Built motion from commit 3f43442b.|2.5.33
authorAndrea Amorese <andrea.amorese@xenialab.it>
Tue, 21 Dec 2021 10:42:39 +0000 (11:42 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Tue, 21 Dec 2021 10:42:39 +0000 (11:42 +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 d32be19..89608f6 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-12-21T10:22:00.419Z",
+    "time": "2021-12-21T10:34:01.397Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index f4392f0..caa81c5 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-12-21T10:22:00.419Z",
+    "time": "2021-12-21T10:34:01.397Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 8090ed3..f12b03b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ae=['VIRTUAL','action','STRING','motionbar','urlForward','browser','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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports'];(function(_0x37f146,_0x4c740d){var _0x54a1ab=function(_0x383998){while(--_0x383998){_0x37f146['push'](_0x37f146['shift']());}};_0x54a1ab(++_0x4c740d);}(_0x40ae,0x8a));var _0xe40a=function(_0x5a8cca,_0x4f5927){_0x5a8cca=_0x5a8cca-0x0;var _0x15403d=_0x40ae[_0x5a8cca];return _0x15403d;};'use strict';var Sequelize=require(_0xe40a('0x0'));module[_0xe40a('0x1')]={'name':{'type':Sequelize[_0xe40a('0x2')],'get':function(_0x4bdef0){return this['getDataValue'](_0xe40a('0x3'));}},'action':{'type':Sequelize[_0xe40a('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xe40a('0x5'),'jscripty',_0xe40a('0x6'),_0xe40a('0x7'),'bot',_0xe40a('0x8')]],'msg':_0xe40a('0x9')}},'comment':_0xe40a('0x9')},'data1':{'type':Sequelize[_0xe40a('0x4')](0x1000),'comment':_0xe40a('0xa')},'data2':{'type':Sequelize[_0xe40a('0x4')](0x1000),'comment':_0xe40a('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xe40a('0xc')},'data4':{'type':Sequelize[_0xe40a('0x4')](0x1000)},'data5':{'type':Sequelize[_0xe40a('0x4')](0x1000)},'data6':{'type':Sequelize[_0xe40a('0x4')]},'data7':{'type':Sequelize[_0xe40a('0xd')]}};
\ No newline at end of file
+var _0xefbd=['contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xefbd,0x198));var _0xdefb=function(_0x2aa16d,_0x412207){_0x2aa16d=_0x2aa16d-0x0;var _0xe34409=_0xefbd[_0x2aa16d];return _0xe34409;};'use strict';var Sequelize=require(_0xdefb('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x20b35d){return this[_0xdefb('0x1')](_0xdefb('0x2'));}},'action':{'type':Sequelize[_0xdefb('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdefb('0x4'),_0xdefb('0x5'),_0xdefb('0x6'),'jscripty',_0xdefb('0x7'),_0xdefb('0x8'),_0xdefb('0x9'),_0xdefb('0xa')]],'msg':_0xdefb('0xb')}},'comment':_0xdefb('0xb')},'data1':{'type':Sequelize[_0xdefb('0x3')](0x1000),'comment':_0xdefb('0xc')},'data2':{'type':Sequelize[_0xdefb('0x3')](0x1000),'comment':_0xdefb('0xd')},'data3':{'type':Sequelize[_0xdefb('0x3')](0x1000),'comment':_0xdefb('0xe')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xdefb('0x3')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index f32c29e..10f77f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1127=['Content-Range','apply','reject','update','destroy','then','end','error','stack','name','body','Action','find','catch','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1127,0xf8));var _0x7112=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0x1127[_0x42ab91];return _0x259d35;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7112('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7112('0x1'));var BPromise=require(_0x7112('0x2'));var Mustache=require(_0x7112('0x3'));var util=require(_0x7112('0x4'));var path=require(_0x7112('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7112('0x6'));var _=require(_0x7112('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7112('0x8'));var deskjs=require(_0x7112('0x9'));var toCsv=require(_0x7112('0xa'));var querystring=require(_0x7112('0xb'));var Papa=require(_0x7112('0xc'));var Redis=require('ioredis');var authService=require(_0x7112('0xd'));var qs=require(_0x7112('0xe'));var as=require(_0x7112('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7112('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7112('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44cef0,_0x51ac90){_0x51ac90=_0x51ac90||0xcc;return function(_0x367edb){if(_0x367edb){return _0x44cef0[_0x7112('0x12')](_0x51ac90);}return _0x44cef0[_0x7112('0x13')](_0x51ac90)['end']();};}function respondWithResult(_0x2516f5,_0x3b506e){_0x3b506e=_0x3b506e||0xc8;return function(_0x5e806a){if(_0x5e806a){return _0x2516f5['status'](_0x3b506e)[_0x7112('0x14')](_0x5e806a);}};}function respondWithFilteredResult(_0x242c2b,_0x57e881){return function(_0x3342c1){if(_0x3342c1){var _0x441eef=typeof _0x57e881[_0x7112('0x15')]===_0x7112('0x16')&&typeof _0x57e881[_0x7112('0x17')]===_0x7112('0x16');var _0xb624c4=_0x3342c1['count'];var _0x4c88d3=_0x441eef?0x0:_0x57e881[_0x7112('0x15')];var _0x4e7a85=_0x441eef?_0x3342c1[_0x7112('0x18')]:_0x57e881['offset']+_0x57e881[_0x7112('0x17')];var _0x57710f;if(_0x4e7a85>=_0xb624c4){_0x4e7a85=_0xb624c4;_0x57710f=0xc8;}else{_0x57710f=0xce;}_0x242c2b[_0x7112('0x13')](_0x57710f);return _0x242c2b['set'](_0x7112('0x19'),_0x4c88d3+'-'+_0x4e7a85+'/'+_0xb624c4)[_0x7112('0x14')](_0x3342c1);}return null;};}function patchUpdates(_0x540420){return function(_0x2dbddf){try{jsonpatch[_0x7112('0x1a')](_0x2dbddf,_0x540420,!![]);}catch(_0x65efdd){return BPromise[_0x7112('0x1b')](_0x65efdd);}return _0x2dbddf['save']();};}function saveUpdates(_0x1e786e,_0x4ad2be){return function(_0x18896c){if(_0x18896c){return _0x18896c[_0x7112('0x1c')](_0x1e786e)['then'](function(_0x34e8e9){return _0x34e8e9;});}return null;};}function removeEntity(_0x4a5284,_0x162b4a){return function(_0x207821){if(_0x207821){return _0x207821[_0x7112('0x1d')]()[_0x7112('0x1e')](function(){_0x4a5284[_0x7112('0x13')](0xcc)[_0x7112('0x1f')]();});}};}function handleEntityNotFound(_0x15693b,_0x54a004){return function(_0x57c0ef){if(!_0x57c0ef){_0x15693b['sendStatus'](0x194);}return _0x57c0ef;};}function handleError(_0x566e4d,_0x46630a){_0x46630a=_0x46630a||0x1f4;return function(_0x2b6627){logger[_0x7112('0x20')](_0x2b6627[_0x7112('0x21')]);if(_0x2b6627[_0x7112('0x22')]){delete _0x2b6627[_0x7112('0x22')];}_0x566e4d[_0x7112('0x13')](_0x46630a)['send'](_0x2b6627);};}exports[_0x7112('0x1c')]=function(_0x560695,_0x5d1266){if(_0x560695[_0x7112('0x23')]['id']){delete _0x560695['body']['id'];}return db[_0x7112('0x24')][_0x7112('0x25')]({'where':{'id':_0x560695['params']['id']}})['then'](handleEntityNotFound(_0x5d1266,null))['then'](saveUpdates(_0x560695[_0x7112('0x23')],null))[_0x7112('0x1e')](respondWithResult(_0x5d1266,null))[_0x7112('0x26')](handleError(_0x5d1266,null));};exports[_0x7112('0x1d')]=function(_0x32570e,_0x310678){return db[_0x7112('0x24')]['find']({'where':{'id':_0x32570e['params']['id']}})[_0x7112('0x1e')](handleEntityNotFound(_0x310678,null))['then'](removeEntity(_0x310678,null))['catch'](handleError(_0x310678,null));};
\ No newline at end of file
+var _0xdb6f=['body','Action','catch','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0xdb6f,0xc5));var _0xfdb6=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xdb6f[_0x313c96];return _0x522f53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdb6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdb6('0x1'));var rp=require(_0xfdb6('0x2'));var moment=require(_0xfdb6('0x3'));var BPromise=require(_0xfdb6('0x4'));var Mustache=require(_0xfdb6('0x5'));var util=require(_0xfdb6('0x6'));var path=require(_0xfdb6('0x7'));var sox=require(_0xfdb6('0x8'));var csv=require(_0xfdb6('0x9'));var ejs=require(_0xfdb6('0xa'));var fs=require('fs');var fs_extra=require(_0xfdb6('0xb'));var _=require('lodash');var squel=require(_0xfdb6('0xc'));var crypto=require(_0xfdb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfdb6('0xe'));var toCsv=require(_0xfdb6('0x9'));var querystring=require('querystring');var Papa=require(_0xfdb6('0xf'));var Redis=require(_0xfdb6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfdb6('0x11'));var as=require(_0xfdb6('0x12'));var hardwareService=require(_0xfdb6('0x13'));var logger=require('../../config/logger')(_0xfdb6('0x14'));var utils=require(_0xfdb6('0x15'));var config=require(_0xfdb6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdb6('0x17'))['db'];function respondWithStatusCode(_0x5bbfbf,_0x27ca89){_0x27ca89=_0x27ca89||0xcc;return function(_0x393f04){if(_0x393f04){return _0x5bbfbf[_0xfdb6('0x18')](_0x27ca89);}return _0x5bbfbf['status'](_0x27ca89)['end']();};}function respondWithResult(_0x45e37,_0x54553c){_0x54553c=_0x54553c||0xc8;return function(_0x353a16){if(_0x353a16){return _0x45e37['status'](_0x54553c)[_0xfdb6('0x19')](_0x353a16);}};}function respondWithFilteredResult(_0x413fcd,_0x1c41c9){return function(_0x5a8649){if(_0x5a8649){var _0x2acaf2=typeof _0x1c41c9[_0xfdb6('0x1a')]===_0xfdb6('0x1b')&&typeof _0x1c41c9[_0xfdb6('0x1c')]==='undefined';var _0x2f6f5d=_0x5a8649['count'];var _0x18b523=_0x2acaf2?0x0:_0x1c41c9[_0xfdb6('0x1a')];var _0x220910=_0x2acaf2?_0x5a8649[_0xfdb6('0x1d')]:_0x1c41c9[_0xfdb6('0x1a')]+_0x1c41c9[_0xfdb6('0x1c')];var _0x4fe479;if(_0x220910>=_0x2f6f5d){_0x220910=_0x2f6f5d;_0x4fe479=0xc8;}else{_0x4fe479=0xce;}_0x413fcd[_0xfdb6('0x1e')](_0x4fe479);return _0x413fcd[_0xfdb6('0x1f')](_0xfdb6('0x20'),_0x18b523+'-'+_0x220910+'/'+_0x2f6f5d)[_0xfdb6('0x19')](_0x5a8649);}return null;};}function patchUpdates(_0x7506da){return function(_0x3d9b92){try{jsonpatch[_0xfdb6('0x21')](_0x3d9b92,_0x7506da,!![]);}catch(_0x420855){return BPromise[_0xfdb6('0x22')](_0x420855);}return _0x3d9b92[_0xfdb6('0x23')]();};}function saveUpdates(_0x6611f9,_0x3e86aa){return function(_0x16e63c){if(_0x16e63c){return _0x16e63c[_0xfdb6('0x24')](_0x6611f9)[_0xfdb6('0x25')](function(_0x376af0){return _0x376af0;});}return null;};}function removeEntity(_0x518357,_0x260171){return function(_0x2602f8){if(_0x2602f8){return _0x2602f8[_0xfdb6('0x26')]()[_0xfdb6('0x25')](function(){_0x518357['status'](0xcc)[_0xfdb6('0x27')]();});}};}function handleEntityNotFound(_0x4689ca,_0x40f4f3){return function(_0x511116){if(!_0x511116){_0x4689ca[_0xfdb6('0x18')](0x194);}return _0x511116;};}function handleError(_0x416a01,_0x1018a1){_0x1018a1=_0x1018a1||0x1f4;return function(_0x1b86e6){logger['error'](_0x1b86e6[_0xfdb6('0x28')]);if(_0x1b86e6[_0xfdb6('0x29')]){delete _0x1b86e6[_0xfdb6('0x29')];}_0x416a01[_0xfdb6('0x1e')](_0x1018a1)[_0xfdb6('0x2a')](_0x1b86e6);};}exports[_0xfdb6('0x24')]=function(_0x3800b1,_0x4bed2f){if(_0x3800b1[_0xfdb6('0x2b')]['id']){delete _0x3800b1[_0xfdb6('0x2b')]['id'];}return db[_0xfdb6('0x2c')]['find']({'where':{'id':_0x3800b1['params']['id']}})[_0xfdb6('0x25')](handleEntityNotFound(_0x4bed2f,null))[_0xfdb6('0x25')](saveUpdates(_0x3800b1['body'],null))[_0xfdb6('0x25')](respondWithResult(_0x4bed2f,null))[_0xfdb6('0x2d')](handleError(_0x4bed2f,null));};exports[_0xfdb6('0x26')]=function(_0x152c77,_0x2812be){return db[_0xfdb6('0x2c')][_0xfdb6('0x2e')]({'where':{'id':_0x152c77[_0xfdb6('0x2f')]['id']}})[_0xfdb6('0x25')](handleEntityNotFound(_0x2812be,null))[_0xfdb6('0x25')](removeEntity(_0x2812be,null))[_0xfdb6('0x2d')](handleError(_0x2812be,null));};
\ No newline at end of file
index ca35cd8..bd8faa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc1=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util'];(function(_0x32f584,_0x530f59){var _0x41e1f7=function(_0x399985){while(--_0x399985){_0x32f584['push'](_0x32f584['shift']());}};_0x41e1f7(++_0x530f59);}(_0x1cc1,0x9a));var _0x11cc=function(_0x3068ac,_0x1b58bd){_0x3068ac=_0x3068ac-0x0;var _0x4500f0=_0x1cc1[_0x3068ac];return _0x4500f0;};'use strict';var _=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var logger=require(_0x11cc('0x2'))(_0x11cc('0x3'));var moment=require('moment');var BPromise=require(_0x11cc('0x4'));var rp=require(_0x11cc('0x5'));var fs=require('fs');var path=require(_0x11cc('0x6'));var rimraf=require(_0x11cc('0x7'));var config=require(_0x11cc('0x8'));var attributes=require(_0x11cc('0x9'));module[_0x11cc('0xa')]=function(_0x22eab8,_0x16cb52){return _0x22eab8[_0x11cc('0xb')]('Action',attributes,{'tableName':_0x11cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8098=['lodash','util','../../config/logger','api','bluebird','path','exports','define','Action','tools_actions'];(function(_0x302b5e,_0x564a8e){var _0x523ab7=function(_0x6aec8f){while(--_0x6aec8f){_0x302b5e['push'](_0x302b5e['shift']());}};_0x523ab7(++_0x564a8e);}(_0x8098,0x6e));var _0x8809=function(_0x490911,_0x35100c){_0x490911=_0x490911-0x0;var _0xa27149=_0x8098[_0x490911];return _0xa27149;};'use strict';var _=require(_0x8809('0x0'));var util=require(_0x8809('0x1'));var logger=require(_0x8809('0x2'))(_0x8809('0x3'));var moment=require('moment');var BPromise=require(_0x8809('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8809('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x8809('0x6')]=function(_0x9fa5f3,_0x11f861){return _0x9fa5f3[_0x8809('0x7')](_0x8809('0x8'),attributes,{'tableName':_0x8809('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26e5827..14fc127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x36c31b,_0x54514d){var _0x51a830=function(_0x4a348e){while(--_0x4a348e){_0x36c31b['push'](_0x36c31b['shift']());}};_0x51a830(++_0x54514d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x5fc3[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
index 9a32edd..7c7ee1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f9=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x70f9,0xa3));var _0x970f=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x70f9[_0x14d250];return _0xb991d8;};'use strict';var multer=require(_0x970f('0x0'));var util=require('util');var path=require(_0x970f('0x1'));var timeout=require(_0x970f('0x2'));var express=require(_0x970f('0x3'));var router=express[_0x970f('0x4')]();var fs_extra=require(_0x970f('0x5'));var auth=require(_0x970f('0x6'));var interaction=require(_0x970f('0x7'));var config=require(_0x970f('0x8'));var controller=require(_0x970f('0x9'));router['put'](_0x970f('0xa'),auth[_0x970f('0xb')](),controller[_0x970f('0xc')]);router[_0x970f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x970f('0xe')]);module[_0x970f('0xf')]=router;
\ No newline at end of file
+var _0x7b15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7b15,0x7a));var _0x57b1=function(_0x530b44,_0x3fef92){_0x530b44=_0x530b44-0x0;var _0x411fde=_0x7b15[_0x530b44];return _0x411fde;};'use strict';var multer=require(_0x57b1('0x0'));var util=require(_0x57b1('0x1'));var path=require('path');var timeout=require(_0x57b1('0x2'));var express=require(_0x57b1('0x3'));var router=express[_0x57b1('0x4')]();var fs_extra=require(_0x57b1('0x5'));var auth=require(_0x57b1('0x6'));var interaction=require(_0x57b1('0x7'));var config=require(_0x57b1('0x8'));var controller=require(_0x57b1('0x9'));router[_0x57b1('0xa')](_0x57b1('0xb'),auth[_0x57b1('0xc')](),controller[_0x57b1('0xd')]);router[_0x57b1('0xe')](_0x57b1('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x57b1('0xf')]=router;
\ No newline at end of file
index 762b241..46cf1ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x56b8b3,_0x18e098){var _0x19ce3=function(_0x322769){while(--_0x322769){_0x56b8b3['push'](_0x56b8b3['shift']());}};_0x19ce3(++_0x18e098);}(_0x98a8,0x12c));var _0x898a=function(_0x1c8e46,_0x364669){_0x1c8e46=_0x1c8e46-0x0;var _0x1a4022=_0x98a8[_0x1c8e46];return _0x1a4022;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x687b,0x14a));var _0xb687=function(_0x14ead9,_0x410058){_0x14ead9=_0x14ead9-0x0;var _0x17bfe6=_0x687b[_0x14ead9];return _0x17bfe6;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
index 03507fe..d091625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2785=['map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','autoAssociation','params','join','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','function','replace','format','groupBy','alias','joins','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','from','metric','orderBy','DESC','parse','%s.%s\x20=\x20%s.%s','web','fullPath','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','output','savename','countTable','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','UserProfileResource','destroy','name','send','index'];(function(_0x50726f,_0x417419){var _0x125e81=function(_0x1ce0db){while(--_0x1ce0db){_0x50726f['push'](_0x50726f['shift']());}};_0x125e81(++_0x417419);}(_0x2785,0x1be));var _0x5278=function(_0x45bda8,_0x1dcede){_0x45bda8=_0x45bda8-0x0;var _0x267dde=_0x2785[_0x45bda8];return _0x267dde;};'use strict';var emlformat=require(_0x5278('0x0'));var rimraf=require(_0x5278('0x1'));var zipdir=require(_0x5278('0x2'));var jsonpatch=require(_0x5278('0x3'));var rp=require(_0x5278('0x4'));var moment=require('moment');var BPromise=require(_0x5278('0x5'));var Mustache=require(_0x5278('0x6'));var util=require(_0x5278('0x7'));var path=require(_0x5278('0x8'));var sox=require(_0x5278('0x9'));var csv=require(_0x5278('0xa'));var ejs=require(_0x5278('0xb'));var fs=require('fs');var fs_extra=require(_0x5278('0xc'));var _=require(_0x5278('0xd'));var squel=require('squel');var crypto=require(_0x5278('0xe'));var jsforce=require(_0x5278('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5278('0xa'));var querystring=require(_0x5278('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5278('0x11'));var qs=require(_0x5278('0x12'));var as=require(_0x5278('0x13'));var hardwareService=require(_0x5278('0x14'));var logger=require(_0x5278('0x15'))(_0x5278('0x16'));var utils=require(_0x5278('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5278('0x18'));var db=require(_0x5278('0x19'))['db'];var dbH=require(_0x5278('0x19'))[_0x5278('0x1a')];function respondWithStatusCode(_0x401fc4,_0x3d5dfd){_0x3d5dfd=_0x3d5dfd||0xcc;return function(_0x124e3c){if(_0x124e3c){return _0x401fc4[_0x5278('0x1b')](_0x3d5dfd);}return _0x401fc4[_0x5278('0x1c')](_0x3d5dfd)[_0x5278('0x1d')]();};}function respondWithResult(_0x43c537,_0x50e1d0){_0x50e1d0=_0x50e1d0||0xc8;return function(_0x10e907){if(_0x10e907){return _0x43c537[_0x5278('0x1c')](_0x50e1d0)[_0x5278('0x1e')](_0x10e907);}};}function respondWithFilteredResult(_0x3c3bad,_0x32c8f3){return function(_0x205ba7){if(_0x205ba7){var _0x568052=typeof _0x32c8f3['offset']===_0x5278('0x1f')&&typeof _0x32c8f3[_0x5278('0x20')]===_0x5278('0x1f');var _0x5749cd=_0x205ba7['count'];var _0x5d0eb9=_0x568052?0x0:_0x32c8f3['offset'];var _0x5302bc=_0x568052?_0x205ba7[_0x5278('0x21')]:_0x32c8f3[_0x5278('0x22')]+_0x32c8f3[_0x5278('0x20')];var _0x1365c1;if(_0x5302bc>=_0x5749cd){_0x5302bc=_0x5749cd;_0x1365c1=0xc8;}else{_0x1365c1=0xce;}_0x3c3bad[_0x5278('0x1c')](_0x1365c1);return _0x3c3bad[_0x5278('0x23')](_0x5278('0x24'),_0x5d0eb9+'-'+_0x5302bc+'/'+_0x5749cd)[_0x5278('0x1e')](_0x205ba7);}return null;};}function patchUpdates(_0x3abc04){return function(_0x2bfb7d){try{jsonpatch[_0x5278('0x25')](_0x2bfb7d,_0x3abc04,!![]);}catch(_0x5d8e75){return BPromise[_0x5278('0x26')](_0x5d8e75);}return _0x2bfb7d['save']();};}function saveUpdates(_0x290968,_0xc5d392){return function(_0x591840){if(_0x591840){return _0x591840[_0x5278('0x27')](_0x290968)[_0x5278('0x28')](function(_0x3a4a9b){return _0x3a4a9b;});}return null;};}function removeEntity(_0x498f22,_0x5cb2d0){return function(_0xfab662){if(_0xfab662){return _0xfab662['destroy']()['then'](function(){var _0x110491=_0xfab662['get']({'plain':!![]});var _0x2981c3='CustomReports';return db[_0x5278('0x29')][_0x5278('0x2a')]({'where':{'type':_0x2981c3,'resourceId':_0x110491['id']}})[_0x5278('0x28')](function(){return _0xfab662;});})['then'](function(){_0x498f22[_0x5278('0x1c')](0xcc)[_0x5278('0x1d')]();});}};}function handleEntityNotFound(_0x242bbd,_0x38673b){return function(_0x4399da){if(!_0x4399da){_0x242bbd[_0x5278('0x1b')](0x194);}return _0x4399da;};}function handleError(_0x31bd0e,_0x3119b3){_0x3119b3=_0x3119b3||0x1f4;return function(_0x5f4fa2){logger['error'](_0x5f4fa2['stack']);if(_0x5f4fa2[_0x5278('0x2b')]){delete _0x5f4fa2['name'];}_0x31bd0e['status'](_0x3119b3)[_0x5278('0x2c')](_0x5f4fa2);};}exports[_0x5278('0x2d')]=function(_0x4df62a,_0x700d10){var _0x1bb83b={},_0x43d243={},_0x2c2f4e={'count':0x0,'rows':[]};var _0x172f0c=_[_0x5278('0x2e')](db[_0x5278('0x2f')][_0x5278('0x30')],function(_0x366757){return{'name':_0x366757[_0x5278('0x31')],'type':_0x366757[_0x5278('0x32')]['key']};});_0x43d243['model']=_[_0x5278('0x2e')](_0x172f0c,_0x5278('0x2b'));_0x43d243[_0x5278('0x33')]=_[_0x5278('0x34')](_0x4df62a[_0x5278('0x33')]);_0x43d243['filters']=_[_0x5278('0x35')](_0x43d243['model'],_0x43d243[_0x5278('0x33')]);_0x1bb83b[_0x5278('0x36')]=_[_0x5278('0x35')](_0x43d243[_0x5278('0x37')],qs[_0x5278('0x38')](_0x4df62a[_0x5278('0x33')][_0x5278('0x38')]));_0x1bb83b[_0x5278('0x36')]=_0x1bb83b[_0x5278('0x36')][_0x5278('0x39')]?_0x1bb83b[_0x5278('0x36')]:_0x43d243[_0x5278('0x37')];if(!_0x4df62a[_0x5278('0x33')]['hasOwnProperty'](_0x5278('0x3a'))){_0x1bb83b[_0x5278('0x20')]=qs[_0x5278('0x20')](_0x4df62a[_0x5278('0x33')][_0x5278('0x20')]);_0x1bb83b[_0x5278('0x22')]=qs[_0x5278('0x22')](_0x4df62a[_0x5278('0x33')][_0x5278('0x22')]);}_0x1bb83b[_0x5278('0x3b')]=qs['sort'](_0x4df62a[_0x5278('0x33')][_0x5278('0x3c')]);_0x1bb83b['where']=qs[_0x5278('0x3d')](_[_0x5278('0x3e')](_0x4df62a[_0x5278('0x33')],_0x43d243[_0x5278('0x3d')]),_0x172f0c);if(_0x4df62a[_0x5278('0x33')][_0x5278('0x3f')]){_0x1bb83b[_0x5278('0x40')]=_[_0x5278('0x41')](_0x1bb83b[_0x5278('0x40')],{'$or':_[_0x5278('0x2e')](_0x172f0c,function(_0x19ca5e){if(_0x19ca5e[_0x5278('0x32')]!==_0x5278('0x42')){var _0x3becde={};_0x3becde[_0x19ca5e['name']]={'$like':'%'+_0x4df62a[_0x5278('0x33')][_0x5278('0x3f')]+'%'};return _0x3becde;}})});}_0x1bb83b=_['merge']({},_0x1bb83b,_0x4df62a[_0x5278('0x43')]);var _0x41b562={'where':_0x1bb83b[_0x5278('0x40')]};return db[_0x5278('0x2f')]['count'](_0x41b562)[_0x5278('0x28')](function(_0x5b6e4a){_0x2c2f4e['count']=_0x5b6e4a;if(_0x4df62a['query'][_0x5278('0x44')]){_0x1bb83b[_0x5278('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x1bb83b);})['then'](function(_0x242f22){_0x2c2f4e[_0x5278('0x46')]=_0x242f22;return _0x2c2f4e;})[_0x5278('0x28')](respondWithFilteredResult(_0x700d10,_0x1bb83b))[_0x5278('0x47')](handleError(_0x700d10,null));};exports['show']=function(_0x2c6853,_0x1fbaf7){var _0x1b1223={'raw':![],'where':{'id':_0x2c6853['params']['id']}},_0x288de5={};_0x288de5['model']=_[_0x5278('0x34')](db[_0x5278('0x2f')][_0x5278('0x30')]);_0x288de5[_0x5278('0x33')]=_[_0x5278('0x34')](_0x2c6853[_0x5278('0x33')]);_0x288de5[_0x5278('0x3d')]=_[_0x5278('0x35')](_0x288de5['model'],_0x288de5[_0x5278('0x33')]);_0x1b1223['attributes']=_[_0x5278('0x35')](_0x288de5[_0x5278('0x37')],qs['fields'](_0x2c6853[_0x5278('0x33')][_0x5278('0x38')]));_0x1b1223['attributes']=_0x1b1223[_0x5278('0x36')][_0x5278('0x39')]?_0x1b1223['attributes']:_0x288de5[_0x5278('0x37')];if(_0x2c6853[_0x5278('0x33')][_0x5278('0x44')]){_0x1b1223['include']=[{'all':!![]}];}_0x1b1223=_[_0x5278('0x41')]({},_0x1b1223,_0x2c6853[_0x5278('0x43')]);return db[_0x5278('0x2f')][_0x5278('0x48')](_0x1b1223)[_0x5278('0x28')](handleEntityNotFound(_0x1fbaf7,null))[_0x5278('0x28')](respondWithResult(_0x1fbaf7,null))[_0x5278('0x47')](handleError(_0x1fbaf7,null));};exports[_0x5278('0x49')]=function(_0x57ddee,_0x1a7727){return db[_0x5278('0x2f')][_0x5278('0x49')](_0x57ddee[_0x5278('0x4a')],{})[_0x5278('0x28')](function(_0x324c6e){var _0x330ca0=_0x57ddee[_0x5278('0x4b')]['get']({'plain':!![]});if(!_0x330ca0)throw new Error(_0x5278('0x4c'));if(_0x330ca0[_0x5278('0x4d')]===_0x5278('0x4b')){var _0x5dba67=_0x324c6e[_0x5278('0x4e')]({'plain':!![]});var _0x1247b9=_0x5278('0x4f');return db[_0x5278('0x50')]['find']({'where':{'name':_0x1247b9,'userProfileId':_0x330ca0['userProfileId']},'raw':!![]})[_0x5278('0x28')](function(_0x3b494d){if(_0x3b494d&&_0x3b494d[_0x5278('0x51')]===0x0){return db[_0x5278('0x29')][_0x5278('0x49')]({'name':_0x5dba67[_0x5278('0x2b')],'resourceId':_0x5dba67['id'],'type':'CustomReports','sectionId':_0x3b494d['id']},{})[_0x5278('0x28')](function(){return _0x324c6e;});}else{return _0x324c6e;}})[_0x5278('0x47')](function(_0x4a94a2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a94a2);throw _0x4a94a2;});}return _0x324c6e;})[_0x5278('0x28')](respondWithResult(_0x1a7727,0xc9))[_0x5278('0x47')](handleError(_0x1a7727,null));};exports[_0x5278('0x27')]=function(_0x34fc7c,_0x245e2c){if(_0x34fc7c[_0x5278('0x4a')]['id']){delete _0x34fc7c['body']['id'];}return db[_0x5278('0x2f')][_0x5278('0x48')]({'where':{'id':_0x34fc7c[_0x5278('0x52')]['id']}})[_0x5278('0x28')](handleEntityNotFound(_0x245e2c,null))['then'](saveUpdates(_0x34fc7c[_0x5278('0x4a')],null))[_0x5278('0x28')](respondWithResult(_0x245e2c,null))[_0x5278('0x47')](handleError(_0x245e2c,null));};exports[_0x5278('0x2a')]=function(_0x44cac5,_0x34e11d){return db[_0x5278('0x2f')][_0x5278('0x48')]({'where':{'id':_0x44cac5[_0x5278('0x52')]['id']}})[_0x5278('0x28')](handleEntityNotFound(_0x34e11d,null))[_0x5278('0x28')](removeEntity(_0x34e11d,null))[_0x5278('0x47')](handleError(_0x34e11d,null));};exports['preview']=function(_0x5b5f8c,_0x58df6d){var _0x31e585=0xa;var _0x55d346=[_0x5278('0x53'),_0x5278('0x54'),_0x5278('0x55'),_0x5278('0x56')];var _0x54e5fe={'SUM':'SUM(%s)','COUNT':_0x5278('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5278('0x58'),'AVG':_0x5278('0x59'),'GROUP_CONCAT':_0x5278('0x5a'),'GROUP_CONCAT ASC':_0x5278('0x5b'),'GROUP_CONCAT DESC':_0x5278('0x5c')};var _0x342c42={'SEC_TO_TIME':_0x5278('0x5d'),'DATE':_0x5278('0x5e'),'HOUR':_0x5278('0x5f'),'ROUND':_0x5278('0x60'),'UNIX_TIMESTAMP':_0x5278('0x61')};var _0x8eb03f=function(_0x511b65){return!_['includes']([_0x5278('0x62'),'IS\x20NOT\x20NULL',_0x5278('0x63'),_0x5278('0x64')],_0x511b65);};var _0x170fea=function(_0x3f225d){if(!_0x3f225d||!_0x3f225d[_0x5278('0x65')]['length']){return'';}for(var _0x1a2893='(',_0x4f8111=0x0;_0x4f8111<_0x3f225d[_0x5278('0x65')][_0x5278('0x39')];_0x4f8111+=0x1){_0x4f8111>0x0&&(_0x1a2893+='\x20'+_0x3f225d[_0x5278('0x66')]+'\x20');_0x1a2893+=_0x3f225d[_0x5278('0x65')][_0x4f8111][_0x5278('0x67')]?_0x170fea(_0x3f225d['rules'][_0x4f8111][_0x5278('0x67')]):_0x3f225d[_0x5278('0x65')][_0x4f8111][_0x5278('0x68')]+'\x20'+_0x3f225d[_0x5278('0x65')][_0x4f8111][_0x5278('0x69')]+(_0x8eb03f(_0x3f225d[_0x5278('0x65')][_0x4f8111][_0x5278('0x69')])?'\x20'+_0x3f225d['rules'][_0x4f8111][_0x5278('0x6a')]:'');}return _0x1a2893+')';};var _0x15f1f1={'where':{'id':_0x5b5f8c[_0x5278('0x52')]['id']}},_0x1ae0e2,_0x524ad1,_0x2273cc,_0x45bc76,_0x644b11;_0x15f1f1=_[_0x5278('0x41')]({},_0x15f1f1,_0x5b5f8c[_0x5278('0x43')]);return db[_0x5278('0x2f')][_0x5278('0x48')](_0x15f1f1)[_0x5278('0x28')](function(_0xf23faf){if(_0xf23faf){_0x1ae0e2=_0xf23faf;return _0xf23faf[_0x5278('0x6b')]();}return null;})[_0x5278('0x28')](function(_0x34d8ff){if(_0x34d8ff){if(!_0x34d8ff['length']){throw new db[(_0x5278('0x6c'))]['ValidationErrorItem'](_0x5278('0x6d'),0x193);}_0x524ad1=_0x34d8ff;return db[_0x5278('0x6e')][_0x5278('0x6f')]({'raw':!![]});}return null;})[_0x5278('0x28')](function(_0x216b9e){if(_0x216b9e){_0x2273cc=_[_0x5278('0x70')](_0x216b9e,'id');var _0x42dc05;var _0x1d1e5b=squel[_0x5278('0x71')]();_0x1d1e5b['from'](_0x1ae0e2[_0x5278('0x72')]);for(var _0x2308e8=0x0;_0x2308e8<_0x524ad1[_0x5278('0x39')];_0x2308e8+=0x1){_0x42dc05=_0x524ad1[_0x2308e8][_0x5278('0x73')]?_0x2273cc[_0x524ad1[_0x2308e8][_0x5278('0x73')]]['metric']:_0x524ad1[_0x2308e8][_0x5278('0x68')];_0x42dc05=_0x524ad1[_0x2308e8][_0x5278('0x74')]?_[_0x5278('0x75')](_0x54e5fe[_0x524ad1[_0x2308e8][_0x5278('0x74')]],'%s',_0x42dc05):_0x42dc05;_0x42dc05=_0x524ad1[_0x2308e8][_0x5278('0x76')]?_['replace'](_0x342c42[_0x524ad1[_0x2308e8][_0x5278('0x76')]],'%s',_0x42dc05):_0x42dc05;if(_0x524ad1[_0x2308e8][_0x5278('0x77')]){_0x1d1e5b[_0x5278('0x67')](_0x42dc05);}_0x524ad1[_0x2308e8]['orderBy']&&_0x1d1e5b[_0x5278('0x3b')](_0x42dc05,_0x524ad1[_0x2308e8]['orderBy']==='DESC'?![]:!![]);_0x1d1e5b[_0x5278('0x68')](_0x42dc05,_0x524ad1[_0x2308e8][_0x5278('0x78')]||_0x42dc05);}if(_0x1ae0e2[_0x5278('0x79')]){_0x1ae0e2[_0x5278('0x79')]=JSON['parse'](_0x1ae0e2[_0x5278('0x79')]);for(var _0xaf876c=0x0;_0xaf876c<_0x1ae0e2[_0x5278('0x79')][_0x5278('0x39')];_0xaf876c+=0x1){if(_0x1ae0e2['joins'][_0xaf876c][_0x5278('0x32')]&&_[_0x5278('0x7a')](_0x55d346,_0x1ae0e2[_0x5278('0x79')][_0xaf876c][_0x5278('0x32')])&&_0x1ae0e2['joins'][_0xaf876c][_0x5278('0x7b')]&&_0x1ae0e2['joins'][_0xaf876c][_0x5278('0x7c')]&&_0x1ae0e2[_0x5278('0x79')][_0xaf876c]['foreignKey']){_0x1d1e5b[_0x1ae0e2[_0x5278('0x79')][_0xaf876c][_0x5278('0x32')]](_0x1ae0e2['joins'][_0xaf876c]['foreignTable'],null,util[_0x5278('0x76')]('%s.%s\x20=\x20%s.%s',_0x1ae0e2[_0x5278('0x72')],_0x1ae0e2[_0x5278('0x79')][_0xaf876c][_0x5278('0x7b')],_0x1ae0e2[_0x5278('0x79')][_0xaf876c][_0x5278('0x7c')],_0x1ae0e2[_0x5278('0x79')][_0xaf876c][_0x5278('0x7d')]));}}}if(_0x1ae0e2[_0x5278('0x7e')]){_0x1ae0e2[_0x5278('0x7e')]=JSON['parse'](_0x1ae0e2[_0x5278('0x7e')]);_0x1d1e5b[_0x5278('0x40')](_0x170fea(_0x1ae0e2['conditions'][_0x5278('0x67')]));}_0x644b11=_0x1d1e5b[_0x5278('0x7f')]();_0x1d1e5b[_0x5278('0x20')](_0x31e585);_0x1d1e5b[_0x5278('0x22')](0x0);logger[_0x5278('0x80')](_0x5278('0x81'),_0x1d1e5b['toString']());return dbH[_0x5278('0x82')][_0x5278('0x33')](_0x1d1e5b[_0x5278('0x83')](),{'type':dbH[_0x5278('0x82')][_0x5278('0x84')][_0x5278('0x85')]});}})[_0x5278('0x28')](respondWithResult(_0x58df6d,null))['catch'](handleError(_0x58df6d,null));};function runReport(_0x17b1e9,_0x4ce653,_0x2491b5){var _0x4310a2=_0x4ce653[_0x5278('0x2b')];var _0x424473=0xa;var _0x2c020e=[_0x5278('0x53'),_0x5278('0x54'),'right_join','cross_join'];var _0x5a6de3={'SUM':_0x5278('0x86'),'COUNT':_0x5278('0x57'),'COUNT DISTINCT':_0x5278('0x87'),'MAX':_0x5278('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5278('0x5a'),'GROUP_CONCAT ASC':_0x5278('0x5b'),'GROUP_CONCAT DESC':_0x5278('0x5c')};var _0x3761a0={'SEC_TO_TIME':_0x5278('0x5d'),'DATE':_0x5278('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x5278('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2f75e5=function(_0x487c60){return!_[_0x5278('0x7a')]([_0x5278('0x62'),_0x5278('0x89'),'IS\x20EMPTY',_0x5278('0x64')],_0x487c60);};var _0x31e93d=function(_0x446998){if(!_0x446998||!_0x446998[_0x5278('0x65')][_0x5278('0x39')]){return'';}for(var _0x59c3b2='(',_0x5cb027=0x0;_0x5cb027<_0x446998[_0x5278('0x65')][_0x5278('0x39')];_0x5cb027+=0x1){_0x5cb027>0x0&&(_0x59c3b2+='\x20'+_0x446998[_0x5278('0x66')]+'\x20');_0x59c3b2+=_0x446998[_0x5278('0x65')][_0x5cb027]['group']?_0x31e93d(_0x446998['rules'][_0x5cb027]['group']):_0x446998['rules'][_0x5cb027][_0x5278('0x68')]+'\x20'+_0x446998[_0x5278('0x65')][_0x5cb027][_0x5278('0x69')]+(_0x2f75e5(_0x446998['rules'][_0x5cb027]['condition'])?'\x20'+_0x446998['rules'][_0x5cb027]['value']:'');}return _0x59c3b2+')';};var _0x926f01={'where':{'id':_0x17b1e9['id']}},_0x4ce0d5,_0x313e4e,_0x309cbc,_0x498165,_0x3cdfbe;_0x926f01=_[_0x5278('0x41')]({},_0x926f01,_0x2491b5);return db['AnalyticCustomReport'][_0x5278('0x48')](_0x926f01)[_0x5278('0x28')](function(_0x18ff3e){if(_0x18ff3e){_0x4ce0d5=_0x18ff3e;return _0x18ff3e[_0x5278('0x6b')]();}return null;})[_0x5278('0x28')](function(_0x310814){if(_0x310814){if(!_0x310814[_0x5278('0x39')]){throw new db[(_0x5278('0x6c'))][(_0x5278('0x8a'))](_0x5278('0x6d'),0x193);}_0x313e4e=_0x310814;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5278('0x28')](function(_0x18b50a){if(_0x18b50a){_0x309cbc=_[_0x5278('0x70')](_0x18b50a,'id');var _0x8b3196;var _0x4c05d6=squel[_0x5278('0x71')]();_0x4c05d6[_0x5278('0x8b')](_0x4ce0d5[_0x5278('0x72')]);for(var _0x3eedac=0x0;_0x3eedac<_0x313e4e[_0x5278('0x39')];_0x3eedac+=0x1){_0x8b3196=_0x313e4e[_0x3eedac][_0x5278('0x73')]?_0x309cbc[_0x313e4e[_0x3eedac][_0x5278('0x73')]][_0x5278('0x8c')]:_0x313e4e[_0x3eedac]['field'];_0x8b3196=_0x313e4e[_0x3eedac][_0x5278('0x74')]?_[_0x5278('0x75')](_0x5a6de3[_0x313e4e[_0x3eedac]['function']],'%s',_0x8b3196):_0x8b3196;_0x8b3196=_0x313e4e[_0x3eedac][_0x5278('0x76')]?_[_0x5278('0x75')](_0x3761a0[_0x313e4e[_0x3eedac]['format']],'%s',_0x8b3196):_0x8b3196;if(_0x313e4e[_0x3eedac][_0x5278('0x77')]){_0x4c05d6['group'](_0x8b3196);}_0x313e4e[_0x3eedac][_0x5278('0x8d')]&&_0x4c05d6[_0x5278('0x3b')](_0x8b3196,_0x313e4e[_0x3eedac]['orderBy']===_0x5278('0x8e')?![]:!![]);_0x4c05d6[_0x5278('0x68')](_0x8b3196,_0x313e4e[_0x3eedac][_0x5278('0x78')]||_0x8b3196);}if(_0x4ce0d5[_0x5278('0x79')]){_0x4ce0d5[_0x5278('0x79')]=JSON[_0x5278('0x8f')](_0x4ce0d5[_0x5278('0x79')]);for(var _0x242422=0x0;_0x242422<_0x4ce0d5[_0x5278('0x79')][_0x5278('0x39')];_0x242422+=0x1){if(_0x4ce0d5[_0x5278('0x79')][_0x242422][_0x5278('0x32')]&&_[_0x5278('0x7a')](_0x2c020e,_0x4ce0d5[_0x5278('0x79')][_0x242422]['type'])&&_0x4ce0d5['joins'][_0x242422][_0x5278('0x7b')]&&_0x4ce0d5[_0x5278('0x79')][_0x242422][_0x5278('0x7c')]&&_0x4ce0d5[_0x5278('0x79')][_0x242422][_0x5278('0x7d')]){_0x4c05d6[_0x4ce0d5['joins'][_0x242422]['type']](_0x4ce0d5[_0x5278('0x79')][_0x242422][_0x5278('0x7c')],null,util[_0x5278('0x76')](_0x5278('0x90'),_0x4ce0d5[_0x5278('0x72')],_0x4ce0d5[_0x5278('0x79')][_0x242422]['parentKey'],_0x4ce0d5[_0x5278('0x79')][_0x242422]['foreignTable'],_0x4ce0d5['joins'][_0x242422][_0x5278('0x7d')]));}}}if(_0x4ce0d5[_0x5278('0x7e')]){_0x4ce0d5[_0x5278('0x7e')]=JSON[_0x5278('0x8f')](_0x4ce0d5[_0x5278('0x7e')]);_0x4c05d6[_0x5278('0x40')](_0x31e93d(_0x4ce0d5['conditions'][_0x5278('0x67')]));}_0x3cdfbe=_0x4c05d6[_0x5278('0x7f')]();_0x4c05d6[_0x5278('0x20')](_0x424473);_0x4c05d6[_0x5278('0x22')](0x0);return;}})[_0x5278('0x28')](function(){if(_0x4ce653['output']===_0x5278('0x91')){return null;}var _0x3f1285=_[_0x5278('0x41')](_0x4ce653,{'name':_0x4ce653[_0x5278('0x92')]||_0x4ce653[_0x5278('0x2b')]||_0x4ce0d5[_0x5278('0x2b')],'basename':_0x4310a2,'savename':util[_0x5278('0x76')]('%s-%s.%s',_0x4ce653[_0x5278('0x2b')]||_0x4ce0d5['name'],require(_0x5278('0x93'))[_0x5278('0x94')](0x4),_0x4ce653['output']||'csv'),'reportId':_0x4ce0d5['id'],'reportType':_0x5278('0x95')});return db[_0x5278('0x96')]['create'](_0x3f1285,{'raw':!![]});})[_0x5278('0x28')](function(_0x274ff3){if(_0x4ce0d5['table']===_0x5278('0x97')){_0x3cdfbe['where'](_0x4ce0d5[_0x5278('0x72')]+_0x5278('0x98'),_0x4ce653[_0x5278('0x99')],_0x4ce653['endDate']);}else{_0x3cdfbe['where'](_0x4ce0d5[_0x5278('0x72')]+_0x5278('0x9a'),_0x4ce653['startDate'],_0x4ce653['endDate']);}if(_0x274ff3){logger[_0x5278('0x9b')](_0x5278('0x9c'),_0x3cdfbe['toString']());require(_0x5278('0x9d'))['fork'](path[_0x5278('0x53')](__dirname,_0x5278('0x9e'),_0x274ff3[_0x5278('0x9f')]),[_0x274ff3['id'],_0x3cdfbe['toString'](),path[_0x5278('0x53')](__dirname,'../../files/reports',_0x274ff3[_0x5278('0xa0')]),_0x4310a2]);return _0x274ff3;}else{var _0x11b3d7=squel[_0x5278('0x71')]();_0x11b3d7[_0x5278('0x8b')]('('+_0x3cdfbe[_0x5278('0x83')]()+')',_0x5278('0xa1'));_0x11b3d7[_0x5278('0x68')]('COUNT(*)',_0x5278('0x21'));_0x3cdfbe[_0x5278('0x20')](_0x4ce653[_0x5278('0x20')]||_0x424473);_0x3cdfbe[_0x5278('0x22')](_0x4ce653[_0x5278('0x22')]||0x0);return dbH[_0x5278('0x82')]['query'](_0x11b3d7['toString'](),{'type':dbH['sequelize'][_0x5278('0x84')][_0x5278('0x85')]})['then'](function(_0x2ff57e){if(!_0x2ff57e[_0x5278('0x39')]){_0x498165=0x0;}else{_0x498165=_0x2ff57e[0x0]['count']||0x0;}return dbH[_0x5278('0x82')]['query'](_0x3cdfbe[_0x5278('0x83')](),{'type':dbH[_0x5278('0x82')][_0x5278('0x84')]['SELECT']});})['then'](function(_0x11e3e5){return{'rows':_0x11e3e5||[],'count':_0x498165};});}});}exports[_0x5278('0xa2')]=function(_0x1b5da6,_0x1eda45){return runReport(_0x1b5da6[_0x5278('0x52')],_0x1b5da6['query'],_0x1b5da6[_0x5278('0x43')])[_0x5278('0x28')](respondWithResult(_0x1eda45,null))[_0x5278('0x47')](handleError(_0x1eda45,null));};exports[_0x5278('0xa3')]=runReport;exports[_0x5278('0x33')]=function(_0x4cd47d,_0x314782){var _0x14a475=0xa;var _0x2f2ecb=[_0x5278('0x53'),'left_join',_0x5278('0x55'),_0x5278('0x56')];var _0x83c609={'SUM':'SUM(%s)','COUNT':_0x5278('0x57'),'COUNT DISTINCT':_0x5278('0x87'),'MAX':_0x5278('0x88'),'MIN':_0x5278('0x58'),'AVG':_0x5278('0x59'),'GROUP_CONCAT':_0x5278('0x5a'),'GROUP_CONCAT ASC':_0x5278('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52ed40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5278('0x5f'),'ROUND':_0x5278('0x60'),'UNIX_TIMESTAMP':_0x5278('0x61')};var _0x45bd3d=function(_0x2c42e6){return!_[_0x5278('0x7a')]([_0x5278('0x62'),_0x5278('0x89'),_0x5278('0x63'),_0x5278('0x64')],_0x2c42e6);};var _0x1e572e=function(_0x55d0a0){if(!_0x55d0a0||!_0x55d0a0[_0x5278('0x65')][_0x5278('0x39')]){return'';}for(var _0xf04bf4='(',_0x4b31b8=0x0;_0x4b31b8<_0x55d0a0[_0x5278('0x65')][_0x5278('0x39')];_0x4b31b8+=0x1){_0x4b31b8>0x0&&(_0xf04bf4+='\x20'+_0x55d0a0[_0x5278('0x66')]+'\x20');_0xf04bf4+=_0x55d0a0[_0x5278('0x65')][_0x4b31b8]['group']?_0x1e572e(_0x55d0a0[_0x5278('0x65')][_0x4b31b8][_0x5278('0x67')]):_0x55d0a0[_0x5278('0x65')][_0x4b31b8]['field']+'\x20'+_0x55d0a0[_0x5278('0x65')][_0x4b31b8][_0x5278('0x69')]+(_0x45bd3d(_0x55d0a0[_0x5278('0x65')][_0x4b31b8][_0x5278('0x69')])?'\x20'+_0x55d0a0[_0x5278('0x65')][_0x4b31b8][_0x5278('0x6a')]:'');}return _0xf04bf4+')';};var _0x2e22b3={'where':{'id':_0x4cd47d[_0x5278('0x52')]['id']}},_0x35b07f,_0x9a7d7c,_0x4b4d50,_0x211aea,_0x33e754;_0x2e22b3=_[_0x5278('0x41')]({},_0x2e22b3,_0x4cd47d[_0x5278('0x43')]);return db[_0x5278('0x2f')][_0x5278('0x48')](_0x2e22b3)['then'](function(_0x27f688){if(_0x27f688){_0x35b07f=_0x27f688;return _0x27f688['getFields']();}return null;})[_0x5278('0x28')](function(_0x2571f3){if(_0x2571f3){if(!_0x2571f3[_0x5278('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5278('0x6d'),0x193);}_0x9a7d7c=_0x2571f3;return db[_0x5278('0x6e')][_0x5278('0x6f')]({'raw':!![]});}return null;})['then'](function(_0x17fc27){if(_0x17fc27){_0x4b4d50=_[_0x5278('0x70')](_0x17fc27,'id');var _0x43e6f5;var _0x349ce8=squel['select']();_0x349ce8[_0x5278('0x8b')](_0x35b07f[_0x5278('0x72')]);for(var _0x151555=0x0;_0x151555<_0x9a7d7c[_0x5278('0x39')];_0x151555+=0x1){_0x43e6f5=_0x9a7d7c[_0x151555][_0x5278('0x73')]?_0x4b4d50[_0x9a7d7c[_0x151555][_0x5278('0x73')]][_0x5278('0x8c')]:_0x9a7d7c[_0x151555][_0x5278('0x68')];_0x43e6f5=_0x9a7d7c[_0x151555][_0x5278('0x74')]?_['replace'](_0x83c609[_0x9a7d7c[_0x151555][_0x5278('0x74')]],'%s',_0x43e6f5):_0x43e6f5;_0x43e6f5=_0x9a7d7c[_0x151555][_0x5278('0x76')]?_['replace'](_0x52ed40[_0x9a7d7c[_0x151555][_0x5278('0x76')]],'%s',_0x43e6f5):_0x43e6f5;if(_0x9a7d7c[_0x151555][_0x5278('0x77')]){_0x349ce8[_0x5278('0x67')](_0x43e6f5);}_0x9a7d7c[_0x151555][_0x5278('0x8d')]&&_0x349ce8[_0x5278('0x3b')](_0x43e6f5,_0x9a7d7c[_0x151555][_0x5278('0x8d')]==='DESC'?![]:!![]);_0x349ce8[_0x5278('0x68')](_0x43e6f5,_0x9a7d7c[_0x151555][_0x5278('0x78')]||_0x43e6f5);}if(_0x35b07f['joins']){_0x35b07f[_0x5278('0x79')]=JSON['parse'](_0x35b07f[_0x5278('0x79')]);for(var _0x2146ac=0x0;_0x2146ac<_0x35b07f[_0x5278('0x79')][_0x5278('0x39')];_0x2146ac+=0x1){if(_0x35b07f[_0x5278('0x79')][_0x2146ac][_0x5278('0x32')]&&_[_0x5278('0x7a')](_0x2f2ecb,_0x35b07f['joins'][_0x2146ac][_0x5278('0x32')])&&_0x35b07f['joins'][_0x2146ac][_0x5278('0x7b')]&&_0x35b07f['joins'][_0x2146ac][_0x5278('0x7c')]&&_0x35b07f[_0x5278('0x79')][_0x2146ac][_0x5278('0x7d')]){_0x349ce8[_0x35b07f[_0x5278('0x79')][_0x2146ac][_0x5278('0x32')]](_0x35b07f['joins'][_0x2146ac]['foreignTable'],null,util[_0x5278('0x76')]('%s.%s\x20=\x20%s.%s',_0x35b07f[_0x5278('0x72')],_0x35b07f[_0x5278('0x79')][_0x2146ac][_0x5278('0x7b')],_0x35b07f[_0x5278('0x79')][_0x2146ac][_0x5278('0x7c')],_0x35b07f['joins'][_0x2146ac]['foreignKey']));}}}if(_0x35b07f[_0x5278('0x7e')]){_0x35b07f['conditions']=JSON[_0x5278('0x8f')](_0x35b07f[_0x5278('0x7e')]);_0x349ce8['where'](_0x1e572e(_0x35b07f[_0x5278('0x7e')][_0x5278('0x67')]));}_0x33e754=_0x349ce8[_0x5278('0x7f')]();_0x349ce8[_0x5278('0x20')](_0x14a475);_0x349ce8[_0x5278('0x22')](0x0);logger['debug']('Limited\x20Query:',_0x349ce8[_0x5278('0x83')]());return dbH[_0x5278('0x82')][_0x5278('0x33')](_0x349ce8['toString'](),{'type':dbH[_0x5278('0x82')][_0x5278('0x84')][_0x5278('0x85')]});}})[_0x5278('0x28')](function(){return{'sql':_0x33e754['toString']()};})[_0x5278('0x28')](respondWithResult(_0x314782,null))[_0x5278('0x47')](handleError(_0x314782,null));};
\ No newline at end of file
+var _0x6ac3=['then','sendStatus','error','name','send','index','AnalyticCustomReport','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','destroy','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','params','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','table','web','fullPath','randomstring','output','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','DATE(%s)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','undefined','limit','count','offset','set','apply','reject','save','get','UserProfileResource'];(function(_0x47e07a,_0xbc1f6d){var _0x743f96=function(_0x432baf){while(--_0x432baf){_0x47e07a['push'](_0x47e07a['shift']());}};_0x743f96(++_0xbc1f6d);}(_0x6ac3,0x7e));var _0x36ac=function(_0x138692,_0x529f4f){_0x138692=_0x138692-0x0;var _0x300ee5=_0x6ac3[_0x138692];return _0x300ee5;};'use strict';var emlformat=require(_0x36ac('0x0'));var rimraf=require(_0x36ac('0x1'));var zipdir=require(_0x36ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36ac('0x3'));var moment=require(_0x36ac('0x4'));var BPromise=require(_0x36ac('0x5'));var Mustache=require('mustache');var util=require(_0x36ac('0x6'));var path=require(_0x36ac('0x7'));var sox=require(_0x36ac('0x8'));var csv=require(_0x36ac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36ac('0xa'));var _=require('lodash');var squel=require(_0x36ac('0xb'));var crypto=require(_0x36ac('0xc'));var jsforce=require(_0x36ac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x36ac('0x9'));var querystring=require(_0x36ac('0xe'));var Papa=require('papaparse');var Redis=require(_0x36ac('0xf'));var authService=require(_0x36ac('0x10'));var qs=require(_0x36ac('0x11'));var as=require(_0x36ac('0x12'));var hardwareService=require(_0x36ac('0x13'));var logger=require(_0x36ac('0x14'))(_0x36ac('0x15'));var utils=require(_0x36ac('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x36ac('0x17'));var db=require(_0x36ac('0x18'))['db'];var dbH=require(_0x36ac('0x18'))[_0x36ac('0x19')];function respondWithStatusCode(_0xdf8405,_0x2c7dd0){_0x2c7dd0=_0x2c7dd0||0xcc;return function(_0x26665d){if(_0x26665d){return _0xdf8405['sendStatus'](_0x2c7dd0);}return _0xdf8405[_0x36ac('0x1a')](_0x2c7dd0)[_0x36ac('0x1b')]();};}function respondWithResult(_0x3593f6,_0x2e6446){_0x2e6446=_0x2e6446||0xc8;return function(_0x244ae1){if(_0x244ae1){return _0x3593f6[_0x36ac('0x1a')](_0x2e6446)[_0x36ac('0x1c')](_0x244ae1);}};}function respondWithFilteredResult(_0x29c87d,_0x3465a3){return function(_0x4a6c91){if(_0x4a6c91){var _0x152cd0=typeof _0x3465a3['offset']===_0x36ac('0x1d')&&typeof _0x3465a3[_0x36ac('0x1e')]===_0x36ac('0x1d');var _0x24ed47=_0x4a6c91[_0x36ac('0x1f')];var _0xa28a24=_0x152cd0?0x0:_0x3465a3['offset'];var _0x565116=_0x152cd0?_0x4a6c91[_0x36ac('0x1f')]:_0x3465a3[_0x36ac('0x20')]+_0x3465a3[_0x36ac('0x1e')];var _0x8ce065;if(_0x565116>=_0x24ed47){_0x565116=_0x24ed47;_0x8ce065=0xc8;}else{_0x8ce065=0xce;}_0x29c87d[_0x36ac('0x1a')](_0x8ce065);return _0x29c87d[_0x36ac('0x21')]('Content-Range',_0xa28a24+'-'+_0x565116+'/'+_0x24ed47)['json'](_0x4a6c91);}return null;};}function patchUpdates(_0x51e98c){return function(_0x586c32){try{jsonpatch[_0x36ac('0x22')](_0x586c32,_0x51e98c,!![]);}catch(_0x23f2e4){return BPromise[_0x36ac('0x23')](_0x23f2e4);}return _0x586c32[_0x36ac('0x24')]();};}function saveUpdates(_0x1bd527,_0x532d16){return function(_0x3c122f){if(_0x3c122f){return _0x3c122f['update'](_0x1bd527)['then'](function(_0xc10651){return _0xc10651;});}return null;};}function removeEntity(_0x1d6488,_0x3d78e9){return function(_0x2145cd){if(_0x2145cd){return _0x2145cd['destroy']()['then'](function(){var _0x1bd997=_0x2145cd[_0x36ac('0x25')]({'plain':!![]});var _0x9fa75d='CustomReports';return db[_0x36ac('0x26')]['destroy']({'where':{'type':_0x9fa75d,'resourceId':_0x1bd997['id']}})['then'](function(){return _0x2145cd;});})[_0x36ac('0x27')](function(){_0x1d6488[_0x36ac('0x1a')](0xcc)[_0x36ac('0x1b')]();});}};}function handleEntityNotFound(_0x4cf38a,_0x1823e4){return function(_0x5ea3b3){if(!_0x5ea3b3){_0x4cf38a[_0x36ac('0x28')](0x194);}return _0x5ea3b3;};}function handleError(_0x136369,_0x583bf7){_0x583bf7=_0x583bf7||0x1f4;return function(_0xc64359){logger[_0x36ac('0x29')](_0xc64359['stack']);if(_0xc64359['name']){delete _0xc64359[_0x36ac('0x2a')];}_0x136369[_0x36ac('0x1a')](_0x583bf7)[_0x36ac('0x2b')](_0xc64359);};}exports[_0x36ac('0x2c')]=function(_0x3649fd,_0x1278ec){var _0x158bf0={},_0x388c4e={},_0x137e57={'count':0x0,'rows':[]};var _0xf67824=_['map'](db[_0x36ac('0x2d')][_0x36ac('0x2e')],function(_0x941c72){return{'name':_0x941c72['fieldName'],'type':_0x941c72[_0x36ac('0x2f')][_0x36ac('0x30')]};});_0x388c4e['model']=_[_0x36ac('0x31')](_0xf67824,'name');_0x388c4e[_0x36ac('0x32')]=_[_0x36ac('0x33')](_0x3649fd['query']);_0x388c4e[_0x36ac('0x34')]=_[_0x36ac('0x35')](_0x388c4e['model'],_0x388c4e[_0x36ac('0x32')]);_0x158bf0[_0x36ac('0x36')]=_[_0x36ac('0x35')](_0x388c4e['model'],qs[_0x36ac('0x37')](_0x3649fd['query'][_0x36ac('0x37')]));_0x158bf0['attributes']=_0x158bf0[_0x36ac('0x36')][_0x36ac('0x38')]?_0x158bf0[_0x36ac('0x36')]:_0x388c4e[_0x36ac('0x39')];if(!_0x3649fd['query'][_0x36ac('0x3a')](_0x36ac('0x3b'))){_0x158bf0['limit']=qs[_0x36ac('0x1e')](_0x3649fd[_0x36ac('0x32')][_0x36ac('0x1e')]);_0x158bf0[_0x36ac('0x20')]=qs[_0x36ac('0x20')](_0x3649fd[_0x36ac('0x32')][_0x36ac('0x20')]);}_0x158bf0[_0x36ac('0x3c')]=qs[_0x36ac('0x3d')](_0x3649fd[_0x36ac('0x32')]['sort']);_0x158bf0[_0x36ac('0x3e')]=qs[_0x36ac('0x34')](_[_0x36ac('0x3f')](_0x3649fd[_0x36ac('0x32')],_0x388c4e[_0x36ac('0x34')]),_0xf67824);if(_0x3649fd['query'][_0x36ac('0x40')]){_0x158bf0['where']=_[_0x36ac('0x41')](_0x158bf0['where'],{'$or':_[_0x36ac('0x31')](_0xf67824,function(_0x1c3943){if(_0x1c3943[_0x36ac('0x2f')]!==_0x36ac('0x42')){var _0x57cfe4={};_0x57cfe4[_0x1c3943[_0x36ac('0x2a')]]={'$like':'%'+_0x3649fd['query'][_0x36ac('0x40')]+'%'};return _0x57cfe4;}})});}_0x158bf0=_['merge']({},_0x158bf0,_0x3649fd[_0x36ac('0x43')]);var _0x53dda3={'where':_0x158bf0[_0x36ac('0x3e')]};return db['AnalyticCustomReport'][_0x36ac('0x1f')](_0x53dda3)[_0x36ac('0x27')](function(_0x23ccaa){_0x137e57[_0x36ac('0x1f')]=_0x23ccaa;if(_0x3649fd['query'][_0x36ac('0x44')]){_0x158bf0[_0x36ac('0x45')]=[{'all':!![]}];}return db[_0x36ac('0x2d')]['findAll'](_0x158bf0);})['then'](function(_0x120dff){_0x137e57[_0x36ac('0x46')]=_0x120dff;return _0x137e57;})[_0x36ac('0x27')](respondWithFilteredResult(_0x1278ec,_0x158bf0))['catch'](handleError(_0x1278ec,null));};exports['show']=function(_0x3e47f2,_0x33f37a){var _0x3b8f79={'raw':![],'where':{'id':_0x3e47f2['params']['id']}},_0x22170e={};_0x22170e[_0x36ac('0x39')]=_[_0x36ac('0x33')](db['AnalyticCustomReport']['rawAttributes']);_0x22170e[_0x36ac('0x32')]=_[_0x36ac('0x33')](_0x3e47f2[_0x36ac('0x32')]);_0x22170e[_0x36ac('0x34')]=_[_0x36ac('0x35')](_0x22170e['model'],_0x22170e[_0x36ac('0x32')]);_0x3b8f79[_0x36ac('0x36')]=_[_0x36ac('0x35')](_0x22170e[_0x36ac('0x39')],qs[_0x36ac('0x37')](_0x3e47f2['query']['fields']));_0x3b8f79['attributes']=_0x3b8f79[_0x36ac('0x36')][_0x36ac('0x38')]?_0x3b8f79[_0x36ac('0x36')]:_0x22170e[_0x36ac('0x39')];if(_0x3e47f2[_0x36ac('0x32')][_0x36ac('0x44')]){_0x3b8f79[_0x36ac('0x45')]=[{'all':!![]}];}_0x3b8f79=_[_0x36ac('0x41')]({},_0x3b8f79,_0x3e47f2['options']);return db[_0x36ac('0x2d')][_0x36ac('0x47')](_0x3b8f79)[_0x36ac('0x27')](handleEntityNotFound(_0x33f37a,null))[_0x36ac('0x27')](respondWithResult(_0x33f37a,null))['catch'](handleError(_0x33f37a,null));};exports[_0x36ac('0x48')]=function(_0xb7c33f,_0x520b64){return db[_0x36ac('0x2d')][_0x36ac('0x48')](_0xb7c33f[_0x36ac('0x49')],{})['then'](function(_0x5dbe7b){var _0x1a1413=_0xb7c33f[_0x36ac('0x4a')][_0x36ac('0x25')]({'plain':!![]});if(!_0x1a1413)throw new Error(_0x36ac('0x4b'));if(_0x1a1413[_0x36ac('0x4c')]===_0x36ac('0x4a')){var _0x2144ef=_0x5dbe7b[_0x36ac('0x25')]({'plain':!![]});var _0x1483d7=_0x36ac('0x4d');return db[_0x36ac('0x4e')][_0x36ac('0x47')]({'where':{'name':_0x1483d7,'userProfileId':_0x1a1413[_0x36ac('0x4f')]},'raw':!![]})[_0x36ac('0x27')](function(_0x32a0e9){if(_0x32a0e9&&_0x32a0e9[_0x36ac('0x50')]===0x0){return db[_0x36ac('0x26')]['create']({'name':_0x2144ef[_0x36ac('0x2a')],'resourceId':_0x2144ef['id'],'type':_0x36ac('0x51'),'sectionId':_0x32a0e9['id']},{})[_0x36ac('0x27')](function(){return _0x5dbe7b;});}else{return _0x5dbe7b;}})['catch'](function(_0x3097c8){logger[_0x36ac('0x29')](_0x36ac('0x52'),_0x3097c8);throw _0x3097c8;});}return _0x5dbe7b;})[_0x36ac('0x27')](respondWithResult(_0x520b64,0xc9))[_0x36ac('0x53')](handleError(_0x520b64,null));};exports['update']=function(_0x150bb7,_0x2d9707){if(_0x150bb7['body']['id']){delete _0x150bb7['body']['id'];}return db[_0x36ac('0x2d')][_0x36ac('0x47')]({'where':{'id':_0x150bb7['params']['id']}})['then'](handleEntityNotFound(_0x2d9707,null))[_0x36ac('0x27')](saveUpdates(_0x150bb7[_0x36ac('0x49')],null))[_0x36ac('0x27')](respondWithResult(_0x2d9707,null))[_0x36ac('0x53')](handleError(_0x2d9707,null));};exports[_0x36ac('0x54')]=function(_0x3ba837,_0x1043cd){return db[_0x36ac('0x2d')][_0x36ac('0x47')]({'where':{'id':_0x3ba837['params']['id']}})[_0x36ac('0x27')](handleEntityNotFound(_0x1043cd,null))['then'](removeEntity(_0x1043cd,null))[_0x36ac('0x53')](handleError(_0x1043cd,null));};exports[_0x36ac('0x55')]=function(_0x3df888,_0x2d5fd3){var _0x2072ba=0xa;var _0x2169a4=[_0x36ac('0x56'),_0x36ac('0x57'),_0x36ac('0x58'),_0x36ac('0x59')];var _0x42c789={'SUM':'SUM(%s)','COUNT':_0x36ac('0x5a'),'COUNT DISTINCT':_0x36ac('0x5b'),'MAX':_0x36ac('0x5c'),'MIN':_0x36ac('0x5d'),'AVG':_0x36ac('0x5e'),'GROUP_CONCAT':_0x36ac('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48ff45={'SEC_TO_TIME':_0x36ac('0x60'),'DATE':'DATE(%s)','HOUR':_0x36ac('0x61'),'ROUND':_0x36ac('0x62'),'UNIX_TIMESTAMP':_0x36ac('0x63')};var _0x400160=function(_0x8aa178){return!_[_0x36ac('0x64')]([_0x36ac('0x65'),_0x36ac('0x66'),_0x36ac('0x67'),'IS\x20NOT\x20EMPTY'],_0x8aa178);};var _0x1457f7=function(_0xee44f2){if(!_0xee44f2||!_0xee44f2['rules'][_0x36ac('0x38')]){return'';}for(var _0x12c3a6='(',_0x54e652=0x0;_0x54e652<_0xee44f2[_0x36ac('0x68')][_0x36ac('0x38')];_0x54e652+=0x1){_0x54e652>0x0&&(_0x12c3a6+='\x20'+_0xee44f2[_0x36ac('0x69')]+'\x20');_0x12c3a6+=_0xee44f2['rules'][_0x54e652][_0x36ac('0x6a')]?_0x1457f7(_0xee44f2[_0x36ac('0x68')][_0x54e652][_0x36ac('0x6a')]):_0xee44f2[_0x36ac('0x68')][_0x54e652][_0x36ac('0x6b')]+'\x20'+_0xee44f2[_0x36ac('0x68')][_0x54e652][_0x36ac('0x6c')]+(_0x400160(_0xee44f2['rules'][_0x54e652][_0x36ac('0x6c')])?'\x20'+_0xee44f2[_0x36ac('0x68')][_0x54e652][_0x36ac('0x6d')]:'');}return _0x12c3a6+')';};var _0x2477f8={'where':{'id':_0x3df888[_0x36ac('0x6e')]['id']}},_0x46e28f,_0x222b62,_0x31ec36,_0x4a2394,_0x5eda33;_0x2477f8=_['merge']({},_0x2477f8,_0x3df888[_0x36ac('0x43')]);return db[_0x36ac('0x2d')][_0x36ac('0x47')](_0x2477f8)[_0x36ac('0x27')](function(_0x265b2d){if(_0x265b2d){_0x46e28f=_0x265b2d;return _0x265b2d[_0x36ac('0x6f')]();}return null;})[_0x36ac('0x27')](function(_0x421f96){if(_0x421f96){if(!_0x421f96[_0x36ac('0x38')]){throw new db[(_0x36ac('0x70'))][(_0x36ac('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x222b62=_0x421f96;return db[_0x36ac('0x72')][_0x36ac('0x73')]({'raw':!![]});}return null;})[_0x36ac('0x27')](function(_0x2aee7f){if(_0x2aee7f){_0x31ec36=_[_0x36ac('0x74')](_0x2aee7f,'id');var _0x11aebd;var _0x316380=squel[_0x36ac('0x75')]();_0x316380[_0x36ac('0x76')](_0x46e28f['table']);for(var _0x16095a=0x0;_0x16095a<_0x222b62[_0x36ac('0x38')];_0x16095a+=0x1){_0x11aebd=_0x222b62[_0x16095a][_0x36ac('0x77')]?_0x31ec36[_0x222b62[_0x16095a]['MetricId']][_0x36ac('0x78')]:_0x222b62[_0x16095a][_0x36ac('0x6b')];_0x11aebd=_0x222b62[_0x16095a][_0x36ac('0x79')]?_[_0x36ac('0x7a')](_0x42c789[_0x222b62[_0x16095a]['function']],'%s',_0x11aebd):_0x11aebd;_0x11aebd=_0x222b62[_0x16095a]['format']?_['replace'](_0x48ff45[_0x222b62[_0x16095a][_0x36ac('0x7b')]],'%s',_0x11aebd):_0x11aebd;if(_0x222b62[_0x16095a][_0x36ac('0x7c')]){_0x316380[_0x36ac('0x6a')](_0x11aebd);}_0x222b62[_0x16095a][_0x36ac('0x7d')]&&_0x316380[_0x36ac('0x3c')](_0x11aebd,_0x222b62[_0x16095a][_0x36ac('0x7d')]===_0x36ac('0x7e')?![]:!![]);_0x316380[_0x36ac('0x6b')](_0x11aebd,_0x222b62[_0x16095a]['alias']||_0x11aebd);}if(_0x46e28f['joins']){_0x46e28f['joins']=JSON['parse'](_0x46e28f[_0x36ac('0x7f')]);for(var _0x6b82c1=0x0;_0x6b82c1<_0x46e28f[_0x36ac('0x7f')]['length'];_0x6b82c1+=0x1){if(_0x46e28f[_0x36ac('0x7f')][_0x6b82c1]['type']&&_['includes'](_0x2169a4,_0x46e28f['joins'][_0x6b82c1]['type'])&&_0x46e28f[_0x36ac('0x7f')][_0x6b82c1]['parentKey']&&_0x46e28f[_0x36ac('0x7f')][_0x6b82c1][_0x36ac('0x80')]&&_0x46e28f[_0x36ac('0x7f')][_0x6b82c1][_0x36ac('0x81')]){_0x316380[_0x46e28f['joins'][_0x6b82c1][_0x36ac('0x2f')]](_0x46e28f['joins'][_0x6b82c1]['foreignTable'],null,util[_0x36ac('0x7b')](_0x36ac('0x82'),_0x46e28f['table'],_0x46e28f['joins'][_0x6b82c1][_0x36ac('0x83')],_0x46e28f[_0x36ac('0x7f')][_0x6b82c1][_0x36ac('0x80')],_0x46e28f['joins'][_0x6b82c1][_0x36ac('0x81')]));}}}if(_0x46e28f[_0x36ac('0x84')]){_0x46e28f['conditions']=JSON[_0x36ac('0x85')](_0x46e28f[_0x36ac('0x84')]);_0x316380[_0x36ac('0x3e')](_0x1457f7(_0x46e28f[_0x36ac('0x84')][_0x36ac('0x6a')]));}_0x5eda33=_0x316380[_0x36ac('0x86')]();_0x316380[_0x36ac('0x1e')](_0x2072ba);_0x316380[_0x36ac('0x20')](0x0);logger['debug'](_0x36ac('0x87'),_0x316380[_0x36ac('0x88')]());return dbH[_0x36ac('0x89')][_0x36ac('0x32')](_0x316380[_0x36ac('0x88')](),{'type':dbH[_0x36ac('0x89')][_0x36ac('0x8a')][_0x36ac('0x8b')]});}})[_0x36ac('0x27')](respondWithResult(_0x2d5fd3,null))[_0x36ac('0x53')](handleError(_0x2d5fd3,null));};function runReport(_0x20f8fa,_0x4a57e8,_0x40b820){var _0x184bcb=_0x4a57e8['name'];var _0x3e4906=0xa;var _0x5bf9d1=[_0x36ac('0x56'),'left_join',_0x36ac('0x58'),'cross_join'];var _0x16a174={'SUM':_0x36ac('0x8c'),'COUNT':_0x36ac('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x36ac('0x5c'),'MIN':_0x36ac('0x5d'),'AVG':_0x36ac('0x5e'),'GROUP_CONCAT':_0x36ac('0x5f'),'GROUP_CONCAT ASC':_0x36ac('0x8d'),'GROUP_CONCAT DESC':_0x36ac('0x8e')};var _0x4d328f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x36ac('0x61'),'ROUND':_0x36ac('0x62'),'UNIX_TIMESTAMP':_0x36ac('0x63')};var _0xabf6c2=function(_0x991fdc){return!_['includes']([_0x36ac('0x65'),_0x36ac('0x66'),_0x36ac('0x67'),_0x36ac('0x8f')],_0x991fdc);};var _0x5af02e=function(_0x2373fb){if(!_0x2373fb||!_0x2373fb[_0x36ac('0x68')][_0x36ac('0x38')]){return'';}for(var _0x35bfa8='(',_0x3717a8=0x0;_0x3717a8<_0x2373fb[_0x36ac('0x68')]['length'];_0x3717a8+=0x1){_0x3717a8>0x0&&(_0x35bfa8+='\x20'+_0x2373fb[_0x36ac('0x69')]+'\x20');_0x35bfa8+=_0x2373fb[_0x36ac('0x68')][_0x3717a8][_0x36ac('0x6a')]?_0x5af02e(_0x2373fb[_0x36ac('0x68')][_0x3717a8][_0x36ac('0x6a')]):_0x2373fb[_0x36ac('0x68')][_0x3717a8][_0x36ac('0x6b')]+'\x20'+_0x2373fb[_0x36ac('0x68')][_0x3717a8]['condition']+(_0xabf6c2(_0x2373fb[_0x36ac('0x68')][_0x3717a8]['condition'])?'\x20'+_0x2373fb[_0x36ac('0x68')][_0x3717a8][_0x36ac('0x6d')]:'');}return _0x35bfa8+')';};var _0xdfbf88={'where':{'id':_0x20f8fa['id']}},_0x593e47,_0x254627,_0x54837e,_0x5db5b3,_0x2b9c8e;_0xdfbf88=_[_0x36ac('0x41')]({},_0xdfbf88,_0x40b820);return db[_0x36ac('0x2d')]['find'](_0xdfbf88)[_0x36ac('0x27')](function(_0x32c74f){if(_0x32c74f){_0x593e47=_0x32c74f;return _0x32c74f[_0x36ac('0x6f')]();}return null;})[_0x36ac('0x27')](function(_0x2c301c){if(_0x2c301c){if(!_0x2c301c[_0x36ac('0x38')]){throw new db['Sequelize'][(_0x36ac('0x71'))](_0x36ac('0x90'),0x193);}_0x254627=_0x2c301c;return db[_0x36ac('0x72')][_0x36ac('0x73')]({'raw':!![]});}return null;})[_0x36ac('0x27')](function(_0x1c01b7){if(_0x1c01b7){_0x54837e=_['keyBy'](_0x1c01b7,'id');var _0x2a987a;var _0x3510c5=squel[_0x36ac('0x75')]();_0x3510c5[_0x36ac('0x76')](_0x593e47[_0x36ac('0x91')]);for(var _0x58d879=0x0;_0x58d879<_0x254627['length'];_0x58d879+=0x1){_0x2a987a=_0x254627[_0x58d879][_0x36ac('0x77')]?_0x54837e[_0x254627[_0x58d879][_0x36ac('0x77')]][_0x36ac('0x78')]:_0x254627[_0x58d879][_0x36ac('0x6b')];_0x2a987a=_0x254627[_0x58d879][_0x36ac('0x79')]?_['replace'](_0x16a174[_0x254627[_0x58d879][_0x36ac('0x79')]],'%s',_0x2a987a):_0x2a987a;_0x2a987a=_0x254627[_0x58d879][_0x36ac('0x7b')]?_[_0x36ac('0x7a')](_0x4d328f[_0x254627[_0x58d879][_0x36ac('0x7b')]],'%s',_0x2a987a):_0x2a987a;if(_0x254627[_0x58d879]['groupBy']){_0x3510c5[_0x36ac('0x6a')](_0x2a987a);}_0x254627[_0x58d879][_0x36ac('0x7d')]&&_0x3510c5[_0x36ac('0x3c')](_0x2a987a,_0x254627[_0x58d879]['orderBy']===_0x36ac('0x7e')?![]:!![]);_0x3510c5[_0x36ac('0x6b')](_0x2a987a,_0x254627[_0x58d879]['alias']||_0x2a987a);}if(_0x593e47[_0x36ac('0x7f')]){_0x593e47[_0x36ac('0x7f')]=JSON[_0x36ac('0x85')](_0x593e47[_0x36ac('0x7f')]);for(var _0x5149ec=0x0;_0x5149ec<_0x593e47[_0x36ac('0x7f')][_0x36ac('0x38')];_0x5149ec+=0x1){if(_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x2f')]&&_[_0x36ac('0x64')](_0x5bf9d1,_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x2f')])&&_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x83')]&&_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x80')]&&_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x81')]){_0x3510c5[_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x2f')]](_0x593e47[_0x36ac('0x7f')][_0x5149ec]['foreignTable'],null,util[_0x36ac('0x7b')](_0x36ac('0x82'),_0x593e47[_0x36ac('0x91')],_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x83')],_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x80')],_0x593e47[_0x36ac('0x7f')][_0x5149ec][_0x36ac('0x81')]));}}}if(_0x593e47[_0x36ac('0x84')]){_0x593e47[_0x36ac('0x84')]=JSON[_0x36ac('0x85')](_0x593e47['conditions']);_0x3510c5['where'](_0x5af02e(_0x593e47[_0x36ac('0x84')][_0x36ac('0x6a')]));}_0x2b9c8e=_0x3510c5['clone']();_0x3510c5[_0x36ac('0x1e')](_0x3e4906);_0x3510c5[_0x36ac('0x20')](0x0);return;}})[_0x36ac('0x27')](function(){if(_0x4a57e8['output']===_0x36ac('0x92')){return null;}var _0x29a996=_[_0x36ac('0x41')](_0x4a57e8,{'name':_0x4a57e8[_0x36ac('0x93')]||_0x4a57e8[_0x36ac('0x2a')]||_0x593e47[_0x36ac('0x2a')],'basename':_0x184bcb,'savename':util[_0x36ac('0x7b')]('%s-%s.%s',_0x4a57e8['name']||_0x593e47[_0x36ac('0x2a')],require(_0x36ac('0x94'))['generate'](0x4),_0x4a57e8[_0x36ac('0x95')]||'csv'),'reportId':_0x593e47['id'],'reportType':'custom'});return db[_0x36ac('0x96')]['create'](_0x29a996,{'raw':!![]});})[_0x36ac('0x27')](function(_0x18fec5){if(_0x593e47[_0x36ac('0x91')]===_0x36ac('0x97')){_0x2b9c8e[_0x36ac('0x3e')](_0x593e47['table']+_0x36ac('0x98'),_0x4a57e8[_0x36ac('0x99')],_0x4a57e8[_0x36ac('0x9a')]);}else{_0x2b9c8e['where'](_0x593e47[_0x36ac('0x91')]+_0x36ac('0x9b'),_0x4a57e8['startDate'],_0x4a57e8[_0x36ac('0x9a')]);}if(_0x18fec5){logger['info']('Run\x20Query:',_0x2b9c8e['toString']());require(_0x36ac('0x9c'))[_0x36ac('0x9d')](path[_0x36ac('0x56')](__dirname,_0x36ac('0x9e'),_0x18fec5[_0x36ac('0x95')]),[_0x18fec5['id'],_0x2b9c8e[_0x36ac('0x88')](),path[_0x36ac('0x56')](__dirname,_0x36ac('0x9f'),_0x18fec5[_0x36ac('0xa0')]),_0x184bcb]);return _0x18fec5;}else{var _0x31deef=squel[_0x36ac('0x75')]();_0x31deef['from']('('+_0x2b9c8e[_0x36ac('0x88')]()+')',_0x36ac('0xa1'));_0x31deef[_0x36ac('0x6b')](_0x36ac('0xa2'),'count');_0x2b9c8e[_0x36ac('0x1e')](_0x4a57e8['limit']||_0x3e4906);_0x2b9c8e[_0x36ac('0x20')](_0x4a57e8[_0x36ac('0x20')]||0x0);return dbH[_0x36ac('0x89')][_0x36ac('0x32')](_0x31deef[_0x36ac('0x88')](),{'type':dbH[_0x36ac('0x89')][_0x36ac('0x8a')][_0x36ac('0x8b')]})[_0x36ac('0x27')](function(_0x3172f8){if(!_0x3172f8[_0x36ac('0x38')]){_0x5db5b3=0x0;}else{_0x5db5b3=_0x3172f8[0x0][_0x36ac('0x1f')]||0x0;}return dbH['sequelize'][_0x36ac('0x32')](_0x2b9c8e['toString'](),{'type':dbH['sequelize'][_0x36ac('0x8a')][_0x36ac('0x8b')]});})[_0x36ac('0x27')](function(_0x5b6cbc){return{'rows':_0x5b6cbc||[],'count':_0x5db5b3};});}});}exports[_0x36ac('0xa3')]=function(_0x33b3c2,_0x45ca8){return runReport(_0x33b3c2[_0x36ac('0x6e')],_0x33b3c2[_0x36ac('0x32')],_0x33b3c2['options'])[_0x36ac('0x27')](respondWithResult(_0x45ca8,null))[_0x36ac('0x53')](handleError(_0x45ca8,null));};exports['runReport']=runReport;exports[_0x36ac('0x32')]=function(_0x315160,_0x2fb83a){var _0x500340=0xa;var _0x23d104=[_0x36ac('0x56'),_0x36ac('0x57'),_0x36ac('0x58'),_0x36ac('0x59')];var _0x5186f6={'SUM':_0x36ac('0x8c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x36ac('0x5b'),'MAX':_0x36ac('0x5c'),'MIN':_0x36ac('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x36ac('0x5f'),'GROUP_CONCAT ASC':_0x36ac('0x8d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xbddb2a={'SEC_TO_TIME':_0x36ac('0x60'),'DATE':_0x36ac('0xa4'),'HOUR':_0x36ac('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x36ac('0x63')};var _0x352847=function(_0x499241){return!_['includes']([_0x36ac('0x65'),_0x36ac('0x66'),_0x36ac('0x67'),_0x36ac('0x8f')],_0x499241);};var _0x19c8af=function(_0x2b2eb5){if(!_0x2b2eb5||!_0x2b2eb5['rules'][_0x36ac('0x38')]){return'';}for(var _0x576097='(',_0xb83131=0x0;_0xb83131<_0x2b2eb5[_0x36ac('0x68')][_0x36ac('0x38')];_0xb83131+=0x1){_0xb83131>0x0&&(_0x576097+='\x20'+_0x2b2eb5[_0x36ac('0x69')]+'\x20');_0x576097+=_0x2b2eb5['rules'][_0xb83131][_0x36ac('0x6a')]?_0x19c8af(_0x2b2eb5[_0x36ac('0x68')][_0xb83131][_0x36ac('0x6a')]):_0x2b2eb5['rules'][_0xb83131][_0x36ac('0x6b')]+'\x20'+_0x2b2eb5[_0x36ac('0x68')][_0xb83131][_0x36ac('0x6c')]+(_0x352847(_0x2b2eb5['rules'][_0xb83131][_0x36ac('0x6c')])?'\x20'+_0x2b2eb5['rules'][_0xb83131][_0x36ac('0x6d')]:'');}return _0x576097+')';};var _0x46af9e={'where':{'id':_0x315160[_0x36ac('0x6e')]['id']}},_0x4d28ab,_0xf379be,_0x28ef70,_0x1e7e41,_0x453fa4;_0x46af9e=_[_0x36ac('0x41')]({},_0x46af9e,_0x315160[_0x36ac('0x43')]);return db[_0x36ac('0x2d')][_0x36ac('0x47')](_0x46af9e)[_0x36ac('0x27')](function(_0x3464a0){if(_0x3464a0){_0x4d28ab=_0x3464a0;return _0x3464a0[_0x36ac('0x6f')]();}return null;})[_0x36ac('0x27')](function(_0x3cdebc){if(_0x3cdebc){if(!_0x3cdebc[_0x36ac('0x38')]){throw new db[(_0x36ac('0x70'))][(_0x36ac('0x71'))](_0x36ac('0x90'),0x193);}_0xf379be=_0x3cdebc;return db[_0x36ac('0x72')][_0x36ac('0x73')]({'raw':!![]});}return null;})[_0x36ac('0x27')](function(_0x48c18d){if(_0x48c18d){_0x28ef70=_['keyBy'](_0x48c18d,'id');var _0x10e6c6;var _0x4a8736=squel[_0x36ac('0x75')]();_0x4a8736['from'](_0x4d28ab[_0x36ac('0x91')]);for(var _0x4e734a=0x0;_0x4e734a<_0xf379be[_0x36ac('0x38')];_0x4e734a+=0x1){_0x10e6c6=_0xf379be[_0x4e734a]['MetricId']?_0x28ef70[_0xf379be[_0x4e734a][_0x36ac('0x77')]]['metric']:_0xf379be[_0x4e734a]['field'];_0x10e6c6=_0xf379be[_0x4e734a][_0x36ac('0x79')]?_[_0x36ac('0x7a')](_0x5186f6[_0xf379be[_0x4e734a][_0x36ac('0x79')]],'%s',_0x10e6c6):_0x10e6c6;_0x10e6c6=_0xf379be[_0x4e734a][_0x36ac('0x7b')]?_[_0x36ac('0x7a')](_0xbddb2a[_0xf379be[_0x4e734a][_0x36ac('0x7b')]],'%s',_0x10e6c6):_0x10e6c6;if(_0xf379be[_0x4e734a][_0x36ac('0x7c')]){_0x4a8736[_0x36ac('0x6a')](_0x10e6c6);}_0xf379be[_0x4e734a][_0x36ac('0x7d')]&&_0x4a8736[_0x36ac('0x3c')](_0x10e6c6,_0xf379be[_0x4e734a][_0x36ac('0x7d')]===_0x36ac('0x7e')?![]:!![]);_0x4a8736[_0x36ac('0x6b')](_0x10e6c6,_0xf379be[_0x4e734a]['alias']||_0x10e6c6);}if(_0x4d28ab['joins']){_0x4d28ab['joins']=JSON[_0x36ac('0x85')](_0x4d28ab[_0x36ac('0x7f')]);for(var _0x368925=0x0;_0x368925<_0x4d28ab['joins'][_0x36ac('0x38')];_0x368925+=0x1){if(_0x4d28ab['joins'][_0x368925][_0x36ac('0x2f')]&&_[_0x36ac('0x64')](_0x23d104,_0x4d28ab['joins'][_0x368925][_0x36ac('0x2f')])&&_0x4d28ab['joins'][_0x368925][_0x36ac('0x83')]&&_0x4d28ab[_0x36ac('0x7f')][_0x368925][_0x36ac('0x80')]&&_0x4d28ab[_0x36ac('0x7f')][_0x368925]['foreignKey']){_0x4a8736[_0x4d28ab['joins'][_0x368925]['type']](_0x4d28ab[_0x36ac('0x7f')][_0x368925][_0x36ac('0x80')],null,util[_0x36ac('0x7b')](_0x36ac('0x82'),_0x4d28ab[_0x36ac('0x91')],_0x4d28ab[_0x36ac('0x7f')][_0x368925][_0x36ac('0x83')],_0x4d28ab[_0x36ac('0x7f')][_0x368925][_0x36ac('0x80')],_0x4d28ab[_0x36ac('0x7f')][_0x368925][_0x36ac('0x81')]));}}}if(_0x4d28ab['conditions']){_0x4d28ab[_0x36ac('0x84')]=JSON[_0x36ac('0x85')](_0x4d28ab[_0x36ac('0x84')]);_0x4a8736[_0x36ac('0x3e')](_0x19c8af(_0x4d28ab[_0x36ac('0x84')][_0x36ac('0x6a')]));}_0x453fa4=_0x4a8736[_0x36ac('0x86')]();_0x4a8736['limit'](_0x500340);_0x4a8736['offset'](0x0);logger['debug']('Limited\x20Query:',_0x4a8736[_0x36ac('0x88')]());return dbH[_0x36ac('0x89')]['query'](_0x4a8736[_0x36ac('0x88')](),{'type':dbH[_0x36ac('0x89')][_0x36ac('0x8a')][_0x36ac('0x8b')]});}})[_0x36ac('0x27')](function(){return{'sql':_0x453fa4[_0x36ac('0x88')]()};})['then'](respondWithResult(_0x2fb83a,null))[_0x36ac('0x53')](handleError(_0x2fb83a,null));};
\ No newline at end of file
index 1f26738..7e4490e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe752=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x2a4280,_0x1485b7){var _0x3705a3=function(_0x23efbb){while(--_0x23efbb){_0x2a4280['push'](_0x2a4280['shift']());}};_0x3705a3(++_0x1485b7);}(_0xe752,0x1d2));var _0x2e75=function(_0x2298c2,_0x520b97){_0x2298c2=_0x2298c2-0x0;var _0x2d0ecc=_0xe752[_0x2298c2];return _0x2d0ecc;};'use strict';var _=require(_0x2e75('0x0'));var util=require(_0x2e75('0x1'));var logger=require('../../config/logger')(_0x2e75('0x2'));var moment=require(_0x2e75('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e75('0x4'));var fs=require('fs');var path=require(_0x2e75('0x5'));var rimraf=require(_0x2e75('0x6'));var config=require(_0x2e75('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x2e75('0x8')]=function(_0x5258a3,_0x5ec13c){return _0x5258a3[_0x2e75('0x9')](_0x2e75('0xa'),attributes,{'tableName':_0x2e75('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x459d=['../../config/logger','api','request-promise','path','../../config/environment','define','lodash','util'];(function(_0x1b2960,_0x53ffc2){var _0x29b7ab=function(_0x464105){while(--_0x464105){_0x1b2960['push'](_0x1b2960['shift']());}};_0x29b7ab(++_0x53ffc2);}(_0x459d,0xb6));var _0xd459=function(_0x1e00d0,_0x380c3b){_0x1e00d0=_0x1e00d0-0x0;var _0x35d81c=_0x459d[_0x1e00d0];return _0x35d81c;};'use strict';var _=require(_0xd459('0x0'));var util=require(_0xd459('0x1'));var logger=require(_0xd459('0x2'))(_0xd459('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd459('0x4'));var fs=require('fs');var path=require(_0xd459('0x5'));var rimraf=require('rimraf');var config=require(_0xd459('0x6'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x52b4df,_0x32bfda){return _0x52b4df[_0xd459('0x7')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40c1d99..e42331a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4048=['jayson/promise','http','request','then','info','request\x20sent','debug','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x281ebc,_0x388adb){var _0x415226=function(_0x3fbb23){while(--_0x3fbb23){_0x281ebc['push'](_0x281ebc['shift']());}};_0x415226(++_0x388adb);}(_0x4048,0x97));var _0x8404=function(_0x3ff729,_0x2ab90d){_0x3ff729=_0x3ff729-0x0;var _0x3757fa=_0x4048[_0x3ff729];return _0x3757fa;};'use strict';var _=require(_0x8404('0x0'));var util=require(_0x8404('0x1'));var moment=require(_0x8404('0x2'));var BPromise=require(_0x8404('0x3'));var rs=require(_0x8404('0x4'));var fs=require('fs');var Redis=require(_0x8404('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8404('0x6'));var logger=require(_0x8404('0x7'))(_0x8404('0x8'));var config=require(_0x8404('0x9'));var jayson=require(_0x8404('0xa'));var client=jayson['client'][_0x8404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x477e34,_0x131abe,_0x486133){return new BPromise(function(_0x244b84,_0x1ef96d){return client[_0x8404('0xc')](_0x477e34,_0x486133)[_0x8404('0xd')](function(_0x1b7e53){logger[_0x8404('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x131abe,_0x8404('0xf'));logger[_0x8404('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x131abe,_0x8404('0xf'),JSON['stringify'](_0x1b7e53));if(_0x1b7e53[_0x8404('0x11')]){if(_0x1b7e53['error'][_0x8404('0x12')]===0x1f4){logger[_0x8404('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x131abe,_0x1b7e53[_0x8404('0x11')][_0x8404('0x13')]);return _0x1ef96d(_0x1b7e53[_0x8404('0x11')][_0x8404('0x13')]);}logger['error'](_0x8404('0x14'),_0x131abe,_0x1b7e53[_0x8404('0x11')][_0x8404('0x13')]);return _0x244b84(_0x1b7e53[_0x8404('0x11')][_0x8404('0x13')]);}else{logger['info'](_0x8404('0x14'),_0x131abe,_0x8404('0xf'));_0x244b84(_0x1b7e53[_0x8404('0x15')][_0x8404('0x13')]);}})[_0x8404('0x16')](function(_0x5c5a1a){logger[_0x8404('0x11')](_0x8404('0x14'),_0x131abe,_0x5c5a1a);_0x1ef96d(_0x5c5a1a);});});}
\ No newline at end of file
+var _0x72ca=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4da76f,_0xb6f804){var _0x9d390b=function(_0x50b8){while(--_0x50b8){_0x4da76f['push'](_0x4da76f['shift']());}};_0x9d390b(++_0xb6f804);}(_0x72ca,0x1b5));var _0xa72c=function(_0x12487e,_0x40012e){_0x12487e=_0x12487e-0x0;var _0x33cf05=_0x72ca[_0x12487e];return _0x33cf05;};'use strict';var _=require(_0xa72c('0x0'));var util=require(_0xa72c('0x1'));var moment=require(_0xa72c('0x2'));var BPromise=require(_0xa72c('0x3'));var rs=require(_0xa72c('0x4'));var fs=require('fs');var Redis=require(_0xa72c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa72c('0x6'));var logger=require(_0xa72c('0x7'))(_0xa72c('0x8'));var config=require(_0xa72c('0x9'));var jayson=require(_0xa72c('0xa'));var client=jayson[_0xa72c('0xb')][_0xa72c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2301a0,_0xdcf596,_0x51dd79){return new BPromise(function(_0x42c526,_0x4fd6e6){return client['request'](_0x2301a0,_0x51dd79)[_0xa72c('0xd')](function(_0x3df363){logger[_0xa72c('0xe')](_0xa72c('0xf'),_0xdcf596,_0xa72c('0x10'));logger[_0xa72c('0x11')](_0xa72c('0x12'),_0xdcf596,_0xa72c('0x10'),JSON[_0xa72c('0x13')](_0x3df363));if(_0x3df363[_0xa72c('0x14')]){if(_0x3df363[_0xa72c('0x14')][_0xa72c('0x15')]===0x1f4){logger['error'](_0xa72c('0xf'),_0xdcf596,_0x3df363[_0xa72c('0x14')][_0xa72c('0x16')]);return _0x4fd6e6(_0x3df363[_0xa72c('0x14')][_0xa72c('0x16')]);}logger[_0xa72c('0x14')](_0xa72c('0xf'),_0xdcf596,_0x3df363[_0xa72c('0x14')]['message']);return _0x42c526(_0x3df363['error'][_0xa72c('0x16')]);}else{logger[_0xa72c('0xe')](_0xa72c('0xf'),_0xdcf596,_0xa72c('0x10'));_0x42c526(_0x3df363[_0xa72c('0x17')][_0xa72c('0x16')]);}})[_0xa72c('0x18')](function(_0x2ccb8b){logger[_0xa72c('0x14')](_0xa72c('0xf'),_0xdcf596,_0x2ccb8b);_0x4fd6e6(_0x2ccb8b);});});}
\ No newline at end of file
index 2c60401..4427f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54cb=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0x54cb,0x1e4));var _0xb54c=function(_0x5a28a9,_0x467480){_0x5a28a9=_0x5a28a9-0x0;var _0x16010a=_0x54cb[_0x5a28a9];return _0x16010a;};'use strict';var multer=require('multer');var util=require(_0xb54c('0x0'));var path=require(_0xb54c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb54c('0x2'));var router=express[_0xb54c('0x3')]();var fs_extra=require(_0xb54c('0x4'));var auth=require(_0xb54c('0x5'));var interaction=require(_0xb54c('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xb54c('0x7')]('/',auth[_0xb54c('0x8')](),controller[_0xb54c('0x9')]);router[_0xb54c('0x7')](_0xb54c('0xa'),auth[_0xb54c('0x8')](),controller['show']);router[_0xb54c('0x7')](_0xb54c('0xb'),auth[_0xb54c('0x8')](),controller[_0xb54c('0xc')]);router[_0xb54c('0x7')](_0xb54c('0xd'),auth[_0xb54c('0x8')](),controller[_0xb54c('0xe')]);router['get'](_0xb54c('0xf'),auth[_0xb54c('0x8')](),controller[_0xb54c('0x10')]);router['post']('/',auth[_0xb54c('0x8')](),controller[_0xb54c('0x11')]);router[_0xb54c('0x12')]('/:id',auth[_0xb54c('0x8')](),controller[_0xb54c('0x13')]);router[_0xb54c('0x14')]('/:id',auth[_0xb54c('0x8')](),controller[_0xb54c('0x15')]);module[_0xb54c('0x16')]=router;
\ No newline at end of file
+var _0x66f2=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','index','isAuthenticated','show','/:id/preview','preview','get','/:id/run','query','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x66f2,0x67));var _0x266f=function(_0x1390a0,_0x499668){_0x1390a0=_0x1390a0-0x0;var _0x359f67=_0x66f2[_0x1390a0];return _0x359f67;};'use strict';var multer=require(_0x266f('0x0'));var util=require(_0x266f('0x1'));var path=require('path');var timeout=require(_0x266f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x266f('0x3'));var auth=require(_0x266f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x266f('0x5'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x266f('0x6')]);router['get']('/:id',auth[_0x266f('0x7')](),controller[_0x266f('0x8')]);router['get'](_0x266f('0x9'),auth[_0x266f('0x7')](),controller[_0x266f('0xa')]);router[_0x266f('0xb')](_0x266f('0xc'),auth[_0x266f('0x7')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x266f('0xd')]);router[_0x266f('0xe')]('/',auth[_0x266f('0x7')](),controller[_0x266f('0xf')]);router[_0x266f('0x10')](_0x266f('0x11'),auth[_0x266f('0x7')](),controller[_0x266f('0x12')]);router['delete']('/:id',auth[_0x266f('0x7')](),controller[_0x266f('0x13')]);module[_0x266f('0x14')]=router;
\ No newline at end of file
index 6c21ce4..d6654fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x4ea891,_0xca830d){var _0x1534cd=function(_0x236aad){while(--_0x236aad){_0x4ea891['push'](_0x4ea891['shift']());}};_0x1534cd(++_0xca830d);}(_0xeda8,0x104));var _0x8eda=function(_0x4adff9,_0x2c6494){_0x4adff9=_0x4adff9-0x0;var _0x3f90c7=_0xeda8[_0x4adff9];return _0x3f90c7;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x6b4e41,_0x3ed208){var _0x346877=function(_0x5b5d0e){while(--_0x5b5d0e){_0x6b4e41['push'](_0x6b4e41['shift']());}};_0x346877(++_0x3ed208);}(_0xac9d,0x14d));var _0xdac9=function(_0x426267,_0x422e6e){_0x426267=_0x426267-0x0;var _0x59e163=_0xac9d[_0x426267];return _0x59e163;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
index b1ea5fe..5d91e6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x2310e0,_0x2e3ab2){var _0xd22833=function(_0x17ba96){while(--_0x17ba96){_0x2310e0['push'](_0x2310e0['shift']());}};_0xd22833(++_0x2e3ab2);}(_0x0295,0x1f0));var _0x5029=function(_0x1406c8,_0x40a801){_0x1406c8=_0x1406c8-0x0;var _0x3ec6f8=_0x0295[_0x1406c8];return _0x3ec6f8;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5e1af1,_0x2d3b7c){_0x5e1af1=_0x5e1af1-0x0;var _0x17aca4=_0xdc97[_0x5e1af1];return _0x17aca4;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));};
\ No newline at end of file
index fd7eb78..d65c6ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ea=['bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x2b0ffd,_0x1fc120){var _0x2e72da=function(_0x664f28){while(--_0x664f28){_0x2b0ffd['push'](_0x2b0ffd['shift']());}};_0x2e72da(++_0x1fc120);}(_0xf6ea,0x14c));var _0xaf6e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf6ea[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xaf6e('0x0'));var util=require(_0xaf6e('0x1'));var logger=require(_0xaf6e('0x2'))('api');var moment=require(_0xaf6e('0x3'));var BPromise=require(_0xaf6e('0x4'));var rp=require(_0xaf6e('0x5'));var fs=require('fs');var path=require(_0xaf6e('0x6'));var rimraf=require(_0xaf6e('0x7'));var config=require(_0xaf6e('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x54a7aa,_0xb8ba47){return _0x54a7aa[_0xaf6e('0x9')](_0xaf6e('0xa'),attributes,{'tableName':_0xaf6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf9c=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0xbf9c,0x1a3));var _0xcbf9=function(_0x452084,_0x1ee124){_0x452084=_0x452084-0x0;var _0x364de2=_0xbf9c[_0x452084];return _0x364de2;};'use strict';var _=require(_0xcbf9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcbf9('0x1'));var moment=require(_0xcbf9('0x2'));var BPromise=require('bluebird');var rp=require(_0xcbf9('0x3'));var fs=require('fs');var path=require(_0xcbf9('0x4'));var rimraf=require(_0xcbf9('0x5'));var config=require(_0xcbf9('0x6'));var attributes=require(_0xcbf9('0x7'));module[_0xcbf9('0x8')]=function(_0x41d32b,_0x5c18f8){return _0x41d32b[_0xcbf9('0x9')](_0xcbf9('0xa'),attributes,{'tableName':_0xcbf9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20cbfb4..ff3e588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dca=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3dca,0xd7));var _0xa3dc=function(_0x3946d6,_0x2cd5e9){_0x3946d6=_0x3946d6-0x0;var _0xec54f5=_0x3dca[_0x3946d6];return _0xec54f5;};'use strict';var _=require('lodash');var util=require(_0xa3dc('0x0'));var moment=require(_0xa3dc('0x1'));var BPromise=require(_0xa3dc('0x2'));var rs=require(_0xa3dc('0x3'));var fs=require('fs');var Redis=require(_0xa3dc('0x4'));var db=require(_0xa3dc('0x5'))['db'];var utils=require(_0xa3dc('0x6'));var logger=require('../../config/logger')(_0xa3dc('0x7'));var config=require(_0xa3dc('0x8'));var jayson=require(_0xa3dc('0x9'));var client=jayson[_0xa3dc('0xa')][_0xa3dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a0ba2,_0x3c755c,_0x4cd8eb){return new BPromise(function(_0x2f47ab,_0xa64b52){return client['request'](_0x5a0ba2,_0x4cd8eb)['then'](function(_0x338a18){logger['info'](_0xa3dc('0xc'),_0x3c755c,'request\x20sent');logger[_0xa3dc('0xd')](_0xa3dc('0xe'),_0x3c755c,_0xa3dc('0xf'),JSON[_0xa3dc('0x10')](_0x338a18));if(_0x338a18[_0xa3dc('0x11')]){if(_0x338a18['error'][_0xa3dc('0x12')]===0x1f4){logger['error'](_0xa3dc('0xc'),_0x3c755c,_0x338a18['error']['message']);return _0xa64b52(_0x338a18['error']['message']);}logger[_0xa3dc('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3c755c,_0x338a18[_0xa3dc('0x11')][_0xa3dc('0x13')]);return _0x2f47ab(_0x338a18[_0xa3dc('0x11')][_0xa3dc('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3c755c,_0xa3dc('0xf'));_0x2f47ab(_0x338a18[_0xa3dc('0x14')]['message']);}})[_0xa3dc('0x15')](function(_0x2efbea){logger[_0xa3dc('0x11')](_0xa3dc('0xc'),_0x3c755c,_0x2efbea);_0xa64b52(_0x2efbea);});});}
\ No newline at end of file
+var _0x8605=['AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x8605,0x163));var _0x5860=function(_0x3fcfb7,_0x496db9){_0x3fcfb7=_0x3fcfb7-0x0;var _0x403ce5=_0x8605[_0x3fcfb7];return _0x403ce5;};'use strict';var _=require('lodash');var util=require(_0x5860('0x0'));var moment=require(_0x5860('0x1'));var BPromise=require('bluebird');var rs=require(_0x5860('0x2'));var fs=require('fs');var Redis=require(_0x5860('0x3'));var db=require(_0x5860('0x4'))['db'];var utils=require(_0x5860('0x5'));var logger=require(_0x5860('0x6'))(_0x5860('0x7'));var config=require(_0x5860('0x8'));var jayson=require(_0x5860('0x9'));var client=jayson[_0x5860('0xa')][_0x5860('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dbc36,_0x3df5c8,_0x1a796a){return new BPromise(function(_0x914914,_0x39c499){return client[_0x5860('0xc')](_0x1dbc36,_0x1a796a)[_0x5860('0xd')](function(_0x28dd28){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3df5c8,_0x5860('0xe'));logger[_0x5860('0xf')](_0x5860('0x10'),_0x3df5c8,_0x5860('0xe'),JSON[_0x5860('0x11')](_0x28dd28));if(_0x28dd28['error']){if(_0x28dd28[_0x5860('0x12')][_0x5860('0x13')]===0x1f4){logger[_0x5860('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3df5c8,_0x28dd28[_0x5860('0x12')]['message']);return _0x39c499(_0x28dd28[_0x5860('0x12')]['message']);}logger[_0x5860('0x12')](_0x5860('0x14'),_0x3df5c8,_0x28dd28[_0x5860('0x12')]['message']);return _0x914914(_0x28dd28[_0x5860('0x12')][_0x5860('0x15')]);}else{logger[_0x5860('0x16')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3df5c8,_0x5860('0xe'));_0x914914(_0x28dd28[_0x5860('0x17')]['message']);}})[_0x5860('0x18')](function(_0x5a042f){logger[_0x5860('0x12')](_0x5860('0x14'),_0x3df5c8,_0x5a042f);_0x39c499(_0x5a042f);});});}
\ No newline at end of file
index eb9ef23..8ecebcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4011=['./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','query','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x12f1c0,_0x57cc1f){var _0x56c50e=function(_0x5aaa77){while(--_0x5aaa77){_0x12f1c0['push'](_0x12f1c0['shift']());}};_0x56c50e(++_0x57cc1f);}(_0x4011,0x138));var _0x1401=function(_0x49d40d,_0x30e0ea){_0x49d40d=_0x49d40d-0x0;var _0x5ec463=_0x4011[_0x49d40d];return _0x5ec463;};'use strict';var multer=require(_0x1401('0x0'));var util=require('util');var path=require(_0x1401('0x1'));var timeout=require(_0x1401('0x2'));var express=require(_0x1401('0x3'));var router=express[_0x1401('0x4')]();var fs_extra=require(_0x1401('0x5'));var auth=require(_0x1401('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1401('0x7'));var controller=require(_0x1401('0x8'));router[_0x1401('0x9')]('/',auth[_0x1401('0xa')](),controller['index']);router['get'](_0x1401('0xb'),auth[_0x1401('0xa')](),controller[_0x1401('0xc')]);router[_0x1401('0x9')](_0x1401('0xd'),auth['isAuthenticated'](),controller[_0x1401('0xe')]);router[_0x1401('0x9')](_0x1401('0xf'),auth['isAuthenticated'](),controller[_0x1401('0x10')]);router[_0x1401('0x9')]('/:id/query',auth[_0x1401('0xa')](),controller[_0x1401('0x11')]);router['post']('/',auth[_0x1401('0xa')](),controller['create']);router['put'](_0x1401('0xb'),auth[_0x1401('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1401('0x12')]);module[_0x1401('0x13')]=router;
\ No newline at end of file
+var _0x6d32=['/:id/preview','/:id/query','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x87c7e7,_0x44ef23){var _0x458acc=function(_0x8fe8ec){while(--_0x8fe8ec){_0x87c7e7['push'](_0x87c7e7['shift']());}};_0x458acc(++_0x44ef23);}(_0x6d32,0x183));var _0x26d3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6d32[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x26d3('0x0'));var util=require(_0x26d3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x26d3('0x2'));var router=express[_0x26d3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x26d3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x26d3('0x5'));var controller=require(_0x26d3('0x6'));router[_0x26d3('0x7')]('/',auth[_0x26d3('0x8')](),controller[_0x26d3('0x9')]);router['get'](_0x26d3('0xa'),auth[_0x26d3('0x8')](),controller[_0x26d3('0xb')]);router['get'](_0x26d3('0xc'),auth[_0x26d3('0x8')](),controller['preview']);router[_0x26d3('0x7')]('/:id/run',auth[_0x26d3('0x8')](),controller['run']);router[_0x26d3('0x7')](_0x26d3('0xd'),auth[_0x26d3('0x8')](),controller['query']);router[_0x26d3('0xe')]('/',auth[_0x26d3('0x8')](),controller[_0x26d3('0xf')]);router[_0x26d3('0x10')](_0x26d3('0xa'),auth[_0x26d3('0x8')](),controller[_0x26d3('0x11')]);router[_0x26d3('0x12')](_0x26d3('0xa'),auth[_0x26d3('0x8')](),controller[_0x26d3('0x13')]);module[_0x26d3('0x14')]=router;
\ No newline at end of file
index 0ab9162..45cf106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bf6=['STRING','pdf','csv','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x569812,_0x370169){var _0x26f517=function(_0x478851){while(--_0x478851){_0x569812['push'](_0x569812['shift']());}};_0x26f517(++_0x370169);}(_0x5bf6,0x15c));var _0x65bf=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0x5bf6[_0x3be0c4];return _0x11af9f;};'use strict';var Sequelize=require(_0x65bf('0x0'));var moment=require(_0x65bf('0x1'));module[_0x65bf('0x2')]={'name':{'type':Sequelize[_0x65bf('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x65bf('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x65bf('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x65bf('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x65bf('0x6')]},'endDate':{'type':Sequelize[_0x65bf('0x6')]},'status':{'type':Sequelize[_0x65bf('0x3')],'defaultValue':_0x65bf('0x7')},'type':{'type':Sequelize[_0x65bf('0x8')](_0x65bf('0x9'),_0x65bf('0xa')),'allowNull':![],'defaultValue':_0x65bf('0x9')},'reportId':{'type':Sequelize[_0x65bf('0xb')](0xb)[_0x65bf('0xc')]},'reportType':{'type':Sequelize[_0x65bf('0x3')]}};
\ No newline at end of file
+var _0x53e3=['sequelize','moment','exports','csv','xlsx','STRING','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x416715,_0x53801b){var _0x5bdcd3=function(_0x4c2369){while(--_0x4c2369){_0x416715['push'](_0x416715['shift']());}};_0x5bdcd3(++_0x53801b);}(_0x53e3,0x1e1));var _0x353e=function(_0x414548,_0x1fb06e){_0x414548=_0x414548-0x0;var _0x50a863=_0x53e3[_0x414548];return _0x50a863;};'use strict';var Sequelize=require(_0x353e('0x0'));var moment=require(_0x353e('0x1'));module[_0x353e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x353e('0x3'),'pdf',_0x353e('0x4')),'allowNull':![],'defaultValue':_0x353e('0x3')},'savename':{'type':Sequelize[_0x353e('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x353e('0x6')]},'endDate':{'type':Sequelize[_0x353e('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x353e('0x7')},'type':{'type':Sequelize[_0x353e('0x8')](_0x353e('0x9'),_0x353e('0xa')),'allowNull':![],'defaultValue':_0x353e('0x9')},'reportId':{'type':Sequelize[_0x353e('0xb')](0xb)[_0x353e('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index eace105..32a631b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b54=['error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','AnalyticExtractedReport','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','Sequelize','ValidationError','exists','sendStatus','root','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','end'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0x4b54,0x1bf));var _0x44b5=function(_0x1ee583,_0x509bf9){_0x1ee583=_0x1ee583-0x0;var _0x34dca6=_0x4b54[_0x1ee583];return _0x34dca6;};'use strict';var emlformat=require(_0x44b5('0x0'));var rimraf=require(_0x44b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44b5('0x2'));var rp=require(_0x44b5('0x3'));var moment=require(_0x44b5('0x4'));var BPromise=require(_0x44b5('0x5'));var Mustache=require('mustache');var util=require(_0x44b5('0x6'));var path=require(_0x44b5('0x7'));var sox=require(_0x44b5('0x8'));var csv=require(_0x44b5('0x9'));var ejs=require(_0x44b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44b5('0xb'));var squel=require(_0x44b5('0xc'));var crypto=require(_0x44b5('0xd'));var jsforce=require(_0x44b5('0xe'));var deskjs=require(_0x44b5('0xf'));var toCsv=require(_0x44b5('0x9'));var querystring=require(_0x44b5('0x10'));var Papa=require(_0x44b5('0x11'));var Redis=require('ioredis');var authService=require(_0x44b5('0x12'));var qs=require(_0x44b5('0x13'));var as=require(_0x44b5('0x14'));var hardwareService=require(_0x44b5('0x15'));var logger=require(_0x44b5('0x16'))('api');var utils=require(_0x44b5('0x17'));var config=require(_0x44b5('0x18'));var licenseUtil=require(_0x44b5('0x19'));var db=require(_0x44b5('0x1a'))['db'];function respondWithStatusCode(_0x123b3d,_0x1a1117){_0x1a1117=_0x1a1117||0xcc;return function(_0x2279b4){if(_0x2279b4){return _0x123b3d['sendStatus'](_0x1a1117);}return _0x123b3d[_0x44b5('0x1b')](_0x1a1117)['end']();};}function respondWithResult(_0xb7fe09,_0x22091a){_0x22091a=_0x22091a||0xc8;return function(_0x480d8e){if(_0x480d8e){return _0xb7fe09[_0x44b5('0x1b')](_0x22091a)[_0x44b5('0x1c')](_0x480d8e);}};}function respondWithFilteredResult(_0x3f8ad8,_0xab32e6){return function(_0x35cc5e){if(_0x35cc5e){var _0x1dab69=typeof _0xab32e6[_0x44b5('0x1d')]==='undefined'&&typeof _0xab32e6['limit']===_0x44b5('0x1e');var _0xdbd4fa=_0x35cc5e[_0x44b5('0x1f')];var _0x163142=_0x1dab69?0x0:_0xab32e6[_0x44b5('0x1d')];var _0x51e470=_0x1dab69?_0x35cc5e['count']:_0xab32e6[_0x44b5('0x1d')]+_0xab32e6[_0x44b5('0x20')];var _0x477161;if(_0x51e470>=_0xdbd4fa){_0x51e470=_0xdbd4fa;_0x477161=0xc8;}else{_0x477161=0xce;}_0x3f8ad8[_0x44b5('0x1b')](_0x477161);return _0x3f8ad8[_0x44b5('0x21')](_0x44b5('0x22'),_0x163142+'-'+_0x51e470+'/'+_0xdbd4fa)[_0x44b5('0x1c')](_0x35cc5e);}return null;};}function patchUpdates(_0x52c0f0){return function(_0x5437a4){try{jsonpatch['apply'](_0x5437a4,_0x52c0f0,!![]);}catch(_0x3bcda8){return BPromise[_0x44b5('0x23')](_0x3bcda8);}return _0x5437a4[_0x44b5('0x24')]();};}function saveUpdates(_0x265f6a,_0x1cbdeb){return function(_0x474b91){if(_0x474b91){return _0x474b91[_0x44b5('0x25')](_0x265f6a)[_0x44b5('0x26')](function(_0x433260){return _0x433260;});}return null;};}function removeEntity(_0x326a3d,_0x507b0a){return function(_0x348c33){if(_0x348c33){return _0x348c33[_0x44b5('0x27')]()['then'](function(){var _0x3d4703=_0x348c33['get']({'plain':!![]});var _0xe852d0=_0x44b5('0x28');return db[_0x44b5('0x29')][_0x44b5('0x27')]({'where':{'type':_0xe852d0,'resourceId':_0x3d4703['id']}})[_0x44b5('0x26')](function(){return _0x348c33;});})[_0x44b5('0x26')](function(){_0x326a3d[_0x44b5('0x1b')](0xcc)[_0x44b5('0x2a')]();});}};}function handleEntityNotFound(_0x5f3301,_0x452558){return function(_0x1fa3d7){if(!_0x1fa3d7){_0x5f3301['sendStatus'](0x194);}return _0x1fa3d7;};}function handleError(_0x2e5255,_0x50cd61){_0x50cd61=_0x50cd61||0x1f4;return function(_0x3d6625){logger[_0x44b5('0x2b')](_0x3d6625[_0x44b5('0x2c')]);if(_0x3d6625['name']){delete _0x3d6625[_0x44b5('0x2d')];}_0x2e5255[_0x44b5('0x1b')](_0x50cd61)[_0x44b5('0x2e')](_0x3d6625);};}exports['index']=function(_0x32dc31,_0xd525d1){var _0x409c0a={},_0x4fcbec={},_0x205e2a={'count':0x0,'rows':[]};var _0x15adb2=_[_0x44b5('0x2f')](db['AnalyticExtractedReport'][_0x44b5('0x30')],function(_0x23391d){return{'name':_0x23391d[_0x44b5('0x31')],'type':_0x23391d[_0x44b5('0x32')][_0x44b5('0x33')]};});_0x4fcbec['model']=_[_0x44b5('0x2f')](_0x15adb2,'name');_0x4fcbec[_0x44b5('0x34')]=_['keys'](_0x32dc31[_0x44b5('0x34')]);_0x4fcbec[_0x44b5('0x35')]=_[_0x44b5('0x36')](_0x4fcbec[_0x44b5('0x37')],_0x4fcbec[_0x44b5('0x34')]);_0x409c0a['attributes']=_[_0x44b5('0x36')](_0x4fcbec[_0x44b5('0x37')],qs[_0x44b5('0x38')](_0x32dc31[_0x44b5('0x34')][_0x44b5('0x38')]));_0x409c0a[_0x44b5('0x39')]=_0x409c0a[_0x44b5('0x39')]['length']?_0x409c0a[_0x44b5('0x39')]:_0x4fcbec[_0x44b5('0x37')];if(!_0x32dc31[_0x44b5('0x34')][_0x44b5('0x3a')]('nolimit')){_0x409c0a[_0x44b5('0x20')]=qs[_0x44b5('0x20')](_0x32dc31[_0x44b5('0x34')]['limit']);_0x409c0a['offset']=qs[_0x44b5('0x1d')](_0x32dc31['query'][_0x44b5('0x1d')]);}_0x409c0a[_0x44b5('0x3b')]=qs[_0x44b5('0x3c')](_0x32dc31[_0x44b5('0x34')][_0x44b5('0x3c')]);_0x409c0a[_0x44b5('0x3d')]=qs[_0x44b5('0x35')](_[_0x44b5('0x3e')](_0x32dc31[_0x44b5('0x34')],_0x4fcbec['filters']),_0x15adb2);if(_0x32dc31[_0x44b5('0x34')][_0x44b5('0x3f')]){_0x409c0a[_0x44b5('0x3d')]=_[_0x44b5('0x40')](_0x409c0a['where'],{'$or':_['map'](_0x15adb2,function(_0x541756){if(_0x541756[_0x44b5('0x32')]!==_0x44b5('0x41')){var _0x3e4203={};_0x3e4203[_0x541756[_0x44b5('0x2d')]]={'$like':'%'+_0x32dc31[_0x44b5('0x34')][_0x44b5('0x3f')]+'%'};return _0x3e4203;}})});}_0x409c0a=_[_0x44b5('0x40')]({},_0x409c0a,_0x32dc31[_0x44b5('0x42')]);var _0xeb3351={'where':_0x409c0a[_0x44b5('0x3d')]};return db['AnalyticExtractedReport']['count'](_0xeb3351)['then'](function(_0x515817){_0x205e2a[_0x44b5('0x1f')]=_0x515817;if(_0x32dc31[_0x44b5('0x34')][_0x44b5('0x43')]){_0x409c0a['include']=[{'all':!![]}];}return db[_0x44b5('0x44')][_0x44b5('0x45')](_0x409c0a);})[_0x44b5('0x26')](function(_0x95eef8){_0x205e2a[_0x44b5('0x46')]=_0x95eef8;return _0x205e2a;})[_0x44b5('0x26')](respondWithFilteredResult(_0xd525d1,_0x409c0a))[_0x44b5('0x47')](handleError(_0xd525d1,null));};exports[_0x44b5('0x48')]=function(_0x270edb,_0x30fd10){var _0x574665={'raw':!![],'where':{'id':_0x270edb['params']['id']}},_0x224cfe={};_0x224cfe[_0x44b5('0x37')]=_[_0x44b5('0x49')](db['AnalyticExtractedReport'][_0x44b5('0x30')]);_0x224cfe[_0x44b5('0x34')]=_[_0x44b5('0x49')](_0x270edb['query']);_0x224cfe[_0x44b5('0x35')]=_[_0x44b5('0x36')](_0x224cfe['model'],_0x224cfe[_0x44b5('0x34')]);_0x574665[_0x44b5('0x39')]=_[_0x44b5('0x36')](_0x224cfe[_0x44b5('0x37')],qs['fields'](_0x270edb[_0x44b5('0x34')]['fields']));_0x574665[_0x44b5('0x39')]=_0x574665['attributes']['length']?_0x574665['attributes']:_0x224cfe[_0x44b5('0x37')];if(_0x270edb[_0x44b5('0x34')][_0x44b5('0x43')]){_0x574665['include']=[{'all':!![]}];}_0x574665=_['merge']({},_0x574665,_0x270edb[_0x44b5('0x42')]);return db[_0x44b5('0x44')][_0x44b5('0x4a')](_0x574665)[_0x44b5('0x26')](handleEntityNotFound(_0x30fd10,null))['then'](respondWithResult(_0x30fd10,null))[_0x44b5('0x47')](handleError(_0x30fd10,null));};exports[_0x44b5('0x4b')]=function(_0x326660,_0xed4f33){return db[_0x44b5('0x44')][_0x44b5('0x4b')](_0x326660[_0x44b5('0x4c')],{})['then'](function(_0x584218){var _0x174de3=_0x326660[_0x44b5('0x4d')][_0x44b5('0x4e')]({'plain':!![]});if(!_0x174de3)throw new Error(_0x44b5('0x4f'));if(_0x174de3['role']===_0x44b5('0x4d')){var _0x31c0bc=_0x584218[_0x44b5('0x4e')]({'plain':!![]});var _0x21dd91=_0x44b5('0x28');return db[_0x44b5('0x50')][_0x44b5('0x4a')]({'where':{'name':_0x21dd91,'userProfileId':_0x174de3[_0x44b5('0x51')]},'raw':!![]})[_0x44b5('0x26')](function(_0x29c5e9){if(_0x29c5e9&&_0x29c5e9['autoAssociation']===0x0){return db[_0x44b5('0x29')][_0x44b5('0x4b')]({'name':_0x31c0bc[_0x44b5('0x2d')],'resourceId':_0x31c0bc['id'],'type':_0x29c5e9[_0x44b5('0x2d')],'sectionId':_0x29c5e9['id']},{})[_0x44b5('0x26')](function(){return _0x584218;});}else{return _0x584218;}})['catch'](function(_0x3ea57b){logger[_0x44b5('0x2b')](_0x44b5('0x52'),_0x3ea57b);throw _0x3ea57b;});}return _0x584218;})[_0x44b5('0x26')](respondWithResult(_0xed4f33,0xc9))['catch'](handleError(_0xed4f33,null));};exports[_0x44b5('0x25')]=function(_0x129bde,_0xbf7426){if(_0x129bde[_0x44b5('0x4c')]['id']){delete _0x129bde[_0x44b5('0x4c')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x129bde[_0x44b5('0x53')]['id']}})[_0x44b5('0x26')](handleEntityNotFound(_0xbf7426,null))[_0x44b5('0x26')](saveUpdates(_0x129bde[_0x44b5('0x4c')],null))[_0x44b5('0x26')](respondWithResult(_0xbf7426,null))[_0x44b5('0x47')](handleError(_0xbf7426,null));};exports[_0x44b5('0x27')]=function(_0x40ea9a,_0x36e602){return db[_0x44b5('0x44')][_0x44b5('0x4a')]({'where':{'id':_0x40ea9a[_0x44b5('0x53')]['id']}})[_0x44b5('0x26')](handleEntityNotFound(_0x36e602,null))[_0x44b5('0x26')](removeEntity(_0x36e602,null))[_0x44b5('0x47')](handleError(_0x36e602,null));};exports[_0x44b5('0x54')]=function(_0x108c5c,_0x1636f1,_0x571d3d){return db[_0x44b5('0x44')]['find']({'where':{'id':_0x108c5c[_0x44b5('0x53')]['id']},'attributes':[_0x44b5('0x2d'),'basename',_0x44b5('0x55'),_0x44b5('0x56')],'raw':!![]})[_0x44b5('0x26')](handleEntityNotFound(_0x1636f1,null))[_0x44b5('0x26')](function(_0xc63649){if(_0xc63649){if(!fs[_0x44b5('0x57')](path[_0x44b5('0x58')](config['root'],'server/files/reports',_0xc63649[_0x44b5('0x55')]))){throw new db[(_0x44b5('0x59'))][(_0x44b5('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x108c5c[_0x44b5('0x34')][_0x44b5('0x5b')]){return _0x1636f1[_0x44b5('0x5c')](0xc8);}return _0x1636f1[_0x44b5('0x54')](path[_0x44b5('0x58')](config[_0x44b5('0x5d')],_0x44b5('0x5e'),_0xc63649['savename']),util[_0x44b5('0x5f')](_0x44b5('0x60'),_0xc63649['basename']||_0xc63649[_0x44b5('0x2d')],_0xc63649[_0x44b5('0x56')][_0x44b5('0x61')]()));}})[_0x44b5('0x47')](handleError(_0x1636f1,null));};
\ No newline at end of file
+var _0x4cab=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','UserProfileResource','error','stack','name','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','fields','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x14bea4,_0x3d7921){var _0x25ed7b=function(_0x247ed5){while(--_0x247ed5){_0x14bea4['push'](_0x14bea4['shift']());}};_0x25ed7b(++_0x3d7921);}(_0x4cab,0x1c5));var _0xb4ca=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x4cab[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xb4ca('0x0'));var rimraf=require(_0xb4ca('0x1'));var zipdir=require(_0xb4ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb4ca('0x3'));var BPromise=require(_0xb4ca('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb4ca('0x5'));var sox=require(_0xb4ca('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4ca('0x7'));var _=require(_0xb4ca('0x8'));var squel=require(_0xb4ca('0x9'));var crypto=require(_0xb4ca('0xa'));var jsforce=require(_0xb4ca('0xb'));var deskjs=require(_0xb4ca('0xc'));var toCsv=require(_0xb4ca('0xd'));var querystring=require(_0xb4ca('0xe'));var Papa=require('papaparse');var Redis=require(_0xb4ca('0xf'));var authService=require(_0xb4ca('0x10'));var qs=require(_0xb4ca('0x11'));var as=require(_0xb4ca('0x12'));var hardwareService=require(_0xb4ca('0x13'));var logger=require(_0xb4ca('0x14'))(_0xb4ca('0x15'));var utils=require(_0xb4ca('0x16'));var config=require(_0xb4ca('0x17'));var licenseUtil=require(_0xb4ca('0x18'));var db=require(_0xb4ca('0x19'))['db'];function respondWithStatusCode(_0x5ba6d5,_0x2c1dfb){_0x2c1dfb=_0x2c1dfb||0xcc;return function(_0x421481){if(_0x421481){return _0x5ba6d5['sendStatus'](_0x2c1dfb);}return _0x5ba6d5[_0xb4ca('0x1a')](_0x2c1dfb)[_0xb4ca('0x1b')]();};}function respondWithResult(_0x3c2a52,_0x129de2){_0x129de2=_0x129de2||0xc8;return function(_0x322e1e){if(_0x322e1e){return _0x3c2a52[_0xb4ca('0x1a')](_0x129de2)[_0xb4ca('0x1c')](_0x322e1e);}};}function respondWithFilteredResult(_0x26fce4,_0x3bad15){return function(_0x47b35e){if(_0x47b35e){var _0x587fa4=typeof _0x3bad15[_0xb4ca('0x1d')]===_0xb4ca('0x1e')&&typeof _0x3bad15[_0xb4ca('0x1f')]==='undefined';var _0x1e1593=_0x47b35e[_0xb4ca('0x20')];var _0x5a4847=_0x587fa4?0x0:_0x3bad15[_0xb4ca('0x1d')];var _0x37656a=_0x587fa4?_0x47b35e[_0xb4ca('0x20')]:_0x3bad15[_0xb4ca('0x1d')]+_0x3bad15['limit'];var _0x510a2a;if(_0x37656a>=_0x1e1593){_0x37656a=_0x1e1593;_0x510a2a=0xc8;}else{_0x510a2a=0xce;}_0x26fce4['status'](_0x510a2a);return _0x26fce4[_0xb4ca('0x21')](_0xb4ca('0x22'),_0x5a4847+'-'+_0x37656a+'/'+_0x1e1593)[_0xb4ca('0x1c')](_0x47b35e);}return null;};}function patchUpdates(_0x11f2f){return function(_0x5d0a7c){try{jsonpatch['apply'](_0x5d0a7c,_0x11f2f,!![]);}catch(_0x12d332){return BPromise[_0xb4ca('0x23')](_0x12d332);}return _0x5d0a7c['save']();};}function saveUpdates(_0x29573d,_0x5b4c70){return function(_0x4ea31c){if(_0x4ea31c){return _0x4ea31c[_0xb4ca('0x24')](_0x29573d)[_0xb4ca('0x25')](function(_0x153894){return _0x153894;});}return null;};}function removeEntity(_0x46347c,_0x5d0843){return function(_0x149a2d){if(_0x149a2d){return _0x149a2d[_0xb4ca('0x26')]()[_0xb4ca('0x25')](function(){var _0x25bf0b=_0x149a2d['get']({'plain':!![]});var _0x3de3fb='ExtractedReports';return db[_0xb4ca('0x27')][_0xb4ca('0x26')]({'where':{'type':_0x3de3fb,'resourceId':_0x25bf0b['id']}})['then'](function(){return _0x149a2d;});})[_0xb4ca('0x25')](function(){_0x46347c['status'](0xcc)[_0xb4ca('0x1b')]();});}};}function handleEntityNotFound(_0x322208,_0x3d9860){return function(_0x25cede){if(!_0x25cede){_0x322208['sendStatus'](0x194);}return _0x25cede;};}function handleError(_0x20f201,_0x1ed209){_0x1ed209=_0x1ed209||0x1f4;return function(_0x34bd46){logger[_0xb4ca('0x28')](_0x34bd46[_0xb4ca('0x29')]);if(_0x34bd46[_0xb4ca('0x2a')]){delete _0x34bd46[_0xb4ca('0x2a')];}_0x20f201['status'](_0x1ed209)['send'](_0x34bd46);};}exports['index']=function(_0xec0361,_0x4d2daa){var _0x290615={},_0x12dd3f={},_0x5105f0={'count':0x0,'rows':[]};var _0x1602fd=_['map'](db[_0xb4ca('0x2b')][_0xb4ca('0x2c')],function(_0x5b73e2){return{'name':_0x5b73e2[_0xb4ca('0x2d')],'type':_0x5b73e2[_0xb4ca('0x2e')]['key']};});_0x12dd3f[_0xb4ca('0x2f')]=_[_0xb4ca('0x30')](_0x1602fd,_0xb4ca('0x2a'));_0x12dd3f[_0xb4ca('0x31')]=_[_0xb4ca('0x32')](_0xec0361[_0xb4ca('0x31')]);_0x12dd3f[_0xb4ca('0x33')]=_['intersection'](_0x12dd3f[_0xb4ca('0x2f')],_0x12dd3f['query']);_0x290615[_0xb4ca('0x34')]=_[_0xb4ca('0x35')](_0x12dd3f[_0xb4ca('0x2f')],qs['fields'](_0xec0361[_0xb4ca('0x31')]['fields']));_0x290615['attributes']=_0x290615[_0xb4ca('0x34')]['length']?_0x290615['attributes']:_0x12dd3f[_0xb4ca('0x2f')];if(!_0xec0361[_0xb4ca('0x31')]['hasOwnProperty']('nolimit')){_0x290615[_0xb4ca('0x1f')]=qs[_0xb4ca('0x1f')](_0xec0361[_0xb4ca('0x31')][_0xb4ca('0x1f')]);_0x290615[_0xb4ca('0x1d')]=qs['offset'](_0xec0361[_0xb4ca('0x31')][_0xb4ca('0x1d')]);}_0x290615['order']=qs['sort'](_0xec0361['query'][_0xb4ca('0x36')]);_0x290615[_0xb4ca('0x37')]=qs['filters'](_[_0xb4ca('0x38')](_0xec0361['query'],_0x12dd3f[_0xb4ca('0x33')]),_0x1602fd);if(_0xec0361['query'][_0xb4ca('0x39')]){_0x290615[_0xb4ca('0x37')]=_[_0xb4ca('0x3a')](_0x290615['where'],{'$or':_[_0xb4ca('0x30')](_0x1602fd,function(_0x3d9e2f){if(_0x3d9e2f[_0xb4ca('0x2e')]!==_0xb4ca('0x3b')){var _0x48e67d={};_0x48e67d[_0x3d9e2f['name']]={'$like':'%'+_0xec0361[_0xb4ca('0x31')][_0xb4ca('0x39')]+'%'};return _0x48e67d;}})});}_0x290615=_['merge']({},_0x290615,_0xec0361[_0xb4ca('0x3c')]);var _0x4b99de={'where':_0x290615[_0xb4ca('0x37')]};return db[_0xb4ca('0x2b')][_0xb4ca('0x20')](_0x4b99de)[_0xb4ca('0x25')](function(_0xe9202){_0x5105f0[_0xb4ca('0x20')]=_0xe9202;if(_0xec0361[_0xb4ca('0x31')]['includeAll']){_0x290615[_0xb4ca('0x3d')]=[{'all':!![]}];}return db[_0xb4ca('0x2b')][_0xb4ca('0x3e')](_0x290615);})[_0xb4ca('0x25')](function(_0x3c0886){_0x5105f0['rows']=_0x3c0886;return _0x5105f0;})[_0xb4ca('0x25')](respondWithFilteredResult(_0x4d2daa,_0x290615))['catch'](handleError(_0x4d2daa,null));};exports[_0xb4ca('0x3f')]=function(_0x3f108d,_0x3f6d87){var _0x7f238={'raw':!![],'where':{'id':_0x3f108d[_0xb4ca('0x40')]['id']}},_0xa981ed={};_0xa981ed[_0xb4ca('0x2f')]=_[_0xb4ca('0x32')](db[_0xb4ca('0x2b')]['rawAttributes']);_0xa981ed[_0xb4ca('0x31')]=_[_0xb4ca('0x32')](_0x3f108d[_0xb4ca('0x31')]);_0xa981ed[_0xb4ca('0x33')]=_['intersection'](_0xa981ed['model'],_0xa981ed[_0xb4ca('0x31')]);_0x7f238[_0xb4ca('0x34')]=_['intersection'](_0xa981ed['model'],qs[_0xb4ca('0x41')](_0x3f108d[_0xb4ca('0x31')][_0xb4ca('0x41')]));_0x7f238[_0xb4ca('0x34')]=_0x7f238[_0xb4ca('0x34')]['length']?_0x7f238['attributes']:_0xa981ed['model'];if(_0x3f108d[_0xb4ca('0x31')][_0xb4ca('0x42')]){_0x7f238[_0xb4ca('0x3d')]=[{'all':!![]}];}_0x7f238=_[_0xb4ca('0x3a')]({},_0x7f238,_0x3f108d[_0xb4ca('0x3c')]);return db[_0xb4ca('0x2b')][_0xb4ca('0x43')](_0x7f238)[_0xb4ca('0x25')](handleEntityNotFound(_0x3f6d87,null))['then'](respondWithResult(_0x3f6d87,null))[_0xb4ca('0x44')](handleError(_0x3f6d87,null));};exports['create']=function(_0x545520,_0x22c7a6){return db['AnalyticExtractedReport'][_0xb4ca('0x45')](_0x545520[_0xb4ca('0x46')],{})['then'](function(_0xb3b928){var _0x135bb4=_0x545520['user']['get']({'plain':!![]});if(!_0x135bb4)throw new Error(_0xb4ca('0x47'));if(_0x135bb4[_0xb4ca('0x48')]===_0xb4ca('0x49')){var _0x3499bf=_0xb3b928['get']({'plain':!![]});var _0x2f330c=_0xb4ca('0x4a');return db[_0xb4ca('0x4b')][_0xb4ca('0x43')]({'where':{'name':_0x2f330c,'userProfileId':_0x135bb4[_0xb4ca('0x4c')]},'raw':!![]})['then'](function(_0x2bf5c6){if(_0x2bf5c6&&_0x2bf5c6[_0xb4ca('0x4d')]===0x0){return db['UserProfileResource'][_0xb4ca('0x45')]({'name':_0x3499bf[_0xb4ca('0x2a')],'resourceId':_0x3499bf['id'],'type':_0x2bf5c6[_0xb4ca('0x2a')],'sectionId':_0x2bf5c6['id']},{})[_0xb4ca('0x25')](function(){return _0xb3b928;});}else{return _0xb3b928;}})['catch'](function(_0x43454e){logger[_0xb4ca('0x28')](_0xb4ca('0x4e'),_0x43454e);throw _0x43454e;});}return _0xb3b928;})[_0xb4ca('0x25')](respondWithResult(_0x22c7a6,0xc9))[_0xb4ca('0x44')](handleError(_0x22c7a6,null));};exports['update']=function(_0x384f9b,_0x6028f7){if(_0x384f9b['body']['id']){delete _0x384f9b['body']['id'];}return db[_0xb4ca('0x2b')][_0xb4ca('0x43')]({'where':{'id':_0x384f9b['params']['id']}})[_0xb4ca('0x25')](handleEntityNotFound(_0x6028f7,null))[_0xb4ca('0x25')](saveUpdates(_0x384f9b[_0xb4ca('0x46')],null))[_0xb4ca('0x25')](respondWithResult(_0x6028f7,null))[_0xb4ca('0x44')](handleError(_0x6028f7,null));};exports['destroy']=function(_0x126bcf,_0xed3d38){return db[_0xb4ca('0x2b')][_0xb4ca('0x43')]({'where':{'id':_0x126bcf[_0xb4ca('0x40')]['id']}})['then'](handleEntityNotFound(_0xed3d38,null))[_0xb4ca('0x25')](removeEntity(_0xed3d38,null))[_0xb4ca('0x44')](handleError(_0xed3d38,null));};exports[_0xb4ca('0x4f')]=function(_0xc32112,_0x394c37,_0x359e62){return db[_0xb4ca('0x2b')][_0xb4ca('0x43')]({'where':{'id':_0xc32112[_0xb4ca('0x40')]['id']},'attributes':['name','basename',_0xb4ca('0x50'),_0xb4ca('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x394c37,null))[_0xb4ca('0x25')](function(_0x45090d){if(_0x45090d){if(!fs[_0xb4ca('0x52')](path[_0xb4ca('0x53')](config[_0xb4ca('0x54')],'server/files/reports',_0x45090d[_0xb4ca('0x50')]))){throw new db[(_0xb4ca('0x55'))][(_0xb4ca('0x56'))](_0xb4ca('0x57'));}if(_0xc32112['query'][_0xb4ca('0x58')]){return _0x394c37[_0xb4ca('0x59')](0xc8);}return _0x394c37[_0xb4ca('0x4f')](path[_0xb4ca('0x53')](config[_0xb4ca('0x54')],_0xb4ca('0x5a'),_0x45090d[_0xb4ca('0x50')]),util[_0xb4ca('0x5b')](_0xb4ca('0x5c'),_0x45090d[_0xb4ca('0x5d')]||_0x45090d['name'],_0x45090d[_0xb4ca('0x51')][_0xb4ca('0x5e')]()));}})[_0xb4ca('0x44')](handleError(_0x394c37,null));};
\ No newline at end of file
index d509f43..f454fa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf175=['rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2fabd5,_0x1afce5){var _0x3de696=function(_0x2fa56e){while(--_0x2fa56e){_0x2fabd5['push'](_0x2fabd5['shift']());}};_0x3de696(++_0x1afce5);}(_0xf175,0x184));var _0x5f17=function(_0x4572b6,_0x1b7ad1){_0x4572b6=_0x4572b6-0x0;var _0x224b67=_0xf175[_0x4572b6];return _0x224b67;};'use strict';var _=require(_0x5f17('0x0'));var util=require(_0x5f17('0x1'));var logger=require(_0x5f17('0x2'))(_0x5f17('0x3'));var moment=require(_0x5f17('0x4'));var BPromise=require(_0x5f17('0x5'));var rp=require(_0x5f17('0x6'));var fs=require('fs');var path=require(_0x5f17('0x7'));var rimraf=require(_0x5f17('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f17('0x9'));module['exports']=function(_0x20d4c0,_0x2b4a79){return _0x20d4c0[_0x5f17('0xa')](_0x5f17('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86b6=['../../config/logger','moment','path','rimraf','define','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x38ae46,_0x49e404){var _0x4d7729=function(_0x5d5359){while(--_0x5d5359){_0x38ae46['push'](_0x38ae46['shift']());}};_0x4d7729(++_0x49e404);}(_0x86b6,0x7f));var _0x686b=function(_0x458d5b,_0x1667a9){_0x458d5b=_0x458d5b-0x0;var _0x796a=_0x86b6[_0x458d5b];return _0x796a;};'use strict';var _=require('lodash');var util=require(_0x686b('0x0'));var logger=require(_0x686b('0x1'))('api');var moment=require(_0x686b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x686b('0x3'));var rimraf=require(_0x686b('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x535bfc,_0x2ee64f){return _0x535bfc[_0x686b('0x5')](_0x686b('0x6'),attributes,{'tableName':_0x686b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 604aee4..02ec86f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe32a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','util','randomstring'];(function(_0x495171,_0x33b4a3){var _0x55ec6a=function(_0x403a21){while(--_0x403a21){_0x495171['push'](_0x495171['shift']());}};_0x55ec6a(++_0x33b4a3);}(_0xe32a,0x7c));var _0xae32=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xe32a[_0xf44d98];return _0x5ebb04;};'use strict';var _=require('lodash');var util=require(_0xae32('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xae32('0x1'));var fs=require('fs');var Redis=require(_0xae32('0x2'));var db=require(_0xae32('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae32('0x4'))(_0xae32('0x5'));var config=require(_0xae32('0x6'));var jayson=require(_0xae32('0x7'));var client=jayson['client'][_0xae32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3368a7,_0x525414,_0x33e5ac){return new BPromise(function(_0xe98e83,_0x2f68e6){return client[_0xae32('0x9')](_0x3368a7,_0x33e5ac)[_0xae32('0xa')](function(_0x526353){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x525414,_0xae32('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x525414,'request\x20sent',JSON[_0xae32('0xc')](_0x526353));if(_0x526353[_0xae32('0xd')]){if(_0x526353['error'][_0xae32('0xe')]===0x1f4){logger[_0xae32('0xd')](_0xae32('0xf'),_0x525414,_0x526353[_0xae32('0xd')][_0xae32('0x10')]);return _0x2f68e6(_0x526353['error']['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x525414,_0x526353['error'][_0xae32('0x10')]);return _0xe98e83(_0x526353[_0xae32('0xd')][_0xae32('0x10')]);}else{logger['info'](_0xae32('0xf'),_0x525414,_0xae32('0xb'));_0xe98e83(_0x526353['result'][_0xae32('0x10')]);}})[_0xae32('0x11')](function(_0x54599b){logger[_0xae32('0xd')](_0xae32('0xf'),_0x525414,_0x54599b);_0x2f68e6(_0x54599b);});});}
\ No newline at end of file
+var _0x14d1=['request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x47c998,_0x347af6){var _0x1a8968=function(_0x3ee934){while(--_0x3ee934){_0x47c998['push'](_0x47c998['shift']());}};_0x1a8968(++_0x347af6);}(_0x14d1,0x84));var _0x114d=function(_0x474fc6,_0x897d42){_0x474fc6=_0x474fc6-0x0;var _0x3c169c=_0x14d1[_0x474fc6];return _0x3c169c;};'use strict';var _=require(_0x114d('0x0'));var util=require(_0x114d('0x1'));var moment=require('moment');var BPromise=require(_0x114d('0x2'));var rs=require(_0x114d('0x3'));var fs=require('fs');var Redis=require(_0x114d('0x4'));var db=require(_0x114d('0x5'))['db'];var utils=require(_0x114d('0x6'));var logger=require(_0x114d('0x7'))(_0x114d('0x8'));var config=require(_0x114d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x114d('0xa')][_0x114d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106ff4,_0x3b6846,_0x1dbf6a){return new BPromise(function(_0x5bfcf6,_0x213223){return client['request'](_0x106ff4,_0x1dbf6a)[_0x114d('0xc')](function(_0x5ca3fa){logger[_0x114d('0xd')](_0x114d('0xe'),_0x3b6846,_0x114d('0xf'));logger[_0x114d('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3b6846,_0x114d('0xf'),JSON[_0x114d('0x11')](_0x5ca3fa));if(_0x5ca3fa['error']){if(_0x5ca3fa[_0x114d('0x12')]['code']===0x1f4){logger[_0x114d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3b6846,_0x5ca3fa[_0x114d('0x12')][_0x114d('0x13')]);return _0x213223(_0x5ca3fa[_0x114d('0x12')][_0x114d('0x13')]);}logger[_0x114d('0x12')](_0x114d('0xe'),_0x3b6846,_0x5ca3fa[_0x114d('0x12')][_0x114d('0x13')]);return _0x5bfcf6(_0x5ca3fa[_0x114d('0x12')][_0x114d('0x13')]);}else{logger[_0x114d('0xd')](_0x114d('0xe'),_0x3b6846,_0x114d('0xf'));_0x5bfcf6(_0x5ca3fa[_0x114d('0x14')][_0x114d('0x13')]);}})['catch'](function(_0x1823a2){logger[_0x114d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3b6846,_0x1823a2);_0x213223(_0x1823a2);});});}
\ No newline at end of file
index 82ff573..9eb3cfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b17=['../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','download','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x28b146,_0x55052b){var _0x598444=function(_0x2248a9){while(--_0x2248a9){_0x28b146['push'](_0x28b146['shift']());}};_0x598444(++_0x55052b);}(_0x1b17,0xd4));var _0x71b1=function(_0x3890f8,_0x1b39df){_0x3890f8=_0x3890f8-0x0;var _0x40713e=_0x1b17[_0x3890f8];return _0x40713e;};'use strict';var multer=require(_0x71b1('0x0'));var util=require(_0x71b1('0x1'));var path=require(_0x71b1('0x2'));var timeout=require(_0x71b1('0x3'));var express=require(_0x71b1('0x4'));var router=express[_0x71b1('0x5')]();var fs_extra=require(_0x71b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x71b1('0x7'));var config=require(_0x71b1('0x8'));var controller=require(_0x71b1('0x9'));router['get']('/',auth[_0x71b1('0xa')](),controller[_0x71b1('0xb')]);router[_0x71b1('0xc')](_0x71b1('0xd'),auth[_0x71b1('0xa')](),controller['show']);router['get']('/:id/download',auth[_0x71b1('0xa')](),controller[_0x71b1('0xe')]);router[_0x71b1('0xf')]('/',auth['isAuthenticated'](),controller[_0x71b1('0x10')]);router[_0x71b1('0x11')](_0x71b1('0xd'),auth[_0x71b1('0xa')](),controller['update']);router[_0x71b1('0x12')](_0x71b1('0xd'),auth[_0x71b1('0xa')](),controller['destroy']);module[_0x71b1('0x13')]=router;
\ No newline at end of file
+var _0x2881=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5ca13a,_0x5d6ffc){var _0x1cdabc=function(_0x29a772){while(--_0x29a772){_0x5ca13a['push'](_0x5ca13a['shift']());}};_0x1cdabc(++_0x5d6ffc);}(_0x2881,0xb0));var _0x1288=function(_0x143f64,_0x1bdc60){_0x143f64=_0x143f64-0x0;var _0x3e7208=_0x2881[_0x143f64];return _0x3e7208;};'use strict';var multer=require('multer');var util=require(_0x1288('0x0'));var path=require(_0x1288('0x1'));var timeout=require(_0x1288('0x2'));var express=require(_0x1288('0x3'));var router=express[_0x1288('0x4')]();var fs_extra=require(_0x1288('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1288('0x6'));var config=require(_0x1288('0x7'));var controller=require(_0x1288('0x8'));router[_0x1288('0x9')]('/',auth[_0x1288('0xa')](),controller[_0x1288('0xb')]);router[_0x1288('0x9')](_0x1288('0xc'),auth[_0x1288('0xa')](),controller[_0x1288('0xd')]);router[_0x1288('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x1288('0xe')]('/',auth[_0x1288('0xa')](),controller[_0x1288('0xf')]);router[_0x1288('0x10')](_0x1288('0xc'),auth[_0x1288('0xa')](),controller['update']);router[_0x1288('0x11')]('/:id',auth[_0x1288('0xa')](),controller[_0x1288('0x12')]);module[_0x1288('0x13')]=router;
\ No newline at end of file
index af0a8ac..5e5cc5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf3=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x219851,_0x23ff3c){var _0x217f7f=function(_0x5e0b97){while(--_0x5e0b97){_0x219851['push'](_0x219851['shift']());}};_0x217f7f(++_0x23ff3c);}(_0x3bf3,0x15c));var _0x33bf=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3bf3[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x33bf('0x0'));module[_0x33bf('0x1')]={'field':{'type':Sequelize[_0x33bf('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x33bf('0x3')]},'format':{'type':Sequelize[_0x33bf('0x3')]},'groupBy':{'type':Sequelize[_0x33bf('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x33bf('0x3')]},'custom':{'type':Sequelize[_0x33bf('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9d58=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0xcb3d9b,_0x5bb9b5){var _0x28f017=function(_0x44efbb){while(--_0x44efbb){_0xcb3d9b['push'](_0xcb3d9b['shift']());}};_0x28f017(++_0x5bb9b5);}(_0x9d58,0x1d2));var _0x89d5=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x9d58[_0x5f382f];return _0x3bb11b;};'use strict';var Sequelize=require(_0x89d5('0x0'));module[_0x89d5('0x1')]={'field':{'type':Sequelize[_0x89d5('0x2')]},'alias':{'type':Sequelize[_0x89d5('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x89d5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x89d5('0x3')]},'custom':{'type':Sequelize[_0x89d5('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 08ee6cb..18af55f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac9=['addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','intersection','fields','length','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','bulkCreate','bulkDestroy','ids'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x9ac9,0x13e));var _0x99ac=function(_0x3ae371,_0x304d81){_0x3ae371=_0x3ae371-0x0;var _0x15796e=_0x9ac9[_0x3ae371];return _0x15796e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x99ac('0x0'));var jsonpatch=require(_0x99ac('0x1'));var rp=require('request-promise');var moment=require(_0x99ac('0x2'));var BPromise=require(_0x99ac('0x3'));var Mustache=require(_0x99ac('0x4'));var util=require(_0x99ac('0x5'));var path=require('path');var sox=require(_0x99ac('0x6'));var csv=require(_0x99ac('0x7'));var ejs=require(_0x99ac('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99ac('0x9'));var squel=require('squel');var crypto=require(_0x99ac('0xa'));var jsforce=require(_0x99ac('0xb'));var deskjs=require(_0x99ac('0xc'));var toCsv=require(_0x99ac('0x7'));var querystring=require('querystring');var Papa=require(_0x99ac('0xd'));var Redis=require(_0x99ac('0xe'));var authService=require(_0x99ac('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x99ac('0x10'));var hardwareService=require(_0x99ac('0x11'));var logger=require('../../config/logger')(_0x99ac('0x12'));var utils=require('../../config/utils');var config=require(_0x99ac('0x13'));var licenseUtil=require(_0x99ac('0x14'));var db=require(_0x99ac('0x15'))['db'];function respondWithStatusCode(_0x59e584,_0xc2d44d){_0xc2d44d=_0xc2d44d||0xcc;return function(_0x296ab9){if(_0x296ab9){return _0x59e584[_0x99ac('0x16')](_0xc2d44d);}return _0x59e584['status'](_0xc2d44d)['end']();};}function respondWithResult(_0x539d26,_0x6d2108){_0x6d2108=_0x6d2108||0xc8;return function(_0x4a50ba){if(_0x4a50ba){return _0x539d26[_0x99ac('0x17')](_0x6d2108)['json'](_0x4a50ba);}};}function respondWithFilteredResult(_0x3acbb2,_0x24fabb){return function(_0x1f1244){if(_0x1f1244){var _0x51a70d=typeof _0x24fabb[_0x99ac('0x18')]==='undefined'&&typeof _0x24fabb[_0x99ac('0x19')]==='undefined';var _0x2108b5=_0x1f1244[_0x99ac('0x1a')];var _0x389605=_0x51a70d?0x0:_0x24fabb[_0x99ac('0x18')];var _0x1a8594=_0x51a70d?_0x1f1244[_0x99ac('0x1a')]:_0x24fabb['offset']+_0x24fabb[_0x99ac('0x19')];var _0x10c777;if(_0x1a8594>=_0x2108b5){_0x1a8594=_0x2108b5;_0x10c777=0xc8;}else{_0x10c777=0xce;}_0x3acbb2['status'](_0x10c777);return _0x3acbb2[_0x99ac('0x1b')](_0x99ac('0x1c'),_0x389605+'-'+_0x1a8594+'/'+_0x2108b5)[_0x99ac('0x1d')](_0x1f1244);}return null;};}function patchUpdates(_0x5c46dc){return function(_0x52357f){try{jsonpatch[_0x99ac('0x1e')](_0x52357f,_0x5c46dc,!![]);}catch(_0x512345){return BPromise['reject'](_0x512345);}return _0x52357f[_0x99ac('0x1f')]();};}function saveUpdates(_0x3a03ad,_0xb611da){return function(_0x170b35){if(_0x170b35){return _0x170b35[_0x99ac('0x20')](_0x3a03ad)[_0x99ac('0x21')](function(_0xfbd7a0){return _0xfbd7a0;});}return null;};}function removeEntity(_0x4c514c,_0xcddab6){return function(_0x4de578){if(_0x4de578){return _0x4de578[_0x99ac('0x22')]()[_0x99ac('0x21')](function(){_0x4c514c[_0x99ac('0x17')](0xcc)[_0x99ac('0x23')]();});}};}function handleEntityNotFound(_0x51919f,_0x27163c){return function(_0x4e40ca){if(!_0x4e40ca){_0x51919f[_0x99ac('0x16')](0x194);}return _0x4e40ca;};}function handleError(_0x43e1cc,_0x5a51af){_0x5a51af=_0x5a51af||0x1f4;return function(_0x416fe0){logger[_0x99ac('0x24')](_0x416fe0[_0x99ac('0x25')]);if(_0x416fe0[_0x99ac('0x26')]){delete _0x416fe0[_0x99ac('0x26')];}_0x43e1cc[_0x99ac('0x17')](_0x5a51af)['send'](_0x416fe0);};}exports[_0x99ac('0x27')]=function(_0x349309,_0x402300){var _0x15787f={},_0x58c6d5={},_0x52a46d={'count':0x0,'rows':[]};var _0x4a6774=_[_0x99ac('0x28')](db[_0x99ac('0x29')][_0x99ac('0x2a')],function(_0x37d275){return{'name':_0x37d275[_0x99ac('0x2b')],'type':_0x37d275[_0x99ac('0x2c')]['key']};});_0x58c6d5[_0x99ac('0x2d')]=_['map'](_0x4a6774,'name');_0x58c6d5[_0x99ac('0x2e')]=_['keys'](_0x349309['query']);_0x58c6d5['filters']=_[_0x99ac('0x2f')](_0x58c6d5[_0x99ac('0x2d')],_0x58c6d5[_0x99ac('0x2e')]);_0x15787f['attributes']=_[_0x99ac('0x2f')](_0x58c6d5[_0x99ac('0x2d')],qs[_0x99ac('0x30')](_0x349309[_0x99ac('0x2e')][_0x99ac('0x30')]));_0x15787f['attributes']=_0x15787f['attributes'][_0x99ac('0x31')]?_0x15787f[_0x99ac('0x32')]:_0x58c6d5['model'];if(!_0x349309[_0x99ac('0x2e')]['hasOwnProperty'](_0x99ac('0x33'))){_0x15787f[_0x99ac('0x19')]=qs[_0x99ac('0x19')](_0x349309[_0x99ac('0x2e')]['limit']);_0x15787f[_0x99ac('0x18')]=qs[_0x99ac('0x18')](_0x349309[_0x99ac('0x2e')][_0x99ac('0x18')]);}_0x15787f['order']=qs[_0x99ac('0x34')](_0x349309['query'][_0x99ac('0x34')]);_0x15787f[_0x99ac('0x35')]=qs[_0x99ac('0x36')](_[_0x99ac('0x37')](_0x349309[_0x99ac('0x2e')],_0x58c6d5['filters']),_0x4a6774);if(_0x349309[_0x99ac('0x2e')][_0x99ac('0x38')]){_0x15787f['where']=_[_0x99ac('0x39')](_0x15787f[_0x99ac('0x35')],{'$or':_['map'](_0x4a6774,function(_0x220f07){if(_0x220f07[_0x99ac('0x2c')]!==_0x99ac('0x3a')){var _0x468d86={};_0x468d86[_0x220f07[_0x99ac('0x26')]]={'$like':'%'+_0x349309[_0x99ac('0x2e')][_0x99ac('0x38')]+'%'};return _0x468d86;}})});}_0x15787f=_[_0x99ac('0x39')]({},_0x15787f,_0x349309[_0x99ac('0x3b')]);var _0x324de7={'where':_0x15787f['where']};return db[_0x99ac('0x29')][_0x99ac('0x1a')](_0x324de7)['then'](function(_0x22768e){_0x52a46d[_0x99ac('0x1a')]=_0x22768e;if(_0x349309['query']['includeAll']){_0x15787f[_0x99ac('0x3c')]=[{'all':!![]}];}return db[_0x99ac('0x29')][_0x99ac('0x3d')](_0x15787f);})['then'](function(_0x31a77f){_0x52a46d['rows']=_0x31a77f;return _0x52a46d;})[_0x99ac('0x21')](respondWithFilteredResult(_0x402300,_0x15787f))[_0x99ac('0x3e')](handleError(_0x402300,null));};exports['show']=function(_0x432bbb,_0x58d8ac){var _0x285a12={'raw':![],'where':{'id':_0x432bbb[_0x99ac('0x3f')]['id']}},_0x5a2812={};_0x5a2812[_0x99ac('0x2d')]=_[_0x99ac('0x40')](db[_0x99ac('0x29')]['rawAttributes']);_0x5a2812[_0x99ac('0x2e')]=_['keys'](_0x432bbb[_0x99ac('0x2e')]);_0x5a2812[_0x99ac('0x36')]=_['intersection'](_0x5a2812[_0x99ac('0x2d')],_0x5a2812['query']);_0x285a12[_0x99ac('0x32')]=_['intersection'](_0x5a2812[_0x99ac('0x2d')],qs[_0x99ac('0x30')](_0x432bbb[_0x99ac('0x2e')]['fields']));_0x285a12['attributes']=_0x285a12[_0x99ac('0x32')][_0x99ac('0x31')]?_0x285a12[_0x99ac('0x32')]:_0x5a2812[_0x99ac('0x2d')];if(_0x432bbb[_0x99ac('0x2e')][_0x99ac('0x41')]){_0x285a12[_0x99ac('0x3c')]=[{'all':!![]}];}_0x285a12=_[_0x99ac('0x39')]({},_0x285a12,_0x432bbb['options']);return db[_0x99ac('0x29')][_0x99ac('0x42')](_0x285a12)[_0x99ac('0x21')](handleEntityNotFound(_0x58d8ac,null))[_0x99ac('0x21')](respondWithResult(_0x58d8ac,null))[_0x99ac('0x3e')](handleError(_0x58d8ac,null));};exports[_0x99ac('0x43')]=function(_0x4cf865,_0x3055f5){return db[_0x99ac('0x29')][_0x99ac('0x43')](_0x4cf865[_0x99ac('0x44')],{})[_0x99ac('0x21')](respondWithResult(_0x3055f5,0xc9))[_0x99ac('0x3e')](handleError(_0x3055f5,null));};exports[_0x99ac('0x45')]=function(_0x43dcee,_0x38328){return db[_0x99ac('0x29')][_0x99ac('0x45')](_0x43dcee[_0x99ac('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x38328,0xc9))[_0x99ac('0x3e')](handleError(_0x38328,null));};exports[_0x99ac('0x20')]=function(_0x1d8fd9,_0x49dfb7){if(_0x1d8fd9[_0x99ac('0x44')]['id']){delete _0x1d8fd9[_0x99ac('0x44')]['id'];}return db[_0x99ac('0x29')][_0x99ac('0x42')]({'where':{'id':_0x1d8fd9['params']['id']}})[_0x99ac('0x21')](handleEntityNotFound(_0x49dfb7,null))[_0x99ac('0x21')](saveUpdates(_0x1d8fd9[_0x99ac('0x44')],null))['then'](respondWithResult(_0x49dfb7,null))['catch'](handleError(_0x49dfb7,null));};exports[_0x99ac('0x22')]=function(_0x913739,_0xf3e333){return db[_0x99ac('0x29')][_0x99ac('0x42')]({'where':{'id':_0x913739['params']['id']}})[_0x99ac('0x21')](handleEntityNotFound(_0xf3e333,null))['then'](removeEntity(_0xf3e333,null))[_0x99ac('0x3e')](handleError(_0xf3e333,null));};exports[_0x99ac('0x46')]=function(_0x5e4ce9,_0x560fe3){return db[_0x99ac('0x29')][_0x99ac('0x22')]({'where':{'id':_0x5e4ce9[_0x99ac('0x2e')][_0x99ac('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x560fe3,0xcc))['catch'](handleError(_0x560fe3,null));};exports[_0x99ac('0x48')]=function(_0x24026c,_0x5c2ac9,_0x2a3df2){return db[_0x99ac('0x49')][_0x99ac('0x4a')]({'where':{'id':_0x24026c['params']['id']}})[_0x99ac('0x21')](handleEntityNotFound(_0x5c2ac9,null))[_0x99ac('0x21')](function(_0xb61b22){if(_0xb61b22){return db[_0x99ac('0x4b')][_0x99ac('0x4c')](function(_0x5dfaf5){return db[_0x99ac('0x29')][_0x99ac('0x22')]({'where':{'CustomReportId':_0x24026c[_0x99ac('0x3f')]['id']},'transaction':_0x5dfaf5})[_0x99ac('0x21')](function(_0x57e31b){var _0x27f23e=_['map'](_0x24026c[_0x99ac('0x44')],function(_0x4acf79){delete _0x4acf79['id'];_0x4acf79[_0x99ac('0x4d')]=_0x24026c[_0x99ac('0x3f')]['id'];return _0x4acf79;});return db['AnalyticFieldReport'][_0x99ac('0x45')](_0x27f23e,{'transaction':_0x5dfaf5});});})[_0x99ac('0x21')](function(){return db[_0x99ac('0x29')][_0x99ac('0x3d')]({'where':{'CustomReportId':_0x24026c[_0x99ac('0x3f')]['id']}});});}})[_0x99ac('0x21')](respondWithResult(_0x5c2ac9,null))[_0x99ac('0x3e')](handleError(_0x5c2ac9,null));};
\ No newline at end of file
+var _0x8cc2=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','eml-format','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x41a6bf,_0x21318e){var _0x5325df=function(_0x25f276){while(--_0x25f276){_0x41a6bf['push'](_0x41a6bf['shift']());}};_0x5325df(++_0x21318e);}(_0x8cc2,0x178));var _0x28cc=function(_0x4b1036,_0x4958ab){_0x4b1036=_0x4b1036-0x0;var _0x3c8cab=_0x8cc2[_0x4b1036];return _0x3c8cab;};'use strict';var emlformat=require(_0x28cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x28cc('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x28cc('0x2'));var util=require('util');var path=require(_0x28cc('0x3'));var sox=require('sox');var csv=require(_0x28cc('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28cc('0x5'));var squel=require(_0x28cc('0x6'));var crypto=require(_0x28cc('0x7'));var jsforce=require(_0x28cc('0x8'));var deskjs=require(_0x28cc('0x9'));var toCsv=require(_0x28cc('0x4'));var querystring=require(_0x28cc('0xa'));var Papa=require(_0x28cc('0xb'));var Redis=require(_0x28cc('0xc'));var authService=require(_0x28cc('0xd'));var qs=require(_0x28cc('0xe'));var as=require(_0x28cc('0xf'));var hardwareService=require(_0x28cc('0x10'));var logger=require(_0x28cc('0x11'))('api');var utils=require(_0x28cc('0x12'));var config=require(_0x28cc('0x13'));var licenseUtil=require(_0x28cc('0x14'));var db=require(_0x28cc('0x15'))['db'];function respondWithStatusCode(_0x4ee253,_0x4f3af8){_0x4f3af8=_0x4f3af8||0xcc;return function(_0x420309){if(_0x420309){return _0x4ee253[_0x28cc('0x16')](_0x4f3af8);}return _0x4ee253[_0x28cc('0x17')](_0x4f3af8)[_0x28cc('0x18')]();};}function respondWithResult(_0x599771,_0x568933){_0x568933=_0x568933||0xc8;return function(_0x25dcfe){if(_0x25dcfe){return _0x599771[_0x28cc('0x17')](_0x568933)[_0x28cc('0x19')](_0x25dcfe);}};}function respondWithFilteredResult(_0x29e567,_0x1854e3){return function(_0xb52283){if(_0xb52283){var _0x126529=typeof _0x1854e3['offset']===_0x28cc('0x1a')&&typeof _0x1854e3[_0x28cc('0x1b')]==='undefined';var _0x1f855f=_0xb52283[_0x28cc('0x1c')];var _0x482dc4=_0x126529?0x0:_0x1854e3['offset'];var _0x4abdf7=_0x126529?_0xb52283[_0x28cc('0x1c')]:_0x1854e3[_0x28cc('0x1d')]+_0x1854e3['limit'];var _0x5d8cf9;if(_0x4abdf7>=_0x1f855f){_0x4abdf7=_0x1f855f;_0x5d8cf9=0xc8;}else{_0x5d8cf9=0xce;}_0x29e567[_0x28cc('0x17')](_0x5d8cf9);return _0x29e567[_0x28cc('0x1e')](_0x28cc('0x1f'),_0x482dc4+'-'+_0x4abdf7+'/'+_0x1f855f)[_0x28cc('0x19')](_0xb52283);}return null;};}function patchUpdates(_0x512243){return function(_0x27c4c5){try{jsonpatch[_0x28cc('0x20')](_0x27c4c5,_0x512243,!![]);}catch(_0x1bc499){return BPromise[_0x28cc('0x21')](_0x1bc499);}return _0x27c4c5['save']();};}function saveUpdates(_0x561fef,_0x1bfb76){return function(_0x1b1291){if(_0x1b1291){return _0x1b1291[_0x28cc('0x22')](_0x561fef)[_0x28cc('0x23')](function(_0x1fdd54){return _0x1fdd54;});}return null;};}function removeEntity(_0x26a103,_0x104644){return function(_0x54d80d){if(_0x54d80d){return _0x54d80d['destroy']()[_0x28cc('0x23')](function(){_0x26a103['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3123,_0x4797b2){return function(_0x337936){if(!_0x337936){_0x4d3123[_0x28cc('0x16')](0x194);}return _0x337936;};}function handleError(_0x1ff0eb,_0x27a8bb){_0x27a8bb=_0x27a8bb||0x1f4;return function(_0x3eec41){logger['error'](_0x3eec41[_0x28cc('0x24')]);if(_0x3eec41['name']){delete _0x3eec41[_0x28cc('0x25')];}_0x1ff0eb[_0x28cc('0x17')](_0x27a8bb)['send'](_0x3eec41);};}exports[_0x28cc('0x26')]=function(_0x42b156,_0x492949){var _0x72a367={},_0x385feb={},_0xe22363={'count':0x0,'rows':[]};var _0x12ba49=_[_0x28cc('0x27')](db[_0x28cc('0x28')][_0x28cc('0x29')],function(_0x3a0521){return{'name':_0x3a0521[_0x28cc('0x2a')],'type':_0x3a0521['type'][_0x28cc('0x2b')]};});_0x385feb['model']=_[_0x28cc('0x27')](_0x12ba49,_0x28cc('0x25'));_0x385feb[_0x28cc('0x2c')]=_[_0x28cc('0x2d')](_0x42b156['query']);_0x385feb['filters']=_[_0x28cc('0x2e')](_0x385feb['model'],_0x385feb[_0x28cc('0x2c')]);_0x72a367[_0x28cc('0x2f')]=_[_0x28cc('0x2e')](_0x385feb[_0x28cc('0x30')],qs[_0x28cc('0x31')](_0x42b156[_0x28cc('0x2c')]['fields']));_0x72a367['attributes']=_0x72a367[_0x28cc('0x2f')]['length']?_0x72a367['attributes']:_0x385feb[_0x28cc('0x30')];if(!_0x42b156[_0x28cc('0x2c')][_0x28cc('0x32')](_0x28cc('0x33'))){_0x72a367[_0x28cc('0x1b')]=qs['limit'](_0x42b156['query']['limit']);_0x72a367['offset']=qs[_0x28cc('0x1d')](_0x42b156[_0x28cc('0x2c')][_0x28cc('0x1d')]);}_0x72a367[_0x28cc('0x34')]=qs[_0x28cc('0x35')](_0x42b156['query']['sort']);_0x72a367[_0x28cc('0x36')]=qs[_0x28cc('0x37')](_[_0x28cc('0x38')](_0x42b156[_0x28cc('0x2c')],_0x385feb[_0x28cc('0x37')]),_0x12ba49);if(_0x42b156[_0x28cc('0x2c')][_0x28cc('0x39')]){_0x72a367[_0x28cc('0x36')]=_['merge'](_0x72a367['where'],{'$or':_[_0x28cc('0x27')](_0x12ba49,function(_0x1e674b){if(_0x1e674b['type']!==_0x28cc('0x3a')){var _0x23bb23={};_0x23bb23[_0x1e674b[_0x28cc('0x25')]]={'$like':'%'+_0x42b156[_0x28cc('0x2c')][_0x28cc('0x39')]+'%'};return _0x23bb23;}})});}_0x72a367=_[_0x28cc('0x3b')]({},_0x72a367,_0x42b156[_0x28cc('0x3c')]);var _0x86c184={'where':_0x72a367['where']};return db['AnalyticFieldReport'][_0x28cc('0x1c')](_0x86c184)[_0x28cc('0x23')](function(_0x4cfe1e){_0xe22363[_0x28cc('0x1c')]=_0x4cfe1e;if(_0x42b156['query'][_0x28cc('0x3d')]){_0x72a367['include']=[{'all':!![]}];}return db[_0x28cc('0x28')][_0x28cc('0x3e')](_0x72a367);})[_0x28cc('0x23')](function(_0x27ede2){_0xe22363[_0x28cc('0x3f')]=_0x27ede2;return _0xe22363;})[_0x28cc('0x23')](respondWithFilteredResult(_0x492949,_0x72a367))[_0x28cc('0x40')](handleError(_0x492949,null));};exports['show']=function(_0xec0e61,_0x22c43c){var _0x295863={'raw':![],'where':{'id':_0xec0e61[_0x28cc('0x41')]['id']}},_0x4515e9={};_0x4515e9[_0x28cc('0x30')]=_[_0x28cc('0x2d')](db[_0x28cc('0x28')][_0x28cc('0x29')]);_0x4515e9['query']=_[_0x28cc('0x2d')](_0xec0e61[_0x28cc('0x2c')]);_0x4515e9[_0x28cc('0x37')]=_[_0x28cc('0x2e')](_0x4515e9['model'],_0x4515e9[_0x28cc('0x2c')]);_0x295863[_0x28cc('0x2f')]=_['intersection'](_0x4515e9[_0x28cc('0x30')],qs[_0x28cc('0x31')](_0xec0e61[_0x28cc('0x2c')][_0x28cc('0x31')]));_0x295863['attributes']=_0x295863[_0x28cc('0x2f')][_0x28cc('0x42')]?_0x295863['attributes']:_0x4515e9['model'];if(_0xec0e61[_0x28cc('0x2c')][_0x28cc('0x3d')]){_0x295863[_0x28cc('0x43')]=[{'all':!![]}];}_0x295863=_[_0x28cc('0x3b')]({},_0x295863,_0xec0e61['options']);return db['AnalyticFieldReport'][_0x28cc('0x44')](_0x295863)[_0x28cc('0x23')](handleEntityNotFound(_0x22c43c,null))[_0x28cc('0x23')](respondWithResult(_0x22c43c,null))['catch'](handleError(_0x22c43c,null));};exports[_0x28cc('0x45')]=function(_0x559403,_0x319a48){return db['AnalyticFieldReport'][_0x28cc('0x45')](_0x559403[_0x28cc('0x46')],{})[_0x28cc('0x23')](respondWithResult(_0x319a48,0xc9))[_0x28cc('0x40')](handleError(_0x319a48,null));};exports[_0x28cc('0x47')]=function(_0x5d3098,_0x59f2c2){return db[_0x28cc('0x28')][_0x28cc('0x47')](_0x5d3098[_0x28cc('0x46')],{'raw':![],'individualHooks':!![]})[_0x28cc('0x23')](respondWithResult(_0x59f2c2,0xc9))[_0x28cc('0x40')](handleError(_0x59f2c2,null));};exports[_0x28cc('0x22')]=function(_0x39d252,_0x49e302){if(_0x39d252[_0x28cc('0x46')]['id']){delete _0x39d252[_0x28cc('0x46')]['id'];}return db[_0x28cc('0x28')][_0x28cc('0x44')]({'where':{'id':_0x39d252[_0x28cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x49e302,null))[_0x28cc('0x23')](saveUpdates(_0x39d252[_0x28cc('0x46')],null))[_0x28cc('0x23')](respondWithResult(_0x49e302,null))['catch'](handleError(_0x49e302,null));};exports[_0x28cc('0x48')]=function(_0x33beb5,_0x354e2a){return db[_0x28cc('0x28')][_0x28cc('0x44')]({'where':{'id':_0x33beb5[_0x28cc('0x41')]['id']}})[_0x28cc('0x23')](handleEntityNotFound(_0x354e2a,null))['then'](removeEntity(_0x354e2a,null))['catch'](handleError(_0x354e2a,null));};exports[_0x28cc('0x49')]=function(_0x1d2359,_0x147e70){return db[_0x28cc('0x28')][_0x28cc('0x48')]({'where':{'id':_0x1d2359[_0x28cc('0x2c')][_0x28cc('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x28cc('0x23')](respondWithResult(_0x147e70,0xcc))[_0x28cc('0x40')](handleError(_0x147e70,null));};exports[_0x28cc('0x4b')]=function(_0x56d53d,_0xcbc7a7,_0x52b442){return db[_0x28cc('0x4c')]['findOne']({'where':{'id':_0x56d53d[_0x28cc('0x41')]['id']}})[_0x28cc('0x23')](handleEntityNotFound(_0xcbc7a7,null))[_0x28cc('0x23')](function(_0x30b365){if(_0x30b365){return db[_0x28cc('0x4d')]['transaction'](function(_0x3236ad){return db[_0x28cc('0x28')]['destroy']({'where':{'CustomReportId':_0x56d53d['params']['id']},'transaction':_0x3236ad})[_0x28cc('0x23')](function(_0x23675e){var _0xab3bbf=_[_0x28cc('0x27')](_0x56d53d['body'],function(_0x253fb6){delete _0x253fb6['id'];_0x253fb6[_0x28cc('0x4e')]=_0x56d53d[_0x28cc('0x41')]['id'];return _0x253fb6;});return db[_0x28cc('0x28')][_0x28cc('0x47')](_0xab3bbf,{'transaction':_0x3236ad});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x56d53d[_0x28cc('0x41')]['id']}});});}})[_0x28cc('0x23')](respondWithResult(_0xcbc7a7,null))['catch'](handleError(_0xcbc7a7,null));};
\ No newline at end of file
index 155daf3..2291026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e71=['path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','api','moment','request-promise'];(function(_0x2ab44d,_0x4190a1){var _0x37b1aa=function(_0x4caa61){while(--_0x4caa61){_0x2ab44d['push'](_0x2ab44d['shift']());}};_0x37b1aa(++_0x4190a1);}(_0x9e71,0x18c));var _0x19e7=function(_0x4e715b,_0x32b1b8){_0x4e715b=_0x4e715b-0x0;var _0x1ebda1=_0x9e71[_0x4e715b];return _0x1ebda1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x19e7('0x0'));var moment=require(_0x19e7('0x1'));var BPromise=require('bluebird');var rp=require(_0x19e7('0x2'));var fs=require('fs');var path=require(_0x19e7('0x3'));var rimraf=require('rimraf');var config=require(_0x19e7('0x4'));var attributes=require(_0x19e7('0x5'));module['exports']=function(_0x573b3e,_0x9a1427){return _0x573b3e['define'](_0x19e7('0x6'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbdd=['AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x27cd2c,_0x2a8354){var _0x336cc9=function(_0x49abaf){while(--_0x49abaf){_0x27cd2c['push'](_0x27cd2c['shift']());}};_0x336cc9(++_0x2a8354);}(_0xdbdd,0xb6));var _0xddbd=function(_0x303e6f,_0x22f5eb){_0x303e6f=_0x303e6f-0x0;var _0x11f785=_0xdbdd[_0x303e6f];return _0x11f785;};'use strict';var _=require(_0xddbd('0x0'));var util=require(_0xddbd('0x1'));var logger=require('../../config/logger')(_0xddbd('0x2'));var moment=require(_0xddbd('0x3'));var BPromise=require(_0xddbd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddbd('0x5'));var rimraf=require(_0xddbd('0x6'));var config=require(_0xddbd('0x7'));var attributes=require(_0xddbd('0x8'));module[_0xddbd('0x9')]=function(_0x1e0f71,_0x33f508){return _0x1e0f71['define'](_0xddbd('0xa'),attributes,{'tableName':_0xddbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 81dbd65..ce3e4f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524b=['client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x179f0e,_0x15528d){var _0x3c7912=function(_0x577458){while(--_0x577458){_0x179f0e['push'](_0x179f0e['shift']());}};_0x3c7912(++_0x15528d);}(_0x524b,0xe9));var _0xb524=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x524b[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xb524('0x0'));var util=require(_0xb524('0x1'));var moment=require(_0xb524('0x2'));var BPromise=require(_0xb524('0x3'));var rs=require(_0xb524('0x4'));var fs=require('fs');var Redis=require(_0xb524('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb524('0x7'));var jayson=require(_0xb524('0x8'));var client=jayson[_0xb524('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27bbe3,_0x23c974,_0x3c7172){return new BPromise(function(_0x17ec64,_0xd1a376){return client[_0xb524('0xa')](_0x27bbe3,_0x3c7172)[_0xb524('0xb')](function(_0x404877){logger[_0xb524('0xc')](_0xb524('0xd'),_0x23c974,_0xb524('0xe'));logger[_0xb524('0xf')](_0xb524('0x10'),_0x23c974,_0xb524('0xe'),JSON[_0xb524('0x11')](_0x404877));if(_0x404877[_0xb524('0x12')]){if(_0x404877['error'][_0xb524('0x13')]===0x1f4){logger[_0xb524('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23c974,_0x404877[_0xb524('0x12')]['message']);return _0xd1a376(_0x404877[_0xb524('0x12')]['message']);}logger[_0xb524('0x12')](_0xb524('0xd'),_0x23c974,_0x404877[_0xb524('0x12')][_0xb524('0x14')]);return _0x17ec64(_0x404877[_0xb524('0x12')][_0xb524('0x14')]);}else{logger[_0xb524('0xc')](_0xb524('0xd'),_0x23c974,'request\x20sent');_0x17ec64(_0x404877['result']['message']);}})[_0xb524('0x15')](function(_0x37e525){logger[_0xb524('0x12')](_0xb524('0xd'),_0x23c974,_0x37e525);_0xd1a376(_0x37e525);});});}
\ No newline at end of file
+var _0x4675=['request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x124742,_0x581275){var _0x19f86f=function(_0x280104){while(--_0x280104){_0x124742['push'](_0x124742['shift']());}};_0x19f86f(++_0x581275);}(_0x4675,0x106));var _0x5467=function(_0x3f868d,_0x1fcc42){_0x3f868d=_0x3f868d-0x0;var _0x557e0a=_0x4675[_0x3f868d];return _0x557e0a;};'use strict';var _=require(_0x5467('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5467('0x1'));var fs=require('fs');var Redis=require(_0x5467('0x2'));var db=require(_0x5467('0x3'))['db'];var utils=require(_0x5467('0x4'));var logger=require(_0x5467('0x5'))('rpc');var config=require(_0x5467('0x6'));var jayson=require(_0x5467('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58e065,_0x5b6ef4,_0x4a5cd2){return new BPromise(function(_0x1c81f0,_0x4a624f){return client[_0x5467('0x8')](_0x58e065,_0x4a5cd2)[_0x5467('0x9')](function(_0x23868e){logger['info'](_0x5467('0xa'),_0x5b6ef4,'request\x20sent');logger[_0x5467('0xb')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5b6ef4,_0x5467('0xc'),JSON[_0x5467('0xd')](_0x23868e));if(_0x23868e[_0x5467('0xe')]){if(_0x23868e['error'][_0x5467('0xf')]===0x1f4){logger['error'](_0x5467('0xa'),_0x5b6ef4,_0x23868e[_0x5467('0xe')][_0x5467('0x10')]);return _0x4a624f(_0x23868e[_0x5467('0xe')]['message']);}logger['error'](_0x5467('0xa'),_0x5b6ef4,_0x23868e[_0x5467('0xe')][_0x5467('0x10')]);return _0x1c81f0(_0x23868e[_0x5467('0xe')]['message']);}else{logger[_0x5467('0x11')](_0x5467('0xa'),_0x5b6ef4,_0x5467('0xc'));_0x1c81f0(_0x23868e['result']['message']);}})['catch'](function(_0xe64b99){logger[_0x5467('0xe')](_0x5467('0xa'),_0x5b6ef4,_0xe64b99);_0x4a624f(_0xe64b99);});});}
\ No newline at end of file
index be47108..78a37be 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(_0x48643b,_0x19fbf8){var _0x380d2e=function(_0x1f321b){while(--_0x1f321b){_0x48643b['push'](_0x48643b['shift']());}};_0x380d2e(++_0x19fbf8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x55057d,_0x4268bf){var _0x453765=function(_0x4da13f){while(--_0x4da13f){_0x55057d['push'](_0x55057d['shift']());}};_0x453765(++_0x4268bf);}(_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['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 340b048..73dfaa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc91b=['name','TEXT','sequelize','exports','STRING'];(function(_0x427ced,_0x39cfe4){var _0x2fbe76=function(_0x10686d){while(--_0x10686d){_0x427ced['push'](_0x427ced['shift']());}};_0x2fbe76(++_0x39cfe4);}(_0xc91b,0x16f));var _0xbc91=function(_0x55b7ac,_0x1822ee){_0x55b7ac=_0x55b7ac-0x0;var _0x1c0c6a=_0xc91b[_0x55b7ac];return _0x1c0c6a;};'use strict';var Sequelize=require(_0xbc91('0x0'));module[_0xbc91('0x1')]={'name':{'type':Sequelize[_0xbc91('0x2')],'allowNull':![],'unique':_0xbc91('0x3')},'table':{'type':Sequelize[_0xbc91('0x2')]},'metric':{'type':Sequelize[_0xbc91('0x4')]},'description':{'type':Sequelize[_0xbc91('0x2')]}};
\ No newline at end of file
+var _0x3f59=['STRING','TEXT','sequelize','exports','name'];(function(_0x5f1421,_0x4a8059){var _0x43039e=function(_0x105506){while(--_0x105506){_0x5f1421['push'](_0x5f1421['shift']());}};_0x43039e(++_0x4a8059);}(_0x3f59,0x1b0));var _0x93f5=function(_0x365416,_0x3180a7){_0x365416=_0x365416-0x0;var _0x42742a=_0x3f59[_0x365416];return _0x42742a;};'use strict';var Sequelize=require(_0x93f5('0x0'));module[_0x93f5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x93f5('0x2')},'table':{'type':Sequelize[_0x93f5('0x3')]},'metric':{'type':Sequelize[_0x93f5('0x4')]},'description':{'type':Sequelize[_0x93f5('0x3')]}};
\ No newline at end of file
index d066bee..3d32415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x2150d9,_0x23c4aa){var _0x54fa94=function(_0x2b0c34){while(--_0x2b0c34){_0x2150d9['push'](_0x2150d9['shift']());}};_0x54fa94(++_0x23c4aa);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x30631e,_0x10187f){_0x30631e=_0x30631e-0x0;var _0x58eda6=_0x8d0e[_0x30631e];return _0x58eda6;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x36a4e5,_0xe2199){var _0x39c2b1=function(_0x1d07f7){while(--_0x1d07f7){_0x36a4e5['push'](_0x36a4e5['shift']());}};_0x39c2b1(++_0xe2199);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2ed1a0,_0x36acd9){_0x2ed1a0=_0x2ed1a0-0x0;var _0x3d272e=_0xf2ca[_0x2ed1a0];return _0x3d272e;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
index 7011651..d22f13d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe225=['rimraf','define','AnalyticMetric','analytics_metrics','util','../../config/logger','request-promise'];(function(_0x3f6f7b,_0x59216f){var _0x59bff8=function(_0x395ef6){while(--_0x395ef6){_0x3f6f7b['push'](_0x3f6f7b['shift']());}};_0x59bff8(++_0x59216f);}(_0xe225,0x1bd));var _0x5e22=function(_0x900a8d,_0x1f009a){_0x900a8d=_0x900a8d-0x0;var _0x5b80fc=_0xe225[_0x900a8d];return _0x5b80fc;};'use strict';var _=require('lodash');var util=require(_0x5e22('0x0'));var logger=require(_0x5e22('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e22('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e22('0x3'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x45595c,_0x35248d){return _0x45595c[_0x5e22('0x4')](_0x5e22('0x5'),attributes,{'tableName':_0x5e22('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5655=['../../config/logger','api','moment','bluebird','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x5655,0x15e));var _0x5565=function(_0x22eb22,_0x5b45b4){_0x22eb22=_0x22eb22-0x0;var _0x235960=_0x5655[_0x22eb22];return _0x235960;};'use strict';var _=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var logger=require(_0x5565('0x2'))(_0x5565('0x3'));var moment=require(_0x5565('0x4'));var BPromise=require(_0x5565('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5565('0x6'));var config=require('../../config/environment');var attributes=require(_0x5565('0x7'));module[_0x5565('0x8')]=function(_0x37954f,_0x93a8e5){return _0x37954f[_0x5565('0x9')]('AnalyticMetric',attributes,{'tableName':_0x5565('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7fafaf9..8dba300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7bf=['http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0xc7bf,0x109));var _0xfc7b=function(_0x4e16ed,_0x14c9e8){_0x4e16ed=_0x4e16ed-0x0;var _0x4ff429=_0xc7bf[_0x4e16ed];return _0x4ff429;};'use strict';var _=require(_0xfc7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfc7b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc7b('0x2'));var db=require(_0xfc7b('0x3'))['db'];var utils=require(_0xfc7b('0x4'));var logger=require(_0xfc7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc7b('0x6'));var client=jayson['client'][_0xfc7b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43f819,_0x44ef89,_0x299c47){return new BPromise(function(_0x169b8c,_0x4cc188){return client[_0xfc7b('0x8')](_0x43f819,_0x299c47)[_0xfc7b('0x9')](function(_0x93849){logger['info'](_0xfc7b('0xa'),_0x44ef89,_0xfc7b('0xb'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x44ef89,_0xfc7b('0xb'),JSON[_0xfc7b('0xc')](_0x93849));if(_0x93849[_0xfc7b('0xd')]){if(_0x93849['error']['code']===0x1f4){logger['error'](_0xfc7b('0xa'),_0x44ef89,_0x93849[_0xfc7b('0xd')][_0xfc7b('0xe')]);return _0x4cc188(_0x93849[_0xfc7b('0xd')][_0xfc7b('0xe')]);}logger['error'](_0xfc7b('0xa'),_0x44ef89,_0x93849[_0xfc7b('0xd')][_0xfc7b('0xe')]);return _0x169b8c(_0x93849[_0xfc7b('0xd')][_0xfc7b('0xe')]);}else{logger[_0xfc7b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x44ef89,_0xfc7b('0xb'));_0x169b8c(_0x93849['result']['message']);}})[_0xfc7b('0x10')](function(_0x3590a4){logger[_0xfc7b('0xd')](_0xfc7b('0xa'),_0x44ef89,_0x3590a4);_0x4cc188(_0x3590a4);});});}
\ No newline at end of file
+var _0xe1d2=['code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e18e5,_0x2d0bc0){var _0x12f39d=function(_0x2cbad0){while(--_0x2cbad0){_0x4e18e5['push'](_0x4e18e5['shift']());}};_0x12f39d(++_0x2d0bc0);}(_0xe1d2,0xac));var _0x2e1d=function(_0x43e5dd,_0x5969c7){_0x43e5dd=_0x43e5dd-0x0;var _0x54dd36=_0xe1d2[_0x43e5dd];return _0x54dd36;};'use strict';var _=require(_0x2e1d('0x0'));var util=require(_0x2e1d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e1d('0x2'));var fs=require('fs');var Redis=require(_0x2e1d('0x3'));var db=require(_0x2e1d('0x4'))['db'];var utils=require(_0x2e1d('0x5'));var logger=require(_0x2e1d('0x6'))(_0x2e1d('0x7'));var config=require(_0x2e1d('0x8'));var jayson=require(_0x2e1d('0x9'));var client=jayson[_0x2e1d('0xa')][_0x2e1d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34f959,_0x4981ef,_0x3691e7){return new BPromise(function(_0xd25a96,_0xc71699){return client[_0x2e1d('0xc')](_0x34f959,_0x3691e7)[_0x2e1d('0xd')](function(_0x1f3dc4){logger[_0x2e1d('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4981ef,_0x2e1d('0xf'));logger[_0x2e1d('0x10')](_0x2e1d('0x11'),_0x4981ef,_0x2e1d('0xf'),JSON[_0x2e1d('0x12')](_0x1f3dc4));if(_0x1f3dc4[_0x2e1d('0x13')]){if(_0x1f3dc4[_0x2e1d('0x13')][_0x2e1d('0x14')]===0x1f4){logger['error'](_0x2e1d('0x15'),_0x4981ef,_0x1f3dc4[_0x2e1d('0x13')][_0x2e1d('0x16')]);return _0xc71699(_0x1f3dc4[_0x2e1d('0x13')]['message']);}logger[_0x2e1d('0x13')](_0x2e1d('0x15'),_0x4981ef,_0x1f3dc4[_0x2e1d('0x13')]['message']);return _0xd25a96(_0x1f3dc4[_0x2e1d('0x13')]['message']);}else{logger['info'](_0x2e1d('0x15'),_0x4981ef,_0x2e1d('0xf'));_0xd25a96(_0x1f3dc4['result'][_0x2e1d('0x16')]);}})[_0x2e1d('0x17')](function(_0x25f22f){logger[_0x2e1d('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4981ef,_0x25f22f);_0xc71699(_0x25f22f);});});}
\ No newline at end of file
index 235f19d..03d6adb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2cf=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x3fac9a,_0xb9809){var _0x2d8dec=function(_0x286210){while(--_0x286210){_0x3fac9a['push'](_0x3fac9a['shift']());}};_0x2d8dec(++_0xb9809);}(_0xf2cf,0xf5));var _0xff2c=function(_0x54c377,_0x50de31){_0x54c377=_0x54c377-0x0;var _0x3de9b4=_0xf2cf[_0x54c377];return _0x3de9b4;};'use strict';var multer=require('multer');var util=require(_0xff2c('0x0'));var path=require(_0xff2c('0x1'));var timeout=require(_0xff2c('0x2'));var express=require('express');var router=express[_0xff2c('0x3')]();var fs_extra=require(_0xff2c('0x4'));var auth=require(_0xff2c('0x5'));var interaction=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var controller=require(_0xff2c('0x8'));router['get']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xa')]);router['get'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xc')]);router[_0xff2c('0xd')]('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xe')]);router[_0xff2c('0xf')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x10')]);router[_0xff2c('0x11')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x12')]);module[_0xff2c('0x13')]=router;
\ No newline at end of file
+var _0xb079=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3400e3,_0x18e869){var _0x4c88d0=function(_0x5362f0){while(--_0x5362f0){_0x3400e3['push'](_0x3400e3['shift']());}};_0x4c88d0(++_0x18e869);}(_0xb079,0x1c9));var _0x9b07=function(_0x550731,_0x55cb7b){_0x550731=_0x550731-0x0;var _0x504160=_0xb079[_0x550731];return _0x504160;};'use strict';var multer=require('multer');var util=require(_0x9b07('0x0'));var path=require(_0x9b07('0x1'));var timeout=require(_0x9b07('0x2'));var express=require(_0x9b07('0x3'));var router=express[_0x9b07('0x4')]();var fs_extra=require(_0x9b07('0x5'));var auth=require(_0x9b07('0x6'));var interaction=require(_0x9b07('0x7'));var config=require(_0x9b07('0x8'));var controller=require(_0x9b07('0x9'));router[_0x9b07('0xa')]('/',auth['isAuthenticated'](),controller[_0x9b07('0xb')]);router[_0x9b07('0xa')]('/:id',auth[_0x9b07('0xc')](),controller['show']);router['post']('/',auth[_0x9b07('0xc')](),controller[_0x9b07('0xd')]);router[_0x9b07('0xe')](_0x9b07('0xf'),auth['isAuthenticated'](),controller[_0x9b07('0x10')]);router[_0x9b07('0x11')](_0x9b07('0xf'),auth[_0x9b07('0xc')](),controller[_0x9b07('0x12')]);module[_0x9b07('0x13')]=router;
\ No newline at end of file
index 43c812d..ad7624d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b23=['exports','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2b23,0x93));var _0x32b2=function(_0x50c7d9,_0x27030e){_0x50c7d9=_0x50c7d9-0x0;var _0x8dc0f8=_0x2b23[_0x50c7d9];return _0x8dc0f8;};'use strict';var Sequelize=require(_0x32b2('0x0'));module[_0x32b2('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x8701=['sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8701,0x136));var _0x1870=function(_0x22de63,_0x1c83ae){_0x22de63=_0x22de63-0x0;var _0x466811=_0x8701[_0x22de63];return _0x466811;};'use strict';var Sequelize=require(_0x1870('0x0'));module[_0x1870('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index c0bc6d3..5305306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e38=['VIRTUAL','AnalyticTreeReport','includeAll','include','findAll','params','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','fieldName','type','key','map','keys','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x4f66ef,_0x3d47ef){var _0x34c6ec=function(_0x449aaf){while(--_0x449aaf){_0x4f66ef['push'](_0x4f66ef['shift']());}};_0x34c6ec(++_0x3d47ef);}(_0x8e38,0x1d2));var _0x88e3=function(_0xb869ea,_0x12979a){_0xb869ea=_0xb869ea-0x0;var _0xfcec64=_0x8e38[_0xb869ea];return _0xfcec64;};'use strict';var emlformat=require(_0x88e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88e3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88e3('0x2'));var moment=require(_0x88e3('0x3'));var BPromise=require(_0x88e3('0x4'));var Mustache=require(_0x88e3('0x5'));var util=require(_0x88e3('0x6'));var path=require(_0x88e3('0x7'));var sox=require(_0x88e3('0x8'));var csv=require(_0x88e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88e3('0xa'));var _=require(_0x88e3('0xb'));var squel=require(_0x88e3('0xc'));var crypto=require(_0x88e3('0xd'));var jsforce=require(_0x88e3('0xe'));var deskjs=require(_0x88e3('0xf'));var toCsv=require(_0x88e3('0x9'));var querystring=require(_0x88e3('0x10'));var Papa=require(_0x88e3('0x11'));var Redis=require(_0x88e3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88e3('0x13'));var as=require(_0x88e3('0x14'));var hardwareService=require(_0x88e3('0x15'));var logger=require(_0x88e3('0x16'))(_0x88e3('0x17'));var utils=require(_0x88e3('0x18'));var config=require(_0x88e3('0x19'));var licenseUtil=require(_0x88e3('0x1a'));var db=require(_0x88e3('0x1b'))['db'];function respondWithStatusCode(_0x3af7c2,_0x1156da){_0x1156da=_0x1156da||0xcc;return function(_0x17629a){if(_0x17629a){return _0x3af7c2[_0x88e3('0x1c')](_0x1156da);}return _0x3af7c2[_0x88e3('0x1d')](_0x1156da)[_0x88e3('0x1e')]();};}function respondWithResult(_0x2792b7,_0x345bf2){_0x345bf2=_0x345bf2||0xc8;return function(_0x1885d5){if(_0x1885d5){return _0x2792b7[_0x88e3('0x1d')](_0x345bf2)[_0x88e3('0x1f')](_0x1885d5);}};}function respondWithFilteredResult(_0x2a53b9,_0x2f90ea){return function(_0x29a789){if(_0x29a789){var _0x2f3775=typeof _0x2f90ea['offset']===_0x88e3('0x20')&&typeof _0x2f90ea[_0x88e3('0x21')]==='undefined';var _0x51547f=_0x29a789[_0x88e3('0x22')];var _0x55a245=_0x2f3775?0x0:_0x2f90ea[_0x88e3('0x23')];var _0xd9b943=_0x2f3775?_0x29a789[_0x88e3('0x22')]:_0x2f90ea['offset']+_0x2f90ea[_0x88e3('0x21')];var _0x330c4a;if(_0xd9b943>=_0x51547f){_0xd9b943=_0x51547f;_0x330c4a=0xc8;}else{_0x330c4a=0xce;}_0x2a53b9['status'](_0x330c4a);return _0x2a53b9['set'](_0x88e3('0x24'),_0x55a245+'-'+_0xd9b943+'/'+_0x51547f)[_0x88e3('0x1f')](_0x29a789);}return null;};}function patchUpdates(_0x39de16){return function(_0x366bcc){try{jsonpatch[_0x88e3('0x25')](_0x366bcc,_0x39de16,!![]);}catch(_0x54c43a){return BPromise[_0x88e3('0x26')](_0x54c43a);}return _0x366bcc[_0x88e3('0x27')]();};}function saveUpdates(_0x32531d,_0x287107){return function(_0x3eae13){if(_0x3eae13){return _0x3eae13[_0x88e3('0x28')](_0x32531d)[_0x88e3('0x29')](function(_0x3cf797){return _0x3cf797;});}return null;};}function removeEntity(_0x34c64d,_0x51bc56){return function(_0x2d0235){if(_0x2d0235){return _0x2d0235[_0x88e3('0x2a')]()[_0x88e3('0x29')](function(){_0x34c64d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d2a93,_0x50487f){return function(_0xcab451){if(!_0xcab451){_0x4d2a93['sendStatus'](0x194);}return _0xcab451;};}function handleError(_0x59370a,_0x4b95cb){_0x4b95cb=_0x4b95cb||0x1f4;return function(_0x2bb068){logger[_0x88e3('0x2b')](_0x2bb068['stack']);if(_0x2bb068[_0x88e3('0x2c')]){delete _0x2bb068[_0x88e3('0x2c')];}_0x59370a[_0x88e3('0x1d')](_0x4b95cb)[_0x88e3('0x2d')](_0x2bb068);};}exports['index']=function(_0x27306a,_0x22ad63){var _0x41b457={},_0x499e9a={},_0x5326fe={'count':0x0,'rows':[]};var _0x22f759=_['map'](db['AnalyticTreeReport'][_0x88e3('0x2e')],function(_0x563be7){return{'name':_0x563be7[_0x88e3('0x2f')],'type':_0x563be7[_0x88e3('0x30')][_0x88e3('0x31')]};});_0x499e9a['model']=_[_0x88e3('0x32')](_0x22f759,_0x88e3('0x2c'));_0x499e9a['query']=_[_0x88e3('0x33')](_0x27306a['query']);_0x499e9a[_0x88e3('0x34')]=_[_0x88e3('0x35')](_0x499e9a['model'],_0x499e9a[_0x88e3('0x36')]);_0x41b457[_0x88e3('0x37')]=_[_0x88e3('0x35')](_0x499e9a['model'],qs[_0x88e3('0x38')](_0x27306a[_0x88e3('0x36')][_0x88e3('0x38')]));_0x41b457['attributes']=_0x41b457[_0x88e3('0x37')][_0x88e3('0x39')]?_0x41b457[_0x88e3('0x37')]:_0x499e9a[_0x88e3('0x3a')];if(!_0x27306a[_0x88e3('0x36')][_0x88e3('0x3b')](_0x88e3('0x3c'))){_0x41b457[_0x88e3('0x21')]=qs[_0x88e3('0x21')](_0x27306a[_0x88e3('0x36')][_0x88e3('0x21')]);_0x41b457[_0x88e3('0x23')]=qs['offset'](_0x27306a[_0x88e3('0x36')][_0x88e3('0x23')]);}_0x41b457['order']=qs[_0x88e3('0x3d')](_0x27306a[_0x88e3('0x36')][_0x88e3('0x3d')]);_0x41b457['where']=qs['filters'](_[_0x88e3('0x3e')](_0x27306a[_0x88e3('0x36')],_0x499e9a[_0x88e3('0x34')]),_0x22f759);if(_0x27306a[_0x88e3('0x36')][_0x88e3('0x3f')]){_0x41b457[_0x88e3('0x40')]=_[_0x88e3('0x41')](_0x41b457['where'],{'$or':_[_0x88e3('0x32')](_0x22f759,function(_0x31f188){if(_0x31f188[_0x88e3('0x30')]!==_0x88e3('0x42')){var _0x5d0084={};_0x5d0084[_0x31f188['name']]={'$like':'%'+_0x27306a[_0x88e3('0x36')][_0x88e3('0x3f')]+'%'};return _0x5d0084;}})});}_0x41b457=_[_0x88e3('0x41')]({},_0x41b457,_0x27306a['options']);var _0x445109={'where':_0x41b457[_0x88e3('0x40')]};return db[_0x88e3('0x43')][_0x88e3('0x22')](_0x445109)[_0x88e3('0x29')](function(_0x2ec7f9){_0x5326fe['count']=_0x2ec7f9;if(_0x27306a['query'][_0x88e3('0x44')]){_0x41b457[_0x88e3('0x45')]=[{'all':!![]}];}return db[_0x88e3('0x43')][_0x88e3('0x46')](_0x41b457);})['then'](function(_0x30b5ff){_0x5326fe['rows']=_0x30b5ff;return _0x5326fe;})[_0x88e3('0x29')](respondWithFilteredResult(_0x22ad63,_0x41b457))['catch'](handleError(_0x22ad63,null));};exports['show']=function(_0x5e6612,_0xbd3ff3){var _0x200ed9={'raw':!![],'where':{'id':_0x5e6612[_0x88e3('0x47')]['id']}},_0x34d612={};_0x34d612['model']=_['keys'](db[_0x88e3('0x43')][_0x88e3('0x2e')]);_0x34d612[_0x88e3('0x36')]=_[_0x88e3('0x33')](_0x5e6612[_0x88e3('0x36')]);_0x34d612[_0x88e3('0x34')]=_['intersection'](_0x34d612[_0x88e3('0x3a')],_0x34d612[_0x88e3('0x36')]);_0x200ed9[_0x88e3('0x37')]=_[_0x88e3('0x35')](_0x34d612['model'],qs[_0x88e3('0x38')](_0x5e6612[_0x88e3('0x36')][_0x88e3('0x38')]));_0x200ed9[_0x88e3('0x37')]=_0x200ed9[_0x88e3('0x37')]['length']?_0x200ed9[_0x88e3('0x37')]:_0x34d612[_0x88e3('0x3a')];if(_0x5e6612[_0x88e3('0x36')][_0x88e3('0x44')]){_0x200ed9[_0x88e3('0x45')]=[{'all':!![]}];}_0x200ed9=_[_0x88e3('0x41')]({},_0x200ed9,_0x5e6612['options']);return db[_0x88e3('0x43')][_0x88e3('0x48')](_0x200ed9)[_0x88e3('0x29')](handleEntityNotFound(_0xbd3ff3,null))['then'](respondWithResult(_0xbd3ff3,null))[_0x88e3('0x49')](handleError(_0xbd3ff3,null));};exports[_0x88e3('0x4a')]=function(_0x2d4a8b,_0x206d93){return db[_0x88e3('0x43')][_0x88e3('0x4a')](_0x2d4a8b[_0x88e3('0x4b')],{})['then'](respondWithResult(_0x206d93,0xc9))['catch'](handleError(_0x206d93,null));};exports['update']=function(_0x46d023,_0x4bd80b){if(_0x46d023['body']['id']){delete _0x46d023[_0x88e3('0x4b')]['id'];}return db[_0x88e3('0x43')][_0x88e3('0x48')]({'where':{'id':_0x46d023[_0x88e3('0x47')]['id']}})[_0x88e3('0x29')](handleEntityNotFound(_0x4bd80b,null))[_0x88e3('0x29')](saveUpdates(_0x46d023[_0x88e3('0x4b')],null))[_0x88e3('0x29')](respondWithResult(_0x4bd80b,null))[_0x88e3('0x49')](handleError(_0x4bd80b,null));};exports['destroy']=function(_0x552e8a,_0x517ebd){return db[_0x88e3('0x43')][_0x88e3('0x48')]({'where':{'id':_0x552e8a[_0x88e3('0x47')]['id']}})['then'](handleEntityNotFound(_0x517ebd,null))[_0x88e3('0x29')](removeEntity(_0x517ebd,null))[_0x88e3('0x49')](handleError(_0x517ebd,null));};
\ No newline at end of file
+var _0xed06=['rows','catch','show','include','find','create','body','params','eml-format','rimraf','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x282bd1,_0x4adf4e){var _0x1eaba7=function(_0x38f91d){while(--_0x38f91d){_0x282bd1['push'](_0x282bd1['shift']());}};_0x1eaba7(++_0x4adf4e);}(_0xed06,0x9a));var _0x6ed0=function(_0x8e017a,_0x4b1974){_0x8e017a=_0x8e017a-0x0;var _0x310c34=_0xed06[_0x8e017a];return _0x310c34;};'use strict';var emlformat=require(_0x6ed0('0x0'));var rimraf=require(_0x6ed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ed0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ed0('0x3'));var util=require('util');var path=require(_0x6ed0('0x4'));var sox=require(_0x6ed0('0x5'));var csv=require(_0x6ed0('0x6'));var ejs=require(_0x6ed0('0x7'));var fs=require('fs');var fs_extra=require(_0x6ed0('0x8'));var _=require(_0x6ed0('0x9'));var squel=require('squel');var crypto=require(_0x6ed0('0xa'));var jsforce=require(_0x6ed0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6ed0('0x6'));var querystring=require(_0x6ed0('0xc'));var Papa=require(_0x6ed0('0xd'));var Redis=require(_0x6ed0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ed0('0xf'));var hardwareService=require(_0x6ed0('0x10'));var logger=require(_0x6ed0('0x11'))(_0x6ed0('0x12'));var utils=require('../../config/utils');var config=require(_0x6ed0('0x13'));var licenseUtil=require(_0x6ed0('0x14'));var db=require(_0x6ed0('0x15'))['db'];function respondWithStatusCode(_0x1db23c,_0x6ecace){_0x6ecace=_0x6ecace||0xcc;return function(_0xaa48e1){if(_0xaa48e1){return _0x1db23c[_0x6ed0('0x16')](_0x6ecace);}return _0x1db23c['status'](_0x6ecace)[_0x6ed0('0x17')]();};}function respondWithResult(_0x7157d4,_0xcdd0fb){_0xcdd0fb=_0xcdd0fb||0xc8;return function(_0x2df03d){if(_0x2df03d){return _0x7157d4['status'](_0xcdd0fb)[_0x6ed0('0x18')](_0x2df03d);}};}function respondWithFilteredResult(_0x2094a3,_0x133604){return function(_0x1ef6f8){if(_0x1ef6f8){var _0x232625=typeof _0x133604[_0x6ed0('0x19')]===_0x6ed0('0x1a')&&typeof _0x133604[_0x6ed0('0x1b')]===_0x6ed0('0x1a');var _0x163f25=_0x1ef6f8[_0x6ed0('0x1c')];var _0x57ea0b=_0x232625?0x0:_0x133604[_0x6ed0('0x19')];var _0x174833=_0x232625?_0x1ef6f8[_0x6ed0('0x1c')]:_0x133604[_0x6ed0('0x19')]+_0x133604[_0x6ed0('0x1b')];var _0x33873d;if(_0x174833>=_0x163f25){_0x174833=_0x163f25;_0x33873d=0xc8;}else{_0x33873d=0xce;}_0x2094a3[_0x6ed0('0x1d')](_0x33873d);return _0x2094a3[_0x6ed0('0x1e')](_0x6ed0('0x1f'),_0x57ea0b+'-'+_0x174833+'/'+_0x163f25)[_0x6ed0('0x18')](_0x1ef6f8);}return null;};}function patchUpdates(_0x31f017){return function(_0x1fadc6){try{jsonpatch[_0x6ed0('0x20')](_0x1fadc6,_0x31f017,!![]);}catch(_0x1cfaff){return BPromise[_0x6ed0('0x21')](_0x1cfaff);}return _0x1fadc6['save']();};}function saveUpdates(_0x24b9dd,_0x594621){return function(_0x360892){if(_0x360892){return _0x360892[_0x6ed0('0x22')](_0x24b9dd)[_0x6ed0('0x23')](function(_0x260617){return _0x260617;});}return null;};}function removeEntity(_0x1074c7,_0x45a725){return function(_0x51866f){if(_0x51866f){return _0x51866f[_0x6ed0('0x24')]()[_0x6ed0('0x23')](function(){_0x1074c7[_0x6ed0('0x1d')](0xcc)[_0x6ed0('0x17')]();});}};}function handleEntityNotFound(_0x5c5db9,_0x2d0632){return function(_0x3e9561){if(!_0x3e9561){_0x5c5db9['sendStatus'](0x194);}return _0x3e9561;};}function handleError(_0x4e5d0d,_0x559914){_0x559914=_0x559914||0x1f4;return function(_0x2f2606){logger[_0x6ed0('0x25')](_0x2f2606['stack']);if(_0x2f2606[_0x6ed0('0x26')]){delete _0x2f2606[_0x6ed0('0x26')];}_0x4e5d0d[_0x6ed0('0x1d')](_0x559914)['send'](_0x2f2606);};}exports['index']=function(_0xa42b82,_0x15fd04){var _0x4ada1c={},_0x34f4b9={},_0x37df12={'count':0x0,'rows':[]};var _0x15bd91=_[_0x6ed0('0x27')](db[_0x6ed0('0x28')][_0x6ed0('0x29')],function(_0x41d732){return{'name':_0x41d732[_0x6ed0('0x2a')],'type':_0x41d732[_0x6ed0('0x2b')][_0x6ed0('0x2c')]};});_0x34f4b9['model']=_['map'](_0x15bd91,_0x6ed0('0x26'));_0x34f4b9[_0x6ed0('0x2d')]=_[_0x6ed0('0x2e')](_0xa42b82['query']);_0x34f4b9[_0x6ed0('0x2f')]=_[_0x6ed0('0x30')](_0x34f4b9[_0x6ed0('0x31')],_0x34f4b9[_0x6ed0('0x2d')]);_0x4ada1c[_0x6ed0('0x32')]=_[_0x6ed0('0x30')](_0x34f4b9[_0x6ed0('0x31')],qs[_0x6ed0('0x33')](_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x33')]));_0x4ada1c[_0x6ed0('0x32')]=_0x4ada1c[_0x6ed0('0x32')][_0x6ed0('0x34')]?_0x4ada1c[_0x6ed0('0x32')]:_0x34f4b9[_0x6ed0('0x31')];if(!_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x35')](_0x6ed0('0x36'))){_0x4ada1c[_0x6ed0('0x1b')]=qs[_0x6ed0('0x1b')](_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x1b')]);_0x4ada1c[_0x6ed0('0x19')]=qs['offset'](_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x19')]);}_0x4ada1c[_0x6ed0('0x37')]=qs['sort'](_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x38')]);_0x4ada1c['where']=qs['filters'](_[_0x6ed0('0x39')](_0xa42b82[_0x6ed0('0x2d')],_0x34f4b9[_0x6ed0('0x2f')]),_0x15bd91);if(_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x3a')]){_0x4ada1c[_0x6ed0('0x3b')]=_[_0x6ed0('0x3c')](_0x4ada1c[_0x6ed0('0x3b')],{'$or':_[_0x6ed0('0x27')](_0x15bd91,function(_0x5da540){if(_0x5da540[_0x6ed0('0x2b')]!==_0x6ed0('0x3d')){var _0x286a01={};_0x286a01[_0x5da540[_0x6ed0('0x26')]]={'$like':'%'+_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x3a')]+'%'};return _0x286a01;}})});}_0x4ada1c=_[_0x6ed0('0x3c')]({},_0x4ada1c,_0xa42b82[_0x6ed0('0x3e')]);var _0x579fb5={'where':_0x4ada1c[_0x6ed0('0x3b')]};return db[_0x6ed0('0x28')]['count'](_0x579fb5)[_0x6ed0('0x23')](function(_0x28d459){_0x37df12[_0x6ed0('0x1c')]=_0x28d459;if(_0xa42b82[_0x6ed0('0x2d')][_0x6ed0('0x3f')]){_0x4ada1c['include']=[{'all':!![]}];}return db[_0x6ed0('0x28')][_0x6ed0('0x40')](_0x4ada1c);})[_0x6ed0('0x23')](function(_0x17b926){_0x37df12[_0x6ed0('0x41')]=_0x17b926;return _0x37df12;})[_0x6ed0('0x23')](respondWithFilteredResult(_0x15fd04,_0x4ada1c))[_0x6ed0('0x42')](handleError(_0x15fd04,null));};exports[_0x6ed0('0x43')]=function(_0x4f0633,_0xa1e0f0){var _0x3ae75c={'raw':!![],'where':{'id':_0x4f0633['params']['id']}},_0x4d9e11={};_0x4d9e11[_0x6ed0('0x31')]=_[_0x6ed0('0x2e')](db[_0x6ed0('0x28')][_0x6ed0('0x29')]);_0x4d9e11[_0x6ed0('0x2d')]=_['keys'](_0x4f0633[_0x6ed0('0x2d')]);_0x4d9e11[_0x6ed0('0x2f')]=_[_0x6ed0('0x30')](_0x4d9e11['model'],_0x4d9e11[_0x6ed0('0x2d')]);_0x3ae75c[_0x6ed0('0x32')]=_['intersection'](_0x4d9e11[_0x6ed0('0x31')],qs[_0x6ed0('0x33')](_0x4f0633[_0x6ed0('0x2d')][_0x6ed0('0x33')]));_0x3ae75c[_0x6ed0('0x32')]=_0x3ae75c['attributes'][_0x6ed0('0x34')]?_0x3ae75c[_0x6ed0('0x32')]:_0x4d9e11[_0x6ed0('0x31')];if(_0x4f0633[_0x6ed0('0x2d')][_0x6ed0('0x3f')]){_0x3ae75c[_0x6ed0('0x44')]=[{'all':!![]}];}_0x3ae75c=_[_0x6ed0('0x3c')]({},_0x3ae75c,_0x4f0633[_0x6ed0('0x3e')]);return db[_0x6ed0('0x28')][_0x6ed0('0x45')](_0x3ae75c)['then'](handleEntityNotFound(_0xa1e0f0,null))[_0x6ed0('0x23')](respondWithResult(_0xa1e0f0,null))[_0x6ed0('0x42')](handleError(_0xa1e0f0,null));};exports['create']=function(_0x15db7a,_0xb7d379){return db['AnalyticTreeReport'][_0x6ed0('0x46')](_0x15db7a['body'],{})[_0x6ed0('0x23')](respondWithResult(_0xb7d379,0xc9))[_0x6ed0('0x42')](handleError(_0xb7d379,null));};exports[_0x6ed0('0x22')]=function(_0x4232a3,_0x2459b3){if(_0x4232a3[_0x6ed0('0x47')]['id']){delete _0x4232a3['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x4232a3[_0x6ed0('0x48')]['id']}})[_0x6ed0('0x23')](handleEntityNotFound(_0x2459b3,null))['then'](saveUpdates(_0x4232a3[_0x6ed0('0x47')],null))['then'](respondWithResult(_0x2459b3,null))['catch'](handleError(_0x2459b3,null));};exports['destroy']=function(_0x474c35,_0x1f72e6){return db[_0x6ed0('0x28')][_0x6ed0('0x45')]({'where':{'id':_0x474c35[_0x6ed0('0x48')]['id']}})[_0x6ed0('0x23')](handleEntityNotFound(_0x1f72e6,null))[_0x6ed0('0x23')](removeEntity(_0x1f72e6,null))['catch'](handleError(_0x1f72e6,null));};
\ No newline at end of file
index c5fb249..896466a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb67c=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xb67c,0xae));var _0xcb67=function(_0x592eeb,_0x10ef82){_0x592eeb=_0x592eeb-0x0;var _0x3ea777=_0xb67c[_0x592eeb];return _0x3ea777;};'use strict';var _=require(_0xcb67('0x0'));var util=require(_0xcb67('0x1'));var logger=require(_0xcb67('0x2'))('api');var moment=require(_0xcb67('0x3'));var BPromise=require(_0xcb67('0x4'));var rp=require(_0xcb67('0x5'));var fs=require('fs');var path=require(_0xcb67('0x6'));var rimraf=require(_0xcb67('0x7'));var config=require(_0xcb67('0x8'));var attributes=require(_0xcb67('0x9'));module[_0xcb67('0xa')]=function(_0xcf8b8b,_0x4805fe){return _0xcf8b8b[_0xcb67('0xb')](_0xcb67('0xc'),attributes,{'tableName':_0xcb67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0e9=['../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x72bc2,_0x317c20){var _0xe96608=function(_0x162565){while(--_0x162565){_0x72bc2['push'](_0x72bc2['shift']());}};_0xe96608(++_0x317c20);}(_0xb0e9,0x9a));var _0x9b0e=function(_0xc683b3,_0x30804c){_0xc683b3=_0xc683b3-0x0;var _0x12f2c4=_0xb0e9[_0xc683b3];return _0x12f2c4;};'use strict';var _=require(_0x9b0e('0x0'));var util=require(_0x9b0e('0x1'));var logger=require(_0x9b0e('0x2'))('api');var moment=require(_0x9b0e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b0e('0x4'));var rimraf=require(_0x9b0e('0x5'));var config=require(_0x9b0e('0x6'));var attributes=require(_0x9b0e('0x7'));module['exports']=function(_0x3e44d0,_0x43c932){return _0x3e44d0[_0x9b0e('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x9b0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5caa524..15e365d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0xf7e0de,_0x41f2fa){var _0x353fb0=function(_0xa8cc9e){while(--_0xa8cc9e){_0xf7e0de['push'](_0xf7e0de['shift']());}};_0x353fb0(++_0x41f2fa);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'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')]('AnalyticTreeReport,\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
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x15da5f,_0x3fce0e){var _0x1992f1=function(_0x1bf2be){while(--_0x1bf2be){_0x15da5f['push'](_0x15da5f['shift']());}};_0x1992f1(++_0x3fce0e);}(_0xadb5,0xad));var _0x5adb=function(_0x2644fb,_0x311ca9){_0x2644fb=_0x2644fb-0x0;var _0x3f6458=_0xadb5[_0x2644fb];return _0x3f6458;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 6e4f199..62cbb3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02f2=['post','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x93e20c,_0x2d9a62){var _0x31d312=function(_0x3240c9){while(--_0x3240c9){_0x93e20c['push'](_0x93e20c['shift']());}};_0x31d312(++_0x2d9a62);}(_0x02f2,0x186));var _0x202f=function(_0x378972,_0x5ac8fa){_0x378972=_0x378972-0x0;var _0x163600=_0x02f2[_0x378972];return _0x163600;};'use strict';var multer=require(_0x202f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x202f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x202f('0x2'));var auth=require(_0x202f('0x3'));var interaction=require(_0x202f('0x4'));var config=require(_0x202f('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x202f('0x6')]('/',auth[_0x202f('0x7')](),controller[_0x202f('0x8')]);router[_0x202f('0x6')]('/:id',auth[_0x202f('0x7')](),controller[_0x202f('0x9')]);router[_0x202f('0xa')]('/',auth[_0x202f('0x7')](),controller['create']);router['put'](_0x202f('0xb'),auth['isAuthenticated'](),controller[_0x202f('0xc')]);router[_0x202f('0xd')](_0x202f('0xb'),auth['isAuthenticated'](),controller[_0x202f('0xe')]);module[_0x202f('0xf')]=router;
\ No newline at end of file
+var _0x5b65=['../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x5b65,0x89));var _0x55b6=function(_0x575362,_0x4751d4){_0x575362=_0x575362-0x0;var _0x13a924=_0x5b65[_0x575362];return _0x13a924;};'use strict';var multer=require('multer');var util=require(_0x55b6('0x0'));var path=require(_0x55b6('0x1'));var timeout=require(_0x55b6('0x2'));var express=require(_0x55b6('0x3'));var router=express[_0x55b6('0x4')]();var fs_extra=require(_0x55b6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x55b6('0x6'));var config=require(_0x55b6('0x7'));var controller=require(_0x55b6('0x8'));router[_0x55b6('0x9')]('/',auth['isAuthenticated'](),controller[_0x55b6('0xa')]);router[_0x55b6('0x9')]('/:id',auth[_0x55b6('0xb')](),controller[_0x55b6('0xc')]);router[_0x55b6('0xd')]('/',auth[_0x55b6('0xb')](),controller[_0x55b6('0xe')]);router['put'](_0x55b6('0xf'),auth[_0x55b6('0xb')](),controller['update']);router[_0x55b6('0x10')](_0x55b6('0xf'),auth[_0x55b6('0xb')](),controller[_0x55b6('0x11')]);module['exports']=router;
\ No newline at end of file
index cbb3029..114b088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207d=['exports','STRING','sequelize'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x207d,0x10d));var _0xd207=function(_0x572214,_0x3cb8f1){_0x572214=_0x572214-0x0;var _0x5a285f=_0x207d[_0x572214];return _0x5a285f;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'name':{'type':Sequelize[_0xd207('0x2')]},'basename':{'type':Sequelize[_0xd207('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2bbb=['STRING','exports'];(function(_0x38037a,_0x196abc){var _0x1a1246=function(_0x4252b5){while(--_0x4252b5){_0x38037a['push'](_0x38037a['shift']());}};_0x1a1246(++_0x196abc);}(_0x2bbb,0x85));var _0xb2bb=function(_0x6c193c,_0x3fa50f){_0x6c193c=_0x6c193c-0x0;var _0x19d760=_0x2bbb[_0x6c193c];return _0x19d760;};'use strict';var Sequelize=require('sequelize');module[_0xb2bb('0x0')]={'name':{'type':Sequelize[_0xb2bb('0x1')]},'basename':{'type':Sequelize[_0xb2bb('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2b37b83..b6b3ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','name','send','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','keys','length','includeAll','find','get','omit','createdAt','updatedAt','body','update','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0xb0b2,0x157));var _0x2b0b=function(_0x1a26c4,_0x16c5ff){_0x1a26c4=_0x1a26c4-0x0;var _0x242db4=_0xb0b2[_0x1a26c4];return _0x242db4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b0b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b0b('0x1'));var moment=require(_0x2b0b('0x2'));var BPromise=require(_0x2b0b('0x3'));var Mustache=require(_0x2b0b('0x4'));var util=require(_0x2b0b('0x5'));var path=require(_0x2b0b('0x6'));var sox=require(_0x2b0b('0x7'));var csv=require(_0x2b0b('0x8'));var ejs=require(_0x2b0b('0x9'));var fs=require('fs');var fs_extra=require(_0x2b0b('0xa'));var _=require(_0x2b0b('0xb'));var squel=require(_0x2b0b('0xc'));var crypto=require(_0x2b0b('0xd'));var jsforce=require(_0x2b0b('0xe'));var deskjs=require(_0x2b0b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b0b('0x10'));var Papa=require('papaparse');var Redis=require(_0x2b0b('0x11'));var authService=require(_0x2b0b('0x12'));var qs=require(_0x2b0b('0x13'));var as=require(_0x2b0b('0x14'));var hardwareService=require(_0x2b0b('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2b0b('0x16'));var config=require(_0x2b0b('0x17'));var licenseUtil=require(_0x2b0b('0x18'));var db=require(_0x2b0b('0x19'))['db'];function respondWithStatusCode(_0x226692,_0x16d95c){_0x16d95c=_0x16d95c||0xcc;return function(_0x2a74ab){if(_0x2a74ab){return _0x226692['sendStatus'](_0x16d95c);}return _0x226692[_0x2b0b('0x1a')](_0x16d95c)['end']();};}function respondWithResult(_0x6ba938,_0x5adb9b){_0x5adb9b=_0x5adb9b||0xc8;return function(_0x3dae8b){if(_0x3dae8b){return _0x6ba938[_0x2b0b('0x1a')](_0x5adb9b)[_0x2b0b('0x1b')](_0x3dae8b);}};}function respondWithFilteredResult(_0xf27977,_0x4e598b){return function(_0x26dce0){if(_0x26dce0){var _0x3bf823=typeof _0x4e598b[_0x2b0b('0x1c')]===_0x2b0b('0x1d')&&typeof _0x4e598b[_0x2b0b('0x1e')]===_0x2b0b('0x1d');var _0x50fd8a=_0x26dce0[_0x2b0b('0x1f')];var _0x131a92=_0x3bf823?0x0:_0x4e598b[_0x2b0b('0x1c')];var _0x1e7e2f=_0x3bf823?_0x26dce0[_0x2b0b('0x1f')]:_0x4e598b[_0x2b0b('0x1c')]+_0x4e598b[_0x2b0b('0x1e')];var _0x53904a;if(_0x1e7e2f>=_0x50fd8a){_0x1e7e2f=_0x50fd8a;_0x53904a=0xc8;}else{_0x53904a=0xce;}_0xf27977['status'](_0x53904a);return _0xf27977[_0x2b0b('0x20')](_0x2b0b('0x21'),_0x131a92+'-'+_0x1e7e2f+'/'+_0x50fd8a)[_0x2b0b('0x1b')](_0x26dce0);}return null;};}function patchUpdates(_0x85b448){return function(_0x11b245){try{jsonpatch[_0x2b0b('0x22')](_0x11b245,_0x85b448,!![]);}catch(_0x42a598){return BPromise[_0x2b0b('0x23')](_0x42a598);}return _0x11b245[_0x2b0b('0x24')]();};}function saveUpdates(_0x16140a,_0x3f27f3){return function(_0xf3f8ae){if(_0xf3f8ae){return _0xf3f8ae['update'](_0x16140a)['then'](function(_0x46d4a4){return _0x46d4a4;});}return null;};}function removeEntity(_0x55860b,_0x3741dd){return function(_0x477fba){if(_0x477fba){return _0x477fba['destroy']()[_0x2b0b('0x25')](function(){_0x55860b['status'](0xcc)[_0x2b0b('0x26')]();});}};}function handleEntityNotFound(_0x3d5faf,_0x4b9ffe){return function(_0x105610){if(!_0x105610){_0x3d5faf[_0x2b0b('0x27')](0x194);}return _0x105610;};}function handleError(_0x2c590d,_0xbff5bd){_0xbff5bd=_0xbff5bd||0x1f4;return function(_0x543f18){logger[_0x2b0b('0x28')](_0x543f18['stack']);if(_0x543f18[_0x2b0b('0x29')]){delete _0x543f18[_0x2b0b('0x29')];}_0x2c590d[_0x2b0b('0x1a')](_0xbff5bd)[_0x2b0b('0x2a')](_0x543f18);};}exports[_0x2b0b('0x2b')]=function(_0x49bb6d,_0x5da6be){var _0x10f70c={},_0x47dd6a={},_0x22c8dc={'count':0x0,'rows':[]};var _0x136a1f=_[_0x2b0b('0x2c')](db[_0x2b0b('0x2d')][_0x2b0b('0x2e')],function(_0x11ae70){return{'name':_0x11ae70['fieldName'],'type':_0x11ae70[_0x2b0b('0x2f')][_0x2b0b('0x30')]};});_0x47dd6a[_0x2b0b('0x31')]=_[_0x2b0b('0x2c')](_0x136a1f,_0x2b0b('0x29'));_0x47dd6a['query']=_['keys'](_0x49bb6d[_0x2b0b('0x32')]);_0x47dd6a[_0x2b0b('0x33')]=_[_0x2b0b('0x34')](_0x47dd6a[_0x2b0b('0x31')],_0x47dd6a[_0x2b0b('0x32')]);_0x10f70c[_0x2b0b('0x35')]=_[_0x2b0b('0x34')](_0x47dd6a[_0x2b0b('0x31')],qs[_0x2b0b('0x36')](_0x49bb6d[_0x2b0b('0x32')][_0x2b0b('0x36')]));_0x10f70c[_0x2b0b('0x35')]=_0x10f70c[_0x2b0b('0x35')]['length']?_0x10f70c['attributes']:_0x47dd6a[_0x2b0b('0x31')];if(!_0x49bb6d[_0x2b0b('0x32')]['hasOwnProperty'](_0x2b0b('0x37'))){_0x10f70c[_0x2b0b('0x1e')]=qs[_0x2b0b('0x1e')](_0x49bb6d[_0x2b0b('0x32')][_0x2b0b('0x1e')]);_0x10f70c[_0x2b0b('0x1c')]=qs[_0x2b0b('0x1c')](_0x49bb6d['query'][_0x2b0b('0x1c')]);}_0x10f70c['order']=qs[_0x2b0b('0x38')](_0x49bb6d[_0x2b0b('0x32')]['sort']);_0x10f70c['where']=qs[_0x2b0b('0x33')](_[_0x2b0b('0x39')](_0x49bb6d[_0x2b0b('0x32')],_0x47dd6a[_0x2b0b('0x33')]),_0x136a1f);if(_0x49bb6d[_0x2b0b('0x32')][_0x2b0b('0x3a')]){_0x10f70c[_0x2b0b('0x3b')]=_[_0x2b0b('0x3c')](_0x10f70c['where'],{'$or':_[_0x2b0b('0x2c')](_0x136a1f,function(_0x55f1b6){if(_0x55f1b6[_0x2b0b('0x2f')]!==_0x2b0b('0x3d')){var _0x4b36a3={};_0x4b36a3[_0x55f1b6[_0x2b0b('0x29')]]={'$like':'%'+_0x49bb6d[_0x2b0b('0x32')][_0x2b0b('0x3a')]+'%'};return _0x4b36a3;}})});}_0x10f70c=_[_0x2b0b('0x3c')]({},_0x10f70c,_0x49bb6d[_0x2b0b('0x3e')]);var _0x5f0bba={'where':_0x10f70c[_0x2b0b('0x3b')]};return db[_0x2b0b('0x2d')][_0x2b0b('0x1f')](_0x5f0bba)[_0x2b0b('0x25')](function(_0x3804fc){_0x22c8dc[_0x2b0b('0x1f')]=_0x3804fc;if(_0x49bb6d[_0x2b0b('0x32')]['includeAll']){_0x10f70c[_0x2b0b('0x3f')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x10f70c);})[_0x2b0b('0x25')](function(_0x572b76){_0x22c8dc[_0x2b0b('0x40')]=_0x572b76;return _0x22c8dc;})['then'](respondWithFilteredResult(_0x5da6be,_0x10f70c))[_0x2b0b('0x41')](handleError(_0x5da6be,null));};exports[_0x2b0b('0x42')]=function(_0x3c02ab,_0x2c6417){var _0x141afa={'raw':!![],'where':{'id':_0x3c02ab[_0x2b0b('0x43')]['id']}},_0x10aad1={};_0x10aad1[_0x2b0b('0x31')]=_[_0x2b0b('0x44')](db[_0x2b0b('0x2d')][_0x2b0b('0x2e')]);_0x10aad1['query']=_['keys'](_0x3c02ab['query']);_0x10aad1[_0x2b0b('0x33')]=_[_0x2b0b('0x34')](_0x10aad1[_0x2b0b('0x31')],_0x10aad1[_0x2b0b('0x32')]);_0x141afa['attributes']=_[_0x2b0b('0x34')](_0x10aad1[_0x2b0b('0x31')],qs[_0x2b0b('0x36')](_0x3c02ab['query'][_0x2b0b('0x36')]));_0x141afa['attributes']=_0x141afa['attributes'][_0x2b0b('0x45')]?_0x141afa[_0x2b0b('0x35')]:_0x10aad1[_0x2b0b('0x31')];if(_0x3c02ab[_0x2b0b('0x32')][_0x2b0b('0x46')]){_0x141afa[_0x2b0b('0x3f')]=[{'all':!![]}];}_0x141afa=_[_0x2b0b('0x3c')]({},_0x141afa,_0x3c02ab['options']);return db[_0x2b0b('0x2d')][_0x2b0b('0x47')](_0x141afa)[_0x2b0b('0x25')](handleEntityNotFound(_0x2c6417,null))[_0x2b0b('0x25')](respondWithResult(_0x2c6417,null))[_0x2b0b('0x41')](handleError(_0x2c6417,null));};exports['clone']=function(_0x525f75,_0x1bc153){var _0x3a3af4={'where':{'id':_0x525f75[_0x2b0b('0x43')]['id']}},_0x30bfb8={};_0x30bfb8[_0x2b0b('0x31')]=_['keys'](db[_0x2b0b('0x2d')][_0x2b0b('0x2e')]);_0x3a3af4[_0x2b0b('0x35')]=_[_0x2b0b('0x34')](_0x30bfb8[_0x2b0b('0x31')],qs['fields'](_0x525f75[_0x2b0b('0x32')][_0x2b0b('0x36')]));_0x3a3af4[_0x2b0b('0x35')]=_0x3a3af4['attributes'][_0x2b0b('0x45')]?_0x3a3af4[_0x2b0b('0x35')]:_0x30bfb8[_0x2b0b('0x31')];if(_0x525f75['query'][_0x2b0b('0x46')]){_0x3a3af4[_0x2b0b('0x3f')]=[{'all':!![]}];}_0x3a3af4=_['merge']({},_0x3a3af4,_0x525f75[_0x2b0b('0x3e')]);return db[_0x2b0b('0x2d')][_0x2b0b('0x47')](_0x3a3af4)['then'](handleEntityNotFound(_0x1bc153,null))[_0x2b0b('0x25')](function(_0x4b6bc3){if(_0x4b6bc3){var _0x25d939=_0x4b6bc3[_0x2b0b('0x48')]({'plain':!![]});_0x25d939=qs[_0x2b0b('0x49')](_0x25d939,['id',_0x2b0b('0x4a'),_0x2b0b('0x4b')]);_0x525f75['body']=_[_0x2b0b('0x49')](_0x525f75[_0x2b0b('0x4c')],['id',_0x2b0b('0x4a'),_0x2b0b('0x4b')]);return db['Attachment']['create'](_[_0x2b0b('0x3c')](_0x25d939,_0x525f75[_0x2b0b('0x4c')]),{'include':_0x525f75[_0x2b0b('0x32')][_0x2b0b('0x46')]?[{'all':!![]}]:undefined});}})[_0x2b0b('0x25')](respondWithResult(_0x1bc153,0xc9))['catch'](handleError(_0x1bc153,null));};exports[_0x2b0b('0x4d')]=function(_0x18b511,_0x3c2957){if(_0x18b511[_0x2b0b('0x4c')]['id']){delete _0x18b511[_0x2b0b('0x4c')]['id'];}return db[_0x2b0b('0x2d')][_0x2b0b('0x47')]({'where':{'id':_0x18b511[_0x2b0b('0x43')]['id']}})[_0x2b0b('0x25')](handleEntityNotFound(_0x3c2957,null))[_0x2b0b('0x25')](saveUpdates(_0x18b511[_0x2b0b('0x4c')],null))[_0x2b0b('0x25')](respondWithResult(_0x3c2957,null))[_0x2b0b('0x41')](handleError(_0x3c2957,null));};exports['destroy']=function(_0x5c35fe,_0x1bb561){return db[_0x2b0b('0x2d')][_0x2b0b('0x47')]({'where':{'id':_0x5c35fe['params']['id']}})[_0x2b0b('0x25')](handleEntityNotFound(_0x1bb561,null))[_0x2b0b('0x25')](removeEntity(_0x1bb561,null))[_0x2b0b('0x41')](handleError(_0x1bb561,null));};exports[_0x2b0b('0x4e')]=function(_0x26771e,_0x59a41f,_0x1bd277){_0x26771e[_0x2b0b('0x4c')][_0x2b0b('0x29')]=_0x26771e[_0x2b0b('0x4f')]['originalname'];_0x26771e['body']['basename']=_0x26771e[_0x2b0b('0x4f')][_0x2b0b('0x50')];_0x26771e[_0x2b0b('0x4c')]['type']=_0x26771e[_0x2b0b('0x4f')][_0x2b0b('0x51')];return db['Attachment']['create'](_0x26771e['body'])[_0x2b0b('0x25')](respondWithResult(_0x59a41f,0xc9))['catch'](handleError(_0x59a41f,null));};exports[_0x2b0b('0x52')]=function(_0x5522a7,_0x411f21,_0x3fbf76){return db['Attachment'][_0x2b0b('0x53')]({'where':{'id':_0x5522a7[_0x2b0b('0x43')]['id']},'raw':!![]})[_0x2b0b('0x25')](handleEntityNotFound(_0x411f21,null))[_0x2b0b('0x25')](function(_0x291e64){if(_0x291e64){var _0x357354=_0x291e64[_0x2b0b('0x54')]!==null;var _0xec678a=path['join'](config[_0x2b0b('0x55')],_0x2b0b('0x56'));if(_0x357354){_0xec678a=path[_0x2b0b('0x57')](_0xec678a,_0x2b0b('0x58'));}var _0x5625f3=path['join'](_0xec678a,_0x291e64[_0x2b0b('0x59')]);return _0x411f21[_0x2b0b('0x52')](_0x5625f3);}})[_0x2b0b('0x41')](handleError(_0x411f21,null));};
\ No newline at end of file
+var _0xc5ad=['download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','params','omit','body','createdAt','updatedAt','create','file','originalname','basename','filename','type','mimetype'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5ad,0xb2));var _0xdc5a=function(_0x5b47bd,_0x13304b){_0x5b47bd=_0x5b47bd-0x0;var _0x55ef81=_0xc5ad[_0x5b47bd];return _0x55ef81;};'use strict';var emlformat=require(_0xdc5a('0x0'));var rimraf=require(_0xdc5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc5a('0x2'));var rp=require(_0xdc5a('0x3'));var moment=require('moment');var BPromise=require(_0xdc5a('0x4'));var Mustache=require(_0xdc5a('0x5'));var util=require(_0xdc5a('0x6'));var path=require('path');var sox=require(_0xdc5a('0x7'));var csv=require(_0xdc5a('0x8'));var ejs=require(_0xdc5a('0x9'));var fs=require('fs');var fs_extra=require(_0xdc5a('0xa'));var _=require(_0xdc5a('0xb'));var squel=require(_0xdc5a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc5a('0x8'));var querystring=require(_0xdc5a('0xd'));var Papa=require(_0xdc5a('0xe'));var Redis=require(_0xdc5a('0xf'));var authService=require(_0xdc5a('0x10'));var qs=require(_0xdc5a('0x11'));var as=require(_0xdc5a('0x12'));var hardwareService=require(_0xdc5a('0x13'));var logger=require(_0xdc5a('0x14'))(_0xdc5a('0x15'));var utils=require(_0xdc5a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdc5a('0x17'));var db=require(_0xdc5a('0x18'))['db'];function respondWithStatusCode(_0x5d1cc5,_0x364aa9){_0x364aa9=_0x364aa9||0xcc;return function(_0x4b7141){if(_0x4b7141){return _0x5d1cc5[_0xdc5a('0x19')](_0x364aa9);}return _0x5d1cc5[_0xdc5a('0x1a')](_0x364aa9)[_0xdc5a('0x1b')]();};}function respondWithResult(_0x57a415,_0xb6e9a3){_0xb6e9a3=_0xb6e9a3||0xc8;return function(_0xa41b41){if(_0xa41b41){return _0x57a415[_0xdc5a('0x1a')](_0xb6e9a3)[_0xdc5a('0x1c')](_0xa41b41);}};}function respondWithFilteredResult(_0x84cbdf,_0x12498e){return function(_0x1df640){if(_0x1df640){var _0x52044a=typeof _0x12498e[_0xdc5a('0x1d')]===_0xdc5a('0x1e')&&typeof _0x12498e['limit']===_0xdc5a('0x1e');var _0x292d1e=_0x1df640[_0xdc5a('0x1f')];var _0x9733b5=_0x52044a?0x0:_0x12498e[_0xdc5a('0x1d')];var _0x2e4b00=_0x52044a?_0x1df640[_0xdc5a('0x1f')]:_0x12498e[_0xdc5a('0x1d')]+_0x12498e['limit'];var _0x1a22ff;if(_0x2e4b00>=_0x292d1e){_0x2e4b00=_0x292d1e;_0x1a22ff=0xc8;}else{_0x1a22ff=0xce;}_0x84cbdf['status'](_0x1a22ff);return _0x84cbdf[_0xdc5a('0x20')]('Content-Range',_0x9733b5+'-'+_0x2e4b00+'/'+_0x292d1e)['json'](_0x1df640);}return null;};}function patchUpdates(_0x4a10a3){return function(_0x2a45ba){try{jsonpatch['apply'](_0x2a45ba,_0x4a10a3,!![]);}catch(_0x296e62){return BPromise[_0xdc5a('0x21')](_0x296e62);}return _0x2a45ba['save']();};}function saveUpdates(_0x4727ca,_0x2e9504){return function(_0x174a9c){if(_0x174a9c){return _0x174a9c[_0xdc5a('0x22')](_0x4727ca)[_0xdc5a('0x23')](function(_0xaee1cb){return _0xaee1cb;});}return null;};}function removeEntity(_0x2e3738,_0x22f827){return function(_0x512429){if(_0x512429){return _0x512429[_0xdc5a('0x24')]()['then'](function(){_0x2e3738['status'](0xcc)[_0xdc5a('0x1b')]();});}};}function handleEntityNotFound(_0x261f28,_0x453336){return function(_0x4de896){if(!_0x4de896){_0x261f28[_0xdc5a('0x19')](0x194);}return _0x4de896;};}function handleError(_0x235449,_0x5c1223){_0x5c1223=_0x5c1223||0x1f4;return function(_0x5f4a84){logger[_0xdc5a('0x25')](_0x5f4a84[_0xdc5a('0x26')]);if(_0x5f4a84[_0xdc5a('0x27')]){delete _0x5f4a84[_0xdc5a('0x27')];}_0x235449[_0xdc5a('0x1a')](_0x5c1223)[_0xdc5a('0x28')](_0x5f4a84);};}exports[_0xdc5a('0x29')]=function(_0x4dba71,_0xc30a52){var _0x5301b0={},_0x144109={},_0x61078e={'count':0x0,'rows':[]};var _0x32d8ca=_[_0xdc5a('0x2a')](db[_0xdc5a('0x2b')]['rawAttributes'],function(_0x245a36){return{'name':_0x245a36[_0xdc5a('0x2c')],'type':_0x245a36['type'][_0xdc5a('0x2d')]};});_0x144109[_0xdc5a('0x2e')]=_[_0xdc5a('0x2a')](_0x32d8ca,_0xdc5a('0x27'));_0x144109[_0xdc5a('0x2f')]=_[_0xdc5a('0x30')](_0x4dba71[_0xdc5a('0x2f')]);_0x144109[_0xdc5a('0x31')]=_[_0xdc5a('0x32')](_0x144109[_0xdc5a('0x2e')],_0x144109[_0xdc5a('0x2f')]);_0x5301b0[_0xdc5a('0x33')]=_['intersection'](_0x144109[_0xdc5a('0x2e')],qs[_0xdc5a('0x34')](_0x4dba71['query']['fields']));_0x5301b0[_0xdc5a('0x33')]=_0x5301b0[_0xdc5a('0x33')][_0xdc5a('0x35')]?_0x5301b0[_0xdc5a('0x33')]:_0x144109[_0xdc5a('0x2e')];if(!_0x4dba71[_0xdc5a('0x2f')]['hasOwnProperty']('nolimit')){_0x5301b0[_0xdc5a('0x36')]=qs['limit'](_0x4dba71[_0xdc5a('0x2f')][_0xdc5a('0x36')]);_0x5301b0['offset']=qs[_0xdc5a('0x1d')](_0x4dba71['query'][_0xdc5a('0x1d')]);}_0x5301b0['order']=qs['sort'](_0x4dba71[_0xdc5a('0x2f')]['sort']);_0x5301b0[_0xdc5a('0x37')]=qs[_0xdc5a('0x31')](_[_0xdc5a('0x38')](_0x4dba71[_0xdc5a('0x2f')],_0x144109['filters']),_0x32d8ca);if(_0x4dba71[_0xdc5a('0x2f')][_0xdc5a('0x39')]){_0x5301b0[_0xdc5a('0x37')]=_[_0xdc5a('0x3a')](_0x5301b0['where'],{'$or':_[_0xdc5a('0x2a')](_0x32d8ca,function(_0x7a71d){if(_0x7a71d['type']!=='VIRTUAL'){var _0x6d792={};_0x6d792[_0x7a71d[_0xdc5a('0x27')]]={'$like':'%'+_0x4dba71[_0xdc5a('0x2f')][_0xdc5a('0x39')]+'%'};return _0x6d792;}})});}_0x5301b0=_['merge']({},_0x5301b0,_0x4dba71[_0xdc5a('0x3b')]);var _0x3b67a0={'where':_0x5301b0['where']};return db[_0xdc5a('0x2b')]['count'](_0x3b67a0)['then'](function(_0x58782f){_0x61078e['count']=_0x58782f;if(_0x4dba71['query'][_0xdc5a('0x3c')]){_0x5301b0[_0xdc5a('0x3d')]=[{'all':!![]}];}return db[_0xdc5a('0x2b')][_0xdc5a('0x3e')](_0x5301b0);})[_0xdc5a('0x23')](function(_0x266017){_0x61078e[_0xdc5a('0x3f')]=_0x266017;return _0x61078e;})['then'](respondWithFilteredResult(_0xc30a52,_0x5301b0))[_0xdc5a('0x40')](handleError(_0xc30a52,null));};exports[_0xdc5a('0x41')]=function(_0x5ae9ab,_0xdbda1c){var _0x46a5db={'raw':!![],'where':{'id':_0x5ae9ab['params']['id']}},_0x39b08f={};_0x39b08f[_0xdc5a('0x2e')]=_[_0xdc5a('0x30')](db[_0xdc5a('0x2b')][_0xdc5a('0x42')]);_0x39b08f[_0xdc5a('0x2f')]=_[_0xdc5a('0x30')](_0x5ae9ab['query']);_0x39b08f[_0xdc5a('0x31')]=_[_0xdc5a('0x32')](_0x39b08f[_0xdc5a('0x2e')],_0x39b08f[_0xdc5a('0x2f')]);_0x46a5db[_0xdc5a('0x33')]=_[_0xdc5a('0x32')](_0x39b08f[_0xdc5a('0x2e')],qs[_0xdc5a('0x34')](_0x5ae9ab[_0xdc5a('0x2f')]['fields']));_0x46a5db[_0xdc5a('0x33')]=_0x46a5db['attributes'][_0xdc5a('0x35')]?_0x46a5db[_0xdc5a('0x33')]:_0x39b08f[_0xdc5a('0x2e')];if(_0x5ae9ab[_0xdc5a('0x2f')][_0xdc5a('0x3c')]){_0x46a5db[_0xdc5a('0x3d')]=[{'all':!![]}];}_0x46a5db=_['merge']({},_0x46a5db,_0x5ae9ab[_0xdc5a('0x3b')]);return db[_0xdc5a('0x2b')][_0xdc5a('0x43')](_0x46a5db)[_0xdc5a('0x23')](handleEntityNotFound(_0xdbda1c,null))['then'](respondWithResult(_0xdbda1c,null))[_0xdc5a('0x40')](handleError(_0xdbda1c,null));};exports['clone']=function(_0x441a89,_0x3b4c44){var _0xb66e0d={'where':{'id':_0x441a89[_0xdc5a('0x44')]['id']}},_0x2c223a={};_0x2c223a['model']=_[_0xdc5a('0x30')](db[_0xdc5a('0x2b')][_0xdc5a('0x42')]);_0xb66e0d['attributes']=_[_0xdc5a('0x32')](_0x2c223a['model'],qs[_0xdc5a('0x34')](_0x441a89['query'][_0xdc5a('0x34')]));_0xb66e0d[_0xdc5a('0x33')]=_0xb66e0d[_0xdc5a('0x33')][_0xdc5a('0x35')]?_0xb66e0d['attributes']:_0x2c223a[_0xdc5a('0x2e')];if(_0x441a89[_0xdc5a('0x2f')][_0xdc5a('0x3c')]){_0xb66e0d[_0xdc5a('0x3d')]=[{'all':!![]}];}_0xb66e0d=_[_0xdc5a('0x3a')]({},_0xb66e0d,_0x441a89['options']);return db[_0xdc5a('0x2b')]['find'](_0xb66e0d)[_0xdc5a('0x23')](handleEntityNotFound(_0x3b4c44,null))[_0xdc5a('0x23')](function(_0x404ee1){if(_0x404ee1){var _0x2fa341=_0x404ee1['get']({'plain':!![]});_0x2fa341=qs[_0xdc5a('0x45')](_0x2fa341,['id','createdAt','updatedAt']);_0x441a89[_0xdc5a('0x46')]=_[_0xdc5a('0x45')](_0x441a89[_0xdc5a('0x46')],['id',_0xdc5a('0x47'),_0xdc5a('0x48')]);return db['Attachment']['create'](_['merge'](_0x2fa341,_0x441a89['body']),{'include':_0x441a89['query'][_0xdc5a('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3b4c44,0xc9))['catch'](handleError(_0x3b4c44,null));};exports['update']=function(_0x37b4ac,_0x79a47f){if(_0x37b4ac['body']['id']){delete _0x37b4ac['body']['id'];}return db['Attachment'][_0xdc5a('0x43')]({'where':{'id':_0x37b4ac[_0xdc5a('0x44')]['id']}})[_0xdc5a('0x23')](handleEntityNotFound(_0x79a47f,null))[_0xdc5a('0x23')](saveUpdates(_0x37b4ac[_0xdc5a('0x46')],null))[_0xdc5a('0x23')](respondWithResult(_0x79a47f,null))[_0xdc5a('0x40')](handleError(_0x79a47f,null));};exports[_0xdc5a('0x24')]=function(_0x189dcb,_0x1f1e02){return db[_0xdc5a('0x2b')][_0xdc5a('0x43')]({'where':{'id':_0x189dcb[_0xdc5a('0x44')]['id']}})[_0xdc5a('0x23')](handleEntityNotFound(_0x1f1e02,null))['then'](removeEntity(_0x1f1e02,null))['catch'](handleError(_0x1f1e02,null));};exports[_0xdc5a('0x49')]=function(_0x2f3c5a,_0xec4e13,_0x12aebc){_0x2f3c5a[_0xdc5a('0x46')][_0xdc5a('0x27')]=_0x2f3c5a[_0xdc5a('0x4a')][_0xdc5a('0x4b')];_0x2f3c5a[_0xdc5a('0x46')][_0xdc5a('0x4c')]=_0x2f3c5a['file'][_0xdc5a('0x4d')];_0x2f3c5a[_0xdc5a('0x46')][_0xdc5a('0x4e')]=_0x2f3c5a[_0xdc5a('0x4a')][_0xdc5a('0x4f')];return db[_0xdc5a('0x2b')][_0xdc5a('0x49')](_0x2f3c5a[_0xdc5a('0x46')])[_0xdc5a('0x23')](respondWithResult(_0xec4e13,0xc9))[_0xdc5a('0x40')](handleError(_0xec4e13,null));};exports[_0xdc5a('0x50')]=function(_0x16b699,_0x339640,_0x419a4a){return db[_0xdc5a('0x2b')][_0xdc5a('0x51')]({'where':{'id':_0x16b699[_0xdc5a('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x339640,null))['then'](function(_0x299cfc){if(_0x299cfc){var _0x19127b=_0x299cfc[_0xdc5a('0x52')]!==null;var _0x38359b=path[_0xdc5a('0x53')](config[_0xdc5a('0x54')],'server/files/attachments/');if(_0x19127b){_0x38359b=path[_0xdc5a('0x53')](_0x38359b,_0xdc5a('0x55'));}var _0x3681b4=path[_0xdc5a('0x53')](_0x38359b,_0x299cfc[_0xdc5a('0x4c')]);return _0x339640[_0xdc5a('0x50')](_0x3681b4);}})['catch'](handleError(_0x339640,null));};
\ No newline at end of file
index 76ffcb0..bd64521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x909c=['lodash','util','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x909c,0x90));var _0xc909=function(_0x466264,_0x1e46a8){_0x466264=_0x466264-0x0;var _0x4660fb=_0x909c[_0x466264];return _0x4660fb;};'use strict';var _=require(_0xc909('0x0'));var util=require(_0xc909('0x1'));var logger=require('../../config/logger')(_0xc909('0x2'));var moment=require('moment');var BPromise=require(_0xc909('0x3'));var rp=require(_0xc909('0x4'));var fs=require('fs');var path=require(_0xc909('0x5'));var rimraf=require(_0xc909('0x6'));var config=require('../../config/environment');var attributes=require(_0xc909('0x7'));module[_0xc909('0x8')]=function(_0x485c55,_0x46ad28){return _0x485c55[_0xc909('0x9')](_0xc909('0xa'),attributes,{'tableName':_0xc909('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88c9=['Attachment','attachments','lodash','util','request-promise','path','rimraf','./attachment.attributes','define'];(function(_0x4777a8,_0x205619){var _0x4e0267=function(_0x45773b){while(--_0x45773b){_0x4777a8['push'](_0x4777a8['shift']());}};_0x4e0267(++_0x205619);}(_0x88c9,0x92));var _0x988c=function(_0x191862,_0x8ed6ca){_0x191862=_0x191862-0x0;var _0x510fe6=_0x88c9[_0x191862];return _0x510fe6;};'use strict';var _=require(_0x988c('0x0'));var util=require(_0x988c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x988c('0x2'));var fs=require('fs');var path=require(_0x988c('0x3'));var rimraf=require(_0x988c('0x4'));var config=require('../../config/environment');var attributes=require(_0x988c('0x5'));module['exports']=function(_0x572758,_0x5e33ff){return _0x572758[_0x988c('0x6')](_0x988c('0x7'),attributes,{'tableName':_0x988c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3ba64fa..295dd09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe812=['error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1fddfc,_0x242fd9){var _0x2567dc=function(_0x72de20){while(--_0x72de20){_0x1fddfc['push'](_0x1fddfc['shift']());}};_0x2567dc(++_0x242fd9);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var moment=require(_0x2e81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e81('0x2'));var db=require(_0x2e81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e81('0x4'))(_0x2e81('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e81('0x6'));var client=jayson[_0x2e81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36604d,_0x32b221,_0x27f9c6){return new BPromise(function(_0x5559ca,_0x142cab){return client[_0x2e81('0x8')](_0x36604d,_0x27f9c6)[_0x2e81('0x9')](function(_0x11a56b){logger['info'](_0x2e81('0xa'),_0x32b221,_0x2e81('0xb'));logger[_0x2e81('0xc')](_0x2e81('0xd'),_0x32b221,_0x2e81('0xb'),JSON[_0x2e81('0xe')](_0x11a56b));if(_0x11a56b[_0x2e81('0xf')]){if(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x10')]===0x1f4){logger[_0x2e81('0xf')](_0x2e81('0xa'),_0x32b221,_0x11a56b['error'][_0x2e81('0x11')]);return _0x142cab(_0x11a56b[_0x2e81('0xf')]['message']);}logger[_0x2e81('0xf')]('Attachment,\x20%s,\x20%s',_0x32b221,_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);return _0x5559ca(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);}else{logger[_0x2e81('0x12')](_0x2e81('0xa'),_0x32b221,'request\x20sent');_0x5559ca(_0x11a56b[_0x2e81('0x13')][_0x2e81('0x11')]);}})['catch'](function(_0x330131){logger['error'](_0x2e81('0xa'),_0x32b221,_0x330131);_0x142cab(_0x330131);});});}exports[_0x2e81('0x14')]=function(_0x4c1b11){var _0x402992=this;return new Promise(function(_0x2bb9b6,_0xbb61a4){return db[_0x2e81('0x15')][_0x2e81('0x16')](_0x4c1b11[_0x2e81('0x17')],{'raw':_0x4c1b11[_0x2e81('0x18')]?_0x4c1b11[_0x2e81('0x18')][_0x2e81('0x19')]===undefined?!![]:![]:!![]})[_0x2e81('0x9')](function(_0x524694){logger[_0x2e81('0x12')](_0x2e81('0x14'),_0x4c1b11);logger[_0x2e81('0xc')](_0x2e81('0x14'),_0x4c1b11,JSON[_0x2e81('0xe')](_0x524694));_0x2bb9b6(_0x524694);})[_0x2e81('0x1a')](function(_0x18b9be){logger[_0x2e81('0xf')]('CreateAttachment',_0x18b9be[_0x2e81('0x11')],_0x4c1b11);_0xbb61a4(_0x402992['error'](0x1f4,_0x18b9be[_0x2e81('0x11')]));});});};
\ No newline at end of file
+var _0x8e44=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x9a138c,_0x2607f8){var _0x3771a3=function(_0x22ebbb){while(--_0x22ebbb){_0x9a138c['push'](_0x9a138c['shift']());}};_0x3771a3(++_0x2607f8);}(_0x8e44,0x1ac));var _0x48e4=function(_0x2f7be6,_0x13bd1f){_0x2f7be6=_0x2f7be6-0x0;var _0x4ca7ab=_0x8e44[_0x2f7be6];return _0x4ca7ab;};'use strict';var _=require(_0x48e4('0x0'));var util=require(_0x48e4('0x1'));var moment=require(_0x48e4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48e4('0x3'));var db=require(_0x48e4('0x4'))['db'];var utils=require(_0x48e4('0x5'));var logger=require(_0x48e4('0x6'))('rpc');var config=require(_0x48e4('0x7'));var jayson=require(_0x48e4('0x8'));var client=jayson[_0x48e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2c12,_0x26c5de,_0xfd30df){return new BPromise(function(_0x552cb1,_0x1ae7a7){return client[_0x48e4('0xa')](_0x4e2c12,_0xfd30df)[_0x48e4('0xb')](function(_0x2ba319){logger[_0x48e4('0xc')](_0x48e4('0xd'),_0x26c5de,'request\x20sent');logger[_0x48e4('0xe')](_0x48e4('0xf'),_0x26c5de,_0x48e4('0x10'),JSON['stringify'](_0x2ba319));if(_0x2ba319['error']){if(_0x2ba319[_0x48e4('0x11')][_0x48e4('0x12')]===0x1f4){logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x2ba319['error'][_0x48e4('0x13')]);return _0x1ae7a7(_0x2ba319['error'][_0x48e4('0x13')]);}logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x2ba319[_0x48e4('0x11')][_0x48e4('0x13')]);return _0x552cb1(_0x2ba319[_0x48e4('0x11')][_0x48e4('0x13')]);}else{logger['info'](_0x48e4('0xd'),_0x26c5de,_0x48e4('0x10'));_0x552cb1(_0x2ba319['result'][_0x48e4('0x13')]);}})[_0x48e4('0x14')](function(_0x4dc92e){logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x4dc92e);_0x1ae7a7(_0x4dc92e);});});}exports[_0x48e4('0x15')]=function(_0x4ffc0d){var _0x231dcd=this;return new Promise(function(_0x16e405,_0x4e3943){return db['Attachment'][_0x48e4('0x16')](_0x4ffc0d['body'],{'raw':_0x4ffc0d['options']?_0x4ffc0d[_0x48e4('0x17')][_0x48e4('0x18')]===undefined?!![]:![]:!![]})[_0x48e4('0xb')](function(_0xad2f7d){logger[_0x48e4('0xc')]('CreateAttachment',_0x4ffc0d);logger['debug'](_0x48e4('0x15'),_0x4ffc0d,JSON[_0x48e4('0x19')](_0xad2f7d));_0x16e405(_0xad2f7d);})[_0x48e4('0x14')](function(_0x131817){logger[_0x48e4('0x11')](_0x48e4('0x15'),_0x131817[_0x48e4('0x13')],_0x4ffc0d);_0x4e3943(_0x231dcd[_0x48e4('0x11')](0x1f4,_0x131817[_0x48e4('0x13')]));});});};
\ No newline at end of file
index cafe17d..6946649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x0b0e[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x47d623,_0x33b2ca){var _0x40a6df=function(_0x59f018){while(--_0x59f018){_0x47d623['push'](_0x47d623['shift']());}};_0x40a6df(++_0x33b2ca);}(_0x2032,0xd9));var _0x2203=function(_0x37e421,_0x28c925){_0x37e421=_0x37e421-0x0;var _0x3b1a56=_0x2032[_0x37e421];return _0x3b1a56;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
index 29720cb..d0d3257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c81=['User','find','map','emails','value','admin','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','Setting','findOne','allowedLoginAttempts'];(function(_0xd149e7,_0x3179f1){var _0x3153e9=function(_0x47c793){while(--_0x47c793){_0xd149e7['push'](_0xd149e7['shift']());}};_0x3153e9(++_0x3179f1);}(_0x8c81,0x1d9));var _0x18c8=function(_0x271b2f,_0x5a0b1f){_0x271b2f=_0x271b2f-0x0;var _0x236b40=_0x8c81[_0x271b2f];return _0x236b40;};'use strict';var _=require('lodash');var passport=require(_0x18c8('0x0'));var GoogleStrategy=require(_0x18c8('0x1'))[_0x18c8('0x2')];var moment=require(_0x18c8('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x18c8('0x4'));var signToken=require(_0x18c8('0x5'))[_0x18c8('0x6')];var utils=require(_0x18c8('0x7'));exports[_0x18c8('0x8')]=passport[_0x18c8('0x9')](_0x18c8('0xa'),{'failureRedirect':_0x18c8('0xb'),'scope':[_0x18c8('0xc'),_0x18c8('0xd')],'session':![]});exports[_0x18c8('0xe')]=passport[_0x18c8('0x9')](_0x18c8('0xa'),{'failureRedirect':_0x18c8('0xb'),'session':![]});passport[_0x18c8('0xf')](new GoogleStrategy({'clientID':config[_0x18c8('0xa')]?config['google'][_0x18c8('0x10')]:'id','clientSecret':config[_0x18c8('0xa')]?config[_0x18c8('0xa')][_0x18c8('0x11')]:'secret','callbackURL':config[_0x18c8('0xa')]?config[_0x18c8('0xa')]['callbackURL']:''},function(_0x38286c,_0x3a8f98,_0x41c0dd,_0x1f86fa){var _0x1f8036,_0x3c2564;return db[_0x18c8('0x12')][_0x18c8('0x13')]({'where':{'id':0x1},'attributes':[_0x18c8('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x3f714b){_0x1f8036=_0x3f714b;return db[_0x18c8('0x15')][_0x18c8('0x16')]({'where':{'email':_[_0x18c8('0x17')](_0x41c0dd[_0x18c8('0x18')],_0x18c8('0x19')),'role':{'$or':[_0x18c8('0x1a'),'user',_0x18c8('0x1b')]}}});})[_0x18c8('0x1c')](function(_0x4dd308){_0x3c2564=_0x4dd308;if(_0x3c2564){if(_0x3c2564[_0x18c8('0x1d')]){return _0x1f86fa(_0x18c8('0x1e'));}else if(_0x1f8036[_0x18c8('0x1f')]>0x0){if(_0x3c2564[_0x18c8('0x20')]){if(moment(_0x3c2564[_0x18c8('0x21')])['add'](_0x1f8036[_0x18c8('0x1f')],_0x18c8('0x22'))>moment()){return _0x1f86fa('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x18c8('0x23')](_0x3c2564,0x0,![],null)[_0x18c8('0x1c')](function(){return utils[_0x18c8('0x24')](_0x3c2564);})[_0x18c8('0x1c')](function(){return _0x1f86fa(null,_0x3c2564);});}}else{return utils[_0x18c8('0x24')](_0x3c2564)['then'](function(){return _0x1f86fa(null,_0x3c2564);});}}else{return utils['getLicense'](_0x3c2564)['then'](function(){return _0x1f86fa(null,_0x3c2564);});}}return _0x1f86fa(_0x18c8('0x1e'));})[_0x18c8('0x25')](function(_0x400e3a){_0x1f86fa(_0x400e3a);});}));
\ No newline at end of file
+var _0xe319=['clientSecret','secret','findOne','blockDuration','then','User','find','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','/login','profile','email','callback','use','clientID'];(function(_0x188f0f,_0x5d738a){var _0x5bfc5f=function(_0x3d488d){while(--_0x3d488d){_0x188f0f['push'](_0x188f0f['shift']());}};_0x5bfc5f(++_0x5d738a);}(_0xe319,0x76));var _0x9e31=function(_0x5eb97f,_0x4075b9){_0x5eb97f=_0x5eb97f-0x0;var _0x30e7b4=_0xe319[_0x5eb97f];return _0x30e7b4;};'use strict';var _=require(_0x9e31('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x9e31('0x1')];var moment=require('moment');var db=require(_0x9e31('0x2'))['db'];var config=require(_0x9e31('0x3'));var signToken=require(_0x9e31('0x4'))['signToken'];var utils=require(_0x9e31('0x5'));exports['login']=passport[_0x9e31('0x6')](_0x9e31('0x7'),{'failureRedirect':_0x9e31('0x8'),'scope':[_0x9e31('0x9'),_0x9e31('0xa')],'session':![]});exports[_0x9e31('0xb')]=passport['authenticate'](_0x9e31('0x7'),{'failureRedirect':_0x9e31('0x8'),'session':![]});passport[_0x9e31('0xc')](new GoogleStrategy({'clientID':config[_0x9e31('0x7')]?config[_0x9e31('0x7')][_0x9e31('0xd')]:'id','clientSecret':config[_0x9e31('0x7')]?config[_0x9e31('0x7')][_0x9e31('0xe')]:_0x9e31('0xf'),'callbackURL':config[_0x9e31('0x7')]?config[_0x9e31('0x7')]['callbackURL']:''},function(_0x54aa07,_0x1444f1,_0x16b698,_0x36107c){var _0x52b6dd,_0x1db513;return db['Setting'][_0x9e31('0x10')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9e31('0x11')],'raw':!![]})[_0x9e31('0x12')](function(_0x2e5666){_0x52b6dd=_0x2e5666;return db[_0x9e31('0x13')][_0x9e31('0x14')]({'where':{'email':_[_0x9e31('0x15')](_0x16b698[_0x9e31('0x16')],_0x9e31('0x17')),'role':{'$or':[_0x9e31('0x18'),_0x9e31('0x19'),_0x9e31('0x1a')]}}});})[_0x9e31('0x12')](function(_0x478ef9){_0x1db513=_0x478ef9;if(_0x1db513){if(_0x1db513['disabled']){return _0x36107c(_0x9e31('0x1b'));}else if(_0x52b6dd[_0x9e31('0x11')]>0x0){if(_0x1db513[_0x9e31('0x1c')]){if(moment(_0x1db513[_0x9e31('0x1d')])[_0x9e31('0x1e')](_0x52b6dd[_0x9e31('0x11')],'minutes')>moment()){return _0x36107c(_0x9e31('0x1b'));}else{return utils[_0x9e31('0x1f')](_0x1db513,0x0,![],null)[_0x9e31('0x12')](function(){return utils[_0x9e31('0x20')](_0x1db513);})[_0x9e31('0x12')](function(){return _0x36107c(null,_0x1db513);});}}else{return utils[_0x9e31('0x20')](_0x1db513)[_0x9e31('0x12')](function(){return _0x36107c(null,_0x1db513);});}}else{return utils['getLicense'](_0x1db513)[_0x9e31('0x12')](function(){return _0x36107c(null,_0x1db513);});}}return _0x36107c(_0x9e31('0x1b'));})['catch'](function(_0x190bfb){_0x36107c(_0x190bfb);});}));
\ No newline at end of file
index 0ff6d45..a852660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf8e=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf8e,0x160));var _0xecf8=function(_0x18fb88,_0x135806){_0x18fb88=_0x18fb88-0x0;var _0x2b73ee=_0xcf8e[_0x18fb88];return _0x2b73ee;};'use strict';var express=require(_0xecf8('0x0'));var passport=require(_0xecf8('0x1'));var router=express[_0xecf8('0x2')]();var controller=require(_0xecf8('0x3'));var userController=require(_0xecf8('0x4'));var authService=require(_0xecf8('0x5'));router[_0xecf8('0x6')]('/',controller[_0xecf8('0x7')]);router[_0xecf8('0x6')](_0xecf8('0x8'),controller[_0xecf8('0x9')],authService[_0xecf8('0xa')],userController[_0xecf8('0x7')],authService[_0xecf8('0xb')]);module[_0xecf8('0xc')]=router;
\ No newline at end of file
+var _0xf0ab=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x34c570,_0x3a95a6){var _0xae81e9=function(_0x6c142d){while(--_0x6c142d){_0x34c570['push'](_0x34c570['shift']());}};_0xae81e9(++_0x3a95a6);}(_0xf0ab,0x1ca));var _0xbf0a=function(_0xf78663,_0x283d65){_0xf78663=_0xf78663-0x0;var _0x58f65a=_0xf0ab[_0xf78663];return _0x58f65a;};'use strict';var express=require(_0xbf0a('0x0'));var passport=require(_0xbf0a('0x1'));var router=express[_0xbf0a('0x2')]();var controller=require(_0xbf0a('0x3'));var userController=require(_0xbf0a('0x4'));var authService=require(_0xbf0a('0x5'));router[_0xbf0a('0x6')]('/',controller[_0xbf0a('0x7')]);router[_0xbf0a('0x6')](_0xbf0a('0x8'),controller[_0xbf0a('0x9')],authService[_0xbf0a('0xa')],userController[_0xbf0a('0x7')],authService[_0xbf0a('0xb')]);module[_0xbf0a('0xc')]=router;
\ No newline at end of file
index bda3ce7..8d32368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ee=['toLowerCase','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','then','password','salt','role','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockedAt','add','blockDuration','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','authentication','pass','merge','format','\x22%s\x22\x20<%s>','email','user','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xf2ee,0x16c));var _0xef2e=function(_0x134fd0,_0x5b0366){_0x134fd0=_0x134fd0-0x0;var _0x431bd=_0xf2ee[_0x134fd0];return _0x431bd;};'use strict';var util=require(_0xef2e('0x0'));var passport=require('passport');var LocalStrategy=require(_0xef2e('0x1'))[_0xef2e('0x2')];var jayson=require(_0xef2e('0x3'));var _=require(_0xef2e('0x4'));var rs=require(_0xef2e('0x5'));var moment=require(_0xef2e('0x6'));var db=require(_0xef2e('0x7'))['db'];var authService=require(_0xef2e('0x8'));var utils=require('../../config/utils');var client=jayson[_0xef2e('0x9')][_0xef2e('0xa')]({'port':0x232b});function localAuthenticate(_0x8ccb24,_0x1b58f1,_0x5890bc,_0x2840d2){var _0x42d0b9,_0x17a975;return db[_0xef2e('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xef2e('0xc'),'blockDuration'],'raw':!![]})[_0xef2e('0xd')](function(_0x3d65f6){_0x42d0b9=_0x3d65f6;return _0x8ccb24['findOne']({'attributes':['id','name',_0xef2e('0xe'),_0xef2e('0xf'),_0xef2e('0x10'),'disabled','blocked','blockedAt',_0xef2e('0x11')],'where':{'name':_0x1b58f1,'role':{'$or':[_0xef2e('0x12'),'user',_0xef2e('0x13')]}}});})[_0xef2e('0xd')](function(_0x47a56b){if(!_0x47a56b||_0x47a56b&&_0x47a56b[_0xef2e('0x14')]!==_0x1b58f1){throw new Error(_0xef2e('0x15'));}else{_0x17a975=_0x47a56b;return _0x17a975;}})[_0xef2e('0xd')](function(){_0x17a975[_0xef2e('0x16')](_0x5890bc,function(_0x4b1eeb,_0x5ef946){var _0x36969b=_0x17a975[_0xef2e('0x11')]+0x1;if(_0x4b1eeb){return _0x2840d2(_0x4b1eeb);}else if(!_0x5ef946){if(_0x17a975[_0xef2e('0x17')]){return _0x2840d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x42d0b9['allowedLoginAttempts']>0x0){if(_0x17a975['blocked']){if(_0x42d0b9['blockDuration']>0x0){if(moment(_0x17a975[_0xef2e('0x18')])[_0xef2e('0x19')](_0x42d0b9[_0xef2e('0x1a')],'minutes')>moment()){return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}else{return utils[_0xef2e('0x1b')](_0x17a975,_0x36969b,![],null)[_0xef2e('0xd')](function(){return _0x2840d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}}else{if(_0x36969b>=_0x42d0b9[_0xef2e('0xc')]){return utils[_0xef2e('0x1b')](_0x17a975,0x0,!![],moment())[_0xef2e('0xd')](function(){return _0x2840d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x17a975,_0x36969b,![],null)['then'](function(){return _0x2840d2(null,![],{'message':_0xef2e('0x15')});});}}}else{return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}}else{if(_0x17a975[_0xef2e('0x17')]){return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}else if(_0x42d0b9[_0xef2e('0xc')]>0x0){if(_0x17a975[_0xef2e('0x1c')]){if(_0x42d0b9[_0xef2e('0x1a')]>0x0){if(moment(_0x17a975[_0xef2e('0x18')])[_0xef2e('0x19')](_0x42d0b9[_0xef2e('0x1a')],_0xef2e('0x1d'))>moment()){return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}else{return utils[_0xef2e('0x1b')](_0x17a975,0x0,![],null)[_0xef2e('0xd')](function(){return utils[_0xef2e('0x1e')](_0x17a975);})[_0xef2e('0xd')](function(){return _0x2840d2(null,_0x17a975);});}}else{return _0x2840d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xef2e('0x1b')](_0x17a975,0x0,![],null)[_0xef2e('0xd')](function(){return utils[_0xef2e('0x1e')](_0x17a975);})[_0xef2e('0xd')](function(){return _0x2840d2(null,_0x17a975);})[_0xef2e('0x1f')](function(_0x54b751){return _0x2840d2(null,![],_0x54b751);});}}else{if(_0x17a975[_0xef2e('0x1c')]){return _0x2840d2(null,![],{'message':_0xef2e('0x15')});}else{return utils['getLicense'](_0x17a975)[_0xef2e('0xd')](function(){return _0x2840d2(null,_0x17a975);});}}}});})[_0xef2e('0x1f')](function(_0x1b3407){return _0x2840d2(null,![],_0x1b3407);});}function sendServiceMail(_0x543956){return db[_0xef2e('0x20')][_0xef2e('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xef2e('0x22')],'as':'Smtp'}]})[_0xef2e('0xd')](function(_0x4acbd8){if(!_0x4acbd8){throw new Error(_0xef2e('0x23'));}var _0x235036={'tls':{'rejectUnauthorized':![]}};if(_0x4acbd8[_0xef2e('0x24')][_0xef2e('0x25')]){_0x235036['service']=_0x4acbd8['Smtp'][_0xef2e('0x25')];}else{_0x235036[_0xef2e('0x26')]=_0x4acbd8[_0xef2e('0x24')]['host'];_0x235036[_0xef2e('0x27')]=_0x4acbd8['Smtp'][_0xef2e('0x27')];_0x235036['secure']=_0x4acbd8[_0xef2e('0x24')]['secure'];}if(_0x4acbd8[_0xef2e('0x24')][_0xef2e('0x28')]){_0x235036['auth']={'user':_0x4acbd8['Smtp']['user'],'pass':_0x4acbd8[_0xef2e('0x24')][_0xef2e('0x29')]};}var _0x15b1f4={'account':_0x235036,'message':_[_0xef2e('0x2a')]({'from':util[_0xef2e('0x2b')](_0xef2e('0x2c'),_0x4acbd8[_0xef2e('0x14')],_0x4acbd8[_0xef2e('0x2d')]||_0x4acbd8[_0xef2e('0x24')][_0xef2e('0x2e')])},_0x543956)};return client[_0xef2e('0x2f')](_0xef2e('0x30'),_0x15b1f4);})[_0xef2e('0xd')](function(_0x53995d){if(_0x53995d['error']){throw new Error(util[_0xef2e('0x2b')](_0xef2e('0x31'),_0x53995d[_0xef2e('0x32')][_0xef2e('0x33')]||JSON['stringify'](_0x53995d[_0xef2e('0x32')])));}return!![];});}function handleError(_0xaf147,_0x468d7e,_0x51fb26){return _0xaf147['status'](_0x468d7e||0x1f4)['send']({'message':_0x51fb26?_0x51fb26['message']||_0x51fb26:''});}exports[_0xef2e('0x34')]=function(_0x4be713,_0x5eb52f,_0x1985ad){passport['authenticate'](_0xef2e('0x35'),function(_0x41dfd4,_0x108136,_0x1e2844){var _0x3e351c=_0x41dfd4||_0x1e2844;if(_0x3e351c){return handleError(_0x5eb52f,0x191,_0x3e351c);}if(!_0x108136){return handleError(_0x5eb52f,0x194,{'message':_0xef2e('0x36')});}else{var _0x11661e={'payload':{'id':_0x108136['id'],'role':_0x108136[_0xef2e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xef2e('0x37')](_0x11661e)[_0xef2e('0xd')](function(_0x34bbc7){_0x5eb52f[_0xef2e('0x38')]({'id':_0x108136['id'],'token':_0x34bbc7,'statusCall':'','isAlreadyLogged':_0x108136[_0xef2e('0x39')]});});}})(_0x4be713,_0x5eb52f,_0x1985ad);};exports[_0xef2e('0x3a')]=function(_0x2ef7d5,_0x3df65b,_0x52b8d8){if(!_0x2ef7d5[_0xef2e('0x3b')][_0xef2e('0x2d')]){return handleError(_0x3df65b,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x51e73a=rs['generate']();_0x2ef7d5[_0xef2e('0x3b')][_0xef2e('0x2d')]=_0x2ef7d5[_0xef2e('0x3b')][_0xef2e('0x2d')][_0xef2e('0x3c')]()[_0xef2e('0x3d')]();var _0x457bcb;return db[_0xef2e('0xb')][_0xef2e('0x3e')]({'where':{'id':0x1},'attributes':[_0xef2e('0xc'),_0xef2e('0x1a')],'raw':!![]})['then'](function(_0x35cb33){_0x457bcb=_0x35cb33;return db[_0xef2e('0x3f')][_0xef2e('0x21')]({'where':{'email':_0x2ef7d5['body']['email']}});})[_0xef2e('0xd')](function(_0x4570a8){if(!_0x4570a8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4570a8['disabled']){throw new Error(_0xef2e('0x40'));}if(_0x4570a8[_0xef2e('0x1c')]){if(moment(_0x4570a8[_0xef2e('0x18')])[_0xef2e('0x19')](_0x457bcb[_0xef2e('0x1a')],_0xef2e('0x1d'))>moment()){throw new Error(_0xef2e('0x41'));}else{_0x4570a8['blocked']=![];_0x4570a8['blockedAt']=null;}}_0x4570a8[_0xef2e('0x42')]=_0x51e73a;_0x4570a8['resetPasswordExpires']=Date[_0xef2e('0x43')]()+0x36ee80;return _0x4570a8['save']();})['then'](function(){return sendServiceMail({'to':_0x2ef7d5[_0xef2e('0x3b')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xef2e('0x44')+_0xef2e('0x45')+'https://'+_0x2ef7d5[_0xef2e('0x46')]['host']+'/reset/'+_0x51e73a+'\x0a\x0a'+_0xef2e('0x47')});})[_0xef2e('0xd')](function(){_0x3df65b[_0xef2e('0x48')](0xc8)[_0xef2e('0x49')]({'message':_0xef2e('0x4a')});})[_0xef2e('0x1f')](function(_0x28d30f){return handleError(_0x3df65b,0x1f4,_0x28d30f);});};exports['reset']=function(_0x9f1679,_0x2e9551,_0x383f42){return db[_0xef2e('0x3f')][_0xef2e('0x21')]({'where':{'resetPasswordToken':_0x9f1679[_0xef2e('0x4b')][_0xef2e('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xef2e('0x43')]()}}})[_0xef2e('0xd')](function(_0x3be846){if(!_0x3be846){throw new Error(_0xef2e('0x4d'));}return db[_0xef2e('0xb')][_0xef2e('0x3e')]({'attributes':['id',_0xef2e('0x4e'),_0xef2e('0x4f'),'passwordHistoryLimit']})['then'](function(_0x25cf78){if(_0x25cf78['securePassword'])authService[_0xef2e('0x50')](_0x9f1679[_0xef2e('0x3b')][_0xef2e('0xe')]);if(!_0x25cf78[_0xef2e('0x4f')]||!_0x3be846[_0xef2e('0x51')])return _0x3be846;authService[_0xef2e('0x52')](_0x9f1679[_0xef2e('0x3b')][_0xef2e('0xe')],_0x3be846['previousPasswords'],_0x25cf78[_0xef2e('0x53')]);return _0x3be846;})[_0xef2e('0xd')](function(){_0x3be846['password']=_0x9f1679[_0xef2e('0x3b')][_0xef2e('0xe')];_0x3be846[_0xef2e('0x42')]=null;_0x3be846['resetPasswordExpires']=null;return _0x3be846['save']();});})[_0xef2e('0xd')](function(){_0x2e9551[_0xef2e('0x48')](0xc8)[_0xef2e('0x49')]({'message':'Password\x20reset!'});})[_0xef2e('0x1f')](function(_0x1e708b){return handleError(_0x2e9551,0x1f4,_0x1e708b);});};passport[_0xef2e('0x54')](new LocalStrategy({'usernameField':'name','passwordField':_0xef2e('0xe')},function(_0x541f32,_0x45a6ec,_0xd70264){return localAuthenticate(db[_0xef2e('0x3f')],_0x541f32,_0x45a6ec,_0xd70264);}));
\ No newline at end of file
+var _0x6728=['service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','send','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','disabled','blocked','blockedAt','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x992fd0,_0x53feeb){var _0x5a4785=function(_0x15e995){while(--_0x15e995){_0x992fd0['push'](_0x992fd0['shift']());}};_0x5a4785(++_0x53feeb);}(_0x6728,0x85));var _0x8672=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x6728[_0x3ebb69];return _0x421e59;};'use strict';var util=require(_0x8672('0x0'));var passport=require(_0x8672('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x8672('0x2'));var _=require(_0x8672('0x3'));var rs=require(_0x8672('0x4'));var moment=require(_0x8672('0x5'));var db=require(_0x8672('0x6'))['db'];var authService=require(_0x8672('0x7'));var utils=require(_0x8672('0x8'));var client=jayson[_0x8672('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x2d4911,_0x2eaaa3,_0x3854a2,_0x5c33f4){var _0x5a79c5,_0x48939e;return db[_0x8672('0xa')][_0x8672('0xb')]({'where':{'id':0x1},'attributes':[_0x8672('0xc'),_0x8672('0xd')],'raw':!![]})['then'](function(_0x39dba1){_0x5a79c5=_0x39dba1;return _0x2d4911[_0x8672('0xb')]({'attributes':['id',_0x8672('0xe'),_0x8672('0xf'),'salt','role',_0x8672('0x10'),_0x8672('0x11'),_0x8672('0x12'),'loginAttempts'],'where':{'name':_0x2eaaa3,'role':{'$or':['admin',_0x8672('0x13'),'agent']}}});})[_0x8672('0x14')](function(_0x3dc3cc){if(!_0x3dc3cc||_0x3dc3cc&&_0x3dc3cc[_0x8672('0xe')]!==_0x2eaaa3){throw new Error(_0x8672('0x15'));}else{_0x48939e=_0x3dc3cc;return _0x48939e;}})['then'](function(){_0x48939e[_0x8672('0x16')](_0x3854a2,function(_0x5055fd,_0x221256){var _0x59fa35=_0x48939e[_0x8672('0x17')]+0x1;if(_0x5055fd){return _0x5c33f4(_0x5055fd);}else if(!_0x221256){if(_0x48939e[_0x8672('0x10')]){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}else if(_0x5a79c5[_0x8672('0xc')]>0x0){if(_0x48939e[_0x8672('0x11')]){if(_0x5a79c5[_0x8672('0xd')]>0x0){if(moment(_0x48939e['blockedAt'])['add'](_0x5a79c5[_0x8672('0xd')],_0x8672('0x18'))>moment()){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}else{return utils[_0x8672('0x19')](_0x48939e,_0x59fa35,![],null)[_0x8672('0x14')](function(){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});});}}else{return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}}else{if(_0x59fa35>=_0x5a79c5['allowedLoginAttempts']){return utils[_0x8672('0x19')](_0x48939e,0x0,!![],moment())[_0x8672('0x14')](function(){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});});}else{return utils[_0x8672('0x19')](_0x48939e,_0x59fa35,![],null)[_0x8672('0x14')](function(){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});});}}}else{return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}}else{if(_0x48939e[_0x8672('0x10')]){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}else if(_0x5a79c5[_0x8672('0xc')]>0x0){if(_0x48939e[_0x8672('0x11')]){if(_0x5a79c5[_0x8672('0xd')]>0x0){if(moment(_0x48939e[_0x8672('0x12')])[_0x8672('0x1a')](_0x5a79c5[_0x8672('0xd')],_0x8672('0x18'))>moment()){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}else{return utils[_0x8672('0x19')](_0x48939e,0x0,![],null)[_0x8672('0x14')](function(){return utils[_0x8672('0x1b')](_0x48939e);})[_0x8672('0x14')](function(){return _0x5c33f4(null,_0x48939e);});}}else{return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}}else{return utils['clearBlockUser'](_0x48939e,0x0,![],null)[_0x8672('0x14')](function(){return utils[_0x8672('0x1b')](_0x48939e);})[_0x8672('0x14')](function(){return _0x5c33f4(null,_0x48939e);})[_0x8672('0x1c')](function(_0x299747){return _0x5c33f4(null,![],_0x299747);});}}else{if(_0x48939e[_0x8672('0x11')]){return _0x5c33f4(null,![],{'message':_0x8672('0x15')});}else{return utils['getLicense'](_0x48939e)['then'](function(){return _0x5c33f4(null,_0x48939e);});}}}});})['catch'](function(_0xac99ea){return _0x5c33f4(null,![],_0xac99ea);});}function sendServiceMail(_0x171515){return db[_0x8672('0x1d')][_0x8672('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x8672('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x8672('0x1f')}]})[_0x8672('0x14')](function(_0x5b5a66){if(!_0x5b5a66){throw new Error(_0x8672('0x20'));}var _0x3bec0a={'tls':{'rejectUnauthorized':![]}};if(_0x5b5a66[_0x8672('0x1f')][_0x8672('0x21')]){_0x3bec0a[_0x8672('0x21')]=_0x5b5a66[_0x8672('0x1f')][_0x8672('0x21')];}else{_0x3bec0a[_0x8672('0x22')]=_0x5b5a66[_0x8672('0x1f')][_0x8672('0x22')];_0x3bec0a['port']=_0x5b5a66[_0x8672('0x1f')][_0x8672('0x23')];_0x3bec0a[_0x8672('0x24')]=_0x5b5a66['Smtp'][_0x8672('0x24')];}if(_0x5b5a66['Smtp'][_0x8672('0x25')]){_0x3bec0a[_0x8672('0x26')]={'user':_0x5b5a66[_0x8672('0x1f')][_0x8672('0x13')],'pass':_0x5b5a66[_0x8672('0x1f')][_0x8672('0x27')]};}var _0x8e954e={'account':_0x3bec0a,'message':_[_0x8672('0x28')]({'from':util[_0x8672('0x29')](_0x8672('0x2a'),_0x5b5a66['name'],_0x5b5a66[_0x8672('0x2b')]||_0x5b5a66[_0x8672('0x1f')][_0x8672('0x13')])},_0x171515)};return client['request'](_0x8672('0x2c'),_0x8e954e);})['then'](function(_0x212aa5){if(_0x212aa5[_0x8672('0x2d')]){throw new Error(util[_0x8672('0x29')](_0x8672('0x2e'),_0x212aa5[_0x8672('0x2d')]['message']||JSON['stringify'](_0x212aa5[_0x8672('0x2d')])));}return!![];});}function handleError(_0x66d450,_0x54eda5,_0x1b9c0e){return _0x66d450[_0x8672('0x2f')](_0x54eda5||0x1f4)['send']({'message':_0x1b9c0e?_0x1b9c0e[_0x8672('0x30')]||_0x1b9c0e:''});}exports[_0x8672('0x31')]=function(_0x36844c,_0x21d5b9,_0xc9e038){passport['authenticate'](_0x8672('0x32'),function(_0x48af2b,_0x342b5b,_0x1b085f){var _0x587f63=_0x48af2b||_0x1b085f;if(_0x587f63){return handleError(_0x21d5b9,0x191,_0x587f63);}if(!_0x342b5b){return handleError(_0x21d5b9,0x194,{'message':_0x8672('0x33')});}else{var _0x91ed7f={'payload':{'id':_0x342b5b['id'],'role':_0x342b5b['role']},'options':{'expiresIn':0x15180}};return authService[_0x8672('0x34')](_0x91ed7f)[_0x8672('0x14')](function(_0x3756e1){_0x21d5b9[_0x8672('0x35')]({'id':_0x342b5b['id'],'token':_0x3756e1,'statusCall':'','isAlreadyLogged':_0x342b5b[_0x8672('0x36')]});});}})(_0x36844c,_0x21d5b9,_0xc9e038);};exports[_0x8672('0x37')]=function(_0x53ef4f,_0x1bec54,_0x5d8e1d){if(!_0x53ef4f[_0x8672('0x38')][_0x8672('0x2b')]){return handleError(_0x1bec54,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x59dcf9=rs['generate']();_0x53ef4f[_0x8672('0x38')][_0x8672('0x2b')]=_0x53ef4f[_0x8672('0x38')][_0x8672('0x2b')][_0x8672('0x39')]()[_0x8672('0x3a')]();var _0x4f4efe;return db[_0x8672('0xa')][_0x8672('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x13e805){_0x4f4efe=_0x13e805;return db[_0x8672('0x3b')][_0x8672('0x1e')]({'where':{'email':_0x53ef4f[_0x8672('0x38')]['email']}});})[_0x8672('0x14')](function(_0x36c57a){if(!_0x36c57a){throw new Error(_0x8672('0x3c'));}if(_0x36c57a[_0x8672('0x10')]){throw new Error(_0x8672('0x3d'));}if(_0x36c57a[_0x8672('0x11')]){if(moment(_0x36c57a[_0x8672('0x12')])['add'](_0x4f4efe[_0x8672('0xd')],_0x8672('0x18'))>moment()){throw new Error(_0x8672('0x3e'));}else{_0x36c57a[_0x8672('0x11')]=![];_0x36c57a[_0x8672('0x12')]=null;}}_0x36c57a[_0x8672('0x3f')]=_0x59dcf9;_0x36c57a[_0x8672('0x40')]=Date['now']()+0x36ee80;return _0x36c57a['save']();})[_0x8672('0x14')](function(){return sendServiceMail({'to':_0x53ef4f[_0x8672('0x38')][_0x8672('0x2b')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x8672('0x41')+_0x8672('0x42')+_0x8672('0x43')+_0x53ef4f['headers'][_0x8672('0x22')]+_0x8672('0x44')+_0x59dcf9+'\x0a\x0a'+_0x8672('0x45')});})[_0x8672('0x14')](function(){_0x1bec54[_0x8672('0x2f')](0xc8)[_0x8672('0x46')]({'message':_0x8672('0x47')});})[_0x8672('0x1c')](function(_0x484f65){return handleError(_0x1bec54,0x1f4,_0x484f65);});};exports['reset']=function(_0x2389a1,_0x50dc48,_0x363058){return db[_0x8672('0x3b')][_0x8672('0x1e')]({'where':{'resetPasswordToken':_0x2389a1[_0x8672('0x48')][_0x8672('0x49')],'resetPasswordExpires':{'$gt':Date[_0x8672('0x4a')]()}}})[_0x8672('0x14')](function(_0x15b24e){if(!_0x15b24e){throw new Error(_0x8672('0x4b'));}return db[_0x8672('0xa')][_0x8672('0xb')]({'attributes':['id',_0x8672('0x4c'),_0x8672('0x4d'),_0x8672('0x4e')]})[_0x8672('0x14')](function(_0x59d8f0){if(_0x59d8f0[_0x8672('0x4c')])authService['validatePasswordPattern'](_0x2389a1[_0x8672('0x38')][_0x8672('0xf')]);if(!_0x59d8f0[_0x8672('0x4d')]||!_0x15b24e[_0x8672('0x4f')])return _0x15b24e;authService[_0x8672('0x50')](_0x2389a1[_0x8672('0x38')][_0x8672('0xf')],_0x15b24e[_0x8672('0x4f')],_0x59d8f0[_0x8672('0x4e')]);return _0x15b24e;})[_0x8672('0x14')](function(){_0x15b24e[_0x8672('0xf')]=_0x2389a1[_0x8672('0x38')][_0x8672('0xf')];_0x15b24e['resetPasswordToken']=null;_0x15b24e['resetPasswordExpires']=null;return _0x15b24e[_0x8672('0x51')]();});})[_0x8672('0x14')](function(){_0x50dc48['status'](0xc8)[_0x8672('0x46')]({'message':'Password\x20reset!'});})['catch'](function(_0x3adb6){return handleError(_0x50dc48,0x1f4,_0x3adb6);});};passport[_0x8672('0x52')](new LocalStrategy({'usernameField':_0x8672('0xe'),'passwordField':_0x8672('0xf')},function(_0x4f0c69,_0x50c30e,_0x11686d){return localAuthenticate(db[_0x8672('0x3b')],_0x4f0c69,_0x50c30e,_0x11686d);}));
\ No newline at end of file
index 5d137f7..8f9fbee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5537=['express','Router','post','/forgot','forgot','/reset/:token'];(function(_0x4ba08d,_0x1b9a47){var _0x1a84bf=function(_0x547fb6){while(--_0x547fb6){_0x4ba08d['push'](_0x4ba08d['shift']());}};_0x1a84bf(++_0x1b9a47);}(_0x5537,0x84));var _0x7553=function(_0x4aeb2f,_0x509b5f){_0x4aeb2f=_0x4aeb2f-0x0;var _0x1b24a5=_0x5537[_0x4aeb2f];return _0x1b24a5;};'use strict';var express=require(_0x7553('0x0'));var router=express[_0x7553('0x1')]();var controller=require('./authLocal.controller');router[_0x7553('0x2')]('/',controller['login']);router[_0x7553('0x2')](_0x7553('0x3'),controller[_0x7553('0x4')]);router[_0x7553('0x2')](_0x7553('0x5'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x95be=['post','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x4e8768,_0x5bcfde){var _0x4f5fc7=function(_0x2b656c){while(--_0x2b656c){_0x4e8768['push'](_0x4e8768['shift']());}};_0x4f5fc7(++_0x5bcfde);}(_0x95be,0x1ed));var _0xe95b=function(_0xf9e8e0,_0x5a8205){_0xf9e8e0=_0xf9e8e0-0x0;var _0xa7a7e1=_0x95be[_0xf9e8e0];return _0xa7a7e1;};'use strict';var express=require(_0xe95b('0x0'));var router=express[_0xe95b('0x1')]();var controller=require(_0xe95b('0x2'));router[_0xe95b('0x3')]('/',controller['login']);router[_0xe95b('0x3')]('/forgot',controller[_0xe95b('0x4')]);router[_0xe95b('0x3')](_0xe95b('0x5'),controller[_0xe95b('0x6')]);module[_0xe95b('0x7')]=router;
\ No newline at end of file
index e6ce85d..e71fb28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa57c=['sequelize','STRING','BOOLEAN'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0xa57c,0x189));var _0xca57=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa57c[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xca57('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xca57('0x1')]},'description':{'type':Sequelize[_0xca57('0x1')]},'status':{'type':Sequelize[_0xca57('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0969=['sequelize','exports','STRING','INTEGER'];(function(_0x11fb41,_0x175755){var _0x121a25=function(_0x53dd6c){while(--_0x53dd6c){_0x11fb41['push'](_0x11fb41['shift']());}};_0x121a25(++_0x175755);}(_0x0969,0xe0));var _0x9096=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x0969[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x9096('0x0'));module[_0x9096('0x1')]={'name':{'type':Sequelize[_0x9096('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x9096('0x2')]},'description':{'type':Sequelize[_0x9096('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9096('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 8c8f01a..4311603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad8f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','save','update','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','create','body','find','params','Condition','omit','ids','findOne','getConditions','nolimit','addActions','Action','getActions','order','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x12cea8,_0x241ec4){var _0x2f7e23=function(_0x205406){while(--_0x205406){_0x12cea8['push'](_0x12cea8['shift']());}};_0x2f7e23(++_0x241ec4);}(_0xad8f,0xf8));var _0xfad8=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xad8f[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0xfad8('0x0'));var rimraf=require(_0xfad8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfad8('0x2'));var rp=require(_0xfad8('0x3'));var moment=require(_0xfad8('0x4'));var BPromise=require(_0xfad8('0x5'));var Mustache=require(_0xfad8('0x6'));var util=require(_0xfad8('0x7'));var path=require(_0xfad8('0x8'));var sox=require(_0xfad8('0x9'));var csv=require(_0xfad8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfad8('0xb'));var squel=require(_0xfad8('0xc'));var crypto=require(_0xfad8('0xd'));var jsforce=require(_0xfad8('0xe'));var deskjs=require(_0xfad8('0xf'));var toCsv=require(_0xfad8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfad8('0x10'));var authService=require(_0xfad8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfad8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfad8('0x13'))(_0xfad8('0x14'));var utils=require(_0xfad8('0x15'));var config=require(_0xfad8('0x16'));var licenseUtil=require(_0xfad8('0x17'));var db=require(_0xfad8('0x18'))['db'];function respondWithStatusCode(_0x50189b,_0x17fa9c){_0x17fa9c=_0x17fa9c||0xcc;return function(_0x1acfca){if(_0x1acfca){return _0x50189b[_0xfad8('0x19')](_0x17fa9c);}return _0x50189b['status'](_0x17fa9c)[_0xfad8('0x1a')]();};}function respondWithResult(_0x486c45,_0x2e40c5){_0x2e40c5=_0x2e40c5||0xc8;return function(_0x5083b6){if(_0x5083b6){return _0x486c45['status'](_0x2e40c5)[_0xfad8('0x1b')](_0x5083b6);}};}function respondWithFilteredResult(_0x24fa1a,_0x491cda){return function(_0xa9d8fe){if(_0xa9d8fe){var _0x4a48f2=typeof _0x491cda['offset']===_0xfad8('0x1c')&&typeof _0x491cda[_0xfad8('0x1d')]==='undefined';var _0x33b0b2=_0xa9d8fe[_0xfad8('0x1e')];var _0xa59d48=_0x4a48f2?0x0:_0x491cda['offset'];var _0x2f0aaf=_0x4a48f2?_0xa9d8fe[_0xfad8('0x1e')]:_0x491cda[_0xfad8('0x1f')]+_0x491cda[_0xfad8('0x1d')];var _0x3faf9e;if(_0x2f0aaf>=_0x33b0b2){_0x2f0aaf=_0x33b0b2;_0x3faf9e=0xc8;}else{_0x3faf9e=0xce;}_0x24fa1a[_0xfad8('0x20')](_0x3faf9e);return _0x24fa1a[_0xfad8('0x21')](_0xfad8('0x22'),_0xa59d48+'-'+_0x2f0aaf+'/'+_0x33b0b2)[_0xfad8('0x1b')](_0xa9d8fe);}return null;};}function patchUpdates(_0x3779fb){return function(_0x2f1a35){try{jsonpatch['apply'](_0x2f1a35,_0x3779fb,!![]);}catch(_0x1f7644){return BPromise['reject'](_0x1f7644);}return _0x2f1a35[_0xfad8('0x23')]();};}function saveUpdates(_0x112453,_0x3a5572){return function(_0x49bfce){if(_0x49bfce){return _0x49bfce[_0xfad8('0x24')](_0x112453)[_0xfad8('0x25')](function(_0x48c2e3){return _0x48c2e3;});}return null;};}function removeEntity(_0x209cdd,_0x3ceaed){return function(_0x303fd5){if(_0x303fd5){return _0x303fd5['destroy']()[_0xfad8('0x25')](function(){_0x209cdd[_0xfad8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121794,_0x5b6e7c){return function(_0x1b61b5){if(!_0x1b61b5){_0x121794['sendStatus'](0x194);}return _0x1b61b5;};}function handleError(_0x2a6f48,_0x5af270){_0x5af270=_0x5af270||0x1f4;return function(_0xdcd53b){logger[_0xfad8('0x26')](_0xdcd53b[_0xfad8('0x27')]);if(_0xdcd53b[_0xfad8('0x28')]){delete _0xdcd53b['name'];}_0x2a6f48['status'](_0x5af270)[_0xfad8('0x29')](_0xdcd53b);};}exports[_0xfad8('0x2a')]=function(_0x11c983,_0x2defdd){var _0x22ec79={},_0x56c91d={},_0x510364={'count':0x0,'rows':[]};var _0x287c16=_[_0xfad8('0x2b')](db[_0xfad8('0x2c')][_0xfad8('0x2d')],function(_0x59cc77){return{'name':_0x59cc77[_0xfad8('0x2e')],'type':_0x59cc77[_0xfad8('0x2f')]['key']};});_0x56c91d[_0xfad8('0x30')]=_[_0xfad8('0x2b')](_0x287c16,_0xfad8('0x28'));_0x56c91d[_0xfad8('0x31')]=_['keys'](_0x11c983[_0xfad8('0x31')]);_0x56c91d['filters']=_[_0xfad8('0x32')](_0x56c91d[_0xfad8('0x30')],_0x56c91d['query']);_0x22ec79[_0xfad8('0x33')]=_['intersection'](_0x56c91d[_0xfad8('0x30')],qs['fields'](_0x11c983['query'][_0xfad8('0x34')]));_0x22ec79[_0xfad8('0x33')]=_0x22ec79[_0xfad8('0x33')]['length']?_0x22ec79['attributes']:_0x56c91d[_0xfad8('0x30')];if(!_0x11c983[_0xfad8('0x31')][_0xfad8('0x35')]('nolimit')){_0x22ec79[_0xfad8('0x1d')]=qs[_0xfad8('0x1d')](_0x11c983[_0xfad8('0x31')]['limit']);_0x22ec79[_0xfad8('0x1f')]=qs[_0xfad8('0x1f')](_0x11c983['query']['offset']);}_0x22ec79['order']=qs[_0xfad8('0x36')](_0x11c983['query'][_0xfad8('0x36')]);_0x22ec79['where']=qs['filters'](_[_0xfad8('0x37')](_0x11c983['query'],_0x56c91d[_0xfad8('0x38')]),_0x287c16);if(_0x11c983['query'][_0xfad8('0x39')]){_0x22ec79[_0xfad8('0x3a')]=_['merge'](_0x22ec79[_0xfad8('0x3a')],{'$or':_[_0xfad8('0x2b')](_0x287c16,function(_0x79a4da){if(_0x79a4da[_0xfad8('0x2f')]!==_0xfad8('0x3b')){var _0x2a7d82={};_0x2a7d82[_0x79a4da[_0xfad8('0x28')]]={'$like':'%'+_0x11c983['query'][_0xfad8('0x39')]+'%'};return _0x2a7d82;}})});}_0x22ec79=_[_0xfad8('0x3c')]({},_0x22ec79,_0x11c983[_0xfad8('0x3d')]);var _0x281420={'where':_0x22ec79[_0xfad8('0x3a')]};return db[_0xfad8('0x2c')]['count'](_0x281420)['then'](function(_0x4ea91b){_0x510364['count']=_0x4ea91b;if(_0x11c983[_0xfad8('0x31')][_0xfad8('0x3e')]){_0x22ec79[_0xfad8('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xfad8('0x40')](_0x22ec79);})[_0xfad8('0x25')](function(_0x1e8b9c){_0x510364[_0xfad8('0x41')]=_0x1e8b9c;return _0x510364;})[_0xfad8('0x25')](respondWithFilteredResult(_0x2defdd,_0x22ec79))[_0xfad8('0x42')](handleError(_0x2defdd,null));};exports[_0xfad8('0x43')]=function(_0xb11818,_0x40a967){var _0x4dfb3c={'raw':![],'where':{'id':_0xb11818['params']['id']}},_0x64063d={};_0x64063d[_0xfad8('0x30')]=_[_0xfad8('0x44')](db['Automation'][_0xfad8('0x2d')]);_0x64063d[_0xfad8('0x31')]=_[_0xfad8('0x44')](_0xb11818[_0xfad8('0x31')]);_0x64063d[_0xfad8('0x38')]=_[_0xfad8('0x32')](_0x64063d['model'],_0x64063d[_0xfad8('0x31')]);_0x4dfb3c[_0xfad8('0x33')]=_[_0xfad8('0x32')](_0x64063d[_0xfad8('0x30')],qs['fields'](_0xb11818[_0xfad8('0x31')]['fields']));_0x4dfb3c['attributes']=_0x4dfb3c[_0xfad8('0x33')][_0xfad8('0x45')]?_0x4dfb3c[_0xfad8('0x33')]:_0x64063d['model'];if(_0xb11818[_0xfad8('0x31')]['includeAll']){_0x4dfb3c[_0xfad8('0x3f')]=[{'all':!![]}];}_0x4dfb3c=_[_0xfad8('0x3c')]({},_0x4dfb3c,_0xb11818[_0xfad8('0x3d')]);return db[_0xfad8('0x2c')]['find'](_0x4dfb3c)[_0xfad8('0x25')](handleEntityNotFound(_0x40a967,null))['then'](respondWithResult(_0x40a967,null))['catch'](handleError(_0x40a967,null));};exports[_0xfad8('0x46')]=function(_0x1351fb,_0x4d4069){return db[_0xfad8('0x2c')][_0xfad8('0x46')](_0x1351fb[_0xfad8('0x47')],{})[_0xfad8('0x25')](respondWithResult(_0x4d4069,0xc9))[_0xfad8('0x42')](handleError(_0x4d4069,null));};exports[_0xfad8('0x24')]=function(_0x42c5dc,_0x1a3d33){if(_0x42c5dc[_0xfad8('0x47')]['id']){delete _0x42c5dc[_0xfad8('0x47')]['id'];}return db['Automation'][_0xfad8('0x48')]({'where':{'id':_0x42c5dc[_0xfad8('0x49')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x1a3d33,null))[_0xfad8('0x25')](saveUpdates(_0x42c5dc[_0xfad8('0x47')],null))[_0xfad8('0x25')](respondWithResult(_0x1a3d33,null))[_0xfad8('0x42')](handleError(_0x1a3d33,null));};exports['destroy']=function(_0x295486,_0x476210){return db[_0xfad8('0x2c')][_0xfad8('0x48')]({'where':{'id':_0x295486[_0xfad8('0x49')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x476210,null))[_0xfad8('0x25')](removeEntity(_0x476210,null))[_0xfad8('0x42')](handleError(_0x476210,null));};exports['addConditions']=function(_0x2bebbf,_0x31bb3d,_0x1a6ee8){return db[_0xfad8('0x4a')][_0xfad8('0x48')]({'where':{'id':_0x2bebbf[_0xfad8('0x49')]['id']}})['then'](handleEntityNotFound(_0x31bb3d,null))[_0xfad8('0x25')](function(_0x4739ca){if(_0x4739ca){return _0x4739ca['addConditions'](_0x2bebbf[_0xfad8('0x47')]['ids'],_[_0xfad8('0x4b')](_0x2bebbf[_0xfad8('0x47')],[_0xfad8('0x4c'),'id'])||{});}})[_0xfad8('0x25')](respondWithResult(_0x31bb3d,null))[_0xfad8('0x42')](handleError(_0x31bb3d,null));};exports['getConditions']=function(_0x2f3aa7,_0x2b3548,_0xb68c84){var _0x3e780e={};var _0x59ec77={};var _0x5e5286;var _0x4c14c8;return db[_0xfad8('0x2c')][_0xfad8('0x4d')]({'where':{'id':_0x2f3aa7[_0xfad8('0x49')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x2b3548,null))[_0xfad8('0x25')](function(_0x446852){if(_0x446852){_0x5e5286=_0x446852;_0x59ec77[_0xfad8('0x30')]=_[_0xfad8('0x44')](db[_0xfad8('0x4a')]['rawAttributes']);_0x59ec77[_0xfad8('0x31')]=_[_0xfad8('0x44')](_0x2f3aa7[_0xfad8('0x31')]);_0x59ec77['filters']=_[_0xfad8('0x32')](_0x59ec77[_0xfad8('0x30')],_0x59ec77['query']);_0x3e780e['attributes']=_[_0xfad8('0x32')](_0x59ec77[_0xfad8('0x30')],qs['fields'](_0x2f3aa7['query'][_0xfad8('0x34')]));_0x3e780e[_0xfad8('0x33')]=_0x3e780e['attributes'][_0xfad8('0x45')]?_0x3e780e[_0xfad8('0x33')]:_0x59ec77[_0xfad8('0x30')];_0x3e780e['order']=qs[_0xfad8('0x36')](_0x2f3aa7[_0xfad8('0x31')][_0xfad8('0x36')]);_0x3e780e[_0xfad8('0x3a')]=qs[_0xfad8('0x38')](_[_0xfad8('0x37')](_0x2f3aa7[_0xfad8('0x31')],_0x59ec77[_0xfad8('0x38')]));if(_0x2f3aa7['query'][_0xfad8('0x39')]){_0x3e780e[_0xfad8('0x3a')]=_['merge'](_0x3e780e[_0xfad8('0x3a')],{'$or':_[_0xfad8('0x2b')](_0x3e780e[_0xfad8('0x33')],function(_0xe05307){var _0x3d5e1f={};_0x3d5e1f[_0xe05307]={'$like':'%'+_0x2f3aa7[_0xfad8('0x31')]['filter']+'%'};return _0x3d5e1f;})});}_0x3e780e=_[_0xfad8('0x3c')]({},_0x3e780e,_0x2f3aa7[_0xfad8('0x3d')]);return _0x5e5286[_0xfad8('0x4e')](_0x3e780e);}})['then'](function(_0x16f543){if(_0x16f543){_0x4c14c8=_0x16f543['length'];if(!_0x2f3aa7['query'][_0xfad8('0x35')](_0xfad8('0x4f'))){_0x3e780e[_0xfad8('0x1d')]=qs[_0xfad8('0x1d')](_0x2f3aa7[_0xfad8('0x31')][_0xfad8('0x1d')]);_0x3e780e[_0xfad8('0x1f')]=qs[_0xfad8('0x1f')](_0x2f3aa7[_0xfad8('0x31')]['offset']);}return _0x5e5286['getConditions'](_0x3e780e);}})[_0xfad8('0x25')](function(_0x4d0fc3){if(_0x4d0fc3){return _0x4d0fc3?{'count':_0x4c14c8,'rows':_0x4d0fc3}:null;}})[_0xfad8('0x25')](respondWithResult(_0x2b3548,null))[_0xfad8('0x42')](handleError(_0x2b3548,null));};exports[_0xfad8('0x50')]=function(_0xaeee9e,_0x5c799f,_0x14ec6c){return db[_0xfad8('0x51')][_0xfad8('0x48')]({'where':{'id':_0xaeee9e[_0xfad8('0x49')]['id']}})[_0xfad8('0x25')](handleEntityNotFound(_0x5c799f,null))[_0xfad8('0x25')](function(_0x4fe209){if(_0x4fe209){return _0x4fe209[_0xfad8('0x50')](_0xaeee9e[_0xfad8('0x47')][_0xfad8('0x4c')],_[_0xfad8('0x4b')](_0xaeee9e[_0xfad8('0x47')],[_0xfad8('0x4c'),'id'])||{});}})[_0xfad8('0x25')](respondWithResult(_0x5c799f,null))[_0xfad8('0x42')](handleError(_0x5c799f,null));};exports[_0xfad8('0x52')]=function(_0x492f7f,_0x14252e,_0x45184f){var _0x35e87b={};var _0x478292={};var _0x1f823b;var _0x1258b0;return db['Automation'][_0xfad8('0x4d')]({'where':{'id':_0x492f7f[_0xfad8('0x49')]['id']}})['then'](handleEntityNotFound(_0x14252e,null))[_0xfad8('0x25')](function(_0x25752f){if(_0x25752f){_0x1f823b=_0x25752f;_0x478292[_0xfad8('0x30')]=_['keys'](db[_0xfad8('0x51')][_0xfad8('0x2d')]);_0x478292[_0xfad8('0x31')]=_[_0xfad8('0x44')](_0x492f7f[_0xfad8('0x31')]);_0x478292[_0xfad8('0x38')]=_[_0xfad8('0x32')](_0x478292['model'],_0x478292[_0xfad8('0x31')]);_0x35e87b[_0xfad8('0x33')]=_[_0xfad8('0x32')](_0x478292[_0xfad8('0x30')],qs[_0xfad8('0x34')](_0x492f7f['query']['fields']));_0x35e87b[_0xfad8('0x33')]=_0x35e87b[_0xfad8('0x33')]['length']?_0x35e87b[_0xfad8('0x33')]:_0x478292['model'];_0x35e87b[_0xfad8('0x53')]=qs[_0xfad8('0x36')](_0x492f7f[_0xfad8('0x31')]['sort']);_0x35e87b[_0xfad8('0x3a')]=qs[_0xfad8('0x38')](_['pick'](_0x492f7f[_0xfad8('0x31')],_0x478292[_0xfad8('0x38')]));if(_0x492f7f[_0xfad8('0x31')][_0xfad8('0x39')]){_0x35e87b[_0xfad8('0x3a')]=_[_0xfad8('0x3c')](_0x35e87b[_0xfad8('0x3a')],{'$or':_[_0xfad8('0x2b')](_0x35e87b[_0xfad8('0x33')],function(_0x1382dd){var _0x4105dc={};_0x4105dc[_0x1382dd]={'$like':'%'+_0x492f7f[_0xfad8('0x31')][_0xfad8('0x39')]+'%'};return _0x4105dc;})});}_0x35e87b=_[_0xfad8('0x3c')]({},_0x35e87b,_0x492f7f['options']);return _0x1f823b[_0xfad8('0x52')](_0x35e87b);}})[_0xfad8('0x25')](function(_0x567c4c){if(_0x567c4c){_0x1258b0=_0x567c4c[_0xfad8('0x45')];if(!_0x492f7f[_0xfad8('0x31')][_0xfad8('0x35')]('nolimit')){_0x35e87b['limit']=qs[_0xfad8('0x1d')](_0x492f7f['query'][_0xfad8('0x1d')]);_0x35e87b['offset']=qs['offset'](_0x492f7f[_0xfad8('0x31')][_0xfad8('0x1f')]);}return _0x1f823b[_0xfad8('0x52')](_0x35e87b);}})[_0xfad8('0x25')](function(_0x391004){if(_0x391004){return _0x391004?{'count':_0x1258b0,'rows':_0x391004}:null;}})[_0xfad8('0x25')](respondWithResult(_0x14252e,null))[_0xfad8('0x42')](handleError(_0x14252e,null));};
\ No newline at end of file
+var _0xb44d=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','Automation','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','map','filter','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','pick','merge','hasOwnProperty','addActions','getActions','Action','order','rimraf','request-promise','moment','util','path','sox','ejs','fs-extra','desk.js','to-csv','../../components/auth/service'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb44d,0xdc));var _0xdb44=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb44d[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb44('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdb44('0x1'));var moment=require(_0xdb44('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdb44('0x3'));var path=require(_0xdb44('0x4'));var sox=require(_0xdb44('0x5'));var csv=require('to-csv');var ejs=require(_0xdb44('0x6'));var fs=require('fs');var fs_extra=require(_0xdb44('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdb44('0x8'));var toCsv=require(_0xdb44('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdb44('0xa'));var qs=require(_0xdb44('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb44('0xc'));var logger=require('../../config/logger')(_0xdb44('0xd'));var utils=require(_0xdb44('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0xdb44('0xf'));var db=require(_0xdb44('0x10'))['db'];function respondWithStatusCode(_0x3bc6b7,_0x585fb7){_0x585fb7=_0x585fb7||0xcc;return function(_0x10cb8a){if(_0x10cb8a){return _0x3bc6b7['sendStatus'](_0x585fb7);}return _0x3bc6b7[_0xdb44('0x11')](_0x585fb7)[_0xdb44('0x12')]();};}function respondWithResult(_0x508ca5,_0x4d6234){_0x4d6234=_0x4d6234||0xc8;return function(_0x52b044){if(_0x52b044){return _0x508ca5[_0xdb44('0x11')](_0x4d6234)[_0xdb44('0x13')](_0x52b044);}};}function respondWithFilteredResult(_0x227f5b,_0x24e956){return function(_0x57afb4){if(_0x57afb4){var _0x287c33=typeof _0x24e956[_0xdb44('0x14')]===_0xdb44('0x15')&&typeof _0x24e956[_0xdb44('0x16')]===_0xdb44('0x15');var _0x500bdd=_0x57afb4['count'];var _0x7af861=_0x287c33?0x0:_0x24e956['offset'];var _0x34a5eb=_0x287c33?_0x57afb4['count']:_0x24e956[_0xdb44('0x14')]+_0x24e956['limit'];var _0x4b9119;if(_0x34a5eb>=_0x500bdd){_0x34a5eb=_0x500bdd;_0x4b9119=0xc8;}else{_0x4b9119=0xce;}_0x227f5b[_0xdb44('0x11')](_0x4b9119);return _0x227f5b[_0xdb44('0x17')](_0xdb44('0x18'),_0x7af861+'-'+_0x34a5eb+'/'+_0x500bdd)['json'](_0x57afb4);}return null;};}function patchUpdates(_0x2a9656){return function(_0x2bce13){try{jsonpatch[_0xdb44('0x19')](_0x2bce13,_0x2a9656,!![]);}catch(_0x14fcbb){return BPromise[_0xdb44('0x1a')](_0x14fcbb);}return _0x2bce13['save']();};}function saveUpdates(_0x1e751a,_0x1785ac){return function(_0x548904){if(_0x548904){return _0x548904[_0xdb44('0x1b')](_0x1e751a)[_0xdb44('0x1c')](function(_0x3d337c){return _0x3d337c;});}return null;};}function removeEntity(_0x460475,_0x1b6389){return function(_0x3bf638){if(_0x3bf638){return _0x3bf638[_0xdb44('0x1d')]()[_0xdb44('0x1c')](function(){_0x460475['status'](0xcc)[_0xdb44('0x12')]();});}};}function handleEntityNotFound(_0x18847f,_0x5b4066){return function(_0x1f1596){if(!_0x1f1596){_0x18847f[_0xdb44('0x1e')](0x194);}return _0x1f1596;};}function handleError(_0x46ebc4,_0x62e293){_0x62e293=_0x62e293||0x1f4;return function(_0xf78bd4){logger[_0xdb44('0x1f')](_0xf78bd4[_0xdb44('0x20')]);if(_0xf78bd4['name']){delete _0xf78bd4[_0xdb44('0x21')];}_0x46ebc4[_0xdb44('0x11')](_0x62e293)[_0xdb44('0x22')](_0xf78bd4);};}exports['index']=function(_0x14c7df,_0x3071ce){var _0x34b457={},_0x2f531f={},_0x3fe463={'count':0x0,'rows':[]};var _0x12427f=_['map'](db[_0xdb44('0x23')][_0xdb44('0x24')],function(_0x1421aa){return{'name':_0x1421aa[_0xdb44('0x25')],'type':_0x1421aa[_0xdb44('0x26')]['key']};});_0x2f531f[_0xdb44('0x27')]=_['map'](_0x12427f,_0xdb44('0x21'));_0x2f531f[_0xdb44('0x28')]=_[_0xdb44('0x29')](_0x14c7df[_0xdb44('0x28')]);_0x2f531f['filters']=_[_0xdb44('0x2a')](_0x2f531f[_0xdb44('0x27')],_0x2f531f[_0xdb44('0x28')]);_0x34b457[_0xdb44('0x2b')]=_[_0xdb44('0x2a')](_0x2f531f[_0xdb44('0x27')],qs[_0xdb44('0x2c')](_0x14c7df[_0xdb44('0x28')][_0xdb44('0x2c')]));_0x34b457[_0xdb44('0x2b')]=_0x34b457[_0xdb44('0x2b')][_0xdb44('0x2d')]?_0x34b457[_0xdb44('0x2b')]:_0x2f531f[_0xdb44('0x27')];if(!_0x14c7df[_0xdb44('0x28')]['hasOwnProperty'](_0xdb44('0x2e'))){_0x34b457[_0xdb44('0x16')]=qs[_0xdb44('0x16')](_0x14c7df[_0xdb44('0x28')][_0xdb44('0x16')]);_0x34b457['offset']=qs[_0xdb44('0x14')](_0x14c7df[_0xdb44('0x28')][_0xdb44('0x14')]);}_0x34b457['order']=qs[_0xdb44('0x2f')](_0x14c7df['query'][_0xdb44('0x2f')]);_0x34b457[_0xdb44('0x30')]=qs[_0xdb44('0x31')](_['pick'](_0x14c7df[_0xdb44('0x28')],_0x2f531f[_0xdb44('0x31')]),_0x12427f);if(_0x14c7df[_0xdb44('0x28')]['filter']){_0x34b457['where']=_['merge'](_0x34b457[_0xdb44('0x30')],{'$or':_[_0xdb44('0x32')](_0x12427f,function(_0x48a9b7){if(_0x48a9b7[_0xdb44('0x26')]!=='VIRTUAL'){var _0x2e0a65={};_0x2e0a65[_0x48a9b7['name']]={'$like':'%'+_0x14c7df['query'][_0xdb44('0x33')]+'%'};return _0x2e0a65;}})});}_0x34b457=_['merge']({},_0x34b457,_0x14c7df[_0xdb44('0x34')]);var _0x19193a={'where':_0x34b457[_0xdb44('0x30')]};return db[_0xdb44('0x23')][_0xdb44('0x35')](_0x19193a)[_0xdb44('0x1c')](function(_0x38876f){_0x3fe463[_0xdb44('0x35')]=_0x38876f;if(_0x14c7df[_0xdb44('0x28')][_0xdb44('0x36')]){_0x34b457[_0xdb44('0x37')]=[{'all':!![]}];}return db[_0xdb44('0x23')][_0xdb44('0x38')](_0x34b457);})[_0xdb44('0x1c')](function(_0x508142){_0x3fe463[_0xdb44('0x39')]=_0x508142;return _0x3fe463;})[_0xdb44('0x1c')](respondWithFilteredResult(_0x3071ce,_0x34b457))['catch'](handleError(_0x3071ce,null));};exports[_0xdb44('0x3a')]=function(_0x4cb0b6,_0x87cad7){var _0x3c3a6b={'raw':![],'where':{'id':_0x4cb0b6[_0xdb44('0x3b')]['id']}},_0x249ba6={};_0x249ba6[_0xdb44('0x27')]=_[_0xdb44('0x29')](db[_0xdb44('0x23')]['rawAttributes']);_0x249ba6[_0xdb44('0x28')]=_['keys'](_0x4cb0b6[_0xdb44('0x28')]);_0x249ba6[_0xdb44('0x31')]=_[_0xdb44('0x2a')](_0x249ba6[_0xdb44('0x27')],_0x249ba6[_0xdb44('0x28')]);_0x3c3a6b[_0xdb44('0x2b')]=_[_0xdb44('0x2a')](_0x249ba6[_0xdb44('0x27')],qs['fields'](_0x4cb0b6[_0xdb44('0x28')][_0xdb44('0x2c')]));_0x3c3a6b['attributes']=_0x3c3a6b[_0xdb44('0x2b')][_0xdb44('0x2d')]?_0x3c3a6b[_0xdb44('0x2b')]:_0x249ba6[_0xdb44('0x27')];if(_0x4cb0b6[_0xdb44('0x28')]['includeAll']){_0x3c3a6b[_0xdb44('0x37')]=[{'all':!![]}];}_0x3c3a6b=_['merge']({},_0x3c3a6b,_0x4cb0b6['options']);return db[_0xdb44('0x23')]['find'](_0x3c3a6b)[_0xdb44('0x1c')](handleEntityNotFound(_0x87cad7,null))['then'](respondWithResult(_0x87cad7,null))[_0xdb44('0x3c')](handleError(_0x87cad7,null));};exports[_0xdb44('0x3d')]=function(_0x5cc327,_0xe2ff05){return db[_0xdb44('0x23')][_0xdb44('0x3d')](_0x5cc327[_0xdb44('0x3e')],{})[_0xdb44('0x1c')](respondWithResult(_0xe2ff05,0xc9))[_0xdb44('0x3c')](handleError(_0xe2ff05,null));};exports[_0xdb44('0x1b')]=function(_0x52f469,_0x1159c5){if(_0x52f469[_0xdb44('0x3e')]['id']){delete _0x52f469[_0xdb44('0x3e')]['id'];}return db[_0xdb44('0x23')][_0xdb44('0x3f')]({'where':{'id':_0x52f469['params']['id']}})[_0xdb44('0x1c')](handleEntityNotFound(_0x1159c5,null))[_0xdb44('0x1c')](saveUpdates(_0x52f469[_0xdb44('0x3e')],null))[_0xdb44('0x1c')](respondWithResult(_0x1159c5,null))['catch'](handleError(_0x1159c5,null));};exports['destroy']=function(_0x5ed36f,_0x332b2c){return db[_0xdb44('0x23')][_0xdb44('0x3f')]({'where':{'id':_0x5ed36f[_0xdb44('0x3b')]['id']}})[_0xdb44('0x1c')](handleEntityNotFound(_0x332b2c,null))['then'](removeEntity(_0x332b2c,null))[_0xdb44('0x3c')](handleError(_0x332b2c,null));};exports[_0xdb44('0x40')]=function(_0x1c1723,_0x7ace,_0xf0d381){return db[_0xdb44('0x41')][_0xdb44('0x3f')]({'where':{'id':_0x1c1723[_0xdb44('0x3b')]['id']}})['then'](handleEntityNotFound(_0x7ace,null))[_0xdb44('0x1c')](function(_0x41035a){if(_0x41035a){return _0x41035a[_0xdb44('0x40')](_0x1c1723[_0xdb44('0x3e')][_0xdb44('0x42')],_[_0xdb44('0x43')](_0x1c1723['body'],[_0xdb44('0x42'),'id'])||{});}})['then'](respondWithResult(_0x7ace,null))['catch'](handleError(_0x7ace,null));};exports[_0xdb44('0x44')]=function(_0x796334,_0x5cf9d8,_0x5db44e){var _0x5a1518={};var _0x2c9387={};var _0x50378a;var _0xee46db;return db[_0xdb44('0x23')][_0xdb44('0x45')]({'where':{'id':_0x796334['params']['id']}})['then'](handleEntityNotFound(_0x5cf9d8,null))[_0xdb44('0x1c')](function(_0x4e8dd3){if(_0x4e8dd3){_0x50378a=_0x4e8dd3;_0x2c9387[_0xdb44('0x27')]=_['keys'](db[_0xdb44('0x41')][_0xdb44('0x24')]);_0x2c9387['query']=_[_0xdb44('0x29')](_0x796334[_0xdb44('0x28')]);_0x2c9387['filters']=_['intersection'](_0x2c9387[_0xdb44('0x27')],_0x2c9387[_0xdb44('0x28')]);_0x5a1518[_0xdb44('0x2b')]=_[_0xdb44('0x2a')](_0x2c9387[_0xdb44('0x27')],qs[_0xdb44('0x2c')](_0x796334[_0xdb44('0x28')][_0xdb44('0x2c')]));_0x5a1518[_0xdb44('0x2b')]=_0x5a1518[_0xdb44('0x2b')][_0xdb44('0x2d')]?_0x5a1518['attributes']:_0x2c9387[_0xdb44('0x27')];_0x5a1518['order']=qs[_0xdb44('0x2f')](_0x796334[_0xdb44('0x28')]['sort']);_0x5a1518['where']=qs[_0xdb44('0x31')](_[_0xdb44('0x46')](_0x796334[_0xdb44('0x28')],_0x2c9387[_0xdb44('0x31')]));if(_0x796334[_0xdb44('0x28')][_0xdb44('0x33')]){_0x5a1518[_0xdb44('0x30')]=_[_0xdb44('0x47')](_0x5a1518[_0xdb44('0x30')],{'$or':_['map'](_0x5a1518[_0xdb44('0x2b')],function(_0x3bdcfd){var _0x56a74d={};_0x56a74d[_0x3bdcfd]={'$like':'%'+_0x796334[_0xdb44('0x28')][_0xdb44('0x33')]+'%'};return _0x56a74d;})});}_0x5a1518=_[_0xdb44('0x47')]({},_0x5a1518,_0x796334[_0xdb44('0x34')]);return _0x50378a[_0xdb44('0x44')](_0x5a1518);}})[_0xdb44('0x1c')](function(_0x41e6e2){if(_0x41e6e2){_0xee46db=_0x41e6e2[_0xdb44('0x2d')];if(!_0x796334[_0xdb44('0x28')][_0xdb44('0x48')](_0xdb44('0x2e'))){_0x5a1518[_0xdb44('0x16')]=qs[_0xdb44('0x16')](_0x796334[_0xdb44('0x28')][_0xdb44('0x16')]);_0x5a1518[_0xdb44('0x14')]=qs[_0xdb44('0x14')](_0x796334[_0xdb44('0x28')][_0xdb44('0x14')]);}return _0x50378a[_0xdb44('0x44')](_0x5a1518);}})[_0xdb44('0x1c')](function(_0x4abfa5){if(_0x4abfa5){return _0x4abfa5?{'count':_0xee46db,'rows':_0x4abfa5}:null;}})['then'](respondWithResult(_0x5cf9d8,null))[_0xdb44('0x3c')](handleError(_0x5cf9d8,null));};exports[_0xdb44('0x49')]=function(_0x5a8d18,_0x4a346d,_0x4a117b){return db['Action'][_0xdb44('0x3f')]({'where':{'id':_0x5a8d18[_0xdb44('0x3b')]['id']}})[_0xdb44('0x1c')](handleEntityNotFound(_0x4a346d,null))[_0xdb44('0x1c')](function(_0x38837d){if(_0x38837d){return _0x38837d[_0xdb44('0x49')](_0x5a8d18[_0xdb44('0x3e')]['ids'],_[_0xdb44('0x43')](_0x5a8d18[_0xdb44('0x3e')],[_0xdb44('0x42'),'id'])||{});}})[_0xdb44('0x1c')](respondWithResult(_0x4a346d,null))['catch'](handleError(_0x4a346d,null));};exports[_0xdb44('0x4a')]=function(_0x2b2ba1,_0x4bf492,_0x2f844c){var _0x26a068={};var _0x484d6b={};var _0x5834ce;var _0x23b96d;return db['Automation'][_0xdb44('0x45')]({'where':{'id':_0x2b2ba1[_0xdb44('0x3b')]['id']}})[_0xdb44('0x1c')](handleEntityNotFound(_0x4bf492,null))[_0xdb44('0x1c')](function(_0x56714c){if(_0x56714c){_0x5834ce=_0x56714c;_0x484d6b[_0xdb44('0x27')]=_[_0xdb44('0x29')](db[_0xdb44('0x4b')][_0xdb44('0x24')]);_0x484d6b['query']=_[_0xdb44('0x29')](_0x2b2ba1[_0xdb44('0x28')]);_0x484d6b[_0xdb44('0x31')]=_['intersection'](_0x484d6b[_0xdb44('0x27')],_0x484d6b[_0xdb44('0x28')]);_0x26a068[_0xdb44('0x2b')]=_[_0xdb44('0x2a')](_0x484d6b[_0xdb44('0x27')],qs[_0xdb44('0x2c')](_0x2b2ba1['query'][_0xdb44('0x2c')]));_0x26a068[_0xdb44('0x2b')]=_0x26a068[_0xdb44('0x2b')]['length']?_0x26a068[_0xdb44('0x2b')]:_0x484d6b['model'];_0x26a068[_0xdb44('0x4c')]=qs[_0xdb44('0x2f')](_0x2b2ba1[_0xdb44('0x28')][_0xdb44('0x2f')]);_0x26a068[_0xdb44('0x30')]=qs[_0xdb44('0x31')](_[_0xdb44('0x46')](_0x2b2ba1[_0xdb44('0x28')],_0x484d6b[_0xdb44('0x31')]));if(_0x2b2ba1[_0xdb44('0x28')]['filter']){_0x26a068[_0xdb44('0x30')]=_[_0xdb44('0x47')](_0x26a068[_0xdb44('0x30')],{'$or':_['map'](_0x26a068[_0xdb44('0x2b')],function(_0x4886e0){var _0x45aa7a={};_0x45aa7a[_0x4886e0]={'$like':'%'+_0x2b2ba1['query'][_0xdb44('0x33')]+'%'};return _0x45aa7a;})});}_0x26a068=_[_0xdb44('0x47')]({},_0x26a068,_0x2b2ba1[_0xdb44('0x34')]);return _0x5834ce[_0xdb44('0x4a')](_0x26a068);}})['then'](function(_0x5df91d){if(_0x5df91d){_0x23b96d=_0x5df91d['length'];if(!_0x2b2ba1[_0xdb44('0x28')][_0xdb44('0x48')](_0xdb44('0x2e'))){_0x26a068[_0xdb44('0x16')]=qs[_0xdb44('0x16')](_0x2b2ba1[_0xdb44('0x28')][_0xdb44('0x16')]);_0x26a068['offset']=qs[_0xdb44('0x14')](_0x2b2ba1['query']['offset']);}return _0x5834ce['getActions'](_0x26a068);}})[_0xdb44('0x1c')](function(_0x6ba561){if(_0x6ba561){return _0x6ba561?{'count':_0x23b96d,'rows':_0x6ba561}:null;}})[_0xdb44('0x1c')](respondWithResult(_0x4bf492,null))[_0xdb44('0x3c')](handleError(_0x4bf492,null));};
\ No newline at end of file
index ee2fc5f..cc59953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa71b=['Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','define'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa71b,0x84));var _0xba71=function(_0x543173,_0x4f243d){_0x543173=_0x543173-0x0;var _0x54db2b=_0xa71b[_0x543173];return _0x54db2b;};'use strict';var _=require(_0xba71('0x0'));var util=require(_0xba71('0x1'));var logger=require(_0xba71('0x2'))(_0xba71('0x3'));var moment=require(_0xba71('0x4'));var BPromise=require(_0xba71('0x5'));var rp=require(_0xba71('0x6'));var fs=require('fs');var path=require(_0xba71('0x7'));var rimraf=require('rimraf');var config=require(_0xba71('0x8'));var attributes=require(_0xba71('0x9'));module['exports']=function(_0x1df9bf,_0x2c363d){return _0x1df9bf[_0xba71('0xa')](_0xba71('0xb'),attributes,{'tableName':_0xba71('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x307b=['moment','request-promise','rimraf','../../config/environment','exports','define','Automation','tools_automations','../../config/logger','api'];(function(_0x1fe463,_0x3e0d3e){var _0x16bdb2=function(_0x57ac2b){while(--_0x57ac2b){_0x1fe463['push'](_0x1fe463['shift']());}};_0x16bdb2(++_0x3e0d3e);}(_0x307b,0x152));var _0xb307=function(_0x222011,_0x31c5f9){_0x222011=_0x222011-0x0;var _0x415377=_0x307b[_0x222011];return _0x415377;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb307('0x0'))(_0xb307('0x1'));var moment=require(_0xb307('0x2'));var BPromise=require('bluebird');var rp=require(_0xb307('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb307('0x4'));var config=require(_0xb307('0x5'));var attributes=require('./automation.attributes');module[_0xb307('0x6')]=function(_0xd205c,_0x3c0eb0){return _0xd205c[_0xb307('0x7')](_0xb307('0x8'),attributes,{'tableName':_0xb307('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07f8934..4e11e07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x2f0c39,_0x31d6c4){var _0x25e6c9=function(_0x368fd9){while(--_0x368fd9){_0x2f0c39['push'](_0x2f0c39['shift']());}};_0x25e6c9(++_0x31d6c4);}(_0x3014,0x1d7));var _0x4301=function(_0x97e9f,_0x1380c1){_0x97e9f=_0x97e9f-0x0;var _0x52bddd=_0x3014[_0x97e9f];return _0x52bddd;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}
\ No newline at end of file
+var _0x6d11=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c3ca4,_0x5c5dd5){var _0x2c4adb=function(_0xb31ba4){while(--_0xb31ba4){_0x5c3ca4['push'](_0x5c3ca4['shift']());}};_0x2c4adb(++_0x5c5dd5);}(_0x6d11,0xbf));var _0x16d1=function(_0x555201,_0x4e7d9e){_0x555201=_0x555201-0x0;var _0x359681=_0x6d11[_0x555201];return _0x359681;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('Automation,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('Automation,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}
\ No newline at end of file
index fae705a..9f13ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0e7=['getConditions','isAuthenticated','getActions','post','addConditions','/:id/actions','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','show','/:id/conditions'];(function(_0x1e489c,_0x16a5f7){var _0x104384=function(_0x41fe47){while(--_0x41fe47){_0x1e489c['push'](_0x1e489c['shift']());}};_0x104384(++_0x16a5f7);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0xe0e7[_0x1e06f1];return _0x34f77e;};'use strict';var multer=require('multer');var util=require(_0x7e0e('0x0'));var path=require(_0x7e0e('0x1'));var timeout=require(_0x7e0e('0x2'));var express=require(_0x7e0e('0x3'));var router=express[_0x7e0e('0x4')]();var fs_extra=require(_0x7e0e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e0e('0x6'));var config=require(_0x7e0e('0x7'));var controller=require(_0x7e0e('0x8'));router[_0x7e0e('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e0e('0xa')]);router[_0x7e0e('0x9')](_0x7e0e('0xb'),auth['isAuthenticated'](),controller[_0x7e0e('0xc')]);router['get'](_0x7e0e('0xd'),auth['isAuthenticated'](),controller[_0x7e0e('0xe')]);router['get']('/:id/actions',auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x10')]);router[_0x7e0e('0x11')]('/',auth[_0x7e0e('0xf')](),controller['create']);router['post'](_0x7e0e('0xd'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x12')]);router['post'](_0x7e0e('0x13'),auth[_0x7e0e('0xf')](),controller['addActions']);router[_0x7e0e('0x14')](_0x7e0e('0xb'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x15')]);router['delete'](_0x7e0e('0xb'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x16')]);module[_0x7e0e('0x17')]=router;
\ No newline at end of file
+var _0x925e=['post','create','addConditions','addActions','put','/:id','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x925e,0x199));var _0xe925=function(_0x2189e1,_0x758b1c){_0x2189e1=_0x2189e1-0x0;var _0x5c7151=_0x925e[_0x2189e1];return _0x5c7151;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe925('0x0'));var timeout=require(_0xe925('0x1'));var express=require(_0xe925('0x2'));var router=express['Router']();var fs_extra=require(_0xe925('0x3'));var auth=require(_0xe925('0x4'));var interaction=require(_0xe925('0x5'));var config=require(_0xe925('0x6'));var controller=require(_0xe925('0x7'));router[_0xe925('0x8')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe925('0xb')]);router['get'](_0xe925('0xc'),auth['isAuthenticated'](),controller[_0xe925('0xd')]);router[_0xe925('0x8')](_0xe925('0xe'),auth[_0xe925('0x9')](),controller[_0xe925('0xf')]);router[_0xe925('0x10')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0x11')]);router[_0xe925('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xe925('0x12')]);router[_0xe925('0x10')]('/:id/actions',auth[_0xe925('0x9')](),controller[_0xe925('0x13')]);router[_0xe925('0x14')](_0xe925('0x15'),auth[_0xe925('0x9')](),controller['update']);router[_0xe925('0x16')](_0xe925('0x15'),auth[_0xe925('0x9')](),controller[_0xe925('0x17')]);module[_0xe925('0x18')]=router;
\ No newline at end of file
index 7758fbd..70b5638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36e1=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36e1,0x187));var _0x136e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x36e1[_0x710815];return _0x5b3b89;};'use strict';var Sequelize=require(_0x136e('0x0'));module[_0x136e('0x1')]={'name':{'type':Sequelize[_0x136e('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x136e('0x3')](_0x136e('0x4')),'allowNull':![],'defaultValue':_0x136e('0x4')},'description':{'type':Sequelize[_0x136e('0x2')]},'active':{'type':Sequelize[_0x136e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x136e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x136e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x136e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x136e('0x8')](0x3)[_0x136e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x136e('0x8')](0x3)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x136e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x136e('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x136e('0x8')](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x136e('0x8')](0x3)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x136e('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x136e('0x2')],'defaultValue':_0x136e('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x136e('0x3')]('always',_0x136e('0x12'),_0x136e('0x13')),'defaultValue':_0x136e('0x14')},'dialAMDActive':{'type':Sequelize[_0x136e('0x5')],'defaultValue':0x0,'comment':_0x136e('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x136e('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x136e('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x136e('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x136e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x136e('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x136e('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x136e('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x136e('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x136e('0x8')](0x5)[_0x136e('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x136e('0x8')](0x9)[_0x136e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x136e('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x136e('0x3')](_0x136e('0x1d'),'ASC'),'defaultValue':_0x136e('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x136e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x136e('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x136e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x136e('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x136e('0x8')](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x136e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x136e('0x8')](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x136e('0x8')](0x3)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x136e('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x136e('0x8')](0x5)[_0x136e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x136e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x136e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x136e('0x27')}};
\ No newline at end of file
+var _0x81ef=['INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','BOOLEAN'];(function(_0x3d0272,_0x349667){var _0xdee5bd=function(_0x4d2bd3){while(--_0x4d2bd3){_0x3d0272['push'](_0x3d0272['shift']());}};_0xdee5bd(++_0x349667);}(_0x81ef,0x16c));var _0xf81e=function(_0x3a278f,_0x299b5b){_0x3a278f=_0x3a278f-0x0;var _0x542e68=_0x81ef[_0x3a278f];return _0x542e68;};'use strict';var Sequelize=require(_0xf81e('0x0'));module[_0xf81e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf81e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf81e('0x3')](_0xf81e('0x4')),'allowNull':![],'defaultValue':_0xf81e('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf81e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf81e('0x6')](0x4)[_0xf81e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf81e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf81e('0x9')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf81e('0x9')]},'dialOriginateTimeout':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'comment':_0xf81e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf81e('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xf81e('0x3')](_0xf81e('0x10'),_0xf81e('0x11'),_0xf81e('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf81e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf81e('0x6')](0x9)[_0xf81e('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf81e('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xf81e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf81e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf81e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf81e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf81e('0x6')](0x9)[_0xf81e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf81e('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf81e('0x6')](0x9)[_0xf81e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf81e('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf81e('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf81e('0x6')](0x9)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf81e('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf81e('0x6')](0x9)[_0xf81e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf81e('0x3')](_0xf81e('0x19'),'ASC'),'defaultValue':_0xf81e('0x19')},'dialPrefix':{'type':Sequelize[_0xf81e('0x9')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf81e('0x1a')},'dialCutDigit':{'type':Sequelize[_0xf81e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf81e('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf81e('0x6')](0x3)[_0xf81e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf81e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf81e('0x6')](0x5)[_0xf81e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf81e('0x24')}};
\ No newline at end of file
index e761263..055a389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab75=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Campaign','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','into','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x237347,_0x35ebe9){var _0x28f2e3=function(_0x4e83f3){while(--_0x4e83f3){_0x237347['push'](_0x237347['shift']());}};_0x28f2e3(++_0x35ebe9);}(_0xab75,0x11f));var _0x5ab7=function(_0x2538ff,_0x9eabf5){_0x2538ff=_0x2538ff-0x0;var _0x27ed94=_0xab75[_0x2538ff];return _0x27ed94;};'use strict';var emlformat=require(_0x5ab7('0x0'));var rimraf=require(_0x5ab7('0x1'));var zipdir=require(_0x5ab7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ab7('0x3'));var BPromise=require(_0x5ab7('0x4'));var Mustache=require(_0x5ab7('0x5'));var util=require('util');var path=require(_0x5ab7('0x6'));var sox=require(_0x5ab7('0x7'));var csv=require(_0x5ab7('0x8'));var ejs=require(_0x5ab7('0x9'));var fs=require('fs');var fs_extra=require(_0x5ab7('0xa'));var _=require(_0x5ab7('0xb'));var squel=require(_0x5ab7('0xc'));var crypto=require(_0x5ab7('0xd'));var jsforce=require(_0x5ab7('0xe'));var deskjs=require(_0x5ab7('0xf'));var toCsv=require(_0x5ab7('0x8'));var querystring=require('querystring');var Papa=require(_0x5ab7('0x10'));var Redis=require(_0x5ab7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5ab7('0x12'));var as=require(_0x5ab7('0x13'));var hardwareService=require(_0x5ab7('0x14'));var logger=require(_0x5ab7('0x15'))(_0x5ab7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5ab7('0x17'));var db=require(_0x5ab7('0x18'))['db'];function respondWithStatusCode(_0x574502,_0x457c24){_0x457c24=_0x457c24||0xcc;return function(_0x1d6ae0){if(_0x1d6ae0){return _0x574502[_0x5ab7('0x19')](_0x457c24);}return _0x574502[_0x5ab7('0x1a')](_0x457c24)[_0x5ab7('0x1b')]();};}function respondWithResult(_0x350bd9,_0xdca16b){_0xdca16b=_0xdca16b||0xc8;return function(_0xd3255d){if(_0xd3255d){return _0x350bd9['status'](_0xdca16b)[_0x5ab7('0x1c')](_0xd3255d);}};}function respondWithFilteredResult(_0x10daf0,_0x477d0d){return function(_0x456a4b){if(_0x456a4b){var _0x3ad6c9=typeof _0x477d0d[_0x5ab7('0x1d')]===_0x5ab7('0x1e')&&typeof _0x477d0d[_0x5ab7('0x1f')]===_0x5ab7('0x1e');var _0x168443=_0x456a4b['count'];var _0x207a79=_0x3ad6c9?0x0:_0x477d0d[_0x5ab7('0x1d')];var _0xdb94d3=_0x3ad6c9?_0x456a4b['count']:_0x477d0d[_0x5ab7('0x1d')]+_0x477d0d[_0x5ab7('0x1f')];var _0xf0a8a9;if(_0xdb94d3>=_0x168443){_0xdb94d3=_0x168443;_0xf0a8a9=0xc8;}else{_0xf0a8a9=0xce;}_0x10daf0[_0x5ab7('0x1a')](_0xf0a8a9);return _0x10daf0['set'](_0x5ab7('0x20'),_0x207a79+'-'+_0xdb94d3+'/'+_0x168443)[_0x5ab7('0x1c')](_0x456a4b);}return null;};}function patchUpdates(_0x38dc30){return function(_0x1975fc){try{jsonpatch['apply'](_0x1975fc,_0x38dc30,!![]);}catch(_0x219e02){return BPromise['reject'](_0x219e02);}return _0x1975fc[_0x5ab7('0x21')]();};}function saveUpdates(_0x1ed9b9,_0x44bda3){return function(_0x5eca9d){if(_0x5eca9d){return _0x5eca9d['update'](_0x1ed9b9)[_0x5ab7('0x22')](function(_0x5519c3){return _0x5519c3;});}return null;};}function removeEntity(_0x8eb814,_0x6d36b5){return function(_0x3301f0){if(_0x3301f0){return _0x3301f0[_0x5ab7('0x23')]()['then'](function(){var _0x26f118=_0x3301f0[_0x5ab7('0x24')]({'plain':!![]});var _0x509130='IvrCampaigns';return db[_0x5ab7('0x25')]['destroy']({'where':{'type':_0x509130,'resourceId':_0x26f118['id']}})['then'](function(){return _0x3301f0;});})[_0x5ab7('0x22')](function(){_0x8eb814[_0x5ab7('0x1a')](0xcc)[_0x5ab7('0x1b')]();});}};}function handleEntityNotFound(_0x25bf65,_0x140a95){return function(_0x340298){if(!_0x340298){_0x25bf65[_0x5ab7('0x19')](0x194);}return _0x340298;};}function handleError(_0x5aece3,_0x38767d){_0x38767d=_0x38767d||0x1f4;return function(_0x20f930){logger[_0x5ab7('0x26')](_0x20f930[_0x5ab7('0x27')]);if(_0x20f930['name']){delete _0x20f930['name'];}_0x5aece3[_0x5ab7('0x1a')](_0x38767d)[_0x5ab7('0x28')](_0x20f930);};}exports[_0x5ab7('0x29')]=function(_0x55d02b,_0x4b2467){var _0x30667b={},_0x51ae7a={},_0xad975b={'count':0x0,'rows':[]};var _0x10ba78=_[_0x5ab7('0x2a')](db['Campaign'][_0x5ab7('0x2b')],function(_0x2b4a00){return{'name':_0x2b4a00[_0x5ab7('0x2c')],'type':_0x2b4a00[_0x5ab7('0x2d')][_0x5ab7('0x2e')]};});_0x51ae7a[_0x5ab7('0x2f')]=_['map'](_0x10ba78,_0x5ab7('0x30'));_0x51ae7a['query']=_['keys'](_0x55d02b['query']);_0x51ae7a[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x51ae7a[_0x5ab7('0x2f')],_0x51ae7a[_0x5ab7('0x33')]);_0x30667b['attributes']=_[_0x5ab7('0x32')](_0x51ae7a['model'],qs[_0x5ab7('0x34')](_0x55d02b[_0x5ab7('0x33')]['fields']));_0x30667b[_0x5ab7('0x35')]=_0x30667b[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x30667b[_0x5ab7('0x35')]:_0x51ae7a['model'];if(!_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x30667b[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x55d02b['query'][_0x5ab7('0x1f')]);_0x30667b[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}_0x30667b['order']=qs[_0x5ab7('0x39')](_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x30667b[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x55d02b[_0x5ab7('0x33')],_0x51ae7a[_0x5ab7('0x31')]),_0x10ba78);if(_0x55d02b['query'][_0x5ab7('0x3c')]){_0x30667b[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x30667b['where'],{'$or':_['map'](_0x10ba78,function(_0x253d7d){if(_0x253d7d['type']!==_0x5ab7('0x3e')){var _0x1c612c={};_0x1c612c[_0x253d7d[_0x5ab7('0x30')]]={'$like':'%'+_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x1c612c;}})});}_0x30667b=_['merge']({},_0x30667b,_0x55d02b['options']);var _0x731544={'where':_0x30667b[_0x5ab7('0x3a')]};return db[_0x5ab7('0x3f')][_0x5ab7('0x40')](_0x731544)[_0x5ab7('0x22')](function(_0x1d7aa5){_0xad975b[_0x5ab7('0x40')]=_0x1d7aa5;if(_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x30667b[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x3f')][_0x5ab7('0x43')](_0x30667b);})[_0x5ab7('0x22')](function(_0x3c0c0d){_0xad975b['rows']=_0x3c0c0d;return _0xad975b;})['then'](respondWithFilteredResult(_0x4b2467,_0x30667b))[_0x5ab7('0x44')](handleError(_0x4b2467,null));};exports[_0x5ab7('0x45')]=function(_0x26829a,_0x3673e6){var _0x570c65={'raw':![],'where':{'id':_0x26829a[_0x5ab7('0x46')]['id']}},_0x5c42c6={};_0x5c42c6['model']=_[_0x5ab7('0x47')](db[_0x5ab7('0x3f')][_0x5ab7('0x2b')]);_0x5c42c6['query']=_[_0x5ab7('0x47')](_0x26829a['query']);_0x5c42c6['filters']=_[_0x5ab7('0x32')](_0x5c42c6[_0x5ab7('0x2f')],_0x5c42c6[_0x5ab7('0x33')]);_0x570c65[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x5c42c6[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x26829a['query']['fields']));_0x570c65[_0x5ab7('0x35')]=_0x570c65[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x570c65[_0x5ab7('0x35')]:_0x5c42c6[_0x5ab7('0x2f')];if(_0x26829a[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x570c65[_0x5ab7('0x42')]=[{'all':!![]}];}_0x570c65=_[_0x5ab7('0x3d')]({},_0x570c65,_0x26829a[_0x5ab7('0x48')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x49')](_0x570c65)[_0x5ab7('0x22')](handleEntityNotFound(_0x3673e6,null))[_0x5ab7('0x22')](respondWithResult(_0x3673e6,null))[_0x5ab7('0x44')](handleError(_0x3673e6,null));};exports[_0x5ab7('0x4a')]=function(_0x55e231,_0x2679c2){return db['Campaign'][_0x5ab7('0x4a')](_0x55e231[_0x5ab7('0x4b')],{})['then'](function(_0x1990ad){var _0x468224=_0x55e231[_0x5ab7('0x4c')]['get']({'plain':!![]});if(!_0x468224)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x468224['role']===_0x5ab7('0x4c')){var _0x467a17=_0x1990ad[_0x5ab7('0x24')]({'plain':!![]});var _0x1198dc=_0x5ab7('0x4d');return db[_0x5ab7('0x4e')][_0x5ab7('0x49')]({'where':{'name':_0x1198dc,'userProfileId':_0x468224[_0x5ab7('0x4f')]},'raw':!![]})[_0x5ab7('0x22')](function(_0x2bd10e){if(_0x2bd10e&&_0x2bd10e[_0x5ab7('0x50')]===0x0){return db[_0x5ab7('0x25')][_0x5ab7('0x4a')]({'name':_0x467a17['name'],'resourceId':_0x467a17['id'],'type':_0x2bd10e[_0x5ab7('0x30')],'sectionId':_0x2bd10e['id']},{})[_0x5ab7('0x22')](function(){return _0x1990ad;});}else{return _0x1990ad;}})[_0x5ab7('0x44')](function(_0x14c5ad){logger[_0x5ab7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14c5ad);throw _0x14c5ad;});}return _0x1990ad;})[_0x5ab7('0x22')](respondWithResult(_0x2679c2,0xc9))[_0x5ab7('0x44')](handleError(_0x2679c2,null));};exports[_0x5ab7('0x51')]=function(_0x37c162,_0x18a41c){var _0x28abfb={'where':{'id':_0x37c162['params']['id']}},_0x13a92a={};_0x13a92a[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db['Campaign'][_0x5ab7('0x2b')]);_0x28abfb['attributes']=_[_0x5ab7('0x32')](_0x13a92a[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x37c162[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x28abfb[_0x5ab7('0x35')]=_0x28abfb[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x28abfb['attributes']:_0x13a92a[_0x5ab7('0x2f')];if(_0x37c162[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x28abfb[_0x5ab7('0x42')]=[{'all':!![]}];}_0x28abfb=_[_0x5ab7('0x3d')]({},_0x28abfb,_0x37c162[_0x5ab7('0x48')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x49')](_0x28abfb)[_0x5ab7('0x22')](handleEntityNotFound(_0x18a41c,null))['then'](function(_0x594f02){if(_0x594f02){var _0x2a7cf3=_0x594f02[_0x5ab7('0x24')]({'plain':!![]});_0x2a7cf3=qs[_0x5ab7('0x52')](_0x2a7cf3,['id',_0x5ab7('0x53'),'updatedAt']);_0x37c162[_0x5ab7('0x4b')]=_[_0x5ab7('0x52')](_0x37c162[_0x5ab7('0x4b')],['id',_0x5ab7('0x53'),_0x5ab7('0x54')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x4a')](_[_0x5ab7('0x3d')](_0x2a7cf3,_0x37c162[_0x5ab7('0x4b')]),{'include':_0x37c162['query'][_0x5ab7('0x41')]?[{'all':!![]}]:undefined})[_0x5ab7('0x22')](function(_0x44dddc){var _0x23dfe6=_0x37c162[_0x5ab7('0x4c')]['get']({'plain':!![]});if(!_0x23dfe6)throw new Error(_0x5ab7('0x55'));if(_0x23dfe6['role']==='user'){var _0x4eac40=_0x44dddc[_0x5ab7('0x24')]({'plain':!![]});var _0x31a47a=_0x5ab7('0x4d');return db['UserProfileSection'][_0x5ab7('0x49')]({'where':{'name':_0x31a47a,'userProfileId':_0x23dfe6[_0x5ab7('0x4f')]},'raw':!![]})['then'](function(_0x4d5bef){if(_0x4d5bef&&_0x4d5bef[_0x5ab7('0x50')]===0x0){return db[_0x5ab7('0x25')]['create']({'name':_0x4eac40[_0x5ab7('0x30')],'resourceId':_0x4eac40['id'],'type':_0x4d5bef[_0x5ab7('0x30')],'sectionId':_0x4d5bef['id']},{})[_0x5ab7('0x22')](function(){return _0x44dddc;});}else{return _0x44dddc;}})['catch'](function(_0x3d388f){logger[_0x5ab7('0x26')](_0x5ab7('0x56'),_0x3d388f);throw _0x3d388f;});}return _0x44dddc;});}})[_0x5ab7('0x22')](respondWithResult(_0x18a41c,0xc9))[_0x5ab7('0x44')](handleError(_0x18a41c,null));};exports[_0x5ab7('0x57')]=function(_0x158587,_0x1c411c){if(_0x158587['body']['id']){delete _0x158587[_0x5ab7('0x4b')]['id'];}return db[_0x5ab7('0x3f')]['find']({'where':{'id':_0x158587[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x1c411c,null))[_0x5ab7('0x22')](saveUpdates(_0x158587['body'],null))[_0x5ab7('0x22')](respondWithResult(_0x1c411c,null))[_0x5ab7('0x44')](handleError(_0x1c411c,null));};exports['destroy']=function(_0x59dc04,_0x33f3c4){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x59dc04[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x33f3c4,null))[_0x5ab7('0x22')](removeEntity(_0x33f3c4,null))[_0x5ab7('0x44')](handleError(_0x33f3c4,null));};exports['getHoppers']=function(_0x3b101f,_0x141ff8,_0x40d85c){var _0x1f9eff={'raw':!![],'where':{}};var _0x4bf414={};var _0x5d5c29={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x3b101f[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x141ff8,null))['then'](function(_0x11547a){if(_0x11547a){_0x4bf414['model']=_[_0x5ab7('0x47')](db[_0x5ab7('0x59')][_0x5ab7('0x2b')]);_0x4bf414[_0x5ab7('0x33')]=_[_0x5ab7('0x47')](_0x3b101f['query']);_0x4bf414[_0x5ab7('0x31')]=_['intersection'](_0x4bf414['model'],_0x4bf414['query']);_0x1f9eff['attributes']=_[_0x5ab7('0x32')](_0x4bf414[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x3b101f[_0x5ab7('0x33')]['fields']));_0x1f9eff['attributes']=_0x1f9eff[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x1f9eff['attributes']:_0x4bf414['model'];if(!_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x37')]('nolimit')){_0x1f9eff[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x3b101f['query'][_0x5ab7('0x1f')]);_0x1f9eff[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x3b101f['query'][_0x5ab7('0x1d')]);}_0x1f9eff[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x1f9eff[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x3b101f[_0x5ab7('0x33')],_0x4bf414[_0x5ab7('0x31')]));_0x1f9eff['where'][_0x5ab7('0x5b')]=_0x11547a['id'];if(_0x3b101f['query'][_0x5ab7('0x3c')]){_0x1f9eff[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x1f9eff['where'],{'$or':_[_0x5ab7('0x2a')](_0x1f9eff['attributes'],function(_0x1d76d0){var _0x5b9887={};_0x5b9887[_0x1d76d0]={'$like':'%'+_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x5b9887;})});}_0x1f9eff=_[_0x5ab7('0x3d')]({},_0x1f9eff,_0x3b101f[_0x5ab7('0x48')]);return db[_0x5ab7('0x59')][_0x5ab7('0x40')]({'where':_0x1f9eff['where']})[_0x5ab7('0x22')](function(_0x32e0e9){_0x5d5c29['count']=_0x32e0e9;if(_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x1f9eff['include']=[{'all':!![]}];}return db[_0x5ab7('0x59')]['findAll'](_0x1f9eff);})[_0x5ab7('0x22')](function(_0x555113){_0x5d5c29[_0x5ab7('0x5c')]=_0x555113;return _0x5d5c29;});}})['then'](respondWithFilteredResult(_0x141ff8,_0x1f9eff))[_0x5ab7('0x44')](handleError(_0x141ff8,null));};exports[_0x5ab7('0x5d')]=function(_0x419af4,_0x589db7,_0x6ee259){var _0x56555e={'raw':!![],'where':{}};var _0x1c9810={};var _0xbd1b79={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x419af4[_0x5ab7('0x46')]['id']}})['then'](handleEntityNotFound(_0x589db7,null))['then'](function(_0x49c7db){if(_0x49c7db){_0x1c9810[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x5e')][_0x5ab7('0x2b')]);_0x1c9810[_0x5ab7('0x33')]=_['keys'](_0x419af4[_0x5ab7('0x33')]);_0x1c9810[_0x5ab7('0x31')]=_['intersection'](_0x1c9810[_0x5ab7('0x2f')],_0x1c9810[_0x5ab7('0x33')]);_0x56555e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x1c9810[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x419af4['query'][_0x5ab7('0x34')]));_0x56555e[_0x5ab7('0x35')]=_0x56555e['attributes']['length']?_0x56555e[_0x5ab7('0x35')]:_0x1c9810[_0x5ab7('0x2f')];if(!_0x419af4['query'][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x56555e[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x56555e[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x419af4[_0x5ab7('0x33')]['offset']);}_0x56555e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x56555e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x419af4[_0x5ab7('0x33')],_0x1c9810[_0x5ab7('0x31')]));_0x56555e[_0x5ab7('0x3a')]['CampaignId']=_0x49c7db['id'];if(_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x56555e[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x56555e[_0x5ab7('0x3a')],{'$or':_[_0x5ab7('0x2a')](_0x56555e[_0x5ab7('0x35')],function(_0x79f4f0){var _0x3af97b={};_0x3af97b[_0x79f4f0]={'$like':'%'+_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x3af97b;})});}_0x56555e=_['merge']({},_0x56555e,_0x419af4[_0x5ab7('0x48')]);return db[_0x5ab7('0x5e')][_0x5ab7('0x40')]({'where':_0x56555e[_0x5ab7('0x3a')]})[_0x5ab7('0x22')](function(_0x50da5f){_0xbd1b79['count']=_0x50da5f;if(_0x419af4['query'][_0x5ab7('0x41')]){_0x56555e['include']=[{'all':!![]}];}return db[_0x5ab7('0x5e')][_0x5ab7('0x43')](_0x56555e);})[_0x5ab7('0x22')](function(_0x365800){_0xbd1b79['rows']=_0x365800;return _0xbd1b79;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0x589db7,_0x56555e))['catch'](handleError(_0x589db7,null));};exports[_0x5ab7('0x5f')]=function(_0x5c3306,_0x5a6d52,_0x34c66d){var _0x54ecc5={'raw':!![],'where':{}};var _0x288553={};var _0x4ac4e5={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x5c3306[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x5a6d52,null))[_0x5ab7('0x22')](function(_0x54ca11){if(_0x54ca11){_0x288553[_0x5ab7('0x2f')]=_['keys'](db[_0x5ab7('0x60')][_0x5ab7('0x2b')]);_0x288553[_0x5ab7('0x33')]=_['keys'](_0x5c3306[_0x5ab7('0x33')]);_0x288553[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x288553[_0x5ab7('0x2f')],_0x288553[_0x5ab7('0x33')]);_0x54ecc5[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x288553[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x54ecc5[_0x5ab7('0x35')]=_0x54ecc5[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x54ecc5[_0x5ab7('0x35')]:_0x288553['model'];if(!_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x54ecc5['limit']=qs[_0x5ab7('0x1f')](_0x5c3306[_0x5ab7('0x33')]['limit']);_0x54ecc5[_0x5ab7('0x1d')]=qs['offset'](_0x5c3306[_0x5ab7('0x33')]['offset']);}_0x54ecc5[_0x5ab7('0x5a')]=qs['sort'](_0x5c3306['query'][_0x5ab7('0x39')]);_0x54ecc5[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_['pick'](_0x5c3306[_0x5ab7('0x33')],_0x288553[_0x5ab7('0x31')]));_0x54ecc5[_0x5ab7('0x3a')][_0x5ab7('0x5b')]=_0x54ca11['id'];if(_0x5c3306[_0x5ab7('0x33')]['filter']){_0x54ecc5[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x54ecc5['where'],{'$or':_[_0x5ab7('0x2a')](_0x54ecc5[_0x5ab7('0x35')],function(_0xa2652f){var _0x39df84={};_0x39df84[_0xa2652f]={'$like':'%'+_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x39df84;})});}_0x54ecc5=_[_0x5ab7('0x3d')]({},_0x54ecc5,_0x5c3306[_0x5ab7('0x48')]);return db[_0x5ab7('0x60')][_0x5ab7('0x40')]({'where':_0x54ecc5['where']})['then'](function(_0x39a276){_0x4ac4e5[_0x5ab7('0x40')]=_0x39a276;if(_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x54ecc5[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x60')][_0x5ab7('0x43')](_0x54ecc5);})[_0x5ab7('0x22')](function(_0x4c19f8){_0x4ac4e5[_0x5ab7('0x5c')]=_0x4c19f8;return _0x4ac4e5;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0x5a6d52,_0x54ecc5))[_0x5ab7('0x44')](handleError(_0x5a6d52,null));};exports[_0x5ab7('0x61')]=function(_0x3217c,_0xd04342,_0x18dbd2){var _0x16a96e={'raw':!![],'where':{}};var _0x13492e={};var _0x4a5cca={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x3217c[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0xd04342,null))['then'](function(_0x76c041){if(_0x76c041){_0x13492e[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x62')]['rawAttributes']);_0x13492e[_0x5ab7('0x33')]=_['keys'](_0x3217c[_0x5ab7('0x33')]);_0x13492e[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x13492e['model'],_0x13492e['query']);_0x16a96e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x13492e[_0x5ab7('0x2f')],qs['fields'](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x16a96e['attributes']=_0x16a96e['attributes'][_0x5ab7('0x36')]?_0x16a96e[_0x5ab7('0x35')]:_0x13492e[_0x5ab7('0x2f')];if(!_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x16a96e[_0x5ab7('0x1f')]=qs['limit'](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x16a96e['offset']=qs[_0x5ab7('0x1d')](_0x3217c['query']['offset']);}_0x16a96e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x16a96e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x3217c[_0x5ab7('0x33')],_0x13492e['filters']));_0x16a96e[_0x5ab7('0x3a')]['CampaignId']=_0x76c041['id'];if(_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x16a96e[_0x5ab7('0x3a')]=_['merge'](_0x16a96e[_0x5ab7('0x3a')],{'$or':_['map'](_0x16a96e[_0x5ab7('0x35')],function(_0x43ade1){var _0x53a879={};_0x53a879[_0x43ade1]={'$like':'%'+_0x3217c['query'][_0x5ab7('0x3c')]+'%'};return _0x53a879;})});}_0x16a96e=_['merge']({},_0x16a96e,_0x3217c[_0x5ab7('0x48')]);return db[_0x5ab7('0x62')][_0x5ab7('0x40')]({'where':_0x16a96e['where']})[_0x5ab7('0x22')](function(_0x4f26ff){_0x4a5cca[_0x5ab7('0x40')]=_0x4f26ff;if(_0x3217c['query']['includeAll']){_0x16a96e[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x62')][_0x5ab7('0x43')](_0x16a96e);})['then'](function(_0x52b3df){_0x4a5cca['rows']=_0x52b3df;return _0x4a5cca;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0xd04342,_0x16a96e))['catch'](handleError(_0xd04342,null));};exports[_0x5ab7('0x63')]=function(_0xcdebd,_0x1ca922,_0x33b3dc){var _0xabc5eb={};var _0x19ae24={};var _0xe316de;var _0x53dc1d;return db[_0x5ab7('0x3f')]['findOne']({'where':{'id':_0xcdebd[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x1ca922,null))['then'](function(_0x96c201){if(_0x96c201){_0xe316de=_0x96c201;_0x19ae24[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x64')][_0x5ab7('0x2b')]);_0x19ae24[_0x5ab7('0x33')]=_[_0x5ab7('0x47')](_0xcdebd['query']);_0x19ae24[_0x5ab7('0x31')]=_['intersection'](_0x19ae24[_0x5ab7('0x2f')],_0x19ae24['query']);_0xabc5eb[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x19ae24['model'],qs[_0x5ab7('0x34')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0xabc5eb[_0x5ab7('0x35')]=_0xabc5eb[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0xabc5eb[_0x5ab7('0x35')]:_0x19ae24[_0x5ab7('0x2f')];_0xabc5eb[_0x5ab7('0x5a')]=qs['sort'](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0xabc5eb['where']=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0xcdebd['query'],_0x19ae24[_0x5ab7('0x31')]));if(_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0xabc5eb[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0xabc5eb['where'],{'$or':_[_0x5ab7('0x2a')](_0xabc5eb[_0x5ab7('0x35')],function(_0x558611){var _0x1d0d1f={};_0x1d0d1f[_0x558611]={'$like':'%'+_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x1d0d1f;})});}_0xabc5eb=_['merge']({},_0xabc5eb,_0xcdebd[_0x5ab7('0x48')]);return _0xe316de['getLists'](_0xabc5eb);}})[_0x5ab7('0x22')](function(_0x5a71de){if(_0x5a71de){_0x53dc1d=_0x5a71de[_0x5ab7('0x36')];if(!_0xcdebd[_0x5ab7('0x33')]['hasOwnProperty'](_0x5ab7('0x38'))){_0xabc5eb[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0xabc5eb['offset']=qs[_0x5ab7('0x1d')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}return _0xe316de[_0x5ab7('0x63')](_0xabc5eb);}})[_0x5ab7('0x22')](function(_0x5b6655){if(_0x5b6655){return _0x5b6655?{'count':_0x53dc1d,'rows':_0x5b6655}:null;}})[_0x5ab7('0x22')](respondWithResult(_0x1ca922,null))[_0x5ab7('0x44')](handleError(_0x1ca922,null));};exports[_0x5ab7('0x65')]=function(_0x3c6dfa,_0x30555f,_0x50cd03){var _0x244715,_0x4be3b4;var _0x367038=[];var _0x4e4147=moment()[_0x5ab7('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x3c6dfa[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x30555f,null))['then'](function(_0x5587f5){if(_0x5587f5){_0x4be3b4=_0x5587f5;return _0x5587f5['addLists'](_0x3c6dfa[_0x5ab7('0x4b')][_0x5ab7('0x67')],_['omit'](_0x3c6dfa[_0x5ab7('0x4b')],['ids','id'])||{});}return null;})[_0x5ab7('0x68')](function(_0x303bf7){var _0x13d39b;var _0x20e151;_0x244715=_0x303bf7||[];var _0x546a5b=[];if(_0x303bf7){for(var _0x481aa8=0x0;_0x481aa8<_0x303bf7[_0x5ab7('0x36')];_0x481aa8+=0x1){var _0x21c2e6=_0x303bf7[_0x481aa8][_0x5ab7('0x24')]({'plain':!![]});_0x4be3b4[_0x5ab7('0x69')]=_0x3c6dfa[_0x5ab7('0x4b')][_0x5ab7('0x69')]?_0x3c6dfa[_0x5ab7('0x4b')]['dialCheckDuplicateType']:_0x4be3b4[_0x5ab7('0x69')];switch(_0x4be3b4['dialCheckDuplicateType']){case _0x5ab7('0x6a'):_0x13d39b=squel['insert']()['into'](_0x5ab7('0x6b'))[_0x5ab7('0x6c')](['phone',_0x5ab7('0x6d'),_0x5ab7('0x6e'),_0x5ab7('0x6f'),'CampaignId',_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x72'),_0x5ab7('0x72'))[_0x5ab7('0x71')](_0x5ab7('0x73'),_0x5ab7('0x6d'))[_0x5ab7('0x71')]('id',_0x5ab7('0x6e'))['field'](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27',_0x5ab7('0x53'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')](_0x5ab7('0x77'))[_0x5ab7('0x3a')](_0x5ab7('0x78'))[_0x5ab7('0x3a')](_0x5ab7('0x79'),_0x21c2e6[_0x5ab7('0x74')]['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x7a'))['where'](_0x5ab7('0x7b'),squel[_0x5ab7('0x70')]()['field'](_0x5ab7('0x7c'))['from'](_0x5ab7('0x7d'))['where']('CampaignId\x20=\x20?',_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']()))[_0x5ab7('0x3a')](_0x5ab7('0x7b'),squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x7e'))[_0x5ab7('0x76')](_0x5ab7('0x6b'))['where'](_0x5ab7('0x7f'),_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']())))['toString']();break;case _0x5ab7('0x80'):_0x13d39b=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')](_0x5ab7('0x6b'))['fromQuery']([_0x5ab7('0x72'),'scheduledAt',_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel['select']()['field'](_0x5ab7('0x72'),'phone')[_0x5ab7('0x71')](_0x5ab7('0x73'),_0x5ab7('0x6d'))[_0x5ab7('0x71')]('id',_0x5ab7('0x6e'))['field'](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','createdAt')[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')]('cm_contacts')[_0x5ab7('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x5ab7('0x79'),_0x21c2e6[_0x5ab7('0x74')]['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x7e'))[_0x5ab7('0x76')]('cm_hopper')[_0x5ab7('0x3a')](_0x5ab7('0x7f'),_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')]())))[_0x5ab7('0x75')]();break;default:_0x13d39b=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')]('cm_hopper')[_0x5ab7('0x6c')]([_0x5ab7('0x72'),_0x5ab7('0x6d'),_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')]('phone',_0x5ab7('0x72'))['field'](_0x5ab7('0x73'),_0x5ab7('0x6d'))['field']('id',_0x5ab7('0x6e'))[_0x5ab7('0x71')](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))['field'](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','createdAt')[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')](_0x5ab7('0x77'))['where'](_0x5ab7('0x78'))[_0x5ab7('0x3a')]('ListId\x20=\x20?',_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')]())[_0x5ab7('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x5ab7('0x75')]();}_0x20e151=squel['insert']()[_0x5ab7('0x82')](_0x5ab7('0x83'))[_0x5ab7('0x6c')]([_0x5ab7('0x84'),_0x5ab7('0x6d'),_0x5ab7('0x72'),'OrderBy',_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x85'),'id')[_0x5ab7('0x71')]('NOW()',_0x5ab7('0x6d'))[_0x5ab7('0x71')](_0x5ab7('0x86'),'phone')['field'](_0x5ab7('0x87'),_0x5ab7('0x88'))['field']('\x27'+_0x4e4147+'\x27',_0x5ab7('0x53'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27',_0x5ab7('0x54'))[_0x5ab7('0x76')](_0x5ab7('0x89'),'ci')['join'](_0x5ab7('0x6b'),'h',_0x5ab7('0x8a'))[_0x5ab7('0x3a')](_0x5ab7('0x8b'),_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')]())['where'](_0x5ab7('0x8c'),_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x8d'),_0x4e4147))[_0x5ab7('0x75')]();_0x546a5b[_0x5ab7('0x8e')](db[_0x5ab7('0x8f')][_0x5ab7('0x33')](_0x13d39b));_0x367038['push'](db[_0x5ab7('0x8f')][_0x5ab7('0x33')](_0x20e151));}return BPromise[_0x5ab7('0x90')](_0x546a5b);}})[_0x5ab7('0x22')](function(){return BPromise['all'](_0x367038);})[_0x5ab7('0x22')](function(){return _0x244715;})[_0x5ab7('0x22')](respondWithResult(_0x30555f,null))[_0x5ab7('0x44')](handleError(_0x30555f,null));};exports[_0x5ab7('0x91')]=function(_0x48710a,_0x429a9f,_0x21f4b7){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x48710a[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x429a9f,null))['then'](function(_0x502245){if(_0x502245){return _0x502245[_0x5ab7('0x91')](_0x48710a[_0x5ab7('0x33')]['ids']);}})['then'](function(_0x1e6783){if(_0x1e6783){return db[_0x5ab7('0x59')][_0x5ab7('0x23')]({'where':{'ListId':_0x48710a[_0x5ab7('0x33')]['ids'],'CampaignId':_0x48710a['params']['id']}})['then'](function(){return _0x1e6783;});}})[_0x5ab7('0x22')](respondWithStatusCode(_0x429a9f,null))[_0x5ab7('0x44')](handleError(_0x429a9f,null));};exports[_0x5ab7('0x92')]=function(_0x349f87,_0x3e410b,_0x3f54c3){var _0x2f427e={};var _0xbe126d={};var _0x321fa3;var _0x4c741b;return db[_0x5ab7('0x3f')]['findOne']({'where':{'id':_0x349f87['params']['id']}})['then'](handleEntityNotFound(_0x3e410b,null))[_0x5ab7('0x22')](function(_0x904fea){if(_0x904fea){_0x321fa3=_0x904fea;_0xbe126d[_0x5ab7('0x2f')]=_['keys'](db['CmList'][_0x5ab7('0x2b')]);_0xbe126d['query']=_[_0x5ab7('0x47')](_0x349f87[_0x5ab7('0x33')]);_0xbe126d[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0xbe126d['model'],_0xbe126d['query']);_0x2f427e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0xbe126d['model'],qs['fields'](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x2f427e[_0x5ab7('0x35')]=_0x2f427e[_0x5ab7('0x35')]['length']?_0x2f427e[_0x5ab7('0x35')]:_0xbe126d['model'];_0x2f427e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x349f87['query']['sort']);_0x2f427e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x349f87['query'],_0xbe126d[_0x5ab7('0x31')]));if(_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x2f427e['where']=_[_0x5ab7('0x3d')](_0x2f427e[_0x5ab7('0x3a')],{'$or':_[_0x5ab7('0x2a')](_0x2f427e[_0x5ab7('0x35')],function(_0x947e21){var _0x166145={};_0x166145[_0x947e21]={'$like':'%'+_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x166145;})});}_0x2f427e=_['merge']({},_0x2f427e,_0x349f87[_0x5ab7('0x48')]);return _0x321fa3[_0x5ab7('0x92')](_0x2f427e);}})[_0x5ab7('0x22')](function(_0x816db){if(_0x816db){_0x4c741b=_0x816db[_0x5ab7('0x36')];if(!_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x2f427e[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x2f427e[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}return _0x321fa3[_0x5ab7('0x92')](_0x2f427e);}})['then'](function(_0x561647){if(_0x561647){return _0x561647?{'count':_0x4c741b,'rows':_0x561647}:null;}})['then'](respondWithResult(_0x3e410b,null))[_0x5ab7('0x44')](handleError(_0x3e410b,null));};exports[_0x5ab7('0x93')]=function(_0x394324,_0x214d37,_0x21d32b){var _0x51c231,_0x3b126e;var _0x3780b7=[];var _0x20ae13=moment()[_0x5ab7('0x66')](_0x5ab7('0x94'));return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x394324[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x214d37,null))[_0x5ab7('0x22')](function(_0x4e4a43){if(_0x4e4a43){_0x3b126e=_0x4e4a43;return _0x4e4a43[_0x5ab7('0x93')](_0x394324['body'][_0x5ab7('0x67')],_[_0x5ab7('0x52')](_0x394324[_0x5ab7('0x4b')],[_0x5ab7('0x67'),'id'])||{});}return null;})[_0x5ab7('0x68')](function(_0x4a37cc){var _0x2063c4;var _0x57a1b3;_0x51c231=_0x4a37cc||[];var _0x9295a0=[];if(_0x4a37cc){for(var _0x5ade22=0x0;_0x5ade22<_0x4a37cc[_0x5ab7('0x36')];_0x5ade22+=0x1){var _0xbc3696=_0x4a37cc[_0x5ade22][_0x5ab7('0x24')]({'plain':!![]});_0x2063c4=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')](_0x5ab7('0x95'))[_0x5ab7('0x6c')](['phone',_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')]('phone',_0x5ab7('0x72'))[_0x5ab7('0x71')]('id','ContactId')[_0x5ab7('0x71')](_0xbc3696['CmListId'][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x394324['params']['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))['field']('NOW()',_0x5ab7('0x53'))[_0x5ab7('0x71')]('NOW()',_0x5ab7('0x54'))['from']('cm_contacts')[_0x5ab7('0x3a')](_0x5ab7('0x78'))[_0x5ab7('0x3a')](_0x5ab7('0x79'),_0xbc3696['CmListId'][_0x5ab7('0x75')]())[_0x5ab7('0x3a')](_0x5ab7('0x7a')))[_0x5ab7('0x75')]();_0x9295a0[_0x5ab7('0x8e')](db['sequelize']['query'](_0x2063c4));}return BPromise[_0x5ab7('0x90')](_0x9295a0);}})['then'](function(){return _0x51c231;})[_0x5ab7('0x22')](respondWithResult(_0x214d37,null))['catch'](handleError(_0x214d37,null));};exports[_0x5ab7('0x96')]=function(_0x265a06,_0x107a8b,_0x2f02de){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x265a06[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x107a8b,null))[_0x5ab7('0x22')](function(_0x501a68){if(_0x501a68){return _0x501a68[_0x5ab7('0x96')](_0x265a06[_0x5ab7('0x33')][_0x5ab7('0x67')]);}})[_0x5ab7('0x22')](function(_0x385013){if(_0x385013){return db[_0x5ab7('0x62')][_0x5ab7('0x23')]({'where':{'ListId':_0x265a06[_0x5ab7('0x33')][_0x5ab7('0x67')],'CampaignId':_0x265a06[_0x5ab7('0x46')]['id']}})['then'](function(){return _0x385013;});}})[_0x5ab7('0x22')](respondWithStatusCode(_0x107a8b,null))[_0x5ab7('0x44')](handleError(_0x107a8b,null));};
\ No newline at end of file
+var _0xbc23=['ContactId','CmListId','ListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','join','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','destroy','then','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','send','map','Campaign','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','autoAssociation','update','getHoppers','findOne','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','field','phone','NOW()'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbc23,0x1bd));var _0x3bc2=function(_0x1cfa01,_0x2b53da){_0x1cfa01=_0x1cfa01-0x0;var _0x57c9b7=_0xbc23[_0x1cfa01];return _0x57c9b7;};'use strict';var emlformat=require(_0x3bc2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3bc2('0x1'));var rp=require(_0x3bc2('0x2'));var moment=require(_0x3bc2('0x3'));var BPromise=require(_0x3bc2('0x4'));var Mustache=require(_0x3bc2('0x5'));var util=require(_0x3bc2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3bc2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bc2('0x8'));var crypto=require(_0x3bc2('0x9'));var jsforce=require(_0x3bc2('0xa'));var deskjs=require(_0x3bc2('0xb'));var toCsv=require(_0x3bc2('0x7'));var querystring=require(_0x3bc2('0xc'));var Papa=require(_0x3bc2('0xd'));var Redis=require('ioredis');var authService=require(_0x3bc2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3bc2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bc2('0x10'))(_0x3bc2('0x11'));var utils=require(_0x3bc2('0x12'));var config=require(_0x3bc2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bc2('0x14'))['db'];function respondWithStatusCode(_0x2280cd,_0xdfdf63){_0xdfdf63=_0xdfdf63||0xcc;return function(_0x2e9ef5){if(_0x2e9ef5){return _0x2280cd['sendStatus'](_0xdfdf63);}return _0x2280cd[_0x3bc2('0x15')](_0xdfdf63)['end']();};}function respondWithResult(_0x8c87ef,_0x15cbb0){_0x15cbb0=_0x15cbb0||0xc8;return function(_0x4d8f05){if(_0x4d8f05){return _0x8c87ef[_0x3bc2('0x15')](_0x15cbb0)[_0x3bc2('0x16')](_0x4d8f05);}};}function respondWithFilteredResult(_0x173493,_0x552e20){return function(_0x243716){if(_0x243716){var _0x4bedb3=typeof _0x552e20[_0x3bc2('0x17')]==='undefined'&&typeof _0x552e20[_0x3bc2('0x18')]===_0x3bc2('0x19');var _0xe3054c=_0x243716[_0x3bc2('0x1a')];var _0x1f4253=_0x4bedb3?0x0:_0x552e20['offset'];var _0x5ecfe4=_0x4bedb3?_0x243716[_0x3bc2('0x1a')]:_0x552e20[_0x3bc2('0x17')]+_0x552e20[_0x3bc2('0x18')];var _0x1d8b47;if(_0x5ecfe4>=_0xe3054c){_0x5ecfe4=_0xe3054c;_0x1d8b47=0xc8;}else{_0x1d8b47=0xce;}_0x173493[_0x3bc2('0x15')](_0x1d8b47);return _0x173493[_0x3bc2('0x1b')]('Content-Range',_0x1f4253+'-'+_0x5ecfe4+'/'+_0xe3054c)[_0x3bc2('0x16')](_0x243716);}return null;};}function patchUpdates(_0x388cd3){return function(_0x4e6bc9){try{jsonpatch['apply'](_0x4e6bc9,_0x388cd3,!![]);}catch(_0x26bb22){return BPromise['reject'](_0x26bb22);}return _0x4e6bc9['save']();};}function saveUpdates(_0x3015e7,_0x580ee2){return function(_0x5d1e39){if(_0x5d1e39){return _0x5d1e39['update'](_0x3015e7)['then'](function(_0x198908){return _0x198908;});}return null;};}function removeEntity(_0x413999,_0x439649){return function(_0x1b00d0){if(_0x1b00d0){return _0x1b00d0[_0x3bc2('0x1c')]()[_0x3bc2('0x1d')](function(){var _0x591e45=_0x1b00d0[_0x3bc2('0x1e')]({'plain':!![]});var _0x25167e=_0x3bc2('0x1f');return db[_0x3bc2('0x20')][_0x3bc2('0x1c')]({'where':{'type':_0x25167e,'resourceId':_0x591e45['id']}})[_0x3bc2('0x1d')](function(){return _0x1b00d0;});})[_0x3bc2('0x1d')](function(){_0x413999[_0x3bc2('0x15')](0xcc)[_0x3bc2('0x21')]();});}};}function handleEntityNotFound(_0x1ddc73,_0xd6b456){return function(_0xd8d5ba){if(!_0xd8d5ba){_0x1ddc73[_0x3bc2('0x22')](0x194);}return _0xd8d5ba;};}function handleError(_0x3d6ba5,_0x594c6f){_0x594c6f=_0x594c6f||0x1f4;return function(_0x396d76){logger[_0x3bc2('0x23')](_0x396d76[_0x3bc2('0x24')]);if(_0x396d76['name']){delete _0x396d76['name'];}_0x3d6ba5[_0x3bc2('0x15')](_0x594c6f)[_0x3bc2('0x25')](_0x396d76);};}exports['index']=function(_0xc12490,_0x10aaa4){var _0x5ebd0d={},_0xaa2ff3={},_0x323d81={'count':0x0,'rows':[]};var _0x283b91=_[_0x3bc2('0x26')](db[_0x3bc2('0x27')][_0x3bc2('0x28')],function(_0x3d7f3c){return{'name':_0x3d7f3c[_0x3bc2('0x29')],'type':_0x3d7f3c[_0x3bc2('0x2a')]['key']};});_0xaa2ff3[_0x3bc2('0x2b')]=_[_0x3bc2('0x26')](_0x283b91,_0x3bc2('0x2c'));_0xaa2ff3[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0xc12490[_0x3bc2('0x2d')]);_0xaa2ff3[_0x3bc2('0x2f')]=_['intersection'](_0xaa2ff3[_0x3bc2('0x2b')],_0xaa2ff3['query']);_0x5ebd0d[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0xaa2ff3['model'],qs[_0x3bc2('0x32')](_0xc12490[_0x3bc2('0x2d')]['fields']));_0x5ebd0d['attributes']=_0x5ebd0d[_0x3bc2('0x30')][_0x3bc2('0x33')]?_0x5ebd0d[_0x3bc2('0x30')]:_0xaa2ff3['model'];if(!_0xc12490[_0x3bc2('0x2d')][_0x3bc2('0x34')](_0x3bc2('0x35'))){_0x5ebd0d['limit']=qs[_0x3bc2('0x18')](_0xc12490[_0x3bc2('0x2d')][_0x3bc2('0x18')]);_0x5ebd0d[_0x3bc2('0x17')]=qs[_0x3bc2('0x17')](_0xc12490[_0x3bc2('0x2d')][_0x3bc2('0x17')]);}_0x5ebd0d[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0xc12490[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x5ebd0d[_0x3bc2('0x38')]=qs[_0x3bc2('0x2f')](_[_0x3bc2('0x39')](_0xc12490[_0x3bc2('0x2d')],_0xaa2ff3[_0x3bc2('0x2f')]),_0x283b91);if(_0xc12490['query']['filter']){_0x5ebd0d[_0x3bc2('0x38')]=_[_0x3bc2('0x3a')](_0x5ebd0d[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x283b91,function(_0x23bc98){if(_0x23bc98[_0x3bc2('0x2a')]!==_0x3bc2('0x3b')){var _0x3c9e9e={};_0x3c9e9e[_0x23bc98[_0x3bc2('0x2c')]]={'$like':'%'+_0xc12490['query'][_0x3bc2('0x3c')]+'%'};return _0x3c9e9e;}})});}_0x5ebd0d=_['merge']({},_0x5ebd0d,_0xc12490[_0x3bc2('0x3d')]);var _0x6e5a6={'where':_0x5ebd0d[_0x3bc2('0x38')]};return db[_0x3bc2('0x27')][_0x3bc2('0x1a')](_0x6e5a6)[_0x3bc2('0x1d')](function(_0xab2142){_0x323d81['count']=_0xab2142;if(_0xc12490[_0x3bc2('0x2d')][_0x3bc2('0x3e')]){_0x5ebd0d[_0x3bc2('0x3f')]=[{'all':!![]}];}return db[_0x3bc2('0x27')]['findAll'](_0x5ebd0d);})[_0x3bc2('0x1d')](function(_0x331501){_0x323d81[_0x3bc2('0x40')]=_0x331501;return _0x323d81;})[_0x3bc2('0x1d')](respondWithFilteredResult(_0x10aaa4,_0x5ebd0d))['catch'](handleError(_0x10aaa4,null));};exports[_0x3bc2('0x41')]=function(_0x11ae06,_0xd1398f){var _0x109e8c={'raw':![],'where':{'id':_0x11ae06[_0x3bc2('0x42')]['id']}},_0x2d3f54={};_0x2d3f54['model']=_[_0x3bc2('0x2e')](db['Campaign'][_0x3bc2('0x28')]);_0x2d3f54[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x11ae06[_0x3bc2('0x2d')]);_0x2d3f54[_0x3bc2('0x2f')]=_['intersection'](_0x2d3f54['model'],_0x2d3f54['query']);_0x109e8c[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0x2d3f54[_0x3bc2('0x2b')],qs[_0x3bc2('0x32')](_0x11ae06[_0x3bc2('0x2d')]['fields']));_0x109e8c[_0x3bc2('0x30')]=_0x109e8c[_0x3bc2('0x30')][_0x3bc2('0x33')]?_0x109e8c[_0x3bc2('0x30')]:_0x2d3f54[_0x3bc2('0x2b')];if(_0x11ae06[_0x3bc2('0x2d')][_0x3bc2('0x3e')]){_0x109e8c['include']=[{'all':!![]}];}_0x109e8c=_['merge']({},_0x109e8c,_0x11ae06[_0x3bc2('0x3d')]);return db[_0x3bc2('0x27')][_0x3bc2('0x43')](_0x109e8c)['then'](handleEntityNotFound(_0xd1398f,null))[_0x3bc2('0x1d')](respondWithResult(_0xd1398f,null))[_0x3bc2('0x44')](handleError(_0xd1398f,null));};exports[_0x3bc2('0x45')]=function(_0x422ca0,_0x26b68b){return db[_0x3bc2('0x27')][_0x3bc2('0x45')](_0x422ca0[_0x3bc2('0x46')],{})[_0x3bc2('0x1d')](function(_0x530037){var _0x372f5d=_0x422ca0[_0x3bc2('0x47')][_0x3bc2('0x1e')]({'plain':!![]});if(!_0x372f5d)throw new Error(_0x3bc2('0x48'));if(_0x372f5d[_0x3bc2('0x49')]===_0x3bc2('0x47')){var _0x513ac6=_0x530037[_0x3bc2('0x1e')]({'plain':!![]});var _0x39dc3f=_0x3bc2('0x1f');return db[_0x3bc2('0x4a')][_0x3bc2('0x43')]({'where':{'name':_0x39dc3f,'userProfileId':_0x372f5d[_0x3bc2('0x4b')]},'raw':!![]})['then'](function(_0x21d4df){if(_0x21d4df&&_0x21d4df['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x513ac6[_0x3bc2('0x2c')],'resourceId':_0x513ac6['id'],'type':_0x21d4df['name'],'sectionId':_0x21d4df['id']},{})[_0x3bc2('0x1d')](function(){return _0x530037;});}else{return _0x530037;}})['catch'](function(_0x1c99a9){logger[_0x3bc2('0x23')](_0x3bc2('0x4c'),_0x1c99a9);throw _0x1c99a9;});}return _0x530037;})['then'](respondWithResult(_0x26b68b,0xc9))[_0x3bc2('0x44')](handleError(_0x26b68b,null));};exports['clone']=function(_0x3db688,_0x4da621){var _0x562932={'where':{'id':_0x3db688[_0x3bc2('0x42')]['id']}},_0x3da87b={};_0x3da87b[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db[_0x3bc2('0x27')][_0x3bc2('0x28')]);_0x562932[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0x3da87b[_0x3bc2('0x2b')],qs['fields'](_0x3db688[_0x3bc2('0x2d')][_0x3bc2('0x32')]));_0x562932[_0x3bc2('0x30')]=_0x562932['attributes'][_0x3bc2('0x33')]?_0x562932[_0x3bc2('0x30')]:_0x3da87b[_0x3bc2('0x2b')];if(_0x3db688[_0x3bc2('0x2d')]['includeAll']){_0x562932[_0x3bc2('0x3f')]=[{'all':!![]}];}_0x562932=_[_0x3bc2('0x3a')]({},_0x562932,_0x3db688[_0x3bc2('0x3d')]);return db[_0x3bc2('0x27')][_0x3bc2('0x43')](_0x562932)[_0x3bc2('0x1d')](handleEntityNotFound(_0x4da621,null))[_0x3bc2('0x1d')](function(_0x2ef720){if(_0x2ef720){var _0x274ddb=_0x2ef720[_0x3bc2('0x1e')]({'plain':!![]});_0x274ddb=qs['omit'](_0x274ddb,['id',_0x3bc2('0x4d'),_0x3bc2('0x4e')]);_0x3db688[_0x3bc2('0x46')]=_['omit'](_0x3db688[_0x3bc2('0x46')],['id',_0x3bc2('0x4d'),_0x3bc2('0x4e')]);return db[_0x3bc2('0x27')][_0x3bc2('0x45')](_[_0x3bc2('0x3a')](_0x274ddb,_0x3db688['body']),{'include':_0x3db688['query'][_0x3bc2('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x57996e){var _0x5350af=_0x3db688[_0x3bc2('0x47')][_0x3bc2('0x1e')]({'plain':!![]});if(!_0x5350af)throw new Error(_0x3bc2('0x48'));if(_0x5350af['role']===_0x3bc2('0x47')){var _0x3f71ba=_0x57996e['get']({'plain':!![]});var _0x5b6cf2=_0x3bc2('0x1f');return db['UserProfileSection'][_0x3bc2('0x43')]({'where':{'name':_0x5b6cf2,'userProfileId':_0x5350af[_0x3bc2('0x4b')]},'raw':!![]})[_0x3bc2('0x1d')](function(_0x2c4509){if(_0x2c4509&&_0x2c4509[_0x3bc2('0x4f')]===0x0){return db['UserProfileResource'][_0x3bc2('0x45')]({'name':_0x3f71ba[_0x3bc2('0x2c')],'resourceId':_0x3f71ba['id'],'type':_0x2c4509[_0x3bc2('0x2c')],'sectionId':_0x2c4509['id']},{})[_0x3bc2('0x1d')](function(){return _0x57996e;});}else{return _0x57996e;}})[_0x3bc2('0x44')](function(_0x226a99){logger['error'](_0x3bc2('0x4c'),_0x226a99);throw _0x226a99;});}return _0x57996e;});}})['then'](respondWithResult(_0x4da621,0xc9))[_0x3bc2('0x44')](handleError(_0x4da621,null));};exports[_0x3bc2('0x50')]=function(_0x597b69,_0x2ff71d){if(_0x597b69[_0x3bc2('0x46')]['id']){delete _0x597b69[_0x3bc2('0x46')]['id'];}return db[_0x3bc2('0x27')][_0x3bc2('0x43')]({'where':{'id':_0x597b69[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x2ff71d,null))[_0x3bc2('0x1d')](saveUpdates(_0x597b69[_0x3bc2('0x46')],null))[_0x3bc2('0x1d')](respondWithResult(_0x2ff71d,null))[_0x3bc2('0x44')](handleError(_0x2ff71d,null));};exports['destroy']=function(_0x82411f,_0x52f524){return db[_0x3bc2('0x27')][_0x3bc2('0x43')]({'where':{'id':_0x82411f[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x52f524,null))[_0x3bc2('0x1d')](removeEntity(_0x52f524,null))[_0x3bc2('0x44')](handleError(_0x52f524,null));};exports[_0x3bc2('0x51')]=function(_0x4e6501,_0x28aab8,_0x515ced){var _0x5e319c={'raw':!![],'where':{}};var _0x5cb5eb={};var _0x528a2e={'count':0x0,'rows':[]};return db[_0x3bc2('0x27')][_0x3bc2('0x52')]({'where':{'id':_0x4e6501['params']['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x28aab8,null))[_0x3bc2('0x1d')](function(_0x57e635){if(_0x57e635){_0x5cb5eb[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db['CmHopper']['rawAttributes']);_0x5cb5eb[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x4e6501[_0x3bc2('0x2d')]);_0x5cb5eb['filters']=_[_0x3bc2('0x31')](_0x5cb5eb[_0x3bc2('0x2b')],_0x5cb5eb[_0x3bc2('0x2d')]);_0x5e319c[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0x5cb5eb['model'],qs[_0x3bc2('0x32')](_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x32')]));_0x5e319c['attributes']=_0x5e319c[_0x3bc2('0x30')]['length']?_0x5e319c['attributes']:_0x5cb5eb[_0x3bc2('0x2b')];if(!_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x34')](_0x3bc2('0x35'))){_0x5e319c[_0x3bc2('0x18')]=qs[_0x3bc2('0x18')](_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x18')]);_0x5e319c[_0x3bc2('0x17')]=qs['offset'](_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x17')]);}_0x5e319c[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x5e319c[_0x3bc2('0x38')]=qs[_0x3bc2('0x2f')](_[_0x3bc2('0x39')](_0x4e6501[_0x3bc2('0x2d')],_0x5cb5eb[_0x3bc2('0x2f')]));_0x5e319c[_0x3bc2('0x38')][_0x3bc2('0x53')]=_0x57e635['id'];if(_0x4e6501['query'][_0x3bc2('0x3c')]){_0x5e319c[_0x3bc2('0x38')]=_[_0x3bc2('0x3a')](_0x5e319c[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x5e319c[_0x3bc2('0x30')],function(_0x182ad8){var _0x3e935c={};_0x3e935c[_0x182ad8]={'$like':'%'+_0x4e6501['query'][_0x3bc2('0x3c')]+'%'};return _0x3e935c;})});}_0x5e319c=_[_0x3bc2('0x3a')]({},_0x5e319c,_0x4e6501[_0x3bc2('0x3d')]);return db[_0x3bc2('0x54')][_0x3bc2('0x1a')]({'where':_0x5e319c[_0x3bc2('0x38')]})[_0x3bc2('0x1d')](function(_0x374a39){_0x528a2e['count']=_0x374a39;if(_0x4e6501[_0x3bc2('0x2d')][_0x3bc2('0x3e')]){_0x5e319c[_0x3bc2('0x3f')]=[{'all':!![]}];}return db[_0x3bc2('0x54')][_0x3bc2('0x55')](_0x5e319c);})[_0x3bc2('0x1d')](function(_0x3e7eb0){_0x528a2e[_0x3bc2('0x40')]=_0x3e7eb0;return _0x528a2e;});}})[_0x3bc2('0x1d')](respondWithFilteredResult(_0x28aab8,_0x5e319c))[_0x3bc2('0x44')](handleError(_0x28aab8,null));};exports[_0x3bc2('0x56')]=function(_0x55dbb3,_0x57c68f,_0x312db8){var _0xd8907e={'raw':!![],'where':{}};var _0x58d54b={};var _0x19c273={'count':0x0,'rows':[]};return db[_0x3bc2('0x27')][_0x3bc2('0x52')]({'where':{'id':_0x55dbb3[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x57c68f,null))[_0x3bc2('0x1d')](function(_0x2b6ec7){if(_0x2b6ec7){_0x58d54b[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db[_0x3bc2('0x57')][_0x3bc2('0x28')]);_0x58d54b[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x55dbb3[_0x3bc2('0x2d')]);_0x58d54b[_0x3bc2('0x2f')]=_['intersection'](_0x58d54b[_0x3bc2('0x2b')],_0x58d54b[_0x3bc2('0x2d')]);_0xd8907e[_0x3bc2('0x30')]=_['intersection'](_0x58d54b['model'],qs['fields'](_0x55dbb3[_0x3bc2('0x2d')][_0x3bc2('0x32')]));_0xd8907e[_0x3bc2('0x30')]=_0xd8907e[_0x3bc2('0x30')][_0x3bc2('0x33')]?_0xd8907e[_0x3bc2('0x30')]:_0x58d54b[_0x3bc2('0x2b')];if(!_0x55dbb3['query'][_0x3bc2('0x34')]('nolimit')){_0xd8907e[_0x3bc2('0x18')]=qs['limit'](_0x55dbb3['query']['limit']);_0xd8907e[_0x3bc2('0x17')]=qs[_0x3bc2('0x17')](_0x55dbb3['query']['offset']);}_0xd8907e[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x55dbb3['query'][_0x3bc2('0x37')]);_0xd8907e['where']=qs['filters'](_[_0x3bc2('0x39')](_0x55dbb3[_0x3bc2('0x2d')],_0x58d54b['filters']));_0xd8907e[_0x3bc2('0x38')][_0x3bc2('0x53')]=_0x2b6ec7['id'];if(_0x55dbb3['query'][_0x3bc2('0x3c')]){_0xd8907e[_0x3bc2('0x38')]=_['merge'](_0xd8907e['where'],{'$or':_[_0x3bc2('0x26')](_0xd8907e['attributes'],function(_0x21fdc1){var _0x1d8ed3={};_0x1d8ed3[_0x21fdc1]={'$like':'%'+_0x55dbb3['query'][_0x3bc2('0x3c')]+'%'};return _0x1d8ed3;})});}_0xd8907e=_['merge']({},_0xd8907e,_0x55dbb3[_0x3bc2('0x3d')]);return db[_0x3bc2('0x57')][_0x3bc2('0x1a')]({'where':_0xd8907e[_0x3bc2('0x38')]})[_0x3bc2('0x1d')](function(_0x44d5b4){_0x19c273['count']=_0x44d5b4;if(_0x55dbb3[_0x3bc2('0x2d')]['includeAll']){_0xd8907e['include']=[{'all':!![]}];}return db[_0x3bc2('0x57')][_0x3bc2('0x55')](_0xd8907e);})[_0x3bc2('0x1d')](function(_0x20e156){_0x19c273[_0x3bc2('0x40')]=_0x20e156;return _0x19c273;});}})['then'](respondWithFilteredResult(_0x57c68f,_0xd8907e))['catch'](handleError(_0x57c68f,null));};exports[_0x3bc2('0x58')]=function(_0x583cff,_0x1547b1,_0x833c0a){var _0x4a44be={'raw':!![],'where':{}};var _0x3679dd={};var _0x2017e8={'count':0x0,'rows':[]};return db['Campaign'][_0x3bc2('0x52')]({'where':{'id':_0x583cff['params']['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x1547b1,null))[_0x3bc2('0x1d')](function(_0x4853b5){if(_0x4853b5){_0x3679dd[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db[_0x3bc2('0x59')][_0x3bc2('0x28')]);_0x3679dd[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x583cff['query']);_0x3679dd[_0x3bc2('0x2f')]=_['intersection'](_0x3679dd[_0x3bc2('0x2b')],_0x3679dd[_0x3bc2('0x2d')]);_0x4a44be[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0x3679dd[_0x3bc2('0x2b')],qs[_0x3bc2('0x32')](_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x32')]));_0x4a44be[_0x3bc2('0x30')]=_0x4a44be[_0x3bc2('0x30')][_0x3bc2('0x33')]?_0x4a44be['attributes']:_0x3679dd[_0x3bc2('0x2b')];if(!_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x34')](_0x3bc2('0x35'))){_0x4a44be['limit']=qs[_0x3bc2('0x18')](_0x583cff['query'][_0x3bc2('0x18')]);_0x4a44be['offset']=qs['offset'](_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x17')]);}_0x4a44be[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x4a44be['where']=qs[_0x3bc2('0x2f')](_['pick'](_0x583cff[_0x3bc2('0x2d')],_0x3679dd[_0x3bc2('0x2f')]));_0x4a44be[_0x3bc2('0x38')]['CampaignId']=_0x4853b5['id'];if(_0x583cff[_0x3bc2('0x2d')]['filter']){_0x4a44be[_0x3bc2('0x38')]=_['merge'](_0x4a44be[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x4a44be[_0x3bc2('0x30')],function(_0xd90a7){var _0x59572e={};_0x59572e[_0xd90a7]={'$like':'%'+_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x3c')]+'%'};return _0x59572e;})});}_0x4a44be=_[_0x3bc2('0x3a')]({},_0x4a44be,_0x583cff[_0x3bc2('0x3d')]);return db[_0x3bc2('0x59')]['count']({'where':_0x4a44be[_0x3bc2('0x38')]})['then'](function(_0x22b469){_0x2017e8[_0x3bc2('0x1a')]=_0x22b469;if(_0x583cff[_0x3bc2('0x2d')][_0x3bc2('0x3e')]){_0x4a44be[_0x3bc2('0x3f')]=[{'all':!![]}];}return db[_0x3bc2('0x59')][_0x3bc2('0x55')](_0x4a44be);})[_0x3bc2('0x1d')](function(_0x146685){_0x2017e8[_0x3bc2('0x40')]=_0x146685;return _0x2017e8;});}})[_0x3bc2('0x1d')](respondWithFilteredResult(_0x1547b1,_0x4a44be))[_0x3bc2('0x44')](handleError(_0x1547b1,null));};exports[_0x3bc2('0x5a')]=function(_0x27c6bb,_0x491b35,_0x4ae115){var _0x377e26={'raw':!![],'where':{}};var _0x4e7055={};var _0x2d77bb={'count':0x0,'rows':[]};return db[_0x3bc2('0x27')][_0x3bc2('0x52')]({'where':{'id':_0x27c6bb[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x491b35,null))[_0x3bc2('0x1d')](function(_0x10125a){if(_0x10125a){_0x4e7055[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db[_0x3bc2('0x5b')][_0x3bc2('0x28')]);_0x4e7055[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x27c6bb[_0x3bc2('0x2d')]);_0x4e7055[_0x3bc2('0x2f')]=_['intersection'](_0x4e7055[_0x3bc2('0x2b')],_0x4e7055['query']);_0x377e26['attributes']=_[_0x3bc2('0x31')](_0x4e7055[_0x3bc2('0x2b')],qs[_0x3bc2('0x32')](_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x32')]));_0x377e26['attributes']=_0x377e26[_0x3bc2('0x30')]['length']?_0x377e26[_0x3bc2('0x30')]:_0x4e7055[_0x3bc2('0x2b')];if(!_0x27c6bb[_0x3bc2('0x2d')]['hasOwnProperty'](_0x3bc2('0x35'))){_0x377e26['limit']=qs['limit'](_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x18')]);_0x377e26[_0x3bc2('0x17')]=qs['offset'](_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x17')]);}_0x377e26[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x377e26[_0x3bc2('0x38')]=qs[_0x3bc2('0x2f')](_[_0x3bc2('0x39')](_0x27c6bb[_0x3bc2('0x2d')],_0x4e7055[_0x3bc2('0x2f')]));_0x377e26[_0x3bc2('0x38')][_0x3bc2('0x53')]=_0x10125a['id'];if(_0x27c6bb[_0x3bc2('0x2d')]['filter']){_0x377e26['where']=_[_0x3bc2('0x3a')](_0x377e26[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x377e26[_0x3bc2('0x30')],function(_0x50b911){var _0x3c441b={};_0x3c441b[_0x50b911]={'$like':'%'+_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x3c')]+'%'};return _0x3c441b;})});}_0x377e26=_[_0x3bc2('0x3a')]({},_0x377e26,_0x27c6bb[_0x3bc2('0x3d')]);return db[_0x3bc2('0x5b')][_0x3bc2('0x1a')]({'where':_0x377e26[_0x3bc2('0x38')]})[_0x3bc2('0x1d')](function(_0x53a1b1){_0x2d77bb[_0x3bc2('0x1a')]=_0x53a1b1;if(_0x27c6bb[_0x3bc2('0x2d')][_0x3bc2('0x3e')]){_0x377e26['include']=[{'all':!![]}];}return db[_0x3bc2('0x5b')][_0x3bc2('0x55')](_0x377e26);})[_0x3bc2('0x1d')](function(_0x461cda){_0x2d77bb['rows']=_0x461cda;return _0x2d77bb;});}})[_0x3bc2('0x1d')](respondWithFilteredResult(_0x491b35,_0x377e26))['catch'](handleError(_0x491b35,null));};exports[_0x3bc2('0x5c')]=function(_0x55f735,_0x1a8db3,_0x48fb27){var _0x44aad5={};var _0x27f04a={};var _0x48e5e9;var _0x5b360e;return db[_0x3bc2('0x27')]['findOne']({'where':{'id':_0x55f735[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x1a8db3,null))[_0x3bc2('0x1d')](function(_0x3a7fff){if(_0x3a7fff){_0x48e5e9=_0x3a7fff;_0x27f04a['model']=_[_0x3bc2('0x2e')](db['CmList'][_0x3bc2('0x28')]);_0x27f04a[_0x3bc2('0x2d')]=_[_0x3bc2('0x2e')](_0x55f735[_0x3bc2('0x2d')]);_0x27f04a['filters']=_[_0x3bc2('0x31')](_0x27f04a[_0x3bc2('0x2b')],_0x27f04a[_0x3bc2('0x2d')]);_0x44aad5[_0x3bc2('0x30')]=_['intersection'](_0x27f04a['model'],qs[_0x3bc2('0x32')](_0x55f735['query']['fields']));_0x44aad5[_0x3bc2('0x30')]=_0x44aad5[_0x3bc2('0x30')][_0x3bc2('0x33')]?_0x44aad5[_0x3bc2('0x30')]:_0x27f04a[_0x3bc2('0x2b')];_0x44aad5[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x55f735[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x44aad5['where']=qs[_0x3bc2('0x2f')](_[_0x3bc2('0x39')](_0x55f735[_0x3bc2('0x2d')],_0x27f04a[_0x3bc2('0x2f')]));if(_0x55f735[_0x3bc2('0x2d')][_0x3bc2('0x3c')]){_0x44aad5['where']=_[_0x3bc2('0x3a')](_0x44aad5[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x44aad5[_0x3bc2('0x30')],function(_0x1f3257){var _0x1e2090={};_0x1e2090[_0x1f3257]={'$like':'%'+_0x55f735['query'][_0x3bc2('0x3c')]+'%'};return _0x1e2090;})});}_0x44aad5=_[_0x3bc2('0x3a')]({},_0x44aad5,_0x55f735[_0x3bc2('0x3d')]);return _0x48e5e9[_0x3bc2('0x5c')](_0x44aad5);}})['then'](function(_0x21310c){if(_0x21310c){_0x5b360e=_0x21310c[_0x3bc2('0x33')];if(!_0x55f735[_0x3bc2('0x2d')][_0x3bc2('0x34')](_0x3bc2('0x35'))){_0x44aad5['limit']=qs['limit'](_0x55f735[_0x3bc2('0x2d')][_0x3bc2('0x18')]);_0x44aad5['offset']=qs[_0x3bc2('0x17')](_0x55f735['query'][_0x3bc2('0x17')]);}return _0x48e5e9[_0x3bc2('0x5c')](_0x44aad5);}})[_0x3bc2('0x1d')](function(_0xb9208d){if(_0xb9208d){return _0xb9208d?{'count':_0x5b360e,'rows':_0xb9208d}:null;}})[_0x3bc2('0x1d')](respondWithResult(_0x1a8db3,null))[_0x3bc2('0x44')](handleError(_0x1a8db3,null));};exports['addLists']=function(_0x55af22,_0x2c1c8b,_0x329516){var _0x839169,_0x9706d2;var _0x1c0d46=[];var _0x40364d=moment()[_0x3bc2('0x5d')](_0x3bc2('0x5e'));return db['Campaign']['find']({'where':{'id':_0x55af22[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x2c1c8b,null))[_0x3bc2('0x1d')](function(_0x2fca06){if(_0x2fca06){_0x9706d2=_0x2fca06;return _0x2fca06['addLists'](_0x55af22['body'][_0x3bc2('0x5f')],_[_0x3bc2('0x60')](_0x55af22[_0x3bc2('0x46')],[_0x3bc2('0x5f'),'id'])||{});}return null;})[_0x3bc2('0x61')](function(_0x356a8a){var _0x1ec041;var _0x477543;_0x839169=_0x356a8a||[];var _0x1622e2=[];if(_0x356a8a){for(var _0x4c7480=0x0;_0x4c7480<_0x356a8a[_0x3bc2('0x33')];_0x4c7480+=0x1){var _0x32f18f=_0x356a8a[_0x4c7480][_0x3bc2('0x1e')]({'plain':!![]});_0x9706d2[_0x3bc2('0x62')]=_0x55af22[_0x3bc2('0x46')]['dialCheckDuplicateType']?_0x55af22['body'][_0x3bc2('0x62')]:_0x9706d2[_0x3bc2('0x62')];switch(_0x9706d2[_0x3bc2('0x62')]){case _0x3bc2('0x63'):_0x1ec041=squel[_0x3bc2('0x64')]()[_0x3bc2('0x65')]('cm_hopper')[_0x3bc2('0x66')](['phone',_0x3bc2('0x67'),'ContactId','ListId',_0x3bc2('0x53'),_0x3bc2('0x4d'),_0x3bc2('0x4e')],squel['select']()[_0x3bc2('0x68')](_0x3bc2('0x69'),_0x3bc2('0x69'))[_0x3bc2('0x68')](_0x3bc2('0x6a'),_0x3bc2('0x67'))['field']('id',_0x3bc2('0x6b'))[_0x3bc2('0x68')](_0x32f18f[_0x3bc2('0x6c')]['toString'](),_0x3bc2('0x6d'))[_0x3bc2('0x68')](_0x55af22[_0x3bc2('0x42')]['id'][_0x3bc2('0x6e')](),_0x3bc2('0x53'))['field']('\x27'+_0x40364d+'\x27','createdAt')[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27','updatedAt')[_0x3bc2('0x6f')](_0x3bc2('0x70'))['where'](_0x3bc2('0x71'))[_0x3bc2('0x38')](_0x3bc2('0x72'),_0x32f18f[_0x3bc2('0x6c')]['toString']())[_0x3bc2('0x38')](_0x3bc2('0x73'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3bc2('0x74')]()['field'](_0x3bc2('0x75'))[_0x3bc2('0x6f')](_0x3bc2('0x76'))[_0x3bc2('0x38')](_0x3bc2('0x77'),_0x55af22[_0x3bc2('0x42')]['id'][_0x3bc2('0x6e')]()))[_0x3bc2('0x38')](_0x3bc2('0x78'),squel[_0x3bc2('0x74')]()[_0x3bc2('0x68')](_0x3bc2('0x79'))['from'](_0x3bc2('0x7a'))['where'](_0x3bc2('0x77'),_0x55af22[_0x3bc2('0x42')]['id'][_0x3bc2('0x6e')]())))[_0x3bc2('0x6e')]();break;case _0x3bc2('0x7b'):_0x1ec041=squel[_0x3bc2('0x64')]()[_0x3bc2('0x65')](_0x3bc2('0x7a'))['fromQuery']([_0x3bc2('0x69'),_0x3bc2('0x67'),'ContactId',_0x3bc2('0x6d'),_0x3bc2('0x53'),'createdAt',_0x3bc2('0x4e')],squel['select']()[_0x3bc2('0x68')](_0x3bc2('0x69'),_0x3bc2('0x69'))[_0x3bc2('0x68')]('NOW()','scheduledAt')[_0x3bc2('0x68')]('id','ContactId')[_0x3bc2('0x68')](_0x32f18f[_0x3bc2('0x6c')][_0x3bc2('0x6e')](),_0x3bc2('0x6d'))[_0x3bc2('0x68')](_0x55af22['params']['id']['toString'](),_0x3bc2('0x53'))[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27',_0x3bc2('0x4d'))[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27','updatedAt')[_0x3bc2('0x6f')]('cm_contacts')[_0x3bc2('0x38')](_0x3bc2('0x71'))[_0x3bc2('0x38')](_0x3bc2('0x72'),_0x32f18f['CmListId']['toString']())[_0x3bc2('0x38')](_0x3bc2('0x73'))[_0x3bc2('0x38')](_0x3bc2('0x78'),squel['select']()[_0x3bc2('0x68')](_0x3bc2('0x79'))[_0x3bc2('0x6f')](_0x3bc2('0x7a'))[_0x3bc2('0x38')](_0x3bc2('0x77'),_0x55af22['params']['id'][_0x3bc2('0x6e')]())))[_0x3bc2('0x6e')]();break;default:_0x1ec041=squel[_0x3bc2('0x64')]()[_0x3bc2('0x65')](_0x3bc2('0x7a'))[_0x3bc2('0x66')]([_0x3bc2('0x69'),'scheduledAt',_0x3bc2('0x6b'),'ListId',_0x3bc2('0x53'),_0x3bc2('0x4d'),_0x3bc2('0x4e')],squel['select']()['field'](_0x3bc2('0x69'),_0x3bc2('0x69'))['field'](_0x3bc2('0x6a'),'scheduledAt')[_0x3bc2('0x68')]('id',_0x3bc2('0x6b'))['field'](_0x32f18f[_0x3bc2('0x6c')][_0x3bc2('0x6e')](),_0x3bc2('0x6d'))[_0x3bc2('0x68')](_0x55af22['params']['id'][_0x3bc2('0x6e')](),_0x3bc2('0x53'))[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27','createdAt')[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27',_0x3bc2('0x4e'))['from'](_0x3bc2('0x70'))[_0x3bc2('0x38')](_0x3bc2('0x71'))[_0x3bc2('0x38')](_0x3bc2('0x72'),_0x32f18f['CmListId']['toString']())[_0x3bc2('0x38')](_0x3bc2('0x73')))[_0x3bc2('0x6e')]();}_0x477543=squel[_0x3bc2('0x64')]()[_0x3bc2('0x65')](_0x3bc2('0x7c'))[_0x3bc2('0x66')]([_0x3bc2('0x7d'),_0x3bc2('0x67'),_0x3bc2('0x69'),_0x3bc2('0x7e'),_0x3bc2('0x4d'),_0x3bc2('0x4e')],squel['select']()['field']('h.id','id')[_0x3bc2('0x68')](_0x3bc2('0x6a'),_0x3bc2('0x67'))[_0x3bc2('0x68')](_0x3bc2('0x7f'),_0x3bc2('0x69'))[_0x3bc2('0x68')]('ci.OrderBY',_0x3bc2('0x7e'))[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27',_0x3bc2('0x4d'))[_0x3bc2('0x68')]('\x27'+_0x40364d+'\x27','updatedAt')[_0x3bc2('0x6f')]('cm_contact_has_items','ci')[_0x3bc2('0x80')](_0x3bc2('0x7a'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x3bc2('0x38')](_0x3bc2('0x81'),_0x32f18f[_0x3bc2('0x6c')][_0x3bc2('0x6e')]())[_0x3bc2('0x38')]('h.CampaignId=?',_0x55af22[_0x3bc2('0x42')]['id'][_0x3bc2('0x6e')]())[_0x3bc2('0x38')]('h.createdAt\x20=\x20?',_0x40364d))[_0x3bc2('0x6e')]();_0x1622e2[_0x3bc2('0x82')](db[_0x3bc2('0x83')][_0x3bc2('0x2d')](_0x1ec041));_0x1c0d46['push'](db[_0x3bc2('0x83')]['query'](_0x477543));}return BPromise['all'](_0x1622e2);}})[_0x3bc2('0x1d')](function(){return BPromise[_0x3bc2('0x84')](_0x1c0d46);})[_0x3bc2('0x1d')](function(){return _0x839169;})[_0x3bc2('0x1d')](respondWithResult(_0x2c1c8b,null))[_0x3bc2('0x44')](handleError(_0x2c1c8b,null));};exports[_0x3bc2('0x85')]=function(_0x1b6f88,_0x230a0c,_0x1feaf1){return db[_0x3bc2('0x27')][_0x3bc2('0x43')]({'where':{'id':_0x1b6f88[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x230a0c,null))['then'](function(_0x166ce9){if(_0x166ce9){return _0x166ce9[_0x3bc2('0x85')](_0x1b6f88['query'][_0x3bc2('0x5f')]);}})[_0x3bc2('0x1d')](function(_0x4a3e0c){if(_0x4a3e0c){return db[_0x3bc2('0x54')]['destroy']({'where':{'ListId':_0x1b6f88[_0x3bc2('0x2d')]['ids'],'CampaignId':_0x1b6f88[_0x3bc2('0x42')]['id']}})['then'](function(){return _0x4a3e0c;});}})['then'](respondWithStatusCode(_0x230a0c,null))[_0x3bc2('0x44')](handleError(_0x230a0c,null));};exports[_0x3bc2('0x86')]=function(_0x2b35b8,_0x1ab7a4,_0xec50df){var _0x298738={};var _0x32c802={};var _0x50d3cb;var _0x929981;return db[_0x3bc2('0x27')][_0x3bc2('0x52')]({'where':{'id':_0x2b35b8[_0x3bc2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ab7a4,null))[_0x3bc2('0x1d')](function(_0x43b876){if(_0x43b876){_0x50d3cb=_0x43b876;_0x32c802[_0x3bc2('0x2b')]=_[_0x3bc2('0x2e')](db[_0x3bc2('0x87')]['rawAttributes']);_0x32c802['query']=_[_0x3bc2('0x2e')](_0x2b35b8[_0x3bc2('0x2d')]);_0x32c802[_0x3bc2('0x2f')]=_[_0x3bc2('0x31')](_0x32c802[_0x3bc2('0x2b')],_0x32c802[_0x3bc2('0x2d')]);_0x298738[_0x3bc2('0x30')]=_[_0x3bc2('0x31')](_0x32c802['model'],qs[_0x3bc2('0x32')](_0x2b35b8[_0x3bc2('0x2d')]['fields']));_0x298738['attributes']=_0x298738[_0x3bc2('0x30')]['length']?_0x298738[_0x3bc2('0x30')]:_0x32c802[_0x3bc2('0x2b')];_0x298738[_0x3bc2('0x36')]=qs[_0x3bc2('0x37')](_0x2b35b8[_0x3bc2('0x2d')][_0x3bc2('0x37')]);_0x298738['where']=qs[_0x3bc2('0x2f')](_['pick'](_0x2b35b8[_0x3bc2('0x2d')],_0x32c802[_0x3bc2('0x2f')]));if(_0x2b35b8['query'][_0x3bc2('0x3c')]){_0x298738['where']=_[_0x3bc2('0x3a')](_0x298738[_0x3bc2('0x38')],{'$or':_[_0x3bc2('0x26')](_0x298738[_0x3bc2('0x30')],function(_0x18f1e5){var _0x59aa9a={};_0x59aa9a[_0x18f1e5]={'$like':'%'+_0x2b35b8[_0x3bc2('0x2d')]['filter']+'%'};return _0x59aa9a;})});}_0x298738=_[_0x3bc2('0x3a')]({},_0x298738,_0x2b35b8[_0x3bc2('0x3d')]);return _0x50d3cb[_0x3bc2('0x86')](_0x298738);}})[_0x3bc2('0x1d')](function(_0xe8f3b1){if(_0xe8f3b1){_0x929981=_0xe8f3b1[_0x3bc2('0x33')];if(!_0x2b35b8[_0x3bc2('0x2d')]['hasOwnProperty'](_0x3bc2('0x35'))){_0x298738[_0x3bc2('0x18')]=qs[_0x3bc2('0x18')](_0x2b35b8['query'][_0x3bc2('0x18')]);_0x298738[_0x3bc2('0x17')]=qs[_0x3bc2('0x17')](_0x2b35b8[_0x3bc2('0x2d')]['offset']);}return _0x50d3cb['getBlackLists'](_0x298738);}})[_0x3bc2('0x1d')](function(_0x33dbbf){if(_0x33dbbf){return _0x33dbbf?{'count':_0x929981,'rows':_0x33dbbf}:null;}})['then'](respondWithResult(_0x1ab7a4,null))[_0x3bc2('0x44')](handleError(_0x1ab7a4,null));};exports['addBlackLists']=function(_0x4cdb35,_0x1ee2d5,_0x422542){var _0x2d44e2,_0x11e4b5;var _0x4a2ac8=[];var _0x2d87ed=moment()['format'](_0x3bc2('0x5e'));return db[_0x3bc2('0x27')][_0x3bc2('0x43')]({'where':{'id':_0x4cdb35[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x1ee2d5,null))[_0x3bc2('0x1d')](function(_0x30e639){if(_0x30e639){_0x11e4b5=_0x30e639;return _0x30e639[_0x3bc2('0x88')](_0x4cdb35[_0x3bc2('0x46')][_0x3bc2('0x5f')],_['omit'](_0x4cdb35[_0x3bc2('0x46')],[_0x3bc2('0x5f'),'id'])||{});}return null;})[_0x3bc2('0x61')](function(_0x54a8ce){var _0x57cc1c;var _0x9950c5;_0x2d44e2=_0x54a8ce||[];var _0x3d3ebb=[];if(_0x54a8ce){for(var _0x54b94a=0x0;_0x54b94a<_0x54a8ce[_0x3bc2('0x33')];_0x54b94a+=0x1){var _0x282a21=_0x54a8ce[_0x54b94a][_0x3bc2('0x1e')]({'plain':!![]});_0x57cc1c=squel['insert']()[_0x3bc2('0x65')]('cm_hopper_black')[_0x3bc2('0x66')]([_0x3bc2('0x69'),_0x3bc2('0x6b'),_0x3bc2('0x6d'),_0x3bc2('0x53'),_0x3bc2('0x4d'),_0x3bc2('0x4e')],squel[_0x3bc2('0x74')]()[_0x3bc2('0x68')](_0x3bc2('0x69'),'phone')['field']('id','ContactId')['field'](_0x282a21[_0x3bc2('0x6c')][_0x3bc2('0x6e')](),_0x3bc2('0x6d'))['field'](_0x4cdb35[_0x3bc2('0x42')]['id'][_0x3bc2('0x6e')](),_0x3bc2('0x53'))[_0x3bc2('0x68')](_0x3bc2('0x6a'),_0x3bc2('0x4d'))[_0x3bc2('0x68')](_0x3bc2('0x6a'),'updatedAt')[_0x3bc2('0x6f')](_0x3bc2('0x70'))[_0x3bc2('0x38')](_0x3bc2('0x71'))[_0x3bc2('0x38')]('ListId\x20=\x20?',_0x282a21[_0x3bc2('0x6c')][_0x3bc2('0x6e')]())[_0x3bc2('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x3bc2('0x6e')]();_0x3d3ebb[_0x3bc2('0x82')](db['sequelize'][_0x3bc2('0x2d')](_0x57cc1c));}return BPromise[_0x3bc2('0x84')](_0x3d3ebb);}})[_0x3bc2('0x1d')](function(){return _0x2d44e2;})[_0x3bc2('0x1d')](respondWithResult(_0x1ee2d5,null))[_0x3bc2('0x44')](handleError(_0x1ee2d5,null));};exports[_0x3bc2('0x89')]=function(_0x3ffd80,_0x4faac3,_0x45f7e2){return db[_0x3bc2('0x27')][_0x3bc2('0x43')]({'where':{'id':_0x3ffd80[_0x3bc2('0x42')]['id']}})[_0x3bc2('0x1d')](handleEntityNotFound(_0x4faac3,null))[_0x3bc2('0x1d')](function(_0x147bef){if(_0x147bef){return _0x147bef[_0x3bc2('0x89')](_0x3ffd80['query'][_0x3bc2('0x5f')]);}})['then'](function(_0x261942){if(_0x261942){return db[_0x3bc2('0x5b')][_0x3bc2('0x1c')]({'where':{'ListId':_0x3ffd80[_0x3bc2('0x2d')]['ids'],'CampaignId':_0x3ffd80[_0x3bc2('0x42')]['id']}})['then'](function(){return _0x261942;});}})[_0x3bc2('0x1d')](respondWithStatusCode(_0x4faac3,null))[_0x3bc2('0x44')](handleError(_0x4faac3,null));};
\ No newline at end of file
index 06da272..f85527e 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(_0x1a7ae3,_0x2727b9){var _0x4d8d56=function(_0x4a5537){while(--_0x4a5537){_0x1a7ae3['push'](_0x1a7ae3['shift']());}};_0x4d8d56(++_0x2727b9);}(_0x7a54,0x106));var _0x47a5=function(_0x414345,_0x3320d5){_0x414345=_0x414345-0x0;var _0x11653f=_0x7a54[_0x414345];return _0x11653f;};'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(_0x39439f,_0x5de32c){var _0x5bb4d7=function(_0x4dfe56){while(--_0x4dfe56){_0x39439f['push'](_0x39439f['shift']());}};_0x5bb4d7(++_0x5de32c);}(_0x7a54,0x106));var _0x47a5=function(_0x2cbab1,_0x115fff){_0x2cbab1=_0x2cbab1-0x0;var _0x450f48=_0x7a54[_0x2cbab1];return _0x450f48;};'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 777edfe..f40adac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbefe=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','util','bluebird','randomstring'];(function(_0x35c9d9,_0x1ebe65){var _0x3cb664=function(_0x3cc52e){while(--_0x3cc52e){_0x35c9d9['push'](_0x35c9d9['shift']());}};_0x3cb664(++_0x1ebe65);}(_0xbefe,0x168));var _0xebef=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0xbefe[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require('lodash');var util=require(_0xebef('0x0'));var moment=require('moment');var BPromise=require(_0xebef('0x1'));var rs=require(_0xebef('0x2'));var fs=require('fs');var Redis=require(_0xebef('0x3'));var db=require(_0xebef('0x4'))['db'];var utils=require(_0xebef('0x5'));var logger=require(_0xebef('0x6'))(_0xebef('0x7'));var config=require(_0xebef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xebef('0x9')][_0xebef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e89ca,_0x4fb4fa,_0x4286bf){return new BPromise(function(_0x2fbd2c,_0x598d6d){return client['request'](_0x3e89ca,_0x4286bf)[_0xebef('0xb')](function(_0xa0a8ef){logger[_0xebef('0xc')](_0xebef('0xd'),_0x4fb4fa,_0xebef('0xe'));logger[_0xebef('0xf')](_0xebef('0x10'),_0x4fb4fa,_0xebef('0xe'),JSON['stringify'](_0xa0a8ef));if(_0xa0a8ef[_0xebef('0x11')]){if(_0xa0a8ef[_0xebef('0x11')][_0xebef('0x12')]===0x1f4){logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0xa0a8ef['error']['message']);return _0x598d6d(_0xa0a8ef['error']['message']);}logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0xa0a8ef[_0xebef('0x11')][_0xebef('0x13')]);return _0x2fbd2c(_0xa0a8ef[_0xebef('0x11')][_0xebef('0x13')]);}else{logger['info'](_0xebef('0xd'),_0x4fb4fa,_0xebef('0xe'));_0x2fbd2c(_0xa0a8ef[_0xebef('0x14')][_0xebef('0x13')]);}})[_0xebef('0x15')](function(_0x8e7044){logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0x8e7044);_0x598d6d(_0x8e7044);});});}exports[_0xebef('0x16')]=function(_0x16856f){var _0x458e83=this;return new Promise(function(_0x5161f1,_0x1a99ba){return db[_0xebef('0x17')][_0xebef('0x18')]({'raw':_0x16856f['options']?_0x16856f[_0xebef('0x19')][_0xebef('0x1a')]===undefined?!![]:![]:!![],'where':_0x16856f[_0xebef('0x19')]?_0x16856f[_0xebef('0x19')][_0xebef('0x1b')]||null:null,'attributes':_0x16856f[_0xebef('0x19')]?_0x16856f[_0xebef('0x19')]['attributes']||null:null,'limit':_0x16856f['options']?_0x16856f['options'][_0xebef('0x1c')]||null:null,'include':_0x16856f[_0xebef('0x19')]?_0x16856f[_0xebef('0x19')][_0xebef('0x1d')]?_[_0xebef('0x1e')](_0x16856f[_0xebef('0x19')][_0xebef('0x1d')],function(_0x5c5091){return{'model':db[_0x5c5091[_0xebef('0x1f')]],'as':_0x5c5091['as'],'attributes':_0x5c5091[_0xebef('0x20')],'include':_0x5c5091[_0xebef('0x1d')]?_[_0xebef('0x1e')](_0x5c5091[_0xebef('0x1d')],function(_0x27f212){return{'model':db[_0x27f212[_0xebef('0x1f')]],'as':_0x27f212['as'],'attributes':_0x27f212[_0xebef('0x20')],'include':_0x27f212[_0xebef('0x1d')]?_[_0xebef('0x1e')](_0x27f212[_0xebef('0x1d')],function(_0x4fb77f){return{'model':db[_0x4fb77f[_0xebef('0x1f')]],'as':_0x4fb77f['as'],'attributes':_0x4fb77f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56b67e){logger['info']('GetCampaign',_0x16856f);logger['debug']('GetCampaign',_0x16856f,JSON['stringify'](_0x56b67e));_0x5161f1(_0x56b67e);})['catch'](function(_0x5a9249){logger['error'](_0xebef('0x16'),_0x5a9249['message'],_0x16856f);_0x1a99ba(_0x458e83[_0xebef('0x11')](0x1f4,_0x5a9249['message']));});});};
\ No newline at end of file
+var _0x6a00=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','model','include','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0xb91078,_0x3cdfc5){var _0x7dba67=function(_0x17f013){while(--_0x17f013){_0xb91078['push'](_0xb91078['shift']());}};_0x7dba67(++_0x3cdfc5);}(_0x6a00,0xc9));var _0x06a0=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x6a00[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x06a0('0x0'));var util=require(_0x06a0('0x1'));var moment=require('moment');var BPromise=require(_0x06a0('0x2'));var rs=require(_0x06a0('0x3'));var fs=require('fs');var Redis=require(_0x06a0('0x4'));var db=require(_0x06a0('0x5'))['db'];var utils=require(_0x06a0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x06a0('0x7'));var jayson=require(_0x06a0('0x8'));var client=jayson[_0x06a0('0x9')][_0x06a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa78ab8,_0x1b8019,_0x51dc49){return new BPromise(function(_0xac416d,_0x22d146){return client[_0x06a0('0xb')](_0xa78ab8,_0x51dc49)[_0x06a0('0xc')](function(_0x38a7d3){logger[_0x06a0('0xd')](_0x06a0('0xe'),_0x1b8019,_0x06a0('0xf'));logger[_0x06a0('0x10')](_0x06a0('0x11'),_0x1b8019,_0x06a0('0xf'),JSON['stringify'](_0x38a7d3));if(_0x38a7d3['error']){if(_0x38a7d3[_0x06a0('0x12')][_0x06a0('0x13')]===0x1f4){logger[_0x06a0('0x12')](_0x06a0('0xe'),_0x1b8019,_0x38a7d3[_0x06a0('0x12')][_0x06a0('0x14')]);return _0x22d146(_0x38a7d3[_0x06a0('0x12')][_0x06a0('0x14')]);}logger['error'](_0x06a0('0xe'),_0x1b8019,_0x38a7d3[_0x06a0('0x12')][_0x06a0('0x14')]);return _0xac416d(_0x38a7d3['error'][_0x06a0('0x14')]);}else{logger[_0x06a0('0xd')](_0x06a0('0xe'),_0x1b8019,'request\x20sent');_0xac416d(_0x38a7d3[_0x06a0('0x15')][_0x06a0('0x14')]);}})['catch'](function(_0x578f39){logger[_0x06a0('0x12')](_0x06a0('0xe'),_0x1b8019,_0x578f39);_0x22d146(_0x578f39);});});}exports[_0x06a0('0x16')]=function(_0x3d8836){var _0x57064e=this;return new Promise(function(_0x3b6e74,_0x3f16fa){return db[_0x06a0('0x17')][_0x06a0('0x18')]({'raw':_0x3d8836[_0x06a0('0x19')]?_0x3d8836[_0x06a0('0x19')][_0x06a0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d8836[_0x06a0('0x19')]?_0x3d8836[_0x06a0('0x19')][_0x06a0('0x1b')]||null:null,'attributes':_0x3d8836['options']?_0x3d8836[_0x06a0('0x19')][_0x06a0('0x1c')]||null:null,'limit':_0x3d8836[_0x06a0('0x19')]?_0x3d8836[_0x06a0('0x19')][_0x06a0('0x1d')]||null:null,'include':_0x3d8836[_0x06a0('0x19')]?_0x3d8836['options']['include']?_[_0x06a0('0x1e')](_0x3d8836[_0x06a0('0x19')]['include'],function(_0x151c35){return{'model':db[_0x151c35[_0x06a0('0x1f')]],'as':_0x151c35['as'],'attributes':_0x151c35[_0x06a0('0x1c')],'include':_0x151c35['include']?_[_0x06a0('0x1e')](_0x151c35[_0x06a0('0x20')],function(_0x4a7fff){return{'model':db[_0x4a7fff['model']],'as':_0x4a7fff['as'],'attributes':_0x4a7fff['attributes'],'include':_0x4a7fff[_0x06a0('0x20')]?_[_0x06a0('0x1e')](_0x4a7fff[_0x06a0('0x20')],function(_0x26f605){return{'model':db[_0x26f605[_0x06a0('0x1f')]],'as':_0x26f605['as'],'attributes':_0x26f605[_0x06a0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06a0('0xc')](function(_0x123958){logger[_0x06a0('0xd')]('GetCampaign',_0x3d8836);logger[_0x06a0('0x10')]('GetCampaign',_0x3d8836,JSON[_0x06a0('0x21')](_0x123958));_0x3b6e74(_0x123958);})[_0x06a0('0x22')](function(_0x18b359){logger[_0x06a0('0x12')](_0x06a0('0x16'),_0x18b359[_0x06a0('0x14')],_0x3d8836);_0x3f16fa(_0x57064e[_0x06a0('0x12')](0x1f4,_0x18b359[_0x06a0('0x14')]));});});};
\ No newline at end of file
index b2ab347..240791f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x923c=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','create','clone','/:id/blacklists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','fs-extra','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers'];(function(_0x1c3068,_0x24d3f2){var _0x47885c=function(_0x494002){while(--_0x494002){_0x1c3068['push'](_0x1c3068['shift']());}};_0x47885c(++_0x24d3f2);}(_0x923c,0x198));var _0xc923=function(_0xc9c9c5,_0x4832fc){_0xc9c9c5=_0xc9c9c5-0x0;var _0x4d3c2c=_0x923c[_0xc9c9c5];return _0x4d3c2c;};'use strict';var multer=require(_0xc923('0x0'));var util=require('util');var path=require(_0xc923('0x1'));var timeout=require(_0xc923('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc923('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc923('0x4'));var controller=require(_0xc923('0x5'));router['get']('/',auth[_0xc923('0x6')](),controller[_0xc923('0x7')]);router[_0xc923('0x8')](_0xc923('0x9'),auth[_0xc923('0x6')](),controller[_0xc923('0xa')]);router[_0xc923('0x8')](_0xc923('0xb'),auth[_0xc923('0x6')](),controller['getHoppers']);router[_0xc923('0x8')](_0xc923('0xc'),auth[_0xc923('0x6')](),controller['getHopperHistories']);router[_0xc923('0x8')](_0xc923('0xd'),auth[_0xc923('0x6')](),controller[_0xc923('0xe')]);router['get'](_0xc923('0xf'),auth[_0xc923('0x6')](),controller['getHopperBlacks']);router[_0xc923('0x8')](_0xc923('0x10'),auth[_0xc923('0x6')](),controller[_0xc923('0x11')]);router[_0xc923('0x8')]('/:id/blacklists',auth[_0xc923('0x6')](),controller[_0xc923('0x12')]);router[_0xc923('0x13')]('/',auth[_0xc923('0x6')](),controller[_0xc923('0x14')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xc923('0x15')]);router[_0xc923('0x13')](_0xc923('0x10'),auth[_0xc923('0x6')](),controller['addLists']);router[_0xc923('0x13')](_0xc923('0x16'),auth[_0xc923('0x6')](),controller[_0xc923('0x17')]);router[_0xc923('0x18')](_0xc923('0x9'),auth[_0xc923('0x6')](),controller['update']);router[_0xc923('0x19')](_0xc923('0x9'),auth[_0xc923('0x6')](),controller[_0xc923('0x1a')]);router[_0xc923('0x19')](_0xc923('0x10'),auth[_0xc923('0x6')](),controller[_0xc923('0x1b')]);router[_0xc923('0x19')](_0xc923('0x16'),auth[_0xc923('0x6')](),controller[_0xc923('0x1c')]);module[_0xc923('0x1d')]=router;
\ No newline at end of file
+var _0xbb3e=['isAuthenticated','index','/:id','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller'];(function(_0x1cceb0,_0xcb90da){var _0xd074ee=function(_0xc59eb){while(--_0xc59eb){_0x1cceb0['push'](_0x1cceb0['shift']());}};_0xd074ee(++_0xcb90da);}(_0xbb3e,0x116));var _0xebb3=function(_0x525c20,_0x3dbd7b){_0x525c20=_0x525c20-0x0;var _0xdf69ed=_0xbb3e[_0x525c20];return _0xdf69ed;};'use strict';var multer=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var path=require(_0xebb3('0x2'));var timeout=require(_0xebb3('0x3'));var express=require(_0xebb3('0x4'));var router=express[_0xebb3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xebb3('0x6'));var interaction=require(_0xebb3('0x7'));var config=require(_0xebb3('0x8'));var controller=require(_0xebb3('0x9'));router['get']('/',auth[_0xebb3('0xa')](),controller[_0xebb3('0xb')]);router['get'](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller[_0xebb3('0xd')]);router[_0xebb3('0xe')](_0xebb3('0xf'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x10')]);router[_0xebb3('0xe')](_0xebb3('0x11'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x12')]);router[_0xebb3('0xe')](_0xebb3('0x13'),auth[_0xebb3('0xa')](),controller['getHopperFinals']);router['get'](_0xebb3('0x14'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x15')]);router['get'](_0xebb3('0x16'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x17')]);router[_0xebb3('0xe')](_0xebb3('0x18'),auth[_0xebb3('0xa')](),controller['getBlackLists']);router[_0xebb3('0x19')]('/',auth[_0xebb3('0xa')](),controller[_0xebb3('0x1a')]);router[_0xebb3('0x19')](_0xebb3('0x1b'),auth[_0xebb3('0xa')](),controller['clone']);router[_0xebb3('0x19')](_0xebb3('0x16'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x1c')]);router[_0xebb3('0x19')](_0xebb3('0x18'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x1d')]);router[_0xebb3('0x1e')](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller['update']);router['delete'](_0xebb3('0xc'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x1f')]);router['delete'](_0xebb3('0x16'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x20')]);router[_0xebb3('0x21')](_0xebb3('0x18'),auth[_0xebb3('0xa')](),controller[_0xebb3('0x22')]);module[_0xebb3('0x23')]=router;
\ No newline at end of file
index 2b5c440..d2d13c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b0=['sequelize','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x25948f,_0x4ac7e4){var _0x2b1976=function(_0x1ee63a){while(--_0x1ee63a){_0x25948f['push'](_0x25948f['shift']());}};_0x2b1976(++_0x4ac7e4);}(_0xa1b0,0x72));var _0x0a1b=function(_0x27c3cd,_0x34718c){_0x27c3cd=_0x27c3cd-0x0;var _0x3b8ac7=_0xa1b0[_0x27c3cd];return _0x3b8ac7;};'use strict';var Sequelize=require(_0x0a1b('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x0a1b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0a1b('0x2')]},'name':{'type':Sequelize[_0x0a1b('0x3')],'get':function(){return this[_0x0a1b('0x4')](_0x0a1b('0x5'));}}};
\ No newline at end of file
+var _0xbe7c=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x385839,_0xd8020d){var _0x3629f5=function(_0x5aac11){while(--_0x5aac11){_0x385839['push'](_0x385839['shift']());}};_0x3629f5(++_0xd8020d);}(_0xbe7c,0x136));var _0xcbe7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe7c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcbe7('0x0'));module[_0xcbe7('0x1')]={'key':{'type':Sequelize[_0xcbe7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xcbe7('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xcbe7('0x2')]},'name':{'type':Sequelize[_0xcbe7('0x4')],'get':function(){return this['getDataValue'](_0xcbe7('0x5'));}}};
\ No newline at end of file
index 844a257..32440b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ff=['rawAttributes','intersection','includeAll','merge','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','get','role','user','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','UserProfileResource','error','name','send','map','fieldName','key','query','filters','model','attributes','fields','nolimit','sort','filter','where','options','include','CannedAnswer','rows','catch','show','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ff,0x16a));var _0xf55f=function(_0x1c2434,_0x28868c){_0x1c2434=_0x1c2434-0x0;var _0x3a601=_0x55ff[_0x1c2434];return _0x3a601;};'use strict';var emlformat=require(_0xf55f('0x0'));var rimraf=require(_0xf55f('0x1'));var zipdir=require(_0xf55f('0x2'));var jsonpatch=require(_0xf55f('0x3'));var rp=require(_0xf55f('0x4'));var moment=require('moment');var BPromise=require(_0xf55f('0x5'));var Mustache=require(_0xf55f('0x6'));var util=require(_0xf55f('0x7'));var path=require(_0xf55f('0x8'));var sox=require('sox');var csv=require(_0xf55f('0x9'));var ejs=require(_0xf55f('0xa'));var fs=require('fs');var fs_extra=require(_0xf55f('0xb'));var _=require('lodash');var squel=require(_0xf55f('0xc'));var crypto=require(_0xf55f('0xd'));var jsforce=require(_0xf55f('0xe'));var deskjs=require(_0xf55f('0xf'));var toCsv=require(_0xf55f('0x9'));var querystring=require(_0xf55f('0x10'));var Papa=require('papaparse');var Redis=require(_0xf55f('0x11'));var authService=require(_0xf55f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf55f('0x13'));var hardwareService=require(_0xf55f('0x14'));var logger=require(_0xf55f('0x15'))(_0xf55f('0x16'));var utils=require(_0xf55f('0x17'));var config=require(_0xf55f('0x18'));var licenseUtil=require(_0xf55f('0x19'));var db=require(_0xf55f('0x1a'))['db'];function respondWithStatusCode(_0x1c0b7f,_0xce687d){_0xce687d=_0xce687d||0xcc;return function(_0x198ef3){if(_0x198ef3){return _0x1c0b7f[_0xf55f('0x1b')](_0xce687d);}return _0x1c0b7f[_0xf55f('0x1c')](_0xce687d)[_0xf55f('0x1d')]();};}function respondWithResult(_0x10889c,_0xf88cbb){_0xf88cbb=_0xf88cbb||0xc8;return function(_0x3122b6){if(_0x3122b6){return _0x10889c[_0xf55f('0x1c')](_0xf88cbb)['json'](_0x3122b6);}};}function respondWithFilteredResult(_0x52113a,_0x8edcd8){return function(_0x189b63){if(_0x189b63){var _0x3c0e78=typeof _0x8edcd8[_0xf55f('0x1e')]===_0xf55f('0x1f')&&typeof _0x8edcd8[_0xf55f('0x20')]===_0xf55f('0x1f');var _0x1c99de=_0x189b63[_0xf55f('0x21')];var _0x4052df=_0x3c0e78?0x0:_0x8edcd8['offset'];var _0xaaed9=_0x3c0e78?_0x189b63['count']:_0x8edcd8[_0xf55f('0x1e')]+_0x8edcd8['limit'];var _0x47bfeb;if(_0xaaed9>=_0x1c99de){_0xaaed9=_0x1c99de;_0x47bfeb=0xc8;}else{_0x47bfeb=0xce;}_0x52113a[_0xf55f('0x1c')](_0x47bfeb);return _0x52113a['set'](_0xf55f('0x22'),_0x4052df+'-'+_0xaaed9+'/'+_0x1c99de)[_0xf55f('0x23')](_0x189b63);}return null;};}function patchUpdates(_0x51b4e2){return function(_0x2f2ae6){try{jsonpatch[_0xf55f('0x24')](_0x2f2ae6,_0x51b4e2,!![]);}catch(_0x1d9f3b){return BPromise[_0xf55f('0x25')](_0x1d9f3b);}return _0x2f2ae6['save']();};}function saveUpdates(_0x29cb2a,_0x15691d){return function(_0x5c526f){if(_0x5c526f){return _0x5c526f['update'](_0x29cb2a)[_0xf55f('0x26')](function(_0x42aabc){return _0x42aabc;});}return null;};}function removeEntity(_0xca23db,_0x5efd7c){return function(_0x3ac57b){if(_0x3ac57b){return _0x3ac57b[_0xf55f('0x27')]()['then'](function(){var _0x3293c3=_0x3ac57b['get']({'plain':!![]});var _0x431630='CannedAnswers';return db[_0xf55f('0x28')][_0xf55f('0x27')]({'where':{'type':_0x431630,'resourceId':_0x3293c3['id']}})[_0xf55f('0x26')](function(){return _0x3ac57b;});})[_0xf55f('0x26')](function(){_0xca23db[_0xf55f('0x1c')](0xcc)[_0xf55f('0x1d')]();});}};}function handleEntityNotFound(_0x183a19,_0x573875){return function(_0x55fd51){if(!_0x55fd51){_0x183a19['sendStatus'](0x194);}return _0x55fd51;};}function handleError(_0x44356a,_0x242cf6){_0x242cf6=_0x242cf6||0x1f4;return function(_0x58e044){logger[_0xf55f('0x29')](_0x58e044['stack']);if(_0x58e044[_0xf55f('0x2a')]){delete _0x58e044[_0xf55f('0x2a')];}_0x44356a[_0xf55f('0x1c')](_0x242cf6)[_0xf55f('0x2b')](_0x58e044);};}exports['index']=function(_0xc9c466,_0x507aab){var _0x3b4259={},_0x16ea84={},_0x4535fa={'count':0x0,'rows':[]};var _0x3a73b1=_[_0xf55f('0x2c')](db['CannedAnswer']['rawAttributes'],function(_0x30e0a9){return{'name':_0x30e0a9[_0xf55f('0x2d')],'type':_0x30e0a9['type'][_0xf55f('0x2e')]};});_0x16ea84['model']=_[_0xf55f('0x2c')](_0x3a73b1,_0xf55f('0x2a'));_0x16ea84[_0xf55f('0x2f')]=_['keys'](_0xc9c466[_0xf55f('0x2f')]);_0x16ea84[_0xf55f('0x30')]=_['intersection'](_0x16ea84[_0xf55f('0x31')],_0x16ea84[_0xf55f('0x2f')]);_0x3b4259[_0xf55f('0x32')]=_['intersection'](_0x16ea84[_0xf55f('0x31')],qs['fields'](_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x33')]));_0x3b4259[_0xf55f('0x32')]=_0x3b4259[_0xf55f('0x32')]['length']?_0x3b4259['attributes']:_0x16ea84[_0xf55f('0x31')];if(!_0xc9c466[_0xf55f('0x2f')]['hasOwnProperty'](_0xf55f('0x34'))){_0x3b4259[_0xf55f('0x20')]=qs[_0xf55f('0x20')](_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x20')]);_0x3b4259[_0xf55f('0x1e')]=qs[_0xf55f('0x1e')](_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x1e')]);}_0x3b4259['order']=qs[_0xf55f('0x35')](_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x35')]);_0x3b4259['where']=qs[_0xf55f('0x30')](_['pick'](_0xc9c466[_0xf55f('0x2f')],_0x16ea84['filters']),_0x3a73b1);if(_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x36')]){_0x3b4259[_0xf55f('0x37')]=_['merge'](_0x3b4259[_0xf55f('0x37')],{'$or':[{'key':{'$like':'%'+_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x36')]+'%'}},{'value':{'$like':'%'+_0xc9c466[_0xf55f('0x2f')][_0xf55f('0x36')]+'%'}}]});}_0x3b4259=_['merge']({},_0x3b4259,_0xc9c466[_0xf55f('0x38')]);var _0x336fbc={'where':_0x3b4259[_0xf55f('0x37')]};return db['CannedAnswer'][_0xf55f('0x21')](_0x336fbc)[_0xf55f('0x26')](function(_0x35ed89){_0x4535fa[_0xf55f('0x21')]=_0x35ed89;if(_0xc9c466['query']['includeAll']){_0x3b4259[_0xf55f('0x39')]=[{'all':!![]}];}return db[_0xf55f('0x3a')]['findAll'](_0x3b4259);})[_0xf55f('0x26')](function(_0x12f62b){_0x4535fa[_0xf55f('0x3b')]=_0x12f62b;return _0x4535fa;})['then'](respondWithFilteredResult(_0x507aab,_0x3b4259))[_0xf55f('0x3c')](handleError(_0x507aab,null));};exports[_0xf55f('0x3d')]=function(_0x8a67eb,_0x1f1e11){var _0x3b93cd={'raw':!![],'where':{'id':_0x8a67eb[_0xf55f('0x3e')]['id']}},_0x25980f={};_0x25980f['model']=_['keys'](db[_0xf55f('0x3a')][_0xf55f('0x3f')]);_0x25980f[_0xf55f('0x2f')]=_['keys'](_0x8a67eb[_0xf55f('0x2f')]);_0x25980f['filters']=_[_0xf55f('0x40')](_0x25980f[_0xf55f('0x31')],_0x25980f[_0xf55f('0x2f')]);_0x3b93cd['attributes']=_[_0xf55f('0x40')](_0x25980f[_0xf55f('0x31')],qs[_0xf55f('0x33')](_0x8a67eb[_0xf55f('0x2f')][_0xf55f('0x33')]));_0x3b93cd['attributes']=_0x3b93cd[_0xf55f('0x32')]['length']?_0x3b93cd[_0xf55f('0x32')]:_0x25980f[_0xf55f('0x31')];if(_0x8a67eb[_0xf55f('0x2f')][_0xf55f('0x41')]){_0x3b93cd[_0xf55f('0x39')]=[{'all':!![]}];}_0x3b93cd=_[_0xf55f('0x42')]({},_0x3b93cd,_0x8a67eb['options']);return db[_0xf55f('0x3a')]['find'](_0x3b93cd)['then'](handleEntityNotFound(_0x1f1e11,null))[_0xf55f('0x26')](respondWithResult(_0x1f1e11,null))[_0xf55f('0x3c')](handleError(_0x1f1e11,null));};exports[_0xf55f('0x43')]=function(_0x52d2f2,_0x576c6){if(_0x52d2f2['body']['id']){delete _0x52d2f2[_0xf55f('0x44')]['id'];}return db[_0xf55f('0x3a')][_0xf55f('0x45')]({'where':{'id':_0x52d2f2[_0xf55f('0x3e')]['id']}})[_0xf55f('0x26')](handleEntityNotFound(_0x576c6,null))[_0xf55f('0x26')](saveUpdates(_0x52d2f2[_0xf55f('0x44')],null))[_0xf55f('0x26')](respondWithResult(_0x576c6,null))[_0xf55f('0x3c')](handleError(_0x576c6,null));};exports['destroy']=function(_0x539448,_0x6c8259){return db[_0xf55f('0x3a')]['find']({'where':{'id':_0x539448[_0xf55f('0x3e')]['id']}})[_0xf55f('0x26')](handleEntityNotFound(_0x6c8259,null))['then'](removeEntity(_0x6c8259,null))[_0xf55f('0x3c')](handleError(_0x6c8259,null));};exports[_0xf55f('0x46')]=function(_0x24af97,_0x66d645){var _0xa078db={'key':_0x24af97[_0xf55f('0x44')][_0xf55f('0x2e')]};if(_0x24af97['body'][_0xf55f('0x47')]){_0xa078db[_0xf55f('0x47')]=_0x24af97[_0xf55f('0x44')][_0xf55f('0x47')];}else if(_0x24af97[_0xf55f('0x44')][_0xf55f('0x48')]){_0xa078db[_0xf55f('0x48')]=_0x24af97[_0xf55f('0x44')][_0xf55f('0x48')];}else if(_0x24af97[_0xf55f('0x44')]['OpenchannelAccountId']){_0xa078db[_0xf55f('0x49')]=_0x24af97['body']['OpenchannelAccountId'];}else if(_0x24af97[_0xf55f('0x44')]['ChatWebsiteId']){_0xa078db[_0xf55f('0x4a')]=_0x24af97[_0xf55f('0x44')][_0xf55f('0x4a')];}return db[_0xf55f('0x3a')][_0xf55f('0x45')]({'where':_0xa078db})[_0xf55f('0x26')](function(_0xfb1651){if(_0xfb1651){throw new db[(_0xf55f('0x4b'))][(_0xf55f('0x4c'))](_0xf55f('0x4d'));}return db[_0xf55f('0x3a')][_0xf55f('0x46')](_0x24af97['body']);})[_0xf55f('0x26')](function(_0x14e950){var _0x413a43=_0x24af97['user'][_0xf55f('0x4e')]({'plain':!![]});if(!_0x413a43)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x413a43[_0xf55f('0x4f')]===_0xf55f('0x50')){var _0xc97573=_0x14e950[_0xf55f('0x4e')]({'plain':!![]});return db[_0xf55f('0x51')][_0xf55f('0x45')]({'where':{'name':_0xf55f('0x52'),'userProfileId':_0x413a43[_0xf55f('0x53')]},'raw':!![]})[_0xf55f('0x26')](function(_0x10f100){if(_0x10f100&&_0x10f100['autoAssociation']===0x0){return db[_0xf55f('0x28')][_0xf55f('0x46')]({'name':_0xc97573[_0xf55f('0x2a')],'resourceId':_0xc97573['id'],'type':_0x10f100[_0xf55f('0x2a')],'sectionId':_0x10f100['id']},{})[_0xf55f('0x26')](function(){return _0x14e950;});}else{return _0x14e950;}})[_0xf55f('0x3c')](function(_0x5d9b5d){logger[_0xf55f('0x29')](_0xf55f('0x54'),_0x5d9b5d);throw _0x5d9b5d;});}return _0x14e950;})[_0xf55f('0x26')](respondWithResult(_0x66d645,0xc9))[_0xf55f('0x3c')](handleError(_0x66d645,null));};
\ No newline at end of file
+var _0x2918=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','merge','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','destroy','get','CannedAnswers','UserProfileResource','then','name','map','CannedAnswer','rawAttributes','type','query'];(function(_0x4ff939,_0x5f54ea){var _0x3f8ba8=function(_0x25e6f7){while(--_0x25e6f7){_0x4ff939['push'](_0x4ff939['shift']());}};_0x3f8ba8(++_0x5f54ea);}(_0x2918,0x83));var _0x8291=function(_0x4ebddb,_0x5cd1d4){_0x4ebddb=_0x4ebddb-0x0;var _0xbd90d5=_0x2918[_0x4ebddb];return _0xbd90d5;};'use strict';var emlformat=require(_0x8291('0x0'));var rimraf=require(_0x8291('0x1'));var zipdir=require(_0x8291('0x2'));var jsonpatch=require(_0x8291('0x3'));var rp=require(_0x8291('0x4'));var moment=require(_0x8291('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8291('0x6'));var util=require(_0x8291('0x7'));var path=require('path');var sox=require(_0x8291('0x8'));var csv=require(_0x8291('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8291('0xa'));var _=require(_0x8291('0xb'));var squel=require(_0x8291('0xc'));var crypto=require(_0x8291('0xd'));var jsforce=require(_0x8291('0xe'));var deskjs=require(_0x8291('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8291('0x10'));var Papa=require(_0x8291('0x11'));var Redis=require(_0x8291('0x12'));var authService=require(_0x8291('0x13'));var qs=require(_0x8291('0x14'));var as=require(_0x8291('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8291('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8291('0x17'));var licenseUtil=require(_0x8291('0x18'));var db=require(_0x8291('0x19'))['db'];function respondWithStatusCode(_0x275b2f,_0x3b7795){_0x3b7795=_0x3b7795||0xcc;return function(_0x3899e9){if(_0x3899e9){return _0x275b2f[_0x8291('0x1a')](_0x3b7795);}return _0x275b2f['status'](_0x3b7795)[_0x8291('0x1b')]();};}function respondWithResult(_0x43b432,_0x4d9b8d){_0x4d9b8d=_0x4d9b8d||0xc8;return function(_0x6def3){if(_0x6def3){return _0x43b432['status'](_0x4d9b8d)[_0x8291('0x1c')](_0x6def3);}};}function respondWithFilteredResult(_0xc43502,_0x829d5c){return function(_0x491667){if(_0x491667){var _0x46952a=typeof _0x829d5c[_0x8291('0x1d')]===_0x8291('0x1e')&&typeof _0x829d5c[_0x8291('0x1f')]===_0x8291('0x1e');var _0x5ec88c=_0x491667[_0x8291('0x20')];var _0x23246b=_0x46952a?0x0:_0x829d5c[_0x8291('0x1d')];var _0x554436=_0x46952a?_0x491667['count']:_0x829d5c[_0x8291('0x1d')]+_0x829d5c['limit'];var _0x5c9d23;if(_0x554436>=_0x5ec88c){_0x554436=_0x5ec88c;_0x5c9d23=0xc8;}else{_0x5c9d23=0xce;}_0xc43502[_0x8291('0x21')](_0x5c9d23);return _0xc43502[_0x8291('0x22')](_0x8291('0x23'),_0x23246b+'-'+_0x554436+'/'+_0x5ec88c)[_0x8291('0x1c')](_0x491667);}return null;};}function patchUpdates(_0x2c38dd){return function(_0x443109){try{jsonpatch['apply'](_0x443109,_0x2c38dd,!![]);}catch(_0x48d656){return BPromise['reject'](_0x48d656);}return _0x443109[_0x8291('0x24')]();};}function saveUpdates(_0x685752,_0x1f73eb){return function(_0x4c5c21){if(_0x4c5c21){return _0x4c5c21[_0x8291('0x25')](_0x685752)['then'](function(_0x36e094){return _0x36e094;});}return null;};}function removeEntity(_0x622add,_0x2b0239){return function(_0x4cfec1){if(_0x4cfec1){return _0x4cfec1[_0x8291('0x26')]()['then'](function(){var _0x4332ac=_0x4cfec1[_0x8291('0x27')]({'plain':!![]});var _0x392082=_0x8291('0x28');return db[_0x8291('0x29')][_0x8291('0x26')]({'where':{'type':_0x392082,'resourceId':_0x4332ac['id']}})[_0x8291('0x2a')](function(){return _0x4cfec1;});})['then'](function(){_0x622add[_0x8291('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce333,_0x22a02c){return function(_0x87f61b){if(!_0x87f61b){_0x5ce333['sendStatus'](0x194);}return _0x87f61b;};}function handleError(_0x5c648f,_0x41e71f){_0x41e71f=_0x41e71f||0x1f4;return function(_0xfae26e){logger['error'](_0xfae26e['stack']);if(_0xfae26e['name']){delete _0xfae26e[_0x8291('0x2b')];}_0x5c648f['status'](_0x41e71f)['send'](_0xfae26e);};}exports['index']=function(_0x57997d,_0x86aa29){var _0x44f3f1={},_0x290d90={},_0x5e446c={'count':0x0,'rows':[]};var _0x3837d3=_[_0x8291('0x2c')](db[_0x8291('0x2d')][_0x8291('0x2e')],function(_0x2c402d){return{'name':_0x2c402d['fieldName'],'type':_0x2c402d[_0x8291('0x2f')]['key']};});_0x290d90['model']=_['map'](_0x3837d3,_0x8291('0x2b'));_0x290d90[_0x8291('0x30')]=_['keys'](_0x57997d['query']);_0x290d90['filters']=_['intersection'](_0x290d90[_0x8291('0x31')],_0x290d90[_0x8291('0x30')]);_0x44f3f1[_0x8291('0x32')]=_['intersection'](_0x290d90[_0x8291('0x31')],qs[_0x8291('0x33')](_0x57997d[_0x8291('0x30')][_0x8291('0x33')]));_0x44f3f1[_0x8291('0x32')]=_0x44f3f1[_0x8291('0x32')][_0x8291('0x34')]?_0x44f3f1[_0x8291('0x32')]:_0x290d90[_0x8291('0x31')];if(!_0x57997d[_0x8291('0x30')][_0x8291('0x35')](_0x8291('0x36'))){_0x44f3f1['limit']=qs[_0x8291('0x1f')](_0x57997d[_0x8291('0x30')][_0x8291('0x1f')]);_0x44f3f1[_0x8291('0x1d')]=qs['offset'](_0x57997d[_0x8291('0x30')]['offset']);}_0x44f3f1['order']=qs['sort'](_0x57997d[_0x8291('0x30')][_0x8291('0x37')]);_0x44f3f1['where']=qs[_0x8291('0x38')](_[_0x8291('0x39')](_0x57997d[_0x8291('0x30')],_0x290d90[_0x8291('0x38')]),_0x3837d3);if(_0x57997d[_0x8291('0x30')][_0x8291('0x3a')]){_0x44f3f1[_0x8291('0x3b')]=_['merge'](_0x44f3f1[_0x8291('0x3b')],{'$or':[{'key':{'$like':'%'+_0x57997d['query'][_0x8291('0x3a')]+'%'}},{'value':{'$like':'%'+_0x57997d[_0x8291('0x30')][_0x8291('0x3a')]+'%'}}]});}_0x44f3f1=_['merge']({},_0x44f3f1,_0x57997d[_0x8291('0x3c')]);var _0x15b004={'where':_0x44f3f1[_0x8291('0x3b')]};return db['CannedAnswer'][_0x8291('0x20')](_0x15b004)['then'](function(_0x44bdf1){_0x5e446c[_0x8291('0x20')]=_0x44bdf1;if(_0x57997d[_0x8291('0x30')][_0x8291('0x3d')]){_0x44f3f1[_0x8291('0x3e')]=[{'all':!![]}];}return db[_0x8291('0x2d')][_0x8291('0x3f')](_0x44f3f1);})['then'](function(_0x11ddc3){_0x5e446c[_0x8291('0x40')]=_0x11ddc3;return _0x5e446c;})[_0x8291('0x2a')](respondWithFilteredResult(_0x86aa29,_0x44f3f1))[_0x8291('0x41')](handleError(_0x86aa29,null));};exports[_0x8291('0x42')]=function(_0x34e6dc,_0x5eb029){var _0x557a16={'raw':!![],'where':{'id':_0x34e6dc[_0x8291('0x43')]['id']}},_0x311954={};_0x311954[_0x8291('0x31')]=_[_0x8291('0x44')](db['CannedAnswer'][_0x8291('0x2e')]);_0x311954[_0x8291('0x30')]=_[_0x8291('0x44')](_0x34e6dc[_0x8291('0x30')]);_0x311954[_0x8291('0x38')]=_[_0x8291('0x45')](_0x311954[_0x8291('0x31')],_0x311954[_0x8291('0x30')]);_0x557a16[_0x8291('0x32')]=_['intersection'](_0x311954[_0x8291('0x31')],qs[_0x8291('0x33')](_0x34e6dc['query'][_0x8291('0x33')]));_0x557a16[_0x8291('0x32')]=_0x557a16[_0x8291('0x32')]['length']?_0x557a16['attributes']:_0x311954[_0x8291('0x31')];if(_0x34e6dc['query'][_0x8291('0x3d')]){_0x557a16[_0x8291('0x3e')]=[{'all':!![]}];}_0x557a16=_[_0x8291('0x46')]({},_0x557a16,_0x34e6dc[_0x8291('0x3c')]);return db[_0x8291('0x2d')][_0x8291('0x47')](_0x557a16)[_0x8291('0x2a')](handleEntityNotFound(_0x5eb029,null))[_0x8291('0x2a')](respondWithResult(_0x5eb029,null))[_0x8291('0x41')](handleError(_0x5eb029,null));};exports[_0x8291('0x25')]=function(_0x6601d8,_0x4a1e9c){if(_0x6601d8[_0x8291('0x48')]['id']){delete _0x6601d8[_0x8291('0x48')]['id'];}return db[_0x8291('0x2d')]['find']({'where':{'id':_0x6601d8[_0x8291('0x43')]['id']}})[_0x8291('0x2a')](handleEntityNotFound(_0x4a1e9c,null))[_0x8291('0x2a')](saveUpdates(_0x6601d8[_0x8291('0x48')],null))[_0x8291('0x2a')](respondWithResult(_0x4a1e9c,null))[_0x8291('0x41')](handleError(_0x4a1e9c,null));};exports[_0x8291('0x26')]=function(_0x534683,_0x2a05c7){return db[_0x8291('0x2d')][_0x8291('0x47')]({'where':{'id':_0x534683[_0x8291('0x43')]['id']}})[_0x8291('0x2a')](handleEntityNotFound(_0x2a05c7,null))['then'](removeEntity(_0x2a05c7,null))[_0x8291('0x41')](handleError(_0x2a05c7,null));};exports[_0x8291('0x49')]=function(_0x5cecdf,_0x42b97c){var _0xec600b={'key':_0x5cecdf[_0x8291('0x48')][_0x8291('0x4a')]};if(_0x5cecdf[_0x8291('0x48')][_0x8291('0x4b')]){_0xec600b[_0x8291('0x4b')]=_0x5cecdf['body']['MailAccountId'];}else if(_0x5cecdf[_0x8291('0x48')][_0x8291('0x4c')]){_0xec600b[_0x8291('0x4c')]=_0x5cecdf[_0x8291('0x48')]['SmsAccountId'];}else if(_0x5cecdf[_0x8291('0x48')][_0x8291('0x4d')]){_0xec600b[_0x8291('0x4d')]=_0x5cecdf[_0x8291('0x48')]['OpenchannelAccountId'];}else if(_0x5cecdf[_0x8291('0x48')]['ChatWebsiteId']){_0xec600b[_0x8291('0x4e')]=_0x5cecdf['body'][_0x8291('0x4e')];}return db[_0x8291('0x2d')][_0x8291('0x47')]({'where':_0xec600b})[_0x8291('0x2a')](function(_0x58bf9f){if(_0x58bf9f){throw new db[(_0x8291('0x4f'))][(_0x8291('0x50'))](_0x8291('0x51'));}return db[_0x8291('0x2d')][_0x8291('0x49')](_0x5cecdf[_0x8291('0x48')]);})[_0x8291('0x2a')](function(_0x56798b){var _0x3390c6=_0x5cecdf['user'][_0x8291('0x27')]({'plain':!![]});if(!_0x3390c6)throw new Error(_0x8291('0x52'));if(_0x3390c6[_0x8291('0x53')]===_0x8291('0x54')){var _0x47e06d=_0x56798b[_0x8291('0x27')]({'plain':!![]});return db[_0x8291('0x55')]['find']({'where':{'name':_0x8291('0x28'),'userProfileId':_0x3390c6[_0x8291('0x56')]},'raw':!![]})['then'](function(_0x2f0146){if(_0x2f0146&&_0x2f0146[_0x8291('0x57')]===0x0){return db[_0x8291('0x29')][_0x8291('0x49')]({'name':_0x47e06d[_0x8291('0x2b')],'resourceId':_0x47e06d['id'],'type':_0x2f0146[_0x8291('0x2b')],'sectionId':_0x2f0146['id']},{})[_0x8291('0x2a')](function(){return _0x56798b;});}else{return _0x56798b;}})[_0x8291('0x41')](function(_0x4c4dcc){logger[_0x8291('0x58')](_0x8291('0x59'),_0x4c4dcc);throw _0x4c4dcc;});}return _0x56798b;})[_0x8291('0x2a')](respondWithResult(_0x42b97c,0xc9))[_0x8291('0x41')](handleError(_0x42b97c,null));};
\ No newline at end of file
index a4df94a..2eb089c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ffd=['exports','define','CannedAnswer','utf8mb4','lodash','util','../../config/logger','api','bluebird','../../config/environment','./cannedAnswer.attributes'];(function(_0xca1e8a,_0x10bd6b){var _0x30d5e6=function(_0x47e8a6){while(--_0x47e8a6){_0xca1e8a['push'](_0xca1e8a['shift']());}};_0x30d5e6(++_0x10bd6b);}(_0x6ffd,0x16f));var _0xd6ff=function(_0x10869e,_0x290466){_0x10869e=_0x10869e-0x0;var _0x260768=_0x6ffd[_0x10869e];return _0x260768;};'use strict';var _=require(_0xd6ff('0x0'));var util=require(_0xd6ff('0x1'));var logger=require(_0xd6ff('0x2'))(_0xd6ff('0x3'));var moment=require('moment');var BPromise=require(_0xd6ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd6ff('0x5'));var attributes=require(_0xd6ff('0x6'));module[_0xd6ff('0x7')]=function(_0x176f1c,_0x3b5d12){return _0x176f1c[_0xd6ff('0x8')](_0xd6ff('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6ff('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3297=['rimraf','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36e6d8,_0x49467a){var _0x189f9a=function(_0x5c1b36){while(--_0x5c1b36){_0x36e6d8['push'](_0x36e6d8['shift']());}};_0x189f9a(++_0x49467a);}(_0x3297,0xa0));var _0x7329=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x3297[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var logger=require(_0x7329('0x2'))(_0x7329('0x3'));var moment=require(_0x7329('0x4'));var BPromise=require(_0x7329('0x5'));var rp=require(_0x7329('0x6'));var fs=require('fs');var path=require(_0x7329('0x7'));var rimraf=require(_0x7329('0x8'));var config=require('../../config/environment');var attributes=require(_0x7329('0x9'));module['exports']=function(_0x55e88d,_0x98ee57){return _0x55e88d[_0x7329('0xa')]('CannedAnswer',attributes,{'tableName':_0x7329('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7329('0xc'),'collate':_0x7329('0xd')});};
\ No newline at end of file
index 71b44ae..b83455c 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(_0x2b63f4,_0x51a4a8){var _0xfb999e=function(_0x2b1308){while(--_0x2b1308){_0x2b63f4['push'](_0x2b63f4['shift']());}};_0xfb999e(++_0x51a4a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x23b300,_0x2e435b){var _0xa217bd=function(_0x50bfda){while(--_0x50bfda){_0x23b300['push'](_0x23b300['shift']());}};_0xa217bd(++_0x2e435b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 78b7f17..6d769a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0851=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5b0c54,_0x2d7ea4){var _0x5145f7=function(_0x5a8547){while(--_0x5a8547){_0x5b0c54['push'](_0x5b0c54['shift']());}};_0x5145f7(++_0x2d7ea4);}(_0x0851,0x90));var _0x1085=function(_0x78929c,_0x529d2f){_0x78929c=_0x78929c-0x0;var _0x1c1c5c=_0x0851[_0x78929c];return _0x1c1c5c;};'use strict';var multer=require(_0x1085('0x0'));var util=require(_0x1085('0x1'));var path=require(_0x1085('0x2'));var timeout=require(_0x1085('0x3'));var express=require(_0x1085('0x4'));var router=express[_0x1085('0x5')]();var fs_extra=require(_0x1085('0x6'));var auth=require(_0x1085('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1085('0x8'));var controller=require(_0x1085('0x9'));router[_0x1085('0xa')]('/',auth[_0x1085('0xb')](),controller['index']);router[_0x1085('0xa')](_0x1085('0xc'),auth['isAuthenticated'](),controller[_0x1085('0xd')]);router[_0x1085('0xe')]('/',auth[_0x1085('0xb')](),controller[_0x1085('0xf')]);router[_0x1085('0x10')]('/:id',auth[_0x1085('0xb')](),controller[_0x1085('0x11')]);router[_0x1085('0x12')](_0x1085('0xc'),auth[_0x1085('0xb')](),controller[_0x1085('0x13')]);module[_0x1085('0x14')]=router;
\ No newline at end of file
+var _0x3fe3=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4ae63d,_0x152404){var _0x4c1e01=function(_0x58cb7e){while(--_0x58cb7e){_0x4ae63d['push'](_0x4ae63d['shift']());}};_0x4c1e01(++_0x152404);}(_0x3fe3,0x1ac));var _0x33fe=function(_0x516090,_0x170e6f){_0x516090=_0x516090-0x0;var _0x35c22e=_0x3fe3[_0x516090];return _0x35c22e;};'use strict';var multer=require(_0x33fe('0x0'));var util=require('util');var path=require(_0x33fe('0x1'));var timeout=require(_0x33fe('0x2'));var express=require(_0x33fe('0x3'));var router=express[_0x33fe('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x33fe('0x5'));var config=require(_0x33fe('0x6'));var controller=require('./cannedAnswer.controller');router[_0x33fe('0x7')]('/',auth[_0x33fe('0x8')](),controller[_0x33fe('0x9')]);router[_0x33fe('0x7')]('/:id',auth[_0x33fe('0x8')](),controller[_0x33fe('0xa')]);router[_0x33fe('0xb')]('/',auth[_0x33fe('0x8')](),controller[_0x33fe('0xc')]);router['put'](_0x33fe('0xd'),auth[_0x33fe('0x8')](),controller[_0x33fe('0xe')]);router[_0x33fe('0xf')](_0x33fe('0xd'),auth['isAuthenticated'](),controller[_0x33fe('0x10')]);module[_0x33fe('0x11')]=router;
\ No newline at end of file
index 740af46..f54bc04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1667=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1667,0xfd));var _0x7166=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x1667[_0x50bf5a];return _0x4ddc1d;};'use strict';var Sequelize=require(_0x7166('0x0'));module[_0x7166('0x1')]={'calldate':{'type':Sequelize[_0x7166('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x7166('0x3')]},'dst':{'type':Sequelize[_0x7166('0x3')]},'dcontext':{'type':Sequelize[_0x7166('0x3')]},'channel':{'type':Sequelize[_0x7166('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7166('0x3')]},'lastdata':{'type':Sequelize[_0x7166('0x3')]},'duration':{'type':Sequelize[_0x7166('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7166('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7166('0x3')]},'userfield':{'type':Sequelize[_0x7166('0x3')]},'uniqueid':{'type':Sequelize[_0x7166('0x3')]},'linkedid':{'type':Sequelize[_0x7166('0x3')]},'sequence':{'type':Sequelize[_0x7166('0x3')]},'peeraccount':{'type':Sequelize[_0x7166('0x3')]},'type':{'type':Sequelize[_0x7166('0x3')]},'tag':{'type':Sequelize[_0x7166('0x3')]}};
\ No newline at end of file
+var _0x42cb=['INTEGER','DATE','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x42cb,0x178));var _0xb42c=function(_0xc99455,_0x2428a7){_0xc99455=_0xc99455-0x0;var _0x422190=_0x42cb[_0xc99455];return _0x422190;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xb42c('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb42c('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb42c('0x1')]},'dcontext':{'type':Sequelize[_0xb42c('0x1')]},'channel':{'type':Sequelize[_0xb42c('0x1')]},'dstchannel':{'type':Sequelize[_0xb42c('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb42c('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb42c('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb42c('0x1')]},'amaflags':{'type':Sequelize[_0xb42c('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb42c('0x1')]},'userfield':{'type':Sequelize[_0xb42c('0x1')]},'uniqueid':{'type':Sequelize[_0xb42c('0x1')]},'linkedid':{'type':Sequelize[_0xb42c('0x1')]},'sequence':{'type':Sequelize[_0xb42c('0x1')]},'peeraccount':{'type':Sequelize[_0xb42c('0x1')]},'type':{'type':Sequelize[_0xb42c('0x1')]},'tag':{'type':Sequelize[_0xb42c('0x1')]}};
\ No newline at end of file
index 8f3e530..18760da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b2=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','Cdr','include','findAll','then','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x728a0d,_0x44ca89){var _0xc575ed=function(_0x418c03){while(--_0x418c03){_0x728a0d['push'](_0x728a0d['shift']());}};_0xc575ed(++_0x44ca89);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x1274bc,_0xffe392){_0x1274bc=_0x1274bc-0x0;var _0x215f21=_0xf8b2[_0x1274bc];return _0x215f21;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];function respondWithStatusCode(_0x175111,_0x4cb1e0){_0x4cb1e0=_0x4cb1e0||0xcc;return function(_0x16d5a2){if(_0x16d5a2){return _0x175111['sendStatus'](_0x4cb1e0);}return _0x175111[_0x2f8b('0x1b')](_0x4cb1e0)[_0x2f8b('0x1c')]();};}function respondWithResult(_0x1b6a17,_0x15634){_0x15634=_0x15634||0xc8;return function(_0xf9cbe0){if(_0xf9cbe0){return _0x1b6a17[_0x2f8b('0x1b')](_0x15634)[_0x2f8b('0x1d')](_0xf9cbe0);}};}function respondWithFilteredResult(_0x2b6003,_0x532fe4){return function(_0x14a248){if(_0x14a248){var _0xdec711=typeof _0x532fe4[_0x2f8b('0x1e')]===_0x2f8b('0x1f')&&typeof _0x532fe4[_0x2f8b('0x20')]===_0x2f8b('0x1f');var _0x3d65ee=_0x14a248[_0x2f8b('0x21')];var _0x35ec40=_0xdec711?0x0:_0x532fe4['offset'];var _0x23dd63=_0xdec711?_0x14a248[_0x2f8b('0x21')]:_0x532fe4[_0x2f8b('0x1e')]+_0x532fe4['limit'];var _0xdc8171;if(_0x23dd63>=_0x3d65ee){_0x23dd63=_0x3d65ee;_0xdc8171=0xc8;}else{_0xdc8171=0xce;}_0x2b6003['status'](_0xdc8171);return _0x2b6003[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x35ec40+'-'+_0x23dd63+'/'+_0x3d65ee)[_0x2f8b('0x1d')](_0x14a248);}return null;};}function patchUpdates(_0x26d78f){return function(_0x3be6dc){try{jsonpatch['apply'](_0x3be6dc,_0x26d78f,!![]);}catch(_0x29c2f3){return BPromise[_0x2f8b('0x24')](_0x29c2f3);}return _0x3be6dc[_0x2f8b('0x25')]();};}function saveUpdates(_0x17b251,_0x3ad38b){return function(_0x1ffbae){if(_0x1ffbae){return _0x1ffbae[_0x2f8b('0x26')](_0x17b251)['then'](function(_0x273950){return _0x273950;});}return null;};}function removeEntity(_0x23f73c,_0x3560c4){return function(_0x41e12b){if(_0x41e12b){return _0x41e12b[_0x2f8b('0x27')]()['then'](function(){_0x23f73c[_0x2f8b('0x1b')](0xcc)[_0x2f8b('0x1c')]();});}};}function handleEntityNotFound(_0x152492,_0x46a95a){return function(_0x183e51){if(!_0x183e51){_0x152492[_0x2f8b('0x28')](0x194);}return _0x183e51;};}function handleError(_0x45e313,_0x347f5a){_0x347f5a=_0x347f5a||0x1f4;return function(_0x4145b3){logger['error'](_0x4145b3[_0x2f8b('0x29')]);if(_0x4145b3['name']){delete _0x4145b3[_0x2f8b('0x2a')];}_0x45e313[_0x2f8b('0x1b')](_0x347f5a)[_0x2f8b('0x2b')](_0x4145b3);};}exports[_0x2f8b('0x2c')]=function(_0x72b23b,_0x4adacd){var _0x2cfbea={},_0x5cc78c={},_0x5207a8={'count':0x0,'rows':[]};var _0x194e75=_[_0x2f8b('0x2d')](db['Cdr'][_0x2f8b('0x2e')],function(_0x20d80c){return{'name':_0x20d80c[_0x2f8b('0x2f')],'type':_0x20d80c[_0x2f8b('0x30')][_0x2f8b('0x31')]};});_0x5cc78c[_0x2f8b('0x32')]=_['map'](_0x194e75,_0x2f8b('0x2a'));_0x5cc78c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0x72b23b[_0x2f8b('0x33')]);_0x5cc78c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x5cc78c[_0x2f8b('0x32')],_0x5cc78c['query']);_0x2cfbea[_0x2f8b('0x37')]=_['intersection'](_0x5cc78c[_0x2f8b('0x32')],qs[_0x2f8b('0x38')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x38')]));_0x2cfbea[_0x2f8b('0x37')]=_0x2cfbea[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x2cfbea[_0x2f8b('0x37')]:_0x5cc78c[_0x2f8b('0x32')];if(!_0x72b23b['query']['hasOwnProperty'](_0x2f8b('0x3a'))){_0x2cfbea[_0x2f8b('0x20')]=qs[_0x2f8b('0x20')](_0x72b23b[_0x2f8b('0x33')]['limit']);_0x2cfbea[_0x2f8b('0x1e')]=qs[_0x2f8b('0x1e')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x1e')]);}_0x2cfbea[_0x2f8b('0x3b')]=qs['sort'](_0x72b23b['query'][_0x2f8b('0x3c')]);_0x2cfbea[_0x2f8b('0x3d')]=qs[_0x2f8b('0x35')](_[_0x2f8b('0x3e')](_0x72b23b[_0x2f8b('0x33')],_0x5cc78c[_0x2f8b('0x35')]),_0x194e75);if(_0x72b23b[_0x2f8b('0x33')]['filter']){_0x2cfbea[_0x2f8b('0x3d')]=_[_0x2f8b('0x3f')](_0x2cfbea['where'],{'$or':_[_0x2f8b('0x2d')](_0x194e75,function(_0x4594b2){if(_0x4594b2[_0x2f8b('0x30')]!=='VIRTUAL'){var _0xa1d8de={};_0xa1d8de[_0x4594b2[_0x2f8b('0x2a')]]={'$like':'%'+_0x72b23b['query'][_0x2f8b('0x40')]+'%'};return _0xa1d8de;}})});}_0x2cfbea=_[_0x2f8b('0x3f')]({},_0x2cfbea,_0x72b23b['options']);var _0x92b37a={'where':_0x2cfbea['where']};return db[_0x2f8b('0x41')][_0x2f8b('0x21')](_0x92b37a)['then'](function(_0x9030da){_0x5207a8[_0x2f8b('0x21')]=_0x9030da;if(_0x72b23b[_0x2f8b('0x33')]['includeAll']){_0x2cfbea[_0x2f8b('0x42')]=[{'all':!![]}];}return db['Cdr'][_0x2f8b('0x43')](_0x2cfbea);})[_0x2f8b('0x44')](function(_0x1ff6e7){_0x5207a8[_0x2f8b('0x45')]=_0x1ff6e7;return _0x5207a8;})[_0x2f8b('0x44')](respondWithFilteredResult(_0x4adacd,_0x2cfbea))[_0x2f8b('0x46')](handleError(_0x4adacd,null));};exports[_0x2f8b('0x47')]=function(_0xa2fc94,_0x1c0b64){var _0x40577c={'raw':!![],'where':{'id':_0xa2fc94[_0x2f8b('0x48')]['id']}},_0x45c92c={};_0x45c92c[_0x2f8b('0x32')]=_[_0x2f8b('0x34')](db[_0x2f8b('0x41')][_0x2f8b('0x2e')]);_0x45c92c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0xa2fc94[_0x2f8b('0x33')]);_0x45c92c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x45c92c[_0x2f8b('0x32')],_0x45c92c[_0x2f8b('0x33')]);_0x40577c[_0x2f8b('0x37')]=_[_0x2f8b('0x36')](_0x45c92c['model'],qs['fields'](_0xa2fc94['query'][_0x2f8b('0x38')]));_0x40577c['attributes']=_0x40577c[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x40577c[_0x2f8b('0x37')]:_0x45c92c['model'];if(_0xa2fc94[_0x2f8b('0x33')]['includeAll']){_0x40577c[_0x2f8b('0x42')]=[{'all':!![]}];}_0x40577c=_['merge']({},_0x40577c,_0xa2fc94[_0x2f8b('0x49')]);return db[_0x2f8b('0x41')]['find'](_0x40577c)[_0x2f8b('0x44')](handleEntityNotFound(_0x1c0b64,null))[_0x2f8b('0x44')](respondWithResult(_0x1c0b64,null))[_0x2f8b('0x46')](handleError(_0x1c0b64,null));};exports[_0x2f8b('0x4a')]=function(_0x1e6ac2,_0x465d59){return db[_0x2f8b('0x41')][_0x2f8b('0x4a')](_0x1e6ac2[_0x2f8b('0x4b')],{})['then'](respondWithResult(_0x465d59,0xc9))[_0x2f8b('0x46')](handleError(_0x465d59,null));};exports[_0x2f8b('0x26')]=function(_0x2d79f9,_0x1bb257){if(_0x2d79f9[_0x2f8b('0x4b')]['id']){delete _0x2d79f9['body']['id'];}return db[_0x2f8b('0x41')][_0x2f8b('0x4c')]({'where':{'id':_0x2d79f9[_0x2f8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb257,null))[_0x2f8b('0x44')](saveUpdates(_0x2d79f9['body'],null))[_0x2f8b('0x44')](respondWithResult(_0x1bb257,null))[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x27')]=function(_0x3a25bb,_0x17b855){return db['Cdr']['find']({'where':{'id':_0x3a25bb['params']['id']}})[_0x2f8b('0x44')](handleEntityNotFound(_0x17b855,null))[_0x2f8b('0x44')](removeEntity(_0x17b855,null))[_0x2f8b('0x46')](handleError(_0x17b855,null));};exports[_0x2f8b('0x4d')]=function(_0x49e047,_0x5ea07d){return db[_0x2f8b('0x41')][_0x2f8b('0x4d')]()[_0x2f8b('0x44')](respondWithResult(_0x5ea07d,null))[_0x2f8b('0x46')](handleError(_0x5ea07d,null));};
\ No newline at end of file
+var _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf987,0x18a));var _0x7f98=function(_0x1f8e76,_0x1fec1c){_0x1f8e76=_0x1f8e76-0x0;var _0x3e7ffc=_0xf987[_0x1f8e76];return _0x3e7ffc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['Cdr']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['Cdr'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['Cdr'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['Cdr'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['Cdr'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));};
\ No newline at end of file
index 6434c62..7e3600c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x280401,_0x4a3fde){var _0x2a32dc=function(_0x2b40c9){while(--_0x2b40c9){_0x280401['push'](_0x280401['shift']());}};_0x2a32dc(++_0x4a3fde);}(_0x7a54,0x106));var _0x47a5=function(_0x595e35,_0x4dbc03){_0x595e35=_0x595e35-0x0;var _0x53f8ab=_0x7a54[_0x595e35];return _0x53f8ab;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1ef3e4,_0x3bbbe8){var _0x473eae=function(_0x2187d9){while(--_0x2187d9){_0x1ef3e4['push'](_0x1ef3e4['shift']());}};_0x473eae(++_0x3bbbe8);}(_0x7a54,0x106));var _0x47a5=function(_0x41bb03,_0x2d4248){_0x41bb03=_0x41bb03-0x0;var _0x4ccec1=_0x7a54[_0x41bb03];return _0x4ccec1;};'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 434bdfb..1d11956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa727=['../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x33501f,_0x2cae5){var _0x3e3713=function(_0x3278e3){while(--_0x3278e3){_0x33501f['push'](_0x33501f['shift']());}};_0x3e3713(++_0x2cae5);}(_0xa727,0x149));var _0x7a72=function(_0x1421d4,_0x5c95cb){_0x1421d4=_0x1421d4-0x0;var _0x585cee=_0xa727[_0x1421d4];return _0x585cee;};'use strict';var _=require(_0x7a72('0x0'));var util=require(_0x7a72('0x1'));var moment=require(_0x7a72('0x2'));var BPromise=require(_0x7a72('0x3'));var rs=require(_0x7a72('0x4'));var fs=require('fs');var Redis=require(_0x7a72('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a72('0x6'));var logger=require(_0x7a72('0x7'))(_0x7a72('0x8'));var config=require(_0x7a72('0x9'));var jayson=require(_0x7a72('0xa'));var client=jayson[_0x7a72('0xb')][_0x7a72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ddd5a,_0x29e961,_0x509386){return new BPromise(function(_0x32d98b,_0x54a9cd){return client[_0x7a72('0xd')](_0x1ddd5a,_0x509386)[_0x7a72('0xe')](function(_0x3acd17){logger[_0x7a72('0xf')](_0x7a72('0x10'),_0x29e961,_0x7a72('0x11'));logger[_0x7a72('0x12')](_0x7a72('0x13'),_0x29e961,'request\x20sent',JSON[_0x7a72('0x14')](_0x3acd17));if(_0x3acd17[_0x7a72('0x15')]){if(_0x3acd17[_0x7a72('0x15')][_0x7a72('0x16')]===0x1f4){logger[_0x7a72('0x15')](_0x7a72('0x10'),_0x29e961,_0x3acd17['error'][_0x7a72('0x17')]);return _0x54a9cd(_0x3acd17[_0x7a72('0x15')][_0x7a72('0x17')]);}logger[_0x7a72('0x15')](_0x7a72('0x10'),_0x29e961,_0x3acd17[_0x7a72('0x15')]['message']);return _0x32d98b(_0x3acd17[_0x7a72('0x15')][_0x7a72('0x17')]);}else{logger[_0x7a72('0xf')](_0x7a72('0x10'),_0x29e961,'request\x20sent');_0x32d98b(_0x3acd17[_0x7a72('0x18')][_0x7a72('0x17')]);}})[_0x7a72('0x19')](function(_0x59c616){logger[_0x7a72('0x15')](_0x7a72('0x10'),_0x29e961,_0x59c616);_0x54a9cd(_0x59c616);});});}
\ No newline at end of file
+var _0x1821=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x51e83f,_0x49ecb9){var _0x499790=function(_0x31c495){while(--_0x31c495){_0x51e83f['push'](_0x51e83f['shift']());}};_0x499790(++_0x49ecb9);}(_0x1821,0x136));var _0x1182=function(_0x444f28,_0x4a92c1){_0x444f28=_0x444f28-0x0;var _0x124160=_0x1821[_0x444f28];return _0x124160;};'use strict';var _=require(_0x1182('0x0'));var util=require(_0x1182('0x1'));var moment=require(_0x1182('0x2'));var BPromise=require(_0x1182('0x3'));var rs=require(_0x1182('0x4'));var fs=require('fs');var Redis=require(_0x1182('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1182('0x6'));var logger=require(_0x1182('0x7'))(_0x1182('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1182('0x9')][_0x1182('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11e01e,_0x3df311,_0x2b823c){return new BPromise(function(_0x226668,_0x2c4523){return client[_0x1182('0xb')](_0x11e01e,_0x2b823c)[_0x1182('0xc')](function(_0x2cca6a){logger[_0x1182('0xd')](_0x1182('0xe'),_0x3df311,_0x1182('0xf'));logger[_0x1182('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3df311,_0x1182('0xf'),JSON[_0x1182('0x11')](_0x2cca6a));if(_0x2cca6a['error']){if(_0x2cca6a[_0x1182('0x12')]['code']===0x1f4){logger[_0x1182('0x12')](_0x1182('0xe'),_0x3df311,_0x2cca6a[_0x1182('0x12')][_0x1182('0x13')]);return _0x2c4523(_0x2cca6a[_0x1182('0x12')][_0x1182('0x13')]);}logger[_0x1182('0x12')](_0x1182('0xe'),_0x3df311,_0x2cca6a['error'][_0x1182('0x13')]);return _0x226668(_0x2cca6a[_0x1182('0x12')]['message']);}else{logger[_0x1182('0xd')](_0x1182('0xe'),_0x3df311,_0x1182('0xf'));_0x226668(_0x2cca6a[_0x1182('0x14')]['message']);}})[_0x1182('0x15')](function(_0x52d88f){logger[_0x1182('0x12')]('Cdr,\x20%s,\x20%s',_0x3df311,_0x52d88f);_0x2c4523(_0x52d88f);});});}
\ No newline at end of file
index c33f0dd..ac533e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x61b15a,_0x2b0d46){var _0x244e45=function(_0x1cd025){while(--_0x1cd025){_0x61b15a['push'](_0x61b15a['shift']());}};_0x244e45(++_0x2b0d46);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c1ade,_0xaa1212){_0x5c1ade=_0x5c1ade-0x0;var _0x4980b4=_0xb10b[_0x5c1ade];return _0x4980b4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _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(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 95a4c8b..ee4eb80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3604=['TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x4ff5c4,_0x4223bb){var _0x3613f8=function(_0x52c693){while(--_0x52c693){_0x4ff5c4['push'](_0x4ff5c4['shift']());}};_0x3613f8(++_0x4223bb);}(_0x3604,0x17a));var _0x4360=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3604[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x4360('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4360('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4360('0x2')]()},'description':{'type':Sequelize[_0x4360('0x3')]},'interval':{'type':Sequelize[_0x4360('0x3')],'defaultValue':_0x4360('0x4')}};
\ No newline at end of file
+var _0x35ad=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x2d4287,_0x5be3ca){var _0xbf72b7=function(_0x2dbaab){while(--_0x2dbaab){_0x2d4287['push'](_0x2d4287['shift']());}};_0xbf72b7(++_0x5be3ca);}(_0x35ad,0x12c));var _0xd35a=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x35ad[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xd35a('0x0'));module[_0xd35a('0x1')]={'priority':{'type':Sequelize[_0xd35a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd35a('0x3')],'allowNull':![],'defaultValue':_0xd35a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd35a('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index bcd2e7e..7d7e8f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a3d=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','show','model','ChatApplication','rawAttributes','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','catch','body','find'];(function(_0x1790ce,_0x5d1a9a){var _0x1e517c=function(_0x11ceba){while(--_0x11ceba){_0x1790ce['push'](_0x1790ce['shift']());}};_0x1e517c(++_0x5d1a9a);}(_0x4a3d,0x79));var _0xd4a3=function(_0x2e79ea,_0x246586){_0x2e79ea=_0x2e79ea-0x0;var _0x1fef5a=_0x4a3d[_0x2e79ea];return _0x1fef5a;};'use strict';var emlformat=require(_0xd4a3('0x0'));var rimraf=require(_0xd4a3('0x1'));var zipdir=require(_0xd4a3('0x2'));var jsonpatch=require(_0xd4a3('0x3'));var rp=require(_0xd4a3('0x4'));var moment=require(_0xd4a3('0x5'));var BPromise=require(_0xd4a3('0x6'));var Mustache=require(_0xd4a3('0x7'));var util=require(_0xd4a3('0x8'));var path=require(_0xd4a3('0x9'));var sox=require(_0xd4a3('0xa'));var csv=require(_0xd4a3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4a3('0xc'));var squel=require(_0xd4a3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd4a3('0xe'));var toCsv=require(_0xd4a3('0xb'));var querystring=require(_0xd4a3('0xf'));var Papa=require(_0xd4a3('0x10'));var Redis=require(_0xd4a3('0x11'));var authService=require(_0xd4a3('0x12'));var qs=require(_0xd4a3('0x13'));var as=require(_0xd4a3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4a3('0x15'))(_0xd4a3('0x16'));var utils=require(_0xd4a3('0x17'));var config=require(_0xd4a3('0x18'));var licenseUtil=require(_0xd4a3('0x19'));var db=require(_0xd4a3('0x1a'))['db'];function respondWithStatusCode(_0x3e7728,_0x57bd90){_0x57bd90=_0x57bd90||0xcc;return function(_0x3548e4){if(_0x3548e4){return _0x3e7728[_0xd4a3('0x1b')](_0x57bd90);}return _0x3e7728[_0xd4a3('0x1c')](_0x57bd90)[_0xd4a3('0x1d')]();};}function respondWithResult(_0xd28551,_0x11f325){_0x11f325=_0x11f325||0xc8;return function(_0x2bfeb6){if(_0x2bfeb6){return _0xd28551[_0xd4a3('0x1c')](_0x11f325)['json'](_0x2bfeb6);}};}function respondWithFilteredResult(_0x5d16e8,_0x140379){return function(_0x2f96bb){if(_0x2f96bb){var _0x124d03=typeof _0x140379[_0xd4a3('0x1e')]===_0xd4a3('0x1f')&&typeof _0x140379[_0xd4a3('0x20')]==='undefined';var _0x2a3b7e=_0x2f96bb['count'];var _0xf9fc3c=_0x124d03?0x0:_0x140379['offset'];var _0x21fa36=_0x124d03?_0x2f96bb['count']:_0x140379[_0xd4a3('0x1e')]+_0x140379[_0xd4a3('0x20')];var _0x4be8b7;if(_0x21fa36>=_0x2a3b7e){_0x21fa36=_0x2a3b7e;_0x4be8b7=0xc8;}else{_0x4be8b7=0xce;}_0x5d16e8[_0xd4a3('0x1c')](_0x4be8b7);return _0x5d16e8[_0xd4a3('0x21')](_0xd4a3('0x22'),_0xf9fc3c+'-'+_0x21fa36+'/'+_0x2a3b7e)['json'](_0x2f96bb);}return null;};}function patchUpdates(_0x4a1cf0){return function(_0x21efd7){try{jsonpatch['apply'](_0x21efd7,_0x4a1cf0,!![]);}catch(_0x402201){return BPromise[_0xd4a3('0x23')](_0x402201);}return _0x21efd7['save']();};}function saveUpdates(_0x5bc708,_0x4f957f){return function(_0x40535d){if(_0x40535d){return _0x40535d[_0xd4a3('0x24')](_0x5bc708)[_0xd4a3('0x25')](function(_0x5717f7){return _0x5717f7;});}return null;};}function removeEntity(_0x2de130,_0x137bba){return function(_0x1a4ced){if(_0x1a4ced){return _0x1a4ced[_0xd4a3('0x26')]()[_0xd4a3('0x25')](function(){_0x2de130[_0xd4a3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35a871,_0x1dea89){return function(_0x50c8ac){if(!_0x50c8ac){_0x35a871[_0xd4a3('0x1b')](0x194);}return _0x50c8ac;};}function handleError(_0x42f100,_0x26cb96){_0x26cb96=_0x26cb96||0x1f4;return function(_0x4ce98a){logger[_0xd4a3('0x27')](_0x4ce98a[_0xd4a3('0x28')]);if(_0x4ce98a[_0xd4a3('0x29')]){delete _0x4ce98a['name'];}_0x42f100[_0xd4a3('0x1c')](_0x26cb96)['send'](_0x4ce98a);};}exports[_0xd4a3('0x2a')]=function(_0x523871,_0x3019a4){var _0x5d84f2={'raw':!![],'where':{'id':_0x523871['params']['id']}},_0x2769b7={};_0x2769b7[_0xd4a3('0x2b')]=_['keys'](db[_0xd4a3('0x2c')][_0xd4a3('0x2d')]);_0x2769b7[_0xd4a3('0x2e')]=_[_0xd4a3('0x2f')](_0x523871[_0xd4a3('0x2e')]);_0x2769b7['filters']=_['intersection'](_0x2769b7[_0xd4a3('0x2b')],_0x2769b7[_0xd4a3('0x2e')]);_0x5d84f2[_0xd4a3('0x30')]=_[_0xd4a3('0x31')](_0x2769b7['model'],qs[_0xd4a3('0x32')](_0x523871[_0xd4a3('0x2e')]['fields']));_0x5d84f2[_0xd4a3('0x30')]=_0x5d84f2['attributes'][_0xd4a3('0x33')]?_0x5d84f2[_0xd4a3('0x30')]:_0x2769b7[_0xd4a3('0x2b')];if(_0x523871[_0xd4a3('0x2e')][_0xd4a3('0x34')]){_0x5d84f2[_0xd4a3('0x35')]=[{'all':!![]}];}_0x5d84f2=_[_0xd4a3('0x36')]({},_0x5d84f2,_0x523871[_0xd4a3('0x37')]);return db[_0xd4a3('0x2c')]['find'](_0x5d84f2)[_0xd4a3('0x25')](handleEntityNotFound(_0x3019a4,null))[_0xd4a3('0x25')](respondWithResult(_0x3019a4,null))[_0xd4a3('0x38')](handleError(_0x3019a4,null));};exports['update']=function(_0x124400,_0x1f579b){if(_0x124400[_0xd4a3('0x39')]['id']){delete _0x124400[_0xd4a3('0x39')]['id'];}return db[_0xd4a3('0x2c')][_0xd4a3('0x3a')]({'where':{'id':_0x124400[_0xd4a3('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1f579b,null))[_0xd4a3('0x25')](saveUpdates(_0x124400['body'],null))['then'](respondWithResult(_0x1f579b,null))[_0xd4a3('0x38')](handleError(_0x1f579b,null));};exports[_0xd4a3('0x26')]=function(_0x2c0d62,_0x3e8c7d){return db['ChatApplication'][_0xd4a3('0x3a')]({'where':{'id':_0x2c0d62['params']['id']}})[_0xd4a3('0x25')](handleEntityNotFound(_0x3e8c7d,null))[_0xd4a3('0x25')](removeEntity(_0x3e8c7d,null))[_0xd4a3('0x38')](handleError(_0x3e8c7d,null));};
\ No newline at end of file
+var _0xfc65=['lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','model','keys','ChatApplication','query','filters','attributes','fields','length','include','options','find','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x49f898,_0x477e33){var _0xeaf382=function(_0x1988f4){while(--_0x1988f4){_0x49f898['push'](_0x49f898['shift']());}};_0xeaf382(++_0x477e33);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x10f118,_0x2333ab){_0x10f118=_0x10f118-0x0;var _0x12feb6=_0xfc65[_0x10f118];return _0x12feb6;};'use strict';var emlformat=require(_0x5fc6('0x0'));var rimraf=require(_0x5fc6('0x1'));var zipdir=require(_0x5fc6('0x2'));var jsonpatch=require(_0x5fc6('0x3'));var rp=require(_0x5fc6('0x4'));var moment=require(_0x5fc6('0x5'));var BPromise=require(_0x5fc6('0x6'));var Mustache=require(_0x5fc6('0x7'));var util=require(_0x5fc6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5fc6('0x9'));var ejs=require(_0x5fc6('0xa'));var fs=require('fs');var fs_extra=require(_0x5fc6('0xb'));var _=require(_0x5fc6('0xc'));var squel=require(_0x5fc6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fc6('0xe'));var toCsv=require(_0x5fc6('0x9'));var querystring=require(_0x5fc6('0xf'));var Papa=require('papaparse');var Redis=require(_0x5fc6('0x10'));var authService=require(_0x5fc6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5fc6('0x12'));var hardwareService=require(_0x5fc6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5fc6('0x14'));var config=require(_0x5fc6('0x15'));var licenseUtil=require(_0x5fc6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1356ba,_0x3d626d){_0x3d626d=_0x3d626d||0xcc;return function(_0x2196a8){if(_0x2196a8){return _0x1356ba[_0x5fc6('0x17')](_0x3d626d);}return _0x1356ba[_0x5fc6('0x18')](_0x3d626d)[_0x5fc6('0x19')]();};}function respondWithResult(_0x4f5160,_0x3593e6){_0x3593e6=_0x3593e6||0xc8;return function(_0x4ee120){if(_0x4ee120){return _0x4f5160[_0x5fc6('0x18')](_0x3593e6)[_0x5fc6('0x1a')](_0x4ee120);}};}function respondWithFilteredResult(_0x91dd7d,_0x1ded68){return function(_0x5f3eec){if(_0x5f3eec){var _0x390af9=typeof _0x1ded68['offset']===_0x5fc6('0x1b')&&typeof _0x1ded68['limit']==='undefined';var _0x361a23=_0x5f3eec[_0x5fc6('0x1c')];var _0x1f6a14=_0x390af9?0x0:_0x1ded68[_0x5fc6('0x1d')];var _0x19e3b1=_0x390af9?_0x5f3eec[_0x5fc6('0x1c')]:_0x1ded68['offset']+_0x1ded68[_0x5fc6('0x1e')];var _0x299746;if(_0x19e3b1>=_0x361a23){_0x19e3b1=_0x361a23;_0x299746=0xc8;}else{_0x299746=0xce;}_0x91dd7d['status'](_0x299746);return _0x91dd7d['set'](_0x5fc6('0x1f'),_0x1f6a14+'-'+_0x19e3b1+'/'+_0x361a23)[_0x5fc6('0x1a')](_0x5f3eec);}return null;};}function patchUpdates(_0x4b3b35){return function(_0x26ac36){try{jsonpatch[_0x5fc6('0x20')](_0x26ac36,_0x4b3b35,!![]);}catch(_0x2bd2eb){return BPromise[_0x5fc6('0x21')](_0x2bd2eb);}return _0x26ac36[_0x5fc6('0x22')]();};}function saveUpdates(_0x378fbe,_0x5d382d){return function(_0x5c89cf){if(_0x5c89cf){return _0x5c89cf['update'](_0x378fbe)[_0x5fc6('0x23')](function(_0x535c43){return _0x535c43;});}return null;};}function removeEntity(_0x47d8d3,_0x331512){return function(_0xa1627d){if(_0xa1627d){return _0xa1627d[_0x5fc6('0x24')]()['then'](function(){_0x47d8d3['status'](0xcc)[_0x5fc6('0x19')]();});}};}function handleEntityNotFound(_0x43f9c9,_0x2497bc){return function(_0x102d47){if(!_0x102d47){_0x43f9c9[_0x5fc6('0x17')](0x194);}return _0x102d47;};}function handleError(_0x17d86a,_0x283eff){_0x283eff=_0x283eff||0x1f4;return function(_0x32e911){logger[_0x5fc6('0x25')](_0x32e911['stack']);if(_0x32e911[_0x5fc6('0x26')]){delete _0x32e911['name'];}_0x17d86a[_0x5fc6('0x18')](_0x283eff)[_0x5fc6('0x27')](_0x32e911);};}exports[_0x5fc6('0x28')]=function(_0xec58dc,_0x465d5f){var _0x33619a={'raw':!![],'where':{'id':_0xec58dc[_0x5fc6('0x29')]['id']}},_0x6dc1da={};_0x6dc1da[_0x5fc6('0x2a')]=_[_0x5fc6('0x2b')](db[_0x5fc6('0x2c')]['rawAttributes']);_0x6dc1da[_0x5fc6('0x2d')]=_[_0x5fc6('0x2b')](_0xec58dc[_0x5fc6('0x2d')]);_0x6dc1da[_0x5fc6('0x2e')]=_['intersection'](_0x6dc1da[_0x5fc6('0x2a')],_0x6dc1da[_0x5fc6('0x2d')]);_0x33619a[_0x5fc6('0x2f')]=_['intersection'](_0x6dc1da[_0x5fc6('0x2a')],qs['fields'](_0xec58dc[_0x5fc6('0x2d')][_0x5fc6('0x30')]));_0x33619a[_0x5fc6('0x2f')]=_0x33619a[_0x5fc6('0x2f')][_0x5fc6('0x31')]?_0x33619a[_0x5fc6('0x2f')]:_0x6dc1da['model'];if(_0xec58dc[_0x5fc6('0x2d')]['includeAll']){_0x33619a[_0x5fc6('0x32')]=[{'all':!![]}];}_0x33619a=_['merge']({},_0x33619a,_0xec58dc[_0x5fc6('0x33')]);return db[_0x5fc6('0x2c')][_0x5fc6('0x34')](_0x33619a)['then'](handleEntityNotFound(_0x465d5f,null))[_0x5fc6('0x23')](respondWithResult(_0x465d5f,null))[_0x5fc6('0x35')](handleError(_0x465d5f,null));};exports[_0x5fc6('0x36')]=function(_0xa011c2,_0x1e05a0){if(_0xa011c2[_0x5fc6('0x37')]['id']){delete _0xa011c2[_0x5fc6('0x37')]['id'];}return db[_0x5fc6('0x2c')][_0x5fc6('0x34')]({'where':{'id':_0xa011c2[_0x5fc6('0x29')]['id']}})[_0x5fc6('0x23')](handleEntityNotFound(_0x1e05a0,null))['then'](saveUpdates(_0xa011c2['body'],null))[_0x5fc6('0x23')](respondWithResult(_0x1e05a0,null))[_0x5fc6('0x35')](handleError(_0x1e05a0,null));};exports[_0x5fc6('0x24')]=function(_0x48b2b4,_0x151c96){return db['ChatApplication'][_0x5fc6('0x34')]({'where':{'id':_0x48b2b4[_0x5fc6('0x29')]['id']}})[_0x5fc6('0x23')](handleEntityNotFound(_0x151c96,null))[_0x5fc6('0x23')](removeEntity(_0x151c96,null))[_0x5fc6('0x35')](handleError(_0x151c96,null));};
\ No newline at end of file
index f2f090f..9082b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4579=['define','chat_applications','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3fad5a,_0x2d3b02){var _0x4ca713=function(_0x2abe58){while(--_0x2abe58){_0x3fad5a['push'](_0x3fad5a['shift']());}};_0x4ca713(++_0x2d3b02);}(_0x4579,0x1d7));var _0x9457=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4579[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9457('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9457('0x1'));var moment=require(_0x9457('0x2'));var BPromise=require(_0x9457('0x3'));var rp=require(_0x9457('0x4'));var fs=require('fs');var path=require(_0x9457('0x5'));var rimraf=require(_0x9457('0x6'));var config=require(_0x9457('0x7'));var attributes=require('./chatApplication.attributes');module[_0x9457('0x8')]=function(_0x364bc5,_0x3b308b){return _0x364bc5[_0x9457('0x9')]('ChatApplication',attributes,{'tableName':_0x9457('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9457('0xb')});};
\ No newline at end of file
+var _0x0aaf=['../../config/environment','exports','ChatApplication','chat_applications','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x14ba10,_0x2d8a65){var _0x461cd8=function(_0x1f2002){while(--_0x1f2002){_0x14ba10['push'](_0x14ba10['shift']());}};_0x461cd8(++_0x2d8a65);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x20e295,_0x308599){_0x20e295=_0x20e295-0x0;var _0x33ffbe=_0x0aaf[_0x20e295];return _0x33ffbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0aa('0x0'))(_0xf0aa('0x1'));var moment=require(_0xf0aa('0x2'));var BPromise=require(_0xf0aa('0x3'));var rp=require(_0xf0aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0aa('0x5'));var config=require(_0xf0aa('0x6'));var attributes=require('./chatApplication.attributes');module[_0xf0aa('0x7')]=function(_0x4c20b5,_0x752f1b){return _0x4c20b5['define'](_0xf0aa('0x8'),attributes,{'tableName':_0xf0aa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf0aa('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 62c78a6..f06d48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ef4=['stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ef4,0xbe));var _0x46ef=function(_0x374ea8,_0x444720){_0x374ea8=_0x374ea8-0x0;var _0x5bdf9f=_0x6ef4[_0x374ea8];return _0x5bdf9f;};'use strict';var _=require(_0x46ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x46ef('0x1'));var rs=require(_0x46ef('0x2'));var fs=require('fs');var Redis=require(_0x46ef('0x3'));var db=require(_0x46ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46ef('0x5'))(_0x46ef('0x6'));var config=require(_0x46ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x46ef('0x8')][_0x46ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2606e3,_0x2d1e4d,_0x2cb653){return new BPromise(function(_0x2ac2e6,_0x40f35f){return client[_0x46ef('0xa')](_0x2606e3,_0x2cb653)[_0x46ef('0xb')](function(_0x294b04){logger[_0x46ef('0xc')](_0x46ef('0xd'),_0x2d1e4d,_0x46ef('0xe'));logger[_0x46ef('0xf')](_0x46ef('0x10'),_0x2d1e4d,_0x46ef('0xe'),JSON[_0x46ef('0x11')](_0x294b04));if(_0x294b04[_0x46ef('0x12')]){if(_0x294b04['error'][_0x46ef('0x13')]===0x1f4){logger[_0x46ef('0x12')]('ChatApplication,\x20%s,\x20%s',_0x2d1e4d,_0x294b04[_0x46ef('0x12')]['message']);return _0x40f35f(_0x294b04[_0x46ef('0x12')][_0x46ef('0x14')]);}logger[_0x46ef('0x12')](_0x46ef('0xd'),_0x2d1e4d,_0x294b04[_0x46ef('0x12')][_0x46ef('0x14')]);return _0x2ac2e6(_0x294b04['error'][_0x46ef('0x14')]);}else{logger[_0x46ef('0xc')]('ChatApplication,\x20%s,\x20%s',_0x2d1e4d,_0x46ef('0xe'));_0x2ac2e6(_0x294b04[_0x46ef('0x15')][_0x46ef('0x14')]);}})[_0x46ef('0x16')](function(_0x180399){logger[_0x46ef('0x12')](_0x46ef('0xd'),_0x2d1e4d,_0x180399);_0x40f35f(_0x180399);});});}
\ No newline at end of file
+var _0xfc30=['info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc30,0x152));var _0x0fc3=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0xfc30[_0x306106];return _0x4d6083;};'use strict';var _=require(_0x0fc3('0x0'));var util=require('util');var moment=require(_0x0fc3('0x1'));var BPromise=require(_0x0fc3('0x2'));var rs=require(_0x0fc3('0x3'));var fs=require('fs');var Redis=require(_0x0fc3('0x4'));var db=require(_0x0fc3('0x5'))['db'];var utils=require(_0x0fc3('0x6'));var logger=require(_0x0fc3('0x7'))('rpc');var config=require(_0x0fc3('0x8'));var jayson=require(_0x0fc3('0x9'));var client=jayson[_0x0fc3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa7dbf9,_0xb15cfc,_0x4566e3){return new BPromise(function(_0x20fafa,_0x50b1b5){return client[_0x0fc3('0xb')](_0xa7dbf9,_0x4566e3)[_0x0fc3('0xc')](function(_0x39c2da){logger['info'](_0x0fc3('0xd'),_0xb15cfc,_0x0fc3('0xe'));logger[_0x0fc3('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0xb15cfc,_0x0fc3('0xe'),JSON['stringify'](_0x39c2da));if(_0x39c2da[_0x0fc3('0x10')]){if(_0x39c2da[_0x0fc3('0x10')][_0x0fc3('0x11')]===0x1f4){logger[_0x0fc3('0x10')](_0x0fc3('0xd'),_0xb15cfc,_0x39c2da[_0x0fc3('0x10')][_0x0fc3('0x12')]);return _0x50b1b5(_0x39c2da[_0x0fc3('0x10')]['message']);}logger['error'](_0x0fc3('0xd'),_0xb15cfc,_0x39c2da[_0x0fc3('0x10')][_0x0fc3('0x12')]);return _0x20fafa(_0x39c2da[_0x0fc3('0x10')][_0x0fc3('0x12')]);}else{logger[_0x0fc3('0x13')](_0x0fc3('0xd'),_0xb15cfc,_0x0fc3('0xe'));_0x20fafa(_0x39c2da['result']['message']);}})[_0x0fc3('0x14')](function(_0x5b0374){logger[_0x0fc3('0x10')](_0x0fc3('0xd'),_0xb15cfc,_0x5b0374);_0x50b1b5(_0x5b0374);});});}
\ No newline at end of file
index 5ec25a6..fa852a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcef9=['../../config/environment','./chatApplication.controller','isAuthenticated','show','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4a4add,_0x39f696){var _0xece032=function(_0x2fbec9){while(--_0x2fbec9){_0x4a4add['push'](_0x4a4add['shift']());}};_0xece032(++_0x39f696);}(_0xcef9,0xf9));var _0x9cef=function(_0x20b7bb,_0x4a3d7e){_0x20b7bb=_0x20b7bb-0x0;var _0x137d6f=_0xcef9[_0x20b7bb];return _0x137d6f;};'use strict';var multer=require(_0x9cef('0x0'));var util=require(_0x9cef('0x1'));var path=require(_0x9cef('0x2'));var timeout=require(_0x9cef('0x3'));var express=require(_0x9cef('0x4'));var router=express[_0x9cef('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9cef('0x6'));var config=require(_0x9cef('0x7'));var controller=require(_0x9cef('0x8'));router['get']('/:id',auth[_0x9cef('0x9')](),controller[_0x9cef('0xa')]);router['put'](_0x9cef('0xb'),auth[_0x9cef('0x9')](),controller[_0x9cef('0xc')]);router[_0x9cef('0xd')](_0x9cef('0xb'),auth['isAuthenticated'](),controller[_0x9cef('0xe')]);module[_0x9cef('0xf')]=router;
\ No newline at end of file
+var _0x7758=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','update','delete','/:id','destroy','exports'];(function(_0x47d5db,_0x6b887f){var _0x4cc85c=function(_0x4c495d){while(--_0x4c495d){_0x47d5db['push'](_0x47d5db['shift']());}};_0x4cc85c(++_0x6b887f);}(_0x7758,0x132));var _0x8775=function(_0x38b5aa,_0x30f873){_0x38b5aa=_0x38b5aa-0x0;var _0x19bb36=_0x7758[_0x38b5aa];return _0x19bb36;};'use strict';var multer=require('multer');var util=require(_0x8775('0x0'));var path=require(_0x8775('0x1'));var timeout=require(_0x8775('0x2'));var express=require(_0x8775('0x3'));var router=express[_0x8775('0x4')]();var fs_extra=require(_0x8775('0x5'));var auth=require(_0x8775('0x6'));var interaction=require(_0x8775('0x7'));var config=require(_0x8775('0x8'));var controller=require(_0x8775('0x9'));router[_0x8775('0xa')]('/:id',auth[_0x8775('0xb')](),controller[_0x8775('0xc')]);router['put']('/:id',auth[_0x8775('0xb')](),controller[_0x8775('0xd')]);router[_0x8775('0xe')](_0x8775('0xf'),auth[_0x8775('0xb')](),controller[_0x8775('0x10')]);module[_0x8775('0x11')]=router;
\ No newline at end of file
index 9e2c5d9..e506b15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x862b=['STRING','BOOLEAN','sequelize','exports'];(function(_0x365ab7,_0x3a9f1c){var _0x1d1fb1=function(_0x85d03a){while(--_0x85d03a){_0x365ab7['push'](_0x365ab7['shift']());}};_0x1d1fb1(++_0x3a9f1c);}(_0x862b,0x14a));var _0xb862=function(_0x3a59fa,_0x3f5fe2){_0x3a59fa=_0x3a59fa-0x0;var _0x7d95a6=_0x862b[_0x3a59fa];return _0x7d95a6;};'use strict';var Sequelize=require(_0xb862('0x0'));module[_0xb862('0x1')]={'name':{'type':Sequelize[_0xb862('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb862('0x2')]},'write':{'type':Sequelize[_0xb862('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5f52=['BOOLEAN','sequelize','exports','STRING'];(function(_0x11bd81,_0x11fa4c){var _0x158de0=function(_0xa93fbb){while(--_0xa93fbb){_0x11bd81['push'](_0x11bd81['shift']());}};_0x158de0(++_0x11fa4c);}(_0x5f52,0xb5));var _0x25f5=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0x5f52[_0x57643b];return _0x53a35b;};'use strict';var Sequelize=require(_0x25f5('0x0'));module[_0x25f5('0x1')]={'name':{'type':Sequelize[_0x25f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x25f5('0x2')]},'write':{'type':Sequelize[_0x25f5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 3f7d662..a333300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x692d=['filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','zip-dir','fast-json-patch','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys'];(function(_0xae73e,_0x3c5b7c){var _0x2599e9=function(_0x572052){while(--_0x572052){_0xae73e['push'](_0xae73e['shift']());}};_0x2599e9(++_0x3c5b7c);}(_0x692d,0x8a));var _0xd692=function(_0x281863,_0x30efef){_0x281863=_0x281863-0x0;var _0x2304de=_0x692d[_0x281863];return _0x2304de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd692('0x0'));var jsonpatch=require(_0xd692('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd692('0x2'));var Mustache=require('mustache');var util=require(_0xd692('0x3'));var path=require(_0xd692('0x4'));var sox=require(_0xd692('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd692('0x6'));var squel=require(_0xd692('0x7'));var crypto=require('crypto');var jsforce=require(_0xd692('0x8'));var deskjs=require(_0xd692('0x9'));var toCsv=require(_0xd692('0xa'));var querystring=require('querystring');var Papa=require(_0xd692('0xb'));var Redis=require(_0xd692('0xc'));var authService=require(_0xd692('0xd'));var qs=require(_0xd692('0xe'));var as=require(_0xd692('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd692('0x10'))('api');var utils=require(_0xd692('0x11'));var config=require(_0xd692('0x12'));var licenseUtil=require(_0xd692('0x13'));var db=require(_0xd692('0x14'))['db'];config[_0xd692('0x15')]=_[_0xd692('0x16')](config[_0xd692('0x15')],{'host':_0xd692('0x17'),'port':0x18eb});var socket=require(_0xd692('0x18'))(new Redis(config[_0xd692('0x15')]));require(_0xd692('0x19'))['register'](socket);function respondWithStatusCode(_0x2c9962,_0x3765fd){_0x3765fd=_0x3765fd||0xcc;return function(_0x3049f0){if(_0x3049f0){return _0x2c9962[_0xd692('0x1a')](_0x3765fd);}return _0x2c9962[_0xd692('0x1b')](_0x3765fd)['end']();};}function respondWithResult(_0x1d5acf,_0xb52cfd){_0xb52cfd=_0xb52cfd||0xc8;return function(_0x2a1e13){if(_0x2a1e13){return _0x1d5acf['status'](_0xb52cfd)['json'](_0x2a1e13);}};}function respondWithFilteredResult(_0x355eeb,_0x574922){return function(_0x2bbfb0){if(_0x2bbfb0){var _0x2557f7=typeof _0x574922[_0xd692('0x1c')]==='undefined'&&typeof _0x574922[_0xd692('0x1d')]===_0xd692('0x1e');var _0x2c931c=_0x2bbfb0['count'];var _0x1dadb5=_0x2557f7?0x0:_0x574922[_0xd692('0x1c')];var _0x34f81c=_0x2557f7?_0x2bbfb0[_0xd692('0x1f')]:_0x574922['offset']+_0x574922[_0xd692('0x1d')];var _0x58dcb5;if(_0x34f81c>=_0x2c931c){_0x34f81c=_0x2c931c;_0x58dcb5=0xc8;}else{_0x58dcb5=0xce;}_0x355eeb[_0xd692('0x1b')](_0x58dcb5);return _0x355eeb['set'](_0xd692('0x20'),_0x1dadb5+'-'+_0x34f81c+'/'+_0x2c931c)['json'](_0x2bbfb0);}return null;};}function patchUpdates(_0x582a1b){return function(_0x36ef97){try{jsonpatch[_0xd692('0x21')](_0x36ef97,_0x582a1b,!![]);}catch(_0x118437){return BPromise[_0xd692('0x22')](_0x118437);}return _0x36ef97[_0xd692('0x23')]();};}function saveUpdates(_0x6ae5c0,_0x21e26c){return function(_0x1f69d5){if(_0x1f69d5){return _0x1f69d5['update'](_0x6ae5c0)[_0xd692('0x24')](function(_0x165fd1){return _0x165fd1;});}return null;};}function removeEntity(_0x520c68,_0x41be3a){return function(_0x1c9ac4){if(_0x1c9ac4){return _0x1c9ac4[_0xd692('0x25')]()[_0xd692('0x24')](function(){_0x520c68['status'](0xcc)[_0xd692('0x26')]();});}};}function handleEntityNotFound(_0x5e8adb,_0x4b3bd2){return function(_0x2cda04){if(!_0x2cda04){_0x5e8adb['sendStatus'](0x194);}return _0x2cda04;};}function handleError(_0x2574a5,_0xe0e82b){_0xe0e82b=_0xe0e82b||0x1f4;return function(_0x4459a1){logger[_0xd692('0x27')](_0x4459a1[_0xd692('0x28')]);if(_0x4459a1[_0xd692('0x29')]){delete _0x4459a1[_0xd692('0x29')];}_0x2574a5[_0xd692('0x1b')](_0xe0e82b)[_0xd692('0x2a')](_0x4459a1);};}exports[_0xd692('0x2b')]=function(_0x5a37c5,_0x150af8){var _0x4b6503={},_0x4a8549={},_0x7fe345={'count':0x0,'rows':[]};var _0x55cf02=_[_0xd692('0x2c')](db['ChatGroup'][_0xd692('0x2d')],function(_0x3722d8){return{'name':_0x3722d8[_0xd692('0x2e')],'type':_0x3722d8['type'][_0xd692('0x2f')]};});_0x4a8549[_0xd692('0x30')]=_[_0xd692('0x2c')](_0x55cf02,'name');_0x4a8549['query']=_[_0xd692('0x31')](_0x5a37c5['query']);_0x4a8549[_0xd692('0x32')]=_[_0xd692('0x33')](_0x4a8549[_0xd692('0x30')],_0x4a8549['query']);_0x4b6503[_0xd692('0x34')]=_['intersection'](_0x4a8549[_0xd692('0x30')],qs['fields'](_0x5a37c5[_0xd692('0x35')][_0xd692('0x36')]));_0x4b6503[_0xd692('0x34')]=_0x4b6503[_0xd692('0x34')][_0xd692('0x37')]?_0x4b6503[_0xd692('0x34')]:_0x4a8549[_0xd692('0x30')];if(!_0x5a37c5['query'][_0xd692('0x38')](_0xd692('0x39'))){_0x4b6503[_0xd692('0x1d')]=qs['limit'](_0x5a37c5[_0xd692('0x35')]['limit']);_0x4b6503[_0xd692('0x1c')]=qs[_0xd692('0x1c')](_0x5a37c5[_0xd692('0x35')][_0xd692('0x1c')]);}_0x4b6503[_0xd692('0x3a')]=qs[_0xd692('0x3b')](_0x5a37c5[_0xd692('0x35')]['sort']);_0x4b6503[_0xd692('0x3c')]=qs[_0xd692('0x32')](_[_0xd692('0x3d')](_0x5a37c5['query'],_0x4a8549['filters']),_0x55cf02);if(_0x5a37c5[_0xd692('0x35')][_0xd692('0x3e')]){_0x4b6503[_0xd692('0x3c')]=_['merge'](_0x4b6503['where'],{'$or':_[_0xd692('0x2c')](_0x55cf02,function(_0x2dc21d){if(_0x2dc21d[_0xd692('0x3f')]!==_0xd692('0x40')){var _0x35f74c={};_0x35f74c[_0x2dc21d[_0xd692('0x29')]]={'$like':'%'+_0x5a37c5['query'][_0xd692('0x3e')]+'%'};return _0x35f74c;}})});}_0x4b6503=_[_0xd692('0x41')]({},_0x4b6503,_0x5a37c5['options']);var _0x521992={'where':_0x4b6503['where']};return db[_0xd692('0x42')]['count'](_0x521992)[_0xd692('0x24')](function(_0x2aa839){_0x7fe345[_0xd692('0x1f')]=_0x2aa839;if(_0x5a37c5['query'][_0xd692('0x43')]){_0x4b6503[_0xd692('0x44')]=[{'all':!![]}];}return db[_0xd692('0x42')][_0xd692('0x45')](_0x4b6503);})[_0xd692('0x24')](function(_0x383337){_0x7fe345[_0xd692('0x46')]=_0x383337;return _0x7fe345;})[_0xd692('0x24')](respondWithFilteredResult(_0x150af8,_0x4b6503))[_0xd692('0x47')](handleError(_0x150af8,null));};exports[_0xd692('0x48')]=function(_0x56ec0e,_0x34382c){var _0x43dd01={'raw':!![],'where':{'id':_0x56ec0e[_0xd692('0x49')]['id']}},_0xb26eef={};_0xb26eef['model']=_[_0xd692('0x31')](db[_0xd692('0x42')]['rawAttributes']);_0xb26eef[_0xd692('0x35')]=_[_0xd692('0x31')](_0x56ec0e[_0xd692('0x35')]);_0xb26eef[_0xd692('0x32')]=_['intersection'](_0xb26eef['model'],_0xb26eef[_0xd692('0x35')]);_0x43dd01[_0xd692('0x34')]=_[_0xd692('0x33')](_0xb26eef[_0xd692('0x30')],qs[_0xd692('0x36')](_0x56ec0e['query']['fields']));_0x43dd01[_0xd692('0x34')]=_0x43dd01[_0xd692('0x34')][_0xd692('0x37')]?_0x43dd01['attributes']:_0xb26eef['model'];if(_0x56ec0e[_0xd692('0x35')]['includeAll']){_0x43dd01[_0xd692('0x44')]=[{'all':!![]}];}_0x43dd01=_[_0xd692('0x41')]({},_0x43dd01,_0x56ec0e[_0xd692('0x4a')]);return db['ChatGroup'][_0xd692('0x4b')](_0x43dd01)[_0xd692('0x24')](handleEntityNotFound(_0x34382c,null))[_0xd692('0x24')](respondWithResult(_0x34382c,null))['catch'](handleError(_0x34382c,null));};exports[_0xd692('0x4c')]=function(_0x3a0ed3,_0x3c75b9){return db[_0xd692('0x42')]['create'](_0x3a0ed3[_0xd692('0x4d')],{})[_0xd692('0x24')](respondWithResult(_0x3c75b9,0xc9))[_0xd692('0x47')](handleError(_0x3c75b9,null));};exports[_0xd692('0x4e')]=function(_0x5db330,_0x484fd4){if(_0x5db330[_0xd692('0x4d')]['id']){delete _0x5db330[_0xd692('0x4d')]['id'];}return db[_0xd692('0x42')]['find']({'where':{'id':_0x5db330[_0xd692('0x49')]['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x484fd4,null))[_0xd692('0x24')](saveUpdates(_0x5db330['body'],null))[_0xd692('0x24')](respondWithResult(_0x484fd4,null))[_0xd692('0x47')](handleError(_0x484fd4,null));};exports[_0xd692('0x25')]=function(_0x1543a2,_0x2d7ace){return db['ChatGroup'][_0xd692('0x4b')]({'where':{'id':_0x1543a2[_0xd692('0x49')]['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x2d7ace,null))['then'](removeEntity(_0x2d7ace,null))['catch'](handleError(_0x2d7ace,null));};exports['describe']=function(_0x1fd476,_0x561477){return db['ChatGroup'][_0xd692('0x4f')]()[_0xd692('0x24')](respondWithResult(_0x561477,null))[_0xd692('0x47')](handleError(_0x561477,null));};exports['getUnread']=function(_0x3a8640,_0x2c98c2,_0x4b4263){return db[_0xd692('0x50')]['count']({'where':{'ChatGroupId':_0x3a8640[_0xd692('0x49')]['id'],'ToId':_0x3a8640[_0xd692('0x51')]['id'],'read':![]}})[_0xd692('0x24')](function(_0x2fa0b0){return{'id':_[_0xd692('0x52')](_0x3a8640[_0xd692('0x49')]['id']),'count':_0x2fa0b0};})['then'](respondWithResult(_0x2c98c2,null))[_0xd692('0x47')](handleError(_0x2c98c2,null));};exports[_0xd692('0x53')]=function(_0x74f33c,_0xda6967,_0x4e0064){return db[_0xd692('0x42')][_0xd692('0x4b')]({'where':{'id':_0x74f33c[_0xd692('0x49')]['id']}})[_0xd692('0x24')](handleEntityNotFound(_0xda6967,null))[_0xd692('0x24')](function(_0x10cc2b){if(_0x10cc2b){return _0x10cc2b['addMembers'](_0x74f33c[_0xd692('0x4d')][_0xd692('0x54')],_['omit'](_0x74f33c['body'],['ids','id'])||{});}})[_0xd692('0x24')](respondWithResult(_0xda6967,null))[_0xd692('0x47')](handleError(_0xda6967,null));};exports['getMembers']=function(_0x1f0574,_0x5db301,_0x537698){var _0x3988d0={};var _0x1f543a={};var _0x36324e;var _0x27e714;return db[_0xd692('0x42')][_0xd692('0x55')]({'where':{'id':_0x1f0574[_0xd692('0x49')]['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x5db301,null))[_0xd692('0x24')](function(_0x2fe658){if(_0x2fe658){_0x36324e=_0x2fe658;_0x1f543a[_0xd692('0x30')]=_[_0xd692('0x31')](db[_0xd692('0x56')][_0xd692('0x2d')]);_0x1f543a[_0xd692('0x35')]=_[_0xd692('0x31')](_0x1f0574[_0xd692('0x35')]);_0x1f543a[_0xd692('0x32')]=_[_0xd692('0x33')](_0x1f543a[_0xd692('0x30')],_0x1f543a['query']);_0x3988d0[_0xd692('0x34')]=_[_0xd692('0x33')](_0x1f543a['model'],qs[_0xd692('0x36')](_0x1f0574['query'][_0xd692('0x36')]));_0x3988d0['attributes']=_0x3988d0[_0xd692('0x34')][_0xd692('0x37')]?_0x3988d0[_0xd692('0x34')]:_0x1f543a[_0xd692('0x30')];_0x3988d0['order']=qs[_0xd692('0x3b')](_0x1f0574[_0xd692('0x35')]['sort']);_0x3988d0[_0xd692('0x3c')]=qs['filters'](_[_0xd692('0x3d')](_0x1f0574[_0xd692('0x35')],_0x1f543a['filters']));if(_0x1f0574[_0xd692('0x35')][_0xd692('0x3e')]){_0x3988d0[_0xd692('0x3c')]=_['merge'](_0x3988d0[_0xd692('0x3c')],{'$or':_[_0xd692('0x2c')](_0x3988d0[_0xd692('0x34')],function(_0x53015f){var _0x30b7bc={};_0x30b7bc[_0x53015f]={'$like':'%'+_0x1f0574[_0xd692('0x35')][_0xd692('0x3e')]+'%'};return _0x30b7bc;})});}_0x3988d0=_[_0xd692('0x41')]({},_0x3988d0,_0x1f0574[_0xd692('0x4a')]);return _0x36324e['getMembers'](_0x3988d0);}})[_0xd692('0x24')](function(_0x46cd09){if(_0x46cd09){_0x27e714=_0x46cd09[_0xd692('0x37')];if(!_0x1f0574[_0xd692('0x35')][_0xd692('0x38')](_0xd692('0x39'))){_0x3988d0[_0xd692('0x1d')]=qs[_0xd692('0x1d')](_0x1f0574[_0xd692('0x35')]['limit']);_0x3988d0[_0xd692('0x1c')]=qs[_0xd692('0x1c')](_0x1f0574['query']['offset']);}return _0x36324e['getMembers'](_0x3988d0);}})[_0xd692('0x24')](function(_0xed2478){if(_0xed2478){return _0xed2478?{'count':_0x27e714,'rows':_0xed2478}:null;}})[_0xd692('0x24')](respondWithResult(_0x5db301,null))[_0xd692('0x47')](handleError(_0x5db301,null));};exports[_0xd692('0x57')]=function(_0x2b7662,_0x5ad829,_0x16f8e5){return db[_0xd692('0x42')][_0xd692('0x4b')]({'where':{'id':_0x2b7662['params']['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x5ad829,null))[_0xd692('0x24')](function(_0x2ecdbc){if(_0x2ecdbc){return _0x2ecdbc[_0xd692('0x57')](_0x2b7662[_0xd692('0x35')][_0xd692('0x54')]);}})[_0xd692('0x24')](respondWithStatusCode(_0x5ad829,null))[_0xd692('0x47')](handleError(_0x5ad829,null));};exports[_0xd692('0x58')]=function(_0x56bce0,_0x5d55fb,_0x31f438){if(_0x56bce0[_0xd692('0x4d')]['id']){delete _0x56bce0['body']['id'];}return db[_0xd692('0x42')]['find']({'where':{'id':_0x56bce0[_0xd692('0x49')]['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x5d55fb,null))[_0xd692('0x24')](function(_0x38b5c5){if(_0x38b5c5){_0x56bce0['body'][_0xd692('0x59')]=_0x38b5c5['id'];return db[_0xd692('0x50')][_0xd692('0x4c')](_0x56bce0[_0xd692('0x4d')]);}})['then'](respondWithResult(_0x5d55fb,null))[_0xd692('0x47')](handleError(_0x5d55fb,null));};exports[_0xd692('0x5a')]=function(_0x110d13,_0x3ef9e9,_0x2495e2){var _0x501473={};var _0x16e4ed={};var _0xb8ffc3;var _0x115e19;return db[_0xd692('0x42')][_0xd692('0x55')]({'where':{'id':_0x110d13['params']['id']}})[_0xd692('0x24')](handleEntityNotFound(_0x3ef9e9,null))['then'](function(_0x18f397){if(_0x18f397){_0xb8ffc3=_0x18f397;_0x16e4ed[_0xd692('0x30')]=_[_0xd692('0x31')](db[_0xd692('0x50')][_0xd692('0x2d')]);_0x16e4ed[_0xd692('0x35')]=_[_0xd692('0x31')](_0x110d13[_0xd692('0x35')]);_0x16e4ed[_0xd692('0x32')]=_[_0xd692('0x33')](_0x16e4ed['model'],_0x16e4ed[_0xd692('0x35')]);_0x501473['attributes']=_[_0xd692('0x33')](_0x16e4ed[_0xd692('0x30')],qs[_0xd692('0x36')](_0x110d13[_0xd692('0x35')]['fields']));_0x501473['attributes']=_0x501473[_0xd692('0x34')][_0xd692('0x37')]?_0x501473[_0xd692('0x34')]:_0x16e4ed['model'];_0x501473[_0xd692('0x3a')]=qs['sort'](_0x110d13[_0xd692('0x35')][_0xd692('0x3b')]);_0x501473[_0xd692('0x3c')]=qs[_0xd692('0x32')](_[_0xd692('0x3d')](_0x110d13[_0xd692('0x35')],_0x16e4ed[_0xd692('0x32')]));if(_0x110d13[_0xd692('0x35')][_0xd692('0x3e')]){_0x501473[_0xd692('0x3c')]=_[_0xd692('0x41')](_0x501473[_0xd692('0x3c')],{'$or':_[_0xd692('0x2c')](_0x501473[_0xd692('0x34')],function(_0x39bd5){var _0x4ed6e5={};_0x4ed6e5[_0x39bd5]={'$like':'%'+_0x110d13[_0xd692('0x35')][_0xd692('0x3e')]+'%'};return _0x4ed6e5;})});}if(_0x110d13[_0xd692('0x35')]['$gte']){var _0x5bb49c=_0x110d13[_0xd692('0x35')][_0xd692('0x5b')][_0xd692('0x5c')](',');var _0x5cb340={};_0x5cb340[_0x5bb49c[0x0]]={'$gte':moment(_0x5bb49c[0x1])['format'](_0xd692('0x5d'))};_0x501473['where']=_[_0xd692('0x41')](_0x501473[_0xd692('0x3c')],_0x5cb340);}_0x501473=_[_0xd692('0x41')]({},_0x501473,_0x110d13[_0xd692('0x4a')]);return _0xb8ffc3['getMessages'](_0x501473);}})[_0xd692('0x24')](function(_0x2f3675){if(_0x2f3675){_0x115e19=_0x2f3675[_0xd692('0x37')];if(!_0x110d13[_0xd692('0x35')][_0xd692('0x38')](_0xd692('0x39'))){_0x501473[_0xd692('0x1d')]=qs['limit'](_0x110d13['query'][_0xd692('0x1d')]);_0x501473[_0xd692('0x1c')]=qs[_0xd692('0x1c')](_0x110d13[_0xd692('0x35')]['offset']);}return _0xb8ffc3[_0xd692('0x5a')](_0x501473);}})[_0xd692('0x24')](function(_0x5355d8){if(_0x5355d8){return _0x5355d8?{'count':_0x115e19,'rows':_0x5355d8}:null;}})[_0xd692('0x24')](respondWithResult(_0x3ef9e9,null))[_0xd692('0x47')](handleError(_0x3ef9e9,null));};
\ No newline at end of file
+var _0xe92e=['YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','key','model','query','intersection','attributes','fields','order','sort','filters','pick','where','type','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','hasOwnProperty','nolimit','removeMembers','ChatGroupId','$gte','split'];(function(_0x208d69,_0x5bbfd1){var _0x42702c=function(_0x1b247a){while(--_0x1b247a){_0x208d69['push'](_0x208d69['shift']());}};_0x42702c(++_0x5bbfd1);}(_0xe92e,0x1ce));var _0xee92=function(_0x188568,_0x2ce192){_0x188568=_0x188568-0x0;var _0x2d17dd=_0xe92e[_0x188568];return _0x2d17dd;};'use strict';var emlformat=require(_0xee92('0x0'));var rimraf=require(_0xee92('0x1'));var zipdir=require(_0xee92('0x2'));var jsonpatch=require(_0xee92('0x3'));var rp=require(_0xee92('0x4'));var moment=require(_0xee92('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xee92('0x6'));var util=require(_0xee92('0x7'));var path=require(_0xee92('0x8'));var sox=require(_0xee92('0x9'));var csv=require(_0xee92('0xa'));var ejs=require(_0xee92('0xb'));var fs=require('fs');var fs_extra=require(_0xee92('0xc'));var _=require(_0xee92('0xd'));var squel=require('squel');var crypto=require(_0xee92('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xee92('0xf'));var toCsv=require(_0xee92('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xee92('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xee92('0x11'));var hardwareService=require(_0xee92('0x12'));var logger=require(_0xee92('0x13'))(_0xee92('0x14'));var utils=require('../../config/utils');var config=require(_0xee92('0x15'));var licenseUtil=require(_0xee92('0x16'));var db=require(_0xee92('0x17'))['db'];config[_0xee92('0x18')]=_[_0xee92('0x19')](config[_0xee92('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xee92('0x1a'))(new Redis(config[_0xee92('0x18')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x55b74e,_0x191069){_0x191069=_0x191069||0xcc;return function(_0x439ea4){if(_0x439ea4){return _0x55b74e[_0xee92('0x1b')](_0x191069);}return _0x55b74e[_0xee92('0x1c')](_0x191069)[_0xee92('0x1d')]();};}function respondWithResult(_0xeb9c1b,_0x19864b){_0x19864b=_0x19864b||0xc8;return function(_0x38151a){if(_0x38151a){return _0xeb9c1b[_0xee92('0x1c')](_0x19864b)[_0xee92('0x1e')](_0x38151a);}};}function respondWithFilteredResult(_0x5d3801,_0x545c2a){return function(_0x3ed279){if(_0x3ed279){var _0x306ff3=typeof _0x545c2a['offset']===_0xee92('0x1f')&&typeof _0x545c2a['limit']===_0xee92('0x1f');var _0x985268=_0x3ed279[_0xee92('0x20')];var _0x1337ed=_0x306ff3?0x0:_0x545c2a[_0xee92('0x21')];var _0x53db31=_0x306ff3?_0x3ed279[_0xee92('0x20')]:_0x545c2a['offset']+_0x545c2a[_0xee92('0x22')];var _0x111303;if(_0x53db31>=_0x985268){_0x53db31=_0x985268;_0x111303=0xc8;}else{_0x111303=0xce;}_0x5d3801['status'](_0x111303);return _0x5d3801[_0xee92('0x23')]('Content-Range',_0x1337ed+'-'+_0x53db31+'/'+_0x985268)['json'](_0x3ed279);}return null;};}function patchUpdates(_0x3930b9){return function(_0x20afe6){try{jsonpatch[_0xee92('0x24')](_0x20afe6,_0x3930b9,!![]);}catch(_0x46ff1d){return BPromise[_0xee92('0x25')](_0x46ff1d);}return _0x20afe6[_0xee92('0x26')]();};}function saveUpdates(_0x4e2000,_0x42a9b2){return function(_0x55a702){if(_0x55a702){return _0x55a702[_0xee92('0x27')](_0x4e2000)[_0xee92('0x28')](function(_0x309d79){return _0x309d79;});}return null;};}function removeEntity(_0x4c5f34,_0x509682){return function(_0x442913){if(_0x442913){return _0x442913[_0xee92('0x29')]()[_0xee92('0x28')](function(){_0x4c5f34['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2921e1,_0x3bb0d5){return function(_0x113c66){if(!_0x113c66){_0x2921e1[_0xee92('0x1b')](0x194);}return _0x113c66;};}function handleError(_0x23db9f,_0x346bad){_0x346bad=_0x346bad||0x1f4;return function(_0x526749){logger[_0xee92('0x2a')](_0x526749['stack']);if(_0x526749[_0xee92('0x2b')]){delete _0x526749[_0xee92('0x2b')];}_0x23db9f[_0xee92('0x1c')](_0x346bad)[_0xee92('0x2c')](_0x526749);};}exports[_0xee92('0x2d')]=function(_0x321fbe,_0x3aa9d9){var _0x536077={},_0xf3a71f={},_0x36353a={'count':0x0,'rows':[]};var _0x327160=_[_0xee92('0x2e')](db[_0xee92('0x2f')][_0xee92('0x30')],function(_0x4ab1a8){return{'name':_0x4ab1a8['fieldName'],'type':_0x4ab1a8['type'][_0xee92('0x31')]};});_0xf3a71f[_0xee92('0x32')]=_[_0xee92('0x2e')](_0x327160,'name');_0xf3a71f[_0xee92('0x33')]=_['keys'](_0x321fbe[_0xee92('0x33')]);_0xf3a71f['filters']=_[_0xee92('0x34')](_0xf3a71f[_0xee92('0x32')],_0xf3a71f['query']);_0x536077[_0xee92('0x35')]=_[_0xee92('0x34')](_0xf3a71f[_0xee92('0x32')],qs[_0xee92('0x36')](_0x321fbe[_0xee92('0x33')][_0xee92('0x36')]));_0x536077[_0xee92('0x35')]=_0x536077[_0xee92('0x35')]['length']?_0x536077[_0xee92('0x35')]:_0xf3a71f[_0xee92('0x32')];if(!_0x321fbe[_0xee92('0x33')]['hasOwnProperty']('nolimit')){_0x536077[_0xee92('0x22')]=qs[_0xee92('0x22')](_0x321fbe[_0xee92('0x33')][_0xee92('0x22')]);_0x536077[_0xee92('0x21')]=qs['offset'](_0x321fbe[_0xee92('0x33')][_0xee92('0x21')]);}_0x536077[_0xee92('0x37')]=qs[_0xee92('0x38')](_0x321fbe['query'][_0xee92('0x38')]);_0x536077['where']=qs[_0xee92('0x39')](_[_0xee92('0x3a')](_0x321fbe[_0xee92('0x33')],_0xf3a71f[_0xee92('0x39')]),_0x327160);if(_0x321fbe[_0xee92('0x33')]['filter']){_0x536077[_0xee92('0x3b')]=_['merge'](_0x536077[_0xee92('0x3b')],{'$or':_['map'](_0x327160,function(_0x12e683){if(_0x12e683[_0xee92('0x3c')]!=='VIRTUAL'){var _0x3a2747={};_0x3a2747[_0x12e683['name']]={'$like':'%'+_0x321fbe[_0xee92('0x33')][_0xee92('0x3d')]+'%'};return _0x3a2747;}})});}_0x536077=_[_0xee92('0x3e')]({},_0x536077,_0x321fbe[_0xee92('0x3f')]);var _0x3ac5f5={'where':_0x536077['where']};return db[_0xee92('0x2f')][_0xee92('0x20')](_0x3ac5f5)[_0xee92('0x28')](function(_0x368be8){_0x36353a[_0xee92('0x20')]=_0x368be8;if(_0x321fbe[_0xee92('0x33')][_0xee92('0x40')]){_0x536077[_0xee92('0x41')]=[{'all':!![]}];}return db[_0xee92('0x2f')][_0xee92('0x42')](_0x536077);})[_0xee92('0x28')](function(_0x29a9c9){_0x36353a['rows']=_0x29a9c9;return _0x36353a;})[_0xee92('0x28')](respondWithFilteredResult(_0x3aa9d9,_0x536077))[_0xee92('0x43')](handleError(_0x3aa9d9,null));};exports[_0xee92('0x44')]=function(_0x2d6d8a,_0x26594f){var _0x27c57a={'raw':!![],'where':{'id':_0x2d6d8a[_0xee92('0x45')]['id']}},_0x4d915f={};_0x4d915f[_0xee92('0x32')]=_[_0xee92('0x46')](db['ChatGroup'][_0xee92('0x30')]);_0x4d915f[_0xee92('0x33')]=_[_0xee92('0x46')](_0x2d6d8a['query']);_0x4d915f[_0xee92('0x39')]=_[_0xee92('0x34')](_0x4d915f[_0xee92('0x32')],_0x4d915f[_0xee92('0x33')]);_0x27c57a[_0xee92('0x35')]=_['intersection'](_0x4d915f[_0xee92('0x32')],qs[_0xee92('0x36')](_0x2d6d8a[_0xee92('0x33')][_0xee92('0x36')]));_0x27c57a[_0xee92('0x35')]=_0x27c57a[_0xee92('0x35')][_0xee92('0x47')]?_0x27c57a['attributes']:_0x4d915f['model'];if(_0x2d6d8a['query'][_0xee92('0x40')]){_0x27c57a['include']=[{'all':!![]}];}_0x27c57a=_[_0xee92('0x3e')]({},_0x27c57a,_0x2d6d8a[_0xee92('0x3f')]);return db['ChatGroup'][_0xee92('0x48')](_0x27c57a)[_0xee92('0x28')](handleEntityNotFound(_0x26594f,null))[_0xee92('0x28')](respondWithResult(_0x26594f,null))[_0xee92('0x43')](handleError(_0x26594f,null));};exports[_0xee92('0x49')]=function(_0x536543,_0x137881){return db[_0xee92('0x2f')]['create'](_0x536543[_0xee92('0x4a')],{})['then'](respondWithResult(_0x137881,0xc9))[_0xee92('0x43')](handleError(_0x137881,null));};exports[_0xee92('0x27')]=function(_0x280548,_0x4ec713){if(_0x280548[_0xee92('0x4a')]['id']){delete _0x280548['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x280548[_0xee92('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ec713,null))[_0xee92('0x28')](saveUpdates(_0x280548[_0xee92('0x4a')],null))['then'](respondWithResult(_0x4ec713,null))[_0xee92('0x43')](handleError(_0x4ec713,null));};exports[_0xee92('0x29')]=function(_0x17a9be,_0x4f1d75){return db[_0xee92('0x2f')][_0xee92('0x48')]({'where':{'id':_0x17a9be[_0xee92('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f1d75,null))[_0xee92('0x28')](removeEntity(_0x4f1d75,null))[_0xee92('0x43')](handleError(_0x4f1d75,null));};exports[_0xee92('0x4b')]=function(_0x14f207,_0x2421b2){return db[_0xee92('0x2f')][_0xee92('0x4b')]()[_0xee92('0x28')](respondWithResult(_0x2421b2,null))[_0xee92('0x43')](handleError(_0x2421b2,null));};exports[_0xee92('0x4c')]=function(_0x428fbc,_0xbb1fc4,_0x570cc3){return db[_0xee92('0x4d')]['count']({'where':{'ChatGroupId':_0x428fbc[_0xee92('0x45')]['id'],'ToId':_0x428fbc['user']['id'],'read':![]}})[_0xee92('0x28')](function(_0x3d6f10){return{'id':_[_0xee92('0x4e')](_0x428fbc['params']['id']),'count':_0x3d6f10};})['then'](respondWithResult(_0xbb1fc4,null))[_0xee92('0x43')](handleError(_0xbb1fc4,null));};exports[_0xee92('0x4f')]=function(_0x37eaa0,_0x5a7780,_0x4a6f4f){return db['ChatGroup'][_0xee92('0x48')]({'where':{'id':_0x37eaa0[_0xee92('0x45')]['id']}})[_0xee92('0x28')](handleEntityNotFound(_0x5a7780,null))[_0xee92('0x28')](function(_0x22c435){if(_0x22c435){return _0x22c435['addMembers'](_0x37eaa0[_0xee92('0x4a')][_0xee92('0x50')],_['omit'](_0x37eaa0[_0xee92('0x4a')],['ids','id'])||{});}})[_0xee92('0x28')](respondWithResult(_0x5a7780,null))[_0xee92('0x43')](handleError(_0x5a7780,null));};exports[_0xee92('0x51')]=function(_0x275920,_0x32d98b,_0x5808d8){var _0x228f33={};var _0x50444e={};var _0x2eda3a;var _0x3ad6b1;return db[_0xee92('0x2f')][_0xee92('0x52')]({'where':{'id':_0x275920[_0xee92('0x45')]['id']}})[_0xee92('0x28')](handleEntityNotFound(_0x32d98b,null))[_0xee92('0x28')](function(_0x4a68e5){if(_0x4a68e5){_0x2eda3a=_0x4a68e5;_0x50444e['model']=_['keys'](db[_0xee92('0x53')][_0xee92('0x30')]);_0x50444e['query']=_[_0xee92('0x46')](_0x275920[_0xee92('0x33')]);_0x50444e[_0xee92('0x39')]=_[_0xee92('0x34')](_0x50444e['model'],_0x50444e[_0xee92('0x33')]);_0x228f33[_0xee92('0x35')]=_['intersection'](_0x50444e[_0xee92('0x32')],qs['fields'](_0x275920[_0xee92('0x33')][_0xee92('0x36')]));_0x228f33[_0xee92('0x35')]=_0x228f33['attributes'][_0xee92('0x47')]?_0x228f33['attributes']:_0x50444e[_0xee92('0x32')];_0x228f33[_0xee92('0x37')]=qs[_0xee92('0x38')](_0x275920['query'][_0xee92('0x38')]);_0x228f33[_0xee92('0x3b')]=qs[_0xee92('0x39')](_[_0xee92('0x3a')](_0x275920[_0xee92('0x33')],_0x50444e[_0xee92('0x39')]));if(_0x275920[_0xee92('0x33')][_0xee92('0x3d')]){_0x228f33[_0xee92('0x3b')]=_['merge'](_0x228f33['where'],{'$or':_[_0xee92('0x2e')](_0x228f33[_0xee92('0x35')],function(_0x29a49b){var _0x267d49={};_0x267d49[_0x29a49b]={'$like':'%'+_0x275920[_0xee92('0x33')][_0xee92('0x3d')]+'%'};return _0x267d49;})});}_0x228f33=_[_0xee92('0x3e')]({},_0x228f33,_0x275920['options']);return _0x2eda3a[_0xee92('0x51')](_0x228f33);}})[_0xee92('0x28')](function(_0x4abcc3){if(_0x4abcc3){_0x3ad6b1=_0x4abcc3['length'];if(!_0x275920['query'][_0xee92('0x54')](_0xee92('0x55'))){_0x228f33[_0xee92('0x22')]=qs[_0xee92('0x22')](_0x275920[_0xee92('0x33')]['limit']);_0x228f33[_0xee92('0x21')]=qs[_0xee92('0x21')](_0x275920['query']['offset']);}return _0x2eda3a['getMembers'](_0x228f33);}})[_0xee92('0x28')](function(_0x5dbbe3){if(_0x5dbbe3){return _0x5dbbe3?{'count':_0x3ad6b1,'rows':_0x5dbbe3}:null;}})[_0xee92('0x28')](respondWithResult(_0x32d98b,null))[_0xee92('0x43')](handleError(_0x32d98b,null));};exports[_0xee92('0x56')]=function(_0x8ebf8c,_0xee7788,_0x1f25d8){return db[_0xee92('0x2f')][_0xee92('0x48')]({'where':{'id':_0x8ebf8c[_0xee92('0x45')]['id']}})[_0xee92('0x28')](handleEntityNotFound(_0xee7788,null))[_0xee92('0x28')](function(_0x59ebae){if(_0x59ebae){return _0x59ebae[_0xee92('0x56')](_0x8ebf8c['query'][_0xee92('0x50')]);}})[_0xee92('0x28')](respondWithStatusCode(_0xee7788,null))['catch'](handleError(_0xee7788,null));};exports['addMessage']=function(_0xf50ee9,_0x39a42b,_0x36d882){if(_0xf50ee9['body']['id']){delete _0xf50ee9[_0xee92('0x4a')]['id'];}return db['ChatGroup'][_0xee92('0x48')]({'where':{'id':_0xf50ee9['params']['id']}})[_0xee92('0x28')](handleEntityNotFound(_0x39a42b,null))['then'](function(_0x3891d6){if(_0x3891d6){_0xf50ee9[_0xee92('0x4a')][_0xee92('0x57')]=_0x3891d6['id'];return db[_0xee92('0x4d')][_0xee92('0x49')](_0xf50ee9[_0xee92('0x4a')]);}})['then'](respondWithResult(_0x39a42b,null))[_0xee92('0x43')](handleError(_0x39a42b,null));};exports['getMessages']=function(_0x57cbb1,_0x55444f,_0x514341){var _0x1bd7e0={};var _0x384631={};var _0x5c7a01;var _0x12af88;return db[_0xee92('0x2f')]['findOne']({'where':{'id':_0x57cbb1[_0xee92('0x45')]['id']}})[_0xee92('0x28')](handleEntityNotFound(_0x55444f,null))[_0xee92('0x28')](function(_0x41e8d2){if(_0x41e8d2){_0x5c7a01=_0x41e8d2;_0x384631[_0xee92('0x32')]=_['keys'](db[_0xee92('0x4d')]['rawAttributes']);_0x384631[_0xee92('0x33')]=_[_0xee92('0x46')](_0x57cbb1['query']);_0x384631[_0xee92('0x39')]=_[_0xee92('0x34')](_0x384631[_0xee92('0x32')],_0x384631[_0xee92('0x33')]);_0x1bd7e0[_0xee92('0x35')]=_['intersection'](_0x384631[_0xee92('0x32')],qs[_0xee92('0x36')](_0x57cbb1[_0xee92('0x33')][_0xee92('0x36')]));_0x1bd7e0[_0xee92('0x35')]=_0x1bd7e0[_0xee92('0x35')]['length']?_0x1bd7e0[_0xee92('0x35')]:_0x384631[_0xee92('0x32')];_0x1bd7e0[_0xee92('0x37')]=qs[_0xee92('0x38')](_0x57cbb1['query']['sort']);_0x1bd7e0[_0xee92('0x3b')]=qs[_0xee92('0x39')](_['pick'](_0x57cbb1[_0xee92('0x33')],_0x384631[_0xee92('0x39')]));if(_0x57cbb1[_0xee92('0x33')][_0xee92('0x3d')]){_0x1bd7e0[_0xee92('0x3b')]=_[_0xee92('0x3e')](_0x1bd7e0['where'],{'$or':_[_0xee92('0x2e')](_0x1bd7e0['attributes'],function(_0x29be58){var _0x4a9ba4={};_0x4a9ba4[_0x29be58]={'$like':'%'+_0x57cbb1[_0xee92('0x33')][_0xee92('0x3d')]+'%'};return _0x4a9ba4;})});}if(_0x57cbb1[_0xee92('0x33')][_0xee92('0x58')]){var _0x31eb54=_0x57cbb1[_0xee92('0x33')][_0xee92('0x58')][_0xee92('0x59')](',');var _0x1726b2={};_0x1726b2[_0x31eb54[0x0]]={'$gte':moment(_0x31eb54[0x1])['format'](_0xee92('0x5a'))};_0x1bd7e0['where']=_[_0xee92('0x3e')](_0x1bd7e0[_0xee92('0x3b')],_0x1726b2);}_0x1bd7e0=_[_0xee92('0x3e')]({},_0x1bd7e0,_0x57cbb1[_0xee92('0x3f')]);return _0x5c7a01['getMessages'](_0x1bd7e0);}})[_0xee92('0x28')](function(_0x211216){if(_0x211216){_0x12af88=_0x211216[_0xee92('0x47')];if(!_0x57cbb1['query'][_0xee92('0x54')]('nolimit')){_0x1bd7e0['limit']=qs[_0xee92('0x22')](_0x57cbb1[_0xee92('0x33')][_0xee92('0x22')]);_0x1bd7e0[_0xee92('0x21')]=qs['offset'](_0x57cbb1[_0xee92('0x33')][_0xee92('0x21')]);}return _0x5c7a01[_0xee92('0x5b')](_0x1bd7e0);}})['then'](function(_0x14a97f){if(_0x14a97f){return _0x14a97f?{'count':_0x12af88,'rows':_0x14a97f}:null;}})[_0xee92('0x28')](respondWithResult(_0x55444f,null))[_0xee92('0x43')](handleError(_0x55444f,null));};
\ No newline at end of file
index 19cc042..2d561e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5f8=['events','../../mysqldb','ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x80b9b8,_0x2a2163){var _0xb7fe18=function(_0x4db660){while(--_0x4db660){_0x80b9b8['push'](_0x80b9b8['shift']());}};_0xb7fe18(++_0x2a2163);}(_0xb5f8,0x168));var _0x8b5f=function(_0x584e39,_0x1fb967){_0x584e39=_0x584e39-0x0;var _0x369d87=_0xb5f8[_0x584e39];return _0x369d87;};'use strict';var EventEmitter=require(_0x8b5f('0x0'));var ChatGroup=require(_0x8b5f('0x1'))['db'][_0x8b5f('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8b5f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3047a7){return function(_0xb70eb8,_0x46e6b5,_0xe1a7d0){ChatGroupEvents['emit'](_0x3047a7+':'+_0xb70eb8['id'],_0xb70eb8);ChatGroupEvents[_0x8b5f('0x5')](_0x3047a7,_0xb70eb8);_0xe1a7d0(null);};}for(var e in events){if(events[_0x8b5f('0x6')](e)){var event=events[e];ChatGroup[_0x8b5f('0x7')](e,emitEvent(event));}}module[_0x8b5f('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x74cd=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2c0caa,_0x500f43){var _0x156c08=function(_0x45e79e){while(--_0x45e79e){_0x2c0caa['push'](_0x2c0caa['shift']());}};_0x156c08(++_0x500f43);}(_0x74cd,0x162));var _0xd74c=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x74cd[_0x138f59];return _0x3d114d;};'use strict';var EventEmitter=require(_0xd74c('0x0'));var ChatGroup=require(_0xd74c('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd74c('0x2')](0x0);var events={'afterCreate':_0xd74c('0x3'),'afterUpdate':'update','afterDestroy':_0xd74c('0x4')};function emitEvent(_0x3bf0e3){return function(_0x1a43e1,_0x395516,_0x1dc04e){ChatGroupEvents[_0xd74c('0x5')](_0x3bf0e3+':'+_0x1a43e1['id'],_0x1a43e1);ChatGroupEvents[_0xd74c('0x5')](_0x3bf0e3,_0x1a43e1);_0x1dc04e(null);};}for(var e in events){if(events[_0xd74c('0x6')](e)){var event=events[e];ChatGroup[_0xd74c('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
index f75d5b5..4216451 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0b2=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','../../config/logger','api','moment','path'];(function(_0x181cbd,_0x51a26e){var _0x45b84c=function(_0x17a151){while(--_0x17a151){_0x181cbd['push'](_0x181cbd['shift']());}};_0x45b84c(++_0x51a26e);}(_0xf0b2,0x92));var _0x2f0b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf0b2[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f0b('0x0'))(_0x2f0b('0x1'));var moment=require(_0x2f0b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f0b('0x3'));var rimraf=require(_0x2f0b('0x4'));var config=require(_0x2f0b('0x5'));var attributes=require(_0x2f0b('0x6'));module[_0x2f0b('0x7')]=function(_0x157463,_0x20bc09){return _0x157463[_0x2f0b('0x8')](_0x2f0b('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1ac=['exports','chat_groups','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb1ac,0x1cd));var _0xcb1a=function(_0x57ec0d,_0x2ca0f5){_0x57ec0d=_0x57ec0d-0x0;var _0x5e8c53=_0xb1ac[_0x57ec0d];return _0x5e8c53;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb1a('0x0'))(_0xcb1a('0x1'));var moment=require('moment');var BPromise=require(_0xcb1a('0x2'));var rp=require(_0xcb1a('0x3'));var fs=require('fs');var path=require(_0xcb1a('0x4'));var rimraf=require('rimraf');var config=require(_0xcb1a('0x5'));var attributes=require(_0xcb1a('0x6'));module[_0xcb1a('0x7')]=function(_0x434854,_0x2079e4){return _0x434854['define']('ChatGroup',attributes,{'tableName':_0xcb1a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0376dcf..7610762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4403=['redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x2ce05,_0x306b52){var _0x1c6341=function(_0x512eca){while(--_0x512eca){_0x2ce05['push'](_0x2ce05['shift']());}};_0x1c6341(++_0x306b52);}(_0x4403,0x179));var _0x3440=function(_0x352401,_0x5c29d3){_0x352401=_0x352401-0x0;var _0x2982c5=_0x4403[_0x352401];return _0x2982c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3440('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3440('0x1'));var db=require(_0x3440('0x2'))['db'];var utils=require(_0x3440('0x3'));var logger=require(_0x3440('0x4'))('rpc');var config=require(_0x3440('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3440('0x6')]({'port':0x232a});config[_0x3440('0x7')]=_[_0x3440('0x8')](config['redis'],{'host':_0x3440('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3440('0x7')]));require(_0x3440('0xa'))[_0x3440('0xb')](socket);function respondWithRpcPromise(_0x5bcb3e,_0x215218,_0x333406){return new BPromise(function(_0x41942e,_0xbf4436){return client[_0x3440('0xc')](_0x5bcb3e,_0x333406)[_0x3440('0xd')](function(_0x64ca6c){logger['info'](_0x3440('0xe'),_0x215218,_0x3440('0xf'));logger[_0x3440('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x215218,_0x3440('0xf'),JSON[_0x3440('0x11')](_0x64ca6c));if(_0x64ca6c[_0x3440('0x12')]){if(_0x64ca6c[_0x3440('0x12')][_0x3440('0x13')]===0x1f4){logger['error'](_0x3440('0xe'),_0x215218,_0x64ca6c['error'][_0x3440('0x14')]);return _0xbf4436(_0x64ca6c[_0x3440('0x12')][_0x3440('0x14')]);}logger[_0x3440('0x12')](_0x3440('0xe'),_0x215218,_0x64ca6c[_0x3440('0x12')][_0x3440('0x14')]);return _0x41942e(_0x64ca6c[_0x3440('0x12')]['message']);}else{logger[_0x3440('0x15')](_0x3440('0xe'),_0x215218,_0x3440('0xf'));_0x41942e(_0x64ca6c[_0x3440('0x16')][_0x3440('0x14')]);}})[_0x3440('0x17')](function(_0x5d6da8){logger[_0x3440('0x12')](_0x3440('0xe'),_0x215218,_0x5d6da8);_0xbf4436(_0x5d6da8);});});}
\ No newline at end of file
+var _0x165d=['rpc','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1662e4,_0x4f4912){var _0x453124=function(_0x5bac59){while(--_0x5bac59){_0x1662e4['push'](_0x1662e4['shift']());}};_0x453124(++_0x4f4912);}(_0x165d,0x14a));var _0xd165=function(_0x26d6db,_0x40caa9){_0x26d6db=_0x26d6db-0x0;var _0x1731b0=_0x165d[_0x26d6db];return _0x1731b0;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var moment=require(_0xd165('0x2'));var BPromise=require(_0xd165('0x3'));var rs=require(_0xd165('0x4'));var fs=require('fs');var Redis=require(_0xd165('0x5'));var db=require(_0xd165('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd165('0x7'))(_0xd165('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd165('0x9')]({'port':0x232a});config[_0xd165('0xa')]=_['defaults'](config['redis'],{'host':_0xd165('0xb'),'port':0x18eb});var socket=require(_0xd165('0xc'))(new Redis(config[_0xd165('0xa')]));require(_0xd165('0xd'))[_0xd165('0xe')](socket);function respondWithRpcPromise(_0x239d6d,_0x249052,_0x1a36f4){return new BPromise(function(_0x51f6f8,_0x3ce4f3){return client[_0xd165('0xf')](_0x239d6d,_0x1a36f4)[_0xd165('0x10')](function(_0x50f6b7){logger[_0xd165('0x11')]('ChatGroup,\x20%s,\x20%s',_0x249052,_0xd165('0x12'));logger[_0xd165('0x13')](_0xd165('0x14'),_0x249052,_0xd165('0x12'),JSON['stringify'](_0x50f6b7));if(_0x50f6b7['error']){if(_0x50f6b7[_0xd165('0x15')][_0xd165('0x16')]===0x1f4){logger[_0xd165('0x15')]('ChatGroup,\x20%s,\x20%s',_0x249052,_0x50f6b7['error']['message']);return _0x3ce4f3(_0x50f6b7[_0xd165('0x15')][_0xd165('0x17')]);}logger['error'](_0xd165('0x18'),_0x249052,_0x50f6b7[_0xd165('0x15')]['message']);return _0x51f6f8(_0x50f6b7['error'][_0xd165('0x17')]);}else{logger[_0xd165('0x11')]('ChatGroup,\x20%s,\x20%s',_0x249052,'request\x20sent');_0x51f6f8(_0x50f6b7['result']['message']);}})[_0xd165('0x19')](function(_0x1521be){logger[_0xd165('0x15')](_0xd165('0x18'),_0x249052,_0x1521be);_0x3ce4f3(_0x1521be);});});}
\ No newline at end of file
index b3342a4..f7b621c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e17=['emit','removeListener','length','chatGroup:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e17,0xe4));var _0x74e1=function(_0x128a06,_0x13413c){_0x128a06=_0x128a06-0x0;var _0x20831c=_0x4e17[_0x128a06];return _0x20831c;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x74e1('0x0'),_0x74e1('0x1'),_0x74e1('0x2')];function createListener(_0x2db06d,_0x14906f){return function(_0xb87bac){_0x14906f[_0x74e1('0x3')](_0x2db06d,_0xb87bac);};}function removeListener(_0x195fe6,_0xe6fc92){return function(){ChatGroupEvents[_0x74e1('0x4')](_0x195fe6,_0xe6fc92);};}exports['register']=function(_0x3a59bd){for(var _0x408dcc=0x0,_0x1faa8e=events[_0x74e1('0x5')];_0x408dcc<_0x1faa8e;_0x408dcc++){var _0x3a5816=events[_0x408dcc];var _0x2d5b2d=createListener(_0x74e1('0x6')+_0x3a5816,_0x3a59bd);ChatGroupEvents['on'](_0x3a5816,_0x2d5b2d);}};
\ No newline at end of file
+var _0xcc10=['./chatGroup.events','save','remove','update','removeListener','register','length','chatGroup:'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0xcc10,0x70));var _0x0cc1=function(_0x5625c4,_0x223ea2){_0x5625c4=_0x5625c4-0x0;var _0x444895=_0xcc10[_0x5625c4];return _0x444895;};'use strict';var ChatGroupEvents=require(_0x0cc1('0x0'));var events=[_0x0cc1('0x1'),_0x0cc1('0x2'),_0x0cc1('0x3')];function createListener(_0x460550,_0x5182b){return function(_0x5e27d6){_0x5182b['emit'](_0x460550,_0x5e27d6);};}function removeListener(_0x1a7c7c,_0x3aeb40){return function(){ChatGroupEvents[_0x0cc1('0x4')](_0x1a7c7c,_0x3aeb40);};}exports[_0x0cc1('0x5')]=function(_0xd17286){for(var _0xbb5534=0x0,_0x4442a1=events[_0x0cc1('0x6')];_0xbb5534<_0x4442a1;_0xbb5534++){var _0x3607f9=events[_0xbb5534];var _0x3fdc83=createListener(_0x0cc1('0x7')+_0x3607f9,_0xd17286);ChatGroupEvents['on'](_0x3607f9,_0x3fdc83);}};
\ No newline at end of file
index 0c7b324..2343e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72cd=['post','create','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x72cd,0xa9));var _0xd72c=function(_0x3517e4,_0x4d8a8f){_0x3517e4=_0x3517e4-0x0;var _0x1403f2=_0x72cd[_0x3517e4];return _0x1403f2;};'use strict';var multer=require(_0xd72c('0x0'));var util=require(_0xd72c('0x1'));var path=require(_0xd72c('0x2'));var timeout=require(_0xd72c('0x3'));var express=require(_0xd72c('0x4'));var router=express[_0xd72c('0x5')]();var fs_extra=require(_0xd72c('0x6'));var auth=require(_0xd72c('0x7'));var interaction=require(_0xd72c('0x8'));var config=require(_0xd72c('0x9'));var controller=require(_0xd72c('0xa'));router['get']('/',auth[_0xd72c('0xb')](),controller[_0xd72c('0xc')]);router[_0xd72c('0xd')](_0xd72c('0xe'),auth[_0xd72c('0xb')](),controller['describe']);router[_0xd72c('0xd')](_0xd72c('0xf'),auth['isAuthenticated'](),controller[_0xd72c('0x10')]);router[_0xd72c('0xd')](_0xd72c('0x11'),auth['isAuthenticated'](),controller[_0xd72c('0x12')]);router[_0xd72c('0xd')](_0xd72c('0x13'),auth[_0xd72c('0xb')](),controller[_0xd72c('0x14')]);router[_0xd72c('0xd')](_0xd72c('0x15'),auth[_0xd72c('0xb')](),controller[_0xd72c('0x16')]);router[_0xd72c('0x17')]('/',auth[_0xd72c('0xb')](),controller[_0xd72c('0x18')]);router[_0xd72c('0x17')](_0xd72c('0x13'),auth[_0xd72c('0xb')](),controller[_0xd72c('0x19')]);router[_0xd72c('0x17')](_0xd72c('0x15'),auth['isAuthenticated'](),controller['addMessage']);router[_0xd72c('0x1a')](_0xd72c('0xf'),auth[_0xd72c('0xb')](),controller[_0xd72c('0x1b')]);router[_0xd72c('0x1c')]('/:id',auth[_0xd72c('0xb')](),controller[_0xd72c('0x1d')]);router[_0xd72c('0x1c')](_0xd72c('0x13'),auth[_0xd72c('0xb')](),controller[_0xd72c('0x1e')]);module[_0xd72c('0x1f')]=router;
\ No newline at end of file
+var _0x036c=['show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x48e8d1,_0xfcc483){var _0x378346=function(_0x3b5944){while(--_0x3b5944){_0x48e8d1['push'](_0x48e8d1['shift']());}};_0x378346(++_0xfcc483);}(_0x036c,0xd6));var _0xc036=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x036c[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0xc036('0x0'));var path=require(_0xc036('0x1'));var timeout=require('connect-timeout');var express=require(_0xc036('0x2'));var router=express['Router']();var fs_extra=require(_0xc036('0x3'));var auth=require(_0xc036('0x4'));var interaction=require(_0xc036('0x5'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xc036('0x6')]('/',auth[_0xc036('0x7')](),controller[_0xc036('0x8')]);router[_0xc036('0x6')](_0xc036('0x9'),auth[_0xc036('0x7')](),controller[_0xc036('0xa')]);router['get']('/:id',auth[_0xc036('0x7')](),controller[_0xc036('0xb')]);router[_0xc036('0x6')](_0xc036('0xc'),auth['isAuthenticated'](),controller[_0xc036('0xd')]);router['get'](_0xc036('0xe'),auth['isAuthenticated'](),controller[_0xc036('0xf')]);router['get'](_0xc036('0x10'),auth[_0xc036('0x7')](),controller[_0xc036('0x11')]);router[_0xc036('0x12')]('/',auth[_0xc036('0x7')](),controller[_0xc036('0x13')]);router[_0xc036('0x12')](_0xc036('0xe'),auth[_0xc036('0x7')](),controller[_0xc036('0x14')]);router[_0xc036('0x12')](_0xc036('0x10'),auth[_0xc036('0x7')](),controller['addMessage']);router[_0xc036('0x15')]('/:id',auth[_0xc036('0x7')](),controller['update']);router[_0xc036('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xc036('0x17')]);router[_0xc036('0x16')](_0xc036('0xe'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xc036('0x18')]=router;
\ No newline at end of file
index 16211e0..08e4b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51c5=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x51c5,0x8f));var _0x551c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x51c5[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x551c('0x0'));module[_0x551c('0x1')]={'closed':{'type':Sequelize[_0x551c('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x551c('0x3')]},'ratingType':{'type':Sequelize[_0x551c('0x4')](_0x551c('0x5'),_0x551c('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x551c('0x7')]},'pathTranscript':{'type':Sequelize[_0x551c('0x7')]},'mailTranscript':{'type':Sequelize[_0x551c('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x551c('0x9')]},'disposition':{'type':Sequelize[_0x551c('0x8')]},'secondDisposition':{'type':Sequelize[_0x551c('0x8')]},'thirdDisposition':{'type':Sequelize[_0x551c('0x8')]},'note':{'type':Sequelize[_0x551c('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x551c('0x8')]},'osName':{'type':Sequelize[_0x551c('0x8')]},'osVersion':{'type':Sequelize[_0x551c('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x551c('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x551c('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x551c('0x9')]},'lastMsgAt':{'type':Sequelize[_0x551c('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x551c('0x4')]('in',_0x551c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x551c('0x8')]},'customerPort':{'type':Sequelize[_0x551c('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x551c('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe9ad=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x32b73e,_0x3e567d){var _0x3aaa05=function(_0x533182){while(--_0x533182){_0x32b73e['push'](_0x32b73e['shift']());}};_0x3aaa05(++_0x3e567d);}(_0xe9ad,0x82));var _0xde9a=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0xe9ad[_0x2ecc65];return _0x103cc3;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'closed':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xde9a('0x3')]},'ratingType':{'type':Sequelize[_0xde9a('0x4')](_0xde9a('0x5'),_0xde9a('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xde9a('0x7')]},'pathTranscript':{'type':Sequelize[_0xde9a('0x7')]},'mailTranscript':{'type':Sequelize[_0xde9a('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xde9a('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xde9a('0x8')]},'thirdDisposition':{'type':Sequelize[_0xde9a('0x8')]},'note':{'type':Sequelize[_0xde9a('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xde9a('0x8')]},'osName':{'type':Sequelize[_0xde9a('0x8')]},'osVersion':{'type':Sequelize[_0xde9a('0x8')]},'deviceModel':{'type':Sequelize[_0xde9a('0x8')]},'deviceVendor':{'type':Sequelize[_0xde9a('0x8')]},'deviceType':{'type':Sequelize[_0xde9a('0x8')]},'referer':{'type':Sequelize[_0xde9a('0x7')]},'customerIp':{'type':Sequelize[_0xde9a('0x8')]},'formData':{'type':Sequelize[_0xde9a('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xde9a('0x4')]('in',_0xde9a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xde9a('0x8')]},'customerPort':{'type':Sequelize[_0xde9a('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xde9a('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]}};
\ No newline at end of file
index d52c662..09750b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','ChatInteractionId','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','attachmentUpload','originalname','file','mimetype','attachmentDownload','findOne','closed','Unauthorized','Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','includeAgent','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x3f0bab,_0x1305d1){var _0x2219a4=function(_0x3e2b9d){while(--_0x3e2b9d){_0x3f0bab['push'](_0x3f0bab['shift']());}};_0x2219a4(++_0x1305d1);}(_0x955f,0x1eb));var _0xf955=function(_0x22c534,_0xb46325){_0x22c534=_0x22c534-0x0;var _0x23bf6f=_0x955f[_0x22c534];return _0x23bf6f;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf955('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf955('0x13'))(_0xf955('0x14'));var utils=require(_0xf955('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf955('0x16'));var db=require('../../mysqldb')['db'];config[_0xf955('0x17')]=_['defaults'](config[_0xf955('0x17')],{'host':_0xf955('0x18'),'port':0x18eb});var socket=require(_0xf955('0x19'))(new Redis(config[_0xf955('0x17')]));require(_0xf955('0x1a'))[_0xf955('0x1b')](socket);var jayson=require(_0xf955('0x1c'));var client=jayson[_0xf955('0x1d')][_0xf955('0x1e')]({'port':0x232b});var client9004=jayson[_0xf955('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc29b35,_0x54e60b,_0x3139d5,_0x3a814f){return new BPromise(function(_0x2f881b,_0x15c07c){var _0x50930d=_0x3a814f||client;return _0x50930d['request'](_0xc29b35,_0x3139d5)[_0xf955('0x1f')](function(_0xe6de5c){logger[_0xf955('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xf955('0x21'));logger[_0xf955('0x22')](_0xf955('0x23'),_0x54e60b,_0xf955('0x21'),JSON[_0xf955('0x24')](_0xe6de5c));if(_0xe6de5c['error']){if(_0xe6de5c[_0xf955('0x25')][_0xf955('0x26')]===0x1f4){logger[_0xf955('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x15c07c(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x2f881b(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}else{logger[_0xf955('0x20')](_0xf955('0x28'),_0x54e60b,_0xf955('0x21'));_0x2f881b(_0xe6de5c[_0xf955('0x29')][_0xf955('0x27')]);}})['catch'](function(_0x18f435){logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0x18f435);_0x15c07c(_0x18f435);});});}function respondWithStatusCode(_0x406632,_0x2dcd55){_0x2dcd55=_0x2dcd55||0xcc;return function(_0x13a86d){if(_0x13a86d){return _0x406632[_0xf955('0x2a')](_0x2dcd55);}return _0x406632['status'](_0x2dcd55)[_0xf955('0x2b')]();};}function respondWithResult(_0x145098,_0x41c9f6){_0x41c9f6=_0x41c9f6||0xc8;return function(_0xbd0b74){if(_0xbd0b74){return _0x145098[_0xf955('0x2c')](_0x41c9f6)[_0xf955('0x2d')](_0xbd0b74);}};}function respondWithFilteredResult(_0x4d4af0,_0x2232a7){return function(_0x1e5d37){if(_0x1e5d37){var _0x4ec3e8=typeof _0x2232a7[_0xf955('0x2e')]===_0xf955('0x2f')&&typeof _0x2232a7[_0xf955('0x30')]===_0xf955('0x2f');var _0x59bfb5=_0x1e5d37[_0xf955('0x31')];var _0x518fb3=_0x4ec3e8?0x0:_0x2232a7[_0xf955('0x2e')];var _0x2c222a=_0x4ec3e8?_0x1e5d37[_0xf955('0x31')]:_0x2232a7[_0xf955('0x2e')]+_0x2232a7[_0xf955('0x30')];var _0x32121b;if(_0x2c222a>=_0x59bfb5){_0x2c222a=_0x59bfb5;_0x32121b=0xc8;}else{_0x32121b=0xce;}_0x4d4af0[_0xf955('0x2c')](_0x32121b);return _0x4d4af0[_0xf955('0x32')]('Content-Range',_0x518fb3+'-'+_0x2c222a+'/'+_0x59bfb5)[_0xf955('0x2d')](_0x1e5d37);}return null;};}function patchUpdates(_0x165cc4){return function(_0x3964d3){try{jsonpatch[_0xf955('0x33')](_0x3964d3,_0x165cc4,!![]);}catch(_0x4fea0c){return BPromise[_0xf955('0x34')](_0x4fea0c);}return _0x3964d3[_0xf955('0x35')]();};}function saveUpdates(_0x3c81bc,_0xe1b436){return function(_0xdbc53e){if(_0xdbc53e){return _0xdbc53e['update'](_0x3c81bc)['then'](function(_0x5480db){return _0x5480db;});}return null;};}function removeEntity(_0x2626cb,_0x3783dc){return function(_0x374e95){if(_0x374e95){return _0x374e95[_0xf955('0x36')]()[_0xf955('0x1f')](function(){_0x2626cb[_0xf955('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acc4b,_0x515dc6){return function(_0x8f842f){if(!_0x8f842f){_0x3acc4b[_0xf955('0x2a')](0x194);}return _0x8f842f;};}function handleError(_0xe33ef2,_0x51762d){_0x51762d=_0x51762d||0x1f4;return function(_0x60a421){logger['error'](_0x60a421[_0xf955('0x37')]);if(_0x60a421[_0xf955('0x38')]){delete _0x60a421[_0xf955('0x38')];}_0xe33ef2[_0xf955('0x2c')](_0x51762d)['send'](_0x60a421);};}function getMustacheRender(_0xf35170,_0x118c92){return Mustache['render'](_0xf35170,_[_0xf955('0x39')](_0x118c92[_0xf955('0x3a')],{'contact':_0x118c92[_0xf955('0x3b')],'message':_0x118c92['message'],'agent':_0x118c92[_0xf955('0x3c')],'interaction':_0x118c92[_0xf955('0x3d')],'account':_0x118c92[_0xf955('0x3e')]}))||'';}function getInteractionUsers(_0x488b6e,_0x97e8ff){return new BPromise(function(_0x195faa,_0x21e4a6){try{if(_0x97e8ff[_0x488b6e['id']]){_0x488b6e[_0xf955('0x3f')]=_[_0xf955('0x40')](_0x97e8ff[_0x488b6e['id']],function(_0x3c4b29){return{'id':_0x3c4b29['id'],'fullname':_0x3c4b29[_0xf955('0x41')]};});}}catch(_0x228dae){_0x21e4a6(_0x228dae);}_0x195faa(_0x488b6e);});}function getInteractionTags(_0x5671c7,_0x8fa41b){return new BPromise(function(_0x7123c1,_0x2aacdf){try{if(_0x5671c7[_0xf955('0x42')]){_0x5671c7[_0xf955('0x43')]=[];_0x5671c7[_0xf955('0x42')][_0xf955('0x44')](',')[_0xf955('0x45')](function(_0x47651b){_0x5671c7[_0xf955('0x43')][_0xf955('0x46')](_0x8fa41b[_0x47651b]);});}delete _0x5671c7[_0xf955('0x42')];}catch(_0x40d7e9){_0x2aacdf(_0x40d7e9);}_0x7123c1(_0x5671c7);});}function updateChatInteraction(_0x159ae3,_0x3557b5,_0x248f60){return new BPromise(function(_0x356ec2,_0x34f0f1){return getInteractionUsers(_0x159ae3,_0x248f60)[_0xf955('0x1f')](function(_0x5dd300){return getInteractionTags(_0x5dd300,_0x3557b5);})[_0xf955('0x1f')](function(_0x25d809){_0x356ec2(_0x25d809);})[_0xf955('0x47')](function(_0x5f0ef9){_0x34f0f1(_0x5f0ef9);});});}exports[_0xf955('0x48')]=function(_0x485e77,_0x398224){var _0x56a4ca={},_0x103ac2={},_0x24cb74={'count':0x0,'rows':[]};var _0x213136=_[_0xf955('0x40')](db['ChatInteraction'][_0xf955('0x49')],function(_0xdb1cc){return{'name':_0xdb1cc[_0xf955('0x4a')],'type':_0xdb1cc['type']['key']};});_0x103ac2[_0xf955('0x4b')]=_[_0xf955('0x40')](_0x213136,_0xf955('0x38'));_0x103ac2[_0xf955('0x4c')]=_['keys'](_0x485e77[_0xf955('0x4c')]);_0x103ac2[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x103ac2['model'],_0x103ac2[_0xf955('0x4c')]);_0x56a4ca['attributes']=_[_0xf955('0x4e')](_0x103ac2[_0xf955('0x4b')],qs[_0xf955('0x4f')](_0x485e77['query'][_0xf955('0x4f')]));_0x56a4ca[_0xf955('0x50')]=_0x56a4ca[_0xf955('0x50')][_0xf955('0x51')]?_0x56a4ca['attributes']:_0x103ac2[_0xf955('0x4b')];if(!_0x485e77[_0xf955('0x4c')][_0xf955('0x52')](_0xf955('0x53'))){_0x56a4ca[_0xf955('0x30')]=qs['limit'](_0x485e77[_0xf955('0x4c')]['limit']);_0x56a4ca[_0xf955('0x2e')]=qs['offset'](_0x485e77[_0xf955('0x4c')]['offset']);}_0x56a4ca['order']=qs[_0xf955('0x54')](_0x485e77[_0xf955('0x4c')]['sort']);_0x56a4ca[_0xf955('0x55')]=qs['filters'](_['pick'](_0x485e77['query'],_0x103ac2['filters']),_0x213136);var _0x3c37e2=[];var _0x1abe1c=squel['select']()['field']('id')[_0xf955('0x56')](_0xf955('0x38'))[_0xf955('0x56')](_0xf955('0x57'))[_0xf955('0x58')](_0xf955('0x59'));var _0x190500=squel[_0xf955('0x5a')]()[_0xf955('0x56')](_0xf955('0x5b'))[_0xf955('0x56')](_0xf955('0x5c'))['field'](_0xf955('0x5d'))[_0xf955('0x58')](_0xf955('0x5e'),'ui')[_0xf955('0x5f')](_0xf955('0x60'),'u','u.id\x20=\x20ui.UserId');var _0xf5d575=squel[_0xf955('0x5a')]()[_0xf955('0x58')](_0xf955('0x61'),'i')[_0xf955('0x5f')](_0xf955('0x62'),'c',_0xf955('0x63'))[_0xf955('0x5f')](_0xf955('0x60'),'o',_0xf955('0x64'))['left_join'](_0xf955('0x65'),'a',_0xf955('0x66'))[_0xf955('0x5f')](_0xf955('0x67'),'me',_0xf955('0x68'))[_0xf955('0x5f')](_0xf955('0x69'),'it',_0xf955('0x6a'))[_0xf955('0x5f')](_0xf955('0x59'),'t',_0xf955('0x6b'));var _0x2b8173=squel['expr']();var _0x1388a0=[];var _0x452de9=squel[_0xf955('0x6c')]();var _0x3eb727;if(_0x485e77[_0xf955('0x4c')][_0xf955('0x6d')]){_0x3eb727=as[_0xf955('0x6e')](_0x485e77['query']['search']);var _0x5e73ff=_0x3eb727[_0xf955('0x6f')];for(var _0x530ec7=0x0;_0x530ec7<_0x3eb727['conditions'][_0xf955('0x51')];_0x530ec7++){var _0x533e0f=_0x3eb727[_0xf955('0x70')][_0x530ec7];var _0x3fa5b5='i';var _0x158469=_[_0xf955('0x71')](_0x213136,['name',_0x533e0f[_0xf955('0x56')]]);if(!_0x158469){switch(_0x533e0f[_0xf955('0x56')]){case _0xf955('0x72'):if(_0x533e0f[_0xf955('0x73')]==0x1){_0xf5d575[_0xf955('0x74')]('`'+_0x533e0f['field']+_0xf955('0x75'));}else{_0xf5d575['having']('`'+_0x533e0f[_0xf955('0x56')]+_0xf955('0x76'));}break;case _0xf955('0x77'):if(_0x533e0f['operator']===_0xf955('0x78')){if(_0x533e0f[_0xf955('0x73')][_0xf955('0x44')]('\x20')[_0xf955('0x51')]>0x1){_0x2b8173[_0x5e73ff](_0xf955('0x79'),qs[_0xf955('0x7a')](_0x533e0f[_0xf955('0x73')]),null);}else{var _0x47e5de='%'+_0x533e0f['value']+'%';_0x2b8173[_0x5e73ff](_0xf955('0x7b'),_0x47e5de,_0x47e5de,_0x47e5de);}}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x7c')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x7c');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}break;case'Tag':var _0x431729=_0x533e0f['value']['split'](',')[_0xf955('0x40')](function(_0x20f11c){return Number(_0x20f11c);});_0x431729['forEach'](function(_0x1e95c3){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x1e95c3+',%');});_0x1388a0=_['union'](_0x1388a0,_0x431729);break;case'User':if(_0x533e0f[_0xf955('0x82')]===_0xf955('0x78')){_0x2b8173[_0x5e73ff](_0xf955('0x83'),'%'+_0x533e0f['value']+'%',null);}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x84')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x84');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2['value'][_0xf955('0x80')],_0x4b85c2[_0xf955('0x73')]['end']);}break;case _0xf955('0x3a'):_0x4b85c2=as[_0xf955('0x7d')]('me',null,_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')]['start'],_0x4b85c2[_0xf955('0x73')][_0xf955('0x2b')]);break;}}else{var _0x4b85c2=as['buildExpression'](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}}}else{var _0x430571=_(_0x485e77[_0xf955('0x4c')])[_0xf955('0x85')]()[_0xf955('0x40')](function(_0x3e9c6e){return _[_0xf955('0x86')](_0x213136,[_0xf955('0x38'),_0x3e9c6e])?_0x3e9c6e:undefined;})[_0xf955('0x87')]()[_0xf955('0x73')]();if(!_[_0xf955('0x88')](_0x430571)){_0x430571[_0xf955('0x45')](function(_0x4254a2){if(_0x4254a2==='ChatWebsiteId'){_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),[][_0xf955('0x8a')](_0x485e77[_0xf955('0x4c')][_0x4254a2]));}else if(_0x4254a2==='createdAt'){var _0xcf6900=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8c')];var _0x2b266d=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8d')];_0xf5d575[_0xf955('0x55')](_0xf955('0x8e'),_0xcf6900,_0x2b266d);}else{if(_0x485e77[_0xf955('0x4c')][_0x4254a2]==='null'){_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x8f'));}else{_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x90'),_0x485e77[_0xf955('0x4c')][_0x4254a2]);}}});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x91')]){if(_0x485e77['query'][_0xf955('0x91')]==0x1){_0xf5d575['having'](_0xf955('0x92'));}else{_0xf5d575['having'](_0xf955('0x93'));}}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]){_0x1388a0=_[_0xf955('0x95')](_0x485e77[_0xf955('0x4c')][_0xf955('0x94')])?_0x485e77['query'][_0xf955('0x94')]:new Array(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]);_0x1388a0['forEach'](function(_0x526346){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x526346+',%');});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x96')]){var _0x595d60=_0x485e77[_0xf955('0x4c')]['filter'][_0xf955('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf955('0x98')](_0x595d60)){_0x2b8173['or'](_0xf955('0x99'),_0x595d60+'%');}else{_0x2b8173['or'](_0xf955('0x9a'),qs['getFullTextValue'](_0x595d60))['or'](_0xf955('0x9b'),_0x595d60+'%');}}}_0xf5d575[_0xf955('0x55')](_0x2b8173);_0xf5d575[_0xf955('0x9c')]('i.id');var _0xba62d0={'type':db[_0xf955('0x9d')][_0xf955('0x9e')][_0xf955('0x9f')],'raw':!![]};var _0x419da5=_0xf5d575[_0xf955('0xa0')]();_0x419da5[_0xf955('0x56')]('i.id');_0x419da5[_0xf955('0x56')](_0xf955('0xa1'),_0xf955('0x72'));if(_0x56a4ca[_0xf955('0xa2')]){_0x56a4ca[_0xf955('0xa2')]['forEach'](function(_0x15c3e1){var _0x23f90c=_0x15c3e1[0x0]==='contactName'?_0x15c3e1[0x0]:'i.'+_0x15c3e1[0x0];_0xf5d575['order'](_0x23f90c,_0x15c3e1[0x1]===_0xf955('0xa3')?![]:!![]);});}if(!_[_0xf955('0x88')](_0x1388a0)){_0xf5d575[_0xf955('0x74')](_0x452de9);_0x419da5[_0xf955('0x55')]('t.id\x20IN\x20?',_0x1388a0);}BPromise[_0xf955('0xa4')]()['then'](function(){if(!_0x3eb727){if(_0x485e77['query'][_0xf955('0xa5')])return;_0x419da5[_0xf955('0x55')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xf5d575['where'](_0xf955('0xa6'));return;}if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]!=='agent')return;return _0x485e77['user'][_0xf955('0xa9')]({'attributes':['id'],'raw':!![]})[_0xf955('0x1f')](function(_0x15fc7e){if(_['isEmpty'](_0x15fc7e)){_0x419da5['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xf5d575['where'](_0xf955('0xaa'));}else{_0x419da5['where'](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));}});})['then'](function(){if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]===_0xf955('0x3c')&&!_0x3eb727&&!_0x485e77[_0xf955('0x4c')]['ChatWebsiteId'])return[];return db[_0xf955('0xab')][_0xf955('0x4c')](_0x419da5['toString'](),_0xba62d0);})[_0xf955('0x1f')](function(_0x1819f6){_0x24cb74[_0xf955('0x31')]=_0x1819f6[_0xf955('0x51')];if(_0x24cb74[_0xf955('0x31')]===0x0)return[];return db[_0xf955('0xab')]['query'](_0x1abe1c['toString'](),_0xba62d0)[_0xf955('0x1f')](function(_0x545275){_0x3c37e2=_[_0xf955('0xac')](_0x545275,'id');_0xba62d0=_[_0xf955('0x39')](_0xba62d0,{'model':db[_0xf955('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x485e77[_0xf955('0x4c')]['fields']){_0x56a4ca['attributes'][_0xf955('0x45')](function(_0x12b9f8){_0xf5d575[_0xf955('0x56')]('i.'+_0x12b9f8);});}else{_0xf5d575[_0xf955('0x56')](_0xf955('0xa1'),'unreadMessages');_0xf5d575[_0xf955('0x56')](_0xf955('0xae'),_0xf955('0xaf'));_0xf5d575[_0xf955('0x56')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xf5d575[_0xf955('0x56')](_0xf955('0xb0'),'contactName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb1'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb2'),'Contact.firstName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb3'),_0xf955('0xb4'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb5'),_0xf955('0xb6'));_0xf5d575[_0xf955('0x56')]('c.phone','Contact.phone');_0xf5d575['field'](_0xf955('0xb7'),_0xf955('0xb8'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb9'),_0xf955('0xba'));_0xf5d575[_0xf955('0x56')](_0xf955('0xbb'),'Owner.fullname');_0xf5d575[_0xf955('0x56')](_0xf955('0xbc'),'Owner.internal');_0xf5d575[_0xf955('0x56')](_0xf955('0xbd'),_0xf955('0x42'));}if(_0x56a4ca[_0xf955('0x30')])_0xf5d575[_0xf955('0x30')](_0x56a4ca[_0xf955('0x30')]);if(_0x56a4ca[_0xf955('0x2e')])_0xf5d575[_0xf955('0x2e')](_0x56a4ca['offset']);return db['sequelize']['query'](_0xf5d575[_0xf955('0xbe')](),_0xba62d0);})[_0xf955('0x1f')](function(_0x210666){if(_0x210666[_0xf955('0x51')]>0x0)_0x190500[_0xf955('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0xf955('0x40')](_0x210666,'id'));return db[_0xf955('0xab')][_0xf955('0x4c')](_0x190500[_0xf955('0xbe')](),_0xba62d0)[_0xf955('0x1f')](function(_0x36731b){var _0x11f6f8=_[_0xf955('0xbf')](_0x36731b,_0xf955('0xc0'));var _0x4a71e5=[];_0x210666[_0xf955('0x45')](function(_0x47daca){_0x4a71e5[_0xf955('0x46')](updateChatInteraction(_0x47daca,_0x3c37e2,_0x11f6f8));});return BPromise[_0xf955('0xc1')](_0x4a71e5);});});})[_0xf955('0x1f')](function(_0x427ab9){_0x24cb74[_0xf955('0xc2')]=_0x427ab9;return _0x24cb74;})[_0xf955('0x1f')](respondWithFilteredResult(_0x398224,_0x56a4ca))[_0xf955('0x47')](handleError(_0x398224,null));};exports['show']=function(_0x1ef189,_0x4bb590){var _0x222df2={'raw':![],'where':{'id':_0x1ef189['params']['id']}},_0x40d7c7={};_0x40d7c7[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xad')][_0xf955('0x49')]);_0x40d7c7[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x1ef189[_0xf955('0x4c')]);_0x40d7c7['filters']=_[_0xf955('0x4e')](_0x40d7c7[_0xf955('0x4b')],_0x40d7c7['query']);_0x222df2[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x40d7c7['model'],qs['fields'](_0x1ef189[_0xf955('0x4c')][_0xf955('0x4f')]));_0x222df2[_0xf955('0x50')]=_0x222df2['attributes'][_0xf955('0x51')]?_0x222df2[_0xf955('0x50')]:_0x40d7c7[_0xf955('0x4b')];if(_0x1ef189[_0xf955('0x4c')][_0xf955('0xc3')]){_0x222df2[_0xf955('0xc4')]=[{'all':!![]}];}_0x222df2=_[_0xf955('0x39')]({},_0x222df2,_0x1ef189[_0xf955('0xc5')]);return db[_0xf955('0xad')][_0xf955('0x71')](_0x222df2)[_0xf955('0x1f')](handleEntityNotFound(_0x4bb590,null))[_0xf955('0x1f')](respondWithResult(_0x4bb590,null))[_0xf955('0x47')](handleError(_0x4bb590,null));};exports[_0xf955('0xc6')]=function(_0x490981,_0x58464d){return db[_0xf955('0xad')][_0xf955('0xc6')](_0x490981[_0xf955('0x3a')],{})[_0xf955('0x1f')](respondWithResult(_0x58464d,0xc9))[_0xf955('0x47')](handleError(_0x58464d,null));};exports['update']=function(_0x161d06,_0x3bab0d){if(_0x161d06['body']['id']){delete _0x161d06[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x161d06[_0xf955('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3bab0d,null))[_0xf955('0x1f')](saveUpdates(_0x161d06['body'],null))[_0xf955('0x1f')](respondWithResult(_0x3bab0d,null))[_0xf955('0x47')](handleError(_0x3bab0d,null));};exports[_0xf955('0x36')]=function(_0xe9f9a8,_0x5aff59){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0xe9f9a8[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x5aff59,null))[_0xf955('0x1f')](removeEntity(_0x5aff59,null))['catch'](handleError(_0x5aff59,null));};exports[_0xf955('0xc8')]=function(_0x1f38db,_0x395013){return db['ChatInteraction'][_0xf955('0xc8')]()[_0xf955('0x1f')](respondWithResult(_0x395013,null))[_0xf955('0x47')](handleError(_0x395013,null));};exports[_0xf955('0xc9')]=function(_0x19665c,_0x437020){var _0x12d158=_0x19665c['params']['id'];var _0x5a6abe;var _0x4e3013;var _0x345a7c;return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x12d158}})[_0xf955('0x1f')](function(_0x42ba43){_0x5a6abe=_0x42ba43;return db[_0xf955('0xca')]['findOne']({'where':{'id':_0x42ba43[_0xf955('0xa5')]},'attributes':['id',_0xf955('0xcb'),'vidaooEscalation','vidaooTopic',_0xf955('0xcc'),_0xf955('0xcd')],'raw':!![]});})[_0xf955('0x1f')](function(_0x30baa1){if(_0x30baa1&&_0x30baa1[_0xf955('0xcb')]&&_0x30baa1['vidaooEscalation']){_0x4e3013=_0x30baa1;var _0xc881d4={'interaction':{'id':_0x12d158},'agent':{'id':_0x19665c[_0xf955('0xa7')]['id'],'name':_0x19665c[_0xf955('0xa7')][_0xf955('0x38')],'fullname':_0x19665c[_0xf955('0xa7')]['fullname'],'email':_0x19665c[_0xf955('0xa7')][_0xf955('0xce')]},'contact':_0x19665c[_0xf955('0x3a')][_0xf955('0x3b')],'account':_0x19665c['body'][_0xf955('0x3e')]};var _0x410d1f={'rejectUnauthorized':![],'method':_0xf955('0xcf'),'url':_0xf955('0xd0'),'headers':{'X-APIKEY':_0x30baa1[_0xf955('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x19665c['user'][_0xf955('0xce')]],'buttons':null,'topic':_0x4e3013[_0xf955('0xd1')],'note':_['isNull'](_0x4e3013[_0xf955('0xcc')])?null:getMustacheRender(_0x4e3013[_0xf955('0xcc')],_0xc881d4),'metadata':null},'redirect':_0xf955('0xd2'),'json':!![]};try{if(!_[_0xf955('0xd3')](_0x4e3013[_0xf955('0xcd')])){var _0x38e031=getMustacheRender(_0x4e3013[_0xf955('0xcd')],_0xc881d4);var _0x4f53ef=JSON[_0xf955('0x8b')](_0x38e031);_0x410d1f[_0xf955('0x3a')]['metadata']=_0x4f53ef;}}catch(_0x5395aa){throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xd5'));}return rp(_0x410d1f);}else{throw new db[(_0xf955('0x9d'))]['ValidationError'](_0xf955('0xd6'));}})[_0xf955('0x1f')](function(_0x57e0d7){_0x345a7c=_0x57e0d7;if(_0x345a7c['id']){var _0x54903a={'body':_0x345a7c[_0xf955('0xd7')],'ChatWebsiteId':_0x4e3013['id'],'ChatInteractionId':_0x5a6abe['id'],'direction':_0xf955('0xd8'),'UserId':_0x19665c[_0xf955('0xa7')]['id']};return db[_0xf955('0xd9')]['create'](_0x54903a,{});}else{throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xda'));}})[_0xf955('0x1f')](function(){return _0x5a6abe[_0xf955('0xdb')]({'vidaooSessionId':_0x345a7c['id']});})[_0xf955('0x1f')](respondWithResult(_0x437020,null))[_0xf955('0x47')](handleError(_0x437020,null));};exports[_0xf955('0xdc')]=function(_0x4c7a54,_0xde084e){if(_0x4c7a54[_0xf955('0x3a')]['id']){delete _0x4c7a54[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x4c7a54[_0xf955('0xc7')]['id']},'include':[{'model':db[_0xf955('0xdd')],'as':_0xf955('0x77')}]})[_0xf955('0x1f')](handleEntityNotFound(_0xde084e,null))[_0xf955('0x1f')](saveUpdates(_0x4c7a54['body'],null))[_0xf955('0x1f')](respondWithResult(_0xde084e,null))[_0xf955('0x47')](handleError(_0xde084e,null));};exports[_0xf955('0xde')]=function(_0x27391f,_0x269ae2,_0x3250df){if(_0x27391f[_0xf955('0x3a')]['id']){delete _0x27391f['body']['id'];}return db[_0xf955('0xad')]['find']({'where':{'id':_0x27391f[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](function(_0x14cde9){if(!_0x14cde9){logger[_0xf955('0x25')](_0xf955('0xdf'),_0xf955('0xde'),0x194,_0xf955('0xe0'));_0x269ae2[_0xf955('0x2a')](0x194);}else{if(_0x14cde9[_0xf955('0x84')]){throw new db['Sequelize'][(_0xf955('0xd4'))](_0xf955('0xe1'));}}return _0x14cde9;})[_0xf955('0x1f')](function(_0x3d5c15){if(_0x3d5c15){return _0x3d5c15[_0xf955('0xe2')]({'closed':_0x27391f[_0xf955('0x3a')]['closed'],'disposition':_0x27391f[_0xf955('0x3a')][_0xf955('0xe3')]})[_0xf955('0x1f')](function(_0x5c8a3f){return _0x5c8a3f;});}})[_0xf955('0x1f')](function(_0x471223){return respondWithRpcPromise(_0xf955('0xe4'),_0xf955('0xde'),_0x27391f[_0xf955('0x3a')],client9004);})[_0xf955('0x1f')](respondWithResult(_0x269ae2,null))['catch'](handleError(_0x269ae2,null));};exports[_0xf955('0xe5')]=function(_0x4775bd,_0x2a862f,_0x42e3eb){_0x4775bd[_0xf955('0x3a')][_0xf955('0x38')]=_0x4775bd['file'][_0xf955('0xe6')];_0x4775bd['body']['basename']=_0x4775bd['file']['filename'];_0x4775bd[_0xf955('0x3a')]['type']=_0x4775bd[_0xf955('0xe7')][_0xf955('0xe8')];return db['Attachment'][_0xf955('0xc6')](_0x4775bd['body'])[_0xf955('0x1f')](respondWithResult(_0x2a862f,0xc9))['catch'](handleError(_0x2a862f,null));};exports[_0xf955('0xe9')]=function(_0x267963,_0x28ce39,_0x43a5c3){return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0x267963['params']['id']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null))[_0xf955('0x1f')](function(_0x30fd01){if(_0x30fd01){if(_0x30fd01[_0xf955('0xeb')]){return _0x28ce39[_0xf955('0x2c')](0x193)[_0xf955('0x2d')]({'status':0x193,'message':_0xf955('0xec')});}return db[_0xf955('0xed')][_0xf955('0xea')]({'where':{'id':_0x267963[_0xf955('0x4c')]['attachId']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null));}})[_0xf955('0x1f')](function(_0x444e24){if(_0x444e24){var _0x2fb11a=_0x444e24[_0xf955('0xee')]!==null;var _0x2ce35c=path[_0xf955('0xef')](config['root'],_0xf955('0xf0'));if(_0x2fb11a){_0x2ce35c=path[_0xf955('0xef')](_0x2ce35c,_0xf955('0xf1'));}var _0x1e35d7=path[_0xf955('0xef')](_0x2ce35c,_0x444e24[_0xf955('0xf2')]);return _0x28ce39[_0xf955('0xf3')](_0x1e35d7);}})[_0xf955('0x47')](handleError(_0x28ce39,null));};exports[_0xf955('0xf4')]=function(_0x38016a,_0x52ad4d){var _0x1620ec=null;var _0x2c8e49=null;var _0x2b3deb=null;var _0x1ae12a=null;if(_0x38016a[_0xf955('0x3a')]['id']){delete _0x38016a[_0xf955('0x3a')]['id'];}if(_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')]){_0x1ae12a=path['join'](config[_0xf955('0xf6')],_0xf955('0xf7'),util[_0xf955('0xf8')](_0xf955('0xf9'),Date[_0xf955('0xfa')]()));_0x38016a[_0xf955('0x3a')][_0xf955('0xfb')]=_0x1ae12a;}return db[_0xf955('0xad')]['find']({'where':{'id':_0x38016a['params']['id']},'include':[{'model':db[_0xf955('0xd9')],'as':_0xf955('0xfc'),'include':[{'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd')}]}]})['then'](handleEntityNotFound(_0x52ad4d,null))['then'](saveUpdates(_0x38016a[_0xf955('0x3a')],null))[_0xf955('0x1f')](function(_0x4860ad){if(_0x4860ad){_0x1620ec=_0x4860ad;return db[_0xf955('0xca')][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0xa5')]}});}})[_0xf955('0x1f')](function(_0x1c0211){if(_0x1c0211){_0x2b3deb=_0x1c0211;return db['CmContact'][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0x7c')]}});}})[_0xf955('0x1f')](function(_0x106640){if(_0x106640){_0x2c8e49=_0x106640;if(_0x1ae12a){var _0x101722=null;for(var _0x479dc0=0x1;_0x479dc0<_0x1620ec[_0xf955('0xfc')]['length'];++_0x479dc0){_0x101722=_0x1620ec[_0xf955('0xfc')][_0x479dc0];var _0x570005=_0x101722[_0xf955('0x84')]?util[_0xf955('0xf8')](_0xf955('0xfe'),_0x2b3deb[_0xf955('0xff')],_0x101722[_0xf955('0x84')]):_0xf955('0x100');var _0x85661f=_0x38016a[_0xf955('0x3a')][_0xf955('0x101')]||util[_0xf955('0xf8')]('%s%d','Visitor',_0x101722[_0xf955('0x7c')]);switch(_0x2b3deb[_0xf955('0x102')]){case _0xf955('0x103'):_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb[_0xf955('0xff')],_0x101722['UserId']):'System';break;case _0xf955('0x104'):_0x570005=_0x101722['UserId']?_0x101722[_0xf955('0xfd')][_0xf955('0x105')]||_0x101722['User']['fullname']:_0xf955('0x100');break;case _0xf955('0x106'):_0x570005=_0x101722[_0xf955('0x84')]?_0x101722[_0xf955('0xfd')][_0xf955('0x41')]:'System';break;default:_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb['agentAlias'],_0x101722[_0xf955('0x84')]):_0xf955('0x100');}var _0x23d382=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x101722[_0xf955('0x107')])['format'](_0xf955('0x108')),_0x101722['direction']==='in'?_0x85661f:_0x570005,_0x101722[_0xf955('0x3a')]);if(!_0x101722[_0xf955('0x109')]){fs['appendFileSync'](_0x1ae12a,_0x23d382);}}return db[_0xf955('0x10a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf955('0x10b')],'as':_0xf955('0x10c'),'raw':!![]}]});}}})[_0xf955('0x1f')](function(_0x1e6165){if(_0x1e6165&&_0x1e6165[_0xf955('0x10c')]&&_0x38016a['body']){var _0x4a6338={'tls':{'rejectUnauthorized':![]}};if(_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')]){_0x4a6338[_0xf955('0x10d')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')];}else{_0x4a6338[_0xf955('0x10e')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10e')];_0x4a6338[_0xf955('0x10f')]=_0x1e6165['Smtp'][_0xf955('0x10f')];_0x4a6338[_0xf955('0x110')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x110')];}if(_0x1e6165[_0xf955('0x10c')]['authentication']){_0x4a6338[_0xf955('0x111')]={'user':_0x1e6165[_0xf955('0x10c')]['user'],'pass':_0x1e6165[_0xf955('0x10c')]['pass']};}return respondWithRpcPromise('SendMail',_0xf955('0x112'),{'account':_0x4a6338,'message':{'from':util[_0xf955('0xf8')](_0xf955('0x113'),_0x1e6165[_0xf955('0x38')],_0x1e6165['email']||_0x1e6165[_0xf955('0x10c')][_0xf955('0xa7')]),'to':_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')],'subject':'Mail\x20Transcript','text':util[_0xf955('0xf8')](_0xf955('0x114'),_0x38016a['body'][_0xf955('0xf5')]),'attachments':[{'path':_0x1ae12a}]}})[_0xf955('0x1f')](function(){return _0x1620ec;})[_0xf955('0x47')](function(_0x50502a){console[_0xf955('0x25')](_0x50502a);});}else{return _0x1620ec;}})[_0xf955('0x1f')](respondWithStatusCode(_0x52ad4d,0xc8))[_0xf955('0x47')](handleError(_0x52ad4d,null));};exports['addMessage']=function(_0x1d2e9c,_0x49718e,_0x5aeba7){return db['ChatMessage'][_0xf955('0x71')]({'where':{'id':_0x1d2e9c[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x49718e,null))[_0xf955('0x1f')](function(_0x10cd8e){if(_0x10cd8e){return _0x10cd8e[_0xf955('0x115')](_0x1d2e9c['body'][_0xf955('0x116')],_[_0xf955('0x117')](_0x1d2e9c[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{});}})[_0xf955('0x1f')](respondWithResult(_0x49718e,null))[_0xf955('0x47')](handleError(_0x49718e,null));};exports[_0xf955('0x118')]=function(_0x287adf,_0x38177d,_0x56a307){var _0x49c6ca={'raw':![],'where':{}};var _0x36f3b3={};var _0x252118={'count':0x0,'rows':[]};return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x287adf['params']['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x38177d,null))['then'](function(_0x1dd4b4){if(_0x1dd4b4){_0x36f3b3[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xd9')]['rawAttributes']);_0x36f3b3[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x287adf[_0xf955('0x4c')]);_0x36f3b3['filters']=_[_0xf955('0x4e')](_0x36f3b3['model'],_0x36f3b3[_0xf955('0x4c')]);_0x49c6ca[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x36f3b3[_0xf955('0x4b')],qs['fields'](_0x287adf[_0xf955('0x4c')][_0xf955('0x4f')]));_0x49c6ca[_0xf955('0x50')]=_0x49c6ca['attributes'][_0xf955('0x51')]?_0x49c6ca['attributes']:_0x36f3b3[_0xf955('0x4b')];if(!_0x287adf['query'][_0xf955('0x52')]('nolimit')){_0x49c6ca[_0xf955('0x30')]=qs['limit'](_0x287adf['query']['limit']);_0x49c6ca[_0xf955('0x2e')]=qs['offset'](_0x287adf['query'][_0xf955('0x2e')]);}_0x49c6ca[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0x287adf[_0xf955('0x4c')][_0xf955('0x54')]);_0x49c6ca[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0x287adf['query'],_0x36f3b3[_0xf955('0x4d')]));_0x49c6ca[_0xf955('0x55')][_0xf955('0xc0')]=_0x1dd4b4['id'];if(_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]){_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca[_0xf955('0x55')],{'$or':_[_0xf955('0x40')](_0x49c6ca['attributes'],function(_0x1d1df4){var _0x1b7a62={};_0x1b7a62[_0x1d1df4]={'$like':'%'+_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x1b7a62;})});}if(_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')]){var _0x547464=_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')][_0xf955('0x44')](',');var _0x280d1c={};_0x280d1c[_0x547464[0x0]]={'$gte':moment(_0x547464[0x1])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca['where'],_0x280d1c);}_0x49c6ca=_['merge']({},_0x49c6ca,_0x287adf['options']);return db[_0xf955('0xd9')][_0xf955('0x31')]({'where':_0x49c6ca[_0xf955('0x55')]})[_0xf955('0x1f')](function(_0x14bed6){_0x252118[_0xf955('0x31')]=_0x14bed6;if(_0x287adf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x49c6ca[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')]['findAll'](_0x49c6ca);})[_0xf955('0x1f')](function(_0x7996b8){_0x252118[_0xf955('0xc2')]=_0x7996b8;return _0x252118;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x38177d,_0x49c6ca))[_0xf955('0x47')](handleError(_0x38177d,null));};exports['getMyMessages']=function(_0xac8cdf,_0x70fa9f,_0x5e650f){var _0x39d911={'where':{}},_0x2fbf0c={},_0x1612e4={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0xac8cdf[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x70fa9f,null))[_0xf955('0x1f')](function(_0x1a7da8){if(_0x1a7da8){_0x2fbf0c[_0xf955('0x4b')]=_[_0xf955('0x85')](db['ChatMessage'][_0xf955('0x49')]);_0x2fbf0c['query']=_['keys'](_0xac8cdf['query']);_0x2fbf0c[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],_0x2fbf0c[_0xf955('0x4c')]);_0x39d911[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],qs['fields'](_0xac8cdf['query'][_0xf955('0x4f')]));_0x39d911[_0xf955('0x50')]=_0x39d911['attributes']['length']?_0x39d911[_0xf955('0x50')]:_0x2fbf0c[_0xf955('0x4b')];if(!_0xac8cdf[_0xf955('0x4c')]['hasOwnProperty']('nolimit')){_0x39d911[_0xf955('0x30')]=qs[_0xf955('0x30')](_0xac8cdf[_0xf955('0x4c')][_0xf955('0x30')]);_0x39d911[_0xf955('0x2e')]=qs['offset'](_0xac8cdf['query'][_0xf955('0x2e')]);}_0x39d911[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0xac8cdf[_0xf955('0x4c')]['sort']);_0x39d911[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0xac8cdf[_0xf955('0x4c')],_0x2fbf0c[_0xf955('0x4d')]));_0x39d911[_0xf955('0x55')]['ChatInteractionId']=_0x1a7da8['id'];if(_0xac8cdf['query'][_0xf955('0x96')]){_0x39d911['where']=_[_0xf955('0x39')](_0x39d911[_0xf955('0x55')],{'$or':_['map'](_0x39d911['attributes'],function(_0x4a3d8c){var _0x170ea7={};_0x170ea7[_0x4a3d8c]={'$like':'%'+_0xac8cdf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x170ea7;})});}_0x39d911[_0xf955('0x55')][_0xf955('0x109')]=![];if(_0xac8cdf[_0xf955('0x4c')]['id']){_0x39d911[_0xf955('0x55')]['id']={'$gt':_0xac8cdf[_0xf955('0x4c')]['id']};}_0x39d911=_[_0xf955('0x39')]({},_0x39d911,_0xac8cdf['options']);return db[_0xf955('0xd9')]['count']({'where':_0x39d911['where']})[_0xf955('0x1f')](function(_0x36327c){_0x1612e4[_0xf955('0x31')]=_0x36327c;_0x39d911[_0xf955('0xc4')]=[];if(_0xac8cdf['query'][_0xf955('0x11a')]){_0x39d911['include'][_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd'),'attributes':['id',_0xf955('0x41'),'alias']});}if(_0xac8cdf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x39d911[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')][_0xf955('0x11b')](_0x39d911);})[_0xf955('0x1f')](function(_0x3e4239){_0x1612e4[_0xf955('0xc2')]=_0x3e4239;return _0x1612e4;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x70fa9f,_0x39d911))['catch'](handleError(_0x70fa9f,null));};exports[_0xf955('0x11c')]=function(_0x11a228,_0x2d37c2,_0x932b98){return db[_0xf955('0xad')]['find']({'where':{'id':_0x11a228[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x2d37c2,null))[_0xf955('0x1f')](function(_0x147f3c){if(_0x147f3c){return _0x147f3c[_0xf955('0x11d')](_0x11a228[_0xf955('0x3a')]['ids'],_[_0xf955('0x117')](_0x11a228[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{})[_0xf955('0x11e')](function(){return db[_0xf955('0x11f')]['findAll']({'attributes':['id',_0xf955('0x38'),_0xf955('0x57')],'where':{'id':_0x11a228[_0xf955('0x3a')]['ids']}});})[_0xf955('0x1f')](function(_0xfcaf21){socket['emit'](_0xf955('0x120'),{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]});return{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]};});}})[_0xf955('0x1f')](respondWithResult(_0x2d37c2,null))[_0xf955('0x47')](handleError(_0x2d37c2,null));};exports['removeTags']=function(_0x572efd,_0x357dbc,_0x2b9880){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x572efd[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x357dbc,null))['then'](function(_0x23968f){if(_0x23968f){return _0x23968f[_0xf955('0x121')](_0x572efd[_0xf955('0x4c')][_0xf955('0x116')]);}})['then'](respondWithStatusCode(_0x357dbc,null))[_0xf955('0x47')](handleError(_0x357dbc,null));};exports[_0xf955('0xf3')]=function(_0x3842e1,_0x204e4e){var _0x47b877=moment()[_0xf955('0x122')]()[_0xf955('0xbe')]();var _0x1624e9=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),'tmp');var _0x3ccc35=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),_0xf955('0x125'));var _0x72b500=path[_0xf955('0xef')](_0x1624e9,_0x47b877);var _0x1d4aa6=util[_0xf955('0xf8')](_0xf955('0x126'),_0x3842e1[_0xf955('0xc7')]['id'],_0x47b877);var _0x4896ae=path[_0xf955('0xef')](_0x1624e9,_0x1d4aa6);var _0x3b67e3=[];_0x3b67e3[_0xf955('0x46')]({'model':db['User'],'as':_0xf955('0xfd'),'attributes':['id','fullname'],'raw':!![]});_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xdd')],'as':_0xf955('0x77'),'attributes':['id',_0xf955('0x127'),'lastName'],'raw':!![]});if(_0x3842e1['query']['attachments']){_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xed')],'as':_0xf955('0xed'),'raw':!![]});}var _0x21b589=[{'model':db[_0xf955('0xd9')],'as':'Messages','attributes':['id',_0xf955('0x3a'),_0xf955('0x107'),_0xf955('0x128'),_0xf955('0x109'),'read'],'include':_0x3b67e3}];_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xca')],'as':_0xf955('0x129'),'attributes':['id',_0xf955('0x38')]});_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':'Owner','attributes':['id',_0xf955('0x41')]});return db['ChatInteraction'][_0xf955('0x71')]({'where':{'id':_0x3842e1['params']['id']},'include':_0x21b589})[_0xf955('0x1f')](handleEntityNotFound(_0x204e4e,null))[_0xf955('0x1f')](function(_0x1ed31c){if(_0x1ed31c){var _0x2e8dc2=_0x1ed31c[_0xf955('0x12a')]({'plain':!![]});fs[_0xf955('0x12b')](_0x72b500);var _0x58b727={'channel':_0xf955('0x12c'),'account':_0x2e8dc2[_0xf955('0x129')][_0xf955('0x38')],'agent':_0x2e8dc2[_0xf955('0x12d')]?_0x2e8dc2[_0xf955('0x12d')][_0xf955('0x41')]:_0xf955('0x12e'),'createdAt':moment(_0x2e8dc2['createdAt'])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')](),'closedAt':_0x2e8dc2['closed']?moment(_0x2e8dc2[_0xf955('0x12f')])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')]():'','disposition':_0x2e8dc2['disposition'],'chatInfo':{'browser':_0x2e8dc2[_0xf955('0x130')],'os':_0x2e8dc2['osName'],'referer':_0x2e8dc2[_0xf955('0x131')],'customerIp':_0x2e8dc2[_0xf955('0x132')],'customerPort':_0x2e8dc2[_0xf955('0x133')]?_0x2e8dc2[_0xf955('0x133')]:'N.A.'},'messages':_(_0x2e8dc2[_0xf955('0xfc')])[_0xf955('0x134')]()[_0xf955('0x96')]({'secret':![]})[_0xf955('0x40')](function(_0x1307a6){if(_0x1307a6[_0xf955('0xed')]){var _0x3328b9=path[_0xf955('0xef')](_0x3ccc35,_0x1307a6['Attachment'][_0xf955('0xf2')]);if(fs[_0xf955('0x135')](_0x3328b9)){fs[_0xf955('0x136')](_0x3328b9)[_0xf955('0x137')](fs['createWriteStream'](path[_0xf955('0xef')](_0x72b500,_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')])));}}return{'date':moment(_0x1307a6[_0xf955('0x107')])[_0xf955('0xf8')](_0xf955('0x138'))['toString'](),'sender':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?_0x1307a6['User']?_0x1307a6[_0xf955('0xfd')][_0xf955('0x41')]:_0xf955('0x100'):_0x1307a6[_0xf955('0x77')][_0xf955('0x127')]+(_0x1307a6[_0xf955('0x77')][_0xf955('0x139')]?'\x20'+_0x1307a6['Contact'][_0xf955('0x139')]:''),'body':_0x1307a6[_0xf955('0xed')]?_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')]:_0x1307a6[_0xf955('0x3a')],'direction':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?'A':'C','secret':_0x1307a6['secret'],'read':_0x1307a6[_0xf955('0x91')],'attachment':_0x1307a6[_0xf955('0xed')]};})[_0xf955('0x73')]()};return ejs[_0xf955('0x13a')](path[_0xf955('0xef')](config[_0xf955('0xf6')],'server',_0xf955('0x13b'),_0xf955('0x13c')),{'interaction':_0x58b727})[_0xf955('0x1f')](function(_0x385676){var _0x5a9193=path['join'](_0x72b500,_0xf955('0x13d')+_0x2e8dc2['id']+'-'+_0x47b877+_0xf955('0x13e'));var _0x157508={'path':_0x5a9193,'channel':'Chat','interactionId':_0x2e8dc2['id']};return pdf[_0xf955('0x13f')](_0x385676,_0x157508);})['then'](function(){return new BPromise(function(_0x37bdd4,_0x4f8fc8){zipdir(_0x72b500,{'saveTo':_0x4896ae},function(_0x5f3e0f,_0x4ad147){if(_0x5f3e0f)return _0x4f8fc8(_0x5f3e0f);return _0x37bdd4(_0x4ad147);});})[_0xf955('0x1f')](function(){return new BPromise(function(_0x2dc607,_0x355871){rimraf(_0x72b500,function(_0x1c5b1d){if(_0x1c5b1d)_0x355871(_0x1c5b1d);return _0x2dc607();});});})[_0xf955('0x1f')](function(){return _0x204e4e[_0xf955('0xf3')](_0x4896ae,_0x1d4aa6,function(_0x5eac2b){if(_0x5eac2b){console[_0xf955('0x140')](_0xf955('0x141'),_0x5eac2b);}else{fs[_0xf955('0x142')](_0x4896ae);}});});});}else{return _0x204e4e[_0xf955('0x2a')](0xc8);}})[_0xf955('0x47')](handleError(_0x204e4e,null));};
\ No newline at end of file
+var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','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)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x5d68b2,_0x566143){var _0x31ae98=function(_0x3f3338){while(--_0x3f3338){_0x5d68b2['push'](_0x5d68b2['shift']());}};_0x31ae98(++_0x566143);}(_0xea28,0x13a));var _0x8ea2=function(_0x22f68b,_0x3c43d8){_0x22f68b=_0x22f68b-0x0;var _0x51327e=_0xea28[_0x22f68b];return _0x51327e;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
index 1e9e53d..6f1aefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf59=['emit','catch','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','remove','then','Users','findAll','setDataValue','length'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0xdf59,0x82));var _0x9df5=function(_0x4e272f,_0x3f93f7){_0x4e272f=_0x4e272f-0x0;var _0x81996e=_0xdf59[_0x4e272f];return _0x81996e;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x9df5('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x9df5('0x0'))['db'][_0x9df5('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9df5('0x2')](0x0);var events={'afterCreate':_0x9df5('0x3'),'afterUpdate':'update','afterDestroy':_0x9df5('0x4')};function emitEvent(_0x526294){return function(_0x58b700,_0x46d79d,_0x41d044){_0x58b700['getUsers']({'attributes':['id'],'raw':!![]})[_0x9df5('0x5')](function(_0x2dc51b){_0x58b700['setDataValue'](_0x9df5('0x6'),_0x2dc51b['map'](function(_0x26e71b){return{'id':_0x26e71b['id']};}));return ChatMessage[_0x9df5('0x7')]({'where':{'ChatInteractionId':_0x58b700['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9df5('0x5')](function(_0x6061){_0x58b700[_0x9df5('0x8')]('unreadMessages',_0x6061[_0x9df5('0x9')]);ChatInteractionEvents[_0x9df5('0xa')](_0x526294+':'+_0x58b700['id'],_0x58b700);ChatInteractionEvents[_0x9df5('0xa')](_0x526294,_0x58b700);_0x41d044(null);})[_0x9df5('0xb')](_0x41d044(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x9df5('0xc')](e,emitEvent(event));}}module[_0x9df5('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x6ea7=['then','setDataValue','Users','map','findAll','emit','catch','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers'];(function(_0x442dde,_0x34ec76){var _0x536b02=function(_0x5e9120){while(--_0x5e9120){_0x442dde['push'](_0x442dde['shift']());}};_0x536b02(++_0x34ec76);}(_0x6ea7,0x199));var _0x76ea=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x6ea7[_0x2aea9e];return _0x430b92;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x76ea('0x0'))['db'][_0x76ea('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x76ea('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76ea('0x3'),'afterUpdate':_0x76ea('0x4'),'afterDestroy':_0x76ea('0x5')};function emitEvent(_0x55728e){return function(_0x1aca43,_0x311ca3,_0x2a80c3){_0x1aca43[_0x76ea('0x6')]({'attributes':['id'],'raw':!![]})[_0x76ea('0x7')](function(_0x3eca59){_0x1aca43[_0x76ea('0x8')](_0x76ea('0x9'),_0x3eca59[_0x76ea('0xa')](function(_0x11d5ac){return{'id':_0x11d5ac['id']};}));return ChatMessage[_0x76ea('0xb')]({'where':{'ChatInteractionId':_0x1aca43['id'],'direction':'in','read':![]},'raw':!![]});})[_0x76ea('0x7')](function(_0x161542){_0x1aca43[_0x76ea('0x8')]('unreadMessages',_0x161542['length']);ChatInteractionEvents[_0x76ea('0xc')](_0x55728e+':'+_0x1aca43['id'],_0x1aca43);ChatInteractionEvents[_0x76ea('0xc')](_0x55728e,_0x1aca43);_0x2a80c3(null);})[_0x76ea('0xd')](_0x2a80c3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x76ea('0xe')](e,emitEvent(event));}}module[_0x76ea('0xf')]=ChatInteractionEvents;
\ No newline at end of file
index 992d611..9c6b622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2495=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0xd516f0,_0x5303e7){var _0x1d25e3=function(_0x6a466d){while(--_0x6a466d){_0xd516f0['push'](_0xd516f0['shift']());}};_0x1d25e3(++_0x5303e7);}(_0x2495,0x1c7));var _0x5249=function(_0x22acaa,_0x36b8ea){_0x22acaa=_0x22acaa-0x0;var _0x3ff523=_0x2495[_0x22acaa];return _0x3ff523;};'use strict';var _=require(_0x5249('0x0'));var util=require(_0x5249('0x1'));var logger=require('../../config/logger')(_0x5249('0x2'));var moment=require(_0x5249('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5249('0x4'));var rimraf=require('rimraf');var config=require(_0x5249('0x5'));var attributes=require(_0x5249('0x6'));module['exports']=function(_0x526dda,_0x3c37da){return _0x526dda[_0x5249('0x7')](_0x5249('0x8'),attributes,{'tableName':_0x5249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10c930,_0x23c712,_0x193384){if(_0x10c930['changed'](_0x5249('0xa'))){_0x10c930[_0x5249('0xb')]=moment()['format'](_0x5249('0xc'));}_0x193384(null,_0x10c930);}},'charset':_0x5249('0xd'),'collate':_0x5249('0xe')});};
\ No newline at end of file
+var _0x2066=['ChatInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2066,0xe5));var _0x6206=function(_0x22d4b8,_0x35ea26){_0x22d4b8=_0x22d4b8-0x0;var _0x4e1383=_0x2066[_0x22d4b8];return _0x4e1383;};'use strict';var _=require(_0x6206('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6206('0x1'));var moment=require(_0x6206('0x2'));var BPromise=require(_0x6206('0x3'));var rp=require(_0x6206('0x4'));var fs=require('fs');var path=require(_0x6206('0x5'));var rimraf=require(_0x6206('0x6'));var config=require(_0x6206('0x7'));var attributes=require(_0x6206('0x8'));module[_0x6206('0x9')]=function(_0x79a836,_0x1ada28){return _0x79a836[_0x6206('0xa')](_0x6206('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14bc5d,_0x45b0dc,_0x30a065){if(_0x14bc5d[_0x6206('0xc')]('closed')){_0x14bc5d[_0x6206('0xd')]=moment()['format'](_0x6206('0xe'));}_0x30a065(null,_0x14bc5d);}},'charset':'utf8mb4','collate':_0x6206('0xf')});};
\ No newline at end of file
index ab8b5ee..8157bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2efa=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateChatInteraction','options','raw','attributes','AddTagsToChatInteraction','ChatInteraction','body','ids','spread','AddTags','lodash'];(function(_0x2b9f08,_0x32f052){var _0x375c87=function(_0x3b8b81){while(--_0x3b8b81){_0x2b9f08['push'](_0x2b9f08['shift']());}};_0x375c87(++_0x32f052);}(_0x2efa,0x1bb));var _0xa2ef=function(_0x1c450a,_0x246b74){_0x1c450a=_0x1c450a-0x0;var _0x17f2da=_0x2efa[_0x1c450a];return _0x17f2da;};'use strict';var _=require(_0xa2ef('0x0'));var util=require(_0xa2ef('0x1'));var moment=require(_0xa2ef('0x2'));var BPromise=require(_0xa2ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ef('0x4'));var db=require(_0xa2ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2ef('0x6'))(_0xa2ef('0x7'));var config=require(_0xa2ef('0x8'));var jayson=require(_0xa2ef('0x9'));var client=jayson[_0xa2ef('0xa')][_0xa2ef('0xb')]({'port':0x232a});config[_0xa2ef('0xc')]=_[_0xa2ef('0xd')](config[_0xa2ef('0xc')],{'host':_0xa2ef('0xe'),'port':0x18eb});var socket=require(_0xa2ef('0xf'))(new Redis(config[_0xa2ef('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x11bef7,_0x416384,_0x147939){return new BPromise(function(_0x498683,_0x8f71ec){return client[_0xa2ef('0x10')](_0x11bef7,_0x147939)[_0xa2ef('0x11')](function(_0xc3faef){logger[_0xa2ef('0x12')](_0xa2ef('0x13'),_0x416384,_0xa2ef('0x14'));logger[_0xa2ef('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x416384,_0xa2ef('0x14'),JSON[_0xa2ef('0x16')](_0xc3faef));if(_0xc3faef[_0xa2ef('0x17')]){if(_0xc3faef[_0xa2ef('0x17')][_0xa2ef('0x18')]===0x1f4){logger[_0xa2ef('0x17')](_0xa2ef('0x13'),_0x416384,_0xc3faef[_0xa2ef('0x17')]['message']);return _0x8f71ec(_0xc3faef[_0xa2ef('0x17')][_0xa2ef('0x19')]);}logger[_0xa2ef('0x17')](_0xa2ef('0x13'),_0x416384,_0xc3faef['error'][_0xa2ef('0x19')]);return _0x498683(_0xc3faef[_0xa2ef('0x17')][_0xa2ef('0x19')]);}else{logger[_0xa2ef('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x416384,_0xa2ef('0x14'));_0x498683(_0xc3faef['result'][_0xa2ef('0x19')]);}})[_0xa2ef('0x1a')](function(_0x22084c){logger[_0xa2ef('0x17')](_0xa2ef('0x13'),_0x416384,_0x22084c);_0x8f71ec(_0x22084c);});});}exports[_0xa2ef('0x1b')]=function(_0x3f1c8a){var _0x59ec40=this;return new Promise(function(_0x390db7,_0x16e023){return db['ChatInteraction']['update'](_0x3f1c8a['body'],{'raw':_0x3f1c8a[_0xa2ef('0x1c')]?_0x3f1c8a['options'][_0xa2ef('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f1c8a[_0xa2ef('0x1c')]?_0x3f1c8a[_0xa2ef('0x1c')]['where']||null:null,'attributes':_0x3f1c8a[_0xa2ef('0x1c')]?_0x3f1c8a[_0xa2ef('0x1c')][_0xa2ef('0x1e')]||null:null,'limit':_0x3f1c8a[_0xa2ef('0x1c')]?_0x3f1c8a[_0xa2ef('0x1c')]['limit']||null:null})[_0xa2ef('0x11')](function(_0x495cd7){logger[_0xa2ef('0x12')](_0xa2ef('0x1b'),_0x3f1c8a);logger['debug']('UpdateChatInteraction',_0x3f1c8a,JSON[_0xa2ef('0x16')](_0x495cd7));_0x390db7(_0x495cd7);})[_0xa2ef('0x1a')](function(_0x3b97d4){logger['error'](_0xa2ef('0x1b'),_0x3b97d4[_0xa2ef('0x19')],_0x3f1c8a);_0x16e023(_0x59ec40[_0xa2ef('0x17')](0x1f4,_0x3b97d4['message']));});});};exports[_0xa2ef('0x1f')]=function(_0x5402bf){return new Promise(function(_0x253a7a,_0x46ee87){return db[_0xa2ef('0x20')]['find']({'where':_0x5402bf['options']?_0x5402bf[_0xa2ef('0x1c')]['where']||null:null})[_0xa2ef('0x11')](function(_0x2ac7a0){if(_0x2ac7a0){return _0x2ac7a0['addTags'](_0x5402bf[_0xa2ef('0x21')][_0xa2ef('0x22')],_['omit'](_0x5402bf['body'],[_0xa2ef('0x22'),'id'])||{});}})[_0xa2ef('0x23')](function(_0x470036){logger['info']('AddTags',_0x5402bf);logger[_0xa2ef('0x15')](_0xa2ef('0x24'),_0x5402bf,JSON['stringify'](_0x470036));_0x253a7a(_0x470036);})['catch'](function(_0xfcc9e7){logger[_0xa2ef('0x17')]('AddTags',_0xfcc9e7[_0xa2ef('0x19')],_0x5402bf);_0x46ee87(_this[_0xa2ef('0x17')](0x1f4,_0xfcc9e7['message']));});});};
\ No newline at end of file
+var _0xf3be=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction','then','addTags','body','ids','omit','spread','AddTags'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf3be,0x81));var _0xef3b=function(_0x48c01f,_0xae686e){_0x48c01f=_0x48c01f-0x0;var _0x98568e=_0xf3be[_0x48c01f];return _0x98568e;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var moment=require(_0xef3b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef3b('0x3'));var db=require(_0xef3b('0x4'))['db'];var utils=require(_0xef3b('0x5'));var logger=require(_0xef3b('0x6'))(_0xef3b('0x7'));var config=require(_0xef3b('0x8'));var jayson=require(_0xef3b('0x9'));var client=jayson[_0xef3b('0xa')][_0xef3b('0xb')]({'port':0x232a});config[_0xef3b('0xc')]=_[_0xef3b('0xd')](config[_0xef3b('0xc')],{'host':_0xef3b('0xe'),'port':0x18eb});var socket=require(_0xef3b('0xf'))(new Redis(config[_0xef3b('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1749da,_0x4faf01,_0x566bc5){return new BPromise(function(_0xadede8,_0x29e236){return client[_0xef3b('0x10')](_0x1749da,_0x566bc5)['then'](function(_0x53f7d4){logger[_0xef3b('0x11')](_0xef3b('0x12'),_0x4faf01,_0xef3b('0x13'));logger[_0xef3b('0x14')](_0xef3b('0x15'),_0x4faf01,_0xef3b('0x13'),JSON[_0xef3b('0x16')](_0x53f7d4));if(_0x53f7d4['error']){if(_0x53f7d4[_0xef3b('0x17')][_0xef3b('0x18')]===0x1f4){logger[_0xef3b('0x17')](_0xef3b('0x12'),_0x4faf01,_0x53f7d4[_0xef3b('0x17')][_0xef3b('0x19')]);return _0x29e236(_0x53f7d4[_0xef3b('0x17')][_0xef3b('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4faf01,_0x53f7d4[_0xef3b('0x17')][_0xef3b('0x19')]);return _0xadede8(_0x53f7d4[_0xef3b('0x17')]['message']);}else{logger['info'](_0xef3b('0x12'),_0x4faf01,_0xef3b('0x13'));_0xadede8(_0x53f7d4['result'][_0xef3b('0x19')]);}})[_0xef3b('0x1a')](function(_0x18f27a){logger[_0xef3b('0x17')](_0xef3b('0x12'),_0x4faf01,_0x18f27a);_0x29e236(_0x18f27a);});});}exports[_0xef3b('0x1b')]=function(_0x53902e){var _0x1bcada=this;return new Promise(function(_0x225bfc,_0x5c8ce7){return db['ChatInteraction'][_0xef3b('0x1c')](_0x53902e['body'],{'raw':_0x53902e['options']?_0x53902e[_0xef3b('0x1d')][_0xef3b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53902e[_0xef3b('0x1d')]?_0x53902e[_0xef3b('0x1d')][_0xef3b('0x1f')]||null:null,'attributes':_0x53902e[_0xef3b('0x1d')]?_0x53902e[_0xef3b('0x1d')][_0xef3b('0x20')]||null:null,'limit':_0x53902e[_0xef3b('0x1d')]?_0x53902e[_0xef3b('0x1d')][_0xef3b('0x21')]||null:null})['then'](function(_0x306021){logger[_0xef3b('0x11')](_0xef3b('0x1b'),_0x53902e);logger[_0xef3b('0x14')]('UpdateChatInteraction',_0x53902e,JSON[_0xef3b('0x16')](_0x306021));_0x225bfc(_0x306021);})[_0xef3b('0x1a')](function(_0x4af361){logger[_0xef3b('0x17')](_0xef3b('0x1b'),_0x4af361[_0xef3b('0x19')],_0x53902e);_0x5c8ce7(_0x1bcada['error'](0x1f4,_0x4af361[_0xef3b('0x19')]));});});};exports[_0xef3b('0x22')]=function(_0x132c68){return new Promise(function(_0x43be4f,_0x48714c){return db[_0xef3b('0x23')]['find']({'where':_0x132c68['options']?_0x132c68[_0xef3b('0x1d')][_0xef3b('0x1f')]||null:null})[_0xef3b('0x24')](function(_0x343709){if(_0x343709){return _0x343709[_0xef3b('0x25')](_0x132c68[_0xef3b('0x26')][_0xef3b('0x27')],_[_0xef3b('0x28')](_0x132c68[_0xef3b('0x26')],[_0xef3b('0x27'),'id'])||{});}})[_0xef3b('0x29')](function(_0x19f5ce){logger['info'](_0xef3b('0x2a'),_0x132c68);logger['debug'](_0xef3b('0x2a'),_0x132c68,JSON[_0xef3b('0x16')](_0x19f5ce));_0x43be4f(_0x19f5ce);})['catch'](function(_0x12c587){logger['error']('AddTags',_0x12c587[_0xef3b('0x19')],_0x132c68);_0x48714c(_this['error'](0x1f4,_0x12c587['message']));});});};
\ No newline at end of file
index f5f56aa..6bc8021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79c3=['save','removeListener','length','chatInteraction:'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0x79c3,0xe8));var _0x379c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x79c3[_0x1facfa];return _0x9ec701;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x379c('0x0'),'remove','update'];function createListener(_0xddf924,_0x5d8fe0){return function(_0x80c04c){_0x5d8fe0['emit'](_0xddf924,_0x80c04c);};}function removeListener(_0x67d422,_0x3bb8c7){return function(){ChatInteractionEvents[_0x379c('0x1')](_0x67d422,_0x3bb8c7);};}exports['register']=function(_0x31258e){for(var _0xddde0e=0x0,_0x1b4703=events[_0x379c('0x2')];_0xddde0e<_0x1b4703;_0xddde0e++){var _0x3a30bc=events[_0xddde0e];var _0x2554b5=createListener(_0x379c('0x3')+_0x3a30bc,_0x31258e);ChatInteractionEvents['on'](_0x3a30bc,_0x2554b5);}};
\ No newline at end of file
+var _0xd7d9=['update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x9191fc,_0x2b8b47){var _0x2d9252=function(_0x5a4875){while(--_0x5a4875){_0x9191fc['push'](_0x9191fc['shift']());}};_0x2d9252(++_0x2b8b47);}(_0xd7d9,0x137));var _0x9d7d=function(_0x1bec0d,_0x338db4){_0x1bec0d=_0x1bec0d-0x0;var _0x49e3e3=_0xd7d9[_0x1bec0d];return _0x49e3e3;};'use strict';var ChatInteractionEvents=require(_0x9d7d('0x0'));var events=['save','remove',_0x9d7d('0x1')];function createListener(_0x2938d9,_0x4aa2af){return function(_0x47074d){_0x4aa2af[_0x9d7d('0x2')](_0x2938d9,_0x47074d);};}function removeListener(_0x479f68,_0x580f63){return function(){ChatInteractionEvents[_0x9d7d('0x3')](_0x479f68,_0x580f63);};}exports[_0x9d7d('0x4')]=function(_0xcbf42){for(var _0x206463=0x0,_0x4553e4=events['length'];_0x206463<_0x4553e4;_0x206463++){var _0xe001a4=events[_0x206463];var _0x4df413=createListener(_0x9d7d('0x5')+_0xe001a4,_0xcbf42);ChatInteractionEvents['on'](_0xe001a4,_0x4df413);}};
\ No newline at end of file
index dda7afc..4cb048c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c44=['/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','close','delete','destroy','/:id/tags','removeTags','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5c44,0xc1));var _0x45c4=function(_0x41ccb2,_0x5eb791){_0x41ccb2=_0x41ccb2-0x0;var _0x430a1a=_0x5c44[_0x41ccb2];return _0x430a1a;};'use strict';var multer=require(_0x45c4('0x0'));var util=require('util');var path=require(_0x45c4('0x1'));var timeout=require('connect-timeout');var express=require(_0x45c4('0x2'));var router=express[_0x45c4('0x3')]();var fs_extra=require(_0x45c4('0x4'));var auth=require(_0x45c4('0x5'));var interaction=require(_0x45c4('0x6'));var config=require(_0x45c4('0x7'));var controller=require(_0x45c4('0x8'));router[_0x45c4('0x9')]('/',auth[_0x45c4('0xa')](),controller[_0x45c4('0xb')]);router[_0x45c4('0x9')](_0x45c4('0xc'),auth[_0x45c4('0xa')](),controller[_0x45c4('0xd')]);router['get'](_0x45c4('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x45c4('0xf')]);router[_0x45c4('0x9')](_0x45c4('0x10'),auth[_0x45c4('0x11')](),controller[_0x45c4('0x12')]);router[_0x45c4('0x9')](_0x45c4('0x13'),auth[_0x45c4('0xa')](),controller[_0x45c4('0x14')]);router['get'](_0x45c4('0x15'),auth[_0x45c4('0x11')](),controller[_0x45c4('0x16')]);router[_0x45c4('0x9')](_0x45c4('0x17'),auth[_0x45c4('0xa')](),controller[_0x45c4('0x18')]);router[_0x45c4('0x19')]('/',auth[_0x45c4('0xa')](),controller[_0x45c4('0x1a')]);router[_0x45c4('0x19')](_0x45c4('0x1b'),auth['isAuthenticated'](),controller[_0x45c4('0x1c')]);var upload=multer({'storage':multer[_0x45c4('0x1d')]({'destination':function(_0x532dab,_0x5ae8a2,_0x1e4c65){_0x1e4c65(null,path[_0x45c4('0x1e')](config[_0x45c4('0x1f')],'server/files/attachments/'));},'filename':function(_0x5bb1e6,_0x2358ad,_0x275ca3){_0x275ca3(null,util[_0x45c4('0x20')](_0x45c4('0x21'),Date['now'](),_0x2358ad[_0x45c4('0x22')][_0x45c4('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x45c4('0x19')](_0x45c4('0x24'),upload[_0x45c4('0x25')](_0x45c4('0x26')),controller['attachmentUpload']);router[_0x45c4('0x19')]('/:id/messages',auth[_0x45c4('0x11')](),controller[_0x45c4('0x27')]);router['post']('/:id/tags',auth[_0x45c4('0xa')](),interaction[_0x45c4('0x28')](_0x45c4('0x29'),_0x45c4('0x2a')),controller[_0x45c4('0x2b')]);router[_0x45c4('0x2c')](_0x45c4('0xe'),auth[_0x45c4('0xa')](),interaction[_0x45c4('0x28')]('chat',_0x45c4('0x2d')),controller[_0x45c4('0x2e')]);router['put'](_0x45c4('0x2f'),controller[_0x45c4('0x30')]);router[_0x45c4('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x45c4('0x31')]);router[_0x45c4('0x2c')]('/:id/close',controller[_0x45c4('0x32')]);router[_0x45c4('0x33')]('/:id',auth[_0x45c4('0xa')](),interaction[_0x45c4('0x28')](_0x45c4('0x29'),'chatinteraction:destroy'),controller[_0x45c4('0x34')]);router[_0x45c4('0x33')](_0x45c4('0x35'),auth['isAuthenticated'](),controller[_0x45c4('0x36')]);module['exports']=router;
\ No newline at end of file
+var _0xcbac=['get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./chatInteraction.controller'];(function(_0x419e32,_0x15c823){var _0x5ce1bc=function(_0x5d9eae){while(--_0x5d9eae){_0x419e32['push'](_0x419e32['shift']());}};_0x5ce1bc(++_0x15c823);}(_0xcbac,0x1a1));var _0xccba=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xcbac[_0x934425];return _0x31d596;};'use strict';var multer=require(_0xccba('0x0'));var util=require(_0xccba('0x1'));var path=require('path');var timeout=require(_0xccba('0x2'));var express=require('express');var router=express[_0xccba('0x3')]();var fs_extra=require(_0xccba('0x4'));var auth=require(_0xccba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xccba('0x6'));router[_0xccba('0x7')]('/',auth[_0xccba('0x8')](),controller[_0xccba('0x9')]);router[_0xccba('0x7')](_0xccba('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xccba('0x7')]('/:id',auth[_0xccba('0xb')](),controller[_0xccba('0xc')]);router[_0xccba('0x7')](_0xccba('0xd'),auth[_0xccba('0xb')](),controller[_0xccba('0xe')]);router['get'](_0xccba('0xf'),auth[_0xccba('0x8')](),controller[_0xccba('0x10')]);router[_0xccba('0x7')](_0xccba('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xccba('0x7')]('/:id/download',auth[_0xccba('0x8')](),controller[_0xccba('0x12')]);router[_0xccba('0x13')]('/',auth['isAuthenticated'](),controller[_0xccba('0x14')]);router['post'](_0xccba('0x15'),auth[_0xccba('0x8')](),controller[_0xccba('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc5d014,_0x22cd0f,_0x14d1a0){_0x14d1a0(null,path[_0xccba('0x17')](config[_0xccba('0x18')],_0xccba('0x19')));},'filename':function(_0x542b09,_0x104840,_0x30cd85){_0x30cd85(null,util[_0xccba('0x1a')](_0xccba('0x1b'),Date[_0xccba('0x1c')](),_0x104840[_0xccba('0x1d')][_0xccba('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xccba('0x13')](_0xccba('0x1f'),upload[_0xccba('0x20')](_0xccba('0x21')),controller[_0xccba('0x22')]);router['post']('/:id/messages',auth[_0xccba('0xb')](),controller[_0xccba('0x23')]);router[_0xccba('0x13')](_0xccba('0x24'),auth[_0xccba('0x8')](),interaction[_0xccba('0x25')]('chat',_0xccba('0x26')),controller[_0xccba('0x27')]);router[_0xccba('0x28')](_0xccba('0x29'),auth[_0xccba('0x8')](),interaction[_0xccba('0x25')](_0xccba('0x2a'),'chatinteraction:update'),controller[_0xccba('0x2b')]);router['put'](_0xccba('0x2c'),controller[_0xccba('0x2d')]);router['put'](_0xccba('0x2e'),auth[_0xccba('0xb')](),controller[_0xccba('0x2f')]);router[_0xccba('0x28')]('/:id/close',controller[_0xccba('0x30')]);router[_0xccba('0x31')](_0xccba('0x29'),auth[_0xccba('0x8')](),interaction[_0xccba('0x25')](_0xccba('0x2a'),_0xccba('0x32')),controller[_0xccba('0x33')]);router[_0xccba('0x31')](_0xccba('0x24'),auth[_0xccba('0x8')](),controller[_0xccba('0x34')]);module['exports']=router;
\ No newline at end of file
index 6fa0ad1..ed545e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4857=['TEXT','medium','BOOLEAN','sequelize'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0x4857,0x147));var _0x7485=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4857[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x7485('0x0'));module['exports']={'body':{'type':Sequelize[_0x7485('0x1')](_0x7485('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7485('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x049a=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0x1c3917,_0x2703c5){var _0x30df62=function(_0x3dcac4){while(--_0x3dcac4){_0x1c3917['push'](_0x1c3917['shift']());}};_0x30df62(++_0x2703c5);}(_0x049a,0x93));var _0xa049=function(_0x761b6d,_0x7c7fa8){_0x761b6d=_0x761b6d-0x0;var _0x3a1639=_0x049a[_0x761b6d];return _0x3a1639;};'use strict';var Sequelize=require('sequelize');module[_0xa049('0x0')]={'body':{'type':Sequelize[_0xa049('0x1')](_0xa049('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa049('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa049('0x4')]}};
\ No newline at end of file
index 376667a..4911fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x569f=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','isEmpty','agent','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x569f,0xbf));var _0xf569=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x569f[_0x4996d5];return _0x4793f9;};'use strict';var emlformat=require(_0xf569('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf569('0x1'));var jsonpatch=require(_0xf569('0x2'));var rp=require(_0xf569('0x3'));var moment=require(_0xf569('0x4'));var BPromise=require(_0xf569('0x5'));var Mustache=require('mustache');var util=require(_0xf569('0x6'));var path=require(_0xf569('0x7'));var sox=require('sox');var csv=require(_0xf569('0x8'));var ejs=require(_0xf569('0x9'));var fs=require('fs');var fs_extra=require(_0xf569('0xa'));var _=require(_0xf569('0xb'));var squel=require(_0xf569('0xc'));var crypto=require(_0xf569('0xd'));var jsforce=require(_0xf569('0xe'));var deskjs=require(_0xf569('0xf'));var toCsv=require(_0xf569('0x8'));var querystring=require(_0xf569('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf569('0x11'));var as=require(_0xf569('0x12'));var hardwareService=require(_0xf569('0x13'));var logger=require(_0xf569('0x14'))(_0xf569('0x15'));var utils=require(_0xf569('0x16'));var config=require(_0xf569('0x17'));var licenseUtil=require(_0xf569('0x18'));var db=require(_0xf569('0x19'))['db'];config[_0xf569('0x1a')]=_[_0xf569('0x1b')](config[_0xf569('0x1a')],{'host':_0xf569('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf569('0x1a')]));require(_0xf569('0x1d'))[_0xf569('0x1e')](socket);function respondWithStatusCode(_0x3b0834,_0x49cba9){_0x49cba9=_0x49cba9||0xcc;return function(_0x1fa67e){if(_0x1fa67e){return _0x3b0834[_0xf569('0x1f')](_0x49cba9);}return _0x3b0834[_0xf569('0x20')](_0x49cba9)[_0xf569('0x21')]();};}function respondWithResult(_0x2cbfaf,_0x4ae9b5){_0x4ae9b5=_0x4ae9b5||0xc8;return function(_0x1b2cae){if(_0x1b2cae){return _0x2cbfaf['status'](_0x4ae9b5)[_0xf569('0x22')](_0x1b2cae);}};}function respondWithFilteredResult(_0x21994e,_0x126969){return function(_0x2327c5){if(_0x2327c5){var _0x3f420b=typeof _0x126969[_0xf569('0x23')]===_0xf569('0x24')&&typeof _0x126969[_0xf569('0x25')]===_0xf569('0x24');var _0x3523e5=_0x2327c5[_0xf569('0x26')];var _0x173505=_0x3f420b?0x0:_0x126969[_0xf569('0x23')];var _0x31caa3=_0x3f420b?_0x2327c5[_0xf569('0x26')]:_0x126969[_0xf569('0x23')]+_0x126969[_0xf569('0x25')];var _0x189ba7;if(_0x31caa3>=_0x3523e5){_0x31caa3=_0x3523e5;_0x189ba7=0xc8;}else{_0x189ba7=0xce;}_0x21994e[_0xf569('0x20')](_0x189ba7);return _0x21994e[_0xf569('0x27')](_0xf569('0x28'),_0x173505+'-'+_0x31caa3+'/'+_0x3523e5)[_0xf569('0x22')](_0x2327c5);}return null;};}function patchUpdates(_0xf396b){return function(_0x30a37a){try{jsonpatch[_0xf569('0x29')](_0x30a37a,_0xf396b,!![]);}catch(_0x3767f5){return BPromise[_0xf569('0x2a')](_0x3767f5);}return _0x30a37a['save']();};}function saveUpdates(_0x237eb7,_0x269d3b){return function(_0x50d19d){if(_0x50d19d){return _0x50d19d[_0xf569('0x2b')](_0x237eb7)[_0xf569('0x2c')](function(_0x2d7447){return _0x2d7447;});}return null;};}function removeEntity(_0x4f93e8,_0x20bc87){return function(_0x4ae0f5){if(_0x4ae0f5){return _0x4ae0f5[_0xf569('0x2d')]()[_0xf569('0x2c')](function(){_0x4f93e8[_0xf569('0x20')](0xcc)[_0xf569('0x21')]();});}};}function handleEntityNotFound(_0x32ed63,_0x57b902){return function(_0x48b49c){if(!_0x48b49c){_0x32ed63[_0xf569('0x1f')](0x194);}return _0x48b49c;};}function handleError(_0x2dc55d,_0x2d0904){_0x2d0904=_0x2d0904||0x1f4;return function(_0x14c092){logger[_0xf569('0x2e')](_0x14c092[_0xf569('0x2f')]);if(_0x14c092[_0xf569('0x30')]){delete _0x14c092[_0xf569('0x30')];}_0x2dc55d[_0xf569('0x20')](_0x2d0904)[_0xf569('0x31')](_0x14c092);};}exports['index']=function(_0x44f6ad,_0x13fe13){var _0x2cf721={},_0x532ca1={},_0x515baf={'count':0x0,'rows':[]};var _0x4814a2=_[_0xf569('0x32')](db[_0xf569('0x33')][_0xf569('0x34')],function(_0x9b0ca1){return{'name':_0x9b0ca1[_0xf569('0x35')],'type':_0x9b0ca1[_0xf569('0x36')][_0xf569('0x37')]};});_0x532ca1[_0xf569('0x38')]=_[_0xf569('0x32')](_0x4814a2,_0xf569('0x30'));_0x532ca1['query']=_[_0xf569('0x39')](_0x44f6ad[_0xf569('0x3a')]);_0x532ca1[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x532ca1['model'],_0x532ca1[_0xf569('0x3a')]);_0x2cf721[_0xf569('0x3d')]=_[_0xf569('0x3c')](_0x532ca1[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x44f6ad['query']['fields']));_0x2cf721['attributes']=_0x2cf721[_0xf569('0x3d')][_0xf569('0x3f')]?_0x2cf721['attributes']:_0x532ca1[_0xf569('0x38')];if(!_0x44f6ad[_0xf569('0x3a')][_0xf569('0x40')]('nolimit')){_0x2cf721['limit']=qs[_0xf569('0x25')](_0x44f6ad['query']['limit']);_0x2cf721['offset']=qs[_0xf569('0x23')](_0x44f6ad[_0xf569('0x3a')][_0xf569('0x23')]);}_0x2cf721[_0xf569('0x41')]=qs[_0xf569('0x42')](_0x44f6ad['query'][_0xf569('0x42')]);_0x2cf721['where']=qs[_0xf569('0x3b')](_['pick'](_0x44f6ad[_0xf569('0x3a')],_0x532ca1[_0xf569('0x3b')]),_0x4814a2);if(_0x44f6ad['query']['filter']){_0x2cf721[_0xf569('0x43')]=_[_0xf569('0x44')](_0x2cf721['where'],{'$or':_[_0xf569('0x32')](_0x4814a2,function(_0x3a877c){if(_0x3a877c['type']!==_0xf569('0x45')){var _0x5ea00a={};_0x5ea00a[_0x3a877c['name']]={'$like':'%'+_0x44f6ad[_0xf569('0x3a')][_0xf569('0x46')]+'%'};return _0x5ea00a;}})});}_0x2cf721=_[_0xf569('0x44')]({},_0x2cf721,_0x44f6ad[_0xf569('0x47')]);var _0x4a4767={'where':_0x2cf721['where']};return db[_0xf569('0x33')][_0xf569('0x26')](_0x4a4767)['then'](function(_0x192cdd){_0x515baf[_0xf569('0x26')]=_0x192cdd;if(_0x44f6ad[_0xf569('0x3a')][_0xf569('0x48')]){_0x2cf721['include']=[{'all':!![]}];}return db[_0xf569('0x33')][_0xf569('0x49')](_0x2cf721);})[_0xf569('0x2c')](function(_0x48e44f){_0x515baf[_0xf569('0x4a')]=_0x48e44f;return _0x515baf;})[_0xf569('0x2c')](respondWithFilteredResult(_0x13fe13,_0x2cf721))[_0xf569('0x4b')](handleError(_0x13fe13,null));};exports[_0xf569('0x4c')]=function(_0x517a0b,_0x4d0081){var _0x5878fc={'raw':!![],'where':{'id':_0x517a0b['params']['id']}},_0x4fada3={};_0x4fada3[_0xf569('0x38')]=_['keys'](db[_0xf569('0x33')][_0xf569('0x34')]);_0x4fada3['query']=_[_0xf569('0x39')](_0x517a0b['query']);_0x4fada3[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x4fada3['model'],_0x4fada3['query']);_0x5878fc[_0xf569('0x3d')]=_['intersection'](_0x4fada3[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x517a0b[_0xf569('0x3a')][_0xf569('0x3e')]));_0x5878fc[_0xf569('0x3d')]=_0x5878fc[_0xf569('0x3d')][_0xf569('0x3f')]?_0x5878fc['attributes']:_0x4fada3['model'];if(_0x517a0b[_0xf569('0x3a')][_0xf569('0x48')]){_0x5878fc[_0xf569('0x4d')]=[{'all':!![]}];}_0x5878fc=_[_0xf569('0x44')]({},_0x5878fc,_0x517a0b[_0xf569('0x47')]);return db[_0xf569('0x33')][_0xf569('0x4e')](_0x5878fc)[_0xf569('0x2c')](handleEntityNotFound(_0x4d0081,null))[_0xf569('0x2c')](respondWithResult(_0x4d0081,null))[_0xf569('0x4b')](handleError(_0x4d0081,null));};exports[_0xf569('0x4f')]=function(_0x4521c4,_0x17b525){return db[_0xf569('0x33')][_0xf569('0x4f')](_0x4521c4[_0xf569('0x50')],{})[_0xf569('0x2c')](respondWithResult(_0x17b525,0xc9))[_0xf569('0x4b')](handleError(_0x17b525,null));};exports['update']=function(_0x1da6d1,_0x357d79){if(_0x1da6d1[_0xf569('0x50')]['id']){delete _0x1da6d1[_0xf569('0x50')]['id'];}return db['ChatInternalMessage'][_0xf569('0x4e')]({'where':{'id':_0x1da6d1['params']['id']}})[_0xf569('0x2c')](handleEntityNotFound(_0x357d79,null))[_0xf569('0x2c')](saveUpdates(_0x1da6d1[_0xf569('0x50')],null))[_0xf569('0x2c')](respondWithResult(_0x357d79,null))['catch'](handleError(_0x357d79,null));};exports[_0xf569('0x2d')]=function(_0x50819b,_0x48956f){return db[_0xf569('0x33')][_0xf569('0x4e')]({'where':{'id':_0x50819b['params']['id']}})['then'](handleEntityNotFound(_0x48956f,null))[_0xf569('0x2c')](removeEntity(_0x48956f,null))[_0xf569('0x4b')](handleError(_0x48956f,null));};exports[_0xf569('0x51')]=function(_0x27db8e,_0x18045f){return db['ChatInternalMessage'][_0xf569('0x51')]()['then'](respondWithResult(_0x18045f,null))['catch'](handleError(_0x18045f,null));};function wrapUser(_0x13c1ca){return function(_0x4bda68){var _0x446658=_0x13c1ca[_0xf569('0x52')]({'plain':!![]});_0x446658[_0xf569('0x53')]=[];if(_0x4bda68){_0x446658[_0xf569('0x54')]=_0x4bda68[_0xf569('0x55')];_0x446658[_0xf569('0x56')]=_0x4bda68;}else{_0x446658[_0xf569('0x54')]=moment(0x0)[_0xf569('0x57')](_0xf569('0x58'));_0x446658['lastMessage']={};}return _0x446658;};}exports['getUsers']=function(_0x2401a3,_0x3c724a,_0x5085e3){var _0x2c3ec7=[];return db[_0xf569('0x59')]['findAll']({'where':{'role':['agent',_0xf569('0x5a'),'user']},'attributes':['id',_0xf569('0x5b'),'name',_0xf569('0x5c'),_0xf569('0x5d'),_0xf569('0x5e'),'online',_0xf569('0x5f'),'allowmessenger',_0xf569('0x60')],'order':qs[_0xf569('0x42')](_0xf569('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0xf569('0x62'),'attributes':['id',_0xf569('0x30'),'type'],'through':{'attributes':[]}}]})[_0xf569('0x2c')](function(_0x23f656){if(_0x23f656){var _0x25beaf=_0x2401a3[_0xf569('0x63')][_0xf569('0x52')]({'plain':!![]});if(!_0x25beaf)throw new Error(_0xf569('0x64'));if(_0x25beaf[_0xf569('0x5c')]===_0xf569('0x63')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x25beaf[_0xf569('0x65')]},'raw':!![]})[_0xf569('0x2c')](function(_0x5ca30f){if(_0x5ca30f){if(_0x5ca30f[_0xf569('0x66')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5ca30f['id']},'raw':!![]})['then'](function(_0x2a692c){var _0x48ca0a=[];if(_[_0xf569('0x67')](_0x2a692c)){_0x48ca0a=_[_0xf569('0x46')](_0x23f656,function(_0x59cd55){if(_0x59cd55[_0xf569('0x5c')]!=='agent'){return _0x59cd55;}});return _0x48ca0a;}else{for(var _0x4dd202=0x0;_0x4dd202<_0x23f656[_0xf569('0x3f')];_0x4dd202++){var _0x5c304c=_0x23f656[_0x4dd202];if(_0x5c304c['role']===_0xf569('0x68')){var _0x3745bb=_[_0xf569('0x4e')](_0x2a692c,function(_0x330d42){return _0x330d42[_0xf569('0x69')]===_0x5c304c['id'];});if(_0x3745bb)_0x48ca0a[_0xf569('0x6a')](_0x5c304c);}else{_0x48ca0a[_0xf569('0x6a')](_0x5c304c);}}return _0x48ca0a;}});}else{return _0x23f656;}}else{var _0x3bdb78=_[_0xf569('0x46')](_0x23f656,function(_0x94779e){if(_0x94779e['role']!==_0xf569('0x68')){return _0x94779e;}});return _0x3bdb78;}});}else{return _0x23f656;}}})[_0xf569('0x2c')](function(_0x3d7e93){var _0x262a82=[];if(_0x3d7e93){_0x2c3ec7=_0x3d7e93;for(var _0x4bc1a3=0x0;_0x4bc1a3<_0x3d7e93['length'];_0x4bc1a3+=0x1){_0x2c3ec7[_0x4bc1a3]['messages']=[];_0x262a82[_0xf569('0x6a')](db[_0xf569('0x33')][_0xf569('0x4e')]({'where':{'FromId':[_0x2401a3[_0xf569('0x63')]['id'],_0x3d7e93[_0x4bc1a3]['id']],'ToId':[_0x2401a3[_0xf569('0x63')]['id'],_0x3d7e93[_0x4bc1a3]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xf569('0x6b'),_0xf569('0x6c'),_0xf569('0x50')],'order':qs[_0xf569('0x42')](_0xf569('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf569('0x2c')](wrapUser(_0x3d7e93[_0x4bc1a3])));}return BPromise[_0xf569('0x6e')](_0x262a82);}return[];})[_0xf569('0x2c')](function(_0x16e3d9){return{'rows':_0x16e3d9,'count':_0x16e3d9[_0xf569('0x3f')]};})[_0xf569('0x2c')](respondWithResult(_0x3c724a,null))[_0xf569('0x4b')](handleError(_0x3c724a,null));};
\ No newline at end of file
+var _0xde75=['includeAll','find','create','body','describe','get','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','model','keys'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xde75,0x93));var _0x5de7=function(_0x39bdc0,_0x3e1543){_0x39bdc0=_0x39bdc0-0x0;var _0x4cd64c=_0xde75[_0x39bdc0];return _0x4cd64c;};'use strict';var emlformat=require(_0x5de7('0x0'));var rimraf=require(_0x5de7('0x1'));var zipdir=require(_0x5de7('0x2'));var jsonpatch=require(_0x5de7('0x3'));var rp=require(_0x5de7('0x4'));var moment=require(_0x5de7('0x5'));var BPromise=require(_0x5de7('0x6'));var Mustache=require('mustache');var util=require(_0x5de7('0x7'));var path=require('path');var sox=require(_0x5de7('0x8'));var csv=require(_0x5de7('0x9'));var ejs=require(_0x5de7('0xa'));var fs=require('fs');var fs_extra=require(_0x5de7('0xb'));var _=require('lodash');var squel=require(_0x5de7('0xc'));var crypto=require(_0x5de7('0xd'));var jsforce=require(_0x5de7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5de7('0x9'));var querystring=require(_0x5de7('0xf'));var Papa=require(_0x5de7('0x10'));var Redis=require('ioredis');var authService=require(_0x5de7('0x11'));var qs=require(_0x5de7('0x12'));var as=require(_0x5de7('0x13'));var hardwareService=require(_0x5de7('0x14'));var logger=require('../../config/logger')(_0x5de7('0x15'));var utils=require(_0x5de7('0x16'));var config=require(_0x5de7('0x17'));var licenseUtil=require(_0x5de7('0x18'));var db=require(_0x5de7('0x19'))['db'];config[_0x5de7('0x1a')]=_[_0x5de7('0x1b')](config[_0x5de7('0x1a')],{'host':_0x5de7('0x1c'),'port':0x18eb});var socket=require(_0x5de7('0x1d'))(new Redis(config[_0x5de7('0x1a')]));require(_0x5de7('0x1e'))[_0x5de7('0x1f')](socket);function respondWithStatusCode(_0xe03cbb,_0x269ca6){_0x269ca6=_0x269ca6||0xcc;return function(_0x4442d7){if(_0x4442d7){return _0xe03cbb['sendStatus'](_0x269ca6);}return _0xe03cbb[_0x5de7('0x20')](_0x269ca6)[_0x5de7('0x21')]();};}function respondWithResult(_0x1ecf40,_0x22487e){_0x22487e=_0x22487e||0xc8;return function(_0x130edb){if(_0x130edb){return _0x1ecf40[_0x5de7('0x20')](_0x22487e)[_0x5de7('0x22')](_0x130edb);}};}function respondWithFilteredResult(_0x3a7be7,_0x54a933){return function(_0x364ac5){if(_0x364ac5){var _0x201d5d=typeof _0x54a933[_0x5de7('0x23')]==='undefined'&&typeof _0x54a933['limit']===_0x5de7('0x24');var _0x41c2b5=_0x364ac5['count'];var _0x30c79e=_0x201d5d?0x0:_0x54a933[_0x5de7('0x23')];var _0x5e20b9=_0x201d5d?_0x364ac5[_0x5de7('0x25')]:_0x54a933['offset']+_0x54a933[_0x5de7('0x26')];var _0x3cac08;if(_0x5e20b9>=_0x41c2b5){_0x5e20b9=_0x41c2b5;_0x3cac08=0xc8;}else{_0x3cac08=0xce;}_0x3a7be7[_0x5de7('0x20')](_0x3cac08);return _0x3a7be7[_0x5de7('0x27')](_0x5de7('0x28'),_0x30c79e+'-'+_0x5e20b9+'/'+_0x41c2b5)[_0x5de7('0x22')](_0x364ac5);}return null;};}function patchUpdates(_0x47755f){return function(_0x10dbb0){try{jsonpatch[_0x5de7('0x29')](_0x10dbb0,_0x47755f,!![]);}catch(_0x570770){return BPromise[_0x5de7('0x2a')](_0x570770);}return _0x10dbb0['save']();};}function saveUpdates(_0x12fd79,_0x458ec6){return function(_0x2d6e6b){if(_0x2d6e6b){return _0x2d6e6b[_0x5de7('0x2b')](_0x12fd79)[_0x5de7('0x2c')](function(_0x4969d1){return _0x4969d1;});}return null;};}function removeEntity(_0x4e6e51,_0x42f1fb){return function(_0x303a00){if(_0x303a00){return _0x303a00[_0x5de7('0x2d')]()[_0x5de7('0x2c')](function(){_0x4e6e51[_0x5de7('0x20')](0xcc)[_0x5de7('0x21')]();});}};}function handleEntityNotFound(_0x2eb13f,_0x4d2296){return function(_0x551ce6){if(!_0x551ce6){_0x2eb13f[_0x5de7('0x2e')](0x194);}return _0x551ce6;};}function handleError(_0x3caa0b,_0x4af556){_0x4af556=_0x4af556||0x1f4;return function(_0x12dfba){logger[_0x5de7('0x2f')](_0x12dfba[_0x5de7('0x30')]);if(_0x12dfba[_0x5de7('0x31')]){delete _0x12dfba[_0x5de7('0x31')];}_0x3caa0b['status'](_0x4af556)[_0x5de7('0x32')](_0x12dfba);};}exports[_0x5de7('0x33')]=function(_0x4fc5b2,_0x408056){var _0x4cdcc6={},_0x2f0755={},_0x458a45={'count':0x0,'rows':[]};var _0xbea1bf=_[_0x5de7('0x34')](db[_0x5de7('0x35')][_0x5de7('0x36')],function(_0x4f9ed2){return{'name':_0x4f9ed2['fieldName'],'type':_0x4f9ed2[_0x5de7('0x37')][_0x5de7('0x38')]};});_0x2f0755['model']=_[_0x5de7('0x34')](_0xbea1bf,_0x5de7('0x31'));_0x2f0755[_0x5de7('0x39')]=_['keys'](_0x4fc5b2['query']);_0x2f0755['filters']=_[_0x5de7('0x3a')](_0x2f0755['model'],_0x2f0755['query']);_0x4cdcc6[_0x5de7('0x3b')]=_[_0x5de7('0x3a')](_0x2f0755['model'],qs['fields'](_0x4fc5b2[_0x5de7('0x39')][_0x5de7('0x3c')]));_0x4cdcc6[_0x5de7('0x3b')]=_0x4cdcc6[_0x5de7('0x3b')][_0x5de7('0x3d')]?_0x4cdcc6[_0x5de7('0x3b')]:_0x2f0755['model'];if(!_0x4fc5b2[_0x5de7('0x39')]['hasOwnProperty']('nolimit')){_0x4cdcc6[_0x5de7('0x26')]=qs[_0x5de7('0x26')](_0x4fc5b2['query'][_0x5de7('0x26')]);_0x4cdcc6['offset']=qs[_0x5de7('0x23')](_0x4fc5b2[_0x5de7('0x39')][_0x5de7('0x23')]);}_0x4cdcc6['order']=qs[_0x5de7('0x3e')](_0x4fc5b2[_0x5de7('0x39')][_0x5de7('0x3e')]);_0x4cdcc6[_0x5de7('0x3f')]=qs[_0x5de7('0x40')](_[_0x5de7('0x41')](_0x4fc5b2[_0x5de7('0x39')],_0x2f0755['filters']),_0xbea1bf);if(_0x4fc5b2[_0x5de7('0x39')][_0x5de7('0x42')]){_0x4cdcc6[_0x5de7('0x3f')]=_['merge'](_0x4cdcc6['where'],{'$or':_[_0x5de7('0x34')](_0xbea1bf,function(_0xc21981){if(_0xc21981[_0x5de7('0x37')]!==_0x5de7('0x43')){var _0x3fead8={};_0x3fead8[_0xc21981['name']]={'$like':'%'+_0x4fc5b2[_0x5de7('0x39')]['filter']+'%'};return _0x3fead8;}})});}_0x4cdcc6=_[_0x5de7('0x44')]({},_0x4cdcc6,_0x4fc5b2[_0x5de7('0x45')]);var _0x499198={'where':_0x4cdcc6['where']};return db['ChatInternalMessage'][_0x5de7('0x25')](_0x499198)[_0x5de7('0x2c')](function(_0x23264b){_0x458a45[_0x5de7('0x25')]=_0x23264b;if(_0x4fc5b2[_0x5de7('0x39')]['includeAll']){_0x4cdcc6[_0x5de7('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5de7('0x47')](_0x4cdcc6);})[_0x5de7('0x2c')](function(_0x46e798){_0x458a45['rows']=_0x46e798;return _0x458a45;})[_0x5de7('0x2c')](respondWithFilteredResult(_0x408056,_0x4cdcc6))[_0x5de7('0x48')](handleError(_0x408056,null));};exports[_0x5de7('0x49')]=function(_0x203546,_0x519760){var _0x22f5f1={'raw':!![],'where':{'id':_0x203546[_0x5de7('0x4a')]['id']}},_0x417534={};_0x417534[_0x5de7('0x4b')]=_[_0x5de7('0x4c')](db[_0x5de7('0x35')][_0x5de7('0x36')]);_0x417534[_0x5de7('0x39')]=_[_0x5de7('0x4c')](_0x203546[_0x5de7('0x39')]);_0x417534[_0x5de7('0x40')]=_[_0x5de7('0x3a')](_0x417534['model'],_0x417534[_0x5de7('0x39')]);_0x22f5f1['attributes']=_['intersection'](_0x417534['model'],qs[_0x5de7('0x3c')](_0x203546[_0x5de7('0x39')]['fields']));_0x22f5f1[_0x5de7('0x3b')]=_0x22f5f1[_0x5de7('0x3b')][_0x5de7('0x3d')]?_0x22f5f1['attributes']:_0x417534['model'];if(_0x203546[_0x5de7('0x39')][_0x5de7('0x4d')]){_0x22f5f1[_0x5de7('0x46')]=[{'all':!![]}];}_0x22f5f1=_[_0x5de7('0x44')]({},_0x22f5f1,_0x203546[_0x5de7('0x45')]);return db[_0x5de7('0x35')][_0x5de7('0x4e')](_0x22f5f1)['then'](handleEntityNotFound(_0x519760,null))['then'](respondWithResult(_0x519760,null))[_0x5de7('0x48')](handleError(_0x519760,null));};exports[_0x5de7('0x4f')]=function(_0x3bc738,_0x45cec1){return db['ChatInternalMessage']['create'](_0x3bc738[_0x5de7('0x50')],{})['then'](respondWithResult(_0x45cec1,0xc9))[_0x5de7('0x48')](handleError(_0x45cec1,null));};exports['update']=function(_0x5a970d,_0x43059d){if(_0x5a970d[_0x5de7('0x50')]['id']){delete _0x5a970d[_0x5de7('0x50')]['id'];}return db[_0x5de7('0x35')][_0x5de7('0x4e')]({'where':{'id':_0x5a970d[_0x5de7('0x4a')]['id']}})[_0x5de7('0x2c')](handleEntityNotFound(_0x43059d,null))[_0x5de7('0x2c')](saveUpdates(_0x5a970d[_0x5de7('0x50')],null))[_0x5de7('0x2c')](respondWithResult(_0x43059d,null))[_0x5de7('0x48')](handleError(_0x43059d,null));};exports['destroy']=function(_0x589760,_0x11640b){return db['ChatInternalMessage'][_0x5de7('0x4e')]({'where':{'id':_0x589760[_0x5de7('0x4a')]['id']}})[_0x5de7('0x2c')](handleEntityNotFound(_0x11640b,null))[_0x5de7('0x2c')](removeEntity(_0x11640b,null))[_0x5de7('0x48')](handleError(_0x11640b,null));};exports['describe']=function(_0x3089a6,_0x487fbe){return db[_0x5de7('0x35')][_0x5de7('0x51')]()[_0x5de7('0x2c')](respondWithResult(_0x487fbe,null))[_0x5de7('0x48')](handleError(_0x487fbe,null));};function wrapUser(_0x1d979d){return function(_0x42150c){var _0x597196=_0x1d979d[_0x5de7('0x52')]({'plain':!![]});_0x597196['messages']=[];if(_0x42150c){_0x597196['lastMessageAt']=_0x42150c[_0x5de7('0x53')];_0x597196['lastMessage']=_0x42150c;}else{_0x597196[_0x5de7('0x54')]=moment(0x0)[_0x5de7('0x55')](_0x5de7('0x56'));_0x597196['lastMessage']={};}return _0x597196;};}exports['getUsers']=function(_0x5545f9,_0x575611,_0x32b726){var _0x2cf7b4=[];return db[_0x5de7('0x57')]['findAll']({'where':{'role':['agent',_0x5de7('0x58'),_0x5de7('0x59')]},'attributes':['id',_0x5de7('0x5a'),'name',_0x5de7('0x5b'),_0x5de7('0x5c'),_0x5de7('0x5d'),_0x5de7('0x5e'),_0x5de7('0x5f'),'allowmessenger',_0x5de7('0x60')],'order':qs[_0x5de7('0x3e')](_0x5de7('0x61')),'include':[{'model':db[_0x5de7('0x62')],'as':_0x5de7('0x63'),'attributes':['id','name',_0x5de7('0x37')],'through':{'attributes':[]}}]})['then'](function(_0x2cb490){if(_0x2cb490){var _0x3bc558=_0x5545f9[_0x5de7('0x59')][_0x5de7('0x52')]({'plain':!![]});if(!_0x3bc558)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bc558['role']==='user'){return db[_0x5de7('0x64')][_0x5de7('0x4e')]({'where':{'name':_0x5de7('0x65'),'userProfileId':_0x3bc558['userProfileId']},'raw':!![]})[_0x5de7('0x2c')](function(_0x14b2a5){if(_0x14b2a5){if(_0x14b2a5[_0x5de7('0x66')]===0x0){return db[_0x5de7('0x67')][_0x5de7('0x47')]({'where':{'sectionId':_0x14b2a5['id']},'raw':!![]})[_0x5de7('0x2c')](function(_0x589d7c){var _0x258b06=[];if(_[_0x5de7('0x68')](_0x589d7c)){_0x258b06=_[_0x5de7('0x42')](_0x2cb490,function(_0x193f91){if(_0x193f91['role']!=='agent'){return _0x193f91;}});return _0x258b06;}else{for(var _0x2f6f1f=0x0;_0x2f6f1f<_0x2cb490[_0x5de7('0x3d')];_0x2f6f1f++){var _0x580fb1=_0x2cb490[_0x2f6f1f];if(_0x580fb1[_0x5de7('0x5b')]===_0x5de7('0x69')){var _0x4eda8a=_[_0x5de7('0x4e')](_0x589d7c,function(_0x32ac2e){return _0x32ac2e[_0x5de7('0x6a')]===_0x580fb1['id'];});if(_0x4eda8a)_0x258b06[_0x5de7('0x6b')](_0x580fb1);}else{_0x258b06[_0x5de7('0x6b')](_0x580fb1);}}return _0x258b06;}});}else{return _0x2cb490;}}else{var _0x3894ec=_[_0x5de7('0x42')](_0x2cb490,function(_0x5b9557){if(_0x5b9557[_0x5de7('0x5b')]!==_0x5de7('0x69')){return _0x5b9557;}});return _0x3894ec;}});}else{return _0x2cb490;}}})[_0x5de7('0x2c')](function(_0x388adf){var _0x3ee6c5=[];if(_0x388adf){_0x2cf7b4=_0x388adf;for(var _0x12fa16=0x0;_0x12fa16<_0x388adf[_0x5de7('0x3d')];_0x12fa16+=0x1){_0x2cf7b4[_0x12fa16][_0x5de7('0x6c')]=[];_0x3ee6c5[_0x5de7('0x6b')](db[_0x5de7('0x35')][_0x5de7('0x4e')]({'where':{'FromId':[_0x5545f9[_0x5de7('0x59')]['id'],_0x388adf[_0x12fa16]['id']],'ToId':[_0x5545f9[_0x5de7('0x59')]['id'],_0x388adf[_0x12fa16]['id']],'ChatGroupId':null},'attributes':['id',_0x5de7('0x53'),_0x5de7('0x6d'),'ToId','read',_0x5de7('0x50')],'order':qs[_0x5de7('0x3e')](_0x5de7('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5de7('0x2c')](wrapUser(_0x388adf[_0x12fa16])));}return BPromise[_0x5de7('0x6f')](_0x3ee6c5);}return[];})[_0x5de7('0x2c')](function(_0x1d905b){return{'rows':_0x1d905b,'count':_0x1d905b[_0x5de7('0x3d')]};})[_0x5de7('0x2c')](respondWithResult(_0x575611,null))[_0x5de7('0x48')](handleError(_0x575611,null));};
\ No newline at end of file
index 12aab64..cc0ec08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a8=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x1fa77b,_0x465720){_0x1fa77b=_0x1fa77b-0x0;var _0x938c9=_0xf3a8[_0x1fa77b];return _0x938c9;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x8f3a('0x0'))['db'][_0x8f3a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f3a('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x109638){return function(_0x48673f,_0x38fe23,_0x5a47bd){ChatInternalMessageEvents[_0x8f3a('0x3')](_0x109638+':'+_0x48673f['id'],_0x48673f);ChatInternalMessageEvents[_0x8f3a('0x3')](_0x109638,_0x48673f);_0x5a47bd(null);};}for(var e in events){if(events[_0x8f3a('0x4')](e)){var event=events[e];ChatInternalMessage[_0x8f3a('0x5')](e,emitEvent(event));}}module[_0x8f3a('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1ee4=['events','../../mysqldb','ChatInternalMessage','remove','emit','hasOwnProperty','hook'];(function(_0x1e9f1e,_0x4537e3){var _0x3165f4=function(_0x132713){while(--_0x132713){_0x1e9f1e['push'](_0x1e9f1e['shift']());}};_0x3165f4(++_0x4537e3);}(_0x1ee4,0x16c));var _0x41ee=function(_0x3567e9,_0x1f3419){_0x3567e9=_0x3567e9-0x0;var _0x45c809=_0x1ee4[_0x3567e9];return _0x45c809;};'use strict';var EventEmitter=require(_0x41ee('0x0'));var ChatInternalMessage=require(_0x41ee('0x1'))['db'][_0x41ee('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x41ee('0x3')};function emitEvent(_0x2de08f){return function(_0x2445e2,_0x37b7d8,_0x289017){ChatInternalMessageEvents[_0x41ee('0x4')](_0x2de08f+':'+_0x2445e2['id'],_0x2445e2);ChatInternalMessageEvents[_0x41ee('0x4')](_0x2de08f,_0x2445e2);_0x289017(null);};}for(var e in events){if(events[_0x41ee('0x5')](e)){var event=events[e];ChatInternalMessage[_0x41ee('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index f1ad85b..3f27400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21f0=['bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x8e5883,_0x5c143f){var _0xbbafb1=function(_0x412ed9){while(--_0x412ed9){_0x8e5883['push'](_0x8e5883['shift']());}};_0xbbafb1(++_0x5c143f);}(_0x21f0,0xca));var _0x021f=function(_0xbb7c64,_0x270b15){_0xbb7c64=_0xbb7c64-0x0;var _0x39a50e=_0x21f0[_0xbb7c64];return _0x39a50e;};'use strict';var _=require(_0x021f('0x0'));var util=require(_0x021f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x021f('0x2'));var rp=require(_0x021f('0x3'));var fs=require('fs');var path=require(_0x021f('0x4'));var rimraf=require(_0x021f('0x5'));var config=require('../../config/environment');var attributes=require(_0x021f('0x6'));module['exports']=function(_0x55a127,_0x138102){return _0x55a127[_0x021f('0x7')](_0x021f('0x8'),attributes,{'tableName':_0x021f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x021f('0xa'),'collate':_0x021f('0xb')});};
\ No newline at end of file
+var _0x8eb4=['bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1db63c,_0x40adde){var _0x3fb16f=function(_0x176a1b){while(--_0x176a1b){_0x1db63c['push'](_0x1db63c['shift']());}};_0x3fb16f(++_0x40adde);}(_0x8eb4,0x195));var _0x48eb=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x8eb4[_0x5817e6];return _0x51916a;};'use strict';var _=require('lodash');var util=require(_0x48eb('0x0'));var logger=require(_0x48eb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x48eb('0x2'));var rp=require(_0x48eb('0x3'));var fs=require('fs');var path=require(_0x48eb('0x4'));var rimraf=require(_0x48eb('0x5'));var config=require('../../config/environment');var attributes=require(_0x48eb('0x6'));module[_0x48eb('0x7')]=function(_0x36cb5d,_0x37e0ce){return _0x36cb5d['define'](_0x48eb('0x8'),attributes,{'tableName':_0x48eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x48eb('0xa')});};
\ No newline at end of file
index 1508295..65033ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc98d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x39b1bd,_0x554c9f){var _0x1dfb46=function(_0x4a15de){while(--_0x4a15de){_0x39b1bd['push'](_0x39b1bd['shift']());}};_0x1dfb46(++_0x554c9f);}(_0xc98d,0xbe));var _0xdc98=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0xc98d[_0x403cff];return _0x5a7c56;};'use strict';var _=require(_0xdc98('0x0'));var util=require(_0xdc98('0x1'));var moment=require(_0xdc98('0x2'));var BPromise=require(_0xdc98('0x3'));var rs=require(_0xdc98('0x4'));var fs=require('fs');var Redis=require(_0xdc98('0x5'));var db=require(_0xdc98('0x6'))['db'];var utils=require(_0xdc98('0x7'));var logger=require(_0xdc98('0x8'))(_0xdc98('0x9'));var config=require(_0xdc98('0xa'));var jayson=require(_0xdc98('0xb'));var client=jayson['client'][_0xdc98('0xc')]({'port':0x232a});config[_0xdc98('0xd')]=_['defaults'](config[_0xdc98('0xd')],{'host':_0xdc98('0xe'),'port':0x18eb});var socket=require(_0xdc98('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xdc98('0x10')](socket);function respondWithRpcPromise(_0x2738a6,_0x4ccf28,_0xd4ca2b){return new BPromise(function(_0x5d1af4,_0x337d36){return client[_0xdc98('0x11')](_0x2738a6,_0xd4ca2b)[_0xdc98('0x12')](function(_0x20b6db){logger[_0xdc98('0x13')](_0xdc98('0x14'),_0x4ccf28,'request\x20sent');logger[_0xdc98('0x15')](_0xdc98('0x16'),_0x4ccf28,'request\x20sent',JSON['stringify'](_0x20b6db));if(_0x20b6db['error']){if(_0x20b6db[_0xdc98('0x17')][_0xdc98('0x18')]===0x1f4){logger[_0xdc98('0x17')](_0xdc98('0x14'),_0x4ccf28,_0x20b6db[_0xdc98('0x17')]['message']);return _0x337d36(_0x20b6db['error']['message']);}logger['error'](_0xdc98('0x14'),_0x4ccf28,_0x20b6db[_0xdc98('0x17')][_0xdc98('0x19')]);return _0x5d1af4(_0x20b6db[_0xdc98('0x17')][_0xdc98('0x19')]);}else{logger['info'](_0xdc98('0x14'),_0x4ccf28,'request\x20sent');_0x5d1af4(_0x20b6db[_0xdc98('0x1a')][_0xdc98('0x19')]);}})[_0xdc98('0x1b')](function(_0x4e309f){logger[_0xdc98('0x17')](_0xdc98('0x14'),_0x4ccf28,_0x4e309f);_0x337d36(_0x4e309f);});});}
\ No newline at end of file
+var _0xdd50=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xdd50,0x172));var _0x0dd5=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0xdd50[_0x5266e7];return _0x5470f1;};'use strict';var _=require('lodash');var util=require(_0x0dd5('0x0'));var moment=require(_0x0dd5('0x1'));var BPromise=require(_0x0dd5('0x2'));var rs=require(_0x0dd5('0x3'));var fs=require('fs');var Redis=require(_0x0dd5('0x4'));var db=require(_0x0dd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0dd5('0x6'));var client=jayson[_0x0dd5('0x7')][_0x0dd5('0x8')]({'port':0x232a});config[_0x0dd5('0x9')]=_[_0x0dd5('0xa')](config['redis'],{'host':_0x0dd5('0xb'),'port':0x18eb});var socket=require(_0x0dd5('0xc'))(new Redis(config[_0x0dd5('0x9')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a07db,_0x22419f,_0x20b37b){return new BPromise(function(_0x53c590,_0x574b2e){return client[_0x0dd5('0xd')](_0x2a07db,_0x20b37b)[_0x0dd5('0xe')](function(_0x51b19a){logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,_0x0dd5('0x11'));logger[_0x0dd5('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x22419f,_0x0dd5('0x11'),JSON['stringify'](_0x51b19a));if(_0x51b19a[_0x0dd5('0x13')]){if(_0x51b19a['error'][_0x0dd5('0x14')]===0x1f4){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x574b2e(_0x51b19a[_0x0dd5('0x13')]['message']);}logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x53c590(_0x51b19a['error'][_0x0dd5('0x15')]);}else{logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,'request\x20sent');_0x53c590(_0x51b19a[_0x0dd5('0x16')][_0x0dd5('0x15')]);}})[_0x0dd5('0x17')](function(_0x2cba7e){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x2cba7e);_0x574b2e(_0x2cba7e);});});}
\ No newline at end of file
index 0e708d4..8b04587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a2=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x15403c,_0x14fbef){var _0x32b3c3=function(_0x1bcda6){while(--_0x1bcda6){_0x15403c['push'](_0x15403c['shift']());}};_0x32b3c3(++_0x14fbef);}(_0xc7a2,0x16b));var _0x2c7a=function(_0x58a975,_0x4f7451){_0x58a975=_0x58a975-0x0;var _0x47f055=_0xc7a2[_0x58a975];return _0x47f055;};'use strict';var ChatInternalMessageEvents=require(_0x2c7a('0x0'));var events=[_0x2c7a('0x1'),_0x2c7a('0x2'),'update'];function createListener(_0xb05f2c,_0x323f89){return function(_0x325592){_0x323f89[_0x2c7a('0x3')](_0xb05f2c,_0x325592);};}function removeListener(_0x494136,_0x3ada39){return function(){ChatInternalMessageEvents[_0x2c7a('0x4')](_0x494136,_0x3ada39);};}exports[_0x2c7a('0x5')]=function(_0x2e31d1){for(var _0x2a089a=0x0,_0xe5e898=events[_0x2c7a('0x6')];_0x2a089a<_0xe5e898;_0x2a089a++){var _0x17ceff=events[_0x2a089a];var _0xde56af=createListener(_0x2c7a('0x7')+_0x17ceff,_0x2e31d1);ChatInternalMessageEvents['on'](_0x17ceff,_0xde56af);}};
\ No newline at end of file
+var _0xf7f6=['chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf7f6,0x86));var _0x6f7f=function(_0x5ef2a9,_0x13ce98){_0x5ef2a9=_0x5ef2a9-0x0;var _0x2801b6=_0xf7f6[_0x5ef2a9];return _0x2801b6;};'use strict';var ChatInternalMessageEvents=require(_0x6f7f('0x0'));var events=['save',_0x6f7f('0x1'),_0x6f7f('0x2')];function createListener(_0x27b9d9,_0xb52e4b){return function(_0x50da59){_0xb52e4b[_0x6f7f('0x3')](_0x27b9d9,_0x50da59);};}function removeListener(_0x961545,_0x57e89a){return function(){ChatInternalMessageEvents['removeListener'](_0x961545,_0x57e89a);};}exports[_0x6f7f('0x4')]=function(_0x4eff4c){for(var _0x4a2d12=0x0,_0x134753=events[_0x6f7f('0x5')];_0x4a2d12<_0x134753;_0x4a2d12++){var _0x1469d1=events[_0x4a2d12];var _0x4024b6=createListener(_0x6f7f('0x6')+_0x1469d1,_0x4eff4c);ChatInternalMessageEvents['on'](_0x1469d1,_0x4024b6);}};
\ No newline at end of file
index 6b5d042..2499fcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaa2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post'];(function(_0x45397a,_0x26f199){var _0x472bd9=function(_0x23c1d6){while(--_0x23c1d6){_0x45397a['push'](_0x45397a['shift']());}};_0x472bd9(++_0x26f199);}(_0xdaa2,0x1a8));var _0x2daa=function(_0x5c1f26,_0x5a1644){_0x5c1f26=_0x5c1f26-0x0;var _0x2c1142=_0xdaa2[_0x5c1f26];return _0x2c1142;};'use strict';var multer=require(_0x2daa('0x0'));var util=require(_0x2daa('0x1'));var path=require(_0x2daa('0x2'));var timeout=require(_0x2daa('0x3'));var express=require(_0x2daa('0x4'));var router=express[_0x2daa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2daa('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x2daa('0x7')]('/',auth[_0x2daa('0x8')](),controller[_0x2daa('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2daa('0xa')]);router[_0x2daa('0x7')](_0x2daa('0xb'),auth[_0x2daa('0x8')](),controller[_0x2daa('0xc')]);router[_0x2daa('0x7')](_0x2daa('0xd'),auth[_0x2daa('0x8')](),controller[_0x2daa('0xe')]);router[_0x2daa('0xf')]('/',auth['isAuthenticated'](),controller[_0x2daa('0x10')]);router[_0x2daa('0x11')](_0x2daa('0xd'),controller[_0x2daa('0x12')]);router[_0x2daa('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2daa('0x14')]);module[_0x2daa('0x15')]=router;
\ No newline at end of file
+var _0x05d1=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','create','update'];(function(_0x590e93,_0x5625ff){var _0x4e8512=function(_0xeef17){while(--_0xeef17){_0x590e93['push'](_0x590e93['shift']());}};_0x4e8512(++_0x5625ff);}(_0x05d1,0x152));var _0x105d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x05d1[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x105d('0x0'));var path=require(_0x105d('0x1'));var timeout=require(_0x105d('0x2'));var express=require(_0x105d('0x3'));var router=express[_0x105d('0x4')]();var fs_extra=require(_0x105d('0x5'));var auth=require(_0x105d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x105d('0x7'));var controller=require(_0x105d('0x8'));router[_0x105d('0x9')]('/',auth[_0x105d('0xa')](),controller[_0x105d('0xb')]);router[_0x105d('0x9')](_0x105d('0xc'),auth[_0x105d('0xa')](),controller[_0x105d('0xd')]);router['get'](_0x105d('0xe'),auth[_0x105d('0xa')](),controller[_0x105d('0xf')]);router[_0x105d('0x9')](_0x105d('0x10'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x105d('0xa')](),controller[_0x105d('0x11')]);router['put'](_0x105d('0x10'),controller[_0x105d('0x12')]);router[_0x105d('0x13')](_0x105d('0x10'),auth[_0x105d('0xa')](),controller['destroy']);module[_0x105d('0x14')]=router;
\ No newline at end of file
index f2d519d..db4de0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20df=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x20df,0x7c));var _0xf20d=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x20df[_0x3d27a];return _0x314fd7;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'body':{'type':Sequelize[_0xf20d('0x2')](_0xf20d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf20d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf20d('0x5')]('in',_0xf20d('0x6')),'defaultValue':_0xf20d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf20d('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf20d('0x2')]}};
\ No newline at end of file
+var _0xfcbb=['ENUM','out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x5daa80,_0x17ed8e){var _0x12b2c9=function(_0x1ba192){while(--_0x1ba192){_0x5daa80['push'](_0x5daa80['shift']());}};_0x12b2c9(++_0x17ed8e);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5e5efd,_0x1ea9ae){_0x5e5efd=_0x5e5efd-0x0;var _0x5d0b26=_0xfcbb[_0x5e5efd];return _0x5d0b26;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'body':{'type':Sequelize[_0xbfcb('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfcb('0x4')]('in',_0xbfcb('0x5')),'defaultValue':_0xbfcb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfcb('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 8acc858..f13295b 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(_0x585c73,_0x3b603f){var _0x265a4e=function(_0x2ad280){while(--_0x2ad280){_0x585c73['push'](_0x585c73['shift']());}};_0x265a4e(++_0x3b603f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x997a12,_0x45fd05){var _0xd9c153=function(_0x262c98){while(--_0x262c98){_0x997a12['push'](_0x997a12['shift']());}};_0xd9c153(++_0x45fd05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 c725ed1..4c3eb6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x474f=['remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x474f,0xc2));var _0xf474=function(_0x334ebb,_0x453640){_0x334ebb=_0x334ebb-0x0;var _0x179d85=_0x474f[_0x334ebb];return _0x179d85;};'use strict';var EventEmitter=require(_0xf474('0x0'));var ChatMessage=require(_0xf474('0x1'))['db'][_0xf474('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf474('0x3')](0x0);var events={'afterCreate':_0xf474('0x4'),'afterUpdate':_0xf474('0x5'),'afterDestroy':_0xf474('0x6')};function emitEvent(_0x1ff682){return function(_0x1859bd,_0x457494,_0x50d73e){ChatMessageEvents[_0xf474('0x7')](_0x1ff682+':'+_0x1859bd['id'],_0x1859bd);ChatMessageEvents[_0xf474('0x7')](_0x1ff682,_0x1859bd);_0x50d73e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf474('0x8')](e,emitEvent(event));}}module[_0xf474('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe6ef=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','update'];(function(_0x1a9f1d,_0x4c3aa4){var _0xe30f4f=function(_0x57d0bf){while(--_0x57d0bf){_0x1a9f1d['push'](_0x1a9f1d['shift']());}};_0xe30f4f(++_0x4c3aa4);}(_0xe6ef,0xa4));var _0xfe6e=function(_0x212f00,_0x320624){_0x212f00=_0x212f00-0x0;var _0x50a826=_0xe6ef[_0x212f00];return _0x50a826;};'use strict';var EventEmitter=require(_0xfe6e('0x0'));var ChatMessage=require(_0xfe6e('0x1'))['db'][_0xfe6e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe6e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50ae8a){return function(_0x1884b1,_0x28a1ec,_0xb15f93){ChatMessageEvents[_0xfe6e('0x4')](_0x50ae8a+':'+_0x1884b1['id'],_0x1884b1);ChatMessageEvents[_0xfe6e('0x4')](_0x50ae8a,_0x1884b1);_0xb15f93(null);};}for(var e in events){if(events[_0xfe6e('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xfe6e('0x6')]=ChatMessageEvents;
\ No newline at end of file
index ef22ae1..78620fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11db=['util','../../config/logger','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x11db,0x195));var _0xb11d=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x11db[_0x2442b9];return _0x31b571;};'use strict';var _=require(_0xb11d('0x0'));var util=require(_0xb11d('0x1'));var logger=require(_0xb11d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb11d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb11d('0x4'));var config=require(_0xb11d('0x5'));var attributes=require(_0xb11d('0x6'));module[_0xb11d('0x7')]=function(_0x59994b,_0x112a4a){return _0x59994b[_0xb11d('0x8')](_0xb11d('0x9'),attributes,{'tableName':_0xb11d('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xb11d('0xb')],'type':_0xb11d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f7516,_0x173aba,_0x2c92b2){var _0x43ee8a=_0x59994b[_0xb11d('0xd')];var _0x2f75fa=_0x2f7516[_0xb11d('0xe')]({'plain':!![]});if(_0x2f75fa['direction'][_0xb11d('0xf')]()==='in'||_0x2f75fa[_0xb11d('0x10')][_0xb11d('0xf')]()===_0xb11d('0x11')&&!_0x2f75fa[_0xb11d('0x12')]&&!_[_0xb11d('0x13')](_0x2f75fa['UserId'])){_0x43ee8a[_0xb11d('0x14')][_0xb11d('0x15')]({'where':{'id':_0x2f75fa[_0xb11d('0x16')]}})[_0xb11d('0x17')](function(_0x2b153c){if(_0x2b153c){_0x2b153c[_0xb11d('0x18')]({'lastMsgAt':_0x2f75fa[_0xb11d('0x19')],'lastMsgDirection':_0x2f75fa[_0xb11d('0x10')][_0xb11d('0xf')]()});}})[_0xb11d('0x1a')](function(_0x5c89a4){console['error'](_0x5c89a4);});}_0x2c92b2();}},'charset':_0xb11d('0x1b'),'collate':_0xb11d('0x1c')});};
\ No newline at end of file
+var _0x7475=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x7475,0xca));var _0x5747=function(_0x5ba75c,_0x46b2d4){_0x5ba75c=_0x5ba75c-0x0;var _0x279d68=_0x7475[_0x5ba75c];return _0x279d68;};'use strict';var _=require(_0x5747('0x0'));var util=require(_0x5747('0x1'));var logger=require(_0x5747('0x2'))('api');var moment=require(_0x5747('0x3'));var BPromise=require(_0x5747('0x4'));var rp=require(_0x5747('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5747('0x6'));var config=require(_0x5747('0x7'));var attributes=require(_0x5747('0x8'));module[_0x5747('0x9')]=function(_0x2e33d9,_0x52f36a){return _0x2e33d9[_0x5747('0xa')](_0x5747('0xb'),attributes,{'tableName':_0x5747('0xc'),'paranoid':![],'indexes':[{'name':_0x5747('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x194080,_0x5912bf,_0x586c04){var _0x4be107=_0x2e33d9[_0x5747('0xe')];var _0x2d4bc1=_0x194080[_0x5747('0xf')]({'plain':!![]});if(_0x2d4bc1[_0x5747('0x10')][_0x5747('0x11')]()==='in'||_0x2d4bc1['direction'][_0x5747('0x11')]()==='out'&&!_0x2d4bc1[_0x5747('0x12')]&&!_[_0x5747('0x13')](_0x2d4bc1[_0x5747('0x14')])){_0x4be107[_0x5747('0x15')][_0x5747('0x16')]({'where':{'id':_0x2d4bc1['ChatInteractionId']}})[_0x5747('0x17')](function(_0x596c7b){if(_0x596c7b){_0x596c7b['update']({'lastMsgAt':_0x2d4bc1['createdAt'],'lastMsgDirection':_0x2d4bc1[_0x5747('0x10')][_0x5747('0x11')]()});}})['catch'](function(_0x4f341d){console['error'](_0x4f341d);});}_0x586c04();}},'charset':_0x5747('0x18'),'collate':_0x5747('0x19')});};
\ No newline at end of file
index acea06b..593f5c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f38=['raw','debug','stringify','lodash','util','moment','../../mysqldb','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','options'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x1f38,0x116));var _0x81f3=function(_0x268111,_0x31c1f9){_0x268111=_0x268111-0x0;var _0x54e72a=_0x1f38[_0x268111];return _0x54e72a;};'use strict';var _=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var moment=require(_0x81f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81f3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x81f3('0x4'));var client=jayson[_0x81f3('0x5')][_0x81f3('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x81f3('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x81f3('0x8'))(new Redis(config['redis']));require(_0x81f3('0x9'))[_0x81f3('0xa')](socket);function respondWithRpcPromise(_0x16741c,_0x27e2ad,_0xeedac6){return new BPromise(function(_0x41b178,_0x3dc250){return client['request'](_0x16741c,_0xeedac6)[_0x81f3('0xb')](function(_0x3e4cd9){logger[_0x81f3('0xc')](_0x81f3('0xd'),_0x27e2ad,_0x81f3('0xe'));logger['debug'](_0x81f3('0xf'),_0x27e2ad,_0x81f3('0xe'),JSON['stringify'](_0x3e4cd9));if(_0x3e4cd9['error']){if(_0x3e4cd9[_0x81f3('0x10')]['code']===0x1f4){logger[_0x81f3('0x10')](_0x81f3('0xd'),_0x27e2ad,_0x3e4cd9['error']['message']);return _0x3dc250(_0x3e4cd9['error']['message']);}logger['error'](_0x81f3('0xd'),_0x27e2ad,_0x3e4cd9[_0x81f3('0x10')][_0x81f3('0x11')]);return _0x41b178(_0x3e4cd9[_0x81f3('0x10')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x27e2ad,_0x81f3('0xe'));_0x41b178(_0x3e4cd9[_0x81f3('0x12')][_0x81f3('0x11')]);}})[_0x81f3('0x13')](function(_0x186c3d){logger['error'](_0x81f3('0xd'),_0x27e2ad,_0x186c3d);_0x3dc250(_0x186c3d);});});}exports[_0x81f3('0x14')]=function(_0x4861bf){var _0x57d5ee=this;return new Promise(function(_0x32972d,_0x3eb734){return db['ChatMessage']['create'](_0x4861bf['body'],{'raw':_0x4861bf['options']?_0x4861bf[_0x81f3('0x15')][_0x81f3('0x16')]===undefined?!![]:![]:!![]})[_0x81f3('0xb')](function(_0x5ca1cc){logger[_0x81f3('0xc')](_0x81f3('0x14'),_0x4861bf);logger[_0x81f3('0x17')](_0x81f3('0x14'),_0x4861bf,JSON[_0x81f3('0x18')](_0x5ca1cc));_0x32972d(_0x5ca1cc);})[_0x81f3('0x13')](function(_0x470ca1){logger[_0x81f3('0x10')](_0x81f3('0x14'),_0x470ca1[_0x81f3('0x11')],_0x4861bf);_0x3eb734(_0x57d5ee['error'](0x1f4,_0x470ca1[_0x81f3('0x11')]));});});};
\ No newline at end of file
+var _0x8837=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','then','CreateChatMessage','lodash','moment'];(function(_0x450144,_0xea17ea){var _0x376c8e=function(_0x153596){while(--_0x153596){_0x450144['push'](_0x450144['shift']());}};_0x376c8e(++_0xea17ea);}(_0x8837,0x184));var _0x7883=function(_0x851a02,_0x4239a8){_0x851a02=_0x851a02-0x0;var _0x47e6f5=_0x8837[_0x851a02];return _0x47e6f5;};'use strict';var _=require(_0x7883('0x0'));var util=require('util');var moment=require(_0x7883('0x1'));var BPromise=require(_0x7883('0x2'));var rs=require(_0x7883('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7883('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7883('0x5'))(_0x7883('0x6'));var config=require(_0x7883('0x7'));var jayson=require(_0x7883('0x8'));var client=jayson[_0x7883('0x9')]['http']({'port':0x232a});config[_0x7883('0xa')]=_['defaults'](config[_0x7883('0xa')],{'host':_0x7883('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7883('0xa')]));require(_0x7883('0xc'))[_0x7883('0xd')](socket);function respondWithRpcPromise(_0x2c5add,_0xac7a3c,_0x5b1dff){return new BPromise(function(_0x456b41,_0x34be6d){return client[_0x7883('0xe')](_0x2c5add,_0x5b1dff)['then'](function(_0x59b2be){logger[_0x7883('0xf')](_0x7883('0x10'),_0xac7a3c,_0x7883('0x11'));logger[_0x7883('0x12')](_0x7883('0x13'),_0xac7a3c,_0x7883('0x11'),JSON[_0x7883('0x14')](_0x59b2be));if(_0x59b2be[_0x7883('0x15')]){if(_0x59b2be[_0x7883('0x15')][_0x7883('0x16')]===0x1f4){logger[_0x7883('0x15')](_0x7883('0x10'),_0xac7a3c,_0x59b2be[_0x7883('0x15')][_0x7883('0x17')]);return _0x34be6d(_0x59b2be['error']['message']);}logger[_0x7883('0x15')]('ChatMessage,\x20%s,\x20%s',_0xac7a3c,_0x59b2be[_0x7883('0x15')][_0x7883('0x17')]);return _0x456b41(_0x59b2be[_0x7883('0x15')][_0x7883('0x17')]);}else{logger[_0x7883('0xf')](_0x7883('0x10'),_0xac7a3c,_0x7883('0x11'));_0x456b41(_0x59b2be[_0x7883('0x18')][_0x7883('0x17')]);}})[_0x7883('0x19')](function(_0x3453b3){logger[_0x7883('0x15')]('ChatMessage,\x20%s,\x20%s',_0xac7a3c,_0x3453b3);_0x34be6d(_0x3453b3);});});}exports['CreateChatMessage']=function(_0x17a4fe){var _0x3058f5=this;return new Promise(function(_0x2c17e6,_0x168880){return db['ChatMessage']['create'](_0x17a4fe['body'],{'raw':_0x17a4fe['options']?_0x17a4fe[_0x7883('0x1a')][_0x7883('0x1b')]===undefined?!![]:![]:!![]})[_0x7883('0x1c')](function(_0x196183){logger['info'](_0x7883('0x1d'),_0x17a4fe);logger[_0x7883('0x12')](_0x7883('0x1d'),_0x17a4fe,JSON[_0x7883('0x14')](_0x196183));_0x2c17e6(_0x196183);})[_0x7883('0x19')](function(_0x59440f){logger[_0x7883('0x15')](_0x7883('0x1d'),_0x59440f['message'],_0x17a4fe);_0x168880(_0x3058f5[_0x7883('0x15')](0x1f4,_0x59440f['message']));});});};
\ No newline at end of file
index b01b133..34a76be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c6c=['update','emit','register','./chatMessage.events','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x46d27d,_0x77b558){_0x46d27d=_0x46d27d-0x0;var _0x37c207=_0x3c6c[_0x46d27d];return _0x37c207;};'use strict';var ChatMessageEvents=require(_0xc3c6('0x0'));var events=['save',_0xc3c6('0x1'),_0xc3c6('0x2')];function createListener(_0x274dda,_0x3d2b3f){return function(_0x16a464){_0x3d2b3f[_0xc3c6('0x3')](_0x274dda,_0x16a464);};}function removeListener(_0x65a78,_0x34db2e){return function(){ChatMessageEvents['removeListener'](_0x65a78,_0x34db2e);};}exports[_0xc3c6('0x4')]=function(_0x4a2ca1){for(var _0xe7731e=0x0,_0x4d7ae6=events['length'];_0xe7731e<_0x4d7ae6;_0xe7731e++){var _0x4aed87=events[_0xe7731e];var _0x5185c3=createListener('chatMessage:'+_0x4aed87,_0x4a2ca1);ChatMessageEvents['on'](_0x4aed87,_0x5185c3);}};
\ No newline at end of file
+var _0x2eb2=['chatMessage:','save','remove','update','register','length'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x2eb2,0x19f));var _0x22eb=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x2eb2[_0x45e98e];return _0x374dba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x22eb('0x0'),_0x22eb('0x1'),_0x22eb('0x2')];function createListener(_0x1a002b,_0x1dd079){return function(_0xaf32cf){_0x1dd079['emit'](_0x1a002b,_0xaf32cf);};}function removeListener(_0x27732f,_0x4efe67){return function(){ChatMessageEvents['removeListener'](_0x27732f,_0x4efe67);};}exports[_0x22eb('0x3')]=function(_0x10e116){for(var _0x35dd5b=0x0,_0x2a9850=events[_0x22eb('0x4')];_0x35dd5b<_0x2a9850;_0x35dd5b++){var _0x396806=events[_0x35dd5b];var _0x33ddef=createListener(_0x22eb('0x5')+_0x396806,_0x10e116);ChatMessageEvents['on'](_0x396806,_0x33ddef);}};
\ No newline at end of file
index 7fe01d0..9afffbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb81c=['accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xb81c,0x66));var _0xcb81=function(_0x350a62,_0x2bcb2c){_0x350a62=_0x350a62-0x0;var _0x3adea7=_0xb81c[_0x350a62];return _0x3adea7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb81('0x0'));var timeout=require(_0xcb81('0x1'));var express=require(_0xcb81('0x2'));var router=express[_0xcb81('0x3')]();var fs_extra=require(_0xcb81('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb81('0x5'));var controller=require(_0xcb81('0x6'));router[_0xcb81('0x7')]('/',auth[_0xcb81('0x8')](),controller['index']);router[_0xcb81('0x7')](_0xcb81('0x9'),auth[_0xcb81('0x8')](),controller['describe']);router[_0xcb81('0x7')](_0xcb81('0xa'),auth[_0xcb81('0x8')](),controller[_0xcb81('0xb')]);router[_0xcb81('0xc')]('/',auth['isAuthenticated'](),interaction[_0xcb81('0xd')]('chat',_0xcb81('0xe')),controller[_0xcb81('0xf')]);router[_0xcb81('0x10')](_0xcb81('0xa'),controller['update']);router[_0xcb81('0x10')](_0xcb81('0x11'),auth['isAuthenticated'](),controller[_0xcb81('0x12')]);router[_0xcb81('0x10')](_0xcb81('0x13'),auth[_0xcb81('0x8')](),controller[_0xcb81('0x14')]);router[_0xcb81('0x15')](_0xcb81('0xa'),auth[_0xcb81('0x8')](),controller[_0xcb81('0x16')]);module[_0xcb81('0x17')]=router;
\ No newline at end of file
+var _0x9e19=['isAuthenticated','show','post','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','/:id','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe'];(function(_0x4e276b,_0xb11e99){var _0x2cb8b8=function(_0x1c2a57){while(--_0x1c2a57){_0x4e276b['push'](_0x4e276b['shift']());}};_0x2cb8b8(++_0xb11e99);}(_0x9e19,0x1be));var _0x99e1=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x9e19[_0x4a96ca];return _0x2aed48;};'use strict';var multer=require('multer');var util=require(_0x99e1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x99e1('0x1'));var router=express[_0x99e1('0x2')]();var fs_extra=require(_0x99e1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x99e1('0x4'));var config=require(_0x99e1('0x5'));var controller=require(_0x99e1('0x6'));router[_0x99e1('0x7')]('/',auth['isAuthenticated'](),controller[_0x99e1('0x8')]);router[_0x99e1('0x7')](_0x99e1('0x9'),auth[_0x99e1('0xa')](),controller['describe']);router[_0x99e1('0x7')]('/:id',auth[_0x99e1('0xa')](),controller[_0x99e1('0xb')]);router[_0x99e1('0xc')]('/',auth[_0x99e1('0xa')](),interaction[_0x99e1('0xd')]('chat','chatmessage:create'),controller[_0x99e1('0xe')]);router[_0x99e1('0xf')]('/:id',controller[_0x99e1('0x10')]);router[_0x99e1('0xf')](_0x99e1('0x11'),auth[_0x99e1('0xa')](),controller[_0x99e1('0x12')]);router['put'](_0x99e1('0x13'),auth[_0x99e1('0xa')](),controller[_0x99e1('0x14')]);router['delete'](_0x99e1('0x15'),auth[_0x99e1('0xa')](),controller[_0x99e1('0x16')]);module[_0x99e1('0x17')]=router;
\ No newline at end of file
index 48b7aa7..8695915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbed3=['exports','medium','sequelize'];(function(_0x343f64,_0x3fdee9){var _0x5c3636=function(_0x15608a){while(--_0x15608a){_0x343f64['push'](_0x343f64['shift']());}};_0x5c3636(++_0x3fdee9);}(_0xbed3,0xad));var _0x3bed=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbed3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x3bed('0x0'));module[_0x3bed('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3bed('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x7b9a=['TEXT','medium','sequelize','exports'];(function(_0x26da12,_0x1da015){var _0x4e57cb=function(_0x1ea577){while(--_0x1ea577){_0x26da12['push'](_0x26da12['shift']());}};_0x4e57cb(++_0x1da015);}(_0x7b9a,0xfe));var _0xa7b9=function(_0x3db128,_0x17464a){_0x3db128=_0x3db128-0x0;var _0x1931b8=_0x7b9a[_0x3db128];return _0x1931b8;};'use strict';var Sequelize=require(_0xa7b9('0x0'));module[_0xa7b9('0x1')]={'body':{'type':Sequelize[_0xa7b9('0x2')](_0xa7b9('0x3')),'allowNull':![]}};
\ No newline at end of file
index a366d74..93e22cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x24bfd7,_0x119e6b){var _0x493b2d=function(_0x3dad43){while(--_0x3dad43){_0x24bfd7['push'](_0x24bfd7['shift']());}};_0x493b2d(++_0x119e6b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7a54,0x106));var _0x47a5=function(_0x58a753,_0x2bad3d){_0x58a753=_0x58a753-0x0;var _0x2095b9=_0x7a54[_0x58a753];return _0x2095b9;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
index e539758..f9f3ae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08e2=['chat_offline_messages','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x4ba587,_0x5e2b03){var _0x26cbd9=function(_0x545f19){while(--_0x545f19){_0x4ba587['push'](_0x4ba587['shift']());}};_0x26cbd9(++_0x5e2b03);}(_0x08e2,0x116));var _0x208e=function(_0x1a2986,_0xb65712){_0x1a2986=_0x1a2986-0x0;var _0x223007=_0x08e2[_0x1a2986];return _0x223007;};'use strict';var _=require('lodash');var util=require(_0x208e('0x0'));var logger=require(_0x208e('0x1'))('api');var moment=require(_0x208e('0x2'));var BPromise=require(_0x208e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x208e('0x4'));var rimraf=require(_0x208e('0x5'));var config=require('../../config/environment');var attributes=require(_0x208e('0x6'));module[_0x208e('0x7')]=function(_0x169a6a,_0x5c85b5){return _0x169a6a[_0x208e('0x8')](_0x208e('0x9'),attributes,{'tableName':_0x208e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x208e('0xb')});};
\ No newline at end of file
+var _0x5605=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5318eb,_0x38a54b){var _0x524faa=function(_0x3fb3f6){while(--_0x3fb3f6){_0x5318eb['push'](_0x5318eb['shift']());}};_0x524faa(++_0x38a54b);}(_0x5605,0x1c8));var _0x5560=function(_0x320e1f,_0x1ada5e){_0x320e1f=_0x320e1f-0x0;var _0x1c7ae2=_0x5605[_0x320e1f];return _0x1c7ae2;};'use strict';var _=require(_0x5560('0x0'));var util=require(_0x5560('0x1'));var logger=require(_0x5560('0x2'))(_0x5560('0x3'));var moment=require(_0x5560('0x4'));var BPromise=require(_0x5560('0x5'));var rp=require(_0x5560('0x6'));var fs=require('fs');var path=require(_0x5560('0x7'));var rimraf=require(_0x5560('0x8'));var config=require(_0x5560('0x9'));var attributes=require(_0x5560('0xa'));module[_0x5560('0xb')]=function(_0x28ed74,_0x145c5a){return _0x28ed74[_0x5560('0xc')](_0x5560('0xd'),attributes,{'tableName':_0x5560('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5560('0xf'),'collate':_0x5560('0x10')});};
\ No newline at end of file
index 72e17c7..9fa23c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f8=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x47a03a,_0x1367f9){var _0x4aa157=function(_0x17d0cb){while(--_0x17d0cb){_0x47a03a['push'](_0x47a03a['shift']());}};_0x4aa157(++_0x1367f9);}(_0x49f8,0x105));var _0x849f=function(_0x36ae11,_0x4c334e){_0x36ae11=_0x36ae11-0x0;var _0x470b3d=_0x49f8[_0x36ae11];return _0x470b3d;};'use strict';var _=require(_0x849f('0x0'));var util=require(_0x849f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x849f('0x2'));var fs=require('fs');var Redis=require(_0x849f('0x3'));var db=require(_0x849f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x849f('0x5'));var jayson=require(_0x849f('0x6'));var client=jayson[_0x849f('0x7')][_0x849f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23bb68,_0x5ea5f3,_0x4e73a4){return new BPromise(function(_0x4288de,_0x3796c1){return client[_0x849f('0x9')](_0x23bb68,_0x4e73a4)['then'](function(_0x39edb4){logger[_0x849f('0xa')](_0x849f('0xb'),_0x5ea5f3,'request\x20sent');logger['debug'](_0x849f('0xc'),_0x5ea5f3,_0x849f('0xd'),JSON[_0x849f('0xe')](_0x39edb4));if(_0x39edb4[_0x849f('0xf')]){if(_0x39edb4[_0x849f('0xf')][_0x849f('0x10')]===0x1f4){logger['error'](_0x849f('0xb'),_0x5ea5f3,_0x39edb4['error']['message']);return _0x3796c1(_0x39edb4[_0x849f('0xf')][_0x849f('0x11')]);}logger[_0x849f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ea5f3,_0x39edb4[_0x849f('0xf')][_0x849f('0x11')]);return _0x4288de(_0x39edb4[_0x849f('0xf')][_0x849f('0x11')]);}else{logger[_0x849f('0xa')](_0x849f('0xb'),_0x5ea5f3,_0x849f('0xd'));_0x4288de(_0x39edb4[_0x849f('0x12')][_0x849f('0x11')]);}})[_0x849f('0x13')](function(_0x51ea1b){logger[_0x849f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ea5f3,_0x51ea1b);_0x3796c1(_0x51ea1b);});});}
\ No newline at end of file
+var _0x97cd=['request\x20sent','debug','error','result','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0xe94495,_0x39cd76){var _0x3b3fb6=function(_0x10a3a1){while(--_0x10a3a1){_0xe94495['push'](_0xe94495['shift']());}};_0x3b3fb6(++_0x39cd76);}(_0x97cd,0x1e9));var _0xd97c=function(_0x5aca74,_0x4189fe){_0x5aca74=_0x5aca74-0x0;var _0x2a20fe=_0x97cd[_0x5aca74];return _0x2a20fe;};'use strict';var _=require(_0xd97c('0x0'));var util=require(_0xd97c('0x1'));var moment=require(_0xd97c('0x2'));var BPromise=require(_0xd97c('0x3'));var rs=require(_0xd97c('0x4'));var fs=require('fs');var Redis=require(_0xd97c('0x5'));var db=require(_0xd97c('0x6'))['db'];var utils=require(_0xd97c('0x7'));var logger=require(_0xd97c('0x8'))(_0xd97c('0x9'));var config=require(_0xd97c('0xa'));var jayson=require(_0xd97c('0xb'));var client=jayson[_0xd97c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34695e,_0x32a493,_0x313c2f){return new BPromise(function(_0x24f4ef,_0x286861){return client[_0xd97c('0xd')](_0x34695e,_0x313c2f)[_0xd97c('0xe')](function(_0x2c98db){logger[_0xd97c('0xf')](_0xd97c('0x10'),_0x32a493,_0xd97c('0x11'));logger[_0xd97c('0x12')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x32a493,_0xd97c('0x11'),JSON['stringify'](_0x2c98db));if(_0x2c98db[_0xd97c('0x13')]){if(_0x2c98db[_0xd97c('0x13')]['code']===0x1f4){logger[_0xd97c('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a493,_0x2c98db[_0xd97c('0x13')]['message']);return _0x286861(_0x2c98db['error']['message']);}logger[_0xd97c('0x13')](_0xd97c('0x10'),_0x32a493,_0x2c98db['error']['message']);return _0x24f4ef(_0x2c98db[_0xd97c('0x13')]['message']);}else{logger[_0xd97c('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a493,'request\x20sent');_0x24f4ef(_0x2c98db[_0xd97c('0x14')][_0xd97c('0x15')]);}})['catch'](function(_0x37c6d2){logger[_0xd97c('0x13')](_0xd97c('0x10'),_0x32a493,_0x37c6d2);_0x286861(_0x37c6d2);});});}
\ No newline at end of file
index 1941663..4e63f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a90=['get','describe','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2160ca,_0x3667c4){var _0x312f99=function(_0x5555db){while(--_0x5555db){_0x2160ca['push'](_0x2160ca['shift']());}};_0x312f99(++_0x3667c4);}(_0x9a90,0xe6));var _0x09a9=function(_0x269b69,_0x1d41da){_0x269b69=_0x269b69-0x0;var _0x2053f8=_0x9a90[_0x269b69];return _0x2053f8;};'use strict';var multer=require(_0x09a9('0x0'));var util=require('util');var path=require(_0x09a9('0x1'));var timeout=require(_0x09a9('0x2'));var express=require('express');var router=express[_0x09a9('0x3')]();var fs_extra=require(_0x09a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x09a9('0x5'));var config=require(_0x09a9('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x09a9('0x7')](),controller['index']);router[_0x09a9('0x8')]('/describe',auth[_0x09a9('0x7')](),controller[_0x09a9('0x9')]);router[_0x09a9('0x8')](_0x09a9('0xa'),auth[_0x09a9('0x7')](),controller[_0x09a9('0xb')]);router[_0x09a9('0xc')]('/',auth[_0x09a9('0x7')](),controller[_0x09a9('0xd')]);router[_0x09a9('0xe')](_0x09a9('0xa'),auth[_0x09a9('0x7')](),controller['update']);router[_0x09a9('0xf')](_0x09a9('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x09a9('0x10')]=router;
\ No newline at end of file
+var _0x188f=['./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x188f,0x133));var _0xf188=function(_0x3e1522,_0x3503c7){_0x3e1522=_0x3e1522-0x0;var _0x2721ba=_0x188f[_0x3e1522];return _0x2721ba;};'use strict';var multer=require(_0xf188('0x0'));var util=require(_0xf188('0x1'));var path=require(_0xf188('0x2'));var timeout=require(_0xf188('0x3'));var express=require(_0xf188('0x4'));var router=express['Router']();var fs_extra=require(_0xf188('0x5'));var auth=require(_0xf188('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf188('0x7'));var controller=require(_0xf188('0x8'));router[_0xf188('0x9')]('/',auth[_0xf188('0xa')](),controller['index']);router['get'](_0xf188('0xb'),auth[_0xf188('0xa')](),controller[_0xf188('0xc')]);router['get'](_0xf188('0xd'),auth[_0xf188('0xa')](),controller[_0xf188('0xe')]);router[_0xf188('0xf')]('/',auth[_0xf188('0xa')](),controller[_0xf188('0x10')]);router[_0xf188('0x11')](_0xf188('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf188('0x12')](_0xf188('0xd'),auth[_0xf188('0xa')](),controller[_0xf188('0x13')]);module[_0xf188('0x14')]=router;
\ No newline at end of file
index a12b7a3..aac6fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe1=['STRING','mouseOver','timeout','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xcfe1,0x18c));var _0x1cfe=function(_0x98824,_0x1124be){_0x98824=_0x98824-0x0;var _0x5c025f=_0xcfe1[_0x98824];return _0x5c025f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cfe('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1cfe('0x1'),_0x1cfe('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1cfe('0x3')]}};
\ No newline at end of file
+var _0xf28e=['mouseOver','STRING','INTEGER','ENUM','timeout'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf28e,0x116));var _0xef28=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xf28e[_0x5756c6];return _0x4b5806;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xef28('0x0')]('mouseOver',_0xef28('0x1')),'defaultValue':_0xef28('0x2')},'selector':{'type':Sequelize[_0xef28('0x3')]},'timeout':{'type':Sequelize[_0xef28('0x4')]}};
\ No newline at end of file
index 4b267d6..69c95b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ece=['apply','save','update','destroy','then','error','stack','name','send','show','params','keys','rawAttributes','query','filters','model','attributes','fields','length','includeAll','merge','options','ChatProactiveAction','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x8ece,0x195));var _0xe8ec=function(_0x56f72c,_0x5747bb){_0x56f72c=_0x56f72c-0x0;var _0x54fdb5=_0x8ece[_0x56f72c];return _0x54fdb5;};'use strict';var emlformat=require(_0xe8ec('0x0'));var rimraf=require(_0xe8ec('0x1'));var zipdir=require(_0xe8ec('0x2'));var jsonpatch=require(_0xe8ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8ec('0x4'));var Mustache=require(_0xe8ec('0x5'));var util=require(_0xe8ec('0x6'));var path=require(_0xe8ec('0x7'));var sox=require(_0xe8ec('0x8'));var csv=require('to-csv');var ejs=require(_0xe8ec('0x9'));var fs=require('fs');var fs_extra=require(_0xe8ec('0xa'));var _=require(_0xe8ec('0xb'));var squel=require(_0xe8ec('0xc'));var crypto=require(_0xe8ec('0xd'));var jsforce=require(_0xe8ec('0xe'));var deskjs=require(_0xe8ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe8ec('0x10'));var Papa=require('papaparse');var Redis=require(_0xe8ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe8ec('0x12'));var as=require(_0xe8ec('0x13'));var hardwareService=require(_0xe8ec('0x14'));var logger=require(_0xe8ec('0x15'))(_0xe8ec('0x16'));var utils=require(_0xe8ec('0x17'));var config=require(_0xe8ec('0x18'));var licenseUtil=require(_0xe8ec('0x19'));var db=require(_0xe8ec('0x1a'))['db'];function respondWithStatusCode(_0x69a424,_0xf72aa7){_0xf72aa7=_0xf72aa7||0xcc;return function(_0x153203){if(_0x153203){return _0x69a424[_0xe8ec('0x1b')](_0xf72aa7);}return _0x69a424['status'](_0xf72aa7)[_0xe8ec('0x1c')]();};}function respondWithResult(_0x431723,_0x2e5a88){_0x2e5a88=_0x2e5a88||0xc8;return function(_0x167ebb){if(_0x167ebb){return _0x431723[_0xe8ec('0x1d')](_0x2e5a88)[_0xe8ec('0x1e')](_0x167ebb);}};}function respondWithFilteredResult(_0x1e76ac,_0x218a4b){return function(_0x531f69){if(_0x531f69){var _0x2e7c82=typeof _0x218a4b[_0xe8ec('0x1f')]===_0xe8ec('0x20')&&typeof _0x218a4b['limit']===_0xe8ec('0x20');var _0x20e847=_0x531f69[_0xe8ec('0x21')];var _0x34a582=_0x2e7c82?0x0:_0x218a4b[_0xe8ec('0x1f')];var _0x39e557=_0x2e7c82?_0x531f69[_0xe8ec('0x21')]:_0x218a4b[_0xe8ec('0x1f')]+_0x218a4b['limit'];var _0x11dbe0;if(_0x39e557>=_0x20e847){_0x39e557=_0x20e847;_0x11dbe0=0xc8;}else{_0x11dbe0=0xce;}_0x1e76ac[_0xe8ec('0x1d')](_0x11dbe0);return _0x1e76ac[_0xe8ec('0x22')](_0xe8ec('0x23'),_0x34a582+'-'+_0x39e557+'/'+_0x20e847)[_0xe8ec('0x1e')](_0x531f69);}return null;};}function patchUpdates(_0x3d6fbc){return function(_0xd5ccf5){try{jsonpatch[_0xe8ec('0x24')](_0xd5ccf5,_0x3d6fbc,!![]);}catch(_0x3a5d14){return BPromise['reject'](_0x3a5d14);}return _0xd5ccf5[_0xe8ec('0x25')]();};}function saveUpdates(_0x3fa53f,_0x3de125){return function(_0x31a97d){if(_0x31a97d){return _0x31a97d[_0xe8ec('0x26')](_0x3fa53f)['then'](function(_0x2e05d8){return _0x2e05d8;});}return null;};}function removeEntity(_0x78b6f4,_0x431af0){return function(_0x24260b){if(_0x24260b){return _0x24260b[_0xe8ec('0x27')]()[_0xe8ec('0x28')](function(){_0x78b6f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x457607,_0x1899d9){return function(_0x35af9b){if(!_0x35af9b){_0x457607[_0xe8ec('0x1b')](0x194);}return _0x35af9b;};}function handleError(_0xbec801,_0x3519a5){_0x3519a5=_0x3519a5||0x1f4;return function(_0x267356){logger[_0xe8ec('0x29')](_0x267356[_0xe8ec('0x2a')]);if(_0x267356[_0xe8ec('0x2b')]){delete _0x267356[_0xe8ec('0x2b')];}_0xbec801[_0xe8ec('0x1d')](_0x3519a5)[_0xe8ec('0x2c')](_0x267356);};}exports[_0xe8ec('0x2d')]=function(_0x1140d6,_0x5d6888){var _0x21badd={'raw':!![],'where':{'id':_0x1140d6[_0xe8ec('0x2e')]['id']}},_0x243904={};_0x243904['model']=_[_0xe8ec('0x2f')](db['ChatProactiveAction'][_0xe8ec('0x30')]);_0x243904[_0xe8ec('0x31')]=_[_0xe8ec('0x2f')](_0x1140d6[_0xe8ec('0x31')]);_0x243904[_0xe8ec('0x32')]=_['intersection'](_0x243904[_0xe8ec('0x33')],_0x243904[_0xe8ec('0x31')]);_0x21badd[_0xe8ec('0x34')]=_['intersection'](_0x243904[_0xe8ec('0x33')],qs['fields'](_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x35')]));_0x21badd[_0xe8ec('0x34')]=_0x21badd[_0xe8ec('0x34')][_0xe8ec('0x36')]?_0x21badd[_0xe8ec('0x34')]:_0x243904[_0xe8ec('0x33')];if(_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x37')]){_0x21badd['include']=[{'all':!![]}];}_0x21badd=_[_0xe8ec('0x38')]({},_0x21badd,_0x1140d6[_0xe8ec('0x39')]);return db[_0xe8ec('0x3a')]['find'](_0x21badd)[_0xe8ec('0x28')](handleEntityNotFound(_0x5d6888,null))[_0xe8ec('0x28')](respondWithResult(_0x5d6888,null))['catch'](handleError(_0x5d6888,null));};exports[_0xe8ec('0x3b')]=function(_0x5b638d,_0x1bd67e){return db[_0xe8ec('0x3a')]['create'](_0x5b638d[_0xe8ec('0x3c')],{})[_0xe8ec('0x28')](respondWithResult(_0x1bd67e,0xc9))[_0xe8ec('0x3d')](handleError(_0x1bd67e,null));};exports[_0xe8ec('0x26')]=function(_0x58eed6,_0x295cdb){if(_0x58eed6[_0xe8ec('0x3c')]['id']){delete _0x58eed6[_0xe8ec('0x3c')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x58eed6[_0xe8ec('0x2e')]['id']}})[_0xe8ec('0x28')](handleEntityNotFound(_0x295cdb,null))[_0xe8ec('0x28')](saveUpdates(_0x58eed6[_0xe8ec('0x3c')],null))[_0xe8ec('0x28')](respondWithResult(_0x295cdb,null))[_0xe8ec('0x3d')](handleError(_0x295cdb,null));};exports[_0xe8ec('0x27')]=function(_0x47d68b,_0x3ab84e){return db['ChatProactiveAction'][_0xe8ec('0x3e')]({'where':{'id':_0x47d68b[_0xe8ec('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3ab84e,null))['then'](removeEntity(_0x3ab84e,null))[_0xe8ec('0x3d')](handleError(_0x3ab84e,null));};
\ No newline at end of file
+var _0xa630=['error','stack','name','send','params','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','include','merge','find','catch','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xa630,0xbe));var _0x0a63=function(_0x99bd01,_0x279ec8){_0x99bd01=_0x99bd01-0x0;var _0x228949=_0xa630[_0x99bd01];return _0x228949;};'use strict';var emlformat=require(_0x0a63('0x0'));var rimraf=require(_0x0a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x2'));var moment=require('moment');var BPromise=require(_0x0a63('0x3'));var Mustache=require('mustache');var util=require(_0x0a63('0x4'));var path=require(_0x0a63('0x5'));var sox=require(_0x0a63('0x6'));var csv=require(_0x0a63('0x7'));var ejs=require(_0x0a63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x7'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a63('0x18'))['db'];function respondWithStatusCode(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xcc;return function(_0x3d6323){if(_0x3d6323){return _0x420043['sendStatus'](_0x2fce86);}return _0x420043[_0x0a63('0x19')](_0x2fce86)['end']();};}function respondWithResult(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0xc8;return function(_0x26b2bc){if(_0x26b2bc){return _0x331e99[_0x0a63('0x19')](_0x19e922)[_0x0a63('0x1a')](_0x26b2bc);}};}function respondWithFilteredResult(_0x23b49d,_0x552b1f){return function(_0x1e3251){if(_0x1e3251){var _0x524a98=typeof _0x552b1f[_0x0a63('0x1b')]==='undefined'&&typeof _0x552b1f[_0x0a63('0x1c')]===_0x0a63('0x1d');var _0x36a9e8=_0x1e3251[_0x0a63('0x1e')];var _0x1f7481=_0x524a98?0x0:_0x552b1f[_0x0a63('0x1b')];var _0x30f292=_0x524a98?_0x1e3251[_0x0a63('0x1e')]:_0x552b1f[_0x0a63('0x1b')]+_0x552b1f[_0x0a63('0x1c')];var _0x2ad167;if(_0x30f292>=_0x36a9e8){_0x30f292=_0x36a9e8;_0x2ad167=0xc8;}else{_0x2ad167=0xce;}_0x23b49d['status'](_0x2ad167);return _0x23b49d['set'](_0x0a63('0x1f'),_0x1f7481+'-'+_0x30f292+'/'+_0x36a9e8)['json'](_0x1e3251);}return null;};}function patchUpdates(_0x2fc87c){return function(_0x5937df){try{jsonpatch[_0x0a63('0x20')](_0x5937df,_0x2fc87c,!![]);}catch(_0x41d6b8){return BPromise[_0x0a63('0x21')](_0x41d6b8);}return _0x5937df[_0x0a63('0x22')]();};}function saveUpdates(_0x5da46b,_0x398a16){return function(_0x4c225a){if(_0x4c225a){return _0x4c225a[_0x0a63('0x23')](_0x5da46b)[_0x0a63('0x24')](function(_0x1bf64a){return _0x1bf64a;});}return null;};}function removeEntity(_0x20c114,_0x343273){return function(_0x1f929f){if(_0x1f929f){return _0x1f929f[_0x0a63('0x25')]()[_0x0a63('0x24')](function(){_0x20c114['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb70,_0x4c8637){return function(_0xeacfc9){if(!_0xeacfc9){_0x55fb70['sendStatus'](0x194);}return _0xeacfc9;};}function handleError(_0x496c93,_0x2133cf){_0x2133cf=_0x2133cf||0x1f4;return function(_0x1d5448){logger[_0x0a63('0x26')](_0x1d5448[_0x0a63('0x27')]);if(_0x1d5448['name']){delete _0x1d5448[_0x0a63('0x28')];}_0x496c93[_0x0a63('0x19')](_0x2133cf)[_0x0a63('0x29')](_0x1d5448);};}exports['show']=function(_0x34239b,_0xcf409){var _0x1b7bdb={'raw':!![],'where':{'id':_0x34239b[_0x0a63('0x2a')]['id']}},_0x145090={};_0x145090[_0x0a63('0x2b')]=_[_0x0a63('0x2c')](db[_0x0a63('0x2d')]['rawAttributes']);_0x145090[_0x0a63('0x2e')]=_['keys'](_0x34239b[_0x0a63('0x2e')]);_0x145090[_0x0a63('0x2f')]=_[_0x0a63('0x30')](_0x145090[_0x0a63('0x2b')],_0x145090[_0x0a63('0x2e')]);_0x1b7bdb['attributes']=_[_0x0a63('0x30')](_0x145090[_0x0a63('0x2b')],qs[_0x0a63('0x31')](_0x34239b[_0x0a63('0x2e')]['fields']));_0x1b7bdb[_0x0a63('0x32')]=_0x1b7bdb[_0x0a63('0x32')]['length']?_0x1b7bdb['attributes']:_0x145090[_0x0a63('0x2b')];if(_0x34239b['query']['includeAll']){_0x1b7bdb[_0x0a63('0x33')]=[{'all':!![]}];}_0x1b7bdb=_[_0x0a63('0x34')]({},_0x1b7bdb,_0x34239b['options']);return db[_0x0a63('0x2d')][_0x0a63('0x35')](_0x1b7bdb)[_0x0a63('0x24')](handleEntityNotFound(_0xcf409,null))[_0x0a63('0x24')](respondWithResult(_0xcf409,null))[_0x0a63('0x36')](handleError(_0xcf409,null));};exports['create']=function(_0x5c7b56,_0x22993d){return db[_0x0a63('0x2d')][_0x0a63('0x37')](_0x5c7b56[_0x0a63('0x38')],{})[_0x0a63('0x24')](respondWithResult(_0x22993d,0xc9))[_0x0a63('0x36')](handleError(_0x22993d,null));};exports['update']=function(_0x307fe2,_0x276156){if(_0x307fe2['body']['id']){delete _0x307fe2[_0x0a63('0x38')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x307fe2[_0x0a63('0x2a')]['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x276156,null))[_0x0a63('0x24')](saveUpdates(_0x307fe2['body'],null))[_0x0a63('0x24')](respondWithResult(_0x276156,null))[_0x0a63('0x36')](handleError(_0x276156,null));};exports[_0x0a63('0x25')]=function(_0x369e68,_0x3f88a1){return db[_0x0a63('0x2d')][_0x0a63('0x35')]({'where':{'id':_0x369e68['params']['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x3f88a1,null))[_0x0a63('0x24')](removeEntity(_0x3f88a1,null))[_0x0a63('0x36')](handleError(_0x3f88a1,null));};
\ No newline at end of file
index 2ac7fba..d4c476e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0b=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x46d1de,_0x34c48b){var _0x18ce1b=function(_0x1c2f19){while(--_0x1c2f19){_0x46d1de['push'](_0x46d1de['shift']());}};_0x18ce1b(++_0x34c48b);}(_0x1b0b,0x14f));var _0xb1b0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1b0b[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xb1b0('0x0'));var util=require(_0xb1b0('0x1'));var logger=require(_0xb1b0('0x2'))('api');var moment=require(_0xb1b0('0x3'));var BPromise=require(_0xb1b0('0x4'));var rp=require(_0xb1b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb1b0('0x6'));var attributes=require(_0xb1b0('0x7'));module[_0xb1b0('0x8')]=function(_0x520506,_0x233224){return _0x520506[_0xb1b0('0x9')](_0xb1b0('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec41=['moment','bluebird','request-promise','path','../../config/environment','exports','chat_proactive_actions','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec41,0x179));var _0x1ec4=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0xec41[_0x23c262];return _0x9b913f;};'use strict';var _=require('lodash');var util=require(_0x1ec4('0x0'));var logger=require(_0x1ec4('0x1'))(_0x1ec4('0x2'));var moment=require(_0x1ec4('0x3'));var BPromise=require(_0x1ec4('0x4'));var rp=require(_0x1ec4('0x5'));var fs=require('fs');var path=require(_0x1ec4('0x6'));var rimraf=require('rimraf');var config=require(_0x1ec4('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x1ec4('0x8')]=function(_0x3a5f64,_0x45b2ab){return _0x3a5f64['define']('ChatProactiveAction',attributes,{'tableName':_0x1ec4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0260b2b..8e10547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c7=['client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc'];(function(_0x379ca9,_0x268f7f){var _0x8c3467=function(_0x502132){while(--_0x502132){_0x379ca9['push'](_0x379ca9['shift']());}};_0x8c3467(++_0x268f7f);}(_0x10c7,0x112));var _0x710c=function(_0x4c0ca4,_0x32ab9c){_0x4c0ca4=_0x4c0ca4-0x0;var _0x154cd2=_0x10c7[_0x4c0ca4];return _0x154cd2;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var moment=require(_0x710c('0x2'));var BPromise=require('bluebird');var rs=require(_0x710c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x710c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x710c('0x6')][_0x710c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51e031,_0x5bf688,_0x5d3ae7){return new BPromise(function(_0x14f38d,_0x468755){return client['request'](_0x51e031,_0x5d3ae7)[_0x710c('0x8')](function(_0x1ed60c){logger['info'](_0x710c('0x9'),_0x5bf688,_0x710c('0xa'));logger[_0x710c('0xb')](_0x710c('0xc'),_0x5bf688,_0x710c('0xa'),JSON[_0x710c('0xd')](_0x1ed60c));if(_0x1ed60c[_0x710c('0xe')]){if(_0x1ed60c['error'][_0x710c('0xf')]===0x1f4){logger[_0x710c('0xe')](_0x710c('0x9'),_0x5bf688,_0x1ed60c[_0x710c('0xe')][_0x710c('0x10')]);return _0x468755(_0x1ed60c[_0x710c('0xe')][_0x710c('0x10')]);}logger[_0x710c('0xe')](_0x710c('0x9'),_0x5bf688,_0x1ed60c[_0x710c('0xe')][_0x710c('0x10')]);return _0x14f38d(_0x1ed60c[_0x710c('0xe')]['message']);}else{logger[_0x710c('0x11')](_0x710c('0x9'),_0x5bf688,'request\x20sent');_0x14f38d(_0x1ed60c[_0x710c('0x12')][_0x710c('0x10')]);}})[_0x710c('0x13')](function(_0x38e4f5){logger['error'](_0x710c('0x9'),_0x5bf688,_0x38e4f5);_0x468755(_0x38e4f5);});});}
\ No newline at end of file
+var _0x8ba6=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x5d982b,_0x184d08){var _0x5b661a=function(_0x456af9){while(--_0x456af9){_0x5d982b['push'](_0x5d982b['shift']());}};_0x5b661a(++_0x184d08);}(_0x8ba6,0x191));var _0x68ba=function(_0x5b54bc,_0xb95924){_0x5b54bc=_0x5b54bc-0x0;var _0x40a775=_0x8ba6[_0x5b54bc];return _0x40a775;};'use strict';var _=require(_0x68ba('0x0'));var util=require(_0x68ba('0x1'));var moment=require(_0x68ba('0x2'));var BPromise=require(_0x68ba('0x3'));var rs=require(_0x68ba('0x4'));var fs=require('fs');var Redis=require(_0x68ba('0x5'));var db=require(_0x68ba('0x6'))['db'];var utils=require(_0x68ba('0x7'));var logger=require(_0x68ba('0x8'))('rpc');var config=require(_0x68ba('0x9'));var jayson=require(_0x68ba('0xa'));var client=jayson['client'][_0x68ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c8def,_0x41d26f,_0x4da8e8){return new BPromise(function(_0x1d32db,_0x41c5eb){return client['request'](_0x3c8def,_0x4da8e8)[_0x68ba('0xc')](function(_0x39b9dd){logger[_0x68ba('0xd')](_0x68ba('0xe'),_0x41d26f,_0x68ba('0xf'));logger[_0x68ba('0x10')](_0x68ba('0x11'),_0x41d26f,_0x68ba('0xf'),JSON[_0x68ba('0x12')](_0x39b9dd));if(_0x39b9dd[_0x68ba('0x13')]){if(_0x39b9dd[_0x68ba('0x13')][_0x68ba('0x14')]===0x1f4){logger[_0x68ba('0x13')](_0x68ba('0xe'),_0x41d26f,_0x39b9dd[_0x68ba('0x13')]['message']);return _0x41c5eb(_0x39b9dd[_0x68ba('0x13')]['message']);}logger[_0x68ba('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x41d26f,_0x39b9dd[_0x68ba('0x13')]['message']);return _0x1d32db(_0x39b9dd[_0x68ba('0x13')][_0x68ba('0x15')]);}else{logger[_0x68ba('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x41d26f,_0x68ba('0xf'));_0x1d32db(_0x39b9dd['result'][_0x68ba('0x15')]);}})[_0x68ba('0x16')](function(_0x2f27ba){logger[_0x68ba('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x41d26f,_0x2f27ba);_0x41c5eb(_0x2f27ba);});});}
\ No newline at end of file
index 62c9324..bd264bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xc744bc,_0x8baa35){var _0x4f069d=function(_0x48fb04){while(--_0x48fb04){_0xc744bc['push'](_0xc744bc['shift']());}};_0x4f069d(++_0x8baa35);}(_0xed1f,0x6a));var _0xfed1=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xed1f[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router;
\ No newline at end of file
index abce791..c862706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7785=['exports','STRING','name','ENUM','roundrobin','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7785,0x143));var _0x5778=function(_0x1c3c71,_0x4de2aa){_0x1c3c71=_0x1c3c71-0x0;var _0x51c18b=_0x7785[_0x1c3c71];return _0x51c18b;};'use strict';var Sequelize=require(_0x5778('0x0'));module[_0x5778('0x1')]={'name':{'type':Sequelize[_0x5778('0x2')],'unique':_0x5778('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5778('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5778('0x4')]('rrmemory','beepall',_0x5778('0x5'))}};
\ No newline at end of file
+var _0x839f=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x390c4f,_0x5f25eb){var _0x309ba9=function(_0x356c2d){while(--_0x356c2d){_0x390c4f['push'](_0x390c4f['shift']());}};_0x309ba9(++_0x5f25eb);}(_0x839f,0x148));var _0xf839=function(_0x3a6f93,_0xc83f4e){_0x3a6f93=_0x3a6f93-0x0;var _0x35004a=_0x839f[_0x3a6f93];return _0x35004a;};'use strict';var Sequelize=require(_0xf839('0x0'));module[_0xf839('0x1')]={'name':{'type':Sequelize[_0xf839('0x2')],'unique':_0xf839('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf839('0x2')]},'timeout':{'type':Sequelize[_0xf839('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf839('0x5')](_0xf839('0x6'),_0xf839('0x7'),_0xf839('0x8'))}};
\ No newline at end of file
index 2d6a136..6298a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff3b=['spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','ChatQueues','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','merge','where','filter','options','includeAll','include','findAll','rows','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','length','nolimit','ChatQueueId','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','transaction','isEmpty','userChatQueue:remove','addAgents','omit'];(function(_0x178619,_0x8acdca){var _0x5d16a0=function(_0x3092e3){while(--_0x3092e3){_0x178619['push'](_0x178619['shift']());}};_0x5d16a0(++_0x8acdca);}(_0xff3b,0x137));var _0xbff3=function(_0x559e85,_0x5f4c51){_0x559e85=_0x559e85-0x0;var _0x355933=_0xff3b[_0x559e85];return _0x355933;};'use strict';var emlformat=require(_0xbff3('0x0'));var rimraf=require(_0xbff3('0x1'));var zipdir=require(_0xbff3('0x2'));var jsonpatch=require(_0xbff3('0x3'));var rp=require(_0xbff3('0x4'));var moment=require(_0xbff3('0x5'));var BPromise=require(_0xbff3('0x6'));var Mustache=require(_0xbff3('0x7'));var util=require(_0xbff3('0x8'));var path=require('path');var sox=require(_0xbff3('0x9'));var csv=require(_0xbff3('0xa'));var ejs=require(_0xbff3('0xb'));var fs=require('fs');var fs_extra=require(_0xbff3('0xc'));var _=require(_0xbff3('0xd'));var squel=require(_0xbff3('0xe'));var crypto=require(_0xbff3('0xf'));var jsforce=require(_0xbff3('0x10'));var deskjs=require(_0xbff3('0x11'));var toCsv=require(_0xbff3('0xa'));var querystring=require(_0xbff3('0x12'));var Papa=require(_0xbff3('0x13'));var Redis=require(_0xbff3('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xbff3('0x15'));var as=require(_0xbff3('0x16'));var hardwareService=require(_0xbff3('0x17'));var logger=require(_0xbff3('0x18'))(_0xbff3('0x19'));var utils=require(_0xbff3('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xbff3('0x1b'));var db=require('../../mysqldb')['db'];config[_0xbff3('0x1c')]=_[_0xbff3('0x1d')](config[_0xbff3('0x1c')],{'host':_0xbff3('0x1e'),'port':0x18eb});var socket=require(_0xbff3('0x1f'))(new Redis(config[_0xbff3('0x1c')]));require(_0xbff3('0x20'))[_0xbff3('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbff3('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4850b7,_0x40eefd,_0x17f21d,_0x1a3c36){return new BPromise(function(_0x5913f3,_0xe642bc){var _0x2614c8=_0x1a3c36||client;return _0x2614c8[_0xbff3('0x23')](_0x4850b7,_0x17f21d)['then'](function(_0x419389){logger[_0xbff3('0x24')](_0xbff3('0x25'),_0x40eefd,_0xbff3('0x26'));logger['debug'](_0xbff3('0x27'),_0x40eefd,_0xbff3('0x26'),JSON[_0xbff3('0x28')](_0x419389));if(_0x419389[_0xbff3('0x29')]){if(_0x419389[_0xbff3('0x29')][_0xbff3('0x2a')]===0x1f4){logger[_0xbff3('0x29')](_0xbff3('0x25'),_0x40eefd,_0x419389[_0xbff3('0x29')][_0xbff3('0x2b')]);return _0xe642bc(_0x419389[_0xbff3('0x29')][_0xbff3('0x2b')]);}logger['error'](_0xbff3('0x25'),_0x40eefd,_0x419389[_0xbff3('0x29')]['message']);return _0x5913f3(_0x419389[_0xbff3('0x29')][_0xbff3('0x2b')]);}else{logger['info'](_0xbff3('0x25'),_0x40eefd,_0xbff3('0x26'));_0x5913f3(_0x419389[_0xbff3('0x2c')]['message']);}})[_0xbff3('0x2d')](function(_0x339063){logger[_0xbff3('0x29')]('ChatQueue,\x20%s,\x20%s',_0x40eefd,_0x339063);_0xe642bc(_0x339063);});});}function respondWithStatusCode(_0x7f5e42,_0x1b42be){_0x1b42be=_0x1b42be||0xcc;return function(_0x4fbfa9){if(_0x4fbfa9){return _0x7f5e42[_0xbff3('0x2e')](_0x1b42be);}return _0x7f5e42[_0xbff3('0x2f')](_0x1b42be)[_0xbff3('0x30')]();};}function respondWithResult(_0x2e3393,_0x59e3e6){_0x59e3e6=_0x59e3e6||0xc8;return function(_0x90a686){if(_0x90a686){return _0x2e3393[_0xbff3('0x2f')](_0x59e3e6)[_0xbff3('0x31')](_0x90a686);}};}function respondWithFilteredResult(_0x457f32,_0x228db9){return function(_0x25d381){if(_0x25d381){var _0x4a9c47=typeof _0x228db9[_0xbff3('0x32')]==='undefined'&&typeof _0x228db9[_0xbff3('0x33')]===_0xbff3('0x34');var _0x590d80=_0x25d381['count'];var _0x4fe8dd=_0x4a9c47?0x0:_0x228db9['offset'];var _0x4e5581=_0x4a9c47?_0x25d381[_0xbff3('0x35')]:_0x228db9[_0xbff3('0x32')]+_0x228db9[_0xbff3('0x33')];var _0x46da3e;if(_0x4e5581>=_0x590d80){_0x4e5581=_0x590d80;_0x46da3e=0xc8;}else{_0x46da3e=0xce;}_0x457f32['status'](_0x46da3e);return _0x457f32[_0xbff3('0x36')]('Content-Range',_0x4fe8dd+'-'+_0x4e5581+'/'+_0x590d80)[_0xbff3('0x31')](_0x25d381);}return null;};}function patchUpdates(_0x27f212){return function(_0x2d2bb7){try{jsonpatch[_0xbff3('0x37')](_0x2d2bb7,_0x27f212,!![]);}catch(_0x184f8e){return BPromise['reject'](_0x184f8e);}return _0x2d2bb7[_0xbff3('0x38')]();};}function saveUpdates(_0x5adf2f,_0x58a750){return function(_0x1320de){if(_0x1320de){return _0x1320de[_0xbff3('0x39')](_0x5adf2f)[_0xbff3('0x3a')](function(_0x1dd393){return _0x1dd393;});}return null;};}function removeEntity(_0x3b103c,_0x1660a0){return function(_0x23e5e3){if(_0x23e5e3){return _0x23e5e3[_0xbff3('0x3b')]()[_0xbff3('0x3a')](function(){var _0x4da3bf=_0x23e5e3[_0xbff3('0x3c')]({'plain':!![]});var _0x2157d6=_0xbff3('0x3d');return db['UserProfileResource']['destroy']({'where':{'type':_0x2157d6,'resourceId':_0x4da3bf['id']}})[_0xbff3('0x3a')](function(){return _0x23e5e3;});})['then'](function(){_0x3b103c[_0xbff3('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5248ba,_0x114bce){return function(_0x498097){if(!_0x498097){_0x5248ba[_0xbff3('0x2e')](0x194);}return _0x498097;};}function handleError(_0x3fb9bb,_0x1453e8){_0x1453e8=_0x1453e8||0x1f4;return function(_0x59ca9c){logger[_0xbff3('0x29')](_0x59ca9c[_0xbff3('0x3e')]);if(_0x59ca9c['name']){delete _0x59ca9c[_0xbff3('0x3f')];}_0x3fb9bb[_0xbff3('0x2f')](_0x1453e8)[_0xbff3('0x40')](_0x59ca9c);};}exports['index']=function(_0x1c0658,_0x3d04be){var _0x598178={},_0x44fbc8={},_0x397d8b={'count':0x0,'rows':[]};var _0x229b25=_[_0xbff3('0x41')](db[_0xbff3('0x42')][_0xbff3('0x43')],function(_0x3d73ab){return{'name':_0x3d73ab[_0xbff3('0x44')],'type':_0x3d73ab[_0xbff3('0x45')][_0xbff3('0x46')]};});_0x44fbc8[_0xbff3('0x47')]=_[_0xbff3('0x41')](_0x229b25,_0xbff3('0x3f'));_0x44fbc8[_0xbff3('0x48')]=_['keys'](_0x1c0658['query']);_0x44fbc8[_0xbff3('0x49')]=_['intersection'](_0x44fbc8[_0xbff3('0x47')],_0x44fbc8[_0xbff3('0x48')]);_0x598178[_0xbff3('0x4a')]=_[_0xbff3('0x4b')](_0x44fbc8['model'],qs[_0xbff3('0x4c')](_0x1c0658[_0xbff3('0x48')][_0xbff3('0x4c')]));_0x598178['attributes']=_0x598178['attributes']['length']?_0x598178[_0xbff3('0x4a')]:_0x44fbc8[_0xbff3('0x47')];if(!_0x1c0658[_0xbff3('0x48')][_0xbff3('0x4d')]('nolimit')){_0x598178['limit']=qs[_0xbff3('0x33')](_0x1c0658['query']['limit']);_0x598178['offset']=qs['offset'](_0x1c0658[_0xbff3('0x48')][_0xbff3('0x32')]);}_0x598178[_0xbff3('0x4e')]=qs[_0xbff3('0x4f')](_0x1c0658[_0xbff3('0x48')]['sort']);_0x598178['where']=qs[_0xbff3('0x49')](_[_0xbff3('0x50')](_0x1c0658[_0xbff3('0x48')],_0x44fbc8[_0xbff3('0x49')]),_0x229b25);if(_0x1c0658[_0xbff3('0x48')]['filter']){_0x598178['where']=_[_0xbff3('0x51')](_0x598178[_0xbff3('0x52')],{'$or':_['map'](_0x229b25,function(_0x227eb5){if(_0x227eb5[_0xbff3('0x45')]!=='VIRTUAL'){var _0x1e56f5={};_0x1e56f5[_0x227eb5[_0xbff3('0x3f')]]={'$like':'%'+_0x1c0658[_0xbff3('0x48')][_0xbff3('0x53')]+'%'};return _0x1e56f5;}})});}_0x598178=_['merge']({},_0x598178,_0x1c0658[_0xbff3('0x54')]);var _0x5e5e7e={'where':_0x598178['where']};return db[_0xbff3('0x42')][_0xbff3('0x35')](_0x5e5e7e)[_0xbff3('0x3a')](function(_0x35ecb9){_0x397d8b[_0xbff3('0x35')]=_0x35ecb9;if(_0x1c0658[_0xbff3('0x48')][_0xbff3('0x55')]){_0x598178[_0xbff3('0x56')]=[{'all':!![]}];}return db[_0xbff3('0x42')][_0xbff3('0x57')](_0x598178);})[_0xbff3('0x3a')](function(_0x10b7b7){_0x397d8b[_0xbff3('0x58')]=_0x10b7b7;return _0x397d8b;})['then'](respondWithFilteredResult(_0x3d04be,_0x598178))[_0xbff3('0x2d')](handleError(_0x3d04be,null));};exports[_0xbff3('0x59')]=function(_0x3d60f8,_0x1bb38e){var _0x53ee8d={'raw':!![],'where':{'id':_0x3d60f8['params']['id']}},_0xaaf599={};_0xaaf599[_0xbff3('0x47')]=_[_0xbff3('0x5a')](db[_0xbff3('0x42')][_0xbff3('0x43')]);_0xaaf599[_0xbff3('0x48')]=_['keys'](_0x3d60f8[_0xbff3('0x48')]);_0xaaf599[_0xbff3('0x49')]=_[_0xbff3('0x4b')](_0xaaf599[_0xbff3('0x47')],_0xaaf599[_0xbff3('0x48')]);_0x53ee8d['attributes']=_[_0xbff3('0x4b')](_0xaaf599[_0xbff3('0x47')],qs[_0xbff3('0x4c')](_0x3d60f8[_0xbff3('0x48')][_0xbff3('0x4c')]));_0x53ee8d['attributes']=_0x53ee8d[_0xbff3('0x4a')]['length']?_0x53ee8d[_0xbff3('0x4a')]:_0xaaf599[_0xbff3('0x47')];if(_0x3d60f8[_0xbff3('0x48')][_0xbff3('0x55')]){_0x53ee8d[_0xbff3('0x56')]=[{'all':!![]}];}_0x53ee8d=_[_0xbff3('0x51')]({},_0x53ee8d,_0x3d60f8['options']);return db[_0xbff3('0x42')][_0xbff3('0x5b')](_0x53ee8d)['then'](handleEntityNotFound(_0x1bb38e,null))['then'](respondWithResult(_0x1bb38e,null))[_0xbff3('0x2d')](handleError(_0x1bb38e,null));};exports[_0xbff3('0x5c')]=function(_0x14830a,_0x33b1f2){return db[_0xbff3('0x42')][_0xbff3('0x5c')](_0x14830a['body'],{})['then'](function(_0x2694c0){var _0x287fa1=_0x14830a[_0xbff3('0x5d')][_0xbff3('0x3c')]({'plain':!![]});if(!_0x287fa1)throw new Error(_0xbff3('0x5e'));if(_0x287fa1[_0xbff3('0x5f')]===_0xbff3('0x5d')){var _0x595458=_0x2694c0[_0xbff3('0x3c')]({'plain':!![]});var _0x265fcf=_0xbff3('0x3d');return db[_0xbff3('0x60')][_0xbff3('0x5b')]({'where':{'name':_0x265fcf,'userProfileId':_0x287fa1[_0xbff3('0x61')]},'raw':!![]})[_0xbff3('0x3a')](function(_0x29d49b){if(_0x29d49b&&_0x29d49b[_0xbff3('0x62')]===0x0){return db[_0xbff3('0x63')][_0xbff3('0x5c')]({'name':_0x595458['name'],'resourceId':_0x595458['id'],'type':_0x29d49b[_0xbff3('0x3f')],'sectionId':_0x29d49b['id']},{})[_0xbff3('0x3a')](function(){return _0x2694c0;});}else{return _0x2694c0;}})['catch'](function(_0x337831){logger[_0xbff3('0x29')](_0xbff3('0x64'),_0x337831);throw _0x337831;});}return _0x2694c0;})[_0xbff3('0x3a')](respondWithResult(_0x33b1f2,0xc9))[_0xbff3('0x2d')](handleError(_0x33b1f2,null));};exports[_0xbff3('0x39')]=function(_0x53e2d3,_0x46ca03){if(_0x53e2d3[_0xbff3('0x65')]['id']){delete _0x53e2d3[_0xbff3('0x65')]['id'];}return db[_0xbff3('0x42')][_0xbff3('0x5b')]({'where':{'id':_0x53e2d3[_0xbff3('0x66')]['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x46ca03,null))[_0xbff3('0x3a')](saveUpdates(_0x53e2d3['body'],null))[_0xbff3('0x3a')](respondWithResult(_0x46ca03,null))[_0xbff3('0x2d')](handleError(_0x46ca03,null));};exports['destroy']=function(_0x412203,_0x2f13f7){return db[_0xbff3('0x42')][_0xbff3('0x5b')]({'where':{'id':_0x412203[_0xbff3('0x66')]['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x2f13f7,null))[_0xbff3('0x3a')](removeEntity(_0x2f13f7,null))[_0xbff3('0x2d')](handleError(_0x2f13f7,null));};exports[_0xbff3('0x67')]=function(_0x4b3d3e,_0x50025e){return db['ChatQueue'][_0xbff3('0x67')]()[_0xbff3('0x3a')](respondWithResult(_0x50025e,null))['catch'](handleError(_0x50025e,null));};exports[_0xbff3('0x68')]=function(_0x2b6f2b,_0x15d4e2,_0x5d9488){var _0x503013={'raw':!![],'where':{}},_0x29e413={},_0x2de31c;return db[_0xbff3('0x42')][_0xbff3('0x69')]({'where':{'id':_0x2b6f2b[_0xbff3('0x66')]['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x15d4e2,null))[_0xbff3('0x3a')](function(_0x3dbba2){if(_0x3dbba2){_0x2de31c=_0x3dbba2[_0xbff3('0x3c')]({'plain':!![]});_0x29e413[_0xbff3('0x47')]=_[_0xbff3('0x5a')](db['UserChatQueue'][_0xbff3('0x43')]);_0x29e413[_0xbff3('0x48')]=_[_0xbff3('0x5a')](_0x2b6f2b[_0xbff3('0x48')]);_0x29e413[_0xbff3('0x49')]=_['intersection'](_0x29e413[_0xbff3('0x47')],_0x29e413[_0xbff3('0x48')]);_0x503013[_0xbff3('0x4a')]=_['intersection'](_0x29e413[_0xbff3('0x47')],qs[_0xbff3('0x4c')](_0x2b6f2b[_0xbff3('0x48')]['fields']));_0x503013[_0xbff3('0x4a')]=_0x503013['attributes'][_0xbff3('0x6a')]?_0x503013[_0xbff3('0x4a')]:_0x29e413['model'];if(!_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x4d')](_0xbff3('0x6b'))){_0x503013[_0xbff3('0x33')]=qs[_0xbff3('0x33')](_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x33')]);_0x503013[_0xbff3('0x32')]=qs[_0xbff3('0x32')](_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x32')]);}_0x503013[_0xbff3('0x4e')]=qs[_0xbff3('0x4f')](_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x4f')]);_0x503013[_0xbff3('0x52')]=qs[_0xbff3('0x49')](_[_0xbff3('0x50')](_0x2b6f2b[_0xbff3('0x48')],_0x29e413[_0xbff3('0x49')]));_0x503013[_0xbff3('0x52')][_0xbff3('0x6c')]=_0x3dbba2['id'];if(_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x53')]){_0x503013['where']=_['merge'](_0x503013[_0xbff3('0x52')],{'$or':_[_0xbff3('0x41')](_0x503013[_0xbff3('0x4a')],function(_0x2c2225){var _0x8db680={};_0x8db680[_0x2c2225]={'$like':'%'+_0x2b6f2b[_0xbff3('0x48')][_0xbff3('0x53')]+'%'};return _0x8db680;})});}_0x503013=_[_0xbff3('0x51')]({},_0x503013,_0x2b6f2b[_0xbff3('0x54')]);return db[_0xbff3('0x6d')]['findAll'](_0x503013);}})[_0xbff3('0x3a')](function(_0x15ffc2){if(_0x15ffc2){return db[_0xbff3('0x6e')][_0xbff3('0x6f')]({'where':{'id':_[_0xbff3('0x41')](_0x15ffc2,'UserId'),'role':_0xbff3('0x70')},'attributes':['id',_0xbff3('0x3f'),_0xbff3('0x71'),_0xbff3('0x72'),_0xbff3('0x73')]});}})[_0xbff3('0x3a')](function(_0x1703fa){if(_0x1703fa){return{'count':_0x1703fa['count'],'rows':_[_0xbff3('0x41')](_0x1703fa[_0xbff3('0x58')],function(_0x2b734f){return{'membername':_0x2b734f[_0xbff3('0x3f')],'UserId':_0x2b734f['id'],'queue_name':_0x2de31c['name'],'ChatQueueId':_0x2de31c['id'],'interface':util[_0xbff3('0x74')](_0xbff3('0x75'),_0xbff3('0x76'),_0x2b734f['name']),'penalty':0x0,'paused':_0x2b734f['chatPause'],'createdAt':_0x2b734f[_0xbff3('0x73')],'updatedAt':_0x2b734f[_0xbff3('0x72')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbff3('0x3a')](respondWithFilteredResult(_0x15d4e2,_0x503013))[_0xbff3('0x2d')](handleError(_0x15d4e2,null));};exports[_0xbff3('0x77')]=function(_0x2ca808,_0x10823d,_0x15ae2e){var _0x83729={};var _0x34e37f={};var _0x6666b8;var _0x1a7a19;return db['ChatQueue'][_0xbff3('0x69')]({'where':{'id':_0x2ca808['params']['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x10823d,null))[_0xbff3('0x3a')](function(_0xc2b5dd){if(_0xc2b5dd){_0x6666b8=_0xc2b5dd;_0x34e37f[_0xbff3('0x47')]=_[_0xbff3('0x5a')](db[_0xbff3('0x78')]['rawAttributes']);_0x34e37f[_0xbff3('0x48')]=_['keys'](_0x2ca808['query']);_0x34e37f[_0xbff3('0x49')]=_['intersection'](_0x34e37f['model'],_0x34e37f[_0xbff3('0x48')]);_0x83729[_0xbff3('0x4a')]=_[_0xbff3('0x4b')](_0x34e37f[_0xbff3('0x47')],qs[_0xbff3('0x4c')](_0x2ca808[_0xbff3('0x48')][_0xbff3('0x4c')]));_0x83729['attributes']=_0x83729['attributes'][_0xbff3('0x6a')]?_0x83729[_0xbff3('0x4a')]:_0x34e37f[_0xbff3('0x47')];_0x83729[_0xbff3('0x4e')]=qs[_0xbff3('0x4f')](_0x2ca808[_0xbff3('0x48')][_0xbff3('0x4f')]);_0x83729[_0xbff3('0x52')]=qs[_0xbff3('0x49')](_[_0xbff3('0x50')](_0x2ca808['query'],_0x34e37f[_0xbff3('0x49')]));if(_0x2ca808[_0xbff3('0x48')][_0xbff3('0x53')]){_0x83729['where']=_[_0xbff3('0x51')](_0x83729[_0xbff3('0x52')],{'$or':_[_0xbff3('0x41')](_0x83729[_0xbff3('0x4a')],function(_0x33a9c3){var _0x1bf954={};_0x1bf954[_0x33a9c3]={'$like':'%'+_0x2ca808[_0xbff3('0x48')][_0xbff3('0x53')]+'%'};return _0x1bf954;})});}_0x83729=_[_0xbff3('0x51')]({},_0x83729,_0x2ca808[_0xbff3('0x54')]);return _0x6666b8[_0xbff3('0x77')](_0x83729);}})[_0xbff3('0x3a')](function(_0xb4cd2c){if(_0xb4cd2c){_0x1a7a19=_0xb4cd2c[_0xbff3('0x6a')];if(!_0x2ca808['query']['hasOwnProperty'](_0xbff3('0x6b'))){_0x83729['limit']=qs[_0xbff3('0x33')](_0x2ca808[_0xbff3('0x48')]['limit']);_0x83729['offset']=qs[_0xbff3('0x32')](_0x2ca808['query'][_0xbff3('0x32')]);}return _0x6666b8[_0xbff3('0x77')](_0x83729);}})[_0xbff3('0x3a')](function(_0x206c95){if(_0x206c95){return _0x206c95?{'count':_0x1a7a19,'rows':_0x206c95}:null;}})[_0xbff3('0x3a')](respondWithResult(_0x10823d,null))[_0xbff3('0x2d')](handleError(_0x10823d,null));};exports['addTeams']=function(_0x3f63ee,_0x55ab77,_0x122dcf){var _0x2ea14f=_0x3f63ee[_0xbff3('0x65')][_0xbff3('0x79')];return db[_0xbff3('0x78')][_0xbff3('0x57')]({'where':{'id':_0x2ea14f},'attributes':['id'],'include':[{'model':db[_0xbff3('0x6e')],'as':_0xbff3('0x7a'),'attributes':['id',_0xbff3('0x3f'),_0xbff3('0x7b'),_0xbff3('0x7c'),_0xbff3('0x7d')],'raw':!![]}]})['then'](function(_0xbd087d){if(_0xbd087d){var _0x3208ec=_[_0xbff3('0x7e')](_0xbd087d,function(_0x4c462b){var _0x55a168=_0x4c462b[_0xbff3('0x3c')]({'plain':!![]});return _0x55a168[_0xbff3('0x7a')];});return db[_0xbff3('0x42')][_0xbff3('0x5b')]({'where':{'id':_0x3f63ee[_0xbff3('0x66')]['id']}})['then'](function(_0x57894e){return db['sequelize']['transaction'](function(_0x4b57c0){return _0x57894e['addTeams'](_0x2ea14f,{'transaction':_0x4b57c0})[_0xbff3('0x3a')](function(){return BPromise[_0xbff3('0x7f')](_0x3208ec,function(_0x4ba455){return db[_0xbff3('0x6d')]['findOrCreate']({'where':{'UserId':_0x4ba455['id'],'ChatQueueId':_0x3f63ee['params']['id']},'transaction':_0x4b57c0});});})['then'](function(){_0x3208ec[_0xbff3('0x80')](function(_0x111de9){socket[_0xbff3('0x81')](_0xbff3('0x82'),{'UserId':_0x111de9['id'],'ChatQueueId':_0x57894e['id']});});});});});}})['then'](respondWithStatusCode(_0x55ab77,null))[_0xbff3('0x2d')](handleError(_0x55ab77,null));};exports[_0xbff3('0x83')]=function(_0xf079de,_0x3ad5c4,_0x5504cc){return db['Team'][_0xbff3('0x57')]({'where':{'id':_0xf079de[_0xbff3('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbff3('0x6e')],'as':_0xbff3('0x7a'),'attributes':['id'],'raw':!![]}]})[_0xbff3('0x3a')](handleEntityNotFound(_0x3ad5c4,null))[_0xbff3('0x3a')](function(_0x446489){var _0x402b36=_[_0xbff3('0x41')](_0x446489,'id');var _0xa7130=[];var _0x54514a=[];var _0x1ba6c3=squel['select']();_0x1ba6c3[_0xbff3('0x84')](_0xbff3('0x85'))[_0xbff3('0x86')]('team_has_chat_queues','tq')[_0xbff3('0x87')](_0xbff3('0x88'),'ut',_0xbff3('0x89'))[_0xbff3('0x52')]('ChatQueueId\x20=\x20?',_0xf079de['params']['id']);for(var _0x172247=0x0;_0x172247<_0x446489[_0xbff3('0x6a')];_0x172247+=0x1){let _0x8f10a4=_0x446489[_0x172247];for(var _0x2db7c2=0x0;_0x2db7c2<_0x8f10a4[_0xbff3('0x7a')]['length'];_0x2db7c2+=0x1){let _0x4d818c=_0x8f10a4[_0xbff3('0x7a')][_0x2db7c2];var _0x2b8714=_0x1ba6c3['clone']();_0x2b8714['where'](_0xbff3('0x8a'),_0x4d818c['id']);_0x54514a[_0xbff3('0x8b')](db[_0xbff3('0x8c')]['query'](_0x2b8714[_0xbff3('0x8d')](),{'type':db['sequelize'][_0xbff3('0x8e')][_0xbff3('0x8f')]})[_0xbff3('0x3a')](function(_0x2d9895){if(_0x2d9895[_0xbff3('0x6a')]===0x1){return _0x4d818c['id'];}else{var _0x147ce6=_[_0xbff3('0x90')](_[_0xbff3('0x41')](_0x2d9895,_0xbff3('0x91')),function(_0x483327){return _['includes'](_0x402b36,_0x483327);});if(_0x147ce6){return _0x4d818c['id'];}}}));}}return BPromise['all'](_0x54514a)['then'](function(_0x3a295b){_0xa7130=_(_0xa7130)['union'](_0x3a295b)['compact']()['value']();return db[_0xbff3('0x42')][_0xbff3('0x5b')]({'where':{'id':_0xf079de[_0xbff3('0x66')]['id']}})['then'](function(_0x5f2939){return db['sequelize'][_0xbff3('0x92')](function(_0x107aa2){return _0x5f2939[_0xbff3('0x83')](_0xf079de['query'][_0xbff3('0x79')],{'transaction':_0x107aa2})[_0xbff3('0x3a')](function(){if(!_[_0xbff3('0x93')](_0xa7130)){return _0x5f2939['removeAgents'](_0xa7130,{'transaction':_0x107aa2});}})[_0xbff3('0x3a')](function(){_0xa7130[_0xbff3('0x80')](function(_0x2eeb77){socket[_0xbff3('0x81')](_0xbff3('0x94'),{'UserId':_0x2eeb77,'ChatQueueId':_0x5f2939['id']});});});});});});})['then'](respondWithStatusCode(_0x3ad5c4,null))['catch'](handleError(_0x3ad5c4,null));};exports['addAgents']=function(_0x2df7f5,_0x3e72bf,_0x1f6bf1){return db[_0xbff3('0x42')][_0xbff3('0x5b')]({'where':{'id':_0x2df7f5[_0xbff3('0x66')]['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x3e72bf,null))['then'](function(_0x5820d7){if(_0x5820d7){return _0x5820d7[_0xbff3('0x95')](_0x2df7f5[_0xbff3('0x65')][_0xbff3('0x79')],_[_0xbff3('0x96')](_0x2df7f5[_0xbff3('0x65')],['ids','id'])||{})[_0xbff3('0x97')](function(_0x375f9a){for(var _0x594241=0x0;_0x594241<_0x2df7f5[_0xbff3('0x65')][_0xbff3('0x79')][_0xbff3('0x6a')];_0x594241+=0x1){socket[_0xbff3('0x81')]('userChatQueue:save',{'UserId':Number(_0x2df7f5[_0xbff3('0x65')]['ids'][_0x594241]),'ChatQueueId':Number(_0x2df7f5[_0xbff3('0x66')]['id'])});}return _0x375f9a;});}})[_0xbff3('0x3a')](respondWithResult(_0x3e72bf,null))[_0xbff3('0x2d')](handleError(_0x3e72bf,null));};exports[_0xbff3('0x98')]=function(_0x2e636a,_0x1c6323,_0x2f554a){return db['ChatQueue'][_0xbff3('0x5b')]({'where':{'id':_0x2e636a[_0xbff3('0x66')]['id']}})['then'](handleEntityNotFound(_0x1c6323,null))[_0xbff3('0x3a')](function(_0x15fd4d){if(_0x15fd4d){return _0x15fd4d[_0xbff3('0x98')](_0x2e636a['query'][_0xbff3('0x79')])[_0xbff3('0x3a')](function(){if(_['isArray'](_0x2e636a['query'][_0xbff3('0x79')])){for(var _0x55c5e6=0x0;_0x55c5e6<_0x2e636a[_0xbff3('0x48')][_0xbff3('0x79')]['length'];_0x55c5e6+=0x1){socket['emit'](_0xbff3('0x94'),{'UserId':Number(_0x2e636a['query']['ids'][_0x55c5e6]),'ChatQueueId':Number(_0x2e636a['params']['id'])});}}else{socket[_0xbff3('0x81')]('userChatQueue:remove',{'UserId':Number(_0x2e636a[_0xbff3('0x48')][_0xbff3('0x79')]),'ChatQueueId':Number(_0x2e636a['params']['id'])});}});}})[_0xbff3('0x3a')](respondWithStatusCode(_0x1c6323,null))[_0xbff3('0x2d')](handleError(_0x1c6323,null));};exports[_0xbff3('0x99')]=function(_0x1793f1,_0x5842fc,_0x572966){var _0x88d434={};var _0xf6ccab={};var _0x5c2209;var _0x37a3e6;return db[_0xbff3('0x42')][_0xbff3('0x69')]({'where':{'id':_0x1793f1[_0xbff3('0x66')]['id']}})[_0xbff3('0x3a')](handleEntityNotFound(_0x5842fc,null))[_0xbff3('0x3a')](function(_0x22a0a3){if(_0x22a0a3){_0x5c2209=_0x22a0a3;_0xf6ccab[_0xbff3('0x47')]=_['keys'](db[_0xbff3('0x6e')]['rawAttributes']);_0xf6ccab['query']=_[_0xbff3('0x5a')](_0x1793f1[_0xbff3('0x48')]);_0xf6ccab[_0xbff3('0x49')]=_['intersection'](_0xf6ccab[_0xbff3('0x47')],_0xf6ccab[_0xbff3('0x48')]);_0x88d434['attributes']=_[_0xbff3('0x4b')](_0xf6ccab[_0xbff3('0x47')],qs[_0xbff3('0x4c')](_0x1793f1[_0xbff3('0x48')]['fields']));_0x88d434[_0xbff3('0x4a')]=_0x88d434[_0xbff3('0x4a')][_0xbff3('0x6a')]?_0x88d434[_0xbff3('0x4a')]:_0xf6ccab[_0xbff3('0x47')];_0x88d434[_0xbff3('0x4e')]=qs[_0xbff3('0x4f')](_0x1793f1[_0xbff3('0x48')][_0xbff3('0x4f')]);_0x88d434[_0xbff3('0x52')]=qs['filters'](_[_0xbff3('0x50')](_0x1793f1[_0xbff3('0x48')],_0xf6ccab[_0xbff3('0x49')]));if(_0x1793f1[_0xbff3('0x48')][_0xbff3('0x53')]){_0x88d434[_0xbff3('0x52')]=_[_0xbff3('0x51')](_0x88d434['where'],{'$or':_[_0xbff3('0x41')](_0x88d434[_0xbff3('0x4a')],function(_0x57083c){var _0x3dfc90={};_0x3dfc90[_0x57083c]={'$like':'%'+_0x1793f1[_0xbff3('0x48')][_0xbff3('0x53')]+'%'};return _0x3dfc90;})});}_0x88d434=_[_0xbff3('0x51')]({},_0x88d434,_0x1793f1['options']);return _0x5c2209['getAgents'](_0x88d434);}})[_0xbff3('0x3a')](function(_0x2693b3){if(_0x2693b3){_0x37a3e6=_0x2693b3[_0xbff3('0x6a')];if(!_0x1793f1[_0xbff3('0x48')][_0xbff3('0x4d')]('nolimit')){_0x88d434['limit']=qs['limit'](_0x1793f1[_0xbff3('0x48')][_0xbff3('0x33')]);_0x88d434['offset']=qs[_0xbff3('0x32')](_0x1793f1[_0xbff3('0x48')][_0xbff3('0x32')]);}return _0x5c2209['getAgents'](_0x88d434);}})[_0xbff3('0x3a')](function(_0x2a36d1){if(_0x2a36d1){return _0x2a36d1?{'count':_0x37a3e6,'rows':_0x2a36d1}:null;}})[_0xbff3('0x3a')](respondWithResult(_0x5842fc,null))[_0xbff3('0x2d')](handleError(_0x5842fc,null));};
\ No newline at end of file
+var _0x7ecf=['fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','get','UserChatQueue','pick','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','%s/%s','SIP','chatPause','createdAt','Team','getTeams','addTeams','ids','findAll','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','ChatQueues','UserProfileResource','destroy','end','stack','name','send','index','ChatQueue','rawAttributes'];(function(_0x9e4910,_0x5a6fbf){var _0x4be283=function(_0x13c68f){while(--_0x13c68f){_0x9e4910['push'](_0x9e4910['shift']());}};_0x4be283(++_0x5a6fbf);}(_0x7ecf,0xfa));var _0xf7ec=function(_0x46956b,_0x2c500f){_0x46956b=_0x46956b-0x0;var _0x2756bb=_0x7ecf[_0x46956b];return _0x2756bb;};'use strict';var emlformat=require(_0xf7ec('0x0'));var rimraf=require(_0xf7ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7ec('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7ec('0x3'));var Mustache=require(_0xf7ec('0x4'));var util=require(_0xf7ec('0x5'));var path=require('path');var sox=require(_0xf7ec('0x6'));var csv=require(_0xf7ec('0x7'));var ejs=require(_0xf7ec('0x8'));var fs=require('fs');var fs_extra=require(_0xf7ec('0x9'));var _=require(_0xf7ec('0xa'));var squel=require('squel');var crypto=require(_0xf7ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf7ec('0xc'));var toCsv=require(_0xf7ec('0x7'));var querystring=require(_0xf7ec('0xd'));var Papa=require(_0xf7ec('0xe'));var Redis=require(_0xf7ec('0xf'));var authService=require(_0xf7ec('0x10'));var qs=require(_0xf7ec('0x11'));var as=require(_0xf7ec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7ec('0x13'))(_0xf7ec('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7ec('0x15'));var db=require(_0xf7ec('0x16'))['db'];config[_0xf7ec('0x17')]=_[_0xf7ec('0x18')](config['redis'],{'host':_0xf7ec('0x19'),'port':0x18eb});var socket=require(_0xf7ec('0x1a'))(new Redis(config[_0xf7ec('0x17')]));require(_0xf7ec('0x1b'))[_0xf7ec('0x1c')](socket);var jayson=require(_0xf7ec('0x1d'));var client=jayson[_0xf7ec('0x1e')][_0xf7ec('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x7c3ebd,_0x318863,_0x22a4bb,_0x50cad2){return new BPromise(function(_0x1e24dd,_0x466bd5){var _0x18b940=_0x50cad2||client;return _0x18b940[_0xf7ec('0x20')](_0x7c3ebd,_0x22a4bb)[_0xf7ec('0x21')](function(_0x21ee45){logger[_0xf7ec('0x22')](_0xf7ec('0x23'),_0x318863,_0xf7ec('0x24'));logger[_0xf7ec('0x25')](_0xf7ec('0x26'),_0x318863,_0xf7ec('0x24'),JSON[_0xf7ec('0x27')](_0x21ee45));if(_0x21ee45[_0xf7ec('0x28')]){if(_0x21ee45['error'][_0xf7ec('0x29')]===0x1f4){logger[_0xf7ec('0x28')](_0xf7ec('0x23'),_0x318863,_0x21ee45[_0xf7ec('0x28')][_0xf7ec('0x2a')]);return _0x466bd5(_0x21ee45[_0xf7ec('0x28')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x318863,_0x21ee45[_0xf7ec('0x28')][_0xf7ec('0x2a')]);return _0x1e24dd(_0x21ee45['error'][_0xf7ec('0x2a')]);}else{logger[_0xf7ec('0x22')](_0xf7ec('0x23'),_0x318863,_0xf7ec('0x24'));_0x1e24dd(_0x21ee45[_0xf7ec('0x2b')]['message']);}})[_0xf7ec('0x2c')](function(_0x1dbb18){logger[_0xf7ec('0x28')](_0xf7ec('0x23'),_0x318863,_0x1dbb18);_0x466bd5(_0x1dbb18);});});}function respondWithStatusCode(_0x5b5200,_0x2c8edf){_0x2c8edf=_0x2c8edf||0xcc;return function(_0x23fe7b){if(_0x23fe7b){return _0x5b5200[_0xf7ec('0x2d')](_0x2c8edf);}return _0x5b5200[_0xf7ec('0x2e')](_0x2c8edf)['end']();};}function respondWithResult(_0x33bb23,_0x141603){_0x141603=_0x141603||0xc8;return function(_0xcb7e52){if(_0xcb7e52){return _0x33bb23['status'](_0x141603)['json'](_0xcb7e52);}};}function respondWithFilteredResult(_0x1ff34b,_0x4ce0f4){return function(_0x570ea7){if(_0x570ea7){var _0x151e96=typeof _0x4ce0f4[_0xf7ec('0x2f')]===_0xf7ec('0x30')&&typeof _0x4ce0f4[_0xf7ec('0x31')]===_0xf7ec('0x30');var _0x2f8af6=_0x570ea7['count'];var _0x181d45=_0x151e96?0x0:_0x4ce0f4['offset'];var _0x4f1084=_0x151e96?_0x570ea7[_0xf7ec('0x32')]:_0x4ce0f4['offset']+_0x4ce0f4[_0xf7ec('0x31')];var _0x6621bb;if(_0x4f1084>=_0x2f8af6){_0x4f1084=_0x2f8af6;_0x6621bb=0xc8;}else{_0x6621bb=0xce;}_0x1ff34b[_0xf7ec('0x2e')](_0x6621bb);return _0x1ff34b['set'](_0xf7ec('0x33'),_0x181d45+'-'+_0x4f1084+'/'+_0x2f8af6)['json'](_0x570ea7);}return null;};}function patchUpdates(_0x5044e4){return function(_0x106046){try{jsonpatch[_0xf7ec('0x34')](_0x106046,_0x5044e4,!![]);}catch(_0x57985b){return BPromise['reject'](_0x57985b);}return _0x106046[_0xf7ec('0x35')]();};}function saveUpdates(_0x4ee293,_0x2ed2d2){return function(_0x42d729){if(_0x42d729){return _0x42d729['update'](_0x4ee293)[_0xf7ec('0x21')](function(_0x3cc1ea){return _0x3cc1ea;});}return null;};}function removeEntity(_0x5ca126,_0x16c290){return function(_0x329740){if(_0x329740){return _0x329740['destroy']()[_0xf7ec('0x21')](function(){var _0x15ce83=_0x329740['get']({'plain':!![]});var _0x3bd085=_0xf7ec('0x36');return db[_0xf7ec('0x37')][_0xf7ec('0x38')]({'where':{'type':_0x3bd085,'resourceId':_0x15ce83['id']}})['then'](function(){return _0x329740;});})[_0xf7ec('0x21')](function(){_0x5ca126['status'](0xcc)[_0xf7ec('0x39')]();});}};}function handleEntityNotFound(_0x2b1e8c,_0x513bb0){return function(_0x3b2707){if(!_0x3b2707){_0x2b1e8c[_0xf7ec('0x2d')](0x194);}return _0x3b2707;};}function handleError(_0xf93586,_0x4264e3){_0x4264e3=_0x4264e3||0x1f4;return function(_0x40089b){logger[_0xf7ec('0x28')](_0x40089b[_0xf7ec('0x3a')]);if(_0x40089b[_0xf7ec('0x3b')]){delete _0x40089b[_0xf7ec('0x3b')];}_0xf93586[_0xf7ec('0x2e')](_0x4264e3)[_0xf7ec('0x3c')](_0x40089b);};}exports[_0xf7ec('0x3d')]=function(_0x46a9ca,_0x4b61ba){var _0x590efb={},_0x52bb3f={},_0x2c40e2={'count':0x0,'rows':[]};var _0x4c4c05=_['map'](db[_0xf7ec('0x3e')][_0xf7ec('0x3f')],function(_0x3ab470){return{'name':_0x3ab470[_0xf7ec('0x40')],'type':_0x3ab470['type'][_0xf7ec('0x41')]};});_0x52bb3f[_0xf7ec('0x42')]=_[_0xf7ec('0x43')](_0x4c4c05,'name');_0x52bb3f[_0xf7ec('0x44')]=_[_0xf7ec('0x45')](_0x46a9ca['query']);_0x52bb3f['filters']=_[_0xf7ec('0x46')](_0x52bb3f[_0xf7ec('0x42')],_0x52bb3f[_0xf7ec('0x44')]);_0x590efb['attributes']=_[_0xf7ec('0x46')](_0x52bb3f[_0xf7ec('0x42')],qs[_0xf7ec('0x47')](_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x47')]));_0x590efb[_0xf7ec('0x48')]=_0x590efb['attributes'][_0xf7ec('0x49')]?_0x590efb['attributes']:_0x52bb3f[_0xf7ec('0x42')];if(!_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x4a')](_0xf7ec('0x4b'))){_0x590efb['limit']=qs[_0xf7ec('0x31')](_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x31')]);_0x590efb[_0xf7ec('0x2f')]=qs[_0xf7ec('0x2f')](_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x2f')]);}_0x590efb[_0xf7ec('0x4c')]=qs[_0xf7ec('0x4d')](_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x4d')]);_0x590efb[_0xf7ec('0x4e')]=qs['filters'](_['pick'](_0x46a9ca[_0xf7ec('0x44')],_0x52bb3f[_0xf7ec('0x4f')]),_0x4c4c05);if(_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x50')]){_0x590efb[_0xf7ec('0x4e')]=_['merge'](_0x590efb[_0xf7ec('0x4e')],{'$or':_['map'](_0x4c4c05,function(_0x42ffe2){if(_0x42ffe2['type']!==_0xf7ec('0x51')){var _0xda07f6={};_0xda07f6[_0x42ffe2[_0xf7ec('0x3b')]]={'$like':'%'+_0x46a9ca[_0xf7ec('0x44')]['filter']+'%'};return _0xda07f6;}})});}_0x590efb=_[_0xf7ec('0x52')]({},_0x590efb,_0x46a9ca[_0xf7ec('0x53')]);var _0x44caf0={'where':_0x590efb[_0xf7ec('0x4e')]};return db[_0xf7ec('0x3e')][_0xf7ec('0x32')](_0x44caf0)['then'](function(_0x1ceb88){_0x2c40e2['count']=_0x1ceb88;if(_0x46a9ca[_0xf7ec('0x44')][_0xf7ec('0x54')]){_0x590efb[_0xf7ec('0x55')]=[{'all':!![]}];}return db[_0xf7ec('0x3e')]['findAll'](_0x590efb);})[_0xf7ec('0x21')](function(_0x4636a4){_0x2c40e2[_0xf7ec('0x56')]=_0x4636a4;return _0x2c40e2;})[_0xf7ec('0x21')](respondWithFilteredResult(_0x4b61ba,_0x590efb))[_0xf7ec('0x2c')](handleError(_0x4b61ba,null));};exports[_0xf7ec('0x57')]=function(_0x2f2bbb,_0x5ee2b4){var _0x1aee36={'raw':!![],'where':{'id':_0x2f2bbb[_0xf7ec('0x58')]['id']}},_0x36345d={};_0x36345d[_0xf7ec('0x42')]=_['keys'](db['ChatQueue'][_0xf7ec('0x3f')]);_0x36345d[_0xf7ec('0x44')]=_['keys'](_0x2f2bbb[_0xf7ec('0x44')]);_0x36345d[_0xf7ec('0x4f')]=_['intersection'](_0x36345d['model'],_0x36345d[_0xf7ec('0x44')]);_0x1aee36[_0xf7ec('0x48')]=_[_0xf7ec('0x46')](_0x36345d['model'],qs['fields'](_0x2f2bbb[_0xf7ec('0x44')][_0xf7ec('0x47')]));_0x1aee36[_0xf7ec('0x48')]=_0x1aee36[_0xf7ec('0x48')]['length']?_0x1aee36[_0xf7ec('0x48')]:_0x36345d[_0xf7ec('0x42')];if(_0x2f2bbb[_0xf7ec('0x44')][_0xf7ec('0x54')]){_0x1aee36['include']=[{'all':!![]}];}_0x1aee36=_['merge']({},_0x1aee36,_0x2f2bbb[_0xf7ec('0x53')]);return db['ChatQueue']['find'](_0x1aee36)[_0xf7ec('0x21')](handleEntityNotFound(_0x5ee2b4,null))[_0xf7ec('0x21')](respondWithResult(_0x5ee2b4,null))[_0xf7ec('0x2c')](handleError(_0x5ee2b4,null));};exports[_0xf7ec('0x59')]=function(_0x7d51cc,_0x330abf){return db[_0xf7ec('0x3e')][_0xf7ec('0x59')](_0x7d51cc[_0xf7ec('0x5a')],{})[_0xf7ec('0x21')](function(_0x4c0ae3){var _0x27689e=_0x7d51cc[_0xf7ec('0x5b')]['get']({'plain':!![]});if(!_0x27689e)throw new Error(_0xf7ec('0x5c'));if(_0x27689e['role']===_0xf7ec('0x5b')){var _0xb2eb39=_0x4c0ae3['get']({'plain':!![]});var _0x132fc7=_0xf7ec('0x36');return db[_0xf7ec('0x5d')][_0xf7ec('0x5e')]({'where':{'name':_0x132fc7,'userProfileId':_0x27689e[_0xf7ec('0x5f')]},'raw':!![]})[_0xf7ec('0x21')](function(_0x3f90d4){if(_0x3f90d4&&_0x3f90d4[_0xf7ec('0x60')]===0x0){return db[_0xf7ec('0x37')][_0xf7ec('0x59')]({'name':_0xb2eb39[_0xf7ec('0x3b')],'resourceId':_0xb2eb39['id'],'type':_0x3f90d4[_0xf7ec('0x3b')],'sectionId':_0x3f90d4['id']},{})[_0xf7ec('0x21')](function(){return _0x4c0ae3;});}else{return _0x4c0ae3;}})[_0xf7ec('0x2c')](function(_0x5566ef){logger[_0xf7ec('0x28')](_0xf7ec('0x61'),_0x5566ef);throw _0x5566ef;});}return _0x4c0ae3;})[_0xf7ec('0x21')](respondWithResult(_0x330abf,0xc9))[_0xf7ec('0x2c')](handleError(_0x330abf,null));};exports[_0xf7ec('0x62')]=function(_0x2653ba,_0x408b36){if(_0x2653ba[_0xf7ec('0x5a')]['id']){delete _0x2653ba[_0xf7ec('0x5a')]['id'];}return db[_0xf7ec('0x3e')][_0xf7ec('0x5e')]({'where':{'id':_0x2653ba[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x408b36,null))[_0xf7ec('0x21')](saveUpdates(_0x2653ba[_0xf7ec('0x5a')],null))['then'](respondWithResult(_0x408b36,null))[_0xf7ec('0x2c')](handleError(_0x408b36,null));};exports[_0xf7ec('0x38')]=function(_0x26f906,_0x1eae1f){return db[_0xf7ec('0x3e')]['find']({'where':{'id':_0x26f906[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x1eae1f,null))[_0xf7ec('0x21')](removeEntity(_0x1eae1f,null))[_0xf7ec('0x2c')](handleError(_0x1eae1f,null));};exports[_0xf7ec('0x63')]=function(_0x3796a9,_0x2d0d8e){return db['ChatQueue'][_0xf7ec('0x63')]()[_0xf7ec('0x21')](respondWithResult(_0x2d0d8e,null))['catch'](handleError(_0x2d0d8e,null));};exports[_0xf7ec('0x64')]=function(_0x14fb4f,_0x4a78e5,_0xedd1b1){var _0x205e64={'raw':!![],'where':{}},_0x44392e={},_0x2e8aa0;return db['ChatQueue'][_0xf7ec('0x65')]({'where':{'id':_0x14fb4f[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x4a78e5,null))[_0xf7ec('0x21')](function(_0x28b79e){if(_0x28b79e){_0x2e8aa0=_0x28b79e[_0xf7ec('0x66')]({'plain':!![]});_0x44392e[_0xf7ec('0x42')]=_[_0xf7ec('0x45')](db[_0xf7ec('0x67')][_0xf7ec('0x3f')]);_0x44392e[_0xf7ec('0x44')]=_[_0xf7ec('0x45')](_0x14fb4f[_0xf7ec('0x44')]);_0x44392e[_0xf7ec('0x4f')]=_['intersection'](_0x44392e[_0xf7ec('0x42')],_0x44392e[_0xf7ec('0x44')]);_0x205e64['attributes']=_[_0xf7ec('0x46')](_0x44392e['model'],qs['fields'](_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x47')]));_0x205e64[_0xf7ec('0x48')]=_0x205e64[_0xf7ec('0x48')][_0xf7ec('0x49')]?_0x205e64[_0xf7ec('0x48')]:_0x44392e[_0xf7ec('0x42')];if(!_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x4a')]('nolimit')){_0x205e64[_0xf7ec('0x31')]=qs[_0xf7ec('0x31')](_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x31')]);_0x205e64[_0xf7ec('0x2f')]=qs[_0xf7ec('0x2f')](_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x2f')]);}_0x205e64[_0xf7ec('0x4c')]=qs[_0xf7ec('0x4d')](_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x4d')]);_0x205e64[_0xf7ec('0x4e')]=qs['filters'](_[_0xf7ec('0x68')](_0x14fb4f[_0xf7ec('0x44')],_0x44392e[_0xf7ec('0x4f')]));_0x205e64['where'][_0xf7ec('0x69')]=_0x28b79e['id'];if(_0x14fb4f[_0xf7ec('0x44')]['filter']){_0x205e64['where']=_[_0xf7ec('0x52')](_0x205e64[_0xf7ec('0x4e')],{'$or':_['map'](_0x205e64[_0xf7ec('0x48')],function(_0x1ac539){var _0x4206df={};_0x4206df[_0x1ac539]={'$like':'%'+_0x14fb4f[_0xf7ec('0x44')][_0xf7ec('0x50')]+'%'};return _0x4206df;})});}_0x205e64=_[_0xf7ec('0x52')]({},_0x205e64,_0x14fb4f['options']);return db[_0xf7ec('0x67')]['findAll'](_0x205e64);}})[_0xf7ec('0x21')](function(_0x45ca91){if(_0x45ca91){return db[_0xf7ec('0x6a')][_0xf7ec('0x6b')]({'where':{'id':_[_0xf7ec('0x43')](_0x45ca91,_0xf7ec('0x6c')),'role':_0xf7ec('0x6d')},'attributes':['id',_0xf7ec('0x3b'),'chatPause',_0xf7ec('0x6e'),'createdAt']});}})['then'](function(_0x11a295){if(_0x11a295){return{'count':_0x11a295[_0xf7ec('0x32')],'rows':_[_0xf7ec('0x43')](_0x11a295[_0xf7ec('0x56')],function(_0x37ef70){return{'membername':_0x37ef70['name'],'UserId':_0x37ef70['id'],'queue_name':_0x2e8aa0[_0xf7ec('0x3b')],'ChatQueueId':_0x2e8aa0['id'],'interface':util['format'](_0xf7ec('0x6f'),_0xf7ec('0x70'),_0x37ef70[_0xf7ec('0x3b')]),'penalty':0x0,'paused':_0x37ef70[_0xf7ec('0x71')],'createdAt':_0x37ef70[_0xf7ec('0x72')],'updatedAt':_0x37ef70[_0xf7ec('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf7ec('0x21')](respondWithFilteredResult(_0x4a78e5,_0x205e64))['catch'](handleError(_0x4a78e5,null));};exports['getTeams']=function(_0x3db6a7,_0x416403,_0x491cee){var _0x118424={};var _0x146786={};var _0x424387;var _0x167cf0;return db['ChatQueue']['findOne']({'where':{'id':_0x3db6a7['params']['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x416403,null))[_0xf7ec('0x21')](function(_0x17bc88){if(_0x17bc88){_0x424387=_0x17bc88;_0x146786['model']=_['keys'](db[_0xf7ec('0x73')]['rawAttributes']);_0x146786['query']=_[_0xf7ec('0x45')](_0x3db6a7['query']);_0x146786[_0xf7ec('0x4f')]=_['intersection'](_0x146786['model'],_0x146786[_0xf7ec('0x44')]);_0x118424[_0xf7ec('0x48')]=_['intersection'](_0x146786['model'],qs[_0xf7ec('0x47')](_0x3db6a7['query']['fields']));_0x118424[_0xf7ec('0x48')]=_0x118424['attributes'][_0xf7ec('0x49')]?_0x118424[_0xf7ec('0x48')]:_0x146786[_0xf7ec('0x42')];_0x118424[_0xf7ec('0x4c')]=qs[_0xf7ec('0x4d')](_0x3db6a7[_0xf7ec('0x44')][_0xf7ec('0x4d')]);_0x118424['where']=qs[_0xf7ec('0x4f')](_['pick'](_0x3db6a7[_0xf7ec('0x44')],_0x146786[_0xf7ec('0x4f')]));if(_0x3db6a7[_0xf7ec('0x44')][_0xf7ec('0x50')]){_0x118424['where']=_['merge'](_0x118424[_0xf7ec('0x4e')],{'$or':_[_0xf7ec('0x43')](_0x118424[_0xf7ec('0x48')],function(_0x3ead3f){var _0x110b78={};_0x110b78[_0x3ead3f]={'$like':'%'+_0x3db6a7['query'][_0xf7ec('0x50')]+'%'};return _0x110b78;})});}_0x118424=_[_0xf7ec('0x52')]({},_0x118424,_0x3db6a7[_0xf7ec('0x53')]);return _0x424387[_0xf7ec('0x74')](_0x118424);}})[_0xf7ec('0x21')](function(_0x1ffc00){if(_0x1ffc00){_0x167cf0=_0x1ffc00['length'];if(!_0x3db6a7[_0xf7ec('0x44')][_0xf7ec('0x4a')](_0xf7ec('0x4b'))){_0x118424['limit']=qs[_0xf7ec('0x31')](_0x3db6a7[_0xf7ec('0x44')][_0xf7ec('0x31')]);_0x118424[_0xf7ec('0x2f')]=qs[_0xf7ec('0x2f')](_0x3db6a7[_0xf7ec('0x44')][_0xf7ec('0x2f')]);}return _0x424387[_0xf7ec('0x74')](_0x118424);}})['then'](function(_0x3d24ab){if(_0x3d24ab){return _0x3d24ab?{'count':_0x167cf0,'rows':_0x3d24ab}:null;}})[_0xf7ec('0x21')](respondWithResult(_0x416403,null))[_0xf7ec('0x2c')](handleError(_0x416403,null));};exports[_0xf7ec('0x75')]=function(_0x43d8d7,_0x512f17,_0x42af5f){var _0x3831a0=_0x43d8d7['body'][_0xf7ec('0x76')];return db[_0xf7ec('0x73')][_0xf7ec('0x77')]({'where':{'id':_0x3831a0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf7ec('0x78'),'attributes':['id','name','online',_0xf7ec('0x79'),_0xf7ec('0x7a')],'raw':!![]}]})[_0xf7ec('0x21')](function(_0x547504){if(_0x547504){var _0x413547=_[_0xf7ec('0x7b')](_0x547504,function(_0x661f29){var _0x5f0ddb=_0x661f29[_0xf7ec('0x66')]({'plain':!![]});return _0x5f0ddb['Agents'];});return db[_0xf7ec('0x3e')][_0xf7ec('0x5e')]({'where':{'id':_0x43d8d7[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](function(_0x44dc3e){return db[_0xf7ec('0x7c')][_0xf7ec('0x7d')](function(_0x36f92a){return _0x44dc3e[_0xf7ec('0x75')](_0x3831a0,{'transaction':_0x36f92a})[_0xf7ec('0x21')](function(){return BPromise['each'](_0x413547,function(_0x23028e){return db[_0xf7ec('0x67')][_0xf7ec('0x7e')]({'where':{'UserId':_0x23028e['id'],'ChatQueueId':_0x43d8d7['params']['id']},'transaction':_0x36f92a});});})[_0xf7ec('0x21')](function(){_0x413547[_0xf7ec('0x7f')](function(_0x1796f4){socket[_0xf7ec('0x80')]('userChatQueue:save',{'UserId':_0x1796f4['id'],'ChatQueueId':_0x44dc3e['id']});});});});});}})['then'](respondWithStatusCode(_0x512f17,null))[_0xf7ec('0x2c')](handleError(_0x512f17,null));};exports[_0xf7ec('0x81')]=function(_0x169a1a,_0x1fc188,_0x151ca6){return db[_0xf7ec('0x73')]['findAll']({'where':{'id':_0x169a1a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf7ec('0x6a')],'as':_0xf7ec('0x78'),'attributes':['id'],'raw':!![]}]})[_0xf7ec('0x21')](handleEntityNotFound(_0x1fc188,null))[_0xf7ec('0x21')](function(_0x431beb){var _0x9ea39f=_[_0xf7ec('0x43')](_0x431beb,'id');var _0x404ccb=[];var _0x11537e=[];var _0x19dce1=squel[_0xf7ec('0x82')]();_0x19dce1['field']('tq.TeamId')[_0xf7ec('0x83')](_0xf7ec('0x84'),'tq')[_0xf7ec('0x85')](_0xf7ec('0x86'),'ut',_0xf7ec('0x87'))['where'](_0xf7ec('0x88'),_0x169a1a[_0xf7ec('0x58')]['id']);for(var _0x3ebda4=0x0;_0x3ebda4<_0x431beb[_0xf7ec('0x49')];_0x3ebda4+=0x1){let _0x41080b=_0x431beb[_0x3ebda4];for(var _0x1cdaf3=0x0;_0x1cdaf3<_0x41080b[_0xf7ec('0x78')]['length'];_0x1cdaf3+=0x1){let _0x198259=_0x41080b[_0xf7ec('0x78')][_0x1cdaf3];var _0x233af5=_0x19dce1['clone']();_0x233af5[_0xf7ec('0x4e')](_0xf7ec('0x89'),_0x198259['id']);_0x11537e[_0xf7ec('0x8a')](db['sequelize'][_0xf7ec('0x44')](_0x233af5[_0xf7ec('0x8b')](),{'type':db[_0xf7ec('0x7c')][_0xf7ec('0x8c')]['SELECT']})['then'](function(_0xaa85e7){if(_0xaa85e7[_0xf7ec('0x49')]===0x1){return _0x198259['id'];}else{var _0x4c5cfb=_[_0xf7ec('0x8d')](_[_0xf7ec('0x43')](_0xaa85e7,_0xf7ec('0x8e')),function(_0x5dc95f){return _[_0xf7ec('0x8f')](_0x9ea39f,_0x5dc95f);});if(_0x4c5cfb){return _0x198259['id'];}}}));}}return BPromise[_0xf7ec('0x90')](_0x11537e)[_0xf7ec('0x21')](function(_0x3c2940){_0x404ccb=_(_0x404ccb)[_0xf7ec('0x91')](_0x3c2940)[_0xf7ec('0x92')]()[_0xf7ec('0x93')]();return db[_0xf7ec('0x3e')][_0xf7ec('0x5e')]({'where':{'id':_0x169a1a['params']['id']}})[_0xf7ec('0x21')](function(_0x1367ea){return db[_0xf7ec('0x7c')]['transaction'](function(_0x2cb762){return _0x1367ea[_0xf7ec('0x81')](_0x169a1a['query'][_0xf7ec('0x76')],{'transaction':_0x2cb762})[_0xf7ec('0x21')](function(){if(!_[_0xf7ec('0x94')](_0x404ccb)){return _0x1367ea[_0xf7ec('0x95')](_0x404ccb,{'transaction':_0x2cb762});}})[_0xf7ec('0x21')](function(){_0x404ccb[_0xf7ec('0x7f')](function(_0x298e89){socket[_0xf7ec('0x80')](_0xf7ec('0x96'),{'UserId':_0x298e89,'ChatQueueId':_0x1367ea['id']});});});});});});})[_0xf7ec('0x21')](respondWithStatusCode(_0x1fc188,null))[_0xf7ec('0x2c')](handleError(_0x1fc188,null));};exports[_0xf7ec('0x97')]=function(_0x5cb492,_0x1f6d58,_0x1434ba){return db[_0xf7ec('0x3e')][_0xf7ec('0x5e')]({'where':{'id':_0x5cb492[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x1f6d58,null))[_0xf7ec('0x21')](function(_0x35aee9){if(_0x35aee9){return _0x35aee9[_0xf7ec('0x97')](_0x5cb492['body'][_0xf7ec('0x76')],_[_0xf7ec('0x98')](_0x5cb492[_0xf7ec('0x5a')],[_0xf7ec('0x76'),'id'])||{})[_0xf7ec('0x99')](function(_0x2bdd55){for(var _0x6655f4=0x0;_0x6655f4<_0x5cb492[_0xf7ec('0x5a')][_0xf7ec('0x76')][_0xf7ec('0x49')];_0x6655f4+=0x1){socket[_0xf7ec('0x80')](_0xf7ec('0x9a'),{'UserId':Number(_0x5cb492[_0xf7ec('0x5a')][_0xf7ec('0x76')][_0x6655f4]),'ChatQueueId':Number(_0x5cb492['params']['id'])});}return _0x2bdd55;});}})[_0xf7ec('0x21')](respondWithResult(_0x1f6d58,null))[_0xf7ec('0x2c')](handleError(_0x1f6d58,null));};exports[_0xf7ec('0x95')]=function(_0x27e2b9,_0x432d27,_0x17a126){return db[_0xf7ec('0x3e')][_0xf7ec('0x5e')]({'where':{'id':_0x27e2b9[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x432d27,null))[_0xf7ec('0x21')](function(_0x4dce30){if(_0x4dce30){return _0x4dce30[_0xf7ec('0x95')](_0x27e2b9[_0xf7ec('0x44')][_0xf7ec('0x76')])[_0xf7ec('0x21')](function(){if(_[_0xf7ec('0x9b')](_0x27e2b9[_0xf7ec('0x44')][_0xf7ec('0x76')])){for(var _0x2d52cf=0x0;_0x2d52cf<_0x27e2b9[_0xf7ec('0x44')][_0xf7ec('0x76')]['length'];_0x2d52cf+=0x1){socket[_0xf7ec('0x80')](_0xf7ec('0x96'),{'UserId':Number(_0x27e2b9[_0xf7ec('0x44')][_0xf7ec('0x76')][_0x2d52cf]),'ChatQueueId':Number(_0x27e2b9['params']['id'])});}}else{socket['emit'](_0xf7ec('0x96'),{'UserId':Number(_0x27e2b9[_0xf7ec('0x44')]['ids']),'ChatQueueId':Number(_0x27e2b9[_0xf7ec('0x58')]['id'])});}});}})[_0xf7ec('0x21')](respondWithStatusCode(_0x432d27,null))[_0xf7ec('0x2c')](handleError(_0x432d27,null));};exports[_0xf7ec('0x9c')]=function(_0x8267f3,_0x216e51,_0x249c20){var _0x46f9bc={};var _0x5055fa={};var _0x44f963;var _0x1abc0e;return db['ChatQueue'][_0xf7ec('0x65')]({'where':{'id':_0x8267f3[_0xf7ec('0x58')]['id']}})[_0xf7ec('0x21')](handleEntityNotFound(_0x216e51,null))[_0xf7ec('0x21')](function(_0xb77ba4){if(_0xb77ba4){_0x44f963=_0xb77ba4;_0x5055fa[_0xf7ec('0x42')]=_['keys'](db['User'][_0xf7ec('0x3f')]);_0x5055fa[_0xf7ec('0x44')]=_[_0xf7ec('0x45')](_0x8267f3[_0xf7ec('0x44')]);_0x5055fa[_0xf7ec('0x4f')]=_[_0xf7ec('0x46')](_0x5055fa['model'],_0x5055fa[_0xf7ec('0x44')]);_0x46f9bc[_0xf7ec('0x48')]=_[_0xf7ec('0x46')](_0x5055fa['model'],qs[_0xf7ec('0x47')](_0x8267f3[_0xf7ec('0x44')][_0xf7ec('0x47')]));_0x46f9bc[_0xf7ec('0x48')]=_0x46f9bc['attributes'][_0xf7ec('0x49')]?_0x46f9bc['attributes']:_0x5055fa[_0xf7ec('0x42')];_0x46f9bc['order']=qs[_0xf7ec('0x4d')](_0x8267f3[_0xf7ec('0x44')][_0xf7ec('0x4d')]);_0x46f9bc['where']=qs[_0xf7ec('0x4f')](_['pick'](_0x8267f3[_0xf7ec('0x44')],_0x5055fa[_0xf7ec('0x4f')]));if(_0x8267f3['query']['filter']){_0x46f9bc[_0xf7ec('0x4e')]=_[_0xf7ec('0x52')](_0x46f9bc[_0xf7ec('0x4e')],{'$or':_['map'](_0x46f9bc['attributes'],function(_0x1a6368){var _0x56f2a0={};_0x56f2a0[_0x1a6368]={'$like':'%'+_0x8267f3[_0xf7ec('0x44')]['filter']+'%'};return _0x56f2a0;})});}_0x46f9bc=_[_0xf7ec('0x52')]({},_0x46f9bc,_0x8267f3['options']);return _0x44f963[_0xf7ec('0x9c')](_0x46f9bc);}})[_0xf7ec('0x21')](function(_0x19bf6b){if(_0x19bf6b){_0x1abc0e=_0x19bf6b[_0xf7ec('0x49')];if(!_0x8267f3[_0xf7ec('0x44')][_0xf7ec('0x4a')](_0xf7ec('0x4b'))){_0x46f9bc[_0xf7ec('0x31')]=qs[_0xf7ec('0x31')](_0x8267f3[_0xf7ec('0x44')][_0xf7ec('0x31')]);_0x46f9bc[_0xf7ec('0x2f')]=qs[_0xf7ec('0x2f')](_0x8267f3[_0xf7ec('0x44')][_0xf7ec('0x2f')]);}return _0x44f963[_0xf7ec('0x9c')](_0x46f9bc);}})[_0xf7ec('0x21')](function(_0xdb96df){if(_0xdb96df){return _0xdb96df?{'count':_0x1abc0e,'rows':_0xdb96df}:null;}})['then'](respondWithResult(_0x216e51,null))['catch'](handleError(_0x216e51,null));};
\ No newline at end of file
index 8c66092..e2c3762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x395a=['remove','emit','exports','events','../../mysqldb','ChatQueue'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x395a,0x159));var _0xa395=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x395a[_0x16db8b];return _0x5ba017;};'use strict';var EventEmitter=require(_0xa395('0x0'));var ChatQueue=require(_0xa395('0x1'))['db'][_0xa395('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa395('0x3')};function emitEvent(_0xa492a9){return function(_0x37336e,_0x4e7666,_0x33d649){ChatQueueEvents[_0xa395('0x4')](_0xa492a9+':'+_0x37336e['id'],_0x37336e);ChatQueueEvents[_0xa395('0x4')](_0xa492a9,_0x37336e);_0x33d649(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xa395('0x5')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc4c2=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1fc429,_0x2ff0e0){var _0x23c495=function(_0x2e176f){while(--_0x2e176f){_0x1fc429['push'](_0x1fc429['shift']());}};_0x23c495(++_0x2ff0e0);}(_0xc4c2,0x155));var _0x2c4c=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xc4c2[_0x49ca18];return _0x145d54;};'use strict';var EventEmitter=require(_0x2c4c('0x0'));var ChatQueue=require(_0x2c4c('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2c4c('0x2')](0x0);var events={'afterCreate':_0x2c4c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4b4793){return function(_0x5abe66,_0x4583a3,_0x2309f2){ChatQueueEvents[_0x2c4c('0x4')](_0x4b4793+':'+_0x5abe66['id'],_0x5abe66);ChatQueueEvents[_0x2c4c('0x4')](_0x4b4793,_0x5abe66);_0x2309f2(null);};}for(var e in events){if(events[_0x2c4c('0x5')](e)){var event=events[e];ChatQueue[_0x2c4c('0x6')](e,emitEvent(event));}}module[_0x2c4c('0x7')]=ChatQueueEvents;
\ No newline at end of file
index 3cca242..e2e0610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc02d=['api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xc02d,0x127));var _0xdc02=function(_0x2f65fa,_0x178d49){_0x2f65fa=_0x2f65fa-0x0;var _0x1ce18b=_0xc02d[_0x2f65fa];return _0x1ce18b;};'use strict';var _=require(_0xdc02('0x0'));var util=require(_0xdc02('0x1'));var logger=require('../../config/logger')(_0xdc02('0x2'));var moment=require(_0xdc02('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc02('0x4'));var fs=require('fs');var path=require(_0xdc02('0x5'));var rimraf=require(_0xdc02('0x6'));var config=require(_0xdc02('0x7'));var attributes=require(_0xdc02('0x8'));module['exports']=function(_0x42cd0e,_0x653c44){return _0x42cd0e['define'](_0xdc02('0x9'),attributes,{'tableName':_0xdc02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa45f=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','api','moment'];(function(_0x2b6ec7,_0x514fd5){var _0x41063d=function(_0x4ddff1){while(--_0x4ddff1){_0x2b6ec7['push'](_0x2b6ec7['shift']());}};_0x41063d(++_0x514fd5);}(_0xa45f,0x1e9));var _0xfa45=function(_0x13800c,_0x3f9719){_0x13800c=_0x13800c-0x0;var _0x1ee117=_0xa45f[_0x13800c];return _0x1ee117;};'use strict';var _=require(_0xfa45('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa45('0x1'));var moment=require(_0xfa45('0x2'));var BPromise=require(_0xfa45('0x3'));var rp=require(_0xfa45('0x4'));var fs=require('fs');var path=require(_0xfa45('0x5'));var rimraf=require(_0xfa45('0x6'));var config=require(_0xfa45('0x7'));var attributes=require(_0xfa45('0x8'));module['exports']=function(_0x36908f,_0x5b5b7d){return _0x36908f[_0xfa45('0x9')](_0xfa45('0xa'),attributes,{'tableName':_0xfa45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4ff5c4..f9191a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe1=['client','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','model','attributes','map','debug','ShowChatQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a842a,_0xd93eb3){var _0x3e0f7b=function(_0x22c398){while(--_0x22c398){_0x5a842a['push'](_0x5a842a['shift']());}};_0x3e0f7b(++_0xd93eb3);}(_0xffe1,0x187));var _0x1ffe=function(_0x4981b1,_0x5e3491){_0x4981b1=_0x4981b1-0x0;var _0x39d10d=_0xffe1[_0x4981b1];return _0x39d10d;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var moment=require('moment');var BPromise=require(_0x1ffe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ffe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ffe('0x4'));var logger=require(_0x1ffe('0x5'))(_0x1ffe('0x6'));var config=require(_0x1ffe('0x7'));var jayson=require(_0x1ffe('0x8'));var client=jayson[_0x1ffe('0x9')][_0x1ffe('0xa')]({'port':0x232a});config[_0x1ffe('0xb')]=_[_0x1ffe('0xc')](config['redis'],{'host':_0x1ffe('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ffe('0xb')]));require('./chatQueue.socket')[_0x1ffe('0xe')](socket);function respondWithRpcPromise(_0x5b21eb,_0x3acf97,_0x1fc0b9){return new BPromise(function(_0x51be1e,_0x45bfb9){return client[_0x1ffe('0xf')](_0x5b21eb,_0x1fc0b9)[_0x1ffe('0x10')](function(_0x2aa80b){logger[_0x1ffe('0x11')](_0x1ffe('0x12'),_0x3acf97,'request\x20sent');logger['debug'](_0x1ffe('0x13'),_0x3acf97,_0x1ffe('0x14'),JSON[_0x1ffe('0x15')](_0x2aa80b));if(_0x2aa80b[_0x1ffe('0x16')]){if(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x17')]===0x1f4){logger[_0x1ffe('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);return _0x45bfb9(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);}logger[_0x1ffe('0x16')](_0x1ffe('0x12'),_0x3acf97,_0x2aa80b[_0x1ffe('0x16')]['message']);return _0x51be1e(_0x2aa80b['error']['message']);}else{logger[_0x1ffe('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x1ffe('0x14'));_0x51be1e(_0x2aa80b[_0x1ffe('0x19')][_0x1ffe('0x18')]);}})[_0x1ffe('0x1a')](function(_0x1cc248){logger['error'](_0x1ffe('0x12'),_0x3acf97,_0x1cc248);_0x45bfb9(_0x1cc248);});});}exports[_0x1ffe('0x1b')]=function(_0x473018){var _0x3f6ff4=this;return new Promise(function(_0x237695,_0x280598){return db[_0x1ffe('0x1c')][_0x1ffe('0x1d')]({'raw':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['raw']===undefined?!![]:![]:!![],'where':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')][_0x1ffe('0x1f')]||null:null,'attributes':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['attributes']||null:null,'limit':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['limit']||null:null,'include':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')]['include']?_['map'](_0x473018['options'][_0x1ffe('0x20')],function(_0x145259){return{'model':db[_0x145259[_0x1ffe('0x21')]],'as':_0x145259['as'],'attributes':_0x145259[_0x1ffe('0x22')],'include':_0x145259['include']?_[_0x1ffe('0x23')](_0x145259['include'],function(_0x266304){return{'model':db[_0x266304['model']],'as':_0x266304['as'],'attributes':_0x266304[_0x1ffe('0x22')],'include':_0x266304[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x266304[_0x1ffe('0x20')],function(_0x56bee3){return{'model':db[_0x56bee3[_0x1ffe('0x21')]],'as':_0x56bee3['as'],'attributes':_0x56bee3[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x14a0bb){logger[_0x1ffe('0x11')](_0x1ffe('0x1b'),_0x473018);logger[_0x1ffe('0x24')](_0x1ffe('0x1b'),_0x473018,JSON[_0x1ffe('0x15')](_0x14a0bb));_0x237695(_0x14a0bb);})[_0x1ffe('0x1a')](function(_0x1e697f){logger[_0x1ffe('0x16')]('GetChatQueue',_0x1e697f[_0x1ffe('0x18')],_0x473018);_0x280598(_0x3f6ff4[_0x1ffe('0x16')](0x1f4,_0x1e697f[_0x1ffe('0x18')]));});});};exports[_0x1ffe('0x25')]=function(_0x9d6faa){var _0x2dccb1=this;return new Promise(function(_0xf5417e,_0x200669){return db[_0x1ffe('0x1c')][_0x1ffe('0x26')]({'raw':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')][_0x1ffe('0x27')]===undefined?!![]:![]:!![],'where':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['where']||null:null,'attributes':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['attributes']||null:null,'include':_0x9d6faa['options']?_0x9d6faa['options'][_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x9d6faa[_0x1ffe('0x1e')]['include'],function(_0x35bfd2){return{'model':db[_0x35bfd2[_0x1ffe('0x21')]],'as':_0x35bfd2['as'],'attributes':_0x35bfd2[_0x1ffe('0x22')],'include':_0x35bfd2[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x35bfd2[_0x1ffe('0x20')],function(_0x3c6723){return{'model':db[_0x3c6723[_0x1ffe('0x21')]],'as':_0x3c6723['as'],'attributes':_0x3c6723['attributes'],'include':_0x3c6723[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x3c6723['include'],function(_0x232db2){return{'model':db[_0x232db2[_0x1ffe('0x21')]],'as':_0x232db2['as'],'attributes':_0x232db2[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x254255){logger['info'](_0x1ffe('0x25'),_0x9d6faa);logger[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x9d6faa,JSON[_0x1ffe('0x15')](_0x254255));_0xf5417e(_0x254255);})[_0x1ffe('0x1a')](function(_0x530673){logger[_0x1ffe('0x16')](_0x1ffe('0x25'),_0x530673[_0x1ffe('0x18')],_0x9d6faa);_0x200669(_0x2dccb1[_0x1ffe('0x16')](0x1f4,_0x530673[_0x1ffe('0x18')]));});});};
\ No newline at end of file
+var _0xe6f1=['../../config/environment','jayson/promise','client','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','debug','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0xe6f1,0x19c));var _0x1e6f=function(_0x1d73ab,_0x4db32c){_0x1d73ab=_0x1d73ab-0x0;var _0x2ed1df=_0xe6f1[_0x1d73ab];return _0x2ed1df;};'use strict';var _=require(_0x1e6f('0x0'));var util=require('util');var moment=require(_0x1e6f('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e6f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e6f('0x4'))(_0x1e6f('0x5'));var config=require(_0x1e6f('0x6'));var jayson=require(_0x1e6f('0x7'));var client=jayson[_0x1e6f('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1e6f('0x9'),'port':0x18eb});var socket=require(_0x1e6f('0xa'))(new Redis(config['redis']));require(_0x1e6f('0xb'))[_0x1e6f('0xc')](socket);function respondWithRpcPromise(_0x2bdee7,_0x38e768,_0x530c84){return new BPromise(function(_0x36d2a8,_0x565a2a){return client[_0x1e6f('0xd')](_0x2bdee7,_0x530c84)[_0x1e6f('0xe')](function(_0xdf70d0){logger[_0x1e6f('0xf')]('ChatQueue,\x20%s,\x20%s',_0x38e768,_0x1e6f('0x10'));logger['debug'](_0x1e6f('0x11'),_0x38e768,_0x1e6f('0x10'),JSON[_0x1e6f('0x12')](_0xdf70d0));if(_0xdf70d0[_0x1e6f('0x13')]){if(_0xdf70d0[_0x1e6f('0x13')]['code']===0x1f4){logger[_0x1e6f('0x13')](_0x1e6f('0x14'),_0x38e768,_0xdf70d0[_0x1e6f('0x13')][_0x1e6f('0x15')]);return _0x565a2a(_0xdf70d0[_0x1e6f('0x13')][_0x1e6f('0x15')]);}logger[_0x1e6f('0x13')](_0x1e6f('0x14'),_0x38e768,_0xdf70d0[_0x1e6f('0x13')][_0x1e6f('0x15')]);return _0x36d2a8(_0xdf70d0['error'][_0x1e6f('0x15')]);}else{logger[_0x1e6f('0xf')](_0x1e6f('0x14'),_0x38e768,_0x1e6f('0x10'));_0x36d2a8(_0xdf70d0[_0x1e6f('0x16')]['message']);}})[_0x1e6f('0x17')](function(_0x334146){logger[_0x1e6f('0x13')](_0x1e6f('0x14'),_0x38e768,_0x334146);_0x565a2a(_0x334146);});});}exports[_0x1e6f('0x18')]=function(_0x465618){var _0x23a952=this;return new Promise(function(_0x32b6be,_0x323bc8){return db[_0x1e6f('0x19')][_0x1e6f('0x1a')]({'raw':_0x465618['options']?_0x465618[_0x1e6f('0x1b')][_0x1e6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x465618[_0x1e6f('0x1b')]?_0x465618['options'][_0x1e6f('0x1d')]||null:null,'attributes':_0x465618[_0x1e6f('0x1b')]?_0x465618['options'][_0x1e6f('0x1e')]||null:null,'limit':_0x465618[_0x1e6f('0x1b')]?_0x465618[_0x1e6f('0x1b')][_0x1e6f('0x1f')]||null:null,'include':_0x465618['options']?_0x465618[_0x1e6f('0x1b')][_0x1e6f('0x20')]?_[_0x1e6f('0x21')](_0x465618['options']['include'],function(_0x1ba103){return{'model':db[_0x1ba103[_0x1e6f('0x22')]],'as':_0x1ba103['as'],'attributes':_0x1ba103[_0x1e6f('0x1e')],'include':_0x1ba103[_0x1e6f('0x20')]?_[_0x1e6f('0x21')](_0x1ba103[_0x1e6f('0x20')],function(_0x100684){return{'model':db[_0x100684[_0x1e6f('0x22')]],'as':_0x100684['as'],'attributes':_0x100684['attributes'],'include':_0x100684['include']?_[_0x1e6f('0x21')](_0x100684[_0x1e6f('0x20')],function(_0x3fef2f){return{'model':db[_0x3fef2f[_0x1e6f('0x22')]],'as':_0x3fef2f['as'],'attributes':_0x3fef2f[_0x1e6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e6f('0xe')](function(_0x3aa2fa){logger['info'](_0x1e6f('0x18'),_0x465618);logger['debug'](_0x1e6f('0x18'),_0x465618,JSON[_0x1e6f('0x12')](_0x3aa2fa));_0x32b6be(_0x3aa2fa);})[_0x1e6f('0x17')](function(_0x5393b5){logger[_0x1e6f('0x13')](_0x1e6f('0x18'),_0x5393b5[_0x1e6f('0x15')],_0x465618);_0x323bc8(_0x23a952[_0x1e6f('0x13')](0x1f4,_0x5393b5['message']));});});};exports[_0x1e6f('0x23')]=function(_0x448623){var _0x378194=this;return new Promise(function(_0x582a51,_0x234497){return db[_0x1e6f('0x19')][_0x1e6f('0x24')]({'raw':_0x448623[_0x1e6f('0x1b')]?_0x448623[_0x1e6f('0x1b')][_0x1e6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x448623[_0x1e6f('0x1b')]?_0x448623[_0x1e6f('0x1b')][_0x1e6f('0x1d')]||null:null,'attributes':_0x448623[_0x1e6f('0x1b')]?_0x448623[_0x1e6f('0x1b')][_0x1e6f('0x1e')]||null:null,'include':_0x448623[_0x1e6f('0x1b')]?_0x448623['options']['include']?_[_0x1e6f('0x21')](_0x448623[_0x1e6f('0x1b')][_0x1e6f('0x20')],function(_0x4b91e8){return{'model':db[_0x4b91e8[_0x1e6f('0x22')]],'as':_0x4b91e8['as'],'attributes':_0x4b91e8['attributes'],'include':_0x4b91e8[_0x1e6f('0x20')]?_['map'](_0x4b91e8[_0x1e6f('0x20')],function(_0x32b7ee){return{'model':db[_0x32b7ee[_0x1e6f('0x22')]],'as':_0x32b7ee['as'],'attributes':_0x32b7ee[_0x1e6f('0x1e')],'include':_0x32b7ee['include']?_['map'](_0x32b7ee[_0x1e6f('0x20')],function(_0x4ac7ac){return{'model':db[_0x4ac7ac[_0x1e6f('0x22')]],'as':_0x4ac7ac['as'],'attributes':_0x4ac7ac['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9da3c3){logger[_0x1e6f('0xf')](_0x1e6f('0x23'),_0x448623);logger[_0x1e6f('0x25')](_0x1e6f('0x23'),_0x448623,JSON[_0x1e6f('0x12')](_0x9da3c3));_0x582a51(_0x9da3c3);})['catch'](function(_0x358930){logger[_0x1e6f('0x13')](_0x1e6f('0x23'),_0x358930[_0x1e6f('0x15')],_0x448623);_0x234497(_0x378194[_0x1e6f('0x13')](0x1f4,_0x358930[_0x1e6f('0x15')]));});});};
\ No newline at end of file
index 1144437..e7ca38e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x44caa4,_0xf52185){var _0x36ac5d=function(_0x40b932){while(--_0x40b932){_0x44caa4['push'](_0x44caa4['shift']());}};_0x36ac5d(++_0xf52185);}(_0x032e,0x124));var _0xe032=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x032e[_0x4e9628];return _0x27bc8c;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x5610c1,_0x1d79b9){var _0x3f005d=function(_0x2612fb){while(--_0x2612fb){_0x5610c1['push'](_0x5610c1['shift']());}};_0x3f005d(++_0x1d79b9);}(_0xe107,0xb3));var _0x7e10=function(_0x28d7c0,_0xeb1518){_0x28d7c0=_0x28d7c0-0x0;var _0x5661d5=_0xe107[_0x28d7c0];return _0x5661d5;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
index 7300adb..c46be9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3fc270,_0x5c9dec){var _0x334e6c=function(_0x3a261c){while(--_0x3a261c){_0x3fc270['push'](_0x3fc270['shift']());}};_0x334e6c(++_0x5c9dec);}(_0xe14b,0x93));var _0xbe14=function(_0x49bdaf,_0x4c829c){_0x49bdaf=_0x49bdaf-0x0;var _0x44b32b=_0xe14b[_0x49bdaf];return _0x44b32b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x37fdbd,_0x335897){_0x37fdbd=_0x37fdbd-0x0;var _0x41a71f=_0x3e74[_0x37fdbd];return _0x41a71f;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
index fcecd7f..dca8a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff5=['sequelize','exports','STRING','DATE','moment'];(function(_0x427f16,_0x1456d9){var _0x1cba1a=function(_0x4f445f){while(--_0x4f445f){_0x427f16['push'](_0x427f16['shift']());}};_0x1cba1a(++_0x1456d9);}(_0x7ff5,0x1c1));var _0x57ff=function(_0x23792a,_0x2c5d44){_0x23792a=_0x23792a-0x0;var _0x3935c1=_0x7ff5[_0x23792a];return _0x3935c1;};'use strict';var moment=require(_0x57ff('0x0'));var Sequelize=require(_0x57ff('0x1'));module[_0x57ff('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x57ff('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x57ff('0x4')]},'acceptAt':{'type':Sequelize[_0x57ff('0x4')]},'exitAt':{'type':Sequelize[_0x57ff('0x4')]},'reason':{'type':Sequelize[_0x57ff('0x3')]}};
\ No newline at end of file
+var _0x8d7b=['moment','exports','STRING','DATE'];(function(_0x5171a7,_0x481cdc){var _0x4fa3c1=function(_0x574b6d){while(--_0x574b6d){_0x5171a7['push'](_0x5171a7['shift']());}};_0x4fa3c1(++_0x481cdc);}(_0x8d7b,0x1e8));var _0xb8d7=function(_0xa377e2,_0xbd1623){_0xa377e2=_0xa377e2-0x0;var _0x95fff7=_0x8d7b[_0xa377e2];return _0x95fff7;};'use strict';var moment=require(_0xb8d7('0x0'));var Sequelize=require('sequelize');module[_0xb8d7('0x1')]={'uniqueid':{'type':Sequelize[_0xb8d7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb8d7('0x2')]},'joinAt':{'type':Sequelize[_0xb8d7('0x3')]},'leaveAt':{'type':Sequelize[_0xb8d7('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb8d7('0x3')]},'reason':{'type':Sequelize[_0xb8d7('0x2')]}};
\ No newline at end of file
index 061240e..9154e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb7e=['reject','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','ChatQueueReport','intersection','length','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x2b48bb,_0x3032b6){var _0x2c620e=function(_0x4cb270){while(--_0x4cb270){_0x2b48bb['push'](_0x2b48bb['shift']());}};_0x2c620e(++_0x3032b6);}(_0xdb7e,0x11a));var _0xedb7=function(_0x2d2979,_0x27f21d){_0x2d2979=_0x2d2979-0x0;var _0x4b767c=_0xdb7e[_0x2d2979];return _0x4b767c;};'use strict';var emlformat=require(_0xedb7('0x0'));var rimraf=require(_0xedb7('0x1'));var zipdir=require(_0xedb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedb7('0x3'));var moment=require(_0xedb7('0x4'));var BPromise=require(_0xedb7('0x5'));var Mustache=require('mustache');var util=require(_0xedb7('0x6'));var path=require(_0xedb7('0x7'));var sox=require(_0xedb7('0x8'));var csv=require(_0xedb7('0x9'));var ejs=require(_0xedb7('0xa'));var fs=require('fs');var fs_extra=require(_0xedb7('0xb'));var _=require(_0xedb7('0xc'));var squel=require(_0xedb7('0xd'));var crypto=require(_0xedb7('0xe'));var jsforce=require(_0xedb7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedb7('0x9'));var querystring=require(_0xedb7('0x10'));var Papa=require(_0xedb7('0x11'));var Redis=require(_0xedb7('0x12'));var authService=require(_0xedb7('0x13'));var qs=require(_0xedb7('0x14'));var as=require(_0xedb7('0x15'));var hardwareService=require(_0xedb7('0x16'));var logger=require(_0xedb7('0x17'))(_0xedb7('0x18'));var utils=require(_0xedb7('0x19'));var config=require(_0xedb7('0x1a'));var licenseUtil=require(_0xedb7('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5161ae,_0x4691db){_0x4691db=_0x4691db||0xcc;return function(_0x1e77b6){if(_0x1e77b6){return _0x5161ae[_0xedb7('0x1c')](_0x4691db);}return _0x5161ae[_0xedb7('0x1d')](_0x4691db)[_0xedb7('0x1e')]();};}function respondWithResult(_0x2923c2,_0x42bb2a){_0x42bb2a=_0x42bb2a||0xc8;return function(_0x1fea8d){if(_0x1fea8d){return _0x2923c2[_0xedb7('0x1d')](_0x42bb2a)['json'](_0x1fea8d);}};}function respondWithFilteredResult(_0x565bb7,_0x19613e){return function(_0x119d3a){if(_0x119d3a){var _0x196b3c=typeof _0x19613e['offset']===_0xedb7('0x1f')&&typeof _0x19613e[_0xedb7('0x20')]===_0xedb7('0x1f');var _0x1c523f=_0x119d3a[_0xedb7('0x21')];var _0x50f579=_0x196b3c?0x0:_0x19613e['offset'];var _0x3d8f2a=_0x196b3c?_0x119d3a[_0xedb7('0x21')]:_0x19613e[_0xedb7('0x22')]+_0x19613e[_0xedb7('0x20')];var _0x4abbf2;if(_0x3d8f2a>=_0x1c523f){_0x3d8f2a=_0x1c523f;_0x4abbf2=0xc8;}else{_0x4abbf2=0xce;}_0x565bb7[_0xedb7('0x1d')](_0x4abbf2);return _0x565bb7[_0xedb7('0x23')](_0xedb7('0x24'),_0x50f579+'-'+_0x3d8f2a+'/'+_0x1c523f)['json'](_0x119d3a);}return null;};}function patchUpdates(_0xecf33d){return function(_0x4806f4){try{jsonpatch[_0xedb7('0x25')](_0x4806f4,_0xecf33d,!![]);}catch(_0x31aaa3){return BPromise[_0xedb7('0x26')](_0x31aaa3);}return _0x4806f4['save']();};}function saveUpdates(_0x54d68f,_0x45d7e7){return function(_0x267e55){if(_0x267e55){return _0x267e55['update'](_0x54d68f)[_0xedb7('0x27')](function(_0xff6827){return _0xff6827;});}return null;};}function removeEntity(_0x4cde11,_0x16d887){return function(_0x581ecb){if(_0x581ecb){return _0x581ecb['destroy']()[_0xedb7('0x27')](function(){_0x4cde11[_0xedb7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad4e9,_0x46e52a){return function(_0x106c28){if(!_0x106c28){_0x1ad4e9[_0xedb7('0x1c')](0x194);}return _0x106c28;};}function handleError(_0x2bcf43,_0xeb222d){_0xeb222d=_0xeb222d||0x1f4;return function(_0xfcc7ee){logger[_0xedb7('0x28')](_0xfcc7ee['stack']);if(_0xfcc7ee[_0xedb7('0x29')]){delete _0xfcc7ee['name'];}_0x2bcf43['status'](_0xeb222d)[_0xedb7('0x2a')](_0xfcc7ee);};}exports[_0xedb7('0x2b')]=function(_0x55fe73,_0x4896a5){var _0x31bebf={},_0x515ab1={},_0x43975e={'count':0x0,'rows':[]};var _0x2c5cfe=_[_0xedb7('0x2c')](db['ChatQueueReport'][_0xedb7('0x2d')],function(_0x124e62){return{'name':_0x124e62[_0xedb7('0x2e')],'type':_0x124e62[_0xedb7('0x2f')][_0xedb7('0x30')]};});_0x515ab1[_0xedb7('0x31')]=_['map'](_0x2c5cfe,_0xedb7('0x29'));_0x515ab1['query']=_[_0xedb7('0x32')](_0x55fe73['query']);_0x515ab1[_0xedb7('0x33')]=_['intersection'](_0x515ab1[_0xedb7('0x31')],_0x515ab1[_0xedb7('0x34')]);_0x31bebf[_0xedb7('0x35')]=_['intersection'](_0x515ab1['model'],qs[_0xedb7('0x36')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x36')]));_0x31bebf['attributes']=_0x31bebf[_0xedb7('0x35')]['length']?_0x31bebf[_0xedb7('0x35')]:_0x515ab1[_0xedb7('0x31')];if(!_0x55fe73[_0xedb7('0x34')][_0xedb7('0x37')](_0xedb7('0x38'))){_0x31bebf[_0xedb7('0x20')]=qs['limit'](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x20')]);_0x31bebf['offset']=qs[_0xedb7('0x22')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x22')]);}_0x31bebf[_0xedb7('0x39')]=qs[_0xedb7('0x3a')](_0x55fe73[_0xedb7('0x34')][_0xedb7('0x3a')]);_0x31bebf[_0xedb7('0x3b')]=qs[_0xedb7('0x33')](_[_0xedb7('0x3c')](_0x55fe73[_0xedb7('0x34')],_0x515ab1[_0xedb7('0x33')]),_0x2c5cfe);if(_0x55fe73[_0xedb7('0x34')][_0xedb7('0x3d')]){_0x31bebf['where']=_[_0xedb7('0x3e')](_0x31bebf[_0xedb7('0x3b')],{'$or':_[_0xedb7('0x2c')](_0x2c5cfe,function(_0x1303be){if(_0x1303be['type']!==_0xedb7('0x3f')){var _0xc5a766={};_0xc5a766[_0x1303be[_0xedb7('0x29')]]={'$like':'%'+_0x55fe73[_0xedb7('0x34')]['filter']+'%'};return _0xc5a766;}})});}_0x31bebf=_[_0xedb7('0x3e')]({},_0x31bebf,_0x55fe73[_0xedb7('0x40')]);var _0x2f323a={'where':_0x31bebf[_0xedb7('0x3b')]};return db['ChatQueueReport'][_0xedb7('0x21')](_0x2f323a)[_0xedb7('0x27')](function(_0x11076d){_0x43975e[_0xedb7('0x21')]=_0x11076d;if(_0x55fe73[_0xedb7('0x34')][_0xedb7('0x41')]){_0x31bebf[_0xedb7('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xedb7('0x43')](_0x31bebf);})['then'](function(_0x8eb7a1){_0x43975e[_0xedb7('0x44')]=_0x8eb7a1;return _0x43975e;})[_0xedb7('0x27')](respondWithFilteredResult(_0x4896a5,_0x31bebf))['catch'](handleError(_0x4896a5,null));};exports[_0xedb7('0x45')]=function(_0x2c8d69,_0x3a5da3){var _0x37a81e={'raw':!![],'where':{'id':_0x2c8d69['params']['id']}},_0x2ff566={};_0x2ff566['model']=_[_0xedb7('0x32')](db[_0xedb7('0x46')][_0xedb7('0x2d')]);_0x2ff566[_0xedb7('0x34')]=_[_0xedb7('0x32')](_0x2c8d69[_0xedb7('0x34')]);_0x2ff566[_0xedb7('0x33')]=_[_0xedb7('0x47')](_0x2ff566[_0xedb7('0x31')],_0x2ff566[_0xedb7('0x34')]);_0x37a81e[_0xedb7('0x35')]=_[_0xedb7('0x47')](_0x2ff566[_0xedb7('0x31')],qs[_0xedb7('0x36')](_0x2c8d69['query'][_0xedb7('0x36')]));_0x37a81e['attributes']=_0x37a81e[_0xedb7('0x35')][_0xedb7('0x48')]?_0x37a81e[_0xedb7('0x35')]:_0x2ff566[_0xedb7('0x31')];if(_0x2c8d69[_0xedb7('0x34')][_0xedb7('0x41')]){_0x37a81e[_0xedb7('0x42')]=[{'all':!![]}];}_0x37a81e=_[_0xedb7('0x3e')]({},_0x37a81e,_0x2c8d69[_0xedb7('0x40')]);return db[_0xedb7('0x46')][_0xedb7('0x49')](_0x37a81e)[_0xedb7('0x27')](handleEntityNotFound(_0x3a5da3,null))[_0xedb7('0x27')](respondWithResult(_0x3a5da3,null))[_0xedb7('0x4a')](handleError(_0x3a5da3,null));};exports[_0xedb7('0x4b')]=function(_0x1f21cf,_0x5c5f00){return db[_0xedb7('0x46')][_0xedb7('0x4b')](_0x1f21cf[_0xedb7('0x4c')],{})[_0xedb7('0x27')](respondWithResult(_0x5c5f00,0xc9))[_0xedb7('0x4a')](handleError(_0x5c5f00,null));};exports[_0xedb7('0x4d')]=function(_0x163823,_0x10dd4d){if(_0x163823[_0xedb7('0x4c')]['id']){delete _0x163823[_0xedb7('0x4c')]['id'];}return db[_0xedb7('0x46')][_0xedb7('0x49')]({'where':{'id':_0x163823[_0xedb7('0x4e')]['id']}})[_0xedb7('0x27')](handleEntityNotFound(_0x10dd4d,null))[_0xedb7('0x27')](saveUpdates(_0x163823[_0xedb7('0x4c')],null))[_0xedb7('0x27')](respondWithResult(_0x10dd4d,null))[_0xedb7('0x4a')](handleError(_0x10dd4d,null));};exports['destroy']=function(_0x4fe02c,_0x353e56){return db[_0xedb7('0x46')][_0xedb7('0x49')]({'where':{'id':_0x4fe02c[_0xedb7('0x4e')]['id']}})[_0xedb7('0x27')](handleEntityNotFound(_0x353e56,null))[_0xedb7('0x27')](removeEntity(_0x353e56,null))['catch'](handleError(_0x353e56,null));};exports[_0xedb7('0x4f')]=function(_0x2dc71d,_0x5bbc2c){return db[_0xedb7('0x46')][_0xedb7('0x4f')]()['then'](respondWithResult(_0x5bbc2c,null))['catch'](handleError(_0x5bbc2c,null));};
\ No newline at end of file
+var _0xdf98=['ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filters','filter','options','includeAll','include','ChatQueueReport','findAll','rows','catch','show','params','length','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xdf98,0xcf));var _0x8df9=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0xdf98[_0x39e164];return _0x13fa6b;};'use strict';var emlformat=require(_0x8df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8df9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8df9('0x2'));var BPromise=require(_0x8df9('0x3'));var Mustache=require(_0x8df9('0x4'));var util=require(_0x8df9('0x5'));var path=require(_0x8df9('0x6'));var sox=require(_0x8df9('0x7'));var csv=require(_0x8df9('0x8'));var ejs=require(_0x8df9('0x9'));var fs=require('fs');var fs_extra=require(_0x8df9('0xa'));var _=require('lodash');var squel=require(_0x8df9('0xb'));var crypto=require(_0x8df9('0xc'));var jsforce=require(_0x8df9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8df9('0xe'));var Papa=require('papaparse');var Redis=require(_0x8df9('0xf'));var authService=require(_0x8df9('0x10'));var qs=require(_0x8df9('0x11'));var as=require(_0x8df9('0x12'));var hardwareService=require(_0x8df9('0x13'));var logger=require(_0x8df9('0x14'))(_0x8df9('0x15'));var utils=require(_0x8df9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8df9('0x17'));var db=require(_0x8df9('0x18'))['db'];function respondWithStatusCode(_0x45f85b,_0x5a97dd){_0x5a97dd=_0x5a97dd||0xcc;return function(_0x42666d){if(_0x42666d){return _0x45f85b[_0x8df9('0x19')](_0x5a97dd);}return _0x45f85b[_0x8df9('0x1a')](_0x5a97dd)[_0x8df9('0x1b')]();};}function respondWithResult(_0x4bc4cc,_0x510e66){_0x510e66=_0x510e66||0xc8;return function(_0x2dcc1c){if(_0x2dcc1c){return _0x4bc4cc[_0x8df9('0x1a')](_0x510e66)[_0x8df9('0x1c')](_0x2dcc1c);}};}function respondWithFilteredResult(_0x50f0f7,_0x110f2b){return function(_0x526c78){if(_0x526c78){var _0xcc0419=typeof _0x110f2b['offset']===_0x8df9('0x1d')&&typeof _0x110f2b[_0x8df9('0x1e')]===_0x8df9('0x1d');var _0x218e76=_0x526c78[_0x8df9('0x1f')];var _0x16e8c4=_0xcc0419?0x0:_0x110f2b['offset'];var _0x54f2b0=_0xcc0419?_0x526c78[_0x8df9('0x1f')]:_0x110f2b['offset']+_0x110f2b['limit'];var _0x324dc0;if(_0x54f2b0>=_0x218e76){_0x54f2b0=_0x218e76;_0x324dc0=0xc8;}else{_0x324dc0=0xce;}_0x50f0f7[_0x8df9('0x1a')](_0x324dc0);return _0x50f0f7[_0x8df9('0x20')](_0x8df9('0x21'),_0x16e8c4+'-'+_0x54f2b0+'/'+_0x218e76)[_0x8df9('0x1c')](_0x526c78);}return null;};}function patchUpdates(_0xd73eb3){return function(_0x5a0071){try{jsonpatch[_0x8df9('0x22')](_0x5a0071,_0xd73eb3,!![]);}catch(_0x36deb6){return BPromise[_0x8df9('0x23')](_0x36deb6);}return _0x5a0071['save']();};}function saveUpdates(_0x5041f8,_0x490028){return function(_0x4a6748){if(_0x4a6748){return _0x4a6748['update'](_0x5041f8)[_0x8df9('0x24')](function(_0x239b71){return _0x239b71;});}return null;};}function removeEntity(_0x360d0b,_0x3dea66){return function(_0x478453){if(_0x478453){return _0x478453[_0x8df9('0x25')]()[_0x8df9('0x24')](function(){_0x360d0b[_0x8df9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3323dc,_0xe662a6){return function(_0x30cc42){if(!_0x30cc42){_0x3323dc['sendStatus'](0x194);}return _0x30cc42;};}function handleError(_0x5e8f46,_0x27d441){_0x27d441=_0x27d441||0x1f4;return function(_0x5117c9){logger['error'](_0x5117c9[_0x8df9('0x26')]);if(_0x5117c9[_0x8df9('0x27')]){delete _0x5117c9[_0x8df9('0x27')];}_0x5e8f46[_0x8df9('0x1a')](_0x27d441)[_0x8df9('0x28')](_0x5117c9);};}exports['index']=function(_0x5a3907,_0x8de080){var _0xce8575={},_0x2a9fee={},_0x5180fb={'count':0x0,'rows':[]};var _0x25d636=_[_0x8df9('0x29')](db['ChatQueueReport'][_0x8df9('0x2a')],function(_0x1c5065){return{'name':_0x1c5065['fieldName'],'type':_0x1c5065[_0x8df9('0x2b')][_0x8df9('0x2c')]};});_0x2a9fee[_0x8df9('0x2d')]=_['map'](_0x25d636,'name');_0x2a9fee[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5a3907[_0x8df9('0x2e')]);_0x2a9fee['filters']=_[_0x8df9('0x30')](_0x2a9fee[_0x8df9('0x2d')],_0x2a9fee[_0x8df9('0x2e')]);_0xce8575[_0x8df9('0x31')]=_['intersection'](_0x2a9fee[_0x8df9('0x2d')],qs[_0x8df9('0x32')](_0x5a3907['query'][_0x8df9('0x32')]));_0xce8575['attributes']=_0xce8575['attributes']['length']?_0xce8575['attributes']:_0x2a9fee[_0x8df9('0x2d')];if(!_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x33')](_0x8df9('0x34'))){_0xce8575[_0x8df9('0x1e')]=qs[_0x8df9('0x1e')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x1e')]);_0xce8575[_0x8df9('0x35')]=qs[_0x8df9('0x35')](_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x35')]);}_0xce8575['order']=qs['sort'](_0x5a3907['query'][_0x8df9('0x36')]);_0xce8575[_0x8df9('0x37')]=qs['filters'](_[_0x8df9('0x38')](_0x5a3907['query'],_0x2a9fee[_0x8df9('0x39')]),_0x25d636);if(_0x5a3907[_0x8df9('0x2e')]['filter']){_0xce8575['where']=_['merge'](_0xce8575[_0x8df9('0x37')],{'$or':_[_0x8df9('0x29')](_0x25d636,function(_0x25d77f){if(_0x25d77f['type']!=='VIRTUAL'){var _0x16b0c3={};_0x16b0c3[_0x25d77f['name']]={'$like':'%'+_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3a')]+'%'};return _0x16b0c3;}})});}_0xce8575=_['merge']({},_0xce8575,_0x5a3907[_0x8df9('0x3b')]);var _0x44e295={'where':_0xce8575[_0x8df9('0x37')]};return db['ChatQueueReport'][_0x8df9('0x1f')](_0x44e295)['then'](function(_0x11014b){_0x5180fb[_0x8df9('0x1f')]=_0x11014b;if(_0x5a3907[_0x8df9('0x2e')][_0x8df9('0x3c')]){_0xce8575[_0x8df9('0x3d')]=[{'all':!![]}];}return db[_0x8df9('0x3e')][_0x8df9('0x3f')](_0xce8575);})[_0x8df9('0x24')](function(_0x211b51){_0x5180fb[_0x8df9('0x40')]=_0x211b51;return _0x5180fb;})[_0x8df9('0x24')](respondWithFilteredResult(_0x8de080,_0xce8575))[_0x8df9('0x41')](handleError(_0x8de080,null));};exports[_0x8df9('0x42')]=function(_0x5d68b0,_0x5b84e6){var _0x1b5cb3={'raw':!![],'where':{'id':_0x5d68b0[_0x8df9('0x43')]['id']}},_0x4fdf12={};_0x4fdf12['model']=_[_0x8df9('0x2f')](db[_0x8df9('0x3e')][_0x8df9('0x2a')]);_0x4fdf12[_0x8df9('0x2e')]=_[_0x8df9('0x2f')](_0x5d68b0[_0x8df9('0x2e')]);_0x4fdf12[_0x8df9('0x39')]=_[_0x8df9('0x30')](_0x4fdf12[_0x8df9('0x2d')],_0x4fdf12[_0x8df9('0x2e')]);_0x1b5cb3[_0x8df9('0x31')]=_[_0x8df9('0x30')](_0x4fdf12['model'],qs[_0x8df9('0x32')](_0x5d68b0[_0x8df9('0x2e')][_0x8df9('0x32')]));_0x1b5cb3['attributes']=_0x1b5cb3[_0x8df9('0x31')][_0x8df9('0x44')]?_0x1b5cb3['attributes']:_0x4fdf12['model'];if(_0x5d68b0['query'][_0x8df9('0x3c')]){_0x1b5cb3[_0x8df9('0x3d')]=[{'all':!![]}];}_0x1b5cb3=_['merge']({},_0x1b5cb3,_0x5d68b0['options']);return db[_0x8df9('0x3e')]['find'](_0x1b5cb3)['then'](handleEntityNotFound(_0x5b84e6,null))['then'](respondWithResult(_0x5b84e6,null))[_0x8df9('0x41')](handleError(_0x5b84e6,null));};exports[_0x8df9('0x45')]=function(_0x28313f,_0x5510f7){return db[_0x8df9('0x3e')][_0x8df9('0x45')](_0x28313f[_0x8df9('0x46')],{})[_0x8df9('0x24')](respondWithResult(_0x5510f7,0xc9))[_0x8df9('0x41')](handleError(_0x5510f7,null));};exports['update']=function(_0x4f9dac,_0xdee15b){if(_0x4f9dac[_0x8df9('0x46')]['id']){delete _0x4f9dac[_0x8df9('0x46')]['id'];}return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x4f9dac[_0x8df9('0x43')]['id']}})[_0x8df9('0x24')](handleEntityNotFound(_0xdee15b,null))[_0x8df9('0x24')](saveUpdates(_0x4f9dac[_0x8df9('0x46')],null))[_0x8df9('0x24')](respondWithResult(_0xdee15b,null))[_0x8df9('0x41')](handleError(_0xdee15b,null));};exports['destroy']=function(_0x3d9e7b,_0x4a24e5){return db[_0x8df9('0x3e')]['find']({'where':{'id':_0x3d9e7b[_0x8df9('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a24e5,null))[_0x8df9('0x24')](removeEntity(_0x4a24e5,null))['catch'](handleError(_0x4a24e5,null));};exports[_0x8df9('0x47')]=function(_0x343518,_0xd445c9){return db['ChatQueueReport'][_0x8df9('0x47')]()['then'](respondWithResult(_0xd445c9,null))[_0x8df9('0x41')](handleError(_0xd445c9,null));};
\ No newline at end of file
index 73c947b..15590d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1733e7,_0x10e5ee){var _0x1e31eb=function(_0x78287c){while(--_0x78287c){_0x1733e7['push'](_0x1733e7['shift']());}};_0x1e31eb(++_0x10e5ee);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x362224,_0x5a3c74){var _0x7adea3=function(_0x11110e){while(--_0x11110e){_0x362224['push'](_0x362224['shift']());}};_0x7adea3(++_0x5a3c74);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index f1df6ef..91de57c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1042=['limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','body','options','catch','raw','where','attributes'];(function(_0x1d4483,_0x5c2c98){var _0xbe3080=function(_0x1a7541){while(--_0x1a7541){_0x1d4483['push'](_0x1d4483['shift']());}};_0xbe3080(++_0x5c2c98);}(_0x1042,0x1de));var _0x2104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1042[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2104('0x0'));var util=require(_0x2104('0x1'));var moment=require(_0x2104('0x2'));var BPromise=require(_0x2104('0x3'));var rs=require(_0x2104('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2104('0x5'));var logger=require(_0x2104('0x6'))(_0x2104('0x7'));var config=require(_0x2104('0x8'));var jayson=require(_0x2104('0x9'));var client=jayson[_0x2104('0xa')][_0x2104('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18b491,_0x543b64,_0x397603){return new BPromise(function(_0x1f6927,_0x5897da){return client[_0x2104('0xc')](_0x18b491,_0x397603)[_0x2104('0xd')](function(_0x16f93f){logger[_0x2104('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x543b64,_0x2104('0xf'));logger[_0x2104('0x10')](_0x2104('0x11'),_0x543b64,_0x2104('0xf'),JSON[_0x2104('0x12')](_0x16f93f));if(_0x16f93f['error']){if(_0x16f93f[_0x2104('0x13')][_0x2104('0x14')]===0x1f4){logger[_0x2104('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x543b64,_0x16f93f[_0x2104('0x13')]['message']);return _0x5897da(_0x16f93f[_0x2104('0x13')]['message']);}logger[_0x2104('0x13')](_0x2104('0x15'),_0x543b64,_0x16f93f[_0x2104('0x13')]['message']);return _0x1f6927(_0x16f93f[_0x2104('0x13')][_0x2104('0x16')]);}else{logger[_0x2104('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x543b64,_0x2104('0xf'));_0x1f6927(_0x16f93f[_0x2104('0x17')][_0x2104('0x16')]);}})['catch'](function(_0x3fea9b){logger[_0x2104('0x13')](_0x2104('0x15'),_0x543b64,_0x3fea9b);_0x5897da(_0x3fea9b);});});}exports[_0x2104('0x18')]=function(_0x39258d){var _0x4b5319=this;return new Promise(function(_0x10e9c7,_0x43130c){return db[_0x2104('0x19')]['create'](_0x39258d[_0x2104('0x1a')],{'raw':_0x39258d['options']?_0x39258d[_0x2104('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2104('0xd')](function(_0x2cedf5){logger[_0x2104('0xe')]('CreateChatQueueReport',_0x39258d);logger[_0x2104('0x10')](_0x2104('0x18'),_0x39258d,JSON['stringify'](_0x2cedf5));_0x10e9c7(_0x2cedf5);})[_0x2104('0x1c')](function(_0x1f6330){logger['error'](_0x2104('0x18'),_0x1f6330[_0x2104('0x16')],_0x39258d);_0x43130c(_0x4b5319[_0x2104('0x13')](0x1f4,_0x1f6330[_0x2104('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x44a457){var _0x10045b=this;return new Promise(function(_0x189773,_0xfa2694){return db[_0x2104('0x19')]['update'](_0x44a457['body'],{'raw':_0x44a457[_0x2104('0x1b')]?_0x44a457['options'][_0x2104('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a457[_0x2104('0x1b')]?_0x44a457[_0x2104('0x1b')][_0x2104('0x1e')]||null:null,'attributes':_0x44a457[_0x2104('0x1b')]?_0x44a457[_0x2104('0x1b')][_0x2104('0x1f')]||null:null,'limit':_0x44a457[_0x2104('0x1b')]?_0x44a457[_0x2104('0x1b')][_0x2104('0x20')]||null:null})['then'](function(_0x4269cf){logger[_0x2104('0xe')]('UpdateChatQueueReport',_0x44a457);logger[_0x2104('0x10')](_0x2104('0x21'),_0x44a457,JSON[_0x2104('0x12')](_0x4269cf));_0x189773(_0x4269cf);})['catch'](function(_0x2f11e0){logger[_0x2104('0x13')]('UpdateChatQueueReport',_0x2f11e0[_0x2104('0x16')],_0x44a457);_0xfa2694(_0x10045b[_0x2104('0x13')](0x1f4,_0x2f11e0['message']));});});};
\ No newline at end of file
+var _0x6eb6=['stringify','UpdateChatQueueReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport'];(function(_0x510347,_0xdf770a){var _0x5cb84f=function(_0x4c35d7){while(--_0x4c35d7){_0x510347['push'](_0x510347['shift']());}};_0x5cb84f(++_0xdf770a);}(_0x6eb6,0x1bf));var _0x66eb=function(_0x2f3ed9,_0x14be84){_0x2f3ed9=_0x2f3ed9-0x0;var _0x5727d7=_0x6eb6[_0x2f3ed9];return _0x5727d7;};'use strict';var _=require(_0x66eb('0x0'));var util=require(_0x66eb('0x1'));var moment=require('moment');var BPromise=require(_0x66eb('0x2'));var rs=require(_0x66eb('0x3'));var fs=require('fs');var Redis=require(_0x66eb('0x4'));var db=require(_0x66eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x66eb('0x6'))(_0x66eb('0x7'));var config=require(_0x66eb('0x8'));var jayson=require(_0x66eb('0x9'));var client=jayson[_0x66eb('0xa')][_0x66eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f1557,_0x46bae2,_0x56d493){return new BPromise(function(_0x29d46b,_0x1ed824){return client['request'](_0x5f1557,_0x56d493)[_0x66eb('0xc')](function(_0x22c0c1){logger[_0x66eb('0xd')](_0x66eb('0xe'),_0x46bae2,'request\x20sent');logger[_0x66eb('0xf')](_0x66eb('0x10'),_0x46bae2,_0x66eb('0x11'),JSON['stringify'](_0x22c0c1));if(_0x22c0c1[_0x66eb('0x12')]){if(_0x22c0c1[_0x66eb('0x12')][_0x66eb('0x13')]===0x1f4){logger[_0x66eb('0x12')](_0x66eb('0xe'),_0x46bae2,_0x22c0c1[_0x66eb('0x12')][_0x66eb('0x14')]);return _0x1ed824(_0x22c0c1[_0x66eb('0x12')][_0x66eb('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x46bae2,_0x22c0c1[_0x66eb('0x12')][_0x66eb('0x14')]);return _0x29d46b(_0x22c0c1[_0x66eb('0x12')][_0x66eb('0x14')]);}else{logger[_0x66eb('0xd')](_0x66eb('0xe'),_0x46bae2,'request\x20sent');_0x29d46b(_0x22c0c1[_0x66eb('0x15')][_0x66eb('0x14')]);}})[_0x66eb('0x16')](function(_0x22ea2c){logger[_0x66eb('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x46bae2,_0x22ea2c);_0x1ed824(_0x22ea2c);});});}exports['CreateChatQueueReport']=function(_0x5b049a){var _0x453c47=this;return new Promise(function(_0x5a7cfe,_0xb246ce){return db[_0x66eb('0x17')][_0x66eb('0x18')](_0x5b049a[_0x66eb('0x19')],{'raw':_0x5b049a[_0x66eb('0x1a')]?_0x5b049a[_0x66eb('0x1a')][_0x66eb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5631c9){logger[_0x66eb('0xd')](_0x66eb('0x1c'),_0x5b049a);logger[_0x66eb('0xf')](_0x66eb('0x1c'),_0x5b049a,JSON[_0x66eb('0x1d')](_0x5631c9));_0x5a7cfe(_0x5631c9);})[_0x66eb('0x16')](function(_0x5ee877){logger['error'](_0x66eb('0x1c'),_0x5ee877[_0x66eb('0x14')],_0x5b049a);_0xb246ce(_0x453c47[_0x66eb('0x12')](0x1f4,_0x5ee877[_0x66eb('0x14')]));});});};exports[_0x66eb('0x1e')]=function(_0xf35a0c){var _0x2a6160=this;return new Promise(function(_0x369250,_0x1e1aea){return db[_0x66eb('0x17')][_0x66eb('0x1f')](_0xf35a0c[_0x66eb('0x19')],{'raw':_0xf35a0c[_0x66eb('0x1a')]?_0xf35a0c[_0x66eb('0x1a')][_0x66eb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf35a0c[_0x66eb('0x1a')]?_0xf35a0c[_0x66eb('0x1a')][_0x66eb('0x20')]||null:null,'attributes':_0xf35a0c[_0x66eb('0x1a')]?_0xf35a0c[_0x66eb('0x1a')][_0x66eb('0x21')]||null:null,'limit':_0xf35a0c[_0x66eb('0x1a')]?_0xf35a0c[_0x66eb('0x1a')]['limit']||null:null})['then'](function(_0x433dd3){logger[_0x66eb('0xd')](_0x66eb('0x1e'),_0xf35a0c);logger[_0x66eb('0xf')](_0x66eb('0x1e'),_0xf35a0c,JSON[_0x66eb('0x1d')](_0x433dd3));_0x369250(_0x433dd3);})[_0x66eb('0x16')](function(_0x4484c7){logger[_0x66eb('0x12')](_0x66eb('0x1e'),_0x4484c7[_0x66eb('0x14')],_0xf35a0c);_0x1e1aea(_0x2a6160[_0x66eb('0x12')](0x1f4,_0x4484c7[_0x66eb('0x14')]));});});};
\ No newline at end of file
index 256091e..df63c78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2879=['/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x426e12,_0x2b547d){var _0x202fcf=function(_0x5aac70){while(--_0x5aac70){_0x426e12['push'](_0x426e12['shift']());}};_0x202fcf(++_0x2b547d);}(_0x2879,0x68));var _0x9287=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2879[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x9287('0x0'));var util=require(_0x9287('0x1'));var path=require(_0x9287('0x2'));var timeout=require(_0x9287('0x3'));var express=require(_0x9287('0x4'));var router=express['Router']();var fs_extra=require(_0x9287('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9287('0x6'));var config=require('../../config/environment');var controller=require(_0x9287('0x7'));router[_0x9287('0x8')]('/',auth[_0x9287('0x9')](),controller['index']);router['get'](_0x9287('0xa'),auth[_0x9287('0x9')](),controller[_0x9287('0xb')]);router[_0x9287('0x8')](_0x9287('0xc'),auth[_0x9287('0x9')](),controller[_0x9287('0xd')]);router[_0x9287('0xe')]('/',auth[_0x9287('0x9')](),controller['create']);router['put'](_0x9287('0xc'),auth[_0x9287('0x9')](),controller[_0x9287('0xf')]);router[_0x9287('0x10')](_0x9287('0xc'),auth[_0x9287('0x9')](),controller[_0x9287('0x11')]);module[_0x9287('0x12')]=router;
\ No newline at end of file
+var _0x3e48=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5693b8,_0x58b34b){var _0x164021=function(_0x50ade5){while(--_0x50ade5){_0x5693b8['push'](_0x5693b8['shift']());}};_0x164021(++_0x58b34b);}(_0x3e48,0x8a));var _0x83e4=function(_0x3ec707,_0x10644f){_0x3ec707=_0x3ec707-0x0;var _0x434087=_0x3e48[_0x3ec707];return _0x434087;};'use strict';var multer=require(_0x83e4('0x0'));var util=require(_0x83e4('0x1'));var path=require(_0x83e4('0x2'));var timeout=require(_0x83e4('0x3'));var express=require('express');var router=express[_0x83e4('0x4')]();var fs_extra=require(_0x83e4('0x5'));var auth=require(_0x83e4('0x6'));var interaction=require(_0x83e4('0x7'));var config=require('../../config/environment');var controller=require(_0x83e4('0x8'));router[_0x83e4('0x9')]('/',auth[_0x83e4('0xa')](),controller[_0x83e4('0xb')]);router['get'](_0x83e4('0xc'),auth[_0x83e4('0xa')](),controller[_0x83e4('0xd')]);router[_0x83e4('0x9')](_0x83e4('0xe'),auth[_0x83e4('0xa')](),controller[_0x83e4('0xf')]);router[_0x83e4('0x10')]('/',auth['isAuthenticated'](),controller[_0x83e4('0x11')]);router[_0x83e4('0x12')](_0x83e4('0xe'),auth[_0x83e4('0xa')](),controller['update']);router[_0x83e4('0x13')](_0x83e4('0xe'),auth['isAuthenticated'](),controller[_0x83e4('0x14')]);module[_0x83e4('0x15')]=router;
\ No newline at end of file
index e976ada..2303846 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(_0x41c78d,_0x4c3628){var _0x26d028=function(_0x44a6ad){while(--_0x44a6ad){_0x41c78d['push'](_0x41c78d['shift']());}};_0x26d028(++_0x4c3628);}(_0x34e8,0x12c));var _0x834e=function(_0xa793e0,_0x1cfe31){_0xa793e0=_0xa793e0-0x0;var _0x29e558=_0x34e8[_0xa793e0];return _0x29e558;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x1fde53,_0x4e8b6c){var _0x987cce=function(_0x19d2cd){while(--_0x19d2cd){_0x1fde53['push'](_0x1fde53['shift']());}};_0x987cce(++_0x4e8b6c);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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
index 40d2205..992f247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x215c=['set','Content-Range','apply','reject','save','update','then','stack','name','index','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','create','body','find','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x215c,0x15a));var _0xc215=function(_0x82ad48,_0x2d6224){_0x82ad48=_0x82ad48-0x0;var _0x3a4643=_0x215c[_0x82ad48];return _0x3a4643;};'use strict';var emlformat=require(_0xc215('0x0'));var rimraf=require(_0xc215('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc215('0x2'));var rp=require(_0xc215('0x3'));var moment=require(_0xc215('0x4'));var BPromise=require(_0xc215('0x5'));var Mustache=require('mustache');var util=require(_0xc215('0x6'));var path=require(_0xc215('0x7'));var sox=require(_0xc215('0x8'));var csv=require(_0xc215('0x9'));var ejs=require(_0xc215('0xa'));var fs=require('fs');var fs_extra=require(_0xc215('0xb'));var _=require('lodash');var squel=require(_0xc215('0xc'));var crypto=require(_0xc215('0xd'));var jsforce=require(_0xc215('0xe'));var deskjs=require(_0xc215('0xf'));var toCsv=require(_0xc215('0x9'));var querystring=require(_0xc215('0x10'));var Papa=require(_0xc215('0x11'));var Redis=require('ioredis');var authService=require(_0xc215('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc215('0x13'));var hardwareService=require(_0xc215('0x14'));var logger=require(_0xc215('0x15'))(_0xc215('0x16'));var utils=require(_0xc215('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc215('0x18'));var db=require(_0xc215('0x19'))['db'];function respondWithStatusCode(_0x553a6a,_0x561999){_0x561999=_0x561999||0xcc;return function(_0x477ccb){if(_0x477ccb){return _0x553a6a[_0xc215('0x1a')](_0x561999);}return _0x553a6a[_0xc215('0x1b')](_0x561999)[_0xc215('0x1c')]();};}function respondWithResult(_0xb7dd20,_0x149c68){_0x149c68=_0x149c68||0xc8;return function(_0x450e2a){if(_0x450e2a){return _0xb7dd20[_0xc215('0x1b')](_0x149c68)[_0xc215('0x1d')](_0x450e2a);}};}function respondWithFilteredResult(_0x25be62,_0x47e2e1){return function(_0x22a75c){if(_0x22a75c){var _0x2a9896=typeof _0x47e2e1[_0xc215('0x1e')]==='undefined'&&typeof _0x47e2e1['limit']===_0xc215('0x1f');var _0x44ca73=_0x22a75c[_0xc215('0x20')];var _0x386d22=_0x2a9896?0x0:_0x47e2e1[_0xc215('0x1e')];var _0x29728a=_0x2a9896?_0x22a75c[_0xc215('0x20')]:_0x47e2e1[_0xc215('0x1e')]+_0x47e2e1[_0xc215('0x21')];var _0x313b06;if(_0x29728a>=_0x44ca73){_0x29728a=_0x44ca73;_0x313b06=0xc8;}else{_0x313b06=0xce;}_0x25be62[_0xc215('0x1b')](_0x313b06);return _0x25be62[_0xc215('0x22')](_0xc215('0x23'),_0x386d22+'-'+_0x29728a+'/'+_0x44ca73)[_0xc215('0x1d')](_0x22a75c);}return null;};}function patchUpdates(_0x5027ef){return function(_0x3e477a){try{jsonpatch[_0xc215('0x24')](_0x3e477a,_0x5027ef,!![]);}catch(_0x53bc53){return BPromise[_0xc215('0x25')](_0x53bc53);}return _0x3e477a[_0xc215('0x26')]();};}function saveUpdates(_0x1b4ab9,_0x2a0250){return function(_0x4dc1dd){if(_0x4dc1dd){return _0x4dc1dd[_0xc215('0x27')](_0x1b4ab9)[_0xc215('0x28')](function(_0x5acd87){return _0x5acd87;});}return null;};}function removeEntity(_0x1f4198,_0x1721bc){return function(_0x2307db){if(_0x2307db){return _0x2307db['destroy']()[_0xc215('0x28')](function(){_0x1f4198['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x230f30,_0x4b47f5){return function(_0x3f90ed){if(!_0x3f90ed){_0x230f30[_0xc215('0x1a')](0x194);}return _0x3f90ed;};}function handleError(_0x25732d,_0x1a12a0){_0x1a12a0=_0x1a12a0||0x1f4;return function(_0x45d061){logger['error'](_0x45d061[_0xc215('0x29')]);if(_0x45d061[_0xc215('0x2a')]){delete _0x45d061['name'];}_0x25732d['status'](_0x1a12a0)['send'](_0x45d061);};}exports[_0xc215('0x2b')]=function(_0xdcc3d8,_0x197c58){var _0x2a4289={},_0x1a0b12={},_0xdebd7={'count':0x0,'rows':[]};var _0x1bf3ac=_['map'](db['ChatTransferReport'][_0xc215('0x2c')],function(_0x2e47d8){return{'name':_0x2e47d8['fieldName'],'type':_0x2e47d8[_0xc215('0x2d')]['key']};});_0x1a0b12[_0xc215('0x2e')]=_[_0xc215('0x2f')](_0x1bf3ac,_0xc215('0x2a'));_0x1a0b12['query']=_[_0xc215('0x30')](_0xdcc3d8[_0xc215('0x31')]);_0x1a0b12[_0xc215('0x32')]=_[_0xc215('0x33')](_0x1a0b12[_0xc215('0x2e')],_0x1a0b12[_0xc215('0x31')]);_0x2a4289[_0xc215('0x34')]=_['intersection'](_0x1a0b12[_0xc215('0x2e')],qs[_0xc215('0x35')](_0xdcc3d8[_0xc215('0x31')]['fields']));_0x2a4289[_0xc215('0x34')]=_0x2a4289['attributes'][_0xc215('0x36')]?_0x2a4289[_0xc215('0x34')]:_0x1a0b12[_0xc215('0x2e')];if(!_0xdcc3d8[_0xc215('0x31')][_0xc215('0x37')](_0xc215('0x38'))){_0x2a4289[_0xc215('0x21')]=qs['limit'](_0xdcc3d8[_0xc215('0x31')][_0xc215('0x21')]);_0x2a4289[_0xc215('0x1e')]=qs[_0xc215('0x1e')](_0xdcc3d8[_0xc215('0x31')][_0xc215('0x1e')]);}_0x2a4289['order']=qs[_0xc215('0x39')](_0xdcc3d8['query'][_0xc215('0x39')]);_0x2a4289['where']=qs[_0xc215('0x32')](_[_0xc215('0x3a')](_0xdcc3d8[_0xc215('0x31')],_0x1a0b12['filters']),_0x1bf3ac);if(_0xdcc3d8[_0xc215('0x31')][_0xc215('0x3b')]){_0x2a4289['where']=_[_0xc215('0x3c')](_0x2a4289[_0xc215('0x3d')],{'$or':_[_0xc215('0x2f')](_0x1bf3ac,function(_0x3770da){if(_0x3770da[_0xc215('0x2d')]!=='VIRTUAL'){var _0x1e38bc={};_0x1e38bc[_0x3770da[_0xc215('0x2a')]]={'$like':'%'+_0xdcc3d8['query'][_0xc215('0x3b')]+'%'};return _0x1e38bc;}})});}_0x2a4289=_[_0xc215('0x3c')]({},_0x2a4289,_0xdcc3d8[_0xc215('0x3e')]);var _0x40bd6f={'where':_0x2a4289['where']};return db[_0xc215('0x3f')][_0xc215('0x20')](_0x40bd6f)['then'](function(_0x5b4f06){_0xdebd7[_0xc215('0x20')]=_0x5b4f06;if(_0xdcc3d8[_0xc215('0x31')][_0xc215('0x40')]){_0x2a4289[_0xc215('0x41')]=[{'all':!![]}];}return db[_0xc215('0x3f')][_0xc215('0x42')](_0x2a4289);})['then'](function(_0x2abba5){_0xdebd7[_0xc215('0x43')]=_0x2abba5;return _0xdebd7;})[_0xc215('0x28')](respondWithFilteredResult(_0x197c58,_0x2a4289))[_0xc215('0x44')](handleError(_0x197c58,null));};exports[_0xc215('0x45')]=function(_0x4209f3,_0x278527){var _0x15c04a={'raw':!![],'where':{'id':_0x4209f3['params']['id']}},_0x439a48={};_0x439a48[_0xc215('0x2e')]=_['keys'](db[_0xc215('0x3f')][_0xc215('0x2c')]);_0x439a48['query']=_['keys'](_0x4209f3[_0xc215('0x31')]);_0x439a48[_0xc215('0x32')]=_[_0xc215('0x33')](_0x439a48[_0xc215('0x2e')],_0x439a48[_0xc215('0x31')]);_0x15c04a['attributes']=_[_0xc215('0x33')](_0x439a48[_0xc215('0x2e')],qs[_0xc215('0x35')](_0x4209f3[_0xc215('0x31')][_0xc215('0x35')]));_0x15c04a[_0xc215('0x34')]=_0x15c04a[_0xc215('0x34')][_0xc215('0x36')]?_0x15c04a[_0xc215('0x34')]:_0x439a48[_0xc215('0x2e')];if(_0x4209f3[_0xc215('0x31')][_0xc215('0x40')]){_0x15c04a[_0xc215('0x41')]=[{'all':!![]}];}_0x15c04a=_[_0xc215('0x3c')]({},_0x15c04a,_0x4209f3['options']);return db[_0xc215('0x3f')]['find'](_0x15c04a)[_0xc215('0x28')](handleEntityNotFound(_0x278527,null))[_0xc215('0x28')](respondWithResult(_0x278527,null))[_0xc215('0x44')](handleError(_0x278527,null));};exports[_0xc215('0x46')]=function(_0x18f150,_0x2bf711){return db['ChatTransferReport']['create'](_0x18f150[_0xc215('0x47')],{})[_0xc215('0x28')](respondWithResult(_0x2bf711,0xc9))[_0xc215('0x44')](handleError(_0x2bf711,null));};exports[_0xc215('0x27')]=function(_0xf59316,_0xae5724){if(_0xf59316[_0xc215('0x47')]['id']){delete _0xf59316['body']['id'];}return db[_0xc215('0x3f')][_0xc215('0x48')]({'where':{'id':_0xf59316[_0xc215('0x49')]['id']}})['then'](handleEntityNotFound(_0xae5724,null))[_0xc215('0x28')](saveUpdates(_0xf59316[_0xc215('0x47')],null))[_0xc215('0x28')](respondWithResult(_0xae5724,null))['catch'](handleError(_0xae5724,null));};exports[_0xc215('0x4a')]=function(_0x1f0ef1,_0x56b2c9){return db['ChatTransferReport'][_0xc215('0x48')]({'where':{'id':_0x1f0ef1[_0xc215('0x49')]['id']}})[_0xc215('0x28')](handleEntityNotFound(_0x56b2c9,null))[_0xc215('0x28')](removeEntity(_0x56b2c9,null))[_0xc215('0x44')](handleError(_0x56b2c9,null));};exports[_0xc215('0x4b')]=function(_0x3919d5,_0x1ffd56){return db[_0xc215('0x3f')][_0xc215('0x4b')]()[_0xc215('0x28')](respondWithResult(_0x1ffd56,null))[_0xc215('0x44')](handleError(_0x1ffd56,null));};
\ No newline at end of file
+var _0xb683=['hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length'];(function(_0x263994,_0x4cad2f){var _0x5e1013=function(_0x51e182){while(--_0x51e182){_0x263994['push'](_0x263994['shift']());}};_0x5e1013(++_0x4cad2f);}(_0xb683,0x176));var _0x3b68=function(_0x5bc158,_0x20ba90){_0x5bc158=_0x5bc158-0x0;var _0x288d43=_0xb683[_0x5bc158];return _0x288d43;};'use strict';var emlformat=require(_0x3b68('0x0'));var rimraf=require(_0x3b68('0x1'));var zipdir=require(_0x3b68('0x2'));var jsonpatch=require(_0x3b68('0x3'));var rp=require(_0x3b68('0x4'));var moment=require(_0x3b68('0x5'));var BPromise=require(_0x3b68('0x6'));var Mustache=require('mustache');var util=require(_0x3b68('0x7'));var path=require('path');var sox=require(_0x3b68('0x8'));var csv=require(_0x3b68('0x9'));var ejs=require(_0x3b68('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b68('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3b68('0xc'));var deskjs=require(_0x3b68('0xd'));var toCsv=require(_0x3b68('0x9'));var querystring=require(_0x3b68('0xe'));var Papa=require(_0x3b68('0xf'));var Redis=require('ioredis');var authService=require(_0x3b68('0x10'));var qs=require(_0x3b68('0x11'));var as=require(_0x3b68('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3b68('0x13'));var config=require(_0x3b68('0x14'));var licenseUtil=require(_0x3b68('0x15'));var db=require(_0x3b68('0x16'))['db'];function respondWithStatusCode(_0x53eba2,_0x51fb7e){_0x51fb7e=_0x51fb7e||0xcc;return function(_0x54d7af){if(_0x54d7af){return _0x53eba2[_0x3b68('0x17')](_0x51fb7e);}return _0x53eba2[_0x3b68('0x18')](_0x51fb7e)[_0x3b68('0x19')]();};}function respondWithResult(_0x1bada9,_0x53c707){_0x53c707=_0x53c707||0xc8;return function(_0x13ed8a){if(_0x13ed8a){return _0x1bada9['status'](_0x53c707)[_0x3b68('0x1a')](_0x13ed8a);}};}function respondWithFilteredResult(_0x2d3dfb,_0x3653bb){return function(_0xd9ac2b){if(_0xd9ac2b){var _0x2fc6ea=typeof _0x3653bb[_0x3b68('0x1b')]===_0x3b68('0x1c')&&typeof _0x3653bb['limit']===_0x3b68('0x1c');var _0x4b7473=_0xd9ac2b[_0x3b68('0x1d')];var _0x552074=_0x2fc6ea?0x0:_0x3653bb[_0x3b68('0x1b')];var _0x575407=_0x2fc6ea?_0xd9ac2b['count']:_0x3653bb[_0x3b68('0x1b')]+_0x3653bb['limit'];var _0x4674a3;if(_0x575407>=_0x4b7473){_0x575407=_0x4b7473;_0x4674a3=0xc8;}else{_0x4674a3=0xce;}_0x2d3dfb['status'](_0x4674a3);return _0x2d3dfb['set'](_0x3b68('0x1e'),_0x552074+'-'+_0x575407+'/'+_0x4b7473)[_0x3b68('0x1a')](_0xd9ac2b);}return null;};}function patchUpdates(_0x31e89e){return function(_0xe7401e){try{jsonpatch[_0x3b68('0x1f')](_0xe7401e,_0x31e89e,!![]);}catch(_0x9dbac5){return BPromise[_0x3b68('0x20')](_0x9dbac5);}return _0xe7401e[_0x3b68('0x21')]();};}function saveUpdates(_0x51220c,_0x12a8e1){return function(_0x2068fb){if(_0x2068fb){return _0x2068fb[_0x3b68('0x22')](_0x51220c)[_0x3b68('0x23')](function(_0x5a06d5){return _0x5a06d5;});}return null;};}function removeEntity(_0x290800,_0x3c4f99){return function(_0x5eb63a){if(_0x5eb63a){return _0x5eb63a[_0x3b68('0x24')]()['then'](function(){_0x290800[_0x3b68('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca54f4,_0x1bf514){return function(_0x5451ee){if(!_0x5451ee){_0xca54f4[_0x3b68('0x17')](0x194);}return _0x5451ee;};}function handleError(_0x2d3f3d,_0x59f9dc){_0x59f9dc=_0x59f9dc||0x1f4;return function(_0x122f4e){logger[_0x3b68('0x25')](_0x122f4e[_0x3b68('0x26')]);if(_0x122f4e[_0x3b68('0x27')]){delete _0x122f4e[_0x3b68('0x27')];}_0x2d3f3d[_0x3b68('0x18')](_0x59f9dc)['send'](_0x122f4e);};}exports[_0x3b68('0x28')]=function(_0x4a481e,_0x330923){var _0x174d40={},_0x3b4989={},_0x43c702={'count':0x0,'rows':[]};var _0x253b20=_[_0x3b68('0x29')](db['ChatTransferReport'][_0x3b68('0x2a')],function(_0x224afd){return{'name':_0x224afd[_0x3b68('0x2b')],'type':_0x224afd['type'][_0x3b68('0x2c')]};});_0x3b4989[_0x3b68('0x2d')]=_['map'](_0x253b20,_0x3b68('0x27'));_0x3b4989['query']=_['keys'](_0x4a481e[_0x3b68('0x2e')]);_0x3b4989[_0x3b68('0x2f')]=_['intersection'](_0x3b4989['model'],_0x3b4989[_0x3b68('0x2e')]);_0x174d40[_0x3b68('0x30')]=_[_0x3b68('0x31')](_0x3b4989[_0x3b68('0x2d')],qs['fields'](_0x4a481e[_0x3b68('0x2e')][_0x3b68('0x32')]));_0x174d40[_0x3b68('0x30')]=_0x174d40[_0x3b68('0x30')][_0x3b68('0x33')]?_0x174d40[_0x3b68('0x30')]:_0x3b4989[_0x3b68('0x2d')];if(!_0x4a481e['query'][_0x3b68('0x34')]('nolimit')){_0x174d40[_0x3b68('0x35')]=qs[_0x3b68('0x35')](_0x4a481e[_0x3b68('0x2e')][_0x3b68('0x35')]);_0x174d40[_0x3b68('0x1b')]=qs['offset'](_0x4a481e['query'][_0x3b68('0x1b')]);}_0x174d40[_0x3b68('0x36')]=qs[_0x3b68('0x37')](_0x4a481e[_0x3b68('0x2e')]['sort']);_0x174d40['where']=qs[_0x3b68('0x2f')](_['pick'](_0x4a481e[_0x3b68('0x2e')],_0x3b4989[_0x3b68('0x2f')]),_0x253b20);if(_0x4a481e['query'][_0x3b68('0x38')]){_0x174d40[_0x3b68('0x39')]=_[_0x3b68('0x3a')](_0x174d40[_0x3b68('0x39')],{'$or':_[_0x3b68('0x29')](_0x253b20,function(_0x2e44e3){if(_0x2e44e3['type']!==_0x3b68('0x3b')){var _0x50ac2b={};_0x50ac2b[_0x2e44e3['name']]={'$like':'%'+_0x4a481e[_0x3b68('0x2e')]['filter']+'%'};return _0x50ac2b;}})});}_0x174d40=_[_0x3b68('0x3a')]({},_0x174d40,_0x4a481e[_0x3b68('0x3c')]);var _0x30f1ef={'where':_0x174d40['where']};return db[_0x3b68('0x3d')][_0x3b68('0x1d')](_0x30f1ef)[_0x3b68('0x23')](function(_0x541d54){_0x43c702['count']=_0x541d54;if(_0x4a481e[_0x3b68('0x2e')][_0x3b68('0x3e')]){_0x174d40['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x174d40);})['then'](function(_0x136805){_0x43c702['rows']=_0x136805;return _0x43c702;})[_0x3b68('0x23')](respondWithFilteredResult(_0x330923,_0x174d40))['catch'](handleError(_0x330923,null));};exports[_0x3b68('0x3f')]=function(_0x32f613,_0x1025d5){var _0x55f5a1={'raw':!![],'where':{'id':_0x32f613[_0x3b68('0x40')]['id']}},_0x3c6ec8={};_0x3c6ec8['model']=_[_0x3b68('0x41')](db['ChatTransferReport'][_0x3b68('0x2a')]);_0x3c6ec8[_0x3b68('0x2e')]=_[_0x3b68('0x41')](_0x32f613[_0x3b68('0x2e')]);_0x3c6ec8[_0x3b68('0x2f')]=_[_0x3b68('0x31')](_0x3c6ec8['model'],_0x3c6ec8[_0x3b68('0x2e')]);_0x55f5a1[_0x3b68('0x30')]=_[_0x3b68('0x31')](_0x3c6ec8[_0x3b68('0x2d')],qs['fields'](_0x32f613[_0x3b68('0x2e')]['fields']));_0x55f5a1[_0x3b68('0x30')]=_0x55f5a1[_0x3b68('0x30')][_0x3b68('0x33')]?_0x55f5a1[_0x3b68('0x30')]:_0x3c6ec8[_0x3b68('0x2d')];if(_0x32f613[_0x3b68('0x2e')][_0x3b68('0x3e')]){_0x55f5a1['include']=[{'all':!![]}];}_0x55f5a1=_['merge']({},_0x55f5a1,_0x32f613[_0x3b68('0x3c')]);return db['ChatTransferReport'][_0x3b68('0x42')](_0x55f5a1)[_0x3b68('0x23')](handleEntityNotFound(_0x1025d5,null))[_0x3b68('0x23')](respondWithResult(_0x1025d5,null))[_0x3b68('0x43')](handleError(_0x1025d5,null));};exports['create']=function(_0x5f556e,_0x2d3b7e){return db[_0x3b68('0x3d')][_0x3b68('0x44')](_0x5f556e[_0x3b68('0x45')],{})['then'](respondWithResult(_0x2d3b7e,0xc9))[_0x3b68('0x43')](handleError(_0x2d3b7e,null));};exports[_0x3b68('0x22')]=function(_0x5cc609,_0xd3d057){if(_0x5cc609[_0x3b68('0x45')]['id']){delete _0x5cc609[_0x3b68('0x45')]['id'];}return db[_0x3b68('0x3d')][_0x3b68('0x42')]({'where':{'id':_0x5cc609[_0x3b68('0x40')]['id']}})[_0x3b68('0x23')](handleEntityNotFound(_0xd3d057,null))[_0x3b68('0x23')](saveUpdates(_0x5cc609[_0x3b68('0x45')],null))[_0x3b68('0x23')](respondWithResult(_0xd3d057,null))[_0x3b68('0x43')](handleError(_0xd3d057,null));};exports[_0x3b68('0x24')]=function(_0x5749ca,_0x497c2c){return db[_0x3b68('0x3d')][_0x3b68('0x42')]({'where':{'id':_0x5749ca[_0x3b68('0x40')]['id']}})[_0x3b68('0x23')](handleEntityNotFound(_0x497c2c,null))[_0x3b68('0x23')](removeEntity(_0x497c2c,null))[_0x3b68('0x43')](handleError(_0x497c2c,null));};exports['describe']=function(_0x2595b2,_0x257e39){return db[_0x3b68('0x3d')][_0x3b68('0x46')]()[_0x3b68('0x23')](respondWithResult(_0x257e39,null))['catch'](handleError(_0x257e39,null));};
\ No newline at end of file
index 6566da6..183226d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd38=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util'];(function(_0x25e3d3,_0x1d2882){var _0x42ad83=function(_0x5f3010){while(--_0x5f3010){_0x25e3d3['push'](_0x25e3d3['shift']());}};_0x42ad83(++_0x1d2882);}(_0xfd38,0xb2));var _0x8fd3=function(_0x36ccb7,_0x59579d){_0x36ccb7=_0x36ccb7-0x0;var _0x31034c=_0xfd38[_0x36ccb7];return _0x31034c;};'use strict';var _=require(_0x8fd3('0x0'));var util=require(_0x8fd3('0x1'));var logger=require(_0x8fd3('0x2'))(_0x8fd3('0x3'));var moment=require(_0x8fd3('0x4'));var BPromise=require(_0x8fd3('0x5'));var rp=require(_0x8fd3('0x6'));var fs=require('fs');var path=require(_0x8fd3('0x7'));var rimraf=require(_0x8fd3('0x8'));var config=require(_0x8fd3('0x9'));var attributes=require(_0x8fd3('0xa'));module[_0x8fd3('0xb')]=function(_0x510af8,_0x530e98){return _0x510af8[_0x8fd3('0xc')](_0x8fd3('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x8fd3('0xe'),'fields':[_0x8fd3('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x85bc=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x51f601,_0x3a1445){var _0x2e7a30=function(_0x5d41a0){while(--_0x5d41a0){_0x51f601['push'](_0x51f601['shift']());}};_0x2e7a30(++_0x3a1445);}(_0x85bc,0x13d));var _0xc85b=function(_0x1a4083,_0x5e57e6){_0x1a4083=_0x1a4083-0x0;var _0x20439f=_0x85bc[_0x1a4083];return _0x20439f;};'use strict';var _=require('lodash');var util=require(_0xc85b('0x0'));var logger=require(_0xc85b('0x1'))(_0xc85b('0x2'));var moment=require(_0xc85b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc85b('0x4'));var rimraf=require(_0xc85b('0x5'));var config=require(_0xc85b('0x6'));var attributes=require(_0xc85b('0x7'));module[_0xc85b('0x8')]=function(_0x12d616,_0x9afc0a){return _0x12d616[_0xc85b('0x9')](_0xc85b('0xa'),attributes,{'tableName':_0xc85b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc85b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0f23392..ee5414a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2451=['http','request','then','info','request\x20sent','debug','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x991b3,_0x59e86e){var _0xd5cd52=function(_0x5da37a){while(--_0x5da37a){_0x991b3['push'](_0x991b3['shift']());}};_0xd5cd52(++_0x59e86e);}(_0x2451,0x90));var _0x1245=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x2451[_0xdeefbd];return _0x4ff63f;};'use strict';var _=require(_0x1245('0x0'));var util=require('util');var moment=require(_0x1245('0x1'));var BPromise=require(_0x1245('0x2'));var rs=require(_0x1245('0x3'));var fs=require('fs');var Redis=require(_0x1245('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1245('0x5'));var logger=require(_0x1245('0x6'))(_0x1245('0x7'));var config=require('../../config/environment');var jayson=require(_0x1245('0x8'));var client=jayson[_0x1245('0x9')][_0x1245('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d386d,_0x5d2753,_0x5d47d7){return new BPromise(function(_0x48bf44,_0x6238fb){return client[_0x1245('0xb')](_0x4d386d,_0x5d47d7)[_0x1245('0xc')](function(_0x362892){logger[_0x1245('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5d2753,_0x1245('0xe'));logger[_0x1245('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5d2753,'request\x20sent',JSON['stringify'](_0x362892));if(_0x362892['error']){if(_0x362892[_0x1245('0x10')][_0x1245('0x11')]===0x1f4){logger[_0x1245('0x10')](_0x1245('0x12'),_0x5d2753,_0x362892['error'][_0x1245('0x13')]);return _0x6238fb(_0x362892[_0x1245('0x10')][_0x1245('0x13')]);}logger[_0x1245('0x10')](_0x1245('0x12'),_0x5d2753,_0x362892['error'][_0x1245('0x13')]);return _0x48bf44(_0x362892[_0x1245('0x10')][_0x1245('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x5d2753,_0x1245('0xe'));_0x48bf44(_0x362892[_0x1245('0x14')]['message']);}})[_0x1245('0x15')](function(_0x43fabb){logger['error'](_0x1245('0x12'),_0x5d2753,_0x43fabb);_0x6238fb(_0x43fabb);});});}
\ No newline at end of file
+var _0x5912=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x5912,0x1c2));var _0x2591=function(_0x2c8009,_0x2502dd){_0x2c8009=_0x2c8009-0x0;var _0x3da6f7=_0x5912[_0x2c8009];return _0x3da6f7;};'use strict';var _=require(_0x2591('0x0'));var util=require(_0x2591('0x1'));var moment=require('moment');var BPromise=require(_0x2591('0x2'));var rs=require(_0x2591('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2591('0x4'))['db'];var utils=require(_0x2591('0x5'));var logger=require(_0x2591('0x6'))(_0x2591('0x7'));var config=require(_0x2591('0x8'));var jayson=require(_0x2591('0x9'));var client=jayson['client'][_0x2591('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x296f67,_0x41bb17,_0x2d7859){return new BPromise(function(_0x5325ee,_0x8c52f3){return client[_0x2591('0xb')](_0x296f67,_0x2d7859)[_0x2591('0xc')](function(_0x16a0dc){logger[_0x2591('0xd')](_0x2591('0xe'),_0x41bb17,_0x2591('0xf'));logger[_0x2591('0x10')](_0x2591('0x11'),_0x41bb17,_0x2591('0xf'),JSON[_0x2591('0x12')](_0x16a0dc));if(_0x16a0dc['error']){if(_0x16a0dc[_0x2591('0x13')][_0x2591('0x14')]===0x1f4){logger[_0x2591('0x13')](_0x2591('0xe'),_0x41bb17,_0x16a0dc[_0x2591('0x13')][_0x2591('0x15')]);return _0x8c52f3(_0x16a0dc[_0x2591('0x13')]['message']);}logger[_0x2591('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x41bb17,_0x16a0dc[_0x2591('0x13')][_0x2591('0x15')]);return _0x5325ee(_0x16a0dc[_0x2591('0x13')][_0x2591('0x15')]);}else{logger[_0x2591('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x41bb17,_0x2591('0xf'));_0x5325ee(_0x16a0dc[_0x2591('0x16')]['message']);}})[_0x2591('0x17')](function(_0x4500c2){logger[_0x2591('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x41bb17,_0x4500c2);_0x8c52f3(_0x4500c2);});});}
\ No newline at end of file
index b03a2bf..d84f44e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x443b=['index','/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x443b,0x155));var _0xb443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x443b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb443('0x0'));var util=require(_0xb443('0x1'));var path=require(_0xb443('0x2'));var timeout=require(_0xb443('0x3'));var express=require(_0xb443('0x4'));var router=express['Router']();var fs_extra=require(_0xb443('0x5'));var auth=require(_0xb443('0x6'));var interaction=require(_0xb443('0x7'));var config=require(_0xb443('0x8'));var controller=require(_0xb443('0x9'));router[_0xb443('0xa')]('/',auth['isAuthenticated'](),controller[_0xb443('0xb')]);router[_0xb443('0xa')](_0xb443('0xc'),auth['isAuthenticated'](),controller[_0xb443('0xd')]);router[_0xb443('0xa')](_0xb443('0xe'),auth[_0xb443('0xf')](),controller[_0xb443('0x10')]);router[_0xb443('0x11')]('/',auth[_0xb443('0xf')](),controller[_0xb443('0x12')]);router['put'](_0xb443('0xe'),auth[_0xb443('0xf')](),controller[_0xb443('0x13')]);router[_0xb443('0x14')](_0xb443('0xe'),auth[_0xb443('0xf')](),controller['destroy']);module[_0xb443('0x15')]=router;
\ No newline at end of file
+var _0x8cf7=['multer','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0x8cf7,0x120));var _0x78cf=function(_0x54bf05,_0x28d91e){_0x54bf05=_0x54bf05-0x0;var _0x5108e3=_0x8cf7[_0x54bf05];return _0x5108e3;};'use strict';var multer=require(_0x78cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x78cf('0x1')]();var fs_extra=require(_0x78cf('0x2'));var auth=require(_0x78cf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x78cf('0x4'));var controller=require(_0x78cf('0x5'));router[_0x78cf('0x6')]('/',auth[_0x78cf('0x7')](),controller[_0x78cf('0x8')]);router[_0x78cf('0x6')](_0x78cf('0x9'),auth[_0x78cf('0x7')](),controller['describe']);router[_0x78cf('0x6')](_0x78cf('0xa'),auth[_0x78cf('0x7')](),controller[_0x78cf('0xb')]);router[_0x78cf('0xc')]('/',auth[_0x78cf('0x7')](),controller[_0x78cf('0xd')]);router['put'](_0x78cf('0xa'),auth[_0x78cf('0x7')](),controller[_0x78cf('0xe')]);router['delete']('/:id',auth[_0x78cf('0x7')](),controller[_0x78cf('0xf')]);module['exports']=router;
\ No newline at end of file
index d5da650..0bbd34d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc4c=['text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','email','#011F6A','#ffffff','BOOLEAN','rounded','squared','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','thumb','star','stringify','input','name'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xcc4c,0x1cf));var _0xccc4=function(_0x5c3e6e,_0x214d68){_0x5c3e6e=_0x5c3e6e-0x0;var _0x541a05=_0xcc4c[_0x5c3e6e];return _0x541a05;};'use strict';var Sequelize=require(_0xccc4('0x0'));var rs=require('randomstring');module[_0xccc4('0x1')]={'name':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xccc4('0x2')]},'mapKey':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x3')},'mapKeyOffline':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'defaultValue':_0xccc4('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'defaultValue':_0xccc4('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xccc4('0x2')]},'animation':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xccc4('0x7'),_0xccc4('0x8')),'defaultValue':_0xccc4('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xccc4('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0xa')},'defaultWhiteLabel':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xccc4('0xb')]},'closingQuestion':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0xc')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xccc4('0xd')},'formSubmitFailureMessage':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0xe')},'noteTitle':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0xf')},'placeholderMessage':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xccc4('0x11')},'closingMessageButton':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x12')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xccc4('0x13')},'conditionAgreement':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x14')},'ratingType':{'type':Sequelize[_0xccc4('0x15')]('star',_0xccc4('0x16')),'defaultValue':_0xccc4('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xccc4('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xccc4('0x18')]({'items':[{'type':_0xccc4('0x19'),'variable':null,'config':{'placeholder':_0xccc4('0x1a'),'type':_0xccc4('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xccc4('0x3'),'type':_0xccc4('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xccc4('0x1c'))?JSON[_0xccc4('0x1d')](this[_0xccc4('0x1e')](_0xccc4('0x1c'))):{};},'set':function(_0x18da8f){return this[_0xccc4('0x1f')]('onlineForm',JSON['stringify'](_0x18da8f));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xccc4('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xccc4('0x3'),'type':_0xccc4('0x3')},'variable':null},{'type':_0xccc4('0x20'),'config':{'placeholder':_0xccc4('0x21')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xccc4('0x1e')]('offlineForm')?JSON['parse'](this[_0xccc4('0x1e')](_0xccc4('0x22'))):{};},'set':function(_0x2dbddc){return this['setDataValue'](_0xccc4('0x22'),JSON[_0xccc4('0x18')](_0x2dbddc));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xccc4('0x23')]();}},'autoclose':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xccc4('0x2')]},'forwardOffline':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xccc4('0x2')]},'waitingTitle':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x24')},'waitingMessage':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xccc4('0x13')},'sendUnmanaged':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x12')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xccc4('0x2')]},'notificationTemplate':{'type':Sequelize[_0xccc4('0xb')],'defaultValue':function(){return _0xccc4('0x28');}},'notificationSound':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x29')},'verticalAlignment':{'type':Sequelize[_0xccc4('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xccc4('0x2a')},'defaultTitle':{'type':Sequelize[_0xccc4('0x2')]},'customerAvatar':{'type':Sequelize[_0xccc4('0xb')]},'showCustomerAvatar':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xccc4('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'defaultValue':_0xccc4('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xccc4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xccc4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xccc4('0x2')],'defaultValue':_0xccc4('0x2c')},'systemAvatar':{'type':Sequelize[_0xccc4('0xb')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xccc4('0x9')],'comment':_0xccc4('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![],'comment':_0xccc4('0x2e'),'set':function(_0x2c324d){if(!_0x2c324d)this[_0xccc4('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xccc4('0x2f'),_0x2c324d);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xccc4('0x2')]},'vidaooTopic':{'type':Sequelize[_0xccc4('0x2')],'allowNull':![],'defaultValue':_0xccc4('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xccc4('0xb')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xccc4('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xccc4('0xb')]}};
\ No newline at end of file
+var _0x227d=['You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','TEXT','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','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','STRING','address','email','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','INTEGER','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x227d,0x1e3));var _0xd227=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x227d[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0xd227('0x0'));var rs=require(_0xd227('0x1'));module['exports']={'name':{'type':Sequelize[_0xd227('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd227('0x2')],'allowNull':![],'unique':_0xd227('0x3')},'description':{'type':Sequelize[_0xd227('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0x4')},'key':{'type':Sequelize[_0xd227('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd227('0x2')],'allowNull':![],'defaultValue':_0xd227('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd227('0x2')],'allowNull':![],'defaultValue':_0xd227('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd227('0x2')]},'animation':{'type':Sequelize[_0xd227('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd227('0x7')](_0xd227('0x8'),_0xd227('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0xb')},'offline_chat_button':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0xf')},'noteTitle':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x10')},'placeholderMessage':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x11')},'closingMessageButton':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x12')},'conditionAgreement':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star',_0xd227('0x13')),'defaultValue':_0xd227('0x14')},'ratingStarsNumber':{'type':Sequelize[_0xd227('0x15')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd227('0x16')]({'items':[{'type':_0xd227('0x17'),'variable':null,'config':{'placeholder':_0xd227('0x18'),'type':'text','required':!![]},'props':{'title':_0xd227('0x18'),'helpText':''}},{'type':_0xd227('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd227('0x4'),'type':_0xd227('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd227('0x19')](_0xd227('0x1a'))?JSON[_0xd227('0x1b')](this[_0xd227('0x19')]('onlineForm')):{};},'set':function(_0x1df3ff){return this[_0xd227('0x1c')]('onlineForm',JSON[_0xd227('0x16')](_0x1df3ff));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd227('0x17'),'props':{'title':_0xd227('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd227('0x4'),'type':_0xd227('0x4')},'variable':null},{'type':_0xd227('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0xd227('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd227('0x19')](_0xd227('0x1f'))?JSON[_0xd227('0x1b')](this[_0xd227('0x19')](_0xd227('0x1f'))):{};},'set':function(_0x107fb7){return this[_0xd227('0x1c')](_0xd227('0x1f'),JSON[_0xd227('0x16')](_0x107fb7));}},'token':{'type':Sequelize[_0xd227('0x2')],'defaultValue':function(){return rs[_0xd227('0x20')]();}},'autoclose':{'type':Sequelize[_0xd227('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd227('0x2')]},'forwardOffline':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd227('0x2')]},'waitingTitle':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xd227('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xd227('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x23')},'skipUnmanaged':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x12')},'sendUnmanaged':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x24')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd227('0x25')]},'showAgentAvatar':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd227('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd227('0x25')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd227('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd227('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd227('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x26')},'verticalAlignment':{'type':Sequelize[_0xd227('0x15')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x27')},'defaultTitle':{'type':Sequelize[_0xd227('0x2')]},'customerAvatar':{'type':Sequelize[_0xd227('0x25')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd227('0x15')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd227('0x2')],'allowNull':![],'defaultValue':_0xd227('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd227('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd227('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd227('0x2')],'defaultValue':_0xd227('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd227('0x15')],'comment':_0xd227('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![],'comment':_0xd227('0x2b'),'set':function(_0x27cf19){if(!_0x27cf19)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd227('0x1c')](_0xd227('0x2c'),_0x27cf19);}},'vidaooEscalation':{'type':Sequelize[_0xd227('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd227('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd227('0x2')],'allowNull':![],'defaultValue':_0xd227('0x2d')},'vidaooNote':{'type':Sequelize[_0xd227('0x2')],'defaultValue':function(){return _0xd227('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0xd227('0x25')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd227('0x25')]}};
\ No newline at end of file
index ad8a574..36f8ebd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfa3=['getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','getLicense','custom','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','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','CmContact','Sequelize','difference','createdAt','updatedAt','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','ListId','contact','customerIp','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','server','attachments','offline-chat','basename','sequelize','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','originalname','mimetype','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','remote','x-forwarded-for','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','http','client','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','json','undefined','limit','count','offset','status','Content-Range','reject','update','then','destroy','get','ChatWebsites','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','order','rows','removeDispositions','ids','addAnswer','CannedAnswer'];(function(_0x1a7c1d,_0x869a10){var _0x4d8e71=function(_0x3bc65e){while(--_0x3bc65e){_0x1a7c1d['push'](_0x1a7c1d['shift']());}};_0x4d8e71(++_0x869a10);}(_0xdfa3,0xc7));var _0x3dfa=function(_0x5f262f,_0x3d832a){_0x5f262f=_0x5f262f-0x0;var _0x37ce2d=_0xdfa3[_0x5f262f];return _0x37ce2d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3dfa('0x0'));var jsonpatch=require(_0x3dfa('0x1'));var rp=require(_0x3dfa('0x2'));var moment=require('moment');var BPromise=require(_0x3dfa('0x3'));var Mustache=require(_0x3dfa('0x4'));var util=require(_0x3dfa('0x5'));var path=require('path');var sox=require(_0x3dfa('0x6'));var csv=require(_0x3dfa('0x7'));var ejs=require(_0x3dfa('0x8'));var fs=require('fs');var fs_extra=require(_0x3dfa('0x9'));var _=require('lodash');var squel=require(_0x3dfa('0xa'));var crypto=require(_0x3dfa('0xb'));var jsforce=require(_0x3dfa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dfa('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3dfa('0xd'));var qs=require(_0x3dfa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dfa('0xf'));var logger=require(_0x3dfa('0x10'))(_0x3dfa('0x11'));var utils=require('../../config/utils');var config=require(_0x3dfa('0x12'));var licenseUtil=require(_0x3dfa('0x13'));var db=require(_0x3dfa('0x14'))['db'];config[_0x3dfa('0x15')]=_[_0x3dfa('0x16')](config[_0x3dfa('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3dfa('0x17'))(new Redis(config[_0x3dfa('0x15')]));require(_0x3dfa('0x18'))[_0x3dfa('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3dfa('0x1a')]({'port':0x232c});var client9002=jayson[_0x3dfa('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0x3dfa('0x1b')][_0x3dfa('0x1a')]({'port':0x232b});var client9001=jayson[_0x3dfa('0x1b')][_0x3dfa('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x362399,_0x4c2cca,_0x2e3ecd,_0x3b7dda){return new BPromise(function(_0x5a8d3a,_0x3a2a27){var _0x104837=_0x3b7dda||client;return _0x104837['request'](_0x362399,_0x2e3ecd)['then'](function(_0x5db210){logger[_0x3dfa('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x4c2cca,'request\x20sent');logger[_0x3dfa('0x1d')](_0x3dfa('0x1e'),_0x4c2cca,_0x3dfa('0x1f'),JSON[_0x3dfa('0x20')](_0x5db210));if(_0x5db210[_0x3dfa('0x21')]){if(_0x5db210[_0x3dfa('0x21')][_0x3dfa('0x22')]===0x1f4){logger['error'](_0x3dfa('0x23'),_0x4c2cca,_0x5db210[_0x3dfa('0x21')]['message']);return _0x3a2a27(_0x5db210['error'][_0x3dfa('0x24')]);}logger[_0x3dfa('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x4c2cca,_0x5db210['error'][_0x3dfa('0x24')]);return _0x5a8d3a(_0x5db210[_0x3dfa('0x21')][_0x3dfa('0x24')]);}else{logger[_0x3dfa('0x1c')](_0x3dfa('0x23'),_0x4c2cca,_0x3dfa('0x1f'));_0x5a8d3a(_0x5db210[_0x3dfa('0x25')][_0x3dfa('0x24')]);}})[_0x3dfa('0x26')](function(_0xa65cda){logger[_0x3dfa('0x21')](_0x3dfa('0x23'),_0x4c2cca,_0xa65cda);_0x3a2a27(_0xa65cda);});});}function respondWithStatusCode(_0x45f2b6,_0x2a22b1){_0x2a22b1=_0x2a22b1||0xcc;return function(_0x3e7582){if(_0x3e7582){return _0x45f2b6[_0x3dfa('0x27')](_0x2a22b1);}return _0x45f2b6['status'](_0x2a22b1)['end']();};}function respondWithResult(_0x4308bd,_0xfb150c){_0xfb150c=_0xfb150c||0xc8;return function(_0x2bbdc3){if(_0x2bbdc3){return _0x4308bd['status'](_0xfb150c)[_0x3dfa('0x28')](_0x2bbdc3);}};}function respondWithFilteredResult(_0x7e7099,_0x2b4626){return function(_0x2266ef){if(_0x2266ef){var _0xa16179=typeof _0x2b4626['offset']===_0x3dfa('0x29')&&typeof _0x2b4626[_0x3dfa('0x2a')]===_0x3dfa('0x29');var _0x2598a1=_0x2266ef[_0x3dfa('0x2b')];var _0x2f0082=_0xa16179?0x0:_0x2b4626[_0x3dfa('0x2c')];var _0x512309=_0xa16179?_0x2266ef['count']:_0x2b4626[_0x3dfa('0x2c')]+_0x2b4626[_0x3dfa('0x2a')];var _0x1dcba9;if(_0x512309>=_0x2598a1){_0x512309=_0x2598a1;_0x1dcba9=0xc8;}else{_0x1dcba9=0xce;}_0x7e7099[_0x3dfa('0x2d')](_0x1dcba9);return _0x7e7099['set'](_0x3dfa('0x2e'),_0x2f0082+'-'+_0x512309+'/'+_0x2598a1)['json'](_0x2266ef);}return null;};}function patchUpdates(_0x1df522){return function(_0x5f1867){try{jsonpatch['apply'](_0x5f1867,_0x1df522,!![]);}catch(_0x351cd3){return BPromise[_0x3dfa('0x2f')](_0x351cd3);}return _0x5f1867['save']();};}function saveUpdates(_0x5d55cd,_0x33db77){return function(_0x2fd112){if(_0x2fd112){return _0x2fd112[_0x3dfa('0x30')](_0x5d55cd)[_0x3dfa('0x31')](function(_0x3f5a5a){return _0x3f5a5a;});}return null;};}function removeEntity(_0x3cc24d,_0x1c491b){return function(_0x48786b){if(_0x48786b){return _0x48786b[_0x3dfa('0x32')]()[_0x3dfa('0x31')](function(){var _0x4d7542=_0x48786b[_0x3dfa('0x33')]({'plain':!![]});var _0x239890=_0x3dfa('0x34');return db['UserProfileResource'][_0x3dfa('0x32')]({'where':{'type':_0x239890,'resourceId':_0x4d7542['id']}})[_0x3dfa('0x31')](function(){return _0x48786b;});})['then'](function(){_0x3cc24d[_0x3dfa('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3700ed,_0x3f405e){return function(_0x5e42d8){if(!_0x5e42d8){_0x3700ed[_0x3dfa('0x27')](0x194);}return _0x5e42d8;};}function handleError(_0x19f3fe,_0x1be9ed){_0x1be9ed=_0x1be9ed||0x1f4;return function(_0x29acc3){logger['error'](_0x29acc3[_0x3dfa('0x35')]);if(_0x29acc3[_0x3dfa('0x36')]){delete _0x29acc3[_0x3dfa('0x36')];}_0x19f3fe['status'](_0x1be9ed)['send'](_0x29acc3);};}exports[_0x3dfa('0x37')]=function(_0xb34ffa,_0x4cd5e4){var _0x27af60={'include':[{'model':db[_0x3dfa('0x38')],'as':_0x3dfa('0x39')}]},_0x974f99={},_0x4a2214={'count':0x0,'rows':[]};var _0x48d79c=_[_0x3dfa('0x3a')](db[_0x3dfa('0x3b')]['rawAttributes'],function(_0x8ca044){return{'name':_0x8ca044[_0x3dfa('0x3c')],'type':_0x8ca044['type'][_0x3dfa('0x3d')]};});_0x974f99['model']=_['map'](_0x48d79c,'name');_0x974f99[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0xb34ffa['query']);_0x974f99[_0x3dfa('0x40')]=_['intersection'](_0x974f99[_0x3dfa('0x41')],_0x974f99[_0x3dfa('0x3e')]);_0x27af60[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x974f99[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0xb34ffa[_0x3dfa('0x3e')]['fields']));_0x27af60[_0x3dfa('0x42')]=_0x27af60[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x27af60[_0x3dfa('0x42')]:_0x974f99[_0x3dfa('0x41')];if(!_0xb34ffa[_0x3dfa('0x3e')][_0x3dfa('0x46')](_0x3dfa('0x47'))){_0x27af60[_0x3dfa('0x2a')]=qs['limit'](_0xb34ffa['query'][_0x3dfa('0x2a')]);_0x27af60[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0xb34ffa[_0x3dfa('0x3e')][_0x3dfa('0x2c')]);}_0x27af60['order']=qs[_0x3dfa('0x48')](_0xb34ffa[_0x3dfa('0x3e')][_0x3dfa('0x48')]);_0x27af60[_0x3dfa('0x49')]=qs['filters'](_[_0x3dfa('0x4a')](_0xb34ffa[_0x3dfa('0x3e')],_0x974f99[_0x3dfa('0x40')]),_0x48d79c);if(_0xb34ffa[_0x3dfa('0x3e')][_0x3dfa('0x4b')]){_0x27af60[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x27af60['where'],{'$or':_['map'](_0x48d79c,function(_0x5ec293){if(_0x5ec293[_0x3dfa('0x4d')]!==_0x3dfa('0x4e')){var _0x503514={};_0x503514[_0x5ec293[_0x3dfa('0x36')]]={'$like':'%'+_0xb34ffa[_0x3dfa('0x3e')]['filter']+'%'};return _0x503514;}})});}_0x27af60=_[_0x3dfa('0x4c')]({},_0x27af60,_0xb34ffa[_0x3dfa('0x4f')]);var _0x506240={'where':_0x27af60['where']};return db[_0x3dfa('0x3b')][_0x3dfa('0x2b')](_0x506240)['then'](function(_0x5dbc13){_0x4a2214['count']=_0x5dbc13;if(_0xb34ffa[_0x3dfa('0x3e')][_0x3dfa('0x50')]){_0x27af60['include']=[{'all':!![]}];}return db[_0x3dfa('0x3b')][_0x3dfa('0x51')](_0x27af60);})['then'](function(_0x2c5693){_0x4a2214['rows']=_0x2c5693;return _0x4a2214;})[_0x3dfa('0x31')](respondWithFilteredResult(_0x4cd5e4,_0x27af60))[_0x3dfa('0x26')](handleError(_0x4cd5e4,null));};exports['show']=function(_0x2b5c22,_0x53e8eb){var _0xd2484d={'raw':![],'where':{'id':_0x2b5c22[_0x3dfa('0x52')]['id']},'include':[{'model':db[_0x3dfa('0x38')],'as':_0x3dfa('0x39')}]},_0x1a9b9a={};_0x1a9b9a[_0x3dfa('0x41')]=_[_0x3dfa('0x3f')](db[_0x3dfa('0x3b')][_0x3dfa('0x53')]);_0x1a9b9a[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0x2b5c22['query']);_0x1a9b9a['filters']=_[_0x3dfa('0x43')](_0x1a9b9a[_0x3dfa('0x41')],_0x1a9b9a[_0x3dfa('0x3e')]);_0xd2484d[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x1a9b9a['model'],qs['fields'](_0x2b5c22[_0x3dfa('0x3e')]['fields']));_0xd2484d[_0x3dfa('0x42')]=_0xd2484d['attributes'][_0x3dfa('0x45')]?_0xd2484d[_0x3dfa('0x42')]:_0x1a9b9a[_0x3dfa('0x41')];if(_0x2b5c22['query'][_0x3dfa('0x50')]){_0xd2484d[_0x3dfa('0x54')]=[{'all':!![]}];}_0xd2484d=_[_0x3dfa('0x4c')]({},_0xd2484d,_0x2b5c22[_0x3dfa('0x4f')]);return db[_0x3dfa('0x3b')]['find'](_0xd2484d)[_0x3dfa('0x31')](handleEntityNotFound(_0x53e8eb,null))[_0x3dfa('0x31')](respondWithResult(_0x53e8eb,null))[_0x3dfa('0x26')](handleError(_0x53e8eb,null));};exports['create']=function(_0x2ab516,_0x4f81ce){return db[_0x3dfa('0x3b')][_0x3dfa('0x55')](_0x2ab516[_0x3dfa('0x56')],{})['then'](function(_0x5d5805){var _0x3e5ed5=_0x2ab516[_0x3dfa('0x57')][_0x3dfa('0x33')]({'plain':!![]});if(!_0x3e5ed5)throw new Error(_0x3dfa('0x58'));if(_0x3e5ed5[_0x3dfa('0x59')]===_0x3dfa('0x57')){var _0x4a289c=_0x5d5805['get']({'plain':!![]});var _0x261f1c='ChatWebsites';return db[_0x3dfa('0x5a')][_0x3dfa('0x5b')]({'where':{'name':_0x261f1c,'userProfileId':_0x3e5ed5[_0x3dfa('0x5c')]},'raw':!![]})[_0x3dfa('0x31')](function(_0xfa744){if(_0xfa744&&_0xfa744['autoAssociation']===0x0){return db['UserProfileResource'][_0x3dfa('0x55')]({'name':_0x4a289c[_0x3dfa('0x36')],'resourceId':_0x4a289c['id'],'type':_0xfa744[_0x3dfa('0x36')],'sectionId':_0xfa744['id']},{})[_0x3dfa('0x31')](function(){return _0x5d5805;});}else{return _0x5d5805;}})[_0x3dfa('0x26')](function(_0x11541f){logger[_0x3dfa('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11541f);throw _0x11541f;});}return _0x5d5805;})[_0x3dfa('0x31')](respondWithResult(_0x4f81ce,0xc9))[_0x3dfa('0x26')](handleError(_0x4f81ce,null));};exports[_0x3dfa('0x30')]=function(_0x5ea9ea,_0x5d744a){if(_0x5ea9ea[_0x3dfa('0x56')]['id']){delete _0x5ea9ea[_0x3dfa('0x56')]['id'];}return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x5ea9ea[_0x3dfa('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x3dfa('0x39')}]})['then'](handleEntityNotFound(_0x5d744a,null))[_0x3dfa('0x31')](saveUpdates(_0x5ea9ea['body'],null))[_0x3dfa('0x31')](respondWithResult(_0x5d744a,null))[_0x3dfa('0x26')](handleError(_0x5d744a,null));};exports[_0x3dfa('0x32')]=function(_0x58da78,_0x597008){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x58da78['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x597008,null))['then'](removeEntity(_0x597008,null))[_0x3dfa('0x26')](handleError(_0x597008,null));};exports[_0x3dfa('0x5d')]=function(_0x52ccde,_0x154646){return db[_0x3dfa('0x3b')][_0x3dfa('0x5d')]()[_0x3dfa('0x31')](respondWithResult(_0x154646,null))[_0x3dfa('0x26')](handleError(_0x154646,null));};exports[_0x3dfa('0x5e')]=function(_0x38c728,_0x51f2ee,_0x4ccd58){if(_0x38c728[_0x3dfa('0x56')]['id']){delete _0x38c728[_0x3dfa('0x56')]['id'];}return db[_0x3dfa('0x3b')]['find']({'where':{'id':_0x38c728[_0x3dfa('0x52')]['id']}})['then'](handleEntityNotFound(_0x51f2ee,null))[_0x3dfa('0x31')](function(_0x1720eb){if(_0x1720eb){_0x38c728[_0x3dfa('0x56')][_0x3dfa('0x5f')]=_0x1720eb['id'];return db['Disposition'][_0x3dfa('0x55')](_0x38c728[_0x3dfa('0x56')]);}})['then'](respondWithResult(_0x51f2ee,null))[_0x3dfa('0x26')](handleError(_0x51f2ee,null));};exports[_0x3dfa('0x60')]=function(_0xd97726,_0x37f8e6,_0x32a785){var _0x59678b={'raw':![],'where':{}};var _0x193167={};var _0x5b666d={'count':0x0,'rows':[]};return db[_0x3dfa('0x3b')]['findOne']({'where':{'id':_0xd97726[_0x3dfa('0x52')]['id']}})['then'](handleEntityNotFound(_0x37f8e6,null))[_0x3dfa('0x31')](function(_0x56a9a0){if(_0x56a9a0){_0x193167[_0x3dfa('0x41')]=_['keys'](db[_0x3dfa('0x61')][_0x3dfa('0x53')]);_0x193167[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0xd97726[_0x3dfa('0x3e')]);_0x193167[_0x3dfa('0x40')]=_[_0x3dfa('0x43')](_0x193167[_0x3dfa('0x41')],_0x193167[_0x3dfa('0x3e')]);_0x59678b[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x193167['model'],qs[_0x3dfa('0x44')](_0xd97726[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x59678b[_0x3dfa('0x42')]=_0x59678b[_0x3dfa('0x42')]['length']?_0x59678b[_0x3dfa('0x42')]:_0x193167[_0x3dfa('0x41')];if(!_0xd97726['query'][_0x3dfa('0x46')](_0x3dfa('0x47'))){_0x59678b['limit']=qs[_0x3dfa('0x2a')](_0xd97726[_0x3dfa('0x3e')][_0x3dfa('0x2a')]);_0x59678b[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0xd97726[_0x3dfa('0x3e')]['offset']);}_0x59678b[_0x3dfa('0x62')]=qs['sort'](_0xd97726['query'][_0x3dfa('0x48')]);_0x59678b[_0x3dfa('0x49')]=qs[_0x3dfa('0x40')](_[_0x3dfa('0x4a')](_0xd97726['query'],_0x193167[_0x3dfa('0x40')]));_0x59678b['where'][_0x3dfa('0x5f')]=_0x56a9a0['id'];if(_0xd97726[_0x3dfa('0x3e')][_0x3dfa('0x4b')]){_0x59678b[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x59678b[_0x3dfa('0x49')],{'$or':_[_0x3dfa('0x3a')](_0x59678b[_0x3dfa('0x42')],function(_0x3335ed){var _0x247802={};_0x247802[_0x3335ed]={'$like':'%'+_0xd97726[_0x3dfa('0x3e')][_0x3dfa('0x4b')]+'%'};return _0x247802;})});}_0x59678b=_['merge']({},_0x59678b,_0xd97726[_0x3dfa('0x4f')]);return db[_0x3dfa('0x61')][_0x3dfa('0x2b')]({'where':_0x59678b[_0x3dfa('0x49')]})[_0x3dfa('0x31')](function(_0x5792d8){_0x5b666d[_0x3dfa('0x2b')]=_0x5792d8;if(_0xd97726[_0x3dfa('0x3e')][_0x3dfa('0x50')]){_0x59678b[_0x3dfa('0x54')]=[{'all':!![]}];}return db[_0x3dfa('0x61')][_0x3dfa('0x51')](_0x59678b);})['then'](function(_0x538b5a){_0x5b666d[_0x3dfa('0x63')]=_0x538b5a;return _0x5b666d;});}})[_0x3dfa('0x31')](respondWithFilteredResult(_0x37f8e6,_0x59678b))['catch'](handleError(_0x37f8e6,null));};exports[_0x3dfa('0x64')]=function(_0x51b8fe,_0x57c436,_0x4f7da6){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x51b8fe['params']['id']}})['then'](handleEntityNotFound(_0x57c436,null))[_0x3dfa('0x31')](function(_0x2aa8b5){if(_0x2aa8b5){return _0x2aa8b5[_0x3dfa('0x64')](_0x51b8fe[_0x3dfa('0x3e')][_0x3dfa('0x65')]);}})[_0x3dfa('0x31')](respondWithStatusCode(_0x57c436,null))['catch'](handleError(_0x57c436,null));};exports[_0x3dfa('0x66')]=function(_0x29159b,_0x267aba,_0x394dca){if(_0x29159b[_0x3dfa('0x56')]['id']){delete _0x29159b[_0x3dfa('0x56')]['id'];}return db[_0x3dfa('0x3b')]['find']({'where':{'id':_0x29159b[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x267aba,null))[_0x3dfa('0x31')](function(_0x4a9901){if(_0x4a9901){_0x29159b['body'][_0x3dfa('0x5f')]=_0x4a9901['id'];return db[_0x3dfa('0x67')][_0x3dfa('0x55')](_0x29159b['body']);}})[_0x3dfa('0x31')](respondWithResult(_0x267aba,null))[_0x3dfa('0x26')](handleError(_0x267aba,null));};exports[_0x3dfa('0x68')]=function(_0x360d66,_0x59d5ea,_0x4fe09a){var _0x26e24b={'raw':![],'where':{}};var _0x82f2c={};var _0x2bc17a={'count':0x0,'rows':[]};return db[_0x3dfa('0x3b')][_0x3dfa('0x69')]({'where':{'id':_0x360d66[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x59d5ea,null))['then'](function(_0x151a0a){if(_0x151a0a){_0x82f2c[_0x3dfa('0x41')]=_['keys'](db[_0x3dfa('0x67')][_0x3dfa('0x53')]);_0x82f2c[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0x360d66[_0x3dfa('0x3e')]);_0x82f2c[_0x3dfa('0x40')]=_[_0x3dfa('0x43')](_0x82f2c[_0x3dfa('0x41')],_0x82f2c[_0x3dfa('0x3e')]);_0x26e24b[_0x3dfa('0x42')]=_['intersection'](_0x82f2c[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0x360d66[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x26e24b[_0x3dfa('0x42')]=_0x26e24b[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x26e24b[_0x3dfa('0x42')]:_0x82f2c[_0x3dfa('0x41')];if(!_0x360d66['query'][_0x3dfa('0x46')](_0x3dfa('0x47'))){_0x26e24b[_0x3dfa('0x2a')]=qs['limit'](_0x360d66[_0x3dfa('0x3e')][_0x3dfa('0x2a')]);_0x26e24b[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0x360d66[_0x3dfa('0x3e')][_0x3dfa('0x2c')]);}_0x26e24b[_0x3dfa('0x62')]=qs[_0x3dfa('0x48')](_0x360d66[_0x3dfa('0x3e')][_0x3dfa('0x48')]);_0x26e24b[_0x3dfa('0x49')]=qs[_0x3dfa('0x40')](_[_0x3dfa('0x4a')](_0x360d66[_0x3dfa('0x3e')],_0x82f2c[_0x3dfa('0x40')]));_0x26e24b['where'][_0x3dfa('0x5f')]=_0x151a0a['id'];if(_0x360d66[_0x3dfa('0x3e')][_0x3dfa('0x4b')]){_0x26e24b[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x26e24b[_0x3dfa('0x49')],{'$or':_[_0x3dfa('0x3a')](_0x26e24b[_0x3dfa('0x42')],function(_0x4e024d){var _0x5ccf6f={};_0x5ccf6f[_0x4e024d]={'$like':'%'+_0x360d66['query'][_0x3dfa('0x4b')]+'%'};return _0x5ccf6f;})});}_0x26e24b=_['merge']({},_0x26e24b,_0x360d66['options']);return db[_0x3dfa('0x67')][_0x3dfa('0x2b')]({'where':_0x26e24b[_0x3dfa('0x49')]})[_0x3dfa('0x31')](function(_0x49949d){_0x2bc17a[_0x3dfa('0x2b')]=_0x49949d;if(_0x360d66['query']['includeAll']){_0x26e24b[_0x3dfa('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3dfa('0x51')](_0x26e24b);})[_0x3dfa('0x31')](function(_0x1644b8){_0x2bc17a[_0x3dfa('0x63')]=_0x1644b8;return _0x2bc17a;});}})[_0x3dfa('0x31')](respondWithFilteredResult(_0x59d5ea,_0x26e24b))[_0x3dfa('0x26')](handleError(_0x59d5ea,null));};exports['removeAnswers']=function(_0x5baa7b,_0x403b05,_0x55ea3d){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x5baa7b['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x403b05,null))[_0x3dfa('0x31')](function(_0x36aee0){if(_0x36aee0){return _0x36aee0[_0x3dfa('0x6a')](_0x5baa7b[_0x3dfa('0x3e')][_0x3dfa('0x65')]);}})[_0x3dfa('0x31')](respondWithStatusCode(_0x403b05,null))[_0x3dfa('0x26')](handleError(_0x403b05,null));};exports['addLogo']=function(_0x4e54e0,_0x420c87,_0x272183){_0x4e54e0[_0x3dfa('0x56')][_0x3dfa('0x6b')]=_0x4e54e0[_0x3dfa('0x6c')][_0x3dfa('0x6d')];return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x4e54e0['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x420c87,null))[_0x3dfa('0x31')](saveUpdates(_0x4e54e0[_0x3dfa('0x56')],null))['then'](respondWithResult(_0x420c87,null))[_0x3dfa('0x26')](handleError(_0x420c87,null));};exports[_0x3dfa('0x6e')]=function(_0xf6f8f8,_0x51d258,_0x1dd415){_0xf6f8f8[_0x3dfa('0x56')][_0x3dfa('0x6f')]=_0xf6f8f8['file']['filename'];return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0xf6f8f8[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x51d258,null))[_0x3dfa('0x31')](saveUpdates(_0xf6f8f8[_0x3dfa('0x56')],null))[_0x3dfa('0x31')](respondWithResult(_0x51d258,null))[_0x3dfa('0x26')](handleError(_0x51d258,null));};exports[_0x3dfa('0x70')]=function(_0x6a75b9,_0x5e1b48,_0x2e3ae2){_0x6a75b9['body'][_0x3dfa('0x71')]=_0x6a75b9['file'][_0x3dfa('0x6d')];return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x6a75b9[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x5e1b48,null))[_0x3dfa('0x31')](saveUpdates(_0x6a75b9[_0x3dfa('0x56')],null))[_0x3dfa('0x31')](respondWithResult(_0x5e1b48,null))[_0x3dfa('0x26')](handleError(_0x5e1b48,null));};exports[_0x3dfa('0x72')]=function(_0x30a75e,_0x12d25b,_0x31dad2){_0x30a75e[_0x3dfa('0x56')][_0x3dfa('0x73')]=_0x30a75e[_0x3dfa('0x6c')][_0x3dfa('0x6d')];return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x30a75e['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x12d25b,null))[_0x3dfa('0x31')](saveUpdates(_0x30a75e['body'],null))['then'](respondWithResult(_0x12d25b,null))[_0x3dfa('0x26')](handleError(_0x12d25b,null));};exports[_0x3dfa('0x74')]=function(_0x2c8e65,_0x373941,_0x17f270){var _0x48738f=path['join'](config['root'],_0x3dfa('0x75'));var _0x546576={'where':{'id':_0x2c8e65[_0x3dfa('0x52')]['id']},'attributes':['id',_0x3dfa('0x6b')],'raw':!![]};var _0x280128=![];return require('../../config/license/util')[_0x3dfa('0x76')]()[_0x3dfa('0x31')](function(_0x4c4b80){if(_0x4c4b80){_0x280128=_0x4c4b80[_0x3dfa('0x77')];}})[_0x3dfa('0x31')](function(){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')](_0x546576);})[_0x3dfa('0x31')](handleEntityNotFound(_0x373941,null))[_0x3dfa('0x31')](function(_0xb568b6){if(_0xb568b6){if(!_['isNil'](_0xb568b6[_0x3dfa('0x6b')])){if(fs['existsSync'](path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x7a'),_0xb568b6['sitepic']))&&_0x280128){_0x48738f=path[_0x3dfa('0x78')](config['root'],'server/files/images/logos/',_0xb568b6[_0x3dfa('0x6b')]);}}return _0x373941[_0x3dfa('0x7b')](_0x48738f);}})['catch'](handleError(_0x373941,null));};exports[_0x3dfa('0x7c')]=function(_0x2b2755,_0x285ef1,_0x3e401e){var _0x2b264f=path['join'](config[_0x3dfa('0x79')],_0x3dfa('0x7d'));var _0x5d8cab={'where':{'id':_0x2b2755[_0x3dfa('0x52')]['id']},'attributes':['id',_0x3dfa('0x6f')],'raw':!![]};return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')](_0x5d8cab)[_0x3dfa('0x31')](handleEntityNotFound(_0x285ef1,null))[_0x3dfa('0x31')](function(_0x4132fb){if(_0x4132fb){if(!_[_0x3dfa('0x7e')](_0x4132fb[_0x3dfa('0x6f')])){if(fs[_0x3dfa('0x7f')](path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x80'),_0x4132fb[_0x3dfa('0x6f')]))){_0x2b264f=path[_0x3dfa('0x78')](config['root'],_0x3dfa('0x80'),_0x4132fb[_0x3dfa('0x6f')]);}}return _0x285ef1[_0x3dfa('0x7b')](_0x2b264f);}})[_0x3dfa('0x26')](handleError(_0x285ef1,null));};exports['getCustomerAvatar']=function(_0x5374cb,_0x496be1,_0x19ac81){var _0x5ecfd8=path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x81'));var _0x58c45d={'where':{'id':_0x5374cb[_0x3dfa('0x52')]['id']},'attributes':['id',_0x3dfa('0x71'),_0x3dfa('0x82')],'raw':!![]};return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')](_0x58c45d)[_0x3dfa('0x31')](handleEntityNotFound(_0x496be1,null))[_0x3dfa('0x31')](function(_0x22d8d1){if(_0x22d8d1){if(!_[_0x3dfa('0x7e')](_0x22d8d1[_0x3dfa('0x71')])){if(fs[_0x3dfa('0x7f')](path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],'server/files/images/avatars/',_0x22d8d1[_0x3dfa('0x71')]))&&_0x22d8d1[_0x3dfa('0x82')]){_0x5ecfd8=path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x80'),_0x22d8d1[_0x3dfa('0x71')]);}}return _0x496be1[_0x3dfa('0x7b')](_0x5ecfd8);}})[_0x3dfa('0x26')](handleError(_0x496be1,null));};exports[_0x3dfa('0x83')]=function(_0x327ed8,_0x319bbd,_0x2a5c38){var _0x3be7b9=path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x84'));var _0x8ee999={'where':{'id':_0x327ed8[_0x3dfa('0x52')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x3dfa('0x5b')](_0x8ee999)['then'](handleEntityNotFound(_0x319bbd,null))['then'](function(_0xa1d59c){if(_0xa1d59c){if(!_[_0x3dfa('0x7e')](_0xa1d59c[_0x3dfa('0x73')])){if(fs[_0x3dfa('0x7f')](path[_0x3dfa('0x78')](config['root'],_0x3dfa('0x80'),_0xa1d59c[_0x3dfa('0x73')]))){_0x3be7b9=path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0x80'),_0xa1d59c[_0x3dfa('0x73')]);}}return _0x319bbd['download'](_0x3be7b9);}})['catch'](handleError(_0x319bbd,null));};exports[_0x3dfa('0x85')]=function(_0x48c425,_0x4997d5,_0x14e6be){var _0xd2094c=require(_0x3dfa('0x86'));var _0x11d2b5=new _0xd2094c();var _0x18851a=_0x11d2b5[_0x3dfa('0x87')](_0x48c425['headers'][_0x3dfa('0x88')])[_0x3dfa('0x89')]();var _0x5dc8fb={'body':_0x48c425[_0x3dfa('0x56')],'channel':'chat'};var _0x87b626=[];var _0x5bf31b=[];var _0x248ec7={};var _0x4976a9=![];return db[_0x3dfa('0x8a')][_0x3dfa('0x5d')]()['then'](function(_0x499414){if(!_0x499414){throw new db[(_0x3dfa('0x8b'))]['ValidationError']('no\x20available\x20attributes');}_0x87b626=_[_0x3dfa('0x8c')](_['keys'](_0x499414),[_0x3dfa('0x8d'),_0x3dfa('0x8e')]);_0x5bf31b=_['difference'](_[_0x3dfa('0x3f')](_0x499414),[_0x3dfa('0x8d'),_0x3dfa('0x8e'),'CompanyId','ListId']);if(_0x48c425[_0x3dfa('0x56')]['id']){delete _0x48c425[_0x3dfa('0x56')]['id'];}if(_['isNil'](_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x8f')])){throw new db[(_0x3dfa('0x8b'))][(_0x3dfa('0x90'))]('from\x20is\x20mandatory');}if(_[_0x3dfa('0x7e')](_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x56')])||_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x56')]===''){throw new db['Sequelize'][(_0x3dfa('0x90'))](_0x3dfa('0x91'));}if(_[_0x3dfa('0x7e')](_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x92')])){throw new db[(_0x3dfa('0x8b'))]['ValidationError'](_0x3dfa('0x93')+_0x5bf31b);}if(!_[_0x3dfa('0x94')](_0x5bf31b,_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x92')])){throw new db[(_0x3dfa('0x8b'))][(_0x3dfa('0x90'))](_0x3dfa('0x95')+_0x5bf31b);}_0x248ec7[_0x48c425[_0x3dfa('0x56')]['mapKey']]=_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x8f')];})[_0x3dfa('0x31')](function(){return db[_0x3dfa('0x3b')]['find']({'where':{'id':_0x48c425[_0x3dfa('0x52')]['id']},'include':[{'model':db[_0x3dfa('0x96')],'as':_0x3dfa('0x97'),'include':[{'model':db[_0x3dfa('0x8a')],'as':_0x3dfa('0x98'),'where':_0x248ec7,'limit':0x1,'order':[['updatedAt',_0x3dfa('0x99')]]}]},{'model':db[_0x3dfa('0x9a')],'as':_0x3dfa('0x9b')}]});})[_0x3dfa('0x31')](handleEntityNotFound(_0x4997d5,null))[_0x3dfa('0x31')](function(_0x130b3b){if(_0x130b3b&&_0x130b3b[_0x3dfa('0x97')]){_0x5dc8fb[_0x3dfa('0x9c')]=_0x130b3b;_0x5dc8fb[_0x3dfa('0x9d')]=_0x130b3b[_0x3dfa('0x9b')];_0x5dc8fb['list']=_0x130b3b[_0x3dfa('0x97')];_0x5dc8fb[_0x3dfa('0x9d')]=_[_0x3dfa('0x9e')](_0x5dc8fb[_0x3dfa('0x9d')],[_0x3dfa('0x9f')],[_0x3dfa('0xa0')]);if(_0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0x9b')]){delete _0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0x9b')];}if(_0x5dc8fb['account']['List']&&_0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0x97')][_0x3dfa('0x98')][_0x3dfa('0x45')]){return _0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0x97')][_0x3dfa('0x98')][0x0];}var _0x3e6f4b=_[_0x3dfa('0x16')](_0x48c425[_0x3dfa('0x56')],{'firstName':_0x48c425['body'][_0x3dfa('0x8f')],'ListId':_0x130b3b[_0x3dfa('0xa1')]});_0x3e6f4b[_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x92')]]=_0x48c425['body']['from'];return db[_0x3dfa('0x8a')]['create'](_0x3e6f4b,{'fields':_0x87b626,'raw':!![]});}})[_0x3dfa('0x31')](handleEntityNotFound(_0x4997d5,null))[_0x3dfa('0x31')](function(_0x2cf305){_0x5dc8fb[_0x3dfa('0xa2')]=_0x2cf305;var _0x54633d=_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xa3')];if(_0x48c425[_0x3dfa('0xa4')]['cf-connecting-ip']){_0x54633d=_0x48c425[_0x3dfa('0xa4')][_0x3dfa('0xa5')];}else if(_0x48c425[_0x3dfa('0xa4')]['x-forwarded-for']){_0x54633d=_[_0x3dfa('0xa6')](_0x48c425[_0x3dfa('0xa4')]['x-forwarded-for'][_0x3dfa('0xa7')](','));}if(_0x2cf305){var _0x5eb9cb={'ContactId':_0x2cf305['id'],'ChatWebsiteId':_0x48c425[_0x3dfa('0x52')]['id'],'from':(_0x2cf305[_0x3dfa('0xa8')]||'')+'\x20'+(_0x2cf305[_0x3dfa('0xa9')]||''),'customerIp':_0x54633d,'customerPort':_0x48c425[_0x3dfa('0xa4')]['x-real-port']?_0x48c425[_0x3dfa('0xa4')][_0x3dfa('0xaa')]:null,'referer':_0x48c425['body'][_0x3dfa('0xab')],'browserName':_0x18851a[_0x3dfa('0xac')][_0x3dfa('0x36')]&&_0x18851a[_0x3dfa('0xac')][_0x3dfa('0xad')]?util['format'](_0x3dfa('0xae'),_0x18851a[_0x3dfa('0xac')][_0x3dfa('0x36')],_0x18851a[_0x3dfa('0xac')][_0x3dfa('0xad')]):_0x3dfa('0xaf'),'browserVersion':_0x18851a[_0x3dfa('0xac')][_0x3dfa('0xad')]||_0x3dfa('0xaf'),'osName':util[_0x3dfa('0xb0')]('%s\x20%s',_0x18851a['os'][_0x3dfa('0x36')],_0x18851a['os'][_0x3dfa('0xad')]),'osVersion':_0x18851a['os'][_0x3dfa('0xad')],'deviceModel':_0x18851a[_0x3dfa('0xb1')][_0x3dfa('0x41')]&&_0x18851a['device'][_0x3dfa('0xb2')]?util[_0x3dfa('0xb0')](_0x3dfa('0xb3'),_0x18851a[_0x3dfa('0xb1')][_0x3dfa('0x41')],_0x18851a[_0x3dfa('0xb1')][_0x3dfa('0xb2')],_0x18851a[_0x3dfa('0xb1')][_0x3dfa('0x4d')]):null,'deviceVendor':_0x18851a['device'][_0x3dfa('0xb2')],'deviceType':_0x18851a[_0x3dfa('0xb1')]['type'],'formData':JSON[_0x3dfa('0x20')](_0x48c425['body'])};var _0x1e2df2={'ChatWebsiteId':_0x48c425[_0x3dfa('0x52')]['id'],'closed':![]};if(_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb4')]){_0x1e2df2['threadId']=_0x48c425['body'][_0x3dfa('0xb4')];return db[_0x3dfa('0xb5')][_0x3dfa('0x5b')]({'where':_0x1e2df2})[_0x3dfa('0x31')](function(_0x3df4e0){if(_0x3df4e0){return[_0x3df4e0,![]];}_0x5eb9cb['threadId']=_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb4')];_0x5eb9cb[_0x3dfa('0xb6')]=_0x48c425['body'][_0x3dfa('0xb6')];return db[_0x3dfa('0xb5')]['create'](_0x5eb9cb)['then'](function(_0x3a57ae){return[_0x3a57ae,!![]];});});}_0x1e2df2['ContactId']=_0x2cf305['id'];if(_0x48c425['body'][_0x3dfa('0xb7')]&&_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb7')]['id']){_0x1e2df2['id']=_0x48c425[_0x3dfa('0x56')]['interaction']['id'];return db[_0x3dfa('0xb5')][_0x3dfa('0x5b')]({'where':_0x1e2df2})[_0x3dfa('0x31')](function(_0x449004){if(_0x449004){return[_0x449004,![]];}return db['ChatInteraction'][_0x3dfa('0x55')](_0x5eb9cb)[_0x3dfa('0x31')](function(_0x2d562b){return[_0x2d562b,!![]];});});}return db[_0x3dfa('0xb5')][_0x3dfa('0x55')](_0x5eb9cb)['then'](function(_0x22e484){return[_0x22e484,!![]];});}})[_0x3dfa('0xb8')](function(_0x23313c,_0x41ebf1){if(_0x23313c){_0x4976a9=_0x41ebf1;if(!_0x41ebf1){var _0x39c583={'from':(_0x5dc8fb[_0x3dfa('0xa2')][_0x3dfa('0xa8')]||'')+'\x20'+(_0x5dc8fb[_0x3dfa('0xa2')][_0x3dfa('0xa9')]||'')};if(_0x48c425[_0x3dfa('0x56')]['threadId']&&_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb9')]&&_0x48c425['body'][_0x3dfa('0xb4')]!=_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb9')]){_0x39c583[_0x3dfa('0xb4')]=_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xb9')];}return _0x23313c['update'](_0x39c583);}else{return _0x23313c;}}})[_0x3dfa('0x31')](function(_0x2293eb){_0x5dc8fb[_0x3dfa('0xb7')]=_0x2293eb['get']({'plain':!![]});_0x5dc8fb['interaction']['created']=_0x4976a9;if(_0x5dc8fb['interaction'][_0x3dfa('0xba')]){if(_0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0xbb')]){_0x5dc8fb[_0x3dfa('0x9d')][_0x3dfa('0xbc')]({'id':0x0,'priority':_0x5dc8fb['applications']['length']+0x1,'app':'close','appdata':_0x3dfa('0xbd'),'interval':_0x3dfa('0xbe')});}}return db[_0x3dfa('0xbf')]['create']({'body':_0x48c425[_0x3dfa('0x56')][_0x3dfa('0x56')],'ChatWebsiteId':_0x48c425['params']['id'],'ChatInteractionId':_0x2293eb['id'],'direction':'in','ContactId':_0x5dc8fb['contact']['id'],'AttachmentId':_0x48c425[_0x3dfa('0x56')][_0x3dfa('0xc0')]});})[_0x3dfa('0x31')](function(_0x357804){_0x5dc8fb['message']=_0x357804;if(_0x5dc8fb['interaction'][_0x3dfa('0xc1')]){return db[_0x3dfa('0xc2')][_0x3dfa('0x5b')]({'attributes':['id',_0x3dfa('0x36')],'where':{'id':_0x5dc8fb[_0x3dfa('0xb7')][_0x3dfa('0xc1')]}})[_0x3dfa('0x31')](function(_0x384954){if(_0x384954){_0x5dc8fb[_0x3dfa('0x9d')][_0x3dfa('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3dfa('0xc4'),'appdata':_0x384954[_0x3dfa('0x36')]+','+(_0x5dc8fb[_0x3dfa('0x9c')][_0x3dfa('0xc5')]||0xa),'interval':_0x3dfa('0xbe')});_0x5dc8fb[_0x3dfa('0xc6')]=!![];}return respondWithRpcPromise(_0x3dfa('0xc7'),_0x3dfa('0xc8'),_0x5dc8fb);});}return respondWithRpcPromise(_0x3dfa('0xc7'),_0x3dfa('0xc8'),_0x5dc8fb);})['then'](function(_0x5f119c){respondWithRpcPromise(_0x3dfa('0xc9'),'EventManager',{'event':_0x3dfa('0x85'),'message':_0x5f119c},client9002);return _0x5f119c;})['then'](respondWithResult(_0x4997d5,null))[_0x3dfa('0x26')](handleError(_0x4997d5,null));};exports[_0x3dfa('0xca')]=function(_0x1ff3c2,_0x4f2149,_0x5d97d3){var _0xa0ead9,_0x3f9812,_0x2d5b5b;var _0x493893=[];var _0x4f915b=[];var _0xe79a82={};var _0x20df13=_0x1ff3c2[_0x3dfa('0xcb')]||[];var _0x465651=[];var _0x2137e6;return db['CmContact'][_0x3dfa('0x5d')]()[_0x3dfa('0x31')](function(_0x45ecd7){if(!_0x45ecd7){throw new db[(_0x3dfa('0x8b'))]['ValidationError'](_0x3dfa('0xcc'));}_0x4f915b=_[_0x3dfa('0x8c')](_[_0x3dfa('0x3f')](_0x45ecd7),[_0x3dfa('0x8d'),_0x3dfa('0x8e')]);_0x493893=_['difference'](_[_0x3dfa('0x3f')](_0x45ecd7),[_0x3dfa('0x8d'),_0x3dfa('0x8e'),_0x3dfa('0xcd'),_0x3dfa('0xa1')]);if(_0x1ff3c2[_0x3dfa('0x56')]['id']){delete _0x1ff3c2[_0x3dfa('0x56')]['id'];}if(_[_0x3dfa('0x7e')](_0x1ff3c2[_0x3dfa('0x56')]['from'])){throw _0x4f2149[_0x3dfa('0x2d')](0x1f4)[_0x3dfa('0xce')](new db['Sequelize'][(_0x3dfa('0x90'))]('from\x20is\x20mandatory'));}if(_[_0x3dfa('0x7e')](_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x56')])||_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x56')]===''){throw _0x4f2149[_0x3dfa('0x2d')](0x1f4)[_0x3dfa('0xce')](new db[(_0x3dfa('0x8b'))][(_0x3dfa('0x90'))](_0x3dfa('0x91')));}if(_[_0x3dfa('0x7e')](_0x1ff3c2['body'][_0x3dfa('0xcf')])){throw _0x4f2149[_0x3dfa('0x2d')](0x1f4)[_0x3dfa('0xce')](new db[(_0x3dfa('0x8b'))]['ValidationError'](_0x3dfa('0xd0')+_0x493893));}if(!_[_0x3dfa('0x94')](_0x493893,_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0xcf')])){throw _0x4f2149[_0x3dfa('0x2d')](0x1f4)[_0x3dfa('0xce')](new db[(_0x3dfa('0x8b'))][(_0x3dfa('0x90'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x493893));}_0xe79a82[_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0xcf')]]=_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x8f')];})[_0x3dfa('0x31')](function(){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x1ff3c2[_0x3dfa('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x3dfa('0xd1')],'as':_0x3dfa('0xd1')}]});})[_0x3dfa('0x31')](handleEntityNotFound(_0x4f2149,null))[_0x3dfa('0x31')](function(_0x102b23){if(_0x102b23&&_0x102b23['List']){_0x3f9812=_0x102b23;var _0x35fae2=_[_0x3dfa('0x16')](_0x1ff3c2[_0x3dfa('0x56')],{'firstName':_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x8f')],'phone':_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x8f')],'ListId':_0x102b23[_0x3dfa('0xa1')]});_0x35fae2[_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0xcf')]]=_0x1ff3c2[_0x3dfa('0x56')]['from'];return db[_0x3dfa('0x8a')][_0x3dfa('0xd2')]({'where':_0xe79a82,'defaults':_0x35fae2});}})['spread'](function(_0x113895){if(_0x113895){_0x2d5b5b=_0x113895;var _0x7e148b=fs[_0x3dfa('0xd3')](path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],'server/files/templates/chatOfflineMessage.ejs'),_0x3dfa('0xd4'));var _0x110aa7=ejs[_0x3dfa('0xd5')](_0x7e148b,{'body':_[_0x3dfa('0xd6')](_0x1ff3c2[_0x3dfa('0x56')][_0x3dfa('0x56')]),'bodyTitle':_0x3f9812['offlineMessageBody']});return db[_0x3dfa('0xd7')][_0x3dfa('0x55')]({'body':_0x110aa7,'ContactId':_0x113895['id'],'ChatWebsiteId':_0x3f9812['id']});}})[_0x3dfa('0x31')](function(_0x3f9232){_0x2137e6=_0x3f9232;if(_0x20df13[_0x3dfa('0x45')]){var _0x4385c2=_0x20df13[_0x3dfa('0x3a')](function(_0x141b96){return{'name':_0x141b96['originalname'],'basename':_0x141b96[_0x3dfa('0x6d')],'type':_0x141b96['mimetype'],'ChatOfflineMessageId':_0x3f9232['id']};});_0x465651=_0x4385c2[_0x3dfa('0x3a')](_0xbf6838=>{var _0x43d4c2={'filename':_0xbf6838['name'],'path':path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0xd8'),_0x3dfa('0xcb'),_0x3dfa('0xd9'),_0x3dfa('0xda'),_0xbf6838[_0x3dfa('0xdb')])};return _0x43d4c2;});if(!_0x3f9812['openNewInteraction']){return db[_0x3dfa('0xdc')]['transaction'](function(_0x198ae5){return db[_0x3dfa('0xdd')][_0x3dfa('0xde')](_0x4385c2,{'transaction':_0x198ae5});});}}})[_0x3dfa('0x31')](function(){if(_0x2137e6){_0xa0ead9=_0x2137e6;return db[_0x3dfa('0xd1')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x3dfa('0x31')](function(_0x423bb2){if(_0x423bb2&&_0x423bb2[_0x3dfa('0xdf')]&&_0x3f9812[_0x3dfa('0xe0')]&&_0x3f9812[_0x3dfa('0xe1')]){var _0x269f27={'tls':{'rejectUnauthorized':![]}};if(_0x423bb2[_0x3dfa('0xdf')][_0x3dfa('0xe2')]){_0x269f27[_0x3dfa('0xe2')]=_0x423bb2[_0x3dfa('0xdf')][_0x3dfa('0xe2')];}else{_0x269f27[_0x3dfa('0xe3')]=_0x423bb2['Smtp'][_0x3dfa('0xe3')];_0x269f27[_0x3dfa('0xe4')]=_0x423bb2['Smtp'][_0x3dfa('0xe4')];_0x269f27[_0x3dfa('0xe5')]=_0x423bb2['Smtp']['secure'];}if(_0x423bb2[_0x3dfa('0xdf')][_0x3dfa('0xe6')]){_0x269f27[_0x3dfa('0xe7')]={'user':_0x423bb2[_0x3dfa('0xdf')]['user'],'pass':_0x423bb2['Smtp'][_0x3dfa('0xe8')]};}return respondWithRpcPromise(_0x3dfa('0xe9'),_0x3dfa('0xea'),{'account':_0x269f27,'message':{'from':util['format'](_0x3dfa('0xeb'),_0x423bb2['name'],_0x423bb2[_0x3dfa('0xec')]||_0x423bb2[_0x3dfa('0xdf')][_0x3dfa('0x57')]),'to':_0x3f9812['forwardOfflineAddress'],'subject':_0x3f9812[_0x3dfa('0xed')],'html':_0xa0ead9[_0x3dfa('0x56')],'attachments':_0x465651}},client9003)[_0x3dfa('0x31')](function(){return _0xa0ead9;})[_0x3dfa('0x26')](function(_0x4bbd70){console[_0x3dfa('0x21')](_0x4bbd70);});}})['then'](function(){if(_0x3f9812&&_0x3f9812[_0x3dfa('0xee')]&&_0x3f9812['MailAccountId']){var _0x516553=[];if(_0x20df13['length']){_0x516553=_0x20df13[_0x3dfa('0x3a')](function(_0x4628f2){return{'name':_0x4628f2[_0x3dfa('0xef')],'basename':_0x4628f2[_0x3dfa('0x6d')],'type':_0x4628f2[_0x3dfa('0xf0')],'ChatOfflineMessageId':_0x2137e6['id']};});}var _0x24f7c6;if(!_[_0x3dfa('0x7e')](_0x3f9812['subjectOffline'])){var _0x5ae161=_[_0x3dfa('0x3a')](_0x1ff3c2[_0x3dfa('0x56')],function(_0x1138cb){return _0x1138cb;});var _0x357da6=_[_0x3dfa('0xf1')](_0x5ae161)[0x0];var _0x38fbe9=_[_0x3dfa('0xf2')](_0x357da6,function(_0x5d6960){return _0x5d6960;});_0x24f7c6=_0x38fbe9[0x1][_0x3f9812['subjectOffline']];}var _0x315868={'from':_0x2d5b5b['email'],'firstName':_0x2d5b5b[_0x3dfa('0xa8')],'lastName':_0x2d5b5b[_0x3dfa('0xa9')],'mapKey':_0x3dfa('0xec'),'message':{'from':_0x2d5b5b[_0x3dfa('0xec')],'to':_0x3f9812[_0x3dfa('0xd1')]['email'],'cc':'','subject':_[_0x3dfa('0x7e')](_0x24f7c6)?_0x3f9812['offlineMessageSubject']:_0x24f7c6,'messageId':'','sentAt':new Date(),'attach':_0x516553[_0x3dfa('0x45')],'attachments':_0x516553,'originChannel':_0x3dfa('0xf3'),'ChatWebsiteId':_0x3f9812['id'],'ChatOfflineMessageId':_0xa0ead9['id'],'originTo':_0x3f9812[_0x3dfa('0xd1')]['email']},'body':_0xa0ead9[_0x3dfa('0x56')]};var _0xca1706={'account':{'id':_0x3f9812[_0x3dfa('0xf4')]},'body':_0x315868,'log':_0x3dfa('0xf5')};return respondWithRpcPromise(_0x3dfa('0xf5'),'notifyMail',_0xca1706,client9001)[_0x3dfa('0x31')](function(){return _0xa0ead9;})[_0x3dfa('0x26')](function(_0xc0167f){console['error'](_0xc0167f);});}return;})[_0x3dfa('0x31')](function(){if(_0xa0ead9){return _0xa0ead9;}})[_0x3dfa('0x31')](respondWithResult(_0x4f2149,null))[_0x3dfa('0x26')](function(_0x9134a3){console[_0x3dfa('0x21')](_0x3dfa('0x26'),_0x9134a3);for(var _0x51e4d0 of _0x20df13){var _0xf619d2=path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],_0x3dfa('0xd8'),_0x3dfa('0xcb'),'attachments',_0x3dfa('0xda'),_0x51e4d0[_0x3dfa('0x6d')]);fs_extra[_0x3dfa('0xf6')](_0xf619d2)['catch'](function(_0x33b601){console[_0x3dfa('0x21')]('Could\x20not\x20remove\x20attachment\x20file',_0xf619d2,_0x33b601);});}});};exports[_0x3dfa('0xf7')]=function(_0x335234,_0x257937,_0x1f7750){return db[_0x3dfa('0xb5')]['find']({'where':{'id':_0x335234['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x257937,null))[_0x3dfa('0x31')](function(_0x268d05){if(_0x268d05){return _0x268d05[_0x3dfa('0xf7')](_0x335234[_0x3dfa('0x56')]['ids'],_['omit'](_0x335234[_0x3dfa('0x56')],['ids','id'])||{});}})[_0x3dfa('0x31')](respondWithResult(_0x257937,null))[_0x3dfa('0x26')](handleError(_0x257937,null));};exports[_0x3dfa('0xf8')]=function(_0x10c2f3,_0x15c9f4,_0x594d74){var _0x500c2e={'raw':![],'where':{}};var _0x360b8b={};var _0x42db66={'count':0x0,'rows':[]};return db[_0x3dfa('0x3b')][_0x3dfa('0x69')]({'where':{'id':_0x10c2f3['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x15c9f4,null))[_0x3dfa('0x31')](function(_0x629cef){if(_0x629cef){_0x360b8b[_0x3dfa('0x41')]=_[_0x3dfa('0x3f')](db[_0x3dfa('0xb5')][_0x3dfa('0x53')]);_0x360b8b[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0x10c2f3['query']);_0x360b8b['filters']=_['intersection'](_0x360b8b[_0x3dfa('0x41')],_0x360b8b['query']);_0x500c2e[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x360b8b[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x500c2e[_0x3dfa('0x42')]=_0x500c2e[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x500c2e['attributes']:_0x360b8b[_0x3dfa('0x41')];if(!_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0x46')](_0x3dfa('0x47'))){_0x500c2e['limit']=qs[_0x3dfa('0x2a')](_0x10c2f3['query'][_0x3dfa('0x2a')]);_0x500c2e['offset']=qs[_0x3dfa('0x2c')](_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0x2c')]);}_0x500c2e[_0x3dfa('0x62')]=qs[_0x3dfa('0x48')](_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0x48')]);_0x500c2e[_0x3dfa('0x49')]=qs[_0x3dfa('0x40')](_[_0x3dfa('0x4a')](_0x10c2f3['query'],_0x360b8b['filters']));_0x500c2e['where'][_0x3dfa('0x5f')]=_0x629cef['id'];if(_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0x4b')]){_0x500c2e[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x500c2e[_0x3dfa('0x49')],{'$or':_['map'](_0x500c2e['attributes'],function(_0x35faba){var _0x5a5698={};_0x5a5698[_0x35faba]={'$like':'%'+_0x10c2f3[_0x3dfa('0x3e')]['filter']+'%'};return _0x5a5698;})});}_0x500c2e=_['merge']({},_0x500c2e,_0x10c2f3[_0x3dfa('0x4f')]);return db[_0x3dfa('0xb5')][_0x3dfa('0x2b')]({'where':_0x500c2e[_0x3dfa('0x49')]})[_0x3dfa('0x31')](function(_0x537806){_0x42db66[_0x3dfa('0x2b')]=_0x537806;if(_0x10c2f3['query'][_0x3dfa('0x50')]){_0x500c2e[_0x3dfa('0x54')]=[{'model':db['CmContact'],'as':_0x3dfa('0xf9'),'required':![]},{'model':db[_0x3dfa('0xc2')],'as':_0x3dfa('0xfa'),'attributes':[_0x3dfa('0x36'),_0x3dfa('0xfb'),_0x3dfa('0xfc')],'required':![]},{'model':db[_0x3dfa('0xfd')],'as':'Tags','attributes':['id','name',_0x3dfa('0xfe')],'where':_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0xff')]?{'id':_0x10c2f3['query'][_0x3dfa('0xff')]}:undefined,'required':_0x10c2f3[_0x3dfa('0x3e')][_0x3dfa('0xff')]?!![]:![]}];}return db[_0x3dfa('0xb5')][_0x3dfa('0x51')](_0x500c2e);})[_0x3dfa('0x31')](function(_0x6976b7){_0x42db66[_0x3dfa('0x63')]=_0x6976b7;return _0x42db66;});}})['then'](respondWithFilteredResult(_0x15c9f4,_0x500c2e))[_0x3dfa('0x26')](handleError(_0x15c9f4,null));};function iftimePromise(_0x839307,_0x34b579){return respondWithRpcPromise(_0x3dfa('0x100'),'getSnippet',{'command':_0x34b579[_0x3dfa('0x101')]?util['format']('iftime\x20%s,%s',_0x839307[_0x3dfa('0x102')],_0x34b579[_0x3dfa('0x101')]):util[_0x3dfa('0xb0')](_0x3dfa('0x103'),_0x839307['interval'])},client9002)[_0x3dfa('0x31')](function(_0x42e842){var _0x46b5f4=_0x42e842&&_0x42e842['indexOf'](_0x3dfa('0x104'))>=0x0?!![]:![];logger[_0x3dfa('0x1c')](_0x3dfa('0x105'),_0x34b579['id'],_0x839307['id'],_0x839307['interval'],_0x46b5f4?_0x3dfa('0x106'):_0x3dfa('0x107'),_0x34b579[_0x3dfa('0x101')]?_0x34b579[_0x3dfa('0x101')]:_0x3dfa('0x108'));return _0x46b5f4;})[_0x3dfa('0x26')](function(_0x1e0427){logger[_0x3dfa('0x21')](_0x3dfa('0x105'),_0x34b579['id'],_0x839307['id'],_0x839307[_0x3dfa('0x102')],util['inspect'](_0x1e0427,{'showHidden':![],'depth':null}),_0x34b579[_0x3dfa('0x101')]?_0x34b579[_0x3dfa('0x101')]:_0x3dfa('0x108'));return![];});}exports[_0x3dfa('0x109')]=function(_0x5d22ba,_0x4c58ae,_0x35c9e7){var _0x592415=0x0;var _0x45acb4=0x0;var _0x331678=![];var _0x2f8e1a;var _0x36f3a3;return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x5d22ba[_0x3dfa('0x52')]['id']},'include':[{'model':db[_0x3dfa('0x10a')],'as':'Interval','include':[{'model':db[_0x3dfa('0x10a')],'as':_0x3dfa('0x10b'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4c58ae,null))[_0x3dfa('0x31')](function(_0x31ecb5){if(_0x31ecb5){_0x2f8e1a=_0x31ecb5;return _0x31ecb5[_0x3dfa('0x10c')]({'raw':!![]});}})['then'](function(_0x4023ce){if(_0x2f8e1a){if(_0x4023ce){_0x36f3a3=_0x4023ce;}}return require('../../config/license/util')[_0x3dfa('0x76')]();})[_0x3dfa('0x31')](function(_0x1f8d81){if(_0x1f8d81){_0x45acb4=_0x1f8d81[_0x3dfa('0x10d')];_0x331678=_0x1f8d81[_0x3dfa('0x77')];}})['then'](function(){return db[_0x3dfa('0xb5')][_0x3dfa('0x2b')]({'where':{'closed':![]}});})[_0x3dfa('0x31')](function(_0x5e8740){_0x592415=_0x5e8740;if(_0x45acb4&&_0x5e8740>_0x45acb4){return db[_0x3dfa('0x10e')]['findOne']({'where':{'id':0x1}})[_0x3dfa('0x31')](function(_0x1f95f8){if(_0x1f95f8){_0x1f95f8[_0x3dfa('0x10f')](_0x3dfa('0x110'));}});}})[_0x3dfa('0x31')](function(){if(_0x2f8e1a[_0x3dfa('0x10a')]&&_0x2f8e1a['Interval'][_0x3dfa('0x10b')]){var _0x6173c9=[];for(var _0xf13dd2=0x0;_0xf13dd2<_0x2f8e1a['Interval'][_0x3dfa('0x10b')][_0x3dfa('0x45')];_0xf13dd2++){var _0x1ce02a=_0x2f8e1a[_0x3dfa('0x10a')]['Intervals'][_0xf13dd2][_0x3dfa('0x33')]({'plain':!![]});_0x6173c9[_0x3dfa('0xbc')](iftimePromise(_0x1ce02a,_0x2f8e1a));}return BPromise[_0x3dfa('0x111')](_0x6173c9)['then'](function(_0x3d3aba){return _[_0x3dfa('0x112')](_0x3d3aba);});}else{return!![];}})[_0x3dfa('0x31')](function(_0x4affd6){var _0x2f3056=fs[_0x3dfa('0xd3')](path[_0x3dfa('0x78')](config[_0x3dfa('0x79')],'server/files/chat/iframe.ejs'),'utf8');var _0x5ecd41={'remote':_0x2f8e1a[_0x3dfa('0x113')],'query':querystring[_0x3dfa('0x20')](_[_0x3dfa('0x4c')](_0x2f8e1a[_0x3dfa('0x33')]({'plain':!![]}),{'customerIp':_0x5d22ba[_0x3dfa('0xa4')][_0x3dfa('0x114')]||_0x5d22ba[_0x3dfa('0xa4')]['x-real-ip']||_0x5d22ba[_0x3dfa('0x115')][_0x3dfa('0x116')]||_0x5d22ba['ip'],'referer':_0x5d22ba[_0x3dfa('0xa4')]['referer'],'openedInteractions':_0x592415,'maxInteractions':_0x45acb4,'virtual':_0x331678['virtual'],'online':_0x4affd6,'custom':_0x331678}))[_0x3dfa('0x117')](/'/g,'\x5c\x27')};_0x4c58ae[_0x3dfa('0xce')](ejs['render'](Mustache[_0x3dfa('0xd5')](_0x2f3056,_0x5ecd41),{'proactiveActions':_0x36f3a3,'alignment':_0x2f8e1a[_0x3dfa('0x118')],'verticalAlignment':_0x2f8e1a[_0x3dfa('0x119')],'div_color':_0x2f8e1a[_0x3dfa('0xfe')],'text_color':_0x2f8e1a[_0x3dfa('0x11a')],'button_color':_0x2f8e1a[_0x3dfa('0x11b')],'background_color':_0x2f8e1a['backgroundColor']}));})['catch'](handleError(_0x4c58ae,null));};exports[_0x3dfa('0x11c')]=function(_0x56c60a,_0x368bf0,_0x2806d1){return db['ChatWebsite'][_0x3dfa('0x69')]({'where':{'id':_0x56c60a[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x368bf0,null))[_0x3dfa('0x31')](function(_0x5ea3bc){if(_0x5ea3bc){return db['sequelize']['transaction'](function(_0x229ebb){return db[_0x3dfa('0x9a')][_0x3dfa('0x32')]({'where':{'ChatWebsiteId':_0x56c60a['params']['id']},'transaction':_0x229ebb})['then'](function(_0x5e6ef6){var _0x4a8761=_[_0x3dfa('0x3a')](_0x56c60a[_0x3dfa('0x56')],function(_0x381c45){_0x381c45['ChatWebsiteId']=_0x56c60a[_0x3dfa('0x52')]['id'];return _0x381c45;});return db[_0x3dfa('0x9a')][_0x3dfa('0xde')](_0x4a8761,{'transaction':_0x229ebb});});})['then'](function(){return db['ChatApplication'][_0x3dfa('0x11d')]({'where':{'ChatWebsiteId':_0x56c60a[_0x3dfa('0x52')]['id']},'order':_0x3dfa('0x9f')});});}})['then'](respondWithResult(_0x368bf0,null))[_0x3dfa('0x26')](handleError(_0x368bf0,null));};exports[_0x3dfa('0x11e')]=function(_0x221fa3,_0x14a2a6,_0x1b16c3){var _0x1c1f2f={};var _0x226db8={};var _0x684cc8;var _0x583195;return db[_0x3dfa('0x3b')][_0x3dfa('0x69')]({'where':{'id':_0x221fa3['params']['id']}})['then'](handleEntityNotFound(_0x14a2a6,null))[_0x3dfa('0x31')](function(_0x130c99){if(_0x130c99){_0x684cc8=_0x130c99;_0x226db8[_0x3dfa('0x41')]=_[_0x3dfa('0x3f')](db['ChatApplication']['rawAttributes']);_0x226db8[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0x221fa3[_0x3dfa('0x3e')]);_0x226db8[_0x3dfa('0x40')]=_[_0x3dfa('0x43')](_0x226db8[_0x3dfa('0x41')],_0x226db8[_0x3dfa('0x3e')]);_0x1c1f2f['attributes']=_[_0x3dfa('0x43')](_0x226db8[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0x221fa3[_0x3dfa('0x3e')]['fields']));_0x1c1f2f[_0x3dfa('0x42')]=_0x1c1f2f[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x1c1f2f['attributes']:_0x226db8[_0x3dfa('0x41')];_0x1c1f2f[_0x3dfa('0x62')]=qs[_0x3dfa('0x48')](_0x221fa3['query'][_0x3dfa('0x48')]);_0x1c1f2f[_0x3dfa('0x49')]=qs[_0x3dfa('0x40')](_[_0x3dfa('0x4a')](_0x221fa3[_0x3dfa('0x3e')],_0x226db8['filters']));if(_0x221fa3[_0x3dfa('0x3e')]['filter']){_0x1c1f2f[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x1c1f2f[_0x3dfa('0x49')],{'$or':_['map'](_0x1c1f2f[_0x3dfa('0x42')],function(_0x35b52b){var _0x50e2c9={};_0x50e2c9[_0x35b52b]={'$like':'%'+_0x221fa3[_0x3dfa('0x3e')][_0x3dfa('0x4b')]+'%'};return _0x50e2c9;})});}_0x1c1f2f=_['merge']({},_0x1c1f2f,_0x221fa3['options']);return _0x684cc8[_0x3dfa('0x11e')](_0x1c1f2f);}})[_0x3dfa('0x31')](function(_0x649998){if(_0x649998){_0x583195=_0x649998['length'];if(!_0x221fa3[_0x3dfa('0x3e')]['hasOwnProperty']('nolimit')){_0x1c1f2f[_0x3dfa('0x2a')]=qs[_0x3dfa('0x2a')](_0x221fa3[_0x3dfa('0x3e')][_0x3dfa('0x2a')]);_0x1c1f2f[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0x221fa3[_0x3dfa('0x3e')][_0x3dfa('0x2c')]);}return _0x684cc8[_0x3dfa('0x11e')](_0x1c1f2f);}})['then'](function(_0x156850){if(_0x156850){return _0x156850?{'count':_0x583195,'rows':_0x156850}:null;}})[_0x3dfa('0x31')](respondWithResult(_0x14a2a6,null))[_0x3dfa('0x26')](handleError(_0x14a2a6,null));};exports[_0x3dfa('0x11f')]=function(_0x376ec8,_0x41f3d6,_0x4e73a0){return db[_0x3dfa('0x120')]['find']({'where':{'id':_0x376ec8['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x41f3d6,null))[_0x3dfa('0x31')](function(_0xdacc73){if(_0xdacc73){return _0xdacc73[_0x3dfa('0x11f')](_0x376ec8[_0x3dfa('0x56')][_0x3dfa('0x65')],_[_0x3dfa('0x121')](_0x376ec8['body'],[_0x3dfa('0x65'),'id'])||{});}})[_0x3dfa('0x31')](respondWithResult(_0x41f3d6,null))[_0x3dfa('0x26')](handleError(_0x41f3d6,null));};exports['getProactiveActions']=function(_0x1aa65f,_0x2d6fcd,_0x110b70){var _0x4b8fe8={};var _0x1a3b1f={};var _0x225a83;var _0x129c00;return db['ChatWebsite'][_0x3dfa('0x69')]({'where':{'id':_0x1aa65f[_0x3dfa('0x52')]['id']}})['then'](handleEntityNotFound(_0x2d6fcd,null))[_0x3dfa('0x31')](function(_0x395fab){if(_0x395fab){_0x225a83=_0x395fab;_0x1a3b1f['model']=_[_0x3dfa('0x3f')](db['ChatProactiveAction'][_0x3dfa('0x53')]);_0x1a3b1f[_0x3dfa('0x3e')]=_['keys'](_0x1aa65f[_0x3dfa('0x3e')]);_0x1a3b1f['filters']=_[_0x3dfa('0x43')](_0x1a3b1f['model'],_0x1a3b1f[_0x3dfa('0x3e')]);_0x4b8fe8[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x1a3b1f[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x4b8fe8['attributes']=_0x4b8fe8[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x4b8fe8[_0x3dfa('0x42')]:_0x1a3b1f[_0x3dfa('0x41')];_0x4b8fe8[_0x3dfa('0x62')]=qs[_0x3dfa('0x48')](_0x1aa65f['query'][_0x3dfa('0x48')]);_0x4b8fe8[_0x3dfa('0x49')]=qs[_0x3dfa('0x40')](_['pick'](_0x1aa65f['query'],_0x1a3b1f['filters']));if(_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x4b')]){_0x4b8fe8['where']=_[_0x3dfa('0x4c')](_0x4b8fe8['where'],{'$or':_['map'](_0x4b8fe8[_0x3dfa('0x42')],function(_0x24a398){var _0x19bd53={};_0x19bd53[_0x24a398]={'$like':'%'+_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x4b')]+'%'};return _0x19bd53;})});}_0x4b8fe8=_[_0x3dfa('0x4c')]({},_0x4b8fe8,_0x1aa65f[_0x3dfa('0x4f')]);return _0x225a83[_0x3dfa('0x10c')](_0x4b8fe8);}})[_0x3dfa('0x31')](function(_0x5c6219){if(_0x5c6219){_0x129c00=_0x5c6219[_0x3dfa('0x45')];if(!_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x46')](_0x3dfa('0x47'))){_0x4b8fe8[_0x3dfa('0x2a')]=qs[_0x3dfa('0x2a')](_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x2a')]);_0x4b8fe8[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0x1aa65f[_0x3dfa('0x3e')][_0x3dfa('0x2c')]);}return _0x225a83[_0x3dfa('0x10c')](_0x4b8fe8);}})[_0x3dfa('0x31')](function(_0x20f315){if(_0x20f315){return _0x20f315?{'count':_0x129c00,'rows':_0x20f315}:null;}})[_0x3dfa('0x31')](respondWithResult(_0x2d6fcd,null))[_0x3dfa('0x26')](handleError(_0x2d6fcd,null));};exports[_0x3dfa('0x122')]=function(_0x34e192,_0x1d11d9,_0x5ed8cf){var _0x16bdb1=_0x34e192['query']['online']===_0x3dfa('0x123')?_0x3dfa('0x124'):'onlineForm';return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'attributes':['id',_0x16bdb1],'where':{'id':_0x34e192[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x1d11d9,null))[_0x3dfa('0x31')](function(_0x9b7781){if(_0x9b7781){var _0x58af6a=_0x9b7781[_0x16bdb1];var _0x2c3d71=_0x58af6a&&_0x58af6a[_0x3dfa('0x125')]?_0x58af6a[_0x3dfa('0x125')]:[];_0x1d11d9[_0x3dfa('0xce')]({'fromKey':_[_0x3dfa('0x7e')](_0x58af6a[_0x3dfa('0x126')])?undefined:_0x58af6a[_0x3dfa('0x126')],'count':_0x2c3d71['length'],'rows':_0x2c3d71});}})['catch'](handleError(_0x1d11d9,null));};exports[_0x3dfa('0x127')]=function(_0x5d1621,_0x3899f8,_0x427f28){var _0x2d90da={'raw':![],'where':{}};var _0x5f215e={};var _0x5af97e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3dfa('0x69')]({'where':{'id':_0x5d1621[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x3899f8,null))['then'](function(_0x339065){if(_0x339065){_0x5f215e['model']=_['keys'](db[_0x3dfa('0xd7')]['rawAttributes']);_0x5f215e[_0x3dfa('0x3e')]=_['keys'](_0x5d1621[_0x3dfa('0x3e')]);_0x5f215e[_0x3dfa('0x40')]=_[_0x3dfa('0x43')](_0x5f215e['model'],_0x5f215e[_0x3dfa('0x3e')]);_0x2d90da[_0x3dfa('0x42')]=_[_0x3dfa('0x43')](_0x5f215e[_0x3dfa('0x41')],qs[_0x3dfa('0x44')](_0x5d1621[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x2d90da['attributes']=_0x2d90da[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x2d90da[_0x3dfa('0x42')]:_0x5f215e[_0x3dfa('0x41')];if(!_0x5d1621[_0x3dfa('0x3e')]['hasOwnProperty'](_0x3dfa('0x47'))){_0x2d90da[_0x3dfa('0x2a')]=qs[_0x3dfa('0x2a')](_0x5d1621[_0x3dfa('0x3e')][_0x3dfa('0x2a')]);_0x2d90da['offset']=qs['offset'](_0x5d1621['query'][_0x3dfa('0x2c')]);}_0x2d90da[_0x3dfa('0x62')]=qs[_0x3dfa('0x48')](_0x5d1621[_0x3dfa('0x3e')]['sort']);_0x2d90da[_0x3dfa('0x49')]=qs['filters'](_['pick'](_0x5d1621[_0x3dfa('0x3e')],_0x5f215e[_0x3dfa('0x40')]));_0x2d90da[_0x3dfa('0x49')][_0x3dfa('0x5f')]=_0x339065['id'];if(_0x5d1621[_0x3dfa('0x3e')]['filter']){_0x2d90da[_0x3dfa('0x49')]=_['merge'](_0x2d90da['where'],{'$or':_[_0x3dfa('0x3a')](_0x2d90da[_0x3dfa('0x42')],function(_0x5beaf7){var _0x40485={};_0x40485[_0x5beaf7]={'$like':'%'+_0x5d1621[_0x3dfa('0x3e')]['filter']+'%'};return _0x40485;})});}_0x2d90da=_[_0x3dfa('0x4c')]({},_0x2d90da,_0x5d1621[_0x3dfa('0x4f')]);return db['ChatOfflineMessage'][_0x3dfa('0x2b')]({'where':_0x2d90da[_0x3dfa('0x49')]})[_0x3dfa('0x31')](function(_0xcb354e){_0x5af97e[_0x3dfa('0x2b')]=_0xcb354e;if(_0x5d1621[_0x3dfa('0x3e')][_0x3dfa('0x50')]){_0x2d90da[_0x3dfa('0x54')]=[{'all':!![]}];}else{_0x2d90da[_0x3dfa('0x54')]=[{'model':db[_0x3dfa('0x8a')],'as':_0x3dfa('0xf9'),'required':![]},{'model':db[_0x3dfa('0xdd')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x3dfa('0x51')](_0x2d90da);})['then'](function(_0x46d5b9){_0x5af97e[_0x3dfa('0x63')]=_0x46d5b9;return _0x5af97e;});}})['then'](respondWithFilteredResult(_0x3899f8,_0x2d90da))['catch'](handleError(_0x3899f8,null));};exports[_0x3dfa('0x128')]=function(_0x26f690,_0x24e4b3,_0x17611d){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x26f690[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x24e4b3,null))[_0x3dfa('0x31')](function(_0x24c05d){if(_0x24c05d){return _0x24c05d[_0x3dfa('0x128')](_0x26f690[_0x3dfa('0x56')][_0x3dfa('0x65')],_['omit'](_0x26f690['body'],[_0x3dfa('0x65'),'id'])||{})[_0x3dfa('0xb8')](function(_0x35ae2e){for(var _0x59d9e9=0x0;_0x59d9e9<_0x26f690[_0x3dfa('0x56')]['ids'][_0x3dfa('0x45')];_0x59d9e9+=0x1){socket[_0x3dfa('0x129')](_0x3dfa('0x12a'),{'UserId':Number(_0x26f690['body']['ids'][_0x59d9e9]),'ChatWebsiteId':Number(_0x26f690[_0x3dfa('0x52')]['id'])});}return _0x35ae2e;});}})[_0x3dfa('0x31')](respondWithResult(_0x24e4b3,null))[_0x3dfa('0x26')](handleError(_0x24e4b3,null));};exports[_0x3dfa('0x12b')]=function(_0x2a7eb1,_0x171d3,_0x725699){return db[_0x3dfa('0x3b')][_0x3dfa('0x5b')]({'where':{'id':_0x2a7eb1['params']['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x171d3,null))[_0x3dfa('0x31')](function(_0x405d67){if(_0x405d67){return _0x405d67[_0x3dfa('0x12b')](_0x2a7eb1['query']['ids'])[_0x3dfa('0x31')](function(){if(_[_0x3dfa('0x12c')](_0x2a7eb1[_0x3dfa('0x3e')][_0x3dfa('0x65')])){for(var _0x23ce68=0x0;_0x23ce68<_0x2a7eb1[_0x3dfa('0x3e')][_0x3dfa('0x65')][_0x3dfa('0x45')];_0x23ce68+=0x1){socket[_0x3dfa('0x129')](_0x3dfa('0x12d'),{'UserId':Number(_0x2a7eb1[_0x3dfa('0x3e')][_0x3dfa('0x65')][_0x23ce68]),'ChatWebsiteId':Number(_0x2a7eb1[_0x3dfa('0x52')]['id'])});}}else{socket[_0x3dfa('0x129')](_0x3dfa('0x12d'),{'UserId':Number(_0x2a7eb1[_0x3dfa('0x3e')][_0x3dfa('0x65')]),'ChatWebsiteId':Number(_0x2a7eb1[_0x3dfa('0x52')]['id'])});}});}})[_0x3dfa('0x31')](respondWithStatusCode(_0x171d3,null))[_0x3dfa('0x26')](handleError(_0x171d3,null));};exports[_0x3dfa('0x12e')]=function(_0xf4a8b1,_0x5f1e9c,_0x1d2d02){var _0x352ba5={};var _0x469cbf={};var _0x5506aa;var _0x14448a;return db[_0x3dfa('0x3b')][_0x3dfa('0x69')]({'where':{'id':_0xf4a8b1[_0x3dfa('0x52')]['id']}})[_0x3dfa('0x31')](handleEntityNotFound(_0x5f1e9c,null))[_0x3dfa('0x31')](function(_0x324416){if(_0x324416){_0x5506aa=_0x324416;_0x469cbf[_0x3dfa('0x41')]=_[_0x3dfa('0x3f')](db['User'][_0x3dfa('0x53')]);_0x469cbf[_0x3dfa('0x3e')]=_[_0x3dfa('0x3f')](_0xf4a8b1[_0x3dfa('0x3e')]);_0x469cbf[_0x3dfa('0x40')]=_[_0x3dfa('0x43')](_0x469cbf[_0x3dfa('0x41')],_0x469cbf[_0x3dfa('0x3e')]);_0x352ba5[_0x3dfa('0x42')]=_['intersection'](_0x469cbf['model'],qs[_0x3dfa('0x44')](_0xf4a8b1[_0x3dfa('0x3e')][_0x3dfa('0x44')]));_0x352ba5[_0x3dfa('0x42')]=_0x352ba5[_0x3dfa('0x42')][_0x3dfa('0x45')]?_0x352ba5[_0x3dfa('0x42')]:_0x469cbf[_0x3dfa('0x41')];_0x352ba5[_0x3dfa('0x62')]=qs['sort'](_0xf4a8b1['query'][_0x3dfa('0x48')]);_0x352ba5[_0x3dfa('0x49')]=qs['filters'](_['pick'](_0xf4a8b1[_0x3dfa('0x3e')],_0x469cbf[_0x3dfa('0x40')]));if(_0xf4a8b1[_0x3dfa('0x3e')]['filter']){_0x352ba5[_0x3dfa('0x49')]=_[_0x3dfa('0x4c')](_0x352ba5[_0x3dfa('0x49')],{'$or':_[_0x3dfa('0x3a')](_0x352ba5[_0x3dfa('0x42')],function(_0x432950){var _0x266bea={};_0x266bea[_0x432950]={'$like':'%'+_0xf4a8b1[_0x3dfa('0x3e')][_0x3dfa('0x4b')]+'%'};return _0x266bea;})});}_0x352ba5=_[_0x3dfa('0x4c')]({},_0x352ba5,_0xf4a8b1[_0x3dfa('0x4f')]);return _0x5506aa['getAgents'](_0x352ba5);}})[_0x3dfa('0x31')](function(_0xdf9c1d){if(_0xdf9c1d){_0x14448a=_0xdf9c1d['length'];if(!_0xf4a8b1[_0x3dfa('0x3e')]['hasOwnProperty'](_0x3dfa('0x47'))){_0x352ba5[_0x3dfa('0x2a')]=qs[_0x3dfa('0x2a')](_0xf4a8b1[_0x3dfa('0x3e')]['limit']);_0x352ba5[_0x3dfa('0x2c')]=qs[_0x3dfa('0x2c')](_0xf4a8b1['query'][_0x3dfa('0x2c')]);}return _0x5506aa[_0x3dfa('0x12e')](_0x352ba5);}})[_0x3dfa('0x31')](function(_0x3b30c2){if(_0x3b30c2){return _0x3b30c2?{'count':_0x14448a,'rows':_0x3b30c2}:null;}})[_0x3dfa('0x31')](respondWithResult(_0x5f1e9c,null))[_0x3dfa('0x26')](handleError(_0x5f1e9c,null));};
\ No newline at end of file
+var _0xcf9b=['get','UserProfileResource','stack','name','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','show','params','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','root','sitepic','getLicense','custom','isNil','existsSync','download','getAvatar','join','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','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','orderBy','priority','asc','contact','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','push','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','alignment','verticalAlignment','textColor','backgroundColor','addApplications','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','getProactiveActions','online','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','destroy'];(function(_0x3bf957,_0x168c65){var _0x551cc=function(_0x5368e8){while(--_0x5368e8){_0x3bf957['push'](_0x3bf957['shift']());}};_0x551cc(++_0x168c65);}(_0xcf9b,0xf6));var _0xbcf9=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xcf9b[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcf9('0x0'));var zipdir=require(_0xbcf9('0x1'));var jsonpatch=require(_0xbcf9('0x2'));var rp=require(_0xbcf9('0x3'));var moment=require('moment');var BPromise=require(_0xbcf9('0x4'));var Mustache=require(_0xbcf9('0x5'));var util=require(_0xbcf9('0x6'));var path=require(_0xbcf9('0x7'));var sox=require(_0xbcf9('0x8'));var csv=require(_0xbcf9('0x9'));var ejs=require(_0xbcf9('0xa'));var fs=require('fs');var fs_extra=require(_0xbcf9('0xb'));var _=require(_0xbcf9('0xc'));var squel=require(_0xbcf9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbcf9('0xe'));var toCsv=require(_0xbcf9('0x9'));var querystring=require(_0xbcf9('0xf'));var Papa=require(_0xbcf9('0x10'));var Redis=require(_0xbcf9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbcf9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcf9('0x13'));var logger=require(_0xbcf9('0x14'))(_0xbcf9('0x15'));var utils=require(_0xbcf9('0x16'));var config=require(_0xbcf9('0x17'));var licenseUtil=require(_0xbcf9('0x18'));var db=require('../../mysqldb')['db'];config[_0xbcf9('0x19')]=_[_0xbcf9('0x1a')](config[_0xbcf9('0x19')],{'host':_0xbcf9('0x1b'),'port':0x18eb});var socket=require(_0xbcf9('0x1c'))(new Redis(config[_0xbcf9('0x19')]));require(_0xbcf9('0x1d'))[_0xbcf9('0x1e')](socket);var jayson=require(_0xbcf9('0x1f'));var client=jayson['client'][_0xbcf9('0x20')]({'port':0x232c});var client9002=jayson[_0xbcf9('0x21')][_0xbcf9('0x20')]({'port':0x232a});var client9003=jayson[_0xbcf9('0x21')]['http']({'port':0x232b});var client9001=jayson[_0xbcf9('0x21')][_0xbcf9('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5f1f46,_0x293f2a,_0x491e97,_0x5169bd){return new BPromise(function(_0x457733,_0x5356fc){var _0x763c59=_0x5169bd||client;return _0x763c59[_0xbcf9('0x22')](_0x5f1f46,_0x491e97)[_0xbcf9('0x23')](function(_0x22dcb3){logger[_0xbcf9('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x293f2a,_0xbcf9('0x25'));logger[_0xbcf9('0x26')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x293f2a,_0xbcf9('0x25'),JSON['stringify'](_0x22dcb3));if(_0x22dcb3[_0xbcf9('0x27')]){if(_0x22dcb3[_0xbcf9('0x27')][_0xbcf9('0x28')]===0x1f4){logger[_0xbcf9('0x27')](_0xbcf9('0x29'),_0x293f2a,_0x22dcb3[_0xbcf9('0x27')]['message']);return _0x5356fc(_0x22dcb3[_0xbcf9('0x27')]['message']);}logger[_0xbcf9('0x27')](_0xbcf9('0x29'),_0x293f2a,_0x22dcb3[_0xbcf9('0x27')][_0xbcf9('0x2a')]);return _0x457733(_0x22dcb3[_0xbcf9('0x27')][_0xbcf9('0x2a')]);}else{logger['info'](_0xbcf9('0x29'),_0x293f2a,_0xbcf9('0x25'));_0x457733(_0x22dcb3[_0xbcf9('0x2b')][_0xbcf9('0x2a')]);}})[_0xbcf9('0x2c')](function(_0x24bcde){logger[_0xbcf9('0x27')](_0xbcf9('0x29'),_0x293f2a,_0x24bcde);_0x5356fc(_0x24bcde);});});}function respondWithStatusCode(_0x3723a2,_0x1d79f3){_0x1d79f3=_0x1d79f3||0xcc;return function(_0x26fc3f){if(_0x26fc3f){return _0x3723a2[_0xbcf9('0x2d')](_0x1d79f3);}return _0x3723a2[_0xbcf9('0x2e')](_0x1d79f3)[_0xbcf9('0x2f')]();};}function respondWithResult(_0x28a3a7,_0x24851d){_0x24851d=_0x24851d||0xc8;return function(_0x6b2762){if(_0x6b2762){return _0x28a3a7[_0xbcf9('0x2e')](_0x24851d)['json'](_0x6b2762);}};}function respondWithFilteredResult(_0x450bc6,_0x8a6f5e){return function(_0x1d4d33){if(_0x1d4d33){var _0x24f40a=typeof _0x8a6f5e[_0xbcf9('0x30')]===_0xbcf9('0x31')&&typeof _0x8a6f5e['limit']==='undefined';var _0x406b05=_0x1d4d33[_0xbcf9('0x32')];var _0x3d810d=_0x24f40a?0x0:_0x8a6f5e['offset'];var _0x558a17=_0x24f40a?_0x1d4d33['count']:_0x8a6f5e[_0xbcf9('0x30')]+_0x8a6f5e[_0xbcf9('0x33')];var _0x488127;if(_0x558a17>=_0x406b05){_0x558a17=_0x406b05;_0x488127=0xc8;}else{_0x488127=0xce;}_0x450bc6['status'](_0x488127);return _0x450bc6[_0xbcf9('0x34')](_0xbcf9('0x35'),_0x3d810d+'-'+_0x558a17+'/'+_0x406b05)[_0xbcf9('0x36')](_0x1d4d33);}return null;};}function patchUpdates(_0x5dd2ba){return function(_0x362ddc){try{jsonpatch['apply'](_0x362ddc,_0x5dd2ba,!![]);}catch(_0x5c70f0){return BPromise[_0xbcf9('0x37')](_0x5c70f0);}return _0x362ddc[_0xbcf9('0x38')]();};}function saveUpdates(_0x3004ca,_0x2a2422){return function(_0x33c5a0){if(_0x33c5a0){return _0x33c5a0['update'](_0x3004ca)[_0xbcf9('0x23')](function(_0x7906ef){return _0x7906ef;});}return null;};}function removeEntity(_0x5935a5,_0x2af856){return function(_0x25db4a){if(_0x25db4a){return _0x25db4a[_0xbcf9('0x39')]()[_0xbcf9('0x23')](function(){var _0x536626=_0x25db4a[_0xbcf9('0x3a')]({'plain':!![]});var _0x33ac9c='ChatWebsites';return db[_0xbcf9('0x3b')][_0xbcf9('0x39')]({'where':{'type':_0x33ac9c,'resourceId':_0x536626['id']}})[_0xbcf9('0x23')](function(){return _0x25db4a;});})[_0xbcf9('0x23')](function(){_0x5935a5[_0xbcf9('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f296d,_0x59877b){return function(_0x24970a){if(!_0x24970a){_0x5f296d[_0xbcf9('0x2d')](0x194);}return _0x24970a;};}function handleError(_0x529001,_0x23564b){_0x23564b=_0x23564b||0x1f4;return function(_0x2248c3){logger[_0xbcf9('0x27')](_0x2248c3[_0xbcf9('0x3c')]);if(_0x2248c3[_0xbcf9('0x3d')]){delete _0x2248c3[_0xbcf9('0x3d')];}_0x529001['status'](_0x23564b)['send'](_0x2248c3);};}exports[_0xbcf9('0x3e')]=function(_0x480f67,_0x13846f){var _0x494af4={'include':[{'model':db[_0xbcf9('0x3f')],'as':'mandatoryDispositionPause'}]},_0x87ca1c={},_0x51eab1={'count':0x0,'rows':[]};var _0x430627=_[_0xbcf9('0x40')](db[_0xbcf9('0x41')][_0xbcf9('0x42')],function(_0x313f56){return{'name':_0x313f56[_0xbcf9('0x43')],'type':_0x313f56[_0xbcf9('0x44')][_0xbcf9('0x45')]};});_0x87ca1c[_0xbcf9('0x46')]=_['map'](_0x430627,_0xbcf9('0x3d'));_0x87ca1c[_0xbcf9('0x47')]=_['keys'](_0x480f67['query']);_0x87ca1c[_0xbcf9('0x48')]=_['intersection'](_0x87ca1c[_0xbcf9('0x46')],_0x87ca1c[_0xbcf9('0x47')]);_0x494af4[_0xbcf9('0x49')]=_['intersection'](_0x87ca1c[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x480f67[_0xbcf9('0x47')]['fields']));_0x494af4[_0xbcf9('0x49')]=_0x494af4['attributes'][_0xbcf9('0x4b')]?_0x494af4[_0xbcf9('0x49')]:_0x87ca1c[_0xbcf9('0x46')];if(!_0x480f67[_0xbcf9('0x47')][_0xbcf9('0x4c')](_0xbcf9('0x4d'))){_0x494af4[_0xbcf9('0x33')]=qs['limit'](_0x480f67[_0xbcf9('0x47')]['limit']);_0x494af4['offset']=qs[_0xbcf9('0x30')](_0x480f67['query']['offset']);}_0x494af4[_0xbcf9('0x4e')]=qs['sort'](_0x480f67[_0xbcf9('0x47')][_0xbcf9('0x4f')]);_0x494af4[_0xbcf9('0x50')]=qs['filters'](_['pick'](_0x480f67['query'],_0x87ca1c[_0xbcf9('0x48')]),_0x430627);if(_0x480f67[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x494af4['where']=_[_0xbcf9('0x52')](_0x494af4[_0xbcf9('0x50')],{'$or':_[_0xbcf9('0x40')](_0x430627,function(_0x2f1f61){if(_0x2f1f61[_0xbcf9('0x44')]!==_0xbcf9('0x53')){var _0x2253d1={};_0x2253d1[_0x2f1f61['name']]={'$like':'%'+_0x480f67[_0xbcf9('0x47')][_0xbcf9('0x51')]+'%'};return _0x2253d1;}})});}_0x494af4=_[_0xbcf9('0x52')]({},_0x494af4,_0x480f67[_0xbcf9('0x54')]);var _0xb25d17={'where':_0x494af4[_0xbcf9('0x50')]};return db[_0xbcf9('0x41')]['count'](_0xb25d17)['then'](function(_0x45c7ec){_0x51eab1[_0xbcf9('0x32')]=_0x45c7ec;if(_0x480f67['query']['includeAll']){_0x494af4[_0xbcf9('0x55')]=[{'all':!![]}];}return db[_0xbcf9('0x41')]['findAll'](_0x494af4);})[_0xbcf9('0x23')](function(_0x30130c){_0x51eab1[_0xbcf9('0x56')]=_0x30130c;return _0x51eab1;})['then'](respondWithFilteredResult(_0x13846f,_0x494af4))[_0xbcf9('0x2c')](handleError(_0x13846f,null));};exports[_0xbcf9('0x57')]=function(_0x37b975,_0x5bcccb){var _0x252272={'raw':![],'where':{'id':_0x37b975[_0xbcf9('0x58')]['id']},'include':[{'model':db[_0xbcf9('0x3f')],'as':'mandatoryDispositionPause'}]},_0x392784={};_0x392784['model']=_[_0xbcf9('0x59')](db[_0xbcf9('0x41')][_0xbcf9('0x42')]);_0x392784[_0xbcf9('0x47')]=_[_0xbcf9('0x59')](_0x37b975[_0xbcf9('0x47')]);_0x392784[_0xbcf9('0x48')]=_['intersection'](_0x392784[_0xbcf9('0x46')],_0x392784[_0xbcf9('0x47')]);_0x252272[_0xbcf9('0x49')]=_[_0xbcf9('0x5a')](_0x392784['model'],qs[_0xbcf9('0x4a')](_0x37b975['query'][_0xbcf9('0x4a')]));_0x252272['attributes']=_0x252272['attributes'][_0xbcf9('0x4b')]?_0x252272[_0xbcf9('0x49')]:_0x392784['model'];if(_0x37b975['query'][_0xbcf9('0x5b')]){_0x252272[_0xbcf9('0x55')]=[{'all':!![]}];}_0x252272=_[_0xbcf9('0x52')]({},_0x252272,_0x37b975[_0xbcf9('0x54')]);return db[_0xbcf9('0x41')][_0xbcf9('0x5c')](_0x252272)[_0xbcf9('0x23')](handleEntityNotFound(_0x5bcccb,null))[_0xbcf9('0x23')](respondWithResult(_0x5bcccb,null))[_0xbcf9('0x2c')](handleError(_0x5bcccb,null));};exports[_0xbcf9('0x5d')]=function(_0x127d1f,_0x4786e2){return db[_0xbcf9('0x41')][_0xbcf9('0x5d')](_0x127d1f[_0xbcf9('0x5e')],{})['then'](function(_0x118e55){var _0x5801e5=_0x127d1f[_0xbcf9('0x5f')][_0xbcf9('0x3a')]({'plain':!![]});if(!_0x5801e5)throw new Error(_0xbcf9('0x60'));if(_0x5801e5[_0xbcf9('0x61')]===_0xbcf9('0x5f')){var _0x24231a=_0x118e55[_0xbcf9('0x3a')]({'plain':!![]});var _0x32eb1b=_0xbcf9('0x62');return db[_0xbcf9('0x63')][_0xbcf9('0x5c')]({'where':{'name':_0x32eb1b,'userProfileId':_0x5801e5['userProfileId']},'raw':!![]})[_0xbcf9('0x23')](function(_0x4743db){if(_0x4743db&&_0x4743db['autoAssociation']===0x0){return db[_0xbcf9('0x3b')][_0xbcf9('0x5d')]({'name':_0x24231a[_0xbcf9('0x3d')],'resourceId':_0x24231a['id'],'type':_0x4743db[_0xbcf9('0x3d')],'sectionId':_0x4743db['id']},{})[_0xbcf9('0x23')](function(){return _0x118e55;});}else{return _0x118e55;}})[_0xbcf9('0x2c')](function(_0x3d5787){logger[_0xbcf9('0x27')](_0xbcf9('0x64'),_0x3d5787);throw _0x3d5787;});}return _0x118e55;})[_0xbcf9('0x23')](respondWithResult(_0x4786e2,0xc9))['catch'](handleError(_0x4786e2,null));};exports[_0xbcf9('0x65')]=function(_0xec3275,_0x50d097){if(_0xec3275['body']['id']){delete _0xec3275['body']['id'];}return db[_0xbcf9('0x41')]['find']({'where':{'id':_0xec3275['params']['id']},'include':[{'model':db[_0xbcf9('0x3f')],'as':_0xbcf9('0x66')}]})['then'](handleEntityNotFound(_0x50d097,null))[_0xbcf9('0x23')](saveUpdates(_0xec3275[_0xbcf9('0x5e')],null))['then'](respondWithResult(_0x50d097,null))[_0xbcf9('0x2c')](handleError(_0x50d097,null));};exports[_0xbcf9('0x39')]=function(_0x4083d3,_0x11b3b5){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x4083d3['params']['id']}})['then'](handleEntityNotFound(_0x11b3b5,null))['then'](removeEntity(_0x11b3b5,null))['catch'](handleError(_0x11b3b5,null));};exports[_0xbcf9('0x67')]=function(_0x520693,_0x493bb3){return db['ChatWebsite'][_0xbcf9('0x67')]()['then'](respondWithResult(_0x493bb3,null))['catch'](handleError(_0x493bb3,null));};exports['addDisposition']=function(_0x438d49,_0x307b0a,_0x1fe7ea){if(_0x438d49['body']['id']){delete _0x438d49[_0xbcf9('0x5e')]['id'];}return db['ChatWebsite'][_0xbcf9('0x5c')]({'where':{'id':_0x438d49[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x307b0a,null))[_0xbcf9('0x23')](function(_0x6b16dd){if(_0x6b16dd){_0x438d49[_0xbcf9('0x5e')][_0xbcf9('0x68')]=_0x6b16dd['id'];return db[_0xbcf9('0x69')]['create'](_0x438d49[_0xbcf9('0x5e')]);}})[_0xbcf9('0x23')](respondWithResult(_0x307b0a,null))[_0xbcf9('0x2c')](handleError(_0x307b0a,null));};exports[_0xbcf9('0x6a')]=function(_0x52b76c,_0x2fa087,_0x3f93ca){var _0x372ea1={'raw':![],'where':{}};var _0x5845f4={};var _0x521b6f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbcf9('0x6b')]({'where':{'id':_0x52b76c[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x2fa087,null))['then'](function(_0x17cf14){if(_0x17cf14){_0x5845f4['model']=_[_0xbcf9('0x59')](db[_0xbcf9('0x69')][_0xbcf9('0x42')]);_0x5845f4[_0xbcf9('0x47')]=_['keys'](_0x52b76c[_0xbcf9('0x47')]);_0x5845f4[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0x5845f4[_0xbcf9('0x46')],_0x5845f4[_0xbcf9('0x47')]);_0x372ea1[_0xbcf9('0x49')]=_[_0xbcf9('0x5a')](_0x5845f4[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x4a')]));_0x372ea1[_0xbcf9('0x49')]=_0x372ea1[_0xbcf9('0x49')]['length']?_0x372ea1['attributes']:_0x5845f4['model'];if(!_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x4c')](_0xbcf9('0x4d'))){_0x372ea1[_0xbcf9('0x33')]=qs[_0xbcf9('0x33')](_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x33')]);_0x372ea1['offset']=qs[_0xbcf9('0x30')](_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x30')]);}_0x372ea1['order']=qs[_0xbcf9('0x4f')](_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x4f')]);_0x372ea1[_0xbcf9('0x50')]=qs[_0xbcf9('0x48')](_[_0xbcf9('0x6c')](_0x52b76c[_0xbcf9('0x47')],_0x5845f4['filters']));_0x372ea1[_0xbcf9('0x50')][_0xbcf9('0x68')]=_0x17cf14['id'];if(_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x372ea1[_0xbcf9('0x50')]=_[_0xbcf9('0x52')](_0x372ea1[_0xbcf9('0x50')],{'$or':_['map'](_0x372ea1[_0xbcf9('0x49')],function(_0xfdbfb7){var _0x52a8a5={};_0x52a8a5[_0xfdbfb7]={'$like':'%'+_0x52b76c['query'][_0xbcf9('0x51')]+'%'};return _0x52a8a5;})});}_0x372ea1=_[_0xbcf9('0x52')]({},_0x372ea1,_0x52b76c[_0xbcf9('0x54')]);return db[_0xbcf9('0x69')][_0xbcf9('0x32')]({'where':_0x372ea1[_0xbcf9('0x50')]})[_0xbcf9('0x23')](function(_0x2f2e4e){_0x521b6f[_0xbcf9('0x32')]=_0x2f2e4e;if(_0x52b76c[_0xbcf9('0x47')][_0xbcf9('0x5b')]){_0x372ea1[_0xbcf9('0x55')]=[{'all':!![]}];}return db[_0xbcf9('0x69')][_0xbcf9('0x6d')](_0x372ea1);})[_0xbcf9('0x23')](function(_0x2d71ab){_0x521b6f[_0xbcf9('0x56')]=_0x2d71ab;return _0x521b6f;});}})[_0xbcf9('0x23')](respondWithFilteredResult(_0x2fa087,_0x372ea1))['catch'](handleError(_0x2fa087,null));};exports[_0xbcf9('0x6e')]=function(_0x4c95fb,_0x5cfdfb,_0x21e8ea){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x4c95fb[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x5cfdfb,null))[_0xbcf9('0x23')](function(_0xa385b4){if(_0xa385b4){return _0xa385b4['removeDispositions'](_0x4c95fb[_0xbcf9('0x47')][_0xbcf9('0x6f')]);}})[_0xbcf9('0x23')](respondWithStatusCode(_0x5cfdfb,null))[_0xbcf9('0x2c')](handleError(_0x5cfdfb,null));};exports['addAnswer']=function(_0x44bffe,_0x111e64,_0x495543){if(_0x44bffe['body']['id']){delete _0x44bffe[_0xbcf9('0x5e')]['id'];}return db['ChatWebsite'][_0xbcf9('0x5c')]({'where':{'id':_0x44bffe[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x111e64,null))[_0xbcf9('0x23')](function(_0x587909){if(_0x587909){_0x44bffe[_0xbcf9('0x5e')][_0xbcf9('0x68')]=_0x587909['id'];return db[_0xbcf9('0x70')][_0xbcf9('0x5d')](_0x44bffe[_0xbcf9('0x5e')]);}})[_0xbcf9('0x23')](respondWithResult(_0x111e64,null))[_0xbcf9('0x2c')](handleError(_0x111e64,null));};exports[_0xbcf9('0x71')]=function(_0x1887c0,_0x15c708,_0x5d9d0d){var _0x47463d={'raw':![],'where':{}};var _0x3f13a9={};var _0x1df8a2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbcf9('0x6b')]({'where':{'id':_0x1887c0[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x15c708,null))[_0xbcf9('0x23')](function(_0x181d04){if(_0x181d04){_0x3f13a9[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db[_0xbcf9('0x70')][_0xbcf9('0x42')]);_0x3f13a9[_0xbcf9('0x47')]=_[_0xbcf9('0x59')](_0x1887c0[_0xbcf9('0x47')]);_0x3f13a9[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0x3f13a9['model'],_0x3f13a9['query']);_0x47463d[_0xbcf9('0x49')]=_[_0xbcf9('0x5a')](_0x3f13a9['model'],qs[_0xbcf9('0x4a')](_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x4a')]));_0x47463d[_0xbcf9('0x49')]=_0x47463d[_0xbcf9('0x49')]['length']?_0x47463d[_0xbcf9('0x49')]:_0x3f13a9[_0xbcf9('0x46')];if(!_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x4c')]('nolimit')){_0x47463d[_0xbcf9('0x33')]=qs[_0xbcf9('0x33')](_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x33')]);_0x47463d[_0xbcf9('0x30')]=qs[_0xbcf9('0x30')](_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x30')]);}_0x47463d[_0xbcf9('0x4e')]=qs['sort'](_0x1887c0[_0xbcf9('0x47')]['sort']);_0x47463d[_0xbcf9('0x50')]=qs[_0xbcf9('0x48')](_[_0xbcf9('0x6c')](_0x1887c0[_0xbcf9('0x47')],_0x3f13a9[_0xbcf9('0x48')]));_0x47463d[_0xbcf9('0x50')][_0xbcf9('0x68')]=_0x181d04['id'];if(_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x47463d[_0xbcf9('0x50')]=_['merge'](_0x47463d[_0xbcf9('0x50')],{'$or':_['map'](_0x47463d[_0xbcf9('0x49')],function(_0x3e699a){var _0x42ce38={};_0x42ce38[_0x3e699a]={'$like':'%'+_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x51')]+'%'};return _0x42ce38;})});}_0x47463d=_[_0xbcf9('0x52')]({},_0x47463d,_0x1887c0[_0xbcf9('0x54')]);return db[_0xbcf9('0x70')][_0xbcf9('0x32')]({'where':_0x47463d[_0xbcf9('0x50')]})[_0xbcf9('0x23')](function(_0x2d8485){_0x1df8a2[_0xbcf9('0x32')]=_0x2d8485;if(_0x1887c0[_0xbcf9('0x47')][_0xbcf9('0x5b')]){_0x47463d[_0xbcf9('0x55')]=[{'all':!![]}];}return db[_0xbcf9('0x70')]['findAll'](_0x47463d);})['then'](function(_0x7253a0){_0x1df8a2['rows']=_0x7253a0;return _0x1df8a2;});}})['then'](respondWithFilteredResult(_0x15c708,_0x47463d))[_0xbcf9('0x2c')](handleError(_0x15c708,null));};exports[_0xbcf9('0x72')]=function(_0xe803f1,_0x2bc2a6,_0x1c894d){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0xe803f1['params']['id']}})['then'](handleEntityNotFound(_0x2bc2a6,null))[_0xbcf9('0x23')](function(_0xc94bd3){if(_0xc94bd3){return _0xc94bd3[_0xbcf9('0x72')](_0xe803f1[_0xbcf9('0x47')]['ids']);}})[_0xbcf9('0x23')](respondWithStatusCode(_0x2bc2a6,null))['catch'](handleError(_0x2bc2a6,null));};exports['addLogo']=function(_0x464efd,_0x2ea9cf,_0x168f05){_0x464efd[_0xbcf9('0x5e')]['sitepic']=_0x464efd[_0xbcf9('0x73')][_0xbcf9('0x74')];return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x464efd['params']['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x2ea9cf,null))[_0xbcf9('0x23')](saveUpdates(_0x464efd[_0xbcf9('0x5e')],null))[_0xbcf9('0x23')](respondWithResult(_0x2ea9cf,null))[_0xbcf9('0x2c')](handleError(_0x2ea9cf,null));};exports[_0xbcf9('0x75')]=function(_0x225ba1,_0x434d20,_0x267366){_0x225ba1[_0xbcf9('0x5e')][_0xbcf9('0x76')]=_0x225ba1[_0xbcf9('0x73')][_0xbcf9('0x74')];return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x225ba1[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x434d20,null))[_0xbcf9('0x23')](saveUpdates(_0x225ba1[_0xbcf9('0x5e')],null))[_0xbcf9('0x23')](respondWithResult(_0x434d20,null))[_0xbcf9('0x2c')](handleError(_0x434d20,null));};exports['addCustomerAvatar']=function(_0x303b9f,_0x53f09d,_0x30b37a){_0x303b9f[_0xbcf9('0x5e')][_0xbcf9('0x77')]=_0x303b9f['file'][_0xbcf9('0x74')];return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x303b9f[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x53f09d,null))[_0xbcf9('0x23')](saveUpdates(_0x303b9f[_0xbcf9('0x5e')],null))[_0xbcf9('0x23')](respondWithResult(_0x53f09d,null))[_0xbcf9('0x2c')](handleError(_0x53f09d,null));};exports['addSystemAvatar']=function(_0x330f08,_0x3394fd,_0x1a3d9d){_0x330f08[_0xbcf9('0x5e')][_0xbcf9('0x78')]=_0x330f08['file'][_0xbcf9('0x74')];return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x330f08[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x3394fd,null))[_0xbcf9('0x23')](saveUpdates(_0x330f08[_0xbcf9('0x5e')],null))['then'](respondWithResult(_0x3394fd,null))[_0xbcf9('0x2c')](handleError(_0x3394fd,null));};exports[_0xbcf9('0x79')]=function(_0x48b02,_0x55a196,_0x3fef28){var _0x355368=path['join'](config[_0xbcf9('0x7a')],'server/files/images/logos/default_logo.svg');var _0x49fb45={'where':{'id':_0x48b02['params']['id']},'attributes':['id',_0xbcf9('0x7b')],'raw':!![]};var _0x3513ae=![];return require(_0xbcf9('0x18'))[_0xbcf9('0x7c')]()[_0xbcf9('0x23')](function(_0x26d5d0){if(_0x26d5d0){_0x3513ae=_0x26d5d0[_0xbcf9('0x7d')];}})[_0xbcf9('0x23')](function(){return db['ChatWebsite'][_0xbcf9('0x5c')](_0x49fb45);})[_0xbcf9('0x23')](handleEntityNotFound(_0x55a196,null))[_0xbcf9('0x23')](function(_0x2314fd){if(_0x2314fd){if(!_[_0xbcf9('0x7e')](_0x2314fd[_0xbcf9('0x7b')])){if(fs[_0xbcf9('0x7f')](path['join'](config[_0xbcf9('0x7a')],'server/files/images/logos/',_0x2314fd[_0xbcf9('0x7b')]))&&_0x3513ae){_0x355368=path['join'](config[_0xbcf9('0x7a')],'server/files/images/logos/',_0x2314fd[_0xbcf9('0x7b')]);}}return _0x55a196[_0xbcf9('0x80')](_0x355368);}})['catch'](handleError(_0x55a196,null));};exports[_0xbcf9('0x81')]=function(_0x1bdc69,_0x3b56b4,_0x1626b7){var _0x5494a9=path[_0xbcf9('0x82')](config[_0xbcf9('0x7a')],_0xbcf9('0x83'));var _0x5e88a6={'where':{'id':_0x1bdc69[_0xbcf9('0x58')]['id']},'attributes':['id',_0xbcf9('0x76')],'raw':!![]};return db[_0xbcf9('0x41')]['find'](_0x5e88a6)['then'](handleEntityNotFound(_0x3b56b4,null))[_0xbcf9('0x23')](function(_0x1c64d2){if(_0x1c64d2){if(!_[_0xbcf9('0x7e')](_0x1c64d2[_0xbcf9('0x76')])){if(fs['existsSync'](path[_0xbcf9('0x82')](config['root'],_0xbcf9('0x84'),_0x1c64d2[_0xbcf9('0x76')]))){_0x5494a9=path['join'](config[_0xbcf9('0x7a')],'server/files/images/avatars/',_0x1c64d2[_0xbcf9('0x76')]);}}return _0x3b56b4['download'](_0x5494a9);}})[_0xbcf9('0x2c')](handleError(_0x3b56b4,null));};exports['getCustomerAvatar']=function(_0x5f2d8e,_0x27540f,_0x1135ae){var _0x57ab38=path[_0xbcf9('0x82')](config[_0xbcf9('0x7a')],_0xbcf9('0x85'));var _0x45dfe0={'where':{'id':_0x5f2d8e[_0xbcf9('0x58')]['id']},'attributes':['id',_0xbcf9('0x77'),_0xbcf9('0x86')],'raw':!![]};return db[_0xbcf9('0x41')][_0xbcf9('0x5c')](_0x45dfe0)['then'](handleEntityNotFound(_0x27540f,null))['then'](function(_0x47ba86){if(_0x47ba86){if(!_[_0xbcf9('0x7e')](_0x47ba86[_0xbcf9('0x77')])){if(fs[_0xbcf9('0x7f')](path['join'](config[_0xbcf9('0x7a')],'server/files/images/avatars/',_0x47ba86[_0xbcf9('0x77')]))&&_0x47ba86[_0xbcf9('0x86')]){_0x57ab38=path['join'](config[_0xbcf9('0x7a')],'server/files/images/avatars/',_0x47ba86[_0xbcf9('0x77')]);}}return _0x27540f['download'](_0x57ab38);}})[_0xbcf9('0x2c')](handleError(_0x27540f,null));};exports[_0xbcf9('0x87')]=function(_0x488a55,_0x205599,_0xaa2d0f){var _0x47b178=path[_0xbcf9('0x82')](config[_0xbcf9('0x7a')],_0xbcf9('0x88'));var _0x1330ef={'where':{'id':_0x488a55['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbcf9('0x41')]['find'](_0x1330ef)['then'](handleEntityNotFound(_0x205599,null))[_0xbcf9('0x23')](function(_0x2adbc7){if(_0x2adbc7){if(!_['isNil'](_0x2adbc7[_0xbcf9('0x78')])){if(fs[_0xbcf9('0x7f')](path[_0xbcf9('0x82')](config[_0xbcf9('0x7a')],_0xbcf9('0x84'),_0x2adbc7[_0xbcf9('0x78')]))){_0x47b178=path[_0xbcf9('0x82')](config['root'],_0xbcf9('0x84'),_0x2adbc7[_0xbcf9('0x78')]);}}return _0x205599['download'](_0x47b178);}})[_0xbcf9('0x2c')](handleError(_0x205599,null));};exports[_0xbcf9('0x89')]=function(_0x5279c9,_0xac2eed,_0x13729d){var _0x3cd5af=require(_0xbcf9('0x8a'));var _0x170d60=new _0x3cd5af();var _0x51e1cf=_0x170d60[_0xbcf9('0x8b')](_0x5279c9[_0xbcf9('0x8c')]['user-agent'])[_0xbcf9('0x8d')]();var _0x962bf9={'body':_0x5279c9[_0xbcf9('0x5e')],'channel':_0xbcf9('0x8e')};var _0x39cca9=[];var _0x392f26=[];var _0x4eee90={};var _0x4266c3=![];return db[_0xbcf9('0x8f')][_0xbcf9('0x67')]()[_0xbcf9('0x23')](function(_0x41a520){if(!_0x41a520){throw new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x92'));}_0x39cca9=_[_0xbcf9('0x93')](_[_0xbcf9('0x59')](_0x41a520),[_0xbcf9('0x94'),'updatedAt']);_0x392f26=_[_0xbcf9('0x93')](_[_0xbcf9('0x59')](_0x41a520),[_0xbcf9('0x94'),_0xbcf9('0x95'),_0xbcf9('0x96'),_0xbcf9('0x97')]);if(_0x5279c9[_0xbcf9('0x5e')]['id']){delete _0x5279c9[_0xbcf9('0x5e')]['id'];}if(_[_0xbcf9('0x7e')](_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x98')])){throw new db['Sequelize'][(_0xbcf9('0x91'))](_0xbcf9('0x99'));}if(_[_0xbcf9('0x7e')](_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x5e')])||_0x5279c9[_0xbcf9('0x5e')]['body']===''){throw new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x9a'));}if(_[_0xbcf9('0x7e')](_0x5279c9['body'][_0xbcf9('0x9b')])){throw new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x9c')+_0x392f26);}if(!_['includes'](_0x392f26,_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x9b')])){throw new db['Sequelize'][(_0xbcf9('0x91'))](_0xbcf9('0x9d')+_0x392f26);}_0x4eee90[_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x9b')]]=_0x5279c9['body'][_0xbcf9('0x98')];})[_0xbcf9('0x23')](function(){return db[_0xbcf9('0x41')]['find']({'where':{'id':_0x5279c9[_0xbcf9('0x58')]['id']},'include':[{'model':db[_0xbcf9('0x9e')],'as':'List','include':[{'model':db[_0xbcf9('0x8f')],'as':_0xbcf9('0x9f'),'where':_0x4eee90,'limit':0x1,'order':[[_0xbcf9('0x95'),_0xbcf9('0xa0')]]}]},{'model':db[_0xbcf9('0xa1')],'as':'Applications'}]});})[_0xbcf9('0x23')](handleEntityNotFound(_0xac2eed,null))[_0xbcf9('0x23')](function(_0x3a43f0){if(_0x3a43f0&&_0x3a43f0[_0xbcf9('0xa2')]){_0x962bf9[_0xbcf9('0xa3')]=_0x3a43f0;_0x962bf9[_0xbcf9('0xa4')]=_0x3a43f0[_0xbcf9('0xa5')];_0x962bf9[_0xbcf9('0xa6')]=_0x3a43f0['List'];_0x962bf9[_0xbcf9('0xa4')]=_[_0xbcf9('0xa7')](_0x962bf9[_0xbcf9('0xa4')],[_0xbcf9('0xa8')],[_0xbcf9('0xa9')]);if(_0x962bf9[_0xbcf9('0xa3')][_0xbcf9('0xa5')]){delete _0x962bf9['account'][_0xbcf9('0xa5')];}if(_0x962bf9[_0xbcf9('0xa3')][_0xbcf9('0xa2')]&&_0x962bf9[_0xbcf9('0xa3')]['List'][_0xbcf9('0x9f')][_0xbcf9('0x4b')]){return _0x962bf9[_0xbcf9('0xa3')][_0xbcf9('0xa2')][_0xbcf9('0x9f')][0x0];}var _0xb76898=_[_0xbcf9('0x1a')](_0x5279c9['body'],{'firstName':_0x5279c9['body'][_0xbcf9('0x98')],'ListId':_0x3a43f0[_0xbcf9('0x97')]});_0xb76898[_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x9b')]]=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x98')];return db['CmContact'][_0xbcf9('0x5d')](_0xb76898,{'fields':_0x39cca9,'raw':!![]});}})[_0xbcf9('0x23')](handleEntityNotFound(_0xac2eed,null))[_0xbcf9('0x23')](function(_0x1e1786){_0x962bf9[_0xbcf9('0xaa')]=_0x1e1786;var _0x9514c0=_0x5279c9[_0xbcf9('0x5e')]['customerIp'];if(_0x5279c9[_0xbcf9('0x8c')]['cf-connecting-ip']){_0x9514c0=_0x5279c9['headers']['cf-connecting-ip'];}else if(_0x5279c9['headers'][_0xbcf9('0xab')]){_0x9514c0=_[_0xbcf9('0xac')](_0x5279c9[_0xbcf9('0x8c')][_0xbcf9('0xab')][_0xbcf9('0xad')](','));}if(_0x1e1786){var _0x231345={'ContactId':_0x1e1786['id'],'ChatWebsiteId':_0x5279c9[_0xbcf9('0x58')]['id'],'from':(_0x1e1786[_0xbcf9('0xae')]||'')+'\x20'+(_0x1e1786[_0xbcf9('0xaf')]||''),'customerIp':_0x9514c0,'customerPort':_0x5279c9[_0xbcf9('0x8c')][_0xbcf9('0xb0')]?_0x5279c9['headers'][_0xbcf9('0xb0')]:null,'referer':_0x5279c9['body'][_0xbcf9('0xb1')],'browserName':_0x51e1cf['browser'][_0xbcf9('0x3d')]&&_0x51e1cf[_0xbcf9('0xb2')][_0xbcf9('0xb3')]?util[_0xbcf9('0xb4')](_0xbcf9('0xb5'),_0x51e1cf['browser'][_0xbcf9('0x3d')],_0x51e1cf['browser']['version']):'unknown','browserVersion':_0x51e1cf[_0xbcf9('0xb2')][_0xbcf9('0xb3')]||_0xbcf9('0xb6'),'osName':util['format'](_0xbcf9('0xb5'),_0x51e1cf['os'][_0xbcf9('0x3d')],_0x51e1cf['os']['version']),'osVersion':_0x51e1cf['os'][_0xbcf9('0xb3')],'deviceModel':_0x51e1cf['device'][_0xbcf9('0x46')]&&_0x51e1cf['device'][_0xbcf9('0xb7')]?util[_0xbcf9('0xb4')](_0xbcf9('0xb8'),_0x51e1cf[_0xbcf9('0xb9')]['model'],_0x51e1cf[_0xbcf9('0xb9')][_0xbcf9('0xb7')],_0x51e1cf[_0xbcf9('0xb9')][_0xbcf9('0x44')]):null,'deviceVendor':_0x51e1cf['device'][_0xbcf9('0xb7')],'deviceType':_0x51e1cf[_0xbcf9('0xb9')][_0xbcf9('0x44')],'formData':JSON['stringify'](_0x5279c9[_0xbcf9('0x5e')])};var _0x28df01={'ChatWebsiteId':_0x5279c9[_0xbcf9('0x58')]['id'],'closed':![]};if(_0x5279c9['body']['threadId']){_0x28df01['threadId']=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xba')];return db[_0xbcf9('0xbb')][_0xbcf9('0x5c')]({'where':_0x28df01})[_0xbcf9('0x23')](function(_0x4d04e6){if(_0x4d04e6){return[_0x4d04e6,![]];}_0x231345[_0xbcf9('0xba')]=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xba')];_0x231345['externalUrl']=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xbc')];return db['ChatInteraction'][_0xbcf9('0x5d')](_0x231345)[_0xbcf9('0x23')](function(_0x1a9351){return[_0x1a9351,!![]];});});}_0x28df01['ContactId']=_0x1e1786['id'];if(_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xbd')]&&_0x5279c9['body'][_0xbcf9('0xbd')]['id']){_0x28df01['id']=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xbd')]['id'];return db[_0xbcf9('0xbb')][_0xbcf9('0x5c')]({'where':_0x28df01})[_0xbcf9('0x23')](function(_0xc5bcbc){if(_0xc5bcbc){return[_0xc5bcbc,![]];}return db[_0xbcf9('0xbb')][_0xbcf9('0x5d')](_0x231345)[_0xbcf9('0x23')](function(_0x19069c){return[_0x19069c,!![]];});});}return db[_0xbcf9('0xbb')]['create'](_0x231345)['then'](function(_0x2af191){return[_0x2af191,!![]];});}})[_0xbcf9('0xbe')](function(_0x3bf46b,_0x1e73ac){if(_0x3bf46b){_0x4266c3=_0x1e73ac;if(!_0x1e73ac){var _0x398369={'from':(_0x962bf9[_0xbcf9('0xaa')]['firstName']||'')+'\x20'+(_0x962bf9[_0xbcf9('0xaa')][_0xbcf9('0xaf')]||'')};if(_0x5279c9['body']['threadId']&&_0x5279c9['body']['messageId']&&_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xba')]!=_0x5279c9[_0xbcf9('0x5e')]['messageId']){_0x398369[_0xbcf9('0xba')]=_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0xbf')];}return _0x3bf46b[_0xbcf9('0x65')](_0x398369);}else{return _0x3bf46b;}}})['then'](function(_0x1f75fe){_0x962bf9[_0xbcf9('0xbd')]=_0x1f75fe[_0xbcf9('0x3a')]({'plain':!![]});_0x962bf9['interaction'][_0xbcf9('0xc0')]=_0x4266c3;if(_0x962bf9[_0xbcf9('0xbd')][_0xbcf9('0xc0')]){if(_0x962bf9[_0xbcf9('0xa3')]['autoclose']){_0x962bf9['applications'][_0xbcf9('0xc1')]({'id':0x0,'priority':_0x962bf9['applications'][_0xbcf9('0x4b')]+0x1,'app':'close','appdata':_0xbcf9('0xc2'),'interval':'*,*,*,*'});}}return db[_0xbcf9('0xc3')][_0xbcf9('0x5d')]({'body':_0x5279c9[_0xbcf9('0x5e')][_0xbcf9('0x5e')],'ChatWebsiteId':_0x5279c9[_0xbcf9('0x58')]['id'],'ChatInteractionId':_0x1f75fe['id'],'direction':'in','ContactId':_0x962bf9[_0xbcf9('0xaa')]['id'],'AttachmentId':_0x5279c9['body']['AttachmentId']});})[_0xbcf9('0x23')](function(_0x3ca05c){_0x962bf9[_0xbcf9('0x2a')]=_0x3ca05c;if(_0x962bf9['interaction'][_0xbcf9('0xc4')]){return db[_0xbcf9('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x962bf9[_0xbcf9('0xbd')][_0xbcf9('0xc4')]}})[_0xbcf9('0x23')](function(_0x38db53){if(_0x38db53){_0x962bf9[_0xbcf9('0xa4')][_0xbcf9('0xc6')]({'id':0x0,'priority':0x0,'app':_0xbcf9('0xc7'),'appdata':_0x38db53[_0xbcf9('0x3d')]+','+(_0x962bf9['account'][_0xbcf9('0xc8')]||0xa),'interval':_0xbcf9('0xc9')});_0x962bf9[_0xbcf9('0xca')]=!![];}return respondWithRpcPromise('Start',_0xbcf9('0xcb'),_0x962bf9);});}return respondWithRpcPromise('Start',_0xbcf9('0xcb'),_0x962bf9);})[_0xbcf9('0x23')](function(_0x1516f2){respondWithRpcPromise(_0xbcf9('0xcc'),_0xbcf9('0xcc'),{'event':'notify','message':_0x1516f2},client9002);return _0x1516f2;})[_0xbcf9('0x23')](respondWithResult(_0xac2eed,null))[_0xbcf9('0x2c')](handleError(_0xac2eed,null));};exports[_0xbcf9('0xcd')]=function(_0x2b21c9,_0xfb2ebf,_0x14c004){var _0x10f99f,_0x1cffff,_0x3053c3;var _0x5f033e=[];var _0xdb8ede=[];var _0x3d3a2e={};var _0xaf5efe=_0x2b21c9[_0xbcf9('0xce')]||[];var _0x340644=[];var _0x22fea4;return db[_0xbcf9('0x8f')]['describe']()[_0xbcf9('0x23')](function(_0x5a2016){if(!_0x5a2016){throw new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x92'));}_0xdb8ede=_[_0xbcf9('0x93')](_[_0xbcf9('0x59')](_0x5a2016),[_0xbcf9('0x94'),_0xbcf9('0x95')]);_0x5f033e=_['difference'](_[_0xbcf9('0x59')](_0x5a2016),[_0xbcf9('0x94'),_0xbcf9('0x95'),_0xbcf9('0x96'),'ListId']);if(_0x2b21c9['body']['id']){delete _0x2b21c9[_0xbcf9('0x5e')]['id'];}if(_[_0xbcf9('0x7e')](_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0x98')])){throw _0xfb2ebf[_0xbcf9('0x2e')](0x1f4)[_0xbcf9('0xcf')](new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x99')));}if(_[_0xbcf9('0x7e')](_0x2b21c9['body'][_0xbcf9('0x5e')])||_0x2b21c9['body'][_0xbcf9('0x5e')]===''){throw _0xfb2ebf[_0xbcf9('0x2e')](0x1f4)[_0xbcf9('0xcf')](new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0x9a')));}if(_['isNil'](_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0xd0')])){throw _0xfb2ebf[_0xbcf9('0x2e')](0x1f4)[_0xbcf9('0xcf')](new db[(_0xbcf9('0x90'))]['ValidationError'](_0xbcf9('0xd1')+_0x5f033e));}if(!_[_0xbcf9('0xd2')](_0x5f033e,_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0xd0')])){throw _0xfb2ebf[_0xbcf9('0x2e')](0x1f4)[_0xbcf9('0xcf')](new db[(_0xbcf9('0x90'))][(_0xbcf9('0x91'))](_0xbcf9('0xd3')+_0x5f033e));}_0x3d3a2e[_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0xd0')]]=_0x2b21c9['body'][_0xbcf9('0x98')];})['then'](function(){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x2b21c9[_0xbcf9('0x58')]['id']},'include':[{'model':db[_0xbcf9('0x9e')],'as':_0xbcf9('0xa2')},{'model':db[_0xbcf9('0xd4')],'as':_0xbcf9('0xd4')}]});})[_0xbcf9('0x23')](handleEntityNotFound(_0xfb2ebf,null))[_0xbcf9('0x23')](function(_0x5248fd){if(_0x5248fd&&_0x5248fd[_0xbcf9('0xa2')]){_0x1cffff=_0x5248fd;var _0x340877=_[_0xbcf9('0x1a')](_0x2b21c9[_0xbcf9('0x5e')],{'firstName':_0x2b21c9['body'][_0xbcf9('0x98')],'phone':_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0x98')],'ListId':_0x5248fd[_0xbcf9('0x97')]});_0x340877[_0x2b21c9['body'][_0xbcf9('0xd0')]]=_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0x98')];return db[_0xbcf9('0x8f')]['findOrCreate']({'where':_0x3d3a2e,'defaults':_0x340877});}})[_0xbcf9('0xbe')](function(_0x5f4f2d){if(_0x5f4f2d){_0x3053c3=_0x5f4f2d;var _0x4e6420=fs[_0xbcf9('0xd5')](path[_0xbcf9('0x82')](config[_0xbcf9('0x7a')],_0xbcf9('0xd6')),_0xbcf9('0xd7'));var _0x4dd14c=ejs[_0xbcf9('0xd8')](_0x4e6420,{'body':_[_0xbcf9('0xd9')](_0x2b21c9[_0xbcf9('0x5e')][_0xbcf9('0x5e')]),'bodyTitle':_0x1cffff[_0xbcf9('0xda')]});return db[_0xbcf9('0xdb')][_0xbcf9('0x5d')]({'body':_0x4dd14c,'ContactId':_0x5f4f2d['id'],'ChatWebsiteId':_0x1cffff['id']});}})[_0xbcf9('0x23')](function(_0x517ba4){_0x22fea4=_0x517ba4;if(_0xaf5efe['length']){var _0x131d93=_0xaf5efe[_0xbcf9('0x40')](function(_0x2f918b){return{'name':_0x2f918b['originalname'],'basename':_0x2f918b['filename'],'type':_0x2f918b[_0xbcf9('0xdc')],'ChatOfflineMessageId':_0x517ba4['id']};});_0x340644=_0x131d93[_0xbcf9('0x40')](_0x27b727=>{var _0x3aa521={'filename':_0x27b727[_0xbcf9('0x3d')],'path':path[_0xbcf9('0x82')](config['root'],'server',_0xbcf9('0xce'),'attachments',_0xbcf9('0xdd'),_0x27b727[_0xbcf9('0xde')])};return _0x3aa521;});if(!_0x1cffff[_0xbcf9('0xdf')]){return db[_0xbcf9('0xe0')][_0xbcf9('0xe1')](function(_0x1d5e78){return db[_0xbcf9('0xe2')][_0xbcf9('0xe3')](_0x131d93,{'transaction':_0x1d5e78});});}}})[_0xbcf9('0x23')](function(){if(_0x22fea4){_0x10f99f=_0x22fea4;return db[_0xbcf9('0xd4')][_0xbcf9('0x6b')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbcf9('0xe4'),'raw':!![]}]});}})[_0xbcf9('0x23')](function(_0x1c3427){if(_0x1c3427&&_0x1c3427['Smtp']&&_0x1cffff[_0xbcf9('0xe5')]&&_0x1cffff[_0xbcf9('0xe6')]){var _0x25bfc9={'tls':{'rejectUnauthorized':![]}};if(_0x1c3427['Smtp'][_0xbcf9('0xe7')]){_0x25bfc9['service']=_0x1c3427[_0xbcf9('0xe4')][_0xbcf9('0xe7')];}else{_0x25bfc9[_0xbcf9('0xe8')]=_0x1c3427[_0xbcf9('0xe4')]['host'];_0x25bfc9[_0xbcf9('0xe9')]=_0x1c3427[_0xbcf9('0xe4')]['port'];_0x25bfc9['secure']=_0x1c3427['Smtp'][_0xbcf9('0xea')];}if(_0x1c3427[_0xbcf9('0xe4')][_0xbcf9('0xeb')]){_0x25bfc9['auth']={'user':_0x1c3427['Smtp']['user'],'pass':_0x1c3427[_0xbcf9('0xe4')][_0xbcf9('0xec')]};}return respondWithRpcPromise(_0xbcf9('0xed'),_0xbcf9('0xee'),{'account':_0x25bfc9,'message':{'from':util[_0xbcf9('0xb4')](_0xbcf9('0xef'),_0x1c3427[_0xbcf9('0x3d')],_0x1c3427['email']||_0x1c3427['Smtp'][_0xbcf9('0x5f')]),'to':_0x1cffff[_0xbcf9('0xe6')],'subject':_0x1cffff['offlineMessageSubject'],'html':_0x10f99f[_0xbcf9('0x5e')],'attachments':_0x340644}},client9003)[_0xbcf9('0x23')](function(){return _0x10f99f;})[_0xbcf9('0x2c')](function(_0x8cd4fa){console['error'](_0x8cd4fa);});}})[_0xbcf9('0x23')](function(){if(_0x1cffff&&_0x1cffff[_0xbcf9('0xdf')]&&_0x1cffff['MailAccountId']){var _0x3a22eb=[];if(_0xaf5efe[_0xbcf9('0x4b')]){_0x3a22eb=_0xaf5efe['map'](function(_0x2a0732){return{'name':_0x2a0732['originalname'],'basename':_0x2a0732[_0xbcf9('0x74')],'type':_0x2a0732[_0xbcf9('0xdc')],'ChatOfflineMessageId':_0x22fea4['id']};});}var _0x555fd8;if(!_['isNil'](_0x1cffff['subjectOffline'])){var _0x5de6cb=_[_0xbcf9('0x40')](_0x2b21c9[_0xbcf9('0x5e')],function(_0xc7cf23){return _0xc7cf23;});var _0x2b600a=_[_0xbcf9('0xf0')](_0x5de6cb)[0x0];var _0x13038a=_[_0xbcf9('0xf1')](_0x2b600a,function(_0x26331c){return _0x26331c;});_0x555fd8=_0x13038a[0x1][_0x1cffff['subjectOffline']];}var _0x9b02c2={'from':_0x3053c3['email'],'firstName':_0x3053c3['firstName'],'lastName':_0x3053c3['lastName'],'mapKey':'email','message':{'from':_0x3053c3[_0xbcf9('0xf2')],'to':_0x1cffff[_0xbcf9('0xd4')]['email'],'cc':'','subject':_[_0xbcf9('0x7e')](_0x555fd8)?_0x1cffff[_0xbcf9('0xf3')]:_0x555fd8,'messageId':'','sentAt':new Date(),'attach':_0x3a22eb[_0xbcf9('0x4b')],'attachments':_0x3a22eb,'originChannel':_0xbcf9('0xf4'),'ChatWebsiteId':_0x1cffff['id'],'ChatOfflineMessageId':_0x10f99f['id'],'originTo':_0x1cffff[_0xbcf9('0xd4')]['email']},'body':_0x10f99f['body']};var _0x35a62f={'account':{'id':_0x1cffff['MailAccountId']},'body':_0x9b02c2,'log':_0xbcf9('0xf5')};return respondWithRpcPromise('NotifyMailAccount',_0xbcf9('0xf6'),_0x35a62f,client9001)[_0xbcf9('0x23')](function(){return _0x10f99f;})[_0xbcf9('0x2c')](function(_0x29d2ca){console['error'](_0x29d2ca);});}return;})[_0xbcf9('0x23')](function(){if(_0x10f99f){return _0x10f99f;}})['then'](respondWithResult(_0xfb2ebf,null))[_0xbcf9('0x2c')](function(_0x3000ec){console['error'](_0xbcf9('0x2c'),_0x3000ec);for(var _0x3d78e2 of _0xaf5efe){var _0x2572f9=path[_0xbcf9('0x82')](config['root'],_0xbcf9('0xf7'),_0xbcf9('0xce'),_0xbcf9('0xf8'),_0xbcf9('0xdd'),_0x3d78e2['filename']);fs_extra[_0xbcf9('0xf9')](_0x2572f9)[_0xbcf9('0x2c')](function(_0x1b6aa8){console[_0xbcf9('0x27')](_0xbcf9('0xfa'),_0x2572f9,_0x1b6aa8);});}});};exports[_0xbcf9('0xfb')]=function(_0xe4303d,_0x1b70db,_0xa7713b){return db['ChatInteraction'][_0xbcf9('0x5c')]({'where':{'id':_0xe4303d['params']['id']}})['then'](handleEntityNotFound(_0x1b70db,null))['then'](function(_0x4eeb6e){if(_0x4eeb6e){return _0x4eeb6e[_0xbcf9('0xfb')](_0xe4303d[_0xbcf9('0x5e')]['ids'],_['omit'](_0xe4303d[_0xbcf9('0x5e')],[_0xbcf9('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x1b70db,null))['catch'](handleError(_0x1b70db,null));};exports[_0xbcf9('0xfc')]=function(_0x603936,_0x21bc75,_0x1d22db){var _0x40c550={'raw':![],'where':{}};var _0xddda90={};var _0x483d47={'count':0x0,'rows':[]};return db[_0xbcf9('0x41')]['findOne']({'where':{'id':_0x603936['params']['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x21bc75,null))[_0xbcf9('0x23')](function(_0x4551bf){if(_0x4551bf){_0xddda90[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db[_0xbcf9('0xbb')]['rawAttributes']);_0xddda90['query']=_[_0xbcf9('0x59')](_0x603936[_0xbcf9('0x47')]);_0xddda90[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0xddda90['model'],_0xddda90[_0xbcf9('0x47')]);_0x40c550[_0xbcf9('0x49')]=_[_0xbcf9('0x5a')](_0xddda90[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x603936[_0xbcf9('0x47')]['fields']));_0x40c550[_0xbcf9('0x49')]=_0x40c550['attributes'][_0xbcf9('0x4b')]?_0x40c550['attributes']:_0xddda90[_0xbcf9('0x46')];if(!_0x603936[_0xbcf9('0x47')][_0xbcf9('0x4c')]('nolimit')){_0x40c550[_0xbcf9('0x33')]=qs[_0xbcf9('0x33')](_0x603936[_0xbcf9('0x47')][_0xbcf9('0x33')]);_0x40c550['offset']=qs[_0xbcf9('0x30')](_0x603936[_0xbcf9('0x47')][_0xbcf9('0x30')]);}_0x40c550['order']=qs[_0xbcf9('0x4f')](_0x603936[_0xbcf9('0x47')][_0xbcf9('0x4f')]);_0x40c550[_0xbcf9('0x50')]=qs[_0xbcf9('0x48')](_['pick'](_0x603936[_0xbcf9('0x47')],_0xddda90['filters']));_0x40c550[_0xbcf9('0x50')]['ChatWebsiteId']=_0x4551bf['id'];if(_0x603936[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x40c550[_0xbcf9('0x50')]=_['merge'](_0x40c550['where'],{'$or':_[_0xbcf9('0x40')](_0x40c550[_0xbcf9('0x49')],function(_0x5dd51c){var _0x4c6532={};_0x4c6532[_0x5dd51c]={'$like':'%'+_0x603936['query'][_0xbcf9('0x51')]+'%'};return _0x4c6532;})});}_0x40c550=_['merge']({},_0x40c550,_0x603936[_0xbcf9('0x54')]);return db[_0xbcf9('0xbb')][_0xbcf9('0x32')]({'where':_0x40c550['where']})[_0xbcf9('0x23')](function(_0x5655ea){_0x483d47[_0xbcf9('0x32')]=_0x5655ea;if(_0x603936[_0xbcf9('0x47')][_0xbcf9('0x5b')]){_0x40c550[_0xbcf9('0x55')]=[{'model':db[_0xbcf9('0x8f')],'as':_0xbcf9('0xfd'),'required':![]},{'model':db[_0xbcf9('0xc5')],'as':_0xbcf9('0xfe'),'attributes':[_0xbcf9('0x3d'),'fullname',_0xbcf9('0xff')],'required':![]},{'model':db[_0xbcf9('0x100')],'as':_0xbcf9('0x101'),'attributes':['id',_0xbcf9('0x3d'),_0xbcf9('0x102')],'where':_0x603936[_0xbcf9('0x47')]['tag']?{'id':_0x603936[_0xbcf9('0x47')][_0xbcf9('0x103')]}:undefined,'required':_0x603936[_0xbcf9('0x47')][_0xbcf9('0x103')]?!![]:![]}];}return db[_0xbcf9('0xbb')][_0xbcf9('0x6d')](_0x40c550);})[_0xbcf9('0x23')](function(_0x2d2160){_0x483d47[_0xbcf9('0x56')]=_0x2d2160;return _0x483d47;});}})[_0xbcf9('0x23')](respondWithFilteredResult(_0x21bc75,_0x40c550))[_0xbcf9('0x2c')](handleError(_0x21bc75,null));};function iftimePromise(_0x1685e9,_0x35f8e3){return respondWithRpcPromise(_0xbcf9('0x104'),_0xbcf9('0x105'),{'command':_0x35f8e3[_0xbcf9('0x106')]?util[_0xbcf9('0xb4')]('iftime\x20%s,%s',_0x1685e9[_0xbcf9('0x107')],_0x35f8e3[_0xbcf9('0x106')]):util[_0xbcf9('0xb4')](_0xbcf9('0x108'),_0x1685e9[_0xbcf9('0x107')])},client9002)[_0xbcf9('0x23')](function(_0x19d2f4){var _0xfb9277=_0x19d2f4&&_0x19d2f4['indexOf']('true')>=0x0?!![]:![];logger[_0xbcf9('0x24')](_0xbcf9('0x109'),_0x35f8e3['id'],_0x1685e9['id'],_0x1685e9[_0xbcf9('0x107')],_0xfb9277?_0xbcf9('0x10a'):'OFFLINE',_0x35f8e3[_0xbcf9('0x106')]?_0x35f8e3['timezone']:_0xbcf9('0x10b'));return _0xfb9277;})['catch'](function(_0x4a1c39){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x35f8e3['id'],_0x1685e9['id'],_0x1685e9[_0xbcf9('0x107')],util[_0xbcf9('0x10c')](_0x4a1c39,{'showHidden':![],'depth':null}),_0x35f8e3[_0xbcf9('0x106')]?_0x35f8e3[_0xbcf9('0x106')]:_0xbcf9('0x10b'));return![];});}exports[_0xbcf9('0x105')]=function(_0x164cdc,_0x27c416,_0x485bd7){var _0x3b6a4b=0x0;var _0x775cd8=0x0;var _0x2bfe3b=![];var _0x54fce2;var _0x1b2221;return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x164cdc[_0xbcf9('0x58')]['id']},'include':[{'model':db[_0xbcf9('0x10d')],'as':_0xbcf9('0x10d'),'include':[{'model':db[_0xbcf9('0x10d')],'as':'Intervals','attributes':['id',_0xbcf9('0x107')],'raw':!![]}]}]})[_0xbcf9('0x23')](handleEntityNotFound(_0x27c416,null))[_0xbcf9('0x23')](function(_0x1c7028){if(_0x1c7028){_0x54fce2=_0x1c7028;return _0x1c7028['getProactiveActions']({'raw':!![]});}})[_0xbcf9('0x23')](function(_0x33f43e){if(_0x54fce2){if(_0x33f43e){_0x1b2221=_0x33f43e;}}return require('../../config/license/util')[_0xbcf9('0x7c')]();})[_0xbcf9('0x23')](function(_0x79a4e){if(_0x79a4e){_0x775cd8=_0x79a4e[_0xbcf9('0x10e')];_0x2bfe3b=_0x79a4e[_0xbcf9('0x7d')];}})['then'](function(){return db[_0xbcf9('0xbb')][_0xbcf9('0x32')]({'where':{'closed':![]}});})[_0xbcf9('0x23')](function(_0x4cc7f6){_0x3b6a4b=_0x4cc7f6;if(_0x775cd8&&_0x4cc7f6>_0x775cd8){return db[_0xbcf9('0x10f')][_0xbcf9('0x6b')]({'where':{'id':0x1}})['then'](function(_0x5dcc1c){if(_0x5dcc1c){_0x5dcc1c[_0xbcf9('0x110')](_0xbcf9('0x111'));}});}})['then'](function(){if(_0x54fce2[_0xbcf9('0x10d')]&&_0x54fce2[_0xbcf9('0x10d')][_0xbcf9('0x112')]){var _0x3385b2=[];for(var _0x30bbea=0x0;_0x30bbea<_0x54fce2[_0xbcf9('0x10d')][_0xbcf9('0x112')][_0xbcf9('0x4b')];_0x30bbea++){var _0x33dbd8=_0x54fce2[_0xbcf9('0x10d')][_0xbcf9('0x112')][_0x30bbea][_0xbcf9('0x3a')]({'plain':!![]});_0x3385b2[_0xbcf9('0xc1')](iftimePromise(_0x33dbd8,_0x54fce2));}return BPromise[_0xbcf9('0x113')](_0x3385b2)[_0xbcf9('0x23')](function(_0x471a9f){return _[_0xbcf9('0x114')](_0x471a9f);});}else{return!![];}})[_0xbcf9('0x23')](function(_0x3fe285){var _0x3e9b7e=fs[_0xbcf9('0xd5')](path['join'](config[_0xbcf9('0x7a')],_0xbcf9('0x115')),'utf8');var _0x12316a={'remote':_0x54fce2[_0xbcf9('0x116')],'query':querystring['stringify'](_[_0xbcf9('0x52')](_0x54fce2[_0xbcf9('0x3a')]({'plain':!![]}),{'customerIp':_0x164cdc[_0xbcf9('0x8c')][_0xbcf9('0xab')]||_0x164cdc[_0xbcf9('0x8c')][_0xbcf9('0x117')]||_0x164cdc['connection']['remoteAddress']||_0x164cdc['ip'],'referer':_0x164cdc[_0xbcf9('0x8c')]['referer'],'openedInteractions':_0x3b6a4b,'maxInteractions':_0x775cd8,'virtual':_0x2bfe3b[_0xbcf9('0x10e')],'online':_0x3fe285,'custom':_0x2bfe3b}))['replace'](/'/g,'\x5c\x27')};_0x27c416[_0xbcf9('0xcf')](ejs['render'](Mustache[_0xbcf9('0xd8')](_0x3e9b7e,_0x12316a),{'proactiveActions':_0x1b2221,'alignment':_0x54fce2[_0xbcf9('0x118')],'verticalAlignment':_0x54fce2[_0xbcf9('0x119')],'div_color':_0x54fce2['color'],'text_color':_0x54fce2[_0xbcf9('0x11a')],'button_color':_0x54fce2['color_button'],'background_color':_0x54fce2[_0xbcf9('0x11b')]}));})['catch'](handleError(_0x27c416,null));};exports[_0xbcf9('0x11c')]=function(_0x5323f7,_0x599126,_0x3a1e0f){return db[_0xbcf9('0x41')][_0xbcf9('0x6b')]({'where':{'id':_0x5323f7[_0xbcf9('0x58')]['id']}})['then'](handleEntityNotFound(_0x599126,null))[_0xbcf9('0x23')](function(_0x91c903){if(_0x91c903){return db['sequelize'][_0xbcf9('0xe1')](function(_0x5891f0){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x5323f7[_0xbcf9('0x58')]['id']},'transaction':_0x5891f0})['then'](function(_0x20f889){var _0x4128ed=_[_0xbcf9('0x40')](_0x5323f7[_0xbcf9('0x5e')],function(_0x3225dc){_0x3225dc['ChatWebsiteId']=_0x5323f7[_0xbcf9('0x58')]['id'];return _0x3225dc;});return db[_0xbcf9('0xa1')][_0xbcf9('0xe3')](_0x4128ed,{'transaction':_0x5891f0});});})[_0xbcf9('0x23')](function(){return db[_0xbcf9('0xa1')][_0xbcf9('0x11d')]({'where':{'ChatWebsiteId':_0x5323f7[_0xbcf9('0x58')]['id']},'order':_0xbcf9('0xa8')});});}})[_0xbcf9('0x23')](respondWithResult(_0x599126,null))[_0xbcf9('0x2c')](handleError(_0x599126,null));};exports[_0xbcf9('0x11e')]=function(_0x11cfc2,_0x9599a4,_0xef703f){var _0x4d1b57={};var _0x12534d={};var _0x533a4b;var _0x295309;return db[_0xbcf9('0x41')][_0xbcf9('0x6b')]({'where':{'id':_0x11cfc2[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x9599a4,null))['then'](function(_0x62a84f){if(_0x62a84f){_0x533a4b=_0x62a84f;_0x12534d[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db['ChatApplication'][_0xbcf9('0x42')]);_0x12534d[_0xbcf9('0x47')]=_[_0xbcf9('0x59')](_0x11cfc2[_0xbcf9('0x47')]);_0x12534d[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0x12534d[_0xbcf9('0x46')],_0x12534d[_0xbcf9('0x47')]);_0x4d1b57['attributes']=_['intersection'](_0x12534d[_0xbcf9('0x46')],qs['fields'](_0x11cfc2[_0xbcf9('0x47')][_0xbcf9('0x4a')]));_0x4d1b57[_0xbcf9('0x49')]=_0x4d1b57[_0xbcf9('0x49')][_0xbcf9('0x4b')]?_0x4d1b57[_0xbcf9('0x49')]:_0x12534d[_0xbcf9('0x46')];_0x4d1b57[_0xbcf9('0x4e')]=qs[_0xbcf9('0x4f')](_0x11cfc2['query'][_0xbcf9('0x4f')]);_0x4d1b57['where']=qs[_0xbcf9('0x48')](_[_0xbcf9('0x6c')](_0x11cfc2[_0xbcf9('0x47')],_0x12534d[_0xbcf9('0x48')]));if(_0x11cfc2[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x4d1b57[_0xbcf9('0x50')]=_[_0xbcf9('0x52')](_0x4d1b57[_0xbcf9('0x50')],{'$or':_[_0xbcf9('0x40')](_0x4d1b57[_0xbcf9('0x49')],function(_0x7ed561){var _0x49cb42={};_0x49cb42[_0x7ed561]={'$like':'%'+_0x11cfc2[_0xbcf9('0x47')]['filter']+'%'};return _0x49cb42;})});}_0x4d1b57=_['merge']({},_0x4d1b57,_0x11cfc2[_0xbcf9('0x54')]);return _0x533a4b[_0xbcf9('0x11e')](_0x4d1b57);}})['then'](function(_0x57f3f0){if(_0x57f3f0){_0x295309=_0x57f3f0[_0xbcf9('0x4b')];if(!_0x11cfc2[_0xbcf9('0x47')]['hasOwnProperty'](_0xbcf9('0x4d'))){_0x4d1b57[_0xbcf9('0x33')]=qs[_0xbcf9('0x33')](_0x11cfc2[_0xbcf9('0x47')][_0xbcf9('0x33')]);_0x4d1b57[_0xbcf9('0x30')]=qs[_0xbcf9('0x30')](_0x11cfc2[_0xbcf9('0x47')][_0xbcf9('0x30')]);}return _0x533a4b[_0xbcf9('0x11e')](_0x4d1b57);}})[_0xbcf9('0x23')](function(_0x21546d){if(_0x21546d){return _0x21546d?{'count':_0x295309,'rows':_0x21546d}:null;}})[_0xbcf9('0x23')](respondWithResult(_0x9599a4,null))[_0xbcf9('0x2c')](handleError(_0x9599a4,null));};exports['addProactiveActions']=function(_0x3d3391,_0x1545fe,_0x48bcb6){return db[_0xbcf9('0x11f')][_0xbcf9('0x5c')]({'where':{'id':_0x3d3391[_0xbcf9('0x58')]['id']}})['then'](handleEntityNotFound(_0x1545fe,null))[_0xbcf9('0x23')](function(_0x37a1e8){if(_0x37a1e8){return _0x37a1e8[_0xbcf9('0x120')](_0x3d3391[_0xbcf9('0x5e')]['ids'],_[_0xbcf9('0x121')](_0x3d3391[_0xbcf9('0x5e')],[_0xbcf9('0x6f'),'id'])||{});}})[_0xbcf9('0x23')](respondWithResult(_0x1545fe,null))[_0xbcf9('0x2c')](handleError(_0x1545fe,null));};exports[_0xbcf9('0x122')]=function(_0x3b2d6f,_0x117600,_0x2b4b5a){var _0x198123={};var _0x49bcf5={};var _0x233a9e;var _0x8deb0e;return db[_0xbcf9('0x41')][_0xbcf9('0x6b')]({'where':{'id':_0x3b2d6f[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x117600,null))[_0xbcf9('0x23')](function(_0x129b64){if(_0x129b64){_0x233a9e=_0x129b64;_0x49bcf5[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db['ChatProactiveAction'][_0xbcf9('0x42')]);_0x49bcf5[_0xbcf9('0x47')]=_[_0xbcf9('0x59')](_0x3b2d6f[_0xbcf9('0x47')]);_0x49bcf5[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0x49bcf5['model'],_0x49bcf5[_0xbcf9('0x47')]);_0x198123[_0xbcf9('0x49')]=_[_0xbcf9('0x5a')](_0x49bcf5[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x3b2d6f[_0xbcf9('0x47')][_0xbcf9('0x4a')]));_0x198123[_0xbcf9('0x49')]=_0x198123[_0xbcf9('0x49')]['length']?_0x198123[_0xbcf9('0x49')]:_0x49bcf5['model'];_0x198123['order']=qs[_0xbcf9('0x4f')](_0x3b2d6f[_0xbcf9('0x47')]['sort']);_0x198123[_0xbcf9('0x50')]=qs['filters'](_[_0xbcf9('0x6c')](_0x3b2d6f['query'],_0x49bcf5[_0xbcf9('0x48')]));if(_0x3b2d6f[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x198123[_0xbcf9('0x50')]=_[_0xbcf9('0x52')](_0x198123['where'],{'$or':_[_0xbcf9('0x40')](_0x198123[_0xbcf9('0x49')],function(_0x8501c){var _0xda09de={};_0xda09de[_0x8501c]={'$like':'%'+_0x3b2d6f['query'][_0xbcf9('0x51')]+'%'};return _0xda09de;})});}_0x198123=_[_0xbcf9('0x52')]({},_0x198123,_0x3b2d6f[_0xbcf9('0x54')]);return _0x233a9e[_0xbcf9('0x122')](_0x198123);}})[_0xbcf9('0x23')](function(_0x5856be){if(_0x5856be){_0x8deb0e=_0x5856be[_0xbcf9('0x4b')];if(!_0x3b2d6f[_0xbcf9('0x47')]['hasOwnProperty'](_0xbcf9('0x4d'))){_0x198123[_0xbcf9('0x33')]=qs['limit'](_0x3b2d6f['query'][_0xbcf9('0x33')]);_0x198123[_0xbcf9('0x30')]=qs[_0xbcf9('0x30')](_0x3b2d6f[_0xbcf9('0x47')][_0xbcf9('0x30')]);}return _0x233a9e[_0xbcf9('0x122')](_0x198123);}})[_0xbcf9('0x23')](function(_0x2f44cb){if(_0x2f44cb){return _0x2f44cb?{'count':_0x8deb0e,'rows':_0x2f44cb}:null;}})[_0xbcf9('0x23')](respondWithResult(_0x117600,null))['catch'](handleError(_0x117600,null));};exports['getFields']=function(_0x3f4f0f,_0x26ba24,_0x31bb59){var _0x5cba83=_0x3f4f0f[_0xbcf9('0x47')][_0xbcf9('0x123')]===_0xbcf9('0x124')?_0xbcf9('0x125'):'onlineForm';return db['ChatWebsite'][_0xbcf9('0x5c')]({'attributes':['id',_0x5cba83],'where':{'id':_0x3f4f0f[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x26ba24,null))[_0xbcf9('0x23')](function(_0x52e6d9){if(_0x52e6d9){var _0x5748f5=_0x52e6d9[_0x5cba83];var _0x293736=_0x5748f5&&_0x5748f5[_0xbcf9('0x126')]?_0x5748f5[_0xbcf9('0x126')]:[];_0x26ba24[_0xbcf9('0xcf')]({'fromKey':_[_0xbcf9('0x7e')](_0x5748f5[_0xbcf9('0x127')])?undefined:_0x5748f5[_0xbcf9('0x127')],'count':_0x293736['length'],'rows':_0x293736});}})[_0xbcf9('0x2c')](handleError(_0x26ba24,null));};exports[_0xbcf9('0x128')]=function(_0x1a6bd6,_0x8312b,_0x2bfb4d){var _0x23d133={'raw':![],'where':{}};var _0xa2ca91={};var _0x6ea354={'count':0x0,'rows':[]};return db[_0xbcf9('0x41')][_0xbcf9('0x6b')]({'where':{'id':_0x1a6bd6['params']['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x8312b,null))[_0xbcf9('0x23')](function(_0x27b56e){if(_0x27b56e){_0xa2ca91[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db[_0xbcf9('0xdb')]['rawAttributes']);_0xa2ca91[_0xbcf9('0x47')]=_[_0xbcf9('0x59')](_0x1a6bd6['query']);_0xa2ca91[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0xa2ca91['model'],_0xa2ca91[_0xbcf9('0x47')]);_0x23d133['attributes']=_[_0xbcf9('0x5a')](_0xa2ca91[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x1a6bd6[_0xbcf9('0x47')][_0xbcf9('0x4a')]));_0x23d133[_0xbcf9('0x49')]=_0x23d133[_0xbcf9('0x49')]['length']?_0x23d133[_0xbcf9('0x49')]:_0xa2ca91[_0xbcf9('0x46')];if(!_0x1a6bd6['query'][_0xbcf9('0x4c')](_0xbcf9('0x4d'))){_0x23d133['limit']=qs[_0xbcf9('0x33')](_0x1a6bd6[_0xbcf9('0x47')][_0xbcf9('0x33')]);_0x23d133[_0xbcf9('0x30')]=qs[_0xbcf9('0x30')](_0x1a6bd6[_0xbcf9('0x47')][_0xbcf9('0x30')]);}_0x23d133[_0xbcf9('0x4e')]=qs[_0xbcf9('0x4f')](_0x1a6bd6[_0xbcf9('0x47')]['sort']);_0x23d133['where']=qs[_0xbcf9('0x48')](_[_0xbcf9('0x6c')](_0x1a6bd6[_0xbcf9('0x47')],_0xa2ca91['filters']));_0x23d133[_0xbcf9('0x50')][_0xbcf9('0x68')]=_0x27b56e['id'];if(_0x1a6bd6[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x23d133['where']=_[_0xbcf9('0x52')](_0x23d133['where'],{'$or':_[_0xbcf9('0x40')](_0x23d133['attributes'],function(_0xef563){var _0xca50a0={};_0xca50a0[_0xef563]={'$like':'%'+_0x1a6bd6['query'][_0xbcf9('0x51')]+'%'};return _0xca50a0;})});}_0x23d133=_[_0xbcf9('0x52')]({},_0x23d133,_0x1a6bd6[_0xbcf9('0x54')]);return db[_0xbcf9('0xdb')][_0xbcf9('0x32')]({'where':_0x23d133['where']})[_0xbcf9('0x23')](function(_0x3c1d39){_0x6ea354[_0xbcf9('0x32')]=_0x3c1d39;if(_0x1a6bd6[_0xbcf9('0x47')][_0xbcf9('0x5b')]){_0x23d133[_0xbcf9('0x55')]=[{'all':!![]}];}else{_0x23d133[_0xbcf9('0x55')]=[{'model':db[_0xbcf9('0x8f')],'as':_0xbcf9('0xfd'),'required':![]},{'model':db[_0xbcf9('0xe2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xbcf9('0x6d')](_0x23d133);})[_0xbcf9('0x23')](function(_0x5a77f5){_0x6ea354[_0xbcf9('0x56')]=_0x5a77f5;return _0x6ea354;});}})[_0xbcf9('0x23')](respondWithFilteredResult(_0x8312b,_0x23d133))[_0xbcf9('0x2c')](handleError(_0x8312b,null));};exports[_0xbcf9('0x129')]=function(_0x1beec6,_0x2683f8,_0x387fba){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x1beec6[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x2683f8,null))[_0xbcf9('0x23')](function(_0x1a0330){if(_0x1a0330){return _0x1a0330[_0xbcf9('0x129')](_0x1beec6['body'][_0xbcf9('0x6f')],_['omit'](_0x1beec6['body'],[_0xbcf9('0x6f'),'id'])||{})[_0xbcf9('0xbe')](function(_0x5a97e6){for(var _0x542225=0x0;_0x542225<_0x1beec6['body'][_0xbcf9('0x6f')][_0xbcf9('0x4b')];_0x542225+=0x1){socket[_0xbcf9('0x12a')](_0xbcf9('0x12b'),{'UserId':Number(_0x1beec6[_0xbcf9('0x5e')][_0xbcf9('0x6f')][_0x542225]),'ChatWebsiteId':Number(_0x1beec6[_0xbcf9('0x58')]['id'])});}return _0x5a97e6;});}})[_0xbcf9('0x23')](respondWithResult(_0x2683f8,null))['catch'](handleError(_0x2683f8,null));};exports['removeAgents']=function(_0x2acd5b,_0x4d3e06,_0x17d76e){return db[_0xbcf9('0x41')][_0xbcf9('0x5c')]({'where':{'id':_0x2acd5b['params']['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x4d3e06,null))[_0xbcf9('0x23')](function(_0x1f65a1){if(_0x1f65a1){return _0x1f65a1[_0xbcf9('0x12c')](_0x2acd5b[_0xbcf9('0x47')]['ids'])[_0xbcf9('0x23')](function(){if(_[_0xbcf9('0x12d')](_0x2acd5b['query'][_0xbcf9('0x6f')])){for(var _0x351159=0x0;_0x351159<_0x2acd5b[_0xbcf9('0x47')][_0xbcf9('0x6f')][_0xbcf9('0x4b')];_0x351159+=0x1){socket[_0xbcf9('0x12a')](_0xbcf9('0x12e'),{'UserId':Number(_0x2acd5b[_0xbcf9('0x47')][_0xbcf9('0x6f')][_0x351159]),'ChatWebsiteId':Number(_0x2acd5b[_0xbcf9('0x58')]['id'])});}}else{socket[_0xbcf9('0x12a')](_0xbcf9('0x12e'),{'UserId':Number(_0x2acd5b[_0xbcf9('0x47')][_0xbcf9('0x6f')]),'ChatWebsiteId':Number(_0x2acd5b[_0xbcf9('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x4d3e06,null))[_0xbcf9('0x2c')](handleError(_0x4d3e06,null));};exports['getAgents']=function(_0x510e45,_0x2e3f6a,_0x36d9b2){var _0x1d54a3={};var _0x23ad34={};var _0x55aeef;var _0x3c8c54;return db[_0xbcf9('0x41')][_0xbcf9('0x6b')]({'where':{'id':_0x510e45[_0xbcf9('0x58')]['id']}})[_0xbcf9('0x23')](handleEntityNotFound(_0x2e3f6a,null))[_0xbcf9('0x23')](function(_0xee72e2){if(_0xee72e2){_0x55aeef=_0xee72e2;_0x23ad34[_0xbcf9('0x46')]=_[_0xbcf9('0x59')](db['User'][_0xbcf9('0x42')]);_0x23ad34['query']=_[_0xbcf9('0x59')](_0x510e45['query']);_0x23ad34[_0xbcf9('0x48')]=_[_0xbcf9('0x5a')](_0x23ad34[_0xbcf9('0x46')],_0x23ad34[_0xbcf9('0x47')]);_0x1d54a3['attributes']=_[_0xbcf9('0x5a')](_0x23ad34[_0xbcf9('0x46')],qs[_0xbcf9('0x4a')](_0x510e45[_0xbcf9('0x47')]['fields']));_0x1d54a3[_0xbcf9('0x49')]=_0x1d54a3[_0xbcf9('0x49')][_0xbcf9('0x4b')]?_0x1d54a3[_0xbcf9('0x49')]:_0x23ad34['model'];_0x1d54a3[_0xbcf9('0x4e')]=qs[_0xbcf9('0x4f')](_0x510e45[_0xbcf9('0x47')][_0xbcf9('0x4f')]);_0x1d54a3[_0xbcf9('0x50')]=qs['filters'](_[_0xbcf9('0x6c')](_0x510e45['query'],_0x23ad34[_0xbcf9('0x48')]));if(_0x510e45[_0xbcf9('0x47')][_0xbcf9('0x51')]){_0x1d54a3['where']=_[_0xbcf9('0x52')](_0x1d54a3['where'],{'$or':_[_0xbcf9('0x40')](_0x1d54a3[_0xbcf9('0x49')],function(_0x45ab79){var _0x4f3c2d={};_0x4f3c2d[_0x45ab79]={'$like':'%'+_0x510e45[_0xbcf9('0x47')][_0xbcf9('0x51')]+'%'};return _0x4f3c2d;})});}_0x1d54a3=_[_0xbcf9('0x52')]({},_0x1d54a3,_0x510e45['options']);return _0x55aeef['getAgents'](_0x1d54a3);}})[_0xbcf9('0x23')](function(_0x4662e9){if(_0x4662e9){_0x3c8c54=_0x4662e9[_0xbcf9('0x4b')];if(!_0x510e45[_0xbcf9('0x47')][_0xbcf9('0x4c')]('nolimit')){_0x1d54a3['limit']=qs['limit'](_0x510e45[_0xbcf9('0x47')]['limit']);_0x1d54a3[_0xbcf9('0x30')]=qs[_0xbcf9('0x30')](_0x510e45[_0xbcf9('0x47')][_0xbcf9('0x30')]);}return _0x55aeef[_0xbcf9('0x12f')](_0x1d54a3);}})[_0xbcf9('0x23')](function(_0x23a61c){if(_0x23a61c){return _0x23a61c?{'count':_0x3c8c54,'rows':_0x23a61c}:null;}})['then'](respondWithResult(_0x2e3f6a,null))[_0xbcf9('0x2c')](handleError(_0x2e3f6a,null));};
\ No newline at end of file
index 948b4b3..51f636e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadec=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','exports'];(function(_0x20e3f1,_0x3fd7a2){var _0x63cc7f=function(_0x1e8d3e){while(--_0x1e8d3e){_0x20e3f1['push'](_0x20e3f1['shift']());}};_0x63cc7f(++_0x3fd7a2);}(_0xadec,0x156));var _0xcade=function(_0x5c8ba0,_0x5b2bae){_0x5c8ba0=_0x5c8ba0-0x0;var _0x15b1d4=_0xadec[_0x5c8ba0];return _0x15b1d4;};'use strict';var EventEmitter=require(_0xcade('0x0'));var ChatWebsite=require(_0xcade('0x1'))['db'][_0xcade('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcade('0x3')](0x0);var events={'afterCreate':_0xcade('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x570d9c){return function(_0x475533,_0x875b81,_0xc0b40e){ChatWebsiteEvents['emit'](_0x570d9c+':'+_0x475533['id'],_0x475533);ChatWebsiteEvents['emit'](_0x570d9c,_0x475533);_0xc0b40e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcade('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2830=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2830,0x117));var _0x0283=function(_0x457c24,_0x2e434d){_0x457c24=_0x457c24-0x0;var _0x311590=_0x2830[_0x457c24];return _0x311590;};'use strict';var EventEmitter=require(_0x0283('0x0'));var ChatWebsite=require(_0x0283('0x1'))['db'][_0x0283('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0283('0x3')](0x0);var events={'afterCreate':_0x0283('0x4'),'afterUpdate':_0x0283('0x5'),'afterDestroy':_0x0283('0x6')};function emitEvent(_0x56984a){return function(_0x414c89,_0x4aa050,_0x1a8998){ChatWebsiteEvents[_0x0283('0x7')](_0x56984a+':'+_0x414c89['id'],_0x414c89);ChatWebsiteEvents[_0x0283('0x7')](_0x56984a,_0x414c89);_0x1a8998(null);};}for(var e in events){if(events[_0x0283('0x8')](e)){var event=events[e];ChatWebsite[_0x0283('0x9')](e,emitEvent(event));}}module[_0x0283('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
index 5501231..0e3b164 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7059=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util'];(function(_0x21a7aa,_0x2248dc){var _0x20c622=function(_0x464a2b){while(--_0x464a2b){_0x21a7aa['push'](_0x21a7aa['shift']());}};_0x20c622(++_0x2248dc);}(_0x7059,0x1c5));var _0x9705=function(_0x5d186c,_0xb30ec8){_0x5d186c=_0x5d186c-0x0;var _0x428e23=_0x7059[_0x5d186c];return _0x428e23;};'use strict';var _=require(_0x9705('0x0'));var util=require(_0x9705('0x1'));var logger=require(_0x9705('0x2'))(_0x9705('0x3'));var moment=require(_0x9705('0x4'));var BPromise=require(_0x9705('0x5'));var rp=require(_0x9705('0x6'));var fs=require('fs');var path=require(_0x9705('0x7'));var rimraf=require(_0x9705('0x8'));var config=require('../../config/environment');var attributes=require(_0x9705('0x9'));module[_0x9705('0xa')]=function(_0x56cfe7,_0x223d7c){return _0x56cfe7[_0x9705('0xb')]('ChatWebsite',attributes,{'tableName':_0x9705('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa81b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x567c79,_0x340546){var _0xb81832=function(_0x3932be){while(--_0x3932be){_0x567c79['push'](_0x567c79['shift']());}};_0xb81832(++_0x340546);}(_0xa81b,0x17a));var _0xba81=function(_0x400da3,_0x55d4fa){_0x400da3=_0x400da3-0x0;var _0x1c7073=_0xa81b[_0x400da3];return _0x1c7073;};'use strict';var _=require(_0xba81('0x0'));var util=require(_0xba81('0x1'));var logger=require(_0xba81('0x2'))(_0xba81('0x3'));var moment=require(_0xba81('0x4'));var BPromise=require(_0xba81('0x5'));var rp=require(_0xba81('0x6'));var fs=require('fs');var path=require(_0xba81('0x7'));var rimraf=require(_0xba81('0x8'));var config=require(_0xba81('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xba81('0xa')]=function(_0x20a981,_0x3fc7d3){return _0x20a981[_0xba81('0xb')](_0xba81('0xc'),attributes,{'tableName':_0xba81('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f27d798..ae17bf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6004=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x6004,0x1e1));var _0x4600=function(_0x24c621,_0x32480c){_0x24c621=_0x24c621-0x0;var _0x4046ff=_0x6004[_0x24c621];return _0x4046ff;};'use strict';var _=require(_0x4600('0x0'));var util=require(_0x4600('0x1'));var moment=require(_0x4600('0x2'));var BPromise=require(_0x4600('0x3'));var rs=require(_0x4600('0x4'));var fs=require('fs');var Redis=require(_0x4600('0x5'));var db=require(_0x4600('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4600('0x7'))(_0x4600('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4600('0x9')][_0x4600('0xa')]({'port':0x232a});config[_0x4600('0xb')]=_[_0x4600('0xc')](config[_0x4600('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4600('0xd'))(new Redis(config[_0x4600('0xb')]));require('./chatWebsite.socket')[_0x4600('0xe')](socket);function respondWithRpcPromise(_0x3a61ba,_0x1c70a9,_0x3b2dca){return new BPromise(function(_0xc27e9a,_0xb948e){return client[_0x4600('0xf')](_0x3a61ba,_0x3b2dca)['then'](function(_0x477475){logger['info'](_0x4600('0x10'),_0x1c70a9,_0x4600('0x11'));logger[_0x4600('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1c70a9,_0x4600('0x11'),JSON[_0x4600('0x13')](_0x477475));if(_0x477475['error']){if(_0x477475[_0x4600('0x14')]['code']===0x1f4){logger[_0x4600('0x14')](_0x4600('0x10'),_0x1c70a9,_0x477475['error']['message']);return _0xb948e(_0x477475[_0x4600('0x14')]['message']);}logger[_0x4600('0x14')](_0x4600('0x10'),_0x1c70a9,_0x477475[_0x4600('0x14')][_0x4600('0x15')]);return _0xc27e9a(_0x477475['error'][_0x4600('0x15')]);}else{logger[_0x4600('0x16')](_0x4600('0x10'),_0x1c70a9,_0x4600('0x11'));_0xc27e9a(_0x477475[_0x4600('0x17')][_0x4600('0x15')]);}})['catch'](function(_0x7f8cab){logger[_0x4600('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1c70a9,_0x7f8cab);_0xb948e(_0x7f8cab);});});}
\ No newline at end of file
+var _0xcd09=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd09,0x15b));var _0x9cd0=function(_0x5a559c,_0xb34e0b){_0x5a559c=_0x5a559c-0x0;var _0x1a4bd9=_0xcd09[_0x5a559c];return _0x1a4bd9;};'use strict';var _=require(_0x9cd0('0x0'));var util=require(_0x9cd0('0x1'));var moment=require(_0x9cd0('0x2'));var BPromise=require(_0x9cd0('0x3'));var rs=require(_0x9cd0('0x4'));var fs=require('fs');var Redis=require(_0x9cd0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cd0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9cd0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cd0('0x8')][_0x9cd0('0x9')]({'port':0x232a});config[_0x9cd0('0xa')]=_[_0x9cd0('0xb')](config[_0x9cd0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9cd0('0xc'))(new Redis(config[_0x9cd0('0xa')]));require('./chatWebsite.socket')[_0x9cd0('0xd')](socket);function respondWithRpcPromise(_0x5cb26c,_0xe88a1,_0x45bcaa){return new BPromise(function(_0x3e801d,_0x26d329){return client[_0x9cd0('0xe')](_0x5cb26c,_0x45bcaa)[_0x9cd0('0xf')](function(_0x5c1353){logger['info'](_0x9cd0('0x10'),_0xe88a1,'request\x20sent');logger['debug'](_0x9cd0('0x11'),_0xe88a1,'request\x20sent',JSON[_0x9cd0('0x12')](_0x5c1353));if(_0x5c1353[_0x9cd0('0x13')]){if(_0x5c1353[_0x9cd0('0x13')][_0x9cd0('0x14')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xe88a1,_0x5c1353[_0x9cd0('0x13')][_0x9cd0('0x15')]);return _0x26d329(_0x5c1353['error'][_0x9cd0('0x15')]);}logger[_0x9cd0('0x13')](_0x9cd0('0x10'),_0xe88a1,_0x5c1353['error'][_0x9cd0('0x15')]);return _0x3e801d(_0x5c1353['error']['message']);}else{logger[_0x9cd0('0x16')](_0x9cd0('0x10'),_0xe88a1,'request\x20sent');_0x3e801d(_0x5c1353[_0x9cd0('0x17')]['message']);}})[_0x9cd0('0x18')](function(_0x28b927){logger[_0x9cd0('0x13')](_0x9cd0('0x10'),_0xe88a1,_0x28b927);_0x26d329(_0x28b927);});});}
\ No newline at end of file
index 4c948f8..fe9719e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0072=['save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x4f8acc,_0xca278b){var _0x3000fc=function(_0x2cb684){while(--_0x2cb684){_0x4f8acc['push'](_0x4f8acc['shift']());}};_0x3000fc(++_0xca278b);}(_0x0072,0x1e8));var _0x2007=function(_0x14977c,_0x2c6d7e){_0x14977c=_0x14977c-0x0;var _0xafe01a=_0x0072[_0x14977c];return _0xafe01a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x2007('0x0'),_0x2007('0x1'),_0x2007('0x2')];function createListener(_0x1e6fce,_0x50321b){return function(_0x5b118b){_0x50321b[_0x2007('0x3')](_0x1e6fce,_0x5b118b);};}function removeListener(_0x488633,_0x71c14b){return function(){ChatWebsiteEvents[_0x2007('0x4')](_0x488633,_0x71c14b);};}exports[_0x2007('0x5')]=function(_0x1bacf1){for(var _0x329171=0x0,_0x3cf355=events[_0x2007('0x6')];_0x329171<_0x3cf355;_0x329171++){var _0x4e868b=events[_0x329171];var _0x4b6ef3=createListener(_0x2007('0x7')+_0x4e868b,_0x1bacf1);ChatWebsiteEvents['on'](_0x4e868b,_0x4b6ef3);}};
\ No newline at end of file
+var _0xc201=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc201,0x10b));var _0x1c20=function(_0x383110,_0x2490b7){_0x383110=_0x383110-0x0;var _0x44cd2f=_0xc201[_0x383110];return _0x44cd2f;};'use strict';var ChatWebsiteEvents=require(_0x1c20('0x0'));var events=[_0x1c20('0x1'),_0x1c20('0x2'),_0x1c20('0x3')];function createListener(_0x4156d6,_0x52dacb){return function(_0x21b076){_0x52dacb[_0x1c20('0x4')](_0x4156d6,_0x21b076);};}function removeListener(_0x221d73,_0x50d427){return function(){ChatWebsiteEvents['removeListener'](_0x221d73,_0x50d427);};}exports[_0x1c20('0x5')]=function(_0x1acfa0){for(var _0xae24e2=0x0,_0x147762=events[_0x1c20('0x6')];_0xae24e2<_0x147762;_0xae24e2++){var _0x2a10cb=events[_0xae24e2];var _0x40cbdd=createListener(_0x1c20('0x7')+_0x2a10cb,_0x1acfa0);ChatWebsiteEvents['on'](_0x2a10cb,_0x40cbdd);}};
\ No newline at end of file
index d9f23df..fcb213e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8522=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','server/files/images/avatars/','single','file','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','removeAnswers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition'];(function(_0x41a983,_0xd760c3){var _0x5a2981=function(_0x5150d9){while(--_0x5150d9){_0x41a983['push'](_0x41a983['shift']());}};_0x5a2981(++_0xd760c3);}(_0x8522,0x1df));var _0x2852=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8522[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x2852('0x0'));var util=require(_0x2852('0x1'));var path=require(_0x2852('0x2'));var timeout=require(_0x2852('0x3'));var express=require('express');var router=express[_0x2852('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2852('0x5'));var interaction=require(_0x2852('0x6'));var config=require('../../config/environment');var controller=require(_0x2852('0x7'));router['get']('/',auth[_0x2852('0x8')](),controller[_0x2852('0x9')]);router[_0x2852('0xa')](_0x2852('0xb'),auth[_0x2852('0x8')](),controller[_0x2852('0xc')]);router[_0x2852('0xa')](_0x2852('0xd'),auth[_0x2852('0x8')](),controller[_0x2852('0xe')]);router[_0x2852('0xa')](_0x2852('0xf'),auth[_0x2852('0x8')](),controller[_0x2852('0x10')]);router[_0x2852('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2852('0x11')]);router['get'](_0x2852('0x12'),controller[_0x2852('0x13')]);router[_0x2852('0xa')](_0x2852('0x14'),controller[_0x2852('0x15')]);router[_0x2852('0xa')](_0x2852('0x16'),controller[_0x2852('0x17')]);router[_0x2852('0xa')]('/:id/system_avatar',controller[_0x2852('0x18')]);router[_0x2852('0xa')]('/:id/interactions',auth[_0x2852('0x8')](),controller[_0x2852('0x19')]);router[_0x2852('0xa')](_0x2852('0x1a'),controller[_0x2852('0x1b')]);router[_0x2852('0xa')](_0x2852('0x1c'),auth[_0x2852('0x8')](),controller[_0x2852('0x1d')]);router[_0x2852('0xa')](_0x2852('0x1e'),auth[_0x2852('0x8')](),controller[_0x2852('0x1f')]);router[_0x2852('0xa')](_0x2852('0x20'),controller['getFields']);router[_0x2852('0xa')](_0x2852('0x21'),auth[_0x2852('0x8')](),controller[_0x2852('0x22')]);router['get'](_0x2852('0x23'),auth[_0x2852('0x8')](),controller['getAgents']);router[_0x2852('0x24')]('/',auth[_0x2852('0x8')](),controller[_0x2852('0x25')]);router[_0x2852('0x24')](_0x2852('0xf'),auth['isAuthenticated'](),controller[_0x2852('0x26')]);router[_0x2852('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2852('0x27')]);var upload=multer({'storage':multer[_0x2852('0x28')]({'destination':function(_0x430cd7,_0x8683af,_0x9be545){_0x9be545(null,path[_0x2852('0x29')](config[_0x2852('0x2a')],_0x2852('0x2b')));},'filename':function(_0x6cd5e7,_0x432c0a,_0x4e146b){_0x4e146b(null,util[_0x2852('0x2c')](_0x2852('0x2d'),Date[_0x2852('0x2e')](),_0x432c0a[_0x2852('0x2f')]));}})});router[_0x2852('0x24')]('/:id/logo',upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x2852('0x28')]({'destination':function(_0x2d48bd,_0x2cd1e9,_0x280a2a){_0x280a2a(null,path[_0x2852('0x29')](config[_0x2852('0x2a')],_0x2852('0x30')));},'filename':function(_0x43938b,_0x3a2b77,_0x2fa727){_0x2fa727(null,util[_0x2852('0x2c')](_0x2852('0x2d'),Date[_0x2852('0x2e')](),_0x3a2b77['originalname']));}})});router['post']('/:id/avatar',upload[_0x2852('0x31')](_0x2852('0x32')),controller[_0x2852('0x33')]);var upload=multer({'storage':multer[_0x2852('0x28')]({'destination':function(_0x5b7a08,_0x22ab13,_0xed94c9){_0xed94c9(null,path[_0x2852('0x29')](config[_0x2852('0x2a')],_0x2852('0x30')));},'filename':function(_0x2194fd,_0x4f7e27,_0x372ab2){_0x372ab2(null,util['format'](_0x2852('0x2d'),Date[_0x2852('0x2e')](),_0x4f7e27[_0x2852('0x2f')]));}})});router[_0x2852('0x24')](_0x2852('0x16'),upload[_0x2852('0x31')](_0x2852('0x32')),controller[_0x2852('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a0be1,_0x442edd,_0x46796b){_0x46796b(null,path[_0x2852('0x29')](config[_0x2852('0x2a')],_0x2852('0x30')));},'filename':function(_0x2798bb,_0x42d1ae,_0x8517c9){_0x8517c9(null,util[_0x2852('0x2c')](_0x2852('0x2d'),Date[_0x2852('0x2e')](),_0x42d1ae[_0x2852('0x2f')]));}})});router['post'](_0x2852('0x35'),upload[_0x2852('0x31')](_0x2852('0x32')),controller[_0x2852('0x36')]);router[_0x2852('0x24')](_0x2852('0x37'),controller[_0x2852('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x2852('0x28')]({'destination':function(_0x483d94,_0x36a514,_0x10464a){const _0x23a34e=path['join'](config['root'],_0x2852('0x39'),_0x2852('0x3a'),_0x2852('0x3b'));fs_extra[_0x2852('0x3c')](_0x23a34e,function(){_0x10464a(null,_0x23a34e);});},'filename':function(_0x39a53e,_0x148edc,_0x1fa5f9){const _0xadbeb6=_0x148edc[_0x2852('0x2f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x13fb65=path[_0x2852('0x3d')](_0xadbeb6);const _0xcc5ad5=Date[_0x2852('0x2e')]()+'-'+_0xadbeb6[_0x2852('0x3e')](_0x13fb65,'')+_0x13fb65;_0x1fa5f9(null,_0xcc5ad5);}})});router[_0x2852('0x24')](_0x2852('0x3f'),offlineUploadMulter[_0x2852('0x40')](),controller[_0x2852('0x41')]);router[_0x2852('0x24')](_0x2852('0x42'),auth[_0x2852('0x8')](),controller[_0x2852('0x43')]);router[_0x2852('0x24')](_0x2852('0x1c'),auth[_0x2852('0x8')](),controller[_0x2852('0x44')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x2852('0x45')]);router[_0x2852('0x24')](_0x2852('0x23'),auth['isAuthenticated'](),controller[_0x2852('0x46')]);router[_0x2852('0x47')](_0x2852('0xd'),auth[_0x2852('0x8')](),controller['update']);router[_0x2852('0x48')](_0x2852('0xd'),auth[_0x2852('0x8')](),controller['destroy']);router[_0x2852('0x48')](_0x2852('0xf'),auth[_0x2852('0x8')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x2852('0x8')](),controller[_0x2852('0x49')]);router['delete'](_0x2852('0x23'),auth[_0x2852('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x00cb=['root','/:id/notify','attachments','offline-chat','replace','extname','any','addInteraction','addProactiveActions','/:id/users','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar'];(function(_0x38cec7,_0x2358b2){var _0x3e89d7=function(_0x190c21){while(--_0x190c21){_0x38cec7['push'](_0x38cec7['shift']());}};_0x3e89d7(++_0x2358b2);}(_0x00cb,0x1c8));var _0xb00c=function(_0x2b778d,_0x5dd9e4){_0x2b778d=_0x2b778d-0x0;var _0x46a581=_0x00cb[_0x2b778d];return _0x46a581;};'use strict';var multer=require(_0xb00c('0x0'));var util=require(_0xb00c('0x1'));var path=require(_0xb00c('0x2'));var timeout=require(_0xb00c('0x3'));var express=require(_0xb00c('0x4'));var router=express[_0xb00c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb00c('0x6'));var interaction=require(_0xb00c('0x7'));var config=require(_0xb00c('0x8'));var controller=require(_0xb00c('0x9'));router[_0xb00c('0xa')]('/',auth[_0xb00c('0xb')](),controller[_0xb00c('0xc')]);router[_0xb00c('0xa')](_0xb00c('0xd'),auth[_0xb00c('0xb')](),controller[_0xb00c('0xe')]);router[_0xb00c('0xa')](_0xb00c('0xf'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x10')]);router[_0xb00c('0xa')](_0xb00c('0x11'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x12')]);router[_0xb00c('0xa')](_0xb00c('0x13'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xb00c('0xa')](_0xb00c('0x14'),controller[_0xb00c('0x15')]);router[_0xb00c('0xa')](_0xb00c('0x16'),controller[_0xb00c('0x17')]);router[_0xb00c('0xa')](_0xb00c('0x18'),controller['getCustomerAvatar']);router[_0xb00c('0xa')](_0xb00c('0x19'),controller['getSystemAvatar']);router[_0xb00c('0xa')](_0xb00c('0x1a'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x1b')]);router['get'](_0xb00c('0x1c'),controller[_0xb00c('0x1d')]);router['get'](_0xb00c('0x1e'),auth['isAuthenticated'](),controller[_0xb00c('0x1f')]);router['get'](_0xb00c('0x20'),auth[_0xb00c('0xb')](),controller['getProactiveActions']);router['get'](_0xb00c('0x21'),controller[_0xb00c('0x22')]);router['get'](_0xb00c('0x23'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x24')]);router['get']('/:id/users',auth[_0xb00c('0xb')](),controller[_0xb00c('0x25')]);router[_0xb00c('0x26')]('/',auth[_0xb00c('0xb')](),controller[_0xb00c('0x27')]);router[_0xb00c('0x26')]('/:id/dispositions',auth[_0xb00c('0xb')](),controller[_0xb00c('0x28')]);router[_0xb00c('0x26')]('/:id/canned_answers',auth[_0xb00c('0xb')](),controller[_0xb00c('0x29')]);var upload=multer({'storage':multer[_0xb00c('0x2a')]({'destination':function(_0x27352c,_0x5a0186,_0x411d36){_0x411d36(null,path[_0xb00c('0x2b')](config['root'],_0xb00c('0x2c')));},'filename':function(_0x157d6a,_0x1fd27d,_0xcf66d4){_0xcf66d4(null,util[_0xb00c('0x2d')](_0xb00c('0x2e'),Date[_0xb00c('0x2f')](),_0x1fd27d[_0xb00c('0x30')]));}})});router[_0xb00c('0x26')](_0xb00c('0x14'),upload[_0xb00c('0x31')]('file'),controller[_0xb00c('0x32')]);var upload=multer({'storage':multer[_0xb00c('0x2a')]({'destination':function(_0x5e2cf0,_0x942144,_0x1a54a1){_0x1a54a1(null,path[_0xb00c('0x2b')](config['root'],_0xb00c('0x33')));},'filename':function(_0x12ef34,_0x3dfbb6,_0x36ed15){_0x36ed15(null,util[_0xb00c('0x2d')](_0xb00c('0x2e'),Date[_0xb00c('0x2f')](),_0x3dfbb6[_0xb00c('0x30')]));}})});router[_0xb00c('0x26')](_0xb00c('0x16'),upload[_0xb00c('0x31')](_0xb00c('0x34')),controller[_0xb00c('0x35')]);var upload=multer({'storage':multer[_0xb00c('0x2a')]({'destination':function(_0x4d72c2,_0x32cdfe,_0x1feb6e){_0x1feb6e(null,path['join'](config['root'],_0xb00c('0x33')));},'filename':function(_0x7db18,_0x27a557,_0xbf58f){_0xbf58f(null,util[_0xb00c('0x2d')](_0xb00c('0x2e'),Date[_0xb00c('0x2f')](),_0x27a557[_0xb00c('0x30')]));}})});router[_0xb00c('0x26')](_0xb00c('0x18'),upload[_0xb00c('0x31')](_0xb00c('0x34')),controller[_0xb00c('0x36')]);var upload=multer({'storage':multer[_0xb00c('0x2a')]({'destination':function(_0xb14b16,_0x38abee,_0x57b967){_0x57b967(null,path[_0xb00c('0x2b')](config[_0xb00c('0x37')],_0xb00c('0x33')));},'filename':function(_0x4f31a8,_0x274dc1,_0xfc5ff0){_0xfc5ff0(null,util[_0xb00c('0x2d')](_0xb00c('0x2e'),Date['now'](),_0x274dc1[_0xb00c('0x30')]));}})});router['post'](_0xb00c('0x19'),upload[_0xb00c('0x31')](_0xb00c('0x34')),controller['addSystemAvatar']);router[_0xb00c('0x26')](_0xb00c('0x38'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xb00c('0x2a')]({'destination':function(_0x583b0a,_0x5af161,_0x13f7ad){const _0xbf4843=path[_0xb00c('0x2b')](config[_0xb00c('0x37')],'server/files',_0xb00c('0x39'),_0xb00c('0x3a'));fs_extra['ensureDir'](_0xbf4843,function(){_0x13f7ad(null,_0xbf4843);});},'filename':function(_0x5c4f46,_0x4e84fd,_0x555ea2){const _0x11e236=_0x4e84fd[_0xb00c('0x30')][_0xb00c('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4ec0b0=path[_0xb00c('0x3c')](_0x11e236);const _0x2dc9a1=Date[_0xb00c('0x2f')]()+'-'+_0x11e236[_0xb00c('0x3b')](_0x4ec0b0,'')+_0x4ec0b0;_0x555ea2(null,_0x2dc9a1);}})});router[_0xb00c('0x26')]('/:id/offline',offlineUploadMulter[_0xb00c('0x3d')](),controller['offline']);router[_0xb00c('0x26')](_0xb00c('0x1a'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x3e')]);router['post'](_0xb00c('0x1e'),auth[_0xb00c('0xb')](),controller['addApplications']);router[_0xb00c('0x26')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb00c('0x3f')]);router['post'](_0xb00c('0x40'),auth[_0xb00c('0xb')](),controller['addAgents']);router[_0xb00c('0x41')](_0xb00c('0xf'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x42')]);router['delete']('/:id',auth[_0xb00c('0xb')](),controller[_0xb00c('0x43')]);router[_0xb00c('0x44')](_0xb00c('0x11'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x45')]);router[_0xb00c('0x44')](_0xb00c('0x13'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x46')]);router['delete'](_0xb00c('0x40'),auth[_0xb00c('0xb')](),controller[_0xb00c('0x47')]);module[_0xb00c('0x48')]=router;
\ No newline at end of file
index 51e9620..809e443 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd663=['STRING','sequelize','exports','ENUM','AmazonAWS','Google'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0xd663,0x1ed));var _0x3d66=function(_0xc0bcb8,_0x138499){_0xc0bcb8=_0xc0bcb8-0x0;var _0x1c683b=_0xd663[_0xc0bcb8];return _0x1c683b;};'use strict';var Sequelize=require(_0x3d66('0x0'));module[_0x3d66('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3d66('0x2')](_0x3d66('0x3'),_0x3d66('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3d66('0x5')]},'data2':{'type':Sequelize[_0x3d66('0x5')]}};
\ No newline at end of file
+var _0x0170=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x49d3c4,_0x4335ff){var _0x2017b8=function(_0x316c23){while(--_0x316c23){_0x49d3c4['push'](_0x49d3c4['shift']());}};_0x2017b8(++_0x4335ff);}(_0x0170,0x1d6));var _0x0017=function(_0x18ba5e,_0x32f21f){_0x18ba5e=_0x18ba5e-0x0;var _0x4ca151=_0x0170[_0x18ba5e];return _0x4ca151;};'use strict';var Sequelize=require(_0x0017('0x0'));module[_0x0017('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0017('0x2')](_0x0017('0x3'),_0x0017('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0017('0x5')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8457664..9679926 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x178e38,_0x20804c){var _0x1ec35a=function(_0xd94f77){while(--_0xd94f77){_0x178e38['push'](_0x178e38['shift']());}};_0x1ec35a(++_0x20804c);}(_0x7a54,0x106));var _0x47a5=function(_0x234f5e,_0x2709a5){_0x234f5e=_0x234f5e-0x0;var _0x5f57fb=_0x7a54[_0x234f5e];return _0x5f57fb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xadb5,0xad));var _0x5adb=function(_0x2679df,_0x300df1){_0x2679df=_0x2679df-0x0;var _0x4a9e91=_0xadb5[_0x2679df];return _0x4a9e91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
index abd8beb..64be05f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f7=['../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers','util'];(function(_0x247eb0,_0xc29d3a){var _0x3e070b=function(_0x3a0d79){while(--_0x3a0d79){_0x247eb0['push'](_0x247eb0['shift']());}};_0x3e070b(++_0xc29d3a);}(_0x27f7,0x16a));var _0x727f=function(_0x11c844,_0x2fa184){_0x11c844=_0x11c844-0x0;var _0x2068e9=_0x27f7[_0x11c844];return _0x2068e9;};'use strict';var _=require('lodash');var util=require(_0x727f('0x0'));var logger=require(_0x727f('0x1'))(_0x727f('0x2'));var moment=require('moment');var BPromise=require(_0x727f('0x3'));var rp=require(_0x727f('0x4'));var fs=require('fs');var path=require(_0x727f('0x5'));var rimraf=require(_0x727f('0x6'));var config=require('../../config/environment');var attributes=require(_0x727f('0x7'));module['exports']=function(_0x3ccac7,_0x592477){return _0x3ccac7[_0x727f('0x8')](_0x727f('0x9'),attributes,{'tableName':_0x727f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x841b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider'];(function(_0x2b8980,_0x38a2e7){var _0x3a3562=function(_0x3d962b){while(--_0x3d962b){_0x2b8980['push'](_0x2b8980['shift']());}};_0x3a3562(++_0x38a2e7);}(_0x841b,0x186));var _0xb841=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x841b[_0x1857d0];return _0x3e3c46;};'use strict';var _=require(_0xb841('0x0'));var util=require(_0xb841('0x1'));var logger=require(_0xb841('0x2'))(_0xb841('0x3'));var moment=require(_0xb841('0x4'));var BPromise=require(_0xb841('0x5'));var rp=require(_0xb841('0x6'));var fs=require('fs');var path=require(_0xb841('0x7'));var rimraf=require(_0xb841('0x8'));var config=require(_0xb841('0x9'));var attributes=require('./cloudProvider.attributes');module[_0xb841('0xa')]=function(_0x134ab6,_0x455610){return _0x134ab6[_0xb841('0xb')](_0xb841('0xc'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe568ca..9404735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27fb=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x1e55e5,_0x59048d){var _0x2f0295=function(_0x2b4813){while(--_0x2b4813){_0x1e55e5['push'](_0x1e55e5['shift']());}};_0x2f0295(++_0x59048d);}(_0x27fb,0x1de));var _0xb27f=function(_0x1447a3,_0x4d37da){_0x1447a3=_0x1447a3-0x0;var _0x1450b3=_0x27fb[_0x1447a3];return _0x1450b3;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var moment=require(_0xb27f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb27f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb27f('0x4'))['db'];var utils=require(_0xb27f('0x5'));var logger=require(_0xb27f('0x6'))('rpc');var config=require(_0xb27f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb27f('0x8')][_0xb27f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cc341,_0x1b7bd9,_0x608e92){return new BPromise(function(_0x4da129,_0xb18d3b){return client[_0xb27f('0xa')](_0x3cc341,_0x608e92)['then'](function(_0x338393){logger[_0xb27f('0xb')](_0xb27f('0xc'),_0x1b7bd9,_0xb27f('0xd'));logger['debug'](_0xb27f('0xe'),_0x1b7bd9,_0xb27f('0xd'),JSON['stringify'](_0x338393));if(_0x338393[_0xb27f('0xf')]){if(_0x338393[_0xb27f('0xf')]['code']===0x1f4){logger[_0xb27f('0xf')](_0xb27f('0xc'),_0x1b7bd9,_0x338393[_0xb27f('0xf')][_0xb27f('0x10')]);return _0xb18d3b(_0x338393[_0xb27f('0xf')][_0xb27f('0x10')]);}logger['error'](_0xb27f('0xc'),_0x1b7bd9,_0x338393['error'][_0xb27f('0x10')]);return _0x4da129(_0x338393['error'][_0xb27f('0x10')]);}else{logger[_0xb27f('0xb')](_0xb27f('0xc'),_0x1b7bd9,_0xb27f('0xd'));_0x4da129(_0x338393[_0xb27f('0x11')]['message']);}})[_0xb27f('0x12')](function(_0x2b8ff5){logger[_0xb27f('0xf')](_0xb27f('0xc'),_0x1b7bd9,_0x2b8ff5);_0xb18d3b(_0x2b8ff5);});});}
\ No newline at end of file
+var _0xb96d=['then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x393e25,_0x391f6c){var _0x58cdcb=function(_0x18e918){while(--_0x18e918){_0x393e25['push'](_0x393e25['shift']());}};_0x58cdcb(++_0x391f6c);}(_0xb96d,0x9e));var _0xdb96=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xb96d[_0xb833b1];return _0x1ab87a;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});}
\ No newline at end of file
index 6f53fa7..d0fa8c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60e7=['../../config/environment','./cloudProvider.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x60e7,0xef));var _0x760e=function(_0x3233cb,_0x45ce67){_0x3233cb=_0x3233cb-0x0;var _0xd6adbe=_0x60e7[_0x3233cb];return _0xd6adbe;};'use strict';var multer=require('multer');var util=require(_0x760e('0x0'));var path=require(_0x760e('0x1'));var timeout=require(_0x760e('0x2'));var express=require(_0x760e('0x3'));var router=express[_0x760e('0x4')]();var fs_extra=require(_0x760e('0x5'));var auth=require(_0x760e('0x6'));var interaction=require(_0x760e('0x7'));var config=require(_0x760e('0x8'));var controller=require(_0x760e('0x9'));router['get']('/',auth[_0x760e('0xa')](),controller[_0x760e('0xb')]);router['get'](_0x760e('0xc'),auth[_0x760e('0xa')](),controller[_0x760e('0xd')]);router[_0x760e('0xe')]('/',auth[_0x760e('0xa')](),controller[_0x760e('0xf')]);router['put'](_0x760e('0xc'),auth['isAuthenticated'](),controller[_0x760e('0x10')]);router[_0x760e('0x11')](_0x760e('0xc'),auth['isAuthenticated'](),controller[_0x760e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x91ed=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0xf7a44c,_0x5bdb78){var _0x568bbd=function(_0xffdd02){while(--_0xffdd02){_0xf7a44c['push'](_0xf7a44c['shift']());}};_0x568bbd(++_0x5bdb78);}(_0x91ed,0x99));var _0xd91e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x91ed[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd91e('0x0'));var timeout=require(_0xd91e('0x1'));var express=require('express');var router=express[_0xd91e('0x2')]();var fs_extra=require(_0xd91e('0x3'));var auth=require(_0xd91e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd91e('0x5'));var controller=require('./cloudProvider.controller');router[_0xd91e('0x6')]('/',auth[_0xd91e('0x7')](),controller[_0xd91e('0x8')]);router['get'](_0xd91e('0x9'),auth[_0xd91e('0x7')](),controller[_0xd91e('0xa')]);router[_0xd91e('0xb')]('/',auth[_0xd91e('0x7')](),controller[_0xd91e('0xc')]);router['put'](_0xd91e('0x9'),auth[_0xd91e('0x7')](),controller[_0xd91e('0xd')]);router[_0xd91e('0xe')]('/:id',auth[_0xd91e('0x7')](),controller[_0xd91e('0xf')]);module[_0xd91e('0x10')]=router;
\ No newline at end of file
index aaa2ab3..98abd13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b9=['sequelize','exports','STRING','name'];(function(_0x19f9b9,_0x12c08c){var _0x10de66=function(_0x2bbd5c){while(--_0x2bbd5c){_0x19f9b9['push'](_0x19f9b9['shift']());}};_0x10de66(++_0x12c08c);}(_0x62b9,0x130));var _0x962b=function(_0x13136a,_0xa90c60){_0x13136a=_0x13136a-0x0;var _0x2fe0c4=_0x62b9[_0x13136a];return _0x2fe0c4;};'use strict';var Sequelize=require(_0x962b('0x0'));module[_0x962b('0x1')]={'name':{'type':Sequelize[_0x962b('0x2')],'unique':_0x962b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x962b('0x2')]},'phone':{'type':Sequelize[_0x962b('0x2')]},'fax':{'type':Sequelize[_0x962b('0x2')]},'type':{'type':Sequelize[_0x962b('0x2')]},'street':{'type':Sequelize[_0x962b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x962b('0x2')]},'country':{'type':Sequelize[_0x962b('0x2')]},'email':{'type':Sequelize[_0x962b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x962b('0x2')]},'sStreet':{'type':Sequelize[_0x962b('0x2')]},'sPostalCode':{'type':Sequelize[_0x962b('0x2')]},'sCity':{'type':Sequelize[_0x962b('0x2')]},'sCountry':{'type':Sequelize[_0x962b('0x2')]},'description':{'type':Sequelize[_0x962b('0x2')]}};
\ No newline at end of file
+var _0xf626=['sequelize','exports','STRING','name'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xf626,0xac));var _0x6f62=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0xf626[_0x1ad901];return _0x3c0249;};'use strict';var Sequelize=require(_0x6f62('0x0'));module[_0x6f62('0x1')]={'name':{'type':Sequelize[_0x6f62('0x2')],'unique':_0x6f62('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x6f62('0x2')]},'website':{'type':Sequelize[_0x6f62('0x2')]},'phone':{'type':Sequelize[_0x6f62('0x2')]},'fax':{'type':Sequelize[_0x6f62('0x2')]},'type':{'type':Sequelize[_0x6f62('0x2')]},'street':{'type':Sequelize[_0x6f62('0x2')]},'postalCode':{'type':Sequelize[_0x6f62('0x2')]},'city':{'type':Sequelize[_0x6f62('0x2')]},'country':{'type':Sequelize[_0x6f62('0x2')]},'email':{'type':Sequelize[_0x6f62('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6f62('0x2')]},'sPostalCode':{'type':Sequelize[_0x6f62('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6f62('0x2')]}};
\ No newline at end of file
index d7f0064..68f993f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x254d=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','includeAll','findAll','rows','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','findOne','rawAttributes','getContacts','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','keys','query'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x254d,0x124));var _0xd254=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x254d[_0x30cc1a];return _0xb3f18f;};'use strict';var emlformat=require(_0xd254('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd254('0x1'));var rp=require(_0xd254('0x2'));var moment=require(_0xd254('0x3'));var BPromise=require(_0xd254('0x4'));var Mustache=require(_0xd254('0x5'));var util=require(_0xd254('0x6'));var path=require(_0xd254('0x7'));var sox=require('sox');var csv=require(_0xd254('0x8'));var ejs=require(_0xd254('0x9'));var fs=require('fs');var fs_extra=require(_0xd254('0xa'));var _=require(_0xd254('0xb'));var squel=require(_0xd254('0xc'));var crypto=require(_0xd254('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd254('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd254('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd254('0x10'));var qs=require(_0xd254('0x11'));var as=require(_0xd254('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd254('0x13'));var config=require(_0xd254('0x14'));var licenseUtil=require(_0xd254('0x15'));var db=require(_0xd254('0x16'))['db'];function respondWithStatusCode(_0x14b68e,_0x4b9eba){_0x4b9eba=_0x4b9eba||0xcc;return function(_0x4e1ee2){if(_0x4e1ee2){return _0x14b68e[_0xd254('0x17')](_0x4b9eba);}return _0x14b68e[_0xd254('0x18')](_0x4b9eba)[_0xd254('0x19')]();};}function respondWithResult(_0x4caf08,_0x393887){_0x393887=_0x393887||0xc8;return function(_0x437c75){if(_0x437c75){return _0x4caf08['status'](_0x393887)[_0xd254('0x1a')](_0x437c75);}};}function respondWithFilteredResult(_0x574ebd,_0x413a09){return function(_0x13cf74){if(_0x13cf74){var _0x2138bb=typeof _0x413a09[_0xd254('0x1b')]===_0xd254('0x1c')&&typeof _0x413a09[_0xd254('0x1d')]===_0xd254('0x1c');var _0x12f08f=_0x13cf74['count'];var _0x55d94a=_0x2138bb?0x0:_0x413a09['offset'];var _0x492fe5=_0x2138bb?_0x13cf74[_0xd254('0x1e')]:_0x413a09[_0xd254('0x1b')]+_0x413a09[_0xd254('0x1d')];var _0x34abca;if(_0x492fe5>=_0x12f08f){_0x492fe5=_0x12f08f;_0x34abca=0xc8;}else{_0x34abca=0xce;}_0x574ebd['status'](_0x34abca);return _0x574ebd[_0xd254('0x1f')](_0xd254('0x20'),_0x55d94a+'-'+_0x492fe5+'/'+_0x12f08f)[_0xd254('0x1a')](_0x13cf74);}return null;};}function patchUpdates(_0x374241){return function(_0x356980){try{jsonpatch[_0xd254('0x21')](_0x356980,_0x374241,!![]);}catch(_0x1464ad){return BPromise[_0xd254('0x22')](_0x1464ad);}return _0x356980['save']();};}function saveUpdates(_0x3b9628,_0x3343e0){return function(_0x4453d3){if(_0x4453d3){return _0x4453d3['update'](_0x3b9628)[_0xd254('0x23')](function(_0x1d9c9c){return _0x1d9c9c;});}return null;};}function removeEntity(_0x5317e7,_0x433e2c){return function(_0x4c526a){if(_0x4c526a){return _0x4c526a[_0xd254('0x24')]()[_0xd254('0x23')](function(){var _0x3a4a18=_0x4c526a['get']({'plain':!![]});var _0x34b01b=_0xd254('0x25');return db[_0xd254('0x26')]['destroy']({'where':{'type':_0x34b01b,'resourceId':_0x3a4a18['id']}})[_0xd254('0x23')](function(){return _0x4c526a;});})[_0xd254('0x23')](function(){_0x5317e7[_0xd254('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe1896a,_0x3ae504){return function(_0x3d1d40){if(!_0x3d1d40){_0xe1896a[_0xd254('0x17')](0x194);}return _0x3d1d40;};}function handleError(_0x23d306,_0x41a277){_0x41a277=_0x41a277||0x1f4;return function(_0x1b64b6){logger[_0xd254('0x27')](_0x1b64b6['stack']);if(_0x1b64b6[_0xd254('0x28')]){delete _0x1b64b6[_0xd254('0x28')];}_0x23d306[_0xd254('0x18')](_0x41a277)[_0xd254('0x29')](_0x1b64b6);};}exports[_0xd254('0x2a')]=function(_0x23d263,_0x10676a){var _0x2c43fd={},_0x3a7333={},_0x1aeb20={'count':0x0,'rows':[]};return db[_0xd254('0x2b')][_0xd254('0x2c')]()[_0xd254('0x23')](function(_0x4a6d37){_0x3a7333[_0xd254('0x2d')]=_[_0xd254('0x2e')](_0x4a6d37);_0x3a7333[_0xd254('0x2f')]=_[_0xd254('0x2e')](_0x23d263[_0xd254('0x2f')]);_0x3a7333[_0xd254('0x30')]=_[_0xd254('0x31')](_0x3a7333[_0xd254('0x2d')],_0x3a7333['query']);_0x2c43fd[_0xd254('0x32')]=_[_0xd254('0x31')](_0x3a7333[_0xd254('0x2d')],qs[_0xd254('0x33')](_0x23d263['query'][_0xd254('0x33')]));_0x2c43fd['attributes']=_0x2c43fd[_0xd254('0x32')][_0xd254('0x34')]?_0x2c43fd[_0xd254('0x32')]:_0x3a7333[_0xd254('0x2d')];if(!_0x23d263['query'][_0xd254('0x35')]('nolimit')){_0x2c43fd[_0xd254('0x1d')]=qs['limit'](_0x23d263[_0xd254('0x2f')][_0xd254('0x1d')]);_0x2c43fd['offset']=qs[_0xd254('0x1b')](_0x23d263[_0xd254('0x2f')][_0xd254('0x1b')]);}_0x2c43fd[_0xd254('0x36')]=qs['sort'](_0x23d263[_0xd254('0x2f')][_0xd254('0x37')]);_0x2c43fd['where']=qs['filters'](_[_0xd254('0x38')](_0x23d263[_0xd254('0x2f')],_0x3a7333[_0xd254('0x30')]),_0x4a6d37);if(_0x23d263[_0xd254('0x2f')][_0xd254('0x39')]){_0x2c43fd[_0xd254('0x3a')]=_[_0xd254('0x3b')](_0x2c43fd[_0xd254('0x3a')],{'$or':_[_0xd254('0x3c')](_0x2c43fd[_0xd254('0x32')],function(_0x1f8f6c){var _0xbc20c8={};_0xbc20c8[_0x1f8f6c]={'$like':'%'+_0x23d263[_0xd254('0x2f')][_0xd254('0x39')]+'%'};return _0xbc20c8;})});}_0x2c43fd=_[_0xd254('0x3b')]({},_0x2c43fd,_0x23d263[_0xd254('0x3d')]);var _0x548cc6={'where':_0x2c43fd[_0xd254('0x3a')]};return db[_0xd254('0x2b')][_0xd254('0x1e')](_0x548cc6)[_0xd254('0x23')](function(_0x54a5fd){_0x1aeb20['count']=_0x54a5fd;if(_0x23d263[_0xd254('0x2f')][_0xd254('0x3e')]){_0x2c43fd['include']=[{'all':!![]}];}return db['CmCompany'][_0xd254('0x3f')](_0x2c43fd);})[_0xd254('0x23')](function(_0x6b0eea){_0x1aeb20[_0xd254('0x40')]=_0x6b0eea;return _0x1aeb20;})[_0xd254('0x23')](respondWithFilteredResult(_0x10676a,_0x2c43fd))[_0xd254('0x41')](handleError(_0x10676a,null));})[_0xd254('0x41')](handleError(_0x10676a,null));};exports[_0xd254('0x42')]=function(_0x5d556c,_0x14c740){var _0x3aa2a6={'raw':![],'where':{'id':_0x5d556c[_0xd254('0x43')]['id']}},_0x192ef7={};_0x192ef7['model']=_[_0xd254('0x2e')](db[_0xd254('0x2b')]['rawAttributes']);_0x192ef7[_0xd254('0x2f')]=_['keys'](_0x5d556c[_0xd254('0x2f')]);_0x192ef7['filters']=_[_0xd254('0x31')](_0x192ef7['model'],_0x192ef7[_0xd254('0x2f')]);_0x3aa2a6[_0xd254('0x32')]=_[_0xd254('0x31')](_0x192ef7[_0xd254('0x2d')],qs[_0xd254('0x33')](_0x5d556c['query'][_0xd254('0x33')]));_0x3aa2a6[_0xd254('0x32')]=_0x3aa2a6[_0xd254('0x32')][_0xd254('0x34')]?_0x3aa2a6[_0xd254('0x32')]:_0x192ef7[_0xd254('0x2d')];if(_0x5d556c[_0xd254('0x2f')][_0xd254('0x3e')]){_0x3aa2a6[_0xd254('0x44')]=[{'all':!![]}];}_0x3aa2a6=_[_0xd254('0x3b')]({},_0x3aa2a6,_0x5d556c[_0xd254('0x3d')]);return db['CmCompany'][_0xd254('0x45')](_0x3aa2a6)[_0xd254('0x23')](handleEntityNotFound(_0x14c740,null))[_0xd254('0x23')](respondWithResult(_0x14c740,null))[_0xd254('0x41')](handleError(_0x14c740,null));};exports['create']=function(_0x39b832,_0x3187b8){return db[_0xd254('0x2b')]['create'](_0x39b832[_0xd254('0x46')],{})[_0xd254('0x23')](function(_0x1e37c7){var _0x470aa6=_0x39b832[_0xd254('0x47')][_0xd254('0x48')]({'plain':!![]});if(!_0x470aa6)throw new Error(_0xd254('0x49'));if(_0x470aa6['role']===_0xd254('0x47')){var _0x4c7e4e=_0x1e37c7[_0xd254('0x48')]({'plain':!![]});var _0x5cc04f='Companies';return db[_0xd254('0x4a')]['find']({'where':{'name':_0x5cc04f,'userProfileId':_0x470aa6[_0xd254('0x4b')]},'raw':!![]})[_0xd254('0x23')](function(_0x5056b4){if(_0x5056b4&&_0x5056b4[_0xd254('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c7e4e[_0xd254('0x28')],'resourceId':_0x4c7e4e['id'],'type':_0x5056b4[_0xd254('0x28')],'sectionId':_0x5056b4['id']},{})[_0xd254('0x23')](function(){return _0x1e37c7;});}else{return _0x1e37c7;}})['catch'](function(_0x4ffb96){logger[_0xd254('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ffb96);throw _0x4ffb96;});}return _0x1e37c7;})[_0xd254('0x23')](respondWithResult(_0x3187b8,0xc9))[_0xd254('0x41')](handleError(_0x3187b8,null));};exports['update']=function(_0x1e3a3d,_0x273f91){if(_0x1e3a3d[_0xd254('0x46')]['id']){delete _0x1e3a3d['body']['id'];}return db[_0xd254('0x2b')]['find']({'where':{'id':_0x1e3a3d['params']['id']}})['then'](handleEntityNotFound(_0x273f91,null))[_0xd254('0x23')](saveUpdates(_0x1e3a3d[_0xd254('0x46')],null))[_0xd254('0x23')](respondWithResult(_0x273f91,null))[_0xd254('0x41')](handleError(_0x273f91,null));};exports[_0xd254('0x24')]=function(_0x29071b,_0x31b524){return db['CmCompany'][_0xd254('0x45')]({'where':{'id':_0x29071b['params']['id']}})[_0xd254('0x23')](handleEntityNotFound(_0x31b524,null))[_0xd254('0x23')](removeEntity(_0x31b524,null))['catch'](handleError(_0x31b524,null));};exports[_0xd254('0x2c')]=function(_0x108c3b,_0x5ee72d){return db[_0xd254('0x2b')][_0xd254('0x2c')]()[_0xd254('0x23')](respondWithResult(_0x5ee72d,null))[_0xd254('0x41')](handleError(_0x5ee72d,null));};exports[_0xd254('0x4d')]=function(_0x108191,_0x2ce7b6,_0x19eff8){return db[_0xd254('0x4e')][_0xd254('0x45')]({'where':{'id':_0x108191[_0xd254('0x43')]['id']}})[_0xd254('0x23')](handleEntityNotFound(_0x2ce7b6,null))[_0xd254('0x23')](function(_0x45a5ac){if(_0x45a5ac){return _0x45a5ac[_0xd254('0x4d')](_0x108191[_0xd254('0x46')][_0xd254('0x4f')],_[_0xd254('0x50')](_0x108191[_0xd254('0x46')],['ids','id'])||{});}})[_0xd254('0x23')](respondWithResult(_0x2ce7b6,null))[_0xd254('0x41')](handleError(_0x2ce7b6,null));};exports['getContacts']=function(_0x94692f,_0x2d0623,_0x483e39){var _0x55067c={};var _0x1cd6f7={};var _0x51c639;var _0x321756;return db['CmCompany'][_0xd254('0x51')]({'where':{'id':_0x94692f[_0xd254('0x43')]['id']}})[_0xd254('0x23')](handleEntityNotFound(_0x2d0623,null))[_0xd254('0x23')](function(_0x5c26e1){if(_0x5c26e1){_0x51c639=_0x5c26e1;_0x1cd6f7['model']=_[_0xd254('0x2e')](db['CmContact'][_0xd254('0x52')]);_0x1cd6f7[_0xd254('0x2f')]=_[_0xd254('0x2e')](_0x94692f[_0xd254('0x2f')]);_0x1cd6f7[_0xd254('0x30')]=_[_0xd254('0x31')](_0x1cd6f7[_0xd254('0x2d')],_0x1cd6f7[_0xd254('0x2f')]);_0x55067c['attributes']=_[_0xd254('0x31')](_0x1cd6f7['model'],qs[_0xd254('0x33')](_0x94692f[_0xd254('0x2f')]['fields']));_0x55067c[_0xd254('0x32')]=_0x55067c[_0xd254('0x32')][_0xd254('0x34')]?_0x55067c['attributes']:_0x1cd6f7['model'];_0x55067c[_0xd254('0x36')]=qs[_0xd254('0x37')](_0x94692f[_0xd254('0x2f')][_0xd254('0x37')]);_0x55067c[_0xd254('0x3a')]=qs['filters'](_[_0xd254('0x38')](_0x94692f[_0xd254('0x2f')],_0x1cd6f7[_0xd254('0x30')]));if(_0x94692f[_0xd254('0x2f')][_0xd254('0x39')]){_0x55067c['where']=_['merge'](_0x55067c[_0xd254('0x3a')],{'$or':_['map'](_0x55067c[_0xd254('0x32')],function(_0x350ba4){var _0x18f55a={};_0x18f55a[_0x350ba4]={'$like':'%'+_0x94692f['query'][_0xd254('0x39')]+'%'};return _0x18f55a;})});}_0x55067c=_[_0xd254('0x3b')]({},_0x55067c,_0x94692f[_0xd254('0x3d')]);return _0x51c639[_0xd254('0x53')](_0x55067c);}})[_0xd254('0x23')](function(_0x62c02a){if(_0x62c02a){_0x321756=_0x62c02a['length'];if(!_0x94692f[_0xd254('0x2f')][_0xd254('0x35')](_0xd254('0x54'))){_0x55067c['limit']=qs[_0xd254('0x1d')](_0x94692f[_0xd254('0x2f')][_0xd254('0x1d')]);_0x55067c[_0xd254('0x1b')]=qs[_0xd254('0x1b')](_0x94692f[_0xd254('0x2f')]['offset']);}return _0x51c639[_0xd254('0x53')](_0x55067c);}})[_0xd254('0x23')](function(_0x2ce970){if(_0x2ce970){return _0x2ce970?{'count':_0x321756,'rows':_0x2ce970}:null;}})['then'](respondWithResult(_0x2d0623,null))[_0xd254('0x41')](handleError(_0x2d0623,null));};
\ No newline at end of file
+var _0x20c9=['Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','where','pick','filter','merge','map','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','ids','omit','getContacts','findOne','CmContact','length','sort','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','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','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x20c9,0x197));var _0x920c=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x20c9[_0x622035];return _0x326cf2;};'use strict';var emlformat=require(_0x920c('0x0'));var rimraf=require(_0x920c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x920c('0x2'));var rp=require('request-promise');var moment=require(_0x920c('0x3'));var BPromise=require(_0x920c('0x4'));var Mustache=require(_0x920c('0x5'));var util=require(_0x920c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x920c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x920c('0x8'));var _=require('lodash');var squel=require(_0x920c('0x9'));var crypto=require(_0x920c('0xa'));var jsforce=require(_0x920c('0xb'));var deskjs=require(_0x920c('0xc'));var toCsv=require(_0x920c('0x7'));var querystring=require(_0x920c('0xd'));var Papa=require(_0x920c('0xe'));var Redis=require(_0x920c('0xf'));var authService=require(_0x920c('0x10'));var qs=require(_0x920c('0x11'));var as=require(_0x920c('0x12'));var hardwareService=require(_0x920c('0x13'));var logger=require(_0x920c('0x14'))(_0x920c('0x15'));var utils=require(_0x920c('0x16'));var config=require(_0x920c('0x17'));var licenseUtil=require(_0x920c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59b641,_0x1e855a){_0x1e855a=_0x1e855a||0xcc;return function(_0x26c71c){if(_0x26c71c){return _0x59b641['sendStatus'](_0x1e855a);}return _0x59b641[_0x920c('0x19')](_0x1e855a)['end']();};}function respondWithResult(_0x2c8fa7,_0x33ef3d){_0x33ef3d=_0x33ef3d||0xc8;return function(_0x1113d8){if(_0x1113d8){return _0x2c8fa7['status'](_0x33ef3d)[_0x920c('0x1a')](_0x1113d8);}};}function respondWithFilteredResult(_0x38205c,_0x52fdeb){return function(_0x54e9a4){if(_0x54e9a4){var _0x4cc23b=typeof _0x52fdeb[_0x920c('0x1b')]==='undefined'&&typeof _0x52fdeb[_0x920c('0x1c')]===_0x920c('0x1d');var _0x4578dc=_0x54e9a4[_0x920c('0x1e')];var _0x54a723=_0x4cc23b?0x0:_0x52fdeb[_0x920c('0x1b')];var _0x1a5e7b=_0x4cc23b?_0x54e9a4['count']:_0x52fdeb['offset']+_0x52fdeb[_0x920c('0x1c')];var _0x20450c;if(_0x1a5e7b>=_0x4578dc){_0x1a5e7b=_0x4578dc;_0x20450c=0xc8;}else{_0x20450c=0xce;}_0x38205c['status'](_0x20450c);return _0x38205c[_0x920c('0x1f')](_0x920c('0x20'),_0x54a723+'-'+_0x1a5e7b+'/'+_0x4578dc)['json'](_0x54e9a4);}return null;};}function patchUpdates(_0x1ee5cc){return function(_0x5cac39){try{jsonpatch[_0x920c('0x21')](_0x5cac39,_0x1ee5cc,!![]);}catch(_0x885ef9){return BPromise['reject'](_0x885ef9);}return _0x5cac39[_0x920c('0x22')]();};}function saveUpdates(_0x125d5b,_0x28b924){return function(_0x25ad73){if(_0x25ad73){return _0x25ad73[_0x920c('0x23')](_0x125d5b)['then'](function(_0x4df679){return _0x4df679;});}return null;};}function removeEntity(_0x46615b,_0x6380f9){return function(_0x30ea2a){if(_0x30ea2a){return _0x30ea2a[_0x920c('0x24')]()[_0x920c('0x25')](function(){var _0x2cb597=_0x30ea2a['get']({'plain':!![]});var _0x3335a0=_0x920c('0x26');return db[_0x920c('0x27')][_0x920c('0x24')]({'where':{'type':_0x3335a0,'resourceId':_0x2cb597['id']}})[_0x920c('0x25')](function(){return _0x30ea2a;});})['then'](function(){_0x46615b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbafe,_0x2fdd0f){return function(_0x276a09){if(!_0x276a09){_0x2cbafe[_0x920c('0x28')](0x194);}return _0x276a09;};}function handleError(_0x1d4911,_0x15ef6a){_0x15ef6a=_0x15ef6a||0x1f4;return function(_0x58cef7){logger[_0x920c('0x29')](_0x58cef7[_0x920c('0x2a')]);if(_0x58cef7[_0x920c('0x2b')]){delete _0x58cef7[_0x920c('0x2b')];}_0x1d4911[_0x920c('0x19')](_0x15ef6a)[_0x920c('0x2c')](_0x58cef7);};}exports[_0x920c('0x2d')]=function(_0x28c66e,_0x3f063c){var _0x320862={},_0x82ebd6={},_0x45ecac={'count':0x0,'rows':[]};return db[_0x920c('0x2e')][_0x920c('0x2f')]()[_0x920c('0x25')](function(_0x93d161){_0x82ebd6[_0x920c('0x30')]=_[_0x920c('0x31')](_0x93d161);_0x82ebd6[_0x920c('0x32')]=_[_0x920c('0x31')](_0x28c66e[_0x920c('0x32')]);_0x82ebd6[_0x920c('0x33')]=_['intersection'](_0x82ebd6['model'],_0x82ebd6[_0x920c('0x32')]);_0x320862[_0x920c('0x34')]=_[_0x920c('0x35')](_0x82ebd6['model'],qs[_0x920c('0x36')](_0x28c66e[_0x920c('0x32')][_0x920c('0x36')]));_0x320862[_0x920c('0x34')]=_0x320862[_0x920c('0x34')]['length']?_0x320862[_0x920c('0x34')]:_0x82ebd6[_0x920c('0x30')];if(!_0x28c66e[_0x920c('0x32')][_0x920c('0x37')]('nolimit')){_0x320862['limit']=qs[_0x920c('0x1c')](_0x28c66e[_0x920c('0x32')][_0x920c('0x1c')]);_0x320862[_0x920c('0x1b')]=qs[_0x920c('0x1b')](_0x28c66e['query']['offset']);}_0x320862[_0x920c('0x38')]=qs['sort'](_0x28c66e[_0x920c('0x32')]['sort']);_0x320862[_0x920c('0x39')]=qs[_0x920c('0x33')](_[_0x920c('0x3a')](_0x28c66e['query'],_0x82ebd6[_0x920c('0x33')]),_0x93d161);if(_0x28c66e[_0x920c('0x32')][_0x920c('0x3b')]){_0x320862[_0x920c('0x39')]=_[_0x920c('0x3c')](_0x320862[_0x920c('0x39')],{'$or':_[_0x920c('0x3d')](_0x320862[_0x920c('0x34')],function(_0x951ff5){var _0x113898={};_0x113898[_0x951ff5]={'$like':'%'+_0x28c66e[_0x920c('0x32')][_0x920c('0x3b')]+'%'};return _0x113898;})});}_0x320862=_['merge']({},_0x320862,_0x28c66e[_0x920c('0x3e')]);var _0x570157={'where':_0x320862['where']};return db['CmCompany'][_0x920c('0x1e')](_0x570157)[_0x920c('0x25')](function(_0x584ba0){_0x45ecac['count']=_0x584ba0;if(_0x28c66e[_0x920c('0x32')]['includeAll']){_0x320862[_0x920c('0x3f')]=[{'all':!![]}];}return db[_0x920c('0x2e')][_0x920c('0x40')](_0x320862);})['then'](function(_0x9d41a9){_0x45ecac[_0x920c('0x41')]=_0x9d41a9;return _0x45ecac;})[_0x920c('0x25')](respondWithFilteredResult(_0x3f063c,_0x320862))[_0x920c('0x42')](handleError(_0x3f063c,null));})[_0x920c('0x42')](handleError(_0x3f063c,null));};exports[_0x920c('0x43')]=function(_0x538ae2,_0x542fe0){var _0x58ce1d={'raw':![],'where':{'id':_0x538ae2['params']['id']}},_0x53dd1f={};_0x53dd1f[_0x920c('0x30')]=_[_0x920c('0x31')](db[_0x920c('0x2e')][_0x920c('0x44')]);_0x53dd1f[_0x920c('0x32')]=_['keys'](_0x538ae2[_0x920c('0x32')]);_0x53dd1f[_0x920c('0x33')]=_[_0x920c('0x35')](_0x53dd1f[_0x920c('0x30')],_0x53dd1f[_0x920c('0x32')]);_0x58ce1d[_0x920c('0x34')]=_[_0x920c('0x35')](_0x53dd1f[_0x920c('0x30')],qs[_0x920c('0x36')](_0x538ae2[_0x920c('0x32')][_0x920c('0x36')]));_0x58ce1d['attributes']=_0x58ce1d['attributes']['length']?_0x58ce1d['attributes']:_0x53dd1f[_0x920c('0x30')];if(_0x538ae2[_0x920c('0x32')][_0x920c('0x45')]){_0x58ce1d[_0x920c('0x3f')]=[{'all':!![]}];}_0x58ce1d=_['merge']({},_0x58ce1d,_0x538ae2[_0x920c('0x3e')]);return db[_0x920c('0x2e')][_0x920c('0x46')](_0x58ce1d)['then'](handleEntityNotFound(_0x542fe0,null))[_0x920c('0x25')](respondWithResult(_0x542fe0,null))[_0x920c('0x42')](handleError(_0x542fe0,null));};exports[_0x920c('0x47')]=function(_0x22aaf5,_0x187ef5){return db[_0x920c('0x2e')][_0x920c('0x47')](_0x22aaf5['body'],{})[_0x920c('0x25')](function(_0x4e3bda){var _0x446674=_0x22aaf5[_0x920c('0x48')][_0x920c('0x49')]({'plain':!![]});if(!_0x446674)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x446674[_0x920c('0x4a')]===_0x920c('0x48')){var _0x124e84=_0x4e3bda[_0x920c('0x49')]({'plain':!![]});var _0x45602e=_0x920c('0x26');return db[_0x920c('0x4b')][_0x920c('0x46')]({'where':{'name':_0x45602e,'userProfileId':_0x446674['userProfileId']},'raw':!![]})[_0x920c('0x25')](function(_0xb4c7a9){if(_0xb4c7a9&&_0xb4c7a9[_0x920c('0x4c')]===0x0){return db[_0x920c('0x27')][_0x920c('0x47')]({'name':_0x124e84[_0x920c('0x2b')],'resourceId':_0x124e84['id'],'type':_0xb4c7a9[_0x920c('0x2b')],'sectionId':_0xb4c7a9['id']},{})[_0x920c('0x25')](function(){return _0x4e3bda;});}else{return _0x4e3bda;}})[_0x920c('0x42')](function(_0x4721bc){logger[_0x920c('0x29')](_0x920c('0x4d'),_0x4721bc);throw _0x4721bc;});}return _0x4e3bda;})[_0x920c('0x25')](respondWithResult(_0x187ef5,0xc9))['catch'](handleError(_0x187ef5,null));};exports[_0x920c('0x23')]=function(_0x42aaf9,_0x6de9f1){if(_0x42aaf9[_0x920c('0x4e')]['id']){delete _0x42aaf9['body']['id'];}return db[_0x920c('0x2e')][_0x920c('0x46')]({'where':{'id':_0x42aaf9['params']['id']}})[_0x920c('0x25')](handleEntityNotFound(_0x6de9f1,null))[_0x920c('0x25')](saveUpdates(_0x42aaf9['body'],null))[_0x920c('0x25')](respondWithResult(_0x6de9f1,null))['catch'](handleError(_0x6de9f1,null));};exports[_0x920c('0x24')]=function(_0x3f7ad3,_0x598da4){return db[_0x920c('0x2e')][_0x920c('0x46')]({'where':{'id':_0x3f7ad3[_0x920c('0x4f')]['id']}})[_0x920c('0x25')](handleEntityNotFound(_0x598da4,null))[_0x920c('0x25')](removeEntity(_0x598da4,null))[_0x920c('0x42')](handleError(_0x598da4,null));};exports[_0x920c('0x2f')]=function(_0x209417,_0x4ea350){return db[_0x920c('0x2e')][_0x920c('0x2f')]()[_0x920c('0x25')](respondWithResult(_0x4ea350,null))[_0x920c('0x42')](handleError(_0x4ea350,null));};exports['addContacts']=function(_0x20ee2d,_0x5a6b45,_0x236302){return db['CmContact']['find']({'where':{'id':_0x20ee2d['params']['id']}})[_0x920c('0x25')](handleEntityNotFound(_0x5a6b45,null))[_0x920c('0x25')](function(_0x585f5a){if(_0x585f5a){return _0x585f5a[_0x920c('0x50')](_0x20ee2d[_0x920c('0x4e')][_0x920c('0x51')],_[_0x920c('0x52')](_0x20ee2d[_0x920c('0x4e')],[_0x920c('0x51'),'id'])||{});}})['then'](respondWithResult(_0x5a6b45,null))[_0x920c('0x42')](handleError(_0x5a6b45,null));};exports[_0x920c('0x53')]=function(_0x3bb5e8,_0x56751b,_0x1e6b3d){var _0x321fa5={};var _0x34f3ec={};var _0x1a929d;var _0x27fdc6;return db['CmCompany'][_0x920c('0x54')]({'where':{'id':_0x3bb5e8['params']['id']}})[_0x920c('0x25')](handleEntityNotFound(_0x56751b,null))[_0x920c('0x25')](function(_0x4501fd){if(_0x4501fd){_0x1a929d=_0x4501fd;_0x34f3ec[_0x920c('0x30')]=_[_0x920c('0x31')](db[_0x920c('0x55')][_0x920c('0x44')]);_0x34f3ec['query']=_['keys'](_0x3bb5e8['query']);_0x34f3ec['filters']=_[_0x920c('0x35')](_0x34f3ec['model'],_0x34f3ec[_0x920c('0x32')]);_0x321fa5['attributes']=_[_0x920c('0x35')](_0x34f3ec['model'],qs[_0x920c('0x36')](_0x3bb5e8[_0x920c('0x32')][_0x920c('0x36')]));_0x321fa5[_0x920c('0x34')]=_0x321fa5[_0x920c('0x34')][_0x920c('0x56')]?_0x321fa5[_0x920c('0x34')]:_0x34f3ec[_0x920c('0x30')];_0x321fa5[_0x920c('0x38')]=qs[_0x920c('0x57')](_0x3bb5e8[_0x920c('0x32')]['sort']);_0x321fa5['where']=qs[_0x920c('0x33')](_[_0x920c('0x3a')](_0x3bb5e8[_0x920c('0x32')],_0x34f3ec[_0x920c('0x33')]));if(_0x3bb5e8['query'][_0x920c('0x3b')]){_0x321fa5['where']=_['merge'](_0x321fa5['where'],{'$or':_[_0x920c('0x3d')](_0x321fa5[_0x920c('0x34')],function(_0x190dd1){var _0x48b919={};_0x48b919[_0x190dd1]={'$like':'%'+_0x3bb5e8[_0x920c('0x32')][_0x920c('0x3b')]+'%'};return _0x48b919;})});}_0x321fa5=_[_0x920c('0x3c')]({},_0x321fa5,_0x3bb5e8['options']);return _0x1a929d[_0x920c('0x53')](_0x321fa5);}})[_0x920c('0x25')](function(_0x35dec1){if(_0x35dec1){_0x27fdc6=_0x35dec1[_0x920c('0x56')];if(!_0x3bb5e8['query'][_0x920c('0x37')](_0x920c('0x58'))){_0x321fa5[_0x920c('0x1c')]=qs[_0x920c('0x1c')](_0x3bb5e8['query'][_0x920c('0x1c')]);_0x321fa5[_0x920c('0x1b')]=qs[_0x920c('0x1b')](_0x3bb5e8['query'][_0x920c('0x1b')]);}return _0x1a929d['getContacts'](_0x321fa5);}})['then'](function(_0x303305){if(_0x303305){return _0x303305?{'count':_0x27fdc6,'rows':_0x303305}:null;}})[_0x920c('0x25')](respondWithResult(_0x56751b,null))[_0x920c('0x42')](handleError(_0x56751b,null));};
\ No newline at end of file
index 6d34b03..8d958d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaef=['../../config/environment','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdaef,0xee));var _0xfdae=function(_0x24358b,_0x23394b){_0x24358b=_0x24358b-0x0;var _0x44515c=_0xdaef[_0x24358b];return _0x44515c;};'use strict';var _=require(_0xfdae('0x0'));var util=require(_0xfdae('0x1'));var logger=require(_0xfdae('0x2'))(_0xfdae('0x3'));var moment=require(_0xfdae('0x4'));var BPromise=require(_0xfdae('0x5'));var rp=require(_0xfdae('0x6'));var fs=require('fs');var path=require(_0xfdae('0x7'));var rimraf=require(_0xfdae('0x8'));var config=require(_0xfdae('0x9'));var attributes=require('./cmCompany.attributes');module[_0xfdae('0xa')]=function(_0x8800b2,_0x32c338){return _0x8800b2['define'](_0xfdae('0xb'),attributes,{'tableName':_0xfdae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb68=['moment','request-promise','path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','api'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xfb68,0x7f));var _0x8fb6=function(_0x198e50,_0x1f8708){_0x198e50=_0x198e50-0x0;var _0x478867=_0xfb68[_0x198e50];return _0x478867;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var logger=require('../../config/logger')(_0x8fb6('0x2'));var moment=require(_0x8fb6('0x3'));var BPromise=require('bluebird');var rp=require(_0x8fb6('0x4'));var fs=require('fs');var path=require(_0x8fb6('0x5'));var rimraf=require(_0x8fb6('0x6'));var config=require('../../config/environment');var attributes=require(_0x8fb6('0x7'));module[_0x8fb6('0x8')]=function(_0x475ba7,_0x2ef51e){return _0x475ba7['define']('CmCompany',attributes,{'tableName':_0x8fb6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f596811..b9fe1f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe431=['debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x56aac6,_0x5bd6f0){var _0x448cb3=function(_0x5e6435){while(--_0x5e6435){_0x56aac6['push'](_0x56aac6['shift']());}};_0x448cb3(++_0x5bd6f0);}(_0xe431,0xcb));var _0x1e43=function(_0x375d93,_0x4112e4){_0x375d93=_0x375d93-0x0;var _0x8b2e88=_0xe431[_0x375d93];return _0x8b2e88;};'use strict';var _=require(_0x1e43('0x0'));var util=require(_0x1e43('0x1'));var moment=require(_0x1e43('0x2'));var BPromise=require(_0x1e43('0x3'));var rs=require(_0x1e43('0x4'));var fs=require('fs');var Redis=require(_0x1e43('0x5'));var db=require(_0x1e43('0x6'))['db'];var utils=require(_0x1e43('0x7'));var logger=require(_0x1e43('0x8'))(_0x1e43('0x9'));var config=require(_0x1e43('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1e43('0xb')][_0x1e43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a1609,_0x2381fe,_0x2c3b01){return new BPromise(function(_0x4d7706,_0x5cdd51){return client['request'](_0x4a1609,_0x2c3b01)[_0x1e43('0xd')](function(_0xb12788){logger[_0x1e43('0xe')](_0x1e43('0xf'),_0x2381fe,_0x1e43('0x10'));logger[_0x1e43('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2381fe,'request\x20sent',JSON['stringify'](_0xb12788));if(_0xb12788['error']){if(_0xb12788[_0x1e43('0x12')][_0x1e43('0x13')]===0x1f4){logger[_0x1e43('0x12')](_0x1e43('0xf'),_0x2381fe,_0xb12788[_0x1e43('0x12')][_0x1e43('0x14')]);return _0x5cdd51(_0xb12788[_0x1e43('0x12')][_0x1e43('0x14')]);}logger[_0x1e43('0x12')](_0x1e43('0xf'),_0x2381fe,_0xb12788[_0x1e43('0x12')][_0x1e43('0x14')]);return _0x4d7706(_0xb12788['error'][_0x1e43('0x14')]);}else{logger[_0x1e43('0xe')](_0x1e43('0xf'),_0x2381fe,_0x1e43('0x10'));_0x4d7706(_0xb12788['result'][_0x1e43('0x14')]);}})[_0x1e43('0x15')](function(_0x2ed979){logger[_0x1e43('0x12')](_0x1e43('0xf'),_0x2381fe,_0x2ed979);_0x5cdd51(_0x2ed979);});});}
\ No newline at end of file
+var _0x10d7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x25eb87,_0xf92fe9){var _0x3d2a0d=function(_0x445265){while(--_0x445265){_0x25eb87['push'](_0x25eb87['shift']());}};_0x3d2a0d(++_0xf92fe9);}(_0x10d7,0x16b));var _0x710d=function(_0x596616,_0xe8890){_0x596616=_0x596616-0x0;var _0x1e96e8=_0x10d7[_0x596616];return _0x1e96e8;};'use strict';var _=require(_0x710d('0x0'));var util=require(_0x710d('0x1'));var moment=require(_0x710d('0x2'));var BPromise=require(_0x710d('0x3'));var rs=require(_0x710d('0x4'));var fs=require('fs');var Redis=require(_0x710d('0x5'));var db=require(_0x710d('0x6'))['db'];var utils=require(_0x710d('0x7'));var logger=require(_0x710d('0x8'))(_0x710d('0x9'));var config=require('../../config/environment');var jayson=require(_0x710d('0xa'));var client=jayson[_0x710d('0xb')][_0x710d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa5d24a,_0x42a2de,_0x1e0330){return new BPromise(function(_0x49259c,_0x418518){return client[_0x710d('0xd')](_0xa5d24a,_0x1e0330)[_0x710d('0xe')](function(_0x474a30){logger[_0x710d('0xf')](_0x710d('0x10'),_0x42a2de,_0x710d('0x11'));logger[_0x710d('0x12')](_0x710d('0x13'),_0x42a2de,_0x710d('0x11'),JSON[_0x710d('0x14')](_0x474a30));if(_0x474a30[_0x710d('0x15')]){if(_0x474a30['error'][_0x710d('0x16')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x42a2de,_0x474a30[_0x710d('0x15')][_0x710d('0x17')]);return _0x418518(_0x474a30[_0x710d('0x15')][_0x710d('0x17')]);}logger[_0x710d('0x15')](_0x710d('0x10'),_0x42a2de,_0x474a30[_0x710d('0x15')][_0x710d('0x17')]);return _0x49259c(_0x474a30[_0x710d('0x15')][_0x710d('0x17')]);}else{logger[_0x710d('0xf')](_0x710d('0x10'),_0x42a2de,'request\x20sent');_0x49259c(_0x474a30[_0x710d('0x18')][_0x710d('0x17')]);}})[_0x710d('0x19')](function(_0x4b87a3){logger['error']('CmCompany,\x20%s,\x20%s',_0x42a2de,_0x4b87a3);_0x418518(_0x4b87a3);});});}
\ No newline at end of file
index 36b9d5c..66f060a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe50d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','update','multer'];(function(_0x5880d0,_0x11ac82){var _0x4b4658=function(_0x333cb3){while(--_0x333cb3){_0x5880d0['push'](_0x5880d0['shift']());}};_0x4b4658(++_0x11ac82);}(_0xe50d,0xfb));var _0xde50=function(_0x5a160b,_0x4f4226){_0x5a160b=_0x5a160b-0x0;var _0x42af03=_0xe50d[_0x5a160b];return _0x42af03;};'use strict';var multer=require(_0xde50('0x0'));var util=require(_0xde50('0x1'));var path=require(_0xde50('0x2'));var timeout=require(_0xde50('0x3'));var express=require(_0xde50('0x4'));var router=express[_0xde50('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xde50('0x6'));var interaction=require(_0xde50('0x7'));var config=require('../../config/environment');var controller=require(_0xde50('0x8'));router['get']('/',auth[_0xde50('0x9')](),controller[_0xde50('0xa')]);router[_0xde50('0xb')](_0xde50('0xc'),auth[_0xde50('0x9')](),controller[_0xde50('0xd')]);router[_0xde50('0xb')](_0xde50('0xe'),auth[_0xde50('0x9')](),controller[_0xde50('0xf')]);router[_0xde50('0xb')](_0xde50('0x10'),auth['isAuthenticated'](),controller[_0xde50('0x11')]);router[_0xde50('0x12')]('/',auth[_0xde50('0x9')](),controller['create']);router[_0xde50('0x12')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xde50('0x13')]);router['put'](_0xde50('0xe'),auth[_0xde50('0x9')](),controller[_0xde50('0x14')]);router['delete'](_0xde50('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7a7e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x232cbf,_0x3e2f33){var _0x1cd460=function(_0x29b4f3){while(--_0x29b4f3){_0x232cbf['push'](_0x232cbf['shift']());}};_0x1cd460(++_0x3e2f33);}(_0x7a7e,0x1ad));var _0xe7a7=function(_0x484bf7,_0x45156f){_0x484bf7=_0x484bf7-0x0;var _0x1f3ac7=_0x7a7e[_0x484bf7];return _0x1f3ac7;};'use strict';var multer=require(_0xe7a7('0x0'));var util=require('util');var path=require(_0xe7a7('0x1'));var timeout=require(_0xe7a7('0x2'));var express=require(_0xe7a7('0x3'));var router=express[_0xe7a7('0x4')]();var fs_extra=require(_0xe7a7('0x5'));var auth=require(_0xe7a7('0x6'));var interaction=require(_0xe7a7('0x7'));var config=require(_0xe7a7('0x8'));var controller=require(_0xe7a7('0x9'));router[_0xe7a7('0xa')]('/',auth[_0xe7a7('0xb')](),controller[_0xe7a7('0xc')]);router[_0xe7a7('0xa')]('/describe',auth[_0xe7a7('0xb')](),controller[_0xe7a7('0xd')]);router[_0xe7a7('0xa')](_0xe7a7('0xe'),auth[_0xe7a7('0xb')](),controller[_0xe7a7('0xf')]);router['get'](_0xe7a7('0x10'),auth[_0xe7a7('0xb')](),controller[_0xe7a7('0x11')]);router[_0xe7a7('0x12')]('/',auth[_0xe7a7('0xb')](),controller['create']);router[_0xe7a7('0x12')](_0xe7a7('0x10'),auth['isAuthenticated'](),controller[_0xe7a7('0x13')]);router['put'](_0xe7a7('0xe'),auth[_0xe7a7('0xb')](),controller[_0xe7a7('0x14')]);router[_0xe7a7('0x15')]('/:id',auth[_0xe7a7('0xb')](),controller[_0xe7a7('0x16')]);module[_0xe7a7('0x17')]=router;
\ No newline at end of file
index c222fb9..99ce201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x661e=['exports','STRING','TEXT','INTEGER','DATE','NOW','sequelize'];(function(_0x50c693,_0x58e18d){var _0x570ae1=function(_0x274a39){while(--_0x274a39){_0x50c693['push'](_0x50c693['shift']());}};_0x570ae1(++_0x58e18d);}(_0x661e,0x7d));var _0xe661=function(_0x554fdd,_0x4934fb){_0x554fdd=_0x554fdd-0x0;var _0x336f58=_0x661e[_0x554fdd];return _0x336f58;};'use strict';var _=require('lodash');var Sequelize=require(_0xe661('0x0'));module[_0xe661('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe661('0x2')]},'postalCode':{'type':Sequelize[_0xe661('0x2')]},'city':{'type':Sequelize[_0xe661('0x2')]},'country':{'type':Sequelize[_0xe661('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe661('0x2')]},'description':{'type':Sequelize[_0xe661('0x3')]},'phone':{'type':Sequelize[_0xe661('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe661('0x2')]},'url':{'type':Sequelize[_0xe661('0x2')]},'facebook':{'type':Sequelize[_0xe661('0x2')]},'fb_data':{'type':Sequelize[_0xe661('0x2')]},'twitter':{'type':Sequelize[_0xe661('0x2')]},'skype':{'type':Sequelize[_0xe661('0x2')]},'teams':{'type':Sequelize[_0xe661('0x2')]},'viber':{'type':Sequelize[_0xe661('0x2')]},'line':{'type':Sequelize[_0xe661('0x2')]},'wechat':{'type':Sequelize[_0xe661('0x2')]},'telegram':{'type':Sequelize[_0xe661('0x2')]},'UserId':{'type':Sequelize[_0xe661('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe661('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe661('0x5')],'defaultValue':Sequelize[_0xe661('0x6')]}};
\ No newline at end of file
+var _0x9c50=['STRING','INTEGER','UNSIGNED','NOW'];(function(_0x5e2ded,_0x29c9b3){var _0x48fb2a=function(_0x1fcc4b){while(--_0x1fcc4b){_0x5e2ded['push'](_0x5e2ded['shift']());}};_0x48fb2a(++_0x29c9b3);}(_0x9c50,0xec));var _0x09c5=function(_0x3216db,_0x213d4f){_0x3216db=_0x3216db-0x0;var _0x5c0559=_0x9c50[_0x3216db];return _0x5c0559;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x09c5('0x0')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x09c5('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x09c5('0x0')]},'dateOfBirth':{'type':Sequelize[_0x09c5('0x0')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x09c5('0x0')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x09c5('0x0')]},'email':{'type':Sequelize[_0x09c5('0x0')]},'url':{'type':Sequelize[_0x09c5('0x0')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x09c5('0x0')]},'twitter':{'type':Sequelize[_0x09c5('0x0')]},'skype':{'type':Sequelize[_0x09c5('0x0')]},'teams':{'type':Sequelize[_0x09c5('0x0')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x09c5('0x0')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x09c5('0x1')]},'AdditionalPhones':{'type':Sequelize[_0x09c5('0x0')]},'priority':{'type':Sequelize[_0x09c5('0x1')](0x2)[_0x09c5('0x2')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x09c5('0x3')]}};
\ No newline at end of file
index f451902..2937211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc901=['subject','substatus','externalUrl','threadId','Interaction','flatten','slice','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./cmContact.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','CmContact','describe','length','keys','cf_','CmCustomField','findOne','all','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','filters','pick','select','field','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','search','parseSearch','sqlOperator','conditions','find','Tag','map','forEach','union','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','buildExpression','text','value','isNil','push','Contact','isEmpty','ListId','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','clone','order','DESC','t.id\x20IN\x20?','resolve','some','User','user','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','agent','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','columnName','displayName','findAll','alias','custom','type','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','findOrCreate','contact','show','color','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','omit','format','cf_%d','table','setFields','toParam','CmHopper','phone','getTags','rawAttributes','sort','options','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ContactItemType','OrderBy','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','include','getHopperHistories','CmHopperHistory','includeAll','getHopperFinals','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','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0xc901,0x142));var _0x1c90=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc901[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x1c90('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c90('0x1'));var BPromise=require(_0x1c90('0x2'));var Mustache=require('mustache');var util=require(_0x1c90('0x3'));var path=require(_0x1c90('0x4'));var sox=require(_0x1c90('0x5'));var csv=require(_0x1c90('0x6'));var ejs=require(_0x1c90('0x7'));var fs=require('fs');var fs_extra=require(_0x1c90('0x8'));var _=require(_0x1c90('0x9'));var squel=require(_0x1c90('0xa'));var crypto=require(_0x1c90('0xb'));var jsforce=require(_0x1c90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c90('0x6'));var querystring=require(_0x1c90('0xd'));var Papa=require(_0x1c90('0xe'));var Redis=require(_0x1c90('0xf'));var authService=require(_0x1c90('0x10'));var qs=require(_0x1c90('0x11'));var as=require(_0x1c90('0x12'));var hardwareService=require(_0x1c90('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1c90('0x14'));var config=require(_0x1c90('0x15'));var licenseUtil=require(_0x1c90('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1c90('0x17')](config[_0x1c90('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c90('0x19'))(new Redis(config[_0x1c90('0x18')]));require(_0x1c90('0x1a'))['register'](socket);function respondWithStatusCode(_0x42cb94,_0x5f3727){_0x5f3727=_0x5f3727||0xcc;return function(_0x1174b6){if(_0x1174b6){return _0x42cb94[_0x1c90('0x1b')](_0x5f3727);}return _0x42cb94[_0x1c90('0x1c')](_0x5f3727)[_0x1c90('0x1d')]();};}function respondWithResult(_0x48bd5e,_0x296c5d){_0x296c5d=_0x296c5d||0xc8;return function(_0x526f4e){if(_0x526f4e){return _0x48bd5e[_0x1c90('0x1c')](_0x296c5d)[_0x1c90('0x1e')](_0x526f4e);}};}function respondWithFilteredResult(_0x5f1025,_0x3839cf){return function(_0x4ec354){if(_0x4ec354){var _0x582246=typeof _0x3839cf[_0x1c90('0x1f')]==='undefined'&&typeof _0x3839cf[_0x1c90('0x20')]===_0x1c90('0x21');var _0x2a5b73=_0x4ec354[_0x1c90('0x22')];var _0x559097=_0x582246?0x0:_0x3839cf[_0x1c90('0x1f')];var _0x5a9cc0=_0x582246?_0x4ec354['count']:_0x3839cf[_0x1c90('0x1f')]+_0x3839cf[_0x1c90('0x20')];var _0x47fd11;if(_0x5a9cc0>=_0x2a5b73){_0x5a9cc0=_0x2a5b73;_0x47fd11=0xc8;}else{_0x47fd11=0xce;}_0x5f1025[_0x1c90('0x1c')](_0x47fd11);return _0x5f1025[_0x1c90('0x23')](_0x1c90('0x24'),_0x559097+'-'+_0x5a9cc0+'/'+_0x2a5b73)[_0x1c90('0x1e')](_0x4ec354);}return null;};}function patchUpdates(_0x13fc42){return function(_0x165f9a){try{jsonpatch['apply'](_0x165f9a,_0x13fc42,!![]);}catch(_0x418f4c){return BPromise[_0x1c90('0x25')](_0x418f4c);}return _0x165f9a[_0x1c90('0x26')]();};}function saveUpdates(_0x33c88b,_0x24539a){return function(_0x26d55a){if(_0x26d55a){return _0x26d55a[_0x1c90('0x27')](_0x33c88b)['then'](function(_0x64ca90){return _0x64ca90;});}return null;};}function removeEntity(_0x435c3a,_0x3923a9){return function(_0x4900e1){if(_0x4900e1){return _0x4900e1[_0x1c90('0x28')]()[_0x1c90('0x29')](function(){_0x435c3a['status'](0xcc)[_0x1c90('0x1d')]();});}};}function handleEntityNotFound(_0x7e9044,_0x488d52){return function(_0x3f3d0f){if(!_0x3f3d0f){_0x7e9044[_0x1c90('0x1b')](0x194);}return _0x3f3d0f;};}function handleError(_0x28801d,_0x21f982){_0x21f982=_0x21f982||0x1f4;return function(_0x395edb){logger[_0x1c90('0x2a')](_0x395edb[_0x1c90('0x2b')]);if(_0x395edb[_0x1c90('0x2c')]){delete _0x395edb['name'];}_0x28801d[_0x1c90('0x1c')](_0x21f982)[_0x1c90('0x2d')](_0x395edb);};}exports[_0x1c90('0x2e')]=function(_0x11bcb3,_0x1979de){var _0x26381c={},_0x32eaf3={},_0x3ad85c={'count':0x0,'rows':[]};return db[_0x1c90('0x2f')][_0x1c90('0x30')]()[_0x1c90('0x29')](function(_0x4dbe4a){var _0x17b8ac=[];for(var _0xb74892=0x0;_0xb74892<Object['keys'](_0x4dbe4a)[_0x1c90('0x31')];_0xb74892++){var _0x5193db=Object[_0x1c90('0x32')](_0x4dbe4a)[_0xb74892];if(_['startsWith'](_0x5193db,_0x1c90('0x33'))){_0x17b8ac['push'](db[_0x1c90('0x34')][_0x1c90('0x35')]({'where':{'id':_['trimStart'](_0x5193db,_0x1c90('0x33'))},'raw':!![]}));}}return BPromise[_0x1c90('0x36')](_0x17b8ac)['then'](function(_0x119bbb){for(var _0x390258=0x0;_0x390258<_0x119bbb[_0x1c90('0x31')];_0x390258++){if(_0x119bbb[_0x390258]){var _0xaa73e6=_0x1c90('0x33')+_0x119bbb[_0x390258]['id'];var _0x51e991=_0x4dbe4a[_0xaa73e6];_0x51e991['fieldType']=_0x119bbb[_0x390258]['type'];}}return _0x4dbe4a;});})['then'](function(_0x4f753a){_0x32eaf3[_0x1c90('0x37')]=_[_0x1c90('0x32')](_0x4f753a);_0x32eaf3[_0x1c90('0x38')]=_['keys'](_0x11bcb3[_0x1c90('0x38')]);_0x32eaf3['filters']=_[_0x1c90('0x39')](_0x32eaf3[_0x1c90('0x37')],_0x32eaf3['query']);_0x26381c['attributes']=_[_0x1c90('0x39')](_0x32eaf3[_0x1c90('0x37')],qs[_0x1c90('0x3a')](_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x3a')]));_0x26381c[_0x1c90('0x3b')]=_0x26381c[_0x1c90('0x3b')]['length']?_0x26381c['attributes']:_0x32eaf3[_0x1c90('0x37')];if(!_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x26381c[_0x1c90('0x20')]=qs[_0x1c90('0x20')](_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x20')]);_0x26381c[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x11bcb3['query'][_0x1c90('0x1f')]);}_0x26381c['order']=qs['sort'](_0x11bcb3[_0x1c90('0x38')]['sort']);_0x26381c['where']=qs[_0x1c90('0x3e')](_[_0x1c90('0x3f')](_0x11bcb3['query'],_0x32eaf3[_0x1c90('0x3e')]),_0x4f753a);var _0x3271ea=[];var _0x19fa9c=squel[_0x1c90('0x40')]()['field']('id')['field'](_0x1c90('0x2c'))[_0x1c90('0x41')]('color')[_0x1c90('0x42')]('tools_tags');var _0x4384dd=squel[_0x1c90('0x40')]()['from'](_0x1c90('0x43'),'c')[_0x1c90('0x44')](_0x1c90('0x45'),'uc',_0x1c90('0x46'))[_0x1c90('0x44')](_0x1c90('0x47'),'ct',_0x1c90('0x48'))[_0x1c90('0x44')](_0x1c90('0x49'),'t',_0x1c90('0x4a'))[_0x1c90('0x4b')]('c.deletedAt\x20IS\x20NULL');var _0x2d8cf1=squel['expr']();var _0x180d37=[];var _0x53303d=squel['expr']();var _0x323a15;if(_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x4c')]){_0x323a15=as[_0x1c90('0x4d')](_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x4c')]);var _0x1cf7d6=_0x323a15[_0x1c90('0x4e')];for(var _0x3d6e92=0x0;_0x3d6e92<_0x323a15['conditions']['length'];_0x3d6e92++){var _0x20f299=_0x323a15[_0x1c90('0x4f')][_0x3d6e92];var _0x68fac8='c';var _0x2d30f5=_(_0x4f753a)[_0x1c90('0x32')]()[_0x1c90('0x50')](function(_0x357ee4){return _0x357ee4===_0x20f299[_0x1c90('0x41')];});if(_0x2d30f5)_0x2d30f5=_0x4f753a[_0x20f299['field']];if(!_0x2d30f5){if(_0x20f299[_0x1c90('0x41')]===_0x1c90('0x51')){var _0x9524b6=_0x20f299['value']['split'](',')[_0x1c90('0x52')](function(_0x5e21f9){return Number(_0x5e21f9);});_0x9524b6[_0x1c90('0x53')](function(_0x52d638){_0x53303d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x52d638+',%');});_0x180d37=_[_0x1c90('0x54')](_0x180d37,_0x9524b6);}else if(_0x20f299[_0x1c90('0x41')]==='User'){_0x2d8cf1['and'](_0x1c90('0x55'),_0x20f299['value']);}}else{if(_0x20f299[_0x1c90('0x41')]===_0x1c90('0x56')||_0x2d30f5[_0x1c90('0x57')]===_0x1c90('0x58'))_0x20f299['castTo']='DATE';var _0x4aa7ac=as[_0x1c90('0x59')](_0x68fac8,_0x2d30f5['type'],_0x20f299);_0x2d8cf1[_0x1cf7d6](_0x4aa7ac[_0x1c90('0x5a')],_0x4aa7ac[_0x1c90('0x5b')]['start'],_0x4aa7ac[_0x1c90('0x5b')]['end']);}}}else{var _0x30ed2a=_(Object['keys'](_0x11bcb3[_0x1c90('0x38')]))[_0x1c90('0x52')](function(_0x29ab9a){return _0x4f753a[_0x1c90('0x3c')](_0x29ab9a)?_0x29ab9a:undefined;})['filter'](function(_0x1bc4a3){return!_[_0x1c90('0x5c')](_0x1bc4a3);})[_0x1c90('0x5b')]();if(_0x11bcb3[_0x1c90('0x38')]['Contact'])_0x30ed2a[_0x1c90('0x5d')](_0x1c90('0x5e'));if(!_[_0x1c90('0x5f')](_0x30ed2a)){_0x30ed2a[_0x1c90('0x53')](function(_0x522ccb){if(_0x522ccb===_0x1c90('0x60')){_0x4384dd[_0x1c90('0x4b')]('c.ListId\x20IN\x20?',[][_0x1c90('0x61')](_0x11bcb3[_0x1c90('0x38')][_0x522ccb]));}else if(_0x522ccb===_0x1c90('0x5e')){var _0x57db87='%'+_0x11bcb3['query'][_0x522ccb]+'%';_0x4384dd[_0x1c90('0x4b')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x57db87);}else{_0x4384dd[_0x1c90('0x4b')]('c.'+_0x522ccb+_0x1c90('0x62'),_0x11bcb3[_0x1c90('0x38')][_0x522ccb]);}});}if(_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x63')]){_0x180d37=_[_0x1c90('0x64')](_0x11bcb3['query']['tag'])?_0x11bcb3['query'][_0x1c90('0x63')]:new Array(_0x11bcb3[_0x1c90('0x38')]['tag']);_0x180d37[_0x1c90('0x53')](function(_0x33a9f8){_0x53303d['or'](_0x1c90('0x65'),'%,'+_0x33a9f8+',%');});}if(_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x66')]){var _0x5ca9c4=_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x66')]['replace']('\x5c','\x5c\x5c')[_0x1c90('0x67')](/'/g,'\x27\x27');if(_0x5ca9c4[_0x1c90('0x68')]('\x20')[_0x1c90('0x31')]>0x1){_0x2d8cf1['or'](_0x1c90('0x69'),qs['getFullTextValue'](_0x5ca9c4),null);}else{if(qs[_0x1c90('0x6a')](_0x5ca9c4)){_0x2d8cf1['or']('c.id\x20LIKE\x20?',_0x5ca9c4+'%');_0x2d8cf1['or'](_0x1c90('0x6b'),_0x5ca9c4+'%');_0x2d8cf1['or'](_0x1c90('0x6c'),_0x5ca9c4+'%');_0x2d8cf1['or'](_0x1c90('0x6d'),_0x5ca9c4+'%');}else if(qs[_0x1c90('0x6e')](_0x5ca9c4)){_0x2d8cf1['or'](_0x1c90('0x6f'),_0x5ca9c4+'%');}else{_0x2d8cf1['or']('c.firstName\x20LIKE\x20?','%'+_0x5ca9c4+'%');_0x2d8cf1['or'](_0x1c90('0x70'),'%'+_0x5ca9c4+'%');_0x2d8cf1['or'](_0x1c90('0x6f'),'%'+_0x5ca9c4+'%');}}}}_0x4384dd[_0x1c90('0x4b')](_0x2d8cf1);_0x4384dd[_0x1c90('0x71')](_0x1c90('0x72'));var _0x580ddd={'type':db['Sequelize'][_0x1c90('0x73')]['SELECT'],'raw':!![]};var _0x35337e=_0x4384dd[_0x1c90('0x74')]()[_0x1c90('0x41')](_0x1c90('0x72'));if(_0x26381c[_0x1c90('0x75')]){_0x26381c[_0x1c90('0x75')][_0x1c90('0x53')](function(_0xad0a9d){_0x4384dd[_0x1c90('0x75')]('c.'+_0xad0a9d[0x0],_0xad0a9d[0x1]===_0x1c90('0x76')?![]:!![]);});}if(!_['isEmpty'](_0x180d37)){_0x4384dd['having'](_0x53303d);_0x35337e[_0x1c90('0x4b')](_0x1c90('0x77'),_0x180d37);}BPromise[_0x1c90('0x78')]()[_0x1c90('0x29')](function(){if(!_0x323a15)return;if(_0x11bcb3['user']['role']!=='agent')return;if(!_[_0x1c90('0x79')](_0x323a15[_0x1c90('0x4f')],[_0x1c90('0x41'),_0x1c90('0x7a')])){return _0x11bcb3[_0x1c90('0x7b')]['getLists']({'attributes':['id'],'raw':!![]})[_0x1c90('0x29')](function(_0x54eed4){if(_[_0x1c90('0x5f')](_0x54eed4)){_0x35337e[_0x1c90('0x4b')]('c.ListId\x20IS\x20NULL');_0x4384dd[_0x1c90('0x4b')](_0x1c90('0x7c'));}else{_0x35337e[_0x1c90('0x4b')](_0x1c90('0x7d'),_['map'](_0x54eed4,'id'));_0x4384dd['where'](_0x1c90('0x7d'),_['map'](_0x54eed4,'id'));}});}})[_0x1c90('0x29')](function(){if(_0x11bcb3[_0x1c90('0x7b')][_0x1c90('0x7e')]===_0x1c90('0x7f')&&!_0x323a15&&!_0x11bcb3[_0x1c90('0x38')][_0x1c90('0x60')])return[];return db[_0x1c90('0x80')][_0x1c90('0x38')](_0x35337e[_0x1c90('0x81')](),_0x580ddd);})[_0x1c90('0x29')](function(_0x33b3e2){_0x3ad85c[_0x1c90('0x22')]=_0x33b3e2[_0x1c90('0x31')];if(_0x3ad85c['count']===0x0)return[];return db[_0x1c90('0x80')][_0x1c90('0x38')](_0x19fa9c[_0x1c90('0x81')](),_0x580ddd)[_0x1c90('0x29')](function(_0x56a56e){_0x3271ea=_['keyBy'](_0x56a56e,'id');_0x580ddd=_[_0x1c90('0x82')](_0x580ddd,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11bcb3[_0x1c90('0x38')]['fields']){_0x26381c['attributes']['forEach'](function(_0x32d3b4){_0x4384dd['field']('c.'+_0x32d3b4);});}else{_0x4384dd[_0x1c90('0x41')]('c.id');_0x4384dd[_0x1c90('0x41')](_0x1c90('0x83'));_0x4384dd[_0x1c90('0x41')](_0x1c90('0x84'));_0x4384dd[_0x1c90('0x41')](_0x1c90('0x85'));_0x4384dd[_0x1c90('0x41')]('c.mobile');_0x4384dd[_0x1c90('0x41')]('c.fax');_0x4384dd[_0x1c90('0x41')]('c.email');_0x4384dd[_0x1c90('0x41')](_0x1c90('0x86'));_0x4384dd[_0x1c90('0x41')]('c.createdAt');_0x4384dd[_0x1c90('0x41')](_0x1c90('0x87'));_0x4384dd[_0x1c90('0x41')](_0x1c90('0x88'));_0x4384dd['field'](_0x1c90('0x89'),_0x1c90('0x8a'));}if(_0x26381c[_0x1c90('0x20')])_0x4384dd[_0x1c90('0x20')](_0x26381c[_0x1c90('0x20')]);if(_0x26381c[_0x1c90('0x1f')])_0x4384dd[_0x1c90('0x1f')](_0x26381c[_0x1c90('0x1f')]);return db[_0x1c90('0x80')][_0x1c90('0x38')](_0x4384dd[_0x1c90('0x81')](),_0x580ddd);});})['then'](function(_0x1f0426){_0x1f0426[_0x1c90('0x53')](function(_0x4304f0){if(_0x4304f0[_0x1c90('0x8a')]){_0x4304f0[_0x1c90('0x8b')]=[];_0x4304f0[_0x1c90('0x8a')]['split'](',')['forEach'](function(_0x4b4b33){_0x4304f0[_0x1c90('0x8b')][_0x1c90('0x5d')](_0x3271ea[_0x4b4b33]);});}delete _0x4304f0[_0x1c90('0x8a')];});_0x3ad85c[_0x1c90('0x8c')]=_0x1f0426;return _0x3ad85c;})[_0x1c90('0x29')](respondWithFilteredResult(_0x1979de,_0x26381c));})['catch'](handleError(_0x1979de,null));};exports['destroy']=function(_0x1f1f6e,_0x3ccdb7){return db[_0x1c90('0x2f')][_0x1c90('0x50')]({'where':{'id':_0x1f1f6e[_0x1c90('0x8d')]['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x3ccdb7,null))[_0x1c90('0x29')](removeEntity(_0x3ccdb7,null))[_0x1c90('0x8e')](handleError(_0x3ccdb7,null));};exports[_0x1c90('0x30')]=function(_0x50e007,_0x5ce8ba){return db['CmContact'][_0x1c90('0x30')]()[_0x1c90('0x29')](function(_0x5b5167){delete _0x5b5167[_0x1c90('0x8f')];for(var _0x4ff92e=0x0;_0x4ff92e<Object[_0x1c90('0x32')](_0x5b5167)[_0x1c90('0x31')];_0x4ff92e++){var _0x407eb9=Object['keys'](_0x5b5167)[_0x4ff92e];if(!_['startsWith'](_0x407eb9,_0x1c90('0x33'))){_0x5b5167[_0x407eb9][_0x1c90('0x90')]=_0x407eb9;_0x5b5167[_0x407eb9][_0x1c90('0x91')]=_0x407eb9;}}return _0x5b5167;})['then'](function(_0x593315){var _0x48cc04={'where':{'$or':[{'ListId':_0x50e007[_0x1c90('0x38')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField'][_0x1c90('0x92')](_0x48cc04)[_0x1c90('0x29')](function(_0x41f989){for(var _0x18f496=0x0;_0x18f496<_0x41f989[_0x1c90('0x31')];_0x18f496++){var _0xb18354=_0x1c90('0x33')+_0x41f989[_0x18f496]['id'];_0x593315[_0xb18354][_0x1c90('0x90')]=_0xb18354;_0x593315[_0xb18354][_0x1c90('0x91')]=_0x41f989[_0x18f496][_0x1c90('0x93')];_0x593315[_0xb18354][_0x1c90('0x94')]={'type':_0x41f989[_0x18f496][_0x1c90('0x95')],'values':_0x41f989[_0x18f496][_0x1c90('0x96')]};}Object[_0x1c90('0x32')](_0x593315)['forEach'](function(_0x5e9507){if(!_0x593315[_0x5e9507][_0x1c90('0x3c')](_0x1c90('0x90'))){delete _0x593315[_0x5e9507];}});return _0x593315;});})[_0x1c90('0x29')](respondWithResult(_0x5ce8ba,null))[_0x1c90('0x8e')](handleError(_0x5ce8ba,null));};exports[_0x1c90('0x82')]=function(_0x1e96a6,_0x15456d){var _0x25f8a9;var _0x269386;var _0x161892;if(_0x1e96a6[_0x1c90('0x97')]['id']){delete _0x1e96a6[_0x1c90('0x97')]['id'];}return db[_0x1c90('0x2f')][_0x1c90('0x92')]({'where':{'id':[_0x1e96a6['body']['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]]}})[_0x1c90('0x29')](function(_0x476d4b){if(_0x476d4b){if(_0x476d4b[_0x1c90('0x31')]!==0x2){return null;}_0x476d4b[0x0]=_0x476d4b[0x0][_0x1c90('0x98')]({'plain':!![]});_0x476d4b[0x1]=_0x476d4b[0x1][_0x1c90('0x98')]({'plain':!![]});delete _0x476d4b[0x0]['id'];delete _0x476d4b[0x1]['id'];return _[_0x1c90('0x99')](_0x476d4b[0x0],_0x476d4b[0x1],function(_0x5c07fd,_0x2538e2){if(Array[_0x1c90('0x64')](_0x2538e2)&&!_0x2538e2[_0x1c90('0x31')]){return _0x5c07fd;}else if(!_0x2538e2){return _0x5c07fd;}});}})[_0x1c90('0x29')](handleEntityNotFound(_0x15456d,null))[_0x1c90('0x29')](function(_0x5aebf3){if(_0x5aebf3){if(_0x5aebf3[_0x1c90('0x8f')]&&_['isArray'](_0x5aebf3[_0x1c90('0x8f')])){_0x5aebf3[_0x1c90('0x8f')]=_0x5aebf3[_0x1c90('0x8f')]['join']();}logger[_0x1c90('0x9a')](_0x1c90('0x9b'),_0x1e96a6[_0x1c90('0x97')]['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]);return db['CmHopper']['destroy']({'where':{'ContactId':[_0x1e96a6['body']['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]]}})[_0x1c90('0x29')](function(_0x129bac){logger['info'](_0x1c90('0x9c'),_0x129bac);return db['CmHopperBlack'][_0x1c90('0x28')]({'where':{'ContactId':[_0x1e96a6['body']['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]]}})['then'](function(_0x3ec314){logger[_0x1c90('0x9a')](_0x1c90('0x9d'),_0x3ec314);return db['CmContact'][_0x1c90('0x9e')](_0x5aebf3);});});}})[_0x1c90('0x29')](function(_0xfbc363){if(_0xfbc363){_0x25f8a9=_0xfbc363;_0x269386={'ContactId':_0x25f8a9['id']};_0x161892={'where':{'ContactId':[_0x1e96a6[_0x1c90('0x97')]['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]]}};return db['ChatInteraction']['update'](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['ChatMessage']['update'](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0x9f')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa0')][_0x1c90('0x27')](_0x269386,_0x161892);}})['then'](function(){if(_0x25f8a9){return db[_0x1c90('0xa1')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa0')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa1')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa2')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa3')]['update'](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['FaxInteraction']['update'](_0x269386,_0x161892);}})['then'](function(){if(_0x25f8a9){return db[_0x1c90('0xa4')][_0x1c90('0x27')](_0x269386,_0x161892);}})['then'](function(){if(_0x25f8a9){return db['OpenchannelInteraction'][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['OpenchannelMessage'][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa5')]['update']({'CmContactId':_0x25f8a9['id']},{'where':{'CmContactId':[_0x1e96a6[_0x1c90('0x97')]['to'],_0x1e96a6['body'][_0x1c90('0x42')]]}});}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa6')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['CmHopperHistory'][_0x1c90('0x27')](_0x269386,_0x161892);}})['then'](function(){if(_0x25f8a9){return db[_0x1c90('0xa7')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xa8')][_0x1c90('0x27')](_0x269386,_0x161892);}})['then'](function(){if(_0x25f8a9){return db[_0x1c90('0xa9')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['FaxQueueReport'][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xaa')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xab')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['SmsQueueReport']['update'](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xac')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db['WhatsappInteraction'][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xad')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0xae')][_0x1c90('0x27')](_0x269386,_0x161892);}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return db[_0x1c90('0x2f')][_0x1c90('0x28')]({'where':{'id':[_0x1e96a6[_0x1c90('0x97')]['to'],_0x1e96a6[_0x1c90('0x97')][_0x1c90('0x42')]]}});}})[_0x1c90('0x29')](function(){if(_0x25f8a9){return _0x25f8a9;}})[_0x1c90('0x29')](respondWithResult(_0x15456d,null))[_0x1c90('0x8e')](handleError(_0x15456d,null));};exports['create']=function(_0x5e3d86,_0x188632){return db['CmContact'][_0x1c90('0x30')]()[_0x1c90('0x29')](function(_0x46dca6){if(_0x5e3d86[_0x1c90('0x97')]['tags']&&_[_0x1c90('0x64')](_0x5e3d86[_0x1c90('0x97')][_0x1c90('0x8f')])){if(_0x5e3d86[_0x1c90('0x97')][_0x1c90('0x8f')][_0x1c90('0x31')]){_0x5e3d86[_0x1c90('0x97')]['tags']=_0x5e3d86[_0x1c90('0x97')][_0x1c90('0x8f')]['join'](';')+';';}else{_0x5e3d86[_0x1c90('0x97')][_0x1c90('0x8f')]=null;}}else{_0x5e3d86[_0x1c90('0x97')][_0x1c90('0x8f')]=null;}return db[_0x1c90('0x2f')]['create'](_0x5e3d86[_0x1c90('0x97')],{'fields':_['keys'](_0x46dca6),'raw':!![]});})[_0x1c90('0x29')](function(_0x5f22f9){if(_0x5e3d86[_0x1c90('0x97')][_0x1c90('0xaf')]){return insertAdditionalPhones(_0x5f22f9,_0x5e3d86[_0x1c90('0x97')][_0x1c90('0xaf')]);}else{return _0x5f22f9;}})[_0x1c90('0x29')](respondWithResult(_0x188632,0xc9))[_0x1c90('0x8e')](handleError(_0x188632,null));};exports[_0x1c90('0xb0')]=function(_0x56c236,_0x4aedc6){var _0x422f21=[];var _0x2752a4=0x0;var _0x4ca9cd=0x0;var _0x455f6d=0x0;var _0x2b7c12=[];return db[_0x1c90('0x2f')][_0x1c90('0x30')]()[_0x1c90('0x29')](function(_0x129e81){return BPromise[_0x1c90('0xb1')](_0x56c236['body'],function(_0x2ceb5e){var _0xcfada1={'where':{'$or':[]},'defaults':_0x2ceb5e,'fields':_[_0x1c90('0x32')](_0x129e81),'raw':!![]};if(_0x2ceb5e[_0x1c90('0xb2')]){for(var _0x335888=0x0;_0x335888<_0x2ceb5e['duplicates'][_0x1c90('0x31')];_0x335888++){var _0x2de441={};_0x2de441[_0x2ceb5e[_0x1c90('0xb2')][_0x335888]]=_0x2ceb5e[_0x2ceb5e[_0x1c90('0xb2')][_0x335888]];_0xcfada1['where']['$or'][_0x1c90('0x5d')](_0x2de441);}_0xcfada1['where'][_0x1c90('0x60')]=_0x2ceb5e[_0x1c90('0x60')];}return db[_0x1c90('0x2f')][_0x1c90('0xb3')](_0xcfada1)['spread'](function(_0x270cdf,_0x4b67f3){if(_0x4b67f3){if(_0x2ceb5e[_0x1c90('0x3c')](_0x1c90('0xaf'))){_0x2b7c12[_0x1c90('0x5d')]({'contact':_0x270cdf,'additionalPhones':_0x2ceb5e['additionalPhones']});}_0x2752a4++;}else{_0x455f6d++;}})[_0x1c90('0x8e')](function(_0x4c1876){console[_0x1c90('0x2a')](_0x4c1876);_0x4ca9cd++;});});})[_0x1c90('0x29')](function(_0x298303){if(_0x298303){if(_0x2b7c12['length']>0x0){return new Promise(function(_0x3f73a2,_0x52ca4){var _0x5aa697=[];for(var _0x37c90=0x0;_0x37c90<_0x2b7c12[_0x1c90('0x31')];_0x37c90++){_0x5aa697[_0x1c90('0x5d')](insertAdditionalPhones(_0x2b7c12[_0x37c90][_0x1c90('0xb4')],_0x2b7c12[_0x37c90][_0x1c90('0xaf')]));}Promise[_0x1c90('0x36')](_0x5aa697)[_0x1c90('0x29')](function(){_0x3f73a2(0x1);});})[_0x1c90('0x29')](function(){return{'success':_0x2752a4,'failure':_0x4ca9cd,'duplicates':_0x455f6d};});}else{return{'success':_0x2752a4,'failure':_0x4ca9cd,'duplicates':_0x455f6d};}}})[_0x1c90('0x29')](respondWithResult(_0x4aedc6,0xc9))[_0x1c90('0x8e')](handleError(_0x4aedc6,null));};exports[_0x1c90('0xb5')]=function(_0x28a47c,_0x410868,_0x267152){var _0x5c1375;return db[_0x1c90('0x2f')]['describe']()[_0x1c90('0x29')](function(_0x23ac72){return db[_0x1c90('0x2f')][_0x1c90('0x50')]({'where':{'id':_0x28a47c[_0x1c90('0x8d')]['id']},'include':[{'model':db[_0x1c90('0x51')],'as':_0x1c90('0x8b'),'attributes':['id',_0x1c90('0x2c'),_0x1c90('0xb6')],'required':_0x28a47c['query'][_0x1c90('0x63')]?!![]:![]},{'model':db[_0x1c90('0xa5')],'as':'Phones','where':{'CmContactId':_0x28a47c[_0x1c90('0x8d')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x1c90('0xb7')}]}],'order':[db[_0x1c90('0x80')][_0x1c90('0xb8')](_0x1c90('0xb9'))],'logging':console[_0x1c90('0xba')],'attributes':_[_0x1c90('0x32')](_0x23ac72)});})[_0x1c90('0x29')](function(_0x3eb79b){_0x5c1375=_0x3eb79b[_0x1c90('0x98')]({'plain':!![]});var _0x1c2b66={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3eb79b&&_0x3eb79b['ListId']){if(_0x3eb79b[_0x1c90('0x60')]){_0x1c2b66[_0x1c90('0x4b')][_0x1c90('0xbb')][_0x1c90('0x5d')]({'ListId':{'$ne':_0x3eb79b['ListId']}});}}return db[_0x1c90('0x34')][_0x1c90('0x92')](_0x1c2b66);})['then'](function(_0x3d7367){return _[_0x1c90('0xbc')](_0x5c1375,_[_0x1c90('0x52')](_0x3d7367,function(_0x1e9d4a){return util[_0x1c90('0xbd')]('cf_%d',_0x1e9d4a['id']);}));})[_0x1c90('0x29')](handleEntityNotFound(_0x410868,null))[_0x1c90('0x29')](respondWithResult(_0x410868,null))[_0x1c90('0x8e')](handleError(_0x410868,null));};exports[_0x1c90('0x27')]=function(_0x623c41,_0x41c64c){var _0x63ffd9;if(_0x623c41['body']['id']){delete _0x623c41['body']['id'];}return db[_0x1c90('0x2f')][_0x1c90('0x50')]({'where':{'id':_0x623c41[_0x1c90('0x8d')]['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x41c64c,null))[_0x1c90('0x29')](saveUpdates(_0x623c41['body'],null))[_0x1c90('0x29')](function(_0x2f1b87){_0x63ffd9=_0x2f1b87;var _0x5c01f3={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2f1b87&&_0x2f1b87['ListId']){if(_0x2f1b87['ListId']){_0x5c01f3[_0x1c90('0x4b')]['$and'][_0x1c90('0x5d')]({'ListId':{'$ne':_0x2f1b87[_0x1c90('0x60')]}});}}return db[_0x1c90('0x34')][_0x1c90('0x92')](_0x5c01f3);})[_0x1c90('0x29')](function(_0x1f9b10){if(_0x1f9b10){return _['omit'](_['pickBy'](_0x623c41[_0x1c90('0x97')],function(_0x4ca8bf,_0x5eeb89){return _['startsWith'](_0x5eeb89,_0x1c90('0x33'));}),_[_0x1c90('0x52')](_0x1f9b10,function(_0x371138){return util[_0x1c90('0xbd')](_0x1c90('0xbe'),_0x371138['id']);}));}})[_0x1c90('0x29')](function(_0xdc3652){if(_0xdc3652&&!_[_0x1c90('0x5f')](_0xdc3652)){var _0x3caa9b=squel[_0x1c90('0x27')]()[_0x1c90('0xbf')](_0x1c90('0x43'))[_0x1c90('0xc0')](_0xdc3652)[_0x1c90('0x4b')]('id\x20=\x20?',_0x623c41[_0x1c90('0x8d')]['id'])[_0x1c90('0xc1')]();return db[_0x1c90('0x80')][_0x1c90('0x38')](_0x3caa9b[_0x1c90('0x5a')],{'replacements':_0x3caa9b['values']});}})[_0x1c90('0x29')](function(){if(_0x623c41[_0x1c90('0x97')]['phone']&&_0x63ffd9){return db[_0x1c90('0xc2')][_0x1c90('0x27')]({'phone':_0x623c41[_0x1c90('0x97')][_0x1c90('0xc3')]},{'where':{'ContactId':_0x63ffd9['id']}});}})['then'](function(){return _0x63ffd9;})[_0x1c90('0x29')](respondWithResult(_0x41c64c,null))[_0x1c90('0x8e')](handleError(_0x41c64c,null));};exports[_0x1c90('0xc4')]=function(_0x503dbc,_0x129a2b,_0x127cb5){var _0x2c5e0f={};var _0x40324b={};var _0x1182e5;var _0x3b6ed2;return db['CmContact']['findOne']({'where':{'id':_0x503dbc[_0x1c90('0x8d')]['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x129a2b,null))['then'](function(_0x4ec733){if(_0x4ec733){_0x1182e5=_0x4ec733;_0x40324b['model']=_[_0x1c90('0x32')](db[_0x1c90('0x51')][_0x1c90('0xc5')]);_0x40324b['query']=_[_0x1c90('0x32')](_0x503dbc[_0x1c90('0x38')]);_0x40324b['filters']=_[_0x1c90('0x39')](_0x40324b[_0x1c90('0x37')],_0x40324b[_0x1c90('0x38')]);_0x2c5e0f['attributes']=_[_0x1c90('0x39')](_0x40324b['model'],qs[_0x1c90('0x3a')](_0x503dbc[_0x1c90('0x38')][_0x1c90('0x3a')]));_0x2c5e0f[_0x1c90('0x3b')]=_0x2c5e0f[_0x1c90('0x3b')][_0x1c90('0x31')]?_0x2c5e0f[_0x1c90('0x3b')]:_0x40324b['model'];_0x2c5e0f[_0x1c90('0x75')]=qs[_0x1c90('0xc6')](_0x503dbc[_0x1c90('0x38')]['sort']);_0x2c5e0f[_0x1c90('0x4b')]=qs['filters'](_['pick'](_0x503dbc['query'],_0x40324b['filters']));if(_0x503dbc['query']['filter']){_0x2c5e0f[_0x1c90('0x4b')]=_[_0x1c90('0x82')](_0x2c5e0f[_0x1c90('0x4b')],{'$or':_[_0x1c90('0x52')](_0x2c5e0f[_0x1c90('0x3b')],function(_0x2a2734){var _0x5233b8={};_0x5233b8[_0x2a2734]={'$like':'%'+_0x503dbc['query'][_0x1c90('0x66')]+'%'};return _0x5233b8;})});}_0x2c5e0f=_[_0x1c90('0x82')]({},_0x2c5e0f,_0x503dbc[_0x1c90('0xc7')]);return _0x1182e5['getTags'](_0x2c5e0f);}})['then'](function(_0x20c945){if(_0x20c945){_0x3b6ed2=_0x20c945['length'];if(!_0x503dbc['query'][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x2c5e0f['limit']=qs['limit'](_0x503dbc[_0x1c90('0x38')][_0x1c90('0x20')]);_0x2c5e0f[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x503dbc[_0x1c90('0x38')][_0x1c90('0x1f')]);}return _0x1182e5[_0x1c90('0xc4')](_0x2c5e0f);}})[_0x1c90('0x29')](function(_0x5f5ba9){if(_0x5f5ba9){return _0x5f5ba9?{'count':_0x3b6ed2,'rows':_0x5f5ba9}:null;}})[_0x1c90('0x29')](respondWithResult(_0x129a2b,null))[_0x1c90('0x8e')](handleError(_0x129a2b,null));};exports[_0x1c90('0xc8')]=function(_0xec9be1,_0x311a21,_0x52890e){if(_0xec9be1[_0x1c90('0x97')]['id']){delete _0xec9be1[_0x1c90('0x97')]['id'];}return db[_0x1c90('0x2f')]['findOne']({'where':{'id':_0xec9be1[_0x1c90('0x8d')]['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x311a21,null))[_0x1c90('0x29')](function(_0xcf6c9e){if(_0xcf6c9e){return _0xcf6c9e[_0x1c90('0xc8')](_0xec9be1['body'][_0x1c90('0xc9')]||[]);}return null;})[_0x1c90('0x29')](respondWithResult(_0x311a21,null))[_0x1c90('0x8e')](handleError(_0x311a21,null));};exports[_0x1c90('0xca')]=function(_0x5aa803,_0x4d68ec){var _0x32f0b3=[];_0x32f0b3['push'](addAdditionalPhones(_0x5aa803['body']));Promise[_0x1c90('0x36')](_0x32f0b3)[_0x1c90('0x29')](function(){_0x32f0b3=[];_0x32f0b3[_0x1c90('0x5d')](deleteCmHopperPhones(_0x5aa803[_0x1c90('0x97')]['id']));_0x32f0b3[_0x1c90('0x5d')](addCmHopperPhones(_0x5aa803[_0x1c90('0x97')]['id']));Promise[_0x1c90('0x36')](_0x32f0b3)[_0x1c90('0x29')](function(){return[0x1];})['then'](respondWithResult(_0x4d68ec,null));});};function addAdditionalPhones(_0x332169){var _0x42cfbd;return new Promise(function(_0x4499f0,_0x563203){return db[_0x1c90('0xa5')]['destroy']({'where':{'CmContactId':_0x332169['id']}})[_0x1c90('0x29')](function(){var _0x38528d=[];for(var _0xa85c4c=0x0;_0xa85c4c<_0x332169[_0x1c90('0xcb')]['length'];_0xa85c4c++){var _0x40e0de=_0x332169['item_types']?_[_0x1c90('0x5c')](_0x332169[_0x1c90('0xcc')][_0xa85c4c])?'':_0x332169[_0x1c90('0xcc')][_0xa85c4c]:_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xcd')]?_0x332169[_0x1c90('0xcb')][_0xa85c4c]['ItemTypeId']:'';var _0x40452c=_[_0x1c90('0x5c')](_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xce')])?'':_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xce')];var _0x44397e=_0x40e0de+':'+_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xc3')]+'§'+_0x40452c;if(_[_0x1c90('0x5c')](_0x42cfbd))_0x42cfbd=_0x44397e;else _0x42cfbd+=';'+_0x44397e;_0x38528d[_0x1c90('0x5d')](addAdditionalPhone(_0x332169['id'],_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xc3')],_0x332169['item_types']?_[_0x1c90('0x5c')](_0x332169[_0x1c90('0xcc')][_0xa85c4c])?null:_0x332169[_0x1c90('0xcc')][_0xa85c4c]:_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xcd')]?_0x332169[_0x1c90('0xcb')][_0xa85c4c][_0x1c90('0xcd')]:null,_0xa85c4c,_0x40452c));}Promise[_0x1c90('0x36')](_0x38528d)[_0x1c90('0x29')](function(){db[_0x1c90('0x2f')][_0x1c90('0x27')]({'AdditionalPhones':_0x42cfbd},{'where':{'id':_0x332169['id']}})[_0x1c90('0x29')](function(){_0x4499f0(0x1);});});});});}function addAdditionalPhone(_0x6e196f,_0x478f1f,_0x5af99b,_0x353bd9,_0x33ba44){return db[_0x1c90('0xa5')][_0x1c90('0x50')]({'where':{'CmContactId':_0x6e196f,'item':_0x478f1f}})[_0x1c90('0x29')](function(_0x5f3bf0){if(_0x5f3bf0)logger[_0x1c90('0x9a')](_0x1c90('0xcf'),_0x5f3bf0);else{db[_0x1c90('0xa5')]['create']({'CmContactId':_0x6e196f,'item':_0x478f1f,'ItemTypeId':_0x5af99b,'OrderBy':_0x353bd9,'ItemClass':_0x1c90('0xd0'),'description':_0x33ba44});}});}function deletePhones(_0x3f329f){return db[_0x1c90('0xa5')][_0x1c90('0x28')]({'where':{'CmContactId':_0x3f329f}});}function deleteCmHopperPhones(_0x18e70d){return new Promise(function(_0x269ad1,_0x36caac){return db[_0x1c90('0xc2')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x18e70d}})[_0x1c90('0x29')](function(_0x59aca2){db[_0x1c90('0xd1')][_0x1c90('0x28')]({'where':{'CmHopperId':{'$in':_['map'](_0x59aca2,'id')}}});})[_0x1c90('0x29')](function(){_0x269ad1(0x1);});});}function addCmHopperPhones(_0x4f318c){return new Promise(function(_0x53280d,_0x233acd){return db[_0x1c90('0xc2')][_0x1c90('0x92')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4f318c}})[_0x1c90('0x29')](function(_0x5555fc){var _0x25fbd7=[];_['map'](_0x5555fc,function(_0x4d3172){_0x25fbd7[_0x1c90('0x5d')](createCmHopperPhone(_0x4f318c,_0x4d3172['id']));});Promise[_0x1c90('0x36')](_0x25fbd7)[_0x1c90('0x29')](function(){_0x53280d(0x1);});});});}function createCmHopperPhone(_0x5aa979,_0x33b2b4){return new Promise(function(_0x14ece5,_0x539471){db[_0x1c90('0xa5')]['findAll']({'raw':!![],'attributes':[_0x1c90('0xd2')],'where':{'CmContactId':_0x5aa979,'ItemClass':_0x1c90('0xd0')},'include':[{'model':db[_0x1c90('0xd3')],'attributes':[_0x1c90('0xd4')],'as':_0x1c90('0xb7')}],'order':[db[_0x1c90('0x80')][_0x1c90('0xb8')]('`ItemType`.OrderBy')]})[_0x1c90('0x29')](function(_0x4c301f){var _0xd24d6a=0x1;var _0x10ab40=_['map'](_0x4c301f,function(_0x301807){_0x301807['CmHopperId']=_0x33b2b4;_0x301807[_0x1c90('0xc3')]=_0x301807[_0x1c90('0xd2')];_0x301807[_0x1c90('0xd4')]=_0x301807[_0x1c90('0xd5')]||_0xd24d6a;delete _0x301807[_0x1c90('0xd5')];_0xd24d6a=_0xd24d6a+0x1;return _0x301807;});return db[_0x1c90('0xd1')][_0x1c90('0xb0')](_0x10ab40,{});})[_0x1c90('0x29')](function(){_0x14ece5(0x1);});});}function insertAdditionalPhones(_0x127fe9,_0x3fdf35){return new Promise(function(_0x5e12da,_0xa66dbe){var _0x36ac41=[];for(var _0x1ee584=0x0;_0x1ee584<_0x3fdf35[_0x1c90('0x31')];_0x1ee584++){var _0x331c75=_0x3fdf35[_0x1ee584];_0x36ac41[_0x1c90('0x5d')](parseContactItemType(_0x331c75));}Promise['all'](_0x36ac41)[_0x1c90('0x29')](function(){var _0x11a45e={'id':_0x127fe9['id'],'items':_0x3fdf35};return addAdditionalPhones(_0x11a45e)['then'](function(_0x206767){return addCmHopperPhones(_0x127fe9['id']);});})[_0x1c90('0x29')](function(){_0x5e12da(_0x127fe9);});});}function parseContactItemType(_0x170a41){return new Promise(function(_0x34a998,_0x3c1d77){if(_0x170a41['hasOwnProperty'](_0x1c90('0xcd'))){_0x34a998(_0x170a41);}else{return db[_0x1c90('0xd3')][_0x1c90('0x50')]({'where':{'name':_0x170a41[_0x1c90('0xb7')]}})[_0x1c90('0x29')](function(_0x3d1567){if(_[_0x1c90('0x5c')](_0x3d1567))_0x170a41[_0x1c90('0xcd')]=null;else _0x170a41[_0x1c90('0xcd')]=_0x3d1567['id'];_0x34a998(_0x170a41);});}});}exports[_0x1c90('0xd6')]=function(_0x3846e6,_0x1be782){return db[_0x1c90('0xa5')][_0x1c90('0x92')]({'raw':!![],'where':{'CmContactId':_0x3846e6[_0x1c90('0x8d')]['id'],'ItemClass':_0x1c90('0xd0')},'include':[{'model':db['ContactItemType'],'as':_0x1c90('0xb7')}],'order':[[db[_0x1c90('0x80')][_0x1c90('0xb8')](_0x1c90('0xd7'))],[_0x1c90('0xd4')]]})['then'](function(_0x3249ec){return _0x3249ec;})[_0x1c90('0x29')](respondWithResult(_0x1be782,null))[_0x1c90('0x8e')](handleError(_0x1be782,null));};exports[_0x1c90('0xd8')]=function(_0x1daad9,_0x13db81){return db[_0x1c90('0xa5')]['findAll']({'raw':!![],'where':{'CmContactId':_0x1daad9[_0x1c90('0x97')][_0x1c90('0xd9')]}})[_0x1c90('0x29')](function(_0x67e83c){var _0x2372da=_[_0x1c90('0x52')](_0x67e83c,function(_0x269ffd){_0x269ffd[_0x1c90('0xda')]=_0x1daad9[_0x1c90('0x97')][_0x1c90('0xdb')];return _0x269ffd;});return db[_0x1c90('0xa5')][_0x1c90('0xb0')](_0x2372da,{});})[_0x1c90('0x29')](function(_0x2ae976){return addCmHopperPhones(_0x1daad9[_0x1c90('0x97')]['toContactId']);})[_0x1c90('0x29')](function(_0x1c5150){return['ok'];})[_0x1c90('0x29')](respondWithResult(_0x13db81,null))[_0x1c90('0x8e')](handleError(_0x13db81,null));};exports[_0x1c90('0xdc')]=function(_0x262e94,_0x509ef8){var _0x5e8afc=[];_0x5e8afc['push'](createCmHopperPhone(_0x262e94[_0x1c90('0x97')]['id'],_0x262e94[_0x1c90('0x97')][_0x1c90('0xdd')]));Promise[_0x1c90('0x36')](_0x5e8afc)['then'](function(){return[0x1];})[_0x1c90('0x29')](respondWithResult(_0x509ef8,null));};exports[_0x1c90('0xde')]=function(_0x5b2ac8,_0x5670bb,_0x1bfaea){var _0x516a34={'raw':![],'where':{}};var _0x3b2c73={};var _0x2a0683={'count':0x0,'rows':[]};return db[_0x1c90('0x2f')]['findOne']({'where':{'id':_0x5b2ac8[_0x1c90('0x8d')]['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x5670bb,null))[_0x1c90('0x29')](function(_0x21e45b){if(_0x21e45b){_0x3b2c73[_0x1c90('0x37')]=_['keys'](db['CmHopper'][_0x1c90('0xc5')]);_0x3b2c73[_0x1c90('0x38')]=_['keys'](_0x5b2ac8[_0x1c90('0x38')]);_0x3b2c73[_0x1c90('0x3e')]=_[_0x1c90('0x39')](_0x3b2c73['model'],_0x3b2c73[_0x1c90('0x38')]);_0x516a34[_0x1c90('0x3b')]=_[_0x1c90('0x39')](_0x3b2c73[_0x1c90('0x37')],qs[_0x1c90('0x3a')](_0x5b2ac8[_0x1c90('0x38')][_0x1c90('0x3a')]));_0x516a34['attributes']=_0x516a34[_0x1c90('0x3b')]['length']?_0x516a34[_0x1c90('0x3b')]:_0x3b2c73['model'];if(!_0x5b2ac8[_0x1c90('0x38')][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x516a34[_0x1c90('0x20')]=qs['limit'](_0x5b2ac8['query']['limit']);_0x516a34[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x5b2ac8[_0x1c90('0x38')][_0x1c90('0x1f')]);}_0x516a34[_0x1c90('0x75')]=qs[_0x1c90('0xc6')](_0x5b2ac8[_0x1c90('0x38')][_0x1c90('0xc6')]);_0x516a34[_0x1c90('0x4b')]=qs['filters'](_[_0x1c90('0x3f')](_0x5b2ac8[_0x1c90('0x38')],_0x3b2c73['filters']));_0x516a34[_0x1c90('0x4b')][_0x1c90('0xdf')]=_0x21e45b['id'];if(_0x5b2ac8[_0x1c90('0x38')]['filter']){_0x516a34[_0x1c90('0x4b')]=_[_0x1c90('0x82')](_0x516a34['where'],{'$or':_[_0x1c90('0x52')](_0x516a34['attributes'],function(_0x2cad46){var _0x59b568={};_0x59b568[_0x2cad46]={'$like':'%'+_0x5b2ac8[_0x1c90('0x38')]['filter']+'%'};return _0x59b568;})});}_0x516a34=_[_0x1c90('0x82')]({},_0x516a34,_0x5b2ac8['options']);return db['CmHopper'][_0x1c90('0x22')]({'where':_0x516a34[_0x1c90('0x4b')]})[_0x1c90('0x29')](function(_0x2ff3bb){_0x2a0683[_0x1c90('0x22')]=_0x2ff3bb;if(_0x5b2ac8['query']['includeAll']){_0x516a34[_0x1c90('0xe0')]=[{'all':!![]}];}return db['CmHopper'][_0x1c90('0x92')](_0x516a34);})[_0x1c90('0x29')](function(_0x113544){_0x2a0683[_0x1c90('0x8c')]=_0x113544;return _0x2a0683;});}})[_0x1c90('0x29')](respondWithFilteredResult(_0x5670bb,_0x516a34))[_0x1c90('0x8e')](handleError(_0x5670bb,null));};exports[_0x1c90('0xe1')]=function(_0x21af02,_0x2e2ecc,_0x45508b){var _0x30bb07={'raw':!![],'where':{}};var _0x32ccea={};var _0x55e4c7={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x21af02['params']['id']}})[_0x1c90('0x29')](handleEntityNotFound(_0x2e2ecc,null))['then'](function(_0x23c889){if(_0x23c889){_0x32ccea['model']=_[_0x1c90('0x32')](db[_0x1c90('0xe2')][_0x1c90('0xc5')]);_0x32ccea['query']=_[_0x1c90('0x32')](_0x21af02['query']);_0x32ccea['filters']=_[_0x1c90('0x39')](_0x32ccea[_0x1c90('0x37')],_0x32ccea[_0x1c90('0x38')]);_0x30bb07[_0x1c90('0x3b')]=_[_0x1c90('0x39')](_0x32ccea[_0x1c90('0x37')],qs[_0x1c90('0x3a')](_0x21af02[_0x1c90('0x38')][_0x1c90('0x3a')]));_0x30bb07[_0x1c90('0x3b')]=_0x30bb07[_0x1c90('0x3b')][_0x1c90('0x31')]?_0x30bb07[_0x1c90('0x3b')]:_0x32ccea['model'];if(!_0x21af02[_0x1c90('0x38')][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x30bb07['limit']=qs[_0x1c90('0x20')](_0x21af02[_0x1c90('0x38')][_0x1c90('0x20')]);_0x30bb07[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x21af02[_0x1c90('0x38')][_0x1c90('0x1f')]);}_0x30bb07[_0x1c90('0x75')]=qs['sort'](_0x21af02[_0x1c90('0x38')][_0x1c90('0xc6')]);_0x30bb07['where']=qs['filters'](_['pick'](_0x21af02[_0x1c90('0x38')],_0x32ccea[_0x1c90('0x3e')]));_0x30bb07[_0x1c90('0x4b')][_0x1c90('0xdf')]=_0x23c889['id'];if(_0x21af02[_0x1c90('0x38')][_0x1c90('0x66')]){_0x30bb07['where']=_[_0x1c90('0x82')](_0x30bb07['where'],{'$or':_[_0x1c90('0x52')](_0x30bb07[_0x1c90('0x3b')],function(_0x1892d9){var _0x1f05d7={};_0x1f05d7[_0x1892d9]={'$like':'%'+_0x21af02[_0x1c90('0x38')][_0x1c90('0x66')]+'%'};return _0x1f05d7;})});}_0x30bb07=_['merge']({},_0x30bb07,_0x21af02['options']);return db[_0x1c90('0xe2')][_0x1c90('0x22')]({'where':_0x30bb07[_0x1c90('0x4b')]})[_0x1c90('0x29')](function(_0x57851f){_0x55e4c7[_0x1c90('0x22')]=_0x57851f;if(_0x21af02[_0x1c90('0x38')][_0x1c90('0xe3')]){_0x30bb07['include']=[{'all':!![]}];}return db[_0x1c90('0xe2')][_0x1c90('0x92')](_0x30bb07);})['then'](function(_0xf84ca8){_0x55e4c7[_0x1c90('0x8c')]=_0xf84ca8;return _0x55e4c7;});}})[_0x1c90('0x29')](respondWithFilteredResult(_0x2e2ecc,_0x30bb07))[_0x1c90('0x8e')](handleError(_0x2e2ecc,null));};exports[_0x1c90('0xe4')]=function(_0x3e8dfb,_0x1b64f7,_0x3d571d){var _0x10564d={'raw':!![],'where':{}};var _0x590ca2={};var _0x595110={'count':0x0,'rows':[]};return db[_0x1c90('0x2f')][_0x1c90('0x35')]({'where':{'id':_0x3e8dfb[_0x1c90('0x8d')]['id']}})['then'](handleEntityNotFound(_0x1b64f7,null))[_0x1c90('0x29')](function(_0x16ccef){if(_0x16ccef){_0x590ca2[_0x1c90('0x37')]=_[_0x1c90('0x32')](db[_0x1c90('0xa6')][_0x1c90('0xc5')]);_0x590ca2[_0x1c90('0x38')]=_[_0x1c90('0x32')](_0x3e8dfb['query']);_0x590ca2[_0x1c90('0x3e')]=_[_0x1c90('0x39')](_0x590ca2[_0x1c90('0x37')],_0x590ca2[_0x1c90('0x38')]);_0x10564d[_0x1c90('0x3b')]=_[_0x1c90('0x39')](_0x590ca2[_0x1c90('0x37')],qs[_0x1c90('0x3a')](_0x3e8dfb['query'][_0x1c90('0x3a')]));_0x10564d[_0x1c90('0x3b')]=_0x10564d[_0x1c90('0x3b')][_0x1c90('0x31')]?_0x10564d[_0x1c90('0x3b')]:_0x590ca2[_0x1c90('0x37')];if(!_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x10564d[_0x1c90('0x20')]=qs[_0x1c90('0x20')](_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0x20')]);_0x10564d[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0x1f')]);}_0x10564d[_0x1c90('0x75')]=qs[_0x1c90('0xc6')](_0x3e8dfb['query']['sort']);_0x10564d[_0x1c90('0x4b')]=qs[_0x1c90('0x3e')](_[_0x1c90('0x3f')](_0x3e8dfb[_0x1c90('0x38')],_0x590ca2[_0x1c90('0x3e')]));_0x10564d[_0x1c90('0x4b')][_0x1c90('0xdf')]=_0x16ccef['id'];if(_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0x66')]){_0x10564d[_0x1c90('0x4b')]=_['merge'](_0x10564d['where'],{'$or':_[_0x1c90('0x52')](_0x10564d[_0x1c90('0x3b')],function(_0x4d14ae){var _0x1f4cda={};_0x1f4cda[_0x4d14ae]={'$like':'%'+_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0x66')]+'%'};return _0x1f4cda;})});}_0x10564d=_['merge']({},_0x10564d,_0x3e8dfb[_0x1c90('0xc7')]);return db[_0x1c90('0xa6')][_0x1c90('0x22')]({'where':_0x10564d[_0x1c90('0x4b')]})[_0x1c90('0x29')](function(_0x418b5a){_0x595110['count']=_0x418b5a;if(_0x3e8dfb[_0x1c90('0x38')][_0x1c90('0xe3')]){_0x10564d[_0x1c90('0xe0')]=[{'all':!![]}];}return db[_0x1c90('0xa6')][_0x1c90('0x92')](_0x10564d);})[_0x1c90('0x29')](function(_0x24b11a){_0x595110[_0x1c90('0x8c')]=_0x24b11a;return _0x595110;});}})[_0x1c90('0x29')](respondWithFilteredResult(_0x1b64f7,_0x10564d))['catch'](handleError(_0x1b64f7,null));};exports['getJscriptySessions']=function(_0x21ce31,_0x40b728,_0x5c957a){var _0xe13c51={'raw':!![],'where':{}};var _0x2babf5={};var _0x1285bc={'count':0x0,'rows':[]};return db[_0x1c90('0x2f')][_0x1c90('0x35')]({'where':{'id':_0x21ce31[_0x1c90('0x8d')]['id']}})['then'](handleEntityNotFound(_0x40b728,null))['then'](function(_0x133fdb){if(_0x133fdb){_0x2babf5[_0x1c90('0x37')]=_[_0x1c90('0x32')](db[_0x1c90('0xac')]['rawAttributes']);_0x2babf5[_0x1c90('0x38')]=_['keys'](_0x21ce31[_0x1c90('0x38')]);_0x2babf5[_0x1c90('0x3e')]=_[_0x1c90('0x39')](_0x2babf5[_0x1c90('0x37')],_0x2babf5[_0x1c90('0x38')]);_0xe13c51[_0x1c90('0x3b')]=_[_0x1c90('0x39')](_0x2babf5[_0x1c90('0x37')],qs['fields'](_0x21ce31[_0x1c90('0x38')]['fields']));_0xe13c51['attributes']=_0xe13c51[_0x1c90('0x3b')]['length']?_0xe13c51[_0x1c90('0x3b')]:_0x2babf5['model'];if(!_0x21ce31[_0x1c90('0x38')][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0xe13c51[_0x1c90('0x20')]=qs[_0x1c90('0x20')](_0x21ce31[_0x1c90('0x38')][_0x1c90('0x20')]);_0xe13c51[_0x1c90('0x1f')]=qs[_0x1c90('0x1f')](_0x21ce31[_0x1c90('0x38')][_0x1c90('0x1f')]);}_0xe13c51[_0x1c90('0x75')]=qs[_0x1c90('0xc6')](_0x21ce31[_0x1c90('0x38')][_0x1c90('0xc6')]);_0xe13c51[_0x1c90('0x4b')]=qs[_0x1c90('0x3e')](_[_0x1c90('0x3f')](_0x21ce31[_0x1c90('0x38')],_0x2babf5['filters']));_0xe13c51['where'][_0x1c90('0xdf')]=_0x133fdb['id'];if(_0x21ce31['query'][_0x1c90('0x66')]){_0xe13c51[_0x1c90('0x4b')]=_[_0x1c90('0x82')](_0xe13c51[_0x1c90('0x4b')],{'$or':_['map'](_0xe13c51['attributes'],function(_0x38fc63){var _0x4cc789={};_0x4cc789[_0x38fc63]={'$like':'%'+_0x21ce31[_0x1c90('0x38')]['filter']+'%'};return _0x4cc789;})});}_0xe13c51=_[_0x1c90('0x82')]({},_0xe13c51,_0x21ce31[_0x1c90('0xc7')]);return db[_0x1c90('0xac')][_0x1c90('0x22')]({'where':_0xe13c51[_0x1c90('0x4b')]})[_0x1c90('0x29')](function(_0x1409b2){_0x1285bc[_0x1c90('0x22')]=_0x1409b2;if(_0x21ce31[_0x1c90('0x38')][_0x1c90('0xe3')]){_0xe13c51[_0x1c90('0xe0')]=[{'all':!![]}];}return db[_0x1c90('0xac')][_0x1c90('0x92')](_0xe13c51);})['then'](function(_0x26b614){_0x1285bc['rows']=_0x26b614;return _0x1285bc;});}})['then'](respondWithFilteredResult(_0x40b728,_0xe13c51))['catch'](handleError(_0x40b728,null));};exports[_0x1c90('0xe5')]=function(_0x1ab6ef,_0x55fbc7,_0x2c4f43){try{if(!_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0x60')]){throw new Error(_0x1c90('0xe6'));}if(!_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0xe7')]){throw new Error(_0x1c90('0xe8'));}if(!_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0xe9')]){throw new Error(_0x1c90('0xea'));}if(!_0x1ab6ef['body'][_0x1c90('0xeb')]){throw new Error(_0x1c90('0xec'));}var _0x2b268b=_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0xe7')][_0x1c90('0x68')](',');var _0x40c987=_0x1ab6ef['body'][_0x1c90('0xe9')][_0x1c90('0x68')](',');if(!_0x2b268b[_0x1c90('0x31')]||!_0x40c987[_0x1c90('0x31')]||_0x2b268b[_0x1c90('0x31')]!==_0x40c987[_0x1c90('0x31')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0x3a')]=_['zipObject'](_0x2b268b,_0x40c987);if(!_0x1ab6ef['body'][_0x1c90('0x3a')][_0x1c90('0xc3')]){throw new Error(_0x1c90('0xed'));}if(!_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0x3a')][_0x1c90('0xee')]){throw new Error(_0x1c90('0xef'));}var _0x15fdec=path[_0x1c90('0xf0')](config[_0x1c90('0xf1')],'server/files/tmp',_0x1ab6ef[_0x1c90('0xf2')][_0x1c90('0xf3')]);fs[_0x1c90('0xf4')](_0x15fdec,parseInt(_0x1c90('0xf5'),0x8));var _0x31d75=require(_0x1c90('0xf6'))[_0x1c90('0xf7')](path[_0x1c90('0xf0')](__dirname,_0x1c90('0xf8')),[_0x15fdec,_0x1ab6ef[_0x1c90('0x97')]['binding_keys'],_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0xe9')],_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0x60')],_0x1ab6ef['body'][_0x1c90('0xf9')],_0x1ab6ef['body'][_0x1c90('0xb2')],_0x1ab6ef[_0x1c90('0x97')][_0x1c90('0xeb')]]);return _0x55fbc7['status'](0xc8)['json']({'message':_0x1c90('0xfa'),'pid':_0x31d75[_0x1c90('0xfb')]});}catch(_0x35cb71){return _0x55fbc7[_0x1c90('0x1c')](0x1f4)[_0x1c90('0x2d')](_0x35cb71);}};exports[_0x1c90('0xfc')]=function(_0x342c8f,_0xd2af3d,_0x36c4ae){var _0x5e7ae6=fs[_0x1c90('0xfd')](_0x342c8f[_0x1c90('0xf2')]['path']);Papa['parse'](_0x5e7ae6,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x53fbf2){return _0xd2af3d[_0x1c90('0x1c')](0xc8)['json']({'file':_0x342c8f[_0x1c90('0xf2')],'fields':_0x53fbf2['meta'][_0x1c90('0x3a')]});}});};exports[_0x1c90('0xfe')]=function(_0x32423f,_0xc2d4c5,_0x22dfe4){return db[_0x1c90('0x7a')][_0x1c90('0x92')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0xff6c00){var _0x397bae=![];if(!_0x32423f['body'][_0x1c90('0x60')]){throw new Error(_0x1c90('0xe6'));}if(!_0x32423f['body'][_0x1c90('0xff')]['phone']){throw new Error(_0x1c90('0xed'));}if(!_0x32423f[_0x1c90('0x97')]['binding']['firstName']){throw new Error(_0x1c90('0xef'));}if(!_0x32423f[_0x1c90('0x97')][_0x1c90('0xeb')]){throw new Error(_0x1c90('0xec'));}var _0x1aeb4b=require(_0x1c90('0xf6'))['fork'](path[_0x1c90('0xf0')](__dirname,'../../components/import/cm/csv2'),[_0x32423f[_0x1c90('0x8d')]['id'],JSON[_0x1c90('0x100')](_0x32423f[_0x1c90('0x97')]),JSON[_0x1c90('0x100')](_0xff6c00)]);_0x1aeb4b['on'](_0x1c90('0x101'),function(_0x3e0cb8){_0x397bae=!![];return _0xc2d4c5[_0x1c90('0x1c')](0xc8)[_0x1c90('0x1e')]({'message':_0x1c90('0x102'),'pid':_0x1aeb4b[_0x1c90('0xfb')]});});_0x1aeb4b['on'](_0x1c90('0x103'),function(_0x39db48){if(_0x39db48&&!_0x397bae){return _0xc2d4c5[_0x1c90('0x1c')](0x1f4)[_0x1c90('0x1e')]({'message':_0x1c90('0x104'),'pid':_0x1aeb4b[_0x1c90('0xfb')]});}});})[_0x1c90('0x8e')](handleError(_0xc2d4c5,null));};exports['importUpdates']=function(_0x41b784,_0x3f9f55,_0x56d70a){return db[_0x1c90('0x7a')][_0x1c90('0x92')]({'raw':!![],'attributes':['id'],'where':{'role':_0x1c90('0x7f')}})[_0x1c90('0x29')](function(_0x4c34c3){var _0x2bc04e=![];if(!_0x41b784[_0x1c90('0x97')]['ListId']){throw new Error(_0x1c90('0xe6'));}if(!_0x41b784[_0x1c90('0x97')][_0x1c90('0xff')][_0x1c90('0xc3')]){throw new Error(_0x1c90('0xed'));}if(!_0x41b784[_0x1c90('0x97')][_0x1c90('0xff')][_0x1c90('0xee')]){throw new Error(_0x1c90('0xef'));}if(!_0x41b784[_0x1c90('0x97')][_0x1c90('0xeb')]){throw new Error(_0x1c90('0xec'));}var _0x31d389=require(_0x1c90('0xf6'))[_0x1c90('0xf7')](path[_0x1c90('0xf0')](__dirname,_0x1c90('0x105')),[_0x41b784[_0x1c90('0x8d')]['id'],JSON[_0x1c90('0x100')](_0x41b784[_0x1c90('0x97')]),JSON['stringify'](_0x4c34c3)]);_0x31d389['on']('message',function(_0x2cc7d7){_0x2bc04e=!![];return _0x3f9f55[_0x1c90('0x1c')](0xc8)[_0x1c90('0x1e')]({'message':_0x1c90('0x102'),'pid':_0x31d389[_0x1c90('0xfb')]});});_0x31d389['on']('exit',function(_0x19fe4b){if(_0x19fe4b&&!_0x2bc04e){return _0x3f9f55[_0x1c90('0x1c')](0x1f4)[_0x1c90('0x1e')]({'message':_0x1c90('0x104'),'pid':_0x31d389[_0x1c90('0xfb')]});}});})[_0x1c90('0x8e')](handleError(_0x3f9f55,null));};exports[_0x1c90('0x106')]=function(_0x5c7579,_0x4f068c){var _0x5df9da=[_0x1c90('0x107'),_0x1c90('0x108'),_0x1c90('0x109'),_0x1c90('0x10a'),_0x1c90('0x10b'),_0x1c90('0x10c'),_0x1c90('0x10d')];var _0x390f1d={'offset':0x0,'order':qs[_0x1c90('0xc6')]('-createdAt')},_0x12ec48={'count':0x0,'rows':[]};Promise[_0x1c90('0x78')]()['then'](function(){if(_0x5c7579[_0x1c90('0x38')][_0x1c90('0x10e')]){if(!_['includes'](_0x5df9da,_0x5c7579[_0x1c90('0x38')][_0x1c90('0x10e')][_0x1c90('0x10f')]())){throw new Error(_0x1c90('0x110'));}_0x5df9da=[_0x5c7579[_0x1c90('0x38')][_0x1c90('0x10e')][_0x1c90('0x10f')]()];}if(_0x5c7579['query'][_0x1c90('0x111')]){try{var _0x2ac623=JSON['parse'](_0x5c7579[_0x1c90('0x38')][_0x1c90('0x111')]);if(!moment(_0x2ac623[_0x1c90('0x42')])[_0x1c90('0x112')]()){throw new Error(_0x1c90('0x113'));}if(!moment(_0x2ac623['to'])['isValid']()){throw new Error(_0x1c90('0x114'));}}catch(_0x10c2dd){throw new Error(_0x1c90('0x115'));}}if(!_0x5c7579['query'][_0x1c90('0x3c')](_0x1c90('0x3d'))){_0x390f1d[_0x1c90('0x20')]=qs[_0x1c90('0x20')](_0x5c7579[_0x1c90('0x38')]['limit']||0xa);_0x390f1d['offset']=qs[_0x1c90('0x1f')](_0x5c7579[_0x1c90('0x38')][_0x1c90('0x1f')]);}var _0x3ef6bd=_0x5df9da[_0x1c90('0x52')](function(_0xe2f451){if(_0xe2f451===_0x1c90('0x10d')){var _0x4a998f={'attributes':['id',_0x1c90('0x116'),_0x1c90('0x95'),_0x1c90('0x117'),_0x1c90('0x118'),_0x1c90('0x119'),_0x1c90('0x11a'),_0x1c90('0x11b'),'duration',_0x1c90('0x11c'),_0x1c90('0x11d'),_0x1c90('0x11e'),_0x1c90('0x11f'),_0x1c90('0x120'),_0x1c90('0x121')],'where':{'ContactId':_0x5c7579[_0x1c90('0x8d')]['id']},'include':[{'model':db[_0x1c90('0x7a')],'as':_0x1c90('0x7a'),'attributes':['id',_0x1c90('0x2c'),_0x1c90('0x122'),_0x1c90('0x93')]}],'order':[['createdAt','DESC']]};if(_0x5c7579['query'][_0x1c90('0x111')]){_0x4a998f[_0x1c90('0x4b')][_0x1c90('0x11d')]={'$gte':_0x2ac623[_0x1c90('0x42')],'$lte':_0x2ac623['to']};}return db[_0x1c90('0xa8')][_0x1c90('0x123')](_0x4a998f)[_0x1c90('0x29')](function(_0x31c03f){_0x12ec48[_0x1c90('0x22')]+=_0x31c03f[_0x1c90('0x22')];return _[_0x1c90('0x52')](_0x31c03f[_0x1c90('0x8c')],function(_0x1dc95d){var _0x2c9ed5=_0x1dc95d[_0x1c90('0x98')]({'plain':!![]});_0x2c9ed5[_0x1c90('0x10e')]=_0xe2f451;if(_0x2c9ed5[_0x1c90('0x7a')]){_0x2c9ed5[_0x1c90('0x7a')]={'id':_0x2c9ed5[_0x1c90('0x7a')]['id'],'name':_0x2c9ed5[_0x1c90('0x7a')][_0x1c90('0x2c')],'fullname':_0x2c9ed5[_0x1c90('0x7a')]['fullname'],'alias':_0x2c9ed5[_0x1c90('0x7a')][_0x1c90('0x93')]};}return _0x2c9ed5;});});}else{var _0x4c4310=_[_0x1c90('0x124')](_0xe2f451)+(_0xe2f451===_0x1c90('0x108')?_0x1c90('0x125'):_0x1c90('0x126'));var _0x272f82={'attributes':['id',_0x1c90('0x127'),_0x1c90('0x128'),_0x1c90('0x11d'),_0x1c90('0x11c'),'disposition',_0x1c90('0x129'),_0x1c90('0x12a'),_0x1c90('0x121'),_0x4c4310+'Id'],'where':{'ContactId':_0x5c7579[_0x1c90('0x8d')]['id']},'include':[{'model':db[_0x4c4310],'as':_0x1c90('0x126'),'attributes':['id',_0x1c90('0x2c'),'key']},{'model':db[_0x1c90('0x7a')],'as':_0x1c90('0x12b'),'attributes':['id','name',_0x1c90('0x122')]},{'model':db['Tag'],'as':_0x1c90('0x8b'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[['createdAt',_0x1c90('0x76')]]};if(_0x5c7579[_0x1c90('0x38')][_0x1c90('0x111')]){_0x272f82[_0x1c90('0x4b')][_0x1c90('0x11d')]={'$gte':_0x2ac623[_0x1c90('0x42')],'$lte':_0x2ac623['to']};}switch(_0xe2f451){case'chat':_0x272f82[_0x1c90('0x3b')]['push'](_0x1c90('0x12c'),_0x1c90('0x12d'),_0x1c90('0x12e'),_0x1c90('0x12f'),_0x1c90('0x130'),_0x1c90('0x131'),'ratingType',_0x1c90('0x132'),_0x1c90('0x133'));break;case _0x1c90('0x107'):_0x272f82[_0x1c90('0x3b')][_0x1c90('0x5d')](_0x1c90('0x134'),_0x1c90('0x135'));break;case _0x1c90('0x10a'):_0x272f82[_0x1c90('0x3b')][_0x1c90('0x5d')](_0x1c90('0x136'),_0x1c90('0x137'));break;}return db[_[_0x1c90('0x124')](_0xe2f451)+_0x1c90('0x138')][_0x1c90('0x123')](_0x272f82)[_0x1c90('0x29')](function(_0x2cdd03){_0x12ec48[_0x1c90('0x22')]+=_0x2cdd03[_0x1c90('0x22')];return _[_0x1c90('0x52')](_0x2cdd03['rows'],function(_0x4bfc10){var _0x3766bc=_0x4bfc10[_0x1c90('0x98')]({'plain':!![]});_0x3766bc[_0x1c90('0x10e')]=_0xe2f451;if(_0x3766bc['Owner']){_0x3766bc[_0x1c90('0x12b')]={'id':_0x3766bc[_0x1c90('0x12b')]['id'],'name':_0x3766bc[_0x1c90('0x12b')][_0x1c90('0x2c')],'fullname':_0x3766bc['Owner'][_0x1c90('0x122')]};}return _0x3766bc;});});}});return Promise[_0x1c90('0x36')](_0x3ef6bd);})[_0x1c90('0x29')](function(_0x5efb4b){return _(_0x5efb4b)[_0x1c90('0x139')]()['sortBy']('createdAt')['reverse']()[_0x1c90('0x5b')]();})[_0x1c90('0x29')](function(_0x6667ca){_0x12ec48[_0x1c90('0x8c')]=_0x390f1d[_0x1c90('0x20')]?_0x6667ca[_0x1c90('0x13a')](_0x390f1d[_0x1c90('0x1f')],_0x390f1d[_0x1c90('0x1f')]+_0x390f1d[_0x1c90('0x20')]):_0x6667ca;return _0x12ec48;})[_0x1c90('0x29')](respondWithFilteredResult(_0x4f068c,_0x390f1d))[_0x1c90('0x8e')](handleError(_0x4f068c,null));};
\ No newline at end of file
+var _0x02a7=['hopperId','getHoppers','rawAttributes','pick','ContactId','includeAll','include','getHopperHistories','options','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','agent','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','voice','-createdAt','channel','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','substatus','openchannel','externalUrl','Interaction','flatten','reverse','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','fields','attributes','hasOwnProperty','order','sort','where','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','dateOfBirth','buildExpression','text','map','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','User','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','find','catch','columnName','displayName','values','body','findAll','get','mergeWith','tags','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','create','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','additionalPhones','error','contact','show','color','params','ContactItemType','literal','`Phones.ItemType`.OrderBy','log','$and','omit','cf_%d','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','intersection','getTags','nolimit','setTags','setAdditionalPhones','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','OrderBy','ItemType','CmHopperId','ItemType.OrderBy','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','toContactId'];(function(_0x1798cb,_0xafe39f){var _0x4a68ed=function(_0x2e9265){while(--_0x2e9265){_0x1798cb['push'](_0x1798cb['shift']());}};_0x4a68ed(++_0xafe39f);}(_0x02a7,0x1a6));var _0x702a=function(_0xf030b0,_0x57a531){_0xf030b0=_0xf030b0-0x0;var _0x85e6eb=_0x02a7[_0xf030b0];return _0x85e6eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require(_0x702a('0x1'));var jsonpatch=require(_0x702a('0x2'));var rp=require(_0x702a('0x3'));var moment=require(_0x702a('0x4'));var BPromise=require(_0x702a('0x5'));var Mustache=require(_0x702a('0x6'));var util=require(_0x702a('0x7'));var path=require(_0x702a('0x8'));var sox=require(_0x702a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x702a('0xa'));var _=require('lodash');var squel=require(_0x702a('0xb'));var crypto=require(_0x702a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x702a('0xd'));var Redis=require(_0x702a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x702a('0xf'));var as=require(_0x702a('0x10'));var hardwareService=require(_0x702a('0x11'));var logger=require(_0x702a('0x12'))(_0x702a('0x13'));var utils=require(_0x702a('0x14'));var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require('../../mysqldb')['db'];config[_0x702a('0x17')]=_[_0x702a('0x18')](config[_0x702a('0x17')],{'host':_0x702a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x702a('0x17')]));require(_0x702a('0x1a'))[_0x702a('0x1b')](socket);function respondWithStatusCode(_0xcf5544,_0x456a3d){_0x456a3d=_0x456a3d||0xcc;return function(_0x5a90a6){if(_0x5a90a6){return _0xcf5544[_0x702a('0x1c')](_0x456a3d);}return _0xcf5544[_0x702a('0x1d')](_0x456a3d)[_0x702a('0x1e')]();};}function respondWithResult(_0x3c8657,_0x434d28){_0x434d28=_0x434d28||0xc8;return function(_0x448b74){if(_0x448b74){return _0x3c8657[_0x702a('0x1d')](_0x434d28)['json'](_0x448b74);}};}function respondWithFilteredResult(_0x59acf9,_0x18b5e9){return function(_0x340dc2){if(_0x340dc2){var _0x2071ad=typeof _0x18b5e9[_0x702a('0x1f')]===_0x702a('0x20')&&typeof _0x18b5e9['limit']===_0x702a('0x20');var _0x3d9506=_0x340dc2[_0x702a('0x21')];var _0x954720=_0x2071ad?0x0:_0x18b5e9[_0x702a('0x1f')];var _0x4e2451=_0x2071ad?_0x340dc2['count']:_0x18b5e9['offset']+_0x18b5e9[_0x702a('0x22')];var _0x5228c6;if(_0x4e2451>=_0x3d9506){_0x4e2451=_0x3d9506;_0x5228c6=0xc8;}else{_0x5228c6=0xce;}_0x59acf9[_0x702a('0x1d')](_0x5228c6);return _0x59acf9[_0x702a('0x23')]('Content-Range',_0x954720+'-'+_0x4e2451+'/'+_0x3d9506)[_0x702a('0x24')](_0x340dc2);}return null;};}function patchUpdates(_0x25f0ff){return function(_0x110f83){try{jsonpatch[_0x702a('0x25')](_0x110f83,_0x25f0ff,!![]);}catch(_0x7ae85e){return BPromise['reject'](_0x7ae85e);}return _0x110f83[_0x702a('0x26')]();};}function saveUpdates(_0x544be5,_0x5e6cce){return function(_0x57d897){if(_0x57d897){return _0x57d897[_0x702a('0x27')](_0x544be5)[_0x702a('0x28')](function(_0x54d370){return _0x54d370;});}return null;};}function removeEntity(_0x3a77c5,_0x29ae0f){return function(_0x418eab){if(_0x418eab){return _0x418eab[_0x702a('0x29')]()[_0x702a('0x28')](function(){_0x3a77c5[_0x702a('0x1d')](0xcc)[_0x702a('0x1e')]();});}};}function handleEntityNotFound(_0x7a3176,_0x3e47ac){return function(_0x2c34b2){if(!_0x2c34b2){_0x7a3176['sendStatus'](0x194);}return _0x2c34b2;};}function handleError(_0x456daa,_0x525a7d){_0x525a7d=_0x525a7d||0x1f4;return function(_0x198f97){logger['error'](_0x198f97[_0x702a('0x2a')]);if(_0x198f97[_0x702a('0x2b')]){delete _0x198f97[_0x702a('0x2b')];}_0x456daa['status'](_0x525a7d)[_0x702a('0x2c')](_0x198f97);};}exports[_0x702a('0x2d')]=function(_0x26e1d1,_0x5b69c5){var _0x15ca67={},_0x5a22ab={},_0x28cbf1={'count':0x0,'rows':[]};return db[_0x702a('0x2e')][_0x702a('0x2f')]()['then'](function(_0x33b5ea){var _0x4235af=[];for(var _0xe63007=0x0;_0xe63007<Object[_0x702a('0x30')](_0x33b5ea)[_0x702a('0x31')];_0xe63007++){var _0x22cd74=Object[_0x702a('0x30')](_0x33b5ea)[_0xe63007];if(_[_0x702a('0x32')](_0x22cd74,_0x702a('0x33'))){_0x4235af[_0x702a('0x34')](db[_0x702a('0x35')][_0x702a('0x36')]({'where':{'id':_[_0x702a('0x37')](_0x22cd74,'cf_')},'raw':!![]}));}}return BPromise[_0x702a('0x38')](_0x4235af)[_0x702a('0x28')](function(_0x502a61){for(var _0x2e134f=0x0;_0x2e134f<_0x502a61['length'];_0x2e134f++){if(_0x502a61[_0x2e134f]){var _0x179d5b=_0x702a('0x33')+_0x502a61[_0x2e134f]['id'];var _0x41405c=_0x33b5ea[_0x179d5b];_0x41405c[_0x702a('0x39')]=_0x502a61[_0x2e134f][_0x702a('0x3a')];}}return _0x33b5ea;});})['then'](function(_0xdab757){_0x5a22ab[_0x702a('0x3b')]=_[_0x702a('0x30')](_0xdab757);_0x5a22ab[_0x702a('0x3c')]=_[_0x702a('0x30')](_0x26e1d1[_0x702a('0x3c')]);_0x5a22ab[_0x702a('0x3d')]=_['intersection'](_0x5a22ab[_0x702a('0x3b')],_0x5a22ab[_0x702a('0x3c')]);_0x15ca67['attributes']=_['intersection'](_0x5a22ab['model'],qs[_0x702a('0x3e')](_0x26e1d1[_0x702a('0x3c')][_0x702a('0x3e')]));_0x15ca67[_0x702a('0x3f')]=_0x15ca67[_0x702a('0x3f')][_0x702a('0x31')]?_0x15ca67[_0x702a('0x3f')]:_0x5a22ab[_0x702a('0x3b')];if(!_0x26e1d1[_0x702a('0x3c')][_0x702a('0x40')]('nolimit')){_0x15ca67[_0x702a('0x22')]=qs[_0x702a('0x22')](_0x26e1d1[_0x702a('0x3c')][_0x702a('0x22')]);_0x15ca67[_0x702a('0x1f')]=qs[_0x702a('0x1f')](_0x26e1d1['query']['offset']);}_0x15ca67[_0x702a('0x41')]=qs[_0x702a('0x42')](_0x26e1d1['query']['sort']);_0x15ca67[_0x702a('0x43')]=qs[_0x702a('0x3d')](_['pick'](_0x26e1d1[_0x702a('0x3c')],_0x5a22ab[_0x702a('0x3d')]),_0xdab757);var _0x2a834e=[];var _0x85610f=squel[_0x702a('0x44')]()[_0x702a('0x45')]('id')[_0x702a('0x45')](_0x702a('0x2b'))[_0x702a('0x45')]('color')[_0x702a('0x46')](_0x702a('0x47'));var _0x4dfb51=squel['select']()['from'](_0x702a('0x48'),'c')[_0x702a('0x49')](_0x702a('0x4a'),'uc','uc.CmContactId\x20=\x20c.id')['left_join']('cm_contact_has_tags','ct',_0x702a('0x4b'))['left_join'](_0x702a('0x47'),'t',_0x702a('0x4c'))[_0x702a('0x43')]('c.deletedAt\x20IS\x20NULL');var _0x46a3d0=squel[_0x702a('0x4d')]();var _0x456826=[];var _0x32b062=squel[_0x702a('0x4d')]();var _0x56af44;if(_0x26e1d1[_0x702a('0x3c')][_0x702a('0x4e')]){_0x56af44=as[_0x702a('0x4f')](_0x26e1d1[_0x702a('0x3c')]['search']);var _0x4c4d43=_0x56af44[_0x702a('0x50')];for(var _0x48044d=0x0;_0x48044d<_0x56af44[_0x702a('0x51')][_0x702a('0x31')];_0x48044d++){var _0x5592e9=_0x56af44[_0x702a('0x51')][_0x48044d];var _0x44612a='c';var _0x38802a=_(_0xdab757)['keys']()['find'](function(_0x55782a){return _0x55782a===_0x5592e9[_0x702a('0x45')];});if(_0x38802a)_0x38802a=_0xdab757[_0x5592e9['field']];if(!_0x38802a){if(_0x5592e9[_0x702a('0x45')]===_0x702a('0x52')){var _0x5b90e2=_0x5592e9[_0x702a('0x53')][_0x702a('0x54')](',')['map'](function(_0x157e64){return Number(_0x157e64);});_0x5b90e2[_0x702a('0x55')](function(_0x17bd84){_0x32b062['or'](_0x702a('0x56'),'%,'+_0x17bd84+',%');});_0x456826=_[_0x702a('0x57')](_0x456826,_0x5b90e2);}else if(_0x5592e9[_0x702a('0x45')]==='User'){_0x46a3d0['and'](_0x702a('0x58'),_0x5592e9[_0x702a('0x53')]);}}else{if(_0x5592e9[_0x702a('0x45')]===_0x702a('0x59')||_0x38802a[_0x702a('0x39')]==='datetime')_0x5592e9['castTo']='DATE';var _0x27101c=as[_0x702a('0x5a')](_0x44612a,_0x38802a['type'],_0x5592e9);_0x46a3d0[_0x4c4d43](_0x27101c[_0x702a('0x5b')],_0x27101c[_0x702a('0x53')]['start'],_0x27101c[_0x702a('0x53')][_0x702a('0x1e')]);}}}else{var _0x36a1db=_(Object[_0x702a('0x30')](_0x26e1d1[_0x702a('0x3c')]))[_0x702a('0x5c')](function(_0x35f4fd){return _0xdab757[_0x702a('0x40')](_0x35f4fd)?_0x35f4fd:undefined;})[_0x702a('0x5d')](function(_0x2d5aaa){return!_[_0x702a('0x5e')](_0x2d5aaa);})[_0x702a('0x53')]();if(_0x26e1d1['query'][_0x702a('0x5f')])_0x36a1db[_0x702a('0x34')](_0x702a('0x5f'));if(!_[_0x702a('0x60')](_0x36a1db)){_0x36a1db[_0x702a('0x55')](function(_0x4c6185){if(_0x4c6185===_0x702a('0x61')){_0x4dfb51[_0x702a('0x43')](_0x702a('0x62'),[]['concat'](_0x26e1d1[_0x702a('0x3c')][_0x4c6185]));}else if(_0x4c6185===_0x702a('0x5f')){var _0x5bfeed='%'+_0x26e1d1['query'][_0x4c6185]+'%';_0x4dfb51[_0x702a('0x43')](_0x702a('0x63'),_0x5bfeed);}else{_0x4dfb51[_0x702a('0x43')]('c.'+_0x4c6185+_0x702a('0x64'),_0x26e1d1[_0x702a('0x3c')][_0x4c6185]);}});}if(_0x26e1d1[_0x702a('0x3c')][_0x702a('0x65')]){_0x456826=_[_0x702a('0x66')](_0x26e1d1['query'][_0x702a('0x65')])?_0x26e1d1[_0x702a('0x3c')][_0x702a('0x65')]:new Array(_0x26e1d1[_0x702a('0x3c')][_0x702a('0x65')]);_0x456826['forEach'](function(_0x57bca6){_0x32b062['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x57bca6+',%');});}if(_0x26e1d1['query']['filter']){var _0xe9a7ff=_0x26e1d1['query'][_0x702a('0x5d')][_0x702a('0x67')]('\x5c','\x5c\x5c')[_0x702a('0x67')](/'/g,'\x27\x27');if(_0xe9a7ff[_0x702a('0x54')]('\x20')[_0x702a('0x31')]>0x1){_0x46a3d0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x702a('0x68')](_0xe9a7ff),null);}else{if(qs[_0x702a('0x69')](_0xe9a7ff)){_0x46a3d0['or'](_0x702a('0x6a'),_0xe9a7ff+'%');_0x46a3d0['or'](_0x702a('0x6b'),_0xe9a7ff+'%');_0x46a3d0['or'](_0x702a('0x6c'),_0xe9a7ff+'%');_0x46a3d0['or'](_0x702a('0x6d'),_0xe9a7ff+'%');}else if(qs[_0x702a('0x6e')](_0xe9a7ff)){_0x46a3d0['or'](_0x702a('0x6f'),_0xe9a7ff+'%');}else{_0x46a3d0['or']('c.firstName\x20LIKE\x20?','%'+_0xe9a7ff+'%');_0x46a3d0['or'](_0x702a('0x70'),'%'+_0xe9a7ff+'%');_0x46a3d0['or'](_0x702a('0x6f'),'%'+_0xe9a7ff+'%');}}}}_0x4dfb51[_0x702a('0x43')](_0x46a3d0);_0x4dfb51[_0x702a('0x71')](_0x702a('0x72'));var _0x8ae11d={'type':db[_0x702a('0x73')][_0x702a('0x74')][_0x702a('0x75')],'raw':!![]};var _0x4a6b27=_0x4dfb51['clone']()[_0x702a('0x45')]('c.id');if(_0x15ca67[_0x702a('0x41')]){_0x15ca67[_0x702a('0x41')][_0x702a('0x55')](function(_0x1845f0){_0x4dfb51['order']('c.'+_0x1845f0[0x0],_0x1845f0[0x1]===_0x702a('0x76')?![]:!![]);});}if(!_[_0x702a('0x60')](_0x456826)){_0x4dfb51[_0x702a('0x77')](_0x32b062);_0x4a6b27[_0x702a('0x43')](_0x702a('0x78'),_0x456826);}BPromise[_0x702a('0x79')]()[_0x702a('0x28')](function(){if(!_0x56af44)return;if(_0x26e1d1[_0x702a('0x7a')][_0x702a('0x7b')]!=='agent')return;if(!_[_0x702a('0x7c')](_0x56af44[_0x702a('0x51')],['field',_0x702a('0x7d')])){return _0x26e1d1[_0x702a('0x7a')][_0x702a('0x7e')]({'attributes':['id'],'raw':!![]})[_0x702a('0x28')](function(_0x20f077){if(_[_0x702a('0x60')](_0x20f077)){_0x4a6b27[_0x702a('0x43')](_0x702a('0x7f'));_0x4dfb51[_0x702a('0x43')](_0x702a('0x7f'));}else{_0x4a6b27['where']('c.ListId\x20IN\x20?',_[_0x702a('0x5c')](_0x20f077,'id'));_0x4dfb51[_0x702a('0x43')](_0x702a('0x62'),_['map'](_0x20f077,'id'));}});}})[_0x702a('0x28')](function(){if(_0x26e1d1[_0x702a('0x7a')][_0x702a('0x7b')]==='agent'&&!_0x56af44&&!_0x26e1d1[_0x702a('0x3c')]['ListId'])return[];return db[_0x702a('0x80')][_0x702a('0x3c')](_0x4a6b27[_0x702a('0x81')](),_0x8ae11d);})[_0x702a('0x28')](function(_0x127642){_0x28cbf1[_0x702a('0x21')]=_0x127642['length'];if(_0x28cbf1[_0x702a('0x21')]===0x0)return[];return db[_0x702a('0x80')][_0x702a('0x3c')](_0x85610f[_0x702a('0x81')](),_0x8ae11d)[_0x702a('0x28')](function(_0x217a84){_0x2a834e=_[_0x702a('0x82')](_0x217a84,'id');_0x8ae11d=_[_0x702a('0x83')](_0x8ae11d,{'model':db[_0x702a('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x26e1d1[_0x702a('0x3c')][_0x702a('0x3e')]){_0x15ca67[_0x702a('0x3f')][_0x702a('0x55')](function(_0x58c7f2){_0x4dfb51[_0x702a('0x45')]('c.'+_0x58c7f2);});}else{_0x4dfb51[_0x702a('0x45')](_0x702a('0x72'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x84'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x85'));_0x4dfb51[_0x702a('0x45')]('c.phone');_0x4dfb51[_0x702a('0x45')]('c.mobile');_0x4dfb51[_0x702a('0x45')](_0x702a('0x86'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x87'));_0x4dfb51[_0x702a('0x45')]('c.ListId');_0x4dfb51[_0x702a('0x45')](_0x702a('0x88'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x89'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x8a'));_0x4dfb51[_0x702a('0x45')](_0x702a('0x8b'),_0x702a('0x8c'));}if(_0x15ca67[_0x702a('0x22')])_0x4dfb51['limit'](_0x15ca67['limit']);if(_0x15ca67['offset'])_0x4dfb51['offset'](_0x15ca67[_0x702a('0x1f')]);return db[_0x702a('0x80')][_0x702a('0x3c')](_0x4dfb51['toString'](),_0x8ae11d);});})['then'](function(_0x9e7c50){_0x9e7c50[_0x702a('0x55')](function(_0x51916a){if(_0x51916a[_0x702a('0x8c')]){_0x51916a[_0x702a('0x8d')]=[];_0x51916a[_0x702a('0x8c')][_0x702a('0x54')](',')[_0x702a('0x55')](function(_0x3074fc){_0x51916a[_0x702a('0x8d')][_0x702a('0x34')](_0x2a834e[_0x3074fc]);});}delete _0x51916a[_0x702a('0x8c')];});_0x28cbf1[_0x702a('0x8e')]=_0x9e7c50;return _0x28cbf1;})['then'](respondWithFilteredResult(_0x5b69c5,_0x15ca67));})['catch'](handleError(_0x5b69c5,null));};exports[_0x702a('0x29')]=function(_0x5724ce,_0xb8740a){return db[_0x702a('0x2e')][_0x702a('0x8f')]({'where':{'id':_0x5724ce['params']['id']}})[_0x702a('0x28')](handleEntityNotFound(_0xb8740a,null))[_0x702a('0x28')](removeEntity(_0xb8740a,null))[_0x702a('0x90')](handleError(_0xb8740a,null));};exports['describe']=function(_0x3d7cf8,_0x2a79e0){return db[_0x702a('0x2e')][_0x702a('0x2f')]()[_0x702a('0x28')](function(_0x23263f){delete _0x23263f['tags'];for(var _0x5ad3d3=0x0;_0x5ad3d3<Object['keys'](_0x23263f)[_0x702a('0x31')];_0x5ad3d3++){var _0x4bda1c=Object[_0x702a('0x30')](_0x23263f)[_0x5ad3d3];if(!_[_0x702a('0x32')](_0x4bda1c,_0x702a('0x33'))){_0x23263f[_0x4bda1c][_0x702a('0x91')]=_0x4bda1c;_0x23263f[_0x4bda1c]['displayName']=_0x4bda1c;}}return _0x23263f;})['then'](function(_0x2b5d47){var _0x5d884d={'where':{'$or':[{'ListId':_0x3d7cf8[_0x702a('0x3c')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x702a('0x35')]['findAll'](_0x5d884d)[_0x702a('0x28')](function(_0x5cf202){for(var _0x4cf8b7=0x0;_0x4cf8b7<_0x5cf202[_0x702a('0x31')];_0x4cf8b7++){var _0x52693f=_0x702a('0x33')+_0x5cf202[_0x4cf8b7]['id'];_0x2b5d47[_0x52693f][_0x702a('0x91')]=_0x52693f;_0x2b5d47[_0x52693f][_0x702a('0x92')]=_0x5cf202[_0x4cf8b7]['alias'];_0x2b5d47[_0x52693f]['custom']={'type':_0x5cf202[_0x4cf8b7][_0x702a('0x3a')],'values':_0x5cf202[_0x4cf8b7][_0x702a('0x93')]};}Object[_0x702a('0x30')](_0x2b5d47)[_0x702a('0x55')](function(_0x2ee4e7){if(!_0x2b5d47[_0x2ee4e7][_0x702a('0x40')](_0x702a('0x91'))){delete _0x2b5d47[_0x2ee4e7];}});return _0x2b5d47;});})['then'](respondWithResult(_0x2a79e0,null))['catch'](handleError(_0x2a79e0,null));};exports[_0x702a('0x83')]=function(_0x418ef9,_0x499dc3){var _0x9c5b40;var _0xa615d7;var _0x4dd0c7;if(_0x418ef9[_0x702a('0x94')]['id']){delete _0x418ef9[_0x702a('0x94')]['id'];}return db['CmContact'][_0x702a('0x95')]({'where':{'id':[_0x418ef9[_0x702a('0x94')]['to'],_0x418ef9[_0x702a('0x94')]['from']]}})[_0x702a('0x28')](function(_0x3ffb12){if(_0x3ffb12){if(_0x3ffb12[_0x702a('0x31')]!==0x2){return null;}_0x3ffb12[0x0]=_0x3ffb12[0x0][_0x702a('0x96')]({'plain':!![]});_0x3ffb12[0x1]=_0x3ffb12[0x1][_0x702a('0x96')]({'plain':!![]});delete _0x3ffb12[0x0]['id'];delete _0x3ffb12[0x1]['id'];return _[_0x702a('0x97')](_0x3ffb12[0x0],_0x3ffb12[0x1],function(_0x3bc144,_0xe9638b){if(Array[_0x702a('0x66')](_0xe9638b)&&!_0xe9638b[_0x702a('0x31')]){return _0x3bc144;}else if(!_0xe9638b){return _0x3bc144;}});}})['then'](handleEntityNotFound(_0x499dc3,null))[_0x702a('0x28')](function(_0x2a2592){if(_0x2a2592){if(_0x2a2592[_0x702a('0x98')]&&_[_0x702a('0x66')](_0x2a2592[_0x702a('0x98')])){_0x2a2592['tags']=_0x2a2592[_0x702a('0x98')][_0x702a('0x99')]();}logger['info']('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x418ef9[_0x702a('0x94')]['to'],_0x418ef9[_0x702a('0x94')][_0x702a('0x46')]);return db[_0x702a('0x9a')][_0x702a('0x29')]({'where':{'ContactId':[_0x418ef9[_0x702a('0x94')]['to'],_0x418ef9[_0x702a('0x94')][_0x702a('0x46')]]}})['then'](function(_0x20a54b){logger['info'](_0x702a('0x9b'),_0x20a54b);return db['CmHopperBlack'][_0x702a('0x29')]({'where':{'ContactId':[_0x418ef9['body']['to'],_0x418ef9[_0x702a('0x94')][_0x702a('0x46')]]}})['then'](function(_0x5e3c47){logger[_0x702a('0x9c')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x5e3c47);return db[_0x702a('0x2e')][_0x702a('0x9d')](_0x2a2592);});});}})[_0x702a('0x28')](function(_0x111b27){if(_0x111b27){_0x9c5b40=_0x111b27;_0xa615d7={'ContactId':_0x9c5b40['id']};_0x4dd0c7={'where':{'ContactId':[_0x418ef9['body']['to'],_0x418ef9['body']['from']]}};return db['ChatInteraction']['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0x9e')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0x9f')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db['MailInteraction'][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})['then'](function(){if(_0x9c5b40){return db[_0x702a('0xa0')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa1')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})['then'](function(){if(_0x9c5b40){return db['MailMessage'][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa2')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa3')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa4')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa5')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})['then'](function(){if(_0x9c5b40){return db['OpenchannelInteraction']['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa6')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa7')][_0x702a('0x27')]({'CmContactId':_0x9c5b40['id']},{'where':{'CmContactId':[_0x418ef9[_0x702a('0x94')]['to'],_0x418ef9[_0x702a('0x94')][_0x702a('0x46')]]}});}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa8')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xa9')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xaa')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db['VoiceCallReport'][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xab')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})['then'](function(){if(_0x9c5b40){return db['FaxQueueReport'][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xac')]['update'](_0xa615d7,_0x4dd0c7);}})['then'](function(){if(_0x9c5b40){return db[_0x702a('0xad')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db['SmsQueueReport'][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xae')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xaf')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xb0')]['update'](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0xb1')][_0x702a('0x27')](_0xa615d7,_0x4dd0c7);}})[_0x702a('0x28')](function(){if(_0x9c5b40){return db[_0x702a('0x2e')][_0x702a('0x29')]({'where':{'id':[_0x418ef9[_0x702a('0x94')]['to'],_0x418ef9['body'][_0x702a('0x46')]]}});}})[_0x702a('0x28')](function(){if(_0x9c5b40){return _0x9c5b40;}})[_0x702a('0x28')](respondWithResult(_0x499dc3,null))[_0x702a('0x90')](handleError(_0x499dc3,null));};exports[_0x702a('0x9d')]=function(_0x203fc9,_0x1487f0){return db[_0x702a('0x2e')][_0x702a('0x2f')]()['then'](function(_0x273524){if(_0x203fc9[_0x702a('0x94')][_0x702a('0x98')]&&_[_0x702a('0x66')](_0x203fc9[_0x702a('0x94')][_0x702a('0x98')])){if(_0x203fc9[_0x702a('0x94')][_0x702a('0x98')][_0x702a('0x31')]){_0x203fc9[_0x702a('0x94')][_0x702a('0x98')]=_0x203fc9['body']['tags'][_0x702a('0x99')](';')+';';}else{_0x203fc9[_0x702a('0x94')][_0x702a('0x98')]=null;}}else{_0x203fc9[_0x702a('0x94')]['tags']=null;}return db['CmContact'][_0x702a('0x9d')](_0x203fc9[_0x702a('0x94')],{'fields':_[_0x702a('0x30')](_0x273524),'raw':!![]});})['then'](function(_0x7a8660){if(_0x203fc9[_0x702a('0x94')]['additionalPhones']){return insertAdditionalPhones(_0x7a8660,_0x203fc9[_0x702a('0x94')]['additionalPhones']);}else{return _0x7a8660;}})['then'](respondWithResult(_0x1487f0,0xc9))[_0x702a('0x90')](handleError(_0x1487f0,null));};exports[_0x702a('0xb2')]=function(_0x19c83c,_0x44f005){var _0x4b28f0=[];var _0x246ebc=0x0;var _0x1a7ce3=0x0;var _0x1707e4=0x0;var _0x4fd6a5=[];return db['CmContact'][_0x702a('0x2f')]()[_0x702a('0x28')](function(_0x5f530f){return BPromise[_0x702a('0xb3')](_0x19c83c[_0x702a('0x94')],function(_0x346f1e){var _0x927994={'where':{'$or':[]},'defaults':_0x346f1e,'fields':_[_0x702a('0x30')](_0x5f530f),'raw':!![]};if(_0x346f1e[_0x702a('0xb4')]){for(var _0x3271c9=0x0;_0x3271c9<_0x346f1e[_0x702a('0xb4')][_0x702a('0x31')];_0x3271c9++){var _0x40c3fe={};_0x40c3fe[_0x346f1e[_0x702a('0xb4')][_0x3271c9]]=_0x346f1e[_0x346f1e[_0x702a('0xb4')][_0x3271c9]];_0x927994[_0x702a('0x43')][_0x702a('0xb5')]['push'](_0x40c3fe);}_0x927994[_0x702a('0x43')][_0x702a('0x61')]=_0x346f1e[_0x702a('0x61')];}return db[_0x702a('0x2e')][_0x702a('0xb6')](_0x927994)[_0x702a('0xb7')](function(_0x2619be,_0x2b2835){if(_0x2b2835){if(_0x346f1e[_0x702a('0x40')](_0x702a('0xb8'))){_0x4fd6a5[_0x702a('0x34')]({'contact':_0x2619be,'additionalPhones':_0x346f1e[_0x702a('0xb8')]});}_0x246ebc++;}else{_0x1707e4++;}})['catch'](function(_0x247a7c){console[_0x702a('0xb9')](_0x247a7c);_0x1a7ce3++;});});})[_0x702a('0x28')](function(_0x4b944e){if(_0x4b944e){if(_0x4fd6a5['length']>0x0){return new Promise(function(_0x282ba7,_0x930b64){var _0x1cefb9=[];for(var _0x3fb5f1=0x0;_0x3fb5f1<_0x4fd6a5[_0x702a('0x31')];_0x3fb5f1++){_0x1cefb9[_0x702a('0x34')](insertAdditionalPhones(_0x4fd6a5[_0x3fb5f1][_0x702a('0xba')],_0x4fd6a5[_0x3fb5f1][_0x702a('0xb8')]));}Promise[_0x702a('0x38')](_0x1cefb9)[_0x702a('0x28')](function(){_0x282ba7(0x1);});})[_0x702a('0x28')](function(){return{'success':_0x246ebc,'failure':_0x1a7ce3,'duplicates':_0x1707e4};});}else{return{'success':_0x246ebc,'failure':_0x1a7ce3,'duplicates':_0x1707e4};}}})[_0x702a('0x28')](respondWithResult(_0x44f005,0xc9))[_0x702a('0x90')](handleError(_0x44f005,null));};exports[_0x702a('0xbb')]=function(_0x2808bc,_0x123b8a,_0x380d9b){var _0x32007e;return db[_0x702a('0x2e')]['describe']()[_0x702a('0x28')](function(_0x30c1b9){return db[_0x702a('0x2e')]['find']({'where':{'id':_0x2808bc['params']['id']},'include':[{'model':db[_0x702a('0x52')],'as':'Tags','attributes':['id',_0x702a('0x2b'),_0x702a('0xbc')],'required':_0x2808bc[_0x702a('0x3c')][_0x702a('0x65')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x2808bc[_0x702a('0xbd')]['id']},'required':![],'include':[{'model':db[_0x702a('0xbe')],'as':'ItemType'}]}],'order':[db[_0x702a('0x80')][_0x702a('0xbf')](_0x702a('0xc0'))],'logging':console[_0x702a('0xc1')],'attributes':_['keys'](_0x30c1b9)});})[_0x702a('0x28')](function(_0x243113){_0x32007e=_0x243113[_0x702a('0x96')]({'plain':!![]});var _0x5022db={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x243113&&_0x243113[_0x702a('0x61')]){if(_0x243113[_0x702a('0x61')]){_0x5022db['where'][_0x702a('0xc2')][_0x702a('0x34')]({'ListId':{'$ne':_0x243113['ListId']}});}}return db['CmCustomField']['findAll'](_0x5022db);})['then'](function(_0xc9069c){return _[_0x702a('0xc3')](_0x32007e,_[_0x702a('0x5c')](_0xc9069c,function(_0x297c3a){return util['format'](_0x702a('0xc4'),_0x297c3a['id']);}));})[_0x702a('0x28')](handleEntityNotFound(_0x123b8a,null))[_0x702a('0x28')](respondWithResult(_0x123b8a,null))['catch'](handleError(_0x123b8a,null));};exports[_0x702a('0x27')]=function(_0x52d3db,_0x54d290){var _0x2d482c;if(_0x52d3db[_0x702a('0x94')]['id']){delete _0x52d3db[_0x702a('0x94')]['id'];}return db['CmContact'][_0x702a('0x8f')]({'where':{'id':_0x52d3db['params']['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x54d290,null))[_0x702a('0x28')](saveUpdates(_0x52d3db[_0x702a('0x94')],null))[_0x702a('0x28')](function(_0x50fd0a){_0x2d482c=_0x50fd0a;var _0x4f14e0={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x50fd0a&&_0x50fd0a[_0x702a('0x61')]){if(_0x50fd0a[_0x702a('0x61')]){_0x4f14e0[_0x702a('0x43')][_0x702a('0xc2')][_0x702a('0x34')]({'ListId':{'$ne':_0x50fd0a[_0x702a('0x61')]}});}}return db[_0x702a('0x35')]['findAll'](_0x4f14e0);})['then'](function(_0x5d5bc5){if(_0x5d5bc5){return _[_0x702a('0xc3')](_[_0x702a('0xc5')](_0x52d3db[_0x702a('0x94')],function(_0x4ca4f3,_0xccd420){return _[_0x702a('0x32')](_0xccd420,_0x702a('0x33'));}),_['map'](_0x5d5bc5,function(_0x166fdf){return util[_0x702a('0xc6')](_0x702a('0xc4'),_0x166fdf['id']);}));}})[_0x702a('0x28')](function(_0x39dbf0){if(_0x39dbf0&&!_[_0x702a('0x60')](_0x39dbf0)){var _0x45504d=squel[_0x702a('0x27')]()[_0x702a('0xc7')](_0x702a('0x48'))[_0x702a('0xc8')](_0x39dbf0)[_0x702a('0x43')](_0x702a('0xc9'),_0x52d3db[_0x702a('0xbd')]['id'])[_0x702a('0xca')]();return db['sequelize'][_0x702a('0x3c')](_0x45504d[_0x702a('0x5b')],{'replacements':_0x45504d[_0x702a('0x93')]});}})[_0x702a('0x28')](function(){if(_0x52d3db[_0x702a('0x94')][_0x702a('0xcb')]&&_0x2d482c){return db['CmHopper']['update']({'phone':_0x52d3db[_0x702a('0x94')]['phone']},{'where':{'ContactId':_0x2d482c['id']}});}})['then'](function(){return _0x2d482c;})[_0x702a('0x28')](respondWithResult(_0x54d290,null))[_0x702a('0x90')](handleError(_0x54d290,null));};exports['getTags']=function(_0x91ec6e,_0x17d310,_0x52b6c8){var _0x50734e={};var _0x132fd8={};var _0x550cb8;var _0x422051;return db[_0x702a('0x2e')]['findOne']({'where':{'id':_0x91ec6e['params']['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x17d310,null))[_0x702a('0x28')](function(_0x435741){if(_0x435741){_0x550cb8=_0x435741;_0x132fd8[_0x702a('0x3b')]=_[_0x702a('0x30')](db[_0x702a('0x52')]['rawAttributes']);_0x132fd8[_0x702a('0x3c')]=_[_0x702a('0x30')](_0x91ec6e[_0x702a('0x3c')]);_0x132fd8[_0x702a('0x3d')]=_[_0x702a('0xcc')](_0x132fd8[_0x702a('0x3b')],_0x132fd8[_0x702a('0x3c')]);_0x50734e[_0x702a('0x3f')]=_[_0x702a('0xcc')](_0x132fd8[_0x702a('0x3b')],qs[_0x702a('0x3e')](_0x91ec6e[_0x702a('0x3c')]['fields']));_0x50734e['attributes']=_0x50734e[_0x702a('0x3f')][_0x702a('0x31')]?_0x50734e['attributes']:_0x132fd8['model'];_0x50734e['order']=qs[_0x702a('0x42')](_0x91ec6e[_0x702a('0x3c')][_0x702a('0x42')]);_0x50734e[_0x702a('0x43')]=qs['filters'](_['pick'](_0x91ec6e[_0x702a('0x3c')],_0x132fd8['filters']));if(_0x91ec6e['query'][_0x702a('0x5d')]){_0x50734e['where']=_[_0x702a('0x83')](_0x50734e[_0x702a('0x43')],{'$or':_[_0x702a('0x5c')](_0x50734e[_0x702a('0x3f')],function(_0x2fa8d2){var _0x2b695e={};_0x2b695e[_0x2fa8d2]={'$like':'%'+_0x91ec6e[_0x702a('0x3c')][_0x702a('0x5d')]+'%'};return _0x2b695e;})});}_0x50734e=_[_0x702a('0x83')]({},_0x50734e,_0x91ec6e['options']);return _0x550cb8[_0x702a('0xcd')](_0x50734e);}})[_0x702a('0x28')](function(_0x2c014c){if(_0x2c014c){_0x422051=_0x2c014c[_0x702a('0x31')];if(!_0x91ec6e[_0x702a('0x3c')][_0x702a('0x40')](_0x702a('0xce'))){_0x50734e[_0x702a('0x22')]=qs[_0x702a('0x22')](_0x91ec6e[_0x702a('0x3c')][_0x702a('0x22')]);_0x50734e[_0x702a('0x1f')]=qs[_0x702a('0x1f')](_0x91ec6e[_0x702a('0x3c')][_0x702a('0x1f')]);}return _0x550cb8[_0x702a('0xcd')](_0x50734e);}})['then'](function(_0x39cae4){if(_0x39cae4){return _0x39cae4?{'count':_0x422051,'rows':_0x39cae4}:null;}})[_0x702a('0x28')](respondWithResult(_0x17d310,null))['catch'](handleError(_0x17d310,null));};exports[_0x702a('0xcf')]=function(_0x50934b,_0x47e434,_0x508c83){if(_0x50934b['body']['id']){delete _0x50934b[_0x702a('0x94')]['id'];}return db[_0x702a('0x2e')][_0x702a('0x36')]({'where':{'id':_0x50934b['params']['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x47e434,null))[_0x702a('0x28')](function(_0x38e5f8){if(_0x38e5f8){return _0x38e5f8[_0x702a('0xcf')](_0x50934b[_0x702a('0x94')]['ids']||[]);}return null;})[_0x702a('0x28')](respondWithResult(_0x47e434,null))[_0x702a('0x90')](handleError(_0x47e434,null));};exports[_0x702a('0xd0')]=function(_0x2065ff,_0x34644f){var _0x2083bb=[];_0x2083bb[_0x702a('0x34')](addAdditionalPhones(_0x2065ff[_0x702a('0x94')]));Promise['all'](_0x2083bb)[_0x702a('0x28')](function(){_0x2083bb=[];_0x2083bb[_0x702a('0x34')](deleteCmHopperPhones(_0x2065ff[_0x702a('0x94')]['id']));_0x2083bb[_0x702a('0x34')](addCmHopperPhones(_0x2065ff['body']['id']));Promise[_0x702a('0x38')](_0x2083bb)[_0x702a('0x28')](function(){return[0x1];})[_0x702a('0x28')](respondWithResult(_0x34644f,null));});};function addAdditionalPhones(_0x1e30b0){var _0x43ac96;return new Promise(function(_0x43eab3,_0x2c4906){return db[_0x702a('0xa7')][_0x702a('0x29')]({'where':{'CmContactId':_0x1e30b0['id']}})[_0x702a('0x28')](function(){var _0x25ef00=[];for(var _0x1ad3ef=0x0;_0x1ad3ef<_0x1e30b0['items'][_0x702a('0x31')];_0x1ad3ef++){var _0x31a033=_0x1e30b0[_0x702a('0xd1')]?_['isNil'](_0x1e30b0['item_types'][_0x1ad3ef])?'':_0x1e30b0['item_types'][_0x1ad3ef]:_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef][_0x702a('0xd3')]?_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef]['ItemTypeId']:'';var _0x2384fd=_[_0x702a('0x5e')](_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef]['description'])?'':_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef][_0x702a('0xd4')];var _0x2ed52b=_0x31a033+':'+_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef][_0x702a('0xcb')]+'§'+_0x2384fd;if(_[_0x702a('0x5e')](_0x43ac96))_0x43ac96=_0x2ed52b;else _0x43ac96+=';'+_0x2ed52b;_0x25ef00['push'](addAdditionalPhone(_0x1e30b0['id'],_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef][_0x702a('0xcb')],_0x1e30b0[_0x702a('0xd1')]?_[_0x702a('0x5e')](_0x1e30b0['item_types'][_0x1ad3ef])?null:_0x1e30b0[_0x702a('0xd1')][_0x1ad3ef]:_0x1e30b0['items'][_0x1ad3ef][_0x702a('0xd3')]?_0x1e30b0[_0x702a('0xd2')][_0x1ad3ef][_0x702a('0xd3')]:null,_0x1ad3ef,_0x2384fd));}Promise['all'](_0x25ef00)[_0x702a('0x28')](function(){db[_0x702a('0x2e')][_0x702a('0x27')]({'AdditionalPhones':_0x43ac96},{'where':{'id':_0x1e30b0['id']}})[_0x702a('0x28')](function(){_0x43eab3(0x1);});});});});}function addAdditionalPhone(_0x38ac5c,_0x99fe34,_0x1a82ab,_0x2bddf2,_0x1b1bb7){return db[_0x702a('0xa7')][_0x702a('0x8f')]({'where':{'CmContactId':_0x38ac5c,'item':_0x99fe34}})[_0x702a('0x28')](function(_0xf2c14c){if(_0xf2c14c)logger[_0x702a('0x9c')](_0x702a('0xd5'),_0xf2c14c);else{db[_0x702a('0xa7')][_0x702a('0x9d')]({'CmContactId':_0x38ac5c,'item':_0x99fe34,'ItemTypeId':_0x1a82ab,'OrderBy':_0x2bddf2,'ItemClass':_0x702a('0xd6'),'description':_0x1b1bb7});}});}function deletePhones(_0x570918){return db[_0x702a('0xa7')][_0x702a('0x29')]({'where':{'CmContactId':_0x570918}});}function deleteCmHopperPhones(_0x137175){return new Promise(function(_0x5813a5,_0x1cf986){return db[_0x702a('0x9a')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x137175}})[_0x702a('0x28')](function(_0x4a7684){db[_0x702a('0xd7')][_0x702a('0x29')]({'where':{'CmHopperId':{'$in':_['map'](_0x4a7684,'id')}}});})[_0x702a('0x28')](function(){_0x5813a5(0x1);});});}function addCmHopperPhones(_0x35b900){return new Promise(function(_0x2832a5,_0x3d5359){return db[_0x702a('0x9a')][_0x702a('0x95')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x35b900}})['then'](function(_0x49ef3a){var _0x45b5e1=[];_[_0x702a('0x5c')](_0x49ef3a,function(_0x54d1d8){_0x45b5e1[_0x702a('0x34')](createCmHopperPhone(_0x35b900,_0x54d1d8['id']));});Promise['all'](_0x45b5e1)[_0x702a('0x28')](function(){_0x2832a5(0x1);});});});}function createCmHopperPhone(_0x6c3139,_0x549410){return new Promise(function(_0x4370ca,_0x36c22d){db[_0x702a('0xa7')][_0x702a('0x95')]({'raw':!![],'attributes':[_0x702a('0xd8')],'where':{'CmContactId':_0x6c3139,'ItemClass':_0x702a('0xd6')},'include':[{'model':db[_0x702a('0xbe')],'attributes':[_0x702a('0xd9')],'as':_0x702a('0xda')}],'order':[db[_0x702a('0x80')][_0x702a('0xbf')]('`ItemType`.OrderBy')]})[_0x702a('0x28')](function(_0x2aeead){var _0x115bb6=0x1;var _0x3c20d7=_['map'](_0x2aeead,function(_0x57a2b0){_0x57a2b0[_0x702a('0xdb')]=_0x549410;_0x57a2b0[_0x702a('0xcb')]=_0x57a2b0[_0x702a('0xd8')];_0x57a2b0[_0x702a('0xd9')]=_0x57a2b0[_0x702a('0xdc')]||_0x115bb6;delete _0x57a2b0['ItemType.OrderBy'];_0x115bb6=_0x115bb6+0x1;return _0x57a2b0;});return db['CmHopperAdditionalPhone']['bulkCreate'](_0x3c20d7,{});})[_0x702a('0x28')](function(){_0x4370ca(0x1);});});}function insertAdditionalPhones(_0x19b966,_0x54979b){return new Promise(function(_0x2f99b8,_0x1c943d){var _0x40cb0e=[];for(var _0x28b8d0=0x0;_0x28b8d0<_0x54979b[_0x702a('0x31')];_0x28b8d0++){var _0x31c5ed=_0x54979b[_0x28b8d0];_0x40cb0e[_0x702a('0x34')](parseContactItemType(_0x31c5ed));}Promise[_0x702a('0x38')](_0x40cb0e)[_0x702a('0x28')](function(){var _0x344983={'id':_0x19b966['id'],'items':_0x54979b};return addAdditionalPhones(_0x344983)[_0x702a('0x28')](function(_0x42f772){return addCmHopperPhones(_0x19b966['id']);});})[_0x702a('0x28')](function(){_0x2f99b8(_0x19b966);});});}function parseContactItemType(_0x280674){return new Promise(function(_0x5061c6,_0x26990d){if(_0x280674[_0x702a('0x40')]('ItemTypeId')){_0x5061c6(_0x280674);}else{return db[_0x702a('0xbe')]['find']({'where':{'name':_0x280674[_0x702a('0xda')]}})[_0x702a('0x28')](function(_0x4f0943){if(_[_0x702a('0x5e')](_0x4f0943))_0x280674[_0x702a('0xd3')]=null;else _0x280674[_0x702a('0xd3')]=_0x4f0943['id'];_0x5061c6(_0x280674);});}});}exports[_0x702a('0xdd')]=function(_0x29d4e5,_0x1309a1){return db[_0x702a('0xa7')][_0x702a('0x95')]({'raw':!![],'where':{'CmContactId':_0x29d4e5['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':_0x702a('0xda')}],'order':[[db[_0x702a('0x80')][_0x702a('0xbf')](_0x702a('0xde'))],[_0x702a('0xd9')]]})[_0x702a('0x28')](function(_0x349a4b){return _0x349a4b;})[_0x702a('0x28')](respondWithResult(_0x1309a1,null))[_0x702a('0x90')](handleError(_0x1309a1,null));};exports[_0x702a('0xdf')]=function(_0x271963,_0x38c8b5){return db[_0x702a('0xa7')]['findAll']({'raw':!![],'where':{'CmContactId':_0x271963['body'][_0x702a('0xe0')]}})['then'](function(_0x91a437){var _0x1155d1=_[_0x702a('0x5c')](_0x91a437,function(_0x2de804){_0x2de804['CmContactId']=_0x271963[_0x702a('0x94')][_0x702a('0xe1')];return _0x2de804;});return db[_0x702a('0xa7')]['bulkCreate'](_0x1155d1,{});})[_0x702a('0x28')](function(_0x57595b){return addCmHopperPhones(_0x271963[_0x702a('0x94')][_0x702a('0xe1')]);})['then'](function(_0x361e25){return['ok'];})[_0x702a('0x28')](respondWithResult(_0x38c8b5,null))[_0x702a('0x90')](handleError(_0x38c8b5,null));};exports['rescheduleAdditionalPhones']=function(_0xc9b0dd,_0x4a588e){var _0x592b32=[];_0x592b32['push'](createCmHopperPhone(_0xc9b0dd['body']['id'],_0xc9b0dd[_0x702a('0x94')][_0x702a('0xe2')]));Promise[_0x702a('0x38')](_0x592b32)[_0x702a('0x28')](function(){return[0x1];})[_0x702a('0x28')](respondWithResult(_0x4a588e,null));};exports[_0x702a('0xe3')]=function(_0x2350d3,_0x5de80d,_0x515c8e){var _0x4da63c={'raw':![],'where':{}};var _0x293a4a={};var _0x5b9d31={'count':0x0,'rows':[]};return db['CmContact'][_0x702a('0x36')]({'where':{'id':_0x2350d3['params']['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x5de80d,null))[_0x702a('0x28')](function(_0x107316){if(_0x107316){_0x293a4a['model']=_[_0x702a('0x30')](db[_0x702a('0x9a')][_0x702a('0xe4')]);_0x293a4a['query']=_[_0x702a('0x30')](_0x2350d3['query']);_0x293a4a[_0x702a('0x3d')]=_[_0x702a('0xcc')](_0x293a4a[_0x702a('0x3b')],_0x293a4a[_0x702a('0x3c')]);_0x4da63c[_0x702a('0x3f')]=_[_0x702a('0xcc')](_0x293a4a[_0x702a('0x3b')],qs[_0x702a('0x3e')](_0x2350d3[_0x702a('0x3c')]['fields']));_0x4da63c[_0x702a('0x3f')]=_0x4da63c[_0x702a('0x3f')][_0x702a('0x31')]?_0x4da63c[_0x702a('0x3f')]:_0x293a4a['model'];if(!_0x2350d3[_0x702a('0x3c')][_0x702a('0x40')](_0x702a('0xce'))){_0x4da63c[_0x702a('0x22')]=qs[_0x702a('0x22')](_0x2350d3[_0x702a('0x3c')][_0x702a('0x22')]);_0x4da63c[_0x702a('0x1f')]=qs[_0x702a('0x1f')](_0x2350d3['query']['offset']);}_0x4da63c[_0x702a('0x41')]=qs['sort'](_0x2350d3[_0x702a('0x3c')][_0x702a('0x42')]);_0x4da63c[_0x702a('0x43')]=qs['filters'](_[_0x702a('0xe5')](_0x2350d3[_0x702a('0x3c')],_0x293a4a[_0x702a('0x3d')]));_0x4da63c[_0x702a('0x43')][_0x702a('0xe6')]=_0x107316['id'];if(_0x2350d3['query'][_0x702a('0x5d')]){_0x4da63c[_0x702a('0x43')]=_[_0x702a('0x83')](_0x4da63c['where'],{'$or':_[_0x702a('0x5c')](_0x4da63c[_0x702a('0x3f')],function(_0x18d543){var _0x591640={};_0x591640[_0x18d543]={'$like':'%'+_0x2350d3[_0x702a('0x3c')][_0x702a('0x5d')]+'%'};return _0x591640;})});}_0x4da63c=_[_0x702a('0x83')]({},_0x4da63c,_0x2350d3['options']);return db[_0x702a('0x9a')][_0x702a('0x21')]({'where':_0x4da63c[_0x702a('0x43')]})[_0x702a('0x28')](function(_0x37ecd5){_0x5b9d31[_0x702a('0x21')]=_0x37ecd5;if(_0x2350d3[_0x702a('0x3c')][_0x702a('0xe7')]){_0x4da63c[_0x702a('0xe8')]=[{'all':!![]}];}return db['CmHopper'][_0x702a('0x95')](_0x4da63c);})[_0x702a('0x28')](function(_0x17ce44){_0x5b9d31[_0x702a('0x8e')]=_0x17ce44;return _0x5b9d31;});}})['then'](respondWithFilteredResult(_0x5de80d,_0x4da63c))[_0x702a('0x90')](handleError(_0x5de80d,null));};exports[_0x702a('0xe9')]=function(_0x1a605d,_0xea7492,_0x36867e){var _0x6f491f={'raw':!![],'where':{}};var _0xc19c4b={};var _0x5f08c8={'count':0x0,'rows':[]};return db['CmContact'][_0x702a('0x36')]({'where':{'id':_0x1a605d['params']['id']}})['then'](handleEntityNotFound(_0xea7492,null))['then'](function(_0x556f0e){if(_0x556f0e){_0xc19c4b['model']=_[_0x702a('0x30')](db[_0x702a('0xa9')]['rawAttributes']);_0xc19c4b[_0x702a('0x3c')]=_[_0x702a('0x30')](_0x1a605d[_0x702a('0x3c')]);_0xc19c4b[_0x702a('0x3d')]=_[_0x702a('0xcc')](_0xc19c4b['model'],_0xc19c4b[_0x702a('0x3c')]);_0x6f491f[_0x702a('0x3f')]=_[_0x702a('0xcc')](_0xc19c4b['model'],qs[_0x702a('0x3e')](_0x1a605d['query'][_0x702a('0x3e')]));_0x6f491f[_0x702a('0x3f')]=_0x6f491f[_0x702a('0x3f')]['length']?_0x6f491f[_0x702a('0x3f')]:_0xc19c4b[_0x702a('0x3b')];if(!_0x1a605d[_0x702a('0x3c')][_0x702a('0x40')](_0x702a('0xce'))){_0x6f491f['limit']=qs[_0x702a('0x22')](_0x1a605d['query'][_0x702a('0x22')]);_0x6f491f[_0x702a('0x1f')]=qs[_0x702a('0x1f')](_0x1a605d[_0x702a('0x3c')][_0x702a('0x1f')]);}_0x6f491f['order']=qs[_0x702a('0x42')](_0x1a605d['query'][_0x702a('0x42')]);_0x6f491f[_0x702a('0x43')]=qs['filters'](_[_0x702a('0xe5')](_0x1a605d[_0x702a('0x3c')],_0xc19c4b[_0x702a('0x3d')]));_0x6f491f[_0x702a('0x43')][_0x702a('0xe6')]=_0x556f0e['id'];if(_0x1a605d[_0x702a('0x3c')][_0x702a('0x5d')]){_0x6f491f[_0x702a('0x43')]=_['merge'](_0x6f491f[_0x702a('0x43')],{'$or':_[_0x702a('0x5c')](_0x6f491f[_0x702a('0x3f')],function(_0x2374d7){var _0x20f2a2={};_0x20f2a2[_0x2374d7]={'$like':'%'+_0x1a605d[_0x702a('0x3c')][_0x702a('0x5d')]+'%'};return _0x20f2a2;})});}_0x6f491f=_[_0x702a('0x83')]({},_0x6f491f,_0x1a605d[_0x702a('0xea')]);return db[_0x702a('0xa9')]['count']({'where':_0x6f491f[_0x702a('0x43')]})['then'](function(_0x2eff18){_0x5f08c8[_0x702a('0x21')]=_0x2eff18;if(_0x1a605d[_0x702a('0x3c')]['includeAll']){_0x6f491f[_0x702a('0xe8')]=[{'all':!![]}];}return db[_0x702a('0xa9')][_0x702a('0x95')](_0x6f491f);})['then'](function(_0x49f507){_0x5f08c8['rows']=_0x49f507;return _0x5f08c8;});}})[_0x702a('0x28')](respondWithFilteredResult(_0xea7492,_0x6f491f))[_0x702a('0x90')](handleError(_0xea7492,null));};exports[_0x702a('0xeb')]=function(_0x480e2d,_0x1464c3,_0x33943b){var _0x347815={'raw':!![],'where':{}};var _0x31dade={};var _0x4a463f={'count':0x0,'rows':[]};return db[_0x702a('0x2e')][_0x702a('0x36')]({'where':{'id':_0x480e2d[_0x702a('0xbd')]['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x1464c3,null))['then'](function(_0x39bf97){if(_0x39bf97){_0x31dade[_0x702a('0x3b')]=_[_0x702a('0x30')](db['CmHopperFinal']['rawAttributes']);_0x31dade[_0x702a('0x3c')]=_[_0x702a('0x30')](_0x480e2d[_0x702a('0x3c')]);_0x31dade[_0x702a('0x3d')]=_[_0x702a('0xcc')](_0x31dade['model'],_0x31dade[_0x702a('0x3c')]);_0x347815[_0x702a('0x3f')]=_[_0x702a('0xcc')](_0x31dade['model'],qs[_0x702a('0x3e')](_0x480e2d[_0x702a('0x3c')]['fields']));_0x347815[_0x702a('0x3f')]=_0x347815[_0x702a('0x3f')]['length']?_0x347815[_0x702a('0x3f')]:_0x31dade['model'];if(!_0x480e2d['query'][_0x702a('0x40')](_0x702a('0xce'))){_0x347815[_0x702a('0x22')]=qs[_0x702a('0x22')](_0x480e2d[_0x702a('0x3c')][_0x702a('0x22')]);_0x347815[_0x702a('0x1f')]=qs['offset'](_0x480e2d['query'][_0x702a('0x1f')]);}_0x347815['order']=qs[_0x702a('0x42')](_0x480e2d[_0x702a('0x3c')]['sort']);_0x347815[_0x702a('0x43')]=qs[_0x702a('0x3d')](_[_0x702a('0xe5')](_0x480e2d['query'],_0x31dade[_0x702a('0x3d')]));_0x347815['where'][_0x702a('0xe6')]=_0x39bf97['id'];if(_0x480e2d[_0x702a('0x3c')]['filter']){_0x347815['where']=_[_0x702a('0x83')](_0x347815[_0x702a('0x43')],{'$or':_[_0x702a('0x5c')](_0x347815[_0x702a('0x3f')],function(_0x2eb04f){var _0x1a83e6={};_0x1a83e6[_0x2eb04f]={'$like':'%'+_0x480e2d[_0x702a('0x3c')]['filter']+'%'};return _0x1a83e6;})});}_0x347815=_[_0x702a('0x83')]({},_0x347815,_0x480e2d[_0x702a('0xea')]);return db[_0x702a('0xa8')][_0x702a('0x21')]({'where':_0x347815[_0x702a('0x43')]})['then'](function(_0x373b1b){_0x4a463f['count']=_0x373b1b;if(_0x480e2d[_0x702a('0x3c')]['includeAll']){_0x347815[_0x702a('0xe8')]=[{'all':!![]}];}return db[_0x702a('0xa8')][_0x702a('0x95')](_0x347815);})[_0x702a('0x28')](function(_0x990860){_0x4a463f[_0x702a('0x8e')]=_0x990860;return _0x4a463f;});}})[_0x702a('0x28')](respondWithFilteredResult(_0x1464c3,_0x347815))[_0x702a('0x90')](handleError(_0x1464c3,null));};exports[_0x702a('0xec')]=function(_0x259b23,_0x3b8cd9,_0x42faf3){var _0x767296={'raw':!![],'where':{}};var _0x297634={};var _0x464cbc={'count':0x0,'rows':[]};return db[_0x702a('0x2e')][_0x702a('0x36')]({'where':{'id':_0x259b23[_0x702a('0xbd')]['id']}})[_0x702a('0x28')](handleEntityNotFound(_0x3b8cd9,null))[_0x702a('0x28')](function(_0x23399d){if(_0x23399d){_0x297634[_0x702a('0x3b')]=_['keys'](db['JscriptySessionReport'][_0x702a('0xe4')]);_0x297634[_0x702a('0x3c')]=_[_0x702a('0x30')](_0x259b23['query']);_0x297634[_0x702a('0x3d')]=_[_0x702a('0xcc')](_0x297634[_0x702a('0x3b')],_0x297634['query']);_0x767296[_0x702a('0x3f')]=_[_0x702a('0xcc')](_0x297634['model'],qs['fields'](_0x259b23[_0x702a('0x3c')]['fields']));_0x767296[_0x702a('0x3f')]=_0x767296[_0x702a('0x3f')][_0x702a('0x31')]?_0x767296[_0x702a('0x3f')]:_0x297634['model'];if(!_0x259b23['query'][_0x702a('0x40')](_0x702a('0xce'))){_0x767296[_0x702a('0x22')]=qs[_0x702a('0x22')](_0x259b23[_0x702a('0x3c')][_0x702a('0x22')]);_0x767296[_0x702a('0x1f')]=qs['offset'](_0x259b23['query'][_0x702a('0x1f')]);}_0x767296[_0x702a('0x41')]=qs[_0x702a('0x42')](_0x259b23[_0x702a('0x3c')][_0x702a('0x42')]);_0x767296[_0x702a('0x43')]=qs[_0x702a('0x3d')](_[_0x702a('0xe5')](_0x259b23['query'],_0x297634[_0x702a('0x3d')]));_0x767296[_0x702a('0x43')]['ContactId']=_0x23399d['id'];if(_0x259b23[_0x702a('0x3c')][_0x702a('0x5d')]){_0x767296['where']=_[_0x702a('0x83')](_0x767296[_0x702a('0x43')],{'$or':_['map'](_0x767296['attributes'],function(_0x515f7f){var _0x1ad278={};_0x1ad278[_0x515f7f]={'$like':'%'+_0x259b23[_0x702a('0x3c')][_0x702a('0x5d')]+'%'};return _0x1ad278;})});}_0x767296=_[_0x702a('0x83')]({},_0x767296,_0x259b23['options']);return db['JscriptySessionReport'][_0x702a('0x21')]({'where':_0x767296[_0x702a('0x43')]})[_0x702a('0x28')](function(_0x4c5f4c){_0x464cbc[_0x702a('0x21')]=_0x4c5f4c;if(_0x259b23[_0x702a('0x3c')][_0x702a('0xe7')]){_0x767296[_0x702a('0xe8')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x702a('0x95')](_0x767296);})[_0x702a('0x28')](function(_0x271b8e){_0x464cbc[_0x702a('0x8e')]=_0x271b8e;return _0x464cbc;});}})['then'](respondWithFilteredResult(_0x3b8cd9,_0x767296))['catch'](handleError(_0x3b8cd9,null));};exports['uploadCsv']=function(_0x3219c1,_0x1a0f7a,_0x273463){try{if(!_0x3219c1[_0x702a('0x94')][_0x702a('0x61')]){throw new Error(_0x702a('0xed'));}if(!_0x3219c1[_0x702a('0x94')][_0x702a('0xee')]){throw new Error(_0x702a('0xef'));}if(!_0x3219c1[_0x702a('0x94')][_0x702a('0xf0')]){throw new Error(_0x702a('0xf1'));}if(!_0x3219c1[_0x702a('0x94')][_0x702a('0xf2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1063c2=_0x3219c1[_0x702a('0x94')]['binding_keys']['split'](',');var _0x2758b9=_0x3219c1[_0x702a('0x94')][_0x702a('0xf0')][_0x702a('0x54')](',');if(!_0x1063c2[_0x702a('0x31')]||!_0x2758b9['length']||_0x1063c2[_0x702a('0x31')]!==_0x2758b9[_0x702a('0x31')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3219c1[_0x702a('0x94')]['fields']=_[_0x702a('0xf3')](_0x1063c2,_0x2758b9);if(!_0x3219c1[_0x702a('0x94')][_0x702a('0x3e')][_0x702a('0xcb')]){throw new Error(_0x702a('0xf4'));}if(!_0x3219c1[_0x702a('0x94')][_0x702a('0x3e')][_0x702a('0xf5')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x78532=path['join'](config[_0x702a('0xf6')],_0x702a('0xf7'),_0x3219c1['file'][_0x702a('0xf8')]);fs[_0x702a('0xf9')](_0x78532,parseInt(_0x702a('0xfa'),0x8));var _0x50702f=require(_0x702a('0xfb'))['fork'](path[_0x702a('0x99')](__dirname,_0x702a('0xfc')),[_0x78532,_0x3219c1[_0x702a('0x94')]['binding_keys'],_0x3219c1['body']['binding_values'],_0x3219c1[_0x702a('0x94')][_0x702a('0x61')],_0x3219c1[_0x702a('0x94')][_0x702a('0xfd')],_0x3219c1[_0x702a('0x94')]['duplicates'],_0x3219c1['body']['socket_timestamp']]);return _0x1a0f7a[_0x702a('0x1d')](0xc8)['json']({'message':_0x702a('0xfe'),'pid':_0x50702f[_0x702a('0xff')]});}catch(_0x3f25b4){return _0x1a0f7a[_0x702a('0x1d')](0x1f4)[_0x702a('0x2c')](_0x3f25b4);}};exports[_0x702a('0x100')]=function(_0x21cabd,_0x4a70c1,_0x392e31){var _0x2f885e=fs[_0x702a('0x101')](_0x21cabd[_0x702a('0x102')][_0x702a('0x8')]);Papa[_0x702a('0x103')](_0x2f885e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4b475e){return _0x4a70c1[_0x702a('0x1d')](0xc8)[_0x702a('0x24')]({'file':_0x21cabd[_0x702a('0x102')],'fields':_0x4b475e[_0x702a('0x104')]['fields']});}});};exports[_0x702a('0x105')]=function(_0x4cb8aa,_0xddf7a4,_0x2e0f12){return db[_0x702a('0x7d')][_0x702a('0x95')]({'raw':!![],'attributes':['id'],'where':{'role':_0x702a('0x106')}})['then'](function(_0x5f25fb){var _0x48fcd6=![];if(!_0x4cb8aa[_0x702a('0x94')][_0x702a('0x61')]){throw new Error('No\x20ListId\x20specified');}if(!_0x4cb8aa[_0x702a('0x94')][_0x702a('0x107')][_0x702a('0xcb')]){throw new Error(_0x702a('0xf4'));}if(!_0x4cb8aa['body'][_0x702a('0x107')]['firstName']){throw new Error(_0x702a('0x108'));}if(!_0x4cb8aa[_0x702a('0x94')][_0x702a('0xf2')]){throw new Error(_0x702a('0x109'));}var _0x7a11f7=require(_0x702a('0xfb'))[_0x702a('0x10a')](path[_0x702a('0x99')](__dirname,_0x702a('0x10b')),[_0x4cb8aa[_0x702a('0xbd')]['id'],JSON[_0x702a('0x10c')](_0x4cb8aa['body']),JSON['stringify'](_0x5f25fb)]);_0x7a11f7['on'](_0x702a('0x10d'),function(_0x4be6dd){_0x48fcd6=!![];return _0xddf7a4[_0x702a('0x1d')](0xc8)[_0x702a('0x24')]({'message':_0x702a('0x10e'),'pid':_0x7a11f7[_0x702a('0xff')]});});_0x7a11f7['on'](_0x702a('0x10f'),function(_0x139f03){if(_0x139f03&&!_0x48fcd6){return _0xddf7a4[_0x702a('0x1d')](0x1f4)[_0x702a('0x24')]({'message':_0x702a('0x110'),'pid':_0x7a11f7[_0x702a('0xff')]});}});})[_0x702a('0x90')](handleError(_0xddf7a4,null));};exports[_0x702a('0x111')]=function(_0x2313b0,_0x38bd70,_0x457b49){return db[_0x702a('0x7d')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x702a('0x106')}})[_0x702a('0x28')](function(_0x465b28){var _0x40c75b=![];if(!_0x2313b0[_0x702a('0x94')][_0x702a('0x61')]){throw new Error(_0x702a('0xed'));}if(!_0x2313b0[_0x702a('0x94')][_0x702a('0x107')]['phone']){throw new Error(_0x702a('0xf4'));}if(!_0x2313b0['body'][_0x702a('0x107')][_0x702a('0xf5')]){throw new Error(_0x702a('0x108'));}if(!_0x2313b0['body'][_0x702a('0xf2')]){throw new Error(_0x702a('0x109'));}var _0xf59637=require('child_process')[_0x702a('0x10a')](path[_0x702a('0x99')](__dirname,_0x702a('0x112')),[_0x2313b0[_0x702a('0xbd')]['id'],JSON[_0x702a('0x10c')](_0x2313b0[_0x702a('0x94')]),JSON[_0x702a('0x10c')](_0x465b28)]);_0xf59637['on'](_0x702a('0x10d'),function(_0x5c1011){_0x40c75b=!![];return _0x38bd70['status'](0xc8)[_0x702a('0x24')]({'message':'start\x20child\x20process\x20correctly!','pid':_0xf59637[_0x702a('0xff')]});});_0xf59637['on'](_0x702a('0x10f'),function(_0x140215){if(_0x140215&&!_0x40c75b){return _0x38bd70['status'](0x1f4)[_0x702a('0x24')]({'message':_0x702a('0x110'),'pid':_0xf59637[_0x702a('0xff')]});}});})[_0x702a('0x90')](handleError(_0x38bd70,null));};exports[_0x702a('0x113')]=function(_0x4298f0,_0x11a0a8){var _0x5082db=[_0x702a('0x114'),_0x702a('0x115'),_0x702a('0x116'),'openchannel',_0x702a('0x117'),'whatsapp',_0x702a('0x118')];var _0x59a40d={'offset':0x0,'order':qs[_0x702a('0x42')](_0x702a('0x119'))},_0x553449={'count':0x0,'rows':[]};Promise['resolve']()[_0x702a('0x28')](function(){if(_0x4298f0[_0x702a('0x3c')][_0x702a('0x11a')]){if(!_['includes'](_0x5082db,_0x4298f0[_0x702a('0x3c')][_0x702a('0x11a')]['toLowerCase']())){throw new Error(_0x702a('0x11b'));}_0x5082db=[_0x4298f0[_0x702a('0x3c')][_0x702a('0x11a')]['toLowerCase']()];}if(_0x4298f0[_0x702a('0x3c')][_0x702a('0x11c')]){try{var _0x45cc73=JSON[_0x702a('0x103')](_0x4298f0['query'][_0x702a('0x11c')]);if(!moment(_0x45cc73[_0x702a('0x46')])[_0x702a('0x11d')]()){throw new Error(_0x702a('0x11e'));}if(!moment(_0x45cc73['to'])[_0x702a('0x11d')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x2ad997){throw new Error(_0x702a('0x11f'));}}if(!_0x4298f0['query'][_0x702a('0x40')](_0x702a('0xce'))){_0x59a40d['limit']=qs['limit'](_0x4298f0[_0x702a('0x3c')]['limit']||0xa);_0x59a40d[_0x702a('0x1f')]=qs[_0x702a('0x1f')](_0x4298f0[_0x702a('0x3c')]['offset']);}var _0x14ca00=_0x5082db[_0x702a('0x5c')](function(_0x3103b8){if(_0x3103b8===_0x702a('0x118')){var _0x1ab9c9={'attributes':['id',_0x702a('0x120'),'type',_0x702a('0x121'),_0x702a('0x122'),_0x702a('0x123'),_0x702a('0x124'),'endtime',_0x702a('0x125'),_0x702a('0x126'),_0x702a('0x127'),_0x702a('0x128'),'userSecondDisposition',_0x702a('0x129'),_0x702a('0x12a')],'where':{'ContactId':_0x4298f0[_0x702a('0xbd')]['id']},'include':[{'model':db[_0x702a('0x7d')],'as':_0x702a('0x7d'),'attributes':['id',_0x702a('0x2b'),_0x702a('0x12b'),_0x702a('0x12c')]}],'order':[[_0x702a('0x127'),_0x702a('0x76')]]};if(_0x4298f0['query'][_0x702a('0x11c')]){_0x1ab9c9[_0x702a('0x43')][_0x702a('0x127')]={'$gte':_0x45cc73[_0x702a('0x46')],'$lte':_0x45cc73['to']};}return db['VoiceCallReport'][_0x702a('0x12d')](_0x1ab9c9)[_0x702a('0x28')](function(_0x570c0f){_0x553449[_0x702a('0x21')]+=_0x570c0f[_0x702a('0x21')];return _['map'](_0x570c0f['rows'],function(_0x4b752b){var _0x160986=_0x4b752b[_0x702a('0x96')]({'plain':!![]});_0x160986[_0x702a('0x11a')]=_0x3103b8;if(_0x160986[_0x702a('0x7d')]){_0x160986[_0x702a('0x7d')]={'id':_0x160986[_0x702a('0x7d')]['id'],'name':_0x160986[_0x702a('0x7d')][_0x702a('0x2b')],'fullname':_0x160986[_0x702a('0x7d')][_0x702a('0x12b')],'alias':_0x160986['User']['alias']};}return _0x160986;});});}else{var _0x2dca16=_[_0x702a('0x12e')](_0x3103b8)+(_0x3103b8===_0x702a('0x115')?_0x702a('0x12f'):'Account');var _0xb9585c={'attributes':['id',_0x702a('0x130'),_0x702a('0x131'),_0x702a('0x127'),_0x702a('0x126'),_0x702a('0x132'),_0x702a('0x133'),_0x702a('0x134'),_0x702a('0x12a'),_0x2dca16+'Id'],'where':{'ContactId':_0x4298f0[_0x702a('0xbd')]['id']},'include':[{'model':db[_0x2dca16],'as':_0x702a('0x135'),'attributes':['id',_0x702a('0x2b'),_0x702a('0x136')]},{'model':db['User'],'as':_0x702a('0x137'),'attributes':['id',_0x702a('0x2b'),_0x702a('0x12b')]},{'model':db[_0x702a('0x52')],'as':_0x702a('0x8d'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x4298f0[_0x702a('0x3c')]['range']){_0xb9585c[_0x702a('0x43')][_0x702a('0x127')]={'$gte':_0x45cc73['from'],'$lte':_0x45cc73['to']};}switch(_0x3103b8){case'chat':_0xb9585c['attributes']['push'](_0x702a('0x138'),'customerIp',_0x702a('0x139'),_0x702a('0x13a'),_0x702a('0x13b'),_0x702a('0x13c'),_0x702a('0x13d'),'ratingValue','referer');break;case _0x702a('0x114'):_0xb9585c[_0x702a('0x3f')]['push']('subject',_0x702a('0x13e'));break;case _0x702a('0x13f'):_0xb9585c['attributes'][_0x702a('0x34')](_0x702a('0x140'),'threadId');break;}return db[_['startCase'](_0x3103b8)+_0x702a('0x141')][_0x702a('0x12d')](_0xb9585c)[_0x702a('0x28')](function(_0x2e55ba){_0x553449[_0x702a('0x21')]+=_0x2e55ba[_0x702a('0x21')];return _[_0x702a('0x5c')](_0x2e55ba[_0x702a('0x8e')],function(_0x198f4a){var _0x5a7669=_0x198f4a['get']({'plain':!![]});_0x5a7669[_0x702a('0x11a')]=_0x3103b8;if(_0x5a7669[_0x702a('0x137')]){_0x5a7669[_0x702a('0x137')]={'id':_0x5a7669[_0x702a('0x137')]['id'],'name':_0x5a7669[_0x702a('0x137')][_0x702a('0x2b')],'fullname':_0x5a7669[_0x702a('0x137')][_0x702a('0x12b')]};}return _0x5a7669;});});}});return Promise[_0x702a('0x38')](_0x14ca00);})[_0x702a('0x28')](function(_0x2fdb38){return _(_0x2fdb38)[_0x702a('0x142')]()['sortBy'](_0x702a('0x127'))[_0x702a('0x143')]()['value']();})['then'](function(_0x42b216){_0x553449[_0x702a('0x8e')]=_0x59a40d[_0x702a('0x22')]?_0x42b216['slice'](_0x59a40d[_0x702a('0x1f')],_0x59a40d[_0x702a('0x1f')]+_0x59a40d[_0x702a('0x22')]):_0x42b216;return _0x553449;})[_0x702a('0x28')](respondWithFilteredResult(_0x11a0a8,_0x59a40d))[_0x702a('0x90')](handleError(_0x11a0a8,null));};
\ No newline at end of file
index 6b87c97..879d152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc20=['emit','hook','exports','events','../../mysqldb','CmContact','save','update'];(function(_0x580c31,_0x2af10b){var _0x1c9741=function(_0x275ba8){while(--_0x275ba8){_0x580c31['push'](_0x580c31['shift']());}};_0x1c9741(++_0x2af10b);}(_0xfc20,0xb3));var _0x0fc2=function(_0x6b32d7,_0xcb6ae3){_0x6b32d7=_0x6b32d7-0x0;var _0x13177b=_0xfc20[_0x6b32d7];return _0x13177b;};'use strict';var EventEmitter=require(_0x0fc2('0x0'));var CmContact=require(_0x0fc2('0x1'))['db'][_0x0fc2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fc2('0x3'),'afterUpdate':_0x0fc2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x93fdd8){return function(_0x5a793a,_0x220173,_0x52a95d){CmContactEvents[_0x0fc2('0x5')](_0x93fdd8+':'+_0x5a793a['id'],_0x5a793a);CmContactEvents[_0x0fc2('0x5')](_0x93fdd8,_0x5a793a);_0x52a95d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x0fc2('0x6')](e,emitEvent(event));}}module[_0x0fc2('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0x6866=['save','remove','hasOwnProperty','hook','exports','events','CmContact','setMaxListeners'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x6866,0x1bd));var _0x6686=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6866[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0x6686('0x0'));var CmContact=require('../../mysqldb')['db'][_0x6686('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x6686('0x2')](0x0);var events={'afterCreate':_0x6686('0x3'),'afterUpdate':'update','afterDestroy':_0x6686('0x4')};function emitEvent(_0x3b48a1){return function(_0xdd5dda,_0x186ea2,_0x2a816f){CmContactEvents['emit'](_0x3b48a1+':'+_0xdd5dda['id'],_0xdd5dda);CmContactEvents['emit'](_0x3b48a1,_0xdd5dda);_0x2a816f(null);};}for(var e in events){if(events[_0x6686('0x5')](e)){var event=events[e];CmContact[_0x6686('0x6')](e,emitEvent(event));}}module[_0x6686('0x7')]=CmContactEvents;
\ No newline at end of file
index ee28590..e0aa167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5ef=['cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ListId','\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','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','length','always','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','Campaign','CmList','BlackLists','message','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','email','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','inspect','findOne','then','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal'];(function(_0x4eef10,_0x35cade){var _0x4c7b25=function(_0x192f75){while(--_0x192f75){_0x4eef10['push'](_0x4eef10['shift']());}};_0x4c7b25(++_0x35cade);}(_0xb5ef,0x178));var _0xfb5e=function(_0x15acfe,_0x1a2e3c){_0x15acfe=_0x15acfe-0x0;var _0x3d3797=_0xb5ef[_0x15acfe];return _0x3d3797;};'use strict';var _=require(_0xfb5e('0x0'));var util=require(_0xfb5e('0x1'));var logger=require(_0xfb5e('0x2'))(_0xfb5e('0x3'));var moment=require(_0xfb5e('0x4'));var BPromise=require(_0xfb5e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb5e('0x6'));var rimraf=require(_0xfb5e('0x7'));var config=require(_0xfb5e('0x8'));var attributes=require(_0xfb5e('0x9'));module[_0xfb5e('0xa')]=function(_0x3a2072,_0x168253){return _0x3a2072[_0xfb5e('0xb')](_0xfb5e('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xfb5e('0xd'),'fields':[_0xfb5e('0xd')]},{'name':_0xfb5e('0xe'),'fields':[_0xfb5e('0xf'),'lastName',_0xfb5e('0xd'),'mobile','fax',_0xfb5e('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xfb5e('0x11'),'collate':_0xfb5e('0x12'),'hooks':{'afterCreate':function(_0x144ddf,_0x42b271,_0x154544){var _0x17f5d8=_0x3a2072['models'];var _0x32b35a=_0x144ddf[_0xfb5e('0x13')]({'plain':!![]});function _0x30813f(){return function(_0x576de9){logger[_0xfb5e('0x14')](_0xfb5e('0x15'),'afterCreate',util[_0xfb5e('0x16')](_0x576de9,{'showHidden':![],'depth':null}));};}var _0x3b2dae=function(_0x2b4e2a){return new BPromise(function(_0x10afeb,_0x4fe667){_0x17f5d8['CmHopper'][_0xfb5e('0x17')]({'where':{'phone':_0x32b35a[_0xfb5e('0xd')],'VoiceQueueId':_0x2b4e2a['id']}})[_0xfb5e('0x18')](function(_0x19d987){if(!_[_0xfb5e('0x19')](_0x19d987)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32b35a[_0xfb5e('0xd')]+_0xfb5e('0x1a')+_0x2b4e2a['id']);}return _0x17f5d8[_0xfb5e('0x1b')][_0xfb5e('0x1c')]({'phone':_0x32b35a['phone'],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a['ListId'],'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a[_0xfb5e('0x1d')]:0x2,'scheduledat':_0x32b35a[_0xfb5e('0x1e')]?_0x32b35a[_0xfb5e('0x1e')]:moment()[_0xfb5e('0x1f')](_0xfb5e('0x20')),'callback':_0x32b35a[_0xfb5e('0x21')]?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a[_0xfb5e('0x21')]:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()[_0xfb5e('0x1f')](_0xfb5e('0x20')):undefined,'VoiceQueueId':_0x2b4e2a['id']});})[_0xfb5e('0x22')](function(_0x20b119){_0x4fe667(_0x20b119);});});};var _0x30dd13=function(_0x4f1f4b){return new BPromise(function(_0x3acaa1,_0x20f9ca){_0x17f5d8['CmHopper']['findOne']({'where':{'phone':_0x32b35a[_0xfb5e('0xd')],'VoiceQueueId':_0x4f1f4b['id']}})[_0xfb5e('0x18')](function(_0x26712b){if(!_[_0xfb5e('0x19')](_0x26712b)){throw new Error(_0xfb5e('0x23')+_0x32b35a[_0xfb5e('0xd')]+_0xfb5e('0x24')+_0x4f1f4b['id']);}return _0x17f5d8[_0xfb5e('0x25')][_0xfb5e('0x17')]({'where':{'calleridnum':_0x32b35a[_0xfb5e('0xd')],'VoiceQueueId':_0x4f1f4b['id']}});})[_0xfb5e('0x18')](function(_0x44c72d){if(!_[_0xfb5e('0x19')](_0x44c72d)){throw new Error(_0xfb5e('0x26')+_0x32b35a[_0xfb5e('0xd')]+_0xfb5e('0x27')+_0x4f1f4b['id']);}return _0x17f5d8[_0xfb5e('0x1b')][_0xfb5e('0x1c')]({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a['ListId'],'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a[_0xfb5e('0x1d')]:0x2,'scheduledat':_0x32b35a[_0xfb5e('0x1e')]?_0x32b35a[_0xfb5e('0x1e')]:moment()['format'](_0xfb5e('0x20')),'callback':_0x32b35a[_0xfb5e('0x21')]?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a['callbackUniqueid']:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()['format'](_0xfb5e('0x20')):undefined,'VoiceQueueId':_0x4f1f4b['id']});})[_0xfb5e('0x22')](function(_0x57c2ea){_0x20f9ca(_0x57c2ea);});});};function _0x5dbff5(){return function(_0x52acc8){logger['error']('cmContact',_0xfb5e('0x28'),util[_0xfb5e('0x16')](_0x52acc8,{'showHidden':![],'depth':null}));};}var _0x5599da=function(_0x8e6440){return new BPromise(function(_0x125aff,_0x9c5f60){_0x17f5d8['CmHopper']['findOne']({'where':{'phone':_0x32b35a['phone'],'CampaignId':_0x8e6440['id']}})[_0xfb5e('0x18')](function(_0x39a6cb){if(!_[_0xfb5e('0x19')](_0x39a6cb)){throw new Error(_0xfb5e('0x23')+_0x32b35a['phone']+_0xfb5e('0x29')+_0x8e6440['id']);}return _0x17f5d8['CmHopper'][_0xfb5e('0x1c')]({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a[_0xfb5e('0x2a')],'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a['priority']:0x2,'scheduledat':_0x32b35a[_0xfb5e('0x1e')]?_0x32b35a[_0xfb5e('0x1e')]:moment()['format'](_0xfb5e('0x20')),'callback':_0x32b35a[_0xfb5e('0x21')]?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a['callbackUniqueid']:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()['format'](_0xfb5e('0x20')):undefined,'CampaignId':_0x8e6440['id']});})[_0xfb5e('0x22')](function(_0x3fba2a){_0x9c5f60(_0x3fba2a);});});};var _0x5d5f35=function(_0x4695dc){return new BPromise(function(_0x43ec48,_0x562792){_0x17f5d8[_0xfb5e('0x1b')]['findOne']({'where':{'phone':_0x32b35a[_0xfb5e('0xd')],'CampaignId':_0x4695dc['id']}})[_0xfb5e('0x18')](function(_0x5bdf81){if(!_[_0xfb5e('0x19')](_0x5bdf81)){throw new Error(_0xfb5e('0x23')+_0x32b35a[_0xfb5e('0xd')]+_0xfb5e('0x2b')+_0x4695dc['id']);}return _0x17f5d8[_0xfb5e('0x25')][_0xfb5e('0x17')]({'where':{'calleridnum':_0x32b35a[_0xfb5e('0xd')],'CampaignId':_0x4695dc['id']}});})[_0xfb5e('0x18')](function(_0x389632){if(!_[_0xfb5e('0x19')](_0x389632)){throw new Error(_0xfb5e('0x26')+_0x32b35a[_0xfb5e('0xd')]+_0xfb5e('0x2c')+_0x4695dc['id']);}return _0x17f5d8[_0xfb5e('0x1b')]['create']({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a[_0xfb5e('0x2a')],'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a[_0xfb5e('0x1d')]:0x2,'scheduledat':_0x32b35a['scheduledat']?_0x32b35a[_0xfb5e('0x1e')]:moment()[_0xfb5e('0x1f')](_0xfb5e('0x20')),'callback':_0x32b35a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a[_0xfb5e('0x21')]:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()['format'](_0xfb5e('0x20')):undefined,'CampaignId':_0x4695dc['id']});})[_0xfb5e('0x22')](function(_0xdbf55){_0x562792(_0xdbf55);});});};if(_0x32b35a[_0xfb5e('0x2a')]){_0x17f5d8[_0xfb5e('0x2d')][_0xfb5e('0x2e')]({'where':{'type':_0xfb5e('0x2f')},'attributes':['id',_0xfb5e('0x30')],'include':[{'model':_0x17f5d8['CmList'],'as':_0xfb5e('0x31'),'where':{'id':_0x32b35a[_0xfb5e('0x2a')]}}]})[_0xfb5e('0x18')](function(_0x346d03){if(_0x346d03){var _0x67ec79=[];for(var _0x67bbc8=0x0,_0x1445b4;_0x67bbc8<_0x346d03[_0xfb5e('0x32')];_0x67bbc8+=0x1){_0x1445b4=_0x346d03[_0x67bbc8][_0xfb5e('0x13')]({'plain':!![]});switch(_0x1445b4['dialCheckDuplicateType']){case _0xfb5e('0x33'):_0x30dd13(_0x1445b4)[_0xfb5e('0x22')](_0x30813f());break;case _0xfb5e('0x34'):_0x3b2dae(_0x1445b4)['catch'](_0x30813f());break;default:_0x17f5d8[_0xfb5e('0x1b')][_0xfb5e('0x1c')]({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a[_0xfb5e('0x2a')],'scheduledat':_0x32b35a['scheduledat']?_0x32b35a[_0xfb5e('0x1e')]:moment()[_0xfb5e('0x1f')](_0xfb5e('0x20')),'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a['priority']:0x2,'callback':_0x32b35a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a[_0xfb5e('0x21')]:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()['format'](_0xfb5e('0x20')):undefined,'VoiceQueueId':_0x1445b4['id']})[_0xfb5e('0x22')](_0x30813f());}}}})[_0xfb5e('0x18')](function(){return _0x17f5d8[_0xfb5e('0x2d')]['findAll']({'where':{'type':_0xfb5e('0x2f')},'attributes':['id'],'include':[{'model':_0x17f5d8['CmList'],'as':'BlackLists','where':{'id':_0x32b35a[_0xfb5e('0x2a')]}}]})['then'](function(_0x5484e3){if(_0x5484e3){var _0x2a92b3=[];for(var _0x7b4da1=0x0,_0x26fa07;_0x7b4da1<_0x5484e3[_0xfb5e('0x32')];_0x7b4da1+=0x1){_0x26fa07=_0x5484e3[_0x7b4da1]['get']({'plain':!![]});_0x17f5d8[_0xfb5e('0x35')][_0xfb5e('0x1c')]({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a[_0xfb5e('0x2a')],'VoiceQueueId':_0x26fa07['id']})[_0xfb5e('0x22')](function(_0x4f7a9d){logger['error'](_0xfb5e('0x36'),_0xfb5e('0x28'),_0x4f7a9d['message']);});}}});})[_0xfb5e('0x18')](function(){return _0x17f5d8[_0xfb5e('0x37')]['findAll']({'attributes':['id',_0xfb5e('0x30')],'include':[{'model':_0x17f5d8[_0xfb5e('0x38')],'as':_0xfb5e('0x31'),'where':{'id':_0x32b35a[_0xfb5e('0x2a')]}}]})['then'](function(_0x488043){if(_0x488043){var _0x56596e=[];for(var _0x1849b6=0x0,_0x36cff0;_0x1849b6<_0x488043[_0xfb5e('0x32')];_0x1849b6+=0x1){_0x36cff0=_0x488043[_0x1849b6][_0xfb5e('0x13')]({'plain':!![]});switch(_0x36cff0[_0xfb5e('0x30')]){case _0xfb5e('0x33'):_0x5d5f35(_0x36cff0)[_0xfb5e('0x22')](_0x5dbff5());break;case _0xfb5e('0x34'):_0x5599da(_0x36cff0)[_0xfb5e('0x22')](_0x5dbff5());break;default:_0x17f5d8[_0xfb5e('0x1b')]['create']({'phone':_0x32b35a['phone'],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a['ListId'],'scheduledat':_0x32b35a[_0xfb5e('0x1e')]?_0x32b35a[_0xfb5e('0x1e')]:moment()[_0xfb5e('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x32b35a[_0xfb5e('0x1d')]?_0x32b35a[_0xfb5e('0x1d')]:0x2,'callback':_0x32b35a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32b35a[_0xfb5e('0x21')]?_0x32b35a[_0xfb5e('0x21')]:undefined,'callbackat':_0x32b35a[_0xfb5e('0x21')]?moment()[_0xfb5e('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x36cff0['id']})[_0xfb5e('0x22')](_0x5dbff5());}}}});})[_0xfb5e('0x18')](function(){return _0x17f5d8[_0xfb5e('0x37')][_0xfb5e('0x2e')]({'attributes':['id'],'include':[{'model':_0x17f5d8[_0xfb5e('0x38')],'as':_0xfb5e('0x39'),'where':{'id':_0x32b35a[_0xfb5e('0x2a')]}}]})['then'](function(_0x2f5131){if(_0x2f5131){var _0x290955=[];for(var _0x59157e=0x0,_0x30a5b1;_0x59157e<_0x2f5131[_0xfb5e('0x32')];_0x59157e+=0x1){_0x30a5b1=_0x2f5131[_0x59157e]['get']({'plain':!![]});_0x17f5d8[_0xfb5e('0x35')][_0xfb5e('0x1c')]({'phone':_0x32b35a[_0xfb5e('0xd')],'ContactId':_0x32b35a['id'],'ListId':_0x32b35a['ListId'],'CampaignId':_0x30a5b1['id']})[_0xfb5e('0x22')](function(_0x33543f){logger['error'](_0xfb5e('0x36'),'afterCreate',_0x33543f[_0xfb5e('0x3a')]);});}}});})['then'](function(){_0x154544();})['catch'](function(_0x33d58f){logger['error'](_0xfb5e('0x36'),_0xfb5e('0x28'),_0x33d58f['message']);_0x154544(_0x33d58f);});}else{_0x154544(new Error(_0xfb5e('0x3b')));}},'afterDestroy':function(_0x22a3e9,_0x3d28d8,_0x24011e){var _0x1bd90f=_0x3a2072[_0xfb5e('0x3c')];var _0x1cb381=_0x22a3e9['get']({'plain':!![]});return _0x1bd90f[_0xfb5e('0x1b')]['findAll']({'raw':!![],'where':{'ListId':_0x1cb381[_0xfb5e('0x2a')],'ContactId':_0x1cb381['id']}})[_0xfb5e('0x18')](function(_0x2854af){if(!_[_0xfb5e('0x3d')](_0x2854af)){var _0x4f83a4=[];for(var _0x4ab8d6=0x0;_0x4ab8d6<_0x2854af['length'];_0x4ab8d6+=0x1){var _0x19d708=_0x1bd90f['CmHopper'][_0xfb5e('0x3e')]({'where':{'ListId':_0x2854af[_0x4ab8d6][_0xfb5e('0x2a')],'ContactId':_0x2854af[_0x4ab8d6][_0xfb5e('0x3f')],'VoiceQueueId':_0x2854af[_0x4ab8d6][_0xfb5e('0x40')],'CampaignId':_0x2854af[_0x4ab8d6]['CampaignId']}});_0x4f83a4[_0xfb5e('0x41')](_0x19d708);}return BPromise[_0xfb5e('0x42')](_0x4f83a4);}})[_0xfb5e('0x18')](function(_0x318348){logger['info'](_0xfb5e('0x43'),util[_0xfb5e('0x16')](_0x318348,{'showHidden':![],'depth':null}));_0x24011e();})[_0xfb5e('0x22')](function(_0x15ebb0){logger['error'](_0xfb5e('0x44'),util['inspect'](_0x15ebb0,{'showHidden':![],'depth':null}));_0x24011e(_0x15ebb0);});}}});};
\ No newline at end of file
+var _0x09ac=['findAll','outbound','dialCheckDuplicateType','length','always','CmList','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','onlyIfOpen','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','push','info','[CmContact][afterDestroy][Error]','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','scheduledat','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue'];(function(_0x487da7,_0x1bcf3d){var _0x195c60=function(_0x110c70){while(--_0x110c70){_0x487da7['push'](_0x487da7['shift']());}};_0x195c60(++_0x1bcf3d);}(_0x09ac,0x14e));var _0xc09a=function(_0x31b7d7,_0x3de9ed){_0x31b7d7=_0x31b7d7-0x0;var _0x3a376e=_0x09ac[_0x31b7d7];return _0x3a376e;};'use strict';var _=require('lodash');var util=require(_0xc09a('0x0'));var logger=require(_0xc09a('0x1'))(_0xc09a('0x2'));var moment=require('moment');var BPromise=require(_0xc09a('0x3'));var rp=require(_0xc09a('0x4'));var fs=require('fs');var path=require(_0xc09a('0x5'));var rimraf=require(_0xc09a('0x6'));var config=require('../../config/environment');var attributes=require(_0xc09a('0x7'));module[_0xc09a('0x8')]=function(_0x4ab14a,_0x4992d3){return _0x4ab14a['define'](_0xc09a('0x9'),attributes,{'tableName':_0xc09a('0xa'),'paranoid':!![],'indexes':[{'name':_0xc09a('0xb'),'fields':['phone']},{'name':_0xc09a('0xc'),'fields':[_0xc09a('0xd'),_0xc09a('0xe'),_0xc09a('0xb'),_0xc09a('0xf'),_0xc09a('0x10'),_0xc09a('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xc09a('0x12'),'collate':_0xc09a('0x13'),'hooks':{'afterCreate':function(_0x1855e7,_0x11be5e,_0x6ec065){var _0x1a2558=_0x4ab14a[_0xc09a('0x14')];var _0x1e7c6a=_0x1855e7[_0xc09a('0x15')]({'plain':!![]});function _0x5d6541(){return function(_0x182409){logger[_0xc09a('0x16')](_0xc09a('0x17'),_0xc09a('0x18'),util[_0xc09a('0x19')](_0x182409,{'showHidden':![],'depth':null}));};}var _0x57b63b=function(_0x11b927){return new BPromise(function(_0x1ed6a1,_0x447ace){_0x1a2558[_0xc09a('0x1a')][_0xc09a('0x1b')]({'where':{'phone':_0x1e7c6a[_0xc09a('0xb')],'VoiceQueueId':_0x11b927['id']}})[_0xc09a('0x1c')](function(_0x5d4d97){if(!_[_0xc09a('0x1d')](_0x5d4d97)){throw new Error(_0xc09a('0x1e')+_0x1e7c6a[_0xc09a('0xb')]+_0xc09a('0x1f')+_0x11b927['id']);}return _0x1a2558[_0xc09a('0x1a')][_0xc09a('0x20')]({'phone':_0x1e7c6a[_0xc09a('0xb')],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a[_0xc09a('0x22')]:0x2,'scheduledat':_0x1e7c6a['scheduledat']?_0x1e7c6a['scheduledat']:moment()[_0xc09a('0x23')](_0xc09a('0x24')),'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a[_0xc09a('0x25')]?_0x1e7c6a['callbackUniqueid']:undefined,'callbackat':_0x1e7c6a[_0xc09a('0x25')]?moment()[_0xc09a('0x23')](_0xc09a('0x24')):undefined,'VoiceQueueId':_0x11b927['id']});})[_0xc09a('0x26')](function(_0x42a949){_0x447ace(_0x42a949);});});};var _0x22144e=function(_0x5b7fc2){return new BPromise(function(_0x3add36,_0x302533){_0x1a2558[_0xc09a('0x1a')][_0xc09a('0x1b')]({'where':{'phone':_0x1e7c6a[_0xc09a('0xb')],'VoiceQueueId':_0x5b7fc2['id']}})['then'](function(_0x55ea43){if(!_[_0xc09a('0x1d')](_0x55ea43)){throw new Error(_0xc09a('0x1e')+_0x1e7c6a['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5b7fc2['id']);}return _0x1a2558[_0xc09a('0x27')][_0xc09a('0x1b')]({'where':{'calleridnum':_0x1e7c6a[_0xc09a('0xb')],'VoiceQueueId':_0x5b7fc2['id']}});})[_0xc09a('0x1c')](function(_0x892c77){if(!_['isNil'](_0x892c77)){throw new Error(_0xc09a('0x28')+_0x1e7c6a[_0xc09a('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5b7fc2['id']);}return _0x1a2558['CmHopper'][_0xc09a('0x20')]({'phone':_0x1e7c6a['phone'],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a['ListId'],'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a[_0xc09a('0x22')]:0x2,'scheduledat':_0x1e7c6a[_0xc09a('0x29')]?_0x1e7c6a['scheduledat']:moment()[_0xc09a('0x23')](_0xc09a('0x24')),'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a[_0xc09a('0x25')]?_0x1e7c6a[_0xc09a('0x25')]:undefined,'callbackat':_0x1e7c6a[_0xc09a('0x25')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x5b7fc2['id']});})[_0xc09a('0x26')](function(_0x419cf2){_0x302533(_0x419cf2);});});};function _0x238de6(){return function(_0x5124f7){logger[_0xc09a('0x16')](_0xc09a('0x17'),_0xc09a('0x18'),util[_0xc09a('0x19')](_0x5124f7,{'showHidden':![],'depth':null}));};}var _0x38404d=function(_0xdbb762){return new BPromise(function(_0xeb158d,_0x303a5c){_0x1a2558['CmHopper'][_0xc09a('0x1b')]({'where':{'phone':_0x1e7c6a[_0xc09a('0xb')],'CampaignId':_0xdbb762['id']}})[_0xc09a('0x1c')](function(_0x44aa24){if(!_['isNil'](_0x44aa24)){throw new Error(_0xc09a('0x1e')+_0x1e7c6a[_0xc09a('0xb')]+_0xc09a('0x2a')+_0xdbb762['id']);}return _0x1a2558[_0xc09a('0x1a')][_0xc09a('0x20')]({'phone':_0x1e7c6a[_0xc09a('0xb')],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a[_0xc09a('0x22')]:0x2,'scheduledat':_0x1e7c6a[_0xc09a('0x29')]?_0x1e7c6a['scheduledat']:moment()[_0xc09a('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a[_0xc09a('0x25')]?_0x1e7c6a[_0xc09a('0x25')]:undefined,'callbackat':_0x1e7c6a['callbackUniqueid']?moment()[_0xc09a('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xdbb762['id']});})[_0xc09a('0x26')](function(_0x47b511){_0x303a5c(_0x47b511);});});};var _0x2f27ea=function(_0x469d2a){return new BPromise(function(_0x123bd1,_0x5b2f88){_0x1a2558[_0xc09a('0x1a')][_0xc09a('0x1b')]({'where':{'phone':_0x1e7c6a[_0xc09a('0xb')],'CampaignId':_0x469d2a['id']}})['then'](function(_0x36e290){if(!_[_0xc09a('0x1d')](_0x36e290)){throw new Error(_0xc09a('0x1e')+_0x1e7c6a[_0xc09a('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x469d2a['id']);}return _0x1a2558[_0xc09a('0x27')][_0xc09a('0x1b')]({'where':{'calleridnum':_0x1e7c6a[_0xc09a('0xb')],'CampaignId':_0x469d2a['id']}});})[_0xc09a('0x1c')](function(_0x2543d0){if(!_[_0xc09a('0x1d')](_0x2543d0)){throw new Error(_0xc09a('0x28')+_0x1e7c6a[_0xc09a('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x469d2a['id']);}return _0x1a2558[_0xc09a('0x1a')]['create']({'phone':_0x1e7c6a['phone'],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a['priority']:0x2,'scheduledat':_0x1e7c6a[_0xc09a('0x29')]?_0x1e7c6a[_0xc09a('0x29')]:moment()['format'](_0xc09a('0x24')),'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a['callbackUniqueid']?_0x1e7c6a['callbackUniqueid']:undefined,'callbackat':_0x1e7c6a[_0xc09a('0x25')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x469d2a['id']});})['catch'](function(_0x59c383){_0x5b2f88(_0x59c383);});});};if(_0x1e7c6a[_0xc09a('0x21')]){_0x1a2558[_0xc09a('0x2b')][_0xc09a('0x2c')]({'where':{'type':_0xc09a('0x2d')},'attributes':['id',_0xc09a('0x2e')],'include':[{'model':_0x1a2558['CmList'],'as':'Lists','where':{'id':_0x1e7c6a[_0xc09a('0x21')]}}]})[_0xc09a('0x1c')](function(_0x374270){if(_0x374270){var _0xd1e64a=[];for(var _0x1519fc=0x0,_0x9f7a5;_0x1519fc<_0x374270[_0xc09a('0x2f')];_0x1519fc+=0x1){_0x9f7a5=_0x374270[_0x1519fc][_0xc09a('0x15')]({'plain':!![]});switch(_0x9f7a5[_0xc09a('0x2e')]){case _0xc09a('0x30'):_0x22144e(_0x9f7a5)[_0xc09a('0x26')](_0x5d6541());break;case'onlyIfOpen':_0x57b63b(_0x9f7a5)[_0xc09a('0x26')](_0x5d6541());break;default:_0x1a2558[_0xc09a('0x1a')][_0xc09a('0x20')]({'phone':_0x1e7c6a['phone'],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'scheduledat':_0x1e7c6a[_0xc09a('0x29')]?_0x1e7c6a[_0xc09a('0x29')]:moment()[_0xc09a('0x23')](_0xc09a('0x24')),'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a['priority']:0x2,'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a[_0xc09a('0x25')]?_0x1e7c6a[_0xc09a('0x25')]:undefined,'callbackat':_0x1e7c6a[_0xc09a('0x25')]?moment()[_0xc09a('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x9f7a5['id']})[_0xc09a('0x26')](_0x5d6541());}}}})[_0xc09a('0x1c')](function(){return _0x1a2558['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1a2558[_0xc09a('0x31')],'as':_0xc09a('0x32'),'where':{'id':_0x1e7c6a[_0xc09a('0x21')]}}]})[_0xc09a('0x1c')](function(_0x15d7ec){if(_0x15d7ec){var _0x40e0fd=[];for(var _0x2ec852=0x0,_0x1e36db;_0x2ec852<_0x15d7ec[_0xc09a('0x2f')];_0x2ec852+=0x1){_0x1e36db=_0x15d7ec[_0x2ec852][_0xc09a('0x15')]({'plain':!![]});_0x1a2558['CmHopperBlack']['create']({'phone':_0x1e7c6a[_0xc09a('0xb')],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'VoiceQueueId':_0x1e36db['id']})[_0xc09a('0x26')](function(_0xbbeeac){logger[_0xc09a('0x16')](_0xc09a('0x33'),'afterCreate',_0xbbeeac[_0xc09a('0x34')]);});}}});})['then'](function(){return _0x1a2558[_0xc09a('0x35')][_0xc09a('0x2c')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x1a2558[_0xc09a('0x31')],'as':'Lists','where':{'id':_0x1e7c6a[_0xc09a('0x21')]}}]})['then'](function(_0x4d3e69){if(_0x4d3e69){var _0x5a01a7=[];for(var _0x33443c=0x0,_0x32345e;_0x33443c<_0x4d3e69[_0xc09a('0x2f')];_0x33443c+=0x1){_0x32345e=_0x4d3e69[_0x33443c]['get']({'plain':!![]});switch(_0x32345e[_0xc09a('0x2e')]){case'always':_0x2f27ea(_0x32345e)['catch'](_0x238de6());break;case _0xc09a('0x36'):_0x38404d(_0x32345e)[_0xc09a('0x26')](_0x238de6());break;default:_0x1a2558[_0xc09a('0x1a')][_0xc09a('0x20')]({'phone':_0x1e7c6a[_0xc09a('0xb')],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'scheduledat':_0x1e7c6a['scheduledat']?_0x1e7c6a[_0xc09a('0x29')]:moment()[_0xc09a('0x23')](_0xc09a('0x24')),'priority':_0x1e7c6a[_0xc09a('0x22')]?_0x1e7c6a[_0xc09a('0x22')]:0x2,'callback':_0x1e7c6a[_0xc09a('0x25')]?!![]:![],'callbackuniqueid':_0x1e7c6a['callbackUniqueid']?_0x1e7c6a[_0xc09a('0x25')]:undefined,'callbackat':_0x1e7c6a[_0xc09a('0x25')]?moment()[_0xc09a('0x23')](_0xc09a('0x24')):undefined,'CampaignId':_0x32345e['id']})[_0xc09a('0x26')](_0x238de6());}}}});})['then'](function(){return _0x1a2558[_0xc09a('0x35')]['findAll']({'attributes':['id'],'include':[{'model':_0x1a2558['CmList'],'as':'BlackLists','where':{'id':_0x1e7c6a[_0xc09a('0x21')]}}]})['then'](function(_0x84874){if(_0x84874){var _0x57f197=[];for(var _0x163ee4=0x0,_0x5316fb;_0x163ee4<_0x84874[_0xc09a('0x2f')];_0x163ee4+=0x1){_0x5316fb=_0x84874[_0x163ee4][_0xc09a('0x15')]({'plain':!![]});_0x1a2558[_0xc09a('0x37')]['create']({'phone':_0x1e7c6a['phone'],'ContactId':_0x1e7c6a['id'],'ListId':_0x1e7c6a[_0xc09a('0x21')],'CampaignId':_0x5316fb['id']})[_0xc09a('0x26')](function(_0x506cd4){logger[_0xc09a('0x16')](_0xc09a('0x33'),_0xc09a('0x18'),_0x506cd4[_0xc09a('0x34')]);});}}});})[_0xc09a('0x1c')](function(){_0x6ec065();})[_0xc09a('0x26')](function(_0x1c350d){logger[_0xc09a('0x16')](_0xc09a('0x33'),_0xc09a('0x18'),_0x1c350d[_0xc09a('0x34')]);_0x6ec065(_0x1c350d);});}else{_0x6ec065(new Error(_0xc09a('0x38')));}},'afterDestroy':function(_0x353084,_0x2e2650,_0x12552f){var _0x331378=_0x4ab14a[_0xc09a('0x14')];var _0x1ce338=_0x353084[_0xc09a('0x15')]({'plain':!![]});return _0x331378[_0xc09a('0x1a')][_0xc09a('0x2c')]({'raw':!![],'where':{'ListId':_0x1ce338[_0xc09a('0x21')],'ContactId':_0x1ce338['id']}})[_0xc09a('0x1c')](function(_0x37ebec){if(!_[_0xc09a('0x39')](_0x37ebec)){var _0x262099=[];for(var _0x3ec2b5=0x0;_0x3ec2b5<_0x37ebec[_0xc09a('0x2f')];_0x3ec2b5+=0x1){var _0x1b1346=_0x331378[_0xc09a('0x1a')][_0xc09a('0x3a')]({'where':{'ListId':_0x37ebec[_0x3ec2b5][_0xc09a('0x21')],'ContactId':_0x37ebec[_0x3ec2b5]['ContactId'],'VoiceQueueId':_0x37ebec[_0x3ec2b5][_0xc09a('0x3b')],'CampaignId':_0x37ebec[_0x3ec2b5]['CampaignId']}});_0x262099[_0xc09a('0x3c')](_0x1b1346);}return BPromise['all'](_0x262099);}})[_0xc09a('0x1c')](function(_0x2a1681){logger[_0xc09a('0x3d')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x2a1681,{'showHidden':![],'depth':null}));_0x12552f();})[_0xc09a('0x26')](function(_0x8aca9c){logger[_0xc09a('0x16')](_0xc09a('0x3e'),util['inspect'](_0x8aca9c,{'showHidden':![],'depth':null}));_0x12552f(_0x8aca9c);});}}});};
\ No newline at end of file
index e0cd760..45c1a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ac=['moment','randomstring','squel','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','info','CmContact,\x20%s,\x20%s','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetCmContact','findAll','raw','options','where','include','map','model','attributes','then','debug','stringify','CreateCmContact','body','length','startsWith','cf_','table','cm_contacts','set','id\x20=\x20?','sequelize','query','lodash','util'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0xf4ac,0xb6));var _0xcf4a=function(_0x3738ca,_0x4bfc80){_0x3738ca=_0x3738ca-0x0;var _0x5b34f0=_0xf4ac[_0x3738ca];return _0x5b34f0;};'use strict';var _=require(_0xcf4a('0x0'));var util=require(_0xcf4a('0x1'));var moment=require(_0xcf4a('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0xcf4a('0x4'));var db=require(_0xcf4a('0x5'))['db'];var utils=require(_0xcf4a('0x6'));var logger=require('../../config/logger')(_0xcf4a('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf4a('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcf4a('0x9')]=_[_0xcf4a('0xa')](config[_0xcf4a('0x9')],{'host':_0xcf4a('0xb'),'port':0x18eb});var socket=require(_0xcf4a('0xc'))(new Redis(config[_0xcf4a('0x9')]));require(_0xcf4a('0xd'))[_0xcf4a('0xe')](socket);function respondWithRpcPromise(_0x23a856,_0x3ca4ed,_0xe2499){return new BPromise(function(_0x5221ea,_0x41f26c){return client[_0xcf4a('0xf')](_0x23a856,_0xe2499)['then'](function(_0x2798b3){logger[_0xcf4a('0x10')](_0xcf4a('0x11'),_0x3ca4ed,'request\x20sent');logger['debug'](_0xcf4a('0x12'),_0x3ca4ed,_0xcf4a('0x13'),JSON['stringify'](_0x2798b3));if(_0x2798b3[_0xcf4a('0x14')]){if(_0x2798b3[_0xcf4a('0x14')][_0xcf4a('0x15')]===0x1f4){logger[_0xcf4a('0x14')]('CmContact,\x20%s,\x20%s',_0x3ca4ed,_0x2798b3['error'][_0xcf4a('0x16')]);return _0x41f26c(_0x2798b3[_0xcf4a('0x14')][_0xcf4a('0x16')]);}logger[_0xcf4a('0x14')](_0xcf4a('0x11'),_0x3ca4ed,_0x2798b3[_0xcf4a('0x14')][_0xcf4a('0x16')]);return _0x5221ea(_0x2798b3['error'][_0xcf4a('0x16')]);}else{logger['info'](_0xcf4a('0x11'),_0x3ca4ed,_0xcf4a('0x13'));_0x5221ea(_0x2798b3['result'][_0xcf4a('0x16')]);}})['catch'](function(_0x5092ec){logger[_0xcf4a('0x14')](_0xcf4a('0x11'),_0x3ca4ed,_0x5092ec);_0x41f26c(_0x5092ec);});});}exports[_0xcf4a('0x17')]=function(_0x5c825c){var _0x5b3bb0=this;return new Promise(function(_0x4e1642,_0x100bee){return db['CmContact'][_0xcf4a('0x18')]({'raw':_0x5c825c['options']?_0x5c825c['options'][_0xcf4a('0x19')]===undefined?!![]:![]:!![],'where':_0x5c825c[_0xcf4a('0x1a')]?_0x5c825c[_0xcf4a('0x1a')][_0xcf4a('0x1b')]||null:null,'attributes':_0x5c825c['options']?_0x5c825c[_0xcf4a('0x1a')]['attributes']||null:null,'limit':_0x5c825c['options']?_0x5c825c[_0xcf4a('0x1a')]['limit']||null:null,'include':_0x5c825c[_0xcf4a('0x1a')]?_0x5c825c[_0xcf4a('0x1a')][_0xcf4a('0x1c')]?_[_0xcf4a('0x1d')](_0x5c825c[_0xcf4a('0x1a')]['include'],function(_0x377c9e){return{'model':db[_0x377c9e[_0xcf4a('0x1e')]],'as':_0x377c9e['as'],'attributes':_0x377c9e['attributes'],'include':_0x377c9e[_0xcf4a('0x1c')]?_[_0xcf4a('0x1d')](_0x377c9e[_0xcf4a('0x1c')],function(_0x4c9588){return{'model':db[_0x4c9588['model']],'as':_0x4c9588['as'],'attributes':_0x4c9588[_0xcf4a('0x1f')],'include':_0x4c9588[_0xcf4a('0x1c')]?_[_0xcf4a('0x1d')](_0x4c9588[_0xcf4a('0x1c')],function(_0x3a7c22){return{'model':db[_0x3a7c22['model']],'as':_0x3a7c22['as'],'attributes':_0x3a7c22[_0xcf4a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf4a('0x20')](function(_0x5b9e26){logger[_0xcf4a('0x10')](_0xcf4a('0x17'),_0x5c825c);logger[_0xcf4a('0x21')](_0xcf4a('0x17'),_0x5c825c,JSON[_0xcf4a('0x22')](_0x5b9e26));_0x4e1642(_0x5b9e26);})['catch'](function(_0x6e3b3d){logger[_0xcf4a('0x14')]('GetCmContact',_0x6e3b3d[_0xcf4a('0x16')],_0x5c825c);_0x100bee(_0x5b3bb0[_0xcf4a('0x14')](0x1f4,_0x6e3b3d[_0xcf4a('0x16')]));});});};exports[_0xcf4a('0x23')]=function(_0x51d1b5){var _0x1089b3=this;return new Promise(function(_0x2134a4,_0x4d4cef){return db['CmContact']['create'](_0x51d1b5[_0xcf4a('0x24')],{'raw':_0x51d1b5[_0xcf4a('0x1a')]?_0x51d1b5[_0xcf4a('0x1a')][_0xcf4a('0x19')]===undefined?!![]:![]:!![]})[_0xcf4a('0x20')](function(_0x188713){var _0x455ca1;for(var _0x4ae849=0x0;_0x4ae849<Object['keys'](_0x51d1b5[_0xcf4a('0x24')])[_0xcf4a('0x25')];_0x4ae849++){var _0x48bc73=Object['keys'](_0x51d1b5[_0xcf4a('0x24')])[_0x4ae849];if(_0x48bc73[_0xcf4a('0x26')](_0xcf4a('0x27'))){_0x455ca1=squel['update']()[_0xcf4a('0x28')](_0xcf4a('0x29'))[_0xcf4a('0x2a')](_0x48bc73,_0x51d1b5['body'][_0x48bc73])[_0xcf4a('0x1b')](_0xcf4a('0x2b'),_0x188713['id'])['toString']();break;}}if(!_0x455ca1)return _0x188713;return db[_0xcf4a('0x2c')][_0xcf4a('0x2d')](_0x455ca1)[_0xcf4a('0x20')](function(){return _0x188713;});})[_0xcf4a('0x20')](function(_0x475e6d){logger[_0xcf4a('0x10')](_0xcf4a('0x23'),_0x51d1b5);logger[_0xcf4a('0x21')](_0xcf4a('0x23'),_0x51d1b5,JSON[_0xcf4a('0x22')](_0x475e6d));_0x2134a4(_0x475e6d);})['catch'](function(_0x4ca566){logger['error']('CreateCmContact',_0x4ca566[_0xcf4a('0x16')],_0x51d1b5);_0x4d4cef(_0x1089b3[_0xcf4a('0x14')](0x1f4,_0x4ca566['message']));});});};
\ No newline at end of file
+var _0x49fc=['startsWith','cf_','update','cm_contacts','set','toString','sequelize','query','lodash','util','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','CmContact','findAll','options','where','attributes','limit','include','map','model','GetCmContact','stringify','CreateCmContact','body','raw','keys'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49fc,0xa4));var _0xc49f=function(_0x2f92e0,_0x411270){_0x2f92e0=_0x2f92e0-0x0;var _0x2f7367=_0x49fc[_0x2f92e0];return _0x2f7367;};'use strict';var _=require(_0xc49f('0x0'));var util=require(_0xc49f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc49f('0x2'));var fs=require('fs');var Redis=require(_0xc49f('0x3'));var squel=require(_0xc49f('0x4'));var db=require(_0xc49f('0x5'))['db'];var utils=require(_0xc49f('0x6'));var logger=require(_0xc49f('0x7'))(_0xc49f('0x8'));var config=require(_0xc49f('0x9'));var jayson=require(_0xc49f('0xa'));var client=jayson[_0xc49f('0xb')][_0xc49f('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc49f('0xd')],{'host':_0xc49f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc49f('0xd')]));require(_0xc49f('0xf'))[_0xc49f('0x10')](socket);function respondWithRpcPromise(_0x425203,_0x243d56,_0x5301aa){return new BPromise(function(_0x3f3c12,_0x823e24){return client[_0xc49f('0x11')](_0x425203,_0x5301aa)[_0xc49f('0x12')](function(_0x3ca83b){logger['info'](_0xc49f('0x13'),_0x243d56,'request\x20sent');logger[_0xc49f('0x14')](_0xc49f('0x15'),_0x243d56,_0xc49f('0x16'),JSON['stringify'](_0x3ca83b));if(_0x3ca83b['error']){if(_0x3ca83b['error'][_0xc49f('0x17')]===0x1f4){logger[_0xc49f('0x18')](_0xc49f('0x13'),_0x243d56,_0x3ca83b[_0xc49f('0x18')][_0xc49f('0x19')]);return _0x823e24(_0x3ca83b[_0xc49f('0x18')]['message']);}logger['error'](_0xc49f('0x13'),_0x243d56,_0x3ca83b[_0xc49f('0x18')][_0xc49f('0x19')]);return _0x3f3c12(_0x3ca83b[_0xc49f('0x18')]['message']);}else{logger[_0xc49f('0x1a')](_0xc49f('0x13'),_0x243d56,'request\x20sent');_0x3f3c12(_0x3ca83b[_0xc49f('0x1b')]['message']);}})[_0xc49f('0x1c')](function(_0x13fc39){logger[_0xc49f('0x18')](_0xc49f('0x13'),_0x243d56,_0x13fc39);_0x823e24(_0x13fc39);});});}exports['GetCmContact']=function(_0x49dc91){var _0x5b2b58=this;return new Promise(function(_0x55d2e0,_0x42e103){return db[_0xc49f('0x1d')][_0xc49f('0x1e')]({'raw':_0x49dc91[_0xc49f('0x1f')]?_0x49dc91[_0xc49f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x49dc91[_0xc49f('0x1f')]?_0x49dc91[_0xc49f('0x1f')][_0xc49f('0x20')]||null:null,'attributes':_0x49dc91['options']?_0x49dc91['options'][_0xc49f('0x21')]||null:null,'limit':_0x49dc91['options']?_0x49dc91[_0xc49f('0x1f')][_0xc49f('0x22')]||null:null,'include':_0x49dc91[_0xc49f('0x1f')]?_0x49dc91[_0xc49f('0x1f')][_0xc49f('0x23')]?_[_0xc49f('0x24')](_0x49dc91[_0xc49f('0x1f')][_0xc49f('0x23')],function(_0x5a6163){return{'model':db[_0x5a6163[_0xc49f('0x25')]],'as':_0x5a6163['as'],'attributes':_0x5a6163[_0xc49f('0x21')],'include':_0x5a6163[_0xc49f('0x23')]?_[_0xc49f('0x24')](_0x5a6163[_0xc49f('0x23')],function(_0x606694){return{'model':db[_0x606694['model']],'as':_0x606694['as'],'attributes':_0x606694[_0xc49f('0x21')],'include':_0x606694[_0xc49f('0x23')]?_[_0xc49f('0x24')](_0x606694[_0xc49f('0x23')],function(_0x4aba81){return{'model':db[_0x4aba81[_0xc49f('0x25')]],'as':_0x4aba81['as'],'attributes':_0x4aba81[_0xc49f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc49f('0x12')](function(_0x4d7672){logger['info'](_0xc49f('0x26'),_0x49dc91);logger[_0xc49f('0x14')](_0xc49f('0x26'),_0x49dc91,JSON[_0xc49f('0x27')](_0x4d7672));_0x55d2e0(_0x4d7672);})[_0xc49f('0x1c')](function(_0x5a61c3){logger['error'](_0xc49f('0x26'),_0x5a61c3[_0xc49f('0x19')],_0x49dc91);_0x42e103(_0x5b2b58[_0xc49f('0x18')](0x1f4,_0x5a61c3['message']));});});};exports[_0xc49f('0x28')]=function(_0x37482a){var _0x3cc33f=this;return new Promise(function(_0x31c000,_0x407342){return db[_0xc49f('0x1d')]['create'](_0x37482a[_0xc49f('0x29')],{'raw':_0x37482a[_0xc49f('0x1f')]?_0x37482a[_0xc49f('0x1f')][_0xc49f('0x2a')]===undefined?!![]:![]:!![]})['then'](function(_0x330506){var _0x161e4e;for(var _0x66c794=0x0;_0x66c794<Object['keys'](_0x37482a[_0xc49f('0x29')])['length'];_0x66c794++){var _0x2cef8b=Object[_0xc49f('0x2b')](_0x37482a['body'])[_0x66c794];if(_0x2cef8b[_0xc49f('0x2c')](_0xc49f('0x2d'))){_0x161e4e=squel[_0xc49f('0x2e')]()['table'](_0xc49f('0x2f'))[_0xc49f('0x30')](_0x2cef8b,_0x37482a['body'][_0x2cef8b])[_0xc49f('0x20')]('id\x20=\x20?',_0x330506['id'])[_0xc49f('0x31')]();break;}}if(!_0x161e4e)return _0x330506;return db[_0xc49f('0x32')][_0xc49f('0x33')](_0x161e4e)[_0xc49f('0x12')](function(){return _0x330506;});})[_0xc49f('0x12')](function(_0x50110e){logger[_0xc49f('0x1a')](_0xc49f('0x28'),_0x37482a);logger[_0xc49f('0x14')](_0xc49f('0x28'),_0x37482a,JSON['stringify'](_0x50110e));_0x31c000(_0x50110e);})[_0xc49f('0x1c')](function(_0xcd1a9e){logger['error'](_0xc49f('0x28'),_0xcd1a9e[_0xc49f('0x19')],_0x37482a);_0x407342(_0x3cc33f[_0xc49f('0x18')](0x1f4,_0xcd1a9e['message']));});});};
\ No newline at end of file
index 2df95f7..5b279f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 9ac9d6f..5725872 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(_0x55b1d1,_0x4f35fe){var _0x379c58=function(_0x4de32b){while(--_0x4de32b){_0x55b1d1['push'](_0x55b1d1['shift']());}};_0x379c58(++_0x4f35fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0xbc24e,_0x49ad64){var _0x1c55d5=function(_0x157cc6){while(--_0x157cc6){_0xbc24e['push'](_0xbc24e['shift']());}};_0x1c55d5(++_0x49ad64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 3735386..112c483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67a2=['PHONE','sequelize','exports','STRING','INTEGER'];(function(_0x1ce71a,_0x1ccd6a){var _0x515e7b=function(_0x3a08d2){while(--_0x3a08d2){_0x1ce71a['push'](_0x1ce71a['shift']());}};_0x515e7b(++_0x1ccd6a);}(_0x67a2,0xd3));var _0x267a=function(_0x3f7c48,_0x382cc3){_0x3f7c48=_0x3f7c48-0x0;var _0x25df2b=_0x67a2[_0x3f7c48];return _0x25df2b;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x267a('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x267a('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x267a('0x2')],'defaultValue':_0x267a('0x4')},'OrderBy':{'type':Sequelize[_0x267a('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x267a('0x2')],'defaultValue':null}};
\ No newline at end of file
+var _0xc1c4=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x16ad2f,_0xf2810){var _0x52d275=function(_0x1fceb4){while(--_0x1fceb4){_0x16ad2f['push'](_0x16ad2f['shift']());}};_0x52d275(++_0xf2810);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x267073,_0x38c98a){_0x267073=_0x267073-0x0;var _0x385834=_0xc1c4[_0x267073];return _0x385834;};'use strict';var Sequelize=require(_0x4c1c('0x0'));module[_0x4c1c('0x1')]={'CmContactId':{'type':Sequelize[_0x4c1c('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x4c1c('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x4c1c('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x4c1c('0x3')],'defaultValue':_0x4c1c('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x4c1c('0x3')],'defaultValue':null}};
\ No newline at end of file
index 0ef527e..c29d92c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x238b=['limit','undefined','count','set','Content-Range','reject','then','destroy','get','CmContactHasItems','UserProfileResource','status','error','name','send','index','CmContactHasItem','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','includeAll','include','findAll','rows','catch','keys','length','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x18de6c,_0x4cb805){var _0x54b14d=function(_0xc9b32b){while(--_0xc9b32b){_0x18de6c['push'](_0x18de6c['shift']());}};_0x54b14d(++_0x4cb805);}(_0x238b,0x122));var _0xb238=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x238b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb238('0x0'));var rimraf=require(_0xb238('0x1'));var zipdir=require(_0xb238('0x2'));var jsonpatch=require(_0xb238('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb238('0x4'));var Mustache=require(_0xb238('0x5'));var util=require(_0xb238('0x6'));var path=require('path');var sox=require(_0xb238('0x7'));var csv=require(_0xb238('0x8'));var ejs=require(_0xb238('0x9'));var fs=require('fs');var fs_extra=require(_0xb238('0xa'));var _=require(_0xb238('0xb'));var squel=require(_0xb238('0xc'));var crypto=require(_0xb238('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb238('0xe'));var toCsv=require(_0xb238('0x8'));var querystring=require(_0xb238('0xf'));var Papa=require(_0xb238('0x10'));var Redis=require(_0xb238('0x11'));var authService=require(_0xb238('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb238('0x13'));var hardwareService=require(_0xb238('0x14'));var logger=require(_0xb238('0x15'))(_0xb238('0x16'));var utils=require(_0xb238('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb238('0x18'));var db=require(_0xb238('0x19'))['db'];function respondWithStatusCode(_0x168ba6,_0x294098){_0x294098=_0x294098||0xcc;return function(_0x5b96c9){if(_0x5b96c9){return _0x168ba6[_0xb238('0x1a')](_0x294098);}return _0x168ba6['status'](_0x294098)[_0xb238('0x1b')]();};}function respondWithResult(_0x558e37,_0x56d385){_0x56d385=_0x56d385||0xc8;return function(_0x124974){if(_0x124974){return _0x558e37['status'](_0x56d385)[_0xb238('0x1c')](_0x124974);}};}function respondWithFilteredResult(_0x2ea19a,_0x5b47ce){return function(_0xb7e322){if(_0xb7e322){var _0x3eca21=typeof _0x5b47ce[_0xb238('0x1d')]==='undefined'&&typeof _0x5b47ce[_0xb238('0x1e')]===_0xb238('0x1f');var _0x10629d=_0xb7e322[_0xb238('0x20')];var _0x3d9c77=_0x3eca21?0x0:_0x5b47ce[_0xb238('0x1d')];var _0x44eee5=_0x3eca21?_0xb7e322[_0xb238('0x20')]:_0x5b47ce[_0xb238('0x1d')]+_0x5b47ce[_0xb238('0x1e')];var _0x594685;if(_0x44eee5>=_0x10629d){_0x44eee5=_0x10629d;_0x594685=0xc8;}else{_0x594685=0xce;}_0x2ea19a['status'](_0x594685);return _0x2ea19a[_0xb238('0x21')](_0xb238('0x22'),_0x3d9c77+'-'+_0x44eee5+'/'+_0x10629d)[_0xb238('0x1c')](_0xb7e322);}return null;};}function patchUpdates(_0x45432c){return function(_0x151e8e){try{jsonpatch['apply'](_0x151e8e,_0x45432c,!![]);}catch(_0x2d5aea){return BPromise[_0xb238('0x23')](_0x2d5aea);}return _0x151e8e['save']();};}function saveUpdates(_0x109e05,_0x2cc21f){return function(_0x38574c){if(_0x38574c){return _0x38574c['update'](_0x109e05)[_0xb238('0x24')](function(_0x1e2c38){return _0x1e2c38;});}return null;};}function removeEntity(_0x47bd15,_0x142e23){return function(_0x28ff02){if(_0x28ff02){return _0x28ff02[_0xb238('0x25')]()['then'](function(){var _0xfa8357=_0x28ff02[_0xb238('0x26')]({'plain':!![]});var _0x1624d9=_0xb238('0x27');return db[_0xb238('0x28')][_0xb238('0x25')]({'where':{'type':_0x1624d9,'resourceId':_0xfa8357['id']}})[_0xb238('0x24')](function(){return _0x28ff02;});})[_0xb238('0x24')](function(){_0x47bd15[_0xb238('0x29')](0xcc)[_0xb238('0x1b')]();});}};}function handleEntityNotFound(_0x1377af,_0x34c39f){return function(_0x1fb76c){if(!_0x1fb76c){_0x1377af[_0xb238('0x1a')](0x194);}return _0x1fb76c;};}function handleError(_0xdc923a,_0x268e00){_0x268e00=_0x268e00||0x1f4;return function(_0x2c7564){logger[_0xb238('0x2a')](_0x2c7564['stack']);if(_0x2c7564[_0xb238('0x2b')]){delete _0x2c7564[_0xb238('0x2b')];}_0xdc923a[_0xb238('0x29')](_0x268e00)[_0xb238('0x2c')](_0x2c7564);};}exports[_0xb238('0x2d')]=function(_0xd9c8b5,_0x13dfc8){var _0x1e0a42={},_0xdbb330={},_0x599bfc={'count':0x0,'rows':[]};var _0x52a91e=_['map'](db[_0xb238('0x2e')][_0xb238('0x2f')],function(_0xb1e74d){return{'name':_0xb1e74d[_0xb238('0x30')],'type':_0xb1e74d['type'][_0xb238('0x31')]};});_0xdbb330[_0xb238('0x32')]=_[_0xb238('0x33')](_0x52a91e,'name');_0xdbb330[_0xb238('0x34')]=_['keys'](_0xd9c8b5[_0xb238('0x34')]);_0xdbb330[_0xb238('0x35')]=_[_0xb238('0x36')](_0xdbb330[_0xb238('0x32')],_0xdbb330['query']);_0x1e0a42[_0xb238('0x37')]=_[_0xb238('0x36')](_0xdbb330[_0xb238('0x32')],qs[_0xb238('0x38')](_0xd9c8b5['query'][_0xb238('0x38')]));_0x1e0a42[_0xb238('0x37')]=_0x1e0a42[_0xb238('0x37')]['length']?_0x1e0a42[_0xb238('0x37')]:_0xdbb330[_0xb238('0x32')];if(!_0xd9c8b5[_0xb238('0x34')][_0xb238('0x39')](_0xb238('0x3a'))){_0x1e0a42[_0xb238('0x1e')]=qs[_0xb238('0x1e')](_0xd9c8b5[_0xb238('0x34')][_0xb238('0x1e')]);_0x1e0a42[_0xb238('0x1d')]=qs[_0xb238('0x1d')](_0xd9c8b5[_0xb238('0x34')][_0xb238('0x1d')]);}_0x1e0a42['order']=qs[_0xb238('0x3b')](_0xd9c8b5['query'][_0xb238('0x3b')]);_0x1e0a42[_0xb238('0x3c')]=qs[_0xb238('0x35')](_[_0xb238('0x3d')](_0xd9c8b5[_0xb238('0x34')],_0xdbb330[_0xb238('0x35')]),_0x52a91e);if(_0xd9c8b5[_0xb238('0x34')][_0xb238('0x3e')]){_0x1e0a42[_0xb238('0x3c')]=_['merge'](_0x1e0a42[_0xb238('0x3c')],{'$or':_[_0xb238('0x33')](_0x52a91e,function(_0x472db2){if(_0x472db2[_0xb238('0x3f')]!=='VIRTUAL'){var _0x3452df={};_0x3452df[_0x472db2[_0xb238('0x2b')]]={'$like':'%'+_0xd9c8b5[_0xb238('0x34')][_0xb238('0x3e')]+'%'};return _0x3452df;}})});}_0x1e0a42=_[_0xb238('0x40')]({},_0x1e0a42,_0xd9c8b5['options']);var _0xbff448={'where':_0x1e0a42[_0xb238('0x3c')]};return db[_0xb238('0x2e')][_0xb238('0x20')](_0xbff448)[_0xb238('0x24')](function(_0x40b72b){_0x599bfc[_0xb238('0x20')]=_0x40b72b;if(_0xd9c8b5[_0xb238('0x34')][_0xb238('0x41')]){_0x1e0a42[_0xb238('0x42')]=[{'all':!![]}];}return db[_0xb238('0x2e')][_0xb238('0x43')](_0x1e0a42);})[_0xb238('0x24')](function(_0x316d5c){_0x599bfc[_0xb238('0x44')]=_0x316d5c;return _0x599bfc;})[_0xb238('0x24')](respondWithFilteredResult(_0x13dfc8,_0x1e0a42))[_0xb238('0x45')](handleError(_0x13dfc8,null));};exports['show']=function(_0x54a336,_0x9e6673){var _0x4a4d1a={'raw':!![],'where':{'id':_0x54a336['params']['id']}},_0x5e734b={};_0x5e734b[_0xb238('0x32')]=_[_0xb238('0x46')](db['CmContactHasItem']['rawAttributes']);_0x5e734b[_0xb238('0x34')]=_[_0xb238('0x46')](_0x54a336[_0xb238('0x34')]);_0x5e734b[_0xb238('0x35')]=_['intersection'](_0x5e734b[_0xb238('0x32')],_0x5e734b[_0xb238('0x34')]);_0x4a4d1a[_0xb238('0x37')]=_[_0xb238('0x36')](_0x5e734b[_0xb238('0x32')],qs[_0xb238('0x38')](_0x54a336['query']['fields']));_0x4a4d1a['attributes']=_0x4a4d1a[_0xb238('0x37')][_0xb238('0x47')]?_0x4a4d1a[_0xb238('0x37')]:_0x5e734b[_0xb238('0x32')];if(_0x54a336['query'][_0xb238('0x41')]){_0x4a4d1a['include']=[{'all':!![]}];}_0x4a4d1a=_[_0xb238('0x40')]({},_0x4a4d1a,_0x54a336[_0xb238('0x48')]);return db[_0xb238('0x2e')][_0xb238('0x49')](_0x4a4d1a)['then'](handleEntityNotFound(_0x9e6673,null))[_0xb238('0x24')](respondWithResult(_0x9e6673,null))['catch'](handleError(_0x9e6673,null));};exports['create']=function(_0x24c338,_0x5c5e2c){return db[_0xb238('0x2e')]['create'](_0x24c338[_0xb238('0x4a')],{})[_0xb238('0x24')](function(_0x1e916d){var _0x575ebc=_0x24c338[_0xb238('0x4b')][_0xb238('0x26')]({'plain':!![]});if(!_0x575ebc)throw new Error(_0xb238('0x4c'));if(_0x575ebc['role']==='user'){var _0x85fc02=_0x1e916d[_0xb238('0x26')]({'plain':!![]});var _0xc29ca8=_0xb238('0x27');return db[_0xb238('0x4d')][_0xb238('0x49')]({'where':{'name':_0xc29ca8,'userProfileId':_0x575ebc[_0xb238('0x4e')]},'raw':!![]})[_0xb238('0x24')](function(_0x1bdb3e){if(_0x1bdb3e&&_0x1bdb3e[_0xb238('0x4f')]===0x0){return db[_0xb238('0x28')]['create']({'name':_0x85fc02['name'],'resourceId':_0x85fc02['id'],'type':_0x1bdb3e['name'],'sectionId':_0x1bdb3e['id']},{})[_0xb238('0x24')](function(){return _0x1e916d;});}else{return _0x1e916d;}})[_0xb238('0x45')](function(_0x431ed2){logger[_0xb238('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x431ed2);throw _0x431ed2;});}return _0x1e916d;})[_0xb238('0x24')](respondWithResult(_0x5c5e2c,0xc9))[_0xb238('0x45')](handleError(_0x5c5e2c,null));};exports['update']=function(_0x3b66f0,_0x38dda9){if(_0x3b66f0[_0xb238('0x4a')]['id']){delete _0x3b66f0[_0xb238('0x4a')]['id'];}return db[_0xb238('0x2e')][_0xb238('0x49')]({'where':{'id':_0x3b66f0['params']['id']}})['then'](handleEntityNotFound(_0x38dda9,null))[_0xb238('0x24')](saveUpdates(_0x3b66f0[_0xb238('0x4a')],null))['then'](respondWithResult(_0x38dda9,null))[_0xb238('0x45')](handleError(_0x38dda9,null));};exports['destroy']=function(_0x176c14,_0x53fbe8){return db['CmContactHasItem'][_0xb238('0x49')]({'where':{'id':_0x176c14['params']['id']}})[_0xb238('0x24')](handleEntityNotFound(_0x53fbe8,null))[_0xb238('0x24')](removeEntity(_0x53fbe8,null))[_0xb238('0x45')](handleError(_0x53fbe8,null));};
\ No newline at end of file
+var _0x5d4a=['rows','catch','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','index','map','CmContactHasItem','rawAttributes','fieldName','key','name','query','keys','filters','attributes','intersection','model','fields','length','sort','pick','where','merge','type','filter','options','include'];(function(_0x13e221,_0x2f90cc){var _0x2cdc4d=function(_0x1738cc){while(--_0x1738cc){_0x13e221['push'](_0x13e221['shift']());}};_0x2cdc4d(++_0x2f90cc);}(_0x5d4a,0x199));var _0xa5d4=function(_0x4194c6,_0x38448f){_0x4194c6=_0x4194c6-0x0;var _0x2e6611=_0x5d4a[_0x4194c6];return _0x2e6611;};'use strict';var emlformat=require(_0xa5d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5d4('0x1'));var jsonpatch=require(_0xa5d4('0x2'));var rp=require(_0xa5d4('0x3'));var moment=require(_0xa5d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5d4('0x5'));var util=require(_0xa5d4('0x6'));var path=require('path');var sox=require(_0xa5d4('0x7'));var csv=require(_0xa5d4('0x8'));var ejs=require(_0xa5d4('0x9'));var fs=require('fs');var fs_extra=require(_0xa5d4('0xa'));var _=require(_0xa5d4('0xb'));var squel=require('squel');var crypto=require(_0xa5d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa5d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa5d4('0xe'));var Papa=require(_0xa5d4('0xf'));var Redis=require('ioredis');var authService=require(_0xa5d4('0x10'));var qs=require(_0xa5d4('0x11'));var as=require(_0xa5d4('0x12'));var hardwareService=require(_0xa5d4('0x13'));var logger=require(_0xa5d4('0x14'))('api');var utils=require(_0xa5d4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa5d4('0x16'));var db=require(_0xa5d4('0x17'))['db'];function respondWithStatusCode(_0x1501af,_0x97911c){_0x97911c=_0x97911c||0xcc;return function(_0xd51b1){if(_0xd51b1){return _0x1501af[_0xa5d4('0x18')](_0x97911c);}return _0x1501af[_0xa5d4('0x19')](_0x97911c)['end']();};}function respondWithResult(_0x395f21,_0x2bae83){_0x2bae83=_0x2bae83||0xc8;return function(_0x1b8441){if(_0x1b8441){return _0x395f21[_0xa5d4('0x19')](_0x2bae83)[_0xa5d4('0x1a')](_0x1b8441);}};}function respondWithFilteredResult(_0x24a0f7,_0x584800){return function(_0x9a3cd5){if(_0x9a3cd5){var _0x9643a4=typeof _0x584800[_0xa5d4('0x1b')]===_0xa5d4('0x1c')&&typeof _0x584800[_0xa5d4('0x1d')]==='undefined';var _0x566971=_0x9a3cd5[_0xa5d4('0x1e')];var _0x6d3ba5=_0x9643a4?0x0:_0x584800[_0xa5d4('0x1b')];var _0x3845d6=_0x9643a4?_0x9a3cd5[_0xa5d4('0x1e')]:_0x584800[_0xa5d4('0x1b')]+_0x584800[_0xa5d4('0x1d')];var _0x3e52ba;if(_0x3845d6>=_0x566971){_0x3845d6=_0x566971;_0x3e52ba=0xc8;}else{_0x3e52ba=0xce;}_0x24a0f7[_0xa5d4('0x19')](_0x3e52ba);return _0x24a0f7[_0xa5d4('0x1f')]('Content-Range',_0x6d3ba5+'-'+_0x3845d6+'/'+_0x566971)[_0xa5d4('0x1a')](_0x9a3cd5);}return null;};}function patchUpdates(_0x180675){return function(_0x370628){try{jsonpatch['apply'](_0x370628,_0x180675,!![]);}catch(_0x585e92){return BPromise[_0xa5d4('0x20')](_0x585e92);}return _0x370628[_0xa5d4('0x21')]();};}function saveUpdates(_0xc94267,_0x10859a){return function(_0x1175d0){if(_0x1175d0){return _0x1175d0['update'](_0xc94267)[_0xa5d4('0x22')](function(_0x250646){return _0x250646;});}return null;};}function removeEntity(_0x24cba9,_0x4bcd06){return function(_0x4d3477){if(_0x4d3477){return _0x4d3477[_0xa5d4('0x23')]()[_0xa5d4('0x22')](function(){var _0x19ca67=_0x4d3477[_0xa5d4('0x24')]({'plain':!![]});var _0x37cf36=_0xa5d4('0x25');return db[_0xa5d4('0x26')][_0xa5d4('0x23')]({'where':{'type':_0x37cf36,'resourceId':_0x19ca67['id']}})[_0xa5d4('0x22')](function(){return _0x4d3477;});})[_0xa5d4('0x22')](function(){_0x24cba9[_0xa5d4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ea54,_0x540998){return function(_0x71c4d0){if(!_0x71c4d0){_0x19ea54[_0xa5d4('0x18')](0x194);}return _0x71c4d0;};}function handleError(_0x5afdcc,_0x59a475){_0x59a475=_0x59a475||0x1f4;return function(_0x8ab3fa){logger[_0xa5d4('0x27')](_0x8ab3fa[_0xa5d4('0x28')]);if(_0x8ab3fa['name']){delete _0x8ab3fa['name'];}_0x5afdcc[_0xa5d4('0x19')](_0x59a475)[_0xa5d4('0x29')](_0x8ab3fa);};}exports[_0xa5d4('0x2a')]=function(_0x2cbc28,_0x52db7b){var _0x177045={},_0x1ee723={},_0x21f056={'count':0x0,'rows':[]};var _0x4d8f15=_[_0xa5d4('0x2b')](db[_0xa5d4('0x2c')][_0xa5d4('0x2d')],function(_0x1096c7){return{'name':_0x1096c7[_0xa5d4('0x2e')],'type':_0x1096c7['type'][_0xa5d4('0x2f')]};});_0x1ee723['model']=_[_0xa5d4('0x2b')](_0x4d8f15,_0xa5d4('0x30'));_0x1ee723[_0xa5d4('0x31')]=_[_0xa5d4('0x32')](_0x2cbc28[_0xa5d4('0x31')]);_0x1ee723[_0xa5d4('0x33')]=_['intersection'](_0x1ee723['model'],_0x1ee723[_0xa5d4('0x31')]);_0x177045[_0xa5d4('0x34')]=_[_0xa5d4('0x35')](_0x1ee723[_0xa5d4('0x36')],qs[_0xa5d4('0x37')](_0x2cbc28[_0xa5d4('0x31')][_0xa5d4('0x37')]));_0x177045[_0xa5d4('0x34')]=_0x177045[_0xa5d4('0x34')][_0xa5d4('0x38')]?_0x177045['attributes']:_0x1ee723[_0xa5d4('0x36')];if(!_0x2cbc28[_0xa5d4('0x31')]['hasOwnProperty']('nolimit')){_0x177045[_0xa5d4('0x1d')]=qs[_0xa5d4('0x1d')](_0x2cbc28[_0xa5d4('0x31')]['limit']);_0x177045['offset']=qs[_0xa5d4('0x1b')](_0x2cbc28['query'][_0xa5d4('0x1b')]);}_0x177045['order']=qs[_0xa5d4('0x39')](_0x2cbc28[_0xa5d4('0x31')][_0xa5d4('0x39')]);_0x177045['where']=qs[_0xa5d4('0x33')](_[_0xa5d4('0x3a')](_0x2cbc28[_0xa5d4('0x31')],_0x1ee723['filters']),_0x4d8f15);if(_0x2cbc28['query']['filter']){_0x177045[_0xa5d4('0x3b')]=_[_0xa5d4('0x3c')](_0x177045['where'],{'$or':_['map'](_0x4d8f15,function(_0x6b4335){if(_0x6b4335[_0xa5d4('0x3d')]!=='VIRTUAL'){var _0x407934={};_0x407934[_0x6b4335[_0xa5d4('0x30')]]={'$like':'%'+_0x2cbc28[_0xa5d4('0x31')][_0xa5d4('0x3e')]+'%'};return _0x407934;}})});}_0x177045=_[_0xa5d4('0x3c')]({},_0x177045,_0x2cbc28[_0xa5d4('0x3f')]);var _0x1df595={'where':_0x177045['where']};return db[_0xa5d4('0x2c')][_0xa5d4('0x1e')](_0x1df595)[_0xa5d4('0x22')](function(_0x888832){_0x21f056[_0xa5d4('0x1e')]=_0x888832;if(_0x2cbc28[_0xa5d4('0x31')]['includeAll']){_0x177045[_0xa5d4('0x40')]=[{'all':!![]}];}return db[_0xa5d4('0x2c')]['findAll'](_0x177045);})[_0xa5d4('0x22')](function(_0x338c59){_0x21f056[_0xa5d4('0x41')]=_0x338c59;return _0x21f056;})[_0xa5d4('0x22')](respondWithFilteredResult(_0x52db7b,_0x177045))[_0xa5d4('0x42')](handleError(_0x52db7b,null));};exports['show']=function(_0x115966,_0x1b800f){var _0x405508={'raw':!![],'where':{'id':_0x115966[_0xa5d4('0x43')]['id']}},_0x57ce8f={};_0x57ce8f[_0xa5d4('0x36')]=_[_0xa5d4('0x32')](db['CmContactHasItem'][_0xa5d4('0x2d')]);_0x57ce8f[_0xa5d4('0x31')]=_[_0xa5d4('0x32')](_0x115966['query']);_0x57ce8f[_0xa5d4('0x33')]=_['intersection'](_0x57ce8f[_0xa5d4('0x36')],_0x57ce8f[_0xa5d4('0x31')]);_0x405508[_0xa5d4('0x34')]=_[_0xa5d4('0x35')](_0x57ce8f['model'],qs[_0xa5d4('0x37')](_0x115966[_0xa5d4('0x31')][_0xa5d4('0x37')]));_0x405508['attributes']=_0x405508['attributes'][_0xa5d4('0x38')]?_0x405508[_0xa5d4('0x34')]:_0x57ce8f[_0xa5d4('0x36')];if(_0x115966['query'][_0xa5d4('0x44')]){_0x405508[_0xa5d4('0x40')]=[{'all':!![]}];}_0x405508=_['merge']({},_0x405508,_0x115966[_0xa5d4('0x3f')]);return db[_0xa5d4('0x2c')][_0xa5d4('0x45')](_0x405508)[_0xa5d4('0x22')](handleEntityNotFound(_0x1b800f,null))['then'](respondWithResult(_0x1b800f,null))[_0xa5d4('0x42')](handleError(_0x1b800f,null));};exports['create']=function(_0x51fb84,_0x256f3c){return db[_0xa5d4('0x2c')][_0xa5d4('0x46')](_0x51fb84[_0xa5d4('0x47')],{})[_0xa5d4('0x22')](function(_0x209185){var _0x3adfd5=_0x51fb84['user'][_0xa5d4('0x24')]({'plain':!![]});if(!_0x3adfd5)throw new Error(_0xa5d4('0x48'));if(_0x3adfd5[_0xa5d4('0x49')]===_0xa5d4('0x4a')){var _0x49cae0=_0x209185['get']({'plain':!![]});var _0x5de370=_0xa5d4('0x25');return db['UserProfileSection'][_0xa5d4('0x45')]({'where':{'name':_0x5de370,'userProfileId':_0x3adfd5[_0xa5d4('0x4b')]},'raw':!![]})[_0xa5d4('0x22')](function(_0x2da3b1){if(_0x2da3b1&&_0x2da3b1[_0xa5d4('0x4c')]===0x0){return db[_0xa5d4('0x26')][_0xa5d4('0x46')]({'name':_0x49cae0[_0xa5d4('0x30')],'resourceId':_0x49cae0['id'],'type':_0x2da3b1['name'],'sectionId':_0x2da3b1['id']},{})['then'](function(){return _0x209185;});}else{return _0x209185;}})[_0xa5d4('0x42')](function(_0x46a9cf){logger[_0xa5d4('0x27')](_0xa5d4('0x4d'),_0x46a9cf);throw _0x46a9cf;});}return _0x209185;})[_0xa5d4('0x22')](respondWithResult(_0x256f3c,0xc9))[_0xa5d4('0x42')](handleError(_0x256f3c,null));};exports[_0xa5d4('0x4e')]=function(_0x5642f0,_0x351372){if(_0x5642f0[_0xa5d4('0x47')]['id']){delete _0x5642f0['body']['id'];}return db[_0xa5d4('0x2c')][_0xa5d4('0x45')]({'where':{'id':_0x5642f0[_0xa5d4('0x43')]['id']}})[_0xa5d4('0x22')](handleEntityNotFound(_0x351372,null))[_0xa5d4('0x22')](saveUpdates(_0x5642f0[_0xa5d4('0x47')],null))[_0xa5d4('0x22')](respondWithResult(_0x351372,null))[_0xa5d4('0x42')](handleError(_0x351372,null));};exports['destroy']=function(_0x35ba69,_0xbbc14a){return db[_0xa5d4('0x2c')][_0xa5d4('0x45')]({'where':{'id':_0x35ba69[_0xa5d4('0x43')]['id']}})[_0xa5d4('0x22')](handleEntityNotFound(_0xbbc14a,null))[_0xa5d4('0x22')](removeEntity(_0xbbc14a,null))[_0xa5d4('0x42')](handleError(_0xbbc14a,null));};
\ No newline at end of file
index 32fea5e..9622cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cde=['cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem'];(function(_0x1496bc,_0x369cd5){var _0x4f8978=function(_0x32d2b7){while(--_0x32d2b7){_0x1496bc['push'](_0x1496bc['shift']());}};_0x4f8978(++_0x369cd5);}(_0x3cde,0x1d5));var _0xe3cd=function(_0x550b2d,_0x475049){_0x550b2d=_0x550b2d-0x0;var _0x37c1cf=_0x3cde[_0x550b2d];return _0x37c1cf;};'use strict';var _=require(_0xe3cd('0x0'));var util=require(_0xe3cd('0x1'));var logger=require(_0xe3cd('0x2'))(_0xe3cd('0x3'));var moment=require('moment');var BPromise=require(_0xe3cd('0x4'));var rp=require(_0xe3cd('0x5'));var fs=require('fs');var path=require(_0xe3cd('0x6'));var rimraf=require(_0xe3cd('0x7'));var config=require(_0xe3cd('0x8'));var attributes=require(_0xe3cd('0x9'));module['exports']=function(_0x5c0bad,_0x2e47ad){return _0x5c0bad[_0xe3cd('0xa')](_0xe3cd('0xb'),attributes,{'tableName':_0xe3cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe70=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items'];(function(_0x100f97,_0x238c02){var _0x21d48c=function(_0x729295){while(--_0x729295){_0x100f97['push'](_0x100f97['shift']());}};_0x21d48c(++_0x238c02);}(_0xfe70,0x87));var _0x0fe7=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0xfe70[_0x65c0bb];return _0x320bd5;};'use strict';var _=require(_0x0fe7('0x0'));var util=require(_0x0fe7('0x1'));var logger=require(_0x0fe7('0x2'))(_0x0fe7('0x3'));var moment=require(_0x0fe7('0x4'));var BPromise=require(_0x0fe7('0x5'));var rp=require(_0x0fe7('0x6'));var fs=require('fs');var path=require(_0x0fe7('0x7'));var rimraf=require(_0x0fe7('0x8'));var config=require(_0x0fe7('0x9'));var attributes=require(_0x0fe7('0xa'));module[_0x0fe7('0xb')]=function(_0xffb092,_0x19e6b1){return _0xffb092[_0x0fe7('0xc')](_0x0fe7('0xd'),attributes,{'tableName':_0x0fe7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4bf9cdc..d997866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48f=['request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0xb48f,0x170));var _0xfb48=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0xb48f[_0x4b1012];return _0x23d715;};'use strict';var _=require(_0xfb48('0x0'));var util=require(_0xfb48('0x1'));var moment=require(_0xfb48('0x2'));var BPromise=require(_0xfb48('0x3'));var rs=require(_0xfb48('0x4'));var fs=require('fs');var Redis=require(_0xfb48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb48('0x6'));var logger=require('../../config/logger')(_0xfb48('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb48('0x8'));var client=jayson[_0xfb48('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x496054,_0x5970ec,_0x4b93b5){return new BPromise(function(_0x1dbc7b,_0x182757){return client[_0xfb48('0xa')](_0x496054,_0x4b93b5)[_0xfb48('0xb')](function(_0x521030){logger['info'](_0xfb48('0xc'),_0x5970ec,_0xfb48('0xd'));logger['debug'](_0xfb48('0xe'),_0x5970ec,_0xfb48('0xd'),JSON[_0xfb48('0xf')](_0x521030));if(_0x521030[_0xfb48('0x10')]){if(_0x521030[_0xfb48('0x10')][_0xfb48('0x11')]===0x1f4){logger[_0xfb48('0x10')](_0xfb48('0xc'),_0x5970ec,_0x521030[_0xfb48('0x10')]['message']);return _0x182757(_0x521030[_0xfb48('0x10')][_0xfb48('0x12')]);}logger[_0xfb48('0x10')](_0xfb48('0xc'),_0x5970ec,_0x521030[_0xfb48('0x10')][_0xfb48('0x12')]);return _0x1dbc7b(_0x521030['error'][_0xfb48('0x12')]);}else{logger[_0xfb48('0x13')](_0xfb48('0xc'),_0x5970ec,'request\x20sent');_0x1dbc7b(_0x521030[_0xfb48('0x14')][_0xfb48('0x12')]);}})['catch'](function(_0x50eca7){logger[_0xfb48('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x5970ec,_0x50eca7);_0x182757(_0x50eca7);});});}
\ No newline at end of file
+var _0x2ef9=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38ecdc,_0x20d1f8){var _0xd8d4d0=function(_0x5b0b6e){while(--_0x5b0b6e){_0x38ecdc['push'](_0x38ecdc['shift']());}};_0xd8d4d0(++_0x20d1f8);}(_0x2ef9,0x9d));var _0x92ef=function(_0x2f4333,_0x523feb){_0x2f4333=_0x2f4333-0x0;var _0x492c2e=_0x2ef9[_0x2f4333];return _0x492c2e;};'use strict';var _=require('lodash');var util=require(_0x92ef('0x0'));var moment=require(_0x92ef('0x1'));var BPromise=require(_0x92ef('0x2'));var rs=require(_0x92ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92ef('0x4'))['db'];var utils=require(_0x92ef('0x5'));var logger=require('../../config/logger')(_0x92ef('0x6'));var config=require(_0x92ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x92ef('0x8')][_0x92ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80898,_0x1bef0d,_0x496d4c){return new BPromise(function(_0x5d5180,_0x390a0a){return client[_0x92ef('0xa')](_0x80898,_0x496d4c)[_0x92ef('0xb')](function(_0x3f35ec){logger[_0x92ef('0xc')](_0x92ef('0xd'),_0x1bef0d,_0x92ef('0xe'));logger['debug'](_0x92ef('0xf'),_0x1bef0d,_0x92ef('0xe'),JSON[_0x92ef('0x10')](_0x3f35ec));if(_0x3f35ec[_0x92ef('0x11')]){if(_0x3f35ec[_0x92ef('0x11')][_0x92ef('0x12')]===0x1f4){logger[_0x92ef('0x11')](_0x92ef('0xd'),_0x1bef0d,_0x3f35ec['error'][_0x92ef('0x13')]);return _0x390a0a(_0x3f35ec['error'][_0x92ef('0x13')]);}logger[_0x92ef('0x11')](_0x92ef('0xd'),_0x1bef0d,_0x3f35ec[_0x92ef('0x11')]['message']);return _0x5d5180(_0x3f35ec[_0x92ef('0x11')][_0x92ef('0x13')]);}else{logger[_0x92ef('0xc')](_0x92ef('0xd'),_0x1bef0d,_0x92ef('0xe'));_0x5d5180(_0x3f35ec[_0x92ef('0x14')]['message']);}})[_0x92ef('0x15')](function(_0x346810){logger[_0x92ef('0x11')](_0x92ef('0xd'),_0x1bef0d,_0x346810);_0x390a0a(_0x346810);});});}
\ No newline at end of file
index 8730ab3..dd65aaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4444=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','util','path','connect-timeout','Router'];(function(_0x5c8722,_0x39fe9b){var _0x2d2e62=function(_0x364c2d){while(--_0x364c2d){_0x5c8722['push'](_0x5c8722['shift']());}};_0x2d2e62(++_0x39fe9b);}(_0x4444,0x1a5));var _0x4444=function(_0x2bb398,_0xd7c0dc){_0x2bb398=_0x2bb398-0x0;var _0x4dfefc=_0x4444[_0x2bb398];return _0x4dfefc;};'use strict';var multer=require('multer');var util=require(_0x4444('0x0'));var path=require(_0x4444('0x1'));var timeout=require(_0x4444('0x2'));var express=require('express');var router=express[_0x4444('0x3')]();var fs_extra=require(_0x4444('0x4'));var auth=require(_0x4444('0x5'));var interaction=require(_0x4444('0x6'));var config=require('../../config/environment');var controller=require(_0x4444('0x7'));router[_0x4444('0x8')]('/',auth[_0x4444('0x9')](),controller[_0x4444('0xa')]);router['get'](_0x4444('0xb'),auth[_0x4444('0x9')](),controller[_0x4444('0xc')]);router[_0x4444('0xd')]('/',auth[_0x4444('0x9')](),controller['create']);router[_0x4444('0xe')](_0x4444('0xb'),auth[_0x4444('0x9')](),controller[_0x4444('0xf')]);router[_0x4444('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x60a1=['get','isAuthenticated','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0xe47817,_0xc0c4b2){var _0x5df0eb=function(_0x3f1a70){while(--_0x3f1a70){_0xe47817['push'](_0xe47817['shift']());}};_0x5df0eb(++_0xc0c4b2);}(_0x60a1,0x75));var _0x160a=function(_0xa89e85,_0x4de801){_0xa89e85=_0xa89e85-0x0;var _0x49a130=_0x60a1[_0xa89e85];return _0x49a130;};'use strict';var multer=require(_0x160a('0x0'));var util=require(_0x160a('0x1'));var path=require('path');var timeout=require(_0x160a('0x2'));var express=require(_0x160a('0x3'));var router=express['Router']();var fs_extra=require(_0x160a('0x4'));var auth=require(_0x160a('0x5'));var interaction=require(_0x160a('0x6'));var config=require(_0x160a('0x7'));var controller=require(_0x160a('0x8'));router[_0x160a('0x9')]('/',auth[_0x160a('0xa')](),controller['index']);router['get'](_0x160a('0xb'),auth[_0x160a('0xa')](),controller[_0x160a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x160a('0xd')](_0x160a('0xb'),auth['isAuthenticated'](),controller[_0x160a('0xe')]);router[_0x160a('0xf')]('/:id',auth[_0x160a('0xa')](),controller[_0x160a('0x10')]);module[_0x160a('0x11')]=router;
\ No newline at end of file
index 419a963..f69209d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1137=['getDataValue','alias','STRING','setDataValue','TEXT','select','parse','values','isArray','stringify','BOOLEAN','VIRTUAL'];(function(_0x1b5bc2,_0x453d84){var _0x1a5382=function(_0x4ffafb){while(--_0x4ffafb){_0x1b5bc2['push'](_0x1b5bc2['shift']());}};_0x1a5382(++_0x453d84);}(_0x1137,0x113));var _0x7113=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x1137[_0x561f25];return _0x150e4c;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x7113('0x0')],'get':function(_0x15ae99){return this[_0x7113('0x1')](_0x7113('0x2'));}},'alias':{'type':Sequelize[_0x7113('0x3')],'allowNull':![],'set':function(_0x5b364b){this[_0x7113('0x4')](_0x7113('0x2'),_0x5b364b?_0x5b364b:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x7113('0x5')]('long'),'get':function(){if(this[_0x7113('0x1')]('type')===_0x7113('0x6')){return JSON[_0x7113('0x7')](this['getDataValue'](_0x7113('0x8')));}else{return this[_0x7113('0x1')](_0x7113('0x8'));}},'set':function(_0x5d9e95){if(Array[_0x7113('0x9')](_0x5d9e95)){this[_0x7113('0x4')](_0x7113('0x8'),JSON[_0x7113('0xa')](_0x5d9e95));}else{this['setDataValue'](_0x7113('0x8'),_0x5d9e95);}}},'required':{'type':Sequelize[_0x7113('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7113('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}};
\ No newline at end of file
+var _0xe673=['getDataValue','STRING','setDataValue','alias','name','TEXT','long','type','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xe673,0x1b7));var _0x3e67=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe673[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x3e67('0x0'));var _=require(_0x3e67('0x1'));module[_0x3e67('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x347e3b){return this[_0x3e67('0x3')]('alias');}},'alias':{'type':Sequelize[_0x3e67('0x4')],'allowNull':![],'set':function(_0x1761a5){this[_0x3e67('0x5')](_0x3e67('0x6'),_0x1761a5?_0x1761a5:this[_0x3e67('0x3')](_0x3e67('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x3e67('0x8')](_0x3e67('0x9')),'get':function(){if(this[_0x3e67('0x3')](_0x3e67('0xa'))==='select'){return JSON[_0x3e67('0xb')](this['getDataValue'](_0x3e67('0xc')));}else{return this[_0x3e67('0x3')](_0x3e67('0xc'));}},'set':function(_0x471097){if(Array[_0x3e67('0xd')](_0x471097)){this[_0x3e67('0x5')](_0x3e67('0xc'),JSON['stringify'](_0x471097));}else{this[_0x3e67('0x5')]('values',_0x471097);}}},'required':{'type':Sequelize[_0x3e67('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3e67('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3e67('0xf')](_0x3e67('0x10'))}};
\ No newline at end of file
index 194afce..e21d948 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7582=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','transaction','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x7582,0x18b));var _0x2758=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0x7582[_0x27031e];return _0xfd46b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2758('0x0'));var zipdir=require(_0x2758('0x1'));var jsonpatch=require(_0x2758('0x2'));var rp=require(_0x2758('0x3'));var moment=require(_0x2758('0x4'));var BPromise=require(_0x2758('0x5'));var Mustache=require('mustache');var util=require(_0x2758('0x6'));var path=require(_0x2758('0x7'));var sox=require(_0x2758('0x8'));var csv=require(_0x2758('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2758('0xa'));var crypto=require(_0x2758('0xb'));var jsforce=require(_0x2758('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2758('0x9'));var querystring=require('querystring');var Papa=require(_0x2758('0xd'));var Redis=require('ioredis');var authService=require(_0x2758('0xe'));var qs=require(_0x2758('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2758('0x10'));var config=require(_0x2758('0x11'));var licenseUtil=require(_0x2758('0x12'));var db=require(_0x2758('0x13'))['db'];function respondWithStatusCode(_0x29e3ef,_0x3f38aa){_0x3f38aa=_0x3f38aa||0xcc;return function(_0x2187e5){if(_0x2187e5){return _0x29e3ef[_0x2758('0x14')](_0x3f38aa);}return _0x29e3ef[_0x2758('0x15')](_0x3f38aa)[_0x2758('0x16')]();};}function respondWithResult(_0x123e74,_0x2ea3db){_0x2ea3db=_0x2ea3db||0xc8;return function(_0x21b36a){if(_0x21b36a){return _0x123e74['status'](_0x2ea3db)[_0x2758('0x17')](_0x21b36a);}};}function respondWithFilteredResult(_0x4d0ce0,_0x514968){return function(_0x3e2e1a){if(_0x3e2e1a){var _0x57cd5b=typeof _0x514968['offset']===_0x2758('0x18')&&typeof _0x514968[_0x2758('0x19')]===_0x2758('0x18');var _0x21c762=_0x3e2e1a['count'];var _0x41c957=_0x57cd5b?0x0:_0x514968['offset'];var _0x1397d7=_0x57cd5b?_0x3e2e1a[_0x2758('0x1a')]:_0x514968[_0x2758('0x1b')]+_0x514968[_0x2758('0x19')];var _0x3e9119;if(_0x1397d7>=_0x21c762){_0x1397d7=_0x21c762;_0x3e9119=0xc8;}else{_0x3e9119=0xce;}_0x4d0ce0[_0x2758('0x15')](_0x3e9119);return _0x4d0ce0[_0x2758('0x1c')](_0x2758('0x1d'),_0x41c957+'-'+_0x1397d7+'/'+_0x21c762)['json'](_0x3e2e1a);}return null;};}function patchUpdates(_0x214d45){return function(_0x377deb){try{jsonpatch[_0x2758('0x1e')](_0x377deb,_0x214d45,!![]);}catch(_0x38cd30){return BPromise[_0x2758('0x1f')](_0x38cd30);}return _0x377deb['save']();};}function saveUpdates(_0x57f798,_0x56e9aa){return function(_0x2ad339){if(_0x2ad339){return _0x2ad339[_0x2758('0x20')](_0x57f798)['then'](function(_0x19e58b){return _0x19e58b;});}return null;};}function removeEntity(_0x3225bd,_0x365c87){return function(_0x32a298){if(_0x32a298){return _0x32a298[_0x2758('0x21')]()[_0x2758('0x22')](function(){_0x3225bd['status'](0xcc)[_0x2758('0x16')]();});}};}function handleEntityNotFound(_0x546fc1,_0x38b2b3){return function(_0x26539a){if(!_0x26539a){_0x546fc1[_0x2758('0x14')](0x194);}return _0x26539a;};}function handleError(_0x67e03e,_0x579c49){_0x579c49=_0x579c49||0x1f4;return function(_0x68f885){logger[_0x2758('0x23')](_0x68f885['stack']);if(_0x68f885['name']){delete _0x68f885[_0x2758('0x24')];}_0x67e03e[_0x2758('0x15')](_0x579c49)['send'](_0x68f885);};}exports[_0x2758('0x25')]=function(_0x49e687,_0x584927){var _0x1b5b0b={},_0x566312={},_0x26cc00={'count':0x0,'rows':[]};var _0xeb61=_[_0x2758('0x26')](db[_0x2758('0x27')]['rawAttributes'],function(_0x34381d){return{'name':_0x34381d[_0x2758('0x28')],'type':_0x34381d[_0x2758('0x29')][_0x2758('0x2a')]};});_0x566312[_0x2758('0x2b')]=_[_0x2758('0x2c')](_[_0x2758('0x26')](_0xeb61,_0x2758('0x24')),[_0x2758('0x24')]);_0x566312[_0x2758('0x2d')]=_[_0x2758('0x2e')](_0x49e687[_0x2758('0x2d')]);_0x566312['filters']=_['intersection'](_0x566312[_0x2758('0x2b')],_0x566312['query']);_0x1b5b0b[_0x2758('0x2f')]=_[_0x2758('0x30')](_0x566312[_0x2758('0x2b')],qs[_0x2758('0x31')](_0x49e687[_0x2758('0x2d')]['fields']));_0x1b5b0b[_0x2758('0x2f')]=_0x1b5b0b['attributes'][_0x2758('0x32')]?_0x1b5b0b[_0x2758('0x2f')]:_0x566312[_0x2758('0x2b')];if(!_0x49e687[_0x2758('0x2d')][_0x2758('0x33')](_0x2758('0x34'))){_0x1b5b0b[_0x2758('0x19')]=qs['limit'](_0x49e687['query']['limit']);_0x1b5b0b[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x49e687[_0x2758('0x2d')][_0x2758('0x1b')]);}_0x1b5b0b[_0x2758('0x35')]=qs[_0x2758('0x36')](_0x49e687[_0x2758('0x2d')]['sort']);_0x1b5b0b[_0x2758('0x37')]=qs[_0x2758('0x38')](_['pick'](_0x49e687['query'],_0x566312[_0x2758('0x38')]),_0xeb61);if(_0x49e687[_0x2758('0x2d')][_0x2758('0x39')]){_0x1b5b0b[_0x2758('0x37')]=_['merge'](_0x1b5b0b['where'],{'$or':_[_0x2758('0x26')](_0xeb61,function(_0x55caf6){if(_0x55caf6[_0x2758('0x29')]!==_0x2758('0x3a')){var _0xc368b4={};_0xc368b4[_0x55caf6['name']]={'$like':'%'+_0x49e687[_0x2758('0x2d')][_0x2758('0x39')]+'%'};return _0xc368b4;}})});}_0x1b5b0b=_[_0x2758('0x3b')]({},_0x1b5b0b,_0x49e687[_0x2758('0x3c')]);var _0x3ac144={'where':_0x1b5b0b[_0x2758('0x37')]};return db[_0x2758('0x27')][_0x2758('0x1a')](_0x3ac144)[_0x2758('0x22')](function(_0x3f5bb5){_0x26cc00[_0x2758('0x1a')]=_0x3f5bb5;if(_0x49e687[_0x2758('0x2d')][_0x2758('0x3d')]){_0x1b5b0b[_0x2758('0x3e')]=[{'all':!![]}];}return db[_0x2758('0x27')][_0x2758('0x3f')](_0x1b5b0b);})[_0x2758('0x22')](function(_0x1c5806){_0x26cc00[_0x2758('0x40')]=_0x1c5806;return _0x26cc00;})[_0x2758('0x22')](respondWithFilteredResult(_0x584927,_0x1b5b0b))[_0x2758('0x41')](handleError(_0x584927,null));};exports[_0x2758('0x42')]=function(_0x3257c3,_0x41e73a){var _0x17ac36={'raw':!![],'where':{'id':_0x3257c3[_0x2758('0x43')]['id']}},_0x476a72={};_0x476a72[_0x2758('0x2b')]=_[_0x2758('0x2e')](db[_0x2758('0x27')][_0x2758('0x44')]);_0x476a72[_0x2758('0x2d')]=_[_0x2758('0x2e')](_0x3257c3[_0x2758('0x2d')]);_0x476a72[_0x2758('0x38')]=_[_0x2758('0x30')](_0x476a72[_0x2758('0x2b')],_0x476a72[_0x2758('0x2d')]);_0x17ac36[_0x2758('0x2f')]=_[_0x2758('0x30')](_0x476a72['model'],qs[_0x2758('0x31')](_0x3257c3[_0x2758('0x2d')][_0x2758('0x31')]));_0x17ac36[_0x2758('0x2f')]=_0x17ac36[_0x2758('0x2f')][_0x2758('0x32')]?_0x17ac36['attributes']:_0x476a72[_0x2758('0x2b')];if(_0x3257c3['query'][_0x2758('0x3d')]){_0x17ac36[_0x2758('0x3e')]=[{'all':!![]}];}_0x17ac36=_[_0x2758('0x3b')]({},_0x17ac36,_0x3257c3['options']);return db[_0x2758('0x27')][_0x2758('0x45')](_0x17ac36)[_0x2758('0x22')](handleEntityNotFound(_0x41e73a,null))[_0x2758('0x22')](respondWithResult(_0x41e73a,null))['catch'](handleError(_0x41e73a,null));};exports[_0x2758('0x20')]=function(_0x24dea3,_0x195e8e){if(_0x24dea3[_0x2758('0x46')]['id']){delete _0x24dea3[_0x2758('0x46')]['id'];}return db[_0x2758('0x27')][_0x2758('0x45')]({'where':{'id':_0x24dea3[_0x2758('0x43')]['id']}})[_0x2758('0x22')](handleEntityNotFound(_0x195e8e,null))[_0x2758('0x22')](saveUpdates(_0x24dea3[_0x2758('0x46')],null))[_0x2758('0x22')](respondWithResult(_0x195e8e,null))[_0x2758('0x41')](handleError(_0x195e8e,null));};exports[_0x2758('0x21')]=function(_0x52d82d,_0xed2d60){return db[_0x2758('0x27')][_0x2758('0x45')]({'where':{'id':_0x52d82d[_0x2758('0x43')]['id']}})[_0x2758('0x22')](handleEntityNotFound(_0xed2d60,null))['then'](removeEntity(_0xed2d60,null))[_0x2758('0x41')](handleError(_0xed2d60,null));};exports[_0x2758('0x47')]=function(_0x2e6c63,_0x557cc2){var _0x142093;return db['sequelize'][_0x2758('0x48')](function(_0x23d72d){return db[_0x2758('0x27')][_0x2758('0x47')](_0x2e6c63[_0x2758('0x46')],{'transaction':_0x23d72d})['then'](function(_0x3439d9){_0x142093=_0x3439d9;var _0xb69de1={'type':db[_0x2758('0x49')]['TEXT'],'transaction':_0x23d72d};switch(_0x2e6c63[_0x2758('0x46')][_0x2758('0x29')]){case _0x2758('0x4a'):_0xb69de1[_0x2758('0x29')]=db[_0x2758('0x49')][_0x2758('0x4b')];break;case _0x2758('0x4c'):_0xb69de1[_0x2758('0x29')]=db['Sequelize']['INTEGER'];break;case _0x2758('0x4d'):_0xb69de1[_0x2758('0x29')]=db[_0x2758('0x49')][_0x2758('0x4e')];_0xb69de1[_0x2758('0x4f')]=![];break;default:}return db['sequelize'][_0x2758('0x50')][_0x2758('0x51')]('cm_contacts',util[_0x2758('0x52')]('cf_%d',_0x142093['id']),_0xb69de1);})['then'](function(){return _0x142093;});})[_0x2758('0x22')](respondWithResult(_0x557cc2,0xc9))['catch'](handleError(_0x557cc2,null));};
\ No newline at end of file
+var _0x9df7=['includeAll','find','body','sequelize','create','Sequelize','TEXT','text','number','INTEGER','switch','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','CmCustomField','then','include','findAll','catch','params','rawAttributes'];(function(_0x468566,_0x1876e3){var _0x253880=function(_0xe01f65){while(--_0xe01f65){_0x468566['push'](_0x468566['shift']());}};_0x253880(++_0x1876e3);}(_0x9df7,0x15b));var _0x79df=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x9df7[_0x305486];return _0xa04940;};'use strict';var emlformat=require(_0x79df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79df('0x1'));var jsonpatch=require(_0x79df('0x2'));var rp=require(_0x79df('0x3'));var moment=require(_0x79df('0x4'));var BPromise=require(_0x79df('0x5'));var Mustache=require(_0x79df('0x6'));var util=require('util');var path=require(_0x79df('0x7'));var sox=require(_0x79df('0x8'));var csv=require('to-csv');var ejs=require(_0x79df('0x9'));var fs=require('fs');var fs_extra=require(_0x79df('0xa'));var _=require(_0x79df('0xb'));var squel=require('squel');var crypto=require(_0x79df('0xc'));var jsforce=require(_0x79df('0xd'));var deskjs=require(_0x79df('0xe'));var toCsv=require(_0x79df('0xf'));var querystring=require(_0x79df('0x10'));var Papa=require(_0x79df('0x11'));var Redis=require(_0x79df('0x12'));var authService=require(_0x79df('0x13'));var qs=require(_0x79df('0x14'));var as=require(_0x79df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79df('0x16'))(_0x79df('0x17'));var utils=require(_0x79df('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a517,_0x2f41f8){_0x2f41f8=_0x2f41f8||0xcc;return function(_0x5c421f){if(_0x5c421f){return _0x37a517[_0x79df('0x19')](_0x2f41f8);}return _0x37a517[_0x79df('0x1a')](_0x2f41f8)['end']();};}function respondWithResult(_0x336e57,_0x33412f){_0x33412f=_0x33412f||0xc8;return function(_0x33b8ba){if(_0x33b8ba){return _0x336e57[_0x79df('0x1a')](_0x33412f)[_0x79df('0x1b')](_0x33b8ba);}};}function respondWithFilteredResult(_0x467409,_0x168730){return function(_0x40c514){if(_0x40c514){var _0x4d6e79=typeof _0x168730['offset']===_0x79df('0x1c')&&typeof _0x168730[_0x79df('0x1d')]===_0x79df('0x1c');var _0x2cbf2a=_0x40c514[_0x79df('0x1e')];var _0x3cd245=_0x4d6e79?0x0:_0x168730[_0x79df('0x1f')];var _0xf06a39=_0x4d6e79?_0x40c514[_0x79df('0x1e')]:_0x168730[_0x79df('0x1f')]+_0x168730['limit'];var _0x5de70e;if(_0xf06a39>=_0x2cbf2a){_0xf06a39=_0x2cbf2a;_0x5de70e=0xc8;}else{_0x5de70e=0xce;}_0x467409[_0x79df('0x1a')](_0x5de70e);return _0x467409['set'](_0x79df('0x20'),_0x3cd245+'-'+_0xf06a39+'/'+_0x2cbf2a)[_0x79df('0x1b')](_0x40c514);}return null;};}function patchUpdates(_0x2db5b5){return function(_0x279e93){try{jsonpatch[_0x79df('0x21')](_0x279e93,_0x2db5b5,!![]);}catch(_0x2b34aa){return BPromise['reject'](_0x2b34aa);}return _0x279e93[_0x79df('0x22')]();};}function saveUpdates(_0x1197aa,_0x5f2259){return function(_0x3b37ce){if(_0x3b37ce){return _0x3b37ce[_0x79df('0x23')](_0x1197aa)['then'](function(_0x4ae13f){return _0x4ae13f;});}return null;};}function removeEntity(_0x388d4c,_0x2846db){return function(_0x475a70){if(_0x475a70){return _0x475a70[_0x79df('0x24')]()['then'](function(){_0x388d4c[_0x79df('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16db49,_0x4cc859){return function(_0x56617b){if(!_0x56617b){_0x16db49['sendStatus'](0x194);}return _0x56617b;};}function handleError(_0x2afc89,_0x2040a1){_0x2040a1=_0x2040a1||0x1f4;return function(_0x548080){logger['error'](_0x548080[_0x79df('0x25')]);if(_0x548080[_0x79df('0x26')]){delete _0x548080[_0x79df('0x26')];}_0x2afc89[_0x79df('0x1a')](_0x2040a1)[_0x79df('0x27')](_0x548080);};}exports[_0x79df('0x28')]=function(_0x231a90,_0x495114){var _0x6b9b0f={},_0x4fb48a={},_0x5dcad7={'count':0x0,'rows':[]};var _0x3e4b05=_[_0x79df('0x29')](db['CmCustomField']['rawAttributes'],function(_0x2db48d){return{'name':_0x2db48d[_0x79df('0x2a')],'type':_0x2db48d[_0x79df('0x2b')][_0x79df('0x2c')]};});_0x4fb48a[_0x79df('0x2d')]=_[_0x79df('0x2e')](_[_0x79df('0x29')](_0x3e4b05,_0x79df('0x26')),[_0x79df('0x26')]);_0x4fb48a[_0x79df('0x2f')]=_[_0x79df('0x30')](_0x231a90['query']);_0x4fb48a[_0x79df('0x31')]=_[_0x79df('0x32')](_0x4fb48a[_0x79df('0x2d')],_0x4fb48a['query']);_0x6b9b0f[_0x79df('0x33')]=_[_0x79df('0x32')](_0x4fb48a[_0x79df('0x2d')],qs[_0x79df('0x34')](_0x231a90['query'][_0x79df('0x34')]));_0x6b9b0f[_0x79df('0x33')]=_0x6b9b0f[_0x79df('0x33')][_0x79df('0x35')]?_0x6b9b0f[_0x79df('0x33')]:_0x4fb48a[_0x79df('0x2d')];if(!_0x231a90[_0x79df('0x2f')][_0x79df('0x36')]('nolimit')){_0x6b9b0f[_0x79df('0x1d')]=qs['limit'](_0x231a90[_0x79df('0x2f')][_0x79df('0x1d')]);_0x6b9b0f['offset']=qs['offset'](_0x231a90[_0x79df('0x2f')]['offset']);}_0x6b9b0f[_0x79df('0x37')]=qs['sort'](_0x231a90[_0x79df('0x2f')]['sort']);_0x6b9b0f[_0x79df('0x38')]=qs[_0x79df('0x31')](_['pick'](_0x231a90[_0x79df('0x2f')],_0x4fb48a['filters']),_0x3e4b05);if(_0x231a90[_0x79df('0x2f')][_0x79df('0x39')]){_0x6b9b0f[_0x79df('0x38')]=_[_0x79df('0x3a')](_0x6b9b0f['where'],{'$or':_[_0x79df('0x29')](_0x3e4b05,function(_0x4b9b78){if(_0x4b9b78[_0x79df('0x2b')]!==_0x79df('0x3b')){var _0x426fd0={};_0x426fd0[_0x4b9b78[_0x79df('0x26')]]={'$like':'%'+_0x231a90[_0x79df('0x2f')][_0x79df('0x39')]+'%'};return _0x426fd0;}})});}_0x6b9b0f=_[_0x79df('0x3a')]({},_0x6b9b0f,_0x231a90[_0x79df('0x3c')]);var _0x2923cc={'where':_0x6b9b0f[_0x79df('0x38')]};return db[_0x79df('0x3d')]['count'](_0x2923cc)[_0x79df('0x3e')](function(_0x1f4984){_0x5dcad7[_0x79df('0x1e')]=_0x1f4984;if(_0x231a90[_0x79df('0x2f')]['includeAll']){_0x6b9b0f[_0x79df('0x3f')]=[{'all':!![]}];}return db[_0x79df('0x3d')][_0x79df('0x40')](_0x6b9b0f);})[_0x79df('0x3e')](function(_0x10b7e5){_0x5dcad7['rows']=_0x10b7e5;return _0x5dcad7;})[_0x79df('0x3e')](respondWithFilteredResult(_0x495114,_0x6b9b0f))[_0x79df('0x41')](handleError(_0x495114,null));};exports['show']=function(_0x2fdbd9,_0x114d1d){var _0x5a356a={'raw':!![],'where':{'id':_0x2fdbd9[_0x79df('0x42')]['id']}},_0x27fdb7={};_0x27fdb7[_0x79df('0x2d')]=_[_0x79df('0x30')](db[_0x79df('0x3d')][_0x79df('0x43')]);_0x27fdb7['query']=_[_0x79df('0x30')](_0x2fdbd9[_0x79df('0x2f')]);_0x27fdb7[_0x79df('0x31')]=_[_0x79df('0x32')](_0x27fdb7[_0x79df('0x2d')],_0x27fdb7[_0x79df('0x2f')]);_0x5a356a['attributes']=_['intersection'](_0x27fdb7['model'],qs[_0x79df('0x34')](_0x2fdbd9['query'][_0x79df('0x34')]));_0x5a356a[_0x79df('0x33')]=_0x5a356a['attributes'][_0x79df('0x35')]?_0x5a356a['attributes']:_0x27fdb7[_0x79df('0x2d')];if(_0x2fdbd9[_0x79df('0x2f')][_0x79df('0x44')]){_0x5a356a[_0x79df('0x3f')]=[{'all':!![]}];}_0x5a356a=_[_0x79df('0x3a')]({},_0x5a356a,_0x2fdbd9[_0x79df('0x3c')]);return db[_0x79df('0x3d')][_0x79df('0x45')](_0x5a356a)[_0x79df('0x3e')](handleEntityNotFound(_0x114d1d,null))['then'](respondWithResult(_0x114d1d,null))[_0x79df('0x41')](handleError(_0x114d1d,null));};exports[_0x79df('0x23')]=function(_0x50f367,_0x5d7b1e){if(_0x50f367[_0x79df('0x46')]['id']){delete _0x50f367[_0x79df('0x46')]['id'];}return db['CmCustomField'][_0x79df('0x45')]({'where':{'id':_0x50f367[_0x79df('0x42')]['id']}})[_0x79df('0x3e')](handleEntityNotFound(_0x5d7b1e,null))[_0x79df('0x3e')](saveUpdates(_0x50f367[_0x79df('0x46')],null))['then'](respondWithResult(_0x5d7b1e,null))[_0x79df('0x41')](handleError(_0x5d7b1e,null));};exports['destroy']=function(_0x4faf0f,_0x2c6824){return db['CmCustomField']['find']({'where':{'id':_0x4faf0f[_0x79df('0x42')]['id']}})[_0x79df('0x3e')](handleEntityNotFound(_0x2c6824,null))[_0x79df('0x3e')](removeEntity(_0x2c6824,null))[_0x79df('0x41')](handleError(_0x2c6824,null));};exports['create']=function(_0xcd1502,_0x2aa573){var _0x29406c;return db[_0x79df('0x47')]['transaction'](function(_0x9271e){return db[_0x79df('0x3d')][_0x79df('0x48')](_0xcd1502[_0x79df('0x46')],{'transaction':_0x9271e})[_0x79df('0x3e')](function(_0x5dea8d){_0x29406c=_0x5dea8d;var _0x15f7c5={'type':db[_0x79df('0x49')][_0x79df('0x4a')],'transaction':_0x9271e};switch(_0xcd1502[_0x79df('0x46')][_0x79df('0x2b')]){case _0x79df('0x4b'):_0x15f7c5[_0x79df('0x2b')]=db['Sequelize'][_0x79df('0x4a')];break;case _0x79df('0x4c'):_0x15f7c5[_0x79df('0x2b')]=db[_0x79df('0x49')][_0x79df('0x4d')];break;case _0x79df('0x4e'):_0x15f7c5['type']=db[_0x79df('0x49')]['BOOLEAN'];_0x15f7c5['defaultValue']=![];break;default:}return db[_0x79df('0x47')]['queryInterface'][_0x79df('0x4f')](_0x79df('0x50'),util[_0x79df('0x51')](_0x79df('0x52'),_0x29406c['id']),_0x15f7c5);})[_0x79df('0x3e')](function(){return _0x29406c;});})[_0x79df('0x3e')](respondWithResult(_0x2aa573,0xc9))[_0x79df('0x41')](handleError(_0x2aa573,null));};
\ No newline at end of file
index 3bf3bc4..903987b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x844e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','util'];(function(_0x58175f,_0x5a5ef5){var _0x4d6488=function(_0x1b545a){while(--_0x1b545a){_0x58175f['push'](_0x58175f['shift']());}};_0x4d6488(++_0x5a5ef5);}(_0x844e,0xa7));var _0xe844=function(_0x188b56,_0x926a0f){_0x188b56=_0x188b56-0x0;var _0x1ab087=_0x844e[_0x188b56];return _0x1ab087;};'use strict';var _=require('lodash');var util=require(_0xe844('0x0'));var logger=require(_0xe844('0x1'))(_0xe844('0x2'));var moment=require(_0xe844('0x3'));var BPromise=require(_0xe844('0x4'));var rp=require(_0xe844('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe844('0x6'));var config=require(_0xe844('0x7'));var attributes=require(_0xe844('0x8'));module[_0xe844('0x9')]=function(_0x1a1a93,_0x30ba2c){return _0x1a1a93[_0xe844('0xa')]('CmCustomField',attributes,{'tableName':_0xe844('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c04=['path','exports','CmCustomField','lodash','util','../../config/logger','moment','request-promise'];(function(_0x263a08,_0x2d9b7a){var _0x195d0f=function(_0x2a66e5){while(--_0x2a66e5){_0x263a08['push'](_0x263a08['shift']());}};_0x195d0f(++_0x2d9b7a);}(_0x5c04,0x10b));var _0x45c0=function(_0x111fe7,_0x2603a4){_0x111fe7=_0x111fe7-0x0;var _0x2abbbb=_0x5c04[_0x111fe7];return _0x2abbbb;};'use strict';var _=require(_0x45c0('0x0'));var util=require(_0x45c0('0x1'));var logger=require(_0x45c0('0x2'))('api');var moment=require(_0x45c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x45c0('0x4'));var fs=require('fs');var path=require(_0x45c0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x45c0('0x6')]=function(_0x41b1fe,_0xd46bc7){return _0x41b1fe['define'](_0x45c0('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1d2590..6006f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbde=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x5c1d68,_0x324087){var _0x229418=function(_0x1e6e50){while(--_0x1e6e50){_0x5c1d68['push'](_0x5c1d68['shift']());}};_0x229418(++_0x324087);}(_0xfbde,0xa9));var _0xefbd=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xfbde[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xefbd('0x0'));var util=require('util');var moment=require(_0xefbd('0x1'));var BPromise=require(_0xefbd('0x2'));var rs=require(_0xefbd('0x3'));var fs=require('fs');var Redis=require(_0xefbd('0x4'));var db=require(_0xefbd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefbd('0x6'));var config=require(_0xefbd('0x7'));var jayson=require(_0xefbd('0x8'));var client=jayson['client'][_0xefbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4e20,_0x376fe9,_0x46e402){return new BPromise(function(_0xdd1cf,_0x4c9c39){return client['request'](_0x2b4e20,_0x46e402)[_0xefbd('0xa')](function(_0x33cb71){logger[_0xefbd('0xb')](_0xefbd('0xc'),_0x376fe9,_0xefbd('0xd'));logger[_0xefbd('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x376fe9,_0xefbd('0xd'),JSON[_0xefbd('0xf')](_0x33cb71));if(_0x33cb71[_0xefbd('0x10')]){if(_0x33cb71[_0xefbd('0x10')][_0xefbd('0x11')]===0x1f4){logger[_0xefbd('0x10')](_0xefbd('0xc'),_0x376fe9,_0x33cb71[_0xefbd('0x10')]['message']);return _0x4c9c39(_0x33cb71[_0xefbd('0x10')][_0xefbd('0x12')]);}logger[_0xefbd('0x10')](_0xefbd('0xc'),_0x376fe9,_0x33cb71[_0xefbd('0x10')][_0xefbd('0x12')]);return _0xdd1cf(_0x33cb71[_0xefbd('0x10')][_0xefbd('0x12')]);}else{logger[_0xefbd('0xb')]('CmCustomField,\x20%s,\x20%s',_0x376fe9,'request\x20sent');_0xdd1cf(_0x33cb71[_0xefbd('0x13')]['message']);}})['catch'](function(_0x51f904){logger[_0xefbd('0x10')](_0xefbd('0xc'),_0x376fe9,_0x51f904);_0x4c9c39(_0x51f904);});});}
\ No newline at end of file
+var _0x567e=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x5bf6b8,_0x1f17d1){var _0x108aed=function(_0x3c35f6){while(--_0x3c35f6){_0x5bf6b8['push'](_0x5bf6b8['shift']());}};_0x108aed(++_0x1f17d1);}(_0x567e,0x1e3));var _0xe567=function(_0x3c77b9,_0x2adf15){_0x3c77b9=_0x3c77b9-0x0;var _0x476177=_0x567e[_0x3c77b9];return _0x476177;};'use strict';var _=require(_0xe567('0x0'));var util=require(_0xe567('0x1'));var moment=require('moment');var BPromise=require(_0xe567('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe567('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe567('0x4'));var logger=require(_0xe567('0x5'))(_0xe567('0x6'));var config=require(_0xe567('0x7'));var jayson=require(_0xe567('0x8'));var client=jayson[_0xe567('0x9')][_0xe567('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c853e,_0x4d7386,_0x1e8f80){return new BPromise(function(_0x45eeea,_0x8256f9){return client[_0xe567('0xb')](_0x3c853e,_0x1e8f80)[_0xe567('0xc')](function(_0x41de8b){logger[_0xe567('0xd')](_0xe567('0xe'),_0x4d7386,_0xe567('0xf'));logger['debug'](_0xe567('0x10'),_0x4d7386,_0xe567('0xf'),JSON[_0xe567('0x11')](_0x41de8b));if(_0x41de8b['error']){if(_0x41de8b[_0xe567('0x12')]['code']===0x1f4){logger[_0xe567('0x12')](_0xe567('0xe'),_0x4d7386,_0x41de8b[_0xe567('0x12')][_0xe567('0x13')]);return _0x8256f9(_0x41de8b[_0xe567('0x12')]['message']);}logger[_0xe567('0x12')](_0xe567('0xe'),_0x4d7386,_0x41de8b[_0xe567('0x12')][_0xe567('0x13')]);return _0x45eeea(_0x41de8b[_0xe567('0x12')]['message']);}else{logger[_0xe567('0xd')]('CmCustomField,\x20%s,\x20%s',_0x4d7386,_0xe567('0xf'));_0x45eeea(_0x41de8b['result'][_0xe567('0x13')]);}})[_0xe567('0x14')](function(_0x52f132){logger[_0xe567('0x12')](_0xe567('0xe'),_0x4d7386,_0x52f132);_0x8256f9(_0x52f132);});});}
\ No newline at end of file
index 5bc74dd..049a0cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e0=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','put','delete','exports'];(function(_0x2a260f,_0x5c6529){var _0x2d8fa9=function(_0x392d5f){while(--_0x392d5f){_0x2a260f['push'](_0x2a260f['shift']());}};_0x2d8fa9(++_0x5c6529);}(_0x96e0,0x7e));var _0x096e=function(_0x27c7bc,_0x3e305e){_0x27c7bc=_0x27c7bc-0x0;var _0xa0ae84=_0x96e0[_0x27c7bc];return _0xa0ae84;};'use strict';var multer=require(_0x096e('0x0'));var util=require('util');var path=require(_0x096e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x096e('0x2')]();var fs_extra=require(_0x096e('0x3'));var auth=require(_0x096e('0x4'));var interaction=require(_0x096e('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x096e('0x6')](),controller[_0x096e('0x7')]);router[_0x096e('0x8')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller[_0x096e('0xa')]);router['post']('/',auth[_0x096e('0x6')](),controller['create']);router[_0x096e('0xb')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller['update']);router[_0x096e('0xc')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller['destroy']);module[_0x096e('0xd')]=router;
\ No newline at end of file
+var _0x1602=['get','/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x57fee1,_0x232580){var _0x2f0a5f=function(_0x160d0a){while(--_0x160d0a){_0x57fee1['push'](_0x57fee1['shift']());}};_0x2f0a5f(++_0x232580);}(_0x1602,0x135));var _0x2160=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1602[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x2160('0x0'));var util=require(_0x2160('0x1'));var path=require(_0x2160('0x2'));var timeout=require(_0x2160('0x3'));var express=require(_0x2160('0x4'));var router=express[_0x2160('0x5')]();var fs_extra=require(_0x2160('0x6'));var auth=require(_0x2160('0x7'));var interaction=require(_0x2160('0x8'));var config=require(_0x2160('0x9'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2160('0xa')]);router[_0x2160('0xb')](_0x2160('0xc'),auth['isAuthenticated'](),controller[_0x2160('0xd')]);router[_0x2160('0xe')]('/',auth[_0x2160('0xf')](),controller['create']);router[_0x2160('0x10')]('/:id',auth[_0x2160('0xf')](),controller['update']);router[_0x2160('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2160('0x12')]);module[_0x2160('0x13')]=router;
\ No newline at end of file
index b2953fb..6e4ecde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x762a=['DATE','INTEGER','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN'];(function(_0xe47217,_0x3a35db){var _0x3dc84c=function(_0x2b5480){while(--_0x2b5480){_0xe47217['push'](_0xe47217['shift']());}};_0x3dc84c(++_0x3a35db);}(_0x762a,0x134));var _0xa762=function(_0xe37137,_0x11e8d0){_0xe37137=_0xe37137-0x0;var _0x5b33d8=_0x762a[_0xe37137];return _0x5b33d8;};'use strict';var moment=require('moment');var Sequelize=require(_0xa762('0x0'));module[_0xa762('0x1')]={'phone':{'type':Sequelize[_0xa762('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa762('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa762('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xa762('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa762('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa762('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa762('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa762('0x4')]},'priority':{'type':Sequelize[_0xa762('0x5')](0x2)[_0xa762('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa762('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa762('0x7')},'ListId':{'type':Sequelize[_0xa762('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xa762('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xa762('0x5')],'unique':_0xa762('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa762('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa762('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa762('0x5')],'allowNull':!![],'defaultValue':0x0}};
\ No newline at end of file
+var _0x22e8=['sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x22e8,0x153));var _0x822e=function(_0x5dead3,_0x473fab){_0x5dead3=_0x5dead3-0x0;var _0x26ddbc=_0x22e8[_0x5dead3];return _0x26ddbc;};'use strict';var moment=require(_0x822e('0x0'));var Sequelize=require(_0x822e('0x1'));module[_0x822e('0x2')]={'phone':{'type':Sequelize[_0x822e('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x822e('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x822e('0x5')],'defaultValue':moment()['format'](_0x822e('0x6'))},'countbusyretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x822e('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x822e('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x822e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x822e('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x822e('0x7')],'unique':_0x822e('0x9')},'ListId':{'type':Sequelize[_0x822e('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x822e('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x822e('0x7')],'unique':_0x822e('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x822e('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x822e('0x7')],'allowNull':!![],'defaultValue':0x0}};
\ No newline at end of file
index 5ba58bb..617476f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['count','set','apply','then','end','error','stack','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','update','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','state','deleted','campaign','membername','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','finally','outbound','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd9,0xfc));var _0x9edd=function(_0xbbeaf8,_0x48da56){_0xbbeaf8=_0xbbeaf8-0x0;var _0xddf567=_0xedd9[_0xbbeaf8];return _0xddf567;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x33')](_0x2ae8dd['filters'],[_0x9edd('0x34'),_0x9edd('0x35'),_0x9edd('0x36'),_0x9edd('0x37'),_0x9edd('0x38'),_0x9edd('0x39'),_0x9edd('0x3a'),_0x9edd('0x3b'),_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e'),_0x9edd('0x3f'),_0x9edd('0x40'),_0x9edd('0x41'),'$notLike',_0x9edd('0x42'),'$notILike',_0x9edd('0x41'),_0x9edd('0x43'),_0x9edd('0x44'),_0x9edd('0x45'),_0x9edd('0x46')]);_0x28cfae['attributes']=_[_0x9edd('0x32')](_0x2ae8dd[_0x9edd('0x2d')],qs[_0x9edd('0x47')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x47')]));_0x28cfae[_0x9edd('0x48')]=_0x28cfae[_0x9edd('0x48')][_0x9edd('0x49')]?_0x28cfae[_0x9edd('0x48')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a['query'][_0x9edd('0x4a')]('nolimit')){_0x28cfae[_0x9edd('0x1d')]=qs['limit'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1d')]);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x4b')]=qs['sort'](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x4c')]=qs[_0x9edd('0x31')](_['pick'](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x4d')]){_0x28cfae['where']=_[_0x9edd('0x4e')](_0x28cfae['where'],{'$or':_[_0x9edd('0x27')](_0x5eccfb,function(_0xc1e657){if(_0xc1e657['type']!==_0x9edd('0x4f')){var _0x49a128={};_0x49a128[_0xc1e657['name']]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x4d')]+'%'};return _0x49a128;}})});}_0x28cfae=_[_0x9edd('0x4e')]({},_0x28cfae,_0x52746a[_0x9edd('0x50')]);var _0x25e6ec={'where':_0x28cfae[_0x9edd('0x4c')]};return db[_0x9edd('0x28')][_0x9edd('0x1e')](_0x25e6ec)[_0x9edd('0x21')](function(_0x2b081a){_0x41af53[_0x9edd('0x1e')]=_0x2b081a;if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x51')]){_0x28cfae[_0x9edd('0x52')]=[{'all':!![]}];}return db[_0x9edd('0x28')]['findAll'](_0x28cfae);})[_0x9edd('0x21')](function(_0x2570e3){_0x41af53[_0x9edd('0x53')]=_0x2570e3;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x54')](handleError(_0x238b22,null));};exports[_0x9edd('0x55')]=function(_0x10d41e,_0x4e9ad1){var _0x4a4656={'raw':!![],'where':{'id':_0x10d41e[_0x9edd('0x56')]['id']}},_0x4bc7a1={};_0x4bc7a1['model']=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x4bc7a1[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x10d41e['query']);_0x4bc7a1[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x4bc7a1[_0x9edd('0x2d')],_0x4bc7a1['query']);_0x4a4656[_0x9edd('0x48')]=_[_0x9edd('0x32')](_0x4bc7a1[_0x9edd('0x2d')],qs[_0x9edd('0x47')](_0x10d41e[_0x9edd('0x2f')][_0x9edd('0x47')]));_0x4a4656['attributes']=_0x4a4656[_0x9edd('0x48')][_0x9edd('0x49')]?_0x4a4656['attributes']:_0x4bc7a1[_0x9edd('0x2d')];if(_0x10d41e[_0x9edd('0x2f')]['includeAll']){_0x4a4656[_0x9edd('0x52')]=[{'all':!![]}];}_0x4a4656=_[_0x9edd('0x4e')]({},_0x4a4656,_0x10d41e[_0x9edd('0x50')]);return db['CmHopper'][_0x9edd('0x57')](_0x4a4656)[_0x9edd('0x21')](handleEntityNotFound(_0x4e9ad1,null))[_0x9edd('0x21')](respondWithResult(_0x4e9ad1,null))[_0x9edd('0x54')](handleError(_0x4e9ad1,null));};exports['create']=function(_0x446443,_0x527727){return db[_0x9edd('0x28')]['create'](_0x446443[_0x9edd('0x58')],{})[_0x9edd('0x21')](respondWithResult(_0x527727,0xc9))['catch'](handleError(_0x527727,null));};exports[_0x9edd('0x59')]=function(_0x4e2aaf,_0x336494){if(_0x4e2aaf[_0x9edd('0x58')]['id']){delete _0x4e2aaf[_0x9edd('0x58')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x57')]({'where':{'id':_0x4e2aaf[_0x9edd('0x56')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x336494,null))[_0x9edd('0x21')](saveUpdates(_0x4e2aaf[_0x9edd('0x58')],null))[_0x9edd('0x21')](respondWithResult(_0x336494,null))[_0x9edd('0x54')](handleError(_0x336494,null));};exports['describe']=function(_0x161bea,_0xf617e3){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0xf617e3,null))['catch'](handleError(_0xf617e3,null));};exports['destroy']=function(_0x54ecfa,_0x1348a7){var _0x45f47c;var _0x366316=_0x54ecfa[_0x9edd('0x56')]['id'];return db['CmHopper']['find']({'where':{'id':_0x54ecfa['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1348a7,null))[_0x9edd('0x21')](function(_0xd5090a){if(_0xd5090a){return _0xd5090a[_0x9edd('0x5a')]()[_0x9edd('0x21')](function(_0x41ec97){return _0x41ec97;});}})[_0x9edd('0x21')](function(_0x1e3087){_0x45f47c=_0x1e3087;if(_0x1e3087){if(_0x1e3087['VoiceQueueId']||_0x1e3087[_0x9edd('0x5b')]){return db[_0x1e3087['VoiceQueueId']?_0x9edd('0x5c'):_0x9edd('0x5d')]['find']({'where':{'id':_0x1e3087[_0x9edd('0x5e')]?_0x1e3087[_0x9edd('0x5e')]:_0x1e3087[_0x9edd('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x9edd('0x21')](function(_0x2e1ce3){var _0x430eb4={};if(_0x2e1ce3){_[_0x9edd('0x4e')](_0x430eb4,_[_0x9edd('0x5f')](_0x45f47c[_0x9edd('0x60')],['createdAt','updatedAt','id']));_0x430eb4[_0x9edd('0x61')]=0x15;_0x430eb4['statedesc']=_0x9edd('0x62');_0x430eb4[_0x9edd('0x63')]=_0x2e1ce3[_0x9edd('0x2e')];_0x430eb4[_0x9edd('0x64')]=_0x54ecfa['user'][_0x9edd('0x2e')];_0x430eb4['UserId']=_0x54ecfa[_0x9edd('0x65')]['id'];_0x430eb4[_0x9edd('0x62')]=!![];_0x430eb4[_0x9edd('0x66')]=moment()['format'](_0x9edd('0x67'));_0x430eb4['calleridnum']=_0x45f47c[_0x9edd('0x68')];_0x430eb4[_0x9edd('0x69')]=_0x45f47c['VoiceQueueId']?_0x9edd('0x6a'):'ivr';return db[_0x9edd('0x6b')][_0x9edd('0x57')]({'where':{'id':_0x430eb4[_0x9edd('0x6c')]},'attributes':['firstName',_0x9edd('0x6d')]})[_0x9edd('0x21')](function(_0x45c17d){if(!_[_0x9edd('0x6e')](_0x1348a7)&&!_[_0x9edd('0x6e')](_0x45c17d['firstName'])){_0x430eb4['calleridname']=_0x45c17d[_0x9edd('0x6f')];if(!_[_0x9edd('0x6e')](_0x45c17d['lastName'])){_0x430eb4['calleridname']+='\x20'+_0x45c17d['lastName'];}}})[_0x9edd('0x70')](function(){return db['CmHopperFinal']['create'](_0x430eb4);});}})[_0x9edd('0x21')](function(_0x32ff46){return db['CmHopperAdditionalPhone'][_0x9edd('0x5a')]({'where':{'CmHopperId':_0x366316}});})[_0x9edd('0x21')](function(){return _0x1348a7[_0x9edd('0x19')](0xcc)['end']();})[_0x9edd('0x54')](handleError(_0x1348a7,null));};exports['getPreview']=function(_0x37b018,_0x18d1a0,_0x4c8d06){var _0x1f80c4=[];return db[_0x9edd('0x6b')]['describe']()[_0x9edd('0x21')](function(_0x475dc3){_0x1f80c4=_[_0x9edd('0x30')](_0x475dc3);return _0x37b018[_0x9edd('0x65')]['getVoiceQueues']({'where':{'type':_0x9edd('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9edd('0x72')],'raw':!![]});})[_0x9edd('0x21')](function(_0xf6c8aa){if(_0xf6c8aa&&_0xf6c8aa['length']){return db[_0x9edd('0x73')][_0x9edd('0x74')](function(_0x130dba){var _0x383cb9={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9edd('0x75')](_0x9edd('0x67'))},'VoiceQueueId':{'$in':_[_0x9edd('0x27')](_0xf6c8aa,'id')},'$or':[{'UserId':null},{'UserId':_0x37b018['user']['id']}]};var _0x5e29d0=[];if(_0x37b018[_0x9edd('0x58')][_0x9edd('0x76')]&&_0x37b018[_0x9edd('0x58')][_0x9edd('0x76')]===_0x9edd('0x77')){if(!_['isEmpty'](_0x37b018[_0x9edd('0x58')][_0x9edd('0x78')])){_0x383cb9['id']={'$in':_0x37b018[_0x9edd('0x58')]['hopperIds']};}_0x5e29d0=[[_0x9edd('0x79'),_0x9edd('0x7a')],['scheduledAt',_0xf6c8aa[0x0][_0x9edd('0x72')]===_0x9edd('0x7a')?'DESC':_0x9edd('0x7a')],db[_0x9edd('0x73')]['literal'](_0x9edd('0x7b')),['id','DESC']];}else{if(!_['isEmpty'](_0x37b018[_0x9edd('0x58')][_0x9edd('0x78')])){_0x383cb9['id']={'$notIn':_0x37b018[_0x9edd('0x58')]['hopperIds']};}_0x5e29d0=[[_0x9edd('0x79'),_0x9edd('0x7c')],['scheduledAt',_0xf6c8aa[0x0][_0x9edd('0x72')]],db[_0x9edd('0x73')][_0x9edd('0x7d')](_0x9edd('0x7e')),['id','ASC']];}return db['CmHopper'][_0x9edd('0x7f')]({'attributes':['id','scheduledat',_0x9edd('0x68')],'where':_0x383cb9,'order':_0x5e29d0,'transaction':_0x130dba,'lock':_0x130dba[_0x9edd('0x80')][_0x9edd('0x81')],'include':[{'model':db[_0x9edd('0x6b')],'as':_0x9edd('0x82'),'attributes':_0x1f80c4,'include':[{'model':db[_0x9edd('0x83')],'as':_0x9edd('0x84'),'attributes':['id',_0x9edd('0x2e')]}]},{'model':db[_0x9edd('0x85')],'as':'List','attributes':['id',_0x9edd('0x2e')]},{'model':db[_0x9edd('0x5c')],'as':_0x9edd('0x86'),'attributes':['id',_0x9edd('0x2e'),_0x9edd('0x87')]}]})[_0x9edd('0x21')](function(_0x14fa8a){if(_0x14fa8a){return _0x14fa8a['update']({'UserId':_0x37b018[_0x9edd('0x65')]['id']},{'transaction':_0x130dba});}});});}})[_0x9edd('0x21')](handleEntityNotFound(_0x18d1a0,null))['then'](respondWithResult(_0x18d1a0,null))[_0x9edd('0x54')](handleError(_0x18d1a0,null));};exports[_0x9edd('0x88')]=function(_0x57231c,_0x304e56,_0x3d6d7a){return _0x57231c[_0x9edd('0x65')]['getVoiceQueues']({'where':{'type':_0x9edd('0x71'),'dialActive':!![],'dialMethod':_0x9edd('0x89')},'attributes':['id'],'raw':!![]})[_0x9edd('0x21')](function(_0x5a7de3){if(_0x5a7de3&&_0x5a7de3['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9edd('0x75')](_0x9edd('0x67'))},'VoiceQueueId':{'$in':_[_0x9edd('0x27')](_0x5a7de3,'id')},'$or':[{'UserId':null},{'UserId':_0x57231c['user']['id']}]}});}return 0x0;})['then'](function(_0x49dc1d){if(!_[_0x9edd('0x6e')](_0x49dc1d)&&_[_0x9edd('0x8a')](_0x49dc1d)){return _0x304e56[_0x9edd('0x19')](0xc8)[_0x9edd('0x1a')]({'contacts':_0x49dc1d});}else{logger[_0x9edd('0x23')](_0x9edd('0x8b'),_0x9edd('0x88'),0x194,_0x9edd('0x8c'));_0x304e56[_0x9edd('0x18')](0x194);}})[_0x9edd('0x54')](handleError(_0x304e56,null));};
\ No newline at end of file
+var _0x24ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','concat','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','model','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','CmHopper','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','find','omit','dataValues','createdAt','statedesc','membername','user','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperAdditionalPhone','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','getOpenContacts','outbound','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x550691,_0x19fe04){var _0x25f1e2=function(_0xe2eebd){while(--_0xe2eebd){_0x550691['push'](_0x550691['shift']());}};_0x25f1e2(++_0x19fe04);}(_0x24ca,0x1bc));var _0xa24c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x24ca[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['CmHopper'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c'));_0x5e491e[_0xa24c('0x32')]=_['keys'](_0x28675f[_0xa24c('0x32')]);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x32')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e[_0xa24c('0x33')],['$and','$or',_0xa24c('0x36'),_0xa24c('0x37'),_0xa24c('0x38'),_0xa24c('0x39'),_0xa24c('0x3a'),_0xa24c('0x3b'),_0xa24c('0x3c'),'$between',_0xa24c('0x3d'),_0xa24c('0x3e'),_0xa24c('0x3f'),_0xa24c('0x40'),_0xa24c('0x41'),_0xa24c('0x42'),_0xa24c('0x43'),_0xa24c('0x40'),_0xa24c('0x44'),_0xa24c('0x45'),'$contained',_0xa24c('0x46')]);_0x12dbdc[_0xa24c('0x47')]=_[_0xa24c('0x34')](_0x5e491e[_0xa24c('0x48')],qs['fields'](_0x28675f['query'][_0xa24c('0x49')]));_0x12dbdc['attributes']=_0x12dbdc[_0xa24c('0x47')][_0xa24c('0x4a')]?_0x12dbdc[_0xa24c('0x47')]:_0x5e491e[_0xa24c('0x48')];if(!_0x28675f[_0xa24c('0x32')]['hasOwnProperty']('nolimit')){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f['query']['offset']);}_0x12dbdc[_0xa24c('0x4b')]=qs[_0xa24c('0x4c')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x4c')]);_0x12dbdc[_0xa24c('0x4d')]=qs['filters'](_[_0xa24c('0x4e')](_0x28675f[_0xa24c('0x32')],_0x5e491e['filters']),_0xc96ce7);if(_0x28675f['query'][_0xa24c('0x4f')]){_0x12dbdc[_0xa24c('0x4d')]=_[_0xa24c('0x50')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x21e204){if(_0x21e204[_0xa24c('0x51')]!==_0xa24c('0x52')){var _0x3ccc37={};_0x3ccc37[_0x21e204[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x32')][_0xa24c('0x4f')]+'%'};return _0x3ccc37;}})});}_0x12dbdc=_[_0xa24c('0x50')]({},_0x12dbdc,_0x28675f['options']);var _0x4bac9e={'where':_0x12dbdc[_0xa24c('0x4d')]};return db[_0xa24c('0x53')][_0xa24c('0x20')](_0x4bac9e)['then'](function(_0x472c1e){_0x21d2a8[_0xa24c('0x20')]=_0x472c1e;if(_0x28675f[_0xa24c('0x32')][_0xa24c('0x54')]){_0x12dbdc[_0xa24c('0x55')]=[{'all':!![]}];}return db[_0xa24c('0x53')][_0xa24c('0x56')](_0x12dbdc);})[_0xa24c('0x27')](function(_0x3f52fe){_0x21d2a8[_0xa24c('0x57')]=_0x3f52fe;return _0x21d2a8;})['then'](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x58')](handleError(_0x152120,null));};exports[_0xa24c('0x59')]=function(_0x39a6cd,_0x5aa2b2){var _0x3a85cb={'raw':!![],'where':{'id':_0x39a6cd[_0xa24c('0x5a')]['id']}},_0x247d2c={};_0x247d2c[_0xa24c('0x48')]=_[_0xa24c('0x5b')](db[_0xa24c('0x53')][_0xa24c('0x2f')]);_0x247d2c[_0xa24c('0x32')]=_[_0xa24c('0x5b')](_0x39a6cd[_0xa24c('0x32')]);_0x247d2c[_0xa24c('0x33')]=_['intersection'](_0x247d2c[_0xa24c('0x48')],_0x247d2c[_0xa24c('0x32')]);_0x3a85cb[_0xa24c('0x47')]=_[_0xa24c('0x34')](_0x247d2c[_0xa24c('0x48')],qs[_0xa24c('0x49')](_0x39a6cd[_0xa24c('0x32')][_0xa24c('0x49')]));_0x3a85cb[_0xa24c('0x47')]=_0x3a85cb['attributes']['length']?_0x3a85cb[_0xa24c('0x47')]:_0x247d2c['model'];if(_0x39a6cd[_0xa24c('0x32')][_0xa24c('0x54')]){_0x3a85cb['include']=[{'all':!![]}];}_0x3a85cb=_[_0xa24c('0x50')]({},_0x3a85cb,_0x39a6cd[_0xa24c('0x5c')]);return db[_0xa24c('0x53')]['find'](_0x3a85cb)['then'](handleEntityNotFound(_0x5aa2b2,null))[_0xa24c('0x27')](respondWithResult(_0x5aa2b2,null))['catch'](handleError(_0x5aa2b2,null));};exports[_0xa24c('0x5d')]=function(_0x2a3665,_0x3c3c8b){return db[_0xa24c('0x53')][_0xa24c('0x5d')](_0x2a3665[_0xa24c('0x5e')],{})[_0xa24c('0x27')](respondWithResult(_0x3c3c8b,0xc9))[_0xa24c('0x58')](handleError(_0x3c3c8b,null));};exports[_0xa24c('0x26')]=function(_0xf3498c,_0x4ea43d){if(_0xf3498c[_0xa24c('0x5e')]['id']){delete _0xf3498c[_0xa24c('0x5e')]['id'];}return db[_0xa24c('0x53')]['find']({'where':{'id':_0xf3498c['params']['id']}})['then'](handleEntityNotFound(_0x4ea43d,null))[_0xa24c('0x27')](saveUpdates(_0xf3498c['body'],null))[_0xa24c('0x27')](respondWithResult(_0x4ea43d,null))[_0xa24c('0x58')](handleError(_0x4ea43d,null));};exports['describe']=function(_0x25c6e5,_0x204d33){return db[_0xa24c('0x53')][_0xa24c('0x5f')]()[_0xa24c('0x27')](respondWithResult(_0x204d33,null))[_0xa24c('0x58')](handleError(_0x204d33,null));};exports[_0xa24c('0x28')]=function(_0xbeab78,_0x518c2a){var _0x172645;var _0x47af80=_0xbeab78['params']['id'];return db['CmHopper']['find']({'where':{'id':_0xbeab78['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x518c2a,null))['then'](function(_0x27c184){if(_0x27c184){return _0x27c184[_0xa24c('0x28')]()[_0xa24c('0x27')](function(_0x1a5f17){return _0x1a5f17;});}})[_0xa24c('0x27')](function(_0x2e1feb){_0x172645=_0x2e1feb;if(_0x2e1feb){if(_0x2e1feb[_0xa24c('0x60')]||_0x2e1feb[_0xa24c('0x61')]){return db[_0x2e1feb[_0xa24c('0x60')]?_0xa24c('0x62'):_0xa24c('0x63')][_0xa24c('0x64')]({'where':{'id':_0x2e1feb[_0xa24c('0x60')]?_0x2e1feb[_0xa24c('0x60')]:_0x2e1feb[_0xa24c('0x61')]},'attributes':['id','name'],'raw':!![]});}}})[_0xa24c('0x27')](function(_0x168601){var _0x5264a7={};if(_0x168601){_[_0xa24c('0x50')](_0x5264a7,_[_0xa24c('0x65')](_0x172645[_0xa24c('0x66')],[_0xa24c('0x67'),'updatedAt','id']));_0x5264a7['state']=0x15;_0x5264a7[_0xa24c('0x68')]='deleted';_0x5264a7['campaign']=_0x168601[_0xa24c('0x2c')];_0x5264a7[_0xa24c('0x69')]=_0xbeab78[_0xa24c('0x6a')][_0xa24c('0x2c')];_0x5264a7['UserId']=_0xbeab78['user']['id'];_0x5264a7[_0xa24c('0x6b')]=!![];_0x5264a7['deletedat']=moment()['format'](_0xa24c('0x6c'));_0x5264a7[_0xa24c('0x6d')]=_0x172645[_0xa24c('0x6e')];_0x5264a7['campaigntype']=_0x172645[_0xa24c('0x60')]?_0xa24c('0x6f'):'ivr';return db[_0xa24c('0x70')][_0xa24c('0x64')]({'where':{'id':_0x5264a7[_0xa24c('0x71')]},'attributes':['firstName',_0xa24c('0x72')]})[_0xa24c('0x27')](function(_0x21439a){if(!_[_0xa24c('0x73')](_0x518c2a)&&!_[_0xa24c('0x73')](_0x21439a['firstName'])){_0x5264a7[_0xa24c('0x74')]=_0x21439a[_0xa24c('0x75')];if(!_[_0xa24c('0x73')](_0x21439a[_0xa24c('0x72')])){_0x5264a7[_0xa24c('0x74')]+='\x20'+_0x21439a[_0xa24c('0x72')];}}})[_0xa24c('0x76')](function(){return db['CmHopperFinal'][_0xa24c('0x5d')](_0x5264a7);});}})[_0xa24c('0x27')](function(_0x5c0639){return db[_0xa24c('0x77')][_0xa24c('0x28')]({'where':{'CmHopperId':_0x47af80}});})[_0xa24c('0x27')](function(){return _0x518c2a[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})[_0xa24c('0x58')](handleError(_0x518c2a,null));};exports[_0xa24c('0x78')]=function(_0xa32e53,_0x38cc30,_0x32ddc3){var _0x50141e=[];return db[_0xa24c('0x70')][_0xa24c('0x5f')]()[_0xa24c('0x27')](function(_0x5e52f4){_0x50141e=_[_0xa24c('0x5b')](_0x5e52f4);return _0xa32e53[_0xa24c('0x6a')][_0xa24c('0x79')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xa24c('0x7a')},'attributes':['id',_0xa24c('0x7b')],'raw':!![]});})[_0xa24c('0x27')](function(_0xc0f2bc){if(_0xc0f2bc&&_0xc0f2bc[_0xa24c('0x4a')]){return db[_0xa24c('0x7c')]['transaction'](function(_0x4c374d){var _0x361763={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa24c('0x6c'))},'VoiceQueueId':{'$in':_[_0xa24c('0x2e')](_0xc0f2bc,'id')},'$or':[{'UserId':null},{'UserId':_0xa32e53[_0xa24c('0x6a')]['id']}]};var _0x4073c5=[];if(_0xa32e53[_0xa24c('0x5e')]['direction']&&_0xa32e53[_0xa24c('0x5e')][_0xa24c('0x7d')]===_0xa24c('0x7e')){if(!_[_0xa24c('0x7f')](_0xa32e53[_0xa24c('0x5e')][_0xa24c('0x80')])){_0x361763['id']={'$in':_0xa32e53['body'][_0xa24c('0x80')]};}_0x4073c5=[[_0xa24c('0x81'),_0xa24c('0x82')],[_0xa24c('0x83'),_0xc0f2bc[0x0]['dialOrderByScheduledAt']===_0xa24c('0x82')?'DESC':_0xa24c('0x82')],db[_0xa24c('0x7c')][_0xa24c('0x84')](_0xa24c('0x85')),['id','DESC']];}else{if(!_[_0xa24c('0x7f')](_0xa32e53[_0xa24c('0x5e')]['hopperIds'])){_0x361763['id']={'$notIn':_0xa32e53[_0xa24c('0x5e')][_0xa24c('0x80')]};}_0x4073c5=[[_0xa24c('0x81'),_0xa24c('0x86')],[_0xa24c('0x83'),_0xc0f2bc[0x0][_0xa24c('0x7b')]],db[_0xa24c('0x7c')][_0xa24c('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xa24c('0x82')]];}return db[_0xa24c('0x53')][_0xa24c('0x87')]({'attributes':['id',_0xa24c('0x88'),_0xa24c('0x6e')],'where':_0x361763,'order':_0x4073c5,'transaction':_0x4c374d,'lock':_0x4c374d[_0xa24c('0x89')][_0xa24c('0x8a')],'include':[{'model':db[_0xa24c('0x70')],'as':_0xa24c('0x8b'),'attributes':_0x50141e,'include':[{'model':db[_0xa24c('0x8c')],'as':_0xa24c('0x8d'),'attributes':['id','name']}]},{'model':db[_0xa24c('0x8e')],'as':_0xa24c('0x8f'),'attributes':['id','name']},{'model':db[_0xa24c('0x62')],'as':_0xa24c('0x90'),'attributes':['id',_0xa24c('0x2c'),'dialActive']}]})['then'](function(_0xf03c2f){if(_0xf03c2f){return _0xf03c2f[_0xa24c('0x26')]({'UserId':_0xa32e53['user']['id']},{'transaction':_0x4c374d});}});});}})[_0xa24c('0x27')](handleEntityNotFound(_0x38cc30,null))[_0xa24c('0x27')](respondWithResult(_0x38cc30,null))[_0xa24c('0x58')](handleError(_0x38cc30,null));};exports[_0xa24c('0x91')]=function(_0x371c80,_0x336898,_0x5e6e59){return _0x371c80['user']['getVoiceQueues']({'where':{'type':_0xa24c('0x92'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xb3f567){if(_0xb3f567&&_0xb3f567[_0xa24c('0x4a')]){return db[_0xa24c('0x53')][_0xa24c('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa24c('0x93')](_0xa24c('0x6c'))},'VoiceQueueId':{'$in':_[_0xa24c('0x2e')](_0xb3f567,'id')},'$or':[{'UserId':null},{'UserId':_0x371c80[_0xa24c('0x6a')]['id']}]}});}return 0x0;})[_0xa24c('0x27')](function(_0x4ee10d){if(!_[_0xa24c('0x73')](_0x4ee10d)&&_[_0xa24c('0x94')](_0x4ee10d)){return _0x336898[_0xa24c('0x1b')](0xc8)[_0xa24c('0x1d')]({'contacts':_0x4ee10d});}else{logger[_0xa24c('0x2a')](_0xa24c('0x95'),_0xa24c('0x91'),0x194,_0xa24c('0x96'));_0x336898[_0xa24c('0x29')](0x194);}})[_0xa24c('0x58')](handleError(_0x336898,null));};
\ No newline at end of file
index 6a1942f..118db3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['CmHopper','cm_hopper','scheduledat','phone','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define'];(function(_0x21b5bf,_0x5a90bc){var _0x51c0f9=function(_0x47f676){while(--_0x47f676){_0x21b5bf['push'](_0x21b5bf['shift']());}};_0x51c0f9(++_0x5a90bc);}(_0x2bd8,0x130));var _0x82bd=function(_0x3d795c,_0x2cebf4){_0x3d795c=_0x3d795c-0x0;var _0x4e4d1c=_0x2bd8[_0x3d795c];return _0x4e4d1c;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'name':_0x82bd('0xd'),'fields':['scheduledat']},{'name':_0x82bd('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x0295,0x1f0));var _0x5029=function(_0x538cac,_0x581ad1){_0x538cac=_0x538cac-0x0;var _0x554759=_0x0295[_0x538cac];return _0x554759;};'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
index be33a32..95f11bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd25=['MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','LOCK','CmContact','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','options','raw','where','attributes','limit','include','map','model','CmHopper','find','ShowCmHopper','create','CreateCmHopper','update','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','findAll','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xfd25,0x19e));var _0x5fd2=function(_0x2c11b7,_0x10bef7){_0x2c11b7=_0x2c11b7-0x0;var _0x2936f0=_0xfd25[_0x2c11b7];return _0x2936f0;};'use strict';var _=require(_0x5fd2('0x0'));var util=require('util');var moment=require(_0x5fd2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fd2('0x2'));var db=require(_0x5fd2('0x3'))['db'];var utils=require(_0x5fd2('0x4'));var logger=require(_0x5fd2('0x5'))(_0x5fd2('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fd2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22344d,_0x210224,_0x4c168a){return new BPromise(function(_0x52513b,_0xa4b869){return client[_0x5fd2('0x8')](_0x22344d,_0x4c168a)[_0x5fd2('0x9')](function(_0x1ebfde){logger[_0x5fd2('0xa')]('CmHopper,\x20%s,\x20%s',_0x210224,_0x5fd2('0xb'));logger[_0x5fd2('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x210224,_0x5fd2('0xb'),JSON[_0x5fd2('0xd')](_0x1ebfde));if(_0x1ebfde[_0x5fd2('0xe')]){if(_0x1ebfde[_0x5fd2('0xe')]['code']===0x1f4){logger[_0x5fd2('0xe')](_0x5fd2('0xf'),_0x210224,_0x1ebfde[_0x5fd2('0xe')][_0x5fd2('0x10')]);return _0xa4b869(_0x1ebfde[_0x5fd2('0xe')][_0x5fd2('0x10')]);}logger[_0x5fd2('0xe')](_0x5fd2('0xf'),_0x210224,_0x1ebfde[_0x5fd2('0xe')][_0x5fd2('0x10')]);return _0x52513b(_0x1ebfde[_0x5fd2('0xe')][_0x5fd2('0x10')]);}else{logger[_0x5fd2('0xa')](_0x5fd2('0xf'),_0x210224,'request\x20sent');_0x52513b(_0x1ebfde[_0x5fd2('0x11')][_0x5fd2('0x10')]);}})[_0x5fd2('0x12')](function(_0x24a08c){logger[_0x5fd2('0xe')](_0x5fd2('0xf'),_0x210224,_0x24a08c);_0xa4b869(_0x24a08c);});});}exports[_0x5fd2('0x13')]=function(_0x2a278a){var _0x5c481a=this;return new Promise(function(_0x174589,_0x34ba8c){return db['CmHopper']['findAll']({'raw':_0x2a278a[_0x5fd2('0x14')]?_0x2a278a['options'][_0x5fd2('0x15')]===undefined?!![]:![]:!![],'where':_0x2a278a[_0x5fd2('0x14')]?_0x2a278a['options'][_0x5fd2('0x16')]||null:null,'attributes':_0x2a278a['options']?_0x2a278a[_0x5fd2('0x14')][_0x5fd2('0x17')]||null:null,'limit':_0x2a278a['options']?_0x2a278a[_0x5fd2('0x14')][_0x5fd2('0x18')]||null:null,'include':_0x2a278a['options']?_0x2a278a[_0x5fd2('0x14')][_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x2a278a['options'][_0x5fd2('0x19')],function(_0xf31874){return{'model':db[_0xf31874[_0x5fd2('0x1b')]],'as':_0xf31874['as'],'attributes':_0xf31874[_0x5fd2('0x17')],'include':_0xf31874[_0x5fd2('0x19')]?_['map'](_0xf31874[_0x5fd2('0x19')],function(_0x9a3f7d){return{'model':db[_0x9a3f7d[_0x5fd2('0x1b')]],'as':_0x9a3f7d['as'],'attributes':_0x9a3f7d[_0x5fd2('0x17')],'include':_0x9a3f7d[_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x9a3f7d[_0x5fd2('0x19')],function(_0x54a168){return{'model':db[_0x54a168[_0x5fd2('0x1b')]],'as':_0x54a168['as'],'attributes':_0x54a168[_0x5fd2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5fd2('0x9')](function(_0xe72036){logger[_0x5fd2('0xa')](_0x5fd2('0x13'),_0x2a278a);logger[_0x5fd2('0xc')](_0x5fd2('0x13'),_0x2a278a,JSON[_0x5fd2('0xd')](_0xe72036));_0x174589(_0xe72036);})[_0x5fd2('0x12')](function(_0x430a5b){logger[_0x5fd2('0xe')](_0x5fd2('0x13'),_0x430a5b[_0x5fd2('0x10')],_0x2a278a);_0x34ba8c(_0x5c481a[_0x5fd2('0xe')](0x1f4,_0x430a5b['message']));});});};exports['ShowCmHopper']=function(_0x15cf9f){var _0x453aec=this;return new Promise(function(_0xbd8768,_0x550ba7){return db[_0x5fd2('0x1c')][_0x5fd2('0x1d')]({'raw':_0x15cf9f[_0x5fd2('0x14')]?_0x15cf9f['options'][_0x5fd2('0x15')]===undefined?!![]:![]:!![],'where':_0x15cf9f['options']?_0x15cf9f['options']['where']||null:null,'attributes':_0x15cf9f[_0x5fd2('0x14')]?_0x15cf9f['options'][_0x5fd2('0x17')]||null:null,'include':_0x15cf9f['options']?_0x15cf9f[_0x5fd2('0x14')]['include']?_[_0x5fd2('0x1a')](_0x15cf9f[_0x5fd2('0x14')][_0x5fd2('0x19')],function(_0x3f2888){return{'model':db[_0x3f2888['model']],'as':_0x3f2888['as'],'attributes':_0x3f2888['attributes'],'include':_0x3f2888[_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x3f2888[_0x5fd2('0x19')],function(_0x2ab24b){return{'model':db[_0x2ab24b[_0x5fd2('0x1b')]],'as':_0x2ab24b['as'],'attributes':_0x2ab24b[_0x5fd2('0x17')],'include':_0x2ab24b['include']?_[_0x5fd2('0x1a')](_0x2ab24b['include'],function(_0x161391){return{'model':db[_0x161391[_0x5fd2('0x1b')]],'as':_0x161391['as'],'attributes':_0x161391[_0x5fd2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5fd2('0x9')](function(_0x2b2a49){logger[_0x5fd2('0xa')](_0x5fd2('0x1e'),_0x15cf9f);logger['debug'](_0x5fd2('0x1e'),_0x15cf9f,JSON[_0x5fd2('0xd')](_0x2b2a49));_0xbd8768(_0x2b2a49);})[_0x5fd2('0x12')](function(_0x2bc5b0){logger[_0x5fd2('0xe')](_0x5fd2('0x1e'),_0x2bc5b0['message'],_0x15cf9f);_0x550ba7(_0x453aec[_0x5fd2('0xe')](0x1f4,_0x2bc5b0[_0x5fd2('0x10')]));});});};exports['CreateCmHopper']=function(_0x123733){var _0x161840=this;return new Promise(function(_0x286e7c,_0x5c66a5){return db[_0x5fd2('0x1c')][_0x5fd2('0x1f')](_0x123733['body'],{'raw':_0x123733[_0x5fd2('0x14')]?_0x123733['options'][_0x5fd2('0x15')]===undefined?!![]:![]:!![]})[_0x5fd2('0x9')](function(_0x1bed19){logger['info'](_0x5fd2('0x20'),_0x123733);logger['debug']('CreateCmHopper',_0x123733,JSON[_0x5fd2('0xd')](_0x1bed19));_0x286e7c(_0x1bed19);})['catch'](function(_0x47316e){logger[_0x5fd2('0xe')](_0x5fd2('0x20'),_0x47316e[_0x5fd2('0x10')],_0x123733);_0x5c66a5(_0x161840['error'](0x1f4,_0x47316e[_0x5fd2('0x10')]));});});};exports['UpdateCmHopper']=function(_0x2e18a0){var _0x566c2a=this;return new Promise(function(_0x2649fa,_0x42e87b){return db[_0x5fd2('0x1c')][_0x5fd2('0x21')](_0x2e18a0[_0x5fd2('0x22')],{'raw':_0x2e18a0[_0x5fd2('0x14')]?_0x2e18a0['options'][_0x5fd2('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e18a0['options']?_0x2e18a0[_0x5fd2('0x14')][_0x5fd2('0x16')]||null:null,'attributes':_0x2e18a0[_0x5fd2('0x14')]?_0x2e18a0['options']['attributes']||null:null,'limit':_0x2e18a0[_0x5fd2('0x14')]?_0x2e18a0['options']['limit']||null:null})['then'](function(_0x27f499){logger[_0x5fd2('0xa')](_0x5fd2('0x23'),_0x2e18a0);logger[_0x5fd2('0xc')](_0x5fd2('0x23'),_0x2e18a0,JSON[_0x5fd2('0xd')](_0x27f499));_0x2649fa(_0x27f499);})[_0x5fd2('0x12')](function(_0xa8c72b){logger['error'](_0x5fd2('0x23'),_0xa8c72b['message'],_0x2e18a0);_0x42e87b(_0x566c2a['error'](0x1f4,_0xa8c72b[_0x5fd2('0x10')]));});});};exports[_0x5fd2('0x24')]=function(_0x244cb8){var _0x5e9056=this;return new Promise(function(_0x3b061f,_0x18b682){return db['CmHopper'][_0x5fd2('0x25')]({'where':_0x244cb8[_0x5fd2('0x14')]?_0x244cb8['options'][_0x5fd2('0x16')]||null:null})[_0x5fd2('0x9')](function(_0x5214a3){logger[_0x5fd2('0xa')](_0x5fd2('0x24'),_0x244cb8);logger[_0x5fd2('0xc')](_0x5fd2('0x24'),_0x244cb8,JSON[_0x5fd2('0xd')](_0x5214a3));_0x3b061f(_0x5214a3);})['catch'](function(_0x46800e){logger['error'](_0x5fd2('0x24'),_0x46800e[_0x5fd2('0x10')],_0x244cb8);_0x18b682(_0x5e9056[_0x5fd2('0xe')](0x1f4,_0x46800e['message']));});});};exports[_0x5fd2('0x26')]=function(_0x171ed3){var _0x589d35=this;return new Promise(function(_0x5e7970,_0x479ad7){return db['CmContact'][_0x5fd2('0x27')]()['then'](function(_0x2e57bb){return db[_0x5fd2('0x28')][_0x5fd2('0x29')](function(_0x13d803){return db[_0x5fd2('0x1c')][_0x5fd2('0x2a')]({'where':_0x171ed3[_0x5fd2('0x14')]?_0x171ed3[_0x5fd2('0x14')]['where']||null:null,'attributes':_0x171ed3[_0x5fd2('0x14')]?_0x171ed3[_0x5fd2('0x14')]['attributes']||null:null,'limit':_0x171ed3[_0x5fd2('0x14')]?_0x171ed3['options'][_0x5fd2('0x18')]||null:null,'order':_0x171ed3['options']?_0x171ed3['options']['order']||null:null,'transaction':_0x13d803,'lock':_0x13d803['LOCK'][_0x5fd2('0x2b')],'include':[{'model':db['CmContact'],'as':_0x5fd2('0x2c'),'attributes':_[_0x5fd2('0x2d')](_0x2e57bb)},{'model':db[_0x5fd2('0x2e')],'as':_0x5fd2('0x2f'),'attributes':['id',_0x5fd2('0x30'),_0x5fd2('0x31')]}]})[_0x5fd2('0x9')](function(_0x4bf3bd){var _0x363046=[];var _0x4e71b6=[];for(var _0x2d08b5=0x0;_0x2d08b5<_0x4bf3bd[_0x5fd2('0x32')];_0x2d08b5+=0x1){var _0x4dbea8=_0x4bf3bd[_0x2d08b5][_0x5fd2('0x33')];if(_0x4dbea8===null){_0x363046[_0x5fd2('0x34')](_0x4bf3bd[_0x2d08b5][_0x5fd2('0x21')](_0x171ed3['body'],{'transaction':_0x13d803}));}else if(!_0x4e71b6[_0x5fd2('0x35')](_0x4dbea8)){_0x4e71b6['push'](_0x4dbea8);_0x363046[_0x5fd2('0x34')](_0x4bf3bd[_0x2d08b5][_0x5fd2('0x21')](_0x171ed3[_0x5fd2('0x22')],{'transaction':_0x13d803}));}}return BPromise[_0x5fd2('0x36')](_0x363046);});})[_0x5fd2('0x9')](function(_0x5ba6b5){logger[_0x5fd2('0xa')](_0x5fd2('0x26'),_0x171ed3);logger[_0x5fd2('0xc')](_0x5fd2('0x26'),_0x171ed3,JSON['stringify'](_0x5ba6b5));_0x5e7970(_0x5ba6b5);})[_0x5fd2('0x12')](function(_0x45ad10){logger[_0x5fd2('0xe')](_0x5fd2('0x26'),_0x45ad10[_0x5fd2('0x10')],_0x171ed3);_0x479ad7(_0x589d35['error'](0x1f4,_0x45ad10[_0x5fd2('0x10')]));});});});};exports[_0x5fd2('0x37')]=function(_0xf38d8e){var _0x546493=this;return new Promise(function(_0x3a9314,_0x2d3200){return db[_0x5fd2('0x28')]['transaction'](function(_0x35f8fc){return db[_0x5fd2('0x38')][_0x5fd2('0x1f')](_0xf38d8e[_0x5fd2('0x22')],{'raw':_0xf38d8e['options']?_0xf38d8e[_0x5fd2('0x14')][_0x5fd2('0x15')]===undefined?!![]:![]:!![],'transaction':_0x35f8fc})[_0x5fd2('0x9')](function(){return db['CmHopper'][_0x5fd2('0x25')]({'where':_0xf38d8e[_0x5fd2('0x14')]?_0xf38d8e[_0x5fd2('0x14')][_0x5fd2('0x16')]||null:null,'transaction':_0x35f8fc});});})[_0x5fd2('0x9')](function(_0x1f505d){logger[_0x5fd2('0xa')](_0x5fd2('0x37'),_0xf38d8e);logger[_0x5fd2('0xc')](_0x5fd2('0x37'),_0xf38d8e,JSON['stringify'](_0x1f505d));_0x3a9314(_0x1f505d);})[_0x5fd2('0x12')](function(_0x2f0f00){logger[_0x5fd2('0xe')](_0x5fd2('0x37'),_0x2f0f00[_0x5fd2('0x10')],_0xf38d8e);_0x2d3200(_0x546493[_0x5fd2('0xe')](0x1f4,_0x2f0f00['message']));});});};exports[_0x5fd2('0x39')]=function(_0x6a4883){var _0x43ffc6=this;return new Promise(function(_0x1d822d,_0x544f23){return db['CmHopper'][_0x5fd2('0x2a')]({'raw':_0x6a4883[_0x5fd2('0x14')]?_0x6a4883[_0x5fd2('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x6a4883['options']?_0x6a4883[_0x5fd2('0x14')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x5fd2('0x28')]['fn']('IF',db[_0x5fd2('0x28')][_0x5fd2('0x3a')]('`scheduledat`\x20>=\x20'+util[_0x5fd2('0x3b')]('\x22%s\x22',moment()[_0x5fd2('0x3b')](_0x5fd2('0x3c')))+_0x5fd2('0x3d')))),_0x5fd2('0x3e')]]})[_0x5fd2('0x9')](function(_0x1115af){logger[_0x5fd2('0xa')]('CountReScheduled',_0x6a4883);logger[_0x5fd2('0xc')](_0x5fd2('0x39'),_0x6a4883,JSON[_0x5fd2('0xd')](_0x1115af));_0x1d822d(_0x1115af);})[_0x5fd2('0x12')](function(_0x1d5442){logger[_0x5fd2('0xe')](_0x5fd2('0x39'),_0x1d5442['message'],_0x6a4883);_0x544f23(_0x43ffc6['error'](0x1f4,_0x1d5442[_0x5fd2('0x10')]));});});};exports[_0x5fd2('0x3f')]=function(_0x584ab5){var _0x53a02d=this;return new Promise(function(_0x27c398,_0x389fe5){return db['CmContact'][_0x5fd2('0x27')]()['then'](function(_0x2cb4fb){return db['sequelize'][_0x5fd2('0x29')](function(_0x2a9a7b){return db[_0x5fd2('0x1c')][_0x5fd2('0x2a')]({'where':_0x584ab5[_0x5fd2('0x14')]?_0x584ab5[_0x5fd2('0x14')][_0x5fd2('0x16')]||null:null,'attributes':_0x584ab5[_0x5fd2('0x14')]?_0x584ab5['options'][_0x5fd2('0x17')]||null:null,'limit':0x1,'order':_0x584ab5[_0x5fd2('0x14')]?_0x584ab5[_0x5fd2('0x14')][_0x5fd2('0x40')]||null:null,'group':db['CmHopper'][_0x5fd2('0x33')],'transaction':_0x2a9a7b,'lock':_0x2a9a7b[_0x5fd2('0x41')]['UPDATE'],'include':_0x584ab5[_0x5fd2('0x14')]?_0x584ab5[_0x5fd2('0x14')][_0x5fd2('0x19')]?_['map'](_0x584ab5[_0x5fd2('0x14')][_0x5fd2('0x19')],function(_0x370b5a){return{'model':db[_0x370b5a[_0x5fd2('0x1b')]],'as':_0x370b5a['as'],'attributes':_0x370b5a[_0x5fd2('0x17')],'include':_0x370b5a[_0x5fd2('0x19')]?_['map'](_0x370b5a[_0x5fd2('0x19')],function(_0x4f2d62){return{'model':db[_0x4f2d62[_0x5fd2('0x1b')]],'as':_0x4f2d62['as'],'attributes':_0x4f2d62[_0x5fd2('0x17')],'include':_0x4f2d62[_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x4f2d62[_0x5fd2('0x19')],function(_0x171d97){return{'model':db[_0x171d97[_0x5fd2('0x1b')]],'as':_0x171d97['as'],'attributes':_0x171d97[_0x5fd2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5fd2('0x9')](function(_0x110f8f){var _0x3ace15=[];for(var _0x51bba1=0x0;_0x51bba1<_0x110f8f[_0x5fd2('0x32')];_0x51bba1+=0x1){_0x3ace15[_0x5fd2('0x34')](_0x110f8f[_0x51bba1][_0x5fd2('0x21')](_0x584ab5[_0x5fd2('0x22')],{'transaction':_0x2a9a7b}));}return BPromise[_0x5fd2('0x36')](_0x3ace15);});})[_0x5fd2('0x9')](function(_0x555a03){logger[_0x5fd2('0xa')]('GetContactRecallMe',_0x584ab5);logger['debug'](_0x5fd2('0x3f'),_0x584ab5,JSON['stringify'](_0x555a03));_0x27c398(_0x555a03);})['catch'](function(_0x54ccdd){logger['error']('GetContactRecallMe',_0x54ccdd[_0x5fd2('0x10')],_0x584ab5);_0x389fe5(_0x53a02d[_0x5fd2('0xe')](0x1f4,_0x54ccdd['message']));});});});};exports['GetCmHopperPreview']=function(_0x58f708){var _0x2ef4c1=this;return new Promise(function(_0x39326f,_0x21eb41){db[_0x5fd2('0x42')]['describe']()[_0x5fd2('0x9')](function(_0xba3841){return db[_0x5fd2('0x1c')][_0x5fd2('0x2a')]({'raw':_0x58f708[_0x5fd2('0x14')]?_0x58f708[_0x5fd2('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x58f708[_0x5fd2('0x14')]?_0x58f708[_0x5fd2('0x14')][_0x5fd2('0x16')]||null:null,'attributes':_0x58f708[_0x5fd2('0x14')]?_0x58f708[_0x5fd2('0x14')][_0x5fd2('0x17')]||null:null,'limit':_0x58f708[_0x5fd2('0x14')]?_0x58f708['options']['limit']||null:null,'include':_0x58f708[_0x5fd2('0x14')]?_0x58f708[_0x5fd2('0x14')][_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x58f708[_0x5fd2('0x14')]['include'],function(_0x3a4626){return{'model':db[_0x3a4626[_0x5fd2('0x1b')]],'as':_0x3a4626['as'],'attributes':_0x3a4626['as']===_0x5fd2('0x2c')?_[_0x5fd2('0x2d')](_0xba3841):_0x3a4626['attributes'],'include':_0x3a4626[_0x5fd2('0x19')]?_[_0x5fd2('0x1a')](_0x3a4626[_0x5fd2('0x19')],function(_0x3484cb){return{'model':db[_0x3484cb['model']],'as':_0x3484cb['as'],'attributes':_0x3484cb['attributes'],'include':_0x3484cb[_0x5fd2('0x19')]?_['map'](_0x3484cb['include'],function(_0x17bb20){return{'model':db[_0x17bb20[_0x5fd2('0x1b')]],'as':_0x17bb20['as'],'attributes':_0x17bb20[_0x5fd2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5fd2('0x9')](function(_0x1b7a35){logger[_0x5fd2('0xa')]('GetCmHopper',_0x58f708);logger[_0x5fd2('0xc')](_0x5fd2('0x13'),_0x58f708,JSON[_0x5fd2('0xd')](_0x1b7a35));_0x39326f(_0x1b7a35);})['catch'](function(_0x488319){logger[_0x5fd2('0xe')](_0x5fd2('0x13'),_0x488319[_0x5fd2('0x10')],_0x58f708);_0x21eb41(_0x2ef4c1[_0x5fd2('0xe')](0x1f4,_0x488319[_0x5fd2('0x10')]));});});});};
\ No newline at end of file
+var _0x676e=['find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','describe','order','LOCK','CmContact','Contact','User','Agent','name','voicePause','length','push','update','all','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','keys','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','debug'];(function(_0x4ac184,_0x2f40d6){var _0x4a2485=function(_0x216211){while(--_0x216211){_0x4ac184['push'](_0x4ac184['shift']());}};_0x4a2485(++_0x2f40d6);}(_0x676e,0x107));var _0xe676=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x676e[_0x1488cd];return _0x63fa13;};'use strict';var _=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));var moment=require(_0xe676('0x2'));var BPromise=require(_0xe676('0x3'));var rs=require(_0xe676('0x4'));var fs=require('fs');var Redis=require(_0xe676('0x5'));var db=require(_0xe676('0x6'))['db'];var utils=require(_0xe676('0x7'));var logger=require(_0xe676('0x8'))(_0xe676('0x9'));var config=require(_0xe676('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe676('0xb')][_0xe676('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e1252,_0xde73db,_0x5a412f){return new BPromise(function(_0x1a06c9,_0x57fd42){return client[_0xe676('0xd')](_0x5e1252,_0x5a412f)[_0xe676('0xe')](function(_0x5d5131){logger[_0xe676('0xf')](_0xe676('0x10'),_0xde73db,'request\x20sent');logger['debug'](_0xe676('0x11'),_0xde73db,'request\x20sent',JSON[_0xe676('0x12')](_0x5d5131));if(_0x5d5131['error']){if(_0x5d5131['error'][_0xe676('0x13')]===0x1f4){logger[_0xe676('0x14')]('CmHopper,\x20%s,\x20%s',_0xde73db,_0x5d5131[_0xe676('0x14')][_0xe676('0x15')]);return _0x57fd42(_0x5d5131[_0xe676('0x14')]['message']);}logger['error'](_0xe676('0x10'),_0xde73db,_0x5d5131[_0xe676('0x14')][_0xe676('0x15')]);return _0x1a06c9(_0x5d5131['error'][_0xe676('0x15')]);}else{logger[_0xe676('0xf')]('CmHopper,\x20%s,\x20%s',_0xde73db,_0xe676('0x16'));_0x1a06c9(_0x5d5131[_0xe676('0x17')][_0xe676('0x15')]);}})[_0xe676('0x18')](function(_0x353f7f){logger[_0xe676('0x14')]('CmHopper,\x20%s,\x20%s',_0xde73db,_0x353f7f);_0x57fd42(_0x353f7f);});});}exports[_0xe676('0x19')]=function(_0xe17e57){var _0xf387f4=this;return new Promise(function(_0x15e54d,_0x32c004){return db[_0xe676('0x1a')][_0xe676('0x1b')]({'raw':_0xe17e57[_0xe676('0x1c')]?_0xe17e57[_0xe676('0x1c')][_0xe676('0x1d')]===undefined?!![]:![]:!![],'where':_0xe17e57[_0xe676('0x1c')]?_0xe17e57[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':_0xe17e57[_0xe676('0x1c')]?_0xe17e57[_0xe676('0x1c')]['attributes']||null:null,'limit':_0xe17e57[_0xe676('0x1c')]?_0xe17e57[_0xe676('0x1c')][_0xe676('0x1f')]||null:null,'include':_0xe17e57[_0xe676('0x1c')]?_0xe17e57[_0xe676('0x1c')][_0xe676('0x20')]?_[_0xe676('0x21')](_0xe17e57[_0xe676('0x1c')][_0xe676('0x20')],function(_0x295529){return{'model':db[_0x295529[_0xe676('0x22')]],'as':_0x295529['as'],'attributes':_0x295529['attributes'],'include':_0x295529[_0xe676('0x20')]?_['map'](_0x295529[_0xe676('0x20')],function(_0x255291){return{'model':db[_0x255291[_0xe676('0x22')]],'as':_0x255291['as'],'attributes':_0x255291[_0xe676('0x23')],'include':_0x255291[_0xe676('0x20')]?_[_0xe676('0x21')](_0x255291['include'],function(_0x1404c3){return{'model':db[_0x1404c3[_0xe676('0x22')]],'as':_0x1404c3['as'],'attributes':_0x1404c3[_0xe676('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe676('0xe')](function(_0x17ced0){logger[_0xe676('0xf')](_0xe676('0x19'),_0xe17e57);logger[_0xe676('0x24')](_0xe676('0x19'),_0xe17e57,JSON[_0xe676('0x12')](_0x17ced0));_0x15e54d(_0x17ced0);})[_0xe676('0x18')](function(_0x5c37d7){logger[_0xe676('0x14')]('GetCmHopper',_0x5c37d7[_0xe676('0x15')],_0xe17e57);_0x32c004(_0xf387f4[_0xe676('0x14')](0x1f4,_0x5c37d7[_0xe676('0x15')]));});});};exports['ShowCmHopper']=function(_0x3af730){var _0x310a03=this;return new Promise(function(_0x4a2adf,_0x408d6c){return db[_0xe676('0x1a')][_0xe676('0x25')]({'raw':_0x3af730[_0xe676('0x1c')]?_0x3af730[_0xe676('0x1c')][_0xe676('0x1d')]===undefined?!![]:![]:!![],'where':_0x3af730[_0xe676('0x1c')]?_0x3af730[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':_0x3af730[_0xe676('0x1c')]?_0x3af730[_0xe676('0x1c')][_0xe676('0x23')]||null:null,'include':_0x3af730[_0xe676('0x1c')]?_0x3af730[_0xe676('0x1c')][_0xe676('0x20')]?_['map'](_0x3af730[_0xe676('0x1c')]['include'],function(_0x45e41e){return{'model':db[_0x45e41e[_0xe676('0x22')]],'as':_0x45e41e['as'],'attributes':_0x45e41e['attributes'],'include':_0x45e41e[_0xe676('0x20')]?_['map'](_0x45e41e[_0xe676('0x20')],function(_0x1fec17){return{'model':db[_0x1fec17['model']],'as':_0x1fec17['as'],'attributes':_0x1fec17['attributes'],'include':_0x1fec17[_0xe676('0x20')]?_[_0xe676('0x21')](_0x1fec17[_0xe676('0x20')],function(_0x231736){return{'model':db[_0x231736[_0xe676('0x22')]],'as':_0x231736['as'],'attributes':_0x231736[_0xe676('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe676('0xe')](function(_0xcd53fd){logger['info'](_0xe676('0x26'),_0x3af730);logger[_0xe676('0x24')](_0xe676('0x26'),_0x3af730,JSON[_0xe676('0x12')](_0xcd53fd));_0x4a2adf(_0xcd53fd);})[_0xe676('0x18')](function(_0x104ed5){logger[_0xe676('0x14')](_0xe676('0x26'),_0x104ed5[_0xe676('0x15')],_0x3af730);_0x408d6c(_0x310a03['error'](0x1f4,_0x104ed5[_0xe676('0x15')]));});});};exports[_0xe676('0x27')]=function(_0x45fb70){var _0x18216f=this;return new Promise(function(_0x4c1e05,_0x1da576){return db[_0xe676('0x1a')][_0xe676('0x28')](_0x45fb70[_0xe676('0x29')],{'raw':_0x45fb70[_0xe676('0x1c')]?_0x45fb70[_0xe676('0x1c')][_0xe676('0x1d')]===undefined?!![]:![]:!![]})[_0xe676('0xe')](function(_0x4c5a5a){logger['info'](_0xe676('0x27'),_0x45fb70);logger[_0xe676('0x24')]('CreateCmHopper',_0x45fb70,JSON[_0xe676('0x12')](_0x4c5a5a));_0x4c1e05(_0x4c5a5a);})[_0xe676('0x18')](function(_0x4bf7a0){logger[_0xe676('0x14')]('CreateCmHopper',_0x4bf7a0[_0xe676('0x15')],_0x45fb70);_0x1da576(_0x18216f[_0xe676('0x14')](0x1f4,_0x4bf7a0[_0xe676('0x15')]));});});};exports[_0xe676('0x2a')]=function(_0x49877a){var _0x3a3a97=this;return new Promise(function(_0x2f89b7,_0x46487f){return db[_0xe676('0x1a')]['update'](_0x49877a['body'],{'raw':_0x49877a[_0xe676('0x1c')]?_0x49877a[_0xe676('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49877a[_0xe676('0x1c')]?_0x49877a[_0xe676('0x1c')]['where']||null:null,'attributes':_0x49877a[_0xe676('0x1c')]?_0x49877a[_0xe676('0x1c')]['attributes']||null:null,'limit':_0x49877a[_0xe676('0x1c')]?_0x49877a['options']['limit']||null:null})[_0xe676('0xe')](function(_0x1bb3d6){logger[_0xe676('0xf')](_0xe676('0x2a'),_0x49877a);logger['debug'](_0xe676('0x2a'),_0x49877a,JSON[_0xe676('0x12')](_0x1bb3d6));_0x2f89b7(_0x1bb3d6);})[_0xe676('0x18')](function(_0x532c3c){logger[_0xe676('0x14')]('UpdateCmHopper',_0x532c3c['message'],_0x49877a);_0x46487f(_0x3a3a97[_0xe676('0x14')](0x1f4,_0x532c3c[_0xe676('0x15')]));});});};exports['DestroyCmHopper']=function(_0x203eb2){var _0x1ca7b5=this;return new Promise(function(_0xda6cbf,_0x2c6725){return db[_0xe676('0x1a')][_0xe676('0x2b')]({'where':_0x203eb2[_0xe676('0x1c')]?_0x203eb2[_0xe676('0x1c')][_0xe676('0x1e')]||null:null})[_0xe676('0xe')](function(_0x4b03b7){logger[_0xe676('0xf')](_0xe676('0x2c'),_0x203eb2);logger['debug']('DestroyCmHopper',_0x203eb2,JSON[_0xe676('0x12')](_0x4b03b7));_0xda6cbf(_0x4b03b7);})[_0xe676('0x18')](function(_0x14359c){logger['error'](_0xe676('0x2c'),_0x14359c[_0xe676('0x15')],_0x203eb2);_0x2c6725(_0x1ca7b5[_0xe676('0x14')](0x1f4,_0x14359c[_0xe676('0x15')]));});});};exports[_0xe676('0x2d')]=function(_0x1c1383){var _0x17dd07=this;return new Promise(function(_0x512166,_0x2e566b){return db['CmContact'][_0xe676('0x2e')]()[_0xe676('0xe')](function(_0x4410e3){return db['sequelize']['transaction'](function(_0x3184c8){return db[_0xe676('0x1a')][_0xe676('0x1b')]({'where':_0x1c1383['options']?_0x1c1383[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':_0x1c1383[_0xe676('0x1c')]?_0x1c1383[_0xe676('0x1c')][_0xe676('0x23')]||null:null,'limit':_0x1c1383['options']?_0x1c1383[_0xe676('0x1c')][_0xe676('0x1f')]||null:null,'order':_0x1c1383[_0xe676('0x1c')]?_0x1c1383[_0xe676('0x1c')][_0xe676('0x2f')]||null:null,'transaction':_0x3184c8,'lock':_0x3184c8[_0xe676('0x30')]['UPDATE'],'include':[{'model':db[_0xe676('0x31')],'as':_0xe676('0x32'),'attributes':_['keys'](_0x4410e3)},{'model':db[_0xe676('0x33')],'as':_0xe676('0x34'),'attributes':['id',_0xe676('0x35'),_0xe676('0x36')]}]})[_0xe676('0xe')](function(_0x177051){var _0x10840c=[];var _0x57cc48=[];for(var _0x5a35ac=0x0;_0x5a35ac<_0x177051[_0xe676('0x37')];_0x5a35ac+=0x1){var _0x49d8ab=_0x177051[_0x5a35ac]['UserId'];if(_0x49d8ab===null){_0x10840c[_0xe676('0x38')](_0x177051[_0x5a35ac][_0xe676('0x39')](_0x1c1383[_0xe676('0x29')],{'transaction':_0x3184c8}));}else if(!_0x57cc48['includes'](_0x49d8ab)){_0x57cc48[_0xe676('0x38')](_0x49d8ab);_0x10840c[_0xe676('0x38')](_0x177051[_0x5a35ac][_0xe676('0x39')](_0x1c1383['body'],{'transaction':_0x3184c8}));}}return BPromise[_0xe676('0x3a')](_0x10840c);});})[_0xe676('0xe')](function(_0x350bf0){logger[_0xe676('0xf')](_0xe676('0x2d'),_0x1c1383);logger[_0xe676('0x24')](_0xe676('0x2d'),_0x1c1383,JSON[_0xe676('0x12')](_0x350bf0));_0x512166(_0x350bf0);})[_0xe676('0x18')](function(_0x4b5b48){logger[_0xe676('0x14')]('GetContactDialer',_0x4b5b48[_0xe676('0x15')],_0x1c1383);_0x2e566b(_0x17dd07[_0xe676('0x14')](0x1f4,_0x4b5b48[_0xe676('0x15')]));});});});};exports[_0xe676('0x3b')]=function(_0x415101){var _0x4902f9=this;return new Promise(function(_0x206e50,_0x1ca6c7){return db[_0xe676('0x3c')][_0xe676('0x3d')](function(_0x450e68){return db[_0xe676('0x3e')][_0xe676('0x28')](_0x415101['body'],{'raw':_0x415101[_0xe676('0x1c')]?_0x415101['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x450e68})[_0xe676('0xe')](function(){return db['CmHopper']['destroy']({'where':_0x415101[_0xe676('0x1c')]?_0x415101['options'][_0xe676('0x1e')]||null:null,'transaction':_0x450e68});});})['then'](function(_0xf0044a){logger['info'](_0xe676('0x3b'),_0x415101);logger[_0xe676('0x24')]('MoveContactManagedDialer',_0x415101,JSON[_0xe676('0x12')](_0xf0044a));_0x206e50(_0xf0044a);})[_0xe676('0x18')](function(_0x28fab2){logger[_0xe676('0x14')](_0xe676('0x3b'),_0x28fab2['message'],_0x415101);_0x1ca6c7(_0x4902f9[_0xe676('0x14')](0x1f4,_0x28fab2['message']));});});};exports[_0xe676('0x3f')]=function(_0x4886dc){var _0x2de0b2=this;return new Promise(function(_0x177677,_0x174b9c){return db[_0xe676('0x1a')][_0xe676('0x1b')]({'raw':_0x4886dc[_0xe676('0x1c')]?_0x4886dc['options']['raw']===undefined?!![]:![]:!![],'where':_0x4886dc[_0xe676('0x1c')]?_0x4886dc[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':[[db[_0xe676('0x3c')]['fn'](_0xe676('0x40'),db[_0xe676('0x3c')]['fn']('IF',db[_0xe676('0x3c')][_0xe676('0x41')]('`scheduledat`\x20>=\x20'+util[_0xe676('0x42')](_0xe676('0x43'),moment()[_0xe676('0x42')](_0xe676('0x44')))+_0xe676('0x45')))),'contactsRescheduled']]})[_0xe676('0xe')](function(_0x2362d9){logger[_0xe676('0xf')](_0xe676('0x3f'),_0x4886dc);logger[_0xe676('0x24')](_0xe676('0x3f'),_0x4886dc,JSON[_0xe676('0x12')](_0x2362d9));_0x177677(_0x2362d9);})['catch'](function(_0x3ed64f){logger[_0xe676('0x14')](_0xe676('0x3f'),_0x3ed64f[_0xe676('0x15')],_0x4886dc);_0x174b9c(_0x2de0b2[_0xe676('0x14')](0x1f4,_0x3ed64f['message']));});});};exports[_0xe676('0x46')]=function(_0x1a27ad){var _0x160597=this;return new Promise(function(_0x5777ae,_0x292ce3){return db[_0xe676('0x31')][_0xe676('0x2e')]()['then'](function(_0x1613ab){return db[_0xe676('0x3c')][_0xe676('0x3d')](function(_0x1788df){return db[_0xe676('0x1a')]['findAll']({'where':_0x1a27ad[_0xe676('0x1c')]?_0x1a27ad[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':_0x1a27ad[_0xe676('0x1c')]?_0x1a27ad[_0xe676('0x1c')][_0xe676('0x23')]||null:null,'limit':0x1,'order':_0x1a27ad['options']?_0x1a27ad[_0xe676('0x1c')][_0xe676('0x2f')]||null:null,'group':db[_0xe676('0x1a')][_0xe676('0x47')],'transaction':_0x1788df,'lock':_0x1788df['LOCK'][_0xe676('0x48')],'include':_0x1a27ad['options']?_0x1a27ad[_0xe676('0x1c')]['include']?_['map'](_0x1a27ad['options'][_0xe676('0x20')],function(_0x2e76ff){return{'model':db[_0x2e76ff[_0xe676('0x22')]],'as':_0x2e76ff['as'],'attributes':_0x2e76ff[_0xe676('0x23')],'include':_0x2e76ff[_0xe676('0x20')]?_[_0xe676('0x21')](_0x2e76ff[_0xe676('0x20')],function(_0x267a7a){return{'model':db[_0x267a7a[_0xe676('0x22')]],'as':_0x267a7a['as'],'attributes':_0x267a7a[_0xe676('0x23')],'include':_0x267a7a[_0xe676('0x20')]?_[_0xe676('0x21')](_0x267a7a[_0xe676('0x20')],function(_0x48bae5){return{'model':db[_0x48bae5['model']],'as':_0x48bae5['as'],'attributes':_0x48bae5[_0xe676('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe676('0xe')](function(_0x33d278){var _0x4be0f6=[];for(var _0x4fb63d=0x0;_0x4fb63d<_0x33d278[_0xe676('0x37')];_0x4fb63d+=0x1){_0x4be0f6['push'](_0x33d278[_0x4fb63d][_0xe676('0x39')](_0x1a27ad['body'],{'transaction':_0x1788df}));}return BPromise['all'](_0x4be0f6);});})['then'](function(_0xc90638){logger['info'](_0xe676('0x46'),_0x1a27ad);logger['debug'](_0xe676('0x46'),_0x1a27ad,JSON[_0xe676('0x12')](_0xc90638));_0x5777ae(_0xc90638);})[_0xe676('0x18')](function(_0x3cf2b9){logger['error'](_0xe676('0x46'),_0x3cf2b9['message'],_0x1a27ad);_0x292ce3(_0x160597[_0xe676('0x14')](0x1f4,_0x3cf2b9[_0xe676('0x15')]));});});});};exports[_0xe676('0x49')]=function(_0x4421df){var _0x10bc75=this;return new Promise(function(_0x1340f2,_0x29d52c){db[_0xe676('0x31')][_0xe676('0x2e')]()['then'](function(_0x3ea0b1){return db['CmHopper'][_0xe676('0x1b')]({'raw':_0x4421df[_0xe676('0x1c')]?_0x4421df[_0xe676('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4421df[_0xe676('0x1c')]?_0x4421df[_0xe676('0x1c')][_0xe676('0x1e')]||null:null,'attributes':_0x4421df['options']?_0x4421df['options'][_0xe676('0x23')]||null:null,'limit':_0x4421df[_0xe676('0x1c')]?_0x4421df[_0xe676('0x1c')][_0xe676('0x1f')]||null:null,'include':_0x4421df[_0xe676('0x1c')]?_0x4421df[_0xe676('0x1c')]['include']?_[_0xe676('0x21')](_0x4421df[_0xe676('0x1c')][_0xe676('0x20')],function(_0x484938){return{'model':db[_0x484938[_0xe676('0x22')]],'as':_0x484938['as'],'attributes':_0x484938['as']==='Contact'?_[_0xe676('0x4a')](_0x3ea0b1):_0x484938['attributes'],'include':_0x484938[_0xe676('0x20')]?_[_0xe676('0x21')](_0x484938['include'],function(_0x247312){return{'model':db[_0x247312[_0xe676('0x22')]],'as':_0x247312['as'],'attributes':_0x247312[_0xe676('0x23')],'include':_0x247312[_0xe676('0x20')]?_['map'](_0x247312['include'],function(_0x579acf){return{'model':db[_0x579acf[_0xe676('0x22')]],'as':_0x579acf['as'],'attributes':_0x579acf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x382cd6){logger[_0xe676('0xf')](_0xe676('0x19'),_0x4421df);logger[_0xe676('0x24')](_0xe676('0x19'),_0x4421df,JSON[_0xe676('0x12')](_0x382cd6));_0x1340f2(_0x382cd6);})[_0xe676('0x18')](function(_0x1a1bdf){logger[_0xe676('0x14')](_0xe676('0x19'),_0x1a1bdf[_0xe676('0x15')],_0x4421df);_0x29d52c(_0x10bc75[_0xe676('0x14')](0x1f4,_0x1a1bdf[_0xe676('0x15')]));});});});};
\ No newline at end of file
index cb32a3a..e432c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29c3=['/opencontacts','getOpenContacts','/:id','show','create','post','/preview','getPreview','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x54ba26,_0x301c1f){var _0x36ce4e=function(_0x227ccb){while(--_0x227ccb){_0x54ba26['push'](_0x54ba26['shift']());}};_0x36ce4e(++_0x301c1f);}(_0x29c3,0x109));var _0x329c=function(_0x2b7406,_0x198551){_0x2b7406=_0x2b7406-0x0;var _0x3762c1=_0x29c3[_0x2b7406];return _0x3762c1;};'use strict';var multer=require(_0x329c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x329c('0x1'));var express=require('express');var router=express[_0x329c('0x2')]();var fs_extra=require(_0x329c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x329c('0x4'));var controller=require(_0x329c('0x5'));router[_0x329c('0x6')]('/',auth[_0x329c('0x7')](),controller[_0x329c('0x8')]);router[_0x329c('0x6')](_0x329c('0x9'),auth['isAuthenticated'](),controller[_0x329c('0xa')]);router['get'](_0x329c('0xb'),auth['isAuthenticated'](),controller[_0x329c('0xc')]);router[_0x329c('0x6')](_0x329c('0xd'),auth[_0x329c('0x7')](),controller[_0x329c('0xe')]);router['post']('/',auth[_0x329c('0x7')](),controller[_0x329c('0xf')]);router[_0x329c('0x10')](_0x329c('0x11'),auth[_0x329c('0x7')](),controller[_0x329c('0x12')]);router[_0x329c('0x13')](_0x329c('0xd'),auth[_0x329c('0x7')](),controller['update']);router[_0x329c('0x14')](_0x329c('0xd'),auth[_0x329c('0x7')](),controller[_0x329c('0x15')]);module[_0x329c('0x16')]=router;
\ No newline at end of file
+var _0xb3d6=['/preview','getPreview','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/:id','show','create','post'];(function(_0x4d26f8,_0x8f9467){var _0x2211e7=function(_0x5d66a2){while(--_0x5d66a2){_0x4d26f8['push'](_0x4d26f8['shift']());}};_0x2211e7(++_0x8f9467);}(_0xb3d6,0xe8));var _0x6b3d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb3d6[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x6b3d('0x0'));var util=require(_0x6b3d('0x1'));var path=require('path');var timeout=require(_0x6b3d('0x2'));var express=require('express');var router=express[_0x6b3d('0x3')]();var fs_extra=require(_0x6b3d('0x4'));var auth=require(_0x6b3d('0x5'));var interaction=require(_0x6b3d('0x6'));var config=require('../../config/environment');var controller=require(_0x6b3d('0x7'));router[_0x6b3d('0x8')]('/',auth[_0x6b3d('0x9')](),controller[_0x6b3d('0xa')]);router[_0x6b3d('0x8')](_0x6b3d('0xb'),auth[_0x6b3d('0x9')](),controller[_0x6b3d('0xc')]);router[_0x6b3d('0x8')](_0x6b3d('0xd'),auth[_0x6b3d('0x9')](),controller['getOpenContacts']);router['get'](_0x6b3d('0xe'),auth[_0x6b3d('0x9')](),controller[_0x6b3d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b3d('0x10')]);router[_0x6b3d('0x11')](_0x6b3d('0x12'),auth['isAuthenticated'](),controller[_0x6b3d('0x13')]);router[_0x6b3d('0x14')](_0x6b3d('0xe'),auth[_0x6b3d('0x9')](),controller[_0x6b3d('0x15')]);router[_0x6b3d('0x16')](_0x6b3d('0xe'),auth['isAuthenticated'](),controller[_0x6b3d('0x17')]);module[_0x6b3d('0x18')]=router;
\ No newline at end of file
index d6f068c..0412620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9b5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe9b5,0x1be));var _0x5e9b=function(_0x53aee2,_0x282f0e){_0x53aee2=_0x53aee2-0x0;var _0x3db14f=_0xe9b5[_0x53aee2];return _0x3db14f;};'use strict';var moment=require(_0x5e9b('0x0'));var Sequelize=require(_0x5e9b('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x5e9b('0x2')]},'phone':{'type':Sequelize[_0x5e9b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5e9b('0x4')](_0x5e9b('0x5'))},'countbusyretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5e9b('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe96c=['moment','exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b7f53,_0x3b5fd7){var _0x265c21=function(_0x54395f){while(--_0x54395f){_0x5b7f53['push'](_0x5b7f53['shift']());}};_0x265c21(++_0x3b5fd7);}(_0xe96c,0xcb));var _0xce96=function(_0x349b86,_0x506099){_0x349b86=_0x349b86-0x0;var _0x538010=_0xe96c[_0x349b86];return _0x538010;};'use strict';var moment=require(_0xce96('0x0'));var Sequelize=require('sequelize');module[_0xce96('0x1')]={'CmHopperId':{'type':Sequelize[_0xce96('0x2')]},'phone':{'type':Sequelize[_0xce96('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xce96('0x4')],'defaultValue':moment()[_0xce96('0x5')](_0xce96('0x6'))},'countbusyretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xce96('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 524fa90..58f4783 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c17=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','CmHopperAdditionalPhones','error','name','send','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','keys','rawAttributes','fields','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0x2c17,0x18b));var _0x72c1=function(_0x370d3b,_0x156e14){_0x370d3b=_0x370d3b-0x0;var _0x3f0e35=_0x2c17[_0x370d3b];return _0x3f0e35;};'use strict';var emlformat=require(_0x72c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72c1('0x1'));var jsonpatch=require(_0x72c1('0x2'));var rp=require(_0x72c1('0x3'));var moment=require(_0x72c1('0x4'));var BPromise=require(_0x72c1('0x5'));var Mustache=require(_0x72c1('0x6'));var util=require(_0x72c1('0x7'));var path=require(_0x72c1('0x8'));var sox=require(_0x72c1('0x9'));var csv=require(_0x72c1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72c1('0xb'));var _=require(_0x72c1('0xc'));var squel=require('squel');var crypto=require(_0x72c1('0xd'));var jsforce=require(_0x72c1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x72c1('0xa'));var querystring=require('querystring');var Papa=require(_0x72c1('0xf'));var Redis=require('ioredis');var authService=require(_0x72c1('0x10'));var qs=require(_0x72c1('0x11'));var as=require(_0x72c1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72c1('0x13'))(_0x72c1('0x14'));var utils=require('../../config/utils');var config=require(_0x72c1('0x15'));var licenseUtil=require(_0x72c1('0x16'));var db=require(_0x72c1('0x17'))['db'];function respondWithStatusCode(_0x19267f,_0x56eece){_0x56eece=_0x56eece||0xcc;return function(_0x160fbc){if(_0x160fbc){return _0x19267f[_0x72c1('0x18')](_0x56eece);}return _0x19267f[_0x72c1('0x19')](_0x56eece)[_0x72c1('0x1a')]();};}function respondWithResult(_0x5d26d3,_0x565f26){_0x565f26=_0x565f26||0xc8;return function(_0x5b1741){if(_0x5b1741){return _0x5d26d3[_0x72c1('0x19')](_0x565f26)[_0x72c1('0x1b')](_0x5b1741);}};}function respondWithFilteredResult(_0x1d33a7,_0x59f50b){return function(_0x2bb2f5){if(_0x2bb2f5){var _0x14ebb0=typeof _0x59f50b[_0x72c1('0x1c')]===_0x72c1('0x1d')&&typeof _0x59f50b['limit']===_0x72c1('0x1d');var _0x4134ca=_0x2bb2f5[_0x72c1('0x1e')];var _0x20054e=_0x14ebb0?0x0:_0x59f50b[_0x72c1('0x1c')];var _0x49f2ad=_0x14ebb0?_0x2bb2f5[_0x72c1('0x1e')]:_0x59f50b[_0x72c1('0x1c')]+_0x59f50b[_0x72c1('0x1f')];var _0x178a2e;if(_0x49f2ad>=_0x4134ca){_0x49f2ad=_0x4134ca;_0x178a2e=0xc8;}else{_0x178a2e=0xce;}_0x1d33a7[_0x72c1('0x19')](_0x178a2e);return _0x1d33a7[_0x72c1('0x20')]('Content-Range',_0x20054e+'-'+_0x49f2ad+'/'+_0x4134ca)['json'](_0x2bb2f5);}return null;};}function patchUpdates(_0x10f6a2){return function(_0x37dc1f){try{jsonpatch[_0x72c1('0x21')](_0x37dc1f,_0x10f6a2,!![]);}catch(_0x45bdcb){return BPromise[_0x72c1('0x22')](_0x45bdcb);}return _0x37dc1f['save']();};}function saveUpdates(_0x380130,_0x2cfbdb){return function(_0x27edac){if(_0x27edac){return _0x27edac[_0x72c1('0x23')](_0x380130)[_0x72c1('0x24')](function(_0x54aefc){return _0x54aefc;});}return null;};}function removeEntity(_0x5b6b0c,_0x320efe){return function(_0x1f6d31){if(_0x1f6d31){return _0x1f6d31[_0x72c1('0x25')]()[_0x72c1('0x24')](function(){var _0x24578e=_0x1f6d31['get']({'plain':!![]});var _0x321b46=_0x72c1('0x26');return db['UserProfileResource'][_0x72c1('0x25')]({'where':{'type':_0x321b46,'resourceId':_0x24578e['id']}})[_0x72c1('0x24')](function(){return _0x1f6d31;});})[_0x72c1('0x24')](function(){_0x5b6b0c[_0x72c1('0x19')](0xcc)[_0x72c1('0x1a')]();});}};}function handleEntityNotFound(_0x216888,_0x5a22b5){return function(_0x3138ea){if(!_0x3138ea){_0x216888['sendStatus'](0x194);}return _0x3138ea;};}function handleError(_0x1bb5f3,_0x44456d){_0x44456d=_0x44456d||0x1f4;return function(_0x4fba16){logger[_0x72c1('0x27')](_0x4fba16['stack']);if(_0x4fba16['name']){delete _0x4fba16[_0x72c1('0x28')];}_0x1bb5f3[_0x72c1('0x19')](_0x44456d)[_0x72c1('0x29')](_0x4fba16);};}exports['index']=function(_0x2d64c3,_0x310c91){var _0x23b5b1={},_0x579854={},_0x21d2a3={'count':0x0,'rows':[]};var _0x38151b=_[_0x72c1('0x2a')](db[_0x72c1('0x2b')]['rawAttributes'],function(_0x4ebefd){return{'name':_0x4ebefd[_0x72c1('0x2c')],'type':_0x4ebefd[_0x72c1('0x2d')][_0x72c1('0x2e')]};});_0x579854[_0x72c1('0x2f')]=_[_0x72c1('0x2a')](_0x38151b,'name');_0x579854[_0x72c1('0x30')]=_['keys'](_0x2d64c3['query']);_0x579854[_0x72c1('0x31')]=_[_0x72c1('0x32')](_0x579854[_0x72c1('0x2f')],_0x579854[_0x72c1('0x30')]);_0x23b5b1[_0x72c1('0x33')]=_[_0x72c1('0x32')](_0x579854['model'],qs['fields'](_0x2d64c3[_0x72c1('0x30')]['fields']));_0x23b5b1[_0x72c1('0x33')]=_0x23b5b1[_0x72c1('0x33')][_0x72c1('0x34')]?_0x23b5b1[_0x72c1('0x33')]:_0x579854[_0x72c1('0x2f')];if(!_0x2d64c3['query'][_0x72c1('0x35')](_0x72c1('0x36'))){_0x23b5b1['limit']=qs[_0x72c1('0x1f')](_0x2d64c3[_0x72c1('0x30')][_0x72c1('0x1f')]);_0x23b5b1['offset']=qs[_0x72c1('0x1c')](_0x2d64c3[_0x72c1('0x30')][_0x72c1('0x1c')]);}_0x23b5b1[_0x72c1('0x37')]=qs['sort'](_0x2d64c3[_0x72c1('0x30')][_0x72c1('0x38')]);_0x23b5b1[_0x72c1('0x39')]=qs[_0x72c1('0x31')](_[_0x72c1('0x3a')](_0x2d64c3[_0x72c1('0x30')],_0x579854['filters']),_0x38151b);if(_0x2d64c3['query'][_0x72c1('0x3b')]){_0x23b5b1['where']=_[_0x72c1('0x3c')](_0x23b5b1[_0x72c1('0x39')],{'$or':_[_0x72c1('0x2a')](_0x38151b,function(_0x5e3c8f){if(_0x5e3c8f['type']!=='VIRTUAL'){var _0x54cb2d={};_0x54cb2d[_0x5e3c8f['name']]={'$like':'%'+_0x2d64c3[_0x72c1('0x30')][_0x72c1('0x3b')]+'%'};return _0x54cb2d;}})});}_0x23b5b1=_['merge']({},_0x23b5b1,_0x2d64c3['options']);var _0xc632d6={'where':_0x23b5b1[_0x72c1('0x39')]};return db[_0x72c1('0x2b')][_0x72c1('0x1e')](_0xc632d6)[_0x72c1('0x24')](function(_0x588a53){_0x21d2a3['count']=_0x588a53;if(_0x2d64c3[_0x72c1('0x30')][_0x72c1('0x3d')]){_0x23b5b1['include']=[{'all':!![]}];}return db[_0x72c1('0x2b')]['findAll'](_0x23b5b1);})[_0x72c1('0x24')](function(_0x1ab580){_0x21d2a3[_0x72c1('0x3e')]=_0x1ab580;return _0x21d2a3;})[_0x72c1('0x24')](respondWithFilteredResult(_0x310c91,_0x23b5b1))[_0x72c1('0x3f')](handleError(_0x310c91,null));};exports[_0x72c1('0x40')]=function(_0x109a1a,_0x18b638){var _0x34bc4a={'raw':!![],'where':{'id':_0x109a1a[_0x72c1('0x41')]['id']}},_0x544853={};_0x544853[_0x72c1('0x2f')]=_[_0x72c1('0x42')](db[_0x72c1('0x2b')][_0x72c1('0x43')]);_0x544853[_0x72c1('0x30')]=_[_0x72c1('0x42')](_0x109a1a[_0x72c1('0x30')]);_0x544853['filters']=_[_0x72c1('0x32')](_0x544853[_0x72c1('0x2f')],_0x544853[_0x72c1('0x30')]);_0x34bc4a['attributes']=_[_0x72c1('0x32')](_0x544853[_0x72c1('0x2f')],qs[_0x72c1('0x44')](_0x109a1a['query'][_0x72c1('0x44')]));_0x34bc4a[_0x72c1('0x33')]=_0x34bc4a[_0x72c1('0x33')]['length']?_0x34bc4a['attributes']:_0x544853[_0x72c1('0x2f')];if(_0x109a1a[_0x72c1('0x30')][_0x72c1('0x3d')]){_0x34bc4a[_0x72c1('0x45')]=[{'all':!![]}];}_0x34bc4a=_[_0x72c1('0x3c')]({},_0x34bc4a,_0x109a1a[_0x72c1('0x46')]);return db[_0x72c1('0x2b')][_0x72c1('0x47')](_0x34bc4a)[_0x72c1('0x24')](handleEntityNotFound(_0x18b638,null))[_0x72c1('0x24')](respondWithResult(_0x18b638,null))[_0x72c1('0x3f')](handleError(_0x18b638,null));};exports['create']=function(_0x4969ac,_0x5cb0f2){return db[_0x72c1('0x2b')][_0x72c1('0x48')](_0x4969ac[_0x72c1('0x49')],{})[_0x72c1('0x24')](function(_0x9a189e){var _0x4dc7ce=_0x4969ac[_0x72c1('0x4a')][_0x72c1('0x4b')]({'plain':!![]});if(!_0x4dc7ce)throw new Error(_0x72c1('0x4c'));if(_0x4dc7ce['role']===_0x72c1('0x4a')){var _0x51bc3f=_0x9a189e['get']({'plain':!![]});var _0x5a845c=_0x72c1('0x26');return db[_0x72c1('0x4d')]['find']({'where':{'name':_0x5a845c,'userProfileId':_0x4dc7ce[_0x72c1('0x4e')]},'raw':!![]})[_0x72c1('0x24')](function(_0x50a86f){if(_0x50a86f&&_0x50a86f[_0x72c1('0x4f')]===0x0){return db[_0x72c1('0x50')][_0x72c1('0x48')]({'name':_0x51bc3f['name'],'resourceId':_0x51bc3f['id'],'type':_0x50a86f[_0x72c1('0x28')],'sectionId':_0x50a86f['id']},{})[_0x72c1('0x24')](function(){return _0x9a189e;});}else{return _0x9a189e;}})['catch'](function(_0x3a4685){logger[_0x72c1('0x27')](_0x72c1('0x51'),_0x3a4685);throw _0x3a4685;});}return _0x9a189e;})['then'](respondWithResult(_0x5cb0f2,0xc9))[_0x72c1('0x3f')](handleError(_0x5cb0f2,null));};exports['update']=function(_0x1012ab,_0x88dac3){if(_0x1012ab[_0x72c1('0x49')]['id']){delete _0x1012ab[_0x72c1('0x49')]['id'];}return db[_0x72c1('0x2b')][_0x72c1('0x47')]({'where':{'id':_0x1012ab[_0x72c1('0x41')]['id']}})[_0x72c1('0x24')](handleEntityNotFound(_0x88dac3,null))[_0x72c1('0x24')](saveUpdates(_0x1012ab[_0x72c1('0x49')],null))['then'](respondWithResult(_0x88dac3,null))[_0x72c1('0x3f')](handleError(_0x88dac3,null));};exports[_0x72c1('0x25')]=function(_0x42dca8,_0x7e6d21){return db[_0x72c1('0x2b')]['find']({'where':{'id':_0x42dca8[_0x72c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x7e6d21,null))[_0x72c1('0x24')](removeEntity(_0x7e6d21,null))[_0x72c1('0x3f')](handleError(_0x7e6d21,null));};
\ No newline at end of file
+var _0x8b54=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','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/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find'];(function(_0x10559e,_0x42e4c1){var _0x1cf6f9=function(_0x4cab7c){while(--_0x4cab7c){_0x10559e['push'](_0x10559e['shift']());}};_0x1cf6f9(++_0x42e4c1);}(_0x8b54,0x1a9));var _0x48b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b54[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x48b5('0x0'));var rimraf=require(_0x48b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x48b5('0x2'));var moment=require(_0x48b5('0x3'));var BPromise=require(_0x48b5('0x4'));var Mustache=require(_0x48b5('0x5'));var util=require(_0x48b5('0x6'));var path=require(_0x48b5('0x7'));var sox=require(_0x48b5('0x8'));var csv=require(_0x48b5('0x9'));var ejs=require(_0x48b5('0xa'));var fs=require('fs');var fs_extra=require(_0x48b5('0xb'));var _=require('lodash');var squel=require(_0x48b5('0xc'));var crypto=require(_0x48b5('0xd'));var jsforce=require(_0x48b5('0xe'));var deskjs=require(_0x48b5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x48b5('0x10'));var Redis=require('ioredis');var authService=require(_0x48b5('0x11'));var qs=require(_0x48b5('0x12'));var as=require(_0x48b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48b5('0x14'))(_0x48b5('0x15'));var utils=require(_0x48b5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48b5('0x17'))['db'];function respondWithStatusCode(_0x2db761,_0x55b43d){_0x55b43d=_0x55b43d||0xcc;return function(_0x5a9656){if(_0x5a9656){return _0x2db761['sendStatus'](_0x55b43d);}return _0x2db761[_0x48b5('0x18')](_0x55b43d)[_0x48b5('0x19')]();};}function respondWithResult(_0x4a8f42,_0x509fcf){_0x509fcf=_0x509fcf||0xc8;return function(_0x1c7ed2){if(_0x1c7ed2){return _0x4a8f42[_0x48b5('0x18')](_0x509fcf)[_0x48b5('0x1a')](_0x1c7ed2);}};}function respondWithFilteredResult(_0x1ff5e3,_0x5c6fad){return function(_0x3d85cb){if(_0x3d85cb){var _0x48d502=typeof _0x5c6fad['offset']==='undefined'&&typeof _0x5c6fad['limit']==='undefined';var _0x47db47=_0x3d85cb[_0x48b5('0x1b')];var _0x23132d=_0x48d502?0x0:_0x5c6fad[_0x48b5('0x1c')];var _0x4c9a52=_0x48d502?_0x3d85cb[_0x48b5('0x1b')]:_0x5c6fad[_0x48b5('0x1c')]+_0x5c6fad[_0x48b5('0x1d')];var _0x158935;if(_0x4c9a52>=_0x47db47){_0x4c9a52=_0x47db47;_0x158935=0xc8;}else{_0x158935=0xce;}_0x1ff5e3[_0x48b5('0x18')](_0x158935);return _0x1ff5e3['set']('Content-Range',_0x23132d+'-'+_0x4c9a52+'/'+_0x47db47)[_0x48b5('0x1a')](_0x3d85cb);}return null;};}function patchUpdates(_0x492b80){return function(_0x21d7b2){try{jsonpatch[_0x48b5('0x1e')](_0x21d7b2,_0x492b80,!![]);}catch(_0x297214){return BPromise[_0x48b5('0x1f')](_0x297214);}return _0x21d7b2[_0x48b5('0x20')]();};}function saveUpdates(_0x5cf3c7,_0x3eae53){return function(_0x1a1fdb){if(_0x1a1fdb){return _0x1a1fdb[_0x48b5('0x21')](_0x5cf3c7)[_0x48b5('0x22')](function(_0x3a0e44){return _0x3a0e44;});}return null;};}function removeEntity(_0x39e2a5,_0x19fa17){return function(_0x5cce4b){if(_0x5cce4b){return _0x5cce4b[_0x48b5('0x23')]()[_0x48b5('0x22')](function(){var _0x101239=_0x5cce4b[_0x48b5('0x24')]({'plain':!![]});var _0x8c38b4=_0x48b5('0x25');return db[_0x48b5('0x26')][_0x48b5('0x23')]({'where':{'type':_0x8c38b4,'resourceId':_0x101239['id']}})[_0x48b5('0x22')](function(){return _0x5cce4b;});})[_0x48b5('0x22')](function(){_0x39e2a5[_0x48b5('0x18')](0xcc)[_0x48b5('0x19')]();});}};}function handleEntityNotFound(_0x4095a6,_0x4d9231){return function(_0x1f2fca){if(!_0x1f2fca){_0x4095a6[_0x48b5('0x27')](0x194);}return _0x1f2fca;};}function handleError(_0x14281f,_0x3ee8a2){_0x3ee8a2=_0x3ee8a2||0x1f4;return function(_0x29dff7){logger[_0x48b5('0x28')](_0x29dff7['stack']);if(_0x29dff7[_0x48b5('0x29')]){delete _0x29dff7[_0x48b5('0x29')];}_0x14281f['status'](_0x3ee8a2)['send'](_0x29dff7);};}exports[_0x48b5('0x2a')]=function(_0x14e3d8,_0x249c26){var _0x4d87a5={},_0x4ff889={},_0x41db60={'count':0x0,'rows':[]};var _0x32979a=_[_0x48b5('0x2b')](db[_0x48b5('0x2c')][_0x48b5('0x2d')],function(_0xe94276){return{'name':_0xe94276[_0x48b5('0x2e')],'type':_0xe94276['type']['key']};});_0x4ff889[_0x48b5('0x2f')]=_['map'](_0x32979a,'name');_0x4ff889[_0x48b5('0x30')]=_['keys'](_0x14e3d8['query']);_0x4ff889['filters']=_[_0x48b5('0x31')](_0x4ff889[_0x48b5('0x2f')],_0x4ff889[_0x48b5('0x30')]);_0x4d87a5[_0x48b5('0x32')]=_[_0x48b5('0x31')](_0x4ff889[_0x48b5('0x2f')],qs[_0x48b5('0x33')](_0x14e3d8[_0x48b5('0x30')][_0x48b5('0x33')]));_0x4d87a5[_0x48b5('0x32')]=_0x4d87a5[_0x48b5('0x32')][_0x48b5('0x34')]?_0x4d87a5['attributes']:_0x4ff889['model'];if(!_0x14e3d8['query'][_0x48b5('0x35')](_0x48b5('0x36'))){_0x4d87a5[_0x48b5('0x1d')]=qs['limit'](_0x14e3d8[_0x48b5('0x30')]['limit']);_0x4d87a5[_0x48b5('0x1c')]=qs['offset'](_0x14e3d8[_0x48b5('0x30')][_0x48b5('0x1c')]);}_0x4d87a5[_0x48b5('0x37')]=qs['sort'](_0x14e3d8['query'][_0x48b5('0x38')]);_0x4d87a5[_0x48b5('0x39')]=qs[_0x48b5('0x3a')](_[_0x48b5('0x3b')](_0x14e3d8[_0x48b5('0x30')],_0x4ff889['filters']),_0x32979a);if(_0x14e3d8['query'][_0x48b5('0x3c')]){_0x4d87a5['where']=_[_0x48b5('0x3d')](_0x4d87a5[_0x48b5('0x39')],{'$or':_[_0x48b5('0x2b')](_0x32979a,function(_0x52a0ad){if(_0x52a0ad[_0x48b5('0x3e')]!==_0x48b5('0x3f')){var _0xc2d1dd={};_0xc2d1dd[_0x52a0ad[_0x48b5('0x29')]]={'$like':'%'+_0x14e3d8[_0x48b5('0x30')]['filter']+'%'};return _0xc2d1dd;}})});}_0x4d87a5=_['merge']({},_0x4d87a5,_0x14e3d8[_0x48b5('0x40')]);var _0x3363e4={'where':_0x4d87a5[_0x48b5('0x39')]};return db['CmHopperAdditionalPhone'][_0x48b5('0x1b')](_0x3363e4)[_0x48b5('0x22')](function(_0x4bf14f){_0x41db60['count']=_0x4bf14f;if(_0x14e3d8[_0x48b5('0x30')][_0x48b5('0x41')]){_0x4d87a5[_0x48b5('0x42')]=[{'all':!![]}];}return db[_0x48b5('0x2c')][_0x48b5('0x43')](_0x4d87a5);})[_0x48b5('0x22')](function(_0xa00e87){_0x41db60[_0x48b5('0x44')]=_0xa00e87;return _0x41db60;})['then'](respondWithFilteredResult(_0x249c26,_0x4d87a5))['catch'](handleError(_0x249c26,null));};exports[_0x48b5('0x45')]=function(_0x44b6df,_0x3abb4a){var _0xb41c2={'raw':!![],'where':{'id':_0x44b6df[_0x48b5('0x46')]['id']}},_0x2c7728={};_0x2c7728['model']=_[_0x48b5('0x47')](db[_0x48b5('0x2c')]['rawAttributes']);_0x2c7728[_0x48b5('0x30')]=_[_0x48b5('0x47')](_0x44b6df[_0x48b5('0x30')]);_0x2c7728[_0x48b5('0x3a')]=_[_0x48b5('0x31')](_0x2c7728[_0x48b5('0x2f')],_0x2c7728[_0x48b5('0x30')]);_0xb41c2[_0x48b5('0x32')]=_[_0x48b5('0x31')](_0x2c7728[_0x48b5('0x2f')],qs[_0x48b5('0x33')](_0x44b6df[_0x48b5('0x30')][_0x48b5('0x33')]));_0xb41c2[_0x48b5('0x32')]=_0xb41c2[_0x48b5('0x32')][_0x48b5('0x34')]?_0xb41c2['attributes']:_0x2c7728['model'];if(_0x44b6df[_0x48b5('0x30')]['includeAll']){_0xb41c2[_0x48b5('0x42')]=[{'all':!![]}];}_0xb41c2=_['merge']({},_0xb41c2,_0x44b6df[_0x48b5('0x40')]);return db[_0x48b5('0x2c')][_0x48b5('0x48')](_0xb41c2)['then'](handleEntityNotFound(_0x3abb4a,null))[_0x48b5('0x22')](respondWithResult(_0x3abb4a,null))[_0x48b5('0x49')](handleError(_0x3abb4a,null));};exports[_0x48b5('0x4a')]=function(_0x3a2cf3,_0x49f1ff){return db[_0x48b5('0x2c')]['create'](_0x3a2cf3[_0x48b5('0x4b')],{})['then'](function(_0xe1c03e){var _0x52d76e=_0x3a2cf3[_0x48b5('0x4c')][_0x48b5('0x24')]({'plain':!![]});if(!_0x52d76e)throw new Error(_0x48b5('0x4d'));if(_0x52d76e[_0x48b5('0x4e')]===_0x48b5('0x4c')){var _0x3ffec0=_0xe1c03e['get']({'plain':!![]});var _0x11d9c2='CmHopperAdditionalPhones';return db[_0x48b5('0x4f')][_0x48b5('0x48')]({'where':{'name':_0x11d9c2,'userProfileId':_0x52d76e[_0x48b5('0x50')]},'raw':!![]})[_0x48b5('0x22')](function(_0x5cd05a){if(_0x5cd05a&&_0x5cd05a[_0x48b5('0x51')]===0x0){return db['UserProfileResource'][_0x48b5('0x4a')]({'name':_0x3ffec0[_0x48b5('0x29')],'resourceId':_0x3ffec0['id'],'type':_0x5cd05a[_0x48b5('0x29')],'sectionId':_0x5cd05a['id']},{})[_0x48b5('0x22')](function(){return _0xe1c03e;});}else{return _0xe1c03e;}})[_0x48b5('0x49')](function(_0x296f4c){logger[_0x48b5('0x28')](_0x48b5('0x52'),_0x296f4c);throw _0x296f4c;});}return _0xe1c03e;})[_0x48b5('0x22')](respondWithResult(_0x49f1ff,0xc9))[_0x48b5('0x49')](handleError(_0x49f1ff,null));};exports[_0x48b5('0x21')]=function(_0xadd508,_0x1e7182){if(_0xadd508[_0x48b5('0x4b')]['id']){delete _0xadd508[_0x48b5('0x4b')]['id'];}return db[_0x48b5('0x2c')][_0x48b5('0x48')]({'where':{'id':_0xadd508['params']['id']}})[_0x48b5('0x22')](handleEntityNotFound(_0x1e7182,null))[_0x48b5('0x22')](saveUpdates(_0xadd508[_0x48b5('0x4b')],null))[_0x48b5('0x22')](respondWithResult(_0x1e7182,null))[_0x48b5('0x49')](handleError(_0x1e7182,null));};exports[_0x48b5('0x23')]=function(_0x39f163,_0x5bcc04){return db['CmHopperAdditionalPhone'][_0x48b5('0x48')]({'where':{'id':_0x39f163[_0x48b5('0x46')]['id']}})[_0x48b5('0x22')](handleEntityNotFound(_0x5bcc04,null))[_0x48b5('0x22')](removeEntity(_0x5bcc04,null))[_0x48b5('0x49')](handleError(_0x5bcc04,null));};
\ No newline at end of file
index a1e598c..573d2ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','cm_hopper_additional_phones','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0bd8,0xe0));var _0x80bd=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x0bd8[_0x56ba92];return _0x8fe94d;};'use strict';var _=require(_0x80bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80bd('0x1'));var moment=require(_0x80bd('0x2'));var BPromise=require(_0x80bd('0x3'));var rp=require(_0x80bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80bd('0x5'));var config=require(_0x80bd('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x80bd('0x7')]=function(_0x130aca,_0x406835){return _0x130aca['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x80bd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1e6=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','moment'];(function(_0x395c24,_0x2c5d88){var _0x45ec90=function(_0x1372b0){while(--_0x1372b0){_0x395c24['push'](_0x395c24['shift']());}};_0x45ec90(++_0x2c5d88);}(_0xc1e6,0x12a));var _0x6c1e=function(_0x2dc5d2,_0x4818f9){_0x2dc5d2=_0x2dc5d2-0x0;var _0x21a848=_0xc1e6[_0x2dc5d2];return _0x21a848;};'use strict';var _=require(_0x6c1e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6c1e('0x1'));var BPromise=require(_0x6c1e('0x2'));var rp=require(_0x6c1e('0x3'));var fs=require('fs');var path=require(_0x6c1e('0x4'));var rimraf=require(_0x6c1e('0x5'));var config=require(_0x6c1e('0x6'));var attributes=require(_0x6c1e('0x7'));module[_0x6c1e('0x8')]=function(_0x52d0cc,_0x44dbac){return _0x52d0cc[_0x6c1e('0x9')](_0x6c1e('0xa'),attributes,{'tableName':_0x6c1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c08fdda..7d5fe3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c35=['error','message','catch','VerifyAdditionalPhones','VerifyAdditionalPhones\x20promise','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','VerifyAdditionalPhones\x20if\x20params','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','VerifyAdditionalPhones\x20else\x20params','VerifyAdditionalPhones\x20final\x20params','countnoanswerretry','countdropretry','entity','SwapAdditionalPhones\x20req\x20=\x20','SwapAdditionalPhones\x20body\x20=\x20','duration','waitTime','ASC','SwapAdditionalPhones\x20additional\x20=\x20','activateAdditionalPhone\x20hopper\x20=\x20','activateAdditionalPhone\x20additional\x20=\x20','activateAdditionalPhone\x20waitTime\x20=\x20','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','hopperToAdditional\x20-\x20','additionalToHopper\x20-\x20','additional\x20-\x20','hopper\x20-\x20','sequelize','transaction','hopperToAdditional\x20transaction\x20-\x20','_additionalToHopper\x20condition\x20-\x20','update','_additionalToHopper\x20transaction\x20-\x20','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x2a12c1,_0x20dd3d){var _0xd296c4=function(_0x2e5e6e){while(--_0x2e5e6e){_0x2a12c1['push'](_0x2a12c1['shift']());}};_0xd296c4(++_0x20dd3d);}(_0x8c35,0x165));var _0x58c3=function(_0x4a5085,_0x26b87a){_0x4a5085=_0x4a5085-0x0;var _0x17e90a=_0x8c35[_0x4a5085];return _0x17e90a;};'use strict';var _=require(_0x58c3('0x0'));var util=require(_0x58c3('0x1'));var moment=require(_0x58c3('0x2'));var BPromise=require(_0x58c3('0x3'));var rs=require(_0x58c3('0x4'));var fs=require('fs');var Redis=require(_0x58c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c3('0x6'));var logger=require(_0x58c3('0x7'))(_0x58c3('0x8'));var config=require(_0x58c3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58c3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d3e03,_0x4e2306,_0x78e577){return new BPromise(function(_0x4926dd,_0x2631c6){return client['request'](_0x4d3e03,_0x78e577)['then'](function(_0x445d83){logger[_0x58c3('0xb')](_0x58c3('0xc'),_0x4e2306,'request\x20sent');logger[_0x58c3('0xd')](_0x58c3('0xe'),_0x4e2306,_0x58c3('0xf'),JSON[_0x58c3('0x10')](_0x445d83));if(_0x445d83['error']){if(_0x445d83['error'][_0x58c3('0x11')]===0x1f4){logger[_0x58c3('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4e2306,_0x445d83[_0x58c3('0x12')][_0x58c3('0x13')]);return _0x2631c6(_0x445d83[_0x58c3('0x12')]['message']);}logger[_0x58c3('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4e2306,_0x445d83[_0x58c3('0x12')][_0x58c3('0x13')]);return _0x4926dd(_0x445d83[_0x58c3('0x12')][_0x58c3('0x13')]);}else{logger[_0x58c3('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4e2306,_0x58c3('0xf'));_0x4926dd(_0x445d83['result'][_0x58c3('0x13')]);}})[_0x58c3('0x14')](function(_0x449349){logger['error'](_0x58c3('0xc'),_0x4e2306,_0x449349);_0x2631c6(_0x449349);});});}exports[_0x58c3('0x15')]=function(_0x543aea){logger[_0x58c3('0xb')](_0x58c3('0x15')+JSON[_0x58c3('0x10')](_0x543aea));var _0x59b891=this;return new Promise(function(_0x2c5779,_0x1c8367){logger[_0x58c3('0xb')](_0x58c3('0x16')+JSON[_0x58c3('0x10')](_0x543aea));return db[_0x58c3('0x17')][_0x58c3('0x18')]({'raw':!![],'where':{'ContactId':_0x543aea[_0x58c3('0x19')][_0x58c3('0x1a')],'ListId':_0x543aea[_0x58c3('0x19')][_0x58c3('0x1b')],'VoiceQueueId':_0x543aea[_0x58c3('0x19')][_0x58c3('0x1c')]===undefined?null:_0x543aea['body'][_0x58c3('0x1c')],'CampaignId':_0x543aea[_0x58c3('0x19')][_0x58c3('0x1d')]===undefined?null:_0x543aea[_0x58c3('0x19')][_0x58c3('0x1d')]}})[_0x58c3('0x1e')](function(_0x179335){if(_0x179335!=null){return db[_0x58c3('0x1f')][_0x58c3('0x18')]({'raw':!![],'where':{'CmHopperId':_0x179335['id'],'OrderBy':{'$gt':_0x179335[_0x58c3('0x20')]}},'order':[['OrderBy','ASC']]})[_0x58c3('0x1e')](function(_0x545805){var _0x31250c=0x0;if(_0x545805){logger['info'](_0x58c3('0x21')+JSON[_0x58c3('0x10')](_0x545805));logger[_0x58c3('0xb')]('VerifyAdditionalPhones\x20if\x20req'+JSON['stringify'](_0x543aea));if(_0x545805[_0x58c3('0x22')]+_0x545805[_0x58c3('0x23')]+_0x545805['countnoanswerretry']+_0x545805[_0x58c3('0x24')]+_0x545805['countdropretry']+_0x545805[_0x58c3('0x25')]+_0x545805[_0x58c3('0x26')]+_0x545805[_0x58c3('0x27')]<_0x543aea['entity'][_0x58c3('0x28')])_0x31250c=0x1;_0x2c5779({'additional':_0x31250c});}else{logger['info'](_0x58c3('0x29')+JSON[_0x58c3('0x10')](_0x545805));logger['info']('VerifyAdditionalPhones\x20else\x20req'+JSON[_0x58c3('0x10')](_0x543aea));return db[_0x58c3('0x1f')][_0x58c3('0x18')]({'raw':!![],'where':{'CmHopperId':_0x179335['id']},'order':[[_0x58c3('0x20'),'ASC']]})[_0x58c3('0x1e')](function(_0x5c2151){var _0x31842e=0x0;logger[_0x58c3('0xb')](_0x58c3('0x2a')+JSON['stringify'](_0x5c2151));logger[_0x58c3('0xb')]('VerifyAdditionalPhones\x20final\x20req'+JSON[_0x58c3('0x10')](_0x543aea));if(_0x5c2151){if(_0x5c2151[_0x58c3('0x22')]+_0x5c2151[_0x58c3('0x23')]+_0x5c2151[_0x58c3('0x2b')]+_0x5c2151[_0x58c3('0x24')]+_0x5c2151[_0x58c3('0x2c')]+_0x5c2151[_0x58c3('0x25')]+_0x5c2151['countmachineretry']+_0x5c2151[_0x58c3('0x27')]<_0x543aea[_0x58c3('0x2d')][_0x58c3('0x28')])_0x31842e=0x1;_0x2c5779({'additional':_0x31842e});}else{_0x2c5779({'additional':0x0});}})[_0x58c3('0x14')](function(_0x53acdd){logger[_0x58c3('0x12')](_0x58c3('0x15'),_0x53acdd['message']);_0x1c8367(_0x59b891[_0x58c3('0x12')](0x1f4,_0x53acdd[_0x58c3('0x13')]));});}})['catch'](function(_0xe60b2e){logger[_0x58c3('0x12')](_0x58c3('0x15'),_0xe60b2e[_0x58c3('0x13')]);_0x1c8367(_0x59b891[_0x58c3('0x12')](0x1f4,_0xe60b2e[_0x58c3('0x13')]));});}else _0x2c5779({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x43e73e){var _0x31b72f=this;return new Promise(function(_0x541b4b,_0xeace6d){logger[_0x58c3('0xb')](_0x58c3('0x2e')+JSON[_0x58c3('0x10')](_0x43e73e));logger[_0x58c3('0xb')](_0x58c3('0x2f')+JSON['stringify'](_0x43e73e[_0x58c3('0x19')]));return db[_0x58c3('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x43e73e['body'][_0x58c3('0x1a')],'ListId':_0x43e73e[_0x58c3('0x19')][_0x58c3('0x1b')],'VoiceQueueId':_0x43e73e['body'][_0x58c3('0x1c')]===undefined?null:_0x43e73e['body']['VoiceQueueId'],'CampaignId':_0x43e73e[_0x58c3('0x19')]['CampaignId']===undefined?null:_0x43e73e[_0x58c3('0x19')][_0x58c3('0x1d')]}})[_0x58c3('0x1e')](function(_0x54d89a){logger[_0x58c3('0xb')]('SwapAdditionalPhones\x20hopper\x20=\x20'+JSON[_0x58c3('0x10')](_0x54d89a));if(_0x54d89a!=null){return db[_0x58c3('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x54d89a['id'],'OrderBy':{'$gte':_0x54d89a['OrderBy']}},'order':[[_0x58c3('0x20'),'ASC']]})[_0x58c3('0x1e')](function(_0x5b0db3){logger[_0x58c3('0xb')]('SwapAdditionalPhones\x20additional\x20=\x20'+JSON[_0x58c3('0x10')](_0x5b0db3));if(_0x5b0db3)return activateAdditionalPhone(_0x54d89a,_0x43e73e[_0x58c3('0x19')],_0x5b0db3,_0x43e73e[_0x58c3('0x30')],_0x43e73e[_0x58c3('0x31')])[_0x58c3('0x1e')](function(_0x5a91b5){_0x541b4b(_0x5a91b5);});else{return db[_0x58c3('0x1f')][_0x58c3('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54d89a['id']},'order':[['OrderBy',_0x58c3('0x32')]]})[_0x58c3('0x1e')](function(_0x2e0239){logger[_0x58c3('0xb')](_0x58c3('0x33')+JSON[_0x58c3('0x10')](_0x2e0239));if(_0x2e0239)return activateAdditionalPhone(_0x54d89a,_0x43e73e['body'],_0x2e0239,_0x43e73e['duration'],_0x43e73e['waitTime'])['then'](function(_0x40d387){_0x541b4b(_0x40d387);});else{_0x541b4b({'id':_0x54d89a['id'],'phone':''});}})[_0x58c3('0x14')](function(_0x29dea3){logger[_0x58c3('0x12')](_0x58c3('0x15'),_0x29dea3[_0x58c3('0x13')]);_0xeace6d(_0x31b72f[_0x58c3('0x12')](0x1f4,_0x29dea3['message']));});}})[_0x58c3('0x14')](function(_0x3a0b6e){logger[_0x58c3('0x12')](_0x58c3('0x15'),_0x3a0b6e['message']);_0xeace6d(_0x31b72f[_0x58c3('0x12')](0x1f4,_0x3a0b6e[_0x58c3('0x13')]));});}else _0x541b4b(0x1);});});};function activateAdditionalPhone(_0xc1f8f2,_0x175c8e,_0x33677f,_0x573415,_0x1fb68c){return new Promise(function(_0x1db3ed,_0x1d1b36){logger[_0x58c3('0xb')](_0x58c3('0x34')+JSON['stringify'](_0xc1f8f2));logger[_0x58c3('0xb')](_0x58c3('0x35')+JSON[_0x58c3('0x10')](_0x33677f));logger[_0x58c3('0xb')]('activateAdditionalPhone\x20body\x20=\x20'+JSON[_0x58c3('0x10')](_0x175c8e));logger[_0x58c3('0xb')]('activateAdditionalPhone\x20duration\x20=\x20'+_0x573415);logger[_0x58c3('0xb')](_0x58c3('0x36')+_0x1fb68c);logger['info']('activateAdditionalPhone');var _0x5a4948;if(moment()>moment(_0x33677f[_0x58c3('0x37')])){_0x5a4948=moment()[_0x58c3('0x38')](_0x1fb68c||0x3,_0x58c3('0x39'));}else{if(_0x33677f[_0x58c3('0x20')]==0x0){_0x5a4948=moment(_0x33677f['scheduledat']);}else{_0x5a4948=moment()[_0x58c3('0x38')](_0x1fb68c||0x3,_0x58c3('0x39'));}}if(_[_0x58c3('0x3a')](_0x5a4948))_0x5a4948=moment()['add'](_0x1fb68c||0x3,_0x58c3('0x39'));var _0xc18eea={'phone':_0xc1f8f2[_0x58c3('0x3b')],'active':0x0,'OrderBy':_[_0x58c3('0x3a')](_0xc1f8f2[_0x58c3('0x20')])?0x0:_0xc1f8f2['OrderBy'],'scheduledat':moment()['add'](_0x573415||0x1,_0x58c3('0x39')),'countbusyretry':_0x175c8e[_0x58c3('0x22')],'countcongestionretry':_0x175c8e[_0x58c3('0x23')],'countnoanswerretry':_0x175c8e[_0x58c3('0x2b')],'countnosuchnumberretry':_0x175c8e[_0x58c3('0x24')],'countdropretry':_0x175c8e['countdropretry'],'countabandonedretry':_0x175c8e[_0x58c3('0x25')],'countmachineretry':_0x175c8e[_0x58c3('0x26')],'countagentrejectretry':_0x175c8e['countagentrejectretry'],'createdAt':_0x175c8e[_0x58c3('0x3c')],'updatedAt':_0x175c8e[_0x58c3('0x3d')]};var _0x3926f0={'CmHopperId':_0xc1f8f2['id'],'phone':_0x33677f[_0x58c3('0x3b')],'active':0x0,'OrderBy':_[_0x58c3('0x3a')](_0x33677f[_0x58c3('0x20')])?0x0:_0x33677f[_0x58c3('0x20')],'scheduledat':_0x5a4948,'countbusyretry':_0x33677f[_0x58c3('0x22')],'countcongestionretry':_0x33677f[_0x58c3('0x23')],'countnoanswerretry':_0x33677f[_0x58c3('0x2b')],'countnosuchnumberretry':_0x33677f['countnosuchnumberretry'],'countdropretry':_0x33677f[_0x58c3('0x2c')],'countabandonedretry':_0x33677f[_0x58c3('0x25')],'countmachineretry':_0x33677f[_0x58c3('0x26')],'countagentrejectretry':_0x33677f[_0x58c3('0x27')],'createdAt':_0x33677f[_0x58c3('0x3c')],'updatedAt':_0x33677f['updatedAt']};logger['info'](_0x58c3('0x3e')+JSON[_0x58c3('0x10')](_0xc18eea));logger[_0x58c3('0xb')](_0x58c3('0x3f')+JSON[_0x58c3('0x10')](_0x3926f0));logger[_0x58c3('0xb')](_0x58c3('0x40')+JSON[_0x58c3('0x10')](_0x33677f));logger[_0x58c3('0xb')](_0x58c3('0x41')+JSON[_0x58c3('0x10')](_0xc1f8f2));return db[_0x58c3('0x42')][_0x58c3('0x43')](function(_0x2c10a9){logger[_0x58c3('0xb')]('SwapAdditionalPhones\x20inside\x20tranaction\x20');logger[_0x58c3('0xb')](_0x58c3('0x44')+JSON[_0x58c3('0x10')](_0xc18eea));logger['info'](_0x58c3('0x45')+JSON[_0x58c3('0x10')](_0x33677f));return db['CmHopperAdditionalPhone'][_0x58c3('0x46')](_0xc18eea,{'where':{'id':_0x33677f['id']}},{'transaction':_0x2c10a9})['then'](function(){logger['info'](_0x58c3('0x47')+JSON[_0x58c3('0x10')](_0x3926f0));logger[_0x58c3('0xb')](_0x58c3('0x45')+JSON['stringify'](_0xc1f8f2));return db[_0x58c3('0x17')][_0x58c3('0x46')](_0x3926f0,{'where':{'id':_0xc1f8f2['id']}},{'transaction':_0x2c10a9});});})[_0x58c3('0x1e')](function(_0x12db71){_0x1db3ed({'id':_0xc1f8f2['id'],'phone':_0x33677f[_0x58c3('0x3b')]});})[_0x58c3('0x14')](function(_0x547828){logger[_0x58c3('0x12')](_0x58c3('0x48'),_0x547828[_0x58c3('0x13')]);_0x1d1b36(_this['error'](0x1f4,_0x547828[_0x58c3('0x13')]));});});}exports[_0x58c3('0x49')]=function(_0x459edf){var _0x45d00f=this;return new Promise(function(_0x57ed8e,_0x6aa267){return db[_0x58c3('0x17')][_0x58c3('0x46')](_0x459edf['body'][_0x58c3('0x4a')],{'where':{'id':_0x459edf[_0x58c3('0x19')]['id']}})[_0x58c3('0x1e')](function(_0x4c1cf3){_0x57ed8e(_0x4c1cf3);})[_0x58c3('0x14')](function(_0x1f5205){logger[_0x58c3('0x12')](_0x58c3('0x49'),_0x1f5205[_0x58c3('0x13')]);_0x6aa267(_0x45d00f[_0x58c3('0x12')](0x1f4,_0x1f5205['message']));});});};
\ No newline at end of file
+var _0x2a72=['CmHopperAdditionalPhone','OrderBy','ASC','VerifyAdditionalPhones\x20if\x20params','VerifyAdditionalPhones\x20if\x20req','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','VerifyAdditionalPhones\x20else\x20params','VerifyAdditionalPhones\x20else\x20req','VerifyAdditionalPhones\x20final\x20params','VerifyAdditionalPhones\x20final\x20req','countnoanswerretry','countagentrejectretry','SwapAdditionalPhones','SwapAdditionalPhones\x20body\x20=\x20','SwapAdditionalPhones\x20hopper\x20=\x20','duration','waitTime','SwapAdditionalPhones\x20additional\x20=\x20','activateAdditionalPhone\x20duration\x20=\x20','activateAdditionalPhone\x20waitTime\x20=\x20','activateAdditionalPhone','minutes','isNil','add','phone','updatedAt','createdAt','hopperToAdditional\x20-\x20','additional\x20-\x20','hopper\x20-\x20','sequelize','transaction','hopperToAdditional\x20transaction\x20-\x20','_additionalToHopper\x20condition\x20-\x20','update','IncrementPreviewCounters','field','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VerifyAdditionalPhones','info','VerifyAdditionalPhones\x20promise','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId'];(function(_0x4931a0,_0x28612a){var _0x59bd62=function(_0x4ccf76){while(--_0x4ccf76){_0x4931a0['push'](_0x4931a0['shift']());}};_0x59bd62(++_0x28612a);}(_0x2a72,0x79));var _0x22a7=function(_0xca82a4,_0x407eb4){_0xca82a4=_0xca82a4-0x0;var _0x5eed21=_0x2a72[_0xca82a4];return _0x5eed21;};'use strict';var _=require('lodash');var util=require(_0x22a7('0x0'));var moment=require('moment');var BPromise=require(_0x22a7('0x1'));var rs=require(_0x22a7('0x2'));var fs=require('fs');var Redis=require(_0x22a7('0x3'));var db=require(_0x22a7('0x4'))['db'];var utils=require(_0x22a7('0x5'));var logger=require(_0x22a7('0x6'))(_0x22a7('0x7'));var config=require(_0x22a7('0x8'));var jayson=require(_0x22a7('0x9'));var client=jayson[_0x22a7('0xa')][_0x22a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141d70,_0x2856de,_0x3c38ae){return new BPromise(function(_0x51f6db,_0x3b8310){return client[_0x22a7('0xc')](_0x141d70,_0x3c38ae)[_0x22a7('0xd')](function(_0x2240e6){logger['info'](_0x22a7('0xe'),_0x2856de,_0x22a7('0xf'));logger[_0x22a7('0x10')](_0x22a7('0x11'),_0x2856de,_0x22a7('0xf'),JSON[_0x22a7('0x12')](_0x2240e6));if(_0x2240e6['error']){if(_0x2240e6[_0x22a7('0x13')]['code']===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2856de,_0x2240e6[_0x22a7('0x13')][_0x22a7('0x14')]);return _0x3b8310(_0x2240e6[_0x22a7('0x13')][_0x22a7('0x14')]);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2856de,_0x2240e6[_0x22a7('0x13')][_0x22a7('0x14')]);return _0x51f6db(_0x2240e6[_0x22a7('0x13')][_0x22a7('0x14')]);}else{logger['info'](_0x22a7('0xe'),_0x2856de,_0x22a7('0xf'));_0x51f6db(_0x2240e6[_0x22a7('0x15')][_0x22a7('0x14')]);}})[_0x22a7('0x16')](function(_0x2d3963){logger[_0x22a7('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2856de,_0x2d3963);_0x3b8310(_0x2d3963);});});}exports[_0x22a7('0x17')]=function(_0x161b55){logger[_0x22a7('0x18')](_0x22a7('0x17')+JSON['stringify'](_0x161b55));var _0xf9ad35=this;return new Promise(function(_0x4f7326,_0x3979ca){logger[_0x22a7('0x18')](_0x22a7('0x19')+JSON['stringify'](_0x161b55));return db[_0x22a7('0x1a')][_0x22a7('0x1b')]({'raw':!![],'where':{'ContactId':_0x161b55['body'][_0x22a7('0x1c')],'ListId':_0x161b55[_0x22a7('0x1d')][_0x22a7('0x1e')],'VoiceQueueId':_0x161b55[_0x22a7('0x1d')][_0x22a7('0x1f')]===undefined?null:_0x161b55['body'][_0x22a7('0x1f')],'CampaignId':_0x161b55[_0x22a7('0x1d')][_0x22a7('0x20')]===undefined?null:_0x161b55[_0x22a7('0x1d')][_0x22a7('0x20')]}})[_0x22a7('0xd')](function(_0xa4cb8e){if(_0xa4cb8e!=null){return db[_0x22a7('0x21')][_0x22a7('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xa4cb8e['id'],'OrderBy':{'$gt':_0xa4cb8e[_0x22a7('0x22')]}},'order':[[_0x22a7('0x22'),_0x22a7('0x23')]]})[_0x22a7('0xd')](function(_0xed2142){var _0x3bebfe=0x0;if(_0xed2142){logger[_0x22a7('0x18')](_0x22a7('0x24')+JSON[_0x22a7('0x12')](_0xed2142));logger[_0x22a7('0x18')](_0x22a7('0x25')+JSON[_0x22a7('0x12')](_0x161b55));if(_0xed2142[_0x22a7('0x26')]+_0xed2142[_0x22a7('0x27')]+_0xed2142['countnoanswerretry']+_0xed2142[_0x22a7('0x28')]+_0xed2142[_0x22a7('0x29')]+_0xed2142[_0x22a7('0x2a')]+_0xed2142[_0x22a7('0x2b')]+_0xed2142['countagentrejectretry']<_0x161b55[_0x22a7('0x2c')][_0x22a7('0x2d')])_0x3bebfe=0x1;_0x4f7326({'additional':_0x3bebfe});}else{logger[_0x22a7('0x18')](_0x22a7('0x2e')+JSON[_0x22a7('0x12')](_0xed2142));logger[_0x22a7('0x18')](_0x22a7('0x2f')+JSON[_0x22a7('0x12')](_0x161b55));return db[_0x22a7('0x21')][_0x22a7('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xa4cb8e['id']},'order':[[_0x22a7('0x22'),_0x22a7('0x23')]]})[_0x22a7('0xd')](function(_0x1760ae){var _0x5ca499=0x0;logger['info'](_0x22a7('0x30')+JSON[_0x22a7('0x12')](_0x1760ae));logger['info'](_0x22a7('0x31')+JSON[_0x22a7('0x12')](_0x161b55));if(_0x1760ae){if(_0x1760ae['countbusyretry']+_0x1760ae['countcongestionretry']+_0x1760ae[_0x22a7('0x32')]+_0x1760ae['countnosuchnumberretry']+_0x1760ae['countdropretry']+_0x1760ae[_0x22a7('0x2a')]+_0x1760ae['countmachineretry']+_0x1760ae[_0x22a7('0x33')]<_0x161b55['entity']['dialGlobalMaxRetry'])_0x5ca499=0x1;_0x4f7326({'additional':_0x5ca499});}else{_0x4f7326({'additional':0x0});}})['catch'](function(_0x391b5f){logger[_0x22a7('0x13')](_0x22a7('0x17'),_0x391b5f[_0x22a7('0x14')]);_0x3979ca(_0xf9ad35['error'](0x1f4,_0x391b5f[_0x22a7('0x14')]));});}})[_0x22a7('0x16')](function(_0x3cf926){logger[_0x22a7('0x13')](_0x22a7('0x17'),_0x3cf926['message']);_0x3979ca(_0xf9ad35[_0x22a7('0x13')](0x1f4,_0x3cf926[_0x22a7('0x14')]));});}else _0x4f7326({'additional':0x0});});});};exports[_0x22a7('0x34')]=function(_0x32d82b){var _0x4e4b66=this;return new Promise(function(_0x29cab0,_0x32f731){logger[_0x22a7('0x18')]('SwapAdditionalPhones\x20req\x20=\x20'+JSON['stringify'](_0x32d82b));logger[_0x22a7('0x18')](_0x22a7('0x35')+JSON[_0x22a7('0x12')](_0x32d82b[_0x22a7('0x1d')]));return db[_0x22a7('0x1a')][_0x22a7('0x1b')]({'raw':!![],'where':{'ContactId':_0x32d82b[_0x22a7('0x1d')][_0x22a7('0x1c')],'ListId':_0x32d82b[_0x22a7('0x1d')][_0x22a7('0x1e')],'VoiceQueueId':_0x32d82b[_0x22a7('0x1d')][_0x22a7('0x1f')]===undefined?null:_0x32d82b['body'][_0x22a7('0x1f')],'CampaignId':_0x32d82b[_0x22a7('0x1d')][_0x22a7('0x20')]===undefined?null:_0x32d82b[_0x22a7('0x1d')][_0x22a7('0x20')]}})['then'](function(_0x3610c2){logger['info'](_0x22a7('0x36')+JSON[_0x22a7('0x12')](_0x3610c2));if(_0x3610c2!=null){return db[_0x22a7('0x21')][_0x22a7('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x3610c2['id'],'OrderBy':{'$gte':_0x3610c2[_0x22a7('0x22')]}},'order':[[_0x22a7('0x22'),_0x22a7('0x23')]]})[_0x22a7('0xd')](function(_0xd906a3){logger['info']('SwapAdditionalPhones\x20additional\x20=\x20'+JSON[_0x22a7('0x12')](_0xd906a3));if(_0xd906a3)return activateAdditionalPhone(_0x3610c2,_0x32d82b[_0x22a7('0x1d')],_0xd906a3,_0x32d82b[_0x22a7('0x37')],_0x32d82b[_0x22a7('0x38')])['then'](function(_0x4d3f52){_0x29cab0(_0x4d3f52);});else{return db[_0x22a7('0x21')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3610c2['id']},'order':[[_0x22a7('0x22'),_0x22a7('0x23')]]})[_0x22a7('0xd')](function(_0x525273){logger[_0x22a7('0x18')](_0x22a7('0x39')+JSON['stringify'](_0x525273));if(_0x525273)return activateAdditionalPhone(_0x3610c2,_0x32d82b['body'],_0x525273,_0x32d82b[_0x22a7('0x37')],_0x32d82b[_0x22a7('0x38')])[_0x22a7('0xd')](function(_0x49ae35){_0x29cab0(_0x49ae35);});else{_0x29cab0({'id':_0x3610c2['id'],'phone':''});}})[_0x22a7('0x16')](function(_0x3e2610){logger[_0x22a7('0x13')]('VerifyAdditionalPhones',_0x3e2610['message']);_0x32f731(_0x4e4b66[_0x22a7('0x13')](0x1f4,_0x3e2610[_0x22a7('0x14')]));});}})[_0x22a7('0x16')](function(_0x3964dd){logger['error']('VerifyAdditionalPhones',_0x3964dd['message']);_0x32f731(_0x4e4b66[_0x22a7('0x13')](0x1f4,_0x3964dd[_0x22a7('0x14')]));});}else _0x29cab0(0x1);});});};function activateAdditionalPhone(_0xcaa205,_0x458044,_0x1a8c4c,_0x46abff,_0x10e9bf){return new Promise(function(_0x2f23fb,_0x2ba47a){logger[_0x22a7('0x18')]('activateAdditionalPhone\x20hopper\x20=\x20'+JSON['stringify'](_0xcaa205));logger['info']('activateAdditionalPhone\x20additional\x20=\x20'+JSON[_0x22a7('0x12')](_0x1a8c4c));logger[_0x22a7('0x18')]('activateAdditionalPhone\x20body\x20=\x20'+JSON[_0x22a7('0x12')](_0x458044));logger[_0x22a7('0x18')](_0x22a7('0x3a')+_0x46abff);logger[_0x22a7('0x18')](_0x22a7('0x3b')+_0x10e9bf);logger[_0x22a7('0x18')](_0x22a7('0x3c'));var _0x1434e0;if(moment()>moment(_0x1a8c4c['scheduledat'])){_0x1434e0=moment()['add'](_0x10e9bf||0x3,'minutes');}else{if(_0x1a8c4c['OrderBy']==0x0){_0x1434e0=moment(_0x1a8c4c['scheduledat']);}else{_0x1434e0=moment()['add'](_0x10e9bf||0x3,_0x22a7('0x3d'));}}if(_[_0x22a7('0x3e')](_0x1434e0))_0x1434e0=moment()[_0x22a7('0x3f')](_0x10e9bf||0x3,_0x22a7('0x3d'));var _0xa2a731={'phone':_0xcaa205[_0x22a7('0x40')],'active':0x0,'OrderBy':_[_0x22a7('0x3e')](_0xcaa205[_0x22a7('0x22')])?0x0:_0xcaa205[_0x22a7('0x22')],'scheduledat':moment()[_0x22a7('0x3f')](_0x46abff||0x1,_0x22a7('0x3d')),'countbusyretry':_0x458044['countbusyretry'],'countcongestionretry':_0x458044[_0x22a7('0x27')],'countnoanswerretry':_0x458044['countnoanswerretry'],'countnosuchnumberretry':_0x458044[_0x22a7('0x28')],'countdropretry':_0x458044['countdropretry'],'countabandonedretry':_0x458044[_0x22a7('0x2a')],'countmachineretry':_0x458044[_0x22a7('0x2b')],'countagentrejectretry':_0x458044[_0x22a7('0x33')],'createdAt':_0x458044['createdAt'],'updatedAt':_0x458044[_0x22a7('0x41')]};var _0x5623da={'CmHopperId':_0xcaa205['id'],'phone':_0x1a8c4c['phone'],'active':0x0,'OrderBy':_[_0x22a7('0x3e')](_0x1a8c4c[_0x22a7('0x22')])?0x0:_0x1a8c4c['OrderBy'],'scheduledat':_0x1434e0,'countbusyretry':_0x1a8c4c[_0x22a7('0x26')],'countcongestionretry':_0x1a8c4c[_0x22a7('0x27')],'countnoanswerretry':_0x1a8c4c[_0x22a7('0x32')],'countnosuchnumberretry':_0x1a8c4c[_0x22a7('0x28')],'countdropretry':_0x1a8c4c[_0x22a7('0x29')],'countabandonedretry':_0x1a8c4c[_0x22a7('0x2a')],'countmachineretry':_0x1a8c4c[_0x22a7('0x2b')],'countagentrejectretry':_0x1a8c4c[_0x22a7('0x33')],'createdAt':_0x1a8c4c[_0x22a7('0x42')],'updatedAt':_0x1a8c4c[_0x22a7('0x41')]};logger[_0x22a7('0x18')](_0x22a7('0x43')+JSON[_0x22a7('0x12')](_0xa2a731));logger['info']('additionalToHopper\x20-\x20'+JSON[_0x22a7('0x12')](_0x5623da));logger[_0x22a7('0x18')](_0x22a7('0x44')+JSON['stringify'](_0x1a8c4c));logger[_0x22a7('0x18')](_0x22a7('0x45')+JSON[_0x22a7('0x12')](_0xcaa205));return db[_0x22a7('0x46')][_0x22a7('0x47')](function(_0x3f3d62){logger[_0x22a7('0x18')]('SwapAdditionalPhones\x20inside\x20tranaction\x20');logger['info'](_0x22a7('0x48')+JSON[_0x22a7('0x12')](_0xa2a731));logger['info'](_0x22a7('0x49')+JSON[_0x22a7('0x12')](_0x1a8c4c));return db['CmHopperAdditionalPhone'][_0x22a7('0x4a')](_0xa2a731,{'where':{'id':_0x1a8c4c['id']}},{'transaction':_0x3f3d62})[_0x22a7('0xd')](function(){logger['info']('_additionalToHopper\x20transaction\x20-\x20'+JSON[_0x22a7('0x12')](_0x5623da));logger[_0x22a7('0x18')](_0x22a7('0x49')+JSON[_0x22a7('0x12')](_0xcaa205));return db['CmHopper'][_0x22a7('0x4a')](_0x5623da,{'where':{'id':_0xcaa205['id']}},{'transaction':_0x3f3d62});});})['then'](function(_0x4b34fd){_0x2f23fb({'id':_0xcaa205['id'],'phone':_0x1a8c4c['phone']});})[_0x22a7('0x16')](function(_0x3feb85){logger[_0x22a7('0x13')]('activateAdditionalPhone',_0x3feb85[_0x22a7('0x14')]);_0x2ba47a(_this[_0x22a7('0x13')](0x1f4,_0x3feb85[_0x22a7('0x14')]));});});}exports[_0x22a7('0x4b')]=function(_0x247517){var _0x1b509b=this;return new Promise(function(_0x2f12f6,_0x5058ac){return db[_0x22a7('0x1a')][_0x22a7('0x4a')](_0x247517['body'][_0x22a7('0x4c')],{'where':{'id':_0x247517[_0x22a7('0x1d')]['id']}})[_0x22a7('0xd')](function(_0x2705d4){_0x2f12f6(_0x2705d4);})[_0x22a7('0x16')](function(_0x1606f8){logger[_0x22a7('0x13')](_0x22a7('0x4b'),_0x1606f8['message']);_0x5058ac(_0x1b509b[_0x22a7('0x13')](0x1f4,_0x1606f8[_0x22a7('0x14')]));});});};
\ No newline at end of file
index 984da48..3b02d1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cb0=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2bc75f,_0x5ab72e){var _0x57ce4a=function(_0x4c5e74){while(--_0x4c5e74){_0x2bc75f['push'](_0x2bc75f['shift']());}};_0x57ce4a(++_0x5ab72e);}(_0x2cb0,0x12c));var _0x02cb=function(_0x47e9f5,_0x15cc45){_0x47e9f5=_0x47e9f5-0x0;var _0x3334f5=_0x2cb0[_0x47e9f5];return _0x3334f5;};'use strict';var multer=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var path=require('path');var timeout=require(_0x02cb('0x2'));var express=require(_0x02cb('0x3'));var router=express[_0x02cb('0x4')]();var fs_extra=require(_0x02cb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02cb('0x6'));var config=require(_0x02cb('0x7'));var controller=require(_0x02cb('0x8'));router[_0x02cb('0x9')]('/',auth[_0x02cb('0xa')](),controller[_0x02cb('0xb')]);router[_0x02cb('0x9')](_0x02cb('0xc'),auth['isAuthenticated'](),controller[_0x02cb('0xd')]);router[_0x02cb('0xe')]('/',auth[_0x02cb('0xa')](),controller[_0x02cb('0xf')]);router[_0x02cb('0x10')]('/:id',auth[_0x02cb('0xa')](),controller[_0x02cb('0x11')]);router[_0x02cb('0x12')]('/:id',auth[_0x02cb('0xa')](),controller[_0x02cb('0x13')]);module[_0x02cb('0x14')]=router;
\ No newline at end of file
+var _0x14a4=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','post','create','put','delete'];(function(_0x4a498d,_0xccfecb){var _0x265842=function(_0x5a1d62){while(--_0x5a1d62){_0x4a498d['push'](_0x4a498d['shift']());}};_0x265842(++_0xccfecb);}(_0x14a4,0x80));var _0x414a=function(_0x37c71b,_0x5c9474){_0x37c71b=_0x37c71b-0x0;var _0x1cecf8=_0x14a4[_0x37c71b];return _0x1cecf8;};'use strict';var multer=require(_0x414a('0x0'));var util=require(_0x414a('0x1'));var path=require(_0x414a('0x2'));var timeout=require(_0x414a('0x3'));var express=require(_0x414a('0x4'));var router=express['Router']();var fs_extra=require(_0x414a('0x5'));var auth=require(_0x414a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x414a('0x7'));var controller=require(_0x414a('0x8'));router[_0x414a('0x9')]('/',auth[_0x414a('0xa')](),controller['index']);router[_0x414a('0x9')](_0x414a('0xb'),auth[_0x414a('0xa')](),controller['show']);router[_0x414a('0xc')]('/',auth['isAuthenticated'](),controller[_0x414a('0xd')]);router[_0x414a('0xe')](_0x414a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x414a('0xf')](_0x414a('0xb'),auth[_0x414a('0xa')](),controller[_0x414a('0x10')]);module[_0x414a('0x11')]=router;
\ No newline at end of file
index e80d2aa..a368d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2264=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2264,0x125));var _0x4226=function(_0x286120,_0x86b8dd){_0x286120=_0x286120-0x0;var _0x176f87=_0x2264[_0x286120];return _0x176f87;};'use strict';var moment=require(_0x4226('0x0'));var Sequelize=require(_0x4226('0x1'));module[_0x4226('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4226('0x3')],'unique':_0x4226('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4226('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4226('0x4')}};
\ No newline at end of file
+var _0x4667=['contactListQueue','moment','sequelize','STRING','INTEGER'];(function(_0x444655,_0x1c7076){var _0x21b8f4=function(_0x1dc5f1){while(--_0x1dc5f1){_0x444655['push'](_0x444655['shift']());}};_0x21b8f4(++_0x1c7076);}(_0x4667,0x10f));var _0x7466=function(_0x4d4614,_0x322855){_0x4d4614=_0x4d4614-0x0;var _0x22ba77=_0x4667[_0x4d4614];return _0x22ba77;};'use strict';var moment=require(_0x7466('0x0'));var Sequelize=require(_0x7466('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7466('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x7466('0x3')],'unique':_0x7466('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7466('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
index 4e450a6..6f25b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d5f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','CmHopperBlack','findAll','rows','catch','show','find','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x4d5f,0x82));var _0xf4d5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4d5f[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xf4d5('0x0'));var rimraf=require(_0xf4d5('0x1'));var zipdir=require(_0xf4d5('0x2'));var jsonpatch=require(_0xf4d5('0x3'));var rp=require(_0xf4d5('0x4'));var moment=require(_0xf4d5('0x5'));var BPromise=require(_0xf4d5('0x6'));var Mustache=require('mustache');var util=require(_0xf4d5('0x7'));var path=require(_0xf4d5('0x8'));var sox=require('sox');var csv=require(_0xf4d5('0x9'));var ejs=require(_0xf4d5('0xa'));var fs=require('fs');var fs_extra=require(_0xf4d5('0xb'));var _=require(_0xf4d5('0xc'));var squel=require(_0xf4d5('0xd'));var crypto=require(_0xf4d5('0xe'));var jsforce=require(_0xf4d5('0xf'));var deskjs=require(_0xf4d5('0x10'));var toCsv=require(_0xf4d5('0x9'));var querystring=require(_0xf4d5('0x11'));var Papa=require('papaparse');var Redis=require(_0xf4d5('0x12'));var authService=require(_0xf4d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf4d5('0x14'));var hardwareService=require(_0xf4d5('0x15'));var logger=require(_0xf4d5('0x16'))(_0xf4d5('0x17'));var utils=require(_0xf4d5('0x18'));var config=require(_0xf4d5('0x19'));var licenseUtil=require(_0xf4d5('0x1a'));var db=require(_0xf4d5('0x1b'))['db'];function respondWithStatusCode(_0x4e8ba3,_0x450415){_0x450415=_0x450415||0xcc;return function(_0x24267b){if(_0x24267b){return _0x4e8ba3[_0xf4d5('0x1c')](_0x450415);}return _0x4e8ba3[_0xf4d5('0x1d')](_0x450415)[_0xf4d5('0x1e')]();};}function respondWithResult(_0x2d35ce,_0x2dddb6){_0x2dddb6=_0x2dddb6||0xc8;return function(_0x4066b5){if(_0x4066b5){return _0x2d35ce[_0xf4d5('0x1d')](_0x2dddb6)[_0xf4d5('0x1f')](_0x4066b5);}};}function respondWithFilteredResult(_0x1d6ee0,_0x5d7314){return function(_0x8f2f44){if(_0x8f2f44){var _0x941e63=typeof _0x5d7314[_0xf4d5('0x20')]==='undefined'&&typeof _0x5d7314[_0xf4d5('0x21')]==='undefined';var _0x1a11a3=_0x8f2f44[_0xf4d5('0x22')];var _0x1ee345=_0x941e63?0x0:_0x5d7314['offset'];var _0x212a7b=_0x941e63?_0x8f2f44[_0xf4d5('0x22')]:_0x5d7314[_0xf4d5('0x20')]+_0x5d7314[_0xf4d5('0x21')];var _0x3ecff6;if(_0x212a7b>=_0x1a11a3){_0x212a7b=_0x1a11a3;_0x3ecff6=0xc8;}else{_0x3ecff6=0xce;}_0x1d6ee0[_0xf4d5('0x1d')](_0x3ecff6);return _0x1d6ee0[_0xf4d5('0x23')](_0xf4d5('0x24'),_0x1ee345+'-'+_0x212a7b+'/'+_0x1a11a3)['json'](_0x8f2f44);}return null;};}function patchUpdates(_0x2b1d11){return function(_0x5e2031){try{jsonpatch[_0xf4d5('0x25')](_0x5e2031,_0x2b1d11,!![]);}catch(_0x3fe657){return BPromise[_0xf4d5('0x26')](_0x3fe657);}return _0x5e2031[_0xf4d5('0x27')]();};}function saveUpdates(_0x4882ec,_0x35fb24){return function(_0x4bb80b){if(_0x4bb80b){return _0x4bb80b['update'](_0x4882ec)[_0xf4d5('0x28')](function(_0xf704c){return _0xf704c;});}return null;};}function removeEntity(_0x157890,_0x29066b){return function(_0x2c5c7a){if(_0x2c5c7a){return _0x2c5c7a[_0xf4d5('0x29')]()[_0xf4d5('0x28')](function(){_0x157890[_0xf4d5('0x1d')](0xcc)[_0xf4d5('0x1e')]();});}};}function handleEntityNotFound(_0x5ee87f,_0xca4d48){return function(_0x199085){if(!_0x199085){_0x5ee87f[_0xf4d5('0x1c')](0x194);}return _0x199085;};}function handleError(_0x500283,_0x38d9bd){_0x38d9bd=_0x38d9bd||0x1f4;return function(_0x265323){logger['error'](_0x265323['stack']);if(_0x265323[_0xf4d5('0x2a')]){delete _0x265323[_0xf4d5('0x2a')];}_0x500283['status'](_0x38d9bd)['send'](_0x265323);};}exports[_0xf4d5('0x2b')]=function(_0x459f5f,_0x54c6fa){var _0x4a6fc8={},_0x57b600={},_0x335083={'count':0x0,'rows':[]};var _0x51273c=_['map'](db['CmHopperBlack'][_0xf4d5('0x2c')],function(_0x2d5f7a){return{'name':_0x2d5f7a[_0xf4d5('0x2d')],'type':_0x2d5f7a['type'][_0xf4d5('0x2e')]};});_0x57b600[_0xf4d5('0x2f')]=_[_0xf4d5('0x30')](_0x51273c,_0xf4d5('0x2a'));_0x57b600[_0xf4d5('0x31')]=_[_0xf4d5('0x32')](_0x459f5f[_0xf4d5('0x31')]);_0x57b600[_0xf4d5('0x33')]=_['intersection'](_0x57b600[_0xf4d5('0x2f')],_0x57b600[_0xf4d5('0x31')]);_0x4a6fc8['attributes']=_[_0xf4d5('0x34')](_0x57b600[_0xf4d5('0x2f')],qs[_0xf4d5('0x35')](_0x459f5f['query'][_0xf4d5('0x35')]));_0x4a6fc8[_0xf4d5('0x36')]=_0x4a6fc8[_0xf4d5('0x36')][_0xf4d5('0x37')]?_0x4a6fc8[_0xf4d5('0x36')]:_0x57b600[_0xf4d5('0x2f')];if(!_0x459f5f[_0xf4d5('0x31')]['hasOwnProperty']('nolimit')){_0x4a6fc8[_0xf4d5('0x21')]=qs[_0xf4d5('0x21')](_0x459f5f[_0xf4d5('0x31')][_0xf4d5('0x21')]);_0x4a6fc8[_0xf4d5('0x20')]=qs[_0xf4d5('0x20')](_0x459f5f[_0xf4d5('0x31')][_0xf4d5('0x20')]);}_0x4a6fc8[_0xf4d5('0x38')]=qs['sort'](_0x459f5f[_0xf4d5('0x31')][_0xf4d5('0x39')]);_0x4a6fc8[_0xf4d5('0x3a')]=qs[_0xf4d5('0x33')](_[_0xf4d5('0x3b')](_0x459f5f[_0xf4d5('0x31')],_0x57b600[_0xf4d5('0x33')]),_0x51273c);if(_0x459f5f['query'][_0xf4d5('0x3c')]){_0x4a6fc8[_0xf4d5('0x3a')]=_[_0xf4d5('0x3d')](_0x4a6fc8[_0xf4d5('0x3a')],{'$or':_['map'](_0x51273c,function(_0x864847){if(_0x864847['type']!=='VIRTUAL'){var _0x1788e0={};_0x1788e0[_0x864847[_0xf4d5('0x2a')]]={'$like':'%'+_0x459f5f[_0xf4d5('0x31')][_0xf4d5('0x3c')]+'%'};return _0x1788e0;}})});}_0x4a6fc8=_[_0xf4d5('0x3d')]({},_0x4a6fc8,_0x459f5f[_0xf4d5('0x3e')]);var _0x1cdc7a={'where':_0x4a6fc8[_0xf4d5('0x3a')]};return db['CmHopperBlack'][_0xf4d5('0x22')](_0x1cdc7a)[_0xf4d5('0x28')](function(_0x34e65b){_0x335083[_0xf4d5('0x22')]=_0x34e65b;if(_0x459f5f[_0xf4d5('0x31')][_0xf4d5('0x3f')]){_0x4a6fc8['include']=[{'all':!![]}];}return db[_0xf4d5('0x40')][_0xf4d5('0x41')](_0x4a6fc8);})[_0xf4d5('0x28')](function(_0x4bddef){_0x335083[_0xf4d5('0x42')]=_0x4bddef;return _0x335083;})[_0xf4d5('0x28')](respondWithFilteredResult(_0x54c6fa,_0x4a6fc8))[_0xf4d5('0x43')](handleError(_0x54c6fa,null));};exports[_0xf4d5('0x44')]=function(_0x5bca42,_0x1c813d){var _0x4d558e={'raw':!![],'where':{'id':_0x5bca42['params']['id']}},_0x8edd25={};_0x8edd25[_0xf4d5('0x2f')]=_[_0xf4d5('0x32')](db['CmHopperBlack']['rawAttributes']);_0x8edd25[_0xf4d5('0x31')]=_['keys'](_0x5bca42[_0xf4d5('0x31')]);_0x8edd25['filters']=_['intersection'](_0x8edd25['model'],_0x8edd25['query']);_0x4d558e['attributes']=_['intersection'](_0x8edd25['model'],qs[_0xf4d5('0x35')](_0x5bca42[_0xf4d5('0x31')][_0xf4d5('0x35')]));_0x4d558e[_0xf4d5('0x36')]=_0x4d558e['attributes'][_0xf4d5('0x37')]?_0x4d558e[_0xf4d5('0x36')]:_0x8edd25[_0xf4d5('0x2f')];if(_0x5bca42[_0xf4d5('0x31')]['includeAll']){_0x4d558e['include']=[{'all':!![]}];}_0x4d558e=_[_0xf4d5('0x3d')]({},_0x4d558e,_0x5bca42[_0xf4d5('0x3e')]);return db[_0xf4d5('0x40')][_0xf4d5('0x45')](_0x4d558e)[_0xf4d5('0x28')](handleEntityNotFound(_0x1c813d,null))[_0xf4d5('0x28')](respondWithResult(_0x1c813d,null))[_0xf4d5('0x43')](handleError(_0x1c813d,null));};exports[_0xf4d5('0x46')]=function(_0x300e8e,_0x34c9b1){if(_0x300e8e[_0xf4d5('0x47')]['id']){delete _0x300e8e[_0xf4d5('0x47')]['id'];}return db[_0xf4d5('0x40')][_0xf4d5('0x45')]({'where':{'id':_0x300e8e['params']['id']}})['then'](handleEntityNotFound(_0x34c9b1,null))['then'](saveUpdates(_0x300e8e[_0xf4d5('0x47')],null))['then'](respondWithResult(_0x34c9b1,null))[_0xf4d5('0x43')](handleError(_0x34c9b1,null));};exports['destroy']=function(_0x853b7d,_0x939bca){return db[_0xf4d5('0x40')][_0xf4d5('0x45')]({'where':{'id':_0x853b7d[_0xf4d5('0x48')]['id']}})['then'](handleEntityNotFound(_0x939bca,null))[_0xf4d5('0x28')](removeEntity(_0x939bca,null))[_0xf4d5('0x43')](handleError(_0x939bca,null));};exports[_0xf4d5('0x49')]=function(_0x29f507,_0x46b2d3){return db['CmHopperBlack'][_0xf4d5('0x49')]()['then'](respondWithResult(_0x46b2d3,null))[_0xf4d5('0x43')](handleError(_0x46b2d3,null));};
\ No newline at end of file
+var _0xcce7=['update','then','destroy','sendStatus','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x48f32b,_0x17baa6){var _0x5ab2be=function(_0x502f19){while(--_0x502f19){_0x48f32b['push'](_0x48f32b['shift']());}};_0x5ab2be(++_0x17baa6);}(_0xcce7,0x115));var _0x7cce=function(_0xd9644e,_0x1686c6){_0xd9644e=_0xd9644e-0x0;var _0x5da124=_0xcce7[_0xd9644e];return _0x5da124;};'use strict';var emlformat=require(_0x7cce('0x0'));var rimraf=require(_0x7cce('0x1'));var zipdir=require(_0x7cce('0x2'));var jsonpatch=require(_0x7cce('0x3'));var rp=require(_0x7cce('0x4'));var moment=require(_0x7cce('0x5'));var BPromise=require(_0x7cce('0x6'));var Mustache=require(_0x7cce('0x7'));var util=require(_0x7cce('0x8'));var path=require(_0x7cce('0x9'));var sox=require(_0x7cce('0xa'));var csv=require(_0x7cce('0xb'));var ejs=require(_0x7cce('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cce('0xd'));var squel=require('squel');var crypto=require(_0x7cce('0xe'));var jsforce=require(_0x7cce('0xf'));var deskjs=require(_0x7cce('0x10'));var toCsv=require(_0x7cce('0xb'));var querystring=require(_0x7cce('0x11'));var Papa=require(_0x7cce('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7cce('0x13'));var as=require(_0x7cce('0x14'));var hardwareService=require(_0x7cce('0x15'));var logger=require(_0x7cce('0x16'))(_0x7cce('0x17'));var utils=require(_0x7cce('0x18'));var config=require(_0x7cce('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cce('0x1a'))['db'];function respondWithStatusCode(_0xff1bb3,_0x4bebf5){_0x4bebf5=_0x4bebf5||0xcc;return function(_0x4ac890){if(_0x4ac890){return _0xff1bb3['sendStatus'](_0x4bebf5);}return _0xff1bb3['status'](_0x4bebf5)[_0x7cce('0x1b')]();};}function respondWithResult(_0x481903,_0x1f6f4f){_0x1f6f4f=_0x1f6f4f||0xc8;return function(_0x210da3){if(_0x210da3){return _0x481903[_0x7cce('0x1c')](_0x1f6f4f)[_0x7cce('0x1d')](_0x210da3);}};}function respondWithFilteredResult(_0x5cc706,_0x369a60){return function(_0x711c2e){if(_0x711c2e){var _0x3885f5=typeof _0x369a60[_0x7cce('0x1e')]===_0x7cce('0x1f')&&typeof _0x369a60[_0x7cce('0x20')]==='undefined';var _0x508358=_0x711c2e['count'];var _0x116a4f=_0x3885f5?0x0:_0x369a60[_0x7cce('0x1e')];var _0x5aeffb=_0x3885f5?_0x711c2e[_0x7cce('0x21')]:_0x369a60['offset']+_0x369a60['limit'];var _0x180cec;if(_0x5aeffb>=_0x508358){_0x5aeffb=_0x508358;_0x180cec=0xc8;}else{_0x180cec=0xce;}_0x5cc706[_0x7cce('0x1c')](_0x180cec);return _0x5cc706[_0x7cce('0x22')](_0x7cce('0x23'),_0x116a4f+'-'+_0x5aeffb+'/'+_0x508358)[_0x7cce('0x1d')](_0x711c2e);}return null;};}function patchUpdates(_0x5068cd){return function(_0x32034d){try{jsonpatch[_0x7cce('0x24')](_0x32034d,_0x5068cd,!![]);}catch(_0xabaa6){return BPromise[_0x7cce('0x25')](_0xabaa6);}return _0x32034d[_0x7cce('0x26')]();};}function saveUpdates(_0x29e4eb,_0x364af1){return function(_0x3036b1){if(_0x3036b1){return _0x3036b1[_0x7cce('0x27')](_0x29e4eb)[_0x7cce('0x28')](function(_0x5a91a9){return _0x5a91a9;});}return null;};}function removeEntity(_0xc3dd9d,_0x3d7bc5){return function(_0x5d0fe9){if(_0x5d0fe9){return _0x5d0fe9[_0x7cce('0x29')]()[_0x7cce('0x28')](function(){_0xc3dd9d[_0x7cce('0x1c')](0xcc)[_0x7cce('0x1b')]();});}};}function handleEntityNotFound(_0x4f4987,_0x2416c6){return function(_0x70f716){if(!_0x70f716){_0x4f4987[_0x7cce('0x2a')](0x194);}return _0x70f716;};}function handleError(_0x5e66c5,_0x32f45e){_0x32f45e=_0x32f45e||0x1f4;return function(_0x3b3466){logger[_0x7cce('0x2b')](_0x3b3466['stack']);if(_0x3b3466[_0x7cce('0x2c')]){delete _0x3b3466['name'];}_0x5e66c5[_0x7cce('0x1c')](_0x32f45e)[_0x7cce('0x2d')](_0x3b3466);};}exports[_0x7cce('0x2e')]=function(_0x227b9e,_0x362b57){var _0x34921d={},_0x52c8ea={},_0xf1df27={'count':0x0,'rows':[]};var _0x4187ce=_[_0x7cce('0x2f')](db[_0x7cce('0x30')][_0x7cce('0x31')],function(_0x780171){return{'name':_0x780171[_0x7cce('0x32')],'type':_0x780171['type']['key']};});_0x52c8ea[_0x7cce('0x33')]=_[_0x7cce('0x2f')](_0x4187ce,_0x7cce('0x2c'));_0x52c8ea[_0x7cce('0x34')]=_[_0x7cce('0x35')](_0x227b9e[_0x7cce('0x34')]);_0x52c8ea[_0x7cce('0x36')]=_[_0x7cce('0x37')](_0x52c8ea[_0x7cce('0x33')],_0x52c8ea[_0x7cce('0x34')]);_0x34921d[_0x7cce('0x38')]=_[_0x7cce('0x37')](_0x52c8ea[_0x7cce('0x33')],qs[_0x7cce('0x39')](_0x227b9e[_0x7cce('0x34')]['fields']));_0x34921d[_0x7cce('0x38')]=_0x34921d[_0x7cce('0x38')][_0x7cce('0x3a')]?_0x34921d[_0x7cce('0x38')]:_0x52c8ea[_0x7cce('0x33')];if(!_0x227b9e[_0x7cce('0x34')][_0x7cce('0x3b')](_0x7cce('0x3c'))){_0x34921d[_0x7cce('0x20')]=qs['limit'](_0x227b9e[_0x7cce('0x34')][_0x7cce('0x20')]);_0x34921d[_0x7cce('0x1e')]=qs[_0x7cce('0x1e')](_0x227b9e[_0x7cce('0x34')]['offset']);}_0x34921d[_0x7cce('0x3d')]=qs[_0x7cce('0x3e')](_0x227b9e['query'][_0x7cce('0x3e')]);_0x34921d[_0x7cce('0x3f')]=qs[_0x7cce('0x36')](_[_0x7cce('0x40')](_0x227b9e[_0x7cce('0x34')],_0x52c8ea[_0x7cce('0x36')]),_0x4187ce);if(_0x227b9e[_0x7cce('0x34')][_0x7cce('0x41')]){_0x34921d[_0x7cce('0x3f')]=_[_0x7cce('0x42')](_0x34921d[_0x7cce('0x3f')],{'$or':_[_0x7cce('0x2f')](_0x4187ce,function(_0xbdc4a3){if(_0xbdc4a3['type']!==_0x7cce('0x43')){var _0x547c42={};_0x547c42[_0xbdc4a3[_0x7cce('0x2c')]]={'$like':'%'+_0x227b9e[_0x7cce('0x34')][_0x7cce('0x41')]+'%'};return _0x547c42;}})});}_0x34921d=_[_0x7cce('0x42')]({},_0x34921d,_0x227b9e['options']);var _0x26db96={'where':_0x34921d[_0x7cce('0x3f')]};return db[_0x7cce('0x30')][_0x7cce('0x21')](_0x26db96)['then'](function(_0x4b2c13){_0xf1df27[_0x7cce('0x21')]=_0x4b2c13;if(_0x227b9e[_0x7cce('0x34')]['includeAll']){_0x34921d[_0x7cce('0x44')]=[{'all':!![]}];}return db[_0x7cce('0x30')][_0x7cce('0x45')](_0x34921d);})[_0x7cce('0x28')](function(_0x397124){_0xf1df27[_0x7cce('0x46')]=_0x397124;return _0xf1df27;})['then'](respondWithFilteredResult(_0x362b57,_0x34921d))[_0x7cce('0x47')](handleError(_0x362b57,null));};exports[_0x7cce('0x48')]=function(_0x562edb,_0x2a9cc4){var _0x1c1243={'raw':!![],'where':{'id':_0x562edb['params']['id']}},_0x359bda={};_0x359bda['model']=_[_0x7cce('0x35')](db[_0x7cce('0x30')][_0x7cce('0x31')]);_0x359bda[_0x7cce('0x34')]=_[_0x7cce('0x35')](_0x562edb[_0x7cce('0x34')]);_0x359bda[_0x7cce('0x36')]=_[_0x7cce('0x37')](_0x359bda['model'],_0x359bda[_0x7cce('0x34')]);_0x1c1243[_0x7cce('0x38')]=_['intersection'](_0x359bda[_0x7cce('0x33')],qs['fields'](_0x562edb[_0x7cce('0x34')][_0x7cce('0x39')]));_0x1c1243[_0x7cce('0x38')]=_0x1c1243[_0x7cce('0x38')][_0x7cce('0x3a')]?_0x1c1243[_0x7cce('0x38')]:_0x359bda[_0x7cce('0x33')];if(_0x562edb[_0x7cce('0x34')][_0x7cce('0x49')]){_0x1c1243['include']=[{'all':!![]}];}_0x1c1243=_[_0x7cce('0x42')]({},_0x1c1243,_0x562edb[_0x7cce('0x4a')]);return db[_0x7cce('0x30')][_0x7cce('0x4b')](_0x1c1243)['then'](handleEntityNotFound(_0x2a9cc4,null))[_0x7cce('0x28')](respondWithResult(_0x2a9cc4,null))[_0x7cce('0x47')](handleError(_0x2a9cc4,null));};exports[_0x7cce('0x27')]=function(_0x246931,_0xc51620){if(_0x246931[_0x7cce('0x4c')]['id']){delete _0x246931[_0x7cce('0x4c')]['id'];}return db[_0x7cce('0x30')][_0x7cce('0x4b')]({'where':{'id':_0x246931['params']['id']}})[_0x7cce('0x28')](handleEntityNotFound(_0xc51620,null))[_0x7cce('0x28')](saveUpdates(_0x246931[_0x7cce('0x4c')],null))[_0x7cce('0x28')](respondWithResult(_0xc51620,null))[_0x7cce('0x47')](handleError(_0xc51620,null));};exports['destroy']=function(_0x3b73a0,_0x2ceb21){return db['CmHopperBlack'][_0x7cce('0x4b')]({'where':{'id':_0x3b73a0[_0x7cce('0x4d')]['id']}})[_0x7cce('0x28')](handleEntityNotFound(_0x2ceb21,null))['then'](removeEntity(_0x2ceb21,null))['catch'](handleError(_0x2ceb21,null));};exports['describe']=function(_0x4c3f85,_0x12c807){return db[_0x7cce('0x30')][_0x7cce('0x4e')]()[_0x7cce('0x28')](respondWithResult(_0x12c807,null))[_0x7cce('0x47')](handleError(_0x12c807,null));};
\ No newline at end of file
index 963de20..d8f343f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40bf=['../../config/logger','api','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x4efa28,_0x4e1805){var _0x599196=function(_0x2e80d9){while(--_0x2e80d9){_0x4efa28['push'](_0x4efa28['shift']());}};_0x599196(++_0x4e1805);}(_0x40bf,0x1a7));var _0xf40b=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x40bf[_0x480bc8];return _0x28c245;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf40b('0x0'))(_0xf40b('0x1'));var moment=require('moment');var BPromise=require(_0xf40b('0x2'));var rp=require(_0xf40b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf40b('0x4'));var config=require('../../config/environment');var attributes=require(_0xf40b('0x5'));module[_0xf40b('0x6')]=function(_0x26ece2,_0xf0fce9){return _0x26ece2[_0xf40b('0x7')](_0xf40b('0x8'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cf0=['api','moment','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x2cd708,_0x40810a){var _0x5dbdaf=function(_0x275349){while(--_0x275349){_0x2cd708['push'](_0x2cd708['shift']());}};_0x5dbdaf(++_0x40810a);}(_0x7cf0,0x76));var _0x07cf=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7cf0[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x07cf('0x0'));var util=require(_0x07cf('0x1'));var logger=require(_0x07cf('0x2'))(_0x07cf('0x3'));var moment=require(_0x07cf('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x07cf('0x5'));var config=require(_0x07cf('0x6'));var attributes=require(_0x07cf('0x7'));module[_0x07cf('0x8')]=function(_0x49a6fc,_0x87e9aa){return _0x49a6fc['define'](_0x07cf('0x9'),attributes,{'tableName':_0x07cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a868802..d5d12df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022b=['randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','include','map','model','stringify','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','util'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x022b,0x1b2));var _0xb022=function(_0x1be3e6,_0x584b34){_0x1be3e6=_0x1be3e6-0x0;var _0xb530ff=_0x022b[_0x1be3e6];return _0xb530ff;};'use strict';var _=require('lodash');var util=require(_0xb022('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb022('0x1'));var fs=require('fs');var Redis=require(_0xb022('0x2'));var db=require(_0xb022('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb022('0x4'));var jayson=require(_0xb022('0x5'));var client=jayson[_0xb022('0x6')][_0xb022('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3e2c0a,_0x74337c,_0x3fc3ef){return new BPromise(function(_0x3ee019,_0x1f46c5){return client['request'](_0x3e2c0a,_0x3fc3ef)[_0xb022('0x8')](function(_0x1e1886){logger[_0xb022('0x9')](_0xb022('0xa'),_0x74337c,_0xb022('0xb'));logger[_0xb022('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x74337c,_0xb022('0xb'),JSON['stringify'](_0x1e1886));if(_0x1e1886[_0xb022('0xd')]){if(_0x1e1886['error']['code']===0x1f4){logger[_0xb022('0xd')](_0xb022('0xa'),_0x74337c,_0x1e1886[_0xb022('0xd')][_0xb022('0xe')]);return _0x1f46c5(_0x1e1886[_0xb022('0xd')][_0xb022('0xe')]);}logger[_0xb022('0xd')](_0xb022('0xa'),_0x74337c,_0x1e1886[_0xb022('0xd')]['message']);return _0x3ee019(_0x1e1886[_0xb022('0xd')][_0xb022('0xe')]);}else{logger[_0xb022('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x74337c,'request\x20sent');_0x3ee019(_0x1e1886[_0xb022('0xf')][_0xb022('0xe')]);}})[_0xb022('0x10')](function(_0x179388){logger['error'](_0xb022('0xa'),_0x74337c,_0x179388);_0x1f46c5(_0x179388);});});}exports[_0xb022('0x11')]=function(_0x2a50ea){var _0x2d0d1f=this;return new Promise(function(_0x13de48,_0x28f216){return db[_0xb022('0x12')]['findAll']({'raw':_0x2a50ea[_0xb022('0x13')]?_0x2a50ea[_0xb022('0x13')][_0xb022('0x14')]===undefined?!![]:![]:!![],'where':_0x2a50ea[_0xb022('0x13')]?_0x2a50ea[_0xb022('0x13')][_0xb022('0x15')]||null:null,'attributes':_0x2a50ea['options']?_0x2a50ea['options']['attributes']||null:null,'limit':_0x2a50ea[_0xb022('0x13')]?_0x2a50ea[_0xb022('0x13')]['limit']||null:null,'include':_0x2a50ea[_0xb022('0x13')]?_0x2a50ea[_0xb022('0x13')][_0xb022('0x16')]?_['map'](_0x2a50ea[_0xb022('0x13')][_0xb022('0x16')],function(_0xf680de){return{'model':db[_0xf680de['model']],'as':_0xf680de['as'],'attributes':_0xf680de['attributes'],'include':_0xf680de[_0xb022('0x16')]?_[_0xb022('0x17')](_0xf680de[_0xb022('0x16')],function(_0x2e9177){return{'model':db[_0x2e9177[_0xb022('0x18')]],'as':_0x2e9177['as'],'attributes':_0x2e9177['attributes'],'include':_0x2e9177[_0xb022('0x16')]?_['map'](_0x2e9177[_0xb022('0x16')],function(_0x4bf73a){return{'model':db[_0x4bf73a[_0xb022('0x18')]],'as':_0x4bf73a['as'],'attributes':_0x4bf73a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5bfa){logger[_0xb022('0x9')](_0xb022('0x11'),_0x2a50ea);logger[_0xb022('0xc')](_0xb022('0x11'),_0x2a50ea,JSON[_0xb022('0x19')](_0x4e5bfa));_0x13de48(_0x4e5bfa);})[_0xb022('0x10')](function(_0x3e3c56){logger[_0xb022('0xd')](_0xb022('0x11'),_0x3e3c56['message'],_0x2a50ea);_0x28f216(_0x2d0d1f[_0xb022('0xd')](0x1f4,_0x3e3c56[_0xb022('0xe')]));});});};exports[_0xb022('0x1a')]=function(_0x3b06fe){var _0x2b0c47=this;return new Promise(function(_0x110bbe,_0x4a59b1){return db['CmHopperBlack']['update'](_0x3b06fe['body'],{'raw':_0x3b06fe[_0xb022('0x13')]?_0x3b06fe[_0xb022('0x13')][_0xb022('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b06fe[_0xb022('0x13')]?_0x3b06fe[_0xb022('0x13')][_0xb022('0x15')]||null:null,'attributes':_0x3b06fe[_0xb022('0x13')]?_0x3b06fe[_0xb022('0x13')]['attributes']||null:null,'limit':_0x3b06fe[_0xb022('0x13')]?_0x3b06fe[_0xb022('0x13')]['limit']||null:null})[_0xb022('0x8')](function(_0x391bfc){logger[_0xb022('0x9')](_0xb022('0x1a'),_0x3b06fe);logger[_0xb022('0xc')]('UpdateCmHopperBlack',_0x3b06fe,JSON[_0xb022('0x19')](_0x391bfc));_0x110bbe(_0x391bfc);})['catch'](function(_0x41ff3f){logger['error'](_0xb022('0x1a'),_0x41ff3f[_0xb022('0xe')],_0x3b06fe);_0x4a59b1(_0x2b0c47['error'](0x1f4,_0x41ff3f[_0xb022('0xe')]));});});};exports['DestroyCmHopperBlack']=function(_0x2b6c15){var _0x175be3=this;return new Promise(function(_0x119530,_0x5cf080){return db[_0xb022('0x12')][_0xb022('0x1b')]({'where':_0x2b6c15[_0xb022('0x13')]?_0x2b6c15[_0xb022('0x13')][_0xb022('0x15')]||null:null})[_0xb022('0x8')](function(_0x1d975e){logger[_0xb022('0x9')](_0xb022('0x1c'),_0x2b6c15);logger[_0xb022('0xc')]('DestroyCmHopperBlack',_0x2b6c15,JSON[_0xb022('0x19')](_0x1d975e));_0x119530(_0x1d975e);})[_0xb022('0x10')](function(_0x400413){logger['error'](_0xb022('0x1c'),_0x400413['message'],_0x2b6c15);_0x5cf080(_0x175be3['error'](0x1f4,_0x400413[_0xb022('0xe')]));});});};
\ No newline at end of file
+var _0x38be=['raw','where','limit','DestroyCmHopperBlack','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetCmHopperBlack','CmHopperBlack','options','attributes','include','map','model','UpdateCmHopperBlack','update','body'];(function(_0x32a998,_0x30cc2c){var _0x2b503d=function(_0x9e4313){while(--_0x9e4313){_0x32a998['push'](_0x32a998['shift']());}};_0x2b503d(++_0x30cc2c);}(_0x38be,0xae));var _0xe38b=function(_0x4c5cd4,_0x268643){_0x4c5cd4=_0x4c5cd4-0x0;var _0x210bcf=_0x38be[_0x4c5cd4];return _0x210bcf;};'use strict';var _=require(_0xe38b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe38b('0x1'));var fs=require('fs');var Redis=require(_0xe38b('0x2'));var db=require(_0xe38b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe38b('0x4'));var jayson=require(_0xe38b('0x5'));var client=jayson[_0xe38b('0x6')][_0xe38b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15552e,_0x5180ca,_0x8b74ec){return new BPromise(function(_0x2774b5,_0x61029f){return client[_0xe38b('0x8')](_0x15552e,_0x8b74ec)[_0xe38b('0x9')](function(_0x3a1e64){logger[_0xe38b('0xa')](_0xe38b('0xb'),_0x5180ca,'request\x20sent');logger[_0xe38b('0xc')](_0xe38b('0xd'),_0x5180ca,'request\x20sent',JSON[_0xe38b('0xe')](_0x3a1e64));if(_0x3a1e64[_0xe38b('0xf')]){if(_0x3a1e64[_0xe38b('0xf')][_0xe38b('0x10')]===0x1f4){logger['error'](_0xe38b('0xb'),_0x5180ca,_0x3a1e64[_0xe38b('0xf')][_0xe38b('0x11')]);return _0x61029f(_0x3a1e64[_0xe38b('0xf')]['message']);}logger['error'](_0xe38b('0xb'),_0x5180ca,_0x3a1e64['error']['message']);return _0x2774b5(_0x3a1e64[_0xe38b('0xf')]['message']);}else{logger[_0xe38b('0xa')](_0xe38b('0xb'),_0x5180ca,_0xe38b('0x12'));_0x2774b5(_0x3a1e64['result']['message']);}})[_0xe38b('0x13')](function(_0xdd4941){logger[_0xe38b('0xf')](_0xe38b('0xb'),_0x5180ca,_0xdd4941);_0x61029f(_0xdd4941);});});}exports[_0xe38b('0x14')]=function(_0x1f36e8){var _0x5d8437=this;return new Promise(function(_0x4c5527,_0x5b9475){return db[_0xe38b('0x15')]['findAll']({'raw':_0x1f36e8[_0xe38b('0x16')]?_0x1f36e8['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f36e8[_0xe38b('0x16')]?_0x1f36e8['options']['where']||null:null,'attributes':_0x1f36e8[_0xe38b('0x16')]?_0x1f36e8['options'][_0xe38b('0x17')]||null:null,'limit':_0x1f36e8[_0xe38b('0x16')]?_0x1f36e8[_0xe38b('0x16')]['limit']||null:null,'include':_0x1f36e8[_0xe38b('0x16')]?_0x1f36e8[_0xe38b('0x16')]['include']?_['map'](_0x1f36e8[_0xe38b('0x16')][_0xe38b('0x18')],function(_0x1dd57c){return{'model':db[_0x1dd57c['model']],'as':_0x1dd57c['as'],'attributes':_0x1dd57c[_0xe38b('0x17')],'include':_0x1dd57c[_0xe38b('0x18')]?_[_0xe38b('0x19')](_0x1dd57c[_0xe38b('0x18')],function(_0x36e87a){return{'model':db[_0x36e87a[_0xe38b('0x1a')]],'as':_0x36e87a['as'],'attributes':_0x36e87a[_0xe38b('0x17')],'include':_0x36e87a[_0xe38b('0x18')]?_['map'](_0x36e87a[_0xe38b('0x18')],function(_0x16f527){return{'model':db[_0x16f527[_0xe38b('0x1a')]],'as':_0x16f527['as'],'attributes':_0x16f527[_0xe38b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2798e5){logger['info'](_0xe38b('0x14'),_0x1f36e8);logger[_0xe38b('0xc')](_0xe38b('0x14'),_0x1f36e8,JSON[_0xe38b('0xe')](_0x2798e5));_0x4c5527(_0x2798e5);})[_0xe38b('0x13')](function(_0x4b2dee){logger[_0xe38b('0xf')](_0xe38b('0x14'),_0x4b2dee[_0xe38b('0x11')],_0x1f36e8);_0x5b9475(_0x5d8437[_0xe38b('0xf')](0x1f4,_0x4b2dee[_0xe38b('0x11')]));});});};exports[_0xe38b('0x1b')]=function(_0xbaaebb){var _0xadde22=this;return new Promise(function(_0x56c8a6,_0x2b3396){return db['CmHopperBlack'][_0xe38b('0x1c')](_0xbaaebb[_0xe38b('0x1d')],{'raw':_0xbaaebb[_0xe38b('0x16')]?_0xbaaebb['options'][_0xe38b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbaaebb[_0xe38b('0x16')]?_0xbaaebb['options'][_0xe38b('0x1f')]||null:null,'attributes':_0xbaaebb['options']?_0xbaaebb['options'][_0xe38b('0x17')]||null:null,'limit':_0xbaaebb[_0xe38b('0x16')]?_0xbaaebb['options'][_0xe38b('0x20')]||null:null})[_0xe38b('0x9')](function(_0x364d9c){logger[_0xe38b('0xa')](_0xe38b('0x1b'),_0xbaaebb);logger[_0xe38b('0xc')]('UpdateCmHopperBlack',_0xbaaebb,JSON[_0xe38b('0xe')](_0x364d9c));_0x56c8a6(_0x364d9c);})[_0xe38b('0x13')](function(_0x43dcd3){logger['error'](_0xe38b('0x1b'),_0x43dcd3[_0xe38b('0x11')],_0xbaaebb);_0x2b3396(_0xadde22[_0xe38b('0xf')](0x1f4,_0x43dcd3[_0xe38b('0x11')]));});});};exports[_0xe38b('0x21')]=function(_0x55e727){var _0xe31f26=this;return new Promise(function(_0xeb5c59,_0x3ff9a6){return db[_0xe38b('0x15')]['destroy']({'where':_0x55e727[_0xe38b('0x16')]?_0x55e727[_0xe38b('0x16')]['where']||null:null})[_0xe38b('0x9')](function(_0x1305f7){logger['info'](_0xe38b('0x21'),_0x55e727);logger['debug'](_0xe38b('0x21'),_0x55e727,JSON['stringify'](_0x1305f7));_0xeb5c59(_0x1305f7);})[_0xe38b('0x13')](function(_0x4d724d){logger[_0xe38b('0xf')]('DestroyCmHopperBlack',_0x4d724d[_0xe38b('0x11')],_0x55e727);_0x3ff9a6(_0xe31f26[_0xe38b('0xf')](0x1f4,_0x4d724d['message']));});});};
\ No newline at end of file
index 4f4fc93..de8a36d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x3c4b7e,_0x457424){var _0x31532a=function(_0x1e80f1){while(--_0x1e80f1){_0x3c4b7e['push'](_0x3c4b7e['shift']());}};_0x31532a(++_0x457424);}(_0x1db9,0x176));var _0x91db=function(_0x4a2670,_0x2ef1e7){_0x4a2670=_0x4a2670-0x0;var _0x4ecdf1=_0x1db9[_0x4a2670];return _0x4ecdf1;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router;
\ No newline at end of file
+var _0x53ec=['../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0x53ec,0x192));var _0xc53e=function(_0x1badc1,_0x19fd91){_0x1badc1=_0x1badc1-0x0;var _0x37e23d=_0x53ec[_0x1badc1];return _0x37e23d;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1857147..cedf195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec38=['BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds'];(function(_0x914b50,_0x462d60){var _0x4aa08f=function(_0x5a4dd6){while(--_0x5a4dd6){_0x914b50['push'](_0x914b50['shift']());}};_0x4aa08f(++_0x462d60);}(_0xec38,0x1da));var _0x8ec3=function(_0xc4e4b2,_0x522c41){_0xc4e4b2=_0xc4e4b2-0x0;var _0x11bdd4=_0xec38[_0xc4e4b2];return _0x11bdd4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8ec3('0x0'));module[_0x8ec3('0x1')]={'state':{'type':Sequelize[_0x8ec3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8ec3('0x3')]},'scheduledat':{'type':Sequelize[_0x8ec3('0x4')]},'countbusyretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8ec3('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8ec3('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8ec3('0x3')]},'calleridnum':{'type':Sequelize[_0x8ec3('0x3')]},'calleridname':{'type':Sequelize[_0x8ec3('0x3')]},'starttime':{'type':Sequelize[_0x8ec3('0x4')]},'responsetime':{'type':Sequelize[_0x8ec3('0x4')]},'answertime':{'type':Sequelize[_0x8ec3('0x4')]},'droptime':{'type':Sequelize[_0x8ec3('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8ec3('0x3')]},'campaign':{'type':Sequelize[_0x8ec3('0x3')]},'campaigntype':{'type':Sequelize[_0x8ec3('0x3')]},'membername':{'type':Sequelize[_0x8ec3('0x3')]},'reason':{'type':Sequelize[_0x8ec3('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8ec3('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8ec3('0x4')],'set':function(_0x189462){var _0x1facf6=this[_0x8ec3('0x5')]('endtime');if(_0x1facf6&&_0x189462){this[_0x8ec3('0x6')](_0x8ec3('0x7'),moment(_0x189462)[_0x8ec3('0x8')](moment(_0x1facf6),_0x8ec3('0x9')));}}},'amd':{'type':Sequelize[_0x8ec3('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8ec3('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8ec3('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8ec3('0x4')]},'callback':{'type':Sequelize[_0x8ec3('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8ec3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8ec3('0x4')]},'deleted':{'type':Sequelize[_0x8ec3('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8ec3('0x4')]},'recallme':{'type':Sequelize[_0x8ec3('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8ec3('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8ec3('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x999d=['exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x999d,0x90));var _0xd999=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x999d[_0x55cc58];return _0x26062e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd999('0x0')]={'state':{'type':Sequelize[_0xd999('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd999('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd999('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd999('0x2')]},'originatecalleridname':{'type':Sequelize[_0xd999('0x2')]},'calleridnum':{'type':Sequelize[_0xd999('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd999('0x3')]},'responsetime':{'type':Sequelize[_0xd999('0x3')]},'answertime':{'type':Sequelize[_0xd999('0x3')]},'droptime':{'type':Sequelize[_0xd999('0x3')]},'endtime':{'type':Sequelize[_0xd999('0x3')]},'ringtime':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd999('0x2')]},'campaign':{'type':Sequelize[_0xd999('0x2')]},'campaigntype':{'type':Sequelize[_0xd999('0x2')]},'membername':{'type':Sequelize[_0xd999('0x2')]},'reason':{'type':Sequelize[_0xd999('0x2')]},'disposition':{'type':Sequelize[_0xd999('0x2')]},'secondDisposition':{'type':Sequelize[_0xd999('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd999('0x2')]},'dispositionat':{'type':Sequelize[_0xd999('0x3')],'set':function(_0x4d0bc0){var _0x483713=this[_0xd999('0x4')](_0xd999('0x5'));if(_0x483713&&_0x4d0bc0){this['setDataValue'](_0xd999('0x6'),moment(_0x4d0bc0)[_0xd999('0x7')](moment(_0x483713),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd999('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd999('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xd999('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd999('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd999('0x3')]},'deleted':{'type':Sequelize[_0xd999('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd999('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd999('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd999('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 8983bf7..8e94486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x187006,_0x25b461){var _0x328105=function(_0xccc828){while(--_0xccc828){_0x187006['push'](_0x187006['shift']());}};_0x328105(++_0x25b461);}(_0x0295,0x1f0));var _0x5029=function(_0x5b7584,_0x5bedb3){_0x5b7584=_0x5b7584-0x0;var _0x19397c=_0x0295[_0x5b7584];return _0x19397c;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));};
\ No newline at end of file
+var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x37759f,_0x1d00b6){var _0x3a2955=function(_0x539e56){while(--_0x539e56){_0x37759f['push'](_0x37759f['shift']());}};_0x3a2955(++_0x1d00b6);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));};
\ No newline at end of file
index 3e6f847..1365412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7610=['uniqueid','lodash','util','../../config/logger','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x7610,0x1ed));var _0x0761=function(_0x1ad8e7,_0x274a01){_0x1ad8e7=_0x1ad8e7-0x0;var _0x370c36=_0x7610[_0x1ad8e7];return _0x370c36;};'use strict';var _=require(_0x0761('0x0'));var util=require(_0x0761('0x1'));var logger=require(_0x0761('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0761('0x3'));var rimraf=require(_0x0761('0x4'));var config=require(_0x0761('0x5'));var attributes=require(_0x0761('0x6'));module[_0x0761('0x7')]=function(_0xef4ad6,_0x289893){return _0xef4ad6[_0x0761('0x8')](_0x0761('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x0761('0xa'),'fields':[_0x0761('0xa')]},{'name':_0x0761('0xb'),'fields':[_0x0761('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7941=['calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','../../config/environment','define','CmHopperFinal','cm_hopper_final'];(function(_0x199245,_0x508366){var _0x2537aa=function(_0x43cea3){while(--_0x43cea3){_0x199245['push'](_0x199245['shift']());}};_0x2537aa(++_0x508366);}(_0x7941,0x16d));var _0x1794=function(_0x5e2de9,_0x1b119f){_0x5e2de9=_0x5e2de9-0x0;var _0x3bd19d=_0x7941[_0x5e2de9];return _0x3bd19d;};'use strict';var _=require(_0x1794('0x0'));var util=require(_0x1794('0x1'));var logger=require(_0x1794('0x2'))(_0x1794('0x3'));var moment=require('moment');var BPromise=require(_0x1794('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1794('0x5'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x1a72f5,_0x5a9fcb){return _0x1a72f5[_0x1794('0x6')](_0x1794('0x7'),attributes,{'tableName':_0x1794('0x8'),'paranoid':![],'indexes':[{'name':_0x1794('0x9'),'fields':[_0x1794('0x9')]},{'name':_0x1794('0xa'),'fields':[_0x1794('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index a2e2a06..d802f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3a16ed,_0x5dafbb){var _0x4e50a8=function(_0x12894c){while(--_0x12894c){_0x3a16ed['push'](_0x3a16ed['shift']());}};_0x4e50a8(++_0x5dafbb);}(_0x7a54,0x106));var _0x47a5=function(_0x1be893,_0x2460dc){_0x1be893=_0x1be893-0x0;var _0x5da141=_0x7a54[_0x1be893];return _0x5da141;};'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
+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(_0x366a01,_0x4caa3c){var _0x52c520=function(_0x32ee2d){while(--_0x32ee2d){_0x366a01['push'](_0x366a01['shift']());}};_0x52c520(++_0x4caa3c);}(_0x7a54,0x106));var _0x47a5=function(_0x2f4c4c,_0x104ac9){_0x2f4c4c=_0x2f4c4c-0x0;var _0x1462c2=_0x7a54[_0x2f4c4c];return _0x1462c2;};'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 4616258..59a9ffc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf05b=['describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf05b,0x1b6));var _0xbf05=function(_0xcc03c0,_0xd4c8a6){_0xcc03c0=_0xcc03c0-0x0;var _0x4f9c02=_0xf05b[_0xcc03c0];return _0x4f9c02;};'use strict';var multer=require(_0xbf05('0x0'));var util=require('util');var path=require(_0xbf05('0x1'));var timeout=require(_0xbf05('0x2'));var express=require(_0xbf05('0x3'));var router=express[_0xbf05('0x4')]();var fs_extra=require(_0xbf05('0x5'));var auth=require(_0xbf05('0x6'));var interaction=require(_0xbf05('0x7'));var config=require(_0xbf05('0x8'));var controller=require(_0xbf05('0x9'));router[_0xbf05('0xa')]('/',auth[_0xbf05('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbf05('0xc')]);router[_0xbf05('0xa')](_0xbf05('0xd'),auth[_0xbf05('0xb')](),controller['show']);router[_0xbf05('0xa')](_0xbf05('0xe'),auth[_0xbf05('0xb')](),controller[_0xbf05('0xf')]);router[_0xbf05('0xa')](_0xbf05('0x10'),auth[_0xbf05('0xb')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xbf05('0x11')](_0xbf05('0x12'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x13')]);router[_0xbf05('0x11')](_0xbf05('0x14'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x15')]);router[_0xbf05('0x11')](_0xbf05('0x16'),auth[_0xbf05('0xb')](),controller['checkContactHopper']);router['put'](_0xbf05('0xd'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x17')]);module[_0xbf05('0x18')]=router;
\ No newline at end of file
+var _0x9a66=['checkContactHopper','put','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x9a66,0xfd));var _0x69a6=function(_0x41b09d,_0x2f376d){_0x41b09d=_0x41b09d-0x0;var _0x7ec929=_0x9a66[_0x41b09d];return _0x7ec929;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x69a6('0x0'));var timeout=require(_0x69a6('0x1'));var express=require(_0x69a6('0x2'));var router=express['Router']();var fs_extra=require(_0x69a6('0x3'));var auth=require(_0x69a6('0x4'));var interaction=require(_0x69a6('0x5'));var config=require(_0x69a6('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x69a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x69a6('0x8')]);router['get']('/describe',auth[_0x69a6('0x9')](),controller[_0x69a6('0xa')]);router[_0x69a6('0x7')]('/:id',auth[_0x69a6('0x9')](),controller[_0x69a6('0xb')]);router['get'](_0x69a6('0xc'),auth['isAuthenticated'](),controller[_0x69a6('0xd')]);router[_0x69a6('0x7')](_0x69a6('0xe'),auth[_0x69a6('0x9')](),controller[_0x69a6('0xf')]);router['post'](_0x69a6('0x10'),auth[_0x69a6('0x9')](),controller[_0x69a6('0x11')]);router['post'](_0x69a6('0x12'),auth[_0x69a6('0x9')](),controller[_0x69a6('0x13')]);router[_0x69a6('0x14')](_0x69a6('0x15'),auth[_0x69a6('0x9')](),controller[_0x69a6('0x16')]);router[_0x69a6('0x17')]('/:id',auth[_0x69a6('0x9')](),controller['update']);module[_0x69a6('0x18')]=router;
\ No newline at end of file
index 1926d0f..4e88ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97e1=['exports','DATE','INTEGER','STRING','BOOLEAN','sequelize'];(function(_0x467ad8,_0x3d8084){var _0x2bb03c=function(_0x93e6c8){while(--_0x93e6c8){_0x467ad8['push'](_0x467ad8['shift']());}};_0x2bb03c(++_0x3d8084);}(_0x97e1,0xfb));var _0x197e=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0x97e1[_0x4f66c2];return _0x447633;};'use strict';var Sequelize=require(_0x197e('0x0'));module[_0x197e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x197e('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x197e('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x197e('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x197e('0x4')]},'calleridname':{'type':Sequelize[_0x197e('0x4')]},'starttime':{'type':Sequelize[_0x197e('0x2')]},'responsetime':{'type':Sequelize[_0x197e('0x2')]},'answertime':{'type':Sequelize[_0x197e('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x197e('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x197e('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x197e('0x4')]},'membername':{'type':Sequelize[_0x197e('0x4')]},'reason':{'type':Sequelize[_0x197e('0x4')]},'amd':{'type':Sequelize[_0x197e('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x197e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x197e('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x197e('0x2')]},'recallme':{'type':Sequelize[_0x197e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x197e('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x197e('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4d56=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x5de42d,_0x471440){var _0x48f6b2=function(_0x9dd297){while(--_0x9dd297){_0x5de42d['push'](_0x5de42d['shift']());}};_0x48f6b2(++_0x471440);}(_0x4d56,0x17e));var _0x64d5=function(_0x3b2edd,_0x5deef7){_0x3b2edd=_0x3b2edd-0x0;var _0x14ee61=_0x4d56[_0x3b2edd];return _0x14ee61;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x64d5('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x64d5('0x1')]},'scheduledat':{'type':Sequelize[_0x64d5('0x2')]},'countbusyretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x64d5('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x64d5('0x1')]},'calleridnum':{'type':Sequelize[_0x64d5('0x1')]},'calleridname':{'type':Sequelize[_0x64d5('0x1')]},'starttime':{'type':Sequelize[_0x64d5('0x2')]},'responsetime':{'type':Sequelize[_0x64d5('0x2')]},'answertime':{'type':Sequelize[_0x64d5('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x64d5('0x2')]},'ringtime':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x64d5('0x1')]},'campaign':{'type':Sequelize[_0x64d5('0x1')]},'campaigntype':{'type':Sequelize[_0x64d5('0x1')]},'membername':{'type':Sequelize[_0x64d5('0x1')]},'reason':{'type':Sequelize[_0x64d5('0x1')]},'amd':{'type':Sequelize[_0x64d5('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x64d5('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x64d5('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x64d5('0x2')]},'recallme':{'type':Sequelize[_0x64d5('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x64d5('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x64d5('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index dc260ef..9887311 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16e8=['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','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','CmHopperHistory','includeAll','include','rows','catch','params','fields','length','create','describe','body','uniqueid','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x1671fa,_0x2865ef){var _0x24f64a=function(_0x5f49c5){while(--_0x5f49c5){_0x1671fa['push'](_0x1671fa['shift']());}};_0x24f64a(++_0x2865ef);}(_0x16e8,0x12c));var _0x816e=function(_0x4a8ab5,_0x54cd7d){_0x4a8ab5=_0x4a8ab5-0x0;var _0x4add27=_0x16e8[_0x4a8ab5];return _0x4add27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x816e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x816e('0x1'));var rp=require(_0x816e('0x2'));var moment=require(_0x816e('0x3'));var BPromise=require(_0x816e('0x4'));var Mustache=require(_0x816e('0x5'));var util=require(_0x816e('0x6'));var path=require('path');var sox=require(_0x816e('0x7'));var csv=require(_0x816e('0x8'));var ejs=require(_0x816e('0x9'));var fs=require('fs');var fs_extra=require(_0x816e('0xa'));var _=require('lodash');var squel=require(_0x816e('0xb'));var crypto=require(_0x816e('0xc'));var jsforce=require(_0x816e('0xd'));var deskjs=require(_0x816e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x816e('0xf'));var Redis=require(_0x816e('0x10'));var authService=require(_0x816e('0x11'));var qs=require(_0x816e('0x12'));var as=require(_0x816e('0x13'));var hardwareService=require(_0x816e('0x14'));var logger=require(_0x816e('0x15'))('api');var utils=require(_0x816e('0x16'));var config=require(_0x816e('0x17'));var licenseUtil=require(_0x816e('0x18'));var db=require(_0x816e('0x19'))['db'];function respondWithStatusCode(_0x3f580c,_0x23ab96){_0x23ab96=_0x23ab96||0xcc;return function(_0x4d0f7d){if(_0x4d0f7d){return _0x3f580c[_0x816e('0x1a')](_0x23ab96);}return _0x3f580c[_0x816e('0x1b')](_0x23ab96)['end']();};}function respondWithResult(_0x119f20,_0x594a69){_0x594a69=_0x594a69||0xc8;return function(_0x3f28cb){if(_0x3f28cb){return _0x119f20['status'](_0x594a69)['json'](_0x3f28cb);}};}function respondWithFilteredResult(_0xfc4ce6,_0xe240bf){return function(_0xe1a64d){if(_0xe1a64d){var _0x174e97=typeof _0xe240bf[_0x816e('0x1c')]==='undefined'&&typeof _0xe240bf[_0x816e('0x1d')]===_0x816e('0x1e');var _0xde2f9e=_0xe1a64d['count'];var _0x3a7e49=_0x174e97?0x0:_0xe240bf[_0x816e('0x1c')];var _0x58393b=_0x174e97?_0xe1a64d[_0x816e('0x1f')]:_0xe240bf[_0x816e('0x1c')]+_0xe240bf['limit'];var _0x400b35;if(_0x58393b>=_0xde2f9e){_0x58393b=_0xde2f9e;_0x400b35=0xc8;}else{_0x400b35=0xce;}_0xfc4ce6[_0x816e('0x1b')](_0x400b35);return _0xfc4ce6[_0x816e('0x20')](_0x816e('0x21'),_0x3a7e49+'-'+_0x58393b+'/'+_0xde2f9e)[_0x816e('0x22')](_0xe1a64d);}return null;};}function patchUpdates(_0x5756aa){return function(_0x2489fa){try{jsonpatch[_0x816e('0x23')](_0x2489fa,_0x5756aa,!![]);}catch(_0x2c8cb8){return BPromise[_0x816e('0x24')](_0x2c8cb8);}return _0x2489fa[_0x816e('0x25')]();};}function saveUpdates(_0x205a30,_0x1e9972){return function(_0xfa7eb6){if(_0xfa7eb6){return _0xfa7eb6[_0x816e('0x26')](_0x205a30)[_0x816e('0x27')](function(_0x1ffcbb){return _0x1ffcbb;});}return null;};}function removeEntity(_0xc2b2d5,_0x2715d9){return function(_0x133d1a){if(_0x133d1a){return _0x133d1a[_0x816e('0x28')]()[_0x816e('0x27')](function(){_0xc2b2d5[_0x816e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x235caa,_0x3a2ecf){return function(_0x32f881){if(!_0x32f881){_0x235caa['sendStatus'](0x194);}return _0x32f881;};}function handleError(_0x4d119e,_0x4c4008){_0x4c4008=_0x4c4008||0x1f4;return function(_0x495718){logger[_0x816e('0x29')](_0x495718[_0x816e('0x2a')]);if(_0x495718[_0x816e('0x2b')]){delete _0x495718[_0x816e('0x2b')];}_0x4d119e[_0x816e('0x1b')](_0x4c4008)[_0x816e('0x2c')](_0x495718);};}exports[_0x816e('0x2d')]=function(_0x2943d2,_0x351db7){var _0x4025c9={},_0x2458cd={},_0x50b581={'count':0x0,'rows':[]};var _0x5c4448=_['map'](db['CmHopperHistory'][_0x816e('0x2e')],function(_0x585475){return{'name':_0x585475[_0x816e('0x2f')],'type':_0x585475[_0x816e('0x30')][_0x816e('0x31')]};});_0x2458cd[_0x816e('0x32')]=_['map'](_0x5c4448,_0x816e('0x2b'));_0x2458cd['query']=_[_0x816e('0x33')](_0x2943d2[_0x816e('0x34')]);_0x2458cd[_0x816e('0x35')]=_[_0x816e('0x36')](_0x2458cd[_0x816e('0x32')],_0x2458cd[_0x816e('0x34')]);_0x4025c9['attributes']=_[_0x816e('0x36')](_0x2458cd[_0x816e('0x32')],qs['fields'](_0x2943d2[_0x816e('0x34')]['fields']));_0x4025c9[_0x816e('0x37')]=_0x4025c9[_0x816e('0x37')]['length']?_0x4025c9[_0x816e('0x37')]:_0x2458cd[_0x816e('0x32')];if(!_0x2943d2[_0x816e('0x34')][_0x816e('0x38')](_0x816e('0x39'))){_0x4025c9['limit']=qs[_0x816e('0x1d')](_0x2943d2[_0x816e('0x34')][_0x816e('0x1d')]);_0x4025c9[_0x816e('0x1c')]=qs['offset'](_0x2943d2['query']['offset']);}_0x4025c9[_0x816e('0x3a')]=qs[_0x816e('0x3b')](_0x2943d2[_0x816e('0x34')][_0x816e('0x3b')]);_0x4025c9[_0x816e('0x3c')]=qs[_0x816e('0x35')](_[_0x816e('0x3d')](_0x2943d2['query'],_0x2458cd[_0x816e('0x35')]),_0x5c4448);if(_0x2943d2[_0x816e('0x34')][_0x816e('0x3e')]){_0x4025c9[_0x816e('0x3c')]=_[_0x816e('0x3f')](_0x4025c9['where'],{'$or':_[_0x816e('0x40')](_0x5c4448,function(_0x2b6340){if(_0x2b6340[_0x816e('0x30')]!==_0x816e('0x41')){var _0x1c311c={};_0x1c311c[_0x2b6340[_0x816e('0x2b')]]={'$like':'%'+_0x2943d2['query'][_0x816e('0x3e')]+'%'};return _0x1c311c;}})});}_0x4025c9=_[_0x816e('0x3f')]({},_0x4025c9,_0x2943d2['options']);var _0x3903af={'where':_0x4025c9['where']};return db[_0x816e('0x42')][_0x816e('0x1f')](_0x3903af)[_0x816e('0x27')](function(_0x2758aa){_0x50b581['count']=_0x2758aa;if(_0x2943d2[_0x816e('0x34')][_0x816e('0x43')]){_0x4025c9[_0x816e('0x44')]=[{'all':!![]}];}return db[_0x816e('0x42')]['findAll'](_0x4025c9);})[_0x816e('0x27')](function(_0x373452){_0x50b581[_0x816e('0x45')]=_0x373452;return _0x50b581;})['then'](respondWithFilteredResult(_0x351db7,_0x4025c9))[_0x816e('0x46')](handleError(_0x351db7,null));};exports['show']=function(_0x5945e5,_0x3b3a47){var _0x4c61a9={'raw':!![],'where':{'id':_0x5945e5[_0x816e('0x47')]['id']}},_0x50d511={};_0x50d511[_0x816e('0x32')]=_['keys'](db[_0x816e('0x42')][_0x816e('0x2e')]);_0x50d511['query']=_['keys'](_0x5945e5[_0x816e('0x34')]);_0x50d511[_0x816e('0x35')]=_[_0x816e('0x36')](_0x50d511[_0x816e('0x32')],_0x50d511[_0x816e('0x34')]);_0x4c61a9[_0x816e('0x37')]=_[_0x816e('0x36')](_0x50d511[_0x816e('0x32')],qs[_0x816e('0x48')](_0x5945e5[_0x816e('0x34')]['fields']));_0x4c61a9['attributes']=_0x4c61a9[_0x816e('0x37')][_0x816e('0x49')]?_0x4c61a9[_0x816e('0x37')]:_0x50d511['model'];if(_0x5945e5[_0x816e('0x34')][_0x816e('0x43')]){_0x4c61a9[_0x816e('0x44')]=[{'all':!![]}];}_0x4c61a9=_[_0x816e('0x3f')]({},_0x4c61a9,_0x5945e5['options']);return db[_0x816e('0x42')]['find'](_0x4c61a9)[_0x816e('0x27')](handleEntityNotFound(_0x3b3a47,null))[_0x816e('0x27')](respondWithResult(_0x3b3a47,null))['catch'](handleError(_0x3b3a47,null));};exports['create']=function(_0x19d160,_0x23e6f7){return db[_0x816e('0x42')][_0x816e('0x4a')](_0x19d160['body'],{})[_0x816e('0x27')](respondWithResult(_0x23e6f7,0xc9))[_0x816e('0x46')](handleError(_0x23e6f7,null));};exports[_0x816e('0x4b')]=function(_0x50d2f6,_0x5e386c){return db[_0x816e('0x42')][_0x816e('0x4b')]()[_0x816e('0x27')](respondWithResult(_0x5e386c,null))['catch'](handleError(_0x5e386c,null));};exports['update']=function(_0x1eb2c4,_0x403323){if(_0x1eb2c4[_0x816e('0x4c')][_0x816e('0x4d')]){delete _0x1eb2c4[_0x816e('0x4c')][_0x816e('0x4d')];}return db['CmHopperHistory'][_0x816e('0x4e')]({'where':{'uniqueid':_0x1eb2c4['params']['id']}})[_0x816e('0x27')](handleEntityNotFound(_0x403323,null))['then'](saveUpdates(_0x1eb2c4[_0x816e('0x4c')],null))[_0x816e('0x27')](respondWithResult(_0x403323,null))[_0x816e('0x46')](handleError(_0x403323,null));};
\ No newline at end of file
+var _0xf7c9=['moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','update','destroy','then','error','name','send','index','CmHopperHistory','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','describe','body','uniqueid','rimraf','zip-dir','fast-json-patch'];(function(_0x23a08d,_0x3819f3){var _0x70d1ab=function(_0x43f563){while(--_0x43f563){_0x23a08d['push'](_0x23a08d['shift']());}};_0x70d1ab(++_0x3819f3);}(_0xf7c9,0xd8));var _0x9f7c=function(_0x589a4d,_0x2c5d60){_0x589a4d=_0x589a4d-0x0;var _0x575b27=_0xf7c9[_0x589a4d];return _0x575b27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f7c('0x0'));var zipdir=require(_0x9f7c('0x1'));var jsonpatch=require(_0x9f7c('0x2'));var rp=require('request-promise');var moment=require(_0x9f7c('0x3'));var BPromise=require(_0x9f7c('0x4'));var Mustache=require(_0x9f7c('0x5'));var util=require('util');var path=require(_0x9f7c('0x6'));var sox=require(_0x9f7c('0x7'));var csv=require('to-csv');var ejs=require(_0x9f7c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f7c('0x9'));var squel=require(_0x9f7c('0xa'));var crypto=require('crypto');var jsforce=require(_0x9f7c('0xb'));var deskjs=require(_0x9f7c('0xc'));var toCsv=require(_0x9f7c('0xd'));var querystring=require(_0x9f7c('0xe'));var Papa=require(_0x9f7c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f7c('0x10'));var as=require(_0x9f7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f7c('0x12'));var utils=require(_0x9f7c('0x13'));var config=require(_0x9f7c('0x14'));var licenseUtil=require(_0x9f7c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c61c9,_0x129b75){_0x129b75=_0x129b75||0xcc;return function(_0x8308dc){if(_0x8308dc){return _0x2c61c9[_0x9f7c('0x16')](_0x129b75);}return _0x2c61c9[_0x9f7c('0x17')](_0x129b75)[_0x9f7c('0x18')]();};}function respondWithResult(_0x1cbda4,_0x5de308){_0x5de308=_0x5de308||0xc8;return function(_0x1be6cb){if(_0x1be6cb){return _0x1cbda4[_0x9f7c('0x17')](_0x5de308)[_0x9f7c('0x19')](_0x1be6cb);}};}function respondWithFilteredResult(_0x119df1,_0xb61bdc){return function(_0xdc7603){if(_0xdc7603){var _0x510678=typeof _0xb61bdc['offset']===_0x9f7c('0x1a')&&typeof _0xb61bdc[_0x9f7c('0x1b')]===_0x9f7c('0x1a');var _0x549fb6=_0xdc7603['count'];var _0x2a7ccf=_0x510678?0x0:_0xb61bdc[_0x9f7c('0x1c')];var _0x287f55=_0x510678?_0xdc7603['count']:_0xb61bdc[_0x9f7c('0x1c')]+_0xb61bdc[_0x9f7c('0x1b')];var _0x446bd1;if(_0x287f55>=_0x549fb6){_0x287f55=_0x549fb6;_0x446bd1=0xc8;}else{_0x446bd1=0xce;}_0x119df1[_0x9f7c('0x17')](_0x446bd1);return _0x119df1[_0x9f7c('0x1d')](_0x9f7c('0x1e'),_0x2a7ccf+'-'+_0x287f55+'/'+_0x549fb6)[_0x9f7c('0x19')](_0xdc7603);}return null;};}function patchUpdates(_0x2ca271){return function(_0x2964d0){try{jsonpatch[_0x9f7c('0x1f')](_0x2964d0,_0x2ca271,!![]);}catch(_0x2ef32b){return BPromise['reject'](_0x2ef32b);}return _0x2964d0['save']();};}function saveUpdates(_0x1c3404,_0x1a9f22){return function(_0x1df463){if(_0x1df463){return _0x1df463[_0x9f7c('0x20')](_0x1c3404)['then'](function(_0x5e391f){return _0x5e391f;});}return null;};}function removeEntity(_0xa6fad5,_0xb22d35){return function(_0x2eba05){if(_0x2eba05){return _0x2eba05[_0x9f7c('0x21')]()[_0x9f7c('0x22')](function(){_0xa6fad5[_0x9f7c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x455c35,_0x3c7913){return function(_0x4cb823){if(!_0x4cb823){_0x455c35[_0x9f7c('0x16')](0x194);}return _0x4cb823;};}function handleError(_0x50431b,_0x1d5a4d){_0x1d5a4d=_0x1d5a4d||0x1f4;return function(_0x200df9){logger[_0x9f7c('0x23')](_0x200df9['stack']);if(_0x200df9[_0x9f7c('0x24')]){delete _0x200df9['name'];}_0x50431b[_0x9f7c('0x17')](_0x1d5a4d)[_0x9f7c('0x25')](_0x200df9);};}exports[_0x9f7c('0x26')]=function(_0x479303,_0x53c110){var _0x98c96e={},_0x1031af={},_0x35276a={'count':0x0,'rows':[]};var _0x5d458a=_['map'](db[_0x9f7c('0x27')][_0x9f7c('0x28')],function(_0x4616b7){return{'name':_0x4616b7['fieldName'],'type':_0x4616b7[_0x9f7c('0x29')][_0x9f7c('0x2a')]};});_0x1031af[_0x9f7c('0x2b')]=_[_0x9f7c('0x2c')](_0x5d458a,_0x9f7c('0x24'));_0x1031af[_0x9f7c('0x2d')]=_[_0x9f7c('0x2e')](_0x479303[_0x9f7c('0x2d')]);_0x1031af[_0x9f7c('0x2f')]=_[_0x9f7c('0x30')](_0x1031af[_0x9f7c('0x2b')],_0x1031af[_0x9f7c('0x2d')]);_0x98c96e['attributes']=_[_0x9f7c('0x30')](_0x1031af[_0x9f7c('0x2b')],qs[_0x9f7c('0x31')](_0x479303[_0x9f7c('0x2d')]['fields']));_0x98c96e[_0x9f7c('0x32')]=_0x98c96e[_0x9f7c('0x32')]['length']?_0x98c96e['attributes']:_0x1031af[_0x9f7c('0x2b')];if(!_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x33')](_0x9f7c('0x34'))){_0x98c96e['limit']=qs[_0x9f7c('0x1b')](_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x1b')]);_0x98c96e['offset']=qs['offset'](_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x1c')]);}_0x98c96e[_0x9f7c('0x35')]=qs[_0x9f7c('0x36')](_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x36')]);_0x98c96e['where']=qs[_0x9f7c('0x2f')](_['pick'](_0x479303['query'],_0x1031af['filters']),_0x5d458a);if(_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x37')]){_0x98c96e['where']=_[_0x9f7c('0x38')](_0x98c96e[_0x9f7c('0x39')],{'$or':_[_0x9f7c('0x2c')](_0x5d458a,function(_0x805c7c){if(_0x805c7c[_0x9f7c('0x29')]!==_0x9f7c('0x3a')){var _0x41828a={};_0x41828a[_0x805c7c[_0x9f7c('0x24')]]={'$like':'%'+_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x37')]+'%'};return _0x41828a;}})});}_0x98c96e=_['merge']({},_0x98c96e,_0x479303[_0x9f7c('0x3b')]);var _0x12a6b2={'where':_0x98c96e[_0x9f7c('0x39')]};return db['CmHopperHistory'][_0x9f7c('0x3c')](_0x12a6b2)['then'](function(_0x1cbed6){_0x35276a[_0x9f7c('0x3c')]=_0x1cbed6;if(_0x479303[_0x9f7c('0x2d')][_0x9f7c('0x3d')]){_0x98c96e[_0x9f7c('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9f7c('0x3f')](_0x98c96e);})[_0x9f7c('0x22')](function(_0x421228){_0x35276a[_0x9f7c('0x40')]=_0x421228;return _0x35276a;})['then'](respondWithFilteredResult(_0x53c110,_0x98c96e))[_0x9f7c('0x41')](handleError(_0x53c110,null));};exports[_0x9f7c('0x42')]=function(_0x5111a6,_0x11a9fa){var _0x5191a5={'raw':!![],'where':{'id':_0x5111a6[_0x9f7c('0x43')]['id']}},_0x2a1250={};_0x2a1250['model']=_[_0x9f7c('0x2e')](db[_0x9f7c('0x27')][_0x9f7c('0x28')]);_0x2a1250[_0x9f7c('0x2d')]=_[_0x9f7c('0x2e')](_0x5111a6[_0x9f7c('0x2d')]);_0x2a1250[_0x9f7c('0x2f')]=_[_0x9f7c('0x30')](_0x2a1250[_0x9f7c('0x2b')],_0x2a1250['query']);_0x5191a5[_0x9f7c('0x32')]=_[_0x9f7c('0x30')](_0x2a1250['model'],qs['fields'](_0x5111a6[_0x9f7c('0x2d')]['fields']));_0x5191a5['attributes']=_0x5191a5['attributes']['length']?_0x5191a5['attributes']:_0x2a1250[_0x9f7c('0x2b')];if(_0x5111a6['query']['includeAll']){_0x5191a5[_0x9f7c('0x3e')]=[{'all':!![]}];}_0x5191a5=_[_0x9f7c('0x38')]({},_0x5191a5,_0x5111a6[_0x9f7c('0x3b')]);return db[_0x9f7c('0x27')][_0x9f7c('0x44')](_0x5191a5)['then'](handleEntityNotFound(_0x11a9fa,null))[_0x9f7c('0x22')](respondWithResult(_0x11a9fa,null))[_0x9f7c('0x41')](handleError(_0x11a9fa,null));};exports[_0x9f7c('0x45')]=function(_0x45dfae,_0x63839a){return db[_0x9f7c('0x27')][_0x9f7c('0x45')](_0x45dfae['body'],{})[_0x9f7c('0x22')](respondWithResult(_0x63839a,0xc9))[_0x9f7c('0x41')](handleError(_0x63839a,null));};exports['describe']=function(_0x4ec8c9,_0x1cf601){return db['CmHopperHistory'][_0x9f7c('0x46')]()[_0x9f7c('0x22')](respondWithResult(_0x1cf601,null))['catch'](handleError(_0x1cf601,null));};exports[_0x9f7c('0x20')]=function(_0x870eb4,_0x25de62){if(_0x870eb4[_0x9f7c('0x47')][_0x9f7c('0x48')]){delete _0x870eb4['body'][_0x9f7c('0x48')];}return db[_0x9f7c('0x27')]['find']({'where':{'uniqueid':_0x870eb4[_0x9f7c('0x43')]['id']}})['then'](handleEntityNotFound(_0x25de62,null))[_0x9f7c('0x22')](saveUpdates(_0x870eb4['body'],null))[_0x9f7c('0x22')](respondWithResult(_0x25de62,null))[_0x9f7c('0x41')](handleError(_0x25de62,null));};
\ No newline at end of file
index 4479890..15f5aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x175624,_0x2df619){var _0x3a41de=function(_0x5b4023){while(--_0x5b4023){_0x175624['push'](_0x175624['shift']());}};_0x3a41de(++_0x2df619);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x9e7c2b,_0x507c5e){_0x9e7c2b=_0x9e7c2b-0x0;var _0x9c0e04=_0xc6ac[_0x9e7c2b];return _0x9c0e04;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf846=['rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1ee7ef,_0x3c0add){var _0x4ff77a=function(_0x34cab7){while(--_0x34cab7){_0x1ee7ef['push'](_0x1ee7ef['shift']());}};_0x4ff77a(++_0x3c0add);}(_0xf846,0x85));var _0x6f84=function(_0x50e2f8,_0x3b05ae){_0x50e2f8=_0x50e2f8-0x0;var _0x272593=_0xf846[_0x50e2f8];return _0x272593;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var logger=require(_0x6f84('0x2'))(_0x6f84('0x3'));var moment=require('moment');var BPromise=require(_0x6f84('0x4'));var rp=require(_0x6f84('0x5'));var fs=require('fs');var path=require(_0x6f84('0x6'));var rimraf=require(_0x6f84('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f84('0x8'));module[_0x6f84('0x9')]=function(_0x2963cd,_0x25e3c2){return _0x2963cd[_0x6f84('0xa')](_0x6f84('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6f84('0xc'),'fields':[_0x6f84('0xc')]},{'name':_0x6f84('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index a591b58..54556f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a3a=['findAll','options','where','COUNT','sequelize','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','raw','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','col','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','body','debug','stringify','AvgHandleTime'];(function(_0x1f581c,_0x538be2){var _0x73f7cf=function(_0x497b25){while(--_0x497b25){_0x1f581c['push'](_0x1f581c['shift']());}};_0x73f7cf(++_0x538be2);}(_0x4a3a,0x140));var _0xa4a3=function(_0x86a336,_0x59ed92){_0x86a336=_0x86a336-0x0;var _0x2dd274=_0x4a3a[_0x86a336];return _0x2dd274;};'use strict';var _=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var moment=require(_0xa4a3('0x2'));var BPromise=require(_0xa4a3('0x3'));var rs=require(_0xa4a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4a3('0x6'))('rpc');var config=require(_0xa4a3('0x7'));var jayson=require(_0xa4a3('0x8'));var client=jayson['client'][_0xa4a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18bc6d,_0x41d321,_0x45f38e){return new BPromise(function(_0x2b8720,_0x2c95ca){return client[_0xa4a3('0xa')](_0x18bc6d,_0x45f38e)[_0xa4a3('0xb')](function(_0x263d1a){logger[_0xa4a3('0xc')](_0xa4a3('0xd'),_0x41d321,_0xa4a3('0xe'));logger['debug'](_0xa4a3('0xf'),_0x41d321,_0xa4a3('0xe'),JSON['stringify'](_0x263d1a));if(_0x263d1a[_0xa4a3('0x10')]){if(_0x263d1a['error']['code']===0x1f4){logger[_0xa4a3('0x10')](_0xa4a3('0xd'),_0x41d321,_0x263d1a[_0xa4a3('0x10')][_0xa4a3('0x11')]);return _0x2c95ca(_0x263d1a['error'][_0xa4a3('0x11')]);}logger[_0xa4a3('0x10')](_0xa4a3('0xd'),_0x41d321,_0x263d1a[_0xa4a3('0x10')][_0xa4a3('0x11')]);return _0x2b8720(_0x263d1a[_0xa4a3('0x10')][_0xa4a3('0x11')]);}else{logger[_0xa4a3('0xc')](_0xa4a3('0xd'),_0x41d321,'request\x20sent');_0x2b8720(_0x263d1a[_0xa4a3('0x12')][_0xa4a3('0x11')]);}})[_0xa4a3('0x13')](function(_0x5461d5){logger[_0xa4a3('0x10')](_0xa4a3('0xd'),_0x41d321,_0x5461d5);_0x2c95ca(_0x5461d5);});});}exports[_0xa4a3('0x14')]=function(_0x35e6e4){var _0x2d6eb2=this;return new Promise(function(_0x1d9342,_0x5159df){return db['CmHopperHistory']['create'](_0x35e6e4[_0xa4a3('0x15')],{'raw':_0x35e6e4['options']?_0x35e6e4['options']['raw']===undefined?!![]:![]:!![]})[_0xa4a3('0xb')](function(_0x4afc76){logger[_0xa4a3('0xc')](_0xa4a3('0x14'),_0x35e6e4);logger[_0xa4a3('0x16')](_0xa4a3('0x14'),_0x35e6e4,JSON[_0xa4a3('0x17')](_0x4afc76));_0x1d9342(_0x4afc76);})['catch'](function(_0xc34496){logger[_0xa4a3('0x10')](_0xa4a3('0x14'),_0xc34496['message'],_0x35e6e4);_0x5159df(_0x2d6eb2[_0xa4a3('0x10')](0x1f4,_0xc34496[_0xa4a3('0x11')]));});});};exports[_0xa4a3('0x18')]=function(_0x7455ad){var _0x5273de=this;return new Promise(function(_0x23b257,_0x45202d){return db['CmHopperHistory'][_0xa4a3('0x19')]({'raw':_0x7455ad[_0xa4a3('0x1a')]?_0x7455ad['options']['raw']===undefined?!![]:![]:!![],'where':_0x7455ad[_0xa4a3('0x1a')]?_0x7455ad[_0xa4a3('0x1a')][_0xa4a3('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['col']('id')),_0xa4a3('0x1e')],[db['sequelize']['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x20')))),_0xa4a3('0x21')],[db['sequelize']['fn']('COUNT',db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xa4a3('0x22')],[db['sequelize']['fn'](_0xa4a3('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xa4a3('0x1f')](_0xa4a3('0x23')))),_0xa4a3('0x24')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x25'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x26')))),_0xa4a3('0x27')],[db[_0xa4a3('0x1d')]['fn']('AVG',db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x28')))),_0xa4a3('0x29')]]})[_0xa4a3('0xb')](function(_0x4908d8){logger['info'](_0xa4a3('0x18'),_0x7455ad);logger[_0xa4a3('0x16')](_0xa4a3('0x18'),_0x7455ad,JSON[_0xa4a3('0x17')](_0x4908d8));_0x23b257(_0x4908d8);})[_0xa4a3('0x13')](function(_0x4c29e0){logger['error']('AvgHandleTime',_0x4c29e0[_0xa4a3('0x11')],_0x7455ad);_0x45202d(_0x5273de[_0xa4a3('0x10')](0x1f4,_0x4c29e0[_0xa4a3('0x11')]));});});};exports[_0xa4a3('0x2a')]=function(_0xc0a2a8){var _0x1bdf1a=this;return new Promise(function(_0xd3f855,_0x578fe7){return db[_0xa4a3('0x2b')]['findAll']({'raw':_0xc0a2a8[_0xa4a3('0x1a')]?_0xc0a2a8[_0xa4a3('0x1a')][_0xa4a3('0x2c')]===undefined?!![]:![]:!![],'where':_0xc0a2a8[_0xa4a3('0x1a')]?_0xc0a2a8['options'][_0xa4a3('0x1b')]||null:null,'attributes':[[_0xa4a3('0x2d'),'name'],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db['sequelize']['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x2e')))),_0xa4a3('0x2f')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x30')))),'outboundNoAnswerCallsDay'],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x20')))),_0xa4a3('0x31')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')]['literal'](_0xa4a3('0x32')))),_0xa4a3('0x33')],[db['sequelize']['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')](_0xa4a3('0x34')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db['sequelize'][_0xa4a3('0x1f')](_0xa4a3('0x35')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa4a3('0x36')],[db[_0xa4a3('0x1d')]['fn']('COUNT',db[_0xa4a3('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xa4a3('0x37')))),'outboundUnknownCallsDay'],[db[_0xa4a3('0x1d')]['fn']('COUNT',db[_0xa4a3('0x1d')]['fn']('IF',db['sequelize'][_0xa4a3('0x1f')](_0xa4a3('0x38')))),_0xa4a3('0x39')],[db[_0xa4a3('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xa4a3('0x3a')))),_0xa4a3('0x3b')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xa4a3('0x3c')))),_0xa4a3('0x3d')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa4a3('0x3e')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db[_0xa4a3('0x1d')]['fn']('IF',db[_0xa4a3('0x1d')]['literal'](_0xa4a3('0x3f')))),_0xa4a3('0x3d')],[db[_0xa4a3('0x1d')]['fn']('COUNT',db[_0xa4a3('0x1d')]['fn']('IF',db['sequelize'][_0xa4a3('0x1f')](_0xa4a3('0x40')))),'outboundReCallsDay']],'group':[_0xa4a3('0x2d')]})[_0xa4a3('0xb')](function(_0x369287){logger['info'](_0xa4a3('0x2a'),_0xc0a2a8);logger[_0xa4a3('0x16')](_0xa4a3('0x2a'),_0xc0a2a8,JSON['stringify'](_0x369287));_0xd3f855(_0x369287);})[_0xa4a3('0x13')](function(_0x19e54b){logger[_0xa4a3('0x10')]('GetVoiceQueueHopperHistory',_0x19e54b[_0xa4a3('0x11')],_0xc0a2a8);_0x578fe7(_0x1bdf1a['error'](0x1f4,_0x19e54b[_0xa4a3('0x11')]));});});};exports[_0xa4a3('0x41')]=function(_0x22da72){var _0x5395b4=this;return new Promise(function(_0x4e5b84,_0x52e39a){return db['CmHopperHistory'][_0xa4a3('0x19')]({'raw':_0x22da72[_0xa4a3('0x1a')]?_0x22da72[_0xa4a3('0x1a')][_0xa4a3('0x2c')]===undefined?!![]:![]:!![],'where':_0x22da72[_0xa4a3('0x1a')]?_0x22da72[_0xa4a3('0x1a')]['where']||null:null,'attributes':[['campaign',_0xa4a3('0x42')],[db[_0xa4a3('0x1d')]['fn']('COUNT',db[_0xa4a3('0x1d')][_0xa4a3('0x43')]('id')),_0xa4a3('0x44')],[db[_0xa4a3('0x1d')]['fn'](_0xa4a3('0x1c'),db['sequelize']['fn']('IF',db[_0xa4a3('0x1d')][_0xa4a3('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xa4a3('0x2d')]})[_0xa4a3('0xb')](function(_0xeec824){logger['info'](_0xa4a3('0x41'),_0x22da72);logger[_0xa4a3('0x16')](_0xa4a3('0x41'),_0x22da72,JSON[_0xa4a3('0x17')](_0xeec824));_0x4e5b84(_0xeec824);})[_0xa4a3('0x13')](function(_0x2e56f2){logger[_0xa4a3('0x10')]('GetCampaignHopperHistory',_0x2e56f2[_0xa4a3('0x11')],_0x22da72);_0x52e39a(_0x5395b4['error'](0x1f4,_0x2e56f2[_0xa4a3('0x11')]));});});};
\ No newline at end of file
+var _0xc901=['request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','catch','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s'];(function(_0x417234,_0x28ac37){var _0x33f3b8=function(_0x112361){while(--_0x112361){_0x417234['push'](_0x417234['shift']());}};_0x33f3b8(++_0x28ac37);}(_0xc901,0x142));var _0x1c90=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc901[_0x42cae2];return _0x5f256f;};'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']('CmHopperHistory,\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')]('CmHopperHistory,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}exports[_0x1c90('0x13')]=function(_0x4ec354){var _0x582246=this;return new Promise(function(_0x128bf0,_0x5dd488){return db[_0x1c90('0x14')][_0x1c90('0x15')](_0x4ec354[_0x1c90('0x16')],{'raw':_0x4ec354[_0x1c90('0x17')]?_0x4ec354['options'][_0x1c90('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x525997){logger[_0x1c90('0xb')](_0x1c90('0x13'),_0x4ec354);logger['debug'](_0x1c90('0x13'),_0x4ec354,JSON[_0x1c90('0x19')](_0x525997));_0x128bf0(_0x525997);})[_0x1c90('0x1a')](function(_0x4074fd){logger[_0x1c90('0x10')](_0x1c90('0x13'),_0x4074fd['message'],_0x4ec354);_0x5dd488(_0x582246[_0x1c90('0x10')](0x1f4,_0x4074fd[_0x1c90('0x12')]));});});};exports[_0x1c90('0x1b')]=function(_0x33c88b){var _0x24539a=this;return new Promise(function(_0x26d55a,_0x4c3bb0){return db['CmHopperHistory'][_0x1c90('0x1c')]({'raw':_0x33c88b[_0x1c90('0x17')]?_0x33c88b[_0x1c90('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x33c88b[_0x1c90('0x17')]?_0x33c88b[_0x1c90('0x17')]['where']||null:null,'attributes':[[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db['sequelize'][_0x1c90('0x1f')]('id')),_0x1c90('0x20')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x23')))),_0x1c90('0x24')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')]['literal'](_0x1c90('0x25')))),_0x1c90('0x26')],[db['sequelize']['fn'](_0x1c90('0x27'),db['sequelize']['fn']('IF',db[_0x1c90('0x1d')]['literal'](_0x1c90('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x27'),db['sequelize']['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x1c90('0x29')]]})[_0x1c90('0xa')](function(_0x99cda1){logger[_0x1c90('0xb')](_0x1c90('0x1b'),_0x33c88b);logger['debug']('AvgHandleTime',_0x33c88b,JSON['stringify'](_0x99cda1));_0x26d55a(_0x99cda1);})['catch'](function(_0x4f753a){logger[_0x1c90('0x10')](_0x1c90('0x1b'),_0x4f753a[_0x1c90('0x12')],_0x33c88b);_0x4c3bb0(_0x24539a['error'](0x1f4,_0x4f753a[_0x1c90('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0xd8038){var _0x9cf23d=this;return new Promise(function(_0x56278e,_0x59ddbe){return db[_0x1c90('0x14')][_0x1c90('0x1c')]({'raw':_0xd8038[_0x1c90('0x17')]?_0xd8038[_0x1c90('0x17')][_0x1c90('0x18')]===undefined?!![]:![]:!![],'where':_0xd8038[_0x1c90('0x17')]?_0xd8038[_0x1c90('0x17')]['where']||null:null,'attributes':[['campaign',_0x1c90('0x2a')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x2b')))),_0x1c90('0x2c')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db['sequelize']['fn']('IF',db[_0x1c90('0x1d')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x1c90('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')]['literal'](_0x1c90('0x22')))),_0x1c90('0x2e')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1c90('0x21')](_0x1c90('0x2f')))),'outboundBusyCallsDay'],[db[_0x1c90('0x1d')]['fn']('COUNT',db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')]['literal'](_0x1c90('0x30')))),_0x1c90('0x31')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x32')))),_0x1c90('0x33')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db['sequelize']['fn']('IF',db[_0x1c90('0x1d')]['literal'](_0x1c90('0x34')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x35')))),_0x1c90('0x36')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x1c90('0x37')))),_0x1c90('0x38')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x1c90('0x3a')))),'outboundRejectCallsDay'],[db[_0x1c90('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0x1c90('0x1d')]['fn']('COUNT',db[_0x1c90('0x1d')]['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')](_0x1c90('0x3b')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x1c90('0x1d')]['fn']('IF',db['sequelize'][_0x1c90('0x21')](_0x1c90('0x3c')))),'outboundReCallsDay']],'group':[_0x1c90('0x3d')]})['then'](function(_0x30ed2a){logger['info'](_0x1c90('0x3e'),_0xd8038);logger[_0x1c90('0xe')](_0x1c90('0x3e'),_0xd8038,JSON[_0x1c90('0x19')](_0x30ed2a));_0x56278e(_0x30ed2a);})['catch'](function(_0x1bc4a3){logger[_0x1c90('0x10')](_0x1c90('0x3e'),_0x1bc4a3[_0x1c90('0x12')],_0xd8038);_0x59ddbe(_0x9cf23d['error'](0x1f4,_0x1bc4a3[_0x1c90('0x12')]));});});};exports[_0x1c90('0x3f')]=function(_0x3f133a){var _0x1329cb=this;return new Promise(function(_0x522ccb,_0x23f8da){return db[_0x1c90('0x14')]['findAll']({'raw':_0x3f133a[_0x1c90('0x17')]?_0x3f133a[_0x1c90('0x17')][_0x1c90('0x18')]===undefined?!![]:![]:!![],'where':_0x3f133a['options']?_0x3f133a['options'][_0x1c90('0x40')]||null:null,'attributes':[['campaign',_0x1c90('0x2a')],[db[_0x1c90('0x1d')]['fn'](_0x1c90('0x1e'),db[_0x1c90('0x1d')][_0x1c90('0x1f')]('id')),_0x1c90('0x41')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1c90('0x1d')][_0x1c90('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x1c90('0x42')]],'group':[_0x1c90('0x3d')]})[_0x1c90('0xa')](function(_0x2882c2){logger[_0x1c90('0xb')]('GetCampaignHopperHistory',_0x3f133a);logger[_0x1c90('0xe')](_0x1c90('0x3f'),_0x3f133a,JSON['stringify'](_0x2882c2));_0x522ccb(_0x2882c2);})[_0x1c90('0x1a')](function(_0xd8dd42){logger[_0x1c90('0x10')](_0x1c90('0x3f'),_0xd8dd42['message'],_0x3f133a);_0x23f8da(_0x1329cb[_0x1c90('0x10')](0x1f4,_0xd8dd42['message']));});});};
\ No newline at end of file
index 53982e0..962bdf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe6f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','multer','util'];(function(_0x168a65,_0x1ba0fb){var _0x220d3c=function(_0x4917d3){while(--_0x4917d3){_0x168a65['push'](_0x168a65['shift']());}};_0x220d3c(++_0x1ba0fb);}(_0xfe6f,0x9e));var _0xffe6=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xfe6f[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0xffe6('0x0'));var util=require(_0xffe6('0x1'));var path=require(_0xffe6('0x2'));var timeout=require(_0xffe6('0x3'));var express=require(_0xffe6('0x4'));var router=express[_0xffe6('0x5')]();var fs_extra=require(_0xffe6('0x6'));var auth=require(_0xffe6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xffe6('0x8'));var controller=require(_0xffe6('0x9'));router[_0xffe6('0xa')]('/',auth[_0xffe6('0xb')](),controller['index']);router[_0xffe6('0xa')](_0xffe6('0xc'),auth[_0xffe6('0xb')](),controller[_0xffe6('0xd')]);router['get']('/:id',auth[_0xffe6('0xb')](),controller[_0xffe6('0xe')]);router[_0xffe6('0xf')]('/',auth[_0xffe6('0xb')](),controller[_0xffe6('0x10')]);router[_0xffe6('0x11')](_0xffe6('0x12'),auth[_0xffe6('0xb')](),controller[_0xffe6('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8b7d=['isAuthenticated','/:id','show','put','exports','multer','util','connect-timeout','express','Router','../../config/environment','./cmHopperHistory.controller','index','get','/describe'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x8b7d,0x1b8));var _0xd8b7=function(_0x4e6165,_0x437309){_0x4e6165=_0x4e6165-0x0;var _0x498d88=_0x8b7d[_0x4e6165];return _0x498d88;};'use strict';var multer=require(_0xd8b7('0x0'));var util=require(_0xd8b7('0x1'));var path=require('path');var timeout=require(_0xd8b7('0x2'));var express=require(_0xd8b7('0x3'));var router=express[_0xd8b7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8b7('0x5'));var controller=require(_0xd8b7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8b7('0x7')]);router[_0xd8b7('0x8')](_0xd8b7('0x9'),auth[_0xd8b7('0xa')](),controller['describe']);router[_0xd8b7('0x8')](_0xd8b7('0xb'),auth['isAuthenticated'](),controller[_0xd8b7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd8b7('0xd')]('/:id',auth[_0xd8b7('0xa')](),controller['update']);module[_0xd8b7('0xe')]=router;
\ No newline at end of file
index bc7a2cc..ef4df0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x089f=['STRING','name','exports'];(function(_0x25738d,_0x21501b){var _0x20f680=function(_0x3294e3){while(--_0x3294e3){_0x25738d['push'](_0x25738d['shift']());}};_0x20f680(++_0x21501b);}(_0x089f,0x1c7));var _0xf089=function(_0x3ba00d,_0x5477c4){_0x3ba00d=_0x3ba00d-0x0;var _0x460a09=_0x089f[_0x3ba00d];return _0x460a09;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'name':{'type':Sequelize[_0xf089('0x1')],'unique':_0xf089('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf089('0x1')]},'dialPrefix':{'type':Sequelize[_0xf089('0x1')]}};
\ No newline at end of file
+var _0x02ef=['sequelize','STRING'];(function(_0x57ee8c,_0xe42849){var _0x3a2322=function(_0x5ea8b2){while(--_0x5ea8b2){_0x57ee8c['push'](_0x57ee8c['shift']());}};_0x3a2322(++_0xe42849);}(_0x02ef,0x11a));var _0xf02e=function(_0x4f5c62,_0xac8212){_0x4f5c62=_0x4f5c62-0x0;var _0x22af89=_0x02ef[_0x4f5c62];return _0x22af89;};'use strict';var Sequelize=require(_0xf02e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf02e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf02e('0x1')]},'dialPrefix':{'type':Sequelize[_0xf02e('0x1')]}};
\ No newline at end of file
index 3f97422..dbd8cc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe605=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','map','CmList','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','include','rows','catch','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','order','ListId','findAll','removeDispositions','ids','addContacts','CmContact','describe','tags','isArray','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','alias','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','toString','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','addColumn','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x149bc3,_0x4b09d8){var _0x5d33eb=function(_0x46af03){while(--_0x46af03){_0x149bc3['push'](_0x149bc3['shift']());}};_0x5d33eb(++_0x4b09d8);}(_0xe605,0x92));var _0x5e60=function(_0x3290d0,_0x4e1428){_0x3290d0=_0x3290d0-0x0;var _0x30469e=_0xe605[_0x3290d0];return _0x30469e;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x5e60('0x19')]=_[_0x5e60('0x1a')](config[_0x5e60('0x19')],{'host':_0x5e60('0x1b'),'port':0x18eb});var socket=require(_0x5e60('0x1c'))(new Redis(config[_0x5e60('0x19')]));require('./cmList.socket')[_0x5e60('0x1d')](socket);function respondWithStatusCode(_0x45304f,_0x21e3c8){_0x21e3c8=_0x21e3c8||0xcc;return function(_0x2a1c55){if(_0x2a1c55){return _0x45304f['sendStatus'](_0x21e3c8);}return _0x45304f[_0x5e60('0x1e')](_0x21e3c8)['end']();};}function respondWithResult(_0x1ffd77,_0x3bc7d8){_0x3bc7d8=_0x3bc7d8||0xc8;return function(_0x4cf084){if(_0x4cf084){return _0x1ffd77[_0x5e60('0x1e')](_0x3bc7d8)[_0x5e60('0x1f')](_0x4cf084);}};}function respondWithFilteredResult(_0xaa7d05,_0x43045a){return function(_0x5c485d){if(_0x5c485d){var _0xdd0a71=typeof _0x43045a[_0x5e60('0x20')]==='undefined'&&typeof _0x43045a[_0x5e60('0x21')]===_0x5e60('0x22');var _0x17c630=_0x5c485d[_0x5e60('0x23')];var _0x20db03=_0xdd0a71?0x0:_0x43045a[_0x5e60('0x20')];var _0x41294f=_0xdd0a71?_0x5c485d[_0x5e60('0x23')]:_0x43045a[_0x5e60('0x20')]+_0x43045a[_0x5e60('0x21')];var _0x228f13;if(_0x41294f>=_0x17c630){_0x41294f=_0x17c630;_0x228f13=0xc8;}else{_0x228f13=0xce;}_0xaa7d05['status'](_0x228f13);return _0xaa7d05[_0x5e60('0x24')]('Content-Range',_0x20db03+'-'+_0x41294f+'/'+_0x17c630)[_0x5e60('0x1f')](_0x5c485d);}return null;};}function patchUpdates(_0x1a44e5){return function(_0x2b0bae){try{jsonpatch[_0x5e60('0x25')](_0x2b0bae,_0x1a44e5,!![]);}catch(_0x34e98d){return BPromise[_0x5e60('0x26')](_0x34e98d);}return _0x2b0bae[_0x5e60('0x27')]();};}function saveUpdates(_0x5d2c03,_0x18d527){return function(_0x7dbdb7){if(_0x7dbdb7){return _0x7dbdb7[_0x5e60('0x28')](_0x5d2c03)['then'](function(_0x45cb62){return _0x45cb62;});}return null;};}function removeEntity(_0x56e3a5,_0x2d8aac){return function(_0x153459){if(_0x153459){return _0x153459['destroy']()[_0x5e60('0x29')](function(){var _0x5712f7=_0x153459[_0x5e60('0x2a')]({'plain':!![]});var _0x221322='Lists';return db[_0x5e60('0x2b')][_0x5e60('0x2c')]({'where':{'type':_0x221322,'resourceId':_0x5712f7['id']}})['then'](function(){return _0x153459;});})[_0x5e60('0x29')](function(){_0x56e3a5[_0x5e60('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5431a8,_0x52f668){return function(_0xf25956){if(!_0xf25956){_0x5431a8[_0x5e60('0x2d')](0x194);}return _0xf25956;};}function handleError(_0x2e8e9e,_0xf661e1){_0xf661e1=_0xf661e1||0x1f4;return function(_0x3ccfee){logger['error'](_0x3ccfee[_0x5e60('0x2e')]);if(_0x3ccfee[_0x5e60('0x2f')]){delete _0x3ccfee['name'];}_0x2e8e9e[_0x5e60('0x1e')](_0xf661e1)['send'](_0x3ccfee);};}exports['index']=function(_0x1035b0,_0x3c4340){var _0x1f474b={},_0x385c77={},_0xaf3a35={'count':0x0,'rows':[]};var _0xbf5b7a=_[_0x5e60('0x30')](db[_0x5e60('0x31')][_0x5e60('0x32')],function(_0x4702a6){return{'name':_0x4702a6['fieldName'],'type':_0x4702a6[_0x5e60('0x33')]['key']};});_0x385c77['model']=_[_0x5e60('0x30')](_0xbf5b7a,_0x5e60('0x2f'));_0x385c77['query']=_[_0x5e60('0x34')](_0x1035b0['query']);_0x385c77[_0x5e60('0x35')]=_[_0x5e60('0x36')](_0x385c77[_0x5e60('0x37')],_0x385c77[_0x5e60('0x38')]);_0x1f474b[_0x5e60('0x39')]=_[_0x5e60('0x36')](_0x385c77[_0x5e60('0x37')],qs[_0x5e60('0x3a')](_0x1035b0['query'][_0x5e60('0x3a')]));_0x1f474b[_0x5e60('0x39')]=_0x1f474b[_0x5e60('0x39')][_0x5e60('0x3b')]?_0x1f474b[_0x5e60('0x39')]:_0x385c77[_0x5e60('0x37')];if(!_0x1035b0[_0x5e60('0x38')]['hasOwnProperty'](_0x5e60('0x3c'))){_0x1f474b[_0x5e60('0x21')]=qs['limit'](_0x1035b0['query'][_0x5e60('0x21')]);_0x1f474b[_0x5e60('0x20')]=qs[_0x5e60('0x20')](_0x1035b0[_0x5e60('0x38')][_0x5e60('0x20')]);}_0x1f474b['order']=qs[_0x5e60('0x3d')](_0x1035b0[_0x5e60('0x38')][_0x5e60('0x3d')]);_0x1f474b[_0x5e60('0x3e')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3f')](_0x1035b0[_0x5e60('0x38')],_0x385c77['filters']),_0xbf5b7a);if(_0x1035b0[_0x5e60('0x38')][_0x5e60('0x40')]){_0x1f474b['where']=_['merge'](_0x1f474b['where'],{'$or':_[_0x5e60('0x30')](_0xbf5b7a,function(_0x1b80ad){if(_0x1b80ad[_0x5e60('0x33')]!==_0x5e60('0x41')){var _0x480ebb={};_0x480ebb[_0x1b80ad[_0x5e60('0x2f')]]={'$like':'%'+_0x1035b0[_0x5e60('0x38')]['filter']+'%'};return _0x480ebb;}})});}_0x1f474b=_['merge']({},_0x1f474b,_0x1035b0[_0x5e60('0x42')]);var _0x42b9b0={'where':_0x1f474b[_0x5e60('0x3e')]};return db[_0x5e60('0x31')][_0x5e60('0x23')](_0x42b9b0)[_0x5e60('0x29')](function(_0x2522d2){_0xaf3a35[_0x5e60('0x23')]=_0x2522d2;if(_0x1035b0[_0x5e60('0x38')]['includeAll']){_0x1f474b[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x31')]['findAll'](_0x1f474b);})[_0x5e60('0x29')](function(_0x4aac07){_0xaf3a35[_0x5e60('0x44')]=_0x4aac07;return _0xaf3a35;})[_0x5e60('0x29')](respondWithFilteredResult(_0x3c4340,_0x1f474b))[_0x5e60('0x45')](handleError(_0x3c4340,null));};exports['show']=function(_0x3f1a53,_0x140bee){var _0x172aff={'raw':![],'where':{'id':_0x3f1a53['params']['id']}},_0x46ced1={};_0x46ced1['model']=_['keys'](db[_0x5e60('0x31')][_0x5e60('0x32')]);_0x46ced1[_0x5e60('0x38')]=_[_0x5e60('0x34')](_0x3f1a53[_0x5e60('0x38')]);_0x46ced1[_0x5e60('0x35')]=_['intersection'](_0x46ced1[_0x5e60('0x37')],_0x46ced1[_0x5e60('0x38')]);_0x172aff[_0x5e60('0x39')]=_[_0x5e60('0x36')](_0x46ced1[_0x5e60('0x37')],qs[_0x5e60('0x3a')](_0x3f1a53[_0x5e60('0x38')]['fields']));_0x172aff[_0x5e60('0x39')]=_0x172aff[_0x5e60('0x39')][_0x5e60('0x3b')]?_0x172aff[_0x5e60('0x39')]:_0x46ced1[_0x5e60('0x37')];if(_0x3f1a53[_0x5e60('0x38')][_0x5e60('0x46')]){_0x172aff[_0x5e60('0x43')]=[{'all':!![]}];}_0x172aff=_[_0x5e60('0x47')]({},_0x172aff,_0x3f1a53[_0x5e60('0x42')]);return db[_0x5e60('0x31')][_0x5e60('0x48')](_0x172aff)[_0x5e60('0x29')](handleEntityNotFound(_0x140bee,null))[_0x5e60('0x29')](respondWithResult(_0x140bee,null))[_0x5e60('0x45')](handleError(_0x140bee,null));};exports[_0x5e60('0x49')]=function(_0x1800b7,_0x150c7e){return db['CmList']['create'](_0x1800b7[_0x5e60('0x4a')],{})['then'](function(_0x3525d){var _0x1d247e=_0x1800b7[_0x5e60('0x4b')][_0x5e60('0x2a')]({'plain':!![]});if(!_0x1d247e)throw new Error(_0x5e60('0x4c'));if(_0x1d247e[_0x5e60('0x4d')]==='user'){var _0x48bea6=_0x3525d[_0x5e60('0x2a')]({'plain':!![]});var _0x1e4e41=_0x5e60('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x1e4e41,'userProfileId':_0x1d247e[_0x5e60('0x4f')]},'raw':!![]})[_0x5e60('0x29')](function(_0x179cc6){if(_0x179cc6&&_0x179cc6['autoAssociation']===0x0){return db[_0x5e60('0x2b')][_0x5e60('0x49')]({'name':_0x48bea6[_0x5e60('0x2f')],'resourceId':_0x48bea6['id'],'type':_0x179cc6[_0x5e60('0x2f')],'sectionId':_0x179cc6['id']},{})[_0x5e60('0x29')](function(){return _0x3525d;});}else{return _0x3525d;}})[_0x5e60('0x45')](function(_0x4ae313){logger[_0x5e60('0x50')](_0x5e60('0x51'),_0x4ae313);throw _0x4ae313;});}return _0x3525d;})['then'](respondWithResult(_0x150c7e,0xc9))[_0x5e60('0x45')](handleError(_0x150c7e,null));};exports[_0x5e60('0x28')]=function(_0x430563,_0x5b3b99){if(_0x430563[_0x5e60('0x4a')]['id']){delete _0x430563[_0x5e60('0x4a')]['id'];}return db['CmList'][_0x5e60('0x48')]({'where':{'id':_0x430563[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x5b3b99,null))[_0x5e60('0x29')](saveUpdates(_0x430563['body'],null))[_0x5e60('0x29')](respondWithResult(_0x5b3b99,null))[_0x5e60('0x45')](handleError(_0x5b3b99,null));};exports['destroy']=function(_0x3cff0e,_0x4cb322){return db[_0x5e60('0x31')]['find']({'where':{'id':_0x3cff0e[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x4cb322,null))['then'](removeEntity(_0x4cb322,null))[_0x5e60('0x45')](handleError(_0x4cb322,null));};exports['describe']=function(_0x1a2094,_0x566fc7){return db[_0x5e60('0x31')]['describe']()[_0x5e60('0x29')](respondWithResult(_0x566fc7,null))[_0x5e60('0x45')](handleError(_0x566fc7,null));};exports[_0x5e60('0x53')]=function(_0x28c2de,_0x252fa3,_0x2b8343){if(_0x28c2de[_0x5e60('0x4a')]['id']){delete _0x28c2de['body']['id'];}return db[_0x5e60('0x31')][_0x5e60('0x48')]({'where':{'id':_0x28c2de[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x252fa3,null))[_0x5e60('0x29')](function(_0x35aad7){if(_0x35aad7){_0x28c2de['body']['ListId']=_0x35aad7['id'];return db['Disposition'][_0x5e60('0x49')](_0x28c2de[_0x5e60('0x4a')]);}})['then'](respondWithResult(_0x252fa3,null))[_0x5e60('0x45')](handleError(_0x252fa3,null));};exports[_0x5e60('0x54')]=function(_0x557f74,_0x2c9e7b,_0xb228a1){var _0xfa108b={'raw':![],'where':{}};var _0x32ef0b={};var _0x2c298b={'count':0x0,'rows':[]};return db[_0x5e60('0x31')][_0x5e60('0x55')]({'where':{'id':_0x557f74[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x2c9e7b,null))[_0x5e60('0x29')](function(_0x157aad){if(_0x157aad){_0x32ef0b[_0x5e60('0x37')]=_[_0x5e60('0x34')](db[_0x5e60('0x56')][_0x5e60('0x32')]);_0x32ef0b[_0x5e60('0x38')]=_[_0x5e60('0x34')](_0x557f74['query']);_0x32ef0b[_0x5e60('0x35')]=_[_0x5e60('0x36')](_0x32ef0b[_0x5e60('0x37')],_0x32ef0b['query']);_0xfa108b[_0x5e60('0x39')]=_[_0x5e60('0x36')](_0x32ef0b['model'],qs[_0x5e60('0x3a')](_0x557f74[_0x5e60('0x38')]['fields']));_0xfa108b[_0x5e60('0x39')]=_0xfa108b[_0x5e60('0x39')][_0x5e60('0x3b')]?_0xfa108b[_0x5e60('0x39')]:_0x32ef0b[_0x5e60('0x37')];if(!_0x557f74[_0x5e60('0x38')][_0x5e60('0x57')](_0x5e60('0x3c'))){_0xfa108b[_0x5e60('0x21')]=qs['limit'](_0x557f74[_0x5e60('0x38')][_0x5e60('0x21')]);_0xfa108b[_0x5e60('0x20')]=qs['offset'](_0x557f74[_0x5e60('0x38')][_0x5e60('0x20')]);}_0xfa108b[_0x5e60('0x58')]=qs[_0x5e60('0x3d')](_0x557f74[_0x5e60('0x38')]['sort']);_0xfa108b[_0x5e60('0x3e')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3f')](_0x557f74['query'],_0x32ef0b['filters']));_0xfa108b[_0x5e60('0x3e')][_0x5e60('0x59')]=_0x157aad['id'];if(_0x557f74[_0x5e60('0x38')][_0x5e60('0x40')]){_0xfa108b[_0x5e60('0x3e')]=_[_0x5e60('0x47')](_0xfa108b[_0x5e60('0x3e')],{'$or':_['map'](_0xfa108b[_0x5e60('0x39')],function(_0x199edd){var _0x3b9358={};_0x3b9358[_0x199edd]={'$like':'%'+_0x557f74['query']['filter']+'%'};return _0x3b9358;})});}_0xfa108b=_[_0x5e60('0x47')]({},_0xfa108b,_0x557f74[_0x5e60('0x42')]);return db[_0x5e60('0x56')]['count']({'where':_0xfa108b['where']})[_0x5e60('0x29')](function(_0x45cc9c){_0x2c298b[_0x5e60('0x23')]=_0x45cc9c;if(_0x557f74[_0x5e60('0x38')][_0x5e60('0x46')]){_0xfa108b[_0x5e60('0x43')]=[{'all':!![]}];}return db['Disposition'][_0x5e60('0x5a')](_0xfa108b);})[_0x5e60('0x29')](function(_0x1210e8){_0x2c298b[_0x5e60('0x44')]=_0x1210e8;return _0x2c298b;});}})[_0x5e60('0x29')](respondWithFilteredResult(_0x2c9e7b,_0xfa108b))[_0x5e60('0x45')](handleError(_0x2c9e7b,null));};exports[_0x5e60('0x5b')]=function(_0x92d9c5,_0x1095ee,_0x55d7d5){return db[_0x5e60('0x31')][_0x5e60('0x48')]({'where':{'id':_0x92d9c5['params']['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x1095ee,null))[_0x5e60('0x29')](function(_0x530a21){if(_0x530a21){return _0x530a21[_0x5e60('0x5b')](_0x92d9c5[_0x5e60('0x38')][_0x5e60('0x5c')]);}})[_0x5e60('0x29')](respondWithStatusCode(_0x1095ee,null))[_0x5e60('0x45')](handleError(_0x1095ee,null));};exports[_0x5e60('0x5d')]=function(_0x5d9784,_0x2dde78,_0x1425a2){return db[_0x5e60('0x31')][_0x5e60('0x48')]({'where':{'id':_0x5d9784[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x2dde78,null))[_0x5e60('0x29')](function(_0x3f6bb2){if(_0x3f6bb2){var _0xd939ad=[];var _0x58e900={'success':[],'errors':[]};return db[_0x5e60('0x5e')][_0x5e60('0x5f')]()[_0x5e60('0x29')](function(_0x3fae7f){if(_0x5d9784[_0x5e60('0x4a')][_0x5e60('0x60')]&&_[_0x5e60('0x61')](_0x5d9784[_0x5e60('0x4a')][_0x5e60('0x60')])){if(_0x5d9784[_0x5e60('0x4a')]['tags']['length']){_0x5d9784['body'][_0x5e60('0x60')]=_0x5d9784[_0x5e60('0x4a')][_0x5e60('0x60')][_0x5e60('0x62')](';')+';';}else{_0x5d9784[_0x5e60('0x4a')][_0x5e60('0x60')]=null;}}else{_0x5d9784[_0x5e60('0x4a')][_0x5e60('0x60')]=null;}if(_0x5d9784[_0x5e60('0x4a')]&&_['isArray'](_0x5d9784[_0x5e60('0x4a')])){for(var _0x42ac7c=0x0;_0x42ac7c<_0x5d9784[_0x5e60('0x4a')]['length'];_0x42ac7c+=0x1){_0x5d9784[_0x5e60('0x4a')][_0x42ac7c]['ListId']=_0x5d9784['params']['id'];_0xd939ad['push'](_0x5d9784[_0x5e60('0x4a')][_0x42ac7c]);}return BPromise[_0x5e60('0x63')](_0xd939ad,function(_0x111f65){return db[_0x5e60('0x5e')][_0x5e60('0x49')](_[_0x5e60('0x64')](_0x111f65,[_0x5e60('0x5c'),'id'])||{},{'fields':_[_0x5e60('0x34')](_0x3fae7f),'raw':!![]})[_0x5e60('0x29')](function(_0x4b9e1d){_0x58e900[_0x5e60('0x65')][_0x5e60('0x66')](_0x4b9e1d[_0x5e60('0x67')]);})[_0x5e60('0x45')](function(_0x388bec){_0x58e900[_0x5e60('0x68')][_0x5e60('0x66')]({'data':_0x111f65,'error':_0x388bec[_0x5e60('0x69')]});});})[_0x5e60('0x29')](function(_0x2163d1){return _0x58e900;})[_0x5e60('0x45')](function(_0xb8f01e){return _0xb8f01e;});}else{_0x2dde78['status'](0x190)[_0x5e60('0x1f')]({'message':_0x5e60('0x6a')});}});}})[_0x5e60('0x29')](respondWithResult(_0x2dde78,null))[_0x5e60('0x45')](handleError(_0x2dde78,null));};exports[_0x5e60('0x6b')]=function(_0x353101,_0x329409,_0x3b0062){var _0xcea76e;return db[_0x5e60('0x31')][_0x5e60('0x48')]({'where':{'id':_0x353101[_0x5e60('0x52')]['id']},'include':[{'model':db[_0x5e60('0x6c')],'as':_0x5e60('0x6d')}]})[_0x5e60('0x29')](handleEntityNotFound(_0x329409,null))[_0x5e60('0x29')](function(_0x534dd){if(_0x534dd){_0xcea76e=_0x534dd;return db[_0x5e60('0x5e')][_0x5e60('0x32')];}})[_0x5e60('0x29')](function(_0x5058b6){if(_0x5058b6){var _0x40ec50={};var _0x434042={};_0x434042[_0x5e60('0x37')]=_['concat'](_['keys'](_0x5058b6),_[_0x5e60('0x30')](_0xcea76e[_0x5e60('0x6d')],function(_0x5d556c){return util[_0x5e60('0x6e')](_0x5e60('0x6f'),_0x5d556c['id']);}));_0x434042[_0x5e60('0x38')]=_[_0x5e60('0x34')](_0x353101[_0x5e60('0x38')]);_0x434042[_0x5e60('0x35')]=_[_0x5e60('0x36')](_0x434042[_0x5e60('0x37')],_0x434042[_0x5e60('0x38')]);_0x40ec50[_0x5e60('0x39')]=_[_0x5e60('0x36')](_0x434042[_0x5e60('0x37')],qs[_0x5e60('0x3a')](_0x353101[_0x5e60('0x38')]['fields']));_0x40ec50[_0x5e60('0x39')]=_0x40ec50[_0x5e60('0x39')][_0x5e60('0x3b')]?_0x40ec50[_0x5e60('0x39')]:_0x434042['model'];if(!_0x353101[_0x5e60('0x38')][_0x5e60('0x57')](_0x5e60('0x3c'))){_0x40ec50['limit']=qs['limit'](_0x353101[_0x5e60('0x38')][_0x5e60('0x21')]);_0x40ec50[_0x5e60('0x20')]=qs[_0x5e60('0x20')](_0x353101['query'][_0x5e60('0x20')]);}_0x40ec50[_0x5e60('0x58')]=qs['sort'](_0x353101['query'][_0x5e60('0x3d')]);_0x40ec50[_0x5e60('0x3e')]=qs[_0x5e60('0x35')](_['pick'](_0x353101['query'],_0x434042['filters']));_0x40ec50[_0x5e60('0x70')]=!![];if(_0x353101[_0x5e60('0x38')][_0x5e60('0x40')]){_0x40ec50[_0x5e60('0x3e')]=_['merge'](_0x40ec50[_0x5e60('0x3e')],{'$or':_[_0x5e60('0x30')](_0x40ec50[_0x5e60('0x39')],function(_0x22c5ae){var _0x313bb9={};_0x313bb9[_0x22c5ae]={'$like':'%'+_0x353101[_0x5e60('0x38')]['filter']+'%'};return _0x313bb9;})});}_0x40ec50=_[_0x5e60('0x47')]({},_0x40ec50,_0x353101['options']);return _0xcea76e[_0x5e60('0x6b')](_0x40ec50);}})['then'](respondWithResult(_0x329409,null))[_0x5e60('0x45')](handleError(_0x329409,null));};exports['getContactsCsv']=function(_0x23d0e1,_0x1255dc,_0x1626d3){var _0x4176bc;var _0x7bcc8;var _0x1c71a5;var _0x2a0571=_0x23d0e1[_0x5e60('0x52')]['id'];csv_results=[];return db[_0x5e60('0x71')][_0x5e60('0x5a')]({'attributes':['id','name'],'raw':!![],'order':[_0x5e60('0x72')]})['then'](function(_0x6a0556){_0x4176bc=_0x6a0556;var _0x1d4076=_['keys'](db['CmContact'][_0x5e60('0x32')]);return db[_0x5e60('0x6c')][_0x5e60('0x5a')]({'raw':!![],'attributes':['id','alias']})[_0x5e60('0x29')](function(_0x44e210){_0x7bcc8=_0x44e210;var _0x36d9ed=squel[_0x5e60('0x73')]()[_0x5e60('0x3a')](_0x1d4076)[_0x5e60('0x74')](_0x5e60('0x75'),'c')[_0x5e60('0x3e')](_0x5e60('0x76'),_0x2a0571)[_0x5e60('0x77')]();for(var _0x1deaca=0x0;_0x1deaca<_0x7bcc8[_0x5e60('0x3b')];_0x1deaca++){_0x36d9ed[_0x5e60('0x78')](_0x5e60('0x79')+_0x7bcc8[_0x1deaca]['id'],_0x5e60('0x7a')+_0x7bcc8[_0x1deaca][_0x5e60('0x7b')]);}for(var _0x1deaca=0x0;_0x1deaca<_0x4176bc[_0x5e60('0x3b')];_0x1deaca++){_0x36d9ed[_0x5e60('0x78')](squel[_0x5e60('0x73')]()[_0x5e60('0x78')]('item')[_0x5e60('0x74')]('cm_contact_has_items')['where'](_0x5e60('0x7c'),_0x4176bc[_0x1deaca]['id'])['where'](_0x5e60('0x7d')),_0x5e60('0x7e')+_0x4176bc[_0x1deaca][_0x5e60('0x2f')]);_0x36d9ed[_0x5e60('0x78')](squel[_0x5e60('0x73')]()[_0x5e60('0x78')](_0x5e60('0x7f'))[_0x5e60('0x74')](_0x5e60('0x80'))['where'](_0x5e60('0x7c'),_0x4176bc[_0x1deaca]['id'])[_0x5e60('0x3e')](_0x5e60('0x7d')),'description_additionalPhone_'+_0x4176bc[_0x1deaca][_0x5e60('0x2f')]);}var _0x55afe5=[];_0x55afe5['push'](_0x36d9ed[_0x5e60('0x81')]());BPromise[_0x5e60('0x63')](_0x55afe5,handleQuery)[_0x5e60('0x29')](function(_0x3ee063){handleQuery(_0x36d9ed[_0x5e60('0x81')]());var _0xc5d1e7=csv_results[0x0];if(!_['isEmpty'](_0xc5d1e7)){var _0x3f5c73=toCsv(_0xc5d1e7);var _0xcdcce5=Date[_0x5e60('0x82')]();fs[_0x5e60('0x83')](util[_0x5e60('0x6e')]('/tmp/list_%d_%s.csv',_0x2a0571,_0xcdcce5),_0x3f5c73);_0x1255dc[_0x5e60('0x84')](_0x5e60('0x85'),_0x5e60('0x86')+util['format'](_0x5e60('0x87'),_0x2a0571,_0xcdcce5));_0x1255dc[_0x5e60('0x84')](_0x5e60('0x88'),_0x5e60('0x89'));return _0x1255dc[_0x5e60('0x8a')](util['format'](_0x5e60('0x8b'),_0x2a0571,_0xcdcce5));}else{return _0x1255dc['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x3e20f8,_0x310ee7,_0x5108dc){var _0x45ef48;delete _0x3e20f8[_0x5e60('0x4a')]['id'];return db[_0x5e60('0x31')][_0x5e60('0x55')]({'where':{'id':_0x3e20f8[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x310ee7,null))[_0x5e60('0x29')](function(_0x4946a8){if(_0x4946a8){return db[_0x5e60('0x8c')]['transaction'](function(_0x358542){return db[_0x5e60('0x6c')][_0x5e60('0x49')](_0x3e20f8[_0x5e60('0x4a')],{'transaction':_0x358542})[_0x5e60('0x29')](function(_0x4952cb){_0x45ef48=_0x4952cb;return _0x4946a8[_0x5e60('0x8d')](_0x4952cb,{'transaction':_0x358542});})[_0x5e60('0x29')](function(){var _0x526c1a={'type':db[_0x5e60('0x8e')][_0x5e60('0x8f')],'transaction':_0x358542};switch(_0x3e20f8[_0x5e60('0x4a')][_0x5e60('0x33')]){case _0x5e60('0x90'):_0x526c1a[_0x5e60('0x33')]=db[_0x5e60('0x8e')][_0x5e60('0x8f')];break;case _0x5e60('0x91'):_0x526c1a[_0x5e60('0x33')]=db[_0x5e60('0x8e')][_0x5e60('0x92')];break;case'switch':_0x526c1a['type']=db[_0x5e60('0x8e')][_0x5e60('0x93')];_0x526c1a[_0x5e60('0x94')]=![];break;default:}return db[_0x5e60('0x8c')]['queryInterface'][_0x5e60('0x95')](_0x5e60('0x75'),util['format']('cf_%s',_0x45ef48['id']),_0x526c1a);})[_0x5e60('0x29')](function(){return _0x45ef48;});});}})[_0x5e60('0x29')](respondWithResult(_0x310ee7,null))[_0x5e60('0x45')](handleError(_0x310ee7,null));};exports[_0x5e60('0x96')]=function(_0x1176eb,_0x44da83,_0x262269){var _0x4f4602={};var _0x30d913={};var _0x53b56e;var _0x2952bf;return db[_0x5e60('0x31')][_0x5e60('0x55')]({'where':{'id':_0x1176eb['params']['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x44da83,null))['then'](function(_0x2f2def){if(_0x2f2def){_0x53b56e=_0x2f2def;_0x30d913[_0x5e60('0x37')]=_[_0x5e60('0x34')](db[_0x5e60('0x6c')][_0x5e60('0x32')]);_0x30d913['query']=_[_0x5e60('0x34')](_0x1176eb['query']);_0x30d913[_0x5e60('0x35')]=_[_0x5e60('0x36')](_0x30d913[_0x5e60('0x37')],_0x30d913['query']);_0x4f4602[_0x5e60('0x39')]=_[_0x5e60('0x36')](_0x30d913[_0x5e60('0x37')],qs[_0x5e60('0x3a')](_0x1176eb[_0x5e60('0x38')][_0x5e60('0x3a')]));_0x4f4602['attributes']=_0x4f4602[_0x5e60('0x39')][_0x5e60('0x3b')]?_0x4f4602['attributes']:_0x30d913[_0x5e60('0x37')];_0x4f4602['order']=qs['sort'](_0x1176eb[_0x5e60('0x38')][_0x5e60('0x3d')]);_0x4f4602[_0x5e60('0x3e')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3f')](_0x1176eb[_0x5e60('0x38')],_0x30d913[_0x5e60('0x35')]));_0x4f4602[_0x5e60('0x3e')]=_[_0x5e60('0x47')](_0x4f4602[_0x5e60('0x3e')],{'$or':[{'ListId':_0x2f2def['id']},{'ListId':null}]});if(_0x1176eb[_0x5e60('0x38')][_0x5e60('0x40')]){_0x4f4602[_0x5e60('0x3e')]=_[_0x5e60('0x47')](_0x4f4602[_0x5e60('0x3e')],{'$or':_['map'](_0x4f4602['attributes'],function(_0x16f478){var _0x499dc0={};_0x499dc0[_0x16f478]={'$like':'%'+_0x1176eb[_0x5e60('0x38')][_0x5e60('0x40')]+'%'};return _0x499dc0;})});}_0x4f4602=_[_0x5e60('0x47')]({},_0x4f4602,_0x1176eb[_0x5e60('0x42')]);return db[_0x5e60('0x6c')][_0x5e60('0x97')](_0x4f4602);}})['then'](respondWithResult(_0x44da83,null))[_0x5e60('0x45')](handleError(_0x44da83,null));};exports[_0x5e60('0x98')]=function(_0xe53dbf,_0x39c186,_0x2f1430){return db[_0x5e60('0x31')]['find']({'where':{'id':_0xe53dbf['params']['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x39c186,null))[_0x5e60('0x29')](function(_0x569cd3){if(_0x569cd3){return _0x569cd3[_0x5e60('0x98')](_0xe53dbf[_0x5e60('0x4a')][_0x5e60('0x5c')],_['omit'](_0xe53dbf[_0x5e60('0x4a')],[_0x5e60('0x5c'),'id'])||{})[_0x5e60('0x99')](function(_0x890d37){for(var _0xdcabc6=0x0;_0xdcabc6<_0xe53dbf[_0x5e60('0x4a')][_0x5e60('0x5c')][_0x5e60('0x3b')];_0xdcabc6+=0x1){socket[_0x5e60('0x9a')](_0x5e60('0x9b'),{'UserId':Number(_0xe53dbf['body'][_0x5e60('0x5c')][_0xdcabc6]),'CmListId':Number(_0xe53dbf[_0x5e60('0x52')]['id'])});}return _0x890d37;});}})[_0x5e60('0x29')](respondWithResult(_0x39c186,null))['catch'](handleError(_0x39c186,null));};exports[_0x5e60('0x9c')]=function(_0x8051af,_0x49491a,_0x2ac9f6){return db[_0x5e60('0x31')][_0x5e60('0x48')]({'where':{'id':_0x8051af[_0x5e60('0x52')]['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x49491a,null))['then'](function(_0x4d0636){if(_0x4d0636){return _0x4d0636[_0x5e60('0x9c')](_0x8051af[_0x5e60('0x38')][_0x5e60('0x5c')])['then'](function(){if(_[_0x5e60('0x61')](_0x8051af[_0x5e60('0x38')][_0x5e60('0x5c')])){for(var _0x4bd289=0x0;_0x4bd289<_0x8051af[_0x5e60('0x38')][_0x5e60('0x5c')][_0x5e60('0x3b')];_0x4bd289+=0x1){socket[_0x5e60('0x9a')](_0x5e60('0x9d'),{'UserId':Number(_0x8051af[_0x5e60('0x38')][_0x5e60('0x5c')][_0x4bd289]),'CmListId':Number(_0x8051af[_0x5e60('0x52')]['id'])});}}else{socket[_0x5e60('0x9a')]('userCmList:remove',{'UserId':Number(_0x8051af[_0x5e60('0x38')][_0x5e60('0x5c')]),'CmListId':Number(_0x8051af[_0x5e60('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x49491a,null))[_0x5e60('0x45')](handleError(_0x49491a,null));};exports['getAgents']=function(_0x26a324,_0x3fa8fd,_0x4b2485){var _0x269ffc={};var _0x2ae16b={};var _0x1e11f2;var _0x13032c;return db['CmList'][_0x5e60('0x55')]({'where':{'id':_0x26a324['params']['id']}})[_0x5e60('0x29')](handleEntityNotFound(_0x3fa8fd,null))['then'](function(_0x518943){if(_0x518943){_0x1e11f2=_0x518943;_0x2ae16b[_0x5e60('0x37')]=_['keys'](db[_0x5e60('0x9e')][_0x5e60('0x32')]);_0x2ae16b['query']=_[_0x5e60('0x34')](_0x26a324[_0x5e60('0x38')]);_0x2ae16b[_0x5e60('0x35')]=_[_0x5e60('0x36')](_0x2ae16b[_0x5e60('0x37')],_0x2ae16b[_0x5e60('0x38')]);_0x269ffc['attributes']=_[_0x5e60('0x36')](_0x2ae16b[_0x5e60('0x37')],qs[_0x5e60('0x3a')](_0x26a324[_0x5e60('0x38')][_0x5e60('0x3a')]));_0x269ffc[_0x5e60('0x39')]=_0x269ffc[_0x5e60('0x39')][_0x5e60('0x3b')]?_0x269ffc[_0x5e60('0x39')]:_0x2ae16b[_0x5e60('0x37')];_0x269ffc['order']=qs['sort'](_0x26a324[_0x5e60('0x38')][_0x5e60('0x3d')]);_0x269ffc[_0x5e60('0x3e')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3f')](_0x26a324[_0x5e60('0x38')],_0x2ae16b['filters']));if(_0x26a324[_0x5e60('0x38')][_0x5e60('0x40')]){_0x269ffc['where']=_[_0x5e60('0x47')](_0x269ffc[_0x5e60('0x3e')],{'$or':_['map'](_0x269ffc[_0x5e60('0x39')],function(_0x207b3e){var _0x2acac9={};_0x2acac9[_0x207b3e]={'$like':'%'+_0x26a324['query']['filter']+'%'};return _0x2acac9;})});}_0x269ffc=_['merge']({},_0x269ffc,_0x26a324[_0x5e60('0x42')]);return _0x1e11f2['getAgents'](_0x269ffc);}})['then'](function(_0x56baa2){if(_0x56baa2){_0x13032c=_0x56baa2[_0x5e60('0x3b')];if(!_0x26a324['query'][_0x5e60('0x57')](_0x5e60('0x3c'))){_0x269ffc[_0x5e60('0x21')]=qs['limit'](_0x26a324[_0x5e60('0x38')][_0x5e60('0x21')]);_0x269ffc['offset']=qs['offset'](_0x26a324['query'][_0x5e60('0x20')]);}return _0x1e11f2[_0x5e60('0x9f')](_0x269ffc);}})['then'](function(_0x1e0be3){if(_0x1e0be3){return _0x1e0be3?{'count':_0x13032c,'rows':_0x1e0be3}:null;}})[_0x5e60('0x29')](respondWithResult(_0x3fa8fd,null))['catch'](handleError(_0x3fa8fd,null));};function handleQuery(_0x398710){logger[_0x5e60('0xa0')](_0x398710);return db[_0x5e60('0x8c')][_0x5e60('0x38')](_0x398710)['spread'](function(_0x2a8af7){csv_results['push'](_0x2a8af7);})[_0x5e60('0x45')](function(_0x29cdd0){logger['error'](_0x29cdd0[_0x5e60('0x69')]);});}
\ No newline at end of file
+var _0xb58b=['emit','userCmList:remove','User','getAgents','info','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','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','end','offset','limit','undefined','count','status','set','Content-Range','json','save','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','addContacts','CmContact','isArray','tags','join','each','omit','ids','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','findAll','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','c.cf_','customField_','field','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','getCustomFields','addAgents','spread','removeAgents'];(function(_0x19aa99,_0x55e125){var _0x5ac324=function(_0x13bded){while(--_0x13bded){_0x19aa99['push'](_0x19aa99['shift']());}};_0x5ac324(++_0x55e125);}(_0xb58b,0x1f1));var _0xbb58=function(_0x442a4d,_0x5ea9a8){_0x442a4d=_0x442a4d-0x0;var _0x15bc47=_0xb58b[_0x442a4d];return _0x15bc47;};'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'];var csv_results;config[_0xbb58('0x18')]=_[_0xbb58('0x19')](config['redis'],{'host':_0xbb58('0x1a'),'port':0x18eb});var socket=require(_0xbb58('0x1b'))(new Redis(config[_0xbb58('0x18')]));require(_0xbb58('0x1c'))[_0xbb58('0x1d')](socket);function respondWithStatusCode(_0x58245f,_0x110944){_0x110944=_0x110944||0xcc;return function(_0x23fd15){if(_0x23fd15){return _0x58245f['sendStatus'](_0x110944);}return _0x58245f['status'](_0x110944)[_0xbb58('0x1e')]();};}function respondWithResult(_0x445b1f,_0x38d69a){_0x38d69a=_0x38d69a||0xc8;return function(_0x47c927){if(_0x47c927){return _0x445b1f['status'](_0x38d69a)['json'](_0x47c927);}};}function respondWithFilteredResult(_0x55156e,_0x28637b){return function(_0x3134ea){if(_0x3134ea){var _0x48f3e0=typeof _0x28637b[_0xbb58('0x1f')]==='undefined'&&typeof _0x28637b[_0xbb58('0x20')]===_0xbb58('0x21');var _0x3c33d9=_0x3134ea[_0xbb58('0x22')];var _0x3d961a=_0x48f3e0?0x0:_0x28637b[_0xbb58('0x1f')];var _0x32d694=_0x48f3e0?_0x3134ea['count']:_0x28637b[_0xbb58('0x1f')]+_0x28637b[_0xbb58('0x20')];var _0x3e64fe;if(_0x32d694>=_0x3c33d9){_0x32d694=_0x3c33d9;_0x3e64fe=0xc8;}else{_0x3e64fe=0xce;}_0x55156e[_0xbb58('0x23')](_0x3e64fe);return _0x55156e[_0xbb58('0x24')](_0xbb58('0x25'),_0x3d961a+'-'+_0x32d694+'/'+_0x3c33d9)[_0xbb58('0x26')](_0x3134ea);}return null;};}function patchUpdates(_0x350be7){return function(_0x27bbec){try{jsonpatch['apply'](_0x27bbec,_0x350be7,!![]);}catch(_0x27806d){return BPromise['reject'](_0x27806d);}return _0x27bbec[_0xbb58('0x27')]();};}function saveUpdates(_0x287822,_0x152f22){return function(_0x3e215c){if(_0x3e215c){return _0x3e215c[_0xbb58('0x28')](_0x287822)[_0xbb58('0x29')](function(_0x2d556a){return _0x2d556a;});}return null;};}function removeEntity(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(_0x283dff){return _0x283dff[_0xbb58('0x2a')]()[_0xbb58('0x29')](function(){var _0x129094=_0x283dff[_0xbb58('0x2b')]({'plain':!![]});var _0x521d0c=_0xbb58('0x2c');return db[_0xbb58('0x2d')][_0xbb58('0x2a')]({'where':{'type':_0x521d0c,'resourceId':_0x129094['id']}})[_0xbb58('0x29')](function(){return _0x283dff;});})[_0xbb58('0x29')](function(){_0x15e4c5[_0xbb58('0x23')](0xcc)[_0xbb58('0x1e')]();});}};}function handleEntityNotFound(_0x4157c4,_0x3559b6){return function(_0x573cca){if(!_0x573cca){_0x4157c4[_0xbb58('0x2e')](0x194);}return _0x573cca;};}function handleError(_0xe46bc1,_0x12b3eb){_0x12b3eb=_0x12b3eb||0x1f4;return function(_0x3c9cee){logger[_0xbb58('0x2f')](_0x3c9cee[_0xbb58('0x30')]);if(_0x3c9cee[_0xbb58('0x31')]){delete _0x3c9cee[_0xbb58('0x31')];}_0xe46bc1[_0xbb58('0x23')](_0x12b3eb)['send'](_0x3c9cee);};}exports[_0xbb58('0x32')]=function(_0x22329b,_0x3edc34){var _0x3a1e46={},_0xdbbe7b={},_0x33f931={'count':0x0,'rows':[]};var _0x409904=_[_0xbb58('0x33')](db[_0xbb58('0x34')][_0xbb58('0x35')],function(_0x389187){return{'name':_0x389187[_0xbb58('0x36')],'type':_0x389187[_0xbb58('0x37')]['key']};});_0xdbbe7b['model']=_['map'](_0x409904,_0xbb58('0x31'));_0xdbbe7b[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x22329b[_0xbb58('0x38')]);_0xdbbe7b[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0xdbbe7b[_0xbb58('0x3c')],_0xdbbe7b[_0xbb58('0x38')]);_0x3a1e46['attributes']=_[_0xbb58('0x3b')](_0xdbbe7b[_0xbb58('0x3c')],qs['fields'](_0x22329b[_0xbb58('0x38')]['fields']));_0x3a1e46[_0xbb58('0x3d')]=_0x3a1e46['attributes'][_0xbb58('0x3e')]?_0x3a1e46[_0xbb58('0x3d')]:_0xdbbe7b['model'];if(!_0x22329b[_0xbb58('0x38')][_0xbb58('0x3f')](_0xbb58('0x40'))){_0x3a1e46[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x22329b[_0xbb58('0x38')][_0xbb58('0x20')]);_0x3a1e46[_0xbb58('0x1f')]=qs['offset'](_0x22329b[_0xbb58('0x38')][_0xbb58('0x1f')]);}_0x3a1e46[_0xbb58('0x41')]=qs['sort'](_0x22329b['query'][_0xbb58('0x42')]);_0x3a1e46['where']=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x22329b[_0xbb58('0x38')],_0xdbbe7b['filters']),_0x409904);if(_0x22329b['query'][_0xbb58('0x44')]){_0x3a1e46[_0xbb58('0x45')]=_[_0xbb58('0x46')](_0x3a1e46[_0xbb58('0x45')],{'$or':_[_0xbb58('0x33')](_0x409904,function(_0xbd13f2){if(_0xbd13f2['type']!==_0xbb58('0x47')){var _0x1d8765={};_0x1d8765[_0xbd13f2[_0xbb58('0x31')]]={'$like':'%'+_0x22329b[_0xbb58('0x38')][_0xbb58('0x44')]+'%'};return _0x1d8765;}})});}_0x3a1e46=_[_0xbb58('0x46')]({},_0x3a1e46,_0x22329b['options']);var _0x360765={'where':_0x3a1e46['where']};return db[_0xbb58('0x34')][_0xbb58('0x22')](_0x360765)[_0xbb58('0x29')](function(_0x45817f){_0x33f931['count']=_0x45817f;if(_0x22329b[_0xbb58('0x38')][_0xbb58('0x48')]){_0x3a1e46[_0xbb58('0x49')]=[{'all':!![]}];}return db[_0xbb58('0x34')]['findAll'](_0x3a1e46);})[_0xbb58('0x29')](function(_0x5250e0){_0x33f931[_0xbb58('0x4a')]=_0x5250e0;return _0x33f931;})[_0xbb58('0x29')](respondWithFilteredResult(_0x3edc34,_0x3a1e46))[_0xbb58('0x4b')](handleError(_0x3edc34,null));};exports[_0xbb58('0x4c')]=function(_0x17f20d,_0xca9498){var _0x666a57={'raw':![],'where':{'id':_0x17f20d[_0xbb58('0x4d')]['id']}},_0xa92db6={};_0xa92db6[_0xbb58('0x3c')]=_[_0xbb58('0x39')](db[_0xbb58('0x34')][_0xbb58('0x35')]);_0xa92db6['query']=_[_0xbb58('0x39')](_0x17f20d['query']);_0xa92db6['filters']=_[_0xbb58('0x3b')](_0xa92db6[_0xbb58('0x3c')],_0xa92db6[_0xbb58('0x38')]);_0x666a57[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0xa92db6[_0xbb58('0x3c')],qs[_0xbb58('0x4e')](_0x17f20d[_0xbb58('0x38')][_0xbb58('0x4e')]));_0x666a57[_0xbb58('0x3d')]=_0x666a57[_0xbb58('0x3d')]['length']?_0x666a57[_0xbb58('0x3d')]:_0xa92db6[_0xbb58('0x3c')];if(_0x17f20d['query'][_0xbb58('0x48')]){_0x666a57[_0xbb58('0x49')]=[{'all':!![]}];}_0x666a57=_[_0xbb58('0x46')]({},_0x666a57,_0x17f20d[_0xbb58('0x4f')]);return db['CmList'][_0xbb58('0x50')](_0x666a57)['then'](handleEntityNotFound(_0xca9498,null))[_0xbb58('0x29')](respondWithResult(_0xca9498,null))[_0xbb58('0x4b')](handleError(_0xca9498,null));};exports[_0xbb58('0x51')]=function(_0x4d0279,_0x2c0a0c){return db[_0xbb58('0x34')]['create'](_0x4d0279[_0xbb58('0x52')],{})['then'](function(_0x28301d){var _0x2d81e0=_0x4d0279[_0xbb58('0x53')][_0xbb58('0x2b')]({'plain':!![]});if(!_0x2d81e0)throw new Error(_0xbb58('0x54'));if(_0x2d81e0[_0xbb58('0x55')]===_0xbb58('0x53')){var _0x4cb975=_0x28301d[_0xbb58('0x2b')]({'plain':!![]});var _0x1fd892='Lists';return db[_0xbb58('0x56')][_0xbb58('0x50')]({'where':{'name':_0x1fd892,'userProfileId':_0x2d81e0['userProfileId']},'raw':!![]})[_0xbb58('0x29')](function(_0x44636b){if(_0x44636b&&_0x44636b[_0xbb58('0x57')]===0x0){return db['UserProfileResource'][_0xbb58('0x51')]({'name':_0x4cb975[_0xbb58('0x31')],'resourceId':_0x4cb975['id'],'type':_0x44636b[_0xbb58('0x31')],'sectionId':_0x44636b['id']},{})['then'](function(){return _0x28301d;});}else{return _0x28301d;}})[_0xbb58('0x4b')](function(_0x5cf2b9){logger[_0xbb58('0x2f')](_0xbb58('0x58'),_0x5cf2b9);throw _0x5cf2b9;});}return _0x28301d;})[_0xbb58('0x29')](respondWithResult(_0x2c0a0c,0xc9))['catch'](handleError(_0x2c0a0c,null));};exports['update']=function(_0x1573d1,_0x40c55d){if(_0x1573d1[_0xbb58('0x52')]['id']){delete _0x1573d1[_0xbb58('0x52')]['id'];}return db[_0xbb58('0x34')]['find']({'where':{'id':_0x1573d1[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x40c55d,null))[_0xbb58('0x29')](saveUpdates(_0x1573d1['body'],null))[_0xbb58('0x29')](respondWithResult(_0x40c55d,null))[_0xbb58('0x4b')](handleError(_0x40c55d,null));};exports[_0xbb58('0x2a')]=function(_0x3365ae,_0x3f5add){return db['CmList'][_0xbb58('0x50')]({'where':{'id':_0x3365ae[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x3f5add,null))[_0xbb58('0x29')](removeEntity(_0x3f5add,null))[_0xbb58('0x4b')](handleError(_0x3f5add,null));};exports[_0xbb58('0x59')]=function(_0x85278c,_0x58ced2){return db['CmList'][_0xbb58('0x59')]()['then'](respondWithResult(_0x58ced2,null))[_0xbb58('0x4b')](handleError(_0x58ced2,null));};exports[_0xbb58('0x5a')]=function(_0x3862c9,_0x2a6963,_0x3d6fba){if(_0x3862c9[_0xbb58('0x52')]['id']){delete _0x3862c9[_0xbb58('0x52')]['id'];}return db[_0xbb58('0x34')][_0xbb58('0x50')]({'where':{'id':_0x3862c9[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x2a6963,null))['then'](function(_0x3933f0){if(_0x3933f0){_0x3862c9[_0xbb58('0x52')][_0xbb58('0x5b')]=_0x3933f0['id'];return db['Disposition'][_0xbb58('0x51')](_0x3862c9['body']);}})[_0xbb58('0x29')](respondWithResult(_0x2a6963,null))[_0xbb58('0x4b')](handleError(_0x2a6963,null));};exports['getDispositions']=function(_0x143a40,_0x2ad5a5,_0x452da6){var _0x18a817={'raw':![],'where':{}};var _0xcac910={};var _0x4e79be={'count':0x0,'rows':[]};return db['CmList'][_0xbb58('0x5c')]({'where':{'id':_0x143a40[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x2ad5a5,null))['then'](function(_0x11d41e){if(_0x11d41e){_0xcac910[_0xbb58('0x3c')]=_['keys'](db[_0xbb58('0x5d')][_0xbb58('0x35')]);_0xcac910['query']=_[_0xbb58('0x39')](_0x143a40[_0xbb58('0x38')]);_0xcac910[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0xcac910[_0xbb58('0x3c')],_0xcac910['query']);_0x18a817[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0xcac910[_0xbb58('0x3c')],qs[_0xbb58('0x4e')](_0x143a40[_0xbb58('0x38')]['fields']));_0x18a817['attributes']=_0x18a817[_0xbb58('0x3d')]['length']?_0x18a817[_0xbb58('0x3d')]:_0xcac910[_0xbb58('0x3c')];if(!_0x143a40[_0xbb58('0x38')][_0xbb58('0x3f')](_0xbb58('0x40'))){_0x18a817[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x143a40[_0xbb58('0x38')][_0xbb58('0x20')]);_0x18a817[_0xbb58('0x1f')]=qs['offset'](_0x143a40[_0xbb58('0x38')][_0xbb58('0x1f')]);}_0x18a817[_0xbb58('0x41')]=qs['sort'](_0x143a40[_0xbb58('0x38')]['sort']);_0x18a817['where']=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x143a40[_0xbb58('0x38')],_0xcac910[_0xbb58('0x3a')]));_0x18a817['where']['ListId']=_0x11d41e['id'];if(_0x143a40[_0xbb58('0x38')][_0xbb58('0x44')]){_0x18a817['where']=_[_0xbb58('0x46')](_0x18a817[_0xbb58('0x45')],{'$or':_[_0xbb58('0x33')](_0x18a817[_0xbb58('0x3d')],function(_0x382d16){var _0x55d3c5={};_0x55d3c5[_0x382d16]={'$like':'%'+_0x143a40[_0xbb58('0x38')]['filter']+'%'};return _0x55d3c5;})});}_0x18a817=_['merge']({},_0x18a817,_0x143a40[_0xbb58('0x4f')]);return db[_0xbb58('0x5d')][_0xbb58('0x22')]({'where':_0x18a817['where']})[_0xbb58('0x29')](function(_0x3d4750){_0x4e79be[_0xbb58('0x22')]=_0x3d4750;if(_0x143a40[_0xbb58('0x38')]['includeAll']){_0x18a817[_0xbb58('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x18a817);})[_0xbb58('0x29')](function(_0x16e6eb){_0x4e79be[_0xbb58('0x4a')]=_0x16e6eb;return _0x4e79be;});}})['then'](respondWithFilteredResult(_0x2ad5a5,_0x18a817))['catch'](handleError(_0x2ad5a5,null));};exports[_0xbb58('0x5e')]=function(_0xb299d7,_0x361d0e,_0x2627a8){return db[_0xbb58('0x34')][_0xbb58('0x50')]({'where':{'id':_0xb299d7[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x361d0e,null))[_0xbb58('0x29')](function(_0x163ca4){if(_0x163ca4){return _0x163ca4[_0xbb58('0x5e')](_0xb299d7['query']['ids']);}})[_0xbb58('0x29')](respondWithStatusCode(_0x361d0e,null))[_0xbb58('0x4b')](handleError(_0x361d0e,null));};exports[_0xbb58('0x5f')]=function(_0x54cd7d,_0x177855,_0x2fadc2){return db[_0xbb58('0x34')]['find']({'where':{'id':_0x54cd7d[_0xbb58('0x4d')]['id']}})['then'](handleEntityNotFound(_0x177855,null))[_0xbb58('0x29')](function(_0x47fd65){if(_0x47fd65){var _0x13935d=[];var _0x35dc6e={'success':[],'errors':[]};return db[_0xbb58('0x60')][_0xbb58('0x59')]()[_0xbb58('0x29')](function(_0xf5e243){if(_0x54cd7d['body']['tags']&&_[_0xbb58('0x61')](_0x54cd7d[_0xbb58('0x52')]['tags'])){if(_0x54cd7d[_0xbb58('0x52')][_0xbb58('0x62')][_0xbb58('0x3e')]){_0x54cd7d['body'][_0xbb58('0x62')]=_0x54cd7d['body'][_0xbb58('0x62')][_0xbb58('0x63')](';')+';';}else{_0x54cd7d[_0xbb58('0x52')][_0xbb58('0x62')]=null;}}else{_0x54cd7d[_0xbb58('0x52')][_0xbb58('0x62')]=null;}if(_0x54cd7d[_0xbb58('0x52')]&&_['isArray'](_0x54cd7d[_0xbb58('0x52')])){for(var _0x2562cf=0x0;_0x2562cf<_0x54cd7d[_0xbb58('0x52')]['length'];_0x2562cf+=0x1){_0x54cd7d[_0xbb58('0x52')][_0x2562cf][_0xbb58('0x5b')]=_0x54cd7d['params']['id'];_0x13935d['push'](_0x54cd7d[_0xbb58('0x52')][_0x2562cf]);}return BPromise[_0xbb58('0x64')](_0x13935d,function(_0x1caa1c){return db['CmContact']['create'](_[_0xbb58('0x65')](_0x1caa1c,[_0xbb58('0x66'),'id'])||{},{'fields':_[_0xbb58('0x39')](_0xf5e243),'raw':!![]})[_0xbb58('0x29')](function(_0x2c8921){_0x35dc6e[_0xbb58('0x67')][_0xbb58('0x68')](_0x2c8921[_0xbb58('0x69')]);})[_0xbb58('0x4b')](function(_0x133785){_0x35dc6e[_0xbb58('0x6a')][_0xbb58('0x68')]({'data':_0x1caa1c,'error':_0x133785[_0xbb58('0x6b')]});});})[_0xbb58('0x29')](function(_0x218e3b){return _0x35dc6e;})['catch'](function(_0x62a590){return _0x62a590;});}else{_0x177855['status'](0x190)[_0xbb58('0x26')]({'message':_0xbb58('0x6c')});}});}})[_0xbb58('0x29')](respondWithResult(_0x177855,null))[_0xbb58('0x4b')](handleError(_0x177855,null));};exports[_0xbb58('0x6d')]=function(_0x16419f,_0x2d22b7,_0x44ce1d){var _0x182b8c;return db[_0xbb58('0x34')]['find']({'where':{'id':_0x16419f[_0xbb58('0x4d')]['id']},'include':[{'model':db[_0xbb58('0x6e')],'as':_0xbb58('0x6f')}]})[_0xbb58('0x29')](handleEntityNotFound(_0x2d22b7,null))[_0xbb58('0x29')](function(_0x528220){if(_0x528220){_0x182b8c=_0x528220;return db[_0xbb58('0x60')]['rawAttributes'];}})['then'](function(_0x3b9c4c){if(_0x3b9c4c){var _0x4acfcf={};var _0x307ce6={};_0x307ce6['model']=_[_0xbb58('0x70')](_['keys'](_0x3b9c4c),_[_0xbb58('0x33')](_0x182b8c[_0xbb58('0x6f')],function(_0x138700){return util[_0xbb58('0x71')](_0xbb58('0x72'),_0x138700['id']);}));_0x307ce6[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x16419f[_0xbb58('0x38')]);_0x307ce6['filters']=_['intersection'](_0x307ce6[_0xbb58('0x3c')],_0x307ce6[_0xbb58('0x38')]);_0x4acfcf['attributes']=_['intersection'](_0x307ce6['model'],qs[_0xbb58('0x4e')](_0x16419f[_0xbb58('0x38')]['fields']));_0x4acfcf[_0xbb58('0x3d')]=_0x4acfcf[_0xbb58('0x3d')][_0xbb58('0x3e')]?_0x4acfcf[_0xbb58('0x3d')]:_0x307ce6[_0xbb58('0x3c')];if(!_0x16419f[_0xbb58('0x38')][_0xbb58('0x3f')](_0xbb58('0x40'))){_0x4acfcf['limit']=qs[_0xbb58('0x20')](_0x16419f[_0xbb58('0x38')]['limit']);_0x4acfcf['offset']=qs[_0xbb58('0x1f')](_0x16419f[_0xbb58('0x38')][_0xbb58('0x1f')]);}_0x4acfcf[_0xbb58('0x41')]=qs[_0xbb58('0x42')](_0x16419f['query'][_0xbb58('0x42')]);_0x4acfcf[_0xbb58('0x45')]=qs['filters'](_[_0xbb58('0x43')](_0x16419f[_0xbb58('0x38')],_0x307ce6[_0xbb58('0x3a')]));_0x4acfcf['raw']=!![];if(_0x16419f[_0xbb58('0x38')][_0xbb58('0x44')]){_0x4acfcf['where']=_[_0xbb58('0x46')](_0x4acfcf[_0xbb58('0x45')],{'$or':_['map'](_0x4acfcf['attributes'],function(_0x53f7c2){var _0x1716e1={};_0x1716e1[_0x53f7c2]={'$like':'%'+_0x16419f['query'][_0xbb58('0x44')]+'%'};return _0x1716e1;})});}_0x4acfcf=_[_0xbb58('0x46')]({},_0x4acfcf,_0x16419f[_0xbb58('0x4f')]);return _0x182b8c[_0xbb58('0x6d')](_0x4acfcf);}})[_0xbb58('0x29')](respondWithResult(_0x2d22b7,null))[_0xbb58('0x4b')](handleError(_0x2d22b7,null));};exports['getContactsCsv']=function(_0x4249ed,_0x4952ab,_0x2644d3){var _0x466c7d;var _0xcf2e3e;var _0x40a994;var _0x68bf76=_0x4249ed[_0xbb58('0x4d')]['id'];csv_results=[];return db['ContactItemType'][_0xbb58('0x73')]({'attributes':['id','name'],'raw':!![],'order':[_0xbb58('0x74')]})[_0xbb58('0x29')](function(_0x4cd52b){_0x466c7d=_0x4cd52b;var _0x52bc27=_[_0xbb58('0x39')](db[_0xbb58('0x60')]['rawAttributes']);return db[_0xbb58('0x6e')]['findAll']({'raw':!![],'attributes':['id',_0xbb58('0x75')]})[_0xbb58('0x29')](function(_0x1de6a){_0xcf2e3e=_0x1de6a;var _0x34aad2=squel[_0xbb58('0x76')]()[_0xbb58('0x4e')](_0x52bc27)[_0xbb58('0x77')](_0xbb58('0x78'),'c')[_0xbb58('0x45')](_0xbb58('0x79'),_0x68bf76)[_0xbb58('0x7a')]();for(var _0x5d12=0x0;_0x5d12<_0xcf2e3e[_0xbb58('0x3e')];_0x5d12++){_0x34aad2['field'](_0xbb58('0x7b')+_0xcf2e3e[_0x5d12]['id'],_0xbb58('0x7c')+_0xcf2e3e[_0x5d12][_0xbb58('0x75')]);}for(var _0x5d12=0x0;_0x5d12<_0x466c7d['length'];_0x5d12++){_0x34aad2[_0xbb58('0x7d')](squel['select']()[_0xbb58('0x7d')](_0xbb58('0x7e'))[_0xbb58('0x77')]('cm_contact_has_items')[_0xbb58('0x45')](_0xbb58('0x7f'),_0x466c7d[_0x5d12]['id'])[_0xbb58('0x45')](_0xbb58('0x80')),_0xbb58('0x81')+_0x466c7d[_0x5d12][_0xbb58('0x31')]);_0x34aad2['field'](squel[_0xbb58('0x76')]()[_0xbb58('0x7d')](_0xbb58('0x82'))['from'](_0xbb58('0x83'))[_0xbb58('0x45')](_0xbb58('0x7f'),_0x466c7d[_0x5d12]['id'])[_0xbb58('0x45')](_0xbb58('0x80')),_0xbb58('0x84')+_0x466c7d[_0x5d12][_0xbb58('0x31')]);}var _0x3641cf=[];_0x3641cf[_0xbb58('0x68')](_0x34aad2['toString']());BPromise[_0xbb58('0x64')](_0x3641cf,handleQuery)['then'](function(_0x320311){handleQuery(_0x34aad2['toString']());var _0xacee1a=csv_results[0x0];if(!_[_0xbb58('0x85')](_0xacee1a)){var _0x20cdec=toCsv(_0xacee1a);var _0x2ef401=Date[_0xbb58('0x86')]();fs[_0xbb58('0x87')](util[_0xbb58('0x71')](_0xbb58('0x88'),_0x68bf76,_0x2ef401),_0x20cdec);_0x4952ab[_0xbb58('0x89')](_0xbb58('0x8a'),_0xbb58('0x8b')+util[_0xbb58('0x71')](_0xbb58('0x8c'),_0x68bf76,_0x2ef401));_0x4952ab[_0xbb58('0x89')](_0xbb58('0x8d'),_0xbb58('0x8e'));return _0x4952ab[_0xbb58('0x8f')](util[_0xbb58('0x71')](_0xbb58('0x88'),_0x68bf76,_0x2ef401));}else{return _0x4952ab[_0xbb58('0x2e')](0xcc);}});});});};exports[_0xbb58('0x90')]=function(_0x678a42,_0x2441ee,_0x8e3347){var _0x154821;delete _0x678a42['body']['id'];return db[_0xbb58('0x34')][_0xbb58('0x5c')]({'where':{'id':_0x678a42[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x2441ee,null))['then'](function(_0x391bbb){if(_0x391bbb){return db[_0xbb58('0x91')][_0xbb58('0x92')](function(_0x3e75eb){return db[_0xbb58('0x6e')]['create'](_0x678a42[_0xbb58('0x52')],{'transaction':_0x3e75eb})[_0xbb58('0x29')](function(_0x254a2c){_0x154821=_0x254a2c;return _0x391bbb[_0xbb58('0x93')](_0x254a2c,{'transaction':_0x3e75eb});})['then'](function(){var _0x117677={'type':db[_0xbb58('0x94')][_0xbb58('0x95')],'transaction':_0x3e75eb};switch(_0x678a42['body']['type']){case _0xbb58('0x96'):_0x117677['type']=db[_0xbb58('0x94')][_0xbb58('0x95')];break;case _0xbb58('0x97'):_0x117677['type']=db[_0xbb58('0x94')][_0xbb58('0x98')];break;case'switch':_0x117677[_0xbb58('0x37')]=db[_0xbb58('0x94')]['BOOLEAN'];_0x117677[_0xbb58('0x99')]=![];break;default:}return db[_0xbb58('0x91')][_0xbb58('0x9a')]['addColumn'](_0xbb58('0x78'),util[_0xbb58('0x71')]('cf_%s',_0x154821['id']),_0x117677);})[_0xbb58('0x29')](function(){return _0x154821;});});}})[_0xbb58('0x29')](respondWithResult(_0x2441ee,null))[_0xbb58('0x4b')](handleError(_0x2441ee,null));};exports[_0xbb58('0x9b')]=function(_0x4a0999,_0x337e18,_0x30c17c){var _0x1865ef={};var _0x52b43e={};var _0x2a0803;var _0x4e5f42;return db[_0xbb58('0x34')]['findOne']({'where':{'id':_0x4a0999[_0xbb58('0x4d')]['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x337e18,null))[_0xbb58('0x29')](function(_0x916be1){if(_0x916be1){_0x2a0803=_0x916be1;_0x52b43e[_0xbb58('0x3c')]=_['keys'](db[_0xbb58('0x6e')][_0xbb58('0x35')]);_0x52b43e[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x4a0999[_0xbb58('0x38')]);_0x52b43e[_0xbb58('0x3a')]=_['intersection'](_0x52b43e['model'],_0x52b43e['query']);_0x1865ef[_0xbb58('0x3d')]=_['intersection'](_0x52b43e[_0xbb58('0x3c')],qs[_0xbb58('0x4e')](_0x4a0999[_0xbb58('0x38')][_0xbb58('0x4e')]));_0x1865ef[_0xbb58('0x3d')]=_0x1865ef[_0xbb58('0x3d')][_0xbb58('0x3e')]?_0x1865ef['attributes']:_0x52b43e[_0xbb58('0x3c')];_0x1865ef[_0xbb58('0x41')]=qs[_0xbb58('0x42')](_0x4a0999[_0xbb58('0x38')][_0xbb58('0x42')]);_0x1865ef['where']=qs[_0xbb58('0x3a')](_['pick'](_0x4a0999[_0xbb58('0x38')],_0x52b43e[_0xbb58('0x3a')]));_0x1865ef[_0xbb58('0x45')]=_[_0xbb58('0x46')](_0x1865ef[_0xbb58('0x45')],{'$or':[{'ListId':_0x916be1['id']},{'ListId':null}]});if(_0x4a0999['query'][_0xbb58('0x44')]){_0x1865ef[_0xbb58('0x45')]=_[_0xbb58('0x46')](_0x1865ef[_0xbb58('0x45')],{'$or':_[_0xbb58('0x33')](_0x1865ef['attributes'],function(_0x32210d){var _0x32fca4={};_0x32fca4[_0x32210d]={'$like':'%'+_0x4a0999[_0xbb58('0x38')][_0xbb58('0x44')]+'%'};return _0x32fca4;})});}_0x1865ef=_['merge']({},_0x1865ef,_0x4a0999[_0xbb58('0x4f')]);return db[_0xbb58('0x6e')]['findAndCountAll'](_0x1865ef);}})[_0xbb58('0x29')](respondWithResult(_0x337e18,null))[_0xbb58('0x4b')](handleError(_0x337e18,null));};exports[_0xbb58('0x9c')]=function(_0x3810f1,_0x426144,_0x41415d){return db[_0xbb58('0x34')][_0xbb58('0x50')]({'where':{'id':_0x3810f1['params']['id']}})['then'](handleEntityNotFound(_0x426144,null))['then'](function(_0x4e2a94){if(_0x4e2a94){return _0x4e2a94['addAgents'](_0x3810f1[_0xbb58('0x52')][_0xbb58('0x66')],_[_0xbb58('0x65')](_0x3810f1[_0xbb58('0x52')],[_0xbb58('0x66'),'id'])||{})[_0xbb58('0x9d')](function(_0x520662){for(var _0x2f3189=0x0;_0x2f3189<_0x3810f1[_0xbb58('0x52')][_0xbb58('0x66')][_0xbb58('0x3e')];_0x2f3189+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x3810f1[_0xbb58('0x52')][_0xbb58('0x66')][_0x2f3189]),'CmListId':Number(_0x3810f1[_0xbb58('0x4d')]['id'])});}return _0x520662;});}})[_0xbb58('0x29')](respondWithResult(_0x426144,null))['catch'](handleError(_0x426144,null));};exports[_0xbb58('0x9e')]=function(_0x261064,_0x496ecb,_0x1eed91){return db[_0xbb58('0x34')][_0xbb58('0x50')]({'where':{'id':_0x261064[_0xbb58('0x4d')]['id']}})['then'](handleEntityNotFound(_0x496ecb,null))['then'](function(_0x537b6c){if(_0x537b6c){return _0x537b6c[_0xbb58('0x9e')](_0x261064[_0xbb58('0x38')][_0xbb58('0x66')])['then'](function(){if(_['isArray'](_0x261064[_0xbb58('0x38')][_0xbb58('0x66')])){for(var _0x575fe1=0x0;_0x575fe1<_0x261064['query'][_0xbb58('0x66')][_0xbb58('0x3e')];_0x575fe1+=0x1){socket[_0xbb58('0x9f')](_0xbb58('0xa0'),{'UserId':Number(_0x261064[_0xbb58('0x38')][_0xbb58('0x66')][_0x575fe1]),'CmListId':Number(_0x261064[_0xbb58('0x4d')]['id'])});}}else{socket[_0xbb58('0x9f')](_0xbb58('0xa0'),{'UserId':Number(_0x261064[_0xbb58('0x38')]['ids']),'CmListId':Number(_0x261064[_0xbb58('0x4d')]['id'])});}});}})[_0xbb58('0x29')](respondWithStatusCode(_0x496ecb,null))[_0xbb58('0x4b')](handleError(_0x496ecb,null));};exports['getAgents']=function(_0x16fff5,_0x2902dc,_0x28e1f2){var _0x25431e={};var _0x52808e={};var _0x5ba440;var _0x569eb9;return db['CmList'][_0xbb58('0x5c')]({'where':{'id':_0x16fff5['params']['id']}})[_0xbb58('0x29')](handleEntityNotFound(_0x2902dc,null))[_0xbb58('0x29')](function(_0x7d59e3){if(_0x7d59e3){_0x5ba440=_0x7d59e3;_0x52808e[_0xbb58('0x3c')]=_['keys'](db[_0xbb58('0xa1')][_0xbb58('0x35')]);_0x52808e[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x16fff5[_0xbb58('0x38')]);_0x52808e[_0xbb58('0x3a')]=_[_0xbb58('0x3b')](_0x52808e[_0xbb58('0x3c')],_0x52808e[_0xbb58('0x38')]);_0x25431e[_0xbb58('0x3d')]=_[_0xbb58('0x3b')](_0x52808e['model'],qs[_0xbb58('0x4e')](_0x16fff5['query'][_0xbb58('0x4e')]));_0x25431e[_0xbb58('0x3d')]=_0x25431e[_0xbb58('0x3d')]['length']?_0x25431e['attributes']:_0x52808e[_0xbb58('0x3c')];_0x25431e[_0xbb58('0x41')]=qs[_0xbb58('0x42')](_0x16fff5['query'][_0xbb58('0x42')]);_0x25431e[_0xbb58('0x45')]=qs[_0xbb58('0x3a')](_[_0xbb58('0x43')](_0x16fff5[_0xbb58('0x38')],_0x52808e[_0xbb58('0x3a')]));if(_0x16fff5[_0xbb58('0x38')][_0xbb58('0x44')]){_0x25431e[_0xbb58('0x45')]=_[_0xbb58('0x46')](_0x25431e[_0xbb58('0x45')],{'$or':_[_0xbb58('0x33')](_0x25431e[_0xbb58('0x3d')],function(_0x377e80){var _0x313613={};_0x313613[_0x377e80]={'$like':'%'+_0x16fff5[_0xbb58('0x38')][_0xbb58('0x44')]+'%'};return _0x313613;})});}_0x25431e=_[_0xbb58('0x46')]({},_0x25431e,_0x16fff5['options']);return _0x5ba440[_0xbb58('0xa2')](_0x25431e);}})[_0xbb58('0x29')](function(_0x3b36d1){if(_0x3b36d1){_0x569eb9=_0x3b36d1[_0xbb58('0x3e')];if(!_0x16fff5[_0xbb58('0x38')][_0xbb58('0x3f')](_0xbb58('0x40'))){_0x25431e[_0xbb58('0x20')]=qs[_0xbb58('0x20')](_0x16fff5[_0xbb58('0x38')][_0xbb58('0x20')]);_0x25431e[_0xbb58('0x1f')]=qs['offset'](_0x16fff5['query'][_0xbb58('0x1f')]);}return _0x5ba440['getAgents'](_0x25431e);}})[_0xbb58('0x29')](function(_0x2bff0d){if(_0x2bff0d){return _0x2bff0d?{'count':_0x569eb9,'rows':_0x2bff0d}:null;}})[_0xbb58('0x29')](respondWithResult(_0x2902dc,null))[_0xbb58('0x4b')](handleError(_0x2902dc,null));};function handleQuery(_0x5cc418){logger[_0xbb58('0xa3')](_0x5cc418);return db[_0xbb58('0x91')]['query'](_0x5cc418)[_0xbb58('0x9d')](function(_0x123236){csv_results[_0xbb58('0x68')](_0x123236);})[_0xbb58('0x4b')](function(_0x27acd9){logger[_0xbb58('0x2f')](_0x27acd9[_0xbb58('0x6b')]);});}
\ No newline at end of file
index a5168a4..f3e6b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x413a5f,_0x5bd8be){_0x413a5f=_0x413a5f-0x0;var _0x2784e4=_0x326f[_0x413a5f];return _0x2784e4;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x5fc3,0xa8));var _0x35fc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5fc3[_0x397e5f];return _0x5302b8;};'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 0713f2d..bb45be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','api','bluebird'];(function(_0x14178a,_0x30c67f){var _0x464579=function(_0x2cc706){while(--_0x2cc706){_0x14178a['push'](_0x14178a['shift']());}};_0x464579(++_0x30c67f);}(_0x9bde,0xe1));var _0xe9bd=function(_0xad2578,_0x4f9b2d){_0xad2578=_0xad2578-0x0;var _0x4fdc3d=_0x9bde[_0xad2578];return _0x4fdc3d;};'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
+var _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0xa75c23,_0x5131c0){var _0x3a07c8=function(_0x252b43){while(--_0x252b43){_0xa75c23['push'](_0xa75c23['shift']());}};_0x3a07c8(++_0x5131c0);}(_0x668b,0x140));var _0xb668=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x668b[_0x246f0c];return _0x30fe50;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d96e113..87f331e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe055=['socket.io-emitter','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x39fdad,_0x1b8980){var _0x2089a1=function(_0x1772cb){while(--_0x1772cb){_0x39fdad['push'](_0x39fdad['shift']());}};_0x2089a1(++_0x1b8980);}(_0xe055,0x1e8));var _0x5e05=function(_0x27314d,_0x33c0f2){_0x27314d=_0x27314d-0x0;var _0x30a648=_0xe055[_0x27314d];return _0x30a648;};'use strict';var _=require('lodash');var util=require(_0x5e05('0x0'));var moment=require(_0x5e05('0x1'));var BPromise=require('bluebird');var rs=require(_0x5e05('0x2'));var fs=require('fs');var Redis=require(_0x5e05('0x3'));var db=require(_0x5e05('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e05('0x5'));var config=require(_0x5e05('0x6'));var jayson=require(_0x5e05('0x7'));var client=jayson[_0x5e05('0x8')][_0x5e05('0x9')]({'port':0x232a});config[_0x5e05('0xa')]=_['defaults'](config[_0x5e05('0xa')],{'host':_0x5e05('0xb'),'port':0x18eb});var socket=require(_0x5e05('0xc'))(new Redis(config[_0x5e05('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x25bcac,_0x1f08d6,_0x12d6e0){return new BPromise(function(_0x5ee5d0,_0x558704){return client[_0x5e05('0xd')](_0x25bcac,_0x12d6e0)[_0x5e05('0xe')](function(_0x4d7557){logger[_0x5e05('0xf')](_0x5e05('0x10'),_0x1f08d6,_0x5e05('0x11'));logger['debug'](_0x5e05('0x12'),_0x1f08d6,_0x5e05('0x11'),JSON[_0x5e05('0x13')](_0x4d7557));if(_0x4d7557['error']){if(_0x4d7557[_0x5e05('0x14')][_0x5e05('0x15')]===0x1f4){logger[_0x5e05('0x14')](_0x5e05('0x10'),_0x1f08d6,_0x4d7557[_0x5e05('0x14')]['message']);return _0x558704(_0x4d7557[_0x5e05('0x14')][_0x5e05('0x16')]);}logger[_0x5e05('0x14')]('CmList,\x20%s,\x20%s',_0x1f08d6,_0x4d7557[_0x5e05('0x14')][_0x5e05('0x16')]);return _0x5ee5d0(_0x4d7557[_0x5e05('0x14')][_0x5e05('0x16')]);}else{logger['info'](_0x5e05('0x10'),_0x1f08d6,_0x5e05('0x11'));_0x5ee5d0(_0x4d7557[_0x5e05('0x17')]['message']);}})[_0x5e05('0x18')](function(_0x38afec){logger[_0x5e05('0x14')](_0x5e05('0x10'),_0x1f08d6,_0x38afec);_0x558704(_0x38afec);});});}
\ No newline at end of file
+var _0xd09f=['error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd09f,0xbb));var _0xfd09=function(_0x30af23,_0x1b9d6a){_0x30af23=_0x30af23-0x0;var _0x5cea96=_0xd09f[_0x30af23];return _0x5cea96;};'use strict';var _=require(_0xfd09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd09('0x1'));var fs=require('fs');var Redis=require(_0xfd09('0x2'));var db=require(_0xfd09('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd09('0x4'))(_0xfd09('0x5'));var config=require(_0xfd09('0x6'));var jayson=require(_0xfd09('0x7'));var client=jayson['client'][_0xfd09('0x8')]({'port':0x232a});config[_0xfd09('0x9')]=_[_0xfd09('0xa')](config[_0xfd09('0x9')],{'host':_0xfd09('0xb'),'port':0x18eb});var socket=require(_0xfd09('0xc'))(new Redis(config[_0xfd09('0x9')]));require(_0xfd09('0xd'))[_0xfd09('0xe')](socket);function respondWithRpcPromise(_0x5a4606,_0x44da15,_0x5e5902){return new BPromise(function(_0x8c8008,_0x5464ec){return client[_0xfd09('0xf')](_0x5a4606,_0x5e5902)[_0xfd09('0x10')](function(_0x5cd09b){logger['info'](_0xfd09('0x11'),_0x44da15,_0xfd09('0x12'));logger[_0xfd09('0x13')](_0xfd09('0x14'),_0x44da15,_0xfd09('0x12'),JSON['stringify'](_0x5cd09b));if(_0x5cd09b[_0xfd09('0x15')]){if(_0x5cd09b[_0xfd09('0x15')][_0xfd09('0x16')]===0x1f4){logger[_0xfd09('0x15')](_0xfd09('0x11'),_0x44da15,_0x5cd09b[_0xfd09('0x15')][_0xfd09('0x17')]);return _0x5464ec(_0x5cd09b[_0xfd09('0x15')][_0xfd09('0x17')]);}logger[_0xfd09('0x15')](_0xfd09('0x11'),_0x44da15,_0x5cd09b[_0xfd09('0x15')][_0xfd09('0x17')]);return _0x8c8008(_0x5cd09b[_0xfd09('0x15')][_0xfd09('0x17')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x44da15,'request\x20sent');_0x8c8008(_0x5cd09b[_0xfd09('0x18')][_0xfd09('0x17')]);}})[_0xfd09('0x19')](function(_0x28fc8b){logger[_0xfd09('0x15')](_0xfd09('0x11'),_0x44da15,_0x28fc8b);_0x5464ec(_0x28fc8b);});});}
\ No newline at end of file
index 7036620..2a5b361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd86=['register','length','cmList:','save','remove','emit','removeListener'];(function(_0x3f96d1,_0x4b1890){var _0x2ca68a=function(_0x5f0e7a){while(--_0x5f0e7a){_0x3f96d1['push'](_0x3f96d1['shift']());}};_0x2ca68a(++_0x4b1890);}(_0xcd86,0x16f));var _0x6cd8=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0xcd86[_0x3c04ef];return _0x6a3a69;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x6cd8('0x0'),_0x6cd8('0x1'),'update'];function createListener(_0x57c04f,_0x3941ec){return function(_0x1e527b){_0x3941ec[_0x6cd8('0x2')](_0x57c04f,_0x1e527b);};}function removeListener(_0x40b10a,_0x2e2d82){return function(){CmListEvents[_0x6cd8('0x3')](_0x40b10a,_0x2e2d82);};}exports[_0x6cd8('0x4')]=function(_0x4c76dd){for(var _0x1faa00=0x0,_0x2c7252=events[_0x6cd8('0x5')];_0x1faa00<_0x2c7252;_0x1faa00++){var _0x3fb768=events[_0x1faa00];var _0x3b19bf=createListener(_0x6cd8('0x6')+_0x3fb768,_0x4c76dd);CmListEvents['on'](_0x3fb768,_0x3b19bf);}};
\ No newline at end of file
+var _0x1046=['cmList:','save','remove','update','emit','removeListener'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x1046,0x151));var _0x6104=function(_0x31e6de,_0x42919){_0x31e6de=_0x31e6de-0x0;var _0x19d831=_0x1046[_0x31e6de];return _0x19d831;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x6104('0x0'),_0x6104('0x1'),_0x6104('0x2')];function createListener(_0x3bcf6e,_0x108bef){return function(_0x20b7b5){_0x108bef[_0x6104('0x3')](_0x3bcf6e,_0x20b7b5);};}function removeListener(_0x15c320,_0x35b5f6){return function(){CmListEvents[_0x6104('0x4')](_0x15c320,_0x35b5f6);};}exports['register']=function(_0x4c66fc){for(var _0x5cd881=0x0,_0x47ac23=events['length'];_0x5cd881<_0x47ac23;_0x5cd881++){var _0x4cd648=events[_0x5cd881];var _0x4baef5=createListener(_0x6104('0x5')+_0x4cd648,_0x4c66fc);CmListEvents['on'](_0x4cd648,_0x4baef5);}};
\ No newline at end of file
index 88b5341..9517d64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9cd=['get','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getCustomFields','/:id/users','getAgents','post','create','addContacts','/:id/fields','addCustomField','addAgents','put','/:id','update','delete','removeDispositions','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','/describe','describe'];(function(_0x18948a,_0x5a5770){var _0x9cbb9a=function(_0x2c4803){while(--_0x2c4803){_0x18948a['push'](_0x18948a['shift']());}};_0x9cbb9a(++_0x5a5770);}(_0xf9cd,0x155));var _0xdf9c=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xf9cd[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require(_0xdf9c('0x0'));var util=require(_0xdf9c('0x1'));var path=require(_0xdf9c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdf9c('0x3')]();var fs_extra=require(_0xdf9c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdf9c('0x5'));var config=require(_0xdf9c('0x6'));var controller=require(_0xdf9c('0x7'));router['get']('/',auth[_0xdf9c('0x8')](),controller['index']);router['get'](_0xdf9c('0x9'),auth['isAuthenticated'](),controller[_0xdf9c('0xa')]);router[_0xdf9c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdf9c('0xc')]);router['get'](_0xdf9c('0xd'),auth[_0xdf9c('0x8')](),controller['getDispositions']);router[_0xdf9c('0xb')](_0xdf9c('0xe'),auth['isAuthenticated'](),controller[_0xdf9c('0xf')]);router[_0xdf9c('0xb')](_0xdf9c('0x10'),auth[_0xdf9c('0x8')](),controller['getContactsCsv']);router[_0xdf9c('0xb')]('/:id/fields',auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x11')]);router[_0xdf9c('0xb')](_0xdf9c('0x12'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x13')]);router[_0xdf9c('0x14')]('/',auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x15')]);router['post'](_0xdf9c('0xd'),auth[_0xdf9c('0x8')](),controller['addDisposition']);router[_0xdf9c('0x14')](_0xdf9c('0xe'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x16')]);router[_0xdf9c('0x14')](_0xdf9c('0x17'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x18')]);router[_0xdf9c('0x14')](_0xdf9c('0x12'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x19')]);router[_0xdf9c('0x1a')](_0xdf9c('0x1b'),auth['isAuthenticated'](),controller[_0xdf9c('0x1c')]);router[_0xdf9c('0x1d')](_0xdf9c('0x1b'),auth[_0xdf9c('0x8')](),controller['destroy']);router[_0xdf9c('0x1d')](_0xdf9c('0xd'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x1e')]);router[_0xdf9c('0x1d')](_0xdf9c('0x12'),auth[_0xdf9c('0x8')](),controller[_0xdf9c('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xcf4a=['index','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44b585,_0x120e48){var _0x38dd43=function(_0x2c6be7){while(--_0x2c6be7){_0x44b585['push'](_0x44b585['shift']());}};_0x38dd43(++_0x120e48);}(_0xcf4a,0x1a7));var _0xacf4=function(_0x5a2386,_0x5d5122){_0x5a2386=_0x5a2386-0x0;var _0x5385a7=_0xcf4a[_0x5a2386];return _0x5385a7;};'use strict';var multer=require('multer');var util=require(_0xacf4('0x0'));var path=require(_0xacf4('0x1'));var timeout=require(_0xacf4('0x2'));var express=require(_0xacf4('0x3'));var router=express[_0xacf4('0x4')]();var fs_extra=require(_0xacf4('0x5'));var auth=require(_0xacf4('0x6'));var interaction=require(_0xacf4('0x7'));var config=require(_0xacf4('0x8'));var controller=require('./cmList.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xacf4('0x9')]);router[_0xacf4('0xa')]('/describe',auth[_0xacf4('0xb')](),controller[_0xacf4('0xc')]);router[_0xacf4('0xa')](_0xacf4('0xd'),auth['isAuthenticated'](),controller[_0xacf4('0xe')]);router[_0xacf4('0xa')](_0xacf4('0xf'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x10')]);router[_0xacf4('0xa')](_0xacf4('0x11'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x12')]);router[_0xacf4('0xa')](_0xacf4('0x13'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x14')]);router['get'](_0xacf4('0x15'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x16')]);router['get']('/:id/users',auth[_0xacf4('0xb')](),controller['getAgents']);router[_0xacf4('0x17')]('/',auth[_0xacf4('0xb')](),controller[_0xacf4('0x18')]);router[_0xacf4('0x17')](_0xacf4('0xf'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x19')]);router[_0xacf4('0x17')](_0xacf4('0x11'),auth['isAuthenticated'](),controller[_0xacf4('0x1a')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xacf4('0x1b')]);router[_0xacf4('0x17')](_0xacf4('0x1c'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x1d')]);router[_0xacf4('0x1e')](_0xacf4('0xd'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x1f')]);router['delete'](_0xacf4('0xd'),auth[_0xacf4('0xb')](),controller[_0xacf4('0x20')]);router['delete'](_0xacf4('0xf'),auth[_0xacf4('0xb')](),controller['removeDispositions']);router[_0xacf4('0x21')]('/:id/users',auth[_0xacf4('0xb')](),controller[_0xacf4('0x22')]);module[_0xacf4('0x23')]=router;
\ No newline at end of file
index 19c30a9..f4b67a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc20=['exports','getDataValue','STRING','sequelize'];(function(_0x545a36,_0x51b5db){var _0x4ae0d9=function(_0x133662){while(--_0x133662){_0x545a36['push'](_0x545a36['shift']());}};_0x4ae0d9(++_0x51b5db);}(_0xcc20,0xdf));var _0x0cc2=function(_0x2ddde0,_0x4832d7){_0x2ddde0=_0x2ddde0-0x0;var _0x259b41=_0xcc20[_0x2ddde0];return _0x259b41;};'use strict';var Sequelize=require(_0x0cc2('0x0'));module[_0x0cc2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x317a5d){return this[_0x0cc2('0x2')]('field');}},'field':{'type':Sequelize[_0x0cc2('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x0cc2('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x0cc2('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0xdf32=['getDataValue','field','STRING','sequelize','exports'];(function(_0x2f575a,_0x1465ee){var _0x34e181=function(_0x4c3f1c){while(--_0x4c3f1c){_0x2f575a['push'](_0x2f575a['shift']());}};_0x34e181(++_0x1465ee);}(_0xdf32,0x120));var _0x2df3=function(_0x38b9cf,_0x2717a5){_0x38b9cf=_0x38b9cf-0x0;var _0x3e25a2=_0xdf32[_0x38b9cf];return _0x3e25a2;};'use strict';var Sequelize=require(_0x2df3('0x0'));module[_0x2df3('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x48f4f7){return this[_0x2df3('0x2')](_0x2df3('0x3'));}},'field':{'type':Sequelize[_0x2df3('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x2df3('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x2df3('0x4')],'allowNull':![]}};
\ No newline at end of file
index 0fc0373..8886927 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(_0x1c3e4d,_0x8ec029){var _0x91386c=function(_0x578e3f){while(--_0x578e3f){_0x1c3e4d['push'](_0x1c3e4d['shift']());}};_0x91386c(++_0x8ec029);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _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(_0x2ec2bf,_0x14e050){var _0x37ec9d=function(_0x4e4e58){while(--_0x4e4e58){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x37ec9d(++_0x14e050);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index 849311c..2be69c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c6b=['rimraf','../../config/environment','exports','Condition','tools_conditions','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x31ed73,_0xf1d9af){var _0xe43ce6=function(_0x285cf8){while(--_0x285cf8){_0x31ed73['push'](_0x31ed73['shift']());}};_0xe43ce6(++_0xf1d9af);}(_0x4c6b,0xe1));var _0xb4c6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4c6b[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb4c6('0x0'));var util=require('util');var logger=require(_0xb4c6('0x1'))(_0xb4c6('0x2'));var moment=require('moment');var BPromise=require(_0xb4c6('0x3'));var rp=require(_0xb4c6('0x4'));var fs=require('fs');var path=require(_0xb4c6('0x5'));var rimraf=require(_0xb4c6('0x6'));var config=require(_0xb4c6('0x7'));var attributes=require('./condition.attributes');module[_0xb4c6('0x8')]=function(_0x1bedc3,_0x54bcd3){return _0x1bedc3['define'](_0xb4c6('0x9'),attributes,{'tableName':_0xb4c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45c3=['path','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','../../config/logger','api','bluebird','request-promise'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x45c3,0x8b));var _0x345c=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0x45c3[_0x2a40b3];return _0x4ac6cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x345c('0x0'))(_0x345c('0x1'));var moment=require('moment');var BPromise=require(_0x345c('0x2'));var rp=require(_0x345c('0x3'));var fs=require('fs');var path=require(_0x345c('0x4'));var rimraf=require('rimraf');var config=require(_0x345c('0x5'));var attributes=require(_0x345c('0x6'));module[_0x345c('0x7')]=function(_0xcbce00,_0x5d7a9c){return _0xcbce00[_0x345c('0x8')](_0x345c('0x9'),attributes,{'tableName':_0x345c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93b0fdb..543bec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11bc=['Condition,\x20%s,\x20%s','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2716e1,_0x2e7205){var _0x53d331=function(_0x119c7d){while(--_0x119c7d){_0x2716e1['push'](_0x2716e1['shift']());}};_0x53d331(++_0x2e7205);}(_0x11bc,0x113));var _0xc11b=function(_0x2f272c,_0x20d432){_0x2f272c=_0x2f272c-0x0;var _0x42a419=_0x11bc[_0x2f272c];return _0x42a419;};'use strict';var _=require(_0xc11b('0x0'));var util=require(_0xc11b('0x1'));var moment=require('moment');var BPromise=require(_0xc11b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc11b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc11b('0x4'));var logger=require(_0xc11b('0x5'))(_0xc11b('0x6'));var config=require(_0xc11b('0x7'));var jayson=require(_0xc11b('0x8'));var client=jayson[_0xc11b('0x9')][_0xc11b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d510c,_0x29d3d1,_0x45fcb4){return new BPromise(function(_0x3b1646,_0x5622f1){return client['request'](_0x1d510c,_0x45fcb4)[_0xc11b('0xb')](function(_0xa372b5){logger[_0xc11b('0xc')]('Condition,\x20%s,\x20%s',_0x29d3d1,_0xc11b('0xd'));logger[_0xc11b('0xe')](_0xc11b('0xf'),_0x29d3d1,_0xc11b('0xd'),JSON[_0xc11b('0x10')](_0xa372b5));if(_0xa372b5[_0xc11b('0x11')]){if(_0xa372b5[_0xc11b('0x11')]['code']===0x1f4){logger[_0xc11b('0x11')]('Condition,\x20%s,\x20%s',_0x29d3d1,_0xa372b5[_0xc11b('0x11')][_0xc11b('0x12')]);return _0x5622f1(_0xa372b5[_0xc11b('0x11')][_0xc11b('0x12')]);}logger['error'](_0xc11b('0x13'),_0x29d3d1,_0xa372b5['error'][_0xc11b('0x12')]);return _0x3b1646(_0xa372b5[_0xc11b('0x11')]['message']);}else{logger[_0xc11b('0xc')](_0xc11b('0x13'),_0x29d3d1,_0xc11b('0xd'));_0x3b1646(_0xa372b5['result']['message']);}})[_0xc11b('0x14')](function(_0x57a686){logger[_0xc11b('0x11')](_0xc11b('0x13'),_0x29d3d1,_0x57a686);_0x5622f1(_0x57a686);});});}
\ No newline at end of file
+var _0x6cf2=['request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x6cf2,0x1aa));var _0x26cf=function(_0x303575,_0x179377){_0x303575=_0x303575-0x0;var _0x542939=_0x6cf2[_0x303575];return _0x542939;};'use strict';var _=require(_0x26cf('0x0'));var util=require('util');var moment=require(_0x26cf('0x1'));var BPromise=require(_0x26cf('0x2'));var rs=require(_0x26cf('0x3'));var fs=require('fs');var Redis=require(_0x26cf('0x4'));var db=require(_0x26cf('0x5'))['db'];var utils=require(_0x26cf('0x6'));var logger=require(_0x26cf('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x26cf('0x8'));var client=jayson[_0x26cf('0x9')][_0x26cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c816b,_0x6662bb,_0x55670f){return new BPromise(function(_0x2e24f4,_0x22795e){return client[_0x26cf('0xb')](_0x2c816b,_0x55670f)[_0x26cf('0xc')](function(_0x3683ed){logger[_0x26cf('0xd')](_0x26cf('0xe'),_0x6662bb,_0x26cf('0xf'));logger[_0x26cf('0x10')](_0x26cf('0x11'),_0x6662bb,_0x26cf('0xf'),JSON[_0x26cf('0x12')](_0x3683ed));if(_0x3683ed[_0x26cf('0x13')]){if(_0x3683ed[_0x26cf('0x13')][_0x26cf('0x14')]===0x1f4){logger['error'](_0x26cf('0xe'),_0x6662bb,_0x3683ed['error']['message']);return _0x22795e(_0x3683ed[_0x26cf('0x13')][_0x26cf('0x15')]);}logger[_0x26cf('0x13')](_0x26cf('0xe'),_0x6662bb,_0x3683ed[_0x26cf('0x13')]['message']);return _0x2e24f4(_0x3683ed['error'][_0x26cf('0x15')]);}else{logger['info'](_0x26cf('0xe'),_0x6662bb,_0x26cf('0xf'));_0x2e24f4(_0x3683ed['result']['message']);}})[_0x26cf('0x16')](function(_0x33392e){logger[_0x26cf('0x13')]('Condition,\x20%s,\x20%s',_0x6662bb,_0x33392e);_0x22795e(_0x33392e);});});}
\ No newline at end of file
index 01c1d4c..ddd428f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc315=['path','express','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x5b36ac,_0x4767aa){var _0x512bc2=function(_0x312285){while(--_0x312285){_0x5b36ac['push'](_0x5b36ac['shift']());}};_0x512bc2(++_0x4767aa);}(_0xc315,0x15d));var _0x5c31=function(_0x3d08da,_0x165845){_0x3d08da=_0x3d08da-0x0;var _0x9b9a2f=_0xc315[_0x3d08da];return _0x9b9a2f;};'use strict';var multer=require(_0x5c31('0x0'));var util=require('util');var path=require(_0x5c31('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c31('0x2'));var router=express['Router']();var fs_extra=require(_0x5c31('0x3'));var auth=require(_0x5c31('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c31('0x5'));var controller=require(_0x5c31('0x6'));router[_0x5c31('0x7')](_0x5c31('0x8'),auth[_0x5c31('0x9')](),controller[_0x5c31('0xa')]);router[_0x5c31('0xb')](_0x5c31('0x8'),auth[_0x5c31('0x9')](),controller[_0x5c31('0xc')]);module[_0x5c31('0xd')]=router;
\ No newline at end of file
+var _0x3e57=['fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','util','connect-timeout','express'];(function(_0x4ce470,_0x3b6964){var _0x11dc88=function(_0x5f3a5e){while(--_0x5f3a5e){_0x4ce470['push'](_0x4ce470['shift']());}};_0x11dc88(++_0x3b6964);}(_0x3e57,0xe7));var _0x73e5=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0x3e57[_0x23ca4d];return _0x435432;};'use strict';var multer=require('multer');var util=require(_0x73e5('0x0'));var path=require('path');var timeout=require(_0x73e5('0x1'));var express=require(_0x73e5('0x2'));var router=express['Router']();var fs_extra=require(_0x73e5('0x3'));var auth=require(_0x73e5('0x4'));var interaction=require(_0x73e5('0x5'));var config=require('../../config/environment');var controller=require(_0x73e5('0x6'));router[_0x73e5('0x7')](_0x73e5('0x8'),auth[_0x73e5('0x9')](),controller[_0x73e5('0xa')]);router['delete'](_0x73e5('0x8'),auth[_0x73e5('0x9')](),controller[_0x73e5('0xb')]);module[_0x73e5('0xc')]=router;
\ No newline at end of file
index 491fbfd..dc0bae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fd=['sequelize','exports','name','INTEGER'];(function(_0x3c4274,_0x858023){var _0x36a214=function(_0x5273e5){while(--_0x5273e5){_0x3c4274['push'](_0x3c4274['shift']());}};_0x36a214(++_0x858023);}(_0xd5fd,0x1c0));var _0xdd5f=function(_0x521c76,_0x2d48f9){_0x521c76=_0x521c76-0x0;var _0x7fcf5f=_0xd5fd[_0x521c76];return _0x7fcf5f;};'use strict';var Sequelize=require(_0xdd5f('0x0'));module[_0xdd5f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdd5f('0x2')},'OrderBy':{'type':Sequelize[_0xdd5f('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x6556=['exports','name','INTEGER','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6556,0x8b));var _0x6655=function(_0x36874b,_0x48727d){_0x36874b=_0x36874b-0x0;var _0x3b63cf=_0x6556[_0x36874b];return _0x3b63cf;};'use strict';var Sequelize=require(_0x6655('0x0'));module[_0x6655('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6655('0x2')},'OrderBy':{'type':Sequelize[_0x6655('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6655('0x4')],'allowNull':!![]}};
\ No newline at end of file
index 51b5c89..49bf80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca4=['send','map','ContactItemType','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','request-promise','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','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','ContactItemTypes','error','stack','name'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xeca4,0x12a));var _0x4eca=function(_0x1b3dc9,_0x1326d5){_0x1b3dc9=_0x1b3dc9-0x0;var _0x48da2d=_0xeca4[_0x1b3dc9];return _0x48da2d;};'use strict';var emlformat=require(_0x4eca('0x0'));var rimraf=require(_0x4eca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4eca('0x2'));var rp=require(_0x4eca('0x3'));var moment=require('moment');var BPromise=require(_0x4eca('0x4'));var Mustache=require(_0x4eca('0x5'));var util=require(_0x4eca('0x6'));var path=require(_0x4eca('0x7'));var sox=require(_0x4eca('0x8'));var csv=require(_0x4eca('0x9'));var ejs=require(_0x4eca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eca('0xb'));var squel=require(_0x4eca('0xc'));var crypto=require(_0x4eca('0xd'));var jsforce=require(_0x4eca('0xe'));var deskjs=require(_0x4eca('0xf'));var toCsv=require(_0x4eca('0x9'));var querystring=require(_0x4eca('0x10'));var Papa=require(_0x4eca('0x11'));var Redis=require('ioredis');var authService=require(_0x4eca('0x12'));var qs=require(_0x4eca('0x13'));var as=require(_0x4eca('0x14'));var hardwareService=require(_0x4eca('0x15'));var logger=require(_0x4eca('0x16'))(_0x4eca('0x17'));var utils=require(_0x4eca('0x18'));var config=require(_0x4eca('0x19'));var licenseUtil=require(_0x4eca('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bd3d,_0x406771){_0x406771=_0x406771||0xcc;return function(_0x5dd852){if(_0x5dd852){return _0x54bd3d[_0x4eca('0x1b')](_0x406771);}return _0x54bd3d[_0x4eca('0x1c')](_0x406771)[_0x4eca('0x1d')]();};}function respondWithResult(_0x3faec7,_0x3dd7e7){_0x3dd7e7=_0x3dd7e7||0xc8;return function(_0x1a6008){if(_0x1a6008){return _0x3faec7['status'](_0x3dd7e7)[_0x4eca('0x1e')](_0x1a6008);}};}function respondWithFilteredResult(_0x38c87f,_0x4ed042){return function(_0x4cf5e3){if(_0x4cf5e3){var _0x129b64=typeof _0x4ed042[_0x4eca('0x1f')]===_0x4eca('0x20')&&typeof _0x4ed042[_0x4eca('0x21')]==='undefined';var _0x531e75=_0x4cf5e3[_0x4eca('0x22')];var _0x17ebef=_0x129b64?0x0:_0x4ed042[_0x4eca('0x1f')];var _0x27bce1=_0x129b64?_0x4cf5e3[_0x4eca('0x22')]:_0x4ed042[_0x4eca('0x1f')]+_0x4ed042['limit'];var _0xb73b2f;if(_0x27bce1>=_0x531e75){_0x27bce1=_0x531e75;_0xb73b2f=0xc8;}else{_0xb73b2f=0xce;}_0x38c87f[_0x4eca('0x1c')](_0xb73b2f);return _0x38c87f[_0x4eca('0x23')]('Content-Range',_0x17ebef+'-'+_0x27bce1+'/'+_0x531e75)['json'](_0x4cf5e3);}return null;};}function patchUpdates(_0x187444){return function(_0x53eb28){try{jsonpatch[_0x4eca('0x24')](_0x53eb28,_0x187444,!![]);}catch(_0x473179){return BPromise[_0x4eca('0x25')](_0x473179);}return _0x53eb28[_0x4eca('0x26')]();};}function saveUpdates(_0x1186a0,_0x5239e4){return function(_0x310d57){if(_0x310d57){return _0x310d57[_0x4eca('0x27')](_0x1186a0)[_0x4eca('0x28')](function(_0x2d2e54){return _0x2d2e54;});}return null;};}function removeEntity(_0x10f32e,_0xe7ff9a){return function(_0x1a3314){if(_0x1a3314){return _0x1a3314[_0x4eca('0x29')]()[_0x4eca('0x28')](function(){var _0x43ce71=_0x1a3314['get']({'plain':!![]});var _0x5857ad=_0x4eca('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5857ad,'resourceId':_0x43ce71['id']}})[_0x4eca('0x28')](function(){return _0x1a3314;});})['then'](function(){_0x10f32e[_0x4eca('0x1c')](0xcc)[_0x4eca('0x1d')]();});}};}function handleEntityNotFound(_0x32c9b0,_0x11e375){return function(_0x4d3555){if(!_0x4d3555){_0x32c9b0[_0x4eca('0x1b')](0x194);}return _0x4d3555;};}function handleError(_0x47a56a,_0x39dd10){_0x39dd10=_0x39dd10||0x1f4;return function(_0x22fccb){logger[_0x4eca('0x2b')](_0x22fccb[_0x4eca('0x2c')]);if(_0x22fccb[_0x4eca('0x2d')]){delete _0x22fccb[_0x4eca('0x2d')];}_0x47a56a['status'](_0x39dd10)[_0x4eca('0x2e')](_0x22fccb);};}exports['index']=function(_0x4946d8,_0x383e55){var _0x4a2842={},_0x290d33={},_0x4b24dd={'count':0x0,'rows':[]};var _0x4b811e=_[_0x4eca('0x2f')](db[_0x4eca('0x30')][_0x4eca('0x31')],function(_0x4828dc){return{'name':_0x4828dc[_0x4eca('0x32')],'type':_0x4828dc[_0x4eca('0x33')][_0x4eca('0x34')]};});_0x290d33['model']=_[_0x4eca('0x2f')](_0x4b811e,'name');_0x290d33[_0x4eca('0x35')]=_[_0x4eca('0x36')](_0x4946d8[_0x4eca('0x35')]);_0x290d33[_0x4eca('0x37')]=_[_0x4eca('0x38')](_0x290d33[_0x4eca('0x39')],_0x290d33[_0x4eca('0x35')]);_0x4a2842[_0x4eca('0x3a')]=_[_0x4eca('0x38')](_0x290d33['model'],qs[_0x4eca('0x3b')](_0x4946d8[_0x4eca('0x35')][_0x4eca('0x3b')]));_0x4a2842[_0x4eca('0x3a')]=_0x4a2842[_0x4eca('0x3a')]['length']?_0x4a2842['attributes']:_0x290d33[_0x4eca('0x39')];if(!_0x4946d8[_0x4eca('0x35')]['hasOwnProperty'](_0x4eca('0x3c'))){_0x4a2842[_0x4eca('0x21')]=qs[_0x4eca('0x21')](_0x4946d8['query'][_0x4eca('0x21')]);_0x4a2842[_0x4eca('0x1f')]=qs[_0x4eca('0x1f')](_0x4946d8['query'][_0x4eca('0x1f')]);}_0x4a2842[_0x4eca('0x3d')]=qs[_0x4eca('0x3e')](_0x4946d8[_0x4eca('0x35')][_0x4eca('0x3e')]);_0x4a2842[_0x4eca('0x3f')]=qs['filters'](_[_0x4eca('0x40')](_0x4946d8[_0x4eca('0x35')],_0x290d33['filters']),_0x4b811e);if(_0x4946d8[_0x4eca('0x35')][_0x4eca('0x41')]){_0x4a2842[_0x4eca('0x3f')]=_['merge'](_0x4a2842[_0x4eca('0x3f')],{'$or':_['map'](_0x4b811e,function(_0x3d0a5c){if(_0x3d0a5c[_0x4eca('0x33')]!==_0x4eca('0x42')){var _0x53273c={};_0x53273c[_0x3d0a5c['name']]={'$like':'%'+_0x4946d8[_0x4eca('0x35')]['filter']+'%'};return _0x53273c;}})});}_0x4a2842=_[_0x4eca('0x43')]({},_0x4a2842,_0x4946d8[_0x4eca('0x44')]);var _0x380a9b={'where':_0x4a2842['where']};return db[_0x4eca('0x30')][_0x4eca('0x22')](_0x380a9b)[_0x4eca('0x28')](function(_0x1b096c){_0x4b24dd['count']=_0x1b096c;if(_0x4946d8[_0x4eca('0x35')][_0x4eca('0x45')]){_0x4a2842['include']=[{'all':!![]}];}return db[_0x4eca('0x30')][_0x4eca('0x46')](_0x4a2842);})['then'](function(_0x2eb47d){_0x4b24dd['rows']=_0x2eb47d;return _0x4b24dd;})[_0x4eca('0x28')](respondWithFilteredResult(_0x383e55,_0x4a2842))[_0x4eca('0x47')](handleError(_0x383e55,null));};exports[_0x4eca('0x48')]=function(_0x2bf916,_0x434e52){var _0x1ef917={'raw':!![],'where':{'id':_0x2bf916[_0x4eca('0x49')]['id']}},_0x21d748={};_0x21d748[_0x4eca('0x39')]=_[_0x4eca('0x36')](db[_0x4eca('0x30')]['rawAttributes']);_0x21d748[_0x4eca('0x35')]=_[_0x4eca('0x36')](_0x2bf916[_0x4eca('0x35')]);_0x21d748[_0x4eca('0x37')]=_[_0x4eca('0x38')](_0x21d748[_0x4eca('0x39')],_0x21d748[_0x4eca('0x35')]);_0x1ef917['attributes']=_['intersection'](_0x21d748[_0x4eca('0x39')],qs[_0x4eca('0x3b')](_0x2bf916[_0x4eca('0x35')][_0x4eca('0x3b')]));_0x1ef917[_0x4eca('0x3a')]=_0x1ef917[_0x4eca('0x3a')][_0x4eca('0x4a')]?_0x1ef917[_0x4eca('0x3a')]:_0x21d748[_0x4eca('0x39')];if(_0x2bf916['query'][_0x4eca('0x45')]){_0x1ef917[_0x4eca('0x4b')]=[{'all':!![]}];}_0x1ef917=_[_0x4eca('0x43')]({},_0x1ef917,_0x2bf916[_0x4eca('0x44')]);return db[_0x4eca('0x30')][_0x4eca('0x4c')](_0x1ef917)[_0x4eca('0x28')](handleEntityNotFound(_0x434e52,null))[_0x4eca('0x28')](respondWithResult(_0x434e52,null))[_0x4eca('0x47')](handleError(_0x434e52,null));};exports[_0x4eca('0x4d')]=function(_0x378b3f,_0x95b33b){return db[_0x4eca('0x30')][_0x4eca('0x4d')](_0x378b3f['body'],{})['then'](function(_0x5c74b2){var _0x5946be=_0x378b3f[_0x4eca('0x4e')][_0x4eca('0x4f')]({'plain':!![]});if(!_0x5946be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5946be[_0x4eca('0x50')]===_0x4eca('0x4e')){var _0x58ad30=_0x5c74b2[_0x4eca('0x4f')]({'plain':!![]});var _0x241724=_0x4eca('0x2a');return db[_0x4eca('0x51')][_0x4eca('0x4c')]({'where':{'name':_0x241724,'userProfileId':_0x5946be[_0x4eca('0x52')]},'raw':!![]})['then'](function(_0xa45659){if(_0xa45659&&_0xa45659[_0x4eca('0x53')]===0x0){return db[_0x4eca('0x54')][_0x4eca('0x4d')]({'name':_0x58ad30['name'],'resourceId':_0x58ad30['id'],'type':_0xa45659[_0x4eca('0x2d')],'sectionId':_0xa45659['id']},{})[_0x4eca('0x28')](function(){return _0x5c74b2;});}else{return _0x5c74b2;}})['catch'](function(_0x10deae){logger[_0x4eca('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10deae);throw _0x10deae;});}return _0x5c74b2;})[_0x4eca('0x28')](respondWithResult(_0x95b33b,0xc9))[_0x4eca('0x47')](handleError(_0x95b33b,null));};exports['update']=function(_0x584c36,_0x2689aa){if(_0x584c36[_0x4eca('0x55')]['id']){delete _0x584c36[_0x4eca('0x55')]['id'];}return db[_0x4eca('0x30')][_0x4eca('0x4c')]({'where':{'id':_0x584c36[_0x4eca('0x49')]['id']}})['then'](handleEntityNotFound(_0x2689aa,null))['then'](saveUpdates(_0x584c36[_0x4eca('0x55')],null))['then'](respondWithResult(_0x2689aa,null))[_0x4eca('0x47')](handleError(_0x2689aa,null));};exports['destroy']=function(_0x1ddf63,_0x168ad7){return db[_0x4eca('0x30')][_0x4eca('0x4c')]({'where':{'id':_0x1ddf63['params']['id']}})[_0x4eca('0x28')](handleEntityNotFound(_0x168ad7,null))[_0x4eca('0x28')](removeEntity(_0x168ad7,null))['catch'](handleError(_0x168ad7,null));};
\ No newline at end of file
+var _0xcd08=['count','set','Content-Range','apply','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x36aad0,_0x3d2e17){var _0x31e987=function(_0x2d0fe4){while(--_0x2d0fe4){_0x36aad0['push'](_0x36aad0['shift']());}};_0x31e987(++_0x3d2e17);}(_0xcd08,0x1c5));var _0x8cd0=function(_0x1738fc,_0x3b1d12){_0x1738fc=_0x1738fc-0x0;var _0x2bea80=_0xcd08[_0x1738fc];return _0x2bea80;};'use strict';var emlformat=require(_0x8cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cd0('0x1'));var jsonpatch=require(_0x8cd0('0x2'));var rp=require(_0x8cd0('0x3'));var moment=require(_0x8cd0('0x4'));var BPromise=require(_0x8cd0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8cd0('0x6'));var csv=require(_0x8cd0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cd0('0x8'));var squel=require(_0x8cd0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8cd0('0xa'));var toCsv=require(_0x8cd0('0x7'));var querystring=require(_0x8cd0('0xb'));var Papa=require('papaparse');var Redis=require(_0x8cd0('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cd0('0xd'));var hardwareService=require(_0x8cd0('0xe'));var logger=require(_0x8cd0('0xf'))('api');var utils=require(_0x8cd0('0x10'));var config=require(_0x8cd0('0x11'));var licenseUtil=require(_0x8cd0('0x12'));var db=require(_0x8cd0('0x13'))['db'];function respondWithStatusCode(_0x145ce3,_0x4fe912){_0x4fe912=_0x4fe912||0xcc;return function(_0x314c0e){if(_0x314c0e){return _0x145ce3[_0x8cd0('0x14')](_0x4fe912);}return _0x145ce3[_0x8cd0('0x15')](_0x4fe912)[_0x8cd0('0x16')]();};}function respondWithResult(_0x67b202,_0x57ae9b){_0x57ae9b=_0x57ae9b||0xc8;return function(_0x1e69cd){if(_0x1e69cd){return _0x67b202[_0x8cd0('0x15')](_0x57ae9b)[_0x8cd0('0x17')](_0x1e69cd);}};}function respondWithFilteredResult(_0x347bdb,_0x57ca78){return function(_0x2902db){if(_0x2902db){var _0x21d815=typeof _0x57ca78[_0x8cd0('0x18')]===_0x8cd0('0x19')&&typeof _0x57ca78[_0x8cd0('0x1a')]==='undefined';var _0x51069a=_0x2902db['count'];var _0x4dfbc0=_0x21d815?0x0:_0x57ca78[_0x8cd0('0x18')];var _0x3beaea=_0x21d815?_0x2902db[_0x8cd0('0x1b')]:_0x57ca78[_0x8cd0('0x18')]+_0x57ca78[_0x8cd0('0x1a')];var _0x50b982;if(_0x3beaea>=_0x51069a){_0x3beaea=_0x51069a;_0x50b982=0xc8;}else{_0x50b982=0xce;}_0x347bdb[_0x8cd0('0x15')](_0x50b982);return _0x347bdb[_0x8cd0('0x1c')](_0x8cd0('0x1d'),_0x4dfbc0+'-'+_0x3beaea+'/'+_0x51069a)[_0x8cd0('0x17')](_0x2902db);}return null;};}function patchUpdates(_0x1c2045){return function(_0x1164cf){try{jsonpatch[_0x8cd0('0x1e')](_0x1164cf,_0x1c2045,!![]);}catch(_0x17d0a1){return BPromise['reject'](_0x17d0a1);}return _0x1164cf[_0x8cd0('0x1f')]();};}function saveUpdates(_0x1994af,_0x160a10){return function(_0x1721ab){if(_0x1721ab){return _0x1721ab['update'](_0x1994af)['then'](function(_0x1d33c0){return _0x1d33c0;});}return null;};}function removeEntity(_0x399fce,_0x49f9ca){return function(_0x995f50){if(_0x995f50){return _0x995f50[_0x8cd0('0x20')]()[_0x8cd0('0x21')](function(){var _0x532706=_0x995f50[_0x8cd0('0x22')]({'plain':!![]});var _0x197cb5='ContactItemTypes';return db[_0x8cd0('0x23')][_0x8cd0('0x20')]({'where':{'type':_0x197cb5,'resourceId':_0x532706['id']}})['then'](function(){return _0x995f50;});})['then'](function(){_0x399fce[_0x8cd0('0x15')](0xcc)[_0x8cd0('0x16')]();});}};}function handleEntityNotFound(_0x3d5936,_0x474ef){return function(_0x41c323){if(!_0x41c323){_0x3d5936[_0x8cd0('0x14')](0x194);}return _0x41c323;};}function handleError(_0x3de0c7,_0x1bcaf3){_0x1bcaf3=_0x1bcaf3||0x1f4;return function(_0x9f0d54){logger[_0x8cd0('0x24')](_0x9f0d54[_0x8cd0('0x25')]);if(_0x9f0d54[_0x8cd0('0x26')]){delete _0x9f0d54[_0x8cd0('0x26')];}_0x3de0c7['status'](_0x1bcaf3)[_0x8cd0('0x27')](_0x9f0d54);};}exports[_0x8cd0('0x28')]=function(_0x5627e8,_0x3c21ef){var _0x4de4e1={},_0x481817={},_0x1533f0={'count':0x0,'rows':[]};var _0x30bbc4=_[_0x8cd0('0x29')](db[_0x8cd0('0x2a')][_0x8cd0('0x2b')],function(_0x5bee62){return{'name':_0x5bee62[_0x8cd0('0x2c')],'type':_0x5bee62[_0x8cd0('0x2d')]['key']};});_0x481817['model']=_['map'](_0x30bbc4,_0x8cd0('0x26'));_0x481817[_0x8cd0('0x2e')]=_['keys'](_0x5627e8[_0x8cd0('0x2e')]);_0x481817['filters']=_[_0x8cd0('0x2f')](_0x481817['model'],_0x481817[_0x8cd0('0x2e')]);_0x4de4e1[_0x8cd0('0x30')]=_[_0x8cd0('0x2f')](_0x481817[_0x8cd0('0x31')],qs[_0x8cd0('0x32')](_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x32')]));_0x4de4e1[_0x8cd0('0x30')]=_0x4de4e1[_0x8cd0('0x30')]['length']?_0x4de4e1[_0x8cd0('0x30')]:_0x481817[_0x8cd0('0x31')];if(!_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x33')](_0x8cd0('0x34'))){_0x4de4e1[_0x8cd0('0x1a')]=qs[_0x8cd0('0x1a')](_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x1a')]);_0x4de4e1[_0x8cd0('0x18')]=qs['offset'](_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x18')]);}_0x4de4e1[_0x8cd0('0x35')]=qs['sort'](_0x5627e8[_0x8cd0('0x2e')]['sort']);_0x4de4e1[_0x8cd0('0x36')]=qs[_0x8cd0('0x37')](_[_0x8cd0('0x38')](_0x5627e8[_0x8cd0('0x2e')],_0x481817[_0x8cd0('0x37')]),_0x30bbc4);if(_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x39')]){_0x4de4e1[_0x8cd0('0x36')]=_['merge'](_0x4de4e1[_0x8cd0('0x36')],{'$or':_[_0x8cd0('0x29')](_0x30bbc4,function(_0x391a7d){if(_0x391a7d[_0x8cd0('0x2d')]!==_0x8cd0('0x3a')){var _0x75b76c={};_0x75b76c[_0x391a7d[_0x8cd0('0x26')]]={'$like':'%'+_0x5627e8[_0x8cd0('0x2e')][_0x8cd0('0x39')]+'%'};return _0x75b76c;}})});}_0x4de4e1=_[_0x8cd0('0x3b')]({},_0x4de4e1,_0x5627e8[_0x8cd0('0x3c')]);var _0x4ed9e1={'where':_0x4de4e1['where']};return db[_0x8cd0('0x2a')][_0x8cd0('0x1b')](_0x4ed9e1)[_0x8cd0('0x21')](function(_0x33a759){_0x1533f0['count']=_0x33a759;if(_0x5627e8[_0x8cd0('0x2e')]['includeAll']){_0x4de4e1[_0x8cd0('0x3d')]=[{'all':!![]}];}return db[_0x8cd0('0x2a')][_0x8cd0('0x3e')](_0x4de4e1);})[_0x8cd0('0x21')](function(_0x52d647){_0x1533f0[_0x8cd0('0x3f')]=_0x52d647;return _0x1533f0;})[_0x8cd0('0x21')](respondWithFilteredResult(_0x3c21ef,_0x4de4e1))[_0x8cd0('0x40')](handleError(_0x3c21ef,null));};exports[_0x8cd0('0x41')]=function(_0x56b74f,_0x2b62b4){var _0x2ebd5e={'raw':!![],'where':{'id':_0x56b74f['params']['id']}},_0xd16433={};_0xd16433['model']=_[_0x8cd0('0x42')](db[_0x8cd0('0x2a')][_0x8cd0('0x2b')]);_0xd16433[_0x8cd0('0x2e')]=_[_0x8cd0('0x42')](_0x56b74f['query']);_0xd16433[_0x8cd0('0x37')]=_[_0x8cd0('0x2f')](_0xd16433[_0x8cd0('0x31')],_0xd16433['query']);_0x2ebd5e[_0x8cd0('0x30')]=_[_0x8cd0('0x2f')](_0xd16433['model'],qs[_0x8cd0('0x32')](_0x56b74f['query'][_0x8cd0('0x32')]));_0x2ebd5e[_0x8cd0('0x30')]=_0x2ebd5e[_0x8cd0('0x30')][_0x8cd0('0x43')]?_0x2ebd5e[_0x8cd0('0x30')]:_0xd16433[_0x8cd0('0x31')];if(_0x56b74f['query'][_0x8cd0('0x44')]){_0x2ebd5e[_0x8cd0('0x3d')]=[{'all':!![]}];}_0x2ebd5e=_[_0x8cd0('0x3b')]({},_0x2ebd5e,_0x56b74f[_0x8cd0('0x3c')]);return db[_0x8cd0('0x2a')][_0x8cd0('0x45')](_0x2ebd5e)[_0x8cd0('0x21')](handleEntityNotFound(_0x2b62b4,null))[_0x8cd0('0x21')](respondWithResult(_0x2b62b4,null))[_0x8cd0('0x40')](handleError(_0x2b62b4,null));};exports[_0x8cd0('0x46')]=function(_0x17f15b,_0x50904f){return db[_0x8cd0('0x2a')][_0x8cd0('0x46')](_0x17f15b[_0x8cd0('0x47')],{})[_0x8cd0('0x21')](function(_0x227d46){var _0x341ef3=_0x17f15b['user'][_0x8cd0('0x22')]({'plain':!![]});if(!_0x341ef3)throw new Error(_0x8cd0('0x48'));if(_0x341ef3[_0x8cd0('0x49')]===_0x8cd0('0x4a')){var _0x366541=_0x227d46[_0x8cd0('0x22')]({'plain':!![]});var _0x268e5c='ContactItemTypes';return db[_0x8cd0('0x4b')]['find']({'where':{'name':_0x268e5c,'userProfileId':_0x341ef3[_0x8cd0('0x4c')]},'raw':!![]})['then'](function(_0x559e26){if(_0x559e26&&_0x559e26[_0x8cd0('0x4d')]===0x0){return db[_0x8cd0('0x23')][_0x8cd0('0x46')]({'name':_0x366541[_0x8cd0('0x26')],'resourceId':_0x366541['id'],'type':_0x559e26[_0x8cd0('0x26')],'sectionId':_0x559e26['id']},{})[_0x8cd0('0x21')](function(){return _0x227d46;});}else{return _0x227d46;}})[_0x8cd0('0x40')](function(_0x514c51){logger[_0x8cd0('0x24')](_0x8cd0('0x4e'),_0x514c51);throw _0x514c51;});}return _0x227d46;})[_0x8cd0('0x21')](respondWithResult(_0x50904f,0xc9))[_0x8cd0('0x40')](handleError(_0x50904f,null));};exports['update']=function(_0x5d7f06,_0x295e7b){if(_0x5d7f06[_0x8cd0('0x47')]['id']){delete _0x5d7f06[_0x8cd0('0x47')]['id'];}return db[_0x8cd0('0x2a')][_0x8cd0('0x45')]({'where':{'id':_0x5d7f06['params']['id']}})[_0x8cd0('0x21')](handleEntityNotFound(_0x295e7b,null))[_0x8cd0('0x21')](saveUpdates(_0x5d7f06[_0x8cd0('0x47')],null))[_0x8cd0('0x21')](respondWithResult(_0x295e7b,null))[_0x8cd0('0x40')](handleError(_0x295e7b,null));};exports[_0x8cd0('0x20')]=function(_0x473823,_0x4ad3cb){return db[_0x8cd0('0x2a')][_0x8cd0('0x45')]({'where':{'id':_0x473823[_0x8cd0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4ad3cb,null))[_0x8cd0('0x21')](removeEntity(_0x4ad3cb,null))['catch'](handleError(_0x4ad3cb,null));};
\ No newline at end of file
index 9f1b49a..77127e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd525=['exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','moment','bluebird','request-promise','rimraf','./contactItemType.attributes'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xd525,0x93));var _0x5d52=function(_0xebeea9,_0x355803){_0xebeea9=_0xebeea9-0x0;var _0x590562=_0xd525[_0xebeea9];return _0x590562;};'use strict';var _=require('lodash');var util=require(_0x5d52('0x0'));var logger=require(_0x5d52('0x1'))('api');var moment=require(_0x5d52('0x2'));var BPromise=require(_0x5d52('0x3'));var rp=require(_0x5d52('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d52('0x5'));var config=require('../../config/environment');var attributes=require(_0x5d52('0x6'));module[_0x5d52('0x7')]=function(_0x17f527,_0x252f5f){return _0x17f527[_0x5d52('0x8')](_0x5d52('0x9'),attributes,{'tableName':_0x5d52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13ce=['ContactItemType','tools_contact_item_types','../../config/logger','api','moment','bluebird','path','../../config/environment','./contactItemType.attributes','define'];(function(_0x81eb62,_0x3034cb){var _0x4b03d3=function(_0x1c7e2c){while(--_0x1c7e2c){_0x81eb62['push'](_0x81eb62['shift']());}};_0x4b03d3(++_0x3034cb);}(_0x13ce,0x110));var _0xe13c=function(_0x3ac828,_0x1bf69e){_0x3ac828=_0x3ac828-0x0;var _0x312ad7=_0x13ce[_0x3ac828];return _0x312ad7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe13c('0x0'))(_0xe13c('0x1'));var moment=require(_0xe13c('0x2'));var BPromise=require(_0xe13c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13c('0x4'));var rimraf=require('rimraf');var config=require(_0xe13c('0x5'));var attributes=require(_0xe13c('0x6'));module['exports']=function(_0x496714,_0x1f6100){return _0x496714[_0xe13c('0x7')](_0xe13c('0x8'),attributes,{'tableName':_0xe13c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75a3af4..7d38f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a65=['rpc','../../config/environment','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4a65,0x16f));var _0x54a6=function(_0x15e0c2,_0x20027b){_0x15e0c2=_0x15e0c2-0x0;var _0x5835dd=_0x4a65[_0x15e0c2];return _0x5835dd;};'use strict';var _=require('lodash');var util=require(_0x54a6('0x0'));var moment=require(_0x54a6('0x1'));var BPromise=require(_0x54a6('0x2'));var rs=require(_0x54a6('0x3'));var fs=require('fs');var Redis=require(_0x54a6('0x4'));var db=require(_0x54a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x54a6('0x6'))(_0x54a6('0x7'));var config=require(_0x54a6('0x8'));var jayson=require(_0x54a6('0x9'));var client=jayson[_0x54a6('0xa')][_0x54a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6544,_0x27e9d3,_0x40e769){return new BPromise(function(_0xb61d06,_0x360d48){return client['request'](_0x2b6544,_0x40e769)[_0x54a6('0xc')](function(_0x40a069){logger['info'](_0x54a6('0xd'),_0x27e9d3,_0x54a6('0xe'));logger[_0x54a6('0xf')](_0x54a6('0x10'),_0x27e9d3,_0x54a6('0xe'),JSON[_0x54a6('0x11')](_0x40a069));if(_0x40a069[_0x54a6('0x12')]){if(_0x40a069[_0x54a6('0x12')][_0x54a6('0x13')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x27e9d3,_0x40a069['error'][_0x54a6('0x14')]);return _0x360d48(_0x40a069['error']['message']);}logger[_0x54a6('0x12')]('ContactItemType,\x20%s,\x20%s',_0x27e9d3,_0x40a069[_0x54a6('0x12')]['message']);return _0xb61d06(_0x40a069[_0x54a6('0x12')]['message']);}else{logger[_0x54a6('0x15')](_0x54a6('0xd'),_0x27e9d3,_0x54a6('0xe'));_0xb61d06(_0x40a069['result'][_0x54a6('0x14')]);}})['catch'](function(_0x1e18f6){logger['error'](_0x54a6('0xd'),_0x27e9d3,_0x1e18f6);_0x360d48(_0x1e18f6);});});}
\ No newline at end of file
+var _0x2054=['info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\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','jayson/promise','client','http','then'];(function(_0x238030,_0xf10a86){var _0x3f45bd=function(_0x742d64){while(--_0x742d64){_0x238030['push'](_0x238030['shift']());}};_0x3f45bd(++_0xf10a86);}(_0x2054,0x1b3));var _0x4205=function(_0x28894c,_0x5a428c){_0x28894c=_0x28894c-0x0;var _0x3e108c=_0x2054[_0x28894c];return _0x3e108c;};'use strict';var _=require(_0x4205('0x0'));var util=require(_0x4205('0x1'));var moment=require(_0x4205('0x2'));var BPromise=require(_0x4205('0x3'));var rs=require(_0x4205('0x4'));var fs=require('fs');var Redis=require(_0x4205('0x5'));var db=require(_0x4205('0x6'))['db'];var utils=require(_0x4205('0x7'));var logger=require(_0x4205('0x8'))(_0x4205('0x9'));var config=require(_0x4205('0xa'));var jayson=require(_0x4205('0xb'));var client=jayson[_0x4205('0xc')][_0x4205('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x279a19,_0x2a1459,_0x1cb718){return new BPromise(function(_0x47f17f,_0x249d0e){return client['request'](_0x279a19,_0x1cb718)[_0x4205('0xe')](function(_0xd5663f){logger[_0x4205('0xf')](_0x4205('0x10'),_0x2a1459,_0x4205('0x11'));logger['debug'](_0x4205('0x12'),_0x2a1459,_0x4205('0x11'),JSON[_0x4205('0x13')](_0xd5663f));if(_0xd5663f[_0x4205('0x14')]){if(_0xd5663f[_0x4205('0x14')][_0x4205('0x15')]===0x1f4){logger[_0x4205('0x14')](_0x4205('0x10'),_0x2a1459,_0xd5663f[_0x4205('0x14')][_0x4205('0x16')]);return _0x249d0e(_0xd5663f[_0x4205('0x14')][_0x4205('0x16')]);}logger[_0x4205('0x14')](_0x4205('0x10'),_0x2a1459,_0xd5663f[_0x4205('0x14')][_0x4205('0x16')]);return _0x47f17f(_0xd5663f[_0x4205('0x14')]['message']);}else{logger['info'](_0x4205('0x10'),_0x2a1459,'request\x20sent');_0x47f17f(_0xd5663f[_0x4205('0x17')]['message']);}})[_0x4205('0x18')](function(_0xf779a){logger[_0x4205('0x14')](_0x4205('0x10'),_0x2a1459,_0xf779a);_0x249d0e(_0xf779a);});});}
\ No newline at end of file
index 9df43c4..c9ec1c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f15=['put','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3ee361,_0x244c67){var _0x32a3d0=function(_0x238363){while(--_0x238363){_0x3ee361['push'](_0x3ee361['shift']());}};_0x32a3d0(++_0x244c67);}(_0x9f15,0x19a));var _0x59f1=function(_0x1a8132,_0x1d4978){_0x1a8132=_0x1a8132-0x0;var _0x5b9329=_0x9f15[_0x1a8132];return _0x5b9329;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x59f1('0x0'));var express=require(_0x59f1('0x1'));var router=express[_0x59f1('0x2')]();var fs_extra=require(_0x59f1('0x3'));var auth=require(_0x59f1('0x4'));var interaction=require(_0x59f1('0x5'));var config=require(_0x59f1('0x6'));var controller=require(_0x59f1('0x7'));router[_0x59f1('0x8')]('/',auth[_0x59f1('0x9')](),controller[_0x59f1('0xa')]);router['get'](_0x59f1('0xb'),auth[_0x59f1('0x9')](),controller[_0x59f1('0xc')]);router[_0x59f1('0xd')]('/',auth[_0x59f1('0x9')](),controller[_0x59f1('0xe')]);router[_0x59f1('0xf')](_0x59f1('0xb'),auth[_0x59f1('0x9')](),controller['update']);router[_0x59f1('0x10')](_0x59f1('0xb'),auth[_0x59f1('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7be4=['isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','/:id'];(function(_0x4d004c,_0x1836cb){var _0xa27461=function(_0x4ae2c8){while(--_0x4ae2c8){_0x4d004c['push'](_0x4d004c['shift']());}};_0xa27461(++_0x1836cb);}(_0x7be4,0x16e));var _0x47be=function(_0x2b1b32,_0x328369){_0x2b1b32=_0x2b1b32-0x0;var _0xce6c52=_0x7be4[_0x2b1b32];return _0xce6c52;};'use strict';var multer=require(_0x47be('0x0'));var util=require(_0x47be('0x1'));var path=require(_0x47be('0x2'));var timeout=require(_0x47be('0x3'));var express=require(_0x47be('0x4'));var router=express[_0x47be('0x5')]();var fs_extra=require(_0x47be('0x6'));var auth=require(_0x47be('0x7'));var interaction=require(_0x47be('0x8'));var config=require(_0x47be('0x9'));var controller=require(_0x47be('0xa'));router[_0x47be('0xb')]('/',auth['isAuthenticated'](),controller[_0x47be('0xc')]);router[_0x47be('0xb')](_0x47be('0xd'),auth[_0x47be('0xe')](),controller[_0x47be('0xf')]);router['post']('/',auth[_0x47be('0xe')](),controller['create']);router[_0x47be('0x10')](_0x47be('0xd'),auth[_0x47be('0xe')](),controller[_0x47be('0x11')]);router[_0x47be('0x12')](_0x47be('0xd'),auth[_0x47be('0xe')](),controller[_0x47be('0x13')]);module['exports']=router;
\ No newline at end of file
index 21e4730..078ecfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
+var _0xb7e7=['STRING','sequelize'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
index 3f23411..d7036bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbabe=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','Dashboard','includeAll','findAll','catch','show','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','omit','createdAt','updatedAt','userProfileId','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','DashboardId','findOne','pick','getItems','nolimit','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2dbdf0,_0x151810){var _0x4c23e3=function(_0x415dfe){while(--_0x415dfe){_0x2dbdf0['push'](_0x2dbdf0['shift']());}};_0x4c23e3(++_0x151810);}(_0xbabe,0x1e6));var _0xebab=function(_0x3afdd9,_0x5becc2){_0x3afdd9=_0x3afdd9-0x0;var _0x2d7189=_0xbabe[_0x3afdd9];return _0x2d7189;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebab('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebab('0x1'));var moment=require(_0xebab('0x2'));var BPromise=require(_0xebab('0x3'));var Mustache=require(_0xebab('0x4'));var util=require(_0xebab('0x5'));var path=require(_0xebab('0x6'));var sox=require(_0xebab('0x7'));var csv=require(_0xebab('0x8'));var ejs=require(_0xebab('0x9'));var fs=require('fs');var fs_extra=require(_0xebab('0xa'));var _=require(_0xebab('0xb'));var squel=require(_0xebab('0xc'));var crypto=require(_0xebab('0xd'));var jsforce=require(_0xebab('0xe'));var deskjs=require(_0xebab('0xf'));var toCsv=require(_0xebab('0x8'));var querystring=require(_0xebab('0x10'));var Papa=require(_0xebab('0x11'));var Redis=require(_0xebab('0x12'));var authService=require(_0xebab('0x13'));var qs=require(_0xebab('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebab('0x15'));var logger=require(_0xebab('0x16'))(_0xebab('0x17'));var utils=require(_0xebab('0x18'));var config=require(_0xebab('0x19'));var licenseUtil=require(_0xebab('0x1a'));var db=require(_0xebab('0x1b'))['db'];config[_0xebab('0x1c')]=_[_0xebab('0x1d')](config['redis'],{'host':_0xebab('0x1e'),'port':0x18eb});var socket=require(_0xebab('0x1f'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1c4ffd,_0x5222b7){_0x5222b7=_0x5222b7||0xcc;return function(_0x3cf801){if(_0x3cf801){return _0x1c4ffd['sendStatus'](_0x5222b7);}return _0x1c4ffd[_0xebab('0x20')](_0x5222b7)[_0xebab('0x21')]();};}function respondWithResult(_0x572079,_0x2be4f9){_0x2be4f9=_0x2be4f9||0xc8;return function(_0x25f33d){if(_0x25f33d){return _0x572079[_0xebab('0x20')](_0x2be4f9)['json'](_0x25f33d);}};}function respondWithFilteredResult(_0x2a6ce5,_0x20192f){return function(_0x51b048){if(_0x51b048){var _0x356869=typeof _0x20192f[_0xebab('0x22')]===_0xebab('0x23')&&typeof _0x20192f[_0xebab('0x24')]==='undefined';var _0x47a1ec=_0x51b048[_0xebab('0x25')];var _0x6e2605=_0x356869?0x0:_0x20192f[_0xebab('0x22')];var _0x3cd0e2=_0x356869?_0x51b048[_0xebab('0x25')]:_0x20192f['offset']+_0x20192f[_0xebab('0x24')];var _0x1f89a8;if(_0x3cd0e2>=_0x47a1ec){_0x3cd0e2=_0x47a1ec;_0x1f89a8=0xc8;}else{_0x1f89a8=0xce;}_0x2a6ce5[_0xebab('0x20')](_0x1f89a8);return _0x2a6ce5[_0xebab('0x26')](_0xebab('0x27'),_0x6e2605+'-'+_0x3cd0e2+'/'+_0x47a1ec)[_0xebab('0x28')](_0x51b048);}return null;};}function patchUpdates(_0x533921){return function(_0x5dd556){try{jsonpatch['apply'](_0x5dd556,_0x533921,!![]);}catch(_0x93d23f){return BPromise[_0xebab('0x29')](_0x93d23f);}return _0x5dd556[_0xebab('0x2a')]();};}function saveUpdates(_0x3d50cf,_0x5c276e){return function(_0x283a80){if(_0x283a80){return _0x283a80[_0xebab('0x2b')](_0x3d50cf)[_0xebab('0x2c')](function(_0x53b50f){return _0x53b50f;});}return null;};}function removeEntity(_0x11d773,_0x3ae69f){return function(_0x12cf10){if(_0x12cf10){return _0x12cf10[_0xebab('0x2d')]()[_0xebab('0x2c')](function(){var _0x5e3bca=_0x12cf10['get']({'plain':!![]});var _0x1e9378=_0xebab('0x2e');return db[_0xebab('0x2f')]['destroy']({'where':{'type':_0x1e9378,'resourceId':_0x5e3bca['id']}})[_0xebab('0x2c')](function(){return _0x12cf10;});})[_0xebab('0x2c')](function(){_0x11d773[_0xebab('0x20')](0xcc)[_0xebab('0x21')]();});}};}function handleEntityNotFound(_0x3e13ef,_0x12f38a){return function(_0x2a0d14){if(!_0x2a0d14){_0x3e13ef[_0xebab('0x30')](0x194);}return _0x2a0d14;};}function handleError(_0x4cbc28,_0x18ade7){_0x18ade7=_0x18ade7||0x1f4;return function(_0x38e7c8){logger[_0xebab('0x31')](_0x38e7c8[_0xebab('0x32')]);if(_0x38e7c8['name']){delete _0x38e7c8[_0xebab('0x33')];}_0x4cbc28[_0xebab('0x20')](_0x18ade7)[_0xebab('0x34')](_0x38e7c8);};}exports[_0xebab('0x35')]=function(_0x3844fb,_0x1bd897){var _0x527ed4={},_0x5c44a4={},_0x29f026={'count':0x0,'rows':[]};var _0x145d60=_[_0xebab('0x36')](db['Dashboard']['rawAttributes'],function(_0x52440b){return{'name':_0x52440b[_0xebab('0x37')],'type':_0x52440b['type'][_0xebab('0x38')]};});_0x5c44a4['model']=_[_0xebab('0x36')](_0x145d60,_0xebab('0x33'));_0x5c44a4['query']=_['keys'](_0x3844fb[_0xebab('0x39')]);_0x5c44a4[_0xebab('0x3a')]=_[_0xebab('0x3b')](_0x5c44a4[_0xebab('0x3c')],_0x5c44a4[_0xebab('0x39')]);_0x527ed4[_0xebab('0x3d')]=_[_0xebab('0x3b')](_0x5c44a4[_0xebab('0x3c')],qs[_0xebab('0x3e')](_0x3844fb[_0xebab('0x39')][_0xebab('0x3e')]));_0x527ed4[_0xebab('0x3d')]=_0x527ed4['attributes'][_0xebab('0x3f')]?_0x527ed4[_0xebab('0x3d')]:_0x5c44a4[_0xebab('0x3c')];if(!_0x3844fb[_0xebab('0x39')][_0xebab('0x40')]('nolimit')){_0x527ed4['limit']=qs['limit'](_0x3844fb[_0xebab('0x39')][_0xebab('0x24')]);_0x527ed4[_0xebab('0x22')]=qs[_0xebab('0x22')](_0x3844fb[_0xebab('0x39')]['offset']);}_0x527ed4[_0xebab('0x41')]=qs[_0xebab('0x42')](_0x3844fb[_0xebab('0x39')][_0xebab('0x42')]);_0x527ed4[_0xebab('0x43')]=qs[_0xebab('0x3a')](_['pick'](_0x3844fb[_0xebab('0x39')],_0x5c44a4[_0xebab('0x3a')]),_0x145d60);if(_0x3844fb[_0xebab('0x39')]['filter']){_0x527ed4[_0xebab('0x43')]=_[_0xebab('0x44')](_0x527ed4[_0xebab('0x43')],{'$or':_[_0xebab('0x36')](_0x145d60,function(_0x56d189){if(_0x56d189[_0xebab('0x45')]!==_0xebab('0x46')){var _0x596229={};_0x596229[_0x56d189[_0xebab('0x33')]]={'$like':'%'+_0x3844fb[_0xebab('0x39')][_0xebab('0x47')]+'%'};return _0x596229;}})});}_0x527ed4=_[_0xebab('0x44')]({},_0x527ed4,_0x3844fb[_0xebab('0x48')]);var _0x3bd89c={'where':_0x527ed4[_0xebab('0x43')]};return db[_0xebab('0x49')][_0xebab('0x25')](_0x3bd89c)[_0xebab('0x2c')](function(_0x44ada3){_0x29f026[_0xebab('0x25')]=_0x44ada3;if(_0x3844fb['query'][_0xebab('0x4a')]){_0x527ed4['include']=[{'all':!![]}];}return db[_0xebab('0x49')][_0xebab('0x4b')](_0x527ed4);})[_0xebab('0x2c')](function(_0x20782e){_0x29f026['rows']=_0x20782e;return _0x29f026;})[_0xebab('0x2c')](respondWithFilteredResult(_0x1bd897,_0x527ed4))[_0xebab('0x4c')](handleError(_0x1bd897,null));};exports[_0xebab('0x4d')]=function(_0x2153f7,_0x58d477){var _0x471ccc={'raw':![],'where':{'id':_0x2153f7['params']['id']}},_0x7dac34={};_0x7dac34[_0xebab('0x3c')]=_[_0xebab('0x4e')](db[_0xebab('0x49')][_0xebab('0x4f')]);_0x7dac34[_0xebab('0x39')]=_[_0xebab('0x4e')](_0x2153f7[_0xebab('0x39')]);_0x7dac34['filters']=_['intersection'](_0x7dac34['model'],_0x7dac34['query']);_0x471ccc[_0xebab('0x3d')]=_[_0xebab('0x3b')](_0x7dac34[_0xebab('0x3c')],qs[_0xebab('0x3e')](_0x2153f7[_0xebab('0x39')]['fields']));_0x471ccc[_0xebab('0x3d')]=_0x471ccc[_0xebab('0x3d')]['length']?_0x471ccc[_0xebab('0x3d')]:_0x7dac34[_0xebab('0x3c')];if(_0x2153f7[_0xebab('0x39')]['includeAll']){_0x471ccc['include']=[{'all':!![]}];}_0x471ccc=_[_0xebab('0x44')]({},_0x471ccc,_0x2153f7[_0xebab('0x48')]);return db[_0xebab('0x49')][_0xebab('0x50')](_0x471ccc)[_0xebab('0x2c')](handleEntityNotFound(_0x58d477,null))['then'](respondWithResult(_0x58d477,null))['catch'](handleError(_0x58d477,null));};exports['create']=function(_0xe1af2c,_0x3c4430){return db[_0xebab('0x49')][_0xebab('0x51')](_0xe1af2c[_0xebab('0x52')],{})[_0xebab('0x2c')](function(_0x1cd83b){var _0x184deb=_0xe1af2c[_0xebab('0x53')]['get']({'plain':!![]});if(!_0x184deb)throw new Error(_0xebab('0x54'));if(_0x184deb[_0xebab('0x55')]===_0xebab('0x53')){var _0x4da11a=_0x1cd83b[_0xebab('0x56')]({'plain':!![]});var _0x4b8f03=_0xebab('0x2e');return db[_0xebab('0x57')]['find']({'where':{'name':_0x4b8f03,'userProfileId':_0x184deb['userProfileId']},'raw':!![]})[_0xebab('0x2c')](function(_0x25b7ce){if(_0x25b7ce&&_0x25b7ce[_0xebab('0x58')]===0x0){return db[_0xebab('0x2f')][_0xebab('0x51')]({'name':_0x4da11a[_0xebab('0x33')],'resourceId':_0x4da11a['id'],'type':_0x25b7ce['name'],'sectionId':_0x25b7ce['id']},{})['then'](function(){return _0x1cd83b;});}else{return _0x1cd83b;}})[_0xebab('0x4c')](function(_0x18be8e){logger['error'](_0xebab('0x59'),_0x18be8e);throw _0x18be8e;});}return _0x1cd83b;})[_0xebab('0x2c')](respondWithResult(_0x3c4430,0xc9))[_0xebab('0x4c')](handleError(_0x3c4430,null));};exports[_0xebab('0x5a')]=function(_0x1eb4c0,_0x3ece85){var _0x30a8f3={'where':{'id':_0x1eb4c0[_0xebab('0x5b')]['id']}},_0x551452={};_0x551452[_0xebab('0x3c')]=_[_0xebab('0x4e')](db['Dashboard'][_0xebab('0x4f')]);_0x30a8f3[_0xebab('0x3d')]=_[_0xebab('0x3b')](_0x551452[_0xebab('0x3c')],qs['fields'](_0x1eb4c0['query'][_0xebab('0x3e')]));_0x30a8f3[_0xebab('0x3d')]=_0x30a8f3['attributes'][_0xebab('0x3f')]?_0x30a8f3[_0xebab('0x3d')]:_0x551452['model'];if(_0x1eb4c0[_0xebab('0x39')]['includeAll']){_0x30a8f3[_0xebab('0x5c')]=[{'all':!![]}];}_0x30a8f3=_[_0xebab('0x44')]({},_0x30a8f3,_0x1eb4c0[_0xebab('0x48')]);return db['Dashboard'][_0xebab('0x50')](_0x30a8f3)['then'](handleEntityNotFound(_0x3ece85,null))['then'](function(_0x397f13){if(_0x397f13){var _0x511eb5=_0x397f13['get']({'plain':!![]});_0x511eb5=qs['omit'](_0x511eb5,['id','createdAt','updatedAt']);_0x1eb4c0[_0xebab('0x52')]=_[_0xebab('0x5d')](_0x1eb4c0[_0xebab('0x52')],['id',_0xebab('0x5e'),_0xebab('0x5f')]);return db[_0xebab('0x49')]['create'](_[_0xebab('0x44')](_0x511eb5,_0x1eb4c0[_0xebab('0x52')]),{'include':_0x1eb4c0[_0xebab('0x39')][_0xebab('0x4a')]?[{'all':!![]}]:undefined})[_0xebab('0x2c')](function(_0x422ff9){var _0xea4aa3=_0x1eb4c0[_0xebab('0x53')][_0xebab('0x56')]({'plain':!![]});if(!_0xea4aa3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xea4aa3[_0xebab('0x55')]===_0xebab('0x53')){var _0x508b19=_0x422ff9[_0xebab('0x56')]({'plain':!![]});var _0x110185=_0xebab('0x2e');return db[_0xebab('0x57')]['find']({'where':{'name':_0x110185,'userProfileId':_0xea4aa3[_0xebab('0x60')]},'raw':!![]})[_0xebab('0x2c')](function(_0x4fdd93){if(_0x4fdd93&&_0x4fdd93[_0xebab('0x58')]===0x0){return db[_0xebab('0x2f')][_0xebab('0x51')]({'name':_0x508b19[_0xebab('0x33')],'resourceId':_0x508b19['id'],'type':_0x4fdd93[_0xebab('0x33')],'sectionId':_0x4fdd93['id']},{})[_0xebab('0x2c')](function(){return _0x422ff9;});}else{return _0x422ff9;}})[_0xebab('0x4c')](function(_0xd280fe){logger[_0xebab('0x31')](_0xebab('0x59'),_0xd280fe);throw _0xd280fe;});}return _0x422ff9;});}})['then'](respondWithResult(_0x3ece85,0xc9))['catch'](handleError(_0x3ece85,null));};exports[_0xebab('0x2b')]=function(_0x3987a2,_0x355c33){if(_0x3987a2[_0xebab('0x52')]['id']){delete _0x3987a2[_0xebab('0x52')]['id'];}return db[_0xebab('0x49')][_0xebab('0x50')]({'where':{'id':_0x3987a2['params']['id']}})[_0xebab('0x2c')](handleEntityNotFound(_0x355c33,null))[_0xebab('0x2c')](saveUpdates(_0x3987a2[_0xebab('0x52')],null))['then'](respondWithResult(_0x355c33,null))[_0xebab('0x4c')](handleError(_0x355c33,null));};exports[_0xebab('0x2d')]=function(_0x39bf9a,_0x4be556){return db[_0xebab('0x49')][_0xebab('0x50')]({'where':{'id':_0x39bf9a['params']['id']}})[_0xebab('0x2c')](handleEntityNotFound(_0x4be556,null))[_0xebab('0x2c')](removeEntity(_0x4be556,null))[_0xebab('0x4c')](handleError(_0x4be556,null));};function widgetAttributes(_0x1000bd){try{switch(_0x1000bd[_0xebab('0x45')]){case'iframe':return[{'name':_0xebab('0x61'),'value':_0x1000bd[_0xebab('0x61')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||_0xebab('0x64')}];case'custom':return[{'name':_0xebab('0x65'),'value':_0x1000bd[_0xebab('0x65')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd['attrs'][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||''}];case'clock':return[{'name':_0xebab('0x66'),'value':_0x1000bd['attrHourFormat']||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||_0xebab('0x67')},{'name':_0xebab('0x68'),'value':_0x1000bd[_0xebab('0x68')]||(_0x1000bd['attrs']&&_0x1000bd[_0xebab('0x62')][0x1]?_0x1000bd['attrs'][0x1][_0xebab('0x63')]:undefined)||'0.00'},{'name':_0xebab('0x69'),'value':_0x1000bd[_0xebab('0x69')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x2]?_0x1000bd[_0xebab('0x62')][0x2][_0xebab('0x63')]:undefined)||0xc}];case'counter':return[{'name':_0xebab('0x6a'),'value':_0x1000bd[_0xebab('0x6a')]||(_0x1000bd['attrs']&&_0x1000bd['attrs'][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1000bd[_0xebab('0x6b')]||(_0x1000bd['attrs']&&_0x1000bd['attrs'][0x1]?_0x1000bd[_0xebab('0x62')][0x1][_0xebab('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x1000bd[_0xebab('0x69')]||(_0x1000bd['attrs']&&_0x1000bd[_0xebab('0x62')][0x2]?_0x1000bd[_0xebab('0x62')][0x2][_0xebab('0x63')]:undefined)||0x14}];case _0xebab('0x6c'):case _0xebab('0x6d'):return[{'name':'attrSerie1','value':_0x1000bd[_0xebab('0x6e')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd['attrs'][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||_0xebab('0x6f')},{'name':_0xebab('0x70'),'value':_0x1000bd[_0xebab('0x70')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x1]?_0x1000bd[_0xebab('0x62')][0x1][_0xebab('0x63')]:undefined)||null},{'name':_0xebab('0x71'),'value':_0x1000bd['attrSerie3']||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x2]?_0x1000bd[_0xebab('0x62')][0x2][_0xebab('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1000bd[_0xebab('0x6b')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x3]?_0x1000bd[_0xebab('0x62')][0x3][_0xebab('0x63')]:undefined)||[]}];case _0xebab('0x72'):return[{'name':_0xebab('0x73'),'type':_0x1000bd[_0xebab('0x74')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x0]?_0x1000bd[_0xebab('0x62')][0x0]['type']:undefined)||null,'value':_0x1000bd[_0xebab('0x73')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd[_0xebab('0x62')][0x0]?_0x1000bd[_0xebab('0x62')][0x0][_0xebab('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x1000bd[_0xebab('0x75')]||(_0x1000bd[_0xebab('0x62')]&&_0x1000bd['attrs'][0x1]?_0x1000bd[_0xebab('0x62')][0x1][_0xebab('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x5b65dd){logger['error']('widgetAttributes:\x20%s',JSON[_0xebab('0x76')](_0x5b65dd));return[];}}exports['addItem']=function(_0x35f19c,_0xc03b90,_0x3aa778){if(_0x35f19c['body']['id']){delete _0x35f19c[_0xebab('0x52')]['id'];}return db[_0xebab('0x49')]['find']({'where':{'id':_0x35f19c[_0xebab('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc03b90,null))[_0xebab('0x2c')](function(_0x46a622){if(_0x46a622){_0x35f19c[_0xebab('0x52')][_0xebab('0x77')]=_0x46a622['id'];_0x35f19c[_0xebab('0x52')]['attrs']=widgetAttributes(_0x35f19c[_0xebab('0x52')]);return db['DashboardItem'][_0xebab('0x51')](_0x35f19c[_0xebab('0x52')]);}})[_0xebab('0x2c')](respondWithResult(_0xc03b90,null))[_0xebab('0x4c')](handleError(_0xc03b90,null));};exports['getItems']=function(_0x3300d6,_0x405ade,_0x43fe47){var _0x53a9bd={};var _0x5f0848={};var _0x7d877f;var _0xeb9d25;return db['Dashboard'][_0xebab('0x78')]({'where':{'id':_0x3300d6[_0xebab('0x5b')]['id']}})[_0xebab('0x2c')](handleEntityNotFound(_0x405ade,null))['then'](function(_0x5da981){if(_0x5da981){_0x7d877f=_0x5da981;_0x5f0848[_0xebab('0x3c')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x5f0848[_0xebab('0x39')]=_[_0xebab('0x4e')](_0x3300d6['query']);_0x5f0848[_0xebab('0x3a')]=_[_0xebab('0x3b')](_0x5f0848[_0xebab('0x3c')],_0x5f0848['query']);_0x53a9bd[_0xebab('0x3d')]=_[_0xebab('0x3b')](_0x5f0848[_0xebab('0x3c')],qs['fields'](_0x3300d6[_0xebab('0x39')][_0xebab('0x3e')]));_0x53a9bd[_0xebab('0x3d')]=_0x53a9bd[_0xebab('0x3d')][_0xebab('0x3f')]?_0x53a9bd['attributes']:_0x5f0848['model'];_0x53a9bd[_0xebab('0x41')]=qs[_0xebab('0x42')](_0x3300d6[_0xebab('0x39')][_0xebab('0x42')]);_0x53a9bd[_0xebab('0x43')]=qs[_0xebab('0x3a')](_[_0xebab('0x79')](_0x3300d6[_0xebab('0x39')],_0x5f0848[_0xebab('0x3a')]));if(_0x3300d6[_0xebab('0x39')]['filter']){_0x53a9bd['where']=_['merge'](_0x53a9bd['where'],{'$or':_[_0xebab('0x36')](_0x53a9bd['attributes'],function(_0x5d1515){var _0x5134f9={};_0x5134f9[_0x5d1515]={'$like':'%'+_0x3300d6['query']['filter']+'%'};return _0x5134f9;})});}_0x53a9bd=_[_0xebab('0x44')]({},_0x53a9bd,_0x3300d6[_0xebab('0x48')]);return _0x7d877f[_0xebab('0x7a')](_0x53a9bd);}})[_0xebab('0x2c')](function(_0x3e3e65){if(_0x3e3e65){_0xeb9d25=_0x3e3e65['length'];if(!_0x3300d6[_0xebab('0x39')][_0xebab('0x40')](_0xebab('0x7b'))){_0x53a9bd[_0xebab('0x24')]=qs[_0xebab('0x24')](_0x3300d6['query'][_0xebab('0x24')]);_0x53a9bd[_0xebab('0x22')]=qs[_0xebab('0x22')](_0x3300d6['query'][_0xebab('0x22')]);}return _0x7d877f['getItems'](_0x53a9bd);}})[_0xebab('0x2c')](function(_0x23dc6b){if(_0x23dc6b){return _0x23dc6b?{'count':_0xeb9d25,'rows':_0x23dc6b}:null;}})[_0xebab('0x2c')](respondWithResult(_0x405ade,null))[_0xebab('0x4c')](handleError(_0x405ade,null));};
\ No newline at end of file
+var _0x7803=['attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','filters','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','count','set','apply','reject','save','destroy','then','CustomDashboards','error','name','send','map','Dashboard','fieldName','type','key','keys','query','model','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','omit','userProfileId','update','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1'];(function(_0x43f8ff,_0x43374a){var _0x3768cb=function(_0x22e6e6){while(--_0x22e6e6){_0x43f8ff['push'](_0x43f8ff['shift']());}};_0x3768cb(++_0x43374a);}(_0x7803,0x175));var _0x3780=function(_0x60773d,_0x40d6b4){_0x60773d=_0x60773d-0x0;var _0x44c143=_0x7803[_0x60773d];return _0x44c143;};'use strict';var emlformat=require(_0x3780('0x0'));var rimraf=require(_0x3780('0x1'));var zipdir=require(_0x3780('0x2'));var jsonpatch=require(_0x3780('0x3'));var rp=require(_0x3780('0x4'));var moment=require(_0x3780('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3780('0x6'));var util=require(_0x3780('0x7'));var path=require(_0x3780('0x8'));var sox=require(_0x3780('0x9'));var csv=require(_0x3780('0xa'));var ejs=require(_0x3780('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3780('0xc'));var crypto=require(_0x3780('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3780('0xe'));var toCsv=require(_0x3780('0xa'));var querystring=require(_0x3780('0xf'));var Papa=require(_0x3780('0x10'));var Redis=require(_0x3780('0x11'));var authService=require(_0x3780('0x12'));var qs=require(_0x3780('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3780('0x14'));var logger=require(_0x3780('0x15'))(_0x3780('0x16'));var utils=require('../../config/utils');var config=require(_0x3780('0x17'));var licenseUtil=require(_0x3780('0x18'));var db=require(_0x3780('0x19'))['db'];config[_0x3780('0x1a')]=_[_0x3780('0x1b')](config[_0x3780('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3780('0x1c'))(new Redis(config[_0x3780('0x1a')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x2ce447,_0x5eec12){_0x5eec12=_0x5eec12||0xcc;return function(_0x333aa9){if(_0x333aa9){return _0x2ce447[_0x3780('0x1d')](_0x5eec12);}return _0x2ce447[_0x3780('0x1e')](_0x5eec12)[_0x3780('0x1f')]();};}function respondWithResult(_0x1a0ac5,_0x51d668){_0x51d668=_0x51d668||0xc8;return function(_0x204d6a){if(_0x204d6a){return _0x1a0ac5['status'](_0x51d668)[_0x3780('0x20')](_0x204d6a);}};}function respondWithFilteredResult(_0x442f92,_0x43dced){return function(_0x2d876b){if(_0x2d876b){var _0x2b5be7=typeof _0x43dced[_0x3780('0x21')]==='undefined'&&typeof _0x43dced['limit']==='undefined';var _0x21b4c2=_0x2d876b[_0x3780('0x22')];var _0x18e188=_0x2b5be7?0x0:_0x43dced[_0x3780('0x21')];var _0x4a9c60=_0x2b5be7?_0x2d876b['count']:_0x43dced[_0x3780('0x21')]+_0x43dced['limit'];var _0x55114c;if(_0x4a9c60>=_0x21b4c2){_0x4a9c60=_0x21b4c2;_0x55114c=0xc8;}else{_0x55114c=0xce;}_0x442f92[_0x3780('0x1e')](_0x55114c);return _0x442f92[_0x3780('0x23')]('Content-Range',_0x18e188+'-'+_0x4a9c60+'/'+_0x21b4c2)[_0x3780('0x20')](_0x2d876b);}return null;};}function patchUpdates(_0x3b69e7){return function(_0xf7e2e7){try{jsonpatch[_0x3780('0x24')](_0xf7e2e7,_0x3b69e7,!![]);}catch(_0x157644){return BPromise[_0x3780('0x25')](_0x157644);}return _0xf7e2e7[_0x3780('0x26')]();};}function saveUpdates(_0x5bc5cb,_0x30b1a0){return function(_0x1e1979){if(_0x1e1979){return _0x1e1979['update'](_0x5bc5cb)['then'](function(_0x452571){return _0x452571;});}return null;};}function removeEntity(_0x18b601,_0x4bdff2){return function(_0x539e3a){if(_0x539e3a){return _0x539e3a[_0x3780('0x27')]()[_0x3780('0x28')](function(){var _0x3ee627=_0x539e3a['get']({'plain':!![]});var _0x28f7cb=_0x3780('0x29');return db['UserProfileResource'][_0x3780('0x27')]({'where':{'type':_0x28f7cb,'resourceId':_0x3ee627['id']}})['then'](function(){return _0x539e3a;});})[_0x3780('0x28')](function(){_0x18b601[_0x3780('0x1e')](0xcc)[_0x3780('0x1f')]();});}};}function handleEntityNotFound(_0x375a25,_0x3ddb78){return function(_0x4b5b73){if(!_0x4b5b73){_0x375a25['sendStatus'](0x194);}return _0x4b5b73;};}function handleError(_0x25cda8,_0x32f65a){_0x32f65a=_0x32f65a||0x1f4;return function(_0xb8e624){logger[_0x3780('0x2a')](_0xb8e624['stack']);if(_0xb8e624[_0x3780('0x2b')]){delete _0xb8e624[_0x3780('0x2b')];}_0x25cda8[_0x3780('0x1e')](_0x32f65a)[_0x3780('0x2c')](_0xb8e624);};}exports['index']=function(_0xef30b0,_0x4e5f8e){var _0x288049={},_0x39f240={},_0x284a64={'count':0x0,'rows':[]};var _0x5d3a9e=_[_0x3780('0x2d')](db[_0x3780('0x2e')]['rawAttributes'],function(_0x11088c){return{'name':_0x11088c[_0x3780('0x2f')],'type':_0x11088c[_0x3780('0x30')][_0x3780('0x31')]};});_0x39f240['model']=_[_0x3780('0x2d')](_0x5d3a9e,_0x3780('0x2b'));_0x39f240['query']=_[_0x3780('0x32')](_0xef30b0[_0x3780('0x33')]);_0x39f240['filters']=_['intersection'](_0x39f240[_0x3780('0x34')],_0x39f240['query']);_0x288049[_0x3780('0x35')]=_['intersection'](_0x39f240['model'],qs[_0x3780('0x36')](_0xef30b0[_0x3780('0x33')]['fields']));_0x288049['attributes']=_0x288049[_0x3780('0x35')]['length']?_0x288049[_0x3780('0x35')]:_0x39f240['model'];if(!_0xef30b0[_0x3780('0x33')]['hasOwnProperty'](_0x3780('0x37'))){_0x288049[_0x3780('0x38')]=qs['limit'](_0xef30b0[_0x3780('0x33')][_0x3780('0x38')]);_0x288049[_0x3780('0x21')]=qs[_0x3780('0x21')](_0xef30b0[_0x3780('0x33')]['offset']);}_0x288049['order']=qs['sort'](_0xef30b0[_0x3780('0x33')][_0x3780('0x39')]);_0x288049[_0x3780('0x3a')]=qs['filters'](_[_0x3780('0x3b')](_0xef30b0['query'],_0x39f240['filters']),_0x5d3a9e);if(_0xef30b0[_0x3780('0x33')][_0x3780('0x3c')]){_0x288049['where']=_[_0x3780('0x3d')](_0x288049[_0x3780('0x3a')],{'$or':_[_0x3780('0x2d')](_0x5d3a9e,function(_0x4e8230){if(_0x4e8230['type']!==_0x3780('0x3e')){var _0x2dd3ea={};_0x2dd3ea[_0x4e8230[_0x3780('0x2b')]]={'$like':'%'+_0xef30b0['query'][_0x3780('0x3c')]+'%'};return _0x2dd3ea;}})});}_0x288049=_[_0x3780('0x3d')]({},_0x288049,_0xef30b0[_0x3780('0x3f')]);var _0x1d6a18={'where':_0x288049['where']};return db[_0x3780('0x2e')][_0x3780('0x22')](_0x1d6a18)[_0x3780('0x28')](function(_0x39800c){_0x284a64[_0x3780('0x22')]=_0x39800c;if(_0xef30b0[_0x3780('0x33')][_0x3780('0x40')]){_0x288049[_0x3780('0x41')]=[{'all':!![]}];}return db['Dashboard'][_0x3780('0x42')](_0x288049);})[_0x3780('0x28')](function(_0x4d9ef3){_0x284a64[_0x3780('0x43')]=_0x4d9ef3;return _0x284a64;})[_0x3780('0x28')](respondWithFilteredResult(_0x4e5f8e,_0x288049))['catch'](handleError(_0x4e5f8e,null));};exports[_0x3780('0x44')]=function(_0x2a582f,_0x4c1a0f){var _0x4dfdc4={'raw':![],'where':{'id':_0x2a582f[_0x3780('0x45')]['id']}},_0x3665a0={};_0x3665a0[_0x3780('0x34')]=_['keys'](db[_0x3780('0x2e')][_0x3780('0x46')]);_0x3665a0['query']=_[_0x3780('0x32')](_0x2a582f[_0x3780('0x33')]);_0x3665a0['filters']=_[_0x3780('0x47')](_0x3665a0[_0x3780('0x34')],_0x3665a0[_0x3780('0x33')]);_0x4dfdc4['attributes']=_[_0x3780('0x47')](_0x3665a0[_0x3780('0x34')],qs[_0x3780('0x36')](_0x2a582f[_0x3780('0x33')][_0x3780('0x36')]));_0x4dfdc4['attributes']=_0x4dfdc4[_0x3780('0x35')][_0x3780('0x48')]?_0x4dfdc4[_0x3780('0x35')]:_0x3665a0['model'];if(_0x2a582f[_0x3780('0x33')][_0x3780('0x40')]){_0x4dfdc4['include']=[{'all':!![]}];}_0x4dfdc4=_[_0x3780('0x3d')]({},_0x4dfdc4,_0x2a582f[_0x3780('0x3f')]);return db['Dashboard'][_0x3780('0x49')](_0x4dfdc4)[_0x3780('0x28')](handleEntityNotFound(_0x4c1a0f,null))[_0x3780('0x28')](respondWithResult(_0x4c1a0f,null))[_0x3780('0x4a')](handleError(_0x4c1a0f,null));};exports[_0x3780('0x4b')]=function(_0x142be4,_0x1bf5c3){return db[_0x3780('0x2e')]['create'](_0x142be4[_0x3780('0x4c')],{})[_0x3780('0x28')](function(_0x256bef){var _0x37ee34=_0x142be4[_0x3780('0x4d')][_0x3780('0x4e')]({'plain':!![]});if(!_0x37ee34)throw new Error(_0x3780('0x4f'));if(_0x37ee34[_0x3780('0x50')]===_0x3780('0x4d')){var _0x4cb33c=_0x256bef['get']({'plain':!![]});var _0x36ccfb=_0x3780('0x29');return db[_0x3780('0x51')]['find']({'where':{'name':_0x36ccfb,'userProfileId':_0x37ee34['userProfileId']},'raw':!![]})['then'](function(_0x30b684){if(_0x30b684&&_0x30b684['autoAssociation']===0x0){return db[_0x3780('0x52')][_0x3780('0x4b')]({'name':_0x4cb33c[_0x3780('0x2b')],'resourceId':_0x4cb33c['id'],'type':_0x30b684[_0x3780('0x2b')],'sectionId':_0x30b684['id']},{})[_0x3780('0x28')](function(){return _0x256bef;});}else{return _0x256bef;}})[_0x3780('0x4a')](function(_0xe2ff4){logger[_0x3780('0x2a')](_0x3780('0x53'),_0xe2ff4);throw _0xe2ff4;});}return _0x256bef;})[_0x3780('0x28')](respondWithResult(_0x1bf5c3,0xc9))['catch'](handleError(_0x1bf5c3,null));};exports['clone']=function(_0x5e4e0f,_0x4cacc7){var _0x554edf={'where':{'id':_0x5e4e0f['params']['id']}},_0x25fb86={};_0x25fb86[_0x3780('0x34')]=_[_0x3780('0x32')](db[_0x3780('0x2e')]['rawAttributes']);_0x554edf[_0x3780('0x35')]=_[_0x3780('0x47')](_0x25fb86[_0x3780('0x34')],qs['fields'](_0x5e4e0f[_0x3780('0x33')]['fields']));_0x554edf[_0x3780('0x35')]=_0x554edf[_0x3780('0x35')][_0x3780('0x48')]?_0x554edf[_0x3780('0x35')]:_0x25fb86[_0x3780('0x34')];if(_0x5e4e0f['query']['includeAll']){_0x554edf[_0x3780('0x41')]=[{'all':!![]}];}_0x554edf=_[_0x3780('0x3d')]({},_0x554edf,_0x5e4e0f['options']);return db['Dashboard'][_0x3780('0x49')](_0x554edf)[_0x3780('0x28')](handleEntityNotFound(_0x4cacc7,null))[_0x3780('0x28')](function(_0x43ef68){if(_0x43ef68){var _0x107888=_0x43ef68[_0x3780('0x4e')]({'plain':!![]});_0x107888=qs['omit'](_0x107888,['id',_0x3780('0x54'),'updatedAt']);_0x5e4e0f[_0x3780('0x4c')]=_[_0x3780('0x55')](_0x5e4e0f[_0x3780('0x4c')],['id',_0x3780('0x54'),'updatedAt']);return db[_0x3780('0x2e')]['create'](_[_0x3780('0x3d')](_0x107888,_0x5e4e0f[_0x3780('0x4c')]),{'include':_0x5e4e0f['query'][_0x3780('0x40')]?[{'all':!![]}]:undefined})[_0x3780('0x28')](function(_0x48f624){var _0x31b1b4=_0x5e4e0f[_0x3780('0x4d')]['get']({'plain':!![]});if(!_0x31b1b4)throw new Error(_0x3780('0x4f'));if(_0x31b1b4[_0x3780('0x50')]===_0x3780('0x4d')){var _0x590372=_0x48f624[_0x3780('0x4e')]({'plain':!![]});var _0x79e42d=_0x3780('0x29');return db[_0x3780('0x51')][_0x3780('0x49')]({'where':{'name':_0x79e42d,'userProfileId':_0x31b1b4[_0x3780('0x56')]},'raw':!![]})[_0x3780('0x28')](function(_0x5e2d8b){if(_0x5e2d8b&&_0x5e2d8b['autoAssociation']===0x0){return db[_0x3780('0x52')][_0x3780('0x4b')]({'name':_0x590372[_0x3780('0x2b')],'resourceId':_0x590372['id'],'type':_0x5e2d8b[_0x3780('0x2b')],'sectionId':_0x5e2d8b['id']},{})[_0x3780('0x28')](function(){return _0x48f624;});}else{return _0x48f624;}})[_0x3780('0x4a')](function(_0x4f4bd5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f4bd5);throw _0x4f4bd5;});}return _0x48f624;});}})[_0x3780('0x28')](respondWithResult(_0x4cacc7,0xc9))['catch'](handleError(_0x4cacc7,null));};exports[_0x3780('0x57')]=function(_0x1ec3f9,_0x5934ee){if(_0x1ec3f9[_0x3780('0x4c')]['id']){delete _0x1ec3f9[_0x3780('0x4c')]['id'];}return db[_0x3780('0x2e')][_0x3780('0x49')]({'where':{'id':_0x1ec3f9[_0x3780('0x45')]['id']}})[_0x3780('0x28')](handleEntityNotFound(_0x5934ee,null))[_0x3780('0x28')](saveUpdates(_0x1ec3f9[_0x3780('0x4c')],null))[_0x3780('0x28')](respondWithResult(_0x5934ee,null))['catch'](handleError(_0x5934ee,null));};exports[_0x3780('0x27')]=function(_0x5b83f2,_0x181aaf){return db[_0x3780('0x2e')]['find']({'where':{'id':_0x5b83f2[_0x3780('0x45')]['id']}})[_0x3780('0x28')](handleEntityNotFound(_0x181aaf,null))['then'](removeEntity(_0x181aaf,null))[_0x3780('0x4a')](handleError(_0x181aaf,null));};function widgetAttributes(_0x593029){try{switch(_0x593029[_0x3780('0x30')]){case _0x3780('0x58'):return[{'name':_0x3780('0x59'),'value':_0x593029[_0x3780('0x59')]||(_0x593029['attrs']&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029[_0x3780('0x5a')][0x0][_0x3780('0x5b')]:undefined)||_0x3780('0x5c')}];case'custom':return[{'name':_0x3780('0x5d'),'value':_0x593029[_0x3780('0x5d')]||(_0x593029['attrs']&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029[_0x3780('0x5a')][0x0][_0x3780('0x5b')]:undefined)||''}];case _0x3780('0x5e'):return[{'name':_0x3780('0x5f'),'value':_0x593029[_0x3780('0x5f')]||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029['attrs'][0x0][_0x3780('0x5b')]:undefined)||_0x3780('0x60')},{'name':_0x3780('0x61'),'value':_0x593029['attrTimezone']||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x1]?_0x593029[_0x3780('0x5a')][0x1][_0x3780('0x5b')]:undefined)||_0x3780('0x62')},{'name':_0x3780('0x63'),'value':_0x593029['attrFontSize']||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x2]?_0x593029['attrs'][0x2][_0x3780('0x5b')]:undefined)||0xc}];case _0x3780('0x64'):return[{'name':'attrMetric','value':_0x593029[_0x3780('0x65')]||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029[_0x3780('0x5a')][0x0]['value']:undefined)||_0x3780('0x66')},{'name':_0x3780('0x67'),'value':_0x593029[_0x3780('0x67')]||(_0x593029[_0x3780('0x5a')]&&_0x593029['attrs'][0x1]?_0x593029['attrs'][0x1][_0x3780('0x5b')]:undefined)||[]},{'name':_0x3780('0x63'),'value':_0x593029[_0x3780('0x63')]||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x2]?_0x593029['attrs'][0x2][_0x3780('0x5b')]:undefined)||0x14}];case _0x3780('0x68'):case _0x3780('0x69'):return[{'name':_0x3780('0x6a'),'value':_0x593029['attrSerie1']||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029[_0x3780('0x5a')][0x0][_0x3780('0x5b')]:undefined)||_0x3780('0x66')},{'name':'attrSerie2','value':_0x593029[_0x3780('0x6b')]||(_0x593029['attrs']&&_0x593029[_0x3780('0x5a')][0x1]?_0x593029[_0x3780('0x5a')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x593029[_0x3780('0x6c')]||(_0x593029['attrs']&&_0x593029[_0x3780('0x5a')][0x2]?_0x593029[_0x3780('0x5a')][0x2][_0x3780('0x5b')]:undefined)||null},{'name':_0x3780('0x67'),'value':_0x593029[_0x3780('0x67')]||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x3]?_0x593029[_0x3780('0x5a')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x3780('0x6d'),'type':_0x593029[_0x3780('0x6e')]||(_0x593029[_0x3780('0x5a')]&&_0x593029['attrs'][0x0]?_0x593029['attrs'][0x0][_0x3780('0x30')]:undefined)||null,'value':_0x593029[_0x3780('0x6d')]||(_0x593029[_0x3780('0x5a')]&&_0x593029[_0x3780('0x5a')][0x0]?_0x593029[_0x3780('0x5a')][0x0]['value']:undefined)||null},{'name':_0x3780('0x6f'),'value':_0x593029[_0x3780('0x6f')]||(_0x593029['attrs']&&_0x593029[_0x3780('0x5a')][0x1]?_0x593029[_0x3780('0x5a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x258c92){logger[_0x3780('0x2a')](_0x3780('0x70'),JSON['stringify'](_0x258c92));return[];}}exports[_0x3780('0x71')]=function(_0x4d91cd,_0x58bc26,_0x2da04c){if(_0x4d91cd[_0x3780('0x4c')]['id']){delete _0x4d91cd['body']['id'];}return db[_0x3780('0x2e')][_0x3780('0x49')]({'where':{'id':_0x4d91cd[_0x3780('0x45')]['id']}})[_0x3780('0x28')](handleEntityNotFound(_0x58bc26,null))['then'](function(_0x28adf5){if(_0x28adf5){_0x4d91cd['body'][_0x3780('0x72')]=_0x28adf5['id'];_0x4d91cd[_0x3780('0x4c')][_0x3780('0x5a')]=widgetAttributes(_0x4d91cd[_0x3780('0x4c')]);return db['DashboardItem'][_0x3780('0x4b')](_0x4d91cd[_0x3780('0x4c')]);}})[_0x3780('0x28')](respondWithResult(_0x58bc26,null))[_0x3780('0x4a')](handleError(_0x58bc26,null));};exports[_0x3780('0x73')]=function(_0x1bb430,_0x58e94a,_0x5384d3){var _0x18f84f={};var _0x45e83b={};var _0x149641;var _0x48935a;return db[_0x3780('0x2e')][_0x3780('0x74')]({'where':{'id':_0x1bb430[_0x3780('0x45')]['id']}})[_0x3780('0x28')](handleEntityNotFound(_0x58e94a,null))['then'](function(_0x4b740d){if(_0x4b740d){_0x149641=_0x4b740d;_0x45e83b[_0x3780('0x34')]=_['keys'](db[_0x3780('0x75')][_0x3780('0x46')]);_0x45e83b[_0x3780('0x33')]=_[_0x3780('0x32')](_0x1bb430[_0x3780('0x33')]);_0x45e83b[_0x3780('0x76')]=_['intersection'](_0x45e83b['model'],_0x45e83b[_0x3780('0x33')]);_0x18f84f[_0x3780('0x35')]=_[_0x3780('0x47')](_0x45e83b[_0x3780('0x34')],qs['fields'](_0x1bb430[_0x3780('0x33')][_0x3780('0x36')]));_0x18f84f[_0x3780('0x35')]=_0x18f84f['attributes'][_0x3780('0x48')]?_0x18f84f['attributes']:_0x45e83b[_0x3780('0x34')];_0x18f84f[_0x3780('0x77')]=qs['sort'](_0x1bb430['query'][_0x3780('0x39')]);_0x18f84f[_0x3780('0x3a')]=qs['filters'](_[_0x3780('0x3b')](_0x1bb430[_0x3780('0x33')],_0x45e83b['filters']));if(_0x1bb430[_0x3780('0x33')][_0x3780('0x3c')]){_0x18f84f[_0x3780('0x3a')]=_[_0x3780('0x3d')](_0x18f84f[_0x3780('0x3a')],{'$or':_[_0x3780('0x2d')](_0x18f84f[_0x3780('0x35')],function(_0x2a83e4){var _0x4d27f2={};_0x4d27f2[_0x2a83e4]={'$like':'%'+_0x1bb430[_0x3780('0x33')]['filter']+'%'};return _0x4d27f2;})});}_0x18f84f=_[_0x3780('0x3d')]({},_0x18f84f,_0x1bb430[_0x3780('0x3f')]);return _0x149641[_0x3780('0x73')](_0x18f84f);}})['then'](function(_0x1a8418){if(_0x1a8418){_0x48935a=_0x1a8418[_0x3780('0x48')];if(!_0x1bb430[_0x3780('0x33')]['hasOwnProperty']('nolimit')){_0x18f84f[_0x3780('0x38')]=qs['limit'](_0x1bb430[_0x3780('0x33')][_0x3780('0x38')]);_0x18f84f[_0x3780('0x21')]=qs[_0x3780('0x21')](_0x1bb430[_0x3780('0x33')][_0x3780('0x21')]);}return _0x149641['getItems'](_0x18f84f);}})[_0x3780('0x28')](function(_0x2f1f52){if(_0x2f1f52){return _0x2f1f52?{'count':_0x48935a,'rows':_0x2f1f52}:null;}})[_0x3780('0x28')](respondWithResult(_0x58e94a,null))['catch'](handleError(_0x58e94a,null));};
\ No newline at end of file
index 46b27a7..6c38f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x050f=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4670df,_0x433288){var _0x326082=function(_0x582361){while(--_0x582361){_0x4670df['push'](_0x4670df['shift']());}};_0x326082(++_0x433288);}(_0x050f,0x1a7));var _0xf050=function(_0x45d08e,_0x29f51c){_0x45d08e=_0x45d08e-0x0;var _0xb9dbc4=_0x050f[_0x45d08e];return _0xb9dbc4;};'use strict';var EventEmitter=require(_0xf050('0x0'));var Dashboard=require(_0xf050('0x1'))['db'][_0xf050('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf050('0x3')](0x0);var events={'afterCreate':_0xf050('0x4'),'afterUpdate':_0xf050('0x5'),'afterDestroy':_0xf050('0x6')};function emitEvent(_0xd31cef){return function(_0x57e9c7,_0x31d0ef,_0x36d2b1){DashboardEvents[_0xf050('0x7')](_0xd31cef+':'+_0x57e9c7['id'],_0x57e9c7);DashboardEvents[_0xf050('0x7')](_0xd31cef,_0x57e9c7);_0x36d2b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xf050('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xca96=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1202b0,_0x2aaca6){var _0x3827e2=function(_0x2e586c){while(--_0x2e586c){_0x1202b0['push'](_0x1202b0['shift']());}};_0x3827e2(++_0x2aaca6);}(_0xca96,0x10f));var _0x6ca9=function(_0x1275ce,_0x4eaea7){_0x1275ce=_0x1275ce-0x0;var _0x3fab97=_0xca96[_0x1275ce];return _0x3fab97;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x6ca9('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6ca9('0x1')](0x0);var events={'afterCreate':_0x6ca9('0x2'),'afterUpdate':_0x6ca9('0x3'),'afterDestroy':_0x6ca9('0x4')};function emitEvent(_0x49ba56){return function(_0x5ded57,_0x2a307a,_0x313218){DashboardEvents['emit'](_0x49ba56+':'+_0x5ded57['id'],_0x5ded57);DashboardEvents[_0x6ca9('0x5')](_0x49ba56,_0x5ded57);_0x313218(null);};}for(var e in events){if(events[_0x6ca9('0x6')](e)){var event=events[e];Dashboard[_0x6ca9('0x7')](e,emitEvent(event));}}module[_0x6ca9('0x8')]=DashboardEvents;
\ No newline at end of file
index 42a3038..d1a24ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a97=['request-promise','path','./dashboard.attributes','exports','Dashboard','dashboards','lodash','moment'];(function(_0x32d58e,_0x476b2f){var _0x8be770=function(_0x4aed19){while(--_0x4aed19){_0x32d58e['push'](_0x32d58e['shift']());}};_0x8be770(++_0x476b2f);}(_0x6a97,0x9e));var _0x76a9=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x6a97[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x76a9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x76a9('0x1'));var BPromise=require('bluebird');var rp=require(_0x76a9('0x2'));var fs=require('fs');var path=require(_0x76a9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x76a9('0x4'));module[_0x76a9('0x5')]=function(_0x111153,_0x2a942f){return _0x111153['define'](_0x76a9('0x6'),attributes,{'tableName':_0x76a9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb969=['define','Dashboard','dashboards','../../config/logger','api','moment','bluebird','request-promise','rimraf','./dashboard.attributes','exports'];(function(_0x3728f1,_0x12a4f9){var _0x6c515b=function(_0x2310ef){while(--_0x2310ef){_0x3728f1['push'](_0x3728f1['shift']());}};_0x6c515b(++_0x12a4f9);}(_0xb969,0x9d));var _0x9b96=function(_0x4b3c66,_0x4f3885){_0x4b3c66=_0x4b3c66-0x0;var _0x160b01=_0xb969[_0x4b3c66];return _0x160b01;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9b96('0x0'))(_0x9b96('0x1'));var moment=require(_0x9b96('0x2'));var BPromise=require(_0x9b96('0x3'));var rp=require(_0x9b96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b96('0x5'));var config=require('../../config/environment');var attributes=require(_0x9b96('0x6'));module[_0x9b96('0x7')]=function(_0x58f0c4,_0x174539){return _0x58f0c4[_0x9b96('0x8')](_0x9b96('0x9'),attributes,{'tableName':_0x9b96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd2d5dd..9887674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb1a=['Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb1a,0x14c));var _0xabb1=function(_0x32a43a,_0x2af844){_0x32a43a=_0x32a43a-0x0;var _0x4b60ca=_0xbb1a[_0x32a43a];return _0x4b60ca;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var moment=require(_0xabb1('0x2'));var BPromise=require(_0xabb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabb1('0x4'));var db=require(_0xabb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabb1('0x6'))(_0xabb1('0x7'));var config=require(_0xabb1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabb1('0x9')][_0xabb1('0xa')]({'port':0x232a});config[_0xabb1('0xb')]=_[_0xabb1('0xc')](config[_0xabb1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xabb1('0xd'))(new Redis(config[_0xabb1('0xb')]));require(_0xabb1('0xe'))[_0xabb1('0xf')](socket);function respondWithRpcPromise(_0x56bc59,_0xb6717e,_0x4020d2){return new BPromise(function(_0x34fe33,_0x5c883d){return client[_0xabb1('0x10')](_0x56bc59,_0x4020d2)[_0xabb1('0x11')](function(_0x1ddd01){logger[_0xabb1('0x12')](_0xabb1('0x13'),_0xb6717e,_0xabb1('0x14'));logger['debug'](_0xabb1('0x15'),_0xb6717e,_0xabb1('0x14'),JSON[_0xabb1('0x16')](_0x1ddd01));if(_0x1ddd01[_0xabb1('0x17')]){if(_0x1ddd01[_0xabb1('0x17')]['code']===0x1f4){logger[_0xabb1('0x17')](_0xabb1('0x13'),_0xb6717e,_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);return _0x5c883d(_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);}logger[_0xabb1('0x17')](_0xabb1('0x13'),_0xb6717e,_0x1ddd01[_0xabb1('0x17')]['message']);return _0x34fe33(_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);}else{logger[_0xabb1('0x12')](_0xabb1('0x13'),_0xb6717e,'request\x20sent');_0x34fe33(_0x1ddd01[_0xabb1('0x19')][_0xabb1('0x18')]);}})[_0xabb1('0x1a')](function(_0x1bb74f){logger['error'](_0xabb1('0x13'),_0xb6717e,_0x1bb74f);_0x5c883d(_0x1bb74f);});});}
\ No newline at end of file
+var _0x1581=['stringify','error','code','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1581,0x118));var _0x1158=function(_0x244e63,_0x596e84){_0x244e63=_0x244e63-0x0;var _0x32e520=_0x1581[_0x244e63];return _0x32e520;};'use strict';var _=require(_0x1158('0x0'));var util=require(_0x1158('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1158('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1158('0x3'))['db'];var utils=require(_0x1158('0x4'));var logger=require(_0x1158('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1158('0x6'));var client=jayson[_0x1158('0x7')][_0x1158('0x8')]({'port':0x232a});config['redis']=_[_0x1158('0x9')](config['redis'],{'host':_0x1158('0xa'),'port':0x18eb});var socket=require(_0x1158('0xb'))(new Redis(config[_0x1158('0xc')]));require(_0x1158('0xd'))[_0x1158('0xe')](socket);function respondWithRpcPromise(_0x230872,_0x3d53f5,_0x527b16){return new BPromise(function(_0x4ea768,_0x32b08b){return client['request'](_0x230872,_0x527b16)['then'](function(_0x1ab906){logger[_0x1158('0xf')](_0x1158('0x10'),_0x3d53f5,_0x1158('0x11'));logger[_0x1158('0x12')](_0x1158('0x13'),_0x3d53f5,_0x1158('0x11'),JSON[_0x1158('0x14')](_0x1ab906));if(_0x1ab906[_0x1158('0x15')]){if(_0x1ab906[_0x1158('0x15')][_0x1158('0x16')]===0x1f4){logger[_0x1158('0x15')](_0x1158('0x10'),_0x3d53f5,_0x1ab906[_0x1158('0x15')]['message']);return _0x32b08b(_0x1ab906[_0x1158('0x15')][_0x1158('0x17')]);}logger[_0x1158('0x15')](_0x1158('0x10'),_0x3d53f5,_0x1ab906[_0x1158('0x15')][_0x1158('0x17')]);return _0x4ea768(_0x1ab906[_0x1158('0x15')][_0x1158('0x17')]);}else{logger[_0x1158('0xf')]('Dashboard,\x20%s,\x20%s',_0x3d53f5,_0x1158('0x11'));_0x4ea768(_0x1ab906[_0x1158('0x18')]['message']);}})['catch'](function(_0x1c15ad){logger[_0x1158('0x15')](_0x1158('0x10'),_0x3d53f5,_0x1c15ad);_0x32b08b(_0x1c15ad);});});}
\ No newline at end of file
index 7ce51a2..c0def45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec3=['dashboard:','./dashboard.events','remove','removeListener','register','length'];(function(_0xbf84f7,_0x26643b){var _0x55ef36=function(_0x4a2338){while(--_0x4a2338){_0xbf84f7['push'](_0xbf84f7['shift']());}};_0x55ef36(++_0x26643b);}(_0x4ec3,0x8b));var _0x34ec=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x4ec3[_0x202c61];return _0x540691;};'use strict';var DashboardEvents=require(_0x34ec('0x0'));var events=['save',_0x34ec('0x1'),'update'];function createListener(_0x20f184,_0x3020fa){return function(_0x3580be){_0x3020fa['emit'](_0x20f184,_0x3580be);};}function removeListener(_0x9b39db,_0x5202c4){return function(){DashboardEvents[_0x34ec('0x2')](_0x9b39db,_0x5202c4);};}exports[_0x34ec('0x3')]=function(_0xebce8b){for(var _0x53d2ab=0x0,_0xc7c216=events[_0x34ec('0x4')];_0x53d2ab<_0xc7c216;_0x53d2ab++){var _0x5b3bb1=events[_0x53d2ab];var _0x505f36=createListener(_0x34ec('0x5')+_0x5b3bb1,_0xebce8b);DashboardEvents['on'](_0x5b3bb1,_0x505f36);}};
\ No newline at end of file
+var _0x0941=['save','remove','update','register','length','dashboard:','./dashboard.events'];(function(_0x2f084a,_0x466cd8){var _0x309260=function(_0x58c162){while(--_0x58c162){_0x2f084a['push'](_0x2f084a['shift']());}};_0x309260(++_0x466cd8);}(_0x0941,0x164));var _0x1094=function(_0x404fb2,_0x4e423e){_0x404fb2=_0x404fb2-0x0;var _0x11438b=_0x0941[_0x404fb2];return _0x11438b;};'use strict';var DashboardEvents=require(_0x1094('0x0'));var events=[_0x1094('0x1'),_0x1094('0x2'),_0x1094('0x3')];function createListener(_0x2eba55,_0x5c2dda){return function(_0x11e35b){_0x5c2dda['emit'](_0x2eba55,_0x11e35b);};}function removeListener(_0x122d67,_0x5274ec){return function(){DashboardEvents['removeListener'](_0x122d67,_0x5274ec);};}exports[_0x1094('0x4')]=function(_0x116a51){for(var _0x3a7c77=0x0,_0x4a4df9=events[_0x1094('0x5')];_0x3a7c77<_0x4a4df9;_0x3a7c77++){var _0x28c72a=events[_0x3a7c77];var _0x8f2f4a=createListener(_0x1094('0x6')+_0x28c72a,_0x116a51);DashboardEvents['on'](_0x28c72a,_0x8f2f4a);}};
\ No newline at end of file
index 4a2225a..be93101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0169=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','post','/:id/clone','addItem','put','delete','exports','multer','path','connect-timeout','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0169,0x1d7));var _0x9016=function(_0x432a4b,_0x39698f){_0x432a4b=_0x432a4b-0x0;var _0x228645=_0x0169[_0x432a4b];return _0x228645;};'use strict';var multer=require(_0x9016('0x0'));var util=require('util');var path=require(_0x9016('0x1'));var timeout=require(_0x9016('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9016('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9016('0x4'));var config=require(_0x9016('0x5'));var controller=require(_0x9016('0x6'));router[_0x9016('0x7')]('/',auth[_0x9016('0x8')](),controller['index']);router[_0x9016('0x7')](_0x9016('0x9'),auth[_0x9016('0x8')](),controller[_0x9016('0xa')]);router[_0x9016('0x7')](_0x9016('0xb'),auth[_0x9016('0x8')](),controller[_0x9016('0xc')]);router[_0x9016('0xd')]('/',auth[_0x9016('0x8')](),controller['create']);router['post'](_0x9016('0xe'),auth[_0x9016('0x8')](),controller['clone']);router[_0x9016('0xd')](_0x9016('0xb'),auth[_0x9016('0x8')](),controller[_0x9016('0xf')]);router[_0x9016('0x10')]('/:id',auth[_0x9016('0x8')](),controller['update']);router[_0x9016('0x11')](_0x9016('0x9'),auth[_0x9016('0x8')](),controller['destroy']);module[_0x9016('0x12')]=router;
\ No newline at end of file
+var _0x42b2=['fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','create','post','addItem','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x2d010a,_0x3b627b){var _0x5d8a29=function(_0x4bc41c){while(--_0x4bc41c){_0x2d010a['push'](_0x2d010a['shift']());}};_0x5d8a29(++_0x3b627b);}(_0x42b2,0xe2));var _0x242b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x42b2[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x242b('0x0'));var util=require('util');var path=require(_0x242b('0x1'));var timeout=require('connect-timeout');var express=require(_0x242b('0x2'));var router=express[_0x242b('0x3')]();var fs_extra=require(_0x242b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x242b('0x5'));var config=require(_0x242b('0x6'));var controller=require(_0x242b('0x7'));router[_0x242b('0x8')]('/',auth[_0x242b('0x9')](),controller[_0x242b('0xa')]);router[_0x242b('0x8')]('/:id',auth[_0x242b('0x9')](),controller[_0x242b('0xb')]);router[_0x242b('0x8')](_0x242b('0xc'),auth[_0x242b('0x9')](),controller[_0x242b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x242b('0xe')]);router[_0x242b('0xf')]('/:id/clone',auth[_0x242b('0x9')](),controller['clone']);router['post'](_0x242b('0xc'),auth['isAuthenticated'](),controller[_0x242b('0x10')]);router[_0x242b('0x11')](_0x242b('0x12'),auth['isAuthenticated'](),controller[_0x242b('0x13')]);router[_0x242b('0x14')](_0x242b('0x12'),auth[_0x242b('0x9')](),controller[_0x242b('0x15')]);module[_0x242b('0x16')]=router;
\ No newline at end of file
index dedadb8..dc9307e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x4a563a,_0x4cd01c){var _0x2fe5ad=function(_0x20d727){while(--_0x20d727){_0x4a563a['push'](_0x4a563a['shift']());}};_0x2fe5ad(++_0x4cd01c);}(_0x9536,0x179));var _0x6953=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x9536[_0x439d59];return _0x3670c7;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}};
\ No newline at end of file
+var _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x3a0f46,_0x393870){var _0x5386b8=function(_0x2e44c1){while(--_0x2e44c1){_0x3a0f46['push'](_0x3a0f46['shift']());}};_0x5386b8(++_0x393870);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x56987a,_0x315609){_0x56987a=_0x56987a-0x0;var _0x49bba4=_0xc1c6[_0x56987a];return _0x49bba4;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index e58bb21..b7316cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1ef=['body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','show','model','DashboardItem','rawAttributes','query','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','destroy','params','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa1ef,0xb0));var _0xfa1e=function(_0x540c04,_0x4c1e2f){_0x540c04=_0x540c04-0x0;var _0x5bcb58=_0xa1ef[_0x540c04];return _0x5bcb58;};'use strict';var emlformat=require(_0xfa1e('0x0'));var rimraf=require(_0xfa1e('0x1'));var zipdir=require(_0xfa1e('0x2'));var jsonpatch=require(_0xfa1e('0x3'));var rp=require(_0xfa1e('0x4'));var moment=require(_0xfa1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfa1e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfa1e('0x7'));var ejs=require(_0xfa1e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa1e('0x9'));var squel=require(_0xfa1e('0xa'));var crypto=require(_0xfa1e('0xb'));var jsforce=require(_0xfa1e('0xc'));var deskjs=require(_0xfa1e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa1e('0xe'));var qs=require(_0xfa1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa1e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xfa1e('0x11'));var config=require(_0xfa1e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa1e('0x13'))['db'];config[_0xfa1e('0x14')]=_[_0xfa1e('0x15')](config[_0xfa1e('0x14')],{'host':_0xfa1e('0x16'),'port':0x18eb});var socket=require(_0xfa1e('0x17'))(new Redis(config[_0xfa1e('0x14')]));require(_0xfa1e('0x18'))[_0xfa1e('0x19')](socket);function respondWithStatusCode(_0x1663b8,_0x5b76ea){_0x5b76ea=_0x5b76ea||0xcc;return function(_0x42ccbe){if(_0x42ccbe){return _0x1663b8[_0xfa1e('0x1a')](_0x5b76ea);}return _0x1663b8[_0xfa1e('0x1b')](_0x5b76ea)['end']();};}function respondWithResult(_0x8573bd,_0x11eed5){_0x11eed5=_0x11eed5||0xc8;return function(_0x1b2eda){if(_0x1b2eda){return _0x8573bd[_0xfa1e('0x1b')](_0x11eed5)[_0xfa1e('0x1c')](_0x1b2eda);}};}function respondWithFilteredResult(_0x5addbe,_0x48edc3){return function(_0x4e1af5){if(_0x4e1af5){var _0x4ec8d5=typeof _0x48edc3[_0xfa1e('0x1d')]===_0xfa1e('0x1e')&&typeof _0x48edc3[_0xfa1e('0x1f')]===_0xfa1e('0x1e');var _0xbc6eb4=_0x4e1af5[_0xfa1e('0x20')];var _0x3748fd=_0x4ec8d5?0x0:_0x48edc3[_0xfa1e('0x1d')];var _0x47d51c=_0x4ec8d5?_0x4e1af5['count']:_0x48edc3[_0xfa1e('0x1d')]+_0x48edc3[_0xfa1e('0x1f')];var _0x10730d;if(_0x47d51c>=_0xbc6eb4){_0x47d51c=_0xbc6eb4;_0x10730d=0xc8;}else{_0x10730d=0xce;}_0x5addbe[_0xfa1e('0x1b')](_0x10730d);return _0x5addbe['set'](_0xfa1e('0x21'),_0x3748fd+'-'+_0x47d51c+'/'+_0xbc6eb4)['json'](_0x4e1af5);}return null;};}function patchUpdates(_0x18b09c){return function(_0x52d009){try{jsonpatch[_0xfa1e('0x22')](_0x52d009,_0x18b09c,!![]);}catch(_0x22c7f8){return BPromise['reject'](_0x22c7f8);}return _0x52d009[_0xfa1e('0x23')]();};}function saveUpdates(_0x208f4e,_0x2a08c0){return function(_0x4fe25d){if(_0x4fe25d){return _0x4fe25d[_0xfa1e('0x24')](_0x208f4e)[_0xfa1e('0x25')](function(_0x22eafa){return _0x22eafa;});}return null;};}function removeEntity(_0x5033fa,_0x5e204d){return function(_0x24514f){if(_0x24514f){return _0x24514f['destroy']()[_0xfa1e('0x25')](function(){_0x5033fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x367ae0,_0x3993cd){return function(_0x3ba34d){if(!_0x3ba34d){_0x367ae0[_0xfa1e('0x1a')](0x194);}return _0x3ba34d;};}function handleError(_0x1d9422,_0x228113){_0x228113=_0x228113||0x1f4;return function(_0x41b060){logger[_0xfa1e('0x26')](_0x41b060[_0xfa1e('0x27')]);if(_0x41b060[_0xfa1e('0x28')]){delete _0x41b060['name'];}_0x1d9422['status'](_0x228113)[_0xfa1e('0x29')](_0x41b060);};}exports[_0xfa1e('0x2a')]=function(_0x2134cb,_0x104157){var _0x38137a={'raw':![],'where':{'id':_0x2134cb['params']['id']}},_0x1f822e={};_0x1f822e[_0xfa1e('0x2b')]=_['keys'](db[_0xfa1e('0x2c')][_0xfa1e('0x2d')]);_0x1f822e[_0xfa1e('0x2e')]=_[_0xfa1e('0x2f')](_0x2134cb[_0xfa1e('0x2e')]);_0x1f822e['filters']=_['intersection'](_0x1f822e[_0xfa1e('0x2b')],_0x1f822e[_0xfa1e('0x2e')]);_0x38137a['attributes']=_[_0xfa1e('0x30')](_0x1f822e['model'],qs[_0xfa1e('0x31')](_0x2134cb[_0xfa1e('0x2e')][_0xfa1e('0x31')]));_0x38137a[_0xfa1e('0x32')]=_0x38137a['attributes'][_0xfa1e('0x33')]?_0x38137a[_0xfa1e('0x32')]:_0x1f822e[_0xfa1e('0x2b')];if(_0x2134cb[_0xfa1e('0x2e')][_0xfa1e('0x34')]){_0x38137a[_0xfa1e('0x35')]=[{'all':!![]}];}_0x38137a=_[_0xfa1e('0x36')]({},_0x38137a,_0x2134cb[_0xfa1e('0x37')]);return db[_0xfa1e('0x2c')][_0xfa1e('0x38')](_0x38137a)[_0xfa1e('0x25')](handleEntityNotFound(_0x104157,null))['then'](respondWithResult(_0x104157,null))['catch'](handleError(_0x104157,null));};exports[_0xfa1e('0x39')]=function(_0x203e45,_0x55dba2){return db[_0xfa1e('0x2c')]['find']({'where':{'id':_0x203e45[_0xfa1e('0x3a')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x55dba2,null))[_0xfa1e('0x25')](removeEntity(_0x55dba2,null))['catch'](handleError(_0x55dba2,null));};function widgetAttributes(_0x455532){try{switch(_0x455532['type']){case'iframe':return[{'name':_0xfa1e('0x3b'),'value':_0x455532[_0xfa1e('0x3b')]||(_0x455532['attrs']&&_0x455532[_0xfa1e('0x3c')][0x0]?_0x455532[_0xfa1e('0x3c')][0x0][_0xfa1e('0x3d')]:undefined)||_0xfa1e('0x3e')}];case'custom':return[{'name':_0xfa1e('0x3f'),'value':_0x455532[_0xfa1e('0x3f')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x0]?_0x455532['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xfa1e('0x40'),'value':_0x455532['attrHourFormat']||(_0x455532[_0xfa1e('0x3c')]&&_0x455532[_0xfa1e('0x3c')][0x0]?_0x455532[_0xfa1e('0x3c')][0x0][_0xfa1e('0x3d')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x455532[_0xfa1e('0x41')]||(_0x455532['attrs']&&_0x455532['attrs'][0x1]?_0x455532[_0xfa1e('0x3c')][0x1]['value']:undefined)||_0xfa1e('0x42')},{'name':_0xfa1e('0x43'),'value':_0x455532[_0xfa1e('0x43')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532[_0xfa1e('0x3c')][0x2]?_0x455532['attrs'][0x2][_0xfa1e('0x3d')]:undefined)||0xc}];case _0xfa1e('0x44'):return[{'name':_0xfa1e('0x45'),'value':_0x455532['attrMetric']||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x0]?_0x455532[_0xfa1e('0x3c')][0x0]['value']:undefined)||'total'},{'name':_0xfa1e('0x46'),'value':_0x455532[_0xfa1e('0x46')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x1]?_0x455532['attrs'][0x1][_0xfa1e('0x3d')]:undefined)||[]},{'name':_0xfa1e('0x43'),'value':_0x455532[_0xfa1e('0x43')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x2]?_0x455532[_0xfa1e('0x3c')][0x2]['value']:undefined)||0x14}];case _0xfa1e('0x47'):case _0xfa1e('0x48'):return[{'name':_0xfa1e('0x49'),'value':_0x455532[_0xfa1e('0x49')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532[_0xfa1e('0x3c')][0x0]?_0x455532[_0xfa1e('0x3c')][0x0][_0xfa1e('0x3d')]:undefined)||_0xfa1e('0x4a')},{'name':_0xfa1e('0x4b'),'value':_0x455532['attrSerie2']||(_0x455532[_0xfa1e('0x3c')]&&_0x455532[_0xfa1e('0x3c')][0x1]?_0x455532[_0xfa1e('0x3c')][0x1][_0xfa1e('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x455532[_0xfa1e('0x4c')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532[_0xfa1e('0x3c')][0x2]?_0x455532['attrs'][0x2][_0xfa1e('0x3d')]:undefined)||null},{'name':_0xfa1e('0x46'),'value':_0x455532[_0xfa1e('0x46')]||(_0x455532['attrs']&&_0x455532[_0xfa1e('0x3c')][0x3]?_0x455532[_0xfa1e('0x3c')][0x3]['value']:undefined)||[]}];case _0xfa1e('0x4d'):return[{'name':_0xfa1e('0x4e'),'type':_0x455532[_0xfa1e('0x4f')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x0]?_0x455532[_0xfa1e('0x3c')][0x0][_0xfa1e('0x50')]:undefined)||null,'value':_0x455532[_0xfa1e('0x4e')]||(_0x455532['attrs']&&_0x455532[_0xfa1e('0x3c')][0x0]?_0x455532[_0xfa1e('0x3c')][0x0]['value']:undefined)||null},{'name':_0xfa1e('0x51'),'value':_0x455532[_0xfa1e('0x51')]||(_0x455532[_0xfa1e('0x3c')]&&_0x455532['attrs'][0x1]?_0x455532['attrs'][0x1][_0xfa1e('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x2a2119){logger[_0xfa1e('0x26')](_0xfa1e('0x52'),JSON[_0xfa1e('0x53')](_0x2a2119));return[];}}exports[_0xfa1e('0x54')]=function(_0x32871b,_0x1ad850){if(_0x32871b[_0xfa1e('0x55')]){_0x32871b['body']['attrs']=widgetAttributes(_0x32871b[_0xfa1e('0x55')]);}return db[_0xfa1e('0x2c')][_0xfa1e('0x54')](_0x32871b[_0xfa1e('0x55')],{})['then'](respondWithResult(_0x1ad850,0xc9))[_0xfa1e('0x56')](handleError(_0x1ad850,null));};exports[_0xfa1e('0x24')]=function(_0x151e61,_0x5380c7){if(_0x151e61[_0xfa1e('0x55')]['id']){delete _0x151e61[_0xfa1e('0x55')]['id'];}_0x151e61[_0xfa1e('0x55')][_0xfa1e('0x3c')]=widgetAttributes(_0x151e61[_0xfa1e('0x55')]);return db['DashboardItem'][_0xfa1e('0x38')]({'where':{'id':_0x151e61[_0xfa1e('0x3a')]['id']}})[_0xfa1e('0x25')](handleEntityNotFound(_0x5380c7,null))[_0xfa1e('0x25')](saveUpdates(_0x151e61[_0xfa1e('0x55')],null))[_0xfa1e('0x25')](respondWithResult(_0x5380c7,null))[_0xfa1e('0x56')](handleError(_0x5380c7,null));};
\ No newline at end of file
+var _0x4398=['merge','options','catch','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboardItem.socket','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4398,0x121));var _0x8439=function(_0x54004d,_0x46238e){_0x54004d=_0x54004d-0x0;var _0x4c52da=_0x4398[_0x54004d];return _0x4c52da;};'use strict';var emlformat=require(_0x8439('0x0'));var rimraf=require(_0x8439('0x1'));var zipdir=require(_0x8439('0x2'));var jsonpatch=require(_0x8439('0x3'));var rp=require(_0x8439('0x4'));var moment=require(_0x8439('0x5'));var BPromise=require(_0x8439('0x6'));var Mustache=require(_0x8439('0x7'));var util=require(_0x8439('0x8'));var path=require(_0x8439('0x9'));var sox=require(_0x8439('0xa'));var csv=require(_0x8439('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8439('0xc'));var _=require(_0x8439('0xd'));var squel=require(_0x8439('0xe'));var crypto=require(_0x8439('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8439('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8439('0x11'));var Papa=require('papaparse');var Redis=require(_0x8439('0x12'));var authService=require(_0x8439('0x13'));var qs=require(_0x8439('0x14'));var as=require(_0x8439('0x15'));var hardwareService=require(_0x8439('0x16'));var logger=require('../../config/logger')(_0x8439('0x17'));var utils=require(_0x8439('0x18'));var config=require(_0x8439('0x19'));var licenseUtil=require(_0x8439('0x1a'));var db=require(_0x8439('0x1b'))['db'];config[_0x8439('0x1c')]=_[_0x8439('0x1d')](config[_0x8439('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8439('0x1e'))['register'](socket);function respondWithStatusCode(_0x567a3a,_0x4ccd1b){_0x4ccd1b=_0x4ccd1b||0xcc;return function(_0x53fa62){if(_0x53fa62){return _0x567a3a['sendStatus'](_0x4ccd1b);}return _0x567a3a[_0x8439('0x1f')](_0x4ccd1b)[_0x8439('0x20')]();};}function respondWithResult(_0x4da25a,_0x5079e9){_0x5079e9=_0x5079e9||0xc8;return function(_0xf36ceb){if(_0xf36ceb){return _0x4da25a['status'](_0x5079e9)['json'](_0xf36ceb);}};}function respondWithFilteredResult(_0x3c2135,_0x4c5f17){return function(_0xc7bbd){if(_0xc7bbd){var _0x5c6e66=typeof _0x4c5f17['offset']===_0x8439('0x21')&&typeof _0x4c5f17[_0x8439('0x22')]==='undefined';var _0x425dd7=_0xc7bbd[_0x8439('0x23')];var _0x300f4e=_0x5c6e66?0x0:_0x4c5f17[_0x8439('0x24')];var _0xa976bc=_0x5c6e66?_0xc7bbd[_0x8439('0x23')]:_0x4c5f17['offset']+_0x4c5f17[_0x8439('0x22')];var _0xfe11d9;if(_0xa976bc>=_0x425dd7){_0xa976bc=_0x425dd7;_0xfe11d9=0xc8;}else{_0xfe11d9=0xce;}_0x3c2135[_0x8439('0x1f')](_0xfe11d9);return _0x3c2135['set'](_0x8439('0x25'),_0x300f4e+'-'+_0xa976bc+'/'+_0x425dd7)[_0x8439('0x26')](_0xc7bbd);}return null;};}function patchUpdates(_0x5806a9){return function(_0x3e51d5){try{jsonpatch[_0x8439('0x27')](_0x3e51d5,_0x5806a9,!![]);}catch(_0xa7accd){return BPromise[_0x8439('0x28')](_0xa7accd);}return _0x3e51d5[_0x8439('0x29')]();};}function saveUpdates(_0x40fda7,_0x5d6641){return function(_0x39e267){if(_0x39e267){return _0x39e267['update'](_0x40fda7)[_0x8439('0x2a')](function(_0xaba938){return _0xaba938;});}return null;};}function removeEntity(_0x4a9584,_0x56b543){return function(_0x31c4b4){if(_0x31c4b4){return _0x31c4b4[_0x8439('0x2b')]()[_0x8439('0x2a')](function(){_0x4a9584[_0x8439('0x1f')](0xcc)[_0x8439('0x20')]();});}};}function handleEntityNotFound(_0x267871,_0x203bb3){return function(_0x3c6d84){if(!_0x3c6d84){_0x267871[_0x8439('0x2c')](0x194);}return _0x3c6d84;};}function handleError(_0x9ecaca,_0x410cf8){_0x410cf8=_0x410cf8||0x1f4;return function(_0xdc41c9){logger[_0x8439('0x2d')](_0xdc41c9['stack']);if(_0xdc41c9['name']){delete _0xdc41c9['name'];}_0x9ecaca['status'](_0x410cf8)[_0x8439('0x2e')](_0xdc41c9);};}exports[_0x8439('0x2f')]=function(_0x54a205,_0x2cbc71){var _0x156880={'raw':![],'where':{'id':_0x54a205[_0x8439('0x30')]['id']}},_0x1204fd={};_0x1204fd[_0x8439('0x31')]=_[_0x8439('0x32')](db[_0x8439('0x33')][_0x8439('0x34')]);_0x1204fd[_0x8439('0x35')]=_[_0x8439('0x32')](_0x54a205[_0x8439('0x35')]);_0x1204fd['filters']=_[_0x8439('0x36')](_0x1204fd[_0x8439('0x31')],_0x1204fd[_0x8439('0x35')]);_0x156880[_0x8439('0x37')]=_[_0x8439('0x36')](_0x1204fd[_0x8439('0x31')],qs[_0x8439('0x38')](_0x54a205[_0x8439('0x35')][_0x8439('0x38')]));_0x156880[_0x8439('0x37')]=_0x156880[_0x8439('0x37')][_0x8439('0x39')]?_0x156880[_0x8439('0x37')]:_0x1204fd[_0x8439('0x31')];if(_0x54a205[_0x8439('0x35')][_0x8439('0x3a')]){_0x156880['include']=[{'all':!![]}];}_0x156880=_[_0x8439('0x3b')]({},_0x156880,_0x54a205[_0x8439('0x3c')]);return db[_0x8439('0x33')]['find'](_0x156880)[_0x8439('0x2a')](handleEntityNotFound(_0x2cbc71,null))[_0x8439('0x2a')](respondWithResult(_0x2cbc71,null))[_0x8439('0x3d')](handleError(_0x2cbc71,null));};exports[_0x8439('0x2b')]=function(_0x1995d5,_0x50f4d1){return db['DashboardItem']['find']({'where':{'id':_0x1995d5['params']['id']}})[_0x8439('0x2a')](handleEntityNotFound(_0x50f4d1,null))[_0x8439('0x2a')](removeEntity(_0x50f4d1,null))[_0x8439('0x3d')](handleError(_0x50f4d1,null));};function widgetAttributes(_0x30e95a){try{switch(_0x30e95a['type']){case _0x8439('0x3e'):return[{'name':'attrUrl','value':_0x30e95a[_0x8439('0x3f')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a[_0x8439('0x40')][0x0][_0x8439('0x41')]:undefined)||'https://'}];case'custom':return[{'name':_0x8439('0x42'),'value':_0x30e95a[_0x8439('0x42')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a[_0x8439('0x40')][0x0][_0x8439('0x41')]:undefined)||''}];case _0x8439('0x43'):return[{'name':_0x8439('0x44'),'value':_0x30e95a[_0x8439('0x44')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a['attrs'][0x0]?_0x30e95a['attrs'][0x0]['value']:undefined)||_0x8439('0x45')},{'name':_0x8439('0x46'),'value':_0x30e95a[_0x8439('0x46')]||(_0x30e95a['attrs']&&_0x30e95a[_0x8439('0x40')][0x1]?_0x30e95a['attrs'][0x1][_0x8439('0x41')]:undefined)||_0x8439('0x47')},{'name':_0x8439('0x48'),'value':_0x30e95a['attrFontSize']||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a['attrs'][0x2]?_0x30e95a[_0x8439('0x40')][0x2][_0x8439('0x41')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x30e95a['attrMetric']||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a['attrs'][0x0][_0x8439('0x41')]:undefined)||_0x8439('0x49')},{'name':_0x8439('0x4a'),'value':_0x30e95a['attrVoiceQueues']||(_0x30e95a['attrs']&&_0x30e95a['attrs'][0x1]?_0x30e95a[_0x8439('0x40')][0x1][_0x8439('0x41')]:undefined)||[]},{'name':_0x8439('0x48'),'value':_0x30e95a[_0x8439('0x48')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x2]?_0x30e95a[_0x8439('0x40')][0x2][_0x8439('0x41')]:undefined)||0x14}];case'multibar-chart':case _0x8439('0x4b'):return[{'name':_0x8439('0x4c'),'value':_0x30e95a[_0x8439('0x4c')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a['attrs'][0x0][_0x8439('0x41')]:undefined)||_0x8439('0x49')},{'name':_0x8439('0x4d'),'value':_0x30e95a[_0x8439('0x4d')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x1]?_0x30e95a['attrs'][0x1][_0x8439('0x41')]:undefined)||null},{'name':_0x8439('0x4e'),'value':_0x30e95a['attrSerie3']||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a['attrs'][0x2]?_0x30e95a[_0x8439('0x40')][0x2][_0x8439('0x41')]:undefined)||null},{'name':_0x8439('0x4a'),'value':_0x30e95a[_0x8439('0x4a')]||(_0x30e95a['attrs']&&_0x30e95a[_0x8439('0x40')][0x3]?_0x30e95a['attrs'][0x3]['value']:undefined)||[]}];case _0x8439('0x4f'):return[{'name':_0x8439('0x50'),'type':_0x30e95a[_0x8439('0x51')]||(_0x30e95a['attrs']&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a[_0x8439('0x40')][0x0][_0x8439('0x52')]:undefined)||null,'value':_0x30e95a[_0x8439('0x50')]||(_0x30e95a[_0x8439('0x40')]&&_0x30e95a[_0x8439('0x40')][0x0]?_0x30e95a[_0x8439('0x40')][0x0][_0x8439('0x41')]:undefined)||null},{'name':_0x8439('0x53'),'value':_0x30e95a[_0x8439('0x53')]||(_0x30e95a['attrs']&&_0x30e95a[_0x8439('0x40')][0x1]?_0x30e95a[_0x8439('0x40')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5562bf){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x5562bf));return[];}}exports['create']=function(_0x5a6dfd,_0x309c70){if(_0x5a6dfd['body']){_0x5a6dfd[_0x8439('0x54')]['attrs']=widgetAttributes(_0x5a6dfd['body']);}return db[_0x8439('0x33')]['create'](_0x5a6dfd['body'],{})[_0x8439('0x2a')](respondWithResult(_0x309c70,0xc9))['catch'](handleError(_0x309c70,null));};exports[_0x8439('0x55')]=function(_0x5b725a,_0x5b4bfe){if(_0x5b725a[_0x8439('0x54')]['id']){delete _0x5b725a[_0x8439('0x54')]['id'];}_0x5b725a[_0x8439('0x54')][_0x8439('0x40')]=widgetAttributes(_0x5b725a['body']);return db['DashboardItem'][_0x8439('0x56')]({'where':{'id':_0x5b725a[_0x8439('0x30')]['id']}})['then'](handleEntityNotFound(_0x5b4bfe,null))[_0x8439('0x2a')](saveUpdates(_0x5b725a[_0x8439('0x54')],null))[_0x8439('0x2a')](respondWithResult(_0x5b4bfe,null))[_0x8439('0x3d')](handleError(_0x5b4bfe,null));};
\ No newline at end of file
index 769b4f9..78f45ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c5a=['emit','hasOwnProperty','hook','../../mysqldb','DashboardItem'];(function(_0x810c15,_0x285e79){var _0x5c79be=function(_0x173cf2){while(--_0x173cf2){_0x810c15['push'](_0x810c15['shift']());}};_0x5c79be(++_0x285e79);}(_0x7c5a,0x184));var _0xa7c5=function(_0x3bbe1b,_0x4ef5ac){_0x3bbe1b=_0x3bbe1b-0x0;var _0x3335db=_0x7c5a[_0x3bbe1b];return _0x3335db;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xa7c5('0x0'))['db'][_0xa7c5('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x438dfd){return function(_0x3ce441,_0x4aca72,_0x2849ee){DashboardItemEvents['emit'](_0x438dfd+':'+_0x3ce441['id'],_0x3ce441);DashboardItemEvents[_0xa7c5('0x2')](_0x438dfd,_0x3ce441);_0x2849ee(null);};}for(var e in events){if(events[_0xa7c5('0x3')](e)){var event=events[e];DashboardItem[_0xa7c5('0x4')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x722d=['DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x722d,0xa1));var _0xd722=function(_0x211f4e,_0x41fa9c){_0x211f4e=_0x211f4e-0x0;var _0x2cda9c=_0x722d[_0x211f4e];return _0x2cda9c;};'use strict';var EventEmitter=require(_0xd722('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xd722('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd722('0x2')](0x0);var events={'afterCreate':_0xd722('0x3'),'afterUpdate':_0xd722('0x4'),'afterDestroy':_0xd722('0x5')};function emitEvent(_0x4d843){return function(_0x3eb5b2,_0x5f34d1,_0x309fda){DashboardItemEvents[_0xd722('0x6')](_0x4d843+':'+_0x3eb5b2['id'],_0x3eb5b2);DashboardItemEvents[_0xd722('0x6')](_0x4d843,_0x3eb5b2);_0x309fda(null);};}for(var e in events){if(events[_0xd722('0x7')](e)){var event=events[e];DashboardItem[_0xd722('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 2ad4564..e423933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6881=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','DashboardItem','dashboard_items'];(function(_0x229f5e,_0x433f0f){var _0x2d62ff=function(_0xe4d381){while(--_0xe4d381){_0x229f5e['push'](_0x229f5e['shift']());}};_0x2d62ff(++_0x433f0f);}(_0x6881,0x10e));var _0x1688=function(_0x3c55b8,_0x38aecd){_0x3c55b8=_0x3c55b8-0x0;var _0x15f795=_0x6881[_0x3c55b8];return _0x15f795;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1688('0x0'))(_0x1688('0x1'));var moment=require('moment');var BPromise=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var fs=require('fs');var path=require(_0x1688('0x4'));var rimraf=require('rimraf');var config=require(_0x1688('0x5'));var attributes=require('./dashboardItem.attributes');module[_0x1688('0x6')]=function(_0x4cad07,_0x323ca9){return _0x4cad07[_0x1688('0x7')](_0x1688('0x8'),attributes,{'tableName':_0x1688('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f85=['rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2d5934,_0x1acc4f){var _0x5807c8=function(_0x326cc5){while(--_0x326cc5){_0x2d5934['push'](_0x2d5934['shift']());}};_0x5807c8(++_0x1acc4f);}(_0x3f85,0xde));var _0x53f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f8('0x0'));var util=require(_0x53f8('0x1'));var logger=require(_0x53f8('0x2'))('api');var moment=require(_0x53f8('0x3'));var BPromise=require(_0x53f8('0x4'));var rp=require(_0x53f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f8('0x6'));var config=require(_0x53f8('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x53f8('0x8')]=function(_0x14bee4,_0x24ed46){return _0x14bee4[_0x53f8('0x9')](_0x53f8('0xa'),attributes,{'tableName':_0x53f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78d42d6..9fbbd89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ed=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','debug','request\x20sent','error','message','DashboardItem,\x20%s,\x20%s','result','catch'];(function(_0x1820f1,_0x1403e7){var _0x167aed=function(_0x4c89f5){while(--_0x4c89f5){_0x1820f1['push'](_0x1820f1['shift']());}};_0x167aed(++_0x1403e7);}(_0xb1ed,0x152));var _0xdb1e=function(_0x537b3c,_0x12aff2){_0x537b3c=_0x537b3c-0x0;var _0x3d9d55=_0xb1ed[_0x537b3c];return _0x3d9d55;};'use strict';var _=require('lodash');var util=require(_0xdb1e('0x0'));var moment=require(_0xdb1e('0x1'));var BPromise=require(_0xdb1e('0x2'));var rs=require(_0xdb1e('0x3'));var fs=require('fs');var Redis=require(_0xdb1e('0x4'));var db=require(_0xdb1e('0x5'))['db'];var utils=require(_0xdb1e('0x6'));var logger=require(_0xdb1e('0x7'))(_0xdb1e('0x8'));var config=require(_0xdb1e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdb1e('0xa')][_0xdb1e('0xb')]({'port':0x232a});config[_0xdb1e('0xc')]=_['defaults'](config['redis'],{'host':_0xdb1e('0xd'),'port':0x18eb});var socket=require(_0xdb1e('0xe'))(new Redis(config[_0xdb1e('0xc')]));require(_0xdb1e('0xf'))[_0xdb1e('0x10')](socket);function respondWithRpcPromise(_0x20212a,_0x29f6f6,_0x186759){return new BPromise(function(_0x454767,_0x249ccf){return client['request'](_0x20212a,_0x186759)[_0xdb1e('0x11')](function(_0x34151f){logger[_0xdb1e('0x12')]('DashboardItem,\x20%s,\x20%s',_0x29f6f6,'request\x20sent');logger[_0xdb1e('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x29f6f6,_0xdb1e('0x14'),JSON['stringify'](_0x34151f));if(_0x34151f[_0xdb1e('0x15')]){if(_0x34151f[_0xdb1e('0x15')]['code']===0x1f4){logger[_0xdb1e('0x15')]('DashboardItem,\x20%s,\x20%s',_0x29f6f6,_0x34151f['error'][_0xdb1e('0x16')]);return _0x249ccf(_0x34151f[_0xdb1e('0x15')]['message']);}logger[_0xdb1e('0x15')](_0xdb1e('0x17'),_0x29f6f6,_0x34151f[_0xdb1e('0x15')][_0xdb1e('0x16')]);return _0x454767(_0x34151f[_0xdb1e('0x15')][_0xdb1e('0x16')]);}else{logger[_0xdb1e('0x12')](_0xdb1e('0x17'),_0x29f6f6,_0xdb1e('0x14'));_0x454767(_0x34151f[_0xdb1e('0x18')][_0xdb1e('0x16')]);}})[_0xdb1e('0x19')](function(_0x1fa3e9){logger[_0xdb1e('0x15')](_0xdb1e('0x17'),_0x29f6f6,_0x1fa3e9);_0x249ccf(_0x1fa3e9);});});}
\ No newline at end of file
+var _0xb3a0=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xb3a0,0xd8));var _0x0b3a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb3a0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0b3a('0x0'));var util=require(_0x0b3a('0x1'));var moment=require(_0x0b3a('0x2'));var BPromise=require(_0x0b3a('0x3'));var rs=require(_0x0b3a('0x4'));var fs=require('fs');var Redis=require(_0x0b3a('0x5'));var db=require(_0x0b3a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0b3a('0x7'));var client=jayson[_0x0b3a('0x8')][_0x0b3a('0x9')]({'port':0x232a});config[_0x0b3a('0xa')]=_[_0x0b3a('0xb')](config[_0x0b3a('0xa')],{'host':_0x0b3a('0xc'),'port':0x18eb});var socket=require(_0x0b3a('0xd'))(new Redis(config[_0x0b3a('0xa')]));require('./dashboardItem.socket')[_0x0b3a('0xe')](socket);function respondWithRpcPromise(_0x464fc1,_0xcc1e66,_0xb595d1){return new BPromise(function(_0x5a8e9d,_0x3732ce){return client[_0x0b3a('0xf')](_0x464fc1,_0xb595d1)[_0x0b3a('0x10')](function(_0x1c4a06){logger[_0x0b3a('0x11')](_0x0b3a('0x12'),_0xcc1e66,_0x0b3a('0x13'));logger[_0x0b3a('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xcc1e66,_0x0b3a('0x13'),JSON[_0x0b3a('0x15')](_0x1c4a06));if(_0x1c4a06[_0x0b3a('0x16')]){if(_0x1c4a06[_0x0b3a('0x16')][_0x0b3a('0x17')]===0x1f4){logger[_0x0b3a('0x16')](_0x0b3a('0x12'),_0xcc1e66,_0x1c4a06[_0x0b3a('0x16')][_0x0b3a('0x18')]);return _0x3732ce(_0x1c4a06['error'][_0x0b3a('0x18')]);}logger[_0x0b3a('0x16')](_0x0b3a('0x12'),_0xcc1e66,_0x1c4a06[_0x0b3a('0x16')]['message']);return _0x5a8e9d(_0x1c4a06['error']['message']);}else{logger[_0x0b3a('0x11')](_0x0b3a('0x12'),_0xcc1e66,_0x0b3a('0x13'));_0x5a8e9d(_0x1c4a06[_0x0b3a('0x19')][_0x0b3a('0x18')]);}})['catch'](function(_0x1a5ecf){logger[_0x0b3a('0x16')](_0x0b3a('0x12'),_0xcc1e66,_0x1a5ecf);_0x3732ce(_0x1a5ecf);});});}
\ No newline at end of file
index 86815a5..d68600c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4222=['remove','emit','removeListener','register','length','dashboardItem:'];(function(_0xf0cc47,_0x35f108){var _0x8362a0=function(_0x9c3bd7){while(--_0x9c3bd7){_0xf0cc47['push'](_0xf0cc47['shift']());}};_0x8362a0(++_0x35f108);}(_0x4222,0x174));var _0x2422=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4222[_0x465a0c];return _0x1e202e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x2422('0x0'),'update'];function createListener(_0x2b3366,_0x258b9e){return function(_0x38dab7){_0x258b9e[_0x2422('0x1')](_0x2b3366,_0x38dab7);};}function removeListener(_0x4c3d39,_0x339f83){return function(){DashboardItemEvents[_0x2422('0x2')](_0x4c3d39,_0x339f83);};}exports[_0x2422('0x3')]=function(_0x52e1ee){for(var _0x5900cb=0x0,_0x7d6217=events[_0x2422('0x4')];_0x5900cb<_0x7d6217;_0x5900cb++){var _0x326da4=events[_0x5900cb];var _0x5057ef=createListener(_0x2422('0x5')+_0x326da4,_0x52e1ee);DashboardItemEvents['on'](_0x326da4,_0x5057ef);}};
\ No newline at end of file
+var _0x3561=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x3561,0x171));var _0x1356=function(_0x437e86,_0x2a387b){_0x437e86=_0x437e86-0x0;var _0x24f6b6=_0x3561[_0x437e86];return _0x24f6b6;};'use strict';var DashboardItemEvents=require(_0x1356('0x0'));var events=[_0x1356('0x1'),_0x1356('0x2'),_0x1356('0x3')];function createListener(_0x12ccf7,_0xea4c01){return function(_0x1c76fa){_0xea4c01[_0x1356('0x4')](_0x12ccf7,_0x1c76fa);};}function removeListener(_0x5a03b6,_0x54d50b){return function(){DashboardItemEvents[_0x1356('0x5')](_0x5a03b6,_0x54d50b);};}exports[_0x1356('0x6')]=function(_0x26a505){for(var _0x477ed5=0x0,_0x302ec0=events[_0x1356('0x7')];_0x477ed5<_0x302ec0;_0x477ed5++){var _0x41a8f2=events[_0x477ed5];var _0x2fe3a1=createListener(_0x1356('0x8')+_0x41a8f2,_0x26a505);DashboardItemEvents['on'](_0x41a8f2,_0x2fe3a1);}};
\ No newline at end of file
index 190e7f5..547bd53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0288=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0288,0x176));var _0x8028=function(_0x2baa72,_0x5d6d68){_0x2baa72=_0x2baa72-0x0;var _0x304803=_0x0288[_0x2baa72];return _0x304803;};'use strict';var multer=require(_0x8028('0x0'));var util=require('util');var path=require(_0x8028('0x1'));var timeout=require(_0x8028('0x2'));var express=require(_0x8028('0x3'));var router=express[_0x8028('0x4')]();var fs_extra=require(_0x8028('0x5'));var auth=require(_0x8028('0x6'));var interaction=require(_0x8028('0x7'));var config=require(_0x8028('0x8'));var controller=require(_0x8028('0x9'));router[_0x8028('0xa')]('/:id',auth[_0x8028('0xb')](),controller[_0x8028('0xc')]);router['post']('/',auth[_0x8028('0xb')](),controller['create']);router[_0x8028('0xd')](_0x8028('0xe'),auth[_0x8028('0xb')](),controller[_0x8028('0xf')]);router[_0x8028('0x10')](_0x8028('0xe'),auth[_0x8028('0xb')](),controller[_0x8028('0x11')]);module[_0x8028('0x12')]=router;
\ No newline at end of file
+var _0x4146=['post','put','update','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show'];(function(_0x3b3e6b,_0xf2fe8e){var _0x477709=function(_0x30fb34){while(--_0x30fb34){_0x3b3e6b['push'](_0x3b3e6b['shift']());}};_0x477709(++_0xf2fe8e);}(_0x4146,0x17c));var _0x6414=function(_0x2fd0d4,_0x366799){_0x2fd0d4=_0x2fd0d4-0x0;var _0x2d3809=_0x4146[_0x2fd0d4];return _0x2d3809;};'use strict';var multer=require(_0x6414('0x0'));var util=require('util');var path=require(_0x6414('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6414('0x2'));var auth=require(_0x6414('0x3'));var interaction=require(_0x6414('0x4'));var config=require(_0x6414('0x5'));var controller=require(_0x6414('0x6'));router[_0x6414('0x7')](_0x6414('0x8'),auth[_0x6414('0x9')](),controller[_0x6414('0xa')]);router[_0x6414('0xb')]('/',auth[_0x6414('0x9')](),controller['create']);router[_0x6414('0xc')](_0x6414('0x8'),auth[_0x6414('0x9')](),controller[_0x6414('0xd')]);router[_0x6414('0xe')]('/:id',auth[_0x6414('0x9')](),controller[_0x6414('0xf')]);module[_0x6414('0x10')]=router;
\ No newline at end of file
index f753584..f576799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c7=['STRING','sequelize','exports','second','third','first'];(function(_0xc0f10a,_0x3a2702){var _0x2c8ab6=function(_0x1ac234){while(--_0x1ac234){_0xc0f10a['push'](_0xc0f10a['shift']());}};_0x2c8ab6(++_0x3a2702);}(_0x12c7,0x1f3));var _0x712c=function(_0x4ab75a,_0x2d988d){_0x4ab75a=_0x4ab75a-0x0;var _0x413445=_0x12c7[_0x4ab75a];return _0x413445;};'use strict';var Sequelize=require(_0x712c('0x0'));module[_0x712c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x712c('0x2'),_0x712c('0x3')),'allowNull':![],'defaultValue':_0x712c('0x4')},'description':{'type':Sequelize[_0x712c('0x5')]}};
\ No newline at end of file
+var _0x78f7=['first','third','sequelize','exports','STRING','ENUM'];(function(_0x2c43d6,_0x560a3c){var _0x38433a=function(_0x5c9bd0){while(--_0x5c9bd0){_0x2c43d6['push'](_0x2c43d6['shift']());}};_0x38433a(++_0x560a3c);}(_0x78f7,0x1d0));var _0x778f=function(_0x1678ab,_0x131a15){_0x1678ab=_0x1678ab-0x0;var _0x20611d=_0x78f7[_0x1678ab];return _0x20611d;};'use strict';var Sequelize=require(_0x778f('0x0'));module[_0x778f('0x1')]={'name':{'type':Sequelize[_0x778f('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x778f('0x3')](_0x778f('0x4'),'second',_0x778f('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x778f('0x2')]}};
\ No newline at end of file
index 5b11fb9..1eb5c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa143=['findAll','rows','catch','show','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Dispositions','UserProfileSection','userProfileId','update','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x4f6a7a,_0x163fe1){var _0x5032fe=function(_0x2cd00a){while(--_0x2cd00a){_0x4f6a7a['push'](_0x4f6a7a['shift']());}};_0x5032fe(++_0x163fe1);}(_0xa143,0x115));var _0x3a14=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa143[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x3a14('0x0'));var rimraf=require(_0x3a14('0x1'));var zipdir=require(_0x3a14('0x2'));var jsonpatch=require(_0x3a14('0x3'));var rp=require(_0x3a14('0x4'));var moment=require(_0x3a14('0x5'));var BPromise=require(_0x3a14('0x6'));var Mustache=require(_0x3a14('0x7'));var util=require(_0x3a14('0x8'));var path=require(_0x3a14('0x9'));var sox=require(_0x3a14('0xa'));var csv=require(_0x3a14('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a14('0xc'));var _=require(_0x3a14('0xd'));var squel=require(_0x3a14('0xe'));var crypto=require(_0x3a14('0xf'));var jsforce=require(_0x3a14('0x10'));var deskjs=require(_0x3a14('0x11'));var toCsv=require(_0x3a14('0xb'));var querystring=require(_0x3a14('0x12'));var Papa=require(_0x3a14('0x13'));var Redis=require(_0x3a14('0x14'));var authService=require(_0x3a14('0x15'));var qs=require(_0x3a14('0x16'));var as=require(_0x3a14('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a14('0x18'))(_0x3a14('0x19'));var utils=require('../../config/utils');var config=require(_0x3a14('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a14('0x1b'))['db'];function respondWithStatusCode(_0x1c5d6f,_0x374b4d){_0x374b4d=_0x374b4d||0xcc;return function(_0x175b44){if(_0x175b44){return _0x1c5d6f[_0x3a14('0x1c')](_0x374b4d);}return _0x1c5d6f['status'](_0x374b4d)[_0x3a14('0x1d')]();};}function respondWithResult(_0x1f2c17,_0x400e3f){_0x400e3f=_0x400e3f||0xc8;return function(_0x3e14e6){if(_0x3e14e6){return _0x1f2c17[_0x3a14('0x1e')](_0x400e3f)[_0x3a14('0x1f')](_0x3e14e6);}};}function respondWithFilteredResult(_0x452e9f,_0x2c87a6){return function(_0x500fb0){if(_0x500fb0){var _0x3fc2eb=typeof _0x2c87a6['offset']===_0x3a14('0x20')&&typeof _0x2c87a6[_0x3a14('0x21')]==='undefined';var _0x5b6d20=_0x500fb0['count'];var _0x5da55b=_0x3fc2eb?0x0:_0x2c87a6['offset'];var _0x33a3fe=_0x3fc2eb?_0x500fb0[_0x3a14('0x22')]:_0x2c87a6[_0x3a14('0x23')]+_0x2c87a6[_0x3a14('0x21')];var _0x567365;if(_0x33a3fe>=_0x5b6d20){_0x33a3fe=_0x5b6d20;_0x567365=0xc8;}else{_0x567365=0xce;}_0x452e9f[_0x3a14('0x1e')](_0x567365);return _0x452e9f[_0x3a14('0x24')](_0x3a14('0x25'),_0x5da55b+'-'+_0x33a3fe+'/'+_0x5b6d20)[_0x3a14('0x1f')](_0x500fb0);}return null;};}function patchUpdates(_0x4791aa){return function(_0x5bd64f){try{jsonpatch[_0x3a14('0x26')](_0x5bd64f,_0x4791aa,!![]);}catch(_0x3761a5){return BPromise[_0x3a14('0x27')](_0x3761a5);}return _0x5bd64f['save']();};}function saveUpdates(_0x40fde7,_0x592d50){return function(_0x9083c9){if(_0x9083c9){return _0x9083c9['update'](_0x40fde7)['then'](function(_0xaf0f23){return _0xaf0f23;});}return null;};}function removeEntity(_0x21991d,_0x5bf552){return function(_0x1a1893){if(_0x1a1893){return _0x1a1893[_0x3a14('0x28')]()[_0x3a14('0x29')](function(){var _0x3a1158=_0x1a1893[_0x3a14('0x2a')]({'plain':!![]});var _0x10c63d='Dispositions';return db[_0x3a14('0x2b')][_0x3a14('0x28')]({'where':{'type':_0x10c63d,'resourceId':_0x3a1158['id']}})['then'](function(){return _0x1a1893;});})[_0x3a14('0x29')](function(){_0x21991d['status'](0xcc)[_0x3a14('0x1d')]();});}};}function handleEntityNotFound(_0xfd3f78,_0x34201f){return function(_0x36b163){if(!_0x36b163){_0xfd3f78[_0x3a14('0x1c')](0x194);}return _0x36b163;};}function handleError(_0x2649b7,_0x38c9f9){_0x38c9f9=_0x38c9f9||0x1f4;return function(_0x354c39){logger[_0x3a14('0x2c')](_0x354c39[_0x3a14('0x2d')]);if(_0x354c39[_0x3a14('0x2e')]){delete _0x354c39[_0x3a14('0x2e')];}_0x2649b7[_0x3a14('0x1e')](_0x38c9f9)[_0x3a14('0x2f')](_0x354c39);};}exports[_0x3a14('0x30')]=function(_0x52e7ce,_0x22d375){var _0x125be5={},_0x4bf216={},_0x1b9169={'count':0x0,'rows':[]};var _0x596e43=_[_0x3a14('0x31')](db[_0x3a14('0x32')]['rawAttributes'],function(_0x2c83fa){return{'name':_0x2c83fa[_0x3a14('0x33')],'type':_0x2c83fa[_0x3a14('0x34')][_0x3a14('0x35')]};});_0x4bf216[_0x3a14('0x36')]=_[_0x3a14('0x31')](_0x596e43,'name');_0x4bf216[_0x3a14('0x37')]=_[_0x3a14('0x38')](_0x52e7ce[_0x3a14('0x37')]);_0x4bf216[_0x3a14('0x39')]=_[_0x3a14('0x3a')](_0x4bf216[_0x3a14('0x36')],_0x4bf216[_0x3a14('0x37')]);_0x125be5[_0x3a14('0x3b')]=_[_0x3a14('0x3a')](_0x4bf216['model'],qs['fields'](_0x52e7ce[_0x3a14('0x37')][_0x3a14('0x3c')]));_0x125be5[_0x3a14('0x3b')]=_0x125be5[_0x3a14('0x3b')][_0x3a14('0x3d')]?_0x125be5['attributes']:_0x4bf216[_0x3a14('0x36')];if(!_0x52e7ce['query']['hasOwnProperty'](_0x3a14('0x3e'))){_0x125be5['limit']=qs['limit'](_0x52e7ce[_0x3a14('0x37')][_0x3a14('0x21')]);_0x125be5[_0x3a14('0x23')]=qs[_0x3a14('0x23')](_0x52e7ce[_0x3a14('0x37')]['offset']);}_0x125be5['order']=qs[_0x3a14('0x3f')](_0x52e7ce[_0x3a14('0x37')][_0x3a14('0x3f')]);_0x125be5[_0x3a14('0x40')]=qs[_0x3a14('0x39')](_[_0x3a14('0x41')](_0x52e7ce[_0x3a14('0x37')],_0x4bf216[_0x3a14('0x39')]),_0x596e43);if(_0x52e7ce[_0x3a14('0x37')][_0x3a14('0x42')]){_0x125be5[_0x3a14('0x40')]=_[_0x3a14('0x43')](_0x125be5[_0x3a14('0x40')],{'$or':_[_0x3a14('0x31')](_0x596e43,function(_0x124e97){if(_0x124e97[_0x3a14('0x34')]!=='VIRTUAL'){var _0x1b9fe8={};_0x1b9fe8[_0x124e97[_0x3a14('0x2e')]]={'$like':'%'+_0x52e7ce[_0x3a14('0x37')]['filter']+'%'};return _0x1b9fe8;}})});}_0x125be5=_[_0x3a14('0x43')]({},_0x125be5,_0x52e7ce[_0x3a14('0x44')]);var _0x4315fb={'where':_0x125be5[_0x3a14('0x40')]};return db[_0x3a14('0x32')][_0x3a14('0x22')](_0x4315fb)[_0x3a14('0x29')](function(_0x5257fd){_0x1b9169[_0x3a14('0x22')]=_0x5257fd;if(_0x52e7ce[_0x3a14('0x37')][_0x3a14('0x45')]){_0x125be5[_0x3a14('0x46')]=[{'all':!![]}];}return db[_0x3a14('0x32')][_0x3a14('0x47')](_0x125be5);})['then'](function(_0x4b7d53){_0x1b9169[_0x3a14('0x48')]=_0x4b7d53;return _0x1b9169;})[_0x3a14('0x29')](respondWithFilteredResult(_0x22d375,_0x125be5))[_0x3a14('0x49')](handleError(_0x22d375,null));};exports[_0x3a14('0x4a')]=function(_0x1f17e8,_0x35e0e8){var _0x678907={'raw':!![],'where':{'id':_0x1f17e8['params']['id']}},_0x55edac={};_0x55edac['model']=_[_0x3a14('0x38')](db[_0x3a14('0x32')][_0x3a14('0x4b')]);_0x55edac['query']=_['keys'](_0x1f17e8[_0x3a14('0x37')]);_0x55edac[_0x3a14('0x39')]=_[_0x3a14('0x3a')](_0x55edac[_0x3a14('0x36')],_0x55edac[_0x3a14('0x37')]);_0x678907['attributes']=_['intersection'](_0x55edac[_0x3a14('0x36')],qs['fields'](_0x1f17e8[_0x3a14('0x37')][_0x3a14('0x3c')]));_0x678907[_0x3a14('0x3b')]=_0x678907[_0x3a14('0x3b')][_0x3a14('0x3d')]?_0x678907[_0x3a14('0x3b')]:_0x55edac['model'];if(_0x1f17e8[_0x3a14('0x37')][_0x3a14('0x45')]){_0x678907[_0x3a14('0x46')]=[{'all':!![]}];}_0x678907=_['merge']({},_0x678907,_0x1f17e8[_0x3a14('0x44')]);return db['Disposition']['find'](_0x678907)[_0x3a14('0x29')](handleEntityNotFound(_0x35e0e8,null))[_0x3a14('0x29')](respondWithResult(_0x35e0e8,null))[_0x3a14('0x49')](handleError(_0x35e0e8,null));};exports[_0x3a14('0x4c')]=function(_0x5db262,_0x41de02){return db[_0x3a14('0x32')][_0x3a14('0x4c')](_0x5db262[_0x3a14('0x4d')],{})['then'](function(_0x464fa6){var _0x1d92f2=_0x5db262['user'][_0x3a14('0x2a')]({'plain':!![]});if(!_0x1d92f2)throw new Error(_0x3a14('0x4e'));if(_0x1d92f2[_0x3a14('0x4f')]===_0x3a14('0x50')){var _0x45e964=_0x464fa6[_0x3a14('0x2a')]({'plain':!![]});var _0x351947=_0x3a14('0x51');return db[_0x3a14('0x52')]['find']({'where':{'name':_0x351947,'userProfileId':_0x1d92f2[_0x3a14('0x53')]},'raw':!![]})[_0x3a14('0x29')](function(_0x45f9b1){if(_0x45f9b1&&_0x45f9b1['autoAssociation']===0x0){return db[_0x3a14('0x2b')][_0x3a14('0x4c')]({'name':_0x45e964[_0x3a14('0x2e')],'resourceId':_0x45e964['id'],'type':_0x45f9b1[_0x3a14('0x2e')],'sectionId':_0x45f9b1['id']},{})['then'](function(){return _0x464fa6;});}else{return _0x464fa6;}})[_0x3a14('0x49')](function(_0x7b6ec2){logger[_0x3a14('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7b6ec2);throw _0x7b6ec2;});}return _0x464fa6;})['then'](respondWithResult(_0x41de02,0xc9))['catch'](handleError(_0x41de02,null));};exports[_0x3a14('0x54')]=function(_0x53bb13,_0x4273a2){if(_0x53bb13[_0x3a14('0x4d')]['id']){delete _0x53bb13[_0x3a14('0x4d')]['id'];}return db[_0x3a14('0x32')]['find']({'where':{'id':_0x53bb13[_0x3a14('0x55')]['id']}})[_0x3a14('0x29')](handleEntityNotFound(_0x4273a2,null))[_0x3a14('0x29')](saveUpdates(_0x53bb13[_0x3a14('0x4d')],null))[_0x3a14('0x29')](respondWithResult(_0x4273a2,null))['catch'](handleError(_0x4273a2,null));};exports[_0x3a14('0x28')]=function(_0x2f8511,_0x1ecab3){return db[_0x3a14('0x32')][_0x3a14('0x56')]({'where':{'id':_0x2f8511['params']['id']}})['then'](handleEntityNotFound(_0x1ecab3,null))[_0x3a14('0x29')](removeEntity(_0x1ecab3,null))['catch'](handleError(_0x1ecab3,null));};
\ No newline at end of file
+var _0x7604=['offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Disposition','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x27ce92,_0x18b4bc){var _0x59d597=function(_0x1a1853){while(--_0x1a1853){_0x27ce92['push'](_0x27ce92['shift']());}};_0x59d597(++_0x18b4bc);}(_0x7604,0xd2));var _0x4760=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7604[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x4760('0x0'));var rimraf=require(_0x4760('0x1'));var zipdir=require(_0x4760('0x2'));var jsonpatch=require(_0x4760('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4760('0x4'));var Mustache=require(_0x4760('0x5'));var util=require(_0x4760('0x6'));var path=require('path');var sox=require(_0x4760('0x7'));var csv=require(_0x4760('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4760('0x9'));var _=require(_0x4760('0xa'));var squel=require('squel');var crypto=require(_0x4760('0xb'));var jsforce=require(_0x4760('0xc'));var deskjs=require(_0x4760('0xd'));var toCsv=require(_0x4760('0x8'));var querystring=require(_0x4760('0xe'));var Papa=require(_0x4760('0xf'));var Redis=require('ioredis');var authService=require(_0x4760('0x10'));var qs=require(_0x4760('0x11'));var as=require(_0x4760('0x12'));var hardwareService=require(_0x4760('0x13'));var logger=require(_0x4760('0x14'))(_0x4760('0x15'));var utils=require(_0x4760('0x16'));var config=require(_0x4760('0x17'));var licenseUtil=require(_0x4760('0x18'));var db=require(_0x4760('0x19'))['db'];function respondWithStatusCode(_0x2dacc1,_0x3b36a3){_0x3b36a3=_0x3b36a3||0xcc;return function(_0x5b3871){if(_0x5b3871){return _0x2dacc1[_0x4760('0x1a')](_0x3b36a3);}return _0x2dacc1[_0x4760('0x1b')](_0x3b36a3)[_0x4760('0x1c')]();};}function respondWithResult(_0x3073a7,_0xd1b06a){_0xd1b06a=_0xd1b06a||0xc8;return function(_0x22eb9a){if(_0x22eb9a){return _0x3073a7[_0x4760('0x1b')](_0xd1b06a)[_0x4760('0x1d')](_0x22eb9a);}};}function respondWithFilteredResult(_0x33b509,_0x507cfa){return function(_0x2f2c63){if(_0x2f2c63){var _0x5a0b08=typeof _0x507cfa['offset']===_0x4760('0x1e')&&typeof _0x507cfa[_0x4760('0x1f')]===_0x4760('0x1e');var _0x28235e=_0x2f2c63[_0x4760('0x20')];var _0x4907fa=_0x5a0b08?0x0:_0x507cfa['offset'];var _0x4e0f5d=_0x5a0b08?_0x2f2c63[_0x4760('0x20')]:_0x507cfa[_0x4760('0x21')]+_0x507cfa[_0x4760('0x1f')];var _0x36b257;if(_0x4e0f5d>=_0x28235e){_0x4e0f5d=_0x28235e;_0x36b257=0xc8;}else{_0x36b257=0xce;}_0x33b509['status'](_0x36b257);return _0x33b509[_0x4760('0x22')](_0x4760('0x23'),_0x4907fa+'-'+_0x4e0f5d+'/'+_0x28235e)[_0x4760('0x1d')](_0x2f2c63);}return null;};}function patchUpdates(_0x3f5739){return function(_0x454ee0){try{jsonpatch[_0x4760('0x24')](_0x454ee0,_0x3f5739,!![]);}catch(_0x2f0a14){return BPromise[_0x4760('0x25')](_0x2f0a14);}return _0x454ee0[_0x4760('0x26')]();};}function saveUpdates(_0x348c6d,_0x274c2d){return function(_0x4d0ea3){if(_0x4d0ea3){return _0x4d0ea3[_0x4760('0x27')](_0x348c6d)['then'](function(_0x3b9821){return _0x3b9821;});}return null;};}function removeEntity(_0x2f08c5,_0x55fc50){return function(_0x1dfe77){if(_0x1dfe77){return _0x1dfe77['destroy']()[_0x4760('0x28')](function(){var _0x2d221c=_0x1dfe77[_0x4760('0x29')]({'plain':!![]});var _0xface4f='Dispositions';return db[_0x4760('0x2a')][_0x4760('0x2b')]({'where':{'type':_0xface4f,'resourceId':_0x2d221c['id']}})[_0x4760('0x28')](function(){return _0x1dfe77;});})[_0x4760('0x28')](function(){_0x2f08c5[_0x4760('0x1b')](0xcc)[_0x4760('0x1c')]();});}};}function handleEntityNotFound(_0x44f5de,_0x3dae62){return function(_0x5caae7){if(!_0x5caae7){_0x44f5de['sendStatus'](0x194);}return _0x5caae7;};}function handleError(_0x1f6942,_0x25dd1a){_0x25dd1a=_0x25dd1a||0x1f4;return function(_0x120bfe){logger[_0x4760('0x2c')](_0x120bfe[_0x4760('0x2d')]);if(_0x120bfe[_0x4760('0x2e')]){delete _0x120bfe['name'];}_0x1f6942['status'](_0x25dd1a)[_0x4760('0x2f')](_0x120bfe);};}exports['index']=function(_0xd70d45,_0x35b132){var _0x3cc198={},_0x40f2f8={},_0x55c1a6={'count':0x0,'rows':[]};var _0x42df78=_[_0x4760('0x30')](db[_0x4760('0x31')][_0x4760('0x32')],function(_0x5710d9){return{'name':_0x5710d9[_0x4760('0x33')],'type':_0x5710d9['type']['key']};});_0x40f2f8[_0x4760('0x34')]=_[_0x4760('0x30')](_0x42df78,'name');_0x40f2f8[_0x4760('0x35')]=_[_0x4760('0x36')](_0xd70d45[_0x4760('0x35')]);_0x40f2f8[_0x4760('0x37')]=_[_0x4760('0x38')](_0x40f2f8[_0x4760('0x34')],_0x40f2f8[_0x4760('0x35')]);_0x3cc198[_0x4760('0x39')]=_[_0x4760('0x38')](_0x40f2f8[_0x4760('0x34')],qs[_0x4760('0x3a')](_0xd70d45[_0x4760('0x35')]['fields']));_0x3cc198[_0x4760('0x39')]=_0x3cc198[_0x4760('0x39')][_0x4760('0x3b')]?_0x3cc198[_0x4760('0x39')]:_0x40f2f8[_0x4760('0x34')];if(!_0xd70d45[_0x4760('0x35')][_0x4760('0x3c')](_0x4760('0x3d'))){_0x3cc198[_0x4760('0x1f')]=qs[_0x4760('0x1f')](_0xd70d45['query'][_0x4760('0x1f')]);_0x3cc198[_0x4760('0x21')]=qs[_0x4760('0x21')](_0xd70d45[_0x4760('0x35')][_0x4760('0x21')]);}_0x3cc198['order']=qs[_0x4760('0x3e')](_0xd70d45[_0x4760('0x35')][_0x4760('0x3e')]);_0x3cc198[_0x4760('0x3f')]=qs[_0x4760('0x37')](_[_0x4760('0x40')](_0xd70d45[_0x4760('0x35')],_0x40f2f8[_0x4760('0x37')]),_0x42df78);if(_0xd70d45[_0x4760('0x35')][_0x4760('0x41')]){_0x3cc198[_0x4760('0x3f')]=_['merge'](_0x3cc198[_0x4760('0x3f')],{'$or':_['map'](_0x42df78,function(_0x1ddbd5){if(_0x1ddbd5['type']!==_0x4760('0x42')){var _0x1a3e0f={};_0x1a3e0f[_0x1ddbd5[_0x4760('0x2e')]]={'$like':'%'+_0xd70d45[_0x4760('0x35')][_0x4760('0x41')]+'%'};return _0x1a3e0f;}})});}_0x3cc198=_[_0x4760('0x43')]({},_0x3cc198,_0xd70d45[_0x4760('0x44')]);var _0x58616c={'where':_0x3cc198[_0x4760('0x3f')]};return db[_0x4760('0x31')][_0x4760('0x20')](_0x58616c)[_0x4760('0x28')](function(_0x336ac1){_0x55c1a6[_0x4760('0x20')]=_0x336ac1;if(_0xd70d45[_0x4760('0x35')]['includeAll']){_0x3cc198[_0x4760('0x45')]=[{'all':!![]}];}return db[_0x4760('0x31')][_0x4760('0x46')](_0x3cc198);})[_0x4760('0x28')](function(_0xd8e960){_0x55c1a6['rows']=_0xd8e960;return _0x55c1a6;})[_0x4760('0x28')](respondWithFilteredResult(_0x35b132,_0x3cc198))[_0x4760('0x47')](handleError(_0x35b132,null));};exports['show']=function(_0x391024,_0x5bb78c){var _0x357fb8={'raw':!![],'where':{'id':_0x391024[_0x4760('0x48')]['id']}},_0x1914cc={};_0x1914cc[_0x4760('0x34')]=_[_0x4760('0x36')](db[_0x4760('0x31')]['rawAttributes']);_0x1914cc[_0x4760('0x35')]=_[_0x4760('0x36')](_0x391024[_0x4760('0x35')]);_0x1914cc[_0x4760('0x37')]=_[_0x4760('0x38')](_0x1914cc['model'],_0x1914cc[_0x4760('0x35')]);_0x357fb8[_0x4760('0x39')]=_[_0x4760('0x38')](_0x1914cc[_0x4760('0x34')],qs[_0x4760('0x3a')](_0x391024['query'][_0x4760('0x3a')]));_0x357fb8['attributes']=_0x357fb8[_0x4760('0x39')][_0x4760('0x3b')]?_0x357fb8[_0x4760('0x39')]:_0x1914cc[_0x4760('0x34')];if(_0x391024[_0x4760('0x35')][_0x4760('0x49')]){_0x357fb8[_0x4760('0x45')]=[{'all':!![]}];}_0x357fb8=_['merge']({},_0x357fb8,_0x391024[_0x4760('0x44')]);return db['Disposition'][_0x4760('0x4a')](_0x357fb8)[_0x4760('0x28')](handleEntityNotFound(_0x5bb78c,null))[_0x4760('0x28')](respondWithResult(_0x5bb78c,null))[_0x4760('0x47')](handleError(_0x5bb78c,null));};exports[_0x4760('0x4b')]=function(_0x52c2e9,_0x320a16){return db[_0x4760('0x31')][_0x4760('0x4b')](_0x52c2e9[_0x4760('0x4c')],{})[_0x4760('0x28')](function(_0x28572c){var _0x4356f2=_0x52c2e9[_0x4760('0x4d')][_0x4760('0x29')]({'plain':!![]});if(!_0x4356f2)throw new Error(_0x4760('0x4e'));if(_0x4356f2[_0x4760('0x4f')]===_0x4760('0x4d')){var _0x4ce106=_0x28572c[_0x4760('0x29')]({'plain':!![]});var _0x326cdf='Dispositions';return db['UserProfileSection'][_0x4760('0x4a')]({'where':{'name':_0x326cdf,'userProfileId':_0x4356f2['userProfileId']},'raw':!![]})['then'](function(_0x4cb379){if(_0x4cb379&&_0x4cb379['autoAssociation']===0x0){return db[_0x4760('0x2a')][_0x4760('0x4b')]({'name':_0x4ce106[_0x4760('0x2e')],'resourceId':_0x4ce106['id'],'type':_0x4cb379[_0x4760('0x2e')],'sectionId':_0x4cb379['id']},{})[_0x4760('0x28')](function(){return _0x28572c;});}else{return _0x28572c;}})[_0x4760('0x47')](function(_0x13a25c){logger[_0x4760('0x2c')](_0x4760('0x50'),_0x13a25c);throw _0x13a25c;});}return _0x28572c;})['then'](respondWithResult(_0x320a16,0xc9))[_0x4760('0x47')](handleError(_0x320a16,null));};exports['update']=function(_0x2f03f0,_0x50a421){if(_0x2f03f0[_0x4760('0x4c')]['id']){delete _0x2f03f0[_0x4760('0x4c')]['id'];}return db['Disposition'][_0x4760('0x4a')]({'where':{'id':_0x2f03f0[_0x4760('0x48')]['id']}})[_0x4760('0x28')](handleEntityNotFound(_0x50a421,null))[_0x4760('0x28')](saveUpdates(_0x2f03f0[_0x4760('0x4c')],null))[_0x4760('0x28')](respondWithResult(_0x50a421,null))[_0x4760('0x47')](handleError(_0x50a421,null));};exports['destroy']=function(_0x38a6d2,_0x3edeff){return db[_0x4760('0x31')][_0x4760('0x4a')]({'where':{'id':_0x38a6d2[_0x4760('0x48')]['id']}})[_0x4760('0x28')](handleEntityNotFound(_0x3edeff,null))['then'](removeEntity(_0x3edeff,null))['catch'](handleError(_0x3edeff,null));};
\ No newline at end of file
index c0bf3a4..5e46744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37b1=['api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x3abc4c,_0x597f7c){var _0x501fef=function(_0x46dbb9){while(--_0x46dbb9){_0x3abc4c['push'](_0x3abc4c['shift']());}};_0x501fef(++_0x597f7c);}(_0x37b1,0x9f));var _0x137b=function(_0x53298a,_0x1660b6){_0x53298a=_0x53298a-0x0;var _0x232e46=_0x37b1[_0x53298a];return _0x232e46;};'use strict';var _=require(_0x137b('0x0'));var util=require(_0x137b('0x1'));var logger=require(_0x137b('0x2'))(_0x137b('0x3'));var moment=require('moment');var BPromise=require(_0x137b('0x4'));var rp=require(_0x137b('0x5'));var fs=require('fs');var path=require(_0x137b('0x6'));var rimraf=require(_0x137b('0x7'));var config=require(_0x137b('0x8'));var attributes=require(_0x137b('0x9'));module[_0x137b('0xa')]=function(_0x6cee5f,_0x1e4293){return _0x6cee5f[_0x137b('0xb')](_0x137b('0xc'),attributes,{'tableName':_0x137b('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x137b('0xe'),'fields':['name',_0x137b('0xf')]},{'unique':!![],'name':_0x137b('0x10'),'fields':[_0x137b('0x11'),'ChatWebsiteId']},{'unique':!![],'name':_0x137b('0x12'),'fields':[_0x137b('0x11'),_0x137b('0x13')]},{'unique':!![],'name':_0x137b('0x14'),'fields':[_0x137b('0x11'),_0x137b('0x15')]},{'unique':!![],'name':_0x137b('0x16'),'fields':[_0x137b('0x11'),_0x137b('0x17')]},{'unique':!![],'name':'name_openchannel','fields':[_0x137b('0x11'),_0x137b('0x18')]},{'unique':!![],'name':_0x137b('0x19'),'fields':['name',_0x137b('0x1a')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xba61=['../../config/logger','bluebird','request-promise','path','rimraf','./disposition.attributes','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util'];(function(_0x1fb2fc,_0x86c7e5){var _0x40458e=function(_0x2ce424){while(--_0x2ce424){_0x1fb2fc['push'](_0x1fb2fc['shift']());}};_0x40458e(++_0x86c7e5);}(_0xba61,0x15f));var _0x1ba6=function(_0x7ee784,_0x28a2ab){_0x7ee784=_0x7ee784-0x0;var _0x5346bf=_0xba61[_0x7ee784];return _0x5346bf;};'use strict';var _=require('lodash');var util=require(_0x1ba6('0x0'));var logger=require(_0x1ba6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1ba6('0x2'));var rp=require(_0x1ba6('0x3'));var fs=require('fs');var path=require(_0x1ba6('0x4'));var rimraf=require(_0x1ba6('0x5'));var config=require('../../config/environment');var attributes=require(_0x1ba6('0x6'));module['exports']=function(_0x139d6a,_0x373cb1){return _0x139d6a['define'](_0x1ba6('0x7'),attributes,{'tableName':_0x1ba6('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x1ba6('0x9'),_0x1ba6('0xa')]},{'unique':!![],'name':_0x1ba6('0xb'),'fields':[_0x1ba6('0x9'),_0x1ba6('0xc')]},{'unique':!![],'name':_0x1ba6('0xd'),'fields':['name',_0x1ba6('0xe')]},{'unique':!![],'name':_0x1ba6('0xf'),'fields':[_0x1ba6('0x9'),_0x1ba6('0x10')]},{'unique':!![],'name':_0x1ba6('0x11'),'fields':[_0x1ba6('0x9'),_0x1ba6('0x12')]},{'unique':!![],'name':_0x1ba6('0x13'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x1ba6('0x14'),'fields':[_0x1ba6('0x9'),_0x1ba6('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
index 8b8d267..967cdab 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(_0x45b24a,_0x1c1cbf){var _0x25b49c=function(_0x192ca9){while(--_0x192ca9){_0x45b24a['push'](_0x45b24a['shift']());}};_0x25b49c(++_0x1c1cbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','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(_0xe89377,_0x554802){var _0x2538b4=function(_0x36ccd0){while(--_0x36ccd0){_0xe89377['push'](_0xe89377['shift']());}};_0x2538b4(++_0x554802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 f600de6..ae7d43d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9230=['get','isAuthenticated','/:id','post','create','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller'];(function(_0xe52c02,_0x14e21a){var _0x5cc823=function(_0x29483d){while(--_0x29483d){_0xe52c02['push'](_0xe52c02['shift']());}};_0x5cc823(++_0x14e21a);}(_0x9230,0xe6));var _0x0923=function(_0x3b68ed,_0x70b4ff){_0x3b68ed=_0x3b68ed-0x0;var _0x13a11d=_0x9230[_0x3b68ed];return _0x13a11d;};'use strict';var multer=require(_0x0923('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0923('0x1'));var express=require(_0x0923('0x2'));var router=express[_0x0923('0x3')]();var fs_extra=require(_0x0923('0x4'));var auth=require(_0x0923('0x5'));var interaction=require(_0x0923('0x6'));var config=require('../../config/environment');var controller=require(_0x0923('0x7'));router[_0x0923('0x8')]('/',auth[_0x0923('0x9')](),controller['index']);router['get'](_0x0923('0xa'),auth[_0x0923('0x9')](),controller['show']);router[_0x0923('0xb')]('/',auth[_0x0923('0x9')](),controller[_0x0923('0xc')]);router['put'](_0x0923('0xa'),auth[_0x0923('0x9')](),controller['update']);router[_0x0923('0xd')](_0x0923('0xa'),auth[_0x0923('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x36b6=['../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x335408,_0x4148e3){var _0x17ab81=function(_0x4e5ba8){while(--_0x4e5ba8){_0x335408['push'](_0x335408['shift']());}};_0x17ab81(++_0x4148e3);}(_0x36b6,0x13a));var _0x636b=function(_0x868fe3,_0x2ee80e){_0x868fe3=_0x868fe3-0x0;var _0x444289=_0x36b6[_0x868fe3];return _0x444289;};'use strict';var multer=require(_0x636b('0x0'));var util=require(_0x636b('0x1'));var path=require(_0x636b('0x2'));var timeout=require(_0x636b('0x3'));var express=require(_0x636b('0x4'));var router=express[_0x636b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x636b('0x6'));var interaction=require(_0x636b('0x7'));var config=require('../../config/environment');var controller=require(_0x636b('0x8'));router[_0x636b('0x9')]('/',auth[_0x636b('0xa')](),controller[_0x636b('0xb')]);router[_0x636b('0x9')](_0x636b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x636b('0xd')]('/',auth['isAuthenticated'](),controller[_0x636b('0xe')]);router[_0x636b('0xf')](_0x636b('0xc'),auth[_0x636b('0xa')](),controller[_0x636b('0x10')]);router[_0x636b('0x11')](_0x636b('0xc'),auth['isAuthenticated'](),controller[_0x636b('0x12')]);module[_0x636b('0x13')]=router;
\ No newline at end of file
index 702d93a..27ea875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbc=['12000','14400','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x7fbc,0x84));var _0xc7fb=function(_0x5a1e8f,_0xf73c41){_0x5a1e8f=_0x5a1e8f-0x0;var _0x29f766=_0x7fbc[_0x5a1e8f];return _0x29f766;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc7fb('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc7fb('0x0')]},'ecm':{'type':Sequelize[_0xc7fb('0x1')](_0xc7fb('0x2'),'no'),'defaultValue':_0xc7fb('0x2')},'headerinfo':{'type':Sequelize[_0xc7fb('0x0')],'defaultValue':_0xc7fb('0x3')},'localstationid':{'type':Sequelize[_0xc7fb('0x0')],'unique':_0xc7fb('0x4')},'minrate':{'type':Sequelize[_0xc7fb('0x1')](_0xc7fb('0x5'),_0xc7fb('0x6'),_0xc7fb('0x7'),'9600',_0xc7fb('0x8'),_0xc7fb('0x9')),'defaultValue':_0xc7fb('0x6')},'maxrate':{'type':Sequelize[_0xc7fb('0x1')]('2400',_0xc7fb('0x6'),'7200','9600',_0xc7fb('0x8'),_0xc7fb('0x9')),'defaultValue':_0xc7fb('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc7fb('0x0')],'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[_0xc7fb('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc7fb('0x1')](_0xc7fb('0xb'),'IAX',_0xc7fb('0xc'),_0xc7fb('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc7fb('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc7fb('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc7fb('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc7fb('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc7fb('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc7fb('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc7fb('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc7fb('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0xc7fb('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc7fb('0x11'),'set':function(_0x225928){if(!_0x225928)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc7fb('0x12')](_0xc7fb('0x13'),_0x225928);}}};
\ No newline at end of file
+var _0xf76f=['2400','v17,v27,v29','SIP','IAX','DADHI','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0xf76f,0x19b));var _0xff76=function(_0x29758a,_0x30bc47){_0x29758a=_0x29758a-0x0;var _0x587b43=_0xf76f[_0x29758a];return _0x587b43;};'use strict';var Sequelize=require(_0xff76('0x0'));module['exports']={'name':{'type':Sequelize[_0xff76('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xff76('0x1')]},'ecm':{'type':Sequelize[_0xff76('0x2')](_0xff76('0x3'),'no'),'defaultValue':_0xff76('0x3')},'headerinfo':{'type':Sequelize[_0xff76('0x1')],'defaultValue':_0xff76('0x4')},'localstationid':{'type':Sequelize[_0xff76('0x1')],'unique':_0xff76('0x5')},'minrate':{'type':Sequelize['ENUM']('2400',_0xff76('0x6'),_0xff76('0x7'),_0xff76('0x8'),'12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xff76('0x2')](_0xff76('0x9'),_0xff76('0x6'),'7200',_0xff76('0x8'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xff76('0xa')},'gateway':{'type':Sequelize[_0xff76('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xff76('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xff76('0x2')](_0xff76('0xb'),_0xff76('0xc'),_0xff76('0xd'),'KHOMP'),'defaultValue':_0xff76('0xb')},'key':{'type':Sequelize[_0xff76('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xff76('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xff76('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff76('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xff76('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff76('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xff76('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xff76('0x11'),'set':function(_0x410db8){if(!_0x410db8)this['setDataValue'](_0xff76('0x12'),null);this['setDataValue'](_0xff76('0x13'),_0x410db8);}}};
\ No newline at end of file
index 1845bd2..5db4e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d8=['findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','CmContact','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','List','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','FaxAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers'];(function(_0x9723ad,_0x37ef4d){var _0x445010=function(_0x2ca302){while(--_0x2ca302){_0x9723ad['push'](_0x9723ad['shift']());}};_0x445010(++_0x37ef4d);}(_0x90d8,0x114));var _0x890d=function(_0x2183cb,_0x4e2cf3){_0x2183cb=_0x2183cb-0x0;var _0x1d70bc=_0x90d8[_0x2183cb];return _0x1d70bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x890d('0x0'));var zipdir=require(_0x890d('0x1'));var jsonpatch=require(_0x890d('0x2'));var rp=require(_0x890d('0x3'));var moment=require(_0x890d('0x4'));var BPromise=require(_0x890d('0x5'));var Mustache=require(_0x890d('0x6'));var util=require(_0x890d('0x7'));var path=require(_0x890d('0x8'));var sox=require(_0x890d('0x9'));var csv=require(_0x890d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x890d('0xb'));var _=require('lodash');var squel=require(_0x890d('0xc'));var crypto=require(_0x890d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x890d('0xe'));var toCsv=require(_0x890d('0xa'));var querystring=require('querystring');var Papa=require(_0x890d('0xf'));var Redis=require(_0x890d('0x10'));var authService=require(_0x890d('0x11'));var qs=require(_0x890d('0x12'));var as=require(_0x890d('0x13'));var hardwareService=require(_0x890d('0x14'));var logger=require('../../config/logger')(_0x890d('0x15'));var utils=require(_0x890d('0x16'));var config=require(_0x890d('0x17'));var licenseUtil=require(_0x890d('0x18'));var db=require(_0x890d('0x19'))['db'];config['redis']=_['defaults'](config[_0x890d('0x1a')],{'host':_0x890d('0x1b'),'port':0x18eb});var socket=require(_0x890d('0x1c'))(new Redis(config['redis']));require(_0x890d('0x1d'))[_0x890d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x890d('0x1f')][_0x890d('0x20')]({'port':0x232c});var client9002=jayson[_0x890d('0x1f')][_0x890d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1ae3de,_0x4f10e2,_0x3c7fbb,_0x3b5625){return new BPromise(function(_0x4a1925,_0x42b455){var _0x3f912c=_0x3b5625||client;return _0x3f912c['request'](_0x1ae3de,_0x3c7fbb)[_0x890d('0x21')](function(_0x28b1b1){logger[_0x890d('0x22')]('FaxAccount,\x20%s,\x20%s',_0x4f10e2,_0x890d('0x23'));logger['debug'](_0x890d('0x24'),_0x4f10e2,_0x890d('0x23'),JSON[_0x890d('0x25')](_0x28b1b1));if(_0x28b1b1['error']){if(_0x28b1b1[_0x890d('0x26')]['code']===0x1f4){logger[_0x890d('0x26')](_0x890d('0x27'),_0x4f10e2,_0x28b1b1['error']['message']);return _0x42b455(_0x28b1b1[_0x890d('0x26')][_0x890d('0x28')]);}logger[_0x890d('0x26')](_0x890d('0x27'),_0x4f10e2,_0x28b1b1[_0x890d('0x26')][_0x890d('0x28')]);return _0x4a1925(_0x28b1b1[_0x890d('0x26')][_0x890d('0x28')]);}else{logger[_0x890d('0x22')](_0x890d('0x27'),_0x4f10e2,_0x890d('0x23'));_0x4a1925(_0x28b1b1['result'][_0x890d('0x28')]);}})[_0x890d('0x29')](function(_0x5e71cd){logger['error'](_0x890d('0x27'),_0x4f10e2,_0x5e71cd);_0x42b455(_0x5e71cd);});});}function respondWithStatusCode(_0x2964c0,_0x2cac92){_0x2cac92=_0x2cac92||0xcc;return function(_0x34a870){if(_0x34a870){return _0x2964c0[_0x890d('0x2a')](_0x2cac92);}return _0x2964c0[_0x890d('0x2b')](_0x2cac92)[_0x890d('0x2c')]();};}function respondWithResult(_0x2373f2,_0x309a30){_0x309a30=_0x309a30||0xc8;return function(_0x129e85){if(_0x129e85){return _0x2373f2['status'](_0x309a30)[_0x890d('0x2d')](_0x129e85);}};}function respondWithFilteredResult(_0x4f0f04,_0x5d5f2f){return function(_0x556b69){if(_0x556b69){var _0x8abd3=typeof _0x5d5f2f[_0x890d('0x2e')]==='undefined'&&typeof _0x5d5f2f[_0x890d('0x2f')]==='undefined';var _0x22a961=_0x556b69[_0x890d('0x30')];var _0x42f339=_0x8abd3?0x0:_0x5d5f2f[_0x890d('0x2e')];var _0x42450a=_0x8abd3?_0x556b69['count']:_0x5d5f2f[_0x890d('0x2e')]+_0x5d5f2f[_0x890d('0x2f')];var _0x3f0bff;if(_0x42450a>=_0x22a961){_0x42450a=_0x22a961;_0x3f0bff=0xc8;}else{_0x3f0bff=0xce;}_0x4f0f04['status'](_0x3f0bff);return _0x4f0f04[_0x890d('0x31')](_0x890d('0x32'),_0x42f339+'-'+_0x42450a+'/'+_0x22a961)[_0x890d('0x2d')](_0x556b69);}return null;};}function patchUpdates(_0x446f13){return function(_0x32d8af){try{jsonpatch[_0x890d('0x33')](_0x32d8af,_0x446f13,!![]);}catch(_0x423a95){return BPromise[_0x890d('0x34')](_0x423a95);}return _0x32d8af['save']();};}function saveUpdates(_0x2992f3,_0x24489f){return function(_0x73fb73){if(_0x73fb73){return _0x73fb73[_0x890d('0x35')](_0x2992f3)[_0x890d('0x21')](function(_0x4d83a4){return _0x4d83a4;});}return null;};}function removeEntity(_0x59d860,_0x2667c8){return function(_0x15aa05){if(_0x15aa05){return _0x15aa05[_0x890d('0x36')]()[_0x890d('0x21')](function(){var _0x4348ad=_0x15aa05[_0x890d('0x37')]({'plain':!![]});var _0x2bcf44=_0x890d('0x38');return db[_0x890d('0x39')][_0x890d('0x36')]({'where':{'type':_0x2bcf44,'resourceId':_0x4348ad['id']}})[_0x890d('0x21')](function(){return _0x15aa05;});})[_0x890d('0x21')](function(){_0x59d860['status'](0xcc)[_0x890d('0x2c')]();});}};}function handleEntityNotFound(_0x2acd8c,_0x25c3a2){return function(_0x4c8336){if(!_0x4c8336){_0x2acd8c[_0x890d('0x2a')](0x194);}return _0x4c8336;};}function handleError(_0x4c341a,_0x48aa14){_0x48aa14=_0x48aa14||0x1f4;return function(_0x512ece){logger['error'](_0x512ece[_0x890d('0x3a')]);if(_0x512ece['name']){delete _0x512ece[_0x890d('0x3b')];}_0x4c341a['status'](_0x48aa14)[_0x890d('0x3c')](_0x512ece);};}exports[_0x890d('0x3d')]=function(_0x266749,_0x4a784f){var _0x28db5c={'include':[{'model':db[_0x890d('0x3e')],'as':_0x890d('0x3f')}]},_0x1f88f3={},_0x9c878={'count':0x0,'rows':[]};var _0xd9bbd1=_[_0x890d('0x40')](db[_0x890d('0x41')]['rawAttributes'],function(_0x160b77){return{'name':_0x160b77[_0x890d('0x42')],'type':_0x160b77['type'][_0x890d('0x43')]};});_0x1f88f3[_0x890d('0x44')]=_[_0x890d('0x40')](_0xd9bbd1,_0x890d('0x3b'));_0x1f88f3[_0x890d('0x45')]=_[_0x890d('0x46')](_0x266749['query']);_0x1f88f3[_0x890d('0x47')]=_['intersection'](_0x1f88f3[_0x890d('0x44')],_0x1f88f3['query']);_0x28db5c[_0x890d('0x48')]=_[_0x890d('0x49')](_0x1f88f3[_0x890d('0x44')],qs[_0x890d('0x4a')](_0x266749[_0x890d('0x45')]['fields']));_0x28db5c['attributes']=_0x28db5c[_0x890d('0x48')][_0x890d('0x4b')]?_0x28db5c['attributes']:_0x1f88f3[_0x890d('0x44')];if(!_0x266749[_0x890d('0x45')][_0x890d('0x4c')](_0x890d('0x4d'))){_0x28db5c[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x266749['query'][_0x890d('0x2f')]);_0x28db5c['offset']=qs[_0x890d('0x2e')](_0x266749[_0x890d('0x45')][_0x890d('0x2e')]);}_0x28db5c[_0x890d('0x4e')]=qs[_0x890d('0x4f')](_0x266749['query'][_0x890d('0x4f')]);_0x28db5c[_0x890d('0x50')]=qs[_0x890d('0x47')](_[_0x890d('0x51')](_0x266749[_0x890d('0x45')],_0x1f88f3[_0x890d('0x47')]),_0xd9bbd1);if(_0x266749[_0x890d('0x45')][_0x890d('0x52')]){_0x28db5c[_0x890d('0x50')]=_[_0x890d('0x53')](_0x28db5c[_0x890d('0x50')],{'$or':_[_0x890d('0x40')](_0xd9bbd1,function(_0x4e8469){if(_0x4e8469['type']!==_0x890d('0x54')){var _0x4a2ab2={};_0x4a2ab2[_0x4e8469['name']]={'$like':'%'+_0x266749[_0x890d('0x45')][_0x890d('0x52')]+'%'};return _0x4a2ab2;}})});}_0x28db5c=_[_0x890d('0x53')]({},_0x28db5c,_0x266749[_0x890d('0x55')]);var _0xd6886d={'where':_0x28db5c[_0x890d('0x50')]};return db[_0x890d('0x41')]['count'](_0xd6886d)['then'](function(_0x2ddfbf){_0x9c878['count']=_0x2ddfbf;if(_0x266749[_0x890d('0x45')][_0x890d('0x56')]){_0x28db5c[_0x890d('0x57')]=[{'all':!![]}];}return db[_0x890d('0x41')][_0x890d('0x58')](_0x28db5c);})[_0x890d('0x21')](function(_0x4cdf33){_0x9c878[_0x890d('0x59')]=_0x4cdf33;return _0x9c878;})[_0x890d('0x21')](respondWithFilteredResult(_0x4a784f,_0x28db5c))[_0x890d('0x29')](handleError(_0x4a784f,null));};exports['show']=function(_0xc24b71,_0x4610f9){var _0x526a23={'raw':![],'where':{'id':_0xc24b71[_0x890d('0x5a')]['id']},'include':[{'model':db[_0x890d('0x3e')],'as':_0x890d('0x3f')}]},_0x253b5a={};_0x253b5a[_0x890d('0x44')]=_[_0x890d('0x46')](db['FaxAccount'][_0x890d('0x5b')]);_0x253b5a[_0x890d('0x45')]=_[_0x890d('0x46')](_0xc24b71['query']);_0x253b5a['filters']=_[_0x890d('0x49')](_0x253b5a[_0x890d('0x44')],_0x253b5a[_0x890d('0x45')]);_0x526a23[_0x890d('0x48')]=_['intersection'](_0x253b5a[_0x890d('0x44')],qs[_0x890d('0x4a')](_0xc24b71[_0x890d('0x45')]['fields']));_0x526a23[_0x890d('0x48')]=_0x526a23['attributes'][_0x890d('0x4b')]?_0x526a23[_0x890d('0x48')]:_0x253b5a[_0x890d('0x44')];if(_0xc24b71['query'][_0x890d('0x56')]){_0x526a23[_0x890d('0x57')]=[{'all':!![]}];}_0x526a23=_[_0x890d('0x53')]({},_0x526a23,_0xc24b71[_0x890d('0x55')]);return db[_0x890d('0x41')]['find'](_0x526a23)[_0x890d('0x21')](handleEntityNotFound(_0x4610f9,null))[_0x890d('0x21')](respondWithResult(_0x4610f9,null))[_0x890d('0x29')](handleError(_0x4610f9,null));};exports[_0x890d('0x5c')]=function(_0x328687,_0x4c3afa){return db[_0x890d('0x41')][_0x890d('0x5c')](_0x328687['body'],{})[_0x890d('0x21')](function(_0x362e6b){var _0xe6703d=_0x328687[_0x890d('0x5d')][_0x890d('0x37')]({'plain':!![]});if(!_0xe6703d)throw new Error(_0x890d('0x5e'));if(_0xe6703d['role']===_0x890d('0x5d')){var _0x213c47=_0x362e6b[_0x890d('0x37')]({'plain':!![]});var _0x30aed4=_0x890d('0x38');return db[_0x890d('0x5f')]['find']({'where':{'name':_0x30aed4,'userProfileId':_0xe6703d['userProfileId']},'raw':!![]})['then'](function(_0x5327f6){if(_0x5327f6&&_0x5327f6[_0x890d('0x60')]===0x0){return db[_0x890d('0x39')][_0x890d('0x5c')]({'name':_0x213c47['name'],'resourceId':_0x213c47['id'],'type':_0x5327f6[_0x890d('0x3b')],'sectionId':_0x5327f6['id']},{})['then'](function(){return _0x362e6b;});}else{return _0x362e6b;}})[_0x890d('0x29')](function(_0x5213e2){logger[_0x890d('0x26')](_0x890d('0x61'),_0x5213e2);throw _0x5213e2;});}return _0x362e6b;})[_0x890d('0x21')](respondWithResult(_0x4c3afa,0xc9))[_0x890d('0x29')](handleError(_0x4c3afa,null));};exports[_0x890d('0x35')]=function(_0x422357,_0x174efd){if(_0x422357['body']['id']){delete _0x422357[_0x890d('0x62')]['id'];}return db['FaxAccount'][_0x890d('0x63')]({'where':{'id':_0x422357[_0x890d('0x5a')]['id']},'include':[{'model':db[_0x890d('0x3e')],'as':_0x890d('0x3f')}]})[_0x890d('0x21')](handleEntityNotFound(_0x174efd,null))[_0x890d('0x21')](saveUpdates(_0x422357[_0x890d('0x62')],null))['then'](respondWithResult(_0x174efd,null))[_0x890d('0x29')](handleError(_0x174efd,null));};exports[_0x890d('0x36')]=function(_0x5686b4,_0x382818){return db[_0x890d('0x41')][_0x890d('0x63')]({'where':{'id':_0x5686b4[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x382818,null))[_0x890d('0x21')](removeEntity(_0x382818,null))['catch'](handleError(_0x382818,null));};exports[_0x890d('0x64')]=function(_0x582eab,_0x551168){return db[_0x890d('0x41')][_0x890d('0x64')]()[_0x890d('0x21')](respondWithResult(_0x551168,null))[_0x890d('0x29')](handleError(_0x551168,null));};exports[_0x890d('0x65')]=function(_0x2c3d38,_0x2de4f2,_0x523330){if(_0x2c3d38[_0x890d('0x62')]['id']){delete _0x2c3d38[_0x890d('0x62')]['id'];}return db[_0x890d('0x41')][_0x890d('0x63')]({'where':{'id':_0x2c3d38[_0x890d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2de4f2,null))[_0x890d('0x21')](function(_0x54f34e){if(_0x54f34e){_0x2c3d38['body'][_0x890d('0x66')]=_0x54f34e['id'];return db[_0x890d('0x67')][_0x890d('0x5c')](_0x2c3d38[_0x890d('0x62')]);}})['then'](respondWithResult(_0x2de4f2,null))[_0x890d('0x29')](handleError(_0x2de4f2,null));};exports[_0x890d('0x68')]=function(_0xd52a94,_0x157bbd,_0x531223){var _0x1c1acf={'raw':![],'where':{}};var _0x1b11da={};var _0xd0a3df={'count':0x0,'rows':[]};return db[_0x890d('0x41')]['findOne']({'where':{'id':_0xd52a94[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x157bbd,null))[_0x890d('0x21')](function(_0x1b4605){if(_0x1b4605){_0x1b11da[_0x890d('0x44')]=_[_0x890d('0x46')](db[_0x890d('0x67')][_0x890d('0x5b')]);_0x1b11da[_0x890d('0x45')]=_['keys'](_0xd52a94['query']);_0x1b11da[_0x890d('0x47')]=_[_0x890d('0x49')](_0x1b11da[_0x890d('0x44')],_0x1b11da['query']);_0x1c1acf[_0x890d('0x48')]=_[_0x890d('0x49')](_0x1b11da[_0x890d('0x44')],qs[_0x890d('0x4a')](_0xd52a94[_0x890d('0x45')]['fields']));_0x1c1acf[_0x890d('0x48')]=_0x1c1acf['attributes'][_0x890d('0x4b')]?_0x1c1acf[_0x890d('0x48')]:_0x1b11da[_0x890d('0x44')];if(!_0xd52a94[_0x890d('0x45')][_0x890d('0x4c')]('nolimit')){_0x1c1acf[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0xd52a94['query']['limit']);_0x1c1acf['offset']=qs[_0x890d('0x2e')](_0xd52a94[_0x890d('0x45')]['offset']);}_0x1c1acf['order']=qs['sort'](_0xd52a94[_0x890d('0x45')][_0x890d('0x4f')]);_0x1c1acf[_0x890d('0x50')]=qs[_0x890d('0x47')](_[_0x890d('0x51')](_0xd52a94[_0x890d('0x45')],_0x1b11da[_0x890d('0x47')]));_0x1c1acf['where'][_0x890d('0x66')]=_0x1b4605['id'];if(_0xd52a94[_0x890d('0x45')][_0x890d('0x52')]){_0x1c1acf[_0x890d('0x50')]=_[_0x890d('0x53')](_0x1c1acf[_0x890d('0x50')],{'$or':_['map'](_0x1c1acf[_0x890d('0x48')],function(_0x24f310){var _0x215158={};_0x215158[_0x24f310]={'$like':'%'+_0xd52a94['query'][_0x890d('0x52')]+'%'};return _0x215158;})});}_0x1c1acf=_['merge']({},_0x1c1acf,_0xd52a94[_0x890d('0x55')]);return db[_0x890d('0x67')][_0x890d('0x30')]({'where':_0x1c1acf[_0x890d('0x50')]})[_0x890d('0x21')](function(_0x1c7fab){_0xd0a3df[_0x890d('0x30')]=_0x1c7fab;if(_0xd52a94[_0x890d('0x45')][_0x890d('0x56')]){_0x1c1acf['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1c1acf);})[_0x890d('0x21')](function(_0x13bd49){_0xd0a3df[_0x890d('0x59')]=_0x13bd49;return _0xd0a3df;});}})[_0x890d('0x21')](respondWithFilteredResult(_0x157bbd,_0x1c1acf))[_0x890d('0x29')](handleError(_0x157bbd,null));};exports[_0x890d('0x69')]=function(_0x4b70e1,_0x15f9a2,_0x281f58){return db[_0x890d('0x41')]['find']({'where':{'id':_0x4b70e1[_0x890d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x15f9a2,null))[_0x890d('0x21')](function(_0x2264a2){if(_0x2264a2){return _0x2264a2['removeDispositions'](_0x4b70e1['query'][_0x890d('0x6a')]);}})[_0x890d('0x21')](respondWithStatusCode(_0x15f9a2,null))[_0x890d('0x29')](handleError(_0x15f9a2,null));};exports[_0x890d('0x6b')]=function(_0x34ea9d,_0x1805f3,_0x43d679){if(_0x34ea9d[_0x890d('0x62')]['id']){delete _0x34ea9d[_0x890d('0x62')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x34ea9d[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x1805f3,null))['then'](function(_0x3dcff3){if(_0x3dcff3){_0x34ea9d[_0x890d('0x62')][_0x890d('0x66')]=_0x3dcff3['id'];return db[_0x890d('0x6c')]['create'](_0x34ea9d[_0x890d('0x62')]);}})[_0x890d('0x21')](respondWithResult(_0x1805f3,null))[_0x890d('0x29')](handleError(_0x1805f3,null));};exports[_0x890d('0x6d')]=function(_0x390e86,_0x280bce,_0x168c59){var _0x402860={'raw':![],'where':{}};var _0x72dc34={};var _0x29b014={'count':0x0,'rows':[]};return db[_0x890d('0x41')][_0x890d('0x6e')]({'where':{'id':_0x390e86[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x280bce,null))[_0x890d('0x21')](function(_0xd7e8d8){if(_0xd7e8d8){_0x72dc34[_0x890d('0x44')]=_[_0x890d('0x46')](db['CannedAnswer'][_0x890d('0x5b')]);_0x72dc34[_0x890d('0x45')]=_['keys'](_0x390e86[_0x890d('0x45')]);_0x72dc34[_0x890d('0x47')]=_[_0x890d('0x49')](_0x72dc34[_0x890d('0x44')],_0x72dc34[_0x890d('0x45')]);_0x402860[_0x890d('0x48')]=_[_0x890d('0x49')](_0x72dc34[_0x890d('0x44')],qs[_0x890d('0x4a')](_0x390e86[_0x890d('0x45')]['fields']));_0x402860['attributes']=_0x402860[_0x890d('0x48')][_0x890d('0x4b')]?_0x402860['attributes']:_0x72dc34[_0x890d('0x44')];if(!_0x390e86[_0x890d('0x45')]['hasOwnProperty'](_0x890d('0x4d'))){_0x402860[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x390e86[_0x890d('0x45')][_0x890d('0x2f')]);_0x402860['offset']=qs[_0x890d('0x2e')](_0x390e86[_0x890d('0x45')]['offset']);}_0x402860[_0x890d('0x4e')]=qs[_0x890d('0x4f')](_0x390e86[_0x890d('0x45')][_0x890d('0x4f')]);_0x402860[_0x890d('0x50')]=qs[_0x890d('0x47')](_[_0x890d('0x51')](_0x390e86[_0x890d('0x45')],_0x72dc34['filters']));_0x402860[_0x890d('0x50')]['FaxAccountId']=_0xd7e8d8['id'];if(_0x390e86[_0x890d('0x45')]['filter']){_0x402860[_0x890d('0x50')]=_['merge'](_0x402860[_0x890d('0x50')],{'$or':_[_0x890d('0x40')](_0x402860[_0x890d('0x48')],function(_0x1d487d){var _0x5080d9={};_0x5080d9[_0x1d487d]={'$like':'%'+_0x390e86[_0x890d('0x45')]['filter']+'%'};return _0x5080d9;})});}_0x402860=_['merge']({},_0x402860,_0x390e86[_0x890d('0x55')]);return db[_0x890d('0x6c')][_0x890d('0x30')]({'where':_0x402860['where']})['then'](function(_0x2e222a){_0x29b014[_0x890d('0x30')]=_0x2e222a;if(_0x390e86['query'][_0x890d('0x56')]){_0x402860[_0x890d('0x57')]=[{'all':!![]}];}return db[_0x890d('0x6c')][_0x890d('0x58')](_0x402860);})[_0x890d('0x21')](function(_0x446bf0){_0x29b014['rows']=_0x446bf0;return _0x29b014;});}})[_0x890d('0x21')](respondWithFilteredResult(_0x280bce,_0x402860))[_0x890d('0x29')](handleError(_0x280bce,null));};exports[_0x890d('0x6f')]=function(_0x162948,_0x34c125,_0xa8b7a9){return db[_0x890d('0x41')]['find']({'where':{'id':_0x162948[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x34c125,null))[_0x890d('0x21')](function(_0x40437e){if(_0x40437e){return _0x40437e['removeAnswers'](_0x162948[_0x890d('0x45')][_0x890d('0x6a')]);}})['then'](respondWithStatusCode(_0x34c125,null))['catch'](handleError(_0x34c125,null));};exports[_0x890d('0x70')]=function(_0x3a812c,_0x4853d4,_0x5ac6ad){return db[_0x890d('0x71')][_0x890d('0x63')]({'where':{'id':_0x3a812c[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x4853d4,null))['then'](function(_0x391586){if(_0x391586){return _0x391586['addInteraction'](_0x3a812c[_0x890d('0x62')]['ids'],_[_0x890d('0x72')](_0x3a812c[_0x890d('0x62')],['ids','id'])||{});}})[_0x890d('0x21')](respondWithResult(_0x4853d4,null))['catch'](handleError(_0x4853d4,null));};exports[_0x890d('0x73')]=function(_0x16a394,_0x315ad1,_0x4546c0){var _0x1750a3={'raw':![],'where':{}};var _0x29289c={};var _0x337daf={'count':0x0,'rows':[]};return db[_0x890d('0x41')]['findOne']({'where':{'id':_0x16a394[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x315ad1,null))[_0x890d('0x21')](function(_0x54e06f){if(_0x54e06f){_0x29289c[_0x890d('0x44')]=_[_0x890d('0x46')](db[_0x890d('0x71')][_0x890d('0x5b')]);_0x29289c['query']=_[_0x890d('0x46')](_0x16a394[_0x890d('0x45')]);_0x29289c[_0x890d('0x47')]=_[_0x890d('0x49')](_0x29289c[_0x890d('0x44')],_0x29289c[_0x890d('0x45')]);_0x1750a3[_0x890d('0x48')]=_[_0x890d('0x49')](_0x29289c[_0x890d('0x44')],qs[_0x890d('0x4a')](_0x16a394[_0x890d('0x45')][_0x890d('0x4a')]));_0x1750a3[_0x890d('0x48')]=_0x1750a3[_0x890d('0x48')][_0x890d('0x4b')]?_0x1750a3[_0x890d('0x48')]:_0x29289c[_0x890d('0x44')];if(!_0x16a394[_0x890d('0x45')][_0x890d('0x4c')]('nolimit')){_0x1750a3[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x16a394[_0x890d('0x45')][_0x890d('0x2f')]);_0x1750a3[_0x890d('0x2e')]=qs[_0x890d('0x2e')](_0x16a394[_0x890d('0x45')][_0x890d('0x2e')]);}_0x1750a3[_0x890d('0x4e')]=qs['sort'](_0x16a394[_0x890d('0x45')][_0x890d('0x4f')]);_0x1750a3[_0x890d('0x50')]=qs['filters'](_[_0x890d('0x51')](_0x16a394[_0x890d('0x45')],_0x29289c[_0x890d('0x47')]));_0x1750a3[_0x890d('0x50')]['FaxAccountId']=_0x54e06f['id'];if(_0x16a394[_0x890d('0x45')][_0x890d('0x52')]){_0x1750a3[_0x890d('0x50')]=_[_0x890d('0x53')](_0x1750a3[_0x890d('0x50')],{'$or':_['map'](_0x1750a3[_0x890d('0x48')],function(_0x3ca14a){var _0x2ee470={};_0x2ee470[_0x3ca14a]={'$like':'%'+_0x16a394['query'][_0x890d('0x52')]+'%'};return _0x2ee470;})});}_0x1750a3=_[_0x890d('0x53')]({},_0x1750a3,_0x16a394[_0x890d('0x55')]);return db[_0x890d('0x71')][_0x890d('0x30')]({'where':_0x1750a3['where']})[_0x890d('0x21')](function(_0xbd880){_0x337daf[_0x890d('0x30')]=_0xbd880;if(_0x16a394[_0x890d('0x45')][_0x890d('0x56')]){_0x1750a3[_0x890d('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x890d('0x74')],'as':_0x890d('0x75'),'attributes':['name',_0x890d('0x76'),_0x890d('0x77')],'required':![]},{'model':db[_0x890d('0x78')],'as':_0x890d('0x79'),'attributes':['id','name',_0x890d('0x7a')],'where':_0x16a394[_0x890d('0x45')][_0x890d('0x7b')]?{'id':_0x16a394['query'][_0x890d('0x7b')]}:undefined,'required':_0x16a394['query'][_0x890d('0x7b')]?!![]:![]}];}return db[_0x890d('0x71')]['findAll'](_0x1750a3);})[_0x890d('0x21')](function(_0x2f8081){_0x337daf[_0x890d('0x59')]=_0x2f8081;return _0x337daf;});}})[_0x890d('0x21')](respondWithFilteredResult(_0x315ad1,_0x1750a3))[_0x890d('0x29')](handleError(_0x315ad1,null));};exports[_0x890d('0x7c')]=function(_0x1ad405,_0x3e5079,_0x3fd6fe){return db[_0x890d('0x41')][_0x890d('0x6e')]({'where':{'id':_0x1ad405[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x3e5079,null))[_0x890d('0x21')](function(_0xba57a1){if(_0xba57a1){return db[_0x890d('0x7d')][_0x890d('0x7e')](function(_0x51a5c3){return db['FaxApplication'][_0x890d('0x36')]({'where':{'FaxAccountId':_0x1ad405[_0x890d('0x5a')]['id']},'transaction':_0x51a5c3})['then'](function(_0x1c3a20){var _0x44453b=_[_0x890d('0x40')](_0x1ad405['body'],function(_0x9d4e06){_0x9d4e06[_0x890d('0x66')]=_0x1ad405[_0x890d('0x5a')]['id'];return _0x9d4e06;});return db[_0x890d('0x7f')]['bulkCreate'](_0x44453b,{'transaction':_0x51a5c3});});})['then'](function(){return db[_0x890d('0x7f')][_0x890d('0x80')]({'where':{'FaxAccountId':_0x1ad405['params']['id']},'order':_0x890d('0x81')});});}})[_0x890d('0x21')](respondWithResult(_0x3e5079,null))[_0x890d('0x29')](handleError(_0x3e5079,null));};exports[_0x890d('0x82')]=function(_0x27b01a,_0x311963,_0x4cf3c2){var _0x30bb0c={};var _0x103d48={};var _0x1645d2;var _0x645165;return db[_0x890d('0x41')][_0x890d('0x6e')]({'where':{'id':_0x27b01a['params']['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x311963,null))[_0x890d('0x21')](function(_0x366936){if(_0x366936){_0x1645d2=_0x366936;_0x103d48[_0x890d('0x44')]=_[_0x890d('0x46')](db[_0x890d('0x7f')][_0x890d('0x5b')]);_0x103d48[_0x890d('0x45')]=_[_0x890d('0x46')](_0x27b01a[_0x890d('0x45')]);_0x103d48['filters']=_[_0x890d('0x49')](_0x103d48['model'],_0x103d48[_0x890d('0x45')]);_0x30bb0c[_0x890d('0x48')]=_[_0x890d('0x49')](_0x103d48[_0x890d('0x44')],qs['fields'](_0x27b01a['query'][_0x890d('0x4a')]));_0x30bb0c[_0x890d('0x48')]=_0x30bb0c[_0x890d('0x48')][_0x890d('0x4b')]?_0x30bb0c[_0x890d('0x48')]:_0x103d48['model'];_0x30bb0c['order']=qs[_0x890d('0x4f')](_0x27b01a[_0x890d('0x45')][_0x890d('0x4f')]);_0x30bb0c[_0x890d('0x50')]=qs['filters'](_[_0x890d('0x51')](_0x27b01a[_0x890d('0x45')],_0x103d48['filters']));if(_0x27b01a[_0x890d('0x45')][_0x890d('0x52')]){_0x30bb0c[_0x890d('0x50')]=_[_0x890d('0x53')](_0x30bb0c[_0x890d('0x50')],{'$or':_[_0x890d('0x40')](_0x30bb0c[_0x890d('0x48')],function(_0x6528ec){var _0x40ab30={};_0x40ab30[_0x6528ec]={'$like':'%'+_0x27b01a[_0x890d('0x45')][_0x890d('0x52')]+'%'};return _0x40ab30;})});}_0x30bb0c=_['merge']({},_0x30bb0c,_0x27b01a[_0x890d('0x55')]);return _0x1645d2[_0x890d('0x82')](_0x30bb0c);}})[_0x890d('0x21')](function(_0x3d1dd1){if(_0x3d1dd1){_0x645165=_0x3d1dd1[_0x890d('0x4b')];if(!_0x27b01a['query']['hasOwnProperty']('nolimit')){_0x30bb0c[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x27b01a['query'][_0x890d('0x2f')]);_0x30bb0c['offset']=qs[_0x890d('0x2e')](_0x27b01a[_0x890d('0x45')][_0x890d('0x2e')]);}return _0x1645d2[_0x890d('0x82')](_0x30bb0c);}})[_0x890d('0x21')](function(_0x584cb2){if(_0x584cb2){return _0x584cb2?{'count':_0x645165,'rows':_0x584cb2}:null;}})[_0x890d('0x21')](respondWithResult(_0x311963,null))[_0x890d('0x29')](handleError(_0x311963,null));};function Extension(_0x5a7ed4,_0x441af6,_0x31cd07,_0x3055bf){this[_0x890d('0x83')]=_0x890d('0x84');this[_0x890d('0x85')]=_0x5a7ed4[_0x890d('0x86')];this['app']=_0x3055bf;this['type']=_0x890d('0x87');this[_0x890d('0x88')]=_0x890d('0x89');this[_0x890d('0x66')]=_0x5a7ed4['id'];this['priority']=_0x441af6;this[_0x890d('0x8a')]=_0x31cd07;}function createExtensionsReciveFax(_0x3b3417){var _0x1fd7f5=0x1;var _0x2faaff=[];_0x2faaff['push'](new Extension(_0x3b3417,_0x1fd7f5,'',_0x890d('0x8b')));_0x1fd7f5+=0x1;_0x2faaff[_0x890d('0x8c')](new Extension(_0x3b3417,_0x1fd7f5,_0x890d('0x8d'),_0x890d('0x8e')));_0x1fd7f5+=0x1;for(var _0x382852 in _0x3b3417){if(_0x3b3417['hasOwnProperty'](_0x382852)&&(_0x382852==='ecm'||_0x382852===_0x890d('0x86')||_0x382852===_0x890d('0x8f')||_0x382852==='faxdetect'||_0x382852==='headerinfo'||_0x382852===_0x890d('0x90')||_0x382852===_0x890d('0x91')||_0x382852===_0x890d('0x92')||_0x382852===_0x890d('0x93'))){_0x2faaff[_0x890d('0x8c')](new Extension(_0x3b3417,_0x1fd7f5,_0x890d('0x94')+_0x382852+')='+_0x3b3417[_0x382852],_0x890d('0x8e')));_0x1fd7f5+=0x1;}}_0x2faaff[_0x890d('0x8c')](new Extension(_0x3b3417,_0x1fd7f5,'6','Wait'));_0x1fd7f5+=0x1;_0x2faaff['push'](new Extension(_0x3b3417,_0x1fd7f5,_0x890d('0x95'),_0x890d('0x96')));_0x1fd7f5=0x0;return _0x2faaff;}exports[_0x890d('0x97')]=function(_0x6166c,_0x1370bc,_0x5dacb9){var _0x2be15c;return db[_0x890d('0x7d')]['transaction'](function(_0x5f4265){return db['FaxAccount'][_0x890d('0x5c')](_0x6166c['body'],{'transaction':_0x5f4265})[_0x890d('0x21')](function(_0x5066aa){_0x2be15c=_0x5066aa[_0x890d('0x37')]({'plain':!![]});return db[_0x890d('0x98')][_0x890d('0x99')](createExtensionsReciveFax(_0x2be15c),{'transaction':_0x5f4265});});})[_0x890d('0x21')](function(){return _0x2be15c;})[_0x890d('0x21')](respondWithResult(_0x1370bc,null))[_0x890d('0x29')](handleError(_0x1370bc,null));};exports[_0x890d('0x9a')]=function(_0x345581,_0x18f6b8,_0x3844a8){var _0x206f34;return db[_0x890d('0x7d')][_0x890d('0x7e')](function(_0x5bd719){return db[_0x890d('0x41')][_0x890d('0x35')](_0x345581[_0x890d('0x62')],{'where':{'id':_0x345581['body']['id']},'transaction':_0x5bd719})[_0x890d('0x21')](function(_0x5e0b0c){return db[_0x890d('0x98')]['destroy']({'where':{'FaxAccountId':_0x345581[_0x890d('0x62')]['id']},'transaction':_0x5bd719})[_0x890d('0x21')](function(_0x34c23c){return db[_0x890d('0x98')][_0x890d('0x99')](createExtensionsReciveFax(_[_0x890d('0x72')](_0x345581['body'],[_0x890d('0x9b'),_0x890d('0x43'),_0x890d('0x9c'),_0x890d('0x9d'),_0x890d('0x9e'),'ListId'])),{'transaction':_0x5bd719});});});})[_0x890d('0x21')](function(){return db['FaxAccount'][_0x890d('0x9f')](_0x345581[_0x890d('0x62')]['id']);})['then'](respondWithResult(_0x18f6b8,null))[_0x890d('0x29')](handleError(_0x18f6b8,null));};exports[_0x890d('0xa0')]=function(_0x2eae95,_0x41d831,_0x599ebf){var _0x5382ca={'raw':!![],'where':{}};var _0x51a798={};var _0x19338b={'count':0x0,'rows':[]};return db['FaxAccount'][_0x890d('0x6e')]({'where':{'id':_0x2eae95[_0x890d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x41d831,null))['then'](function(_0x10729c){if(_0x10729c){_0x51a798[_0x890d('0x44')]=_['keys'](db['FaxMessage'][_0x890d('0x5b')]);_0x51a798[_0x890d('0x45')]=_[_0x890d('0x46')](_0x2eae95[_0x890d('0x45')]);_0x51a798[_0x890d('0x47')]=_[_0x890d('0x49')](_0x51a798[_0x890d('0x44')],_0x51a798[_0x890d('0x45')]);_0x5382ca[_0x890d('0x48')]=_[_0x890d('0x49')](_0x51a798[_0x890d('0x44')],qs[_0x890d('0x4a')](_0x2eae95['query'][_0x890d('0x4a')]));_0x5382ca['attributes']=_0x5382ca[_0x890d('0x48')]['length']?_0x5382ca['attributes']:_0x51a798[_0x890d('0x44')];if(!_0x2eae95[_0x890d('0x45')]['hasOwnProperty'](_0x890d('0x4d'))){_0x5382ca[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x2eae95[_0x890d('0x45')][_0x890d('0x2f')]);_0x5382ca[_0x890d('0x2e')]=qs[_0x890d('0x2e')](_0x2eae95[_0x890d('0x45')][_0x890d('0x2e')]);}_0x5382ca[_0x890d('0x4e')]=qs[_0x890d('0x4f')](_0x2eae95[_0x890d('0x45')][_0x890d('0x4f')]);_0x5382ca[_0x890d('0x50')]=qs[_0x890d('0x47')](_[_0x890d('0x51')](_0x2eae95[_0x890d('0x45')],_0x51a798['filters']));_0x5382ca[_0x890d('0x50')][_0x890d('0x66')]=_0x10729c['id'];if(_0x2eae95['query'][_0x890d('0x52')]){_0x5382ca[_0x890d('0x50')]=_['merge'](_0x5382ca[_0x890d('0x50')],{'$or':_[_0x890d('0x40')](_0x5382ca[_0x890d('0x48')],function(_0x2b703d){var _0xf65ade={};_0xf65ade[_0x2b703d]={'$like':'%'+_0x2eae95['query'][_0x890d('0x52')]+'%'};return _0xf65ade;})});}if(_0x2eae95[_0x890d('0x45')][_0x890d('0xa1')]){var _0x347b74=_0x2eae95['query']['$gte'][_0x890d('0xa2')](',');var _0xc16704={};_0xc16704[_0x347b74[0x0]]={'$gte':moment(_0x347b74[0x1])[_0x890d('0xa3')](_0x890d('0xa4'))};_0x5382ca[_0x890d('0x50')]=_[_0x890d('0x53')](_0x5382ca[_0x890d('0x50')],_0xc16704);}_0x5382ca=_['merge']({},_0x5382ca,_0x2eae95['options']);return db[_0x890d('0xa5')][_0x890d('0x30')]({'where':_0x5382ca['where']})[_0x890d('0x21')](function(_0x34542a){_0x19338b[_0x890d('0x30')]=_0x34542a;if(_0x2eae95['query']['includeAll']){_0x5382ca[_0x890d('0x57')]=[{'all':!![]}];}return db[_0x890d('0xa5')]['findAll'](_0x5382ca);})['then'](function(_0x3d8e55){_0x19338b[_0x890d('0x59')]=_0x3d8e55;return _0x19338b;});}})[_0x890d('0x21')](respondWithFilteredResult(_0x41d831,_0x5382ca))[_0x890d('0x29')](handleError(_0x41d831,null));};exports[_0x890d('0x3c')]=function(_0x29f255,_0x11a9cc,_0x3422ac){var _0x16fd4d,_0x1e0954={},_0x2a3dc2;if(_0x29f255[_0x890d('0x62')]['to']){_0x2a3dc2=_0x29f255[_0x890d('0x62')]['to'][0x0];}return db['FaxAccount'][_0x890d('0x63')]({'where':{'id':_0x29f255['params']['id']},'include':[{'model':db[_0x890d('0xa6')],'as':'List','include':[{'model':db[_0x890d('0xa7')],'as':_0x890d('0xa8'),'where':{'fax':_0x2a3dc2},'limit':0x1,'order':[[_0x890d('0x9d'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x11a9cc,null))['then'](function(_0x3898c0){_0x16fd4d=_0x3898c0;if(_0x29f255[_0x890d('0x62')][_0x890d('0xa9')]&&_0x29f255['body'][_0x890d('0xa9')][_0x890d('0x4b')]){for(var _0x21d105=0x0;_0x21d105<_0x29f255[_0x890d('0x62')]['attachments']['length'];_0x21d105+=0x1){_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][_0x21d105]={'filename':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][_0x21d105][_0x890d('0x3b')],'id':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][_0x21d105]['id'],'path':path[_0x890d('0xaa')](config[_0x890d('0xab')],_0x890d('0xac'),_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][_0x21d105]['basename'])};}}return respondWithRpcPromise(_0x890d('0xad'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x29f255[_0x890d('0x5a')]['id'])?undefined:_0x29f255[_0x890d('0x5a')]['id'],'path':_['isNil'](_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0][_0x890d('0x8')])?undefined:_0x29f255['body']['attachments'][0x0][_0x890d('0x8')],'fax':_[_0x890d('0xae')](_0x29f255[_0x890d('0x62')]['to'][0x0])?undefined:_0x29f255[_0x890d('0x62')]['to'][0x0]},client9002);})[_0x890d('0x21')](function(){if(_0x16fd4d){if(_[_0x890d('0xae')](_0x29f255[_0x890d('0x62')][_0x890d('0xaf')])){_0x29f255[_0x890d('0x62')][_0x890d('0xaf')]=util['format']('\x22%s\x22\x20<%s>',_0x16fd4d[_0x890d('0x3b')],_0x16fd4d[_0x890d('0xb0')]);}if(_0x16fd4d['List']){if(_0x16fd4d[_0x890d('0xb1')][_0x890d('0xa8')][_0x890d('0x4b')]){return _0x16fd4d[_0x890d('0xb1')][_0x890d('0xa8')][0x0];}else{return db[_0x890d('0xa7')][_0x890d('0x5c')](_['defaults'](_0x29f255[_0x890d('0x62')],{'firstName':_0x29f255[_0x890d('0x62')]['to'][0x0],'phone':_0x29f255[_0x890d('0x62')]['to'][0x0],'fax':_0x29f255['body']['to'][0x0],'ListId':_0x16fd4d['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x890d('0xb2'));}})[_0x890d('0x21')](function(_0x22d0a8){if(_0x22d0a8){return db['FaxInteraction'][_0x890d('0x63')]({'where':{'ContactId':_0x22d0a8['id'],'closed':![],'FaxAccountId':_0x16fd4d['id']}})[_0x890d('0x21')](function(_0xb31bf3){if(_0xb31bf3){return[_0xb31bf3,![]];}return db[_0x890d('0x71')]['create']({'UserId':_0x29f255[_0x890d('0x5d')]['id'],'ContactId':_0x22d0a8['id'],'FaxAccountId':_0x16fd4d['id'],'fax':_0x29f255['body']['to'][0x0],'firstMsgDirection':_0x890d('0xb3'),'Messages':[_[_0x890d('0x53')](_0x29f255[_0x890d('0x62')],{'read':![],'body':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0][_0x890d('0xb4')],'FaxAccountId':_0x16fd4d['id'],'UserId':_0x29f255[_0x890d('0x5d')]['id'],'ContactId':_0x22d0a8['id'],'AttachmentId':_0x29f255['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x890d('0xa5')],'as':_0x890d('0xb5')}]})[_0x890d('0x21')](function(_0x108ed0){return[_0x108ed0,!![]];});});}else{throw new Error(_0x890d('0xb6'));}})[_0x890d('0xb7')](function(_0x358900,_0x3fdcd9){if(_0x3fdcd9){return _0x358900;}return db['FaxMessage'][_0x890d('0x5c')]({'direction':_0x890d('0xb3'),'read':![],'body':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0]['filename'],'FaxAccountId':_0x16fd4d['id'],'FaxInteractionId':_0x358900['id'],'UserId':_0x29f255[_0x890d('0x5d')]['id'],'ContactId':_0x358900[_0x890d('0xb8')],'AttachmentId':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0]['id']})['then'](function(_0x4bd969){_0x358900[_0x890d('0xb9')]['Messages']=[];_0x358900[_0x890d('0xb9')][_0x890d('0xb5')][_0x890d('0x8c')](_0x4bd969[_0x890d('0xb9')]);return _0x358900;});})[_0x890d('0x21')](function(_0x52a25d){respondWithRpcPromise(_0x890d('0xba'),'SendFax',{'FaxAccountId':_[_0x890d('0xae')](_0x29f255[_0x890d('0x5a')]['id'])?undefined:_0x29f255[_0x890d('0x5a')]['id'],'path':_[_0x890d('0xae')](_0x29f255[_0x890d('0x62')]['attachments'][0x0]['path'])?undefined:_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0]['path'],'fax':_[_0x890d('0xae')](_0x29f255[_0x890d('0x62')]['to'][0x0])?undefined:_0x29f255[_0x890d('0x62')]['to'][0x0],'AttachmentId':_0x29f255[_0x890d('0x62')][_0x890d('0xa9')][0x0]['id']},client9002)[_0x890d('0x21')](function(_0x22fb18){logger[_0x890d('0x22')](_0x890d('0xbb'),_0x22fb18);})[_0x890d('0x29')](function(_0x1b303d){logger['info'](_0x890d('0xbb'),_0x1b303d);});return _0x52a25d;})[_0x890d('0x21')](respondWithResult(_0x11a9cc,null))[_0x890d('0x29')](handleError(_0x11a9cc,null));};exports[_0x890d('0xbc')]=function(_0x2bfe9c,_0x1c39ca,_0x282c26){return db['FaxAccount'][_0x890d('0x63')]({'where':{'id':_0x2bfe9c[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x1c39ca,null))[_0x890d('0x21')](function(_0x39d43c){if(_0x39d43c){return _0x39d43c[_0x890d('0xbc')](_0x2bfe9c['body'][_0x890d('0x6a')],_['omit'](_0x2bfe9c['body'],[_0x890d('0x6a'),'id'])||{})['spread'](function(_0x1e50c8){for(var _0x5ab4e2=0x0;_0x5ab4e2<_0x2bfe9c[_0x890d('0x62')]['ids']['length'];_0x5ab4e2+=0x1){socket[_0x890d('0xbd')]('userFaxAccount:save',{'UserId':Number(_0x2bfe9c['body'][_0x890d('0x6a')][_0x5ab4e2]),'FaxAccountId':Number(_0x2bfe9c[_0x890d('0x5a')]['id'])});}return _0x1e50c8;});}})[_0x890d('0x21')](respondWithResult(_0x1c39ca,null))['catch'](handleError(_0x1c39ca,null));};exports['removeAgents']=function(_0x314cda,_0x5ab2d9,_0x504c73){return db[_0x890d('0x41')][_0x890d('0x63')]({'where':{'id':_0x314cda[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x5ab2d9,null))[_0x890d('0x21')](function(_0x393fa7){if(_0x393fa7){return _0x393fa7['removeAgents'](_0x314cda[_0x890d('0x45')][_0x890d('0x6a')])['then'](function(){if(_[_0x890d('0xbe')](_0x314cda['query'][_0x890d('0x6a')])){for(var _0x2d1d1b=0x0;_0x2d1d1b<_0x314cda[_0x890d('0x45')][_0x890d('0x6a')][_0x890d('0x4b')];_0x2d1d1b+=0x1){socket[_0x890d('0xbd')](_0x890d('0xbf'),{'UserId':Number(_0x314cda[_0x890d('0x45')][_0x890d('0x6a')][_0x2d1d1b]),'FaxAccountId':Number(_0x314cda[_0x890d('0x5a')]['id'])});}}else{socket[_0x890d('0xbd')](_0x890d('0xbf'),{'UserId':Number(_0x314cda[_0x890d('0x45')][_0x890d('0x6a')]),'FaxAccountId':Number(_0x314cda[_0x890d('0x5a')]['id'])});}});}})[_0x890d('0x21')](respondWithStatusCode(_0x5ab2d9,null))[_0x890d('0x29')](handleError(_0x5ab2d9,null));};exports['getAgents']=function(_0x4aa9c4,_0x38911c,_0xf0c023){var _0x167c71={};var _0x3cf265={};var _0x1478c9;var _0x123075;return db[_0x890d('0x41')][_0x890d('0x6e')]({'where':{'id':_0x4aa9c4[_0x890d('0x5a')]['id']}})[_0x890d('0x21')](handleEntityNotFound(_0x38911c,null))[_0x890d('0x21')](function(_0x5dc779){if(_0x5dc779){_0x1478c9=_0x5dc779;_0x3cf265[_0x890d('0x44')]=_[_0x890d('0x46')](db[_0x890d('0x74')]['rawAttributes']);_0x3cf265[_0x890d('0x45')]=_['keys'](_0x4aa9c4['query']);_0x3cf265[_0x890d('0x47')]=_['intersection'](_0x3cf265['model'],_0x3cf265[_0x890d('0x45')]);_0x167c71[_0x890d('0x48')]=_['intersection'](_0x3cf265[_0x890d('0x44')],qs['fields'](_0x4aa9c4[_0x890d('0x45')][_0x890d('0x4a')]));_0x167c71['attributes']=_0x167c71['attributes'][_0x890d('0x4b')]?_0x167c71['attributes']:_0x3cf265[_0x890d('0x44')];_0x167c71[_0x890d('0x4e')]=qs[_0x890d('0x4f')](_0x4aa9c4[_0x890d('0x45')][_0x890d('0x4f')]);_0x167c71[_0x890d('0x50')]=qs['filters'](_['pick'](_0x4aa9c4['query'],_0x3cf265[_0x890d('0x47')]));if(_0x4aa9c4[_0x890d('0x45')][_0x890d('0x52')]){_0x167c71[_0x890d('0x50')]=_[_0x890d('0x53')](_0x167c71['where'],{'$or':_[_0x890d('0x40')](_0x167c71[_0x890d('0x48')],function(_0x50b671){var _0x79ae8f={};_0x79ae8f[_0x50b671]={'$like':'%'+_0x4aa9c4[_0x890d('0x45')][_0x890d('0x52')]+'%'};return _0x79ae8f;})});}_0x167c71=_[_0x890d('0x53')]({},_0x167c71,_0x4aa9c4[_0x890d('0x55')]);return _0x1478c9[_0x890d('0xc0')](_0x167c71);}})['then'](function(_0x3457c3){if(_0x3457c3){_0x123075=_0x3457c3[_0x890d('0x4b')];if(!_0x4aa9c4['query'][_0x890d('0x4c')](_0x890d('0x4d'))){_0x167c71[_0x890d('0x2f')]=qs[_0x890d('0x2f')](_0x4aa9c4[_0x890d('0x45')][_0x890d('0x2f')]);_0x167c71[_0x890d('0x2e')]=qs[_0x890d('0x2e')](_0x4aa9c4[_0x890d('0x45')]['offset']);}return _0x1478c9[_0x890d('0xc0')](_0x167c71);}})[_0x890d('0x21')](function(_0x40cd4e){if(_0x40cd4e){return _0x40cd4e?{'count':_0x123075,'rows':_0x40cd4e}:null;}})[_0x890d('0x21')](respondWithResult(_0x38911c,null))['catch'](handleError(_0x38911c,null));};
\ No newline at end of file
+var _0x2b43=['join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','Messages','spread','out','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','isArray','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','ids','omit','getInteractions','CmContact','Contact','Owner','fullname','Tag','Tags','color','tag','addApplications','FaxApplication','getApplications','context','exten','localstationid','app','system','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','minrate','modem','t38timeout','FAXOPT(','Set','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','sequelize','transaction','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','ListId','findById','getMessages','$gte','format','FaxMessage','CmList','List','attachments'];(function(_0x534830,_0x165f6a){var _0x124cf4=function(_0x1c72cc){while(--_0x1c72cc){_0x534830['push'](_0x534830['shift']());}};_0x124cf4(++_0x165f6a);}(_0x2b43,0xd4));var _0x32b4=function(_0x23570f,_0x50c9ce){_0x23570f=_0x23570f-0x0;var _0x538419=_0x2b43[_0x23570f];return _0x538419;};'use strict';var emlformat=require(_0x32b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32b4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b4('0x2'));var moment=require(_0x32b4('0x3'));var BPromise=require(_0x32b4('0x4'));var Mustache=require(_0x32b4('0x5'));var util=require(_0x32b4('0x6'));var path=require(_0x32b4('0x7'));var sox=require(_0x32b4('0x8'));var csv=require(_0x32b4('0x9'));var ejs=require(_0x32b4('0xa'));var fs=require('fs');var fs_extra=require(_0x32b4('0xb'));var _=require(_0x32b4('0xc'));var squel=require(_0x32b4('0xd'));var crypto=require(_0x32b4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x32b4('0x9'));var querystring=require('querystring');var Papa=require(_0x32b4('0xf'));var Redis=require(_0x32b4('0x10'));var authService=require(_0x32b4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x32b4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32b4('0x13'))('api');var utils=require(_0x32b4('0x14'));var config=require(_0x32b4('0x15'));var licenseUtil=require(_0x32b4('0x16'));var db=require(_0x32b4('0x17'))['db'];config[_0x32b4('0x18')]=_[_0x32b4('0x19')](config['redis'],{'host':_0x32b4('0x1a'),'port':0x18eb});var socket=require(_0x32b4('0x1b'))(new Redis(config['redis']));require(_0x32b4('0x1c'))['register'](socket);var jayson=require(_0x32b4('0x1d'));var client=jayson['client'][_0x32b4('0x1e')]({'port':0x232c});var client9002=jayson[_0x32b4('0x1f')][_0x32b4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3a7dff,_0x2b3a44,_0x4360e0,_0x4a9180){return new BPromise(function(_0x184b1c,_0x16b7a4){var _0x424c41=_0x4a9180||client;return _0x424c41['request'](_0x3a7dff,_0x4360e0)[_0x32b4('0x20')](function(_0x13cc73){logger[_0x32b4('0x21')](_0x32b4('0x22'),_0x2b3a44,_0x32b4('0x23'));logger[_0x32b4('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2b3a44,_0x32b4('0x23'),JSON['stringify'](_0x13cc73));if(_0x13cc73[_0x32b4('0x25')]){if(_0x13cc73[_0x32b4('0x25')][_0x32b4('0x26')]===0x1f4){logger[_0x32b4('0x25')](_0x32b4('0x22'),_0x2b3a44,_0x13cc73[_0x32b4('0x25')][_0x32b4('0x27')]);return _0x16b7a4(_0x13cc73[_0x32b4('0x25')][_0x32b4('0x27')]);}logger[_0x32b4('0x25')](_0x32b4('0x22'),_0x2b3a44,_0x13cc73[_0x32b4('0x25')][_0x32b4('0x27')]);return _0x184b1c(_0x13cc73['error']['message']);}else{logger[_0x32b4('0x21')](_0x32b4('0x22'),_0x2b3a44,'request\x20sent');_0x184b1c(_0x13cc73['result']['message']);}})[_0x32b4('0x28')](function(_0x586089){logger[_0x32b4('0x25')](_0x32b4('0x22'),_0x2b3a44,_0x586089);_0x16b7a4(_0x586089);});});}function respondWithStatusCode(_0x2129fd,_0x55d0e1){_0x55d0e1=_0x55d0e1||0xcc;return function(_0xac93db){if(_0xac93db){return _0x2129fd['sendStatus'](_0x55d0e1);}return _0x2129fd['status'](_0x55d0e1)[_0x32b4('0x29')]();};}function respondWithResult(_0x599683,_0x4ff8da){_0x4ff8da=_0x4ff8da||0xc8;return function(_0x252408){if(_0x252408){return _0x599683['status'](_0x4ff8da)[_0x32b4('0x2a')](_0x252408);}};}function respondWithFilteredResult(_0x2d4224,_0x2ecfe2){return function(_0x2bc080){if(_0x2bc080){var _0x2a9233=typeof _0x2ecfe2[_0x32b4('0x2b')]===_0x32b4('0x2c')&&typeof _0x2ecfe2[_0x32b4('0x2d')]===_0x32b4('0x2c');var _0x2259cb=_0x2bc080[_0x32b4('0x2e')];var _0x193317=_0x2a9233?0x0:_0x2ecfe2[_0x32b4('0x2b')];var _0x27f4d7=_0x2a9233?_0x2bc080[_0x32b4('0x2e')]:_0x2ecfe2[_0x32b4('0x2b')]+_0x2ecfe2[_0x32b4('0x2d')];var _0x348546;if(_0x27f4d7>=_0x2259cb){_0x27f4d7=_0x2259cb;_0x348546=0xc8;}else{_0x348546=0xce;}_0x2d4224[_0x32b4('0x2f')](_0x348546);return _0x2d4224[_0x32b4('0x30')](_0x32b4('0x31'),_0x193317+'-'+_0x27f4d7+'/'+_0x2259cb)[_0x32b4('0x2a')](_0x2bc080);}return null;};}function patchUpdates(_0x3e8438){return function(_0x295488){try{jsonpatch[_0x32b4('0x32')](_0x295488,_0x3e8438,!![]);}catch(_0x2d6d4a){return BPromise[_0x32b4('0x33')](_0x2d6d4a);}return _0x295488[_0x32b4('0x34')]();};}function saveUpdates(_0x57624c,_0x8bd3fd){return function(_0xaeed57){if(_0xaeed57){return _0xaeed57['update'](_0x57624c)[_0x32b4('0x20')](function(_0x2c6be8){return _0x2c6be8;});}return null;};}function removeEntity(_0x51209c,_0x205a1e){return function(_0x381d5b){if(_0x381d5b){return _0x381d5b[_0x32b4('0x35')]()[_0x32b4('0x20')](function(){var _0x24d6b5=_0x381d5b[_0x32b4('0x36')]({'plain':!![]});var _0x491a88=_0x32b4('0x37');return db[_0x32b4('0x38')][_0x32b4('0x35')]({'where':{'type':_0x491a88,'resourceId':_0x24d6b5['id']}})[_0x32b4('0x20')](function(){return _0x381d5b;});})['then'](function(){_0x51209c[_0x32b4('0x2f')](0xcc)[_0x32b4('0x29')]();});}};}function handleEntityNotFound(_0x43b15e,_0x52e35d){return function(_0xdbc0a6){if(!_0xdbc0a6){_0x43b15e[_0x32b4('0x39')](0x194);}return _0xdbc0a6;};}function handleError(_0x11a3be,_0x2e7aba){_0x2e7aba=_0x2e7aba||0x1f4;return function(_0x3bc47a){logger[_0x32b4('0x25')](_0x3bc47a['stack']);if(_0x3bc47a['name']){delete _0x3bc47a[_0x32b4('0x3a')];}_0x11a3be[_0x32b4('0x2f')](_0x2e7aba)[_0x32b4('0x3b')](_0x3bc47a);};}exports[_0x32b4('0x3c')]=function(_0x44e356,_0x569fa0){var _0x4277a4={'include':[{'model':db[_0x32b4('0x3d')],'as':_0x32b4('0x3e')}]},_0xae154={},_0x68e690={'count':0x0,'rows':[]};var _0x58643c=_[_0x32b4('0x3f')](db[_0x32b4('0x40')]['rawAttributes'],function(_0x2a712e){return{'name':_0x2a712e[_0x32b4('0x41')],'type':_0x2a712e[_0x32b4('0x42')][_0x32b4('0x43')]};});_0xae154[_0x32b4('0x44')]=_[_0x32b4('0x3f')](_0x58643c,_0x32b4('0x3a'));_0xae154[_0x32b4('0x45')]=_['keys'](_0x44e356[_0x32b4('0x45')]);_0xae154[_0x32b4('0x46')]=_[_0x32b4('0x47')](_0xae154[_0x32b4('0x44')],_0xae154['query']);_0x4277a4['attributes']=_[_0x32b4('0x47')](_0xae154[_0x32b4('0x44')],qs[_0x32b4('0x48')](_0x44e356[_0x32b4('0x45')][_0x32b4('0x48')]));_0x4277a4[_0x32b4('0x49')]=_0x4277a4[_0x32b4('0x49')]['length']?_0x4277a4[_0x32b4('0x49')]:_0xae154[_0x32b4('0x44')];if(!_0x44e356['query']['hasOwnProperty'](_0x32b4('0x4a'))){_0x4277a4[_0x32b4('0x2d')]=qs[_0x32b4('0x2d')](_0x44e356[_0x32b4('0x45')]['limit']);_0x4277a4[_0x32b4('0x2b')]=qs[_0x32b4('0x2b')](_0x44e356[_0x32b4('0x45')][_0x32b4('0x2b')]);}_0x4277a4[_0x32b4('0x4b')]=qs['sort'](_0x44e356[_0x32b4('0x45')][_0x32b4('0x4c')]);_0x4277a4['where']=qs[_0x32b4('0x46')](_[_0x32b4('0x4d')](_0x44e356[_0x32b4('0x45')],_0xae154[_0x32b4('0x46')]),_0x58643c);if(_0x44e356[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x4277a4[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x4277a4[_0x32b4('0x4f')],{'$or':_[_0x32b4('0x3f')](_0x58643c,function(_0x15ca7f){if(_0x15ca7f['type']!==_0x32b4('0x51')){var _0x580c3e={};_0x580c3e[_0x15ca7f['name']]={'$like':'%'+_0x44e356[_0x32b4('0x45')][_0x32b4('0x4e')]+'%'};return _0x580c3e;}})});}_0x4277a4=_['merge']({},_0x4277a4,_0x44e356[_0x32b4('0x52')]);var _0x49c554={'where':_0x4277a4['where']};return db['FaxAccount']['count'](_0x49c554)[_0x32b4('0x20')](function(_0x2ca1a7){_0x68e690[_0x32b4('0x2e')]=_0x2ca1a7;if(_0x44e356[_0x32b4('0x45')][_0x32b4('0x53')]){_0x4277a4[_0x32b4('0x54')]=[{'all':!![]}];}return db[_0x32b4('0x40')][_0x32b4('0x55')](_0x4277a4);})[_0x32b4('0x20')](function(_0x464651){_0x68e690['rows']=_0x464651;return _0x68e690;})[_0x32b4('0x20')](respondWithFilteredResult(_0x569fa0,_0x4277a4))[_0x32b4('0x28')](handleError(_0x569fa0,null));};exports[_0x32b4('0x56')]=function(_0x57b1ab,_0xb1d0a0){var _0x40243f={'raw':![],'where':{'id':_0x57b1ab[_0x32b4('0x57')]['id']},'include':[{'model':db[_0x32b4('0x3d')],'as':_0x32b4('0x3e')}]},_0xeddfb2={};_0xeddfb2[_0x32b4('0x44')]=_[_0x32b4('0x58')](db['FaxAccount'][_0x32b4('0x59')]);_0xeddfb2[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x57b1ab['query']);_0xeddfb2[_0x32b4('0x46')]=_[_0x32b4('0x47')](_0xeddfb2[_0x32b4('0x44')],_0xeddfb2[_0x32b4('0x45')]);_0x40243f['attributes']=_[_0x32b4('0x47')](_0xeddfb2['model'],qs[_0x32b4('0x48')](_0x57b1ab['query'][_0x32b4('0x48')]));_0x40243f[_0x32b4('0x49')]=_0x40243f[_0x32b4('0x49')][_0x32b4('0x5a')]?_0x40243f['attributes']:_0xeddfb2['model'];if(_0x57b1ab[_0x32b4('0x45')][_0x32b4('0x53')]){_0x40243f[_0x32b4('0x54')]=[{'all':!![]}];}_0x40243f=_[_0x32b4('0x50')]({},_0x40243f,_0x57b1ab[_0x32b4('0x52')]);return db[_0x32b4('0x40')][_0x32b4('0x5b')](_0x40243f)[_0x32b4('0x20')](handleEntityNotFound(_0xb1d0a0,null))[_0x32b4('0x20')](respondWithResult(_0xb1d0a0,null))[_0x32b4('0x28')](handleError(_0xb1d0a0,null));};exports['create']=function(_0x230671,_0x474dd9){return db[_0x32b4('0x40')][_0x32b4('0x5c')](_0x230671[_0x32b4('0x5d')],{})[_0x32b4('0x20')](function(_0x1a975f){var _0x4b0be0=_0x230671[_0x32b4('0x5e')][_0x32b4('0x36')]({'plain':!![]});if(!_0x4b0be0)throw new Error(_0x32b4('0x5f'));if(_0x4b0be0['role']===_0x32b4('0x5e')){var _0x5d673f=_0x1a975f[_0x32b4('0x36')]({'plain':!![]});var _0x343890=_0x32b4('0x37');return db[_0x32b4('0x60')]['find']({'where':{'name':_0x343890,'userProfileId':_0x4b0be0['userProfileId']},'raw':!![]})['then'](function(_0x3300fb){if(_0x3300fb&&_0x3300fb[_0x32b4('0x61')]===0x0){return db[_0x32b4('0x38')][_0x32b4('0x5c')]({'name':_0x5d673f[_0x32b4('0x3a')],'resourceId':_0x5d673f['id'],'type':_0x3300fb[_0x32b4('0x3a')],'sectionId':_0x3300fb['id']},{})[_0x32b4('0x20')](function(){return _0x1a975f;});}else{return _0x1a975f;}})[_0x32b4('0x28')](function(_0x1344d5){logger[_0x32b4('0x25')](_0x32b4('0x62'),_0x1344d5);throw _0x1344d5;});}return _0x1a975f;})[_0x32b4('0x20')](respondWithResult(_0x474dd9,0xc9))[_0x32b4('0x28')](handleError(_0x474dd9,null));};exports[_0x32b4('0x63')]=function(_0x4170f5,_0x2ff5a7){if(_0x4170f5[_0x32b4('0x5d')]['id']){delete _0x4170f5[_0x32b4('0x5d')]['id'];}return db['FaxAccount'][_0x32b4('0x5b')]({'where':{'id':_0x4170f5['params']['id']},'include':[{'model':db[_0x32b4('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x32b4('0x20')](handleEntityNotFound(_0x2ff5a7,null))['then'](saveUpdates(_0x4170f5[_0x32b4('0x5d')],null))['then'](respondWithResult(_0x2ff5a7,null))[_0x32b4('0x28')](handleError(_0x2ff5a7,null));};exports[_0x32b4('0x35')]=function(_0x64d62f,_0x513125){return db[_0x32b4('0x40')]['find']({'where':{'id':_0x64d62f[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x513125,null))[_0x32b4('0x20')](removeEntity(_0x513125,null))[_0x32b4('0x28')](handleError(_0x513125,null));};exports['describe']=function(_0x403ee8,_0x591a39){return db[_0x32b4('0x40')][_0x32b4('0x64')]()['then'](respondWithResult(_0x591a39,null))[_0x32b4('0x28')](handleError(_0x591a39,null));};exports[_0x32b4('0x65')]=function(_0x44d22e,_0x302e6b,_0x1f92af){if(_0x44d22e['body']['id']){delete _0x44d22e['body']['id'];}return db[_0x32b4('0x40')][_0x32b4('0x5b')]({'where':{'id':_0x44d22e[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x302e6b,null))['then'](function(_0x24fc66){if(_0x24fc66){_0x44d22e['body'][_0x32b4('0x66')]=_0x24fc66['id'];return db['Disposition'][_0x32b4('0x5c')](_0x44d22e[_0x32b4('0x5d')]);}})['then'](respondWithResult(_0x302e6b,null))[_0x32b4('0x28')](handleError(_0x302e6b,null));};exports[_0x32b4('0x67')]=function(_0x1eccc3,_0x371327,_0x5254bb){var _0x39d0d8={'raw':![],'where':{}};var _0x27a153={};var _0x57d85={'count':0x0,'rows':[]};return db['FaxAccount'][_0x32b4('0x68')]({'where':{'id':_0x1eccc3[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x371327,null))['then'](function(_0x529461){if(_0x529461){_0x27a153[_0x32b4('0x44')]=_[_0x32b4('0x58')](db[_0x32b4('0x69')][_0x32b4('0x59')]);_0x27a153[_0x32b4('0x45')]=_['keys'](_0x1eccc3['query']);_0x27a153[_0x32b4('0x46')]=_[_0x32b4('0x47')](_0x27a153[_0x32b4('0x44')],_0x27a153[_0x32b4('0x45')]);_0x39d0d8[_0x32b4('0x49')]=_[_0x32b4('0x47')](_0x27a153[_0x32b4('0x44')],qs['fields'](_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x48')]));_0x39d0d8[_0x32b4('0x49')]=_0x39d0d8[_0x32b4('0x49')]['length']?_0x39d0d8[_0x32b4('0x49')]:_0x27a153[_0x32b4('0x44')];if(!_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x6a')](_0x32b4('0x4a'))){_0x39d0d8[_0x32b4('0x2d')]=qs['limit'](_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x2d')]);_0x39d0d8['offset']=qs[_0x32b4('0x2b')](_0x1eccc3['query']['offset']);}_0x39d0d8[_0x32b4('0x4b')]=qs['sort'](_0x1eccc3[_0x32b4('0x45')]['sort']);_0x39d0d8['where']=qs[_0x32b4('0x46')](_[_0x32b4('0x4d')](_0x1eccc3[_0x32b4('0x45')],_0x27a153['filters']));_0x39d0d8[_0x32b4('0x4f')][_0x32b4('0x66')]=_0x529461['id'];if(_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x39d0d8[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x39d0d8['where'],{'$or':_[_0x32b4('0x3f')](_0x39d0d8[_0x32b4('0x49')],function(_0xd9eb69){var _0x3f712b={};_0x3f712b[_0xd9eb69]={'$like':'%'+_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x4e')]+'%'};return _0x3f712b;})});}_0x39d0d8=_['merge']({},_0x39d0d8,_0x1eccc3[_0x32b4('0x52')]);return db[_0x32b4('0x69')][_0x32b4('0x2e')]({'where':_0x39d0d8[_0x32b4('0x4f')]})[_0x32b4('0x20')](function(_0x5eb05a){_0x57d85[_0x32b4('0x2e')]=_0x5eb05a;if(_0x1eccc3[_0x32b4('0x45')][_0x32b4('0x53')]){_0x39d0d8['include']=[{'all':!![]}];}return db[_0x32b4('0x69')][_0x32b4('0x55')](_0x39d0d8);})['then'](function(_0x5e14bd){_0x57d85[_0x32b4('0x6b')]=_0x5e14bd;return _0x57d85;});}})[_0x32b4('0x20')](respondWithFilteredResult(_0x371327,_0x39d0d8))[_0x32b4('0x28')](handleError(_0x371327,null));};exports[_0x32b4('0x6c')]=function(_0x1212f0,_0x53a8eb,_0x4a26b1){return db[_0x32b4('0x40')][_0x32b4('0x5b')]({'where':{'id':_0x1212f0[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x53a8eb,null))[_0x32b4('0x20')](function(_0x1a2111){if(_0x1a2111){return _0x1a2111[_0x32b4('0x6c')](_0x1212f0[_0x32b4('0x45')]['ids']);}})[_0x32b4('0x20')](respondWithStatusCode(_0x53a8eb,null))['catch'](handleError(_0x53a8eb,null));};exports[_0x32b4('0x6d')]=function(_0x57674c,_0x5eb46,_0x2ecfd5){if(_0x57674c[_0x32b4('0x5d')]['id']){delete _0x57674c['body']['id'];}return db['FaxAccount'][_0x32b4('0x5b')]({'where':{'id':_0x57674c['params']['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x5eb46,null))[_0x32b4('0x20')](function(_0x4f98f4){if(_0x4f98f4){_0x57674c['body'][_0x32b4('0x66')]=_0x4f98f4['id'];return db[_0x32b4('0x6e')][_0x32b4('0x5c')](_0x57674c[_0x32b4('0x5d')]);}})['then'](respondWithResult(_0x5eb46,null))['catch'](handleError(_0x5eb46,null));};exports['getAnswers']=function(_0x2c86bf,_0x5c434e,_0x28d04f){var _0x200507={'raw':![],'where':{}};var _0x474d64={};var _0x58adde={'count':0x0,'rows':[]};return db[_0x32b4('0x40')][_0x32b4('0x68')]({'where':{'id':_0x2c86bf[_0x32b4('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c434e,null))[_0x32b4('0x20')](function(_0x10e8c6){if(_0x10e8c6){_0x474d64[_0x32b4('0x44')]=_[_0x32b4('0x58')](db[_0x32b4('0x6e')][_0x32b4('0x59')]);_0x474d64[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x2c86bf[_0x32b4('0x45')]);_0x474d64[_0x32b4('0x46')]=_[_0x32b4('0x47')](_0x474d64['model'],_0x474d64[_0x32b4('0x45')]);_0x200507[_0x32b4('0x49')]=_[_0x32b4('0x47')](_0x474d64[_0x32b4('0x44')],qs[_0x32b4('0x48')](_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x48')]));_0x200507[_0x32b4('0x49')]=_0x200507[_0x32b4('0x49')][_0x32b4('0x5a')]?_0x200507[_0x32b4('0x49')]:_0x474d64[_0x32b4('0x44')];if(!_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x6a')](_0x32b4('0x4a'))){_0x200507[_0x32b4('0x2d')]=qs['limit'](_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x2d')]);_0x200507['offset']=qs[_0x32b4('0x2b')](_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x2b')]);}_0x200507[_0x32b4('0x4b')]=qs['sort'](_0x2c86bf[_0x32b4('0x45')]['sort']);_0x200507[_0x32b4('0x4f')]=qs[_0x32b4('0x46')](_[_0x32b4('0x4d')](_0x2c86bf[_0x32b4('0x45')],_0x474d64[_0x32b4('0x46')]));_0x200507['where'][_0x32b4('0x66')]=_0x10e8c6['id'];if(_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x200507[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x200507['where'],{'$or':_['map'](_0x200507['attributes'],function(_0xbdf8ae){var _0x16a388={};_0x16a388[_0xbdf8ae]={'$like':'%'+_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x4e')]+'%'};return _0x16a388;})});}_0x200507=_[_0x32b4('0x50')]({},_0x200507,_0x2c86bf[_0x32b4('0x52')]);return db[_0x32b4('0x6e')][_0x32b4('0x2e')]({'where':_0x200507[_0x32b4('0x4f')]})[_0x32b4('0x20')](function(_0x55a80c){_0x58adde['count']=_0x55a80c;if(_0x2c86bf[_0x32b4('0x45')][_0x32b4('0x53')]){_0x200507[_0x32b4('0x54')]=[{'all':!![]}];}return db[_0x32b4('0x6e')][_0x32b4('0x55')](_0x200507);})['then'](function(_0x28d602){_0x58adde[_0x32b4('0x6b')]=_0x28d602;return _0x58adde;});}})[_0x32b4('0x20')](respondWithFilteredResult(_0x5c434e,_0x200507))[_0x32b4('0x28')](handleError(_0x5c434e,null));};exports[_0x32b4('0x6f')]=function(_0x4b6cf1,_0x2176b3,_0x4f2a35){return db[_0x32b4('0x40')][_0x32b4('0x5b')]({'where':{'id':_0x4b6cf1[_0x32b4('0x57')]['id']}})['then'](handleEntityNotFound(_0x2176b3,null))['then'](function(_0x518581){if(_0x518581){return _0x518581['removeAnswers'](_0x4b6cf1[_0x32b4('0x45')]['ids']);}})[_0x32b4('0x20')](respondWithStatusCode(_0x2176b3,null))[_0x32b4('0x28')](handleError(_0x2176b3,null));};exports[_0x32b4('0x70')]=function(_0x5b2533,_0x3a768a,_0x3713ef){return db[_0x32b4('0x71')][_0x32b4('0x5b')]({'where':{'id':_0x5b2533[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x3a768a,null))['then'](function(_0x3befd0){if(_0x3befd0){return _0x3befd0[_0x32b4('0x70')](_0x5b2533[_0x32b4('0x5d')][_0x32b4('0x72')],_[_0x32b4('0x73')](_0x5b2533['body'],[_0x32b4('0x72'),'id'])||{});}})[_0x32b4('0x20')](respondWithResult(_0x3a768a,null))[_0x32b4('0x28')](handleError(_0x3a768a,null));};exports[_0x32b4('0x74')]=function(_0x5586aa,_0x7cbc7c,_0x4f1b8b){var _0x3fd33d={'raw':![],'where':{}};var _0x558112={};var _0x480cc2={'count':0x0,'rows':[]};return db[_0x32b4('0x40')][_0x32b4('0x68')]({'where':{'id':_0x5586aa[_0x32b4('0x57')]['id']}})['then'](handleEntityNotFound(_0x7cbc7c,null))[_0x32b4('0x20')](function(_0x50ea3c){if(_0x50ea3c){_0x558112[_0x32b4('0x44')]=_['keys'](db[_0x32b4('0x71')][_0x32b4('0x59')]);_0x558112[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x5586aa[_0x32b4('0x45')]);_0x558112['filters']=_[_0x32b4('0x47')](_0x558112[_0x32b4('0x44')],_0x558112[_0x32b4('0x45')]);_0x3fd33d[_0x32b4('0x49')]=_[_0x32b4('0x47')](_0x558112[_0x32b4('0x44')],qs[_0x32b4('0x48')](_0x5586aa['query'][_0x32b4('0x48')]));_0x3fd33d[_0x32b4('0x49')]=_0x3fd33d[_0x32b4('0x49')][_0x32b4('0x5a')]?_0x3fd33d[_0x32b4('0x49')]:_0x558112[_0x32b4('0x44')];if(!_0x5586aa[_0x32b4('0x45')][_0x32b4('0x6a')](_0x32b4('0x4a'))){_0x3fd33d[_0x32b4('0x2d')]=qs[_0x32b4('0x2d')](_0x5586aa[_0x32b4('0x45')][_0x32b4('0x2d')]);_0x3fd33d[_0x32b4('0x2b')]=qs[_0x32b4('0x2b')](_0x5586aa[_0x32b4('0x45')][_0x32b4('0x2b')]);}_0x3fd33d[_0x32b4('0x4b')]=qs[_0x32b4('0x4c')](_0x5586aa[_0x32b4('0x45')][_0x32b4('0x4c')]);_0x3fd33d[_0x32b4('0x4f')]=qs[_0x32b4('0x46')](_['pick'](_0x5586aa['query'],_0x558112[_0x32b4('0x46')]));_0x3fd33d[_0x32b4('0x4f')][_0x32b4('0x66')]=_0x50ea3c['id'];if(_0x5586aa[_0x32b4('0x45')]['filter']){_0x3fd33d[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x3fd33d['where'],{'$or':_[_0x32b4('0x3f')](_0x3fd33d[_0x32b4('0x49')],function(_0x2d874e){var _0x2c0775={};_0x2c0775[_0x2d874e]={'$like':'%'+_0x5586aa[_0x32b4('0x45')][_0x32b4('0x4e')]+'%'};return _0x2c0775;})});}_0x3fd33d=_['merge']({},_0x3fd33d,_0x5586aa[_0x32b4('0x52')]);return db['FaxInteraction'][_0x32b4('0x2e')]({'where':_0x3fd33d['where']})[_0x32b4('0x20')](function(_0x38dde2){_0x480cc2[_0x32b4('0x2e')]=_0x38dde2;if(_0x5586aa[_0x32b4('0x45')][_0x32b4('0x53')]){_0x3fd33d[_0x32b4('0x54')]=[{'model':db[_0x32b4('0x75')],'as':_0x32b4('0x76'),'required':![]},{'model':db['User'],'as':_0x32b4('0x77'),'attributes':[_0x32b4('0x3a'),_0x32b4('0x78'),'internal'],'required':![]},{'model':db[_0x32b4('0x79')],'as':_0x32b4('0x7a'),'attributes':['id','name',_0x32b4('0x7b')],'where':_0x5586aa['query'][_0x32b4('0x7c')]?{'id':_0x5586aa[_0x32b4('0x45')][_0x32b4('0x7c')]}:undefined,'required':_0x5586aa[_0x32b4('0x45')][_0x32b4('0x7c')]?!![]:![]}];}return db[_0x32b4('0x71')][_0x32b4('0x55')](_0x3fd33d);})['then'](function(_0x26934b){_0x480cc2[_0x32b4('0x6b')]=_0x26934b;return _0x480cc2;});}})[_0x32b4('0x20')](respondWithFilteredResult(_0x7cbc7c,_0x3fd33d))[_0x32b4('0x28')](handleError(_0x7cbc7c,null));};exports[_0x32b4('0x7d')]=function(_0x44552e,_0x3f6dc3,_0x1f01dc){return db[_0x32b4('0x40')][_0x32b4('0x68')]({'where':{'id':_0x44552e[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x3f6dc3,null))[_0x32b4('0x20')](function(_0x4b0557){if(_0x4b0557){return db['sequelize']['transaction'](function(_0x57f4b1){return db[_0x32b4('0x7e')][_0x32b4('0x35')]({'where':{'FaxAccountId':_0x44552e[_0x32b4('0x57')]['id']},'transaction':_0x57f4b1})[_0x32b4('0x20')](function(_0xfeb989){var _0x488db1=_[_0x32b4('0x3f')](_0x44552e['body'],function(_0x42a9d9){_0x42a9d9[_0x32b4('0x66')]=_0x44552e[_0x32b4('0x57')]['id'];return _0x42a9d9;});return db[_0x32b4('0x7e')]['bulkCreate'](_0x488db1,{'transaction':_0x57f4b1});});})[_0x32b4('0x20')](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x44552e[_0x32b4('0x57')]['id']},'order':'priority'});});}})[_0x32b4('0x20')](respondWithResult(_0x3f6dc3,null))[_0x32b4('0x28')](handleError(_0x3f6dc3,null));};exports[_0x32b4('0x7f')]=function(_0x2a849d,_0x425ed7,_0x10fc8c){var _0x5009da={};var _0x27fa04={};var _0x112021;var _0x2285d1;return db[_0x32b4('0x40')]['findOne']({'where':{'id':_0x2a849d['params']['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x425ed7,null))[_0x32b4('0x20')](function(_0x582ede){if(_0x582ede){_0x112021=_0x582ede;_0x27fa04['model']=_[_0x32b4('0x58')](db[_0x32b4('0x7e')][_0x32b4('0x59')]);_0x27fa04[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x2a849d[_0x32b4('0x45')]);_0x27fa04['filters']=_[_0x32b4('0x47')](_0x27fa04[_0x32b4('0x44')],_0x27fa04[_0x32b4('0x45')]);_0x5009da['attributes']=_[_0x32b4('0x47')](_0x27fa04[_0x32b4('0x44')],qs['fields'](_0x2a849d['query'][_0x32b4('0x48')]));_0x5009da['attributes']=_0x5009da[_0x32b4('0x49')]['length']?_0x5009da[_0x32b4('0x49')]:_0x27fa04[_0x32b4('0x44')];_0x5009da['order']=qs[_0x32b4('0x4c')](_0x2a849d[_0x32b4('0x45')][_0x32b4('0x4c')]);_0x5009da[_0x32b4('0x4f')]=qs[_0x32b4('0x46')](_[_0x32b4('0x4d')](_0x2a849d[_0x32b4('0x45')],_0x27fa04[_0x32b4('0x46')]));if(_0x2a849d[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x5009da[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x5009da[_0x32b4('0x4f')],{'$or':_[_0x32b4('0x3f')](_0x5009da['attributes'],function(_0x34ab0e){var _0x39c042={};_0x39c042[_0x34ab0e]={'$like':'%'+_0x2a849d[_0x32b4('0x45')]['filter']+'%'};return _0x39c042;})});}_0x5009da=_['merge']({},_0x5009da,_0x2a849d[_0x32b4('0x52')]);return _0x112021[_0x32b4('0x7f')](_0x5009da);}})[_0x32b4('0x20')](function(_0x18ebe3){if(_0x18ebe3){_0x2285d1=_0x18ebe3[_0x32b4('0x5a')];if(!_0x2a849d['query'][_0x32b4('0x6a')](_0x32b4('0x4a'))){_0x5009da[_0x32b4('0x2d')]=qs[_0x32b4('0x2d')](_0x2a849d[_0x32b4('0x45')]['limit']);_0x5009da[_0x32b4('0x2b')]=qs['offset'](_0x2a849d[_0x32b4('0x45')][_0x32b4('0x2b')]);}return _0x112021[_0x32b4('0x7f')](_0x5009da);}})[_0x32b4('0x20')](function(_0x4f3236){if(_0x4f3236){return _0x4f3236?{'count':_0x2285d1,'rows':_0x4f3236}:null;}})[_0x32b4('0x20')](respondWithResult(_0x425ed7,null))[_0x32b4('0x28')](handleError(_0x425ed7,null));};function Extension(_0x177c4f,_0x31f509,_0x311777,_0x10f28b){this[_0x32b4('0x80')]='from-voip-provider';this[_0x32b4('0x81')]=_0x177c4f[_0x32b4('0x82')];this[_0x32b4('0x83')]=_0x10f28b;this[_0x32b4('0x42')]=_0x32b4('0x84');this[_0x32b4('0x85')]='Fax\x20Extension';this[_0x32b4('0x66')]=_0x177c4f['id'];this[_0x32b4('0x86')]=_0x31f509;this[_0x32b4('0x87')]=_0x311777;}function createExtensionsReciveFax(_0x3b9bc5){var _0xbb0ab5=0x1;var _0x1c8b7a=[];_0x1c8b7a[_0x32b4('0x88')](new Extension(_0x3b9bc5,_0xbb0ab5,'',_0x32b4('0x89')));_0xbb0ab5+=0x1;_0x1c8b7a[_0x32b4('0x88')](new Extension(_0x3b9bc5,_0xbb0ab5,_0x32b4('0x8a'),'Set'));_0xbb0ab5+=0x1;for(var _0x2ca709 in _0x3b9bc5){if(_0x3b9bc5[_0x32b4('0x6a')](_0x2ca709)&&(_0x2ca709==='ecm'||_0x2ca709===_0x32b4('0x82')||_0x2ca709===_0x32b4('0x8b')||_0x2ca709===_0x32b4('0x8c')||_0x2ca709==='headerinfo'||_0x2ca709==='maxrate'||_0x2ca709===_0x32b4('0x8d')||_0x2ca709===_0x32b4('0x8e')||_0x2ca709===_0x32b4('0x8f'))){_0x1c8b7a[_0x32b4('0x88')](new Extension(_0x3b9bc5,_0xbb0ab5,_0x32b4('0x90')+_0x2ca709+')='+_0x3b9bc5[_0x2ca709],_0x32b4('0x91')));_0xbb0ab5+=0x1;}}_0x1c8b7a['push'](new Extension(_0x3b9bc5,_0xbb0ab5,'6',_0x32b4('0x92')));_0xbb0ab5+=0x1;_0x1c8b7a[_0x32b4('0x88')](new Extension(_0x3b9bc5,_0xbb0ab5,_0x32b4('0x93'),_0x32b4('0x94')));_0xbb0ab5=0x0;return _0x1c8b7a;}exports[_0x32b4('0x95')]=function(_0xeb51dc,_0x4bbe4b,_0x17c15f){var _0x32ace6;return db[_0x32b4('0x96')][_0x32b4('0x97')](function(_0x4877b9){return db[_0x32b4('0x40')][_0x32b4('0x5c')](_0xeb51dc['body'],{'transaction':_0x4877b9})[_0x32b4('0x20')](function(_0x544669){_0x32ace6=_0x544669['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x32ace6),{'transaction':_0x4877b9});});})[_0x32b4('0x20')](function(){return _0x32ace6;})[_0x32b4('0x20')](respondWithResult(_0x4bbe4b,null))[_0x32b4('0x28')](handleError(_0x4bbe4b,null));};exports['updateAccountApplications']=function(_0x4d16c9,_0x574946,_0x316c2e){var _0x1cdbcf;return db[_0x32b4('0x96')][_0x32b4('0x97')](function(_0x58e614){return db[_0x32b4('0x40')][_0x32b4('0x63')](_0x4d16c9[_0x32b4('0x5d')],{'where':{'id':_0x4d16c9['body']['id']},'transaction':_0x58e614})[_0x32b4('0x20')](function(_0x1cdf2d){return db[_0x32b4('0x98')][_0x32b4('0x35')]({'where':{'FaxAccountId':_0x4d16c9[_0x32b4('0x5d')]['id']},'transaction':_0x58e614})[_0x32b4('0x20')](function(_0x4c0660){return db[_0x32b4('0x98')][_0x32b4('0x99')](createExtensionsReciveFax(_[_0x32b4('0x73')](_0x4d16c9[_0x32b4('0x5d')],[_0x32b4('0x9a'),_0x32b4('0x43'),_0x32b4('0x9b'),_0x32b4('0x9c'),'TrunkId',_0x32b4('0x9d')])),{'transaction':_0x58e614});});});})[_0x32b4('0x20')](function(){return db[_0x32b4('0x40')][_0x32b4('0x9e')](_0x4d16c9[_0x32b4('0x5d')]['id']);})[_0x32b4('0x20')](respondWithResult(_0x574946,null))[_0x32b4('0x28')](handleError(_0x574946,null));};exports[_0x32b4('0x9f')]=function(_0x53a492,_0x3b6698,_0x36a169){var _0x342df7={'raw':!![],'where':{}};var _0x28e661={};var _0x15129e={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x53a492[_0x32b4('0x57')]['id']}})['then'](handleEntityNotFound(_0x3b6698,null))[_0x32b4('0x20')](function(_0x59a4b1){if(_0x59a4b1){_0x28e661[_0x32b4('0x44')]=_['keys'](db['FaxMessage'][_0x32b4('0x59')]);_0x28e661[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x53a492['query']);_0x28e661[_0x32b4('0x46')]=_['intersection'](_0x28e661[_0x32b4('0x44')],_0x28e661[_0x32b4('0x45')]);_0x342df7[_0x32b4('0x49')]=_[_0x32b4('0x47')](_0x28e661[_0x32b4('0x44')],qs[_0x32b4('0x48')](_0x53a492[_0x32b4('0x45')]['fields']));_0x342df7[_0x32b4('0x49')]=_0x342df7[_0x32b4('0x49')]['length']?_0x342df7[_0x32b4('0x49')]:_0x28e661[_0x32b4('0x44')];if(!_0x53a492[_0x32b4('0x45')][_0x32b4('0x6a')]('nolimit')){_0x342df7[_0x32b4('0x2d')]=qs[_0x32b4('0x2d')](_0x53a492['query'][_0x32b4('0x2d')]);_0x342df7[_0x32b4('0x2b')]=qs[_0x32b4('0x2b')](_0x53a492[_0x32b4('0x45')][_0x32b4('0x2b')]);}_0x342df7['order']=qs['sort'](_0x53a492[_0x32b4('0x45')][_0x32b4('0x4c')]);_0x342df7[_0x32b4('0x4f')]=qs[_0x32b4('0x46')](_[_0x32b4('0x4d')](_0x53a492[_0x32b4('0x45')],_0x28e661[_0x32b4('0x46')]));_0x342df7['where'][_0x32b4('0x66')]=_0x59a4b1['id'];if(_0x53a492[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x342df7['where']=_[_0x32b4('0x50')](_0x342df7[_0x32b4('0x4f')],{'$or':_[_0x32b4('0x3f')](_0x342df7[_0x32b4('0x49')],function(_0x6bf52f){var _0x4147d3={};_0x4147d3[_0x6bf52f]={'$like':'%'+_0x53a492['query'][_0x32b4('0x4e')]+'%'};return _0x4147d3;})});}if(_0x53a492[_0x32b4('0x45')]['$gte']){var _0x5b2831=_0x53a492[_0x32b4('0x45')][_0x32b4('0xa0')]['split'](',');var _0x567673={};_0x567673[_0x5b2831[0x0]]={'$gte':moment(_0x5b2831[0x1])[_0x32b4('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x342df7['where']=_[_0x32b4('0x50')](_0x342df7[_0x32b4('0x4f')],_0x567673);}_0x342df7=_[_0x32b4('0x50')]({},_0x342df7,_0x53a492[_0x32b4('0x52')]);return db[_0x32b4('0xa2')]['count']({'where':_0x342df7[_0x32b4('0x4f')]})[_0x32b4('0x20')](function(_0x596b1e){_0x15129e[_0x32b4('0x2e')]=_0x596b1e;if(_0x53a492[_0x32b4('0x45')]['includeAll']){_0x342df7[_0x32b4('0x54')]=[{'all':!![]}];}return db[_0x32b4('0xa2')]['findAll'](_0x342df7);})[_0x32b4('0x20')](function(_0x4348b4){_0x15129e[_0x32b4('0x6b')]=_0x4348b4;return _0x15129e;});}})[_0x32b4('0x20')](respondWithFilteredResult(_0x3b6698,_0x342df7))[_0x32b4('0x28')](handleError(_0x3b6698,null));};exports['send']=function(_0x2aca64,_0x3680a2,_0x3ee3ef){var _0x30699b,_0x7263e1={},_0xf75672;if(_0x2aca64[_0x32b4('0x5d')]['to']){_0xf75672=_0x2aca64[_0x32b4('0x5d')]['to'][0x0];}return db[_0x32b4('0x40')][_0x32b4('0x5b')]({'where':{'id':_0x2aca64['params']['id']},'include':[{'model':db[_0x32b4('0xa3')],'as':_0x32b4('0xa4'),'include':[{'model':db[_0x32b4('0x75')],'as':'Contacts','where':{'fax':_0xf75672},'limit':0x1,'order':[[_0x32b4('0x9c'),'DESC']]}]}]})[_0x32b4('0x20')](handleEntityNotFound(_0x3680a2,null))[_0x32b4('0x20')](function(_0x5a777f){_0x30699b=_0x5a777f;if(_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')]&&_0x2aca64['body'][_0x32b4('0xa5')][_0x32b4('0x5a')]){for(var _0x542187=0x0;_0x542187<_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][_0x32b4('0x5a')];_0x542187+=0x1){_0x2aca64[_0x32b4('0x5d')]['attachments'][_0x542187]={'filename':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][_0x542187]['name'],'id':_0x2aca64['body']['attachments'][_0x542187]['id'],'path':path[_0x32b4('0xa6')](config[_0x32b4('0xa7')],_0x32b4('0xa8'),_0x2aca64[_0x32b4('0x5d')]['attachments'][_0x542187]['basename'])};}}return respondWithRpcPromise(_0x32b4('0xa9'),_0x32b4('0xa9'),{'FaxAccountId':_[_0x32b4('0xaa')](_0x2aca64[_0x32b4('0x57')]['id'])?undefined:_0x2aca64[_0x32b4('0x57')]['id'],'path':_[_0x32b4('0xaa')](_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0][_0x32b4('0x7')])?undefined:_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0][_0x32b4('0x7')],'fax':_['isNil'](_0x2aca64['body']['to'][0x0])?undefined:_0x2aca64[_0x32b4('0x5d')]['to'][0x0]},client9002);})[_0x32b4('0x20')](function(){if(_0x30699b){if(_[_0x32b4('0xaa')](_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xab')])){_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xab')]=util[_0x32b4('0xa1')]('\x22%s\x22\x20<%s>',_0x30699b['name'],_0x30699b[_0x32b4('0xac')]);}if(_0x30699b[_0x32b4('0xa4')]){if(_0x30699b[_0x32b4('0xa4')][_0x32b4('0xad')][_0x32b4('0x5a')]){return _0x30699b[_0x32b4('0xa4')]['Contacts'][0x0];}else{return db[_0x32b4('0x75')]['create'](_['defaults'](_0x2aca64[_0x32b4('0x5d')],{'firstName':_0x2aca64[_0x32b4('0x5d')]['to'][0x0],'phone':_0x2aca64['body']['to'][0x0],'fax':_0x2aca64['body']['to'][0x0],'ListId':_0x30699b['ListId']}));}}else{throw new Error(_0x32b4('0xae'));}}else{throw new Error(_0x32b4('0xaf'));}})['then'](function(_0x42f41b){if(_0x42f41b){return db[_0x32b4('0x71')][_0x32b4('0x5b')]({'where':{'ContactId':_0x42f41b['id'],'closed':![],'FaxAccountId':_0x30699b['id']}})['then'](function(_0x541e91){if(_0x541e91){return[_0x541e91,![]];}return db[_0x32b4('0x71')][_0x32b4('0x5c')]({'UserId':_0x2aca64['user']['id'],'ContactId':_0x42f41b['id'],'FaxAccountId':_0x30699b['id'],'fax':_0x2aca64[_0x32b4('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x32b4('0x50')](_0x2aca64['body'],{'read':![],'body':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0]['filename'],'FaxAccountId':_0x30699b['id'],'UserId':_0x2aca64[_0x32b4('0x5e')]['id'],'ContactId':_0x42f41b['id'],'AttachmentId':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x32b4('0xb0')}]})[_0x32b4('0x20')](function(_0x1bff20){return[_0x1bff20,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x32b4('0xb1')](function(_0x41717a,_0x2ca6b7){if(_0x2ca6b7){return _0x41717a;}return db[_0x32b4('0xa2')]['create']({'direction':_0x32b4('0xb2'),'read':![],'body':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0][_0x32b4('0xb3')],'FaxAccountId':_0x30699b['id'],'FaxInteractionId':_0x41717a['id'],'UserId':_0x2aca64[_0x32b4('0x5e')]['id'],'ContactId':_0x41717a['ContactId'],'AttachmentId':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0]['id']})[_0x32b4('0x20')](function(_0x14ac0f){_0x41717a['dataValues'][_0x32b4('0xb0')]=[];_0x41717a[_0x32b4('0xb4')][_0x32b4('0xb0')][_0x32b4('0x88')](_0x14ac0f[_0x32b4('0xb4')]);return _0x41717a;});})[_0x32b4('0x20')](function(_0x53e721){respondWithRpcPromise(_0x32b4('0xb5'),_0x32b4('0xb5'),{'FaxAccountId':_[_0x32b4('0xaa')](_0x2aca64[_0x32b4('0x57')]['id'])?undefined:_0x2aca64[_0x32b4('0x57')]['id'],'path':_[_0x32b4('0xaa')](_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0][_0x32b4('0x7')])?undefined:_0x2aca64['body']['attachments'][0x0]['path'],'fax':_[_0x32b4('0xaa')](_0x2aca64['body']['to'][0x0])?undefined:_0x2aca64[_0x32b4('0x5d')]['to'][0x0],'AttachmentId':_0x2aca64[_0x32b4('0x5d')][_0x32b4('0xa5')][0x0]['id']},client9002)[_0x32b4('0x20')](function(_0x3569ea){logger[_0x32b4('0x21')](_0x32b4('0xb6'),_0x3569ea);})['catch'](function(_0x40e691){logger[_0x32b4('0x21')](_0x32b4('0xb6'),_0x40e691);});return _0x53e721;})['then'](respondWithResult(_0x3680a2,null))[_0x32b4('0x28')](handleError(_0x3680a2,null));};exports[_0x32b4('0xb7')]=function(_0x5b43d7,_0x37106d,_0x979712){return db['FaxAccount'][_0x32b4('0x5b')]({'where':{'id':_0x5b43d7[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x37106d,null))[_0x32b4('0x20')](function(_0x4bd832){if(_0x4bd832){return _0x4bd832['addAgents'](_0x5b43d7[_0x32b4('0x5d')][_0x32b4('0x72')],_['omit'](_0x5b43d7['body'],[_0x32b4('0x72'),'id'])||{})[_0x32b4('0xb1')](function(_0x60e9b5){for(var _0x47fef5=0x0;_0x47fef5<_0x5b43d7[_0x32b4('0x5d')][_0x32b4('0x72')]['length'];_0x47fef5+=0x1){socket[_0x32b4('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x5b43d7[_0x32b4('0x5d')][_0x32b4('0x72')][_0x47fef5]),'FaxAccountId':Number(_0x5b43d7[_0x32b4('0x57')]['id'])});}return _0x60e9b5;});}})[_0x32b4('0x20')](respondWithResult(_0x37106d,null))[_0x32b4('0x28')](handleError(_0x37106d,null));};exports['removeAgents']=function(_0x6aff2a,_0x156c0b,_0x4e553a){return db[_0x32b4('0x40')][_0x32b4('0x5b')]({'where':{'id':_0x6aff2a[_0x32b4('0x57')]['id']}})[_0x32b4('0x20')](handleEntityNotFound(_0x156c0b,null))[_0x32b4('0x20')](function(_0x15f29f){if(_0x15f29f){return _0x15f29f['removeAgents'](_0x6aff2a['query'][_0x32b4('0x72')])[_0x32b4('0x20')](function(){if(_[_0x32b4('0xb9')](_0x6aff2a['query']['ids'])){for(var _0x28d549=0x0;_0x28d549<_0x6aff2a[_0x32b4('0x45')][_0x32b4('0x72')][_0x32b4('0x5a')];_0x28d549+=0x1){socket[_0x32b4('0xb8')](_0x32b4('0xba'),{'UserId':Number(_0x6aff2a['query'][_0x32b4('0x72')][_0x28d549]),'FaxAccountId':Number(_0x6aff2a[_0x32b4('0x57')]['id'])});}}else{socket[_0x32b4('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x6aff2a['query'][_0x32b4('0x72')]),'FaxAccountId':Number(_0x6aff2a[_0x32b4('0x57')]['id'])});}});}})[_0x32b4('0x20')](respondWithStatusCode(_0x156c0b,null))[_0x32b4('0x28')](handleError(_0x156c0b,null));};exports[_0x32b4('0xbb')]=function(_0x347023,_0x5a816d,_0x5f47ff){var _0x5f57d3={};var _0x46f604={};var _0x40c806;var _0x2848dd;return db[_0x32b4('0x40')]['findOne']({'where':{'id':_0x347023[_0x32b4('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a816d,null))[_0x32b4('0x20')](function(_0x59f566){if(_0x59f566){_0x40c806=_0x59f566;_0x46f604['model']=_[_0x32b4('0x58')](db[_0x32b4('0xbc')][_0x32b4('0x59')]);_0x46f604[_0x32b4('0x45')]=_[_0x32b4('0x58')](_0x347023['query']);_0x46f604[_0x32b4('0x46')]=_[_0x32b4('0x47')](_0x46f604[_0x32b4('0x44')],_0x46f604[_0x32b4('0x45')]);_0x5f57d3['attributes']=_[_0x32b4('0x47')](_0x46f604['model'],qs[_0x32b4('0x48')](_0x347023[_0x32b4('0x45')][_0x32b4('0x48')]));_0x5f57d3[_0x32b4('0x49')]=_0x5f57d3[_0x32b4('0x49')][_0x32b4('0x5a')]?_0x5f57d3[_0x32b4('0x49')]:_0x46f604[_0x32b4('0x44')];_0x5f57d3['order']=qs[_0x32b4('0x4c')](_0x347023['query'][_0x32b4('0x4c')]);_0x5f57d3['where']=qs[_0x32b4('0x46')](_['pick'](_0x347023[_0x32b4('0x45')],_0x46f604[_0x32b4('0x46')]));if(_0x347023[_0x32b4('0x45')][_0x32b4('0x4e')]){_0x5f57d3[_0x32b4('0x4f')]=_[_0x32b4('0x50')](_0x5f57d3['where'],{'$or':_[_0x32b4('0x3f')](_0x5f57d3['attributes'],function(_0x24adcd){var _0x2ecb81={};_0x2ecb81[_0x24adcd]={'$like':'%'+_0x347023['query'][_0x32b4('0x4e')]+'%'};return _0x2ecb81;})});}_0x5f57d3=_[_0x32b4('0x50')]({},_0x5f57d3,_0x347023[_0x32b4('0x52')]);return _0x40c806[_0x32b4('0xbb')](_0x5f57d3);}})['then'](function(_0x494142){if(_0x494142){_0x2848dd=_0x494142[_0x32b4('0x5a')];if(!_0x347023[_0x32b4('0x45')]['hasOwnProperty'](_0x32b4('0x4a'))){_0x5f57d3['limit']=qs[_0x32b4('0x2d')](_0x347023[_0x32b4('0x45')][_0x32b4('0x2d')]);_0x5f57d3[_0x32b4('0x2b')]=qs[_0x32b4('0x2b')](_0x347023[_0x32b4('0x45')][_0x32b4('0x2b')]);}return _0x40c806['getAgents'](_0x5f57d3);}})[_0x32b4('0x20')](function(_0x30c356){if(_0x30c356){return _0x30c356?{'count':_0x2848dd,'rows':_0x30c356}:null;}})[_0x32b4('0x20')](respondWithResult(_0x5a816d,null))['catch'](handleError(_0x5a816d,null));};
\ No newline at end of file
index aada970..4d20c4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf041=['hook','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x436eeb,_0x492ab4){var _0x329e60=function(_0x30ba50){while(--_0x30ba50){_0x436eeb['push'](_0x436eeb['shift']());}};_0x329e60(++_0x492ab4);}(_0xf041,0x1d5));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x1f04('0x0'));var FaxAccount=require(_0x1f04('0x1'))['db'][_0x1f04('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1f04('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f04('0x4'),'afterDestroy':_0x1f04('0x5')};function emitEvent(_0x279c42){return function(_0x256073,_0x38f49a,_0x44e7f4){FaxAccountEvents[_0x1f04('0x6')](_0x279c42+':'+_0x256073['id'],_0x256073);FaxAccountEvents[_0x1f04('0x6')](_0x279c42,_0x256073);_0x44e7f4(null);};}for(var e in events){if(events[_0x1f04('0x7')](e)){var event=events[e];FaxAccount[_0x1f04('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0xae3f=['remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xae3f,0x115));var _0xfae3=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xae3f[_0x307d86];return _0x361745;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xfae3('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfae3('0x1')](0x0);var events={'afterCreate':_0xfae3('0x2'),'afterUpdate':'update','afterDestroy':_0xfae3('0x3')};function emitEvent(_0x4381ba){return function(_0x39c596,_0x14afcd,_0x567461){FaxAccountEvents[_0xfae3('0x4')](_0x4381ba+':'+_0x39c596['id'],_0x39c596);FaxAccountEvents[_0xfae3('0x4')](_0x4381ba,_0x39c596);_0x567461(null);};}for(var e in events){if(events[_0xfae3('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xfae3('0x6')]=FaxAccountEvents;
\ No newline at end of file
index 35cc714..0ec7642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97bf=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x97bf,0x137));var _0xf97b=function(_0xe34e0c,_0x15a758){_0xe34e0c=_0xe34e0c-0x0;var _0x3e5435=_0x97bf[_0xe34e0c];return _0x3e5435;};'use strict';var _=require(_0xf97b('0x0'));var util=require('util');var logger=require(_0xf97b('0x1'))(_0xf97b('0x2'));var moment=require(_0xf97b('0x3'));var BPromise=require(_0xf97b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf97b('0x5'));var rimraf=require(_0xf97b('0x6'));var config=require(_0xf97b('0x7'));var attributes=require(_0xf97b('0x8'));module[_0xf97b('0x9')]=function(_0x598299,_0x38213b){return _0x598299[_0xf97b('0xa')](_0xf97b('0xb'),attributes,{'tableName':_0xf97b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x365c=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger'];(function(_0x5c97c1,_0x232635){var _0x3ebf4f=function(_0x1f7e45){while(--_0x1f7e45){_0x5c97c1['push'](_0x5c97c1['shift']());}};_0x3ebf4f(++_0x232635);}(_0x365c,0x169));var _0xc365=function(_0x347191,_0x37dd7a){_0x347191=_0x347191-0x0;var _0x3c97fa=_0x365c[_0x347191];return _0x3c97fa;};'use strict';var _=require(_0xc365('0x0'));var util=require(_0xc365('0x1'));var logger=require(_0xc365('0x2'))(_0xc365('0x3'));var moment=require(_0xc365('0x4'));var BPromise=require(_0xc365('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc365('0x6'));var rimraf=require(_0xc365('0x7'));var config=require(_0xc365('0x8'));var attributes=require('./faxAccount.attributes');module[_0xc365('0x9')]=function(_0x9346d5,_0x5cf6b3){return _0x9346d5[_0xc365('0xa')](_0xc365('0xb'),attributes,{'tableName':_0xc365('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5925aa..45a2039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe45=['FaxInteraction','Contact\x20not\x20found','get','autoclose','push','unmanaged','*,*,*,*','created','interaction','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','orderBy','priority','asc','length','create'];(function(_0x5c0e69,_0x831395){var _0x16a602=function(_0x146cab){while(--_0x146cab){_0x5c0e69['push'](_0x5c0e69['shift']());}};_0x16a602(++_0x831395);}(_0xbe45,0x1e2));var _0x5be4=function(_0x5918c3,_0x2b74da){_0x5918c3=_0x5918c3-0x0;var _0x54bd8d=_0xbe45[_0x5918c3];return _0x54bd8d;};'use strict';var _=require(_0x5be4('0x0'));var util=require(_0x5be4('0x1'));var moment=require(_0x5be4('0x2'));var BPromise=require(_0x5be4('0x3'));var rs=require(_0x5be4('0x4'));var fs=require('fs');var Redis=require(_0x5be4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5be4('0x6'));var logger=require(_0x5be4('0x7'))('rpc');var config=require(_0x5be4('0x8'));var jayson=require(_0x5be4('0x9'));var client=jayson['client'][_0x5be4('0xa')]({'port':0x232c});config[_0x5be4('0xb')]=_[_0x5be4('0xc')](config[_0x5be4('0xb')],{'host':_0x5be4('0xd'),'port':0x18eb});var socket=require(_0x5be4('0xe'))(new Redis(config[_0x5be4('0xb')]));require(_0x5be4('0xf'))[_0x5be4('0x10')](socket);function respondWithRpcPromise(_0x4f88b4,_0x2e41a2,_0x2f3a1b){return new BPromise(function(_0x4c0e99,_0x4055d6){return client[_0x5be4('0x11')](_0x4f88b4,_0x2f3a1b)[_0x5be4('0x12')](function(_0x5c14bd){logger['info'](_0x5be4('0x13'),_0x2e41a2,_0x5be4('0x14'));logger[_0x5be4('0x15')](_0x5be4('0x16'),_0x2e41a2,'request\x20sent',JSON['stringify'](_0x5c14bd));if(_0x5c14bd['error']){if(_0x5c14bd[_0x5be4('0x17')][_0x5be4('0x18')]===0x1f4){logger[_0x5be4('0x17')](_0x5be4('0x13'),_0x2e41a2,_0x5c14bd[_0x5be4('0x17')][_0x5be4('0x19')]);return _0x4055d6(_0x5c14bd[_0x5be4('0x17')][_0x5be4('0x19')]);}logger[_0x5be4('0x17')](_0x5be4('0x13'),_0x2e41a2,_0x5c14bd[_0x5be4('0x17')][_0x5be4('0x19')]);return _0x4c0e99(_0x5c14bd['error'][_0x5be4('0x19')]);}else{logger[_0x5be4('0x1a')](_0x5be4('0x13'),_0x2e41a2,_0x5be4('0x14'));_0x4c0e99(_0x5c14bd[_0x5be4('0x1b')]['message']);}})[_0x5be4('0x1c')](function(_0x291571){logger[_0x5be4('0x17')](_0x5be4('0x13'),_0x2e41a2,_0x291571);_0x4055d6(_0x291571);});});}exports[_0x5be4('0x1d')]=function(_0x47ed9e){var _0x59049d=this;return new Promise(function(_0xcde383,_0x118f56){return db[_0x5be4('0x1e')][_0x5be4('0x1f')]({'raw':_0x47ed9e[_0x5be4('0x20')]?_0x47ed9e[_0x5be4('0x20')][_0x5be4('0x21')]===undefined?!![]:![]:!![],'where':_0x47ed9e[_0x5be4('0x20')]?_0x47ed9e[_0x5be4('0x20')][_0x5be4('0x22')]||null:null,'attributes':_0x47ed9e[_0x5be4('0x20')]?_0x47ed9e[_0x5be4('0x20')][_0x5be4('0x23')]||null:null,'limit':_0x47ed9e[_0x5be4('0x20')]?_0x47ed9e['options'][_0x5be4('0x24')]||null:null,'include':_0x47ed9e['options']?_0x47ed9e['options'][_0x5be4('0x25')]?_[_0x5be4('0x26')](_0x47ed9e['options']['include'],function(_0x160a7d){return{'model':db[_0x160a7d[_0x5be4('0x27')]],'as':_0x160a7d['as'],'attributes':_0x160a7d[_0x5be4('0x23')],'include':_0x160a7d[_0x5be4('0x25')]?_[_0x5be4('0x26')](_0x160a7d['include'],function(_0xc2652b){return{'model':db[_0xc2652b[_0x5be4('0x27')]],'as':_0xc2652b['as'],'attributes':_0xc2652b[_0x5be4('0x23')],'include':_0xc2652b[_0x5be4('0x25')]?_[_0x5be4('0x26')](_0xc2652b[_0x5be4('0x25')],function(_0x1029e3){return{'model':db[_0x1029e3[_0x5be4('0x27')]],'as':_0x1029e3['as'],'attributes':_0x1029e3[_0x5be4('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa29f40){logger[_0x5be4('0x1a')](_0x5be4('0x1d'),_0x47ed9e);logger[_0x5be4('0x15')]('GetFaxAccount',_0x47ed9e,JSON[_0x5be4('0x28')](_0xa29f40));_0xcde383(_0xa29f40);})['catch'](function(_0x56badc){logger[_0x5be4('0x17')]('GetFaxAccount',_0x56badc['message'],_0x47ed9e);_0x118f56(_0x59049d[_0x5be4('0x17')](0x1f4,_0x56badc[_0x5be4('0x19')]));});});};exports[_0x5be4('0x29')]=function(_0xc3c2a8,_0x283cc8,_0x1258ef){var _0x1e602c=this;return new Promise(function(_0x372be4,_0x570d1f){var _0x2da20c={'body':_0xc3c2a8[_0x5be4('0x2a')],'channel':_0x5be4('0x2b')};var _0x5303f6=[];var _0x1082f5=[];var _0x52f29a={};return db[_0x5be4('0x2c')][_0x5be4('0x2d')]()[_0x5be4('0x12')](function(_0x46d1e){if(!_0x46d1e){throw new db[(_0x5be4('0x2e'))][(_0x5be4('0x2f'))](_0x5be4('0x30'));}_0x5303f6=_[_0x5be4('0x31')](_[_0x5be4('0x32')](_0x46d1e),[_0x5be4('0x33'),_0x5be4('0x34')]);_0x1082f5=_['difference'](_[_0x5be4('0x32')](_0x46d1e),[_0x5be4('0x33'),'updatedAt',_0x5be4('0x35'),_0x5be4('0x36')]);if(_0xc3c2a8[_0x5be4('0x2a')]['id']){delete _0xc3c2a8['body']['id'];}if(_[_0x5be4('0x37')](_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x38')])){throw new db['Sequelize'][(_0x5be4('0x2f'))](_0x5be4('0x39'));}if(_['isNil'](_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x2a')])||_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x2a')]===''){throw new db[(_0x5be4('0x2e'))][(_0x5be4('0x2f'))](_0x5be4('0x3a'));}if(_[_0x5be4('0x37')](_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x3b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1082f5);}if(!_[_0x5be4('0x3c')](_0x1082f5,_0xc3c2a8['body'][_0x5be4('0x3b')])){throw new db['Sequelize']['ValidationError'](_0x5be4('0x3d')+_0x1082f5);}_0x52f29a[_0xc3c2a8['body'][_0x5be4('0x3b')]]=_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x38')];})[_0x5be4('0x12')](function(){return db[_0x5be4('0x1e')][_0x5be4('0x3e')]({'where':{'id':_0xc3c2a8[_0x5be4('0x3f')]['id']},'include':[{'model':db[_0x5be4('0x40')],'as':_0x5be4('0x41'),'include':[{'model':db[_0x5be4('0x2c')],'as':_0x5be4('0x42'),'where':_0x52f29a,'limit':0x1,'order':[[_0x5be4('0x34'),_0x5be4('0x43')]]}]},{'model':db[_0x5be4('0x44')],'as':_0x5be4('0x45')}]});})['then'](function(_0x755668){if(_0x755668&&_0x755668[_0x5be4('0x41')]){var _0x826fe5=_0x755668['get']({'plain':!![]});_0x2da20c[_0x5be4('0x3f')]=_0x826fe5;_0x2da20c[_0x5be4('0x46')]=_0x826fe5[_0x5be4('0x45')];_0x2da20c['list']=_0x826fe5[_0x5be4('0x41')];_0x2da20c['applications']=_[_0x5be4('0x47')](_0x2da20c['applications'],[_0x5be4('0x48')],[_0x5be4('0x49')]);if(_0x2da20c[_0x5be4('0x3f')][_0x5be4('0x45')]){delete _0x2da20c[_0x5be4('0x3f')]['Applications'];}if(_0x2da20c['account'][_0x5be4('0x41')]&&_0x2da20c[_0x5be4('0x3f')][_0x5be4('0x41')]['Contacts'][_0x5be4('0x4a')]){return _0x2da20c[_0x5be4('0x3f')][_0x5be4('0x41')][_0x5be4('0x42')][0x0];}var _0x1ddf4b=_[_0x5be4('0xc')](_0xc3c2a8['body'],{'firstName':_0xc3c2a8['body'][_0x5be4('0x38')],'ListId':_0x826fe5['ListId']});_0x1ddf4b[_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x3b')]]=_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x38')];return db[_0x5be4('0x2c')][_0x5be4('0x4b')](_0x1ddf4b,{'fields':_0x5303f6,'raw':!![]});}})[_0x5be4('0x12')](function(_0x2c1388){_0x2da20c['contact']=_0x2c1388;if(_0x2c1388){var _0x538c12={'ContactId':_0x2c1388['id'],'FaxAccountId':_0xc3c2a8[_0x5be4('0x3f')]['id'],'fax':_0x2c1388[_0x5be4('0x2b')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x2c1388['id'],'closed':![],'FaxAccountId':_0xc3c2a8[_0x5be4('0x3f')]['id']}})['then'](function(_0x44bdb3){if(_0x44bdb3){return[_0x44bdb3,![]];}return db[_0x5be4('0x4c')][_0x5be4('0x4b')](_0x538c12)[_0x5be4('0x12')](function(_0x18bb14){return[_0x18bb14,!![]];});});}else{throw new Error(_0x5be4('0x4d'));}})['spread'](function(_0xc41d8c,_0x4ad2b6){var _0x37b393=_0xc41d8c[_0x5be4('0x4e')]({'plain':!![]});if(_0x4ad2b6){if(_0x2da20c['account'][_0x5be4('0x4f')]){_0x2da20c[_0x5be4('0x46')][_0x5be4('0x50')]({'id':0x0,'priority':_0x2da20c[_0x5be4('0x46')]['length']+0x1,'app':'close','appdata':_0x5be4('0x51'),'interval':_0x5be4('0x52')});}_0x37b393[_0x5be4('0x53')]=!![];}else{_0x37b393[_0x5be4('0x53')]=![];}_0x2da20c[_0x5be4('0x54')]=_0x37b393;return db['FaxMessage']['create']({'body':_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x2a')],'FaxAccountId':_0xc3c2a8[_0x5be4('0x3f')]['id'],'FaxInteractionId':_0xc41d8c['id'],'direction':'in','ContactId':_0xc41d8c['ContactId'],'AttachmentId':_0xc3c2a8[_0x5be4('0x2a')][_0x5be4('0x55')]});})[_0x5be4('0x12')](function(_0x34d57d){_0x2da20c[_0x5be4('0x19')]=_0x34d57d;if(_0x2da20c[_0x5be4('0x54')][_0x5be4('0x56')]){return db[_0x5be4('0x57')]['find']({'attributes':['id',_0x5be4('0x58')],'where':{'id':_0x2da20c[_0x5be4('0x54')][_0x5be4('0x56')]}})[_0x5be4('0x12')](function(_0x3606d6){if(_0x3606d6){_0x2da20c['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5be4('0x59'),'appdata':_0x3606d6['name']+','+(_0x2da20c['account'][_0x5be4('0x5a')]||0xa),'interval':_0x5be4('0x52')});}return respondWithRpcPromise(_0x5be4('0x5b'),_0x5be4('0x5c'),_0x2da20c);});}return respondWithRpcPromise(_0x5be4('0x5b'),_0x5be4('0x5c'),_0x2da20c);})[_0x5be4('0x12')](function(_0x37904d){_0x372be4(_0x37904d);})['catch'](function(_0x544d94){_0x570d1f(_0x1e602c[_0x5be4('0x17')](0x1f4,_0x544d94[_0x5be4('0x19')]));});});};
\ No newline at end of file
+var _0xb5d8=['include','model','attributes','map','stringify','NotifyFaxAccount','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications','get','applications','orderBy','priority','length','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','name','Start','startRouting','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetFaxAccount','FaxAccount','options','where'];(function(_0x5a979b,_0x17a473){var _0x1abd9a=function(_0x48e37c){while(--_0x48e37c){_0x5a979b['push'](_0x5a979b['shift']());}};_0x1abd9a(++_0x17a473);}(_0xb5d8,0x17c));var _0x8b5d=function(_0x271d08,_0x4449f4){_0x271d08=_0x271d08-0x0;var _0x369746=_0xb5d8[_0x271d08];return _0x369746;};'use strict';var _=require('lodash');var util=require(_0x8b5d('0x0'));var moment=require(_0x8b5d('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(_0x8b5d('0x2'));var logger=require(_0x8b5d('0x3'))(_0x8b5d('0x4'));var config=require(_0x8b5d('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b5d('0x6')]({'port':0x232c});config['redis']=_[_0x8b5d('0x7')](config[_0x8b5d('0x8')],{'host':_0x8b5d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b5d('0x8')]));require('./faxAccount.socket')[_0x8b5d('0xa')](socket);function respondWithRpcPromise(_0x39cdc6,_0x42fe9c,_0x3c4302){return new BPromise(function(_0xb16b5,_0x15755d){return client[_0x8b5d('0xb')](_0x39cdc6,_0x3c4302)[_0x8b5d('0xc')](function(_0x50c365){logger[_0x8b5d('0xd')](_0x8b5d('0xe'),_0x42fe9c,_0x8b5d('0xf'));logger[_0x8b5d('0x10')](_0x8b5d('0x11'),_0x42fe9c,_0x8b5d('0xf'),JSON['stringify'](_0x50c365));if(_0x50c365[_0x8b5d('0x12')]){if(_0x50c365['error'][_0x8b5d('0x13')]===0x1f4){logger['error'](_0x8b5d('0xe'),_0x42fe9c,_0x50c365[_0x8b5d('0x12')][_0x8b5d('0x14')]);return _0x15755d(_0x50c365[_0x8b5d('0x12')][_0x8b5d('0x14')]);}logger['error'](_0x8b5d('0xe'),_0x42fe9c,_0x50c365['error'][_0x8b5d('0x14')]);return _0xb16b5(_0x50c365[_0x8b5d('0x12')]['message']);}else{logger['info'](_0x8b5d('0xe'),_0x42fe9c,_0x8b5d('0xf'));_0xb16b5(_0x50c365['result']['message']);}})['catch'](function(_0x294ed2){logger[_0x8b5d('0x12')](_0x8b5d('0xe'),_0x42fe9c,_0x294ed2);_0x15755d(_0x294ed2);});});}exports[_0x8b5d('0x15')]=function(_0x55228d){var _0x18fe19=this;return new Promise(function(_0x1094e4,_0x5ce103){return db[_0x8b5d('0x16')]['findAll']({'raw':_0x55228d[_0x8b5d('0x17')]?_0x55228d[_0x8b5d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x55228d[_0x8b5d('0x17')]?_0x55228d[_0x8b5d('0x17')][_0x8b5d('0x18')]||null:null,'attributes':_0x55228d[_0x8b5d('0x17')]?_0x55228d[_0x8b5d('0x17')]['attributes']||null:null,'limit':_0x55228d['options']?_0x55228d['options']['limit']||null:null,'include':_0x55228d[_0x8b5d('0x17')]?_0x55228d[_0x8b5d('0x17')][_0x8b5d('0x19')]?_['map'](_0x55228d[_0x8b5d('0x17')]['include'],function(_0xe22cd0){return{'model':db[_0xe22cd0[_0x8b5d('0x1a')]],'as':_0xe22cd0['as'],'attributes':_0xe22cd0[_0x8b5d('0x1b')],'include':_0xe22cd0[_0x8b5d('0x19')]?_[_0x8b5d('0x1c')](_0xe22cd0[_0x8b5d('0x19')],function(_0x5a3180){return{'model':db[_0x5a3180[_0x8b5d('0x1a')]],'as':_0x5a3180['as'],'attributes':_0x5a3180[_0x8b5d('0x1b')],'include':_0x5a3180[_0x8b5d('0x19')]?_[_0x8b5d('0x1c')](_0x5a3180[_0x8b5d('0x19')],function(_0xca4161){return{'model':db[_0xca4161[_0x8b5d('0x1a')]],'as':_0xca4161['as'],'attributes':_0xca4161[_0x8b5d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8b5d('0xc')](function(_0x14e58b){logger['info']('GetFaxAccount',_0x55228d);logger[_0x8b5d('0x10')]('GetFaxAccount',_0x55228d,JSON[_0x8b5d('0x1d')](_0x14e58b));_0x1094e4(_0x14e58b);})['catch'](function(_0x1b8421){logger['error'](_0x8b5d('0x15'),_0x1b8421[_0x8b5d('0x14')],_0x55228d);_0x5ce103(_0x18fe19[_0x8b5d('0x12')](0x1f4,_0x1b8421[_0x8b5d('0x14')]));});});};exports[_0x8b5d('0x1e')]=function(_0x1d26bf,_0x189bea,_0x49200a){var _0x403276=this;return new Promise(function(_0x1aaf58,_0x481ee2){var _0x17784c={'body':_0x1d26bf['body'],'channel':_0x8b5d('0x1f')};var _0x2b461b=[];var _0x5ab83e=[];var _0xebf96a={};return db[_0x8b5d('0x20')][_0x8b5d('0x21')]()[_0x8b5d('0xc')](function(_0x1d5984){if(!_0x1d5984){throw new db['Sequelize'][(_0x8b5d('0x22'))](_0x8b5d('0x23'));}_0x2b461b=_['difference'](_[_0x8b5d('0x24')](_0x1d5984),[_0x8b5d('0x25'),_0x8b5d('0x26')]);_0x5ab83e=_['difference'](_[_0x8b5d('0x24')](_0x1d5984),[_0x8b5d('0x25'),_0x8b5d('0x26'),_0x8b5d('0x27'),_0x8b5d('0x28')]);if(_0x1d26bf['body']['id']){delete _0x1d26bf[_0x8b5d('0x29')]['id'];}if(_[_0x8b5d('0x2a')](_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2b')])){throw new db[(_0x8b5d('0x2c'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x8b5d('0x2a')](_0x1d26bf[_0x8b5d('0x29')]['body'])||_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x29')]===''){throw new db[(_0x8b5d('0x2c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8b5d('0x2a')](_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2d')])){throw new db[(_0x8b5d('0x2c'))]['ValidationError'](_0x8b5d('0x2e')+_0x5ab83e);}if(!_[_0x8b5d('0x2f')](_0x5ab83e,_0x1d26bf['body'][_0x8b5d('0x2d')])){throw new db[(_0x8b5d('0x2c'))]['ValidationError'](_0x8b5d('0x30')+_0x5ab83e);}_0xebf96a[_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2d')]]=_0x1d26bf[_0x8b5d('0x29')]['from'];})['then'](function(){return db[_0x8b5d('0x16')][_0x8b5d('0x31')]({'where':{'id':_0x1d26bf[_0x8b5d('0x32')]['id']},'include':[{'model':db[_0x8b5d('0x33')],'as':_0x8b5d('0x34'),'include':[{'model':db[_0x8b5d('0x20')],'as':_0x8b5d('0x35'),'where':_0xebf96a,'limit':0x1,'order':[[_0x8b5d('0x26'),_0x8b5d('0x36')]]}]},{'model':db['FaxApplication'],'as':_0x8b5d('0x37')}]});})[_0x8b5d('0xc')](function(_0x6ab315){if(_0x6ab315&&_0x6ab315[_0x8b5d('0x34')]){var _0x3ebd42=_0x6ab315[_0x8b5d('0x38')]({'plain':!![]});_0x17784c[_0x8b5d('0x32')]=_0x3ebd42;_0x17784c[_0x8b5d('0x39')]=_0x3ebd42[_0x8b5d('0x37')];_0x17784c['list']=_0x3ebd42[_0x8b5d('0x34')];_0x17784c[_0x8b5d('0x39')]=_[_0x8b5d('0x3a')](_0x17784c[_0x8b5d('0x39')],[_0x8b5d('0x3b')],['asc']);if(_0x17784c[_0x8b5d('0x32')]['Applications']){delete _0x17784c[_0x8b5d('0x32')][_0x8b5d('0x37')];}if(_0x17784c[_0x8b5d('0x32')][_0x8b5d('0x34')]&&_0x17784c['account'][_0x8b5d('0x34')][_0x8b5d('0x35')][_0x8b5d('0x3c')]){return _0x17784c['account'][_0x8b5d('0x34')]['Contacts'][0x0];}var _0x58a736=_[_0x8b5d('0x7')](_0x1d26bf[_0x8b5d('0x29')],{'firstName':_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2b')],'ListId':_0x3ebd42[_0x8b5d('0x28')]});_0x58a736[_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2d')]]=_0x1d26bf[_0x8b5d('0x29')][_0x8b5d('0x2b')];return db[_0x8b5d('0x20')]['create'](_0x58a736,{'fields':_0x2b461b,'raw':!![]});}})['then'](function(_0x1b8269){_0x17784c[_0x8b5d('0x3d')]=_0x1b8269;if(_0x1b8269){var _0x5d1888={'ContactId':_0x1b8269['id'],'FaxAccountId':_0x1d26bf['account']['id'],'fax':_0x1b8269[_0x8b5d('0x1f')]};return db[_0x8b5d('0x3e')][_0x8b5d('0x31')]({'where':{'ContactId':_0x1b8269['id'],'closed':![],'FaxAccountId':_0x1d26bf[_0x8b5d('0x32')]['id']}})['then'](function(_0x3b176c){if(_0x3b176c){return[_0x3b176c,![]];}return db[_0x8b5d('0x3e')][_0x8b5d('0x3f')](_0x5d1888)[_0x8b5d('0xc')](function(_0x150327){return[_0x150327,!![]];});});}else{throw new Error(_0x8b5d('0x40'));}})[_0x8b5d('0x41')](function(_0x42c6da,_0x163cc6){var _0x59b151=_0x42c6da[_0x8b5d('0x38')]({'plain':!![]});if(_0x163cc6){if(_0x17784c['account'][_0x8b5d('0x42')]){_0x17784c['applications']['push']({'id':0x0,'priority':_0x17784c[_0x8b5d('0x39')][_0x8b5d('0x3c')]+0x1,'app':_0x8b5d('0x43'),'appdata':'unmanaged','interval':_0x8b5d('0x44')});}_0x59b151[_0x8b5d('0x45')]=!![];}else{_0x59b151[_0x8b5d('0x45')]=![];}_0x17784c[_0x8b5d('0x46')]=_0x59b151;return db[_0x8b5d('0x47')]['create']({'body':_0x1d26bf['body'][_0x8b5d('0x29')],'FaxAccountId':_0x1d26bf[_0x8b5d('0x32')]['id'],'FaxInteractionId':_0x42c6da['id'],'direction':'in','ContactId':_0x42c6da[_0x8b5d('0x48')],'AttachmentId':_0x1d26bf['body'][_0x8b5d('0x49')]});})[_0x8b5d('0xc')](function(_0x566f0a){_0x17784c[_0x8b5d('0x14')]=_0x566f0a;if(_0x17784c[_0x8b5d('0x46')][_0x8b5d('0x4a')]){return db['User'][_0x8b5d('0x31')]({'attributes':['id','name'],'where':{'id':_0x17784c[_0x8b5d('0x46')][_0x8b5d('0x4a')]}})[_0x8b5d('0xc')](function(_0x430e57){if(_0x430e57){_0x17784c[_0x8b5d('0x39')][_0x8b5d('0x4b')]({'id':0x0,'priority':0x0,'app':_0x8b5d('0x4c'),'appdata':_0x430e57[_0x8b5d('0x4d')]+','+(_0x17784c[_0x8b5d('0x32')]['waitForTheAssignedAgent']||0xa),'interval':_0x8b5d('0x44')});}return respondWithRpcPromise(_0x8b5d('0x4e'),_0x8b5d('0x4f'),_0x17784c);});}return respondWithRpcPromise(_0x8b5d('0x4e'),_0x8b5d('0x4f'),_0x17784c);})[_0x8b5d('0xc')](function(_0x9207b2){_0x1aaf58(_0x9207b2);})[_0x8b5d('0x50')](function(_0x436e6b){_0x481ee2(_0x403276['error'](0x1f4,_0x436e6b[_0x8b5d('0x14')]));});});};
\ No newline at end of file
index e1f3dbb..d63dd90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x995d=['save','remove','update','emit','removeListener','register','length'];(function(_0x1909e1,_0x53667a){var _0x560761=function(_0x229ab2){while(--_0x229ab2){_0x1909e1['push'](_0x1909e1['shift']());}};_0x560761(++_0x53667a);}(_0x995d,0x1f1));var _0xd995=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x995d[_0x160c73];return _0xd9302;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xd995('0x0'),_0xd995('0x1'),_0xd995('0x2')];function createListener(_0x33fdee,_0xfc103d){return function(_0xbb9760){_0xfc103d[_0xd995('0x3')](_0x33fdee,_0xbb9760);};}function removeListener(_0x39f0b7,_0x2ab3e1){return function(){FaxAccountEvents[_0xd995('0x4')](_0x39f0b7,_0x2ab3e1);};}exports[_0xd995('0x5')]=function(_0xa4bb7){for(var _0x392fc5=0x0,_0x2b72bd=events[_0xd995('0x6')];_0x392fc5<_0x2b72bd;_0x392fc5++){var _0x4aee18=events[_0x392fc5];var _0x664b6c=createListener('faxAccount:'+_0x4aee18,_0xa4bb7);FaxAccountEvents['on'](_0x4aee18,_0x664b6c);}};
\ No newline at end of file
+var _0x4096=['length','faxAccount:','save','remove','update','emit','register'];(function(_0x78bdbb,_0x1ef57c){var _0x4118b4=function(_0x319ca2){while(--_0x319ca2){_0x78bdbb['push'](_0x78bdbb['shift']());}};_0x4118b4(++_0x1ef57c);}(_0x4096,0xf0));var _0x6409=function(_0x166f6f,_0x2962c8){_0x166f6f=_0x166f6f-0x0;var _0x4a960d=_0x4096[_0x166f6f];return _0x4a960d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x6409('0x0'),_0x6409('0x1'),_0x6409('0x2')];function createListener(_0x2993cb,_0x32e101){return function(_0x10173a){_0x32e101[_0x6409('0x3')](_0x2993cb,_0x10173a);};}function removeListener(_0x296859,_0x469ab8){return function(){FaxAccountEvents['removeListener'](_0x296859,_0x469ab8);};}exports[_0x6409('0x4')]=function(_0x236727){for(var _0x233283=0x0,_0x330539=events[_0x6409('0x5')];_0x233283<_0x330539;_0x233283++){var _0x541d77=events[_0x233283];var _0x44e5b4=createListener(_0x6409('0x6')+_0x541d77,_0x236727);FaxAccountEvents['on'](_0x541d77,_0x44e5b4);}};
\ No newline at end of file
index 1c68146..8ab0f3e 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(_0x517be1,_0x354331){var _0x33e557=function(_0x12d741){while(--_0x12d741){_0x517be1['push'](_0x517be1['shift']());}};_0x33e557(++_0x354331);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x224b2c,_0x271eb3){var _0x286765=function(_0x205064){while(--_0x205064){_0x224b2c['push'](_0x224b2c['shift']());}};_0x286765(++_0x271eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 dacea96..ae2fcf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aa0=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x2d0ebc,_0x4c6491){var _0x30920b=function(_0x4d5f32){while(--_0x4d5f32){_0x2d0ebc['push'](_0x2d0ebc['shift']());}};_0x30920b(++_0x4c6491);}(_0x2aa0,0x198));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x02aa('0x0'));module[_0x02aa('0x1')]={'priority':{'type':Sequelize[_0x02aa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x02aa('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x02aa('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x02aa('0x3')],'defaultValue':_0x02aa('0x5')}};
\ No newline at end of file
+var _0x95bb=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x34d6cb,_0x1ae55c){var _0x4372cb=function(_0x1a073a){while(--_0x1a073a){_0x34d6cb['push'](_0x34d6cb['shift']());}};_0x4372cb(++_0x1ae55c);}(_0x95bb,0xa8));var _0xb95b=function(_0x4fa557,_0x3aeb30){_0x4fa557=_0x4fa557-0x0;var _0x3fe5c8=_0x95bb[_0x4fa557];return _0x3fe5c8;};'use strict';var Sequelize=require(_0xb95b('0x0'));module[_0xb95b('0x1')]={'priority':{'type':Sequelize[_0xb95b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb95b('0x3')],'allowNull':![],'defaultValue':_0xb95b('0x4')},'appdata':{'type':Sequelize[_0xb95b('0x5')]()},'description':{'type':Sequelize[_0xb95b('0x3')]},'interval':{'type':Sequelize[_0xb95b('0x3')],'defaultValue':_0xb95b('0x6')}};
\ No newline at end of file
index 2216543..b34f13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc396=['reject','update','then','destroy','error','stack','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','name','options','count','includeAll','include','findAll','catch','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x13cb9d,_0x1610ae){var _0x2c80be=function(_0x40ddc1){while(--_0x40ddc1){_0x13cb9d['push'](_0x13cb9d['shift']());}};_0x2c80be(++_0x1610ae);}(_0xc396,0x1de));var _0x6c39=function(_0x339b1d,_0x45f3de){_0x339b1d=_0x339b1d-0x0;var _0x37a479=_0xc396[_0x339b1d];return _0x37a479;};'use strict';var emlformat=require(_0x6c39('0x0'));var rimraf=require(_0x6c39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c39('0x2'));var rp=require(_0x6c39('0x3'));var moment=require(_0x6c39('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c39('0x5'));var util=require(_0x6c39('0x6'));var path=require(_0x6c39('0x7'));var sox=require(_0x6c39('0x8'));var csv=require(_0x6c39('0x9'));var ejs=require(_0x6c39('0xa'));var fs=require('fs');var fs_extra=require(_0x6c39('0xb'));var _=require(_0x6c39('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6c39('0xd'));var deskjs=require(_0x6c39('0xe'));var toCsv=require(_0x6c39('0x9'));var querystring=require(_0x6c39('0xf'));var Papa=require('papaparse');var Redis=require(_0x6c39('0x10'));var authService=require(_0x6c39('0x11'));var qs=require(_0x6c39('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c39('0x13'))(_0x6c39('0x14'));var utils=require('../../config/utils');var config=require(_0x6c39('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c39('0x16'))['db'];function respondWithStatusCode(_0x4d782d,_0x34d0a8){_0x34d0a8=_0x34d0a8||0xcc;return function(_0x1e3a26){if(_0x1e3a26){return _0x4d782d[_0x6c39('0x17')](_0x34d0a8);}return _0x4d782d[_0x6c39('0x18')](_0x34d0a8)[_0x6c39('0x19')]();};}function respondWithResult(_0x5459ed,_0x3320b2){_0x3320b2=_0x3320b2||0xc8;return function(_0xe7c22c){if(_0xe7c22c){return _0x5459ed['status'](_0x3320b2)[_0x6c39('0x1a')](_0xe7c22c);}};}function respondWithFilteredResult(_0x261e49,_0x566ec6){return function(_0xf331a8){if(_0xf331a8){var _0x445a78=typeof _0x566ec6[_0x6c39('0x1b')]===_0x6c39('0x1c')&&typeof _0x566ec6[_0x6c39('0x1d')]===_0x6c39('0x1c');var _0x3dcf37=_0xf331a8['count'];var _0x41d52c=_0x445a78?0x0:_0x566ec6[_0x6c39('0x1b')];var _0x141aaf=_0x445a78?_0xf331a8['count']:_0x566ec6['offset']+_0x566ec6[_0x6c39('0x1d')];var _0x161d28;if(_0x141aaf>=_0x3dcf37){_0x141aaf=_0x3dcf37;_0x161d28=0xc8;}else{_0x161d28=0xce;}_0x261e49[_0x6c39('0x18')](_0x161d28);return _0x261e49[_0x6c39('0x1e')](_0x6c39('0x1f'),_0x41d52c+'-'+_0x141aaf+'/'+_0x3dcf37)[_0x6c39('0x1a')](_0xf331a8);}return null;};}function patchUpdates(_0x86cad2){return function(_0x44cd4f){try{jsonpatch[_0x6c39('0x20')](_0x44cd4f,_0x86cad2,!![]);}catch(_0x221bd6){return BPromise[_0x6c39('0x21')](_0x221bd6);}return _0x44cd4f['save']();};}function saveUpdates(_0x4a24b8,_0x3ea0d2){return function(_0x586e39){if(_0x586e39){return _0x586e39[_0x6c39('0x22')](_0x4a24b8)[_0x6c39('0x23')](function(_0x4d0191){return _0x4d0191;});}return null;};}function removeEntity(_0x3ea3ca,_0x3ef626){return function(_0x62732d){if(_0x62732d){return _0x62732d[_0x6c39('0x24')]()[_0x6c39('0x23')](function(){_0x3ea3ca['status'](0xcc)[_0x6c39('0x19')]();});}};}function handleEntityNotFound(_0x2574b7,_0x10cd6f){return function(_0x1f9e73){if(!_0x1f9e73){_0x2574b7[_0x6c39('0x17')](0x194);}return _0x1f9e73;};}function handleError(_0x31306e,_0x1c1983){_0x1c1983=_0x1c1983||0x1f4;return function(_0x47eef1){logger[_0x6c39('0x25')](_0x47eef1[_0x6c39('0x26')]);if(_0x47eef1['name']){delete _0x47eef1['name'];}_0x31306e[_0x6c39('0x18')](_0x1c1983)[_0x6c39('0x27')](_0x47eef1);};}exports[_0x6c39('0x28')]=function(_0x5e22d4,_0x929536){var _0x41d8b9={},_0x197438={},_0x345831={'count':0x0,'rows':[]};var _0x5571bd=_[_0x6c39('0x29')](db[_0x6c39('0x2a')][_0x6c39('0x2b')],function(_0x5cdb94){return{'name':_0x5cdb94[_0x6c39('0x2c')],'type':_0x5cdb94[_0x6c39('0x2d')][_0x6c39('0x2e')]};});_0x197438['model']=_[_0x6c39('0x29')](_0x5571bd,'name');_0x197438[_0x6c39('0x2f')]=_[_0x6c39('0x30')](_0x5e22d4['query']);_0x197438[_0x6c39('0x31')]=_[_0x6c39('0x32')](_0x197438['model'],_0x197438[_0x6c39('0x2f')]);_0x41d8b9[_0x6c39('0x33')]=_[_0x6c39('0x32')](_0x197438['model'],qs[_0x6c39('0x34')](_0x5e22d4[_0x6c39('0x2f')][_0x6c39('0x34')]));_0x41d8b9[_0x6c39('0x33')]=_0x41d8b9[_0x6c39('0x33')]['length']?_0x41d8b9[_0x6c39('0x33')]:_0x197438[_0x6c39('0x35')];if(!_0x5e22d4[_0x6c39('0x2f')][_0x6c39('0x36')](_0x6c39('0x37'))){_0x41d8b9[_0x6c39('0x1d')]=qs[_0x6c39('0x1d')](_0x5e22d4['query'][_0x6c39('0x1d')]);_0x41d8b9[_0x6c39('0x1b')]=qs[_0x6c39('0x1b')](_0x5e22d4['query'][_0x6c39('0x1b')]);}_0x41d8b9['order']=qs[_0x6c39('0x38')](_0x5e22d4[_0x6c39('0x2f')][_0x6c39('0x38')]);_0x41d8b9[_0x6c39('0x39')]=qs[_0x6c39('0x31')](_['pick'](_0x5e22d4[_0x6c39('0x2f')],_0x197438[_0x6c39('0x31')]),_0x5571bd);if(_0x5e22d4[_0x6c39('0x2f')][_0x6c39('0x3a')]){_0x41d8b9['where']=_[_0x6c39('0x3b')](_0x41d8b9[_0x6c39('0x39')],{'$or':_[_0x6c39('0x29')](_0x5571bd,function(_0x628b83){if(_0x628b83[_0x6c39('0x2d')]!==_0x6c39('0x3c')){var _0xb0e468={};_0xb0e468[_0x628b83[_0x6c39('0x3d')]]={'$like':'%'+_0x5e22d4[_0x6c39('0x2f')][_0x6c39('0x3a')]+'%'};return _0xb0e468;}})});}_0x41d8b9=_[_0x6c39('0x3b')]({},_0x41d8b9,_0x5e22d4[_0x6c39('0x3e')]);var _0x31071c={'where':_0x41d8b9[_0x6c39('0x39')]};return db[_0x6c39('0x2a')][_0x6c39('0x3f')](_0x31071c)[_0x6c39('0x23')](function(_0x1df965){_0x345831[_0x6c39('0x3f')]=_0x1df965;if(_0x5e22d4['query'][_0x6c39('0x40')]){_0x41d8b9[_0x6c39('0x41')]=[{'all':!![]}];}return db[_0x6c39('0x2a')][_0x6c39('0x42')](_0x41d8b9);})[_0x6c39('0x23')](function(_0x355c69){_0x345831['rows']=_0x355c69;return _0x345831;})[_0x6c39('0x23')](respondWithFilteredResult(_0x929536,_0x41d8b9))[_0x6c39('0x43')](handleError(_0x929536,null));};exports['show']=function(_0x582a49,_0x9625c7){var _0x3bfa81={'raw':!![],'where':{'id':_0x582a49[_0x6c39('0x44')]['id']}},_0x20880e={};_0x20880e[_0x6c39('0x35')]=_[_0x6c39('0x30')](db[_0x6c39('0x2a')]['rawAttributes']);_0x20880e[_0x6c39('0x2f')]=_[_0x6c39('0x30')](_0x582a49[_0x6c39('0x2f')]);_0x20880e[_0x6c39('0x31')]=_[_0x6c39('0x32')](_0x20880e[_0x6c39('0x35')],_0x20880e[_0x6c39('0x2f')]);_0x3bfa81['attributes']=_[_0x6c39('0x32')](_0x20880e[_0x6c39('0x35')],qs[_0x6c39('0x34')](_0x582a49['query'][_0x6c39('0x34')]));_0x3bfa81[_0x6c39('0x33')]=_0x3bfa81[_0x6c39('0x33')][_0x6c39('0x45')]?_0x3bfa81[_0x6c39('0x33')]:_0x20880e[_0x6c39('0x35')];if(_0x582a49[_0x6c39('0x2f')][_0x6c39('0x40')]){_0x3bfa81[_0x6c39('0x41')]=[{'all':!![]}];}_0x3bfa81=_['merge']({},_0x3bfa81,_0x582a49[_0x6c39('0x3e')]);return db[_0x6c39('0x2a')][_0x6c39('0x46')](_0x3bfa81)[_0x6c39('0x23')](handleEntityNotFound(_0x9625c7,null))['then'](respondWithResult(_0x9625c7,null))['catch'](handleError(_0x9625c7,null));};exports[_0x6c39('0x47')]=function(_0x3218c7,_0x3468af){return db[_0x6c39('0x2a')]['create'](_0x3218c7['body'],{})[_0x6c39('0x23')](respondWithResult(_0x3468af,0xc9))['catch'](handleError(_0x3468af,null));};exports[_0x6c39('0x22')]=function(_0x23a792,_0x4b1cf2){if(_0x23a792['body']['id']){delete _0x23a792['body']['id'];}return db[_0x6c39('0x2a')][_0x6c39('0x46')]({'where':{'id':_0x23a792[_0x6c39('0x44')]['id']}})[_0x6c39('0x23')](handleEntityNotFound(_0x4b1cf2,null))[_0x6c39('0x23')](saveUpdates(_0x23a792[_0x6c39('0x48')],null))[_0x6c39('0x23')](respondWithResult(_0x4b1cf2,null))[_0x6c39('0x43')](handleError(_0x4b1cf2,null));};exports[_0x6c39('0x24')]=function(_0x3b0a96,_0x4cc957){return db['FaxApplication'][_0x6c39('0x46')]({'where':{'id':_0x3b0a96[_0x6c39('0x44')]['id']}})[_0x6c39('0x23')](handleEntityNotFound(_0x4cc957,null))[_0x6c39('0x23')](removeEntity(_0x4cc957,null))['catch'](handleError(_0x4cc957,null));};
\ No newline at end of file
+var _0x4739=['fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','params','find','create','body','catch','update','rimraf','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','FaxApplication','rawAttributes'];(function(_0x34d533,_0x161449){var _0x4731f5=function(_0x46fbb4){while(--_0x46fbb4){_0x34d533['push'](_0x34d533['shift']());}};_0x4731f5(++_0x161449);}(_0x4739,0xaa));var _0x9473=function(_0x5bfc6c,_0x48b093){_0x5bfc6c=_0x5bfc6c-0x0;var _0x19c568=_0x4739[_0x5bfc6c];return _0x19c568;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9473('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9473('0x1'));var Mustache=require(_0x9473('0x2'));var util=require(_0x9473('0x3'));var path=require(_0x9473('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9473('0x5'));var fs=require('fs');var fs_extra=require(_0x9473('0x6'));var _=require(_0x9473('0x7'));var squel=require(_0x9473('0x8'));var crypto=require(_0x9473('0x9'));var jsforce=require(_0x9473('0xa'));var deskjs=require(_0x9473('0xb'));var toCsv=require(_0x9473('0xc'));var querystring=require(_0x9473('0xd'));var Papa=require(_0x9473('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9473('0xf'));var as=require(_0x9473('0x10'));var hardwareService=require(_0x9473('0x11'));var logger=require(_0x9473('0x12'))(_0x9473('0x13'));var utils=require(_0x9473('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9473('0x15'));var db=require(_0x9473('0x16'))['db'];function respondWithStatusCode(_0x4162d5,_0x508658){_0x508658=_0x508658||0xcc;return function(_0x3de216){if(_0x3de216){return _0x4162d5[_0x9473('0x17')](_0x508658);}return _0x4162d5[_0x9473('0x18')](_0x508658)[_0x9473('0x19')]();};}function respondWithResult(_0x47b5dc,_0x5b5270){_0x5b5270=_0x5b5270||0xc8;return function(_0x5cd0ee){if(_0x5cd0ee){return _0x47b5dc['status'](_0x5b5270)['json'](_0x5cd0ee);}};}function respondWithFilteredResult(_0x27f31b,_0x151e36){return function(_0x9dd1e6){if(_0x9dd1e6){var _0x3c16a3=typeof _0x151e36[_0x9473('0x1a')]==='undefined'&&typeof _0x151e36[_0x9473('0x1b')]===_0x9473('0x1c');var _0x57566b=_0x9dd1e6['count'];var _0x5aaec4=_0x3c16a3?0x0:_0x151e36['offset'];var _0x1772e5=_0x3c16a3?_0x9dd1e6[_0x9473('0x1d')]:_0x151e36[_0x9473('0x1a')]+_0x151e36['limit'];var _0x5214eb;if(_0x1772e5>=_0x57566b){_0x1772e5=_0x57566b;_0x5214eb=0xc8;}else{_0x5214eb=0xce;}_0x27f31b[_0x9473('0x18')](_0x5214eb);return _0x27f31b['set'](_0x9473('0x1e'),_0x5aaec4+'-'+_0x1772e5+'/'+_0x57566b)[_0x9473('0x1f')](_0x9dd1e6);}return null;};}function patchUpdates(_0x1c8590){return function(_0xc801d6){try{jsonpatch[_0x9473('0x20')](_0xc801d6,_0x1c8590,!![]);}catch(_0x3f4630){return BPromise[_0x9473('0x21')](_0x3f4630);}return _0xc801d6[_0x9473('0x22')]();};}function saveUpdates(_0x7142a1,_0x34f703){return function(_0x235d98){if(_0x235d98){return _0x235d98['update'](_0x7142a1)[_0x9473('0x23')](function(_0x599880){return _0x599880;});}return null;};}function removeEntity(_0x2ed3fe,_0x28e57d){return function(_0x50663e){if(_0x50663e){return _0x50663e[_0x9473('0x24')]()[_0x9473('0x23')](function(){_0x2ed3fe['status'](0xcc)[_0x9473('0x19')]();});}};}function handleEntityNotFound(_0xc17ea1,_0x5db1df){return function(_0x153866){if(!_0x153866){_0xc17ea1[_0x9473('0x17')](0x194);}return _0x153866;};}function handleError(_0x4fab19,_0x518b49){_0x518b49=_0x518b49||0x1f4;return function(_0x38dce5){logger[_0x9473('0x25')](_0x38dce5['stack']);if(_0x38dce5[_0x9473('0x26')]){delete _0x38dce5[_0x9473('0x26')];}_0x4fab19['status'](_0x518b49)[_0x9473('0x27')](_0x38dce5);};}exports[_0x9473('0x28')]=function(_0x972aa6,_0x4f2194){var _0x264e47={},_0x338e91={},_0x58fcb8={'count':0x0,'rows':[]};var _0x5c227f=_['map'](db[_0x9473('0x29')][_0x9473('0x2a')],function(_0x250217){return{'name':_0x250217[_0x9473('0x2b')],'type':_0x250217[_0x9473('0x2c')][_0x9473('0x2d')]};});_0x338e91[_0x9473('0x2e')]=_['map'](_0x5c227f,_0x9473('0x26'));_0x338e91['query']=_[_0x9473('0x2f')](_0x972aa6[_0x9473('0x30')]);_0x338e91[_0x9473('0x31')]=_['intersection'](_0x338e91[_0x9473('0x2e')],_0x338e91[_0x9473('0x30')]);_0x264e47['attributes']=_[_0x9473('0x32')](_0x338e91[_0x9473('0x2e')],qs[_0x9473('0x33')](_0x972aa6[_0x9473('0x30')][_0x9473('0x33')]));_0x264e47[_0x9473('0x34')]=_0x264e47[_0x9473('0x34')]['length']?_0x264e47[_0x9473('0x34')]:_0x338e91[_0x9473('0x2e')];if(!_0x972aa6[_0x9473('0x30')][_0x9473('0x35')](_0x9473('0x36'))){_0x264e47['limit']=qs['limit'](_0x972aa6[_0x9473('0x30')][_0x9473('0x1b')]);_0x264e47[_0x9473('0x1a')]=qs[_0x9473('0x1a')](_0x972aa6[_0x9473('0x30')]['offset']);}_0x264e47[_0x9473('0x37')]=qs[_0x9473('0x38')](_0x972aa6['query'][_0x9473('0x38')]);_0x264e47[_0x9473('0x39')]=qs[_0x9473('0x31')](_['pick'](_0x972aa6[_0x9473('0x30')],_0x338e91[_0x9473('0x31')]),_0x5c227f);if(_0x972aa6[_0x9473('0x30')][_0x9473('0x3a')]){_0x264e47[_0x9473('0x39')]=_[_0x9473('0x3b')](_0x264e47[_0x9473('0x39')],{'$or':_[_0x9473('0x3c')](_0x5c227f,function(_0x31568a){if(_0x31568a[_0x9473('0x2c')]!==_0x9473('0x3d')){var _0x57886a={};_0x57886a[_0x31568a['name']]={'$like':'%'+_0x972aa6['query'][_0x9473('0x3a')]+'%'};return _0x57886a;}})});}_0x264e47=_[_0x9473('0x3b')]({},_0x264e47,_0x972aa6['options']);var _0x5451ad={'where':_0x264e47[_0x9473('0x39')]};return db[_0x9473('0x29')]['count'](_0x5451ad)[_0x9473('0x23')](function(_0x4361f6){_0x58fcb8[_0x9473('0x1d')]=_0x4361f6;if(_0x972aa6['query'][_0x9473('0x3e')]){_0x264e47[_0x9473('0x3f')]=[{'all':!![]}];}return db['FaxApplication'][_0x9473('0x40')](_0x264e47);})[_0x9473('0x23')](function(_0x49ebce){_0x58fcb8['rows']=_0x49ebce;return _0x58fcb8;})[_0x9473('0x23')](respondWithFilteredResult(_0x4f2194,_0x264e47))['catch'](handleError(_0x4f2194,null));};exports['show']=function(_0x528b7a,_0x4c9b97){var _0x2a7771={'raw':!![],'where':{'id':_0x528b7a[_0x9473('0x41')]['id']}},_0x58086f={};_0x58086f[_0x9473('0x2e')]=_['keys'](db['FaxApplication'][_0x9473('0x2a')]);_0x58086f[_0x9473('0x30')]=_['keys'](_0x528b7a['query']);_0x58086f[_0x9473('0x31')]=_[_0x9473('0x32')](_0x58086f[_0x9473('0x2e')],_0x58086f['query']);_0x2a7771['attributes']=_[_0x9473('0x32')](_0x58086f[_0x9473('0x2e')],qs['fields'](_0x528b7a['query'][_0x9473('0x33')]));_0x2a7771[_0x9473('0x34')]=_0x2a7771[_0x9473('0x34')]['length']?_0x2a7771[_0x9473('0x34')]:_0x58086f[_0x9473('0x2e')];if(_0x528b7a['query']['includeAll']){_0x2a7771['include']=[{'all':!![]}];}_0x2a7771=_[_0x9473('0x3b')]({},_0x2a7771,_0x528b7a['options']);return db[_0x9473('0x29')][_0x9473('0x42')](_0x2a7771)['then'](handleEntityNotFound(_0x4c9b97,null))['then'](respondWithResult(_0x4c9b97,null))['catch'](handleError(_0x4c9b97,null));};exports[_0x9473('0x43')]=function(_0x27b25d,_0x27e81e){return db[_0x9473('0x29')]['create'](_0x27b25d[_0x9473('0x44')],{})[_0x9473('0x23')](respondWithResult(_0x27e81e,0xc9))[_0x9473('0x45')](handleError(_0x27e81e,null));};exports[_0x9473('0x46')]=function(_0x46fd65,_0x123fde){if(_0x46fd65[_0x9473('0x44')]['id']){delete _0x46fd65[_0x9473('0x44')]['id'];}return db[_0x9473('0x29')][_0x9473('0x42')]({'where':{'id':_0x46fd65[_0x9473('0x41')]['id']}})[_0x9473('0x23')](handleEntityNotFound(_0x123fde,null))[_0x9473('0x23')](saveUpdates(_0x46fd65[_0x9473('0x44')],null))[_0x9473('0x23')](respondWithResult(_0x123fde,null))[_0x9473('0x45')](handleError(_0x123fde,null));};exports[_0x9473('0x24')]=function(_0x18f1fa,_0x552b11){return db['FaxApplication'][_0x9473('0x42')]({'where':{'id':_0x18f1fa[_0x9473('0x41')]['id']}})[_0x9473('0x23')](handleEntityNotFound(_0x552b11,null))[_0x9473('0x23')](removeEntity(_0x552b11,null))['catch'](handleError(_0x552b11,null));};
\ No newline at end of file
index dec7053..178f19f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e8=['FaxApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','exports'];(function(_0x31eef0,_0x13538a){var _0x5189e1=function(_0x2cef29){while(--_0x2cef29){_0x31eef0['push'](_0x31eef0['shift']());}};_0x5189e1(++_0x13538a);}(_0xf2e8,0x6e));var _0x8f2e=function(_0x10c2c8,_0x214e47){_0x10c2c8=_0x10c2c8-0x0;var _0x2946ef=_0xf2e8[_0x10c2c8];return _0x2946ef;};'use strict';var _=require(_0x8f2e('0x0'));var util=require('util');var logger=require(_0x8f2e('0x1'))(_0x8f2e('0x2'));var moment=require(_0x8f2e('0x3'));var BPromise=require(_0x8f2e('0x4'));var rp=require(_0x8f2e('0x5'));var fs=require('fs');var path=require(_0x8f2e('0x6'));var rimraf=require(_0x8f2e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f2e('0x8'));module[_0x8f2e('0x9')]=function(_0x16e581,_0x45c44e){return _0x16e581['define'](_0x8f2e('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f2e('0xb')});};
\ No newline at end of file
+var _0x2bda=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bda,0xe6));var _0xa2bd=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x2bda[_0x1fa381];return _0x47eefe;};'use strict';var _=require(_0xa2bd('0x0'));var util=require(_0xa2bd('0x1'));var logger=require(_0xa2bd('0x2'))(_0xa2bd('0x3'));var moment=require(_0xa2bd('0x4'));var BPromise=require('bluebird');var rp=require(_0xa2bd('0x5'));var fs=require('fs');var path=require(_0xa2bd('0x6'));var rimraf=require('rimraf');var config=require(_0xa2bd('0x7'));var attributes=require(_0xa2bd('0x8'));module[_0xa2bd('0x9')]=function(_0x34e164,_0x3d8ff3){return _0x34e164[_0xa2bd('0xa')](_0xa2bd('0xb'),attributes,{'tableName':_0xa2bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2bd('0xd'),'collate':_0xa2bd('0xe')});};
\ No newline at end of file
index ed91f72..f56d0d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1262=['UpdateFaxApplication','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','update','options','attributes','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1262,0xf4));var _0x2126=function(_0x4fe7b8,_0x4e17cf){_0x4fe7b8=_0x4fe7b8-0x0;var _0x39471d=_0x1262[_0x4fe7b8];return _0x39471d;};'use strict';var _=require(_0x2126('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2126('0x1'));var rs=require(_0x2126('0x2'));var fs=require('fs');var Redis=require(_0x2126('0x3'));var db=require(_0x2126('0x4'))['db'];var utils=require(_0x2126('0x5'));var logger=require(_0x2126('0x6'))(_0x2126('0x7'));var config=require('../../config/environment');var jayson=require(_0x2126('0x8'));var client=jayson[_0x2126('0x9')][_0x2126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9d36,_0x13758e,_0x2cbf63){return new BPromise(function(_0x534367,_0x52a4d5){return client['request'](_0x3d9d36,_0x2cbf63)[_0x2126('0xb')](function(_0x49c2c7){logger[_0x2126('0xc')]('FaxApplication,\x20%s,\x20%s',_0x13758e,'request\x20sent');logger[_0x2126('0xd')](_0x2126('0xe'),_0x13758e,_0x2126('0xf'),JSON[_0x2126('0x10')](_0x49c2c7));if(_0x49c2c7[_0x2126('0x11')]){if(_0x49c2c7['error']['code']===0x1f4){logger[_0x2126('0x11')](_0x2126('0x12'),_0x13758e,_0x49c2c7[_0x2126('0x11')][_0x2126('0x13')]);return _0x52a4d5(_0x49c2c7[_0x2126('0x11')][_0x2126('0x13')]);}logger[_0x2126('0x11')](_0x2126('0x12'),_0x13758e,_0x49c2c7[_0x2126('0x11')][_0x2126('0x13')]);return _0x534367(_0x49c2c7['error']['message']);}else{logger[_0x2126('0xc')](_0x2126('0x12'),_0x13758e,_0x2126('0xf'));_0x534367(_0x49c2c7[_0x2126('0x14')]['message']);}})[_0x2126('0x15')](function(_0x1f40a0){logger['error']('FaxApplication,\x20%s,\x20%s',_0x13758e,_0x1f40a0);_0x52a4d5(_0x1f40a0);});});}exports['UpdateFaxApplication']=function(_0x3f1f59){var _0x444c59=this;return new Promise(function(_0x44a404,_0xadc6a0){return db['FaxApplication'][_0x2126('0x16')](_0x3f1f59['body'],{'raw':_0x3f1f59[_0x2126('0x17')]?_0x3f1f59[_0x2126('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f1f59[_0x2126('0x17')]?_0x3f1f59[_0x2126('0x17')]['where']||null:null,'attributes':_0x3f1f59['options']?_0x3f1f59[_0x2126('0x17')][_0x2126('0x18')]||null:null,'limit':_0x3f1f59[_0x2126('0x17')]?_0x3f1f59[_0x2126('0x17')][_0x2126('0x19')]||null:null})['then'](function(_0x40ae6e){logger['info'](_0x2126('0x1a'),_0x3f1f59);logger['debug']('UpdateFaxApplication',_0x3f1f59,JSON[_0x2126('0x10')](_0x40ae6e));_0x44a404(_0x40ae6e);})[_0x2126('0x15')](function(_0x29e0bc){logger[_0x2126('0x11')](_0x2126('0x1a'),_0x29e0bc['message'],_0x3f1f59);_0xadc6a0(_0x444c59[_0x2126('0x11')](0x1f4,_0x29e0bc[_0x2126('0x13')]));});});};
\ No newline at end of file
+var _0xc9cb=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','update','body','options','raw','attributes','limit','debug','catch','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc9cb,0x199));var _0xbc9c=function(_0x1d69de,_0x22d7de){_0x1d69de=_0x1d69de-0x0;var _0x2b837f=_0xc9cb[_0x1d69de];return _0x2b837f;};'use strict';var _=require(_0xbc9c('0x0'));var util=require(_0xbc9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc9c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc9c('0x3'));var logger=require('../../config/logger')(_0xbc9c('0x4'));var config=require(_0xbc9c('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3ce0,_0x37d248,_0x1aff87){return new BPromise(function(_0x294388,_0x27f9e1){return client[_0xbc9c('0x6')](_0x2f3ce0,_0x1aff87)[_0xbc9c('0x7')](function(_0x5e76a1){logger[_0xbc9c('0x8')](_0xbc9c('0x9'),_0x37d248,_0xbc9c('0xa'));logger['debug'](_0xbc9c('0xb'),_0x37d248,_0xbc9c('0xa'),JSON[_0xbc9c('0xc')](_0x5e76a1));if(_0x5e76a1[_0xbc9c('0xd')]){if(_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xe')]===0x1f4){logger[_0xbc9c('0xd')](_0xbc9c('0x9'),_0x37d248,_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);return _0x27f9e1(_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);}logger['error'](_0xbc9c('0x9'),_0x37d248,_0x5e76a1[_0xbc9c('0xd')][_0xbc9c('0xf')]);return _0x294388(_0x5e76a1['error']['message']);}else{logger['info'](_0xbc9c('0x9'),_0x37d248,_0xbc9c('0xa'));_0x294388(_0x5e76a1[_0xbc9c('0x10')][_0xbc9c('0xf')]);}})['catch'](function(_0x5d34d3){logger[_0xbc9c('0xd')]('FaxApplication,\x20%s,\x20%s',_0x37d248,_0x5d34d3);_0x27f9e1(_0x5d34d3);});});}exports[_0xbc9c('0x11')]=function(_0x198490){var _0x1c1c4f=this;return new Promise(function(_0x2cd7c8,_0x3f7bf4){return db['FaxApplication'][_0xbc9c('0x12')](_0x198490[_0xbc9c('0x13')],{'raw':_0x198490[_0xbc9c('0x14')]?_0x198490[_0xbc9c('0x14')][_0xbc9c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198490[_0xbc9c('0x14')]?_0x198490[_0xbc9c('0x14')]['where']||null:null,'attributes':_0x198490['options']?_0x198490['options'][_0xbc9c('0x16')]||null:null,'limit':_0x198490[_0xbc9c('0x14')]?_0x198490[_0xbc9c('0x14')][_0xbc9c('0x17')]||null:null})[_0xbc9c('0x7')](function(_0x420537){logger[_0xbc9c('0x8')](_0xbc9c('0x11'),_0x198490);logger[_0xbc9c('0x18')](_0xbc9c('0x11'),_0x198490,JSON['stringify'](_0x420537));_0x2cd7c8(_0x420537);})[_0xbc9c('0x19')](function(_0x14015f){logger[_0xbc9c('0xd')]('UpdateFaxApplication',_0x14015f[_0xbc9c('0xf')],_0x198490);_0x3f7bf4(_0x1c1c4f['error'](0x1f4,_0x14015f['message']));});});};
\ No newline at end of file
index 256c677..8e56d65 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','./faxApplication.controller','get'];(function(_0x2f888d,_0x597d3c){var _0x40f285=function(_0x225c27){while(--_0x225c27){_0x2f888d['push'](_0x2f888d['shift']());}};_0x40f285(++_0x597d3c);}(_0xda2d,0x102));var _0xdda2=function(_0x270f6f,_0x20d7db){_0x270f6f=_0x270f6f-0x0;var _0x5b5ded=_0xda2d[_0x270f6f];return _0x5b5ded;};'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 _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x587fdb,_0x16fb82){var _0x590db8=function(_0x23c8db){while(--_0x23c8db){_0x587fdb['push'](_0x587fdb['shift']());}};_0x590db8(++_0x16fb82);}(_0x4213,0x77));var _0x3421=function(_0x11ea47,_0x208f38){_0x11ea47=_0x11ea47-0x0;var _0x2cead1=_0x4213[_0x11ea47];return _0x2cead1;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router;
\ No newline at end of file
index 1e35ce5..d26eac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1aa=['exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xc1aa,0x131));var _0xac1a=function(_0x2ff595,_0x1b5bc5){_0x2ff595=_0x2ff595-0x0;var _0xad21e4=_0xc1aa[_0x2ff595];return _0xad21e4;};'use strict';var Sequelize=require('sequelize');module[_0xac1a('0x0')]={'closed':{'type':Sequelize[_0xac1a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xac1a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xac1a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xac1a('0x3')]},'note':{'type':Sequelize[_0xac1a('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xac1a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xac1a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xac1a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xac1a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x014c=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x014c,0x1bb));var _0xc014=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x014c[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xc014('0x0'));module[_0xc014('0x1')]={'closed':{'type':Sequelize[_0xc014('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc014('0x3')]},'disposition':{'type':Sequelize[_0xc014('0x4')]},'secondDisposition':{'type':Sequelize[_0xc014('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc014('0x4')]},'note':{'type':Sequelize[_0xc014('0x4')]},'read1stAt':{'type':Sequelize[_0xc014('0x3')]},'fax':{'type':Sequelize[_0xc014('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc014('0x5')]('in',_0xc014('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc014('0x5')]('in',_0xc014('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 36d41e5..7b36b2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa300=['emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','limit','count','set','json','apply','reject','save','update','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','then','catch','index','FaxInteraction','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','users','u.id\x20=\x20ui.UserId','from','cm_contacts','left_join','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','unreadMessages','value','`\x20=\x200','having','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','operator','find','UserId','keys','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\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','role','agent','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','include','create','body','describe','FaxMessage','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','Tag'];(function(_0x50161b,_0x4b98eb){var _0x58c059=function(_0x210aff){while(--_0x210aff){_0x50161b['push'](_0x50161b['shift']());}};_0x58c059(++_0x4b98eb);}(_0xa300,0x1d6));var _0x0a30=function(_0x286ffe,_0x364881){_0x286ffe=_0x286ffe-0x0;var _0x2b4548=_0xa300[_0x286ffe];return _0x2b4548;};'use strict';var emlformat=require(_0x0a30('0x0'));var rimraf=require(_0x0a30('0x1'));var zipdir=require(_0x0a30('0x2'));var jsonpatch=require(_0x0a30('0x3'));var rp=require('request-promise');var moment=require(_0x0a30('0x4'));var BPromise=require(_0x0a30('0x5'));var Mustache=require('mustache');var util=require(_0x0a30('0x6'));var path=require(_0x0a30('0x7'));var sox=require(_0x0a30('0x8'));var csv=require(_0x0a30('0x9'));var ejs=require(_0x0a30('0xa'));var fs=require('fs');var fs_extra=require(_0x0a30('0xb'));var _=require(_0x0a30('0xc'));var squel=require(_0x0a30('0xd'));var crypto=require(_0x0a30('0xe'));var jsforce=require(_0x0a30('0xf'));var deskjs=require(_0x0a30('0x10'));var toCsv=require(_0x0a30('0x9'));var querystring=require(_0x0a30('0x11'));var Papa=require(_0x0a30('0x12'));var Redis=require('ioredis');var authService=require(_0x0a30('0x13'));var qs=require(_0x0a30('0x14'));var as=require(_0x0a30('0x15'));var hardwareService=require(_0x0a30('0x16'));var logger=require('../../config/logger')(_0x0a30('0x17'));var utils=require(_0x0a30('0x18'));var config=require(_0x0a30('0x19'));var licenseUtil=require(_0x0a30('0x1a'));var db=require(_0x0a30('0x1b'))['db'];config[_0x0a30('0x1c')]=_[_0x0a30('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a30('0x1e'))(new Redis(config[_0x0a30('0x1c')]));require(_0x0a30('0x1f'))[_0x0a30('0x20')](socket);function respondWithStatusCode(_0x1be658,_0x29f2d2){_0x29f2d2=_0x29f2d2||0xcc;return function(_0xf322f2){if(_0xf322f2){return _0x1be658[_0x0a30('0x21')](_0x29f2d2);}return _0x1be658[_0x0a30('0x22')](_0x29f2d2)['end']();};}function respondWithResult(_0x251761,_0x57edbb){_0x57edbb=_0x57edbb||0xc8;return function(_0x3d3992){if(_0x3d3992){return _0x251761[_0x0a30('0x22')](_0x57edbb)['json'](_0x3d3992);}};}function respondWithFilteredResult(_0x16c986,_0x354ba3){return function(_0x50a7e4){if(_0x50a7e4){var _0x50d72b=typeof _0x354ba3[_0x0a30('0x23')]==='undefined'&&typeof _0x354ba3[_0x0a30('0x24')]==='undefined';var _0x40d151=_0x50a7e4['count'];var _0x1a7594=_0x50d72b?0x0:_0x354ba3[_0x0a30('0x23')];var _0x5b3e0c=_0x50d72b?_0x50a7e4[_0x0a30('0x25')]:_0x354ba3[_0x0a30('0x23')]+_0x354ba3[_0x0a30('0x24')];var _0x3bbaca;if(_0x5b3e0c>=_0x40d151){_0x5b3e0c=_0x40d151;_0x3bbaca=0xc8;}else{_0x3bbaca=0xce;}_0x16c986[_0x0a30('0x22')](_0x3bbaca);return _0x16c986[_0x0a30('0x26')]('Content-Range',_0x1a7594+'-'+_0x5b3e0c+'/'+_0x40d151)[_0x0a30('0x27')](_0x50a7e4);}return null;};}function patchUpdates(_0x15241a){return function(_0x4abc7c){try{jsonpatch[_0x0a30('0x28')](_0x4abc7c,_0x15241a,!![]);}catch(_0x5d6c3a){return BPromise[_0x0a30('0x29')](_0x5d6c3a);}return _0x4abc7c[_0x0a30('0x2a')]();};}function saveUpdates(_0x43e852,_0x4381a4){return function(_0x133ef5){if(_0x133ef5){return _0x133ef5[_0x0a30('0x2b')](_0x43e852)['then'](function(_0x3c9ad7){return _0x3c9ad7;});}return null;};}function removeEntity(_0x52c9c8,_0x181f74){return function(_0x6994bf){if(_0x6994bf){return _0x6994bf[_0x0a30('0x2c')]()['then'](function(){_0x52c9c8['status'](0xcc)[_0x0a30('0x2d')]();});}};}function handleEntityNotFound(_0x36a791,_0x27d1f6){return function(_0x1321f2){if(!_0x1321f2){_0x36a791[_0x0a30('0x21')](0x194);}return _0x1321f2;};}function handleError(_0x37ef9f,_0x43b53f){_0x43b53f=_0x43b53f||0x1f4;return function(_0x2b1261){logger['error'](_0x2b1261[_0x0a30('0x2e')]);if(_0x2b1261[_0x0a30('0x2f')]){delete _0x2b1261[_0x0a30('0x2f')];}_0x37ef9f[_0x0a30('0x22')](_0x43b53f)[_0x0a30('0x30')](_0x2b1261);};}function getInteractionUsers(_0x13bded,_0x385fe2){return new BPromise(function(_0x37ed63,_0x59fd83){try{if(_0x385fe2[_0x13bded['id']]){_0x13bded[_0x0a30('0x31')]=_[_0x0a30('0x32')](_0x385fe2[_0x13bded['id']],function(_0x11439c){return{'id':_0x11439c['id'],'fullname':_0x11439c[_0x0a30('0x33')]};});}}catch(_0x354676){_0x59fd83(_0x354676);}_0x37ed63(_0x13bded);});}function getInteractionTags(_0x419a28,_0x33bb0c){return new BPromise(function(_0x52215a,_0x242d98){try{if(_0x419a28[_0x0a30('0x34')]){_0x419a28[_0x0a30('0x35')]=[];_0x419a28['TagIds']['split'](',')[_0x0a30('0x36')](function(_0x24254f){_0x419a28[_0x0a30('0x35')][_0x0a30('0x37')](_0x33bb0c[_0x24254f]);});}delete _0x419a28[_0x0a30('0x34')];}catch(_0x2cd209){_0x242d98(_0x2cd209);}_0x52215a(_0x419a28);});}function updateFaxInteraction(_0x239a6a,_0x2f2405,_0x2880ea){return new BPromise(function(_0x598e05,_0x4e2a02){return getInteractionUsers(_0x239a6a,_0x2880ea)[_0x0a30('0x38')](function(_0x28ef9b){return getInteractionTags(_0x28ef9b,_0x2f2405);})['then'](function(_0x1865e6){_0x598e05(_0x1865e6);})[_0x0a30('0x39')](function(_0x40869e){_0x4e2a02(_0x40869e);});});}exports[_0x0a30('0x3a')]=function(_0x16a593,_0x121c7a){var _0x4cd376={},_0x1a2966={},_0x31dfe9={'count':0x0,'rows':[]};var _0x3337c1=_[_0x0a30('0x32')](db[_0x0a30('0x3b')]['rawAttributes'],function(_0x399c9c){return{'name':_0x399c9c[_0x0a30('0x3c')],'type':_0x399c9c[_0x0a30('0x3d')][_0x0a30('0x3e')]};});_0x1a2966[_0x0a30('0x3f')]=_[_0x0a30('0x32')](_0x3337c1,_0x0a30('0x2f'));_0x1a2966['query']=_['keys'](_0x16a593[_0x0a30('0x40')]);_0x1a2966[_0x0a30('0x41')]=_[_0x0a30('0x42')](_0x1a2966[_0x0a30('0x3f')],_0x1a2966[_0x0a30('0x40')]);_0x4cd376['attributes']=_[_0x0a30('0x42')](_0x1a2966[_0x0a30('0x3f')],qs[_0x0a30('0x43')](_0x16a593['query'][_0x0a30('0x43')]));_0x4cd376[_0x0a30('0x44')]=_0x4cd376[_0x0a30('0x44')]['length']?_0x4cd376[_0x0a30('0x44')]:_0x1a2966[_0x0a30('0x3f')];if(!_0x16a593['query']['hasOwnProperty'](_0x0a30('0x45'))){_0x4cd376['limit']=qs[_0x0a30('0x24')](_0x16a593[_0x0a30('0x40')]['limit']);_0x4cd376[_0x0a30('0x23')]=qs[_0x0a30('0x23')](_0x16a593[_0x0a30('0x40')][_0x0a30('0x23')]);}_0x4cd376[_0x0a30('0x46')]=qs[_0x0a30('0x47')](_0x16a593[_0x0a30('0x40')][_0x0a30('0x47')]);_0x4cd376[_0x0a30('0x48')]=qs[_0x0a30('0x41')](_[_0x0a30('0x49')](_0x16a593[_0x0a30('0x40')],_0x1a2966[_0x0a30('0x41')]),_0x3337c1);var _0x3c1248=[];var _0x4f4ec8=squel['select']()['field']('id')[_0x0a30('0x4a')]('name')['field'](_0x0a30('0x4b'))['from'](_0x0a30('0x4c'));var _0x5bbb88=squel[_0x0a30('0x4d')]()[_0x0a30('0x4a')](_0x0a30('0x4e'))[_0x0a30('0x4a')](_0x0a30('0x4f'))[_0x0a30('0x4a')](_0x0a30('0x50'))['from']('user_has_fax_interactions','ui')['left_join'](_0x0a30('0x51'),'u',_0x0a30('0x52'));var _0x2b9c5b=squel['select']()[_0x0a30('0x53')]('fax_interactions','i')['left_join'](_0x0a30('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0a30('0x55')](_0x0a30('0x51'),'o',_0x0a30('0x56'))['left_join'](_0x0a30('0x57'),'a',_0x0a30('0x58'))['left_join'](_0x0a30('0x59'),'me',_0x0a30('0x5a'))[_0x0a30('0x55')]('fax_interaction_has_tags','it',_0x0a30('0x5b'))['left_join'](_0x0a30('0x4c'),'t',_0x0a30('0x5c'));var _0x53dfec=squel[_0x0a30('0x5d')]();var _0x682c47=[];var _0x537901=squel['expr']();var _0x2344ce;if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x5e')]){_0x2344ce=as[_0x0a30('0x5f')](_0x16a593[_0x0a30('0x40')][_0x0a30('0x5e')]);var _0x1e945e=_0x2344ce[_0x0a30('0x60')];for(var _0x5d5620=0x0;_0x5d5620<_0x2344ce['conditions'][_0x0a30('0x61')];_0x5d5620++){var _0x215f61=_0x2344ce[_0x0a30('0x62')][_0x5d5620];var _0x317744='i';var _0x2bb1fc=_['find'](_0x3337c1,[_0x0a30('0x2f'),_0x215f61[_0x0a30('0x4a')]]);if(!_0x2bb1fc){switch(_0x215f61[_0x0a30('0x4a')]){case _0x0a30('0x63'):if(_0x215f61[_0x0a30('0x64')]==0x1){_0x2b9c5b['having']('`'+_0x215f61[_0x0a30('0x4a')]+_0x0a30('0x65'));}else{_0x2b9c5b[_0x0a30('0x66')]('`'+_0x215f61['field']+'`\x20>\x200');}break;case _0x0a30('0x67'):if(_0x215f61['operator']===_0x0a30('0x68')){if(_0x215f61['value'][_0x0a30('0x69')]('\x20')['length']>0x1){_0x53dfec[_0x1e945e](_0x0a30('0x6a'),qs[_0x0a30('0x6b')](_0x215f61[_0x0a30('0x64')]),null);}else{var _0x1a4fdd='%'+_0x215f61['value']+'%';_0x53dfec[_0x1e945e](_0x0a30('0x6c'),_0x1a4fdd,_0x1a4fdd,_0x1a4fdd);}}else{_0x2bb1fc=_['find'](_0x3337c1,[_0x0a30('0x2f'),_0x0a30('0x6d')]);_0x215f61[_0x0a30('0x4a')]='ContactId';_0x26fccb=as[_0x0a30('0x6e')](_0x317744,_0x2bb1fc[_0x0a30('0x3d')],_0x215f61);_0x53dfec[_0x1e945e](_0x26fccb[_0x0a30('0x6f')],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x70')],_0x26fccb['value']['end']);}break;case'Tag':var _0x518da6=_0x215f61['value'][_0x0a30('0x69')](',')['map'](function(_0x5456dc){return Number(_0x5456dc);});_0x518da6['forEach'](function(_0x25fb37){_0x537901['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25fb37+',%');});_0x682c47=_['union'](_0x682c47,_0x518da6);break;case _0x0a30('0x71'):if(_0x215f61[_0x0a30('0x72')]===_0x0a30('0x68')){_0x53dfec[_0x1e945e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x215f61['value']+'%',null);}else{_0x2bb1fc=_[_0x0a30('0x73')](_0x3337c1,[_0x0a30('0x2f'),_0x0a30('0x74')]);_0x215f61[_0x0a30('0x4a')]=_0x0a30('0x74');_0x26fccb=as[_0x0a30('0x6e')](_0x317744,_0x2bb1fc[_0x0a30('0x3d')],_0x215f61);_0x53dfec[_0x1e945e](_0x26fccb[_0x0a30('0x6f')],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x70')],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x2d')]);}break;case'body':_0x26fccb=as[_0x0a30('0x6e')]('me',null,_0x215f61);_0x53dfec[_0x1e945e](_0x26fccb['text'],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x70')],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x2d')]);break;}}else{var _0x26fccb=as['buildExpression'](_0x317744,_0x2bb1fc['type'],_0x215f61);_0x53dfec[_0x1e945e](_0x26fccb[_0x0a30('0x6f')],_0x26fccb[_0x0a30('0x64')][_0x0a30('0x70')],_0x26fccb['value'][_0x0a30('0x2d')]);}}}else{var _0x26da4b=_(_0x16a593[_0x0a30('0x40')])[_0x0a30('0x75')]()['map'](function(_0x33e8d2){return _[_0x0a30('0x76')](_0x3337c1,[_0x0a30('0x2f'),_0x33e8d2])?_0x33e8d2:undefined;})[_0x0a30('0x77')]()['value']();if(!_[_0x0a30('0x78')](_0x26da4b)){_0x26da4b[_0x0a30('0x36')](function(_0x3f5d15){if(_0x3f5d15===_0x0a30('0x79')){_0x2b9c5b['where'](_0x0a30('0x7a'),[][_0x0a30('0x7b')](_0x16a593[_0x0a30('0x40')][_0x3f5d15]));}else if(_0x3f5d15==='createdAt'){var _0x1e3701=JSON[_0x0a30('0x7c')](_0x16a593['query'][_0x3f5d15])[_0x0a30('0x7d')];var _0x1a97ee=JSON['parse'](_0x16a593['query'][_0x3f5d15])[_0x0a30('0x7e')];_0x2b9c5b['where'](_0x0a30('0x7f'),_0x1e3701,_0x1a97ee);}else{if(_0x16a593[_0x0a30('0x40')][_0x3f5d15]===_0x0a30('0x80')){_0x2b9c5b[_0x0a30('0x48')]('i.'+_0x3f5d15+_0x0a30('0x81'));}else{_0x2b9c5b[_0x0a30('0x48')]('i.'+_0x3f5d15+_0x0a30('0x82'),_0x16a593[_0x0a30('0x40')][_0x3f5d15]);}}});}if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x83')]){if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x83')]==0x1){_0x2b9c5b[_0x0a30('0x66')](_0x0a30('0x84'));}else{_0x2b9c5b['having'](_0x0a30('0x85'));}}if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x86')]){_0x682c47=_[_0x0a30('0x87')](_0x16a593['query']['tag'])?_0x16a593['query'][_0x0a30('0x86')]:new Array(_0x16a593['query'][_0x0a30('0x86')]);_0x682c47['forEach'](function(_0x574ac4){_0x537901['or'](_0x0a30('0x88'),'%,'+_0x574ac4+',%');});}if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x89')]){var _0x1548f2=_0x16a593['query']['filter'][_0x0a30('0x8a')]('\x5c','\x5c\x5c')[_0x0a30('0x8a')](/'/g,'\x27\x27');if(qs[_0x0a30('0x8b')](_0x1548f2)){_0x53dfec['or'](_0x0a30('0x8c'),_0x1548f2+'%')['or'](_0x0a30('0x8d'),_0x1548f2+'%');}_0x53dfec['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1548f2+'%');}}_0x2b9c5b[_0x0a30('0x48')](_0x53dfec);_0x2b9c5b[_0x0a30('0x8e')](_0x0a30('0x8f'));var _0x4eba2f={'type':db[_0x0a30('0x90')][_0x0a30('0x91')][_0x0a30('0x92')],'raw':!![]};var _0x3a566c=_0x2b9c5b[_0x0a30('0x93')]();_0x3a566c['field'](_0x0a30('0x8f'));_0x3a566c[_0x0a30('0x4a')](_0x0a30('0x94'),_0x0a30('0x63'));if(_0x4cd376[_0x0a30('0x46')]){_0x4cd376[_0x0a30('0x46')]['forEach'](function(_0x509364){var _0x456703=_0x509364[0x0]==='contactName'?_0x509364[0x0]:'i.'+_0x509364[0x0];_0x2b9c5b[_0x0a30('0x46')](_0x456703,_0x509364[0x1]===_0x0a30('0x95')?![]:!![]);});}if(!_[_0x0a30('0x78')](_0x682c47)){_0x2b9c5b[_0x0a30('0x66')](_0x537901);_0x3a566c[_0x0a30('0x48')]('t.id\x20IN\x20?',_0x682c47);}BPromise[_0x0a30('0x96')]()[_0x0a30('0x38')](function(){if(!_0x2344ce){if(_0x16a593[_0x0a30('0x40')][_0x0a30('0x79')])return;_0x3a566c['where'](_0x0a30('0x97'));_0x2b9c5b[_0x0a30('0x48')](_0x0a30('0x97'));return;}if(_0x16a593[_0x0a30('0x98')][_0x0a30('0x99')]!==_0x0a30('0x9a'))return;return _0x16a593[_0x0a30('0x98')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x0a30('0x38')](function(_0x12a2ba){if(_[_0x0a30('0x78')](_0x12a2ba)){_0x3a566c[_0x0a30('0x48')]('i.FaxAccountId\x20IS\x20NULL');_0x2b9c5b[_0x0a30('0x48')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x3a566c[_0x0a30('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0x0a30('0x32')](_0x12a2ba,'id'));_0x2b9c5b['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x12a2ba,'id'));}});})[_0x0a30('0x38')](function(){if(_0x16a593['user'][_0x0a30('0x99')]==='agent'&&!_0x2344ce&&!_0x16a593['query']['FaxAccountId'])return[];return db[_0x0a30('0x9b')]['query'](_0x3a566c[_0x0a30('0x9c')](),_0x4eba2f);})[_0x0a30('0x38')](function(_0x2d91d0){_0x31dfe9[_0x0a30('0x25')]=_0x2d91d0[_0x0a30('0x61')];if(_0x31dfe9[_0x0a30('0x25')]===0x0)return[];return db[_0x0a30('0x9b')]['query'](_0x4f4ec8['toString'](),_0x4eba2f)[_0x0a30('0x38')](function(_0x1d7766){_0x3c1248=_[_0x0a30('0x9d')](_0x1d7766,'id');_0x4eba2f=_[_0x0a30('0x9e')](_0x4eba2f,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16a593['query'][_0x0a30('0x43')]){_0x4cd376[_0x0a30('0x44')]['forEach'](function(_0x39d806){_0x2b9c5b[_0x0a30('0x4a')]('i.'+_0x39d806);});}else{_0x2b9c5b[_0x0a30('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a30('0x63'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0x9f'),_0x0a30('0xa0'));_0x2b9c5b[_0x0a30('0x4a')]('a.mandatoryDisposition',_0x0a30('0xa1'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xa2'),_0x0a30('0xa3'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xa4'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xa5'),_0x0a30('0xa6'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xa7'),_0x0a30('0xa8'));_0x2b9c5b[_0x0a30('0x4a')]('c.email',_0x0a30('0xa9'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xaa'),_0x0a30('0xab'));_0x2b9c5b['field'](_0x0a30('0xac'),_0x0a30('0xad'));_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xae'),'Contact.fax');_0x2b9c5b['field'](_0x0a30('0xaf'),'Owner.fullname');_0x2b9c5b[_0x0a30('0x4a')](_0x0a30('0xb0'),_0x0a30('0xb1'));_0x2b9c5b[_0x0a30('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0a30('0x34'));}if(_0x4cd376[_0x0a30('0x24')])_0x2b9c5b['limit'](_0x4cd376[_0x0a30('0x24')]);if(_0x4cd376[_0x0a30('0x23')])_0x2b9c5b[_0x0a30('0x23')](_0x4cd376['offset']);return db['sequelize'][_0x0a30('0x40')](_0x2b9c5b[_0x0a30('0x9c')](),_0x4eba2f);})[_0x0a30('0x38')](function(_0x167fc6){if(_0x167fc6[_0x0a30('0x61')]>0x0)_0x5bbb88['where'](_0x0a30('0xb2'),_[_0x0a30('0x32')](_0x167fc6,'id'));return db[_0x0a30('0x9b')]['query'](_0x5bbb88['toString'](),_0x4eba2f)[_0x0a30('0x38')](function(_0x248a2f){var _0x341543=_[_0x0a30('0xb3')](_0x248a2f,_0x0a30('0xb4'));var _0x504e53=[];_0x167fc6[_0x0a30('0x36')](function(_0x13395a){_0x504e53[_0x0a30('0x37')](updateFaxInteraction(_0x13395a,_0x3c1248,_0x341543));});return BPromise[_0x0a30('0xb5')](_0x504e53);});});})[_0x0a30('0x38')](function(_0x581d70){_0x31dfe9[_0x0a30('0xb6')]=_0x581d70;return _0x31dfe9;})[_0x0a30('0x38')](respondWithFilteredResult(_0x121c7a,_0x4cd376))['catch'](handleError(_0x121c7a,null));};exports[_0x0a30('0xb7')]=function(_0x3c8bc9,_0x1b915c){var _0x50ce0={'raw':![],'where':{'id':_0x3c8bc9[_0x0a30('0xb8')]['id']}},_0xb7b5ef={};_0xb7b5ef[_0x0a30('0x3f')]=_['keys'](db[_0x0a30('0x3b')][_0x0a30('0xb9')]);_0xb7b5ef[_0x0a30('0x40')]=_[_0x0a30('0x75')](_0x3c8bc9[_0x0a30('0x40')]);_0xb7b5ef[_0x0a30('0x41')]=_['intersection'](_0xb7b5ef[_0x0a30('0x3f')],_0xb7b5ef['query']);_0x50ce0['attributes']=_['intersection'](_0xb7b5ef[_0x0a30('0x3f')],qs['fields'](_0x3c8bc9['query'][_0x0a30('0x43')]));_0x50ce0['attributes']=_0x50ce0['attributes'][_0x0a30('0x61')]?_0x50ce0[_0x0a30('0x44')]:_0xb7b5ef['model'];if(_0x3c8bc9[_0x0a30('0x40')][_0x0a30('0xba')]){_0x50ce0[_0x0a30('0xbb')]=[{'all':!![]}];}_0x50ce0=_['merge']({},_0x50ce0,_0x3c8bc9['options']);return db[_0x0a30('0x3b')][_0x0a30('0x73')](_0x50ce0)[_0x0a30('0x38')](handleEntityNotFound(_0x1b915c,null))['then'](respondWithResult(_0x1b915c,null))['catch'](handleError(_0x1b915c,null));};exports[_0x0a30('0xbc')]=function(_0xed701f,_0x2f7e7c){return db[_0x0a30('0x3b')][_0x0a30('0xbc')](_0xed701f[_0x0a30('0xbd')],{})['then'](respondWithResult(_0x2f7e7c,0xc9))['catch'](handleError(_0x2f7e7c,null));};exports[_0x0a30('0x2b')]=function(_0x56e0e2,_0x355daa){if(_0x56e0e2[_0x0a30('0xbd')]['id']){delete _0x56e0e2[_0x0a30('0xbd')]['id'];}return db[_0x0a30('0x3b')]['find']({'where':{'id':_0x56e0e2['params']['id']}})[_0x0a30('0x38')](handleEntityNotFound(_0x355daa,null))[_0x0a30('0x38')](saveUpdates(_0x56e0e2[_0x0a30('0xbd')],null))[_0x0a30('0x38')](respondWithResult(_0x355daa,null))[_0x0a30('0x39')](handleError(_0x355daa,null));};exports[_0x0a30('0x2c')]=function(_0x3dd702,_0x1ed1f0){return db[_0x0a30('0x3b')]['find']({'where':{'id':_0x3dd702[_0x0a30('0xb8')]['id']}})[_0x0a30('0x38')](handleEntityNotFound(_0x1ed1f0,null))[_0x0a30('0x38')](removeEntity(_0x1ed1f0,null))[_0x0a30('0x39')](handleError(_0x1ed1f0,null));};exports[_0x0a30('0xbe')]=function(_0x460e31,_0x311b08){return db[_0x0a30('0x3b')][_0x0a30('0xbe')]()[_0x0a30('0x38')](respondWithResult(_0x311b08,null))[_0x0a30('0x39')](handleError(_0x311b08,null));};exports['addMessage']=function(_0x3075cc,_0x5b01a3,_0x441450){return db[_0x0a30('0xbf')]['find']({'where':{'id':_0x3075cc[_0x0a30('0xb8')]['id']}})[_0x0a30('0x38')](handleEntityNotFound(_0x5b01a3,null))[_0x0a30('0x38')](function(_0x3d5a47){if(_0x3d5a47){return _0x3d5a47[_0x0a30('0xc0')](_0x3075cc[_0x0a30('0xbd')]['ids'],_[_0x0a30('0xc1')](_0x3075cc['body'],[_0x0a30('0xc2'),'id'])||{});}})[_0x0a30('0x38')](respondWithResult(_0x5b01a3,null))[_0x0a30('0x39')](handleError(_0x5b01a3,null));};exports[_0x0a30('0xc3')]=function(_0x3a94bd,_0x11f18b,_0x320892){var _0x2b8b34={'raw':![],'where':{}};var _0x59fef6={};var _0x3c479e={'count':0x0,'rows':[]};return db[_0x0a30('0x3b')][_0x0a30('0xc4')]({'where':{'id':_0x3a94bd['params']['id']}})['then'](handleEntityNotFound(_0x11f18b,null))[_0x0a30('0x38')](function(_0x3823e5){if(_0x3823e5){_0x59fef6['model']=_[_0x0a30('0x75')](db[_0x0a30('0xbf')][_0x0a30('0xb9')]);_0x59fef6[_0x0a30('0x40')]=_['keys'](_0x3a94bd[_0x0a30('0x40')]);_0x59fef6['filters']=_[_0x0a30('0x42')](_0x59fef6[_0x0a30('0x3f')],_0x59fef6[_0x0a30('0x40')]);_0x2b8b34['attributes']=_[_0x0a30('0x42')](_0x59fef6[_0x0a30('0x3f')],qs['fields'](_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x43')]));_0x2b8b34[_0x0a30('0x44')]=_0x2b8b34['attributes'][_0x0a30('0x61')]?_0x2b8b34[_0x0a30('0x44')]:_0x59fef6['model'];if(!_0x3a94bd[_0x0a30('0x40')][_0x0a30('0xc5')]('nolimit')){_0x2b8b34['limit']=qs[_0x0a30('0x24')](_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x24')]);_0x2b8b34[_0x0a30('0x23')]=qs[_0x0a30('0x23')](_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x23')]);}_0x2b8b34['order']=qs['sort'](_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x47')]);_0x2b8b34[_0x0a30('0x48')]=qs[_0x0a30('0x41')](_[_0x0a30('0x49')](_0x3a94bd[_0x0a30('0x40')],_0x59fef6[_0x0a30('0x41')]));_0x2b8b34[_0x0a30('0x48')][_0x0a30('0xb4')]=_0x3823e5['id'];if(_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x89')]){_0x2b8b34[_0x0a30('0x48')]=_[_0x0a30('0x9e')](_0x2b8b34[_0x0a30('0x48')],{'$or':_[_0x0a30('0x32')](_0x2b8b34[_0x0a30('0x44')],function(_0x2df5a1){var _0x3d9fc4={};_0x3d9fc4[_0x2df5a1]={'$like':'%'+_0x3a94bd['query'][_0x0a30('0x89')]+'%'};return _0x3d9fc4;})});}if(_0x3a94bd[_0x0a30('0x40')][_0x0a30('0x7d')]){var _0xe45c40=_0x3a94bd[_0x0a30('0x40')]['$gte'][_0x0a30('0x69')](',');var _0x35b855={};_0x35b855[_0xe45c40[0x0]]={'$gte':moment(_0xe45c40[0x1])[_0x0a30('0xc6')](_0x0a30('0xc7'))};_0x2b8b34[_0x0a30('0x48')]=_[_0x0a30('0x9e')](_0x2b8b34[_0x0a30('0x48')],_0x35b855);}_0x2b8b34=_['merge']({},_0x2b8b34,_0x3a94bd[_0x0a30('0xc8')]);return db[_0x0a30('0xbf')][_0x0a30('0x25')]({'where':_0x2b8b34['where']})[_0x0a30('0x38')](function(_0x43e911){_0x3c479e[_0x0a30('0x25')]=_0x43e911;if(_0x3a94bd[_0x0a30('0x40')]['includeAll']){_0x2b8b34[_0x0a30('0xbb')]=[{'all':!![]}];}return db[_0x0a30('0xbf')][_0x0a30('0xc9')](_0x2b8b34);})['then'](function(_0x33335f){_0x3c479e[_0x0a30('0xb6')]=_0x33335f;return _0x3c479e;});}})[_0x0a30('0x38')](respondWithFilteredResult(_0x11f18b,_0x2b8b34))[_0x0a30('0x39')](handleError(_0x11f18b,null));};exports[_0x0a30('0xca')]=function(_0x2051f3,_0x1e58dc,_0x504135){return db[_0x0a30('0x3b')][_0x0a30('0x73')]({'where':{'id':_0x2051f3['params']['id']}})[_0x0a30('0x38')](handleEntityNotFound(_0x1e58dc,null))['then'](function(_0x106bfe){if(_0x106bfe){return _0x106bfe[_0x0a30('0xcb')](_0x2051f3[_0x0a30('0xbd')][_0x0a30('0xc2')],_[_0x0a30('0xc1')](_0x2051f3['body'],[_0x0a30('0xc2'),'id'])||{})['spread'](function(){return db[_0x0a30('0xcc')][_0x0a30('0xc9')]({'attributes':['id',_0x0a30('0x2f'),_0x0a30('0x4b')],'where':{'id':_0x2051f3[_0x0a30('0xbd')][_0x0a30('0xc2')]}});})[_0x0a30('0x38')](function(_0xd9c76e){socket[_0x0a30('0xcd')](_0x0a30('0xce'),{'id':Number(_0x2051f3[_0x0a30('0xb8')]['id']),'tags':_0xd9c76e||[]});return{'id':Number(_0x2051f3[_0x0a30('0xb8')]['id']),'tags':_0xd9c76e||[]};});}})[_0x0a30('0x38')](respondWithResult(_0x1e58dc,null))[_0x0a30('0x39')](handleError(_0x1e58dc,null));};exports['removeTags']=function(_0x3b347e,_0x4a6258,_0x2a92e2){return db[_0x0a30('0x3b')][_0x0a30('0x73')]({'where':{'id':_0x3b347e[_0x0a30('0xb8')]['id']}})[_0x0a30('0x38')](handleEntityNotFound(_0x4a6258,null))[_0x0a30('0x38')](function(_0x6c1343){if(_0x6c1343){return _0x6c1343[_0x0a30('0xcf')](_0x3b347e['query'][_0x0a30('0xc2')]);}})[_0x0a30('0x38')](respondWithStatusCode(_0x4a6258,null))[_0x0a30('0x39')](handleError(_0x4a6258,null));};exports[_0x0a30('0xd0')]=function(_0x24fc09,_0x4850e4){var _0x335afb=moment()[_0x0a30('0xd1')]()[_0x0a30('0x9c')]();var _0x48ce18=path[_0x0a30('0xd2')](config[_0x0a30('0xd3')],_0x0a30('0xd4'),_0x0a30('0xd5'),_0x0a30('0xd6'));var _0x312932=path[_0x0a30('0xd2')](config['root'],_0x0a30('0xd4'),'files',_0x0a30('0xd7'));var _0x283c1b=path[_0x0a30('0xd2')](_0x48ce18,_0x335afb);var _0x27c56c=util[_0x0a30('0xc6')](_0x0a30('0xd8'),_0x24fc09[_0x0a30('0xb8')]['id'],_0x335afb);var _0x3f6658=path['join'](_0x48ce18,_0x27c56c);var _0x79b46e=[];_0x79b46e[_0x0a30('0x37')]({'model':db[_0x0a30('0xd9')],'as':_0x0a30('0xd9'),'raw':!![]});var _0x40f417=[{'model':db[_0x0a30('0xbf')],'as':_0x0a30('0xda'),'attributes':['id',_0x0a30('0xbd'),'createdAt'],'include':_0x79b46e}];return db['FaxInteraction'][_0x0a30('0x73')]({'where':{'id':_0x24fc09['params']['id']},'include':_0x40f417})[_0x0a30('0x38')](handleEntityNotFound(_0x4850e4,null))[_0x0a30('0x38')](function(_0x932b43){if(_0x932b43&&_0x932b43['Messages']){var _0x51bb56=_0x932b43['get']({'plain':!![]});fs[_0x0a30('0xdb')](_0x283c1b);for(var _0x344d66=0x0;_0x344d66<_0x51bb56[_0x0a30('0xda')][_0x0a30('0x61')];_0x344d66++){var _0x11286a=_0x51bb56[_0x0a30('0xda')][_0x344d66]['Attachment'];if(_0x11286a){var _0x4a167a=path[_0x0a30('0xd2')](_0x312932,_0x11286a[_0x0a30('0xdc')]);if(fs['existsSync'](_0x4a167a)){fs[_0x0a30('0xdd')](_0x4a167a)['pipe'](fs[_0x0a30('0xde')](path[_0x0a30('0xd2')](_0x283c1b,_0x11286a[_0x0a30('0xdc')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x475273,_0x2f058b){zipdir(_0x283c1b,{'saveTo':_0x3f6658},function(_0x37c012,_0x3ed1e6){if(_0x37c012)return _0x2f058b(_0x37c012);return _0x475273(_0x3ed1e6);});})[_0x0a30('0x38')](function(){return new BPromise(function(_0x41c8f5,_0x3bf8b1){rimraf(_0x283c1b,function(_0x44a95e){if(_0x44a95e)_0x3bf8b1(_0x44a95e);return _0x41c8f5();});});})['then'](function(){return _0x4850e4[_0x0a30('0xd0')](_0x3f6658,_0x27c56c,function(_0x357ebe){if(_0x357ebe){console[_0x0a30('0xdf')]('err',_0x357ebe);}else{fs[_0x0a30('0xe0')](_0x3f6658);}});});});}else{return _0x4850e4[_0x0a30('0x21')](0xc8);}})[_0x0a30('0x39')](handleError(_0x4850e4,null));};
\ No newline at end of file
+var _0x6f12=['addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','Users','map','fullname','TagIds','forEach','Tags','catch','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','params','FaxInteraction','include','create','body','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x6f12,0xf5));var _0x26f1=function(_0x43f2d7,_0x3b37cb){_0x43f2d7=_0x43f2d7-0x0;var _0xcd377e=_0x6f12[_0x43f2d7];return _0xcd377e;};'use strict';var emlformat=require(_0x26f1('0x0'));var rimraf=require(_0x26f1('0x1'));var zipdir=require(_0x26f1('0x2'));var jsonpatch=require(_0x26f1('0x3'));var rp=require(_0x26f1('0x4'));var moment=require(_0x26f1('0x5'));var BPromise=require(_0x26f1('0x6'));var Mustache=require(_0x26f1('0x7'));var util=require(_0x26f1('0x8'));var path=require(_0x26f1('0x9'));var sox=require('sox');var csv=require(_0x26f1('0xa'));var ejs=require(_0x26f1('0xb'));var fs=require('fs');var fs_extra=require(_0x26f1('0xc'));var _=require('lodash');var squel=require(_0x26f1('0xd'));var crypto=require(_0x26f1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x26f1('0xf'));var toCsv=require(_0x26f1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26f1('0x10'));var authService=require(_0x26f1('0x11'));var qs=require(_0x26f1('0x12'));var as=require(_0x26f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26f1('0x14'))(_0x26f1('0x15'));var utils=require('../../config/utils');var config=require(_0x26f1('0x16'));var licenseUtil=require(_0x26f1('0x17'));var db=require('../../mysqldb')['db'];config[_0x26f1('0x18')]=_[_0x26f1('0x19')](config[_0x26f1('0x18')],{'host':_0x26f1('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26f1('0x18')]));require(_0x26f1('0x1b'))[_0x26f1('0x1c')](socket);function respondWithStatusCode(_0x1d32f7,_0x543e92){_0x543e92=_0x543e92||0xcc;return function(_0x55db5b){if(_0x55db5b){return _0x1d32f7[_0x26f1('0x1d')](_0x543e92);}return _0x1d32f7['status'](_0x543e92)[_0x26f1('0x1e')]();};}function respondWithResult(_0x34c2ce,_0x34ab48){_0x34ab48=_0x34ab48||0xc8;return function(_0x4dbba2){if(_0x4dbba2){return _0x34c2ce['status'](_0x34ab48)[_0x26f1('0x1f')](_0x4dbba2);}};}function respondWithFilteredResult(_0x5b8a6c,_0x55c82b){return function(_0x3ada09){if(_0x3ada09){var _0x4852fa=typeof _0x55c82b[_0x26f1('0x20')]===_0x26f1('0x21')&&typeof _0x55c82b[_0x26f1('0x22')]==='undefined';var _0xd3f4e=_0x3ada09['count'];var _0x14a564=_0x4852fa?0x0:_0x55c82b['offset'];var _0x145207=_0x4852fa?_0x3ada09[_0x26f1('0x23')]:_0x55c82b['offset']+_0x55c82b[_0x26f1('0x22')];var _0x16f37f;if(_0x145207>=_0xd3f4e){_0x145207=_0xd3f4e;_0x16f37f=0xc8;}else{_0x16f37f=0xce;}_0x5b8a6c[_0x26f1('0x24')](_0x16f37f);return _0x5b8a6c[_0x26f1('0x25')](_0x26f1('0x26'),_0x14a564+'-'+_0x145207+'/'+_0xd3f4e)[_0x26f1('0x1f')](_0x3ada09);}return null;};}function patchUpdates(_0x1ccbfd){return function(_0x4cbe35){try{jsonpatch[_0x26f1('0x27')](_0x4cbe35,_0x1ccbfd,!![]);}catch(_0x19eb34){return BPromise['reject'](_0x19eb34);}return _0x4cbe35[_0x26f1('0x28')]();};}function saveUpdates(_0xc92360,_0x107dc8){return function(_0x59c020){if(_0x59c020){return _0x59c020['update'](_0xc92360)[_0x26f1('0x29')](function(_0x5d1d1e){return _0x5d1d1e;});}return null;};}function removeEntity(_0x5d12f7,_0x15ecbf){return function(_0x36d1ac){if(_0x36d1ac){return _0x36d1ac[_0x26f1('0x2a')]()[_0x26f1('0x29')](function(){_0x5d12f7[_0x26f1('0x24')](0xcc)[_0x26f1('0x1e')]();});}};}function handleEntityNotFound(_0x34a048,_0x4f0bc0){return function(_0x1ed4eb){if(!_0x1ed4eb){_0x34a048[_0x26f1('0x1d')](0x194);}return _0x1ed4eb;};}function handleError(_0x4c912b,_0x57ff70){_0x57ff70=_0x57ff70||0x1f4;return function(_0x2d0517){logger[_0x26f1('0x2b')](_0x2d0517[_0x26f1('0x2c')]);if(_0x2d0517[_0x26f1('0x2d')]){delete _0x2d0517[_0x26f1('0x2d')];}_0x4c912b[_0x26f1('0x24')](_0x57ff70)['send'](_0x2d0517);};}function getInteractionUsers(_0x39cf50,_0x4e446c){return new BPromise(function(_0x94e960,_0x387e44){try{if(_0x4e446c[_0x39cf50['id']]){_0x39cf50[_0x26f1('0x2e')]=_[_0x26f1('0x2f')](_0x4e446c[_0x39cf50['id']],function(_0x25c3d0){return{'id':_0x25c3d0['id'],'fullname':_0x25c3d0[_0x26f1('0x30')]};});}}catch(_0x1b0ea6){_0x387e44(_0x1b0ea6);}_0x94e960(_0x39cf50);});}function getInteractionTags(_0x567652,_0x479554){return new BPromise(function(_0x213419,_0x9d3840){try{if(_0x567652[_0x26f1('0x31')]){_0x567652['Tags']=[];_0x567652[_0x26f1('0x31')]['split'](',')[_0x26f1('0x32')](function(_0x5d0886){_0x567652[_0x26f1('0x33')]['push'](_0x479554[_0x5d0886]);});}delete _0x567652[_0x26f1('0x31')];}catch(_0x41b905){_0x9d3840(_0x41b905);}_0x213419(_0x567652);});}function updateFaxInteraction(_0x3eeb39,_0x28ec7b,_0x3642cf){return new BPromise(function(_0x1f4fb8,_0x2d35bf){return getInteractionUsers(_0x3eeb39,_0x3642cf)[_0x26f1('0x29')](function(_0x5e7bed){return getInteractionTags(_0x5e7bed,_0x28ec7b);})['then'](function(_0x1f4002){_0x1f4fb8(_0x1f4002);})[_0x26f1('0x34')](function(_0xf015c9){_0x2d35bf(_0xf015c9);});});}exports[_0x26f1('0x35')]=function(_0x4d203f,_0x25a632){var _0x308930={},_0x1b0aa0={},_0x3f5091={'count':0x0,'rows':[]};var _0x40c8ae=_['map'](db['FaxInteraction'][_0x26f1('0x36')],function(_0x2ab96){return{'name':_0x2ab96[_0x26f1('0x37')],'type':_0x2ab96['type']['key']};});_0x1b0aa0[_0x26f1('0x38')]=_[_0x26f1('0x2f')](_0x40c8ae,'name');_0x1b0aa0[_0x26f1('0x39')]=_[_0x26f1('0x3a')](_0x4d203f[_0x26f1('0x39')]);_0x1b0aa0[_0x26f1('0x3b')]=_[_0x26f1('0x3c')](_0x1b0aa0[_0x26f1('0x38')],_0x1b0aa0[_0x26f1('0x39')]);_0x308930[_0x26f1('0x3d')]=_[_0x26f1('0x3c')](_0x1b0aa0[_0x26f1('0x38')],qs['fields'](_0x4d203f[_0x26f1('0x39')][_0x26f1('0x3e')]));_0x308930[_0x26f1('0x3d')]=_0x308930[_0x26f1('0x3d')][_0x26f1('0x3f')]?_0x308930[_0x26f1('0x3d')]:_0x1b0aa0['model'];if(!_0x4d203f[_0x26f1('0x39')]['hasOwnProperty'](_0x26f1('0x40'))){_0x308930[_0x26f1('0x22')]=qs['limit'](_0x4d203f[_0x26f1('0x39')][_0x26f1('0x22')]);_0x308930[_0x26f1('0x20')]=qs[_0x26f1('0x20')](_0x4d203f[_0x26f1('0x39')]['offset']);}_0x308930[_0x26f1('0x41')]=qs[_0x26f1('0x42')](_0x4d203f[_0x26f1('0x39')][_0x26f1('0x42')]);_0x308930[_0x26f1('0x43')]=qs[_0x26f1('0x3b')](_[_0x26f1('0x44')](_0x4d203f[_0x26f1('0x39')],_0x1b0aa0['filters']),_0x40c8ae);var _0x423c59=[];var _0x1cf167=squel[_0x26f1('0x45')]()[_0x26f1('0x46')]('id')['field'](_0x26f1('0x2d'))[_0x26f1('0x46')](_0x26f1('0x47'))[_0x26f1('0x48')](_0x26f1('0x49'));var _0x485074=squel[_0x26f1('0x45')]()['field'](_0x26f1('0x4a'))[_0x26f1('0x46')](_0x26f1('0x4b'))[_0x26f1('0x46')](_0x26f1('0x4c'))[_0x26f1('0x48')]('user_has_fax_interactions','ui')[_0x26f1('0x4d')](_0x26f1('0x4e'),'u',_0x26f1('0x4f'));var _0x4bd236=squel[_0x26f1('0x45')]()[_0x26f1('0x48')](_0x26f1('0x50'),'i')['left_join'](_0x26f1('0x51'),'c',_0x26f1('0x52'))[_0x26f1('0x4d')]('users','o',_0x26f1('0x53'))[_0x26f1('0x4d')](_0x26f1('0x54'),'a',_0x26f1('0x55'))['left_join'](_0x26f1('0x56'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x26f1('0x4d')](_0x26f1('0x57'),'it',_0x26f1('0x58'))[_0x26f1('0x4d')](_0x26f1('0x49'),'t',_0x26f1('0x59'));var _0x1e0583=squel[_0x26f1('0x5a')]();var _0x45b9db=[];var _0x2a2901=squel[_0x26f1('0x5a')]();var _0x2315c3;if(_0x4d203f[_0x26f1('0x39')][_0x26f1('0x5b')]){_0x2315c3=as[_0x26f1('0x5c')](_0x4d203f[_0x26f1('0x39')][_0x26f1('0x5b')]);var _0x530711=_0x2315c3[_0x26f1('0x5d')];for(var _0x582e3f=0x0;_0x582e3f<_0x2315c3['conditions']['length'];_0x582e3f++){var _0x1ecdaa=_0x2315c3[_0x26f1('0x5e')][_0x582e3f];var _0x84d4f3='i';var _0x36332e=_[_0x26f1('0x5f')](_0x40c8ae,[_0x26f1('0x2d'),_0x1ecdaa[_0x26f1('0x46')]]);if(!_0x36332e){switch(_0x1ecdaa[_0x26f1('0x46')]){case _0x26f1('0x60'):if(_0x1ecdaa[_0x26f1('0x61')]==0x1){_0x4bd236[_0x26f1('0x62')]('`'+_0x1ecdaa['field']+_0x26f1('0x63'));}else{_0x4bd236[_0x26f1('0x62')]('`'+_0x1ecdaa[_0x26f1('0x46')]+'`\x20>\x200');}break;case _0x26f1('0x64'):if(_0x1ecdaa[_0x26f1('0x65')]===_0x26f1('0x66')){if(_0x1ecdaa[_0x26f1('0x61')][_0x26f1('0x67')]('\x20')[_0x26f1('0x3f')]>0x1){_0x1e0583[_0x530711](_0x26f1('0x68'),qs['getFullTextValue'](_0x1ecdaa[_0x26f1('0x61')]),null);}else{var _0x29ed2f='%'+_0x1ecdaa[_0x26f1('0x61')]+'%';_0x1e0583[_0x530711](_0x26f1('0x69'),_0x29ed2f,_0x29ed2f,_0x29ed2f);}}else{_0x36332e=_['find'](_0x40c8ae,[_0x26f1('0x2d'),'ContactId']);_0x1ecdaa['field']=_0x26f1('0x6a');_0x12a1a9=as[_0x26f1('0x6b')](_0x84d4f3,_0x36332e[_0x26f1('0x6c')],_0x1ecdaa);_0x1e0583[_0x530711](_0x12a1a9['text'],_0x12a1a9['value'][_0x26f1('0x6d')],_0x12a1a9['value'][_0x26f1('0x1e')]);}break;case'Tag':var _0x117a44=_0x1ecdaa[_0x26f1('0x61')]['split'](',')[_0x26f1('0x2f')](function(_0x502b8d){return Number(_0x502b8d);});_0x117a44[_0x26f1('0x32')](function(_0x5459e8){_0x2a2901['or'](_0x26f1('0x6e'),'%,'+_0x5459e8+',%');});_0x45b9db=_[_0x26f1('0x6f')](_0x45b9db,_0x117a44);break;case _0x26f1('0x70'):if(_0x1ecdaa[_0x26f1('0x65')]===_0x26f1('0x66')){_0x1e0583[_0x530711](_0x26f1('0x71'),'%'+_0x1ecdaa[_0x26f1('0x61')]+'%',null);}else{_0x36332e=_['find'](_0x40c8ae,[_0x26f1('0x2d'),_0x26f1('0x72')]);_0x1ecdaa[_0x26f1('0x46')]='UserId';_0x12a1a9=as[_0x26f1('0x6b')](_0x84d4f3,_0x36332e[_0x26f1('0x6c')],_0x1ecdaa);_0x1e0583[_0x530711](_0x12a1a9[_0x26f1('0x73')],_0x12a1a9[_0x26f1('0x61')][_0x26f1('0x6d')],_0x12a1a9[_0x26f1('0x61')][_0x26f1('0x1e')]);}break;case'body':_0x12a1a9=as[_0x26f1('0x6b')]('me',null,_0x1ecdaa);_0x1e0583[_0x530711](_0x12a1a9[_0x26f1('0x73')],_0x12a1a9['value'][_0x26f1('0x6d')],_0x12a1a9['value'][_0x26f1('0x1e')]);break;}}else{var _0x12a1a9=as[_0x26f1('0x6b')](_0x84d4f3,_0x36332e[_0x26f1('0x6c')],_0x1ecdaa);_0x1e0583[_0x530711](_0x12a1a9[_0x26f1('0x73')],_0x12a1a9[_0x26f1('0x61')][_0x26f1('0x6d')],_0x12a1a9[_0x26f1('0x61')][_0x26f1('0x1e')]);}}}else{var _0x384645=_(_0x4d203f[_0x26f1('0x39')])[_0x26f1('0x3a')]()[_0x26f1('0x2f')](function(_0x4c463c){return _[_0x26f1('0x74')](_0x40c8ae,[_0x26f1('0x2d'),_0x4c463c])?_0x4c463c:undefined;})['compact']()[_0x26f1('0x61')]();if(!_['isEmpty'](_0x384645)){_0x384645[_0x26f1('0x32')](function(_0x2c39cc){if(_0x2c39cc===_0x26f1('0x75')){_0x4bd236[_0x26f1('0x43')](_0x26f1('0x76'),[][_0x26f1('0x77')](_0x4d203f[_0x26f1('0x39')][_0x2c39cc]));}else if(_0x2c39cc===_0x26f1('0x78')){var _0x1bf5e9=JSON[_0x26f1('0x79')](_0x4d203f['query'][_0x2c39cc])['$gte'];var _0xf3633b=JSON['parse'](_0x4d203f['query'][_0x2c39cc])[_0x26f1('0x7a')];_0x4bd236[_0x26f1('0x43')](_0x26f1('0x7b'),_0x1bf5e9,_0xf3633b);}else{if(_0x4d203f[_0x26f1('0x39')][_0x2c39cc]==='null'){_0x4bd236[_0x26f1('0x43')]('i.'+_0x2c39cc+_0x26f1('0x7c'));}else{_0x4bd236['where']('i.'+_0x2c39cc+_0x26f1('0x7d'),_0x4d203f[_0x26f1('0x39')][_0x2c39cc]);}}});}if(_0x4d203f[_0x26f1('0x39')][_0x26f1('0x7e')]){if(_0x4d203f['query']['read']==0x1){_0x4bd236[_0x26f1('0x62')](_0x26f1('0x7f'));}else{_0x4bd236[_0x26f1('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x4d203f['query'][_0x26f1('0x80')]){_0x45b9db=_['isArray'](_0x4d203f['query'][_0x26f1('0x80')])?_0x4d203f[_0x26f1('0x39')][_0x26f1('0x80')]:new Array(_0x4d203f['query'][_0x26f1('0x80')]);_0x45b9db['forEach'](function(_0x15c0de){_0x2a2901['or'](_0x26f1('0x6e'),'%,'+_0x15c0de+',%');});}if(_0x4d203f[_0x26f1('0x39')]['filter']){var _0x42fc29=_0x4d203f[_0x26f1('0x39')][_0x26f1('0x81')]['replace']('\x5c','\x5c\x5c')[_0x26f1('0x82')](/'/g,'\x27\x27');if(qs[_0x26f1('0x83')](_0x42fc29)){_0x1e0583['or'](_0x26f1('0x84'),_0x42fc29+'%')['or'](_0x26f1('0x85'),_0x42fc29+'%');}_0x1e0583['or'](_0x26f1('0x86'),_0x42fc29+'%');}}_0x4bd236[_0x26f1('0x43')](_0x1e0583);_0x4bd236[_0x26f1('0x87')](_0x26f1('0x88'));var _0x39b0ca={'type':db[_0x26f1('0x89')]['QueryTypes'][_0x26f1('0x8a')],'raw':!![]};var _0x211a61=_0x4bd236[_0x26f1('0x8b')]();_0x211a61[_0x26f1('0x46')]('i.id');_0x211a61[_0x26f1('0x46')](_0x26f1('0x8c'),'unreadMessages');if(_0x308930[_0x26f1('0x41')]){_0x308930[_0x26f1('0x41')][_0x26f1('0x32')](function(_0x4afb91){var _0x861c16=_0x4afb91[0x0]===_0x26f1('0x8d')?_0x4afb91[0x0]:'i.'+_0x4afb91[0x0];_0x4bd236[_0x26f1('0x41')](_0x861c16,_0x4afb91[0x1]===_0x26f1('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x45b9db)){_0x4bd236[_0x26f1('0x62')](_0x2a2901);_0x211a61[_0x26f1('0x43')](_0x26f1('0x8f'),_0x45b9db);}BPromise[_0x26f1('0x90')]()[_0x26f1('0x29')](function(){if(!_0x2315c3){if(_0x4d203f[_0x26f1('0x39')][_0x26f1('0x75')])return;_0x211a61['where'](_0x26f1('0x91'));_0x4bd236['where'](_0x26f1('0x91'));return;}if(_0x4d203f[_0x26f1('0x92')][_0x26f1('0x93')]!==_0x26f1('0x94'))return;return _0x4d203f[_0x26f1('0x92')][_0x26f1('0x95')]({'attributes':['id'],'raw':!![]})[_0x26f1('0x29')](function(_0x5cd3d9){if(_[_0x26f1('0x96')](_0x5cd3d9)){_0x211a61[_0x26f1('0x43')](_0x26f1('0x97'));_0x4bd236[_0x26f1('0x43')](_0x26f1('0x97'));}else{_0x211a61['where'](_0x26f1('0x76'),_[_0x26f1('0x2f')](_0x5cd3d9,'id'));_0x4bd236[_0x26f1('0x43')](_0x26f1('0x76'),_[_0x26f1('0x2f')](_0x5cd3d9,'id'));}});})[_0x26f1('0x29')](function(){if(_0x4d203f[_0x26f1('0x92')]['role']===_0x26f1('0x94')&&!_0x2315c3&&!_0x4d203f[_0x26f1('0x39')][_0x26f1('0x75')])return[];return db[_0x26f1('0x98')][_0x26f1('0x39')](_0x211a61['toString'](),_0x39b0ca);})['then'](function(_0x609f3f){_0x3f5091[_0x26f1('0x23')]=_0x609f3f[_0x26f1('0x3f')];if(_0x3f5091[_0x26f1('0x23')]===0x0)return[];return db[_0x26f1('0x98')]['query'](_0x1cf167[_0x26f1('0x99')](),_0x39b0ca)[_0x26f1('0x29')](function(_0x675ba9){_0x423c59=_['keyBy'](_0x675ba9,'id');_0x39b0ca=_[_0x26f1('0x9a')](_0x39b0ca,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d203f[_0x26f1('0x39')]['fields']){_0x308930[_0x26f1('0x3d')][_0x26f1('0x32')](function(_0x1678a8){_0x4bd236[_0x26f1('0x46')]('i.'+_0x1678a8);});}else{_0x4bd236['field'](_0x26f1('0x8c'),'unreadMessages');_0x4bd236[_0x26f1('0x46')]('a.key','Account.key');_0x4bd236[_0x26f1('0x46')](_0x26f1('0x9b'),'Account.mandatoryDisposition');_0x4bd236[_0x26f1('0x46')]('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');_0x4bd236[_0x26f1('0x46')](_0x26f1('0x9c'));_0x4bd236[_0x26f1('0x46')](_0x26f1('0x9d'),_0x26f1('0x9e'));_0x4bd236[_0x26f1('0x46')](_0x26f1('0x9f'),_0x26f1('0xa0'));_0x4bd236['field'](_0x26f1('0xa1'),'Contact.email');_0x4bd236[_0x26f1('0x46')](_0x26f1('0xa2'),_0x26f1('0xa3'));_0x4bd236[_0x26f1('0x46')](_0x26f1('0xa4'),'Contact.mobile');_0x4bd236['field'](_0x26f1('0xa5'),_0x26f1('0xa6'));_0x4bd236[_0x26f1('0x46')](_0x26f1('0xa7'),_0x26f1('0xa8'));_0x4bd236[_0x26f1('0x46')]('o.internal',_0x26f1('0xa9'));_0x4bd236[_0x26f1('0x46')](_0x26f1('0xaa'),_0x26f1('0x31'));}if(_0x308930[_0x26f1('0x22')])_0x4bd236[_0x26f1('0x22')](_0x308930[_0x26f1('0x22')]);if(_0x308930['offset'])_0x4bd236[_0x26f1('0x20')](_0x308930[_0x26f1('0x20')]);return db[_0x26f1('0x98')]['query'](_0x4bd236[_0x26f1('0x99')](),_0x39b0ca);})[_0x26f1('0x29')](function(_0x38230f){if(_0x38230f[_0x26f1('0x3f')]>0x0)_0x485074[_0x26f1('0x43')](_0x26f1('0xab'),_[_0x26f1('0x2f')](_0x38230f,'id'));return db[_0x26f1('0x98')][_0x26f1('0x39')](_0x485074[_0x26f1('0x99')](),_0x39b0ca)[_0x26f1('0x29')](function(_0x18a81d){var _0x5b2589=_[_0x26f1('0xac')](_0x18a81d,_0x26f1('0xad'));var _0x2b1316=[];_0x38230f['forEach'](function(_0x441d58){_0x2b1316[_0x26f1('0xae')](updateFaxInteraction(_0x441d58,_0x423c59,_0x5b2589));});return BPromise[_0x26f1('0xaf')](_0x2b1316);});});})['then'](function(_0x6d8ab8){_0x3f5091[_0x26f1('0xb0')]=_0x6d8ab8;return _0x3f5091;})['then'](respondWithFilteredResult(_0x25a632,_0x308930))[_0x26f1('0x34')](handleError(_0x25a632,null));};exports['show']=function(_0x116b45,_0xfdddc1){var _0x58db65={'raw':![],'where':{'id':_0x116b45[_0x26f1('0xb1')]['id']}},_0x10fc61={};_0x10fc61['model']=_[_0x26f1('0x3a')](db[_0x26f1('0xb2')]['rawAttributes']);_0x10fc61[_0x26f1('0x39')]=_[_0x26f1('0x3a')](_0x116b45[_0x26f1('0x39')]);_0x10fc61[_0x26f1('0x3b')]=_['intersection'](_0x10fc61['model'],_0x10fc61['query']);_0x58db65[_0x26f1('0x3d')]=_[_0x26f1('0x3c')](_0x10fc61['model'],qs['fields'](_0x116b45[_0x26f1('0x39')][_0x26f1('0x3e')]));_0x58db65['attributes']=_0x58db65[_0x26f1('0x3d')][_0x26f1('0x3f')]?_0x58db65[_0x26f1('0x3d')]:_0x10fc61[_0x26f1('0x38')];if(_0x116b45['query']['includeAll']){_0x58db65[_0x26f1('0xb3')]=[{'all':!![]}];}_0x58db65=_[_0x26f1('0x9a')]({},_0x58db65,_0x116b45['options']);return db[_0x26f1('0xb2')][_0x26f1('0x5f')](_0x58db65)[_0x26f1('0x29')](handleEntityNotFound(_0xfdddc1,null))[_0x26f1('0x29')](respondWithResult(_0xfdddc1,null))[_0x26f1('0x34')](handleError(_0xfdddc1,null));};exports['create']=function(_0x178f2f,_0xdf9a87){return db[_0x26f1('0xb2')][_0x26f1('0xb4')](_0x178f2f[_0x26f1('0xb5')],{})['then'](respondWithResult(_0xdf9a87,0xc9))['catch'](handleError(_0xdf9a87,null));};exports['update']=function(_0x67fdd8,_0x103c98){if(_0x67fdd8[_0x26f1('0xb5')]['id']){delete _0x67fdd8[_0x26f1('0xb5')]['id'];}return db[_0x26f1('0xb2')][_0x26f1('0x5f')]({'where':{'id':_0x67fdd8[_0x26f1('0xb1')]['id']}})[_0x26f1('0x29')](handleEntityNotFound(_0x103c98,null))[_0x26f1('0x29')](saveUpdates(_0x67fdd8[_0x26f1('0xb5')],null))[_0x26f1('0x29')](respondWithResult(_0x103c98,null))['catch'](handleError(_0x103c98,null));};exports[_0x26f1('0x2a')]=function(_0x42c7d6,_0x22e42f){return db['FaxInteraction']['find']({'where':{'id':_0x42c7d6[_0x26f1('0xb1')]['id']}})[_0x26f1('0x29')](handleEntityNotFound(_0x22e42f,null))[_0x26f1('0x29')](removeEntity(_0x22e42f,null))[_0x26f1('0x34')](handleError(_0x22e42f,null));};exports['describe']=function(_0x15fa5a,_0x49cfdd){return db['FaxInteraction']['describe']()['then'](respondWithResult(_0x49cfdd,null))[_0x26f1('0x34')](handleError(_0x49cfdd,null));};exports[_0x26f1('0xb6')]=function(_0x2fcc14,_0x41da34,_0x5dc7a8){return db[_0x26f1('0xb7')][_0x26f1('0x5f')]({'where':{'id':_0x2fcc14[_0x26f1('0xb1')]['id']}})['then'](handleEntityNotFound(_0x41da34,null))[_0x26f1('0x29')](function(_0x31d0d9){if(_0x31d0d9){return _0x31d0d9[_0x26f1('0xb6')](_0x2fcc14[_0x26f1('0xb5')][_0x26f1('0xb8')],_[_0x26f1('0xb9')](_0x2fcc14[_0x26f1('0xb5')],[_0x26f1('0xb8'),'id'])||{});}})[_0x26f1('0x29')](respondWithResult(_0x41da34,null))[_0x26f1('0x34')](handleError(_0x41da34,null));};exports[_0x26f1('0xba')]=function(_0x3b7d09,_0x5c69d8,_0x332409){var _0x2d8797={'raw':![],'where':{}};var _0x3956c6={};var _0x1031a8={'count':0x0,'rows':[]};return db[_0x26f1('0xb2')][_0x26f1('0xbb')]({'where':{'id':_0x3b7d09[_0x26f1('0xb1')]['id']}})[_0x26f1('0x29')](handleEntityNotFound(_0x5c69d8,null))[_0x26f1('0x29')](function(_0xb6ead3){if(_0xb6ead3){_0x3956c6[_0x26f1('0x38')]=_['keys'](db[_0x26f1('0xb7')][_0x26f1('0x36')]);_0x3956c6[_0x26f1('0x39')]=_[_0x26f1('0x3a')](_0x3b7d09[_0x26f1('0x39')]);_0x3956c6[_0x26f1('0x3b')]=_[_0x26f1('0x3c')](_0x3956c6[_0x26f1('0x38')],_0x3956c6[_0x26f1('0x39')]);_0x2d8797[_0x26f1('0x3d')]=_['intersection'](_0x3956c6[_0x26f1('0x38')],qs['fields'](_0x3b7d09[_0x26f1('0x39')][_0x26f1('0x3e')]));_0x2d8797[_0x26f1('0x3d')]=_0x2d8797['attributes'][_0x26f1('0x3f')]?_0x2d8797[_0x26f1('0x3d')]:_0x3956c6[_0x26f1('0x38')];if(!_0x3b7d09[_0x26f1('0x39')][_0x26f1('0xbc')]('nolimit')){_0x2d8797[_0x26f1('0x22')]=qs[_0x26f1('0x22')](_0x3b7d09[_0x26f1('0x39')]['limit']);_0x2d8797[_0x26f1('0x20')]=qs[_0x26f1('0x20')](_0x3b7d09['query'][_0x26f1('0x20')]);}_0x2d8797[_0x26f1('0x41')]=qs[_0x26f1('0x42')](_0x3b7d09[_0x26f1('0x39')][_0x26f1('0x42')]);_0x2d8797[_0x26f1('0x43')]=qs['filters'](_['pick'](_0x3b7d09['query'],_0x3956c6[_0x26f1('0x3b')]));_0x2d8797[_0x26f1('0x43')]['FaxInteractionId']=_0xb6ead3['id'];if(_0x3b7d09['query'][_0x26f1('0x81')]){_0x2d8797[_0x26f1('0x43')]=_[_0x26f1('0x9a')](_0x2d8797[_0x26f1('0x43')],{'$or':_['map'](_0x2d8797[_0x26f1('0x3d')],function(_0x5cbbb2){var _0x6685f9={};_0x6685f9[_0x5cbbb2]={'$like':'%'+_0x3b7d09[_0x26f1('0x39')][_0x26f1('0x81')]+'%'};return _0x6685f9;})});}if(_0x3b7d09['query'][_0x26f1('0xbd')]){var _0x2d678b=_0x3b7d09[_0x26f1('0x39')][_0x26f1('0xbd')]['split'](',');var _0x5a39d8={};_0x5a39d8[_0x2d678b[0x0]]={'$gte':moment(_0x2d678b[0x1])[_0x26f1('0xbe')](_0x26f1('0xbf'))};_0x2d8797[_0x26f1('0x43')]=_[_0x26f1('0x9a')](_0x2d8797[_0x26f1('0x43')],_0x5a39d8);}_0x2d8797=_['merge']({},_0x2d8797,_0x3b7d09[_0x26f1('0xc0')]);return db[_0x26f1('0xb7')][_0x26f1('0x23')]({'where':_0x2d8797['where']})['then'](function(_0x3fca35){_0x1031a8[_0x26f1('0x23')]=_0x3fca35;if(_0x3b7d09[_0x26f1('0x39')][_0x26f1('0xc1')]){_0x2d8797[_0x26f1('0xb3')]=[{'all':!![]}];}return db[_0x26f1('0xb7')][_0x26f1('0xc2')](_0x2d8797);})[_0x26f1('0x29')](function(_0x292996){_0x1031a8[_0x26f1('0xb0')]=_0x292996;return _0x1031a8;});}})[_0x26f1('0x29')](respondWithFilteredResult(_0x5c69d8,_0x2d8797))[_0x26f1('0x34')](handleError(_0x5c69d8,null));};exports[_0x26f1('0xc3')]=function(_0x42a4f7,_0xa2a66b,_0x3e5488){return db['FaxInteraction'][_0x26f1('0x5f')]({'where':{'id':_0x42a4f7['params']['id']}})[_0x26f1('0x29')](handleEntityNotFound(_0xa2a66b,null))[_0x26f1('0x29')](function(_0x3768fc){if(_0x3768fc){return _0x3768fc[_0x26f1('0xc4')](_0x42a4f7[_0x26f1('0xb5')]['ids'],_[_0x26f1('0xb9')](_0x42a4f7[_0x26f1('0xb5')],[_0x26f1('0xb8'),'id'])||{})[_0x26f1('0xc5')](function(){return db[_0x26f1('0xc6')][_0x26f1('0xc2')]({'attributes':['id','name',_0x26f1('0x47')],'where':{'id':_0x42a4f7['body']['ids']}});})[_0x26f1('0x29')](function(_0x3b73b3){socket[_0x26f1('0xc7')](_0x26f1('0xc8'),{'id':Number(_0x42a4f7['params']['id']),'tags':_0x3b73b3||[]});return{'id':Number(_0x42a4f7[_0x26f1('0xb1')]['id']),'tags':_0x3b73b3||[]};});}})[_0x26f1('0x29')](respondWithResult(_0xa2a66b,null))['catch'](handleError(_0xa2a66b,null));};exports[_0x26f1('0xc9')]=function(_0x2e8324,_0x330806,_0x492c2b){return db[_0x26f1('0xb2')][_0x26f1('0x5f')]({'where':{'id':_0x2e8324['params']['id']}})['then'](handleEntityNotFound(_0x330806,null))[_0x26f1('0x29')](function(_0x10a5a3){if(_0x10a5a3){return _0x10a5a3[_0x26f1('0xc9')](_0x2e8324[_0x26f1('0x39')][_0x26f1('0xb8')]);}})['then'](respondWithStatusCode(_0x330806,null))[_0x26f1('0x34')](handleError(_0x330806,null));};exports[_0x26f1('0xca')]=function(_0xb2d680,_0x3106e4){var _0x4f4197=moment()[_0x26f1('0xcb')]()[_0x26f1('0x99')]();var _0x21e1b3=path[_0x26f1('0xcc')](config[_0x26f1('0xcd')],_0x26f1('0xce'),'files',_0x26f1('0xcf'));var _0x574cd2=path[_0x26f1('0xcc')](config['root'],_0x26f1('0xce'),_0x26f1('0xd0'),'attachments');var _0x2b9cdb=path[_0x26f1('0xcc')](_0x21e1b3,_0x4f4197);var _0x4b3aba=util['format'](_0x26f1('0xd1'),_0xb2d680[_0x26f1('0xb1')]['id'],_0x4f4197);var _0x47fa82=path[_0x26f1('0xcc')](_0x21e1b3,_0x4b3aba);var _0x4c2b06=[];_0x4c2b06[_0x26f1('0xae')]({'model':db[_0x26f1('0xd2')],'as':'Attachment','raw':!![]});var _0x1dd5bb=[{'model':db[_0x26f1('0xb7')],'as':_0x26f1('0xd3'),'attributes':['id',_0x26f1('0xb5'),_0x26f1('0x78')],'include':_0x4c2b06}];return db[_0x26f1('0xb2')][_0x26f1('0x5f')]({'where':{'id':_0xb2d680[_0x26f1('0xb1')]['id']},'include':_0x1dd5bb})[_0x26f1('0x29')](handleEntityNotFound(_0x3106e4,null))['then'](function(_0x1f2915){if(_0x1f2915&&_0x1f2915[_0x26f1('0xd3')]){var _0x10ecd6=_0x1f2915[_0x26f1('0xd4')]({'plain':!![]});fs[_0x26f1('0xd5')](_0x2b9cdb);for(var _0x365532=0x0;_0x365532<_0x10ecd6[_0x26f1('0xd3')][_0x26f1('0x3f')];_0x365532++){var _0x2182cc=_0x10ecd6[_0x26f1('0xd3')][_0x365532][_0x26f1('0xd2')];if(_0x2182cc){var _0x3ab3=path[_0x26f1('0xcc')](_0x574cd2,_0x2182cc[_0x26f1('0xd6')]);if(fs['existsSync'](_0x3ab3)){fs[_0x26f1('0xd7')](_0x3ab3)[_0x26f1('0xd8')](fs[_0x26f1('0xd9')](path['join'](_0x2b9cdb,_0x2182cc[_0x26f1('0xd6')])));}}}return BPromise[_0x26f1('0x90')]()['then'](function(){return new BPromise(function(_0xb4f9bc,_0x25d4b5){zipdir(_0x2b9cdb,{'saveTo':_0x47fa82},function(_0x2f2f42,_0x26b7f4){if(_0x2f2f42)return _0x25d4b5(_0x2f2f42);return _0xb4f9bc(_0x26b7f4);});})[_0x26f1('0x29')](function(){return new BPromise(function(_0x4cfbd8,_0x51b421){rimraf(_0x2b9cdb,function(_0x177ae5){if(_0x177ae5)_0x51b421(_0x177ae5);return _0x4cfbd8();});});})[_0x26f1('0x29')](function(){return _0x3106e4[_0x26f1('0xca')](_0x47fa82,_0x4b3aba,function(_0x1754fa){if(_0x1754fa){console[_0x26f1('0xda')](_0x26f1('0xdb'),_0x1754fa);}else{fs['unlinkSync'](_0x47fa82);}});});});}else{return _0x3106e4[_0x26f1('0x1d')](0xc8);}})[_0x26f1('0x34')](handleError(_0x3106e4,null));};
\ No newline at end of file
index 5433d3c..a88d26b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2768=['FaxMessage','setMaxListeners','save','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x90b26c,_0x338438){var _0x3c2b37=function(_0x4dccf6){while(--_0x4dccf6){_0x90b26c['push'](_0x90b26c['shift']());}};_0x3c2b37(++_0x338438);}(_0x2768,0x11c));var _0x8276=function(_0x373922,_0x444867){_0x373922=_0x373922-0x0;var _0x5536d3=_0x2768[_0x373922];return _0x5536d3;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x8276('0x0'))['db'][_0x8276('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8276('0x2')](0x0);var events={'afterCreate':_0x8276('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x256ffb){return function(_0x3528b7,_0x411f7c,_0x393dd4){_0x3528b7[_0x8276('0x4')]({'attributes':['id'],'raw':!![]})[_0x8276('0x5')](function(_0x3fcad6){_0x3528b7[_0x8276('0x6')]('Users',_0x3fcad6[_0x8276('0x7')](function(_0x2264e3){return{'id':_0x2264e3['id']};}));return FaxMessage[_0x8276('0x8')]({'where':{'FaxInteractionId':_0x3528b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8276('0x5')](function(_0x513f6f){_0x3528b7[_0x8276('0x6')]('unreadMessages',_0x513f6f[_0x8276('0x9')]);FaxInteractionEvents['emit'](_0x256ffb+':'+_0x3528b7['id'],_0x3528b7);FaxInteractionEvents[_0x8276('0xa')](_0x256ffb,_0x3528b7);_0x393dd4(null);})[_0x8276('0xb')](_0x393dd4(null));};}for(var e in events){if(events[_0x8276('0xc')](e)){var event=events[e];FaxInteraction[_0x8276('0xd')](e,emitEvent(event));}}module[_0x8276('0xe')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x3972=['map','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','setDataValue'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3972,0x1b8));var _0x2397=function(_0x3cd6ed,_0x558b02){_0x3cd6ed=_0x3cd6ed-0x0;var _0x1a29dd=_0x3972[_0x3cd6ed];return _0x1a29dd;};'use strict';var EventEmitter=require(_0x2397('0x0'));var FaxInteraction=require(_0x2397('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x2397('0x1'))['db'][_0x2397('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2397('0x3')](0x0);var events={'afterCreate':_0x2397('0x4'),'afterUpdate':_0x2397('0x5'),'afterDestroy':_0x2397('0x6')};function emitEvent(_0x23a075){return function(_0x294eaf,_0x13f14c,_0x20ce6c){_0x294eaf['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x49c723){_0x294eaf[_0x2397('0x7')]('Users',_0x49c723[_0x2397('0x8')](function(_0x1f7367){return{'id':_0x1f7367['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x294eaf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5e2912){_0x294eaf[_0x2397('0x7')]('unreadMessages',_0x5e2912['length']);FaxInteractionEvents['emit'](_0x23a075+':'+_0x294eaf['id'],_0x294eaf);FaxInteractionEvents[_0x2397('0x9')](_0x23a075,_0x294eaf);_0x20ce6c(null);})[_0x2397('0xa')](_0x20ce6c(null));};}for(var e in events){if(events[_0x2397('0xb')](e)){var event=events[e];FaxInteraction[_0x2397('0xc')](e,emitEvent(event));}}module[_0x2397('0xd')]=FaxInteractionEvents;
\ No newline at end of file
index 878d359..09c2de7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30bd=['./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x45330f,_0xf726fa){var _0x50ae88=function(_0x373094){while(--_0x373094){_0x45330f['push'](_0x45330f['shift']());}};_0x50ae88(++_0xf726fa);}(_0x30bd,0xf7));var _0xd30b=function(_0x33a2c0,_0x5f2237){_0x33a2c0=_0x33a2c0-0x0;var _0x10815f=_0x30bd[_0x33a2c0];return _0x10815f;};'use strict';var _=require(_0xd30b('0x0'));var util=require(_0xd30b('0x1'));var logger=require('../../config/logger')(_0xd30b('0x2'));var moment=require(_0xd30b('0x3'));var BPromise=require(_0xd30b('0x4'));var rp=require(_0xd30b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd30b('0x6'));var config=require(_0xd30b('0x7'));var attributes=require(_0xd30b('0x8'));module[_0xd30b('0x9')]=function(_0x3b0aac,_0x443610){return _0x3b0aac[_0xd30b('0xa')](_0xd30b('0xb'),attributes,{'tableName':_0xd30b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e8626,_0x1e2e9b,_0x3cf920){if(_0x3e8626[_0xd30b('0xd')](_0xd30b('0xe'))){_0x3e8626['closedAt']=moment()[_0xd30b('0xf')](_0xd30b('0x10'));}_0x3cf920(null,_0x3e8626);}}});};
\ No newline at end of file
+var _0xbbcd=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xbbcd,0xa1));var _0xdbbc=function(_0x4f212b,_0x511139){_0x4f212b=_0x4f212b-0x0;var _0x54aedd=_0xbbcd[_0x4f212b];return _0x54aedd;};'use strict';var _=require(_0xdbbc('0x0'));var util=require(_0xdbbc('0x1'));var logger=require(_0xdbbc('0x2'))(_0xdbbc('0x3'));var moment=require(_0xdbbc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbbc('0x5'));var rimraf=require(_0xdbbc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbbc('0x7'));module[_0xdbbc('0x8')]=function(_0x382e57,_0x45cc88){return _0x382e57[_0xdbbc('0x9')](_0xdbbc('0xa'),attributes,{'tableName':_0xdbbc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ab46e,_0x5589c8,_0x28d593){if(_0x5ab46e[_0xdbbc('0xc')](_0xdbbc('0xd'))){_0x5ab46e[_0xdbbc('0xe')]=moment()['format'](_0xdbbc('0xf'));}_0x28d593(null,_0x5ab46e);}}});};
\ No newline at end of file
index 5d6b4c2..f5c13b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d25=['localhost','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','body','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x59cc3f,_0x4a8091){var _0x5b2a42=function(_0x44a2f3){while(--_0x44a2f3){_0x59cc3f['push'](_0x59cc3f['shift']());}};_0x5b2a42(++_0x4a8091);}(_0x4d25,0x1eb));var _0x54d2=function(_0x48054e,_0x596765){_0x48054e=_0x48054e-0x0;var _0x32f5d9=_0x4d25[_0x48054e];return _0x32f5d9;};'use strict';var _=require(_0x54d2('0x0'));var util=require('util');var moment=require(_0x54d2('0x1'));var BPromise=require('bluebird');var rs=require(_0x54d2('0x2'));var fs=require('fs');var Redis=require(_0x54d2('0x3'));var db=require(_0x54d2('0x4'))['db'];var utils=require(_0x54d2('0x5'));var logger=require(_0x54d2('0x6'))(_0x54d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x54d2('0x8'));var client=jayson[_0x54d2('0x9')][_0x54d2('0xa')]({'port':0x232a});config[_0x54d2('0xb')]=_[_0x54d2('0xc')](config[_0x54d2('0xb')],{'host':_0x54d2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54d2('0xb')]));require(_0x54d2('0xe'))['register'](socket);function respondWithRpcPromise(_0x389101,_0x2ee70f,_0x89b834){return new BPromise(function(_0x4c40fb,_0x5160b3){return client[_0x54d2('0xf')](_0x389101,_0x89b834)['then'](function(_0x188f89){logger[_0x54d2('0x10')](_0x54d2('0x11'),_0x2ee70f,_0x54d2('0x12'));logger[_0x54d2('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2ee70f,_0x54d2('0x12'),JSON[_0x54d2('0x14')](_0x188f89));if(_0x188f89[_0x54d2('0x15')]){if(_0x188f89[_0x54d2('0x15')][_0x54d2('0x16')]===0x1f4){logger[_0x54d2('0x15')](_0x54d2('0x11'),_0x2ee70f,_0x188f89['error'][_0x54d2('0x17')]);return _0x5160b3(_0x188f89[_0x54d2('0x15')][_0x54d2('0x17')]);}logger[_0x54d2('0x15')](_0x54d2('0x11'),_0x2ee70f,_0x188f89['error'][_0x54d2('0x17')]);return _0x4c40fb(_0x188f89[_0x54d2('0x15')][_0x54d2('0x17')]);}else{logger[_0x54d2('0x10')](_0x54d2('0x11'),_0x2ee70f,'request\x20sent');_0x4c40fb(_0x188f89[_0x54d2('0x18')][_0x54d2('0x17')]);}})[_0x54d2('0x19')](function(_0x5e494c){logger['error'](_0x54d2('0x11'),_0x2ee70f,_0x5e494c);_0x5160b3(_0x5e494c);});});}exports[_0x54d2('0x1a')]=function(_0x25e956){var _0x596094=this;return new Promise(function(_0xb9db03,_0x389cab){return db['FaxInteraction']['update'](_0x25e956[_0x54d2('0x1b')],{'raw':_0x25e956[_0x54d2('0x1c')]?_0x25e956[_0x54d2('0x1c')][_0x54d2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e956[_0x54d2('0x1c')]?_0x25e956['options'][_0x54d2('0x1e')]||null:null,'attributes':_0x25e956['options']?_0x25e956[_0x54d2('0x1c')][_0x54d2('0x1f')]||null:null,'limit':_0x25e956[_0x54d2('0x1c')]?_0x25e956['options'][_0x54d2('0x20')]||null:null})[_0x54d2('0x21')](function(_0xe0d982){logger['info']('UpdateFaxInteraction',_0x25e956);logger['debug']('UpdateFaxInteraction',_0x25e956,JSON[_0x54d2('0x14')](_0xe0d982));_0xb9db03(_0xe0d982);})[_0x54d2('0x19')](function(_0xc6f92c){logger[_0x54d2('0x15')](_0x54d2('0x1a'),_0xc6f92c[_0x54d2('0x17')],_0x25e956);_0x389cab(_0x596094[_0x54d2('0x15')](0x1f4,_0xc6f92c['message']));});});};exports[_0x54d2('0x22')]=function(_0x600372){return new Promise(function(_0x260261,_0x31c2c6){return db[_0x54d2('0x23')][_0x54d2('0x24')]({'where':_0x600372[_0x54d2('0x1c')]?_0x600372[_0x54d2('0x1c')][_0x54d2('0x1e')]||null:null})[_0x54d2('0x21')](function(_0x4e8d08){if(_0x4e8d08){return _0x4e8d08[_0x54d2('0x25')](_0x600372['body'][_0x54d2('0x26')],_[_0x54d2('0x27')](_0x600372['body'],[_0x54d2('0x26'),'id'])||{});}})[_0x54d2('0x28')](function(_0x237bf7){logger['info'](_0x54d2('0x29'),_0x600372);logger[_0x54d2('0x13')](_0x54d2('0x29'),_0x600372,JSON[_0x54d2('0x14')](_0x237bf7));_0x260261(_0x237bf7);})[_0x54d2('0x19')](function(_0x237619){logger[_0x54d2('0x15')](_0x54d2('0x29'),_0x237619[_0x54d2('0x17')],_0x600372);_0x31c2c6(_this[_0x54d2('0x15')](0x1f4,_0x237619[_0x54d2('0x17')]));});});};
\ No newline at end of file
+var _0xd8c1=['error','message','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xf67fc,_0x86a57b){var _0x152781=function(_0x3c672a){while(--_0x3c672a){_0xf67fc['push'](_0xf67fc['shift']());}};_0x152781(++_0x86a57b);}(_0xd8c1,0x112));var _0x1d8c=function(_0x58dc20,_0x108194){_0x58dc20=_0x58dc20-0x0;var _0x9d7260=_0xd8c1[_0x58dc20];return _0x9d7260;};'use strict';var _=require(_0x1d8c('0x0'));var util=require(_0x1d8c('0x1'));var moment=require(_0x1d8c('0x2'));var BPromise=require(_0x1d8c('0x3'));var rs=require(_0x1d8c('0x4'));var fs=require('fs');var Redis=require(_0x1d8c('0x5'));var db=require(_0x1d8c('0x6'))['db'];var utils=require(_0x1d8c('0x7'));var logger=require(_0x1d8c('0x8'))(_0x1d8c('0x9'));var config=require(_0x1d8c('0xa'));var jayson=require(_0x1d8c('0xb'));var client=jayson[_0x1d8c('0xc')]['http']({'port':0x232a});config[_0x1d8c('0xd')]=_[_0x1d8c('0xe')](config[_0x1d8c('0xd')],{'host':_0x1d8c('0xf'),'port':0x18eb});var socket=require(_0x1d8c('0x10'))(new Redis(config[_0x1d8c('0xd')]));require(_0x1d8c('0x11'))[_0x1d8c('0x12')](socket);function respondWithRpcPromise(_0x2f61a1,_0x66278,_0x46c620){return new BPromise(function(_0x43c20a,_0x1991d2){return client[_0x1d8c('0x13')](_0x2f61a1,_0x46c620)[_0x1d8c('0x14')](function(_0x125281){logger[_0x1d8c('0x15')](_0x1d8c('0x16'),_0x66278,'request\x20sent');logger[_0x1d8c('0x17')](_0x1d8c('0x18'),_0x66278,_0x1d8c('0x19'),JSON[_0x1d8c('0x1a')](_0x125281));if(_0x125281[_0x1d8c('0x1b')]){if(_0x125281['error']['code']===0x1f4){logger[_0x1d8c('0x1b')]('FaxInteraction,\x20%s,\x20%s',_0x66278,_0x125281[_0x1d8c('0x1b')][_0x1d8c('0x1c')]);return _0x1991d2(_0x125281[_0x1d8c('0x1b')][_0x1d8c('0x1c')]);}logger[_0x1d8c('0x1b')](_0x1d8c('0x16'),_0x66278,_0x125281[_0x1d8c('0x1b')][_0x1d8c('0x1c')]);return _0x43c20a(_0x125281[_0x1d8c('0x1b')][_0x1d8c('0x1c')]);}else{logger[_0x1d8c('0x15')](_0x1d8c('0x16'),_0x66278,_0x1d8c('0x19'));_0x43c20a(_0x125281['result'][_0x1d8c('0x1c')]);}})[_0x1d8c('0x1d')](function(_0x35d000){logger[_0x1d8c('0x1b')](_0x1d8c('0x16'),_0x66278,_0x35d000);_0x1991d2(_0x35d000);});});}exports['UpdateFaxInteraction']=function(_0x5d8752){var _0x3aaf44=this;return new Promise(function(_0x543fdb,_0x5820dc){return db[_0x1d8c('0x1e')][_0x1d8c('0x1f')](_0x5d8752[_0x1d8c('0x20')],{'raw':_0x5d8752[_0x1d8c('0x21')]?_0x5d8752[_0x1d8c('0x21')][_0x1d8c('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d8752[_0x1d8c('0x21')]?_0x5d8752[_0x1d8c('0x21')][_0x1d8c('0x23')]||null:null,'attributes':_0x5d8752[_0x1d8c('0x21')]?_0x5d8752[_0x1d8c('0x21')][_0x1d8c('0x24')]||null:null,'limit':_0x5d8752[_0x1d8c('0x21')]?_0x5d8752['options'][_0x1d8c('0x25')]||null:null})['then'](function(_0x40bd58){logger[_0x1d8c('0x15')](_0x1d8c('0x26'),_0x5d8752);logger[_0x1d8c('0x17')](_0x1d8c('0x26'),_0x5d8752,JSON['stringify'](_0x40bd58));_0x543fdb(_0x40bd58);})[_0x1d8c('0x1d')](function(_0x386d4e){logger[_0x1d8c('0x1b')](_0x1d8c('0x26'),_0x386d4e['message'],_0x5d8752);_0x5820dc(_0x3aaf44['error'](0x1f4,_0x386d4e[_0x1d8c('0x1c')]));});});};exports[_0x1d8c('0x27')]=function(_0x1bd7da){return new Promise(function(_0x3a0661,_0x195624){return db[_0x1d8c('0x1e')][_0x1d8c('0x28')]({'where':_0x1bd7da['options']?_0x1bd7da[_0x1d8c('0x21')]['where']||null:null})['then'](function(_0x4f0db2){if(_0x4f0db2){return _0x4f0db2['addTags'](_0x1bd7da[_0x1d8c('0x20')][_0x1d8c('0x29')],_['omit'](_0x1bd7da['body'],[_0x1d8c('0x29'),'id'])||{});}})['spread'](function(_0x4eb955){logger[_0x1d8c('0x15')](_0x1d8c('0x2a'),_0x1bd7da);logger[_0x1d8c('0x17')](_0x1d8c('0x2a'),_0x1bd7da,JSON[_0x1d8c('0x1a')](_0x4eb955));_0x3a0661(_0x4eb955);})[_0x1d8c('0x1d')](function(_0x5cd88e){logger[_0x1d8c('0x1b')](_0x1d8c('0x2a'),_0x5cd88e[_0x1d8c('0x1c')],_0x1bd7da);_0x195624(_this[_0x1d8c('0x1b')](0x1f4,_0x5cd88e[_0x1d8c('0x1c')]));});});};
\ No newline at end of file
index c7a19b9..71df038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9800=['remove','update','register','faxInteraction:','./faxInteraction.events','save'];(function(_0x3abc4c,_0x597f7c){var _0x501fef=function(_0x46dbb9){while(--_0x46dbb9){_0x3abc4c['push'](_0x3abc4c['shift']());}};_0x501fef(++_0x597f7c);}(_0x9800,0x1a8));var _0x0980=function(_0x2af12e,_0x3f1291){_0x2af12e=_0x2af12e-0x0;var _0x375b9a=_0x9800[_0x2af12e];return _0x375b9a;};'use strict';var FaxInteractionEvents=require(_0x0980('0x0'));var events=[_0x0980('0x1'),_0x0980('0x2'),_0x0980('0x3')];function createListener(_0x3395dd,_0x2d8a11){return function(_0x4c3cc3){_0x2d8a11['emit'](_0x3395dd,_0x4c3cc3);};}function removeListener(_0x421081,_0x176710){return function(){FaxInteractionEvents['removeListener'](_0x421081,_0x176710);};}exports[_0x0980('0x4')]=function(_0x10b243){for(var _0x220012=0x0,_0x5a320a=events['length'];_0x220012<_0x5a320a;_0x220012++){var _0x3c6cd7=events[_0x220012];var _0x37b359=createListener(_0x0980('0x5')+_0x3c6cd7,_0x10b243);FaxInteractionEvents['on'](_0x3c6cd7,_0x37b359);}};
\ No newline at end of file
+var _0x6a92=['faxInteraction:','./faxInteraction.events','save','removeListener'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x6a92,0x1ad));var _0x26a9=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x6a92[_0x1a72f3];return _0x57ef47;};'use strict';var FaxInteractionEvents=require(_0x26a9('0x0'));var events=[_0x26a9('0x1'),'remove','update'];function createListener(_0x57d8c2,_0x135b42){return function(_0x46ef1f){_0x135b42['emit'](_0x57d8c2,_0x46ef1f);};}function removeListener(_0x55d0af,_0x4e39bc){return function(){FaxInteractionEvents[_0x26a9('0x2')](_0x55d0af,_0x4e39bc);};}exports['register']=function(_0x1a0325){for(var _0x1e6215=0x0,_0x235ec5=events['length'];_0x1e6215<_0x235ec5;_0x1e6215++){var _0x2ae51a=events[_0x1e6215];var _0xbb0f87=createListener(_0x26a9('0x3')+_0x2ae51a,_0x1a0325);FaxInteractionEvents['on'](_0x2ae51a,_0xbb0f87);}};
\ No newline at end of file
index 3e70b09..5909d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ad=['faxinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','/:id','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5ad,0xea));var _0xdc5a=function(_0x4df168,_0x411644){_0x4df168=_0x4df168-0x0;var _0x55b12e=_0xc5ad[_0x4df168];return _0x55b12e;};'use strict';var multer=require(_0xdc5a('0x0'));var util=require(_0xdc5a('0x1'));var path=require(_0xdc5a('0x2'));var timeout=require(_0xdc5a('0x3'));var express=require(_0xdc5a('0x4'));var router=express[_0xdc5a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc5a('0x6'));var interaction=require(_0xdc5a('0x7'));var config=require(_0xdc5a('0x8'));var controller=require(_0xdc5a('0x9'));router[_0xdc5a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc5a('0xa')]('/describe',auth[_0xdc5a('0xb')](),controller[_0xdc5a('0xc')]);router['get'](_0xdc5a('0xd'),auth[_0xdc5a('0xb')](),controller['show']);router[_0xdc5a('0xa')]('/:id/messages',auth[_0xdc5a('0xb')](),controller['getMessages']);router[_0xdc5a('0xa')](_0xdc5a('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xdc5a('0xf')]('/',auth[_0xdc5a('0xb')](),controller[_0xdc5a('0x10')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xdc5a('0x11')]);router['post'](_0xdc5a('0x12'),auth['isAuthenticated'](),interaction[_0xdc5a('0x13')](_0xdc5a('0x14'),_0xdc5a('0x15')),controller[_0xdc5a('0x16')]);router[_0xdc5a('0x17')](_0xdc5a('0xd'),auth['isAuthenticated'](),interaction[_0xdc5a('0x13')](_0xdc5a('0x14'),_0xdc5a('0x18')),controller[_0xdc5a('0x19')]);router[_0xdc5a('0x1a')](_0xdc5a('0xd'),auth[_0xdc5a('0xb')](),interaction[_0xdc5a('0x13')]('fax',_0xdc5a('0x1b')),controller[_0xdc5a('0x1c')]);router[_0xdc5a('0x1a')](_0xdc5a('0x12'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x4e60=['fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','addTags','put'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4e60,0x150));var _0x04e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e60[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x04e6('0x0'));var util=require(_0x04e6('0x1'));var path=require(_0x04e6('0x2'));var timeout=require(_0x04e6('0x3'));var express=require(_0x04e6('0x4'));var router=express[_0x04e6('0x5')]();var fs_extra=require(_0x04e6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x04e6('0x7'));var config=require('../../config/environment');var controller=require(_0x04e6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x04e6('0x9')]);router[_0x04e6('0xa')](_0x04e6('0xb'),auth[_0x04e6('0xc')](),controller[_0x04e6('0xd')]);router[_0x04e6('0xa')](_0x04e6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x04e6('0xa')](_0x04e6('0xf'),auth[_0x04e6('0xc')](),controller[_0x04e6('0x10')]);router[_0x04e6('0xa')](_0x04e6('0x11'),auth[_0x04e6('0xc')](),controller[_0x04e6('0x12')]);router[_0x04e6('0x13')]('/',auth[_0x04e6('0xc')](),controller['create']);router['post']('/:id/messages',auth[_0x04e6('0xc')](),controller['addMessage']);router[_0x04e6('0x13')](_0x04e6('0x14'),auth[_0x04e6('0xc')](),interaction[_0x04e6('0x15')]('fax','faxinteraction:addtags'),controller[_0x04e6('0x16')]);router[_0x04e6('0x17')](_0x04e6('0xe'),auth[_0x04e6('0xc')](),interaction[_0x04e6('0x15')](_0x04e6('0x18'),_0x04e6('0x19')),controller[_0x04e6('0x1a')]);router[_0x04e6('0x1b')](_0x04e6('0xe'),auth[_0x04e6('0xc')](),interaction[_0x04e6('0x15')](_0x04e6('0x18'),_0x04e6('0x1c')),controller[_0x04e6('0x1d')]);router[_0x04e6('0x1b')]('/:id/tags',auth[_0x04e6('0xc')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 8377e7b..33b3236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x4b98e7,_0x2f0ca1){var _0x1b6839=function(_0x48f5ea){while(--_0x48f5ea){_0x4b98e7['push'](_0x4b98e7['shift']());}};_0x1b6839(++_0x2f0ca1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0xf3cd[_0x5b5eb4];return _0x42af53;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}};
\ No newline at end of file
+var _0x7846=['TEXT','medium','BOOLEAN','ENUM','out','DATE','exports'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7846,0xf4));var _0x6784=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x7846[_0x1b8f5a];return _0x594189;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'body':{'type':Sequelize[_0x6784('0x1')](_0x6784('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6784('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6784('0x4')]('in',_0x6784('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x6784('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6784('0x6')]}};
\ No newline at end of file
index df30ed4..d728223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x715e=['UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','SIP/%s','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/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','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','name','send','index','map','FaxMessage','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x715e,0x153));var _0xe715=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x715e[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0xe715('0x0'));var rimraf=require(_0xe715('0x1'));var zipdir=require(_0xe715('0x2'));var jsonpatch=require(_0xe715('0x3'));var rp=require(_0xe715('0x4'));var moment=require(_0xe715('0x5'));var BPromise=require(_0xe715('0x6'));var Mustache=require(_0xe715('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe715('0x8'));var csv=require(_0xe715('0x9'));var ejs=require(_0xe715('0xa'));var fs=require('fs');var fs_extra=require(_0xe715('0xb'));var _=require(_0xe715('0xc'));var squel=require(_0xe715('0xd'));var crypto=require(_0xe715('0xe'));var jsforce=require(_0xe715('0xf'));var deskjs=require(_0xe715('0x10'));var toCsv=require(_0xe715('0x9'));var querystring=require(_0xe715('0x11'));var Papa=require(_0xe715('0x12'));var Redis=require(_0xe715('0x13'));var authService=require(_0xe715('0x14'));var qs=require(_0xe715('0x15'));var as=require(_0xe715('0x16'));var hardwareService=require(_0xe715('0x17'));var logger=require(_0xe715('0x18'))(_0xe715('0x19'));var utils=require('../../config/utils');var config=require(_0xe715('0x1a'));var licenseUtil=require(_0xe715('0x1b'));var db=require(_0xe715('0x1c'))['db'];config['redis']=_['defaults'](config[_0xe715('0x1d')],{'host':_0xe715('0x1e'),'port':0x18eb});var socket=require(_0xe715('0x1f'))(new Redis(config[_0xe715('0x1d')]));require(_0xe715('0x20'))[_0xe715('0x21')](socket);var jayson=require(_0xe715('0x22'));var client=jayson['client'][_0xe715('0x23')]({'port':0x232c});var client9002=jayson[_0xe715('0x24')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25aa11,_0x2d7601,_0x2f4536,_0x2c63f1){return new BPromise(function(_0x435b09,_0x566807){var _0x473019=_0x2c63f1||client;return _0x473019[_0xe715('0x25')](_0x25aa11,_0x2f4536)[_0xe715('0x26')](function(_0x2f4ed3){logger[_0xe715('0x27')](_0xe715('0x28'),_0x2d7601,'request\x20sent');logger[_0xe715('0x29')](_0xe715('0x2a'),_0x2d7601,_0xe715('0x2b'),JSON['stringify'](_0x2f4ed3));if(_0x2f4ed3[_0xe715('0x2c')]){if(_0x2f4ed3['error'][_0xe715('0x2d')]===0x1f4){logger[_0xe715('0x2c')](_0xe715('0x28'),_0x2d7601,_0x2f4ed3['error'][_0xe715('0x2e')]);return _0x566807(_0x2f4ed3[_0xe715('0x2c')][_0xe715('0x2e')]);}logger['error'](_0xe715('0x28'),_0x2d7601,_0x2f4ed3[_0xe715('0x2c')][_0xe715('0x2e')]);return _0x435b09(_0x2f4ed3[_0xe715('0x2c')][_0xe715('0x2e')]);}else{logger[_0xe715('0x27')](_0xe715('0x28'),_0x2d7601,_0xe715('0x2b'));_0x435b09(_0x2f4ed3['result'][_0xe715('0x2e')]);}})[_0xe715('0x2f')](function(_0x26cc59){logger[_0xe715('0x2c')](_0xe715('0x28'),_0x2d7601,_0x26cc59);_0x566807(_0x26cc59);});});}function respondWithStatusCode(_0x52a83b,_0x1a694f){_0x1a694f=_0x1a694f||0xcc;return function(_0x5cb1e9){if(_0x5cb1e9){return _0x52a83b[_0xe715('0x30')](_0x1a694f);}return _0x52a83b[_0xe715('0x31')](_0x1a694f)[_0xe715('0x32')]();};}function respondWithResult(_0x5cbde0,_0x5134f5){_0x5134f5=_0x5134f5||0xc8;return function(_0x597bf5){if(_0x597bf5){return _0x5cbde0[_0xe715('0x31')](_0x5134f5)[_0xe715('0x33')](_0x597bf5);}};}function respondWithFilteredResult(_0x30ffbe,_0x39c4cf){return function(_0x33c313){if(_0x33c313){var _0xefb0ee=typeof _0x39c4cf[_0xe715('0x34')]===_0xe715('0x35')&&typeof _0x39c4cf[_0xe715('0x36')]===_0xe715('0x35');var _0x59973f=_0x33c313['count'];var _0x4b2da8=_0xefb0ee?0x0:_0x39c4cf[_0xe715('0x34')];var _0x420266=_0xefb0ee?_0x33c313[_0xe715('0x37')]:_0x39c4cf[_0xe715('0x34')]+_0x39c4cf[_0xe715('0x36')];var _0x279d67;if(_0x420266>=_0x59973f){_0x420266=_0x59973f;_0x279d67=0xc8;}else{_0x279d67=0xce;}_0x30ffbe['status'](_0x279d67);return _0x30ffbe['set'](_0xe715('0x38'),_0x4b2da8+'-'+_0x420266+'/'+_0x59973f)[_0xe715('0x33')](_0x33c313);}return null;};}function patchUpdates(_0x23b18f){return function(_0x424251){try{jsonpatch[_0xe715('0x39')](_0x424251,_0x23b18f,!![]);}catch(_0x11daf4){return BPromise[_0xe715('0x3a')](_0x11daf4);}return _0x424251['save']();};}function saveUpdates(_0x21e86f,_0x53703e){return function(_0xc3a9){if(_0xc3a9){return _0xc3a9[_0xe715('0x3b')](_0x21e86f)[_0xe715('0x26')](function(_0x4cd18f){return _0x4cd18f;});}return null;};}function removeEntity(_0x50734f,_0x4b60e2){return function(_0x3e71ff){if(_0x3e71ff){return _0x3e71ff[_0xe715('0x3c')]()[_0xe715('0x26')](function(){_0x50734f[_0xe715('0x31')](0xcc)[_0xe715('0x32')]();});}};}function handleEntityNotFound(_0x284ffb,_0x4903e8){return function(_0x1dd586){if(!_0x1dd586){_0x284ffb[_0xe715('0x30')](0x194);}return _0x1dd586;};}function handleError(_0x105bb3,_0x314723){_0x314723=_0x314723||0x1f4;return function(_0x45c7dc){logger[_0xe715('0x2c')](_0x45c7dc['stack']);if(_0x45c7dc[_0xe715('0x3d')]){delete _0x45c7dc[_0xe715('0x3d')];}_0x105bb3[_0xe715('0x31')](_0x314723)[_0xe715('0x3e')](_0x45c7dc);};}exports[_0xe715('0x3f')]=function(_0x181ab5,_0x3a6044){var _0x5d35cc={},_0x228afb={},_0x154a3e={'count':0x0,'rows':[]};var _0x19c6a7=_[_0xe715('0x40')](db[_0xe715('0x41')]['rawAttributes'],function(_0x35d4fb){return{'name':_0x35d4fb['fieldName'],'type':_0x35d4fb[_0xe715('0x42')]['key']};});_0x228afb['model']=_[_0xe715('0x40')](_0x19c6a7,'name');_0x228afb[_0xe715('0x43')]=_[_0xe715('0x44')](_0x181ab5['query']);_0x228afb['filters']=_[_0xe715('0x45')](_0x228afb[_0xe715('0x46')],_0x228afb[_0xe715('0x43')]);_0x5d35cc['attributes']=_[_0xe715('0x45')](_0x228afb[_0xe715('0x46')],qs[_0xe715('0x47')](_0x181ab5[_0xe715('0x43')][_0xe715('0x47')]));_0x5d35cc[_0xe715('0x48')]=_0x5d35cc[_0xe715('0x48')][_0xe715('0x49')]?_0x5d35cc['attributes']:_0x228afb['model'];if(!_0x181ab5[_0xe715('0x43')][_0xe715('0x4a')](_0xe715('0x4b'))){_0x5d35cc[_0xe715('0x36')]=qs['limit'](_0x181ab5[_0xe715('0x43')][_0xe715('0x36')]);_0x5d35cc[_0xe715('0x34')]=qs[_0xe715('0x34')](_0x181ab5[_0xe715('0x43')][_0xe715('0x34')]);}_0x5d35cc[_0xe715('0x4c')]=qs['sort'](_0x181ab5[_0xe715('0x43')][_0xe715('0x4d')]);_0x5d35cc['where']=qs[_0xe715('0x4e')](_[_0xe715('0x4f')](_0x181ab5['query'],_0x228afb[_0xe715('0x4e')]),_0x19c6a7);if(_0x181ab5[_0xe715('0x43')][_0xe715('0x50')]){_0x5d35cc[_0xe715('0x51')]=_[_0xe715('0x52')](_0x5d35cc['where'],{'$or':_[_0xe715('0x40')](_0x19c6a7,function(_0x5c5160){if(_0x5c5160[_0xe715('0x42')]!==_0xe715('0x53')){var _0x4467e7={};_0x4467e7[_0x5c5160[_0xe715('0x3d')]]={'$like':'%'+_0x181ab5[_0xe715('0x43')][_0xe715('0x50')]+'%'};return _0x4467e7;}})});}_0x5d35cc=_[_0xe715('0x52')]({},_0x5d35cc,_0x181ab5[_0xe715('0x54')]);var _0x367e67={'where':_0x5d35cc[_0xe715('0x51')]};return db[_0xe715('0x41')]['count'](_0x367e67)['then'](function(_0x31337d){_0x154a3e['count']=_0x31337d;if(_0x181ab5['query'][_0xe715('0x55')]){_0x5d35cc[_0xe715('0x56')]=[{'all':!![]}];}return db[_0xe715('0x41')][_0xe715('0x57')](_0x5d35cc);})[_0xe715('0x26')](function(_0x245fb9){_0x154a3e[_0xe715('0x58')]=_0x245fb9;return _0x154a3e;})['then'](respondWithFilteredResult(_0x3a6044,_0x5d35cc))[_0xe715('0x2f')](handleError(_0x3a6044,null));};exports[_0xe715('0x59')]=function(_0x3c97e7,_0x4d077a){var _0x2fcc12={'raw':!![],'where':{'id':_0x3c97e7[_0xe715('0x5a')]['id']}},_0xa43990={};_0xa43990['model']=_[_0xe715('0x44')](db[_0xe715('0x41')][_0xe715('0x5b')]);_0xa43990['query']=_[_0xe715('0x44')](_0x3c97e7['query']);_0xa43990[_0xe715('0x4e')]=_[_0xe715('0x45')](_0xa43990[_0xe715('0x46')],_0xa43990[_0xe715('0x43')]);_0x2fcc12[_0xe715('0x48')]=_['intersection'](_0xa43990[_0xe715('0x46')],qs[_0xe715('0x47')](_0x3c97e7[_0xe715('0x43')][_0xe715('0x47')]));_0x2fcc12[_0xe715('0x48')]=_0x2fcc12[_0xe715('0x48')][_0xe715('0x49')]?_0x2fcc12[_0xe715('0x48')]:_0xa43990[_0xe715('0x46')];if(_0x3c97e7[_0xe715('0x43')][_0xe715('0x55')]){_0x2fcc12[_0xe715('0x56')]=[{'all':!![]}];}_0x2fcc12=_['merge']({},_0x2fcc12,_0x3c97e7[_0xe715('0x54')]);return db[_0xe715('0x41')][_0xe715('0x5c')](_0x2fcc12)[_0xe715('0x26')](handleEntityNotFound(_0x4d077a,null))[_0xe715('0x26')](respondWithResult(_0x4d077a,null))['catch'](handleError(_0x4d077a,null));};exports[_0xe715('0x3b')]=function(_0x4039fa,_0x8564ed){if(_0x4039fa[_0xe715('0x5d')]['id']){delete _0x4039fa[_0xe715('0x5d')]['id'];}return db['FaxMessage'][_0xe715('0x5c')]({'where':{'id':_0x4039fa['params']['id']}})[_0xe715('0x26')](handleEntityNotFound(_0x8564ed,null))[_0xe715('0x26')](saveUpdates(_0x4039fa[_0xe715('0x5d')],null))['then'](respondWithResult(_0x8564ed,null))[_0xe715('0x2f')](handleError(_0x8564ed,null));};exports['destroy']=function(_0x10e77d,_0x12896c){return db[_0xe715('0x41')][_0xe715('0x5c')]({'where':{'id':_0x10e77d[_0xe715('0x5a')]['id']}})[_0xe715('0x26')](handleEntityNotFound(_0x12896c,null))['then'](removeEntity(_0x12896c,null))[_0xe715('0x2f')](handleError(_0x12896c,null));};exports[_0xe715('0x5e')]=function(_0x5c0a53,_0x2755d0){return db['FaxMessage'][_0xe715('0x5e')]()[_0xe715('0x26')](respondWithResult(_0x2755d0,null))[_0xe715('0x2f')](handleError(_0x2755d0,null));};var interaction_log=require(_0xe715('0x18'))(_0xe715('0x5f'));exports[_0xe715('0x60')]=function(_0x386655,_0x3b3b0a,_0x3d206f){var _0x2d9af8={'agent':{},'channel':_0xe715('0x61')};if(_0x386655[_0xe715('0x5d')]['id']){delete _0x386655['body']['id'];}_0x386655[_0xe715('0x5d')][_0xe715('0x62')]=!![];_0x386655[_0xe715('0x5d')][_0xe715('0x63')]=moment()[_0xe715('0x64')](_0xe715('0x65'));_0x386655[_0xe715('0x5d')][_0xe715('0x66')]=_0x386655['body'][_0xe715('0x66')]||_0x386655[_0xe715('0x67')]['id'];_0x2d9af8[_0xe715('0x68')]['id']=_0x386655['body']['UserId'];return db['FaxMessage'][_0xe715('0x5c')]({'where':{'id':_0x386655[_0xe715('0x5a')]['id'],'UserId':null}})[_0xe715('0x26')](handleEntityNotFound(_0x3b3b0a,null))[_0xe715('0x26')](saveUpdates(_0x386655[_0xe715('0x5d')],null))[_0xe715('0x26')](function(_0x2c42f4){if(_0x2c42f4){_0x2d9af8[_0xe715('0x2e')]=_0x2c42f4[_0xe715('0x69')]({'plain':!![]});return db[_0xe715('0x6a')][_0xe715('0x5c')]({'where':{'id':_0x2c42f4[_0xe715('0x6b')]}});}return null;})[_0xe715('0x26')](handleEntityNotFound(_0x3b3b0a,null))[_0xe715('0x26')](function(_0x1cf5d3){if(_0x1cf5d3){return _0x1cf5d3[_0xe715('0x3b')]({'UserId':_0x386655[_0xe715('0x5d')][_0xe715('0x66')],'read1stAt':_[_0xe715('0x6c')](_0x1cf5d3[_0xe715('0x6d')])?moment()['format'](_0xe715('0x65')):undefined});}return null;})['then'](function(_0x1e5359){if(_0x1e5359){_0x2d9af8[_0xe715('0x6e')]=_0x1e5359[_0xe715('0x69')]({'plain':!![]});interaction_log[_0xe715('0x27')](_0xe715('0x6f'),_0x386655[_0xe715('0x67')]['id'],_0x386655[_0xe715('0x67')][_0xe715('0x3d')],_0x386655[_0xe715('0x67')][_0xe715('0x70')],_0x2d9af8[_0xe715('0x6e')]['id'],_0x386655['body']?JSON[_0xe715('0x71')](_0x386655[_0xe715('0x5d')]):_0xe715('0x72'));return respondWithRpcPromise('AcceptMessage',_0xe715('0x73'),_0x2d9af8);}return null;})[_0xe715('0x26')](function(_0x2f3cfd){var _0xd22edf=_0xe715('0x74')+_0x2f3cfd[_0xe715('0x2e')][_0xe715('0x75')];return db[_0xe715('0x76')][_0xe715('0x43')](_0xd22edf,{'type':db[_0xe715('0x77')][_0xe715('0x78')][_0xe715('0x79')],'raw':!![]})[_0xe715('0x26')](function(_0x4324d8){return _0x4324d8;});})[_0xe715('0x26')](function(_0x42978d){if(_0x42978d){_0x2d9af8[_0xe715('0x2e')][_0xe715('0x7a')]=_0x42978d[0x0];if(!_0x386655['body']['UserId'])return;return db[_0xe715('0x7b')]['find']({'where':{'id':_0x386655[_0xe715('0x5d')][_0xe715('0x66')],'role':_0xe715('0x68')},'attributes':['id',_0xe715('0x3d'),_0xe715('0x7c'),_0xe715('0x7d'),'internal'],'raw':!![]});}return null;})[_0xe715('0x26')](function(_0x343072){if(!_0x343072)return null;_0x2d9af8['message']['agent']=_0x343072;return _0x2d9af8;})[_0xe715('0x26')](function(_0x6d6311){if(_0x6d6311){if(_0x386655[_0xe715('0x5d')][_0xe715('0x7e')]){_0x2d9af8['message'][_0xe715('0x7f')]=util[_0xe715('0x64')]('SIP/%s',_0x386655['user'][_0xe715('0x3d')]);_0x2d9af8['message'][_0xe715('0x80')]=_0x2d9af8['channel'];_0x2d9af8[_0xe715('0x2e')]['event']=_0xe715('0x60');return respondWithRpcPromise(_0xe715('0x81'),_0xe715('0x81'),{'event':'acceptmessage','message':_0x2d9af8[_0xe715('0x2e')]},client9002)[_0xe715('0x26')](function(){return _0x2d9af8;});}return _0x2d9af8;}return null;})[_0xe715('0x26')](respondWithResult(_0x3b3b0a,null))[_0xe715('0x2f')](handleError(_0x3b3b0a,null));};var interaction_log=require(_0xe715('0x18'))(_0xe715('0x5f'));exports[_0xe715('0x3a')]=function(_0x579fd3,_0x1118f1,_0x1f9ddb){var _0xa58ed6={'agent':{},'channel':_0xe715('0x61')};if(_0x579fd3[_0xe715('0x5d')]['id']){delete _0x579fd3[_0xe715('0x5d')]['id'];}_0x579fd3[_0xe715('0x5d')][_0xe715('0x66')]=_0x579fd3[_0xe715('0x5d')][_0xe715('0x66')]||_0x579fd3[_0xe715('0x67')]['id'];_0xa58ed6['agent']['id']=_0x579fd3[_0xe715('0x5d')][_0xe715('0x66')];return db[_0xe715('0x41')][_0xe715('0x5c')]({'where':{'id':_0x579fd3[_0xe715('0x5a')]['id'],'UserId':null}})[_0xe715('0x26')](handleEntityNotFound(_0x1118f1,null))['then'](function(_0x53dc6a){if(_0x53dc6a){_0xa58ed6[_0xe715('0x2e')]=_0x53dc6a[_0xe715('0x69')]({'plain':!![]});return db[_0xe715('0x6a')][_0xe715('0x5c')]({'where':{'id':_0x53dc6a[_0xe715('0x6b')]}});}return null;})[_0xe715('0x26')](handleEntityNotFound(_0x1118f1,null))[_0xe715('0x26')](function(_0x1dffe4){if(_0x1dffe4){_0xa58ed6[_0xe715('0x6e')]=_0x1dffe4[_0xe715('0x69')]({'plain':!![]});interaction_log[_0xe715('0x27')](_0xe715('0x82'),_0x579fd3[_0xe715('0x67')]['id'],_0x579fd3[_0xe715('0x67')]['name'],_0x579fd3[_0xe715('0x67')]['role'],_0xa58ed6['interaction']['id'],_0x579fd3[_0xe715('0x5d')]?JSON[_0xe715('0x71')](_0x579fd3[_0xe715('0x5d')]):_0xe715('0x72'));return respondWithRpcPromise(_0xe715('0x83'),'rejectMessage',_0xa58ed6);}return null;})[_0xe715('0x26')](function(_0x5b0af6){var _0x545b26=_0xe715('0x74')+_0x5b0af6['message'][_0xe715('0x75')];return db[_0xe715('0x76')][_0xe715('0x43')](_0x545b26,{'type':db[_0xe715('0x77')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe715('0x26')](function(_0x58d2e2){return _0x58d2e2;});})[_0xe715('0x26')](function(_0x34d2f6){if(_0x34d2f6){_0xa58ed6['message'][_0xe715('0x7a')]=_0x34d2f6[0x0];if(!_0x579fd3[_0xe715('0x5d')][_0xe715('0x66')])return;return db[_0xe715('0x7b')][_0xe715('0x5c')]({'where':{'id':_0x579fd3[_0xe715('0x5d')]['UserId'],'role':_0xe715('0x68')},'attributes':['id',_0xe715('0x3d'),_0xe715('0x7c'),'email',_0xe715('0x84')],'raw':!![]});}return null;})['then'](function(_0x263f0b){if(!_0x263f0b)return null;_0xa58ed6[_0xe715('0x2e')][_0xe715('0x68')]=_0x263f0b;return _0xa58ed6;})[_0xe715('0x26')](function(_0x532ebf){if(_0x532ebf){_0x532ebf[_0xe715('0x2e')][_0xe715('0x7f')]=util[_0xe715('0x64')](_0xe715('0x85'),_0x579fd3[_0xe715('0x67')][_0xe715('0x3d')]);_0x532ebf[_0xe715('0x2e')][_0xe715('0x80')]=_0xa58ed6[_0xe715('0x80')];_0x532ebf['message']['event']=_0xe715('0x3a');respondWithRpcPromise('EventManager',_0xe715('0x81'),{'event':_0xe715('0x86'),'message':_0x532ebf['message']},client9002);return _0xa58ed6;}return null;})[_0xe715('0x26')](respondWithResult(_0x1118f1,null))[_0xe715('0x2f')](handleError(_0x1118f1,null));};exports[_0xe715('0x87')]=function(_0x1a6cd0,_0x321299){var _0x43a9b3;return db[_0xe715('0x41')]['create'](_0x1a6cd0[_0xe715('0x5d')],{})[_0xe715('0x26')](function(_0x4e2032){_0x43a9b3=_0x4e2032;return db[_0xe715('0x88')][_0xe715('0x89')]({'where':{'id':_0x43a9b3[_0xe715('0x75')]}});})[_0xe715('0x26')](function(_0x1adb8e){if(_[_0xe715('0x6c')](_0x1adb8e)){return;}else{_0x43a9b3['fax']=_0x1adb8e[_0xe715('0x61')];return db[_0xe715('0x8a')][_0xe715('0x89')]({'where':{'id':_0x43a9b3[_0xe715('0x8b')]}});}})[_0xe715('0x26')](function(_0x4bda31){return respondWithRpcPromise(_0xe715('0x8c'),_0xe715('0x8c'),{'FaxAccountId':_['isNil'](_0x1a6cd0[_0xe715('0x5d')])?undefined:_0x1a6cd0[_0xe715('0x5d')][_0xe715('0x8d')],'path':_[_0xe715('0x6c')](_0x4bda31)?undefined:util[_0xe715('0x64')]('/var/opt/motion2/server/files/attachments/%s',_0x4bda31[_0xe715('0x8e')]),'fax':_[_0xe715('0x6c')](_0x43a9b3['fax'])?undefined:_0x43a9b3[_0xe715('0x61')],'AttachmentId':_0x43a9b3[_0xe715('0x8b')]},client9002);})[_0xe715('0x26')](respondWithResult(_0x321299,0xc9))['catch'](handleError(_0x321299,null));};exports[_0xe715('0x8f')]=function(_0x6fd1dc,_0x5adc55){var _0x17a950=path[_0xe715('0x90')](config['root'],_0xe715('0x91'),_0xe715('0x92'),'attachments');return db[_0xe715('0x41')]['find']({'where':{'id':_0x6fd1dc[_0xe715('0x5a')]['id']},'include':[{'model':db[_0xe715('0x8a')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x5adc55,null))['then'](function(_0x241bbb){if(_0x241bbb){return _0x5adc55[_0xe715('0x8f')](path[_0xe715('0x90')](_0x17a950,_0x241bbb[_0xe715('0x8a')][_0xe715('0x8e')]));}})[_0xe715('0x2f')](handleError(_0x5adc55,null));};
\ No newline at end of file
+var _0xc230=['fieldName','model','filters','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','FaxMessage','includeAll','rows','show','params','keys','intersection','include','body','find','describe','fax-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','accept','EventManager','acceptmessage','fax','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','event','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download','root','server','files','attachments','join','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','rawAttributes'];(function(_0x20219a,_0x43ad7d){var _0x3e68f2=function(_0x1590cc){while(--_0x1590cc){_0x20219a['push'](_0x20219a['shift']());}};_0x3e68f2(++_0x43ad7d);}(_0xc230,0x168));var _0x0c23=function(_0x7d46c8,_0x3581d2){_0x7d46c8=_0x7d46c8-0x0;var _0x30bbc1=_0xc230[_0x7d46c8];return _0x30bbc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c23('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c23('0x1'));var rp=require(_0x0c23('0x2'));var moment=require(_0x0c23('0x3'));var BPromise=require(_0x0c23('0x4'));var Mustache=require('mustache');var util=require(_0x0c23('0x5'));var path=require(_0x0c23('0x6'));var sox=require(_0x0c23('0x7'));var csv=require(_0x0c23('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0c23('0x9'));var crypto=require(_0x0c23('0xa'));var jsforce=require(_0x0c23('0xb'));var deskjs=require(_0x0c23('0xc'));var toCsv=require(_0x0c23('0x8'));var querystring=require('querystring');var Papa=require(_0x0c23('0xd'));var Redis=require(_0x0c23('0xe'));var authService=require(_0x0c23('0xf'));var qs=require(_0x0c23('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c23('0x11'));var logger=require(_0x0c23('0x12'))(_0x0c23('0x13'));var utils=require(_0x0c23('0x14'));var config=require(_0x0c23('0x15'));var licenseUtil=require(_0x0c23('0x16'));var db=require('../../mysqldb')['db'];config[_0x0c23('0x17')]=_[_0x0c23('0x18')](config[_0x0c23('0x17')],{'host':_0x0c23('0x19'),'port':0x18eb});var socket=require(_0x0c23('0x1a'))(new Redis(config[_0x0c23('0x17')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x0c23('0x1b'));var client=jayson[_0x0c23('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0c23('0x1c')][_0x0c23('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5176be,_0x4e9f3a,_0x16ea4a,_0x50a611){return new BPromise(function(_0x289567,_0xc429ff){var _0x4f06f5=_0x50a611||client;return _0x4f06f5['request'](_0x5176be,_0x16ea4a)[_0x0c23('0x1e')](function(_0x5366bc){logger[_0x0c23('0x1f')](_0x0c23('0x20'),_0x4e9f3a,_0x0c23('0x21'));logger[_0x0c23('0x22')](_0x0c23('0x23'),_0x4e9f3a,_0x0c23('0x21'),JSON[_0x0c23('0x24')](_0x5366bc));if(_0x5366bc[_0x0c23('0x25')]){if(_0x5366bc[_0x0c23('0x25')]['code']===0x1f4){logger['error'](_0x0c23('0x20'),_0x4e9f3a,_0x5366bc[_0x0c23('0x25')][_0x0c23('0x26')]);return _0xc429ff(_0x5366bc['error'][_0x0c23('0x26')]);}logger[_0x0c23('0x25')](_0x0c23('0x20'),_0x4e9f3a,_0x5366bc[_0x0c23('0x25')][_0x0c23('0x26')]);return _0x289567(_0x5366bc[_0x0c23('0x25')][_0x0c23('0x26')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x4e9f3a,_0x0c23('0x21'));_0x289567(_0x5366bc['result'][_0x0c23('0x26')]);}})[_0x0c23('0x27')](function(_0x1a17d8){logger[_0x0c23('0x25')]('FaxMessage,\x20%s,\x20%s',_0x4e9f3a,_0x1a17d8);_0xc429ff(_0x1a17d8);});});}function respondWithStatusCode(_0x58ea9e,_0x5de74e){_0x5de74e=_0x5de74e||0xcc;return function(_0xe39daa){if(_0xe39daa){return _0x58ea9e[_0x0c23('0x28')](_0x5de74e);}return _0x58ea9e[_0x0c23('0x29')](_0x5de74e)['end']();};}function respondWithResult(_0x29d690,_0x5f2cff){_0x5f2cff=_0x5f2cff||0xc8;return function(_0x1e6fd2){if(_0x1e6fd2){return _0x29d690[_0x0c23('0x29')](_0x5f2cff)[_0x0c23('0x2a')](_0x1e6fd2);}};}function respondWithFilteredResult(_0x140db7,_0x442044){return function(_0x3e3b2e){if(_0x3e3b2e){var _0x237da9=typeof _0x442044[_0x0c23('0x2b')]===_0x0c23('0x2c')&&typeof _0x442044['limit']==='undefined';var _0x5964f5=_0x3e3b2e[_0x0c23('0x2d')];var _0x49b6c1=_0x237da9?0x0:_0x442044['offset'];var _0x23b0a7=_0x237da9?_0x3e3b2e['count']:_0x442044[_0x0c23('0x2b')]+_0x442044[_0x0c23('0x2e')];var _0xc0ed59;if(_0x23b0a7>=_0x5964f5){_0x23b0a7=_0x5964f5;_0xc0ed59=0xc8;}else{_0xc0ed59=0xce;}_0x140db7[_0x0c23('0x29')](_0xc0ed59);return _0x140db7[_0x0c23('0x2f')](_0x0c23('0x30'),_0x49b6c1+'-'+_0x23b0a7+'/'+_0x5964f5)[_0x0c23('0x2a')](_0x3e3b2e);}return null;};}function patchUpdates(_0x24b1b4){return function(_0x1be941){try{jsonpatch[_0x0c23('0x31')](_0x1be941,_0x24b1b4,!![]);}catch(_0x2526b2){return BPromise[_0x0c23('0x32')](_0x2526b2);}return _0x1be941[_0x0c23('0x33')]();};}function saveUpdates(_0x1efe21,_0x242c2e){return function(_0x30c052){if(_0x30c052){return _0x30c052[_0x0c23('0x34')](_0x1efe21)['then'](function(_0x5363ba){return _0x5363ba;});}return null;};}function removeEntity(_0x2a9fd0,_0x5166c2){return function(_0x3c71c5){if(_0x3c71c5){return _0x3c71c5[_0x0c23('0x35')]()[_0x0c23('0x1e')](function(){_0x2a9fd0[_0x0c23('0x29')](0xcc)[_0x0c23('0x36')]();});}};}function handleEntityNotFound(_0x34f236,_0x315c44){return function(_0x1e6f50){if(!_0x1e6f50){_0x34f236[_0x0c23('0x28')](0x194);}return _0x1e6f50;};}function handleError(_0x14d03d,_0x314ab2){_0x314ab2=_0x314ab2||0x1f4;return function(_0x413dcb){logger[_0x0c23('0x25')](_0x413dcb[_0x0c23('0x37')]);if(_0x413dcb[_0x0c23('0x38')]){delete _0x413dcb[_0x0c23('0x38')];}_0x14d03d['status'](_0x314ab2)[_0x0c23('0x39')](_0x413dcb);};}exports['index']=function(_0x38795e,_0x2b03f8){var _0x4cc7b6={},_0x12a46f={},_0x130bb1={'count':0x0,'rows':[]};var _0xf49bc=_[_0x0c23('0x3a')](db['FaxMessage'][_0x0c23('0x3b')],function(_0x352b51){return{'name':_0x352b51[_0x0c23('0x3c')],'type':_0x352b51['type']['key']};});_0x12a46f[_0x0c23('0x3d')]=_[_0x0c23('0x3a')](_0xf49bc,_0x0c23('0x38'));_0x12a46f['query']=_['keys'](_0x38795e['query']);_0x12a46f[_0x0c23('0x3e')]=_['intersection'](_0x12a46f[_0x0c23('0x3d')],_0x12a46f[_0x0c23('0x3f')]);_0x4cc7b6[_0x0c23('0x40')]=_['intersection'](_0x12a46f[_0x0c23('0x3d')],qs[_0x0c23('0x41')](_0x38795e[_0x0c23('0x3f')]['fields']));_0x4cc7b6[_0x0c23('0x40')]=_0x4cc7b6['attributes'][_0x0c23('0x42')]?_0x4cc7b6['attributes']:_0x12a46f[_0x0c23('0x3d')];if(!_0x38795e[_0x0c23('0x3f')]['hasOwnProperty'](_0x0c23('0x43'))){_0x4cc7b6['limit']=qs[_0x0c23('0x2e')](_0x38795e[_0x0c23('0x3f')][_0x0c23('0x2e')]);_0x4cc7b6[_0x0c23('0x2b')]=qs[_0x0c23('0x2b')](_0x38795e['query'][_0x0c23('0x2b')]);}_0x4cc7b6[_0x0c23('0x44')]=qs[_0x0c23('0x45')](_0x38795e['query'][_0x0c23('0x45')]);_0x4cc7b6[_0x0c23('0x46')]=qs['filters'](_[_0x0c23('0x47')](_0x38795e['query'],_0x12a46f[_0x0c23('0x3e')]),_0xf49bc);if(_0x38795e[_0x0c23('0x3f')]['filter']){_0x4cc7b6[_0x0c23('0x46')]=_[_0x0c23('0x48')](_0x4cc7b6[_0x0c23('0x46')],{'$or':_[_0x0c23('0x3a')](_0xf49bc,function(_0x5f29f7){if(_0x5f29f7['type']!=='VIRTUAL'){var _0x123f04={};_0x123f04[_0x5f29f7['name']]={'$like':'%'+_0x38795e[_0x0c23('0x3f')]['filter']+'%'};return _0x123f04;}})});}_0x4cc7b6=_[_0x0c23('0x48')]({},_0x4cc7b6,_0x38795e[_0x0c23('0x49')]);var _0x54b80b={'where':_0x4cc7b6[_0x0c23('0x46')]};return db[_0x0c23('0x4a')]['count'](_0x54b80b)[_0x0c23('0x1e')](function(_0xebf728){_0x130bb1[_0x0c23('0x2d')]=_0xebf728;if(_0x38795e[_0x0c23('0x3f')][_0x0c23('0x4b')]){_0x4cc7b6['include']=[{'all':!![]}];}return db[_0x0c23('0x4a')]['findAll'](_0x4cc7b6);})[_0x0c23('0x1e')](function(_0x17eb62){_0x130bb1[_0x0c23('0x4c')]=_0x17eb62;return _0x130bb1;})[_0x0c23('0x1e')](respondWithFilteredResult(_0x2b03f8,_0x4cc7b6))['catch'](handleError(_0x2b03f8,null));};exports[_0x0c23('0x4d')]=function(_0x220e79,_0x58972e){var _0x2adbdd={'raw':!![],'where':{'id':_0x220e79[_0x0c23('0x4e')]['id']}},_0x1a5a5d={};_0x1a5a5d['model']=_[_0x0c23('0x4f')](db['FaxMessage'][_0x0c23('0x3b')]);_0x1a5a5d['query']=_['keys'](_0x220e79[_0x0c23('0x3f')]);_0x1a5a5d[_0x0c23('0x3e')]=_[_0x0c23('0x50')](_0x1a5a5d[_0x0c23('0x3d')],_0x1a5a5d[_0x0c23('0x3f')]);_0x2adbdd[_0x0c23('0x40')]=_[_0x0c23('0x50')](_0x1a5a5d[_0x0c23('0x3d')],qs[_0x0c23('0x41')](_0x220e79['query']['fields']));_0x2adbdd[_0x0c23('0x40')]=_0x2adbdd[_0x0c23('0x40')][_0x0c23('0x42')]?_0x2adbdd[_0x0c23('0x40')]:_0x1a5a5d[_0x0c23('0x3d')];if(_0x220e79[_0x0c23('0x3f')][_0x0c23('0x4b')]){_0x2adbdd[_0x0c23('0x51')]=[{'all':!![]}];}_0x2adbdd=_[_0x0c23('0x48')]({},_0x2adbdd,_0x220e79[_0x0c23('0x49')]);return db[_0x0c23('0x4a')]['find'](_0x2adbdd)[_0x0c23('0x1e')](handleEntityNotFound(_0x58972e,null))[_0x0c23('0x1e')](respondWithResult(_0x58972e,null))['catch'](handleError(_0x58972e,null));};exports[_0x0c23('0x34')]=function(_0x164435,_0x329b95){if(_0x164435[_0x0c23('0x52')]['id']){delete _0x164435[_0x0c23('0x52')]['id'];}return db['FaxMessage'][_0x0c23('0x53')]({'where':{'id':_0x164435[_0x0c23('0x4e')]['id']}})[_0x0c23('0x1e')](handleEntityNotFound(_0x329b95,null))[_0x0c23('0x1e')](saveUpdates(_0x164435[_0x0c23('0x52')],null))[_0x0c23('0x1e')](respondWithResult(_0x329b95,null))[_0x0c23('0x27')](handleError(_0x329b95,null));};exports[_0x0c23('0x35')]=function(_0x17ae1c,_0x37a483){return db['FaxMessage'][_0x0c23('0x53')]({'where':{'id':_0x17ae1c['params']['id']}})['then'](handleEntityNotFound(_0x37a483,null))['then'](removeEntity(_0x37a483,null))[_0x0c23('0x27')](handleError(_0x37a483,null));};exports[_0x0c23('0x54')]=function(_0x46498f,_0x1ed21b){return db['FaxMessage'][_0x0c23('0x54')]()['then'](respondWithResult(_0x1ed21b,null))[_0x0c23('0x27')](handleError(_0x1ed21b,null));};var interaction_log=require('../../config/logger')(_0x0c23('0x55'));exports['accept']=function(_0x2dc2b1,_0x178122,_0x3aae6d){var _0x2d4d1d={'agent':{},'channel':'fax'};if(_0x2dc2b1[_0x0c23('0x52')]['id']){delete _0x2dc2b1[_0x0c23('0x52')]['id'];}_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x56')]=!![];_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x57')]=moment()['format'](_0x0c23('0x58'));_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x59')]=_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x59')]||_0x2dc2b1[_0x0c23('0x5a')]['id'];_0x2d4d1d['agent']['id']=_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x59')];return db[_0x0c23('0x4a')][_0x0c23('0x53')]({'where':{'id':_0x2dc2b1['params']['id'],'UserId':null}})[_0x0c23('0x1e')](handleEntityNotFound(_0x178122,null))[_0x0c23('0x1e')](saveUpdates(_0x2dc2b1[_0x0c23('0x52')],null))[_0x0c23('0x1e')](function(_0x4b5654){if(_0x4b5654){_0x2d4d1d[_0x0c23('0x26')]=_0x4b5654[_0x0c23('0x5b')]({'plain':!![]});return db['FaxInteraction'][_0x0c23('0x53')]({'where':{'id':_0x4b5654['FaxInteractionId']}});}return null;})[_0x0c23('0x1e')](handleEntityNotFound(_0x178122,null))[_0x0c23('0x1e')](function(_0xd3aafa){if(_0xd3aafa){return _0xd3aafa[_0x0c23('0x34')]({'UserId':_0x2dc2b1['body']['UserId'],'read1stAt':_['isNil'](_0xd3aafa[_0x0c23('0x5c')])?moment()['format'](_0x0c23('0x58')):undefined});}return null;})[_0x0c23('0x1e')](function(_0x2177e5){if(_0x2177e5){_0x2d4d1d[_0x0c23('0x5d')]=_0x2177e5[_0x0c23('0x5b')]({'plain':!![]});interaction_log[_0x0c23('0x1f')](_0x0c23('0x5e'),_0x2dc2b1['user']['id'],_0x2dc2b1['user'][_0x0c23('0x38')],_0x2dc2b1[_0x0c23('0x5a')]['role'],_0x2d4d1d[_0x0c23('0x5d')]['id'],_0x2dc2b1['body']?JSON[_0x0c23('0x24')](_0x2dc2b1[_0x0c23('0x52')]):_0x0c23('0x5f'));return respondWithRpcPromise('AcceptMessage',_0x0c23('0x60'),_0x2d4d1d);}return null;})[_0x0c23('0x1e')](function(_0x3be4b7){var _0xbef6f8=_0x0c23('0x61')+_0x3be4b7[_0x0c23('0x26')][_0x0c23('0x62')];return db[_0x0c23('0x63')][_0x0c23('0x3f')](_0xbef6f8,{'type':db[_0x0c23('0x64')][_0x0c23('0x65')][_0x0c23('0x66')],'raw':!![]})[_0x0c23('0x1e')](function(_0x4da48c){return _0x4da48c;});})[_0x0c23('0x1e')](function(_0x488679){if(_0x488679){_0x2d4d1d['message'][_0x0c23('0x67')]=_0x488679[0x0];if(!_0x2dc2b1['body'][_0x0c23('0x59')])return;return db[_0x0c23('0x68')][_0x0c23('0x53')]({'where':{'id':_0x2dc2b1[_0x0c23('0x52')][_0x0c23('0x59')],'role':_0x0c23('0x69')},'attributes':['id',_0x0c23('0x38'),_0x0c23('0x6a'),_0x0c23('0x6b'),_0x0c23('0x6c')],'raw':!![]});}return null;})[_0x0c23('0x1e')](function(_0x2e3209){if(!_0x2e3209)return null;_0x2d4d1d[_0x0c23('0x26')][_0x0c23('0x69')]=_0x2e3209;return _0x2d4d1d;})['then'](function(_0x3db7a1){if(_0x3db7a1){if(_0x2dc2b1['body'][_0x0c23('0x6d')]){_0x2d4d1d[_0x0c23('0x26')][_0x0c23('0x6e')]=util[_0x0c23('0x6f')](_0x0c23('0x70'),_0x2dc2b1[_0x0c23('0x5a')][_0x0c23('0x38')]);_0x2d4d1d[_0x0c23('0x26')][_0x0c23('0x71')]=_0x2d4d1d[_0x0c23('0x71')];_0x2d4d1d[_0x0c23('0x26')]['event']=_0x0c23('0x72');return respondWithRpcPromise(_0x0c23('0x73'),_0x0c23('0x73'),{'event':_0x0c23('0x74'),'message':_0x2d4d1d['message']},client9002)[_0x0c23('0x1e')](function(){return _0x2d4d1d;});}return _0x2d4d1d;}return null;})[_0x0c23('0x1e')](respondWithResult(_0x178122,null))['catch'](handleError(_0x178122,null));};var interaction_log=require('../../config/logger')(_0x0c23('0x55'));exports[_0x0c23('0x32')]=function(_0x13c77d,_0x1ec96f,_0x36ead8){var _0x3123d5={'agent':{},'channel':_0x0c23('0x75')};if(_0x13c77d['body']['id']){delete _0x13c77d[_0x0c23('0x52')]['id'];}_0x13c77d[_0x0c23('0x52')][_0x0c23('0x59')]=_0x13c77d['body'][_0x0c23('0x59')]||_0x13c77d['user']['id'];_0x3123d5[_0x0c23('0x69')]['id']=_0x13c77d[_0x0c23('0x52')]['UserId'];return db[_0x0c23('0x4a')][_0x0c23('0x53')]({'where':{'id':_0x13c77d[_0x0c23('0x4e')]['id'],'UserId':null}})[_0x0c23('0x1e')](handleEntityNotFound(_0x1ec96f,null))[_0x0c23('0x1e')](function(_0x2b7cb6){if(_0x2b7cb6){_0x3123d5[_0x0c23('0x26')]=_0x2b7cb6[_0x0c23('0x5b')]({'plain':!![]});return db[_0x0c23('0x76')]['find']({'where':{'id':_0x2b7cb6[_0x0c23('0x77')]}});}return null;})[_0x0c23('0x1e')](handleEntityNotFound(_0x1ec96f,null))['then'](function(_0x545eae){if(_0x545eae){_0x3123d5[_0x0c23('0x5d')]=_0x545eae[_0x0c23('0x5b')]({'plain':!![]});interaction_log['info'](_0x0c23('0x78'),_0x13c77d[_0x0c23('0x5a')]['id'],_0x13c77d[_0x0c23('0x5a')][_0x0c23('0x38')],_0x13c77d[_0x0c23('0x5a')][_0x0c23('0x79')],_0x3123d5[_0x0c23('0x5d')]['id'],_0x13c77d[_0x0c23('0x52')]?JSON[_0x0c23('0x24')](_0x13c77d[_0x0c23('0x52')]):_0x0c23('0x5f'));return respondWithRpcPromise(_0x0c23('0x7a'),_0x0c23('0x7b'),_0x3123d5);}return null;})[_0x0c23('0x1e')](function(_0x2f58e1){var _0x5d09a8=_0x0c23('0x61')+_0x2f58e1[_0x0c23('0x26')][_0x0c23('0x62')];return db[_0x0c23('0x63')]['query'](_0x5d09a8,{'type':db['Sequelize'][_0x0c23('0x65')][_0x0c23('0x66')],'raw':!![]})['then'](function(_0x3e3556){return _0x3e3556;});})[_0x0c23('0x1e')](function(_0x36f563){if(_0x36f563){_0x3123d5[_0x0c23('0x26')][_0x0c23('0x67')]=_0x36f563[0x0];if(!_0x13c77d[_0x0c23('0x52')][_0x0c23('0x59')])return;return db[_0x0c23('0x68')]['find']({'where':{'id':_0x13c77d[_0x0c23('0x52')][_0x0c23('0x59')],'role':'agent'},'attributes':['id',_0x0c23('0x38'),_0x0c23('0x6a'),_0x0c23('0x6b'),_0x0c23('0x6c')],'raw':!![]});}return null;})[_0x0c23('0x1e')](function(_0x14627c){if(!_0x14627c)return null;_0x3123d5['message'][_0x0c23('0x69')]=_0x14627c;return _0x3123d5;})[_0x0c23('0x1e')](function(_0x16f514){if(_0x16f514){_0x16f514[_0x0c23('0x26')][_0x0c23('0x6e')]=util[_0x0c23('0x6f')](_0x0c23('0x70'),_0x13c77d[_0x0c23('0x5a')]['name']);_0x16f514[_0x0c23('0x26')]['channel']=_0x3123d5[_0x0c23('0x71')];_0x16f514[_0x0c23('0x26')][_0x0c23('0x7c')]=_0x0c23('0x32');respondWithRpcPromise(_0x0c23('0x73'),'EventManager',{'event':_0x0c23('0x7d'),'message':_0x16f514['message']},client9002);return _0x3123d5;}return null;})[_0x0c23('0x1e')](respondWithResult(_0x1ec96f,null))[_0x0c23('0x27')](handleError(_0x1ec96f,null));};exports['create']=function(_0x17d3bf,_0x37ff16){var _0x873946;return db['FaxMessage'][_0x0c23('0x7e')](_0x17d3bf[_0x0c23('0x52')],{})[_0x0c23('0x1e')](function(_0x1e196a){_0x873946=_0x1e196a;return db['CmContact'][_0x0c23('0x7f')]({'where':{'id':_0x873946[_0x0c23('0x62')]}});})[_0x0c23('0x1e')](function(_0x19f657){if(_[_0x0c23('0x80')](_0x19f657)){return;}else{_0x873946[_0x0c23('0x75')]=_0x19f657[_0x0c23('0x75')];return db[_0x0c23('0x81')][_0x0c23('0x7f')]({'where':{'id':_0x873946['AttachmentId']}});}})['then'](function(_0x5e46a8){return respondWithRpcPromise('SendFax',_0x0c23('0x82'),{'FaxAccountId':_[_0x0c23('0x80')](_0x17d3bf[_0x0c23('0x52')])?undefined:_0x17d3bf['body'][_0x0c23('0x83')],'path':_[_0x0c23('0x80')](_0x5e46a8)?undefined:util[_0x0c23('0x6f')]('/var/opt/motion2/server/files/attachments/%s',_0x5e46a8[_0x0c23('0x84')]),'fax':_[_0x0c23('0x80')](_0x873946[_0x0c23('0x75')])?undefined:_0x873946[_0x0c23('0x75')],'AttachmentId':_0x873946[_0x0c23('0x85')]},client9002);})[_0x0c23('0x1e')](respondWithResult(_0x37ff16,0xc9))[_0x0c23('0x27')](handleError(_0x37ff16,null));};exports[_0x0c23('0x86')]=function(_0x5b886a,_0x39d39f){var _0xda0e83=path['join'](config[_0x0c23('0x87')],_0x0c23('0x88'),_0x0c23('0x89'),_0x0c23('0x8a'));return db[_0x0c23('0x4a')][_0x0c23('0x53')]({'where':{'id':_0x5b886a[_0x0c23('0x4e')]['id']},'include':[{'model':db['Attachment'],'as':_0x0c23('0x81')}]})['then'](handleEntityNotFound(_0x39d39f,null))[_0x0c23('0x1e')](function(_0x21d23b){if(_0x21d23b){return _0x39d39f[_0x0c23('0x86')](path[_0x0c23('0x8b')](_0xda0e83,_0x21d23b['Attachment'][_0x0c23('0x84')]));}})[_0x0c23('0x27')](handleError(_0x39d39f,null));};
\ No newline at end of file
index bca08fb..434b3fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update'];(function(_0x373f44,_0x2aad40){var _0x5378cf=function(_0x1d7d97){while(--_0x1d7d97){_0x373f44['push'](_0x373f44['shift']());}};_0x5378cf(++_0x2aad40);}(_0x720b,0x1d8));var _0xb720=function(_0x5e99ae,_0x37d21f){_0x5e99ae=_0x5e99ae-0x0;var _0x286019=_0x720b[_0x5e99ae];return _0x286019;};'use strict';var EventEmitter=require(_0xb720('0x0'));var FaxMessage=require(_0xb720('0x1'))['db'][_0xb720('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb720('0x3'),'afterUpdate':_0xb720('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f7ac1){return function(_0x3f8acb,_0x33f308,_0x4ddff9){FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1+':'+_0x3f8acb['id'],_0x3f8acb);FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1,_0x3f8acb);_0x4ddff9(null);};}for(var e in events){if(events[_0xb720('0x6')](e)){var event=events[e];FaxMessage[_0xb720('0x7')](e,emitEvent(event));}}module[_0xb720('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0x7031=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0xa1671c,_0x57700d){var _0x2107f0=function(_0x436e27){while(--_0x436e27){_0xa1671c['push'](_0xa1671c['shift']());}};_0x2107f0(++_0x57700d);}(_0x7031,0x19a));var _0x1703=function(_0x5ca47b,_0x1734e0){_0x5ca47b=_0x5ca47b-0x0;var _0x398fab=_0x7031[_0x5ca47b];return _0x398fab;};'use strict';var EventEmitter=require(_0x1703('0x0'));var FaxMessage=require(_0x1703('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1703('0x2')](0x0);var events={'afterCreate':_0x1703('0x3'),'afterUpdate':'update','afterDestroy':_0x1703('0x4')};function emitEvent(_0x193f2a){return function(_0x520961,_0x1ad53b,_0x438115){FaxMessageEvents['emit'](_0x193f2a+':'+_0x520961['id'],_0x520961);FaxMessageEvents[_0x1703('0x5')](_0x193f2a,_0x520961);_0x438115(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x1703('0x6')](e,emitEvent(event));}}module[_0x1703('0x7')]=FaxMessageEvents;
\ No newline at end of file
index 0959af7..7dd9790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ae4=['./faxMessage.attributes','define','FaxMessage','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x4ae4,0x158));var _0x44ae=function(_0x33a354,_0x1c9f29){_0x33a354=_0x33a354-0x0;var _0xa62bbf=_0x4ae4[_0x33a354];return _0xa62bbf;};'use strict';var _=require('lodash');var util=require(_0x44ae('0x0'));var logger=require(_0x44ae('0x1'))(_0x44ae('0x2'));var moment=require(_0x44ae('0x3'));var BPromise=require(_0x44ae('0x4'));var rp=require(_0x44ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44ae('0x6'));var attributes=require(_0x44ae('0x7'));module['exports']=function(_0x6c6062,_0x594980){return _0x6c6062[_0x44ae('0x8')](_0x44ae('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x44ae('0xa'),'fields':['body'],'type':_0x44ae('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x287523,_0x14d4d1,_0x273a94){var _0x3d3072=_0x6c6062[_0x44ae('0xc')];var _0x497cc0=_0x287523[_0x44ae('0xd')]({'plain':!![]});if(_0x497cc0[_0x44ae('0xe')]['toLowerCase']()==='in'||_0x497cc0['direction'][_0x44ae('0xf')]()===_0x44ae('0x10')&&!_0x497cc0[_0x44ae('0x11')]&&!_[_0x44ae('0x12')](_0x497cc0[_0x44ae('0x13')])){_0x3d3072[_0x44ae('0x14')]['findOne']({'where':{'id':_0x497cc0[_0x44ae('0x15')]}})[_0x44ae('0x16')](function(_0x39610b){if(_0x39610b){_0x39610b[_0x44ae('0x17')]({'lastMsgAt':_0x497cc0['createdAt'],'lastMsgDirection':_0x497cc0['direction'][_0x44ae('0xf')]()});}})[_0x44ae('0x18')](function(_0xd40451){console['error'](_0xd40451);});}_0x273a94();}},'charset':_0x44ae('0x19'),'collate':_0x44ae('0x1a')});};
\ No newline at end of file
+var _0x8aba=['direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','FULLTEXT','models','get'];(function(_0x247130,_0x5a58a4){var _0x49a10c=function(_0x33ceca){while(--_0x33ceca){_0x247130['push'](_0x247130['shift']());}};_0x49a10c(++_0x5a58a4);}(_0x8aba,0xbb));var _0xa8ab=function(_0x1a93ce,_0x2816f9){_0x1a93ce=_0x1a93ce-0x0;var _0x4eb08b=_0x8aba[_0x1a93ce];return _0x4eb08b;};'use strict';var _=require(_0xa8ab('0x0'));var util=require(_0xa8ab('0x1'));var logger=require(_0xa8ab('0x2'))(_0xa8ab('0x3'));var moment=require(_0xa8ab('0x4'));var BPromise=require(_0xa8ab('0x5'));var rp=require(_0xa8ab('0x6'));var fs=require('fs');var path=require(_0xa8ab('0x7'));var rimraf=require('rimraf');var config=require(_0xa8ab('0x8'));var attributes=require(_0xa8ab('0x9'));module['exports']=function(_0x326315,_0x5f0280){return _0x326315[_0xa8ab('0xa')]('FaxMessage',attributes,{'tableName':_0xa8ab('0xb'),'paranoid':![],'indexes':[{'name':_0xa8ab('0xc'),'fields':['body'],'type':_0xa8ab('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x122a15,_0x5fac67,_0x11f829){var _0x23fe78=_0x326315[_0xa8ab('0xe')];var _0x3fa9da=_0x122a15[_0xa8ab('0xf')]({'plain':!![]});if(_0x3fa9da[_0xa8ab('0x10')][_0xa8ab('0x11')]()==='in'||_0x3fa9da[_0xa8ab('0x10')][_0xa8ab('0x11')]()===_0xa8ab('0x12')&&!_0x3fa9da[_0xa8ab('0x13')]&&!_[_0xa8ab('0x14')](_0x3fa9da['UserId'])){_0x23fe78[_0xa8ab('0x15')][_0xa8ab('0x16')]({'where':{'id':_0x3fa9da[_0xa8ab('0x17')]}})[_0xa8ab('0x18')](function(_0xfbbb4a){if(_0xfbbb4a){_0xfbbb4a[_0xa8ab('0x19')]({'lastMsgAt':_0x3fa9da[_0xa8ab('0x1a')],'lastMsgDirection':_0x3fa9da[_0xa8ab('0x10')][_0xa8ab('0x11')]()});}})['catch'](function(_0x4821c6){console[_0xa8ab('0x1b')](_0x4821c6);});}_0x11f829();}},'charset':_0xa8ab('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 07e3af2..d3e3b87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x2ff5e0,_0x5a61ee){var _0x434548=function(_0x4bf710){while(--_0x4bf710){_0x2ff5e0['push'](_0x2ff5e0['shift']());}};_0x434548(++_0x5a61ee);}(_0xeec6,0x1c2));var _0x6eec=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xeec6[_0xa1e2fd];return _0x218880;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});};
\ No newline at end of file
+var _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x7bae[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});};
\ No newline at end of file
index 105b94f..1f8f9a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7e5=['length','faxMessage:','./faxMessage.events','remove','update','removeListener'];(function(_0xbdafc3,_0x121178){var _0x5de68c=function(_0x43d25e){while(--_0x43d25e){_0xbdafc3['push'](_0xbdafc3['shift']());}};_0x5de68c(++_0x121178);}(_0xa7e5,0x140));var _0x5a7e=function(_0x551d34,_0x13d16e){_0x551d34=_0x551d34-0x0;var _0x547525=_0xa7e5[_0x551d34];return _0x547525;};'use strict';var FaxMessageEvents=require(_0x5a7e('0x0'));var events=['save',_0x5a7e('0x1'),_0x5a7e('0x2')];function createListener(_0x2a331e,_0x5ec957){return function(_0x5d828f){_0x5ec957['emit'](_0x2a331e,_0x5d828f);};}function removeListener(_0x86351a,_0x1f2c20){return function(){FaxMessageEvents[_0x5a7e('0x3')](_0x86351a,_0x1f2c20);};}exports['register']=function(_0x63b008){for(var _0x3e72b4=0x0,_0x3c76e3=events[_0x5a7e('0x4')];_0x3e72b4<_0x3c76e3;_0x3e72b4++){var _0x44ab85=events[_0x3e72b4];var _0x3b58ca=createListener(_0x5a7e('0x5')+_0x44ab85,_0x63b008);FaxMessageEvents['on'](_0x44ab85,_0x3b58ca);}};
\ No newline at end of file
+var _0x1b3a=['save','update','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x1b3a,0x1db));var _0xa1b3=function(_0x41c2cb,_0x425374){_0x41c2cb=_0x41c2cb-0x0;var _0x56374c=_0x1b3a[_0x41c2cb];return _0x56374c;};'use strict';var FaxMessageEvents=require(_0xa1b3('0x0'));var events=[_0xa1b3('0x1'),'remove',_0xa1b3('0x2')];function createListener(_0x7a4232,_0x5a54a1){return function(_0x2f0117){_0x5a54a1['emit'](_0x7a4232,_0x2f0117);};}function removeListener(_0x24f100,_0x313760){return function(){FaxMessageEvents[_0xa1b3('0x3')](_0x24f100,_0x313760);};}exports[_0xa1b3('0x4')]=function(_0x473e25){for(var _0x342f59=0x0,_0x4c4d2a=events[_0xa1b3('0x5')];_0x342f59<_0x4c4d2a;_0x342f59++){var _0x4c222c=events[_0x342f59];var _0x5843d1=createListener(_0xa1b3('0x6')+_0x4c222c,_0x473e25);FaxMessageEvents['on'](_0x4c222c,_0x5843d1);}};
\ No newline at end of file
index 3f29747..796ce23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2547=['/:id/download','download','post','tracked','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0x2547,0x1cd));var _0x7254=function(_0x115032,_0x1bdde8){_0x115032=_0x115032-0x0;var _0x28122d=_0x2547[_0x115032];return _0x28122d;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),interaction[_0x7254('0x12')]('fax',_0x7254('0x13')),controller['create']);router[_0x7254('0x14')]('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0x15')]);router[_0x7254('0x14')](_0x7254('0x16'),auth[_0x7254('0xa')](),controller[_0x7254('0x17')]);router[_0x7254('0x14')](_0x7254('0x18'),auth[_0x7254('0xa')](),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),controller['destroy']);module[_0x7254('0x1b')]=router;
\ No newline at end of file
+var _0xb43b=['update','/:id/reject','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','create','put'];(function(_0x55b0f0,_0x123813){var _0x426165=function(_0x31b7de){while(--_0x31b7de){_0x55b0f0['push'](_0x55b0f0['shift']());}};_0x426165(++_0x123813);}(_0xb43b,0x1b2));var _0xbb43=function(_0x903934,_0x445a22){_0x903934=_0x903934-0x0;var _0x23e7b0=_0xb43b[_0x903934];return _0x23e7b0;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0xd')]('/:id/download',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),interaction[_0xbb43('0x12')](_0xbb43('0x13'),'faxmessage:create'),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x16')]);router['put']('/:id/accept',auth[_0xbb43('0xb')](),controller['accept']);router[_0xbb43('0x15')](_0xbb43('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a005dec..14e2be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac19=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0xe82e9a,_0x5be9a0){var _0x53ee84=function(_0x71dac6){while(--_0x71dac6){_0xe82e9a['push'](_0xe82e9a['shift']());}};_0x53ee84(++_0x5be9a0);}(_0xac19,0x11d));var _0x9ac1=function(_0x46e9f2,_0xb8c5f9){_0x46e9f2=_0x46e9f2-0x0;var _0x2ff437=_0xac19[_0x46e9f2];return _0x2ff437;};'use strict';var Sequelize=require(_0x9ac1('0x0'));module[_0x9ac1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9ac1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9ac1('0x3')]},'timeout':{'type':Sequelize[_0x9ac1('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9ac1('0x5')](_0x9ac1('0x6'),'beepall',_0x9ac1('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9ac1('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xef6a=['STRING','name','ENUM','beepall','roundrobin','INTEGER','sequelize','exports'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xef6a,0x10e));var _0xaef6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xef6a[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xaef6('0x0'));module[_0xaef6('0x1')]={'name':{'type':Sequelize[_0xaef6('0x2')],'unique':_0xaef6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaef6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaef6('0x4')]('rrmemory',_0xaef6('0x5'),_0xaef6('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xaef6('0x7')],'defaultValue':0x0}};
\ No newline at end of file
index e7cfbd8..c1a9802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x664d=['ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','removeTeams','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','destroy','error','name','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','SIP','faxPause','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','sequelize','transaction','each','emit','userFaxQueue:save','select','field','from','team_has_fax_queues','join','user_has_teams'];(function(_0x2df39c,_0x122585){var _0x405e8d=function(_0x2ffcd8){while(--_0x2ffcd8){_0x2df39c['push'](_0x2df39c['shift']());}};_0x405e8d(++_0x122585);}(_0x664d,0x1a3));var _0xd664=function(_0x143cc6,_0xf94536){_0x143cc6=_0x143cc6-0x0;var _0x2cedba=_0x664d[_0x143cc6];return _0x2cedba;};'use strict';var emlformat=require(_0xd664('0x0'));var rimraf=require(_0xd664('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd664('0x2'));var rp=require(_0xd664('0x3'));var moment=require('moment');var BPromise=require(_0xd664('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd664('0x5'));var csv=require(_0xd664('0x6'));var ejs=require(_0xd664('0x7'));var fs=require('fs');var fs_extra=require(_0xd664('0x8'));var _=require(_0xd664('0x9'));var squel=require('squel');var crypto=require(_0xd664('0xa'));var jsforce=require(_0xd664('0xb'));var deskjs=require(_0xd664('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd664('0xd'));var Papa=require(_0xd664('0xe'));var Redis=require(_0xd664('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd664('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xd664('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd664('0x12'));var db=require(_0xd664('0x13'))['db'];config[_0xd664('0x14')]=_[_0xd664('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd664('0x16'))(new Redis(config[_0xd664('0x14')]));require(_0xd664('0x17'))['register'](socket);function respondWithStatusCode(_0x16cc1d,_0x128c96){_0x128c96=_0x128c96||0xcc;return function(_0x165781){if(_0x165781){return _0x16cc1d[_0xd664('0x18')](_0x128c96);}return _0x16cc1d[_0xd664('0x19')](_0x128c96)[_0xd664('0x1a')]();};}function respondWithResult(_0x16493a,_0x428dfa){_0x428dfa=_0x428dfa||0xc8;return function(_0xbf77ad){if(_0xbf77ad){return _0x16493a[_0xd664('0x19')](_0x428dfa)[_0xd664('0x1b')](_0xbf77ad);}};}function respondWithFilteredResult(_0x3b0fe1,_0x2aaeb3){return function(_0x849160){if(_0x849160){var _0x163456=typeof _0x2aaeb3['offset']===_0xd664('0x1c')&&typeof _0x2aaeb3[_0xd664('0x1d')]===_0xd664('0x1c');var _0x331c58=_0x849160[_0xd664('0x1e')];var _0x1f485b=_0x163456?0x0:_0x2aaeb3[_0xd664('0x1f')];var _0x3af3e4=_0x163456?_0x849160[_0xd664('0x1e')]:_0x2aaeb3[_0xd664('0x1f')]+_0x2aaeb3[_0xd664('0x1d')];var _0x3c809f;if(_0x3af3e4>=_0x331c58){_0x3af3e4=_0x331c58;_0x3c809f=0xc8;}else{_0x3c809f=0xce;}_0x3b0fe1[_0xd664('0x19')](_0x3c809f);return _0x3b0fe1[_0xd664('0x20')](_0xd664('0x21'),_0x1f485b+'-'+_0x3af3e4+'/'+_0x331c58)[_0xd664('0x1b')](_0x849160);}return null;};}function patchUpdates(_0x14dffa){return function(_0x516850){try{jsonpatch[_0xd664('0x22')](_0x516850,_0x14dffa,!![]);}catch(_0x38dce1){return BPromise[_0xd664('0x23')](_0x38dce1);}return _0x516850[_0xd664('0x24')]();};}function saveUpdates(_0x5d74b4,_0x46c0d1){return function(_0x442d29){if(_0x442d29){return _0x442d29[_0xd664('0x25')](_0x5d74b4)[_0xd664('0x26')](function(_0x330a22){return _0x330a22;});}return null;};}function removeEntity(_0x58263a,_0x287c98){return function(_0xe39989){if(_0xe39989){return _0xe39989['destroy']()[_0xd664('0x26')](function(){var _0x11a526=_0xe39989[_0xd664('0x27')]({'plain':!![]});var _0x23c3ec=_0xd664('0x28');return db['UserProfileResource'][_0xd664('0x29')]({'where':{'type':_0x23c3ec,'resourceId':_0x11a526['id']}})[_0xd664('0x26')](function(){return _0xe39989;});})[_0xd664('0x26')](function(){_0x58263a[_0xd664('0x19')](0xcc)[_0xd664('0x1a')]();});}};}function handleEntityNotFound(_0x9b9275,_0x3c4984){return function(_0x20dfc8){if(!_0x20dfc8){_0x9b9275['sendStatus'](0x194);}return _0x20dfc8;};}function handleError(_0x10bc23,_0xab2c66){_0xab2c66=_0xab2c66||0x1f4;return function(_0x1040c0){logger[_0xd664('0x2a')](_0x1040c0['stack']);if(_0x1040c0['name']){delete _0x1040c0[_0xd664('0x2b')];}_0x10bc23[_0xd664('0x19')](_0xab2c66)['send'](_0x1040c0);};}exports['index']=function(_0xffd97f,_0x106d4c){var _0x52f57c={},_0x510f08={},_0x5cb3a3={'count':0x0,'rows':[]};var _0x2c702e=_[_0xd664('0x2c')](db[_0xd664('0x2d')][_0xd664('0x2e')],function(_0x10d2ff){return{'name':_0x10d2ff[_0xd664('0x2f')],'type':_0x10d2ff[_0xd664('0x30')][_0xd664('0x31')]};});_0x510f08[_0xd664('0x32')]=_['map'](_0x2c702e,_0xd664('0x2b'));_0x510f08[_0xd664('0x33')]=_['keys'](_0xffd97f[_0xd664('0x33')]);_0x510f08[_0xd664('0x34')]=_[_0xd664('0x35')](_0x510f08[_0xd664('0x32')],_0x510f08[_0xd664('0x33')]);_0x52f57c[_0xd664('0x36')]=_['intersection'](_0x510f08['model'],qs[_0xd664('0x37')](_0xffd97f[_0xd664('0x33')]['fields']));_0x52f57c[_0xd664('0x36')]=_0x52f57c[_0xd664('0x36')][_0xd664('0x38')]?_0x52f57c['attributes']:_0x510f08[_0xd664('0x32')];if(!_0xffd97f[_0xd664('0x33')][_0xd664('0x39')](_0xd664('0x3a'))){_0x52f57c[_0xd664('0x1d')]=qs['limit'](_0xffd97f['query'][_0xd664('0x1d')]);_0x52f57c[_0xd664('0x1f')]=qs[_0xd664('0x1f')](_0xffd97f['query'][_0xd664('0x1f')]);}_0x52f57c[_0xd664('0x3b')]=qs[_0xd664('0x3c')](_0xffd97f[_0xd664('0x33')][_0xd664('0x3c')]);_0x52f57c[_0xd664('0x3d')]=qs[_0xd664('0x34')](_[_0xd664('0x3e')](_0xffd97f[_0xd664('0x33')],_0x510f08['filters']),_0x2c702e);if(_0xffd97f[_0xd664('0x33')]['filter']){_0x52f57c['where']=_[_0xd664('0x3f')](_0x52f57c[_0xd664('0x3d')],{'$or':_['map'](_0x2c702e,function(_0x118d28){if(_0x118d28['type']!=='VIRTUAL'){var _0x150413={};_0x150413[_0x118d28[_0xd664('0x2b')]]={'$like':'%'+_0xffd97f['query'][_0xd664('0x40')]+'%'};return _0x150413;}})});}_0x52f57c=_[_0xd664('0x3f')]({},_0x52f57c,_0xffd97f[_0xd664('0x41')]);var _0x5f36dd={'where':_0x52f57c[_0xd664('0x3d')]};return db['FaxQueue'][_0xd664('0x1e')](_0x5f36dd)[_0xd664('0x26')](function(_0xbf663b){_0x5cb3a3[_0xd664('0x1e')]=_0xbf663b;if(_0xffd97f[_0xd664('0x33')]['includeAll']){_0x52f57c[_0xd664('0x42')]=[{'all':!![]}];}return db[_0xd664('0x2d')][_0xd664('0x43')](_0x52f57c);})['then'](function(_0x3bf9d3){_0x5cb3a3[_0xd664('0x44')]=_0x3bf9d3;return _0x5cb3a3;})[_0xd664('0x26')](respondWithFilteredResult(_0x106d4c,_0x52f57c))['catch'](handleError(_0x106d4c,null));};exports['show']=function(_0xa1f824,_0x565108){var _0x46f360={'raw':!![],'where':{'id':_0xa1f824[_0xd664('0x45')]['id']}},_0x509a86={};_0x509a86[_0xd664('0x32')]=_[_0xd664('0x46')](db[_0xd664('0x2d')]['rawAttributes']);_0x509a86[_0xd664('0x33')]=_[_0xd664('0x46')](_0xa1f824[_0xd664('0x33')]);_0x509a86[_0xd664('0x34')]=_[_0xd664('0x35')](_0x509a86[_0xd664('0x32')],_0x509a86[_0xd664('0x33')]);_0x46f360['attributes']=_[_0xd664('0x35')](_0x509a86['model'],qs[_0xd664('0x37')](_0xa1f824[_0xd664('0x33')][_0xd664('0x37')]));_0x46f360[_0xd664('0x36')]=_0x46f360[_0xd664('0x36')]['length']?_0x46f360[_0xd664('0x36')]:_0x509a86[_0xd664('0x32')];if(_0xa1f824[_0xd664('0x33')]['includeAll']){_0x46f360['include']=[{'all':!![]}];}_0x46f360=_[_0xd664('0x3f')]({},_0x46f360,_0xa1f824[_0xd664('0x41')]);return db[_0xd664('0x2d')][_0xd664('0x47')](_0x46f360)[_0xd664('0x26')](handleEntityNotFound(_0x565108,null))[_0xd664('0x26')](respondWithResult(_0x565108,null))[_0xd664('0x48')](handleError(_0x565108,null));};exports[_0xd664('0x49')]=function(_0x598d6c,_0x88b75d){return db['FaxQueue']['create'](_0x598d6c[_0xd664('0x4a')],{})[_0xd664('0x26')](function(_0x106865){var _0x5dc9a2=_0x598d6c['user'][_0xd664('0x27')]({'plain':!![]});if(!_0x5dc9a2)throw new Error(_0xd664('0x4b'));if(_0x5dc9a2['role']===_0xd664('0x4c')){var _0x4132ba=_0x106865[_0xd664('0x27')]({'plain':!![]});var _0x3684d9=_0xd664('0x28');return db[_0xd664('0x4d')]['find']({'where':{'name':_0x3684d9,'userProfileId':_0x5dc9a2[_0xd664('0x4e')]},'raw':!![]})[_0xd664('0x26')](function(_0x14c896){if(_0x14c896&&_0x14c896[_0xd664('0x4f')]===0x0){return db[_0xd664('0x50')][_0xd664('0x49')]({'name':_0x4132ba[_0xd664('0x2b')],'resourceId':_0x4132ba['id'],'type':_0x14c896['name'],'sectionId':_0x14c896['id']},{})[_0xd664('0x26')](function(){return _0x106865;});}else{return _0x106865;}})['catch'](function(_0x19695d){logger[_0xd664('0x2a')](_0xd664('0x51'),_0x19695d);throw _0x19695d;});}return _0x106865;})['then'](respondWithResult(_0x88b75d,0xc9))[_0xd664('0x48')](handleError(_0x88b75d,null));};exports['update']=function(_0x2b6181,_0x457e34){if(_0x2b6181[_0xd664('0x4a')]['id']){delete _0x2b6181['body']['id'];}return db[_0xd664('0x2d')]['find']({'where':{'id':_0x2b6181[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x457e34,null))['then'](saveUpdates(_0x2b6181[_0xd664('0x4a')],null))[_0xd664('0x26')](respondWithResult(_0x457e34,null))[_0xd664('0x48')](handleError(_0x457e34,null));};exports[_0xd664('0x29')]=function(_0xc82aee,_0x4cd96d){return db[_0xd664('0x2d')][_0xd664('0x47')]({'where':{'id':_0xc82aee[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x4cd96d,null))[_0xd664('0x26')](removeEntity(_0x4cd96d,null))['catch'](handleError(_0x4cd96d,null));};exports[_0xd664('0x52')]=function(_0x33e21b,_0x15d535){return db['FaxQueue'][_0xd664('0x52')]()[_0xd664('0x26')](respondWithResult(_0x15d535,null))[_0xd664('0x48')](handleError(_0x15d535,null));};exports[_0xd664('0x53')]=function(_0x63a5d2,_0x137ed0,_0x323613){var _0x435658={'raw':!![],'where':{}},_0x9bbc82={},_0x578de8;return db['FaxQueue'][_0xd664('0x54')]({'where':{'id':_0x63a5d2[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x137ed0,null))[_0xd664('0x26')](function(_0x527cdc){if(_0x527cdc){_0x578de8=_0x527cdc[_0xd664('0x27')]({'plain':!![]});_0x9bbc82[_0xd664('0x32')]=_['keys'](db[_0xd664('0x55')][_0xd664('0x2e')]);_0x9bbc82[_0xd664('0x33')]=_[_0xd664('0x46')](_0x63a5d2['query']);_0x9bbc82[_0xd664('0x34')]=_['intersection'](_0x9bbc82[_0xd664('0x32')],_0x9bbc82['query']);_0x435658[_0xd664('0x36')]=_['intersection'](_0x9bbc82[_0xd664('0x32')],qs[_0xd664('0x37')](_0x63a5d2[_0xd664('0x33')][_0xd664('0x37')]));_0x435658['attributes']=_0x435658['attributes'][_0xd664('0x38')]?_0x435658[_0xd664('0x36')]:_0x9bbc82[_0xd664('0x32')];if(!_0x63a5d2['query'][_0xd664('0x39')]('nolimit')){_0x435658[_0xd664('0x1d')]=qs[_0xd664('0x1d')](_0x63a5d2[_0xd664('0x33')][_0xd664('0x1d')]);_0x435658[_0xd664('0x1f')]=qs[_0xd664('0x1f')](_0x63a5d2[_0xd664('0x33')]['offset']);}_0x435658['order']=qs[_0xd664('0x3c')](_0x63a5d2[_0xd664('0x33')][_0xd664('0x3c')]);_0x435658[_0xd664('0x3d')]=qs[_0xd664('0x34')](_[_0xd664('0x3e')](_0x63a5d2['query'],_0x9bbc82[_0xd664('0x34')]));_0x435658[_0xd664('0x3d')][_0xd664('0x56')]=_0x527cdc['id'];if(_0x63a5d2[_0xd664('0x33')][_0xd664('0x40')]){_0x435658[_0xd664('0x3d')]=_[_0xd664('0x3f')](_0x435658[_0xd664('0x3d')],{'$or':_[_0xd664('0x2c')](_0x435658[_0xd664('0x36')],function(_0x158212){var _0x36cd7b={};_0x36cd7b[_0x158212]={'$like':'%'+_0x63a5d2[_0xd664('0x33')][_0xd664('0x40')]+'%'};return _0x36cd7b;})});}_0x435658=_[_0xd664('0x3f')]({},_0x435658,_0x63a5d2['options']);return db['UserFaxQueue'][_0xd664('0x43')](_0x435658);}})[_0xd664('0x26')](function(_0x2c2d60){if(_0x2c2d60){return db['User'][_0xd664('0x57')]({'where':{'id':_[_0xd664('0x2c')](_0x2c2d60,_0xd664('0x58')),'role':_0xd664('0x59')},'attributes':['id',_0xd664('0x2b'),'faxPause',_0xd664('0x5a'),_0xd664('0x5b')]});}})[_0xd664('0x26')](function(_0x2282f5){if(_0x2282f5){return{'count':_0x2282f5[_0xd664('0x1e')],'rows':_[_0xd664('0x2c')](_0x2282f5['rows'],function(_0x3fa221){return{'membername':_0x3fa221[_0xd664('0x2b')],'UserId':_0x3fa221['id'],'queue_name':_0x578de8[_0xd664('0x2b')],'FaxQueueId':_0x578de8['id'],'interface':util['format']('%s/%s',_0xd664('0x5c'),_0x3fa221[_0xd664('0x2b')]),'penalty':0x0,'paused':_0x3fa221[_0xd664('0x5d')],'createdAt':_0x3fa221[_0xd664('0x5b')],'updatedAt':_0x3fa221[_0xd664('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x137ed0,_0x435658))[_0xd664('0x48')](handleError(_0x137ed0,null));};exports[_0xd664('0x5e')]=function(_0x6f1561,_0x566190,_0x1597b3){var _0x51d46a={};var _0x3cf2e6={};var _0x5aea42;var _0x2ae356;return db['FaxQueue']['findOne']({'where':{'id':_0x6f1561[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x566190,null))[_0xd664('0x26')](function(_0x557539){if(_0x557539){_0x5aea42=_0x557539;_0x3cf2e6[_0xd664('0x32')]=_[_0xd664('0x46')](db[_0xd664('0x5f')]['rawAttributes']);_0x3cf2e6[_0xd664('0x33')]=_[_0xd664('0x46')](_0x6f1561[_0xd664('0x33')]);_0x3cf2e6[_0xd664('0x34')]=_['intersection'](_0x3cf2e6['model'],_0x3cf2e6[_0xd664('0x33')]);_0x51d46a['attributes']=_[_0xd664('0x35')](_0x3cf2e6[_0xd664('0x32')],qs[_0xd664('0x37')](_0x6f1561['query'][_0xd664('0x37')]));_0x51d46a[_0xd664('0x36')]=_0x51d46a['attributes'][_0xd664('0x38')]?_0x51d46a[_0xd664('0x36')]:_0x3cf2e6[_0xd664('0x32')];_0x51d46a[_0xd664('0x3b')]=qs[_0xd664('0x3c')](_0x6f1561[_0xd664('0x33')][_0xd664('0x3c')]);_0x51d46a[_0xd664('0x3d')]=qs[_0xd664('0x34')](_['pick'](_0x6f1561[_0xd664('0x33')],_0x3cf2e6[_0xd664('0x34')]));if(_0x6f1561[_0xd664('0x33')][_0xd664('0x40')]){_0x51d46a['where']=_[_0xd664('0x3f')](_0x51d46a[_0xd664('0x3d')],{'$or':_['map'](_0x51d46a[_0xd664('0x36')],function(_0x54991a){var _0x1c5858={};_0x1c5858[_0x54991a]={'$like':'%'+_0x6f1561[_0xd664('0x33')]['filter']+'%'};return _0x1c5858;})});}_0x51d46a=_[_0xd664('0x3f')]({},_0x51d46a,_0x6f1561[_0xd664('0x41')]);return _0x5aea42['getTeams'](_0x51d46a);}})[_0xd664('0x26')](function(_0x90d645){if(_0x90d645){_0x2ae356=_0x90d645[_0xd664('0x38')];if(!_0x6f1561['query']['hasOwnProperty'](_0xd664('0x3a'))){_0x51d46a[_0xd664('0x1d')]=qs[_0xd664('0x1d')](_0x6f1561[_0xd664('0x33')][_0xd664('0x1d')]);_0x51d46a['offset']=qs[_0xd664('0x1f')](_0x6f1561[_0xd664('0x33')]['offset']);}return _0x5aea42['getTeams'](_0x51d46a);}})['then'](function(_0xcd857e){if(_0xcd857e){return _0xcd857e?{'count':_0x2ae356,'rows':_0xcd857e}:null;}})[_0xd664('0x26')](respondWithResult(_0x566190,null))[_0xd664('0x48')](handleError(_0x566190,null));};exports[_0xd664('0x60')]=function(_0x362414,_0xa9c297,_0x3d4df6){var _0x19c0d7=_0x362414['body'][_0xd664('0x61')];return db[_0xd664('0x5f')]['findAll']({'where':{'id':_0x19c0d7},'attributes':['id'],'include':[{'model':db[_0xd664('0x62')],'as':_0xd664('0x63'),'attributes':['id',_0xd664('0x2b'),_0xd664('0x64'),_0xd664('0x65'),'interface'],'raw':!![]}]})[_0xd664('0x26')](function(_0x337891){if(_0x337891){var _0x3d0932=_['flatMap'](_0x337891,function(_0x4697e0){var _0x2c64c7=_0x4697e0[_0xd664('0x27')]({'plain':!![]});return _0x2c64c7[_0xd664('0x63')];});return db['FaxQueue'][_0xd664('0x47')]({'where':{'id':_0x362414[_0xd664('0x45')]['id']}})[_0xd664('0x26')](function(_0x139947){return db[_0xd664('0x66')][_0xd664('0x67')](function(_0x4d21e8){return _0x139947[_0xd664('0x60')](_0x19c0d7,{'transaction':_0x4d21e8})[_0xd664('0x26')](function(){return BPromise[_0xd664('0x68')](_0x3d0932,function(_0x288a94){return db[_0xd664('0x55')]['findOrCreate']({'where':{'UserId':_0x288a94['id'],'FaxQueueId':_0x362414[_0xd664('0x45')]['id']},'transaction':_0x4d21e8});});})['then'](function(){_0x3d0932['forEach'](function(_0x5bee18){socket[_0xd664('0x69')](_0xd664('0x6a'),{'UserId':_0x5bee18['id'],'FaxQueueId':_0x139947['id']});});});});});}})[_0xd664('0x26')](respondWithStatusCode(_0xa9c297,null))[_0xd664('0x48')](handleError(_0xa9c297,null));};exports['removeTeams']=function(_0x3422a2,_0x2d4a1e,_0x310cd0){return db[_0xd664('0x5f')][_0xd664('0x43')]({'where':{'id':_0x3422a2[_0xd664('0x33')][_0xd664('0x61')]},'attributes':['id'],'include':[{'model':db[_0xd664('0x62')],'as':_0xd664('0x63'),'attributes':['id'],'raw':!![]}]})[_0xd664('0x26')](handleEntityNotFound(_0x2d4a1e,null))[_0xd664('0x26')](function(_0x9072a9){var _0x5391a6=_[_0xd664('0x2c')](_0x9072a9,'id');var _0x1b1ecb=[];var _0x2f0240=[];var _0x2db06a=squel[_0xd664('0x6b')]();_0x2db06a[_0xd664('0x6c')]('tq.TeamId')[_0xd664('0x6d')](_0xd664('0x6e'),'tq')[_0xd664('0x6f')](_0xd664('0x70'),'ut',_0xd664('0x71'))[_0xd664('0x3d')](_0xd664('0x72'),_0x3422a2['params']['id']);for(var _0x34ecfe=0x0;_0x34ecfe<_0x9072a9[_0xd664('0x38')];_0x34ecfe+=0x1){let _0x4f3a1a=_0x9072a9[_0x34ecfe];for(var _0x12a506=0x0;_0x12a506<_0x4f3a1a['Agents'][_0xd664('0x38')];_0x12a506+=0x1){let _0x58cc9d=_0x4f3a1a['Agents'][_0x12a506];var _0x408c52=_0x2db06a[_0xd664('0x73')]();_0x408c52[_0xd664('0x3d')]('ut.UserId\x20=\x20?',_0x58cc9d['id']);_0x2f0240[_0xd664('0x74')](db['sequelize'][_0xd664('0x33')](_0x408c52[_0xd664('0x75')](),{'type':db[_0xd664('0x66')][_0xd664('0x76')]['SELECT']})[_0xd664('0x26')](function(_0x19b173){if(_0x19b173[_0xd664('0x38')]===0x1){return _0x58cc9d['id'];}else{var _0xffc993=_['every'](_[_0xd664('0x2c')](_0x19b173,_0xd664('0x77')),function(_0x234b2a){return _[_0xd664('0x78')](_0x5391a6,_0x234b2a);});if(_0xffc993){return _0x58cc9d['id'];}}}));}}return BPromise[_0xd664('0x79')](_0x2f0240)[_0xd664('0x26')](function(_0x2ee484){_0x1b1ecb=_(_0x1b1ecb)[_0xd664('0x7a')](_0x2ee484)[_0xd664('0x7b')]()['value']();return db[_0xd664('0x2d')][_0xd664('0x47')]({'where':{'id':_0x3422a2[_0xd664('0x45')]['id']}})[_0xd664('0x26')](function(_0x2075de){return db['sequelize'][_0xd664('0x67')](function(_0x2106e1){return _0x2075de[_0xd664('0x7c')](_0x3422a2[_0xd664('0x33')][_0xd664('0x61')],{'transaction':_0x2106e1})[_0xd664('0x26')](function(){if(!_['isEmpty'](_0x1b1ecb)){return _0x2075de[_0xd664('0x7d')](_0x1b1ecb,{'transaction':_0x2106e1});}})[_0xd664('0x26')](function(){_0x1b1ecb[_0xd664('0x7e')](function(_0x541e5c){socket['emit'](_0xd664('0x7f'),{'UserId':_0x541e5c,'FaxQueueId':_0x2075de['id']});});});});});});})[_0xd664('0x26')](respondWithStatusCode(_0x2d4a1e,null))[_0xd664('0x48')](handleError(_0x2d4a1e,null));};exports[_0xd664('0x80')]=function(_0x4a5527,_0x4c1328,_0x26af1b){return db[_0xd664('0x2d')]['find']({'where':{'id':_0x4a5527[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x4c1328,null))[_0xd664('0x26')](function(_0x540643){if(_0x540643){return _0x540643['addAgents'](_0x4a5527[_0xd664('0x4a')][_0xd664('0x61')],_[_0xd664('0x81')](_0x4a5527['body'],[_0xd664('0x61'),'id'])||{})[_0xd664('0x82')](function(_0x2623b4){for(var _0x493b28=0x0;_0x493b28<_0x4a5527[_0xd664('0x4a')][_0xd664('0x61')]['length'];_0x493b28+=0x1){socket[_0xd664('0x69')]('userFaxQueue:save',{'UserId':Number(_0x4a5527[_0xd664('0x4a')][_0xd664('0x61')][_0x493b28]),'FaxQueueId':Number(_0x4a5527[_0xd664('0x45')]['id'])});}return _0x2623b4;});}})[_0xd664('0x26')](respondWithResult(_0x4c1328,null))[_0xd664('0x48')](handleError(_0x4c1328,null));};exports[_0xd664('0x7d')]=function(_0x4fc08d,_0x18b5d4,_0x6ed493){return db[_0xd664('0x2d')][_0xd664('0x47')]({'where':{'id':_0x4fc08d[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x18b5d4,null))['then'](function(_0x11fe90){if(_0x11fe90){return _0x11fe90[_0xd664('0x7d')](_0x4fc08d[_0xd664('0x33')][_0xd664('0x61')])[_0xd664('0x26')](function(){if(_[_0xd664('0x83')](_0x4fc08d[_0xd664('0x33')][_0xd664('0x61')])){for(var _0x43957a=0x0;_0x43957a<_0x4fc08d[_0xd664('0x33')][_0xd664('0x61')]['length'];_0x43957a+=0x1){socket[_0xd664('0x69')]('userFaxQueue:remove',{'UserId':Number(_0x4fc08d[_0xd664('0x33')][_0xd664('0x61')][_0x43957a]),'FaxQueueId':Number(_0x4fc08d[_0xd664('0x45')]['id'])});}}else{socket[_0xd664('0x69')](_0xd664('0x7f'),{'UserId':Number(_0x4fc08d['query'][_0xd664('0x61')]),'FaxQueueId':Number(_0x4fc08d[_0xd664('0x45')]['id'])});}});}})[_0xd664('0x26')](respondWithStatusCode(_0x18b5d4,null))[_0xd664('0x48')](handleError(_0x18b5d4,null));};exports['getAgents']=function(_0x2936df,_0x474b7b,_0x1758af){var _0xb0973e={};var _0x2063be={};var _0x5a75fb;var _0x2b17ab;return db[_0xd664('0x2d')][_0xd664('0x54')]({'where':{'id':_0x2936df[_0xd664('0x45')]['id']}})[_0xd664('0x26')](handleEntityNotFound(_0x474b7b,null))[_0xd664('0x26')](function(_0x54b508){if(_0x54b508){_0x5a75fb=_0x54b508;_0x2063be[_0xd664('0x32')]=_[_0xd664('0x46')](db[_0xd664('0x62')][_0xd664('0x2e')]);_0x2063be[_0xd664('0x33')]=_[_0xd664('0x46')](_0x2936df[_0xd664('0x33')]);_0x2063be[_0xd664('0x34')]=_[_0xd664('0x35')](_0x2063be[_0xd664('0x32')],_0x2063be[_0xd664('0x33')]);_0xb0973e[_0xd664('0x36')]=_[_0xd664('0x35')](_0x2063be[_0xd664('0x32')],qs[_0xd664('0x37')](_0x2936df[_0xd664('0x33')][_0xd664('0x37')]));_0xb0973e[_0xd664('0x36')]=_0xb0973e[_0xd664('0x36')][_0xd664('0x38')]?_0xb0973e[_0xd664('0x36')]:_0x2063be[_0xd664('0x32')];_0xb0973e[_0xd664('0x3b')]=qs[_0xd664('0x3c')](_0x2936df['query']['sort']);_0xb0973e['where']=qs[_0xd664('0x34')](_[_0xd664('0x3e')](_0x2936df[_0xd664('0x33')],_0x2063be['filters']));if(_0x2936df[_0xd664('0x33')]['filter']){_0xb0973e[_0xd664('0x3d')]=_[_0xd664('0x3f')](_0xb0973e[_0xd664('0x3d')],{'$or':_[_0xd664('0x2c')](_0xb0973e[_0xd664('0x36')],function(_0x16f921){var _0x2dc889={};_0x2dc889[_0x16f921]={'$like':'%'+_0x2936df['query']['filter']+'%'};return _0x2dc889;})});}_0xb0973e=_[_0xd664('0x3f')]({},_0xb0973e,_0x2936df['options']);return _0x5a75fb[_0xd664('0x84')](_0xb0973e);}})[_0xd664('0x26')](function(_0x48dad6){if(_0x48dad6){_0x2b17ab=_0x48dad6[_0xd664('0x38')];if(!_0x2936df['query']['hasOwnProperty'](_0xd664('0x3a'))){_0xb0973e['limit']=qs['limit'](_0x2936df[_0xd664('0x33')]['limit']);_0xb0973e[_0xd664('0x1f')]=qs[_0xd664('0x1f')](_0x2936df[_0xd664('0x33')]['offset']);}return _0x5a75fb['getAgents'](_0xb0973e);}})['then'](function(_0xfcf479){if(_0xfcf479){return _0xfcf479?{'count':_0x2b17ab,'rows':_0xfcf479}:null;}})[_0xd664('0x26')](respondWithResult(_0x474b7b,null))[_0xd664('0x48')](handleError(_0x474b7b,null));};
\ No newline at end of file
+var _0x472b=['sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','FaxQueues','destroy','error','stack','name','index','map','FaxQueue','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','push','sequelize','toString','QueryTypes','SELECT','includes','union','value','transaction','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x472b,0xfc));var _0xb472=function(_0x534616,_0x4d978f){_0x534616=_0x534616-0x0;var _0xa085e1=_0x472b[_0x534616];return _0xa085e1;};'use strict';var emlformat=require(_0xb472('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb472('0x1'));var jsonpatch=require(_0xb472('0x2'));var rp=require(_0xb472('0x3'));var moment=require(_0xb472('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb472('0x5'));var util=require(_0xb472('0x6'));var path=require(_0xb472('0x7'));var sox=require(_0xb472('0x8'));var csv=require(_0xb472('0x9'));var ejs=require(_0xb472('0xa'));var fs=require('fs');var fs_extra=require(_0xb472('0xb'));var _=require(_0xb472('0xc'));var squel=require(_0xb472('0xd'));var crypto=require('crypto');var jsforce=require(_0xb472('0xe'));var deskjs=require(_0xb472('0xf'));var toCsv=require(_0xb472('0x9'));var querystring=require(_0xb472('0x10'));var Papa=require(_0xb472('0x11'));var Redis=require(_0xb472('0x12'));var authService=require(_0xb472('0x13'));var qs=require(_0xb472('0x14'));var as=require(_0xb472('0x15'));var hardwareService=require(_0xb472('0x16'));var logger=require(_0xb472('0x17'))(_0xb472('0x18'));var utils=require('../../config/utils');var config=require(_0xb472('0x19'));var licenseUtil=require(_0xb472('0x1a'));var db=require(_0xb472('0x1b'))['db'];config[_0xb472('0x1c')]=_[_0xb472('0x1d')](config[_0xb472('0x1c')],{'host':_0xb472('0x1e'),'port':0x18eb});var socket=require(_0xb472('0x1f'))(new Redis(config[_0xb472('0x1c')]));require(_0xb472('0x20'))[_0xb472('0x21')](socket);function respondWithStatusCode(_0x2fab8d,_0x162f56){_0x162f56=_0x162f56||0xcc;return function(_0x474a58){if(_0x474a58){return _0x2fab8d[_0xb472('0x22')](_0x162f56);}return _0x2fab8d[_0xb472('0x23')](_0x162f56)[_0xb472('0x24')]();};}function respondWithResult(_0xb5bbc8,_0x452c52){_0x452c52=_0x452c52||0xc8;return function(_0x20faad){if(_0x20faad){return _0xb5bbc8[_0xb472('0x23')](_0x452c52)['json'](_0x20faad);}};}function respondWithFilteredResult(_0x5c452d,_0x334467){return function(_0x5dae52){if(_0x5dae52){var _0x334f86=typeof _0x334467['offset']===_0xb472('0x25')&&typeof _0x334467[_0xb472('0x26')]==='undefined';var _0x2b8542=_0x5dae52[_0xb472('0x27')];var _0x5e7bfd=_0x334f86?0x0:_0x334467['offset'];var _0x2a7cef=_0x334f86?_0x5dae52['count']:_0x334467['offset']+_0x334467['limit'];var _0x4fd8a3;if(_0x2a7cef>=_0x2b8542){_0x2a7cef=_0x2b8542;_0x4fd8a3=0xc8;}else{_0x4fd8a3=0xce;}_0x5c452d[_0xb472('0x23')](_0x4fd8a3);return _0x5c452d[_0xb472('0x28')](_0xb472('0x29'),_0x5e7bfd+'-'+_0x2a7cef+'/'+_0x2b8542)[_0xb472('0x2a')](_0x5dae52);}return null;};}function patchUpdates(_0x3b95fe){return function(_0x5b7bbb){try{jsonpatch[_0xb472('0x2b')](_0x5b7bbb,_0x3b95fe,!![]);}catch(_0x4a1ea1){return BPromise[_0xb472('0x2c')](_0x4a1ea1);}return _0x5b7bbb[_0xb472('0x2d')]();};}function saveUpdates(_0x389e46,_0x769324){return function(_0x1d7d41){if(_0x1d7d41){return _0x1d7d41[_0xb472('0x2e')](_0x389e46)['then'](function(_0x2ce51c){return _0x2ce51c;});}return null;};}function removeEntity(_0x1d76bd,_0x228f2a){return function(_0x10589){if(_0x10589){return _0x10589['destroy']()[_0xb472('0x2f')](function(){var _0x58bb04=_0x10589[_0xb472('0x30')]({'plain':!![]});var _0x3f6e49=_0xb472('0x31');return db['UserProfileResource'][_0xb472('0x32')]({'where':{'type':_0x3f6e49,'resourceId':_0x58bb04['id']}})[_0xb472('0x2f')](function(){return _0x10589;});})['then'](function(){_0x1d76bd[_0xb472('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4b44,_0x46208c){return function(_0x2ec30b){if(!_0x2ec30b){_0x5f4b44['sendStatus'](0x194);}return _0x2ec30b;};}function handleError(_0x109e01,_0x27ca01){_0x27ca01=_0x27ca01||0x1f4;return function(_0x28b1ca){logger[_0xb472('0x33')](_0x28b1ca[_0xb472('0x34')]);if(_0x28b1ca['name']){delete _0x28b1ca[_0xb472('0x35')];}_0x109e01['status'](_0x27ca01)['send'](_0x28b1ca);};}exports[_0xb472('0x36')]=function(_0x2d2a5b,_0xfdc0da){var _0x1292e9={},_0x6a828a={},_0x26306b={'count':0x0,'rows':[]};var _0x2e7d9e=_[_0xb472('0x37')](db[_0xb472('0x38')]['rawAttributes'],function(_0xe9ed6b){return{'name':_0xe9ed6b['fieldName'],'type':_0xe9ed6b[_0xb472('0x39')][_0xb472('0x3a')]};});_0x6a828a['model']=_['map'](_0x2e7d9e,_0xb472('0x35'));_0x6a828a[_0xb472('0x3b')]=_[_0xb472('0x3c')](_0x2d2a5b['query']);_0x6a828a[_0xb472('0x3d')]=_[_0xb472('0x3e')](_0x6a828a['model'],_0x6a828a[_0xb472('0x3b')]);_0x1292e9['attributes']=_[_0xb472('0x3e')](_0x6a828a[_0xb472('0x3f')],qs[_0xb472('0x40')](_0x2d2a5b[_0xb472('0x3b')][_0xb472('0x40')]));_0x1292e9[_0xb472('0x41')]=_0x1292e9[_0xb472('0x41')]['length']?_0x1292e9['attributes']:_0x6a828a[_0xb472('0x3f')];if(!_0x2d2a5b['query'][_0xb472('0x42')](_0xb472('0x43'))){_0x1292e9[_0xb472('0x26')]=qs['limit'](_0x2d2a5b['query'][_0xb472('0x26')]);_0x1292e9[_0xb472('0x44')]=qs['offset'](_0x2d2a5b['query'][_0xb472('0x44')]);}_0x1292e9[_0xb472('0x45')]=qs[_0xb472('0x46')](_0x2d2a5b[_0xb472('0x3b')][_0xb472('0x46')]);_0x1292e9[_0xb472('0x47')]=qs['filters'](_[_0xb472('0x48')](_0x2d2a5b['query'],_0x6a828a[_0xb472('0x3d')]),_0x2e7d9e);if(_0x2d2a5b[_0xb472('0x3b')]['filter']){_0x1292e9[_0xb472('0x47')]=_[_0xb472('0x49')](_0x1292e9[_0xb472('0x47')],{'$or':_[_0xb472('0x37')](_0x2e7d9e,function(_0x1e580f){if(_0x1e580f[_0xb472('0x39')]!=='VIRTUAL'){var _0x325116={};_0x325116[_0x1e580f[_0xb472('0x35')]]={'$like':'%'+_0x2d2a5b[_0xb472('0x3b')][_0xb472('0x4a')]+'%'};return _0x325116;}})});}_0x1292e9=_['merge']({},_0x1292e9,_0x2d2a5b['options']);var _0x3abd17={'where':_0x1292e9[_0xb472('0x47')]};return db[_0xb472('0x38')][_0xb472('0x27')](_0x3abd17)[_0xb472('0x2f')](function(_0x3a1074){_0x26306b[_0xb472('0x27')]=_0x3a1074;if(_0x2d2a5b['query']['includeAll']){_0x1292e9['include']=[{'all':!![]}];}return db[_0xb472('0x38')][_0xb472('0x4b')](_0x1292e9);})[_0xb472('0x2f')](function(_0x4a2a04){_0x26306b[_0xb472('0x4c')]=_0x4a2a04;return _0x26306b;})['then'](respondWithFilteredResult(_0xfdc0da,_0x1292e9))[_0xb472('0x4d')](handleError(_0xfdc0da,null));};exports[_0xb472('0x4e')]=function(_0x188ee3,_0xb3071a){var _0x1b9959={'raw':!![],'where':{'id':_0x188ee3[_0xb472('0x4f')]['id']}},_0x5b47f9={};_0x5b47f9[_0xb472('0x3f')]=_['keys'](db['FaxQueue'][_0xb472('0x50')]);_0x5b47f9[_0xb472('0x3b')]=_[_0xb472('0x3c')](_0x188ee3[_0xb472('0x3b')]);_0x5b47f9[_0xb472('0x3d')]=_[_0xb472('0x3e')](_0x5b47f9['model'],_0x5b47f9['query']);_0x1b9959['attributes']=_[_0xb472('0x3e')](_0x5b47f9[_0xb472('0x3f')],qs[_0xb472('0x40')](_0x188ee3['query'][_0xb472('0x40')]));_0x1b9959[_0xb472('0x41')]=_0x1b9959[_0xb472('0x41')][_0xb472('0x51')]?_0x1b9959[_0xb472('0x41')]:_0x5b47f9[_0xb472('0x3f')];if(_0x188ee3[_0xb472('0x3b')][_0xb472('0x52')]){_0x1b9959[_0xb472('0x53')]=[{'all':!![]}];}_0x1b9959=_['merge']({},_0x1b9959,_0x188ee3[_0xb472('0x54')]);return db[_0xb472('0x38')][_0xb472('0x55')](_0x1b9959)[_0xb472('0x2f')](handleEntityNotFound(_0xb3071a,null))[_0xb472('0x2f')](respondWithResult(_0xb3071a,null))[_0xb472('0x4d')](handleError(_0xb3071a,null));};exports[_0xb472('0x56')]=function(_0x2d924c,_0x23d95f){return db[_0xb472('0x38')][_0xb472('0x56')](_0x2d924c[_0xb472('0x57')],{})['then'](function(_0x20d5ec){var _0x2be2f4=_0x2d924c[_0xb472('0x58')][_0xb472('0x30')]({'plain':!![]});if(!_0x2be2f4)throw new Error(_0xb472('0x59'));if(_0x2be2f4[_0xb472('0x5a')]===_0xb472('0x58')){var _0x5f064f=_0x20d5ec[_0xb472('0x30')]({'plain':!![]});var _0x10ee10=_0xb472('0x31');return db[_0xb472('0x5b')][_0xb472('0x55')]({'where':{'name':_0x10ee10,'userProfileId':_0x2be2f4[_0xb472('0x5c')]},'raw':!![]})[_0xb472('0x2f')](function(_0x5c720b){if(_0x5c720b&&_0x5c720b['autoAssociation']===0x0){return db[_0xb472('0x5d')][_0xb472('0x56')]({'name':_0x5f064f[_0xb472('0x35')],'resourceId':_0x5f064f['id'],'type':_0x5c720b['name'],'sectionId':_0x5c720b['id']},{})[_0xb472('0x2f')](function(){return _0x20d5ec;});}else{return _0x20d5ec;}})['catch'](function(_0x142cf1){logger[_0xb472('0x33')](_0xb472('0x5e'),_0x142cf1);throw _0x142cf1;});}return _0x20d5ec;})[_0xb472('0x2f')](respondWithResult(_0x23d95f,0xc9))[_0xb472('0x4d')](handleError(_0x23d95f,null));};exports['update']=function(_0x55b9cf,_0x18c18f){if(_0x55b9cf['body']['id']){delete _0x55b9cf[_0xb472('0x57')]['id'];}return db[_0xb472('0x38')][_0xb472('0x55')]({'where':{'id':_0x55b9cf[_0xb472('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18c18f,null))[_0xb472('0x2f')](saveUpdates(_0x55b9cf[_0xb472('0x57')],null))['then'](respondWithResult(_0x18c18f,null))[_0xb472('0x4d')](handleError(_0x18c18f,null));};exports[_0xb472('0x32')]=function(_0x448f11,_0x4a1070){return db[_0xb472('0x38')][_0xb472('0x55')]({'where':{'id':_0x448f11[_0xb472('0x4f')]['id']}})[_0xb472('0x2f')](handleEntityNotFound(_0x4a1070,null))['then'](removeEntity(_0x4a1070,null))[_0xb472('0x4d')](handleError(_0x4a1070,null));};exports[_0xb472('0x5f')]=function(_0x50d058,_0x1fa1ef){return db[_0xb472('0x38')][_0xb472('0x5f')]()[_0xb472('0x2f')](respondWithResult(_0x1fa1ef,null))[_0xb472('0x4d')](handleError(_0x1fa1ef,null));};exports[_0xb472('0x60')]=function(_0x528801,_0x232d90,_0x11535a){var _0x49d86c={'raw':!![],'where':{}},_0x1a8683={},_0x69f0af;return db[_0xb472('0x38')][_0xb472('0x61')]({'where':{'id':_0x528801[_0xb472('0x4f')]['id']}})[_0xb472('0x2f')](handleEntityNotFound(_0x232d90,null))[_0xb472('0x2f')](function(_0x129b38){if(_0x129b38){_0x69f0af=_0x129b38[_0xb472('0x30')]({'plain':!![]});_0x1a8683['model']=_[_0xb472('0x3c')](db[_0xb472('0x62')][_0xb472('0x50')]);_0x1a8683[_0xb472('0x3b')]=_[_0xb472('0x3c')](_0x528801[_0xb472('0x3b')]);_0x1a8683[_0xb472('0x3d')]=_[_0xb472('0x3e')](_0x1a8683['model'],_0x1a8683['query']);_0x49d86c[_0xb472('0x41')]=_['intersection'](_0x1a8683[_0xb472('0x3f')],qs[_0xb472('0x40')](_0x528801[_0xb472('0x3b')][_0xb472('0x40')]));_0x49d86c[_0xb472('0x41')]=_0x49d86c[_0xb472('0x41')]['length']?_0x49d86c[_0xb472('0x41')]:_0x1a8683['model'];if(!_0x528801['query'][_0xb472('0x42')](_0xb472('0x43'))){_0x49d86c[_0xb472('0x26')]=qs['limit'](_0x528801[_0xb472('0x3b')][_0xb472('0x26')]);_0x49d86c[_0xb472('0x44')]=qs['offset'](_0x528801[_0xb472('0x3b')]['offset']);}_0x49d86c[_0xb472('0x45')]=qs[_0xb472('0x46')](_0x528801[_0xb472('0x3b')][_0xb472('0x46')]);_0x49d86c[_0xb472('0x47')]=qs['filters'](_[_0xb472('0x48')](_0x528801['query'],_0x1a8683['filters']));_0x49d86c[_0xb472('0x47')][_0xb472('0x63')]=_0x129b38['id'];if(_0x528801[_0xb472('0x3b')]['filter']){_0x49d86c[_0xb472('0x47')]=_[_0xb472('0x49')](_0x49d86c[_0xb472('0x47')],{'$or':_[_0xb472('0x37')](_0x49d86c[_0xb472('0x41')],function(_0x2ba5b4){var _0x5ed4ad={};_0x5ed4ad[_0x2ba5b4]={'$like':'%'+_0x528801[_0xb472('0x3b')]['filter']+'%'};return _0x5ed4ad;})});}_0x49d86c=_[_0xb472('0x49')]({},_0x49d86c,_0x528801[_0xb472('0x54')]);return db['UserFaxQueue']['findAll'](_0x49d86c);}})['then'](function(_0x5020fc){if(_0x5020fc){return db[_0xb472('0x64')][_0xb472('0x65')]({'where':{'id':_[_0xb472('0x37')](_0x5020fc,_0xb472('0x66')),'role':'agent'},'attributes':['id',_0xb472('0x35'),_0xb472('0x67'),'updatedAt',_0xb472('0x68')]});}})[_0xb472('0x2f')](function(_0x2ec9d2){if(_0x2ec9d2){return{'count':_0x2ec9d2['count'],'rows':_[_0xb472('0x37')](_0x2ec9d2[_0xb472('0x4c')],function(_0x3ad609){return{'membername':_0x3ad609[_0xb472('0x35')],'UserId':_0x3ad609['id'],'queue_name':_0x69f0af['name'],'FaxQueueId':_0x69f0af['id'],'interface':util[_0xb472('0x69')](_0xb472('0x6a'),_0xb472('0x6b'),_0x3ad609[_0xb472('0x35')]),'penalty':0x0,'paused':_0x3ad609['faxPause'],'createdAt':_0x3ad609[_0xb472('0x68')],'updatedAt':_0x3ad609[_0xb472('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x232d90,_0x49d86c))[_0xb472('0x4d')](handleError(_0x232d90,null));};exports[_0xb472('0x6d')]=function(_0x2f55bf,_0x30a7f5,_0x42dfad){var _0x581fc1={};var _0x4c5c0d={};var _0x419f34;var _0x521e8f;return db[_0xb472('0x38')][_0xb472('0x61')]({'where':{'id':_0x2f55bf['params']['id']}})[_0xb472('0x2f')](handleEntityNotFound(_0x30a7f5,null))[_0xb472('0x2f')](function(_0x1b2eae){if(_0x1b2eae){_0x419f34=_0x1b2eae;_0x4c5c0d[_0xb472('0x3f')]=_[_0xb472('0x3c')](db[_0xb472('0x6e')]['rawAttributes']);_0x4c5c0d['query']=_[_0xb472('0x3c')](_0x2f55bf[_0xb472('0x3b')]);_0x4c5c0d['filters']=_[_0xb472('0x3e')](_0x4c5c0d[_0xb472('0x3f')],_0x4c5c0d['query']);_0x581fc1['attributes']=_[_0xb472('0x3e')](_0x4c5c0d[_0xb472('0x3f')],qs['fields'](_0x2f55bf[_0xb472('0x3b')]['fields']));_0x581fc1[_0xb472('0x41')]=_0x581fc1[_0xb472('0x41')]['length']?_0x581fc1[_0xb472('0x41')]:_0x4c5c0d[_0xb472('0x3f')];_0x581fc1[_0xb472('0x45')]=qs[_0xb472('0x46')](_0x2f55bf[_0xb472('0x3b')]['sort']);_0x581fc1[_0xb472('0x47')]=qs[_0xb472('0x3d')](_[_0xb472('0x48')](_0x2f55bf[_0xb472('0x3b')],_0x4c5c0d['filters']));if(_0x2f55bf['query']['filter']){_0x581fc1['where']=_[_0xb472('0x49')](_0x581fc1['where'],{'$or':_['map'](_0x581fc1[_0xb472('0x41')],function(_0x468b02){var _0xb76b7b={};_0xb76b7b[_0x468b02]={'$like':'%'+_0x2f55bf[_0xb472('0x3b')][_0xb472('0x4a')]+'%'};return _0xb76b7b;})});}_0x581fc1=_[_0xb472('0x49')]({},_0x581fc1,_0x2f55bf[_0xb472('0x54')]);return _0x419f34[_0xb472('0x6d')](_0x581fc1);}})[_0xb472('0x2f')](function(_0x54b68f){if(_0x54b68f){_0x521e8f=_0x54b68f[_0xb472('0x51')];if(!_0x2f55bf[_0xb472('0x3b')][_0xb472('0x42')](_0xb472('0x43'))){_0x581fc1[_0xb472('0x26')]=qs['limit'](_0x2f55bf[_0xb472('0x3b')][_0xb472('0x26')]);_0x581fc1[_0xb472('0x44')]=qs[_0xb472('0x44')](_0x2f55bf[_0xb472('0x3b')]['offset']);}return _0x419f34[_0xb472('0x6d')](_0x581fc1);}})['then'](function(_0x4fcb1d){if(_0x4fcb1d){return _0x4fcb1d?{'count':_0x521e8f,'rows':_0x4fcb1d}:null;}})[_0xb472('0x2f')](respondWithResult(_0x30a7f5,null))[_0xb472('0x4d')](handleError(_0x30a7f5,null));};exports[_0xb472('0x6f')]=function(_0x1ce625,_0x5281f0,_0x45a752){var _0x4ccca9=_0x1ce625[_0xb472('0x57')][_0xb472('0x70')];return db[_0xb472('0x6e')][_0xb472('0x4b')]({'where':{'id':_0x4ccca9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb472('0x71'),'attributes':['id',_0xb472('0x35'),'online',_0xb472('0x72'),_0xb472('0x73')],'raw':!![]}]})[_0xb472('0x2f')](function(_0x2c4df6){if(_0x2c4df6){var _0x39cda4=_['flatMap'](_0x2c4df6,function(_0x20bd54){var _0x470e23=_0x20bd54[_0xb472('0x30')]({'plain':!![]});return _0x470e23[_0xb472('0x71')];});return db[_0xb472('0x38')]['find']({'where':{'id':_0x1ce625[_0xb472('0x4f')]['id']}})[_0xb472('0x2f')](function(_0x327e2d){return db['sequelize']['transaction'](function(_0x1f3fb3){return _0x327e2d[_0xb472('0x6f')](_0x4ccca9,{'transaction':_0x1f3fb3})[_0xb472('0x2f')](function(){return BPromise['each'](_0x39cda4,function(_0x250f26){return db['UserFaxQueue'][_0xb472('0x74')]({'where':{'UserId':_0x250f26['id'],'FaxQueueId':_0x1ce625['params']['id']},'transaction':_0x1f3fb3});});})[_0xb472('0x2f')](function(){_0x39cda4[_0xb472('0x75')](function(_0x202ee7){socket[_0xb472('0x76')]('userFaxQueue:save',{'UserId':_0x202ee7['id'],'FaxQueueId':_0x327e2d['id']});});});});});}})[_0xb472('0x2f')](respondWithStatusCode(_0x5281f0,null))[_0xb472('0x4d')](handleError(_0x5281f0,null));};exports['removeTeams']=function(_0x534363,_0x34b22e,_0x162b4d){return db[_0xb472('0x6e')][_0xb472('0x4b')]({'where':{'id':_0x534363[_0xb472('0x3b')][_0xb472('0x70')]},'attributes':['id'],'include':[{'model':db[_0xb472('0x64')],'as':_0xb472('0x71'),'attributes':['id'],'raw':!![]}]})[_0xb472('0x2f')](handleEntityNotFound(_0x34b22e,null))[_0xb472('0x2f')](function(_0x21eef9){var _0x190185=_[_0xb472('0x37')](_0x21eef9,'id');var _0x26282e=[];var _0x3d51d0=[];var _0x444710=squel[_0xb472('0x77')]();_0x444710[_0xb472('0x78')](_0xb472('0x79'))['from'](_0xb472('0x7a'),'tq')[_0xb472('0x7b')](_0xb472('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x534363['params']['id']);for(var _0x5e2d1a=0x0;_0x5e2d1a<_0x21eef9[_0xb472('0x51')];_0x5e2d1a+=0x1){let _0x36f808=_0x21eef9[_0x5e2d1a];for(var _0x5e3fec=0x0;_0x5e3fec<_0x36f808[_0xb472('0x71')][_0xb472('0x51')];_0x5e3fec+=0x1){let _0x24c0fa=_0x36f808[_0xb472('0x71')][_0x5e3fec];var _0x2ad2e1=_0x444710['clone']();_0x2ad2e1[_0xb472('0x47')]('ut.UserId\x20=\x20?',_0x24c0fa['id']);_0x3d51d0[_0xb472('0x7d')](db[_0xb472('0x7e')][_0xb472('0x3b')](_0x2ad2e1[_0xb472('0x7f')](),{'type':db['sequelize'][_0xb472('0x80')][_0xb472('0x81')]})[_0xb472('0x2f')](function(_0x5413a1){if(_0x5413a1[_0xb472('0x51')]===0x1){return _0x24c0fa['id'];}else{var _0x3b4963=_['every'](_[_0xb472('0x37')](_0x5413a1,'TeamId'),function(_0x54082d){return _[_0xb472('0x82')](_0x190185,_0x54082d);});if(_0x3b4963){return _0x24c0fa['id'];}}}));}}return BPromise['all'](_0x3d51d0)[_0xb472('0x2f')](function(_0x46bbe6){_0x26282e=_(_0x26282e)[_0xb472('0x83')](_0x46bbe6)['compact']()[_0xb472('0x84')]();return db[_0xb472('0x38')][_0xb472('0x55')]({'where':{'id':_0x534363[_0xb472('0x4f')]['id']}})[_0xb472('0x2f')](function(_0x23a452){return db[_0xb472('0x7e')][_0xb472('0x85')](function(_0x14c298){return _0x23a452[_0xb472('0x86')](_0x534363['query'][_0xb472('0x70')],{'transaction':_0x14c298})['then'](function(){if(!_[_0xb472('0x87')](_0x26282e)){return _0x23a452['removeAgents'](_0x26282e,{'transaction':_0x14c298});}})[_0xb472('0x2f')](function(){_0x26282e['forEach'](function(_0x45ca44){socket[_0xb472('0x76')](_0xb472('0x88'),{'UserId':_0x45ca44,'FaxQueueId':_0x23a452['id']});});});});});});})['then'](respondWithStatusCode(_0x34b22e,null))[_0xb472('0x4d')](handleError(_0x34b22e,null));};exports[_0xb472('0x89')]=function(_0x3cacf5,_0x8a957f,_0xc04ed9){return db[_0xb472('0x38')][_0xb472('0x55')]({'where':{'id':_0x3cacf5[_0xb472('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8a957f,null))[_0xb472('0x2f')](function(_0x2ec728){if(_0x2ec728){return _0x2ec728[_0xb472('0x89')](_0x3cacf5[_0xb472('0x57')][_0xb472('0x70')],_[_0xb472('0x8a')](_0x3cacf5[_0xb472('0x57')],[_0xb472('0x70'),'id'])||{})[_0xb472('0x8b')](function(_0x35fee1){for(var _0x89a49c=0x0;_0x89a49c<_0x3cacf5[_0xb472('0x57')][_0xb472('0x70')]['length'];_0x89a49c+=0x1){socket[_0xb472('0x76')]('userFaxQueue:save',{'UserId':Number(_0x3cacf5[_0xb472('0x57')][_0xb472('0x70')][_0x89a49c]),'FaxQueueId':Number(_0x3cacf5[_0xb472('0x4f')]['id'])});}return _0x35fee1;});}})[_0xb472('0x2f')](respondWithResult(_0x8a957f,null))['catch'](handleError(_0x8a957f,null));};exports[_0xb472('0x8c')]=function(_0x27a1d6,_0x286b39,_0x1ce128){return db[_0xb472('0x38')]['find']({'where':{'id':_0x27a1d6['params']['id']}})['then'](handleEntityNotFound(_0x286b39,null))[_0xb472('0x2f')](function(_0x525529){if(_0x525529){return _0x525529[_0xb472('0x8c')](_0x27a1d6[_0xb472('0x3b')][_0xb472('0x70')])['then'](function(){if(_[_0xb472('0x8d')](_0x27a1d6[_0xb472('0x3b')][_0xb472('0x70')])){for(var _0x59452f=0x0;_0x59452f<_0x27a1d6[_0xb472('0x3b')][_0xb472('0x70')][_0xb472('0x51')];_0x59452f+=0x1){socket[_0xb472('0x76')](_0xb472('0x88'),{'UserId':Number(_0x27a1d6[_0xb472('0x3b')][_0xb472('0x70')][_0x59452f]),'FaxQueueId':Number(_0x27a1d6[_0xb472('0x4f')]['id'])});}}else{socket['emit'](_0xb472('0x88'),{'UserId':Number(_0x27a1d6[_0xb472('0x3b')][_0xb472('0x70')]),'FaxQueueId':Number(_0x27a1d6['params']['id'])});}});}})[_0xb472('0x2f')](respondWithStatusCode(_0x286b39,null))[_0xb472('0x4d')](handleError(_0x286b39,null));};exports[_0xb472('0x8e')]=function(_0x134276,_0x5387a8,_0x2eb354){var _0x308521={};var _0x37c1c6={};var _0x13dbc3;var _0x24f173;return db[_0xb472('0x38')]['findOne']({'where':{'id':_0x134276['params']['id']}})[_0xb472('0x2f')](handleEntityNotFound(_0x5387a8,null))[_0xb472('0x2f')](function(_0x4c85fb){if(_0x4c85fb){_0x13dbc3=_0x4c85fb;_0x37c1c6['model']=_[_0xb472('0x3c')](db[_0xb472('0x64')]['rawAttributes']);_0x37c1c6[_0xb472('0x3b')]=_[_0xb472('0x3c')](_0x134276[_0xb472('0x3b')]);_0x37c1c6[_0xb472('0x3d')]=_[_0xb472('0x3e')](_0x37c1c6[_0xb472('0x3f')],_0x37c1c6[_0xb472('0x3b')]);_0x308521['attributes']=_['intersection'](_0x37c1c6[_0xb472('0x3f')],qs[_0xb472('0x40')](_0x134276[_0xb472('0x3b')][_0xb472('0x40')]));_0x308521['attributes']=_0x308521[_0xb472('0x41')][_0xb472('0x51')]?_0x308521[_0xb472('0x41')]:_0x37c1c6[_0xb472('0x3f')];_0x308521['order']=qs['sort'](_0x134276[_0xb472('0x3b')]['sort']);_0x308521['where']=qs[_0xb472('0x3d')](_[_0xb472('0x48')](_0x134276['query'],_0x37c1c6[_0xb472('0x3d')]));if(_0x134276[_0xb472('0x3b')][_0xb472('0x4a')]){_0x308521[_0xb472('0x47')]=_[_0xb472('0x49')](_0x308521[_0xb472('0x47')],{'$or':_['map'](_0x308521[_0xb472('0x41')],function(_0x2beacb){var _0xd3380e={};_0xd3380e[_0x2beacb]={'$like':'%'+_0x134276[_0xb472('0x3b')]['filter']+'%'};return _0xd3380e;})});}_0x308521=_[_0xb472('0x49')]({},_0x308521,_0x134276[_0xb472('0x54')]);return _0x13dbc3[_0xb472('0x8e')](_0x308521);}})[_0xb472('0x2f')](function(_0x438503){if(_0x438503){_0x24f173=_0x438503[_0xb472('0x51')];if(!_0x134276[_0xb472('0x3b')][_0xb472('0x42')](_0xb472('0x43'))){_0x308521['limit']=qs[_0xb472('0x26')](_0x134276[_0xb472('0x3b')]['limit']);_0x308521['offset']=qs[_0xb472('0x44')](_0x134276['query'][_0xb472('0x44')]);}return _0x13dbc3['getAgents'](_0x308521);}})[_0xb472('0x2f')](function(_0x147d72){if(_0x147d72){return _0x147d72?{'count':_0x24f173,'rows':_0x147d72}:null;}})[_0xb472('0x2f')](respondWithResult(_0x5387a8,null))[_0xb472('0x4d')](handleError(_0x5387a8,null));};
\ No newline at end of file
index 39c0df8..933bd49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ee=['hasOwnProperty','events','FaxQueue','setMaxListeners','save','update','remove'];(function(_0xb30581,_0x4581c1){var _0x29cd12=function(_0x1d35fb){while(--_0x1d35fb){_0xb30581['push'](_0xb30581['shift']());}};_0x29cd12(++_0x4581c1);}(_0x63ee,0xe8));var _0xe63e=function(_0x4a29f1,_0x23e312){_0x4a29f1=_0x4a29f1-0x0;var _0xe71461=_0x63ee[_0x4a29f1];return _0xe71461;};'use strict';var EventEmitter=require(_0xe63e('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xe63e('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe63e('0x2')](0x0);var events={'afterCreate':_0xe63e('0x3'),'afterUpdate':_0xe63e('0x4'),'afterDestroy':_0xe63e('0x5')};function emitEvent(_0x7a07d6){return function(_0x4da68b,_0xae94f5,_0x58b59b){FaxQueueEvents['emit'](_0x7a07d6+':'+_0x4da68b['id'],_0x4da68b);FaxQueueEvents['emit'](_0x7a07d6,_0x4da68b);_0x58b59b(null);};}for(var e in events){if(events[_0xe63e('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0xe5c7=['update','remove','emit','hasOwnProperty','exports','events','FaxQueue','setMaxListeners','save'];(function(_0x9f342e,_0xecafe9){var _0x3e3c8a=function(_0x7c1f1c){while(--_0x7c1f1c){_0x9f342e['push'](_0x9f342e['shift']());}};_0x3e3c8a(++_0xecafe9);}(_0xe5c7,0x15b));var _0x7e5c=function(_0x2962d4,_0x17b750){_0x2962d4=_0x2962d4-0x0;var _0x831903=_0xe5c7[_0x2962d4];return _0x831903;};'use strict';var EventEmitter=require(_0x7e5c('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x7e5c('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7e5c('0x2')](0x0);var events={'afterCreate':_0x7e5c('0x3'),'afterUpdate':_0x7e5c('0x4'),'afterDestroy':_0x7e5c('0x5')};function emitEvent(_0x492107){return function(_0x17c294,_0x3e7786,_0x54d9d9){FaxQueueEvents[_0x7e5c('0x6')](_0x492107+':'+_0x17c294['id'],_0x17c294);FaxQueueEvents['emit'](_0x492107,_0x17c294);_0x54d9d9(null);};}for(var e in events){if(events[_0x7e5c('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x7e5c('0x8')]=FaxQueueEvents;
\ No newline at end of file
index bee47cf..f08246e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15df=['bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x1d1722,_0x759c36){var _0x100055=function(_0x259635){while(--_0x259635){_0x1d1722['push'](_0x1d1722['shift']());}};_0x100055(++_0x759c36);}(_0x15df,0x15c));var _0xf15d=function(_0x47f0be,_0x494f1d){_0x47f0be=_0x47f0be-0x0;var _0x5d30a3=_0x15df[_0x47f0be];return _0x5d30a3;};'use strict';var _=require(_0xf15d('0x0'));var util=require('util');var logger=require(_0xf15d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf15d('0x2'));var rp=require(_0xf15d('0x3'));var fs=require('fs');var path=require(_0xf15d('0x4'));var rimraf=require('rimraf');var config=require(_0xf15d('0x5'));var attributes=require(_0xf15d('0x6'));module['exports']=function(_0x5684,_0x184291){return _0x5684[_0xf15d('0x7')](_0xf15d('0x8'),attributes,{'tableName':_0xf15d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb355=['fax_queues','lodash','util','../../config/logger','moment','path','../../config/environment','./faxQueue.attributes','exports','FaxQueue'];(function(_0x3c1ca2,_0x3428ae){var _0x310c01=function(_0x1e25a2){while(--_0x1e25a2){_0x3c1ca2['push'](_0x3c1ca2['shift']());}};_0x310c01(++_0x3428ae);}(_0xb355,0x1c3));var _0x5b35=function(_0x307860,_0xaf7c7d){_0x307860=_0x307860-0x0;var _0x3e726f=_0xb355[_0x307860];return _0x3e726f;};'use strict';var _=require(_0x5b35('0x0'));var util=require(_0x5b35('0x1'));var logger=require(_0x5b35('0x2'))('api');var moment=require(_0x5b35('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b35('0x4'));var rimraf=require('rimraf');var config=require(_0x5b35('0x5'));var attributes=require(_0x5b35('0x6'));module[_0x5b35('0x7')]=function(_0x12e956,_0x1c5890){return _0x12e956['define'](_0x5b35('0x8'),attributes,{'tableName':_0x5b35('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f80d46..f5ea3e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9130=['localhost','./faxQueue.socket','register','request','info','request\x20sent','debug','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','options','raw','where','map','include','model','attributes','GetFaxQueue','find','ShowFaxQueue','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis'];(function(_0x2fc800,_0x49e7d0){var _0xc55a0e=function(_0x33dd64){while(--_0x33dd64){_0x2fc800['push'](_0x2fc800['shift']());}};_0xc55a0e(++_0x49e7d0);}(_0x9130,0x114));var _0x0913=function(_0xe40866,_0x5c3fe5){_0xe40866=_0xe40866-0x0;var _0x313d59=_0x9130[_0xe40866];return _0x313d59;};'use strict';var _=require(_0x0913('0x0'));var util=require('util');var moment=require(_0x0913('0x1'));var BPromise=require(_0x0913('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0913('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0913('0x4'));var logger=require(_0x0913('0x5'))(_0x0913('0x6'));var config=require(_0x0913('0x7'));var jayson=require(_0x0913('0x8'));var client=jayson[_0x0913('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0913('0xa')](config[_0x0913('0xb')],{'host':_0x0913('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0913('0xb')]));require(_0x0913('0xd'))[_0x0913('0xe')](socket);function respondWithRpcPromise(_0x374d52,_0xae3a19,_0x2c68ed){return new BPromise(function(_0x331226,_0x1edfe4){return client[_0x0913('0xf')](_0x374d52,_0x2c68ed)['then'](function(_0x1d2c91){logger[_0x0913('0x10')]('FaxQueue,\x20%s,\x20%s',_0xae3a19,_0x0913('0x11'));logger[_0x0913('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0xae3a19,_0x0913('0x11'),JSON[_0x0913('0x13')](_0x1d2c91));if(_0x1d2c91[_0x0913('0x14')]){if(_0x1d2c91[_0x0913('0x14')]['code']===0x1f4){logger[_0x0913('0x14')](_0x0913('0x15'),_0xae3a19,_0x1d2c91[_0x0913('0x14')][_0x0913('0x16')]);return _0x1edfe4(_0x1d2c91[_0x0913('0x14')][_0x0913('0x16')]);}logger[_0x0913('0x14')](_0x0913('0x15'),_0xae3a19,_0x1d2c91['error']['message']);return _0x331226(_0x1d2c91[_0x0913('0x14')][_0x0913('0x16')]);}else{logger[_0x0913('0x10')](_0x0913('0x15'),_0xae3a19,_0x0913('0x11'));_0x331226(_0x1d2c91[_0x0913('0x17')][_0x0913('0x16')]);}})[_0x0913('0x18')](function(_0x18e203){logger[_0x0913('0x14')](_0x0913('0x15'),_0xae3a19,_0x18e203);_0x1edfe4(_0x18e203);});});}exports['GetFaxQueue']=function(_0x5c965b){var _0x8c79e7=this;return new Promise(function(_0x54a103,_0x3942f0){return db[_0x0913('0x19')]['findAll']({'raw':_0x5c965b[_0x0913('0x1a')]?_0x5c965b['options'][_0x0913('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c965b['options']?_0x5c965b['options'][_0x0913('0x1c')]||null:null,'attributes':_0x5c965b[_0x0913('0x1a')]?_0x5c965b[_0x0913('0x1a')]['attributes']||null:null,'limit':_0x5c965b[_0x0913('0x1a')]?_0x5c965b[_0x0913('0x1a')]['limit']||null:null,'include':_0x5c965b[_0x0913('0x1a')]?_0x5c965b[_0x0913('0x1a')]['include']?_[_0x0913('0x1d')](_0x5c965b[_0x0913('0x1a')][_0x0913('0x1e')],function(_0xd6de00){return{'model':db[_0xd6de00[_0x0913('0x1f')]],'as':_0xd6de00['as'],'attributes':_0xd6de00[_0x0913('0x20')],'include':_0xd6de00[_0x0913('0x1e')]?_[_0x0913('0x1d')](_0xd6de00[_0x0913('0x1e')],function(_0x5acde0){return{'model':db[_0x5acde0[_0x0913('0x1f')]],'as':_0x5acde0['as'],'attributes':_0x5acde0[_0x0913('0x20')],'include':_0x5acde0[_0x0913('0x1e')]?_['map'](_0x5acde0[_0x0913('0x1e')],function(_0x4f672e){return{'model':db[_0x4f672e['model']],'as':_0x4f672e['as'],'attributes':_0x4f672e[_0x0913('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a3c77){logger[_0x0913('0x10')]('GetFaxQueue',_0x5c965b);logger[_0x0913('0x12')](_0x0913('0x21'),_0x5c965b,JSON[_0x0913('0x13')](_0x3a3c77));_0x54a103(_0x3a3c77);})[_0x0913('0x18')](function(_0x212a15){logger[_0x0913('0x14')]('GetFaxQueue',_0x212a15['message'],_0x5c965b);_0x3942f0(_0x8c79e7[_0x0913('0x14')](0x1f4,_0x212a15[_0x0913('0x16')]));});});};exports['ShowFaxQueue']=function(_0x2e3f0c){var _0x484f07=this;return new Promise(function(_0x5846b2,_0x2f8293){return db['FaxQueue'][_0x0913('0x22')]({'raw':_0x2e3f0c[_0x0913('0x1a')]?_0x2e3f0c[_0x0913('0x1a')][_0x0913('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e3f0c[_0x0913('0x1a')]?_0x2e3f0c[_0x0913('0x1a')][_0x0913('0x1c')]||null:null,'attributes':_0x2e3f0c[_0x0913('0x1a')]?_0x2e3f0c[_0x0913('0x1a')]['attributes']||null:null,'include':_0x2e3f0c[_0x0913('0x1a')]?_0x2e3f0c[_0x0913('0x1a')][_0x0913('0x1e')]?_[_0x0913('0x1d')](_0x2e3f0c['options'][_0x0913('0x1e')],function(_0x4141d9){return{'model':db[_0x4141d9[_0x0913('0x1f')]],'as':_0x4141d9['as'],'attributes':_0x4141d9[_0x0913('0x20')],'include':_0x4141d9[_0x0913('0x1e')]?_[_0x0913('0x1d')](_0x4141d9[_0x0913('0x1e')],function(_0x40d11a){return{'model':db[_0x40d11a[_0x0913('0x1f')]],'as':_0x40d11a['as'],'attributes':_0x40d11a[_0x0913('0x20')],'include':_0x40d11a[_0x0913('0x1e')]?_['map'](_0x40d11a[_0x0913('0x1e')],function(_0x43273a){return{'model':db[_0x43273a[_0x0913('0x1f')]],'as':_0x43273a['as'],'attributes':_0x43273a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x146ebd){logger['info'](_0x0913('0x23'),_0x2e3f0c);logger['debug'](_0x0913('0x23'),_0x2e3f0c,JSON['stringify'](_0x146ebd));_0x5846b2(_0x146ebd);})[_0x0913('0x18')](function(_0x2e2f08){logger[_0x0913('0x14')](_0x0913('0x23'),_0x2e2f08[_0x0913('0x16')],_0x2e3f0c);_0x2f8293(_0x484f07[_0x0913('0x14')](0x1f4,_0x2e2f08[_0x0913('0x16')]));});});};
\ No newline at end of file
+var _0xb15f=['register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','include','map','model','attributes','then','stringify','ShowFaxQueue','where','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x451221,_0x2d1707){var _0x5be8ac=function(_0x521500){while(--_0x521500){_0x451221['push'](_0x451221['shift']());}};_0x5be8ac(++_0x2d1707);}(_0xb15f,0xf6));var _0xfb15=function(_0x5a3df3,_0x5aae77){_0x5a3df3=_0x5a3df3-0x0;var _0x1c388b=_0xb15f[_0x5a3df3];return _0x1c388b;};'use strict';var _=require('lodash');var util=require(_0xfb15('0x0'));var moment=require(_0xfb15('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb15('0x2'))['db'];var utils=require(_0xfb15('0x3'));var logger=require(_0xfb15('0x4'))(_0xfb15('0x5'));var config=require(_0xfb15('0x6'));var jayson=require(_0xfb15('0x7'));var client=jayson[_0xfb15('0x8')][_0xfb15('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfb15('0xa')],{'host':_0xfb15('0xb'),'port':0x18eb});var socket=require(_0xfb15('0xc'))(new Redis(config[_0xfb15('0xa')]));require('./faxQueue.socket')[_0xfb15('0xd')](socket);function respondWithRpcPromise(_0x261f4f,_0x50bf98,_0x5e8476){return new BPromise(function(_0x24c9b2,_0x4d5cc9){return client[_0xfb15('0xe')](_0x261f4f,_0x5e8476)['then'](function(_0x164cf7){logger[_0xfb15('0xf')](_0xfb15('0x10'),_0x50bf98,_0xfb15('0x11'));logger[_0xfb15('0x12')](_0xfb15('0x13'),_0x50bf98,_0xfb15('0x11'),JSON['stringify'](_0x164cf7));if(_0x164cf7[_0xfb15('0x14')]){if(_0x164cf7[_0xfb15('0x14')][_0xfb15('0x15')]===0x1f4){logger[_0xfb15('0x14')](_0xfb15('0x10'),_0x50bf98,_0x164cf7['error'][_0xfb15('0x16')]);return _0x4d5cc9(_0x164cf7[_0xfb15('0x14')][_0xfb15('0x16')]);}logger[_0xfb15('0x14')](_0xfb15('0x10'),_0x50bf98,_0x164cf7[_0xfb15('0x14')][_0xfb15('0x16')]);return _0x24c9b2(_0x164cf7[_0xfb15('0x14')][_0xfb15('0x16')]);}else{logger['info'](_0xfb15('0x10'),_0x50bf98,'request\x20sent');_0x24c9b2(_0x164cf7[_0xfb15('0x17')]['message']);}})[_0xfb15('0x18')](function(_0x364ff4){logger[_0xfb15('0x14')](_0xfb15('0x10'),_0x50bf98,_0x364ff4);_0x4d5cc9(_0x364ff4);});});}exports[_0xfb15('0x19')]=function(_0x45145c){var _0x52c2da=this;return new Promise(function(_0x1d4425,_0x381880){return db['FaxQueue'][_0xfb15('0x1a')]({'raw':_0x45145c[_0xfb15('0x1b')]?_0x45145c[_0xfb15('0x1b')][_0xfb15('0x1c')]===undefined?!![]:![]:!![],'where':_0x45145c[_0xfb15('0x1b')]?_0x45145c[_0xfb15('0x1b')]['where']||null:null,'attributes':_0x45145c[_0xfb15('0x1b')]?_0x45145c[_0xfb15('0x1b')]['attributes']||null:null,'limit':_0x45145c['options']?_0x45145c['options']['limit']||null:null,'include':_0x45145c[_0xfb15('0x1b')]?_0x45145c[_0xfb15('0x1b')][_0xfb15('0x1d')]?_[_0xfb15('0x1e')](_0x45145c['options'][_0xfb15('0x1d')],function(_0x1391fa){return{'model':db[_0x1391fa[_0xfb15('0x1f')]],'as':_0x1391fa['as'],'attributes':_0x1391fa[_0xfb15('0x20')],'include':_0x1391fa[_0xfb15('0x1d')]?_[_0xfb15('0x1e')](_0x1391fa[_0xfb15('0x1d')],function(_0x3a7632){return{'model':db[_0x3a7632['model']],'as':_0x3a7632['as'],'attributes':_0x3a7632[_0xfb15('0x20')],'include':_0x3a7632['include']?_[_0xfb15('0x1e')](_0x3a7632[_0xfb15('0x1d')],function(_0x1eadbe){return{'model':db[_0x1eadbe[_0xfb15('0x1f')]],'as':_0x1eadbe['as'],'attributes':_0x1eadbe[_0xfb15('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfb15('0x21')](function(_0x56309d){logger['info'](_0xfb15('0x19'),_0x45145c);logger[_0xfb15('0x12')]('GetFaxQueue',_0x45145c,JSON[_0xfb15('0x22')](_0x56309d));_0x1d4425(_0x56309d);})['catch'](function(_0xee5804){logger[_0xfb15('0x14')]('GetFaxQueue',_0xee5804['message'],_0x45145c);_0x381880(_0x52c2da[_0xfb15('0x14')](0x1f4,_0xee5804[_0xfb15('0x16')]));});});};exports[_0xfb15('0x23')]=function(_0x4caf9e){var _0x6e1ca1=this;return new Promise(function(_0x2e64f1,_0x42f6fd){return db['FaxQueue']['find']({'raw':_0x4caf9e['options']?_0x4caf9e['options'][_0xfb15('0x1c')]===undefined?!![]:![]:!![],'where':_0x4caf9e['options']?_0x4caf9e[_0xfb15('0x1b')][_0xfb15('0x24')]||null:null,'attributes':_0x4caf9e[_0xfb15('0x1b')]?_0x4caf9e[_0xfb15('0x1b')][_0xfb15('0x20')]||null:null,'include':_0x4caf9e['options']?_0x4caf9e['options'][_0xfb15('0x1d')]?_[_0xfb15('0x1e')](_0x4caf9e[_0xfb15('0x1b')][_0xfb15('0x1d')],function(_0x37242c){return{'model':db[_0x37242c[_0xfb15('0x1f')]],'as':_0x37242c['as'],'attributes':_0x37242c[_0xfb15('0x20')],'include':_0x37242c[_0xfb15('0x1d')]?_['map'](_0x37242c['include'],function(_0x209cfb){return{'model':db[_0x209cfb['model']],'as':_0x209cfb['as'],'attributes':_0x209cfb[_0xfb15('0x20')],'include':_0x209cfb[_0xfb15('0x1d')]?_[_0xfb15('0x1e')](_0x209cfb[_0xfb15('0x1d')],function(_0x1fc50f){return{'model':db[_0x1fc50f['model']],'as':_0x1fc50f['as'],'attributes':_0x1fc50f[_0xfb15('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfb15('0x21')](function(_0x2284d8){logger[_0xfb15('0xf')](_0xfb15('0x23'),_0x4caf9e);logger[_0xfb15('0x12')](_0xfb15('0x23'),_0x4caf9e,JSON['stringify'](_0x2284d8));_0x2e64f1(_0x2284d8);})['catch'](function(_0x59920a){logger[_0xfb15('0x14')](_0xfb15('0x23'),_0x59920a[_0xfb15('0x16')],_0x4caf9e);_0x42f6fd(_0x6e1ca1[_0xfb15('0x14')](0x1f4,_0x59920a[_0xfb15('0x16')]));});});};
\ No newline at end of file
index 0be80c2..5cca866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82fb=['length','./faxQueue.events','remove','update'];(function(_0x2b7222,_0x34b9ed){var _0x1ffe98=function(_0x4523b9){while(--_0x4523b9){_0x2b7222['push'](_0x2b7222['shift']());}};_0x1ffe98(++_0x34b9ed);}(_0x82fb,0x11d));var _0xb82f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x82fb[_0x21a9d9];return _0x46adce;};'use strict';var FaxQueueEvents=require(_0xb82f('0x0'));var events=['save',_0xb82f('0x1'),_0xb82f('0x2')];function createListener(_0x4b3377,_0x257ea5){return function(_0x2ceb16){_0x257ea5['emit'](_0x4b3377,_0x2ceb16);};}function removeListener(_0x54d165,_0x333a1a){return function(){FaxQueueEvents['removeListener'](_0x54d165,_0x333a1a);};}exports['register']=function(_0x3b3803){for(var _0x40c23f=0x0,_0x4f4237=events[_0xb82f('0x3')];_0x40c23f<_0x4f4237;_0x40c23f++){var _0x25691f=events[_0x40c23f];var _0x376fa8=createListener('faxQueue:'+_0x25691f,_0x3b3803);FaxQueueEvents['on'](_0x25691f,_0x376fa8);}};
\ No newline at end of file
+var _0xd46b=['faxQueue:','./faxQueue.events','save','update','emit','removeListener','register'];(function(_0x51ba22,_0x78e766){var _0xf0838b=function(_0x25338b){while(--_0x25338b){_0x51ba22['push'](_0x51ba22['shift']());}};_0xf0838b(++_0x78e766);}(_0xd46b,0xe1));var _0xbd46=function(_0xe1150a,_0x199580){_0xe1150a=_0xe1150a-0x0;var _0xf98e7c=_0xd46b[_0xe1150a];return _0xf98e7c;};'use strict';var FaxQueueEvents=require(_0xbd46('0x0'));var events=[_0xbd46('0x1'),'remove',_0xbd46('0x2')];function createListener(_0x65e8,_0x4fc8d7){return function(_0x431283){_0x4fc8d7[_0xbd46('0x3')](_0x65e8,_0x431283);};}function removeListener(_0x102d4b,_0x31d7db){return function(){FaxQueueEvents[_0xbd46('0x4')](_0x102d4b,_0x31d7db);};}exports[_0xbd46('0x5')]=function(_0x531346){for(var _0x3e7bf8=0x0,_0x5c7582=events['length'];_0x3e7bf8<_0x5c7582;_0x3e7bf8++){var _0x220848=events[_0x3e7bf8];var _0x2ce719=createListener(_0xbd46('0x6')+_0x220848,_0x531346);FaxQueueEvents['on'](_0x220848,_0x2ce719);}};
\ No newline at end of file
index 433f9dc..01065f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x2149cd,_0x42776c){var _0x3238f0=function(_0x123ca7){while(--_0x123ca7){_0x2149cd['push'](_0x2149cd['shift']());}};_0x3238f0(++_0x42776c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x250720,_0x1cf3f4){_0x250720=_0x250720-0x0;var _0xdba80e=_0xa6b0[_0x250720];return _0xdba80e;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0x8')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x8')](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x8')](_0x0a6b('0x12'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);router[_0x0a6b('0x14')]('/',auth[_0x0a6b('0x9')](),controller['create']);router['post'](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x15')]);router[_0x0a6b('0x14')](_0x0a6b('0x12'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x16')]);router[_0x0a6b('0x17')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller['update']);router[_0x0a6b('0x18')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller[_0x0a6b('0x19')]);router['delete'](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x1a')]);router[_0x0a6b('0x18')]('/:id/users',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xc2c7=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3703eb,_0x1c7cde){var _0x190bdc=function(_0x5246c8){while(--_0x5246c8){_0x3703eb['push'](_0x3703eb['shift']());}};_0x190bdc(++_0x1c7cde);}(_0xc2c7,0x134));var _0x7c2c=function(_0x8fa945,_0xf976dc){_0x8fa945=_0x8fa945-0x0;var _0x542fd1=_0xc2c7[_0x8fa945];return _0x542fd1;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['get'](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x8')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x8')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);router[_0x7c2c('0x14')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x15')]);router[_0x7c2c('0x14')](_0x7c2c('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x7c2c('0x14')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller['addAgents']);router[_0x7c2c('0x16')](_0x7c2c('0xc'),auth['isAuthenticated'](),controller[_0x7c2c('0x17')]);router['delete'](_0x7c2c('0xc'),auth['isAuthenticated'](),controller[_0x7c2c('0x18')]);router[_0x7c2c('0x19')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1a')]);router[_0x7c2c('0x19')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1b')]);module[_0x7c2c('0x1c')]=router;
\ No newline at end of file
index 4f97735..efa597b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefc0=['sequelize','exports','STRING','DATE','moment'];(function(_0x2020ab,_0x21da97){var _0x2867ba=function(_0x399f38){while(--_0x399f38){_0x2020ab['push'](_0x2020ab['shift']());}};_0x2867ba(++_0x21da97);}(_0xefc0,0x18a));var _0x0efc=function(_0x50dbc4,_0x17b76f){_0x50dbc4=_0x50dbc4-0x0;var _0x5b8d7d=_0xefc0[_0x50dbc4];return _0x5b8d7d;};'use strict';var moment=require(_0x0efc('0x0'));var Sequelize=require(_0x0efc('0x1'));module[_0x0efc('0x2')]={'uniqueid':{'type':Sequelize[_0x0efc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0efc('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0efc('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0efc('0x4')]},'reason':{'type':Sequelize[_0x0efc('0x3')]}};
\ No newline at end of file
+var _0xc1bc=['sequelize','STRING','DATE','moment'];(function(_0x20a800,_0x1c96fc){var _0x3801f0=function(_0x134bbe){while(--_0x134bbe){_0x20a800['push'](_0x20a800['shift']());}};_0x3801f0(++_0x1c96fc);}(_0xc1bc,0x173));var _0xcc1b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc1bc[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xcc1b('0x0'));var Sequelize=require(_0xcc1b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xcc1b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcc1b('0x2')]},'joinAt':{'type':Sequelize[_0xcc1b('0x3')]},'leaveAt':{'type':Sequelize[_0xcc1b('0x3')]},'acceptAt':{'type':Sequelize[_0xcc1b('0x3')]},'exitAt':{'type':Sequelize[_0xcc1b('0x3')]},'reason':{'type':Sequelize[_0xcc1b('0x2')]}};
\ No newline at end of file
index 055fe1c..59b015f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3715=['reject','save','update','then','error','stack','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0xef7a6c,_0x5134b2){var _0x5d8d9c=function(_0x4f9508){while(--_0x4f9508){_0xef7a6c['push'](_0xef7a6c['shift']());}};_0x5d8d9c(++_0x5134b2);}(_0x3715,0xc3));var _0x5371=function(_0x5d4bc7,_0x419994){_0x5d4bc7=_0x5d4bc7-0x0;var _0x22a8a9=_0x3715[_0x5d4bc7];return _0x22a8a9;};'use strict';var emlformat=require(_0x5371('0x0'));var rimraf=require(_0x5371('0x1'));var zipdir=require(_0x5371('0x2'));var jsonpatch=require(_0x5371('0x3'));var rp=require(_0x5371('0x4'));var moment=require(_0x5371('0x5'));var BPromise=require(_0x5371('0x6'));var Mustache=require(_0x5371('0x7'));var util=require(_0x5371('0x8'));var path=require(_0x5371('0x9'));var sox=require(_0x5371('0xa'));var csv=require(_0x5371('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5371('0xc'));var _=require(_0x5371('0xd'));var squel=require('squel');var crypto=require(_0x5371('0xe'));var jsforce=require(_0x5371('0xf'));var deskjs=require(_0x5371('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5371('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5371('0x12'));var qs=require(_0x5371('0x13'));var as=require(_0x5371('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5371('0x15'))(_0x5371('0x16'));var utils=require(_0x5371('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5371('0x18'));var db=require(_0x5371('0x19'))['db'];function respondWithStatusCode(_0x1faac2,_0x1b0a8a){_0x1b0a8a=_0x1b0a8a||0xcc;return function(_0x5b4adf){if(_0x5b4adf){return _0x1faac2[_0x5371('0x1a')](_0x1b0a8a);}return _0x1faac2['status'](_0x1b0a8a)[_0x5371('0x1b')]();};}function respondWithResult(_0x777eaf,_0x4c8eb8){_0x4c8eb8=_0x4c8eb8||0xc8;return function(_0x4611dd){if(_0x4611dd){return _0x777eaf[_0x5371('0x1c')](_0x4c8eb8)[_0x5371('0x1d')](_0x4611dd);}};}function respondWithFilteredResult(_0x29bf5b,_0x178130){return function(_0x41d0c2){if(_0x41d0c2){var _0x33b592=typeof _0x178130['offset']===_0x5371('0x1e')&&typeof _0x178130[_0x5371('0x1f')]===_0x5371('0x1e');var _0x22dbcd=_0x41d0c2[_0x5371('0x20')];var _0x32f469=_0x33b592?0x0:_0x178130[_0x5371('0x21')];var _0x4855b3=_0x33b592?_0x41d0c2['count']:_0x178130[_0x5371('0x21')]+_0x178130['limit'];var _0x2579f9;if(_0x4855b3>=_0x22dbcd){_0x4855b3=_0x22dbcd;_0x2579f9=0xc8;}else{_0x2579f9=0xce;}_0x29bf5b['status'](_0x2579f9);return _0x29bf5b[_0x5371('0x22')](_0x5371('0x23'),_0x32f469+'-'+_0x4855b3+'/'+_0x22dbcd)['json'](_0x41d0c2);}return null;};}function patchUpdates(_0x470cd2){return function(_0x2c989c){try{jsonpatch['apply'](_0x2c989c,_0x470cd2,!![]);}catch(_0x3c2d4a){return BPromise[_0x5371('0x24')](_0x3c2d4a);}return _0x2c989c[_0x5371('0x25')]();};}function saveUpdates(_0x5eacf2,_0x4add7e){return function(_0x4d7dad){if(_0x4d7dad){return _0x4d7dad[_0x5371('0x26')](_0x5eacf2)[_0x5371('0x27')](function(_0x2a897e){return _0x2a897e;});}return null;};}function removeEntity(_0x2bae28,_0x1f0998){return function(_0xabe2a6){if(_0xabe2a6){return _0xabe2a6['destroy']()[_0x5371('0x27')](function(){_0x2bae28['status'](0xcc)[_0x5371('0x1b')]();});}};}function handleEntityNotFound(_0x522a53,_0xc02f21){return function(_0x427f20){if(!_0x427f20){_0x522a53['sendStatus'](0x194);}return _0x427f20;};}function handleError(_0x395aa9,_0x2a7a93){_0x2a7a93=_0x2a7a93||0x1f4;return function(_0x30d3c2){logger[_0x5371('0x28')](_0x30d3c2[_0x5371('0x29')]);if(_0x30d3c2['name']){delete _0x30d3c2['name'];}_0x395aa9[_0x5371('0x1c')](_0x2a7a93)['send'](_0x30d3c2);};}exports['index']=function(_0x2138e6,_0x167280){var _0x5a84c1={},_0x311021={},_0x32554f={'count':0x0,'rows':[]};var _0x1ea613=_[_0x5371('0x2a')](db[_0x5371('0x2b')][_0x5371('0x2c')],function(_0x1f60c3){return{'name':_0x1f60c3[_0x5371('0x2d')],'type':_0x1f60c3[_0x5371('0x2e')][_0x5371('0x2f')]};});_0x311021['model']=_[_0x5371('0x2a')](_0x1ea613,'name');_0x311021[_0x5371('0x30')]=_['keys'](_0x2138e6['query']);_0x311021[_0x5371('0x31')]=_[_0x5371('0x32')](_0x311021[_0x5371('0x33')],_0x311021[_0x5371('0x30')]);_0x5a84c1[_0x5371('0x34')]=_[_0x5371('0x32')](_0x311021['model'],qs[_0x5371('0x35')](_0x2138e6['query'][_0x5371('0x35')]));_0x5a84c1[_0x5371('0x34')]=_0x5a84c1[_0x5371('0x34')][_0x5371('0x36')]?_0x5a84c1[_0x5371('0x34')]:_0x311021[_0x5371('0x33')];if(!_0x2138e6[_0x5371('0x30')]['hasOwnProperty'](_0x5371('0x37'))){_0x5a84c1[_0x5371('0x1f')]=qs[_0x5371('0x1f')](_0x2138e6[_0x5371('0x30')][_0x5371('0x1f')]);_0x5a84c1[_0x5371('0x21')]=qs[_0x5371('0x21')](_0x2138e6['query'][_0x5371('0x21')]);}_0x5a84c1[_0x5371('0x38')]=qs['sort'](_0x2138e6[_0x5371('0x30')][_0x5371('0x39')]);_0x5a84c1[_0x5371('0x3a')]=qs[_0x5371('0x31')](_['pick'](_0x2138e6[_0x5371('0x30')],_0x311021[_0x5371('0x31')]),_0x1ea613);if(_0x2138e6['query'][_0x5371('0x3b')]){_0x5a84c1[_0x5371('0x3a')]=_[_0x5371('0x3c')](_0x5a84c1[_0x5371('0x3a')],{'$or':_[_0x5371('0x2a')](_0x1ea613,function(_0x131409){if(_0x131409[_0x5371('0x2e')]!==_0x5371('0x3d')){var _0x50e7e3={};_0x50e7e3[_0x131409[_0x5371('0x3e')]]={'$like':'%'+_0x2138e6[_0x5371('0x30')][_0x5371('0x3b')]+'%'};return _0x50e7e3;}})});}_0x5a84c1=_[_0x5371('0x3c')]({},_0x5a84c1,_0x2138e6['options']);var _0x175296={'where':_0x5a84c1[_0x5371('0x3a')]};return db[_0x5371('0x2b')][_0x5371('0x20')](_0x175296)[_0x5371('0x27')](function(_0x2b7859){_0x32554f['count']=_0x2b7859;if(_0x2138e6[_0x5371('0x30')][_0x5371('0x3f')]){_0x5a84c1[_0x5371('0x40')]=[{'all':!![]}];}return db[_0x5371('0x2b')][_0x5371('0x41')](_0x5a84c1);})[_0x5371('0x27')](function(_0x47f7fd){_0x32554f[_0x5371('0x42')]=_0x47f7fd;return _0x32554f;})[_0x5371('0x27')](respondWithFilteredResult(_0x167280,_0x5a84c1))[_0x5371('0x43')](handleError(_0x167280,null));};exports[_0x5371('0x44')]=function(_0x454985,_0x331087){var _0x4db26a={'raw':!![],'where':{'id':_0x454985['params']['id']}},_0x29d7ac={};_0x29d7ac['model']=_[_0x5371('0x45')](db['FaxQueueReport']['rawAttributes']);_0x29d7ac['query']=_[_0x5371('0x45')](_0x454985[_0x5371('0x30')]);_0x29d7ac[_0x5371('0x31')]=_['intersection'](_0x29d7ac[_0x5371('0x33')],_0x29d7ac[_0x5371('0x30')]);_0x4db26a['attributes']=_['intersection'](_0x29d7ac[_0x5371('0x33')],qs[_0x5371('0x35')](_0x454985[_0x5371('0x30')][_0x5371('0x35')]));_0x4db26a['attributes']=_0x4db26a['attributes']['length']?_0x4db26a['attributes']:_0x29d7ac['model'];if(_0x454985[_0x5371('0x30')]['includeAll']){_0x4db26a[_0x5371('0x40')]=[{'all':!![]}];}_0x4db26a=_['merge']({},_0x4db26a,_0x454985[_0x5371('0x46')]);return db[_0x5371('0x2b')][_0x5371('0x47')](_0x4db26a)[_0x5371('0x27')](handleEntityNotFound(_0x331087,null))['then'](respondWithResult(_0x331087,null))[_0x5371('0x43')](handleError(_0x331087,null));};exports[_0x5371('0x48')]=function(_0x5efa09,_0x389bb8){return db[_0x5371('0x2b')]['create'](_0x5efa09[_0x5371('0x49')],{})['then'](respondWithResult(_0x389bb8,0xc9))['catch'](handleError(_0x389bb8,null));};exports[_0x5371('0x26')]=function(_0x179163,_0x2daa6e){if(_0x179163[_0x5371('0x49')]['id']){delete _0x179163[_0x5371('0x49')]['id'];}return db[_0x5371('0x2b')][_0x5371('0x47')]({'where':{'id':_0x179163['params']['id']}})[_0x5371('0x27')](handleEntityNotFound(_0x2daa6e,null))[_0x5371('0x27')](saveUpdates(_0x179163[_0x5371('0x49')],null))['then'](respondWithResult(_0x2daa6e,null))['catch'](handleError(_0x2daa6e,null));};exports[_0x5371('0x4a')]=function(_0x334b29,_0x5e39d2){return db[_0x5371('0x2b')]['find']({'where':{'id':_0x334b29[_0x5371('0x4b')]['id']}})[_0x5371('0x27')](handleEntityNotFound(_0x5e39d2,null))[_0x5371('0x27')](removeEntity(_0x5e39d2,null))[_0x5371('0x43')](handleError(_0x5e39d2,null));};exports['describe']=function(_0x3c75b5,_0x4f9227){return db['FaxQueueReport'][_0x5371('0x4c')]()[_0x5371('0x27')](respondWithResult(_0x4f9227,null))[_0x5371('0x43')](handleError(_0x4f9227,null));};
\ No newline at end of file
+var _0x3189=['name','send','index','map','FaxQueueReport','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error'];(function(_0x28befd,_0x1eeb2b){var _0x1f46db=function(_0x1fdb1e){while(--_0x1fdb1e){_0x28befd['push'](_0x28befd['shift']());}};_0x1f46db(++_0x1eeb2b);}(_0x3189,0xae));var _0x9318=function(_0x3a7b43,_0x1d0b10){_0x3a7b43=_0x3a7b43-0x0;var _0x4414df=_0x3189[_0x3a7b43];return _0x4414df;};'use strict';var emlformat=require(_0x9318('0x0'));var rimraf=require(_0x9318('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9318('0x2'));var rp=require(_0x9318('0x3'));var moment=require(_0x9318('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9318('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9318('0x6'));var csv=require(_0x9318('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9318('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9318('0x9'));var jsforce=require(_0x9318('0xa'));var deskjs=require(_0x9318('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9318('0xc'));var Papa=require(_0x9318('0xd'));var Redis=require(_0x9318('0xe'));var authService=require(_0x9318('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9318('0x10'));var logger=require('../../config/logger')(_0x9318('0x11'));var utils=require(_0x9318('0x12'));var config=require(_0x9318('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9318('0x14'))['db'];function respondWithStatusCode(_0x5b63fe,_0x5133a4){_0x5133a4=_0x5133a4||0xcc;return function(_0x2ac258){if(_0x2ac258){return _0x5b63fe['sendStatus'](_0x5133a4);}return _0x5b63fe[_0x9318('0x15')](_0x5133a4)[_0x9318('0x16')]();};}function respondWithResult(_0x571d73,_0x258b56){_0x258b56=_0x258b56||0xc8;return function(_0xfe145c){if(_0xfe145c){return _0x571d73[_0x9318('0x15')](_0x258b56)['json'](_0xfe145c);}};}function respondWithFilteredResult(_0x4a5d09,_0x10d4f0){return function(_0x11b380){if(_0x11b380){var _0x4ee574=typeof _0x10d4f0[_0x9318('0x17')]===_0x9318('0x18')&&typeof _0x10d4f0['limit']===_0x9318('0x18');var _0x26c0d8=_0x11b380[_0x9318('0x19')];var _0xda93f2=_0x4ee574?0x0:_0x10d4f0[_0x9318('0x17')];var _0x19c253=_0x4ee574?_0x11b380[_0x9318('0x19')]:_0x10d4f0[_0x9318('0x17')]+_0x10d4f0['limit'];var _0x367300;if(_0x19c253>=_0x26c0d8){_0x19c253=_0x26c0d8;_0x367300=0xc8;}else{_0x367300=0xce;}_0x4a5d09[_0x9318('0x15')](_0x367300);return _0x4a5d09[_0x9318('0x1a')](_0x9318('0x1b'),_0xda93f2+'-'+_0x19c253+'/'+_0x26c0d8)[_0x9318('0x1c')](_0x11b380);}return null;};}function patchUpdates(_0xc122e9){return function(_0x59a34f){try{jsonpatch[_0x9318('0x1d')](_0x59a34f,_0xc122e9,!![]);}catch(_0x5219e4){return BPromise['reject'](_0x5219e4);}return _0x59a34f[_0x9318('0x1e')]();};}function saveUpdates(_0x317f9d,_0xa45304){return function(_0x2b3d31){if(_0x2b3d31){return _0x2b3d31[_0x9318('0x1f')](_0x317f9d)['then'](function(_0x46c7f2){return _0x46c7f2;});}return null;};}function removeEntity(_0x3d6205,_0x451694){return function(_0x33502a){if(_0x33502a){return _0x33502a[_0x9318('0x20')]()[_0x9318('0x21')](function(){_0x3d6205[_0x9318('0x15')](0xcc)[_0x9318('0x16')]();});}};}function handleEntityNotFound(_0x174e63,_0xaf8aec){return function(_0x30386c){if(!_0x30386c){_0x174e63[_0x9318('0x22')](0x194);}return _0x30386c;};}function handleError(_0x176ff0,_0x659998){_0x659998=_0x659998||0x1f4;return function(_0x35e85e){logger[_0x9318('0x23')](_0x35e85e['stack']);if(_0x35e85e[_0x9318('0x24')]){delete _0x35e85e[_0x9318('0x24')];}_0x176ff0['status'](_0x659998)[_0x9318('0x25')](_0x35e85e);};}exports[_0x9318('0x26')]=function(_0x177833,_0xf8bc76){var _0xf01d79={},_0x430f42={},_0x30b048={'count':0x0,'rows':[]};var _0x4c8dc6=_[_0x9318('0x27')](db[_0x9318('0x28')]['rawAttributes'],function(_0x3363ab){return{'name':_0x3363ab['fieldName'],'type':_0x3363ab[_0x9318('0x29')][_0x9318('0x2a')]};});_0x430f42['model']=_[_0x9318('0x27')](_0x4c8dc6,'name');_0x430f42[_0x9318('0x2b')]=_[_0x9318('0x2c')](_0x177833[_0x9318('0x2b')]);_0x430f42['filters']=_[_0x9318('0x2d')](_0x430f42[_0x9318('0x2e')],_0x430f42[_0x9318('0x2b')]);_0xf01d79[_0x9318('0x2f')]=_['intersection'](_0x430f42['model'],qs[_0x9318('0x30')](_0x177833['query'][_0x9318('0x30')]));_0xf01d79[_0x9318('0x2f')]=_0xf01d79['attributes'][_0x9318('0x31')]?_0xf01d79[_0x9318('0x2f')]:_0x430f42['model'];if(!_0x177833[_0x9318('0x2b')][_0x9318('0x32')]('nolimit')){_0xf01d79[_0x9318('0x33')]=qs[_0x9318('0x33')](_0x177833[_0x9318('0x2b')][_0x9318('0x33')]);_0xf01d79[_0x9318('0x17')]=qs[_0x9318('0x17')](_0x177833[_0x9318('0x2b')][_0x9318('0x17')]);}_0xf01d79[_0x9318('0x34')]=qs['sort'](_0x177833['query'][_0x9318('0x35')]);_0xf01d79[_0x9318('0x36')]=qs[_0x9318('0x37')](_[_0x9318('0x38')](_0x177833[_0x9318('0x2b')],_0x430f42[_0x9318('0x37')]),_0x4c8dc6);if(_0x177833[_0x9318('0x2b')][_0x9318('0x39')]){_0xf01d79[_0x9318('0x36')]=_[_0x9318('0x3a')](_0xf01d79['where'],{'$or':_['map'](_0x4c8dc6,function(_0x20c1e5){if(_0x20c1e5['type']!=='VIRTUAL'){var _0x120256={};_0x120256[_0x20c1e5[_0x9318('0x24')]]={'$like':'%'+_0x177833[_0x9318('0x2b')][_0x9318('0x39')]+'%'};return _0x120256;}})});}_0xf01d79=_[_0x9318('0x3a')]({},_0xf01d79,_0x177833[_0x9318('0x3b')]);var _0x57c625={'where':_0xf01d79[_0x9318('0x36')]};return db[_0x9318('0x28')][_0x9318('0x19')](_0x57c625)[_0x9318('0x21')](function(_0x4b1a52){_0x30b048[_0x9318('0x19')]=_0x4b1a52;if(_0x177833[_0x9318('0x2b')][_0x9318('0x3c')]){_0xf01d79[_0x9318('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xf01d79);})[_0x9318('0x21')](function(_0x45ef71){_0x30b048['rows']=_0x45ef71;return _0x30b048;})[_0x9318('0x21')](respondWithFilteredResult(_0xf8bc76,_0xf01d79))[_0x9318('0x3e')](handleError(_0xf8bc76,null));};exports[_0x9318('0x3f')]=function(_0x59335f,_0x94a111){var _0x205f06={'raw':!![],'where':{'id':_0x59335f[_0x9318('0x40')]['id']}},_0x28d505={};_0x28d505['model']=_[_0x9318('0x2c')](db['FaxQueueReport'][_0x9318('0x41')]);_0x28d505[_0x9318('0x2b')]=_[_0x9318('0x2c')](_0x59335f[_0x9318('0x2b')]);_0x28d505[_0x9318('0x37')]=_[_0x9318('0x2d')](_0x28d505['model'],_0x28d505[_0x9318('0x2b')]);_0x205f06['attributes']=_[_0x9318('0x2d')](_0x28d505[_0x9318('0x2e')],qs['fields'](_0x59335f['query']['fields']));_0x205f06[_0x9318('0x2f')]=_0x205f06[_0x9318('0x2f')][_0x9318('0x31')]?_0x205f06[_0x9318('0x2f')]:_0x28d505[_0x9318('0x2e')];if(_0x59335f[_0x9318('0x2b')][_0x9318('0x3c')]){_0x205f06[_0x9318('0x3d')]=[{'all':!![]}];}_0x205f06=_[_0x9318('0x3a')]({},_0x205f06,_0x59335f[_0x9318('0x3b')]);return db['FaxQueueReport'][_0x9318('0x42')](_0x205f06)[_0x9318('0x21')](handleEntityNotFound(_0x94a111,null))[_0x9318('0x21')](respondWithResult(_0x94a111,null))[_0x9318('0x3e')](handleError(_0x94a111,null));};exports[_0x9318('0x43')]=function(_0x426c1c,_0x5eec25){return db[_0x9318('0x28')]['create'](_0x426c1c[_0x9318('0x44')],{})[_0x9318('0x21')](respondWithResult(_0x5eec25,0xc9))[_0x9318('0x3e')](handleError(_0x5eec25,null));};exports['update']=function(_0x47b00b,_0x4ce675){if(_0x47b00b[_0x9318('0x44')]['id']){delete _0x47b00b[_0x9318('0x44')]['id'];}return db[_0x9318('0x28')][_0x9318('0x42')]({'where':{'id':_0x47b00b[_0x9318('0x40')]['id']}})[_0x9318('0x21')](handleEntityNotFound(_0x4ce675,null))[_0x9318('0x21')](saveUpdates(_0x47b00b['body'],null))[_0x9318('0x21')](respondWithResult(_0x4ce675,null))[_0x9318('0x3e')](handleError(_0x4ce675,null));};exports['destroy']=function(_0x5a7d2a,_0x1d8e80){return db[_0x9318('0x28')][_0x9318('0x42')]({'where':{'id':_0x5a7d2a[_0x9318('0x40')]['id']}})[_0x9318('0x21')](handleEntityNotFound(_0x1d8e80,null))[_0x9318('0x21')](removeEntity(_0x1d8e80,null))[_0x9318('0x3e')](handleError(_0x1d8e80,null));};exports[_0x9318('0x45')]=function(_0x54e8d2,_0x2c7eca){return db[_0x9318('0x28')][_0x9318('0x45')]()[_0x9318('0x21')](respondWithResult(_0x2c7eca,null))[_0x9318('0x3e')](handleError(_0x2c7eca,null));};
\ No newline at end of file
index 7ff6bb2..d127106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x6a07e6,_0x35c0bd){var _0x2e717a=function(_0x1f0f1c){while(--_0x1f0f1c){_0x6a07e6['push'](_0x6a07e6['shift']());}};_0x2e717a(++_0x35c0bd);}(_0x326f,0xd1));var _0xf326=function(_0x23c0ee,_0x48ccd3){_0x23c0ee=_0x23c0ee-0x0;var _0x3f49d3=_0x326f[_0x23c0ee];return _0x3f49d3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x127bf2,_0x24f20e){var _0x36ab07=function(_0x3a2030){while(--_0x3a2030){_0x127bf2['push'](_0x127bf2['shift']());}};_0x36ab07(++_0x24f20e);}(_0xf494,0x1c6));var _0x4f49=function(_0x5f0db6,_0x4e871f){_0x5f0db6=_0x5f0db6-0x0;var _0x1917b4=_0xf494[_0x5f0db6];return _0x1917b4;};'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 09f7f9c..c3fb32f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1081=['FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','FaxQueueReport','create','body','options','then','CreateFaxQueueReport','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug'];(function(_0x107d53,_0x227f1c){var _0x2d96fc=function(_0x385745){while(--_0x385745){_0x107d53['push'](_0x107d53['shift']());}};_0x2d96fc(++_0x227f1c);}(_0x1081,0x1be));var _0x1108=function(_0x4ff9e3,_0x2f9cb7){_0x4ff9e3=_0x4ff9e3-0x0;var _0x5f41f2=_0x1081[_0x4ff9e3];return _0x5f41f2;};'use strict';var _=require(_0x1108('0x0'));var util=require(_0x1108('0x1'));var moment=require(_0x1108('0x2'));var BPromise=require(_0x1108('0x3'));var rs=require(_0x1108('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1108('0x5'))['db'];var utils=require(_0x1108('0x6'));var logger=require(_0x1108('0x7'))(_0x1108('0x8'));var config=require(_0x1108('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1108('0xa')][_0x1108('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x588c0a,_0x18a3a8,_0x284f9a){return new BPromise(function(_0x4c88ff,_0x3e6f14){return client[_0x1108('0xc')](_0x588c0a,_0x284f9a)['then'](function(_0x52404a){logger[_0x1108('0xd')](_0x1108('0xe'),_0x18a3a8,'request\x20sent');logger[_0x1108('0xf')](_0x1108('0x10'),_0x18a3a8,_0x1108('0x11'),JSON[_0x1108('0x12')](_0x52404a));if(_0x52404a['error']){if(_0x52404a[_0x1108('0x13')]['code']===0x1f4){logger[_0x1108('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x18a3a8,_0x52404a[_0x1108('0x13')][_0x1108('0x14')]);return _0x3e6f14(_0x52404a['error'][_0x1108('0x14')]);}logger['error'](_0x1108('0xe'),_0x18a3a8,_0x52404a[_0x1108('0x13')][_0x1108('0x14')]);return _0x4c88ff(_0x52404a[_0x1108('0x13')]['message']);}else{logger['info'](_0x1108('0xe'),_0x18a3a8,_0x1108('0x11'));_0x4c88ff(_0x52404a['result'][_0x1108('0x14')]);}})[_0x1108('0x15')](function(_0x3a225c){logger[_0x1108('0x13')](_0x1108('0xe'),_0x18a3a8,_0x3a225c);_0x3e6f14(_0x3a225c);});});}exports['CreateFaxQueueReport']=function(_0x54d19f){var _0xb9e088=this;return new Promise(function(_0x317f68,_0x1a4027){return db[_0x1108('0x16')][_0x1108('0x17')](_0x54d19f[_0x1108('0x18')],{'raw':_0x54d19f[_0x1108('0x19')]?_0x54d19f[_0x1108('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x1108('0x1a')](function(_0x32ec6c){logger['info'](_0x1108('0x1b'),_0x54d19f);logger[_0x1108('0xf')](_0x1108('0x1b'),_0x54d19f,JSON['stringify'](_0x32ec6c));_0x317f68(_0x32ec6c);})[_0x1108('0x15')](function(_0x412878){logger[_0x1108('0x13')](_0x1108('0x1b'),_0x412878['message'],_0x54d19f);_0x1a4027(_0xb9e088['error'](0x1f4,_0x412878[_0x1108('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x526d67){var _0x42cfad=this;return new Promise(function(_0x3fdc84,_0x147818){return db[_0x1108('0x16')]['update'](_0x526d67[_0x1108('0x18')],{'raw':_0x526d67['options']?_0x526d67['options'][_0x1108('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x526d67[_0x1108('0x19')]?_0x526d67[_0x1108('0x19')][_0x1108('0x1d')]||null:null,'attributes':_0x526d67[_0x1108('0x19')]?_0x526d67[_0x1108('0x19')][_0x1108('0x1e')]||null:null,'limit':_0x526d67['options']?_0x526d67[_0x1108('0x19')][_0x1108('0x1f')]||null:null})[_0x1108('0x1a')](function(_0x52e462){logger[_0x1108('0xd')](_0x1108('0x20'),_0x526d67);logger['debug'](_0x1108('0x20'),_0x526d67,JSON[_0x1108('0x12')](_0x52e462));_0x3fdc84(_0x52e462);})[_0x1108('0x15')](function(_0x48a1f7){logger[_0x1108('0x13')](_0x1108('0x20'),_0x48a1f7[_0x1108('0x14')],_0x526d67);_0x147818(_0x42cfad[_0x1108('0x13')](0x1f4,_0x48a1f7[_0x1108('0x14')]));});});};
\ No newline at end of file
+var _0x8319=['raw','where','limit','UpdateFaxQueueReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','FaxQueueReport','create','body','options','info','stringify','CreateFaxQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8319,0x1bf));var _0x9831=function(_0x3f20a5,_0x3c5ff6){_0x3f20a5=_0x3f20a5-0x0;var _0x4aeb2e=_0x8319[_0x3f20a5];return _0x4aeb2e;};'use strict';var _=require(_0x9831('0x0'));var util=require(_0x9831('0x1'));var moment=require(_0x9831('0x2'));var BPromise=require(_0x9831('0x3'));var rs=require(_0x9831('0x4'));var fs=require('fs');var Redis=require(_0x9831('0x5'));var db=require(_0x9831('0x6'))['db'];var utils=require(_0x9831('0x7'));var logger=require(_0x9831('0x8'))(_0x9831('0x9'));var config=require(_0x9831('0xa'));var jayson=require(_0x9831('0xb'));var client=jayson[_0x9831('0xc')][_0x9831('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x27061b,_0x4960c2,_0xeeb291){return new BPromise(function(_0x2ae167,_0x4cec76){return client[_0x9831('0xe')](_0x27061b,_0xeeb291)[_0x9831('0xf')](function(_0x5738af){logger['info'](_0x9831('0x10'),_0x4960c2,_0x9831('0x11'));logger[_0x9831('0x12')](_0x9831('0x13'),_0x4960c2,_0x9831('0x11'),JSON['stringify'](_0x5738af));if(_0x5738af[_0x9831('0x14')]){if(_0x5738af[_0x9831('0x14')]['code']===0x1f4){logger[_0x9831('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x4960c2,_0x5738af[_0x9831('0x14')][_0x9831('0x15')]);return _0x4cec76(_0x5738af[_0x9831('0x14')][_0x9831('0x15')]);}logger[_0x9831('0x14')](_0x9831('0x10'),_0x4960c2,_0x5738af[_0x9831('0x14')][_0x9831('0x15')]);return _0x2ae167(_0x5738af[_0x9831('0x14')]['message']);}else{logger['info'](_0x9831('0x10'),_0x4960c2,_0x9831('0x11'));_0x2ae167(_0x5738af['result']['message']);}})['catch'](function(_0x2038d5){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x4960c2,_0x2038d5);_0x4cec76(_0x2038d5);});});}exports['CreateFaxQueueReport']=function(_0x2e0ec0){var _0x2b4f3e=this;return new Promise(function(_0x35c1a1,_0x78fd3c){return db[_0x9831('0x16')][_0x9831('0x17')](_0x2e0ec0[_0x9831('0x18')],{'raw':_0x2e0ec0[_0x9831('0x19')]?_0x2e0ec0[_0x9831('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2ea50c){logger[_0x9831('0x1a')]('CreateFaxQueueReport',_0x2e0ec0);logger['debug']('CreateFaxQueueReport',_0x2e0ec0,JSON[_0x9831('0x1b')](_0x2ea50c));_0x35c1a1(_0x2ea50c);})['catch'](function(_0x257eb1){logger['error'](_0x9831('0x1c'),_0x257eb1[_0x9831('0x15')],_0x2e0ec0);_0x78fd3c(_0x2b4f3e[_0x9831('0x14')](0x1f4,_0x257eb1['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1f0df0){var _0x3af86c=this;return new Promise(function(_0x17010b,_0x1e509f){return db[_0x9831('0x16')]['update'](_0x1f0df0[_0x9831('0x18')],{'raw':_0x1f0df0[_0x9831('0x19')]?_0x1f0df0[_0x9831('0x19')][_0x9831('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f0df0[_0x9831('0x19')]?_0x1f0df0[_0x9831('0x19')][_0x9831('0x1e')]||null:null,'attributes':_0x1f0df0[_0x9831('0x19')]?_0x1f0df0[_0x9831('0x19')]['attributes']||null:null,'limit':_0x1f0df0['options']?_0x1f0df0[_0x9831('0x19')][_0x9831('0x1f')]||null:null})[_0x9831('0xf')](function(_0x258f14){logger['info'](_0x9831('0x20'),_0x1f0df0);logger['debug']('UpdateFaxQueueReport',_0x1f0df0,JSON[_0x9831('0x1b')](_0x258f14));_0x17010b(_0x258f14);})[_0x9831('0x21')](function(_0x3864b6){logger[_0x9831('0x14')](_0x9831('0x20'),_0x3864b6[_0x9831('0x15')],_0x1f0df0);_0x1e509f(_0x3af86c[_0x9831('0x14')](0x1f4,_0x3864b6[_0x9831('0x15')]));});});};
\ No newline at end of file
index 46e6748..df601a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cda=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x20b822,_0x4affe3){var _0x3cd815=function(_0x3c961b){while(--_0x3c961b){_0x20b822['push'](_0x20b822['shift']());}};_0x3cd815(++_0x4affe3);}(_0x2cda,0x71));var _0xa2cd=function(_0x76c0b3,_0x29c9e0){_0x76c0b3=_0x76c0b3-0x0;var _0x365703=_0x2cda[_0x76c0b3];return _0x365703;};'use strict';var multer=require(_0xa2cd('0x0'));var util=require('util');var path=require(_0xa2cd('0x1'));var timeout=require(_0xa2cd('0x2'));var express=require('express');var router=express[_0xa2cd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2cd('0x4'));var config=require(_0xa2cd('0x5'));var controller=require('./faxQueueReport.controller');router[_0xa2cd('0x6')]('/',auth[_0xa2cd('0x7')](),controller[_0xa2cd('0x8')]);router[_0xa2cd('0x6')](_0xa2cd('0x9'),auth[_0xa2cd('0x7')](),controller['describe']);router[_0xa2cd('0x6')](_0xa2cd('0xa'),auth['isAuthenticated'](),controller[_0xa2cd('0xb')]);router[_0xa2cd('0xc')]('/',auth['isAuthenticated'](),controller[_0xa2cd('0xd')]);router[_0xa2cd('0xe')](_0xa2cd('0xa'),auth[_0xa2cd('0x7')](),controller[_0xa2cd('0xf')]);router['delete'](_0xa2cd('0xa'),auth[_0xa2cd('0x7')](),controller[_0xa2cd('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xdba2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xd553ea,_0x5b014d){var _0x5c0ab4=function(_0x3d69d3){while(--_0x3d69d3){_0xd553ea['push'](_0xd553ea['shift']());}};_0x5c0ab4(++_0x5b014d);}(_0xdba2,0x9b));var _0x2dba=function(_0x33ce48,_0x57682b){_0x33ce48=_0x33ce48-0x0;var _0x500f53=_0xdba2[_0x33ce48];return _0x500f53;};'use strict';var multer=require(_0x2dba('0x0'));var util=require('util');var path=require(_0x2dba('0x1'));var timeout=require(_0x2dba('0x2'));var express=require(_0x2dba('0x3'));var router=express[_0x2dba('0x4')]();var fs_extra=require(_0x2dba('0x5'));var auth=require(_0x2dba('0x6'));var interaction=require(_0x2dba('0x7'));var config=require(_0x2dba('0x8'));var controller=require(_0x2dba('0x9'));router[_0x2dba('0xa')]('/',auth[_0x2dba('0xb')](),controller[_0x2dba('0xc')]);router[_0x2dba('0xa')](_0x2dba('0xd'),auth[_0x2dba('0xb')](),controller[_0x2dba('0xe')]);router[_0x2dba('0xa')]('/:id',auth[_0x2dba('0xb')](),controller[_0x2dba('0xf')]);router[_0x2dba('0x10')]('/',auth['isAuthenticated'](),controller[_0x2dba('0x11')]);router['put']('/:id',auth[_0x2dba('0xb')](),controller[_0x2dba('0x12')]);router[_0x2dba('0x13')](_0x2dba('0x14'),auth['isAuthenticated'](),controller[_0x2dba('0x15')]);module[_0x2dba('0x16')]=router;
\ No newline at end of file
index 556af3e..a62df59 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(_0x489e52,_0x5529b9){var _0xcd1cf3=function(_0x41bd18){while(--_0x41bd18){_0x489e52['push'](_0x489e52['shift']());}};_0xcd1cf3(++_0x5529b9);}(_0xe706,0xa3));var _0x6e70=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe706[_0x2b7764];return _0x848dcb;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5bb51c,_0x58b915){var _0x3dcb57=function(_0x5666d4){while(--_0x5666d4){_0x5bb51c['push'](_0x5bb51c['shift']());}};_0x3dcb57(++_0x58b915);}(_0xaa88,0x137));var _0x8aa8=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0xaa88[_0x56a061];return _0x105fa0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index 52efa92..b2e83a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcebe=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','end','name','send','index','map','FaxTransferReport','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x311bd0,_0x545a44){var _0x5699c3=function(_0x3a2c73){while(--_0x3a2c73){_0x311bd0['push'](_0x311bd0['shift']());}};_0x5699c3(++_0x545a44);}(_0xcebe,0xdb));var _0xeceb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcebe[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xeceb('0x0'));var rimraf=require(_0xeceb('0x1'));var zipdir=require(_0xeceb('0x2'));var jsonpatch=require(_0xeceb('0x3'));var rp=require(_0xeceb('0x4'));var moment=require(_0xeceb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeceb('0x6'));var util=require('util');var path=require(_0xeceb('0x7'));var sox=require(_0xeceb('0x8'));var csv=require(_0xeceb('0x9'));var ejs=require(_0xeceb('0xa'));var fs=require('fs');var fs_extra=require(_0xeceb('0xb'));var _=require(_0xeceb('0xc'));var squel=require(_0xeceb('0xd'));var crypto=require(_0xeceb('0xe'));var jsforce=require(_0xeceb('0xf'));var deskjs=require(_0xeceb('0x10'));var toCsv=require(_0xeceb('0x9'));var querystring=require(_0xeceb('0x11'));var Papa=require(_0xeceb('0x12'));var Redis=require(_0xeceb('0x13'));var authService=require(_0xeceb('0x14'));var qs=require(_0xeceb('0x15'));var as=require(_0xeceb('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeceb('0x17'))(_0xeceb('0x18'));var utils=require(_0xeceb('0x19'));var config=require(_0xeceb('0x1a'));var licenseUtil=require(_0xeceb('0x1b'));var db=require(_0xeceb('0x1c'))['db'];function respondWithStatusCode(_0x5b11cf,_0x4323a2){_0x4323a2=_0x4323a2||0xcc;return function(_0x35481f){if(_0x35481f){return _0x5b11cf[_0xeceb('0x1d')](_0x4323a2);}return _0x5b11cf[_0xeceb('0x1e')](_0x4323a2)['end']();};}function respondWithResult(_0xd52ee2,_0x77ba85){_0x77ba85=_0x77ba85||0xc8;return function(_0x4b2f6b){if(_0x4b2f6b){return _0xd52ee2[_0xeceb('0x1e')](_0x77ba85)[_0xeceb('0x1f')](_0x4b2f6b);}};}function respondWithFilteredResult(_0x559800,_0x3d6e13){return function(_0x3015d1){if(_0x3015d1){var _0x2739a7=typeof _0x3d6e13['offset']==='undefined'&&typeof _0x3d6e13[_0xeceb('0x20')]===_0xeceb('0x21');var _0x2b4064=_0x3015d1[_0xeceb('0x22')];var _0x205cf1=_0x2739a7?0x0:_0x3d6e13['offset'];var _0x4d6ab3=_0x2739a7?_0x3015d1[_0xeceb('0x22')]:_0x3d6e13[_0xeceb('0x23')]+_0x3d6e13[_0xeceb('0x20')];var _0x1faafb;if(_0x4d6ab3>=_0x2b4064){_0x4d6ab3=_0x2b4064;_0x1faafb=0xc8;}else{_0x1faafb=0xce;}_0x559800[_0xeceb('0x1e')](_0x1faafb);return _0x559800[_0xeceb('0x24')](_0xeceb('0x25'),_0x205cf1+'-'+_0x4d6ab3+'/'+_0x2b4064)['json'](_0x3015d1);}return null;};}function patchUpdates(_0x15115e){return function(_0x5a5d36){try{jsonpatch['apply'](_0x5a5d36,_0x15115e,!![]);}catch(_0x38e039){return BPromise[_0xeceb('0x26')](_0x38e039);}return _0x5a5d36[_0xeceb('0x27')]();};}function saveUpdates(_0x135ca8,_0x147c10){return function(_0x34f3e0){if(_0x34f3e0){return _0x34f3e0['update'](_0x135ca8)['then'](function(_0xbe09ba){return _0xbe09ba;});}return null;};}function removeEntity(_0x2b0f40,_0x25e7da){return function(_0x3753c3){if(_0x3753c3){return _0x3753c3[_0xeceb('0x28')]()[_0xeceb('0x29')](function(){_0x2b0f40['status'](0xcc)[_0xeceb('0x2a')]();});}};}function handleEntityNotFound(_0x26e0f7,_0x42e543){return function(_0x20025f){if(!_0x20025f){_0x26e0f7[_0xeceb('0x1d')](0x194);}return _0x20025f;};}function handleError(_0x43859c,_0x3f676a){_0x3f676a=_0x3f676a||0x1f4;return function(_0x31ebbe){logger['error'](_0x31ebbe['stack']);if(_0x31ebbe[_0xeceb('0x2b')]){delete _0x31ebbe[_0xeceb('0x2b')];}_0x43859c[_0xeceb('0x1e')](_0x3f676a)[_0xeceb('0x2c')](_0x31ebbe);};}exports[_0xeceb('0x2d')]=function(_0x31d82c,_0x101d68){var _0x2ec17f={},_0x19e457={},_0x4e876a={'count':0x0,'rows':[]};var _0x27f968=_[_0xeceb('0x2e')](db[_0xeceb('0x2f')]['rawAttributes'],function(_0x41e6ff){return{'name':_0x41e6ff['fieldName'],'type':_0x41e6ff[_0xeceb('0x30')][_0xeceb('0x31')]};});_0x19e457[_0xeceb('0x32')]=_[_0xeceb('0x2e')](_0x27f968,_0xeceb('0x2b'));_0x19e457['query']=_[_0xeceb('0x33')](_0x31d82c[_0xeceb('0x34')]);_0x19e457['filters']=_[_0xeceb('0x35')](_0x19e457[_0xeceb('0x32')],_0x19e457[_0xeceb('0x34')]);_0x2ec17f[_0xeceb('0x36')]=_['intersection'](_0x19e457[_0xeceb('0x32')],qs[_0xeceb('0x37')](_0x31d82c[_0xeceb('0x34')][_0xeceb('0x37')]));_0x2ec17f[_0xeceb('0x36')]=_0x2ec17f[_0xeceb('0x36')][_0xeceb('0x38')]?_0x2ec17f[_0xeceb('0x36')]:_0x19e457['model'];if(!_0x31d82c['query']['hasOwnProperty'](_0xeceb('0x39'))){_0x2ec17f[_0xeceb('0x20')]=qs[_0xeceb('0x20')](_0x31d82c['query'][_0xeceb('0x20')]);_0x2ec17f[_0xeceb('0x23')]=qs['offset'](_0x31d82c[_0xeceb('0x34')]['offset']);}_0x2ec17f['order']=qs[_0xeceb('0x3a')](_0x31d82c[_0xeceb('0x34')][_0xeceb('0x3a')]);_0x2ec17f[_0xeceb('0x3b')]=qs['filters'](_[_0xeceb('0x3c')](_0x31d82c['query'],_0x19e457['filters']),_0x27f968);if(_0x31d82c[_0xeceb('0x34')][_0xeceb('0x3d')]){_0x2ec17f[_0xeceb('0x3b')]=_[_0xeceb('0x3e')](_0x2ec17f[_0xeceb('0x3b')],{'$or':_[_0xeceb('0x2e')](_0x27f968,function(_0x325245){if(_0x325245['type']!==_0xeceb('0x3f')){var _0x1b7b28={};_0x1b7b28[_0x325245['name']]={'$like':'%'+_0x31d82c['query'][_0xeceb('0x3d')]+'%'};return _0x1b7b28;}})});}_0x2ec17f=_['merge']({},_0x2ec17f,_0x31d82c[_0xeceb('0x40')]);var _0x1c8b2c={'where':_0x2ec17f[_0xeceb('0x3b')]};return db[_0xeceb('0x2f')][_0xeceb('0x22')](_0x1c8b2c)['then'](function(_0x55a6de){_0x4e876a[_0xeceb('0x22')]=_0x55a6de;if(_0x31d82c['query'][_0xeceb('0x41')]){_0x2ec17f[_0xeceb('0x42')]=[{'all':!![]}];}return db[_0xeceb('0x2f')][_0xeceb('0x43')](_0x2ec17f);})['then'](function(_0x1562ce){_0x4e876a['rows']=_0x1562ce;return _0x4e876a;})[_0xeceb('0x29')](respondWithFilteredResult(_0x101d68,_0x2ec17f))[_0xeceb('0x44')](handleError(_0x101d68,null));};exports[_0xeceb('0x45')]=function(_0x38d5bd,_0x231dea){var _0x2f7d2a={'raw':!![],'where':{'id':_0x38d5bd[_0xeceb('0x46')]['id']}},_0x9687b6={};_0x9687b6[_0xeceb('0x32')]=_['keys'](db['FaxTransferReport'][_0xeceb('0x47')]);_0x9687b6[_0xeceb('0x34')]=_['keys'](_0x38d5bd['query']);_0x9687b6['filters']=_[_0xeceb('0x35')](_0x9687b6[_0xeceb('0x32')],_0x9687b6[_0xeceb('0x34')]);_0x2f7d2a[_0xeceb('0x36')]=_['intersection'](_0x9687b6[_0xeceb('0x32')],qs['fields'](_0x38d5bd[_0xeceb('0x34')][_0xeceb('0x37')]));_0x2f7d2a['attributes']=_0x2f7d2a[_0xeceb('0x36')][_0xeceb('0x38')]?_0x2f7d2a[_0xeceb('0x36')]:_0x9687b6[_0xeceb('0x32')];if(_0x38d5bd[_0xeceb('0x34')][_0xeceb('0x41')]){_0x2f7d2a[_0xeceb('0x42')]=[{'all':!![]}];}_0x2f7d2a=_[_0xeceb('0x3e')]({},_0x2f7d2a,_0x38d5bd[_0xeceb('0x40')]);return db[_0xeceb('0x2f')][_0xeceb('0x48')](_0x2f7d2a)['then'](handleEntityNotFound(_0x231dea,null))[_0xeceb('0x29')](respondWithResult(_0x231dea,null))[_0xeceb('0x44')](handleError(_0x231dea,null));};exports[_0xeceb('0x49')]=function(_0x1568e4,_0x15b8e9){return db['FaxTransferReport'][_0xeceb('0x49')](_0x1568e4[_0xeceb('0x4a')],{})[_0xeceb('0x29')](respondWithResult(_0x15b8e9,0xc9))[_0xeceb('0x44')](handleError(_0x15b8e9,null));};exports[_0xeceb('0x4b')]=function(_0x41c610,_0x4188c4){if(_0x41c610[_0xeceb('0x4a')]['id']){delete _0x41c610[_0xeceb('0x4a')]['id'];}return db[_0xeceb('0x2f')][_0xeceb('0x48')]({'where':{'id':_0x41c610['params']['id']}})[_0xeceb('0x29')](handleEntityNotFound(_0x4188c4,null))[_0xeceb('0x29')](saveUpdates(_0x41c610['body'],null))[_0xeceb('0x29')](respondWithResult(_0x4188c4,null))[_0xeceb('0x44')](handleError(_0x4188c4,null));};exports[_0xeceb('0x28')]=function(_0x4c3733,_0x593320){return db[_0xeceb('0x2f')][_0xeceb('0x48')]({'where':{'id':_0x4c3733['params']['id']}})['then'](handleEntityNotFound(_0x593320,null))[_0xeceb('0x29')](removeEntity(_0x593320,null))[_0xeceb('0x44')](handleError(_0x593320,null));};exports[_0xeceb('0x4c')]=function(_0xacb78c,_0x34f27d){return db['FaxTransferReport'][_0xeceb('0x4c')]()[_0xeceb('0x29')](respondWithResult(_0x34f27d,null))[_0xeceb('0x44')](handleError(_0x34f27d,null));};
\ No newline at end of file
+var _0x4240=['key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','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','undefined','limit','count','set','apply','save','update','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes'];(function(_0x4d0899,_0x320113){var _0x241d62=function(_0x316efc){while(--_0x316efc){_0x4d0899['push'](_0x4d0899['shift']());}};_0x241d62(++_0x320113);}(_0x4240,0x188));var _0x0424=function(_0xebc2cb,_0x3dae2b){_0xebc2cb=_0xebc2cb-0x0;var _0x34ae49=_0x4240[_0xebc2cb];return _0x34ae49;};'use strict';var emlformat=require(_0x0424('0x0'));var rimraf=require(_0x0424('0x1'));var zipdir=require(_0x0424('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0424('0x3'));var moment=require(_0x0424('0x4'));var BPromise=require(_0x0424('0x5'));var Mustache=require(_0x0424('0x6'));var util=require(_0x0424('0x7'));var path=require(_0x0424('0x8'));var sox=require(_0x0424('0x9'));var csv=require(_0x0424('0xa'));var ejs=require(_0x0424('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0424('0xc'));var squel=require(_0x0424('0xd'));var crypto=require('crypto');var jsforce=require(_0x0424('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0424('0xa'));var querystring=require('querystring');var Papa=require(_0x0424('0xf'));var Redis=require(_0x0424('0x10'));var authService=require(_0x0424('0x11'));var qs=require(_0x0424('0x12'));var as=require(_0x0424('0x13'));var hardwareService=require(_0x0424('0x14'));var logger=require(_0x0424('0x15'))(_0x0424('0x16'));var utils=require(_0x0424('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0424('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45fb88,_0x3230f1){_0x3230f1=_0x3230f1||0xcc;return function(_0x5e9f32){if(_0x5e9f32){return _0x45fb88[_0x0424('0x19')](_0x3230f1);}return _0x45fb88[_0x0424('0x1a')](_0x3230f1)[_0x0424('0x1b')]();};}function respondWithResult(_0x2d9283,_0xb72540){_0xb72540=_0xb72540||0xc8;return function(_0x3eefc4){if(_0x3eefc4){return _0x2d9283[_0x0424('0x1a')](_0xb72540)[_0x0424('0x1c')](_0x3eefc4);}};}function respondWithFilteredResult(_0x576e9c,_0x40360c){return function(_0x266b20){if(_0x266b20){var _0xbf5247=typeof _0x40360c[_0x0424('0x1d')]===_0x0424('0x1e')&&typeof _0x40360c[_0x0424('0x1f')]===_0x0424('0x1e');var _0x1495a9=_0x266b20[_0x0424('0x20')];var _0x5a020c=_0xbf5247?0x0:_0x40360c[_0x0424('0x1d')];var _0x637dd4=_0xbf5247?_0x266b20[_0x0424('0x20')]:_0x40360c[_0x0424('0x1d')]+_0x40360c[_0x0424('0x1f')];var _0x287ab7;if(_0x637dd4>=_0x1495a9){_0x637dd4=_0x1495a9;_0x287ab7=0xc8;}else{_0x287ab7=0xce;}_0x576e9c['status'](_0x287ab7);return _0x576e9c[_0x0424('0x21')]('Content-Range',_0x5a020c+'-'+_0x637dd4+'/'+_0x1495a9)[_0x0424('0x1c')](_0x266b20);}return null;};}function patchUpdates(_0x149628){return function(_0x116b4f){try{jsonpatch[_0x0424('0x22')](_0x116b4f,_0x149628,!![]);}catch(_0x19cb95){return BPromise['reject'](_0x19cb95);}return _0x116b4f[_0x0424('0x23')]();};}function saveUpdates(_0x1ad1e5,_0x13cc79){return function(_0x203a46){if(_0x203a46){return _0x203a46[_0x0424('0x24')](_0x1ad1e5)['then'](function(_0x44d1ab){return _0x44d1ab;});}return null;};}function removeEntity(_0x3264e6,_0x5e2774){return function(_0x2a0cd7){if(_0x2a0cd7){return _0x2a0cd7[_0x0424('0x25')]()['then'](function(){_0x3264e6[_0x0424('0x1a')](0xcc)[_0x0424('0x1b')]();});}};}function handleEntityNotFound(_0x4a5176,_0x21eefc){return function(_0x53156e){if(!_0x53156e){_0x4a5176[_0x0424('0x19')](0x194);}return _0x53156e;};}function handleError(_0x231a32,_0x7c08e3){_0x7c08e3=_0x7c08e3||0x1f4;return function(_0x5bbbf9){logger[_0x0424('0x26')](_0x5bbbf9[_0x0424('0x27')]);if(_0x5bbbf9[_0x0424('0x28')]){delete _0x5bbbf9[_0x0424('0x28')];}_0x231a32['status'](_0x7c08e3)[_0x0424('0x29')](_0x5bbbf9);};}exports[_0x0424('0x2a')]=function(_0x47b91,_0x10f220){var _0x4a92f4={},_0x1ff307={},_0x10f75d={'count':0x0,'rows':[]};var _0x4628f6=_[_0x0424('0x2b')](db[_0x0424('0x2c')][_0x0424('0x2d')],function(_0x3799cb){return{'name':_0x3799cb['fieldName'],'type':_0x3799cb['type'][_0x0424('0x2e')]};});_0x1ff307['model']=_[_0x0424('0x2b')](_0x4628f6,_0x0424('0x28'));_0x1ff307[_0x0424('0x2f')]=_[_0x0424('0x30')](_0x47b91[_0x0424('0x2f')]);_0x1ff307[_0x0424('0x31')]=_[_0x0424('0x32')](_0x1ff307[_0x0424('0x33')],_0x1ff307[_0x0424('0x2f')]);_0x4a92f4[_0x0424('0x34')]=_[_0x0424('0x32')](_0x1ff307[_0x0424('0x33')],qs['fields'](_0x47b91[_0x0424('0x2f')][_0x0424('0x35')]));_0x4a92f4['attributes']=_0x4a92f4['attributes']['length']?_0x4a92f4['attributes']:_0x1ff307[_0x0424('0x33')];if(!_0x47b91[_0x0424('0x2f')]['hasOwnProperty']('nolimit')){_0x4a92f4[_0x0424('0x1f')]=qs[_0x0424('0x1f')](_0x47b91[_0x0424('0x2f')]['limit']);_0x4a92f4['offset']=qs['offset'](_0x47b91[_0x0424('0x2f')][_0x0424('0x1d')]);}_0x4a92f4[_0x0424('0x36')]=qs['sort'](_0x47b91['query'][_0x0424('0x37')]);_0x4a92f4[_0x0424('0x38')]=qs[_0x0424('0x31')](_[_0x0424('0x39')](_0x47b91[_0x0424('0x2f')],_0x1ff307['filters']),_0x4628f6);if(_0x47b91['query']['filter']){_0x4a92f4[_0x0424('0x38')]=_[_0x0424('0x3a')](_0x4a92f4[_0x0424('0x38')],{'$or':_[_0x0424('0x2b')](_0x4628f6,function(_0x1a53c3){if(_0x1a53c3[_0x0424('0x3b')]!==_0x0424('0x3c')){var _0x5096b5={};_0x5096b5[_0x1a53c3[_0x0424('0x28')]]={'$like':'%'+_0x47b91[_0x0424('0x2f')][_0x0424('0x3d')]+'%'};return _0x5096b5;}})});}_0x4a92f4=_['merge']({},_0x4a92f4,_0x47b91[_0x0424('0x3e')]);var _0x228965={'where':_0x4a92f4[_0x0424('0x38')]};return db[_0x0424('0x2c')][_0x0424('0x20')](_0x228965)[_0x0424('0x3f')](function(_0x243737){_0x10f75d[_0x0424('0x20')]=_0x243737;if(_0x47b91[_0x0424('0x2f')][_0x0424('0x40')]){_0x4a92f4[_0x0424('0x41')]=[{'all':!![]}];}return db[_0x0424('0x2c')]['findAll'](_0x4a92f4);})[_0x0424('0x3f')](function(_0x2a9e69){_0x10f75d[_0x0424('0x42')]=_0x2a9e69;return _0x10f75d;})[_0x0424('0x3f')](respondWithFilteredResult(_0x10f220,_0x4a92f4))[_0x0424('0x43')](handleError(_0x10f220,null));};exports['show']=function(_0x5b10f7,_0x5e4da9){var _0x3c201d={'raw':!![],'where':{'id':_0x5b10f7[_0x0424('0x44')]['id']}},_0xc8bd4f={};_0xc8bd4f[_0x0424('0x33')]=_['keys'](db[_0x0424('0x2c')][_0x0424('0x2d')]);_0xc8bd4f[_0x0424('0x2f')]=_['keys'](_0x5b10f7[_0x0424('0x2f')]);_0xc8bd4f[_0x0424('0x31')]=_[_0x0424('0x32')](_0xc8bd4f[_0x0424('0x33')],_0xc8bd4f['query']);_0x3c201d[_0x0424('0x34')]=_['intersection'](_0xc8bd4f[_0x0424('0x33')],qs[_0x0424('0x35')](_0x5b10f7[_0x0424('0x2f')]['fields']));_0x3c201d['attributes']=_0x3c201d[_0x0424('0x34')]['length']?_0x3c201d['attributes']:_0xc8bd4f[_0x0424('0x33')];if(_0x5b10f7[_0x0424('0x2f')][_0x0424('0x40')]){_0x3c201d[_0x0424('0x41')]=[{'all':!![]}];}_0x3c201d=_[_0x0424('0x3a')]({},_0x3c201d,_0x5b10f7[_0x0424('0x3e')]);return db[_0x0424('0x2c')][_0x0424('0x45')](_0x3c201d)['then'](handleEntityNotFound(_0x5e4da9,null))['then'](respondWithResult(_0x5e4da9,null))[_0x0424('0x43')](handleError(_0x5e4da9,null));};exports[_0x0424('0x46')]=function(_0x37bd70,_0x438ace){return db[_0x0424('0x2c')][_0x0424('0x46')](_0x37bd70[_0x0424('0x47')],{})[_0x0424('0x3f')](respondWithResult(_0x438ace,0xc9))[_0x0424('0x43')](handleError(_0x438ace,null));};exports[_0x0424('0x24')]=function(_0x556fe5,_0x3e116a){if(_0x556fe5[_0x0424('0x47')]['id']){delete _0x556fe5[_0x0424('0x47')]['id'];}return db[_0x0424('0x2c')][_0x0424('0x45')]({'where':{'id':_0x556fe5[_0x0424('0x44')]['id']}})[_0x0424('0x3f')](handleEntityNotFound(_0x3e116a,null))['then'](saveUpdates(_0x556fe5[_0x0424('0x47')],null))[_0x0424('0x3f')](respondWithResult(_0x3e116a,null))[_0x0424('0x43')](handleError(_0x3e116a,null));};exports[_0x0424('0x25')]=function(_0xc3e59a,_0x2de6e8){return db[_0x0424('0x2c')]['find']({'where':{'id':_0xc3e59a[_0x0424('0x44')]['id']}})[_0x0424('0x3f')](handleEntityNotFound(_0x2de6e8,null))[_0x0424('0x3f')](removeEntity(_0x2de6e8,null))[_0x0424('0x43')](handleError(_0x2de6e8,null));};exports[_0x0424('0x48')]=function(_0x63276b,_0x96735f){return db[_0x0424('0x2c')][_0x0424('0x48')]()[_0x0424('0x3f')](respondWithResult(_0x96735f,null))[_0x0424('0x43')](handleError(_0x96735f,null));};
\ No newline at end of file
index bf421d1..b19b17b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x24e4,0x10e));var _0x424e=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x24e4[_0x10dfdf];return _0x4d857d;};'use strict';var _=require(_0x424e('0x0'));var util=require(_0x424e('0x1'));var logger=require(_0x424e('0x2'))(_0x424e('0x3'));var moment=require(_0x424e('0x4'));var BPromise=require(_0x424e('0x5'));var rp=require(_0x424e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x424e('0x7'));var config=require(_0x424e('0x8'));var attributes=require(_0x424e('0x9'));module[_0x424e('0xa')]=function(_0x267f56,_0x2ae6d0){return _0x267f56[_0x424e('0xb')](_0x424e('0xc'),attributes,{'tableName':_0x424e('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x424e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbedc=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x4d5387,_0x2e9834){var _0x33850d=function(_0x10c1f3){while(--_0x10c1f3){_0x4d5387['push'](_0x4d5387['shift']());}};_0x33850d(++_0x2e9834);}(_0xbedc,0x10a));var _0xcbed=function(_0x530f66,_0x41bcb7){_0x530f66=_0x530f66-0x0;var _0x23a441=_0xbedc[_0x530f66];return _0x23a441;};'use strict';var _=require(_0xcbed('0x0'));var util=require(_0xcbed('0x1'));var logger=require(_0xcbed('0x2'))(_0xcbed('0x3'));var moment=require('moment');var BPromise=require(_0xcbed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbed('0x5'));var rimraf=require(_0xcbed('0x6'));var config=require(_0xcbed('0x7'));var attributes=require(_0xcbed('0x8'));module[_0xcbed('0x9')]=function(_0x1b83f8,_0x404a3e){return _0x1b83f8[_0xcbed('0xa')](_0xcbed('0xb'),attributes,{'tableName':_0xcbed('0xc'),'paranoid':![],'indexes':[{'name':_0xcbed('0xd'),'fields':[_0xcbed('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 38b2f09..7f0dd7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29df=['jayson/promise','client','http','request','then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x43dabf,_0x525c7){var _0x52429d=function(_0x322ed2){while(--_0x322ed2){_0x43dabf['push'](_0x43dabf['shift']());}};_0x52429d(++_0x525c7);}(_0x29df,0x184));var _0xf29d=function(_0x40c8a6,_0x144ca4){_0x40c8a6=_0x40c8a6-0x0;var _0x64ae5a=_0x29df[_0x40c8a6];return _0x64ae5a;};'use strict';var _=require('lodash');var util=require(_0xf29d('0x0'));var moment=require(_0xf29d('0x1'));var BPromise=require('bluebird');var rs=require(_0xf29d('0x2'));var fs=require('fs');var Redis=require(_0xf29d('0x3'));var db=require(_0xf29d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf29d('0x5'))(_0xf29d('0x6'));var config=require(_0xf29d('0x7'));var jayson=require(_0xf29d('0x8'));var client=jayson[_0xf29d('0x9')][_0xf29d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe43e6d,_0x74f450,_0x2a3237){return new BPromise(function(_0x3a5540,_0x578a11){return client[_0xf29d('0xb')](_0xe43e6d,_0x2a3237)[_0xf29d('0xc')](function(_0x2de1d7){logger[_0xf29d('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x74f450,'request\x20sent');logger[_0xf29d('0xe')](_0xf29d('0xf'),_0x74f450,'request\x20sent',JSON[_0xf29d('0x10')](_0x2de1d7));if(_0x2de1d7[_0xf29d('0x11')]){if(_0x2de1d7['error']['code']===0x1f4){logger[_0xf29d('0x11')](_0xf29d('0x12'),_0x74f450,_0x2de1d7['error'][_0xf29d('0x13')]);return _0x578a11(_0x2de1d7['error'][_0xf29d('0x13')]);}logger[_0xf29d('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x74f450,_0x2de1d7['error'][_0xf29d('0x13')]);return _0x3a5540(_0x2de1d7[_0xf29d('0x11')]['message']);}else{logger[_0xf29d('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x74f450,'request\x20sent');_0x3a5540(_0x2de1d7[_0xf29d('0x14')][_0xf29d('0x13')]);}})[_0xf29d('0x15')](function(_0x26ef78){logger[_0xf29d('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x74f450,_0x26ef78);_0x578a11(_0x26ef78);});});}
\ No newline at end of file
+var _0x23d0=['error','code','message','info','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2b433e,_0x1e96a1){var _0x1f2768=function(_0x57f332){while(--_0x57f332){_0x2b433e['push'](_0x2b433e['shift']());}};_0x1f2768(++_0x1e96a1);}(_0x23d0,0x83));var _0x023d=function(_0xeb4aa4,_0x66be0d){_0xeb4aa4=_0xeb4aa4-0x0;var _0xbcd05f=_0x23d0[_0xeb4aa4];return _0xbcd05f;};'use strict';var _=require('lodash');var util=require(_0x023d('0x0'));var moment=require('moment');var BPromise=require(_0x023d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x023d('0x2'))['db'];var utils=require(_0x023d('0x3'));var logger=require(_0x023d('0x4'))(_0x023d('0x5'));var config=require('../../config/environment');var jayson=require(_0x023d('0x6'));var client=jayson[_0x023d('0x7')][_0x023d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x935615,_0x43ac76,_0x1830f9){return new BPromise(function(_0x4a1cb1,_0x15ffad){return client[_0x023d('0x9')](_0x935615,_0x1830f9)[_0x023d('0xa')](function(_0xe187c2){logger['info'](_0x023d('0xb'),_0x43ac76,'request\x20sent');logger[_0x023d('0xc')](_0x023d('0xd'),_0x43ac76,_0x023d('0xe'),JSON[_0x023d('0xf')](_0xe187c2));if(_0xe187c2['error']){if(_0xe187c2[_0x023d('0x10')][_0x023d('0x11')]===0x1f4){logger['error'](_0x023d('0xb'),_0x43ac76,_0xe187c2['error'][_0x023d('0x12')]);return _0x15ffad(_0xe187c2[_0x023d('0x10')][_0x023d('0x12')]);}logger[_0x023d('0x10')](_0x023d('0xb'),_0x43ac76,_0xe187c2[_0x023d('0x10')][_0x023d('0x12')]);return _0x4a1cb1(_0xe187c2['error'][_0x023d('0x12')]);}else{logger[_0x023d('0x13')](_0x023d('0xb'),_0x43ac76,_0x023d('0xe'));_0x4a1cb1(_0xe187c2['result'][_0x023d('0x12')]);}})[_0x023d('0x14')](function(_0x5f4a4b){logger['error'](_0x023d('0xb'),_0x43ac76,_0x5f4a4b);_0x15ffad(_0x5f4a4b);});});}
\ No newline at end of file
index 200ec90..ff6eee9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd527=['destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x23a1b7,_0x37038a){var _0x5412ba=function(_0x3dcc0f){while(--_0x3dcc0f){_0x23a1b7['push'](_0x23a1b7['shift']());}};_0x5412ba(++_0x37038a);}(_0xd527,0x155));var _0x7d52=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0xd527[_0x35c97a];return _0x388917;};'use strict';var multer=require(_0x7d52('0x0'));var util=require('util');var path=require(_0x7d52('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d52('0x2'));var router=express[_0x7d52('0x3')]();var fs_extra=require(_0x7d52('0x4'));var auth=require(_0x7d52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7d52('0x6'));var controller=require(_0x7d52('0x7'));router[_0x7d52('0x8')]('/',auth[_0x7d52('0x9')](),controller[_0x7d52('0xa')]);router[_0x7d52('0x8')](_0x7d52('0xb'),auth[_0x7d52('0x9')](),controller[_0x7d52('0xc')]);router[_0x7d52('0x8')](_0x7d52('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7d52('0xe')]('/',auth[_0x7d52('0x9')](),controller[_0x7d52('0xf')]);router[_0x7d52('0x10')]('/:id',auth[_0x7d52('0x9')](),controller[_0x7d52('0x11')]);router[_0x7d52('0x12')](_0x7d52('0xd'),auth['isAuthenticated'](),controller[_0x7d52('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xbc9e=['create','put','delete','destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xbc9e,0xae));var _0xebc9=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xbc9e[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require(_0xebc9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebc9('0x1')]();var fs_extra=require(_0xebc9('0x2'));var auth=require(_0xebc9('0x3'));var interaction=require(_0xebc9('0x4'));var config=require(_0xebc9('0x5'));var controller=require(_0xebc9('0x6'));router[_0xebc9('0x7')]('/',auth[_0xebc9('0x8')](),controller[_0xebc9('0x9')]);router[_0xebc9('0x7')](_0xebc9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xebc9('0x7')](_0xebc9('0xb'),auth[_0xebc9('0x8')](),controller[_0xebc9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebc9('0xd')]);router[_0xebc9('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xebc9('0xf')](_0xebc9('0xb'),auth[_0xebc9('0x8')](),controller[_0xebc9('0x10')]);module['exports']=router;
\ No newline at end of file
index 24168c8..b3a72ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2635=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated'];(function(_0x5db720,_0x1d6bdd){var _0x2ab3e2=function(_0x4f3692){while(--_0x4f3692){_0x5db720['push'](_0x5db720['shift']());}};_0x2ab3e2(++_0x1d6bdd);}(_0x2635,0x1ed));var _0x5263=function(_0x270a11,_0x22f5b8){_0x270a11=_0x270a11-0x0;var _0x3b8ccc=_0x2635[_0x270a11];return _0x3b8ccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5263('0x0'));var timeout=require(_0x5263('0x1'));var express=require(_0x5263('0x2'));var router=express[_0x5263('0x3')]();var fs_extra=require(_0x5263('0x4'));var auth=require(_0x5263('0x5'));var interaction=require(_0x5263('0x6'));var config=require(_0x5263('0x7'));var controller=require(_0x5263('0x8'));router[_0x5263('0x9')]('/',auth[_0x5263('0xa')](),controller['index']);router[_0x5263('0x9')](_0x5263('0xb'),auth[_0x5263('0xa')](),controller[_0x5263('0xc')]);router[_0x5263('0x9')](_0x5263('0xd'),auth[_0x5263('0xa')](),controller[_0x5263('0xe')]);router['get'](_0x5263('0xf'),auth['isAuthenticated'](),controller[_0x5263('0x10')]);router[_0x5263('0x11')]('/',auth[_0x5263('0xa')](),controller['create']);router[_0x5263('0x11')](_0x5263('0xd'),auth[_0x5263('0xa')](),controller['addConfiguration']);router[_0x5263('0x12')](_0x5263('0xb'),auth[_0x5263('0xa')](),controller[_0x5263('0x13')]);router['delete'](_0x5263('0xb'),auth[_0x5263('0xa')](),controller[_0x5263('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x8931=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','getFields','post','addConfiguration','put','update','destroy','exports','multer'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x8931,0x1e2));var _0x1893=function(_0x595d1e,_0x3098c3){_0x595d1e=_0x595d1e-0x0;var _0xa56ae3=_0x8931[_0x595d1e];return _0xa56ae3;};'use strict';var multer=require(_0x1893('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1893('0x1'));var express=require(_0x1893('0x2'));var router=express[_0x1893('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1893('0x4'));var interaction=require(_0x1893('0x5'));var config=require(_0x1893('0x6'));var controller=require(_0x1893('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1893('0x8')]);router[_0x1893('0x9')](_0x1893('0xa'),auth[_0x1893('0xb')](),controller[_0x1893('0xc')]);router[_0x1893('0x9')]('/:id/configurations',auth[_0x1893('0xb')](),controller[_0x1893('0xd')]);router['get']('/:id/fields',auth[_0x1893('0xb')](),controller[_0x1893('0xe')]);router[_0x1893('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1893('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1893('0x10')]);router[_0x1893('0x11')](_0x1893('0xa'),auth[_0x1893('0xb')](),controller[_0x1893('0x12')]);router['delete'](_0x1893('0xa'),auth['isAuthenticated'](),controller[_0x1893('0x13')]);module[_0x1893('0x14')]=router;
\ No newline at end of file
index 3600849..709c364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31cb=['STRING','ENUM','integrationTab','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31cb,0xf8));var _0xb31c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x31cb[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xb31c('0x0'));module[_0xb31c('0x1')]={'name':{'type':Sequelize[_0xb31c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb31c('0x2')]},'authType':{'type':Sequelize[_0xb31c('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xb31c('0x2')]},'consumerKey':{'type':Sequelize[_0xb31c('0x2')]},'consumerSecret':{'type':Sequelize[_0xb31c('0x2')]},'token':{'type':Sequelize[_0xb31c('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb31c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb31c('0x3')](_0xb31c('0x4'),'newTab'),'defaultValue':_0xb31c('0x4')}};
\ No newline at end of file
+var _0xf69c=['exports','STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x429da6,_0x17ce0a){var _0x3caa27=function(_0x650890){while(--_0x650890){_0x429da6['push'](_0x429da6['shift']());}};_0x3caa27(++_0x17ce0a);}(_0xf69c,0x1b8));var _0xcf69=function(_0x123935,_0x1670ba){_0x123935=_0x123935-0x0;var _0x1a8ebf=_0xf69c[_0x123935];return _0x1a8ebf;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'name':{'type':Sequelize[_0xcf69('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcf69('0x2')]},'remoteUri':{'type':Sequelize[_0xcf69('0x2')]},'authType':{'type':Sequelize[_0xcf69('0x3')]('basic'),'defaultValue':_0xcf69('0x4')},'password':{'type':Sequelize[_0xcf69('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xcf69('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcf69('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcf69('0x3')]('integrationTab',_0xcf69('0x5')),'defaultValue':_0xcf69('0x6')}};
\ No newline at end of file
index 4e2fb36..1025a91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe348=['find','create','body','getConfigurations','findOne','length','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','slice','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','username','toString','base64','concat','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0xcf1a80,_0x9575ce){var _0x1fb8ec=function(_0x2c0dcb){while(--_0x2c0dcb){_0xcf1a80['push'](_0xcf1a80['shift']());}};_0x1fb8ec(++_0x9575ce);}(_0xe348,0x9e));var _0x8e34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe348[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8e34('0x0'));var rimraf=require(_0x8e34('0x1'));var zipdir=require(_0x8e34('0x2'));var jsonpatch=require(_0x8e34('0x3'));var rp=require(_0x8e34('0x4'));var moment=require(_0x8e34('0x5'));var BPromise=require(_0x8e34('0x6'));var Mustache=require(_0x8e34('0x7'));var util=require('util');var path=require(_0x8e34('0x8'));var sox=require('sox');var csv=require(_0x8e34('0x9'));var ejs=require(_0x8e34('0xa'));var fs=require('fs');var fs_extra=require(_0x8e34('0xb'));var _=require(_0x8e34('0xc'));var squel=require(_0x8e34('0xd'));var crypto=require(_0x8e34('0xe'));var jsforce=require(_0x8e34('0xf'));var deskjs=require(_0x8e34('0x10'));var toCsv=require(_0x8e34('0x9'));var querystring=require(_0x8e34('0x11'));var Papa=require('papaparse');var Redis=require(_0x8e34('0x12'));var authService=require(_0x8e34('0x13'));var qs=require(_0x8e34('0x14'));var as=require(_0x8e34('0x15'));var hardwareService=require(_0x8e34('0x16'));var logger=require(_0x8e34('0x17'))(_0x8e34('0x18'));var utils=require(_0x8e34('0x19'));var config=require(_0x8e34('0x1a'));var licenseUtil=require(_0x8e34('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8e34('0x1c'));function respondWithStatusCode(_0x3f38db,_0x2d6f6b){_0x2d6f6b=_0x2d6f6b||0xcc;return function(_0x376068){if(_0x376068){return _0x3f38db['sendStatus'](_0x2d6f6b);}return _0x3f38db[_0x8e34('0x1d')](_0x2d6f6b)[_0x8e34('0x1e')]();};}function respondWithResult(_0x472efa,_0x9517ca){_0x9517ca=_0x9517ca||0xc8;return function(_0x1e96d5){if(_0x1e96d5){return _0x472efa[_0x8e34('0x1d')](_0x9517ca)['json'](_0x1e96d5);}};}function respondWithFilteredResult(_0x5d64a1,_0x469393){return function(_0x336532){if(_0x336532){var _0x216c34=typeof _0x469393[_0x8e34('0x1f')]===_0x8e34('0x20')&&typeof _0x469393[_0x8e34('0x21')]===_0x8e34('0x20');var _0xdf256e=_0x336532['count'];var _0x6487ab=_0x216c34?0x0:_0x469393['offset'];var _0x16a0d5=_0x216c34?_0x336532[_0x8e34('0x22')]:_0x469393[_0x8e34('0x1f')]+_0x469393[_0x8e34('0x21')];var _0x1d2203;if(_0x16a0d5>=_0xdf256e){_0x16a0d5=_0xdf256e;_0x1d2203=0xc8;}else{_0x1d2203=0xce;}_0x5d64a1[_0x8e34('0x1d')](_0x1d2203);return _0x5d64a1[_0x8e34('0x23')](_0x8e34('0x24'),_0x6487ab+'-'+_0x16a0d5+'/'+_0xdf256e)[_0x8e34('0x25')](_0x336532);}return null;};}function patchUpdates(_0x5ee394){return function(_0x2f10da){try{jsonpatch[_0x8e34('0x26')](_0x2f10da,_0x5ee394,!![]);}catch(_0x236d5a){return BPromise[_0x8e34('0x27')](_0x236d5a);}return _0x2f10da['save']();};}function saveUpdates(_0x8857e5,_0x3b5a15){return function(_0xe4d6db){if(_0xe4d6db){return _0xe4d6db[_0x8e34('0x28')](_0x8857e5)[_0x8e34('0x29')](function(_0x1ec0e8){return _0x1ec0e8;});}return null;};}function removeEntity(_0x3b4c1e,_0x1b71e4){return function(_0x508dee){if(_0x508dee){return _0x508dee[_0x8e34('0x2a')]()[_0x8e34('0x29')](function(){_0x3b4c1e[_0x8e34('0x1d')](0xcc)[_0x8e34('0x1e')]();});}};}function handleEntityNotFound(_0x1958f1,_0x3dcbff){return function(_0x4866a8){if(!_0x4866a8){_0x1958f1[_0x8e34('0x2b')](0x194);}return _0x4866a8;};}function handleError(_0x2f6627,_0x465f7d){_0x465f7d=_0x465f7d||0x1f4;return function(_0x13d972){logger['error'](_0x13d972['stack']);if(_0x13d972[_0x8e34('0x2c')]){delete _0x13d972[_0x8e34('0x2c')];}_0x2f6627[_0x8e34('0x1d')](_0x465f7d)[_0x8e34('0x2d')](_0x13d972);};}exports[_0x8e34('0x2e')]=function(_0x50ab04,_0x24c1d3){var _0x1b60b0={},_0x28f823={},_0x280557={'count':0x0,'rows':[]};var _0x1a1567=_[_0x8e34('0x2f')](db[_0x8e34('0x30')][_0x8e34('0x31')],function(_0x2dd43a){return{'name':_0x2dd43a[_0x8e34('0x32')],'type':_0x2dd43a[_0x8e34('0x33')][_0x8e34('0x34')]};});_0x28f823[_0x8e34('0x35')]=_['map'](_0x1a1567,'name');_0x28f823['query']=_['keys'](_0x50ab04['query']);_0x28f823[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x28f823[_0x8e34('0x35')],_0x28f823[_0x8e34('0x38')]);_0x1b60b0[_0x8e34('0x39')]=_['intersection'](_0x28f823[_0x8e34('0x35')],qs[_0x8e34('0x3a')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x1b60b0[_0x8e34('0x39')]=_0x1b60b0[_0x8e34('0x39')]['length']?_0x1b60b0[_0x8e34('0x39')]:_0x28f823[_0x8e34('0x35')];if(!_0x50ab04[_0x8e34('0x38')][_0x8e34('0x3b')](_0x8e34('0x3c'))){_0x1b60b0['limit']=qs[_0x8e34('0x21')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x21')]);_0x1b60b0['offset']=qs[_0x8e34('0x1f')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x1f')]);}_0x1b60b0[_0x8e34('0x3d')]=qs[_0x8e34('0x3e')](_0x50ab04[_0x8e34('0x38')]['sort']);_0x1b60b0['where']=qs[_0x8e34('0x36')](_[_0x8e34('0x3f')](_0x50ab04['query'],_0x28f823[_0x8e34('0x36')]),_0x1a1567);if(_0x50ab04['query']['filter']){_0x1b60b0[_0x8e34('0x40')]=_[_0x8e34('0x41')](_0x1b60b0[_0x8e34('0x40')],{'$or':_[_0x8e34('0x2f')](_0x1a1567,function(_0x5aa9ee){if(_0x5aa9ee[_0x8e34('0x33')]!=='VIRTUAL'){var _0x39976f={};_0x39976f[_0x5aa9ee[_0x8e34('0x2c')]]={'$like':'%'+_0x50ab04[_0x8e34('0x38')][_0x8e34('0x42')]+'%'};return _0x39976f;}})});}_0x1b60b0=_[_0x8e34('0x41')]({},_0x1b60b0,_0x50ab04[_0x8e34('0x43')]);var _0x1df9f2={'where':_0x1b60b0['where']};return db[_0x8e34('0x30')][_0x8e34('0x22')](_0x1df9f2)[_0x8e34('0x29')](function(_0x29f262){_0x280557[_0x8e34('0x22')]=_0x29f262;if(_0x50ab04['query'][_0x8e34('0x44')]){_0x1b60b0[_0x8e34('0x45')]=[{'all':!![]}];}return db[_0x8e34('0x30')][_0x8e34('0x46')](_0x1b60b0);})[_0x8e34('0x29')](function(_0x4ab773){_0x280557[_0x8e34('0x47')]=_0x4ab773;return _0x280557;})[_0x8e34('0x29')](respondWithFilteredResult(_0x24c1d3,_0x1b60b0))[_0x8e34('0x48')](handleError(_0x24c1d3,null));};exports[_0x8e34('0x49')]=function(_0xd0e32,_0x19f77f){var _0x156ff8={'raw':![],'where':{'id':_0xd0e32[_0x8e34('0x4a')]['id']}},_0x5d3886={};_0x5d3886[_0x8e34('0x35')]=_[_0x8e34('0x4b')](db[_0x8e34('0x30')][_0x8e34('0x31')]);_0x5d3886[_0x8e34('0x38')]=_['keys'](_0xd0e32['query']);_0x5d3886[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x5d3886['model'],_0x5d3886[_0x8e34('0x38')]);_0x156ff8[_0x8e34('0x39')]=_[_0x8e34('0x37')](_0x5d3886[_0x8e34('0x35')],qs[_0x8e34('0x3a')](_0xd0e32[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x156ff8[_0x8e34('0x39')]=_0x156ff8[_0x8e34('0x39')]['length']?_0x156ff8[_0x8e34('0x39')]:_0x5d3886[_0x8e34('0x35')];if(_0xd0e32['query'][_0x8e34('0x44')]){_0x156ff8[_0x8e34('0x45')]=[{'all':!![]}];}_0x156ff8=_[_0x8e34('0x41')]({},_0x156ff8,_0xd0e32[_0x8e34('0x43')]);return db[_0x8e34('0x30')][_0x8e34('0x4c')](_0x156ff8)[_0x8e34('0x29')](handleEntityNotFound(_0x19f77f,null))[_0x8e34('0x29')](respondWithResult(_0x19f77f,null))[_0x8e34('0x48')](handleError(_0x19f77f,null));};exports['create']=function(_0x563ab2,_0x1f727a){return db[_0x8e34('0x30')][_0x8e34('0x4d')](_0x563ab2['body'],{})['then'](respondWithResult(_0x1f727a,0xc9))['catch'](handleError(_0x1f727a,null));};exports[_0x8e34('0x28')]=function(_0x4341f9,_0xf5c6fb){if(_0x4341f9['body']['id']){delete _0x4341f9[_0x8e34('0x4e')]['id'];}return db[_0x8e34('0x30')]['find']({'where':{'id':_0x4341f9[_0x8e34('0x4a')]['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0xf5c6fb,null))[_0x8e34('0x29')](saveUpdates(_0x4341f9[_0x8e34('0x4e')],null))['then'](respondWithResult(_0xf5c6fb,null))[_0x8e34('0x48')](handleError(_0xf5c6fb,null));};exports[_0x8e34('0x2a')]=function(_0xdbfcde,_0x51190f){return db[_0x8e34('0x30')]['find']({'where':{'id':_0xdbfcde[_0x8e34('0x4a')]['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0x51190f,null))[_0x8e34('0x29')](removeEntity(_0x51190f,null))[_0x8e34('0x48')](handleError(_0x51190f,null));};exports[_0x8e34('0x4f')]=function(_0x4f6e76,_0x33e23f,_0x2f8f39){var _0x10d3c7={};var _0x11e1a1={};var _0x1413aa;var _0x3d7d8f;return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x4f6e76[_0x8e34('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33e23f,null))[_0x8e34('0x29')](function(_0x32ed18){if(_0x32ed18){_0x1413aa=_0x32ed18;_0x11e1a1['model']=_[_0x8e34('0x4b')](db['DeskConfiguration'][_0x8e34('0x31')]);_0x11e1a1['query']=_[_0x8e34('0x4b')](_0x4f6e76[_0x8e34('0x38')]);_0x11e1a1[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x11e1a1[_0x8e34('0x35')],_0x11e1a1[_0x8e34('0x38')]);_0x10d3c7[_0x8e34('0x39')]=_[_0x8e34('0x37')](_0x11e1a1['model'],qs[_0x8e34('0x3a')](_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x10d3c7[_0x8e34('0x39')]=_0x10d3c7['attributes'][_0x8e34('0x51')]?_0x10d3c7[_0x8e34('0x39')]:_0x11e1a1['model'];_0x10d3c7['order']=qs[_0x8e34('0x3e')](_0x4f6e76['query'][_0x8e34('0x3e')]);_0x10d3c7[_0x8e34('0x40')]=qs[_0x8e34('0x36')](_['pick'](_0x4f6e76[_0x8e34('0x38')],_0x11e1a1[_0x8e34('0x36')]));if(_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x42')]){_0x10d3c7[_0x8e34('0x40')]=_['merge'](_0x10d3c7['where'],{'$or':_[_0x8e34('0x2f')](_0x10d3c7['attributes'],function(_0x35ad57){var _0xa4ece7={};_0xa4ece7[_0x35ad57]={'$like':'%'+_0x4f6e76[_0x8e34('0x38')]['filter']+'%'};return _0xa4ece7;})});}_0x10d3c7=_[_0x8e34('0x41')]({},_0x10d3c7,_0x4f6e76['options']);return _0x1413aa[_0x8e34('0x4f')](_0x10d3c7);}})[_0x8e34('0x29')](function(_0x209a2f){if(_0x209a2f){_0x3d7d8f=_0x209a2f[_0x8e34('0x51')];if(!_0x4f6e76[_0x8e34('0x38')]['hasOwnProperty'](_0x8e34('0x3c'))){_0x10d3c7['limit']=qs[_0x8e34('0x21')](_0x4f6e76['query']['limit']);_0x10d3c7[_0x8e34('0x1f')]=qs[_0x8e34('0x1f')](_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x1f')]);}return _0x1413aa['getConfigurations'](_0x10d3c7);}})[_0x8e34('0x29')](function(_0x25116c){if(_0x25116c){return _0x25116c?{'count':_0x3d7d8f,'rows':_0x25116c}:null;}})[_0x8e34('0x29')](respondWithResult(_0x33e23f,null))[_0x8e34('0x48')](handleError(_0x33e23f,null));};exports['addConfiguration']=function(_0x469a54,_0x573e2e,_0x41d070){if(_0x469a54['body']['id']){delete _0x469a54[_0x8e34('0x4e')]['id'];}return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x469a54['params']['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0x573e2e,null))[_0x8e34('0x29')](function(_0x16ee15){if(_0x16ee15){_0x469a54[_0x8e34('0x4e')]['AccountId']=_0x16ee15['id'];_0x469a54['body'][_0x8e34('0x52')]=integrations[_0x8e34('0x53')](_0x469a54[_0x8e34('0x4e')][_0x8e34('0x54')],_0x469a54[_0x8e34('0x4e')][_0x8e34('0x33')]);_0x469a54[_0x8e34('0x4e')][_0x8e34('0x55')]=integrations[_0x8e34('0x56')](_0x469a54['body']['channel'],_0x469a54[_0x8e34('0x4e')][_0x8e34('0x33')]);return db[_0x8e34('0x57')][_0x8e34('0x4d')](_0x469a54[_0x8e34('0x4e')],{'include':[{'model':db[_0x8e34('0x58')],'as':_0x8e34('0x52')},{'model':db[_0x8e34('0x58')],'as':'Descriptions'}]});}return null;})[_0x8e34('0x29')](respondWithResult(_0x573e2e,null))['catch'](handleError(_0x573e2e,null));};exports[_0x8e34('0x59')]=function(_0x4ad093,_0x4d08cd,_0x454381){var _0x50cf84=[{'name':_0x8e34('0x5a'),'label':_0x8e34('0x5a'),'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 _0x47e8d4='';return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x4ad093[_0x8e34('0x4a')]['id']},'attributes':['id',_0x8e34('0x5b'),_0x8e34('0x5c'),'username',_0x8e34('0x5d'),'consumerKey',_0x8e34('0x5e'),_0x8e34('0x5f'),_0x8e34('0x60')]})['then'](handleEntityNotFound(_0x4d08cd,null))['then'](function(_0x47f4de){if(_0x47f4de){_0x47e8d4=_0x47f4de[_0x8e34('0x5b')];var _0x45d3de=_0x47e8d4[_0x8e34('0x61')](-0x1);if(_0x45d3de==='/'){_0x47e8d4=_0x47e8d4['substring'](0x0,_0x47e8d4['lastIndexOf'](_0x45d3de));}var _0x3bed98={'method':'GET','uri':util[_0x8e34('0x62')](_0x8e34('0x63'),_0x47e8d4),'headers':{'Content-Type':_0x8e34('0x64'),'Accept':_0x8e34('0x64')},'json':!![]};if(_0x47f4de[_0x8e34('0x5c')]===_0x8e34('0x65')){_0x3bed98['headers'][_0x8e34('0x66')]=util[_0x8e34('0x62')](_0x8e34('0x67'),new Buffer(util[_0x8e34('0x62')]('%s:%s',_0x47f4de[_0x8e34('0x68')],_0x47f4de[_0x8e34('0x5d')]))[_0x8e34('0x69')](_0x8e34('0x6a')));}return rp(_0x3bed98)[_0x8e34('0x29')](function(_0x2d7608){return _0x50cf84[_0x8e34('0x6b')](_[_0x8e34('0x2f')](_0x2d7608['_embedded'][_0x8e34('0x6c')],function(_0x3e9601){return{'id':_0x3e9601[_0x8e34('0x2c')],'name':_0x3e9601[_0x8e34('0x2c')],'type':_0x3e9601[_0x8e34('0x33')],'active':_0x3e9601[_0x8e34('0x6d')],'label':_0x3e9601[_0x8e34('0x6e')],'custom':!![]};}));});}})[_0x8e34('0x29')](function(_0x33fb8e){return{'count':_0x33fb8e['length'],'rows':_0x33fb8e};})[_0x8e34('0x29')](respondWithResult(_0x4d08cd,null))[_0x8e34('0x48')](function(_0x349ee7){var _0x4e4804=_0x4ad093[_0x8e34('0x38')]['test']?0x1f4:_0x349ee7[_0x8e34('0x6f')]||0x1f4;logger[_0x8e34('0x70')](_0x8e34('0x71'),_0x8e34('0x59'),_0x4e4804,JSON[_0x8e34('0x72')](_0x349ee7));delete _0x349ee7['name'];if(_0x4e4804===0x191){_0x4e4804=0x190;}_0x4d08cd[_0x8e34('0x1d')](_0x4e4804)[_0x8e34('0x2d')](_0x4ad093[_0x8e34('0x38')][_0x8e34('0x73')]?{'message':_0x8e34('0x74'),'statusCode':_0x349ee7[_0x8e34('0x6f')]}:_0x349ee7);});};
\ No newline at end of file
+var _0x9056=['name','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','includeAll','find','create','body','update','params','getConfigurations','DeskConfiguration','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','send','index','map','DeskAccount','rawAttributes','fieldName','type','key'];(function(_0x12699c,_0xf9dd49){var _0x54360e=function(_0xa4d495){while(--_0xa4d495){_0x12699c['push'](_0x12699c['shift']());}};_0x54360e(++_0xf9dd49);}(_0x9056,0xa9));var _0x6905=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9056[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6905('0x0'));var rimraf=require(_0x6905('0x1'));var zipdir=require(_0x6905('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6905('0x3'));var BPromise=require(_0x6905('0x4'));var Mustache=require('mustache');var util=require(_0x6905('0x5'));var path=require(_0x6905('0x6'));var sox=require(_0x6905('0x7'));var csv=require('to-csv');var ejs=require(_0x6905('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6905('0x9'));var squel=require(_0x6905('0xa'));var crypto=require(_0x6905('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6905('0xc'));var toCsv=require(_0x6905('0xd'));var querystring=require(_0x6905('0xe'));var Papa=require(_0x6905('0xf'));var Redis=require(_0x6905('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6905('0x11'));var logger=require(_0x6905('0x12'))('api');var utils=require(_0x6905('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6905('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x24465e,_0x4cd55c){_0x4cd55c=_0x4cd55c||0xcc;return function(_0x214997){if(_0x214997){return _0x24465e[_0x6905('0x15')](_0x4cd55c);}return _0x24465e['status'](_0x4cd55c)[_0x6905('0x16')]();};}function respondWithResult(_0x676477,_0xf01cd){_0xf01cd=_0xf01cd||0xc8;return function(_0x4d8481){if(_0x4d8481){return _0x676477[_0x6905('0x17')](_0xf01cd)['json'](_0x4d8481);}};}function respondWithFilteredResult(_0x19eaa7,_0x32c112){return function(_0x34d30f){if(_0x34d30f){var _0x430a0d=typeof _0x32c112[_0x6905('0x18')]===_0x6905('0x19')&&typeof _0x32c112[_0x6905('0x1a')]===_0x6905('0x19');var _0x31defb=_0x34d30f[_0x6905('0x1b')];var _0xadb324=_0x430a0d?0x0:_0x32c112[_0x6905('0x18')];var _0xa4e567=_0x430a0d?_0x34d30f[_0x6905('0x1b')]:_0x32c112[_0x6905('0x18')]+_0x32c112['limit'];var _0x1711c2;if(_0xa4e567>=_0x31defb){_0xa4e567=_0x31defb;_0x1711c2=0xc8;}else{_0x1711c2=0xce;}_0x19eaa7[_0x6905('0x17')](_0x1711c2);return _0x19eaa7[_0x6905('0x1c')](_0x6905('0x1d'),_0xadb324+'-'+_0xa4e567+'/'+_0x31defb)[_0x6905('0x1e')](_0x34d30f);}return null;};}function patchUpdates(_0x4c2af8){return function(_0x74d1be){try{jsonpatch[_0x6905('0x1f')](_0x74d1be,_0x4c2af8,!![]);}catch(_0x5c626b){return BPromise[_0x6905('0x20')](_0x5c626b);}return _0x74d1be['save']();};}function saveUpdates(_0x34f711,_0x51ee56){return function(_0x4aa896){if(_0x4aa896){return _0x4aa896['update'](_0x34f711)['then'](function(_0x483ed7){return _0x483ed7;});}return null;};}function removeEntity(_0x824b4f,_0x366282){return function(_0x3b3cb4){if(_0x3b3cb4){return _0x3b3cb4[_0x6905('0x21')]()[_0x6905('0x22')](function(){_0x824b4f[_0x6905('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa07c7f,_0x103732){return function(_0x3d628c){if(!_0x3d628c){_0xa07c7f[_0x6905('0x15')](0x194);}return _0x3d628c;};}function handleError(_0x2407ea,_0x4d530d){_0x4d530d=_0x4d530d||0x1f4;return function(_0x27596c){logger[_0x6905('0x23')](_0x27596c[_0x6905('0x24')]);if(_0x27596c['name']){delete _0x27596c['name'];}_0x2407ea[_0x6905('0x17')](_0x4d530d)[_0x6905('0x25')](_0x27596c);};}exports[_0x6905('0x26')]=function(_0x2f7c68,_0x1ee876){var _0x3b6225={},_0x2e6493={},_0xe5fa1e={'count':0x0,'rows':[]};var _0x14bf3c=_[_0x6905('0x27')](db[_0x6905('0x28')][_0x6905('0x29')],function(_0x1d0a46){return{'name':_0x1d0a46[_0x6905('0x2a')],'type':_0x1d0a46[_0x6905('0x2b')][_0x6905('0x2c')]};});_0x2e6493['model']=_[_0x6905('0x27')](_0x14bf3c,_0x6905('0x2d'));_0x2e6493['query']=_[_0x6905('0x2e')](_0x2f7c68[_0x6905('0x2f')]);_0x2e6493[_0x6905('0x30')]=_[_0x6905('0x31')](_0x2e6493[_0x6905('0x32')],_0x2e6493[_0x6905('0x2f')]);_0x3b6225[_0x6905('0x33')]=_['intersection'](_0x2e6493[_0x6905('0x32')],qs[_0x6905('0x34')](_0x2f7c68[_0x6905('0x2f')][_0x6905('0x34')]));_0x3b6225['attributes']=_0x3b6225[_0x6905('0x33')][_0x6905('0x35')]?_0x3b6225[_0x6905('0x33')]:_0x2e6493[_0x6905('0x32')];if(!_0x2f7c68[_0x6905('0x2f')]['hasOwnProperty']('nolimit')){_0x3b6225[_0x6905('0x1a')]=qs[_0x6905('0x1a')](_0x2f7c68[_0x6905('0x2f')][_0x6905('0x1a')]);_0x3b6225[_0x6905('0x18')]=qs[_0x6905('0x18')](_0x2f7c68['query']['offset']);}_0x3b6225[_0x6905('0x36')]=qs[_0x6905('0x37')](_0x2f7c68[_0x6905('0x2f')][_0x6905('0x37')]);_0x3b6225[_0x6905('0x38')]=qs[_0x6905('0x30')](_[_0x6905('0x39')](_0x2f7c68[_0x6905('0x2f')],_0x2e6493['filters']),_0x14bf3c);if(_0x2f7c68['query']['filter']){_0x3b6225[_0x6905('0x38')]=_[_0x6905('0x3a')](_0x3b6225['where'],{'$or':_[_0x6905('0x27')](_0x14bf3c,function(_0x188d07){if(_0x188d07[_0x6905('0x2b')]!==_0x6905('0x3b')){var _0x209606={};_0x209606[_0x188d07[_0x6905('0x2d')]]={'$like':'%'+_0x2f7c68[_0x6905('0x2f')][_0x6905('0x3c')]+'%'};return _0x209606;}})});}_0x3b6225=_[_0x6905('0x3a')]({},_0x3b6225,_0x2f7c68[_0x6905('0x3d')]);var _0x2bc682={'where':_0x3b6225['where']};return db[_0x6905('0x28')][_0x6905('0x1b')](_0x2bc682)[_0x6905('0x22')](function(_0x46299c){_0xe5fa1e[_0x6905('0x1b')]=_0x46299c;if(_0x2f7c68[_0x6905('0x2f')]['includeAll']){_0x3b6225[_0x6905('0x3e')]=[{'all':!![]}];}return db[_0x6905('0x28')][_0x6905('0x3f')](_0x3b6225);})[_0x6905('0x22')](function(_0x556832){_0xe5fa1e['rows']=_0x556832;return _0xe5fa1e;})[_0x6905('0x22')](respondWithFilteredResult(_0x1ee876,_0x3b6225))[_0x6905('0x40')](handleError(_0x1ee876,null));};exports['show']=function(_0x36869b,_0x2a8adc){var _0x2f3f27={'raw':![],'where':{'id':_0x36869b['params']['id']}},_0x115031={};_0x115031[_0x6905('0x32')]=_[_0x6905('0x2e')](db[_0x6905('0x28')][_0x6905('0x29')]);_0x115031[_0x6905('0x2f')]=_[_0x6905('0x2e')](_0x36869b[_0x6905('0x2f')]);_0x115031[_0x6905('0x30')]=_['intersection'](_0x115031[_0x6905('0x32')],_0x115031['query']);_0x2f3f27[_0x6905('0x33')]=_[_0x6905('0x31')](_0x115031[_0x6905('0x32')],qs[_0x6905('0x34')](_0x36869b[_0x6905('0x2f')]['fields']));_0x2f3f27[_0x6905('0x33')]=_0x2f3f27[_0x6905('0x33')][_0x6905('0x35')]?_0x2f3f27[_0x6905('0x33')]:_0x115031['model'];if(_0x36869b[_0x6905('0x2f')][_0x6905('0x41')]){_0x2f3f27[_0x6905('0x3e')]=[{'all':!![]}];}_0x2f3f27=_['merge']({},_0x2f3f27,_0x36869b[_0x6905('0x3d')]);return db[_0x6905('0x28')][_0x6905('0x42')](_0x2f3f27)[_0x6905('0x22')](handleEntityNotFound(_0x2a8adc,null))[_0x6905('0x22')](respondWithResult(_0x2a8adc,null))['catch'](handleError(_0x2a8adc,null));};exports[_0x6905('0x43')]=function(_0x27627e,_0x3b61a7){return db[_0x6905('0x28')][_0x6905('0x43')](_0x27627e[_0x6905('0x44')],{})[_0x6905('0x22')](respondWithResult(_0x3b61a7,0xc9))[_0x6905('0x40')](handleError(_0x3b61a7,null));};exports[_0x6905('0x45')]=function(_0x30e18b,_0x157803){if(_0x30e18b['body']['id']){delete _0x30e18b['body']['id'];}return db['DeskAccount'][_0x6905('0x42')]({'where':{'id':_0x30e18b[_0x6905('0x46')]['id']}})[_0x6905('0x22')](handleEntityNotFound(_0x157803,null))[_0x6905('0x22')](saveUpdates(_0x30e18b[_0x6905('0x44')],null))['then'](respondWithResult(_0x157803,null))['catch'](handleError(_0x157803,null));};exports[_0x6905('0x21')]=function(_0x592c82,_0x1acb8f){return db[_0x6905('0x28')][_0x6905('0x42')]({'where':{'id':_0x592c82[_0x6905('0x46')]['id']}})[_0x6905('0x22')](handleEntityNotFound(_0x1acb8f,null))[_0x6905('0x22')](removeEntity(_0x1acb8f,null))[_0x6905('0x40')](handleError(_0x1acb8f,null));};exports[_0x6905('0x47')]=function(_0x197980,_0x3dc3e9,_0x134f09){var _0x3c11e3={};var _0xb5c223={};var _0x226d77;var _0x5c83c0;return db[_0x6905('0x28')]['findOne']({'where':{'id':_0x197980[_0x6905('0x46')]['id']}})[_0x6905('0x22')](handleEntityNotFound(_0x3dc3e9,null))[_0x6905('0x22')](function(_0x5b5ffc){if(_0x5b5ffc){_0x226d77=_0x5b5ffc;_0xb5c223[_0x6905('0x32')]=_[_0x6905('0x2e')](db[_0x6905('0x48')][_0x6905('0x29')]);_0xb5c223['query']=_['keys'](_0x197980['query']);_0xb5c223['filters']=_['intersection'](_0xb5c223['model'],_0xb5c223['query']);_0x3c11e3[_0x6905('0x33')]=_['intersection'](_0xb5c223[_0x6905('0x32')],qs['fields'](_0x197980[_0x6905('0x2f')][_0x6905('0x34')]));_0x3c11e3[_0x6905('0x33')]=_0x3c11e3[_0x6905('0x33')][_0x6905('0x35')]?_0x3c11e3[_0x6905('0x33')]:_0xb5c223[_0x6905('0x32')];_0x3c11e3['order']=qs[_0x6905('0x37')](_0x197980[_0x6905('0x2f')][_0x6905('0x37')]);_0x3c11e3[_0x6905('0x38')]=qs[_0x6905('0x30')](_[_0x6905('0x39')](_0x197980[_0x6905('0x2f')],_0xb5c223['filters']));if(_0x197980['query'][_0x6905('0x3c')]){_0x3c11e3[_0x6905('0x38')]=_['merge'](_0x3c11e3[_0x6905('0x38')],{'$or':_[_0x6905('0x27')](_0x3c11e3['attributes'],function(_0xab97ee){var _0x13d2e4={};_0x13d2e4[_0xab97ee]={'$like':'%'+_0x197980[_0x6905('0x2f')][_0x6905('0x3c')]+'%'};return _0x13d2e4;})});}_0x3c11e3=_[_0x6905('0x3a')]({},_0x3c11e3,_0x197980[_0x6905('0x3d')]);return _0x226d77['getConfigurations'](_0x3c11e3);}})[_0x6905('0x22')](function(_0x22a0c5){if(_0x22a0c5){_0x5c83c0=_0x22a0c5[_0x6905('0x35')];if(!_0x197980['query'][_0x6905('0x49')](_0x6905('0x4a'))){_0x3c11e3['limit']=qs[_0x6905('0x1a')](_0x197980[_0x6905('0x2f')]['limit']);_0x3c11e3[_0x6905('0x18')]=qs[_0x6905('0x18')](_0x197980[_0x6905('0x2f')][_0x6905('0x18')]);}return _0x226d77[_0x6905('0x47')](_0x3c11e3);}})['then'](function(_0x123993){if(_0x123993){return _0x123993?{'count':_0x5c83c0,'rows':_0x123993}:null;}})[_0x6905('0x22')](respondWithResult(_0x3dc3e9,null))[_0x6905('0x40')](handleError(_0x3dc3e9,null));};exports['addConfiguration']=function(_0x46582a,_0x447dd7,_0x5aea2f){if(_0x46582a[_0x6905('0x44')]['id']){delete _0x46582a[_0x6905('0x44')]['id'];}return db['DeskAccount'][_0x6905('0x4b')]({'where':{'id':_0x46582a[_0x6905('0x46')]['id']}})['then'](handleEntityNotFound(_0x447dd7,null))[_0x6905('0x22')](function(_0x26fa75){if(_0x26fa75){_0x46582a[_0x6905('0x44')][_0x6905('0x4c')]=_0x26fa75['id'];_0x46582a['body'][_0x6905('0x4d')]=integrations[_0x6905('0x4e')](_0x46582a['body'][_0x6905('0x4f')],_0x46582a[_0x6905('0x44')][_0x6905('0x2b')]);_0x46582a[_0x6905('0x44')][_0x6905('0x50')]=integrations['getDescriptions'](_0x46582a[_0x6905('0x44')]['channel'],_0x46582a[_0x6905('0x44')]['type']);return db[_0x6905('0x48')][_0x6905('0x43')](_0x46582a[_0x6905('0x44')],{'include':[{'model':db[_0x6905('0x51')],'as':'Subjects'},{'model':db[_0x6905('0x51')],'as':_0x6905('0x50')}]});}return null;})[_0x6905('0x22')](respondWithResult(_0x447dd7,null))[_0x6905('0x40')](handleError(_0x447dd7,null));};exports[_0x6905('0x52')]=function(_0x1d9522,_0x367617,_0x320f1e){var _0x3f8f34=[{'name':_0x6905('0x53'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2aae62='';return db[_0x6905('0x28')][_0x6905('0x4b')]({'where':{'id':_0x1d9522[_0x6905('0x46')]['id']},'attributes':['id',_0x6905('0x54'),'authType',_0x6905('0x55'),_0x6905('0x56'),_0x6905('0x57'),_0x6905('0x58'),'token','tokenSecret']})[_0x6905('0x22')](handleEntityNotFound(_0x367617,null))[_0x6905('0x22')](function(_0x35762f){if(_0x35762f){_0x2aae62=_0x35762f[_0x6905('0x54')];var _0x3ff300=_0x2aae62[_0x6905('0x59')](-0x1);if(_0x3ff300==='/'){_0x2aae62=_0x2aae62[_0x6905('0x5a')](0x0,_0x2aae62[_0x6905('0x5b')](_0x3ff300));}var _0x35c457={'method':_0x6905('0x5c'),'uri':util[_0x6905('0x5d')](_0x6905('0x5e'),_0x2aae62),'headers':{'Content-Type':_0x6905('0x5f'),'Accept':_0x6905('0x5f')},'json':!![]};if(_0x35762f['authType']===_0x6905('0x60')){_0x35c457[_0x6905('0x61')]['Authorization']=util['format'](_0x6905('0x62'),new Buffer(util[_0x6905('0x5d')](_0x6905('0x63'),_0x35762f[_0x6905('0x55')],_0x35762f[_0x6905('0x56')]))['toString']('base64'));}return rp(_0x35c457)[_0x6905('0x22')](function(_0x4663bc){return _0x3f8f34[_0x6905('0x64')](_['map'](_0x4663bc[_0x6905('0x65')]['entries'],function(_0xb0420a){return{'id':_0xb0420a[_0x6905('0x2d')],'name':_0xb0420a[_0x6905('0x2d')],'type':_0xb0420a[_0x6905('0x2b')],'active':_0xb0420a[_0x6905('0x66')],'label':_0xb0420a[_0x6905('0x67')],'custom':!![]};}));});}})[_0x6905('0x22')](function(_0x2d2ae4){return{'count':_0x2d2ae4[_0x6905('0x35')],'rows':_0x2d2ae4};})['then'](respondWithResult(_0x367617,null))[_0x6905('0x40')](function(_0x14903d){var _0x412da7=_0x1d9522[_0x6905('0x2f')][_0x6905('0x68')]?0x1f4:_0x14903d[_0x6905('0x69')]||0x1f4;logger[_0x6905('0x23')](_0x6905('0x6a'),_0x6905('0x52'),_0x412da7,JSON['stringify'](_0x14903d));delete _0x14903d[_0x6905('0x2d')];if(_0x412da7===0x191){_0x412da7=0x190;}_0x367617['status'](_0x412da7)[_0x6905('0x25')](_0x1d9522[_0x6905('0x2f')][_0x6905('0x68')]?{'message':'Wrong\x20credentials','statusCode':_0x14903d['statusCode']}:_0x14903d);});};
\ No newline at end of file
index 6864e0a..8c3ae37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcafd=['lodash','util','../../config/logger','moment','bluebird','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','int_desk_accounts'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcafd,0x156));var _0xdcaf=function(_0x986c5a,_0xd6224e){_0x986c5a=_0x986c5a-0x0;var _0x2606db=_0xcafd[_0x986c5a];return _0x2606db;};'use strict';var _=require(_0xdcaf('0x0'));var util=require(_0xdcaf('0x1'));var logger=require(_0xdcaf('0x2'))('api');var moment=require(_0xdcaf('0x3'));var BPromise=require(_0xdcaf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdcaf('0x5'));var config=require('../../config/environment');var attributes=require(_0xdcaf('0x6'));var integrations=require(_0xdcaf('0x7'));module['exports']=function(_0x19d3fa,_0x1fe5fb){return _0x19d3fa['define']('DeskAccount',attributes,{'tableName':_0xdcaf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3282=['api','bluebird','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x3282,0x1c4));var _0x2328=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0x3282[_0x42fc8e];return _0x4ad7b5;};'use strict';var _=require(_0x2328('0x0'));var util=require(_0x2328('0x1'));var logger=require(_0x2328('0x2'))(_0x2328('0x3'));var moment=require('moment');var BPromise=require(_0x2328('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2328('0x5'));var rimraf=require(_0x2328('0x6'));var config=require('../../config/environment');var attributes=require(_0x2328('0x7'));var integrations=require(_0x2328('0x8'));module[_0x2328('0x9')]=function(_0x4eeb4a,_0x508a9f){return _0x4eeb4a[_0x2328('0xa')](_0x2328('0xb'),attributes,{'tableName':_0x2328('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7ec106a..402d0de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7459=['rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','attributes','limit','include','map','model','ShowDeskAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x7459,0x19d));var _0x9745=function(_0x8dcc2e,_0x4d086b){_0x8dcc2e=_0x8dcc2e-0x0;var _0x5c0f95=_0x7459[_0x8dcc2e];return _0x5c0f95;};'use strict';var _=require(_0x9745('0x0'));var util=require(_0x9745('0x1'));var moment=require('moment');var BPromise=require(_0x9745('0x2'));var rs=require(_0x9745('0x3'));var fs=require('fs');var Redis=require(_0x9745('0x4'));var db=require(_0x9745('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9745('0x6'))(_0x9745('0x7'));var config=require(_0x9745('0x8'));var jayson=require(_0x9745('0x9'));var client=jayson[_0x9745('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd708,_0x29e5a7,_0x4398f0){return new BPromise(function(_0x2a0ee2,_0x3c2032){return client[_0x9745('0xb')](_0x2fd708,_0x4398f0)[_0x9745('0xc')](function(_0xce0c46){logger[_0x9745('0xd')](_0x9745('0xe'),_0x29e5a7,'request\x20sent');logger[_0x9745('0xf')](_0x9745('0x10'),_0x29e5a7,_0x9745('0x11'),JSON[_0x9745('0x12')](_0xce0c46));if(_0xce0c46['error']){if(_0xce0c46['error'][_0x9745('0x13')]===0x1f4){logger[_0x9745('0x14')](_0x9745('0xe'),_0x29e5a7,_0xce0c46[_0x9745('0x14')][_0x9745('0x15')]);return _0x3c2032(_0xce0c46['error'][_0x9745('0x15')]);}logger[_0x9745('0x14')]('DeskAccount,\x20%s,\x20%s',_0x29e5a7,_0xce0c46['error'][_0x9745('0x15')]);return _0x2a0ee2(_0xce0c46[_0x9745('0x14')][_0x9745('0x15')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x29e5a7,_0x9745('0x11'));_0x2a0ee2(_0xce0c46['result'][_0x9745('0x15')]);}})[_0x9745('0x16')](function(_0x19e56f){logger[_0x9745('0x14')](_0x9745('0xe'),_0x29e5a7,_0x19e56f);_0x3c2032(_0x19e56f);});});}exports[_0x9745('0x17')]=function(_0x42fc6d){var _0x1f7e2e=this;return new Promise(function(_0x661fe5,_0x62a5aa){return db[_0x9745('0x18')][_0x9745('0x19')]({'raw':_0x42fc6d[_0x9745('0x1a')]?_0x42fc6d[_0x9745('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x42fc6d[_0x9745('0x1a')]?_0x42fc6d[_0x9745('0x1a')]['where']||null:null,'attributes':_0x42fc6d['options']?_0x42fc6d[_0x9745('0x1a')][_0x9745('0x1b')]||null:null,'limit':_0x42fc6d[_0x9745('0x1a')]?_0x42fc6d['options'][_0x9745('0x1c')]||null:null,'include':_0x42fc6d[_0x9745('0x1a')]?_0x42fc6d[_0x9745('0x1a')][_0x9745('0x1d')]?_[_0x9745('0x1e')](_0x42fc6d[_0x9745('0x1a')][_0x9745('0x1d')],function(_0x33f94a){return{'model':db[_0x33f94a[_0x9745('0x1f')]],'as':_0x33f94a['as'],'attributes':_0x33f94a['attributes'],'include':_0x33f94a[_0x9745('0x1d')]?_[_0x9745('0x1e')](_0x33f94a[_0x9745('0x1d')],function(_0x318721){return{'model':db[_0x318721[_0x9745('0x1f')]],'as':_0x318721['as'],'attributes':_0x318721[_0x9745('0x1b')],'include':_0x318721[_0x9745('0x1d')]?_['map'](_0x318721[_0x9745('0x1d')],function(_0x236285){return{'model':db[_0x236285[_0x9745('0x1f')]],'as':_0x236285['as'],'attributes':_0x236285[_0x9745('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9745('0xc')](function(_0x55cf70){logger[_0x9745('0xd')](_0x9745('0x17'),_0x42fc6d);logger['debug'](_0x9745('0x17'),_0x42fc6d,JSON[_0x9745('0x12')](_0x55cf70));_0x661fe5(_0x55cf70);})['catch'](function(_0x526898){logger[_0x9745('0x14')]('GetDeskAccount',_0x526898[_0x9745('0x15')],_0x42fc6d);_0x62a5aa(_0x1f7e2e[_0x9745('0x14')](0x1f4,_0x526898['message']));});});};exports[_0x9745('0x20')]=function(_0x44fc60){var _0x14bc66=this;return new Promise(function(_0x5a492c,_0x3b8880){return db[_0x9745('0x18')][_0x9745('0x21')]({'raw':_0x44fc60['options']?_0x44fc60[_0x9745('0x1a')][_0x9745('0x22')]===undefined?!![]:![]:!![],'where':_0x44fc60[_0x9745('0x1a')]?_0x44fc60[_0x9745('0x1a')]['where']||null:null,'attributes':_0x44fc60[_0x9745('0x1a')]?_0x44fc60[_0x9745('0x1a')][_0x9745('0x1b')]||null:null,'include':_0x44fc60[_0x9745('0x1a')]?_0x44fc60[_0x9745('0x1a')]['include']?_[_0x9745('0x1e')](_0x44fc60[_0x9745('0x1a')]['include'],function(_0x2996f5){return{'model':db[_0x2996f5[_0x9745('0x1f')]],'as':_0x2996f5['as'],'attributes':_0x2996f5[_0x9745('0x1b')],'include':_0x2996f5[_0x9745('0x1d')]?_['map'](_0x2996f5[_0x9745('0x1d')],function(_0x411772){return{'model':db[_0x411772[_0x9745('0x1f')]],'as':_0x411772['as'],'attributes':_0x411772[_0x9745('0x1b')],'include':_0x411772['include']?_[_0x9745('0x1e')](_0x411772[_0x9745('0x1d')],function(_0x5da3c3){return{'model':db[_0x5da3c3[_0x9745('0x1f')]],'as':_0x5da3c3['as'],'attributes':_0x5da3c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x9745('0xc')](function(_0x1c17c0){logger[_0x9745('0xd')]('ShowDeskAccount',_0x44fc60);logger[_0x9745('0xf')]('ShowDeskAccount',_0x44fc60,JSON['stringify'](_0x1c17c0));_0x5a492c(_0x1c17c0);})[_0x9745('0x16')](function(_0x235a99){logger[_0x9745('0x14')](_0x9745('0x20'),_0x235a99[_0x9745('0x15')],_0x44fc60);_0x3b8880(_0x14bc66[_0x9745('0x14')](0x1f4,_0x235a99[_0x9745('0x15')]));});});};
\ No newline at end of file
+var _0x5f28=['ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','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','raw','where','attributes','limit','include','model','map','info'];(function(_0x45d190,_0x10c8ad){var _0x2d76e1=function(_0x1e04b4){while(--_0x1e04b4){_0x45d190['push'](_0x45d190['shift']());}};_0x2d76e1(++_0x10c8ad);}(_0x5f28,0x119));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x85f2('0x0'));var util=require(_0x85f2('0x1'));var moment=require(_0x85f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x85f2('0x3'));var fs=require('fs');var Redis=require(_0x85f2('0x4'));var db=require(_0x85f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x85f2('0x6'))('rpc');var config=require(_0x85f2('0x7'));var jayson=require(_0x85f2('0x8'));var client=jayson['client'][_0x85f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cef5c,_0x3a505c,_0x255e84){return new BPromise(function(_0x170a31,_0x3d2f31){return client[_0x85f2('0xa')](_0x5cef5c,_0x255e84)[_0x85f2('0xb')](function(_0x111764){logger['info'](_0x85f2('0xc'),_0x3a505c,_0x85f2('0xd'));logger[_0x85f2('0xe')](_0x85f2('0xf'),_0x3a505c,_0x85f2('0xd'),JSON[_0x85f2('0x10')](_0x111764));if(_0x111764[_0x85f2('0x11')]){if(_0x111764['error'][_0x85f2('0x12')]===0x1f4){logger[_0x85f2('0x11')](_0x85f2('0xc'),_0x3a505c,_0x111764[_0x85f2('0x11')][_0x85f2('0x13')]);return _0x3d2f31(_0x111764[_0x85f2('0x11')][_0x85f2('0x13')]);}logger[_0x85f2('0x11')](_0x85f2('0xc'),_0x3a505c,_0x111764['error'][_0x85f2('0x13')]);return _0x170a31(_0x111764[_0x85f2('0x11')][_0x85f2('0x13')]);}else{logger['info'](_0x85f2('0xc'),_0x3a505c,_0x85f2('0xd'));_0x170a31(_0x111764[_0x85f2('0x14')][_0x85f2('0x13')]);}})[_0x85f2('0x15')](function(_0x25b837){logger['error'](_0x85f2('0xc'),_0x3a505c,_0x25b837);_0x3d2f31(_0x25b837);});});}exports[_0x85f2('0x16')]=function(_0x237246){var _0x3e89ff=this;return new Promise(function(_0x55642f,_0x5669ab){return db[_0x85f2('0x17')][_0x85f2('0x18')]({'raw':_0x237246[_0x85f2('0x19')]?_0x237246[_0x85f2('0x19')][_0x85f2('0x1a')]===undefined?!![]:![]:!![],'where':_0x237246[_0x85f2('0x19')]?_0x237246[_0x85f2('0x19')][_0x85f2('0x1b')]||null:null,'attributes':_0x237246[_0x85f2('0x19')]?_0x237246['options'][_0x85f2('0x1c')]||null:null,'limit':_0x237246['options']?_0x237246[_0x85f2('0x19')][_0x85f2('0x1d')]||null:null,'include':_0x237246[_0x85f2('0x19')]?_0x237246['options'][_0x85f2('0x1e')]?_['map'](_0x237246[_0x85f2('0x19')][_0x85f2('0x1e')],function(_0x3b1f41){return{'model':db[_0x3b1f41[_0x85f2('0x1f')]],'as':_0x3b1f41['as'],'attributes':_0x3b1f41[_0x85f2('0x1c')],'include':_0x3b1f41[_0x85f2('0x1e')]?_[_0x85f2('0x20')](_0x3b1f41[_0x85f2('0x1e')],function(_0x511dc8){return{'model':db[_0x511dc8[_0x85f2('0x1f')]],'as':_0x511dc8['as'],'attributes':_0x511dc8[_0x85f2('0x1c')],'include':_0x511dc8['include']?_[_0x85f2('0x20')](_0x511dc8[_0x85f2('0x1e')],function(_0x1aa855){return{'model':db[_0x1aa855['model']],'as':_0x1aa855['as'],'attributes':_0x1aa855['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x584a08){logger[_0x85f2('0x21')](_0x85f2('0x16'),_0x237246);logger[_0x85f2('0xe')](_0x85f2('0x16'),_0x237246,JSON[_0x85f2('0x10')](_0x584a08));_0x55642f(_0x584a08);})['catch'](function(_0x182f28){logger[_0x85f2('0x11')]('GetDeskAccount',_0x182f28[_0x85f2('0x13')],_0x237246);_0x5669ab(_0x3e89ff[_0x85f2('0x11')](0x1f4,_0x182f28[_0x85f2('0x13')]));});});};exports[_0x85f2('0x22')]=function(_0x43e9c5){var _0x447363=this;return new Promise(function(_0xef068e,_0x328717){return db['DeskAccount']['find']({'raw':_0x43e9c5['options']?_0x43e9c5[_0x85f2('0x19')][_0x85f2('0x1a')]===undefined?!![]:![]:!![],'where':_0x43e9c5[_0x85f2('0x19')]?_0x43e9c5['options']['where']||null:null,'attributes':_0x43e9c5['options']?_0x43e9c5[_0x85f2('0x19')][_0x85f2('0x1c')]||null:null,'include':_0x43e9c5[_0x85f2('0x19')]?_0x43e9c5[_0x85f2('0x19')][_0x85f2('0x1e')]?_['map'](_0x43e9c5[_0x85f2('0x19')][_0x85f2('0x1e')],function(_0x38c3c1){return{'model':db[_0x38c3c1['model']],'as':_0x38c3c1['as'],'attributes':_0x38c3c1[_0x85f2('0x1c')],'include':_0x38c3c1[_0x85f2('0x1e')]?_['map'](_0x38c3c1['include'],function(_0xd57882){return{'model':db[_0xd57882['model']],'as':_0xd57882['as'],'attributes':_0xd57882[_0x85f2('0x1c')],'include':_0xd57882[_0x85f2('0x1e')]?_['map'](_0xd57882['include'],function(_0x285dd6){return{'model':db[_0x285dd6[_0x85f2('0x1f')]],'as':_0x285dd6['as'],'attributes':_0x285dd6[_0x85f2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85f2('0xb')](function(_0xbf7a93){logger[_0x85f2('0x21')](_0x85f2('0x22'),_0x43e9c5);logger[_0x85f2('0xe')](_0x85f2('0x22'),_0x43e9c5,JSON[_0x85f2('0x10')](_0xbf7a93));_0xef068e(_0xbf7a93);})[_0x85f2('0x15')](function(_0x4d2cda){logger[_0x85f2('0x11')](_0x85f2('0x22'),_0x4d2cda[_0x85f2('0x13')],_0x43e9c5);_0x328717(_0x447363[_0x85f2('0x11')](0x1f4,_0x4d2cda[_0x85f2('0x13')]));});});};
\ No newline at end of file
index d830180..78427e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x55ca,0x126));var _0xa55c=function(_0x14090e,_0x30c2f7){_0x14090e=_0x14090e-0x0;var _0x554da7=_0x55ca[_0x14090e];return _0x554da7;};'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['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
+var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x55ca,0x126));var _0xa55c=function(_0x112147,_0x4e692e){_0x112147=_0x112147-0x0;var _0x3ba744=_0x55ca[_0x112147];return _0x3ba744;};'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['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
index fbe06ef..62ee854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa69f=['exports','STRING','sequelize'];(function(_0x19328a,_0x2fc17f){var _0x21e5a3=function(_0x578976){while(--_0x578976){_0x19328a['push'](_0x19328a['shift']());}};_0x21e5a3(++_0x2fc17f);}(_0xa69f,0x74));var _0xfa69=function(_0xd236d1,_0x1e4163){_0xd236d1=_0xd236d1-0x0;var _0x24e8a4=_0xa69f[_0xd236d1];return _0x24e8a4;};'use strict';var Sequelize=require(_0xfa69('0x0'));module[_0xfa69('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfa69('0x2')]}};
\ No newline at end of file
+var _0xf52c=['exports','STRING','sequelize'];(function(_0x2959a2,_0x2f6481){var _0x316b45=function(_0x2a60d1){while(--_0x2a60d1){_0x2959a2['push'](_0x2959a2['shift']());}};_0x316b45(++_0x2f6481);}(_0xf52c,0xd1));var _0xcf52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf52c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf52('0x0'));module[_0xcf52('0x1')]={'name':{'type':Sequelize[_0xcf52('0x2')]},'description':{'type':Sequelize[_0xcf52('0x2')]}};
\ No newline at end of file
index 2a54f3e..1e76065 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c8f=['then','destroy','error','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','keys','rawAttributes','length','includeAll','include','create','body','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9c8f,0xd9));var _0xf9c8=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x9c8f[_0x802997];return _0x35c641;};'use strict';var emlformat=require(_0xf9c8('0x0'));var rimraf=require(_0xf9c8('0x1'));var zipdir=require(_0xf9c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9c8('0x3'));var moment=require(_0xf9c8('0x4'));var BPromise=require(_0xf9c8('0x5'));var Mustache=require(_0xf9c8('0x6'));var util=require(_0xf9c8('0x7'));var path=require(_0xf9c8('0x8'));var sox=require(_0xf9c8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9c8('0xa'));var _=require(_0xf9c8('0xb'));var squel=require('squel');var crypto=require(_0xf9c8('0xc'));var jsforce=require(_0xf9c8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9c8('0xe'));var Papa=require(_0xf9c8('0xf'));var Redis=require(_0xf9c8('0x10'));var authService=require(_0xf9c8('0x11'));var qs=require(_0xf9c8('0x12'));var as=require(_0xf9c8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9c8('0x14'))(_0xf9c8('0x15'));var utils=require(_0xf9c8('0x16'));var config=require(_0xf9c8('0x17'));var licenseUtil=require(_0xf9c8('0x18'));var db=require(_0xf9c8('0x19'))['db'];function respondWithStatusCode(_0x2a5e02,_0xac876c){_0xac876c=_0xac876c||0xcc;return function(_0x394cf0){if(_0x394cf0){return _0x2a5e02[_0xf9c8('0x1a')](_0xac876c);}return _0x2a5e02[_0xf9c8('0x1b')](_0xac876c)[_0xf9c8('0x1c')]();};}function respondWithResult(_0x3b440c,_0x460077){_0x460077=_0x460077||0xc8;return function(_0x3c8f41){if(_0x3c8f41){return _0x3b440c[_0xf9c8('0x1b')](_0x460077)[_0xf9c8('0x1d')](_0x3c8f41);}};}function respondWithFilteredResult(_0x36853e,_0x2902af){return function(_0xb7146){if(_0xb7146){var _0x5a9cf1=typeof _0x2902af[_0xf9c8('0x1e')]===_0xf9c8('0x1f')&&typeof _0x2902af[_0xf9c8('0x20')]==='undefined';var _0x45d0aa=_0xb7146['count'];var _0x533b35=_0x5a9cf1?0x0:_0x2902af['offset'];var _0x270a4b=_0x5a9cf1?_0xb7146[_0xf9c8('0x21')]:_0x2902af[_0xf9c8('0x1e')]+_0x2902af[_0xf9c8('0x20')];var _0x3c07c8;if(_0x270a4b>=_0x45d0aa){_0x270a4b=_0x45d0aa;_0x3c07c8=0xc8;}else{_0x3c07c8=0xce;}_0x36853e[_0xf9c8('0x1b')](_0x3c07c8);return _0x36853e['set'](_0xf9c8('0x22'),_0x533b35+'-'+_0x270a4b+'/'+_0x45d0aa)[_0xf9c8('0x1d')](_0xb7146);}return null;};}function patchUpdates(_0x9367c6){return function(_0x37d80d){try{jsonpatch[_0xf9c8('0x23')](_0x37d80d,_0x9367c6,!![]);}catch(_0x128fe9){return BPromise[_0xf9c8('0x24')](_0x128fe9);}return _0x37d80d['save']();};}function saveUpdates(_0x340c61,_0x72350){return function(_0x1b4489){if(_0x1b4489){return _0x1b4489[_0xf9c8('0x25')](_0x340c61)[_0xf9c8('0x26')](function(_0x478290){return _0x478290;});}return null;};}function removeEntity(_0x1df77c,_0x20dbb9){return function(_0x42f72f){if(_0x42f72f){return _0x42f72f[_0xf9c8('0x27')]()[_0xf9c8('0x26')](function(){_0x1df77c[_0xf9c8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f10e9,_0x1ee274){return function(_0x19d239){if(!_0x19d239){_0x1f10e9[_0xf9c8('0x1a')](0x194);}return _0x19d239;};}function handleError(_0x14d9ab,_0x319bfb){_0x319bfb=_0x319bfb||0x1f4;return function(_0x1adb67){logger[_0xf9c8('0x28')](_0x1adb67['stack']);if(_0x1adb67[_0xf9c8('0x29')]){delete _0x1adb67[_0xf9c8('0x29')];}_0x14d9ab[_0xf9c8('0x1b')](_0x319bfb)[_0xf9c8('0x2a')](_0x1adb67);};}exports[_0xf9c8('0x2b')]=function(_0x2fcf09,_0x3f576d){var _0x4ad7e2={},_0x5261a4={},_0x298d05={'count':0x0,'rows':[]};var _0x112158=_[_0xf9c8('0x2c')](db[_0xf9c8('0x2d')]['rawAttributes'],function(_0x4a012c){return{'name':_0x4a012c[_0xf9c8('0x2e')],'type':_0x4a012c[_0xf9c8('0x2f')][_0xf9c8('0x30')]};});_0x5261a4[_0xf9c8('0x31')]=_[_0xf9c8('0x2c')](_0x112158,_0xf9c8('0x29'));_0x5261a4[_0xf9c8('0x32')]=_['keys'](_0x2fcf09[_0xf9c8('0x32')]);_0x5261a4[_0xf9c8('0x33')]=_['intersection'](_0x5261a4['model'],_0x5261a4['query']);_0x4ad7e2[_0xf9c8('0x34')]=_[_0xf9c8('0x35')](_0x5261a4['model'],qs[_0xf9c8('0x36')](_0x2fcf09[_0xf9c8('0x32')][_0xf9c8('0x36')]));_0x4ad7e2['attributes']=_0x4ad7e2['attributes']['length']?_0x4ad7e2[_0xf9c8('0x34')]:_0x5261a4[_0xf9c8('0x31')];if(!_0x2fcf09['query'][_0xf9c8('0x37')](_0xf9c8('0x38'))){_0x4ad7e2['limit']=qs[_0xf9c8('0x20')](_0x2fcf09[_0xf9c8('0x32')][_0xf9c8('0x20')]);_0x4ad7e2[_0xf9c8('0x1e')]=qs[_0xf9c8('0x1e')](_0x2fcf09[_0xf9c8('0x32')][_0xf9c8('0x1e')]);}_0x4ad7e2[_0xf9c8('0x39')]=qs[_0xf9c8('0x3a')](_0x2fcf09[_0xf9c8('0x32')][_0xf9c8('0x3a')]);_0x4ad7e2[_0xf9c8('0x3b')]=qs['filters'](_[_0xf9c8('0x3c')](_0x2fcf09['query'],_0x5261a4[_0xf9c8('0x33')]),_0x112158);if(_0x2fcf09[_0xf9c8('0x32')][_0xf9c8('0x3d')]){_0x4ad7e2['where']=_['merge'](_0x4ad7e2[_0xf9c8('0x3b')],{'$or':_['map'](_0x112158,function(_0x20dab6){if(_0x20dab6['type']!==_0xf9c8('0x3e')){var _0x56432b={};_0x56432b[_0x20dab6[_0xf9c8('0x29')]]={'$like':'%'+_0x2fcf09['query'][_0xf9c8('0x3d')]+'%'};return _0x56432b;}})});}_0x4ad7e2=_[_0xf9c8('0x3f')]({},_0x4ad7e2,_0x2fcf09[_0xf9c8('0x40')]);var _0xb39243={'where':_0x4ad7e2[_0xf9c8('0x3b')]};return db[_0xf9c8('0x2d')]['count'](_0xb39243)['then'](function(_0x5e6623){_0x298d05['count']=_0x5e6623;if(_0x2fcf09[_0xf9c8('0x32')]['includeAll']){_0x4ad7e2['include']=[{'all':!![]}];}return db[_0xf9c8('0x2d')][_0xf9c8('0x41')](_0x4ad7e2);})[_0xf9c8('0x26')](function(_0x525cdc){_0x298d05['rows']=_0x525cdc;return _0x298d05;})[_0xf9c8('0x26')](respondWithFilteredResult(_0x3f576d,_0x4ad7e2))[_0xf9c8('0x42')](handleError(_0x3f576d,null));};exports[_0xf9c8('0x43')]=function(_0x4fc51b,_0xf5efa6){var _0x2b15c6={'raw':![],'where':{'id':_0x4fc51b[_0xf9c8('0x44')]['id']}},_0x52a48d={};_0x52a48d['model']=_[_0xf9c8('0x45')](db[_0xf9c8('0x2d')][_0xf9c8('0x46')]);_0x52a48d[_0xf9c8('0x32')]=_[_0xf9c8('0x45')](_0x4fc51b[_0xf9c8('0x32')]);_0x52a48d[_0xf9c8('0x33')]=_[_0xf9c8('0x35')](_0x52a48d['model'],_0x52a48d[_0xf9c8('0x32')]);_0x2b15c6[_0xf9c8('0x34')]=_['intersection'](_0x52a48d['model'],qs[_0xf9c8('0x36')](_0x4fc51b['query'][_0xf9c8('0x36')]));_0x2b15c6[_0xf9c8('0x34')]=_0x2b15c6[_0xf9c8('0x34')][_0xf9c8('0x47')]?_0x2b15c6[_0xf9c8('0x34')]:_0x52a48d[_0xf9c8('0x31')];if(_0x4fc51b['query'][_0xf9c8('0x48')]){_0x2b15c6[_0xf9c8('0x49')]=[{'all':!![]}];}_0x2b15c6=_['merge']({},_0x2b15c6,_0x4fc51b['options']);return db[_0xf9c8('0x2d')]['find'](_0x2b15c6)['then'](handleEntityNotFound(_0xf5efa6,null))['then'](respondWithResult(_0xf5efa6,null))['catch'](handleError(_0xf5efa6,null));};exports[_0xf9c8('0x4a')]=function(_0x4f4bae,_0x554e41){return db[_0xf9c8('0x2d')]['create'](_0x4f4bae[_0xf9c8('0x4b')],{})[_0xf9c8('0x26')](respondWithResult(_0x554e41,0xc9))['catch'](handleError(_0x554e41,null));};exports[_0xf9c8('0x25')]=function(_0x578fbb,_0x4e5f24){if(_0x578fbb[_0xf9c8('0x4b')]['id']){delete _0x578fbb[_0xf9c8('0x4b')]['id'];}return db[_0xf9c8('0x2d')]['find']({'where':{'id':_0x578fbb[_0xf9c8('0x44')]['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x4e5f24,null))[_0xf9c8('0x26')](saveUpdates(_0x578fbb[_0xf9c8('0x4b')],null))[_0xf9c8('0x26')](respondWithResult(_0x4e5f24,null))['catch'](handleError(_0x4e5f24,null));};exports[_0xf9c8('0x27')]=function(_0x561428,_0x44ff64){return db[_0xf9c8('0x2d')]['find']({'where':{'id':_0x561428[_0xf9c8('0x44')]['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x44ff64,null))[_0xf9c8('0x26')](removeEntity(_0x44ff64,null))[_0xf9c8('0x42')](handleError(_0x44ff64,null));};exports[_0xf9c8('0x4c')]=function(_0x21ff61,_0x517cbe,_0x37440e){var _0x23a749={};var _0x65a78f={};var _0x19da8c;var _0x133015;return db[_0xf9c8('0x2d')]['findOne']({'where':{'id':_0x21ff61[_0xf9c8('0x44')]['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x517cbe,null))[_0xf9c8('0x26')](function(_0x3ff8cc){if(_0x3ff8cc){_0x19da8c=_0x3ff8cc;_0x65a78f[_0xf9c8('0x31')]=_[_0xf9c8('0x45')](db[_0xf9c8('0x4d')][_0xf9c8('0x46')]);_0x65a78f['query']=_[_0xf9c8('0x45')](_0x21ff61[_0xf9c8('0x32')]);_0x65a78f[_0xf9c8('0x33')]=_['intersection'](_0x65a78f['model'],_0x65a78f[_0xf9c8('0x32')]);_0x23a749[_0xf9c8('0x34')]=_[_0xf9c8('0x35')](_0x65a78f['model'],qs['fields'](_0x21ff61[_0xf9c8('0x32')][_0xf9c8('0x36')]));_0x23a749[_0xf9c8('0x34')]=_0x23a749['attributes'][_0xf9c8('0x47')]?_0x23a749['attributes']:_0x65a78f['model'];_0x23a749[_0xf9c8('0x39')]=qs[_0xf9c8('0x3a')](_0x21ff61[_0xf9c8('0x32')][_0xf9c8('0x3a')]);_0x23a749[_0xf9c8('0x3b')]=qs['filters'](_[_0xf9c8('0x3c')](_0x21ff61[_0xf9c8('0x32')],_0x65a78f[_0xf9c8('0x33')]));if(_0x21ff61['query']['filter']){_0x23a749['where']=_[_0xf9c8('0x3f')](_0x23a749[_0xf9c8('0x3b')],{'$or':_[_0xf9c8('0x2c')](_0x23a749['attributes'],function(_0x416d6a){var _0x2e13a5={};_0x2e13a5[_0x416d6a]={'$like':'%'+_0x21ff61[_0xf9c8('0x32')][_0xf9c8('0x3d')]+'%'};return _0x2e13a5;})});}_0x23a749=_[_0xf9c8('0x3f')]({},_0x23a749,_0x21ff61[_0xf9c8('0x40')]);return _0x19da8c[_0xf9c8('0x4c')](_0x23a749);}})[_0xf9c8('0x26')](function(_0x4c1feb){if(_0x4c1feb){_0x133015=_0x4c1feb['length'];if(!_0x21ff61[_0xf9c8('0x32')][_0xf9c8('0x37')]('nolimit')){_0x23a749[_0xf9c8('0x20')]=qs[_0xf9c8('0x20')](_0x21ff61[_0xf9c8('0x32')]['limit']);_0x23a749['offset']=qs[_0xf9c8('0x1e')](_0x21ff61['query']['offset']);}return _0x19da8c[_0xf9c8('0x4c')](_0x23a749);}})[_0xf9c8('0x26')](function(_0x379f20){if(_0x379f20){return _0x379f20?{'count':_0x133015,'rows':_0x379f20}:null;}})[_0xf9c8('0x26')](respondWithResult(_0x517cbe,null))[_0xf9c8('0x42')](handleError(_0x517cbe,null));};exports[_0xf9c8('0x4e')]=function(_0x131592,_0x5983c4,_0x376f1e){var _0xd3a189={};var _0x3e0af7={};var _0x1dd512;var _0x3886be;return db[_0xf9c8('0x2d')][_0xf9c8('0x4f')]({'where':{'id':_0x131592[_0xf9c8('0x44')]['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x5983c4,null))[_0xf9c8('0x26')](function(_0x38246c){if(_0x38246c){_0x1dd512=_0x38246c;_0x3e0af7[_0xf9c8('0x31')]=_[_0xf9c8('0x45')](db['DeskField']['rawAttributes']);_0x3e0af7['query']=_[_0xf9c8('0x45')](_0x131592[_0xf9c8('0x32')]);_0x3e0af7[_0xf9c8('0x33')]=_[_0xf9c8('0x35')](_0x3e0af7[_0xf9c8('0x31')],_0x3e0af7[_0xf9c8('0x32')]);_0xd3a189['attributes']=_['intersection'](_0x3e0af7[_0xf9c8('0x31')],qs[_0xf9c8('0x36')](_0x131592['query'][_0xf9c8('0x36')]));_0xd3a189[_0xf9c8('0x34')]=_0xd3a189[_0xf9c8('0x34')]['length']?_0xd3a189[_0xf9c8('0x34')]:_0x3e0af7[_0xf9c8('0x31')];_0xd3a189[_0xf9c8('0x39')]=qs['sort'](_0x131592[_0xf9c8('0x32')][_0xf9c8('0x3a')]);_0xd3a189[_0xf9c8('0x3b')]=qs[_0xf9c8('0x33')](_[_0xf9c8('0x3c')](_0x131592[_0xf9c8('0x32')],_0x3e0af7[_0xf9c8('0x33')]));if(_0x131592['query']['filter']){_0xd3a189[_0xf9c8('0x3b')]=_[_0xf9c8('0x3f')](_0xd3a189[_0xf9c8('0x3b')],{'$or':_[_0xf9c8('0x2c')](_0xd3a189[_0xf9c8('0x34')],function(_0xf15cbf){var _0x5e60d2={};_0x5e60d2[_0xf15cbf]={'$like':'%'+_0x131592[_0xf9c8('0x32')][_0xf9c8('0x3d')]+'%'};return _0x5e60d2;})});}_0xd3a189=_['merge']({},_0xd3a189,_0x131592['options']);return _0x1dd512[_0xf9c8('0x4e')](_0xd3a189);}})[_0xf9c8('0x26')](function(_0x287944){if(_0x287944){_0x3886be=_0x287944[_0xf9c8('0x47')];if(!_0x131592[_0xf9c8('0x32')][_0xf9c8('0x37')](_0xf9c8('0x38'))){_0xd3a189['limit']=qs[_0xf9c8('0x20')](_0x131592[_0xf9c8('0x32')][_0xf9c8('0x20')]);_0xd3a189[_0xf9c8('0x1e')]=qs[_0xf9c8('0x1e')](_0x131592[_0xf9c8('0x32')]['offset']);}return _0x1dd512['getSubjects'](_0xd3a189);}})['then'](function(_0xe7e347){if(_0xe7e347){return _0xe7e347?{'count':_0x3886be,'rows':_0xe7e347}:null;}})[_0xf9c8('0x26')](respondWithResult(_0x5983c4,null))['catch'](handleError(_0x5983c4,null));};exports[_0xf9c8('0x50')]=function(_0xd44cfd,_0x11c525,_0x5b2c3f){var _0x1f5f58={};var _0x52abba={};var _0x41fed6;var _0x2d6895;return db['DeskConfiguration'][_0xf9c8('0x4f')]({'where':{'id':_0xd44cfd['params']['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x11c525,null))[_0xf9c8('0x26')](function(_0x51030a){if(_0x51030a){_0x41fed6=_0x51030a;_0x52abba[_0xf9c8('0x31')]=_[_0xf9c8('0x45')](db[_0xf9c8('0x4d')]['rawAttributes']);_0x52abba[_0xf9c8('0x32')]=_[_0xf9c8('0x45')](_0xd44cfd['query']);_0x52abba['filters']=_[_0xf9c8('0x35')](_0x52abba[_0xf9c8('0x31')],_0x52abba[_0xf9c8('0x32')]);_0x1f5f58[_0xf9c8('0x34')]=_[_0xf9c8('0x35')](_0x52abba[_0xf9c8('0x31')],qs[_0xf9c8('0x36')](_0xd44cfd[_0xf9c8('0x32')]['fields']));_0x1f5f58[_0xf9c8('0x34')]=_0x1f5f58[_0xf9c8('0x34')][_0xf9c8('0x47')]?_0x1f5f58[_0xf9c8('0x34')]:_0x52abba[_0xf9c8('0x31')];_0x1f5f58['order']=qs[_0xf9c8('0x3a')](_0xd44cfd[_0xf9c8('0x32')][_0xf9c8('0x3a')]);_0x1f5f58['where']=qs['filters'](_[_0xf9c8('0x3c')](_0xd44cfd[_0xf9c8('0x32')],_0x52abba[_0xf9c8('0x33')]));if(_0xd44cfd[_0xf9c8('0x32')][_0xf9c8('0x3d')]){_0x1f5f58[_0xf9c8('0x3b')]=_[_0xf9c8('0x3f')](_0x1f5f58[_0xf9c8('0x3b')],{'$or':_[_0xf9c8('0x2c')](_0x1f5f58[_0xf9c8('0x34')],function(_0x3310af){var _0x2ad936={};_0x2ad936[_0x3310af]={'$like':'%'+_0xd44cfd[_0xf9c8('0x32')][_0xf9c8('0x3d')]+'%'};return _0x2ad936;})});}_0x1f5f58=_[_0xf9c8('0x3f')]({},_0x1f5f58,_0xd44cfd[_0xf9c8('0x40')]);return _0x41fed6[_0xf9c8('0x50')](_0x1f5f58);}})['then'](function(_0x2d3721){if(_0x2d3721){_0x2d6895=_0x2d3721[_0xf9c8('0x47')];if(!_0xd44cfd[_0xf9c8('0x32')]['hasOwnProperty'](_0xf9c8('0x38'))){_0x1f5f58['limit']=qs['limit'](_0xd44cfd[_0xf9c8('0x32')][_0xf9c8('0x20')]);_0x1f5f58[_0xf9c8('0x1e')]=qs[_0xf9c8('0x1e')](_0xd44cfd[_0xf9c8('0x32')][_0xf9c8('0x1e')]);}return _0x41fed6[_0xf9c8('0x50')](_0x1f5f58);}})[_0xf9c8('0x26')](function(_0x3e2ab0){if(_0x3e2ab0){return _0x3e2ab0?{'count':_0x2d6895,'rows':_0x3e2ab0}:null;}})[_0xf9c8('0x26')](respondWithResult(_0x11c525,null))['catch'](handleError(_0x11c525,null));};exports[_0xf9c8('0x51')]=function(_0x39e89f,_0x53771b,_0x2d2410){var _0x1e1f86={};var _0x3cd6bc={};var _0x31083c;var _0x32d386;return db['DeskConfiguration'][_0xf9c8('0x4f')]({'where':{'id':_0x39e89f['params']['id']}})[_0xf9c8('0x26')](handleEntityNotFound(_0x53771b,null))[_0xf9c8('0x26')](function(_0x4ebc1f){if(_0x4ebc1f){_0x31083c=_0x4ebc1f;_0x3cd6bc['model']=_[_0xf9c8('0x45')](db[_0xf9c8('0x52')][_0xf9c8('0x46')]);_0x3cd6bc[_0xf9c8('0x32')]=_[_0xf9c8('0x45')](_0x39e89f[_0xf9c8('0x32')]);_0x3cd6bc[_0xf9c8('0x33')]=_[_0xf9c8('0x35')](_0x3cd6bc[_0xf9c8('0x31')],_0x3cd6bc['query']);_0x1e1f86[_0xf9c8('0x34')]=_[_0xf9c8('0x35')](_0x3cd6bc[_0xf9c8('0x31')],qs[_0xf9c8('0x36')](_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x36')]));_0x1e1f86[_0xf9c8('0x34')]=_0x1e1f86[_0xf9c8('0x34')][_0xf9c8('0x47')]?_0x1e1f86['attributes']:_0x3cd6bc[_0xf9c8('0x31')];_0x1e1f86[_0xf9c8('0x39')]=qs['sort'](_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x3a')]);_0x1e1f86[_0xf9c8('0x3b')]=qs[_0xf9c8('0x33')](_['pick'](_0x39e89f[_0xf9c8('0x32')],_0x3cd6bc[_0xf9c8('0x33')]));if(_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x3d')]){_0x1e1f86[_0xf9c8('0x3b')]=_[_0xf9c8('0x3f')](_0x1e1f86['where'],{'$or':_['map'](_0x1e1f86[_0xf9c8('0x34')],function(_0x2edae0){var _0x4e85bc={};_0x4e85bc[_0x2edae0]={'$like':'%'+_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x3d')]+'%'};return _0x4e85bc;})});}_0x1e1f86=_[_0xf9c8('0x3f')]({},_0x1e1f86,_0x39e89f[_0xf9c8('0x40')]);return _0x31083c['getTags'](_0x1e1f86);}})['then'](function(_0x23251e){if(_0x23251e){_0x32d386=_0x23251e[_0xf9c8('0x47')];if(!_0x39e89f[_0xf9c8('0x32')]['hasOwnProperty'](_0xf9c8('0x38'))){_0x1e1f86[_0xf9c8('0x20')]=qs[_0xf9c8('0x20')](_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x20')]);_0x1e1f86[_0xf9c8('0x1e')]=qs[_0xf9c8('0x1e')](_0x39e89f[_0xf9c8('0x32')][_0xf9c8('0x1e')]);}return _0x31083c['getTags'](_0x1e1f86);}})[_0xf9c8('0x26')](function(_0x1143bb){if(_0x1143bb){return _0x1143bb?{'count':_0x32d386,'rows':_0x1143bb}:null;}})[_0xf9c8('0x26')](respondWithResult(_0x53771b,null))['catch'](handleError(_0x53771b,null));};exports[_0xf9c8('0x53')]=function(_0x2e2877,_0x417ff7,_0x290f8e){if(_0x2e2877[_0xf9c8('0x4b')]['id']){delete _0x2e2877[_0xf9c8('0x4b')]['id'];}return db[_0xf9c8('0x2d')]['findOne']({'where':{'id':_0x2e2877[_0xf9c8('0x44')]['id']}})['then'](handleEntityNotFound(_0x417ff7,null))[_0xf9c8('0x26')](function(_0x1a83d2){if(_0x1a83d2){return _0x1a83d2[_0xf9c8('0x53')](_0x2e2877[_0xf9c8('0x4b')][_0xf9c8('0x54')]||[]);}return null;})[_0xf9c8('0x26')](respondWithResult(_0x417ff7,null))[_0xf9c8('0x42')](handleError(_0x417ff7,null));};
\ No newline at end of file
+var _0x11d5=['DeskField','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','end','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','rawAttributes','includeAll','options','create','body','update','find','params','getFields','findOne'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0x11d5,0xa9));var _0x511d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x11d5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x511d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x511d('0x1'));var rp=require('request-promise');var moment=require(_0x511d('0x2'));var BPromise=require(_0x511d('0x3'));var Mustache=require('mustache');var util=require(_0x511d('0x4'));var path=require(_0x511d('0x5'));var sox=require(_0x511d('0x6'));var csv=require(_0x511d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x511d('0x8'));var _=require(_0x511d('0x9'));var squel=require(_0x511d('0xa'));var crypto=require('crypto');var jsforce=require(_0x511d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x511d('0x7'));var querystring=require(_0x511d('0xc'));var Papa=require(_0x511d('0xd'));var Redis=require('ioredis');var authService=require(_0x511d('0xe'));var qs=require(_0x511d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x511d('0x10'));var logger=require(_0x511d('0x11'))(_0x511d('0x12'));var utils=require(_0x511d('0x13'));var config=require(_0x511d('0x14'));var licenseUtil=require(_0x511d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53bb62,_0x398ae6){_0x398ae6=_0x398ae6||0xcc;return function(_0x53602c){if(_0x53602c){return _0x53bb62[_0x511d('0x16')](_0x398ae6);}return _0x53bb62[_0x511d('0x17')](_0x398ae6)['end']();};}function respondWithResult(_0x2e8b72,_0x21272a){_0x21272a=_0x21272a||0xc8;return function(_0x4040c0){if(_0x4040c0){return _0x2e8b72[_0x511d('0x17')](_0x21272a)[_0x511d('0x18')](_0x4040c0);}};}function respondWithFilteredResult(_0x4b2d43,_0x235c9f){return function(_0x106291){if(_0x106291){var _0x222888=typeof _0x235c9f[_0x511d('0x19')]===_0x511d('0x1a')&&typeof _0x235c9f[_0x511d('0x1b')]===_0x511d('0x1a');var _0x4d8d63=_0x106291[_0x511d('0x1c')];var _0x2b20f2=_0x222888?0x0:_0x235c9f[_0x511d('0x19')];var _0x285e1c=_0x222888?_0x106291['count']:_0x235c9f[_0x511d('0x19')]+_0x235c9f[_0x511d('0x1b')];var _0x5e7a7c;if(_0x285e1c>=_0x4d8d63){_0x285e1c=_0x4d8d63;_0x5e7a7c=0xc8;}else{_0x5e7a7c=0xce;}_0x4b2d43[_0x511d('0x17')](_0x5e7a7c);return _0x4b2d43[_0x511d('0x1d')]('Content-Range',_0x2b20f2+'-'+_0x285e1c+'/'+_0x4d8d63)[_0x511d('0x18')](_0x106291);}return null;};}function patchUpdates(_0x4f632a){return function(_0x40a763){try{jsonpatch['apply'](_0x40a763,_0x4f632a,!![]);}catch(_0x44b4fd){return BPromise['reject'](_0x44b4fd);}return _0x40a763[_0x511d('0x1e')]();};}function saveUpdates(_0x45699a,_0x334db6){return function(_0x4f3fbf){if(_0x4f3fbf){return _0x4f3fbf['update'](_0x45699a)[_0x511d('0x1f')](function(_0x2fc9dd){return _0x2fc9dd;});}return null;};}function removeEntity(_0x37f7e7,_0x4b401c){return function(_0x119660){if(_0x119660){return _0x119660[_0x511d('0x20')]()['then'](function(){_0x37f7e7[_0x511d('0x17')](0xcc)[_0x511d('0x21')]();});}};}function handleEntityNotFound(_0x2977f2,_0x4b1000){return function(_0x128d6d){if(!_0x128d6d){_0x2977f2[_0x511d('0x16')](0x194);}return _0x128d6d;};}function handleError(_0x3bbaba,_0x2c8c7f){_0x2c8c7f=_0x2c8c7f||0x1f4;return function(_0x30aabd){logger[_0x511d('0x22')](_0x30aabd[_0x511d('0x23')]);if(_0x30aabd[_0x511d('0x24')]){delete _0x30aabd[_0x511d('0x24')];}_0x3bbaba[_0x511d('0x17')](_0x2c8c7f)[_0x511d('0x25')](_0x30aabd);};}exports[_0x511d('0x26')]=function(_0x51eda6,_0x6f832e){var _0x4f9ee7={},_0x42417d={},_0x343c43={'count':0x0,'rows':[]};var _0x59a037=_[_0x511d('0x27')](db[_0x511d('0x28')]['rawAttributes'],function(_0x356458){return{'name':_0x356458[_0x511d('0x29')],'type':_0x356458[_0x511d('0x2a')]['key']};});_0x42417d[_0x511d('0x2b')]=_['map'](_0x59a037,_0x511d('0x24'));_0x42417d[_0x511d('0x2c')]=_[_0x511d('0x2d')](_0x51eda6[_0x511d('0x2c')]);_0x42417d[_0x511d('0x2e')]=_[_0x511d('0x2f')](_0x42417d[_0x511d('0x2b')],_0x42417d['query']);_0x4f9ee7['attributes']=_[_0x511d('0x2f')](_0x42417d[_0x511d('0x2b')],qs[_0x511d('0x30')](_0x51eda6[_0x511d('0x2c')][_0x511d('0x30')]));_0x4f9ee7[_0x511d('0x31')]=_0x4f9ee7[_0x511d('0x31')][_0x511d('0x32')]?_0x4f9ee7['attributes']:_0x42417d[_0x511d('0x2b')];if(!_0x51eda6[_0x511d('0x2c')][_0x511d('0x33')]('nolimit')){_0x4f9ee7['limit']=qs[_0x511d('0x1b')](_0x51eda6[_0x511d('0x2c')][_0x511d('0x1b')]);_0x4f9ee7['offset']=qs[_0x511d('0x19')](_0x51eda6[_0x511d('0x2c')][_0x511d('0x19')]);}_0x4f9ee7[_0x511d('0x34')]=qs[_0x511d('0x35')](_0x51eda6[_0x511d('0x2c')][_0x511d('0x35')]);_0x4f9ee7[_0x511d('0x36')]=qs['filters'](_[_0x511d('0x37')](_0x51eda6['query'],_0x42417d[_0x511d('0x2e')]),_0x59a037);if(_0x51eda6[_0x511d('0x2c')][_0x511d('0x38')]){_0x4f9ee7['where']=_['merge'](_0x4f9ee7[_0x511d('0x36')],{'$or':_[_0x511d('0x27')](_0x59a037,function(_0x5283d6){if(_0x5283d6[_0x511d('0x2a')]!==_0x511d('0x39')){var _0x86fe84={};_0x86fe84[_0x5283d6['name']]={'$like':'%'+_0x51eda6[_0x511d('0x2c')][_0x511d('0x38')]+'%'};return _0x86fe84;}})});}_0x4f9ee7=_[_0x511d('0x3a')]({},_0x4f9ee7,_0x51eda6['options']);var _0x48d0c9={'where':_0x4f9ee7[_0x511d('0x36')]};return db[_0x511d('0x28')][_0x511d('0x1c')](_0x48d0c9)['then'](function(_0x3be638){_0x343c43[_0x511d('0x1c')]=_0x3be638;if(_0x51eda6[_0x511d('0x2c')]['includeAll']){_0x4f9ee7[_0x511d('0x3b')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x511d('0x3c')](_0x4f9ee7);})[_0x511d('0x1f')](function(_0x5d8c1d){_0x343c43[_0x511d('0x3d')]=_0x5d8c1d;return _0x343c43;})['then'](respondWithFilteredResult(_0x6f832e,_0x4f9ee7))[_0x511d('0x3e')](handleError(_0x6f832e,null));};exports[_0x511d('0x3f')]=function(_0x473e63,_0x4d29a1){var _0x122c5f={'raw':![],'where':{'id':_0x473e63['params']['id']}},_0x17254c={};_0x17254c['model']=_[_0x511d('0x2d')](db[_0x511d('0x28')][_0x511d('0x40')]);_0x17254c[_0x511d('0x2c')]=_[_0x511d('0x2d')](_0x473e63[_0x511d('0x2c')]);_0x17254c[_0x511d('0x2e')]=_[_0x511d('0x2f')](_0x17254c[_0x511d('0x2b')],_0x17254c[_0x511d('0x2c')]);_0x122c5f['attributes']=_[_0x511d('0x2f')](_0x17254c[_0x511d('0x2b')],qs[_0x511d('0x30')](_0x473e63[_0x511d('0x2c')][_0x511d('0x30')]));_0x122c5f['attributes']=_0x122c5f['attributes'][_0x511d('0x32')]?_0x122c5f[_0x511d('0x31')]:_0x17254c[_0x511d('0x2b')];if(_0x473e63['query'][_0x511d('0x41')]){_0x122c5f['include']=[{'all':!![]}];}_0x122c5f=_['merge']({},_0x122c5f,_0x473e63[_0x511d('0x42')]);return db[_0x511d('0x28')]['find'](_0x122c5f)[_0x511d('0x1f')](handleEntityNotFound(_0x4d29a1,null))['then'](respondWithResult(_0x4d29a1,null))[_0x511d('0x3e')](handleError(_0x4d29a1,null));};exports['create']=function(_0x4fce9b,_0x33a1ec){return db['DeskConfiguration'][_0x511d('0x43')](_0x4fce9b[_0x511d('0x44')],{})['then'](respondWithResult(_0x33a1ec,0xc9))['catch'](handleError(_0x33a1ec,null));};exports[_0x511d('0x45')]=function(_0xe061ae,_0x5115bc){if(_0xe061ae[_0x511d('0x44')]['id']){delete _0xe061ae[_0x511d('0x44')]['id'];}return db[_0x511d('0x28')][_0x511d('0x46')]({'where':{'id':_0xe061ae[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x5115bc,null))['then'](saveUpdates(_0xe061ae[_0x511d('0x44')],null))['then'](respondWithResult(_0x5115bc,null))[_0x511d('0x3e')](handleError(_0x5115bc,null));};exports[_0x511d('0x20')]=function(_0x11f5cd,_0x5b776a){return db['DeskConfiguration'][_0x511d('0x46')]({'where':{'id':_0x11f5cd[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x5b776a,null))['then'](removeEntity(_0x5b776a,null))[_0x511d('0x3e')](handleError(_0x5b776a,null));};exports[_0x511d('0x48')]=function(_0x1144bf,_0x1813bf,_0x24d20d){var _0x303a80={};var _0x523d47={};var _0x1e5e2d;var _0x3c7ea3;return db[_0x511d('0x28')][_0x511d('0x49')]({'where':{'id':_0x1144bf[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x1813bf,null))['then'](function(_0x3d58fb){if(_0x3d58fb){_0x1e5e2d=_0x3d58fb;_0x523d47[_0x511d('0x2b')]=_[_0x511d('0x2d')](db[_0x511d('0x4a')][_0x511d('0x40')]);_0x523d47[_0x511d('0x2c')]=_[_0x511d('0x2d')](_0x1144bf[_0x511d('0x2c')]);_0x523d47[_0x511d('0x2e')]=_[_0x511d('0x2f')](_0x523d47[_0x511d('0x2b')],_0x523d47['query']);_0x303a80['attributes']=_[_0x511d('0x2f')](_0x523d47[_0x511d('0x2b')],qs[_0x511d('0x30')](_0x1144bf[_0x511d('0x2c')][_0x511d('0x30')]));_0x303a80[_0x511d('0x31')]=_0x303a80[_0x511d('0x31')][_0x511d('0x32')]?_0x303a80[_0x511d('0x31')]:_0x523d47[_0x511d('0x2b')];_0x303a80[_0x511d('0x34')]=qs[_0x511d('0x35')](_0x1144bf[_0x511d('0x2c')][_0x511d('0x35')]);_0x303a80[_0x511d('0x36')]=qs['filters'](_[_0x511d('0x37')](_0x1144bf[_0x511d('0x2c')],_0x523d47[_0x511d('0x2e')]));if(_0x1144bf[_0x511d('0x2c')]['filter']){_0x303a80[_0x511d('0x36')]=_[_0x511d('0x3a')](_0x303a80['where'],{'$or':_[_0x511d('0x27')](_0x303a80[_0x511d('0x31')],function(_0x52eece){var _0x3b1544={};_0x3b1544[_0x52eece]={'$like':'%'+_0x1144bf[_0x511d('0x2c')][_0x511d('0x38')]+'%'};return _0x3b1544;})});}_0x303a80=_[_0x511d('0x3a')]({},_0x303a80,_0x1144bf[_0x511d('0x42')]);return _0x1e5e2d[_0x511d('0x48')](_0x303a80);}})[_0x511d('0x1f')](function(_0x1a1d43){if(_0x1a1d43){_0x3c7ea3=_0x1a1d43['length'];if(!_0x1144bf['query'][_0x511d('0x33')]('nolimit')){_0x303a80[_0x511d('0x1b')]=qs[_0x511d('0x1b')](_0x1144bf[_0x511d('0x2c')][_0x511d('0x1b')]);_0x303a80[_0x511d('0x19')]=qs[_0x511d('0x19')](_0x1144bf[_0x511d('0x2c')]['offset']);}return _0x1e5e2d[_0x511d('0x48')](_0x303a80);}})[_0x511d('0x1f')](function(_0x358b91){if(_0x358b91){return _0x358b91?{'count':_0x3c7ea3,'rows':_0x358b91}:null;}})['then'](respondWithResult(_0x1813bf,null))[_0x511d('0x3e')](handleError(_0x1813bf,null));};exports['getSubjects']=function(_0x48984b,_0x606e37,_0x2c6d87){var _0x37ab96={};var _0x15e254={};var _0xba6efa;var _0x40cc62;return db['DeskConfiguration'][_0x511d('0x49')]({'where':{'id':_0x48984b[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x606e37,null))['then'](function(_0x3aca87){if(_0x3aca87){_0xba6efa=_0x3aca87;_0x15e254[_0x511d('0x2b')]=_[_0x511d('0x2d')](db[_0x511d('0x4a')][_0x511d('0x40')]);_0x15e254[_0x511d('0x2c')]=_['keys'](_0x48984b[_0x511d('0x2c')]);_0x15e254[_0x511d('0x2e')]=_['intersection'](_0x15e254[_0x511d('0x2b')],_0x15e254[_0x511d('0x2c')]);_0x37ab96[_0x511d('0x31')]=_['intersection'](_0x15e254[_0x511d('0x2b')],qs[_0x511d('0x30')](_0x48984b[_0x511d('0x2c')][_0x511d('0x30')]));_0x37ab96[_0x511d('0x31')]=_0x37ab96[_0x511d('0x31')]['length']?_0x37ab96[_0x511d('0x31')]:_0x15e254['model'];_0x37ab96[_0x511d('0x34')]=qs[_0x511d('0x35')](_0x48984b[_0x511d('0x2c')]['sort']);_0x37ab96[_0x511d('0x36')]=qs[_0x511d('0x2e')](_[_0x511d('0x37')](_0x48984b['query'],_0x15e254[_0x511d('0x2e')]));if(_0x48984b[_0x511d('0x2c')][_0x511d('0x38')]){_0x37ab96[_0x511d('0x36')]=_['merge'](_0x37ab96[_0x511d('0x36')],{'$or':_['map'](_0x37ab96[_0x511d('0x31')],function(_0x49a965){var _0x39332c={};_0x39332c[_0x49a965]={'$like':'%'+_0x48984b[_0x511d('0x2c')][_0x511d('0x38')]+'%'};return _0x39332c;})});}_0x37ab96=_['merge']({},_0x37ab96,_0x48984b[_0x511d('0x42')]);return _0xba6efa['getSubjects'](_0x37ab96);}})[_0x511d('0x1f')](function(_0x506aa1){if(_0x506aa1){_0x40cc62=_0x506aa1['length'];if(!_0x48984b[_0x511d('0x2c')][_0x511d('0x33')](_0x511d('0x4b'))){_0x37ab96['limit']=qs[_0x511d('0x1b')](_0x48984b[_0x511d('0x2c')][_0x511d('0x1b')]);_0x37ab96['offset']=qs[_0x511d('0x19')](_0x48984b[_0x511d('0x2c')]['offset']);}return _0xba6efa[_0x511d('0x4c')](_0x37ab96);}})['then'](function(_0x22e63c){if(_0x22e63c){return _0x22e63c?{'count':_0x40cc62,'rows':_0x22e63c}:null;}})[_0x511d('0x1f')](respondWithResult(_0x606e37,null))[_0x511d('0x3e')](handleError(_0x606e37,null));};exports[_0x511d('0x4d')]=function(_0x2abeae,_0x2eee9f,_0x4a46ff){var _0x18dea7={};var _0x3a8a60={};var _0x29b188;var _0x109020;return db[_0x511d('0x28')][_0x511d('0x49')]({'where':{'id':_0x2abeae[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x2eee9f,null))[_0x511d('0x1f')](function(_0x3a825d){if(_0x3a825d){_0x29b188=_0x3a825d;_0x3a8a60[_0x511d('0x2b')]=_['keys'](db[_0x511d('0x4a')][_0x511d('0x40')]);_0x3a8a60[_0x511d('0x2c')]=_[_0x511d('0x2d')](_0x2abeae[_0x511d('0x2c')]);_0x3a8a60[_0x511d('0x2e')]=_[_0x511d('0x2f')](_0x3a8a60[_0x511d('0x2b')],_0x3a8a60[_0x511d('0x2c')]);_0x18dea7['attributes']=_[_0x511d('0x2f')](_0x3a8a60[_0x511d('0x2b')],qs[_0x511d('0x30')](_0x2abeae[_0x511d('0x2c')][_0x511d('0x30')]));_0x18dea7[_0x511d('0x31')]=_0x18dea7[_0x511d('0x31')][_0x511d('0x32')]?_0x18dea7[_0x511d('0x31')]:_0x3a8a60['model'];_0x18dea7['order']=qs[_0x511d('0x35')](_0x2abeae[_0x511d('0x2c')]['sort']);_0x18dea7[_0x511d('0x36')]=qs['filters'](_['pick'](_0x2abeae[_0x511d('0x2c')],_0x3a8a60[_0x511d('0x2e')]));if(_0x2abeae[_0x511d('0x2c')]['filter']){_0x18dea7[_0x511d('0x36')]=_['merge'](_0x18dea7['where'],{'$or':_[_0x511d('0x27')](_0x18dea7['attributes'],function(_0x1d0e89){var _0x5a5ad1={};_0x5a5ad1[_0x1d0e89]={'$like':'%'+_0x2abeae[_0x511d('0x2c')]['filter']+'%'};return _0x5a5ad1;})});}_0x18dea7=_[_0x511d('0x3a')]({},_0x18dea7,_0x2abeae['options']);return _0x29b188[_0x511d('0x4d')](_0x18dea7);}})[_0x511d('0x1f')](function(_0x509b16){if(_0x509b16){_0x109020=_0x509b16[_0x511d('0x32')];if(!_0x2abeae[_0x511d('0x2c')]['hasOwnProperty'](_0x511d('0x4b'))){_0x18dea7[_0x511d('0x1b')]=qs[_0x511d('0x1b')](_0x2abeae[_0x511d('0x2c')][_0x511d('0x1b')]);_0x18dea7[_0x511d('0x19')]=qs['offset'](_0x2abeae['query'][_0x511d('0x19')]);}return _0x29b188['getDescriptions'](_0x18dea7);}})[_0x511d('0x1f')](function(_0x3528ce){if(_0x3528ce){return _0x3528ce?{'count':_0x109020,'rows':_0x3528ce}:null;}})['then'](respondWithResult(_0x2eee9f,null))[_0x511d('0x3e')](handleError(_0x2eee9f,null));};exports['getTags']=function(_0x51cc07,_0x1d5fce,_0x128ea3){var _0x100db={};var _0x3a0045={};var _0x342de1;var _0x2cbd8f;return db[_0x511d('0x28')][_0x511d('0x49')]({'where':{'id':_0x51cc07[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x1d5fce,null))[_0x511d('0x1f')](function(_0x482c6b){if(_0x482c6b){_0x342de1=_0x482c6b;_0x3a0045['model']=_[_0x511d('0x2d')](db[_0x511d('0x4e')][_0x511d('0x40')]);_0x3a0045[_0x511d('0x2c')]=_[_0x511d('0x2d')](_0x51cc07[_0x511d('0x2c')]);_0x3a0045['filters']=_[_0x511d('0x2f')](_0x3a0045['model'],_0x3a0045[_0x511d('0x2c')]);_0x100db[_0x511d('0x31')]=_[_0x511d('0x2f')](_0x3a0045[_0x511d('0x2b')],qs['fields'](_0x51cc07['query'][_0x511d('0x30')]));_0x100db[_0x511d('0x31')]=_0x100db['attributes'][_0x511d('0x32')]?_0x100db[_0x511d('0x31')]:_0x3a0045[_0x511d('0x2b')];_0x100db[_0x511d('0x34')]=qs[_0x511d('0x35')](_0x51cc07['query'][_0x511d('0x35')]);_0x100db['where']=qs[_0x511d('0x2e')](_['pick'](_0x51cc07[_0x511d('0x2c')],_0x3a0045[_0x511d('0x2e')]));if(_0x51cc07['query'][_0x511d('0x38')]){_0x100db[_0x511d('0x36')]=_['merge'](_0x100db['where'],{'$or':_[_0x511d('0x27')](_0x100db[_0x511d('0x31')],function(_0x50d33e){var _0x1d9e53={};_0x1d9e53[_0x50d33e]={'$like':'%'+_0x51cc07['query'][_0x511d('0x38')]+'%'};return _0x1d9e53;})});}_0x100db=_['merge']({},_0x100db,_0x51cc07[_0x511d('0x42')]);return _0x342de1[_0x511d('0x4f')](_0x100db);}})['then'](function(_0x1b11fe){if(_0x1b11fe){_0x2cbd8f=_0x1b11fe[_0x511d('0x32')];if(!_0x51cc07[_0x511d('0x2c')]['hasOwnProperty'](_0x511d('0x4b'))){_0x100db[_0x511d('0x1b')]=qs[_0x511d('0x1b')](_0x51cc07[_0x511d('0x2c')][_0x511d('0x1b')]);_0x100db[_0x511d('0x19')]=qs[_0x511d('0x19')](_0x51cc07[_0x511d('0x2c')][_0x511d('0x19')]);}return _0x342de1['getTags'](_0x100db);}})[_0x511d('0x1f')](function(_0x155e53){if(_0x155e53){return _0x155e53?{'count':_0x2cbd8f,'rows':_0x155e53}:null;}})[_0x511d('0x1f')](respondWithResult(_0x1d5fce,null))['catch'](handleError(_0x1d5fce,null));};exports[_0x511d('0x50')]=function(_0x3bc8f1,_0x551f1a,_0x446fb0){if(_0x3bc8f1[_0x511d('0x44')]['id']){delete _0x3bc8f1[_0x511d('0x44')]['id'];}return db[_0x511d('0x28')][_0x511d('0x49')]({'where':{'id':_0x3bc8f1[_0x511d('0x47')]['id']}})[_0x511d('0x1f')](handleEntityNotFound(_0x551f1a,null))[_0x511d('0x1f')](function(_0x458090){if(_0x458090){return _0x458090['setTags'](_0x3bc8f1[_0x511d('0x44')]['ids']||[]);}return null;})['then'](respondWithResult(_0x551f1a,null))[_0x511d('0x3e')](handleError(_0x551f1a,null));};
\ No newline at end of file
index 16ae07b..c4d6ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98dc=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util'];(function(_0x225685,_0x7f3eef){var _0x1b1d51=function(_0x1912b2){while(--_0x1912b2){_0x225685['push'](_0x225685['shift']());}};_0x1b1d51(++_0x7f3eef);}(_0x98dc,0x18a));var _0xc98d=function(_0x2965d0,_0x40de59){_0x2965d0=_0x2965d0-0x0;var _0x5d3a96=_0x98dc[_0x2965d0];return _0x5d3a96;};'use strict';var _=require(_0xc98d('0x0'));var util=require(_0xc98d('0x1'));var logger=require(_0xc98d('0x2'))(_0xc98d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc98d('0x4'));var fs=require('fs');var path=require(_0xc98d('0x5'));var rimraf=require(_0xc98d('0x6'));var config=require(_0xc98d('0x7'));var attributes=require(_0xc98d('0x8'));module[_0xc98d('0x9')]=function(_0x4c4280,_0x447adc){return _0x4c4280[_0xc98d('0xa')]('DeskConfiguration',attributes,{'tableName':_0xc98d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x695e=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4f8885,_0x40456c){var _0x589c9e=function(_0x25d587){while(--_0x25d587){_0x4f8885['push'](_0x4f8885['shift']());}};_0x589c9e(++_0x40456c);}(_0x695e,0x10a));var _0xe695=function(_0x1757c8,_0x4aa781){_0x1757c8=_0x1757c8-0x0;var _0x3059f1=_0x695e[_0x1757c8];return _0x3059f1;};'use strict';var _=require(_0xe695('0x0'));var util=require(_0xe695('0x1'));var logger=require('../../config/logger')(_0xe695('0x2'));var moment=require(_0xe695('0x3'));var BPromise=require(_0xe695('0x4'));var rp=require(_0xe695('0x5'));var fs=require('fs');var path=require(_0xe695('0x6'));var rimraf=require(_0xe695('0x7'));var config=require(_0xe695('0x8'));var attributes=require(_0xe695('0x9'));module[_0xe695('0xa')]=function(_0x10efba,_0x185e00){return _0x10efba['define'](_0xe695('0xb'),attributes,{'tableName':_0xe695('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbcd4cf..2157e8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1bd=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1bd,0x1a3));var _0xde1b=function(_0x5affec,_0x2d2b76){_0x5affec=_0x5affec-0x0;var _0x166192=_0xe1bd[_0x5affec];return _0x166192;};'use strict';var _=require(_0xde1b('0x0'));var util=require(_0xde1b('0x1'));var moment=require(_0xde1b('0x2'));var BPromise=require(_0xde1b('0x3'));var rs=require(_0xde1b('0x4'));var fs=require('fs');var Redis=require(_0xde1b('0x5'));var db=require(_0xde1b('0x6'))['db'];var utils=require(_0xde1b('0x7'));var logger=require(_0xde1b('0x8'))(_0xde1b('0x9'));var config=require('../../config/environment');var jayson=require(_0xde1b('0xa'));var client=jayson[_0xde1b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e3b8b,_0x36b491,_0x3b4fc7){return new BPromise(function(_0x1da9f4,_0x403447){return client[_0xde1b('0xc')](_0x8e3b8b,_0x3b4fc7)[_0xde1b('0xd')](function(_0x488aa1){logger[_0xde1b('0xe')](_0xde1b('0xf'),_0x36b491,_0xde1b('0x10'));logger[_0xde1b('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x36b491,'request\x20sent',JSON[_0xde1b('0x12')](_0x488aa1));if(_0x488aa1['error']){if(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x14')]===0x1f4){logger['error'](_0xde1b('0xf'),_0x36b491,_0x488aa1[_0xde1b('0x13')]['message']);return _0x403447(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x15')]);}logger[_0xde1b('0x13')](_0xde1b('0xf'),_0x36b491,_0x488aa1[_0xde1b('0x13')]['message']);return _0x1da9f4(_0x488aa1[_0xde1b('0x13')][_0xde1b('0x15')]);}else{logger['info'](_0xde1b('0xf'),_0x36b491,_0xde1b('0x10'));_0x1da9f4(_0x488aa1[_0xde1b('0x16')]['message']);}})[_0xde1b('0x17')](function(_0x3f6c4d){logger[_0xde1b('0x13')](_0xde1b('0xf'),_0x36b491,_0x3f6c4d);_0x403447(_0x3f6c4d);});});}
\ No newline at end of file
+var _0x5a13=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','code','message','error'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x5a13,0x145));var _0x35a1=function(_0x3c7343,_0x275113){_0x3c7343=_0x3c7343-0x0;var _0x795c36=_0x5a13[_0x3c7343];return _0x795c36;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}
\ No newline at end of file
index 800d076..256b64e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46a1=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x46a1,0x1b2));var _0x146a=function(_0xb32add,_0x51b21d){_0xb32add=_0xb32add-0x0;var _0x3fea3c=_0x46a1[_0xb32add];return _0x3fea3c;};'use strict';var multer=require(_0x146a('0x0'));var util=require(_0x146a('0x1'));var path=require(_0x146a('0x2'));var timeout=require(_0x146a('0x3'));var express=require(_0x146a('0x4'));var router=express[_0x146a('0x5')]();var fs_extra=require(_0x146a('0x6'));var auth=require(_0x146a('0x7'));var interaction=require(_0x146a('0x8'));var config=require(_0x146a('0x9'));var controller=require(_0x146a('0xa'));router[_0x146a('0xb')]('/',auth[_0x146a('0xc')](),controller['index']);router[_0x146a('0xb')](_0x146a('0xd'),auth[_0x146a('0xc')](),controller[_0x146a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x146a('0xd'),auth[_0x146a('0xc')](),controller[_0x146a('0xf')]);router['delete'](_0x146a('0xd'),auth[_0x146a('0xc')](),controller[_0x146a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x234b=['post','create','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x234b,0xc6));var _0xb234=function(_0x4afe6d,_0x1b3667){_0x4afe6d=_0x4afe6d-0x0;var _0x3bb37e=_0x234b[_0x4afe6d];return _0x3bb37e;};'use strict';var multer=require('multer');var util=require(_0xb234('0x0'));var path=require(_0xb234('0x1'));var timeout=require(_0xb234('0x2'));var express=require(_0xb234('0x3'));var router=express[_0xb234('0x4')]();var fs_extra=require(_0xb234('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb234('0x6'));var config=require('../../config/environment');var controller=require(_0xb234('0x7'));router[_0xb234('0x8')]('/',auth[_0xb234('0x9')](),controller['index']);router[_0xb234('0x8')]('/:id',auth[_0xb234('0x9')](),controller['show']);router[_0xb234('0xa')]('/',auth[_0xb234('0x9')](),controller[_0xb234('0xb')]);router['put'](_0xb234('0xc'),auth['isAuthenticated'](),controller[_0xb234('0xd')]);router[_0xb234('0xe')](_0xb234('0xc'),auth[_0xb234('0x9')](),controller['destroy']);module[_0xb234('0xf')]=router;
\ No newline at end of file
index a52a781..0d33ebd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c63=['BOOLEAN','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x5c63,0x81));var _0x35c6=function(_0x184647,_0x47feed){_0x184647=_0x184647-0x0;var _0x5b57fe=_0x5c63[_0x184647];return _0x5b57fe;};'use strict';var Sequelize=require('sequelize');module[_0x35c6('0x0')]={'type':{'type':Sequelize[_0x35c6('0x1')](_0x35c6('0x2'),_0x35c6('0x3'),'customVariable',_0x35c6('0x4'),'picklist'),'defaultValue':_0x35c6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x35c6('0x5')]},'keyType':{'type':Sequelize[_0x35c6('0x1')]('string',_0x35c6('0x3'),_0x35c6('0x6'))},'keyContent':{'type':Sequelize[_0x35c6('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x35c6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb401=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3f1d70,_0x455679){var _0x20f488=function(_0x3e55cd){while(--_0x3e55cd){_0x3f1d70['push'](_0x3f1d70['shift']());}};_0x20f488(++_0x455679);}(_0xb401,0x113));var _0x1b40=function(_0x13398f,_0x1d2f28){_0x13398f=_0x13398f-0x0;var _0xa6b507=_0xb401[_0x13398f];return _0xa6b507;};'use strict';var Sequelize=require(_0x1b40('0x0'));module[_0x1b40('0x1')]={'type':{'type':Sequelize[_0x1b40('0x2')](_0x1b40('0x3'),_0x1b40('0x4'),'customVariable',_0x1b40('0x5'),'picklist'),'defaultValue':_0x1b40('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1b40('0x6')]},'keyType':{'type':Sequelize[_0x1b40('0x2')](_0x1b40('0x3'),'variable',_0x1b40('0x7'))},'keyContent':{'type':Sequelize[_0x1b40('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1b40('0x6')]},'customField':{'type':Sequelize[_0x1b40('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1b40('0x6')]}};
\ No newline at end of file
index 2551878..ca86182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22da=['../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x22da,0x80));var _0xa22d=function(_0x2f130d,_0x47e4e1){_0x2f130d=_0x2f130d-0x0;var _0x335f67=_0x22da[_0x2f130d];return _0x335f67;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa22d('0x0'));var jsonpatch=require(_0xa22d('0x1'));var rp=require(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa22d('0x4'));var util=require(_0xa22d('0x5'));var path=require(_0xa22d('0x6'));var sox=require(_0xa22d('0x7'));var csv=require('to-csv');var ejs=require(_0xa22d('0x8'));var fs=require('fs');var fs_extra=require(_0xa22d('0x9'));var _=require('lodash');var squel=require(_0xa22d('0xa'));var crypto=require(_0xa22d('0xb'));var jsforce=require(_0xa22d('0xc'));var deskjs=require(_0xa22d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa22d('0xe'));var Redis=require(_0xa22d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa22d('0x10'));var as=require(_0xa22d('0x11'));var hardwareService=require(_0xa22d('0x12'));var logger=require(_0xa22d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa22d('0x14'));var licenseUtil=require(_0xa22d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184309,_0x515d6c){_0x515d6c=_0x515d6c||0xcc;return function(_0x983182){if(_0x983182){return _0x184309[_0xa22d('0x16')](_0x515d6c);}return _0x184309[_0xa22d('0x17')](_0x515d6c)['end']();};}function respondWithResult(_0x174a3f,_0x20d7f3){_0x20d7f3=_0x20d7f3||0xc8;return function(_0xc0d11d){if(_0xc0d11d){return _0x174a3f[_0xa22d('0x17')](_0x20d7f3)[_0xa22d('0x18')](_0xc0d11d);}};}function respondWithFilteredResult(_0x4dfa44,_0x132b1d){return function(_0x1b8627){if(_0x1b8627){var _0x2af5c6=typeof _0x132b1d[_0xa22d('0x19')]===_0xa22d('0x1a')&&typeof _0x132b1d[_0xa22d('0x1b')]===_0xa22d('0x1a');var _0x5e56a6=_0x1b8627[_0xa22d('0x1c')];var _0x3d78b9=_0x2af5c6?0x0:_0x132b1d[_0xa22d('0x19')];var _0x1ed22e=_0x2af5c6?_0x1b8627[_0xa22d('0x1c')]:_0x132b1d[_0xa22d('0x19')]+_0x132b1d[_0xa22d('0x1b')];var _0x184604;if(_0x1ed22e>=_0x5e56a6){_0x1ed22e=_0x5e56a6;_0x184604=0xc8;}else{_0x184604=0xce;}_0x4dfa44['status'](_0x184604);return _0x4dfa44[_0xa22d('0x1d')](_0xa22d('0x1e'),_0x3d78b9+'-'+_0x1ed22e+'/'+_0x5e56a6)[_0xa22d('0x18')](_0x1b8627);}return null;};}function patchUpdates(_0x4ed606){return function(_0x4c0aed){try{jsonpatch['apply'](_0x4c0aed,_0x4ed606,!![]);}catch(_0x2cd394){return BPromise[_0xa22d('0x1f')](_0x2cd394);}return _0x4c0aed[_0xa22d('0x20')]();};}function saveUpdates(_0x5071e1,_0x389675){return function(_0x45f528){if(_0x45f528){return _0x45f528[_0xa22d('0x21')](_0x5071e1)['then'](function(_0xdb2773){return _0xdb2773;});}return null;};}function removeEntity(_0x1088ea,_0x502219){return function(_0x24701d){if(_0x24701d){return _0x24701d[_0xa22d('0x22')]()[_0xa22d('0x23')](function(){_0x1088ea[_0xa22d('0x17')](0xcc)[_0xa22d('0x24')]();});}};}function handleEntityNotFound(_0x1c83e8,_0x55f1ce){return function(_0x58aa49){if(!_0x58aa49){_0x1c83e8['sendStatus'](0x194);}return _0x58aa49;};}function handleError(_0x70bfb8,_0x2e4b26){_0x2e4b26=_0x2e4b26||0x1f4;return function(_0x2fe9e0){logger[_0xa22d('0x25')](_0x2fe9e0[_0xa22d('0x26')]);if(_0x2fe9e0[_0xa22d('0x27')]){delete _0x2fe9e0[_0xa22d('0x27')];}_0x70bfb8[_0xa22d('0x17')](_0x2e4b26)[_0xa22d('0x28')](_0x2fe9e0);};}exports[_0xa22d('0x29')]=function(_0x594ac5,_0x5ba48b){var _0xf687b9={},_0x4d460f={},_0x550dd7={'count':0x0,'rows':[]};var _0x1d7b33=_[_0xa22d('0x2a')](db[_0xa22d('0x2b')][_0xa22d('0x2c')],function(_0x1614f4){return{'name':_0x1614f4[_0xa22d('0x2d')],'type':_0x1614f4[_0xa22d('0x2e')][_0xa22d('0x2f')]};});_0x4d460f['model']=_[_0xa22d('0x2a')](_0x1d7b33,_0xa22d('0x27'));_0x4d460f[_0xa22d('0x30')]=_[_0xa22d('0x31')](_0x594ac5[_0xa22d('0x30')]);_0x4d460f[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4d460f[_0xa22d('0x34')],_0x4d460f[_0xa22d('0x30')]);_0xf687b9[_0xa22d('0x35')]=_['intersection'](_0x4d460f[_0xa22d('0x34')],qs[_0xa22d('0x36')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x36')]));_0xf687b9[_0xa22d('0x35')]=_0xf687b9[_0xa22d('0x35')]['length']?_0xf687b9[_0xa22d('0x35')]:_0x4d460f[_0xa22d('0x34')];if(!_0x594ac5['query'][_0xa22d('0x37')]('nolimit')){_0xf687b9[_0xa22d('0x1b')]=qs[_0xa22d('0x1b')](_0x594ac5['query'][_0xa22d('0x1b')]);_0xf687b9['offset']=qs[_0xa22d('0x19')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x19')]);}_0xf687b9[_0xa22d('0x38')]=qs[_0xa22d('0x39')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x39')]);_0xf687b9[_0xa22d('0x3a')]=qs['filters'](_[_0xa22d('0x3b')](_0x594ac5[_0xa22d('0x30')],_0x4d460f['filters']),_0x1d7b33);if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]){_0xf687b9['where']=_['merge'](_0xf687b9[_0xa22d('0x3a')],{'$or':_[_0xa22d('0x2a')](_0x1d7b33,function(_0x109944){if(_0x109944[_0xa22d('0x2e')]!==_0xa22d('0x3d')){var _0x180c37={};_0x180c37[_0x109944[_0xa22d('0x27')]]={'$like':'%'+_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]+'%'};return _0x180c37;}})});}_0xf687b9=_[_0xa22d('0x3e')]({},_0xf687b9,_0x594ac5['options']);var _0x36287a={'where':_0xf687b9[_0xa22d('0x3a')]};return db[_0xa22d('0x2b')][_0xa22d('0x1c')](_0x36287a)['then'](function(_0x11e608){_0x550dd7['count']=_0x11e608;if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3f')]){_0xf687b9[_0xa22d('0x40')]=[{'all':!![]}];}return db[_0xa22d('0x2b')][_0xa22d('0x41')](_0xf687b9);})[_0xa22d('0x23')](function(_0x55034d){_0x550dd7[_0xa22d('0x42')]=_0x55034d;return _0x550dd7;})[_0xa22d('0x23')](respondWithFilteredResult(_0x5ba48b,_0xf687b9))['catch'](handleError(_0x5ba48b,null));};exports[_0xa22d('0x43')]=function(_0x2e44c3,_0x5404d1){var _0x42a36b={'raw':!![],'where':{'id':_0x2e44c3[_0xa22d('0x44')]['id']}},_0x4aebbe={};_0x4aebbe[_0xa22d('0x34')]=_[_0xa22d('0x31')](db['DeskField'][_0xa22d('0x2c')]);_0x4aebbe[_0xa22d('0x30')]=_['keys'](_0x2e44c3[_0xa22d('0x30')]);_0x4aebbe[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],_0x4aebbe[_0xa22d('0x30')]);_0x42a36b[_0xa22d('0x35')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],qs['fields'](_0x2e44c3['query'][_0xa22d('0x36')]));_0x42a36b['attributes']=_0x42a36b[_0xa22d('0x35')]['length']?_0x42a36b[_0xa22d('0x35')]:_0x4aebbe['model'];if(_0x2e44c3[_0xa22d('0x30')][_0xa22d('0x3f')]){_0x42a36b[_0xa22d('0x40')]=[{'all':!![]}];}_0x42a36b=_[_0xa22d('0x3e')]({},_0x42a36b,_0x2e44c3[_0xa22d('0x45')]);return db[_0xa22d('0x2b')][_0xa22d('0x46')](_0x42a36b)[_0xa22d('0x23')](handleEntityNotFound(_0x5404d1,null))[_0xa22d('0x23')](respondWithResult(_0x5404d1,null))[_0xa22d('0x47')](handleError(_0x5404d1,null));};exports['create']=function(_0x5f488e,_0x132be8){return db['DeskField'][_0xa22d('0x48')](_0x5f488e['body'],{})[_0xa22d('0x23')](respondWithResult(_0x132be8,0xc9))[_0xa22d('0x47')](handleError(_0x132be8,null));};exports['update']=function(_0x4a1d04,_0x37e2b2){if(_0x4a1d04['body']['id']){delete _0x4a1d04[_0xa22d('0x49')]['id'];}return db['DeskField'][_0xa22d('0x46')]({'where':{'id':_0x4a1d04[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x37e2b2,null))[_0xa22d('0x23')](saveUpdates(_0x4a1d04[_0xa22d('0x49')],null))[_0xa22d('0x23')](respondWithResult(_0x37e2b2,null))[_0xa22d('0x47')](handleError(_0x37e2b2,null));};exports[_0xa22d('0x22')]=function(_0x45672b,_0x5e5847){return db[_0xa22d('0x2b')][_0xa22d('0x46')]({'where':{'id':_0x45672b[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x5e5847,null))[_0xa22d('0x23')](removeEntity(_0x5e5847,null))[_0xa22d('0x47')](handleError(_0x5e5847,null));};
\ No newline at end of file
+var _0x42f0=['include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','count','limit','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskField','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x1e977c,_0x3f784a){var _0x1ae854=function(_0x13054e){while(--_0x13054e){_0x1e977c['push'](_0x1e977c['shift']());}};_0x1ae854(++_0x3f784a);}(_0x42f0,0x1b4));var _0x042f=function(_0x5a64eb,_0x286782){_0x5a64eb=_0x5a64eb-0x0;var _0x3ad930=_0x42f0[_0x5a64eb];return _0x3ad930;};'use strict';var emlformat=require(_0x042f('0x0'));var rimraf=require(_0x042f('0x1'));var zipdir=require(_0x042f('0x2'));var jsonpatch=require(_0x042f('0x3'));var rp=require(_0x042f('0x4'));var moment=require(_0x042f('0x5'));var BPromise=require(_0x042f('0x6'));var Mustache=require(_0x042f('0x7'));var util=require('util');var path=require(_0x042f('0x8'));var sox=require(_0x042f('0x9'));var csv=require(_0x042f('0xa'));var ejs=require(_0x042f('0xb'));var fs=require('fs');var fs_extra=require(_0x042f('0xc'));var _=require(_0x042f('0xd'));var squel=require(_0x042f('0xe'));var crypto=require('crypto');var jsforce=require(_0x042f('0xf'));var deskjs=require(_0x042f('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x042f('0x11'));var Redis=require('ioredis');var authService=require(_0x042f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x042f('0x13'));var logger=require(_0x042f('0x14'))(_0x042f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x042f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c457e,_0x3c3a3f){_0x3c3a3f=_0x3c3a3f||0xcc;return function(_0x1c78d0){if(_0x1c78d0){return _0x5c457e[_0x042f('0x17')](_0x3c3a3f);}return _0x5c457e[_0x042f('0x18')](_0x3c3a3f)[_0x042f('0x19')]();};}function respondWithResult(_0x57e7a1,_0x355cec){_0x355cec=_0x355cec||0xc8;return function(_0x3d9c07){if(_0x3d9c07){return _0x57e7a1[_0x042f('0x18')](_0x355cec)['json'](_0x3d9c07);}};}function respondWithFilteredResult(_0xfc66ce,_0x52f818){return function(_0x4635bd){if(_0x4635bd){var _0x3c7bc9=typeof _0x52f818[_0x042f('0x1a')]==='undefined'&&typeof _0x52f818['limit']==='undefined';var _0x4db10c=_0x4635bd[_0x042f('0x1b')];var _0xa80b7e=_0x3c7bc9?0x0:_0x52f818[_0x042f('0x1a')];var _0x27470c=_0x3c7bc9?_0x4635bd[_0x042f('0x1b')]:_0x52f818[_0x042f('0x1a')]+_0x52f818[_0x042f('0x1c')];var _0x18f24e;if(_0x27470c>=_0x4db10c){_0x27470c=_0x4db10c;_0x18f24e=0xc8;}else{_0x18f24e=0xce;}_0xfc66ce[_0x042f('0x18')](_0x18f24e);return _0xfc66ce['set']('Content-Range',_0xa80b7e+'-'+_0x27470c+'/'+_0x4db10c)[_0x042f('0x1d')](_0x4635bd);}return null;};}function patchUpdates(_0x5c69b2){return function(_0x182868){try{jsonpatch[_0x042f('0x1e')](_0x182868,_0x5c69b2,!![]);}catch(_0x238c3b){return BPromise[_0x042f('0x1f')](_0x238c3b);}return _0x182868[_0x042f('0x20')]();};}function saveUpdates(_0x44991c,_0xcfdd67){return function(_0x50d4ad){if(_0x50d4ad){return _0x50d4ad[_0x042f('0x21')](_0x44991c)[_0x042f('0x22')](function(_0x3dc959){return _0x3dc959;});}return null;};}function removeEntity(_0x3bc5a3,_0x4bb700){return function(_0x1a2d0a){if(_0x1a2d0a){return _0x1a2d0a[_0x042f('0x23')]()[_0x042f('0x22')](function(){_0x3bc5a3[_0x042f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30736f,_0x11bbf7){return function(_0x5e5a7e){if(!_0x5e5a7e){_0x30736f[_0x042f('0x17')](0x194);}return _0x5e5a7e;};}function handleError(_0x5c6fc8,_0x4206bd){_0x4206bd=_0x4206bd||0x1f4;return function(_0x551a08){logger['error'](_0x551a08[_0x042f('0x24')]);if(_0x551a08[_0x042f('0x25')]){delete _0x551a08[_0x042f('0x25')];}_0x5c6fc8['status'](_0x4206bd)[_0x042f('0x26')](_0x551a08);};}exports[_0x042f('0x27')]=function(_0x32fe9a,_0x5a9650){var _0x2075cc={},_0x904ac7={},_0x20c957={'count':0x0,'rows':[]};var _0x3091a5=_[_0x042f('0x28')](db[_0x042f('0x29')]['rawAttributes'],function(_0x34e0a6){return{'name':_0x34e0a6[_0x042f('0x2a')],'type':_0x34e0a6[_0x042f('0x2b')][_0x042f('0x2c')]};});_0x904ac7['model']=_[_0x042f('0x28')](_0x3091a5,_0x042f('0x25'));_0x904ac7['query']=_[_0x042f('0x2d')](_0x32fe9a[_0x042f('0x2e')]);_0x904ac7[_0x042f('0x2f')]=_[_0x042f('0x30')](_0x904ac7[_0x042f('0x31')],_0x904ac7[_0x042f('0x2e')]);_0x2075cc[_0x042f('0x32')]=_['intersection'](_0x904ac7[_0x042f('0x31')],qs['fields'](_0x32fe9a[_0x042f('0x2e')][_0x042f('0x33')]));_0x2075cc[_0x042f('0x32')]=_0x2075cc[_0x042f('0x32')]['length']?_0x2075cc[_0x042f('0x32')]:_0x904ac7[_0x042f('0x31')];if(!_0x32fe9a[_0x042f('0x2e')][_0x042f('0x34')]('nolimit')){_0x2075cc[_0x042f('0x1c')]=qs[_0x042f('0x1c')](_0x32fe9a[_0x042f('0x2e')][_0x042f('0x1c')]);_0x2075cc[_0x042f('0x1a')]=qs[_0x042f('0x1a')](_0x32fe9a[_0x042f('0x2e')][_0x042f('0x1a')]);}_0x2075cc[_0x042f('0x35')]=qs['sort'](_0x32fe9a['query'][_0x042f('0x36')]);_0x2075cc['where']=qs[_0x042f('0x2f')](_['pick'](_0x32fe9a[_0x042f('0x2e')],_0x904ac7['filters']),_0x3091a5);if(_0x32fe9a[_0x042f('0x2e')][_0x042f('0x37')]){_0x2075cc[_0x042f('0x38')]=_[_0x042f('0x39')](_0x2075cc['where'],{'$or':_['map'](_0x3091a5,function(_0x462ecc){if(_0x462ecc[_0x042f('0x2b')]!==_0x042f('0x3a')){var _0x4103a3={};_0x4103a3[_0x462ecc[_0x042f('0x25')]]={'$like':'%'+_0x32fe9a[_0x042f('0x2e')][_0x042f('0x37')]+'%'};return _0x4103a3;}})});}_0x2075cc=_[_0x042f('0x39')]({},_0x2075cc,_0x32fe9a[_0x042f('0x3b')]);var _0x51ddd1={'where':_0x2075cc[_0x042f('0x38')]};return db[_0x042f('0x29')]['count'](_0x51ddd1)[_0x042f('0x22')](function(_0x30909e){_0x20c957['count']=_0x30909e;if(_0x32fe9a[_0x042f('0x2e')][_0x042f('0x3c')]){_0x2075cc[_0x042f('0x3d')]=[{'all':!![]}];}return db[_0x042f('0x29')][_0x042f('0x3e')](_0x2075cc);})[_0x042f('0x22')](function(_0x512373){_0x20c957[_0x042f('0x3f')]=_0x512373;return _0x20c957;})[_0x042f('0x22')](respondWithFilteredResult(_0x5a9650,_0x2075cc))[_0x042f('0x40')](handleError(_0x5a9650,null));};exports[_0x042f('0x41')]=function(_0x417e35,_0x48207d){var _0x874282={'raw':!![],'where':{'id':_0x417e35[_0x042f('0x42')]['id']}},_0x225e77={};_0x225e77[_0x042f('0x31')]=_[_0x042f('0x2d')](db[_0x042f('0x29')][_0x042f('0x43')]);_0x225e77[_0x042f('0x2e')]=_['keys'](_0x417e35[_0x042f('0x2e')]);_0x225e77[_0x042f('0x2f')]=_['intersection'](_0x225e77[_0x042f('0x31')],_0x225e77['query']);_0x874282[_0x042f('0x32')]=_[_0x042f('0x30')](_0x225e77[_0x042f('0x31')],qs[_0x042f('0x33')](_0x417e35['query'][_0x042f('0x33')]));_0x874282[_0x042f('0x32')]=_0x874282[_0x042f('0x32')]['length']?_0x874282['attributes']:_0x225e77[_0x042f('0x31')];if(_0x417e35[_0x042f('0x2e')][_0x042f('0x3c')]){_0x874282[_0x042f('0x3d')]=[{'all':!![]}];}_0x874282=_[_0x042f('0x39')]({},_0x874282,_0x417e35[_0x042f('0x3b')]);return db['DeskField']['find'](_0x874282)[_0x042f('0x22')](handleEntityNotFound(_0x48207d,null))[_0x042f('0x22')](respondWithResult(_0x48207d,null))[_0x042f('0x40')](handleError(_0x48207d,null));};exports[_0x042f('0x44')]=function(_0x45cb9b,_0x3d31f5){return db['DeskField'][_0x042f('0x44')](_0x45cb9b[_0x042f('0x45')],{})['then'](respondWithResult(_0x3d31f5,0xc9))[_0x042f('0x40')](handleError(_0x3d31f5,null));};exports[_0x042f('0x21')]=function(_0x5ab21c,_0x156b06){if(_0x5ab21c[_0x042f('0x45')]['id']){delete _0x5ab21c['body']['id'];}return db['DeskField'][_0x042f('0x46')]({'where':{'id':_0x5ab21c[_0x042f('0x42')]['id']}})['then'](handleEntityNotFound(_0x156b06,null))['then'](saveUpdates(_0x5ab21c['body'],null))['then'](respondWithResult(_0x156b06,null))[_0x042f('0x40')](handleError(_0x156b06,null));};exports[_0x042f('0x23')]=function(_0x584644,_0x599f05){return db[_0x042f('0x29')]['find']({'where':{'id':_0x584644[_0x042f('0x42')]['id']}})[_0x042f('0x22')](handleEntityNotFound(_0x599f05,null))[_0x042f('0x22')](removeEntity(_0x599f05,null))['catch'](handleError(_0x599f05,null));};
\ No newline at end of file
index 582e993..6058ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc18=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0xdc18,0x18f));var _0x8dc1=function(_0x181251,_0x1c4c07){_0x181251=_0x181251-0x0;var _0x57a3c9=_0xdc18[_0x181251];return _0x57a3c9;};'use strict';var _=require('lodash');var util=require(_0x8dc1('0x0'));var logger=require(_0x8dc1('0x1'))(_0x8dc1('0x2'));var moment=require(_0x8dc1('0x3'));var BPromise=require(_0x8dc1('0x4'));var rp=require(_0x8dc1('0x5'));var fs=require('fs');var path=require(_0x8dc1('0x6'));var rimraf=require(_0x8dc1('0x7'));var config=require(_0x8dc1('0x8'));var attributes=require(_0x8dc1('0x9'));module[_0x8dc1('0xa')]=function(_0x591e9d,_0x98f794){return _0x591e9d[_0x8dc1('0xb')](_0x8dc1('0xc'),attributes,{'tableName':_0x8dc1('0xd'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x8dc1('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4dc5=['../../config/logger','api','moment','bluebird','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','lodash','util'];(function(_0x3a64d1,_0x4314d8){var _0x449e12=function(_0x2abb13){while(--_0x2abb13){_0x3a64d1['push'](_0x3a64d1['shift']());}};_0x449e12(++_0x4314d8);}(_0x4dc5,0x1ec));var _0x54dc=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x4dc5[_0x576170];return _0x397c70;};'use strict';var _=require(_0x54dc('0x0'));var util=require(_0x54dc('0x1'));var logger=require(_0x54dc('0x2'))(_0x54dc('0x3'));var moment=require(_0x54dc('0x4'));var BPromise=require(_0x54dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x54dc('0x6'));var attributes=require(_0x54dc('0x7'));module[_0x54dc('0x8')]=function(_0x1527ce,_0x413486){return _0x1527ce[_0x54dc('0x9')](_0x54dc('0xa'),attributes,{'tableName':_0x54dc('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x54dc('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index adb62b4..bf12d30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e1d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x193781,_0x1eff8e){var _0x44dc6d=function(_0x471c9c){while(--_0x471c9c){_0x193781['push'](_0x193781['shift']());}};_0x44dc6d(++_0x1eff8e);}(_0x6e1d,0x8f));var _0xd6e1=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x6e1d[_0x30cd7e];return _0x462a02;};'use strict';var _=require(_0xd6e1('0x0'));var util=require(_0xd6e1('0x1'));var moment=require(_0xd6e1('0x2'));var BPromise=require(_0xd6e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6e1('0x4'));var db=require(_0xd6e1('0x5'))['db'];var utils=require(_0xd6e1('0x6'));var logger=require(_0xd6e1('0x7'))(_0xd6e1('0x8'));var config=require(_0xd6e1('0x9'));var jayson=require(_0xd6e1('0xa'));var client=jayson[_0xd6e1('0xb')][_0xd6e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30884b,_0x2dabfa,_0x3fec62){return new BPromise(function(_0xd04a8d,_0x1a0212){return client[_0xd6e1('0xd')](_0x30884b,_0x3fec62)[_0xd6e1('0xe')](function(_0x43391d){logger[_0xd6e1('0xf')](_0xd6e1('0x10'),_0x2dabfa,_0xd6e1('0x11'));logger[_0xd6e1('0x12')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2dabfa,_0xd6e1('0x11'),JSON[_0xd6e1('0x13')](_0x43391d));if(_0x43391d[_0xd6e1('0x14')]){if(_0x43391d['error'][_0xd6e1('0x15')]===0x1f4){logger[_0xd6e1('0x14')](_0xd6e1('0x10'),_0x2dabfa,_0x43391d['error'][_0xd6e1('0x16')]);return _0x1a0212(_0x43391d[_0xd6e1('0x14')]['message']);}logger['error'](_0xd6e1('0x10'),_0x2dabfa,_0x43391d[_0xd6e1('0x14')][_0xd6e1('0x16')]);return _0xd04a8d(_0x43391d['error'][_0xd6e1('0x16')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x2dabfa,_0xd6e1('0x11'));_0xd04a8d(_0x43391d[_0xd6e1('0x17')][_0xd6e1('0x16')]);}})[_0xd6e1('0x18')](function(_0x384230){logger['error'](_0xd6e1('0x10'),_0x2dabfa,_0x384230);_0x1a0212(_0x384230);});});}
\ No newline at end of file
+var _0x65f0=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5424b6,_0x52dd23){var _0x34b519=function(_0x4c3276){while(--_0x4c3276){_0x5424b6['push'](_0x5424b6['shift']());}};_0x34b519(++_0x52dd23);}(_0x65f0,0x159));var _0x065f=function(_0x43cc5a,_0x1fbc95){_0x43cc5a=_0x43cc5a-0x0;var _0x5b3307=_0x65f0[_0x43cc5a];return _0x5b3307;};'use strict';var _=require(_0x065f('0x0'));var util=require(_0x065f('0x1'));var moment=require(_0x065f('0x2'));var BPromise=require(_0x065f('0x3'));var rs=require(_0x065f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x065f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x065f('0x6'))(_0x065f('0x7'));var config=require(_0x065f('0x8'));var jayson=require(_0x065f('0x9'));var client=jayson[_0x065f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2ca1,_0x4cfdad,_0x3ac93d){return new BPromise(function(_0x7caeec,_0x2b4dcb){return client[_0x065f('0xb')](_0x5a2ca1,_0x3ac93d)['then'](function(_0x301f74){logger[_0x065f('0xc')]('DeskField,\x20%s,\x20%s',_0x4cfdad,_0x065f('0xd'));logger[_0x065f('0xe')](_0x065f('0xf'),_0x4cfdad,_0x065f('0xd'),JSON[_0x065f('0x10')](_0x301f74));if(_0x301f74[_0x065f('0x11')]){if(_0x301f74[_0x065f('0x11')]['code']===0x1f4){logger[_0x065f('0x11')](_0x065f('0x12'),_0x4cfdad,_0x301f74[_0x065f('0x11')][_0x065f('0x13')]);return _0x2b4dcb(_0x301f74['error'][_0x065f('0x13')]);}logger[_0x065f('0x11')](_0x065f('0x12'),_0x4cfdad,_0x301f74[_0x065f('0x11')]['message']);return _0x7caeec(_0x301f74[_0x065f('0x11')][_0x065f('0x13')]);}else{logger[_0x065f('0xc')](_0x065f('0x12'),_0x4cfdad,_0x065f('0xd'));_0x7caeec(_0x301f74[_0x065f('0x14')][_0x065f('0x13')]);}})[_0x065f('0x15')](function(_0x40d756){logger[_0x065f('0x11')](_0x065f('0x12'),_0x4cfdad,_0x40d756);_0x2b4dcb(_0x40d756);});});}
\ No newline at end of file
index b967559..80e8a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0268=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','multer','path'];(function(_0x42dfa0,_0x1b46db){var _0x253811=function(_0x1c0f5a){while(--_0x1c0f5a){_0x42dfa0['push'](_0x42dfa0['shift']());}};_0x253811(++_0x1b46db);}(_0x0268,0xda));var _0x8026=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0268[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8026('0x0'));var util=require('util');var path=require(_0x8026('0x1'));var timeout=require('connect-timeout');var express=require(_0x8026('0x2'));var router=express[_0x8026('0x3')]();var fs_extra=require(_0x8026('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8026('0x5'));var config=require(_0x8026('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x8026('0x7')]('/',auth[_0x8026('0x8')](),controller[_0x8026('0x9')]);router['get'](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['show']);router[_0x8026('0x7')](_0x8026('0xb'),auth[_0x8026('0x8')](),controller[_0x8026('0xc')]);router[_0x8026('0x7')](_0x8026('0xd'),auth['isAuthenticated'](),controller[_0x8026('0xe')]);router[_0x8026('0xf')]('/',auth[_0x8026('0x8')](),controller[_0x8026('0x10')]);router['post'](_0x8026('0xb'),auth[_0x8026('0x8')](),controller[_0x8026('0x11')]);router[_0x8026('0x12')](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8026('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x395f=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration','put','delete','multer','util','connect-timeout','express','Router'];(function(_0x1384c1,_0x38a9ff){var _0x56a661=function(_0x2c9766){while(--_0x2c9766){_0x1384c1['push'](_0x1384c1['shift']());}};_0x56a661(++_0x38a9ff);}(_0x395f,0x18b));var _0xf395=function(_0x11a000,_0xb39f1){_0x11a000=_0x11a000-0x0;var _0x19fd92=_0x395f[_0x11a000];return _0x19fd92;};'use strict';var multer=require(_0xf395('0x0'));var util=require(_0xf395('0x1'));var path=require('path');var timeout=require(_0xf395('0x2'));var express=require(_0xf395('0x3'));var router=express[_0xf395('0x4')]();var fs_extra=require(_0xf395('0x5'));var auth=require(_0xf395('0x6'));var interaction=require(_0xf395('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0xf395('0x8')](),controller[_0xf395('0x9')]);router[_0xf395('0xa')](_0xf395('0xb'),auth[_0xf395('0x8')](),controller[_0xf395('0xc')]);router['get'](_0xf395('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xf395('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xf395('0x8')](),controller[_0xf395('0xf')]);router[_0xf395('0x10')](_0xf395('0xd'),auth[_0xf395('0x8')](),controller[_0xf395('0x11')]);router[_0xf395('0x12')](_0xf395('0xb'),auth[_0xf395('0x8')](),controller['update']);router[_0xf395('0x13')](_0xf395('0xb'),auth[_0xf395('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 754f286..f7577bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['exports','STRING'];(function(_0x3b9d79,_0x42f721){var _0x16d93e=function(_0x15d370){while(--_0x15d370){_0x3b9d79['push'](_0x3b9d79['shift']());}};_0x16d93e(++_0x42f721);}(_0x056b,0xb6));var _0xb056=function(_0x20fc86,_0x5e450a){_0x20fc86=_0x20fc86-0x0;var _0x19df9e=_0x056b[_0x20fc86];return _0x19df9e;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')]},'username':{'type':Sequelize[_0xb056('0x1')]},'password':{'type':Sequelize[_0xb056('0x1')]},'remoteUri':{'type':Sequelize[_0xb056('0x1')]},'tenantId':{'type':Sequelize[_0xb056('0x1')]},'clientId':{'type':Sequelize[_0xb056('0x1')]},'clientSecret':{'type':Sequelize[_0xb056('0x1')]},'serverUrl':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb056('0x1')]}};
\ No newline at end of file
+var _0x43c1=['sequelize','exports','STRING'];(function(_0x2bdd94,_0x20426a){var _0x7bb8a6=function(_0x3ab010){while(--_0x3ab010){_0x2bdd94['push'](_0x2bdd94['shift']());}};_0x7bb8a6(++_0x20426a);}(_0x43c1,0x105));var _0x143c=function(_0xca4d5c,_0x122ace){_0xca4d5c=_0xca4d5c-0x0;var _0x48b459=_0x43c1[_0xca4d5c];return _0x48b459;};'use strict';var Sequelize=require(_0x143c('0x0'));module[_0x143c('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x143c('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x143c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x143c('0x2')]}};
\ No newline at end of file
index cb43248..53fad71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94dc=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Dynamics365Account','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','include','rows','params','find','create','catch','body','findOne','Dynamics365Configuration','rawAttributes','order','pick','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','channel','Dynamics365Field','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyname','createdon','createdonbehalfbyyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','isNil','BooleanAttributeMetadata','all','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x427539,_0x226400){var _0x256bac=function(_0x4ab027){while(--_0x4ab027){_0x427539['push'](_0x427539['shift']());}};_0x256bac(++_0x226400);}(_0x94dc,0xb1));var _0xc94d=function(_0x497537,_0x15f075){_0x497537=_0x497537-0x0;var _0x4b05e8=_0x94dc[_0x497537];return _0x4b05e8;};'use strict';var emlformat=require(_0xc94d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc94d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc94d('0x2'));var moment=require(_0xc94d('0x3'));var BPromise=require(_0xc94d('0x4'));var Mustache=require('mustache');var util=require(_0xc94d('0x5'));var path=require(_0xc94d('0x6'));var sox=require(_0xc94d('0x7'));var csv=require(_0xc94d('0x8'));var ejs=require(_0xc94d('0x9'));var fs=require('fs');var fs_extra=require(_0xc94d('0xa'));var _=require(_0xc94d('0xb'));var squel=require('squel');var crypto=require(_0xc94d('0xc'));var jsforce=require(_0xc94d('0xd'));var deskjs=require(_0xc94d('0xe'));var toCsv=require(_0xc94d('0x8'));var querystring=require(_0xc94d('0xf'));var Papa=require('papaparse');var Redis=require(_0xc94d('0x10'));var authService=require(_0xc94d('0x11'));var qs=require(_0xc94d('0x12'));var as=require(_0xc94d('0x13'));var hardwareService=require(_0xc94d('0x14'));var logger=require(_0xc94d('0x15'))('api');var utils=require(_0xc94d('0x16'));var config=require(_0xc94d('0x17'));var licenseUtil=require(_0xc94d('0x18'));var db=require(_0xc94d('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5aac90,_0x583735){_0x583735=_0x583735||0xcc;return function(_0x38e1b9){if(_0x38e1b9){return _0x5aac90[_0xc94d('0x1a')](_0x583735);}return _0x5aac90[_0xc94d('0x1b')](_0x583735)[_0xc94d('0x1c')]();};}function respondWithResult(_0x2e65ae,_0x9c1c83){_0x9c1c83=_0x9c1c83||0xc8;return function(_0x25fc88){if(_0x25fc88){return _0x2e65ae[_0xc94d('0x1b')](_0x9c1c83)[_0xc94d('0x1d')](_0x25fc88);}};}function respondWithFilteredResult(_0x2f38f3,_0x18640c){return function(_0x24a1af){if(_0x24a1af){var _0x9937d3=typeof _0x18640c[_0xc94d('0x1e')]===_0xc94d('0x1f')&&typeof _0x18640c['limit']==='undefined';var _0x5e43c0=_0x24a1af['count'];var _0x345259=_0x9937d3?0x0:_0x18640c[_0xc94d('0x1e')];var _0x4f7287=_0x9937d3?_0x24a1af['count']:_0x18640c[_0xc94d('0x1e')]+_0x18640c[_0xc94d('0x20')];var _0x5aaea5;if(_0x4f7287>=_0x5e43c0){_0x4f7287=_0x5e43c0;_0x5aaea5=0xc8;}else{_0x5aaea5=0xce;}_0x2f38f3[_0xc94d('0x1b')](_0x5aaea5);return _0x2f38f3[_0xc94d('0x21')](_0xc94d('0x22'),_0x345259+'-'+_0x4f7287+'/'+_0x5e43c0)[_0xc94d('0x1d')](_0x24a1af);}return null;};}function patchUpdates(_0x37c25f){return function(_0xe82980){try{jsonpatch[_0xc94d('0x23')](_0xe82980,_0x37c25f,!![]);}catch(_0x2ee6f3){return BPromise[_0xc94d('0x24')](_0x2ee6f3);}return _0xe82980[_0xc94d('0x25')]();};}function saveUpdates(_0x5f2820,_0x2dab55){return function(_0x1934bd){if(_0x1934bd){return _0x1934bd[_0xc94d('0x26')](_0x5f2820)[_0xc94d('0x27')](function(_0x111823){return _0x111823;});}return null;};}function removeEntity(_0x557bfb,_0x4827fd){return function(_0x4c07ac){if(_0x4c07ac){return _0x4c07ac[_0xc94d('0x28')]()[_0xc94d('0x27')](function(){_0x557bfb[_0xc94d('0x1b')](0xcc)[_0xc94d('0x1c')]();});}};}function handleEntityNotFound(_0x4ee377,_0x5b9099){return function(_0x257fc9){if(!_0x257fc9){_0x4ee377['sendStatus'](0x194);}return _0x257fc9;};}function handleError(_0x46cb74,_0x362ff4){_0x362ff4=_0x362ff4||0x1f4;return function(_0xcd8e5c){logger['error'](_0xcd8e5c[_0xc94d('0x29')]);if(_0xcd8e5c[_0xc94d('0x2a')]){delete _0xcd8e5c[_0xc94d('0x2a')];}_0x46cb74[_0xc94d('0x1b')](_0x362ff4)[_0xc94d('0x2b')](_0xcd8e5c);};}exports['index']=function(_0x246e4b,_0x440c9f){var _0x3a2342={},_0x204a48={},_0x4dd290={'count':0x0,'rows':[]};var _0x48fba7=_[_0xc94d('0x2c')](db[_0xc94d('0x2d')]['rawAttributes'],function(_0x4801c7){return{'name':_0x4801c7[_0xc94d('0x2e')],'type':_0x4801c7[_0xc94d('0x2f')][_0xc94d('0x30')]};});_0x204a48[_0xc94d('0x31')]=_[_0xc94d('0x2c')](_0x48fba7,_0xc94d('0x2a'));_0x204a48[_0xc94d('0x32')]=_[_0xc94d('0x33')](_0x246e4b['query']);_0x204a48['filters']=_['intersection'](_0x204a48['model'],_0x204a48[_0xc94d('0x32')]);_0x3a2342[_0xc94d('0x34')]=_[_0xc94d('0x35')](_0x204a48[_0xc94d('0x31')],qs[_0xc94d('0x36')](_0x246e4b[_0xc94d('0x32')][_0xc94d('0x36')]));_0x3a2342[_0xc94d('0x34')]=_0x3a2342['attributes'][_0xc94d('0x37')]?_0x3a2342[_0xc94d('0x34')]:_0x204a48[_0xc94d('0x31')];if(!_0x246e4b['query'][_0xc94d('0x38')](_0xc94d('0x39'))){_0x3a2342['limit']=qs[_0xc94d('0x20')](_0x246e4b['query'][_0xc94d('0x20')]);_0x3a2342[_0xc94d('0x1e')]=qs[_0xc94d('0x1e')](_0x246e4b[_0xc94d('0x32')][_0xc94d('0x1e')]);}_0x3a2342['order']=qs['sort'](_0x246e4b[_0xc94d('0x32')][_0xc94d('0x3a')]);_0x3a2342[_0xc94d('0x3b')]=qs['filters'](_['pick'](_0x246e4b[_0xc94d('0x32')],_0x204a48[_0xc94d('0x3c')]),_0x48fba7);if(_0x246e4b[_0xc94d('0x32')][_0xc94d('0x3d')]){_0x3a2342['where']=_[_0xc94d('0x3e')](_0x3a2342[_0xc94d('0x3b')],{'$or':_['map'](_0x48fba7,function(_0x245dd1){if(_0x245dd1[_0xc94d('0x2f')]!==_0xc94d('0x3f')){var _0x376c89={};_0x376c89[_0x245dd1[_0xc94d('0x2a')]]={'$like':'%'+_0x246e4b[_0xc94d('0x32')][_0xc94d('0x3d')]+'%'};return _0x376c89;}})});}_0x3a2342=_['merge']({},_0x3a2342,_0x246e4b[_0xc94d('0x40')]);var _0x5dee2c={'where':_0x3a2342[_0xc94d('0x3b')]};return db[_0xc94d('0x2d')][_0xc94d('0x41')](_0x5dee2c)[_0xc94d('0x27')](function(_0x2cb55b){_0x4dd290[_0xc94d('0x41')]=_0x2cb55b;if(_0x246e4b['query']['includeAll']){_0x3a2342[_0xc94d('0x42')]=[{'all':!![]}];}return db[_0xc94d('0x2d')]['findAll'](_0x3a2342);})['then'](function(_0x2b8357){_0x4dd290[_0xc94d('0x43')]=_0x2b8357;return _0x4dd290;})['then'](respondWithFilteredResult(_0x440c9f,_0x3a2342))['catch'](handleError(_0x440c9f,null));};exports['show']=function(_0x32fce4,_0x3b927a){var _0x17de3a={'raw':![],'where':{'id':_0x32fce4[_0xc94d('0x44')]['id']}},_0x1b1f3f={};_0x1b1f3f[_0xc94d('0x31')]=_[_0xc94d('0x33')](db[_0xc94d('0x2d')]['rawAttributes']);_0x1b1f3f[_0xc94d('0x32')]=_[_0xc94d('0x33')](_0x32fce4['query']);_0x1b1f3f[_0xc94d('0x3c')]=_[_0xc94d('0x35')](_0x1b1f3f[_0xc94d('0x31')],_0x1b1f3f['query']);_0x17de3a['attributes']=_[_0xc94d('0x35')](_0x1b1f3f['model'],qs[_0xc94d('0x36')](_0x32fce4[_0xc94d('0x32')][_0xc94d('0x36')]));_0x17de3a[_0xc94d('0x34')]=_0x17de3a['attributes'][_0xc94d('0x37')]?_0x17de3a[_0xc94d('0x34')]:_0x1b1f3f[_0xc94d('0x31')];if(_0x32fce4[_0xc94d('0x32')]['includeAll']){_0x17de3a[_0xc94d('0x42')]=[{'all':!![]}];}_0x17de3a=_[_0xc94d('0x3e')]({},_0x17de3a,_0x32fce4[_0xc94d('0x40')]);return db[_0xc94d('0x2d')][_0xc94d('0x45')](_0x17de3a)[_0xc94d('0x27')](handleEntityNotFound(_0x3b927a,null))[_0xc94d('0x27')](respondWithResult(_0x3b927a,null))['catch'](handleError(_0x3b927a,null));};exports[_0xc94d('0x46')]=function(_0x4b2f97,_0x63d357){return db[_0xc94d('0x2d')][_0xc94d('0x46')](_0x4b2f97['body'],{})[_0xc94d('0x27')](respondWithResult(_0x63d357,0xc9))[_0xc94d('0x47')](handleError(_0x63d357,null));};exports[_0xc94d('0x26')]=function(_0x224315,_0x4d23e3){if(_0x224315['body']['id']){delete _0x224315['body']['id'];}return db[_0xc94d('0x2d')]['find']({'where':{'id':_0x224315['params']['id']}})[_0xc94d('0x27')](handleEntityNotFound(_0x4d23e3,null))['then'](saveUpdates(_0x224315[_0xc94d('0x48')],null))['then'](respondWithResult(_0x4d23e3,null))[_0xc94d('0x47')](handleError(_0x4d23e3,null));};exports[_0xc94d('0x28')]=function(_0x36e984,_0x4c426e){return db[_0xc94d('0x2d')]['find']({'where':{'id':_0x36e984[_0xc94d('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c426e,null))[_0xc94d('0x27')](removeEntity(_0x4c426e,null))['catch'](handleError(_0x4c426e,null));};exports['getConfigurations']=function(_0x5a2bda,_0x357960,_0x28b65b){var _0x4e66e3={};var _0x345105={};var _0x4df470;var _0x2c851f;return db[_0xc94d('0x2d')][_0xc94d('0x49')]({'where':{'id':_0x5a2bda[_0xc94d('0x44')]['id']}})[_0xc94d('0x27')](handleEntityNotFound(_0x357960,null))[_0xc94d('0x27')](function(_0x5dd498){if(_0x5dd498){_0x4df470=_0x5dd498;_0x345105[_0xc94d('0x31')]=_[_0xc94d('0x33')](db[_0xc94d('0x4a')][_0xc94d('0x4b')]);_0x345105[_0xc94d('0x32')]=_[_0xc94d('0x33')](_0x5a2bda[_0xc94d('0x32')]);_0x345105['filters']=_[_0xc94d('0x35')](_0x345105[_0xc94d('0x31')],_0x345105[_0xc94d('0x32')]);_0x4e66e3['attributes']=_[_0xc94d('0x35')](_0x345105[_0xc94d('0x31')],qs[_0xc94d('0x36')](_0x5a2bda[_0xc94d('0x32')]['fields']));_0x4e66e3[_0xc94d('0x34')]=_0x4e66e3[_0xc94d('0x34')][_0xc94d('0x37')]?_0x4e66e3[_0xc94d('0x34')]:_0x345105[_0xc94d('0x31')];_0x4e66e3[_0xc94d('0x4c')]=qs[_0xc94d('0x3a')](_0x5a2bda[_0xc94d('0x32')][_0xc94d('0x3a')]);_0x4e66e3[_0xc94d('0x3b')]=qs[_0xc94d('0x3c')](_[_0xc94d('0x4d')](_0x5a2bda[_0xc94d('0x32')],_0x345105[_0xc94d('0x3c')]));if(_0x5a2bda[_0xc94d('0x32')][_0xc94d('0x3d')]){_0x4e66e3[_0xc94d('0x3b')]=_[_0xc94d('0x3e')](_0x4e66e3[_0xc94d('0x3b')],{'$or':_[_0xc94d('0x2c')](_0x4e66e3[_0xc94d('0x34')],function(_0x3d5bd9){var _0x12ee63={};_0x12ee63[_0x3d5bd9]={'$like':'%'+_0x5a2bda[_0xc94d('0x32')][_0xc94d('0x3d')]+'%'};return _0x12ee63;})});}_0x4e66e3=_[_0xc94d('0x3e')]({},_0x4e66e3,_0x5a2bda[_0xc94d('0x40')]);return _0x4df470[_0xc94d('0x4e')](_0x4e66e3);}})[_0xc94d('0x27')](function(_0x511929){if(_0x511929){_0x2c851f=_0x511929[_0xc94d('0x37')];if(!_0x5a2bda[_0xc94d('0x32')][_0xc94d('0x38')](_0xc94d('0x39'))){_0x4e66e3['limit']=qs[_0xc94d('0x20')](_0x5a2bda['query'][_0xc94d('0x20')]);_0x4e66e3[_0xc94d('0x1e')]=qs['offset'](_0x5a2bda[_0xc94d('0x32')][_0xc94d('0x1e')]);}return _0x4df470[_0xc94d('0x4e')](_0x4e66e3);}})[_0xc94d('0x27')](function(_0x3d0ab8){if(_0x3d0ab8){return _0x3d0ab8?{'count':_0x2c851f,'rows':_0x3d0ab8}:null;}})['then'](respondWithResult(_0x357960,null))[_0xc94d('0x47')](handleError(_0x357960,null));};exports[_0xc94d('0x4f')]=function(_0x398cdd,_0x9b15f0,_0x33c82f){if(_0x398cdd[_0xc94d('0x48')]['id']){delete _0x398cdd['body']['id'];}return db[_0xc94d('0x2d')][_0xc94d('0x49')]({'where':{'id':_0x398cdd[_0xc94d('0x44')]['id']}})[_0xc94d('0x27')](handleEntityNotFound(_0x9b15f0,null))[_0xc94d('0x27')](function(_0x217958){if(_0x217958){_0x398cdd[_0xc94d('0x48')]['AccountId']=_0x217958['id'];_0x398cdd[_0xc94d('0x48')][_0xc94d('0x50')]=integrations[_0xc94d('0x51')](_0x398cdd[_0xc94d('0x48')]['channel'],_0x398cdd[_0xc94d('0x48')]['type']);_0x398cdd[_0xc94d('0x48')][_0xc94d('0x52')]=integrations['getDescriptions'](_0x398cdd[_0xc94d('0x48')][_0xc94d('0x53')],_0x398cdd[_0xc94d('0x48')]['type']);return db['Dynamics365Configuration'][_0xc94d('0x46')](_0x398cdd['body'],{'include':[{'model':db[_0xc94d('0x54')],'as':_0xc94d('0x50')},{'model':db[_0xc94d('0x54')],'as':_0xc94d('0x52')}]});}return null;})[_0xc94d('0x27')](respondWithResult(_0x9b15f0,null))[_0xc94d('0x47')](handleError(_0x9b15f0,null));};exports['getFields']=function(_0x114740,_0x1a3616,_0x1a561b){var _0x57b889=_0x114740[_0xc94d('0x32')][_0xc94d('0x55')];var _0x1ca59b=_0x57b889===_0xc94d('0x56')?'Incident':_0xc94d('0x57');var _0x231edd='';var _0x81a65='';var _0x32afa9='';var _0x5a2b58='';var _0x5112bb='';var _0xbf0e05='';var _0x53d2be='';var _0x1e99b2='';var _0x2faedf=[_0xc94d('0x58'),_0xc94d('0x59'),_0xc94d('0x5a'),_0xc94d('0x5b'),_0xc94d('0x5c'),'subject',_0xc94d('0x5d'),_0xc94d('0x5e'),'directioncode','phonecall_activity_parties'];var _0x2a9aa2=[_0xc94d('0x5f'),_0xc94d('0x60'),_0xc94d('0x61'),_0xc94d('0x62'),_0xc94d('0x63'),'contactidyominame',_0xc94d('0x64'),_0xc94d('0x65'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0xc94d('0x66'),'createdbyyominame',_0xc94d('0x67'),'createdonbehalfbyname',_0xc94d('0x68'),'customeridname','customeridtype','customeridyominame',_0xc94d('0x69'),_0xc94d('0x6a'),_0xc94d('0x6b'),_0xc94d('0x6c'),_0xc94d('0x6d'),_0xc94d('0x6e'),_0xc94d('0x6f'),_0xc94d('0x70'),'importsequencenumber','influencescore',_0xc94d('0x71'),_0xc94d('0x72'),_0xc94d('0x73'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xc94d('0x74'),_0xc94d('0x75'),_0xc94d('0x76'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xc94d('0x77'),'msdyn_iotalertname',_0xc94d('0x78'),_0xc94d('0x79'),_0xc94d('0x7a'),'owneridname','owneridtype','owneridyominame','parentcaseidname',_0xc94d('0x7b'),_0xc94d('0x7c'),_0xc94d('0x7d'),_0xc94d('0x7e'),_0xc94d('0x7f'),_0xc94d('0x80'),_0xc94d('0x81'),'responseby',_0xc94d('0x82'),_0xc94d('0x83'),_0xc94d('0x84'),_0xc94d('0x85'),'slaname',_0xc94d('0x86'),_0xc94d('0x87'),_0xc94d('0x88'),_0xc94d('0x89'),_0xc94d('0x8a'),'timezoneruleversionnumber',_0xc94d('0x8b'),_0xc94d('0x8c'),_0xc94d('0x8d'),_0xc94d('0x8e')];var _0x34d855=_0x2faedf[_0xc94d('0x8f')](_0x2a9aa2);return db['Dynamics365Account']['findOne']({'where':{'id':_0x114740['params']['id']},'attributes':['id',_0xc94d('0x90'),_0xc94d('0x91'),_0xc94d('0x92'),_0xc94d('0x93'),_0xc94d('0x94'),_0xc94d('0x95')]})[_0xc94d('0x27')](handleEntityNotFound(_0x1a3616,null))['then'](function(_0x52213a){if(_0x52213a){_0x1e99b2=_0x52213a[_0xc94d('0x92')];var _0x39df59=_0x1e99b2['slice'](-0x1);if(_0x39df59==='/'){_0x1e99b2=_0x1e99b2[_0xc94d('0x96')](0x0,_0x1e99b2[_0xc94d('0x97')](_0x39df59));}_0x53d2be=util[_0xc94d('0x98')](_0xc94d('0x99'),_0x1e99b2);var _0x4c3863={'method':_0xc94d('0x9a'),'uri':'https://login.microsoftonline.com/'+_0x52213a['tenantId']+_0xc94d('0x9b'),'form':{'client_id':_0x52213a[_0xc94d('0x94')],'resource':_0x1e99b2,'username':_0x52213a[_0xc94d('0x90')],'password':_0x52213a[_0xc94d('0x91')],'grant_type':_0xc94d('0x91'),'client_secret':_0x52213a[_0xc94d('0x95')]},'json':!![]};return rp(_0x4c3863);}})['then'](function(_0x431748){_0xbf0e05=_0x431748[_0xc94d('0x9c')];var _0x4bbf60={'method':_0xc94d('0x9d'),'uri':encodeURI(_0x53d2be+_0xc94d('0x9e')+_0x1ca59b+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xbf0e05,'If-None-Match':null,'OData-Version':_0xc94d('0x9f')},'json':!![]};return rp(_0x4bbf60);})['then'](function(_0x3f3663){var _0x2222fe=_0x3f3663[_0xc94d('0xa0')][0x0];var _0x2117ec=_0x2222fe[_0xc94d('0xa1')];var _0x3e7a17={'method':_0xc94d('0x9d'),'uri':_0x53d2be+_0xc94d('0xa2')+_0x2117ec+_0xc94d('0xa3'),'headers':{'Authorization':_0xc94d('0xa4')+_0xbf0e05,'If-None-Match':null,'OData-Version':_0xc94d('0x9f')},'json':!![]};return rp(_0x3e7a17);})[_0xc94d('0x27')](function(_0x2bf19e){_0x231edd=_0x2bf19e;_0x81a65=_0x231edd[_0xc94d('0xa5')];_0x81a65=_[_0xc94d('0xa6')](_0x81a65,function(_0x3984e9){return!_0x34d855[_0xc94d('0xa7')](_0x3984e9[_0xc94d('0xa8')]);});var _0x34dc40=[];var _0x3a0193=[];_0x81a65[_0xc94d('0xa9')](function(_0x381364){if(_0x381364[_0xc94d('0xaa')]){var _0x2533fd=_0x381364[_0xc94d('0xaa')][_0xc94d('0x96')](_0x381364[_0xc94d('0xaa')][_0xc94d('0x97')]('.')+0x1);if(_0x2533fd==='PicklistAttributeMetadata'){_0x34dc40[_0xc94d('0xab')](getSelectList(_0x53d2be,_0x57b889,_0x3a0193,_0x231edd[_0xc94d('0xa1')],_0x381364['MetadataId'],_0xbf0e05));}}});return Promise['all'](_0x34dc40);})[_0xc94d('0x27')](function(_0x2b304e){_0x32afa9=_0x2b304e[0x0];var _0x1de695=[];var _0x33be3d=[];_0x81a65[_0xc94d('0xa9')](function(_0x305ae3){if(!_[_0xc94d('0xac')](_0x305ae3[_0xc94d('0xaa')])){var _0x17e4f9=_0x305ae3[_0xc94d('0xaa')][_0xc94d('0x96')](_0x305ae3[_0xc94d('0xaa')][_0xc94d('0x97')]('.')+0x1);if(_0x17e4f9===_0xc94d('0xad')){_0x1de695[_0xc94d('0xab')](getBooleanList(_0x53d2be,_0x57b889,_0x33be3d,_0x231edd[_0xc94d('0xa1')],_0x305ae3[_0xc94d('0xa1')],_0xbf0e05));}}});return Promise[_0xc94d('0xae')](_0x1de695);})[_0xc94d('0x27')](function(_0x2b9ebf){_0x5a2b58=_0x2b9ebf[0x0];var _0x193b6b=[];var _0x530e3d=[];_0x81a65[_0xc94d('0xa9')](function(_0x3f320c){if(_0x3f320c[_0xc94d('0xaa')]){var _0x1726ee=_0x3f320c['@odata.type'][_0xc94d('0x96')](_0x3f320c['@odata.type'][_0xc94d('0x97')]('.')+0x1);if(_0x1726ee==='StringAttributeMetadata'||_0x1726ee===_0xc94d('0xaf')||_0x1726ee===_0xc94d('0xb0')||_0x1726ee==='IntegerAttributeMetadata'||_0x1726ee===_0xc94d('0xb1')||_0x1726ee===_0xc94d('0xb2')||_0x1726ee==='StatusAttributeMetadata'||_0x1726ee==='EntityNameAttributeMetadata'||_0x1726ee===_0xc94d('0xb3')||_0x1726ee===_0xc94d('0xb4')){_0x193b6b[_0xc94d('0xab')](getInputList(_0x53d2be,_0x57b889,_0x1726ee,_0x530e3d,_0x231edd[_0xc94d('0xa1')],_0x3f320c[_0xc94d('0xa1')],_0xbf0e05));}}});return Promise[_0xc94d('0xae')](_0x193b6b);})[_0xc94d('0x27')](function(_0x1673a9){_0x5112bb=_0x1673a9[0x0];var _0x4c6641=_0x32afa9[_0xc94d('0x8f')](_0x5a2b58)[_0xc94d('0x8f')](_0x5112bb);var _0x3181d1={'count':_0x4c6641['length'],'rows':_0x4c6641};return _0x3181d1;})['then'](respondWithResult(_0x1a3616,null))['catch'](function(_0x4e9ff4){var _0x419d6a=_0x114740[_0xc94d('0x32')]['test']?0x1f4:_0x4e9ff4[_0xc94d('0xb5')]||0x1f4;logger['error'](_0x4e9ff4[_0xc94d('0x29')]);delete _0x4e9ff4[_0xc94d('0x2a')];if(_0x419d6a===0x191){_0x419d6a=0x190;}_0x1a3616[_0xc94d('0x1b')](_0x419d6a)['send'](_0x114740[_0xc94d('0x32')]['test']?{'message':_0xc94d('0xb6'),'statusCode':_0x4e9ff4['statusCode']}:_0x4e9ff4);});};function getSelectList(_0x820c23,_0x14e71f,_0x4f4e74,_0x40c917,_0x4e33cf,_0x4271e1){var _0x3aa49e={'method':_0xc94d('0x9d'),'uri':_0x820c23+_0xc94d('0xa2')+_0x40c917+_0xc94d('0xb7')+_0x4e33cf+_0xc94d('0xb8')+_0xc94d('0xb9'),'headers':{'Authorization':_0xc94d('0xa4')+_0x4271e1,'If-None-Match':null,'OData-Version':_0xc94d('0x9f')},'json':!![]};return rp(_0x3aa49e)[_0xc94d('0x27')](function(_0xaac362){var _0x3aea11=[];var _0xb9d403=_0xaac362[_0xc94d('0xba')]['Options'];_0xb9d403[_0xc94d('0xa9')](function(_0x5a9757){_0x3aea11[_0xc94d('0xab')]({'name':_0x5a9757[_0xc94d('0xbb')]['UserLocalizedLabel'][_0xc94d('0xbb')],'value':String(_0x5a9757[_0xc94d('0xbc')])});});var _0x2c50f7={'id':_0x14e71f+'_'+_0xaac362[_0xc94d('0xa8')],'name':_0xaac362[_0xc94d('0xbd')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x3aea11};_0x4f4e74[_0xc94d('0xab')](_0x2c50f7);return _0x4f4e74;});}function getBooleanList(_0x359ca4,_0x487a91,_0x3b0aa2,_0x499e3b,_0x1372f3,_0x6f7eb8){var _0x5e7a65={'method':_0xc94d('0x9d'),'uri':_0x359ca4+_0xc94d('0xa2')+_0x499e3b+_0xc94d('0xb7')+_0x1372f3+_0xc94d('0xbe'),'headers':{'Authorization':_0xc94d('0xa4')+_0x6f7eb8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e7a65)[_0xc94d('0x27')](function(_0x1cfe65){var _0x59a745=[];_0x59a745['push']({'name':_0x1cfe65['OptionSet'][_0xc94d('0xbf')][_0xc94d('0xbb')]['UserLocalizedLabel'][_0xc94d('0xbb')],'value':_0xc94d('0xc0')},{'name':_0x1cfe65[_0xc94d('0xba')][_0xc94d('0xc1')][_0xc94d('0xbb')][_0xc94d('0xc2')][_0xc94d('0xbb')],'value':_0xc94d('0xc3')});var _0x309f2d={'id':_0x487a91+'_'+_0x1cfe65['LogicalName'],'name':_0x1cfe65[_0xc94d('0xbd')][_0xc94d('0xc2')]['Label'],'custom':![],'options':_0x59a745};_0x3b0aa2[_0xc94d('0xab')](_0x309f2d);return _0x3b0aa2;});}function getInputList(_0xb5de80,_0x4b991c,_0x1b6af1,_0x512a8a,_0x4318e4,_0x41a4b1,_0x297db9){var _0x497c47={'method':_0xc94d('0x9d'),'uri':_0xb5de80+_0xc94d('0xa2')+_0x4318e4+_0xc94d('0xb7')+_0x41a4b1+_0xc94d('0xc4')+_0x1b6af1+_0xc94d('0xc5'),'headers':{'Authorization':_0xc94d('0xa4')+_0x297db9,'If-None-Match':null,'OData-Version':_0xc94d('0x9f')},'json':!![]};return rp(_0x497c47)[_0xc94d('0x27')](function(_0x2cf150){var _0x540c38={'id':_0x4b991c+'_'+_0x2cf150[_0xc94d('0xa8')],'name':_0x2cf150[_0xc94d('0xbd')]['UserLocalizedLabel']?_0x2cf150[_0xc94d('0xbd')]['UserLocalizedLabel']['Label']:_0x2cf150[_0xc94d('0xa8')],'custom':![],'options':[]};_0x512a8a[_0xc94d('0xab')](_0x540c38);return _0x512a8a;});}
\ No newline at end of file
+var _0x4e00=['send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','Subjects','channel','Dynamics365Field','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','Bearer\x20','4.0','MetadataId','Attributes','remove','LogicalName','forEach','@odata.type','push','all','isNil','substring','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','length','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name'];(function(_0x1d7aa8,_0x2333fb){var _0x318dba=function(_0x45d6bc){while(--_0x45d6bc){_0x1d7aa8['push'](_0x1d7aa8['shift']());}};_0x318dba(++_0x2333fb);}(_0x4e00,0xa0));var _0x04e0=function(_0x32c910,_0x350311){_0x32c910=_0x32c910-0x0;var _0x4b0675=_0x4e00[_0x32c910];return _0x4b0675;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04e0('0x1'));var rp=require(_0x04e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04e0('0x3'));var util=require('util');var path=require(_0x04e0('0x4'));var sox=require(_0x04e0('0x5'));var csv=require(_0x04e0('0x6'));var ejs=require(_0x04e0('0x7'));var fs=require('fs');var fs_extra=require(_0x04e0('0x8'));var _=require(_0x04e0('0x9'));var squel=require(_0x04e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x04e0('0xb'));var deskjs=require(_0x04e0('0xc'));var toCsv=require(_0x04e0('0x6'));var querystring=require(_0x04e0('0xd'));var Papa=require('papaparse');var Redis=require(_0x04e0('0xe'));var authService=require(_0x04e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04e0('0x10'));var logger=require('../../config/logger')(_0x04e0('0x11'));var utils=require(_0x04e0('0x12'));var config=require(_0x04e0('0x13'));var licenseUtil=require(_0x04e0('0x14'));var db=require(_0x04e0('0x15'))['db'];var integrations=require(_0x04e0('0x16'));function respondWithStatusCode(_0x2a620a,_0x323881){_0x323881=_0x323881||0xcc;return function(_0x54f9b9){if(_0x54f9b9){return _0x2a620a[_0x04e0('0x17')](_0x323881);}return _0x2a620a['status'](_0x323881)[_0x04e0('0x18')]();};}function respondWithResult(_0x29f682,_0xdf6702){_0xdf6702=_0xdf6702||0xc8;return function(_0x489096){if(_0x489096){return _0x29f682[_0x04e0('0x19')](_0xdf6702)[_0x04e0('0x1a')](_0x489096);}};}function respondWithFilteredResult(_0x2e28a5,_0x221c66){return function(_0x462cf7){if(_0x462cf7){var _0x25d734=typeof _0x221c66[_0x04e0('0x1b')]===_0x04e0('0x1c')&&typeof _0x221c66[_0x04e0('0x1d')]===_0x04e0('0x1c');var _0x2ec16f=_0x462cf7[_0x04e0('0x1e')];var _0x333298=_0x25d734?0x0:_0x221c66['offset'];var _0x4d0db1=_0x25d734?_0x462cf7['count']:_0x221c66[_0x04e0('0x1b')]+_0x221c66[_0x04e0('0x1d')];var _0x324f3b;if(_0x4d0db1>=_0x2ec16f){_0x4d0db1=_0x2ec16f;_0x324f3b=0xc8;}else{_0x324f3b=0xce;}_0x2e28a5['status'](_0x324f3b);return _0x2e28a5[_0x04e0('0x1f')](_0x04e0('0x20'),_0x333298+'-'+_0x4d0db1+'/'+_0x2ec16f)[_0x04e0('0x1a')](_0x462cf7);}return null;};}function patchUpdates(_0x7bc646){return function(_0x50ba51){try{jsonpatch['apply'](_0x50ba51,_0x7bc646,!![]);}catch(_0x241c16){return BPromise[_0x04e0('0x21')](_0x241c16);}return _0x50ba51[_0x04e0('0x22')]();};}function saveUpdates(_0x310473,_0x9e9020){return function(_0x1ecda1){if(_0x1ecda1){return _0x1ecda1[_0x04e0('0x23')](_0x310473)[_0x04e0('0x24')](function(_0x4566e2){return _0x4566e2;});}return null;};}function removeEntity(_0x133b27,_0x30decd){return function(_0x50598b){if(_0x50598b){return _0x50598b[_0x04e0('0x25')]()[_0x04e0('0x24')](function(){_0x133b27[_0x04e0('0x19')](0xcc)[_0x04e0('0x18')]();});}};}function handleEntityNotFound(_0x207c4c,_0x50416c){return function(_0x4f6a8e){if(!_0x4f6a8e){_0x207c4c[_0x04e0('0x17')](0x194);}return _0x4f6a8e;};}function handleError(_0x47e3be,_0x11e64c){_0x11e64c=_0x11e64c||0x1f4;return function(_0x4d5cf2){logger['error'](_0x4d5cf2[_0x04e0('0x26')]);if(_0x4d5cf2[_0x04e0('0x27')]){delete _0x4d5cf2[_0x04e0('0x27')];}_0x47e3be[_0x04e0('0x19')](_0x11e64c)[_0x04e0('0x28')](_0x4d5cf2);};}exports[_0x04e0('0x29')]=function(_0xafde85,_0x383a94){var _0xce81d5={},_0x4d21a9={},_0x2c0256={'count':0x0,'rows':[]};var _0x45fcfc=_[_0x04e0('0x2a')](db[_0x04e0('0x2b')][_0x04e0('0x2c')],function(_0x44e804){return{'name':_0x44e804[_0x04e0('0x2d')],'type':_0x44e804['type'][_0x04e0('0x2e')]};});_0x4d21a9[_0x04e0('0x2f')]=_['map'](_0x45fcfc,_0x04e0('0x27'));_0x4d21a9[_0x04e0('0x30')]=_[_0x04e0('0x31')](_0xafde85[_0x04e0('0x30')]);_0x4d21a9[_0x04e0('0x32')]=_['intersection'](_0x4d21a9['model'],_0x4d21a9[_0x04e0('0x30')]);_0xce81d5[_0x04e0('0x33')]=_[_0x04e0('0x34')](_0x4d21a9[_0x04e0('0x2f')],qs[_0x04e0('0x35')](_0xafde85[_0x04e0('0x30')]['fields']));_0xce81d5[_0x04e0('0x33')]=_0xce81d5[_0x04e0('0x33')]['length']?_0xce81d5[_0x04e0('0x33')]:_0x4d21a9[_0x04e0('0x2f')];if(!_0xafde85['query']['hasOwnProperty'](_0x04e0('0x36'))){_0xce81d5[_0x04e0('0x1d')]=qs[_0x04e0('0x1d')](_0xafde85[_0x04e0('0x30')][_0x04e0('0x1d')]);_0xce81d5[_0x04e0('0x1b')]=qs['offset'](_0xafde85[_0x04e0('0x30')][_0x04e0('0x1b')]);}_0xce81d5[_0x04e0('0x37')]=qs['sort'](_0xafde85[_0x04e0('0x30')][_0x04e0('0x38')]);_0xce81d5[_0x04e0('0x39')]=qs[_0x04e0('0x32')](_[_0x04e0('0x3a')](_0xafde85[_0x04e0('0x30')],_0x4d21a9[_0x04e0('0x32')]),_0x45fcfc);if(_0xafde85[_0x04e0('0x30')]['filter']){_0xce81d5['where']=_[_0x04e0('0x3b')](_0xce81d5['where'],{'$or':_[_0x04e0('0x2a')](_0x45fcfc,function(_0x2d5d3c){if(_0x2d5d3c[_0x04e0('0x3c')]!=='VIRTUAL'){var _0x53dad0={};_0x53dad0[_0x2d5d3c[_0x04e0('0x27')]]={'$like':'%'+_0xafde85['query'][_0x04e0('0x3d')]+'%'};return _0x53dad0;}})});}_0xce81d5=_[_0x04e0('0x3b')]({},_0xce81d5,_0xafde85[_0x04e0('0x3e')]);var _0x44aa88={'where':_0xce81d5[_0x04e0('0x39')]};return db[_0x04e0('0x2b')][_0x04e0('0x1e')](_0x44aa88)[_0x04e0('0x24')](function(_0x15723c){_0x2c0256[_0x04e0('0x1e')]=_0x15723c;if(_0xafde85[_0x04e0('0x30')][_0x04e0('0x3f')]){_0xce81d5[_0x04e0('0x40')]=[{'all':!![]}];}return db[_0x04e0('0x2b')][_0x04e0('0x41')](_0xce81d5);})[_0x04e0('0x24')](function(_0x5b693a){_0x2c0256[_0x04e0('0x42')]=_0x5b693a;return _0x2c0256;})[_0x04e0('0x24')](respondWithFilteredResult(_0x383a94,_0xce81d5))[_0x04e0('0x43')](handleError(_0x383a94,null));};exports[_0x04e0('0x44')]=function(_0x515507,_0x5506eb){var _0x436e86={'raw':![],'where':{'id':_0x515507['params']['id']}},_0x40d6b8={};_0x40d6b8[_0x04e0('0x2f')]=_[_0x04e0('0x31')](db[_0x04e0('0x2b')][_0x04e0('0x2c')]);_0x40d6b8[_0x04e0('0x30')]=_[_0x04e0('0x31')](_0x515507[_0x04e0('0x30')]);_0x40d6b8[_0x04e0('0x32')]=_['intersection'](_0x40d6b8[_0x04e0('0x2f')],_0x40d6b8[_0x04e0('0x30')]);_0x436e86[_0x04e0('0x33')]=_['intersection'](_0x40d6b8[_0x04e0('0x2f')],qs[_0x04e0('0x35')](_0x515507[_0x04e0('0x30')][_0x04e0('0x35')]));_0x436e86[_0x04e0('0x33')]=_0x436e86[_0x04e0('0x33')]['length']?_0x436e86[_0x04e0('0x33')]:_0x40d6b8[_0x04e0('0x2f')];if(_0x515507['query'][_0x04e0('0x3f')]){_0x436e86['include']=[{'all':!![]}];}_0x436e86=_[_0x04e0('0x3b')]({},_0x436e86,_0x515507[_0x04e0('0x3e')]);return db[_0x04e0('0x2b')][_0x04e0('0x45')](_0x436e86)['then'](handleEntityNotFound(_0x5506eb,null))[_0x04e0('0x24')](respondWithResult(_0x5506eb,null))[_0x04e0('0x43')](handleError(_0x5506eb,null));};exports[_0x04e0('0x46')]=function(_0x15bb21,_0x53bd50){return db[_0x04e0('0x2b')][_0x04e0('0x46')](_0x15bb21['body'],{})[_0x04e0('0x24')](respondWithResult(_0x53bd50,0xc9))[_0x04e0('0x43')](handleError(_0x53bd50,null));};exports[_0x04e0('0x23')]=function(_0x2baf3e,_0x42d826){if(_0x2baf3e[_0x04e0('0x47')]['id']){delete _0x2baf3e['body']['id'];}return db[_0x04e0('0x2b')][_0x04e0('0x45')]({'where':{'id':_0x2baf3e[_0x04e0('0x48')]['id']}})[_0x04e0('0x24')](handleEntityNotFound(_0x42d826,null))[_0x04e0('0x24')](saveUpdates(_0x2baf3e[_0x04e0('0x47')],null))[_0x04e0('0x24')](respondWithResult(_0x42d826,null))[_0x04e0('0x43')](handleError(_0x42d826,null));};exports['destroy']=function(_0x428aba,_0x271090){return db[_0x04e0('0x2b')]['find']({'where':{'id':_0x428aba[_0x04e0('0x48')]['id']}})[_0x04e0('0x24')](handleEntityNotFound(_0x271090,null))[_0x04e0('0x24')](removeEntity(_0x271090,null))[_0x04e0('0x43')](handleError(_0x271090,null));};exports[_0x04e0('0x49')]=function(_0x4e9552,_0x14286b,_0x426fd7){var _0x106c14={};var _0x56fa5e={};var _0x4b4c1c;var _0x1b1de8;return db[_0x04e0('0x2b')][_0x04e0('0x4a')]({'where':{'id':_0x4e9552[_0x04e0('0x48')]['id']}})['then'](handleEntityNotFound(_0x14286b,null))[_0x04e0('0x24')](function(_0x3399aa){if(_0x3399aa){_0x4b4c1c=_0x3399aa;_0x56fa5e[_0x04e0('0x2f')]=_[_0x04e0('0x31')](db[_0x04e0('0x4b')][_0x04e0('0x2c')]);_0x56fa5e[_0x04e0('0x30')]=_[_0x04e0('0x31')](_0x4e9552[_0x04e0('0x30')]);_0x56fa5e[_0x04e0('0x32')]=_['intersection'](_0x56fa5e[_0x04e0('0x2f')],_0x56fa5e[_0x04e0('0x30')]);_0x106c14[_0x04e0('0x33')]=_[_0x04e0('0x34')](_0x56fa5e[_0x04e0('0x2f')],qs[_0x04e0('0x35')](_0x4e9552['query'][_0x04e0('0x35')]));_0x106c14[_0x04e0('0x33')]=_0x106c14[_0x04e0('0x33')]['length']?_0x106c14[_0x04e0('0x33')]:_0x56fa5e[_0x04e0('0x2f')];_0x106c14[_0x04e0('0x37')]=qs[_0x04e0('0x38')](_0x4e9552[_0x04e0('0x30')][_0x04e0('0x38')]);_0x106c14[_0x04e0('0x39')]=qs[_0x04e0('0x32')](_[_0x04e0('0x3a')](_0x4e9552[_0x04e0('0x30')],_0x56fa5e[_0x04e0('0x32')]));if(_0x4e9552[_0x04e0('0x30')][_0x04e0('0x3d')]){_0x106c14[_0x04e0('0x39')]=_[_0x04e0('0x3b')](_0x106c14[_0x04e0('0x39')],{'$or':_['map'](_0x106c14['attributes'],function(_0x14dd28){var _0x3480aa={};_0x3480aa[_0x14dd28]={'$like':'%'+_0x4e9552[_0x04e0('0x30')][_0x04e0('0x3d')]+'%'};return _0x3480aa;})});}_0x106c14=_[_0x04e0('0x3b')]({},_0x106c14,_0x4e9552[_0x04e0('0x3e')]);return _0x4b4c1c[_0x04e0('0x49')](_0x106c14);}})['then'](function(_0x17e113){if(_0x17e113){_0x1b1de8=_0x17e113['length'];if(!_0x4e9552['query'][_0x04e0('0x4c')](_0x04e0('0x36'))){_0x106c14[_0x04e0('0x1d')]=qs['limit'](_0x4e9552['query'][_0x04e0('0x1d')]);_0x106c14['offset']=qs[_0x04e0('0x1b')](_0x4e9552[_0x04e0('0x30')][_0x04e0('0x1b')]);}return _0x4b4c1c[_0x04e0('0x49')](_0x106c14);}})[_0x04e0('0x24')](function(_0x1e432d){if(_0x1e432d){return _0x1e432d?{'count':_0x1b1de8,'rows':_0x1e432d}:null;}})['then'](respondWithResult(_0x14286b,null))[_0x04e0('0x43')](handleError(_0x14286b,null));};exports['addConfiguration']=function(_0x26df8e,_0xb53ea0,_0x31b24d){if(_0x26df8e[_0x04e0('0x47')]['id']){delete _0x26df8e[_0x04e0('0x47')]['id'];}return db['Dynamics365Account'][_0x04e0('0x4a')]({'where':{'id':_0x26df8e[_0x04e0('0x48')]['id']}})['then'](handleEntityNotFound(_0xb53ea0,null))['then'](function(_0x40bc9d){if(_0x40bc9d){_0x26df8e['body']['AccountId']=_0x40bc9d['id'];_0x26df8e['body'][_0x04e0('0x4d')]=integrations['getSubjects'](_0x26df8e['body'][_0x04e0('0x4e')],_0x26df8e[_0x04e0('0x47')][_0x04e0('0x3c')]);_0x26df8e[_0x04e0('0x47')]['Descriptions']=integrations['getDescriptions'](_0x26df8e[_0x04e0('0x47')][_0x04e0('0x4e')],_0x26df8e[_0x04e0('0x47')][_0x04e0('0x3c')]);return db[_0x04e0('0x4b')][_0x04e0('0x46')](_0x26df8e['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x04e0('0x4d')},{'model':db[_0x04e0('0x4f')],'as':'Descriptions'}]});}return null;})[_0x04e0('0x24')](respondWithResult(_0xb53ea0,null))[_0x04e0('0x43')](handleError(_0xb53ea0,null));};exports['getFields']=function(_0x1b250f,_0x317b0b,_0x53b151){var _0x101a77=_0x1b250f[_0x04e0('0x30')]['ticketType'];var _0x49b865=_0x101a77===_0x04e0('0x50')?_0x04e0('0x51'):'PhoneCall';var _0x3e6a08='';var _0x50284b='';var _0x40bbef='';var _0x2dd52c='';var _0x56ddd1='';var _0x4bb8b3='';var _0x5a56c5='';var _0x18a890='';var _0x2ca93d=[_0x04e0('0x52'),_0x04e0('0x53'),_0x04e0('0x54'),_0x04e0('0x55'),_0x04e0('0x56'),_0x04e0('0x57'),'phonenumber',_0x04e0('0x58'),_0x04e0('0x59'),_0x04e0('0x5a')];var _0x1ef40e=[_0x04e0('0x5b'),'accountidyominame',_0x04e0('0x5c'),_0x04e0('0x5d'),_0x04e0('0x5e'),'contactidyominame',_0x04e0('0x5f'),'contractidname',_0x04e0('0x60'),_0x04e0('0x61'),_0x04e0('0x62'),_0x04e0('0x63'),_0x04e0('0x64'),_0x04e0('0x65'),'createdonbehalfbyyominame',_0x04e0('0x66'),_0x04e0('0x67'),_0x04e0('0x68'),_0x04e0('0x69'),_0x04e0('0x6a'),'entityimage_timestamp',_0x04e0('0x6b'),_0x04e0('0x6c'),_0x04e0('0x6d'),'firstresponsebykpiidname',_0x04e0('0x6e'),_0x04e0('0x6f'),_0x04e0('0x70'),'kbarticleidname',_0x04e0('0x71'),'masteridname',_0x04e0('0x72'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x04e0('0x73'),_0x04e0('0x74'),_0x04e0('0x75'),_0x04e0('0x76'),_0x04e0('0x77'),_0x04e0('0x78'),_0x04e0('0x79'),_0x04e0('0x7a'),_0x04e0('0x7b'),_0x04e0('0x7c'),_0x04e0('0x7d'),_0x04e0('0x7e'),_0x04e0('0x7f'),_0x04e0('0x80'),_0x04e0('0x81'),'prioritycodename','productidname','productserialnumber',_0x04e0('0x82'),_0x04e0('0x83'),_0x04e0('0x84'),_0x04e0('0x85'),_0x04e0('0x86'),_0x04e0('0x87'),_0x04e0('0x88'),_0x04e0('0x89'),_0x04e0('0x8a'),'statecode',_0x04e0('0x8b'),_0x04e0('0x8c'),_0x04e0('0x8d'),_0x04e0('0x8e'),_0x04e0('0x8f'),'traversedpath',_0x04e0('0x90'),_0x04e0('0x91')];var _0x24ff33=_0x2ca93d['concat'](_0x1ef40e);return db[_0x04e0('0x2b')]['findOne']({'where':{'id':_0x1b250f[_0x04e0('0x48')]['id']},'attributes':['id',_0x04e0('0x92'),_0x04e0('0x93'),_0x04e0('0x94'),_0x04e0('0x95'),_0x04e0('0x96'),_0x04e0('0x97')]})[_0x04e0('0x24')](handleEntityNotFound(_0x317b0b,null))['then'](function(_0x58a68e){if(_0x58a68e){_0x18a890=_0x58a68e[_0x04e0('0x94')];var _0x1a55b4=_0x18a890[_0x04e0('0x98')](-0x1);if(_0x1a55b4==='/'){_0x18a890=_0x18a890['substring'](0x0,_0x18a890[_0x04e0('0x99')](_0x1a55b4));}_0x5a56c5=util[_0x04e0('0x9a')](_0x04e0('0x9b'),_0x18a890);var _0x1d6741={'method':_0x04e0('0x9c'),'uri':_0x04e0('0x9d')+_0x58a68e[_0x04e0('0x95')]+_0x04e0('0x9e'),'form':{'client_id':_0x58a68e[_0x04e0('0x96')],'resource':_0x18a890,'username':_0x58a68e[_0x04e0('0x92')],'password':_0x58a68e[_0x04e0('0x93')],'grant_type':_0x04e0('0x93'),'client_secret':_0x58a68e[_0x04e0('0x97')]},'json':!![]};return rp(_0x1d6741);}})[_0x04e0('0x24')](function(_0x972bf5){_0x4bb8b3=_0x972bf5[_0x04e0('0x9f')];var _0x2a2168={'method':_0x04e0('0xa0'),'uri':encodeURI(_0x5a56c5+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x49b865+'\x27'),'headers':{'Authorization':_0x04e0('0xa1')+_0x4bb8b3,'If-None-Match':null,'OData-Version':_0x04e0('0xa2')},'json':!![]};return rp(_0x2a2168);})[_0x04e0('0x24')](function(_0x41c2b8){var _0x5654ed=_0x41c2b8['value'][0x0];var _0x1c767d=_0x5654ed[_0x04e0('0xa3')];var _0x553f35={'method':_0x04e0('0xa0'),'uri':_0x5a56c5+'EntityDefinitions('+_0x1c767d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x04e0('0xa1')+_0x4bb8b3,'If-None-Match':null,'OData-Version':_0x04e0('0xa2')},'json':!![]};return rp(_0x553f35);})[_0x04e0('0x24')](function(_0x23984f){_0x3e6a08=_0x23984f;_0x50284b=_0x3e6a08[_0x04e0('0xa4')];_0x50284b=_[_0x04e0('0xa5')](_0x50284b,function(_0x188f9c){return!_0x24ff33['includes'](_0x188f9c[_0x04e0('0xa6')]);});var _0x2dd18d=[];var _0x3b81e7=[];_0x50284b[_0x04e0('0xa7')](function(_0xbcd911){if(_0xbcd911[_0x04e0('0xa8')]){var _0x2ab15b=_0xbcd911[_0x04e0('0xa8')]['substring'](_0xbcd911['@odata.type'][_0x04e0('0x99')]('.')+0x1);if(_0x2ab15b==='PicklistAttributeMetadata'){_0x2dd18d[_0x04e0('0xa9')](getSelectList(_0x5a56c5,_0x101a77,_0x3b81e7,_0x3e6a08['MetadataId'],_0xbcd911[_0x04e0('0xa3')],_0x4bb8b3));}}});return Promise[_0x04e0('0xaa')](_0x2dd18d);})[_0x04e0('0x24')](function(_0x269524){_0x40bbef=_0x269524[0x0];var _0x418641=[];var _0x59a16e=[];_0x50284b[_0x04e0('0xa7')](function(_0x27b3da){if(!_[_0x04e0('0xab')](_0x27b3da[_0x04e0('0xa8')])){var _0x3a7088=_0x27b3da[_0x04e0('0xa8')][_0x04e0('0xac')](_0x27b3da[_0x04e0('0xa8')]['lastIndexOf']('.')+0x1);if(_0x3a7088===_0x04e0('0xad')){_0x418641[_0x04e0('0xa9')](getBooleanList(_0x5a56c5,_0x101a77,_0x59a16e,_0x3e6a08['MetadataId'],_0x27b3da[_0x04e0('0xa3')],_0x4bb8b3));}}});return Promise[_0x04e0('0xaa')](_0x418641);})[_0x04e0('0x24')](function(_0x1573af){_0x2dd52c=_0x1573af[0x0];var _0x8cfb91=[];var _0x557c98=[];_0x50284b['forEach'](function(_0x5d9c2c){if(_0x5d9c2c[_0x04e0('0xa8')]){var _0x23f3c0=_0x5d9c2c['@odata.type'][_0x04e0('0xac')](_0x5d9c2c[_0x04e0('0xa8')]['lastIndexOf']('.')+0x1);if(_0x23f3c0===_0x04e0('0xae')||_0x23f3c0==='DoubleAttributeMetadata'||_0x23f3c0===_0x04e0('0xaf')||_0x23f3c0===_0x04e0('0xb0')||_0x23f3c0===_0x04e0('0xb1')||_0x23f3c0==='DateTimeAttributeMetadata'||_0x23f3c0===_0x04e0('0xb2')||_0x23f3c0===_0x04e0('0xb3')||_0x23f3c0===_0x04e0('0xb4')||_0x23f3c0==='DecimalAttributeMetadata'){_0x8cfb91[_0x04e0('0xa9')](getInputList(_0x5a56c5,_0x101a77,_0x23f3c0,_0x557c98,_0x3e6a08[_0x04e0('0xa3')],_0x5d9c2c['MetadataId'],_0x4bb8b3));}}});return Promise['all'](_0x8cfb91);})[_0x04e0('0x24')](function(_0x28dd44){_0x56ddd1=_0x28dd44[0x0];var _0xc6d0bf=_0x40bbef[_0x04e0('0xb5')](_0x2dd52c)[_0x04e0('0xb5')](_0x56ddd1);var _0x288ffd={'count':_0xc6d0bf[_0x04e0('0xb6')],'rows':_0xc6d0bf};return _0x288ffd;})['then'](respondWithResult(_0x317b0b,null))[_0x04e0('0x43')](function(_0x45a877){var _0x52b0f4=_0x1b250f[_0x04e0('0x30')]['test']?0x1f4:_0x45a877[_0x04e0('0xb7')]||0x1f4;logger[_0x04e0('0xb8')](_0x45a877[_0x04e0('0x26')]);delete _0x45a877[_0x04e0('0x27')];if(_0x52b0f4===0x191){_0x52b0f4=0x190;}_0x317b0b['status'](_0x52b0f4)[_0x04e0('0x28')](_0x1b250f[_0x04e0('0x30')]['test']?{'message':_0x04e0('0xb9'),'statusCode':_0x45a877[_0x04e0('0xb7')]}:_0x45a877);});};function getSelectList(_0x41302e,_0x5f981d,_0x1b4066,_0x3dc27d,_0x19e496,_0x38ddff){var _0x4fee94={'method':_0x04e0('0xa0'),'uri':_0x41302e+_0x04e0('0xba')+_0x3dc27d+_0x04e0('0xbb')+_0x19e496+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x04e0('0xbc'),'headers':{'Authorization':_0x04e0('0xa1')+_0x38ddff,'If-None-Match':null,'OData-Version':_0x04e0('0xa2')},'json':!![]};return rp(_0x4fee94)['then'](function(_0x434e2f){var _0x4a3b7e=[];var _0x3ba8a2=_0x434e2f[_0x04e0('0xbd')]['Options'];_0x3ba8a2[_0x04e0('0xa7')](function(_0x343323){_0x4a3b7e[_0x04e0('0xa9')]({'name':_0x343323[_0x04e0('0xbe')][_0x04e0('0xbf')][_0x04e0('0xbe')],'value':String(_0x343323[_0x04e0('0xc0')])});});var _0xb890b8={'id':_0x5f981d+'_'+_0x434e2f[_0x04e0('0xa6')],'name':_0x434e2f['DisplayName'][_0x04e0('0xbf')][_0x04e0('0xbe')],'custom':![],'options':_0x4a3b7e};_0x1b4066[_0x04e0('0xa9')](_0xb890b8);return _0x1b4066;});}function getBooleanList(_0x24bc9c,_0x27b11e,_0x199859,_0x48aec6,_0x582b8b,_0x41f2ec){var _0x3149a5={'method':_0x04e0('0xa0'),'uri':_0x24bc9c+_0x04e0('0xba')+_0x48aec6+')/Attributes('+_0x582b8b+_0x04e0('0xc1'),'headers':{'Authorization':_0x04e0('0xa1')+_0x41f2ec,'If-None-Match':null,'OData-Version':_0x04e0('0xa2')},'json':!![]};return rp(_0x3149a5)[_0x04e0('0x24')](function(_0x5243bb){var _0x19112e=[];_0x19112e[_0x04e0('0xa9')]({'name':_0x5243bb['OptionSet']['TrueOption'][_0x04e0('0xbe')][_0x04e0('0xbf')]['Label'],'value':_0x04e0('0xc2')},{'name':_0x5243bb[_0x04e0('0xbd')][_0x04e0('0xc3')][_0x04e0('0xbe')][_0x04e0('0xbf')][_0x04e0('0xbe')],'value':_0x04e0('0xc4')});var _0x2e092c={'id':_0x27b11e+'_'+_0x5243bb['LogicalName'],'name':_0x5243bb[_0x04e0('0xc5')][_0x04e0('0xbf')]['Label'],'custom':![],'options':_0x19112e};_0x199859[_0x04e0('0xa9')](_0x2e092c);return _0x199859;});}function getInputList(_0x450553,_0x408c64,_0x44aede,_0x194658,_0x3d6f08,_0x210d3b,_0x4ea675){var _0x4a19b0={'method':_0x04e0('0xa0'),'uri':_0x450553+'EntityDefinitions('+_0x3d6f08+_0x04e0('0xbb')+_0x210d3b+_0x04e0('0xc6')+_0x44aede+_0x04e0('0xc7'),'headers':{'Authorization':_0x04e0('0xa1')+_0x4ea675,'If-None-Match':null,'OData-Version':_0x04e0('0xa2')},'json':!![]};return rp(_0x4a19b0)[_0x04e0('0x24')](function(_0x211e11){var _0x4f46bd={'id':_0x408c64+'_'+_0x211e11['LogicalName'],'name':_0x211e11['DisplayName'][_0x04e0('0xbf')]?_0x211e11[_0x04e0('0xc5')][_0x04e0('0xbf')][_0x04e0('0xbe')]:_0x211e11[_0x04e0('0xa6')],'custom':![],'options':[]};_0x194658[_0x04e0('0xa9')](_0x4f46bd);return _0x194658;});}
\ No newline at end of file
index 22c55cd..a273d29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1bfe38,_0x329a9b){var _0x7df950=function(_0x48db3b){while(--_0x48db3b){_0x1bfe38['push'](_0x1bfe38['shift']());}};_0x7df950(++_0x329a9b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x14107e,_0x44a29e){var _0x58eb1f=function(_0x5e0255){while(--_0x5e0255){_0x14107e['push'](_0x14107e['shift']());}};_0x58eb1f(++_0x44a29e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xcb91[_0x44bcb0];return _0xfaf881;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e21b53..94e6eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae35=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map','ShowDynamics365Account','find'];(function(_0x1615e7,_0x3c1d32){var _0x9736ba=function(_0x2d0e00){while(--_0x2d0e00){_0x1615e7['push'](_0x1615e7['shift']());}};_0x9736ba(++_0x3c1d32);}(_0xae35,0x94));var _0x5ae3=function(_0x1a0a77,_0x5f00d1){_0x1a0a77=_0x1a0a77-0x0;var _0x42fa75=_0xae35[_0x1a0a77];return _0x42fa75;};'use strict';var _=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var moment=require(_0x5ae3('0x2'));var BPromise=require(_0x5ae3('0x3'));var rs=require(_0x5ae3('0x4'));var fs=require('fs');var Redis=require(_0x5ae3('0x5'));var db=require(_0x5ae3('0x6'))['db'];var utils=require(_0x5ae3('0x7'));var logger=require(_0x5ae3('0x8'))('rpc');var config=require(_0x5ae3('0x9'));var jayson=require(_0x5ae3('0xa'));var client=jayson[_0x5ae3('0xb')][_0x5ae3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53a6d1,_0x121631,_0x448307){return new BPromise(function(_0x76902f,_0x1bd3b0){return client['request'](_0x53a6d1,_0x448307)[_0x5ae3('0xd')](function(_0x5dddef){logger[_0x5ae3('0xe')](_0x5ae3('0xf'),_0x121631,_0x5ae3('0x10'));logger[_0x5ae3('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x121631,'request\x20sent',JSON[_0x5ae3('0x12')](_0x5dddef));if(_0x5dddef['error']){if(_0x5dddef[_0x5ae3('0x13')][_0x5ae3('0x14')]===0x1f4){logger[_0x5ae3('0x13')](_0x5ae3('0xf'),_0x121631,_0x5dddef[_0x5ae3('0x13')][_0x5ae3('0x15')]);return _0x1bd3b0(_0x5dddef[_0x5ae3('0x13')][_0x5ae3('0x15')]);}logger[_0x5ae3('0x13')](_0x5ae3('0xf'),_0x121631,_0x5dddef[_0x5ae3('0x13')]['message']);return _0x76902f(_0x5dddef[_0x5ae3('0x13')][_0x5ae3('0x15')]);}else{logger[_0x5ae3('0xe')](_0x5ae3('0xf'),_0x121631,_0x5ae3('0x10'));_0x76902f(_0x5dddef[_0x5ae3('0x16')][_0x5ae3('0x15')]);}})[_0x5ae3('0x17')](function(_0x107425){logger[_0x5ae3('0x13')](_0x5ae3('0xf'),_0x121631,_0x107425);_0x1bd3b0(_0x107425);});});}exports[_0x5ae3('0x18')]=function(_0x5a7f36){var _0x13ca7d=this;return new Promise(function(_0x536818,_0x593ed4){return db[_0x5ae3('0x19')][_0x5ae3('0x1a')]({'raw':_0x5a7f36[_0x5ae3('0x1b')]?_0x5a7f36['options'][_0x5ae3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a7f36[_0x5ae3('0x1b')]?_0x5a7f36[_0x5ae3('0x1b')][_0x5ae3('0x1d')]||null:null,'attributes':_0x5a7f36[_0x5ae3('0x1b')]?_0x5a7f36[_0x5ae3('0x1b')][_0x5ae3('0x1e')]||null:null,'limit':_0x5a7f36[_0x5ae3('0x1b')]?_0x5a7f36[_0x5ae3('0x1b')][_0x5ae3('0x1f')]||null:null,'include':_0x5a7f36[_0x5ae3('0x1b')]?_0x5a7f36[_0x5ae3('0x1b')][_0x5ae3('0x20')]?_['map'](_0x5a7f36[_0x5ae3('0x1b')]['include'],function(_0x5208b2){return{'model':db[_0x5208b2[_0x5ae3('0x21')]],'as':_0x5208b2['as'],'attributes':_0x5208b2[_0x5ae3('0x1e')],'include':_0x5208b2['include']?_[_0x5ae3('0x22')](_0x5208b2[_0x5ae3('0x20')],function(_0xfc1d13){return{'model':db[_0xfc1d13[_0x5ae3('0x21')]],'as':_0xfc1d13['as'],'attributes':_0xfc1d13[_0x5ae3('0x1e')],'include':_0xfc1d13['include']?_[_0x5ae3('0x22')](_0xfc1d13[_0x5ae3('0x20')],function(_0x25a22d){return{'model':db[_0x25a22d['model']],'as':_0x25a22d['as'],'attributes':_0x25a22d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ae3('0xd')](function(_0x2f9a2e){logger[_0x5ae3('0xe')](_0x5ae3('0x18'),_0x5a7f36);logger[_0x5ae3('0x11')](_0x5ae3('0x18'),_0x5a7f36,JSON['stringify'](_0x2f9a2e));_0x536818(_0x2f9a2e);})[_0x5ae3('0x17')](function(_0x1dfc58){logger[_0x5ae3('0x13')](_0x5ae3('0x18'),_0x1dfc58[_0x5ae3('0x15')],_0x5a7f36);_0x593ed4(_0x13ca7d[_0x5ae3('0x13')](0x1f4,_0x1dfc58['message']));});});};exports[_0x5ae3('0x23')]=function(_0x94a4b8){var _0x289d61=this;return new Promise(function(_0x86ab07,_0xba28ae){return db[_0x5ae3('0x19')][_0x5ae3('0x24')]({'raw':_0x94a4b8[_0x5ae3('0x1b')]?_0x94a4b8['options'][_0x5ae3('0x1c')]===undefined?!![]:![]:!![],'where':_0x94a4b8[_0x5ae3('0x1b')]?_0x94a4b8[_0x5ae3('0x1b')][_0x5ae3('0x1d')]||null:null,'attributes':_0x94a4b8[_0x5ae3('0x1b')]?_0x94a4b8[_0x5ae3('0x1b')]['attributes']||null:null,'include':_0x94a4b8['options']?_0x94a4b8[_0x5ae3('0x1b')][_0x5ae3('0x20')]?_['map'](_0x94a4b8[_0x5ae3('0x1b')][_0x5ae3('0x20')],function(_0x400bec){return{'model':db[_0x400bec[_0x5ae3('0x21')]],'as':_0x400bec['as'],'attributes':_0x400bec[_0x5ae3('0x1e')],'include':_0x400bec['include']?_[_0x5ae3('0x22')](_0x400bec['include'],function(_0xc536ef){return{'model':db[_0xc536ef[_0x5ae3('0x21')]],'as':_0xc536ef['as'],'attributes':_0xc536ef[_0x5ae3('0x1e')],'include':_0xc536ef[_0x5ae3('0x20')]?_['map'](_0xc536ef['include'],function(_0xddb44){return{'model':db[_0xddb44[_0x5ae3('0x21')]],'as':_0xddb44['as'],'attributes':_0xddb44['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ae3('0xd')](function(_0xe5b878){logger[_0x5ae3('0xe')]('ShowDynamics365Account',_0x94a4b8);logger[_0x5ae3('0x11')](_0x5ae3('0x23'),_0x94a4b8,JSON[_0x5ae3('0x12')](_0xe5b878));_0x86ab07(_0xe5b878);})[_0x5ae3('0x17')](function(_0x14299f){logger[_0x5ae3('0x13')](_0x5ae3('0x23'),_0x14299f[_0x5ae3('0x15')],_0x94a4b8);_0xba28ae(_0x289d61[_0x5ae3('0x13')](0x1f4,_0x14299f['message']));});});};
\ No newline at end of file
+var _0x9684=['result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x299b26,_0x5b10e6){var _0x3d1477=function(_0x4cb250){while(--_0x4cb250){_0x299b26['push'](_0x299b26['shift']());}};_0x3d1477(++_0x5b10e6);}(_0x9684,0x80));var _0x4968=function(_0x1af130,_0x35f849){_0x1af130=_0x1af130-0x0;var _0x8ed495=_0x9684[_0x1af130];return _0x8ed495;};'use strict';var _=require(_0x4968('0x0'));var util=require(_0x4968('0x1'));var moment=require(_0x4968('0x2'));var BPromise=require(_0x4968('0x3'));var rs=require(_0x4968('0x4'));var fs=require('fs');var Redis=require(_0x4968('0x5'));var db=require(_0x4968('0x6'))['db'];var utils=require(_0x4968('0x7'));var logger=require(_0x4968('0x8'))(_0x4968('0x9'));var config=require(_0x4968('0xa'));var jayson=require(_0x4968('0xb'));var client=jayson['client'][_0x4968('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x449ba6,_0x4264d8,_0x60e3fc){return new BPromise(function(_0x3a54a5,_0x161980){return client[_0x4968('0xd')](_0x449ba6,_0x60e3fc)[_0x4968('0xe')](function(_0x304e55){logger[_0x4968('0xf')](_0x4968('0x10'),_0x4264d8,_0x4968('0x11'));logger[_0x4968('0x12')](_0x4968('0x13'),_0x4264d8,_0x4968('0x11'),JSON[_0x4968('0x14')](_0x304e55));if(_0x304e55[_0x4968('0x15')]){if(_0x304e55['error'][_0x4968('0x16')]===0x1f4){logger['error'](_0x4968('0x10'),_0x4264d8,_0x304e55[_0x4968('0x15')][_0x4968('0x17')]);return _0x161980(_0x304e55['error']['message']);}logger[_0x4968('0x15')](_0x4968('0x10'),_0x4264d8,_0x304e55[_0x4968('0x15')]['message']);return _0x3a54a5(_0x304e55[_0x4968('0x15')][_0x4968('0x17')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x4264d8,'request\x20sent');_0x3a54a5(_0x304e55[_0x4968('0x18')][_0x4968('0x17')]);}})['catch'](function(_0x1684bb){logger[_0x4968('0x15')](_0x4968('0x10'),_0x4264d8,_0x1684bb);_0x161980(_0x1684bb);});});}exports[_0x4968('0x19')]=function(_0x16d493){var _0x1f4f38=this;return new Promise(function(_0x152adc,_0x564be5){return db[_0x4968('0x1a')][_0x4968('0x1b')]({'raw':_0x16d493[_0x4968('0x1c')]?_0x16d493['options'][_0x4968('0x1d')]===undefined?!![]:![]:!![],'where':_0x16d493[_0x4968('0x1c')]?_0x16d493[_0x4968('0x1c')][_0x4968('0x1e')]||null:null,'attributes':_0x16d493[_0x4968('0x1c')]?_0x16d493[_0x4968('0x1c')][_0x4968('0x1f')]||null:null,'limit':_0x16d493[_0x4968('0x1c')]?_0x16d493[_0x4968('0x1c')][_0x4968('0x20')]||null:null,'include':_0x16d493[_0x4968('0x1c')]?_0x16d493['options']['include']?_[_0x4968('0x21')](_0x16d493['options'][_0x4968('0x22')],function(_0x44a410){return{'model':db[_0x44a410['model']],'as':_0x44a410['as'],'attributes':_0x44a410[_0x4968('0x1f')],'include':_0x44a410['include']?_['map'](_0x44a410[_0x4968('0x22')],function(_0x3ce51f){return{'model':db[_0x3ce51f['model']],'as':_0x3ce51f['as'],'attributes':_0x3ce51f['attributes'],'include':_0x3ce51f['include']?_[_0x4968('0x21')](_0x3ce51f[_0x4968('0x22')],function(_0x14b28a){return{'model':db[_0x14b28a[_0x4968('0x23')]],'as':_0x14b28a['as'],'attributes':_0x14b28a[_0x4968('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4968('0xe')](function(_0x5152cc){logger[_0x4968('0xf')](_0x4968('0x19'),_0x16d493);logger[_0x4968('0x12')](_0x4968('0x19'),_0x16d493,JSON['stringify'](_0x5152cc));_0x152adc(_0x5152cc);})[_0x4968('0x24')](function(_0x17ac9c){logger[_0x4968('0x15')]('GetDynamics365Account',_0x17ac9c['message'],_0x16d493);_0x564be5(_0x1f4f38[_0x4968('0x15')](0x1f4,_0x17ac9c[_0x4968('0x17')]));});});};exports[_0x4968('0x25')]=function(_0x3d79be){var _0x3e967c=this;return new Promise(function(_0x399d13,_0xb0a440){return db[_0x4968('0x1a')]['find']({'raw':_0x3d79be[_0x4968('0x1c')]?_0x3d79be[_0x4968('0x1c')][_0x4968('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d79be[_0x4968('0x1c')]?_0x3d79be[_0x4968('0x1c')][_0x4968('0x1e')]||null:null,'attributes':_0x3d79be['options']?_0x3d79be[_0x4968('0x1c')][_0x4968('0x1f')]||null:null,'include':_0x3d79be[_0x4968('0x1c')]?_0x3d79be[_0x4968('0x1c')][_0x4968('0x22')]?_[_0x4968('0x21')](_0x3d79be['options']['include'],function(_0x84ed9){return{'model':db[_0x84ed9[_0x4968('0x23')]],'as':_0x84ed9['as'],'attributes':_0x84ed9[_0x4968('0x1f')],'include':_0x84ed9[_0x4968('0x22')]?_[_0x4968('0x21')](_0x84ed9[_0x4968('0x22')],function(_0x412e32){return{'model':db[_0x412e32[_0x4968('0x23')]],'as':_0x412e32['as'],'attributes':_0x412e32[_0x4968('0x1f')],'include':_0x412e32[_0x4968('0x22')]?_[_0x4968('0x21')](_0x412e32['include'],function(_0x3b1811){return{'model':db[_0x3b1811[_0x4968('0x23')]],'as':_0x3b1811['as'],'attributes':_0x3b1811['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d84f1){logger[_0x4968('0xf')](_0x4968('0x25'),_0x3d79be);logger[_0x4968('0x12')]('ShowDynamics365Account',_0x3d79be,JSON[_0x4968('0x14')](_0x4d84f1));_0x399d13(_0x4d84f1);})[_0x4968('0x24')](function(_0x2693c9){logger[_0x4968('0x15')](_0x4968('0x25'),_0x2693c9[_0x4968('0x17')],_0x3d79be);_0xb0a440(_0x3e967c['error'](0x1f4,_0x2693c9['message']));});});};
\ No newline at end of file
index 2921d42..37124ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a69=['/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x125956,_0xf5cb13){var _0x4c72f5=function(_0x21e198){while(--_0x21e198){_0x125956['push'](_0x125956['shift']());}};_0x4c72f5(++_0xf5cb13);}(_0x5a69,0x1c0));var _0x95a6=function(_0x3053bf,_0x319e74){_0x3053bf=_0x3053bf-0x0;var _0x1583a6=_0x5a69[_0x3053bf];return _0x1583a6;};'use strict';var multer=require(_0x95a6('0x0'));var util=require(_0x95a6('0x1'));var path=require('path');var timeout=require(_0x95a6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x95a6('0x3'));var auth=require(_0x95a6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x95a6('0x5'));router[_0x95a6('0x6')]('/',auth[_0x95a6('0x7')](),controller[_0x95a6('0x8')]);router[_0x95a6('0x6')](_0x95a6('0x9'),auth['isAuthenticated'](),controller[_0x95a6('0xa')]);router['get']('/:id/fields',auth[_0x95a6('0x7')](),controller[_0x95a6('0xb')]);router[_0x95a6('0x6')](_0x95a6('0xc'),auth['isAuthenticated'](),controller[_0x95a6('0xd')]);router[_0x95a6('0x6')](_0x95a6('0xe'),auth[_0x95a6('0x7')](),controller[_0x95a6('0xf')]);router[_0x95a6('0x10')]('/',auth[_0x95a6('0x7')](),controller[_0x95a6('0x11')]);router['put'](_0x95a6('0x9'),auth['isAuthenticated'](),controller[_0x95a6('0x12')]);router[_0x95a6('0x13')](_0x95a6('0x9'),auth[_0x95a6('0x7')](),controller['destroy']);module[_0x95a6('0x14')]=router;
\ No newline at end of file
+var _0x5098=['post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2512ce,_0x525ffe){var _0x4c5923=function(_0x32d5c1){while(--_0x32d5c1){_0x2512ce['push'](_0x2512ce['shift']());}};_0x4c5923(++_0x525ffe);}(_0x5098,0x6a));var _0x8509=function(_0x27f497,_0xc3442a){_0x27f497=_0x27f497-0x0;var _0x36bf37=_0x5098[_0x27f497];return _0x36bf37;};'use strict';var multer=require(_0x8509('0x0'));var util=require('util');var path=require(_0x8509('0x1'));var timeout=require(_0x8509('0x2'));var express=require(_0x8509('0x3'));var router=express[_0x8509('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8509('0x5'));var interaction=require(_0x8509('0x6'));var config=require(_0x8509('0x7'));var controller=require(_0x8509('0x8'));router[_0x8509('0x9')]('/',auth[_0x8509('0xa')](),controller[_0x8509('0xb')]);router[_0x8509('0x9')](_0x8509('0xc'),auth['isAuthenticated'](),controller[_0x8509('0xd')]);router['get'](_0x8509('0xe'),auth[_0x8509('0xa')](),controller[_0x8509('0xf')]);router['get'](_0x8509('0x10'),auth['isAuthenticated'](),controller[_0x8509('0x11')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x8509('0x12')]);router[_0x8509('0x13')]('/',auth[_0x8509('0xa')](),controller[_0x8509('0x14')]);router[_0x8509('0x15')](_0x8509('0xc'),auth[_0x8509('0xa')](),controller['update']);router[_0x8509('0x16')](_0x8509('0xc'),auth['isAuthenticated'](),controller[_0x8509('0x17')]);module[_0x8509('0x18')]=router;
\ No newline at end of file
index 06b423b..765310f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0550=['phonecall','sequelize','STRING'];(function(_0xd9cf2,_0x510978){var _0xb5d2e5=function(_0x2d89f4){while(--_0x2d89f4){_0xd9cf2['push'](_0xd9cf2['shift']());}};_0xb5d2e5(++_0x510978);}(_0x0550,0x91));var _0x0055=function(_0x1b33ec,_0x4c5bb3){_0x1b33ec=_0x1b33ec-0x0;var _0x36c0a4=_0x0550[_0x1b33ec];return _0x36c0a4;};'use strict';var Sequelize=require(_0x0055('0x0'));module['exports']={'name':{'type':Sequelize[_0x0055('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('incident',_0x0055('0x2')),'defaultValue':'incident'}};
\ No newline at end of file
+var _0x4ef7=['sequelize','STRING','ENUM','incident'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4ef7,0x1d8));var _0x74ef=function(_0x2ac23b,_0x550cea){_0x2ac23b=_0x2ac23b-0x0;var _0x9273f=_0x4ef7[_0x2ac23b];return _0x9273f;};'use strict';var Sequelize=require(_0x74ef('0x0'));module['exports']={'name':{'type':Sequelize[_0x74ef('0x1')]},'description':{'type':Sequelize[_0x74ef('0x1')]},'ticketType':{'type':Sequelize[_0x74ef('0x2')](_0x74ef('0x3'),'phonecall'),'defaultValue':_0x74ef('0x3')}};
\ No newline at end of file
index 95a1a57..9dd95b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf063=['findAll','catch','show','keys','length','body','find','params','getFields','Dynamics365Field','getSubjects','getDescriptions','findOne','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xf063,0x198));var _0x3f06=function(_0x59b1e0,_0x1b416c){_0x59b1e0=_0x59b1e0-0x0;var _0x5d7d12=_0xf063[_0x59b1e0];return _0x5d7d12;};'use strict';var emlformat=require(_0x3f06('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3f06('0x1'));var moment=require(_0x3f06('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3f06('0x3'));var util=require('util');var path=require(_0x3f06('0x4'));var sox=require(_0x3f06('0x5'));var csv=require(_0x3f06('0x6'));var ejs=require(_0x3f06('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f06('0x8'));var jsforce=require(_0x3f06('0x9'));var deskjs=require(_0x3f06('0xa'));var toCsv=require(_0x3f06('0x6'));var querystring=require(_0x3f06('0xb'));var Papa=require(_0x3f06('0xc'));var Redis=require(_0x3f06('0xd'));var authService=require(_0x3f06('0xe'));var qs=require(_0x3f06('0xf'));var as=require(_0x3f06('0x10'));var hardwareService=require(_0x3f06('0x11'));var logger=require(_0x3f06('0x12'))('api');var utils=require(_0x3f06('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3f06('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cef3d,_0x95a50b){_0x95a50b=_0x95a50b||0xcc;return function(_0x2319c3){if(_0x2319c3){return _0x1cef3d['sendStatus'](_0x95a50b);}return _0x1cef3d[_0x3f06('0x15')](_0x95a50b)['end']();};}function respondWithResult(_0x586352,_0x472061){_0x472061=_0x472061||0xc8;return function(_0x11b43b){if(_0x11b43b){return _0x586352[_0x3f06('0x15')](_0x472061)[_0x3f06('0x16')](_0x11b43b);}};}function respondWithFilteredResult(_0x173db3,_0x59c76b){return function(_0x1aa77c){if(_0x1aa77c){var _0x5df79b=typeof _0x59c76b['offset']===_0x3f06('0x17')&&typeof _0x59c76b[_0x3f06('0x18')]===_0x3f06('0x17');var _0x53eaa9=_0x1aa77c[_0x3f06('0x19')];var _0x4a2a31=_0x5df79b?0x0:_0x59c76b[_0x3f06('0x1a')];var _0x5be2a0=_0x5df79b?_0x1aa77c[_0x3f06('0x19')]:_0x59c76b[_0x3f06('0x1a')]+_0x59c76b[_0x3f06('0x18')];var _0x5fc95;if(_0x5be2a0>=_0x53eaa9){_0x5be2a0=_0x53eaa9;_0x5fc95=0xc8;}else{_0x5fc95=0xce;}_0x173db3[_0x3f06('0x15')](_0x5fc95);return _0x173db3[_0x3f06('0x1b')](_0x3f06('0x1c'),_0x4a2a31+'-'+_0x5be2a0+'/'+_0x53eaa9)['json'](_0x1aa77c);}return null;};}function patchUpdates(_0x1d71df){return function(_0x160bb9){try{jsonpatch[_0x3f06('0x1d')](_0x160bb9,_0x1d71df,!![]);}catch(_0x1043c7){return BPromise[_0x3f06('0x1e')](_0x1043c7);}return _0x160bb9[_0x3f06('0x1f')]();};}function saveUpdates(_0x19961e,_0x2f81e7){return function(_0x207399){if(_0x207399){return _0x207399[_0x3f06('0x20')](_0x19961e)['then'](function(_0x550735){return _0x550735;});}return null;};}function removeEntity(_0x41edbe,_0x17b340){return function(_0x147df1){if(_0x147df1){return _0x147df1[_0x3f06('0x21')]()[_0x3f06('0x22')](function(){_0x41edbe[_0x3f06('0x15')](0xcc)[_0x3f06('0x23')]();});}};}function handleEntityNotFound(_0x3571f8,_0x576095){return function(_0x1a0b76){if(!_0x1a0b76){_0x3571f8[_0x3f06('0x24')](0x194);}return _0x1a0b76;};}function handleError(_0x256dd8,_0x3ce148){_0x3ce148=_0x3ce148||0x1f4;return function(_0x361ec6){logger[_0x3f06('0x25')](_0x361ec6[_0x3f06('0x26')]);if(_0x361ec6[_0x3f06('0x27')]){delete _0x361ec6[_0x3f06('0x27')];}_0x256dd8[_0x3f06('0x15')](_0x3ce148)[_0x3f06('0x28')](_0x361ec6);};}exports[_0x3f06('0x29')]=function(_0x2518a8,_0x46ad0c){var _0x32637d={},_0x3408d8={},_0x4fb979={'count':0x0,'rows':[]};var _0x30dd9a=_[_0x3f06('0x2a')](db[_0x3f06('0x2b')][_0x3f06('0x2c')],function(_0x425568){return{'name':_0x425568[_0x3f06('0x2d')],'type':_0x425568[_0x3f06('0x2e')][_0x3f06('0x2f')]};});_0x3408d8[_0x3f06('0x30')]=_[_0x3f06('0x2a')](_0x30dd9a,_0x3f06('0x27'));_0x3408d8[_0x3f06('0x31')]=_['keys'](_0x2518a8[_0x3f06('0x31')]);_0x3408d8[_0x3f06('0x32')]=_[_0x3f06('0x33')](_0x3408d8[_0x3f06('0x30')],_0x3408d8[_0x3f06('0x31')]);_0x32637d[_0x3f06('0x34')]=_[_0x3f06('0x33')](_0x3408d8[_0x3f06('0x30')],qs[_0x3f06('0x35')](_0x2518a8[_0x3f06('0x31')][_0x3f06('0x35')]));_0x32637d[_0x3f06('0x34')]=_0x32637d[_0x3f06('0x34')]['length']?_0x32637d[_0x3f06('0x34')]:_0x3408d8[_0x3f06('0x30')];if(!_0x2518a8[_0x3f06('0x31')][_0x3f06('0x36')](_0x3f06('0x37'))){_0x32637d[_0x3f06('0x18')]=qs[_0x3f06('0x18')](_0x2518a8['query']['limit']);_0x32637d[_0x3f06('0x1a')]=qs['offset'](_0x2518a8[_0x3f06('0x31')]['offset']);}_0x32637d[_0x3f06('0x38')]=qs['sort'](_0x2518a8[_0x3f06('0x31')][_0x3f06('0x39')]);_0x32637d[_0x3f06('0x3a')]=qs[_0x3f06('0x32')](_[_0x3f06('0x3b')](_0x2518a8[_0x3f06('0x31')],_0x3408d8[_0x3f06('0x32')]),_0x30dd9a);if(_0x2518a8[_0x3f06('0x31')][_0x3f06('0x3c')]){_0x32637d[_0x3f06('0x3a')]=_[_0x3f06('0x3d')](_0x32637d['where'],{'$or':_[_0x3f06('0x2a')](_0x30dd9a,function(_0x5d1878){if(_0x5d1878['type']!==_0x3f06('0x3e')){var _0x3637d9={};_0x3637d9[_0x5d1878['name']]={'$like':'%'+_0x2518a8['query'][_0x3f06('0x3c')]+'%'};return _0x3637d9;}})});}_0x32637d=_['merge']({},_0x32637d,_0x2518a8[_0x3f06('0x3f')]);var _0x3bc3cf={'where':_0x32637d[_0x3f06('0x3a')]};return db[_0x3f06('0x2b')][_0x3f06('0x19')](_0x3bc3cf)[_0x3f06('0x22')](function(_0xa18ace){_0x4fb979[_0x3f06('0x19')]=_0xa18ace;if(_0x2518a8['query'][_0x3f06('0x40')]){_0x32637d[_0x3f06('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3f06('0x42')](_0x32637d);})[_0x3f06('0x22')](function(_0x12f5a9){_0x4fb979['rows']=_0x12f5a9;return _0x4fb979;})[_0x3f06('0x22')](respondWithFilteredResult(_0x46ad0c,_0x32637d))[_0x3f06('0x43')](handleError(_0x46ad0c,null));};exports[_0x3f06('0x44')]=function(_0x561bee,_0x478f92){var _0x4c424b={'raw':![],'where':{'id':_0x561bee['params']['id']}},_0x21e831={};_0x21e831[_0x3f06('0x30')]=_[_0x3f06('0x45')](db[_0x3f06('0x2b')]['rawAttributes']);_0x21e831[_0x3f06('0x31')]=_[_0x3f06('0x45')](_0x561bee[_0x3f06('0x31')]);_0x21e831[_0x3f06('0x32')]=_[_0x3f06('0x33')](_0x21e831[_0x3f06('0x30')],_0x21e831[_0x3f06('0x31')]);_0x4c424b[_0x3f06('0x34')]=_[_0x3f06('0x33')](_0x21e831['model'],qs[_0x3f06('0x35')](_0x561bee[_0x3f06('0x31')][_0x3f06('0x35')]));_0x4c424b['attributes']=_0x4c424b[_0x3f06('0x34')][_0x3f06('0x46')]?_0x4c424b[_0x3f06('0x34')]:_0x21e831[_0x3f06('0x30')];if(_0x561bee[_0x3f06('0x31')][_0x3f06('0x40')]){_0x4c424b['include']=[{'all':!![]}];}_0x4c424b=_[_0x3f06('0x3d')]({},_0x4c424b,_0x561bee['options']);return db[_0x3f06('0x2b')]['find'](_0x4c424b)[_0x3f06('0x22')](handleEntityNotFound(_0x478f92,null))[_0x3f06('0x22')](respondWithResult(_0x478f92,null))[_0x3f06('0x43')](handleError(_0x478f92,null));};exports['create']=function(_0x1dbddd,_0x436d77){return db[_0x3f06('0x2b')]['create'](_0x1dbddd[_0x3f06('0x47')],{})[_0x3f06('0x22')](respondWithResult(_0x436d77,0xc9))[_0x3f06('0x43')](handleError(_0x436d77,null));};exports[_0x3f06('0x20')]=function(_0x36ce0b,_0x5861f8){if(_0x36ce0b[_0x3f06('0x47')]['id']){delete _0x36ce0b[_0x3f06('0x47')]['id'];}return db['Dynamics365Configuration'][_0x3f06('0x48')]({'where':{'id':_0x36ce0b[_0x3f06('0x49')]['id']}})['then'](handleEntityNotFound(_0x5861f8,null))[_0x3f06('0x22')](saveUpdates(_0x36ce0b[_0x3f06('0x47')],null))[_0x3f06('0x22')](respondWithResult(_0x5861f8,null))[_0x3f06('0x43')](handleError(_0x5861f8,null));};exports[_0x3f06('0x21')]=function(_0x156ca7,_0x26b3cd){return db[_0x3f06('0x2b')][_0x3f06('0x48')]({'where':{'id':_0x156ca7['params']['id']}})[_0x3f06('0x22')](handleEntityNotFound(_0x26b3cd,null))['then'](removeEntity(_0x26b3cd,null))[_0x3f06('0x43')](handleError(_0x26b3cd,null));};exports[_0x3f06('0x4a')]=function(_0x46dd4f,_0x4595fb,_0x16d41b){var _0x56e178={};var _0xd5c5e1={};var _0x4fc15c;var _0x31bb5d;return db[_0x3f06('0x2b')]['findOne']({'where':{'id':_0x46dd4f[_0x3f06('0x49')]['id']}})[_0x3f06('0x22')](handleEntityNotFound(_0x4595fb,null))[_0x3f06('0x22')](function(_0x5df0e2){if(_0x5df0e2){_0x4fc15c=_0x5df0e2;_0xd5c5e1[_0x3f06('0x30')]=_['keys'](db[_0x3f06('0x4b')][_0x3f06('0x2c')]);_0xd5c5e1[_0x3f06('0x31')]=_['keys'](_0x46dd4f[_0x3f06('0x31')]);_0xd5c5e1[_0x3f06('0x32')]=_[_0x3f06('0x33')](_0xd5c5e1[_0x3f06('0x30')],_0xd5c5e1[_0x3f06('0x31')]);_0x56e178['attributes']=_[_0x3f06('0x33')](_0xd5c5e1[_0x3f06('0x30')],qs[_0x3f06('0x35')](_0x46dd4f[_0x3f06('0x31')][_0x3f06('0x35')]));_0x56e178['attributes']=_0x56e178[_0x3f06('0x34')]['length']?_0x56e178['attributes']:_0xd5c5e1['model'];_0x56e178[_0x3f06('0x38')]=qs[_0x3f06('0x39')](_0x46dd4f[_0x3f06('0x31')][_0x3f06('0x39')]);_0x56e178[_0x3f06('0x3a')]=qs[_0x3f06('0x32')](_[_0x3f06('0x3b')](_0x46dd4f[_0x3f06('0x31')],_0xd5c5e1[_0x3f06('0x32')]));if(_0x46dd4f[_0x3f06('0x31')][_0x3f06('0x3c')]){_0x56e178[_0x3f06('0x3a')]=_[_0x3f06('0x3d')](_0x56e178[_0x3f06('0x3a')],{'$or':_[_0x3f06('0x2a')](_0x56e178[_0x3f06('0x34')],function(_0x3fe05e){var _0x2e6b55={};_0x2e6b55[_0x3fe05e]={'$like':'%'+_0x46dd4f[_0x3f06('0x31')][_0x3f06('0x3c')]+'%'};return _0x2e6b55;})});}_0x56e178=_['merge']({},_0x56e178,_0x46dd4f['options']);return _0x4fc15c[_0x3f06('0x4a')](_0x56e178);}})['then'](function(_0x86cd64){if(_0x86cd64){_0x31bb5d=_0x86cd64[_0x3f06('0x46')];if(!_0x46dd4f['query'][_0x3f06('0x36')](_0x3f06('0x37'))){_0x56e178['limit']=qs['limit'](_0x46dd4f[_0x3f06('0x31')][_0x3f06('0x18')]);_0x56e178[_0x3f06('0x1a')]=qs[_0x3f06('0x1a')](_0x46dd4f['query'][_0x3f06('0x1a')]);}return _0x4fc15c[_0x3f06('0x4a')](_0x56e178);}})[_0x3f06('0x22')](function(_0x35a033){if(_0x35a033){return _0x35a033?{'count':_0x31bb5d,'rows':_0x35a033}:null;}})['then'](respondWithResult(_0x4595fb,null))[_0x3f06('0x43')](handleError(_0x4595fb,null));};exports['getSubjects']=function(_0x1b1e7f,_0x50b834,_0x404eda){var _0x5f4e25={};var _0x1b807c={};var _0x5a2e36;var _0x5c9eb3;return db[_0x3f06('0x2b')]['findOne']({'where':{'id':_0x1b1e7f[_0x3f06('0x49')]['id']}})[_0x3f06('0x22')](handleEntityNotFound(_0x50b834,null))[_0x3f06('0x22')](function(_0x5c52df){if(_0x5c52df){_0x5a2e36=_0x5c52df;_0x1b807c[_0x3f06('0x30')]=_[_0x3f06('0x45')](db[_0x3f06('0x4b')][_0x3f06('0x2c')]);_0x1b807c['query']=_[_0x3f06('0x45')](_0x1b1e7f[_0x3f06('0x31')]);_0x1b807c[_0x3f06('0x32')]=_[_0x3f06('0x33')](_0x1b807c['model'],_0x1b807c[_0x3f06('0x31')]);_0x5f4e25[_0x3f06('0x34')]=_[_0x3f06('0x33')](_0x1b807c['model'],qs[_0x3f06('0x35')](_0x1b1e7f[_0x3f06('0x31')][_0x3f06('0x35')]));_0x5f4e25[_0x3f06('0x34')]=_0x5f4e25[_0x3f06('0x34')]['length']?_0x5f4e25['attributes']:_0x1b807c[_0x3f06('0x30')];_0x5f4e25[_0x3f06('0x38')]=qs[_0x3f06('0x39')](_0x1b1e7f[_0x3f06('0x31')][_0x3f06('0x39')]);_0x5f4e25[_0x3f06('0x3a')]=qs[_0x3f06('0x32')](_[_0x3f06('0x3b')](_0x1b1e7f[_0x3f06('0x31')],_0x1b807c[_0x3f06('0x32')]));if(_0x1b1e7f[_0x3f06('0x31')]['filter']){_0x5f4e25[_0x3f06('0x3a')]=_[_0x3f06('0x3d')](_0x5f4e25[_0x3f06('0x3a')],{'$or':_[_0x3f06('0x2a')](_0x5f4e25[_0x3f06('0x34')],function(_0x25e50){var _0x4c0f3d={};_0x4c0f3d[_0x25e50]={'$like':'%'+_0x1b1e7f[_0x3f06('0x31')][_0x3f06('0x3c')]+'%'};return _0x4c0f3d;})});}_0x5f4e25=_[_0x3f06('0x3d')]({},_0x5f4e25,_0x1b1e7f['options']);return _0x5a2e36[_0x3f06('0x4c')](_0x5f4e25);}})[_0x3f06('0x22')](function(_0x15cb28){if(_0x15cb28){_0x5c9eb3=_0x15cb28[_0x3f06('0x46')];if(!_0x1b1e7f[_0x3f06('0x31')]['hasOwnProperty'](_0x3f06('0x37'))){_0x5f4e25[_0x3f06('0x18')]=qs['limit'](_0x1b1e7f['query'][_0x3f06('0x18')]);_0x5f4e25[_0x3f06('0x1a')]=qs[_0x3f06('0x1a')](_0x1b1e7f[_0x3f06('0x31')][_0x3f06('0x1a')]);}return _0x5a2e36['getSubjects'](_0x5f4e25);}})[_0x3f06('0x22')](function(_0x8234d){if(_0x8234d){return _0x8234d?{'count':_0x5c9eb3,'rows':_0x8234d}:null;}})['then'](respondWithResult(_0x50b834,null))[_0x3f06('0x43')](handleError(_0x50b834,null));};exports[_0x3f06('0x4d')]=function(_0x264e7a,_0x3608a7,_0x56e795){var _0x422783={};var _0x42d925={};var _0x4363a5;var _0x1b525e;return db[_0x3f06('0x2b')][_0x3f06('0x4e')]({'where':{'id':_0x264e7a[_0x3f06('0x49')]['id']}})[_0x3f06('0x22')](handleEntityNotFound(_0x3608a7,null))[_0x3f06('0x22')](function(_0x2bea98){if(_0x2bea98){_0x4363a5=_0x2bea98;_0x42d925[_0x3f06('0x30')]=_[_0x3f06('0x45')](db[_0x3f06('0x4b')][_0x3f06('0x2c')]);_0x42d925[_0x3f06('0x31')]=_[_0x3f06('0x45')](_0x264e7a['query']);_0x42d925[_0x3f06('0x32')]=_[_0x3f06('0x33')](_0x42d925['model'],_0x42d925[_0x3f06('0x31')]);_0x422783[_0x3f06('0x34')]=_[_0x3f06('0x33')](_0x42d925['model'],qs[_0x3f06('0x35')](_0x264e7a[_0x3f06('0x31')][_0x3f06('0x35')]));_0x422783[_0x3f06('0x34')]=_0x422783[_0x3f06('0x34')][_0x3f06('0x46')]?_0x422783['attributes']:_0x42d925['model'];_0x422783[_0x3f06('0x38')]=qs[_0x3f06('0x39')](_0x264e7a[_0x3f06('0x31')]['sort']);_0x422783[_0x3f06('0x3a')]=qs[_0x3f06('0x32')](_[_0x3f06('0x3b')](_0x264e7a[_0x3f06('0x31')],_0x42d925['filters']));if(_0x264e7a[_0x3f06('0x31')]['filter']){_0x422783['where']=_['merge'](_0x422783[_0x3f06('0x3a')],{'$or':_[_0x3f06('0x2a')](_0x422783[_0x3f06('0x34')],function(_0x3f1299){var _0x2059f5={};_0x2059f5[_0x3f1299]={'$like':'%'+_0x264e7a[_0x3f06('0x31')][_0x3f06('0x3c')]+'%'};return _0x2059f5;})});}_0x422783=_[_0x3f06('0x3d')]({},_0x422783,_0x264e7a[_0x3f06('0x3f')]);return _0x4363a5['getDescriptions'](_0x422783);}})[_0x3f06('0x22')](function(_0x2aa0c9){if(_0x2aa0c9){_0x1b525e=_0x2aa0c9['length'];if(!_0x264e7a[_0x3f06('0x31')][_0x3f06('0x36')](_0x3f06('0x37'))){_0x422783[_0x3f06('0x18')]=qs[_0x3f06('0x18')](_0x264e7a[_0x3f06('0x31')][_0x3f06('0x18')]);_0x422783[_0x3f06('0x1a')]=qs[_0x3f06('0x1a')](_0x264e7a[_0x3f06('0x31')][_0x3f06('0x1a')]);}return _0x4363a5[_0x3f06('0x4d')](_0x422783);}})['then'](function(_0x4055a1){if(_0x4055a1){return _0x4055a1?{'count':_0x1b525e,'rows':_0x4055a1}:null;}})[_0x3f06('0x22')](respondWithResult(_0x3608a7,null))[_0x3f06('0x43')](handleError(_0x3608a7,null));};
\ No newline at end of file
+var _0x544b=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','Dynamics365Field','pick','length','hasOwnProperty','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x544b,0x180));var _0xb544=function(_0x1f8cf3,_0x3baa15){_0x1f8cf3=_0x1f8cf3-0x0;var _0x4a1fa6=_0x544b[_0x1f8cf3];return _0x4a1fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb544('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb544('0x1'));var moment=require(_0xb544('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb544('0x3'));var util=require(_0xb544('0x4'));var path=require(_0xb544('0x5'));var sox=require(_0xb544('0x6'));var csv=require('to-csv');var ejs=require(_0xb544('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb544('0x8'));var squel=require(_0xb544('0x9'));var crypto=require(_0xb544('0xa'));var jsforce=require(_0xb544('0xb'));var deskjs=require(_0xb544('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb544('0xd'));var Papa=require('papaparse');var Redis=require(_0xb544('0xe'));var authService=require(_0xb544('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb544('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb544('0x11'))(_0xb544('0x12'));var utils=require(_0xb544('0x13'));var config=require(_0xb544('0x14'));var licenseUtil=require(_0xb544('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14d695,_0x265721){_0x265721=_0x265721||0xcc;return function(_0x5c3ff4){if(_0x5c3ff4){return _0x14d695[_0xb544('0x16')](_0x265721);}return _0x14d695[_0xb544('0x17')](_0x265721)[_0xb544('0x18')]();};}function respondWithResult(_0x5d95e7,_0x3c7e9c){_0x3c7e9c=_0x3c7e9c||0xc8;return function(_0x446e53){if(_0x446e53){return _0x5d95e7['status'](_0x3c7e9c)['json'](_0x446e53);}};}function respondWithFilteredResult(_0x4a1d2f,_0x1ba73e){return function(_0x312c01){if(_0x312c01){var _0x397e6e=typeof _0x1ba73e[_0xb544('0x19')]===_0xb544('0x1a')&&typeof _0x1ba73e[_0xb544('0x1b')]==='undefined';var _0x506da2=_0x312c01[_0xb544('0x1c')];var _0x468c89=_0x397e6e?0x0:_0x1ba73e[_0xb544('0x19')];var _0x25be9e=_0x397e6e?_0x312c01['count']:_0x1ba73e[_0xb544('0x19')]+_0x1ba73e[_0xb544('0x1b')];var _0x4a4fcf;if(_0x25be9e>=_0x506da2){_0x25be9e=_0x506da2;_0x4a4fcf=0xc8;}else{_0x4a4fcf=0xce;}_0x4a1d2f[_0xb544('0x17')](_0x4a4fcf);return _0x4a1d2f[_0xb544('0x1d')](_0xb544('0x1e'),_0x468c89+'-'+_0x25be9e+'/'+_0x506da2)[_0xb544('0x1f')](_0x312c01);}return null;};}function patchUpdates(_0xe2c73e){return function(_0x196418){try{jsonpatch['apply'](_0x196418,_0xe2c73e,!![]);}catch(_0x515b85){return BPromise[_0xb544('0x20')](_0x515b85);}return _0x196418['save']();};}function saveUpdates(_0x101789,_0xdbd88c){return function(_0x2a86ba){if(_0x2a86ba){return _0x2a86ba[_0xb544('0x21')](_0x101789)[_0xb544('0x22')](function(_0x363d06){return _0x363d06;});}return null;};}function removeEntity(_0x12bf5c,_0x145d24){return function(_0x1cffe2){if(_0x1cffe2){return _0x1cffe2[_0xb544('0x23')]()[_0xb544('0x22')](function(){_0x12bf5c[_0xb544('0x17')](0xcc)[_0xb544('0x18')]();});}};}function handleEntityNotFound(_0x20ba11,_0x2cc53d){return function(_0x39ba3b){if(!_0x39ba3b){_0x20ba11[_0xb544('0x16')](0x194);}return _0x39ba3b;};}function handleError(_0x5b290d,_0x1f63e3){_0x1f63e3=_0x1f63e3||0x1f4;return function(_0x3caeda){logger[_0xb544('0x24')](_0x3caeda[_0xb544('0x25')]);if(_0x3caeda['name']){delete _0x3caeda[_0xb544('0x26')];}_0x5b290d[_0xb544('0x17')](_0x1f63e3)['send'](_0x3caeda);};}exports[_0xb544('0x27')]=function(_0x1382a1,_0x135da9){var _0x5043e9={},_0xdff098={},_0x283bc3={'count':0x0,'rows':[]};var _0x270727=_[_0xb544('0x28')](db['Dynamics365Configuration'][_0xb544('0x29')],function(_0x224510){return{'name':_0x224510[_0xb544('0x2a')],'type':_0x224510[_0xb544('0x2b')][_0xb544('0x2c')]};});_0xdff098['model']=_[_0xb544('0x28')](_0x270727,_0xb544('0x26'));_0xdff098[_0xb544('0x2d')]=_[_0xb544('0x2e')](_0x1382a1[_0xb544('0x2d')]);_0xdff098[_0xb544('0x2f')]=_[_0xb544('0x30')](_0xdff098[_0xb544('0x31')],_0xdff098[_0xb544('0x2d')]);_0x5043e9[_0xb544('0x32')]=_[_0xb544('0x30')](_0xdff098[_0xb544('0x31')],qs[_0xb544('0x33')](_0x1382a1[_0xb544('0x2d')]['fields']));_0x5043e9[_0xb544('0x32')]=_0x5043e9[_0xb544('0x32')]['length']?_0x5043e9['attributes']:_0xdff098[_0xb544('0x31')];if(!_0x1382a1[_0xb544('0x2d')]['hasOwnProperty'](_0xb544('0x34'))){_0x5043e9[_0xb544('0x1b')]=qs[_0xb544('0x1b')](_0x1382a1['query'][_0xb544('0x1b')]);_0x5043e9['offset']=qs[_0xb544('0x19')](_0x1382a1[_0xb544('0x2d')][_0xb544('0x19')]);}_0x5043e9[_0xb544('0x35')]=qs[_0xb544('0x36')](_0x1382a1[_0xb544('0x2d')]['sort']);_0x5043e9[_0xb544('0x37')]=qs[_0xb544('0x2f')](_['pick'](_0x1382a1[_0xb544('0x2d')],_0xdff098[_0xb544('0x2f')]),_0x270727);if(_0x1382a1['query'][_0xb544('0x38')]){_0x5043e9['where']=_[_0xb544('0x39')](_0x5043e9['where'],{'$or':_['map'](_0x270727,function(_0x1de37c){if(_0x1de37c['type']!==_0xb544('0x3a')){var _0x503ffd={};_0x503ffd[_0x1de37c[_0xb544('0x26')]]={'$like':'%'+_0x1382a1[_0xb544('0x2d')][_0xb544('0x38')]+'%'};return _0x503ffd;}})});}_0x5043e9=_['merge']({},_0x5043e9,_0x1382a1['options']);var _0x1a3b71={'where':_0x5043e9[_0xb544('0x37')]};return db[_0xb544('0x3b')][_0xb544('0x1c')](_0x1a3b71)['then'](function(_0x1f373c){_0x283bc3[_0xb544('0x1c')]=_0x1f373c;if(_0x1382a1[_0xb544('0x2d')][_0xb544('0x3c')]){_0x5043e9['include']=[{'all':!![]}];}return db[_0xb544('0x3b')][_0xb544('0x3d')](_0x5043e9);})[_0xb544('0x22')](function(_0xb66aa3){_0x283bc3[_0xb544('0x3e')]=_0xb66aa3;return _0x283bc3;})[_0xb544('0x22')](respondWithFilteredResult(_0x135da9,_0x5043e9))[_0xb544('0x3f')](handleError(_0x135da9,null));};exports[_0xb544('0x40')]=function(_0x21680f,_0x4ac3a5){var _0x301f29={'raw':![],'where':{'id':_0x21680f[_0xb544('0x41')]['id']}},_0x21717a={};_0x21717a[_0xb544('0x31')]=_[_0xb544('0x2e')](db[_0xb544('0x3b')][_0xb544('0x29')]);_0x21717a['query']=_['keys'](_0x21680f[_0xb544('0x2d')]);_0x21717a['filters']=_['intersection'](_0x21717a[_0xb544('0x31')],_0x21717a[_0xb544('0x2d')]);_0x301f29[_0xb544('0x32')]=_['intersection'](_0x21717a[_0xb544('0x31')],qs[_0xb544('0x33')](_0x21680f['query'][_0xb544('0x33')]));_0x301f29[_0xb544('0x32')]=_0x301f29[_0xb544('0x32')]['length']?_0x301f29['attributes']:_0x21717a[_0xb544('0x31')];if(_0x21680f[_0xb544('0x2d')]['includeAll']){_0x301f29[_0xb544('0x42')]=[{'all':!![]}];}_0x301f29=_[_0xb544('0x39')]({},_0x301f29,_0x21680f[_0xb544('0x43')]);return db[_0xb544('0x3b')][_0xb544('0x44')](_0x301f29)['then'](handleEntityNotFound(_0x4ac3a5,null))[_0xb544('0x22')](respondWithResult(_0x4ac3a5,null))[_0xb544('0x3f')](handleError(_0x4ac3a5,null));};exports[_0xb544('0x45')]=function(_0x38b801,_0x534edb){return db[_0xb544('0x3b')][_0xb544('0x45')](_0x38b801[_0xb544('0x46')],{})[_0xb544('0x22')](respondWithResult(_0x534edb,0xc9))['catch'](handleError(_0x534edb,null));};exports['update']=function(_0x5b80c5,_0x5b13c2){if(_0x5b80c5[_0xb544('0x46')]['id']){delete _0x5b80c5[_0xb544('0x46')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x5b80c5['params']['id']}})[_0xb544('0x22')](handleEntityNotFound(_0x5b13c2,null))[_0xb544('0x22')](saveUpdates(_0x5b80c5[_0xb544('0x46')],null))[_0xb544('0x22')](respondWithResult(_0x5b13c2,null))[_0xb544('0x3f')](handleError(_0x5b13c2,null));};exports[_0xb544('0x23')]=function(_0x219a07,_0x1172cb){return db[_0xb544('0x3b')][_0xb544('0x44')]({'where':{'id':_0x219a07[_0xb544('0x41')]['id']}})[_0xb544('0x22')](handleEntityNotFound(_0x1172cb,null))[_0xb544('0x22')](removeEntity(_0x1172cb,null))[_0xb544('0x3f')](handleError(_0x1172cb,null));};exports[_0xb544('0x47')]=function(_0x23f7de,_0x35e029,_0x338d26){var _0x24459c={};var _0x509064={};var _0x180b6c;var _0x487d9a;return db['Dynamics365Configuration'][_0xb544('0x48')]({'where':{'id':_0x23f7de[_0xb544('0x41')]['id']}})[_0xb544('0x22')](handleEntityNotFound(_0x35e029,null))[_0xb544('0x22')](function(_0x35b677){if(_0x35b677){_0x180b6c=_0x35b677;_0x509064[_0xb544('0x31')]=_[_0xb544('0x2e')](db[_0xb544('0x49')]['rawAttributes']);_0x509064[_0xb544('0x2d')]=_[_0xb544('0x2e')](_0x23f7de[_0xb544('0x2d')]);_0x509064[_0xb544('0x2f')]=_['intersection'](_0x509064[_0xb544('0x31')],_0x509064[_0xb544('0x2d')]);_0x24459c[_0xb544('0x32')]=_[_0xb544('0x30')](_0x509064['model'],qs['fields'](_0x23f7de['query'][_0xb544('0x33')]));_0x24459c[_0xb544('0x32')]=_0x24459c[_0xb544('0x32')]['length']?_0x24459c[_0xb544('0x32')]:_0x509064[_0xb544('0x31')];_0x24459c[_0xb544('0x35')]=qs[_0xb544('0x36')](_0x23f7de[_0xb544('0x2d')][_0xb544('0x36')]);_0x24459c['where']=qs[_0xb544('0x2f')](_[_0xb544('0x4a')](_0x23f7de[_0xb544('0x2d')],_0x509064[_0xb544('0x2f')]));if(_0x23f7de['query'][_0xb544('0x38')]){_0x24459c[_0xb544('0x37')]=_['merge'](_0x24459c[_0xb544('0x37')],{'$or':_[_0xb544('0x28')](_0x24459c['attributes'],function(_0x304cf4){var _0x45f279={};_0x45f279[_0x304cf4]={'$like':'%'+_0x23f7de[_0xb544('0x2d')]['filter']+'%'};return _0x45f279;})});}_0x24459c=_[_0xb544('0x39')]({},_0x24459c,_0x23f7de['options']);return _0x180b6c[_0xb544('0x47')](_0x24459c);}})[_0xb544('0x22')](function(_0x5c7c07){if(_0x5c7c07){_0x487d9a=_0x5c7c07[_0xb544('0x4b')];if(!_0x23f7de[_0xb544('0x2d')][_0xb544('0x4c')](_0xb544('0x34'))){_0x24459c[_0xb544('0x1b')]=qs[_0xb544('0x1b')](_0x23f7de[_0xb544('0x2d')][_0xb544('0x1b')]);_0x24459c['offset']=qs[_0xb544('0x19')](_0x23f7de[_0xb544('0x2d')][_0xb544('0x19')]);}return _0x180b6c['getFields'](_0x24459c);}})['then'](function(_0x123ef6){if(_0x123ef6){return _0x123ef6?{'count':_0x487d9a,'rows':_0x123ef6}:null;}})[_0xb544('0x22')](respondWithResult(_0x35e029,null))[_0xb544('0x3f')](handleError(_0x35e029,null));};exports[_0xb544('0x4d')]=function(_0x1e6cd1,_0x229550,_0x22cf77){var _0x39e6d2={};var _0x2ae05c={};var _0xa02882;var _0x243005;return db[_0xb544('0x3b')][_0xb544('0x48')]({'where':{'id':_0x1e6cd1[_0xb544('0x41')]['id']}})[_0xb544('0x22')](handleEntityNotFound(_0x229550,null))[_0xb544('0x22')](function(_0xb322d9){if(_0xb322d9){_0xa02882=_0xb322d9;_0x2ae05c['model']=_[_0xb544('0x2e')](db[_0xb544('0x49')][_0xb544('0x29')]);_0x2ae05c['query']=_[_0xb544('0x2e')](_0x1e6cd1[_0xb544('0x2d')]);_0x2ae05c[_0xb544('0x2f')]=_['intersection'](_0x2ae05c[_0xb544('0x31')],_0x2ae05c[_0xb544('0x2d')]);_0x39e6d2[_0xb544('0x32')]=_[_0xb544('0x30')](_0x2ae05c[_0xb544('0x31')],qs[_0xb544('0x33')](_0x1e6cd1[_0xb544('0x2d')][_0xb544('0x33')]));_0x39e6d2[_0xb544('0x32')]=_0x39e6d2[_0xb544('0x32')][_0xb544('0x4b')]?_0x39e6d2[_0xb544('0x32')]:_0x2ae05c[_0xb544('0x31')];_0x39e6d2[_0xb544('0x35')]=qs[_0xb544('0x36')](_0x1e6cd1[_0xb544('0x2d')][_0xb544('0x36')]);_0x39e6d2[_0xb544('0x37')]=qs['filters'](_[_0xb544('0x4a')](_0x1e6cd1['query'],_0x2ae05c[_0xb544('0x2f')]));if(_0x1e6cd1['query'][_0xb544('0x38')]){_0x39e6d2['where']=_[_0xb544('0x39')](_0x39e6d2[_0xb544('0x37')],{'$or':_[_0xb544('0x28')](_0x39e6d2[_0xb544('0x32')],function(_0x9d83d1){var _0x4ce8df={};_0x4ce8df[_0x9d83d1]={'$like':'%'+_0x1e6cd1[_0xb544('0x2d')][_0xb544('0x38')]+'%'};return _0x4ce8df;})});}_0x39e6d2=_[_0xb544('0x39')]({},_0x39e6d2,_0x1e6cd1['options']);return _0xa02882[_0xb544('0x4d')](_0x39e6d2);}})[_0xb544('0x22')](function(_0x448b59){if(_0x448b59){_0x243005=_0x448b59[_0xb544('0x4b')];if(!_0x1e6cd1[_0xb544('0x2d')][_0xb544('0x4c')](_0xb544('0x34'))){_0x39e6d2[_0xb544('0x1b')]=qs[_0xb544('0x1b')](_0x1e6cd1['query']['limit']);_0x39e6d2['offset']=qs[_0xb544('0x19')](_0x1e6cd1[_0xb544('0x2d')][_0xb544('0x19')]);}return _0xa02882[_0xb544('0x4d')](_0x39e6d2);}})[_0xb544('0x22')](function(_0x10a98b){if(_0x10a98b){return _0x10a98b?{'count':_0x243005,'rows':_0x10a98b}:null;}})[_0xb544('0x22')](respondWithResult(_0x229550,null))[_0xb544('0x3f')](handleError(_0x229550,null));};exports['getDescriptions']=function(_0x500601,_0x20dd9e,_0x1da4c3){var _0x21ef46={};var _0x3644f5={};var _0x4bea7d;var _0x2ae4db;return db[_0xb544('0x3b')]['findOne']({'where':{'id':_0x500601[_0xb544('0x41')]['id']}})['then'](handleEntityNotFound(_0x20dd9e,null))[_0xb544('0x22')](function(_0x3cc047){if(_0x3cc047){_0x4bea7d=_0x3cc047;_0x3644f5[_0xb544('0x31')]=_[_0xb544('0x2e')](db[_0xb544('0x49')][_0xb544('0x29')]);_0x3644f5['query']=_[_0xb544('0x2e')](_0x500601[_0xb544('0x2d')]);_0x3644f5[_0xb544('0x2f')]=_[_0xb544('0x30')](_0x3644f5[_0xb544('0x31')],_0x3644f5[_0xb544('0x2d')]);_0x21ef46[_0xb544('0x32')]=_[_0xb544('0x30')](_0x3644f5[_0xb544('0x31')],qs['fields'](_0x500601[_0xb544('0x2d')]['fields']));_0x21ef46[_0xb544('0x32')]=_0x21ef46[_0xb544('0x32')][_0xb544('0x4b')]?_0x21ef46[_0xb544('0x32')]:_0x3644f5[_0xb544('0x31')];_0x21ef46[_0xb544('0x35')]=qs['sort'](_0x500601['query'][_0xb544('0x36')]);_0x21ef46[_0xb544('0x37')]=qs['filters'](_['pick'](_0x500601['query'],_0x3644f5[_0xb544('0x2f')]));if(_0x500601[_0xb544('0x2d')][_0xb544('0x38')]){_0x21ef46[_0xb544('0x37')]=_['merge'](_0x21ef46[_0xb544('0x37')],{'$or':_[_0xb544('0x28')](_0x21ef46[_0xb544('0x32')],function(_0xe78ffd){var _0x58de95={};_0x58de95[_0xe78ffd]={'$like':'%'+_0x500601[_0xb544('0x2d')][_0xb544('0x38')]+'%'};return _0x58de95;})});}_0x21ef46=_['merge']({},_0x21ef46,_0x500601[_0xb544('0x43')]);return _0x4bea7d[_0xb544('0x4e')](_0x21ef46);}})['then'](function(_0x3bca61){if(_0x3bca61){_0x2ae4db=_0x3bca61[_0xb544('0x4b')];if(!_0x500601[_0xb544('0x2d')][_0xb544('0x4c')](_0xb544('0x34'))){_0x21ef46[_0xb544('0x1b')]=qs[_0xb544('0x1b')](_0x500601[_0xb544('0x2d')]['limit']);_0x21ef46[_0xb544('0x19')]=qs[_0xb544('0x19')](_0x500601['query'][_0xb544('0x19')]);}return _0x4bea7d[_0xb544('0x4e')](_0x21ef46);}})[_0xb544('0x22')](function(_0x450c6b){if(_0x450c6b){return _0x450c6b?{'count':_0x2ae4db,'rows':_0x450c6b}:null;}})[_0xb544('0x22')](respondWithResult(_0x20dd9e,null))['catch'](handleError(_0x20dd9e,null));};
\ No newline at end of file
index a61b619..7f7c893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9a19,0x114));var _0x99a1=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x9a19[_0x25701b];return _0x3a8a2c;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0xf3b23d,_0x140e14){var _0x4826d9=function(_0x402ad8){while(--_0x402ad8){_0xf3b23d['push'](_0xf3b23d['shift']());}};_0x4826d9(++_0x140e14);}(_0x5b02,0xe9));var _0x25b0=function(_0x45ba5f,_0x4ede3e){_0x45ba5f=_0x45ba5f-0x0;var _0x549b99=_0x5b02[_0x45ba5f];return _0x549b99;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 56f4b6c..66fa332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2879=['client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d1d67,_0x44ba1d){var _0x140e57=function(_0x4377d4){while(--_0x4377d4){_0x1d1d67['push'](_0x1d1d67['shift']());}};_0x140e57(++_0x44ba1d);}(_0x2879,0x194));var _0x9287=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2879[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x9287('0x0'));var moment=require(_0x9287('0x1'));var BPromise=require('bluebird');var rs=require(_0x9287('0x2'));var fs=require('fs');var Redis=require(_0x9287('0x3'));var db=require(_0x9287('0x4'))['db'];var utils=require(_0x9287('0x5'));var logger=require(_0x9287('0x6'))(_0x9287('0x7'));var config=require(_0x9287('0x8'));var jayson=require(_0x9287('0x9'));var client=jayson[_0x9287('0xa')][_0x9287('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9a8b95,_0x459ee3,_0x5f58a2){return new BPromise(function(_0x224312,_0x4844c8){return client[_0x9287('0xc')](_0x9a8b95,_0x5f58a2)[_0x9287('0xd')](function(_0x508f0f){logger['info'](_0x9287('0xe'),_0x459ee3,_0x9287('0xf'));logger[_0x9287('0x10')](_0x9287('0x11'),_0x459ee3,_0x9287('0xf'),JSON[_0x9287('0x12')](_0x508f0f));if(_0x508f0f['error']){if(_0x508f0f[_0x9287('0x13')]['code']===0x1f4){logger[_0x9287('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x459ee3,_0x508f0f['error'][_0x9287('0x14')]);return _0x4844c8(_0x508f0f[_0x9287('0x13')][_0x9287('0x14')]);}logger[_0x9287('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x459ee3,_0x508f0f['error'][_0x9287('0x14')]);return _0x224312(_0x508f0f[_0x9287('0x13')][_0x9287('0x14')]);}else{logger[_0x9287('0x15')](_0x9287('0xe'),_0x459ee3,'request\x20sent');_0x224312(_0x508f0f['result'][_0x9287('0x14')]);}})[_0x9287('0x16')](function(_0x5b1d29){logger[_0x9287('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x459ee3,_0x5b1d29);_0x4844c8(_0x5b1d29);});});}
\ No newline at end of file
+var _0x3f78=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x488da7,_0x4bc17f){var _0x3c5cf4=function(_0x20df84){while(--_0x20df84){_0x488da7['push'](_0x488da7['shift']());}};_0x3c5cf4(++_0x4bc17f);}(_0x3f78,0xdb));var _0x83f7=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x3f78[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x83f7('0x0'));var util=require(_0x83f7('0x1'));var moment=require(_0x83f7('0x2'));var BPromise=require(_0x83f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x83f7('0x5'));var logger=require(_0x83f7('0x6'))(_0x83f7('0x7'));var config=require(_0x83f7('0x8'));var jayson=require(_0x83f7('0x9'));var client=jayson['client'][_0x83f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e6969,_0x18b097,_0x2a83af){return new BPromise(function(_0x29e60e,_0x19a044){return client['request'](_0x5e6969,_0x2a83af)['then'](function(_0x2c22a4){logger[_0x83f7('0xb')](_0x83f7('0xc'),_0x18b097,_0x83f7('0xd'));logger[_0x83f7('0xe')](_0x83f7('0xf'),_0x18b097,'request\x20sent',JSON[_0x83f7('0x10')](_0x2c22a4));if(_0x2c22a4[_0x83f7('0x11')]){if(_0x2c22a4['error'][_0x83f7('0x12')]===0x1f4){logger[_0x83f7('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x18b097,_0x2c22a4[_0x83f7('0x11')][_0x83f7('0x13')]);return _0x19a044(_0x2c22a4[_0x83f7('0x11')][_0x83f7('0x13')]);}logger[_0x83f7('0x11')](_0x83f7('0xc'),_0x18b097,_0x2c22a4[_0x83f7('0x11')][_0x83f7('0x13')]);return _0x29e60e(_0x2c22a4[_0x83f7('0x11')][_0x83f7('0x13')]);}else{logger[_0x83f7('0xb')](_0x83f7('0xc'),_0x18b097,_0x83f7('0xd'));_0x29e60e(_0x2c22a4[_0x83f7('0x14')][_0x83f7('0x13')]);}})[_0x83f7('0x15')](function(_0x176f62){logger['error'](_0x83f7('0xc'),_0x18b097,_0x176f62);_0x19a044(_0x176f62);});});}
\ No newline at end of file
index 506548c..a8c4b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87c7=['index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x2017de,_0x18be40){var _0x2ee0ff=function(_0x101fe7){while(--_0x101fe7){_0x2017de['push'](_0x2017de['shift']());}};_0x2ee0ff(++_0x18be40);}(_0x87c7,0x7c));var _0x787c=function(_0x3ae80b,_0x169564){_0x3ae80b=_0x3ae80b-0x0;var _0x19b93c=_0x87c7[_0x3ae80b];return _0x19b93c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x787c('0x0'));var timeout=require(_0x787c('0x1'));var express=require(_0x787c('0x2'));var router=express[_0x787c('0x3')]();var fs_extra=require(_0x787c('0x4'));var auth=require(_0x787c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x787c('0x6'));var controller=require(_0x787c('0x7'));router[_0x787c('0x8')]('/',auth['isAuthenticated'](),controller[_0x787c('0x9')]);router[_0x787c('0x8')](_0x787c('0xa'),auth['isAuthenticated'](),controller[_0x787c('0xb')]);router[_0x787c('0xc')]('/',auth[_0x787c('0xd')](),controller[_0x787c('0xe')]);router[_0x787c('0xf')](_0x787c('0xa'),auth[_0x787c('0xd')](),controller[_0x787c('0x10')]);router[_0x787c('0x11')](_0x787c('0xa'),auth[_0x787c('0xd')](),controller[_0x787c('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb40c=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x258759,_0x1003c4){var _0x4fefa0=function(_0x17bde1){while(--_0x17bde1){_0x258759['push'](_0x258759['shift']());}};_0x4fefa0(++_0x1003c4);}(_0xb40c,0xbe));var _0xcb40=function(_0x49ff57,_0x517496){_0x49ff57=_0x49ff57-0x0;var _0x32e5a9=_0xb40c[_0x49ff57];return _0x32e5a9;};'use strict';var multer=require(_0xcb40('0x0'));var util=require('util');var path=require(_0xcb40('0x1'));var timeout=require(_0xcb40('0x2'));var express=require(_0xcb40('0x3'));var router=express[_0xcb40('0x4')]();var fs_extra=require(_0xcb40('0x5'));var auth=require(_0xcb40('0x6'));var interaction=require(_0xcb40('0x7'));var config=require(_0xcb40('0x8'));var controller=require(_0xcb40('0x9'));router[_0xcb40('0xa')]('/',auth[_0xcb40('0xb')](),controller[_0xcb40('0xc')]);router[_0xcb40('0xa')]('/:id',auth[_0xcb40('0xb')](),controller[_0xcb40('0xd')]);router['post']('/',auth[_0xcb40('0xb')](),controller[_0xcb40('0xe')]);router[_0xcb40('0xf')](_0xcb40('0x10'),auth[_0xcb40('0xb')](),controller[_0xcb40('0x11')]);router[_0xcb40('0x12')](_0xcb40('0x10'),auth[_0xcb40('0xb')](),controller[_0xcb40('0x13')]);module[_0xcb40('0x14')]=router;
\ No newline at end of file
index 792465a..c32fc3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ba=['picklist','STRING','ENUM','variable','customVariable','sequelize','string'];(function(_0x3f7a1d,_0x4bc551){var _0x104a9d=function(_0x26f9e6){while(--_0x26f9e6){_0x3f7a1d['push'](_0x3f7a1d['shift']());}};_0x104a9d(++_0x4bc551);}(_0xc5ba,0x155));var _0xac5b=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0xc5ba[_0x8fa4bc];return _0x35b6a7;};'use strict';var Sequelize=require(_0xac5b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xac5b('0x1'),'variable','customVariable','keyValue',_0xac5b('0x2')),'defaultValue':_0xac5b('0x1')},'content':{'type':Sequelize[_0xac5b('0x3')]},'key':{'type':Sequelize[_0xac5b('0x3')]},'keyType':{'type':Sequelize[_0xac5b('0x4')]('string',_0xac5b('0x5'),_0xac5b('0x6'))},'keyContent':{'type':Sequelize[_0xac5b('0x3')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xac5b('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0d05=['variable','customVariable','keyValue','picklist','STRING','exports','ENUM','string'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x0d05,0x95));var _0x50d0=function(_0x2bf031,_0x2e84d8){_0x2bf031=_0x2bf031-0x0;var _0x215504=_0x0d05[_0x2bf031];return _0x215504;};'use strict';var Sequelize=require('sequelize');module[_0x50d0('0x0')]={'type':{'type':Sequelize[_0x50d0('0x1')](_0x50d0('0x2'),_0x50d0('0x3'),_0x50d0('0x4'),_0x50d0('0x5'),_0x50d0('0x6')),'defaultValue':_0x50d0('0x2')},'content':{'type':Sequelize[_0x50d0('0x7')]},'key':{'type':Sequelize[_0x50d0('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x50d0('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x50d0('0x7')]},'idField':{'type':Sequelize[_0x50d0('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x50d0('0x7')]}};
\ No newline at end of file
index 4d1f563..44d9433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb9=['sendStatus','status','json','undefined','limit','offset','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','Dynamics365Field','count','includeAll','include','findAll','catch','params','find','create','body','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4b3942,_0xbe1f06){var _0x3fc1ef=function(_0x42c957){while(--_0x42c957){_0x4b3942['push'](_0x4b3942['shift']());}};_0x3fc1ef(++_0xbe1f06);}(_0xaeb9,0x185));var _0x9aeb=function(_0x18b968,_0x438e48){_0x18b968=_0x18b968-0x0;var _0x286075=_0xaeb9[_0x18b968];return _0x286075;};'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(_0x9aeb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9aeb('0x1'));var util=require(_0x9aeb('0x2'));var path=require(_0x9aeb('0x3'));var sox=require(_0x9aeb('0x4'));var csv=require(_0x9aeb('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9aeb('0x6'));var _=require(_0x9aeb('0x7'));var squel=require(_0x9aeb('0x8'));var crypto=require('crypto');var jsforce=require(_0x9aeb('0x9'));var deskjs=require(_0x9aeb('0xa'));var toCsv=require(_0x9aeb('0x5'));var querystring=require(_0x9aeb('0xb'));var Papa=require(_0x9aeb('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9aeb('0xd'));var as=require(_0x9aeb('0xe'));var hardwareService=require(_0x9aeb('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x9aeb('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x9aeb('0x11'));var db=require(_0x9aeb('0x12'))['db'];function respondWithStatusCode(_0x9f3204,_0x468e75){_0x468e75=_0x468e75||0xcc;return function(_0x835d9a){if(_0x835d9a){return _0x9f3204[_0x9aeb('0x13')](_0x468e75);}return _0x9f3204[_0x9aeb('0x14')](_0x468e75)['end']();};}function respondWithResult(_0x231397,_0x290c55){_0x290c55=_0x290c55||0xc8;return function(_0x409c28){if(_0x409c28){return _0x231397['status'](_0x290c55)[_0x9aeb('0x15')](_0x409c28);}};}function respondWithFilteredResult(_0x4d6f43,_0x40df98){return function(_0x5c1c90){if(_0x5c1c90){var _0x49f02a=typeof _0x40df98['offset']===_0x9aeb('0x16')&&typeof _0x40df98[_0x9aeb('0x17')]===_0x9aeb('0x16');var _0x2f6a32=_0x5c1c90['count'];var _0x28d621=_0x49f02a?0x0:_0x40df98[_0x9aeb('0x18')];var _0x60ae22=_0x49f02a?_0x5c1c90['count']:_0x40df98['offset']+_0x40df98['limit'];var _0x212415;if(_0x60ae22>=_0x2f6a32){_0x60ae22=_0x2f6a32;_0x212415=0xc8;}else{_0x212415=0xce;}_0x4d6f43['status'](_0x212415);return _0x4d6f43['set'](_0x9aeb('0x19'),_0x28d621+'-'+_0x60ae22+'/'+_0x2f6a32)[_0x9aeb('0x15')](_0x5c1c90);}return null;};}function patchUpdates(_0xe371c3){return function(_0x1660ab){try{jsonpatch[_0x9aeb('0x1a')](_0x1660ab,_0xe371c3,!![]);}catch(_0xa8e4cb){return BPromise[_0x9aeb('0x1b')](_0xa8e4cb);}return _0x1660ab['save']();};}function saveUpdates(_0x1f6799,_0x26bbc8){return function(_0x1802c9){if(_0x1802c9){return _0x1802c9[_0x9aeb('0x1c')](_0x1f6799)[_0x9aeb('0x1d')](function(_0x299b7e){return _0x299b7e;});}return null;};}function removeEntity(_0x457e71,_0x5d7e13){return function(_0x4fccea){if(_0x4fccea){return _0x4fccea[_0x9aeb('0x1e')]()[_0x9aeb('0x1d')](function(){_0x457e71['status'](0xcc)[_0x9aeb('0x1f')]();});}};}function handleEntityNotFound(_0x367f76,_0x543d30){return function(_0x3b3ce3){if(!_0x3b3ce3){_0x367f76['sendStatus'](0x194);}return _0x3b3ce3;};}function handleError(_0x47b4fc,_0x52d983){_0x52d983=_0x52d983||0x1f4;return function(_0x7d2c99){logger[_0x9aeb('0x20')](_0x7d2c99[_0x9aeb('0x21')]);if(_0x7d2c99[_0x9aeb('0x22')]){delete _0x7d2c99[_0x9aeb('0x22')];}_0x47b4fc['status'](_0x52d983)[_0x9aeb('0x23')](_0x7d2c99);};}exports[_0x9aeb('0x24')]=function(_0x246511,_0x5793b4){var _0x10437f={},_0x14efec={},_0x1d74b0={'count':0x0,'rows':[]};var _0xd82798=_[_0x9aeb('0x25')](db['Dynamics365Field'][_0x9aeb('0x26')],function(_0x4a65f2){return{'name':_0x4a65f2['fieldName'],'type':_0x4a65f2[_0x9aeb('0x27')][_0x9aeb('0x28')]};});_0x14efec[_0x9aeb('0x29')]=_[_0x9aeb('0x25')](_0xd82798,_0x9aeb('0x22'));_0x14efec[_0x9aeb('0x2a')]=_[_0x9aeb('0x2b')](_0x246511[_0x9aeb('0x2a')]);_0x14efec[_0x9aeb('0x2c')]=_['intersection'](_0x14efec['model'],_0x14efec['query']);_0x10437f['attributes']=_[_0x9aeb('0x2d')](_0x14efec['model'],qs['fields'](_0x246511['query'][_0x9aeb('0x2e')]));_0x10437f[_0x9aeb('0x2f')]=_0x10437f[_0x9aeb('0x2f')][_0x9aeb('0x30')]?_0x10437f[_0x9aeb('0x2f')]:_0x14efec[_0x9aeb('0x29')];if(!_0x246511[_0x9aeb('0x2a')][_0x9aeb('0x31')](_0x9aeb('0x32'))){_0x10437f[_0x9aeb('0x17')]=qs['limit'](_0x246511[_0x9aeb('0x2a')][_0x9aeb('0x17')]);_0x10437f['offset']=qs[_0x9aeb('0x18')](_0x246511[_0x9aeb('0x2a')][_0x9aeb('0x18')]);}_0x10437f[_0x9aeb('0x33')]=qs['sort'](_0x246511[_0x9aeb('0x2a')]['sort']);_0x10437f['where']=qs[_0x9aeb('0x2c')](_[_0x9aeb('0x34')](_0x246511[_0x9aeb('0x2a')],_0x14efec[_0x9aeb('0x2c')]),_0xd82798);if(_0x246511['query'][_0x9aeb('0x35')]){_0x10437f[_0x9aeb('0x36')]=_[_0x9aeb('0x37')](_0x10437f[_0x9aeb('0x36')],{'$or':_[_0x9aeb('0x25')](_0xd82798,function(_0x39d673){if(_0x39d673[_0x9aeb('0x27')]!==_0x9aeb('0x38')){var _0x32135a={};_0x32135a[_0x39d673[_0x9aeb('0x22')]]={'$like':'%'+_0x246511[_0x9aeb('0x2a')][_0x9aeb('0x35')]+'%'};return _0x32135a;}})});}_0x10437f=_[_0x9aeb('0x37')]({},_0x10437f,_0x246511[_0x9aeb('0x39')]);var _0x62c8fa={'where':_0x10437f[_0x9aeb('0x36')]};return db[_0x9aeb('0x3a')][_0x9aeb('0x3b')](_0x62c8fa)[_0x9aeb('0x1d')](function(_0x573169){_0x1d74b0[_0x9aeb('0x3b')]=_0x573169;if(_0x246511[_0x9aeb('0x2a')][_0x9aeb('0x3c')]){_0x10437f[_0x9aeb('0x3d')]=[{'all':!![]}];}return db[_0x9aeb('0x3a')][_0x9aeb('0x3e')](_0x10437f);})[_0x9aeb('0x1d')](function(_0x35fc68){_0x1d74b0['rows']=_0x35fc68;return _0x1d74b0;})[_0x9aeb('0x1d')](respondWithFilteredResult(_0x5793b4,_0x10437f))[_0x9aeb('0x3f')](handleError(_0x5793b4,null));};exports['show']=function(_0xb33e56,_0x5efd29){var _0xc96e98={'raw':!![],'where':{'id':_0xb33e56[_0x9aeb('0x40')]['id']}},_0x3b4722={};_0x3b4722[_0x9aeb('0x29')]=_[_0x9aeb('0x2b')](db[_0x9aeb('0x3a')]['rawAttributes']);_0x3b4722[_0x9aeb('0x2a')]=_[_0x9aeb('0x2b')](_0xb33e56[_0x9aeb('0x2a')]);_0x3b4722[_0x9aeb('0x2c')]=_[_0x9aeb('0x2d')](_0x3b4722[_0x9aeb('0x29')],_0x3b4722[_0x9aeb('0x2a')]);_0xc96e98[_0x9aeb('0x2f')]=_[_0x9aeb('0x2d')](_0x3b4722['model'],qs[_0x9aeb('0x2e')](_0xb33e56['query']['fields']));_0xc96e98[_0x9aeb('0x2f')]=_0xc96e98[_0x9aeb('0x2f')][_0x9aeb('0x30')]?_0xc96e98[_0x9aeb('0x2f')]:_0x3b4722[_0x9aeb('0x29')];if(_0xb33e56[_0x9aeb('0x2a')][_0x9aeb('0x3c')]){_0xc96e98['include']=[{'all':!![]}];}_0xc96e98=_['merge']({},_0xc96e98,_0xb33e56['options']);return db[_0x9aeb('0x3a')][_0x9aeb('0x41')](_0xc96e98)[_0x9aeb('0x1d')](handleEntityNotFound(_0x5efd29,null))[_0x9aeb('0x1d')](respondWithResult(_0x5efd29,null))['catch'](handleError(_0x5efd29,null));};exports[_0x9aeb('0x42')]=function(_0x1bd9e9,_0xd20586){return db['Dynamics365Field'][_0x9aeb('0x42')](_0x1bd9e9[_0x9aeb('0x43')],{})[_0x9aeb('0x1d')](respondWithResult(_0xd20586,0xc9))[_0x9aeb('0x3f')](handleError(_0xd20586,null));};exports['update']=function(_0x2db799,_0x3d7bf0){if(_0x2db799['body']['id']){delete _0x2db799[_0x9aeb('0x43')]['id'];}return db['Dynamics365Field'][_0x9aeb('0x41')]({'where':{'id':_0x2db799[_0x9aeb('0x40')]['id']}})[_0x9aeb('0x1d')](handleEntityNotFound(_0x3d7bf0,null))[_0x9aeb('0x1d')](saveUpdates(_0x2db799[_0x9aeb('0x43')],null))[_0x9aeb('0x1d')](respondWithResult(_0x3d7bf0,null))[_0x9aeb('0x3f')](handleError(_0x3d7bf0,null));};exports[_0x9aeb('0x1e')]=function(_0x5eb502,_0x157ae1){return db[_0x9aeb('0x3a')][_0x9aeb('0x41')]({'where':{'id':_0x5eb502[_0x9aeb('0x40')]['id']}})[_0x9aeb('0x1d')](handleEntityNotFound(_0x157ae1,null))[_0x9aeb('0x1d')](removeEntity(_0x157ae1,null))['catch'](handleError(_0x157ae1,null));};
\ No newline at end of file
+var _0x7562=['../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','Dynamics365Field','fieldName','type','key','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','params','keys','rawAttributes','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2b79d2,_0x5975ce){var _0x128248=function(_0x442740){while(--_0x442740){_0x2b79d2['push'](_0x2b79d2['shift']());}};_0x128248(++_0x5975ce);}(_0x7562,0x10f));var _0x2756=function(_0x32e985,_0xdfa2b5){_0x32e985=_0x32e985-0x0;var _0x5a9911=_0x7562[_0x32e985];return _0x5a9911;};'use strict';var emlformat=require(_0x2756('0x0'));var rimraf=require(_0x2756('0x1'));var zipdir=require(_0x2756('0x2'));var jsonpatch=require(_0x2756('0x3'));var rp=require(_0x2756('0x4'));var moment=require('moment');var BPromise=require(_0x2756('0x5'));var Mustache=require(_0x2756('0x6'));var util=require(_0x2756('0x7'));var path=require(_0x2756('0x8'));var sox=require('sox');var csv=require(_0x2756('0x9'));var ejs=require(_0x2756('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2756('0xb'));var crypto=require(_0x2756('0xc'));var jsforce=require(_0x2756('0xd'));var deskjs=require(_0x2756('0xe'));var toCsv=require(_0x2756('0x9'));var querystring=require(_0x2756('0xf'));var Papa=require(_0x2756('0x10'));var Redis=require(_0x2756('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2756('0x12'));var hardwareService=require(_0x2756('0x13'));var logger=require(_0x2756('0x14'))(_0x2756('0x15'));var utils=require(_0x2756('0x16'));var config=require(_0x2756('0x17'));var licenseUtil=require(_0x2756('0x18'));var db=require(_0x2756('0x19'))['db'];function respondWithStatusCode(_0x5523c8,_0x231330){_0x231330=_0x231330||0xcc;return function(_0x52dd6b){if(_0x52dd6b){return _0x5523c8['sendStatus'](_0x231330);}return _0x5523c8[_0x2756('0x1a')](_0x231330)[_0x2756('0x1b')]();};}function respondWithResult(_0x5bc24a,_0x5ec199){_0x5ec199=_0x5ec199||0xc8;return function(_0x21c4f7){if(_0x21c4f7){return _0x5bc24a[_0x2756('0x1a')](_0x5ec199)[_0x2756('0x1c')](_0x21c4f7);}};}function respondWithFilteredResult(_0x5c5b76,_0x29bac4){return function(_0x596d15){if(_0x596d15){var _0x5ba4ac=typeof _0x29bac4[_0x2756('0x1d')]===_0x2756('0x1e')&&typeof _0x29bac4['limit']==='undefined';var _0x106a0a=_0x596d15['count'];var _0x549463=_0x5ba4ac?0x0:_0x29bac4[_0x2756('0x1d')];var _0x383a76=_0x5ba4ac?_0x596d15[_0x2756('0x1f')]:_0x29bac4[_0x2756('0x1d')]+_0x29bac4[_0x2756('0x20')];var _0x6a0359;if(_0x383a76>=_0x106a0a){_0x383a76=_0x106a0a;_0x6a0359=0xc8;}else{_0x6a0359=0xce;}_0x5c5b76['status'](_0x6a0359);return _0x5c5b76[_0x2756('0x21')](_0x2756('0x22'),_0x549463+'-'+_0x383a76+'/'+_0x106a0a)[_0x2756('0x1c')](_0x596d15);}return null;};}function patchUpdates(_0x44cebf){return function(_0x1a27f5){try{jsonpatch[_0x2756('0x23')](_0x1a27f5,_0x44cebf,!![]);}catch(_0x40b899){return BPromise[_0x2756('0x24')](_0x40b899);}return _0x1a27f5[_0x2756('0x25')]();};}function saveUpdates(_0x978bb9,_0xe0788e){return function(_0x47c04f){if(_0x47c04f){return _0x47c04f[_0x2756('0x26')](_0x978bb9)[_0x2756('0x27')](function(_0x2a8c66){return _0x2a8c66;});}return null;};}function removeEntity(_0x1911b1,_0x53f6d8){return function(_0x1c1d44){if(_0x1c1d44){return _0x1c1d44[_0x2756('0x28')]()[_0x2756('0x27')](function(){_0x1911b1[_0x2756('0x1a')](0xcc)[_0x2756('0x1b')]();});}};}function handleEntityNotFound(_0x18eaa2,_0x22d7f5){return function(_0x68d94d){if(!_0x68d94d){_0x18eaa2[_0x2756('0x29')](0x194);}return _0x68d94d;};}function handleError(_0x4d9759,_0x5bb79b){_0x5bb79b=_0x5bb79b||0x1f4;return function(_0x38e83c){logger['error'](_0x38e83c['stack']);if(_0x38e83c[_0x2756('0x2a')]){delete _0x38e83c[_0x2756('0x2a')];}_0x4d9759[_0x2756('0x1a')](_0x5bb79b)[_0x2756('0x2b')](_0x38e83c);};}exports[_0x2756('0x2c')]=function(_0x47322a,_0x4a6f4a){var _0x639ca9={},_0x2f6478={},_0x4ae79b={'count':0x0,'rows':[]};var _0x4f695f=_[_0x2756('0x2d')](db[_0x2756('0x2e')]['rawAttributes'],function(_0x559c62){return{'name':_0x559c62[_0x2756('0x2f')],'type':_0x559c62[_0x2756('0x30')][_0x2756('0x31')]};});_0x2f6478['model']=_[_0x2756('0x2d')](_0x4f695f,_0x2756('0x2a'));_0x2f6478[_0x2756('0x32')]=_['keys'](_0x47322a[_0x2756('0x32')]);_0x2f6478[_0x2756('0x33')]=_[_0x2756('0x34')](_0x2f6478[_0x2756('0x35')],_0x2f6478[_0x2756('0x32')]);_0x639ca9['attributes']=_[_0x2756('0x34')](_0x2f6478['model'],qs['fields'](_0x47322a['query'][_0x2756('0x36')]));_0x639ca9['attributes']=_0x639ca9[_0x2756('0x37')]['length']?_0x639ca9[_0x2756('0x37')]:_0x2f6478[_0x2756('0x35')];if(!_0x47322a['query']['hasOwnProperty'](_0x2756('0x38'))){_0x639ca9[_0x2756('0x20')]=qs[_0x2756('0x20')](_0x47322a[_0x2756('0x32')][_0x2756('0x20')]);_0x639ca9[_0x2756('0x1d')]=qs[_0x2756('0x1d')](_0x47322a[_0x2756('0x32')][_0x2756('0x1d')]);}_0x639ca9['order']=qs[_0x2756('0x39')](_0x47322a[_0x2756('0x32')]['sort']);_0x639ca9[_0x2756('0x3a')]=qs[_0x2756('0x33')](_[_0x2756('0x3b')](_0x47322a[_0x2756('0x32')],_0x2f6478[_0x2756('0x33')]),_0x4f695f);if(_0x47322a[_0x2756('0x32')][_0x2756('0x3c')]){_0x639ca9[_0x2756('0x3a')]=_[_0x2756('0x3d')](_0x639ca9['where'],{'$or':_[_0x2756('0x2d')](_0x4f695f,function(_0x3e249f){if(_0x3e249f[_0x2756('0x30')]!=='VIRTUAL'){var _0x477e77={};_0x477e77[_0x3e249f[_0x2756('0x2a')]]={'$like':'%'+_0x47322a[_0x2756('0x32')][_0x2756('0x3c')]+'%'};return _0x477e77;}})});}_0x639ca9=_['merge']({},_0x639ca9,_0x47322a[_0x2756('0x3e')]);var _0x125ee4={'where':_0x639ca9[_0x2756('0x3a')]};return db[_0x2756('0x2e')]['count'](_0x125ee4)[_0x2756('0x27')](function(_0x2de674){_0x4ae79b[_0x2756('0x1f')]=_0x2de674;if(_0x47322a[_0x2756('0x32')]['includeAll']){_0x639ca9[_0x2756('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x2756('0x40')](_0x639ca9);})[_0x2756('0x27')](function(_0x19e945){_0x4ae79b['rows']=_0x19e945;return _0x4ae79b;})[_0x2756('0x27')](respondWithFilteredResult(_0x4a6f4a,_0x639ca9))[_0x2756('0x41')](handleError(_0x4a6f4a,null));};exports['show']=function(_0x25cd3d,_0xf870b8){var _0x523b8e={'raw':!![],'where':{'id':_0x25cd3d[_0x2756('0x42')]['id']}},_0xda76e3={};_0xda76e3[_0x2756('0x35')]=_[_0x2756('0x43')](db[_0x2756('0x2e')][_0x2756('0x44')]);_0xda76e3['query']=_[_0x2756('0x43')](_0x25cd3d[_0x2756('0x32')]);_0xda76e3[_0x2756('0x33')]=_['intersection'](_0xda76e3[_0x2756('0x35')],_0xda76e3[_0x2756('0x32')]);_0x523b8e[_0x2756('0x37')]=_['intersection'](_0xda76e3['model'],qs['fields'](_0x25cd3d[_0x2756('0x32')][_0x2756('0x36')]));_0x523b8e['attributes']=_0x523b8e[_0x2756('0x37')][_0x2756('0x45')]?_0x523b8e[_0x2756('0x37')]:_0xda76e3['model'];if(_0x25cd3d[_0x2756('0x32')][_0x2756('0x46')]){_0x523b8e['include']=[{'all':!![]}];}_0x523b8e=_[_0x2756('0x3d')]({},_0x523b8e,_0x25cd3d[_0x2756('0x3e')]);return db[_0x2756('0x2e')][_0x2756('0x47')](_0x523b8e)[_0x2756('0x27')](handleEntityNotFound(_0xf870b8,null))[_0x2756('0x27')](respondWithResult(_0xf870b8,null))['catch'](handleError(_0xf870b8,null));};exports['create']=function(_0x5ee77e,_0x1a848c){return db[_0x2756('0x2e')][_0x2756('0x48')](_0x5ee77e[_0x2756('0x49')],{})[_0x2756('0x27')](respondWithResult(_0x1a848c,0xc9))[_0x2756('0x41')](handleError(_0x1a848c,null));};exports['update']=function(_0xa7f308,_0x5db2e7){if(_0xa7f308['body']['id']){delete _0xa7f308[_0x2756('0x49')]['id'];}return db['Dynamics365Field'][_0x2756('0x47')]({'where':{'id':_0xa7f308[_0x2756('0x42')]['id']}})[_0x2756('0x27')](handleEntityNotFound(_0x5db2e7,null))[_0x2756('0x27')](saveUpdates(_0xa7f308[_0x2756('0x49')],null))[_0x2756('0x27')](respondWithResult(_0x5db2e7,null))[_0x2756('0x41')](handleError(_0x5db2e7,null));};exports[_0x2756('0x28')]=function(_0x4275a9,_0x266dac){return db[_0x2756('0x2e')]['find']({'where':{'id':_0x4275a9[_0x2756('0x42')]['id']}})['then'](handleEntityNotFound(_0x266dac,null))[_0x2756('0x27')](removeEntity(_0x266dac,null))[_0x2756('0x41')](handleError(_0x266dac,null));};
\ No newline at end of file
index 6184ca3..3cf1239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd73d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','int_dynamics365_fields'];(function(_0x2adf08,_0x1fa2f6){var _0x2bbb77=function(_0x2d9a80){while(--_0x2d9a80){_0x2adf08['push'](_0x2adf08['shift']());}};_0x2bbb77(++_0x1fa2f6);}(_0xd73d,0x150));var _0xdd73=function(_0x1c6a56,_0x490201){_0x1c6a56=_0x1c6a56-0x0;var _0x5e2b01=_0xd73d[_0x1c6a56];return _0x5e2b01;};'use strict';var _=require(_0xdd73('0x0'));var util=require(_0xdd73('0x1'));var logger=require(_0xdd73('0x2'))(_0xdd73('0x3'));var moment=require(_0xdd73('0x4'));var BPromise=require(_0xdd73('0x5'));var rp=require(_0xdd73('0x6'));var fs=require('fs');var path=require(_0xdd73('0x7'));var rimraf=require('rimraf');var config=require(_0xdd73('0x8'));var attributes=require(_0xdd73('0x9'));module[_0xdd73('0xa')]=function(_0x587b8c,_0xd1dd3){return _0x587b8c['define']('Dynamics365Field',attributes,{'tableName':_0xdd73('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x460f=['api','bluebird','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x293cb3,_0xc8e867){var _0x361785=function(_0x3225d3){while(--_0x3225d3){_0x293cb3['push'](_0x293cb3['shift']());}};_0x361785(++_0xc8e867);}(_0x460f,0x6d));var _0xf460=function(_0x30a3bd,_0x197c95){_0x30a3bd=_0x30a3bd-0x0;var _0x408309=_0x460f[_0x30a3bd];return _0x408309;};'use strict';var _=require(_0xf460('0x0'));var util=require(_0xf460('0x1'));var logger=require(_0xf460('0x2'))(_0xf460('0x3'));var moment=require('moment');var BPromise=require(_0xf460('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf460('0x5'));var rimraf=require(_0xf460('0x6'));var config=require('../../config/environment');var attributes=require(_0xf460('0x7'));module[_0xf460('0x8')]=function(_0x46e0a1,_0x4387c1){return _0x46e0a1[_0xf460('0x9')](_0xf460('0xa'),attributes,{'tableName':_0xf460('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xf460('0xc'),_0xf460('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 40e4129..caeecf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9da1=['client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x3788c2,_0x489257){var _0xb9c4d2=function(_0x5c0cca){while(--_0x5c0cca){_0x3788c2['push'](_0x3788c2['shift']());}};_0xb9c4d2(++_0x489257);}(_0x9da1,0x1d7));var _0x19da=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0x9da1[_0x2a2799];return _0x17f761;};'use strict';var _=require(_0x19da('0x0'));var util=require(_0x19da('0x1'));var moment=require(_0x19da('0x2'));var BPromise=require(_0x19da('0x3'));var rs=require(_0x19da('0x4'));var fs=require('fs');var Redis=require(_0x19da('0x5'));var db=require(_0x19da('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x19da('0x7'))('rpc');var config=require(_0x19da('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x19da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b49f3,_0x212c0e,_0x10d90a){return new BPromise(function(_0x2ce8bb,_0x1e24f4){return client[_0x19da('0xa')](_0x2b49f3,_0x10d90a)[_0x19da('0xb')](function(_0x3821f6){logger[_0x19da('0xc')](_0x19da('0xd'),_0x212c0e,_0x19da('0xe'));logger['debug'](_0x19da('0xf'),_0x212c0e,_0x19da('0xe'),JSON['stringify'](_0x3821f6));if(_0x3821f6['error']){if(_0x3821f6[_0x19da('0x10')][_0x19da('0x11')]===0x1f4){logger[_0x19da('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x212c0e,_0x3821f6[_0x19da('0x10')]['message']);return _0x1e24f4(_0x3821f6[_0x19da('0x10')][_0x19da('0x12')]);}logger[_0x19da('0x10')](_0x19da('0xd'),_0x212c0e,_0x3821f6[_0x19da('0x10')][_0x19da('0x12')]);return _0x2ce8bb(_0x3821f6[_0x19da('0x10')][_0x19da('0x12')]);}else{logger[_0x19da('0xc')](_0x19da('0xd'),_0x212c0e,_0x19da('0xe'));_0x2ce8bb(_0x3821f6[_0x19da('0x13')][_0x19da('0x12')]);}})['catch'](function(_0x52fa76){logger[_0x19da('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x212c0e,_0x52fa76);_0x1e24f4(_0x52fa76);});});}
\ No newline at end of file
+var _0x959f=['debug','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x128c10,_0x157ac9){var _0x5b1080=function(_0x5d49b1){while(--_0x5d49b1){_0x128c10['push'](_0x128c10['shift']());}};_0x5b1080(++_0x157ac9);}(_0x959f,0xc4));var _0xf959=function(_0x3753a0,_0x5a5b91){_0x3753a0=_0x3753a0-0x0;var _0x2be2ea=_0x959f[_0x3753a0];return _0x2be2ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf959('0x0'));var BPromise=require(_0xf959('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf959('0x2'));var db=require(_0xf959('0x3'))['db'];var utils=require(_0xf959('0x4'));var logger=require('../../config/logger')(_0xf959('0x5'));var config=require(_0xf959('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf959('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4bf513,_0x2d12f9,_0x6d185f){return new BPromise(function(_0x3748c7,_0x24bef9){return client[_0xf959('0x8')](_0x4bf513,_0x6d185f)[_0xf959('0x9')](function(_0xe9f3e0){logger[_0xf959('0xa')](_0xf959('0xb'),_0x2d12f9,_0xf959('0xc'));logger[_0xf959('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2d12f9,'request\x20sent',JSON['stringify'](_0xe9f3e0));if(_0xe9f3e0[_0xf959('0xe')]){if(_0xe9f3e0[_0xf959('0xe')][_0xf959('0xf')]===0x1f4){logger[_0xf959('0xe')](_0xf959('0xb'),_0x2d12f9,_0xe9f3e0[_0xf959('0xe')][_0xf959('0x10')]);return _0x24bef9(_0xe9f3e0[_0xf959('0xe')][_0xf959('0x10')]);}logger[_0xf959('0xe')](_0xf959('0xb'),_0x2d12f9,_0xe9f3e0[_0xf959('0xe')][_0xf959('0x10')]);return _0x3748c7(_0xe9f3e0['error'][_0xf959('0x10')]);}else{logger[_0xf959('0xa')](_0xf959('0xb'),_0x2d12f9,_0xf959('0xc'));_0x3748c7(_0xe9f3e0[_0xf959('0x11')][_0xf959('0x10')]);}})[_0xf959('0x12')](function(_0x2f4c0c){logger[_0xf959('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x2d12f9,_0x2f4c0c);_0x24bef9(_0x2f4c0c);});});}
\ No newline at end of file
index 9cc4d8d..247b755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1040=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x31ecd1,_0x52df3d){var _0x911498=function(_0x4c4f73){while(--_0x4c4f73){_0x31ecd1['push'](_0x31ecd1['shift']());}};_0x911498(++_0x52df3d);}(_0x1040,0x158));var _0x0104=function(_0x58ac34,_0x5b5bfb){_0x58ac34=_0x58ac34-0x0;var _0x3921ab=_0x1040[_0x58ac34];return _0x3921ab;};'use strict';var multer=require(_0x0104('0x0'));var util=require(_0x0104('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0104('0x2')]();var fs_extra=require(_0x0104('0x3'));var auth=require(_0x0104('0x4'));var interaction=require(_0x0104('0x5'));var config=require(_0x0104('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x0104('0x7')]('/',auth['isAuthenticated'](),controller[_0x0104('0x8')]);router[_0x0104('0x7')](_0x0104('0x9'),auth[_0x0104('0xa')](),controller[_0x0104('0xb')]);router[_0x0104('0x7')](_0x0104('0xc'),auth['isAuthenticated'](),controller[_0x0104('0xd')]);router[_0x0104('0x7')](_0x0104('0xe'),auth['isAuthenticated'](),controller[_0x0104('0xf')]);router[_0x0104('0x10')]('/',auth[_0x0104('0xa')](),controller[_0x0104('0x11')]);router[_0x0104('0x10')](_0x0104('0xc'),auth[_0x0104('0xa')](),controller[_0x0104('0x12')]);router[_0x0104('0x13')]('/:id',auth[_0x0104('0xa')](),controller[_0x0104('0x14')]);router[_0x0104('0x15')]('/:id',auth[_0x0104('0xa')](),controller[_0x0104('0x16')]);module[_0x0104('0x17')]=router;
\ No newline at end of file
+var _0xe75b=['getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xe75b,0x168));var _0xbe75=function(_0x1d7d63,_0x448421){_0x1d7d63=_0x1d7d63-0x0;var _0x41d684=_0xe75b[_0x1d7d63];return _0x41d684;};'use strict';var multer=require(_0xbe75('0x0'));var util=require(_0xbe75('0x1'));var path=require(_0xbe75('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbe75('0x3')]();var fs_extra=require(_0xbe75('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbe75('0x5'));var controller=require(_0xbe75('0x6'));router[_0xbe75('0x7')]('/',auth[_0xbe75('0x8')](),controller[_0xbe75('0x9')]);router[_0xbe75('0x7')](_0xbe75('0xa'),auth[_0xbe75('0x8')](),controller[_0xbe75('0xb')]);router[_0xbe75('0x7')]('/:id/configurations',auth[_0xbe75('0x8')](),controller[_0xbe75('0xc')]);router['get'](_0xbe75('0xd'),auth[_0xbe75('0x8')](),controller[_0xbe75('0xe')]);router['post']('/',auth[_0xbe75('0x8')](),controller['create']);router[_0xbe75('0xf')](_0xbe75('0x10'),auth[_0xbe75('0x8')](),controller[_0xbe75('0x11')]);router[_0xbe75('0x12')]('/:id',auth[_0xbe75('0x8')](),controller[_0xbe75('0x13')]);router[_0xbe75('0x14')](_0xbe75('0xa'),auth[_0xbe75('0x8')](),controller[_0xbe75('0x15')]);module['exports']=router;
\ No newline at end of file
index a6f46d1..0980b01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x28419c,_0x188ef2){var _0x59a4ba=function(_0x5efcb7){while(--_0x5efcb7){_0x28419c['push'](_0x28419c['shift']());}};_0x59a4ba(++_0x188ef2);}(_0xe5af,0x9c));var _0xfe5a=function(_0x558f99,_0x3ac63c){_0x558f99=_0x558f99-0x0;var _0x134ebc=_0xe5af[_0x558f99];return _0x134ebc;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x6a55=['STRING','sequelize'];(function(_0x297201,_0x8a9fca){var _0x4337eb=function(_0x413d3d){while(--_0x413d3d){_0x297201['push'](_0x297201['shift']());}};_0x4337eb(++_0x8a9fca);}(_0x6a55,0xdb));var _0x56a5=function(_0x2e030a,_0x8e4c48){_0x2e030a=_0x2e030a-0x0;var _0x597df6=_0x6a55[_0x2e030a];return _0x597df6;};'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 9b6d260..53362d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc9d=['query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','find','create','update','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','getSubjects','channel','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','description','priority','source','ticket_type','group','remove','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','send','index','FreshdeskAccount','rawAttributes','type','key','name'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x57ce89,_0x389a7d){_0x57ce89=_0x57ce89-0x0;var _0x53371b=_0xbc9d[_0x57ce89];return _0x53371b;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];var integrations=require(_0xdbc9('0x19'));function respondWithStatusCode(_0x48bc83,_0x567e71){_0x567e71=_0x567e71||0xcc;return function(_0x3d0fdd){if(_0x3d0fdd){return _0x48bc83[_0xdbc9('0x1a')](_0x567e71);}return _0x48bc83[_0xdbc9('0x1b')](_0x567e71)[_0xdbc9('0x1c')]();};}function respondWithResult(_0x53495d,_0x4a9dcb){_0x4a9dcb=_0x4a9dcb||0xc8;return function(_0x2b7bd){if(_0x2b7bd){return _0x53495d[_0xdbc9('0x1b')](_0x4a9dcb)[_0xdbc9('0x1d')](_0x2b7bd);}};}function respondWithFilteredResult(_0x4c7b4f,_0x1b4616){return function(_0x1abee8){if(_0x1abee8){var _0x4fdb81=typeof _0x1b4616[_0xdbc9('0x1e')]===_0xdbc9('0x1f')&&typeof _0x1b4616[_0xdbc9('0x20')]===_0xdbc9('0x1f');var _0x1f22f4=_0x1abee8[_0xdbc9('0x21')];var _0x9f343d=_0x4fdb81?0x0:_0x1b4616[_0xdbc9('0x1e')];var _0x2ad952=_0x4fdb81?_0x1abee8[_0xdbc9('0x21')]:_0x1b4616['offset']+_0x1b4616[_0xdbc9('0x20')];var _0x497be2;if(_0x2ad952>=_0x1f22f4){_0x2ad952=_0x1f22f4;_0x497be2=0xc8;}else{_0x497be2=0xce;}_0x4c7b4f[_0xdbc9('0x1b')](_0x497be2);return _0x4c7b4f[_0xdbc9('0x22')]('Content-Range',_0x9f343d+'-'+_0x2ad952+'/'+_0x1f22f4)[_0xdbc9('0x1d')](_0x1abee8);}return null;};}function patchUpdates(_0x5367dc){return function(_0x569f32){try{jsonpatch['apply'](_0x569f32,_0x5367dc,!![]);}catch(_0x4f3b5d){return BPromise[_0xdbc9('0x23')](_0x4f3b5d);}return _0x569f32[_0xdbc9('0x24')]();};}function saveUpdates(_0x570ad9,_0x16dcf7){return function(_0x20563e){if(_0x20563e){return _0x20563e['update'](_0x570ad9)[_0xdbc9('0x25')](function(_0x6b788){return _0x6b788;});}return null;};}function removeEntity(_0x1b1c0d,_0x119230){return function(_0x3400e7){if(_0x3400e7){return _0x3400e7[_0xdbc9('0x26')]()[_0xdbc9('0x25')](function(){_0x1b1c0d[_0xdbc9('0x1b')](0xcc)[_0xdbc9('0x1c')]();});}};}function handleEntityNotFound(_0x4a868b,_0x550bef){return function(_0xe309ae){if(!_0xe309ae){_0x4a868b[_0xdbc9('0x1a')](0x194);}return _0xe309ae;};}function handleError(_0x1053ca,_0x24fdec){_0x24fdec=_0x24fdec||0x1f4;return function(_0x50c3ee){logger[_0xdbc9('0x27')](_0x50c3ee[_0xdbc9('0x28')]);if(_0x50c3ee['name']){delete _0x50c3ee['name'];}_0x1053ca[_0xdbc9('0x1b')](_0x24fdec)[_0xdbc9('0x29')](_0x50c3ee);};}exports[_0xdbc9('0x2a')]=function(_0x59bfd2,_0x13a432){var _0x539e57={},_0x561f8e={},_0x210a40={'count':0x0,'rows':[]};var _0x49da36=_['map'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')],function(_0x1cb557){return{'name':_0x1cb557['fieldName'],'type':_0x1cb557[_0xdbc9('0x2d')][_0xdbc9('0x2e')]};});_0x561f8e['model']=_['map'](_0x49da36,_0xdbc9('0x2f'));_0x561f8e[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x59bfd2[_0xdbc9('0x30')]);_0x561f8e[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],_0x561f8e['query']);_0x539e57[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x561f8e[_0xdbc9('0x34')],qs[_0xdbc9('0x36')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x539e57['attributes']=_0x539e57[_0xdbc9('0x35')]['length']?_0x539e57['attributes']:_0x561f8e['model'];if(!_0x59bfd2['query']['hasOwnProperty'](_0xdbc9('0x37'))){_0x539e57[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x59bfd2['query'][_0xdbc9('0x20')]);_0x539e57[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x1e')]);}_0x539e57[_0xdbc9('0x38')]=qs['sort'](_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x39')]);_0x539e57[_0xdbc9('0x3a')]=qs['filters'](_[_0xdbc9('0x3b')](_0x59bfd2[_0xdbc9('0x30')],_0x561f8e[_0xdbc9('0x32')]),_0x49da36);if(_0x59bfd2[_0xdbc9('0x30')]['filter']){_0x539e57['where']=_[_0xdbc9('0x3c')](_0x539e57[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x49da36,function(_0x1ef970){if(_0x1ef970['type']!==_0xdbc9('0x3e')){var _0x3827be={};_0x3827be[_0x1ef970[_0xdbc9('0x2f')]]={'$like':'%'+_0x59bfd2['query'][_0xdbc9('0x3f')]+'%'};return _0x3827be;}})});}_0x539e57=_[_0xdbc9('0x3c')]({},_0x539e57,_0x59bfd2[_0xdbc9('0x40')]);var _0x523c79={'where':_0x539e57[_0xdbc9('0x3a')]};return db[_0xdbc9('0x2b')]['count'](_0x523c79)['then'](function(_0xfc34d5){_0x210a40[_0xdbc9('0x21')]=_0xfc34d5;if(_0x59bfd2[_0xdbc9('0x30')][_0xdbc9('0x41')]){_0x539e57['include']=[{'all':!![]}];}return db[_0xdbc9('0x2b')][_0xdbc9('0x42')](_0x539e57);})['then'](function(_0x8445b8){_0x210a40[_0xdbc9('0x43')]=_0x8445b8;return _0x210a40;})['then'](respondWithFilteredResult(_0x13a432,_0x539e57))[_0xdbc9('0x44')](handleError(_0x13a432,null));};exports[_0xdbc9('0x45')]=function(_0x2adb23,_0x3415c3){var _0x3ed4de={'raw':![],'where':{'id':_0x2adb23[_0xdbc9('0x46')]['id']}},_0x1cd538={};_0x1cd538['model']=_['keys'](db[_0xdbc9('0x2b')][_0xdbc9('0x2c')]);_0x1cd538[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x2adb23[_0xdbc9('0x30')]);_0x1cd538[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x1cd538[_0xdbc9('0x34')],_0x1cd538[_0xdbc9('0x30')]);_0x3ed4de[_0xdbc9('0x35')]=_[_0xdbc9('0x33')](_0x1cd538['model'],qs['fields'](_0x2adb23[_0xdbc9('0x30')][_0xdbc9('0x36')]));_0x3ed4de[_0xdbc9('0x35')]=_0x3ed4de[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x3ed4de[_0xdbc9('0x35')]:_0x1cd538[_0xdbc9('0x34')];if(_0x2adb23[_0xdbc9('0x30')]['includeAll']){_0x3ed4de['include']=[{'all':!![]}];}_0x3ed4de=_[_0xdbc9('0x3c')]({},_0x3ed4de,_0x2adb23[_0xdbc9('0x40')]);return db[_0xdbc9('0x2b')][_0xdbc9('0x48')](_0x3ed4de)[_0xdbc9('0x25')](handleEntityNotFound(_0x3415c3,null))[_0xdbc9('0x25')](respondWithResult(_0x3415c3,null))[_0xdbc9('0x44')](handleError(_0x3415c3,null));};exports[_0xdbc9('0x49')]=function(_0x43e3ec,_0x589557){return db[_0xdbc9('0x2b')][_0xdbc9('0x49')](_0x43e3ec['body'],{})['then'](respondWithResult(_0x589557,0xc9))[_0xdbc9('0x44')](handleError(_0x589557,null));};exports[_0xdbc9('0x4a')]=function(_0x133a13,_0x49a55c){if(_0x133a13[_0xdbc9('0x4b')]['id']){delete _0x133a13[_0xdbc9('0x4b')]['id'];}return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x133a13['params']['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x49a55c,null))[_0xdbc9('0x25')](saveUpdates(_0x133a13[_0xdbc9('0x4b')],null))[_0xdbc9('0x25')](respondWithResult(_0x49a55c,null))['catch'](handleError(_0x49a55c,null));};exports[_0xdbc9('0x26')]=function(_0x36c70e,_0x3f49b7){return db[_0xdbc9('0x2b')][_0xdbc9('0x48')]({'where':{'id':_0x36c70e[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3f49b7,null))[_0xdbc9('0x25')](removeEntity(_0x3f49b7,null))['catch'](handleError(_0x3f49b7,null));};exports[_0xdbc9('0x4c')]=function(_0x4d09e1,_0x3f493e,_0x4279bc){var _0x53771a={};var _0x561737={};var _0xc7335d;var _0x4b55df;return db[_0xdbc9('0x2b')][_0xdbc9('0x4d')]({'where':{'id':_0x4d09e1[_0xdbc9('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f493e,null))[_0xdbc9('0x25')](function(_0x1c52e6){if(_0x1c52e6){_0xc7335d=_0x1c52e6;_0x561737[_0xdbc9('0x34')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x4e')][_0xdbc9('0x2c')]);_0x561737[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x4d09e1['query']);_0x561737['filters']=_['intersection'](_0x561737[_0xdbc9('0x34')],_0x561737[_0xdbc9('0x30')]);_0x53771a[_0xdbc9('0x35')]=_['intersection'](_0x561737['model'],qs[_0xdbc9('0x36')](_0x4d09e1[_0xdbc9('0x30')]['fields']));_0x53771a['attributes']=_0x53771a[_0xdbc9('0x35')][_0xdbc9('0x47')]?_0x53771a[_0xdbc9('0x35')]:_0x561737[_0xdbc9('0x34')];_0x53771a[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x4d09e1['query'][_0xdbc9('0x39')]);_0x53771a[_0xdbc9('0x3a')]=qs[_0xdbc9('0x32')](_['pick'](_0x4d09e1[_0xdbc9('0x30')],_0x561737[_0xdbc9('0x32')]));if(_0x4d09e1[_0xdbc9('0x30')]['filter']){_0x53771a[_0xdbc9('0x3a')]=_['merge'](_0x53771a[_0xdbc9('0x3a')],{'$or':_[_0xdbc9('0x3d')](_0x53771a[_0xdbc9('0x35')],function(_0x26ed1c){var _0x148061={};_0x148061[_0x26ed1c]={'$like':'%'+_0x4d09e1[_0xdbc9('0x30')]['filter']+'%'};return _0x148061;})});}_0x53771a=_[_0xdbc9('0x3c')]({},_0x53771a,_0x4d09e1['options']);return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})[_0xdbc9('0x25')](function(_0x53fcd6){if(_0x53fcd6){_0x4b55df=_0x53fcd6[_0xdbc9('0x47')];if(!_0x4d09e1[_0xdbc9('0x30')]['hasOwnProperty']('nolimit')){_0x53771a[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x4d09e1[_0xdbc9('0x30')]['limit']);_0x53771a[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x4d09e1['query'][_0xdbc9('0x1e')]);}return _0xc7335d[_0xdbc9('0x4c')](_0x53771a);}})['then'](function(_0x4876f9){if(_0x4876f9){return _0x4876f9?{'count':_0x4b55df,'rows':_0x4876f9}:null;}})[_0xdbc9('0x25')](respondWithResult(_0x3f493e,null))[_0xdbc9('0x44')](handleError(_0x3f493e,null));};exports[_0xdbc9('0x4f')]=function(_0xa8b4d9,_0x3e93d3,_0x14cbf4){if(_0xa8b4d9[_0xdbc9('0x4b')]['id']){delete _0xa8b4d9[_0xdbc9('0x4b')]['id'];}return db['FreshdeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0xa8b4d9[_0xdbc9('0x46')]['id']}})[_0xdbc9('0x25')](handleEntityNotFound(_0x3e93d3,null))[_0xdbc9('0x25')](function(_0x38f7da){if(_0x38f7da){_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x50')]=_0x38f7da['id'];_0xa8b4d9[_0xdbc9('0x4b')]['Subjects']=integrations[_0xdbc9('0x51')](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9['body'][_0xdbc9('0x2d')]);_0xa8b4d9[_0xdbc9('0x4b')]['Descriptions']=integrations['getDescriptions'](_0xa8b4d9['body'][_0xdbc9('0x52')],_0xa8b4d9[_0xdbc9('0x4b')][_0xdbc9('0x2d')]);return db['FreshdeskConfiguration'][_0xdbc9('0x49')](_0xa8b4d9[_0xdbc9('0x4b')],{'include':[{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x54')},{'model':db[_0xdbc9('0x53')],'as':_0xdbc9('0x55')}]});}return null;})[_0xdbc9('0x25')](respondWithResult(_0x3e93d3,null))[_0xdbc9('0x44')](handleError(_0x3e93d3,null));};exports[_0xdbc9('0x56')]=function(_0x5e6522,_0x2787d9,_0x2c3223){var _0x511778='';return db['FreshdeskAccount'][_0xdbc9('0x4d')]({'where':{'id':_0x5e6522[_0xdbc9('0x46')]['id']},'attributes':['id',_0xdbc9('0x57'),_0xdbc9('0x58')]})[_0xdbc9('0x25')](handleEntityNotFound(_0x2787d9,null))[_0xdbc9('0x25')](function(_0xa80fea){if(_0xa80fea){_0x511778=_0xa80fea['remoteUri'];var _0x23eb73=_0x511778[_0xdbc9('0x59')](-0x1);if(_0x23eb73==='/'){_0x511778=_0x511778[_0xdbc9('0x5a')](0x0,_0x511778['lastIndexOf'](_0x23eb73));}return rp({'method':_0xdbc9('0x5b'),'uri':util[_0xdbc9('0x5c')](_0xdbc9('0x5d'),_0x511778,_0xdbc9('0x5e')),'headers':{'Authorization':util[_0xdbc9('0x5c')](_0xdbc9('0x5f'),new Buffer(util[_0xdbc9('0x5c')](_0xdbc9('0x60'),_0xa80fea[_0xdbc9('0x58')]))[_0xdbc9('0x61')](_0xdbc9('0x62')))},'json':!![]});}})[_0xdbc9('0x25')](function(_0x5197eb){if(_0x5197eb){var _0x5b27a9=[_0xdbc9('0x63'),'subject','agent',_0xdbc9('0x64'),_0xdbc9('0x1b'),_0xdbc9('0x65'),'group',_0xdbc9('0x66'),_0xdbc9('0x67'),_0xdbc9('0x68'),'company'];_[_0xdbc9('0x69')](_0x5197eb,function(_0x2572c1){return _0x5b27a9['includes'](_0x2572c1[_0xdbc9('0x2f')])||!_0x2572c1[_0xdbc9('0x6a')]&&_0x2572c1[_0xdbc9('0x2d')]!==_0xdbc9('0x6b')&&_0x2572c1[_0xdbc9('0x2d')]!=='custom_dropdown';});return{'count':_0x5197eb['length'],'rows':_[_0xdbc9('0x3d')](_0x5197eb,function(_0x185165){return{'id':_0x185165['name'],'name':_0x185165[_0xdbc9('0x6c')],'custom':!_0x185165[_0xdbc9('0x6a')],'options':_0x185165[_0xdbc9('0x6d')]?_['map'](_0x185165[_0xdbc9('0x6d')],function(_0x3d3fc3){return{'name':_[_0xdbc9('0x6e')](_0x3d3fc3),'value':_0x3d3fc3};}):[]};})};}})[_0xdbc9('0x25')](respondWithResult(_0x2787d9,null))[_0xdbc9('0x44')](function(_0x42516a){var _0x1b053a=_0x5e6522[_0xdbc9('0x30')]['test']?0x1f4:_0x42516a[_0xdbc9('0x6f')]||0x1f4;logger[_0xdbc9('0x27')](_0xdbc9('0x70'),_0xdbc9('0x56'),_0x1b053a,JSON['stringify'](_0x42516a));delete _0x42516a[_0xdbc9('0x2f')];if(_0x1b053a===0x191){_0x1b053a=0x190;}_0x2787d9['status'](_0x1b053a)['send'](_0x5e6522[_0xdbc9('0x30')][_0xdbc9('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x42516a[_0xdbc9('0x6f')]}:_0x42516a);});};
\ No newline at end of file
+var _0x19ea=['description','priority','source','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','length','order','sort','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Subjects','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject'];(function(_0x1fd9dd,_0x282dfc){var _0x44dd3c=function(_0x104811){while(--_0x104811){_0x1fd9dd['push'](_0x1fd9dd['shift']());}};_0x44dd3c(++_0x282dfc);}(_0x19ea,0xfe));var _0xa19e=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x19ea[_0x2d9c6a];return _0xf3c918;};'use strict';var emlformat=require(_0xa19e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa19e('0x1'));var rp=require('request-promise');var moment=require(_0xa19e('0x2'));var BPromise=require(_0xa19e('0x3'));var Mustache=require(_0xa19e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa19e('0x5'));var csv=require(_0xa19e('0x6'));var ejs=require(_0xa19e('0x7'));var fs=require('fs');var fs_extra=require(_0xa19e('0x8'));var _=require(_0xa19e('0x9'));var squel=require(_0xa19e('0xa'));var crypto=require(_0xa19e('0xb'));var jsforce=require(_0xa19e('0xc'));var deskjs=require(_0xa19e('0xd'));var toCsv=require(_0xa19e('0x6'));var querystring=require(_0xa19e('0xe'));var Papa=require('papaparse');var Redis=require(_0xa19e('0xf'));var authService=require(_0xa19e('0x10'));var qs=require(_0xa19e('0x11'));var as=require(_0xa19e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa19e('0x13'))(_0xa19e('0x14'));var utils=require(_0xa19e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa19e('0x16'));var db=require(_0xa19e('0x17'))['db'];var integrations=require(_0xa19e('0x18'));function respondWithStatusCode(_0x1bd1f5,_0x35ca5b){_0x35ca5b=_0x35ca5b||0xcc;return function(_0x4eed79){if(_0x4eed79){return _0x1bd1f5[_0xa19e('0x19')](_0x35ca5b);}return _0x1bd1f5[_0xa19e('0x1a')](_0x35ca5b)[_0xa19e('0x1b')]();};}function respondWithResult(_0x28dedd,_0x564d2a){_0x564d2a=_0x564d2a||0xc8;return function(_0x3c6425){if(_0x3c6425){return _0x28dedd[_0xa19e('0x1a')](_0x564d2a)[_0xa19e('0x1c')](_0x3c6425);}};}function respondWithFilteredResult(_0x3be281,_0x1fdea2){return function(_0x2598f5){if(_0x2598f5){var _0x48530c=typeof _0x1fdea2[_0xa19e('0x1d')]===_0xa19e('0x1e')&&typeof _0x1fdea2[_0xa19e('0x1f')]===_0xa19e('0x1e');var _0x3acfae=_0x2598f5[_0xa19e('0x20')];var _0x1f37c4=_0x48530c?0x0:_0x1fdea2['offset'];var _0xd3e0ff=_0x48530c?_0x2598f5['count']:_0x1fdea2[_0xa19e('0x1d')]+_0x1fdea2['limit'];var _0x5ce913;if(_0xd3e0ff>=_0x3acfae){_0xd3e0ff=_0x3acfae;_0x5ce913=0xc8;}else{_0x5ce913=0xce;}_0x3be281[_0xa19e('0x1a')](_0x5ce913);return _0x3be281[_0xa19e('0x21')]('Content-Range',_0x1f37c4+'-'+_0xd3e0ff+'/'+_0x3acfae)[_0xa19e('0x1c')](_0x2598f5);}return null;};}function patchUpdates(_0x3f2060){return function(_0x3c11d5){try{jsonpatch[_0xa19e('0x22')](_0x3c11d5,_0x3f2060,!![]);}catch(_0x5869c8){return BPromise[_0xa19e('0x23')](_0x5869c8);}return _0x3c11d5[_0xa19e('0x24')]();};}function saveUpdates(_0x105874,_0x301f6d){return function(_0x472c95){if(_0x472c95){return _0x472c95[_0xa19e('0x25')](_0x105874)[_0xa19e('0x26')](function(_0x20a649){return _0x20a649;});}return null;};}function removeEntity(_0xc16a44,_0x536386){return function(_0x466a55){if(_0x466a55){return _0x466a55[_0xa19e('0x27')]()['then'](function(){_0xc16a44[_0xa19e('0x1a')](0xcc)[_0xa19e('0x1b')]();});}};}function handleEntityNotFound(_0x4e06b8,_0x20b05c){return function(_0x389f2f){if(!_0x389f2f){_0x4e06b8['sendStatus'](0x194);}return _0x389f2f;};}function handleError(_0x40dc1c,_0x10682d){_0x10682d=_0x10682d||0x1f4;return function(_0x2bd823){logger[_0xa19e('0x28')](_0x2bd823[_0xa19e('0x29')]);if(_0x2bd823[_0xa19e('0x2a')]){delete _0x2bd823[_0xa19e('0x2a')];}_0x40dc1c[_0xa19e('0x1a')](_0x10682d)[_0xa19e('0x2b')](_0x2bd823);};}exports[_0xa19e('0x2c')]=function(_0x30e490,_0x3d1cae){var _0x1ce643={},_0x475a26={},_0xdf0b20={'count':0x0,'rows':[]};var _0x4613c3=_[_0xa19e('0x2d')](db[_0xa19e('0x2e')][_0xa19e('0x2f')],function(_0x114656){return{'name':_0x114656['fieldName'],'type':_0x114656[_0xa19e('0x30')][_0xa19e('0x31')]};});_0x475a26[_0xa19e('0x32')]=_[_0xa19e('0x2d')](_0x4613c3,_0xa19e('0x2a'));_0x475a26[_0xa19e('0x33')]=_['keys'](_0x30e490[_0xa19e('0x33')]);_0x475a26[_0xa19e('0x34')]=_['intersection'](_0x475a26[_0xa19e('0x32')],_0x475a26['query']);_0x1ce643['attributes']=_[_0xa19e('0x35')](_0x475a26['model'],qs['fields'](_0x30e490['query'][_0xa19e('0x36')]));_0x1ce643[_0xa19e('0x37')]=_0x1ce643[_0xa19e('0x37')]['length']?_0x1ce643[_0xa19e('0x37')]:_0x475a26[_0xa19e('0x32')];if(!_0x30e490[_0xa19e('0x33')][_0xa19e('0x38')](_0xa19e('0x39'))){_0x1ce643[_0xa19e('0x1f')]=qs['limit'](_0x30e490[_0xa19e('0x33')][_0xa19e('0x1f')]);_0x1ce643['offset']=qs[_0xa19e('0x1d')](_0x30e490[_0xa19e('0x33')][_0xa19e('0x1d')]);}_0x1ce643['order']=qs['sort'](_0x30e490[_0xa19e('0x33')]['sort']);_0x1ce643[_0xa19e('0x3a')]=qs[_0xa19e('0x34')](_[_0xa19e('0x3b')](_0x30e490[_0xa19e('0x33')],_0x475a26['filters']),_0x4613c3);if(_0x30e490[_0xa19e('0x33')][_0xa19e('0x3c')]){_0x1ce643['where']=_[_0xa19e('0x3d')](_0x1ce643['where'],{'$or':_[_0xa19e('0x2d')](_0x4613c3,function(_0x19b53b){if(_0x19b53b[_0xa19e('0x30')]!=='VIRTUAL'){var _0x45ee6f={};_0x45ee6f[_0x19b53b[_0xa19e('0x2a')]]={'$like':'%'+_0x30e490[_0xa19e('0x33')]['filter']+'%'};return _0x45ee6f;}})});}_0x1ce643=_[_0xa19e('0x3d')]({},_0x1ce643,_0x30e490[_0xa19e('0x3e')]);var _0x576acf={'where':_0x1ce643['where']};return db[_0xa19e('0x2e')][_0xa19e('0x20')](_0x576acf)['then'](function(_0x3974a1){_0xdf0b20[_0xa19e('0x20')]=_0x3974a1;if(_0x30e490['query'][_0xa19e('0x3f')]){_0x1ce643[_0xa19e('0x40')]=[{'all':!![]}];}return db[_0xa19e('0x2e')][_0xa19e('0x41')](_0x1ce643);})[_0xa19e('0x26')](function(_0x522485){_0xdf0b20[_0xa19e('0x42')]=_0x522485;return _0xdf0b20;})[_0xa19e('0x26')](respondWithFilteredResult(_0x3d1cae,_0x1ce643))[_0xa19e('0x43')](handleError(_0x3d1cae,null));};exports[_0xa19e('0x44')]=function(_0x124e8c,_0x51f0f4){var _0x315341={'raw':![],'where':{'id':_0x124e8c[_0xa19e('0x45')]['id']}},_0x4a22d8={};_0x4a22d8[_0xa19e('0x32')]=_['keys'](db[_0xa19e('0x2e')][_0xa19e('0x2f')]);_0x4a22d8['query']=_[_0xa19e('0x46')](_0x124e8c['query']);_0x4a22d8[_0xa19e('0x34')]=_[_0xa19e('0x35')](_0x4a22d8[_0xa19e('0x32')],_0x4a22d8[_0xa19e('0x33')]);_0x315341[_0xa19e('0x37')]=_[_0xa19e('0x35')](_0x4a22d8[_0xa19e('0x32')],qs[_0xa19e('0x36')](_0x124e8c['query'][_0xa19e('0x36')]));_0x315341[_0xa19e('0x37')]=_0x315341['attributes']['length']?_0x315341[_0xa19e('0x37')]:_0x4a22d8[_0xa19e('0x32')];if(_0x124e8c[_0xa19e('0x33')]['includeAll']){_0x315341[_0xa19e('0x40')]=[{'all':!![]}];}_0x315341=_[_0xa19e('0x3d')]({},_0x315341,_0x124e8c['options']);return db[_0xa19e('0x2e')][_0xa19e('0x47')](_0x315341)[_0xa19e('0x26')](handleEntityNotFound(_0x51f0f4,null))['then'](respondWithResult(_0x51f0f4,null))[_0xa19e('0x43')](handleError(_0x51f0f4,null));};exports['create']=function(_0x349543,_0x2f32af){return db[_0xa19e('0x2e')][_0xa19e('0x48')](_0x349543[_0xa19e('0x49')],{})['then'](respondWithResult(_0x2f32af,0xc9))[_0xa19e('0x43')](handleError(_0x2f32af,null));};exports['update']=function(_0x4779d8,_0x5d2e5f){if(_0x4779d8[_0xa19e('0x49')]['id']){delete _0x4779d8[_0xa19e('0x49')]['id'];}return db[_0xa19e('0x2e')][_0xa19e('0x47')]({'where':{'id':_0x4779d8['params']['id']}})[_0xa19e('0x26')](handleEntityNotFound(_0x5d2e5f,null))[_0xa19e('0x26')](saveUpdates(_0x4779d8[_0xa19e('0x49')],null))[_0xa19e('0x26')](respondWithResult(_0x5d2e5f,null))['catch'](handleError(_0x5d2e5f,null));};exports[_0xa19e('0x27')]=function(_0x5ae431,_0x2c58c8){return db[_0xa19e('0x2e')][_0xa19e('0x47')]({'where':{'id':_0x5ae431['params']['id']}})[_0xa19e('0x26')](handleEntityNotFound(_0x2c58c8,null))[_0xa19e('0x26')](removeEntity(_0x2c58c8,null))['catch'](handleError(_0x2c58c8,null));};exports[_0xa19e('0x4a')]=function(_0x13045d,_0x33b6b0,_0x3f8751){var _0x58b3f4={};var _0x51d10a={};var _0x37e47c;var _0x239a3b;return db['FreshdeskAccount'][_0xa19e('0x4b')]({'where':{'id':_0x13045d[_0xa19e('0x45')]['id']}})['then'](handleEntityNotFound(_0x33b6b0,null))[_0xa19e('0x26')](function(_0x68e0d1){if(_0x68e0d1){_0x37e47c=_0x68e0d1;_0x51d10a[_0xa19e('0x32')]=_[_0xa19e('0x46')](db[_0xa19e('0x4c')][_0xa19e('0x2f')]);_0x51d10a[_0xa19e('0x33')]=_[_0xa19e('0x46')](_0x13045d[_0xa19e('0x33')]);_0x51d10a[_0xa19e('0x34')]=_[_0xa19e('0x35')](_0x51d10a['model'],_0x51d10a['query']);_0x58b3f4[_0xa19e('0x37')]=_[_0xa19e('0x35')](_0x51d10a[_0xa19e('0x32')],qs['fields'](_0x13045d['query']['fields']));_0x58b3f4[_0xa19e('0x37')]=_0x58b3f4['attributes'][_0xa19e('0x4d')]?_0x58b3f4[_0xa19e('0x37')]:_0x51d10a[_0xa19e('0x32')];_0x58b3f4[_0xa19e('0x4e')]=qs['sort'](_0x13045d[_0xa19e('0x33')][_0xa19e('0x4f')]);_0x58b3f4[_0xa19e('0x3a')]=qs[_0xa19e('0x34')](_[_0xa19e('0x3b')](_0x13045d[_0xa19e('0x33')],_0x51d10a[_0xa19e('0x34')]));if(_0x13045d[_0xa19e('0x33')][_0xa19e('0x3c')]){_0x58b3f4[_0xa19e('0x3a')]=_[_0xa19e('0x3d')](_0x58b3f4[_0xa19e('0x3a')],{'$or':_[_0xa19e('0x2d')](_0x58b3f4[_0xa19e('0x37')],function(_0x2bf399){var _0x2b3f72={};_0x2b3f72[_0x2bf399]={'$like':'%'+_0x13045d[_0xa19e('0x33')]['filter']+'%'};return _0x2b3f72;})});}_0x58b3f4=_[_0xa19e('0x3d')]({},_0x58b3f4,_0x13045d[_0xa19e('0x3e')]);return _0x37e47c['getConfigurations'](_0x58b3f4);}})[_0xa19e('0x26')](function(_0x51b33d){if(_0x51b33d){_0x239a3b=_0x51b33d['length'];if(!_0x13045d[_0xa19e('0x33')][_0xa19e('0x38')](_0xa19e('0x39'))){_0x58b3f4['limit']=qs[_0xa19e('0x1f')](_0x13045d['query'][_0xa19e('0x1f')]);_0x58b3f4['offset']=qs[_0xa19e('0x1d')](_0x13045d[_0xa19e('0x33')][_0xa19e('0x1d')]);}return _0x37e47c[_0xa19e('0x4a')](_0x58b3f4);}})[_0xa19e('0x26')](function(_0x4b0eaa){if(_0x4b0eaa){return _0x4b0eaa?{'count':_0x239a3b,'rows':_0x4b0eaa}:null;}})[_0xa19e('0x26')](respondWithResult(_0x33b6b0,null))['catch'](handleError(_0x33b6b0,null));};exports[_0xa19e('0x50')]=function(_0x5daff,_0x1ba3ae,_0x17f023){if(_0x5daff[_0xa19e('0x49')]['id']){delete _0x5daff[_0xa19e('0x49')]['id'];}return db[_0xa19e('0x2e')][_0xa19e('0x4b')]({'where':{'id':_0x5daff[_0xa19e('0x45')]['id']}})[_0xa19e('0x26')](handleEntityNotFound(_0x1ba3ae,null))[_0xa19e('0x26')](function(_0x3863d7){if(_0x3863d7){_0x5daff['body'][_0xa19e('0x51')]=_0x3863d7['id'];_0x5daff[_0xa19e('0x49')]['Subjects']=integrations[_0xa19e('0x52')](_0x5daff['body'][_0xa19e('0x53')],_0x5daff['body'][_0xa19e('0x30')]);_0x5daff[_0xa19e('0x49')]['Descriptions']=integrations[_0xa19e('0x54')](_0x5daff['body'][_0xa19e('0x53')],_0x5daff[_0xa19e('0x49')][_0xa19e('0x30')]);return db[_0xa19e('0x4c')][_0xa19e('0x48')](_0x5daff[_0xa19e('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0xa19e('0x55')},{'model':db[_0xa19e('0x56')],'as':_0xa19e('0x57')}]});}return null;})['then'](respondWithResult(_0x1ba3ae,null))[_0xa19e('0x43')](handleError(_0x1ba3ae,null));};exports[_0xa19e('0x58')]=function(_0x2ddc61,_0x510a00,_0x3027e7){var _0xf7d3d3='';return db['FreshdeskAccount'][_0xa19e('0x4b')]({'where':{'id':_0x2ddc61[_0xa19e('0x45')]['id']},'attributes':['id',_0xa19e('0x59'),'apiKey']})[_0xa19e('0x26')](handleEntityNotFound(_0x510a00,null))[_0xa19e('0x26')](function(_0x434727){if(_0x434727){_0xf7d3d3=_0x434727[_0xa19e('0x59')];var _0x88be51=_0xf7d3d3[_0xa19e('0x5a')](-0x1);if(_0x88be51==='/'){_0xf7d3d3=_0xf7d3d3[_0xa19e('0x5b')](0x0,_0xf7d3d3['lastIndexOf'](_0x88be51));}return rp({'method':_0xa19e('0x5c'),'uri':util[_0xa19e('0x5d')](_0xa19e('0x5e'),_0xf7d3d3,_0xa19e('0x5f')),'headers':{'Authorization':util[_0xa19e('0x5d')](_0xa19e('0x60'),new Buffer(util[_0xa19e('0x5d')](_0xa19e('0x61'),_0x434727[_0xa19e('0x62')]))[_0xa19e('0x63')](_0xa19e('0x64')))},'json':!![]});}})[_0xa19e('0x26')](function(_0x255793){if(_0x255793){var _0x4b66bc=[_0xa19e('0x65'),_0xa19e('0x66'),'agent',_0xa19e('0x67'),_0xa19e('0x1a'),_0xa19e('0x68'),'group',_0xa19e('0x69'),'ticket_type','group','company'];_[_0xa19e('0x6a')](_0x255793,function(_0x5d3b38){return _0x4b66bc[_0xa19e('0x6b')](_0x5d3b38[_0xa19e('0x2a')])||!_0x5d3b38[_0xa19e('0x6c')]&&_0x5d3b38['type']!==_0xa19e('0x6d')&&_0x5d3b38[_0xa19e('0x30')]!==_0xa19e('0x6e');});return{'count':_0x255793[_0xa19e('0x4d')],'rows':_[_0xa19e('0x2d')](_0x255793,function(_0x36c7ed){return{'id':_0x36c7ed[_0xa19e('0x2a')],'name':_0x36c7ed[_0xa19e('0x6f')],'custom':!_0x36c7ed['default'],'options':_0x36c7ed[_0xa19e('0x70')]?_['map'](_0x36c7ed[_0xa19e('0x70')],function(_0x484cf9){return{'name':_[_0xa19e('0x71')](_0x484cf9),'value':_0x484cf9};}):[]};})};}})[_0xa19e('0x26')](respondWithResult(_0x510a00,null))[_0xa19e('0x43')](function(_0x170f64){var _0x11b4ba=_0x2ddc61[_0xa19e('0x33')][_0xa19e('0x72')]?0x1f4:_0x170f64['statusCode']||0x1f4;logger[_0xa19e('0x28')](_0xa19e('0x73'),_0xa19e('0x58'),_0x11b4ba,JSON[_0xa19e('0x74')](_0x170f64));delete _0x170f64['name'];if(_0x11b4ba===0x191){_0x11b4ba=0x190;}_0x510a00[_0xa19e('0x1a')](_0x11b4ba)['send'](_0x2ddc61['query']['test']?{'message':_0xa19e('0x75'),'statusCode':_0x170f64[_0xa19e('0x76')]}:_0x170f64);});};
\ No newline at end of file
index 9b8adac..c830511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce9b=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x51d6a1,_0x54e39e){var _0x59cd04=function(_0x34fcbf){while(--_0x34fcbf){_0x51d6a1['push'](_0x51d6a1['shift']());}};_0x59cd04(++_0x54e39e);}(_0xce9b,0x149));var _0xbce9=function(_0x469e8d,_0x4bace6){_0x469e8d=_0x469e8d-0x0;var _0x327669=_0xce9b[_0x469e8d];return _0x327669;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbce9('0x0'));var moment=require(_0xbce9('0x1'));var BPromise=require(_0xbce9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbce9('0x3'));var rimraf=require(_0xbce9('0x4'));var config=require(_0xbce9('0x5'));var attributes=require(_0xbce9('0x6'));var integrations=require(_0xbce9('0x7'));module[_0xbce9('0x8')]=function(_0x32e968,_0x7a0086){return _0x32e968[_0xbce9('0x9')](_0xbce9('0xa'),attributes,{'tableName':_0xbce9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb37c=['../../components/integrations/configuration','define','int_freshdesk_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x241322,_0x1a653d){var _0x8536=function(_0x326188){while(--_0x326188){_0x241322['push'](_0x241322['shift']());}};_0x8536(++_0x1a653d);}(_0xb37c,0xf3));var _0xcb37=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb37c[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb37('0x0'))(_0xcb37('0x1'));var moment=require(_0xcb37('0x2'));var BPromise=require(_0xcb37('0x3'));var rp=require(_0xcb37('0x4'));var fs=require('fs');var path=require(_0xcb37('0x5'));var rimraf=require(_0xcb37('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xcb37('0x7'));module['exports']=function(_0x5a5cc4,_0x374692){return _0x5a5cc4[_0xcb37('0x8')]('FreshdeskAccount',attributes,{'tableName':_0xcb37('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4dc64fb..82df266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c29=['ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','raw','options','where','attributes','limit','include','model','map','stringify','catch','find'];(function(_0x4d9812,_0x201df6){var _0x4618a8=function(_0x86a7e){while(--_0x86a7e){_0x4d9812['push'](_0x4d9812['shift']());}};_0x4618a8(++_0x201df6);}(_0x0c29,0xd3));var _0x90c2=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x0c29[_0x52a857];return _0x4e2aae;};'use strict';var _=require(_0x90c2('0x0'));var util=require(_0x90c2('0x1'));var moment=require(_0x90c2('0x2'));var BPromise=require(_0x90c2('0x3'));var rs=require(_0x90c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x90c2('0x6'))(_0x90c2('0x7'));var config=require(_0x90c2('0x8'));var jayson=require(_0x90c2('0x9'));var client=jayson['client'][_0x90c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f743f,_0xc0085c,_0x54ee0c){return new BPromise(function(_0x37be70,_0x2faf05){return client[_0x90c2('0xb')](_0x3f743f,_0x54ee0c)[_0x90c2('0xc')](function(_0x2502a2){logger[_0x90c2('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0xc0085c,_0x90c2('0xe'));logger[_0x90c2('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xc0085c,_0x90c2('0xe'),JSON['stringify'](_0x2502a2));if(_0x2502a2[_0x90c2('0x10')]){if(_0x2502a2[_0x90c2('0x10')][_0x90c2('0x11')]===0x1f4){logger[_0x90c2('0x10')](_0x90c2('0x12'),_0xc0085c,_0x2502a2[_0x90c2('0x10')][_0x90c2('0x13')]);return _0x2faf05(_0x2502a2[_0x90c2('0x10')][_0x90c2('0x13')]);}logger['error'](_0x90c2('0x12'),_0xc0085c,_0x2502a2[_0x90c2('0x10')]['message']);return _0x37be70(_0x2502a2[_0x90c2('0x10')][_0x90c2('0x13')]);}else{logger['info'](_0x90c2('0x12'),_0xc0085c,_0x90c2('0xe'));_0x37be70(_0x2502a2[_0x90c2('0x14')][_0x90c2('0x13')]);}})['catch'](function(_0x5d3840){logger[_0x90c2('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0xc0085c,_0x5d3840);_0x2faf05(_0x5d3840);});});}exports[_0x90c2('0x15')]=function(_0x526e84){var _0x363edd=this;return new Promise(function(_0x29520f,_0x35755e){return db[_0x90c2('0x16')]['findAll']({'raw':_0x526e84['options']?_0x526e84['options'][_0x90c2('0x17')]===undefined?!![]:![]:!![],'where':_0x526e84[_0x90c2('0x18')]?_0x526e84['options'][_0x90c2('0x19')]||null:null,'attributes':_0x526e84[_0x90c2('0x18')]?_0x526e84[_0x90c2('0x18')][_0x90c2('0x1a')]||null:null,'limit':_0x526e84[_0x90c2('0x18')]?_0x526e84[_0x90c2('0x18')][_0x90c2('0x1b')]||null:null,'include':_0x526e84[_0x90c2('0x18')]?_0x526e84[_0x90c2('0x18')]['include']?_['map'](_0x526e84[_0x90c2('0x18')][_0x90c2('0x1c')],function(_0x3a8a44){return{'model':db[_0x3a8a44[_0x90c2('0x1d')]],'as':_0x3a8a44['as'],'attributes':_0x3a8a44['attributes'],'include':_0x3a8a44['include']?_[_0x90c2('0x1e')](_0x3a8a44[_0x90c2('0x1c')],function(_0x20feb0){return{'model':db[_0x20feb0[_0x90c2('0x1d')]],'as':_0x20feb0['as'],'attributes':_0x20feb0[_0x90c2('0x1a')],'include':_0x20feb0[_0x90c2('0x1c')]?_['map'](_0x20feb0[_0x90c2('0x1c')],function(_0xe74078){return{'model':db[_0xe74078['model']],'as':_0xe74078['as'],'attributes':_0xe74078['attributes']};}):[]};}):[]};}):[]:[]})[_0x90c2('0xc')](function(_0x4c5daf){logger[_0x90c2('0xd')]('GetFreshdeskAccount',_0x526e84);logger[_0x90c2('0xf')](_0x90c2('0x15'),_0x526e84,JSON[_0x90c2('0x1f')](_0x4c5daf));_0x29520f(_0x4c5daf);})[_0x90c2('0x20')](function(_0x50c77a){logger['error'](_0x90c2('0x15'),_0x50c77a[_0x90c2('0x13')],_0x526e84);_0x35755e(_0x363edd[_0x90c2('0x10')](0x1f4,_0x50c77a[_0x90c2('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x395a52){var _0x474f74=this;return new Promise(function(_0x455d41,_0xf0d4c8){return db['FreshdeskAccount'][_0x90c2('0x21')]({'raw':_0x395a52[_0x90c2('0x18')]?_0x395a52[_0x90c2('0x18')][_0x90c2('0x17')]===undefined?!![]:![]:!![],'where':_0x395a52[_0x90c2('0x18')]?_0x395a52[_0x90c2('0x18')]['where']||null:null,'attributes':_0x395a52[_0x90c2('0x18')]?_0x395a52[_0x90c2('0x18')][_0x90c2('0x1a')]||null:null,'include':_0x395a52[_0x90c2('0x18')]?_0x395a52[_0x90c2('0x18')][_0x90c2('0x1c')]?_[_0x90c2('0x1e')](_0x395a52[_0x90c2('0x18')][_0x90c2('0x1c')],function(_0x32a0e5){return{'model':db[_0x32a0e5[_0x90c2('0x1d')]],'as':_0x32a0e5['as'],'attributes':_0x32a0e5[_0x90c2('0x1a')],'include':_0x32a0e5[_0x90c2('0x1c')]?_['map'](_0x32a0e5[_0x90c2('0x1c')],function(_0xac1620){return{'model':db[_0xac1620[_0x90c2('0x1d')]],'as':_0xac1620['as'],'attributes':_0xac1620['attributes'],'include':_0xac1620[_0x90c2('0x1c')]?_['map'](_0xac1620[_0x90c2('0x1c')],function(_0xdc4d7b){return{'model':db[_0xdc4d7b[_0x90c2('0x1d')]],'as':_0xdc4d7b['as'],'attributes':_0xdc4d7b[_0x90c2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ac189){logger['info']('ShowFreshdeskAccount',_0x395a52);logger[_0x90c2('0xf')](_0x90c2('0x22'),_0x395a52,JSON['stringify'](_0x2ac189));_0x455d41(_0x2ac189);})['catch'](function(_0x165be4){logger[_0x90c2('0x10')](_0x90c2('0x22'),_0x165be4[_0x90c2('0x13')],_0x395a52);_0xf0d4c8(_0x474f74['error'](0x1f4,_0x165be4[_0x90c2('0x13')]));});});};
\ No newline at end of file
+var _0x9e8e=['client','http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetFreshdeskAccount','options','where','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x9e8e,0x1cb));var _0xe9e8=function(_0x435440,_0x237e43){_0x435440=_0x435440-0x0;var _0x4b7a5e=_0x9e8e[_0x435440];return _0x4b7a5e;};'use strict';var _=require(_0xe9e8('0x0'));var util=require(_0xe9e8('0x1'));var moment=require(_0xe9e8('0x2'));var BPromise=require(_0xe9e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9e8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9e8('0x5'))(_0xe9e8('0x6'));var config=require(_0xe9e8('0x7'));var jayson=require(_0xe9e8('0x8'));var client=jayson[_0xe9e8('0x9')][_0xe9e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x254e8e,_0x53d402,_0x383a3d){return new BPromise(function(_0x367e69,_0x1f80fd){return client[_0xe9e8('0xb')](_0x254e8e,_0x383a3d)[_0xe9e8('0xc')](function(_0x29b19f){logger[_0xe9e8('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d402,'request\x20sent');logger[_0xe9e8('0xe')](_0xe9e8('0xf'),_0x53d402,'request\x20sent',JSON['stringify'](_0x29b19f));if(_0x29b19f[_0xe9e8('0x10')]){if(_0x29b19f[_0xe9e8('0x10')][_0xe9e8('0x11')]===0x1f4){logger[_0xe9e8('0x10')](_0xe9e8('0x12'),_0x53d402,_0x29b19f[_0xe9e8('0x10')][_0xe9e8('0x13')]);return _0x1f80fd(_0x29b19f[_0xe9e8('0x10')]['message']);}logger['error'](_0xe9e8('0x12'),_0x53d402,_0x29b19f['error'][_0xe9e8('0x13')]);return _0x367e69(_0x29b19f['error'][_0xe9e8('0x13')]);}else{logger['info'](_0xe9e8('0x12'),_0x53d402,_0xe9e8('0x14'));_0x367e69(_0x29b19f[_0xe9e8('0x15')][_0xe9e8('0x13')]);}})[_0xe9e8('0x16')](function(_0x1c3e3a){logger[_0xe9e8('0x10')](_0xe9e8('0x12'),_0x53d402,_0x1c3e3a);_0x1f80fd(_0x1c3e3a);});});}exports[_0xe9e8('0x17')]=function(_0x425bb7){var _0x6a472f=this;return new Promise(function(_0x2ae3e9,_0x5c40ec){return db['FreshdeskAccount']['findAll']({'raw':_0x425bb7[_0xe9e8('0x18')]?_0x425bb7[_0xe9e8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x425bb7[_0xe9e8('0x18')]?_0x425bb7[_0xe9e8('0x18')][_0xe9e8('0x19')]||null:null,'attributes':_0x425bb7['options']?_0x425bb7[_0xe9e8('0x18')][_0xe9e8('0x1a')]||null:null,'limit':_0x425bb7[_0xe9e8('0x18')]?_0x425bb7['options'][_0xe9e8('0x1b')]||null:null,'include':_0x425bb7[_0xe9e8('0x18')]?_0x425bb7['options'][_0xe9e8('0x1c')]?_[_0xe9e8('0x1d')](_0x425bb7['options']['include'],function(_0x83b1b){return{'model':db[_0x83b1b[_0xe9e8('0x1e')]],'as':_0x83b1b['as'],'attributes':_0x83b1b[_0xe9e8('0x1a')],'include':_0x83b1b[_0xe9e8('0x1c')]?_[_0xe9e8('0x1d')](_0x83b1b['include'],function(_0x22a540){return{'model':db[_0x22a540[_0xe9e8('0x1e')]],'as':_0x22a540['as'],'attributes':_0x22a540[_0xe9e8('0x1a')],'include':_0x22a540['include']?_[_0xe9e8('0x1d')](_0x22a540[_0xe9e8('0x1c')],function(_0x19334e){return{'model':db[_0x19334e[_0xe9e8('0x1e')]],'as':_0x19334e['as'],'attributes':_0x19334e[_0xe9e8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe9e8('0xc')](function(_0x3da7f2){logger[_0xe9e8('0xd')]('GetFreshdeskAccount',_0x425bb7);logger[_0xe9e8('0xe')](_0xe9e8('0x17'),_0x425bb7,JSON[_0xe9e8('0x1f')](_0x3da7f2));_0x2ae3e9(_0x3da7f2);})[_0xe9e8('0x16')](function(_0x35286a){logger[_0xe9e8('0x10')](_0xe9e8('0x17'),_0x35286a[_0xe9e8('0x13')],_0x425bb7);_0x5c40ec(_0x6a472f['error'](0x1f4,_0x35286a[_0xe9e8('0x13')]));});});};exports[_0xe9e8('0x20')]=function(_0x50eaa1){var _0x5d251f=this;return new Promise(function(_0x2b235e,_0x568fcc){return db[_0xe9e8('0x21')][_0xe9e8('0x22')]({'raw':_0x50eaa1[_0xe9e8('0x18')]?_0x50eaa1[_0xe9e8('0x18')][_0xe9e8('0x23')]===undefined?!![]:![]:!![],'where':_0x50eaa1['options']?_0x50eaa1[_0xe9e8('0x18')]['where']||null:null,'attributes':_0x50eaa1[_0xe9e8('0x18')]?_0x50eaa1[_0xe9e8('0x18')][_0xe9e8('0x1a')]||null:null,'include':_0x50eaa1[_0xe9e8('0x18')]?_0x50eaa1[_0xe9e8('0x18')][_0xe9e8('0x1c')]?_[_0xe9e8('0x1d')](_0x50eaa1[_0xe9e8('0x18')][_0xe9e8('0x1c')],function(_0x4b34c6){return{'model':db[_0x4b34c6[_0xe9e8('0x1e')]],'as':_0x4b34c6['as'],'attributes':_0x4b34c6[_0xe9e8('0x1a')],'include':_0x4b34c6[_0xe9e8('0x1c')]?_[_0xe9e8('0x1d')](_0x4b34c6[_0xe9e8('0x1c')],function(_0x1333c6){return{'model':db[_0x1333c6[_0xe9e8('0x1e')]],'as':_0x1333c6['as'],'attributes':_0x1333c6['attributes'],'include':_0x1333c6[_0xe9e8('0x1c')]?_[_0xe9e8('0x1d')](_0x1333c6[_0xe9e8('0x1c')],function(_0x766ed2){return{'model':db[_0x766ed2[_0xe9e8('0x1e')]],'as':_0x766ed2['as'],'attributes':_0x766ed2[_0xe9e8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe9e8('0xc')](function(_0x3673cb){logger[_0xe9e8('0xd')]('ShowFreshdeskAccount',_0x50eaa1);logger[_0xe9e8('0xe')](_0xe9e8('0x20'),_0x50eaa1,JSON[_0xe9e8('0x1f')](_0x3673cb));_0x2b235e(_0x3673cb);})[_0xe9e8('0x16')](function(_0x4e6935){logger['error'](_0xe9e8('0x20'),_0x4e6935[_0xe9e8('0x13')],_0x50eaa1);_0x568fcc(_0x5d251f[_0xe9e8('0x10')](0x1f4,_0x4e6935[_0xe9e8('0x13')]));});});};
\ No newline at end of file
index e64fd42..2418f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03b5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','util','connect-timeout','express'];(function(_0x5b3544,_0x4f679d){var _0x5d9a5a=function(_0x426cba){while(--_0x426cba){_0x5b3544['push'](_0x5b3544['shift']());}};_0x5d9a5a(++_0x4f679d);}(_0x03b5,0xbd));var _0x503b=function(_0x1d693c,_0x1841e6){_0x1d693c=_0x1d693c-0x0;var _0x43873a=_0x03b5[_0x1d693c];return _0x43873a;};'use strict';var multer=require('multer');var util=require(_0x503b('0x0'));var path=require('path');var timeout=require(_0x503b('0x1'));var express=require(_0x503b('0x2'));var router=express[_0x503b('0x3')]();var fs_extra=require(_0x503b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x503b('0x5'));var config=require(_0x503b('0x6'));var controller=require(_0x503b('0x7'));router['get']('/',auth[_0x503b('0x8')](),controller['index']);router[_0x503b('0x9')](_0x503b('0xa'),auth[_0x503b('0x8')](),controller[_0x503b('0xb')]);router[_0x503b('0x9')]('/:id/fields',auth[_0x503b('0x8')](),controller['getFields']);router[_0x503b('0x9')](_0x503b('0xc'),auth[_0x503b('0x8')](),controller[_0x503b('0xd')]);router[_0x503b('0x9')](_0x503b('0xe'),auth[_0x503b('0x8')](),controller[_0x503b('0xf')]);router[_0x503b('0x9')](_0x503b('0x10'),auth[_0x503b('0x8')](),controller[_0x503b('0x11')]);router[_0x503b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x503b('0x12')](_0x503b('0x10'),auth[_0x503b('0x8')](),controller[_0x503b('0x13')]);router[_0x503b('0x14')](_0x503b('0xa'),auth['isAuthenticated'](),controller[_0x503b('0x15')]);router[_0x503b('0x16')]('/:id',auth[_0x503b('0x8')](),controller[_0x503b('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x9437=['getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','destroy','multer','util','path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x9437,0x1c0));var _0x7943=function(_0x182315,_0x311b9e){_0x182315=_0x182315-0x0;var _0x56ee46=_0x9437[_0x182315];return _0x56ee46;};'use strict';var multer=require(_0x7943('0x0'));var util=require(_0x7943('0x1'));var path=require(_0x7943('0x2'));var timeout=require('connect-timeout');var express=require(_0x7943('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7943('0x4'));var config=require(_0x7943('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x7943('0x6')]('/',auth[_0x7943('0x7')](),controller[_0x7943('0x8')]);router[_0x7943('0x6')](_0x7943('0x9'),auth['isAuthenticated'](),controller[_0x7943('0xa')]);router[_0x7943('0x6')](_0x7943('0xb'),auth[_0x7943('0x7')](),controller[_0x7943('0xc')]);router[_0x7943('0x6')](_0x7943('0xd'),auth[_0x7943('0x7')](),controller[_0x7943('0xe')]);router[_0x7943('0x6')](_0x7943('0xf'),auth[_0x7943('0x7')](),controller[_0x7943('0x10')]);router['get']('/:id/tags',auth[_0x7943('0x7')](),controller[_0x7943('0x11')]);router['post']('/',auth[_0x7943('0x7')](),controller[_0x7943('0x12')]);router[_0x7943('0x13')](_0x7943('0x14'),auth[_0x7943('0x7')](),controller['setTags']);router['put'](_0x7943('0x9'),auth[_0x7943('0x7')](),controller['update']);router['delete'](_0x7943('0x9'),auth['isAuthenticated'](),controller[_0x7943('0x15')]);module['exports']=router;
\ No newline at end of file
index d3bbd20..63706c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31b9=['STRING','sequelize','exports'];(function(_0x40f34e,_0x149b85){var _0x317549=function(_0x1c35da){while(--_0x1c35da){_0x40f34e['push'](_0x40f34e['shift']());}};_0x317549(++_0x149b85);}(_0x31b9,0x160));var _0x931b=function(_0x4e4090,_0x572855){_0x4e4090=_0x4e4090-0x0;var _0x4316d3=_0x31b9[_0x4e4090];return _0x4316d3;};'use strict';var Sequelize=require(_0x931b('0x0'));module[_0x931b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x931b('0x2')]}};
\ No newline at end of file
+var _0x69b0=['sequelize','exports','STRING'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x69b0,0x177));var _0x069b=function(_0x3265af,_0x505052){_0x3265af=_0x3265af-0x0;var _0x15955b=_0x69b0[_0x3265af];return _0x15955b;};'use strict';var Sequelize=require(_0x069b('0x0'));module[_0x069b('0x1')]={'name':{'type':Sequelize[_0x069b('0x2')]},'description':{'type':Sequelize[_0x069b('0x2')]}};
\ No newline at end of file
index e54eb47..15d44b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a68=['count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','catch','show','options','find','create','body','update','params','getFields','FreshdeskField','getSubjects','getDescriptions','getTags','findOne','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x3a68,0x130));var _0x83a6=function(_0x35ec00,_0x4c12fc){_0x35ec00=_0x35ec00-0x0;var _0x4dc487=_0x3a68[_0x35ec00];return _0x4dc487;};'use strict';var emlformat=require(_0x83a6('0x0'));var rimraf=require(_0x83a6('0x1'));var zipdir=require(_0x83a6('0x2'));var jsonpatch=require(_0x83a6('0x3'));var rp=require(_0x83a6('0x4'));var moment=require('moment');var BPromise=require(_0x83a6('0x5'));var Mustache=require(_0x83a6('0x6'));var util=require('util');var path=require(_0x83a6('0x7'));var sox=require('sox');var csv=require(_0x83a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83a6('0x9'));var _=require(_0x83a6('0xa'));var squel=require('squel');var crypto=require(_0x83a6('0xb'));var jsforce=require(_0x83a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x83a6('0x8'));var querystring=require(_0x83a6('0xd'));var Papa=require(_0x83a6('0xe'));var Redis=require(_0x83a6('0xf'));var authService=require(_0x83a6('0x10'));var qs=require(_0x83a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83a6('0x12'));var logger=require(_0x83a6('0x13'))(_0x83a6('0x14'));var utils=require(_0x83a6('0x15'));var config=require(_0x83a6('0x16'));var licenseUtil=require(_0x83a6('0x17'));var db=require(_0x83a6('0x18'))['db'];function respondWithStatusCode(_0xb86f8a,_0x4dd8d9){_0x4dd8d9=_0x4dd8d9||0xcc;return function(_0x253c8c){if(_0x253c8c){return _0xb86f8a[_0x83a6('0x19')](_0x4dd8d9);}return _0xb86f8a['status'](_0x4dd8d9)[_0x83a6('0x1a')]();};}function respondWithResult(_0x14c0e1,_0x5a2a78){_0x5a2a78=_0x5a2a78||0xc8;return function(_0x441cf4){if(_0x441cf4){return _0x14c0e1[_0x83a6('0x1b')](_0x5a2a78)[_0x83a6('0x1c')](_0x441cf4);}};}function respondWithFilteredResult(_0x481458,_0x1379b7){return function(_0x43ee44){if(_0x43ee44){var _0x27bea8=typeof _0x1379b7[_0x83a6('0x1d')]===_0x83a6('0x1e')&&typeof _0x1379b7[_0x83a6('0x1f')]===_0x83a6('0x1e');var _0x155d54=_0x43ee44['count'];var _0x539bcc=_0x27bea8?0x0:_0x1379b7[_0x83a6('0x1d')];var _0x2dbe10=_0x27bea8?_0x43ee44[_0x83a6('0x20')]:_0x1379b7[_0x83a6('0x1d')]+_0x1379b7[_0x83a6('0x1f')];var _0xb4c68a;if(_0x2dbe10>=_0x155d54){_0x2dbe10=_0x155d54;_0xb4c68a=0xc8;}else{_0xb4c68a=0xce;}_0x481458['status'](_0xb4c68a);return _0x481458[_0x83a6('0x21')](_0x83a6('0x22'),_0x539bcc+'-'+_0x2dbe10+'/'+_0x155d54)[_0x83a6('0x1c')](_0x43ee44);}return null;};}function patchUpdates(_0x23e749){return function(_0x38fe6f){try{jsonpatch[_0x83a6('0x23')](_0x38fe6f,_0x23e749,!![]);}catch(_0x4606cc){return BPromise[_0x83a6('0x24')](_0x4606cc);}return _0x38fe6f['save']();};}function saveUpdates(_0x3d0a3b,_0xd3190){return function(_0x32d967){if(_0x32d967){return _0x32d967['update'](_0x3d0a3b)['then'](function(_0x10a9c6){return _0x10a9c6;});}return null;};}function removeEntity(_0x2742ab,_0x234cdb){return function(_0x33fe59){if(_0x33fe59){return _0x33fe59[_0x83a6('0x25')]()[_0x83a6('0x26')](function(){_0x2742ab[_0x83a6('0x1b')](0xcc)[_0x83a6('0x1a')]();});}};}function handleEntityNotFound(_0xda5e94,_0x14274c){return function(_0x10e13c){if(!_0x10e13c){_0xda5e94[_0x83a6('0x19')](0x194);}return _0x10e13c;};}function handleError(_0x4d6c59,_0x16c4af){_0x16c4af=_0x16c4af||0x1f4;return function(_0x2a8b1e){logger[_0x83a6('0x27')](_0x2a8b1e[_0x83a6('0x28')]);if(_0x2a8b1e['name']){delete _0x2a8b1e[_0x83a6('0x29')];}_0x4d6c59['status'](_0x16c4af)[_0x83a6('0x2a')](_0x2a8b1e);};}exports[_0x83a6('0x2b')]=function(_0x485684,_0x5b386b){var _0x4fbd2a={},_0x59afe3={},_0x15465d={'count':0x0,'rows':[]};var _0x222565=_[_0x83a6('0x2c')](db[_0x83a6('0x2d')][_0x83a6('0x2e')],function(_0x2797d1){return{'name':_0x2797d1['fieldName'],'type':_0x2797d1['type'][_0x83a6('0x2f')]};});_0x59afe3['model']=_[_0x83a6('0x2c')](_0x222565,_0x83a6('0x29'));_0x59afe3[_0x83a6('0x30')]=_[_0x83a6('0x31')](_0x485684[_0x83a6('0x30')]);_0x59afe3['filters']=_[_0x83a6('0x32')](_0x59afe3[_0x83a6('0x33')],_0x59afe3['query']);_0x4fbd2a[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x59afe3['model'],qs['fields'](_0x485684['query'][_0x83a6('0x35')]));_0x4fbd2a['attributes']=_0x4fbd2a[_0x83a6('0x34')][_0x83a6('0x36')]?_0x4fbd2a[_0x83a6('0x34')]:_0x59afe3[_0x83a6('0x33')];if(!_0x485684['query'][_0x83a6('0x37')](_0x83a6('0x38'))){_0x4fbd2a[_0x83a6('0x1f')]=qs[_0x83a6('0x1f')](_0x485684['query'][_0x83a6('0x1f')]);_0x4fbd2a[_0x83a6('0x1d')]=qs[_0x83a6('0x1d')](_0x485684[_0x83a6('0x30')][_0x83a6('0x1d')]);}_0x4fbd2a[_0x83a6('0x39')]=qs[_0x83a6('0x3a')](_0x485684[_0x83a6('0x30')]['sort']);_0x4fbd2a[_0x83a6('0x3b')]=qs[_0x83a6('0x3c')](_[_0x83a6('0x3d')](_0x485684['query'],_0x59afe3[_0x83a6('0x3c')]),_0x222565);if(_0x485684['query'][_0x83a6('0x3e')]){_0x4fbd2a['where']=_[_0x83a6('0x3f')](_0x4fbd2a[_0x83a6('0x3b')],{'$or':_[_0x83a6('0x2c')](_0x222565,function(_0x18ff7c){if(_0x18ff7c[_0x83a6('0x40')]!=='VIRTUAL'){var _0x44256c={};_0x44256c[_0x18ff7c[_0x83a6('0x29')]]={'$like':'%'+_0x485684['query'][_0x83a6('0x3e')]+'%'};return _0x44256c;}})});}_0x4fbd2a=_[_0x83a6('0x3f')]({},_0x4fbd2a,_0x485684['options']);var _0x590862={'where':_0x4fbd2a[_0x83a6('0x3b')]};return db[_0x83a6('0x2d')]['count'](_0x590862)[_0x83a6('0x26')](function(_0x5256b5){_0x15465d[_0x83a6('0x20')]=_0x5256b5;if(_0x485684['query'][_0x83a6('0x41')]){_0x4fbd2a[_0x83a6('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x83a6('0x43')](_0x4fbd2a);})['then'](function(_0x51dba5){_0x15465d['rows']=_0x51dba5;return _0x15465d;})['then'](respondWithFilteredResult(_0x5b386b,_0x4fbd2a))[_0x83a6('0x44')](handleError(_0x5b386b,null));};exports[_0x83a6('0x45')]=function(_0x4f216e,_0x379fc6){var _0x8d62d4={'raw':![],'where':{'id':_0x4f216e['params']['id']}},_0x2f84a4={};_0x2f84a4[_0x83a6('0x33')]=_[_0x83a6('0x31')](db[_0x83a6('0x2d')]['rawAttributes']);_0x2f84a4['query']=_[_0x83a6('0x31')](_0x4f216e[_0x83a6('0x30')]);_0x2f84a4[_0x83a6('0x3c')]=_['intersection'](_0x2f84a4[_0x83a6('0x33')],_0x2f84a4[_0x83a6('0x30')]);_0x8d62d4[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x2f84a4[_0x83a6('0x33')],qs[_0x83a6('0x35')](_0x4f216e[_0x83a6('0x30')]['fields']));_0x8d62d4[_0x83a6('0x34')]=_0x8d62d4[_0x83a6('0x34')][_0x83a6('0x36')]?_0x8d62d4[_0x83a6('0x34')]:_0x2f84a4[_0x83a6('0x33')];if(_0x4f216e[_0x83a6('0x30')][_0x83a6('0x41')]){_0x8d62d4['include']=[{'all':!![]}];}_0x8d62d4=_['merge']({},_0x8d62d4,_0x4f216e[_0x83a6('0x46')]);return db['FreshdeskConfiguration'][_0x83a6('0x47')](_0x8d62d4)[_0x83a6('0x26')](handleEntityNotFound(_0x379fc6,null))[_0x83a6('0x26')](respondWithResult(_0x379fc6,null))[_0x83a6('0x44')](handleError(_0x379fc6,null));};exports[_0x83a6('0x48')]=function(_0x18f986,_0x504971){return db[_0x83a6('0x2d')][_0x83a6('0x48')](_0x18f986[_0x83a6('0x49')],{})[_0x83a6('0x26')](respondWithResult(_0x504971,0xc9))['catch'](handleError(_0x504971,null));};exports[_0x83a6('0x4a')]=function(_0x1ce0fe,_0x3e28e2){if(_0x1ce0fe[_0x83a6('0x49')]['id']){delete _0x1ce0fe[_0x83a6('0x49')]['id'];}return db[_0x83a6('0x2d')][_0x83a6('0x47')]({'where':{'id':_0x1ce0fe['params']['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0x3e28e2,null))[_0x83a6('0x26')](saveUpdates(_0x1ce0fe['body'],null))[_0x83a6('0x26')](respondWithResult(_0x3e28e2,null))[_0x83a6('0x44')](handleError(_0x3e28e2,null));};exports['destroy']=function(_0x210d41,_0x2558f3){return db['FreshdeskConfiguration'][_0x83a6('0x47')]({'where':{'id':_0x210d41[_0x83a6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2558f3,null))[_0x83a6('0x26')](removeEntity(_0x2558f3,null))[_0x83a6('0x44')](handleError(_0x2558f3,null));};exports[_0x83a6('0x4c')]=function(_0x5076de,_0x3f353b,_0x50a6b9){var _0x48b0cd={};var _0x4e0f4f={};var _0x2076ca;var _0x52e79c;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5076de[_0x83a6('0x4b')]['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0x3f353b,null))[_0x83a6('0x26')](function(_0x53e37d){if(_0x53e37d){_0x2076ca=_0x53e37d;_0x4e0f4f[_0x83a6('0x33')]=_[_0x83a6('0x31')](db[_0x83a6('0x4d')][_0x83a6('0x2e')]);_0x4e0f4f[_0x83a6('0x30')]=_[_0x83a6('0x31')](_0x5076de[_0x83a6('0x30')]);_0x4e0f4f[_0x83a6('0x3c')]=_['intersection'](_0x4e0f4f['model'],_0x4e0f4f[_0x83a6('0x30')]);_0x48b0cd[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x4e0f4f[_0x83a6('0x33')],qs[_0x83a6('0x35')](_0x5076de[_0x83a6('0x30')][_0x83a6('0x35')]));_0x48b0cd[_0x83a6('0x34')]=_0x48b0cd[_0x83a6('0x34')][_0x83a6('0x36')]?_0x48b0cd[_0x83a6('0x34')]:_0x4e0f4f[_0x83a6('0x33')];_0x48b0cd[_0x83a6('0x39')]=qs[_0x83a6('0x3a')](_0x5076de['query'][_0x83a6('0x3a')]);_0x48b0cd[_0x83a6('0x3b')]=qs['filters'](_['pick'](_0x5076de[_0x83a6('0x30')],_0x4e0f4f[_0x83a6('0x3c')]));if(_0x5076de[_0x83a6('0x30')][_0x83a6('0x3e')]){_0x48b0cd[_0x83a6('0x3b')]=_['merge'](_0x48b0cd[_0x83a6('0x3b')],{'$or':_[_0x83a6('0x2c')](_0x48b0cd[_0x83a6('0x34')],function(_0x36ab35){var _0x1d3942={};_0x1d3942[_0x36ab35]={'$like':'%'+_0x5076de[_0x83a6('0x30')][_0x83a6('0x3e')]+'%'};return _0x1d3942;})});}_0x48b0cd=_['merge']({},_0x48b0cd,_0x5076de[_0x83a6('0x46')]);return _0x2076ca[_0x83a6('0x4c')](_0x48b0cd);}})[_0x83a6('0x26')](function(_0x5accc6){if(_0x5accc6){_0x52e79c=_0x5accc6['length'];if(!_0x5076de[_0x83a6('0x30')][_0x83a6('0x37')](_0x83a6('0x38'))){_0x48b0cd[_0x83a6('0x1f')]=qs[_0x83a6('0x1f')](_0x5076de[_0x83a6('0x30')][_0x83a6('0x1f')]);_0x48b0cd['offset']=qs[_0x83a6('0x1d')](_0x5076de['query'][_0x83a6('0x1d')]);}return _0x2076ca[_0x83a6('0x4c')](_0x48b0cd);}})[_0x83a6('0x26')](function(_0x1b0979){if(_0x1b0979){return _0x1b0979?{'count':_0x52e79c,'rows':_0x1b0979}:null;}})[_0x83a6('0x26')](respondWithResult(_0x3f353b,null))[_0x83a6('0x44')](handleError(_0x3f353b,null));};exports['getSubjects']=function(_0x396aba,_0x5a3f74,_0x4297a3){var _0x44d500={};var _0x3e3705={};var _0xb552bf;var _0x4747c1;return db[_0x83a6('0x2d')]['findOne']({'where':{'id':_0x396aba['params']['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0x5a3f74,null))['then'](function(_0x50a65b){if(_0x50a65b){_0xb552bf=_0x50a65b;_0x3e3705[_0x83a6('0x33')]=_[_0x83a6('0x31')](db[_0x83a6('0x4d')][_0x83a6('0x2e')]);_0x3e3705[_0x83a6('0x30')]=_[_0x83a6('0x31')](_0x396aba[_0x83a6('0x30')]);_0x3e3705[_0x83a6('0x3c')]=_[_0x83a6('0x32')](_0x3e3705[_0x83a6('0x33')],_0x3e3705[_0x83a6('0x30')]);_0x44d500[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x3e3705[_0x83a6('0x33')],qs[_0x83a6('0x35')](_0x396aba['query'][_0x83a6('0x35')]));_0x44d500['attributes']=_0x44d500['attributes']['length']?_0x44d500['attributes']:_0x3e3705['model'];_0x44d500['order']=qs[_0x83a6('0x3a')](_0x396aba[_0x83a6('0x30')][_0x83a6('0x3a')]);_0x44d500[_0x83a6('0x3b')]=qs[_0x83a6('0x3c')](_[_0x83a6('0x3d')](_0x396aba[_0x83a6('0x30')],_0x3e3705[_0x83a6('0x3c')]));if(_0x396aba[_0x83a6('0x30')][_0x83a6('0x3e')]){_0x44d500['where']=_[_0x83a6('0x3f')](_0x44d500[_0x83a6('0x3b')],{'$or':_[_0x83a6('0x2c')](_0x44d500[_0x83a6('0x34')],function(_0x1e47b1){var _0x3f217f={};_0x3f217f[_0x1e47b1]={'$like':'%'+_0x396aba[_0x83a6('0x30')][_0x83a6('0x3e')]+'%'};return _0x3f217f;})});}_0x44d500=_[_0x83a6('0x3f')]({},_0x44d500,_0x396aba[_0x83a6('0x46')]);return _0xb552bf[_0x83a6('0x4e')](_0x44d500);}})[_0x83a6('0x26')](function(_0x390663){if(_0x390663){_0x4747c1=_0x390663[_0x83a6('0x36')];if(!_0x396aba[_0x83a6('0x30')][_0x83a6('0x37')](_0x83a6('0x38'))){_0x44d500[_0x83a6('0x1f')]=qs[_0x83a6('0x1f')](_0x396aba[_0x83a6('0x30')][_0x83a6('0x1f')]);_0x44d500[_0x83a6('0x1d')]=qs[_0x83a6('0x1d')](_0x396aba[_0x83a6('0x30')]['offset']);}return _0xb552bf['getSubjects'](_0x44d500);}})[_0x83a6('0x26')](function(_0x508f84){if(_0x508f84){return _0x508f84?{'count':_0x4747c1,'rows':_0x508f84}:null;}})[_0x83a6('0x26')](respondWithResult(_0x5a3f74,null))[_0x83a6('0x44')](handleError(_0x5a3f74,null));};exports[_0x83a6('0x4f')]=function(_0x417f0e,_0x176f84,_0x2f734b){var _0x558348={};var _0x5ca27d={};var _0x1a1a61;var _0x47636c;return db[_0x83a6('0x2d')]['findOne']({'where':{'id':_0x417f0e[_0x83a6('0x4b')]['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0x176f84,null))['then'](function(_0x21ce17){if(_0x21ce17){_0x1a1a61=_0x21ce17;_0x5ca27d['model']=_['keys'](db[_0x83a6('0x4d')]['rawAttributes']);_0x5ca27d[_0x83a6('0x30')]=_[_0x83a6('0x31')](_0x417f0e[_0x83a6('0x30')]);_0x5ca27d[_0x83a6('0x3c')]=_[_0x83a6('0x32')](_0x5ca27d[_0x83a6('0x33')],_0x5ca27d[_0x83a6('0x30')]);_0x558348[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x5ca27d[_0x83a6('0x33')],qs[_0x83a6('0x35')](_0x417f0e['query']['fields']));_0x558348[_0x83a6('0x34')]=_0x558348[_0x83a6('0x34')][_0x83a6('0x36')]?_0x558348[_0x83a6('0x34')]:_0x5ca27d[_0x83a6('0x33')];_0x558348[_0x83a6('0x39')]=qs['sort'](_0x417f0e[_0x83a6('0x30')][_0x83a6('0x3a')]);_0x558348['where']=qs[_0x83a6('0x3c')](_[_0x83a6('0x3d')](_0x417f0e[_0x83a6('0x30')],_0x5ca27d[_0x83a6('0x3c')]));if(_0x417f0e[_0x83a6('0x30')][_0x83a6('0x3e')]){_0x558348[_0x83a6('0x3b')]=_[_0x83a6('0x3f')](_0x558348[_0x83a6('0x3b')],{'$or':_[_0x83a6('0x2c')](_0x558348[_0x83a6('0x34')],function(_0x3f33cb){var _0x5a28ff={};_0x5a28ff[_0x3f33cb]={'$like':'%'+_0x417f0e['query'][_0x83a6('0x3e')]+'%'};return _0x5a28ff;})});}_0x558348=_['merge']({},_0x558348,_0x417f0e[_0x83a6('0x46')]);return _0x1a1a61[_0x83a6('0x4f')](_0x558348);}})['then'](function(_0x211585){if(_0x211585){_0x47636c=_0x211585[_0x83a6('0x36')];if(!_0x417f0e['query']['hasOwnProperty'](_0x83a6('0x38'))){_0x558348[_0x83a6('0x1f')]=qs[_0x83a6('0x1f')](_0x417f0e['query'][_0x83a6('0x1f')]);_0x558348[_0x83a6('0x1d')]=qs['offset'](_0x417f0e[_0x83a6('0x30')][_0x83a6('0x1d')]);}return _0x1a1a61[_0x83a6('0x4f')](_0x558348);}})[_0x83a6('0x26')](function(_0x47c649){if(_0x47c649){return _0x47c649?{'count':_0x47636c,'rows':_0x47c649}:null;}})[_0x83a6('0x26')](respondWithResult(_0x176f84,null))[_0x83a6('0x44')](handleError(_0x176f84,null));};exports[_0x83a6('0x50')]=function(_0x10edd3,_0xa862b5,_0xf55b41){var _0x1c1bd8={};var _0x11076b={};var _0x151762;var _0x33d34f;return db['FreshdeskConfiguration'][_0x83a6('0x51')]({'where':{'id':_0x10edd3[_0x83a6('0x4b')]['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0xa862b5,null))['then'](function(_0x46ec0b){if(_0x46ec0b){_0x151762=_0x46ec0b;_0x11076b['model']=_['keys'](db['Tag'][_0x83a6('0x2e')]);_0x11076b[_0x83a6('0x30')]=_[_0x83a6('0x31')](_0x10edd3[_0x83a6('0x30')]);_0x11076b[_0x83a6('0x3c')]=_[_0x83a6('0x32')](_0x11076b[_0x83a6('0x33')],_0x11076b[_0x83a6('0x30')]);_0x1c1bd8[_0x83a6('0x34')]=_[_0x83a6('0x32')](_0x11076b[_0x83a6('0x33')],qs[_0x83a6('0x35')](_0x10edd3[_0x83a6('0x30')]['fields']));_0x1c1bd8[_0x83a6('0x34')]=_0x1c1bd8[_0x83a6('0x34')][_0x83a6('0x36')]?_0x1c1bd8[_0x83a6('0x34')]:_0x11076b[_0x83a6('0x33')];_0x1c1bd8[_0x83a6('0x39')]=qs[_0x83a6('0x3a')](_0x10edd3[_0x83a6('0x30')][_0x83a6('0x3a')]);_0x1c1bd8[_0x83a6('0x3b')]=qs[_0x83a6('0x3c')](_[_0x83a6('0x3d')](_0x10edd3[_0x83a6('0x30')],_0x11076b[_0x83a6('0x3c')]));if(_0x10edd3[_0x83a6('0x30')][_0x83a6('0x3e')]){_0x1c1bd8[_0x83a6('0x3b')]=_[_0x83a6('0x3f')](_0x1c1bd8[_0x83a6('0x3b')],{'$or':_[_0x83a6('0x2c')](_0x1c1bd8[_0x83a6('0x34')],function(_0x5e8080){var _0x5b2dff={};_0x5b2dff[_0x5e8080]={'$like':'%'+_0x10edd3[_0x83a6('0x30')][_0x83a6('0x3e')]+'%'};return _0x5b2dff;})});}_0x1c1bd8=_['merge']({},_0x1c1bd8,_0x10edd3['options']);return _0x151762[_0x83a6('0x50')](_0x1c1bd8);}})['then'](function(_0x448739){if(_0x448739){_0x33d34f=_0x448739['length'];if(!_0x10edd3[_0x83a6('0x30')][_0x83a6('0x37')]('nolimit')){_0x1c1bd8[_0x83a6('0x1f')]=qs[_0x83a6('0x1f')](_0x10edd3[_0x83a6('0x30')][_0x83a6('0x1f')]);_0x1c1bd8['offset']=qs[_0x83a6('0x1d')](_0x10edd3[_0x83a6('0x30')][_0x83a6('0x1d')]);}return _0x151762[_0x83a6('0x50')](_0x1c1bd8);}})[_0x83a6('0x26')](function(_0x25fa47){if(_0x25fa47){return _0x25fa47?{'count':_0x33d34f,'rows':_0x25fa47}:null;}})['then'](respondWithResult(_0xa862b5,null))['catch'](handleError(_0xa862b5,null));};exports['setTags']=function(_0x2d5162,_0x1320f4,_0x148cd0){if(_0x2d5162['body']['id']){delete _0x2d5162[_0x83a6('0x49')]['id'];}return db[_0x83a6('0x2d')][_0x83a6('0x51')]({'where':{'id':_0x2d5162[_0x83a6('0x4b')]['id']}})[_0x83a6('0x26')](handleEntityNotFound(_0x1320f4,null))[_0x83a6('0x26')](function(_0x33418b){if(_0x33418b){return _0x33418b[_0x83a6('0x52')](_0x2d5162[_0x83a6('0x49')][_0x83a6('0x53')]||[]);}return null;})['then'](respondWithResult(_0x1320f4,null))[_0x83a6('0x44')](handleError(_0x1320f4,null));};
\ No newline at end of file
+var _0x7467=['getFields','findOne','nolimit','getSubjects','FreshdeskField','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','moment','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','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','FreshdeskConfiguration','includeAll','include','rows','catch','params','options','find','create','body'];(function(_0x4ad37c,_0x2e7490){var _0x288919=function(_0x3988a2){while(--_0x3988a2){_0x4ad37c['push'](_0x4ad37c['shift']());}};_0x288919(++_0x2e7490);}(_0x7467,0x1ae));var _0x7746=function(_0x4e2897,_0x33a468){_0x4e2897=_0x4e2897-0x0;var _0x3a21c8=_0x7467[_0x4e2897];return _0x3a21c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7746('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7746('0x1'));var rp=require('request-promise');var moment=require(_0x7746('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7746('0x3'));var util=require(_0x7746('0x4'));var path=require(_0x7746('0x5'));var sox=require(_0x7746('0x6'));var csv=require('to-csv');var ejs=require(_0x7746('0x7'));var fs=require('fs');var fs_extra=require(_0x7746('0x8'));var _=require(_0x7746('0x9'));var squel=require(_0x7746('0xa'));var crypto=require(_0x7746('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7746('0xc'));var toCsv=require(_0x7746('0xd'));var querystring=require(_0x7746('0xe'));var Papa=require(_0x7746('0xf'));var Redis=require(_0x7746('0x10'));var authService=require(_0x7746('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7746('0x12'));var hardwareService=require(_0x7746('0x13'));var logger=require(_0x7746('0x14'))(_0x7746('0x15'));var utils=require(_0x7746('0x16'));var config=require(_0x7746('0x17'));var licenseUtil=require(_0x7746('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x383d82,_0x546c09){_0x546c09=_0x546c09||0xcc;return function(_0x12922f){if(_0x12922f){return _0x383d82[_0x7746('0x19')](_0x546c09);}return _0x383d82['status'](_0x546c09)[_0x7746('0x1a')]();};}function respondWithResult(_0x50a2d4,_0x468f03){_0x468f03=_0x468f03||0xc8;return function(_0x3f3465){if(_0x3f3465){return _0x50a2d4['status'](_0x468f03)[_0x7746('0x1b')](_0x3f3465);}};}function respondWithFilteredResult(_0x56f173,_0x49fd0a){return function(_0x39720d){if(_0x39720d){var _0x417151=typeof _0x49fd0a[_0x7746('0x1c')]===_0x7746('0x1d')&&typeof _0x49fd0a[_0x7746('0x1e')]==='undefined';var _0x519230=_0x39720d['count'];var _0x179e25=_0x417151?0x0:_0x49fd0a[_0x7746('0x1c')];var _0x3d9d57=_0x417151?_0x39720d[_0x7746('0x1f')]:_0x49fd0a[_0x7746('0x1c')]+_0x49fd0a[_0x7746('0x1e')];var _0x506f40;if(_0x3d9d57>=_0x519230){_0x3d9d57=_0x519230;_0x506f40=0xc8;}else{_0x506f40=0xce;}_0x56f173[_0x7746('0x20')](_0x506f40);return _0x56f173['set']('Content-Range',_0x179e25+'-'+_0x3d9d57+'/'+_0x519230)[_0x7746('0x1b')](_0x39720d);}return null;};}function patchUpdates(_0x17722c){return function(_0x234a11){try{jsonpatch[_0x7746('0x21')](_0x234a11,_0x17722c,!![]);}catch(_0xb28579){return BPromise[_0x7746('0x22')](_0xb28579);}return _0x234a11[_0x7746('0x23')]();};}function saveUpdates(_0x6a20d3,_0x3231eb){return function(_0x4c207d){if(_0x4c207d){return _0x4c207d[_0x7746('0x24')](_0x6a20d3)[_0x7746('0x25')](function(_0x132238){return _0x132238;});}return null;};}function removeEntity(_0x31c2e6,_0x1a0cc5){return function(_0x3ab518){if(_0x3ab518){return _0x3ab518[_0x7746('0x26')]()[_0x7746('0x25')](function(){_0x31c2e6[_0x7746('0x20')](0xcc)[_0x7746('0x1a')]();});}};}function handleEntityNotFound(_0x58b7d9,_0x14965d){return function(_0x2cb5d2){if(!_0x2cb5d2){_0x58b7d9[_0x7746('0x19')](0x194);}return _0x2cb5d2;};}function handleError(_0x277eae,_0x4dcd2d){_0x4dcd2d=_0x4dcd2d||0x1f4;return function(_0x55fc67){logger[_0x7746('0x27')](_0x55fc67[_0x7746('0x28')]);if(_0x55fc67[_0x7746('0x29')]){delete _0x55fc67[_0x7746('0x29')];}_0x277eae[_0x7746('0x20')](_0x4dcd2d)[_0x7746('0x2a')](_0x55fc67);};}exports[_0x7746('0x2b')]=function(_0x3a4627,_0x144669){var _0x4bf5ff={},_0x5b02a7={},_0x5c3c5e={'count':0x0,'rows':[]};var _0x2b2a20=_[_0x7746('0x2c')](db['FreshdeskConfiguration'][_0x7746('0x2d')],function(_0x1cf2a5){return{'name':_0x1cf2a5['fieldName'],'type':_0x1cf2a5['type'][_0x7746('0x2e')]};});_0x5b02a7[_0x7746('0x2f')]=_[_0x7746('0x2c')](_0x2b2a20,_0x7746('0x29'));_0x5b02a7[_0x7746('0x30')]=_[_0x7746('0x31')](_0x3a4627[_0x7746('0x30')]);_0x5b02a7[_0x7746('0x32')]=_[_0x7746('0x33')](_0x5b02a7['model'],_0x5b02a7[_0x7746('0x30')]);_0x4bf5ff[_0x7746('0x34')]=_[_0x7746('0x33')](_0x5b02a7[_0x7746('0x2f')],qs[_0x7746('0x35')](_0x3a4627['query']['fields']));_0x4bf5ff[_0x7746('0x34')]=_0x4bf5ff['attributes'][_0x7746('0x36')]?_0x4bf5ff[_0x7746('0x34')]:_0x5b02a7[_0x7746('0x2f')];if(!_0x3a4627['query'][_0x7746('0x37')]('nolimit')){_0x4bf5ff[_0x7746('0x1e')]=qs[_0x7746('0x1e')](_0x3a4627[_0x7746('0x30')][_0x7746('0x1e')]);_0x4bf5ff[_0x7746('0x1c')]=qs[_0x7746('0x1c')](_0x3a4627[_0x7746('0x30')][_0x7746('0x1c')]);}_0x4bf5ff[_0x7746('0x38')]=qs[_0x7746('0x39')](_0x3a4627['query'][_0x7746('0x39')]);_0x4bf5ff[_0x7746('0x3a')]=qs[_0x7746('0x32')](_[_0x7746('0x3b')](_0x3a4627[_0x7746('0x30')],_0x5b02a7[_0x7746('0x32')]),_0x2b2a20);if(_0x3a4627[_0x7746('0x30')][_0x7746('0x3c')]){_0x4bf5ff[_0x7746('0x3a')]=_[_0x7746('0x3d')](_0x4bf5ff[_0x7746('0x3a')],{'$or':_['map'](_0x2b2a20,function(_0x39cc56){if(_0x39cc56[_0x7746('0x3e')]!==_0x7746('0x3f')){var _0x55c400={};_0x55c400[_0x39cc56[_0x7746('0x29')]]={'$like':'%'+_0x3a4627[_0x7746('0x30')][_0x7746('0x3c')]+'%'};return _0x55c400;}})});}_0x4bf5ff=_[_0x7746('0x3d')]({},_0x4bf5ff,_0x3a4627['options']);var _0x1d521e={'where':_0x4bf5ff[_0x7746('0x3a')]};return db[_0x7746('0x40')][_0x7746('0x1f')](_0x1d521e)[_0x7746('0x25')](function(_0x11b7a0){_0x5c3c5e[_0x7746('0x1f')]=_0x11b7a0;if(_0x3a4627[_0x7746('0x30')][_0x7746('0x41')]){_0x4bf5ff[_0x7746('0x42')]=[{'all':!![]}];}return db[_0x7746('0x40')]['findAll'](_0x4bf5ff);})[_0x7746('0x25')](function(_0x48d31d){_0x5c3c5e[_0x7746('0x43')]=_0x48d31d;return _0x5c3c5e;})['then'](respondWithFilteredResult(_0x144669,_0x4bf5ff))[_0x7746('0x44')](handleError(_0x144669,null));};exports['show']=function(_0x5694ca,_0x2899e4){var _0x9ddcd1={'raw':![],'where':{'id':_0x5694ca[_0x7746('0x45')]['id']}},_0x150722={};_0x150722[_0x7746('0x2f')]=_[_0x7746('0x31')](db[_0x7746('0x40')]['rawAttributes']);_0x150722['query']=_[_0x7746('0x31')](_0x5694ca[_0x7746('0x30')]);_0x150722[_0x7746('0x32')]=_[_0x7746('0x33')](_0x150722[_0x7746('0x2f')],_0x150722[_0x7746('0x30')]);_0x9ddcd1['attributes']=_['intersection'](_0x150722['model'],qs['fields'](_0x5694ca['query']['fields']));_0x9ddcd1[_0x7746('0x34')]=_0x9ddcd1[_0x7746('0x34')][_0x7746('0x36')]?_0x9ddcd1[_0x7746('0x34')]:_0x150722[_0x7746('0x2f')];if(_0x5694ca[_0x7746('0x30')]['includeAll']){_0x9ddcd1[_0x7746('0x42')]=[{'all':!![]}];}_0x9ddcd1=_['merge']({},_0x9ddcd1,_0x5694ca[_0x7746('0x46')]);return db[_0x7746('0x40')][_0x7746('0x47')](_0x9ddcd1)[_0x7746('0x25')](handleEntityNotFound(_0x2899e4,null))['then'](respondWithResult(_0x2899e4,null))[_0x7746('0x44')](handleError(_0x2899e4,null));};exports[_0x7746('0x48')]=function(_0x347bf5,_0x47e421){return db['FreshdeskConfiguration'][_0x7746('0x48')](_0x347bf5['body'],{})['then'](respondWithResult(_0x47e421,0xc9))[_0x7746('0x44')](handleError(_0x47e421,null));};exports[_0x7746('0x24')]=function(_0x188c0b,_0x17bf86){if(_0x188c0b[_0x7746('0x49')]['id']){delete _0x188c0b[_0x7746('0x49')]['id'];}return db[_0x7746('0x40')][_0x7746('0x47')]({'where':{'id':_0x188c0b[_0x7746('0x45')]['id']}})[_0x7746('0x25')](handleEntityNotFound(_0x17bf86,null))[_0x7746('0x25')](saveUpdates(_0x188c0b[_0x7746('0x49')],null))[_0x7746('0x25')](respondWithResult(_0x17bf86,null))[_0x7746('0x44')](handleError(_0x17bf86,null));};exports[_0x7746('0x26')]=function(_0x3f04d9,_0x3eb0d6){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3f04d9[_0x7746('0x45')]['id']}})['then'](handleEntityNotFound(_0x3eb0d6,null))['then'](removeEntity(_0x3eb0d6,null))['catch'](handleError(_0x3eb0d6,null));};exports[_0x7746('0x4a')]=function(_0x15706b,_0x1e6131,_0x231f8e){var _0x2ed7b2={};var _0x44be3d={};var _0x927596;var _0x2f09b6;return db[_0x7746('0x40')][_0x7746('0x4b')]({'where':{'id':_0x15706b[_0x7746('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e6131,null))['then'](function(_0xc5fdf0){if(_0xc5fdf0){_0x927596=_0xc5fdf0;_0x44be3d[_0x7746('0x2f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x44be3d['query']=_[_0x7746('0x31')](_0x15706b[_0x7746('0x30')]);_0x44be3d[_0x7746('0x32')]=_[_0x7746('0x33')](_0x44be3d[_0x7746('0x2f')],_0x44be3d[_0x7746('0x30')]);_0x2ed7b2[_0x7746('0x34')]=_['intersection'](_0x44be3d[_0x7746('0x2f')],qs[_0x7746('0x35')](_0x15706b['query'][_0x7746('0x35')]));_0x2ed7b2['attributes']=_0x2ed7b2[_0x7746('0x34')]['length']?_0x2ed7b2[_0x7746('0x34')]:_0x44be3d['model'];_0x2ed7b2[_0x7746('0x38')]=qs[_0x7746('0x39')](_0x15706b[_0x7746('0x30')][_0x7746('0x39')]);_0x2ed7b2[_0x7746('0x3a')]=qs['filters'](_[_0x7746('0x3b')](_0x15706b[_0x7746('0x30')],_0x44be3d['filters']));if(_0x15706b[_0x7746('0x30')][_0x7746('0x3c')]){_0x2ed7b2[_0x7746('0x3a')]=_['merge'](_0x2ed7b2['where'],{'$or':_[_0x7746('0x2c')](_0x2ed7b2[_0x7746('0x34')],function(_0xd03226){var _0x34d604={};_0x34d604[_0xd03226]={'$like':'%'+_0x15706b[_0x7746('0x30')][_0x7746('0x3c')]+'%'};return _0x34d604;})});}_0x2ed7b2=_[_0x7746('0x3d')]({},_0x2ed7b2,_0x15706b[_0x7746('0x46')]);return _0x927596[_0x7746('0x4a')](_0x2ed7b2);}})[_0x7746('0x25')](function(_0x14b36d){if(_0x14b36d){_0x2f09b6=_0x14b36d[_0x7746('0x36')];if(!_0x15706b[_0x7746('0x30')][_0x7746('0x37')](_0x7746('0x4c'))){_0x2ed7b2['limit']=qs[_0x7746('0x1e')](_0x15706b[_0x7746('0x30')][_0x7746('0x1e')]);_0x2ed7b2[_0x7746('0x1c')]=qs[_0x7746('0x1c')](_0x15706b[_0x7746('0x30')][_0x7746('0x1c')]);}return _0x927596[_0x7746('0x4a')](_0x2ed7b2);}})[_0x7746('0x25')](function(_0x3ecbb7){if(_0x3ecbb7){return _0x3ecbb7?{'count':_0x2f09b6,'rows':_0x3ecbb7}:null;}})[_0x7746('0x25')](respondWithResult(_0x1e6131,null))[_0x7746('0x44')](handleError(_0x1e6131,null));};exports[_0x7746('0x4d')]=function(_0x273149,_0x34d96d,_0x1555a2){var _0x4dab1a={};var _0x1a607a={};var _0x1c8255;var _0x1bd380;return db[_0x7746('0x40')][_0x7746('0x4b')]({'where':{'id':_0x273149[_0x7746('0x45')]['id']}})['then'](handleEntityNotFound(_0x34d96d,null))[_0x7746('0x25')](function(_0xa83ff7){if(_0xa83ff7){_0x1c8255=_0xa83ff7;_0x1a607a[_0x7746('0x2f')]=_['keys'](db[_0x7746('0x4e')][_0x7746('0x2d')]);_0x1a607a[_0x7746('0x30')]=_[_0x7746('0x31')](_0x273149[_0x7746('0x30')]);_0x1a607a[_0x7746('0x32')]=_[_0x7746('0x33')](_0x1a607a[_0x7746('0x2f')],_0x1a607a[_0x7746('0x30')]);_0x4dab1a[_0x7746('0x34')]=_[_0x7746('0x33')](_0x1a607a['model'],qs['fields'](_0x273149['query'][_0x7746('0x35')]));_0x4dab1a[_0x7746('0x34')]=_0x4dab1a['attributes'][_0x7746('0x36')]?_0x4dab1a['attributes']:_0x1a607a[_0x7746('0x2f')];_0x4dab1a['order']=qs[_0x7746('0x39')](_0x273149[_0x7746('0x30')][_0x7746('0x39')]);_0x4dab1a[_0x7746('0x3a')]=qs[_0x7746('0x32')](_['pick'](_0x273149[_0x7746('0x30')],_0x1a607a[_0x7746('0x32')]));if(_0x273149[_0x7746('0x30')][_0x7746('0x3c')]){_0x4dab1a[_0x7746('0x3a')]=_['merge'](_0x4dab1a['where'],{'$or':_['map'](_0x4dab1a[_0x7746('0x34')],function(_0x53c55b){var _0x36d2ad={};_0x36d2ad[_0x53c55b]={'$like':'%'+_0x273149[_0x7746('0x30')][_0x7746('0x3c')]+'%'};return _0x36d2ad;})});}_0x4dab1a=_[_0x7746('0x3d')]({},_0x4dab1a,_0x273149[_0x7746('0x46')]);return _0x1c8255[_0x7746('0x4d')](_0x4dab1a);}})['then'](function(_0x12513d){if(_0x12513d){_0x1bd380=_0x12513d[_0x7746('0x36')];if(!_0x273149['query'][_0x7746('0x37')](_0x7746('0x4c'))){_0x4dab1a[_0x7746('0x1e')]=qs[_0x7746('0x1e')](_0x273149[_0x7746('0x30')][_0x7746('0x1e')]);_0x4dab1a[_0x7746('0x1c')]=qs[_0x7746('0x1c')](_0x273149[_0x7746('0x30')][_0x7746('0x1c')]);}return _0x1c8255[_0x7746('0x4d')](_0x4dab1a);}})[_0x7746('0x25')](function(_0x965777){if(_0x965777){return _0x965777?{'count':_0x1bd380,'rows':_0x965777}:null;}})['then'](respondWithResult(_0x34d96d,null))[_0x7746('0x44')](handleError(_0x34d96d,null));};exports[_0x7746('0x4f')]=function(_0xedf3f2,_0x3b6a88,_0x6d5571){var _0x157035={};var _0x179bba={};var _0x4292b9;var _0x1837d2;return db['FreshdeskConfiguration'][_0x7746('0x4b')]({'where':{'id':_0xedf3f2[_0x7746('0x45')]['id']}})[_0x7746('0x25')](handleEntityNotFound(_0x3b6a88,null))[_0x7746('0x25')](function(_0x13c3b8){if(_0x13c3b8){_0x4292b9=_0x13c3b8;_0x179bba[_0x7746('0x2f')]=_[_0x7746('0x31')](db[_0x7746('0x4e')][_0x7746('0x2d')]);_0x179bba['query']=_[_0x7746('0x31')](_0xedf3f2['query']);_0x179bba[_0x7746('0x32')]=_[_0x7746('0x33')](_0x179bba[_0x7746('0x2f')],_0x179bba[_0x7746('0x30')]);_0x157035[_0x7746('0x34')]=_['intersection'](_0x179bba['model'],qs[_0x7746('0x35')](_0xedf3f2[_0x7746('0x30')][_0x7746('0x35')]));_0x157035[_0x7746('0x34')]=_0x157035[_0x7746('0x34')][_0x7746('0x36')]?_0x157035[_0x7746('0x34')]:_0x179bba[_0x7746('0x2f')];_0x157035[_0x7746('0x38')]=qs[_0x7746('0x39')](_0xedf3f2[_0x7746('0x30')][_0x7746('0x39')]);_0x157035['where']=qs[_0x7746('0x32')](_[_0x7746('0x3b')](_0xedf3f2['query'],_0x179bba['filters']));if(_0xedf3f2[_0x7746('0x30')][_0x7746('0x3c')]){_0x157035['where']=_[_0x7746('0x3d')](_0x157035['where'],{'$or':_[_0x7746('0x2c')](_0x157035[_0x7746('0x34')],function(_0x51db76){var _0x4fa31c={};_0x4fa31c[_0x51db76]={'$like':'%'+_0xedf3f2[_0x7746('0x30')][_0x7746('0x3c')]+'%'};return _0x4fa31c;})});}_0x157035=_[_0x7746('0x3d')]({},_0x157035,_0xedf3f2[_0x7746('0x46')]);return _0x4292b9[_0x7746('0x4f')](_0x157035);}})[_0x7746('0x25')](function(_0x42ccc9){if(_0x42ccc9){_0x1837d2=_0x42ccc9[_0x7746('0x36')];if(!_0xedf3f2[_0x7746('0x30')][_0x7746('0x37')]('nolimit')){_0x157035[_0x7746('0x1e')]=qs[_0x7746('0x1e')](_0xedf3f2[_0x7746('0x30')][_0x7746('0x1e')]);_0x157035[_0x7746('0x1c')]=qs[_0x7746('0x1c')](_0xedf3f2[_0x7746('0x30')]['offset']);}return _0x4292b9['getDescriptions'](_0x157035);}})[_0x7746('0x25')](function(_0x1f3b3d){if(_0x1f3b3d){return _0x1f3b3d?{'count':_0x1837d2,'rows':_0x1f3b3d}:null;}})['then'](respondWithResult(_0x3b6a88,null))[_0x7746('0x44')](handleError(_0x3b6a88,null));};exports['getTags']=function(_0x5815fe,_0x1ae87d,_0x3079b8){var _0x3c6245={};var _0x5030b4={};var _0x260c9;var _0x4e66a7;return db[_0x7746('0x40')][_0x7746('0x4b')]({'where':{'id':_0x5815fe['params']['id']}})['then'](handleEntityNotFound(_0x1ae87d,null))[_0x7746('0x25')](function(_0x22dfb0){if(_0x22dfb0){_0x260c9=_0x22dfb0;_0x5030b4['model']=_[_0x7746('0x31')](db[_0x7746('0x50')][_0x7746('0x2d')]);_0x5030b4[_0x7746('0x30')]=_[_0x7746('0x31')](_0x5815fe[_0x7746('0x30')]);_0x5030b4[_0x7746('0x32')]=_['intersection'](_0x5030b4[_0x7746('0x2f')],_0x5030b4[_0x7746('0x30')]);_0x3c6245[_0x7746('0x34')]=_[_0x7746('0x33')](_0x5030b4[_0x7746('0x2f')],qs[_0x7746('0x35')](_0x5815fe['query'][_0x7746('0x35')]));_0x3c6245[_0x7746('0x34')]=_0x3c6245[_0x7746('0x34')][_0x7746('0x36')]?_0x3c6245['attributes']:_0x5030b4[_0x7746('0x2f')];_0x3c6245[_0x7746('0x38')]=qs[_0x7746('0x39')](_0x5815fe[_0x7746('0x30')][_0x7746('0x39')]);_0x3c6245[_0x7746('0x3a')]=qs[_0x7746('0x32')](_[_0x7746('0x3b')](_0x5815fe[_0x7746('0x30')],_0x5030b4['filters']));if(_0x5815fe[_0x7746('0x30')][_0x7746('0x3c')]){_0x3c6245[_0x7746('0x3a')]=_['merge'](_0x3c6245[_0x7746('0x3a')],{'$or':_[_0x7746('0x2c')](_0x3c6245[_0x7746('0x34')],function(_0x590c2a){var _0x531c8b={};_0x531c8b[_0x590c2a]={'$like':'%'+_0x5815fe[_0x7746('0x30')]['filter']+'%'};return _0x531c8b;})});}_0x3c6245=_[_0x7746('0x3d')]({},_0x3c6245,_0x5815fe[_0x7746('0x46')]);return _0x260c9[_0x7746('0x51')](_0x3c6245);}})[_0x7746('0x25')](function(_0x62b1ae){if(_0x62b1ae){_0x4e66a7=_0x62b1ae[_0x7746('0x36')];if(!_0x5815fe[_0x7746('0x30')][_0x7746('0x37')](_0x7746('0x4c'))){_0x3c6245[_0x7746('0x1e')]=qs[_0x7746('0x1e')](_0x5815fe[_0x7746('0x30')]['limit']);_0x3c6245['offset']=qs[_0x7746('0x1c')](_0x5815fe['query'][_0x7746('0x1c')]);}return _0x260c9[_0x7746('0x51')](_0x3c6245);}})[_0x7746('0x25')](function(_0x3d22d2){if(_0x3d22d2){return _0x3d22d2?{'count':_0x4e66a7,'rows':_0x3d22d2}:null;}})[_0x7746('0x25')](respondWithResult(_0x1ae87d,null))[_0x7746('0x44')](handleError(_0x1ae87d,null));};exports[_0x7746('0x52')]=function(_0x164c79,_0x4c704a,_0x2bcf28){if(_0x164c79[_0x7746('0x49')]['id']){delete _0x164c79['body']['id'];}return db[_0x7746('0x40')][_0x7746('0x4b')]({'where':{'id':_0x164c79[_0x7746('0x45')]['id']}})[_0x7746('0x25')](handleEntityNotFound(_0x4c704a,null))[_0x7746('0x25')](function(_0x52ff20){if(_0x52ff20){return _0x52ff20[_0x7746('0x52')](_0x164c79[_0x7746('0x49')][_0x7746('0x53')]||[]);}return null;})[_0x7746('0x25')](respondWithResult(_0x4c704a,null))['catch'](handleError(_0x4c704a,null));};
\ No newline at end of file
index 6dfced2..a696416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa42c=['moment','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x1728f7,_0x1e39ea){var _0x46d33c=function(_0x3bcc11){while(--_0x3bcc11){_0x1728f7['push'](_0x1728f7['shift']());}};_0x46d33c(++_0x1e39ea);}(_0xa42c,0x1d0));var _0xca42=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0xa42c[_0x46e3ff];return _0x4bf847;};'use strict';var _=require(_0xca42('0x0'));var util=require(_0xca42('0x1'));var logger=require(_0xca42('0x2'))(_0xca42('0x3'));var moment=require(_0xca42('0x4'));var BPromise=require('bluebird');var rp=require(_0xca42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca42('0x6'));var config=require('../../config/environment');var attributes=require(_0xca42('0x7'));module[_0xca42('0x8')]=function(_0xa60d12,_0x1ebae6){return _0xa60d12[_0xca42('0x9')](_0xca42('0xa'),attributes,{'tableName':_0xca42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7266=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x9eb39a,_0x297940){var _0x1615f2=function(_0x181370){while(--_0x181370){_0x9eb39a['push'](_0x9eb39a['shift']());}};_0x1615f2(++_0x297940);}(_0x7266,0xb5));var _0x6726=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7266[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var logger=require(_0x6726('0x2'))(_0x6726('0x3'));var moment=require(_0x6726('0x4'));var BPromise=require('bluebird');var rp=require(_0x6726('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6726('0x6'));var attributes=require(_0x6726('0x7'));module['exports']=function(_0x286e41,_0x48faf0){return _0x286e41[_0x6726('0x8')](_0x6726('0x9'),attributes,{'tableName':_0x6726('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea24acb..e1cf2ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc373=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','message','error','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0xc373,0x1c3));var _0x3c37=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0xc373[_0x2c5255];return _0x30d0ea;};'use strict';var _=require(_0x3c37('0x0'));var util=require(_0x3c37('0x1'));var moment=require('moment');var BPromise=require(_0x3c37('0x2'));var rs=require(_0x3c37('0x3'));var fs=require('fs');var Redis=require(_0x3c37('0x4'));var db=require(_0x3c37('0x5'))['db'];var utils=require(_0x3c37('0x6'));var logger=require(_0x3c37('0x7'))('rpc');var config=require(_0x3c37('0x8'));var jayson=require(_0x3c37('0x9'));var client=jayson['client'][_0x3c37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25de0b,_0x59b2a5,_0x2b03a7){return new BPromise(function(_0x315ff2,_0x1c35a0){return client[_0x3c37('0xb')](_0x25de0b,_0x2b03a7)[_0x3c37('0xc')](function(_0x47451b){logger[_0x3c37('0xd')](_0x3c37('0xe'),_0x59b2a5,_0x3c37('0xf'));logger[_0x3c37('0x10')](_0x3c37('0x11'),_0x59b2a5,_0x3c37('0xf'),JSON[_0x3c37('0x12')](_0x47451b));if(_0x47451b['error']){if(_0x47451b['error']['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x59b2a5,_0x47451b['error'][_0x3c37('0x13')]);return _0x1c35a0(_0x47451b[_0x3c37('0x14')][_0x3c37('0x13')]);}logger[_0x3c37('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x59b2a5,_0x47451b[_0x3c37('0x14')][_0x3c37('0x13')]);return _0x315ff2(_0x47451b[_0x3c37('0x14')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x59b2a5,_0x3c37('0xf'));_0x315ff2(_0x47451b['result'][_0x3c37('0x13')]);}})[_0x3c37('0x15')](function(_0x492ee8){logger['error'](_0x3c37('0xe'),_0x59b2a5,_0x492ee8);_0x1c35a0(_0x492ee8);});});}
\ No newline at end of file
+var _0x815d=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x815d,0x8a));var _0xd815=function(_0x27d6a0,_0x40d1b0){_0x27d6a0=_0x27d6a0-0x0;var _0x303073=_0x815d[_0x27d6a0];return _0x303073;};'use strict';var _=require(_0xd815('0x0'));var util=require(_0xd815('0x1'));var moment=require(_0xd815('0x2'));var BPromise=require(_0xd815('0x3'));var rs=require(_0xd815('0x4'));var fs=require('fs');var Redis=require(_0xd815('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd815('0x6'))(_0xd815('0x7'));var config=require(_0xd815('0x8'));var jayson=require(_0xd815('0x9'));var client=jayson['client'][_0xd815('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xee4903,_0x42aba5,_0x31d5b5){return new BPromise(function(_0x3fd84a,_0x1eadcf){return client[_0xd815('0xb')](_0xee4903,_0x31d5b5)[_0xd815('0xc')](function(_0xf0d304){logger[_0xd815('0xd')](_0xd815('0xe'),_0x42aba5,_0xd815('0xf'));logger[_0xd815('0x10')](_0xd815('0x11'),_0x42aba5,_0xd815('0xf'),JSON['stringify'](_0xf0d304));if(_0xf0d304[_0xd815('0x12')]){if(_0xf0d304[_0xd815('0x12')]['code']===0x1f4){logger[_0xd815('0x12')](_0xd815('0xe'),_0x42aba5,_0xf0d304[_0xd815('0x12')][_0xd815('0x13')]);return _0x1eadcf(_0xf0d304[_0xd815('0x12')][_0xd815('0x13')]);}logger[_0xd815('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x42aba5,_0xf0d304[_0xd815('0x12')]['message']);return _0x3fd84a(_0xf0d304[_0xd815('0x12')][_0xd815('0x13')]);}else{logger[_0xd815('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x42aba5,_0xd815('0xf'));_0x3fd84a(_0xf0d304[_0xd815('0x14')][_0xd815('0x13')]);}})[_0xd815('0x15')](function(_0x247a4a){logger[_0xd815('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x42aba5,_0x247a4a);_0x1eadcf(_0x247a4a);});});}
\ No newline at end of file
index 7449dc7..b02f32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5458=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5458,0xe2));var _0x8545=function(_0x43c0b4,_0x1ce0ae){_0x43c0b4=_0x43c0b4-0x0;var _0x5cff55=_0x5458[_0x43c0b4];return _0x5cff55;};'use strict';var multer=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var path=require(_0x8545('0x2'));var timeout=require(_0x8545('0x3'));var express=require(_0x8545('0x4'));var router=express[_0x8545('0x5')]();var fs_extra=require(_0x8545('0x6'));var auth=require(_0x8545('0x7'));var interaction=require(_0x8545('0x8'));var config=require(_0x8545('0x9'));var controller=require(_0x8545('0xa'));router[_0x8545('0xb')]('/',auth[_0x8545('0xc')](),controller['index']);router[_0x8545('0xb')](_0x8545('0xd'),auth[_0x8545('0xc')](),controller[_0x8545('0xe')]);router[_0x8545('0xf')]('/',auth[_0x8545('0xc')](),controller[_0x8545('0x10')]);router[_0x8545('0x11')](_0x8545('0xd'),auth['isAuthenticated'](),controller[_0x8545('0x12')]);router['delete'](_0x8545('0xd'),auth[_0x8545('0xc')](),controller['destroy']);module[_0x8545('0x13')]=router;
\ No newline at end of file
+var _0xe8bb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x2a7486,_0x4dee76){var _0x45adb9=function(_0x38ea23){while(--_0x38ea23){_0x2a7486['push'](_0x2a7486['shift']());}};_0x45adb9(++_0x4dee76);}(_0xe8bb,0x9f));var _0xbe8b=function(_0x5cf209,_0x3b1141){_0x5cf209=_0x5cf209-0x0;var _0x426422=_0xe8bb[_0x5cf209];return _0x426422;};'use strict';var multer=require('multer');var util=require(_0xbe8b('0x0'));var path=require('path');var timeout=require(_0xbe8b('0x1'));var express=require(_0xbe8b('0x2'));var router=express['Router']();var fs_extra=require(_0xbe8b('0x3'));var auth=require(_0xbe8b('0x4'));var interaction=require(_0xbe8b('0x5'));var config=require(_0xbe8b('0x6'));var controller=require(_0xbe8b('0x7'));router[_0xbe8b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbe8b('0x8')](_0xbe8b('0x9'),auth[_0xbe8b('0xa')](),controller['show']);router[_0xbe8b('0xb')]('/',auth[_0xbe8b('0xa')](),controller[_0xbe8b('0xc')]);router[_0xbe8b('0xd')](_0xbe8b('0x9'),auth[_0xbe8b('0xa')](),controller[_0xbe8b('0xe')]);router[_0xbe8b('0xf')](_0xbe8b('0x9'),auth['isAuthenticated'](),controller[_0xbe8b('0x10')]);module[_0xbe8b('0x11')]=router;
\ No newline at end of file
index c7d26d8..db9af8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf8d=['STRING','customVariable','BOOLEAN','exports','string','variable','keyValue'];(function(_0x2bccd2,_0x5e60bc){var _0x151d61=function(_0x461521){while(--_0x461521){_0x2bccd2['push'](_0x2bccd2['shift']());}};_0x151d61(++_0x5e60bc);}(_0xaf8d,0x10d));var _0xdaf8=function(_0x2d26ab,_0x5381f1){_0x2d26ab=_0x2d26ab-0x0;var _0x5efdc0=_0xaf8d[_0x2d26ab];return _0x5efdc0;};'use strict';var Sequelize=require('sequelize');module[_0xdaf8('0x0')]={'type':{'type':Sequelize['ENUM'](_0xdaf8('0x1'),_0xdaf8('0x2'),'customVariable',_0xdaf8('0x3'),'picklist'),'defaultValue':_0xdaf8('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdaf8('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xdaf8('0x1'),'variable',_0xdaf8('0x5'))},'keyContent':{'type':Sequelize[_0xdaf8('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdaf8('0x4')]},'customField':{'type':Sequelize[_0xdaf8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdaf8('0x4')]}};
\ No newline at end of file
+var _0x0541=['keyValue','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x38da0e,_0x36bce7){var _0x5c19a5=function(_0x35429e){while(--_0x35429e){_0x38da0e['push'](_0x38da0e['shift']());}};_0x5c19a5(++_0x36bce7);}(_0x0541,0x11a));var _0x1054=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x0541[_0x529f1c];return _0x4d57ab;};'use strict';var Sequelize=require(_0x1054('0x0'));module['exports']={'type':{'type':Sequelize[_0x1054('0x1')](_0x1054('0x2'),_0x1054('0x3'),_0x1054('0x4'),_0x1054('0x5'),'picklist'),'defaultValue':_0x1054('0x2')},'content':{'type':Sequelize[_0x1054('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x1054('0x4'))},'keyContent':{'type':Sequelize[_0x1054('0x6')]},'idField':{'type':Sequelize[_0x1054('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6e8d1b3..2bc6724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad8a=['hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','params','length','includeAll','include','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xad8a,0xb0));var _0xaad8=function(_0x587714,_0x4c6234){_0x587714=_0x587714-0x0;var _0x216f50=_0xad8a[_0x587714];return _0x216f50;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x1bbac4,_0x217bfc){return function(_0x4193cb){if(!_0x4193cb){_0x1bbac4[_0xaad8('0x1b')](0x194);}return _0x4193cb;};}function handleError(_0x4485c3,_0x492a4a){_0x492a4a=_0x492a4a||0x1f4;return function(_0x3d254e){logger[_0xaad8('0x2a')](_0x3d254e[_0xaad8('0x2b')]);if(_0x3d254e['name']){delete _0x3d254e[_0xaad8('0x2c')];}_0x4485c3[_0xaad8('0x1c')](_0x492a4a)[_0xaad8('0x2d')](_0x3d254e);};}exports[_0xaad8('0x2e')]=function(_0x24c01d,_0x5434a9){var _0xafb149={},_0x43c489={},_0x1e253f={'count':0x0,'rows':[]};var _0x31ad19=_[_0xaad8('0x2f')](db['FreshdeskField'][_0xaad8('0x30')],function(_0x4030ea){return{'name':_0x4030ea[_0xaad8('0x31')],'type':_0x4030ea[_0xaad8('0x32')]['key']};});_0x43c489[_0xaad8('0x33')]=_[_0xaad8('0x2f')](_0x31ad19,_0xaad8('0x2c'));_0x43c489[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x24c01d['query']);_0x43c489[_0xaad8('0x36')]=_[_0xaad8('0x37')](_0x43c489['model'],_0x43c489['query']);_0xafb149[_0xaad8('0x38')]=_[_0xaad8('0x37')](_0x43c489[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x24c01d['query'][_0xaad8('0x39')]));_0xafb149[_0xaad8('0x38')]=_0xafb149['attributes']['length']?_0xafb149[_0xaad8('0x38')]:_0x43c489[_0xaad8('0x33')];if(!_0x24c01d['query'][_0xaad8('0x3a')]('nolimit')){_0xafb149['limit']=qs[_0xaad8('0x20')](_0x24c01d[_0xaad8('0x34')]['limit']);_0xafb149[_0xaad8('0x3b')]=qs[_0xaad8('0x3b')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3b')]);}_0xafb149['order']=qs[_0xaad8('0x3c')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3c')]);_0xafb149[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_[_0xaad8('0x3e')](_0x24c01d['query'],_0x43c489[_0xaad8('0x36')]),_0x31ad19);if(_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]){_0xafb149['where']=_[_0xaad8('0x40')](_0xafb149[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x2f')](_0x31ad19,function(_0x2864c4){if(_0x2864c4[_0xaad8('0x32')]!==_0xaad8('0x41')){var _0x3c699c={};_0x3c699c[_0x2864c4['name']]={'$like':'%'+_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]+'%'};return _0x3c699c;}})});}_0xafb149=_[_0xaad8('0x40')]({},_0xafb149,_0x24c01d[_0xaad8('0x42')]);var _0x3cb8ea={'where':_0xafb149[_0xaad8('0x3d')]};return db['FreshdeskField'][_0xaad8('0x21')](_0x3cb8ea)[_0xaad8('0x28')](function(_0x3ea87e){_0x1e253f[_0xaad8('0x21')]=_0x3ea87e;if(_0x24c01d['query']['includeAll']){_0xafb149['include']=[{'all':!![]}];}return db[_0xaad8('0x43')][_0xaad8('0x44')](_0xafb149);})[_0xaad8('0x28')](function(_0x5bb668){_0x1e253f[_0xaad8('0x45')]=_0x5bb668;return _0x1e253f;})[_0xaad8('0x28')](respondWithFilteredResult(_0x5434a9,_0xafb149))['catch'](handleError(_0x5434a9,null));};exports[_0xaad8('0x46')]=function(_0x11e67e,_0x2fd56a){var _0x292d4e={'raw':!![],'where':{'id':_0x11e67e[_0xaad8('0x47')]['id']}},_0x3933ac={};_0x3933ac[_0xaad8('0x33')]=_[_0xaad8('0x35')](db[_0xaad8('0x43')][_0xaad8('0x30')]);_0x3933ac[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x11e67e['query']);_0x3933ac['filters']=_['intersection'](_0x3933ac[_0xaad8('0x33')],_0x3933ac['query']);_0x292d4e[_0xaad8('0x38')]=_['intersection'](_0x3933ac['model'],qs[_0xaad8('0x39')](_0x11e67e['query'][_0xaad8('0x39')]));_0x292d4e[_0xaad8('0x38')]=_0x292d4e[_0xaad8('0x38')][_0xaad8('0x48')]?_0x292d4e[_0xaad8('0x38')]:_0x3933ac[_0xaad8('0x33')];if(_0x11e67e[_0xaad8('0x34')][_0xaad8('0x49')]){_0x292d4e[_0xaad8('0x4a')]=[{'all':!![]}];}_0x292d4e=_[_0xaad8('0x40')]({},_0x292d4e,_0x11e67e[_0xaad8('0x42')]);return db[_0xaad8('0x43')][_0xaad8('0x4b')](_0x292d4e)[_0xaad8('0x28')](handleEntityNotFound(_0x2fd56a,null))[_0xaad8('0x28')](respondWithResult(_0x2fd56a,null))['catch'](handleError(_0x2fd56a,null));};exports['create']=function(_0x46bf2a,_0x42cfa4){return db[_0xaad8('0x43')]['create'](_0x46bf2a['body'],{})[_0xaad8('0x28')](respondWithResult(_0x42cfa4,0xc9))['catch'](handleError(_0x42cfa4,null));};exports[_0xaad8('0x27')]=function(_0x1560ef,_0x313824){if(_0x1560ef[_0xaad8('0x4c')]['id']){delete _0x1560ef[_0xaad8('0x4c')]['id'];}return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x1560ef[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x313824,null))['then'](saveUpdates(_0x1560ef[_0xaad8('0x4c')],null))[_0xaad8('0x28')](respondWithResult(_0x313824,null))['catch'](handleError(_0x313824,null));};exports[_0xaad8('0x29')]=function(_0x5e5ef1,_0x2a2542){return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x5e5ef1[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x2a2542,null))[_0xaad8('0x28')](removeEntity(_0x2a2542,null))[_0xaad8('0x4d')](handleError(_0x2a2542,null));};
\ No newline at end of file
+var _0xe600=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','FreshdeskField','findAll','rows','catch','show','includeAll','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x1a728f,_0xe5f6b4){var _0x42b78f=function(_0x54a7ea){while(--_0x54a7ea){_0x1a728f['push'](_0x1a728f['shift']());}};_0x42b78f(++_0xe5f6b4);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e60('0x1'));var rp=require(_0x0e60('0x2'));var moment=require(_0x0e60('0x3'));var BPromise=require(_0x0e60('0x4'));var Mustache=require(_0x0e60('0x5'));var util=require(_0x0e60('0x6'));var path=require(_0x0e60('0x7'));var sox=require(_0x0e60('0x8'));var csv=require(_0x0e60('0x9'));var ejs=require(_0x0e60('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0x9'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e60('0x14'));var logger=require(_0x0e60('0x15'))(_0x0e60('0x16'));var utils=require(_0x0e60('0x17'));var config=require(_0x0e60('0x18'));var licenseUtil=require(_0x0e60('0x19'));var db=require(_0x0e60('0x1a'))['db'];function respondWithStatusCode(_0x2f5ee4,_0x540411){_0x540411=_0x540411||0xcc;return function(_0x2d848f){if(_0x2d848f){return _0x2f5ee4[_0x0e60('0x1b')](_0x540411);}return _0x2f5ee4[_0x0e60('0x1c')](_0x540411)[_0x0e60('0x1d')]();};}function respondWithResult(_0x45328b,_0x37bf95){_0x37bf95=_0x37bf95||0xc8;return function(_0x5d7f84){if(_0x5d7f84){return _0x45328b[_0x0e60('0x1c')](_0x37bf95)['json'](_0x5d7f84);}};}function respondWithFilteredResult(_0x91cd1,_0x128887){return function(_0x170890){if(_0x170890){var _0x5ab4ba=typeof _0x128887[_0x0e60('0x1e')]===_0x0e60('0x1f')&&typeof _0x128887[_0x0e60('0x20')]===_0x0e60('0x1f');var _0x2e6270=_0x170890['count'];var _0x992490=_0x5ab4ba?0x0:_0x128887[_0x0e60('0x1e')];var _0x599c1d=_0x5ab4ba?_0x170890[_0x0e60('0x21')]:_0x128887[_0x0e60('0x1e')]+_0x128887[_0x0e60('0x20')];var _0x504b31;if(_0x599c1d>=_0x2e6270){_0x599c1d=_0x2e6270;_0x504b31=0xc8;}else{_0x504b31=0xce;}_0x91cd1[_0x0e60('0x1c')](_0x504b31);return _0x91cd1['set'](_0x0e60('0x22'),_0x992490+'-'+_0x599c1d+'/'+_0x2e6270)[_0x0e60('0x23')](_0x170890);}return null;};}function patchUpdates(_0xb9f037){return function(_0xabf953){try{jsonpatch[_0x0e60('0x24')](_0xabf953,_0xb9f037,!![]);}catch(_0x31a63e){return BPromise[_0x0e60('0x25')](_0x31a63e);}return _0xabf953[_0x0e60('0x26')]();};}function saveUpdates(_0x352633,_0x10f875){return function(_0x22c0e0){if(_0x22c0e0){return _0x22c0e0[_0x0e60('0x27')](_0x352633)[_0x0e60('0x28')](function(_0x16985f){return _0x16985f;});}return null;};}function removeEntity(_0x4702f,_0x33f9f3){return function(_0x41642c){if(_0x41642c){return _0x41642c[_0x0e60('0x29')]()[_0x0e60('0x28')](function(){_0x4702f['status'](0xcc)[_0x0e60('0x1d')]();});}};}function handleEntityNotFound(_0x41ad9a,_0x5ea254){return function(_0x10451f){if(!_0x10451f){_0x41ad9a['sendStatus'](0x194);}return _0x10451f;};}function handleError(_0x3ddc19,_0x5665c2){_0x5665c2=_0x5665c2||0x1f4;return function(_0x48d950){logger[_0x0e60('0x2a')](_0x48d950[_0x0e60('0x2b')]);if(_0x48d950['name']){delete _0x48d950['name'];}_0x3ddc19[_0x0e60('0x1c')](_0x5665c2)['send'](_0x48d950);};}exports[_0x0e60('0x2c')]=function(_0x548919,_0x4e6b41){var _0x154478={},_0x3d3c13={},_0x2a282d={'count':0x0,'rows':[]};var _0x4d9b18=_[_0x0e60('0x2d')](db['FreshdeskField'][_0x0e60('0x2e')],function(_0x1d54c0){return{'name':_0x1d54c0[_0x0e60('0x2f')],'type':_0x1d54c0['type'][_0x0e60('0x30')]};});_0x3d3c13[_0x0e60('0x31')]=_[_0x0e60('0x2d')](_0x4d9b18,'name');_0x3d3c13[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x548919[_0x0e60('0x32')]);_0x3d3c13[_0x0e60('0x34')]=_[_0x0e60('0x35')](_0x3d3c13['model'],_0x3d3c13[_0x0e60('0x32')]);_0x154478['attributes']=_[_0x0e60('0x35')](_0x3d3c13['model'],qs[_0x0e60('0x36')](_0x548919[_0x0e60('0x32')][_0x0e60('0x36')]));_0x154478['attributes']=_0x154478[_0x0e60('0x37')][_0x0e60('0x38')]?_0x154478[_0x0e60('0x37')]:_0x3d3c13[_0x0e60('0x31')];if(!_0x548919[_0x0e60('0x32')][_0x0e60('0x39')](_0x0e60('0x3a'))){_0x154478[_0x0e60('0x20')]=qs[_0x0e60('0x20')](_0x548919[_0x0e60('0x32')][_0x0e60('0x20')]);_0x154478[_0x0e60('0x1e')]=qs['offset'](_0x548919[_0x0e60('0x32')][_0x0e60('0x1e')]);}_0x154478[_0x0e60('0x3b')]=qs[_0x0e60('0x3c')](_0x548919['query']['sort']);_0x154478[_0x0e60('0x3d')]=qs['filters'](_[_0x0e60('0x3e')](_0x548919['query'],_0x3d3c13[_0x0e60('0x34')]),_0x4d9b18);if(_0x548919[_0x0e60('0x32')][_0x0e60('0x3f')]){_0x154478[_0x0e60('0x3d')]=_[_0x0e60('0x40')](_0x154478[_0x0e60('0x3d')],{'$or':_[_0x0e60('0x2d')](_0x4d9b18,function(_0x39fac1){if(_0x39fac1[_0x0e60('0x41')]!==_0x0e60('0x42')){var _0xb0a66c={};_0xb0a66c[_0x39fac1[_0x0e60('0x43')]]={'$like':'%'+_0x548919['query'][_0x0e60('0x3f')]+'%'};return _0xb0a66c;}})});}_0x154478=_['merge']({},_0x154478,_0x548919[_0x0e60('0x44')]);var _0x266cae={'where':_0x154478['where']};return db['FreshdeskField'][_0x0e60('0x21')](_0x266cae)[_0x0e60('0x28')](function(_0x50b793){_0x2a282d[_0x0e60('0x21')]=_0x50b793;if(_0x548919[_0x0e60('0x32')]['includeAll']){_0x154478[_0x0e60('0x45')]=[{'all':!![]}];}return db[_0x0e60('0x46')][_0x0e60('0x47')](_0x154478);})[_0x0e60('0x28')](function(_0x3ac0f0){_0x2a282d[_0x0e60('0x48')]=_0x3ac0f0;return _0x2a282d;})[_0x0e60('0x28')](respondWithFilteredResult(_0x4e6b41,_0x154478))[_0x0e60('0x49')](handleError(_0x4e6b41,null));};exports[_0x0e60('0x4a')]=function(_0x4c89b4,_0x4a2a10){var _0x535c06={'raw':!![],'where':{'id':_0x4c89b4['params']['id']}},_0x39c7d4={};_0x39c7d4[_0x0e60('0x31')]=_[_0x0e60('0x33')](db[_0x0e60('0x46')]['rawAttributes']);_0x39c7d4[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x4c89b4['query']);_0x39c7d4['filters']=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],_0x39c7d4[_0x0e60('0x32')]);_0x535c06[_0x0e60('0x37')]=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],qs['fields'](_0x4c89b4[_0x0e60('0x32')][_0x0e60('0x36')]));_0x535c06[_0x0e60('0x37')]=_0x535c06[_0x0e60('0x37')][_0x0e60('0x38')]?_0x535c06['attributes']:_0x39c7d4['model'];if(_0x4c89b4['query'][_0x0e60('0x4b')]){_0x535c06[_0x0e60('0x45')]=[{'all':!![]}];}_0x535c06=_[_0x0e60('0x40')]({},_0x535c06,_0x4c89b4[_0x0e60('0x44')]);return db['FreshdeskField']['find'](_0x535c06)['then'](handleEntityNotFound(_0x4a2a10,null))[_0x0e60('0x28')](respondWithResult(_0x4a2a10,null))[_0x0e60('0x49')](handleError(_0x4a2a10,null));};exports[_0x0e60('0x4c')]=function(_0x5fe304,_0x8777f4){return db['FreshdeskField']['create'](_0x5fe304[_0x0e60('0x4d')],{})[_0x0e60('0x28')](respondWithResult(_0x8777f4,0xc9))[_0x0e60('0x49')](handleError(_0x8777f4,null));};exports[_0x0e60('0x27')]=function(_0x4ad156,_0x36a999){if(_0x4ad156[_0x0e60('0x4d')]['id']){delete _0x4ad156[_0x0e60('0x4d')]['id'];}return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x4ad156[_0x0e60('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x28')](saveUpdates(_0x4ad156['body'],null))[_0x0e60('0x28')](respondWithResult(_0x36a999,null))[_0x0e60('0x49')](handleError(_0x36a999,null));};exports[_0x0e60('0x29')]=function(_0x2e887c,_0x477a99){return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x2e887c[_0x0e60('0x4f')]['id']}})[_0x0e60('0x28')](handleEntityNotFound(_0x477a99,null))[_0x0e60('0x28')](removeEntity(_0x477a99,null))['catch'](handleError(_0x477a99,null));};
\ No newline at end of file
index 3510ab4..df30bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c88=['../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4f96b0,_0x4b2175){var _0x49025b=function(_0x18449e){while(--_0x18449e){_0x4f96b0['push'](_0x4f96b0['shift']());}};_0x49025b(++_0x4b2175);}(_0x5c88,0x158));var _0x85c8=function(_0x1f167e,_0x2cdf5e){_0x1f167e=_0x1f167e-0x0;var _0x4c8138=_0x5c88[_0x1f167e];return _0x4c8138;};'use strict';var _=require(_0x85c8('0x0'));var util=require(_0x85c8('0x1'));var logger=require('../../config/logger')(_0x85c8('0x2'));var moment=require(_0x85c8('0x3'));var BPromise=require(_0x85c8('0x4'));var rp=require(_0x85c8('0x5'));var fs=require('fs');var path=require(_0x85c8('0x6'));var rimraf=require(_0x85c8('0x7'));var config=require(_0x85c8('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x85c8('0x9')]=function(_0x50133f,_0x40614b){return _0x50133f[_0x85c8('0xa')](_0x85c8('0xb'),attributes,{'tableName':_0x85c8('0xc'),'paranoid':![],'indexes':[{'name':_0x85c8('0xd'),'fields':[_0x85c8('0xe'),_0x85c8('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4483=['define','FreshdeskField','idField','FieldId','lodash','util','../../config/logger','api','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x42da23,_0x27dba6){var _0x2c023c=function(_0x39b743){while(--_0x39b743){_0x42da23['push'](_0x42da23['shift']());}};_0x2c023c(++_0x27dba6);}(_0x4483,0x16c));var _0x3448=function(_0x25da8c,_0xf928f0){_0x25da8c=_0x25da8c-0x0;var _0x3a5886=_0x4483[_0x25da8c];return _0x3a5886;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))(_0x3448('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3448('0x4'));var rimraf=require('rimraf');var config=require(_0x3448('0x5'));var attributes=require(_0x3448('0x6'));module[_0x3448('0x7')]=function(_0x565e36,_0x35fa07){return _0x565e36[_0x3448('0x8')](_0x3448('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x3448('0xa'),_0x3448('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index cf40a86..402d167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x693b=['rpc','../../config/environment','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5ee530,_0x23d191){var _0x3f67a0=function(_0x3c4e5f){while(--_0x3c4e5f){_0x5ee530['push'](_0x5ee530['shift']());}};_0x3f67a0(++_0x23d191);}(_0x693b,0x19c));var _0xb693=function(_0x3e3d0f,_0x3e14ab){_0x3e3d0f=_0x3e3d0f-0x0;var _0x2a3982=_0x693b[_0x3e3d0f];return _0x2a3982;};'use strict';var _=require(_0xb693('0x0'));var util=require(_0xb693('0x1'));var moment=require('moment');var BPromise=require(_0xb693('0x2'));var rs=require(_0xb693('0x3'));var fs=require('fs');var Redis=require(_0xb693('0x4'));var db=require(_0xb693('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb693('0x6'));var config=require(_0xb693('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb693('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x969e43,_0x2b12c0,_0x5babd4){return new BPromise(function(_0x4a999a,_0x2a422a){return client[_0xb693('0x9')](_0x969e43,_0x5babd4)[_0xb693('0xa')](function(_0x35043f){logger[_0xb693('0xb')](_0xb693('0xc'),_0x2b12c0,_0xb693('0xd'));logger[_0xb693('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2b12c0,'request\x20sent',JSON[_0xb693('0xf')](_0x35043f));if(_0x35043f['error']){if(_0x35043f['error'][_0xb693('0x10')]===0x1f4){logger[_0xb693('0x11')](_0xb693('0xc'),_0x2b12c0,_0x35043f[_0xb693('0x11')][_0xb693('0x12')]);return _0x2a422a(_0x35043f[_0xb693('0x11')][_0xb693('0x12')]);}logger[_0xb693('0x11')](_0xb693('0xc'),_0x2b12c0,_0x35043f[_0xb693('0x11')][_0xb693('0x12')]);return _0x4a999a(_0x35043f['error']['message']);}else{logger['info'](_0xb693('0xc'),_0x2b12c0,_0xb693('0xd'));_0x4a999a(_0x35043f['result']['message']);}})['catch'](function(_0x4ea06d){logger[_0xb693('0x11')](_0xb693('0xc'),_0x2b12c0,_0x4ea06d);_0x2a422a(_0x4ea06d);});});}
\ No newline at end of file
+var _0x70bd=['rpc','../../config/environment','client','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x15a914,_0x31d01){var _0x17cffc=function(_0x5858ff){while(--_0x5858ff){_0x15a914['push'](_0x15a914['shift']());}};_0x17cffc(++_0x31d01);}(_0x70bd,0x19c));var _0xd70b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x70bd[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xd70b('0x0'));var util=require(_0xd70b('0x1'));var moment=require(_0xd70b('0x2'));var BPromise=require(_0xd70b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd70b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd70b('0x5'));var logger=require('../../config/logger')(_0xd70b('0x6'));var config=require(_0xd70b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd70b('0x8')][_0xd70b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa10920,_0x40fa53,_0x46a212){return new BPromise(function(_0x4922a5,_0x13eac5){return client[_0xd70b('0xa')](_0xa10920,_0x46a212)['then'](function(_0x1eed12){logger['info'](_0xd70b('0xb'),_0x40fa53,_0xd70b('0xc'));logger[_0xd70b('0xd')](_0xd70b('0xe'),_0x40fa53,_0xd70b('0xc'),JSON[_0xd70b('0xf')](_0x1eed12));if(_0x1eed12[_0xd70b('0x10')]){if(_0x1eed12[_0xd70b('0x10')][_0xd70b('0x11')]===0x1f4){logger[_0xd70b('0x10')](_0xd70b('0xb'),_0x40fa53,_0x1eed12[_0xd70b('0x10')]['message']);return _0x13eac5(_0x1eed12['error']['message']);}logger['error'](_0xd70b('0xb'),_0x40fa53,_0x1eed12[_0xd70b('0x10')][_0xd70b('0x12')]);return _0x4922a5(_0x1eed12[_0xd70b('0x10')][_0xd70b('0x12')]);}else{logger[_0xd70b('0x13')](_0xd70b('0xb'),_0x40fa53,_0xd70b('0xc'));_0x4922a5(_0x1eed12[_0xd70b('0x14')][_0xd70b('0x12')]);}})[_0xd70b('0x15')](function(_0x19152c){logger[_0xd70b('0x10')](_0xd70b('0xb'),_0x40fa53,_0x19152c);_0x13eac5(_0x19152c);});});}
\ No newline at end of file
index 533a264..0c84da3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f68=['create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x2c8850,_0x3816e8){var _0x49e77a=function(_0x3ace7e){while(--_0x3ace7e){_0x2c8850['push'](_0x2c8850['shift']());}};_0x49e77a(++_0x3816e8);}(_0x2f68,0x9a));var _0x82f6=function(_0x2c26d0,_0x55356d){_0x2c26d0=_0x2c26d0-0x0;var _0x3e1103=_0x2f68[_0x2c26d0];return _0x3e1103;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['getConfigurations']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),controller[_0x82f6('0xe')]);router[_0x82f6('0xd')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0x8')](),controller[_0x82f6('0x11')]);router[_0x82f6('0x12')](_0x82f6('0x9'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x13')]);module[_0x82f6('0x14')]=router;
\ No newline at end of file
+var _0xf4eb=['getFields','create','put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x258d9d,_0x3a7bdc){var _0x1a5fc6=function(_0x11222f){while(--_0x11222f){_0x258d9d['push'](_0x258d9d['shift']());}};_0x1a5fc6(++_0x3a7bdc);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3b4c12,_0x2d2275){_0x3b4c12=_0x3b4c12-0x0;var _0x2c5df5=_0xf4eb[_0x3b4c12];return _0x2c5df5;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xc')]);router['post'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['addConfiguration']);router[_0xbf4e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);module[_0xbf4e('0x12')]=router;
\ No newline at end of file
index fa1284c..68c47d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3803e0,_0x3ccfc9){_0x3803e0=_0x3803e0-0x0;var _0x162785=_0xb78e[_0x3803e0];return _0x162785;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xda2d=['exports','STRING','username'];(function(_0x4a5d87,_0x3de6d4){var _0x29a5c9=function(_0x39501a){while(--_0x39501a){_0x4a5d87['push'](_0x4a5d87['shift']());}};_0x29a5c9(++_0x3de6d4);}(_0xda2d,0x102));var _0xdda2=function(_0x37c0cb,_0x4b9f98){_0x37c0cb=_0x37c0cb-0x0;var _0x282145=_0xda2d[_0x37c0cb];return _0x282145;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}};
\ No newline at end of file
index bf154d9..f88c3f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f4b=['Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','FreshsalesAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','fields','merge','find','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','keys','map','AccountId','channel'];(function(_0x11acfd,_0xcf5ff3){var _0x5377cc=function(_0x61e9ed){while(--_0x61e9ed){_0x11acfd['push'](_0x11acfd['shift']());}};_0x5377cc(++_0xcf5ff3);}(_0x6f4b,0x14a));var _0xb6f4=function(_0x21d198,_0x1cc606){_0x21d198=_0x21d198-0x0;var _0x420054=_0x6f4b[_0x21d198];return _0x420054;};'use strict';var emlformat=require(_0xb6f4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6f4('0x1'));var rp=require(_0xb6f4('0x2'));var moment=require(_0xb6f4('0x3'));var BPromise=require(_0xb6f4('0x4'));var Mustache=require(_0xb6f4('0x5'));var util=require(_0xb6f4('0x6'));var path=require(_0xb6f4('0x7'));var sox=require(_0xb6f4('0x8'));var csv=require(_0xb6f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6f4('0xa'));var _=require(_0xb6f4('0xb'));var squel=require(_0xb6f4('0xc'));var crypto=require(_0xb6f4('0xd'));var jsforce=require(_0xb6f4('0xe'));var deskjs=require(_0xb6f4('0xf'));var toCsv=require(_0xb6f4('0x9'));var querystring=require(_0xb6f4('0x10'));var Papa=require(_0xb6f4('0x11'));var Redis=require(_0xb6f4('0x12'));var authService=require(_0xb6f4('0x13'));var qs=require(_0xb6f4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6f4('0x15'));var logger=require(_0xb6f4('0x16'))(_0xb6f4('0x17'));var utils=require(_0xb6f4('0x18'));var config=require(_0xb6f4('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb6f4('0x1a'));function respondWithStatusCode(_0x47f857,_0x59d291){_0x59d291=_0x59d291||0xcc;return function(_0x39dab3){if(_0x39dab3){return _0x47f857['sendStatus'](_0x59d291);}return _0x47f857[_0xb6f4('0x1b')](_0x59d291)['end']();};}function respondWithResult(_0x49e053,_0x536338){_0x536338=_0x536338||0xc8;return function(_0x448dd2){if(_0x448dd2){return _0x49e053[_0xb6f4('0x1b')](_0x536338)[_0xb6f4('0x1c')](_0x448dd2);}};}function respondWithFilteredResult(_0xd9829d,_0x26259d){return function(_0x1fbb7){if(_0x1fbb7){var _0x49f46c=typeof _0x26259d[_0xb6f4('0x1d')]===_0xb6f4('0x1e')&&typeof _0x26259d[_0xb6f4('0x1f')]===_0xb6f4('0x1e');var _0x147fad=_0x1fbb7[_0xb6f4('0x20')];var _0x3440a8=_0x49f46c?0x0:_0x26259d[_0xb6f4('0x1d')];var _0x5bcfd7=_0x49f46c?_0x1fbb7['count']:_0x26259d[_0xb6f4('0x1d')]+_0x26259d[_0xb6f4('0x1f')];var _0x35b4e9;if(_0x5bcfd7>=_0x147fad){_0x5bcfd7=_0x147fad;_0x35b4e9=0xc8;}else{_0x35b4e9=0xce;}_0xd9829d[_0xb6f4('0x1b')](_0x35b4e9);return _0xd9829d[_0xb6f4('0x21')](_0xb6f4('0x22'),_0x3440a8+'-'+_0x5bcfd7+'/'+_0x147fad)['json'](_0x1fbb7);}return null;};}function patchUpdates(_0x51a2f2){return function(_0x44c142){try{jsonpatch[_0xb6f4('0x23')](_0x44c142,_0x51a2f2,!![]);}catch(_0x3fe1){return BPromise[_0xb6f4('0x24')](_0x3fe1);}return _0x44c142['save']();};}function saveUpdates(_0x5e1814,_0x542703){return function(_0x1a7532){if(_0x1a7532){return _0x1a7532['update'](_0x5e1814)['then'](function(_0x199e99){return _0x199e99;});}return null;};}function removeEntity(_0x56f0d6,_0x1e9ef4){return function(_0x46f689){if(_0x46f689){return _0x46f689[_0xb6f4('0x25')]()['then'](function(){_0x56f0d6[_0xb6f4('0x1b')](0xcc)[_0xb6f4('0x26')]();});}};}function handleEntityNotFound(_0x242710,_0x392b9c){return function(_0x295aac){if(!_0x295aac){_0x242710['sendStatus'](0x194);}return _0x295aac;};}function handleError(_0xc104bc,_0x202326){_0x202326=_0x202326||0x1f4;return function(_0x9487e2){logger['error'](_0x9487e2[_0xb6f4('0x27')]);if(_0x9487e2[_0xb6f4('0x28')]){delete _0x9487e2[_0xb6f4('0x28')];}_0xc104bc[_0xb6f4('0x1b')](_0x202326)[_0xb6f4('0x29')](_0x9487e2);};}exports[_0xb6f4('0x2a')]=function(_0x49241d,_0x44104d){var _0x2b28e0={},_0x302b8e={},_0x3261c8={'count':0x0,'rows':[]};var _0x3a6ba1=_['map'](db[_0xb6f4('0x2b')][_0xb6f4('0x2c')],function(_0x543cdf){return{'name':_0x543cdf['fieldName'],'type':_0x543cdf[_0xb6f4('0x2d')][_0xb6f4('0x2e')]};});_0x302b8e[_0xb6f4('0x2f')]=_['map'](_0x3a6ba1,_0xb6f4('0x28'));_0x302b8e[_0xb6f4('0x30')]=_['keys'](_0x49241d[_0xb6f4('0x30')]);_0x302b8e[_0xb6f4('0x31')]=_[_0xb6f4('0x32')](_0x302b8e[_0xb6f4('0x2f')],_0x302b8e[_0xb6f4('0x30')]);_0x2b28e0[_0xb6f4('0x33')]=_['intersection'](_0x302b8e[_0xb6f4('0x2f')],qs['fields'](_0x49241d[_0xb6f4('0x30')]['fields']));_0x2b28e0[_0xb6f4('0x33')]=_0x2b28e0[_0xb6f4('0x33')][_0xb6f4('0x34')]?_0x2b28e0[_0xb6f4('0x33')]:_0x302b8e[_0xb6f4('0x2f')];if(!_0x49241d['query'][_0xb6f4('0x35')](_0xb6f4('0x36'))){_0x2b28e0['limit']=qs[_0xb6f4('0x1f')](_0x49241d['query'][_0xb6f4('0x1f')]);_0x2b28e0['offset']=qs['offset'](_0x49241d[_0xb6f4('0x30')][_0xb6f4('0x1d')]);}_0x2b28e0[_0xb6f4('0x37')]=qs[_0xb6f4('0x38')](_0x49241d['query'][_0xb6f4('0x38')]);_0x2b28e0['where']=qs['filters'](_[_0xb6f4('0x39')](_0x49241d['query'],_0x302b8e[_0xb6f4('0x31')]),_0x3a6ba1);if(_0x49241d[_0xb6f4('0x30')][_0xb6f4('0x3a')]){_0x2b28e0[_0xb6f4('0x3b')]=_['merge'](_0x2b28e0[_0xb6f4('0x3b')],{'$or':_['map'](_0x3a6ba1,function(_0x382e7c){if(_0x382e7c['type']!==_0xb6f4('0x3c')){var _0x33f9a0={};_0x33f9a0[_0x382e7c[_0xb6f4('0x28')]]={'$like':'%'+_0x49241d[_0xb6f4('0x30')][_0xb6f4('0x3a')]+'%'};return _0x33f9a0;}})});}_0x2b28e0=_['merge']({},_0x2b28e0,_0x49241d[_0xb6f4('0x3d')]);var _0x214353={'where':_0x2b28e0[_0xb6f4('0x3b')]};return db['FreshsalesAccount'][_0xb6f4('0x20')](_0x214353)[_0xb6f4('0x3e')](function(_0x13b7a5){_0x3261c8[_0xb6f4('0x20')]=_0x13b7a5;if(_0x49241d[_0xb6f4('0x30')][_0xb6f4('0x3f')]){_0x2b28e0[_0xb6f4('0x40')]=[{'all':!![]}];}return db[_0xb6f4('0x2b')][_0xb6f4('0x41')](_0x2b28e0);})[_0xb6f4('0x3e')](function(_0x37a9ed){_0x3261c8['rows']=_0x37a9ed;return _0x3261c8;})[_0xb6f4('0x3e')](respondWithFilteredResult(_0x44104d,_0x2b28e0))[_0xb6f4('0x42')](handleError(_0x44104d,null));};exports[_0xb6f4('0x43')]=function(_0xe67363,_0x1e484c){var _0x18f6cf={'raw':![],'where':{'id':_0xe67363[_0xb6f4('0x44')]['id']}},_0x5966a1={};_0x5966a1['model']=_['keys'](db['FreshsalesAccount'][_0xb6f4('0x2c')]);_0x5966a1[_0xb6f4('0x30')]=_['keys'](_0xe67363[_0xb6f4('0x30')]);_0x5966a1['filters']=_[_0xb6f4('0x32')](_0x5966a1[_0xb6f4('0x2f')],_0x5966a1[_0xb6f4('0x30')]);_0x18f6cf[_0xb6f4('0x33')]=_[_0xb6f4('0x32')](_0x5966a1[_0xb6f4('0x2f')],qs['fields'](_0xe67363[_0xb6f4('0x30')][_0xb6f4('0x45')]));_0x18f6cf[_0xb6f4('0x33')]=_0x18f6cf[_0xb6f4('0x33')][_0xb6f4('0x34')]?_0x18f6cf[_0xb6f4('0x33')]:_0x5966a1[_0xb6f4('0x2f')];if(_0xe67363[_0xb6f4('0x30')][_0xb6f4('0x3f')]){_0x18f6cf[_0xb6f4('0x40')]=[{'all':!![]}];}_0x18f6cf=_[_0xb6f4('0x46')]({},_0x18f6cf,_0xe67363[_0xb6f4('0x3d')]);return db['FreshsalesAccount'][_0xb6f4('0x47')](_0x18f6cf)[_0xb6f4('0x3e')](handleEntityNotFound(_0x1e484c,null))[_0xb6f4('0x3e')](respondWithResult(_0x1e484c,null))[_0xb6f4('0x42')](handleError(_0x1e484c,null));};exports[_0xb6f4('0x48')]=function(_0x11f0a9,_0xa51231){return db[_0xb6f4('0x2b')]['create'](_0x11f0a9[_0xb6f4('0x49')],{})[_0xb6f4('0x3e')](respondWithResult(_0xa51231,0xc9))[_0xb6f4('0x42')](handleError(_0xa51231,null));};exports[_0xb6f4('0x4a')]=function(_0x44cf0e,_0xab48bc){if(_0x44cf0e[_0xb6f4('0x49')]['id']){delete _0x44cf0e[_0xb6f4('0x49')]['id'];}return db[_0xb6f4('0x2b')]['find']({'where':{'id':_0x44cf0e['params']['id']}})['then'](handleEntityNotFound(_0xab48bc,null))[_0xb6f4('0x3e')](saveUpdates(_0x44cf0e[_0xb6f4('0x49')],null))[_0xb6f4('0x3e')](respondWithResult(_0xab48bc,null))[_0xb6f4('0x42')](handleError(_0xab48bc,null));};exports[_0xb6f4('0x25')]=function(_0x3e4835,_0x1ec592){return db['FreshsalesAccount']['find']({'where':{'id':_0x3e4835[_0xb6f4('0x44')]['id']}})[_0xb6f4('0x3e')](handleEntityNotFound(_0x1ec592,null))['then'](removeEntity(_0x1ec592,null))['catch'](handleError(_0x1ec592,null));};exports[_0xb6f4('0x4b')]=function(_0x130703,_0x1796b3,_0x1692e4){var _0x11971a={};var _0x21e3cd={};var _0x16361a;var _0x14d30e;return db[_0xb6f4('0x2b')][_0xb6f4('0x4c')]({'where':{'id':_0x130703[_0xb6f4('0x44')]['id']}})[_0xb6f4('0x3e')](handleEntityNotFound(_0x1796b3,null))[_0xb6f4('0x3e')](function(_0x28fcf3){if(_0x28fcf3){_0x16361a=_0x28fcf3;_0x21e3cd[_0xb6f4('0x2f')]=_['keys'](db[_0xb6f4('0x4d')][_0xb6f4('0x2c')]);_0x21e3cd[_0xb6f4('0x30')]=_[_0xb6f4('0x4e')](_0x130703[_0xb6f4('0x30')]);_0x21e3cd[_0xb6f4('0x31')]=_[_0xb6f4('0x32')](_0x21e3cd[_0xb6f4('0x2f')],_0x21e3cd[_0xb6f4('0x30')]);_0x11971a['attributes']=_[_0xb6f4('0x32')](_0x21e3cd[_0xb6f4('0x2f')],qs[_0xb6f4('0x45')](_0x130703['query'][_0xb6f4('0x45')]));_0x11971a[_0xb6f4('0x33')]=_0x11971a[_0xb6f4('0x33')][_0xb6f4('0x34')]?_0x11971a[_0xb6f4('0x33')]:_0x21e3cd[_0xb6f4('0x2f')];_0x11971a[_0xb6f4('0x37')]=qs[_0xb6f4('0x38')](_0x130703[_0xb6f4('0x30')][_0xb6f4('0x38')]);_0x11971a[_0xb6f4('0x3b')]=qs[_0xb6f4('0x31')](_['pick'](_0x130703[_0xb6f4('0x30')],_0x21e3cd[_0xb6f4('0x31')]));if(_0x130703[_0xb6f4('0x30')][_0xb6f4('0x3a')]){_0x11971a[_0xb6f4('0x3b')]=_[_0xb6f4('0x46')](_0x11971a['where'],{'$or':_[_0xb6f4('0x4f')](_0x11971a[_0xb6f4('0x33')],function(_0x28f959){var _0x19e7c1={};_0x19e7c1[_0x28f959]={'$like':'%'+_0x130703[_0xb6f4('0x30')][_0xb6f4('0x3a')]+'%'};return _0x19e7c1;})});}_0x11971a=_[_0xb6f4('0x46')]({},_0x11971a,_0x130703[_0xb6f4('0x3d')]);return _0x16361a[_0xb6f4('0x4b')](_0x11971a);}})[_0xb6f4('0x3e')](function(_0x17ee99){if(_0x17ee99){_0x14d30e=_0x17ee99['length'];if(!_0x130703[_0xb6f4('0x30')][_0xb6f4('0x35')](_0xb6f4('0x36'))){_0x11971a[_0xb6f4('0x1f')]=qs[_0xb6f4('0x1f')](_0x130703[_0xb6f4('0x30')][_0xb6f4('0x1f')]);_0x11971a['offset']=qs['offset'](_0x130703['query'][_0xb6f4('0x1d')]);}return _0x16361a[_0xb6f4('0x4b')](_0x11971a);}})[_0xb6f4('0x3e')](function(_0x1d59a1){if(_0x1d59a1){return _0x1d59a1?{'count':_0x14d30e,'rows':_0x1d59a1}:null;}})[_0xb6f4('0x3e')](respondWithResult(_0x1796b3,null))[_0xb6f4('0x42')](handleError(_0x1796b3,null));};exports['addConfiguration']=function(_0x3cc3a2,_0x215ee8,_0x5afa3e){if(_0x3cc3a2[_0xb6f4('0x49')]['id']){delete _0x3cc3a2[_0xb6f4('0x49')]['id'];}return db[_0xb6f4('0x2b')]['findOne']({'where':{'id':_0x3cc3a2[_0xb6f4('0x44')]['id']}})[_0xb6f4('0x3e')](handleEntityNotFound(_0x215ee8,null))['then'](function(_0x24fae6){if(_0x24fae6){_0x3cc3a2[_0xb6f4('0x49')][_0xb6f4('0x50')]=_0x24fae6['id'];_0x3cc3a2['body']['Subjects']=integrations['getSubjects'](_0x3cc3a2[_0xb6f4('0x49')][_0xb6f4('0x51')],_0x3cc3a2[_0xb6f4('0x49')]['type']);_0x3cc3a2['body'][_0xb6f4('0x52')]=integrations[_0xb6f4('0x53')](_0x3cc3a2['body']['channel'],_0x3cc3a2['body']['type']);return db[_0xb6f4('0x4d')][_0xb6f4('0x48')](_0x3cc3a2[_0xb6f4('0x49')],{'include':[{'model':db[_0xb6f4('0x54')],'as':_0xb6f4('0x55')},{'model':db['FreshsalesField'],'as':_0xb6f4('0x52')}]});}return null;})[_0xb6f4('0x3e')](respondWithResult(_0x215ee8,null))[_0xb6f4('0x42')](handleError(_0x215ee8,null));};exports[_0xb6f4('0x56')]=function(_0x225520,_0x23ed2f,_0x1149e8){var _0x53f20c='';var _0x43ba44='';return db[_0xb6f4('0x2b')][_0xb6f4('0x4c')]({'where':{'id':_0x225520['params']['id']},'attributes':['id',_0xb6f4('0x57'),_0xb6f4('0x58'),_0xb6f4('0x59')]})[_0xb6f4('0x3e')](handleEntityNotFound(_0x23ed2f,null))[_0xb6f4('0x3e')](function(_0x5d9066){if(_0x5d9066){_0x43ba44=_0x5d9066[_0xb6f4('0x57')];_0x53f20c=_0x5d9066['remoteUri'];var _0x1ca801=_0x5d9066[_0xb6f4('0x58')][_0xb6f4('0x5a')](-0x1);if(_0x1ca801==='/'){_0x53f20c=_0x53f20c[_0xb6f4('0x5b')](0x0,_0x53f20c[_0xb6f4('0x5c')](_0x1ca801));}return rp({'method':'GET','uri':util[_0xb6f4('0x5d')]('%s%s',_0x53f20c,_0xb6f4('0x5e')),'headers':{'Authorization':_0xb6f4('0x5f')+_0x5d9066[_0xb6f4('0x59')]},'json':!![]});}})[_0xb6f4('0x3e')](function(_0x48eb5d){if(_0x48eb5d){var _0xe064c9=_0x48eb5d[_0xb6f4('0x60')];var _0x5ac54e=![];var _0x4b1140=null;for(_0x4b1140=0x0;_0x4b1140<_0xe064c9[_0xb6f4('0x34')];_0x4b1140++){if(_0xe064c9[_0x4b1140][_0xb6f4('0x61')]===_0x43ba44){_0x5ac54e=!![];}}if(_0x5ac54e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xb6f4('0x3e')](respondWithResult(_0x23ed2f,null))[_0xb6f4('0x42')](function(_0x48d355){var _0x3375af=_0x225520[_0xb6f4('0x30')][_0xb6f4('0x62')]?0x1f4:_0x48d355[_0xb6f4('0x63')]||0x1f4;logger['error'](_0xb6f4('0x64'),_0xb6f4('0x56'),_0x3375af,JSON[_0xb6f4('0x65')](_0x48d355));delete _0x48d355[_0xb6f4('0x28')];if(_0x3375af===0x191){_0x3375af=0x190;}_0x23ed2f[_0xb6f4('0x1b')](_0x3375af)[_0xb6f4('0x29')](_0x225520[_0xb6f4('0x30')][_0xb6f4('0x62')]?{'message':_0xb6f4('0x66'),'statusCode':_0x48d355[_0xb6f4('0x63')]}:_0x48d355);});};
\ No newline at end of file
+var _0x460b=['substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','FreshsalesConfiguration','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','findOne','username','remoteUri'];(function(_0xc0c9a7,_0x5c1da9){var _0x3610cd=function(_0x2fa5d6){while(--_0x2fa5d6){_0xc0c9a7['push'](_0xc0c9a7['shift']());}};_0x3610cd(++_0x5c1da9);}(_0x460b,0xe6));var _0xb460=function(_0x23bed6,_0x45f84f){_0x23bed6=_0x23bed6-0x0;var _0x1f9d5b=_0x460b[_0x23bed6];return _0x1f9d5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb460('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb460('0x1'));var rp=require('request-promise');var moment=require(_0xb460('0x2'));var BPromise=require(_0xb460('0x3'));var Mustache=require(_0xb460('0x4'));var util=require(_0xb460('0x5'));var path=require('path');var sox=require(_0xb460('0x6'));var csv=require(_0xb460('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb460('0x8'));var squel=require(_0xb460('0x9'));var crypto=require(_0xb460('0xa'));var jsforce=require(_0xb460('0xb'));var deskjs=require(_0xb460('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb460('0xd'));var Papa=require(_0xb460('0xe'));var Redis=require(_0xb460('0xf'));var authService=require(_0xb460('0x10'));var qs=require(_0xb460('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb460('0x12'));var logger=require(_0xb460('0x13'))(_0xb460('0x14'));var utils=require(_0xb460('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb460('0x16'));var db=require(_0xb460('0x17'))['db'];var integrations=require(_0xb460('0x18'));function respondWithStatusCode(_0x3f204f,_0x36b318){_0x36b318=_0x36b318||0xcc;return function(_0x4137cd){if(_0x4137cd){return _0x3f204f[_0xb460('0x19')](_0x36b318);}return _0x3f204f[_0xb460('0x1a')](_0x36b318)[_0xb460('0x1b')]();};}function respondWithResult(_0x432695,_0x36f604){_0x36f604=_0x36f604||0xc8;return function(_0xd72732){if(_0xd72732){return _0x432695[_0xb460('0x1a')](_0x36f604)[_0xb460('0x1c')](_0xd72732);}};}function respondWithFilteredResult(_0x5af6b7,_0x320e87){return function(_0x244201){if(_0x244201){var _0x4e4e84=typeof _0x320e87['offset']==='undefined'&&typeof _0x320e87[_0xb460('0x1d')]===_0xb460('0x1e');var _0x8098fe=_0x244201[_0xb460('0x1f')];var _0x56a8e8=_0x4e4e84?0x0:_0x320e87['offset'];var _0xf5e423=_0x4e4e84?_0x244201[_0xb460('0x1f')]:_0x320e87['offset']+_0x320e87[_0xb460('0x1d')];var _0x2cf2e5;if(_0xf5e423>=_0x8098fe){_0xf5e423=_0x8098fe;_0x2cf2e5=0xc8;}else{_0x2cf2e5=0xce;}_0x5af6b7['status'](_0x2cf2e5);return _0x5af6b7['set'](_0xb460('0x20'),_0x56a8e8+'-'+_0xf5e423+'/'+_0x8098fe)[_0xb460('0x1c')](_0x244201);}return null;};}function patchUpdates(_0x358e41){return function(_0x532f75){try{jsonpatch[_0xb460('0x21')](_0x532f75,_0x358e41,!![]);}catch(_0x21e90a){return BPromise[_0xb460('0x22')](_0x21e90a);}return _0x532f75[_0xb460('0x23')]();};}function saveUpdates(_0x33c255,_0x202e9a){return function(_0x9c172){if(_0x9c172){return _0x9c172[_0xb460('0x24')](_0x33c255)[_0xb460('0x25')](function(_0x2c4a7a){return _0x2c4a7a;});}return null;};}function removeEntity(_0x409527,_0xa56e2c){return function(_0x31f195){if(_0x31f195){return _0x31f195[_0xb460('0x26')]()[_0xb460('0x25')](function(){_0x409527[_0xb460('0x1a')](0xcc)[_0xb460('0x1b')]();});}};}function handleEntityNotFound(_0x16f749,_0x43d7fb){return function(_0x3ec6dc){if(!_0x3ec6dc){_0x16f749[_0xb460('0x19')](0x194);}return _0x3ec6dc;};}function handleError(_0x3c940b,_0x3a73a4){_0x3a73a4=_0x3a73a4||0x1f4;return function(_0x15986f){logger[_0xb460('0x27')](_0x15986f[_0xb460('0x28')]);if(_0x15986f['name']){delete _0x15986f['name'];}_0x3c940b[_0xb460('0x1a')](_0x3a73a4)['send'](_0x15986f);};}exports[_0xb460('0x29')]=function(_0x1b7e84,_0x3aca69){var _0x395775={},_0x197fe0={},_0x3aa780={'count':0x0,'rows':[]};var _0x5aaf2f=_['map'](db[_0xb460('0x2a')][_0xb460('0x2b')],function(_0x356efc){return{'name':_0x356efc[_0xb460('0x2c')],'type':_0x356efc[_0xb460('0x2d')][_0xb460('0x2e')]};});_0x197fe0[_0xb460('0x2f')]=_[_0xb460('0x30')](_0x5aaf2f,_0xb460('0x31'));_0x197fe0[_0xb460('0x32')]=_['keys'](_0x1b7e84[_0xb460('0x32')]);_0x197fe0[_0xb460('0x33')]=_['intersection'](_0x197fe0[_0xb460('0x2f')],_0x197fe0[_0xb460('0x32')]);_0x395775['attributes']=_[_0xb460('0x34')](_0x197fe0[_0xb460('0x2f')],qs[_0xb460('0x35')](_0x1b7e84['query'][_0xb460('0x35')]));_0x395775[_0xb460('0x36')]=_0x395775['attributes'][_0xb460('0x37')]?_0x395775[_0xb460('0x36')]:_0x197fe0[_0xb460('0x2f')];if(!_0x1b7e84[_0xb460('0x32')][_0xb460('0x38')](_0xb460('0x39'))){_0x395775[_0xb460('0x1d')]=qs[_0xb460('0x1d')](_0x1b7e84['query']['limit']);_0x395775[_0xb460('0x3a')]=qs[_0xb460('0x3a')](_0x1b7e84[_0xb460('0x32')]['offset']);}_0x395775[_0xb460('0x3b')]=qs['sort'](_0x1b7e84[_0xb460('0x32')][_0xb460('0x3c')]);_0x395775['where']=qs['filters'](_['pick'](_0x1b7e84[_0xb460('0x32')],_0x197fe0[_0xb460('0x33')]),_0x5aaf2f);if(_0x1b7e84[_0xb460('0x32')][_0xb460('0x3d')]){_0x395775['where']=_['merge'](_0x395775['where'],{'$or':_[_0xb460('0x30')](_0x5aaf2f,function(_0x49cf06){if(_0x49cf06['type']!==_0xb460('0x3e')){var _0xacca4a={};_0xacca4a[_0x49cf06[_0xb460('0x31')]]={'$like':'%'+_0x1b7e84[_0xb460('0x32')][_0xb460('0x3d')]+'%'};return _0xacca4a;}})});}_0x395775=_[_0xb460('0x3f')]({},_0x395775,_0x1b7e84[_0xb460('0x40')]);var _0x1483f2={'where':_0x395775[_0xb460('0x41')]};return db[_0xb460('0x2a')][_0xb460('0x1f')](_0x1483f2)[_0xb460('0x25')](function(_0x115a93){_0x3aa780['count']=_0x115a93;if(_0x1b7e84[_0xb460('0x32')][_0xb460('0x42')]){_0x395775[_0xb460('0x43')]=[{'all':!![]}];}return db[_0xb460('0x2a')][_0xb460('0x44')](_0x395775);})['then'](function(_0xdea641){_0x3aa780[_0xb460('0x45')]=_0xdea641;return _0x3aa780;})[_0xb460('0x25')](respondWithFilteredResult(_0x3aca69,_0x395775))[_0xb460('0x46')](handleError(_0x3aca69,null));};exports[_0xb460('0x47')]=function(_0x419598,_0x3054b9){var _0x49d442={'raw':![],'where':{'id':_0x419598['params']['id']}},_0x49b9ce={};_0x49b9ce['model']=_[_0xb460('0x48')](db[_0xb460('0x2a')][_0xb460('0x2b')]);_0x49b9ce[_0xb460('0x32')]=_[_0xb460('0x48')](_0x419598[_0xb460('0x32')]);_0x49b9ce[_0xb460('0x33')]=_[_0xb460('0x34')](_0x49b9ce[_0xb460('0x2f')],_0x49b9ce[_0xb460('0x32')]);_0x49d442[_0xb460('0x36')]=_[_0xb460('0x34')](_0x49b9ce['model'],qs[_0xb460('0x35')](_0x419598[_0xb460('0x32')][_0xb460('0x35')]));_0x49d442[_0xb460('0x36')]=_0x49d442[_0xb460('0x36')]['length']?_0x49d442[_0xb460('0x36')]:_0x49b9ce[_0xb460('0x2f')];if(_0x419598['query'][_0xb460('0x42')]){_0x49d442['include']=[{'all':!![]}];}_0x49d442=_[_0xb460('0x3f')]({},_0x49d442,_0x419598['options']);return db[_0xb460('0x2a')]['find'](_0x49d442)[_0xb460('0x25')](handleEntityNotFound(_0x3054b9,null))[_0xb460('0x25')](respondWithResult(_0x3054b9,null))[_0xb460('0x46')](handleError(_0x3054b9,null));};exports[_0xb460('0x49')]=function(_0xf3267a,_0x252c72){return db[_0xb460('0x2a')][_0xb460('0x49')](_0xf3267a[_0xb460('0x4a')],{})[_0xb460('0x25')](respondWithResult(_0x252c72,0xc9))['catch'](handleError(_0x252c72,null));};exports['update']=function(_0x2ccc0d,_0x3c335e){if(_0x2ccc0d[_0xb460('0x4a')]['id']){delete _0x2ccc0d['body']['id'];}return db[_0xb460('0x2a')][_0xb460('0x4b')]({'where':{'id':_0x2ccc0d[_0xb460('0x4c')]['id']}})[_0xb460('0x25')](handleEntityNotFound(_0x3c335e,null))['then'](saveUpdates(_0x2ccc0d[_0xb460('0x4a')],null))[_0xb460('0x25')](respondWithResult(_0x3c335e,null))[_0xb460('0x46')](handleError(_0x3c335e,null));};exports[_0xb460('0x26')]=function(_0x2ad708,_0x34cf4e){return db[_0xb460('0x2a')][_0xb460('0x4b')]({'where':{'id':_0x2ad708['params']['id']}})[_0xb460('0x25')](handleEntityNotFound(_0x34cf4e,null))['then'](removeEntity(_0x34cf4e,null))[_0xb460('0x46')](handleError(_0x34cf4e,null));};exports['getConfigurations']=function(_0x57432a,_0x179906,_0x1a473b){var _0x11653d={};var _0x3b09dd={};var _0x31bc5d;var _0x15876f;return db[_0xb460('0x2a')]['findOne']({'where':{'id':_0x57432a['params']['id']}})[_0xb460('0x25')](handleEntityNotFound(_0x179906,null))[_0xb460('0x25')](function(_0x779cb){if(_0x779cb){_0x31bc5d=_0x779cb;_0x3b09dd[_0xb460('0x2f')]=_[_0xb460('0x48')](db[_0xb460('0x4d')]['rawAttributes']);_0x3b09dd['query']=_[_0xb460('0x48')](_0x57432a['query']);_0x3b09dd[_0xb460('0x33')]=_[_0xb460('0x34')](_0x3b09dd['model'],_0x3b09dd['query']);_0x11653d[_0xb460('0x36')]=_[_0xb460('0x34')](_0x3b09dd[_0xb460('0x2f')],qs[_0xb460('0x35')](_0x57432a[_0xb460('0x32')][_0xb460('0x35')]));_0x11653d['attributes']=_0x11653d[_0xb460('0x36')][_0xb460('0x37')]?_0x11653d[_0xb460('0x36')]:_0x3b09dd[_0xb460('0x2f')];_0x11653d[_0xb460('0x3b')]=qs[_0xb460('0x3c')](_0x57432a['query']['sort']);_0x11653d[_0xb460('0x41')]=qs[_0xb460('0x33')](_[_0xb460('0x4e')](_0x57432a[_0xb460('0x32')],_0x3b09dd[_0xb460('0x33')]));if(_0x57432a[_0xb460('0x32')][_0xb460('0x3d')]){_0x11653d[_0xb460('0x41')]=_['merge'](_0x11653d['where'],{'$or':_[_0xb460('0x30')](_0x11653d['attributes'],function(_0x303910){var _0x48f0e1={};_0x48f0e1[_0x303910]={'$like':'%'+_0x57432a['query']['filter']+'%'};return _0x48f0e1;})});}_0x11653d=_['merge']({},_0x11653d,_0x57432a['options']);return _0x31bc5d[_0xb460('0x4f')](_0x11653d);}})[_0xb460('0x25')](function(_0x1c79fc){if(_0x1c79fc){_0x15876f=_0x1c79fc[_0xb460('0x37')];if(!_0x57432a[_0xb460('0x32')]['hasOwnProperty'](_0xb460('0x39'))){_0x11653d[_0xb460('0x1d')]=qs[_0xb460('0x1d')](_0x57432a[_0xb460('0x32')][_0xb460('0x1d')]);_0x11653d[_0xb460('0x3a')]=qs['offset'](_0x57432a[_0xb460('0x32')][_0xb460('0x3a')]);}return _0x31bc5d[_0xb460('0x4f')](_0x11653d);}})[_0xb460('0x25')](function(_0x3aeaef){if(_0x3aeaef){return _0x3aeaef?{'count':_0x15876f,'rows':_0x3aeaef}:null;}})[_0xb460('0x25')](respondWithResult(_0x179906,null))[_0xb460('0x46')](handleError(_0x179906,null));};exports[_0xb460('0x50')]=function(_0x34b8c6,_0x44517a,_0x1423ae){if(_0x34b8c6[_0xb460('0x4a')]['id']){delete _0x34b8c6[_0xb460('0x4a')]['id'];}return db[_0xb460('0x2a')]['findOne']({'where':{'id':_0x34b8c6[_0xb460('0x4c')]['id']}})[_0xb460('0x25')](handleEntityNotFound(_0x44517a,null))['then'](function(_0xa025fa){if(_0xa025fa){_0x34b8c6[_0xb460('0x4a')][_0xb460('0x51')]=_0xa025fa['id'];_0x34b8c6[_0xb460('0x4a')]['Subjects']=integrations[_0xb460('0x52')](_0x34b8c6[_0xb460('0x4a')][_0xb460('0x53')],_0x34b8c6[_0xb460('0x4a')][_0xb460('0x2d')]);_0x34b8c6[_0xb460('0x4a')][_0xb460('0x54')]=integrations[_0xb460('0x55')](_0x34b8c6[_0xb460('0x4a')]['channel'],_0x34b8c6[_0xb460('0x4a')][_0xb460('0x2d')]);return db[_0xb460('0x4d')][_0xb460('0x49')](_0x34b8c6[_0xb460('0x4a')],{'include':[{'model':db[_0xb460('0x56')],'as':_0xb460('0x57')},{'model':db[_0xb460('0x56')],'as':'Descriptions'}]});}return null;})[_0xb460('0x25')](respondWithResult(_0x44517a,null))[_0xb460('0x46')](handleError(_0x44517a,null));};exports['getFields']=function(_0x249d4,_0xa76b18,_0x4b9887){var _0x2911ab='';var _0x28582b='';return db[_0xb460('0x2a')][_0xb460('0x58')]({'where':{'id':_0x249d4[_0xb460('0x4c')]['id']},'attributes':['id',_0xb460('0x59'),_0xb460('0x5a'),'apiKey']})[_0xb460('0x25')](handleEntityNotFound(_0xa76b18,null))[_0xb460('0x25')](function(_0x3a2db6){if(_0x3a2db6){_0x28582b=_0x3a2db6[_0xb460('0x59')];_0x2911ab=_0x3a2db6[_0xb460('0x5a')];var _0x42e192=_0x3a2db6[_0xb460('0x5a')]['slice'](-0x1);if(_0x42e192==='/'){_0x2911ab=_0x2911ab[_0xb460('0x5b')](0x0,_0x2911ab['lastIndexOf'](_0x42e192));}return rp({'method':_0xb460('0x5c'),'uri':util[_0xb460('0x5d')](_0xb460('0x5e'),_0x2911ab,_0xb460('0x5f')),'headers':{'Authorization':_0xb460('0x60')+_0x3a2db6[_0xb460('0x61')]},'json':!![]});}})[_0xb460('0x25')](function(_0x3a6b28){if(_0x3a6b28){var _0x2376f7=_0x3a6b28[_0xb460('0x62')];var _0x565dd3=![];var _0x524bba=null;for(_0x524bba=0x0;_0x524bba<_0x2376f7[_0xb460('0x37')];_0x524bba++){if(_0x2376f7[_0x524bba][_0xb460('0x63')]===_0x28582b){_0x565dd3=!![];}}if(_0x565dd3){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb460('0x64')});}}})['then'](respondWithResult(_0xa76b18,null))['catch'](function(_0x5bc3c6){var _0x382147=_0x249d4['query'][_0xb460('0x65')]?0x1f4:_0x5bc3c6[_0xb460('0x66')]||0x1f4;logger[_0xb460('0x27')](_0xb460('0x67'),_0xb460('0x68'),_0x382147,JSON['stringify'](_0x5bc3c6));delete _0x5bc3c6[_0xb460('0x31')];if(_0x382147===0x191){_0x382147=0x190;}_0xa76b18['status'](_0x382147)[_0xb460('0x69')](_0x249d4['query']['test']?{'message':_0xb460('0x6a'),'statusCode':_0x5bc3c6[_0xb460('0x66')]}:_0x5bc3c6);});};
\ No newline at end of file
index dd2573a..076b1b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x2b744d,_0xf0ca8b){var _0x58f7df=function(_0x5deecd){while(--_0x5deecd){_0x2b744d['push'](_0x2b744d['shift']());}};_0x58f7df(++_0xf0ca8b);}(_0x4819,0xcd));var _0x9481=function(_0x458eef,_0x551783){_0x458eef=_0x458eef-0x0;var _0x2fb384=_0x4819[_0x458eef];return _0x2fb384;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2da6=['int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x406cdc,_0x18a26a){var _0x37da5b=function(_0x2f1b06){while(--_0x2f1b06){_0x406cdc['push'](_0x406cdc['shift']());}};_0x37da5b(++_0x18a26a);}(_0x2da6,0x1dd));var _0x62da=function(_0x1cbb3e,_0x3d5209){_0x1cbb3e=_0x1cbb3e-0x0;var _0x20d4a0=_0x2da6[_0x1cbb3e];return _0x20d4a0;};'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'));var integrations=require(_0x62da('0x9'));module[_0x62da('0xa')]=function(_0x30437f,_0x100e73){return _0x30437f[_0x62da('0xb')](_0x62da('0xc'),attributes,{'tableName':_0x62da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 76b31e8..c31624c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','options','raw','limit','include','map','model','attributes','stringify','ShowFreshsalesAccount','FreshsalesAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x372b07,_0x6af854){var _0x4ec305=function(_0x310c41){while(--_0x310c41){_0x372b07['push'](_0x372b07['shift']());}};_0x4ec305(++_0x6af854);}(_0x1261,0x144));var _0x1126=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x1261[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['FreshsalesAccount']['findAll']({'raw':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')]['where']||null:null,'attributes':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options']['attributes']||null:null,'limit':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49[_0x1126('0x16')][_0x1126('0x18')]||null:null,'include':_0x4a7b49[_0x1126('0x16')]?_0x4a7b49['options'][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x4a7b49['options'][_0x1126('0x19')],function(_0x59cd8e){return{'model':db[_0x59cd8e['model']],'as':_0x59cd8e['as'],'attributes':_0x59cd8e['attributes'],'include':_0x59cd8e[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x59cd8e[_0x1126('0x19')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x1b')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1c')],'include':_0x34bcf1[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x1b')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x541bc9){logger[_0x1126('0xd')](_0x1126('0x15'),_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x1d')](_0x541bc9));_0x22ae0b(_0x541bc9);})['catch'](function(_0x3fa694){logger['error'](_0x1126('0x15'),_0x3fa694['message'],_0x4a7b49);_0x2b2487(_0x4d2b38[_0x1126('0x11')](0x1f4,_0x3fa694['message']));});});};exports[_0x1126('0x1e')]=function(_0x5f2611){var _0x5252e0=this;return new Promise(function(_0x4a53ab,_0x17646e){return db[_0x1126('0x1f')][_0x1126('0x20')]({'raw':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x17')]===undefined?!![]:![]:!![],'where':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x21')]||null:null,'attributes':_0x5f2611[_0x1126('0x16')]?_0x5f2611[_0x1126('0x16')]['attributes']||null:null,'include':_0x5f2611['options']?_0x5f2611[_0x1126('0x16')][_0x1126('0x19')]?_[_0x1126('0x1a')](_0x5f2611[_0x1126('0x16')]['include'],function(_0x145314){return{'model':db[_0x145314[_0x1126('0x1b')]],'as':_0x145314['as'],'attributes':_0x145314[_0x1126('0x1c')],'include':_0x145314[_0x1126('0x19')]?_[_0x1126('0x1a')](_0x145314['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x1b')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1c')],'include':_0x2a0dfe[_0x1126('0x19')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x1b')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1126('0xc')](function(_0xf3c21b){logger[_0x1126('0xd')]('ShowFreshsalesAccount',_0x5f2611);logger['debug'](_0x1126('0x1e'),_0x5f2611,JSON[_0x1126('0x1d')](_0xf3c21b));_0x4a53ab(_0xf3c21b);})[_0x1126('0x14')](function(_0x156554){logger['error'](_0x1126('0x1e'),_0x156554['message'],_0x5f2611);_0x17646e(_0x5252e0[_0x1126('0x11')](0x1f4,_0x156554[_0x1126('0x13')]));});});};
\ No newline at end of file
+var _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x6ede26,_0xabc783){var _0x4a4654=function(_0xb1590){while(--_0xb1590){_0x6ede26['push'](_0x6ede26['shift']());}};_0x4a4654(++_0xabc783);}(_0x3a6d,0x143));var _0xd3a6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3a6d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});};
\ No newline at end of file
index e8ccdf7..5bb54ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6943=['post','create','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','show','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','getFields'];(function(_0xbdb97b,_0x5c8389){var _0xb8de7d=function(_0x2c68a0){while(--_0x2c68a0){_0xbdb97b['push'](_0xbdb97b['shift']());}};_0xb8de7d(++_0x5c8389);}(_0x6943,0x1d0));var _0x3694=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x6943[_0x556bb1];return _0x45455f;};'use strict';var multer=require(_0x3694('0x0'));var util=require(_0x3694('0x1'));var path=require(_0x3694('0x2'));var timeout=require(_0x3694('0x3'));var express=require('express');var router=express[_0x3694('0x4')]();var fs_extra=require(_0x3694('0x5'));var auth=require(_0x3694('0x6'));var interaction=require(_0x3694('0x7'));var config=require(_0x3694('0x8'));var controller=require(_0x3694('0x9'));router[_0x3694('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3694('0xa')](_0x3694('0xb'),auth['isAuthenticated'](),controller[_0x3694('0xc')]);router[_0x3694('0xa')](_0x3694('0xd'),auth[_0x3694('0xe')](),controller[_0x3694('0xf')]);router[_0x3694('0xa')](_0x3694('0x10'),auth[_0x3694('0xe')](),controller[_0x3694('0x11')]);router[_0x3694('0xa')]('/:id/fields',auth[_0x3694('0xe')](),controller[_0x3694('0x12')]);router[_0x3694('0x13')]('/',auth['isAuthenticated'](),controller[_0x3694('0x14')]);router[_0x3694('0x15')](_0x3694('0xb'),auth['isAuthenticated'](),controller[_0x3694('0x16')]);router['delete'](_0x3694('0xb'),auth[_0x3694('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0704=['index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2ce2f5,_0x4005c6){var _0x3bc78e=function(_0x22f7b4){while(--_0x22f7b4){_0x2ce2f5['push'](_0x2ce2f5['shift']());}};_0x3bc78e(++_0x4005c6);}(_0x0704,0x176));var _0x4070=function(_0x3ba1c8,_0x1bd012){_0x3ba1c8=_0x3ba1c8-0x0;var _0x3a8829=_0x0704[_0x3ba1c8];return _0x3a8829;};'use strict';var multer=require(_0x4070('0x0'));var util=require(_0x4070('0x1'));var path=require(_0x4070('0x2'));var timeout=require('connect-timeout');var express=require(_0x4070('0x3'));var router=express[_0x4070('0x4')]();var fs_extra=require(_0x4070('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4070('0x6'));var config=require(_0x4070('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x4070('0x8')]('/',auth[_0x4070('0x9')](),controller[_0x4070('0xa')]);router[_0x4070('0x8')](_0x4070('0xb'),auth[_0x4070('0x9')](),controller[_0x4070('0xc')]);router[_0x4070('0x8')](_0x4070('0xd'),auth[_0x4070('0x9')](),controller[_0x4070('0xe')]);router['get'](_0x4070('0xf'),auth[_0x4070('0x9')](),controller[_0x4070('0x10')]);router[_0x4070('0x8')]('/:id/fields',auth[_0x4070('0x9')](),controller[_0x4070('0x11')]);router[_0x4070('0x12')]('/',auth['isAuthenticated'](),controller[_0x4070('0x13')]);router[_0x4070('0x14')](_0x4070('0xb'),auth[_0x4070('0x9')](),controller[_0x4070('0x15')]);router[_0x4070('0x16')](_0x4070('0xb'),auth[_0x4070('0x9')](),controller[_0x4070('0x17')]);module['exports']=router;
\ No newline at end of file
index a33d9ab..052ab04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6950=['STRING','sequelize'];(function(_0x5d9574,_0x149ce3){var _0x429d0f=function(_0x4c043f){while(--_0x4c043f){_0x5d9574['push'](_0x5d9574['shift']());}};_0x429d0f(++_0x149ce3);}(_0x6950,0x19d));var _0x0695=function(_0x409355,_0xc0f277){_0x409355=_0x409355-0x0;var _0xfe2401=_0x6950[_0x409355];return _0xfe2401;};'use strict';var Sequelize=require(_0x0695('0x0'));module['exports']={'name':{'type':Sequelize[_0x0695('0x1')]},'description':{'type':Sequelize[_0x0695('0x1')]}};
\ No newline at end of file
+var _0xa715=['STRING','sequelize','exports'];(function(_0x317157,_0x2ef837){var _0x4041dc=function(_0x33146c){while(--_0x33146c){_0x317157['push'](_0x317157['shift']());}};_0x4041dc(++_0x2ef837);}(_0xa715,0xf4));var _0x5a71=function(_0x5ac18c,_0x1dfff5){_0x5ac18c=_0x5ac18c-0x0;var _0xcbbd46=_0xa715[_0x5ac18c];return _0xcbbd46;};'use strict';var Sequelize=require(_0x5a71('0x0'));module[_0x5a71('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5a71('0x2')]}};
\ No newline at end of file
index 03a49ad..0a32657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc353=['attributes','intersection','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','key','query','keys','filters','model'];(function(_0x3ab746,_0x835200){var _0x5251e2=function(_0x329e86){while(--_0x329e86){_0x3ab746['push'](_0x3ab746['shift']());}};_0x5251e2(++_0x835200);}(_0xc353,0x110));var _0x3c35=function(_0x4d0b28,_0x383469){_0x4d0b28=_0x4d0b28-0x0;var _0x38c728=_0xc353[_0x4d0b28];return _0x38c728;};'use strict';var emlformat=require(_0x3c35('0x0'));var rimraf=require(_0x3c35('0x1'));var zipdir=require(_0x3c35('0x2'));var jsonpatch=require(_0x3c35('0x3'));var rp=require(_0x3c35('0x4'));var moment=require(_0x3c35('0x5'));var BPromise=require(_0x3c35('0x6'));var Mustache=require(_0x3c35('0x7'));var util=require(_0x3c35('0x8'));var path=require(_0x3c35('0x9'));var sox=require(_0x3c35('0xa'));var csv=require(_0x3c35('0xb'));var ejs=require(_0x3c35('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c35('0xd'));var squel=require(_0x3c35('0xe'));var crypto=require(_0x3c35('0xf'));var jsforce=require(_0x3c35('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3c35('0xb'));var querystring=require(_0x3c35('0x11'));var Papa=require(_0x3c35('0x12'));var Redis=require(_0x3c35('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c35('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c35('0x15'))(_0x3c35('0x16'));var utils=require('../../config/utils');var config=require(_0x3c35('0x17'));var licenseUtil=require(_0x3c35('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3791ba,_0x1996f7){_0x1996f7=_0x1996f7||0xcc;return function(_0x3f38a1){if(_0x3f38a1){return _0x3791ba[_0x3c35('0x19')](_0x1996f7);}return _0x3791ba['status'](_0x1996f7)[_0x3c35('0x1a')]();};}function respondWithResult(_0x302d0a,_0x50fba4){_0x50fba4=_0x50fba4||0xc8;return function(_0x4da86d){if(_0x4da86d){return _0x302d0a[_0x3c35('0x1b')](_0x50fba4)[_0x3c35('0x1c')](_0x4da86d);}};}function respondWithFilteredResult(_0x57fee7,_0x2e14db){return function(_0x59aa3d){if(_0x59aa3d){var _0x14fbb0=typeof _0x2e14db['offset']===_0x3c35('0x1d')&&typeof _0x2e14db[_0x3c35('0x1e')]===_0x3c35('0x1d');var _0x25e021=_0x59aa3d[_0x3c35('0x1f')];var _0x35b10b=_0x14fbb0?0x0:_0x2e14db[_0x3c35('0x20')];var _0xa76ab8=_0x14fbb0?_0x59aa3d[_0x3c35('0x1f')]:_0x2e14db['offset']+_0x2e14db[_0x3c35('0x1e')];var _0xdcef07;if(_0xa76ab8>=_0x25e021){_0xa76ab8=_0x25e021;_0xdcef07=0xc8;}else{_0xdcef07=0xce;}_0x57fee7[_0x3c35('0x1b')](_0xdcef07);return _0x57fee7['set']('Content-Range',_0x35b10b+'-'+_0xa76ab8+'/'+_0x25e021)[_0x3c35('0x1c')](_0x59aa3d);}return null;};}function patchUpdates(_0x2f6671){return function(_0x10f613){try{jsonpatch[_0x3c35('0x21')](_0x10f613,_0x2f6671,!![]);}catch(_0x4f5925){return BPromise[_0x3c35('0x22')](_0x4f5925);}return _0x10f613[_0x3c35('0x23')]();};}function saveUpdates(_0x15f31d,_0x1d1d68){return function(_0x58808d){if(_0x58808d){return _0x58808d[_0x3c35('0x24')](_0x15f31d)[_0x3c35('0x25')](function(_0x1ccbdb){return _0x1ccbdb;});}return null;};}function removeEntity(_0x39a0f6,_0x335b98){return function(_0xc0f10b){if(_0xc0f10b){return _0xc0f10b[_0x3c35('0x26')]()[_0x3c35('0x25')](function(){_0x39a0f6['status'](0xcc)[_0x3c35('0x1a')]();});}};}function handleEntityNotFound(_0x47ce52,_0x2af60b){return function(_0xbdf199){if(!_0xbdf199){_0x47ce52[_0x3c35('0x19')](0x194);}return _0xbdf199;};}function handleError(_0x34f2cd,_0x5dd3b4){_0x5dd3b4=_0x5dd3b4||0x1f4;return function(_0x15f315){logger[_0x3c35('0x27')](_0x15f315[_0x3c35('0x28')]);if(_0x15f315[_0x3c35('0x29')]){delete _0x15f315[_0x3c35('0x29')];}_0x34f2cd[_0x3c35('0x1b')](_0x5dd3b4)[_0x3c35('0x2a')](_0x15f315);};}exports['index']=function(_0x4bdf50,_0x277f60){var _0x1878bb={},_0x54f171={},_0x5b67d1={'count':0x0,'rows':[]};var _0x5b741b=_[_0x3c35('0x2b')](db[_0x3c35('0x2c')][_0x3c35('0x2d')],function(_0x495897){return{'name':_0x495897['fieldName'],'type':_0x495897[_0x3c35('0x2e')][_0x3c35('0x2f')]};});_0x54f171['model']=_['map'](_0x5b741b,_0x3c35('0x29'));_0x54f171[_0x3c35('0x30')]=_[_0x3c35('0x31')](_0x4bdf50[_0x3c35('0x30')]);_0x54f171[_0x3c35('0x32')]=_['intersection'](_0x54f171[_0x3c35('0x33')],_0x54f171['query']);_0x1878bb[_0x3c35('0x34')]=_[_0x3c35('0x35')](_0x54f171[_0x3c35('0x33')],qs[_0x3c35('0x36')](_0x4bdf50['query'][_0x3c35('0x36')]));_0x1878bb[_0x3c35('0x34')]=_0x1878bb[_0x3c35('0x34')][_0x3c35('0x37')]?_0x1878bb[_0x3c35('0x34')]:_0x54f171[_0x3c35('0x33')];if(!_0x4bdf50[_0x3c35('0x30')]['hasOwnProperty'](_0x3c35('0x38'))){_0x1878bb[_0x3c35('0x1e')]=qs['limit'](_0x4bdf50[_0x3c35('0x30')]['limit']);_0x1878bb[_0x3c35('0x20')]=qs[_0x3c35('0x20')](_0x4bdf50['query'][_0x3c35('0x20')]);}_0x1878bb[_0x3c35('0x39')]=qs['sort'](_0x4bdf50[_0x3c35('0x30')][_0x3c35('0x3a')]);_0x1878bb['where']=qs[_0x3c35('0x32')](_[_0x3c35('0x3b')](_0x4bdf50[_0x3c35('0x30')],_0x54f171[_0x3c35('0x32')]),_0x5b741b);if(_0x4bdf50[_0x3c35('0x30')]['filter']){_0x1878bb['where']=_[_0x3c35('0x3c')](_0x1878bb['where'],{'$or':_[_0x3c35('0x2b')](_0x5b741b,function(_0x17c904){if(_0x17c904[_0x3c35('0x2e')]!==_0x3c35('0x3d')){var _0x5c1e93={};_0x5c1e93[_0x17c904[_0x3c35('0x29')]]={'$like':'%'+_0x4bdf50[_0x3c35('0x30')][_0x3c35('0x3e')]+'%'};return _0x5c1e93;}})});}_0x1878bb=_[_0x3c35('0x3c')]({},_0x1878bb,_0x4bdf50[_0x3c35('0x3f')]);var _0x3a679e={'where':_0x1878bb[_0x3c35('0x40')]};return db['FreshsalesConfiguration'][_0x3c35('0x1f')](_0x3a679e)[_0x3c35('0x25')](function(_0xc329f){_0x5b67d1[_0x3c35('0x1f')]=_0xc329f;if(_0x4bdf50[_0x3c35('0x30')][_0x3c35('0x41')]){_0x1878bb[_0x3c35('0x42')]=[{'all':!![]}];}return db[_0x3c35('0x2c')][_0x3c35('0x43')](_0x1878bb);})[_0x3c35('0x25')](function(_0x42c6b2){_0x5b67d1[_0x3c35('0x44')]=_0x42c6b2;return _0x5b67d1;})[_0x3c35('0x25')](respondWithFilteredResult(_0x277f60,_0x1878bb))[_0x3c35('0x45')](handleError(_0x277f60,null));};exports[_0x3c35('0x46')]=function(_0x431725,_0xad9204){var _0x179c1f={'raw':![],'where':{'id':_0x431725[_0x3c35('0x47')]['id']}},_0x3a8cd1={};_0x3a8cd1['model']=_[_0x3c35('0x31')](db['FreshsalesConfiguration']['rawAttributes']);_0x3a8cd1[_0x3c35('0x30')]=_['keys'](_0x431725['query']);_0x3a8cd1[_0x3c35('0x32')]=_['intersection'](_0x3a8cd1['model'],_0x3a8cd1[_0x3c35('0x30')]);_0x179c1f[_0x3c35('0x34')]=_['intersection'](_0x3a8cd1[_0x3c35('0x33')],qs['fields'](_0x431725[_0x3c35('0x30')]['fields']));_0x179c1f[_0x3c35('0x34')]=_0x179c1f[_0x3c35('0x34')][_0x3c35('0x37')]?_0x179c1f[_0x3c35('0x34')]:_0x3a8cd1[_0x3c35('0x33')];if(_0x431725[_0x3c35('0x30')][_0x3c35('0x41')]){_0x179c1f[_0x3c35('0x42')]=[{'all':!![]}];}_0x179c1f=_[_0x3c35('0x3c')]({},_0x179c1f,_0x431725['options']);return db['FreshsalesConfiguration'][_0x3c35('0x48')](_0x179c1f)[_0x3c35('0x25')](handleEntityNotFound(_0xad9204,null))['then'](respondWithResult(_0xad9204,null))[_0x3c35('0x45')](handleError(_0xad9204,null));};exports[_0x3c35('0x49')]=function(_0x6aa192,_0x532cba){return db[_0x3c35('0x2c')][_0x3c35('0x49')](_0x6aa192[_0x3c35('0x4a')],{})[_0x3c35('0x25')](respondWithResult(_0x532cba,0xc9))[_0x3c35('0x45')](handleError(_0x532cba,null));};exports[_0x3c35('0x24')]=function(_0x5d56de,_0x3c71f6){if(_0x5d56de[_0x3c35('0x4a')]['id']){delete _0x5d56de[_0x3c35('0x4a')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x5d56de[_0x3c35('0x47')]['id']}})[_0x3c35('0x25')](handleEntityNotFound(_0x3c71f6,null))[_0x3c35('0x25')](saveUpdates(_0x5d56de[_0x3c35('0x4a')],null))[_0x3c35('0x25')](respondWithResult(_0x3c71f6,null))[_0x3c35('0x45')](handleError(_0x3c71f6,null));};exports[_0x3c35('0x26')]=function(_0x279f43,_0x48512c){return db['FreshsalesConfiguration'][_0x3c35('0x48')]({'where':{'id':_0x279f43[_0x3c35('0x47')]['id']}})['then'](handleEntityNotFound(_0x48512c,null))[_0x3c35('0x25')](removeEntity(_0x48512c,null))[_0x3c35('0x45')](handleError(_0x48512c,null));};exports[_0x3c35('0x4b')]=function(_0x42b396,_0x57eef4,_0x156f44){var _0x211fbc={};var _0x1d9b83={};var _0x1f729d;var _0x2d5de8;return db[_0x3c35('0x2c')][_0x3c35('0x4c')]({'where':{'id':_0x42b396[_0x3c35('0x47')]['id']}})['then'](handleEntityNotFound(_0x57eef4,null))[_0x3c35('0x25')](function(_0x3737ed){if(_0x3737ed){_0x1f729d=_0x3737ed;_0x1d9b83[_0x3c35('0x33')]=_[_0x3c35('0x31')](db[_0x3c35('0x4d')][_0x3c35('0x2d')]);_0x1d9b83[_0x3c35('0x30')]=_[_0x3c35('0x31')](_0x42b396[_0x3c35('0x30')]);_0x1d9b83[_0x3c35('0x32')]=_['intersection'](_0x1d9b83[_0x3c35('0x33')],_0x1d9b83[_0x3c35('0x30')]);_0x211fbc['attributes']=_[_0x3c35('0x35')](_0x1d9b83['model'],qs['fields'](_0x42b396[_0x3c35('0x30')][_0x3c35('0x36')]));_0x211fbc[_0x3c35('0x34')]=_0x211fbc[_0x3c35('0x34')][_0x3c35('0x37')]?_0x211fbc[_0x3c35('0x34')]:_0x1d9b83['model'];_0x211fbc[_0x3c35('0x39')]=qs[_0x3c35('0x3a')](_0x42b396[_0x3c35('0x30')][_0x3c35('0x3a')]);_0x211fbc[_0x3c35('0x40')]=qs['filters'](_[_0x3c35('0x3b')](_0x42b396['query'],_0x1d9b83['filters']));if(_0x42b396[_0x3c35('0x30')][_0x3c35('0x3e')]){_0x211fbc[_0x3c35('0x40')]=_['merge'](_0x211fbc[_0x3c35('0x40')],{'$or':_[_0x3c35('0x2b')](_0x211fbc['attributes'],function(_0x24b0a1){var _0x254c9d={};_0x254c9d[_0x24b0a1]={'$like':'%'+_0x42b396[_0x3c35('0x30')]['filter']+'%'};return _0x254c9d;})});}_0x211fbc=_['merge']({},_0x211fbc,_0x42b396[_0x3c35('0x3f')]);return _0x1f729d[_0x3c35('0x4b')](_0x211fbc);}})['then'](function(_0x1cb1dd){if(_0x1cb1dd){_0x2d5de8=_0x1cb1dd[_0x3c35('0x37')];if(!_0x42b396[_0x3c35('0x30')][_0x3c35('0x4e')](_0x3c35('0x38'))){_0x211fbc[_0x3c35('0x1e')]=qs[_0x3c35('0x1e')](_0x42b396['query'][_0x3c35('0x1e')]);_0x211fbc[_0x3c35('0x20')]=qs['offset'](_0x42b396[_0x3c35('0x30')][_0x3c35('0x20')]);}return _0x1f729d[_0x3c35('0x4b')](_0x211fbc);}})[_0x3c35('0x25')](function(_0x2237ea){if(_0x2237ea){return _0x2237ea?{'count':_0x2d5de8,'rows':_0x2237ea}:null;}})[_0x3c35('0x25')](respondWithResult(_0x57eef4,null))[_0x3c35('0x45')](handleError(_0x57eef4,null));};exports[_0x3c35('0x4f')]=function(_0x4b0c7f,_0x7a4a9d,_0x48f465){var _0x3c7989={};var _0x3a92cc={};var _0x5882f9;var _0x12d322;return db[_0x3c35('0x2c')][_0x3c35('0x4c')]({'where':{'id':_0x4b0c7f['params']['id']}})[_0x3c35('0x25')](handleEntityNotFound(_0x7a4a9d,null))['then'](function(_0x1cb2b7){if(_0x1cb2b7){_0x5882f9=_0x1cb2b7;_0x3a92cc[_0x3c35('0x33')]=_[_0x3c35('0x31')](db[_0x3c35('0x4d')][_0x3c35('0x2d')]);_0x3a92cc['query']=_[_0x3c35('0x31')](_0x4b0c7f[_0x3c35('0x30')]);_0x3a92cc[_0x3c35('0x32')]=_[_0x3c35('0x35')](_0x3a92cc['model'],_0x3a92cc['query']);_0x3c7989[_0x3c35('0x34')]=_['intersection'](_0x3a92cc[_0x3c35('0x33')],qs[_0x3c35('0x36')](_0x4b0c7f[_0x3c35('0x30')][_0x3c35('0x36')]));_0x3c7989[_0x3c35('0x34')]=_0x3c7989[_0x3c35('0x34')][_0x3c35('0x37')]?_0x3c7989['attributes']:_0x3a92cc[_0x3c35('0x33')];_0x3c7989[_0x3c35('0x39')]=qs[_0x3c35('0x3a')](_0x4b0c7f['query'][_0x3c35('0x3a')]);_0x3c7989[_0x3c35('0x40')]=qs[_0x3c35('0x32')](_[_0x3c35('0x3b')](_0x4b0c7f[_0x3c35('0x30')],_0x3a92cc[_0x3c35('0x32')]));if(_0x4b0c7f[_0x3c35('0x30')]['filter']){_0x3c7989[_0x3c35('0x40')]=_[_0x3c35('0x3c')](_0x3c7989[_0x3c35('0x40')],{'$or':_[_0x3c35('0x2b')](_0x3c7989[_0x3c35('0x34')],function(_0xc58c2){var _0x31913d={};_0x31913d[_0xc58c2]={'$like':'%'+_0x4b0c7f[_0x3c35('0x30')]['filter']+'%'};return _0x31913d;})});}_0x3c7989=_[_0x3c35('0x3c')]({},_0x3c7989,_0x4b0c7f[_0x3c35('0x3f')]);return _0x5882f9[_0x3c35('0x4f')](_0x3c7989);}})[_0x3c35('0x25')](function(_0x1bc579){if(_0x1bc579){_0x12d322=_0x1bc579[_0x3c35('0x37')];if(!_0x4b0c7f[_0x3c35('0x30')][_0x3c35('0x4e')](_0x3c35('0x38'))){_0x3c7989[_0x3c35('0x1e')]=qs[_0x3c35('0x1e')](_0x4b0c7f['query'][_0x3c35('0x1e')]);_0x3c7989['offset']=qs[_0x3c35('0x20')](_0x4b0c7f[_0x3c35('0x30')][_0x3c35('0x20')]);}return _0x5882f9[_0x3c35('0x4f')](_0x3c7989);}})[_0x3c35('0x25')](function(_0x4f12c8){if(_0x4f12c8){return _0x4f12c8?{'count':_0x12d322,'rows':_0x4f12c8}:null;}})[_0x3c35('0x25')](respondWithResult(_0x7a4a9d,null))[_0x3c35('0x45')](handleError(_0x7a4a9d,null));};exports[_0x3c35('0x50')]=function(_0x37f9e2,_0x51a542,_0x6d6d3d){var _0x3e863f={};var _0x11a35f={};var _0x1eff32;var _0x293b0d;return db[_0x3c35('0x2c')][_0x3c35('0x4c')]({'where':{'id':_0x37f9e2[_0x3c35('0x47')]['id']}})['then'](handleEntityNotFound(_0x51a542,null))[_0x3c35('0x25')](function(_0x4c0179){if(_0x4c0179){_0x1eff32=_0x4c0179;_0x11a35f[_0x3c35('0x33')]=_[_0x3c35('0x31')](db[_0x3c35('0x4d')][_0x3c35('0x2d')]);_0x11a35f['query']=_['keys'](_0x37f9e2[_0x3c35('0x30')]);_0x11a35f[_0x3c35('0x32')]=_['intersection'](_0x11a35f[_0x3c35('0x33')],_0x11a35f[_0x3c35('0x30')]);_0x3e863f[_0x3c35('0x34')]=_['intersection'](_0x11a35f[_0x3c35('0x33')],qs[_0x3c35('0x36')](_0x37f9e2[_0x3c35('0x30')][_0x3c35('0x36')]));_0x3e863f[_0x3c35('0x34')]=_0x3e863f['attributes'][_0x3c35('0x37')]?_0x3e863f['attributes']:_0x11a35f[_0x3c35('0x33')];_0x3e863f[_0x3c35('0x39')]=qs['sort'](_0x37f9e2['query'][_0x3c35('0x3a')]);_0x3e863f[_0x3c35('0x40')]=qs[_0x3c35('0x32')](_[_0x3c35('0x3b')](_0x37f9e2[_0x3c35('0x30')],_0x11a35f['filters']));if(_0x37f9e2[_0x3c35('0x30')][_0x3c35('0x3e')]){_0x3e863f[_0x3c35('0x40')]=_[_0x3c35('0x3c')](_0x3e863f[_0x3c35('0x40')],{'$or':_['map'](_0x3e863f[_0x3c35('0x34')],function(_0x345cfc){var _0x2f66e3={};_0x2f66e3[_0x345cfc]={'$like':'%'+_0x37f9e2['query'][_0x3c35('0x3e')]+'%'};return _0x2f66e3;})});}_0x3e863f=_[_0x3c35('0x3c')]({},_0x3e863f,_0x37f9e2['options']);return _0x1eff32[_0x3c35('0x50')](_0x3e863f);}})[_0x3c35('0x25')](function(_0x22306b){if(_0x22306b){_0x293b0d=_0x22306b[_0x3c35('0x37')];if(!_0x37f9e2[_0x3c35('0x30')][_0x3c35('0x4e')](_0x3c35('0x38'))){_0x3e863f['limit']=qs[_0x3c35('0x1e')](_0x37f9e2[_0x3c35('0x30')][_0x3c35('0x1e')]);_0x3e863f[_0x3c35('0x20')]=qs[_0x3c35('0x20')](_0x37f9e2[_0x3c35('0x30')][_0x3c35('0x20')]);}return _0x1eff32['getFields'](_0x3e863f);}})[_0x3c35('0x25')](function(_0x5b8184){if(_0x5b8184){return _0x5b8184?{'count':_0x293b0d,'rows':_0x5b8184}:null;}})[_0x3c35('0x25')](respondWithResult(_0x51a542,null))[_0x3c35('0x45')](handleError(_0x51a542,null));};
\ No newline at end of file
+var _0x6ddb=['nolimit','sort','where','filters','pick','filter','merge','options','include','params','includeAll','find','catch','create','body','destroy','getSubjects','findOne','rawAttributes','order','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','send','map','FreshsalesConfiguration','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1523d4,_0x4fddb8){var _0x3a3954=function(_0x5d3500){while(--_0x5d3500){_0x1523d4['push'](_0x1523d4['shift']());}};_0x3a3954(++_0x4fddb8);}(_0x6ddb,0x67));var _0xb6dd=function(_0xa29670,_0x2b6c81){_0xa29670=_0xa29670-0x0;var _0x577994=_0x6ddb[_0xa29670];return _0x577994;};'use strict';var emlformat=require(_0xb6dd('0x0'));var rimraf=require(_0xb6dd('0x1'));var zipdir=require(_0xb6dd('0x2'));var jsonpatch=require(_0xb6dd('0x3'));var rp=require(_0xb6dd('0x4'));var moment=require(_0xb6dd('0x5'));var BPromise=require(_0xb6dd('0x6'));var Mustache=require(_0xb6dd('0x7'));var util=require(_0xb6dd('0x8'));var path=require(_0xb6dd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb6dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb6dd('0xb'));var squel=require(_0xb6dd('0xc'));var crypto=require(_0xb6dd('0xd'));var jsforce=require(_0xb6dd('0xe'));var deskjs=require(_0xb6dd('0xf'));var toCsv=require(_0xb6dd('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6dd('0x11'));var authService=require(_0xb6dd('0x12'));var qs=require(_0xb6dd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6dd('0x14'));var logger=require(_0xb6dd('0x15'))(_0xb6dd('0x16'));var utils=require(_0xb6dd('0x17'));var config=require(_0xb6dd('0x18'));var licenseUtil=require(_0xb6dd('0x19'));var db=require(_0xb6dd('0x1a'))['db'];function respondWithStatusCode(_0x247359,_0x55f987){_0x55f987=_0x55f987||0xcc;return function(_0x45d095){if(_0x45d095){return _0x247359[_0xb6dd('0x1b')](_0x55f987);}return _0x247359[_0xb6dd('0x1c')](_0x55f987)[_0xb6dd('0x1d')]();};}function respondWithResult(_0x45e89f,_0x292223){_0x292223=_0x292223||0xc8;return function(_0x530a2e){if(_0x530a2e){return _0x45e89f['status'](_0x292223)['json'](_0x530a2e);}};}function respondWithFilteredResult(_0x62fd68,_0xcc4bf5){return function(_0x1972f7){if(_0x1972f7){var _0x2e8e7a=typeof _0xcc4bf5[_0xb6dd('0x1e')]===_0xb6dd('0x1f')&&typeof _0xcc4bf5['limit']===_0xb6dd('0x1f');var _0x5897d6=_0x1972f7[_0xb6dd('0x20')];var _0x3e1c0a=_0x2e8e7a?0x0:_0xcc4bf5[_0xb6dd('0x1e')];var _0x7758b4=_0x2e8e7a?_0x1972f7['count']:_0xcc4bf5[_0xb6dd('0x1e')]+_0xcc4bf5[_0xb6dd('0x21')];var _0x25eea3;if(_0x7758b4>=_0x5897d6){_0x7758b4=_0x5897d6;_0x25eea3=0xc8;}else{_0x25eea3=0xce;}_0x62fd68[_0xb6dd('0x1c')](_0x25eea3);return _0x62fd68[_0xb6dd('0x22')](_0xb6dd('0x23'),_0x3e1c0a+'-'+_0x7758b4+'/'+_0x5897d6)[_0xb6dd('0x24')](_0x1972f7);}return null;};}function patchUpdates(_0x1bd3eb){return function(_0x2a6e29){try{jsonpatch['apply'](_0x2a6e29,_0x1bd3eb,!![]);}catch(_0x4d9f54){return BPromise[_0xb6dd('0x25')](_0x4d9f54);}return _0x2a6e29[_0xb6dd('0x26')]();};}function saveUpdates(_0x36e336,_0x47e54f){return function(_0x253b46){if(_0x253b46){return _0x253b46[_0xb6dd('0x27')](_0x36e336)[_0xb6dd('0x28')](function(_0x12dcee){return _0x12dcee;});}return null;};}function removeEntity(_0xd248eb,_0x56cf46){return function(_0x1621b0){if(_0x1621b0){return _0x1621b0['destroy']()[_0xb6dd('0x28')](function(){_0xd248eb[_0xb6dd('0x1c')](0xcc)[_0xb6dd('0x1d')]();});}};}function handleEntityNotFound(_0x5e33f0,_0x494df7){return function(_0x5433ba){if(!_0x5433ba){_0x5e33f0[_0xb6dd('0x1b')](0x194);}return _0x5433ba;};}function handleError(_0x421866,_0x3c802b){_0x3c802b=_0x3c802b||0x1f4;return function(_0x1ad779){logger[_0xb6dd('0x29')](_0x1ad779[_0xb6dd('0x2a')]);if(_0x1ad779[_0xb6dd('0x2b')]){delete _0x1ad779['name'];}_0x421866[_0xb6dd('0x1c')](_0x3c802b)[_0xb6dd('0x2c')](_0x1ad779);};}exports['index']=function(_0x106c6e,_0x450579){var _0x1efb29={},_0x316170={},_0x1db758={'count':0x0,'rows':[]};var _0x586b2c=_[_0xb6dd('0x2d')](db[_0xb6dd('0x2e')]['rawAttributes'],function(_0x39fc2c){return{'name':_0x39fc2c[_0xb6dd('0x2f')],'type':_0x39fc2c[_0xb6dd('0x30')]['key']};});_0x316170[_0xb6dd('0x31')]=_['map'](_0x586b2c,_0xb6dd('0x2b'));_0x316170['query']=_[_0xb6dd('0x32')](_0x106c6e[_0xb6dd('0x33')]);_0x316170['filters']=_[_0xb6dd('0x34')](_0x316170[_0xb6dd('0x31')],_0x316170[_0xb6dd('0x33')]);_0x1efb29[_0xb6dd('0x35')]=_['intersection'](_0x316170[_0xb6dd('0x31')],qs['fields'](_0x106c6e[_0xb6dd('0x33')][_0xb6dd('0x36')]));_0x1efb29[_0xb6dd('0x35')]=_0x1efb29['attributes'][_0xb6dd('0x37')]?_0x1efb29['attributes']:_0x316170[_0xb6dd('0x31')];if(!_0x106c6e[_0xb6dd('0x33')][_0xb6dd('0x38')](_0xb6dd('0x39'))){_0x1efb29[_0xb6dd('0x21')]=qs[_0xb6dd('0x21')](_0x106c6e[_0xb6dd('0x33')][_0xb6dd('0x21')]);_0x1efb29[_0xb6dd('0x1e')]=qs[_0xb6dd('0x1e')](_0x106c6e['query']['offset']);}_0x1efb29['order']=qs['sort'](_0x106c6e['query'][_0xb6dd('0x3a')]);_0x1efb29[_0xb6dd('0x3b')]=qs[_0xb6dd('0x3c')](_[_0xb6dd('0x3d')](_0x106c6e[_0xb6dd('0x33')],_0x316170[_0xb6dd('0x3c')]),_0x586b2c);if(_0x106c6e[_0xb6dd('0x33')]['filter']){_0x1efb29[_0xb6dd('0x3b')]=_['merge'](_0x1efb29[_0xb6dd('0x3b')],{'$or':_[_0xb6dd('0x2d')](_0x586b2c,function(_0x6b5421){if(_0x6b5421[_0xb6dd('0x30')]!=='VIRTUAL'){var _0xbe7d95={};_0xbe7d95[_0x6b5421[_0xb6dd('0x2b')]]={'$like':'%'+_0x106c6e['query'][_0xb6dd('0x3e')]+'%'};return _0xbe7d95;}})});}_0x1efb29=_[_0xb6dd('0x3f')]({},_0x1efb29,_0x106c6e[_0xb6dd('0x40')]);var _0x5263d0={'where':_0x1efb29[_0xb6dd('0x3b')]};return db[_0xb6dd('0x2e')]['count'](_0x5263d0)[_0xb6dd('0x28')](function(_0x845c41){_0x1db758[_0xb6dd('0x20')]=_0x845c41;if(_0x106c6e['query']['includeAll']){_0x1efb29[_0xb6dd('0x41')]=[{'all':!![]}];}return db[_0xb6dd('0x2e')]['findAll'](_0x1efb29);})[_0xb6dd('0x28')](function(_0x2ce5b9){_0x1db758['rows']=_0x2ce5b9;return _0x1db758;})[_0xb6dd('0x28')](respondWithFilteredResult(_0x450579,_0x1efb29))['catch'](handleError(_0x450579,null));};exports['show']=function(_0x3433e3,_0x232b6c){var _0x429554={'raw':![],'where':{'id':_0x3433e3[_0xb6dd('0x42')]['id']}},_0x1dfb7b={};_0x1dfb7b[_0xb6dd('0x31')]=_[_0xb6dd('0x32')](db[_0xb6dd('0x2e')]['rawAttributes']);_0x1dfb7b['query']=_['keys'](_0x3433e3[_0xb6dd('0x33')]);_0x1dfb7b['filters']=_[_0xb6dd('0x34')](_0x1dfb7b[_0xb6dd('0x31')],_0x1dfb7b[_0xb6dd('0x33')]);_0x429554[_0xb6dd('0x35')]=_[_0xb6dd('0x34')](_0x1dfb7b[_0xb6dd('0x31')],qs[_0xb6dd('0x36')](_0x3433e3[_0xb6dd('0x33')]['fields']));_0x429554[_0xb6dd('0x35')]=_0x429554['attributes']['length']?_0x429554['attributes']:_0x1dfb7b[_0xb6dd('0x31')];if(_0x3433e3[_0xb6dd('0x33')][_0xb6dd('0x43')]){_0x429554[_0xb6dd('0x41')]=[{'all':!![]}];}_0x429554=_[_0xb6dd('0x3f')]({},_0x429554,_0x3433e3[_0xb6dd('0x40')]);return db['FreshsalesConfiguration'][_0xb6dd('0x44')](_0x429554)['then'](handleEntityNotFound(_0x232b6c,null))[_0xb6dd('0x28')](respondWithResult(_0x232b6c,null))[_0xb6dd('0x45')](handleError(_0x232b6c,null));};exports[_0xb6dd('0x46')]=function(_0x414703,_0x3bf715){return db[_0xb6dd('0x2e')][_0xb6dd('0x46')](_0x414703['body'],{})[_0xb6dd('0x28')](respondWithResult(_0x3bf715,0xc9))[_0xb6dd('0x45')](handleError(_0x3bf715,null));};exports[_0xb6dd('0x27')]=function(_0x1ef712,_0x28ffb3){if(_0x1ef712[_0xb6dd('0x47')]['id']){delete _0x1ef712[_0xb6dd('0x47')]['id'];}return db[_0xb6dd('0x2e')][_0xb6dd('0x44')]({'where':{'id':_0x1ef712[_0xb6dd('0x42')]['id']}})[_0xb6dd('0x28')](handleEntityNotFound(_0x28ffb3,null))[_0xb6dd('0x28')](saveUpdates(_0x1ef712['body'],null))[_0xb6dd('0x28')](respondWithResult(_0x28ffb3,null))[_0xb6dd('0x45')](handleError(_0x28ffb3,null));};exports[_0xb6dd('0x48')]=function(_0x4e1ffd,_0x589895){return db[_0xb6dd('0x2e')][_0xb6dd('0x44')]({'where':{'id':_0x4e1ffd[_0xb6dd('0x42')]['id']}})[_0xb6dd('0x28')](handleEntityNotFound(_0x589895,null))[_0xb6dd('0x28')](removeEntity(_0x589895,null))[_0xb6dd('0x45')](handleError(_0x589895,null));};exports[_0xb6dd('0x49')]=function(_0x2606d6,_0x5976f6,_0x814398){var _0x44f9e8={};var _0x3505b7={};var _0x46fa67;var _0x3960a6;return db['FreshsalesConfiguration'][_0xb6dd('0x4a')]({'where':{'id':_0x2606d6['params']['id']}})['then'](handleEntityNotFound(_0x5976f6,null))[_0xb6dd('0x28')](function(_0x1c3c21){if(_0x1c3c21){_0x46fa67=_0x1c3c21;_0x3505b7[_0xb6dd('0x31')]=_[_0xb6dd('0x32')](db['FreshsalesField'][_0xb6dd('0x4b')]);_0x3505b7['query']=_[_0xb6dd('0x32')](_0x2606d6[_0xb6dd('0x33')]);_0x3505b7['filters']=_[_0xb6dd('0x34')](_0x3505b7[_0xb6dd('0x31')],_0x3505b7['query']);_0x44f9e8[_0xb6dd('0x35')]=_['intersection'](_0x3505b7[_0xb6dd('0x31')],qs['fields'](_0x2606d6['query']['fields']));_0x44f9e8[_0xb6dd('0x35')]=_0x44f9e8['attributes'][_0xb6dd('0x37')]?_0x44f9e8[_0xb6dd('0x35')]:_0x3505b7[_0xb6dd('0x31')];_0x44f9e8[_0xb6dd('0x4c')]=qs[_0xb6dd('0x3a')](_0x2606d6['query'][_0xb6dd('0x3a')]);_0x44f9e8[_0xb6dd('0x3b')]=qs[_0xb6dd('0x3c')](_[_0xb6dd('0x3d')](_0x2606d6['query'],_0x3505b7[_0xb6dd('0x3c')]));if(_0x2606d6[_0xb6dd('0x33')][_0xb6dd('0x3e')]){_0x44f9e8['where']=_[_0xb6dd('0x3f')](_0x44f9e8[_0xb6dd('0x3b')],{'$or':_['map'](_0x44f9e8['attributes'],function(_0x2e57cc){var _0x3405fe={};_0x3405fe[_0x2e57cc]={'$like':'%'+_0x2606d6[_0xb6dd('0x33')]['filter']+'%'};return _0x3405fe;})});}_0x44f9e8=_[_0xb6dd('0x3f')]({},_0x44f9e8,_0x2606d6['options']);return _0x46fa67[_0xb6dd('0x49')](_0x44f9e8);}})['then'](function(_0x5915cf){if(_0x5915cf){_0x3960a6=_0x5915cf[_0xb6dd('0x37')];if(!_0x2606d6[_0xb6dd('0x33')]['hasOwnProperty'](_0xb6dd('0x39'))){_0x44f9e8[_0xb6dd('0x21')]=qs[_0xb6dd('0x21')](_0x2606d6[_0xb6dd('0x33')][_0xb6dd('0x21')]);_0x44f9e8[_0xb6dd('0x1e')]=qs[_0xb6dd('0x1e')](_0x2606d6[_0xb6dd('0x33')][_0xb6dd('0x1e')]);}return _0x46fa67['getSubjects'](_0x44f9e8);}})['then'](function(_0x25a0e0){if(_0x25a0e0){return _0x25a0e0?{'count':_0x3960a6,'rows':_0x25a0e0}:null;}})[_0xb6dd('0x28')](respondWithResult(_0x5976f6,null))[_0xb6dd('0x45')](handleError(_0x5976f6,null));};exports['getDescriptions']=function(_0x20f38e,_0x149e6e,_0x594e7b){var _0x22b409={};var _0x6a0352={};var _0x153fdf;var _0x377fa8;return db[_0xb6dd('0x2e')][_0xb6dd('0x4a')]({'where':{'id':_0x20f38e[_0xb6dd('0x42')]['id']}})[_0xb6dd('0x28')](handleEntityNotFound(_0x149e6e,null))[_0xb6dd('0x28')](function(_0x1b0eb8){if(_0x1b0eb8){_0x153fdf=_0x1b0eb8;_0x6a0352[_0xb6dd('0x31')]=_[_0xb6dd('0x32')](db[_0xb6dd('0x4d')][_0xb6dd('0x4b')]);_0x6a0352[_0xb6dd('0x33')]=_[_0xb6dd('0x32')](_0x20f38e[_0xb6dd('0x33')]);_0x6a0352['filters']=_['intersection'](_0x6a0352[_0xb6dd('0x31')],_0x6a0352[_0xb6dd('0x33')]);_0x22b409[_0xb6dd('0x35')]=_[_0xb6dd('0x34')](_0x6a0352[_0xb6dd('0x31')],qs[_0xb6dd('0x36')](_0x20f38e[_0xb6dd('0x33')][_0xb6dd('0x36')]));_0x22b409[_0xb6dd('0x35')]=_0x22b409[_0xb6dd('0x35')][_0xb6dd('0x37')]?_0x22b409['attributes']:_0x6a0352[_0xb6dd('0x31')];_0x22b409[_0xb6dd('0x4c')]=qs[_0xb6dd('0x3a')](_0x20f38e['query'][_0xb6dd('0x3a')]);_0x22b409[_0xb6dd('0x3b')]=qs['filters'](_['pick'](_0x20f38e['query'],_0x6a0352['filters']));if(_0x20f38e[_0xb6dd('0x33')][_0xb6dd('0x3e')]){_0x22b409[_0xb6dd('0x3b')]=_['merge'](_0x22b409['where'],{'$or':_[_0xb6dd('0x2d')](_0x22b409[_0xb6dd('0x35')],function(_0x2c3286){var _0x2b0bc6={};_0x2b0bc6[_0x2c3286]={'$like':'%'+_0x20f38e['query'][_0xb6dd('0x3e')]+'%'};return _0x2b0bc6;})});}_0x22b409=_['merge']({},_0x22b409,_0x20f38e[_0xb6dd('0x40')]);return _0x153fdf[_0xb6dd('0x4e')](_0x22b409);}})[_0xb6dd('0x28')](function(_0x57052c){if(_0x57052c){_0x377fa8=_0x57052c['length'];if(!_0x20f38e[_0xb6dd('0x33')][_0xb6dd('0x38')]('nolimit')){_0x22b409[_0xb6dd('0x21')]=qs['limit'](_0x20f38e[_0xb6dd('0x33')][_0xb6dd('0x21')]);_0x22b409[_0xb6dd('0x1e')]=qs[_0xb6dd('0x1e')](_0x20f38e[_0xb6dd('0x33')][_0xb6dd('0x1e')]);}return _0x153fdf[_0xb6dd('0x4e')](_0x22b409);}})[_0xb6dd('0x28')](function(_0x3d9169){if(_0x3d9169){return _0x3d9169?{'count':_0x377fa8,'rows':_0x3d9169}:null;}})[_0xb6dd('0x28')](respondWithResult(_0x149e6e,null))[_0xb6dd('0x45')](handleError(_0x149e6e,null));};exports[_0xb6dd('0x4f')]=function(_0x3e5afe,_0x453bbc,_0x134334){var _0xe0a97={};var _0x4d7555={};var _0x261052;var _0x4c7078;return db[_0xb6dd('0x2e')][_0xb6dd('0x4a')]({'where':{'id':_0x3e5afe[_0xb6dd('0x42')]['id']}})[_0xb6dd('0x28')](handleEntityNotFound(_0x453bbc,null))[_0xb6dd('0x28')](function(_0x106274){if(_0x106274){_0x261052=_0x106274;_0x4d7555[_0xb6dd('0x31')]=_[_0xb6dd('0x32')](db['FreshsalesField']['rawAttributes']);_0x4d7555[_0xb6dd('0x33')]=_[_0xb6dd('0x32')](_0x3e5afe['query']);_0x4d7555[_0xb6dd('0x3c')]=_[_0xb6dd('0x34')](_0x4d7555[_0xb6dd('0x31')],_0x4d7555['query']);_0xe0a97[_0xb6dd('0x35')]=_['intersection'](_0x4d7555[_0xb6dd('0x31')],qs[_0xb6dd('0x36')](_0x3e5afe[_0xb6dd('0x33')][_0xb6dd('0x36')]));_0xe0a97[_0xb6dd('0x35')]=_0xe0a97[_0xb6dd('0x35')][_0xb6dd('0x37')]?_0xe0a97['attributes']:_0x4d7555['model'];_0xe0a97['order']=qs[_0xb6dd('0x3a')](_0x3e5afe[_0xb6dd('0x33')][_0xb6dd('0x3a')]);_0xe0a97[_0xb6dd('0x3b')]=qs['filters'](_['pick'](_0x3e5afe['query'],_0x4d7555['filters']));if(_0x3e5afe['query'][_0xb6dd('0x3e')]){_0xe0a97['where']=_[_0xb6dd('0x3f')](_0xe0a97[_0xb6dd('0x3b')],{'$or':_[_0xb6dd('0x2d')](_0xe0a97[_0xb6dd('0x35')],function(_0x20dcb8){var _0x69185f={};_0x69185f[_0x20dcb8]={'$like':'%'+_0x3e5afe['query'][_0xb6dd('0x3e')]+'%'};return _0x69185f;})});}_0xe0a97=_[_0xb6dd('0x3f')]({},_0xe0a97,_0x3e5afe[_0xb6dd('0x40')]);return _0x261052[_0xb6dd('0x4f')](_0xe0a97);}})[_0xb6dd('0x28')](function(_0x1359c2){if(_0x1359c2){_0x4c7078=_0x1359c2[_0xb6dd('0x37')];if(!_0x3e5afe[_0xb6dd('0x33')][_0xb6dd('0x38')]('nolimit')){_0xe0a97['limit']=qs['limit'](_0x3e5afe['query'][_0xb6dd('0x21')]);_0xe0a97[_0xb6dd('0x1e')]=qs[_0xb6dd('0x1e')](_0x3e5afe[_0xb6dd('0x33')][_0xb6dd('0x1e')]);}return _0x261052[_0xb6dd('0x4f')](_0xe0a97);}})[_0xb6dd('0x28')](function(_0x46bcab){if(_0x46bcab){return _0x46bcab?{'count':_0x4c7078,'rows':_0x46bcab}:null;}})[_0xb6dd('0x28')](respondWithResult(_0x453bbc,null))['catch'](handleError(_0x453bbc,null));};
\ No newline at end of file
index bf789c9..76e725d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d7f=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x25410b,_0x13a5d){var _0x4cbbcd=function(_0x5f459d){while(--_0x5f459d){_0x25410b['push'](_0x25410b['shift']());}};_0x4cbbcd(++_0x13a5d);}(_0x7d7f,0x138));var _0xf7d7=function(_0x268d82,_0x46f06a){_0x268d82=_0x268d82-0x0;var _0x3da554=_0x7d7f[_0x268d82];return _0x3da554;};'use strict';var _=require(_0xf7d7('0x0'));var util=require('util');var logger=require(_0xf7d7('0x1'))(_0xf7d7('0x2'));var moment=require('moment');var BPromise=require(_0xf7d7('0x3'));var rp=require(_0xf7d7('0x4'));var fs=require('fs');var path=require(_0xf7d7('0x5'));var rimraf=require(_0xf7d7('0x6'));var config=require(_0xf7d7('0x7'));var attributes=require(_0xf7d7('0x8'));module[_0xf7d7('0x9')]=function(_0xdea4f3,_0x1ffed1){return _0xdea4f3['define']('FreshsalesConfiguration',attributes,{'tableName':_0xf7d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebcf=['FreshsalesConfiguration','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x16f125,_0x359f0e){var _0x4f5dde=function(_0x1f2103){while(--_0x1f2103){_0x16f125['push'](_0x16f125['shift']());}};_0x4f5dde(++_0x359f0e);}(_0xebcf,0x13c));var _0xfebc=function(_0xdd11d6,_0x4550f4){_0xdd11d6=_0xdd11d6-0x0;var _0x3c3a6d=_0xebcf[_0xdd11d6];return _0x3c3a6d;};'use strict';var _=require('lodash');var util=require(_0xfebc('0x0'));var logger=require(_0xfebc('0x1'))('api');var moment=require(_0xfebc('0x2'));var BPromise=require(_0xfebc('0x3'));var rp=require(_0xfebc('0x4'));var fs=require('fs');var path=require(_0xfebc('0x5'));var rimraf=require(_0xfebc('0x6'));var config=require('../../config/environment');var attributes=require(_0xfebc('0x7'));module['exports']=function(_0x3f0c35,_0x13ea3c){return _0x3f0c35['define'](_0xfebc('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5d48d61..c3c5558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd409=['http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4e8b41,_0xfaae0a){var _0x5b522f=function(_0x186b95){while(--_0x186b95){_0x4e8b41['push'](_0x4e8b41['shift']());}};_0x5b522f(++_0xfaae0a);}(_0xd409,0x180));var _0x9d40=function(_0x5d1d6c,_0x8c94ff){_0x5d1d6c=_0x5d1d6c-0x0;var _0x3f4b02=_0xd409[_0x5d1d6c];return _0x3f4b02;};'use strict';var _=require(_0x9d40('0x0'));var util=require(_0x9d40('0x1'));var moment=require(_0x9d40('0x2'));var BPromise=require(_0x9d40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d40('0x4'));var db=require(_0x9d40('0x5'))['db'];var utils=require(_0x9d40('0x6'));var logger=require(_0x9d40('0x7'))(_0x9d40('0x8'));var config=require(_0x9d40('0x9'));var jayson=require(_0x9d40('0xa'));var client=jayson[_0x9d40('0xb')][_0x9d40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x332195,_0x9857dc,_0x18e882){return new BPromise(function(_0x203ea1,_0x5f2e18){return client[_0x9d40('0xd')](_0x332195,_0x18e882)['then'](function(_0x5d73bb){logger[_0x9d40('0xe')](_0x9d40('0xf'),_0x9857dc,'request\x20sent');logger[_0x9d40('0x10')](_0x9d40('0x11'),_0x9857dc,'request\x20sent',JSON['stringify'](_0x5d73bb));if(_0x5d73bb[_0x9d40('0x12')]){if(_0x5d73bb['error'][_0x9d40('0x13')]===0x1f4){logger[_0x9d40('0x12')](_0x9d40('0xf'),_0x9857dc,_0x5d73bb[_0x9d40('0x12')][_0x9d40('0x14')]);return _0x5f2e18(_0x5d73bb['error'][_0x9d40('0x14')]);}logger['error'](_0x9d40('0xf'),_0x9857dc,_0x5d73bb[_0x9d40('0x12')][_0x9d40('0x14')]);return _0x203ea1(_0x5d73bb['error'][_0x9d40('0x14')]);}else{logger[_0x9d40('0xe')](_0x9d40('0xf'),_0x9857dc,_0x9d40('0x15'));_0x203ea1(_0x5d73bb['result'][_0x9d40('0x14')]);}})['catch'](function(_0x5c8c33){logger[_0x9d40('0x12')](_0x9d40('0xf'),_0x9857dc,_0x5c8c33);_0x5f2e18(_0x5c8c33);});});}
\ No newline at end of file
+var _0x3e3c=['request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e1b8a,_0x5c2c4c){var _0x183fcf=function(_0x15fc0d){while(--_0x15fc0d){_0x1e1b8a['push'](_0x1e1b8a['shift']());}};_0x183fcf(++_0x5c2c4c);}(_0x3e3c,0xb9));var _0xc3e3=function(_0x1a799a,_0x10f98f){_0x1a799a=_0x1a799a-0x0;var _0x2e6ae7=_0x3e3c[_0x1a799a];return _0x2e6ae7;};'use strict';var _=require(_0xc3e3('0x0'));var util=require(_0xc3e3('0x1'));var moment=require(_0xc3e3('0x2'));var BPromise=require(_0xc3e3('0x3'));var rs=require(_0xc3e3('0x4'));var fs=require('fs');var Redis=require(_0xc3e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3e3('0x6'));var logger=require(_0xc3e3('0x7'))(_0xc3e3('0x8'));var config=require(_0xc3e3('0x9'));var jayson=require(_0xc3e3('0xa'));var client=jayson[_0xc3e3('0xb')][_0xc3e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5c0a,_0x5a78e2,_0x441a41){return new BPromise(function(_0xb64c51,_0x235379){return client[_0xc3e3('0xd')](_0x5a5c0a,_0x441a41)['then'](function(_0x9edd9e){logger['info'](_0xc3e3('0xe'),_0x5a78e2,_0xc3e3('0xf'));logger['debug'](_0xc3e3('0x10'),_0x5a78e2,_0xc3e3('0xf'),JSON['stringify'](_0x9edd9e));if(_0x9edd9e[_0xc3e3('0x11')]){if(_0x9edd9e['error'][_0xc3e3('0x12')]===0x1f4){logger['error'](_0xc3e3('0xe'),_0x5a78e2,_0x9edd9e[_0xc3e3('0x11')]['message']);return _0x235379(_0x9edd9e[_0xc3e3('0x11')][_0xc3e3('0x13')]);}logger[_0xc3e3('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a78e2,_0x9edd9e[_0xc3e3('0x11')][_0xc3e3('0x13')]);return _0xb64c51(_0x9edd9e[_0xc3e3('0x11')]['message']);}else{logger['info'](_0xc3e3('0xe'),_0x5a78e2,'request\x20sent');_0xb64c51(_0x9edd9e[_0xc3e3('0x14')][_0xc3e3('0x13')]);}})[_0xc3e3('0x15')](function(_0x259379){logger[_0xc3e3('0x11')](_0xc3e3('0xe'),_0x5a78e2,_0x259379);_0x235379(_0x259379);});});}
\ No newline at end of file
index 01a39f8..a0f740e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc30d=['Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x33bb5d,_0x5b816f){var _0x234246=function(_0xc2d8cc){while(--_0xc2d8cc){_0x33bb5d['push'](_0x33bb5d['shift']());}};_0x234246(++_0x5b816f);}(_0xc30d,0x6e));var _0xdc30=function(_0x48f011,_0x4f4a87){_0x48f011=_0x48f011-0x0;var _0x47824e=_0xc30d[_0x48f011];return _0x47824e;};'use strict';var multer=require(_0xdc30('0x0'));var util=require('util');var path=require(_0xdc30('0x1'));var timeout=require(_0xdc30('0x2'));var express=require(_0xdc30('0x3'));var router=express[_0xdc30('0x4')]();var fs_extra=require(_0xdc30('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc30('0x6'));var config=require('../../config/environment');var controller=require(_0xdc30('0x7'));router[_0xdc30('0x8')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xa')]);router[_0xdc30('0x8')](_0xdc30('0xb'),auth['isAuthenticated'](),controller[_0xdc30('0xc')]);router[_0xdc30('0xd')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xe')]);router[_0xdc30('0xf')](_0xdc30('0xb'),auth[_0xdc30('0x9')](),controller[_0xdc30('0x10')]);router[_0xdc30('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc30('0x12')]=router;
\ No newline at end of file
+var _0xbe45=['../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ac562,_0x270a2d){var _0x483610=function(_0x1eb389){while(--_0x1eb389){_0x1ac562['push'](_0x1ac562['shift']());}};_0x483610(++_0x270a2d);}(_0xbe45,0xf0));var _0x5be4=function(_0x187f74,_0x17f9aa){_0x187f74=_0x187f74-0x0;var _0x113d9c=_0xbe45[_0x187f74];return _0x113d9c;};'use strict';var multer=require(_0x5be4('0x0'));var util=require(_0x5be4('0x1'));var path=require('path');var timeout=require(_0x5be4('0x2'));var express=require(_0x5be4('0x3'));var router=express[_0x5be4('0x4')]();var fs_extra=require(_0x5be4('0x5'));var auth=require(_0x5be4('0x6'));var interaction=require(_0x5be4('0x7'));var config=require('../../config/environment');var controller=require(_0x5be4('0x8'));router[_0x5be4('0x9')]('/',auth[_0x5be4('0xa')](),controller[_0x5be4('0xb')]);router[_0x5be4('0x9')](_0x5be4('0xc'),auth[_0x5be4('0xa')](),controller[_0x5be4('0xd')]);router[_0x5be4('0xe')]('/',auth[_0x5be4('0xa')](),controller[_0x5be4('0xf')]);router[_0x5be4('0x10')](_0x5be4('0xc'),auth['isAuthenticated'](),controller[_0x5be4('0x11')]);router['delete']('/:id',auth[_0x5be4('0xa')](),controller['destroy']);module[_0x5be4('0x12')]=router;
\ No newline at end of file
index ded58cb..5b33ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c8b=['STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x30af3c,_0x23a2ef){var _0x5b028f=function(_0x3505a4){while(--_0x3505a4){_0x30af3c['push'](_0x30af3c['shift']());}};_0x5b028f(++_0x23a2ef);}(_0x4c8b,0x112));var _0xb4c8=function(_0x1e613e,_0x43b07e){_0x1e613e=_0x1e613e-0x0;var _0x20d9a9=_0x4c8b[_0x1e613e];return _0x20d9a9;};'use strict';var Sequelize=require(_0xb4c8('0x0'));module[_0xb4c8('0x1')]={'type':{'type':Sequelize[_0xb4c8('0x2')](_0xb4c8('0x3'),_0xb4c8('0x4'),_0xb4c8('0x5'),'keyValue','picklist'),'defaultValue':_0xb4c8('0x3')},'content':{'type':Sequelize[_0xb4c8('0x6')]},'key':{'type':Sequelize[_0xb4c8('0x6')]},'keyType':{'type':Sequelize[_0xb4c8('0x2')](_0xb4c8('0x3'),_0xb4c8('0x4'),_0xb4c8('0x5'))},'keyContent':{'type':Sequelize[_0xb4c8('0x6')]},'idField':{'type':Sequelize[_0xb4c8('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb4c8('0x6')]}};
\ No newline at end of file
+var _0x05dc=['ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN','exports'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x05dc,0xff));var _0xc05d=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x05dc[_0x188d31];return _0x30ed33;};'use strict';var Sequelize=require('sequelize');module[_0xc05d('0x0')]={'type':{'type':Sequelize[_0xc05d('0x1')]('string',_0xc05d('0x2'),_0xc05d('0x3'),'keyValue',_0xc05d('0x4')),'defaultValue':_0xc05d('0x5')},'content':{'type':Sequelize[_0xc05d('0x6')]},'key':{'type':Sequelize[_0xc05d('0x6')]},'keyType':{'type':Sequelize[_0xc05d('0x1')](_0xc05d('0x5'),_0xc05d('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc05d('0x6')]},'idField':{'type':Sequelize[_0xc05d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc05d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc05d('0x6')]}};
\ No newline at end of file
index 1f62a22..babdda8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a42=['options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','end','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','sort','pick','filter','where'];(function(_0x2a875a,_0x3eba20){var _0x157b00=function(_0x164be4){while(--_0x164be4){_0x2a875a['push'](_0x2a875a['shift']());}};_0x157b00(++_0x3eba20);}(_0x2a42,0x174));var _0x22a4=function(_0x43876c,_0x2e75fe){_0x43876c=_0x43876c-0x0;var _0x162267=_0x2a42[_0x43876c];return _0x162267;};'use strict';var emlformat=require(_0x22a4('0x0'));var rimraf=require(_0x22a4('0x1'));var zipdir=require(_0x22a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22a4('0x3'));var moment=require('moment');var BPromise=require(_0x22a4('0x4'));var Mustache=require(_0x22a4('0x5'));var util=require(_0x22a4('0x6'));var path=require(_0x22a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x22a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x22a4('0x9'));var squel=require(_0x22a4('0xa'));var crypto=require(_0x22a4('0xb'));var jsforce=require(_0x22a4('0xc'));var deskjs=require(_0x22a4('0xd'));var toCsv=require(_0x22a4('0xe'));var querystring=require('querystring');var Papa=require(_0x22a4('0xf'));var Redis=require(_0x22a4('0x10'));var authService=require(_0x22a4('0x11'));var qs=require(_0x22a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22a4('0x13'));var logger=require(_0x22a4('0x14'))(_0x22a4('0x15'));var utils=require(_0x22a4('0x16'));var config=require(_0x22a4('0x17'));var licenseUtil=require(_0x22a4('0x18'));var db=require(_0x22a4('0x19'))['db'];function respondWithStatusCode(_0x1a1647,_0x961cce){_0x961cce=_0x961cce||0xcc;return function(_0x2a25e0){if(_0x2a25e0){return _0x1a1647[_0x22a4('0x1a')](_0x961cce);}return _0x1a1647[_0x22a4('0x1b')](_0x961cce)['end']();};}function respondWithResult(_0x5c4940,_0x5df989){_0x5df989=_0x5df989||0xc8;return function(_0xb8cf55){if(_0xb8cf55){return _0x5c4940[_0x22a4('0x1b')](_0x5df989)[_0x22a4('0x1c')](_0xb8cf55);}};}function respondWithFilteredResult(_0x28dde0,_0x4b53ae){return function(_0x12d46c){if(_0x12d46c){var _0x18e139=typeof _0x4b53ae[_0x22a4('0x1d')]===_0x22a4('0x1e')&&typeof _0x4b53ae[_0x22a4('0x1f')]==='undefined';var _0x308ab0=_0x12d46c[_0x22a4('0x20')];var _0x1d28cb=_0x18e139?0x0:_0x4b53ae[_0x22a4('0x1d')];var _0x2c9fe9=_0x18e139?_0x12d46c[_0x22a4('0x20')]:_0x4b53ae[_0x22a4('0x1d')]+_0x4b53ae[_0x22a4('0x1f')];var _0xea91ba;if(_0x2c9fe9>=_0x308ab0){_0x2c9fe9=_0x308ab0;_0xea91ba=0xc8;}else{_0xea91ba=0xce;}_0x28dde0[_0x22a4('0x1b')](_0xea91ba);return _0x28dde0[_0x22a4('0x21')]('Content-Range',_0x1d28cb+'-'+_0x2c9fe9+'/'+_0x308ab0)['json'](_0x12d46c);}return null;};}function patchUpdates(_0x35b354){return function(_0x5931fb){try{jsonpatch['apply'](_0x5931fb,_0x35b354,!![]);}catch(_0x15ff4c){return BPromise[_0x22a4('0x22')](_0x15ff4c);}return _0x5931fb[_0x22a4('0x23')]();};}function saveUpdates(_0x1b1d9e,_0x358ad2){return function(_0x4533ee){if(_0x4533ee){return _0x4533ee[_0x22a4('0x24')](_0x1b1d9e)['then'](function(_0x6b1dd0){return _0x6b1dd0;});}return null;};}function removeEntity(_0x3a32cf,_0x553540){return function(_0x5a2a68){if(_0x5a2a68){return _0x5a2a68[_0x22a4('0x25')]()[_0x22a4('0x26')](function(){_0x3a32cf[_0x22a4('0x1b')](0xcc)[_0x22a4('0x27')]();});}};}function handleEntityNotFound(_0x7b34a8,_0x4734c8){return function(_0x1d66d9){if(!_0x1d66d9){_0x7b34a8[_0x22a4('0x1a')](0x194);}return _0x1d66d9;};}function handleError(_0x41b7bf,_0x18206f){_0x18206f=_0x18206f||0x1f4;return function(_0x53b11b){logger['error'](_0x53b11b['stack']);if(_0x53b11b[_0x22a4('0x28')]){delete _0x53b11b['name'];}_0x41b7bf[_0x22a4('0x1b')](_0x18206f)[_0x22a4('0x29')](_0x53b11b);};}exports[_0x22a4('0x2a')]=function(_0x2d9af9,_0x186a4d){var _0x1e94c7={},_0x3e3f47={},_0x5606d4={'count':0x0,'rows':[]};var _0x5ba4c3=_[_0x22a4('0x2b')](db[_0x22a4('0x2c')][_0x22a4('0x2d')],function(_0x583224){return{'name':_0x583224[_0x22a4('0x2e')],'type':_0x583224[_0x22a4('0x2f')][_0x22a4('0x30')]};});_0x3e3f47[_0x22a4('0x31')]=_['map'](_0x5ba4c3,_0x22a4('0x28'));_0x3e3f47[_0x22a4('0x32')]=_['keys'](_0x2d9af9[_0x22a4('0x32')]);_0x3e3f47[_0x22a4('0x33')]=_['intersection'](_0x3e3f47[_0x22a4('0x31')],_0x3e3f47[_0x22a4('0x32')]);_0x1e94c7[_0x22a4('0x34')]=_[_0x22a4('0x35')](_0x3e3f47['model'],qs['fields'](_0x2d9af9[_0x22a4('0x32')][_0x22a4('0x36')]));_0x1e94c7[_0x22a4('0x34')]=_0x1e94c7[_0x22a4('0x34')][_0x22a4('0x37')]?_0x1e94c7[_0x22a4('0x34')]:_0x3e3f47[_0x22a4('0x31')];if(!_0x2d9af9[_0x22a4('0x32')]['hasOwnProperty']('nolimit')){_0x1e94c7['limit']=qs[_0x22a4('0x1f')](_0x2d9af9[_0x22a4('0x32')][_0x22a4('0x1f')]);_0x1e94c7['offset']=qs[_0x22a4('0x1d')](_0x2d9af9[_0x22a4('0x32')]['offset']);}_0x1e94c7['order']=qs[_0x22a4('0x38')](_0x2d9af9['query'][_0x22a4('0x38')]);_0x1e94c7['where']=qs[_0x22a4('0x33')](_[_0x22a4('0x39')](_0x2d9af9[_0x22a4('0x32')],_0x3e3f47[_0x22a4('0x33')]),_0x5ba4c3);if(_0x2d9af9[_0x22a4('0x32')][_0x22a4('0x3a')]){_0x1e94c7[_0x22a4('0x3b')]=_['merge'](_0x1e94c7[_0x22a4('0x3b')],{'$or':_['map'](_0x5ba4c3,function(_0x3fa076){if(_0x3fa076[_0x22a4('0x2f')]!=='VIRTUAL'){var _0x10388e={};_0x10388e[_0x3fa076['name']]={'$like':'%'+_0x2d9af9[_0x22a4('0x32')]['filter']+'%'};return _0x10388e;}})});}_0x1e94c7=_['merge']({},_0x1e94c7,_0x2d9af9[_0x22a4('0x3c')]);var _0x59ef55={'where':_0x1e94c7[_0x22a4('0x3b')]};return db[_0x22a4('0x2c')][_0x22a4('0x20')](_0x59ef55)[_0x22a4('0x26')](function(_0x44624a){_0x5606d4[_0x22a4('0x20')]=_0x44624a;if(_0x2d9af9[_0x22a4('0x32')][_0x22a4('0x3d')]){_0x1e94c7[_0x22a4('0x3e')]=[{'all':!![]}];}return db[_0x22a4('0x2c')][_0x22a4('0x3f')](_0x1e94c7);})[_0x22a4('0x26')](function(_0xb02568){_0x5606d4[_0x22a4('0x40')]=_0xb02568;return _0x5606d4;})[_0x22a4('0x26')](respondWithFilteredResult(_0x186a4d,_0x1e94c7))[_0x22a4('0x41')](handleError(_0x186a4d,null));};exports[_0x22a4('0x42')]=function(_0xc1e925,_0x42a98b){var _0x4f0dd2={'raw':!![],'where':{'id':_0xc1e925[_0x22a4('0x43')]['id']}},_0x40167a={};_0x40167a['model']=_[_0x22a4('0x44')](db[_0x22a4('0x2c')][_0x22a4('0x2d')]);_0x40167a[_0x22a4('0x32')]=_[_0x22a4('0x44')](_0xc1e925['query']);_0x40167a['filters']=_[_0x22a4('0x35')](_0x40167a[_0x22a4('0x31')],_0x40167a[_0x22a4('0x32')]);_0x4f0dd2[_0x22a4('0x34')]=_[_0x22a4('0x35')](_0x40167a[_0x22a4('0x31')],qs[_0x22a4('0x36')](_0xc1e925[_0x22a4('0x32')]['fields']));_0x4f0dd2[_0x22a4('0x34')]=_0x4f0dd2[_0x22a4('0x34')][_0x22a4('0x37')]?_0x4f0dd2[_0x22a4('0x34')]:_0x40167a[_0x22a4('0x31')];if(_0xc1e925[_0x22a4('0x32')][_0x22a4('0x3d')]){_0x4f0dd2[_0x22a4('0x3e')]=[{'all':!![]}];}_0x4f0dd2=_['merge']({},_0x4f0dd2,_0xc1e925['options']);return db[_0x22a4('0x2c')][_0x22a4('0x45')](_0x4f0dd2)[_0x22a4('0x26')](handleEntityNotFound(_0x42a98b,null))[_0x22a4('0x26')](respondWithResult(_0x42a98b,null))['catch'](handleError(_0x42a98b,null));};exports[_0x22a4('0x46')]=function(_0x3b0f83,_0x3a54d1){return db[_0x22a4('0x2c')][_0x22a4('0x46')](_0x3b0f83['body'],{})['then'](respondWithResult(_0x3a54d1,0xc9))['catch'](handleError(_0x3a54d1,null));};exports['update']=function(_0x4cc111,_0x2ef066){if(_0x4cc111['body']['id']){delete _0x4cc111[_0x22a4('0x47')]['id'];}return db[_0x22a4('0x2c')]['find']({'where':{'id':_0x4cc111[_0x22a4('0x43')]['id']}})[_0x22a4('0x26')](handleEntityNotFound(_0x2ef066,null))[_0x22a4('0x26')](saveUpdates(_0x4cc111['body'],null))[_0x22a4('0x26')](respondWithResult(_0x2ef066,null))[_0x22a4('0x41')](handleError(_0x2ef066,null));};exports[_0x22a4('0x25')]=function(_0x5df6dc,_0x3ae4cf){return db[_0x22a4('0x2c')][_0x22a4('0x45')]({'where':{'id':_0x5df6dc[_0x22a4('0x43')]['id']}})[_0x22a4('0x26')](handleEntityNotFound(_0x3ae4cf,null))['then'](removeEntity(_0x3ae4cf,null))['catch'](handleError(_0x3ae4cf,null));};
\ No newline at end of file
+var _0x25cd=['../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x43dd40,_0x431145){var _0x200de4=function(_0x2d485b){while(--_0x2d485b){_0x43dd40['push'](_0x43dd40['shift']());}};_0x200de4(++_0x431145);}(_0x25cd,0xc5));var _0xd25c=function(_0x42eee6,_0x35f745){_0x42eee6=_0x42eee6-0x0;var _0x4981dd=_0x25cd[_0x42eee6];return _0x4981dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd25c('0x0'));var zipdir=require(_0xd25c('0x1'));var jsonpatch=require(_0xd25c('0x2'));var rp=require('request-promise');var moment=require(_0xd25c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd25c('0x4'));var util=require('util');var path=require(_0xd25c('0x5'));var sox=require(_0xd25c('0x6'));var csv=require(_0xd25c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd25c('0x8'));var _=require(_0xd25c('0x9'));var squel=require(_0xd25c('0xa'));var crypto=require(_0xd25c('0xb'));var jsforce=require(_0xd25c('0xc'));var deskjs=require(_0xd25c('0xd'));var toCsv=require(_0xd25c('0x7'));var querystring=require(_0xd25c('0xe'));var Papa=require(_0xd25c('0xf'));var Redis=require(_0xd25c('0x10'));var authService=require(_0xd25c('0x11'));var qs=require(_0xd25c('0x12'));var as=require(_0xd25c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd25c('0x14'))('api');var utils=require(_0xd25c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd25c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf7bb9,_0x2b8dbb){_0x2b8dbb=_0x2b8dbb||0xcc;return function(_0x4825b1){if(_0x4825b1){return _0xcf7bb9['sendStatus'](_0x2b8dbb);}return _0xcf7bb9[_0xd25c('0x17')](_0x2b8dbb)[_0xd25c('0x18')]();};}function respondWithResult(_0x1abe0f,_0x7e58d2){_0x7e58d2=_0x7e58d2||0xc8;return function(_0x4a7119){if(_0x4a7119){return _0x1abe0f['status'](_0x7e58d2)[_0xd25c('0x19')](_0x4a7119);}};}function respondWithFilteredResult(_0x178365,_0x2f49bb){return function(_0x5075a5){if(_0x5075a5){var _0x41530a=typeof _0x2f49bb['offset']===_0xd25c('0x1a')&&typeof _0x2f49bb['limit']===_0xd25c('0x1a');var _0x59d583=_0x5075a5[_0xd25c('0x1b')];var _0x59c320=_0x41530a?0x0:_0x2f49bb[_0xd25c('0x1c')];var _0x535ceb=_0x41530a?_0x5075a5[_0xd25c('0x1b')]:_0x2f49bb[_0xd25c('0x1c')]+_0x2f49bb[_0xd25c('0x1d')];var _0x2281be;if(_0x535ceb>=_0x59d583){_0x535ceb=_0x59d583;_0x2281be=0xc8;}else{_0x2281be=0xce;}_0x178365[_0xd25c('0x17')](_0x2281be);return _0x178365[_0xd25c('0x1e')](_0xd25c('0x1f'),_0x59c320+'-'+_0x535ceb+'/'+_0x59d583)['json'](_0x5075a5);}return null;};}function patchUpdates(_0x1c8efa){return function(_0x55f8d5){try{jsonpatch[_0xd25c('0x20')](_0x55f8d5,_0x1c8efa,!![]);}catch(_0x5e8c86){return BPromise[_0xd25c('0x21')](_0x5e8c86);}return _0x55f8d5[_0xd25c('0x22')]();};}function saveUpdates(_0x4556d5,_0x157cc1){return function(_0x3e0608){if(_0x3e0608){return _0x3e0608['update'](_0x4556d5)[_0xd25c('0x23')](function(_0x42f14c){return _0x42f14c;});}return null;};}function removeEntity(_0x429cb3,_0x4d42bc){return function(_0x400e58){if(_0x400e58){return _0x400e58['destroy']()[_0xd25c('0x23')](function(){_0x429cb3[_0xd25c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x584997,_0x30e6b6){return function(_0x156368){if(!_0x156368){_0x584997['sendStatus'](0x194);}return _0x156368;};}function handleError(_0x8a70fd,_0x2b8f47){_0x2b8f47=_0x2b8f47||0x1f4;return function(_0x417fd1){logger['error'](_0x417fd1[_0xd25c('0x24')]);if(_0x417fd1[_0xd25c('0x25')]){delete _0x417fd1[_0xd25c('0x25')];}_0x8a70fd[_0xd25c('0x17')](_0x2b8f47)[_0xd25c('0x26')](_0x417fd1);};}exports[_0xd25c('0x27')]=function(_0xed218b,_0x85fb8a){var _0x2f133f={},_0xb3afcb={},_0x3264e6={'count':0x0,'rows':[]};var _0x6eac78=_[_0xd25c('0x28')](db[_0xd25c('0x29')][_0xd25c('0x2a')],function(_0x5515db){return{'name':_0x5515db[_0xd25c('0x2b')],'type':_0x5515db[_0xd25c('0x2c')][_0xd25c('0x2d')]};});_0xb3afcb[_0xd25c('0x2e')]=_[_0xd25c('0x28')](_0x6eac78,_0xd25c('0x25'));_0xb3afcb[_0xd25c('0x2f')]=_[_0xd25c('0x30')](_0xed218b[_0xd25c('0x2f')]);_0xb3afcb['filters']=_[_0xd25c('0x31')](_0xb3afcb[_0xd25c('0x2e')],_0xb3afcb[_0xd25c('0x2f')]);_0x2f133f[_0xd25c('0x32')]=_[_0xd25c('0x31')](_0xb3afcb[_0xd25c('0x2e')],qs[_0xd25c('0x33')](_0xed218b[_0xd25c('0x2f')]['fields']));_0x2f133f['attributes']=_0x2f133f[_0xd25c('0x32')]['length']?_0x2f133f[_0xd25c('0x32')]:_0xb3afcb[_0xd25c('0x2e')];if(!_0xed218b[_0xd25c('0x2f')]['hasOwnProperty'](_0xd25c('0x34'))){_0x2f133f[_0xd25c('0x1d')]=qs[_0xd25c('0x1d')](_0xed218b[_0xd25c('0x2f')][_0xd25c('0x1d')]);_0x2f133f['offset']=qs[_0xd25c('0x1c')](_0xed218b[_0xd25c('0x2f')][_0xd25c('0x1c')]);}_0x2f133f[_0xd25c('0x35')]=qs['sort'](_0xed218b[_0xd25c('0x2f')][_0xd25c('0x36')]);_0x2f133f[_0xd25c('0x37')]=qs[_0xd25c('0x38')](_['pick'](_0xed218b[_0xd25c('0x2f')],_0xb3afcb[_0xd25c('0x38')]),_0x6eac78);if(_0xed218b[_0xd25c('0x2f')][_0xd25c('0x39')]){_0x2f133f['where']=_['merge'](_0x2f133f[_0xd25c('0x37')],{'$or':_['map'](_0x6eac78,function(_0x45fffc){if(_0x45fffc['type']!==_0xd25c('0x3a')){var _0x11693e={};_0x11693e[_0x45fffc[_0xd25c('0x25')]]={'$like':'%'+_0xed218b[_0xd25c('0x2f')]['filter']+'%'};return _0x11693e;}})});}_0x2f133f=_[_0xd25c('0x3b')]({},_0x2f133f,_0xed218b[_0xd25c('0x3c')]);var _0x537b4a={'where':_0x2f133f['where']};return db[_0xd25c('0x29')]['count'](_0x537b4a)['then'](function(_0x40a921){_0x3264e6['count']=_0x40a921;if(_0xed218b[_0xd25c('0x2f')][_0xd25c('0x3d')]){_0x2f133f[_0xd25c('0x3e')]=[{'all':!![]}];}return db[_0xd25c('0x29')][_0xd25c('0x3f')](_0x2f133f);})[_0xd25c('0x23')](function(_0x5e7c64){_0x3264e6[_0xd25c('0x40')]=_0x5e7c64;return _0x3264e6;})[_0xd25c('0x23')](respondWithFilteredResult(_0x85fb8a,_0x2f133f))[_0xd25c('0x41')](handleError(_0x85fb8a,null));};exports[_0xd25c('0x42')]=function(_0x582d4b,_0xa7a0a1){var _0x20bc02={'raw':!![],'where':{'id':_0x582d4b[_0xd25c('0x43')]['id']}},_0x223c52={};_0x223c52[_0xd25c('0x2e')]=_['keys'](db['FreshsalesField'][_0xd25c('0x2a')]);_0x223c52[_0xd25c('0x2f')]=_[_0xd25c('0x30')](_0x582d4b[_0xd25c('0x2f')]);_0x223c52['filters']=_[_0xd25c('0x31')](_0x223c52[_0xd25c('0x2e')],_0x223c52['query']);_0x20bc02[_0xd25c('0x32')]=_[_0xd25c('0x31')](_0x223c52[_0xd25c('0x2e')],qs['fields'](_0x582d4b['query']['fields']));_0x20bc02[_0xd25c('0x32')]=_0x20bc02[_0xd25c('0x32')][_0xd25c('0x44')]?_0x20bc02[_0xd25c('0x32')]:_0x223c52['model'];if(_0x582d4b[_0xd25c('0x2f')][_0xd25c('0x3d')]){_0x20bc02['include']=[{'all':!![]}];}_0x20bc02=_[_0xd25c('0x3b')]({},_0x20bc02,_0x582d4b['options']);return db[_0xd25c('0x29')][_0xd25c('0x45')](_0x20bc02)['then'](handleEntityNotFound(_0xa7a0a1,null))[_0xd25c('0x23')](respondWithResult(_0xa7a0a1,null))[_0xd25c('0x41')](handleError(_0xa7a0a1,null));};exports[_0xd25c('0x46')]=function(_0x34d674,_0x316ccb){return db[_0xd25c('0x29')][_0xd25c('0x46')](_0x34d674[_0xd25c('0x47')],{})[_0xd25c('0x23')](respondWithResult(_0x316ccb,0xc9))['catch'](handleError(_0x316ccb,null));};exports[_0xd25c('0x48')]=function(_0x283328,_0x584559){if(_0x283328[_0xd25c('0x47')]['id']){delete _0x283328[_0xd25c('0x47')]['id'];}return db[_0xd25c('0x29')]['find']({'where':{'id':_0x283328[_0xd25c('0x43')]['id']}})[_0xd25c('0x23')](handleEntityNotFound(_0x584559,null))[_0xd25c('0x23')](saveUpdates(_0x283328[_0xd25c('0x47')],null))[_0xd25c('0x23')](respondWithResult(_0x584559,null))[_0xd25c('0x41')](handleError(_0x584559,null));};exports['destroy']=function(_0x453f51,_0x4dbbc1){return db['FreshsalesField']['find']({'where':{'id':_0x453f51[_0xd25c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4dbbc1,null))['then'](removeEntity(_0x4dbbc1,null))['catch'](handleError(_0x4dbbc1,null));};
\ No newline at end of file
index 22dfbec..f174de7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4171=['int_freshsales_fields','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FreshsalesField'];(function(_0x311d8c,_0x394ad2){var _0x4d4e34=function(_0x34d22d){while(--_0x34d22d){_0x311d8c['push'](_0x311d8c['shift']());}};_0x4d4e34(++_0x394ad2);}(_0x4171,0x6a));var _0x1417=function(_0x565238,_0x3561f1){_0x565238=_0x565238-0x0;var _0x47056b=_0x4171[_0x565238];return _0x47056b;};'use strict';var _=require('lodash');var util=require(_0x1417('0x0'));var logger=require(_0x1417('0x1'))(_0x1417('0x2'));var moment=require(_0x1417('0x3'));var BPromise=require(_0x1417('0x4'));var rp=require(_0x1417('0x5'));var fs=require('fs');var path=require(_0x1417('0x6'));var rimraf=require('rimraf');var config=require(_0x1417('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x1417('0x8')]=function(_0x51c955,_0x1d24e){return _0x51c955[_0x1417('0x9')](_0x1417('0xa'),attributes,{'tableName':_0x1417('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x1417('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb574=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','idField','FieldId','lodash','util'];(function(_0x1fb94f,_0x2812e7){var _0x2a1bd0=function(_0x591ce1){while(--_0x591ce1){_0x1fb94f['push'](_0x1fb94f['shift']());}};_0x2a1bd0(++_0x2812e7);}(_0xb574,0x106));var _0x4b57=function(_0xb2aa50,_0x107fd1){_0xb2aa50=_0xb2aa50-0x0;var _0x52f496=_0xb574[_0xb2aa50];return _0x52f496;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var logger=require('../../config/logger')(_0x4b57('0x2'));var moment=require(_0x4b57('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b57('0x4'));var fs=require('fs');var path=require(_0x4b57('0x5'));var rimraf=require(_0x4b57('0x6'));var config=require(_0x4b57('0x7'));var attributes=require(_0x4b57('0x8'));module['exports']=function(_0x4eb019,_0x1c97e5){return _0x4eb019['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x4b57('0x9'),_0x4b57('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 61f833c..f9575b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x329784,_0x89d4ad){var _0x219389=function(_0x43b4b8){while(--_0x43b4b8){_0x329784['push'](_0x329784['shift']());}};_0x219389(++_0x89d4ad);}(_0x4c60,0xc1));var _0x04c6=function(_0x4199ed,_0x4389df){_0x4199ed=_0x4199ed-0x0;var _0x52b62b=_0x4c60[_0x4199ed];return _0x52b62b;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x55f3dd,_0xf840a6){var _0x30101f=function(_0x495419){while(--_0x495419){_0x55f3dd['push'](_0x55f3dd['shift']());}};_0x30101f(++_0xf840a6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0x5fc3[_0x3b594b];return _0x1ea5f8;};'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')]('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('FreshsalesField,\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']('FreshsalesField,\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 17dd374..c3a07a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2079bd,_0x2fc8f2){var _0x274f77=function(_0x5c10d3){while(--_0x5c10d3){_0x2079bd['push'](_0x2079bd['shift']());}};_0x274f77(++_0x2fc8f2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _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(_0x2cfc2c,_0xd2c1f0){var _0x6a88f7=function(_0x56cf10){while(--_0x56cf10){_0x2cfc2c['push'](_0x2cfc2c['shift']());}};_0x6a88f7(++_0xd2c1f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 26787e4..7a80422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd959=['STRING','username','ENUM','integrationTab','sequelize','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xd959,0x94));var _0x9d95=function(_0x474d29,_0x5c3591){_0x474d29=_0x474d29-0x0;var _0x146d37=_0xd959[_0x474d29];return _0x146d37;};'use strict';var Sequelize=require(_0x9d95('0x0'));module[_0x9d95('0x1')]={'name':{'type':Sequelize[_0x9d95('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d95('0x2')],'unique':_0x9d95('0x3')},'remoteUri':{'type':Sequelize[_0x9d95('0x2')]},'password':{'type':Sequelize[_0x9d95('0x2')]},'clientId':{'type':Sequelize[_0x9d95('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x9d95('0x2')]},'serverUrl':{'type':Sequelize[_0x9d95('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x5'),'newTab'),'defaultValue':_0x9d95('0x5')}};
\ No newline at end of file
+var _0xb657=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x508794,_0x20e88c){var _0x2df96a=function(_0x355e29){while(--_0x355e29){_0x508794['push'](_0x508794['shift']());}};_0x2df96a(++_0x20e88c);}(_0xb657,0x150));var _0x7b65=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xb657[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x7b65('0x0'));module[_0x7b65('0x1')]={'name':{'type':Sequelize[_0x7b65('0x2')]},'description':{'type':Sequelize[_0x7b65('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x7b65('0x3')},'remoteUri':{'type':Sequelize[_0x7b65('0x2')]},'password':{'type':Sequelize[_0x7b65('0x2')]},'clientId':{'type':Sequelize[_0x7b65('0x2')]},'clientSecret':{'type':Sequelize[_0x7b65('0x2')]},'securityToken':{'type':Sequelize[_0x7b65('0x2')]},'serverUrl':{'type':Sequelize[_0x7b65('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7b65('0x4'),_0x7b65('0x5')),'defaultValue':_0x7b65('0x4')}};
\ No newline at end of file
index 9ec4974..f5403db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fe6=['../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','stack','map','SalesforceAccount','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','catch','show','params','include','options','find','create','body','update','getConfigurations','findOne','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','SalesforceConfiguration','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','ticketType','describe','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','email','textarea','remove','includes','label','custom','picklistValues','value','boolean','True','true','false','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x1fe6,0x65));var _0x61fe=function(_0x54aa55,_0x1ce03b){_0x54aa55=_0x54aa55-0x0;var _0x56a768=_0x1fe6[_0x54aa55];return _0x56a768;};'use strict';var emlformat=require(_0x61fe('0x0'));var rimraf=require(_0x61fe('0x1'));var zipdir=require(_0x61fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61fe('0x3'));var moment=require(_0x61fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61fe('0x5'));var util=require(_0x61fe('0x6'));var path=require(_0x61fe('0x7'));var sox=require(_0x61fe('0x8'));var csv=require(_0x61fe('0x9'));var ejs=require(_0x61fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61fe('0xb'));var squel=require(_0x61fe('0xc'));var crypto=require('crypto');var jsforce=require(_0x61fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x61fe('0x9'));var querystring=require(_0x61fe('0xe'));var Papa=require('papaparse');var Redis=require(_0x61fe('0xf'));var authService=require(_0x61fe('0x10'));var qs=require(_0x61fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x61fe('0x12'))(_0x61fe('0x13'));var utils=require(_0x61fe('0x14'));var config=require(_0x61fe('0x15'));var licenseUtil=require(_0x61fe('0x16'));var db=require(_0x61fe('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e6155,_0x3c0829){_0x3c0829=_0x3c0829||0xcc;return function(_0x46fe48){if(_0x46fe48){return _0x3e6155[_0x61fe('0x18')](_0x3c0829);}return _0x3e6155['status'](_0x3c0829)[_0x61fe('0x19')]();};}function respondWithResult(_0x43ec7f,_0x2caa5e){_0x2caa5e=_0x2caa5e||0xc8;return function(_0x3cf8f5){if(_0x3cf8f5){return _0x43ec7f[_0x61fe('0x1a')](_0x2caa5e)['json'](_0x3cf8f5);}};}function respondWithFilteredResult(_0x2f714e,_0x314c3e){return function(_0x3ca8db){if(_0x3ca8db){var _0x35d1cc=typeof _0x314c3e[_0x61fe('0x1b')]===_0x61fe('0x1c')&&typeof _0x314c3e[_0x61fe('0x1d')]===_0x61fe('0x1c');var _0x6bc465=_0x3ca8db[_0x61fe('0x1e')];var _0x38f00f=_0x35d1cc?0x0:_0x314c3e['offset'];var _0x59becf=_0x35d1cc?_0x3ca8db['count']:_0x314c3e['offset']+_0x314c3e[_0x61fe('0x1d')];var _0x3b93cf;if(_0x59becf>=_0x6bc465){_0x59becf=_0x6bc465;_0x3b93cf=0xc8;}else{_0x3b93cf=0xce;}_0x2f714e[_0x61fe('0x1a')](_0x3b93cf);return _0x2f714e[_0x61fe('0x1f')](_0x61fe('0x20'),_0x38f00f+'-'+_0x59becf+'/'+_0x6bc465)[_0x61fe('0x21')](_0x3ca8db);}return null;};}function patchUpdates(_0x6ae754){return function(_0x1c0e8a){try{jsonpatch[_0x61fe('0x22')](_0x1c0e8a,_0x6ae754,!![]);}catch(_0x4aa2df){return BPromise['reject'](_0x4aa2df);}return _0x1c0e8a['save']();};}function saveUpdates(_0x2af5a2,_0x556c76){return function(_0x3eae47){if(_0x3eae47){return _0x3eae47['update'](_0x2af5a2)[_0x61fe('0x23')](function(_0x51ebc0){return _0x51ebc0;});}return null;};}function removeEntity(_0x1f088d,_0x4910b7){return function(_0x84043e){if(_0x84043e){return _0x84043e[_0x61fe('0x24')]()[_0x61fe('0x23')](function(){_0x1f088d[_0x61fe('0x1a')](0xcc)[_0x61fe('0x19')]();});}};}function handleEntityNotFound(_0x1706b3,_0x231d4a){return function(_0x174cfc){if(!_0x174cfc){_0x1706b3[_0x61fe('0x18')](0x194);}return _0x174cfc;};}function handleError(_0x1cd582,_0xfa6704){_0xfa6704=_0xfa6704||0x1f4;return function(_0x55eb7c){logger['error'](_0x55eb7c[_0x61fe('0x25')]);if(_0x55eb7c['name']){delete _0x55eb7c['name'];}_0x1cd582[_0x61fe('0x1a')](_0xfa6704)['send'](_0x55eb7c);};}exports['index']=function(_0x4b678a,_0x3e708f){var _0xb7a8fd={},_0x2f1bb4={},_0x483f82={'count':0x0,'rows':[]};var _0x3ab153=_[_0x61fe('0x26')](db[_0x61fe('0x27')][_0x61fe('0x28')],function(_0x1fff15){return{'name':_0x1fff15['fieldName'],'type':_0x1fff15[_0x61fe('0x29')][_0x61fe('0x2a')]};});_0x2f1bb4[_0x61fe('0x2b')]=_[_0x61fe('0x26')](_0x3ab153,_0x61fe('0x2c'));_0x2f1bb4[_0x61fe('0x2d')]=_[_0x61fe('0x2e')](_0x4b678a[_0x61fe('0x2d')]);_0x2f1bb4[_0x61fe('0x2f')]=_['intersection'](_0x2f1bb4['model'],_0x2f1bb4[_0x61fe('0x2d')]);_0xb7a8fd[_0x61fe('0x30')]=_[_0x61fe('0x31')](_0x2f1bb4[_0x61fe('0x2b')],qs[_0x61fe('0x32')](_0x4b678a[_0x61fe('0x2d')][_0x61fe('0x32')]));_0xb7a8fd['attributes']=_0xb7a8fd['attributes'][_0x61fe('0x33')]?_0xb7a8fd['attributes']:_0x2f1bb4['model'];if(!_0x4b678a[_0x61fe('0x2d')][_0x61fe('0x34')](_0x61fe('0x35'))){_0xb7a8fd[_0x61fe('0x1d')]=qs[_0x61fe('0x1d')](_0x4b678a['query'][_0x61fe('0x1d')]);_0xb7a8fd['offset']=qs['offset'](_0x4b678a[_0x61fe('0x2d')][_0x61fe('0x1b')]);}_0xb7a8fd[_0x61fe('0x36')]=qs[_0x61fe('0x37')](_0x4b678a[_0x61fe('0x2d')][_0x61fe('0x37')]);_0xb7a8fd['where']=qs['filters'](_[_0x61fe('0x38')](_0x4b678a[_0x61fe('0x2d')],_0x2f1bb4[_0x61fe('0x2f')]),_0x3ab153);if(_0x4b678a['query'][_0x61fe('0x39')]){_0xb7a8fd[_0x61fe('0x3a')]=_[_0x61fe('0x3b')](_0xb7a8fd[_0x61fe('0x3a')],{'$or':_[_0x61fe('0x26')](_0x3ab153,function(_0x3e6324){if(_0x3e6324['type']!=='VIRTUAL'){var _0x320ca3={};_0x320ca3[_0x3e6324[_0x61fe('0x2c')]]={'$like':'%'+_0x4b678a[_0x61fe('0x2d')][_0x61fe('0x39')]+'%'};return _0x320ca3;}})});}_0xb7a8fd=_[_0x61fe('0x3b')]({},_0xb7a8fd,_0x4b678a['options']);var _0x37c4bc={'where':_0xb7a8fd[_0x61fe('0x3a')]};return db[_0x61fe('0x27')][_0x61fe('0x1e')](_0x37c4bc)[_0x61fe('0x23')](function(_0x686a40){_0x483f82[_0x61fe('0x1e')]=_0x686a40;if(_0x4b678a['query'][_0x61fe('0x3c')]){_0xb7a8fd['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x61fe('0x3d')](_0xb7a8fd);})[_0x61fe('0x23')](function(_0x5c1969){_0x483f82['rows']=_0x5c1969;return _0x483f82;})[_0x61fe('0x23')](respondWithFilteredResult(_0x3e708f,_0xb7a8fd))[_0x61fe('0x3e')](handleError(_0x3e708f,null));};exports[_0x61fe('0x3f')]=function(_0x59ec7c,_0x35f8f6){var _0x3a61d5={'raw':![],'where':{'id':_0x59ec7c[_0x61fe('0x40')]['id']}},_0x312bbf={};_0x312bbf[_0x61fe('0x2b')]=_['keys'](db[_0x61fe('0x27')][_0x61fe('0x28')]);_0x312bbf[_0x61fe('0x2d')]=_[_0x61fe('0x2e')](_0x59ec7c['query']);_0x312bbf[_0x61fe('0x2f')]=_[_0x61fe('0x31')](_0x312bbf['model'],_0x312bbf[_0x61fe('0x2d')]);_0x3a61d5[_0x61fe('0x30')]=_['intersection'](_0x312bbf['model'],qs[_0x61fe('0x32')](_0x59ec7c['query'][_0x61fe('0x32')]));_0x3a61d5[_0x61fe('0x30')]=_0x3a61d5[_0x61fe('0x30')][_0x61fe('0x33')]?_0x3a61d5[_0x61fe('0x30')]:_0x312bbf[_0x61fe('0x2b')];if(_0x59ec7c[_0x61fe('0x2d')][_0x61fe('0x3c')]){_0x3a61d5[_0x61fe('0x41')]=[{'all':!![]}];}_0x3a61d5=_[_0x61fe('0x3b')]({},_0x3a61d5,_0x59ec7c[_0x61fe('0x42')]);return db[_0x61fe('0x27')][_0x61fe('0x43')](_0x3a61d5)['then'](handleEntityNotFound(_0x35f8f6,null))[_0x61fe('0x23')](respondWithResult(_0x35f8f6,null))[_0x61fe('0x3e')](handleError(_0x35f8f6,null));};exports[_0x61fe('0x44')]=function(_0x39df3c,_0x33e9f7){return db['SalesforceAccount']['create'](_0x39df3c[_0x61fe('0x45')],{})[_0x61fe('0x23')](respondWithResult(_0x33e9f7,0xc9))[_0x61fe('0x3e')](handleError(_0x33e9f7,null));};exports[_0x61fe('0x46')]=function(_0x2b7b02,_0x3feca8){if(_0x2b7b02[_0x61fe('0x45')]['id']){delete _0x2b7b02[_0x61fe('0x45')]['id'];}return db[_0x61fe('0x27')][_0x61fe('0x43')]({'where':{'id':_0x2b7b02[_0x61fe('0x40')]['id']}})[_0x61fe('0x23')](handleEntityNotFound(_0x3feca8,null))[_0x61fe('0x23')](saveUpdates(_0x2b7b02[_0x61fe('0x45')],null))['then'](respondWithResult(_0x3feca8,null))[_0x61fe('0x3e')](handleError(_0x3feca8,null));};exports[_0x61fe('0x24')]=function(_0x254d83,_0x56ff2a){return db[_0x61fe('0x27')][_0x61fe('0x43')]({'where':{'id':_0x254d83[_0x61fe('0x40')]['id']}})[_0x61fe('0x23')](handleEntityNotFound(_0x56ff2a,null))[_0x61fe('0x23')](removeEntity(_0x56ff2a,null))[_0x61fe('0x3e')](handleError(_0x56ff2a,null));};exports[_0x61fe('0x47')]=function(_0x34e5b1,_0x494364,_0x44096d){var _0x1c5a84={};var _0xe81678={};var _0x416db6;var _0x1d97a2;return db[_0x61fe('0x27')][_0x61fe('0x48')]({'where':{'id':_0x34e5b1[_0x61fe('0x40')]['id']}})[_0x61fe('0x23')](handleEntityNotFound(_0x494364,null))[_0x61fe('0x23')](function(_0x33b4d){if(_0x33b4d){_0x416db6=_0x33b4d;_0xe81678[_0x61fe('0x2b')]=_['keys'](db['SalesforceConfiguration']['rawAttributes']);_0xe81678['query']=_[_0x61fe('0x2e')](_0x34e5b1[_0x61fe('0x2d')]);_0xe81678[_0x61fe('0x2f')]=_[_0x61fe('0x31')](_0xe81678[_0x61fe('0x2b')],_0xe81678[_0x61fe('0x2d')]);_0x1c5a84[_0x61fe('0x30')]=_[_0x61fe('0x31')](_0xe81678[_0x61fe('0x2b')],qs[_0x61fe('0x32')](_0x34e5b1[_0x61fe('0x2d')][_0x61fe('0x32')]));_0x1c5a84['attributes']=_0x1c5a84[_0x61fe('0x30')][_0x61fe('0x33')]?_0x1c5a84['attributes']:_0xe81678['model'];_0x1c5a84[_0x61fe('0x36')]=qs[_0x61fe('0x37')](_0x34e5b1[_0x61fe('0x2d')][_0x61fe('0x37')]);_0x1c5a84[_0x61fe('0x3a')]=qs[_0x61fe('0x2f')](_[_0x61fe('0x38')](_0x34e5b1[_0x61fe('0x2d')],_0xe81678[_0x61fe('0x2f')]));if(_0x34e5b1[_0x61fe('0x2d')][_0x61fe('0x39')]){_0x1c5a84['where']=_[_0x61fe('0x3b')](_0x1c5a84['where'],{'$or':_['map'](_0x1c5a84[_0x61fe('0x30')],function(_0x2d3abb){var _0x1a7134={};_0x1a7134[_0x2d3abb]={'$like':'%'+_0x34e5b1[_0x61fe('0x2d')]['filter']+'%'};return _0x1a7134;})});}_0x1c5a84=_[_0x61fe('0x3b')]({},_0x1c5a84,_0x34e5b1[_0x61fe('0x42')]);return _0x416db6['getConfigurations'](_0x1c5a84);}})[_0x61fe('0x23')](function(_0x122db3){if(_0x122db3){_0x1d97a2=_0x122db3[_0x61fe('0x33')];if(!_0x34e5b1[_0x61fe('0x2d')][_0x61fe('0x34')](_0x61fe('0x35'))){_0x1c5a84[_0x61fe('0x1d')]=qs[_0x61fe('0x1d')](_0x34e5b1['query'][_0x61fe('0x1d')]);_0x1c5a84[_0x61fe('0x1b')]=qs[_0x61fe('0x1b')](_0x34e5b1[_0x61fe('0x2d')][_0x61fe('0x1b')]);}return _0x416db6[_0x61fe('0x47')](_0x1c5a84);}})['then'](function(_0x110c50){if(_0x110c50){return _0x110c50?{'count':_0x1d97a2,'rows':_0x110c50}:null;}})[_0x61fe('0x23')](respondWithResult(_0x494364,null))[_0x61fe('0x3e')](handleError(_0x494364,null));};exports[_0x61fe('0x49')]=function(_0x3f81d1,_0x27e4a6,_0x17247b){if(_0x3f81d1[_0x61fe('0x45')]['id']){delete _0x3f81d1['body']['id'];}return db[_0x61fe('0x27')][_0x61fe('0x48')]({'where':{'id':_0x3f81d1[_0x61fe('0x40')]['id']}})[_0x61fe('0x23')](handleEntityNotFound(_0x27e4a6,null))['then'](function(_0x18604e){if(_0x18604e){_0x3f81d1[_0x61fe('0x45')]['AccountId']=_0x18604e['id'];_0x3f81d1[_0x61fe('0x45')]['Subjects']=integrations[_0x61fe('0x4a')](_0x3f81d1['body']['channel'],_0x3f81d1[_0x61fe('0x45')][_0x61fe('0x29')]);_0x3f81d1['body'][_0x61fe('0x4b')]=integrations[_0x61fe('0x4c')](_0x3f81d1[_0x61fe('0x45')][_0x61fe('0x4d')],_0x3f81d1[_0x61fe('0x45')][_0x61fe('0x29')]);return db[_0x61fe('0x4e')][_0x61fe('0x44')](_0x3f81d1['body'],{'include':[{'model':db[_0x61fe('0x4f')],'as':_0x61fe('0x50')},{'model':db['SalesforceField'],'as':_0x61fe('0x4b')}]});}return null;})['then'](respondWithResult(_0x27e4a6,null))[_0x61fe('0x3e')](handleError(_0x27e4a6,null));};exports[_0x61fe('0x51')]=function(_0x4783c2,_0x20725a,_0x5774ae){var _0x2f7509;var _0x3a64fc='';var _0x4c0b71=_0x61fe('0x52');return db[_0x61fe('0x27')][_0x61fe('0x48')]({'where':{'id':_0x4783c2['params']['id']},'attributes':['id',_0x61fe('0x53'),_0x61fe('0x54'),_0x61fe('0x55'),_0x61fe('0x56'),'password',_0x61fe('0x57')]})['then'](handleEntityNotFound(_0x20725a,null))[_0x61fe('0x23')](function(_0x4f0903){if(_0x4f0903){_0x3a64fc=_0x4f0903[_0x61fe('0x53')];var _0xba228a=_0x3a64fc[_0x61fe('0x58')](-0x1);if(_0xba228a==='/'){_0x3a64fc=_0x3a64fc[_0x61fe('0x59')](0x0,_0x3a64fc[_0x61fe('0x5a')](_0xba228a));}_0x2f7509=new jsforce[(_0x61fe('0x5b'))]({'oauth2':{'loginUrl':_0x3a64fc,'clientId':_0x4f0903[_0x61fe('0x54')],'clientSecret':_0x4f0903[_0x61fe('0x55')]}});return _0x2f7509[_0x61fe('0x5c')](_0x4f0903[_0x61fe('0x56')],_0x4f0903[_0x61fe('0x5d')][_0x61fe('0x5e')](_0x4f0903[_0x61fe('0x57')]));}})[_0x61fe('0x23')](function(_0x30b601){if(_0x30b601){if(!_[_0x61fe('0x5f')](_0x4783c2[_0x61fe('0x2d')][_0x61fe('0x60')])){_0x4c0b71=_0x4783c2['query'][_0x61fe('0x60')];}return _0x2f7509['sobject'](_0x4c0b71)[_0x61fe('0x61')]();}})[_0x61fe('0x23')](function(_0x263653){var _0xc74d5a=['OwnerId',_0x61fe('0x62'),_0x61fe('0x63'),_0x61fe('0x64'),'Subject',_0x61fe('0x65')];var _0x1c8602=[_0x61fe('0x66'),_0x61fe('0x67'),_0x61fe('0x68'),'boolean',_0x61fe('0x69'),_0x61fe('0x6a'),'phone'];if(_0x263653){_[_0x61fe('0x6b')](_0x263653['fields'],function(_0x37ca2f){return _0xc74d5a[_0x61fe('0x6c')](_0x37ca2f['name'])||!_0x1c8602[_0x61fe('0x6c')](_0x37ca2f['type']);});return{'count':_0x263653[_0x61fe('0x32')][_0x61fe('0x33')],'rows':_['map'](_0x263653[_0x61fe('0x32')],function(_0x3a9ee4){return{'id':_0x3a9ee4['name'],'name':_0x3a9ee4[_0x61fe('0x6d')],'custom':_0x3a9ee4[_0x61fe('0x6e')],'options':_0x3a9ee4[_0x61fe('0x6f')][_0x61fe('0x33')]>0x0?_[_0x61fe('0x26')](_0x3a9ee4['picklistValues'],function(_0x57d058){return{'name':_0x57d058['label'],'value':_0x57d058[_0x61fe('0x70')]};}):_0x3a9ee4['type']==_0x61fe('0x71')?[{'name':_0x61fe('0x72'),'value':_0x61fe('0x73')},{'name':'False','value':_0x61fe('0x74')}]:[]};})};}})['then'](respondWithResult(_0x20725a,null))[_0x61fe('0x3e')](function(_0x177f52){var _0x573cb4=_0x4783c2['query']['test']?0x1f4:_0x177f52['statusCode']||0x1f4;logger[_0x61fe('0x75')](_0x61fe('0x76'),'getFields',_0x573cb4,JSON[_0x61fe('0x77')](_0x177f52));delete _0x177f52[_0x61fe('0x2c')];if(_0x573cb4===0x191){_0x573cb4=0x190;}_0x20725a['status'](_0x573cb4)[_0x61fe('0x78')](_0x4783c2[_0x61fe('0x2d')][_0x61fe('0x79')]?{'message':_0x61fe('0x7a'),'statusCode':_0x177f52[_0x61fe('0x7b')]}:_0x177f52);});};
\ No newline at end of file
+var _0x3dad=['getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','password','slice','substring','lastIndexOf','clientId','clientSecret','login','concat','securityToken','isNil','describe','OwnerId','ActivityDate','IsReminderSet','Subject','string','int','picklist','email','textarea','phone','includes','custom','picklistValues','label','value','boolean','True','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','limit','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','SalesforceAccount','includeAll','findAll','rows','catch','show','params','include','find','create','body','findOne','SalesforceConfiguration','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x2f06a3,_0x194ea4){var _0x3d3632=function(_0x8f5d89){while(--_0x8f5d89){_0x2f06a3['push'](_0x2f06a3['shift']());}};_0x3d3632(++_0x194ea4);}(_0x3dad,0x122));var _0xd3da=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3dad[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xd3da('0x0'));var rimraf=require(_0xd3da('0x1'));var zipdir=require(_0xd3da('0x2'));var jsonpatch=require(_0xd3da('0x3'));var rp=require(_0xd3da('0x4'));var moment=require(_0xd3da('0x5'));var BPromise=require(_0xd3da('0x6'));var Mustache=require(_0xd3da('0x7'));var util=require(_0xd3da('0x8'));var path=require(_0xd3da('0x9'));var sox=require(_0xd3da('0xa'));var csv=require(_0xd3da('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3da('0xc'));var _=require(_0xd3da('0xd'));var squel=require('squel');var crypto=require(_0xd3da('0xe'));var jsforce=require(_0xd3da('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd3da('0xb'));var querystring=require(_0xd3da('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd3da('0x11'));var qs=require(_0xd3da('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3da('0x13'));var logger=require('../../config/logger')(_0xd3da('0x14'));var utils=require(_0xd3da('0x15'));var config=require(_0xd3da('0x16'));var licenseUtil=require(_0xd3da('0x17'));var db=require(_0xd3da('0x18'))['db'];var integrations=require(_0xd3da('0x19'));function respondWithStatusCode(_0x51f14a,_0x2c6566){_0x2c6566=_0x2c6566||0xcc;return function(_0xcf8a2c){if(_0xcf8a2c){return _0x51f14a[_0xd3da('0x1a')](_0x2c6566);}return _0x51f14a[_0xd3da('0x1b')](_0x2c6566)[_0xd3da('0x1c')]();};}function respondWithResult(_0x5a34a8,_0x14b98b){_0x14b98b=_0x14b98b||0xc8;return function(_0x1bfeae){if(_0x1bfeae){return _0x5a34a8[_0xd3da('0x1b')](_0x14b98b)[_0xd3da('0x1d')](_0x1bfeae);}};}function respondWithFilteredResult(_0x17fba7,_0x2dd858){return function(_0x3979ed){if(_0x3979ed){var _0x3ef7ba=typeof _0x2dd858['offset']===_0xd3da('0x1e')&&typeof _0x2dd858['limit']===_0xd3da('0x1e');var _0x16541f=_0x3979ed[_0xd3da('0x1f')];var _0x11e652=_0x3ef7ba?0x0:_0x2dd858['offset'];var _0x340504=_0x3ef7ba?_0x3979ed['count']:_0x2dd858['offset']+_0x2dd858[_0xd3da('0x20')];var _0x2a38da;if(_0x340504>=_0x16541f){_0x340504=_0x16541f;_0x2a38da=0xc8;}else{_0x2a38da=0xce;}_0x17fba7[_0xd3da('0x1b')](_0x2a38da);return _0x17fba7['set']('Content-Range',_0x11e652+'-'+_0x340504+'/'+_0x16541f)['json'](_0x3979ed);}return null;};}function patchUpdates(_0x462fb1){return function(_0x2e1661){try{jsonpatch[_0xd3da('0x21')](_0x2e1661,_0x462fb1,!![]);}catch(_0x1a2a3c){return BPromise[_0xd3da('0x22')](_0x1a2a3c);}return _0x2e1661[_0xd3da('0x23')]();};}function saveUpdates(_0x3e098a,_0x2c2b88){return function(_0x16be37){if(_0x16be37){return _0x16be37[_0xd3da('0x24')](_0x3e098a)[_0xd3da('0x25')](function(_0x4d836f){return _0x4d836f;});}return null;};}function removeEntity(_0x3229e1,_0xbaaf92){return function(_0x1d0fb5){if(_0x1d0fb5){return _0x1d0fb5[_0xd3da('0x26')]()['then'](function(){_0x3229e1[_0xd3da('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x428071,_0x3ee6f1){return function(_0x6854af){if(!_0x6854af){_0x428071[_0xd3da('0x1a')](0x194);}return _0x6854af;};}function handleError(_0x1c7d6f,_0x5910c8){_0x5910c8=_0x5910c8||0x1f4;return function(_0x1d9bd5){logger['error'](_0x1d9bd5[_0xd3da('0x27')]);if(_0x1d9bd5[_0xd3da('0x28')]){delete _0x1d9bd5[_0xd3da('0x28')];}_0x1c7d6f[_0xd3da('0x1b')](_0x5910c8)[_0xd3da('0x29')](_0x1d9bd5);};}exports[_0xd3da('0x2a')]=function(_0x340516,_0x21dcb4){var _0x175df8={},_0x44b660={},_0x48ade8={'count':0x0,'rows':[]};var _0x94569b=_[_0xd3da('0x2b')](db['SalesforceAccount'][_0xd3da('0x2c')],function(_0x1543a9){return{'name':_0x1543a9[_0xd3da('0x2d')],'type':_0x1543a9[_0xd3da('0x2e')]['key']};});_0x44b660[_0xd3da('0x2f')]=_['map'](_0x94569b,_0xd3da('0x28'));_0x44b660[_0xd3da('0x30')]=_[_0xd3da('0x31')](_0x340516['query']);_0x44b660[_0xd3da('0x32')]=_['intersection'](_0x44b660[_0xd3da('0x2f')],_0x44b660['query']);_0x175df8[_0xd3da('0x33')]=_[_0xd3da('0x34')](_0x44b660[_0xd3da('0x2f')],qs['fields'](_0x340516[_0xd3da('0x30')][_0xd3da('0x35')]));_0x175df8[_0xd3da('0x33')]=_0x175df8[_0xd3da('0x33')][_0xd3da('0x36')]?_0x175df8[_0xd3da('0x33')]:_0x44b660['model'];if(!_0x340516[_0xd3da('0x30')][_0xd3da('0x37')](_0xd3da('0x38'))){_0x175df8[_0xd3da('0x20')]=qs[_0xd3da('0x20')](_0x340516[_0xd3da('0x30')]['limit']);_0x175df8[_0xd3da('0x39')]=qs['offset'](_0x340516['query'][_0xd3da('0x39')]);}_0x175df8[_0xd3da('0x3a')]=qs['sort'](_0x340516['query'][_0xd3da('0x3b')]);_0x175df8[_0xd3da('0x3c')]=qs['filters'](_[_0xd3da('0x3d')](_0x340516['query'],_0x44b660['filters']),_0x94569b);if(_0x340516[_0xd3da('0x30')]['filter']){_0x175df8['where']=_[_0xd3da('0x3e')](_0x175df8['where'],{'$or':_[_0xd3da('0x2b')](_0x94569b,function(_0x384238){if(_0x384238[_0xd3da('0x2e')]!==_0xd3da('0x3f')){var _0x520446={};_0x520446[_0x384238[_0xd3da('0x28')]]={'$like':'%'+_0x340516['query']['filter']+'%'};return _0x520446;}})});}_0x175df8=_[_0xd3da('0x3e')]({},_0x175df8,_0x340516[_0xd3da('0x40')]);var _0x19a071={'where':_0x175df8[_0xd3da('0x3c')]};return db[_0xd3da('0x41')][_0xd3da('0x1f')](_0x19a071)[_0xd3da('0x25')](function(_0xfb6512){_0x48ade8[_0xd3da('0x1f')]=_0xfb6512;if(_0x340516['query'][_0xd3da('0x42')]){_0x175df8['include']=[{'all':!![]}];}return db[_0xd3da('0x41')][_0xd3da('0x43')](_0x175df8);})[_0xd3da('0x25')](function(_0xf1d838){_0x48ade8[_0xd3da('0x44')]=_0xf1d838;return _0x48ade8;})[_0xd3da('0x25')](respondWithFilteredResult(_0x21dcb4,_0x175df8))[_0xd3da('0x45')](handleError(_0x21dcb4,null));};exports[_0xd3da('0x46')]=function(_0x18949d,_0x25c9f3){var _0x4cdbdc={'raw':![],'where':{'id':_0x18949d[_0xd3da('0x47')]['id']}},_0x120ecf={};_0x120ecf[_0xd3da('0x2f')]=_[_0xd3da('0x31')](db[_0xd3da('0x41')]['rawAttributes']);_0x120ecf[_0xd3da('0x30')]=_[_0xd3da('0x31')](_0x18949d[_0xd3da('0x30')]);_0x120ecf[_0xd3da('0x32')]=_['intersection'](_0x120ecf[_0xd3da('0x2f')],_0x120ecf[_0xd3da('0x30')]);_0x4cdbdc[_0xd3da('0x33')]=_[_0xd3da('0x34')](_0x120ecf[_0xd3da('0x2f')],qs[_0xd3da('0x35')](_0x18949d[_0xd3da('0x30')][_0xd3da('0x35')]));_0x4cdbdc[_0xd3da('0x33')]=_0x4cdbdc[_0xd3da('0x33')][_0xd3da('0x36')]?_0x4cdbdc['attributes']:_0x120ecf[_0xd3da('0x2f')];if(_0x18949d[_0xd3da('0x30')]['includeAll']){_0x4cdbdc[_0xd3da('0x48')]=[{'all':!![]}];}_0x4cdbdc=_['merge']({},_0x4cdbdc,_0x18949d[_0xd3da('0x40')]);return db[_0xd3da('0x41')][_0xd3da('0x49')](_0x4cdbdc)[_0xd3da('0x25')](handleEntityNotFound(_0x25c9f3,null))[_0xd3da('0x25')](respondWithResult(_0x25c9f3,null))[_0xd3da('0x45')](handleError(_0x25c9f3,null));};exports[_0xd3da('0x4a')]=function(_0x2f4946,_0x2274bf){return db[_0xd3da('0x41')][_0xd3da('0x4a')](_0x2f4946[_0xd3da('0x4b')],{})[_0xd3da('0x25')](respondWithResult(_0x2274bf,0xc9))['catch'](handleError(_0x2274bf,null));};exports['update']=function(_0xfe63d3,_0x216d06){if(_0xfe63d3[_0xd3da('0x4b')]['id']){delete _0xfe63d3['body']['id'];}return db[_0xd3da('0x41')][_0xd3da('0x49')]({'where':{'id':_0xfe63d3[_0xd3da('0x47')]['id']}})[_0xd3da('0x25')](handleEntityNotFound(_0x216d06,null))[_0xd3da('0x25')](saveUpdates(_0xfe63d3[_0xd3da('0x4b')],null))['then'](respondWithResult(_0x216d06,null))['catch'](handleError(_0x216d06,null));};exports['destroy']=function(_0xcdccbe,_0x70e6a9){return db[_0xd3da('0x41')][_0xd3da('0x49')]({'where':{'id':_0xcdccbe[_0xd3da('0x47')]['id']}})[_0xd3da('0x25')](handleEntityNotFound(_0x70e6a9,null))[_0xd3da('0x25')](removeEntity(_0x70e6a9,null))['catch'](handleError(_0x70e6a9,null));};exports['getConfigurations']=function(_0x20e8b2,_0x53e133,_0x9c2a11){var _0x28b1ae={};var _0x4678cb={};var _0x46e315;var _0x50fe63;return db['SalesforceAccount'][_0xd3da('0x4c')]({'where':{'id':_0x20e8b2[_0xd3da('0x47')]['id']}})[_0xd3da('0x25')](handleEntityNotFound(_0x53e133,null))[_0xd3da('0x25')](function(_0x16b836){if(_0x16b836){_0x46e315=_0x16b836;_0x4678cb['model']=_[_0xd3da('0x31')](db[_0xd3da('0x4d')][_0xd3da('0x2c')]);_0x4678cb[_0xd3da('0x30')]=_[_0xd3da('0x31')](_0x20e8b2[_0xd3da('0x30')]);_0x4678cb['filters']=_[_0xd3da('0x34')](_0x4678cb[_0xd3da('0x2f')],_0x4678cb['query']);_0x28b1ae[_0xd3da('0x33')]=_[_0xd3da('0x34')](_0x4678cb[_0xd3da('0x2f')],qs['fields'](_0x20e8b2[_0xd3da('0x30')][_0xd3da('0x35')]));_0x28b1ae['attributes']=_0x28b1ae['attributes'][_0xd3da('0x36')]?_0x28b1ae[_0xd3da('0x33')]:_0x4678cb[_0xd3da('0x2f')];_0x28b1ae['order']=qs[_0xd3da('0x3b')](_0x20e8b2[_0xd3da('0x30')][_0xd3da('0x3b')]);_0x28b1ae[_0xd3da('0x3c')]=qs[_0xd3da('0x32')](_[_0xd3da('0x3d')](_0x20e8b2[_0xd3da('0x30')],_0x4678cb[_0xd3da('0x32')]));if(_0x20e8b2[_0xd3da('0x30')]['filter']){_0x28b1ae[_0xd3da('0x3c')]=_[_0xd3da('0x3e')](_0x28b1ae[_0xd3da('0x3c')],{'$or':_['map'](_0x28b1ae[_0xd3da('0x33')],function(_0x582ecb){var _0x1f18e0={};_0x1f18e0[_0x582ecb]={'$like':'%'+_0x20e8b2[_0xd3da('0x30')][_0xd3da('0x4e')]+'%'};return _0x1f18e0;})});}_0x28b1ae=_[_0xd3da('0x3e')]({},_0x28b1ae,_0x20e8b2[_0xd3da('0x40')]);return _0x46e315[_0xd3da('0x4f')](_0x28b1ae);}})[_0xd3da('0x25')](function(_0x3c92c8){if(_0x3c92c8){_0x50fe63=_0x3c92c8[_0xd3da('0x36')];if(!_0x20e8b2['query'][_0xd3da('0x37')]('nolimit')){_0x28b1ae[_0xd3da('0x20')]=qs[_0xd3da('0x20')](_0x20e8b2[_0xd3da('0x30')]['limit']);_0x28b1ae[_0xd3da('0x39')]=qs[_0xd3da('0x39')](_0x20e8b2[_0xd3da('0x30')][_0xd3da('0x39')]);}return _0x46e315[_0xd3da('0x4f')](_0x28b1ae);}})[_0xd3da('0x25')](function(_0x6c18af){if(_0x6c18af){return _0x6c18af?{'count':_0x50fe63,'rows':_0x6c18af}:null;}})[_0xd3da('0x25')](respondWithResult(_0x53e133,null))[_0xd3da('0x45')](handleError(_0x53e133,null));};exports[_0xd3da('0x50')]=function(_0x53d8fc,_0x31326e,_0x472eaa){if(_0x53d8fc['body']['id']){delete _0x53d8fc[_0xd3da('0x4b')]['id'];}return db[_0xd3da('0x41')][_0xd3da('0x4c')]({'where':{'id':_0x53d8fc[_0xd3da('0x47')]['id']}})[_0xd3da('0x25')](handleEntityNotFound(_0x31326e,null))[_0xd3da('0x25')](function(_0x40b1f4){if(_0x40b1f4){_0x53d8fc['body'][_0xd3da('0x51')]=_0x40b1f4['id'];_0x53d8fc[_0xd3da('0x4b')][_0xd3da('0x52')]=integrations[_0xd3da('0x53')](_0x53d8fc['body'][_0xd3da('0x54')],_0x53d8fc['body'][_0xd3da('0x2e')]);_0x53d8fc[_0xd3da('0x4b')]['Descriptions']=integrations[_0xd3da('0x55')](_0x53d8fc[_0xd3da('0x4b')][_0xd3da('0x54')],_0x53d8fc[_0xd3da('0x4b')][_0xd3da('0x2e')]);return db[_0xd3da('0x4d')][_0xd3da('0x4a')](_0x53d8fc[_0xd3da('0x4b')],{'include':[{'model':db[_0xd3da('0x56')],'as':_0xd3da('0x52')},{'model':db[_0xd3da('0x56')],'as':_0xd3da('0x57')}]});}return null;})[_0xd3da('0x25')](respondWithResult(_0x31326e,null))[_0xd3da('0x45')](handleError(_0x31326e,null));};exports[_0xd3da('0x58')]=function(_0x49c0c5,_0x587b8f,_0xb6f3ab){var _0x193c94;var _0x4bbc1b='';var _0x4074e3=_0xd3da('0x59');return db[_0xd3da('0x41')][_0xd3da('0x4c')]({'where':{'id':_0x49c0c5[_0xd3da('0x47')]['id']},'attributes':['id',_0xd3da('0x5a'),'clientId','clientSecret','username',_0xd3da('0x5b'),'securityToken']})[_0xd3da('0x25')](handleEntityNotFound(_0x587b8f,null))[_0xd3da('0x25')](function(_0x4d48ae){if(_0x4d48ae){_0x4bbc1b=_0x4d48ae[_0xd3da('0x5a')];var _0x5733f0=_0x4bbc1b[_0xd3da('0x5c')](-0x1);if(_0x5733f0==='/'){_0x4bbc1b=_0x4bbc1b[_0xd3da('0x5d')](0x0,_0x4bbc1b[_0xd3da('0x5e')](_0x5733f0));}_0x193c94=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4bbc1b,'clientId':_0x4d48ae[_0xd3da('0x5f')],'clientSecret':_0x4d48ae[_0xd3da('0x60')]}});return _0x193c94[_0xd3da('0x61')](_0x4d48ae['username'],_0x4d48ae[_0xd3da('0x5b')][_0xd3da('0x62')](_0x4d48ae[_0xd3da('0x63')]));}})[_0xd3da('0x25')](function(_0x27eb64){if(_0x27eb64){if(!_[_0xd3da('0x64')](_0x49c0c5[_0xd3da('0x30')]['ticketType'])){_0x4074e3=_0x49c0c5['query']['ticketType'];}return _0x193c94['sobject'](_0x4074e3)[_0xd3da('0x65')]();}})[_0xd3da('0x25')](function(_0x24e57e){var _0x4771f3=[_0xd3da('0x66'),_0xd3da('0x67'),_0xd3da('0x68'),'IsRecurrence',_0xd3da('0x69'),'Description'];var _0x13ebba=[_0xd3da('0x6a'),_0xd3da('0x6b'),_0xd3da('0x6c'),'boolean',_0xd3da('0x6d'),_0xd3da('0x6e'),_0xd3da('0x6f')];if(_0x24e57e){_['remove'](_0x24e57e[_0xd3da('0x35')],function(_0x2a8beb){return _0x4771f3[_0xd3da('0x70')](_0x2a8beb[_0xd3da('0x28')])||!_0x13ebba['includes'](_0x2a8beb[_0xd3da('0x2e')]);});return{'count':_0x24e57e[_0xd3da('0x35')]['length'],'rows':_[_0xd3da('0x2b')](_0x24e57e[_0xd3da('0x35')],function(_0x96d8e2){return{'id':_0x96d8e2['name'],'name':_0x96d8e2['label'],'custom':_0x96d8e2[_0xd3da('0x71')],'options':_0x96d8e2[_0xd3da('0x72')][_0xd3da('0x36')]>0x0?_[_0xd3da('0x2b')](_0x96d8e2[_0xd3da('0x72')],function(_0x32eb74){return{'name':_0x32eb74[_0xd3da('0x73')],'value':_0x32eb74[_0xd3da('0x74')]};}):_0x96d8e2[_0xd3da('0x2e')]==_0xd3da('0x75')?[{'name':_0xd3da('0x76'),'value':'true'},{'name':_0xd3da('0x77'),'value':'false'}]:[]};})};}})[_0xd3da('0x25')](respondWithResult(_0x587b8f,null))[_0xd3da('0x45')](function(_0x8b002e){var _0x49b59d=_0x49c0c5[_0xd3da('0x30')][_0xd3da('0x78')]?0x1f4:_0x8b002e[_0xd3da('0x79')]||0x1f4;logger[_0xd3da('0x7a')](_0xd3da('0x7b'),'getFields',_0x49b59d,JSON[_0xd3da('0x7c')](_0x8b002e));delete _0x8b002e[_0xd3da('0x28')];if(_0x49b59d===0x191){_0x49b59d=0x190;}_0x587b8f['status'](_0x49b59d)[_0xd3da('0x29')](_0x49c0c5[_0xd3da('0x30')][_0xd3da('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x8b002e['statusCode']}:_0x8b002e);});};
\ No newline at end of file
index 0946856..6df5984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07be=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x4d4deb,_0x12cd06){var _0x3123ce=function(_0x391258){while(--_0x391258){_0x4d4deb['push'](_0x4d4deb['shift']());}};_0x3123ce(++_0x12cd06);}(_0x07be,0xfb));var _0xe07b=function(_0x4cf72b,_0x2f11af){_0x4cf72b=_0x4cf72b-0x0;var _0x3a8fcf=_0x07be[_0x4cf72b];return _0x3a8fcf;};'use strict';var _=require(_0xe07b('0x0'));var util=require(_0xe07b('0x1'));var logger=require(_0xe07b('0x2'))(_0xe07b('0x3'));var moment=require('moment');var BPromise=require(_0xe07b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe07b('0x5'));var rimraf=require(_0xe07b('0x6'));var config=require(_0xe07b('0x7'));var attributes=require(_0xe07b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xe07b('0x9')]=function(_0x1eb78f,_0x288525){return _0x1eb78f['define'](_0xe07b('0xa'),attributes,{'tableName':_0xe07b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff14=['define','int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x4c5aa8,_0x2bf606){var _0x163f45=function(_0x17806a){while(--_0x17806a){_0x4c5aa8['push'](_0x4c5aa8['shift']());}};_0x163f45(++_0x2bf606);}(_0xff14,0x1ca));var _0x4ff1=function(_0x39e309,_0x1b260b){_0x39e309=_0x39e309-0x0;var _0x180c8a=_0xff14[_0x39e309];return _0x180c8a;};'use strict';var _=require(_0x4ff1('0x0'));var util=require(_0x4ff1('0x1'));var logger=require('../../config/logger')(_0x4ff1('0x2'));var moment=require(_0x4ff1('0x3'));var BPromise=require(_0x4ff1('0x4'));var rp=require(_0x4ff1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ff1('0x6'));var config=require(_0x4ff1('0x7'));var attributes=require(_0x4ff1('0x8'));var integrations=require(_0x4ff1('0x9'));module['exports']=function(_0x12aadb,_0x150898){return _0x12aadb[_0x4ff1('0xa')]('SalesforceAccount',attributes,{'tableName':_0x4ff1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5b7426..fc7c622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d4b=['findAll','raw','options','where','attributes','map','model','include','stringify','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetSalesforceAccount','SalesforceAccount'];(function(_0x28cddc,_0x1be16d){var _0x5ce855=function(_0x1fe396){while(--_0x1fe396){_0x28cddc['push'](_0x28cddc['shift']());}};_0x5ce855(++_0x1be16d);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x1dabdf,_0x43ca53){_0x1dabdf=_0x1dabdf-0x0;var _0x44fef5=_0x6d4b[_0x1dabdf];return _0x44fef5;};'use strict';var _=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var moment=require(_0xb6d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6d4('0x3'));var fs=require('fs');var Redis=require(_0xb6d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb6d4('0x5'))(_0xb6d4('0x6'));var config=require(_0xb6d4('0x7'));var jayson=require(_0xb6d4('0x8'));var client=jayson[_0xb6d4('0x9')][_0xb6d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11498a,_0x78c489,_0x5f11b9){return new BPromise(function(_0x36d85f,_0xe82b85){return client[_0xb6d4('0xb')](_0x11498a,_0x5f11b9)[_0xb6d4('0xc')](function(_0x2effac){logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));logger[_0xb6d4('0x10')](_0xb6d4('0x11'),_0x78c489,'request\x20sent',JSON['stringify'](_0x2effac));if(_0x2effac['error']){if(_0x2effac['error'][_0xb6d4('0x12')]===0x1f4){logger['error'](_0xb6d4('0xe'),_0x78c489,_0x2effac[_0xb6d4('0x13')][_0xb6d4('0x14')]);return _0xe82b85(_0x2effac[_0xb6d4('0x13')]['message']);}logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x2effac['error'][_0xb6d4('0x14')]);return _0x36d85f(_0x2effac['error'][_0xb6d4('0x14')]);}else{logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));_0x36d85f(_0x2effac[_0xb6d4('0x15')][_0xb6d4('0x14')]);}})[_0xb6d4('0x16')](function(_0x5e3b0f){logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x5e3b0f);_0xe82b85(_0x5e3b0f);});});}exports[_0xb6d4('0x17')]=function(_0x431af2){var _0x43ba1f=this;return new Promise(function(_0x438053,_0x28bce9){return db[_0xb6d4('0x18')][_0xb6d4('0x19')]({'raw':_0x431af2['options']?_0x431af2['options'][_0xb6d4('0x1a')]===undefined?!![]:![]:!![],'where':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')][_0xb6d4('0x1c')]||null:null,'attributes':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options'][_0xb6d4('0x1d')]||null:null,'limit':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')]['limit']||null:null,'include':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options']['include']?_[_0xb6d4('0x1e')](_0x431af2[_0xb6d4('0x1b')]['include'],function(_0x56baa4){return{'model':db[_0x56baa4[_0xb6d4('0x1f')]],'as':_0x56baa4['as'],'attributes':_0x56baa4[_0xb6d4('0x1d')],'include':_0x56baa4[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x56baa4[_0xb6d4('0x20')],function(_0x223ca0){return{'model':db[_0x223ca0[_0xb6d4('0x1f')]],'as':_0x223ca0['as'],'attributes':_0x223ca0[_0xb6d4('0x1d')],'include':_0x223ca0[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x223ca0[_0xb6d4('0x20')],function(_0x18db34){return{'model':db[_0x18db34['model']],'as':_0x18db34['as'],'attributes':_0x18db34[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb6d4('0xc')](function(_0x54ddeb){logger[_0xb6d4('0xd')]('GetSalesforceAccount',_0x431af2);logger[_0xb6d4('0x10')](_0xb6d4('0x17'),_0x431af2,JSON[_0xb6d4('0x21')](_0x54ddeb));_0x438053(_0x54ddeb);})[_0xb6d4('0x16')](function(_0x1a311d){logger[_0xb6d4('0x13')](_0xb6d4('0x17'),_0x1a311d[_0xb6d4('0x14')],_0x431af2);_0x28bce9(_0x43ba1f['error'](0x1f4,_0x1a311d[_0xb6d4('0x14')]));});});};exports[_0xb6d4('0x22')]=function(_0x112d10){var _0x54e090=this;return new Promise(function(_0x417d70,_0x5bacec){return db['SalesforceAccount'][_0xb6d4('0x23')]({'raw':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x112d10['options']?_0x112d10['options'][_0xb6d4('0x1c')]||null:null,'attributes':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')][_0xb6d4('0x1d')]||null:null,'include':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['include']?_['map'](_0x112d10[_0xb6d4('0x1b')]['include'],function(_0x53fb87){return{'model':db[_0x53fb87['model']],'as':_0x53fb87['as'],'attributes':_0x53fb87['attributes'],'include':_0x53fb87[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x53fb87['include'],function(_0x7c98be){return{'model':db[_0x7c98be['model']],'as':_0x7c98be['as'],'attributes':_0x7c98be[_0xb6d4('0x1d')],'include':_0x7c98be[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x7c98be[_0xb6d4('0x20')],function(_0x274ebd){return{'model':db[_0x274ebd[_0xb6d4('0x1f')]],'as':_0x274ebd['as'],'attributes':_0x274ebd[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x410602){logger[_0xb6d4('0xd')](_0xb6d4('0x22'),_0x112d10);logger['debug']('ShowSalesforceAccount',_0x112d10,JSON[_0xb6d4('0x21')](_0x410602));_0x417d70(_0x410602);})[_0xb6d4('0x16')](function(_0x12a3dc){logger[_0xb6d4('0x13')](_0xb6d4('0x22'),_0x12a3dc['message'],_0x112d10);_0x5bacec(_0x54e090[_0xb6d4('0x13')](0x1f4,_0x12a3dc['message']));});});};
\ No newline at end of file
+var _0x4178=['attributes','limit','include','map','model','then','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','where'];(function(_0x4897dd,_0x19533a){var _0x59120a=function(_0x15579b){while(--_0x15579b){_0x4897dd['push'](_0x4897dd['shift']());}};_0x59120a(++_0x19533a);}(_0x4178,0x1b7));var _0x8417=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4178[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x8417('0x0'));var util=require(_0x8417('0x1'));var moment=require(_0x8417('0x2'));var BPromise=require('bluebird');var rs=require(_0x8417('0x3'));var fs=require('fs');var Redis=require(_0x8417('0x4'));var db=require(_0x8417('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8417('0x6'))(_0x8417('0x7'));var config=require(_0x8417('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8417('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2683ab,_0x467869,_0x2e6712){return new BPromise(function(_0x6f749e,_0x298ae7){return client[_0x8417('0xa')](_0x2683ab,_0x2e6712)['then'](function(_0x154851){logger[_0x8417('0xb')](_0x8417('0xc'),_0x467869,_0x8417('0xd'));logger[_0x8417('0xe')](_0x8417('0xf'),_0x467869,_0x8417('0xd'),JSON[_0x8417('0x10')](_0x154851));if(_0x154851[_0x8417('0x11')]){if(_0x154851['error']['code']===0x1f4){logger[_0x8417('0x11')](_0x8417('0xc'),_0x467869,_0x154851['error'][_0x8417('0x12')]);return _0x298ae7(_0x154851[_0x8417('0x11')][_0x8417('0x12')]);}logger[_0x8417('0x11')](_0x8417('0xc'),_0x467869,_0x154851[_0x8417('0x11')]['message']);return _0x6f749e(_0x154851[_0x8417('0x11')][_0x8417('0x12')]);}else{logger[_0x8417('0xb')](_0x8417('0xc'),_0x467869,_0x8417('0xd'));_0x6f749e(_0x154851['result'][_0x8417('0x12')]);}})[_0x8417('0x13')](function(_0x4b60d3){logger['error'](_0x8417('0xc'),_0x467869,_0x4b60d3);_0x298ae7(_0x4b60d3);});});}exports['GetSalesforceAccount']=function(_0x5bc00f){var _0xffffad=this;return new Promise(function(_0x4652a9,_0x3f3683){return db['SalesforceAccount'][_0x8417('0x14')]({'raw':_0x5bc00f[_0x8417('0x15')]?_0x5bc00f[_0x8417('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5bc00f[_0x8417('0x15')]?_0x5bc00f[_0x8417('0x15')][_0x8417('0x16')]||null:null,'attributes':_0x5bc00f['options']?_0x5bc00f[_0x8417('0x15')][_0x8417('0x17')]||null:null,'limit':_0x5bc00f[_0x8417('0x15')]?_0x5bc00f['options'][_0x8417('0x18')]||null:null,'include':_0x5bc00f[_0x8417('0x15')]?_0x5bc00f['options'][_0x8417('0x19')]?_[_0x8417('0x1a')](_0x5bc00f[_0x8417('0x15')][_0x8417('0x19')],function(_0x373140){return{'model':db[_0x373140['model']],'as':_0x373140['as'],'attributes':_0x373140[_0x8417('0x17')],'include':_0x373140[_0x8417('0x19')]?_[_0x8417('0x1a')](_0x373140['include'],function(_0x4329f0){return{'model':db[_0x4329f0[_0x8417('0x1b')]],'as':_0x4329f0['as'],'attributes':_0x4329f0['attributes'],'include':_0x4329f0[_0x8417('0x19')]?_['map'](_0x4329f0['include'],function(_0x39c922){return{'model':db[_0x39c922[_0x8417('0x1b')]],'as':_0x39c922['as'],'attributes':_0x39c922[_0x8417('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8417('0x1c')](function(_0x5316e9){logger[_0x8417('0xb')](_0x8417('0x1d'),_0x5bc00f);logger[_0x8417('0xe')]('GetSalesforceAccount',_0x5bc00f,JSON['stringify'](_0x5316e9));_0x4652a9(_0x5316e9);})[_0x8417('0x13')](function(_0x321515){logger[_0x8417('0x11')](_0x8417('0x1d'),_0x321515[_0x8417('0x12')],_0x5bc00f);_0x3f3683(_0xffffad['error'](0x1f4,_0x321515[_0x8417('0x12')]));});});};exports[_0x8417('0x1e')]=function(_0x371026){var _0x1e3806=this;return new Promise(function(_0x18acb3,_0xe6019c){return db[_0x8417('0x1f')]['find']({'raw':_0x371026[_0x8417('0x15')]?_0x371026[_0x8417('0x15')][_0x8417('0x20')]===undefined?!![]:![]:!![],'where':_0x371026['options']?_0x371026['options'][_0x8417('0x16')]||null:null,'attributes':_0x371026['options']?_0x371026[_0x8417('0x15')][_0x8417('0x17')]||null:null,'include':_0x371026[_0x8417('0x15')]?_0x371026[_0x8417('0x15')]['include']?_['map'](_0x371026['options'][_0x8417('0x19')],function(_0x287e82){return{'model':db[_0x287e82[_0x8417('0x1b')]],'as':_0x287e82['as'],'attributes':_0x287e82[_0x8417('0x17')],'include':_0x287e82[_0x8417('0x19')]?_['map'](_0x287e82[_0x8417('0x19')],function(_0x340c31){return{'model':db[_0x340c31[_0x8417('0x1b')]],'as':_0x340c31['as'],'attributes':_0x340c31[_0x8417('0x17')],'include':_0x340c31['include']?_[_0x8417('0x1a')](_0x340c31[_0x8417('0x19')],function(_0x2c8abd){return{'model':db[_0x2c8abd[_0x8417('0x1b')]],'as':_0x2c8abd['as'],'attributes':_0x2c8abd[_0x8417('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8417('0x1c')](function(_0x855ed3){logger['info']('ShowSalesforceAccount',_0x371026);logger[_0x8417('0xe')](_0x8417('0x1e'),_0x371026,JSON['stringify'](_0x855ed3));_0x18acb3(_0x855ed3);})[_0x8417('0x13')](function(_0x5c8242){logger[_0x8417('0x11')](_0x8417('0x1e'),_0x5c8242['message'],_0x371026);_0xe6019c(_0x1e3806[_0x8417('0x11')](0x1f4,_0x5c8242[_0x8417('0x12')]));});});};
\ No newline at end of file
index 9e33440..3eb9f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x469e41,_0x3a9274){var _0x3fcaee=function(_0x3ed9cb){while(--_0x3ed9cb){_0x469e41['push'](_0x469e41['shift']());}};_0x3fcaee(++_0x3a9274);}(_0x7a54,0x106));var _0x47a5=function(_0x5c9ca3,_0x47d6ae){_0x5c9ca3=_0x5c9ca3-0x0;var _0x360eb7=_0x7a54[_0x5c9ca3];return _0x360eb7;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
+var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x4ac7e6,_0x1fcba3){var _0x448f87=function(_0x513fce){while(--_0x513fce){_0x4ac7e6['push'](_0x4ac7e6['shift']());}};_0x448f87(++_0x1fcba3);}(_0x7a54,0x106));var _0x47a5=function(_0x28eb9e,_0x2d8b3e){_0x28eb9e=_0x28eb9e-0x0;var _0x572397=_0x7a54[_0x28eb9e];return _0x572397;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
index 1607a03..ac88829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1e8=['lead','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','account','nothing'];(function(_0x3c9164,_0x302ae3){var _0x431176=function(_0x1f41bf){while(--_0x1f41bf){_0x3c9164['push'](_0x3c9164['shift']());}};_0x431176(++_0x302ae3);}(_0xb1e8,0x16c));var _0x8b1e=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0xb1e8[_0x45ac0c];return _0x4b4074;};'use strict';var Sequelize=require(_0x8b1e('0x0'));module[_0x8b1e('0x1')]={'name':{'type':Sequelize[_0x8b1e('0x2')]},'description':{'type':Sequelize[_0x8b1e('0x2')]},'ticketType':{'type':Sequelize[_0x8b1e('0x3')]('Task',_0x8b1e('0x4')),'defaultValue':_0x8b1e('0x5')},'moduleSearch':{'type':Sequelize[_0x8b1e('0x3')](_0x8b1e('0x6'),_0x8b1e('0x7'),'lead','account_contact_lead',_0x8b1e('0x8')),'defaultValue':_0x8b1e('0x6')},'moduleCreate':{'type':Sequelize[_0x8b1e('0x3')](_0x8b1e('0x9'),_0x8b1e('0x7'),_0x8b1e('0xa'),'account'),'defaultValue':_0x8b1e('0xa')},'leadId':{'type':Sequelize[_0x8b1e('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x8b1e('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x8b1e('0x2')]}};
\ No newline at end of file
+var _0xe3e6=['contact_lead','lead','account_contact_lead','account','nothing','contact','sequelize','exports','STRING','ENUM','Case','Task'];(function(_0x392f27,_0x3cd9ab){var _0x49edf3=function(_0x31af51){while(--_0x31af51){_0x392f27['push'](_0x392f27['shift']());}};_0x49edf3(++_0x3cd9ab);}(_0xe3e6,0x14a));var _0x6e3e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xe3e6[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0x6e3e('0x0'));module[_0x6e3e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e3e('0x2')]},'ticketType':{'type':Sequelize[_0x6e3e('0x3')]('Task',_0x6e3e('0x4')),'defaultValue':_0x6e3e('0x5')},'moduleSearch':{'type':Sequelize[_0x6e3e('0x3')](_0x6e3e('0x6'),'contact',_0x6e3e('0x7'),_0x6e3e('0x8'),_0x6e3e('0x9')),'defaultValue':_0x6e3e('0x6')},'moduleCreate':{'type':Sequelize[_0x6e3e('0x3')](_0x6e3e('0xa'),_0x6e3e('0xb'),_0x6e3e('0x7'),_0x6e3e('0x9')),'defaultValue':_0x6e3e('0x7')},'leadId':{'type':Sequelize[_0x6e3e('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6e3e('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x6e3e('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1b41a1d..79fe42b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe784=['then','stack','name','send','index','map','SalesforceConfiguration','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','include','rows','catch','show','params','rawAttributes','includeAll','create','body','find','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xe784,0x1b9));var _0x4e78=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xe784[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x4e78('0x0'));var rimraf=require(_0x4e78('0x1'));var zipdir=require(_0x4e78('0x2'));var jsonpatch=require(_0x4e78('0x3'));var rp=require(_0x4e78('0x4'));var moment=require('moment');var BPromise=require(_0x4e78('0x5'));var Mustache=require(_0x4e78('0x6'));var util=require(_0x4e78('0x7'));var path=require(_0x4e78('0x8'));var sox=require(_0x4e78('0x9'));var csv=require(_0x4e78('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e78('0xb'));var _=require('lodash');var squel=require(_0x4e78('0xc'));var crypto=require(_0x4e78('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e78('0xa'));var querystring=require(_0x4e78('0xe'));var Papa=require(_0x4e78('0xf'));var Redis=require(_0x4e78('0x10'));var authService=require(_0x4e78('0x11'));var qs=require(_0x4e78('0x12'));var as=require(_0x4e78('0x13'));var hardwareService=require(_0x4e78('0x14'));var logger=require(_0x4e78('0x15'))(_0x4e78('0x16'));var utils=require('../../config/utils');var config=require(_0x4e78('0x17'));var licenseUtil=require(_0x4e78('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x125803,_0x19e070){_0x19e070=_0x19e070||0xcc;return function(_0x448223){if(_0x448223){return _0x125803[_0x4e78('0x19')](_0x19e070);}return _0x125803[_0x4e78('0x1a')](_0x19e070)[_0x4e78('0x1b')]();};}function respondWithResult(_0x15555,_0x40dd52){_0x40dd52=_0x40dd52||0xc8;return function(_0xf95ea){if(_0xf95ea){return _0x15555[_0x4e78('0x1a')](_0x40dd52)[_0x4e78('0x1c')](_0xf95ea);}};}function respondWithFilteredResult(_0x12e95b,_0x275177){return function(_0x556650){if(_0x556650){var _0x3d15c6=typeof _0x275177[_0x4e78('0x1d')]===_0x4e78('0x1e')&&typeof _0x275177['limit']===_0x4e78('0x1e');var _0x183c96=_0x556650[_0x4e78('0x1f')];var _0x11f2dd=_0x3d15c6?0x0:_0x275177[_0x4e78('0x1d')];var _0x49e127=_0x3d15c6?_0x556650[_0x4e78('0x1f')]:_0x275177['offset']+_0x275177[_0x4e78('0x20')];var _0xcee2bb;if(_0x49e127>=_0x183c96){_0x49e127=_0x183c96;_0xcee2bb=0xc8;}else{_0xcee2bb=0xce;}_0x12e95b[_0x4e78('0x1a')](_0xcee2bb);return _0x12e95b[_0x4e78('0x21')]('Content-Range',_0x11f2dd+'-'+_0x49e127+'/'+_0x183c96)[_0x4e78('0x1c')](_0x556650);}return null;};}function patchUpdates(_0x551d1a){return function(_0x127ec5){try{jsonpatch[_0x4e78('0x22')](_0x127ec5,_0x551d1a,!![]);}catch(_0x106cfa){return BPromise[_0x4e78('0x23')](_0x106cfa);}return _0x127ec5[_0x4e78('0x24')]();};}function saveUpdates(_0x387040,_0x3b9e2e){return function(_0xac7897){if(_0xac7897){return _0xac7897[_0x4e78('0x25')](_0x387040)['then'](function(_0x1cd49f){return _0x1cd49f;});}return null;};}function removeEntity(_0xbec7e7,_0x5ba03a){return function(_0x26c91d){if(_0x26c91d){return _0x26c91d[_0x4e78('0x26')]()[_0x4e78('0x27')](function(){_0xbec7e7[_0x4e78('0x1a')](0xcc)[_0x4e78('0x1b')]();});}};}function handleEntityNotFound(_0x1942e9,_0xe18c4d){return function(_0x16d30d){if(!_0x16d30d){_0x1942e9['sendStatus'](0x194);}return _0x16d30d;};}function handleError(_0x5bd0bb,_0x5eac94){_0x5eac94=_0x5eac94||0x1f4;return function(_0x5baf02){logger['error'](_0x5baf02[_0x4e78('0x28')]);if(_0x5baf02[_0x4e78('0x29')]){delete _0x5baf02[_0x4e78('0x29')];}_0x5bd0bb[_0x4e78('0x1a')](_0x5eac94)[_0x4e78('0x2a')](_0x5baf02);};}exports[_0x4e78('0x2b')]=function(_0xe69513,_0x38c584){var _0x18ab69={},_0x45b73a={},_0x393d94={'count':0x0,'rows':[]};var _0x43edf3=_[_0x4e78('0x2c')](db[_0x4e78('0x2d')]['rawAttributes'],function(_0x593d64){return{'name':_0x593d64['fieldName'],'type':_0x593d64[_0x4e78('0x2e')][_0x4e78('0x2f')]};});_0x45b73a['model']=_['map'](_0x43edf3,'name');_0x45b73a[_0x4e78('0x30')]=_[_0x4e78('0x31')](_0xe69513[_0x4e78('0x30')]);_0x45b73a['filters']=_[_0x4e78('0x32')](_0x45b73a[_0x4e78('0x33')],_0x45b73a[_0x4e78('0x30')]);_0x18ab69[_0x4e78('0x34')]=_[_0x4e78('0x32')](_0x45b73a[_0x4e78('0x33')],qs[_0x4e78('0x35')](_0xe69513[_0x4e78('0x30')][_0x4e78('0x35')]));_0x18ab69[_0x4e78('0x34')]=_0x18ab69[_0x4e78('0x34')][_0x4e78('0x36')]?_0x18ab69[_0x4e78('0x34')]:_0x45b73a[_0x4e78('0x33')];if(!_0xe69513['query'][_0x4e78('0x37')](_0x4e78('0x38'))){_0x18ab69[_0x4e78('0x20')]=qs[_0x4e78('0x20')](_0xe69513['query']['limit']);_0x18ab69[_0x4e78('0x1d')]=qs[_0x4e78('0x1d')](_0xe69513['query'][_0x4e78('0x1d')]);}_0x18ab69[_0x4e78('0x39')]=qs[_0x4e78('0x3a')](_0xe69513[_0x4e78('0x30')][_0x4e78('0x3a')]);_0x18ab69['where']=qs[_0x4e78('0x3b')](_[_0x4e78('0x3c')](_0xe69513[_0x4e78('0x30')],_0x45b73a[_0x4e78('0x3b')]),_0x43edf3);if(_0xe69513[_0x4e78('0x30')][_0x4e78('0x3d')]){_0x18ab69['where']=_[_0x4e78('0x3e')](_0x18ab69[_0x4e78('0x3f')],{'$or':_['map'](_0x43edf3,function(_0x399ced){if(_0x399ced[_0x4e78('0x2e')]!=='VIRTUAL'){var _0x3475c9={};_0x3475c9[_0x399ced['name']]={'$like':'%'+_0xe69513[_0x4e78('0x30')]['filter']+'%'};return _0x3475c9;}})});}_0x18ab69=_[_0x4e78('0x3e')]({},_0x18ab69,_0xe69513[_0x4e78('0x40')]);var _0x5a3039={'where':_0x18ab69[_0x4e78('0x3f')]};return db[_0x4e78('0x2d')][_0x4e78('0x1f')](_0x5a3039)[_0x4e78('0x27')](function(_0x1004d1){_0x393d94[_0x4e78('0x1f')]=_0x1004d1;if(_0xe69513['query']['includeAll']){_0x18ab69[_0x4e78('0x41')]=[{'all':!![]}];}return db[_0x4e78('0x2d')]['findAll'](_0x18ab69);})[_0x4e78('0x27')](function(_0x261b51){_0x393d94[_0x4e78('0x42')]=_0x261b51;return _0x393d94;})['then'](respondWithFilteredResult(_0x38c584,_0x18ab69))[_0x4e78('0x43')](handleError(_0x38c584,null));};exports[_0x4e78('0x44')]=function(_0xfd70af,_0x1f15f0){var _0x43d3e6={'raw':![],'where':{'id':_0xfd70af[_0x4e78('0x45')]['id']}},_0x20bcf3={};_0x20bcf3['model']=_[_0x4e78('0x31')](db[_0x4e78('0x2d')][_0x4e78('0x46')]);_0x20bcf3[_0x4e78('0x30')]=_[_0x4e78('0x31')](_0xfd70af['query']);_0x20bcf3[_0x4e78('0x3b')]=_[_0x4e78('0x32')](_0x20bcf3[_0x4e78('0x33')],_0x20bcf3[_0x4e78('0x30')]);_0x43d3e6[_0x4e78('0x34')]=_[_0x4e78('0x32')](_0x20bcf3['model'],qs[_0x4e78('0x35')](_0xfd70af['query'][_0x4e78('0x35')]));_0x43d3e6[_0x4e78('0x34')]=_0x43d3e6[_0x4e78('0x34')][_0x4e78('0x36')]?_0x43d3e6['attributes']:_0x20bcf3[_0x4e78('0x33')];if(_0xfd70af[_0x4e78('0x30')][_0x4e78('0x47')]){_0x43d3e6[_0x4e78('0x41')]=[{'all':!![]}];}_0x43d3e6=_['merge']({},_0x43d3e6,_0xfd70af[_0x4e78('0x40')]);return db[_0x4e78('0x2d')]['find'](_0x43d3e6)['then'](handleEntityNotFound(_0x1f15f0,null))['then'](respondWithResult(_0x1f15f0,null))[_0x4e78('0x43')](handleError(_0x1f15f0,null));};exports[_0x4e78('0x48')]=function(_0x51bae2,_0x505485){return db[_0x4e78('0x2d')][_0x4e78('0x48')](_0x51bae2['body'],{})[_0x4e78('0x27')](respondWithResult(_0x505485,0xc9))[_0x4e78('0x43')](handleError(_0x505485,null));};exports['update']=function(_0x4253f3,_0x50be7e){if(_0x4253f3[_0x4e78('0x49')]['id']){delete _0x4253f3['body']['id'];}return db['SalesforceConfiguration'][_0x4e78('0x4a')]({'where':{'id':_0x4253f3[_0x4e78('0x45')]['id']}})['then'](handleEntityNotFound(_0x50be7e,null))[_0x4e78('0x27')](saveUpdates(_0x4253f3['body'],null))[_0x4e78('0x27')](respondWithResult(_0x50be7e,null))['catch'](handleError(_0x50be7e,null));};exports[_0x4e78('0x26')]=function(_0x2ee205,_0x5b2f85){return db[_0x4e78('0x2d')][_0x4e78('0x4a')]({'where':{'id':_0x2ee205[_0x4e78('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b2f85,null))[_0x4e78('0x27')](removeEntity(_0x5b2f85,null))['catch'](handleError(_0x5b2f85,null));};exports[_0x4e78('0x4b')]=function(_0x55d0d2,_0x2b8c3d,_0x268868){var _0xe6df02={};var _0x18e297={};var _0x18b0a1;var _0xabc37b;return db[_0x4e78('0x2d')][_0x4e78('0x4c')]({'where':{'id':_0x55d0d2[_0x4e78('0x45')]['id']}})[_0x4e78('0x27')](handleEntityNotFound(_0x2b8c3d,null))[_0x4e78('0x27')](function(_0x17ca04){if(_0x17ca04){_0x18b0a1=_0x17ca04;_0x18e297['model']=_[_0x4e78('0x31')](db[_0x4e78('0x4d')][_0x4e78('0x46')]);_0x18e297[_0x4e78('0x30')]=_[_0x4e78('0x31')](_0x55d0d2[_0x4e78('0x30')]);_0x18e297[_0x4e78('0x3b')]=_['intersection'](_0x18e297['model'],_0x18e297[_0x4e78('0x30')]);_0xe6df02[_0x4e78('0x34')]=_[_0x4e78('0x32')](_0x18e297['model'],qs['fields'](_0x55d0d2[_0x4e78('0x30')][_0x4e78('0x35')]));_0xe6df02['attributes']=_0xe6df02[_0x4e78('0x34')][_0x4e78('0x36')]?_0xe6df02[_0x4e78('0x34')]:_0x18e297['model'];_0xe6df02[_0x4e78('0x39')]=qs[_0x4e78('0x3a')](_0x55d0d2['query'][_0x4e78('0x3a')]);_0xe6df02['where']=qs[_0x4e78('0x3b')](_[_0x4e78('0x3c')](_0x55d0d2[_0x4e78('0x30')],_0x18e297[_0x4e78('0x3b')]));if(_0x55d0d2[_0x4e78('0x30')][_0x4e78('0x3d')]){_0xe6df02['where']=_[_0x4e78('0x3e')](_0xe6df02[_0x4e78('0x3f')],{'$or':_[_0x4e78('0x2c')](_0xe6df02[_0x4e78('0x34')],function(_0x2cd9ed){var _0x241fc5={};_0x241fc5[_0x2cd9ed]={'$like':'%'+_0x55d0d2[_0x4e78('0x30')]['filter']+'%'};return _0x241fc5;})});}_0xe6df02=_[_0x4e78('0x3e')]({},_0xe6df02,_0x55d0d2['options']);return _0x18b0a1[_0x4e78('0x4b')](_0xe6df02);}})['then'](function(_0x53b22c){if(_0x53b22c){_0xabc37b=_0x53b22c[_0x4e78('0x36')];if(!_0x55d0d2[_0x4e78('0x30')][_0x4e78('0x37')]('nolimit')){_0xe6df02[_0x4e78('0x20')]=qs['limit'](_0x55d0d2[_0x4e78('0x30')][_0x4e78('0x20')]);_0xe6df02[_0x4e78('0x1d')]=qs[_0x4e78('0x1d')](_0x55d0d2['query']['offset']);}return _0x18b0a1[_0x4e78('0x4b')](_0xe6df02);}})[_0x4e78('0x27')](function(_0x5d6348){if(_0x5d6348){return _0x5d6348?{'count':_0xabc37b,'rows':_0x5d6348}:null;}})[_0x4e78('0x27')](respondWithResult(_0x2b8c3d,null))['catch'](handleError(_0x2b8c3d,null));};exports[_0x4e78('0x4e')]=function(_0x547df5,_0x3af9d1,_0x5c2f37){var _0x2950f0={};var _0x3aa9c7={};var _0x565e6e;var _0x23a08a;return db[_0x4e78('0x2d')][_0x4e78('0x4c')]({'where':{'id':_0x547df5[_0x4e78('0x45')]['id']}})[_0x4e78('0x27')](handleEntityNotFound(_0x3af9d1,null))[_0x4e78('0x27')](function(_0x3a9f3e){if(_0x3a9f3e){_0x565e6e=_0x3a9f3e;_0x3aa9c7[_0x4e78('0x33')]=_[_0x4e78('0x31')](db['SalesforceField'][_0x4e78('0x46')]);_0x3aa9c7[_0x4e78('0x30')]=_[_0x4e78('0x31')](_0x547df5[_0x4e78('0x30')]);_0x3aa9c7[_0x4e78('0x3b')]=_['intersection'](_0x3aa9c7[_0x4e78('0x33')],_0x3aa9c7[_0x4e78('0x30')]);_0x2950f0[_0x4e78('0x34')]=_[_0x4e78('0x32')](_0x3aa9c7[_0x4e78('0x33')],qs[_0x4e78('0x35')](_0x547df5[_0x4e78('0x30')][_0x4e78('0x35')]));_0x2950f0['attributes']=_0x2950f0[_0x4e78('0x34')][_0x4e78('0x36')]?_0x2950f0['attributes']:_0x3aa9c7[_0x4e78('0x33')];_0x2950f0['order']=qs[_0x4e78('0x3a')](_0x547df5['query']['sort']);_0x2950f0[_0x4e78('0x3f')]=qs[_0x4e78('0x3b')](_['pick'](_0x547df5[_0x4e78('0x30')],_0x3aa9c7[_0x4e78('0x3b')]));if(_0x547df5[_0x4e78('0x30')][_0x4e78('0x3d')]){_0x2950f0['where']=_[_0x4e78('0x3e')](_0x2950f0['where'],{'$or':_[_0x4e78('0x2c')](_0x2950f0['attributes'],function(_0x35f27c){var _0x12cf86={};_0x12cf86[_0x35f27c]={'$like':'%'+_0x547df5['query'][_0x4e78('0x3d')]+'%'};return _0x12cf86;})});}_0x2950f0=_[_0x4e78('0x3e')]({},_0x2950f0,_0x547df5[_0x4e78('0x40')]);return _0x565e6e['getSubjects'](_0x2950f0);}})['then'](function(_0x5b4ff2){if(_0x5b4ff2){_0x23a08a=_0x5b4ff2['length'];if(!_0x547df5[_0x4e78('0x30')][_0x4e78('0x37')](_0x4e78('0x38'))){_0x2950f0[_0x4e78('0x20')]=qs[_0x4e78('0x20')](_0x547df5[_0x4e78('0x30')][_0x4e78('0x20')]);_0x2950f0['offset']=qs['offset'](_0x547df5[_0x4e78('0x30')][_0x4e78('0x1d')]);}return _0x565e6e[_0x4e78('0x4e')](_0x2950f0);}})['then'](function(_0x36a62e){if(_0x36a62e){return _0x36a62e?{'count':_0x23a08a,'rows':_0x36a62e}:null;}})[_0x4e78('0x27')](respondWithResult(_0x3af9d1,null))[_0x4e78('0x43')](handleError(_0x3af9d1,null));};exports['getDescriptions']=function(_0x4307f7,_0x4864c2,_0xce0b75){var _0x243c62={};var _0x2964a8={};var _0x537664;var _0x5cfe3b;return db[_0x4e78('0x2d')][_0x4e78('0x4c')]({'where':{'id':_0x4307f7[_0x4e78('0x45')]['id']}})[_0x4e78('0x27')](handleEntityNotFound(_0x4864c2,null))[_0x4e78('0x27')](function(_0x3fa39e){if(_0x3fa39e){_0x537664=_0x3fa39e;_0x2964a8['model']=_[_0x4e78('0x31')](db[_0x4e78('0x4d')][_0x4e78('0x46')]);_0x2964a8[_0x4e78('0x30')]=_['keys'](_0x4307f7[_0x4e78('0x30')]);_0x2964a8[_0x4e78('0x3b')]=_['intersection'](_0x2964a8[_0x4e78('0x33')],_0x2964a8[_0x4e78('0x30')]);_0x243c62['attributes']=_[_0x4e78('0x32')](_0x2964a8[_0x4e78('0x33')],qs[_0x4e78('0x35')](_0x4307f7['query']['fields']));_0x243c62[_0x4e78('0x34')]=_0x243c62[_0x4e78('0x34')][_0x4e78('0x36')]?_0x243c62[_0x4e78('0x34')]:_0x2964a8[_0x4e78('0x33')];_0x243c62[_0x4e78('0x39')]=qs[_0x4e78('0x3a')](_0x4307f7['query']['sort']);_0x243c62[_0x4e78('0x3f')]=qs[_0x4e78('0x3b')](_[_0x4e78('0x3c')](_0x4307f7[_0x4e78('0x30')],_0x2964a8[_0x4e78('0x3b')]));if(_0x4307f7['query'][_0x4e78('0x3d')]){_0x243c62[_0x4e78('0x3f')]=_['merge'](_0x243c62[_0x4e78('0x3f')],{'$or':_[_0x4e78('0x2c')](_0x243c62[_0x4e78('0x34')],function(_0xdbc0dc){var _0x20655a={};_0x20655a[_0xdbc0dc]={'$like':'%'+_0x4307f7['query']['filter']+'%'};return _0x20655a;})});}_0x243c62=_[_0x4e78('0x3e')]({},_0x243c62,_0x4307f7[_0x4e78('0x40')]);return _0x537664[_0x4e78('0x4f')](_0x243c62);}})['then'](function(_0x131c58){if(_0x131c58){_0x5cfe3b=_0x131c58[_0x4e78('0x36')];if(!_0x4307f7['query'][_0x4e78('0x37')](_0x4e78('0x38'))){_0x243c62[_0x4e78('0x20')]=qs[_0x4e78('0x20')](_0x4307f7[_0x4e78('0x30')]['limit']);_0x243c62[_0x4e78('0x1d')]=qs[_0x4e78('0x1d')](_0x4307f7[_0x4e78('0x30')]['offset']);}return _0x537664['getDescriptions'](_0x243c62);}})[_0x4e78('0x27')](function(_0x369a07){if(_0x369a07){return _0x369a07?{'count':_0x5cfe3b,'rows':_0x369a07}:null;}})[_0x4e78('0x27')](respondWithResult(_0x4864c2,null))[_0x4e78('0x43')](handleError(_0x4864c2,null));};
\ No newline at end of file
+var _0x8184=['keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','findOne','SalesforceField','getFields','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','map','query'];(function(_0x1ba6cc,_0x30dd61){var _0x5b0d85=function(_0x59b0c5){while(--_0x59b0c5){_0x1ba6cc['push'](_0x1ba6cc['shift']());}};_0x5b0d85(++_0x30dd61);}(_0x8184,0x76));var _0x4818=function(_0x33a6bd,_0x564362){_0x33a6bd=_0x33a6bd-0x0;var _0x339aff=_0x8184[_0x33a6bd];return _0x339aff;};'use strict';var emlformat=require(_0x4818('0x0'));var rimraf=require(_0x4818('0x1'));var zipdir=require(_0x4818('0x2'));var jsonpatch=require(_0x4818('0x3'));var rp=require(_0x4818('0x4'));var moment=require(_0x4818('0x5'));var BPromise=require(_0x4818('0x6'));var Mustache=require(_0x4818('0x7'));var util=require(_0x4818('0x8'));var path=require('path');var sox=require(_0x4818('0x9'));var csv=require(_0x4818('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4818('0xb'));var _=require(_0x4818('0xc'));var squel=require(_0x4818('0xd'));var crypto=require(_0x4818('0xe'));var jsforce=require(_0x4818('0xf'));var deskjs=require(_0x4818('0x10'));var toCsv=require(_0x4818('0xa'));var querystring=require(_0x4818('0x11'));var Papa=require(_0x4818('0x12'));var Redis=require(_0x4818('0x13'));var authService=require(_0x4818('0x14'));var qs=require(_0x4818('0x15'));var as=require(_0x4818('0x16'));var hardwareService=require(_0x4818('0x17'));var logger=require(_0x4818('0x18'))(_0x4818('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4818('0x1a'))['db'];function respondWithStatusCode(_0x49c53b,_0x1dd9c7){_0x1dd9c7=_0x1dd9c7||0xcc;return function(_0x145492){if(_0x145492){return _0x49c53b[_0x4818('0x1b')](_0x1dd9c7);}return _0x49c53b[_0x4818('0x1c')](_0x1dd9c7)[_0x4818('0x1d')]();};}function respondWithResult(_0x2df6af,_0x1cac74){_0x1cac74=_0x1cac74||0xc8;return function(_0x18f933){if(_0x18f933){return _0x2df6af[_0x4818('0x1c')](_0x1cac74)[_0x4818('0x1e')](_0x18f933);}};}function respondWithFilteredResult(_0x3a67a7,_0xbad18e){return function(_0x45a349){if(_0x45a349){var _0x552620=typeof _0xbad18e['offset']===_0x4818('0x1f')&&typeof _0xbad18e[_0x4818('0x20')]===_0x4818('0x1f');var _0x3cf458=_0x45a349[_0x4818('0x21')];var _0x168368=_0x552620?0x0:_0xbad18e[_0x4818('0x22')];var _0x48f473=_0x552620?_0x45a349[_0x4818('0x21')]:_0xbad18e[_0x4818('0x22')]+_0xbad18e[_0x4818('0x20')];var _0x118db1;if(_0x48f473>=_0x3cf458){_0x48f473=_0x3cf458;_0x118db1=0xc8;}else{_0x118db1=0xce;}_0x3a67a7[_0x4818('0x1c')](_0x118db1);return _0x3a67a7[_0x4818('0x23')](_0x4818('0x24'),_0x168368+'-'+_0x48f473+'/'+_0x3cf458)[_0x4818('0x1e')](_0x45a349);}return null;};}function patchUpdates(_0xe63b16){return function(_0x192763){try{jsonpatch[_0x4818('0x25')](_0x192763,_0xe63b16,!![]);}catch(_0x5ddea7){return BPromise[_0x4818('0x26')](_0x5ddea7);}return _0x192763[_0x4818('0x27')]();};}function saveUpdates(_0x244403,_0x1ab46e){return function(_0xa63c43){if(_0xa63c43){return _0xa63c43[_0x4818('0x28')](_0x244403)[_0x4818('0x29')](function(_0x4264e7){return _0x4264e7;});}return null;};}function removeEntity(_0x237e1d,_0x4e214c){return function(_0x4e5abc){if(_0x4e5abc){return _0x4e5abc['destroy']()[_0x4818('0x29')](function(){_0x237e1d[_0x4818('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa3ac39,_0x1d4afb){return function(_0x4f75dc){if(!_0x4f75dc){_0xa3ac39[_0x4818('0x1b')](0x194);}return _0x4f75dc;};}function handleError(_0x447890,_0x35bf6c){_0x35bf6c=_0x35bf6c||0x1f4;return function(_0x282bfa){logger[_0x4818('0x2a')](_0x282bfa[_0x4818('0x2b')]);if(_0x282bfa[_0x4818('0x2c')]){delete _0x282bfa['name'];}_0x447890[_0x4818('0x1c')](_0x35bf6c)[_0x4818('0x2d')](_0x282bfa);};}exports[_0x4818('0x2e')]=function(_0x593491,_0x179f50){var _0x5df5d3={},_0x1d0f96={},_0x3d84eb={'count':0x0,'rows':[]};var _0x3a03e6=_['map'](db[_0x4818('0x2f')][_0x4818('0x30')],function(_0x1e89b5){return{'name':_0x1e89b5[_0x4818('0x31')],'type':_0x1e89b5[_0x4818('0x32')][_0x4818('0x33')]};});_0x1d0f96['model']=_[_0x4818('0x34')](_0x3a03e6,'name');_0x1d0f96[_0x4818('0x35')]=_[_0x4818('0x36')](_0x593491[_0x4818('0x35')]);_0x1d0f96[_0x4818('0x37')]=_[_0x4818('0x38')](_0x1d0f96[_0x4818('0x39')],_0x1d0f96[_0x4818('0x35')]);_0x5df5d3[_0x4818('0x3a')]=_['intersection'](_0x1d0f96[_0x4818('0x39')],qs[_0x4818('0x3b')](_0x593491[_0x4818('0x35')]['fields']));_0x5df5d3[_0x4818('0x3a')]=_0x5df5d3[_0x4818('0x3a')][_0x4818('0x3c')]?_0x5df5d3[_0x4818('0x3a')]:_0x1d0f96['model'];if(!_0x593491[_0x4818('0x35')]['hasOwnProperty']('nolimit')){_0x5df5d3[_0x4818('0x20')]=qs[_0x4818('0x20')](_0x593491[_0x4818('0x35')][_0x4818('0x20')]);_0x5df5d3[_0x4818('0x22')]=qs['offset'](_0x593491[_0x4818('0x35')][_0x4818('0x22')]);}_0x5df5d3[_0x4818('0x3d')]=qs[_0x4818('0x3e')](_0x593491[_0x4818('0x35')][_0x4818('0x3e')]);_0x5df5d3[_0x4818('0x3f')]=qs[_0x4818('0x37')](_[_0x4818('0x40')](_0x593491[_0x4818('0x35')],_0x1d0f96['filters']),_0x3a03e6);if(_0x593491[_0x4818('0x35')]['filter']){_0x5df5d3[_0x4818('0x3f')]=_['merge'](_0x5df5d3[_0x4818('0x3f')],{'$or':_[_0x4818('0x34')](_0x3a03e6,function(_0x415543){if(_0x415543[_0x4818('0x32')]!==_0x4818('0x41')){var _0x435f61={};_0x435f61[_0x415543[_0x4818('0x2c')]]={'$like':'%'+_0x593491['query'][_0x4818('0x42')]+'%'};return _0x435f61;}})});}_0x5df5d3=_[_0x4818('0x43')]({},_0x5df5d3,_0x593491[_0x4818('0x44')]);var _0x50f449={'where':_0x5df5d3[_0x4818('0x3f')]};return db['SalesforceConfiguration'][_0x4818('0x21')](_0x50f449)[_0x4818('0x29')](function(_0x29e35){_0x3d84eb['count']=_0x29e35;if(_0x593491[_0x4818('0x35')][_0x4818('0x45')]){_0x5df5d3[_0x4818('0x46')]=[{'all':!![]}];}return db[_0x4818('0x2f')][_0x4818('0x47')](_0x5df5d3);})[_0x4818('0x29')](function(_0x4d2b7f){_0x3d84eb[_0x4818('0x48')]=_0x4d2b7f;return _0x3d84eb;})['then'](respondWithFilteredResult(_0x179f50,_0x5df5d3))[_0x4818('0x49')](handleError(_0x179f50,null));};exports['show']=function(_0x4e1039,_0x1d3615){var _0x229951={'raw':![],'where':{'id':_0x4e1039[_0x4818('0x4a')]['id']}},_0x115e6e={};_0x115e6e['model']=_[_0x4818('0x36')](db[_0x4818('0x2f')]['rawAttributes']);_0x115e6e['query']=_[_0x4818('0x36')](_0x4e1039[_0x4818('0x35')]);_0x115e6e['filters']=_[_0x4818('0x38')](_0x115e6e['model'],_0x115e6e[_0x4818('0x35')]);_0x229951[_0x4818('0x3a')]=_[_0x4818('0x38')](_0x115e6e[_0x4818('0x39')],qs[_0x4818('0x3b')](_0x4e1039[_0x4818('0x35')][_0x4818('0x3b')]));_0x229951['attributes']=_0x229951['attributes']['length']?_0x229951[_0x4818('0x3a')]:_0x115e6e[_0x4818('0x39')];if(_0x4e1039[_0x4818('0x35')][_0x4818('0x45')]){_0x229951[_0x4818('0x46')]=[{'all':!![]}];}_0x229951=_[_0x4818('0x43')]({},_0x229951,_0x4e1039[_0x4818('0x44')]);return db[_0x4818('0x2f')][_0x4818('0x4b')](_0x229951)['then'](handleEntityNotFound(_0x1d3615,null))['then'](respondWithResult(_0x1d3615,null))[_0x4818('0x49')](handleError(_0x1d3615,null));};exports['create']=function(_0x415740,_0x471f84){return db['SalesforceConfiguration'][_0x4818('0x4c')](_0x415740[_0x4818('0x4d')],{})['then'](respondWithResult(_0x471f84,0xc9))[_0x4818('0x49')](handleError(_0x471f84,null));};exports[_0x4818('0x28')]=function(_0x40376b,_0x479aea){if(_0x40376b[_0x4818('0x4d')]['id']){delete _0x40376b[_0x4818('0x4d')]['id'];}return db[_0x4818('0x2f')][_0x4818('0x4b')]({'where':{'id':_0x40376b[_0x4818('0x4a')]['id']}})[_0x4818('0x29')](handleEntityNotFound(_0x479aea,null))[_0x4818('0x29')](saveUpdates(_0x40376b[_0x4818('0x4d')],null))[_0x4818('0x29')](respondWithResult(_0x479aea,null))[_0x4818('0x49')](handleError(_0x479aea,null));};exports[_0x4818('0x4e')]=function(_0x496b9f,_0x1741cf){return db[_0x4818('0x2f')]['find']({'where':{'id':_0x496b9f['params']['id']}})['then'](handleEntityNotFound(_0x1741cf,null))[_0x4818('0x29')](removeEntity(_0x1741cf,null))[_0x4818('0x49')](handleError(_0x1741cf,null));};exports['getFields']=function(_0x107a1c,_0x28b72a,_0x234d5b){var _0x35c25f={};var _0x2d6735={};var _0x27449a;var _0x37e6a4;return db[_0x4818('0x2f')][_0x4818('0x4f')]({'where':{'id':_0x107a1c[_0x4818('0x4a')]['id']}})[_0x4818('0x29')](handleEntityNotFound(_0x28b72a,null))[_0x4818('0x29')](function(_0x37ef1e){if(_0x37ef1e){_0x27449a=_0x37ef1e;_0x2d6735[_0x4818('0x39')]=_[_0x4818('0x36')](db[_0x4818('0x50')]['rawAttributes']);_0x2d6735[_0x4818('0x35')]=_[_0x4818('0x36')](_0x107a1c[_0x4818('0x35')]);_0x2d6735[_0x4818('0x37')]=_[_0x4818('0x38')](_0x2d6735[_0x4818('0x39')],_0x2d6735[_0x4818('0x35')]);_0x35c25f[_0x4818('0x3a')]=_[_0x4818('0x38')](_0x2d6735[_0x4818('0x39')],qs['fields'](_0x107a1c[_0x4818('0x35')][_0x4818('0x3b')]));_0x35c25f[_0x4818('0x3a')]=_0x35c25f[_0x4818('0x3a')][_0x4818('0x3c')]?_0x35c25f['attributes']:_0x2d6735[_0x4818('0x39')];_0x35c25f[_0x4818('0x3d')]=qs[_0x4818('0x3e')](_0x107a1c[_0x4818('0x35')][_0x4818('0x3e')]);_0x35c25f[_0x4818('0x3f')]=qs['filters'](_['pick'](_0x107a1c[_0x4818('0x35')],_0x2d6735['filters']));if(_0x107a1c[_0x4818('0x35')][_0x4818('0x42')]){_0x35c25f[_0x4818('0x3f')]=_[_0x4818('0x43')](_0x35c25f[_0x4818('0x3f')],{'$or':_[_0x4818('0x34')](_0x35c25f['attributes'],function(_0x342756){var _0x57de89={};_0x57de89[_0x342756]={'$like':'%'+_0x107a1c[_0x4818('0x35')][_0x4818('0x42')]+'%'};return _0x57de89;})});}_0x35c25f=_[_0x4818('0x43')]({},_0x35c25f,_0x107a1c[_0x4818('0x44')]);return _0x27449a[_0x4818('0x51')](_0x35c25f);}})[_0x4818('0x29')](function(_0x2e68cb){if(_0x2e68cb){_0x37e6a4=_0x2e68cb[_0x4818('0x3c')];if(!_0x107a1c[_0x4818('0x35')]['hasOwnProperty'](_0x4818('0x52'))){_0x35c25f['limit']=qs[_0x4818('0x20')](_0x107a1c[_0x4818('0x35')][_0x4818('0x20')]);_0x35c25f[_0x4818('0x22')]=qs[_0x4818('0x22')](_0x107a1c[_0x4818('0x35')]['offset']);}return _0x27449a[_0x4818('0x51')](_0x35c25f);}})[_0x4818('0x29')](function(_0x472a5f){if(_0x472a5f){return _0x472a5f?{'count':_0x37e6a4,'rows':_0x472a5f}:null;}})[_0x4818('0x29')](respondWithResult(_0x28b72a,null))['catch'](handleError(_0x28b72a,null));};exports[_0x4818('0x53')]=function(_0x210856,_0x174b11,_0x27ba16){var _0x124487={};var _0x26d0c1={};var _0x4bf7cf;var _0x3c3437;return db[_0x4818('0x2f')][_0x4818('0x4f')]({'where':{'id':_0x210856[_0x4818('0x4a')]['id']}})[_0x4818('0x29')](handleEntityNotFound(_0x174b11,null))[_0x4818('0x29')](function(_0x332e2f){if(_0x332e2f){_0x4bf7cf=_0x332e2f;_0x26d0c1[_0x4818('0x39')]=_[_0x4818('0x36')](db['SalesforceField'][_0x4818('0x30')]);_0x26d0c1[_0x4818('0x35')]=_[_0x4818('0x36')](_0x210856['query']);_0x26d0c1[_0x4818('0x37')]=_[_0x4818('0x38')](_0x26d0c1[_0x4818('0x39')],_0x26d0c1[_0x4818('0x35')]);_0x124487[_0x4818('0x3a')]=_[_0x4818('0x38')](_0x26d0c1[_0x4818('0x39')],qs[_0x4818('0x3b')](_0x210856['query']['fields']));_0x124487[_0x4818('0x3a')]=_0x124487[_0x4818('0x3a')][_0x4818('0x3c')]?_0x124487[_0x4818('0x3a')]:_0x26d0c1[_0x4818('0x39')];_0x124487[_0x4818('0x3d')]=qs['sort'](_0x210856['query'][_0x4818('0x3e')]);_0x124487[_0x4818('0x3f')]=qs[_0x4818('0x37')](_[_0x4818('0x40')](_0x210856[_0x4818('0x35')],_0x26d0c1[_0x4818('0x37')]));if(_0x210856['query']['filter']){_0x124487['where']=_[_0x4818('0x43')](_0x124487['where'],{'$or':_[_0x4818('0x34')](_0x124487[_0x4818('0x3a')],function(_0x3243ad){var _0x33bf67={};_0x33bf67[_0x3243ad]={'$like':'%'+_0x210856[_0x4818('0x35')][_0x4818('0x42')]+'%'};return _0x33bf67;})});}_0x124487=_[_0x4818('0x43')]({},_0x124487,_0x210856[_0x4818('0x44')]);return _0x4bf7cf[_0x4818('0x53')](_0x124487);}})[_0x4818('0x29')](function(_0x105e50){if(_0x105e50){_0x3c3437=_0x105e50[_0x4818('0x3c')];if(!_0x210856[_0x4818('0x35')][_0x4818('0x54')](_0x4818('0x52'))){_0x124487[_0x4818('0x20')]=qs[_0x4818('0x20')](_0x210856['query'][_0x4818('0x20')]);_0x124487[_0x4818('0x22')]=qs[_0x4818('0x22')](_0x210856[_0x4818('0x35')][_0x4818('0x22')]);}return _0x4bf7cf[_0x4818('0x53')](_0x124487);}})[_0x4818('0x29')](function(_0x4e4369){if(_0x4e4369){return _0x4e4369?{'count':_0x3c3437,'rows':_0x4e4369}:null;}})['then'](respondWithResult(_0x174b11,null))[_0x4818('0x49')](handleError(_0x174b11,null));};exports[_0x4818('0x55')]=function(_0x282ba7,_0x2be3ee,_0x289291){var _0x279a1d={};var _0x3226c8={};var _0x3e3772;var _0x468442;return db[_0x4818('0x2f')][_0x4818('0x4f')]({'where':{'id':_0x282ba7['params']['id']}})['then'](handleEntityNotFound(_0x2be3ee,null))[_0x4818('0x29')](function(_0x156293){if(_0x156293){_0x3e3772=_0x156293;_0x3226c8['model']=_[_0x4818('0x36')](db[_0x4818('0x50')][_0x4818('0x30')]);_0x3226c8[_0x4818('0x35')]=_[_0x4818('0x36')](_0x282ba7[_0x4818('0x35')]);_0x3226c8['filters']=_[_0x4818('0x38')](_0x3226c8[_0x4818('0x39')],_0x3226c8['query']);_0x279a1d[_0x4818('0x3a')]=_[_0x4818('0x38')](_0x3226c8[_0x4818('0x39')],qs['fields'](_0x282ba7[_0x4818('0x35')]['fields']));_0x279a1d[_0x4818('0x3a')]=_0x279a1d['attributes']['length']?_0x279a1d[_0x4818('0x3a')]:_0x3226c8[_0x4818('0x39')];_0x279a1d[_0x4818('0x3d')]=qs[_0x4818('0x3e')](_0x282ba7[_0x4818('0x35')][_0x4818('0x3e')]);_0x279a1d[_0x4818('0x3f')]=qs[_0x4818('0x37')](_[_0x4818('0x40')](_0x282ba7['query'],_0x3226c8[_0x4818('0x37')]));if(_0x282ba7['query'][_0x4818('0x42')]){_0x279a1d[_0x4818('0x3f')]=_[_0x4818('0x43')](_0x279a1d[_0x4818('0x3f')],{'$or':_['map'](_0x279a1d[_0x4818('0x3a')],function(_0x2972d1){var _0x105061={};_0x105061[_0x2972d1]={'$like':'%'+_0x282ba7['query'][_0x4818('0x42')]+'%'};return _0x105061;})});}_0x279a1d=_['merge']({},_0x279a1d,_0x282ba7['options']);return _0x3e3772[_0x4818('0x55')](_0x279a1d);}})[_0x4818('0x29')](function(_0x18a16f){if(_0x18a16f){_0x468442=_0x18a16f['length'];if(!_0x282ba7[_0x4818('0x35')]['hasOwnProperty'](_0x4818('0x52'))){_0x279a1d[_0x4818('0x20')]=qs[_0x4818('0x20')](_0x282ba7[_0x4818('0x35')][_0x4818('0x20')]);_0x279a1d['offset']=qs[_0x4818('0x22')](_0x282ba7[_0x4818('0x35')][_0x4818('0x22')]);}return _0x3e3772[_0x4818('0x55')](_0x279a1d);}})[_0x4818('0x29')](function(_0x29b26b){if(_0x29b26b){return _0x29b26b?{'count':_0x468442,'rows':_0x29b26b}:null;}})[_0x4818('0x29')](respondWithResult(_0x2be3ee,null))[_0x4818('0x49')](handleError(_0x2be3ee,null));};
\ No newline at end of file
index bcd6ec9..819ec2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ade=['util','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x1d9966,_0x1187a4){var _0x363e17=function(_0x1c689f){while(--_0x1c689f){_0x1d9966['push'](_0x1d9966['shift']());}};_0x363e17(++_0x1187a4);}(_0x1ade,0x1e4));var _0xe1ad=function(_0x223faf,_0x1c6fb5){_0x223faf=_0x223faf-0x0;var _0x2809a0=_0x1ade[_0x223faf];return _0x2809a0;};'use strict';var _=require('lodash');var util=require(_0xe1ad('0x0'));var logger=require('../../config/logger')(_0xe1ad('0x1'));var moment=require(_0xe1ad('0x2'));var BPromise=require('bluebird');var rp=require(_0xe1ad('0x3'));var fs=require('fs');var path=require(_0xe1ad('0x4'));var rimraf=require(_0xe1ad('0x5'));var config=require(_0xe1ad('0x6'));var attributes=require(_0xe1ad('0x7'));module['exports']=function(_0x3954d1,_0x5e34a2){return _0x3954d1[_0xe1ad('0x8')](_0xe1ad('0x9'),attributes,{'tableName':_0xe1ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x780e=['bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','util','../../config/logger','api','moment'];(function(_0xebcc5d,_0x257ad9){var _0x5b4869=function(_0x23a35f){while(--_0x23a35f){_0xebcc5d['push'](_0xebcc5d['shift']());}};_0x5b4869(++_0x257ad9);}(_0x780e,0x1a9));var _0xe780=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x780e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe780('0x0'));var logger=require(_0xe780('0x1'))(_0xe780('0x2'));var moment=require(_0xe780('0x3'));var BPromise=require(_0xe780('0x4'));var rp=require(_0xe780('0x5'));var fs=require('fs');var path=require(_0xe780('0x6'));var rimraf=require('rimraf');var config=require(_0xe780('0x7'));var attributes=require(_0xe780('0x8'));module['exports']=function(_0x44b17c,_0x16b95d){return _0x44b17c[_0xe780('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xe780('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 06444dc..0e27d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e2f=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f134a,_0x22d4ff){var _0x43013e=function(_0xad5e83){while(--_0xad5e83){_0x5f134a['push'](_0x5f134a['shift']());}};_0x43013e(++_0x22d4ff);}(_0x5e2f,0x8e));var _0xf5e2=function(_0x148c5c,_0x1b5c70){_0x148c5c=_0x148c5c-0x0;var _0x5ec287=_0x5e2f[_0x148c5c];return _0x5ec287;};'use strict';var _=require(_0xf5e2('0x0'));var util=require(_0xf5e2('0x1'));var moment=require(_0xf5e2('0x2'));var BPromise=require(_0xf5e2('0x3'));var rs=require(_0xf5e2('0x4'));var fs=require('fs');var Redis=require(_0xf5e2('0x5'));var db=require(_0xf5e2('0x6'))['db'];var utils=require(_0xf5e2('0x7'));var logger=require(_0xf5e2('0x8'))(_0xf5e2('0x9'));var config=require(_0xf5e2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf5e2('0xb')][_0xf5e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dc16e,_0x1c4337,_0x4056c5){return new BPromise(function(_0x52ec7a,_0xd4601f){return client[_0xf5e2('0xd')](_0x3dc16e,_0x4056c5)[_0xf5e2('0xe')](function(_0x14e9c4){logger[_0xf5e2('0xf')](_0xf5e2('0x10'),_0x1c4337,_0xf5e2('0x11'));logger[_0xf5e2('0x12')](_0xf5e2('0x13'),_0x1c4337,'request\x20sent',JSON[_0xf5e2('0x14')](_0x14e9c4));if(_0x14e9c4[_0xf5e2('0x15')]){if(_0x14e9c4[_0xf5e2('0x15')][_0xf5e2('0x16')]===0x1f4){logger[_0xf5e2('0x15')](_0xf5e2('0x10'),_0x1c4337,_0x14e9c4[_0xf5e2('0x15')][_0xf5e2('0x17')]);return _0xd4601f(_0x14e9c4[_0xf5e2('0x15')]['message']);}logger[_0xf5e2('0x15')](_0xf5e2('0x10'),_0x1c4337,_0x14e9c4[_0xf5e2('0x15')][_0xf5e2('0x17')]);return _0x52ec7a(_0x14e9c4[_0xf5e2('0x15')][_0xf5e2('0x17')]);}else{logger[_0xf5e2('0xf')](_0xf5e2('0x10'),_0x1c4337,_0xf5e2('0x11'));_0x52ec7a(_0x14e9c4[_0xf5e2('0x18')][_0xf5e2('0x17')]);}})['catch'](function(_0x270eec){logger[_0xf5e2('0x15')](_0xf5e2('0x10'),_0x1c4337,_0x270eec);_0xd4601f(_0x270eec);});});}
\ No newline at end of file
+var _0x5094=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','moment'];(function(_0x4f6ebb,_0x2f3e18){var _0x216fe3=function(_0x37dec8){while(--_0x37dec8){_0x4f6ebb['push'](_0x4f6ebb['shift']());}};_0x216fe3(++_0x2f3e18);}(_0x5094,0x12f));var _0x4509=function(_0x4610f6,_0x5fe8c3){_0x4610f6=_0x4610f6-0x0;var _0x422a4d=_0x5094[_0x4610f6];return _0x422a4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4509('0x0'));var BPromise=require(_0x4509('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4509('0x2'));var db=require(_0x4509('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4509('0x4'))(_0x4509('0x5'));var config=require('../../config/environment');var jayson=require(_0x4509('0x6'));var client=jayson[_0x4509('0x7')][_0x4509('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e21aa,_0x167c4b,_0xef5149){return new BPromise(function(_0x228384,_0x1032ef){return client[_0x4509('0x9')](_0x1e21aa,_0xef5149)['then'](function(_0x4bb81c){logger['info'](_0x4509('0xa'),_0x167c4b,_0x4509('0xb'));logger[_0x4509('0xc')](_0x4509('0xd'),_0x167c4b,_0x4509('0xb'),JSON['stringify'](_0x4bb81c));if(_0x4bb81c[_0x4509('0xe')]){if(_0x4bb81c[_0x4509('0xe')][_0x4509('0xf')]===0x1f4){logger[_0x4509('0xe')](_0x4509('0xa'),_0x167c4b,_0x4bb81c[_0x4509('0xe')][_0x4509('0x10')]);return _0x1032ef(_0x4bb81c[_0x4509('0xe')][_0x4509('0x10')]);}logger[_0x4509('0xe')](_0x4509('0xa'),_0x167c4b,_0x4bb81c[_0x4509('0xe')]['message']);return _0x228384(_0x4bb81c[_0x4509('0xe')][_0x4509('0x10')]);}else{logger[_0x4509('0x11')](_0x4509('0xa'),_0x167c4b,'request\x20sent');_0x228384(_0x4bb81c[_0x4509('0x12')][_0x4509('0x10')]);}})['catch'](function(_0x3fd69a){logger[_0x4509('0xe')](_0x4509('0xa'),_0x167c4b,_0x3fd69a);_0x1032ef(_0x3fd69a);});});}
\ No newline at end of file
index 2d87974..96b5f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7df=['show','post','create','put','/:id','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x4b4e37,_0x4cd105){var _0x51db20=function(_0x583a3a){while(--_0x583a3a){_0x4b4e37['push'](_0x4b4e37['shift']());}};_0x51db20(++_0x4cd105);}(_0xd7df,0xf1));var _0xfd7d=function(_0x1dd2fd,_0x337a99){_0x1dd2fd=_0x1dd2fd-0x0;var _0x45c484=_0xd7df[_0x1dd2fd];return _0x45c484;};'use strict';var multer=require('multer');var util=require(_0xfd7d('0x0'));var path=require(_0xfd7d('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd7d('0x2'));var router=express[_0xfd7d('0x3')]();var fs_extra=require(_0xfd7d('0x4'));var auth=require(_0xfd7d('0x5'));var interaction=require(_0xfd7d('0x6'));var config=require(_0xfd7d('0x7'));var controller=require(_0xfd7d('0x8'));router[_0xfd7d('0x9')]('/',auth[_0xfd7d('0xa')](),controller['index']);router[_0xfd7d('0x9')]('/:id',auth[_0xfd7d('0xa')](),controller[_0xfd7d('0xb')]);router[_0xfd7d('0xc')]('/',auth[_0xfd7d('0xa')](),controller[_0xfd7d('0xd')]);router[_0xfd7d('0xe')](_0xfd7d('0xf'),auth['isAuthenticated'](),controller[_0xfd7d('0x10')]);router['delete'](_0xfd7d('0xf'),auth[_0xfd7d('0xa')](),controller['destroy']);module[_0xfd7d('0x11')]=router;
\ No newline at end of file
+var _0xf784=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0xf784,0xc1));var _0x4f78=function(_0x84d4d0,_0x2d1054){_0x84d4d0=_0x84d4d0-0x0;var _0x295705=_0xf784[_0x84d4d0];return _0x295705;};'use strict';var multer=require(_0x4f78('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f78('0x1'));var express=require(_0x4f78('0x2'));var router=express[_0x4f78('0x3')]();var fs_extra=require(_0x4f78('0x4'));var auth=require(_0x4f78('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f78('0x6'));var controller=require('./intSalesforceField.controller');router[_0x4f78('0x7')]('/',auth[_0x4f78('0x8')](),controller[_0x4f78('0x9')]);router[_0x4f78('0x7')](_0x4f78('0xa'),auth[_0x4f78('0x8')](),controller[_0x4f78('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4f78('0xc')]('/:id',auth[_0x4f78('0x8')](),controller[_0x4f78('0xd')]);router[_0x4f78('0xe')]('/:id',auth[_0x4f78('0x8')](),controller[_0x4f78('0xf')]);module['exports']=router;
\ No newline at end of file
index 8a1bd8d..93850d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5426=['exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x340c00,_0x5802c1){var _0x2f2eed=function(_0x5083bb){while(--_0x5083bb){_0x340c00['push'](_0x340c00['shift']());}};_0x2f2eed(++_0x5802c1);}(_0x5426,0x18f));var _0x6542=function(_0x19b58f,_0x5d109d){_0x19b58f=_0x19b58f-0x0;var _0x32f5cd=_0x5426[_0x19b58f];return _0x32f5cd;};'use strict';var Sequelize=require('sequelize');module[_0x6542('0x0')]={'type':{'type':Sequelize[_0x6542('0x1')](_0x6542('0x2'),_0x6542('0x3'),_0x6542('0x4'),'keyValue',_0x6542('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6542('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6542('0x1')]('string',_0x6542('0x3'),_0x6542('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6542('0x6')]},'variableName':{'type':Sequelize[_0x6542('0x6')]}};
\ No newline at end of file
+var _0x6ebf=['sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6ebf,0x1e0));var _0xf6eb=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x6ebf[_0x237da8];return _0x558825;};'use strict';var Sequelize=require(_0xf6eb('0x0'));module[_0xf6eb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf6eb('0x2'),_0xf6eb('0x3'),_0xf6eb('0x4'),_0xf6eb('0x5')),'defaultValue':_0xf6eb('0x6')},'content':{'type':Sequelize[_0xf6eb('0x7')]},'key':{'type':Sequelize[_0xf6eb('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf6eb('0x6'),_0xf6eb('0x2'),_0xf6eb('0x3'))},'keyContent':{'type':Sequelize[_0xf6eb('0x7')]},'idField':{'type':Sequelize[_0xf6eb('0x7')]},'variableName':{'type':Sequelize[_0xf6eb('0x7')]}};
\ No newline at end of file
index 542aac9..1f63fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1248=['includeAll','include','findAll','params','length','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options'];(function(_0x341130,_0x2bc2cf){var _0x4660e3=function(_0x3a7b53){while(--_0x3a7b53){_0x341130['push'](_0x341130['shift']());}};_0x4660e3(++_0x2bc2cf);}(_0x1248,0x19a));var _0x8124=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0x1248[_0x104a84];return _0x4973ff;};'use strict';var emlformat=require(_0x8124('0x0'));var rimraf=require(_0x8124('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8124('0x2'));var rp=require('request-promise');var moment=require(_0x8124('0x3'));var BPromise=require(_0x8124('0x4'));var Mustache=require(_0x8124('0x5'));var util=require(_0x8124('0x6'));var path=require(_0x8124('0x7'));var sox=require(_0x8124('0x8'));var csv=require(_0x8124('0x9'));var ejs=require(_0x8124('0xa'));var fs=require('fs');var fs_extra=require(_0x8124('0xb'));var _=require(_0x8124('0xc'));var squel=require(_0x8124('0xd'));var crypto=require('crypto');var jsforce=require(_0x8124('0xe'));var deskjs=require(_0x8124('0xf'));var toCsv=require(_0x8124('0x9'));var querystring=require(_0x8124('0x10'));var Papa=require(_0x8124('0x11'));var Redis=require(_0x8124('0x12'));var authService=require(_0x8124('0x13'));var qs=require(_0x8124('0x14'));var as=require(_0x8124('0x15'));var hardwareService=require(_0x8124('0x16'));var logger=require(_0x8124('0x17'))(_0x8124('0x18'));var utils=require(_0x8124('0x19'));var config=require(_0x8124('0x1a'));var licenseUtil=require(_0x8124('0x1b'));var db=require(_0x8124('0x1c'))['db'];function respondWithStatusCode(_0x4b9398,_0x11c580){_0x11c580=_0x11c580||0xcc;return function(_0x5f10fa){if(_0x5f10fa){return _0x4b9398[_0x8124('0x1d')](_0x11c580);}return _0x4b9398[_0x8124('0x1e')](_0x11c580)[_0x8124('0x1f')]();};}function respondWithResult(_0x23f07c,_0x53e421){_0x53e421=_0x53e421||0xc8;return function(_0x429d32){if(_0x429d32){return _0x23f07c['status'](_0x53e421)[_0x8124('0x20')](_0x429d32);}};}function respondWithFilteredResult(_0x3c2a3a,_0x34c637){return function(_0x17c82f){if(_0x17c82f){var _0x164b7a=typeof _0x34c637[_0x8124('0x21')]===_0x8124('0x22')&&typeof _0x34c637[_0x8124('0x23')]===_0x8124('0x22');var _0x12d648=_0x17c82f[_0x8124('0x24')];var _0x3b9235=_0x164b7a?0x0:_0x34c637['offset'];var _0x10354d=_0x164b7a?_0x17c82f[_0x8124('0x24')]:_0x34c637[_0x8124('0x21')]+_0x34c637[_0x8124('0x23')];var _0x9bcc1a;if(_0x10354d>=_0x12d648){_0x10354d=_0x12d648;_0x9bcc1a=0xc8;}else{_0x9bcc1a=0xce;}_0x3c2a3a[_0x8124('0x1e')](_0x9bcc1a);return _0x3c2a3a[_0x8124('0x25')](_0x8124('0x26'),_0x3b9235+'-'+_0x10354d+'/'+_0x12d648)[_0x8124('0x20')](_0x17c82f);}return null;};}function patchUpdates(_0x15a857){return function(_0x44da13){try{jsonpatch[_0x8124('0x27')](_0x44da13,_0x15a857,!![]);}catch(_0x4fcdd9){return BPromise[_0x8124('0x28')](_0x4fcdd9);}return _0x44da13[_0x8124('0x29')]();};}function saveUpdates(_0x69858b,_0x270a43){return function(_0x3599e5){if(_0x3599e5){return _0x3599e5['update'](_0x69858b)[_0x8124('0x2a')](function(_0x20837b){return _0x20837b;});}return null;};}function removeEntity(_0x1775ac,_0x198384){return function(_0x52ec7f){if(_0x52ec7f){return _0x52ec7f[_0x8124('0x2b')]()[_0x8124('0x2a')](function(){_0x1775ac['status'](0xcc)[_0x8124('0x1f')]();});}};}function handleEntityNotFound(_0xe3948b,_0x6fd040){return function(_0x1e8486){if(!_0x1e8486){_0xe3948b[_0x8124('0x1d')](0x194);}return _0x1e8486;};}function handleError(_0x2e5f1a,_0xc7c294){_0xc7c294=_0xc7c294||0x1f4;return function(_0x85431e){logger['error'](_0x85431e[_0x8124('0x2c')]);if(_0x85431e[_0x8124('0x2d')]){delete _0x85431e[_0x8124('0x2d')];}_0x2e5f1a[_0x8124('0x1e')](_0xc7c294)[_0x8124('0x2e')](_0x85431e);};}exports[_0x8124('0x2f')]=function(_0x58fcee,_0x2f631f){var _0x30426e={},_0x5689f1={},_0x38ab64={'count':0x0,'rows':[]};var _0x12c97b=_[_0x8124('0x30')](db[_0x8124('0x31')][_0x8124('0x32')],function(_0x102019){return{'name':_0x102019[_0x8124('0x33')],'type':_0x102019[_0x8124('0x34')][_0x8124('0x35')]};});_0x5689f1[_0x8124('0x36')]=_[_0x8124('0x30')](_0x12c97b,_0x8124('0x2d'));_0x5689f1['query']=_[_0x8124('0x37')](_0x58fcee[_0x8124('0x38')]);_0x5689f1[_0x8124('0x39')]=_[_0x8124('0x3a')](_0x5689f1['model'],_0x5689f1[_0x8124('0x38')]);_0x30426e[_0x8124('0x3b')]=_[_0x8124('0x3a')](_0x5689f1[_0x8124('0x36')],qs[_0x8124('0x3c')](_0x58fcee['query'][_0x8124('0x3c')]));_0x30426e[_0x8124('0x3b')]=_0x30426e[_0x8124('0x3b')]['length']?_0x30426e[_0x8124('0x3b')]:_0x5689f1[_0x8124('0x36')];if(!_0x58fcee[_0x8124('0x38')][_0x8124('0x3d')](_0x8124('0x3e'))){_0x30426e[_0x8124('0x23')]=qs[_0x8124('0x23')](_0x58fcee[_0x8124('0x38')][_0x8124('0x23')]);_0x30426e['offset']=qs[_0x8124('0x21')](_0x58fcee[_0x8124('0x38')][_0x8124('0x21')]);}_0x30426e[_0x8124('0x3f')]=qs[_0x8124('0x40')](_0x58fcee[_0x8124('0x38')][_0x8124('0x40')]);_0x30426e[_0x8124('0x41')]=qs['filters'](_['pick'](_0x58fcee[_0x8124('0x38')],_0x5689f1[_0x8124('0x39')]),_0x12c97b);if(_0x58fcee['query']['filter']){_0x30426e[_0x8124('0x41')]=_[_0x8124('0x42')](_0x30426e['where'],{'$or':_[_0x8124('0x30')](_0x12c97b,function(_0x44b3ce){if(_0x44b3ce[_0x8124('0x34')]!==_0x8124('0x43')){var _0x4daba4={};_0x4daba4[_0x44b3ce[_0x8124('0x2d')]]={'$like':'%'+_0x58fcee['query'][_0x8124('0x44')]+'%'};return _0x4daba4;}})});}_0x30426e=_[_0x8124('0x42')]({},_0x30426e,_0x58fcee[_0x8124('0x45')]);var _0x469e48={'where':_0x30426e['where']};return db[_0x8124('0x31')]['count'](_0x469e48)[_0x8124('0x2a')](function(_0x3fcd78){_0x38ab64[_0x8124('0x24')]=_0x3fcd78;if(_0x58fcee[_0x8124('0x38')][_0x8124('0x46')]){_0x30426e[_0x8124('0x47')]=[{'all':!![]}];}return db[_0x8124('0x31')][_0x8124('0x48')](_0x30426e);})[_0x8124('0x2a')](function(_0x2b459f){_0x38ab64['rows']=_0x2b459f;return _0x38ab64;})[_0x8124('0x2a')](respondWithFilteredResult(_0x2f631f,_0x30426e))['catch'](handleError(_0x2f631f,null));};exports['show']=function(_0x1ad06a,_0x3bb955){var _0x5c8792={'raw':!![],'where':{'id':_0x1ad06a[_0x8124('0x49')]['id']}},_0x3903c2={};_0x3903c2['model']=_['keys'](db[_0x8124('0x31')][_0x8124('0x32')]);_0x3903c2[_0x8124('0x38')]=_[_0x8124('0x37')](_0x1ad06a[_0x8124('0x38')]);_0x3903c2[_0x8124('0x39')]=_[_0x8124('0x3a')](_0x3903c2['model'],_0x3903c2[_0x8124('0x38')]);_0x5c8792[_0x8124('0x3b')]=_[_0x8124('0x3a')](_0x3903c2['model'],qs[_0x8124('0x3c')](_0x1ad06a['query'][_0x8124('0x3c')]));_0x5c8792['attributes']=_0x5c8792[_0x8124('0x3b')][_0x8124('0x4a')]?_0x5c8792[_0x8124('0x3b')]:_0x3903c2[_0x8124('0x36')];if(_0x1ad06a[_0x8124('0x38')][_0x8124('0x46')]){_0x5c8792['include']=[{'all':!![]}];}_0x5c8792=_['merge']({},_0x5c8792,_0x1ad06a[_0x8124('0x45')]);return db[_0x8124('0x31')][_0x8124('0x4b')](_0x5c8792)['then'](handleEntityNotFound(_0x3bb955,null))[_0x8124('0x2a')](respondWithResult(_0x3bb955,null))[_0x8124('0x4c')](handleError(_0x3bb955,null));};exports[_0x8124('0x4d')]=function(_0x56d476,_0x5c4ade){return db['SalesforceField'][_0x8124('0x4d')](_0x56d476[_0x8124('0x4e')],{})[_0x8124('0x2a')](respondWithResult(_0x5c4ade,0xc9))['catch'](handleError(_0x5c4ade,null));};exports[_0x8124('0x4f')]=function(_0x4d8bb1,_0x1ad7c5){if(_0x4d8bb1[_0x8124('0x4e')]['id']){delete _0x4d8bb1['body']['id'];}return db[_0x8124('0x31')][_0x8124('0x4b')]({'where':{'id':_0x4d8bb1[_0x8124('0x49')]['id']}})[_0x8124('0x2a')](handleEntityNotFound(_0x1ad7c5,null))[_0x8124('0x2a')](saveUpdates(_0x4d8bb1[_0x8124('0x4e')],null))[_0x8124('0x2a')](respondWithResult(_0x1ad7c5,null))[_0x8124('0x4c')](handleError(_0x1ad7c5,null));};exports[_0x8124('0x2b')]=function(_0x12d730,_0x1e0df3){return db['SalesforceField']['find']({'where':{'id':_0x12d730['params']['id']}})[_0x8124('0x2a')](handleEntityNotFound(_0x1e0df3,null))[_0x8124('0x2a')](removeEntity(_0x1e0df3,null))[_0x8124('0x4c')](handleError(_0x1e0df3,null));};
\ No newline at end of file
+var _0x81b8=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x81b8,0x10f));var _0x881b=function(_0x40b254,_0x271cc8){_0x40b254=_0x40b254-0x0;var _0x2b8948=_0x81b8[_0x40b254];return _0x2b8948;};'use strict';var emlformat=require(_0x881b('0x0'));var rimraf=require(_0x881b('0x1'));var zipdir=require(_0x881b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x881b('0x3'));var moment=require(_0x881b('0x4'));var BPromise=require(_0x881b('0x5'));var Mustache=require(_0x881b('0x6'));var util=require(_0x881b('0x7'));var path=require('path');var sox=require(_0x881b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x881b('0x9'));var _=require(_0x881b('0xa'));var squel=require(_0x881b('0xb'));var crypto=require(_0x881b('0xc'));var jsforce=require(_0x881b('0xd'));var deskjs=require(_0x881b('0xe'));var toCsv=require(_0x881b('0xf'));var querystring=require(_0x881b('0x10'));var Papa=require(_0x881b('0x11'));var Redis=require(_0x881b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x881b('0x13'));var as=require(_0x881b('0x14'));var hardwareService=require(_0x881b('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x881b('0x16'));var config=require(_0x881b('0x17'));var licenseUtil=require(_0x881b('0x18'));var db=require(_0x881b('0x19'))['db'];function respondWithStatusCode(_0x43f65e,_0x295733){_0x295733=_0x295733||0xcc;return function(_0x112d5c){if(_0x112d5c){return _0x43f65e[_0x881b('0x1a')](_0x295733);}return _0x43f65e[_0x881b('0x1b')](_0x295733)[_0x881b('0x1c')]();};}function respondWithResult(_0x11264a,_0x2fb5af){_0x2fb5af=_0x2fb5af||0xc8;return function(_0x4df1b0){if(_0x4df1b0){return _0x11264a[_0x881b('0x1b')](_0x2fb5af)[_0x881b('0x1d')](_0x4df1b0);}};}function respondWithFilteredResult(_0xc2389a,_0xd82296){return function(_0x66413f){if(_0x66413f){var _0x2ccf0f=typeof _0xd82296[_0x881b('0x1e')]===_0x881b('0x1f')&&typeof _0xd82296[_0x881b('0x20')]===_0x881b('0x1f');var _0x3a35e0=_0x66413f['count'];var _0x40770c=_0x2ccf0f?0x0:_0xd82296[_0x881b('0x1e')];var _0x3dc99a=_0x2ccf0f?_0x66413f[_0x881b('0x21')]:_0xd82296[_0x881b('0x1e')]+_0xd82296['limit'];var _0x264898;if(_0x3dc99a>=_0x3a35e0){_0x3dc99a=_0x3a35e0;_0x264898=0xc8;}else{_0x264898=0xce;}_0xc2389a[_0x881b('0x1b')](_0x264898);return _0xc2389a[_0x881b('0x22')]('Content-Range',_0x40770c+'-'+_0x3dc99a+'/'+_0x3a35e0)[_0x881b('0x1d')](_0x66413f);}return null;};}function patchUpdates(_0x4dc0ef){return function(_0xe41a6d){try{jsonpatch[_0x881b('0x23')](_0xe41a6d,_0x4dc0ef,!![]);}catch(_0x3c0ed5){return BPromise[_0x881b('0x24')](_0x3c0ed5);}return _0xe41a6d[_0x881b('0x25')]();};}function saveUpdates(_0x353e0b,_0x256253){return function(_0x2fa39a){if(_0x2fa39a){return _0x2fa39a[_0x881b('0x26')](_0x353e0b)['then'](function(_0x5d4946){return _0x5d4946;});}return null;};}function removeEntity(_0xd980aa,_0x427951){return function(_0x3a13cb){if(_0x3a13cb){return _0x3a13cb[_0x881b('0x27')]()[_0x881b('0x28')](function(){_0xd980aa['status'](0xcc)[_0x881b('0x1c')]();});}};}function handleEntityNotFound(_0x1a47bb,_0x107f13){return function(_0x35425b){if(!_0x35425b){_0x1a47bb[_0x881b('0x1a')](0x194);}return _0x35425b;};}function handleError(_0x4b18c9,_0x40d732){_0x40d732=_0x40d732||0x1f4;return function(_0x4a8010){logger['error'](_0x4a8010['stack']);if(_0x4a8010[_0x881b('0x29')]){delete _0x4a8010['name'];}_0x4b18c9[_0x881b('0x1b')](_0x40d732)[_0x881b('0x2a')](_0x4a8010);};}exports[_0x881b('0x2b')]=function(_0x41e635,_0x37d107){var _0x960241={},_0x540f6a={},_0x4ed646={'count':0x0,'rows':[]};var _0x6e5d94=_[_0x881b('0x2c')](db[_0x881b('0x2d')][_0x881b('0x2e')],function(_0x1434e7){return{'name':_0x1434e7[_0x881b('0x2f')],'type':_0x1434e7[_0x881b('0x30')]['key']};});_0x540f6a[_0x881b('0x31')]=_[_0x881b('0x2c')](_0x6e5d94,'name');_0x540f6a[_0x881b('0x32')]=_['keys'](_0x41e635['query']);_0x540f6a[_0x881b('0x33')]=_[_0x881b('0x34')](_0x540f6a[_0x881b('0x31')],_0x540f6a[_0x881b('0x32')]);_0x960241[_0x881b('0x35')]=_[_0x881b('0x34')](_0x540f6a[_0x881b('0x31')],qs[_0x881b('0x36')](_0x41e635[_0x881b('0x32')]['fields']));_0x960241['attributes']=_0x960241[_0x881b('0x35')]['length']?_0x960241['attributes']:_0x540f6a['model'];if(!_0x41e635['query']['hasOwnProperty'](_0x881b('0x37'))){_0x960241[_0x881b('0x20')]=qs[_0x881b('0x20')](_0x41e635[_0x881b('0x32')][_0x881b('0x20')]);_0x960241[_0x881b('0x1e')]=qs[_0x881b('0x1e')](_0x41e635[_0x881b('0x32')][_0x881b('0x1e')]);}_0x960241[_0x881b('0x38')]=qs[_0x881b('0x39')](_0x41e635[_0x881b('0x32')][_0x881b('0x39')]);_0x960241['where']=qs['filters'](_[_0x881b('0x3a')](_0x41e635[_0x881b('0x32')],_0x540f6a[_0x881b('0x33')]),_0x6e5d94);if(_0x41e635['query'][_0x881b('0x3b')]){_0x960241[_0x881b('0x3c')]=_[_0x881b('0x3d')](_0x960241[_0x881b('0x3c')],{'$or':_[_0x881b('0x2c')](_0x6e5d94,function(_0xfdd930){if(_0xfdd930['type']!==_0x881b('0x3e')){var _0x105ba2={};_0x105ba2[_0xfdd930['name']]={'$like':'%'+_0x41e635[_0x881b('0x32')][_0x881b('0x3b')]+'%'};return _0x105ba2;}})});}_0x960241=_[_0x881b('0x3d')]({},_0x960241,_0x41e635[_0x881b('0x3f')]);var _0xc7f37c={'where':_0x960241[_0x881b('0x3c')]};return db['SalesforceField'][_0x881b('0x21')](_0xc7f37c)['then'](function(_0x485244){_0x4ed646[_0x881b('0x21')]=_0x485244;if(_0x41e635[_0x881b('0x32')]['includeAll']){_0x960241[_0x881b('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0x881b('0x41')](_0x960241);})[_0x881b('0x28')](function(_0x4f8698){_0x4ed646[_0x881b('0x42')]=_0x4f8698;return _0x4ed646;})[_0x881b('0x28')](respondWithFilteredResult(_0x37d107,_0x960241))['catch'](handleError(_0x37d107,null));};exports['show']=function(_0x99f659,_0x3b7be0){var _0x13d7f2={'raw':!![],'where':{'id':_0x99f659[_0x881b('0x43')]['id']}},_0x49e8f3={};_0x49e8f3[_0x881b('0x31')]=_['keys'](db[_0x881b('0x2d')][_0x881b('0x2e')]);_0x49e8f3[_0x881b('0x32')]=_[_0x881b('0x44')](_0x99f659[_0x881b('0x32')]);_0x49e8f3[_0x881b('0x33')]=_[_0x881b('0x34')](_0x49e8f3[_0x881b('0x31')],_0x49e8f3['query']);_0x13d7f2[_0x881b('0x35')]=_['intersection'](_0x49e8f3[_0x881b('0x31')],qs[_0x881b('0x36')](_0x99f659[_0x881b('0x32')][_0x881b('0x36')]));_0x13d7f2[_0x881b('0x35')]=_0x13d7f2[_0x881b('0x35')][_0x881b('0x45')]?_0x13d7f2[_0x881b('0x35')]:_0x49e8f3[_0x881b('0x31')];if(_0x99f659[_0x881b('0x32')]['includeAll']){_0x13d7f2[_0x881b('0x40')]=[{'all':!![]}];}_0x13d7f2=_[_0x881b('0x3d')]({},_0x13d7f2,_0x99f659[_0x881b('0x3f')]);return db[_0x881b('0x2d')][_0x881b('0x46')](_0x13d7f2)[_0x881b('0x28')](handleEntityNotFound(_0x3b7be0,null))['then'](respondWithResult(_0x3b7be0,null))[_0x881b('0x47')](handleError(_0x3b7be0,null));};exports[_0x881b('0x48')]=function(_0x51f8c6,_0x46db14){return db[_0x881b('0x2d')][_0x881b('0x48')](_0x51f8c6[_0x881b('0x49')],{})[_0x881b('0x28')](respondWithResult(_0x46db14,0xc9))['catch'](handleError(_0x46db14,null));};exports['update']=function(_0x1d5976,_0x584ae6){if(_0x1d5976[_0x881b('0x49')]['id']){delete _0x1d5976[_0x881b('0x49')]['id'];}return db[_0x881b('0x2d')][_0x881b('0x46')]({'where':{'id':_0x1d5976[_0x881b('0x43')]['id']}})[_0x881b('0x28')](handleEntityNotFound(_0x584ae6,null))[_0x881b('0x28')](saveUpdates(_0x1d5976[_0x881b('0x49')],null))[_0x881b('0x28')](respondWithResult(_0x584ae6,null))[_0x881b('0x47')](handleError(_0x584ae6,null));};exports[_0x881b('0x27')]=function(_0x5d55bb,_0x4a75d8){return db[_0x881b('0x2d')][_0x881b('0x46')]({'where':{'id':_0x5d55bb['params']['id']}})[_0x881b('0x28')](handleEntityNotFound(_0x4a75d8,null))[_0x881b('0x28')](removeEntity(_0x4a75d8,null))[_0x881b('0x47')](handleError(_0x4a75d8,null));};
\ No newline at end of file
index e5900d4..49c5d42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f5b=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5f5b,0x1a0));var _0xb5f5=function(_0x1b6892,_0x2dc098){_0x1b6892=_0x1b6892-0x0;var _0x1a5b81=_0x5f5b[_0x1b6892];return _0x1a5b81;};'use strict';var _=require(_0xb5f5('0x0'));var util=require(_0xb5f5('0x1'));var logger=require('../../config/logger')(_0xb5f5('0x2'));var moment=require(_0xb5f5('0x3'));var BPromise=require(_0xb5f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb5f5('0x5'));var config=require(_0xb5f5('0x6'));var attributes=require(_0xb5f5('0x7'));module['exports']=function(_0x5eaa62,_0x27ba3b){return _0x5eaa62[_0xb5f5('0x8')](_0xb5f5('0x9'),attributes,{'tableName':_0xb5f5('0xa'),'paranoid':![],'indexes':[{'name':_0xb5f5('0xb'),'fields':['idField',_0xb5f5('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5977=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','FieldId','util','../../config/logger','api'];(function(_0x3465e6,_0x15fcb3){var _0x4f591b=function(_0x2544a2){while(--_0x2544a2){_0x3465e6['push'](_0x3465e6['shift']());}};_0x4f591b(++_0x15fcb3);}(_0x5977,0x14d));var _0x7597=function(_0x2cfcd6,_0x3fd1d2){_0x2cfcd6=_0x2cfcd6-0x0;var _0x2f277f=_0x5977[_0x2cfcd6];return _0x2f277f;};'use strict';var _=require('lodash');var util=require(_0x7597('0x0'));var logger=require(_0x7597('0x1'))(_0x7597('0x2'));var moment=require(_0x7597('0x3'));var BPromise=require(_0x7597('0x4'));var rp=require(_0x7597('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7597('0x6'));var config=require(_0x7597('0x7'));var attributes=require(_0x7597('0x8'));module[_0x7597('0x9')]=function(_0x29b3a0,_0x5caeab){return _0x29b3a0[_0x7597('0xa')](_0x7597('0xb'),attributes,{'tableName':_0x7597('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x7597('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e79f1ed..098ded1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x916b=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2fc11a,_0x1d412f){var _0x5f2fec=function(_0x321030){while(--_0x321030){_0x2fc11a['push'](_0x2fc11a['shift']());}};_0x5f2fec(++_0x1d412f);}(_0x916b,0x1bb));var _0xb916=function(_0x227e88,_0x93e719){_0x227e88=_0x227e88-0x0;var _0xbfca45=_0x916b[_0x227e88];return _0xbfca45;};'use strict';var _=require(_0xb916('0x0'));var util=require(_0xb916('0x1'));var moment=require(_0xb916('0x2'));var BPromise=require('bluebird');var rs=require(_0xb916('0x3'));var fs=require('fs');var Redis=require(_0xb916('0x4'));var db=require(_0xb916('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb916('0x6'))(_0xb916('0x7'));var config=require(_0xb916('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb916('0x9')][_0xb916('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10e7bf,_0x1b1584,_0x414a46){return new BPromise(function(_0x21085b,_0x1336f5){return client['request'](_0x10e7bf,_0x414a46)[_0xb916('0xb')](function(_0x112adf){logger[_0xb916('0xc')](_0xb916('0xd'),_0x1b1584,_0xb916('0xe'));logger[_0xb916('0xf')](_0xb916('0x10'),_0x1b1584,_0xb916('0xe'),JSON[_0xb916('0x11')](_0x112adf));if(_0x112adf['error']){if(_0x112adf[_0xb916('0x12')]['code']===0x1f4){logger[_0xb916('0x12')](_0xb916('0xd'),_0x1b1584,_0x112adf[_0xb916('0x12')][_0xb916('0x13')]);return _0x1336f5(_0x112adf[_0xb916('0x12')][_0xb916('0x13')]);}logger[_0xb916('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1b1584,_0x112adf[_0xb916('0x12')][_0xb916('0x13')]);return _0x21085b(_0x112adf[_0xb916('0x12')][_0xb916('0x13')]);}else{logger[_0xb916('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1b1584,'request\x20sent');_0x21085b(_0x112adf[_0xb916('0x14')][_0xb916('0x13')]);}})[_0xb916('0x15')](function(_0x5b7363){logger[_0xb916('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1b1584,_0x5b7363);_0x1336f5(_0x5b7363);});});}
\ No newline at end of file
+var _0x0ceb=['client','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3cd194,_0x52a84f){var _0x264f14=function(_0x575183){while(--_0x575183){_0x3cd194['push'](_0x3cd194['shift']());}};_0x264f14(++_0x52a84f);}(_0x0ceb,0x186));var _0xb0ce=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0ceb[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb0ce('0x0'));var util=require(_0xb0ce('0x1'));var moment=require(_0xb0ce('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0ce('0x3'));var db=require(_0xb0ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0ce('0x5'))(_0xb0ce('0x6'));var config=require(_0xb0ce('0x7'));var jayson=require(_0xb0ce('0x8'));var client=jayson[_0xb0ce('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fb5a8,_0x90e86a,_0x5e56f8){return new BPromise(function(_0x256939,_0xfc466e){return client['request'](_0x2fb5a8,_0x5e56f8)[_0xb0ce('0xa')](function(_0x23a956){logger['info'](_0xb0ce('0xb'),_0x90e86a,_0xb0ce('0xc'));logger[_0xb0ce('0xd')](_0xb0ce('0xe'),_0x90e86a,_0xb0ce('0xc'),JSON[_0xb0ce('0xf')](_0x23a956));if(_0x23a956[_0xb0ce('0x10')]){if(_0x23a956[_0xb0ce('0x10')][_0xb0ce('0x11')]===0x1f4){logger[_0xb0ce('0x10')]('SalesforceField,\x20%s,\x20%s',_0x90e86a,_0x23a956[_0xb0ce('0x10')][_0xb0ce('0x12')]);return _0xfc466e(_0x23a956[_0xb0ce('0x10')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x90e86a,_0x23a956[_0xb0ce('0x10')]['message']);return _0x256939(_0x23a956['error'][_0xb0ce('0x12')]);}else{logger[_0xb0ce('0x13')](_0xb0ce('0xb'),_0x90e86a,_0xb0ce('0xc'));_0x256939(_0x23a956[_0xb0ce('0x14')]['message']);}})['catch'](function(_0x1830c7){logger[_0xb0ce('0x10')](_0xb0ce('0xb'),_0x90e86a,_0x1830c7);_0xfc466e(_0x1830c7);});});}
\ No newline at end of file
index c4ce4cf..e4e3ffa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ece=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports'];(function(_0x54654,_0x1d637e){var _0x240b1f=function(_0x3065b6){while(--_0x3065b6){_0x54654['push'](_0x54654['shift']());}};_0x240b1f(++_0x1d637e);}(_0x7ece,0x1e3));var _0xe7ec=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x7ece[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0xe7ec('0x0'));var util=require(_0xe7ec('0x1'));var path=require(_0xe7ec('0x2'));var timeout=require(_0xe7ec('0x3'));var express=require('express');var router=express[_0xe7ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ec('0x5'));var interaction=require(_0xe7ec('0x6'));var config=require(_0xe7ec('0x7'));var controller=require(_0xe7ec('0x8'));router[_0xe7ec('0x9')]('/',auth[_0xe7ec('0xa')](),controller['index']);router[_0xe7ec('0x9')](_0xe7ec('0xb'),auth['isAuthenticated'](),controller[_0xe7ec('0xc')]);router['get'](_0xe7ec('0xd'),auth[_0xe7ec('0xa')](),controller[_0xe7ec('0xe')]);router[_0xe7ec('0x9')](_0xe7ec('0xf'),auth[_0xe7ec('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xe7ec('0x10')]);router[_0xe7ec('0x11')](_0xe7ec('0xd'),auth[_0xe7ec('0xa')](),controller[_0xe7ec('0x12')]);router[_0xe7ec('0x13')](_0xe7ec('0xb'),auth[_0xe7ec('0xa')](),controller['update']);router[_0xe7ec('0x14')](_0xe7ec('0xb'),auth[_0xe7ec('0xa')](),controller[_0xe7ec('0x15')]);module[_0xe7ec('0x16')]=router;
\ No newline at end of file
+var _0x845b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x57a9c6,_0x5a6819){var _0x42febc=function(_0x23139b){while(--_0x23139b){_0x57a9c6['push'](_0x57a9c6['shift']());}};_0x42febc(++_0x5a6819);}(_0x845b,0x1ab));var _0xb845=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0x845b[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0xb845('0x0'));var util=require(_0xb845('0x1'));var path=require(_0xb845('0x2'));var timeout=require(_0xb845('0x3'));var express=require('express');var router=express[_0xb845('0x4')]();var fs_extra=require(_0xb845('0x5'));var auth=require(_0xb845('0x6'));var interaction=require(_0xb845('0x7'));var config=require(_0xb845('0x8'));var controller=require('./intServicenowAccount.controller');router[_0xb845('0x9')]('/',auth['isAuthenticated'](),controller[_0xb845('0xa')]);router[_0xb845('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb845('0x9')](_0xb845('0xb'),auth[_0xb845('0xc')](),controller[_0xb845('0xd')]);router[_0xb845('0x9')](_0xb845('0xe'),auth['isAuthenticated'](),controller[_0xb845('0xf')]);router[_0xb845('0x10')]('/',auth[_0xb845('0xc')](),controller['create']);router[_0xb845('0x10')](_0xb845('0xb'),auth[_0xb845('0xc')](),controller[_0xb845('0x11')]);router[_0xb845('0x12')](_0xb845('0x13'),auth[_0xb845('0xc')](),controller[_0xb845('0x14')]);router[_0xb845('0x15')](_0xb845('0x13'),auth[_0xb845('0xc')](),controller[_0xb845('0x16')]);module[_0xb845('0x17')]=router;
\ No newline at end of file
index c7a74cd..ca55d2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd92=['sequelize','STRING','username'];(function(_0x400bf6,_0x36c629){var _0x2b0198=function(_0x58534a){while(--_0x58534a){_0x400bf6['push'](_0x400bf6['shift']());}};_0x2b0198(++_0x36c629);}(_0xfd92,0x14a));var _0x2fd9=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0xfd92[_0x348860];return _0x2fc2ad;};'use strict';var Sequelize=require(_0x2fd9('0x0'));module['exports']={'name':{'type':Sequelize[_0x2fd9('0x1')]},'description':{'type':Sequelize[_0x2fd9('0x1')]},'username':{'type':Sequelize[_0x2fd9('0x1')],'unique':_0x2fd9('0x2')},'password':{'type':Sequelize[_0x2fd9('0x1')]},'email':{'type':Sequelize[_0x2fd9('0x1')]},'remoteUri':{'type':Sequelize[_0x2fd9('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2fd9('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x44d0=['sequelize','STRING'];(function(_0x5464ab,_0x329d11){var _0x15432c=function(_0x451994){while(--_0x451994){_0x5464ab['push'](_0x5464ab['shift']());}};_0x15432c(++_0x329d11);}(_0x44d0,0x90));var _0x044d=function(_0x327696,_0x577565){_0x327696=_0x327696-0x0;var _0x20fb80=_0x44d0[_0x327696];return _0x20fb80;};'use strict';var Sequelize=require(_0x044d('0x0'));module['exports']={'name':{'type':Sequelize[_0x044d('0x1')]},'description':{'type':Sequelize[_0x044d('0x1')]},'username':{'type':Sequelize[_0x044d('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x044d('0x1')]},'remoteUri':{'type':Sequelize[_0x044d('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index ae26ca5..0756891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4599=['caller_id','approval_set','work_notes','delivery_task','assignment_group','business_stc','additional_assignee_list','description','notify','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','upon_approval','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','forEach','push','all','assign','includes','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','knowledge','subcategory','close_code','category','parent','made_sla','caused_by','watch_list','upon_reject','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at'];(function(_0x4e6fa8,_0x3dde63){var _0x31bf97=function(_0x1df785){while(--_0x1df785){_0x4e6fa8['push'](_0x4e6fa8['shift']());}};_0x31bf97(++_0x3dde63);}(_0x4599,0x1c0));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9459('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9459('0x1'));var jsonpatch=require(_0x9459('0x2'));var rp=require(_0x9459('0x3'));var moment=require('moment');var BPromise=require(_0x9459('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9459('0x5'));var sox=require(_0x9459('0x6'));var csv=require(_0x9459('0x7'));var ejs=require(_0x9459('0x8'));var fs=require('fs');var fs_extra=require(_0x9459('0x9'));var _=require(_0x9459('0xa'));var squel=require(_0x9459('0xb'));var crypto=require(_0x9459('0xc'));var jsforce=require(_0x9459('0xd'));var deskjs=require(_0x9459('0xe'));var toCsv=require(_0x9459('0x7'));var querystring=require(_0x9459('0xf'));var Papa=require(_0x9459('0x10'));var Redis=require(_0x9459('0x11'));var authService=require(_0x9459('0x12'));var qs=require(_0x9459('0x13'));var as=require(_0x9459('0x14'));var hardwareService=require(_0x9459('0x15'));var logger=require(_0x9459('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9459('0x17'));var db=require(_0x9459('0x18'))['db'];var integrations=require(_0x9459('0x19'));function respondWithStatusCode(_0x51a933,_0x3809cb){_0x3809cb=_0x3809cb||0xcc;return function(_0x1bd26d){if(_0x1bd26d){return _0x51a933[_0x9459('0x1a')](_0x3809cb);}return _0x51a933[_0x9459('0x1b')](_0x3809cb)[_0x9459('0x1c')]();};}function respondWithResult(_0x2672d4,_0x48ad29){_0x48ad29=_0x48ad29||0xc8;return function(_0x33cc86){if(_0x33cc86){return _0x2672d4[_0x9459('0x1b')](_0x48ad29)[_0x9459('0x1d')](_0x33cc86);}};}function respondWithFilteredResult(_0x2c1b97,_0x37e2b3){return function(_0xc83e7c){if(_0xc83e7c){var _0x15a594=typeof _0x37e2b3[_0x9459('0x1e')]==='undefined'&&typeof _0x37e2b3[_0x9459('0x1f')]===_0x9459('0x20');var _0x499b8a=_0xc83e7c[_0x9459('0x21')];var _0x12d7ea=_0x15a594?0x0:_0x37e2b3[_0x9459('0x1e')];var _0x1c0f9a=_0x15a594?_0xc83e7c[_0x9459('0x21')]:_0x37e2b3['offset']+_0x37e2b3[_0x9459('0x1f')];var _0x557486;if(_0x1c0f9a>=_0x499b8a){_0x1c0f9a=_0x499b8a;_0x557486=0xc8;}else{_0x557486=0xce;}_0x2c1b97[_0x9459('0x1b')](_0x557486);return _0x2c1b97['set'](_0x9459('0x22'),_0x12d7ea+'-'+_0x1c0f9a+'/'+_0x499b8a)['json'](_0xc83e7c);}return null;};}function patchUpdates(_0x3b3f01){return function(_0xe2ace){try{jsonpatch[_0x9459('0x23')](_0xe2ace,_0x3b3f01,!![]);}catch(_0x365800){return BPromise[_0x9459('0x24')](_0x365800);}return _0xe2ace[_0x9459('0x25')]();};}function saveUpdates(_0x13449e,_0x1fb4b4){return function(_0x396a4e){if(_0x396a4e){return _0x396a4e[_0x9459('0x26')](_0x13449e)[_0x9459('0x27')](function(_0x21c3ef){return _0x21c3ef;});}return null;};}function removeEntity(_0x6decec,_0x2ffd5d){return function(_0x381a68){if(_0x381a68){return _0x381a68['destroy']()[_0x9459('0x27')](function(){_0x6decec[_0x9459('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe0276f,_0x5e28ff){return function(_0x91e511){if(!_0x91e511){_0xe0276f[_0x9459('0x1a')](0x194);}return _0x91e511;};}function handleError(_0x2b0196,_0x1af34b){_0x1af34b=_0x1af34b||0x1f4;return function(_0x5eeed7){logger[_0x9459('0x28')](_0x5eeed7[_0x9459('0x29')]);if(_0x5eeed7[_0x9459('0x2a')]){delete _0x5eeed7[_0x9459('0x2a')];}_0x2b0196['status'](_0x1af34b)[_0x9459('0x2b')](_0x5eeed7);};}exports[_0x9459('0x2c')]=function(_0x3587f8,_0x4978b6){var _0x15436a={},_0x48c5b4={},_0x7bf99a={'count':0x0,'rows':[]};var _0x151697=_[_0x9459('0x2d')](db[_0x9459('0x2e')][_0x9459('0x2f')],function(_0x50496a){return{'name':_0x50496a[_0x9459('0x30')],'type':_0x50496a['type'][_0x9459('0x31')]};});_0x48c5b4['model']=_[_0x9459('0x2d')](_0x151697,'name');_0x48c5b4[_0x9459('0x32')]=_[_0x9459('0x33')](_0x3587f8[_0x9459('0x32')]);_0x48c5b4['filters']=_[_0x9459('0x34')](_0x48c5b4[_0x9459('0x35')],_0x48c5b4[_0x9459('0x32')]);_0x15436a[_0x9459('0x36')]=_['intersection'](_0x48c5b4[_0x9459('0x35')],qs[_0x9459('0x37')](_0x3587f8[_0x9459('0x32')][_0x9459('0x37')]));_0x15436a['attributes']=_0x15436a[_0x9459('0x36')][_0x9459('0x38')]?_0x15436a[_0x9459('0x36')]:_0x48c5b4[_0x9459('0x35')];if(!_0x3587f8[_0x9459('0x32')][_0x9459('0x39')](_0x9459('0x3a'))){_0x15436a[_0x9459('0x1f')]=qs[_0x9459('0x1f')](_0x3587f8[_0x9459('0x32')][_0x9459('0x1f')]);_0x15436a[_0x9459('0x1e')]=qs[_0x9459('0x1e')](_0x3587f8['query'][_0x9459('0x1e')]);}_0x15436a[_0x9459('0x3b')]=qs[_0x9459('0x3c')](_0x3587f8[_0x9459('0x32')][_0x9459('0x3c')]);_0x15436a['where']=qs[_0x9459('0x3d')](_[_0x9459('0x3e')](_0x3587f8[_0x9459('0x32')],_0x48c5b4[_0x9459('0x3d')]),_0x151697);if(_0x3587f8[_0x9459('0x32')][_0x9459('0x3f')]){_0x15436a['where']=_[_0x9459('0x40')](_0x15436a[_0x9459('0x41')],{'$or':_[_0x9459('0x2d')](_0x151697,function(_0x2896fc){if(_0x2896fc[_0x9459('0x42')]!==_0x9459('0x43')){var _0x174175={};_0x174175[_0x2896fc[_0x9459('0x2a')]]={'$like':'%'+_0x3587f8[_0x9459('0x32')][_0x9459('0x3f')]+'%'};return _0x174175;}})});}_0x15436a=_[_0x9459('0x40')]({},_0x15436a,_0x3587f8[_0x9459('0x44')]);var _0x13f2eb={'where':_0x15436a[_0x9459('0x41')]};return db['ServicenowAccount'][_0x9459('0x21')](_0x13f2eb)['then'](function(_0x8be008){_0x7bf99a['count']=_0x8be008;if(_0x3587f8[_0x9459('0x32')][_0x9459('0x45')]){_0x15436a[_0x9459('0x46')]=[{'all':!![]}];}return db[_0x9459('0x2e')][_0x9459('0x47')](_0x15436a);})['then'](function(_0xa98734){_0x7bf99a[_0x9459('0x48')]=_0xa98734;return _0x7bf99a;})[_0x9459('0x27')](respondWithFilteredResult(_0x4978b6,_0x15436a))['catch'](handleError(_0x4978b6,null));};exports[_0x9459('0x49')]=function(_0x4e780f,_0xefd886){var _0x2feb66={'raw':![],'where':{'id':_0x4e780f[_0x9459('0x4a')]['id']}},_0x2f5e3d={};_0x2f5e3d[_0x9459('0x35')]=_[_0x9459('0x33')](db[_0x9459('0x2e')][_0x9459('0x2f')]);_0x2f5e3d[_0x9459('0x32')]=_[_0x9459('0x33')](_0x4e780f['query']);_0x2f5e3d[_0x9459('0x3d')]=_[_0x9459('0x34')](_0x2f5e3d['model'],_0x2f5e3d[_0x9459('0x32')]);_0x2feb66['attributes']=_['intersection'](_0x2f5e3d[_0x9459('0x35')],qs[_0x9459('0x37')](_0x4e780f['query']['fields']));_0x2feb66[_0x9459('0x36')]=_0x2feb66['attributes'][_0x9459('0x38')]?_0x2feb66[_0x9459('0x36')]:_0x2f5e3d[_0x9459('0x35')];if(_0x4e780f[_0x9459('0x32')][_0x9459('0x45')]){_0x2feb66[_0x9459('0x46')]=[{'all':!![]}];}_0x2feb66=_[_0x9459('0x40')]({},_0x2feb66,_0x4e780f[_0x9459('0x44')]);return db[_0x9459('0x2e')][_0x9459('0x4b')](_0x2feb66)['then'](handleEntityNotFound(_0xefd886,null))[_0x9459('0x27')](respondWithResult(_0xefd886,null))['catch'](handleError(_0xefd886,null));};exports[_0x9459('0x4c')]=function(_0x200e94,_0x3d5f07){return db[_0x9459('0x2e')]['create'](_0x200e94['body'],{})[_0x9459('0x27')](respondWithResult(_0x3d5f07,0xc9))[_0x9459('0x4d')](handleError(_0x3d5f07,null));};exports[_0x9459('0x26')]=function(_0x44991c,_0x5eede6){if(_0x44991c[_0x9459('0x4e')]['id']){delete _0x44991c['body']['id'];}return db[_0x9459('0x2e')]['find']({'where':{'id':_0x44991c[_0x9459('0x4a')]['id']}})[_0x9459('0x27')](handleEntityNotFound(_0x5eede6,null))[_0x9459('0x27')](saveUpdates(_0x44991c[_0x9459('0x4e')],null))[_0x9459('0x27')](respondWithResult(_0x5eede6,null))[_0x9459('0x4d')](handleError(_0x5eede6,null));};exports['destroy']=function(_0x2384eb,_0x5a509f){return db[_0x9459('0x2e')][_0x9459('0x4b')]({'where':{'id':_0x2384eb[_0x9459('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a509f,null))[_0x9459('0x27')](removeEntity(_0x5a509f,null))[_0x9459('0x4d')](handleError(_0x5a509f,null));};exports[_0x9459('0x4f')]=function(_0x2f54f9,_0x54489a,_0xc4467b){var _0x35dd33={};var _0x5de729={};var _0x2d9b9b;var _0x429db8;return db[_0x9459('0x2e')][_0x9459('0x50')]({'where':{'id':_0x2f54f9[_0x9459('0x4a')]['id']}})[_0x9459('0x27')](handleEntityNotFound(_0x54489a,null))[_0x9459('0x27')](function(_0x4f9c48){if(_0x4f9c48){_0x2d9b9b=_0x4f9c48;_0x5de729[_0x9459('0x35')]=_[_0x9459('0x33')](db[_0x9459('0x51')]['rawAttributes']);_0x5de729[_0x9459('0x32')]=_[_0x9459('0x33')](_0x2f54f9[_0x9459('0x32')]);_0x5de729['filters']=_[_0x9459('0x34')](_0x5de729[_0x9459('0x35')],_0x5de729[_0x9459('0x32')]);_0x35dd33[_0x9459('0x36')]=_['intersection'](_0x5de729[_0x9459('0x35')],qs[_0x9459('0x37')](_0x2f54f9['query'][_0x9459('0x37')]));_0x35dd33[_0x9459('0x36')]=_0x35dd33['attributes'][_0x9459('0x38')]?_0x35dd33[_0x9459('0x36')]:_0x5de729[_0x9459('0x35')];_0x35dd33[_0x9459('0x3b')]=qs[_0x9459('0x3c')](_0x2f54f9[_0x9459('0x32')][_0x9459('0x3c')]);_0x35dd33['where']=qs[_0x9459('0x3d')](_['pick'](_0x2f54f9[_0x9459('0x32')],_0x5de729[_0x9459('0x3d')]));if(_0x2f54f9['query']['filter']){_0x35dd33[_0x9459('0x41')]=_['merge'](_0x35dd33[_0x9459('0x41')],{'$or':_[_0x9459('0x2d')](_0x35dd33[_0x9459('0x36')],function(_0x1549f7){var _0x35c332={};_0x35c332[_0x1549f7]={'$like':'%'+_0x2f54f9[_0x9459('0x32')][_0x9459('0x3f')]+'%'};return _0x35c332;})});}_0x35dd33=_['merge']({},_0x35dd33,_0x2f54f9['options']);return _0x2d9b9b['getConfigurations'](_0x35dd33);}})[_0x9459('0x27')](function(_0x4bd125){if(_0x4bd125){_0x429db8=_0x4bd125['length'];if(!_0x2f54f9[_0x9459('0x32')][_0x9459('0x39')](_0x9459('0x3a'))){_0x35dd33[_0x9459('0x1f')]=qs['limit'](_0x2f54f9[_0x9459('0x32')][_0x9459('0x1f')]);_0x35dd33[_0x9459('0x1e')]=qs[_0x9459('0x1e')](_0x2f54f9['query'][_0x9459('0x1e')]);}return _0x2d9b9b[_0x9459('0x4f')](_0x35dd33);}})[_0x9459('0x27')](function(_0x40303a){if(_0x40303a){return _0x40303a?{'count':_0x429db8,'rows':_0x40303a}:null;}})[_0x9459('0x27')](respondWithResult(_0x54489a,null))[_0x9459('0x4d')](handleError(_0x54489a,null));};exports[_0x9459('0x52')]=function(_0x27f5af,_0x17a812,_0x342058){if(_0x27f5af[_0x9459('0x4e')]['id']){delete _0x27f5af[_0x9459('0x4e')]['id'];}return db[_0x9459('0x2e')]['findOne']({'where':{'id':_0x27f5af[_0x9459('0x4a')]['id']}})[_0x9459('0x27')](handleEntityNotFound(_0x17a812,null))[_0x9459('0x27')](function(_0x27e54b){if(_0x27e54b){_0x27f5af[_0x9459('0x4e')][_0x9459('0x53')]=_0x27e54b['id'];_0x27f5af[_0x9459('0x4e')][_0x9459('0x54')]=integrations[_0x9459('0x55')](_0x27f5af['body'][_0x9459('0x56')],_0x27f5af[_0x9459('0x4e')][_0x9459('0x42')]);_0x27f5af['body'][_0x9459('0x57')]=integrations[_0x9459('0x58')](_0x27f5af[_0x9459('0x4e')][_0x9459('0x56')],_0x27f5af[_0x9459('0x4e')][_0x9459('0x42')]);return db['ServicenowConfiguration']['create'](_0x27f5af[_0x9459('0x4e')],{'include':[{'model':db[_0x9459('0x59')],'as':_0x9459('0x54')},{'model':db[_0x9459('0x59')],'as':_0x9459('0x57')}]});}return null;})[_0x9459('0x27')](respondWithResult(_0x17a812,null))[_0x9459('0x4d')](handleError(_0x17a812,null));};exports['getFields']=function(_0x278831,_0x47f059,_0x2944e1){var _0x21e17f=['made_sla','hold_reason',_0x9459('0x5a'),_0x9459('0x5b'),_0x9459('0x5c'),'notify','incident_state','severity',_0x9459('0x5d')];var _0x458382=[_0x9459('0x5e'),_0x9459('0x5f'),_0x9459('0x60'),_0x9459('0x61'),_0x9459('0x62'),'sys_updated_on','child_incidents',_0x9459('0x63'),'approval_history',_0x9459('0x64'),_0x9459('0x65'),_0x9459('0x66'),_0x9459('0x67'),_0x9459('0x68'),_0x9459('0x69'),_0x9459('0x6a'),_0x9459('0x6b'),'sys_created_by',_0x9459('0x5a'),_0x9459('0x3b'),_0x9459('0x6c'),_0x9459('0x6d'),_0x9459('0x6e'),_0x9459('0x6f'),'impact','active',_0x9459('0x70'),_0x9459('0x71'),_0x9459('0x72'),_0x9459('0x73'),_0x9459('0x74'),_0x9459('0x75'),_0x9459('0x76'),_0x9459('0x77'),_0x9459('0x78'),_0x9459('0x79'),_0x9459('0x7a'),_0x9459('0x7b'),_0x9459('0x7c'),_0x9459('0x7d'),_0x9459('0x7e'),'subcategory',_0x9459('0x7f'),'short_description',_0x9459('0x5c'),'correlation_display',_0x9459('0x80'),'work_start',_0x9459('0x81'),_0x9459('0x82'),_0x9459('0x83'),_0x9459('0x84'),'calendar_duration',_0x9459('0x85'),_0x9459('0x86'),'close_notes',_0x9459('0x87'),_0x9459('0x88'),'parent_incident',_0x9459('0x89'),_0x9459('0x8a'),_0x9459('0x8b'),_0x9459('0x8c'),_0x9459('0x8d'),_0x9459('0x8e'),_0x9459('0x8f'),_0x9459('0x90'),_0x9459('0x91'),'assigned_to','severity',_0x9459('0x92'),_0x9459('0x93'),_0x9459('0x94'),_0x9459('0x95'),_0x9459('0x96'),'sys_mod_count',_0x9459('0x97'),_0x9459('0x98'),'escalation',_0x9459('0x99'),_0x9459('0x9a'),_0x9459('0x9b'),_0x9459('0x5d')];var _0x4e02a9='';var _0x5c27db='';var _0x3a93d2=[];var _0x506b7f='';var _0xd749a2='';var _0x578fe0=[];var _0x7ff3c8='';var _0x122442='';var _0x9112ac={};var _0x468a9c='';return db[_0x9459('0x2e')]['findOne']({'where':{'id':_0x278831['params']['id']},'attributes':['id','username',_0x9459('0x9c'),_0x9459('0x9d'),_0x9459('0x9e'),_0x9459('0x9f')]})[_0x9459('0x27')](handleEntityNotFound(_0x47f059,null))[_0x9459('0x27')](function(_0x372962){if(_0x372962){_0x468a9c=_0x372962['remoteUri'];var _0x5258b7=_0x468a9c[_0x9459('0xa0')](-0x1);if(_0x5258b7==='/'){_0x468a9c=_0x468a9c[_0x9459('0xa1')](0x0,_0x468a9c[_0x9459('0xa2')](_0x5258b7));}_0x122442=util['format'](_0x9459('0xa3'),_0x468a9c);_0x7ff3c8=util[_0x9459('0xa4')](_0x9459('0xa5'),_0x468a9c);_0x9112ac={'user':_0x372962[_0x9459('0xa6')],'pass':_0x372962[_0x9459('0x9c')]};var _0x53f646={'method':_0x9459('0xa7'),'uri':_0x122442+_0x9459('0xa8'),'auth':_0x9112ac,'json':!![]};return rp(_0x53f646);}})['then'](function(_0x4474a9){if(_0x4474a9[_0x9459('0xa9')]['length']>0x0){_0x4e02a9=_0x4474a9[_0x9459('0xa9')];}console['log'](_0x9459('0xaa'),_0x4e02a9);_0x578fe0=[];_0x5c27db=Object['assign']([],_0x4e02a9);_[_0x9459('0xab')](_0x5c27db,function(_0x2af74d){return!_0x21e17f['includes'](_0x2af74d[_0x9459('0x2a')]);});_0x5c27db[_0x9459('0xac')](function(_0x1c852c){var _0x2d37c2=createFieldObject(_0x7ff3c8,_0x9112ac,_0x1c852c['internalType'],_0x1c852c['name'],_0x1c852c['label'],![]);_0x578fe0[_0x9459('0xad')](_0x2d37c2);});return Promise[_0x9459('0xae')](_0x578fe0);})[_0x9459('0x27')](function(_0x48ed8f){_0x3a93d2=_0x48ed8f;_0x506b7f=Object[_0x9459('0xaf')]([],_0x4e02a9);console['log']('TCL:\x20_object',_0x4e02a9);_['remove'](_0x506b7f,function(_0x1b3883){return _0x458382[_0x9459('0xb0')](_0x1b3883['name']);});console[_0x9459('0xb1')](_0x9459('0xb2'),_0x506b7f);_0x578fe0=[];_0x506b7f[_0x9459('0xac')](function(_0x2fef3b){var _0xc6e0db=createFieldObject(_0x7ff3c8,_0x9112ac,_0x2fef3b['internalType'],_0x2fef3b[_0x9459('0x2a')],_0x2fef3b[_0x9459('0xb3')],!![]);_0x578fe0[_0x9459('0xad')](_0xc6e0db);});return Promise['all'](_0x578fe0);})[_0x9459('0x27')](function(_0x1131a1){_0xd749a2=_0x1131a1;var _0xbe4585=_0x3a93d2[_0x9459('0xb4')](_0xd749a2);return{'count':_0xbe4585[_0x9459('0x38')],'rows':_0xbe4585};})[_0x9459('0x27')](respondWithResult(_0x47f059,null))[_0x9459('0x4d')](function(_0xbdfbaf){console[_0x9459('0xb1')](_0x9459('0xb5')+_0xbdfbaf);var _0x46e4d1=_0x278831[_0x9459('0x32')][_0x9459('0xb6')]?0x1f4:_0xbdfbaf[_0x9459('0xb7')]||0x1f4;logger['error'](_0xbdfbaf[_0x9459('0x29')]);delete _0xbdfbaf[_0x9459('0x2a')];if(_0x46e4d1===0x191){_0x46e4d1=0x190;}_0x47f059['status'](_0x46e4d1)[_0x9459('0x2b')](_0x278831['query'][_0x9459('0xb6')]?{'message':_0x9459('0xb8'),'statusCode':_0xbdfbaf['statusCode']}:_0xbdfbaf);});};function createFieldObject(_0x53e35b,_0x1b5951,_0x4d9331,_0x3efd25,_0x5d035c,_0xe3a800){return new Promise(function(_0x86a9e5,_0x2acd52){var _0x2e5deb={'id':_0x3efd25,'name':_0x5d035c,'custom':_0xe3a800};if(_0x4d9331===_0x9459('0xb9')){_0x2e5deb[_0x9459('0x44')]=[{'name':_0x9459('0xba'),'value':'true'},{'name':'False','value':_0x9459('0xbb')}];_0x86a9e5(_0x2e5deb);}else{var _0x3e95a3={'method':_0x9459('0xa7'),'uri':_0x53e35b+_0x9459('0xbc')+_0x3efd25,'auth':_0x1b5951,'json':!![]};return rp(_0x3e95a3)[_0x9459('0x27')](function(_0x13ce6f){var _0x46c86f=[];if(_0x13ce6f[_0x9459('0xa9')][_0x9459('0x38')]>0x0){_0x13ce6f['result']['forEach'](function(_0x3dcbb6){if(_0x3dcbb6[_0x9459('0xbd')]===_0x9459('0xbb')){var _0x5a8b6f={'name':_0x3dcbb6[_0x9459('0xb3')],'value':_0x3dcbb6[_0x9459('0xbe')]};_0x46c86f[_0x9459('0xad')](_0x5a8b6f);}});}_0x2e5deb[_0x9459('0x44')]=_0x46c86f;if(_0x2e5deb[_0x9459('0x44')][_0x9459('0x38')]>0x0){_0x86a9e5(_0x2e5deb);}else{if(_0xe3a800==![]){_0x86a9e5();}else{_0x86a9e5(_0x2e5deb);}}});}});}
\ No newline at end of file
+var _0x2e4e=['work_start','business_stc','additional_assignee_list','description','calendar_duration','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','format','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','statusCode','error','test','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','crypto','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','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','ServicenowAccount','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','then','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','filter','addConfiguration','AccountId','Subjects','getDescriptions','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2e4e,0xf3));var _0xe2e4=function(_0x4d6b01,_0x40465d){_0x4d6b01=_0x4d6b01-0x0;var _0x3eecf1=_0x2e4e[_0x4d6b01];return _0x3eecf1;};'use strict';var emlformat=require(_0xe2e4('0x0'));var rimraf=require(_0xe2e4('0x1'));var zipdir=require(_0xe2e4('0x2'));var jsonpatch=require(_0xe2e4('0x3'));var rp=require(_0xe2e4('0x4'));var moment=require('moment');var BPromise=require(_0xe2e4('0x5'));var Mustache=require('mustache');var util=require(_0xe2e4('0x6'));var path=require(_0xe2e4('0x7'));var sox=require(_0xe2e4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2e4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe2e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe2e4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2e4('0xc'));var Redis=require(_0xe2e4('0xd'));var authService=require(_0xe2e4('0xe'));var qs=require(_0xe2e4('0xf'));var as=require(_0xe2e4('0x10'));var hardwareService=require(_0xe2e4('0x11'));var logger=require(_0xe2e4('0x12'))(_0xe2e4('0x13'));var utils=require(_0xe2e4('0x14'));var config=require(_0xe2e4('0x15'));var licenseUtil=require(_0xe2e4('0x16'));var db=require(_0xe2e4('0x17'))['db'];var integrations=require(_0xe2e4('0x18'));function respondWithStatusCode(_0x2ea99b,_0x2991f1){_0x2991f1=_0x2991f1||0xcc;return function(_0x4f5a71){if(_0x4f5a71){return _0x2ea99b[_0xe2e4('0x19')](_0x2991f1);}return _0x2ea99b[_0xe2e4('0x1a')](_0x2991f1)[_0xe2e4('0x1b')]();};}function respondWithResult(_0x4b87f3,_0x26e817){_0x26e817=_0x26e817||0xc8;return function(_0xc77432){if(_0xc77432){return _0x4b87f3[_0xe2e4('0x1a')](_0x26e817)['json'](_0xc77432);}};}function respondWithFilteredResult(_0xec3ad8,_0x48e410){return function(_0x548df5){if(_0x548df5){var _0x53e31f=typeof _0x48e410['offset']===_0xe2e4('0x1c')&&typeof _0x48e410[_0xe2e4('0x1d')]===_0xe2e4('0x1c');var _0x575fff=_0x548df5[_0xe2e4('0x1e')];var _0x22dda9=_0x53e31f?0x0:_0x48e410[_0xe2e4('0x1f')];var _0x4796fd=_0x53e31f?_0x548df5['count']:_0x48e410[_0xe2e4('0x1f')]+_0x48e410[_0xe2e4('0x1d')];var _0x1ef757;if(_0x4796fd>=_0x575fff){_0x4796fd=_0x575fff;_0x1ef757=0xc8;}else{_0x1ef757=0xce;}_0xec3ad8[_0xe2e4('0x1a')](_0x1ef757);return _0xec3ad8[_0xe2e4('0x20')](_0xe2e4('0x21'),_0x22dda9+'-'+_0x4796fd+'/'+_0x575fff)[_0xe2e4('0x22')](_0x548df5);}return null;};}function patchUpdates(_0x9129da){return function(_0x4148cf){try{jsonpatch[_0xe2e4('0x23')](_0x4148cf,_0x9129da,!![]);}catch(_0x3cc397){return BPromise[_0xe2e4('0x24')](_0x3cc397);}return _0x4148cf[_0xe2e4('0x25')]();};}function saveUpdates(_0xe7077f,_0x538398){return function(_0x56be19){if(_0x56be19){return _0x56be19['update'](_0xe7077f)['then'](function(_0x256e2a){return _0x256e2a;});}return null;};}function removeEntity(_0x3f7682,_0x1340ea){return function(_0x4a8f8d){if(_0x4a8f8d){return _0x4a8f8d[_0xe2e4('0x26')]()['then'](function(){_0x3f7682['status'](0xcc)[_0xe2e4('0x1b')]();});}};}function handleEntityNotFound(_0x3be323,_0x333f11){return function(_0x24cb5d){if(!_0x24cb5d){_0x3be323[_0xe2e4('0x19')](0x194);}return _0x24cb5d;};}function handleError(_0x5f57af,_0x26882a){_0x26882a=_0x26882a||0x1f4;return function(_0x555d16){logger['error'](_0x555d16[_0xe2e4('0x27')]);if(_0x555d16[_0xe2e4('0x28')]){delete _0x555d16[_0xe2e4('0x28')];}_0x5f57af[_0xe2e4('0x1a')](_0x26882a)[_0xe2e4('0x29')](_0x555d16);};}exports['index']=function(_0x2d6fee,_0x108f62){var _0x1640d2={},_0x52c22a={},_0x41e457={'count':0x0,'rows':[]};var _0x49601d=_[_0xe2e4('0x2a')](db[_0xe2e4('0x2b')]['rawAttributes'],function(_0x38b295){return{'name':_0x38b295[_0xe2e4('0x2c')],'type':_0x38b295['type'][_0xe2e4('0x2d')]};});_0x52c22a[_0xe2e4('0x2e')]=_[_0xe2e4('0x2a')](_0x49601d,'name');_0x52c22a['query']=_[_0xe2e4('0x2f')](_0x2d6fee['query']);_0x52c22a[_0xe2e4('0x30')]=_['intersection'](_0x52c22a[_0xe2e4('0x2e')],_0x52c22a[_0xe2e4('0x31')]);_0x1640d2[_0xe2e4('0x32')]=_[_0xe2e4('0x33')](_0x52c22a['model'],qs[_0xe2e4('0x34')](_0x2d6fee[_0xe2e4('0x31')]['fields']));_0x1640d2[_0xe2e4('0x32')]=_0x1640d2[_0xe2e4('0x32')][_0xe2e4('0x35')]?_0x1640d2[_0xe2e4('0x32')]:_0x52c22a['model'];if(!_0x2d6fee[_0xe2e4('0x31')][_0xe2e4('0x36')](_0xe2e4('0x37'))){_0x1640d2[_0xe2e4('0x1d')]=qs[_0xe2e4('0x1d')](_0x2d6fee[_0xe2e4('0x31')][_0xe2e4('0x1d')]);_0x1640d2[_0xe2e4('0x1f')]=qs[_0xe2e4('0x1f')](_0x2d6fee[_0xe2e4('0x31')][_0xe2e4('0x1f')]);}_0x1640d2[_0xe2e4('0x38')]=qs[_0xe2e4('0x39')](_0x2d6fee[_0xe2e4('0x31')]['sort']);_0x1640d2[_0xe2e4('0x3a')]=qs[_0xe2e4('0x30')](_[_0xe2e4('0x3b')](_0x2d6fee['query'],_0x52c22a['filters']),_0x49601d);if(_0x2d6fee[_0xe2e4('0x31')]['filter']){_0x1640d2[_0xe2e4('0x3a')]=_[_0xe2e4('0x3c')](_0x1640d2[_0xe2e4('0x3a')],{'$or':_[_0xe2e4('0x2a')](_0x49601d,function(_0x4d2767){if(_0x4d2767[_0xe2e4('0x3d')]!=='VIRTUAL'){var _0x21a2fa={};_0x21a2fa[_0x4d2767['name']]={'$like':'%'+_0x2d6fee['query']['filter']+'%'};return _0x21a2fa;}})});}_0x1640d2=_[_0xe2e4('0x3c')]({},_0x1640d2,_0x2d6fee[_0xe2e4('0x3e')]);var _0x419072={'where':_0x1640d2[_0xe2e4('0x3a')]};return db[_0xe2e4('0x2b')][_0xe2e4('0x1e')](_0x419072)[_0xe2e4('0x3f')](function(_0x2d9699){_0x41e457['count']=_0x2d9699;if(_0x2d6fee[_0xe2e4('0x31')][_0xe2e4('0x40')]){_0x1640d2[_0xe2e4('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xe2e4('0x42')](_0x1640d2);})['then'](function(_0x34afbd){_0x41e457[_0xe2e4('0x43')]=_0x34afbd;return _0x41e457;})[_0xe2e4('0x3f')](respondWithFilteredResult(_0x108f62,_0x1640d2))[_0xe2e4('0x44')](handleError(_0x108f62,null));};exports['show']=function(_0x58e36b,_0x9fa64e){var _0x181fcf={'raw':![],'where':{'id':_0x58e36b['params']['id']}},_0x202c97={};_0x202c97[_0xe2e4('0x2e')]=_[_0xe2e4('0x2f')](db[_0xe2e4('0x2b')][_0xe2e4('0x45')]);_0x202c97[_0xe2e4('0x31')]=_[_0xe2e4('0x2f')](_0x58e36b['query']);_0x202c97['filters']=_[_0xe2e4('0x33')](_0x202c97[_0xe2e4('0x2e')],_0x202c97[_0xe2e4('0x31')]);_0x181fcf[_0xe2e4('0x32')]=_['intersection'](_0x202c97[_0xe2e4('0x2e')],qs[_0xe2e4('0x34')](_0x58e36b[_0xe2e4('0x31')][_0xe2e4('0x34')]));_0x181fcf[_0xe2e4('0x32')]=_0x181fcf[_0xe2e4('0x32')][_0xe2e4('0x35')]?_0x181fcf['attributes']:_0x202c97[_0xe2e4('0x2e')];if(_0x58e36b[_0xe2e4('0x31')][_0xe2e4('0x40')]){_0x181fcf['include']=[{'all':!![]}];}_0x181fcf=_[_0xe2e4('0x3c')]({},_0x181fcf,_0x58e36b[_0xe2e4('0x3e')]);return db[_0xe2e4('0x2b')][_0xe2e4('0x46')](_0x181fcf)['then'](handleEntityNotFound(_0x9fa64e,null))['then'](respondWithResult(_0x9fa64e,null))[_0xe2e4('0x44')](handleError(_0x9fa64e,null));};exports[_0xe2e4('0x47')]=function(_0xd15332,_0x22c82a){return db['ServicenowAccount']['create'](_0xd15332[_0xe2e4('0x48')],{})['then'](respondWithResult(_0x22c82a,0xc9))[_0xe2e4('0x44')](handleError(_0x22c82a,null));};exports[_0xe2e4('0x49')]=function(_0x1cc944,_0x1172d4){if(_0x1cc944[_0xe2e4('0x48')]['id']){delete _0x1cc944[_0xe2e4('0x48')]['id'];}return db[_0xe2e4('0x2b')][_0xe2e4('0x46')]({'where':{'id':_0x1cc944['params']['id']}})['then'](handleEntityNotFound(_0x1172d4,null))[_0xe2e4('0x3f')](saveUpdates(_0x1cc944['body'],null))[_0xe2e4('0x3f')](respondWithResult(_0x1172d4,null))['catch'](handleError(_0x1172d4,null));};exports[_0xe2e4('0x26')]=function(_0x11c3e3,_0x26ee4c){return db['ServicenowAccount'][_0xe2e4('0x46')]({'where':{'id':_0x11c3e3[_0xe2e4('0x4a')]['id']}})[_0xe2e4('0x3f')](handleEntityNotFound(_0x26ee4c,null))[_0xe2e4('0x3f')](removeEntity(_0x26ee4c,null))[_0xe2e4('0x44')](handleError(_0x26ee4c,null));};exports[_0xe2e4('0x4b')]=function(_0x364cb8,_0x2c76be,_0xd53a89){var _0x1725bc={};var _0x1195ab={};var _0x5c0d9e;var _0xcf8bef;return db[_0xe2e4('0x2b')][_0xe2e4('0x4c')]({'where':{'id':_0x364cb8[_0xe2e4('0x4a')]['id']}})[_0xe2e4('0x3f')](handleEntityNotFound(_0x2c76be,null))[_0xe2e4('0x3f')](function(_0x10f0a4){if(_0x10f0a4){_0x5c0d9e=_0x10f0a4;_0x1195ab[_0xe2e4('0x2e')]=_[_0xe2e4('0x2f')](db[_0xe2e4('0x4d')][_0xe2e4('0x45')]);_0x1195ab[_0xe2e4('0x31')]=_[_0xe2e4('0x2f')](_0x364cb8[_0xe2e4('0x31')]);_0x1195ab[_0xe2e4('0x30')]=_['intersection'](_0x1195ab[_0xe2e4('0x2e')],_0x1195ab['query']);_0x1725bc[_0xe2e4('0x32')]=_[_0xe2e4('0x33')](_0x1195ab[_0xe2e4('0x2e')],qs[_0xe2e4('0x34')](_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x34')]));_0x1725bc[_0xe2e4('0x32')]=_0x1725bc[_0xe2e4('0x32')][_0xe2e4('0x35')]?_0x1725bc[_0xe2e4('0x32')]:_0x1195ab[_0xe2e4('0x2e')];_0x1725bc[_0xe2e4('0x38')]=qs['sort'](_0x364cb8['query']['sort']);_0x1725bc['where']=qs[_0xe2e4('0x30')](_[_0xe2e4('0x3b')](_0x364cb8[_0xe2e4('0x31')],_0x1195ab[_0xe2e4('0x30')]));if(_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x4e')]){_0x1725bc['where']=_['merge'](_0x1725bc[_0xe2e4('0x3a')],{'$or':_[_0xe2e4('0x2a')](_0x1725bc[_0xe2e4('0x32')],function(_0x5d83df){var _0xadf710={};_0xadf710[_0x5d83df]={'$like':'%'+_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x4e')]+'%'};return _0xadf710;})});}_0x1725bc=_[_0xe2e4('0x3c')]({},_0x1725bc,_0x364cb8[_0xe2e4('0x3e')]);return _0x5c0d9e[_0xe2e4('0x4b')](_0x1725bc);}})[_0xe2e4('0x3f')](function(_0xf8076c){if(_0xf8076c){_0xcf8bef=_0xf8076c[_0xe2e4('0x35')];if(!_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x36')](_0xe2e4('0x37'))){_0x1725bc[_0xe2e4('0x1d')]=qs[_0xe2e4('0x1d')](_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x1d')]);_0x1725bc['offset']=qs['offset'](_0x364cb8[_0xe2e4('0x31')][_0xe2e4('0x1f')]);}return _0x5c0d9e['getConfigurations'](_0x1725bc);}})[_0xe2e4('0x3f')](function(_0x244c13){if(_0x244c13){return _0x244c13?{'count':_0xcf8bef,'rows':_0x244c13}:null;}})[_0xe2e4('0x3f')](respondWithResult(_0x2c76be,null))[_0xe2e4('0x44')](handleError(_0x2c76be,null));};exports[_0xe2e4('0x4f')]=function(_0x1eee62,_0x1745f8,_0x2ac977){if(_0x1eee62[_0xe2e4('0x48')]['id']){delete _0x1eee62[_0xe2e4('0x48')]['id'];}return db[_0xe2e4('0x2b')][_0xe2e4('0x4c')]({'where':{'id':_0x1eee62[_0xe2e4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1745f8,null))[_0xe2e4('0x3f')](function(_0x2bb1b6){if(_0x2bb1b6){_0x1eee62[_0xe2e4('0x48')][_0xe2e4('0x50')]=_0x2bb1b6['id'];_0x1eee62[_0xe2e4('0x48')][_0xe2e4('0x51')]=integrations['getSubjects'](_0x1eee62[_0xe2e4('0x48')]['channel'],_0x1eee62[_0xe2e4('0x48')][_0xe2e4('0x3d')]);_0x1eee62[_0xe2e4('0x48')]['Descriptions']=integrations[_0xe2e4('0x52')](_0x1eee62[_0xe2e4('0x48')][_0xe2e4('0x53')],_0x1eee62[_0xe2e4('0x48')][_0xe2e4('0x3d')]);return db[_0xe2e4('0x4d')][_0xe2e4('0x47')](_0x1eee62[_0xe2e4('0x48')],{'include':[{'model':db[_0xe2e4('0x54')],'as':_0xe2e4('0x51')},{'model':db[_0xe2e4('0x54')],'as':_0xe2e4('0x55')}]});}return null;})[_0xe2e4('0x3f')](respondWithResult(_0x1745f8,null))[_0xe2e4('0x44')](handleError(_0x1745f8,null));};exports[_0xe2e4('0x56')]=function(_0x42b4b1,_0x3980c3,_0x461157){var _0x2262d6=[_0xe2e4('0x57'),_0xe2e4('0x58'),'knowledge',_0xe2e4('0x59'),_0xe2e4('0x5a'),_0xe2e4('0x5b'),_0xe2e4('0x5c'),_0xe2e4('0x5d'),_0xe2e4('0x5e')];var _0x3a9668=[_0xe2e4('0x5f'),'made_sla',_0xe2e4('0x60'),_0xe2e4('0x61'),_0xe2e4('0x62'),_0xe2e4('0x63'),_0xe2e4('0x64'),_0xe2e4('0x58'),_0xe2e4('0x65'),'number',_0xe2e4('0x66'),_0xe2e4('0x67'),'opened_by',_0xe2e4('0x68'),_0xe2e4('0x69'),_0xe2e4('0x6a'),'state',_0xe2e4('0x6b'),_0xe2e4('0x6c'),_0xe2e4('0x38'),_0xe2e4('0x6d'),_0xe2e4('0x6e'),_0xe2e4('0x6f'),_0xe2e4('0x70'),'impact',_0xe2e4('0x71'),_0xe2e4('0x72'),_0xe2e4('0x73'),_0xe2e4('0x74'),_0xe2e4('0x75'),_0xe2e4('0x76'),_0xe2e4('0x77'),_0xe2e4('0x78'),_0xe2e4('0x79'),_0xe2e4('0x7a'),'group_list',_0xe2e4('0x7b'),_0xe2e4('0x7c'),_0xe2e4('0x7d'),'caller_id',_0xe2e4('0x7e'),_0xe2e4('0x59'),_0xe2e4('0x7f'),_0xe2e4('0x80'),'close_code',_0xe2e4('0x81'),_0xe2e4('0x82'),_0xe2e4('0x83'),'assignment_group',_0xe2e4('0x84'),_0xe2e4('0x85'),_0xe2e4('0x86'),_0xe2e4('0x87'),_0xe2e4('0x5b'),'sys_class_name','close_notes',_0xe2e4('0x88'),_0xe2e4('0x89'),_0xe2e4('0x8a'),_0xe2e4('0x8b'),'contact_type',_0xe2e4('0x8c'),'incident_state',_0xe2e4('0x8d'),_0xe2e4('0x8e'),_0xe2e4('0x8f'),_0xe2e4('0x90'),_0xe2e4('0x91'),_0xe2e4('0x92'),_0xe2e4('0x5d'),'comments',_0xe2e4('0x93'),_0xe2e4('0x94'),_0xe2e4('0x95'),'due_date',_0xe2e4('0x96'),_0xe2e4('0x97'),_0xe2e4('0x98'),_0xe2e4('0x99'),'upon_approval',_0xe2e4('0x9a'),_0xe2e4('0x9b'),_0xe2e4('0x5e')];var _0x5836f2='';var _0x3e1cb2='';var _0x463487=[];var _0x417bfd='';var _0x11ea87='';var _0x5334ad=[];var _0x5e17b5='';var _0x514763='';var _0x11f724={};var _0x3ff54a='';return db[_0xe2e4('0x2b')][_0xe2e4('0x4c')]({'where':{'id':_0x42b4b1[_0xe2e4('0x4a')]['id']},'attributes':['id',_0xe2e4('0x9c'),_0xe2e4('0x9d'),_0xe2e4('0x9e'),_0xe2e4('0x9f'),_0xe2e4('0xa0')]})[_0xe2e4('0x3f')](handleEntityNotFound(_0x3980c3,null))[_0xe2e4('0x3f')](function(_0x44b393){if(_0x44b393){_0x3ff54a=_0x44b393[_0xe2e4('0x9f')];var _0x29506b=_0x3ff54a['slice'](-0x1);if(_0x29506b==='/'){_0x3ff54a=_0x3ff54a[_0xe2e4('0xa1')](0x0,_0x3ff54a['lastIndexOf'](_0x29506b));}_0x514763=util[_0xe2e4('0xa2')]('%s/api/now/doc/table/schema/',_0x3ff54a);_0x5e17b5=util[_0xe2e4('0xa2')]('%s/api/now/table/',_0x3ff54a);_0x11f724={'user':_0x44b393[_0xe2e4('0x9c')],'pass':_0x44b393[_0xe2e4('0x9d')]};var _0x3a867e={'method':_0xe2e4('0xa3'),'uri':_0x514763+_0xe2e4('0xa4'),'auth':_0x11f724,'json':!![]};return rp(_0x3a867e);}})[_0xe2e4('0x3f')](function(_0x216e7d){if(_0x216e7d[_0xe2e4('0xa5')][_0xe2e4('0x35')]>0x0){_0x5836f2=_0x216e7d['result'];}console['log'](_0xe2e4('0xa6'),_0x5836f2);_0x5334ad=[];_0x3e1cb2=Object['assign']([],_0x5836f2);_[_0xe2e4('0xa7')](_0x3e1cb2,function(_0x50d1a8){return!_0x2262d6[_0xe2e4('0xa8')](_0x50d1a8[_0xe2e4('0x28')]);});_0x3e1cb2[_0xe2e4('0xa9')](function(_0x5f41ce){var _0x44b853=createFieldObject(_0x5e17b5,_0x11f724,_0x5f41ce[_0xe2e4('0xaa')],_0x5f41ce[_0xe2e4('0x28')],_0x5f41ce[_0xe2e4('0xab')],![]);_0x5334ad['push'](_0x44b853);});return Promise[_0xe2e4('0xac')](_0x5334ad);})['then'](function(_0x30aba9){_0x463487=_0x30aba9;_0x417bfd=Object['assign']([],_0x5836f2);console[_0xe2e4('0xad')](_0xe2e4('0xae'),_0x5836f2);_['remove'](_0x417bfd,function(_0x512eed){return _0x3a9668[_0xe2e4('0xa8')](_0x512eed[_0xe2e4('0x28')]);});console['log'](_0xe2e4('0xaf'),_0x417bfd);_0x5334ad=[];_0x417bfd[_0xe2e4('0xa9')](function(_0x320763){var _0x15b752=createFieldObject(_0x5e17b5,_0x11f724,_0x320763['internalType'],_0x320763['name'],_0x320763['label'],!![]);_0x5334ad[_0xe2e4('0xb0')](_0x15b752);});return Promise[_0xe2e4('0xac')](_0x5334ad);})['then'](function(_0x4b192b){_0x11ea87=_0x4b192b;var _0x2bab4c=_0x463487['concat'](_0x11ea87);return{'count':_0x2bab4c[_0xe2e4('0x35')],'rows':_0x2bab4c};})[_0xe2e4('0x3f')](respondWithResult(_0x3980c3,null))[_0xe2e4('0x44')](function(_0x113fc2){console[_0xe2e4('0xad')]('ServiceNow\x20error:\x20'+_0x113fc2);var _0x6cd6a8=_0x42b4b1[_0xe2e4('0x31')]['test']?0x1f4:_0x113fc2[_0xe2e4('0xb1')]||0x1f4;logger[_0xe2e4('0xb2')](_0x113fc2[_0xe2e4('0x27')]);delete _0x113fc2['name'];if(_0x6cd6a8===0x191){_0x6cd6a8=0x190;}_0x3980c3[_0xe2e4('0x1a')](_0x6cd6a8)[_0xe2e4('0x29')](_0x42b4b1['query'][_0xe2e4('0xb3')]?{'message':_0xe2e4('0xb4'),'statusCode':_0x113fc2[_0xe2e4('0xb1')]}:_0x113fc2);});};function createFieldObject(_0x3ed19a,_0x105c02,_0x3235f8,_0x2b0f8a,_0x240b68,_0x5efc35){return new Promise(function(_0x70ee19,_0x2e4254){var _0x32d73b={'id':_0x2b0f8a,'name':_0x240b68,'custom':_0x5efc35};if(_0x3235f8===_0xe2e4('0xb5')){_0x32d73b['options']=[{'name':_0xe2e4('0xb6'),'value':'true'},{'name':_0xe2e4('0xb7'),'value':_0xe2e4('0xb8')}];_0x70ee19(_0x32d73b);}else{var _0x222698={'method':_0xe2e4('0xa3'),'uri':_0x3ed19a+_0xe2e4('0xb9')+_0x2b0f8a,'auth':_0x105c02,'json':!![]};return rp(_0x222698)[_0xe2e4('0x3f')](function(_0x513996){var _0x146501=[];if(_0x513996['result'][_0xe2e4('0x35')]>0x0){_0x513996[_0xe2e4('0xa5')]['forEach'](function(_0x5d0e9e){if(_0x5d0e9e[_0xe2e4('0xba')]==='false'){var _0x555959={'name':_0x5d0e9e[_0xe2e4('0xab')],'value':_0x5d0e9e['value']};_0x146501['push'](_0x555959);}});}_0x32d73b[_0xe2e4('0x3e')]=_0x146501;if(_0x32d73b[_0xe2e4('0x3e')][_0xe2e4('0x35')]>0x0){_0x70ee19(_0x32d73b);}else{if(_0x5efc35==![]){_0x70ee19();}else{_0x70ee19(_0x32d73b);}}});}});}
\ No newline at end of file
index 2d12bd0..f7d8094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4fec53,_0x2b4c25){_0x4fec53=_0x4fec53-0x0;var _0x5d7124=_0x3f8a[_0x4fec53];return _0x5d7124;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x433590,_0x3c847a){var _0x1ddaf0=function(_0x26595b){while(--_0x26595b){_0x433590['push'](_0x433590['shift']());}};_0x1ddaf0(++_0x3c847a);}(_0x4975,0x86));var _0x5497=function(_0x3fe556,_0x1576aa){_0x3fe556=_0x3fe556-0x0;var _0x439ebf=_0x4975[_0x3fe556];return _0x439ebf;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5760fbf..bd61d0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x124a=['include','map','model','find','ShowServicenowAccount','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0x124a,0x171));var _0xa124=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0x124a[_0x4498a2];return _0x411aa8;};'use strict';var _=require(_0xa124('0x0'));var util=require(_0xa124('0x1'));var moment=require(_0xa124('0x2'));var BPromise=require(_0xa124('0x3'));var rs=require(_0xa124('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa124('0x5'));var logger=require(_0xa124('0x6'))('rpc');var config=require(_0xa124('0x7'));var jayson=require(_0xa124('0x8'));var client=jayson[_0xa124('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421685,_0x4d1d7f,_0x3ab306){return new BPromise(function(_0x2802bf,_0x442d4f){return client[_0xa124('0xa')](_0x421685,_0x3ab306)[_0xa124('0xb')](function(_0x253ef8){logger[_0xa124('0xc')](_0xa124('0xd'),_0x4d1d7f,_0xa124('0xe'));logger[_0xa124('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4d1d7f,_0xa124('0xe'),JSON[_0xa124('0x10')](_0x253ef8));if(_0x253ef8[_0xa124('0x11')]){if(_0x253ef8[_0xa124('0x11')]['code']===0x1f4){logger['error'](_0xa124('0xd'),_0x4d1d7f,_0x253ef8[_0xa124('0x11')][_0xa124('0x12')]);return _0x442d4f(_0x253ef8[_0xa124('0x11')]['message']);}logger[_0xa124('0x11')](_0xa124('0xd'),_0x4d1d7f,_0x253ef8[_0xa124('0x11')]['message']);return _0x2802bf(_0x253ef8[_0xa124('0x11')][_0xa124('0x12')]);}else{logger[_0xa124('0xc')](_0xa124('0xd'),_0x4d1d7f,'request\x20sent');_0x2802bf(_0x253ef8[_0xa124('0x13')][_0xa124('0x12')]);}})['catch'](function(_0x44db8c){logger[_0xa124('0x11')](_0xa124('0xd'),_0x4d1d7f,_0x44db8c);_0x442d4f(_0x44db8c);});});}exports[_0xa124('0x14')]=function(_0x11af42){var _0x586262=this;return new Promise(function(_0x42dc63,_0x197497){return db[_0xa124('0x15')][_0xa124('0x16')]({'raw':_0x11af42[_0xa124('0x17')]?_0x11af42['options']['raw']===undefined?!![]:![]:!![],'where':_0x11af42[_0xa124('0x17')]?_0x11af42[_0xa124('0x17')][_0xa124('0x18')]||null:null,'attributes':_0x11af42[_0xa124('0x17')]?_0x11af42[_0xa124('0x17')][_0xa124('0x19')]||null:null,'limit':_0x11af42['options']?_0x11af42[_0xa124('0x17')][_0xa124('0x1a')]||null:null,'include':_0x11af42[_0xa124('0x17')]?_0x11af42['options'][_0xa124('0x1b')]?_[_0xa124('0x1c')](_0x11af42['options'][_0xa124('0x1b')],function(_0x55904f){return{'model':db[_0x55904f[_0xa124('0x1d')]],'as':_0x55904f['as'],'attributes':_0x55904f[_0xa124('0x19')],'include':_0x55904f['include']?_[_0xa124('0x1c')](_0x55904f[_0xa124('0x1b')],function(_0x1b9161){return{'model':db[_0x1b9161[_0xa124('0x1d')]],'as':_0x1b9161['as'],'attributes':_0x1b9161[_0xa124('0x19')],'include':_0x1b9161[_0xa124('0x1b')]?_[_0xa124('0x1c')](_0x1b9161[_0xa124('0x1b')],function(_0x106b92){return{'model':db[_0x106b92[_0xa124('0x1d')]],'as':_0x106b92['as'],'attributes':_0x106b92['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3334cb){logger[_0xa124('0xc')](_0xa124('0x14'),_0x11af42);logger[_0xa124('0xf')](_0xa124('0x14'),_0x11af42,JSON['stringify'](_0x3334cb));_0x42dc63(_0x3334cb);})['catch'](function(_0x3e2c83){logger[_0xa124('0x11')](_0xa124('0x14'),_0x3e2c83[_0xa124('0x12')],_0x11af42);_0x197497(_0x586262['error'](0x1f4,_0x3e2c83['message']));});});};exports['ShowServicenowAccount']=function(_0x4f6a8d){var _0x3f7b06=this;return new Promise(function(_0xe60bce,_0x5396f7){return db[_0xa124('0x15')][_0xa124('0x1e')]({'raw':_0x4f6a8d['options']?_0x4f6a8d[_0xa124('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6a8d[_0xa124('0x17')]?_0x4f6a8d[_0xa124('0x17')][_0xa124('0x18')]||null:null,'attributes':_0x4f6a8d['options']?_0x4f6a8d[_0xa124('0x17')][_0xa124('0x19')]||null:null,'include':_0x4f6a8d[_0xa124('0x17')]?_0x4f6a8d['options'][_0xa124('0x1b')]?_[_0xa124('0x1c')](_0x4f6a8d[_0xa124('0x17')][_0xa124('0x1b')],function(_0x59bf98){return{'model':db[_0x59bf98['model']],'as':_0x59bf98['as'],'attributes':_0x59bf98[_0xa124('0x19')],'include':_0x59bf98[_0xa124('0x1b')]?_[_0xa124('0x1c')](_0x59bf98[_0xa124('0x1b')],function(_0x1b0b6f){return{'model':db[_0x1b0b6f[_0xa124('0x1d')]],'as':_0x1b0b6f['as'],'attributes':_0x1b0b6f[_0xa124('0x19')],'include':_0x1b0b6f[_0xa124('0x1b')]?_[_0xa124('0x1c')](_0x1b0b6f[_0xa124('0x1b')],function(_0x147858){return{'model':db[_0x147858[_0xa124('0x1d')]],'as':_0x147858['as'],'attributes':_0x147858[_0xa124('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa124('0xb')](function(_0x58ad5e){logger[_0xa124('0xc')](_0xa124('0x1f'),_0x4f6a8d);logger[_0xa124('0xf')]('ShowServicenowAccount',_0x4f6a8d,JSON[_0xa124('0x10')](_0x58ad5e));_0xe60bce(_0x58ad5e);})[_0xa124('0x20')](function(_0x41ccae){logger[_0xa124('0x11')](_0xa124('0x1f'),_0x41ccae['message'],_0x4f6a8d);_0x5396f7(_0x3f7b06['error'](0x1f4,_0x41ccae['message']));});});};
\ No newline at end of file
+var _0x955b=['debug','stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3eb4ae,_0x493c5b){var _0x1aa0d4=function(_0x194a3b){while(--_0x194a3b){_0x3eb4ae['push'](_0x3eb4ae['shift']());}};_0x1aa0d4(++_0x493c5b);}(_0x955b,0x193));var _0xb955=function(_0x36da1f,_0x23d72c){_0x36da1f=_0x36da1f-0x0;var _0x2418a4=_0x955b[_0x36da1f];return _0x2418a4;};'use strict';var _=require('lodash');var util=require(_0xb955('0x0'));var moment=require('moment');var BPromise=require(_0xb955('0x1'));var rs=require(_0xb955('0x2'));var fs=require('fs');var Redis=require(_0xb955('0x3'));var db=require(_0xb955('0x4'))['db'];var utils=require(_0xb955('0x5'));var logger=require('../../config/logger')(_0xb955('0x6'));var config=require('../../config/environment');var jayson=require(_0xb955('0x7'));var client=jayson[_0xb955('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2067c2,_0x1a1e3f,_0x4f20e3){return new BPromise(function(_0x91d5bc,_0x4b8f7f){return client['request'](_0x2067c2,_0x4f20e3)[_0xb955('0x9')](function(_0x252cb0){logger[_0xb955('0xa')](_0xb955('0xb'),_0x1a1e3f,_0xb955('0xc'));logger[_0xb955('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1a1e3f,_0xb955('0xc'),JSON[_0xb955('0xe')](_0x252cb0));if(_0x252cb0[_0xb955('0xf')]){if(_0x252cb0['error'][_0xb955('0x10')]===0x1f4){logger[_0xb955('0xf')](_0xb955('0xb'),_0x1a1e3f,_0x252cb0[_0xb955('0xf')]['message']);return _0x4b8f7f(_0x252cb0[_0xb955('0xf')][_0xb955('0x11')]);}logger['error'](_0xb955('0xb'),_0x1a1e3f,_0x252cb0[_0xb955('0xf')][_0xb955('0x11')]);return _0x91d5bc(_0x252cb0['error']['message']);}else{logger[_0xb955('0xa')](_0xb955('0xb'),_0x1a1e3f,_0xb955('0xc'));_0x91d5bc(_0x252cb0[_0xb955('0x12')][_0xb955('0x11')]);}})['catch'](function(_0x29e175){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1a1e3f,_0x29e175);_0x4b8f7f(_0x29e175);});});}exports[_0xb955('0x13')]=function(_0x28b89c){var _0x5a0b83=this;return new Promise(function(_0x5710c8,_0x2e6e6f){return db[_0xb955('0x14')][_0xb955('0x15')]({'raw':_0x28b89c[_0xb955('0x16')]?_0x28b89c[_0xb955('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x28b89c[_0xb955('0x16')]?_0x28b89c[_0xb955('0x16')][_0xb955('0x17')]||null:null,'attributes':_0x28b89c[_0xb955('0x16')]?_0x28b89c[_0xb955('0x16')][_0xb955('0x18')]||null:null,'limit':_0x28b89c[_0xb955('0x16')]?_0x28b89c[_0xb955('0x16')][_0xb955('0x19')]||null:null,'include':_0x28b89c['options']?_0x28b89c['options'][_0xb955('0x1a')]?_[_0xb955('0x1b')](_0x28b89c[_0xb955('0x16')][_0xb955('0x1a')],function(_0x835027){return{'model':db[_0x835027[_0xb955('0x1c')]],'as':_0x835027['as'],'attributes':_0x835027[_0xb955('0x18')],'include':_0x835027[_0xb955('0x1a')]?_['map'](_0x835027[_0xb955('0x1a')],function(_0x3a95e3){return{'model':db[_0x3a95e3['model']],'as':_0x3a95e3['as'],'attributes':_0x3a95e3[_0xb955('0x18')],'include':_0x3a95e3[_0xb955('0x1a')]?_[_0xb955('0x1b')](_0x3a95e3['include'],function(_0x769571){return{'model':db[_0x769571[_0xb955('0x1c')]],'as':_0x769571['as'],'attributes':_0x769571['attributes']};}):[]};}):[]};}):[]:[]})[_0xb955('0x9')](function(_0x4bf7a2){logger[_0xb955('0xa')](_0xb955('0x13'),_0x28b89c);logger[_0xb955('0xd')]('GetServicenowAccount',_0x28b89c,JSON['stringify'](_0x4bf7a2));_0x5710c8(_0x4bf7a2);})[_0xb955('0x1d')](function(_0x2fc558){logger['error']('GetServicenowAccount',_0x2fc558[_0xb955('0x11')],_0x28b89c);_0x2e6e6f(_0x5a0b83[_0xb955('0xf')](0x1f4,_0x2fc558['message']));});});};exports[_0xb955('0x1e')]=function(_0x106120){var _0x345ad1=this;return new Promise(function(_0x116fcb,_0x5a588e){return db[_0xb955('0x14')]['find']({'raw':_0x106120['options']?_0x106120['options'][_0xb955('0x1f')]===undefined?!![]:![]:!![],'where':_0x106120[_0xb955('0x16')]?_0x106120[_0xb955('0x16')]['where']||null:null,'attributes':_0x106120[_0xb955('0x16')]?_0x106120[_0xb955('0x16')][_0xb955('0x18')]||null:null,'include':_0x106120[_0xb955('0x16')]?_0x106120['options'][_0xb955('0x1a')]?_[_0xb955('0x1b')](_0x106120[_0xb955('0x16')]['include'],function(_0x44bc17){return{'model':db[_0x44bc17[_0xb955('0x1c')]],'as':_0x44bc17['as'],'attributes':_0x44bc17[_0xb955('0x18')],'include':_0x44bc17['include']?_[_0xb955('0x1b')](_0x44bc17['include'],function(_0x623d32){return{'model':db[_0x623d32[_0xb955('0x1c')]],'as':_0x623d32['as'],'attributes':_0x623d32[_0xb955('0x18')],'include':_0x623d32['include']?_[_0xb955('0x1b')](_0x623d32[_0xb955('0x1a')],function(_0x53359a){return{'model':db[_0x53359a[_0xb955('0x1c')]],'as':_0x53359a['as'],'attributes':_0x53359a[_0xb955('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb955('0x9')](function(_0x52060c){logger[_0xb955('0xa')](_0xb955('0x1e'),_0x106120);logger[_0xb955('0xd')](_0xb955('0x1e'),_0x106120,JSON[_0xb955('0xe')](_0x52060c));_0x116fcb(_0x52060c);})[_0xb955('0x1d')](function(_0x1fcd20){logger[_0xb955('0xf')](_0xb955('0x1e'),_0x1fcd20['message'],_0x106120);_0x5a588e(_0x345ad1['error'](0x1f4,_0x1fcd20[_0xb955('0x11')]));});});};
\ No newline at end of file
index 538b0df..9811b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9df8=['put','/:id','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x9df8,0xbd));var _0x89df=function(_0x563104,_0x3d0aba){_0x563104=_0x563104-0x0;var _0x4897b4=_0x9df8[_0x563104];return _0x4897b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x89df('0x0'));var timeout=require(_0x89df('0x1'));var express=require('express');var router=express[_0x89df('0x2')]();var fs_extra=require(_0x89df('0x3'));var auth=require(_0x89df('0x4'));var interaction=require(_0x89df('0x5'));var config=require(_0x89df('0x6'));var controller=require(_0x89df('0x7'));router[_0x89df('0x8')]('/',auth[_0x89df('0x9')](),controller[_0x89df('0xa')]);router[_0x89df('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x89df('0x8')](_0x89df('0xb'),auth[_0x89df('0x9')](),controller[_0x89df('0xc')]);router[_0x89df('0x8')](_0x89df('0xd'),auth[_0x89df('0x9')](),controller['getSubjects']);router[_0x89df('0x8')](_0x89df('0xe'),auth['isAuthenticated'](),controller[_0x89df('0xf')]);router[_0x89df('0x10')]('/',auth[_0x89df('0x9')](),controller[_0x89df('0x11')]);router[_0x89df('0x12')](_0x89df('0x13'),auth[_0x89df('0x9')](),controller[_0x89df('0x14')]);router[_0x89df('0x15')](_0x89df('0x13'),auth[_0x89df('0x9')](),controller[_0x89df('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x0e8d=['/:id/descriptions','post','create','put','delete','/:id','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0x0e8d,0x8b));var _0xd0e8=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x0e8d[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require('multer');var util=require(_0xd0e8('0x0'));var path=require(_0xd0e8('0x1'));var timeout=require(_0xd0e8('0x2'));var express=require(_0xd0e8('0x3'));var router=express[_0xd0e8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0e8('0x5'));var config=require(_0xd0e8('0x6'));var controller=require(_0xd0e8('0x7'));router[_0xd0e8('0x8')]('/',auth[_0xd0e8('0x9')](),controller[_0xd0e8('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd0e8('0xb')]);router[_0xd0e8('0x8')](_0xd0e8('0xc'),auth[_0xd0e8('0x9')](),controller[_0xd0e8('0xd')]);router[_0xd0e8('0x8')]('/:id/subjects',auth[_0xd0e8('0x9')](),controller[_0xd0e8('0xe')]);router['get'](_0xd0e8('0xf'),auth[_0xd0e8('0x9')](),controller['getDescriptions']);router[_0xd0e8('0x10')]('/',auth[_0xd0e8('0x9')](),controller[_0xd0e8('0x11')]);router[_0xd0e8('0x12')]('/:id',auth[_0xd0e8('0x9')](),controller['update']);router[_0xd0e8('0x13')](_0xd0e8('0x14'),auth[_0xd0e8('0x9')](),controller[_0xd0e8('0x15')]);module['exports']=router;
\ No newline at end of file
index 6e0deaa..e358672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc3=['STRING','sequelize','exports'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0xabc3,0x8e));var _0x3abc=function(_0x4fbae4,_0x105926){_0x4fbae4=_0x4fbae4-0x0;var _0x5aa1b1=_0xabc3[_0x4fbae4];return _0x5aa1b1;};'use strict';var Sequelize=require(_0x3abc('0x0'));module[_0x3abc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3abc('0x2')]}};
\ No newline at end of file
+var _0xc535=['STRING','exports'];(function(_0x7c22,_0x20ad8e){var _0x39c1e3=function(_0x363c3e){while(--_0x363c3e){_0x7c22['push'](_0x7c22['shift']());}};_0x39c1e3(++_0x20ad8e);}(_0xc535,0x1c3));var _0x5c53=function(_0x59c20e,_0x5cfffd){_0x59c20e=_0x59c20e-0x0;var _0x4505b7=_0xc535[_0x59c20e];return _0x4505b7;};'use strict';var Sequelize=require('sequelize');module[_0x5c53('0x0')]={'name':{'type':Sequelize[_0x5c53('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4db7408..80b1e5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20cb=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','params','body','getFields','findOne','ServicenowField','order','pick','getSubjects','getDescriptions','hasOwnProperty'];(function(_0xc394da,_0x4207f6){var _0x2ef6ae=function(_0x239a86){while(--_0x239a86){_0xc394da['push'](_0xc394da['shift']());}};_0x2ef6ae(++_0x4207f6);}(_0x20cb,0xa8));var _0xb20c=function(_0x3fddd7,_0x346c89){_0x3fddd7=_0x3fddd7-0x0;var _0x34cf70=_0x20cb[_0x3fddd7];return _0x34cf70;};'use strict';var emlformat=require(_0xb20c('0x0'));var rimraf=require(_0xb20c('0x1'));var zipdir=require(_0xb20c('0x2'));var jsonpatch=require(_0xb20c('0x3'));var rp=require(_0xb20c('0x4'));var moment=require(_0xb20c('0x5'));var BPromise=require(_0xb20c('0x6'));var Mustache=require('mustache');var util=require(_0xb20c('0x7'));var path=require(_0xb20c('0x8'));var sox=require('sox');var csv=require(_0xb20c('0x9'));var ejs=require(_0xb20c('0xa'));var fs=require('fs');var fs_extra=require(_0xb20c('0xb'));var _=require(_0xb20c('0xc'));var squel=require(_0xb20c('0xd'));var crypto=require('crypto');var jsforce=require(_0xb20c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb20c('0x9'));var querystring=require(_0xb20c('0xf'));var Papa=require('papaparse');var Redis=require(_0xb20c('0x10'));var authService=require(_0xb20c('0x11'));var qs=require(_0xb20c('0x12'));var as=require(_0xb20c('0x13'));var hardwareService=require(_0xb20c('0x14'));var logger=require(_0xb20c('0x15'))(_0xb20c('0x16'));var utils=require(_0xb20c('0x17'));var config=require(_0xb20c('0x18'));var licenseUtil=require(_0xb20c('0x19'));var db=require(_0xb20c('0x1a'))['db'];function respondWithStatusCode(_0x5d6749,_0x3238f6){_0x3238f6=_0x3238f6||0xcc;return function(_0x2dba39){if(_0x2dba39){return _0x5d6749[_0xb20c('0x1b')](_0x3238f6);}return _0x5d6749[_0xb20c('0x1c')](_0x3238f6)[_0xb20c('0x1d')]();};}function respondWithResult(_0x2a500e,_0x216633){_0x216633=_0x216633||0xc8;return function(_0x529027){if(_0x529027){return _0x2a500e['status'](_0x216633)['json'](_0x529027);}};}function respondWithFilteredResult(_0x5c7e9a,_0x34abb6){return function(_0x38f436){if(_0x38f436){var _0x5642ae=typeof _0x34abb6[_0xb20c('0x1e')]===_0xb20c('0x1f')&&typeof _0x34abb6[_0xb20c('0x20')]===_0xb20c('0x1f');var _0x385810=_0x38f436['count'];var _0x14aeb4=_0x5642ae?0x0:_0x34abb6[_0xb20c('0x1e')];var _0x373d30=_0x5642ae?_0x38f436[_0xb20c('0x21')]:_0x34abb6[_0xb20c('0x1e')]+_0x34abb6[_0xb20c('0x20')];var _0xab79da;if(_0x373d30>=_0x385810){_0x373d30=_0x385810;_0xab79da=0xc8;}else{_0xab79da=0xce;}_0x5c7e9a[_0xb20c('0x1c')](_0xab79da);return _0x5c7e9a[_0xb20c('0x22')](_0xb20c('0x23'),_0x14aeb4+'-'+_0x373d30+'/'+_0x385810)[_0xb20c('0x24')](_0x38f436);}return null;};}function patchUpdates(_0xe1432f){return function(_0x1e6498){try{jsonpatch[_0xb20c('0x25')](_0x1e6498,_0xe1432f,!![]);}catch(_0x1237ac){return BPromise[_0xb20c('0x26')](_0x1237ac);}return _0x1e6498[_0xb20c('0x27')]();};}function saveUpdates(_0x459f0a,_0x2f22dc){return function(_0x47aa11){if(_0x47aa11){return _0x47aa11[_0xb20c('0x28')](_0x459f0a)[_0xb20c('0x29')](function(_0x88e770){return _0x88e770;});}return null;};}function removeEntity(_0x3e47ba,_0x4753cc){return function(_0x3a789e){if(_0x3a789e){return _0x3a789e[_0xb20c('0x2a')]()[_0xb20c('0x29')](function(){_0x3e47ba[_0xb20c('0x1c')](0xcc)[_0xb20c('0x1d')]();});}};}function handleEntityNotFound(_0x4d5f4f,_0x2713c4){return function(_0x4646bc){if(!_0x4646bc){_0x4d5f4f[_0xb20c('0x1b')](0x194);}return _0x4646bc;};}function handleError(_0xe16b32,_0x5774a4){_0x5774a4=_0x5774a4||0x1f4;return function(_0x2fc074){logger['error'](_0x2fc074[_0xb20c('0x2b')]);if(_0x2fc074['name']){delete _0x2fc074[_0xb20c('0x2c')];}_0xe16b32[_0xb20c('0x1c')](_0x5774a4)[_0xb20c('0x2d')](_0x2fc074);};}exports['index']=function(_0x359e79,_0x141272){var _0x4a3c08={},_0x37d85f={},_0x51f8f6={'count':0x0,'rows':[]};var _0x5af8f6=_[_0xb20c('0x2e')](db[_0xb20c('0x2f')][_0xb20c('0x30')],function(_0x48de2c){return{'name':_0x48de2c[_0xb20c('0x31')],'type':_0x48de2c['type'][_0xb20c('0x32')]};});_0x37d85f[_0xb20c('0x33')]=_[_0xb20c('0x2e')](_0x5af8f6,_0xb20c('0x2c'));_0x37d85f[_0xb20c('0x34')]=_[_0xb20c('0x35')](_0x359e79[_0xb20c('0x34')]);_0x37d85f[_0xb20c('0x36')]=_['intersection'](_0x37d85f[_0xb20c('0x33')],_0x37d85f[_0xb20c('0x34')]);_0x4a3c08[_0xb20c('0x37')]=_[_0xb20c('0x38')](_0x37d85f[_0xb20c('0x33')],qs[_0xb20c('0x39')](_0x359e79[_0xb20c('0x34')][_0xb20c('0x39')]));_0x4a3c08[_0xb20c('0x37')]=_0x4a3c08[_0xb20c('0x37')][_0xb20c('0x3a')]?_0x4a3c08[_0xb20c('0x37')]:_0x37d85f['model'];if(!_0x359e79['query']['hasOwnProperty'](_0xb20c('0x3b'))){_0x4a3c08[_0xb20c('0x20')]=qs[_0xb20c('0x20')](_0x359e79[_0xb20c('0x34')][_0xb20c('0x20')]);_0x4a3c08['offset']=qs[_0xb20c('0x1e')](_0x359e79[_0xb20c('0x34')][_0xb20c('0x1e')]);}_0x4a3c08['order']=qs['sort'](_0x359e79[_0xb20c('0x34')][_0xb20c('0x3c')]);_0x4a3c08[_0xb20c('0x3d')]=qs[_0xb20c('0x36')](_['pick'](_0x359e79[_0xb20c('0x34')],_0x37d85f[_0xb20c('0x36')]),_0x5af8f6);if(_0x359e79['query'][_0xb20c('0x3e')]){_0x4a3c08[_0xb20c('0x3d')]=_[_0xb20c('0x3f')](_0x4a3c08['where'],{'$or':_[_0xb20c('0x2e')](_0x5af8f6,function(_0x197db7){if(_0x197db7['type']!==_0xb20c('0x40')){var _0x55790c={};_0x55790c[_0x197db7[_0xb20c('0x2c')]]={'$like':'%'+_0x359e79[_0xb20c('0x34')][_0xb20c('0x3e')]+'%'};return _0x55790c;}})});}_0x4a3c08=_['merge']({},_0x4a3c08,_0x359e79[_0xb20c('0x41')]);var _0x427c18={'where':_0x4a3c08[_0xb20c('0x3d')]};return db['ServicenowConfiguration'][_0xb20c('0x21')](_0x427c18)[_0xb20c('0x29')](function(_0x54d9d5){_0x51f8f6[_0xb20c('0x21')]=_0x54d9d5;if(_0x359e79[_0xb20c('0x34')]['includeAll']){_0x4a3c08[_0xb20c('0x42')]=[{'all':!![]}];}return db[_0xb20c('0x2f')][_0xb20c('0x43')](_0x4a3c08);})[_0xb20c('0x29')](function(_0x1d8434){_0x51f8f6[_0xb20c('0x44')]=_0x1d8434;return _0x51f8f6;})[_0xb20c('0x29')](respondWithFilteredResult(_0x141272,_0x4a3c08))[_0xb20c('0x45')](handleError(_0x141272,null));};exports[_0xb20c('0x46')]=function(_0x486dcf,_0x1936f2){var _0x24f366={'raw':![],'where':{'id':_0x486dcf['params']['id']}},_0x402165={};_0x402165[_0xb20c('0x33')]=_[_0xb20c('0x35')](db[_0xb20c('0x2f')][_0xb20c('0x30')]);_0x402165[_0xb20c('0x34')]=_[_0xb20c('0x35')](_0x486dcf[_0xb20c('0x34')]);_0x402165[_0xb20c('0x36')]=_[_0xb20c('0x38')](_0x402165[_0xb20c('0x33')],_0x402165[_0xb20c('0x34')]);_0x24f366[_0xb20c('0x37')]=_[_0xb20c('0x38')](_0x402165['model'],qs[_0xb20c('0x39')](_0x486dcf[_0xb20c('0x34')][_0xb20c('0x39')]));_0x24f366[_0xb20c('0x37')]=_0x24f366[_0xb20c('0x37')][_0xb20c('0x3a')]?_0x24f366[_0xb20c('0x37')]:_0x402165['model'];if(_0x486dcf['query'][_0xb20c('0x47')]){_0x24f366[_0xb20c('0x42')]=[{'all':!![]}];}_0x24f366=_[_0xb20c('0x3f')]({},_0x24f366,_0x486dcf['options']);return db['ServicenowConfiguration'][_0xb20c('0x48')](_0x24f366)[_0xb20c('0x29')](handleEntityNotFound(_0x1936f2,null))[_0xb20c('0x29')](respondWithResult(_0x1936f2,null))['catch'](handleError(_0x1936f2,null));};exports[_0xb20c('0x49')]=function(_0x1ec3c6,_0x255ac8){return db['ServicenowConfiguration'][_0xb20c('0x49')](_0x1ec3c6['body'],{})['then'](respondWithResult(_0x255ac8,0xc9))[_0xb20c('0x45')](handleError(_0x255ac8,null));};exports[_0xb20c('0x28')]=function(_0x300d21,_0x391e05){if(_0x300d21['body']['id']){delete _0x300d21['body']['id'];}return db[_0xb20c('0x2f')][_0xb20c('0x48')]({'where':{'id':_0x300d21[_0xb20c('0x4a')]['id']}})[_0xb20c('0x29')](handleEntityNotFound(_0x391e05,null))['then'](saveUpdates(_0x300d21[_0xb20c('0x4b')],null))['then'](respondWithResult(_0x391e05,null))['catch'](handleError(_0x391e05,null));};exports[_0xb20c('0x2a')]=function(_0x605b7c,_0x3255a5){return db[_0xb20c('0x2f')]['find']({'where':{'id':_0x605b7c[_0xb20c('0x4a')]['id']}})[_0xb20c('0x29')](handleEntityNotFound(_0x3255a5,null))[_0xb20c('0x29')](removeEntity(_0x3255a5,null))[_0xb20c('0x45')](handleError(_0x3255a5,null));};exports[_0xb20c('0x4c')]=function(_0x3cc296,_0x2ca171,_0x24be6e){var _0x413e86={};var _0x17d858={};var _0xbaea77;var _0x577ce6;return db[_0xb20c('0x2f')][_0xb20c('0x4d')]({'where':{'id':_0x3cc296[_0xb20c('0x4a')]['id']}})[_0xb20c('0x29')](handleEntityNotFound(_0x2ca171,null))[_0xb20c('0x29')](function(_0x58f69b){if(_0x58f69b){_0xbaea77=_0x58f69b;_0x17d858[_0xb20c('0x33')]=_[_0xb20c('0x35')](db[_0xb20c('0x4e')]['rawAttributes']);_0x17d858[_0xb20c('0x34')]=_[_0xb20c('0x35')](_0x3cc296['query']);_0x17d858[_0xb20c('0x36')]=_['intersection'](_0x17d858[_0xb20c('0x33')],_0x17d858['query']);_0x413e86[_0xb20c('0x37')]=_['intersection'](_0x17d858[_0xb20c('0x33')],qs['fields'](_0x3cc296[_0xb20c('0x34')][_0xb20c('0x39')]));_0x413e86[_0xb20c('0x37')]=_0x413e86['attributes'][_0xb20c('0x3a')]?_0x413e86[_0xb20c('0x37')]:_0x17d858[_0xb20c('0x33')];_0x413e86[_0xb20c('0x4f')]=qs[_0xb20c('0x3c')](_0x3cc296[_0xb20c('0x34')][_0xb20c('0x3c')]);_0x413e86[_0xb20c('0x3d')]=qs[_0xb20c('0x36')](_[_0xb20c('0x50')](_0x3cc296[_0xb20c('0x34')],_0x17d858[_0xb20c('0x36')]));if(_0x3cc296[_0xb20c('0x34')][_0xb20c('0x3e')]){_0x413e86[_0xb20c('0x3d')]=_[_0xb20c('0x3f')](_0x413e86[_0xb20c('0x3d')],{'$or':_['map'](_0x413e86[_0xb20c('0x37')],function(_0x2c123d){var _0x5991d6={};_0x5991d6[_0x2c123d]={'$like':'%'+_0x3cc296[_0xb20c('0x34')][_0xb20c('0x3e')]+'%'};return _0x5991d6;})});}_0x413e86=_[_0xb20c('0x3f')]({},_0x413e86,_0x3cc296[_0xb20c('0x41')]);return _0xbaea77[_0xb20c('0x4c')](_0x413e86);}})[_0xb20c('0x29')](function(_0x21dfd8){if(_0x21dfd8){_0x577ce6=_0x21dfd8['length'];if(!_0x3cc296[_0xb20c('0x34')]['hasOwnProperty'](_0xb20c('0x3b'))){_0x413e86[_0xb20c('0x20')]=qs[_0xb20c('0x20')](_0x3cc296[_0xb20c('0x34')][_0xb20c('0x20')]);_0x413e86[_0xb20c('0x1e')]=qs[_0xb20c('0x1e')](_0x3cc296[_0xb20c('0x34')][_0xb20c('0x1e')]);}return _0xbaea77[_0xb20c('0x4c')](_0x413e86);}})['then'](function(_0x486531){if(_0x486531){return _0x486531?{'count':_0x577ce6,'rows':_0x486531}:null;}})[_0xb20c('0x29')](respondWithResult(_0x2ca171,null))[_0xb20c('0x45')](handleError(_0x2ca171,null));};exports[_0xb20c('0x51')]=function(_0x51b7a1,_0x3ef8c2,_0x3bdf60){var _0x445c26={};var _0x322610={};var _0x2b0d31;var _0x5ec7be;return db[_0xb20c('0x2f')]['findOne']({'where':{'id':_0x51b7a1['params']['id']}})[_0xb20c('0x29')](handleEntityNotFound(_0x3ef8c2,null))[_0xb20c('0x29')](function(_0x2b423d){if(_0x2b423d){_0x2b0d31=_0x2b423d;_0x322610[_0xb20c('0x33')]=_[_0xb20c('0x35')](db['ServicenowField'][_0xb20c('0x30')]);_0x322610[_0xb20c('0x34')]=_[_0xb20c('0x35')](_0x51b7a1[_0xb20c('0x34')]);_0x322610['filters']=_['intersection'](_0x322610[_0xb20c('0x33')],_0x322610[_0xb20c('0x34')]);_0x445c26[_0xb20c('0x37')]=_[_0xb20c('0x38')](_0x322610[_0xb20c('0x33')],qs[_0xb20c('0x39')](_0x51b7a1[_0xb20c('0x34')][_0xb20c('0x39')]));_0x445c26[_0xb20c('0x37')]=_0x445c26[_0xb20c('0x37')][_0xb20c('0x3a')]?_0x445c26[_0xb20c('0x37')]:_0x322610[_0xb20c('0x33')];_0x445c26[_0xb20c('0x4f')]=qs[_0xb20c('0x3c')](_0x51b7a1[_0xb20c('0x34')][_0xb20c('0x3c')]);_0x445c26['where']=qs[_0xb20c('0x36')](_[_0xb20c('0x50')](_0x51b7a1[_0xb20c('0x34')],_0x322610[_0xb20c('0x36')]));if(_0x51b7a1[_0xb20c('0x34')]['filter']){_0x445c26[_0xb20c('0x3d')]=_[_0xb20c('0x3f')](_0x445c26[_0xb20c('0x3d')],{'$or':_[_0xb20c('0x2e')](_0x445c26[_0xb20c('0x37')],function(_0x251e2d){var _0x2e1f64={};_0x2e1f64[_0x251e2d]={'$like':'%'+_0x51b7a1[_0xb20c('0x34')]['filter']+'%'};return _0x2e1f64;})});}_0x445c26=_[_0xb20c('0x3f')]({},_0x445c26,_0x51b7a1[_0xb20c('0x41')]);return _0x2b0d31[_0xb20c('0x51')](_0x445c26);}})['then'](function(_0x3223cc){if(_0x3223cc){_0x5ec7be=_0x3223cc[_0xb20c('0x3a')];if(!_0x51b7a1[_0xb20c('0x34')]['hasOwnProperty'](_0xb20c('0x3b'))){_0x445c26['limit']=qs[_0xb20c('0x20')](_0x51b7a1[_0xb20c('0x34')][_0xb20c('0x20')]);_0x445c26[_0xb20c('0x1e')]=qs[_0xb20c('0x1e')](_0x51b7a1[_0xb20c('0x34')][_0xb20c('0x1e')]);}return _0x2b0d31[_0xb20c('0x51')](_0x445c26);}})['then'](function(_0x487f38){if(_0x487f38){return _0x487f38?{'count':_0x5ec7be,'rows':_0x487f38}:null;}})[_0xb20c('0x29')](respondWithResult(_0x3ef8c2,null))[_0xb20c('0x45')](handleError(_0x3ef8c2,null));};exports[_0xb20c('0x52')]=function(_0x31c1ff,_0x256cf0,_0x379ffb){var _0x574e5b={};var _0x540197={};var _0x5c0209;var _0x5cd562;return db[_0xb20c('0x2f')][_0xb20c('0x4d')]({'where':{'id':_0x31c1ff[_0xb20c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x256cf0,null))['then'](function(_0x4be807){if(_0x4be807){_0x5c0209=_0x4be807;_0x540197[_0xb20c('0x33')]=_[_0xb20c('0x35')](db['ServicenowField'][_0xb20c('0x30')]);_0x540197[_0xb20c('0x34')]=_['keys'](_0x31c1ff['query']);_0x540197['filters']=_[_0xb20c('0x38')](_0x540197[_0xb20c('0x33')],_0x540197['query']);_0x574e5b['attributes']=_[_0xb20c('0x38')](_0x540197['model'],qs[_0xb20c('0x39')](_0x31c1ff[_0xb20c('0x34')][_0xb20c('0x39')]));_0x574e5b['attributes']=_0x574e5b[_0xb20c('0x37')]['length']?_0x574e5b[_0xb20c('0x37')]:_0x540197['model'];_0x574e5b[_0xb20c('0x4f')]=qs[_0xb20c('0x3c')](_0x31c1ff[_0xb20c('0x34')][_0xb20c('0x3c')]);_0x574e5b[_0xb20c('0x3d')]=qs[_0xb20c('0x36')](_[_0xb20c('0x50')](_0x31c1ff[_0xb20c('0x34')],_0x540197[_0xb20c('0x36')]));if(_0x31c1ff[_0xb20c('0x34')][_0xb20c('0x3e')]){_0x574e5b[_0xb20c('0x3d')]=_['merge'](_0x574e5b[_0xb20c('0x3d')],{'$or':_[_0xb20c('0x2e')](_0x574e5b[_0xb20c('0x37')],function(_0x474709){var _0x2450c7={};_0x2450c7[_0x474709]={'$like':'%'+_0x31c1ff[_0xb20c('0x34')]['filter']+'%'};return _0x2450c7;})});}_0x574e5b=_[_0xb20c('0x3f')]({},_0x574e5b,_0x31c1ff[_0xb20c('0x41')]);return _0x5c0209[_0xb20c('0x52')](_0x574e5b);}})[_0xb20c('0x29')](function(_0xadf9e3){if(_0xadf9e3){_0x5cd562=_0xadf9e3['length'];if(!_0x31c1ff[_0xb20c('0x34')][_0xb20c('0x53')]('nolimit')){_0x574e5b[_0xb20c('0x20')]=qs[_0xb20c('0x20')](_0x31c1ff[_0xb20c('0x34')]['limit']);_0x574e5b[_0xb20c('0x1e')]=qs[_0xb20c('0x1e')](_0x31c1ff[_0xb20c('0x34')]['offset']);}return _0x5c0209[_0xb20c('0x52')](_0x574e5b);}})['then'](function(_0x3dd651){if(_0x3dd651){return _0x3dd651?{'count':_0x5cd562,'rows':_0x3dd651}:null;}})[_0xb20c('0x29')](respondWithResult(_0x256cf0,null))['catch'](handleError(_0x256cf0,null));};
\ No newline at end of file
+var _0x8f15=['findOne','ServicenowField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','getFields'];(function(_0x4e923c,_0x4d9897){var _0x29638e=function(_0x555f90){while(--_0x555f90){_0x4e923c['push'](_0x4e923c['shift']());}};_0x29638e(++_0x4d9897);}(_0x8f15,0xaa));var _0x58f1=function(_0x160b16,_0x227755){_0x160b16=_0x160b16-0x0;var _0xaf35af=_0x8f15[_0x160b16];return _0xaf35af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58f1('0x0'));var zipdir=require(_0x58f1('0x1'));var jsonpatch=require(_0x58f1('0x2'));var rp=require(_0x58f1('0x3'));var moment=require('moment');var BPromise=require(_0x58f1('0x4'));var Mustache=require(_0x58f1('0x5'));var util=require(_0x58f1('0x6'));var path=require(_0x58f1('0x7'));var sox=require(_0x58f1('0x8'));var csv=require(_0x58f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58f1('0xa'));var _=require(_0x58f1('0xb'));var squel=require(_0x58f1('0xc'));var crypto=require(_0x58f1('0xd'));var jsforce=require(_0x58f1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x58f1('0x9'));var querystring=require(_0x58f1('0xf'));var Papa=require(_0x58f1('0x10'));var Redis=require('ioredis');var authService=require(_0x58f1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58f1('0x12'));var hardwareService=require(_0x58f1('0x13'));var logger=require(_0x58f1('0x14'))('api');var utils=require(_0x58f1('0x15'));var config=require(_0x58f1('0x16'));var licenseUtil=require(_0x58f1('0x17'));var db=require(_0x58f1('0x18'))['db'];function respondWithStatusCode(_0x57792b,_0x409eb6){_0x409eb6=_0x409eb6||0xcc;return function(_0x3a2345){if(_0x3a2345){return _0x57792b['sendStatus'](_0x409eb6);}return _0x57792b[_0x58f1('0x19')](_0x409eb6)[_0x58f1('0x1a')]();};}function respondWithResult(_0x35f16a,_0x3ca74d){_0x3ca74d=_0x3ca74d||0xc8;return function(_0x197216){if(_0x197216){return _0x35f16a['status'](_0x3ca74d)[_0x58f1('0x1b')](_0x197216);}};}function respondWithFilteredResult(_0xb25d88,_0x1bbd2d){return function(_0x5c11db){if(_0x5c11db){var _0xd14ab2=typeof _0x1bbd2d['offset']===_0x58f1('0x1c')&&typeof _0x1bbd2d[_0x58f1('0x1d')]==='undefined';var _0x2e4ffe=_0x5c11db[_0x58f1('0x1e')];var _0x4118fc=_0xd14ab2?0x0:_0x1bbd2d[_0x58f1('0x1f')];var _0x54c476=_0xd14ab2?_0x5c11db[_0x58f1('0x1e')]:_0x1bbd2d[_0x58f1('0x1f')]+_0x1bbd2d[_0x58f1('0x1d')];var _0x330310;if(_0x54c476>=_0x2e4ffe){_0x54c476=_0x2e4ffe;_0x330310=0xc8;}else{_0x330310=0xce;}_0xb25d88[_0x58f1('0x19')](_0x330310);return _0xb25d88['set'](_0x58f1('0x20'),_0x4118fc+'-'+_0x54c476+'/'+_0x2e4ffe)[_0x58f1('0x1b')](_0x5c11db);}return null;};}function patchUpdates(_0xe8b8e1){return function(_0x5aa483){try{jsonpatch[_0x58f1('0x21')](_0x5aa483,_0xe8b8e1,!![]);}catch(_0xcb903c){return BPromise[_0x58f1('0x22')](_0xcb903c);}return _0x5aa483[_0x58f1('0x23')]();};}function saveUpdates(_0x2d778b,_0x457525){return function(_0x291d5b){if(_0x291d5b){return _0x291d5b[_0x58f1('0x24')](_0x2d778b)[_0x58f1('0x25')](function(_0x16ee34){return _0x16ee34;});}return null;};}function removeEntity(_0x2ed920,_0xb5d318){return function(_0x37eeb9){if(_0x37eeb9){return _0x37eeb9[_0x58f1('0x26')]()[_0x58f1('0x25')](function(){_0x2ed920[_0x58f1('0x19')](0xcc)[_0x58f1('0x1a')]();});}};}function handleEntityNotFound(_0x4ea37e,_0x190957){return function(_0x3754c6){if(!_0x3754c6){_0x4ea37e[_0x58f1('0x27')](0x194);}return _0x3754c6;};}function handleError(_0x28b1af,_0x1ac5c5){_0x1ac5c5=_0x1ac5c5||0x1f4;return function(_0x550dcc){logger[_0x58f1('0x28')](_0x550dcc[_0x58f1('0x29')]);if(_0x550dcc['name']){delete _0x550dcc[_0x58f1('0x2a')];}_0x28b1af[_0x58f1('0x19')](_0x1ac5c5)[_0x58f1('0x2b')](_0x550dcc);};}exports['index']=function(_0xaaffd4,_0x43319d){var _0x1f67d9={},_0x109359={},_0x2e086c={'count':0x0,'rows':[]};var _0x486da4=_[_0x58f1('0x2c')](db['ServicenowConfiguration'][_0x58f1('0x2d')],function(_0x3343e0){return{'name':_0x3343e0[_0x58f1('0x2e')],'type':_0x3343e0[_0x58f1('0x2f')][_0x58f1('0x30')]};});_0x109359[_0x58f1('0x31')]=_['map'](_0x486da4,_0x58f1('0x2a'));_0x109359[_0x58f1('0x32')]=_[_0x58f1('0x33')](_0xaaffd4[_0x58f1('0x32')]);_0x109359[_0x58f1('0x34')]=_[_0x58f1('0x35')](_0x109359['model'],_0x109359[_0x58f1('0x32')]);_0x1f67d9[_0x58f1('0x36')]=_['intersection'](_0x109359[_0x58f1('0x31')],qs['fields'](_0xaaffd4[_0x58f1('0x32')][_0x58f1('0x37')]));_0x1f67d9['attributes']=_0x1f67d9[_0x58f1('0x36')]['length']?_0x1f67d9[_0x58f1('0x36')]:_0x109359[_0x58f1('0x31')];if(!_0xaaffd4[_0x58f1('0x32')][_0x58f1('0x38')](_0x58f1('0x39'))){_0x1f67d9[_0x58f1('0x1d')]=qs[_0x58f1('0x1d')](_0xaaffd4[_0x58f1('0x32')][_0x58f1('0x1d')]);_0x1f67d9[_0x58f1('0x1f')]=qs['offset'](_0xaaffd4['query']['offset']);}_0x1f67d9[_0x58f1('0x3a')]=qs['sort'](_0xaaffd4[_0x58f1('0x32')][_0x58f1('0x3b')]);_0x1f67d9[_0x58f1('0x3c')]=qs[_0x58f1('0x34')](_[_0x58f1('0x3d')](_0xaaffd4[_0x58f1('0x32')],_0x109359['filters']),_0x486da4);if(_0xaaffd4[_0x58f1('0x32')][_0x58f1('0x3e')]){_0x1f67d9['where']=_[_0x58f1('0x3f')](_0x1f67d9[_0x58f1('0x3c')],{'$or':_[_0x58f1('0x2c')](_0x486da4,function(_0x4ea917){if(_0x4ea917['type']!==_0x58f1('0x40')){var _0x1f15bf={};_0x1f15bf[_0x4ea917[_0x58f1('0x2a')]]={'$like':'%'+_0xaaffd4[_0x58f1('0x32')]['filter']+'%'};return _0x1f15bf;}})});}_0x1f67d9=_[_0x58f1('0x3f')]({},_0x1f67d9,_0xaaffd4[_0x58f1('0x41')]);var _0x5c7412={'where':_0x1f67d9[_0x58f1('0x3c')]};return db[_0x58f1('0x42')][_0x58f1('0x1e')](_0x5c7412)[_0x58f1('0x25')](function(_0x4f18d2){_0x2e086c[_0x58f1('0x1e')]=_0x4f18d2;if(_0xaaffd4['query'][_0x58f1('0x43')]){_0x1f67d9['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x58f1('0x44')](_0x1f67d9);})[_0x58f1('0x25')](function(_0x20499d){_0x2e086c[_0x58f1('0x45')]=_0x20499d;return _0x2e086c;})[_0x58f1('0x25')](respondWithFilteredResult(_0x43319d,_0x1f67d9))[_0x58f1('0x46')](handleError(_0x43319d,null));};exports[_0x58f1('0x47')]=function(_0x511f07,_0x5c6a44){var _0x57a85b={'raw':![],'where':{'id':_0x511f07[_0x58f1('0x48')]['id']}},_0x3a7f73={};_0x3a7f73[_0x58f1('0x31')]=_[_0x58f1('0x33')](db[_0x58f1('0x42')][_0x58f1('0x2d')]);_0x3a7f73['query']=_[_0x58f1('0x33')](_0x511f07[_0x58f1('0x32')]);_0x3a7f73[_0x58f1('0x34')]=_[_0x58f1('0x35')](_0x3a7f73[_0x58f1('0x31')],_0x3a7f73['query']);_0x57a85b[_0x58f1('0x36')]=_['intersection'](_0x3a7f73[_0x58f1('0x31')],qs['fields'](_0x511f07[_0x58f1('0x32')][_0x58f1('0x37')]));_0x57a85b['attributes']=_0x57a85b['attributes'][_0x58f1('0x49')]?_0x57a85b[_0x58f1('0x36')]:_0x3a7f73[_0x58f1('0x31')];if(_0x511f07[_0x58f1('0x32')][_0x58f1('0x43')]){_0x57a85b[_0x58f1('0x4a')]=[{'all':!![]}];}_0x57a85b=_[_0x58f1('0x3f')]({},_0x57a85b,_0x511f07['options']);return db[_0x58f1('0x42')][_0x58f1('0x4b')](_0x57a85b)[_0x58f1('0x25')](handleEntityNotFound(_0x5c6a44,null))['then'](respondWithResult(_0x5c6a44,null))[_0x58f1('0x46')](handleError(_0x5c6a44,null));};exports[_0x58f1('0x4c')]=function(_0x2c94a0,_0x405b7b){return db[_0x58f1('0x42')]['create'](_0x2c94a0[_0x58f1('0x4d')],{})[_0x58f1('0x25')](respondWithResult(_0x405b7b,0xc9))[_0x58f1('0x46')](handleError(_0x405b7b,null));};exports['update']=function(_0x4d4b56,_0xbdd6f6){if(_0x4d4b56[_0x58f1('0x4d')]['id']){delete _0x4d4b56[_0x58f1('0x4d')]['id'];}return db[_0x58f1('0x42')]['find']({'where':{'id':_0x4d4b56[_0x58f1('0x48')]['id']}})[_0x58f1('0x25')](handleEntityNotFound(_0xbdd6f6,null))[_0x58f1('0x25')](saveUpdates(_0x4d4b56[_0x58f1('0x4d')],null))[_0x58f1('0x25')](respondWithResult(_0xbdd6f6,null))[_0x58f1('0x46')](handleError(_0xbdd6f6,null));};exports[_0x58f1('0x26')]=function(_0x54e490,_0x15ab07){return db[_0x58f1('0x42')][_0x58f1('0x4b')]({'where':{'id':_0x54e490[_0x58f1('0x48')]['id']}})[_0x58f1('0x25')](handleEntityNotFound(_0x15ab07,null))['then'](removeEntity(_0x15ab07,null))[_0x58f1('0x46')](handleError(_0x15ab07,null));};exports[_0x58f1('0x4e')]=function(_0x1d5e01,_0x4b6275,_0x586d6c){var _0x21fb0d={};var _0x5176c9={};var _0x3d0054;var _0xff2f8a;return db[_0x58f1('0x42')][_0x58f1('0x4f')]({'where':{'id':_0x1d5e01[_0x58f1('0x48')]['id']}})[_0x58f1('0x25')](handleEntityNotFound(_0x4b6275,null))[_0x58f1('0x25')](function(_0x4fb699){if(_0x4fb699){_0x3d0054=_0x4fb699;_0x5176c9[_0x58f1('0x31')]=_[_0x58f1('0x33')](db[_0x58f1('0x50')]['rawAttributes']);_0x5176c9['query']=_['keys'](_0x1d5e01[_0x58f1('0x32')]);_0x5176c9[_0x58f1('0x34')]=_['intersection'](_0x5176c9[_0x58f1('0x31')],_0x5176c9[_0x58f1('0x32')]);_0x21fb0d[_0x58f1('0x36')]=_[_0x58f1('0x35')](_0x5176c9['model'],qs[_0x58f1('0x37')](_0x1d5e01[_0x58f1('0x32')]['fields']));_0x21fb0d[_0x58f1('0x36')]=_0x21fb0d[_0x58f1('0x36')][_0x58f1('0x49')]?_0x21fb0d[_0x58f1('0x36')]:_0x5176c9[_0x58f1('0x31')];_0x21fb0d['order']=qs[_0x58f1('0x3b')](_0x1d5e01[_0x58f1('0x32')][_0x58f1('0x3b')]);_0x21fb0d['where']=qs[_0x58f1('0x34')](_[_0x58f1('0x3d')](_0x1d5e01[_0x58f1('0x32')],_0x5176c9[_0x58f1('0x34')]));if(_0x1d5e01['query'][_0x58f1('0x3e')]){_0x21fb0d['where']=_[_0x58f1('0x3f')](_0x21fb0d[_0x58f1('0x3c')],{'$or':_['map'](_0x21fb0d[_0x58f1('0x36')],function(_0x4889f7){var _0x3ec710={};_0x3ec710[_0x4889f7]={'$like':'%'+_0x1d5e01[_0x58f1('0x32')][_0x58f1('0x3e')]+'%'};return _0x3ec710;})});}_0x21fb0d=_[_0x58f1('0x3f')]({},_0x21fb0d,_0x1d5e01[_0x58f1('0x41')]);return _0x3d0054[_0x58f1('0x4e')](_0x21fb0d);}})[_0x58f1('0x25')](function(_0x3360b3){if(_0x3360b3){_0xff2f8a=_0x3360b3['length'];if(!_0x1d5e01[_0x58f1('0x32')][_0x58f1('0x38')](_0x58f1('0x39'))){_0x21fb0d[_0x58f1('0x1d')]=qs[_0x58f1('0x1d')](_0x1d5e01[_0x58f1('0x32')][_0x58f1('0x1d')]);_0x21fb0d[_0x58f1('0x1f')]=qs['offset'](_0x1d5e01[_0x58f1('0x32')][_0x58f1('0x1f')]);}return _0x3d0054['getFields'](_0x21fb0d);}})['then'](function(_0x2687af){if(_0x2687af){return _0x2687af?{'count':_0xff2f8a,'rows':_0x2687af}:null;}})['then'](respondWithResult(_0x4b6275,null))[_0x58f1('0x46')](handleError(_0x4b6275,null));};exports['getSubjects']=function(_0x54febf,_0xbe393a,_0x5465ca){var _0x4a4d0f={};var _0x411e2c={};var _0xf6152a;var _0x3e3d81;return db[_0x58f1('0x42')][_0x58f1('0x4f')]({'where':{'id':_0x54febf[_0x58f1('0x48')]['id']}})[_0x58f1('0x25')](handleEntityNotFound(_0xbe393a,null))[_0x58f1('0x25')](function(_0x57f082){if(_0x57f082){_0xf6152a=_0x57f082;_0x411e2c[_0x58f1('0x31')]=_[_0x58f1('0x33')](db[_0x58f1('0x50')][_0x58f1('0x2d')]);_0x411e2c['query']=_[_0x58f1('0x33')](_0x54febf[_0x58f1('0x32')]);_0x411e2c[_0x58f1('0x34')]=_['intersection'](_0x411e2c[_0x58f1('0x31')],_0x411e2c[_0x58f1('0x32')]);_0x4a4d0f[_0x58f1('0x36')]=_['intersection'](_0x411e2c['model'],qs[_0x58f1('0x37')](_0x54febf[_0x58f1('0x32')][_0x58f1('0x37')]));_0x4a4d0f[_0x58f1('0x36')]=_0x4a4d0f['attributes'][_0x58f1('0x49')]?_0x4a4d0f[_0x58f1('0x36')]:_0x411e2c[_0x58f1('0x31')];_0x4a4d0f['order']=qs[_0x58f1('0x3b')](_0x54febf[_0x58f1('0x32')]['sort']);_0x4a4d0f['where']=qs['filters'](_[_0x58f1('0x3d')](_0x54febf[_0x58f1('0x32')],_0x411e2c[_0x58f1('0x34')]));if(_0x54febf['query'][_0x58f1('0x3e')]){_0x4a4d0f['where']=_['merge'](_0x4a4d0f['where'],{'$or':_[_0x58f1('0x2c')](_0x4a4d0f[_0x58f1('0x36')],function(_0x2001df){var _0x557dde={};_0x557dde[_0x2001df]={'$like':'%'+_0x54febf[_0x58f1('0x32')][_0x58f1('0x3e')]+'%'};return _0x557dde;})});}_0x4a4d0f=_[_0x58f1('0x3f')]({},_0x4a4d0f,_0x54febf[_0x58f1('0x41')]);return _0xf6152a['getSubjects'](_0x4a4d0f);}})['then'](function(_0x21d2b7){if(_0x21d2b7){_0x3e3d81=_0x21d2b7[_0x58f1('0x49')];if(!_0x54febf[_0x58f1('0x32')]['hasOwnProperty'](_0x58f1('0x39'))){_0x4a4d0f[_0x58f1('0x1d')]=qs['limit'](_0x54febf[_0x58f1('0x32')][_0x58f1('0x1d')]);_0x4a4d0f[_0x58f1('0x1f')]=qs['offset'](_0x54febf[_0x58f1('0x32')][_0x58f1('0x1f')]);}return _0xf6152a[_0x58f1('0x51')](_0x4a4d0f);}})[_0x58f1('0x25')](function(_0x41bf5d){if(_0x41bf5d){return _0x41bf5d?{'count':_0x3e3d81,'rows':_0x41bf5d}:null;}})[_0x58f1('0x25')](respondWithResult(_0xbe393a,null))[_0x58f1('0x46')](handleError(_0xbe393a,null));};exports[_0x58f1('0x52')]=function(_0x4ce99e,_0x6ff1b3,_0xe3b0bd){var _0x5326f0={};var _0x5c43c4={};var _0x24053f;var _0x543e9a;return db['ServicenowConfiguration'][_0x58f1('0x4f')]({'where':{'id':_0x4ce99e[_0x58f1('0x48')]['id']}})[_0x58f1('0x25')](handleEntityNotFound(_0x6ff1b3,null))[_0x58f1('0x25')](function(_0x5ed7f7){if(_0x5ed7f7){_0x24053f=_0x5ed7f7;_0x5c43c4['model']=_[_0x58f1('0x33')](db[_0x58f1('0x50')][_0x58f1('0x2d')]);_0x5c43c4[_0x58f1('0x32')]=_[_0x58f1('0x33')](_0x4ce99e['query']);_0x5c43c4['filters']=_[_0x58f1('0x35')](_0x5c43c4[_0x58f1('0x31')],_0x5c43c4['query']);_0x5326f0[_0x58f1('0x36')]=_[_0x58f1('0x35')](_0x5c43c4[_0x58f1('0x31')],qs['fields'](_0x4ce99e['query']['fields']));_0x5326f0['attributes']=_0x5326f0[_0x58f1('0x36')][_0x58f1('0x49')]?_0x5326f0[_0x58f1('0x36')]:_0x5c43c4[_0x58f1('0x31')];_0x5326f0[_0x58f1('0x3a')]=qs[_0x58f1('0x3b')](_0x4ce99e[_0x58f1('0x32')][_0x58f1('0x3b')]);_0x5326f0[_0x58f1('0x3c')]=qs[_0x58f1('0x34')](_[_0x58f1('0x3d')](_0x4ce99e[_0x58f1('0x32')],_0x5c43c4[_0x58f1('0x34')]));if(_0x4ce99e['query']['filter']){_0x5326f0[_0x58f1('0x3c')]=_[_0x58f1('0x3f')](_0x5326f0[_0x58f1('0x3c')],{'$or':_['map'](_0x5326f0[_0x58f1('0x36')],function(_0x4a0da7){var _0x4d52fc={};_0x4d52fc[_0x4a0da7]={'$like':'%'+_0x4ce99e[_0x58f1('0x32')]['filter']+'%'};return _0x4d52fc;})});}_0x5326f0=_['merge']({},_0x5326f0,_0x4ce99e[_0x58f1('0x41')]);return _0x24053f[_0x58f1('0x52')](_0x5326f0);}})['then'](function(_0x3d67d4){if(_0x3d67d4){_0x543e9a=_0x3d67d4[_0x58f1('0x49')];if(!_0x4ce99e[_0x58f1('0x32')]['hasOwnProperty'](_0x58f1('0x39'))){_0x5326f0[_0x58f1('0x1d')]=qs[_0x58f1('0x1d')](_0x4ce99e[_0x58f1('0x32')]['limit']);_0x5326f0[_0x58f1('0x1f')]=qs[_0x58f1('0x1f')](_0x4ce99e['query'][_0x58f1('0x1f')]);}return _0x24053f[_0x58f1('0x52')](_0x5326f0);}})[_0x58f1('0x25')](function(_0x489620){if(_0x489620){return _0x489620?{'count':_0x543e9a,'rows':_0x489620}:null;}})['then'](respondWithResult(_0x6ff1b3,null))[_0x58f1('0x46')](handleError(_0x6ff1b3,null));};
\ No newline at end of file
index 5233cb7..4b9c5a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1aa=['moment','bluebird','rimraf','../../config/environment','exports','ServicenowConfiguration','util','../../config/logger','api'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa1aa,0x19b));var _0xaa1a=function(_0xf901da,_0x10c6fa){_0xf901da=_0xf901da-0x0;var _0x5e565c=_0xa1aa[_0xf901da];return _0x5e565c;};'use strict';var _=require('lodash');var util=require(_0xaa1a('0x0'));var logger=require(_0xaa1a('0x1'))(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xaa1a('0x7')]=function(_0x370a4e,_0x243c15){return _0x370a4e['define'](_0xaa1a('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa788=['request-promise','rimraf','../../config/environment','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x3917e4,_0x578a14){var _0x1ebf46=function(_0x4868b7){while(--_0x4868b7){_0x3917e4['push'](_0x3917e4['shift']());}};_0x1ebf46(++_0x578a14);}(_0xa788,0x70));var _0x8a78=function(_0x24accd,_0x51ad2b){_0x24accd=_0x24accd-0x0;var _0x51a7bf=_0xa788[_0x24accd];return _0x51a7bf;};'use strict';var _=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var logger=require(_0x8a78('0x2'))(_0x8a78('0x3'));var moment=require('moment');var BPromise=require(_0x8a78('0x4'));var rp=require(_0x8a78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a78('0x6'));var config=require(_0x8a78('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x506edf,_0x316a62){return _0x506edf[_0x8a78('0x8')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 873b528..8aa52ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86b8,0x15d));var _0x886b=function(_0x40e436,_0x49e2ef){_0x40e436=_0x40e436-0x0;var _0x45783d=_0x86b8[_0x40e436];return _0x45783d;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var moment=require(_0x886b('0x2'));var BPromise=require('bluebird');var rs=require(_0x886b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x886b('0x4'))['db'];var utils=require(_0x886b('0x5'));var logger=require(_0x886b('0x6'))('rpc');var config=require(_0x886b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x886b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd9d9ac,_0xe888a0,_0x2f8957){return new BPromise(function(_0xbc2d70,_0x238701){return client[_0x886b('0x9')](_0xd9d9ac,_0x2f8957)[_0x886b('0xa')](function(_0x52344d){logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));logger[_0x886b('0xe')](_0x886b('0xf'),_0xe888a0,_0x886b('0xd'),JSON[_0x886b('0x10')](_0x52344d));if(_0x52344d[_0x886b('0x11')]){if(_0x52344d['error'][_0x886b('0x12')]===0x1f4){logger[_0x886b('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0x238701(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0xbc2d70(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}else{logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));_0xbc2d70(_0x52344d[_0x886b('0x14')]['message']);}})[_0x886b('0x15')](function(_0x44d81a){logger['error'](_0x886b('0xc'),_0xe888a0,_0x44d81a);_0x238701(_0x44d81a);});});}
\ No newline at end of file
+var _0xad94=['catch','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x37f91e,_0x168d65){var _0x490fb1=function(_0x498e6b){while(--_0x498e6b){_0x37f91e['push'](_0x37f91e['shift']());}};_0x490fb1(++_0x168d65);}(_0xad94,0x99));var _0x4ad9=function(_0x5b462c,_0x4894af){_0x5b462c=_0x5b462c-0x0;var _0x31c895=_0xad94[_0x5b462c];return _0x31c895;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ad9('0x0'));var BPromise=require('bluebird');var rs=require(_0x4ad9('0x1'));var fs=require('fs');var Redis=require(_0x4ad9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ad9('0x3'))('rpc');var config=require(_0x4ad9('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4ad9('0x5')][_0x4ad9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xb6e8cb,_0x3cd626,_0x1f1d52){return new BPromise(function(_0xac2d13,_0x516496){return client[_0x4ad9('0x7')](_0xb6e8cb,_0x1f1d52)[_0x4ad9('0x8')](function(_0xb308b0){logger[_0x4ad9('0x9')](_0x4ad9('0xa'),_0x3cd626,'request\x20sent');logger[_0x4ad9('0xb')](_0x4ad9('0xc'),_0x3cd626,_0x4ad9('0xd'),JSON['stringify'](_0xb308b0));if(_0xb308b0[_0x4ad9('0xe')]){if(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0xf')]===0x1f4){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);return _0x516496(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);}logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')]['message']);return _0xac2d13(_0xb308b0[_0x4ad9('0xe')]['message']);}else{logger[_0x4ad9('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cd626,_0x4ad9('0xd'));_0xac2d13(_0xb308b0[_0x4ad9('0x11')][_0x4ad9('0x10')]);}})[_0x4ad9('0x12')](function(_0x2b5bbc){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0x2b5bbc);_0x516496(_0x2b5bbc);});});}
\ No newline at end of file
index d1082c5..b942327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb273=['get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xb273,0x127));var _0x3b27=function(_0x2dd67c,_0x354d22){_0x2dd67c=_0x2dd67c-0x0;var _0x553be6=_0xb273[_0x2dd67c];return _0x553be6;};'use strict';var multer=require(_0x3b27('0x0'));var util=require(_0x3b27('0x1'));var path=require(_0x3b27('0x2'));var timeout=require(_0x3b27('0x3'));var express=require(_0x3b27('0x4'));var router=express['Router']();var fs_extra=require(_0x3b27('0x5'));var auth=require(_0x3b27('0x6'));var interaction=require(_0x3b27('0x7'));var config=require(_0x3b27('0x8'));var controller=require('./intServicenowField.controller');router[_0x3b27('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b27('0xa')]);router[_0x3b27('0x9')](_0x3b27('0xb'),auth[_0x3b27('0xc')](),controller[_0x3b27('0xd')]);router['post']('/',auth[_0x3b27('0xc')](),controller[_0x3b27('0xe')]);router[_0x3b27('0xf')](_0x3b27('0xb'),auth[_0x3b27('0xc')](),controller[_0x3b27('0x10')]);router['delete'](_0x3b27('0xb'),auth[_0x3b27('0xc')](),controller[_0x3b27('0x11')]);module[_0x3b27('0x12')]=router;
\ No newline at end of file
+var _0xce8d=['./intServicenowField.controller','isAuthenticated','index','get','show','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f7d84,_0xeda4d){var _0x2a9122=function(_0x5ee055){while(--_0x5ee055){_0x4f7d84['push'](_0x4f7d84['shift']());}};_0x2a9122(++_0xeda4d);}(_0xce8d,0x101));var _0xdce8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce8d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdce8('0x0'));var util=require(_0xdce8('0x1'));var path=require(_0xdce8('0x2'));var timeout=require(_0xdce8('0x3'));var express=require(_0xdce8('0x4'));var router=express[_0xdce8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdce8('0x6'));var interaction=require(_0xdce8('0x7'));var config=require(_0xdce8('0x8'));var controller=require(_0xdce8('0x9'));router['get']('/',auth[_0xdce8('0xa')](),controller[_0xdce8('0xb')]);router[_0xdce8('0xc')]('/:id',auth[_0xdce8('0xa')](),controller[_0xdce8('0xd')]);router[_0xdce8('0xe')]('/',auth[_0xdce8('0xa')](),controller['create']);router['put'](_0xdce8('0xf'),auth[_0xdce8('0xa')](),controller[_0xdce8('0x10')]);router['delete'](_0xdce8('0xf'),auth[_0xdce8('0xa')](),controller[_0xdce8('0x11')]);module[_0xdce8('0x12')]=router;
\ No newline at end of file
index 5adf1de..3b96a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4fa=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x2dd4b4,_0x34cc3f){var _0x2322d0=function(_0x33b824){while(--_0x33b824){_0x2dd4b4['push'](_0x2dd4b4['shift']());}};_0x2322d0(++_0x34cc3f);}(_0xb4fa,0x10d));var _0xab4f=function(_0x29bd18,_0x1dd34d){_0x29bd18=_0x29bd18-0x0;var _0x3c8f3f=_0xb4fa[_0x29bd18];return _0x3c8f3f;};'use strict';var Sequelize=require(_0xab4f('0x0'));module[_0xab4f('0x1')]={'type':{'type':Sequelize[_0xab4f('0x2')](_0xab4f('0x3'),_0xab4f('0x4'),_0xab4f('0x5'),_0xab4f('0x6'),_0xab4f('0x7')),'defaultValue':_0xab4f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xab4f('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xab4f('0x3'),_0xab4f('0x4'),_0xab4f('0x5'))},'keyContent':{'type':Sequelize[_0xab4f('0x8')]},'idField':{'type':Sequelize[_0xab4f('0x8')]},'nameField':{'type':Sequelize[_0xab4f('0x8')]},'customField':{'type':Sequelize[_0xab4f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xab4f('0x8')]}};
\ No newline at end of file
+var _0x55a5=['sequelize','exports','ENUM','variable','keyValue','picklist','string','customVariable','STRING','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x55a5,0x6e));var _0x555a=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0x55a5[_0x47e309];return _0x2e1900;};'use strict';var Sequelize=require(_0x555a('0x0'));module[_0x555a('0x1')]={'type':{'type':Sequelize[_0x555a('0x2')]('string',_0x555a('0x3'),'customVariable',_0x555a('0x4'),_0x555a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x555a('0x2')](_0x555a('0x6'),_0x555a('0x3'),_0x555a('0x7'))},'keyContent':{'type':Sequelize[_0x555a('0x8')]},'idField':{'type':Sequelize[_0x555a('0x8')]},'nameField':{'type':Sequelize[_0x555a('0x8')]},'customField':{'type':Sequelize[_0x555a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x555a('0x8')]}};
\ No newline at end of file
index 009332f..5362263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x738f=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','create','body','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring'];(function(_0x28a3cd,_0x21982c){var _0x5f44d2=function(_0x43ba6f){while(--_0x43ba6f){_0x28a3cd['push'](_0x28a3cd['shift']());}};_0x5f44d2(++_0x21982c);}(_0x738f,0x160));var _0xf738=function(_0x1465c1,_0xa8fd77){_0x1465c1=_0x1465c1-0x0;var _0x104621=_0x738f[_0x1465c1];return _0x104621;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf738('0x1'));var rp=require(_0xf738('0x2'));var moment=require('moment');var BPromise=require(_0xf738('0x3'));var Mustache=require(_0xf738('0x4'));var util=require(_0xf738('0x5'));var path=require('path');var sox=require(_0xf738('0x6'));var csv=require(_0xf738('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf738('0x8'));var _=require(_0xf738('0x9'));var squel=require(_0xf738('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf738('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf738('0xc'));var Papa=require(_0xf738('0xd'));var Redis=require(_0xf738('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf738('0xf'));var hardwareService=require(_0xf738('0x10'));var logger=require(_0xf738('0x11'))(_0xf738('0x12'));var utils=require(_0xf738('0x13'));var config=require(_0xf738('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf738('0x15'))['db'];function respondWithStatusCode(_0x2c5624,_0x53553d){_0x53553d=_0x53553d||0xcc;return function(_0x27e17c){if(_0x27e17c){return _0x2c5624[_0xf738('0x16')](_0x53553d);}return _0x2c5624[_0xf738('0x17')](_0x53553d)[_0xf738('0x18')]();};}function respondWithResult(_0x3f69dc,_0x2058d3){_0x2058d3=_0x2058d3||0xc8;return function(_0x20bc56){if(_0x20bc56){return _0x3f69dc[_0xf738('0x17')](_0x2058d3)['json'](_0x20bc56);}};}function respondWithFilteredResult(_0x54354f,_0x102203){return function(_0x411c59){if(_0x411c59){var _0x566c71=typeof _0x102203[_0xf738('0x19')]===_0xf738('0x1a')&&typeof _0x102203[_0xf738('0x1b')]===_0xf738('0x1a');var _0x27d66f=_0x411c59['count'];var _0x55def2=_0x566c71?0x0:_0x102203['offset'];var _0x3205d8=_0x566c71?_0x411c59[_0xf738('0x1c')]:_0x102203[_0xf738('0x19')]+_0x102203[_0xf738('0x1b')];var _0x5f2fb8;if(_0x3205d8>=_0x27d66f){_0x3205d8=_0x27d66f;_0x5f2fb8=0xc8;}else{_0x5f2fb8=0xce;}_0x54354f['status'](_0x5f2fb8);return _0x54354f[_0xf738('0x1d')](_0xf738('0x1e'),_0x55def2+'-'+_0x3205d8+'/'+_0x27d66f)[_0xf738('0x1f')](_0x411c59);}return null;};}function patchUpdates(_0x34abd0){return function(_0x5a4f8b){try{jsonpatch[_0xf738('0x20')](_0x5a4f8b,_0x34abd0,!![]);}catch(_0x437ef3){return BPromise[_0xf738('0x21')](_0x437ef3);}return _0x5a4f8b[_0xf738('0x22')]();};}function saveUpdates(_0x1f5cdd,_0x2ff8cc){return function(_0x52dd85){if(_0x52dd85){return _0x52dd85[_0xf738('0x23')](_0x1f5cdd)[_0xf738('0x24')](function(_0x184102){return _0x184102;});}return null;};}function removeEntity(_0x581f83,_0x70f3a9){return function(_0x3ec7dd){if(_0x3ec7dd){return _0x3ec7dd[_0xf738('0x25')]()['then'](function(){_0x581f83['status'](0xcc)[_0xf738('0x18')]();});}};}function handleEntityNotFound(_0x1afafe,_0x5b838a){return function(_0x2a06a3){if(!_0x2a06a3){_0x1afafe[_0xf738('0x16')](0x194);}return _0x2a06a3;};}function handleError(_0x5513f6,_0x5a46fe){_0x5a46fe=_0x5a46fe||0x1f4;return function(_0x6b1131){logger[_0xf738('0x26')](_0x6b1131[_0xf738('0x27')]);if(_0x6b1131[_0xf738('0x28')]){delete _0x6b1131['name'];}_0x5513f6[_0xf738('0x17')](_0x5a46fe)[_0xf738('0x29')](_0x6b1131);};}exports[_0xf738('0x2a')]=function(_0x1c4b17,_0x4a8c8f){var _0x1e2006={},_0x4c9a77={},_0x14aa12={'count':0x0,'rows':[]};var _0x41b1f2=_[_0xf738('0x2b')](db[_0xf738('0x2c')][_0xf738('0x2d')],function(_0x10a918){return{'name':_0x10a918['fieldName'],'type':_0x10a918[_0xf738('0x2e')]['key']};});_0x4c9a77['model']=_[_0xf738('0x2b')](_0x41b1f2,'name');_0x4c9a77[_0xf738('0x2f')]=_['keys'](_0x1c4b17[_0xf738('0x2f')]);_0x4c9a77[_0xf738('0x30')]=_[_0xf738('0x31')](_0x4c9a77[_0xf738('0x32')],_0x4c9a77['query']);_0x1e2006[_0xf738('0x33')]=_[_0xf738('0x31')](_0x4c9a77[_0xf738('0x32')],qs[_0xf738('0x34')](_0x1c4b17[_0xf738('0x2f')][_0xf738('0x34')]));_0x1e2006[_0xf738('0x33')]=_0x1e2006['attributes'][_0xf738('0x35')]?_0x1e2006[_0xf738('0x33')]:_0x4c9a77['model'];if(!_0x1c4b17[_0xf738('0x2f')][_0xf738('0x36')](_0xf738('0x37'))){_0x1e2006[_0xf738('0x1b')]=qs['limit'](_0x1c4b17['query'][_0xf738('0x1b')]);_0x1e2006[_0xf738('0x19')]=qs[_0xf738('0x19')](_0x1c4b17[_0xf738('0x2f')]['offset']);}_0x1e2006[_0xf738('0x38')]=qs[_0xf738('0x39')](_0x1c4b17[_0xf738('0x2f')][_0xf738('0x39')]);_0x1e2006[_0xf738('0x3a')]=qs[_0xf738('0x30')](_['pick'](_0x1c4b17[_0xf738('0x2f')],_0x4c9a77[_0xf738('0x30')]),_0x41b1f2);if(_0x1c4b17['query'][_0xf738('0x3b')]){_0x1e2006[_0xf738('0x3a')]=_[_0xf738('0x3c')](_0x1e2006[_0xf738('0x3a')],{'$or':_[_0xf738('0x2b')](_0x41b1f2,function(_0x63cfe7){if(_0x63cfe7[_0xf738('0x2e')]!==_0xf738('0x3d')){var _0x55d200={};_0x55d200[_0x63cfe7['name']]={'$like':'%'+_0x1c4b17[_0xf738('0x2f')][_0xf738('0x3b')]+'%'};return _0x55d200;}})});}_0x1e2006=_[_0xf738('0x3c')]({},_0x1e2006,_0x1c4b17[_0xf738('0x3e')]);var _0x50bb7={'where':_0x1e2006[_0xf738('0x3a')]};return db['ServicenowField'][_0xf738('0x1c')](_0x50bb7)[_0xf738('0x24')](function(_0x5bd99d){_0x14aa12[_0xf738('0x1c')]=_0x5bd99d;if(_0x1c4b17[_0xf738('0x2f')]['includeAll']){_0x1e2006[_0xf738('0x3f')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x1e2006);})[_0xf738('0x24')](function(_0x37b9ad){_0x14aa12[_0xf738('0x40')]=_0x37b9ad;return _0x14aa12;})[_0xf738('0x24')](respondWithFilteredResult(_0x4a8c8f,_0x1e2006))[_0xf738('0x41')](handleError(_0x4a8c8f,null));};exports[_0xf738('0x42')]=function(_0x59623b,_0x4e1fcb){var _0x5813d2={'raw':!![],'where':{'id':_0x59623b[_0xf738('0x43')]['id']}},_0x4d1263={};_0x4d1263[_0xf738('0x32')]=_[_0xf738('0x44')](db[_0xf738('0x2c')]['rawAttributes']);_0x4d1263[_0xf738('0x2f')]=_[_0xf738('0x44')](_0x59623b['query']);_0x4d1263[_0xf738('0x30')]=_[_0xf738('0x31')](_0x4d1263[_0xf738('0x32')],_0x4d1263[_0xf738('0x2f')]);_0x5813d2['attributes']=_['intersection'](_0x4d1263[_0xf738('0x32')],qs[_0xf738('0x34')](_0x59623b['query'][_0xf738('0x34')]));_0x5813d2[_0xf738('0x33')]=_0x5813d2[_0xf738('0x33')][_0xf738('0x35')]?_0x5813d2['attributes']:_0x4d1263[_0xf738('0x32')];if(_0x59623b[_0xf738('0x2f')][_0xf738('0x45')]){_0x5813d2[_0xf738('0x3f')]=[{'all':!![]}];}_0x5813d2=_[_0xf738('0x3c')]({},_0x5813d2,_0x59623b[_0xf738('0x3e')]);return db[_0xf738('0x2c')]['find'](_0x5813d2)['then'](handleEntityNotFound(_0x4e1fcb,null))[_0xf738('0x24')](respondWithResult(_0x4e1fcb,null))['catch'](handleError(_0x4e1fcb,null));};exports[_0xf738('0x46')]=function(_0x1c5b40,_0x53dd15){return db[_0xf738('0x2c')][_0xf738('0x46')](_0x1c5b40[_0xf738('0x47')],{})[_0xf738('0x24')](respondWithResult(_0x53dd15,0xc9))[_0xf738('0x41')](handleError(_0x53dd15,null));};exports[_0xf738('0x23')]=function(_0x4f0d11,_0x3fc13f){if(_0x4f0d11[_0xf738('0x47')]['id']){delete _0x4f0d11['body']['id'];}return db['ServicenowField'][_0xf738('0x48')]({'where':{'id':_0x4f0d11[_0xf738('0x43')]['id']}})[_0xf738('0x24')](handleEntityNotFound(_0x3fc13f,null))[_0xf738('0x24')](saveUpdates(_0x4f0d11['body'],null))['then'](respondWithResult(_0x3fc13f,null))[_0xf738('0x41')](handleError(_0x3fc13f,null));};exports[_0xf738('0x25')]=function(_0x5bd7e4,_0x7cd78f){return db[_0xf738('0x2c')][_0xf738('0x48')]({'where':{'id':_0x5bd7e4[_0xf738('0x43')]['id']}})['then'](handleEntityNotFound(_0x7cd78f,null))[_0xf738('0x24')](removeEntity(_0x7cd78f,null))[_0xf738('0x41')](handleError(_0x7cd78f,null));};
\ No newline at end of file
+var _0xf291=['map','ServicenowField','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','show','params','length','include','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','save','then','destroy','error','stack','name'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xf291,0x1d3));var _0x1f29=function(_0x6a395c,_0x3954fa){_0x6a395c=_0x6a395c-0x0;var _0x2ad2fc=_0xf291[_0x6a395c];return _0x2ad2fc;};'use strict';var emlformat=require(_0x1f29('0x0'));var rimraf=require(_0x1f29('0x1'));var zipdir=require(_0x1f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1f29('0x3'));var BPromise=require(_0x1f29('0x4'));var Mustache=require(_0x1f29('0x5'));var util=require(_0x1f29('0x6'));var path=require(_0x1f29('0x7'));var sox=require(_0x1f29('0x8'));var csv=require('to-csv');var ejs=require(_0x1f29('0x9'));var fs=require('fs');var fs_extra=require(_0x1f29('0xa'));var _=require(_0x1f29('0xb'));var squel=require(_0x1f29('0xc'));var crypto=require('crypto');var jsforce=require(_0x1f29('0xd'));var deskjs=require(_0x1f29('0xe'));var toCsv=require(_0x1f29('0xf'));var querystring=require(_0x1f29('0x10'));var Papa=require(_0x1f29('0x11'));var Redis=require(_0x1f29('0x12'));var authService=require(_0x1f29('0x13'));var qs=require(_0x1f29('0x14'));var as=require(_0x1f29('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f29('0x16'))(_0x1f29('0x17'));var utils=require(_0x1f29('0x18'));var config=require(_0x1f29('0x19'));var licenseUtil=require(_0x1f29('0x1a'));var db=require(_0x1f29('0x1b'))['db'];function respondWithStatusCode(_0x23dad7,_0x75f130){_0x75f130=_0x75f130||0xcc;return function(_0x43c264){if(_0x43c264){return _0x23dad7[_0x1f29('0x1c')](_0x75f130);}return _0x23dad7['status'](_0x75f130)[_0x1f29('0x1d')]();};}function respondWithResult(_0x3d6f53,_0x5b006a){_0x5b006a=_0x5b006a||0xc8;return function(_0x3dbb43){if(_0x3dbb43){return _0x3d6f53['status'](_0x5b006a)[_0x1f29('0x1e')](_0x3dbb43);}};}function respondWithFilteredResult(_0x4eca0b,_0x19ae52){return function(_0x5b0a47){if(_0x5b0a47){var _0x30cfd7=typeof _0x19ae52[_0x1f29('0x1f')]==='undefined'&&typeof _0x19ae52[_0x1f29('0x20')]===_0x1f29('0x21');var _0x418b54=_0x5b0a47['count'];var _0x2248b5=_0x30cfd7?0x0:_0x19ae52[_0x1f29('0x1f')];var _0x47f97a=_0x30cfd7?_0x5b0a47[_0x1f29('0x22')]:_0x19ae52[_0x1f29('0x1f')]+_0x19ae52[_0x1f29('0x20')];var _0x408377;if(_0x47f97a>=_0x418b54){_0x47f97a=_0x418b54;_0x408377=0xc8;}else{_0x408377=0xce;}_0x4eca0b[_0x1f29('0x23')](_0x408377);return _0x4eca0b[_0x1f29('0x24')](_0x1f29('0x25'),_0x2248b5+'-'+_0x47f97a+'/'+_0x418b54)[_0x1f29('0x1e')](_0x5b0a47);}return null;};}function patchUpdates(_0x596d61){return function(_0x1661dd){try{jsonpatch['apply'](_0x1661dd,_0x596d61,!![]);}catch(_0x57cb9c){return BPromise['reject'](_0x57cb9c);}return _0x1661dd[_0x1f29('0x26')]();};}function saveUpdates(_0xfa289f,_0x31485b){return function(_0x34e4d8){if(_0x34e4d8){return _0x34e4d8['update'](_0xfa289f)[_0x1f29('0x27')](function(_0x2a2169){return _0x2a2169;});}return null;};}function removeEntity(_0x5be46d,_0x121940){return function(_0x399d81){if(_0x399d81){return _0x399d81[_0x1f29('0x28')]()[_0x1f29('0x27')](function(){_0x5be46d[_0x1f29('0x23')](0xcc)[_0x1f29('0x1d')]();});}};}function handleEntityNotFound(_0x4838da,_0x452797){return function(_0x314e6e){if(!_0x314e6e){_0x4838da[_0x1f29('0x1c')](0x194);}return _0x314e6e;};}function handleError(_0x2e5956,_0x2cce9a){_0x2cce9a=_0x2cce9a||0x1f4;return function(_0x37fc61){logger[_0x1f29('0x29')](_0x37fc61[_0x1f29('0x2a')]);if(_0x37fc61[_0x1f29('0x2b')]){delete _0x37fc61[_0x1f29('0x2b')];}_0x2e5956[_0x1f29('0x23')](_0x2cce9a)['send'](_0x37fc61);};}exports['index']=function(_0xdc014,_0x44bc0b){var _0x39e03a={},_0x385492={},_0x54089d={'count':0x0,'rows':[]};var _0x39224a=_[_0x1f29('0x2c')](db[_0x1f29('0x2d')]['rawAttributes'],function(_0x175a62){return{'name':_0x175a62[_0x1f29('0x2e')],'type':_0x175a62['type'][_0x1f29('0x2f')]};});_0x385492[_0x1f29('0x30')]=_['map'](_0x39224a,'name');_0x385492[_0x1f29('0x31')]=_[_0x1f29('0x32')](_0xdc014[_0x1f29('0x31')]);_0x385492[_0x1f29('0x33')]=_['intersection'](_0x385492[_0x1f29('0x30')],_0x385492[_0x1f29('0x31')]);_0x39e03a[_0x1f29('0x34')]=_[_0x1f29('0x35')](_0x385492[_0x1f29('0x30')],qs[_0x1f29('0x36')](_0xdc014[_0x1f29('0x31')][_0x1f29('0x36')]));_0x39e03a[_0x1f29('0x34')]=_0x39e03a[_0x1f29('0x34')]['length']?_0x39e03a[_0x1f29('0x34')]:_0x385492[_0x1f29('0x30')];if(!_0xdc014[_0x1f29('0x31')][_0x1f29('0x37')](_0x1f29('0x38'))){_0x39e03a[_0x1f29('0x20')]=qs[_0x1f29('0x20')](_0xdc014[_0x1f29('0x31')]['limit']);_0x39e03a['offset']=qs[_0x1f29('0x1f')](_0xdc014[_0x1f29('0x31')]['offset']);}_0x39e03a[_0x1f29('0x39')]=qs[_0x1f29('0x3a')](_0xdc014[_0x1f29('0x31')][_0x1f29('0x3a')]);_0x39e03a[_0x1f29('0x3b')]=qs[_0x1f29('0x33')](_['pick'](_0xdc014[_0x1f29('0x31')],_0x385492['filters']),_0x39224a);if(_0xdc014['query'][_0x1f29('0x3c')]){_0x39e03a[_0x1f29('0x3b')]=_[_0x1f29('0x3d')](_0x39e03a['where'],{'$or':_[_0x1f29('0x2c')](_0x39224a,function(_0x3d3427){if(_0x3d3427['type']!==_0x1f29('0x3e')){var _0x59a23e={};_0x59a23e[_0x3d3427['name']]={'$like':'%'+_0xdc014[_0x1f29('0x31')][_0x1f29('0x3c')]+'%'};return _0x59a23e;}})});}_0x39e03a=_[_0x1f29('0x3d')]({},_0x39e03a,_0xdc014['options']);var _0x31b3af={'where':_0x39e03a[_0x1f29('0x3b')]};return db['ServicenowField'][_0x1f29('0x22')](_0x31b3af)[_0x1f29('0x27')](function(_0x2d853c){_0x54089d[_0x1f29('0x22')]=_0x2d853c;if(_0xdc014[_0x1f29('0x31')][_0x1f29('0x3f')]){_0x39e03a['include']=[{'all':!![]}];}return db[_0x1f29('0x2d')][_0x1f29('0x40')](_0x39e03a);})[_0x1f29('0x27')](function(_0x3e0923){_0x54089d['rows']=_0x3e0923;return _0x54089d;})['then'](respondWithFilteredResult(_0x44bc0b,_0x39e03a))['catch'](handleError(_0x44bc0b,null));};exports[_0x1f29('0x41')]=function(_0x3af6ad,_0x37f388){var _0x167b17={'raw':!![],'where':{'id':_0x3af6ad[_0x1f29('0x42')]['id']}},_0x3745d8={};_0x3745d8['model']=_[_0x1f29('0x32')](db[_0x1f29('0x2d')]['rawAttributes']);_0x3745d8['query']=_[_0x1f29('0x32')](_0x3af6ad['query']);_0x3745d8['filters']=_[_0x1f29('0x35')](_0x3745d8['model'],_0x3745d8['query']);_0x167b17[_0x1f29('0x34')]=_[_0x1f29('0x35')](_0x3745d8[_0x1f29('0x30')],qs[_0x1f29('0x36')](_0x3af6ad['query'][_0x1f29('0x36')]));_0x167b17[_0x1f29('0x34')]=_0x167b17[_0x1f29('0x34')][_0x1f29('0x43')]?_0x167b17['attributes']:_0x3745d8[_0x1f29('0x30')];if(_0x3af6ad[_0x1f29('0x31')][_0x1f29('0x3f')]){_0x167b17[_0x1f29('0x44')]=[{'all':!![]}];}_0x167b17=_['merge']({},_0x167b17,_0x3af6ad['options']);return db[_0x1f29('0x2d')][_0x1f29('0x45')](_0x167b17)[_0x1f29('0x27')](handleEntityNotFound(_0x37f388,null))[_0x1f29('0x27')](respondWithResult(_0x37f388,null))[_0x1f29('0x46')](handleError(_0x37f388,null));};exports[_0x1f29('0x47')]=function(_0x59fbf1,_0x5ba318){return db[_0x1f29('0x2d')][_0x1f29('0x47')](_0x59fbf1[_0x1f29('0x48')],{})[_0x1f29('0x27')](respondWithResult(_0x5ba318,0xc9))[_0x1f29('0x46')](handleError(_0x5ba318,null));};exports['update']=function(_0x58a388,_0x14be9c){if(_0x58a388[_0x1f29('0x48')]['id']){delete _0x58a388['body']['id'];}return db[_0x1f29('0x2d')][_0x1f29('0x45')]({'where':{'id':_0x58a388[_0x1f29('0x42')]['id']}})[_0x1f29('0x27')](handleEntityNotFound(_0x14be9c,null))['then'](saveUpdates(_0x58a388[_0x1f29('0x48')],null))[_0x1f29('0x27')](respondWithResult(_0x14be9c,null))[_0x1f29('0x46')](handleError(_0x14be9c,null));};exports[_0x1f29('0x28')]=function(_0x37f788,_0x5c1b0b){return db['ServicenowField'][_0x1f29('0x45')]({'where':{'id':_0x37f788[_0x1f29('0x42')]['id']}})[_0x1f29('0x27')](handleEntityNotFound(_0x5c1b0b,null))[_0x1f29('0x27')](removeEntity(_0x5c1b0b,null))[_0x1f29('0x46')](handleError(_0x5c1b0b,null));};
\ No newline at end of file
index 209618b..73b0f9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe884=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x58f8e9,_0x4073ac){var _0x27ba35=function(_0x45823b){while(--_0x45823b){_0x58f8e9['push'](_0x58f8e9['shift']());}};_0x27ba35(++_0x4073ac);}(_0xe884,0xb1));var _0x4e88=function(_0x2efc91,_0x1902c6){_0x2efc91=_0x2efc91-0x0;var _0x34598=_0xe884[_0x2efc91];return _0x34598;};'use strict';var _=require(_0x4e88('0x0'));var util=require(_0x4e88('0x1'));var logger=require(_0x4e88('0x2'))(_0x4e88('0x3'));var moment=require(_0x4e88('0x4'));var BPromise=require('bluebird');var rp=require(_0x4e88('0x5'));var fs=require('fs');var path=require(_0x4e88('0x6'));var rimraf=require('rimraf');var config=require(_0x4e88('0x7'));var attributes=require(_0x4e88('0x8'));module[_0x4e88('0x9')]=function(_0x6cf218,_0x2249ea){return _0x6cf218[_0x4e88('0xa')](_0x4e88('0xb'),attributes,{'tableName':_0x4e88('0xc'),'paranoid':![],'indexes':[{'name':_0x4e88('0xd'),'fields':[_0x4e88('0xe'),_0x4e88('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x82a8=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger'];(function(_0xd03bb7,_0xc1ef5b){var _0x33ee50=function(_0x15f526){while(--_0x15f526){_0xd03bb7['push'](_0xd03bb7['shift']());}};_0x33ee50(++_0xc1ef5b);}(_0x82a8,0x195));var _0x882a=function(_0x36f8fe,_0x26cd47){_0x36f8fe=_0x36f8fe-0x0;var _0x3f821a=_0x82a8[_0x36f8fe];return _0x3f821a;};'use strict';var _=require(_0x882a('0x0'));var util=require(_0x882a('0x1'));var logger=require(_0x882a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x882a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x882a('0x4'));var config=require(_0x882a('0x5'));var attributes=require(_0x882a('0x6'));module['exports']=function(_0xc121f4,_0x116934){return _0xc121f4[_0x882a('0x7')](_0x882a('0x8'),attributes,{'tableName':_0x882a('0x9'),'paranoid':![],'indexes':[{'name':_0x882a('0xa'),'fields':[_0x882a('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a3b221c..2d90e33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0xda3f,0xec));var _0xfda3=function(_0x2bfb1c,_0x42f0da){_0x2bfb1c=_0x2bfb1c-0x0;var _0x30ef7e=_0xda3f[_0x2bfb1c];return _0x30ef7e;};'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')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x38bc51,_0x47c022){var _0x3df60f=function(_0x540046){while(--_0x540046){_0x38bc51['push'](_0x38bc51['shift']());}};_0x3df60f(++_0x47c022);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 e28e99f..2d78baf 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(_0x1c3dcd,_0x242958){var _0x2d5a9e=function(_0x2b2b5a){while(--_0x2b2b5a){_0x1c3dcd['push'](_0x1c3dcd['shift']());}};_0x2d5a9e(++_0x242958);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x22f3df,_0x2f15b5){var _0x191c57=function(_0x4d57ab){while(--_0x4d57ab){_0x22f3df['push'](_0x22f3df['shift']());}};_0x191c57(++_0x2f15b5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 0a0c4a5..65d4575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x417de6,_0x29d0f0){var _0x23650e=function(_0x149c0a){while(--_0x149c0a){_0x417de6['push'](_0x417de6['shift']());}};_0x23650e(++_0x29d0f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x51bff2,_0x2409d0){var _0x4c3311=function(_0x1e4c4a){while(--_0x1e4c4a){_0x51bff2['push'](_0x51bff2['shift']());}};_0x4c3311(++_0x2409d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 6ebaffe..d88ea1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4992=['rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','error','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy','getConfigurations','SugarcrmConfiguration','sort','addConfiguration','findOne','getSubjects','channel','Descriptions','SugarcrmField','Subjects','getFields','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format'];(function(_0x1b1885,_0x548eb9){var _0x1339cc=function(_0x225ed9){while(--_0x225ed9){_0x1b1885['push'](_0x1b1885['shift']());}};_0x1339cc(++_0x548eb9);}(_0x4992,0x164));var _0x2499=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x4992[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0x2499('0x0'));var rimraf=require(_0x2499('0x1'));var zipdir=require(_0x2499('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2499('0x3'));var moment=require(_0x2499('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2499('0x5'));var util=require(_0x2499('0x6'));var path=require('path');var sox=require(_0x2499('0x7'));var csv=require(_0x2499('0x8'));var ejs=require(_0x2499('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2499('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2499('0xb'));var deskjs=require(_0x2499('0xc'));var toCsv=require(_0x2499('0x8'));var querystring=require(_0x2499('0xd'));var Papa=require('papaparse');var Redis=require(_0x2499('0xe'));var authService=require(_0x2499('0xf'));var qs=require(_0x2499('0x10'));var as=require(_0x2499('0x11'));var hardwareService=require(_0x2499('0x12'));var logger=require('../../config/logger')(_0x2499('0x13'));var utils=require(_0x2499('0x14'));var config=require(_0x2499('0x15'));var licenseUtil=require(_0x2499('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2499('0x17'));function respondWithStatusCode(_0x45dbc7,_0x417cf9){_0x417cf9=_0x417cf9||0xcc;return function(_0x5a24bd){if(_0x5a24bd){return _0x45dbc7[_0x2499('0x18')](_0x417cf9);}return _0x45dbc7[_0x2499('0x19')](_0x417cf9)['end']();};}function respondWithResult(_0x2fa5d2,_0x1ac282){_0x1ac282=_0x1ac282||0xc8;return function(_0x44e8e0){if(_0x44e8e0){return _0x2fa5d2[_0x2499('0x19')](_0x1ac282)['json'](_0x44e8e0);}};}function respondWithFilteredResult(_0x19ccf1,_0x3e14bf){return function(_0x35c29b){if(_0x35c29b){var _0x47a7d8=typeof _0x3e14bf[_0x2499('0x1a')]===_0x2499('0x1b')&&typeof _0x3e14bf[_0x2499('0x1c')]===_0x2499('0x1b');var _0x5179d0=_0x35c29b[_0x2499('0x1d')];var _0xd06a75=_0x47a7d8?0x0:_0x3e14bf['offset'];var _0xbf4275=_0x47a7d8?_0x35c29b[_0x2499('0x1d')]:_0x3e14bf['offset']+_0x3e14bf[_0x2499('0x1c')];var _0x46ad4f;if(_0xbf4275>=_0x5179d0){_0xbf4275=_0x5179d0;_0x46ad4f=0xc8;}else{_0x46ad4f=0xce;}_0x19ccf1[_0x2499('0x19')](_0x46ad4f);return _0x19ccf1[_0x2499('0x1e')](_0x2499('0x1f'),_0xd06a75+'-'+_0xbf4275+'/'+_0x5179d0)[_0x2499('0x20')](_0x35c29b);}return null;};}function patchUpdates(_0x404f62){return function(_0x1923b5){try{jsonpatch[_0x2499('0x21')](_0x1923b5,_0x404f62,!![]);}catch(_0x1581ec){return BPromise['reject'](_0x1581ec);}return _0x1923b5['save']();};}function saveUpdates(_0x3ffed5,_0x21b5f0){return function(_0x3f773a){if(_0x3f773a){return _0x3f773a[_0x2499('0x22')](_0x3ffed5)[_0x2499('0x23')](function(_0x23dea3){return _0x23dea3;});}return null;};}function removeEntity(_0x1d9303,_0x41c5ae){return function(_0x5b5e4c){if(_0x5b5e4c){return _0x5b5e4c['destroy']()[_0x2499('0x23')](function(){_0x1d9303[_0x2499('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331468,_0x4693cf){return function(_0x4c19c8){if(!_0x4c19c8){_0x331468['sendStatus'](0x194);}return _0x4c19c8;};}function handleError(_0x3ecf62,_0x23ac79){_0x23ac79=_0x23ac79||0x1f4;return function(_0x420e0e){logger[_0x2499('0x24')](_0x420e0e['stack']);if(_0x420e0e[_0x2499('0x25')]){delete _0x420e0e['name'];}_0x3ecf62[_0x2499('0x19')](_0x23ac79)[_0x2499('0x26')](_0x420e0e);};}exports[_0x2499('0x27')]=function(_0x525428,_0x9d7ff9){var _0x2582d3={},_0x3bc540={},_0x391514={'count':0x0,'rows':[]};var _0xbec6d7=_[_0x2499('0x28')](db[_0x2499('0x29')]['rawAttributes'],function(_0x56c005){return{'name':_0x56c005[_0x2499('0x2a')],'type':_0x56c005[_0x2499('0x2b')][_0x2499('0x2c')]};});_0x3bc540[_0x2499('0x2d')]=_[_0x2499('0x28')](_0xbec6d7,_0x2499('0x25'));_0x3bc540[_0x2499('0x2e')]=_[_0x2499('0x2f')](_0x525428['query']);_0x3bc540[_0x2499('0x30')]=_[_0x2499('0x31')](_0x3bc540['model'],_0x3bc540['query']);_0x2582d3[_0x2499('0x32')]=_[_0x2499('0x31')](_0x3bc540[_0x2499('0x2d')],qs[_0x2499('0x33')](_0x525428['query'][_0x2499('0x33')]));_0x2582d3[_0x2499('0x32')]=_0x2582d3[_0x2499('0x32')]['length']?_0x2582d3[_0x2499('0x32')]:_0x3bc540[_0x2499('0x2d')];if(!_0x525428[_0x2499('0x2e')][_0x2499('0x34')]('nolimit')){_0x2582d3['limit']=qs[_0x2499('0x1c')](_0x525428[_0x2499('0x2e')][_0x2499('0x1c')]);_0x2582d3[_0x2499('0x1a')]=qs[_0x2499('0x1a')](_0x525428['query'][_0x2499('0x1a')]);}_0x2582d3['order']=qs['sort'](_0x525428[_0x2499('0x2e')]['sort']);_0x2582d3['where']=qs['filters'](_[_0x2499('0x35')](_0x525428['query'],_0x3bc540[_0x2499('0x30')]),_0xbec6d7);if(_0x525428['query'][_0x2499('0x36')]){_0x2582d3[_0x2499('0x37')]=_['merge'](_0x2582d3[_0x2499('0x37')],{'$or':_['map'](_0xbec6d7,function(_0x422eb6){if(_0x422eb6[_0x2499('0x2b')]!=='VIRTUAL'){var _0x7b19b0={};_0x7b19b0[_0x422eb6[_0x2499('0x25')]]={'$like':'%'+_0x525428[_0x2499('0x2e')][_0x2499('0x36')]+'%'};return _0x7b19b0;}})});}_0x2582d3=_[_0x2499('0x38')]({},_0x2582d3,_0x525428[_0x2499('0x39')]);var _0x106abf={'where':_0x2582d3[_0x2499('0x37')]};return db['SugarcrmAccount']['count'](_0x106abf)['then'](function(_0x350109){_0x391514[_0x2499('0x1d')]=_0x350109;if(_0x525428['query'][_0x2499('0x3a')]){_0x2582d3['include']=[{'all':!![]}];}return db[_0x2499('0x29')][_0x2499('0x3b')](_0x2582d3);})[_0x2499('0x23')](function(_0x31d831){_0x391514[_0x2499('0x3c')]=_0x31d831;return _0x391514;})[_0x2499('0x23')](respondWithFilteredResult(_0x9d7ff9,_0x2582d3))[_0x2499('0x3d')](handleError(_0x9d7ff9,null));};exports[_0x2499('0x3e')]=function(_0x44493d,_0x5db204){var _0x3548eb={'raw':![],'where':{'id':_0x44493d[_0x2499('0x3f')]['id']}},_0x2c959a={};_0x2c959a[_0x2499('0x2d')]=_[_0x2499('0x2f')](db['SugarcrmAccount'][_0x2499('0x40')]);_0x2c959a['query']=_[_0x2499('0x2f')](_0x44493d[_0x2499('0x2e')]);_0x2c959a['filters']=_['intersection'](_0x2c959a[_0x2499('0x2d')],_0x2c959a[_0x2499('0x2e')]);_0x3548eb[_0x2499('0x32')]=_[_0x2499('0x31')](_0x2c959a[_0x2499('0x2d')],qs['fields'](_0x44493d[_0x2499('0x2e')]['fields']));_0x3548eb[_0x2499('0x32')]=_0x3548eb[_0x2499('0x32')][_0x2499('0x41')]?_0x3548eb['attributes']:_0x2c959a['model'];if(_0x44493d['query']['includeAll']){_0x3548eb[_0x2499('0x42')]=[{'all':!![]}];}_0x3548eb=_[_0x2499('0x38')]({},_0x3548eb,_0x44493d[_0x2499('0x39')]);return db[_0x2499('0x29')][_0x2499('0x43')](_0x3548eb)[_0x2499('0x23')](handleEntityNotFound(_0x5db204,null))['then'](respondWithResult(_0x5db204,null))[_0x2499('0x3d')](handleError(_0x5db204,null));};exports[_0x2499('0x44')]=function(_0x5c2403,_0x524110){return db[_0x2499('0x29')][_0x2499('0x44')](_0x5c2403[_0x2499('0x45')],{})[_0x2499('0x23')](respondWithResult(_0x524110,0xc9))[_0x2499('0x3d')](handleError(_0x524110,null));};exports[_0x2499('0x22')]=function(_0xb477fa,_0x38664f){if(_0xb477fa[_0x2499('0x45')]['id']){delete _0xb477fa[_0x2499('0x45')]['id'];}return db['SugarcrmAccount'][_0x2499('0x43')]({'where':{'id':_0xb477fa[_0x2499('0x3f')]['id']}})[_0x2499('0x23')](handleEntityNotFound(_0x38664f,null))[_0x2499('0x23')](saveUpdates(_0xb477fa['body'],null))['then'](respondWithResult(_0x38664f,null))['catch'](handleError(_0x38664f,null));};exports[_0x2499('0x46')]=function(_0xe34b34,_0x19a92d){return db[_0x2499('0x29')][_0x2499('0x43')]({'where':{'id':_0xe34b34[_0x2499('0x3f')]['id']}})[_0x2499('0x23')](handleEntityNotFound(_0x19a92d,null))[_0x2499('0x23')](removeEntity(_0x19a92d,null))[_0x2499('0x3d')](handleError(_0x19a92d,null));};exports[_0x2499('0x47')]=function(_0x2e2f76,_0x1e1e93,_0x5bf0b6){var _0xba0e3a={};var _0x3e80a2={};var _0x9b750b;var _0x93f865;return db[_0x2499('0x29')]['findOne']({'where':{'id':_0x2e2f76['params']['id']}})[_0x2499('0x23')](handleEntityNotFound(_0x1e1e93,null))['then'](function(_0x4ec9e3){if(_0x4ec9e3){_0x9b750b=_0x4ec9e3;_0x3e80a2[_0x2499('0x2d')]=_[_0x2499('0x2f')](db[_0x2499('0x48')]['rawAttributes']);_0x3e80a2[_0x2499('0x2e')]=_[_0x2499('0x2f')](_0x2e2f76['query']);_0x3e80a2[_0x2499('0x30')]=_['intersection'](_0x3e80a2[_0x2499('0x2d')],_0x3e80a2[_0x2499('0x2e')]);_0xba0e3a[_0x2499('0x32')]=_[_0x2499('0x31')](_0x3e80a2[_0x2499('0x2d')],qs[_0x2499('0x33')](_0x2e2f76[_0x2499('0x2e')][_0x2499('0x33')]));_0xba0e3a[_0x2499('0x32')]=_0xba0e3a[_0x2499('0x32')][_0x2499('0x41')]?_0xba0e3a[_0x2499('0x32')]:_0x3e80a2[_0x2499('0x2d')];_0xba0e3a['order']=qs[_0x2499('0x49')](_0x2e2f76[_0x2499('0x2e')]['sort']);_0xba0e3a[_0x2499('0x37')]=qs[_0x2499('0x30')](_['pick'](_0x2e2f76['query'],_0x3e80a2[_0x2499('0x30')]));if(_0x2e2f76[_0x2499('0x2e')][_0x2499('0x36')]){_0xba0e3a[_0x2499('0x37')]=_[_0x2499('0x38')](_0xba0e3a[_0x2499('0x37')],{'$or':_[_0x2499('0x28')](_0xba0e3a[_0x2499('0x32')],function(_0x51ad55){var _0x177af2={};_0x177af2[_0x51ad55]={'$like':'%'+_0x2e2f76[_0x2499('0x2e')][_0x2499('0x36')]+'%'};return _0x177af2;})});}_0xba0e3a=_[_0x2499('0x38')]({},_0xba0e3a,_0x2e2f76[_0x2499('0x39')]);return _0x9b750b['getConfigurations'](_0xba0e3a);}})[_0x2499('0x23')](function(_0x304e13){if(_0x304e13){_0x93f865=_0x304e13[_0x2499('0x41')];if(!_0x2e2f76[_0x2499('0x2e')][_0x2499('0x34')]('nolimit')){_0xba0e3a[_0x2499('0x1c')]=qs[_0x2499('0x1c')](_0x2e2f76[_0x2499('0x2e')][_0x2499('0x1c')]);_0xba0e3a[_0x2499('0x1a')]=qs[_0x2499('0x1a')](_0x2e2f76[_0x2499('0x2e')][_0x2499('0x1a')]);}return _0x9b750b['getConfigurations'](_0xba0e3a);}})[_0x2499('0x23')](function(_0xf38693){if(_0xf38693){return _0xf38693?{'count':_0x93f865,'rows':_0xf38693}:null;}})[_0x2499('0x23')](respondWithResult(_0x1e1e93,null))[_0x2499('0x3d')](handleError(_0x1e1e93,null));};exports[_0x2499('0x4a')]=function(_0x1e7f82,_0x206382,_0x4e6ce3){if(_0x1e7f82['body']['id']){delete _0x1e7f82[_0x2499('0x45')]['id'];}return db[_0x2499('0x29')][_0x2499('0x4b')]({'where':{'id':_0x1e7f82['params']['id']}})[_0x2499('0x23')](handleEntityNotFound(_0x206382,null))[_0x2499('0x23')](function(_0x1cd6fe){if(_0x1cd6fe){_0x1e7f82[_0x2499('0x45')]['AccountId']=_0x1cd6fe['id'];_0x1e7f82['body']['Subjects']=integrations[_0x2499('0x4c')](_0x1e7f82[_0x2499('0x45')][_0x2499('0x4d')],_0x1e7f82[_0x2499('0x45')][_0x2499('0x2b')]);_0x1e7f82[_0x2499('0x45')][_0x2499('0x4e')]=integrations['getDescriptions'](_0x1e7f82[_0x2499('0x45')][_0x2499('0x4d')],_0x1e7f82[_0x2499('0x45')][_0x2499('0x2b')]);return db[_0x2499('0x48')]['create'](_0x1e7f82[_0x2499('0x45')],{'include':[{'model':db[_0x2499('0x4f')],'as':_0x2499('0x50')},{'model':db[_0x2499('0x4f')],'as':_0x2499('0x4e')}]});}return null;})[_0x2499('0x23')](respondWithResult(_0x206382,null))[_0x2499('0x3d')](handleError(_0x206382,null));};exports[_0x2499('0x51')]=function(_0x5e1ef9,_0x1acd55,_0x243279){var _0xc94cb4='';var _0x19ec34=['id',_0x2499('0x25'),'assigned_user_id',_0x2499('0x52'),_0x2499('0x53'),_0x2499('0x54'),'duration_hours',_0x2499('0x55'),_0x2499('0x56'),_0x2499('0x57'),_0x2499('0x58'),_0x2499('0x59')];return db[_0x2499('0x29')][_0x2499('0x4b')]({'where':{'id':_0x5e1ef9[_0x2499('0x3f')]['id']},'attributes':['id','username','password',_0x2499('0x5a')]})[_0x2499('0x23')](handleEntityNotFound(_0x1acd55,null))[_0x2499('0x23')](function(_0x1081ba){if(_0x1081ba){_0xc94cb4=_0x1081ba[_0x2499('0x5a')];var _0x59773d=_0xc94cb4[_0x2499('0x5b')](-0x1);if(_0x59773d==='/'){_0xc94cb4=_0xc94cb4[_0x2499('0x5c')](0x0,_0xc94cb4[_0x2499('0x5d')](_0x59773d));}return rp({'method':_0x2499('0x5e'),'uri':util[_0x2499('0x5f')](_0x2499('0x60'),_0xc94cb4,_0x2499('0x61')),'json':!![],'form':{'method':_0x2499('0x62'),'input_type':_0x2499('0x63'),'response_type':_0x2499('0x63'),'rest_data':JSON[_0x2499('0x64')]({'user_auth':{'user_name':_0x1081ba[_0x2499('0x65')],'password':_0x1081ba[_0x2499('0x66')],'encryption':_0x2499('0x67')},'application':_0x2499('0x68')})}});}})[_0x2499('0x23')](function(_0x2b5efa){if(_0x2b5efa&&_0x2b5efa[_0x2499('0x25')]!==_0x2499('0x69')&&_0x2b5efa['name']!==_0x2499('0x6a')){return rp({'method':_0x2499('0x5e'),'uri':util[_0x2499('0x5f')](_0x2499('0x60'),_0xc94cb4,_0x2499('0x61')),'json':!![],'form':{'method':_0x2499('0x6b'),'input_type':_0x2499('0x63'),'response_type':_0x2499('0x63'),'rest_data':JSON['stringify']({'session':_0x2b5efa['id'],'module_name':_0x2499('0x6c')})}})[_0x2499('0x23')](function(_0x2092a5){if(_0x2092a5){var _0x29ab28=_[_0x2499('0x6d')](_0x2092a5[_0x2499('0x6e')]);_[_0x2499('0x6f')](_0x29ab28,function(_0x1e5848){return _0x19ec34['includes'](_0x1e5848['name']);});return{'count':_0x29ab28[_0x2499('0x41')],'rows':_[_0x2499('0x28')](_0x29ab28,function(_0x1b9d42){return{'id':_0x1b9d42[_0x2499('0x25')],'name':_0x1b9d42[_0x2499('0x70')],'custom':_[_0x2499('0x71')](_0x1b9d42['name'],'_c')?!![]:![],'options':_0x1b9d42['options']?_[_0x2499('0x28')](_[_0x2499('0x6d')](_0x1b9d42[_0x2499('0x39')]),function(_0x2994db){return{'name':_0x2994db[_0x2499('0x72')],'value':_0x2994db[_0x2499('0x25')]};}):[]};})};}})['then'](respondWithResult(_0x1acd55,null))[_0x2499('0x3d')](function(_0x2239fa){var _0xe71ad0=_0x5e1ef9[_0x2499('0x2e')][_0x2499('0x73')]?0x1f4:_0x2239fa['statusCode']||0x1f4;logger['error'](_0x2499('0x74'),_0x2499('0x51'),_0xe71ad0,JSON[_0x2499('0x64')](_0x2239fa));delete _0x2239fa[_0x2499('0x25')];if(_0xe71ad0===0x191){_0xe71ad0=0x190;}_0x1acd55[_0x2499('0x19')](_0xe71ad0)[_0x2499('0x26')](_0x5e1ef9[_0x2499('0x2e')][_0x2499('0x73')]?{'message':_0x2499('0x75'),'statusCode':_0x2239fa[_0x2499('0x76')]}:_0x2239fa);});}else{var _0x23bc16=0x1f4;_0x1acd55[_0x2499('0x19')](_0x23bc16)[_0x2499('0x26')]({'message':_0x2499('0x75'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x8e2a=['api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','SugarcrmField','Descriptions','created_by','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','includes','label','endsWith','value','statusCode','getFields','test','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2621c5,_0x2361c0){var _0x5066cf=function(_0x340c36){while(--_0x340c36){_0x2621c5['push'](_0x2621c5['shift']());}};_0x5066cf(++_0x2361c0);}(_0x8e2a,0x1b6));var _0xa8e2=function(_0xa33f22,_0x503cc1){_0xa33f22=_0xa33f22-0x0;var _0x4a5f8c=_0x8e2a[_0xa33f22];return _0x4a5f8c;};'use strict';var emlformat=require(_0xa8e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8e2('0x2'));var moment=require(_0xa8e2('0x3'));var BPromise=require(_0xa8e2('0x4'));var Mustache=require('mustache');var util=require(_0xa8e2('0x5'));var path=require(_0xa8e2('0x6'));var sox=require(_0xa8e2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8e2('0x8'));var _=require(_0xa8e2('0x9'));var squel=require('squel');var crypto=require(_0xa8e2('0xa'));var jsforce=require(_0xa8e2('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8e2('0xc'));var Papa=require(_0xa8e2('0xd'));var Redis=require('ioredis');var authService=require(_0xa8e2('0xe'));var qs=require(_0xa8e2('0xf'));var as=require(_0xa8e2('0x10'));var hardwareService=require(_0xa8e2('0x11'));var logger=require('../../config/logger')(_0xa8e2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa8e2('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa8e2('0x14'));function respondWithStatusCode(_0x2a2bdc,_0x298973){_0x298973=_0x298973||0xcc;return function(_0x5c873f){if(_0x5c873f){return _0x2a2bdc[_0xa8e2('0x15')](_0x298973);}return _0x2a2bdc[_0xa8e2('0x16')](_0x298973)[_0xa8e2('0x17')]();};}function respondWithResult(_0x10d7a2,_0x653bff){_0x653bff=_0x653bff||0xc8;return function(_0xd1de95){if(_0xd1de95){return _0x10d7a2['status'](_0x653bff)[_0xa8e2('0x18')](_0xd1de95);}};}function respondWithFilteredResult(_0x860e90,_0x214ab8){return function(_0x2e2bf0){if(_0x2e2bf0){var _0x4c9382=typeof _0x214ab8[_0xa8e2('0x19')]===_0xa8e2('0x1a')&&typeof _0x214ab8['limit']===_0xa8e2('0x1a');var _0x433bd5=_0x2e2bf0['count'];var _0x268d3a=_0x4c9382?0x0:_0x214ab8[_0xa8e2('0x19')];var _0xd3a49c=_0x4c9382?_0x2e2bf0[_0xa8e2('0x1b')]:_0x214ab8['offset']+_0x214ab8[_0xa8e2('0x1c')];var _0x5250e7;if(_0xd3a49c>=_0x433bd5){_0xd3a49c=_0x433bd5;_0x5250e7=0xc8;}else{_0x5250e7=0xce;}_0x860e90[_0xa8e2('0x16')](_0x5250e7);return _0x860e90[_0xa8e2('0x1d')](_0xa8e2('0x1e'),_0x268d3a+'-'+_0xd3a49c+'/'+_0x433bd5)[_0xa8e2('0x18')](_0x2e2bf0);}return null;};}function patchUpdates(_0x12c032){return function(_0x191e8f){try{jsonpatch['apply'](_0x191e8f,_0x12c032,!![]);}catch(_0x590c5e){return BPromise[_0xa8e2('0x1f')](_0x590c5e);}return _0x191e8f[_0xa8e2('0x20')]();};}function saveUpdates(_0x38d01c,_0x4bb624){return function(_0x4cb5a1){if(_0x4cb5a1){return _0x4cb5a1[_0xa8e2('0x21')](_0x38d01c)[_0xa8e2('0x22')](function(_0x25a3b5){return _0x25a3b5;});}return null;};}function removeEntity(_0x2e8a1f,_0x4ae262){return function(_0x5dd44c){if(_0x5dd44c){return _0x5dd44c[_0xa8e2('0x23')]()['then'](function(){_0x2e8a1f[_0xa8e2('0x16')](0xcc)[_0xa8e2('0x17')]();});}};}function handleEntityNotFound(_0x3025cd,_0x5c04b4){return function(_0x656901){if(!_0x656901){_0x3025cd[_0xa8e2('0x15')](0x194);}return _0x656901;};}function handleError(_0x56ba5e,_0x361275){_0x361275=_0x361275||0x1f4;return function(_0x27020f){logger[_0xa8e2('0x24')](_0x27020f[_0xa8e2('0x25')]);if(_0x27020f[_0xa8e2('0x26')]){delete _0x27020f[_0xa8e2('0x26')];}_0x56ba5e[_0xa8e2('0x16')](_0x361275)[_0xa8e2('0x27')](_0x27020f);};}exports[_0xa8e2('0x28')]=function(_0x47c028,_0x57508d){var _0xc06a04={},_0x55f319={},_0x3eecb6={'count':0x0,'rows':[]};var _0x589941=_['map'](db[_0xa8e2('0x29')][_0xa8e2('0x2a')],function(_0x2e7ad9){return{'name':_0x2e7ad9[_0xa8e2('0x2b')],'type':_0x2e7ad9[_0xa8e2('0x2c')][_0xa8e2('0x2d')]};});_0x55f319[_0xa8e2('0x2e')]=_[_0xa8e2('0x2f')](_0x589941,'name');_0x55f319[_0xa8e2('0x30')]=_[_0xa8e2('0x31')](_0x47c028[_0xa8e2('0x30')]);_0x55f319[_0xa8e2('0x32')]=_[_0xa8e2('0x33')](_0x55f319[_0xa8e2('0x2e')],_0x55f319[_0xa8e2('0x30')]);_0xc06a04[_0xa8e2('0x34')]=_['intersection'](_0x55f319[_0xa8e2('0x2e')],qs[_0xa8e2('0x35')](_0x47c028[_0xa8e2('0x30')][_0xa8e2('0x35')]));_0xc06a04[_0xa8e2('0x34')]=_0xc06a04[_0xa8e2('0x34')][_0xa8e2('0x36')]?_0xc06a04[_0xa8e2('0x34')]:_0x55f319[_0xa8e2('0x2e')];if(!_0x47c028[_0xa8e2('0x30')]['hasOwnProperty'](_0xa8e2('0x37'))){_0xc06a04[_0xa8e2('0x1c')]=qs[_0xa8e2('0x1c')](_0x47c028['query'][_0xa8e2('0x1c')]);_0xc06a04[_0xa8e2('0x19')]=qs['offset'](_0x47c028[_0xa8e2('0x30')][_0xa8e2('0x19')]);}_0xc06a04['order']=qs['sort'](_0x47c028[_0xa8e2('0x30')][_0xa8e2('0x38')]);_0xc06a04[_0xa8e2('0x39')]=qs[_0xa8e2('0x32')](_[_0xa8e2('0x3a')](_0x47c028['query'],_0x55f319[_0xa8e2('0x32')]),_0x589941);if(_0x47c028[_0xa8e2('0x30')][_0xa8e2('0x3b')]){_0xc06a04[_0xa8e2('0x39')]=_[_0xa8e2('0x3c')](_0xc06a04[_0xa8e2('0x39')],{'$or':_[_0xa8e2('0x2f')](_0x589941,function(_0x27175c){if(_0x27175c['type']!==_0xa8e2('0x3d')){var _0x4538f5={};_0x4538f5[_0x27175c[_0xa8e2('0x26')]]={'$like':'%'+_0x47c028['query'][_0xa8e2('0x3b')]+'%'};return _0x4538f5;}})});}_0xc06a04=_[_0xa8e2('0x3c')]({},_0xc06a04,_0x47c028[_0xa8e2('0x3e')]);var _0x4424af={'where':_0xc06a04[_0xa8e2('0x39')]};return db[_0xa8e2('0x29')]['count'](_0x4424af)[_0xa8e2('0x22')](function(_0x52fb5d){_0x3eecb6['count']=_0x52fb5d;if(_0x47c028[_0xa8e2('0x30')][_0xa8e2('0x3f')]){_0xc06a04[_0xa8e2('0x40')]=[{'all':!![]}];}return db[_0xa8e2('0x29')][_0xa8e2('0x41')](_0xc06a04);})[_0xa8e2('0x22')](function(_0x545460){_0x3eecb6[_0xa8e2('0x42')]=_0x545460;return _0x3eecb6;})[_0xa8e2('0x22')](respondWithFilteredResult(_0x57508d,_0xc06a04))['catch'](handleError(_0x57508d,null));};exports['show']=function(_0x1a0bb5,_0x4b4147){var _0x56a37c={'raw':![],'where':{'id':_0x1a0bb5[_0xa8e2('0x43')]['id']}},_0x546573={};_0x546573[_0xa8e2('0x2e')]=_['keys'](db['SugarcrmAccount'][_0xa8e2('0x2a')]);_0x546573[_0xa8e2('0x30')]=_[_0xa8e2('0x31')](_0x1a0bb5[_0xa8e2('0x30')]);_0x546573[_0xa8e2('0x32')]=_[_0xa8e2('0x33')](_0x546573['model'],_0x546573[_0xa8e2('0x30')]);_0x56a37c['attributes']=_[_0xa8e2('0x33')](_0x546573[_0xa8e2('0x2e')],qs[_0xa8e2('0x35')](_0x1a0bb5[_0xa8e2('0x30')][_0xa8e2('0x35')]));_0x56a37c[_0xa8e2('0x34')]=_0x56a37c[_0xa8e2('0x34')]['length']?_0x56a37c['attributes']:_0x546573[_0xa8e2('0x2e')];if(_0x1a0bb5[_0xa8e2('0x30')][_0xa8e2('0x3f')]){_0x56a37c[_0xa8e2('0x40')]=[{'all':!![]}];}_0x56a37c=_[_0xa8e2('0x3c')]({},_0x56a37c,_0x1a0bb5['options']);return db[_0xa8e2('0x29')][_0xa8e2('0x44')](_0x56a37c)[_0xa8e2('0x22')](handleEntityNotFound(_0x4b4147,null))[_0xa8e2('0x22')](respondWithResult(_0x4b4147,null))[_0xa8e2('0x45')](handleError(_0x4b4147,null));};exports[_0xa8e2('0x46')]=function(_0x2aa926,_0x2b1563){return db['SugarcrmAccount'][_0xa8e2('0x46')](_0x2aa926[_0xa8e2('0x47')],{})[_0xa8e2('0x22')](respondWithResult(_0x2b1563,0xc9))[_0xa8e2('0x45')](handleError(_0x2b1563,null));};exports['update']=function(_0x344d21,_0x3bb573){if(_0x344d21[_0xa8e2('0x47')]['id']){delete _0x344d21[_0xa8e2('0x47')]['id'];}return db[_0xa8e2('0x29')][_0xa8e2('0x44')]({'where':{'id':_0x344d21[_0xa8e2('0x43')]['id']}})[_0xa8e2('0x22')](handleEntityNotFound(_0x3bb573,null))[_0xa8e2('0x22')](saveUpdates(_0x344d21[_0xa8e2('0x47')],null))[_0xa8e2('0x22')](respondWithResult(_0x3bb573,null))[_0xa8e2('0x45')](handleError(_0x3bb573,null));};exports[_0xa8e2('0x23')]=function(_0x189345,_0x5a0108){return db[_0xa8e2('0x29')]['find']({'where':{'id':_0x189345['params']['id']}})['then'](handleEntityNotFound(_0x5a0108,null))[_0xa8e2('0x22')](removeEntity(_0x5a0108,null))[_0xa8e2('0x45')](handleError(_0x5a0108,null));};exports[_0xa8e2('0x48')]=function(_0x14a9a8,_0x4688a8,_0xf8a42a){var _0x3ed72a={};var _0x317aff={};var _0x588abe;var _0x26ed75;return db[_0xa8e2('0x29')][_0xa8e2('0x49')]({'where':{'id':_0x14a9a8['params']['id']}})[_0xa8e2('0x22')](handleEntityNotFound(_0x4688a8,null))[_0xa8e2('0x22')](function(_0x3d9363){if(_0x3d9363){_0x588abe=_0x3d9363;_0x317aff[_0xa8e2('0x2e')]=_[_0xa8e2('0x31')](db[_0xa8e2('0x4a')]['rawAttributes']);_0x317aff['query']=_[_0xa8e2('0x31')](_0x14a9a8['query']);_0x317aff[_0xa8e2('0x32')]=_[_0xa8e2('0x33')](_0x317aff[_0xa8e2('0x2e')],_0x317aff['query']);_0x3ed72a[_0xa8e2('0x34')]=_[_0xa8e2('0x33')](_0x317aff[_0xa8e2('0x2e')],qs[_0xa8e2('0x35')](_0x14a9a8[_0xa8e2('0x30')][_0xa8e2('0x35')]));_0x3ed72a[_0xa8e2('0x34')]=_0x3ed72a[_0xa8e2('0x34')][_0xa8e2('0x36')]?_0x3ed72a['attributes']:_0x317aff[_0xa8e2('0x2e')];_0x3ed72a[_0xa8e2('0x4b')]=qs['sort'](_0x14a9a8['query'][_0xa8e2('0x38')]);_0x3ed72a['where']=qs['filters'](_['pick'](_0x14a9a8[_0xa8e2('0x30')],_0x317aff['filters']));if(_0x14a9a8[_0xa8e2('0x30')][_0xa8e2('0x3b')]){_0x3ed72a[_0xa8e2('0x39')]=_['merge'](_0x3ed72a[_0xa8e2('0x39')],{'$or':_[_0xa8e2('0x2f')](_0x3ed72a[_0xa8e2('0x34')],function(_0x55095d){var _0x4ef8f6={};_0x4ef8f6[_0x55095d]={'$like':'%'+_0x14a9a8['query'][_0xa8e2('0x3b')]+'%'};return _0x4ef8f6;})});}_0x3ed72a=_['merge']({},_0x3ed72a,_0x14a9a8[_0xa8e2('0x3e')]);return _0x588abe[_0xa8e2('0x48')](_0x3ed72a);}})[_0xa8e2('0x22')](function(_0x482879){if(_0x482879){_0x26ed75=_0x482879['length'];if(!_0x14a9a8[_0xa8e2('0x30')][_0xa8e2('0x4c')]('nolimit')){_0x3ed72a[_0xa8e2('0x1c')]=qs['limit'](_0x14a9a8[_0xa8e2('0x30')]['limit']);_0x3ed72a[_0xa8e2('0x19')]=qs[_0xa8e2('0x19')](_0x14a9a8['query'][_0xa8e2('0x19')]);}return _0x588abe['getConfigurations'](_0x3ed72a);}})[_0xa8e2('0x22')](function(_0x19dee8){if(_0x19dee8){return _0x19dee8?{'count':_0x26ed75,'rows':_0x19dee8}:null;}})[_0xa8e2('0x22')](respondWithResult(_0x4688a8,null))['catch'](handleError(_0x4688a8,null));};exports[_0xa8e2('0x4d')]=function(_0x4cfa83,_0x333cf2,_0x113f08){if(_0x4cfa83[_0xa8e2('0x47')]['id']){delete _0x4cfa83[_0xa8e2('0x47')]['id'];}return db[_0xa8e2('0x29')][_0xa8e2('0x49')]({'where':{'id':_0x4cfa83['params']['id']}})[_0xa8e2('0x22')](handleEntityNotFound(_0x333cf2,null))[_0xa8e2('0x22')](function(_0x1ba2e4){if(_0x1ba2e4){_0x4cfa83[_0xa8e2('0x47')][_0xa8e2('0x4e')]=_0x1ba2e4['id'];_0x4cfa83[_0xa8e2('0x47')]['Subjects']=integrations[_0xa8e2('0x4f')](_0x4cfa83[_0xa8e2('0x47')]['channel'],_0x4cfa83[_0xa8e2('0x47')][_0xa8e2('0x2c')]);_0x4cfa83['body']['Descriptions']=integrations['getDescriptions'](_0x4cfa83[_0xa8e2('0x47')][_0xa8e2('0x50')],_0x4cfa83[_0xa8e2('0x47')][_0xa8e2('0x2c')]);return db['SugarcrmConfiguration'][_0xa8e2('0x46')](_0x4cfa83['body'],{'include':[{'model':db[_0xa8e2('0x51')],'as':'Subjects'},{'model':db[_0xa8e2('0x51')],'as':_0xa8e2('0x52')}]});}return null;})[_0xa8e2('0x22')](respondWithResult(_0x333cf2,null))[_0xa8e2('0x45')](handleError(_0x333cf2,null));};exports['getFields']=function(_0xd716b,_0x44a5ed,_0x5a962b){var _0xd6090d='';var _0xb8a445=['id',_0xa8e2('0x26'),'assigned_user_id',_0xa8e2('0x53'),'description',_0xa8e2('0x54'),_0xa8e2('0x55'),_0xa8e2('0x56'),_0xa8e2('0x57'),'parent_type','parent_name',_0xa8e2('0x58')];return db[_0xa8e2('0x29')][_0xa8e2('0x49')]({'where':{'id':_0xd716b[_0xa8e2('0x43')]['id']},'attributes':['id',_0xa8e2('0x59'),_0xa8e2('0x5a'),_0xa8e2('0x5b')]})[_0xa8e2('0x22')](handleEntityNotFound(_0x44a5ed,null))['then'](function(_0x5f135b){if(_0x5f135b){_0xd6090d=_0x5f135b[_0xa8e2('0x5b')];var _0x45c845=_0xd6090d['slice'](-0x1);if(_0x45c845==='/'){_0xd6090d=_0xd6090d[_0xa8e2('0x5c')](0x0,_0xd6090d['lastIndexOf'](_0x45c845));}return rp({'method':_0xa8e2('0x5d'),'uri':util[_0xa8e2('0x5e')](_0xa8e2('0x5f'),_0xd6090d,_0xa8e2('0x60')),'json':!![],'form':{'method':_0xa8e2('0x61'),'input_type':_0xa8e2('0x62'),'response_type':_0xa8e2('0x62'),'rest_data':JSON[_0xa8e2('0x63')]({'user_auth':{'user_name':_0x5f135b[_0xa8e2('0x59')],'password':_0x5f135b[_0xa8e2('0x5a')],'encryption':'PLAIN'},'application':_0xa8e2('0x64')})}});}})[_0xa8e2('0x22')](function(_0x442ed2){if(_0x442ed2&&_0x442ed2[_0xa8e2('0x26')]!==_0xa8e2('0x65')&&_0x442ed2[_0xa8e2('0x26')]!==_0xa8e2('0x66')){return rp({'method':'POST','uri':util['format'](_0xa8e2('0x5f'),_0xd6090d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xa8e2('0x62'),'response_type':_0xa8e2('0x62'),'rest_data':JSON['stringify']({'session':_0x442ed2['id'],'module_name':_0xa8e2('0x67')})}})['then'](function(_0x4d499e){if(_0x4d499e){var _0x5c2ec1=_[_0xa8e2('0x68')](_0x4d499e[_0xa8e2('0x69')]);_['remove'](_0x5c2ec1,function(_0xa59e85){return _0xb8a445[_0xa8e2('0x6a')](_0xa59e85[_0xa8e2('0x26')]);});return{'count':_0x5c2ec1[_0xa8e2('0x36')],'rows':_[_0xa8e2('0x2f')](_0x5c2ec1,function(_0x1985d2){return{'id':_0x1985d2[_0xa8e2('0x26')],'name':_0x1985d2[_0xa8e2('0x6b')],'custom':_[_0xa8e2('0x6c')](_0x1985d2[_0xa8e2('0x26')],'_c')?!![]:![],'options':_0x1985d2[_0xa8e2('0x3e')]?_[_0xa8e2('0x2f')](_[_0xa8e2('0x68')](_0x1985d2[_0xa8e2('0x3e')]),function(_0x19dc2e){return{'name':_0x19dc2e[_0xa8e2('0x6d')],'value':_0x19dc2e[_0xa8e2('0x26')]};}):[]};})};}})[_0xa8e2('0x22')](respondWithResult(_0x44a5ed,null))[_0xa8e2('0x45')](function(_0x4a961c){var _0x426eae=_0xd716b['query']['test']?0x1f4:_0x4a961c[_0xa8e2('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xa8e2('0x6f'),_0x426eae,JSON[_0xa8e2('0x63')](_0x4a961c));delete _0x4a961c[_0xa8e2('0x26')];if(_0x426eae===0x191){_0x426eae=0x190;}_0x44a5ed[_0xa8e2('0x16')](_0x426eae)[_0xa8e2('0x27')](_0xd716b[_0xa8e2('0x30')][_0xa8e2('0x70')]?{'message':_0xa8e2('0x71'),'statusCode':_0x4a961c[_0xa8e2('0x6e')]}:_0x4a961c);});}else{var _0x43f133=0x1f4;_0x44a5ed['status'](_0x43f133)[_0xa8e2('0x27')]({'message':_0xa8e2('0x71'),'statusCode':0x190});}});};
\ No newline at end of file
index fb232f1..04883fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70b=['rimraf','exports','define','int_sugarcrm_accounts','util','moment','bluebird','request-promise','path'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0xf70b,0xe5));var _0xbf70=function(_0x56b45a,_0x469f91){_0x56b45a=_0x56b45a-0x0;var _0x1f0800=_0xf70b[_0x56b45a];return _0x1f0800;};'use strict';var _=require('lodash');var util=require(_0xbf70('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbf70('0x1'));var BPromise=require(_0xbf70('0x2'));var rp=require(_0xbf70('0x3'));var fs=require('fs');var path=require(_0xbf70('0x4'));var rimraf=require(_0xbf70('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xbf70('0x6')]=function(_0x7c920b,_0x432294){return _0x7c920b[_0xbf70('0x7')]('SugarcrmAccount',attributes,{'tableName':_0xbf70('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72d7=['bluebird','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4c389c,_0x20e533){var _0x375bd2=function(_0xaa2e4c){while(--_0xaa2e4c){_0x4c389c['push'](_0x4c389c['shift']());}};_0x375bd2(++_0x20e533);}(_0x72d7,0x19b));var _0x772d=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x72d7[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x772d('0x0'));var util=require(_0x772d('0x1'));var logger=require(_0x772d('0x2'))(_0x772d('0x3'));var moment=require(_0x772d('0x4'));var BPromise=require(_0x772d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x772d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x772d('0x7'));var integrations=require(_0x772d('0x8'));module[_0x772d('0x9')]=function(_0x527450,_0x1b5bc4){return _0x527450[_0x772d('0xa')](_0x772d('0xb'),attributes,{'tableName':_0x772d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8c01a8..83ba088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea16=['catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','map','attributes','model','find','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xea16,0x1b2));var _0x6ea1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xea16[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x6ea1('0x0'));var util=require('util');var moment=require(_0x6ea1('0x1'));var BPromise=require(_0x6ea1('0x2'));var rs=require(_0x6ea1('0x3'));var fs=require('fs');var Redis=require(_0x6ea1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ea1('0x5'));var logger=require(_0x6ea1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6ea1('0x7'));var client=jayson[_0x6ea1('0x8')][_0x6ea1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42fe83,_0xa67771,_0xa4b8d1){return new BPromise(function(_0xe2e222,_0x228d98){return client['request'](_0x42fe83,_0xa4b8d1)[_0x6ea1('0xa')](function(_0x456799){logger[_0x6ea1('0xb')](_0x6ea1('0xc'),_0xa67771,_0x6ea1('0xd'));logger[_0x6ea1('0xe')](_0x6ea1('0xf'),_0xa67771,_0x6ea1('0xd'),JSON[_0x6ea1('0x10')](_0x456799));if(_0x456799[_0x6ea1('0x11')]){if(_0x456799[_0x6ea1('0x11')][_0x6ea1('0x12')]===0x1f4){logger[_0x6ea1('0x11')](_0x6ea1('0xc'),_0xa67771,_0x456799[_0x6ea1('0x11')][_0x6ea1('0x13')]);return _0x228d98(_0x456799['error']['message']);}logger['error'](_0x6ea1('0xc'),_0xa67771,_0x456799[_0x6ea1('0x11')][_0x6ea1('0x13')]);return _0xe2e222(_0x456799['error'][_0x6ea1('0x13')]);}else{logger[_0x6ea1('0xb')](_0x6ea1('0xc'),_0xa67771,'request\x20sent');_0xe2e222(_0x456799[_0x6ea1('0x14')]['message']);}})[_0x6ea1('0x15')](function(_0xb22b9f){logger[_0x6ea1('0x11')](_0x6ea1('0xc'),_0xa67771,_0xb22b9f);_0x228d98(_0xb22b9f);});});}exports[_0x6ea1('0x16')]=function(_0x100450){var _0x43c695=this;return new Promise(function(_0x304981,_0x428f73){return db[_0x6ea1('0x17')][_0x6ea1('0x18')]({'raw':_0x100450[_0x6ea1('0x19')]?_0x100450['options'][_0x6ea1('0x1a')]===undefined?!![]:![]:!![],'where':_0x100450[_0x6ea1('0x19')]?_0x100450[_0x6ea1('0x19')][_0x6ea1('0x1b')]||null:null,'attributes':_0x100450['options']?_0x100450[_0x6ea1('0x19')]['attributes']||null:null,'limit':_0x100450[_0x6ea1('0x19')]?_0x100450['options'][_0x6ea1('0x1c')]||null:null,'include':_0x100450['options']?_0x100450['options'][_0x6ea1('0x1d')]?_[_0x6ea1('0x1e')](_0x100450[_0x6ea1('0x19')][_0x6ea1('0x1d')],function(_0x4bb004){return{'model':db[_0x4bb004['model']],'as':_0x4bb004['as'],'attributes':_0x4bb004[_0x6ea1('0x1f')],'include':_0x4bb004[_0x6ea1('0x1d')]?_[_0x6ea1('0x1e')](_0x4bb004[_0x6ea1('0x1d')],function(_0x8bc2d9){return{'model':db[_0x8bc2d9[_0x6ea1('0x20')]],'as':_0x8bc2d9['as'],'attributes':_0x8bc2d9[_0x6ea1('0x1f')],'include':_0x8bc2d9[_0x6ea1('0x1d')]?_['map'](_0x8bc2d9[_0x6ea1('0x1d')],function(_0x470454){return{'model':db[_0x470454[_0x6ea1('0x20')]],'as':_0x470454['as'],'attributes':_0x470454[_0x6ea1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x497437){logger[_0x6ea1('0xb')]('GetSugarcrmAccount',_0x100450);logger[_0x6ea1('0xe')](_0x6ea1('0x16'),_0x100450,JSON['stringify'](_0x497437));_0x304981(_0x497437);})[_0x6ea1('0x15')](function(_0x4fe343){logger[_0x6ea1('0x11')](_0x6ea1('0x16'),_0x4fe343[_0x6ea1('0x13')],_0x100450);_0x428f73(_0x43c695[_0x6ea1('0x11')](0x1f4,_0x4fe343[_0x6ea1('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x5391c2){var _0x4b8736=this;return new Promise(function(_0x20f3cc,_0x288500){return db['SugarcrmAccount'][_0x6ea1('0x21')]({'raw':_0x5391c2[_0x6ea1('0x19')]?_0x5391c2['options'][_0x6ea1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5391c2['options']?_0x5391c2['options'][_0x6ea1('0x1b')]||null:null,'attributes':_0x5391c2['options']?_0x5391c2[_0x6ea1('0x19')][_0x6ea1('0x1f')]||null:null,'include':_0x5391c2[_0x6ea1('0x19')]?_0x5391c2[_0x6ea1('0x19')][_0x6ea1('0x1d')]?_[_0x6ea1('0x1e')](_0x5391c2[_0x6ea1('0x19')][_0x6ea1('0x1d')],function(_0x3715cb){return{'model':db[_0x3715cb[_0x6ea1('0x20')]],'as':_0x3715cb['as'],'attributes':_0x3715cb['attributes'],'include':_0x3715cb[_0x6ea1('0x1d')]?_[_0x6ea1('0x1e')](_0x3715cb[_0x6ea1('0x1d')],function(_0x3190e2){return{'model':db[_0x3190e2['model']],'as':_0x3190e2['as'],'attributes':_0x3190e2[_0x6ea1('0x1f')],'include':_0x3190e2[_0x6ea1('0x1d')]?_[_0x6ea1('0x1e')](_0x3190e2[_0x6ea1('0x1d')],function(_0x3b49de){return{'model':db[_0x3b49de[_0x6ea1('0x20')]],'as':_0x3b49de['as'],'attributes':_0x3b49de[_0x6ea1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x361c0f){logger[_0x6ea1('0xb')](_0x6ea1('0x22'),_0x5391c2);logger[_0x6ea1('0xe')](_0x6ea1('0x22'),_0x5391c2,JSON[_0x6ea1('0x10')](_0x361c0f));_0x20f3cc(_0x361c0f);})[_0x6ea1('0x15')](function(_0x55c9d6){logger[_0x6ea1('0x11')]('ShowSugarcrmAccount',_0x55c9d6[_0x6ea1('0x13')],_0x5391c2);_0x288500(_0x4b8736[_0x6ea1('0x11')](0x1f4,_0x55c9d6['message']));});});};
\ No newline at end of file
+var _0xe5c4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetSugarcrmAccount','findAll','raw','options','where','attributes','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','find','then'];(function(_0x3f7cd1,_0x13a200){var _0x340a9b=function(_0x322055){while(--_0x322055){_0x3f7cd1['push'](_0x3f7cd1['shift']());}};_0x340a9b(++_0x13a200);}(_0xe5c4,0x1ba));var _0x4e5c=function(_0x193c81,_0x219d01){_0x193c81=_0x193c81-0x0;var _0x4348a5=_0xe5c4[_0x193c81];return _0x4348a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e5c('0x0'));var BPromise=require(_0x4e5c('0x1'));var rs=require(_0x4e5c('0x2'));var fs=require('fs');var Redis=require(_0x4e5c('0x3'));var db=require(_0x4e5c('0x4'))['db'];var utils=require(_0x4e5c('0x5'));var logger=require('../../config/logger')(_0x4e5c('0x6'));var config=require(_0x4e5c('0x7'));var jayson=require(_0x4e5c('0x8'));var client=jayson[_0x4e5c('0x9')][_0x4e5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa231,_0xd90b0b,_0xfd82bc){return new BPromise(function(_0x3dc804,_0x4576cb){return client['request'](_0x4aa231,_0xfd82bc)['then'](function(_0x453509){logger[_0x4e5c('0xb')](_0x4e5c('0xc'),_0xd90b0b,'request\x20sent');logger[_0x4e5c('0xd')](_0x4e5c('0xe'),_0xd90b0b,_0x4e5c('0xf'),JSON[_0x4e5c('0x10')](_0x453509));if(_0x453509[_0x4e5c('0x11')]){if(_0x453509['error'][_0x4e5c('0x12')]===0x1f4){logger[_0x4e5c('0x11')](_0x4e5c('0xc'),_0xd90b0b,_0x453509['error'][_0x4e5c('0x13')]);return _0x4576cb(_0x453509[_0x4e5c('0x11')][_0x4e5c('0x13')]);}logger[_0x4e5c('0x11')](_0x4e5c('0xc'),_0xd90b0b,_0x453509[_0x4e5c('0x11')][_0x4e5c('0x13')]);return _0x3dc804(_0x453509[_0x4e5c('0x11')][_0x4e5c('0x13')]);}else{logger[_0x4e5c('0xb')](_0x4e5c('0xc'),_0xd90b0b,'request\x20sent');_0x3dc804(_0x453509['result'][_0x4e5c('0x13')]);}})[_0x4e5c('0x14')](function(_0x2beca6){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0xd90b0b,_0x2beca6);_0x4576cb(_0x2beca6);});});}exports[_0x4e5c('0x15')]=function(_0x5120a9){var _0x1edc0d=this;return new Promise(function(_0x362f31,_0x4b6bdd){return db['SugarcrmAccount'][_0x4e5c('0x16')]({'raw':_0x5120a9['options']?_0x5120a9['options'][_0x4e5c('0x17')]===undefined?!![]:![]:!![],'where':_0x5120a9[_0x4e5c('0x18')]?_0x5120a9['options'][_0x4e5c('0x19')]||null:null,'attributes':_0x5120a9['options']?_0x5120a9[_0x4e5c('0x18')][_0x4e5c('0x1a')]||null:null,'limit':_0x5120a9[_0x4e5c('0x18')]?_0x5120a9['options']['limit']||null:null,'include':_0x5120a9[_0x4e5c('0x18')]?_0x5120a9[_0x4e5c('0x18')][_0x4e5c('0x1b')]?_[_0x4e5c('0x1c')](_0x5120a9['options'][_0x4e5c('0x1b')],function(_0x33d072){return{'model':db[_0x33d072[_0x4e5c('0x1d')]],'as':_0x33d072['as'],'attributes':_0x33d072[_0x4e5c('0x1a')],'include':_0x33d072['include']?_[_0x4e5c('0x1c')](_0x33d072[_0x4e5c('0x1b')],function(_0x5babfa){return{'model':db[_0x5babfa['model']],'as':_0x5babfa['as'],'attributes':_0x5babfa['attributes'],'include':_0x5babfa[_0x4e5c('0x1b')]?_[_0x4e5c('0x1c')](_0x5babfa[_0x4e5c('0x1b')],function(_0x2b43f3){return{'model':db[_0x2b43f3[_0x4e5c('0x1d')]],'as':_0x2b43f3['as'],'attributes':_0x2b43f3[_0x4e5c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ecb0a){logger[_0x4e5c('0xb')](_0x4e5c('0x15'),_0x5120a9);logger[_0x4e5c('0xd')](_0x4e5c('0x15'),_0x5120a9,JSON[_0x4e5c('0x10')](_0x5ecb0a));_0x362f31(_0x5ecb0a);})[_0x4e5c('0x14')](function(_0x46611b){logger['error'](_0x4e5c('0x15'),_0x46611b['message'],_0x5120a9);_0x4b6bdd(_0x1edc0d[_0x4e5c('0x11')](0x1f4,_0x46611b[_0x4e5c('0x13')]));});});};exports[_0x4e5c('0x1e')]=function(_0x4f20e3){var _0x140fb0=this;return new Promise(function(_0x33de74,_0x44d195){return db[_0x4e5c('0x1f')][_0x4e5c('0x20')]({'raw':_0x4f20e3[_0x4e5c('0x18')]?_0x4f20e3[_0x4e5c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f20e3[_0x4e5c('0x18')]?_0x4f20e3[_0x4e5c('0x18')][_0x4e5c('0x19')]||null:null,'attributes':_0x4f20e3[_0x4e5c('0x18')]?_0x4f20e3['options'][_0x4e5c('0x1a')]||null:null,'include':_0x4f20e3[_0x4e5c('0x18')]?_0x4f20e3[_0x4e5c('0x18')][_0x4e5c('0x1b')]?_[_0x4e5c('0x1c')](_0x4f20e3[_0x4e5c('0x18')][_0x4e5c('0x1b')],function(_0x4eae0b){return{'model':db[_0x4eae0b[_0x4e5c('0x1d')]],'as':_0x4eae0b['as'],'attributes':_0x4eae0b['attributes'],'include':_0x4eae0b['include']?_['map'](_0x4eae0b['include'],function(_0x2e2f9b){return{'model':db[_0x2e2f9b[_0x4e5c('0x1d')]],'as':_0x2e2f9b['as'],'attributes':_0x2e2f9b[_0x4e5c('0x1a')],'include':_0x2e2f9b['include']?_[_0x4e5c('0x1c')](_0x2e2f9b[_0x4e5c('0x1b')],function(_0xaf8197){return{'model':db[_0xaf8197['model']],'as':_0xaf8197['as'],'attributes':_0xaf8197[_0x4e5c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4e5c('0x21')](function(_0x3568d5){logger[_0x4e5c('0xb')]('ShowSugarcrmAccount',_0x4f20e3);logger[_0x4e5c('0xd')](_0x4e5c('0x1e'),_0x4f20e3,JSON[_0x4e5c('0x10')](_0x3568d5));_0x33de74(_0x3568d5);})[_0x4e5c('0x14')](function(_0x55f6cb){logger['error']('ShowSugarcrmAccount',_0x55f6cb[_0x4e5c('0x13')],_0x4f20e3);_0x44d195(_0x140fb0['error'](0x1f4,_0x55f6cb['message']));});});};
\ No newline at end of file
index 4cef4be..e10132d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5405=['fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','put','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x46d323,_0x4206b5){var _0x34866c=function(_0x476521){while(--_0x476521){_0x46d323['push'](_0x46d323['shift']());}};_0x34866c(++_0x4206b5);}(_0x5405,0x1b2));var _0x5540=function(_0x4e707e,_0x208eb5){_0x4e707e=_0x4e707e-0x0;var _0x3d346e=_0x5405[_0x4e707e];return _0x3d346e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5540('0x0'));var timeout=require(_0x5540('0x1'));var express=require('express');var router=express[_0x5540('0x2')]();var fs_extra=require(_0x5540('0x3'));var auth=require(_0x5540('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5540('0x5'));var controller=require(_0x5540('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5540('0x7')]);router[_0x5540('0x8')](_0x5540('0x9'),auth[_0x5540('0xa')](),controller['show']);router['get']('/:id/fields',auth[_0x5540('0xa')](),controller[_0x5540('0xb')]);router[_0x5540('0x8')](_0x5540('0xc'),auth[_0x5540('0xa')](),controller['getSubjects']);router[_0x5540('0x8')](_0x5540('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x5540('0xa')](),controller['create']);router[_0x5540('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5540('0xf')]);router[_0x5540('0x10')](_0x5540('0x9'),auth['isAuthenticated'](),controller[_0x5540('0x11')]);module[_0x5540('0x12')]=router;
\ No newline at end of file
+var _0x0db6=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x17b6f8,_0x57e1b4){var _0x440050=function(_0xcb04ab){while(--_0xcb04ab){_0x17b6f8['push'](_0x17b6f8['shift']());}};_0x440050(++_0x57e1b4);}(_0x0db6,0x1d2));var _0x60db=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x0db6[_0x35007a];return _0x574f68;};'use strict';var multer=require(_0x60db('0x0'));var util=require(_0x60db('0x1'));var path=require(_0x60db('0x2'));var timeout=require(_0x60db('0x3'));var express=require(_0x60db('0x4'));var router=express[_0x60db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x60db('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60db('0x7'));router[_0x60db('0x8')]('/',auth[_0x60db('0x9')](),controller[_0x60db('0xa')]);router['get'](_0x60db('0xb'),auth[_0x60db('0x9')](),controller[_0x60db('0xc')]);router[_0x60db('0x8')]('/:id/fields',auth[_0x60db('0x9')](),controller[_0x60db('0xd')]);router[_0x60db('0x8')](_0x60db('0xe'),auth[_0x60db('0x9')](),controller['getSubjects']);router[_0x60db('0x8')](_0x60db('0xf'),auth[_0x60db('0x9')](),controller[_0x60db('0x10')]);router[_0x60db('0x11')]('/',auth[_0x60db('0x9')](),controller['create']);router[_0x60db('0x12')](_0x60db('0xb'),auth[_0x60db('0x9')](),controller[_0x60db('0x13')]);router[_0x60db('0x14')](_0x60db('0xb'),auth[_0x60db('0x9')](),controller[_0x60db('0x15')]);module[_0x60db('0x16')]=router;
\ No newline at end of file
index 11025c9..5bce5b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84c5=['sequelize','STRING'];(function(_0x560af7,_0x24879e){var _0x125a73=function(_0xf349f3){while(--_0xf349f3){_0x560af7['push'](_0x560af7['shift']());}};_0x125a73(++_0x24879e);}(_0x84c5,0x1d2));var _0x584c=function(_0x2da3cc,_0x1fed56){_0x2da3cc=_0x2da3cc-0x0;var _0x55c3e0=_0x84c5[_0x2da3cc];return _0x55c3e0;};'use strict';var Sequelize=require(_0x584c('0x0'));module['exports']={'name':{'type':Sequelize[_0x584c('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7183=['exports','STRING','sequelize'];(function(_0x37f046,_0x2d48c9){var _0x438355=function(_0x204bf6){while(--_0x204bf6){_0x37f046['push'](_0x37f046['shift']());}};_0x438355(++_0x2d48c9);}(_0x7183,0x107));var _0x3718=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7183[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x3718('0x0'));module[_0x3718('0x1')]={'name':{'type':Sequelize[_0x3718('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ec1d0fa..f96879e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x148d=['where','pick','filter','merge','include','findAll','rows','show','includeAll','options','catch','body','find','params','destroy','getFields','findOne','SugarcrmField','length','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort'];(function(_0x1d5fa3,_0x4b79f0){var _0x1f2fdf=function(_0x30f9b2){while(--_0x30f9b2){_0x1d5fa3['push'](_0x1d5fa3['shift']());}};_0x1f2fdf(++_0x4b79f0);}(_0x148d,0x1b0));var _0xd148=function(_0x4bc8ac,_0x1a19c4){_0x4bc8ac=_0x4bc8ac-0x0;var _0x9fe991=_0x148d[_0x4bc8ac];return _0x9fe991;};'use strict';var emlformat=require(_0xd148('0x0'));var rimraf=require(_0xd148('0x1'));var zipdir=require(_0xd148('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd148('0x3'));var moment=require('moment');var BPromise=require(_0xd148('0x4'));var Mustache=require(_0xd148('0x5'));var util=require(_0xd148('0x6'));var path=require(_0xd148('0x7'));var sox=require(_0xd148('0x8'));var csv=require(_0xd148('0x9'));var ejs=require(_0xd148('0xa'));var fs=require('fs');var fs_extra=require(_0xd148('0xb'));var _=require('lodash');var squel=require(_0xd148('0xc'));var crypto=require(_0xd148('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd148('0xe'));var toCsv=require(_0xd148('0x9'));var querystring=require(_0xd148('0xf'));var Papa=require(_0xd148('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd148('0x11'));var as=require(_0xd148('0x12'));var hardwareService=require(_0xd148('0x13'));var logger=require(_0xd148('0x14'))(_0xd148('0x15'));var utils=require(_0xd148('0x16'));var config=require(_0xd148('0x17'));var licenseUtil=require(_0xd148('0x18'));var db=require(_0xd148('0x19'))['db'];function respondWithStatusCode(_0x24868d,_0x219655){_0x219655=_0x219655||0xcc;return function(_0x1b6211){if(_0x1b6211){return _0x24868d[_0xd148('0x1a')](_0x219655);}return _0x24868d[_0xd148('0x1b')](_0x219655)[_0xd148('0x1c')]();};}function respondWithResult(_0x116fd3,_0x5c0335){_0x5c0335=_0x5c0335||0xc8;return function(_0x2a28e1){if(_0x2a28e1){return _0x116fd3[_0xd148('0x1b')](_0x5c0335)[_0xd148('0x1d')](_0x2a28e1);}};}function respondWithFilteredResult(_0x3ab3ab,_0x500e0e){return function(_0x5d076e){if(_0x5d076e){var _0x5428e3=typeof _0x500e0e[_0xd148('0x1e')]===_0xd148('0x1f')&&typeof _0x500e0e[_0xd148('0x20')]===_0xd148('0x1f');var _0x31e4a8=_0x5d076e[_0xd148('0x21')];var _0x33e761=_0x5428e3?0x0:_0x500e0e[_0xd148('0x1e')];var _0x1cedd2=_0x5428e3?_0x5d076e['count']:_0x500e0e[_0xd148('0x1e')]+_0x500e0e['limit'];var _0x1b3025;if(_0x1cedd2>=_0x31e4a8){_0x1cedd2=_0x31e4a8;_0x1b3025=0xc8;}else{_0x1b3025=0xce;}_0x3ab3ab[_0xd148('0x1b')](_0x1b3025);return _0x3ab3ab['set'](_0xd148('0x22'),_0x33e761+'-'+_0x1cedd2+'/'+_0x31e4a8)[_0xd148('0x1d')](_0x5d076e);}return null;};}function patchUpdates(_0x42f20b){return function(_0x3a021a){try{jsonpatch['apply'](_0x3a021a,_0x42f20b,!![]);}catch(_0x206dc6){return BPromise[_0xd148('0x23')](_0x206dc6);}return _0x3a021a[_0xd148('0x24')]();};}function saveUpdates(_0x2ca13b,_0x51755f){return function(_0x1a1f5d){if(_0x1a1f5d){return _0x1a1f5d[_0xd148('0x25')](_0x2ca13b)[_0xd148('0x26')](function(_0x40dade){return _0x40dade;});}return null;};}function removeEntity(_0x406ff5,_0xd2616b){return function(_0x18d937){if(_0x18d937){return _0x18d937['destroy']()[_0xd148('0x26')](function(){_0x406ff5[_0xd148('0x1b')](0xcc)[_0xd148('0x1c')]();});}};}function handleEntityNotFound(_0x3f67c6,_0x2a8440){return function(_0x5c7da6){if(!_0x5c7da6){_0x3f67c6['sendStatus'](0x194);}return _0x5c7da6;};}function handleError(_0x2a586b,_0x2b9061){_0x2b9061=_0x2b9061||0x1f4;return function(_0x466808){logger[_0xd148('0x27')](_0x466808[_0xd148('0x28')]);if(_0x466808[_0xd148('0x29')]){delete _0x466808[_0xd148('0x29')];}_0x2a586b[_0xd148('0x1b')](_0x2b9061)[_0xd148('0x2a')](_0x466808);};}exports[_0xd148('0x2b')]=function(_0x448b6e,_0x254cdd){var _0x218718={},_0x158ae2={},_0x501690={'count':0x0,'rows':[]};var _0x3e676d=_[_0xd148('0x2c')](db[_0xd148('0x2d')][_0xd148('0x2e')],function(_0x3556f6){return{'name':_0x3556f6[_0xd148('0x2f')],'type':_0x3556f6[_0xd148('0x30')][_0xd148('0x31')]};});_0x158ae2[_0xd148('0x32')]=_[_0xd148('0x2c')](_0x3e676d,_0xd148('0x29'));_0x158ae2[_0xd148('0x33')]=_[_0xd148('0x34')](_0x448b6e['query']);_0x158ae2[_0xd148('0x35')]=_['intersection'](_0x158ae2[_0xd148('0x32')],_0x158ae2[_0xd148('0x33')]);_0x218718[_0xd148('0x36')]=_[_0xd148('0x37')](_0x158ae2['model'],qs[_0xd148('0x38')](_0x448b6e[_0xd148('0x33')][_0xd148('0x38')]));_0x218718[_0xd148('0x36')]=_0x218718['attributes']['length']?_0x218718[_0xd148('0x36')]:_0x158ae2['model'];if(!_0x448b6e[_0xd148('0x33')]['hasOwnProperty'](_0xd148('0x39'))){_0x218718[_0xd148('0x20')]=qs['limit'](_0x448b6e['query'][_0xd148('0x20')]);_0x218718[_0xd148('0x1e')]=qs[_0xd148('0x1e')](_0x448b6e[_0xd148('0x33')][_0xd148('0x1e')]);}_0x218718[_0xd148('0x3a')]=qs[_0xd148('0x3b')](_0x448b6e['query'][_0xd148('0x3b')]);_0x218718[_0xd148('0x3c')]=qs['filters'](_[_0xd148('0x3d')](_0x448b6e[_0xd148('0x33')],_0x158ae2['filters']),_0x3e676d);if(_0x448b6e[_0xd148('0x33')][_0xd148('0x3e')]){_0x218718['where']=_['merge'](_0x218718[_0xd148('0x3c')],{'$or':_[_0xd148('0x2c')](_0x3e676d,function(_0xf01af7){if(_0xf01af7[_0xd148('0x30')]!=='VIRTUAL'){var _0x515931={};_0x515931[_0xf01af7['name']]={'$like':'%'+_0x448b6e[_0xd148('0x33')][_0xd148('0x3e')]+'%'};return _0x515931;}})});}_0x218718=_[_0xd148('0x3f')]({},_0x218718,_0x448b6e['options']);var _0x1a0993={'where':_0x218718[_0xd148('0x3c')]};return db['SugarcrmConfiguration']['count'](_0x1a0993)[_0xd148('0x26')](function(_0x36bde3){_0x501690[_0xd148('0x21')]=_0x36bde3;if(_0x448b6e[_0xd148('0x33')]['includeAll']){_0x218718[_0xd148('0x40')]=[{'all':!![]}];}return db[_0xd148('0x2d')][_0xd148('0x41')](_0x218718);})['then'](function(_0x472b4a){_0x501690[_0xd148('0x42')]=_0x472b4a;return _0x501690;})['then'](respondWithFilteredResult(_0x254cdd,_0x218718))['catch'](handleError(_0x254cdd,null));};exports[_0xd148('0x43')]=function(_0x14f209,_0x291649){var _0x3efeff={'raw':![],'where':{'id':_0x14f209['params']['id']}},_0x197e9b={};_0x197e9b[_0xd148('0x32')]=_[_0xd148('0x34')](db['SugarcrmConfiguration']['rawAttributes']);_0x197e9b[_0xd148('0x33')]=_['keys'](_0x14f209[_0xd148('0x33')]);_0x197e9b[_0xd148('0x35')]=_[_0xd148('0x37')](_0x197e9b[_0xd148('0x32')],_0x197e9b['query']);_0x3efeff[_0xd148('0x36')]=_['intersection'](_0x197e9b[_0xd148('0x32')],qs[_0xd148('0x38')](_0x14f209[_0xd148('0x33')][_0xd148('0x38')]));_0x3efeff[_0xd148('0x36')]=_0x3efeff['attributes']['length']?_0x3efeff['attributes']:_0x197e9b[_0xd148('0x32')];if(_0x14f209[_0xd148('0x33')][_0xd148('0x44')]){_0x3efeff[_0xd148('0x40')]=[{'all':!![]}];}_0x3efeff=_[_0xd148('0x3f')]({},_0x3efeff,_0x14f209[_0xd148('0x45')]);return db[_0xd148('0x2d')]['find'](_0x3efeff)[_0xd148('0x26')](handleEntityNotFound(_0x291649,null))['then'](respondWithResult(_0x291649,null))[_0xd148('0x46')](handleError(_0x291649,null));};exports['create']=function(_0x38efc5,_0x1df240){return db[_0xd148('0x2d')]['create'](_0x38efc5[_0xd148('0x47')],{})[_0xd148('0x26')](respondWithResult(_0x1df240,0xc9))['catch'](handleError(_0x1df240,null));};exports['update']=function(_0x30ed02,_0x5d5cc7){if(_0x30ed02['body']['id']){delete _0x30ed02['body']['id'];}return db[_0xd148('0x2d')][_0xd148('0x48')]({'where':{'id':_0x30ed02[_0xd148('0x49')]['id']}})[_0xd148('0x26')](handleEntityNotFound(_0x5d5cc7,null))['then'](saveUpdates(_0x30ed02[_0xd148('0x47')],null))[_0xd148('0x26')](respondWithResult(_0x5d5cc7,null))['catch'](handleError(_0x5d5cc7,null));};exports[_0xd148('0x4a')]=function(_0x1efdb8,_0x462c01){return db[_0xd148('0x2d')]['find']({'where':{'id':_0x1efdb8[_0xd148('0x49')]['id']}})[_0xd148('0x26')](handleEntityNotFound(_0x462c01,null))[_0xd148('0x26')](removeEntity(_0x462c01,null))[_0xd148('0x46')](handleError(_0x462c01,null));};exports[_0xd148('0x4b')]=function(_0x379d64,_0x36e884,_0x817948){var _0x1a6cb9={};var _0x1da6bf={};var _0x5304c3;var _0x2192f4;return db[_0xd148('0x2d')][_0xd148('0x4c')]({'where':{'id':_0x379d64[_0xd148('0x49')]['id']}})[_0xd148('0x26')](handleEntityNotFound(_0x36e884,null))[_0xd148('0x26')](function(_0x3ba48d){if(_0x3ba48d){_0x5304c3=_0x3ba48d;_0x1da6bf['model']=_[_0xd148('0x34')](db[_0xd148('0x4d')][_0xd148('0x2e')]);_0x1da6bf['query']=_['keys'](_0x379d64[_0xd148('0x33')]);_0x1da6bf[_0xd148('0x35')]=_[_0xd148('0x37')](_0x1da6bf[_0xd148('0x32')],_0x1da6bf[_0xd148('0x33')]);_0x1a6cb9[_0xd148('0x36')]=_['intersection'](_0x1da6bf[_0xd148('0x32')],qs[_0xd148('0x38')](_0x379d64[_0xd148('0x33')][_0xd148('0x38')]));_0x1a6cb9[_0xd148('0x36')]=_0x1a6cb9['attributes'][_0xd148('0x4e')]?_0x1a6cb9[_0xd148('0x36')]:_0x1da6bf[_0xd148('0x32')];_0x1a6cb9[_0xd148('0x3a')]=qs[_0xd148('0x3b')](_0x379d64[_0xd148('0x33')][_0xd148('0x3b')]);_0x1a6cb9[_0xd148('0x3c')]=qs[_0xd148('0x35')](_[_0xd148('0x3d')](_0x379d64[_0xd148('0x33')],_0x1da6bf[_0xd148('0x35')]));if(_0x379d64['query'][_0xd148('0x3e')]){_0x1a6cb9['where']=_[_0xd148('0x3f')](_0x1a6cb9[_0xd148('0x3c')],{'$or':_[_0xd148('0x2c')](_0x1a6cb9[_0xd148('0x36')],function(_0x356557){var _0x551664={};_0x551664[_0x356557]={'$like':'%'+_0x379d64['query'][_0xd148('0x3e')]+'%'};return _0x551664;})});}_0x1a6cb9=_[_0xd148('0x3f')]({},_0x1a6cb9,_0x379d64[_0xd148('0x45')]);return _0x5304c3['getFields'](_0x1a6cb9);}})[_0xd148('0x26')](function(_0x580840){if(_0x580840){_0x2192f4=_0x580840[_0xd148('0x4e')];if(!_0x379d64[_0xd148('0x33')][_0xd148('0x4f')](_0xd148('0x39'))){_0x1a6cb9[_0xd148('0x20')]=qs[_0xd148('0x20')](_0x379d64[_0xd148('0x33')][_0xd148('0x20')]);_0x1a6cb9[_0xd148('0x1e')]=qs[_0xd148('0x1e')](_0x379d64[_0xd148('0x33')]['offset']);}return _0x5304c3[_0xd148('0x4b')](_0x1a6cb9);}})['then'](function(_0x1d2f56){if(_0x1d2f56){return _0x1d2f56?{'count':_0x2192f4,'rows':_0x1d2f56}:null;}})[_0xd148('0x26')](respondWithResult(_0x36e884,null))['catch'](handleError(_0x36e884,null));};exports[_0xd148('0x50')]=function(_0x3b9100,_0x14f5b5,_0x5666e8){var _0x528e1e={};var _0x1ee866={};var _0x3a352e;var _0x368d50;return db[_0xd148('0x2d')]['findOne']({'where':{'id':_0x3b9100[_0xd148('0x49')]['id']}})[_0xd148('0x26')](handleEntityNotFound(_0x14f5b5,null))['then'](function(_0x4bf551){if(_0x4bf551){_0x3a352e=_0x4bf551;_0x1ee866['model']=_[_0xd148('0x34')](db[_0xd148('0x4d')][_0xd148('0x2e')]);_0x1ee866[_0xd148('0x33')]=_[_0xd148('0x34')](_0x3b9100['query']);_0x1ee866[_0xd148('0x35')]=_[_0xd148('0x37')](_0x1ee866[_0xd148('0x32')],_0x1ee866[_0xd148('0x33')]);_0x528e1e[_0xd148('0x36')]=_[_0xd148('0x37')](_0x1ee866[_0xd148('0x32')],qs[_0xd148('0x38')](_0x3b9100['query'][_0xd148('0x38')]));_0x528e1e['attributes']=_0x528e1e[_0xd148('0x36')]['length']?_0x528e1e[_0xd148('0x36')]:_0x1ee866[_0xd148('0x32')];_0x528e1e[_0xd148('0x3a')]=qs[_0xd148('0x3b')](_0x3b9100[_0xd148('0x33')][_0xd148('0x3b')]);_0x528e1e[_0xd148('0x3c')]=qs['filters'](_[_0xd148('0x3d')](_0x3b9100[_0xd148('0x33')],_0x1ee866[_0xd148('0x35')]));if(_0x3b9100[_0xd148('0x33')][_0xd148('0x3e')]){_0x528e1e['where']=_[_0xd148('0x3f')](_0x528e1e[_0xd148('0x3c')],{'$or':_[_0xd148('0x2c')](_0x528e1e[_0xd148('0x36')],function(_0x17e751){var _0x10fdd6={};_0x10fdd6[_0x17e751]={'$like':'%'+_0x3b9100[_0xd148('0x33')]['filter']+'%'};return _0x10fdd6;})});}_0x528e1e=_['merge']({},_0x528e1e,_0x3b9100[_0xd148('0x45')]);return _0x3a352e[_0xd148('0x50')](_0x528e1e);}})[_0xd148('0x26')](function(_0x5d00f4){if(_0x5d00f4){_0x368d50=_0x5d00f4[_0xd148('0x4e')];if(!_0x3b9100[_0xd148('0x33')][_0xd148('0x4f')](_0xd148('0x39'))){_0x528e1e[_0xd148('0x20')]=qs[_0xd148('0x20')](_0x3b9100[_0xd148('0x33')][_0xd148('0x20')]);_0x528e1e['offset']=qs['offset'](_0x3b9100[_0xd148('0x33')]['offset']);}return _0x3a352e['getSubjects'](_0x528e1e);}})[_0xd148('0x26')](function(_0x2bcbf4){if(_0x2bcbf4){return _0x2bcbf4?{'count':_0x368d50,'rows':_0x2bcbf4}:null;}})['then'](respondWithResult(_0x14f5b5,null))[_0xd148('0x46')](handleError(_0x14f5b5,null));};exports[_0xd148('0x51')]=function(_0x364365,_0x40bdac,_0x4c4213){var _0x59f040={};var _0xca8836={};var _0x1bacd3;var _0x3aaa73;return db[_0xd148('0x2d')][_0xd148('0x4c')]({'where':{'id':_0x364365[_0xd148('0x49')]['id']}})[_0xd148('0x26')](handleEntityNotFound(_0x40bdac,null))[_0xd148('0x26')](function(_0xb685ca){if(_0xb685ca){_0x1bacd3=_0xb685ca;_0xca8836['model']=_[_0xd148('0x34')](db[_0xd148('0x4d')][_0xd148('0x2e')]);_0xca8836[_0xd148('0x33')]=_[_0xd148('0x34')](_0x364365[_0xd148('0x33')]);_0xca8836[_0xd148('0x35')]=_[_0xd148('0x37')](_0xca8836[_0xd148('0x32')],_0xca8836['query']);_0x59f040[_0xd148('0x36')]=_[_0xd148('0x37')](_0xca8836[_0xd148('0x32')],qs[_0xd148('0x38')](_0x364365[_0xd148('0x33')][_0xd148('0x38')]));_0x59f040[_0xd148('0x36')]=_0x59f040[_0xd148('0x36')][_0xd148('0x4e')]?_0x59f040[_0xd148('0x36')]:_0xca8836[_0xd148('0x32')];_0x59f040[_0xd148('0x3a')]=qs[_0xd148('0x3b')](_0x364365[_0xd148('0x33')]['sort']);_0x59f040[_0xd148('0x3c')]=qs[_0xd148('0x35')](_[_0xd148('0x3d')](_0x364365[_0xd148('0x33')],_0xca8836[_0xd148('0x35')]));if(_0x364365[_0xd148('0x33')][_0xd148('0x3e')]){_0x59f040['where']=_[_0xd148('0x3f')](_0x59f040[_0xd148('0x3c')],{'$or':_[_0xd148('0x2c')](_0x59f040[_0xd148('0x36')],function(_0x579428){var _0x72681a={};_0x72681a[_0x579428]={'$like':'%'+_0x364365['query'][_0xd148('0x3e')]+'%'};return _0x72681a;})});}_0x59f040=_[_0xd148('0x3f')]({},_0x59f040,_0x364365[_0xd148('0x45')]);return _0x1bacd3['getDescriptions'](_0x59f040);}})['then'](function(_0x238d3a){if(_0x238d3a){_0x3aaa73=_0x238d3a[_0xd148('0x4e')];if(!_0x364365[_0xd148('0x33')][_0xd148('0x4f')](_0xd148('0x39'))){_0x59f040[_0xd148('0x20')]=qs[_0xd148('0x20')](_0x364365[_0xd148('0x33')]['limit']);_0x59f040['offset']=qs['offset'](_0x364365['query'][_0xd148('0x1e')]);}return _0x1bacd3[_0xd148('0x51')](_0x59f040);}})['then'](function(_0x54992e){if(_0x54992e){return _0x54992e?{'count':_0x3aaa73,'rows':_0x54992e}:null;}})[_0xd148('0x26')](respondWithResult(_0x40bdac,null))['catch'](handleError(_0x40bdac,null));};
\ No newline at end of file
+var _0x16fa=['bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SugarcrmConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','getFields','findOne','SugarcrmField','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1f1aca,_0x13a17d){var _0x19e665=function(_0x568362){while(--_0x568362){_0x1f1aca['push'](_0x1f1aca['shift']());}};_0x19e665(++_0x13a17d);}(_0x16fa,0x98));var _0xa16f=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x16fa[_0x52bfa5];return _0x26f80b;};'use strict';var emlformat=require(_0xa16f('0x0'));var rimraf=require(_0xa16f('0x1'));var zipdir=require(_0xa16f('0x2'));var jsonpatch=require(_0xa16f('0x3'));var rp=require(_0xa16f('0x4'));var moment=require(_0xa16f('0x5'));var BPromise=require(_0xa16f('0x6'));var Mustache=require(_0xa16f('0x7'));var util=require(_0xa16f('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa16f('0x9'));var fs=require('fs');var fs_extra=require(_0xa16f('0xa'));var _=require(_0xa16f('0xb'));var squel=require(_0xa16f('0xc'));var crypto=require(_0xa16f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa16f('0xe'));var toCsv=require(_0xa16f('0xf'));var querystring=require(_0xa16f('0x10'));var Papa=require('papaparse');var Redis=require(_0xa16f('0x11'));var authService=require(_0xa16f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa16f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa16f('0x14'));var utils=require(_0xa16f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa16f('0x16'))['db'];function respondWithStatusCode(_0x356edf,_0xa79269){_0xa79269=_0xa79269||0xcc;return function(_0x2b9e4b){if(_0x2b9e4b){return _0x356edf[_0xa16f('0x17')](_0xa79269);}return _0x356edf[_0xa16f('0x18')](_0xa79269)[_0xa16f('0x19')]();};}function respondWithResult(_0x32523a,_0x28a75d){_0x28a75d=_0x28a75d||0xc8;return function(_0x41efe6){if(_0x41efe6){return _0x32523a[_0xa16f('0x18')](_0x28a75d)[_0xa16f('0x1a')](_0x41efe6);}};}function respondWithFilteredResult(_0x1dbef0,_0x96028f){return function(_0x41e5c5){if(_0x41e5c5){var _0x5e95c6=typeof _0x96028f[_0xa16f('0x1b')]===_0xa16f('0x1c')&&typeof _0x96028f['limit']===_0xa16f('0x1c');var _0x3859c9=_0x41e5c5[_0xa16f('0x1d')];var _0x2fc4c8=_0x5e95c6?0x0:_0x96028f[_0xa16f('0x1b')];var _0x90a0f0=_0x5e95c6?_0x41e5c5[_0xa16f('0x1d')]:_0x96028f[_0xa16f('0x1b')]+_0x96028f[_0xa16f('0x1e')];var _0x5b1396;if(_0x90a0f0>=_0x3859c9){_0x90a0f0=_0x3859c9;_0x5b1396=0xc8;}else{_0x5b1396=0xce;}_0x1dbef0[_0xa16f('0x18')](_0x5b1396);return _0x1dbef0[_0xa16f('0x1f')](_0xa16f('0x20'),_0x2fc4c8+'-'+_0x90a0f0+'/'+_0x3859c9)[_0xa16f('0x1a')](_0x41e5c5);}return null;};}function patchUpdates(_0x5541e6){return function(_0x28abb6){try{jsonpatch[_0xa16f('0x21')](_0x28abb6,_0x5541e6,!![]);}catch(_0x690e30){return BPromise[_0xa16f('0x22')](_0x690e30);}return _0x28abb6[_0xa16f('0x23')]();};}function saveUpdates(_0x238bcd,_0x69d5dd){return function(_0x412ada){if(_0x412ada){return _0x412ada[_0xa16f('0x24')](_0x238bcd)['then'](function(_0x176e50){return _0x176e50;});}return null;};}function removeEntity(_0x14f217,_0x1d1bc6){return function(_0x28b38f){if(_0x28b38f){return _0x28b38f[_0xa16f('0x25')]()[_0xa16f('0x26')](function(){_0x14f217['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52801e,_0x2521d7){return function(_0x2b3cc5){if(!_0x2b3cc5){_0x52801e[_0xa16f('0x17')](0x194);}return _0x2b3cc5;};}function handleError(_0x1f45b6,_0x414f1a){_0x414f1a=_0x414f1a||0x1f4;return function(_0x5d40df){logger[_0xa16f('0x27')](_0x5d40df[_0xa16f('0x28')]);if(_0x5d40df[_0xa16f('0x29')]){delete _0x5d40df[_0xa16f('0x29')];}_0x1f45b6[_0xa16f('0x18')](_0x414f1a)[_0xa16f('0x2a')](_0x5d40df);};}exports['index']=function(_0x241054,_0xceceae){var _0x4261b3={},_0x22b477={},_0x224328={'count':0x0,'rows':[]};var _0x3ead19=_[_0xa16f('0x2b')](db[_0xa16f('0x2c')]['rawAttributes'],function(_0x409ee4){return{'name':_0x409ee4[_0xa16f('0x2d')],'type':_0x409ee4[_0xa16f('0x2e')]['key']};});_0x22b477[_0xa16f('0x2f')]=_[_0xa16f('0x2b')](_0x3ead19,_0xa16f('0x29'));_0x22b477[_0xa16f('0x30')]=_[_0xa16f('0x31')](_0x241054[_0xa16f('0x30')]);_0x22b477[_0xa16f('0x32')]=_[_0xa16f('0x33')](_0x22b477[_0xa16f('0x2f')],_0x22b477['query']);_0x4261b3[_0xa16f('0x34')]=_[_0xa16f('0x33')](_0x22b477[_0xa16f('0x2f')],qs[_0xa16f('0x35')](_0x241054[_0xa16f('0x30')][_0xa16f('0x35')]));_0x4261b3['attributes']=_0x4261b3['attributes'][_0xa16f('0x36')]?_0x4261b3[_0xa16f('0x34')]:_0x22b477[_0xa16f('0x2f')];if(!_0x241054[_0xa16f('0x30')][_0xa16f('0x37')]('nolimit')){_0x4261b3[_0xa16f('0x1e')]=qs[_0xa16f('0x1e')](_0x241054[_0xa16f('0x30')][_0xa16f('0x1e')]);_0x4261b3[_0xa16f('0x1b')]=qs[_0xa16f('0x1b')](_0x241054['query'][_0xa16f('0x1b')]);}_0x4261b3[_0xa16f('0x38')]=qs[_0xa16f('0x39')](_0x241054[_0xa16f('0x30')][_0xa16f('0x39')]);_0x4261b3['where']=qs[_0xa16f('0x32')](_['pick'](_0x241054['query'],_0x22b477[_0xa16f('0x32')]),_0x3ead19);if(_0x241054['query'][_0xa16f('0x3a')]){_0x4261b3[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x4261b3[_0xa16f('0x3b')],{'$or':_['map'](_0x3ead19,function(_0x500896){if(_0x500896[_0xa16f('0x2e')]!=='VIRTUAL'){var _0xe159f7={};_0xe159f7[_0x500896[_0xa16f('0x29')]]={'$like':'%'+_0x241054[_0xa16f('0x30')]['filter']+'%'};return _0xe159f7;}})});}_0x4261b3=_['merge']({},_0x4261b3,_0x241054['options']);var _0x11f83a={'where':_0x4261b3[_0xa16f('0x3b')]};return db[_0xa16f('0x2c')][_0xa16f('0x1d')](_0x11f83a)[_0xa16f('0x26')](function(_0x404e20){_0x224328[_0xa16f('0x1d')]=_0x404e20;if(_0x241054[_0xa16f('0x30')]['includeAll']){_0x4261b3['include']=[{'all':!![]}];}return db[_0xa16f('0x2c')][_0xa16f('0x3d')](_0x4261b3);})[_0xa16f('0x26')](function(_0x5c5ae6){_0x224328[_0xa16f('0x3e')]=_0x5c5ae6;return _0x224328;})[_0xa16f('0x26')](respondWithFilteredResult(_0xceceae,_0x4261b3))[_0xa16f('0x3f')](handleError(_0xceceae,null));};exports[_0xa16f('0x40')]=function(_0x49453a,_0x153fc9){var _0x4c961e={'raw':![],'where':{'id':_0x49453a[_0xa16f('0x41')]['id']}},_0x397b9e={};_0x397b9e[_0xa16f('0x2f')]=_[_0xa16f('0x31')](db['SugarcrmConfiguration'][_0xa16f('0x42')]);_0x397b9e[_0xa16f('0x30')]=_[_0xa16f('0x31')](_0x49453a[_0xa16f('0x30')]);_0x397b9e[_0xa16f('0x32')]=_[_0xa16f('0x33')](_0x397b9e[_0xa16f('0x2f')],_0x397b9e[_0xa16f('0x30')]);_0x4c961e[_0xa16f('0x34')]=_[_0xa16f('0x33')](_0x397b9e['model'],qs[_0xa16f('0x35')](_0x49453a[_0xa16f('0x30')][_0xa16f('0x35')]));_0x4c961e[_0xa16f('0x34')]=_0x4c961e[_0xa16f('0x34')][_0xa16f('0x36')]?_0x4c961e[_0xa16f('0x34')]:_0x397b9e[_0xa16f('0x2f')];if(_0x49453a[_0xa16f('0x30')]['includeAll']){_0x4c961e[_0xa16f('0x43')]=[{'all':!![]}];}_0x4c961e=_[_0xa16f('0x3c')]({},_0x4c961e,_0x49453a[_0xa16f('0x44')]);return db['SugarcrmConfiguration']['find'](_0x4c961e)[_0xa16f('0x26')](handleEntityNotFound(_0x153fc9,null))[_0xa16f('0x26')](respondWithResult(_0x153fc9,null))[_0xa16f('0x3f')](handleError(_0x153fc9,null));};exports[_0xa16f('0x45')]=function(_0x154fb3,_0x899ccd){return db[_0xa16f('0x2c')][_0xa16f('0x45')](_0x154fb3[_0xa16f('0x46')],{})[_0xa16f('0x26')](respondWithResult(_0x899ccd,0xc9))[_0xa16f('0x3f')](handleError(_0x899ccd,null));};exports[_0xa16f('0x24')]=function(_0x4382e4,_0x39b97d){if(_0x4382e4['body']['id']){delete _0x4382e4[_0xa16f('0x46')]['id'];}return db[_0xa16f('0x2c')][_0xa16f('0x47')]({'where':{'id':_0x4382e4[_0xa16f('0x41')]['id']}})[_0xa16f('0x26')](handleEntityNotFound(_0x39b97d,null))[_0xa16f('0x26')](saveUpdates(_0x4382e4['body'],null))[_0xa16f('0x26')](respondWithResult(_0x39b97d,null))[_0xa16f('0x3f')](handleError(_0x39b97d,null));};exports[_0xa16f('0x25')]=function(_0x386930,_0x1d615f){return db[_0xa16f('0x2c')][_0xa16f('0x47')]({'where':{'id':_0x386930[_0xa16f('0x41')]['id']}})[_0xa16f('0x26')](handleEntityNotFound(_0x1d615f,null))['then'](removeEntity(_0x1d615f,null))[_0xa16f('0x3f')](handleError(_0x1d615f,null));};exports[_0xa16f('0x48')]=function(_0x23c31d,_0x1e1f2d,_0x7816a1){var _0x314bf2={};var _0x3b2396={};var _0x27b65e;var _0x977fc6;return db['SugarcrmConfiguration'][_0xa16f('0x49')]({'where':{'id':_0x23c31d[_0xa16f('0x41')]['id']}})[_0xa16f('0x26')](handleEntityNotFound(_0x1e1f2d,null))[_0xa16f('0x26')](function(_0x3cebcb){if(_0x3cebcb){_0x27b65e=_0x3cebcb;_0x3b2396[_0xa16f('0x2f')]=_[_0xa16f('0x31')](db[_0xa16f('0x4a')]['rawAttributes']);_0x3b2396[_0xa16f('0x30')]=_[_0xa16f('0x31')](_0x23c31d[_0xa16f('0x30')]);_0x3b2396['filters']=_[_0xa16f('0x33')](_0x3b2396[_0xa16f('0x2f')],_0x3b2396[_0xa16f('0x30')]);_0x314bf2['attributes']=_[_0xa16f('0x33')](_0x3b2396[_0xa16f('0x2f')],qs['fields'](_0x23c31d['query'][_0xa16f('0x35')]));_0x314bf2[_0xa16f('0x34')]=_0x314bf2['attributes'][_0xa16f('0x36')]?_0x314bf2[_0xa16f('0x34')]:_0x3b2396[_0xa16f('0x2f')];_0x314bf2[_0xa16f('0x38')]=qs[_0xa16f('0x39')](_0x23c31d['query'][_0xa16f('0x39')]);_0x314bf2[_0xa16f('0x3b')]=qs[_0xa16f('0x32')](_[_0xa16f('0x4b')](_0x23c31d[_0xa16f('0x30')],_0x3b2396[_0xa16f('0x32')]));if(_0x23c31d[_0xa16f('0x30')][_0xa16f('0x3a')]){_0x314bf2[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x314bf2[_0xa16f('0x3b')],{'$or':_[_0xa16f('0x2b')](_0x314bf2[_0xa16f('0x34')],function(_0x4e97fa){var _0x40c64e={};_0x40c64e[_0x4e97fa]={'$like':'%'+_0x23c31d['query'][_0xa16f('0x3a')]+'%'};return _0x40c64e;})});}_0x314bf2=_[_0xa16f('0x3c')]({},_0x314bf2,_0x23c31d[_0xa16f('0x44')]);return _0x27b65e[_0xa16f('0x48')](_0x314bf2);}})[_0xa16f('0x26')](function(_0x4bdb98){if(_0x4bdb98){_0x977fc6=_0x4bdb98[_0xa16f('0x36')];if(!_0x23c31d[_0xa16f('0x30')]['hasOwnProperty'](_0xa16f('0x4c'))){_0x314bf2['limit']=qs['limit'](_0x23c31d[_0xa16f('0x30')][_0xa16f('0x1e')]);_0x314bf2[_0xa16f('0x1b')]=qs[_0xa16f('0x1b')](_0x23c31d[_0xa16f('0x30')]['offset']);}return _0x27b65e[_0xa16f('0x48')](_0x314bf2);}})[_0xa16f('0x26')](function(_0x14563a){if(_0x14563a){return _0x14563a?{'count':_0x977fc6,'rows':_0x14563a}:null;}})[_0xa16f('0x26')](respondWithResult(_0x1e1f2d,null))[_0xa16f('0x3f')](handleError(_0x1e1f2d,null));};exports[_0xa16f('0x4d')]=function(_0x568997,_0x320259,_0x5f1cd2){var _0x49a91a={};var _0x548402={};var _0x3489c0;var _0xe45922;return db[_0xa16f('0x2c')][_0xa16f('0x49')]({'where':{'id':_0x568997['params']['id']}})[_0xa16f('0x26')](handleEntityNotFound(_0x320259,null))[_0xa16f('0x26')](function(_0xd0c6eb){if(_0xd0c6eb){_0x3489c0=_0xd0c6eb;_0x548402[_0xa16f('0x2f')]=_[_0xa16f('0x31')](db[_0xa16f('0x4a')][_0xa16f('0x42')]);_0x548402[_0xa16f('0x30')]=_[_0xa16f('0x31')](_0x568997[_0xa16f('0x30')]);_0x548402[_0xa16f('0x32')]=_[_0xa16f('0x33')](_0x548402[_0xa16f('0x2f')],_0x548402['query']);_0x49a91a[_0xa16f('0x34')]=_[_0xa16f('0x33')](_0x548402['model'],qs[_0xa16f('0x35')](_0x568997[_0xa16f('0x30')][_0xa16f('0x35')]));_0x49a91a['attributes']=_0x49a91a[_0xa16f('0x34')]['length']?_0x49a91a['attributes']:_0x548402[_0xa16f('0x2f')];_0x49a91a[_0xa16f('0x38')]=qs[_0xa16f('0x39')](_0x568997[_0xa16f('0x30')][_0xa16f('0x39')]);_0x49a91a[_0xa16f('0x3b')]=qs['filters'](_[_0xa16f('0x4b')](_0x568997[_0xa16f('0x30')],_0x548402[_0xa16f('0x32')]));if(_0x568997[_0xa16f('0x30')][_0xa16f('0x3a')]){_0x49a91a[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x49a91a['where'],{'$or':_['map'](_0x49a91a[_0xa16f('0x34')],function(_0x6ee351){var _0x85231d={};_0x85231d[_0x6ee351]={'$like':'%'+_0x568997[_0xa16f('0x30')]['filter']+'%'};return _0x85231d;})});}_0x49a91a=_['merge']({},_0x49a91a,_0x568997['options']);return _0x3489c0[_0xa16f('0x4d')](_0x49a91a);}})['then'](function(_0x2477fe){if(_0x2477fe){_0xe45922=_0x2477fe[_0xa16f('0x36')];if(!_0x568997[_0xa16f('0x30')]['hasOwnProperty'](_0xa16f('0x4c'))){_0x49a91a[_0xa16f('0x1e')]=qs[_0xa16f('0x1e')](_0x568997[_0xa16f('0x30')][_0xa16f('0x1e')]);_0x49a91a[_0xa16f('0x1b')]=qs[_0xa16f('0x1b')](_0x568997[_0xa16f('0x30')][_0xa16f('0x1b')]);}return _0x3489c0[_0xa16f('0x4d')](_0x49a91a);}})[_0xa16f('0x26')](function(_0x250b58){if(_0x250b58){return _0x250b58?{'count':_0xe45922,'rows':_0x250b58}:null;}})[_0xa16f('0x26')](respondWithResult(_0x320259,null))[_0xa16f('0x3f')](handleError(_0x320259,null));};exports[_0xa16f('0x4e')]=function(_0x5a4a3a,_0x3522c1,_0x4a3b08){var _0x1d8f62={};var _0x40fbd5={};var _0x308fb1;var _0x531e97;return db[_0xa16f('0x2c')][_0xa16f('0x49')]({'where':{'id':_0x5a4a3a[_0xa16f('0x41')]['id']}})[_0xa16f('0x26')](handleEntityNotFound(_0x3522c1,null))['then'](function(_0x2a44ee){if(_0x2a44ee){_0x308fb1=_0x2a44ee;_0x40fbd5['model']=_['keys'](db['SugarcrmField'][_0xa16f('0x42')]);_0x40fbd5['query']=_[_0xa16f('0x31')](_0x5a4a3a[_0xa16f('0x30')]);_0x40fbd5[_0xa16f('0x32')]=_[_0xa16f('0x33')](_0x40fbd5[_0xa16f('0x2f')],_0x40fbd5['query']);_0x1d8f62[_0xa16f('0x34')]=_[_0xa16f('0x33')](_0x40fbd5[_0xa16f('0x2f')],qs[_0xa16f('0x35')](_0x5a4a3a[_0xa16f('0x30')][_0xa16f('0x35')]));_0x1d8f62[_0xa16f('0x34')]=_0x1d8f62['attributes']['length']?_0x1d8f62[_0xa16f('0x34')]:_0x40fbd5[_0xa16f('0x2f')];_0x1d8f62[_0xa16f('0x38')]=qs[_0xa16f('0x39')](_0x5a4a3a['query'][_0xa16f('0x39')]);_0x1d8f62[_0xa16f('0x3b')]=qs['filters'](_[_0xa16f('0x4b')](_0x5a4a3a['query'],_0x40fbd5[_0xa16f('0x32')]));if(_0x5a4a3a[_0xa16f('0x30')]['filter']){_0x1d8f62[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x1d8f62['where'],{'$or':_[_0xa16f('0x2b')](_0x1d8f62[_0xa16f('0x34')],function(_0x2ac7b0){var _0x49726f={};_0x49726f[_0x2ac7b0]={'$like':'%'+_0x5a4a3a[_0xa16f('0x30')][_0xa16f('0x3a')]+'%'};return _0x49726f;})});}_0x1d8f62=_[_0xa16f('0x3c')]({},_0x1d8f62,_0x5a4a3a[_0xa16f('0x44')]);return _0x308fb1[_0xa16f('0x4e')](_0x1d8f62);}})[_0xa16f('0x26')](function(_0xf6b34e){if(_0xf6b34e){_0x531e97=_0xf6b34e['length'];if(!_0x5a4a3a[_0xa16f('0x30')][_0xa16f('0x37')](_0xa16f('0x4c'))){_0x1d8f62['limit']=qs[_0xa16f('0x1e')](_0x5a4a3a['query'][_0xa16f('0x1e')]);_0x1d8f62[_0xa16f('0x1b')]=qs[_0xa16f('0x1b')](_0x5a4a3a[_0xa16f('0x30')]['offset']);}return _0x308fb1[_0xa16f('0x4e')](_0x1d8f62);}})[_0xa16f('0x26')](function(_0x1e8e23){if(_0x1e8e23){return _0x1e8e23?{'count':_0x531e97,'rows':_0x1e8e23}:null;}})[_0xa16f('0x26')](respondWithResult(_0x3522c1,null))['catch'](handleError(_0x3522c1,null));};
\ No newline at end of file
index d8c6a83..a67a5b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb11c=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0xb11c,0x123));var _0xcb11=function(_0x51397c,_0x3c33ff){_0x51397c=_0x51397c-0x0;var _0x5644f9=_0xb11c[_0x51397c];return _0x5644f9;};'use strict';var _=require(_0xcb11('0x0'));var util=require('util');var logger=require(_0xcb11('0x1'))('api');var moment=require(_0xcb11('0x2'));var BPromise=require(_0xcb11('0x3'));var rp=require(_0xcb11('0x4'));var fs=require('fs');var path=require(_0xcb11('0x5'));var rimraf=require(_0xcb11('0x6'));var config=require(_0xcb11('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xcb11('0x8')]=function(_0x367786,_0x5d5dba){return _0x367786[_0xcb11('0x9')](_0xcb11('0xa'),attributes,{'tableName':_0xcb11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7bd0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x4586da,_0x12c862){var _0x14a825=function(_0x2862f3){while(--_0x2862f3){_0x4586da['push'](_0x4586da['shift']());}};_0x14a825(++_0x12c862);}(_0x7bd0,0x111));var _0x07bd=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x7bd0[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4c3138..71d8024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4be=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','request\x20sent','stringify','error','code','message','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf4be,0x1b1));var _0xef4b=function(_0x45c916,_0x5b10e2){_0x45c916=_0x45c916-0x0;var _0x5b7c82=_0xf4be[_0x45c916];return _0x5b7c82;};'use strict';var _=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var moment=require(_0xef4b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef4b('0x3'));var db=require(_0xef4b('0x4'))['db'];var utils=require(_0xef4b('0x5'));var logger=require('../../config/logger')(_0xef4b('0x6'));var config=require('../../config/environment');var jayson=require(_0xef4b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc86a,_0x568ef0,_0x129837){return new BPromise(function(_0x5c228f,_0x1f68b4){return client[_0xef4b('0x8')](_0x2dc86a,_0x129837)[_0xef4b('0x9')](function(_0x1d016d){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x568ef0,_0xef4b('0xa'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x568ef0,_0xef4b('0xa'),JSON[_0xef4b('0xb')](_0x1d016d));if(_0x1d016d['error']){if(_0x1d016d[_0xef4b('0xc')][_0xef4b('0xd')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x568ef0,_0x1d016d[_0xef4b('0xc')]['message']);return _0x1f68b4(_0x1d016d[_0xef4b('0xc')][_0xef4b('0xe')]);}logger[_0xef4b('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x568ef0,_0x1d016d[_0xef4b('0xc')][_0xef4b('0xe')]);return _0x5c228f(_0x1d016d[_0xef4b('0xc')][_0xef4b('0xe')]);}else{logger[_0xef4b('0xf')](_0xef4b('0x10'),_0x568ef0,_0xef4b('0xa'));_0x5c228f(_0x1d016d['result'][_0xef4b('0xe')]);}})[_0xef4b('0x11')](function(_0x5e138b){logger['error'](_0xef4b('0x10'),_0x568ef0,_0x5e138b);_0x1f68b4(_0x5e138b);});});}
\ No newline at end of file
+var _0x02a8=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x02a8,0xa5));var _0x802a=function(_0x214a13,_0x5841e9){_0x214a13=_0x214a13-0x0;var _0xc926f4=_0x02a8[_0x214a13];return _0xc926f4;};'use strict';var _=require(_0x802a('0x0'));var util=require('util');var moment=require(_0x802a('0x1'));var BPromise=require(_0x802a('0x2'));var rs=require(_0x802a('0x3'));var fs=require('fs');var Redis=require(_0x802a('0x4'));var db=require(_0x802a('0x5'))['db'];var utils=require(_0x802a('0x6'));var logger=require(_0x802a('0x7'))(_0x802a('0x8'));var config=require('../../config/environment');var jayson=require(_0x802a('0x9'));var client=jayson[_0x802a('0xa')][_0x802a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6292,_0x1f6535,_0x2af91a){return new BPromise(function(_0x3ceae5,_0x54e24e){return client[_0x802a('0xc')](_0x5b6292,_0x2af91a)[_0x802a('0xd')](function(_0x29e6e9){logger[_0x802a('0xe')](_0x802a('0xf'),_0x1f6535,_0x802a('0x10'));logger['debug'](_0x802a('0x11'),_0x1f6535,_0x802a('0x10'),JSON['stringify'](_0x29e6e9));if(_0x29e6e9[_0x802a('0x12')]){if(_0x29e6e9[_0x802a('0x12')][_0x802a('0x13')]===0x1f4){logger[_0x802a('0x12')](_0x802a('0xf'),_0x1f6535,_0x29e6e9[_0x802a('0x12')][_0x802a('0x14')]);return _0x54e24e(_0x29e6e9[_0x802a('0x12')][_0x802a('0x14')]);}logger['error'](_0x802a('0xf'),_0x1f6535,_0x29e6e9[_0x802a('0x12')][_0x802a('0x14')]);return _0x3ceae5(_0x29e6e9[_0x802a('0x12')]['message']);}else{logger[_0x802a('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1f6535,_0x802a('0x10'));_0x3ceae5(_0x29e6e9[_0x802a('0x15')][_0x802a('0x14')]);}})[_0x802a('0x16')](function(_0x46236e){logger[_0x802a('0x12')](_0x802a('0xf'),_0x1f6535,_0x46236e);_0x54e24e(_0x46236e);});});}
\ No newline at end of file
index ee1da6c..fdeb1d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89ce=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','put','update','delete'];(function(_0x3f4f65,_0x26069e){var _0x599852=function(_0x5edf86){while(--_0x5edf86){_0x3f4f65['push'](_0x3f4f65['shift']());}};_0x599852(++_0x26069e);}(_0x89ce,0x80));var _0xe89c=function(_0x5efbf3,_0x33afb3){_0x5efbf3=_0x5efbf3-0x0;var _0x1f3f6f=_0x89ce[_0x5efbf3];return _0x1f3f6f;};'use strict';var multer=require(_0xe89c('0x0'));var util=require(_0xe89c('0x1'));var path=require(_0xe89c('0x2'));var timeout=require(_0xe89c('0x3'));var express=require(_0xe89c('0x4'));var router=express[_0xe89c('0x5')]();var fs_extra=require(_0xe89c('0x6'));var auth=require(_0xe89c('0x7'));var interaction=require(_0xe89c('0x8'));var config=require(_0xe89c('0x9'));var controller=require(_0xe89c('0xa'));router[_0xe89c('0xb')]('/',auth[_0xe89c('0xc')](),controller[_0xe89c('0xd')]);router['get'](_0xe89c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe89c('0xf')]('/',auth[_0xe89c('0xc')](),controller['create']);router[_0xe89c('0x10')](_0xe89c('0xe'),auth[_0xe89c('0xc')](),controller[_0xe89c('0x11')]);router[_0xe89c('0x12')]('/:id',auth[_0xe89c('0xc')](),controller[_0xe89c('0x13')]);module[_0xe89c('0x14')]=router;
\ No newline at end of file
+var _0x4320=['Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x4320,0x1dc));var _0x0432=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x4320[_0x15c421];return _0x5e5ed5;};'use strict';var multer=require('multer');var util=require(_0x0432('0x0'));var path=require(_0x0432('0x1'));var timeout=require(_0x0432('0x2'));var express=require(_0x0432('0x3'));var router=express[_0x0432('0x4')]();var fs_extra=require(_0x0432('0x5'));var auth=require(_0x0432('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0432('0x7'));var controller=require(_0x0432('0x8'));router[_0x0432('0x9')]('/',auth[_0x0432('0xa')](),controller[_0x0432('0xb')]);router['get'](_0x0432('0xc'),auth[_0x0432('0xa')](),controller[_0x0432('0xd')]);router[_0x0432('0xe')]('/',auth[_0x0432('0xa')](),controller[_0x0432('0xf')]);router[_0x0432('0x10')](_0x0432('0xc'),auth[_0x0432('0xa')](),controller[_0x0432('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0432('0x12')]);module[_0x0432('0x13')]=router;
\ No newline at end of file
index 8ed6b53..3193aca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46d4=['variable','keyValue','STRING','customVariable','sequelize','ENUM','string'];(function(_0x2e3f3b,_0xef509){var _0x2094bd=function(_0x19eb34){while(--_0x19eb34){_0x2e3f3b['push'](_0x2e3f3b['shift']());}};_0x2094bd(++_0xef509);}(_0x46d4,0x1d2));var _0x446d=function(_0x2cfd50,_0x28a14b){_0x2cfd50=_0x2cfd50-0x0;var _0xb43537=_0x46d4[_0x2cfd50];return _0xb43537;};'use strict';var Sequelize=require(_0x446d('0x0'));module['exports']={'type':{'type':Sequelize[_0x446d('0x1')](_0x446d('0x2'),_0x446d('0x3'),'customVariable',_0x446d('0x4'),'picklist'),'defaultValue':_0x446d('0x2')},'content':{'type':Sequelize[_0x446d('0x5')]},'key':{'type':Sequelize[_0x446d('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x446d('0x2'),'variable',_0x446d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x446d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x446d('0x5')]}};
\ No newline at end of file
+var _0x271c=['picklist','STRING','variable','customVariable','BOOLEAN','exports','ENUM','string','keyValue'];(function(_0x56d4a2,_0x23c670){var _0x48b89d=function(_0x1851a0){while(--_0x1851a0){_0x56d4a2['push'](_0x56d4a2['shift']());}};_0x48b89d(++_0x23c670);}(_0x271c,0xa7));var _0xc271=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x271c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xc271('0x0')]={'type':{'type':Sequelize[_0xc271('0x1')](_0xc271('0x2'),'variable','customVariable',_0xc271('0x3'),_0xc271('0x4')),'defaultValue':_0xc271('0x2')},'content':{'type':Sequelize[_0xc271('0x5')]},'key':{'type':Sequelize[_0xc271('0x5')]},'keyType':{'type':Sequelize[_0xc271('0x1')]('string',_0xc271('0x6'),_0xc271('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc271('0x5')]},'nameField':{'type':Sequelize[_0xc271('0x5')]},'customField':{'type':Sequelize[_0xc271('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc271('0x5')]}};
\ No newline at end of file
index e3c9bce..84ab984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ad7=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SugarcrmField','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7ad7,0xce));var _0x77ad=function(_0x5b6541,_0x467a7a){_0x5b6541=_0x5b6541-0x0;var _0x3652df=_0x7ad7[_0x5b6541];return _0x3652df;};'use strict';var emlformat=require(_0x77ad('0x0'));var rimraf=require(_0x77ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77ad('0x2'));var BPromise=require(_0x77ad('0x3'));var Mustache=require('mustache');var util=require(_0x77ad('0x4'));var path=require('path');var sox=require(_0x77ad('0x5'));var csv=require(_0x77ad('0x6'));var ejs=require(_0x77ad('0x7'));var fs=require('fs');var fs_extra=require(_0x77ad('0x8'));var _=require('lodash');var squel=require(_0x77ad('0x9'));var crypto=require(_0x77ad('0xa'));var jsforce=require(_0x77ad('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x77ad('0x6'));var querystring=require(_0x77ad('0xc'));var Papa=require(_0x77ad('0xd'));var Redis=require(_0x77ad('0xe'));var authService=require(_0x77ad('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77ad('0x10'));var logger=require('../../config/logger')(_0x77ad('0x11'));var utils=require(_0x77ad('0x12'));var config=require(_0x77ad('0x13'));var licenseUtil=require(_0x77ad('0x14'));var db=require(_0x77ad('0x15'))['db'];function respondWithStatusCode(_0x46ed13,_0x3bf0ea){_0x3bf0ea=_0x3bf0ea||0xcc;return function(_0x18aaa7){if(_0x18aaa7){return _0x46ed13['sendStatus'](_0x3bf0ea);}return _0x46ed13[_0x77ad('0x16')](_0x3bf0ea)[_0x77ad('0x17')]();};}function respondWithResult(_0x83610d,_0x37a207){_0x37a207=_0x37a207||0xc8;return function(_0x58c8ae){if(_0x58c8ae){return _0x83610d[_0x77ad('0x16')](_0x37a207)[_0x77ad('0x18')](_0x58c8ae);}};}function respondWithFilteredResult(_0xb721b9,_0x4d62aa){return function(_0x589813){if(_0x589813){var _0x351327=typeof _0x4d62aa[_0x77ad('0x19')]===_0x77ad('0x1a')&&typeof _0x4d62aa[_0x77ad('0x1b')]===_0x77ad('0x1a');var _0x4e4d0e=_0x589813[_0x77ad('0x1c')];var _0x4e499c=_0x351327?0x0:_0x4d62aa['offset'];var _0x1fe4d9=_0x351327?_0x589813[_0x77ad('0x1c')]:_0x4d62aa[_0x77ad('0x19')]+_0x4d62aa['limit'];var _0x39ce56;if(_0x1fe4d9>=_0x4e4d0e){_0x1fe4d9=_0x4e4d0e;_0x39ce56=0xc8;}else{_0x39ce56=0xce;}_0xb721b9[_0x77ad('0x16')](_0x39ce56);return _0xb721b9[_0x77ad('0x1d')](_0x77ad('0x1e'),_0x4e499c+'-'+_0x1fe4d9+'/'+_0x4e4d0e)[_0x77ad('0x18')](_0x589813);}return null;};}function patchUpdates(_0x1d6d6d){return function(_0x10e31f){try{jsonpatch[_0x77ad('0x1f')](_0x10e31f,_0x1d6d6d,!![]);}catch(_0x2581fd){return BPromise[_0x77ad('0x20')](_0x2581fd);}return _0x10e31f[_0x77ad('0x21')]();};}function saveUpdates(_0x5d05fc,_0x2047f8){return function(_0x5c0100){if(_0x5c0100){return _0x5c0100[_0x77ad('0x22')](_0x5d05fc)[_0x77ad('0x23')](function(_0x4b0cad){return _0x4b0cad;});}return null;};}function removeEntity(_0x45644b,_0x1621cf){return function(_0x50961f){if(_0x50961f){return _0x50961f[_0x77ad('0x24')]()['then'](function(){_0x45644b['status'](0xcc)[_0x77ad('0x17')]();});}};}function handleEntityNotFound(_0x1d2c06,_0x16e60c){return function(_0x26ac37){if(!_0x26ac37){_0x1d2c06[_0x77ad('0x25')](0x194);}return _0x26ac37;};}function handleError(_0x57b69c,_0xbd52e1){_0xbd52e1=_0xbd52e1||0x1f4;return function(_0x8c7251){logger[_0x77ad('0x26')](_0x8c7251['stack']);if(_0x8c7251[_0x77ad('0x27')]){delete _0x8c7251[_0x77ad('0x27')];}_0x57b69c[_0x77ad('0x16')](_0xbd52e1)[_0x77ad('0x28')](_0x8c7251);};}exports[_0x77ad('0x29')]=function(_0x4bbd18,_0x28ee37){var _0x2445df={},_0x9bff8={},_0x63cd7e={'count':0x0,'rows':[]};var _0x276be4=_[_0x77ad('0x2a')](db['SugarcrmField'][_0x77ad('0x2b')],function(_0x424a29){return{'name':_0x424a29[_0x77ad('0x2c')],'type':_0x424a29[_0x77ad('0x2d')][_0x77ad('0x2e')]};});_0x9bff8['model']=_[_0x77ad('0x2a')](_0x276be4,_0x77ad('0x27'));_0x9bff8[_0x77ad('0x2f')]=_[_0x77ad('0x30')](_0x4bbd18[_0x77ad('0x2f')]);_0x9bff8[_0x77ad('0x31')]=_[_0x77ad('0x32')](_0x9bff8[_0x77ad('0x33')],_0x9bff8[_0x77ad('0x2f')]);_0x2445df[_0x77ad('0x34')]=_[_0x77ad('0x32')](_0x9bff8[_0x77ad('0x33')],qs[_0x77ad('0x35')](_0x4bbd18['query'][_0x77ad('0x35')]));_0x2445df[_0x77ad('0x34')]=_0x2445df[_0x77ad('0x34')][_0x77ad('0x36')]?_0x2445df['attributes']:_0x9bff8[_0x77ad('0x33')];if(!_0x4bbd18[_0x77ad('0x2f')][_0x77ad('0x37')](_0x77ad('0x38'))){_0x2445df['limit']=qs[_0x77ad('0x1b')](_0x4bbd18[_0x77ad('0x2f')]['limit']);_0x2445df[_0x77ad('0x19')]=qs[_0x77ad('0x19')](_0x4bbd18['query'][_0x77ad('0x19')]);}_0x2445df[_0x77ad('0x39')]=qs['sort'](_0x4bbd18[_0x77ad('0x2f')][_0x77ad('0x3a')]);_0x2445df[_0x77ad('0x3b')]=qs[_0x77ad('0x31')](_[_0x77ad('0x3c')](_0x4bbd18[_0x77ad('0x2f')],_0x9bff8[_0x77ad('0x31')]),_0x276be4);if(_0x4bbd18[_0x77ad('0x2f')][_0x77ad('0x3d')]){_0x2445df[_0x77ad('0x3b')]=_[_0x77ad('0x3e')](_0x2445df[_0x77ad('0x3b')],{'$or':_[_0x77ad('0x2a')](_0x276be4,function(_0x1ebcc9){if(_0x1ebcc9['type']!=='VIRTUAL'){var _0x419162={};_0x419162[_0x1ebcc9[_0x77ad('0x27')]]={'$like':'%'+_0x4bbd18[_0x77ad('0x2f')][_0x77ad('0x3d')]+'%'};return _0x419162;}})});}_0x2445df=_[_0x77ad('0x3e')]({},_0x2445df,_0x4bbd18['options']);var _0x3715db={'where':_0x2445df['where']};return db[_0x77ad('0x3f')][_0x77ad('0x1c')](_0x3715db)[_0x77ad('0x23')](function(_0x55cac4){_0x63cd7e[_0x77ad('0x1c')]=_0x55cac4;if(_0x4bbd18[_0x77ad('0x2f')]['includeAll']){_0x2445df[_0x77ad('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x77ad('0x41')](_0x2445df);})[_0x77ad('0x23')](function(_0x28c0d3){_0x63cd7e[_0x77ad('0x42')]=_0x28c0d3;return _0x63cd7e;})[_0x77ad('0x23')](respondWithFilteredResult(_0x28ee37,_0x2445df))[_0x77ad('0x43')](handleError(_0x28ee37,null));};exports[_0x77ad('0x44')]=function(_0x3311b6,_0x13346e){var _0xe146a3={'raw':!![],'where':{'id':_0x3311b6[_0x77ad('0x45')]['id']}},_0x25f2dd={};_0x25f2dd[_0x77ad('0x33')]=_[_0x77ad('0x30')](db[_0x77ad('0x3f')][_0x77ad('0x2b')]);_0x25f2dd[_0x77ad('0x2f')]=_['keys'](_0x3311b6[_0x77ad('0x2f')]);_0x25f2dd['filters']=_[_0x77ad('0x32')](_0x25f2dd[_0x77ad('0x33')],_0x25f2dd['query']);_0xe146a3[_0x77ad('0x34')]=_[_0x77ad('0x32')](_0x25f2dd[_0x77ad('0x33')],qs[_0x77ad('0x35')](_0x3311b6['query'][_0x77ad('0x35')]));_0xe146a3[_0x77ad('0x34')]=_0xe146a3['attributes'][_0x77ad('0x36')]?_0xe146a3[_0x77ad('0x34')]:_0x25f2dd['model'];if(_0x3311b6[_0x77ad('0x2f')]['includeAll']){_0xe146a3[_0x77ad('0x40')]=[{'all':!![]}];}_0xe146a3=_[_0x77ad('0x3e')]({},_0xe146a3,_0x3311b6['options']);return db['SugarcrmField'][_0x77ad('0x46')](_0xe146a3)[_0x77ad('0x23')](handleEntityNotFound(_0x13346e,null))[_0x77ad('0x23')](respondWithResult(_0x13346e,null))[_0x77ad('0x43')](handleError(_0x13346e,null));};exports[_0x77ad('0x47')]=function(_0x399044,_0x598c97){return db[_0x77ad('0x3f')][_0x77ad('0x47')](_0x399044[_0x77ad('0x48')],{})[_0x77ad('0x23')](respondWithResult(_0x598c97,0xc9))[_0x77ad('0x43')](handleError(_0x598c97,null));};exports[_0x77ad('0x22')]=function(_0x5daeb2,_0x50c5ca){if(_0x5daeb2['body']['id']){delete _0x5daeb2['body']['id'];}return db[_0x77ad('0x3f')][_0x77ad('0x46')]({'where':{'id':_0x5daeb2[_0x77ad('0x45')]['id']}})[_0x77ad('0x23')](handleEntityNotFound(_0x50c5ca,null))['then'](saveUpdates(_0x5daeb2[_0x77ad('0x48')],null))['then'](respondWithResult(_0x50c5ca,null))['catch'](handleError(_0x50c5ca,null));};exports[_0x77ad('0x24')]=function(_0x1cc3cc,_0x5bd283){return db[_0x77ad('0x3f')][_0x77ad('0x46')]({'where':{'id':_0x1cc3cc['params']['id']}})[_0x77ad('0x23')](handleEntityNotFound(_0x5bd283,null))['then'](removeEntity(_0x5bd283,null))['catch'](handleError(_0x5bd283,null));};
\ No newline at end of file
+var _0xcde1=['reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmField','includeAll','include','findAll','rows','catch','find','create','params','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','limit','Content-Range','apply'];(function(_0x47f526,_0x4d2828){var _0x1f4a2f=function(_0x14a603){while(--_0x14a603){_0x47f526['push'](_0x47f526['shift']());}};_0x1f4a2f(++_0x4d2828);}(_0xcde1,0xbf));var _0x1cde=function(_0x1f2fef,_0x3a7011){_0x1f2fef=_0x1f2fef-0x0;var _0x21ee26=_0xcde1[_0x1f2fef];return _0x21ee26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cde('0x0'));var jsonpatch=require(_0x1cde('0x1'));var rp=require('request-promise');var moment=require(_0x1cde('0x2'));var BPromise=require(_0x1cde('0x3'));var Mustache=require(_0x1cde('0x4'));var util=require('util');var path=require(_0x1cde('0x5'));var sox=require('sox');var csv=require(_0x1cde('0x6'));var ejs=require(_0x1cde('0x7'));var fs=require('fs');var fs_extra=require(_0x1cde('0x8'));var _=require(_0x1cde('0x9'));var squel=require(_0x1cde('0xa'));var crypto=require(_0x1cde('0xb'));var jsforce=require(_0x1cde('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1cde('0x6'));var querystring=require('querystring');var Papa=require(_0x1cde('0xd'));var Redis=require(_0x1cde('0xe'));var authService=require(_0x1cde('0xf'));var qs=require(_0x1cde('0x10'));var as=require(_0x1cde('0x11'));var hardwareService=require(_0x1cde('0x12'));var logger=require(_0x1cde('0x13'))('api');var utils=require(_0x1cde('0x14'));var config=require(_0x1cde('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cde('0x16'))['db'];function respondWithStatusCode(_0x384ff8,_0x2866f9){_0x2866f9=_0x2866f9||0xcc;return function(_0x82160e){if(_0x82160e){return _0x384ff8[_0x1cde('0x17')](_0x2866f9);}return _0x384ff8[_0x1cde('0x18')](_0x2866f9)['end']();};}function respondWithResult(_0x34f7f5,_0x4e5966){_0x4e5966=_0x4e5966||0xc8;return function(_0x19ae14){if(_0x19ae14){return _0x34f7f5[_0x1cde('0x18')](_0x4e5966)[_0x1cde('0x19')](_0x19ae14);}};}function respondWithFilteredResult(_0x1ccffb,_0x3adac3){return function(_0x51ed93){if(_0x51ed93){var _0x299bde=typeof _0x3adac3['offset']===_0x1cde('0x1a')&&typeof _0x3adac3['limit']===_0x1cde('0x1a');var _0x84cb1a=_0x51ed93[_0x1cde('0x1b')];var _0x4f36a3=_0x299bde?0x0:_0x3adac3['offset'];var _0x4bcded=_0x299bde?_0x51ed93[_0x1cde('0x1b')]:_0x3adac3['offset']+_0x3adac3[_0x1cde('0x1c')];var _0x41841e;if(_0x4bcded>=_0x84cb1a){_0x4bcded=_0x84cb1a;_0x41841e=0xc8;}else{_0x41841e=0xce;}_0x1ccffb[_0x1cde('0x18')](_0x41841e);return _0x1ccffb['set'](_0x1cde('0x1d'),_0x4f36a3+'-'+_0x4bcded+'/'+_0x84cb1a)[_0x1cde('0x19')](_0x51ed93);}return null;};}function patchUpdates(_0x2f2c9e){return function(_0x2460cd){try{jsonpatch[_0x1cde('0x1e')](_0x2460cd,_0x2f2c9e,!![]);}catch(_0x26c908){return BPromise[_0x1cde('0x1f')](_0x26c908);}return _0x2460cd[_0x1cde('0x20')]();};}function saveUpdates(_0x12c6f0,_0x4519b2){return function(_0x1a388f){if(_0x1a388f){return _0x1a388f[_0x1cde('0x21')](_0x12c6f0)['then'](function(_0x319bff){return _0x319bff;});}return null;};}function removeEntity(_0x39b682,_0x109233){return function(_0x5f2d72){if(_0x5f2d72){return _0x5f2d72[_0x1cde('0x22')]()[_0x1cde('0x23')](function(){_0x39b682['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0906,_0x25c192){return function(_0x75009a){if(!_0x75009a){_0x2f0906[_0x1cde('0x17')](0x194);}return _0x75009a;};}function handleError(_0x3b6861,_0x53360a){_0x53360a=_0x53360a||0x1f4;return function(_0x7647b8){logger[_0x1cde('0x24')](_0x7647b8[_0x1cde('0x25')]);if(_0x7647b8[_0x1cde('0x26')]){delete _0x7647b8[_0x1cde('0x26')];}_0x3b6861[_0x1cde('0x18')](_0x53360a)[_0x1cde('0x27')](_0x7647b8);};}exports[_0x1cde('0x28')]=function(_0x2b054d,_0x8288ae){var _0x5ec0b6={},_0x218035={},_0x17b1e0={'count':0x0,'rows':[]};var _0xfbfc88=_[_0x1cde('0x29')](db['SugarcrmField'][_0x1cde('0x2a')],function(_0x437b49){return{'name':_0x437b49[_0x1cde('0x2b')],'type':_0x437b49[_0x1cde('0x2c')][_0x1cde('0x2d')]};});_0x218035[_0x1cde('0x2e')]=_[_0x1cde('0x29')](_0xfbfc88,_0x1cde('0x26'));_0x218035[_0x1cde('0x2f')]=_[_0x1cde('0x30')](_0x2b054d['query']);_0x218035[_0x1cde('0x31')]=_['intersection'](_0x218035[_0x1cde('0x2e')],_0x218035[_0x1cde('0x2f')]);_0x5ec0b6[_0x1cde('0x32')]=_[_0x1cde('0x33')](_0x218035[_0x1cde('0x2e')],qs[_0x1cde('0x34')](_0x2b054d[_0x1cde('0x2f')][_0x1cde('0x34')]));_0x5ec0b6['attributes']=_0x5ec0b6[_0x1cde('0x32')][_0x1cde('0x35')]?_0x5ec0b6[_0x1cde('0x32')]:_0x218035[_0x1cde('0x2e')];if(!_0x2b054d[_0x1cde('0x2f')][_0x1cde('0x36')](_0x1cde('0x37'))){_0x5ec0b6['limit']=qs[_0x1cde('0x1c')](_0x2b054d[_0x1cde('0x2f')][_0x1cde('0x1c')]);_0x5ec0b6[_0x1cde('0x38')]=qs[_0x1cde('0x38')](_0x2b054d['query']['offset']);}_0x5ec0b6[_0x1cde('0x39')]=qs[_0x1cde('0x3a')](_0x2b054d[_0x1cde('0x2f')][_0x1cde('0x3a')]);_0x5ec0b6[_0x1cde('0x3b')]=qs[_0x1cde('0x31')](_[_0x1cde('0x3c')](_0x2b054d[_0x1cde('0x2f')],_0x218035[_0x1cde('0x31')]),_0xfbfc88);if(_0x2b054d['query'][_0x1cde('0x3d')]){_0x5ec0b6[_0x1cde('0x3b')]=_['merge'](_0x5ec0b6[_0x1cde('0x3b')],{'$or':_[_0x1cde('0x29')](_0xfbfc88,function(_0x253918){if(_0x253918[_0x1cde('0x2c')]!==_0x1cde('0x3e')){var _0x35f648={};_0x35f648[_0x253918[_0x1cde('0x26')]]={'$like':'%'+_0x2b054d[_0x1cde('0x2f')][_0x1cde('0x3d')]+'%'};return _0x35f648;}})});}_0x5ec0b6=_[_0x1cde('0x3f')]({},_0x5ec0b6,_0x2b054d[_0x1cde('0x40')]);var _0x1a3a9a={'where':_0x5ec0b6['where']};return db[_0x1cde('0x41')][_0x1cde('0x1b')](_0x1a3a9a)[_0x1cde('0x23')](function(_0x2a8ddb){_0x17b1e0[_0x1cde('0x1b')]=_0x2a8ddb;if(_0x2b054d['query'][_0x1cde('0x42')]){_0x5ec0b6[_0x1cde('0x43')]=[{'all':!![]}];}return db['SugarcrmField'][_0x1cde('0x44')](_0x5ec0b6);})[_0x1cde('0x23')](function(_0x572b70){_0x17b1e0[_0x1cde('0x45')]=_0x572b70;return _0x17b1e0;})['then'](respondWithFilteredResult(_0x8288ae,_0x5ec0b6))[_0x1cde('0x46')](handleError(_0x8288ae,null));};exports['show']=function(_0x4df7e4,_0x4fa604){var _0x1f2420={'raw':!![],'where':{'id':_0x4df7e4['params']['id']}},_0x4aa6eb={};_0x4aa6eb['model']=_[_0x1cde('0x30')](db[_0x1cde('0x41')][_0x1cde('0x2a')]);_0x4aa6eb[_0x1cde('0x2f')]=_[_0x1cde('0x30')](_0x4df7e4[_0x1cde('0x2f')]);_0x4aa6eb[_0x1cde('0x31')]=_[_0x1cde('0x33')](_0x4aa6eb['model'],_0x4aa6eb['query']);_0x1f2420[_0x1cde('0x32')]=_[_0x1cde('0x33')](_0x4aa6eb[_0x1cde('0x2e')],qs[_0x1cde('0x34')](_0x4df7e4[_0x1cde('0x2f')]['fields']));_0x1f2420[_0x1cde('0x32')]=_0x1f2420[_0x1cde('0x32')][_0x1cde('0x35')]?_0x1f2420[_0x1cde('0x32')]:_0x4aa6eb[_0x1cde('0x2e')];if(_0x4df7e4[_0x1cde('0x2f')][_0x1cde('0x42')]){_0x1f2420[_0x1cde('0x43')]=[{'all':!![]}];}_0x1f2420=_[_0x1cde('0x3f')]({},_0x1f2420,_0x4df7e4[_0x1cde('0x40')]);return db[_0x1cde('0x41')][_0x1cde('0x47')](_0x1f2420)[_0x1cde('0x23')](handleEntityNotFound(_0x4fa604,null))[_0x1cde('0x23')](respondWithResult(_0x4fa604,null))[_0x1cde('0x46')](handleError(_0x4fa604,null));};exports['create']=function(_0x59e8c4,_0x3cd087){return db[_0x1cde('0x41')][_0x1cde('0x48')](_0x59e8c4['body'],{})[_0x1cde('0x23')](respondWithResult(_0x3cd087,0xc9))['catch'](handleError(_0x3cd087,null));};exports[_0x1cde('0x21')]=function(_0x50365e,_0x53f58f){if(_0x50365e['body']['id']){delete _0x50365e['body']['id'];}return db[_0x1cde('0x41')][_0x1cde('0x47')]({'where':{'id':_0x50365e[_0x1cde('0x49')]['id']}})[_0x1cde('0x23')](handleEntityNotFound(_0x53f58f,null))['then'](saveUpdates(_0x50365e['body'],null))[_0x1cde('0x23')](respondWithResult(_0x53f58f,null))[_0x1cde('0x46')](handleError(_0x53f58f,null));};exports[_0x1cde('0x22')]=function(_0x15a017,_0x598344){return db[_0x1cde('0x41')]['find']({'where':{'id':_0x15a017['params']['id']}})['then'](handleEntityNotFound(_0x598344,null))[_0x1cde('0x23')](removeEntity(_0x598344,null))[_0x1cde('0x46')](handleError(_0x598344,null));};
\ No newline at end of file
index 14ca140..aa7ed70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bc0=['bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','../../config/logger','api','moment'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7bc0,0x1dc));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07bc('0x0'));var logger=require(_0x07bc('0x1'))(_0x07bc('0x2'));var moment=require(_0x07bc('0x3'));var BPromise=require(_0x07bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07bc('0x5'));var rimraf=require(_0x07bc('0x6'));var config=require(_0x07bc('0x7'));var attributes=require(_0x07bc('0x8'));module[_0x07bc('0x9')]=function(_0x2b7b1d,_0x3a1bed){return _0x2b7b1d[_0x07bc('0xa')](_0x07bc('0xb'),attributes,{'tableName':_0x07bc('0xc'),'paranoid':![],'indexes':[{'name':_0x07bc('0xd'),'fields':['idField',_0x07bc('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6706=['moment','bluebird','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','util','api'];(function(_0x21039e,_0x2170c9){var _0x143612=function(_0x30e30e){while(--_0x30e30e){_0x21039e['push'](_0x21039e['shift']());}};_0x143612(++_0x2170c9);}(_0x6706,0x136));var _0x6670=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6706[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6670('0x0'));var logger=require('../../config/logger')(_0x6670('0x1'));var moment=require(_0x6670('0x2'));var BPromise=require(_0x6670('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6670('0x4'));var config=require(_0x6670('0x5'));var attributes=require(_0x6670('0x6'));module[_0x6670('0x7')]=function(_0x5c8074,_0x53b9be){return _0x5c8074[_0x6670('0x8')](_0x6670('0x9'),attributes,{'tableName':_0x6670('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x6670('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index cda370d..11030dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed17=['../../config/logger','rpc','../../config/environment','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x109618,_0x4f46f9){var _0x42665f=function(_0x4f38ee){while(--_0x4f38ee){_0x109618['push'](_0x109618['shift']());}};_0x42665f(++_0x4f46f9);}(_0xed17,0x186));var _0x7ed1=function(_0x4cdf87,_0x200caf){_0x4cdf87=_0x4cdf87-0x0;var _0x14d49d=_0xed17[_0x4cdf87];return _0x14d49d;};'use strict';var _=require('lodash');var util=require(_0x7ed1('0x0'));var moment=require(_0x7ed1('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ed1('0x2'));var fs=require('fs');var Redis=require(_0x7ed1('0x3'));var db=require(_0x7ed1('0x4'))['db'];var utils=require(_0x7ed1('0x5'));var logger=require(_0x7ed1('0x6'))(_0x7ed1('0x7'));var config=require(_0x7ed1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7ed1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe7df60,_0x440ef8,_0x4c4ee0){return new BPromise(function(_0x179f27,_0x3521be){return client[_0x7ed1('0xa')](_0xe7df60,_0x4c4ee0)[_0x7ed1('0xb')](function(_0x599e03){logger[_0x7ed1('0xc')](_0x7ed1('0xd'),_0x440ef8,'request\x20sent');logger[_0x7ed1('0xe')](_0x7ed1('0xf'),_0x440ef8,_0x7ed1('0x10'),JSON[_0x7ed1('0x11')](_0x599e03));if(_0x599e03[_0x7ed1('0x12')]){if(_0x599e03[_0x7ed1('0x12')][_0x7ed1('0x13')]===0x1f4){logger[_0x7ed1('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x440ef8,_0x599e03['error'][_0x7ed1('0x14')]);return _0x3521be(_0x599e03[_0x7ed1('0x12')][_0x7ed1('0x14')]);}logger[_0x7ed1('0x12')](_0x7ed1('0xd'),_0x440ef8,_0x599e03[_0x7ed1('0x12')][_0x7ed1('0x14')]);return _0x179f27(_0x599e03[_0x7ed1('0x12')][_0x7ed1('0x14')]);}else{logger[_0x7ed1('0xc')](_0x7ed1('0xd'),_0x440ef8,_0x7ed1('0x10'));_0x179f27(_0x599e03[_0x7ed1('0x15')][_0x7ed1('0x14')]);}})['catch'](function(_0x444be7){logger[_0x7ed1('0x12')](_0x7ed1('0xd'),_0x440ef8,_0x444be7);_0x3521be(_0x444be7);});});}
\ No newline at end of file
+var _0x11ec=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','SugarcrmField,\x20%s,\x20%s','error','message'];(function(_0x4f36be,_0x3a46ce){var _0x4995f0=function(_0x192a20){while(--_0x192a20){_0x4f36be['push'](_0x4f36be['shift']());}};_0x4995f0(++_0x3a46ce);}(_0x11ec,0x7a));var _0xc11e=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x11ec[_0x528497];return _0x392d59;};'use strict';var _=require(_0xc11e('0x0'));var util=require(_0xc11e('0x1'));var moment=require(_0xc11e('0x2'));var BPromise=require(_0xc11e('0x3'));var rs=require(_0xc11e('0x4'));var fs=require('fs');var Redis=require(_0xc11e('0x5'));var db=require(_0xc11e('0x6'))['db'];var utils=require(_0xc11e('0x7'));var logger=require('../../config/logger')(_0xc11e('0x8'));var config=require(_0xc11e('0x9'));var jayson=require(_0xc11e('0xa'));var client=jayson[_0xc11e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20af03,_0x5aed96,_0x59d64d){return new BPromise(function(_0x2ff488,_0x456128){return client[_0xc11e('0xc')](_0x20af03,_0x59d64d)['then'](function(_0x5e3cc2){logger[_0xc11e('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x5aed96,_0xc11e('0xe'));logger[_0xc11e('0xf')](_0xc11e('0x10'),_0x5aed96,'request\x20sent',JSON[_0xc11e('0x11')](_0x5e3cc2));if(_0x5e3cc2['error']){if(_0x5e3cc2['error'][_0xc11e('0x12')]===0x1f4){logger['error'](_0xc11e('0x13'),_0x5aed96,_0x5e3cc2[_0xc11e('0x14')]['message']);return _0x456128(_0x5e3cc2['error']['message']);}logger[_0xc11e('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x5aed96,_0x5e3cc2['error'][_0xc11e('0x15')]);return _0x2ff488(_0x5e3cc2[_0xc11e('0x14')][_0xc11e('0x15')]);}else{logger[_0xc11e('0xd')](_0xc11e('0x13'),_0x5aed96,_0xc11e('0xe'));_0x2ff488(_0x5e3cc2[_0xc11e('0x16')][_0xc11e('0x15')]);}})[_0xc11e('0x17')](function(_0x289cd9){logger['error'](_0xc11e('0x13'),_0x5aed96,_0x289cd9);_0x456128(_0x289cd9);});});}
\ No newline at end of file
index ea438a2..56eb824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc737=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration'];(function(_0x39e3e,_0x138954){var _0x398829=function(_0x5d8461){while(--_0x5d8461){_0x39e3e['push'](_0x39e3e['shift']());}};_0x398829(++_0x138954);}(_0xc737,0x8e));var _0x7c73=function(_0x26f616,_0x3e8f08){_0x26f616=_0x26f616-0x0;var _0x298682=_0xc737[_0x26f616];return _0x298682;};'use strict';var multer=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var path=require('path');var timeout=require(_0x7c73('0x2'));var express=require(_0x7c73('0x3'));var router=express[_0x7c73('0x4')]();var fs_extra=require(_0x7c73('0x5'));var auth=require(_0x7c73('0x6'));var interaction=require(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x7c73('0x9')](),controller[_0x7c73('0xa')]);router[_0x7c73('0xb')](_0x7c73('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x7c73('0xd')]);router[_0x7c73('0xb')](_0x7c73('0xe'),auth[_0x7c73('0x9')](),controller['getFields']);router[_0x7c73('0xf')]('/',auth['isAuthenticated'](),controller[_0x7c73('0x10')]);router[_0x7c73('0xf')](_0x7c73('0x11'),auth['isAuthenticated'](),controller[_0x7c73('0x12')]);router[_0x7c73('0x13')](_0x7c73('0xc'),auth[_0x7c73('0x9')](),controller[_0x7c73('0x14')]);router[_0x7c73('0x15')](_0x7c73('0xc'),auth[_0x7c73('0x9')](),controller['destroy']);module[_0x7c73('0x16')]=router;
\ No newline at end of file
+var _0x4499=['isAuthenticated','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','index','get','/:id'];(function(_0x553bc8,_0x481382){var _0xc45407=function(_0x1831ac){while(--_0x1831ac){_0x553bc8['push'](_0x553bc8['shift']());}};_0xc45407(++_0x481382);}(_0x4499,0x145));var _0x9449=function(_0x248afa,_0xc057df){_0x248afa=_0x248afa-0x0;var _0x26d2d2=_0x4499[_0x248afa];return _0x26d2d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9449('0x0'));var timeout=require(_0x9449('0x1'));var express=require(_0x9449('0x2'));var router=express[_0x9449('0x3')]();var fs_extra=require(_0x9449('0x4'));var auth=require(_0x9449('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9449('0x6'));var controller=require(_0x9449('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9449('0x8')]);router[_0x9449('0x9')](_0x9449('0xa'),auth[_0x9449('0xb')](),controller[_0x9449('0xc')]);router[_0x9449('0x9')]('/:id/configurations',auth[_0x9449('0xb')](),controller[_0x9449('0xd')]);router[_0x9449('0x9')](_0x9449('0xe'),auth[_0x9449('0xb')](),controller['getFields']);router[_0x9449('0xf')]('/',auth[_0x9449('0xb')](),controller[_0x9449('0x10')]);router['post'](_0x9449('0x11'),auth[_0x9449('0xb')](),controller[_0x9449('0x12')]);router[_0x9449('0x13')](_0x9449('0xa'),auth[_0x9449('0xb')](),controller[_0x9449('0x14')]);router[_0x9449('0x15')](_0x9449('0xa'),auth[_0x9449('0xb')](),controller[_0x9449('0x16')]);module[_0x9449('0x17')]=router;
\ No newline at end of file
index 63df00a..0bf0b3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b7=['STRING','sequelize','exports'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x21b7,0x7c));var _0x721b=function(_0x468097,_0x21f0fc){_0x468097=_0x468097-0x0;var _0x1fd8d1=_0x21b7[_0x468097];return _0x1fd8d1;};'use strict';var Sequelize=require(_0x721b('0x0'));module[_0x721b('0x1')]={'name':{'type':Sequelize[_0x721b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x721b('0x2')]},'username':{'type':Sequelize[_0x721b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x721b('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x721b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x721b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x721b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa694=['STRING','HelpDesk','sequelize','exports'];(function(_0xc2da6d,_0x5439ab){var _0x593375=function(_0x1baad9){while(--_0x1baad9){_0xc2da6d['push'](_0xc2da6d['shift']());}};_0x593375(++_0x5439ab);}(_0xa694,0x86));var _0x4a69=function(_0x50a509,_0x3ef792){_0x50a509=_0x50a509-0x0;var _0xff22c2=_0xa694[_0x50a509];return _0xff22c2;};'use strict';var Sequelize=require(_0x4a69('0x0'));module[_0x4a69('0x1')]={'name':{'type':Sequelize[_0x4a69('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4a69('0x2')]},'username':{'type':Sequelize[_0x4a69('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a69('0x3')},'remoteUri':{'type':Sequelize[_0x4a69('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4a69('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index d571c7f..8860e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc62a=['login','result','token','sessionName','autogenerated','reference','owner','remove','editable','false','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../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','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','then','includeAll','VtigerAccount','findAll','rows','catch','show','params','fields','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success'];(function(_0x4d65ee,_0x2ae591){var _0x3601f2=function(_0x3c00af){while(--_0x3c00af){_0x4d65ee['push'](_0x4d65ee['shift']());}};_0x3601f2(++_0x2ae591);}(_0xc62a,0x18e));var _0xac62=function(_0x57a390,_0x836740){_0x57a390=_0x57a390-0x0;var _0x38d2f7=_0xc62a[_0x57a390];return _0x38d2f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac62('0x0'));var jsonpatch=require(_0xac62('0x1'));var rp=require(_0xac62('0x2'));var moment=require(_0xac62('0x3'));var BPromise=require(_0xac62('0x4'));var Mustache=require('mustache');var util=require(_0xac62('0x5'));var path=require(_0xac62('0x6'));var sox=require(_0xac62('0x7'));var csv=require(_0xac62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac62('0x9'));var _=require(_0xac62('0xa'));var squel=require(_0xac62('0xb'));var crypto=require(_0xac62('0xc'));var jsforce=require(_0xac62('0xd'));var deskjs=require(_0xac62('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac62('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac62('0x10'));var as=require(_0xac62('0x11'));var hardwareService=require(_0xac62('0x12'));var logger=require(_0xac62('0x13'))(_0xac62('0x14'));var utils=require(_0xac62('0x15'));var config=require(_0xac62('0x16'));var licenseUtil=require(_0xac62('0x17'));var db=require(_0xac62('0x18'))['db'];var integrations=require(_0xac62('0x19'));function respondWithStatusCode(_0x4c3fe5,_0x59c1db){_0x59c1db=_0x59c1db||0xcc;return function(_0x4e25e0){if(_0x4e25e0){return _0x4c3fe5[_0xac62('0x1a')](_0x59c1db);}return _0x4c3fe5['status'](_0x59c1db)[_0xac62('0x1b')]();};}function respondWithResult(_0x542c49,_0x5e71ff){_0x5e71ff=_0x5e71ff||0xc8;return function(_0x1e75f4){if(_0x1e75f4){return _0x542c49[_0xac62('0x1c')](_0x5e71ff)[_0xac62('0x1d')](_0x1e75f4);}};}function respondWithFilteredResult(_0x55f7c2,_0x3a2ad9){return function(_0x52f105){if(_0x52f105){var _0x377ecb=typeof _0x3a2ad9[_0xac62('0x1e')]===_0xac62('0x1f')&&typeof _0x3a2ad9[_0xac62('0x20')]==='undefined';var _0xc0c677=_0x52f105[_0xac62('0x21')];var _0x2a7ccb=_0x377ecb?0x0:_0x3a2ad9[_0xac62('0x1e')];var _0x48d1a8=_0x377ecb?_0x52f105[_0xac62('0x21')]:_0x3a2ad9['offset']+_0x3a2ad9['limit'];var _0x33393d;if(_0x48d1a8>=_0xc0c677){_0x48d1a8=_0xc0c677;_0x33393d=0xc8;}else{_0x33393d=0xce;}_0x55f7c2[_0xac62('0x1c')](_0x33393d);return _0x55f7c2[_0xac62('0x22')](_0xac62('0x23'),_0x2a7ccb+'-'+_0x48d1a8+'/'+_0xc0c677)['json'](_0x52f105);}return null;};}function patchUpdates(_0x485584){return function(_0x17c3f6){try{jsonpatch[_0xac62('0x24')](_0x17c3f6,_0x485584,!![]);}catch(_0x1f89ca){return BPromise[_0xac62('0x25')](_0x1f89ca);}return _0x17c3f6[_0xac62('0x26')]();};}function saveUpdates(_0x5b86d2,_0x5bebda){return function(_0x16ed7f){if(_0x16ed7f){return _0x16ed7f[_0xac62('0x27')](_0x5b86d2)['then'](function(_0x19a8c5){return _0x19a8c5;});}return null;};}function removeEntity(_0xf8f421,_0xde595e){return function(_0x95d6a9){if(_0x95d6a9){return _0x95d6a9[_0xac62('0x28')]()['then'](function(){_0xf8f421[_0xac62('0x1c')](0xcc)[_0xac62('0x1b')]();});}};}function handleEntityNotFound(_0x136118,_0x7cb3fd){return function(_0x4dac00){if(!_0x4dac00){_0x136118['sendStatus'](0x194);}return _0x4dac00;};}function handleError(_0x375c75,_0x36feba){_0x36feba=_0x36feba||0x1f4;return function(_0xa1696e){logger[_0xac62('0x29')](_0xa1696e[_0xac62('0x2a')]);if(_0xa1696e[_0xac62('0x2b')]){delete _0xa1696e[_0xac62('0x2b')];}_0x375c75['status'](_0x36feba)[_0xac62('0x2c')](_0xa1696e);};}exports[_0xac62('0x2d')]=function(_0x1e5157,_0x47030c){var _0xea630f={},_0x310512={},_0x293c22={'count':0x0,'rows':[]};var _0x780449=_['map'](db['VtigerAccount'][_0xac62('0x2e')],function(_0x188cba){return{'name':_0x188cba[_0xac62('0x2f')],'type':_0x188cba['type'][_0xac62('0x30')]};});_0x310512[_0xac62('0x31')]=_[_0xac62('0x32')](_0x780449,'name');_0x310512[_0xac62('0x33')]=_[_0xac62('0x34')](_0x1e5157[_0xac62('0x33')]);_0x310512[_0xac62('0x35')]=_[_0xac62('0x36')](_0x310512['model'],_0x310512[_0xac62('0x33')]);_0xea630f[_0xac62('0x37')]=_['intersection'](_0x310512['model'],qs['fields'](_0x1e5157['query']['fields']));_0xea630f[_0xac62('0x37')]=_0xea630f[_0xac62('0x37')][_0xac62('0x38')]?_0xea630f[_0xac62('0x37')]:_0x310512['model'];if(!_0x1e5157[_0xac62('0x33')][_0xac62('0x39')]('nolimit')){_0xea630f[_0xac62('0x20')]=qs[_0xac62('0x20')](_0x1e5157[_0xac62('0x33')][_0xac62('0x20')]);_0xea630f[_0xac62('0x1e')]=qs[_0xac62('0x1e')](_0x1e5157[_0xac62('0x33')]['offset']);}_0xea630f[_0xac62('0x3a')]=qs['sort'](_0x1e5157[_0xac62('0x33')][_0xac62('0x3b')]);_0xea630f['where']=qs[_0xac62('0x35')](_['pick'](_0x1e5157[_0xac62('0x33')],_0x310512[_0xac62('0x35')]),_0x780449);if(_0x1e5157['query']['filter']){_0xea630f[_0xac62('0x3c')]=_[_0xac62('0x3d')](_0xea630f[_0xac62('0x3c')],{'$or':_['map'](_0x780449,function(_0xe8a3aa){if(_0xe8a3aa[_0xac62('0x3e')]!==_0xac62('0x3f')){var _0x16add3={};_0x16add3[_0xe8a3aa[_0xac62('0x2b')]]={'$like':'%'+_0x1e5157[_0xac62('0x33')][_0xac62('0x40')]+'%'};return _0x16add3;}})});}_0xea630f=_[_0xac62('0x3d')]({},_0xea630f,_0x1e5157[_0xac62('0x41')]);var _0x46d3b7={'where':_0xea630f[_0xac62('0x3c')]};return db['VtigerAccount'][_0xac62('0x21')](_0x46d3b7)[_0xac62('0x42')](function(_0x16d239){_0x293c22[_0xac62('0x21')]=_0x16d239;if(_0x1e5157['query'][_0xac62('0x43')]){_0xea630f['include']=[{'all':!![]}];}return db[_0xac62('0x44')][_0xac62('0x45')](_0xea630f);})[_0xac62('0x42')](function(_0x39338c){_0x293c22[_0xac62('0x46')]=_0x39338c;return _0x293c22;})[_0xac62('0x42')](respondWithFilteredResult(_0x47030c,_0xea630f))[_0xac62('0x47')](handleError(_0x47030c,null));};exports[_0xac62('0x48')]=function(_0x228589,_0x4a74aa){var _0x1ebc7c={'raw':![],'where':{'id':_0x228589[_0xac62('0x49')]['id']}},_0x26908d={};_0x26908d[_0xac62('0x31')]=_[_0xac62('0x34')](db['VtigerAccount'][_0xac62('0x2e')]);_0x26908d[_0xac62('0x33')]=_[_0xac62('0x34')](_0x228589['query']);_0x26908d['filters']=_[_0xac62('0x36')](_0x26908d['model'],_0x26908d[_0xac62('0x33')]);_0x1ebc7c[_0xac62('0x37')]=_['intersection'](_0x26908d[_0xac62('0x31')],qs[_0xac62('0x4a')](_0x228589[_0xac62('0x33')]['fields']));_0x1ebc7c['attributes']=_0x1ebc7c[_0xac62('0x37')][_0xac62('0x38')]?_0x1ebc7c['attributes']:_0x26908d['model'];if(_0x228589[_0xac62('0x33')]['includeAll']){_0x1ebc7c[_0xac62('0x4b')]=[{'all':!![]}];}_0x1ebc7c=_[_0xac62('0x3d')]({},_0x1ebc7c,_0x228589[_0xac62('0x41')]);return db[_0xac62('0x44')][_0xac62('0x4c')](_0x1ebc7c)['then'](handleEntityNotFound(_0x4a74aa,null))['then'](respondWithResult(_0x4a74aa,null))[_0xac62('0x47')](handleError(_0x4a74aa,null));};exports['create']=function(_0x45fe7e,_0x322a71){return db[_0xac62('0x44')][_0xac62('0x4d')](_0x45fe7e[_0xac62('0x4e')],{})[_0xac62('0x42')](respondWithResult(_0x322a71,0xc9))[_0xac62('0x47')](handleError(_0x322a71,null));};exports[_0xac62('0x27')]=function(_0x3b8a0c,_0x2e3539){if(_0x3b8a0c[_0xac62('0x4e')]['id']){delete _0x3b8a0c['body']['id'];}return db[_0xac62('0x44')][_0xac62('0x4c')]({'where':{'id':_0x3b8a0c[_0xac62('0x49')]['id']}})[_0xac62('0x42')](handleEntityNotFound(_0x2e3539,null))[_0xac62('0x42')](saveUpdates(_0x3b8a0c['body'],null))[_0xac62('0x42')](respondWithResult(_0x2e3539,null))[_0xac62('0x47')](handleError(_0x2e3539,null));};exports[_0xac62('0x28')]=function(_0x563707,_0x3cc64f){return db['VtigerAccount'][_0xac62('0x4c')]({'where':{'id':_0x563707[_0xac62('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cc64f,null))[_0xac62('0x42')](removeEntity(_0x3cc64f,null))[_0xac62('0x47')](handleError(_0x3cc64f,null));};exports[_0xac62('0x4f')]=function(_0x1efa09,_0x56cbd1,_0x2f74fd){var _0x432e2f={};var _0x3d8366={};var _0x1221e6;var _0x30435a;return db[_0xac62('0x44')][_0xac62('0x50')]({'where':{'id':_0x1efa09[_0xac62('0x49')]['id']}})[_0xac62('0x42')](handleEntityNotFound(_0x56cbd1,null))['then'](function(_0x1087fb){if(_0x1087fb){_0x1221e6=_0x1087fb;_0x3d8366[_0xac62('0x31')]=_[_0xac62('0x34')](db[_0xac62('0x51')]['rawAttributes']);_0x3d8366[_0xac62('0x33')]=_[_0xac62('0x34')](_0x1efa09[_0xac62('0x33')]);_0x3d8366['filters']=_['intersection'](_0x3d8366[_0xac62('0x31')],_0x3d8366[_0xac62('0x33')]);_0x432e2f[_0xac62('0x37')]=_['intersection'](_0x3d8366[_0xac62('0x31')],qs[_0xac62('0x4a')](_0x1efa09['query'][_0xac62('0x4a')]));_0x432e2f[_0xac62('0x37')]=_0x432e2f[_0xac62('0x37')][_0xac62('0x38')]?_0x432e2f['attributes']:_0x3d8366[_0xac62('0x31')];_0x432e2f[_0xac62('0x3a')]=qs['sort'](_0x1efa09[_0xac62('0x33')]['sort']);_0x432e2f[_0xac62('0x3c')]=qs[_0xac62('0x35')](_[_0xac62('0x52')](_0x1efa09[_0xac62('0x33')],_0x3d8366[_0xac62('0x35')]));if(_0x1efa09[_0xac62('0x33')][_0xac62('0x40')]){_0x432e2f[_0xac62('0x3c')]=_[_0xac62('0x3d')](_0x432e2f[_0xac62('0x3c')],{'$or':_[_0xac62('0x32')](_0x432e2f['attributes'],function(_0x2767dc){var _0x523964={};_0x523964[_0x2767dc]={'$like':'%'+_0x1efa09[_0xac62('0x33')][_0xac62('0x40')]+'%'};return _0x523964;})});}_0x432e2f=_['merge']({},_0x432e2f,_0x1efa09['options']);return _0x1221e6[_0xac62('0x4f')](_0x432e2f);}})[_0xac62('0x42')](function(_0x3f8a9f){if(_0x3f8a9f){_0x30435a=_0x3f8a9f[_0xac62('0x38')];if(!_0x1efa09['query']['hasOwnProperty'](_0xac62('0x53'))){_0x432e2f[_0xac62('0x20')]=qs[_0xac62('0x20')](_0x1efa09[_0xac62('0x33')]['limit']);_0x432e2f[_0xac62('0x1e')]=qs[_0xac62('0x1e')](_0x1efa09[_0xac62('0x33')]['offset']);}return _0x1221e6['getConfigurations'](_0x432e2f);}})[_0xac62('0x42')](function(_0x52d4d4){if(_0x52d4d4){return _0x52d4d4?{'count':_0x30435a,'rows':_0x52d4d4}:null;}})[_0xac62('0x42')](respondWithResult(_0x56cbd1,null))['catch'](handleError(_0x56cbd1,null));};exports['addConfiguration']=function(_0x2ee144,_0xfad605,_0x4ff32c){if(_0x2ee144['body']['id']){delete _0x2ee144[_0xac62('0x4e')]['id'];}return db[_0xac62('0x44')][_0xac62('0x50')]({'where':{'id':_0x2ee144[_0xac62('0x49')]['id']}})[_0xac62('0x42')](handleEntityNotFound(_0xfad605,null))['then'](function(_0x1653db){if(_0x1653db){_0x2ee144[_0xac62('0x4e')][_0xac62('0x54')]=_0x1653db['id'];_0x2ee144['body'][_0xac62('0x55')]=integrations[_0xac62('0x56')](_0x2ee144[_0xac62('0x4e')][_0xac62('0x57')],_0x2ee144[_0xac62('0x4e')][_0xac62('0x3e')]);_0x2ee144['body'][_0xac62('0x58')]=integrations[_0xac62('0x59')](_0x2ee144['body'][_0xac62('0x57')],_0x2ee144['body']['type']);return db['VtigerConfiguration'][_0xac62('0x4d')](_0x2ee144[_0xac62('0x4e')],{'include':[{'model':db[_0xac62('0x5a')],'as':_0xac62('0x55')},{'model':db['VtigerField'],'as':_0xac62('0x58')}]});}return null;})[_0xac62('0x42')](respondWithResult(_0xfad605,null))[_0xac62('0x47')](handleError(_0xfad605,null));};var md5=require(_0xac62('0x5b'));exports[_0xac62('0x5c')]=function(_0x445425,_0x395b4d,_0x3d900a){var _0x4406d9=null;var _0x18ab84=null;var _0x3bcea3=null;var _0x16a7f1=null;var _0x119ca3='';return db[_0xac62('0x44')]['findOne']({'where':{'id':_0x445425[_0xac62('0x49')]['id']},'attributes':['id',_0xac62('0x2b'),_0xac62('0x5d'),_0xac62('0x5e'),_0xac62('0x5f'),_0xac62('0x60'),_0xac62('0x61'),_0xac62('0x62')]})['then'](handleEntityNotFound(_0x395b4d,null))['then'](function(_0x3e7d95){if(_0x3e7d95){_0x4406d9=_0x3e7d95[_0xac62('0x5d')];_0x18ab84=_0x3e7d95[_0xac62('0x62')];_0x3bcea3=_0x3e7d95['moduleName'];_0x119ca3=_0x3e7d95[_0xac62('0x60')];var _0x580727=_0x119ca3[_0xac62('0x63')](-0x1);if(_0x580727==='/'){_0x119ca3=_0x119ca3[_0xac62('0x64')](0x0,_0x119ca3[_0xac62('0x65')](_0x580727));}_0x16a7f1=util[_0xac62('0x66')]('%s/webservice.php',_0x119ca3);var _0x3871c5={'method':_0xac62('0x67'),'uri':_0x16a7f1,'qs':{'operation':_0xac62('0x68'),'username':_0x3e7d95[_0xac62('0x5d')]},'json':!![]};return rp(_0x3871c5);}})[_0xac62('0x42')](function(_0x2d8d9b){if(_0x2d8d9b[_0xac62('0x69')]){var _0x21e0dd={'method':'POST','uri':_0x16a7f1,'form':{'operation':_0xac62('0x6a'),'username':_0x4406d9,'accessKey':md5(_0x2d8d9b[_0xac62('0x6b')][_0xac62('0x6c')]+_0x18ab84)},'json':!![]};return rp(_0x21e0dd);}})[_0xac62('0x42')](function(_0x3b2f45){if(_0x3b2f45[_0xac62('0x69')]){var _0x1f1346={'method':_0xac62('0x67'),'uri':_0x16a7f1,'qs':{'operation':'describe','username':_0x4406d9,'sessionName':_0x3b2f45[_0xac62('0x6b')][_0xac62('0x6d')],'elementType':_0x3bcea3},'json':!![]};return rp(_0x1f1346);}})[_0xac62('0x42')](function(_0x207874){if(_0x207874[_0xac62('0x69')]){var _0x5bf448=[_0xac62('0x6e'),_0xac62('0x6f'),_0xac62('0x70')];_[_0xac62('0x71')](_0x207874[_0xac62('0x6b')]['fields'],function(_0x46209a){return _0x5bf448['includes'](_0x46209a[_0xac62('0x3e')][_0xac62('0x2b')]);});_[_0xac62('0x71')](_0x207874['result'][_0xac62('0x4a')],function(_0x5b9aee){return _0x5b9aee[_0xac62('0x72')]===_0xac62('0x73');});return{'count':_0x207874['result']['fields'][_0xac62('0x38')],'rows':_[_0xac62('0x32')](_0x207874[_0xac62('0x6b')][_0xac62('0x4a')],function(_0x4770b6){return{'id':_0x4770b6['name'],'name':_0x4770b6['label'],'custom':_[_0xac62('0x74')](_0x4770b6[_0xac62('0x2b')],'cf_')?!![]:![],'options':_0x4770b6[_0xac62('0x3e')][_0xac62('0x2b')]===_0xac62('0x75')&&_0x4770b6['type'][_0xac62('0x76')][_0xac62('0x38')]>0x0?_[_0xac62('0x32')](_0x4770b6[_0xac62('0x3e')][_0xac62('0x76')],function(_0x14eb2c){return{'name':_0x14eb2c['label'],'value':_0x14eb2c[_0xac62('0x77')]};}):[]};})};}})['then'](respondWithResult(_0x395b4d,null))['catch'](function(_0x2ec6fc){console[_0xac62('0x78')](_0xac62('0x79')+_0x2ec6fc);var _0x4cfeb5=_0x445425[_0xac62('0x33')][_0xac62('0x7a')]?0x1f4:_0x2ec6fc[_0xac62('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xac62('0x5c'),_0x4cfeb5,JSON[_0xac62('0x7c')](_0x2ec6fc));delete _0x2ec6fc[_0xac62('0x2b')];if(_0x4cfeb5===0x191){_0x4cfeb5=0x190;}_0x395b4d['status'](_0x4cfeb5)['send'](_0x445425[_0xac62('0x33')][_0xac62('0x7a')]?{'message':_0xac62('0x7d'),'statusCode':_0x2ec6fc[_0xac62('0x7b')]}:_0x2ec6fc);});};
\ No newline at end of file
+var _0x64bc=['editable','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','stringify','statusCode','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','findOne','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','VtigerField','Subjects','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','POST','login','result','token','success','autogenerated','owner','remove'];(function(_0x4f358f,_0x1d71be){var _0x410114=function(_0x406689){while(--_0x406689){_0x4f358f['push'](_0x4f358f['shift']());}};_0x410114(++_0x1d71be);}(_0x64bc,0x1ef));var _0xc64b=function(_0x2a40b3,_0xe1c253){_0x2a40b3=_0x2a40b3-0x0;var _0x4ac6cb=_0x64bc[_0x2a40b3];return _0x4ac6cb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc64b('0x0'));var jsonpatch=require(_0xc64b('0x1'));var rp=require('request-promise');var moment=require(_0xc64b('0x2'));var BPromise=require(_0xc64b('0x3'));var Mustache=require('mustache');var util=require(_0xc64b('0x4'));var path=require(_0xc64b('0x5'));var sox=require(_0xc64b('0x6'));var csv=require('to-csv');var ejs=require(_0xc64b('0x7'));var fs=require('fs');var fs_extra=require(_0xc64b('0x8'));var _=require(_0xc64b('0x9'));var squel=require(_0xc64b('0xa'));var crypto=require(_0xc64b('0xb'));var jsforce=require(_0xc64b('0xc'));var deskjs=require(_0xc64b('0xd'));var toCsv=require(_0xc64b('0xe'));var querystring=require(_0xc64b('0xf'));var Papa=require(_0xc64b('0x10'));var Redis=require(_0xc64b('0x11'));var authService=require(_0xc64b('0x12'));var qs=require(_0xc64b('0x13'));var as=require(_0xc64b('0x14'));var hardwareService=require(_0xc64b('0x15'));var logger=require(_0xc64b('0x16'))(_0xc64b('0x17'));var utils=require(_0xc64b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc64b('0x19'))['db'];var integrations=require(_0xc64b('0x1a'));function respondWithStatusCode(_0x2985a7,_0x1444a4){_0x1444a4=_0x1444a4||0xcc;return function(_0xb3275c){if(_0xb3275c){return _0x2985a7[_0xc64b('0x1b')](_0x1444a4);}return _0x2985a7[_0xc64b('0x1c')](_0x1444a4)['end']();};}function respondWithResult(_0xc9c398,_0x3fab00){_0x3fab00=_0x3fab00||0xc8;return function(_0x27e42f){if(_0x27e42f){return _0xc9c398['status'](_0x3fab00)['json'](_0x27e42f);}};}function respondWithFilteredResult(_0x20c368,_0x55a309){return function(_0x49c3e2){if(_0x49c3e2){var _0x5bbfc2=typeof _0x55a309[_0xc64b('0x1d')]==='undefined'&&typeof _0x55a309[_0xc64b('0x1e')]===_0xc64b('0x1f');var _0x3e698d=_0x49c3e2['count'];var _0x3926d1=_0x5bbfc2?0x0:_0x55a309[_0xc64b('0x1d')];var _0x5409b8=_0x5bbfc2?_0x49c3e2[_0xc64b('0x20')]:_0x55a309[_0xc64b('0x1d')]+_0x55a309['limit'];var _0x5b6c83;if(_0x5409b8>=_0x3e698d){_0x5409b8=_0x3e698d;_0x5b6c83=0xc8;}else{_0x5b6c83=0xce;}_0x20c368[_0xc64b('0x1c')](_0x5b6c83);return _0x20c368[_0xc64b('0x21')](_0xc64b('0x22'),_0x3926d1+'-'+_0x5409b8+'/'+_0x3e698d)[_0xc64b('0x23')](_0x49c3e2);}return null;};}function patchUpdates(_0x4af2c5){return function(_0x283b53){try{jsonpatch[_0xc64b('0x24')](_0x283b53,_0x4af2c5,!![]);}catch(_0x5a628d){return BPromise[_0xc64b('0x25')](_0x5a628d);}return _0x283b53[_0xc64b('0x26')]();};}function saveUpdates(_0x4a7ce6,_0x4087e5){return function(_0x38e91a){if(_0x38e91a){return _0x38e91a[_0xc64b('0x27')](_0x4a7ce6)[_0xc64b('0x28')](function(_0x414ced){return _0x414ced;});}return null;};}function removeEntity(_0x37cfad,_0x4c47ae){return function(_0x2c486a){if(_0x2c486a){return _0x2c486a[_0xc64b('0x29')]()[_0xc64b('0x28')](function(){_0x37cfad[_0xc64b('0x1c')](0xcc)[_0xc64b('0x2a')]();});}};}function handleEntityNotFound(_0x4d9489,_0x3196c3){return function(_0x130cde){if(!_0x130cde){_0x4d9489['sendStatus'](0x194);}return _0x130cde;};}function handleError(_0x229c27,_0x1bf43a){_0x1bf43a=_0x1bf43a||0x1f4;return function(_0x48da96){logger[_0xc64b('0x2b')](_0x48da96['stack']);if(_0x48da96[_0xc64b('0x2c')]){delete _0x48da96[_0xc64b('0x2c')];}_0x229c27[_0xc64b('0x1c')](_0x1bf43a)[_0xc64b('0x2d')](_0x48da96);};}exports['index']=function(_0x5add91,_0x4f670e){var _0x5447d8={},_0x3737ca={},_0x12f45e={'count':0x0,'rows':[]};var _0xba0f77=_[_0xc64b('0x2e')](db[_0xc64b('0x2f')][_0xc64b('0x30')],function(_0x34faf2){return{'name':_0x34faf2[_0xc64b('0x31')],'type':_0x34faf2[_0xc64b('0x32')][_0xc64b('0x33')]};});_0x3737ca['model']=_['map'](_0xba0f77,_0xc64b('0x2c'));_0x3737ca[_0xc64b('0x34')]=_[_0xc64b('0x35')](_0x5add91[_0xc64b('0x34')]);_0x3737ca[_0xc64b('0x36')]=_[_0xc64b('0x37')](_0x3737ca['model'],_0x3737ca[_0xc64b('0x34')]);_0x5447d8[_0xc64b('0x38')]=_[_0xc64b('0x37')](_0x3737ca[_0xc64b('0x39')],qs['fields'](_0x5add91[_0xc64b('0x34')]['fields']));_0x5447d8[_0xc64b('0x38')]=_0x5447d8[_0xc64b('0x38')]['length']?_0x5447d8[_0xc64b('0x38')]:_0x3737ca[_0xc64b('0x39')];if(!_0x5add91[_0xc64b('0x34')]['hasOwnProperty'](_0xc64b('0x3a'))){_0x5447d8['limit']=qs[_0xc64b('0x1e')](_0x5add91[_0xc64b('0x34')][_0xc64b('0x1e')]);_0x5447d8[_0xc64b('0x1d')]=qs[_0xc64b('0x1d')](_0x5add91[_0xc64b('0x34')][_0xc64b('0x1d')]);}_0x5447d8[_0xc64b('0x3b')]=qs['sort'](_0x5add91[_0xc64b('0x34')][_0xc64b('0x3c')]);_0x5447d8[_0xc64b('0x3d')]=qs[_0xc64b('0x36')](_[_0xc64b('0x3e')](_0x5add91[_0xc64b('0x34')],_0x3737ca[_0xc64b('0x36')]),_0xba0f77);if(_0x5add91['query'][_0xc64b('0x3f')]){_0x5447d8[_0xc64b('0x3d')]=_['merge'](_0x5447d8[_0xc64b('0x3d')],{'$or':_['map'](_0xba0f77,function(_0xf10e9a){if(_0xf10e9a['type']!==_0xc64b('0x40')){var _0x3af998={};_0x3af998[_0xf10e9a[_0xc64b('0x2c')]]={'$like':'%'+_0x5add91['query'][_0xc64b('0x3f')]+'%'};return _0x3af998;}})});}_0x5447d8=_[_0xc64b('0x41')]({},_0x5447d8,_0x5add91[_0xc64b('0x42')]);var _0x3e1a0e={'where':_0x5447d8[_0xc64b('0x3d')]};return db[_0xc64b('0x2f')]['count'](_0x3e1a0e)[_0xc64b('0x28')](function(_0x40a3f6){_0x12f45e['count']=_0x40a3f6;if(_0x5add91[_0xc64b('0x34')][_0xc64b('0x43')]){_0x5447d8[_0xc64b('0x44')]=[{'all':!![]}];}return db[_0xc64b('0x2f')][_0xc64b('0x45')](_0x5447d8);})['then'](function(_0x26b5f9){_0x12f45e[_0xc64b('0x46')]=_0x26b5f9;return _0x12f45e;})[_0xc64b('0x28')](respondWithFilteredResult(_0x4f670e,_0x5447d8))[_0xc64b('0x47')](handleError(_0x4f670e,null));};exports[_0xc64b('0x48')]=function(_0x15c9ec,_0x189c9e){var _0x23872b={'raw':![],'where':{'id':_0x15c9ec[_0xc64b('0x49')]['id']}},_0x2c2d84={};_0x2c2d84['model']=_['keys'](db['VtigerAccount'][_0xc64b('0x30')]);_0x2c2d84[_0xc64b('0x34')]=_['keys'](_0x15c9ec[_0xc64b('0x34')]);_0x2c2d84['filters']=_[_0xc64b('0x37')](_0x2c2d84[_0xc64b('0x39')],_0x2c2d84['query']);_0x23872b[_0xc64b('0x38')]=_['intersection'](_0x2c2d84[_0xc64b('0x39')],qs[_0xc64b('0x4a')](_0x15c9ec[_0xc64b('0x34')][_0xc64b('0x4a')]));_0x23872b[_0xc64b('0x38')]=_0x23872b[_0xc64b('0x38')][_0xc64b('0x4b')]?_0x23872b['attributes']:_0x2c2d84[_0xc64b('0x39')];if(_0x15c9ec[_0xc64b('0x34')][_0xc64b('0x43')]){_0x23872b['include']=[{'all':!![]}];}_0x23872b=_['merge']({},_0x23872b,_0x15c9ec[_0xc64b('0x42')]);return db['VtigerAccount'][_0xc64b('0x4c')](_0x23872b)[_0xc64b('0x28')](handleEntityNotFound(_0x189c9e,null))[_0xc64b('0x28')](respondWithResult(_0x189c9e,null))['catch'](handleError(_0x189c9e,null));};exports['create']=function(_0x4ab8ce,_0x12ae20){return db[_0xc64b('0x2f')][_0xc64b('0x4d')](_0x4ab8ce[_0xc64b('0x4e')],{})[_0xc64b('0x28')](respondWithResult(_0x12ae20,0xc9))[_0xc64b('0x47')](handleError(_0x12ae20,null));};exports[_0xc64b('0x27')]=function(_0x3f3d1c,_0x1f7f1a){if(_0x3f3d1c['body']['id']){delete _0x3f3d1c[_0xc64b('0x4e')]['id'];}return db['VtigerAccount'][_0xc64b('0x4c')]({'where':{'id':_0x3f3d1c[_0xc64b('0x49')]['id']}})[_0xc64b('0x28')](handleEntityNotFound(_0x1f7f1a,null))[_0xc64b('0x28')](saveUpdates(_0x3f3d1c['body'],null))[_0xc64b('0x28')](respondWithResult(_0x1f7f1a,null))[_0xc64b('0x47')](handleError(_0x1f7f1a,null));};exports[_0xc64b('0x29')]=function(_0x4452c6,_0x290ad3){return db[_0xc64b('0x2f')][_0xc64b('0x4c')]({'where':{'id':_0x4452c6['params']['id']}})[_0xc64b('0x28')](handleEntityNotFound(_0x290ad3,null))[_0xc64b('0x28')](removeEntity(_0x290ad3,null))[_0xc64b('0x47')](handleError(_0x290ad3,null));};exports['getConfigurations']=function(_0x301b4c,_0x509a1a,_0x4b2598){var _0x2267a4={};var _0x22a38a={};var _0x5186a5;var _0x512f7a;return db[_0xc64b('0x2f')][_0xc64b('0x4f')]({'where':{'id':_0x301b4c[_0xc64b('0x49')]['id']}})[_0xc64b('0x28')](handleEntityNotFound(_0x509a1a,null))[_0xc64b('0x28')](function(_0x1514ad){if(_0x1514ad){_0x5186a5=_0x1514ad;_0x22a38a[_0xc64b('0x39')]=_[_0xc64b('0x35')](db[_0xc64b('0x50')]['rawAttributes']);_0x22a38a[_0xc64b('0x34')]=_['keys'](_0x301b4c[_0xc64b('0x34')]);_0x22a38a[_0xc64b('0x36')]=_[_0xc64b('0x37')](_0x22a38a[_0xc64b('0x39')],_0x22a38a[_0xc64b('0x34')]);_0x2267a4['attributes']=_[_0xc64b('0x37')](_0x22a38a[_0xc64b('0x39')],qs[_0xc64b('0x4a')](_0x301b4c[_0xc64b('0x34')]['fields']));_0x2267a4['attributes']=_0x2267a4[_0xc64b('0x38')][_0xc64b('0x4b')]?_0x2267a4[_0xc64b('0x38')]:_0x22a38a['model'];_0x2267a4[_0xc64b('0x3b')]=qs['sort'](_0x301b4c[_0xc64b('0x34')][_0xc64b('0x3c')]);_0x2267a4[_0xc64b('0x3d')]=qs[_0xc64b('0x36')](_['pick'](_0x301b4c['query'],_0x22a38a[_0xc64b('0x36')]));if(_0x301b4c[_0xc64b('0x34')][_0xc64b('0x3f')]){_0x2267a4[_0xc64b('0x3d')]=_['merge'](_0x2267a4[_0xc64b('0x3d')],{'$or':_[_0xc64b('0x2e')](_0x2267a4['attributes'],function(_0x2f68d3){var _0x17bed7={};_0x17bed7[_0x2f68d3]={'$like':'%'+_0x301b4c[_0xc64b('0x34')][_0xc64b('0x3f')]+'%'};return _0x17bed7;})});}_0x2267a4=_[_0xc64b('0x41')]({},_0x2267a4,_0x301b4c[_0xc64b('0x42')]);return _0x5186a5[_0xc64b('0x51')](_0x2267a4);}})[_0xc64b('0x28')](function(_0x23c5ab){if(_0x23c5ab){_0x512f7a=_0x23c5ab[_0xc64b('0x4b')];if(!_0x301b4c[_0xc64b('0x34')][_0xc64b('0x52')](_0xc64b('0x3a'))){_0x2267a4[_0xc64b('0x1e')]=qs[_0xc64b('0x1e')](_0x301b4c[_0xc64b('0x34')][_0xc64b('0x1e')]);_0x2267a4[_0xc64b('0x1d')]=qs[_0xc64b('0x1d')](_0x301b4c['query'][_0xc64b('0x1d')]);}return _0x5186a5[_0xc64b('0x51')](_0x2267a4);}})[_0xc64b('0x28')](function(_0x3977aa){if(_0x3977aa){return _0x3977aa?{'count':_0x512f7a,'rows':_0x3977aa}:null;}})[_0xc64b('0x28')](respondWithResult(_0x509a1a,null))['catch'](handleError(_0x509a1a,null));};exports[_0xc64b('0x53')]=function(_0x422888,_0x1e1f0e,_0x356d28){if(_0x422888[_0xc64b('0x4e')]['id']){delete _0x422888[_0xc64b('0x4e')]['id'];}return db[_0xc64b('0x2f')]['findOne']({'where':{'id':_0x422888[_0xc64b('0x49')]['id']}})[_0xc64b('0x28')](handleEntityNotFound(_0x1e1f0e,null))['then'](function(_0x21d8b6){if(_0x21d8b6){_0x422888[_0xc64b('0x4e')]['AccountId']=_0x21d8b6['id'];_0x422888[_0xc64b('0x4e')]['Subjects']=integrations[_0xc64b('0x54')](_0x422888[_0xc64b('0x4e')][_0xc64b('0x55')],_0x422888['body'][_0xc64b('0x32')]);_0x422888[_0xc64b('0x4e')][_0xc64b('0x56')]=integrations['getDescriptions'](_0x422888['body']['channel'],_0x422888['body'][_0xc64b('0x32')]);return db[_0xc64b('0x50')][_0xc64b('0x4d')](_0x422888[_0xc64b('0x4e')],{'include':[{'model':db[_0xc64b('0x57')],'as':_0xc64b('0x58')},{'model':db[_0xc64b('0x57')],'as':_0xc64b('0x56')}]});}return null;})[_0xc64b('0x28')](respondWithResult(_0x1e1f0e,null))[_0xc64b('0x47')](handleError(_0x1e1f0e,null));};var md5=require('md5');exports[_0xc64b('0x59')]=function(_0x3c519c,_0x8152a1,_0x4ea24b){var _0x21f28b=null;var _0x22455e=null;var _0x3b92e3=null;var _0x11e82b=null;var _0x1453b4='';return db[_0xc64b('0x2f')]['findOne']({'where':{'id':_0x3c519c[_0xc64b('0x49')]['id']},'attributes':['id',_0xc64b('0x2c'),_0xc64b('0x5a'),_0xc64b('0x5b'),_0xc64b('0x5c'),_0xc64b('0x5d'),_0xc64b('0x5e'),'accessKey']})[_0xc64b('0x28')](handleEntityNotFound(_0x8152a1,null))[_0xc64b('0x28')](function(_0x40b8d5){if(_0x40b8d5){_0x21f28b=_0x40b8d5[_0xc64b('0x5a')];_0x22455e=_0x40b8d5[_0xc64b('0x5f')];_0x3b92e3=_0x40b8d5[_0xc64b('0x5c')];_0x1453b4=_0x40b8d5['remoteUri'];var _0x37aee5=_0x1453b4[_0xc64b('0x60')](-0x1);if(_0x37aee5==='/'){_0x1453b4=_0x1453b4[_0xc64b('0x61')](0x0,_0x1453b4[_0xc64b('0x62')](_0x37aee5));}_0x11e82b=util[_0xc64b('0x63')](_0xc64b('0x64'),_0x1453b4);var _0x2f9b6e={'method':_0xc64b('0x65'),'uri':_0x11e82b,'qs':{'operation':'getchallenge','username':_0x40b8d5[_0xc64b('0x5a')]},'json':!![]};return rp(_0x2f9b6e);}})[_0xc64b('0x28')](function(_0x491b2b){if(_0x491b2b['success']){var _0x4c8451={'method':_0xc64b('0x66'),'uri':_0x11e82b,'form':{'operation':_0xc64b('0x67'),'username':_0x21f28b,'accessKey':md5(_0x491b2b[_0xc64b('0x68')][_0xc64b('0x69')]+_0x22455e)},'json':!![]};return rp(_0x4c8451);}})[_0xc64b('0x28')](function(_0x4bb34e){if(_0x4bb34e['success']){var _0x14bafd={'method':_0xc64b('0x65'),'uri':_0x11e82b,'qs':{'operation':'describe','username':_0x21f28b,'sessionName':_0x4bb34e[_0xc64b('0x68')]['sessionName'],'elementType':_0x3b92e3},'json':!![]};return rp(_0x14bafd);}})[_0xc64b('0x28')](function(_0x335b62){if(_0x335b62[_0xc64b('0x6a')]){var _0x5279c8=[_0xc64b('0x6b'),'reference',_0xc64b('0x6c')];_[_0xc64b('0x6d')](_0x335b62[_0xc64b('0x68')][_0xc64b('0x4a')],function(_0x407f01){return _0x5279c8['includes'](_0x407f01['type'][_0xc64b('0x2c')]);});_['remove'](_0x335b62[_0xc64b('0x68')][_0xc64b('0x4a')],function(_0x30fcc0){return _0x30fcc0[_0xc64b('0x6e')]==='false';});return{'count':_0x335b62[_0xc64b('0x68')][_0xc64b('0x4a')][_0xc64b('0x4b')],'rows':_[_0xc64b('0x2e')](_0x335b62[_0xc64b('0x68')][_0xc64b('0x4a')],function(_0x49b96a){return{'id':_0x49b96a['name'],'name':_0x49b96a[_0xc64b('0x6f')],'custom':_[_0xc64b('0x70')](_0x49b96a['name'],_0xc64b('0x71'))?!![]:![],'options':_0x49b96a[_0xc64b('0x32')][_0xc64b('0x2c')]==='picklist'&&_0x49b96a[_0xc64b('0x32')]['picklistValues'][_0xc64b('0x4b')]>0x0?_[_0xc64b('0x2e')](_0x49b96a['type'][_0xc64b('0x72')],function(_0x5da5a4){return{'name':_0x5da5a4[_0xc64b('0x6f')],'value':_0x5da5a4[_0xc64b('0x73')]};}):[]};})};}})[_0xc64b('0x28')](respondWithResult(_0x8152a1,null))['catch'](function(_0x17c3a1){console[_0xc64b('0x74')](_0xc64b('0x75')+_0x17c3a1);var _0x4d7cdc=_0x3c519c[_0xc64b('0x34')][_0xc64b('0x76')]?0x1f4:_0x17c3a1['statusCode']||0x1f4;logger[_0xc64b('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0xc64b('0x59'),_0x4d7cdc,JSON[_0xc64b('0x77')](_0x17c3a1));delete _0x17c3a1[_0xc64b('0x2c')];if(_0x4d7cdc===0x191){_0x4d7cdc=0x190;}_0x8152a1[_0xc64b('0x1c')](_0x4d7cdc)[_0xc64b('0x2d')](_0x3c519c[_0xc64b('0x34')][_0xc64b('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x17c3a1[_0xc64b('0x78')]}:_0x17c3a1);});};
\ No newline at end of file
index 08715b3..354c873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf54b=['./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e83ee,_0x53b879){var _0x5cb65e=function(_0x332cce){while(--_0x332cce){_0x5e83ee['push'](_0x5e83ee['shift']());}};_0x5cb65e(++_0x53b879);}(_0xf54b,0x1d9));var _0xbf54=function(_0x5e3115,_0x540600){_0x5e3115=_0x5e3115-0x0;var _0x5a1dc6=_0xf54b[_0x5e3115];return _0x5a1dc6;};'use strict';var _=require('lodash');var util=require(_0xbf54('0x0'));var logger=require(_0xbf54('0x1'))(_0xbf54('0x2'));var moment=require('moment');var BPromise=require(_0xbf54('0x3'));var rp=require(_0xbf54('0x4'));var fs=require('fs');var path=require(_0xbf54('0x5'));var rimraf=require(_0xbf54('0x6'));var config=require(_0xbf54('0x7'));var attributes=require(_0xbf54('0x8'));var integrations=require(_0xbf54('0x9'));module['exports']=function(_0x2118d1,_0x12bddc){return _0x2118d1[_0xbf54('0xa')](_0xbf54('0xb'),attributes,{'tableName':_0xbf54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x515d=['bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment'];(function(_0x1f23b1,_0x57c83f){var _0x3c9197=function(_0x2f6e4a){while(--_0x2f6e4a){_0x1f23b1['push'](_0x1f23b1['shift']());}};_0x3c9197(++_0x57c83f);}(_0x515d,0x104));var _0xd515=function(_0x3d1801,_0x8373f8){_0x3d1801=_0x3d1801-0x0;var _0x4c7e33=_0x515d[_0x3d1801];return _0x4c7e33;};'use strict';var _=require(_0xd515('0x0'));var util=require(_0xd515('0x1'));var logger=require(_0xd515('0x2'))('api');var moment=require(_0xd515('0x3'));var BPromise=require(_0xd515('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd515('0x5'));var rimraf=require(_0xd515('0x6'));var config=require(_0xd515('0x7'));var attributes=require(_0xd515('0x8'));var integrations=require(_0xd515('0x9'));module[_0xd515('0xa')]=function(_0x20b74b,_0x2ab314){return _0x20b74b[_0xd515('0xb')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ddedf6..6619ddf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8c=['jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','find','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x3f8c,0x104));var _0xc3f8=function(_0x57db50,_0x5b9b46){_0x57db50=_0x57db50-0x0;var _0x7fad6d=_0x3f8c[_0x57db50];return _0x7fad6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}exports[_0xc3f8('0x12')]=function(_0x2e7c0f){var _0x35500f=this;return new Promise(function(_0xb4ab67,_0x47a185){return db[_0xc3f8('0x13')][_0xc3f8('0x14')]({'raw':_0x2e7c0f['options']?_0x2e7c0f[_0xc3f8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x16')]||null:null,'attributes':_0x2e7c0f['options']?_0x2e7c0f['options'][_0xc3f8('0x17')]||null:null,'limit':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x18')]||null:null,'include':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2e7c0f['options']['include'],function(_0x4b83f0){return{'model':db[_0x4b83f0[_0xc3f8('0x1b')]],'as':_0x4b83f0['as'],'attributes':_0x4b83f0['attributes'],'include':_0x4b83f0[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4b83f0['include'],function(_0x4569c2){return{'model':db[_0x4569c2[_0xc3f8('0x1b')]],'as':_0x4569c2['as'],'attributes':_0x4569c2[_0xc3f8('0x17')],'include':_0x4569c2[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4569c2[_0xc3f8('0x19')],function(_0xf1d460){return{'model':db[_0xf1d460[_0xc3f8('0x1b')]],'as':_0xf1d460['as'],'attributes':_0xf1d460[_0xc3f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x22c8e6){logger[_0xc3f8('0x9')](_0xc3f8('0x12'),_0x2e7c0f);logger[_0xc3f8('0x1c')]('GetVtigerAccount',_0x2e7c0f,JSON[_0xc3f8('0xd')](_0x22c8e6));_0xb4ab67(_0x22c8e6);})[_0xc3f8('0x1d')](function(_0x218029){logger['error'](_0xc3f8('0x12'),_0x218029['message'],_0x2e7c0f);_0x47a185(_0x35500f[_0xc3f8('0xe')](0x1f4,_0x218029[_0xc3f8('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x48b32e){var _0x21a225=this;return new Promise(function(_0x25df65,_0xd32b09){return db[_0xc3f8('0x13')][_0xc3f8('0x1e')]({'raw':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x1f')]===undefined?!![]:![]:!![],'where':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['where']||null:null,'attributes':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x17')]||null:null,'include':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['include']?_['map'](_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x19')],function(_0x76ef00){return{'model':db[_0x76ef00[_0xc3f8('0x1b')]],'as':_0x76ef00['as'],'attributes':_0x76ef00[_0xc3f8('0x17')],'include':_0x76ef00['include']?_[_0xc3f8('0x1a')](_0x76ef00[_0xc3f8('0x19')],function(_0x2ba6aa){return{'model':db[_0x2ba6aa['model']],'as':_0x2ba6aa['as'],'attributes':_0x2ba6aa[_0xc3f8('0x17')],'include':_0x2ba6aa[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2ba6aa['include'],function(_0x21a725){return{'model':db[_0x21a725[_0xc3f8('0x1b')]],'as':_0x21a725['as'],'attributes':_0x21a725['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x84d5d2){logger[_0xc3f8('0x9')](_0xc3f8('0x20'),_0x48b32e);logger[_0xc3f8('0x1c')](_0xc3f8('0x20'),_0x48b32e,JSON['stringify'](_0x84d5d2));_0x25df65(_0x84d5d2);})[_0xc3f8('0x1d')](function(_0x2e4880){logger[_0xc3f8('0xe')](_0xc3f8('0x20'),_0x2e4880[_0xc3f8('0x10')],_0x48b32e);_0xd32b09(_0x21a225['error'](0x1f4,_0x2e4880[_0xc3f8('0x10')]));});});};
\ No newline at end of file
+var _0x282b=['map','model','ShowVtigerAccount','VtigerAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include'];(function(_0x20b7a8,_0x1f0fa2){var _0x306997=function(_0x290216){while(--_0x290216){_0x20b7a8['push'](_0x20b7a8['shift']());}};_0x306997(++_0x1f0fa2);}(_0x282b,0xec));var _0xb282=function(_0x7fd6f0,_0x2b3fd1){_0x7fd6f0=_0x7fd6f0-0x0;var _0x430624=_0x282b[_0x7fd6f0];return _0x430624;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['VtigerAccount'][_0xb282('0x16')]({'raw':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x19')]||null:null,'attributes':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x1a')]||null:null,'limit':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')]['limit']||null:null,'include':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x1b')]?_[_0xb282('0x1c')](_0xca5f12[_0xb282('0x17')]['include'],function(_0x4d624f){return{'model':db[_0x4d624f[_0xb282('0x1d')]],'as':_0x4d624f['as'],'attributes':_0x4d624f[_0xb282('0x1a')],'include':_0x4d624f['include']?_['map'](_0x4d624f[_0xb282('0x1b')],function(_0x114f77){return{'model':db[_0x114f77[_0xb282('0x1d')]],'as':_0x114f77['as'],'attributes':_0x114f77[_0xb282('0x1a')],'include':_0x114f77[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x114f77['include'],function(_0xa0d7fb){return{'model':db[_0xa0d7fb[_0xb282('0x1d')]],'as':_0xa0d7fb['as'],'attributes':_0xa0d7fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xb')](function(_0x38a1f8){logger[_0xb282('0xc')](_0xb282('0x15'),_0xca5f12);logger['debug'](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x38a1f8));_0x3f8a3f(_0x38a1f8);})[_0xb282('0x14')](function(_0x433ad5){logger[_0xb282('0x11')](_0xb282('0x15'),_0x433ad5[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070['error'](0x1f4,_0x433ad5[_0xb282('0x12')]));});});};exports[_0xb282('0x1e')]=function(_0x3eb294){var _0xd8780b=this;return new Promise(function(_0x42ef75,_0x5f3ddf){return db[_0xb282('0x1f')]['find']({'raw':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb294['options']?_0x3eb294[_0xb282('0x17')]['where']||null:null,'attributes':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1a')]||null:null,'include':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')]?_['map'](_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')],function(_0x4ede9d){return{'model':db[_0x4ede9d['model']],'as':_0x4ede9d['as'],'attributes':_0x4ede9d[_0xb282('0x1a')],'include':_0x4ede9d[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4ede9d['include'],function(_0x4a76ce){return{'model':db[_0x4a76ce['model']],'as':_0x4a76ce['as'],'attributes':_0x4a76ce[_0xb282('0x1a')],'include':_0x4a76ce[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4a76ce[_0xb282('0x1b')],function(_0x17c1e4){return{'model':db[_0x17c1e4[_0xb282('0x1d')]],'as':_0x17c1e4['as'],'attributes':_0x17c1e4[_0xb282('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc171){logger['info'](_0xb282('0x1e'),_0x3eb294);logger[_0xb282('0x20')](_0xb282('0x1e'),_0x3eb294,JSON['stringify'](_0x3dc171));_0x42ef75(_0x3dc171);})[_0xb282('0x14')](function(_0x4beef2){logger[_0xb282('0x11')](_0xb282('0x1e'),_0x4beef2[_0xb282('0x12')],_0x3eb294);_0x5f3ddf(_0xd8780b[_0xb282('0x11')](0x1f4,_0x4beef2['message']));});});};
\ No newline at end of file
index 5db89f8..f232908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf685=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','post','create','update','delete'];(function(_0x3cc02c,_0x8de5b5){var _0x57def9=function(_0x252fe5){while(--_0x252fe5){_0x3cc02c['push'](_0x3cc02c['shift']());}};_0x57def9(++_0x8de5b5);}(_0xf685,0x12c));var _0x5f68=function(_0x3b3d53,_0x1129ef){_0x3b3d53=_0x3b3d53-0x0;var _0x5e0754=_0xf685[_0x3b3d53];return _0x5e0754;};'use strict';var multer=require(_0x5f68('0x0'));var util=require(_0x5f68('0x1'));var path=require(_0x5f68('0x2'));var timeout=require(_0x5f68('0x3'));var express=require(_0x5f68('0x4'));var router=express[_0x5f68('0x5')]();var fs_extra=require(_0x5f68('0x6'));var auth=require(_0x5f68('0x7'));var interaction=require(_0x5f68('0x8'));var config=require(_0x5f68('0x9'));var controller=require(_0x5f68('0xa'));router[_0x5f68('0xb')]('/',auth['isAuthenticated'](),controller[_0x5f68('0xc')]);router[_0x5f68('0xb')](_0x5f68('0xd'),auth[_0x5f68('0xe')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x5f68('0xf')]);router[_0x5f68('0xb')](_0x5f68('0x10'),auth[_0x5f68('0xe')](),controller['getSubjects']);router[_0x5f68('0xb')](_0x5f68('0x11'),auth[_0x5f68('0xe')](),controller['getDescriptions']);router[_0x5f68('0x12')]('/',auth[_0x5f68('0xe')](),controller[_0x5f68('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5f68('0x14')]);router[_0x5f68('0x15')](_0x5f68('0xd'),auth[_0x5f68('0xe')](),controller[_0x5f68('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xff69=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x5d15b6,_0x298f5f){var _0x1801c5=function(_0x12f0cc){while(--_0x12f0cc){_0x5d15b6['push'](_0x5d15b6['shift']());}};_0x1801c5(++_0x298f5f);}(_0xff69,0x1b5));var _0x9ff6=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0xff69[_0x4c9f6a];return _0x5df5b9;};'use strict';var multer=require(_0x9ff6('0x0'));var util=require(_0x9ff6('0x1'));var path=require(_0x9ff6('0x2'));var timeout=require(_0x9ff6('0x3'));var express=require(_0x9ff6('0x4'));var router=express['Router']();var fs_extra=require(_0x9ff6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ff6('0x6'));var controller=require(_0x9ff6('0x7'));router[_0x9ff6('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ff6('0x9')]);router[_0x9ff6('0x8')](_0x9ff6('0xa'),auth[_0x9ff6('0xb')](),controller['show']);router[_0x9ff6('0x8')](_0x9ff6('0xc'),auth[_0x9ff6('0xb')](),controller[_0x9ff6('0xd')]);router['get'](_0x9ff6('0xe'),auth[_0x9ff6('0xb')](),controller[_0x9ff6('0xf')]);router[_0x9ff6('0x8')]('/:id/descriptions',auth[_0x9ff6('0xb')](),controller[_0x9ff6('0x10')]);router[_0x9ff6('0x11')]('/',auth['isAuthenticated'](),controller[_0x9ff6('0x12')]);router[_0x9ff6('0x13')](_0x9ff6('0xa'),auth[_0x9ff6('0xb')](),controller[_0x9ff6('0x14')]);router[_0x9ff6('0x15')](_0x9ff6('0xa'),auth['isAuthenticated'](),controller[_0x9ff6('0x16')]);module['exports']=router;
\ No newline at end of file
index d9559cf..9641ef4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43fc=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43fc,0x1ce));var _0xc43f=function(_0xf5e02f,_0x4e4d0e){_0xf5e02f=_0xf5e02f-0x0;var _0x3e91a5=_0x43fc[_0xf5e02f];return _0x3e91a5;};'use strict';var Sequelize=require(_0xc43f('0x0'));module[_0xc43f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc43f('0x2')]}};
\ No newline at end of file
+var _0x828f=['exports','STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x828f,0x1dc));var _0xf828=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x828f[_0x382e89];return _0x3a1318;};'use strict';var Sequelize=require(_0xf828('0x0'));module[_0xf828('0x1')]={'name':{'type':Sequelize[_0xf828('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2d425f1..85ef568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9071=['filters','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','attributes','include','options','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VtigerConfiguration','fieldName','type','key','map','query','keys','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3c5d9b,_0x16f3f1){var _0x557a6e=function(_0x28276c){while(--_0x28276c){_0x3c5d9b['push'](_0x3c5d9b['shift']());}};_0x557a6e(++_0x16f3f1);}(_0x9071,0x6b));var _0x1907=function(_0x3f92a0,_0x59deea){_0x3f92a0=_0x3f92a0-0x0;var _0x1f6e44=_0x9071[_0x3f92a0];return _0x1f6e44;};'use strict';var emlformat=require(_0x1907('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1907('0x1'));var jsonpatch=require(_0x1907('0x2'));var rp=require(_0x1907('0x3'));var moment=require(_0x1907('0x4'));var BPromise=require(_0x1907('0x5'));var Mustache=require('mustache');var util=require(_0x1907('0x6'));var path=require(_0x1907('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1907('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1907('0x9'));var squel=require(_0x1907('0xa'));var crypto=require(_0x1907('0xb'));var jsforce=require(_0x1907('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1907('0xd'));var querystring=require(_0x1907('0xe'));var Papa=require(_0x1907('0xf'));var Redis=require('ioredis');var authService=require(_0x1907('0x10'));var qs=require(_0x1907('0x11'));var as=require(_0x1907('0x12'));var hardwareService=require(_0x1907('0x13'));var logger=require(_0x1907('0x14'))(_0x1907('0x15'));var utils=require(_0x1907('0x16'));var config=require(_0x1907('0x17'));var licenseUtil=require(_0x1907('0x18'));var db=require(_0x1907('0x19'))['db'];function respondWithStatusCode(_0x5652f8,_0x2d4140){_0x2d4140=_0x2d4140||0xcc;return function(_0x3fd75e){if(_0x3fd75e){return _0x5652f8['sendStatus'](_0x2d4140);}return _0x5652f8[_0x1907('0x1a')](_0x2d4140)['end']();};}function respondWithResult(_0x5a183e,_0x5219d6){_0x5219d6=_0x5219d6||0xc8;return function(_0x50573f){if(_0x50573f){return _0x5a183e['status'](_0x5219d6)['json'](_0x50573f);}};}function respondWithFilteredResult(_0x1a8a19,_0x1db294){return function(_0xc56f91){if(_0xc56f91){var _0x36ccf1=typeof _0x1db294[_0x1907('0x1b')]===_0x1907('0x1c')&&typeof _0x1db294[_0x1907('0x1d')]===_0x1907('0x1c');var _0x1a186d=_0xc56f91[_0x1907('0x1e')];var _0x34e7cb=_0x36ccf1?0x0:_0x1db294['offset'];var _0x61adef=_0x36ccf1?_0xc56f91['count']:_0x1db294[_0x1907('0x1b')]+_0x1db294[_0x1907('0x1d')];var _0x23dfae;if(_0x61adef>=_0x1a186d){_0x61adef=_0x1a186d;_0x23dfae=0xc8;}else{_0x23dfae=0xce;}_0x1a8a19[_0x1907('0x1a')](_0x23dfae);return _0x1a8a19['set'](_0x1907('0x1f'),_0x34e7cb+'-'+_0x61adef+'/'+_0x1a186d)[_0x1907('0x20')](_0xc56f91);}return null;};}function patchUpdates(_0x2af981){return function(_0xde455b){try{jsonpatch[_0x1907('0x21')](_0xde455b,_0x2af981,!![]);}catch(_0x14e5a4){return BPromise[_0x1907('0x22')](_0x14e5a4);}return _0xde455b[_0x1907('0x23')]();};}function saveUpdates(_0x1654c4,_0x148926){return function(_0x16be08){if(_0x16be08){return _0x16be08[_0x1907('0x24')](_0x1654c4)[_0x1907('0x25')](function(_0x4f097d){return _0x4f097d;});}return null;};}function removeEntity(_0x368bc4,_0xbf8435){return function(_0x4f9f1c){if(_0x4f9f1c){return _0x4f9f1c[_0x1907('0x26')]()[_0x1907('0x25')](function(){_0x368bc4['status'](0xcc)[_0x1907('0x27')]();});}};}function handleEntityNotFound(_0x561a68,_0x40d138){return function(_0x153808){if(!_0x153808){_0x561a68['sendStatus'](0x194);}return _0x153808;};}function handleError(_0x298547,_0x498ae5){_0x498ae5=_0x498ae5||0x1f4;return function(_0x42d2a2){logger[_0x1907('0x28')](_0x42d2a2[_0x1907('0x29')]);if(_0x42d2a2[_0x1907('0x2a')]){delete _0x42d2a2[_0x1907('0x2a')];}_0x298547[_0x1907('0x1a')](_0x498ae5)[_0x1907('0x2b')](_0x42d2a2);};}exports[_0x1907('0x2c')]=function(_0x3f86ec,_0x2521c0){var _0x3e1e5e={},_0x5f298f={},_0x5612cb={'count':0x0,'rows':[]};var _0x47f64c=_['map'](db[_0x1907('0x2d')]['rawAttributes'],function(_0x4fb3ed){return{'name':_0x4fb3ed[_0x1907('0x2e')],'type':_0x4fb3ed[_0x1907('0x2f')][_0x1907('0x30')]};});_0x5f298f['model']=_[_0x1907('0x31')](_0x47f64c,'name');_0x5f298f[_0x1907('0x32')]=_[_0x1907('0x33')](_0x3f86ec['query']);_0x5f298f['filters']=_[_0x1907('0x34')](_0x5f298f[_0x1907('0x35')],_0x5f298f[_0x1907('0x32')]);_0x3e1e5e['attributes']=_['intersection'](_0x5f298f[_0x1907('0x35')],qs[_0x1907('0x36')](_0x3f86ec[_0x1907('0x32')][_0x1907('0x36')]));_0x3e1e5e['attributes']=_0x3e1e5e['attributes'][_0x1907('0x37')]?_0x3e1e5e['attributes']:_0x5f298f[_0x1907('0x35')];if(!_0x3f86ec['query'][_0x1907('0x38')](_0x1907('0x39'))){_0x3e1e5e[_0x1907('0x1d')]=qs[_0x1907('0x1d')](_0x3f86ec[_0x1907('0x32')][_0x1907('0x1d')]);_0x3e1e5e[_0x1907('0x1b')]=qs[_0x1907('0x1b')](_0x3f86ec['query']['offset']);}_0x3e1e5e[_0x1907('0x3a')]=qs[_0x1907('0x3b')](_0x3f86ec[_0x1907('0x32')][_0x1907('0x3b')]);_0x3e1e5e[_0x1907('0x3c')]=qs[_0x1907('0x3d')](_[_0x1907('0x3e')](_0x3f86ec[_0x1907('0x32')],_0x5f298f[_0x1907('0x3d')]),_0x47f64c);if(_0x3f86ec[_0x1907('0x32')]['filter']){_0x3e1e5e['where']=_[_0x1907('0x3f')](_0x3e1e5e['where'],{'$or':_['map'](_0x47f64c,function(_0x3fb223){if(_0x3fb223['type']!==_0x1907('0x40')){var _0x424b36={};_0x424b36[_0x3fb223[_0x1907('0x2a')]]={'$like':'%'+_0x3f86ec['query'][_0x1907('0x41')]+'%'};return _0x424b36;}})});}_0x3e1e5e=_[_0x1907('0x3f')]({},_0x3e1e5e,_0x3f86ec['options']);var _0x3cff7c={'where':_0x3e1e5e[_0x1907('0x3c')]};return db[_0x1907('0x2d')][_0x1907('0x1e')](_0x3cff7c)[_0x1907('0x25')](function(_0x39c6a5){_0x5612cb[_0x1907('0x1e')]=_0x39c6a5;if(_0x3f86ec['query'][_0x1907('0x42')]){_0x3e1e5e['include']=[{'all':!![]}];}return db[_0x1907('0x2d')][_0x1907('0x43')](_0x3e1e5e);})[_0x1907('0x25')](function(_0x5a43d5){_0x5612cb[_0x1907('0x44')]=_0x5a43d5;return _0x5612cb;})[_0x1907('0x25')](respondWithFilteredResult(_0x2521c0,_0x3e1e5e))[_0x1907('0x45')](handleError(_0x2521c0,null));};exports[_0x1907('0x46')]=function(_0x264777,_0xbf0de7){var _0x210887={'raw':![],'where':{'id':_0x264777['params']['id']}},_0x53e2c6={};_0x53e2c6[_0x1907('0x35')]=_[_0x1907('0x33')](db[_0x1907('0x2d')][_0x1907('0x47')]);_0x53e2c6[_0x1907('0x32')]=_[_0x1907('0x33')](_0x264777[_0x1907('0x32')]);_0x53e2c6[_0x1907('0x3d')]=_[_0x1907('0x34')](_0x53e2c6[_0x1907('0x35')],_0x53e2c6[_0x1907('0x32')]);_0x210887[_0x1907('0x48')]=_[_0x1907('0x34')](_0x53e2c6['model'],qs[_0x1907('0x36')](_0x264777['query'][_0x1907('0x36')]));_0x210887[_0x1907('0x48')]=_0x210887[_0x1907('0x48')][_0x1907('0x37')]?_0x210887[_0x1907('0x48')]:_0x53e2c6['model'];if(_0x264777[_0x1907('0x32')][_0x1907('0x42')]){_0x210887[_0x1907('0x49')]=[{'all':!![]}];}_0x210887=_[_0x1907('0x3f')]({},_0x210887,_0x264777[_0x1907('0x4a')]);return db[_0x1907('0x2d')][_0x1907('0x4b')](_0x210887)['then'](handleEntityNotFound(_0xbf0de7,null))[_0x1907('0x25')](respondWithResult(_0xbf0de7,null))[_0x1907('0x45')](handleError(_0xbf0de7,null));};exports['create']=function(_0x205113,_0x27f7aa){return db[_0x1907('0x2d')][_0x1907('0x4c')](_0x205113[_0x1907('0x4d')],{})[_0x1907('0x25')](respondWithResult(_0x27f7aa,0xc9))[_0x1907('0x45')](handleError(_0x27f7aa,null));};exports[_0x1907('0x24')]=function(_0x21e3df,_0x405166){if(_0x21e3df[_0x1907('0x4d')]['id']){delete _0x21e3df['body']['id'];}return db[_0x1907('0x2d')]['find']({'where':{'id':_0x21e3df[_0x1907('0x4e')]['id']}})[_0x1907('0x25')](handleEntityNotFound(_0x405166,null))[_0x1907('0x25')](saveUpdates(_0x21e3df[_0x1907('0x4d')],null))[_0x1907('0x25')](respondWithResult(_0x405166,null))['catch'](handleError(_0x405166,null));};exports['destroy']=function(_0x11d56a,_0x8e900c){return db[_0x1907('0x2d')][_0x1907('0x4b')]({'where':{'id':_0x11d56a['params']['id']}})[_0x1907('0x25')](handleEntityNotFound(_0x8e900c,null))[_0x1907('0x25')](removeEntity(_0x8e900c,null))[_0x1907('0x45')](handleError(_0x8e900c,null));};exports[_0x1907('0x4f')]=function(_0x3cd2a9,_0x50053d,_0x471ab3){var _0x36ebb5={};var _0x1b9d06={};var _0x305444;var _0x2f59de;return db['VtigerConfiguration'][_0x1907('0x50')]({'where':{'id':_0x3cd2a9[_0x1907('0x4e')]['id']}})['then'](handleEntityNotFound(_0x50053d,null))[_0x1907('0x25')](function(_0x5c5f63){if(_0x5c5f63){_0x305444=_0x5c5f63;_0x1b9d06[_0x1907('0x35')]=_['keys'](db[_0x1907('0x51')]['rawAttributes']);_0x1b9d06[_0x1907('0x32')]=_['keys'](_0x3cd2a9[_0x1907('0x32')]);_0x1b9d06[_0x1907('0x3d')]=_['intersection'](_0x1b9d06[_0x1907('0x35')],_0x1b9d06[_0x1907('0x32')]);_0x36ebb5[_0x1907('0x48')]=_[_0x1907('0x34')](_0x1b9d06[_0x1907('0x35')],qs[_0x1907('0x36')](_0x3cd2a9[_0x1907('0x32')][_0x1907('0x36')]));_0x36ebb5[_0x1907('0x48')]=_0x36ebb5['attributes'][_0x1907('0x37')]?_0x36ebb5[_0x1907('0x48')]:_0x1b9d06[_0x1907('0x35')];_0x36ebb5['order']=qs[_0x1907('0x3b')](_0x3cd2a9['query']['sort']);_0x36ebb5[_0x1907('0x3c')]=qs['filters'](_[_0x1907('0x3e')](_0x3cd2a9['query'],_0x1b9d06[_0x1907('0x3d')]));if(_0x3cd2a9[_0x1907('0x32')][_0x1907('0x41')]){_0x36ebb5[_0x1907('0x3c')]=_[_0x1907('0x3f')](_0x36ebb5[_0x1907('0x3c')],{'$or':_['map'](_0x36ebb5[_0x1907('0x48')],function(_0x339d7a){var _0x1d4e71={};_0x1d4e71[_0x339d7a]={'$like':'%'+_0x3cd2a9[_0x1907('0x32')][_0x1907('0x41')]+'%'};return _0x1d4e71;})});}_0x36ebb5=_[_0x1907('0x3f')]({},_0x36ebb5,_0x3cd2a9['options']);return _0x305444['getFields'](_0x36ebb5);}})[_0x1907('0x25')](function(_0x2fc413){if(_0x2fc413){_0x2f59de=_0x2fc413[_0x1907('0x37')];if(!_0x3cd2a9[_0x1907('0x32')][_0x1907('0x38')](_0x1907('0x39'))){_0x36ebb5[_0x1907('0x1d')]=qs[_0x1907('0x1d')](_0x3cd2a9[_0x1907('0x32')][_0x1907('0x1d')]);_0x36ebb5[_0x1907('0x1b')]=qs['offset'](_0x3cd2a9['query']['offset']);}return _0x305444[_0x1907('0x4f')](_0x36ebb5);}})[_0x1907('0x25')](function(_0x3e2bb3){if(_0x3e2bb3){return _0x3e2bb3?{'count':_0x2f59de,'rows':_0x3e2bb3}:null;}})['then'](respondWithResult(_0x50053d,null))[_0x1907('0x45')](handleError(_0x50053d,null));};exports['getSubjects']=function(_0x5217eb,_0x1b310c,_0xd5756c){var _0xd81e83={};var _0x1f434d={};var _0x124233;var _0x41faa4;return db[_0x1907('0x2d')][_0x1907('0x50')]({'where':{'id':_0x5217eb[_0x1907('0x4e')]['id']}})[_0x1907('0x25')](handleEntityNotFound(_0x1b310c,null))[_0x1907('0x25')](function(_0x424001){if(_0x424001){_0x124233=_0x424001;_0x1f434d[_0x1907('0x35')]=_['keys'](db[_0x1907('0x51')][_0x1907('0x47')]);_0x1f434d[_0x1907('0x32')]=_[_0x1907('0x33')](_0x5217eb[_0x1907('0x32')]);_0x1f434d[_0x1907('0x3d')]=_[_0x1907('0x34')](_0x1f434d[_0x1907('0x35')],_0x1f434d['query']);_0xd81e83['attributes']=_[_0x1907('0x34')](_0x1f434d[_0x1907('0x35')],qs['fields'](_0x5217eb[_0x1907('0x32')][_0x1907('0x36')]));_0xd81e83['attributes']=_0xd81e83[_0x1907('0x48')][_0x1907('0x37')]?_0xd81e83[_0x1907('0x48')]:_0x1f434d['model'];_0xd81e83['order']=qs['sort'](_0x5217eb[_0x1907('0x32')][_0x1907('0x3b')]);_0xd81e83[_0x1907('0x3c')]=qs[_0x1907('0x3d')](_[_0x1907('0x3e')](_0x5217eb['query'],_0x1f434d[_0x1907('0x3d')]));if(_0x5217eb['query'][_0x1907('0x41')]){_0xd81e83[_0x1907('0x3c')]=_[_0x1907('0x3f')](_0xd81e83[_0x1907('0x3c')],{'$or':_[_0x1907('0x31')](_0xd81e83[_0x1907('0x48')],function(_0x57474e){var _0x32fc9d={};_0x32fc9d[_0x57474e]={'$like':'%'+_0x5217eb[_0x1907('0x32')][_0x1907('0x41')]+'%'};return _0x32fc9d;})});}_0xd81e83=_[_0x1907('0x3f')]({},_0xd81e83,_0x5217eb[_0x1907('0x4a')]);return _0x124233[_0x1907('0x52')](_0xd81e83);}})['then'](function(_0x3f5f80){if(_0x3f5f80){_0x41faa4=_0x3f5f80[_0x1907('0x37')];if(!_0x5217eb[_0x1907('0x32')][_0x1907('0x38')](_0x1907('0x39'))){_0xd81e83[_0x1907('0x1d')]=qs[_0x1907('0x1d')](_0x5217eb[_0x1907('0x32')][_0x1907('0x1d')]);_0xd81e83['offset']=qs[_0x1907('0x1b')](_0x5217eb['query'][_0x1907('0x1b')]);}return _0x124233[_0x1907('0x52')](_0xd81e83);}})[_0x1907('0x25')](function(_0x125f96){if(_0x125f96){return _0x125f96?{'count':_0x41faa4,'rows':_0x125f96}:null;}})[_0x1907('0x25')](respondWithResult(_0x1b310c,null))[_0x1907('0x45')](handleError(_0x1b310c,null));};exports[_0x1907('0x53')]=function(_0x265869,_0x159286,_0x4973f6){var _0x577880={};var _0x295fd5={};var _0x57817f;var _0x234fa6;return db[_0x1907('0x2d')]['findOne']({'where':{'id':_0x265869[_0x1907('0x4e')]['id']}})[_0x1907('0x25')](handleEntityNotFound(_0x159286,null))[_0x1907('0x25')](function(_0x12d8d3){if(_0x12d8d3){_0x57817f=_0x12d8d3;_0x295fd5[_0x1907('0x35')]=_[_0x1907('0x33')](db[_0x1907('0x51')][_0x1907('0x47')]);_0x295fd5[_0x1907('0x32')]=_['keys'](_0x265869[_0x1907('0x32')]);_0x295fd5[_0x1907('0x3d')]=_[_0x1907('0x34')](_0x295fd5[_0x1907('0x35')],_0x295fd5[_0x1907('0x32')]);_0x577880[_0x1907('0x48')]=_['intersection'](_0x295fd5[_0x1907('0x35')],qs['fields'](_0x265869[_0x1907('0x32')][_0x1907('0x36')]));_0x577880[_0x1907('0x48')]=_0x577880[_0x1907('0x48')][_0x1907('0x37')]?_0x577880[_0x1907('0x48')]:_0x295fd5[_0x1907('0x35')];_0x577880[_0x1907('0x3a')]=qs['sort'](_0x265869[_0x1907('0x32')][_0x1907('0x3b')]);_0x577880[_0x1907('0x3c')]=qs[_0x1907('0x3d')](_[_0x1907('0x3e')](_0x265869[_0x1907('0x32')],_0x295fd5[_0x1907('0x3d')]));if(_0x265869[_0x1907('0x32')]['filter']){_0x577880[_0x1907('0x3c')]=_[_0x1907('0x3f')](_0x577880[_0x1907('0x3c')],{'$or':_[_0x1907('0x31')](_0x577880[_0x1907('0x48')],function(_0x48c58a){var _0x47e8cf={};_0x47e8cf[_0x48c58a]={'$like':'%'+_0x265869['query'][_0x1907('0x41')]+'%'};return _0x47e8cf;})});}_0x577880=_[_0x1907('0x3f')]({},_0x577880,_0x265869[_0x1907('0x4a')]);return _0x57817f[_0x1907('0x53')](_0x577880);}})[_0x1907('0x25')](function(_0x2239d4){if(_0x2239d4){_0x234fa6=_0x2239d4[_0x1907('0x37')];if(!_0x265869[_0x1907('0x32')]['hasOwnProperty'](_0x1907('0x39'))){_0x577880[_0x1907('0x1d')]=qs[_0x1907('0x1d')](_0x265869['query'][_0x1907('0x1d')]);_0x577880['offset']=qs[_0x1907('0x1b')](_0x265869[_0x1907('0x32')][_0x1907('0x1b')]);}return _0x57817f[_0x1907('0x53')](_0x577880);}})[_0x1907('0x25')](function(_0x1a6dfa){if(_0x1a6dfa){return _0x1a6dfa?{'count':_0x234fa6,'rows':_0x1a6dfa}:null;}})['then'](respondWithResult(_0x159286,null))[_0x1907('0x45')](handleError(_0x159286,null));};
\ No newline at end of file
+var _0x5561=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','VtigerField','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util'];(function(_0x1a9460,_0x12eb8a){var _0x5f2f21=function(_0x40c497){while(--_0x40c497){_0x1a9460['push'](_0x1a9460['shift']());}};_0x5f2f21(++_0x12eb8a);}(_0x5561,0xe0));var _0x1556=function(_0x51028b,_0x3d289f){_0x51028b=_0x51028b-0x0;var _0x30397e=_0x5561[_0x51028b];return _0x30397e;};'use strict';var emlformat=require(_0x1556('0x0'));var rimraf=require(_0x1556('0x1'));var zipdir=require(_0x1556('0x2'));var jsonpatch=require(_0x1556('0x3'));var rp=require(_0x1556('0x4'));var moment=require(_0x1556('0x5'));var BPromise=require(_0x1556('0x6'));var Mustache=require(_0x1556('0x7'));var util=require(_0x1556('0x8'));var path=require(_0x1556('0x9'));var sox=require(_0x1556('0xa'));var csv=require('to-csv');var ejs=require(_0x1556('0xb'));var fs=require('fs');var fs_extra=require(_0x1556('0xc'));var _=require(_0x1556('0xd'));var squel=require(_0x1556('0xe'));var crypto=require(_0x1556('0xf'));var jsforce=require(_0x1556('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1556('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1556('0x12'));var authService=require(_0x1556('0x13'));var qs=require(_0x1556('0x14'));var as=require(_0x1556('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1556('0x16'));var utils=require(_0x1556('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1556('0x18'));var db=require(_0x1556('0x19'))['db'];function respondWithStatusCode(_0x4d1fa1,_0x4f6935){_0x4f6935=_0x4f6935||0xcc;return function(_0x31c30b){if(_0x31c30b){return _0x4d1fa1[_0x1556('0x1a')](_0x4f6935);}return _0x4d1fa1[_0x1556('0x1b')](_0x4f6935)[_0x1556('0x1c')]();};}function respondWithResult(_0x50079e,_0x157f46){_0x157f46=_0x157f46||0xc8;return function(_0x20f19f){if(_0x20f19f){return _0x50079e[_0x1556('0x1b')](_0x157f46)[_0x1556('0x1d')](_0x20f19f);}};}function respondWithFilteredResult(_0x2dad96,_0x4e7745){return function(_0x59e0e7){if(_0x59e0e7){var _0x6ede41=typeof _0x4e7745[_0x1556('0x1e')]===_0x1556('0x1f')&&typeof _0x4e7745[_0x1556('0x20')]===_0x1556('0x1f');var _0x4b8587=_0x59e0e7[_0x1556('0x21')];var _0x2cd8db=_0x6ede41?0x0:_0x4e7745['offset'];var _0x481565=_0x6ede41?_0x59e0e7[_0x1556('0x21')]:_0x4e7745['offset']+_0x4e7745[_0x1556('0x20')];var _0x510f35;if(_0x481565>=_0x4b8587){_0x481565=_0x4b8587;_0x510f35=0xc8;}else{_0x510f35=0xce;}_0x2dad96['status'](_0x510f35);return _0x2dad96['set'](_0x1556('0x22'),_0x2cd8db+'-'+_0x481565+'/'+_0x4b8587)[_0x1556('0x1d')](_0x59e0e7);}return null;};}function patchUpdates(_0x16ec32){return function(_0x371332){try{jsonpatch[_0x1556('0x23')](_0x371332,_0x16ec32,!![]);}catch(_0x2c5eb6){return BPromise[_0x1556('0x24')](_0x2c5eb6);}return _0x371332[_0x1556('0x25')]();};}function saveUpdates(_0x1e9f45,_0x584a68){return function(_0x6d1e34){if(_0x6d1e34){return _0x6d1e34[_0x1556('0x26')](_0x1e9f45)[_0x1556('0x27')](function(_0x25d508){return _0x25d508;});}return null;};}function removeEntity(_0x46ec65,_0x699817){return function(_0x18f756){if(_0x18f756){return _0x18f756[_0x1556('0x28')]()[_0x1556('0x27')](function(){_0x46ec65[_0x1556('0x1b')](0xcc)[_0x1556('0x1c')]();});}};}function handleEntityNotFound(_0x42f400,_0x193da3){return function(_0x375902){if(!_0x375902){_0x42f400[_0x1556('0x1a')](0x194);}return _0x375902;};}function handleError(_0x4a0f53,_0x362646){_0x362646=_0x362646||0x1f4;return function(_0x438235){logger[_0x1556('0x29')](_0x438235[_0x1556('0x2a')]);if(_0x438235['name']){delete _0x438235[_0x1556('0x2b')];}_0x4a0f53[_0x1556('0x1b')](_0x362646)[_0x1556('0x2c')](_0x438235);};}exports[_0x1556('0x2d')]=function(_0x1bc353,_0x3d8b3b){var _0x9dff3b={},_0x52b537={},_0x153b12={'count':0x0,'rows':[]};var _0x21ea80=_[_0x1556('0x2e')](db[_0x1556('0x2f')][_0x1556('0x30')],function(_0x18be71){return{'name':_0x18be71[_0x1556('0x31')],'type':_0x18be71[_0x1556('0x32')]['key']};});_0x52b537[_0x1556('0x33')]=_[_0x1556('0x2e')](_0x21ea80,_0x1556('0x2b'));_0x52b537['query']=_[_0x1556('0x34')](_0x1bc353['query']);_0x52b537[_0x1556('0x35')]=_['intersection'](_0x52b537[_0x1556('0x33')],_0x52b537[_0x1556('0x36')]);_0x9dff3b[_0x1556('0x37')]=_[_0x1556('0x38')](_0x52b537['model'],qs[_0x1556('0x39')](_0x1bc353['query']['fields']));_0x9dff3b[_0x1556('0x37')]=_0x9dff3b['attributes'][_0x1556('0x3a')]?_0x9dff3b['attributes']:_0x52b537[_0x1556('0x33')];if(!_0x1bc353['query'][_0x1556('0x3b')](_0x1556('0x3c'))){_0x9dff3b['limit']=qs[_0x1556('0x20')](_0x1bc353[_0x1556('0x36')][_0x1556('0x20')]);_0x9dff3b[_0x1556('0x1e')]=qs[_0x1556('0x1e')](_0x1bc353['query'][_0x1556('0x1e')]);}_0x9dff3b[_0x1556('0x3d')]=qs[_0x1556('0x3e')](_0x1bc353['query'][_0x1556('0x3e')]);_0x9dff3b[_0x1556('0x3f')]=qs[_0x1556('0x35')](_[_0x1556('0x40')](_0x1bc353[_0x1556('0x36')],_0x52b537['filters']),_0x21ea80);if(_0x1bc353['query'][_0x1556('0x41')]){_0x9dff3b['where']=_[_0x1556('0x42')](_0x9dff3b[_0x1556('0x3f')],{'$or':_[_0x1556('0x2e')](_0x21ea80,function(_0x585acf){if(_0x585acf[_0x1556('0x32')]!==_0x1556('0x43')){var _0x306816={};_0x306816[_0x585acf[_0x1556('0x2b')]]={'$like':'%'+_0x1bc353[_0x1556('0x36')]['filter']+'%'};return _0x306816;}})});}_0x9dff3b=_[_0x1556('0x42')]({},_0x9dff3b,_0x1bc353[_0x1556('0x44')]);var _0x219bd2={'where':_0x9dff3b['where']};return db[_0x1556('0x2f')]['count'](_0x219bd2)[_0x1556('0x27')](function(_0xc36df8){_0x153b12[_0x1556('0x21')]=_0xc36df8;if(_0x1bc353['query'][_0x1556('0x45')]){_0x9dff3b[_0x1556('0x46')]=[{'all':!![]}];}return db[_0x1556('0x2f')][_0x1556('0x47')](_0x9dff3b);})[_0x1556('0x27')](function(_0x42fa11){_0x153b12['rows']=_0x42fa11;return _0x153b12;})[_0x1556('0x27')](respondWithFilteredResult(_0x3d8b3b,_0x9dff3b))[_0x1556('0x48')](handleError(_0x3d8b3b,null));};exports[_0x1556('0x49')]=function(_0x121f26,_0x386191){var _0xa4b816={'raw':![],'where':{'id':_0x121f26[_0x1556('0x4a')]['id']}},_0x4552f2={};_0x4552f2[_0x1556('0x33')]=_[_0x1556('0x34')](db[_0x1556('0x2f')][_0x1556('0x30')]);_0x4552f2[_0x1556('0x36')]=_[_0x1556('0x34')](_0x121f26[_0x1556('0x36')]);_0x4552f2[_0x1556('0x35')]=_[_0x1556('0x38')](_0x4552f2[_0x1556('0x33')],_0x4552f2[_0x1556('0x36')]);_0xa4b816['attributes']=_['intersection'](_0x4552f2[_0x1556('0x33')],qs['fields'](_0x121f26[_0x1556('0x36')]['fields']));_0xa4b816['attributes']=_0xa4b816['attributes']['length']?_0xa4b816[_0x1556('0x37')]:_0x4552f2['model'];if(_0x121f26[_0x1556('0x36')][_0x1556('0x45')]){_0xa4b816[_0x1556('0x46')]=[{'all':!![]}];}_0xa4b816=_[_0x1556('0x42')]({},_0xa4b816,_0x121f26[_0x1556('0x44')]);return db[_0x1556('0x2f')][_0x1556('0x4b')](_0xa4b816)[_0x1556('0x27')](handleEntityNotFound(_0x386191,null))[_0x1556('0x27')](respondWithResult(_0x386191,null))[_0x1556('0x48')](handleError(_0x386191,null));};exports[_0x1556('0x4c')]=function(_0xfb6d4,_0x5954c9){return db['VtigerConfiguration'][_0x1556('0x4c')](_0xfb6d4[_0x1556('0x4d')],{})[_0x1556('0x27')](respondWithResult(_0x5954c9,0xc9))[_0x1556('0x48')](handleError(_0x5954c9,null));};exports[_0x1556('0x26')]=function(_0x272fbb,_0x500720){if(_0x272fbb[_0x1556('0x4d')]['id']){delete _0x272fbb[_0x1556('0x4d')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x272fbb[_0x1556('0x4a')]['id']}})[_0x1556('0x27')](handleEntityNotFound(_0x500720,null))[_0x1556('0x27')](saveUpdates(_0x272fbb[_0x1556('0x4d')],null))[_0x1556('0x27')](respondWithResult(_0x500720,null))[_0x1556('0x48')](handleError(_0x500720,null));};exports[_0x1556('0x28')]=function(_0x38e513,_0x43cb1a){return db[_0x1556('0x2f')][_0x1556('0x4b')]({'where':{'id':_0x38e513[_0x1556('0x4a')]['id']}})[_0x1556('0x27')](handleEntityNotFound(_0x43cb1a,null))[_0x1556('0x27')](removeEntity(_0x43cb1a,null))[_0x1556('0x48')](handleError(_0x43cb1a,null));};exports[_0x1556('0x4e')]=function(_0x249b33,_0x1749cc,_0x3a6299){var _0x35b0f0={};var _0x5a8d1c={};var _0x585964;var _0x5a3636;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x249b33[_0x1556('0x4a')]['id']}})[_0x1556('0x27')](handleEntityNotFound(_0x1749cc,null))[_0x1556('0x27')](function(_0xafdff6){if(_0xafdff6){_0x585964=_0xafdff6;_0x5a8d1c['model']=_['keys'](db[_0x1556('0x4f')][_0x1556('0x30')]);_0x5a8d1c[_0x1556('0x36')]=_['keys'](_0x249b33['query']);_0x5a8d1c['filters']=_[_0x1556('0x38')](_0x5a8d1c[_0x1556('0x33')],_0x5a8d1c[_0x1556('0x36')]);_0x35b0f0[_0x1556('0x37')]=_['intersection'](_0x5a8d1c[_0x1556('0x33')],qs[_0x1556('0x39')](_0x249b33[_0x1556('0x36')][_0x1556('0x39')]));_0x35b0f0['attributes']=_0x35b0f0['attributes']['length']?_0x35b0f0[_0x1556('0x37')]:_0x5a8d1c['model'];_0x35b0f0[_0x1556('0x3d')]=qs['sort'](_0x249b33[_0x1556('0x36')][_0x1556('0x3e')]);_0x35b0f0[_0x1556('0x3f')]=qs[_0x1556('0x35')](_[_0x1556('0x40')](_0x249b33[_0x1556('0x36')],_0x5a8d1c[_0x1556('0x35')]));if(_0x249b33['query'][_0x1556('0x41')]){_0x35b0f0['where']=_[_0x1556('0x42')](_0x35b0f0[_0x1556('0x3f')],{'$or':_[_0x1556('0x2e')](_0x35b0f0['attributes'],function(_0x57d7f2){var _0x4398e1={};_0x4398e1[_0x57d7f2]={'$like':'%'+_0x249b33['query'][_0x1556('0x41')]+'%'};return _0x4398e1;})});}_0x35b0f0=_[_0x1556('0x42')]({},_0x35b0f0,_0x249b33[_0x1556('0x44')]);return _0x585964[_0x1556('0x4e')](_0x35b0f0);}})[_0x1556('0x27')](function(_0x2e2903){if(_0x2e2903){_0x5a3636=_0x2e2903[_0x1556('0x3a')];if(!_0x249b33[_0x1556('0x36')]['hasOwnProperty'](_0x1556('0x3c'))){_0x35b0f0[_0x1556('0x20')]=qs['limit'](_0x249b33[_0x1556('0x36')][_0x1556('0x20')]);_0x35b0f0[_0x1556('0x1e')]=qs[_0x1556('0x1e')](_0x249b33['query'][_0x1556('0x1e')]);}return _0x585964[_0x1556('0x4e')](_0x35b0f0);}})[_0x1556('0x27')](function(_0x4e2929){if(_0x4e2929){return _0x4e2929?{'count':_0x5a3636,'rows':_0x4e2929}:null;}})['then'](respondWithResult(_0x1749cc,null))[_0x1556('0x48')](handleError(_0x1749cc,null));};exports['getSubjects']=function(_0x4796cd,_0x1437be,_0x3cc0f8){var _0x110f6c={};var _0x35139d={};var _0x3dbd84;var _0x59c6a5;return db[_0x1556('0x2f')][_0x1556('0x50')]({'where':{'id':_0x4796cd[_0x1556('0x4a')]['id']}})[_0x1556('0x27')](handleEntityNotFound(_0x1437be,null))['then'](function(_0x24cdc5){if(_0x24cdc5){_0x3dbd84=_0x24cdc5;_0x35139d[_0x1556('0x33')]=_['keys'](db[_0x1556('0x4f')][_0x1556('0x30')]);_0x35139d[_0x1556('0x36')]=_[_0x1556('0x34')](_0x4796cd[_0x1556('0x36')]);_0x35139d[_0x1556('0x35')]=_[_0x1556('0x38')](_0x35139d[_0x1556('0x33')],_0x35139d['query']);_0x110f6c['attributes']=_[_0x1556('0x38')](_0x35139d[_0x1556('0x33')],qs[_0x1556('0x39')](_0x4796cd[_0x1556('0x36')][_0x1556('0x39')]));_0x110f6c[_0x1556('0x37')]=_0x110f6c['attributes'][_0x1556('0x3a')]?_0x110f6c['attributes']:_0x35139d[_0x1556('0x33')];_0x110f6c[_0x1556('0x3d')]=qs[_0x1556('0x3e')](_0x4796cd[_0x1556('0x36')][_0x1556('0x3e')]);_0x110f6c[_0x1556('0x3f')]=qs[_0x1556('0x35')](_['pick'](_0x4796cd['query'],_0x35139d[_0x1556('0x35')]));if(_0x4796cd['query'][_0x1556('0x41')]){_0x110f6c['where']=_[_0x1556('0x42')](_0x110f6c[_0x1556('0x3f')],{'$or':_[_0x1556('0x2e')](_0x110f6c[_0x1556('0x37')],function(_0x32c6f6){var _0x8ecc9e={};_0x8ecc9e[_0x32c6f6]={'$like':'%'+_0x4796cd[_0x1556('0x36')][_0x1556('0x41')]+'%'};return _0x8ecc9e;})});}_0x110f6c=_[_0x1556('0x42')]({},_0x110f6c,_0x4796cd[_0x1556('0x44')]);return _0x3dbd84['getSubjects'](_0x110f6c);}})[_0x1556('0x27')](function(_0x1a877b){if(_0x1a877b){_0x59c6a5=_0x1a877b[_0x1556('0x3a')];if(!_0x4796cd[_0x1556('0x36')]['hasOwnProperty']('nolimit')){_0x110f6c[_0x1556('0x20')]=qs[_0x1556('0x20')](_0x4796cd[_0x1556('0x36')][_0x1556('0x20')]);_0x110f6c[_0x1556('0x1e')]=qs[_0x1556('0x1e')](_0x4796cd['query'][_0x1556('0x1e')]);}return _0x3dbd84[_0x1556('0x51')](_0x110f6c);}})[_0x1556('0x27')](function(_0x55e62b){if(_0x55e62b){return _0x55e62b?{'count':_0x59c6a5,'rows':_0x55e62b}:null;}})[_0x1556('0x27')](respondWithResult(_0x1437be,null))[_0x1556('0x48')](handleError(_0x1437be,null));};exports[_0x1556('0x52')]=function(_0x10caaa,_0x3e2f37,_0x59454b){var _0x46641c={};var _0x57d17c={};var _0x5f44a7;var _0x5d1df7;return db[_0x1556('0x2f')]['findOne']({'where':{'id':_0x10caaa['params']['id']}})[_0x1556('0x27')](handleEntityNotFound(_0x3e2f37,null))['then'](function(_0x49d4bb){if(_0x49d4bb){_0x5f44a7=_0x49d4bb;_0x57d17c[_0x1556('0x33')]=_['keys'](db[_0x1556('0x4f')][_0x1556('0x30')]);_0x57d17c['query']=_[_0x1556('0x34')](_0x10caaa[_0x1556('0x36')]);_0x57d17c['filters']=_['intersection'](_0x57d17c[_0x1556('0x33')],_0x57d17c[_0x1556('0x36')]);_0x46641c['attributes']=_['intersection'](_0x57d17c[_0x1556('0x33')],qs['fields'](_0x10caaa[_0x1556('0x36')][_0x1556('0x39')]));_0x46641c[_0x1556('0x37')]=_0x46641c[_0x1556('0x37')]['length']?_0x46641c['attributes']:_0x57d17c[_0x1556('0x33')];_0x46641c['order']=qs[_0x1556('0x3e')](_0x10caaa['query']['sort']);_0x46641c[_0x1556('0x3f')]=qs[_0x1556('0x35')](_[_0x1556('0x40')](_0x10caaa[_0x1556('0x36')],_0x57d17c[_0x1556('0x35')]));if(_0x10caaa[_0x1556('0x36')][_0x1556('0x41')]){_0x46641c[_0x1556('0x3f')]=_['merge'](_0x46641c[_0x1556('0x3f')],{'$or':_[_0x1556('0x2e')](_0x46641c[_0x1556('0x37')],function(_0x3dcf46){var _0x4c2507={};_0x4c2507[_0x3dcf46]={'$like':'%'+_0x10caaa[_0x1556('0x36')][_0x1556('0x41')]+'%'};return _0x4c2507;})});}_0x46641c=_[_0x1556('0x42')]({},_0x46641c,_0x10caaa['options']);return _0x5f44a7[_0x1556('0x52')](_0x46641c);}})[_0x1556('0x27')](function(_0x5c62c4){if(_0x5c62c4){_0x5d1df7=_0x5c62c4[_0x1556('0x3a')];if(!_0x10caaa[_0x1556('0x36')][_0x1556('0x3b')](_0x1556('0x3c'))){_0x46641c[_0x1556('0x20')]=qs[_0x1556('0x20')](_0x10caaa[_0x1556('0x36')][_0x1556('0x20')]);_0x46641c['offset']=qs['offset'](_0x10caaa[_0x1556('0x36')][_0x1556('0x1e')]);}return _0x5f44a7[_0x1556('0x52')](_0x46641c);}})['then'](function(_0x5f36b4){if(_0x5f36b4){return _0x5f36b4?{'count':_0x5d1df7,'rows':_0x5f36b4}:null;}})['then'](respondWithResult(_0x3e2f37,null))['catch'](handleError(_0x3e2f37,null));};
\ No newline at end of file
index 5096d52..5100892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3152=['VtigerConfiguration','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define'];(function(_0x469343,_0x274ccc){var _0x5800f3=function(_0x427fe4){while(--_0x427fe4){_0x469343['push'](_0x469343['shift']());}};_0x5800f3(++_0x274ccc);}(_0x3152,0x7a));var _0x2315=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3152[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x2315('0x0'));var util=require('util');var logger=require(_0x2315('0x1'))('api');var moment=require(_0x2315('0x2'));var BPromise=require(_0x2315('0x3'));var rp=require(_0x2315('0x4'));var fs=require('fs');var path=require(_0x2315('0x5'));var rimraf=require(_0x2315('0x6'));var config=require(_0x2315('0x7'));var attributes=require(_0x2315('0x8'));module['exports']=function(_0x56a139,_0x5aa317){return _0x56a139[_0x2315('0x9')](_0x2315('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x58f7=['rimraf','exports','int_vtiger_configurations','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x58f7,0xd2));var _0x758f=function(_0x530245,_0x1541ab){_0x530245=_0x530245-0x0;var _0x22506d=_0x58f7[_0x530245];return _0x22506d;};'use strict';var _=require('lodash');var util=require(_0x758f('0x0'));var logger=require(_0x758f('0x1'))(_0x758f('0x2'));var moment=require(_0x758f('0x3'));var BPromise=require(_0x758f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x758f('0x5'));var rimraf=require(_0x758f('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x758f('0x7')]=function(_0x5861d7,_0x53a554){return _0x5861d7['define']('VtigerConfiguration',attributes,{'tableName':_0x758f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 994f63b..9436841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f2=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x521cbd,_0x5b806b){var _0x3ca58a=function(_0x49ddbb){while(--_0x49ddbb){_0x521cbd['push'](_0x521cbd['shift']());}};_0x3ca58a(++_0x5b806b);}(_0x66f2,0xd8));var _0x266f=function(_0x3212cc,_0x3bfe46){_0x3212cc=_0x3212cc-0x0;var _0x3ecd2c=_0x66f2[_0x3212cc];return _0x3ecd2c;};'use strict';var _=require(_0x266f('0x0'));var util=require(_0x266f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x266f('0x2'));var db=require(_0x266f('0x3'))['db'];var utils=require(_0x266f('0x4'));var logger=require(_0x266f('0x5'))(_0x266f('0x6'));var config=require(_0x266f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x266f('0x8')][_0x266f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368278,_0x121909,_0x599a84){return new BPromise(function(_0x33372a,_0x1cc3a8){return client[_0x266f('0xa')](_0x368278,_0x599a84)[_0x266f('0xb')](function(_0x4b59d5){logger['info'](_0x266f('0xc'),_0x121909,'request\x20sent');logger['debug'](_0x266f('0xd'),_0x121909,_0x266f('0xe'),JSON[_0x266f('0xf')](_0x4b59d5));if(_0x4b59d5['error']){if(_0x4b59d5[_0x266f('0x10')][_0x266f('0x11')]===0x1f4){logger[_0x266f('0x10')](_0x266f('0xc'),_0x121909,_0x4b59d5[_0x266f('0x10')][_0x266f('0x12')]);return _0x1cc3a8(_0x4b59d5[_0x266f('0x10')][_0x266f('0x12')]);}logger[_0x266f('0x10')](_0x266f('0xc'),_0x121909,_0x4b59d5[_0x266f('0x10')][_0x266f('0x12')]);return _0x33372a(_0x4b59d5[_0x266f('0x10')][_0x266f('0x12')]);}else{logger[_0x266f('0x13')](_0x266f('0xc'),_0x121909,'request\x20sent');_0x33372a(_0x4b59d5[_0x266f('0x14')][_0x266f('0x12')]);}})[_0x266f('0x15')](function(_0x58e1aa){logger[_0x266f('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x121909,_0x58e1aa);_0x1cc3a8(_0x58e1aa);});});}
\ No newline at end of file
+var _0x5f67=['jayson/promise','http','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5ba252,_0x2fc1b6){var _0xe4abe0=function(_0x3e1ddb){while(--_0x3e1ddb){_0x5ba252['push'](_0x5ba252['shift']());}};_0xe4abe0(++_0x2fc1b6);}(_0x5f67,0x141));var _0x75f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f67[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75f6('0x0'));var util=require('util');var moment=require(_0x75f6('0x1'));var BPromise=require(_0x75f6('0x2'));var rs=require(_0x75f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75f6('0x4'))['db'];var utils=require(_0x75f6('0x5'));var logger=require(_0x75f6('0x6'))(_0x75f6('0x7'));var config=require(_0x75f6('0x8'));var jayson=require(_0x75f6('0x9'));var client=jayson['client'][_0x75f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a2258,_0x33022d,_0x5bf3a8){return new BPromise(function(_0x2fd259,_0x26a872){return client['request'](_0x2a2258,_0x5bf3a8)[_0x75f6('0xb')](function(_0x34e673){logger['info'](_0x75f6('0xc'),_0x33022d,'request\x20sent');logger[_0x75f6('0xd')](_0x75f6('0xe'),_0x33022d,_0x75f6('0xf'),JSON[_0x75f6('0x10')](_0x34e673));if(_0x34e673[_0x75f6('0x11')]){if(_0x34e673[_0x75f6('0x11')]['code']===0x1f4){logger[_0x75f6('0x11')](_0x75f6('0xc'),_0x33022d,_0x34e673[_0x75f6('0x11')]['message']);return _0x26a872(_0x34e673[_0x75f6('0x11')][_0x75f6('0x12')]);}logger[_0x75f6('0x11')](_0x75f6('0xc'),_0x33022d,_0x34e673[_0x75f6('0x11')]['message']);return _0x2fd259(_0x34e673[_0x75f6('0x11')][_0x75f6('0x12')]);}else{logger[_0x75f6('0x13')](_0x75f6('0xc'),_0x33022d,'request\x20sent');_0x2fd259(_0x34e673[_0x75f6('0x14')]['message']);}})[_0x75f6('0x15')](function(_0x32e085){logger[_0x75f6('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x33022d,_0x32e085);_0x26a872(_0x32e085);});});}
\ No newline at end of file
index 19cd5ce..cb243d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2b=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','update','exports','multer','util'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x6f2b,0x18e));var _0xb6f2=function(_0x1b2bd2,_0x491f68){_0x1b2bd2=_0x1b2bd2-0x0;var _0x34a271=_0x6f2b[_0x1b2bd2];return _0x34a271;};'use strict';var multer=require(_0xb6f2('0x0'));var util=require(_0xb6f2('0x1'));var path=require('path');var timeout=require(_0xb6f2('0x2'));var express=require('express');var router=express[_0xb6f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb6f2('0x4'));var config=require(_0xb6f2('0x5'));var controller=require(_0xb6f2('0x6'));router[_0xb6f2('0x7')]('/',auth[_0xb6f2('0x8')](),controller[_0xb6f2('0x9')]);router[_0xb6f2('0x7')](_0xb6f2('0xa'),auth[_0xb6f2('0x8')](),controller[_0xb6f2('0xb')]);router[_0xb6f2('0xc')]('/',auth['isAuthenticated'](),controller[_0xb6f2('0xd')]);router['put'](_0xb6f2('0xa'),auth[_0xb6f2('0x8')](),controller[_0xb6f2('0xe')]);router['delete']('/:id',auth[_0xb6f2('0x8')](),controller['destroy']);module[_0xb6f2('0xf')]=router;
\ No newline at end of file
+var _0x0afa=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get','/:id'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x0afa,0x11f));var _0xa0af=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0afa[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xa0af('0x0'));var util=require(_0xa0af('0x1'));var path=require(_0xa0af('0x2'));var timeout=require(_0xa0af('0x3'));var express=require(_0xa0af('0x4'));var router=express[_0xa0af('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa0af('0x6'));var interaction=require(_0xa0af('0x7'));var config=require(_0xa0af('0x8'));var controller=require(_0xa0af('0x9'));router['get']('/',auth[_0xa0af('0xa')](),controller['index']);router[_0xa0af('0xb')](_0xa0af('0xc'),auth[_0xa0af('0xa')](),controller[_0xa0af('0xd')]);router[_0xa0af('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0af('0xf')]);router[_0xa0af('0x10')](_0xa0af('0xc'),auth[_0xa0af('0xa')](),controller['update']);router[_0xa0af('0x11')](_0xa0af('0xc'),auth[_0xa0af('0xa')](),controller[_0xa0af('0x12')]);module[_0xa0af('0x13')]=router;
\ No newline at end of file
index dfba8ea..71266d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f5b=['customVariable','BOOLEAN','sequelize','exports','ENUM','keyValue','picklist','string','STRING','variable'];(function(_0x2db588,_0x4b5828){var _0xf72e3d=function(_0xb750bf){while(--_0xb750bf){_0x2db588['push'](_0x2db588['shift']());}};_0xf72e3d(++_0x4b5828);}(_0x0f5b,0x1d8));var _0xb0f5=function(_0x47113f,_0x20532e){_0x47113f=_0x47113f-0x0;var _0x1a95bb=_0x0f5b[_0x47113f];return _0x1a95bb;};'use strict';var Sequelize=require(_0xb0f5('0x0'));module[_0xb0f5('0x1')]={'type':{'type':Sequelize[_0xb0f5('0x2')]('string','variable','customVariable',_0xb0f5('0x3'),_0xb0f5('0x4')),'defaultValue':_0xb0f5('0x5')},'content':{'type':Sequelize[_0xb0f5('0x6')]},'key':{'type':Sequelize[_0xb0f5('0x6')]},'keyType':{'type':Sequelize[_0xb0f5('0x2')](_0xb0f5('0x5'),_0xb0f5('0x7'),_0xb0f5('0x8'))},'keyContent':{'type':Sequelize[_0xb0f5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb0f5('0x6')]},'customField':{'type':Sequelize[_0xb0f5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb0f5('0x6')]}};
\ No newline at end of file
+var _0x1648=['sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x553c2a,_0x592c23){var _0x37988b=function(_0x5ccdf1){while(--_0x5ccdf1){_0x553c2a['push'](_0x553c2a['shift']());}};_0x37988b(++_0x592c23);}(_0x1648,0x1f0));var _0x8164=function(_0x304914,_0xfdde44){_0x304914=_0x304914-0x0;var _0x37270c=_0x1648[_0x304914];return _0x37270c;};'use strict';var Sequelize=require(_0x8164('0x0'));module[_0x8164('0x1')]={'type':{'type':Sequelize[_0x8164('0x2')]('string',_0x8164('0x3'),_0x8164('0x4'),_0x8164('0x5'),'picklist'),'defaultValue':_0x8164('0x6')},'content':{'type':Sequelize[_0x8164('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8164('0x2')]('string','variable',_0x8164('0x4'))},'keyContent':{'type':Sequelize[_0x8164('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8164('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8164('0x7')]}};
\ No newline at end of file
index bb6788c..d76a9d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5046=['save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x49a3c6,_0xbabfd3){var _0xaedf97=function(_0x35233c){while(--_0x35233c){_0x49a3c6['push'](_0x49a3c6['shift']());}};_0xaedf97(++_0xbabfd3);}(_0x5046,0x113));var _0x6504=function(_0x2e7877,_0x35b5e2){_0x2e7877=_0x2e7877-0x0;var _0x1beda8=_0x5046[_0x2e7877];return _0x1beda8;};'use strict';var emlformat=require(_0x6504('0x0'));var rimraf=require(_0x6504('0x1'));var zipdir=require(_0x6504('0x2'));var jsonpatch=require(_0x6504('0x3'));var rp=require('request-promise');var moment=require(_0x6504('0x4'));var BPromise=require(_0x6504('0x5'));var Mustache=require(_0x6504('0x6'));var util=require(_0x6504('0x7'));var path=require('path');var sox=require(_0x6504('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6504('0x9'));var _=require(_0x6504('0xa'));var squel=require(_0x6504('0xb'));var crypto=require(_0x6504('0xc'));var jsforce=require(_0x6504('0xd'));var deskjs=require(_0x6504('0xe'));var toCsv=require(_0x6504('0xf'));var querystring=require('querystring');var Papa=require(_0x6504('0x10'));var Redis=require(_0x6504('0x11'));var authService=require(_0x6504('0x12'));var qs=require(_0x6504('0x13'));var as=require(_0x6504('0x14'));var hardwareService=require(_0x6504('0x15'));var logger=require('../../config/logger')(_0x6504('0x16'));var utils=require('../../config/utils');var config=require(_0x6504('0x17'));var licenseUtil=require(_0x6504('0x18'));var db=require(_0x6504('0x19'))['db'];function respondWithStatusCode(_0x36fc94,_0x4d5bdf){_0x4d5bdf=_0x4d5bdf||0xcc;return function(_0x99792e){if(_0x99792e){return _0x36fc94['sendStatus'](_0x4d5bdf);}return _0x36fc94[_0x6504('0x1a')](_0x4d5bdf)[_0x6504('0x1b')]();};}function respondWithResult(_0x388174,_0x63fcbf){_0x63fcbf=_0x63fcbf||0xc8;return function(_0x4f5096){if(_0x4f5096){return _0x388174[_0x6504('0x1a')](_0x63fcbf)[_0x6504('0x1c')](_0x4f5096);}};}function respondWithFilteredResult(_0xdedfeb,_0x253a3c){return function(_0x55c055){if(_0x55c055){var _0x4bc285=typeof _0x253a3c[_0x6504('0x1d')]===_0x6504('0x1e')&&typeof _0x253a3c['limit']==='undefined';var _0x466b35=_0x55c055[_0x6504('0x1f')];var _0x802abf=_0x4bc285?0x0:_0x253a3c[_0x6504('0x1d')];var _0x4b854b=_0x4bc285?_0x55c055['count']:_0x253a3c[_0x6504('0x1d')]+_0x253a3c[_0x6504('0x20')];var _0x5cb527;if(_0x4b854b>=_0x466b35){_0x4b854b=_0x466b35;_0x5cb527=0xc8;}else{_0x5cb527=0xce;}_0xdedfeb['status'](_0x5cb527);return _0xdedfeb[_0x6504('0x21')](_0x6504('0x22'),_0x802abf+'-'+_0x4b854b+'/'+_0x466b35)[_0x6504('0x1c')](_0x55c055);}return null;};}function patchUpdates(_0x5ccf42){return function(_0x2f1809){try{jsonpatch[_0x6504('0x23')](_0x2f1809,_0x5ccf42,!![]);}catch(_0x2f9b53){return BPromise[_0x6504('0x24')](_0x2f9b53);}return _0x2f1809[_0x6504('0x25')]();};}function saveUpdates(_0x37a81f,_0x6b303d){return function(_0x2174df){if(_0x2174df){return _0x2174df[_0x6504('0x26')](_0x37a81f)[_0x6504('0x27')](function(_0x50fa0d){return _0x50fa0d;});}return null;};}function removeEntity(_0x1852fe,_0x473f0e){return function(_0x2c00e1){if(_0x2c00e1){return _0x2c00e1[_0x6504('0x28')]()['then'](function(){_0x1852fe[_0x6504('0x1a')](0xcc)[_0x6504('0x1b')]();});}};}function handleEntityNotFound(_0x4c4a70,_0x488afb){return function(_0x47bc56){if(!_0x47bc56){_0x4c4a70[_0x6504('0x29')](0x194);}return _0x47bc56;};}function handleError(_0x1b2fc3,_0x3e39fc){_0x3e39fc=_0x3e39fc||0x1f4;return function(_0xeea1b0){logger[_0x6504('0x2a')](_0xeea1b0[_0x6504('0x2b')]);if(_0xeea1b0[_0x6504('0x2c')]){delete _0xeea1b0[_0x6504('0x2c')];}_0x1b2fc3['status'](_0x3e39fc)[_0x6504('0x2d')](_0xeea1b0);};}exports[_0x6504('0x2e')]=function(_0x311597,_0x5f1ecc){var _0x31c766={},_0x2c618a={},_0x2b934d={'count':0x0,'rows':[]};var _0x7877a0=_[_0x6504('0x2f')](db[_0x6504('0x30')][_0x6504('0x31')],function(_0x39e2d8){return{'name':_0x39e2d8['fieldName'],'type':_0x39e2d8[_0x6504('0x32')]['key']};});_0x2c618a[_0x6504('0x33')]=_[_0x6504('0x2f')](_0x7877a0,_0x6504('0x2c'));_0x2c618a[_0x6504('0x34')]=_['keys'](_0x311597['query']);_0x2c618a[_0x6504('0x35')]=_[_0x6504('0x36')](_0x2c618a[_0x6504('0x33')],_0x2c618a[_0x6504('0x34')]);_0x31c766['attributes']=_[_0x6504('0x36')](_0x2c618a[_0x6504('0x33')],qs[_0x6504('0x37')](_0x311597[_0x6504('0x34')][_0x6504('0x37')]));_0x31c766[_0x6504('0x38')]=_0x31c766[_0x6504('0x38')][_0x6504('0x39')]?_0x31c766[_0x6504('0x38')]:_0x2c618a['model'];if(!_0x311597[_0x6504('0x34')][_0x6504('0x3a')](_0x6504('0x3b'))){_0x31c766[_0x6504('0x20')]=qs[_0x6504('0x20')](_0x311597['query'][_0x6504('0x20')]);_0x31c766[_0x6504('0x1d')]=qs[_0x6504('0x1d')](_0x311597[_0x6504('0x34')]['offset']);}_0x31c766[_0x6504('0x3c')]=qs[_0x6504('0x3d')](_0x311597['query'][_0x6504('0x3d')]);_0x31c766[_0x6504('0x3e')]=qs[_0x6504('0x35')](_[_0x6504('0x3f')](_0x311597[_0x6504('0x34')],_0x2c618a[_0x6504('0x35')]),_0x7877a0);if(_0x311597[_0x6504('0x34')][_0x6504('0x40')]){_0x31c766['where']=_['merge'](_0x31c766['where'],{'$or':_[_0x6504('0x2f')](_0x7877a0,function(_0x1ea61e){if(_0x1ea61e[_0x6504('0x32')]!==_0x6504('0x41')){var _0x5dcb33={};_0x5dcb33[_0x1ea61e[_0x6504('0x2c')]]={'$like':'%'+_0x311597[_0x6504('0x34')][_0x6504('0x40')]+'%'};return _0x5dcb33;}})});}_0x31c766=_[_0x6504('0x42')]({},_0x31c766,_0x311597[_0x6504('0x43')]);var _0x30fdb6={'where':_0x31c766[_0x6504('0x3e')]};return db['VtigerField'][_0x6504('0x1f')](_0x30fdb6)['then'](function(_0x48b202){_0x2b934d[_0x6504('0x1f')]=_0x48b202;if(_0x311597[_0x6504('0x34')][_0x6504('0x44')]){_0x31c766[_0x6504('0x45')]=[{'all':!![]}];}return db[_0x6504('0x30')]['findAll'](_0x31c766);})[_0x6504('0x27')](function(_0x39d7a8){_0x2b934d[_0x6504('0x46')]=_0x39d7a8;return _0x2b934d;})[_0x6504('0x27')](respondWithFilteredResult(_0x5f1ecc,_0x31c766))[_0x6504('0x47')](handleError(_0x5f1ecc,null));};exports[_0x6504('0x48')]=function(_0x1a57bb,_0x50cbf7){var _0xf8a5f3={'raw':!![],'where':{'id':_0x1a57bb[_0x6504('0x49')]['id']}},_0x6638a3={};_0x6638a3['model']=_['keys'](db[_0x6504('0x30')][_0x6504('0x31')]);_0x6638a3[_0x6504('0x34')]=_[_0x6504('0x4a')](_0x1a57bb[_0x6504('0x34')]);_0x6638a3['filters']=_[_0x6504('0x36')](_0x6638a3['model'],_0x6638a3[_0x6504('0x34')]);_0xf8a5f3[_0x6504('0x38')]=_[_0x6504('0x36')](_0x6638a3['model'],qs[_0x6504('0x37')](_0x1a57bb['query'][_0x6504('0x37')]));_0xf8a5f3[_0x6504('0x38')]=_0xf8a5f3[_0x6504('0x38')][_0x6504('0x39')]?_0xf8a5f3[_0x6504('0x38')]:_0x6638a3[_0x6504('0x33')];if(_0x1a57bb[_0x6504('0x34')]['includeAll']){_0xf8a5f3[_0x6504('0x45')]=[{'all':!![]}];}_0xf8a5f3=_[_0x6504('0x42')]({},_0xf8a5f3,_0x1a57bb[_0x6504('0x43')]);return db[_0x6504('0x30')][_0x6504('0x4b')](_0xf8a5f3)[_0x6504('0x27')](handleEntityNotFound(_0x50cbf7,null))[_0x6504('0x27')](respondWithResult(_0x50cbf7,null))['catch'](handleError(_0x50cbf7,null));};exports[_0x6504('0x4c')]=function(_0x3ddd60,_0x4b58ae){return db['VtigerField'][_0x6504('0x4c')](_0x3ddd60[_0x6504('0x4d')],{})['then'](respondWithResult(_0x4b58ae,0xc9))[_0x6504('0x47')](handleError(_0x4b58ae,null));};exports[_0x6504('0x26')]=function(_0x90237c,_0x25dac2){if(_0x90237c[_0x6504('0x4d')]['id']){delete _0x90237c[_0x6504('0x4d')]['id'];}return db[_0x6504('0x30')]['find']({'where':{'id':_0x90237c['params']['id']}})[_0x6504('0x27')](handleEntityNotFound(_0x25dac2,null))[_0x6504('0x27')](saveUpdates(_0x90237c[_0x6504('0x4d')],null))[_0x6504('0x27')](respondWithResult(_0x25dac2,null))['catch'](handleError(_0x25dac2,null));};exports[_0x6504('0x28')]=function(_0x49a762,_0x4f804f){return db[_0x6504('0x30')][_0x6504('0x4b')]({'where':{'id':_0x49a762[_0x6504('0x49')]['id']}})[_0x6504('0x27')](handleEntityNotFound(_0x4f804f,null))[_0x6504('0x27')](removeEntity(_0x4f804f,null))['catch'](handleError(_0x4f804f,null));};
\ No newline at end of file
+var _0xc073=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','VtigerField','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto'];(function(_0x38eb4a,_0x173887){var _0x26fac6=function(_0x5040e2){while(--_0x5040e2){_0x38eb4a['push'](_0x38eb4a['shift']());}};_0x26fac6(++_0x173887);}(_0xc073,0x1c7));var _0x3c07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc073[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3c07('0x0'));var rimraf=require(_0x3c07('0x1'));var zipdir=require(_0x3c07('0x2'));var jsonpatch=require(_0x3c07('0x3'));var rp=require(_0x3c07('0x4'));var moment=require(_0x3c07('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c07('0x6'));var util=require(_0x3c07('0x7'));var path=require('path');var sox=require(_0x3c07('0x8'));var csv=require(_0x3c07('0x9'));var ejs=require(_0x3c07('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c07('0xb'));var crypto=require(_0x3c07('0xc'));var jsforce=require(_0x3c07('0xd'));var deskjs=require(_0x3c07('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c07('0xf'));var Papa=require(_0x3c07('0x10'));var Redis=require(_0x3c07('0x11'));var authService=require(_0x3c07('0x12'));var qs=require(_0x3c07('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c07('0x14'))(_0x3c07('0x15'));var utils=require(_0x3c07('0x16'));var config=require(_0x3c07('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c07('0x18'))['db'];function respondWithStatusCode(_0x248d57,_0x4172e1){_0x4172e1=_0x4172e1||0xcc;return function(_0x3f48a7){if(_0x3f48a7){return _0x248d57[_0x3c07('0x19')](_0x4172e1);}return _0x248d57[_0x3c07('0x1a')](_0x4172e1)[_0x3c07('0x1b')]();};}function respondWithResult(_0x3907a5,_0x10db9c){_0x10db9c=_0x10db9c||0xc8;return function(_0x1ad4bc){if(_0x1ad4bc){return _0x3907a5[_0x3c07('0x1a')](_0x10db9c)[_0x3c07('0x1c')](_0x1ad4bc);}};}function respondWithFilteredResult(_0x4f6c31,_0x4b91a3){return function(_0x140b6b){if(_0x140b6b){var _0x584923=typeof _0x4b91a3[_0x3c07('0x1d')]===_0x3c07('0x1e')&&typeof _0x4b91a3['limit']===_0x3c07('0x1e');var _0x27f490=_0x140b6b[_0x3c07('0x1f')];var _0x49fe3d=_0x584923?0x0:_0x4b91a3[_0x3c07('0x1d')];var _0x3e1760=_0x584923?_0x140b6b[_0x3c07('0x1f')]:_0x4b91a3[_0x3c07('0x1d')]+_0x4b91a3[_0x3c07('0x20')];var _0x325f27;if(_0x3e1760>=_0x27f490){_0x3e1760=_0x27f490;_0x325f27=0xc8;}else{_0x325f27=0xce;}_0x4f6c31[_0x3c07('0x1a')](_0x325f27);return _0x4f6c31[_0x3c07('0x21')](_0x3c07('0x22'),_0x49fe3d+'-'+_0x3e1760+'/'+_0x27f490)[_0x3c07('0x1c')](_0x140b6b);}return null;};}function patchUpdates(_0x3cebf9){return function(_0x59966d){try{jsonpatch[_0x3c07('0x23')](_0x59966d,_0x3cebf9,!![]);}catch(_0x21050b){return BPromise[_0x3c07('0x24')](_0x21050b);}return _0x59966d['save']();};}function saveUpdates(_0x464e0a,_0x124753){return function(_0x41d063){if(_0x41d063){return _0x41d063[_0x3c07('0x25')](_0x464e0a)['then'](function(_0x104567){return _0x104567;});}return null;};}function removeEntity(_0xac4693,_0x19c082){return function(_0x214bbf){if(_0x214bbf){return _0x214bbf[_0x3c07('0x26')]()[_0x3c07('0x27')](function(){_0xac4693[_0x3c07('0x1a')](0xcc)[_0x3c07('0x1b')]();});}};}function handleEntityNotFound(_0x463cce,_0x1efb02){return function(_0x50fb31){if(!_0x50fb31){_0x463cce[_0x3c07('0x19')](0x194);}return _0x50fb31;};}function handleError(_0x360f73,_0x248c48){_0x248c48=_0x248c48||0x1f4;return function(_0x5d9346){logger[_0x3c07('0x28')](_0x5d9346[_0x3c07('0x29')]);if(_0x5d9346['name']){delete _0x5d9346[_0x3c07('0x2a')];}_0x360f73['status'](_0x248c48)[_0x3c07('0x2b')](_0x5d9346);};}exports[_0x3c07('0x2c')]=function(_0x432ac4,_0x3fcf88){var _0x24cad9={},_0x73148b={},_0x282908={'count':0x0,'rows':[]};var _0x2517fa=_['map'](db['VtigerField'][_0x3c07('0x2d')],function(_0x4fed0c){return{'name':_0x4fed0c[_0x3c07('0x2e')],'type':_0x4fed0c[_0x3c07('0x2f')][_0x3c07('0x30')]};});_0x73148b[_0x3c07('0x31')]=_[_0x3c07('0x32')](_0x2517fa,_0x3c07('0x2a'));_0x73148b[_0x3c07('0x33')]=_[_0x3c07('0x34')](_0x432ac4['query']);_0x73148b[_0x3c07('0x35')]=_[_0x3c07('0x36')](_0x73148b[_0x3c07('0x31')],_0x73148b[_0x3c07('0x33')]);_0x24cad9[_0x3c07('0x37')]=_[_0x3c07('0x36')](_0x73148b[_0x3c07('0x31')],qs[_0x3c07('0x38')](_0x432ac4[_0x3c07('0x33')]['fields']));_0x24cad9['attributes']=_0x24cad9[_0x3c07('0x37')][_0x3c07('0x39')]?_0x24cad9[_0x3c07('0x37')]:_0x73148b[_0x3c07('0x31')];if(!_0x432ac4[_0x3c07('0x33')][_0x3c07('0x3a')](_0x3c07('0x3b'))){_0x24cad9[_0x3c07('0x20')]=qs['limit'](_0x432ac4[_0x3c07('0x33')][_0x3c07('0x20')]);_0x24cad9[_0x3c07('0x1d')]=qs[_0x3c07('0x1d')](_0x432ac4[_0x3c07('0x33')][_0x3c07('0x1d')]);}_0x24cad9[_0x3c07('0x3c')]=qs[_0x3c07('0x3d')](_0x432ac4[_0x3c07('0x33')]['sort']);_0x24cad9[_0x3c07('0x3e')]=qs[_0x3c07('0x35')](_['pick'](_0x432ac4['query'],_0x73148b[_0x3c07('0x35')]),_0x2517fa);if(_0x432ac4[_0x3c07('0x33')]['filter']){_0x24cad9[_0x3c07('0x3e')]=_[_0x3c07('0x3f')](_0x24cad9['where'],{'$or':_['map'](_0x2517fa,function(_0x1124dd){if(_0x1124dd[_0x3c07('0x2f')]!==_0x3c07('0x40')){var _0xfc140c={};_0xfc140c[_0x1124dd['name']]={'$like':'%'+_0x432ac4[_0x3c07('0x33')][_0x3c07('0x41')]+'%'};return _0xfc140c;}})});}_0x24cad9=_[_0x3c07('0x3f')]({},_0x24cad9,_0x432ac4[_0x3c07('0x42')]);var _0x414cfe={'where':_0x24cad9['where']};return db['VtigerField']['count'](_0x414cfe)['then'](function(_0x2de70a){_0x282908[_0x3c07('0x1f')]=_0x2de70a;if(_0x432ac4['query'][_0x3c07('0x43')]){_0x24cad9[_0x3c07('0x44')]=[{'all':!![]}];}return db[_0x3c07('0x45')][_0x3c07('0x46')](_0x24cad9);})['then'](function(_0xda3534){_0x282908[_0x3c07('0x47')]=_0xda3534;return _0x282908;})['then'](respondWithFilteredResult(_0x3fcf88,_0x24cad9))[_0x3c07('0x48')](handleError(_0x3fcf88,null));};exports[_0x3c07('0x49')]=function(_0x1f817d,_0x6be5c){var _0x213a83={'raw':!![],'where':{'id':_0x1f817d[_0x3c07('0x4a')]['id']}},_0x28f2a2={};_0x28f2a2[_0x3c07('0x31')]=_[_0x3c07('0x34')](db[_0x3c07('0x45')]['rawAttributes']);_0x28f2a2[_0x3c07('0x33')]=_[_0x3c07('0x34')](_0x1f817d[_0x3c07('0x33')]);_0x28f2a2[_0x3c07('0x35')]=_[_0x3c07('0x36')](_0x28f2a2['model'],_0x28f2a2[_0x3c07('0x33')]);_0x213a83[_0x3c07('0x37')]=_[_0x3c07('0x36')](_0x28f2a2[_0x3c07('0x31')],qs[_0x3c07('0x38')](_0x1f817d[_0x3c07('0x33')][_0x3c07('0x38')]));_0x213a83[_0x3c07('0x37')]=_0x213a83[_0x3c07('0x37')][_0x3c07('0x39')]?_0x213a83[_0x3c07('0x37')]:_0x28f2a2[_0x3c07('0x31')];if(_0x1f817d[_0x3c07('0x33')][_0x3c07('0x43')]){_0x213a83[_0x3c07('0x44')]=[{'all':!![]}];}_0x213a83=_[_0x3c07('0x3f')]({},_0x213a83,_0x1f817d[_0x3c07('0x42')]);return db['VtigerField']['find'](_0x213a83)[_0x3c07('0x27')](handleEntityNotFound(_0x6be5c,null))[_0x3c07('0x27')](respondWithResult(_0x6be5c,null))[_0x3c07('0x48')](handleError(_0x6be5c,null));};exports[_0x3c07('0x4b')]=function(_0x5a17d9,_0x18cc90){return db['VtigerField'][_0x3c07('0x4b')](_0x5a17d9[_0x3c07('0x4c')],{})[_0x3c07('0x27')](respondWithResult(_0x18cc90,0xc9))[_0x3c07('0x48')](handleError(_0x18cc90,null));};exports['update']=function(_0x158280,_0x48d3ff){if(_0x158280[_0x3c07('0x4c')]['id']){delete _0x158280['body']['id'];}return db['VtigerField'][_0x3c07('0x4d')]({'where':{'id':_0x158280[_0x3c07('0x4a')]['id']}})[_0x3c07('0x27')](handleEntityNotFound(_0x48d3ff,null))[_0x3c07('0x27')](saveUpdates(_0x158280['body'],null))[_0x3c07('0x27')](respondWithResult(_0x48d3ff,null))['catch'](handleError(_0x48d3ff,null));};exports[_0x3c07('0x26')]=function(_0x254263,_0x23bdb8){return db[_0x3c07('0x45')][_0x3c07('0x4d')]({'where':{'id':_0x254263[_0x3c07('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23bdb8,null))['then'](removeEntity(_0x23bdb8,null))[_0x3c07('0x48')](handleError(_0x23bdb8,null));};
\ No newline at end of file
index a35cfdc..c8a5291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7761=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x1ee43f,_0x4686d8){var _0x1cb212=function(_0x3a8bc6){while(--_0x3a8bc6){_0x1ee43f['push'](_0x1ee43f['shift']());}};_0x1cb212(++_0x4686d8);}(_0x7761,0x112));var _0x1776=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7761[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1776('0x0'));var util=require(_0x1776('0x1'));var logger=require(_0x1776('0x2'))(_0x1776('0x3'));var moment=require(_0x1776('0x4'));var BPromise=require(_0x1776('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1776('0x6'));var rimraf=require(_0x1776('0x7'));var config=require(_0x1776('0x8'));var attributes=require(_0x1776('0x9'));module[_0x1776('0xa')]=function(_0x1a02b7,_0x4e143f){return _0x1a02b7[_0x1776('0xb')](_0x1776('0xc'),attributes,{'tableName':_0x1776('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x1776('0xe'),_0x1776('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6818=['VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x1833b7,_0x12ac8f){var _0x4125a5=function(_0x11eefd){while(--_0x11eefd){_0x1833b7['push'](_0x1833b7['shift']());}};_0x4125a5(++_0x12ac8f);}(_0x6818,0xf4));var _0x8681=function(_0x298722,_0x2174cc){_0x298722=_0x298722-0x0;var _0x2c0131=_0x6818[_0x298722];return _0x2c0131;};'use strict';var _=require(_0x8681('0x0'));var util=require(_0x8681('0x1'));var logger=require(_0x8681('0x2'))('api');var moment=require(_0x8681('0x3'));var BPromise=require(_0x8681('0x4'));var rp=require(_0x8681('0x5'));var fs=require('fs');var path=require(_0x8681('0x6'));var rimraf=require(_0x8681('0x7'));var config=require(_0x8681('0x8'));var attributes=require(_0x8681('0x9'));module[_0x8681('0xa')]=function(_0x565c85,_0x287f15){return _0x565c85[_0x8681('0xb')](_0x8681('0xc'),attributes,{'tableName':_0x8681('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x8681('0xe'),_0x8681('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a2a4462..53334ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7762=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x7762,0x17b));var _0x2776=function(_0x258430,_0x369be7){_0x258430=_0x258430-0x0;var _0x579518=_0x7762[_0x258430];return _0x579518;};'use strict';var _=require(_0x2776('0x0'));var util=require(_0x2776('0x1'));var moment=require(_0x2776('0x2'));var BPromise=require('bluebird');var rs=require(_0x2776('0x3'));var fs=require('fs');var Redis=require(_0x2776('0x4'));var db=require(_0x2776('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2776('0x6'))(_0x2776('0x7'));var config=require('../../config/environment');var jayson=require(_0x2776('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51fb08,_0x15af30,_0x110f10){return new BPromise(function(_0x5364ad,_0x5336a2){return client['request'](_0x51fb08,_0x110f10)[_0x2776('0x9')](function(_0x3847f3){logger[_0x2776('0xa')](_0x2776('0xb'),_0x15af30,_0x2776('0xc'));logger[_0x2776('0xd')](_0x2776('0xe'),_0x15af30,'request\x20sent',JSON['stringify'](_0x3847f3));if(_0x3847f3[_0x2776('0xf')]){if(_0x3847f3[_0x2776('0xf')][_0x2776('0x10')]===0x1f4){logger['error'](_0x2776('0xb'),_0x15af30,_0x3847f3['error'][_0x2776('0x11')]);return _0x5336a2(_0x3847f3['error'][_0x2776('0x11')]);}logger[_0x2776('0xf')](_0x2776('0xb'),_0x15af30,_0x3847f3[_0x2776('0xf')][_0x2776('0x11')]);return _0x5364ad(_0x3847f3[_0x2776('0xf')]['message']);}else{logger[_0x2776('0xa')](_0x2776('0xb'),_0x15af30,'request\x20sent');_0x5364ad(_0x3847f3[_0x2776('0x12')][_0x2776('0x11')]);}})['catch'](function(_0x8ac668){logger[_0x2776('0xf')]('VtigerField,\x20%s,\x20%s',_0x15af30,_0x8ac668);_0x5336a2(_0x8ac668);});});}
\ No newline at end of file
+var _0x8d68=['then','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d68,0xfa));var _0x88d6=function(_0x5eb411,_0x396a6e){_0x5eb411=_0x5eb411-0x0;var _0xa3cbcb=_0x8d68[_0x5eb411];return _0xa3cbcb;};'use strict';var _=require(_0x88d6('0x0'));var util=require(_0x88d6('0x1'));var moment=require(_0x88d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x88d6('0x3'));var fs=require('fs');var Redis=require(_0x88d6('0x4'));var db=require(_0x88d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88d6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88d6('0x7'));var client=jayson[_0x88d6('0x8')][_0x88d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a30c,_0x7009de,_0x5266c0){return new BPromise(function(_0x1b273f,_0x5afd24){return client['request'](_0x13a30c,_0x5266c0)[_0x88d6('0xa')](function(_0x3a3d5b){logger['info']('VtigerField,\x20%s,\x20%s',_0x7009de,_0x88d6('0xb'));logger[_0x88d6('0xc')](_0x88d6('0xd'),_0x7009de,_0x88d6('0xb'),JSON[_0x88d6('0xe')](_0x3a3d5b));if(_0x3a3d5b['error']){if(_0x3a3d5b['error'][_0x88d6('0xf')]===0x1f4){logger[_0x88d6('0x10')](_0x88d6('0x11'),_0x7009de,_0x3a3d5b[_0x88d6('0x10')]['message']);return _0x5afd24(_0x3a3d5b[_0x88d6('0x10')][_0x88d6('0x12')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x7009de,_0x3a3d5b['error'][_0x88d6('0x12')]);return _0x1b273f(_0x3a3d5b[_0x88d6('0x10')]['message']);}else{logger['info'](_0x88d6('0x11'),_0x7009de,_0x88d6('0xb'));_0x1b273f(_0x3a3d5b['result'][_0x88d6('0x12')]);}})[_0x88d6('0x13')](function(_0x56daf8){logger[_0x88d6('0x10')](_0x88d6('0x11'),_0x7009de,_0x56daf8);_0x5afd24(_0x56daf8);});});}
\ No newline at end of file
index 54e8720..a3fd833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3646=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','put','update','delete','/:id'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x3646,0x1b8));var _0x6364=function(_0x3392d8,_0x56e13f){_0x3392d8=_0x3392d8-0x0;var _0x235c10=_0x3646[_0x3392d8];return _0x235c10;};'use strict';var multer=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var path=require(_0x6364('0x2'));var timeout=require(_0x6364('0x3'));var express=require('express');var router=express[_0x6364('0x4')]();var fs_extra=require(_0x6364('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6364('0x6'));var config=require(_0x6364('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x6364('0x8')]('/',auth[_0x6364('0x9')](),controller[_0x6364('0xa')]);router[_0x6364('0x8')]('/:id',auth[_0x6364('0x9')](),controller[_0x6364('0xb')]);router[_0x6364('0x8')](_0x6364('0xc'),auth[_0x6364('0x9')](),controller['getConfigurations']);router['get'](_0x6364('0xd'),auth['isAuthenticated'](),controller[_0x6364('0xe')]);router['post']('/',auth[_0x6364('0x9')](),controller['create']);router[_0x6364('0xf')](_0x6364('0xc'),auth[_0x6364('0x9')](),controller['addConfiguration']);router[_0x6364('0x10')]('/:id',auth[_0x6364('0x9')](),controller[_0x6364('0x11')]);router[_0x6364('0x12')](_0x6364('0x13'),auth[_0x6364('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4320=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','post','create','addConfiguration','put','/:id','update','exports','multer','path','connect-timeout','Router'];(function(_0x58ca90,_0x564543){var _0x49fb41=function(_0x500c37){while(--_0x500c37){_0x58ca90['push'](_0x58ca90['shift']());}};_0x49fb41(++_0x564543);}(_0x4320,0x1f0));var _0x0432=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x4320[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0x0432('0x0'));var util=require('util');var path=require(_0x0432('0x1'));var timeout=require(_0x0432('0x2'));var express=require('express');var router=express[_0x0432('0x3')]();var fs_extra=require(_0x0432('0x4'));var auth=require(_0x0432('0x5'));var interaction=require(_0x0432('0x6'));var config=require(_0x0432('0x7'));var controller=require(_0x0432('0x8'));router[_0x0432('0x9')]('/',auth[_0x0432('0xa')](),controller[_0x0432('0xb')]);router[_0x0432('0x9')]('/:id',auth[_0x0432('0xa')](),controller['show']);router[_0x0432('0x9')](_0x0432('0xc'),auth[_0x0432('0xa')](),controller['getConfigurations']);router[_0x0432('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x0432('0xd')]('/',auth[_0x0432('0xa')](),controller[_0x0432('0xe')]);router[_0x0432('0xd')](_0x0432('0xc'),auth[_0x0432('0xa')](),controller[_0x0432('0xf')]);router[_0x0432('0x10')](_0x0432('0x11'),auth[_0x0432('0xa')](),controller[_0x0432('0x12')]);router['delete'](_0x0432('0x11'),auth[_0x0432('0xa')](),controller['destroy']);module[_0x0432('0x13')]=router;
\ No newline at end of file
index f45e7db..8722ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['integrationTab','newTab','sequelize','exports','STRING','password','ENUM'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2c606c,_0x36d00b){_0x2c606c=_0x2c606c-0x0;var _0x249438=_0xc1c6[_0x2c606c];return _0x249438;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'name':{'type':Sequelize[_0x6c1c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6c1c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6c1c('0x2')]},'token':{'type':Sequelize[_0x6c1c('0x2')]},'remoteUri':{'type':Sequelize[_0x6c1c('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x6c1c('0x3'),'token'),'defaultValue':_0x6c1c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5'),_0x6c1c('0x6')),'defaultValue':_0x6c1c('0x5')}};
\ No newline at end of file
+var _0x81c6=['remoteUri','ENUM','password','token','integrationTab','exports','username','STRING'];(function(_0x19f004,_0x310bfb){var _0x42ce2c=function(_0x33522a){while(--_0x33522a){_0x19f004['push'](_0x19f004['shift']());}};_0x42ce2c(++_0x310bfb);}(_0x81c6,0x1d5));var _0x681c=function(_0x19b9d1,_0x4f603f){_0x19b9d1=_0x19b9d1-0x0;var _0x1ca4f7=_0x81c6[_0x19b9d1];return _0x1ca4f7;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x681c('0x1')},'password':{'type':Sequelize[_0x681c('0x2')]},'token':{'type':Sequelize[_0x681c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x681c('0x3')},'authType':{'type':Sequelize[_0x681c('0x4')](_0x681c('0x5'),_0x681c('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x681c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x681c('0x4')]('integrationTab','newTab'),'defaultValue':_0x681c('0x7')}};
\ No newline at end of file
index b7d0389..f1de904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','map','type'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x58a4,0xbf));var _0x458a=function(_0x5b22e5,_0x50a727){_0x5b22e5=_0x5b22e5-0x0;var _0x50aa89=_0x58a4[_0x5b22e5];return _0x50aa89;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];var integrations=require(_0x458a('0x1a'));function respondWithStatusCode(_0x2a4934,_0x2e788b){_0x2e788b=_0x2e788b||0xcc;return function(_0x5bd09e){if(_0x5bd09e){return _0x2a4934['sendStatus'](_0x2e788b);}return _0x2a4934[_0x458a('0x1b')](_0x2e788b)['end']();};}function respondWithResult(_0x2c7528,_0x44f683){_0x44f683=_0x44f683||0xc8;return function(_0x10133b){if(_0x10133b){return _0x2c7528[_0x458a('0x1b')](_0x44f683)[_0x458a('0x1c')](_0x10133b);}};}function respondWithFilteredResult(_0x29acee,_0x507b0f){return function(_0x4b26be){if(_0x4b26be){var _0x5c7993=typeof _0x507b0f[_0x458a('0x1d')]===_0x458a('0x1e')&&typeof _0x507b0f[_0x458a('0x1f')]==='undefined';var _0x310569=_0x4b26be[_0x458a('0x20')];var _0x18504d=_0x5c7993?0x0:_0x507b0f[_0x458a('0x1d')];var _0xa91473=_0x5c7993?_0x4b26be['count']:_0x507b0f['offset']+_0x507b0f[_0x458a('0x1f')];var _0x4d07a7;if(_0xa91473>=_0x310569){_0xa91473=_0x310569;_0x4d07a7=0xc8;}else{_0x4d07a7=0xce;}_0x29acee[_0x458a('0x1b')](_0x4d07a7);return _0x29acee[_0x458a('0x21')]('Content-Range',_0x18504d+'-'+_0xa91473+'/'+_0x310569)[_0x458a('0x1c')](_0x4b26be);}return null;};}function patchUpdates(_0x55a588){return function(_0x200213){try{jsonpatch[_0x458a('0x22')](_0x200213,_0x55a588,!![]);}catch(_0x59f44c){return BPromise[_0x458a('0x23')](_0x59f44c);}return _0x200213[_0x458a('0x24')]();};}function saveUpdates(_0x5a2bcb,_0xa6b8ff){return function(_0x5ad95a){if(_0x5ad95a){return _0x5ad95a[_0x458a('0x25')](_0x5a2bcb)['then'](function(_0x4080fc){return _0x4080fc;});}return null;};}function removeEntity(_0x5dfc6c,_0x36b08e){return function(_0x911eaf){if(_0x911eaf){return _0x911eaf[_0x458a('0x26')]()[_0x458a('0x27')](function(){_0x5dfc6c[_0x458a('0x1b')](0xcc)[_0x458a('0x28')]();});}};}function handleEntityNotFound(_0x340375,_0x3012c7){return function(_0x1f2d0){if(!_0x1f2d0){_0x340375[_0x458a('0x29')](0x194);}return _0x1f2d0;};}function handleError(_0x52efed,_0x327fcb){_0x327fcb=_0x327fcb||0x1f4;return function(_0x21ec38){logger['error'](_0x21ec38[_0x458a('0x2a')]);if(_0x21ec38[_0x458a('0x2b')]){delete _0x21ec38['name'];}_0x52efed['status'](_0x327fcb)[_0x458a('0x2c')](_0x21ec38);};}exports['index']=function(_0x33c5d8,_0x29f9b5){var _0x223f73={},_0x4a49e4={},_0xa6fdf={'count':0x0,'rows':[]};var _0x2531f7=_[_0x458a('0x2d')](db['ZendeskAccount']['rawAttributes'],function(_0x18c890){return{'name':_0x18c890['fieldName'],'type':_0x18c890[_0x458a('0x2e')]['key']};});_0x4a49e4[_0x458a('0x2f')]=_[_0x458a('0x2d')](_0x2531f7,'name');_0x4a49e4[_0x458a('0x30')]=_[_0x458a('0x31')](_0x33c5d8[_0x458a('0x30')]);_0x4a49e4['filters']=_[_0x458a('0x32')](_0x4a49e4[_0x458a('0x2f')],_0x4a49e4[_0x458a('0x30')]);_0x223f73[_0x458a('0x33')]=_[_0x458a('0x32')](_0x4a49e4['model'],qs[_0x458a('0x34')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x34')]));_0x223f73[_0x458a('0x33')]=_0x223f73[_0x458a('0x33')][_0x458a('0x35')]?_0x223f73['attributes']:_0x4a49e4[_0x458a('0x2f')];if(!_0x33c5d8[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x223f73[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1f')]);_0x223f73[_0x458a('0x1d')]=qs['offset'](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1d')]);}_0x223f73[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x39')]);_0x223f73[_0x458a('0x3a')]=qs[_0x458a('0x3b')](_[_0x458a('0x3c')](_0x33c5d8[_0x458a('0x30')],_0x4a49e4[_0x458a('0x3b')]),_0x2531f7);if(_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]){_0x223f73[_0x458a('0x3a')]=_[_0x458a('0x3e')](_0x223f73['where'],{'$or':_[_0x458a('0x2d')](_0x2531f7,function(_0x397a41){if(_0x397a41[_0x458a('0x2e')]!==_0x458a('0x3f')){var _0x3c5840={};_0x3c5840[_0x397a41[_0x458a('0x2b')]]={'$like':'%'+_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x3c5840;}})});}_0x223f73=_[_0x458a('0x3e')]({},_0x223f73,_0x33c5d8[_0x458a('0x40')]);var _0x20cf10={'where':_0x223f73['where']};return db[_0x458a('0x41')][_0x458a('0x20')](_0x20cf10)['then'](function(_0x430bda){_0xa6fdf[_0x458a('0x20')]=_0x430bda;if(_0x33c5d8[_0x458a('0x30')]['includeAll']){_0x223f73[_0x458a('0x42')]=[{'all':!![]}];}return db[_0x458a('0x41')][_0x458a('0x43')](_0x223f73);})[_0x458a('0x27')](function(_0xbcd632){_0xa6fdf[_0x458a('0x44')]=_0xbcd632;return _0xa6fdf;})[_0x458a('0x27')](respondWithFilteredResult(_0x29f9b5,_0x223f73))[_0x458a('0x45')](handleError(_0x29f9b5,null));};exports['show']=function(_0x296385,_0x145e3c){var _0x2b9030={'raw':![],'where':{'id':_0x296385[_0x458a('0x46')]['id']}},_0x5180ae={};_0x5180ae[_0x458a('0x2f')]=_['keys'](db[_0x458a('0x41')][_0x458a('0x47')]);_0x5180ae[_0x458a('0x30')]=_[_0x458a('0x31')](_0x296385[_0x458a('0x30')]);_0x5180ae['filters']=_['intersection'](_0x5180ae[_0x458a('0x2f')],_0x5180ae[_0x458a('0x30')]);_0x2b9030[_0x458a('0x33')]=_[_0x458a('0x32')](_0x5180ae['model'],qs[_0x458a('0x34')](_0x296385[_0x458a('0x30')]['fields']));_0x2b9030[_0x458a('0x33')]=_0x2b9030['attributes'][_0x458a('0x35')]?_0x2b9030[_0x458a('0x33')]:_0x5180ae[_0x458a('0x2f')];if(_0x296385['query'][_0x458a('0x48')]){_0x2b9030[_0x458a('0x42')]=[{'all':!![]}];}_0x2b9030=_[_0x458a('0x3e')]({},_0x2b9030,_0x296385['options']);return db['ZendeskAccount'][_0x458a('0x49')](_0x2b9030)[_0x458a('0x27')](handleEntityNotFound(_0x145e3c,null))[_0x458a('0x27')](respondWithResult(_0x145e3c,null))['catch'](handleError(_0x145e3c,null));};exports['create']=function(_0x3a7005,_0xf362b5){return db[_0x458a('0x41')][_0x458a('0x4a')](_0x3a7005[_0x458a('0x4b')],{})[_0x458a('0x27')](respondWithResult(_0xf362b5,0xc9))[_0x458a('0x45')](handleError(_0xf362b5,null));};exports[_0x458a('0x25')]=function(_0xb22232,_0x213f86){if(_0xb22232[_0x458a('0x4b')]['id']){delete _0xb22232[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x49')]({'where':{'id':_0xb22232[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x213f86,null))['then'](saveUpdates(_0xb22232[_0x458a('0x4b')],null))[_0x458a('0x27')](respondWithResult(_0x213f86,null))[_0x458a('0x45')](handleError(_0x213f86,null));};exports[_0x458a('0x26')]=function(_0x44670a,_0x5630cf){return db['ZendeskAccount']['find']({'where':{'id':_0x44670a[_0x458a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5630cf,null))[_0x458a('0x27')](removeEntity(_0x5630cf,null))[_0x458a('0x45')](handleError(_0x5630cf,null));};exports[_0x458a('0x4c')]=function(_0x649553,_0xfa6e65,_0x5f0151){var _0x48f68e={};var _0x3d7616={};var _0x2d8b77;var _0x2587a1;return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x649553['params']['id']}})[_0x458a('0x27')](handleEntityNotFound(_0xfa6e65,null))['then'](function(_0xa51e28){if(_0xa51e28){_0x2d8b77=_0xa51e28;_0x3d7616['model']=_[_0x458a('0x31')](db['ZendeskConfiguration']['rawAttributes']);_0x3d7616['query']=_[_0x458a('0x31')](_0x649553[_0x458a('0x30')]);_0x3d7616['filters']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],_0x3d7616[_0x458a('0x30')]);_0x48f68e['attributes']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],qs[_0x458a('0x34')](_0x649553[_0x458a('0x30')][_0x458a('0x34')]));_0x48f68e[_0x458a('0x33')]=_0x48f68e['attributes'][_0x458a('0x35')]?_0x48f68e[_0x458a('0x33')]:_0x3d7616[_0x458a('0x2f')];_0x48f68e[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x649553[_0x458a('0x30')][_0x458a('0x39')]);_0x48f68e[_0x458a('0x3a')]=qs['filters'](_[_0x458a('0x3c')](_0x649553['query'],_0x3d7616[_0x458a('0x3b')]));if(_0x649553[_0x458a('0x30')][_0x458a('0x3d')]){_0x48f68e[_0x458a('0x3a')]=_['merge'](_0x48f68e['where'],{'$or':_[_0x458a('0x2d')](_0x48f68e[_0x458a('0x33')],function(_0x2b9aac){var _0x156a22={};_0x156a22[_0x2b9aac]={'$like':'%'+_0x649553[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x156a22;})});}_0x48f68e=_['merge']({},_0x48f68e,_0x649553[_0x458a('0x40')]);return _0x2d8b77[_0x458a('0x4c')](_0x48f68e);}})['then'](function(_0x18d83a){if(_0x18d83a){_0x2587a1=_0x18d83a['length'];if(!_0x649553[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x48f68e[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x649553[_0x458a('0x30')][_0x458a('0x1f')]);_0x48f68e[_0x458a('0x1d')]=qs['offset'](_0x649553[_0x458a('0x30')][_0x458a('0x1d')]);}return _0x2d8b77['getConfigurations'](_0x48f68e);}})[_0x458a('0x27')](function(_0x3da617){if(_0x3da617){return _0x3da617?{'count':_0x2587a1,'rows':_0x3da617}:null;}})['then'](respondWithResult(_0xfa6e65,null))[_0x458a('0x45')](handleError(_0xfa6e65,null));};exports[_0x458a('0x4e')]=function(_0x47cbcf,_0x17b611,_0x180df0){if(_0x47cbcf['body']['id']){delete _0x47cbcf[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x47cbcf[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x17b611,null))[_0x458a('0x27')](function(_0x4199a7){if(_0x4199a7){_0x47cbcf[_0x458a('0x4b')]['AccountId']=_0x4199a7['id'];_0x47cbcf[_0x458a('0x4b')][_0x458a('0x4f')]=integrations[_0x458a('0x50')](_0x47cbcf[_0x458a('0x4b')][_0x458a('0x51')],_0x47cbcf[_0x458a('0x4b')][_0x458a('0x2e')]);_0x47cbcf[_0x458a('0x4b')][_0x458a('0x52')]=integrations[_0x458a('0x53')](_0x47cbcf['body'][_0x458a('0x51')],_0x47cbcf['body'][_0x458a('0x2e')]);return db[_0x458a('0x54')][_0x458a('0x4a')](_0x47cbcf[_0x458a('0x4b')],{'include':[{'model':db[_0x458a('0x55')],'as':_0x458a('0x4f')},{'model':db[_0x458a('0x55')],'as':_0x458a('0x52')}]});}return null;})[_0x458a('0x27')](respondWithResult(_0x17b611,null))[_0x458a('0x45')](handleError(_0x17b611,null));};exports[_0x458a('0x56')]=function(_0x448cbc,_0x11bbba,_0x435884){var _0x3948aa='';return db[_0x458a('0x41')]['findOne']({'where':{'id':_0x448cbc[_0x458a('0x46')]['id']},'attributes':['id','username',_0x458a('0x57'),_0x458a('0x58'),'authType',_0x458a('0x59')]})[_0x458a('0x27')](handleEntityNotFound(_0x11bbba,null))[_0x458a('0x27')](function(_0x494710){if(_0x494710){_0x3948aa=_0x494710[_0x458a('0x59')];var _0xed002=_0x3948aa[_0x458a('0x5a')](-0x1);if(_0xed002==='/'){_0x3948aa=_0x3948aa[_0x458a('0x5b')](0x0,_0x3948aa[_0x458a('0x5c')](_0xed002));}var _0x42f213={'method':'GET','uri':util[_0x458a('0x5d')]('%s/%s',_0x3948aa,'ticket_fields'),'json':!![]};switch(_0x494710[_0x458a('0x5e')]){case _0x458a('0x57'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')](_0x458a('0x60'),new Buffer(util[_0x458a('0x5d')](_0x458a('0x61'),_0x494710[_0x458a('0x62')],_0x494710[_0x458a('0x57')]))[_0x458a('0x63')](_0x458a('0x64')))};break;case _0x458a('0x58'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x494710[_0x458a('0x62')],_0x494710['token']))[_0x458a('0x63')](_0x458a('0x64')))};break;default:throw new db[(_0x458a('0x65'))][(_0x458a('0x66'))](_0x458a('0x67'));}return rp(_0x42f213);}})[_0x458a('0x27')](function(_0x46df7c){if(_0x46df7c){var _0x49f3ee=[_0x458a('0x68'),_0x458a('0x69'),'group',_0x458a('0x6a')];_['remove'](_0x46df7c[_0x458a('0x6b')],function(_0x58d29d){return _0x49f3ee[_0x458a('0x6c')](_0x58d29d[_0x458a('0x2e')]);});return{'count':_0x46df7c[_0x458a('0x6b')][_0x458a('0x35')],'rows':_['map'](_0x46df7c[_0x458a('0x6b')],function(_0x14b95e){return{'id':_0x14b95e['id'],'name':_0x14b95e[_0x458a('0x6d')]>0x7?_0x14b95e[_0x458a('0x6e')]:_0x14b95e[_0x458a('0x2e')],'custom':_0x14b95e[_0x458a('0x6d')]>0x7?!![]:![],'options':_0x14b95e[_0x458a('0x6f')]?_0x14b95e[_0x458a('0x6f')]:_0x14b95e['custom_field_options']?_0x14b95e[_0x458a('0x70')]:[]};})};}})[_0x458a('0x27')](respondWithResult(_0x11bbba,null))[_0x458a('0x45')](function(_0x4212af){var _0x591dbb=_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?0x1f4:_0x4212af['statusCode']||0x1f4;logger[_0x458a('0x72')](_0x458a('0x73'),_0x458a('0x56'),_0x591dbb,JSON[_0x458a('0x74')](_0x4212af));delete _0x4212af[_0x458a('0x2b')];if(_0x591dbb===0x191){_0x591dbb=0x190;}_0x11bbba['status'](_0x591dbb)[_0x458a('0x2c')](_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?{'message':_0x458a('0x75'),'statusCode':_0x4212af[_0x458a('0x76')]}:_0x4212af);});};
\ No newline at end of file
+var _0x2547=['Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','system_field_options','custom_field_options','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ZendeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','create','catch','body','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','%s/token:%s'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x2547,0x1cd));var _0x7254=function(_0xba2d0a,_0x11a99e){_0xba2d0a=_0xba2d0a-0x0;var _0x429bc2=_0x2547[_0xba2d0a];return _0x429bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16c08e,_0x2bfff8){_0x2bfff8=_0x2bfff8||0xcc;return function(_0x348d4e){if(_0x348d4e){return _0x16c08e[_0x7254('0x17')](_0x2bfff8);}return _0x16c08e[_0x7254('0x18')](_0x2bfff8)[_0x7254('0x19')]();};}function respondWithResult(_0x124192,_0x21cecc){_0x21cecc=_0x21cecc||0xc8;return function(_0x1625ea){if(_0x1625ea){return _0x124192[_0x7254('0x18')](_0x21cecc)[_0x7254('0x1a')](_0x1625ea);}};}function respondWithFilteredResult(_0x1ee5cb,_0x163c8c){return function(_0x535065){if(_0x535065){var _0x265293=typeof _0x163c8c[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x163c8c[_0x7254('0x1d')]===_0x7254('0x1c');var _0x1e4aff=_0x535065[_0x7254('0x1e')];var _0x5dd23b=_0x265293?0x0:_0x163c8c[_0x7254('0x1b')];var _0x2283b7=_0x265293?_0x535065[_0x7254('0x1e')]:_0x163c8c[_0x7254('0x1b')]+_0x163c8c[_0x7254('0x1d')];var _0x301f00;if(_0x2283b7>=_0x1e4aff){_0x2283b7=_0x1e4aff;_0x301f00=0xc8;}else{_0x301f00=0xce;}_0x1ee5cb[_0x7254('0x18')](_0x301f00);return _0x1ee5cb[_0x7254('0x1f')](_0x7254('0x20'),_0x5dd23b+'-'+_0x2283b7+'/'+_0x1e4aff)[_0x7254('0x1a')](_0x535065);}return null;};}function patchUpdates(_0x2594b8){return function(_0x24bc73){try{jsonpatch[_0x7254('0x21')](_0x24bc73,_0x2594b8,!![]);}catch(_0x41ef72){return BPromise[_0x7254('0x22')](_0x41ef72);}return _0x24bc73[_0x7254('0x23')]();};}function saveUpdates(_0x2bb2fe,_0x46c0a2){return function(_0x195fd2){if(_0x195fd2){return _0x195fd2[_0x7254('0x24')](_0x2bb2fe)[_0x7254('0x25')](function(_0x50c34b){return _0x50c34b;});}return null;};}function removeEntity(_0x493bfd,_0x136ea3){return function(_0xd91c1f){if(_0xd91c1f){return _0xd91c1f[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x493bfd[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x133aee,_0x5d6df5){return function(_0x133287){if(!_0x133287){_0x133aee[_0x7254('0x17')](0x194);}return _0x133287;};}function handleError(_0x2b4f46,_0x494cdb){_0x494cdb=_0x494cdb||0x1f4;return function(_0x3c22d0){logger['error'](_0x3c22d0[_0x7254('0x27')]);if(_0x3c22d0[_0x7254('0x28')]){delete _0x3c22d0['name'];}_0x2b4f46[_0x7254('0x18')](_0x494cdb)[_0x7254('0x29')](_0x3c22d0);};}exports['index']=function(_0x14cbea,_0x6c4927){var _0x37cb5c={},_0xb9198b={},_0x43bf02={'count':0x0,'rows':[]};var _0xfe02ea=_['map'](db[_0x7254('0x2a')][_0x7254('0x2b')],function(_0x5569be){return{'name':_0x5569be[_0x7254('0x2c')],'type':_0x5569be[_0x7254('0x2d')][_0x7254('0x2e')]};});_0xb9198b['model']=_[_0x7254('0x2f')](_0xfe02ea,_0x7254('0x28'));_0xb9198b[_0x7254('0x30')]=_[_0x7254('0x31')](_0x14cbea[_0x7254('0x30')]);_0xb9198b[_0x7254('0x32')]=_[_0x7254('0x33')](_0xb9198b['model'],_0xb9198b[_0x7254('0x30')]);_0x37cb5c['attributes']=_['intersection'](_0xb9198b[_0x7254('0x34')],qs[_0x7254('0x35')](_0x14cbea[_0x7254('0x30')][_0x7254('0x35')]));_0x37cb5c[_0x7254('0x36')]=_0x37cb5c[_0x7254('0x36')][_0x7254('0x37')]?_0x37cb5c[_0x7254('0x36')]:_0xb9198b[_0x7254('0x34')];if(!_0x14cbea[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x37cb5c[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x14cbea['query'][_0x7254('0x1d')]);_0x37cb5c[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x14cbea[_0x7254('0x30')][_0x7254('0x1b')]);}_0x37cb5c['order']=qs[_0x7254('0x3a')](_0x14cbea['query'][_0x7254('0x3a')]);_0x37cb5c[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x14cbea[_0x7254('0x30')],_0xb9198b['filters']),_0xfe02ea);if(_0x14cbea[_0x7254('0x30')]['filter']){_0x37cb5c[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x37cb5c['where'],{'$or':_[_0x7254('0x2f')](_0xfe02ea,function(_0x3c5bf4){if(_0x3c5bf4[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x14b625={};_0x14b625[_0x3c5bf4[_0x7254('0x28')]]={'$like':'%'+_0x14cbea['query'][_0x7254('0x3f')]+'%'};return _0x14b625;}})});}_0x37cb5c=_[_0x7254('0x3d')]({},_0x37cb5c,_0x14cbea[_0x7254('0x40')]);var _0x4eca7a={'where':_0x37cb5c[_0x7254('0x3b')]};return db[_0x7254('0x2a')][_0x7254('0x1e')](_0x4eca7a)['then'](function(_0xc09711){_0x43bf02[_0x7254('0x1e')]=_0xc09711;if(_0x14cbea[_0x7254('0x30')][_0x7254('0x41')]){_0x37cb5c[_0x7254('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x37cb5c);})[_0x7254('0x25')](function(_0x17bc29){_0x43bf02[_0x7254('0x43')]=_0x17bc29;return _0x43bf02;})[_0x7254('0x25')](respondWithFilteredResult(_0x6c4927,_0x37cb5c))['catch'](handleError(_0x6c4927,null));};exports['show']=function(_0x29821a,_0x565cd8){var _0x2ae22e={'raw':![],'where':{'id':_0x29821a[_0x7254('0x44')]['id']}},_0x3187b0={};_0x3187b0[_0x7254('0x34')]=_['keys'](db['ZendeskAccount'][_0x7254('0x2b')]);_0x3187b0[_0x7254('0x30')]=_[_0x7254('0x31')](_0x29821a[_0x7254('0x30')]);_0x3187b0[_0x7254('0x32')]=_['intersection'](_0x3187b0['model'],_0x3187b0[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3187b0['model'],qs[_0x7254('0x35')](_0x29821a[_0x7254('0x30')]['fields']));_0x2ae22e[_0x7254('0x36')]=_0x2ae22e[_0x7254('0x36')][_0x7254('0x37')]?_0x2ae22e[_0x7254('0x36')]:_0x3187b0['model'];if(_0x29821a[_0x7254('0x30')][_0x7254('0x41')]){_0x2ae22e['include']=[{'all':!![]}];}_0x2ae22e=_[_0x7254('0x3d')]({},_0x2ae22e,_0x29821a[_0x7254('0x40')]);return db[_0x7254('0x2a')]['find'](_0x2ae22e)[_0x7254('0x25')](handleEntityNotFound(_0x565cd8,null))[_0x7254('0x25')](respondWithResult(_0x565cd8,null))['catch'](handleError(_0x565cd8,null));};exports['create']=function(_0x10b32f,_0x54c792){return db[_0x7254('0x2a')][_0x7254('0x45')](_0x10b32f['body'],{})['then'](respondWithResult(_0x54c792,0xc9))[_0x7254('0x46')](handleError(_0x54c792,null));};exports[_0x7254('0x24')]=function(_0x38bcd5,_0x104d98){if(_0x38bcd5[_0x7254('0x47')]['id']){delete _0x38bcd5[_0x7254('0x47')]['id'];}return db['ZendeskAccount'][_0x7254('0x48')]({'where':{'id':_0x38bcd5['params']['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x104d98,null))[_0x7254('0x25')](saveUpdates(_0x38bcd5[_0x7254('0x47')],null))['then'](respondWithResult(_0x104d98,null))[_0x7254('0x46')](handleError(_0x104d98,null));};exports[_0x7254('0x26')]=function(_0x252758,_0x5b3b6e){return db[_0x7254('0x2a')][_0x7254('0x48')]({'where':{'id':_0x252758[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x5b3b6e,null))[_0x7254('0x25')](removeEntity(_0x5b3b6e,null))['catch'](handleError(_0x5b3b6e,null));};exports['getConfigurations']=function(_0x24c532,_0x2cb7cd,_0x441d23){var _0x10e1cb={};var _0x3b0002={};var _0x4c6838;var _0x5a44fb;return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x24c532[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x2cb7cd,null))['then'](function(_0xaf6d3d){if(_0xaf6d3d){_0x4c6838=_0xaf6d3d;_0x3b0002[_0x7254('0x34')]=_['keys'](db[_0x7254('0x4a')]['rawAttributes']);_0x3b0002[_0x7254('0x30')]=_['keys'](_0x24c532[_0x7254('0x30')]);_0x3b0002['filters']=_['intersection'](_0x3b0002[_0x7254('0x34')],_0x3b0002[_0x7254('0x30')]);_0x10e1cb[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3b0002['model'],qs[_0x7254('0x35')](_0x24c532['query'][_0x7254('0x35')]));_0x10e1cb[_0x7254('0x36')]=_0x10e1cb[_0x7254('0x36')][_0x7254('0x37')]?_0x10e1cb[_0x7254('0x36')]:_0x3b0002[_0x7254('0x34')];_0x10e1cb['order']=qs[_0x7254('0x3a')](_0x24c532[_0x7254('0x30')][_0x7254('0x3a')]);_0x10e1cb[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x24c532['query'],_0x3b0002[_0x7254('0x32')]));if(_0x24c532[_0x7254('0x30')][_0x7254('0x3f')]){_0x10e1cb[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x10e1cb[_0x7254('0x3b')],{'$or':_[_0x7254('0x2f')](_0x10e1cb['attributes'],function(_0x5dd108){var _0xac4d0={};_0xac4d0[_0x5dd108]={'$like':'%'+_0x24c532['query']['filter']+'%'};return _0xac4d0;})});}_0x10e1cb=_[_0x7254('0x3d')]({},_0x10e1cb,_0x24c532[_0x7254('0x40')]);return _0x4c6838[_0x7254('0x4b')](_0x10e1cb);}})['then'](function(_0x1821f0){if(_0x1821f0){_0x5a44fb=_0x1821f0['length'];if(!_0x24c532[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x10e1cb[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x24c532['query'][_0x7254('0x1d')]);_0x10e1cb[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x24c532[_0x7254('0x30')]['offset']);}return _0x4c6838['getConfigurations'](_0x10e1cb);}})[_0x7254('0x25')](function(_0x41355e){if(_0x41355e){return _0x41355e?{'count':_0x5a44fb,'rows':_0x41355e}:null;}})[_0x7254('0x25')](respondWithResult(_0x2cb7cd,null))[_0x7254('0x46')](handleError(_0x2cb7cd,null));};exports[_0x7254('0x4c')]=function(_0x1cf028,_0x464680,_0x38cba1){if(_0x1cf028[_0x7254('0x47')]['id']){delete _0x1cf028[_0x7254('0x47')]['id'];}return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x1cf028[_0x7254('0x44')]['id']}})['then'](handleEntityNotFound(_0x464680,null))[_0x7254('0x25')](function(_0x4716a2){if(_0x4716a2){_0x1cf028[_0x7254('0x47')]['AccountId']=_0x4716a2['id'];_0x1cf028[_0x7254('0x47')][_0x7254('0x4d')]=integrations[_0x7254('0x4e')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);_0x1cf028[_0x7254('0x47')][_0x7254('0x4f')]=integrations[_0x7254('0x50')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);return db[_0x7254('0x4a')]['create'](_0x1cf028[_0x7254('0x47')],{'include':[{'model':db[_0x7254('0x51')],'as':_0x7254('0x4d')},{'model':db[_0x7254('0x51')],'as':_0x7254('0x4f')}]});}return null;})[_0x7254('0x25')](respondWithResult(_0x464680,null))[_0x7254('0x46')](handleError(_0x464680,null));};exports[_0x7254('0x52')]=function(_0x4e07c6,_0x37562a,_0x57c0a0){var _0x12c36e='';return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x4e07c6[_0x7254('0x44')]['id']},'attributes':['id',_0x7254('0x53'),_0x7254('0x54'),_0x7254('0x55'),_0x7254('0x56'),'remoteUri']})[_0x7254('0x25')](handleEntityNotFound(_0x37562a,null))['then'](function(_0x231184){if(_0x231184){_0x12c36e=_0x231184[_0x7254('0x57')];var _0x2399ef=_0x12c36e[_0x7254('0x58')](-0x1);if(_0x2399ef==='/'){_0x12c36e=_0x12c36e[_0x7254('0x59')](0x0,_0x12c36e[_0x7254('0x5a')](_0x2399ef));}var _0xb65570={'method':_0x7254('0x5b'),'uri':util[_0x7254('0x5c')](_0x7254('0x5d'),_0x12c36e,_0x7254('0x5e')),'json':!![]};switch(_0x231184[_0x7254('0x56')]){case _0x7254('0x54'):_0xb65570[_0x7254('0x5f')]={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')]('%s:%s',_0x231184['username'],_0x231184[_0x7254('0x54')]))[_0x7254('0x61')]('base64'))};break;case'token':_0xb65570['headers']={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')](_0x7254('0x62'),_0x231184['username'],_0x231184[_0x7254('0x55')]))[_0x7254('0x61')]('base64'))};break;default:throw new db[(_0x7254('0x63'))][(_0x7254('0x64'))](_0x7254('0x65'));}return rp(_0xb65570);}})['then'](function(_0x4aa036){if(_0x4aa036){var _0x220066=[_0x7254('0x66'),'description',_0x7254('0x67'),_0x7254('0x68')];_[_0x7254('0x69')](_0x4aa036[_0x7254('0x5e')],function(_0x24fcb1){return _0x220066['includes'](_0x24fcb1[_0x7254('0x2d')]);});return{'count':_0x4aa036[_0x7254('0x5e')][_0x7254('0x37')],'rows':_['map'](_0x4aa036[_0x7254('0x5e')],function(_0x4cf18d){return{'id':_0x4cf18d['id'],'name':_0x4cf18d['position']>0x7?_0x4cf18d['title']:_0x4cf18d[_0x7254('0x2d')],'custom':_0x4cf18d['position']>0x7?!![]:![],'options':_0x4cf18d['system_field_options']?_0x4cf18d[_0x7254('0x6a')]:_0x4cf18d[_0x7254('0x6b')]?_0x4cf18d[_0x7254('0x6b')]:[]};})};}})['then'](respondWithResult(_0x37562a,null))[_0x7254('0x46')](function(_0x5a0c41){var _0x175379=_0x4e07c6[_0x7254('0x30')]['test']?0x1f4:_0x5a0c41[_0x7254('0x6c')]||0x1f4;logger[_0x7254('0x6d')](_0x7254('0x6e'),_0x7254('0x52'),_0x175379,JSON[_0x7254('0x6f')](_0x5a0c41));delete _0x5a0c41[_0x7254('0x28')];if(_0x175379===0x191){_0x175379=0x190;}_0x37562a[_0x7254('0x18')](_0x175379)['send'](_0x4e07c6[_0x7254('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5a0c41[_0x7254('0x6c')]}:_0x5a0c41);});};
\ No newline at end of file
index 74e855b..25dff3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d3=['rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','request-promise','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd2d3,0x139));var _0x3d2d=function(_0x4590ed,_0x4b613e){_0x4590ed=_0x4590ed-0x0;var _0x49062e=_0xd2d3[_0x4590ed];return _0x49062e;};'use strict';var _=require('lodash');var util=require(_0x3d2d('0x0'));var logger=require(_0x3d2d('0x1'))(_0x3d2d('0x2'));var moment=require(_0x3d2d('0x3'));var BPromise=require('bluebird');var rp=require(_0x3d2d('0x4'));var fs=require('fs');var path=require(_0x3d2d('0x5'));var rimraf=require(_0x3d2d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d2d('0x7'));var integrations=require(_0x3d2d('0x8'));module['exports']=function(_0x4869cc,_0x1d173c){return _0x4869cc['define'](_0x3d2d('0x9'),attributes,{'tableName':_0x3d2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa489=['util','api','moment','bluebird','request-promise','path','rimraf','exports','ZendeskAccount','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa489,0xbd));var _0x9a48=function(_0x4a5926,_0x3f124b){_0x4a5926=_0x4a5926-0x0;var _0x4c463c=_0xa489[_0x4a5926];return _0x4c463c;};'use strict';var _=require(_0x9a48('0x0'));var util=require(_0x9a48('0x1'));var logger=require('../../config/logger')(_0x9a48('0x2'));var moment=require(_0x9a48('0x3'));var BPromise=require(_0x9a48('0x4'));var rp=require(_0x9a48('0x5'));var fs=require('fs');var path=require(_0x9a48('0x6'));var rimraf=require(_0x9a48('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x9a48('0x8')]=function(_0x5937be,_0x5b330b){return _0x5937be['define'](_0x9a48('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5360eb0..bf8e206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee31=['../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4008de,_0x15f2e9){var _0x596738=function(_0x2d4060){while(--_0x2d4060){_0x4008de['push'](_0x4008de['shift']());}};_0x596738(++_0x15f2e9);}(_0xee31,0x101));var _0x1ee3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xee31[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1ee3('0x0'));var util=require(_0x1ee3('0x1'));var moment=require(_0x1ee3('0x2'));var BPromise=require(_0x1ee3('0x3'));var rs=require(_0x1ee3('0x4'));var fs=require('fs');var Redis=require(_0x1ee3('0x5'));var db=require(_0x1ee3('0x6'))['db'];var utils=require(_0x1ee3('0x7'));var logger=require(_0x1ee3('0x8'))('rpc');var config=require(_0x1ee3('0x9'));var jayson=require(_0x1ee3('0xa'));var client=jayson[_0x1ee3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x565f2e,_0x1bf4e2,_0x891646){return new BPromise(function(_0x2d8166,_0x3293bb){return client[_0x1ee3('0xc')](_0x565f2e,_0x891646)['then'](function(_0x2abc99){logger[_0x1ee3('0xd')](_0x1ee3('0xe'),_0x1bf4e2,_0x1ee3('0xf'));logger[_0x1ee3('0x10')](_0x1ee3('0x11'),_0x1bf4e2,'request\x20sent',JSON[_0x1ee3('0x12')](_0x2abc99));if(_0x2abc99[_0x1ee3('0x13')]){if(_0x2abc99[_0x1ee3('0x13')][_0x1ee3('0x14')]===0x1f4){logger[_0x1ee3('0x13')](_0x1ee3('0xe'),_0x1bf4e2,_0x2abc99[_0x1ee3('0x13')]['message']);return _0x3293bb(_0x2abc99['error'][_0x1ee3('0x15')]);}logger[_0x1ee3('0x13')](_0x1ee3('0xe'),_0x1bf4e2,_0x2abc99[_0x1ee3('0x13')][_0x1ee3('0x15')]);return _0x2d8166(_0x2abc99[_0x1ee3('0x13')][_0x1ee3('0x15')]);}else{logger[_0x1ee3('0xd')](_0x1ee3('0xe'),_0x1bf4e2,_0x1ee3('0xf'));_0x2d8166(_0x2abc99[_0x1ee3('0x16')][_0x1ee3('0x15')]);}})[_0x1ee3('0x17')](function(_0x44c1c9){logger[_0x1ee3('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x1bf4e2,_0x44c1c9);_0x3293bb(_0x44c1c9);});});}exports[_0x1ee3('0x18')]=function(_0xf4f796){var _0x5d9ca4=this;return new Promise(function(_0x4bdc2d,_0x45cb0e){return db[_0x1ee3('0x19')][_0x1ee3('0x1a')]({'raw':_0xf4f796[_0x1ee3('0x1b')]?_0xf4f796[_0x1ee3('0x1b')][_0x1ee3('0x1c')]===undefined?!![]:![]:!![],'where':_0xf4f796['options']?_0xf4f796['options'][_0x1ee3('0x1d')]||null:null,'attributes':_0xf4f796[_0x1ee3('0x1b')]?_0xf4f796['options'][_0x1ee3('0x1e')]||null:null,'limit':_0xf4f796['options']?_0xf4f796[_0x1ee3('0x1b')][_0x1ee3('0x1f')]||null:null,'include':_0xf4f796[_0x1ee3('0x1b')]?_0xf4f796[_0x1ee3('0x1b')][_0x1ee3('0x20')]?_[_0x1ee3('0x21')](_0xf4f796[_0x1ee3('0x1b')]['include'],function(_0x4ed319){return{'model':db[_0x4ed319['model']],'as':_0x4ed319['as'],'attributes':_0x4ed319[_0x1ee3('0x1e')],'include':_0x4ed319['include']?_[_0x1ee3('0x21')](_0x4ed319[_0x1ee3('0x20')],function(_0x2e3004){return{'model':db[_0x2e3004[_0x1ee3('0x22')]],'as':_0x2e3004['as'],'attributes':_0x2e3004[_0x1ee3('0x1e')],'include':_0x2e3004['include']?_[_0x1ee3('0x21')](_0x2e3004[_0x1ee3('0x20')],function(_0x1df312){return{'model':db[_0x1df312[_0x1ee3('0x22')]],'as':_0x1df312['as'],'attributes':_0x1df312[_0x1ee3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1ee3('0x23')](function(_0x2e72b8){logger['info'](_0x1ee3('0x18'),_0xf4f796);logger[_0x1ee3('0x10')](_0x1ee3('0x18'),_0xf4f796,JSON[_0x1ee3('0x12')](_0x2e72b8));_0x4bdc2d(_0x2e72b8);})[_0x1ee3('0x17')](function(_0x16110f){logger['error']('GetZendeskAccount',_0x16110f['message'],_0xf4f796);_0x45cb0e(_0x5d9ca4[_0x1ee3('0x13')](0x1f4,_0x16110f[_0x1ee3('0x15')]));});});};exports[_0x1ee3('0x24')]=function(_0x3956a4){var _0x5af078=this;return new Promise(function(_0xbeb3b0,_0x460b6f){return db[_0x1ee3('0x19')][_0x1ee3('0x25')]({'raw':_0x3956a4['options']?_0x3956a4[_0x1ee3('0x1b')][_0x1ee3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3956a4['options']?_0x3956a4[_0x1ee3('0x1b')][_0x1ee3('0x1d')]||null:null,'attributes':_0x3956a4[_0x1ee3('0x1b')]?_0x3956a4[_0x1ee3('0x1b')][_0x1ee3('0x1e')]||null:null,'include':_0x3956a4[_0x1ee3('0x1b')]?_0x3956a4[_0x1ee3('0x1b')]['include']?_['map'](_0x3956a4[_0x1ee3('0x1b')][_0x1ee3('0x20')],function(_0x21854e){return{'model':db[_0x21854e[_0x1ee3('0x22')]],'as':_0x21854e['as'],'attributes':_0x21854e[_0x1ee3('0x1e')],'include':_0x21854e[_0x1ee3('0x20')]?_[_0x1ee3('0x21')](_0x21854e[_0x1ee3('0x20')],function(_0xa54057){return{'model':db[_0xa54057[_0x1ee3('0x22')]],'as':_0xa54057['as'],'attributes':_0xa54057[_0x1ee3('0x1e')],'include':_0xa54057[_0x1ee3('0x20')]?_['map'](_0xa54057[_0x1ee3('0x20')],function(_0x28cc43){return{'model':db[_0x28cc43['model']],'as':_0x28cc43['as'],'attributes':_0x28cc43[_0x1ee3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1ee3('0x23')](function(_0x43965f){logger[_0x1ee3('0xd')](_0x1ee3('0x24'),_0x3956a4);logger[_0x1ee3('0x10')](_0x1ee3('0x24'),_0x3956a4,JSON[_0x1ee3('0x12')](_0x43965f));_0xbeb3b0(_0x43965f);})[_0x1ee3('0x17')](function(_0x3d644c){logger[_0x1ee3('0x13')](_0x1ee3('0x24'),_0x3d644c[_0x1ee3('0x15')],_0x3956a4);_0x460b6f(_0x5af078['error'](0x1f4,_0x3d644c['message']));});});};
\ No newline at end of file
+var _0xee4a=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','debug','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','moment'];(function(_0x229101,_0x31339d){var _0xc93cb=function(_0x461394){while(--_0x461394){_0x229101['push'](_0x229101['shift']());}};_0xc93cb(++_0x31339d);}(_0xee4a,0x9e));var _0xaee4=function(_0x305b23,_0x421832){_0x305b23=_0x305b23-0x0;var _0x1e2b65=_0xee4a[_0x305b23];return _0x1e2b65;};'use strict';var _=require(_0xaee4('0x0'));var util=require('util');var moment=require(_0xaee4('0x1'));var BPromise=require(_0xaee4('0x2'));var rs=require(_0xaee4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaee4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaee4('0x5'))('rpc');var config=require(_0xaee4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaee4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24372a,_0x478331,_0x37ed64){return new BPromise(function(_0x5e0ab4,_0x274758){return client[_0xaee4('0x8')](_0x24372a,_0x37ed64)['then'](function(_0x117da5){logger[_0xaee4('0x9')](_0xaee4('0xa'),_0x478331,_0xaee4('0xb'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x478331,'request\x20sent',JSON[_0xaee4('0xc')](_0x117da5));if(_0x117da5[_0xaee4('0xd')]){if(_0x117da5[_0xaee4('0xd')][_0xaee4('0xe')]===0x1f4){logger[_0xaee4('0xd')](_0xaee4('0xa'),_0x478331,_0x117da5[_0xaee4('0xd')][_0xaee4('0xf')]);return _0x274758(_0x117da5['error']['message']);}logger[_0xaee4('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x478331,_0x117da5['error'][_0xaee4('0xf')]);return _0x5e0ab4(_0x117da5[_0xaee4('0xd')][_0xaee4('0xf')]);}else{logger[_0xaee4('0x9')](_0xaee4('0xa'),_0x478331,_0xaee4('0xb'));_0x5e0ab4(_0x117da5[_0xaee4('0x10')][_0xaee4('0xf')]);}})['catch'](function(_0x55dc57){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x478331,_0x55dc57);_0x274758(_0x55dc57);});});}exports[_0xaee4('0x11')]=function(_0x632c0f){var _0x2e576c=this;return new Promise(function(_0x45bdf2,_0xc02e8f){return db['ZendeskAccount'][_0xaee4('0x12')]({'raw':_0x632c0f[_0xaee4('0x13')]?_0x632c0f['options'][_0xaee4('0x14')]===undefined?!![]:![]:!![],'where':_0x632c0f[_0xaee4('0x13')]?_0x632c0f['options'][_0xaee4('0x15')]||null:null,'attributes':_0x632c0f['options']?_0x632c0f[_0xaee4('0x13')][_0xaee4('0x16')]||null:null,'limit':_0x632c0f[_0xaee4('0x13')]?_0x632c0f['options']['limit']||null:null,'include':_0x632c0f[_0xaee4('0x13')]?_0x632c0f['options'][_0xaee4('0x17')]?_[_0xaee4('0x18')](_0x632c0f['options'][_0xaee4('0x17')],function(_0x3297e4){return{'model':db[_0x3297e4[_0xaee4('0x19')]],'as':_0x3297e4['as'],'attributes':_0x3297e4[_0xaee4('0x16')],'include':_0x3297e4[_0xaee4('0x17')]?_[_0xaee4('0x18')](_0x3297e4[_0xaee4('0x17')],function(_0xcee4c7){return{'model':db[_0xcee4c7[_0xaee4('0x19')]],'as':_0xcee4c7['as'],'attributes':_0xcee4c7[_0xaee4('0x16')],'include':_0xcee4c7[_0xaee4('0x17')]?_[_0xaee4('0x18')](_0xcee4c7[_0xaee4('0x17')],function(_0x32bc01){return{'model':db[_0x32bc01[_0xaee4('0x19')]],'as':_0x32bc01['as'],'attributes':_0x32bc01['attributes']};}):[]};}):[]};}):[]:[]})[_0xaee4('0x1a')](function(_0x3a9fd9){logger[_0xaee4('0x9')]('GetZendeskAccount',_0x632c0f);logger[_0xaee4('0x1b')](_0xaee4('0x11'),_0x632c0f,JSON[_0xaee4('0xc')](_0x3a9fd9));_0x45bdf2(_0x3a9fd9);})[_0xaee4('0x1c')](function(_0x2dbf6f){logger[_0xaee4('0xd')]('GetZendeskAccount',_0x2dbf6f['message'],_0x632c0f);_0xc02e8f(_0x2e576c[_0xaee4('0xd')](0x1f4,_0x2dbf6f[_0xaee4('0xf')]));});});};exports[_0xaee4('0x1d')]=function(_0x24a98d){var _0x2278a9=this;return new Promise(function(_0x584b8f,_0x170e41){return db[_0xaee4('0x1e')][_0xaee4('0x1f')]({'raw':_0x24a98d[_0xaee4('0x13')]?_0x24a98d[_0xaee4('0x13')][_0xaee4('0x14')]===undefined?!![]:![]:!![],'where':_0x24a98d[_0xaee4('0x13')]?_0x24a98d['options'][_0xaee4('0x15')]||null:null,'attributes':_0x24a98d[_0xaee4('0x13')]?_0x24a98d['options'][_0xaee4('0x16')]||null:null,'include':_0x24a98d['options']?_0x24a98d[_0xaee4('0x13')]['include']?_[_0xaee4('0x18')](_0x24a98d[_0xaee4('0x13')][_0xaee4('0x17')],function(_0x40a679){return{'model':db[_0x40a679['model']],'as':_0x40a679['as'],'attributes':_0x40a679[_0xaee4('0x16')],'include':_0x40a679[_0xaee4('0x17')]?_[_0xaee4('0x18')](_0x40a679[_0xaee4('0x17')],function(_0x46df79){return{'model':db[_0x46df79['model']],'as':_0x46df79['as'],'attributes':_0x46df79[_0xaee4('0x16')],'include':_0x46df79[_0xaee4('0x17')]?_[_0xaee4('0x18')](_0x46df79[_0xaee4('0x17')],function(_0xf42d4){return{'model':db[_0xf42d4['model']],'as':_0xf42d4['as'],'attributes':_0xf42d4[_0xaee4('0x16')]};}):[]};}):[]};}):[]:[]})[_0xaee4('0x1a')](function(_0x412992){logger['info'](_0xaee4('0x1d'),_0x24a98d);logger[_0xaee4('0x1b')](_0xaee4('0x1d'),_0x24a98d,JSON['stringify'](_0x412992));_0x584b8f(_0x412992);})[_0xaee4('0x1c')](function(_0x5e00d0){logger[_0xaee4('0xd')](_0xaee4('0x1d'),_0x5e00d0[_0xaee4('0xf')],_0x24a98d);_0x170e41(_0x2278a9['error'](0x1f4,_0x5e00d0[_0xaee4('0xf')]));});});};
\ No newline at end of file
index c8347e5..6bf934b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5eca13,_0x376853){_0x5eca13=_0x5eca13-0x0;var _0x73f2fb=_0x9ffd[_0x5eca13];return _0x73f2fb;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x3b048d,_0x450938){var _0x31b2d4=function(_0x13ebc0){while(--_0x13ebc0){_0x3b048d['push'](_0x3b048d['shift']());}};_0x31b2d4(++_0x450938);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router;
\ No newline at end of file
index b7d3552..f3af815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdde3=['sequelize','exports','STRING'];(function(_0x5f0f89,_0x1fc5cc){var _0x541945=function(_0x26ea1d){while(--_0x26ea1d){_0x5f0f89['push'](_0x5f0f89['shift']());}};_0x541945(++_0x1fc5cc);}(_0xdde3,0x1ec));var _0x3dde=function(_0x2613b7,_0x5d950a){_0x2613b7=_0x2613b7-0x0;var _0x3b3d12=_0xdde3[_0x2613b7];return _0x3b3d12;};'use strict';var Sequelize=require(_0x3dde('0x0'));module[_0x3dde('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3dde('0x2')]}};
\ No newline at end of file
+var _0x35dc=['STRING','sequelize','exports'];(function(_0xf6bf83,_0x107584){var _0x9148b9=function(_0x35ba70){while(--_0x35ba70){_0xf6bf83['push'](_0xf6bf83['shift']());}};_0x9148b9(++_0x107584);}(_0x35dc,0x17b));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc35d('0x0'));module[_0xc35d('0x1')]={'name':{'type':Sequelize[_0xc35d('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 09f1231..561fef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2da=['where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','findOne','getFields','getSubjects','nolimit','getDescriptions','ZendeskField','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','then','destroy','error','stack','name','index','ZendeskConfiguration','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x5824f4,_0x364f4d){var _0x15c774=function(_0xeaa6e1){while(--_0xeaa6e1){_0x5824f4['push'](_0x5824f4['shift']());}};_0x15c774(++_0x364f4d);}(_0xd2da,0x1cf));var _0xad2d=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0xd2da[_0x5093e9];return _0x4c9a22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad2d('0x0'));var jsonpatch=require(_0xad2d('0x1'));var rp=require(_0xad2d('0x2'));var moment=require('moment');var BPromise=require(_0xad2d('0x3'));var Mustache=require(_0xad2d('0x4'));var util=require(_0xad2d('0x5'));var path=require(_0xad2d('0x6'));var sox=require(_0xad2d('0x7'));var csv=require(_0xad2d('0x8'));var ejs=require(_0xad2d('0x9'));var fs=require('fs');var fs_extra=require(_0xad2d('0xa'));var _=require(_0xad2d('0xb'));var squel=require(_0xad2d('0xc'));var crypto=require(_0xad2d('0xd'));var jsforce=require(_0xad2d('0xe'));var deskjs=require(_0xad2d('0xf'));var toCsv=require(_0xad2d('0x8'));var querystring=require(_0xad2d('0x10'));var Papa=require(_0xad2d('0x11'));var Redis=require(_0xad2d('0x12'));var authService=require(_0xad2d('0x13'));var qs=require(_0xad2d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad2d('0x15'));var logger=require(_0xad2d('0x16'))(_0xad2d('0x17'));var utils=require(_0xad2d('0x18'));var config=require(_0xad2d('0x19'));var licenseUtil=require(_0xad2d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3819a2,_0x56d7c7){_0x56d7c7=_0x56d7c7||0xcc;return function(_0x305456){if(_0x305456){return _0x3819a2[_0xad2d('0x1b')](_0x56d7c7);}return _0x3819a2['status'](_0x56d7c7)[_0xad2d('0x1c')]();};}function respondWithResult(_0x17fc4f,_0x20fa0d){_0x20fa0d=_0x20fa0d||0xc8;return function(_0x5b9546){if(_0x5b9546){return _0x17fc4f[_0xad2d('0x1d')](_0x20fa0d)[_0xad2d('0x1e')](_0x5b9546);}};}function respondWithFilteredResult(_0x4bf0c4,_0x2d7009){return function(_0x24f2d2){if(_0x24f2d2){var _0x2189ea=typeof _0x2d7009['offset']===_0xad2d('0x1f')&&typeof _0x2d7009[_0xad2d('0x20')]===_0xad2d('0x1f');var _0x4b8707=_0x24f2d2[_0xad2d('0x21')];var _0x3f4b6e=_0x2189ea?0x0:_0x2d7009[_0xad2d('0x22')];var _0x522587=_0x2189ea?_0x24f2d2[_0xad2d('0x21')]:_0x2d7009['offset']+_0x2d7009['limit'];var _0xf26e45;if(_0x522587>=_0x4b8707){_0x522587=_0x4b8707;_0xf26e45=0xc8;}else{_0xf26e45=0xce;}_0x4bf0c4[_0xad2d('0x1d')](_0xf26e45);return _0x4bf0c4[_0xad2d('0x23')]('Content-Range',_0x3f4b6e+'-'+_0x522587+'/'+_0x4b8707)[_0xad2d('0x1e')](_0x24f2d2);}return null;};}function patchUpdates(_0x345971){return function(_0x3ea80){try{jsonpatch[_0xad2d('0x24')](_0x3ea80,_0x345971,!![]);}catch(_0x1bb4e5){return BPromise[_0xad2d('0x25')](_0x1bb4e5);}return _0x3ea80['save']();};}function saveUpdates(_0x4dfc56,_0x25c22c){return function(_0x17c4d2){if(_0x17c4d2){return _0x17c4d2['update'](_0x4dfc56)[_0xad2d('0x26')](function(_0x4a13af){return _0x4a13af;});}return null;};}function removeEntity(_0x5d862a,_0x190274){return function(_0x208677){if(_0x208677){return _0x208677[_0xad2d('0x27')]()[_0xad2d('0x26')](function(){_0x5d862a['status'](0xcc)[_0xad2d('0x1c')]();});}};}function handleEntityNotFound(_0x3b469c,_0x9b609f){return function(_0x3028a0){if(!_0x3028a0){_0x3b469c[_0xad2d('0x1b')](0x194);}return _0x3028a0;};}function handleError(_0x30fa7d,_0x23657a){_0x23657a=_0x23657a||0x1f4;return function(_0x38d9ae){logger[_0xad2d('0x28')](_0x38d9ae[_0xad2d('0x29')]);if(_0x38d9ae[_0xad2d('0x2a')]){delete _0x38d9ae['name'];}_0x30fa7d[_0xad2d('0x1d')](_0x23657a)['send'](_0x38d9ae);};}exports[_0xad2d('0x2b')]=function(_0x323052,_0x57c2c0){var _0x2c5771={},_0x1a96b8={},_0x407bb1={'count':0x0,'rows':[]};var _0x10217f=_['map'](db[_0xad2d('0x2c')]['rawAttributes'],function(_0x3d9ded){return{'name':_0x3d9ded[_0xad2d('0x2d')],'type':_0x3d9ded['type'][_0xad2d('0x2e')]};});_0x1a96b8[_0xad2d('0x2f')]=_[_0xad2d('0x30')](_0x10217f,_0xad2d('0x2a'));_0x1a96b8[_0xad2d('0x31')]=_[_0xad2d('0x32')](_0x323052[_0xad2d('0x31')]);_0x1a96b8[_0xad2d('0x33')]=_[_0xad2d('0x34')](_0x1a96b8[_0xad2d('0x2f')],_0x1a96b8[_0xad2d('0x31')]);_0x2c5771[_0xad2d('0x35')]=_['intersection'](_0x1a96b8[_0xad2d('0x2f')],qs['fields'](_0x323052[_0xad2d('0x31')][_0xad2d('0x36')]));_0x2c5771[_0xad2d('0x35')]=_0x2c5771[_0xad2d('0x35')][_0xad2d('0x37')]?_0x2c5771['attributes']:_0x1a96b8[_0xad2d('0x2f')];if(!_0x323052[_0xad2d('0x31')][_0xad2d('0x38')]('nolimit')){_0x2c5771['limit']=qs[_0xad2d('0x20')](_0x323052[_0xad2d('0x31')][_0xad2d('0x20')]);_0x2c5771[_0xad2d('0x22')]=qs[_0xad2d('0x22')](_0x323052['query']['offset']);}_0x2c5771[_0xad2d('0x39')]=qs[_0xad2d('0x3a')](_0x323052[_0xad2d('0x31')]['sort']);_0x2c5771[_0xad2d('0x3b')]=qs['filters'](_[_0xad2d('0x3c')](_0x323052[_0xad2d('0x31')],_0x1a96b8[_0xad2d('0x33')]),_0x10217f);if(_0x323052['query'][_0xad2d('0x3d')]){_0x2c5771[_0xad2d('0x3b')]=_['merge'](_0x2c5771[_0xad2d('0x3b')],{'$or':_[_0xad2d('0x30')](_0x10217f,function(_0x5201a3){if(_0x5201a3[_0xad2d('0x3e')]!==_0xad2d('0x3f')){var _0x3a2dc1={};_0x3a2dc1[_0x5201a3[_0xad2d('0x2a')]]={'$like':'%'+_0x323052[_0xad2d('0x31')][_0xad2d('0x3d')]+'%'};return _0x3a2dc1;}})});}_0x2c5771=_[_0xad2d('0x40')]({},_0x2c5771,_0x323052[_0xad2d('0x41')]);var _0x565817={'where':_0x2c5771[_0xad2d('0x3b')]};return db[_0xad2d('0x2c')][_0xad2d('0x21')](_0x565817)['then'](function(_0x4b0dee){_0x407bb1[_0xad2d('0x21')]=_0x4b0dee;if(_0x323052[_0xad2d('0x31')][_0xad2d('0x42')]){_0x2c5771['include']=[{'all':!![]}];}return db[_0xad2d('0x2c')][_0xad2d('0x43')](_0x2c5771);})[_0xad2d('0x26')](function(_0x2a6dc6){_0x407bb1[_0xad2d('0x44')]=_0x2a6dc6;return _0x407bb1;})[_0xad2d('0x26')](respondWithFilteredResult(_0x57c2c0,_0x2c5771))[_0xad2d('0x45')](handleError(_0x57c2c0,null));};exports[_0xad2d('0x46')]=function(_0x4c5626,_0x4ab9a6){var _0x1d89fc={'raw':![],'where':{'id':_0x4c5626[_0xad2d('0x47')]['id']}},_0x5b8ef3={};_0x5b8ef3['model']=_[_0xad2d('0x32')](db['ZendeskConfiguration'][_0xad2d('0x48')]);_0x5b8ef3[_0xad2d('0x31')]=_[_0xad2d('0x32')](_0x4c5626[_0xad2d('0x31')]);_0x5b8ef3[_0xad2d('0x33')]=_[_0xad2d('0x34')](_0x5b8ef3[_0xad2d('0x2f')],_0x5b8ef3[_0xad2d('0x31')]);_0x1d89fc[_0xad2d('0x35')]=_[_0xad2d('0x34')](_0x5b8ef3[_0xad2d('0x2f')],qs[_0xad2d('0x36')](_0x4c5626[_0xad2d('0x31')][_0xad2d('0x36')]));_0x1d89fc[_0xad2d('0x35')]=_0x1d89fc[_0xad2d('0x35')][_0xad2d('0x37')]?_0x1d89fc[_0xad2d('0x35')]:_0x5b8ef3[_0xad2d('0x2f')];if(_0x4c5626[_0xad2d('0x31')][_0xad2d('0x42')]){_0x1d89fc['include']=[{'all':!![]}];}_0x1d89fc=_[_0xad2d('0x40')]({},_0x1d89fc,_0x4c5626['options']);return db[_0xad2d('0x2c')][_0xad2d('0x49')](_0x1d89fc)[_0xad2d('0x26')](handleEntityNotFound(_0x4ab9a6,null))[_0xad2d('0x26')](respondWithResult(_0x4ab9a6,null))[_0xad2d('0x45')](handleError(_0x4ab9a6,null));};exports[_0xad2d('0x4a')]=function(_0x27c8c9,_0x5dfc39){return db[_0xad2d('0x2c')][_0xad2d('0x4a')](_0x27c8c9['body'],{})[_0xad2d('0x26')](respondWithResult(_0x5dfc39,0xc9))[_0xad2d('0x45')](handleError(_0x5dfc39,null));};exports[_0xad2d('0x4b')]=function(_0xad5311,_0x188ec6){if(_0xad5311[_0xad2d('0x4c')]['id']){delete _0xad5311[_0xad2d('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xad2d('0x49')]({'where':{'id':_0xad5311[_0xad2d('0x47')]['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x188ec6,null))[_0xad2d('0x26')](saveUpdates(_0xad5311[_0xad2d('0x4c')],null))['then'](respondWithResult(_0x188ec6,null))[_0xad2d('0x45')](handleError(_0x188ec6,null));};exports[_0xad2d('0x27')]=function(_0x268519,_0x297481){return db[_0xad2d('0x2c')][_0xad2d('0x49')]({'where':{'id':_0x268519[_0xad2d('0x47')]['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x297481,null))[_0xad2d('0x26')](removeEntity(_0x297481,null))[_0xad2d('0x45')](handleError(_0x297481,null));};exports['getFields']=function(_0x40aedd,_0x20fab5,_0x26e9d4){var _0x10e73c={};var _0x55bdb9={};var _0x2a226f;var _0x32a7ae;return db['ZendeskConfiguration'][_0xad2d('0x4d')]({'where':{'id':_0x40aedd[_0xad2d('0x47')]['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x20fab5,null))[_0xad2d('0x26')](function(_0x2e7e2a){if(_0x2e7e2a){_0x2a226f=_0x2e7e2a;_0x55bdb9['model']=_[_0xad2d('0x32')](db['ZendeskField'][_0xad2d('0x48')]);_0x55bdb9[_0xad2d('0x31')]=_[_0xad2d('0x32')](_0x40aedd[_0xad2d('0x31')]);_0x55bdb9[_0xad2d('0x33')]=_['intersection'](_0x55bdb9[_0xad2d('0x2f')],_0x55bdb9['query']);_0x10e73c[_0xad2d('0x35')]=_['intersection'](_0x55bdb9[_0xad2d('0x2f')],qs[_0xad2d('0x36')](_0x40aedd[_0xad2d('0x31')]['fields']));_0x10e73c[_0xad2d('0x35')]=_0x10e73c[_0xad2d('0x35')][_0xad2d('0x37')]?_0x10e73c[_0xad2d('0x35')]:_0x55bdb9['model'];_0x10e73c[_0xad2d('0x39')]=qs[_0xad2d('0x3a')](_0x40aedd[_0xad2d('0x31')]['sort']);_0x10e73c['where']=qs[_0xad2d('0x33')](_[_0xad2d('0x3c')](_0x40aedd[_0xad2d('0x31')],_0x55bdb9[_0xad2d('0x33')]));if(_0x40aedd[_0xad2d('0x31')][_0xad2d('0x3d')]){_0x10e73c['where']=_[_0xad2d('0x40')](_0x10e73c[_0xad2d('0x3b')],{'$or':_['map'](_0x10e73c[_0xad2d('0x35')],function(_0x58aaf6){var _0x28a989={};_0x28a989[_0x58aaf6]={'$like':'%'+_0x40aedd[_0xad2d('0x31')][_0xad2d('0x3d')]+'%'};return _0x28a989;})});}_0x10e73c=_[_0xad2d('0x40')]({},_0x10e73c,_0x40aedd[_0xad2d('0x41')]);return _0x2a226f[_0xad2d('0x4e')](_0x10e73c);}})[_0xad2d('0x26')](function(_0x4e4d74){if(_0x4e4d74){_0x32a7ae=_0x4e4d74[_0xad2d('0x37')];if(!_0x40aedd[_0xad2d('0x31')][_0xad2d('0x38')]('nolimit')){_0x10e73c[_0xad2d('0x20')]=qs['limit'](_0x40aedd['query'][_0xad2d('0x20')]);_0x10e73c[_0xad2d('0x22')]=qs[_0xad2d('0x22')](_0x40aedd[_0xad2d('0x31')][_0xad2d('0x22')]);}return _0x2a226f['getFields'](_0x10e73c);}})['then'](function(_0x3793bf){if(_0x3793bf){return _0x3793bf?{'count':_0x32a7ae,'rows':_0x3793bf}:null;}})['then'](respondWithResult(_0x20fab5,null))[_0xad2d('0x45')](handleError(_0x20fab5,null));};exports['getSubjects']=function(_0x571658,_0x1f30b4,_0x1e4962){var _0x10a122={};var _0x498b19={};var _0x5dac6a;var _0x37449d;return db[_0xad2d('0x2c')]['findOne']({'where':{'id':_0x571658['params']['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x1f30b4,null))[_0xad2d('0x26')](function(_0x16f20d){if(_0x16f20d){_0x5dac6a=_0x16f20d;_0x498b19['model']=_[_0xad2d('0x32')](db['ZendeskField'][_0xad2d('0x48')]);_0x498b19['query']=_[_0xad2d('0x32')](_0x571658[_0xad2d('0x31')]);_0x498b19[_0xad2d('0x33')]=_[_0xad2d('0x34')](_0x498b19[_0xad2d('0x2f')],_0x498b19[_0xad2d('0x31')]);_0x10a122[_0xad2d('0x35')]=_[_0xad2d('0x34')](_0x498b19['model'],qs[_0xad2d('0x36')](_0x571658[_0xad2d('0x31')][_0xad2d('0x36')]));_0x10a122[_0xad2d('0x35')]=_0x10a122[_0xad2d('0x35')]['length']?_0x10a122[_0xad2d('0x35')]:_0x498b19[_0xad2d('0x2f')];_0x10a122[_0xad2d('0x39')]=qs[_0xad2d('0x3a')](_0x571658[_0xad2d('0x31')][_0xad2d('0x3a')]);_0x10a122[_0xad2d('0x3b')]=qs[_0xad2d('0x33')](_['pick'](_0x571658[_0xad2d('0x31')],_0x498b19[_0xad2d('0x33')]));if(_0x571658['query'][_0xad2d('0x3d')]){_0x10a122[_0xad2d('0x3b')]=_[_0xad2d('0x40')](_0x10a122[_0xad2d('0x3b')],{'$or':_[_0xad2d('0x30')](_0x10a122[_0xad2d('0x35')],function(_0x2e3de6){var _0x4ad742={};_0x4ad742[_0x2e3de6]={'$like':'%'+_0x571658[_0xad2d('0x31')][_0xad2d('0x3d')]+'%'};return _0x4ad742;})});}_0x10a122=_[_0xad2d('0x40')]({},_0x10a122,_0x571658[_0xad2d('0x41')]);return _0x5dac6a[_0xad2d('0x4f')](_0x10a122);}})[_0xad2d('0x26')](function(_0x475328){if(_0x475328){_0x37449d=_0x475328[_0xad2d('0x37')];if(!_0x571658[_0xad2d('0x31')][_0xad2d('0x38')](_0xad2d('0x50'))){_0x10a122['limit']=qs[_0xad2d('0x20')](_0x571658['query'][_0xad2d('0x20')]);_0x10a122[_0xad2d('0x22')]=qs['offset'](_0x571658[_0xad2d('0x31')][_0xad2d('0x22')]);}return _0x5dac6a[_0xad2d('0x4f')](_0x10a122);}})['then'](function(_0xd20c60){if(_0xd20c60){return _0xd20c60?{'count':_0x37449d,'rows':_0xd20c60}:null;}})[_0xad2d('0x26')](respondWithResult(_0x1f30b4,null))[_0xad2d('0x45')](handleError(_0x1f30b4,null));};exports[_0xad2d('0x51')]=function(_0x1c76c1,_0x197545,_0xb27072){var _0x3a5423={};var _0x3f2648={};var _0x4b7c9a;var _0xaa074f;return db[_0xad2d('0x2c')]['findOne']({'where':{'id':_0x1c76c1[_0xad2d('0x47')]['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x197545,null))[_0xad2d('0x26')](function(_0x4ff8f0){if(_0x4ff8f0){_0x4b7c9a=_0x4ff8f0;_0x3f2648['model']=_[_0xad2d('0x32')](db[_0xad2d('0x52')][_0xad2d('0x48')]);_0x3f2648[_0xad2d('0x31')]=_[_0xad2d('0x32')](_0x1c76c1['query']);_0x3f2648['filters']=_[_0xad2d('0x34')](_0x3f2648['model'],_0x3f2648[_0xad2d('0x31')]);_0x3a5423['attributes']=_[_0xad2d('0x34')](_0x3f2648[_0xad2d('0x2f')],qs[_0xad2d('0x36')](_0x1c76c1['query']['fields']));_0x3a5423[_0xad2d('0x35')]=_0x3a5423[_0xad2d('0x35')][_0xad2d('0x37')]?_0x3a5423['attributes']:_0x3f2648[_0xad2d('0x2f')];_0x3a5423[_0xad2d('0x39')]=qs[_0xad2d('0x3a')](_0x1c76c1[_0xad2d('0x31')]['sort']);_0x3a5423[_0xad2d('0x3b')]=qs[_0xad2d('0x33')](_[_0xad2d('0x3c')](_0x1c76c1['query'],_0x3f2648[_0xad2d('0x33')]));if(_0x1c76c1[_0xad2d('0x31')][_0xad2d('0x3d')]){_0x3a5423[_0xad2d('0x3b')]=_[_0xad2d('0x40')](_0x3a5423[_0xad2d('0x3b')],{'$or':_['map'](_0x3a5423['attributes'],function(_0x4840c0){var _0x248fc7={};_0x248fc7[_0x4840c0]={'$like':'%'+_0x1c76c1[_0xad2d('0x31')][_0xad2d('0x3d')]+'%'};return _0x248fc7;})});}_0x3a5423=_[_0xad2d('0x40')]({},_0x3a5423,_0x1c76c1[_0xad2d('0x41')]);return _0x4b7c9a[_0xad2d('0x51')](_0x3a5423);}})[_0xad2d('0x26')](function(_0x53a688){if(_0x53a688){_0xaa074f=_0x53a688[_0xad2d('0x37')];if(!_0x1c76c1[_0xad2d('0x31')][_0xad2d('0x38')](_0xad2d('0x50'))){_0x3a5423[_0xad2d('0x20')]=qs[_0xad2d('0x20')](_0x1c76c1[_0xad2d('0x31')][_0xad2d('0x20')]);_0x3a5423[_0xad2d('0x22')]=qs[_0xad2d('0x22')](_0x1c76c1[_0xad2d('0x31')][_0xad2d('0x22')]);}return _0x4b7c9a[_0xad2d('0x51')](_0x3a5423);}})['then'](function(_0x1a6b2f){if(_0x1a6b2f){return _0x1a6b2f?{'count':_0xaa074f,'rows':_0x1a6b2f}:null;}})[_0xad2d('0x26')](respondWithResult(_0x197545,null))[_0xad2d('0x45')](handleError(_0x197545,null));};exports[_0xad2d('0x53')]=function(_0xa76fde,_0x220b60,_0x3e1f3e){var _0x852909={};var _0x5c26f7={};var _0x527224;var _0x5e14b2;return db['ZendeskConfiguration'][_0xad2d('0x4d')]({'where':{'id':_0xa76fde[_0xad2d('0x47')]['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x220b60,null))['then'](function(_0x3596f4){if(_0x3596f4){_0x527224=_0x3596f4;_0x5c26f7[_0xad2d('0x2f')]=_[_0xad2d('0x32')](db[_0xad2d('0x54')][_0xad2d('0x48')]);_0x5c26f7[_0xad2d('0x31')]=_[_0xad2d('0x32')](_0xa76fde[_0xad2d('0x31')]);_0x5c26f7[_0xad2d('0x33')]=_[_0xad2d('0x34')](_0x5c26f7['model'],_0x5c26f7[_0xad2d('0x31')]);_0x852909[_0xad2d('0x35')]=_['intersection'](_0x5c26f7['model'],qs[_0xad2d('0x36')](_0xa76fde[_0xad2d('0x31')][_0xad2d('0x36')]));_0x852909[_0xad2d('0x35')]=_0x852909['attributes']['length']?_0x852909['attributes']:_0x5c26f7[_0xad2d('0x2f')];_0x852909[_0xad2d('0x39')]=qs[_0xad2d('0x3a')](_0xa76fde[_0xad2d('0x31')][_0xad2d('0x3a')]);_0x852909['where']=qs['filters'](_[_0xad2d('0x3c')](_0xa76fde[_0xad2d('0x31')],_0x5c26f7['filters']));if(_0xa76fde[_0xad2d('0x31')][_0xad2d('0x3d')]){_0x852909[_0xad2d('0x3b')]=_[_0xad2d('0x40')](_0x852909[_0xad2d('0x3b')],{'$or':_[_0xad2d('0x30')](_0x852909[_0xad2d('0x35')],function(_0x51703f){var _0x89a944={};_0x89a944[_0x51703f]={'$like':'%'+_0xa76fde[_0xad2d('0x31')][_0xad2d('0x3d')]+'%'};return _0x89a944;})});}_0x852909=_[_0xad2d('0x40')]({},_0x852909,_0xa76fde[_0xad2d('0x41')]);return _0x527224[_0xad2d('0x53')](_0x852909);}})[_0xad2d('0x26')](function(_0x4f2746){if(_0x4f2746){_0x5e14b2=_0x4f2746[_0xad2d('0x37')];if(!_0xa76fde[_0xad2d('0x31')][_0xad2d('0x38')](_0xad2d('0x50'))){_0x852909[_0xad2d('0x20')]=qs[_0xad2d('0x20')](_0xa76fde[_0xad2d('0x31')]['limit']);_0x852909[_0xad2d('0x22')]=qs[_0xad2d('0x22')](_0xa76fde[_0xad2d('0x31')][_0xad2d('0x22')]);}return _0x527224[_0xad2d('0x53')](_0x852909);}})[_0xad2d('0x26')](function(_0x3adc28){if(_0x3adc28){return _0x3adc28?{'count':_0x5e14b2,'rows':_0x3adc28}:null;}})[_0xad2d('0x26')](respondWithResult(_0x220b60,null))['catch'](handleError(_0x220b60,null));};exports[_0xad2d('0x55')]=function(_0x5b8a90,_0x2443b5,_0x36b7cc){if(_0x5b8a90[_0xad2d('0x4c')]['id']){delete _0x5b8a90[_0xad2d('0x4c')]['id'];}return db[_0xad2d('0x2c')]['findOne']({'where':{'id':_0x5b8a90['params']['id']}})[_0xad2d('0x26')](handleEntityNotFound(_0x2443b5,null))['then'](function(_0x1e5e5e){if(_0x1e5e5e){return _0x1e5e5e[_0xad2d('0x55')](_0x5b8a90[_0xad2d('0x4c')][_0xad2d('0x56')]||[]);}return null;})['then'](respondWithResult(_0x2443b5,null))[_0xad2d('0x45')](handleError(_0x2443b5,null));};
\ No newline at end of file
+var _0xbc52=['order','filter','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','destroy','then','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','map','keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne'];(function(_0xef8e69,_0xbc78ff){var _0x463ee6=function(_0x2e0695){while(--_0x2e0695){_0xef8e69['push'](_0xef8e69['shift']());}};_0x463ee6(++_0xbc78ff);}(_0xbc52,0x151));var _0x2bc5=function(_0x364ae8,_0x3a39ea){_0x364ae8=_0x364ae8-0x0;var _0x424c8a=_0xbc52[_0x364ae8];return _0x424c8a;};'use strict';var emlformat=require(_0x2bc5('0x0'));var rimraf=require(_0x2bc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2bc5('0x2'));var rp=require('request-promise');var moment=require(_0x2bc5('0x3'));var BPromise=require(_0x2bc5('0x4'));var Mustache=require(_0x2bc5('0x5'));var util=require(_0x2bc5('0x6'));var path=require(_0x2bc5('0x7'));var sox=require('sox');var csv=require(_0x2bc5('0x8'));var ejs=require(_0x2bc5('0x9'));var fs=require('fs');var fs_extra=require(_0x2bc5('0xa'));var _=require(_0x2bc5('0xb'));var squel=require('squel');var crypto=require(_0x2bc5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2bc5('0xd'));var toCsv=require(_0x2bc5('0x8'));var querystring=require('querystring');var Papa=require(_0x2bc5('0xe'));var Redis=require(_0x2bc5('0xf'));var authService=require(_0x2bc5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bc5('0x11'));var logger=require(_0x2bc5('0x12'))(_0x2bc5('0x13'));var utils=require(_0x2bc5('0x14'));var config=require(_0x2bc5('0x15'));var licenseUtil=require(_0x2bc5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4259cd,_0x346237){_0x346237=_0x346237||0xcc;return function(_0x78d2ae){if(_0x78d2ae){return _0x4259cd[_0x2bc5('0x17')](_0x346237);}return _0x4259cd[_0x2bc5('0x18')](_0x346237)[_0x2bc5('0x19')]();};}function respondWithResult(_0x5a2265,_0x503654){_0x503654=_0x503654||0xc8;return function(_0x49c9b6){if(_0x49c9b6){return _0x5a2265[_0x2bc5('0x18')](_0x503654)['json'](_0x49c9b6);}};}function respondWithFilteredResult(_0x27dcfe,_0x196447){return function(_0x11d79f){if(_0x11d79f){var _0x57936d=typeof _0x196447[_0x2bc5('0x1a')]===_0x2bc5('0x1b')&&typeof _0x196447['limit']===_0x2bc5('0x1b');var _0xc23c85=_0x11d79f[_0x2bc5('0x1c')];var _0x1e590e=_0x57936d?0x0:_0x196447['offset'];var _0x4d2bb2=_0x57936d?_0x11d79f[_0x2bc5('0x1c')]:_0x196447[_0x2bc5('0x1a')]+_0x196447[_0x2bc5('0x1d')];var _0x2194d5;if(_0x4d2bb2>=_0xc23c85){_0x4d2bb2=_0xc23c85;_0x2194d5=0xc8;}else{_0x2194d5=0xce;}_0x27dcfe[_0x2bc5('0x18')](_0x2194d5);return _0x27dcfe[_0x2bc5('0x1e')]('Content-Range',_0x1e590e+'-'+_0x4d2bb2+'/'+_0xc23c85)[_0x2bc5('0x1f')](_0x11d79f);}return null;};}function patchUpdates(_0x10a43f){return function(_0x49c4ef){try{jsonpatch['apply'](_0x49c4ef,_0x10a43f,!![]);}catch(_0x143a06){return BPromise['reject'](_0x143a06);}return _0x49c4ef[_0x2bc5('0x20')]();};}function saveUpdates(_0x3e6519,_0x58806b){return function(_0x2ea62a){if(_0x2ea62a){return _0x2ea62a[_0x2bc5('0x21')](_0x3e6519)['then'](function(_0x1cc6e4){return _0x1cc6e4;});}return null;};}function removeEntity(_0x265bd4,_0x4ec6d7){return function(_0x5d47e7){if(_0x5d47e7){return _0x5d47e7[_0x2bc5('0x22')]()[_0x2bc5('0x23')](function(){_0x265bd4[_0x2bc5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a91c,_0x42c0cb){return function(_0x36aa04){if(!_0x36aa04){_0x22a91c['sendStatus'](0x194);}return _0x36aa04;};}function handleError(_0x3ca40a,_0x3c900b){_0x3c900b=_0x3c900b||0x1f4;return function(_0x4ea450){logger[_0x2bc5('0x24')](_0x4ea450[_0x2bc5('0x25')]);if(_0x4ea450['name']){delete _0x4ea450[_0x2bc5('0x26')];}_0x3ca40a[_0x2bc5('0x18')](_0x3c900b)[_0x2bc5('0x27')](_0x4ea450);};}exports[_0x2bc5('0x28')]=function(_0x54f8c5,_0xbb49bb){var _0x190950={},_0x20d1e2={},_0x4c790a={'count':0x0,'rows':[]};var _0xf5531f=_['map'](db[_0x2bc5('0x29')][_0x2bc5('0x2a')],function(_0x296f7e){return{'name':_0x296f7e[_0x2bc5('0x2b')],'type':_0x296f7e['type']['key']};});_0x20d1e2['model']=_[_0x2bc5('0x2c')](_0xf5531f,_0x2bc5('0x26'));_0x20d1e2['query']=_[_0x2bc5('0x2d')](_0x54f8c5['query']);_0x20d1e2[_0x2bc5('0x2e')]=_[_0x2bc5('0x2f')](_0x20d1e2['model'],_0x20d1e2['query']);_0x190950[_0x2bc5('0x30')]=_['intersection'](_0x20d1e2[_0x2bc5('0x31')],qs[_0x2bc5('0x32')](_0x54f8c5[_0x2bc5('0x33')][_0x2bc5('0x32')]));_0x190950[_0x2bc5('0x30')]=_0x190950[_0x2bc5('0x30')][_0x2bc5('0x34')]?_0x190950[_0x2bc5('0x30')]:_0x20d1e2[_0x2bc5('0x31')];if(!_0x54f8c5[_0x2bc5('0x33')][_0x2bc5('0x35')](_0x2bc5('0x36'))){_0x190950[_0x2bc5('0x1d')]=qs['limit'](_0x54f8c5['query'][_0x2bc5('0x1d')]);_0x190950[_0x2bc5('0x1a')]=qs['offset'](_0x54f8c5[_0x2bc5('0x33')][_0x2bc5('0x1a')]);}_0x190950['order']=qs['sort'](_0x54f8c5[_0x2bc5('0x33')][_0x2bc5('0x37')]);_0x190950['where']=qs[_0x2bc5('0x2e')](_[_0x2bc5('0x38')](_0x54f8c5[_0x2bc5('0x33')],_0x20d1e2[_0x2bc5('0x2e')]),_0xf5531f);if(_0x54f8c5['query']['filter']){_0x190950[_0x2bc5('0x39')]=_[_0x2bc5('0x3a')](_0x190950[_0x2bc5('0x39')],{'$or':_[_0x2bc5('0x2c')](_0xf5531f,function(_0x5a4c37){if(_0x5a4c37[_0x2bc5('0x3b')]!=='VIRTUAL'){var _0x569236={};_0x569236[_0x5a4c37[_0x2bc5('0x26')]]={'$like':'%'+_0x54f8c5[_0x2bc5('0x33')]['filter']+'%'};return _0x569236;}})});}_0x190950=_[_0x2bc5('0x3a')]({},_0x190950,_0x54f8c5[_0x2bc5('0x3c')]);var _0x37f681={'where':_0x190950['where']};return db[_0x2bc5('0x29')][_0x2bc5('0x1c')](_0x37f681)[_0x2bc5('0x23')](function(_0x37eb16){_0x4c790a[_0x2bc5('0x1c')]=_0x37eb16;if(_0x54f8c5[_0x2bc5('0x33')]['includeAll']){_0x190950[_0x2bc5('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x2bc5('0x3e')](_0x190950);})[_0x2bc5('0x23')](function(_0x41f5bb){_0x4c790a[_0x2bc5('0x3f')]=_0x41f5bb;return _0x4c790a;})[_0x2bc5('0x23')](respondWithFilteredResult(_0xbb49bb,_0x190950))[_0x2bc5('0x40')](handleError(_0xbb49bb,null));};exports[_0x2bc5('0x41')]=function(_0x56858b,_0x4eb7f0){var _0x3cbc9b={'raw':![],'where':{'id':_0x56858b[_0x2bc5('0x42')]['id']}},_0x550ea2={};_0x550ea2[_0x2bc5('0x31')]=_['keys'](db[_0x2bc5('0x29')][_0x2bc5('0x2a')]);_0x550ea2[_0x2bc5('0x33')]=_[_0x2bc5('0x2d')](_0x56858b[_0x2bc5('0x33')]);_0x550ea2[_0x2bc5('0x2e')]=_[_0x2bc5('0x2f')](_0x550ea2[_0x2bc5('0x31')],_0x550ea2[_0x2bc5('0x33')]);_0x3cbc9b[_0x2bc5('0x30')]=_['intersection'](_0x550ea2[_0x2bc5('0x31')],qs[_0x2bc5('0x32')](_0x56858b['query'][_0x2bc5('0x32')]));_0x3cbc9b[_0x2bc5('0x30')]=_0x3cbc9b['attributes'][_0x2bc5('0x34')]?_0x3cbc9b[_0x2bc5('0x30')]:_0x550ea2['model'];if(_0x56858b[_0x2bc5('0x33')][_0x2bc5('0x43')]){_0x3cbc9b['include']=[{'all':!![]}];}_0x3cbc9b=_['merge']({},_0x3cbc9b,_0x56858b[_0x2bc5('0x3c')]);return db[_0x2bc5('0x29')][_0x2bc5('0x44')](_0x3cbc9b)[_0x2bc5('0x23')](handleEntityNotFound(_0x4eb7f0,null))[_0x2bc5('0x23')](respondWithResult(_0x4eb7f0,null))[_0x2bc5('0x40')](handleError(_0x4eb7f0,null));};exports[_0x2bc5('0x45')]=function(_0xc4dddd,_0x5e46be){return db[_0x2bc5('0x29')][_0x2bc5('0x45')](_0xc4dddd[_0x2bc5('0x46')],{})['then'](respondWithResult(_0x5e46be,0xc9))[_0x2bc5('0x40')](handleError(_0x5e46be,null));};exports[_0x2bc5('0x21')]=function(_0x45200d,_0x3c3cca){if(_0x45200d['body']['id']){delete _0x45200d[_0x2bc5('0x46')]['id'];}return db[_0x2bc5('0x29')][_0x2bc5('0x44')]({'where':{'id':_0x45200d['params']['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x3c3cca,null))[_0x2bc5('0x23')](saveUpdates(_0x45200d[_0x2bc5('0x46')],null))[_0x2bc5('0x23')](respondWithResult(_0x3c3cca,null))['catch'](handleError(_0x3c3cca,null));};exports[_0x2bc5('0x22')]=function(_0x112b56,_0xf73526){return db[_0x2bc5('0x29')]['find']({'where':{'id':_0x112b56[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0xf73526,null))[_0x2bc5('0x23')](removeEntity(_0xf73526,null))['catch'](handleError(_0xf73526,null));};exports[_0x2bc5('0x47')]=function(_0x33871c,_0x3a2f14,_0x5d42bb){var _0xcba094={};var _0x1559ad={};var _0x1a575d;var _0x565026;return db[_0x2bc5('0x29')][_0x2bc5('0x48')]({'where':{'id':_0x33871c[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x3a2f14,null))[_0x2bc5('0x23')](function(_0x1f423c){if(_0x1f423c){_0x1a575d=_0x1f423c;_0x1559ad[_0x2bc5('0x31')]=_[_0x2bc5('0x2d')](db['ZendeskField'][_0x2bc5('0x2a')]);_0x1559ad[_0x2bc5('0x33')]=_[_0x2bc5('0x2d')](_0x33871c[_0x2bc5('0x33')]);_0x1559ad['filters']=_[_0x2bc5('0x2f')](_0x1559ad[_0x2bc5('0x31')],_0x1559ad[_0x2bc5('0x33')]);_0xcba094[_0x2bc5('0x30')]=_[_0x2bc5('0x2f')](_0x1559ad[_0x2bc5('0x31')],qs['fields'](_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x32')]));_0xcba094[_0x2bc5('0x30')]=_0xcba094['attributes'][_0x2bc5('0x34')]?_0xcba094['attributes']:_0x1559ad['model'];_0xcba094[_0x2bc5('0x49')]=qs['sort'](_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x37')]);_0xcba094[_0x2bc5('0x39')]=qs[_0x2bc5('0x2e')](_[_0x2bc5('0x38')](_0x33871c[_0x2bc5('0x33')],_0x1559ad['filters']));if(_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x4a')]){_0xcba094[_0x2bc5('0x39')]=_[_0x2bc5('0x3a')](_0xcba094[_0x2bc5('0x39')],{'$or':_[_0x2bc5('0x2c')](_0xcba094[_0x2bc5('0x30')],function(_0x2edcfe){var _0x1d7cfe={};_0x1d7cfe[_0x2edcfe]={'$like':'%'+_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x4a')]+'%'};return _0x1d7cfe;})});}_0xcba094=_[_0x2bc5('0x3a')]({},_0xcba094,_0x33871c['options']);return _0x1a575d[_0x2bc5('0x47')](_0xcba094);}})['then'](function(_0x46036d){if(_0x46036d){_0x565026=_0x46036d[_0x2bc5('0x34')];if(!_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x35')](_0x2bc5('0x36'))){_0xcba094['limit']=qs['limit'](_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x1d')]);_0xcba094['offset']=qs[_0x2bc5('0x1a')](_0x33871c[_0x2bc5('0x33')][_0x2bc5('0x1a')]);}return _0x1a575d['getFields'](_0xcba094);}})[_0x2bc5('0x23')](function(_0x1777dc){if(_0x1777dc){return _0x1777dc?{'count':_0x565026,'rows':_0x1777dc}:null;}})['then'](respondWithResult(_0x3a2f14,null))['catch'](handleError(_0x3a2f14,null));};exports[_0x2bc5('0x4b')]=function(_0x2bc3ff,_0x392cc4,_0x1b27fc){var _0x414a29={};var _0x1251f6={};var _0x2715b8;var _0x5143d6;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2bc3ff[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x392cc4,null))['then'](function(_0x1ceadb){if(_0x1ceadb){_0x2715b8=_0x1ceadb;_0x1251f6[_0x2bc5('0x31')]=_[_0x2bc5('0x2d')](db[_0x2bc5('0x4c')]['rawAttributes']);_0x1251f6[_0x2bc5('0x33')]=_[_0x2bc5('0x2d')](_0x2bc3ff[_0x2bc5('0x33')]);_0x1251f6['filters']=_[_0x2bc5('0x2f')](_0x1251f6[_0x2bc5('0x31')],_0x1251f6[_0x2bc5('0x33')]);_0x414a29[_0x2bc5('0x30')]=_['intersection'](_0x1251f6[_0x2bc5('0x31')],qs['fields'](_0x2bc3ff[_0x2bc5('0x33')][_0x2bc5('0x32')]));_0x414a29[_0x2bc5('0x30')]=_0x414a29[_0x2bc5('0x30')][_0x2bc5('0x34')]?_0x414a29['attributes']:_0x1251f6['model'];_0x414a29[_0x2bc5('0x49')]=qs[_0x2bc5('0x37')](_0x2bc3ff['query'][_0x2bc5('0x37')]);_0x414a29[_0x2bc5('0x39')]=qs['filters'](_['pick'](_0x2bc3ff['query'],_0x1251f6[_0x2bc5('0x2e')]));if(_0x2bc3ff[_0x2bc5('0x33')]['filter']){_0x414a29[_0x2bc5('0x39')]=_['merge'](_0x414a29['where'],{'$or':_[_0x2bc5('0x2c')](_0x414a29[_0x2bc5('0x30')],function(_0x54055a){var _0x44a627={};_0x44a627[_0x54055a]={'$like':'%'+_0x2bc3ff['query'][_0x2bc5('0x4a')]+'%'};return _0x44a627;})});}_0x414a29=_[_0x2bc5('0x3a')]({},_0x414a29,_0x2bc3ff[_0x2bc5('0x3c')]);return _0x2715b8[_0x2bc5('0x4b')](_0x414a29);}})[_0x2bc5('0x23')](function(_0x2fec4b){if(_0x2fec4b){_0x5143d6=_0x2fec4b[_0x2bc5('0x34')];if(!_0x2bc3ff[_0x2bc5('0x33')][_0x2bc5('0x35')](_0x2bc5('0x36'))){_0x414a29[_0x2bc5('0x1d')]=qs[_0x2bc5('0x1d')](_0x2bc3ff[_0x2bc5('0x33')][_0x2bc5('0x1d')]);_0x414a29[_0x2bc5('0x1a')]=qs[_0x2bc5('0x1a')](_0x2bc3ff[_0x2bc5('0x33')][_0x2bc5('0x1a')]);}return _0x2715b8[_0x2bc5('0x4b')](_0x414a29);}})[_0x2bc5('0x23')](function(_0x2f3cd8){if(_0x2f3cd8){return _0x2f3cd8?{'count':_0x5143d6,'rows':_0x2f3cd8}:null;}})[_0x2bc5('0x23')](respondWithResult(_0x392cc4,null))[_0x2bc5('0x40')](handleError(_0x392cc4,null));};exports[_0x2bc5('0x4d')]=function(_0x278ab4,_0x5af1af,_0x52f3b9){var _0x546a6b={};var _0x3d11a9={};var _0x4fffdb;var _0x48f8bc;return db[_0x2bc5('0x29')][_0x2bc5('0x48')]({'where':{'id':_0x278ab4[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x5af1af,null))[_0x2bc5('0x23')](function(_0x31d32f){if(_0x31d32f){_0x4fffdb=_0x31d32f;_0x3d11a9['model']=_[_0x2bc5('0x2d')](db[_0x2bc5('0x4c')][_0x2bc5('0x2a')]);_0x3d11a9[_0x2bc5('0x33')]=_[_0x2bc5('0x2d')](_0x278ab4['query']);_0x3d11a9[_0x2bc5('0x2e')]=_[_0x2bc5('0x2f')](_0x3d11a9[_0x2bc5('0x31')],_0x3d11a9['query']);_0x546a6b['attributes']=_[_0x2bc5('0x2f')](_0x3d11a9[_0x2bc5('0x31')],qs[_0x2bc5('0x32')](_0x278ab4[_0x2bc5('0x33')][_0x2bc5('0x32')]));_0x546a6b[_0x2bc5('0x30')]=_0x546a6b[_0x2bc5('0x30')]['length']?_0x546a6b['attributes']:_0x3d11a9[_0x2bc5('0x31')];_0x546a6b['order']=qs['sort'](_0x278ab4[_0x2bc5('0x33')]['sort']);_0x546a6b[_0x2bc5('0x39')]=qs[_0x2bc5('0x2e')](_[_0x2bc5('0x38')](_0x278ab4[_0x2bc5('0x33')],_0x3d11a9['filters']));if(_0x278ab4[_0x2bc5('0x33')][_0x2bc5('0x4a')]){_0x546a6b[_0x2bc5('0x39')]=_[_0x2bc5('0x3a')](_0x546a6b[_0x2bc5('0x39')],{'$or':_[_0x2bc5('0x2c')](_0x546a6b[_0x2bc5('0x30')],function(_0x58af51){var _0x176bae={};_0x176bae[_0x58af51]={'$like':'%'+_0x278ab4[_0x2bc5('0x33')][_0x2bc5('0x4a')]+'%'};return _0x176bae;})});}_0x546a6b=_[_0x2bc5('0x3a')]({},_0x546a6b,_0x278ab4[_0x2bc5('0x3c')]);return _0x4fffdb['getDescriptions'](_0x546a6b);}})[_0x2bc5('0x23')](function(_0x3c774b){if(_0x3c774b){_0x48f8bc=_0x3c774b[_0x2bc5('0x34')];if(!_0x278ab4[_0x2bc5('0x33')]['hasOwnProperty'](_0x2bc5('0x36'))){_0x546a6b[_0x2bc5('0x1d')]=qs['limit'](_0x278ab4['query'][_0x2bc5('0x1d')]);_0x546a6b[_0x2bc5('0x1a')]=qs[_0x2bc5('0x1a')](_0x278ab4[_0x2bc5('0x33')][_0x2bc5('0x1a')]);}return _0x4fffdb['getDescriptions'](_0x546a6b);}})[_0x2bc5('0x23')](function(_0x3b3449){if(_0x3b3449){return _0x3b3449?{'count':_0x48f8bc,'rows':_0x3b3449}:null;}})[_0x2bc5('0x23')](respondWithResult(_0x5af1af,null))[_0x2bc5('0x40')](handleError(_0x5af1af,null));};exports[_0x2bc5('0x4e')]=function(_0x1e9a9f,_0x4a1371,_0x53e86f){var _0x4121f1={};var _0x3277b4={};var _0x3b902c;var _0xde3690;return db['ZendeskConfiguration'][_0x2bc5('0x48')]({'where':{'id':_0x1e9a9f[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x4a1371,null))['then'](function(_0x52378f){if(_0x52378f){_0x3b902c=_0x52378f;_0x3277b4[_0x2bc5('0x31')]=_[_0x2bc5('0x2d')](db[_0x2bc5('0x4f')][_0x2bc5('0x2a')]);_0x3277b4[_0x2bc5('0x33')]=_['keys'](_0x1e9a9f[_0x2bc5('0x33')]);_0x3277b4[_0x2bc5('0x2e')]=_[_0x2bc5('0x2f')](_0x3277b4['model'],_0x3277b4['query']);_0x4121f1[_0x2bc5('0x30')]=_[_0x2bc5('0x2f')](_0x3277b4[_0x2bc5('0x31')],qs['fields'](_0x1e9a9f[_0x2bc5('0x33')][_0x2bc5('0x32')]));_0x4121f1[_0x2bc5('0x30')]=_0x4121f1[_0x2bc5('0x30')][_0x2bc5('0x34')]?_0x4121f1['attributes']:_0x3277b4[_0x2bc5('0x31')];_0x4121f1['order']=qs[_0x2bc5('0x37')](_0x1e9a9f[_0x2bc5('0x33')][_0x2bc5('0x37')]);_0x4121f1[_0x2bc5('0x39')]=qs[_0x2bc5('0x2e')](_[_0x2bc5('0x38')](_0x1e9a9f['query'],_0x3277b4[_0x2bc5('0x2e')]));if(_0x1e9a9f[_0x2bc5('0x33')][_0x2bc5('0x4a')]){_0x4121f1[_0x2bc5('0x39')]=_['merge'](_0x4121f1[_0x2bc5('0x39')],{'$or':_['map'](_0x4121f1[_0x2bc5('0x30')],function(_0x3c99c6){var _0x182533={};_0x182533[_0x3c99c6]={'$like':'%'+_0x1e9a9f[_0x2bc5('0x33')][_0x2bc5('0x4a')]+'%'};return _0x182533;})});}_0x4121f1=_['merge']({},_0x4121f1,_0x1e9a9f[_0x2bc5('0x3c')]);return _0x3b902c['getTags'](_0x4121f1);}})[_0x2bc5('0x23')](function(_0x48a044){if(_0x48a044){_0xde3690=_0x48a044[_0x2bc5('0x34')];if(!_0x1e9a9f[_0x2bc5('0x33')]['hasOwnProperty'](_0x2bc5('0x36'))){_0x4121f1[_0x2bc5('0x1d')]=qs[_0x2bc5('0x1d')](_0x1e9a9f[_0x2bc5('0x33')]['limit']);_0x4121f1[_0x2bc5('0x1a')]=qs[_0x2bc5('0x1a')](_0x1e9a9f[_0x2bc5('0x33')][_0x2bc5('0x1a')]);}return _0x3b902c['getTags'](_0x4121f1);}})[_0x2bc5('0x23')](function(_0x47403d){if(_0x47403d){return _0x47403d?{'count':_0xde3690,'rows':_0x47403d}:null;}})['then'](respondWithResult(_0x4a1371,null))[_0x2bc5('0x40')](handleError(_0x4a1371,null));};exports[_0x2bc5('0x50')]=function(_0x3540a7,_0x4a06ee,_0x4a4522){if(_0x3540a7[_0x2bc5('0x46')]['id']){delete _0x3540a7['body']['id'];}return db[_0x2bc5('0x29')][_0x2bc5('0x48')]({'where':{'id':_0x3540a7[_0x2bc5('0x42')]['id']}})[_0x2bc5('0x23')](handleEntityNotFound(_0x4a06ee,null))[_0x2bc5('0x23')](function(_0x18752f){if(_0x18752f){return _0x18752f[_0x2bc5('0x50')](_0x3540a7[_0x2bc5('0x46')][_0x2bc5('0x51')]||[]);}return null;})[_0x2bc5('0x23')](respondWithResult(_0x4a06ee,null))['catch'](handleError(_0x4a06ee,null));};
\ No newline at end of file
index 9edae3a..4ce3156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa478=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1b85d5,_0xd48ca0){var _0x1c7938=function(_0x3c8c19){while(--_0x3c8c19){_0x1b85d5['push'](_0x1b85d5['shift']());}};_0x1c7938(++_0xd48ca0);}(_0xa478,0x136));var _0x8a47=function(_0x2aefff,_0x26a24b){_0x2aefff=_0x2aefff-0x0;var _0x4e4534=_0xa478[_0x2aefff];return _0x4e4534;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x896e=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14b562,_0x1b466d){var _0x29c5af=function(_0xfede84){while(--_0xfede84){_0x14b562['push'](_0x14b562['shift']());}};_0x29c5af(++_0x1b466d);}(_0x896e,0x1e9));var _0xe896=function(_0x1bd3e1,_0x5a7442){_0x1bd3e1=_0x1bd3e1-0x0;var _0x5add17=_0x896e[_0x1bd3e1];return _0x5add17;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3935795..16c719c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xe6d8ab,_0x3f706e){var _0xe08b36=function(_0x52fb25){while(--_0x52fb25){_0xe6d8ab['push'](_0xe6d8ab['shift']());}};_0xe08b36(++_0x3f706e);}(_0x2dd1,0x162));var _0x12dd=function(_0x213775,_0x2e51b0){_0x213775=_0x213775-0x0;var _0x856e8c=_0x2dd1[_0x213775];return _0x856e8c;};'use strict';var _=require(_0x12dd('0x0'));var util=require(_0x12dd('0x1'));var moment=require(_0x12dd('0x2'));var BPromise=require(_0x12dd('0x3'));var rs=require(_0x12dd('0x4'));var fs=require('fs');var Redis=require(_0x12dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x12dd('0x6'));var logger=require(_0x12dd('0x7'))(_0x12dd('0x8'));var config=require(_0x12dd('0x9'));var jayson=require(_0x12dd('0xa'));var client=jayson[_0x12dd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b2638,_0x512fb2,_0x15ac3e){return new BPromise(function(_0x15373f,_0x3108b2){return client[_0x12dd('0xc')](_0x4b2638,_0x15ac3e)[_0x12dd('0xd')](function(_0x1185db){logger[_0x12dd('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x512fb2,'request\x20sent');logger[_0x12dd('0xf')](_0x12dd('0x10'),_0x512fb2,'request\x20sent',JSON[_0x12dd('0x11')](_0x1185db));if(_0x1185db[_0x12dd('0x12')]){if(_0x1185db[_0x12dd('0x12')][_0x12dd('0x13')]===0x1f4){logger[_0x12dd('0x12')](_0x12dd('0x14'),_0x512fb2,_0x1185db[_0x12dd('0x12')][_0x12dd('0x15')]);return _0x3108b2(_0x1185db[_0x12dd('0x12')][_0x12dd('0x15')]);}logger[_0x12dd('0x12')](_0x12dd('0x14'),_0x512fb2,_0x1185db['error'][_0x12dd('0x15')]);return _0x15373f(_0x1185db[_0x12dd('0x12')][_0x12dd('0x15')]);}else{logger[_0x12dd('0xe')](_0x12dd('0x14'),_0x512fb2,_0x12dd('0x16'));_0x15373f(_0x1185db['result'][_0x12dd('0x15')]);}})[_0x12dd('0x17')](function(_0x3e86a6){logger[_0x12dd('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x512fb2,_0x3e86a6);_0x3108b2(_0x3e86a6);});});}
\ No newline at end of file
+var _0x10aa=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','http','request'];(function(_0x1ccf18,_0x55da90){var _0x41ce6c=function(_0x2f2cc8){while(--_0x2f2cc8){_0x1ccf18['push'](_0x1ccf18['shift']());}};_0x41ce6c(++_0x55da90);}(_0x10aa,0xad));var _0xa10a=function(_0x5c493a,_0x4ee199){_0x5c493a=_0x5c493a-0x0;var _0x1d1dca=_0x10aa[_0x5c493a];return _0x1d1dca;};'use strict';var _=require('lodash');var util=require(_0xa10a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa10a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa10a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa10a('0x3'))(_0xa10a('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa10a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x38286b,_0x588939,_0x4c54e2){return new BPromise(function(_0x3658d9,_0x235a9f){return client[_0xa10a('0x6')](_0x38286b,_0x4c54e2)[_0xa10a('0x7')](function(_0x41b357){logger[_0xa10a('0x8')](_0xa10a('0x9'),_0x588939,_0xa10a('0xa'));logger[_0xa10a('0xb')](_0xa10a('0xc'),_0x588939,'request\x20sent',JSON[_0xa10a('0xd')](_0x41b357));if(_0x41b357[_0xa10a('0xe')]){if(_0x41b357['error'][_0xa10a('0xf')]===0x1f4){logger['error'](_0xa10a('0x9'),_0x588939,_0x41b357[_0xa10a('0xe')]['message']);return _0x235a9f(_0x41b357[_0xa10a('0xe')][_0xa10a('0x10')]);}logger[_0xa10a('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x588939,_0x41b357['error']['message']);return _0x3658d9(_0x41b357[_0xa10a('0xe')]['message']);}else{logger[_0xa10a('0x8')](_0xa10a('0x9'),_0x588939,'request\x20sent');_0x3658d9(_0x41b357['result'][_0xa10a('0x10')]);}})[_0xa10a('0x11')](function(_0x5e99dd){logger[_0xa10a('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x588939,_0x5e99dd);_0x235a9f(_0x5e99dd);});});}
\ No newline at end of file
index 148e0e2..81a594b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0dd=['./intZendeskField.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x58b440,_0x3b2bb5){var _0x4b0624=function(_0x1e10f6){while(--_0x1e10f6){_0x58b440['push'](_0x58b440['shift']());}};_0x4b0624(++_0x3b2bb5);}(_0xd0dd,0x1d4));var _0xdd0d=function(_0x237190,_0x441f96){_0x237190=_0x237190-0x0;var _0x3a49f7=_0xd0dd[_0x237190];return _0x3a49f7;};'use strict';var multer=require(_0xdd0d('0x0'));var util=require(_0xdd0d('0x1'));var path=require('path');var timeout=require(_0xdd0d('0x2'));var express=require(_0xdd0d('0x3'));var router=express[_0xdd0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdd0d('0x5'));var interaction=require(_0xdd0d('0x6'));var config=require(_0xdd0d('0x7'));var controller=require(_0xdd0d('0x8'));router[_0xdd0d('0x9')]('/',auth[_0xdd0d('0xa')](),controller[_0xdd0d('0xb')]);router[_0xdd0d('0x9')](_0xdd0d('0xc'),auth[_0xdd0d('0xa')](),controller[_0xdd0d('0xd')]);router['post']('/',auth[_0xdd0d('0xa')](),controller['create']);router['put'](_0xdd0d('0xc'),auth[_0xdd0d('0xa')](),controller[_0xdd0d('0xe')]);router[_0xdd0d('0xf')](_0xdd0d('0xc'),auth[_0xdd0d('0xa')](),controller[_0xdd0d('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x86e9=['get','isAuthenticated','index','show','post','put','/:id','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x410ba5,_0x5c8b23){var _0x15eca4=function(_0x360702){while(--_0x360702){_0x410ba5['push'](_0x410ba5['shift']());}};_0x15eca4(++_0x5c8b23);}(_0x86e9,0x16e));var _0x986e=function(_0x4d1d2c,_0x44f4d8){_0x4d1d2c=_0x4d1d2c-0x0;var _0x2c4cb9=_0x86e9[_0x4d1d2c];return _0x2c4cb9;};'use strict';var multer=require('multer');var util=require(_0x986e('0x0'));var path=require(_0x986e('0x1'));var timeout=require(_0x986e('0x2'));var express=require('express');var router=express[_0x986e('0x3')]();var fs_extra=require(_0x986e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x986e('0x5'));var config=require(_0x986e('0x6'));var controller=require(_0x986e('0x7'));router[_0x986e('0x8')]('/',auth[_0x986e('0x9')](),controller[_0x986e('0xa')]);router[_0x986e('0x8')]('/:id',auth[_0x986e('0x9')](),controller[_0x986e('0xb')]);router[_0x986e('0xc')]('/',auth[_0x986e('0x9')](),controller['create']);router[_0x986e('0xd')](_0x986e('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x986e('0x9')](),controller[_0x986e('0xf')]);module[_0x986e('0x10')]=router;
\ No newline at end of file
index a18c572..65a67fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d6e=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x1c1555,_0x127b18){var _0x4c8d9d=function(_0x3c96a8){while(--_0x3c96a8){_0x1c1555['push'](_0x1c1555['shift']());}};_0x4c8d9d(++_0x127b18);}(_0x6d6e,0x18c));var _0xe6d6=function(_0x4cfa3a,_0x1869c9){_0x4cfa3a=_0x4cfa3a-0x0;var _0x303fc4=_0x6d6e[_0x4cfa3a];return _0x303fc4;};'use strict';var Sequelize=require(_0xe6d6('0x0'));module['exports']={'type':{'type':Sequelize[_0xe6d6('0x1')]('string',_0xe6d6('0x2'),_0xe6d6('0x3'),'keyValue',_0xe6d6('0x4')),'defaultValue':_0xe6d6('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe6d6('0x6')]},'keyType':{'type':Sequelize[_0xe6d6('0x1')]('string',_0xe6d6('0x2'),_0xe6d6('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe6d6('0x6')]},'nameField':{'type':Sequelize[_0xe6d6('0x6')]},'customField':{'type':Sequelize[_0xe6d6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe6d6('0x6')]}};
\ No newline at end of file
+var _0xa2fd=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1ba3cb,_0x44b146){var _0x12c1e8=function(_0x4c8da6){while(--_0x4c8da6){_0x1ba3cb['push'](_0x1ba3cb['shift']());}};_0x12c1e8(++_0x44b146);}(_0xa2fd,0x17b));var _0xda2f=function(_0x348aca,_0x26d747){_0x348aca=_0x348aca-0x0;var _0x26b7d3=_0xa2fd[_0x348aca];return _0x26b7d3;};'use strict';var Sequelize=require('sequelize');module[_0xda2f('0x0')]={'type':{'type':Sequelize[_0xda2f('0x1')](_0xda2f('0x2'),_0xda2f('0x3'),_0xda2f('0x4'),_0xda2f('0x5'),_0xda2f('0x6')),'defaultValue':_0xda2f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xda2f('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xda2f('0x7')]},'nameField':{'type':Sequelize[_0xda2f('0x7')]},'customField':{'type':Sequelize[_0xda2f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xda2f('0x7')]}};
\ No newline at end of file
index 189c0da..4d244aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd63=['catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','map','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x5905c6,_0x37da21){var _0x32a8d9=function(_0x49fb9d){while(--_0x49fb9d){_0x5905c6['push'](_0x5905c6['shift']());}};_0x32a8d9(++_0x37da21);}(_0xcd63,0xe4));var _0x3cd6=function(_0x37c12b,_0x17447e){_0x37c12b=_0x37c12b-0x0;var _0xcbf3a7=_0xcd63[_0x37c12b];return _0xcbf3a7;};'use strict';var emlformat=require(_0x3cd6('0x0'));var rimraf=require(_0x3cd6('0x1'));var zipdir=require(_0x3cd6('0x2'));var jsonpatch=require(_0x3cd6('0x3'));var rp=require(_0x3cd6('0x4'));var moment=require('moment');var BPromise=require(_0x3cd6('0x5'));var Mustache=require(_0x3cd6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3cd6('0x7'));var csv=require(_0x3cd6('0x8'));var ejs=require(_0x3cd6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cd6('0xa'));var squel=require(_0x3cd6('0xb'));var crypto=require(_0x3cd6('0xc'));var jsforce=require(_0x3cd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3cd6('0x8'));var querystring=require('querystring');var Papa=require(_0x3cd6('0xe'));var Redis=require(_0x3cd6('0xf'));var authService=require(_0x3cd6('0x10'));var qs=require(_0x3cd6('0x11'));var as=require(_0x3cd6('0x12'));var hardwareService=require(_0x3cd6('0x13'));var logger=require(_0x3cd6('0x14'))(_0x3cd6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3cd6('0x16'))['db'];function respondWithStatusCode(_0x223437,_0x14d383){_0x14d383=_0x14d383||0xcc;return function(_0x29aa4a){if(_0x29aa4a){return _0x223437[_0x3cd6('0x17')](_0x14d383);}return _0x223437[_0x3cd6('0x18')](_0x14d383)[_0x3cd6('0x19')]();};}function respondWithResult(_0x2f47dc,_0x2afca0){_0x2afca0=_0x2afca0||0xc8;return function(_0x17d0cc){if(_0x17d0cc){return _0x2f47dc['status'](_0x2afca0)['json'](_0x17d0cc);}};}function respondWithFilteredResult(_0x2a1d88,_0x581247){return function(_0xaa527){if(_0xaa527){var _0x812fe3=typeof _0x581247['offset']===_0x3cd6('0x1a')&&typeof _0x581247['limit']==='undefined';var _0x4cfa90=_0xaa527['count'];var _0x4f39c2=_0x812fe3?0x0:_0x581247['offset'];var _0x47a60f=_0x812fe3?_0xaa527[_0x3cd6('0x1b')]:_0x581247[_0x3cd6('0x1c')]+_0x581247[_0x3cd6('0x1d')];var _0x422747;if(_0x47a60f>=_0x4cfa90){_0x47a60f=_0x4cfa90;_0x422747=0xc8;}else{_0x422747=0xce;}_0x2a1d88['status'](_0x422747);return _0x2a1d88[_0x3cd6('0x1e')]('Content-Range',_0x4f39c2+'-'+_0x47a60f+'/'+_0x4cfa90)[_0x3cd6('0x1f')](_0xaa527);}return null;};}function patchUpdates(_0x540fd1){return function(_0x4df3f5){try{jsonpatch[_0x3cd6('0x20')](_0x4df3f5,_0x540fd1,!![]);}catch(_0xc96492){return BPromise[_0x3cd6('0x21')](_0xc96492);}return _0x4df3f5[_0x3cd6('0x22')]();};}function saveUpdates(_0x4fdca1,_0xd787cc){return function(_0x34230c){if(_0x34230c){return _0x34230c[_0x3cd6('0x23')](_0x4fdca1)[_0x3cd6('0x24')](function(_0x3f01ca){return _0x3f01ca;});}return null;};}function removeEntity(_0x2719d2,_0x1efb9d){return function(_0x205395){if(_0x205395){return _0x205395[_0x3cd6('0x25')]()[_0x3cd6('0x24')](function(){_0x2719d2[_0x3cd6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130271,_0x56b6fc){return function(_0x1d91f4){if(!_0x1d91f4){_0x130271[_0x3cd6('0x17')](0x194);}return _0x1d91f4;};}function handleError(_0x53e0ff,_0x188dc7){_0x188dc7=_0x188dc7||0x1f4;return function(_0x41ce0c){logger[_0x3cd6('0x26')](_0x41ce0c[_0x3cd6('0x27')]);if(_0x41ce0c[_0x3cd6('0x28')]){delete _0x41ce0c['name'];}_0x53e0ff[_0x3cd6('0x18')](_0x188dc7)[_0x3cd6('0x29')](_0x41ce0c);};}exports[_0x3cd6('0x2a')]=function(_0x334f0c,_0x58357a){var _0x16c15e={},_0x121635={},_0x2c92fd={'count':0x0,'rows':[]};var _0x2ebe44=_['map'](db[_0x3cd6('0x2b')][_0x3cd6('0x2c')],function(_0x51362d){return{'name':_0x51362d['fieldName'],'type':_0x51362d[_0x3cd6('0x2d')]['key']};});_0x121635['model']=_[_0x3cd6('0x2e')](_0x2ebe44,'name');_0x121635['query']=_['keys'](_0x334f0c['query']);_0x121635[_0x3cd6('0x2f')]=_[_0x3cd6('0x30')](_0x121635[_0x3cd6('0x31')],_0x121635[_0x3cd6('0x32')]);_0x16c15e[_0x3cd6('0x33')]=_['intersection'](_0x121635[_0x3cd6('0x31')],qs[_0x3cd6('0x34')](_0x334f0c['query'][_0x3cd6('0x34')]));_0x16c15e[_0x3cd6('0x33')]=_0x16c15e[_0x3cd6('0x33')][_0x3cd6('0x35')]?_0x16c15e['attributes']:_0x121635['model'];if(!_0x334f0c[_0x3cd6('0x32')][_0x3cd6('0x36')](_0x3cd6('0x37'))){_0x16c15e['limit']=qs[_0x3cd6('0x1d')](_0x334f0c[_0x3cd6('0x32')][_0x3cd6('0x1d')]);_0x16c15e[_0x3cd6('0x1c')]=qs[_0x3cd6('0x1c')](_0x334f0c[_0x3cd6('0x32')][_0x3cd6('0x1c')]);}_0x16c15e[_0x3cd6('0x38')]=qs[_0x3cd6('0x39')](_0x334f0c[_0x3cd6('0x32')][_0x3cd6('0x39')]);_0x16c15e[_0x3cd6('0x3a')]=qs['filters'](_[_0x3cd6('0x3b')](_0x334f0c['query'],_0x121635[_0x3cd6('0x2f')]),_0x2ebe44);if(_0x334f0c[_0x3cd6('0x32')]['filter']){_0x16c15e[_0x3cd6('0x3a')]=_[_0x3cd6('0x3c')](_0x16c15e[_0x3cd6('0x3a')],{'$or':_[_0x3cd6('0x2e')](_0x2ebe44,function(_0x452e50){if(_0x452e50[_0x3cd6('0x2d')]!==_0x3cd6('0x3d')){var _0x436f78={};_0x436f78[_0x452e50['name']]={'$like':'%'+_0x334f0c[_0x3cd6('0x32')][_0x3cd6('0x3e')]+'%'};return _0x436f78;}})});}_0x16c15e=_[_0x3cd6('0x3c')]({},_0x16c15e,_0x334f0c[_0x3cd6('0x3f')]);var _0x270129={'where':_0x16c15e['where']};return db['ZendeskField'][_0x3cd6('0x1b')](_0x270129)[_0x3cd6('0x24')](function(_0x593862){_0x2c92fd[_0x3cd6('0x1b')]=_0x593862;if(_0x334f0c['query'][_0x3cd6('0x40')]){_0x16c15e[_0x3cd6('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x3cd6('0x42')](_0x16c15e);})[_0x3cd6('0x24')](function(_0x20e6ef){_0x2c92fd[_0x3cd6('0x43')]=_0x20e6ef;return _0x2c92fd;})[_0x3cd6('0x24')](respondWithFilteredResult(_0x58357a,_0x16c15e))[_0x3cd6('0x44')](handleError(_0x58357a,null));};exports['show']=function(_0x3833b7,_0x2ce708){var _0x5bf132={'raw':!![],'where':{'id':_0x3833b7[_0x3cd6('0x45')]['id']}},_0x6da447={};_0x6da447[_0x3cd6('0x31')]=_[_0x3cd6('0x46')](db[_0x3cd6('0x2b')][_0x3cd6('0x2c')]);_0x6da447[_0x3cd6('0x32')]=_[_0x3cd6('0x46')](_0x3833b7['query']);_0x6da447[_0x3cd6('0x2f')]=_[_0x3cd6('0x30')](_0x6da447[_0x3cd6('0x31')],_0x6da447[_0x3cd6('0x32')]);_0x5bf132[_0x3cd6('0x33')]=_[_0x3cd6('0x30')](_0x6da447[_0x3cd6('0x31')],qs[_0x3cd6('0x34')](_0x3833b7['query'][_0x3cd6('0x34')]));_0x5bf132[_0x3cd6('0x33')]=_0x5bf132['attributes'][_0x3cd6('0x35')]?_0x5bf132[_0x3cd6('0x33')]:_0x6da447[_0x3cd6('0x31')];if(_0x3833b7[_0x3cd6('0x32')][_0x3cd6('0x40')]){_0x5bf132['include']=[{'all':!![]}];}_0x5bf132=_[_0x3cd6('0x3c')]({},_0x5bf132,_0x3833b7[_0x3cd6('0x3f')]);return db[_0x3cd6('0x2b')][_0x3cd6('0x47')](_0x5bf132)[_0x3cd6('0x24')](handleEntityNotFound(_0x2ce708,null))['then'](respondWithResult(_0x2ce708,null))[_0x3cd6('0x44')](handleError(_0x2ce708,null));};exports[_0x3cd6('0x48')]=function(_0x5228b8,_0x40aa31){return db['ZendeskField'][_0x3cd6('0x48')](_0x5228b8['body'],{})[_0x3cd6('0x24')](respondWithResult(_0x40aa31,0xc9))[_0x3cd6('0x44')](handleError(_0x40aa31,null));};exports[_0x3cd6('0x23')]=function(_0x1cb1dc,_0x4cdd30){if(_0x1cb1dc[_0x3cd6('0x49')]['id']){delete _0x1cb1dc[_0x3cd6('0x49')]['id'];}return db[_0x3cd6('0x2b')][_0x3cd6('0x47')]({'where':{'id':_0x1cb1dc[_0x3cd6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cdd30,null))[_0x3cd6('0x24')](saveUpdates(_0x1cb1dc['body'],null))[_0x3cd6('0x24')](respondWithResult(_0x4cdd30,null))[_0x3cd6('0x44')](handleError(_0x4cdd30,null));};exports[_0x3cd6('0x25')]=function(_0x239cfc,_0x22d56c){return db[_0x3cd6('0x2b')][_0x3cd6('0x47')]({'where':{'id':_0x239cfc[_0x3cd6('0x45')]['id']}})[_0x3cd6('0x24')](handleEntityNotFound(_0x22d56c,null))[_0x3cd6('0x24')](removeEntity(_0x22d56c,null))['catch'](handleError(_0x22d56c,null));};
\ No newline at end of file
+var _0xdc91=['options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge'];(function(_0x4bbf61,_0x442b21){var _0x41d9cc=function(_0x4be429){while(--_0x4be429){_0x4bbf61['push'](_0x4bbf61['shift']());}};_0x41d9cc(++_0x442b21);}(_0xdc91,0x183));var _0x1dc9=function(_0x52056a,_0x4de11e){_0x52056a=_0x52056a-0x0;var _0x2467fe=_0xdc91[_0x52056a];return _0x2467fe;};'use strict';var emlformat=require(_0x1dc9('0x0'));var rimraf=require(_0x1dc9('0x1'));var zipdir=require(_0x1dc9('0x2'));var jsonpatch=require(_0x1dc9('0x3'));var rp=require(_0x1dc9('0x4'));var moment=require('moment');var BPromise=require(_0x1dc9('0x5'));var Mustache=require(_0x1dc9('0x6'));var util=require(_0x1dc9('0x7'));var path=require('path');var sox=require(_0x1dc9('0x8'));var csv=require('to-csv');var ejs=require(_0x1dc9('0x9'));var fs=require('fs');var fs_extra=require(_0x1dc9('0xa'));var _=require(_0x1dc9('0xb'));var squel=require(_0x1dc9('0xc'));var crypto=require(_0x1dc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1dc9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1dc9('0xf'));var authService=require(_0x1dc9('0x10'));var qs=require(_0x1dc9('0x11'));var as=require(_0x1dc9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dc9('0x13'))(_0x1dc9('0x14'));var utils=require(_0x1dc9('0x15'));var config=require(_0x1dc9('0x16'));var licenseUtil=require(_0x1dc9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371e91,_0x209472){_0x209472=_0x209472||0xcc;return function(_0x34b914){if(_0x34b914){return _0x371e91[_0x1dc9('0x18')](_0x209472);}return _0x371e91[_0x1dc9('0x19')](_0x209472)['end']();};}function respondWithResult(_0x5852fe,_0x4572b4){_0x4572b4=_0x4572b4||0xc8;return function(_0x5d2478){if(_0x5d2478){return _0x5852fe[_0x1dc9('0x19')](_0x4572b4)[_0x1dc9('0x1a')](_0x5d2478);}};}function respondWithFilteredResult(_0x328202,_0x1abf27){return function(_0x5c346f){if(_0x5c346f){var _0x3d5833=typeof _0x1abf27[_0x1dc9('0x1b')]===_0x1dc9('0x1c')&&typeof _0x1abf27[_0x1dc9('0x1d')]===_0x1dc9('0x1c');var _0x3f6eaf=_0x5c346f[_0x1dc9('0x1e')];var _0x9d3593=_0x3d5833?0x0:_0x1abf27[_0x1dc9('0x1b')];var _0x57e767=_0x3d5833?_0x5c346f['count']:_0x1abf27['offset']+_0x1abf27[_0x1dc9('0x1d')];var _0x5453c4;if(_0x57e767>=_0x3f6eaf){_0x57e767=_0x3f6eaf;_0x5453c4=0xc8;}else{_0x5453c4=0xce;}_0x328202[_0x1dc9('0x19')](_0x5453c4);return _0x328202['set'](_0x1dc9('0x1f'),_0x9d3593+'-'+_0x57e767+'/'+_0x3f6eaf)[_0x1dc9('0x1a')](_0x5c346f);}return null;};}function patchUpdates(_0x4e0c45){return function(_0x2a4119){try{jsonpatch['apply'](_0x2a4119,_0x4e0c45,!![]);}catch(_0x452b7b){return BPromise[_0x1dc9('0x20')](_0x452b7b);}return _0x2a4119[_0x1dc9('0x21')]();};}function saveUpdates(_0xbe70f8,_0x237cfc){return function(_0x173fbf){if(_0x173fbf){return _0x173fbf[_0x1dc9('0x22')](_0xbe70f8)[_0x1dc9('0x23')](function(_0x2b3aec){return _0x2b3aec;});}return null;};}function removeEntity(_0x1d6911,_0x3fc0c6){return function(_0x2d94eb){if(_0x2d94eb){return _0x2d94eb[_0x1dc9('0x24')]()[_0x1dc9('0x23')](function(){_0x1d6911[_0x1dc9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x174106,_0x2aa67a){return function(_0x2ae3b1){if(!_0x2ae3b1){_0x174106['sendStatus'](0x194);}return _0x2ae3b1;};}function handleError(_0x44b7b6,_0x5e84ae){_0x5e84ae=_0x5e84ae||0x1f4;return function(_0xf13b6f){logger[_0x1dc9('0x25')](_0xf13b6f['stack']);if(_0xf13b6f['name']){delete _0xf13b6f[_0x1dc9('0x26')];}_0x44b7b6[_0x1dc9('0x19')](_0x5e84ae)[_0x1dc9('0x27')](_0xf13b6f);};}exports[_0x1dc9('0x28')]=function(_0x30488f,_0x53c72a){var _0xadad88={},_0x47ed2e={},_0x2b712c={'count':0x0,'rows':[]};var _0x46040a=_[_0x1dc9('0x29')](db[_0x1dc9('0x2a')][_0x1dc9('0x2b')],function(_0x177b5c){return{'name':_0x177b5c[_0x1dc9('0x2c')],'type':_0x177b5c[_0x1dc9('0x2d')][_0x1dc9('0x2e')]};});_0x47ed2e['model']=_[_0x1dc9('0x29')](_0x46040a,_0x1dc9('0x26'));_0x47ed2e[_0x1dc9('0x2f')]=_['keys'](_0x30488f[_0x1dc9('0x2f')]);_0x47ed2e['filters']=_['intersection'](_0x47ed2e[_0x1dc9('0x30')],_0x47ed2e[_0x1dc9('0x2f')]);_0xadad88[_0x1dc9('0x31')]=_[_0x1dc9('0x32')](_0x47ed2e[_0x1dc9('0x30')],qs[_0x1dc9('0x33')](_0x30488f[_0x1dc9('0x2f')]['fields']));_0xadad88['attributes']=_0xadad88[_0x1dc9('0x31')][_0x1dc9('0x34')]?_0xadad88[_0x1dc9('0x31')]:_0x47ed2e[_0x1dc9('0x30')];if(!_0x30488f[_0x1dc9('0x2f')][_0x1dc9('0x35')](_0x1dc9('0x36'))){_0xadad88[_0x1dc9('0x1d')]=qs[_0x1dc9('0x1d')](_0x30488f['query'][_0x1dc9('0x1d')]);_0xadad88['offset']=qs[_0x1dc9('0x1b')](_0x30488f[_0x1dc9('0x2f')][_0x1dc9('0x1b')]);}_0xadad88[_0x1dc9('0x37')]=qs[_0x1dc9('0x38')](_0x30488f[_0x1dc9('0x2f')]['sort']);_0xadad88[_0x1dc9('0x39')]=qs[_0x1dc9('0x3a')](_[_0x1dc9('0x3b')](_0x30488f['query'],_0x47ed2e[_0x1dc9('0x3a')]),_0x46040a);if(_0x30488f[_0x1dc9('0x2f')][_0x1dc9('0x3c')]){_0xadad88[_0x1dc9('0x39')]=_['merge'](_0xadad88['where'],{'$or':_[_0x1dc9('0x29')](_0x46040a,function(_0x2f5915){if(_0x2f5915[_0x1dc9('0x2d')]!==_0x1dc9('0x3d')){var _0x1c44c8={};_0x1c44c8[_0x2f5915['name']]={'$like':'%'+_0x30488f[_0x1dc9('0x2f')][_0x1dc9('0x3c')]+'%'};return _0x1c44c8;}})});}_0xadad88=_[_0x1dc9('0x3e')]({},_0xadad88,_0x30488f[_0x1dc9('0x3f')]);var _0x4d8b5f={'where':_0xadad88[_0x1dc9('0x39')]};return db[_0x1dc9('0x2a')][_0x1dc9('0x1e')](_0x4d8b5f)[_0x1dc9('0x23')](function(_0x5ad242){_0x2b712c[_0x1dc9('0x1e')]=_0x5ad242;if(_0x30488f['query'][_0x1dc9('0x40')]){_0xadad88[_0x1dc9('0x41')]=[{'all':!![]}];}return db[_0x1dc9('0x2a')][_0x1dc9('0x42')](_0xadad88);})[_0x1dc9('0x23')](function(_0x3bf238){_0x2b712c[_0x1dc9('0x43')]=_0x3bf238;return _0x2b712c;})['then'](respondWithFilteredResult(_0x53c72a,_0xadad88))[_0x1dc9('0x44')](handleError(_0x53c72a,null));};exports[_0x1dc9('0x45')]=function(_0x366575,_0x319657){var _0x50e669={'raw':!![],'where':{'id':_0x366575[_0x1dc9('0x46')]['id']}},_0x20ecf1={};_0x20ecf1[_0x1dc9('0x30')]=_[_0x1dc9('0x47')](db[_0x1dc9('0x2a')]['rawAttributes']);_0x20ecf1['query']=_['keys'](_0x366575[_0x1dc9('0x2f')]);_0x20ecf1[_0x1dc9('0x3a')]=_[_0x1dc9('0x32')](_0x20ecf1[_0x1dc9('0x30')],_0x20ecf1[_0x1dc9('0x2f')]);_0x50e669[_0x1dc9('0x31')]=_[_0x1dc9('0x32')](_0x20ecf1[_0x1dc9('0x30')],qs[_0x1dc9('0x33')](_0x366575[_0x1dc9('0x2f')][_0x1dc9('0x33')]));_0x50e669[_0x1dc9('0x31')]=_0x50e669[_0x1dc9('0x31')][_0x1dc9('0x34')]?_0x50e669['attributes']:_0x20ecf1[_0x1dc9('0x30')];if(_0x366575[_0x1dc9('0x2f')][_0x1dc9('0x40')]){_0x50e669[_0x1dc9('0x41')]=[{'all':!![]}];}_0x50e669=_[_0x1dc9('0x3e')]({},_0x50e669,_0x366575['options']);return db[_0x1dc9('0x2a')][_0x1dc9('0x48')](_0x50e669)[_0x1dc9('0x23')](handleEntityNotFound(_0x319657,null))[_0x1dc9('0x23')](respondWithResult(_0x319657,null))['catch'](handleError(_0x319657,null));};exports[_0x1dc9('0x49')]=function(_0x442c2b,_0x41ce6d){return db[_0x1dc9('0x2a')][_0x1dc9('0x49')](_0x442c2b['body'],{})[_0x1dc9('0x23')](respondWithResult(_0x41ce6d,0xc9))[_0x1dc9('0x44')](handleError(_0x41ce6d,null));};exports[_0x1dc9('0x22')]=function(_0x417091,_0x31c890){if(_0x417091[_0x1dc9('0x4a')]['id']){delete _0x417091[_0x1dc9('0x4a')]['id'];}return db[_0x1dc9('0x2a')]['find']({'where':{'id':_0x417091[_0x1dc9('0x46')]['id']}})[_0x1dc9('0x23')](handleEntityNotFound(_0x31c890,null))['then'](saveUpdates(_0x417091[_0x1dc9('0x4a')],null))[_0x1dc9('0x23')](respondWithResult(_0x31c890,null))[_0x1dc9('0x44')](handleError(_0x31c890,null));};exports['destroy']=function(_0x13384b,_0xd1bd7a){return db[_0x1dc9('0x2a')][_0x1dc9('0x48')]({'where':{'id':_0x13384b['params']['id']}})[_0x1dc9('0x23')](handleEntityNotFound(_0xd1bd7a,null))[_0x1dc9('0x23')](removeEntity(_0xd1bd7a,null))['catch'](handleError(_0xd1bd7a,null));};
\ No newline at end of file
index dbf995a..d2b7094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5b9=['idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x5a5627,_0x1ef8f4){var _0x58e1eb=function(_0x260f30){while(--_0x260f30){_0x5a5627['push'](_0x5a5627['shift']());}};_0x58e1eb(++_0x1ef8f4);}(_0xa5b9,0x1f0));var _0x9a5b=function(_0x45d668,_0x406d63){_0x45d668=_0x45d668-0x0;var _0x247925=_0xa5b9[_0x45d668];return _0x247925;};'use strict';var _=require(_0x9a5b('0x0'));var util=require(_0x9a5b('0x1'));var logger=require('../../config/logger')(_0x9a5b('0x2'));var moment=require(_0x9a5b('0x3'));var BPromise=require(_0x9a5b('0x4'));var rp=require(_0x9a5b('0x5'));var fs=require('fs');var path=require(_0x9a5b('0x6'));var rimraf=require(_0x9a5b('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a5b('0x8'));module[_0x9a5b('0x9')]=function(_0x183f25,_0x39f5c7){return _0x183f25[_0x9a5b('0xa')](_0x9a5b('0xb'),attributes,{'tableName':_0x9a5b('0xc'),'paranoid':![],'indexes':[{'name':_0x9a5b('0xd'),'fields':[_0x9a5b('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x94fc=['../../config/logger','api','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x94fc,0x15c));var _0xc94f=function(_0x58e2e8,_0x345009){_0x58e2e8=_0x58e2e8-0x0;var _0x4af21b=_0x94fc[_0x58e2e8];return _0x4af21b;};'use strict';var _=require(_0xc94f('0x0'));var util=require(_0xc94f('0x1'));var logger=require(_0xc94f('0x2'))(_0xc94f('0x3'));var moment=require('moment');var BPromise=require(_0xc94f('0x4'));var rp=require(_0xc94f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc94f('0x6'));var attributes=require(_0xc94f('0x7'));module[_0xc94f('0x8')]=function(_0xb332e8,_0x1c1a50){return _0xb332e8[_0xc94f('0x9')](_0xc94f('0xa'),attributes,{'tableName':_0xc94f('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc94f('0xc'),_0xc94f('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index db7ad78..f678510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde86=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x9688c7,_0x3eb211){var _0x434b67=function(_0x583f63){while(--_0x583f63){_0x9688c7['push'](_0x9688c7['shift']());}};_0x434b67(++_0x3eb211);}(_0xde86,0xbb));var _0x6de8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde86[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6de8('0x0'));var moment=require(_0x6de8('0x1'));var BPromise=require(_0x6de8('0x2'));var rs=require(_0x6de8('0x3'));var fs=require('fs');var Redis=require(_0x6de8('0x4'));var db=require(_0x6de8('0x5'))['db'];var utils=require(_0x6de8('0x6'));var logger=require(_0x6de8('0x7'))(_0x6de8('0x8'));var config=require(_0x6de8('0x9'));var jayson=require(_0x6de8('0xa'));var client=jayson['client'][_0x6de8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2741f7,_0x3305c6,_0x2a5014){return new BPromise(function(_0x480953,_0x52fb90){return client[_0x6de8('0xc')](_0x2741f7,_0x2a5014)[_0x6de8('0xd')](function(_0x31e9fa){logger[_0x6de8('0xe')](_0x6de8('0xf'),_0x3305c6,'request\x20sent');logger[_0x6de8('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3305c6,_0x6de8('0x11'),JSON[_0x6de8('0x12')](_0x31e9fa));if(_0x31e9fa['error']){if(_0x31e9fa[_0x6de8('0x13')][_0x6de8('0x14')]===0x1f4){logger[_0x6de8('0x13')](_0x6de8('0xf'),_0x3305c6,_0x31e9fa['error'][_0x6de8('0x15')]);return _0x52fb90(_0x31e9fa[_0x6de8('0x13')]['message']);}logger[_0x6de8('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3305c6,_0x31e9fa[_0x6de8('0x13')][_0x6de8('0x15')]);return _0x480953(_0x31e9fa[_0x6de8('0x13')][_0x6de8('0x15')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x3305c6,'request\x20sent');_0x480953(_0x31e9fa['result'][_0x6de8('0x15')]);}})[_0x6de8('0x16')](function(_0x59d5b4){logger[_0x6de8('0x13')](_0x6de8('0xf'),_0x3305c6,_0x59d5b4);_0x52fb90(_0x59d5b4);});});}
\ No newline at end of file
+var _0x3aed=['http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x546e47,_0x1adc11){var _0x54e47f=function(_0x8526b){while(--_0x8526b){_0x546e47['push'](_0x546e47['shift']());}};_0x54e47f(++_0x1adc11);}(_0x3aed,0x7e));var _0xd3ae=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x3aed[_0x454018];return _0x24697d;};'use strict';var _=require(_0xd3ae('0x0'));var util=require(_0xd3ae('0x1'));var moment=require(_0xd3ae('0x2'));var BPromise=require(_0xd3ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3ae('0x4'));var db=require(_0xd3ae('0x5'))['db'];var utils=require(_0xd3ae('0x6'));var logger=require(_0xd3ae('0x7'))(_0xd3ae('0x8'));var config=require(_0xd3ae('0x9'));var jayson=require(_0xd3ae('0xa'));var client=jayson[_0xd3ae('0xb')][_0xd3ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5056c4,_0x563c06,_0x2c65c4){return new BPromise(function(_0x12d6f2,_0x5b7bf1){return client[_0xd3ae('0xd')](_0x5056c4,_0x2c65c4)[_0xd3ae('0xe')](function(_0x20598a){logger[_0xd3ae('0xf')](_0xd3ae('0x10'),_0x563c06,_0xd3ae('0x11'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x563c06,_0xd3ae('0x11'),JSON[_0xd3ae('0x12')](_0x20598a));if(_0x20598a['error']){if(_0x20598a[_0xd3ae('0x13')]['code']===0x1f4){logger[_0xd3ae('0x13')](_0xd3ae('0x10'),_0x563c06,_0x20598a[_0xd3ae('0x13')]['message']);return _0x5b7bf1(_0x20598a[_0xd3ae('0x13')][_0xd3ae('0x14')]);}logger['error'](_0xd3ae('0x10'),_0x563c06,_0x20598a['error'][_0xd3ae('0x14')]);return _0x12d6f2(_0x20598a[_0xd3ae('0x13')][_0xd3ae('0x14')]);}else{logger['info'](_0xd3ae('0x10'),_0x563c06,_0xd3ae('0x11'));_0x12d6f2(_0x20598a[_0xd3ae('0x15')][_0xd3ae('0x14')]);}})[_0xd3ae('0x16')](function(_0x5444be){logger['error'](_0xd3ae('0x10'),_0x563c06,_0x5444be);_0x5b7bf1(_0x5444be);});});}
\ No newline at end of file
index b82f722..112217f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5667=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x15481d,_0x17eef7){var _0x5206ae=function(_0x1dabae){while(--_0x1dabae){_0x15481d['push'](_0x15481d['shift']());}};_0x5206ae(++_0x17eef7);}(_0x5667,0xcc));var _0x7566=function(_0xfab911,_0xfe2dd7){_0xfab911=_0xfab911-0x0;var _0x3419e4=_0x5667[_0xfab911];return _0x3419e4;};'use strict';var multer=require('multer');var util=require(_0x7566('0x0'));var path=require(_0x7566('0x1'));var timeout=require('connect-timeout');var express=require(_0x7566('0x2'));var router=express[_0x7566('0x3')]();var fs_extra=require(_0x7566('0x4'));var auth=require(_0x7566('0x5'));var interaction=require(_0x7566('0x6'));var config=require('../../config/environment');var controller=require(_0x7566('0x7'));router[_0x7566('0x8')]('/',auth[_0x7566('0x9')](),controller[_0x7566('0xa')]);router[_0x7566('0x8')](_0x7566('0xb'),auth[_0x7566('0x9')](),controller[_0x7566('0xc')]);router[_0x7566('0x8')](_0x7566('0xd'),auth[_0x7566('0x9')](),controller[_0x7566('0xe')]);router['get'](_0x7566('0xf'),auth[_0x7566('0x9')](),controller[_0x7566('0x10')]);router[_0x7566('0x11')]('/',auth[_0x7566('0x9')](),controller[_0x7566('0x12')]);router[_0x7566('0x11')](_0x7566('0xd'),auth[_0x7566('0x9')](),controller[_0x7566('0x13')]);router[_0x7566('0x14')](_0x7566('0xb'),auth[_0x7566('0x9')](),controller[_0x7566('0x15')]);router['delete']('/:id',auth[_0x7566('0x9')](),controller[_0x7566('0x16')]);module[_0x7566('0x17')]=router;
\ No newline at end of file
+var _0xad01=['delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update'];(function(_0x55bf0b,_0x477364){var _0x4a2a40=function(_0x3cc3f2){while(--_0x3cc3f2){_0x55bf0b['push'](_0x55bf0b['shift']());}};_0x4a2a40(++_0x477364);}(_0xad01,0x117));var _0x1ad0=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xad01[_0x3b4b1d];return _0x488c36;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1ad0('0x0'));var timeout=require('connect-timeout');var express=require(_0x1ad0('0x1'));var router=express[_0x1ad0('0x2')]();var fs_extra=require(_0x1ad0('0x3'));var auth=require(_0x1ad0('0x4'));var interaction=require(_0x1ad0('0x5'));var config=require(_0x1ad0('0x6'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x1ad0('0x7')](),controller[_0x1ad0('0x8')]);router[_0x1ad0('0x9')](_0x1ad0('0xa'),auth[_0x1ad0('0x7')](),controller[_0x1ad0('0xb')]);router[_0x1ad0('0x9')](_0x1ad0('0xc'),auth['isAuthenticated'](),controller[_0x1ad0('0xd')]);router[_0x1ad0('0x9')](_0x1ad0('0xe'),auth[_0x1ad0('0x7')](),controller[_0x1ad0('0xf')]);router[_0x1ad0('0x10')]('/',auth[_0x1ad0('0x7')](),controller[_0x1ad0('0x11')]);router[_0x1ad0('0x10')](_0x1ad0('0xc'),auth[_0x1ad0('0x7')](),controller['addConfiguration']);router[_0x1ad0('0x12')](_0x1ad0('0xa'),auth[_0x1ad0('0x7')](),controller[_0x1ad0('0x13')]);router[_0x1ad0('0x14')](_0x1ad0('0xa'),auth['isAuthenticated'](),controller[_0x1ad0('0x15')]);module[_0x1ad0('0x16')]=router;
\ No newline at end of file
index c978ba0..fcae5bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['STRING','sequelize'];(function(_0x37eca7,_0x3e016e){var _0x222bce=function(_0xebd0b7){while(--_0xebd0b7){_0x37eca7['push'](_0x37eca7['shift']());}};_0x222bce(++_0x3e016e);}(_0x2750,0x13b));var _0x0275=function(_0x1509b0,_0x285e76){_0x1509b0=_0x1509b0-0x0;var _0x3b50ee=_0x2750[_0x1509b0];return _0x3b50ee;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}};
\ No newline at end of file
+var _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x4bc3[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}};
\ No newline at end of file
index 3d1189f..37df2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfc9=['../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','ZohoAccount','includeAll','findAll','rows','catch','show','find','create','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','order','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','host','serverUrl','code','zoho.eu','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','error','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xbfc9,0xe7));var _0x9bfc=function(_0x6d69ba,_0xbd91af){_0x6d69ba=_0x6d69ba-0x0;var _0x5eb4f8=_0xbfc9[_0x6d69ba];return _0x5eb4f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bfc('0x0'));var zipdir=require(_0x9bfc('0x1'));var jsonpatch=require(_0x9bfc('0x2'));var rp=require(_0x9bfc('0x3'));var moment=require('moment');var BPromise=require(_0x9bfc('0x4'));var Mustache=require(_0x9bfc('0x5'));var util=require(_0x9bfc('0x6'));var path=require(_0x9bfc('0x7'));var sox=require(_0x9bfc('0x8'));var csv=require('to-csv');var ejs=require(_0x9bfc('0x9'));var fs=require('fs');var fs_extra=require(_0x9bfc('0xa'));var _=require(_0x9bfc('0xb'));var squel=require('squel');var crypto=require(_0x9bfc('0xc'));var jsforce=require(_0x9bfc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9bfc('0xe'));var Papa=require(_0x9bfc('0xf'));var Redis=require(_0x9bfc('0x10'));var authService=require(_0x9bfc('0x11'));var qs=require(_0x9bfc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bfc('0x13'))(_0x9bfc('0x14'));var utils=require(_0x9bfc('0x15'));var config=require(_0x9bfc('0x16'));var licenseUtil=require(_0x9bfc('0x17'));var db=require(_0x9bfc('0x18'))['db'];var integrations=require(_0x9bfc('0x19'));function respondWithStatusCode(_0x54b253,_0x1ed4e0){_0x1ed4e0=_0x1ed4e0||0xcc;return function(_0x4105f6){if(_0x4105f6){return _0x54b253['sendStatus'](_0x1ed4e0);}return _0x54b253[_0x9bfc('0x1a')](_0x1ed4e0)[_0x9bfc('0x1b')]();};}function respondWithResult(_0x35daca,_0x1380fa){_0x1380fa=_0x1380fa||0xc8;return function(_0x5418bf){if(_0x5418bf){return _0x35daca[_0x9bfc('0x1a')](_0x1380fa)[_0x9bfc('0x1c')](_0x5418bf);}};}function respondWithFilteredResult(_0xbef606,_0x1dd7fc){return function(_0x2a4411){if(_0x2a4411){var _0x47781b=typeof _0x1dd7fc[_0x9bfc('0x1d')]===_0x9bfc('0x1e')&&typeof _0x1dd7fc[_0x9bfc('0x1f')]==='undefined';var _0xf19776=_0x2a4411[_0x9bfc('0x20')];var _0x212857=_0x47781b?0x0:_0x1dd7fc[_0x9bfc('0x1d')];var _0x3b235c=_0x47781b?_0x2a4411['count']:_0x1dd7fc[_0x9bfc('0x1d')]+_0x1dd7fc['limit'];var _0x46ed9c;if(_0x3b235c>=_0xf19776){_0x3b235c=_0xf19776;_0x46ed9c=0xc8;}else{_0x46ed9c=0xce;}_0xbef606[_0x9bfc('0x1a')](_0x46ed9c);return _0xbef606[_0x9bfc('0x21')](_0x9bfc('0x22'),_0x212857+'-'+_0x3b235c+'/'+_0xf19776)[_0x9bfc('0x1c')](_0x2a4411);}return null;};}function patchUpdates(_0x1b0656){return function(_0x1ad224){try{jsonpatch[_0x9bfc('0x23')](_0x1ad224,_0x1b0656,!![]);}catch(_0x475f0a){return BPromise[_0x9bfc('0x24')](_0x475f0a);}return _0x1ad224[_0x9bfc('0x25')]();};}function saveUpdates(_0x4c3155,_0x5c2c4c){return function(_0x3d1dd1){if(_0x3d1dd1){return _0x3d1dd1[_0x9bfc('0x26')](_0x4c3155)[_0x9bfc('0x27')](function(_0x975162){return _0x975162;});}return null;};}function removeEntity(_0x3eef1e,_0x1cfb0f){return function(_0x194e55){if(_0x194e55){return _0x194e55['destroy']()[_0x9bfc('0x27')](function(){_0x3eef1e[_0x9bfc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4861a4,_0xf4115){return function(_0x8a0bdd){if(!_0x8a0bdd){_0x4861a4['sendStatus'](0x194);}return _0x8a0bdd;};}function handleError(_0x516314,_0x2a1063){_0x2a1063=_0x2a1063||0x1f4;return function(_0x1ebb9f){logger['error'](_0x1ebb9f[_0x9bfc('0x28')]);if(_0x1ebb9f[_0x9bfc('0x29')]){delete _0x1ebb9f['name'];}_0x516314[_0x9bfc('0x1a')](_0x2a1063)[_0x9bfc('0x2a')](_0x1ebb9f);};}exports[_0x9bfc('0x2b')]=function(_0x368374,_0x2d12ab){var _0x4f3718={},_0x3fc06d={},_0x39a701={'count':0x0,'rows':[]};var _0x4848ad=_['map'](db['ZohoAccount'][_0x9bfc('0x2c')],function(_0x39c579){return{'name':_0x39c579[_0x9bfc('0x2d')],'type':_0x39c579[_0x9bfc('0x2e')][_0x9bfc('0x2f')]};});_0x3fc06d[_0x9bfc('0x30')]=_[_0x9bfc('0x31')](_0x4848ad,_0x9bfc('0x29'));_0x3fc06d[_0x9bfc('0x32')]=_[_0x9bfc('0x33')](_0x368374[_0x9bfc('0x32')]);_0x3fc06d[_0x9bfc('0x34')]=_['intersection'](_0x3fc06d[_0x9bfc('0x30')],_0x3fc06d[_0x9bfc('0x32')]);_0x4f3718[_0x9bfc('0x35')]=_[_0x9bfc('0x36')](_0x3fc06d[_0x9bfc('0x30')],qs['fields'](_0x368374[_0x9bfc('0x32')][_0x9bfc('0x37')]));_0x4f3718[_0x9bfc('0x35')]=_0x4f3718[_0x9bfc('0x35')][_0x9bfc('0x38')]?_0x4f3718[_0x9bfc('0x35')]:_0x3fc06d['model'];if(!_0x368374['query']['hasOwnProperty'](_0x9bfc('0x39'))){_0x4f3718[_0x9bfc('0x1f')]=qs[_0x9bfc('0x1f')](_0x368374[_0x9bfc('0x32')]['limit']);_0x4f3718[_0x9bfc('0x1d')]=qs[_0x9bfc('0x1d')](_0x368374['query'][_0x9bfc('0x1d')]);}_0x4f3718['order']=qs[_0x9bfc('0x3a')](_0x368374[_0x9bfc('0x32')][_0x9bfc('0x3a')]);_0x4f3718['where']=qs[_0x9bfc('0x34')](_[_0x9bfc('0x3b')](_0x368374[_0x9bfc('0x32')],_0x3fc06d[_0x9bfc('0x34')]),_0x4848ad);if(_0x368374[_0x9bfc('0x32')][_0x9bfc('0x3c')]){_0x4f3718['where']=_[_0x9bfc('0x3d')](_0x4f3718[_0x9bfc('0x3e')],{'$or':_[_0x9bfc('0x31')](_0x4848ad,function(_0x11f4c6){if(_0x11f4c6[_0x9bfc('0x2e')]!==_0x9bfc('0x3f')){var _0x4e8a4f={};_0x4e8a4f[_0x11f4c6[_0x9bfc('0x29')]]={'$like':'%'+_0x368374['query'][_0x9bfc('0x3c')]+'%'};return _0x4e8a4f;}})});}_0x4f3718=_[_0x9bfc('0x3d')]({},_0x4f3718,_0x368374[_0x9bfc('0x40')]);var _0x35b14b={'where':_0x4f3718[_0x9bfc('0x3e')]};return db[_0x9bfc('0x41')][_0x9bfc('0x20')](_0x35b14b)[_0x9bfc('0x27')](function(_0x432612){_0x39a701[_0x9bfc('0x20')]=_0x432612;if(_0x368374[_0x9bfc('0x32')][_0x9bfc('0x42')]){_0x4f3718['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x9bfc('0x43')](_0x4f3718);})[_0x9bfc('0x27')](function(_0x415dd7){_0x39a701[_0x9bfc('0x44')]=_0x415dd7;return _0x39a701;})[_0x9bfc('0x27')](respondWithFilteredResult(_0x2d12ab,_0x4f3718))[_0x9bfc('0x45')](handleError(_0x2d12ab,null));};exports[_0x9bfc('0x46')]=function(_0xce74f3,_0x1746d9){var _0x220191={'raw':![],'where':{'id':_0xce74f3['params']['id']}},_0x48514e={};_0x48514e['model']=_[_0x9bfc('0x33')](db[_0x9bfc('0x41')]['rawAttributes']);_0x48514e[_0x9bfc('0x32')]=_[_0x9bfc('0x33')](_0xce74f3[_0x9bfc('0x32')]);_0x48514e['filters']=_['intersection'](_0x48514e[_0x9bfc('0x30')],_0x48514e['query']);_0x220191[_0x9bfc('0x35')]=_[_0x9bfc('0x36')](_0x48514e['model'],qs[_0x9bfc('0x37')](_0xce74f3[_0x9bfc('0x32')][_0x9bfc('0x37')]));_0x220191[_0x9bfc('0x35')]=_0x220191[_0x9bfc('0x35')]['length']?_0x220191['attributes']:_0x48514e[_0x9bfc('0x30')];if(_0xce74f3[_0x9bfc('0x32')]['includeAll']){_0x220191['include']=[{'all':!![]}];}_0x220191=_[_0x9bfc('0x3d')]({},_0x220191,_0xce74f3[_0x9bfc('0x40')]);return db[_0x9bfc('0x41')][_0x9bfc('0x47')](_0x220191)[_0x9bfc('0x27')](handleEntityNotFound(_0x1746d9,null))[_0x9bfc('0x27')](respondWithResult(_0x1746d9,null))[_0x9bfc('0x45')](handleError(_0x1746d9,null));};exports['create']=function(_0x283d9d,_0x1c7352){return db[_0x9bfc('0x41')][_0x9bfc('0x48')](_0x283d9d[_0x9bfc('0x49')],{})['then'](respondWithResult(_0x1c7352,0xc9))[_0x9bfc('0x45')](handleError(_0x1c7352,null));};exports['update']=function(_0xa5b29e,_0x385e56){if(_0xa5b29e['body']['id']){delete _0xa5b29e[_0x9bfc('0x49')]['id'];}return db[_0x9bfc('0x41')][_0x9bfc('0x47')]({'where':{'id':_0xa5b29e[_0x9bfc('0x4a')]['id']}})[_0x9bfc('0x27')](handleEntityNotFound(_0x385e56,null))['then'](saveUpdates(_0xa5b29e[_0x9bfc('0x49')],null))[_0x9bfc('0x27')](respondWithResult(_0x385e56,null))['catch'](handleError(_0x385e56,null));};exports[_0x9bfc('0x4b')]=function(_0x477daf,_0x5b7f04){return db['ZohoAccount'][_0x9bfc('0x47')]({'where':{'id':_0x477daf[_0x9bfc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b7f04,null))[_0x9bfc('0x27')](removeEntity(_0x5b7f04,null))[_0x9bfc('0x45')](handleError(_0x5b7f04,null));};exports[_0x9bfc('0x4c')]=function(_0x19aeba,_0x18834d,_0x3c2061){var _0x215c34={};var _0x466647={};var _0x5bf23b;var _0x46b0aa;return db[_0x9bfc('0x41')][_0x9bfc('0x4d')]({'where':{'id':_0x19aeba[_0x9bfc('0x4a')]['id']}})[_0x9bfc('0x27')](handleEntityNotFound(_0x18834d,null))[_0x9bfc('0x27')](function(_0x130f5c){if(_0x130f5c){_0x5bf23b=_0x130f5c;_0x466647[_0x9bfc('0x30')]=_[_0x9bfc('0x33')](db[_0x9bfc('0x4e')]['rawAttributes']);_0x466647[_0x9bfc('0x32')]=_[_0x9bfc('0x33')](_0x19aeba[_0x9bfc('0x32')]);_0x466647['filters']=_['intersection'](_0x466647[_0x9bfc('0x30')],_0x466647[_0x9bfc('0x32')]);_0x215c34[_0x9bfc('0x35')]=_[_0x9bfc('0x36')](_0x466647[_0x9bfc('0x30')],qs[_0x9bfc('0x37')](_0x19aeba[_0x9bfc('0x32')][_0x9bfc('0x37')]));_0x215c34['attributes']=_0x215c34[_0x9bfc('0x35')][_0x9bfc('0x38')]?_0x215c34[_0x9bfc('0x35')]:_0x466647['model'];_0x215c34[_0x9bfc('0x4f')]=qs[_0x9bfc('0x3a')](_0x19aeba[_0x9bfc('0x32')]['sort']);_0x215c34[_0x9bfc('0x3e')]=qs[_0x9bfc('0x34')](_[_0x9bfc('0x3b')](_0x19aeba['query'],_0x466647['filters']));if(_0x19aeba[_0x9bfc('0x32')]['filter']){_0x215c34['where']=_[_0x9bfc('0x3d')](_0x215c34['where'],{'$or':_[_0x9bfc('0x31')](_0x215c34['attributes'],function(_0x228d5c){var _0x376d52={};_0x376d52[_0x228d5c]={'$like':'%'+_0x19aeba[_0x9bfc('0x32')][_0x9bfc('0x3c')]+'%'};return _0x376d52;})});}_0x215c34=_[_0x9bfc('0x3d')]({},_0x215c34,_0x19aeba['options']);return _0x5bf23b['getConfigurations'](_0x215c34);}})[_0x9bfc('0x27')](function(_0x2e9580){if(_0x2e9580){_0x46b0aa=_0x2e9580[_0x9bfc('0x38')];if(!_0x19aeba['query']['hasOwnProperty'](_0x9bfc('0x39'))){_0x215c34[_0x9bfc('0x1f')]=qs[_0x9bfc('0x1f')](_0x19aeba[_0x9bfc('0x32')][_0x9bfc('0x1f')]);_0x215c34[_0x9bfc('0x1d')]=qs[_0x9bfc('0x1d')](_0x19aeba['query'][_0x9bfc('0x1d')]);}return _0x5bf23b[_0x9bfc('0x4c')](_0x215c34);}})['then'](function(_0x4b4c12){if(_0x4b4c12){return _0x4b4c12?{'count':_0x46b0aa,'rows':_0x4b4c12}:null;}})['then'](respondWithResult(_0x18834d,null))['catch'](handleError(_0x18834d,null));};exports['addConfiguration']=function(_0x54f520,_0x1522fe,_0x48cc32){if(_0x54f520['body']['id']){delete _0x54f520[_0x9bfc('0x49')]['id'];}return db[_0x9bfc('0x41')]['findOne']({'where':{'id':_0x54f520[_0x9bfc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1522fe,null))[_0x9bfc('0x27')](function(_0x5acd11){if(_0x5acd11){_0x54f520['body']['AccountId']=_0x5acd11['id'];_0x54f520[_0x9bfc('0x49')][_0x9bfc('0x50')]=integrations[_0x9bfc('0x51')](_0x54f520['body']['channel'],_0x54f520['body']['type']);_0x54f520[_0x9bfc('0x49')][_0x9bfc('0x52')]=integrations[_0x9bfc('0x53')](_0x54f520[_0x9bfc('0x49')][_0x9bfc('0x54')],_0x54f520['body']['type']);return db['ZohoConfiguration'][_0x9bfc('0x48')](_0x54f520[_0x9bfc('0x49')],{'include':[{'model':db[_0x9bfc('0x55')],'as':_0x9bfc('0x50')},{'model':db[_0x9bfc('0x55')],'as':_0x9bfc('0x52')}]});}return null;})['then'](respondWithResult(_0x1522fe,null))[_0x9bfc('0x45')](handleError(_0x1522fe,null));};function getAccessToken(_0x1c3f94){return new Promise(function(_0x157dac,_0x3229c2){var _0x366c27;switch(_0x1c3f94[_0x9bfc('0x56')]){case'US':_0x366c27='https://accounts.zoho.com';break;case'AU':_0x366c27=_0x9bfc('0x57');break;case'EU':_0x366c27='https://accounts.zoho.eu';break;case'IN':_0x366c27=_0x9bfc('0x58');break;case'CN':_0x366c27=_0x9bfc('0x59');break;default:_0x366c27=_0x9bfc('0x5a');break;}var _0x275843={'method':_0x9bfc('0x5b'),'uri':_0x366c27+_0x9bfc('0x5c'),'qs':{'refresh_token':_0x1c3f94[_0x9bfc('0x5d')],'client_id':_0x1c3f94['clientId'],'client_secret':_0x1c3f94[_0x9bfc('0x5e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x275843)['then'](function(_0x43cfea){if(_0x43cfea[_0x9bfc('0x5f')]){_0x157dac(_0x43cfea[_0x9bfc('0x5f')]);}else{_0x3229c2('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x9bfc('0x45')](function(_0xdb8cf9){_0x3229c2(_0xdb8cf9);});});}exports['getFields']=function(_0x1e37a4,_0x42e55b,_0x49961a){var _0x48d3b3,_0x19695a,_0x1bc53f,_0x3ccdd1,_0x20eb97;return db[_0x9bfc('0x41')]['findOne']({'where':{'id':_0x1e37a4[_0x9bfc('0x4a')]['id']},'attributes':['id',_0x9bfc('0x60'),'zone','clientId',_0x9bfc('0x5e'),_0x9bfc('0x61'),_0x9bfc('0x62'),_0x9bfc('0x5d')]})['then'](handleEntityNotFound(_0x42e55b,null))[_0x9bfc('0x27')](function(_0x45822d){_0x20eb97=_0x45822d;_0x48d3b3=_0x20eb97[_0x9bfc('0x60')];_0x19695a=_0x48d3b3===_0x9bfc('0x63')?'eu':'com';_0x1bc53f=_0x20eb97[_0x9bfc('0x61')];var _0x2f85ba=_0x1bc53f['slice'](-0x1);if(_0x2f85ba==='/'||_0x2f85ba==='\x5c'||_0x2f85ba===':'){_0x1bc53f=_0x1bc53f[_0x9bfc('0x64')](0x0,_0x1bc53f['lastIndexOf'](_0x2f85ba));}if(!_0x20eb97['refreshToken']){throw new Error(_0x9bfc('0x65'));}return getAccessToken(_0x20eb97);})[_0x9bfc('0x27')](function(_0x50f4fb){if(_0x50f4fb){return rp({'method':_0x9bfc('0x66'),'uri':util[_0x9bfc('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x19695a),'qs':{'module':_0x9bfc('0x68')},'headers':{'Authorization':_0x9bfc('0x69')+_0x50f4fb},'json':!![]});}})[_0x9bfc('0x27')](function(_0x2caa81){if(_0x2caa81){if(_0x2caa81['response']&&_0x2caa81[_0x9bfc('0x6a')][_0x9bfc('0x6b')]){throw new Error(_0x2caa81[_0x9bfc('0x6a')]['error']['message']);}var _0x103e5f=[];var _0x265ad2=[];var _0x8981f4=['Owner',_0x9bfc('0x6c'),_0x9bfc('0x6d'),_0x9bfc('0x6e'),_0x9bfc('0x6f'),_0x9bfc('0x70'),_0x9bfc('0x71'),_0x9bfc('0x72')];_0x265ad2=_[_0x9bfc('0x73')](_0x2caa81[_0x9bfc('0x37')],function(_0x1d08e2){return _0x8981f4[_0x9bfc('0x74')](_0x1d08e2[_0x9bfc('0x75')]);});for(var _0x4d3c91=0x0;_0x4d3c91<_0x265ad2['length'];_0x4d3c91++){if(_0x265ad2[_0x4d3c91][_0x9bfc('0x76')]===![]){_0x103e5f[_0x9bfc('0x77')]({'id':_0x265ad2[_0x4d3c91]['id'],'name':_0x265ad2[_0x4d3c91][_0x9bfc('0x78')],'custom':_0x265ad2[_0x4d3c91][_0x9bfc('0x79')],'options':_0x265ad2[_0x4d3c91][_0x9bfc('0x7a')]===_0x9bfc('0x7b')&&_0x265ad2[_0x4d3c91][_0x9bfc('0x7c')][_0x9bfc('0x38')]>-0x1?_[_0x9bfc('0x31')](_0x265ad2[_0x4d3c91][_0x9bfc('0x7c')],function(_0x1abae9){return{'name':_0x1abae9,'value':_0x1abae9};}):[]});}}return{'count':_0x103e5f[_0x9bfc('0x38')],'rows':_0x103e5f};}else{return{'count':0x0,'rows':[]};}})[_0x9bfc('0x27')](respondWithResult(_0x42e55b,null))[_0x9bfc('0x45')](function(_0x57275d){var _0x52784c=_0x1e37a4[_0x9bfc('0x32')]['test']?0x1f4:_0x57275d[_0x9bfc('0x7d')]||0x1f4;logger[_0x9bfc('0x6b')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x52784c,JSON[_0x9bfc('0x7e')](_0x57275d));delete _0x57275d['name'];if(_0x52784c===0x191){_0x52784c=0x190;}_0x42e55b[_0x9bfc('0x1a')](_0x52784c)[_0x9bfc('0x2a')](_0x1e37a4['query']['test']?{'message':_0x9bfc('0x7f'),'statusCode':_0x57275d[_0x9bfc('0x7d')]}:_0x57275d);});};
\ No newline at end of file
+var _0x7b6e=['response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','ZohoAccount','includeAll','include','rows','show','params','catch','create','body','find','destroy','findOne','pick','nolimit','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Zoho-oauthtoken\x20'];(function(_0x532e2d,_0x292943){var _0x1ce3e9=function(_0x15e5dc){while(--_0x15e5dc){_0x532e2d['push'](_0x532e2d['shift']());}};_0x1ce3e9(++_0x292943);}(_0x7b6e,0x18c));var _0xe7b6=function(_0x1fc7b5,_0x5d4779){_0x1fc7b5=_0x1fc7b5-0x0;var _0x3ef5db=_0x7b6e[_0x1fc7b5];return _0x3ef5db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7b6('0x0'));var zipdir=require(_0xe7b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7b6('0x2'));var moment=require('moment');var BPromise=require(_0xe7b6('0x3'));var Mustache=require(_0xe7b6('0x4'));var util=require(_0xe7b6('0x5'));var path=require(_0xe7b6('0x6'));var sox=require(_0xe7b6('0x7'));var csv=require(_0xe7b6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7b6('0x9'));var _=require(_0xe7b6('0xa'));var squel=require(_0xe7b6('0xb'));var crypto=require(_0xe7b6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7b6('0xd'));var toCsv=require(_0xe7b6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe7b6('0xe'));var authService=require(_0xe7b6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe7b6('0x10'));var hardwareService=require(_0xe7b6('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe7b6('0x12'));var config=require(_0xe7b6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7b6('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x93b321,_0xd52df7){_0xd52df7=_0xd52df7||0xcc;return function(_0xae4ca2){if(_0xae4ca2){return _0x93b321[_0xe7b6('0x15')](_0xd52df7);}return _0x93b321[_0xe7b6('0x16')](_0xd52df7)[_0xe7b6('0x17')]();};}function respondWithResult(_0x77a0a7,_0x451bb1){_0x451bb1=_0x451bb1||0xc8;return function(_0x145693){if(_0x145693){return _0x77a0a7[_0xe7b6('0x16')](_0x451bb1)[_0xe7b6('0x18')](_0x145693);}};}function respondWithFilteredResult(_0x5d6eff,_0x37a26c){return function(_0x43b030){if(_0x43b030){var _0x5d0ae9=typeof _0x37a26c[_0xe7b6('0x19')]===_0xe7b6('0x1a')&&typeof _0x37a26c[_0xe7b6('0x1b')]===_0xe7b6('0x1a');var _0x54ec3a=_0x43b030[_0xe7b6('0x1c')];var _0x2f5d48=_0x5d0ae9?0x0:_0x37a26c[_0xe7b6('0x19')];var _0x1450d5=_0x5d0ae9?_0x43b030['count']:_0x37a26c[_0xe7b6('0x19')]+_0x37a26c[_0xe7b6('0x1b')];var _0x12a5ba;if(_0x1450d5>=_0x54ec3a){_0x1450d5=_0x54ec3a;_0x12a5ba=0xc8;}else{_0x12a5ba=0xce;}_0x5d6eff['status'](_0x12a5ba);return _0x5d6eff[_0xe7b6('0x1d')](_0xe7b6('0x1e'),_0x2f5d48+'-'+_0x1450d5+'/'+_0x54ec3a)[_0xe7b6('0x18')](_0x43b030);}return null;};}function patchUpdates(_0x2c8293){return function(_0x5d54bb){try{jsonpatch[_0xe7b6('0x1f')](_0x5d54bb,_0x2c8293,!![]);}catch(_0x29a1f0){return BPromise['reject'](_0x29a1f0);}return _0x5d54bb[_0xe7b6('0x20')]();};}function saveUpdates(_0x3df987,_0x4cda19){return function(_0x5ced8f){if(_0x5ced8f){return _0x5ced8f[_0xe7b6('0x21')](_0x3df987)[_0xe7b6('0x22')](function(_0x3d49fa){return _0x3d49fa;});}return null;};}function removeEntity(_0x5cc6ab,_0x4d4c4c){return function(_0x4be449){if(_0x4be449){return _0x4be449['destroy']()[_0xe7b6('0x22')](function(){_0x5cc6ab[_0xe7b6('0x16')](0xcc)[_0xe7b6('0x17')]();});}};}function handleEntityNotFound(_0x39a3c4,_0x25d624){return function(_0x4d46da){if(!_0x4d46da){_0x39a3c4[_0xe7b6('0x15')](0x194);}return _0x4d46da;};}function handleError(_0x26f21f,_0x539c08){_0x539c08=_0x539c08||0x1f4;return function(_0x3e9401){logger[_0xe7b6('0x23')](_0x3e9401[_0xe7b6('0x24')]);if(_0x3e9401['name']){delete _0x3e9401[_0xe7b6('0x25')];}_0x26f21f['status'](_0x539c08)[_0xe7b6('0x26')](_0x3e9401);};}exports[_0xe7b6('0x27')]=function(_0x457a0d,_0x288074){var _0x3cd901={},_0x515f60={},_0x41794e={'count':0x0,'rows':[]};var _0x2bfbcb=_[_0xe7b6('0x28')](db['ZohoAccount'][_0xe7b6('0x29')],function(_0x8a8639){return{'name':_0x8a8639['fieldName'],'type':_0x8a8639['type'][_0xe7b6('0x2a')]};});_0x515f60['model']=_[_0xe7b6('0x28')](_0x2bfbcb,_0xe7b6('0x25'));_0x515f60['query']=_[_0xe7b6('0x2b')](_0x457a0d[_0xe7b6('0x2c')]);_0x515f60[_0xe7b6('0x2d')]=_[_0xe7b6('0x2e')](_0x515f60[_0xe7b6('0x2f')],_0x515f60[_0xe7b6('0x2c')]);_0x3cd901[_0xe7b6('0x30')]=_['intersection'](_0x515f60[_0xe7b6('0x2f')],qs[_0xe7b6('0x31')](_0x457a0d['query'][_0xe7b6('0x31')]));_0x3cd901[_0xe7b6('0x30')]=_0x3cd901[_0xe7b6('0x30')][_0xe7b6('0x32')]?_0x3cd901[_0xe7b6('0x30')]:_0x515f60[_0xe7b6('0x2f')];if(!_0x457a0d['query'][_0xe7b6('0x33')]('nolimit')){_0x3cd901[_0xe7b6('0x1b')]=qs[_0xe7b6('0x1b')](_0x457a0d[_0xe7b6('0x2c')][_0xe7b6('0x1b')]);_0x3cd901['offset']=qs[_0xe7b6('0x19')](_0x457a0d[_0xe7b6('0x2c')][_0xe7b6('0x19')]);}_0x3cd901[_0xe7b6('0x34')]=qs[_0xe7b6('0x35')](_0x457a0d['query'][_0xe7b6('0x35')]);_0x3cd901[_0xe7b6('0x36')]=qs[_0xe7b6('0x2d')](_['pick'](_0x457a0d['query'],_0x515f60[_0xe7b6('0x2d')]),_0x2bfbcb);if(_0x457a0d['query']['filter']){_0x3cd901[_0xe7b6('0x36')]=_['merge'](_0x3cd901[_0xe7b6('0x36')],{'$or':_[_0xe7b6('0x28')](_0x2bfbcb,function(_0x14e7b3){if(_0x14e7b3[_0xe7b6('0x37')]!==_0xe7b6('0x38')){var _0x40df05={};_0x40df05[_0x14e7b3['name']]={'$like':'%'+_0x457a0d['query'][_0xe7b6('0x39')]+'%'};return _0x40df05;}})});}_0x3cd901=_[_0xe7b6('0x3a')]({},_0x3cd901,_0x457a0d[_0xe7b6('0x3b')]);var _0x237146={'where':_0x3cd901[_0xe7b6('0x36')]};return db[_0xe7b6('0x3c')][_0xe7b6('0x1c')](_0x237146)[_0xe7b6('0x22')](function(_0x5df407){_0x41794e[_0xe7b6('0x1c')]=_0x5df407;if(_0x457a0d[_0xe7b6('0x2c')][_0xe7b6('0x3d')]){_0x3cd901[_0xe7b6('0x3e')]=[{'all':!![]}];}return db[_0xe7b6('0x3c')]['findAll'](_0x3cd901);})[_0xe7b6('0x22')](function(_0x35f128){_0x41794e[_0xe7b6('0x3f')]=_0x35f128;return _0x41794e;})[_0xe7b6('0x22')](respondWithFilteredResult(_0x288074,_0x3cd901))['catch'](handleError(_0x288074,null));};exports[_0xe7b6('0x40')]=function(_0x3dbccb,_0x2bb7cc){var _0xe0776e={'raw':![],'where':{'id':_0x3dbccb[_0xe7b6('0x41')]['id']}},_0x432fad={};_0x432fad[_0xe7b6('0x2f')]=_[_0xe7b6('0x2b')](db['ZohoAccount'][_0xe7b6('0x29')]);_0x432fad['query']=_[_0xe7b6('0x2b')](_0x3dbccb['query']);_0x432fad[_0xe7b6('0x2d')]=_['intersection'](_0x432fad[_0xe7b6('0x2f')],_0x432fad[_0xe7b6('0x2c')]);_0xe0776e[_0xe7b6('0x30')]=_[_0xe7b6('0x2e')](_0x432fad[_0xe7b6('0x2f')],qs[_0xe7b6('0x31')](_0x3dbccb[_0xe7b6('0x2c')]['fields']));_0xe0776e[_0xe7b6('0x30')]=_0xe0776e['attributes'][_0xe7b6('0x32')]?_0xe0776e[_0xe7b6('0x30')]:_0x432fad[_0xe7b6('0x2f')];if(_0x3dbccb[_0xe7b6('0x2c')][_0xe7b6('0x3d')]){_0xe0776e[_0xe7b6('0x3e')]=[{'all':!![]}];}_0xe0776e=_[_0xe7b6('0x3a')]({},_0xe0776e,_0x3dbccb[_0xe7b6('0x3b')]);return db['ZohoAccount']['find'](_0xe0776e)[_0xe7b6('0x22')](handleEntityNotFound(_0x2bb7cc,null))['then'](respondWithResult(_0x2bb7cc,null))[_0xe7b6('0x42')](handleError(_0x2bb7cc,null));};exports[_0xe7b6('0x43')]=function(_0x266d03,_0xa4ad2f){return db[_0xe7b6('0x3c')][_0xe7b6('0x43')](_0x266d03[_0xe7b6('0x44')],{})[_0xe7b6('0x22')](respondWithResult(_0xa4ad2f,0xc9))[_0xe7b6('0x42')](handleError(_0xa4ad2f,null));};exports['update']=function(_0x10a5e9,_0x1f8542){if(_0x10a5e9['body']['id']){delete _0x10a5e9[_0xe7b6('0x44')]['id'];}return db[_0xe7b6('0x3c')][_0xe7b6('0x45')]({'where':{'id':_0x10a5e9[_0xe7b6('0x41')]['id']}})[_0xe7b6('0x22')](handleEntityNotFound(_0x1f8542,null))[_0xe7b6('0x22')](saveUpdates(_0x10a5e9[_0xe7b6('0x44')],null))[_0xe7b6('0x22')](respondWithResult(_0x1f8542,null))['catch'](handleError(_0x1f8542,null));};exports[_0xe7b6('0x46')]=function(_0x33d5a6,_0x261fcc){return db[_0xe7b6('0x3c')]['find']({'where':{'id':_0x33d5a6['params']['id']}})['then'](handleEntityNotFound(_0x261fcc,null))[_0xe7b6('0x22')](removeEntity(_0x261fcc,null))[_0xe7b6('0x42')](handleError(_0x261fcc,null));};exports['getConfigurations']=function(_0x2cfedd,_0x3a4c1e,_0x45900e){var _0x4bfbf2={};var _0x7f3b44={};var _0x3f359d;var _0x55729d;return db[_0xe7b6('0x3c')][_0xe7b6('0x47')]({'where':{'id':_0x2cfedd[_0xe7b6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a4c1e,null))['then'](function(_0x4d49d8){if(_0x4d49d8){_0x3f359d=_0x4d49d8;_0x7f3b44[_0xe7b6('0x2f')]=_[_0xe7b6('0x2b')](db['ZohoConfiguration']['rawAttributes']);_0x7f3b44[_0xe7b6('0x2c')]=_[_0xe7b6('0x2b')](_0x2cfedd[_0xe7b6('0x2c')]);_0x7f3b44[_0xe7b6('0x2d')]=_['intersection'](_0x7f3b44['model'],_0x7f3b44[_0xe7b6('0x2c')]);_0x4bfbf2[_0xe7b6('0x30')]=_[_0xe7b6('0x2e')](_0x7f3b44[_0xe7b6('0x2f')],qs['fields'](_0x2cfedd[_0xe7b6('0x2c')]['fields']));_0x4bfbf2['attributes']=_0x4bfbf2[_0xe7b6('0x30')]['length']?_0x4bfbf2[_0xe7b6('0x30')]:_0x7f3b44[_0xe7b6('0x2f')];_0x4bfbf2[_0xe7b6('0x34')]=qs[_0xe7b6('0x35')](_0x2cfedd['query'][_0xe7b6('0x35')]);_0x4bfbf2[_0xe7b6('0x36')]=qs['filters'](_[_0xe7b6('0x48')](_0x2cfedd[_0xe7b6('0x2c')],_0x7f3b44[_0xe7b6('0x2d')]));if(_0x2cfedd[_0xe7b6('0x2c')]['filter']){_0x4bfbf2['where']=_[_0xe7b6('0x3a')](_0x4bfbf2[_0xe7b6('0x36')],{'$or':_['map'](_0x4bfbf2[_0xe7b6('0x30')],function(_0x211229){var _0x2b178f={};_0x2b178f[_0x211229]={'$like':'%'+_0x2cfedd[_0xe7b6('0x2c')][_0xe7b6('0x39')]+'%'};return _0x2b178f;})});}_0x4bfbf2=_[_0xe7b6('0x3a')]({},_0x4bfbf2,_0x2cfedd[_0xe7b6('0x3b')]);return _0x3f359d['getConfigurations'](_0x4bfbf2);}})[_0xe7b6('0x22')](function(_0x2808b3){if(_0x2808b3){_0x55729d=_0x2808b3['length'];if(!_0x2cfedd[_0xe7b6('0x2c')][_0xe7b6('0x33')](_0xe7b6('0x49'))){_0x4bfbf2[_0xe7b6('0x1b')]=qs[_0xe7b6('0x1b')](_0x2cfedd[_0xe7b6('0x2c')][_0xe7b6('0x1b')]);_0x4bfbf2[_0xe7b6('0x19')]=qs['offset'](_0x2cfedd[_0xe7b6('0x2c')][_0xe7b6('0x19')]);}return _0x3f359d[_0xe7b6('0x4a')](_0x4bfbf2);}})[_0xe7b6('0x22')](function(_0x3156a4){if(_0x3156a4){return _0x3156a4?{'count':_0x55729d,'rows':_0x3156a4}:null;}})[_0xe7b6('0x22')](respondWithResult(_0x3a4c1e,null))[_0xe7b6('0x42')](handleError(_0x3a4c1e,null));};exports['addConfiguration']=function(_0x4b8711,_0x54fc11,_0x4bee55){if(_0x4b8711[_0xe7b6('0x44')]['id']){delete _0x4b8711[_0xe7b6('0x44')]['id'];}return db[_0xe7b6('0x3c')][_0xe7b6('0x47')]({'where':{'id':_0x4b8711[_0xe7b6('0x41')]['id']}})['then'](handleEntityNotFound(_0x54fc11,null))['then'](function(_0x5aaa87){if(_0x5aaa87){_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x4b')]=_0x5aaa87['id'];_0x4b8711['body'][_0xe7b6('0x4c')]=integrations['getSubjects'](_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x4d')],_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x37')]);_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x4e')]=integrations[_0xe7b6('0x4f')](_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x4d')],_0x4b8711[_0xe7b6('0x44')][_0xe7b6('0x37')]);return db[_0xe7b6('0x50')][_0xe7b6('0x43')](_0x4b8711[_0xe7b6('0x44')],{'include':[{'model':db[_0xe7b6('0x51')],'as':'Subjects'},{'model':db[_0xe7b6('0x51')],'as':_0xe7b6('0x4e')}]});}return null;})[_0xe7b6('0x22')](respondWithResult(_0x54fc11,null))[_0xe7b6('0x42')](handleError(_0x54fc11,null));};function getAccessToken(_0x3c374b){return new Promise(function(_0x370b09,_0x186d98){var _0x27f962;switch(_0x3c374b[_0xe7b6('0x52')]){case'US':_0x27f962=_0xe7b6('0x53');break;case'AU':_0x27f962=_0xe7b6('0x54');break;case'EU':_0x27f962=_0xe7b6('0x55');break;case'IN':_0x27f962=_0xe7b6('0x56');break;case'CN':_0x27f962='https://accounts.zoho.com.cn';break;default:_0x27f962=_0xe7b6('0x55');break;}var _0x2ed68c={'method':'POST','uri':_0x27f962+_0xe7b6('0x57'),'qs':{'refresh_token':_0x3c374b[_0xe7b6('0x58')],'client_id':_0x3c374b[_0xe7b6('0x59')],'client_secret':_0x3c374b[_0xe7b6('0x5a')],'grant_type':_0xe7b6('0x5b')},'json':!![]};return rp(_0x2ed68c)[_0xe7b6('0x22')](function(_0x4bea66){if(_0x4bea66['access_token']){_0x370b09(_0x4bea66[_0xe7b6('0x5c')]);}else{_0x186d98('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xe7b6('0x42')](function(_0x447729){_0x186d98(_0x447729);});});}exports[_0xe7b6('0x5d')]=function(_0x5ce044,_0x2ab817,_0x48fe6a){var _0x40a38f,_0x40f56e,_0x4075d0,_0x12fecf,_0x16f057;return db[_0xe7b6('0x3c')][_0xe7b6('0x47')]({'where':{'id':_0x5ce044[_0xe7b6('0x41')]['id']},'attributes':['id',_0xe7b6('0x5e'),_0xe7b6('0x52'),_0xe7b6('0x59'),_0xe7b6('0x5a'),_0xe7b6('0x5f'),_0xe7b6('0x60'),_0xe7b6('0x58')]})[_0xe7b6('0x22')](handleEntityNotFound(_0x2ab817,null))['then'](function(_0x502f7f){_0x16f057=_0x502f7f;_0x40a38f=_0x16f057[_0xe7b6('0x5e')];_0x40f56e=_0x40a38f===_0xe7b6('0x61')?'eu':_0xe7b6('0x62');_0x4075d0=_0x16f057['serverUrl'];var _0x425309=_0x4075d0[_0xe7b6('0x63')](-0x1);if(_0x425309==='/'||_0x425309==='\x5c'||_0x425309===':'){_0x4075d0=_0x4075d0['substring'](0x0,_0x4075d0[_0xe7b6('0x64')](_0x425309));}if(!_0x16f057[_0xe7b6('0x58')]){throw new Error(_0xe7b6('0x65'));}return getAccessToken(_0x16f057);})['then'](function(_0x4d5065){if(_0x4d5065){return rp({'method':_0xe7b6('0x66'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x40f56e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe7b6('0x67')+_0x4d5065},'json':!![]});}})[_0xe7b6('0x22')](function(_0x45fde8){if(_0x45fde8){if(_0x45fde8[_0xe7b6('0x68')]&&_0x45fde8[_0xe7b6('0x68')][_0xe7b6('0x23')]){throw new Error(_0x45fde8['response'][_0xe7b6('0x23')][_0xe7b6('0x69')]);}var _0x215927=[];var _0x54391b=[];var _0x3f0f08=['Owner',_0xe7b6('0x6a'),'Description',_0xe7b6('0x6b'),_0xe7b6('0x6c'),_0xe7b6('0x6d'),_0xe7b6('0x6e'),_0xe7b6('0x6f')];_0x54391b=_[_0xe7b6('0x70')](_0x45fde8['fields'],function(_0x18fdee){return _0x3f0f08[_0xe7b6('0x71')](_0x18fdee[_0xe7b6('0x72')]);});for(var _0x49d3f9=0x0;_0x49d3f9<_0x54391b[_0xe7b6('0x32')];_0x49d3f9++){if(_0x54391b[_0x49d3f9][_0xe7b6('0x73')]===![]){_0x215927[_0xe7b6('0x74')]({'id':_0x54391b[_0x49d3f9]['id'],'name':_0x54391b[_0x49d3f9][_0xe7b6('0x75')],'custom':_0x54391b[_0x49d3f9][_0xe7b6('0x76')],'options':_0x54391b[_0x49d3f9]['data_type']==='picklist'&&_0x54391b[_0x49d3f9][_0xe7b6('0x77')][_0xe7b6('0x32')]>-0x1?_[_0xe7b6('0x28')](_0x54391b[_0x49d3f9][_0xe7b6('0x77')],function(_0x50e5d7){return{'name':_0x50e5d7,'value':_0x50e5d7};}):[]});}}return{'count':_0x215927[_0xe7b6('0x32')],'rows':_0x215927};}else{return{'count':0x0,'rows':[]};}})[_0xe7b6('0x22')](respondWithResult(_0x2ab817,null))[_0xe7b6('0x42')](function(_0x3ae7b0){var _0x20b58e=_0x5ce044['query'][_0xe7b6('0x78')]?0x1f4:_0x3ae7b0['statusCode']||0x1f4;logger[_0xe7b6('0x23')](_0xe7b6('0x79'),_0xe7b6('0x5d'),_0x20b58e,JSON[_0xe7b6('0x7a')](_0x3ae7b0));delete _0x3ae7b0[_0xe7b6('0x25')];if(_0x20b58e===0x191){_0x20b58e=0x190;}_0x2ab817[_0xe7b6('0x16')](_0x20b58e)[_0xe7b6('0x26')](_0x5ce044[_0xe7b6('0x2c')][_0xe7b6('0x78')]?{'message':_0xe7b6('0x7b'),'statusCode':_0x3ae7b0[_0xe7b6('0x7c')]}:_0x3ae7b0);});};
\ No newline at end of file
index 1883900..9f2e6be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed22=['slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','then','parse','refresh_token','refreshToken','info','format','name','error','catch','inspect','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host'];(function(_0x5f47cc,_0x46f935){var _0x5330e9=function(_0x48912e){while(--_0x48912e){_0x5f47cc['push'](_0x5f47cc['shift']());}};_0x5330e9(++_0x46f935);}(_0xed22,0x14b));var _0x2ed2=function(_0x44ad40,_0x39f9ea){_0x44ad40=_0x44ad40-0x0;var _0x2e92df=_0xed22[_0x44ad40];return _0x2e92df;};'use strict';var _=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var logger=require(_0x2ed2('0x2'))(_0x2ed2('0x3'));var moment=require('moment');var BPromise=require(_0x2ed2('0x4'));var rp=require(_0x2ed2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ed2('0x6'));var config=require(_0x2ed2('0x7'));var attributes=require(_0x2ed2('0x8'));var integrations=require(_0x2ed2('0x9'));module[_0x2ed2('0xa')]=function(_0x404c63,_0x5db6e7){return _0x404c63[_0x2ed2('0xb')](_0x2ed2('0xc'),attributes,{'tableName':_0x2ed2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x599b1a,_0x28bbf8,_0x49a43a){if(_0x599b1a[_0x2ed2('0xe')](_0x2ed2('0xf'))||_0x599b1a[_0x2ed2('0xe')](_0x2ed2('0x10'))||_0x599b1a['changed'](_0x2ed2('0x11'))||_0x599b1a[_0x2ed2('0xe')](_0x2ed2('0x12'))||_0x599b1a['changed'](_0x2ed2('0x13'))||_0x599b1a[_0x2ed2('0xe')](_0x2ed2('0x14'))){var _0x4d2192,_0x2be5e2;_0x4d2192=_0x599b1a[_0x2ed2('0x10')];var _0x29c63a=_0x4d2192[_0x2ed2('0x15')](-0x1);if(_0x29c63a==='/'||_0x29c63a==='\x5c'||_0x29c63a===':'){_0x4d2192=_0x4d2192[_0x2ed2('0x16')](0x0,_0x4d2192['lastIndexOf'](_0x29c63a));}switch(_0x599b1a[_0x2ed2('0xf')]){case'US':_0x2be5e2='https://accounts.zoho.com';break;case'AU':_0x2be5e2=_0x2ed2('0x17');break;case'IN':_0x2be5e2=_0x2ed2('0x18');break;case'CN':_0x2be5e2='https://accounts.zoho.com.cn';break;default:_0x2be5e2=_0x2ed2('0x19');break;}var _0x4ae758={'method':'POST','uri':_0x2be5e2+_0x2ed2('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x599b1a[_0x2ed2('0x11')],'client_secret':_0x599b1a['clientSecret'],'redirect_uri':_0x599b1a['serverUrl'],'code':_0x599b1a[_0x2ed2('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4ae758)[_0x2ed2('0x1b')](function(_0x1395d9){var _0x5be8a0=JSON[_0x2ed2('0x1c')](_0x1395d9);if(_0x5be8a0[_0x2ed2('0x1d')]){_0x599b1a[_0x2ed2('0x1e')]=_0x5be8a0['refresh_token'];logger[_0x2ed2('0x1f')](util[_0x2ed2('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x599b1a[_0x2ed2('0x21')],_0x599b1a['id']));}else{logger[_0x2ed2('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x599b1a[_0x2ed2('0x21')],_0x599b1a['id']),util['inspect'](_0x5be8a0,{'showHidden':![],'depth':null}));}return _0x49a43a(null,_0x28bbf8);})[_0x2ed2('0x23')](function(_0x4f0f98){logger['error'](util[_0x2ed2('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x599b1a['name'],_0x599b1a['id']),util[_0x2ed2('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x49a43a(_0x4f0f98);});}else{return _0x49a43a(null,_0x28bbf8);}},'beforeUpdate':function(_0x1b602b,_0x1da957,_0x2d310b){if(_0x1b602b[_0x2ed2('0xe')](_0x2ed2('0xf'))||_0x1b602b[_0x2ed2('0xe')](_0x2ed2('0x10'))||_0x1b602b['changed']('clientId')||_0x1b602b[_0x2ed2('0xe')]('clientSecret')||_0x1b602b[_0x2ed2('0xe')]('code')||_0x1b602b[_0x2ed2('0xe')](_0x2ed2('0x14'))){var _0x596056,_0x5765fe;_0x596056=_0x1b602b['serverUrl'];var _0xc657c9=_0x596056[_0x2ed2('0x15')](-0x1);if(_0xc657c9==='/'||_0xc657c9==='\x5c'||_0xc657c9===':'){_0x596056=_0x596056[_0x2ed2('0x16')](0x0,_0x596056[_0x2ed2('0x25')](_0xc657c9));}switch(_0x1b602b[_0x2ed2('0xf')]){case'US':_0x5765fe=_0x2ed2('0x26');break;case'AU':_0x5765fe=_0x2ed2('0x17');break;case'IN':_0x5765fe='https://accounts.zoho.in';break;case'CN':_0x5765fe=_0x2ed2('0x27');break;default:_0x5765fe=_0x2ed2('0x19');break;}var _0x9a34ba={'method':_0x2ed2('0x28'),'uri':_0x5765fe+'/oauth/v2/token','form':{'grant_type':_0x2ed2('0x29'),'client_id':_0x1b602b['clientId'],'client_secret':_0x1b602b[_0x2ed2('0x12')],'redirect_uri':_0x1b602b['serverUrl'],'code':_0x1b602b['code']},'headers':{'Content-Type':_0x2ed2('0x2a')}};return rp(_0x9a34ba)[_0x2ed2('0x1b')](function(_0x3579e4){var _0x85834e=JSON[_0x2ed2('0x1c')](_0x3579e4);if(_0x85834e[_0x2ed2('0x1d')]){_0x1b602b[_0x2ed2('0x1e')]=_0x85834e['refresh_token'];logger[_0x2ed2('0x1f')](util[_0x2ed2('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1b602b[_0x2ed2('0x21')],_0x1b602b['id']));}else{logger[_0x2ed2('0x22')](util['format'](_0x2ed2('0x2b'),_0x1b602b['name'],_0x1b602b['id']),util[_0x2ed2('0x24')](_0x85834e,{'showHidden':![],'depth':null}));}return _0x2d310b(null,_0x1da957);})[_0x2ed2('0x23')](function(_0xba3fdd){logger[_0x2ed2('0x22')](util[_0x2ed2('0x20')](_0x2ed2('0x2b'),_0x1b602b[_0x2ed2('0x21')],_0x1b602b['id']),util[_0x2ed2('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2d310b(_0xba3fdd);});}else{return _0x2d310b(null,_0x1da957);}}}});};
\ No newline at end of file
+var _0x7dba=['POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','name','slice','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x3988b6,_0x3697a3){var _0x2ce0c0=function(_0x394c79){while(--_0x394c79){_0x3988b6['push'](_0x3988b6['shift']());}};_0x2ce0c0(++_0x3697a3);}(_0x7dba,0x6d));var _0xa7db=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x7dba[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require('lodash');var util=require(_0xa7db('0x0'));var logger=require(_0xa7db('0x1'))(_0xa7db('0x2'));var moment=require(_0xa7db('0x3'));var BPromise=require(_0xa7db('0x4'));var rp=require(_0xa7db('0x5'));var fs=require('fs');var path=require(_0xa7db('0x6'));var rimraf=require(_0xa7db('0x7'));var config=require(_0xa7db('0x8'));var attributes=require(_0xa7db('0x9'));var integrations=require(_0xa7db('0xa'));module[_0xa7db('0xb')]=function(_0x42be1e,_0x28455f){return _0x42be1e[_0xa7db('0xc')](_0xa7db('0xd'),attributes,{'tableName':_0xa7db('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x337c48,_0x19d5f2,_0x362712){if(_0x337c48[_0xa7db('0xf')]('zone')||_0x337c48[_0xa7db('0xf')](_0xa7db('0x10'))||_0x337c48[_0xa7db('0xf')](_0xa7db('0x11'))||_0x337c48['changed'](_0xa7db('0x12'))||_0x337c48[_0xa7db('0xf')](_0xa7db('0x13'))||_0x337c48['changed'](_0xa7db('0x14'))){var _0x4f906d,_0x23a61e;_0x4f906d=_0x337c48[_0xa7db('0x10')];var _0x15d4a4=_0x4f906d['slice'](-0x1);if(_0x15d4a4==='/'||_0x15d4a4==='\x5c'||_0x15d4a4===':'){_0x4f906d=_0x4f906d[_0xa7db('0x15')](0x0,_0x4f906d[_0xa7db('0x16')](_0x15d4a4));}switch(_0x337c48[_0xa7db('0x17')]){case'US':_0x23a61e=_0xa7db('0x18');break;case'AU':_0x23a61e=_0xa7db('0x19');break;case'IN':_0x23a61e=_0xa7db('0x1a');break;case'CN':_0x23a61e=_0xa7db('0x1b');break;default:_0x23a61e=_0xa7db('0x1c');break;}var _0x504f54={'method':_0xa7db('0x1d'),'uri':_0x23a61e+_0xa7db('0x1e'),'form':{'grant_type':_0xa7db('0x1f'),'client_id':_0x337c48['clientId'],'client_secret':_0x337c48['clientSecret'],'redirect_uri':_0x337c48['serverUrl'],'code':_0x337c48[_0xa7db('0x13')]},'headers':{'Content-Type':_0xa7db('0x20')}};return rp(_0x504f54)[_0xa7db('0x21')](function(_0x1ed6c1){var _0x5c12d0=JSON[_0xa7db('0x22')](_0x1ed6c1);if(_0x5c12d0[_0xa7db('0x23')]){_0x337c48[_0xa7db('0x24')]=_0x5c12d0[_0xa7db('0x23')];logger[_0xa7db('0x25')](util[_0xa7db('0x26')](_0xa7db('0x27'),_0x337c48['name'],_0x337c48['id']));}else{logger[_0xa7db('0x28')](util['format'](_0xa7db('0x29'),_0x337c48['name'],_0x337c48['id']),util[_0xa7db('0x2a')](_0x5c12d0,{'showHidden':![],'depth':null}));}return _0x362712(null,_0x19d5f2);})['catch'](function(_0x46fc25){logger[_0xa7db('0x28')](util['format'](_0xa7db('0x29'),_0x337c48[_0xa7db('0x2b')],_0x337c48['id']),util[_0xa7db('0x2a')](parsedResult,{'showHidden':![],'depth':null}));return _0x362712(_0x46fc25);});}else{return _0x362712(null,_0x19d5f2);}},'beforeUpdate':function(_0x523110,_0x2e93aa,_0x352ceb){if(_0x523110[_0xa7db('0xf')](_0xa7db('0x17'))||_0x523110[_0xa7db('0xf')]('serverUrl')||_0x523110[_0xa7db('0xf')]('clientId')||_0x523110[_0xa7db('0xf')](_0xa7db('0x12'))||_0x523110[_0xa7db('0xf')](_0xa7db('0x13'))||_0x523110['changed'](_0xa7db('0x14'))){var _0x2df4e,_0x87d687;_0x2df4e=_0x523110['serverUrl'];var _0x1340e4=_0x2df4e[_0xa7db('0x2c')](-0x1);if(_0x1340e4==='/'||_0x1340e4==='\x5c'||_0x1340e4===':'){_0x2df4e=_0x2df4e[_0xa7db('0x15')](0x0,_0x2df4e[_0xa7db('0x16')](_0x1340e4));}switch(_0x523110[_0xa7db('0x17')]){case'US':_0x87d687=_0xa7db('0x18');break;case'AU':_0x87d687='https://accounts.zoho.com.au';break;case'IN':_0x87d687=_0xa7db('0x1a');break;case'CN':_0x87d687=_0xa7db('0x1b');break;default:_0x87d687=_0xa7db('0x1c');break;}var _0x172031={'method':_0xa7db('0x1d'),'uri':_0x87d687+_0xa7db('0x1e'),'form':{'grant_type':_0xa7db('0x1f'),'client_id':_0x523110[_0xa7db('0x11')],'client_secret':_0x523110['clientSecret'],'redirect_uri':_0x523110['serverUrl'],'code':_0x523110['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x172031)[_0xa7db('0x21')](function(_0x406f5a){var _0x42224d=JSON[_0xa7db('0x22')](_0x406f5a);if(_0x42224d[_0xa7db('0x23')]){_0x523110[_0xa7db('0x24')]=_0x42224d['refresh_token'];logger[_0xa7db('0x25')](util[_0xa7db('0x26')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x523110[_0xa7db('0x2b')],_0x523110['id']));}else{logger[_0xa7db('0x28')](util['format'](_0xa7db('0x29'),_0x523110[_0xa7db('0x2b')],_0x523110['id']),util[_0xa7db('0x2a')](_0x42224d,{'showHidden':![],'depth':null}));}return _0x352ceb(null,_0x2e93aa);})[_0xa7db('0x2d')](function(_0x493903){logger[_0xa7db('0x28')](util[_0xa7db('0x26')](_0xa7db('0x29'),_0x523110[_0xa7db('0x2b')],_0x523110['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x352ceb(_0x493903);});}else{return _0x352ceb(null,_0x2e93aa);}}}});};
\ No newline at end of file
index 2250c81..e7972ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaef=['options','raw','attributes','limit','include','model','map','ShowZohoAccount','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0x7da967,_0x54e1e2){var _0x2fd036=function(_0x3e157c){while(--_0x3e157c){_0x7da967['push'](_0x7da967['shift']());}};_0x2fd036(++_0x54e1e2);}(_0xcaef,0x1c9));var _0xfcae=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xcaef[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0xfcae('0x0'));var moment=require(_0xfcae('0x1'));var BPromise=require(_0xfcae('0x2'));var rs=require(_0xfcae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcae('0x5'))(_0xfcae('0x6'));var config=require('../../config/environment');var jayson=require(_0xfcae('0x7'));var client=jayson[_0xfcae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f0938,_0x5d9a45,_0x516d1e){return new BPromise(function(_0x30dd6e,_0x24dde0){return client[_0xfcae('0x9')](_0x2f0938,_0x516d1e)['then'](function(_0xb305f5){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5d9a45,_0xfcae('0xa'));logger[_0xfcae('0xb')](_0xfcae('0xc'),_0x5d9a45,_0xfcae('0xa'),JSON[_0xfcae('0xd')](_0xb305f5));if(_0xb305f5[_0xfcae('0xe')]){if(_0xb305f5[_0xfcae('0xe')][_0xfcae('0xf')]===0x1f4){logger[_0xfcae('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x5d9a45,_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);return _0x24dde0(_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);}logger[_0xfcae('0xe')](_0xfcae('0x11'),_0x5d9a45,_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);return _0x30dd6e(_0xb305f5['error'][_0xfcae('0x10')]);}else{logger['info'](_0xfcae('0x11'),_0x5d9a45,_0xfcae('0xa'));_0x30dd6e(_0xb305f5[_0xfcae('0x12')][_0xfcae('0x10')]);}})[_0xfcae('0x13')](function(_0x23c404){logger[_0xfcae('0xe')](_0xfcae('0x11'),_0x5d9a45,_0x23c404);_0x24dde0(_0x23c404);});});}exports[_0xfcae('0x14')]=function(_0x4d2a5e){var _0x24f607=this;return new Promise(function(_0x5f4a8b,_0x3176d6){return db[_0xfcae('0x15')][_0xfcae('0x16')]({'raw':_0x4d2a5e[_0xfcae('0x17')]?_0x4d2a5e[_0xfcae('0x17')][_0xfcae('0x18')]===undefined?!![]:![]:!![],'where':_0x4d2a5e[_0xfcae('0x17')]?_0x4d2a5e['options']['where']||null:null,'attributes':_0x4d2a5e[_0xfcae('0x17')]?_0x4d2a5e[_0xfcae('0x17')][_0xfcae('0x19')]||null:null,'limit':_0x4d2a5e[_0xfcae('0x17')]?_0x4d2a5e[_0xfcae('0x17')][_0xfcae('0x1a')]||null:null,'include':_0x4d2a5e[_0xfcae('0x17')]?_0x4d2a5e[_0xfcae('0x17')][_0xfcae('0x1b')]?_['map'](_0x4d2a5e[_0xfcae('0x17')][_0xfcae('0x1b')],function(_0x57687e){return{'model':db[_0x57687e['model']],'as':_0x57687e['as'],'attributes':_0x57687e['attributes'],'include':_0x57687e[_0xfcae('0x1b')]?_['map'](_0x57687e[_0xfcae('0x1b')],function(_0x2b0bde){return{'model':db[_0x2b0bde[_0xfcae('0x1c')]],'as':_0x2b0bde['as'],'attributes':_0x2b0bde['attributes'],'include':_0x2b0bde[_0xfcae('0x1b')]?_[_0xfcae('0x1d')](_0x2b0bde[_0xfcae('0x1b')],function(_0x374c30){return{'model':db[_0x374c30['model']],'as':_0x374c30['as'],'attributes':_0x374c30['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47b7ed){logger['info'](_0xfcae('0x14'),_0x4d2a5e);logger['debug']('GetZohoAccount',_0x4d2a5e,JSON[_0xfcae('0xd')](_0x47b7ed));_0x5f4a8b(_0x47b7ed);})[_0xfcae('0x13')](function(_0x2596a6){logger['error'](_0xfcae('0x14'),_0x2596a6['message'],_0x4d2a5e);_0x3176d6(_0x24f607['error'](0x1f4,_0x2596a6['message']));});});};exports[_0xfcae('0x1e')]=function(_0x2859d2){var _0x3931b0=this;return new Promise(function(_0x31e0ce,_0x47cfde){return db['ZohoAccount']['find']({'raw':_0x2859d2[_0xfcae('0x17')]?_0x2859d2[_0xfcae('0x17')][_0xfcae('0x18')]===undefined?!![]:![]:!![],'where':_0x2859d2['options']?_0x2859d2['options'][_0xfcae('0x1f')]||null:null,'attributes':_0x2859d2['options']?_0x2859d2[_0xfcae('0x17')][_0xfcae('0x19')]||null:null,'include':_0x2859d2[_0xfcae('0x17')]?_0x2859d2[_0xfcae('0x17')][_0xfcae('0x1b')]?_['map'](_0x2859d2[_0xfcae('0x17')][_0xfcae('0x1b')],function(_0x16a576){return{'model':db[_0x16a576['model']],'as':_0x16a576['as'],'attributes':_0x16a576[_0xfcae('0x19')],'include':_0x16a576[_0xfcae('0x1b')]?_[_0xfcae('0x1d')](_0x16a576[_0xfcae('0x1b')],function(_0x486ec5){return{'model':db[_0x486ec5[_0xfcae('0x1c')]],'as':_0x486ec5['as'],'attributes':_0x486ec5[_0xfcae('0x19')],'include':_0x486ec5[_0xfcae('0x1b')]?_['map'](_0x486ec5[_0xfcae('0x1b')],function(_0x116542){return{'model':db[_0x116542[_0xfcae('0x1c')]],'as':_0x116542['as'],'attributes':_0x116542[_0xfcae('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x487ca8){logger['info'](_0xfcae('0x1e'),_0x2859d2);logger[_0xfcae('0xb')]('ShowZohoAccount',_0x2859d2,JSON[_0xfcae('0xd')](_0x487ca8));_0x31e0ce(_0x487ca8);})['catch'](function(_0x520548){logger[_0xfcae('0xe')](_0xfcae('0x1e'),_0x520548[_0xfcae('0x10')],_0x2859d2);_0x47cfde(_0x3931b0[_0xfcae('0xe')](0x1f4,_0x520548[_0xfcae('0x10')]));});});};
\ No newline at end of file
+var _0x11c8=['request\x20sent','debug','stringify','error','code','message','info','ZohoAccount,\x20%s,\x20%s','catch','GetZohoAccount','ZohoAccount','options','where','limit','include','map','model','attributes','ShowZohoAccount','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x531f1a,_0x5efc00){var _0x3b471b=function(_0x39f5e1){while(--_0x39f5e1){_0x531f1a['push'](_0x531f1a['shift']());}};_0x3b471b(++_0x5efc00);}(_0x11c8,0x19a));var _0x811c=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x11c8[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var moment=require(_0x811c('0x1'));var BPromise=require('bluebird');var rs=require(_0x811c('0x2'));var fs=require('fs');var Redis=require(_0x811c('0x3'));var db=require(_0x811c('0x4'))['db'];var utils=require(_0x811c('0x5'));var logger=require(_0x811c('0x6'))(_0x811c('0x7'));var config=require('../../config/environment');var jayson=require(_0x811c('0x8'));var client=jayson[_0x811c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126cc2,_0x8af784,_0x13a95a){return new BPromise(function(_0x3e81ac,_0x57a92d){return client['request'](_0x126cc2,_0x13a95a)['then'](function(_0x5be7fc){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x8af784,_0x811c('0xa'));logger[_0x811c('0xb')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x8af784,_0x811c('0xa'),JSON[_0x811c('0xc')](_0x5be7fc));if(_0x5be7fc[_0x811c('0xd')]){if(_0x5be7fc[_0x811c('0xd')][_0x811c('0xe')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x8af784,_0x5be7fc[_0x811c('0xd')]['message']);return _0x57a92d(_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x8af784,_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);return _0x3e81ac(_0x5be7fc[_0x811c('0xd')][_0x811c('0xf')]);}else{logger[_0x811c('0x10')](_0x811c('0x11'),_0x8af784,'request\x20sent');_0x3e81ac(_0x5be7fc['result'][_0x811c('0xf')]);}})[_0x811c('0x12')](function(_0x3b0895){logger[_0x811c('0xd')](_0x811c('0x11'),_0x8af784,_0x3b0895);_0x57a92d(_0x3b0895);});});}exports[_0x811c('0x13')]=function(_0xcefd63){var _0x36c8da=this;return new Promise(function(_0x179636,_0x503bbc){return db[_0x811c('0x14')]['findAll']({'raw':_0xcefd63[_0x811c('0x15')]?_0xcefd63[_0x811c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xcefd63[_0x811c('0x15')]?_0xcefd63[_0x811c('0x15')][_0x811c('0x16')]||null:null,'attributes':_0xcefd63['options']?_0xcefd63['options']['attributes']||null:null,'limit':_0xcefd63[_0x811c('0x15')]?_0xcefd63[_0x811c('0x15')][_0x811c('0x17')]||null:null,'include':_0xcefd63['options']?_0xcefd63[_0x811c('0x15')][_0x811c('0x18')]?_[_0x811c('0x19')](_0xcefd63[_0x811c('0x15')]['include'],function(_0x29d80f){return{'model':db[_0x29d80f[_0x811c('0x1a')]],'as':_0x29d80f['as'],'attributes':_0x29d80f[_0x811c('0x1b')],'include':_0x29d80f[_0x811c('0x18')]?_[_0x811c('0x19')](_0x29d80f[_0x811c('0x18')],function(_0x54deb8){return{'model':db[_0x54deb8[_0x811c('0x1a')]],'as':_0x54deb8['as'],'attributes':_0x54deb8['attributes'],'include':_0x54deb8[_0x811c('0x18')]?_[_0x811c('0x19')](_0x54deb8[_0x811c('0x18')],function(_0x37dbb4){return{'model':db[_0x37dbb4[_0x811c('0x1a')]],'as':_0x37dbb4['as'],'attributes':_0x37dbb4[_0x811c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ecad8){logger[_0x811c('0x10')](_0x811c('0x13'),_0xcefd63);logger[_0x811c('0xb')](_0x811c('0x13'),_0xcefd63,JSON[_0x811c('0xc')](_0x1ecad8));_0x179636(_0x1ecad8);})['catch'](function(_0x2fde17){logger[_0x811c('0xd')]('GetZohoAccount',_0x2fde17['message'],_0xcefd63);_0x503bbc(_0x36c8da[_0x811c('0xd')](0x1f4,_0x2fde17[_0x811c('0xf')]));});});};exports[_0x811c('0x1c')]=function(_0x5920a5){var _0x21d6d5=this;return new Promise(function(_0x244375,_0x538977){return db['ZohoAccount']['find']({'raw':_0x5920a5[_0x811c('0x15')]?_0x5920a5[_0x811c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5920a5[_0x811c('0x15')]?_0x5920a5['options']['where']||null:null,'attributes':_0x5920a5[_0x811c('0x15')]?_0x5920a5[_0x811c('0x15')][_0x811c('0x1b')]||null:null,'include':_0x5920a5[_0x811c('0x15')]?_0x5920a5[_0x811c('0x15')][_0x811c('0x18')]?_[_0x811c('0x19')](_0x5920a5[_0x811c('0x15')]['include'],function(_0x54a299){return{'model':db[_0x54a299[_0x811c('0x1a')]],'as':_0x54a299['as'],'attributes':_0x54a299[_0x811c('0x1b')],'include':_0x54a299['include']?_[_0x811c('0x19')](_0x54a299['include'],function(_0x4779d7){return{'model':db[_0x4779d7['model']],'as':_0x4779d7['as'],'attributes':_0x4779d7[_0x811c('0x1b')],'include':_0x4779d7[_0x811c('0x18')]?_['map'](_0x4779d7[_0x811c('0x18')],function(_0x2b4ce3){return{'model':db[_0x2b4ce3[_0x811c('0x1a')]],'as':_0x2b4ce3['as'],'attributes':_0x2b4ce3['attributes']};}):[]};}):[]};}):[]:[]})[_0x811c('0x1d')](function(_0x5720c1){logger['info']('ShowZohoAccount',_0x5920a5);logger[_0x811c('0xb')](_0x811c('0x1c'),_0x5920a5,JSON['stringify'](_0x5720c1));_0x244375(_0x5720c1);})['catch'](function(_0x55766b){logger[_0x811c('0xd')](_0x811c('0x1c'),_0x55766b[_0x811c('0xf')],_0x5920a5);_0x538977(_0x21d6d5[_0x811c('0xd')](0x1f4,_0x55766b[_0x811c('0xf')]));});});};
\ No newline at end of file
index fc94df5..8d97fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa08=['../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','/:id/descriptions','getDescriptions','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x50565c,_0x20a412){var _0xbd09f=function(_0x3fa7ae){while(--_0x3fa7ae){_0x50565c['push'](_0x50565c['shift']());}};_0xbd09f(++_0x20a412);}(_0xfa08,0x160));var _0x8fa0=function(_0x1c495b,_0x4e72c5){_0x1c495b=_0x1c495b-0x0;var _0x993419=_0xfa08[_0x1c495b];return _0x993419;};'use strict';var multer=require(_0x8fa0('0x0'));var util=require(_0x8fa0('0x1'));var path=require(_0x8fa0('0x2'));var timeout=require(_0x8fa0('0x3'));var express=require(_0x8fa0('0x4'));var router=express[_0x8fa0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8fa0('0x6'));var interaction=require(_0x8fa0('0x7'));var config=require(_0x8fa0('0x8'));var controller=require(_0x8fa0('0x9'));router[_0x8fa0('0xa')]('/',auth[_0x8fa0('0xb')](),controller['index']);router['get'](_0x8fa0('0xc'),auth[_0x8fa0('0xb')](),controller['show']);router[_0x8fa0('0xa')](_0x8fa0('0xd'),auth[_0x8fa0('0xb')](),controller['getFields']);router[_0x8fa0('0xa')]('/:id/subjects',auth[_0x8fa0('0xb')](),controller['getSubjects']);router[_0x8fa0('0xa')](_0x8fa0('0xe'),auth[_0x8fa0('0xb')](),controller[_0x8fa0('0xf')]);router[_0x8fa0('0x10')]('/',auth[_0x8fa0('0xb')](),controller[_0x8fa0('0x11')]);router['put']('/:id',auth[_0x8fa0('0xb')](),controller['update']);router[_0x8fa0('0x12')](_0x8fa0('0xc'),auth[_0x8fa0('0xb')](),controller[_0x8fa0('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdef6=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getDescriptions','post','create','put','update','delete'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdef6,0x191));var _0x6def=function(_0x12a32a,_0x200871){_0x12a32a=_0x12a32a-0x0;var _0x45c462=_0xdef6[_0x12a32a];return _0x45c462;};'use strict';var multer=require(_0x6def('0x0'));var util=require('util');var path=require(_0x6def('0x1'));var timeout=require(_0x6def('0x2'));var express=require(_0x6def('0x3'));var router=express['Router']();var fs_extra=require(_0x6def('0x4'));var auth=require(_0x6def('0x5'));var interaction=require(_0x6def('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x6def('0x7')]('/',auth[_0x6def('0x8')](),controller[_0x6def('0x9')]);router['get'](_0x6def('0xa'),auth[_0x6def('0x8')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x6def('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x6def('0x7')]('/:id/descriptions',auth[_0x6def('0x8')](),controller[_0x6def('0xb')]);router[_0x6def('0xc')]('/',auth[_0x6def('0x8')](),controller[_0x6def('0xd')]);router[_0x6def('0xe')]('/:id',auth[_0x6def('0x8')](),controller[_0x6def('0xf')]);router[_0x6def('0x10')]('/:id',auth[_0x6def('0x8')](),controller[_0x6def('0x11')]);module[_0x6def('0x12')]=router;
\ No newline at end of file
index c1a2ec5..7fb1df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6934=['STRING','ENUM','lead','nothing','contact_lead','sequelize','exports'];(function(_0x5aabf9,_0x13f348){var _0x7d7575=function(_0x4310c5){while(--_0x4310c5){_0x5aabf9['push'](_0x5aabf9['shift']());}};_0x7d7575(++_0x13f348);}(_0x6934,0x17f));var _0x4693=function(_0x5b2500,_0x129113){_0x5b2500=_0x5b2500-0x0;var _0x2b19f7=_0x6934[_0x5b2500];return _0x2b19f7;};'use strict';var Sequelize=require(_0x4693('0x0'));module[_0x4693('0x1')]={'name':{'type':Sequelize[_0x4693('0x2')]},'moduleCreate':{'type':Sequelize[_0x4693('0x3')](_0x4693('0x4'),'contact',_0x4693('0x5')),'defaultValue':_0x4693('0x4')},'moduleSearch':{'type':Sequelize[_0x4693('0x3')](_0x4693('0x6'),'contact',_0x4693('0x4')),'defaultValue':_0x4693('0x6')},'description':{'type':Sequelize[_0x4693('0x2')]}};
\ No newline at end of file
+var _0xe362=['ENUM','contact','nothing','lead','contact_lead','sequelize','STRING'];(function(_0x552fa9,_0x16e78e){var _0x19c709=function(_0x14e460){while(--_0x14e460){_0x552fa9['push'](_0x552fa9['shift']());}};_0x19c709(++_0x16e78e);}(_0xe362,0x194));var _0x2e36=function(_0x3039bd,_0x55fb7c){_0x3039bd=_0x3039bd-0x0;var _0x2c11ac=_0xe362[_0x3039bd];return _0x2c11ac;};'use strict';var Sequelize=require(_0x2e36('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e36('0x1')]},'moduleCreate':{'type':Sequelize[_0x2e36('0x2')]('lead',_0x2e36('0x3'),_0x2e36('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x2e36('0x3'),_0x2e36('0x5')),'defaultValue':_0x2e36('0x6')},'description':{'type':Sequelize[_0x2e36('0x1')]}};
\ No newline at end of file
index 4f44f40..0dc24fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf437=['getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','getFields','findOne','ZohoField','length','getSubjects'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xf437,0x9f));var _0x7f43=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0xf437[_0x206f02];return _0x8a2663;};'use strict';var emlformat=require(_0x7f43('0x0'));var rimraf=require(_0x7f43('0x1'));var zipdir=require(_0x7f43('0x2'));var jsonpatch=require(_0x7f43('0x3'));var rp=require(_0x7f43('0x4'));var moment=require(_0x7f43('0x5'));var BPromise=require(_0x7f43('0x6'));var Mustache=require(_0x7f43('0x7'));var util=require(_0x7f43('0x8'));var path=require(_0x7f43('0x9'));var sox=require('sox');var csv=require(_0x7f43('0xa'));var ejs=require(_0x7f43('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7f43('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f43('0xd'));var deskjs=require(_0x7f43('0xe'));var toCsv=require(_0x7f43('0xa'));var querystring=require(_0x7f43('0xf'));var Papa=require(_0x7f43('0x10'));var Redis=require('ioredis');var authService=require(_0x7f43('0x11'));var qs=require(_0x7f43('0x12'));var as=require(_0x7f43('0x13'));var hardwareService=require(_0x7f43('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7f43('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f43('0x16'))['db'];function respondWithStatusCode(_0x34d6ab,_0x273c74){_0x273c74=_0x273c74||0xcc;return function(_0x51cf75){if(_0x51cf75){return _0x34d6ab['sendStatus'](_0x273c74);}return _0x34d6ab[_0x7f43('0x17')](_0x273c74)[_0x7f43('0x18')]();};}function respondWithResult(_0x3a6248,_0x25f6d1){_0x25f6d1=_0x25f6d1||0xc8;return function(_0x5a2a13){if(_0x5a2a13){return _0x3a6248[_0x7f43('0x17')](_0x25f6d1)[_0x7f43('0x19')](_0x5a2a13);}};}function respondWithFilteredResult(_0x4ee4a0,_0x5e177e){return function(_0xf23a72){if(_0xf23a72){var _0x3e2489=typeof _0x5e177e[_0x7f43('0x1a')]===_0x7f43('0x1b')&&typeof _0x5e177e[_0x7f43('0x1c')]==='undefined';var _0x519412=_0xf23a72[_0x7f43('0x1d')];var _0x304a6b=_0x3e2489?0x0:_0x5e177e[_0x7f43('0x1a')];var _0x5c7239=_0x3e2489?_0xf23a72['count']:_0x5e177e[_0x7f43('0x1a')]+_0x5e177e['limit'];var _0x44b919;if(_0x5c7239>=_0x519412){_0x5c7239=_0x519412;_0x44b919=0xc8;}else{_0x44b919=0xce;}_0x4ee4a0['status'](_0x44b919);return _0x4ee4a0['set']('Content-Range',_0x304a6b+'-'+_0x5c7239+'/'+_0x519412)['json'](_0xf23a72);}return null;};}function patchUpdates(_0x467e51){return function(_0x1900f3){try{jsonpatch[_0x7f43('0x1e')](_0x1900f3,_0x467e51,!![]);}catch(_0x12402e){return BPromise['reject'](_0x12402e);}return _0x1900f3[_0x7f43('0x1f')]();};}function saveUpdates(_0x432ecd,_0x7d1545){return function(_0xbf5956){if(_0xbf5956){return _0xbf5956['update'](_0x432ecd)['then'](function(_0x202a0c){return _0x202a0c;});}return null;};}function removeEntity(_0x570a2b,_0x3e1887){return function(_0x3bab51){if(_0x3bab51){return _0x3bab51[_0x7f43('0x20')]()['then'](function(){_0x570a2b['status'](0xcc)[_0x7f43('0x18')]();});}};}function handleEntityNotFound(_0x2e74d9,_0x2b232b){return function(_0x1b224e){if(!_0x1b224e){_0x2e74d9['sendStatus'](0x194);}return _0x1b224e;};}function handleError(_0x453884,_0x4efd6d){_0x4efd6d=_0x4efd6d||0x1f4;return function(_0x25ad4d){logger[_0x7f43('0x21')](_0x25ad4d[_0x7f43('0x22')]);if(_0x25ad4d['name']){delete _0x25ad4d[_0x7f43('0x23')];}_0x453884[_0x7f43('0x17')](_0x4efd6d)[_0x7f43('0x24')](_0x25ad4d);};}exports[_0x7f43('0x25')]=function(_0x3d4ef5,_0x560c90){var _0x4c07f7={},_0x3d7b8b={},_0x1bbb48={'count':0x0,'rows':[]};var _0xd32554=_[_0x7f43('0x26')](db[_0x7f43('0x27')][_0x7f43('0x28')],function(_0x58909f){return{'name':_0x58909f[_0x7f43('0x29')],'type':_0x58909f[_0x7f43('0x2a')][_0x7f43('0x2b')]};});_0x3d7b8b[_0x7f43('0x2c')]=_['map'](_0xd32554,_0x7f43('0x23'));_0x3d7b8b[_0x7f43('0x2d')]=_[_0x7f43('0x2e')](_0x3d4ef5[_0x7f43('0x2d')]);_0x3d7b8b['filters']=_[_0x7f43('0x2f')](_0x3d7b8b[_0x7f43('0x2c')],_0x3d7b8b[_0x7f43('0x2d')]);_0x4c07f7[_0x7f43('0x30')]=_[_0x7f43('0x2f')](_0x3d7b8b['model'],qs[_0x7f43('0x31')](_0x3d4ef5[_0x7f43('0x2d')][_0x7f43('0x31')]));_0x4c07f7[_0x7f43('0x30')]=_0x4c07f7['attributes']['length']?_0x4c07f7[_0x7f43('0x30')]:_0x3d7b8b['model'];if(!_0x3d4ef5['query'][_0x7f43('0x32')](_0x7f43('0x33'))){_0x4c07f7[_0x7f43('0x1c')]=qs['limit'](_0x3d4ef5[_0x7f43('0x2d')][_0x7f43('0x1c')]);_0x4c07f7[_0x7f43('0x1a')]=qs['offset'](_0x3d4ef5[_0x7f43('0x2d')][_0x7f43('0x1a')]);}_0x4c07f7[_0x7f43('0x34')]=qs[_0x7f43('0x35')](_0x3d4ef5[_0x7f43('0x2d')]['sort']);_0x4c07f7['where']=qs['filters'](_[_0x7f43('0x36')](_0x3d4ef5[_0x7f43('0x2d')],_0x3d7b8b[_0x7f43('0x37')]),_0xd32554);if(_0x3d4ef5[_0x7f43('0x2d')]['filter']){_0x4c07f7[_0x7f43('0x38')]=_[_0x7f43('0x39')](_0x4c07f7[_0x7f43('0x38')],{'$or':_['map'](_0xd32554,function(_0x5d8261){if(_0x5d8261[_0x7f43('0x2a')]!==_0x7f43('0x3a')){var _0x22dcfe={};_0x22dcfe[_0x5d8261['name']]={'$like':'%'+_0x3d4ef5[_0x7f43('0x2d')][_0x7f43('0x3b')]+'%'};return _0x22dcfe;}})});}_0x4c07f7=_[_0x7f43('0x39')]({},_0x4c07f7,_0x3d4ef5[_0x7f43('0x3c')]);var _0x5cf954={'where':_0x4c07f7[_0x7f43('0x38')]};return db[_0x7f43('0x27')][_0x7f43('0x1d')](_0x5cf954)[_0x7f43('0x3d')](function(_0x1408c2){_0x1bbb48[_0x7f43('0x1d')]=_0x1408c2;if(_0x3d4ef5[_0x7f43('0x2d')][_0x7f43('0x3e')]){_0x4c07f7[_0x7f43('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7f43('0x40')](_0x4c07f7);})[_0x7f43('0x3d')](function(_0x1791bb){_0x1bbb48[_0x7f43('0x41')]=_0x1791bb;return _0x1bbb48;})[_0x7f43('0x3d')](respondWithFilteredResult(_0x560c90,_0x4c07f7))[_0x7f43('0x42')](handleError(_0x560c90,null));};exports[_0x7f43('0x43')]=function(_0x42f22c,_0x9548f){var _0x34ba2a={'raw':![],'where':{'id':_0x42f22c['params']['id']}},_0x32fc56={};_0x32fc56[_0x7f43('0x2c')]=_[_0x7f43('0x2e')](db[_0x7f43('0x27')][_0x7f43('0x28')]);_0x32fc56[_0x7f43('0x2d')]=_[_0x7f43('0x2e')](_0x42f22c['query']);_0x32fc56['filters']=_['intersection'](_0x32fc56['model'],_0x32fc56[_0x7f43('0x2d')]);_0x34ba2a[_0x7f43('0x30')]=_[_0x7f43('0x2f')](_0x32fc56[_0x7f43('0x2c')],qs[_0x7f43('0x31')](_0x42f22c[_0x7f43('0x2d')][_0x7f43('0x31')]));_0x34ba2a['attributes']=_0x34ba2a[_0x7f43('0x30')]['length']?_0x34ba2a['attributes']:_0x32fc56['model'];if(_0x42f22c[_0x7f43('0x2d')][_0x7f43('0x3e')]){_0x34ba2a['include']=[{'all':!![]}];}_0x34ba2a=_['merge']({},_0x34ba2a,_0x42f22c[_0x7f43('0x3c')]);return db['ZohoConfiguration'][_0x7f43('0x44')](_0x34ba2a)[_0x7f43('0x3d')](handleEntityNotFound(_0x9548f,null))['then'](respondWithResult(_0x9548f,null))['catch'](handleError(_0x9548f,null));};exports[_0x7f43('0x45')]=function(_0x239211,_0x397789){return db['ZohoConfiguration']['create'](_0x239211[_0x7f43('0x46')],{})[_0x7f43('0x3d')](respondWithResult(_0x397789,0xc9))['catch'](handleError(_0x397789,null));};exports[_0x7f43('0x47')]=function(_0x469f09,_0x366b77){if(_0x469f09['body']['id']){delete _0x469f09['body']['id'];}return db[_0x7f43('0x27')]['find']({'where':{'id':_0x469f09['params']['id']}})[_0x7f43('0x3d')](handleEntityNotFound(_0x366b77,null))[_0x7f43('0x3d')](saveUpdates(_0x469f09[_0x7f43('0x46')],null))[_0x7f43('0x3d')](respondWithResult(_0x366b77,null))[_0x7f43('0x42')](handleError(_0x366b77,null));};exports[_0x7f43('0x20')]=function(_0x35bb01,_0x3902a1){return db[_0x7f43('0x27')][_0x7f43('0x44')]({'where':{'id':_0x35bb01[_0x7f43('0x48')]['id']}})['then'](handleEntityNotFound(_0x3902a1,null))[_0x7f43('0x3d')](removeEntity(_0x3902a1,null))[_0x7f43('0x42')](handleError(_0x3902a1,null));};exports[_0x7f43('0x49')]=function(_0x1a6d51,_0x283793,_0x2fd1b7){var _0x4a730e={};var _0x83d227={};var _0x4dc62d;var _0x29fc2d;return db[_0x7f43('0x27')][_0x7f43('0x4a')]({'where':{'id':_0x1a6d51[_0x7f43('0x48')]['id']}})[_0x7f43('0x3d')](handleEntityNotFound(_0x283793,null))[_0x7f43('0x3d')](function(_0x53f0e6){if(_0x53f0e6){_0x4dc62d=_0x53f0e6;_0x83d227['model']=_[_0x7f43('0x2e')](db[_0x7f43('0x4b')][_0x7f43('0x28')]);_0x83d227[_0x7f43('0x2d')]=_[_0x7f43('0x2e')](_0x1a6d51[_0x7f43('0x2d')]);_0x83d227[_0x7f43('0x37')]=_['intersection'](_0x83d227['model'],_0x83d227[_0x7f43('0x2d')]);_0x4a730e['attributes']=_['intersection'](_0x83d227[_0x7f43('0x2c')],qs['fields'](_0x1a6d51[_0x7f43('0x2d')][_0x7f43('0x31')]));_0x4a730e[_0x7f43('0x30')]=_0x4a730e[_0x7f43('0x30')][_0x7f43('0x4c')]?_0x4a730e[_0x7f43('0x30')]:_0x83d227[_0x7f43('0x2c')];_0x4a730e[_0x7f43('0x34')]=qs['sort'](_0x1a6d51[_0x7f43('0x2d')]['sort']);_0x4a730e[_0x7f43('0x38')]=qs[_0x7f43('0x37')](_[_0x7f43('0x36')](_0x1a6d51[_0x7f43('0x2d')],_0x83d227['filters']));if(_0x1a6d51[_0x7f43('0x2d')][_0x7f43('0x3b')]){_0x4a730e['where']=_[_0x7f43('0x39')](_0x4a730e[_0x7f43('0x38')],{'$or':_[_0x7f43('0x26')](_0x4a730e[_0x7f43('0x30')],function(_0x473081){var _0x2d9122={};_0x2d9122[_0x473081]={'$like':'%'+_0x1a6d51[_0x7f43('0x2d')][_0x7f43('0x3b')]+'%'};return _0x2d9122;})});}_0x4a730e=_[_0x7f43('0x39')]({},_0x4a730e,_0x1a6d51[_0x7f43('0x3c')]);return _0x4dc62d[_0x7f43('0x49')](_0x4a730e);}})[_0x7f43('0x3d')](function(_0x35ea7e){if(_0x35ea7e){_0x29fc2d=_0x35ea7e['length'];if(!_0x1a6d51[_0x7f43('0x2d')][_0x7f43('0x32')](_0x7f43('0x33'))){_0x4a730e[_0x7f43('0x1c')]=qs[_0x7f43('0x1c')](_0x1a6d51[_0x7f43('0x2d')][_0x7f43('0x1c')]);_0x4a730e[_0x7f43('0x1a')]=qs['offset'](_0x1a6d51[_0x7f43('0x2d')]['offset']);}return _0x4dc62d[_0x7f43('0x49')](_0x4a730e);}})[_0x7f43('0x3d')](function(_0x278747){if(_0x278747){return _0x278747?{'count':_0x29fc2d,'rows':_0x278747}:null;}})[_0x7f43('0x3d')](respondWithResult(_0x283793,null))[_0x7f43('0x42')](handleError(_0x283793,null));};exports[_0x7f43('0x4d')]=function(_0x51662c,_0x56c314,_0x4645d7){var _0x6f8528={};var _0x2e0d3c={};var _0x2bc5cb;var _0x47a4e5;return db[_0x7f43('0x27')]['findOne']({'where':{'id':_0x51662c['params']['id']}})['then'](handleEntityNotFound(_0x56c314,null))[_0x7f43('0x3d')](function(_0x119de3){if(_0x119de3){_0x2bc5cb=_0x119de3;_0x2e0d3c[_0x7f43('0x2c')]=_[_0x7f43('0x2e')](db['ZohoField']['rawAttributes']);_0x2e0d3c['query']=_[_0x7f43('0x2e')](_0x51662c[_0x7f43('0x2d')]);_0x2e0d3c['filters']=_[_0x7f43('0x2f')](_0x2e0d3c[_0x7f43('0x2c')],_0x2e0d3c['query']);_0x6f8528[_0x7f43('0x30')]=_['intersection'](_0x2e0d3c[_0x7f43('0x2c')],qs['fields'](_0x51662c[_0x7f43('0x2d')][_0x7f43('0x31')]));_0x6f8528[_0x7f43('0x30')]=_0x6f8528[_0x7f43('0x30')][_0x7f43('0x4c')]?_0x6f8528[_0x7f43('0x30')]:_0x2e0d3c[_0x7f43('0x2c')];_0x6f8528[_0x7f43('0x34')]=qs[_0x7f43('0x35')](_0x51662c[_0x7f43('0x2d')][_0x7f43('0x35')]);_0x6f8528[_0x7f43('0x38')]=qs[_0x7f43('0x37')](_['pick'](_0x51662c['query'],_0x2e0d3c[_0x7f43('0x37')]));if(_0x51662c[_0x7f43('0x2d')][_0x7f43('0x3b')]){_0x6f8528['where']=_[_0x7f43('0x39')](_0x6f8528[_0x7f43('0x38')],{'$or':_[_0x7f43('0x26')](_0x6f8528[_0x7f43('0x30')],function(_0x1858a1){var _0xc21173={};_0xc21173[_0x1858a1]={'$like':'%'+_0x51662c[_0x7f43('0x2d')]['filter']+'%'};return _0xc21173;})});}_0x6f8528=_[_0x7f43('0x39')]({},_0x6f8528,_0x51662c['options']);return _0x2bc5cb[_0x7f43('0x4d')](_0x6f8528);}})[_0x7f43('0x3d')](function(_0x3c96da){if(_0x3c96da){_0x47a4e5=_0x3c96da[_0x7f43('0x4c')];if(!_0x51662c['query'][_0x7f43('0x32')](_0x7f43('0x33'))){_0x6f8528[_0x7f43('0x1c')]=qs[_0x7f43('0x1c')](_0x51662c[_0x7f43('0x2d')]['limit']);_0x6f8528[_0x7f43('0x1a')]=qs[_0x7f43('0x1a')](_0x51662c[_0x7f43('0x2d')][_0x7f43('0x1a')]);}return _0x2bc5cb['getSubjects'](_0x6f8528);}})[_0x7f43('0x3d')](function(_0x26b7d7){if(_0x26b7d7){return _0x26b7d7?{'count':_0x47a4e5,'rows':_0x26b7d7}:null;}})['then'](respondWithResult(_0x56c314,null))[_0x7f43('0x42')](handleError(_0x56c314,null));};exports[_0x7f43('0x4e')]=function(_0x5946cc,_0x412700,_0x256865){var _0x32eb0f={};var _0x748367={};var _0x2cf4ed;var _0xce2631;return db[_0x7f43('0x27')]['findOne']({'where':{'id':_0x5946cc[_0x7f43('0x48')]['id']}})[_0x7f43('0x3d')](handleEntityNotFound(_0x412700,null))[_0x7f43('0x3d')](function(_0x135fe7){if(_0x135fe7){_0x2cf4ed=_0x135fe7;_0x748367[_0x7f43('0x2c')]=_[_0x7f43('0x2e')](db[_0x7f43('0x4b')][_0x7f43('0x28')]);_0x748367[_0x7f43('0x2d')]=_[_0x7f43('0x2e')](_0x5946cc[_0x7f43('0x2d')]);_0x748367[_0x7f43('0x37')]=_[_0x7f43('0x2f')](_0x748367[_0x7f43('0x2c')],_0x748367['query']);_0x32eb0f[_0x7f43('0x30')]=_[_0x7f43('0x2f')](_0x748367[_0x7f43('0x2c')],qs['fields'](_0x5946cc[_0x7f43('0x2d')][_0x7f43('0x31')]));_0x32eb0f[_0x7f43('0x30')]=_0x32eb0f[_0x7f43('0x30')][_0x7f43('0x4c')]?_0x32eb0f['attributes']:_0x748367[_0x7f43('0x2c')];_0x32eb0f['order']=qs[_0x7f43('0x35')](_0x5946cc[_0x7f43('0x2d')][_0x7f43('0x35')]);_0x32eb0f[_0x7f43('0x38')]=qs[_0x7f43('0x37')](_[_0x7f43('0x36')](_0x5946cc['query'],_0x748367['filters']));if(_0x5946cc['query'][_0x7f43('0x3b')]){_0x32eb0f[_0x7f43('0x38')]=_['merge'](_0x32eb0f[_0x7f43('0x38')],{'$or':_[_0x7f43('0x26')](_0x32eb0f[_0x7f43('0x30')],function(_0xf2a2bf){var _0x4b1128={};_0x4b1128[_0xf2a2bf]={'$like':'%'+_0x5946cc[_0x7f43('0x2d')][_0x7f43('0x3b')]+'%'};return _0x4b1128;})});}_0x32eb0f=_[_0x7f43('0x39')]({},_0x32eb0f,_0x5946cc[_0x7f43('0x3c')]);return _0x2cf4ed[_0x7f43('0x4e')](_0x32eb0f);}})[_0x7f43('0x3d')](function(_0x4e451d){if(_0x4e451d){_0xce2631=_0x4e451d[_0x7f43('0x4c')];if(!_0x5946cc['query'][_0x7f43('0x32')](_0x7f43('0x33'))){_0x32eb0f[_0x7f43('0x1c')]=qs['limit'](_0x5946cc[_0x7f43('0x2d')][_0x7f43('0x1c')]);_0x32eb0f[_0x7f43('0x1a')]=qs[_0x7f43('0x1a')](_0x5946cc['query']['offset']);}return _0x2cf4ed[_0x7f43('0x4e')](_0x32eb0f);}})['then'](function(_0x18753e){if(_0x18753e){return _0x18753e?{'count':_0xce2631,'rows':_0x18753e}:null;}})[_0x7f43('0x3d')](respondWithResult(_0x412700,null))['catch'](handleError(_0x412700,null));};
\ No newline at end of file
+var _0xa047=['model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','type','options','ZohoConfiguration','includeAll','include','findAll','rows','show','rawAttributes','catch','create','update','body','find','params','destroy','getFields','findOne','ZohoField','filter','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','error','stack','name','send','map','fieldName','key'];(function(_0x1b87fb,_0x3e6870){var _0xc7de31=function(_0x4eaded){while(--_0x4eaded){_0x1b87fb['push'](_0x1b87fb['shift']());}};_0xc7de31(++_0x3e6870);}(_0xa047,0x118));var _0x7a04=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xa047[_0x59ee41];return _0x3ecd3e;};'use strict';var emlformat=require(_0x7a04('0x0'));var rimraf=require(_0x7a04('0x1'));var zipdir=require(_0x7a04('0x2'));var jsonpatch=require(_0x7a04('0x3'));var rp=require(_0x7a04('0x4'));var moment=require('moment');var BPromise=require(_0x7a04('0x5'));var Mustache=require('mustache');var util=require(_0x7a04('0x6'));var path=require('path');var sox=require(_0x7a04('0x7'));var csv=require(_0x7a04('0x8'));var ejs=require(_0x7a04('0x9'));var fs=require('fs');var fs_extra=require(_0x7a04('0xa'));var _=require(_0x7a04('0xb'));var squel=require(_0x7a04('0xc'));var crypto=require(_0x7a04('0xd'));var jsforce=require(_0x7a04('0xe'));var deskjs=require(_0x7a04('0xf'));var toCsv=require(_0x7a04('0x8'));var querystring=require(_0x7a04('0x10'));var Papa=require('papaparse');var Redis=require(_0x7a04('0x11'));var authService=require(_0x7a04('0x12'));var qs=require(_0x7a04('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a04('0x14'));var logger=require(_0x7a04('0x15'))(_0x7a04('0x16'));var utils=require(_0x7a04('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x225e54,_0x25f296){_0x25f296=_0x25f296||0xcc;return function(_0x3a63a2){if(_0x3a63a2){return _0x225e54[_0x7a04('0x18')](_0x25f296);}return _0x225e54[_0x7a04('0x19')](_0x25f296)[_0x7a04('0x1a')]();};}function respondWithResult(_0x4e0d52,_0x276920){_0x276920=_0x276920||0xc8;return function(_0x364d97){if(_0x364d97){return _0x4e0d52[_0x7a04('0x19')](_0x276920)[_0x7a04('0x1b')](_0x364d97);}};}function respondWithFilteredResult(_0x1b868a,_0x20ca2c){return function(_0x11f52b){if(_0x11f52b){var _0x16d404=typeof _0x20ca2c[_0x7a04('0x1c')]===_0x7a04('0x1d')&&typeof _0x20ca2c['limit']===_0x7a04('0x1d');var _0x168695=_0x11f52b[_0x7a04('0x1e')];var _0x591e29=_0x16d404?0x0:_0x20ca2c[_0x7a04('0x1c')];var _0x4750f9=_0x16d404?_0x11f52b['count']:_0x20ca2c['offset']+_0x20ca2c[_0x7a04('0x1f')];var _0x1538d6;if(_0x4750f9>=_0x168695){_0x4750f9=_0x168695;_0x1538d6=0xc8;}else{_0x1538d6=0xce;}_0x1b868a[_0x7a04('0x19')](_0x1538d6);return _0x1b868a[_0x7a04('0x20')](_0x7a04('0x21'),_0x591e29+'-'+_0x4750f9+'/'+_0x168695)['json'](_0x11f52b);}return null;};}function patchUpdates(_0x5d9d1c){return function(_0x13bbf2){try{jsonpatch[_0x7a04('0x22')](_0x13bbf2,_0x5d9d1c,!![]);}catch(_0x3505dd){return BPromise[_0x7a04('0x23')](_0x3505dd);}return _0x13bbf2['save']();};}function saveUpdates(_0x21d220,_0x46f437){return function(_0x49c54b){if(_0x49c54b){return _0x49c54b['update'](_0x21d220)[_0x7a04('0x24')](function(_0x32e327){return _0x32e327;});}return null;};}function removeEntity(_0x126dfa,_0x557208){return function(_0x5b46d9){if(_0x5b46d9){return _0x5b46d9['destroy']()['then'](function(){_0x126dfa[_0x7a04('0x19')](0xcc)[_0x7a04('0x1a')]();});}};}function handleEntityNotFound(_0x87df87,_0x554085){return function(_0x304b07){if(!_0x304b07){_0x87df87[_0x7a04('0x18')](0x194);}return _0x304b07;};}function handleError(_0x494b4e,_0xe246e){_0xe246e=_0xe246e||0x1f4;return function(_0x1dfc95){logger[_0x7a04('0x25')](_0x1dfc95[_0x7a04('0x26')]);if(_0x1dfc95[_0x7a04('0x27')]){delete _0x1dfc95[_0x7a04('0x27')];}_0x494b4e['status'](_0xe246e)[_0x7a04('0x28')](_0x1dfc95);};}exports['index']=function(_0x31555f,_0x3a0953){var _0x341d21={},_0x48a0c0={},_0x91cdb1={'count':0x0,'rows':[]};var _0x6911cf=_[_0x7a04('0x29')](db['ZohoConfiguration']['rawAttributes'],function(_0x5cbcef){return{'name':_0x5cbcef[_0x7a04('0x2a')],'type':_0x5cbcef['type'][_0x7a04('0x2b')]};});_0x48a0c0[_0x7a04('0x2c')]=_[_0x7a04('0x29')](_0x6911cf,_0x7a04('0x27'));_0x48a0c0[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x31555f[_0x7a04('0x2d')]);_0x48a0c0[_0x7a04('0x2f')]=_['intersection'](_0x48a0c0[_0x7a04('0x2c')],_0x48a0c0[_0x7a04('0x2d')]);_0x341d21[_0x7a04('0x30')]=_[_0x7a04('0x31')](_0x48a0c0['model'],qs[_0x7a04('0x32')](_0x31555f[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x341d21[_0x7a04('0x30')]=_0x341d21['attributes'][_0x7a04('0x33')]?_0x341d21[_0x7a04('0x30')]:_0x48a0c0['model'];if(!_0x31555f['query']['hasOwnProperty'](_0x7a04('0x34'))){_0x341d21[_0x7a04('0x1f')]=qs[_0x7a04('0x1f')](_0x31555f['query'][_0x7a04('0x1f')]);_0x341d21[_0x7a04('0x1c')]=qs[_0x7a04('0x1c')](_0x31555f[_0x7a04('0x2d')][_0x7a04('0x1c')]);}_0x341d21[_0x7a04('0x35')]=qs[_0x7a04('0x36')](_0x31555f[_0x7a04('0x2d')][_0x7a04('0x36')]);_0x341d21['where']=qs[_0x7a04('0x2f')](_[_0x7a04('0x37')](_0x31555f[_0x7a04('0x2d')],_0x48a0c0[_0x7a04('0x2f')]),_0x6911cf);if(_0x31555f[_0x7a04('0x2d')]['filter']){_0x341d21[_0x7a04('0x38')]=_[_0x7a04('0x39')](_0x341d21['where'],{'$or':_['map'](_0x6911cf,function(_0x47d8cf){if(_0x47d8cf[_0x7a04('0x3a')]!=='VIRTUAL'){var _0x543b5f={};_0x543b5f[_0x47d8cf['name']]={'$like':'%'+_0x31555f['query']['filter']+'%'};return _0x543b5f;}})});}_0x341d21=_[_0x7a04('0x39')]({},_0x341d21,_0x31555f[_0x7a04('0x3b')]);var _0x21cc81={'where':_0x341d21[_0x7a04('0x38')]};return db[_0x7a04('0x3c')]['count'](_0x21cc81)[_0x7a04('0x24')](function(_0x4af2d4){_0x91cdb1[_0x7a04('0x1e')]=_0x4af2d4;if(_0x31555f[_0x7a04('0x2d')][_0x7a04('0x3d')]){_0x341d21[_0x7a04('0x3e')]=[{'all':!![]}];}return db[_0x7a04('0x3c')][_0x7a04('0x3f')](_0x341d21);})[_0x7a04('0x24')](function(_0x1358d9){_0x91cdb1[_0x7a04('0x40')]=_0x1358d9;return _0x91cdb1;})[_0x7a04('0x24')](respondWithFilteredResult(_0x3a0953,_0x341d21))['catch'](handleError(_0x3a0953,null));};exports[_0x7a04('0x41')]=function(_0xc6fecb,_0x3794fd){var _0x38c75b={'raw':![],'where':{'id':_0xc6fecb['params']['id']}},_0x3401ed={};_0x3401ed[_0x7a04('0x2c')]=_[_0x7a04('0x2e')](db[_0x7a04('0x3c')][_0x7a04('0x42')]);_0x3401ed[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0xc6fecb[_0x7a04('0x2d')]);_0x3401ed[_0x7a04('0x2f')]=_[_0x7a04('0x31')](_0x3401ed['model'],_0x3401ed[_0x7a04('0x2d')]);_0x38c75b[_0x7a04('0x30')]=_[_0x7a04('0x31')](_0x3401ed[_0x7a04('0x2c')],qs[_0x7a04('0x32')](_0xc6fecb[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x38c75b[_0x7a04('0x30')]=_0x38c75b['attributes'][_0x7a04('0x33')]?_0x38c75b['attributes']:_0x3401ed['model'];if(_0xc6fecb[_0x7a04('0x2d')][_0x7a04('0x3d')]){_0x38c75b[_0x7a04('0x3e')]=[{'all':!![]}];}_0x38c75b=_[_0x7a04('0x39')]({},_0x38c75b,_0xc6fecb[_0x7a04('0x3b')]);return db[_0x7a04('0x3c')]['find'](_0x38c75b)[_0x7a04('0x24')](handleEntityNotFound(_0x3794fd,null))[_0x7a04('0x24')](respondWithResult(_0x3794fd,null))[_0x7a04('0x43')](handleError(_0x3794fd,null));};exports['create']=function(_0x1fb21f,_0x4417d1){return db[_0x7a04('0x3c')][_0x7a04('0x44')](_0x1fb21f['body'],{})[_0x7a04('0x24')](respondWithResult(_0x4417d1,0xc9))[_0x7a04('0x43')](handleError(_0x4417d1,null));};exports[_0x7a04('0x45')]=function(_0x344ea3,_0x868991){if(_0x344ea3[_0x7a04('0x46')]['id']){delete _0x344ea3['body']['id'];}return db[_0x7a04('0x3c')][_0x7a04('0x47')]({'where':{'id':_0x344ea3[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x868991,null))[_0x7a04('0x24')](saveUpdates(_0x344ea3['body'],null))[_0x7a04('0x24')](respondWithResult(_0x868991,null))['catch'](handleError(_0x868991,null));};exports[_0x7a04('0x49')]=function(_0x3d1276,_0x2f4814){return db['ZohoConfiguration']['find']({'where':{'id':_0x3d1276['params']['id']}})['then'](handleEntityNotFound(_0x2f4814,null))['then'](removeEntity(_0x2f4814,null))[_0x7a04('0x43')](handleError(_0x2f4814,null));};exports[_0x7a04('0x4a')]=function(_0x3deac3,_0x375241,_0x385fa1){var _0x1edc17={};var _0x247dcc={};var _0x57867f;var _0x52d38a;return db[_0x7a04('0x3c')][_0x7a04('0x4b')]({'where':{'id':_0x3deac3['params']['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x375241,null))[_0x7a04('0x24')](function(_0x28fb37){if(_0x28fb37){_0x57867f=_0x28fb37;_0x247dcc[_0x7a04('0x2c')]=_[_0x7a04('0x2e')](db[_0x7a04('0x4c')][_0x7a04('0x42')]);_0x247dcc['query']=_[_0x7a04('0x2e')](_0x3deac3['query']);_0x247dcc[_0x7a04('0x2f')]=_[_0x7a04('0x31')](_0x247dcc['model'],_0x247dcc[_0x7a04('0x2d')]);_0x1edc17[_0x7a04('0x30')]=_[_0x7a04('0x31')](_0x247dcc[_0x7a04('0x2c')],qs['fields'](_0x3deac3['query'][_0x7a04('0x32')]));_0x1edc17[_0x7a04('0x30')]=_0x1edc17[_0x7a04('0x30')][_0x7a04('0x33')]?_0x1edc17[_0x7a04('0x30')]:_0x247dcc[_0x7a04('0x2c')];_0x1edc17['order']=qs[_0x7a04('0x36')](_0x3deac3[_0x7a04('0x2d')][_0x7a04('0x36')]);_0x1edc17['where']=qs['filters'](_[_0x7a04('0x37')](_0x3deac3[_0x7a04('0x2d')],_0x247dcc[_0x7a04('0x2f')]));if(_0x3deac3[_0x7a04('0x2d')][_0x7a04('0x4d')]){_0x1edc17['where']=_[_0x7a04('0x39')](_0x1edc17[_0x7a04('0x38')],{'$or':_['map'](_0x1edc17[_0x7a04('0x30')],function(_0x11c839){var _0x456c15={};_0x456c15[_0x11c839]={'$like':'%'+_0x3deac3['query']['filter']+'%'};return _0x456c15;})});}_0x1edc17=_[_0x7a04('0x39')]({},_0x1edc17,_0x3deac3[_0x7a04('0x3b')]);return _0x57867f['getFields'](_0x1edc17);}})[_0x7a04('0x24')](function(_0x25a1ed){if(_0x25a1ed){_0x52d38a=_0x25a1ed[_0x7a04('0x33')];if(!_0x3deac3[_0x7a04('0x2d')][_0x7a04('0x4e')](_0x7a04('0x34'))){_0x1edc17['limit']=qs['limit'](_0x3deac3[_0x7a04('0x2d')][_0x7a04('0x1f')]);_0x1edc17[_0x7a04('0x1c')]=qs['offset'](_0x3deac3[_0x7a04('0x2d')][_0x7a04('0x1c')]);}return _0x57867f[_0x7a04('0x4a')](_0x1edc17);}})[_0x7a04('0x24')](function(_0xcd2d31){if(_0xcd2d31){return _0xcd2d31?{'count':_0x52d38a,'rows':_0xcd2d31}:null;}})[_0x7a04('0x24')](respondWithResult(_0x375241,null))['catch'](handleError(_0x375241,null));};exports[_0x7a04('0x4f')]=function(_0x2dd417,_0x6bd7ac,_0x2306e6){var _0x35b3d2={};var _0x222202={};var _0x101353;var _0x18d824;return db[_0x7a04('0x3c')][_0x7a04('0x4b')]({'where':{'id':_0x2dd417[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x6bd7ac,null))[_0x7a04('0x24')](function(_0x37332e){if(_0x37332e){_0x101353=_0x37332e;_0x222202['model']=_['keys'](db[_0x7a04('0x4c')][_0x7a04('0x42')]);_0x222202[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x2dd417[_0x7a04('0x2d')]);_0x222202[_0x7a04('0x2f')]=_['intersection'](_0x222202[_0x7a04('0x2c')],_0x222202[_0x7a04('0x2d')]);_0x35b3d2[_0x7a04('0x30')]=_[_0x7a04('0x31')](_0x222202[_0x7a04('0x2c')],qs['fields'](_0x2dd417[_0x7a04('0x2d')]['fields']));_0x35b3d2[_0x7a04('0x30')]=_0x35b3d2[_0x7a04('0x30')][_0x7a04('0x33')]?_0x35b3d2['attributes']:_0x222202['model'];_0x35b3d2[_0x7a04('0x35')]=qs['sort'](_0x2dd417['query']['sort']);_0x35b3d2[_0x7a04('0x38')]=qs[_0x7a04('0x2f')](_[_0x7a04('0x37')](_0x2dd417[_0x7a04('0x2d')],_0x222202[_0x7a04('0x2f')]));if(_0x2dd417[_0x7a04('0x2d')]['filter']){_0x35b3d2[_0x7a04('0x38')]=_[_0x7a04('0x39')](_0x35b3d2[_0x7a04('0x38')],{'$or':_[_0x7a04('0x29')](_0x35b3d2[_0x7a04('0x30')],function(_0x4b52a4){var _0x552458={};_0x552458[_0x4b52a4]={'$like':'%'+_0x2dd417[_0x7a04('0x2d')]['filter']+'%'};return _0x552458;})});}_0x35b3d2=_[_0x7a04('0x39')]({},_0x35b3d2,_0x2dd417[_0x7a04('0x3b')]);return _0x101353['getSubjects'](_0x35b3d2);}})['then'](function(_0x1a5fec){if(_0x1a5fec){_0x18d824=_0x1a5fec[_0x7a04('0x33')];if(!_0x2dd417[_0x7a04('0x2d')][_0x7a04('0x4e')](_0x7a04('0x34'))){_0x35b3d2[_0x7a04('0x1f')]=qs[_0x7a04('0x1f')](_0x2dd417['query'][_0x7a04('0x1f')]);_0x35b3d2[_0x7a04('0x1c')]=qs['offset'](_0x2dd417[_0x7a04('0x2d')]['offset']);}return _0x101353[_0x7a04('0x4f')](_0x35b3d2);}})[_0x7a04('0x24')](function(_0x3eee19){if(_0x3eee19){return _0x3eee19?{'count':_0x18d824,'rows':_0x3eee19}:null;}})['then'](respondWithResult(_0x6bd7ac,null))[_0x7a04('0x43')](handleError(_0x6bd7ac,null));};exports[_0x7a04('0x50')]=function(_0x45882a,_0x3c394b,_0x48492b){var _0x39807d={};var _0x4ca4be={};var _0x1e9247;var _0x47ccef;return db[_0x7a04('0x3c')][_0x7a04('0x4b')]({'where':{'id':_0x45882a[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x3c394b,null))[_0x7a04('0x24')](function(_0x34db7f){if(_0x34db7f){_0x1e9247=_0x34db7f;_0x4ca4be[_0x7a04('0x2c')]=_['keys'](db[_0x7a04('0x4c')][_0x7a04('0x42')]);_0x4ca4be[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x45882a[_0x7a04('0x2d')]);_0x4ca4be['filters']=_[_0x7a04('0x31')](_0x4ca4be[_0x7a04('0x2c')],_0x4ca4be[_0x7a04('0x2d')]);_0x39807d['attributes']=_[_0x7a04('0x31')](_0x4ca4be['model'],qs[_0x7a04('0x32')](_0x45882a[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x39807d[_0x7a04('0x30')]=_0x39807d['attributes'][_0x7a04('0x33')]?_0x39807d[_0x7a04('0x30')]:_0x4ca4be[_0x7a04('0x2c')];_0x39807d[_0x7a04('0x35')]=qs[_0x7a04('0x36')](_0x45882a['query'][_0x7a04('0x36')]);_0x39807d['where']=qs['filters'](_[_0x7a04('0x37')](_0x45882a[_0x7a04('0x2d')],_0x4ca4be[_0x7a04('0x2f')]));if(_0x45882a[_0x7a04('0x2d')][_0x7a04('0x4d')]){_0x39807d[_0x7a04('0x38')]=_[_0x7a04('0x39')](_0x39807d[_0x7a04('0x38')],{'$or':_[_0x7a04('0x29')](_0x39807d[_0x7a04('0x30')],function(_0x54d3db){var _0x4ddf01={};_0x4ddf01[_0x54d3db]={'$like':'%'+_0x45882a['query']['filter']+'%'};return _0x4ddf01;})});}_0x39807d=_['merge']({},_0x39807d,_0x45882a[_0x7a04('0x3b')]);return _0x1e9247[_0x7a04('0x50')](_0x39807d);}})['then'](function(_0x2293a9){if(_0x2293a9){_0x47ccef=_0x2293a9[_0x7a04('0x33')];if(!_0x45882a[_0x7a04('0x2d')][_0x7a04('0x4e')]('nolimit')){_0x39807d[_0x7a04('0x1f')]=qs[_0x7a04('0x1f')](_0x45882a[_0x7a04('0x2d')][_0x7a04('0x1f')]);_0x39807d[_0x7a04('0x1c')]=qs[_0x7a04('0x1c')](_0x45882a[_0x7a04('0x2d')][_0x7a04('0x1c')]);}return _0x1e9247['getDescriptions'](_0x39807d);}})[_0x7a04('0x24')](function(_0x4c258f){if(_0x4c258f){return _0x4c258f?{'count':_0x47ccef,'rows':_0x4c258f}:null;}})[_0x7a04('0x24')](respondWithResult(_0x3c394b,null))[_0x7a04('0x43')](handleError(_0x3c394b,null));};
\ No newline at end of file
index 88b8bca..378393c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01dc=['./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1cdc88,_0x126aba){var _0x175c63=function(_0x56f3c8){while(--_0x56f3c8){_0x1cdc88['push'](_0x1cdc88['shift']());}};_0x175c63(++_0x126aba);}(_0x01dc,0x92));var _0xc01d=function(_0x272014,_0x11a8c2){_0x272014=_0x272014-0x0;var _0x3004a1=_0x01dc[_0x272014];return _0x3004a1;};'use strict';var _=require(_0xc01d('0x0'));var util=require(_0xc01d('0x1'));var logger=require(_0xc01d('0x2'))('api');var moment=require(_0xc01d('0x3'));var BPromise=require(_0xc01d('0x4'));var rp=require(_0xc01d('0x5'));var fs=require('fs');var path=require(_0xc01d('0x6'));var rimraf=require('rimraf');var config=require(_0xc01d('0x7'));var attributes=require(_0xc01d('0x8'));module['exports']=function(_0x39c4b2,_0x92831){return _0x39c4b2['define'](_0xc01d('0x9'),attributes,{'tableName':_0xc01d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0326=['exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0326,0x1a7));var _0x6032=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x0326[_0x3b2369];return _0x5a1367;};'use strict';var _=require(_0x6032('0x0'));var util=require(_0x6032('0x1'));var logger=require(_0x6032('0x2'))(_0x6032('0x3'));var moment=require(_0x6032('0x4'));var BPromise=require(_0x6032('0x5'));var rp=require(_0x6032('0x6'));var fs=require('fs');var path=require(_0x6032('0x7'));var rimraf=require(_0x6032('0x8'));var config=require(_0x6032('0x9'));var attributes=require(_0x6032('0xa'));module[_0x6032('0xb')]=function(_0x21b75b,_0x91bf58){return _0x21b75b['define'](_0x6032('0xc'),attributes,{'tableName':_0x6032('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 317b43b..6943e12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e7=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','rpc','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x231092,_0x3db2e2){var _0x526b7b=function(_0xbf4040){while(--_0xbf4040){_0x231092['push'](_0x231092['shift']());}};_0x526b7b(++_0x3db2e2);}(_0x74e7,0x182));var _0x774e=function(_0x334b47,_0x1ee0d0){_0x334b47=_0x334b47-0x0;var _0x212805=_0x74e7[_0x334b47];return _0x212805;};'use strict';var _=require(_0x774e('0x0'));var util=require(_0x774e('0x1'));var moment=require(_0x774e('0x2'));var BPromise=require(_0x774e('0x3'));var rs=require(_0x774e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x774e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x774e('0x6')][_0x774e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28a169,_0x46b0d0,_0x4bf691){return new BPromise(function(_0x5caa48,_0x485150){return client[_0x774e('0x8')](_0x28a169,_0x4bf691)['then'](function(_0x1474ae){logger[_0x774e('0x9')](_0x774e('0xa'),_0x46b0d0,_0x774e('0xb'));logger['debug'](_0x774e('0xc'),_0x46b0d0,_0x774e('0xb'),JSON[_0x774e('0xd')](_0x1474ae));if(_0x1474ae[_0x774e('0xe')]){if(_0x1474ae[_0x774e('0xe')][_0x774e('0xf')]===0x1f4){logger[_0x774e('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x46b0d0,_0x1474ae[_0x774e('0xe')][_0x774e('0x10')]);return _0x485150(_0x1474ae[_0x774e('0xe')]['message']);}logger['error'](_0x774e('0xa'),_0x46b0d0,_0x1474ae[_0x774e('0xe')][_0x774e('0x10')]);return _0x5caa48(_0x1474ae['error'][_0x774e('0x10')]);}else{logger[_0x774e('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x46b0d0,'request\x20sent');_0x5caa48(_0x1474ae[_0x774e('0x11')][_0x774e('0x10')]);}})[_0x774e('0x12')](function(_0x506494){logger[_0x774e('0xe')](_0x774e('0xa'),_0x46b0d0,_0x506494);_0x485150(_0x506494);});});}
\ No newline at end of file
+var _0x60e3=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x60e3,0xef));var _0x360e=function(_0x1224c7,_0x1c31a8){_0x1224c7=_0x1224c7-0x0;var _0x489483=_0x60e3[_0x1224c7];return _0x489483;};'use strict';var _=require(_0x360e('0x0'));var util=require(_0x360e('0x1'));var moment=require(_0x360e('0x2'));var BPromise=require(_0x360e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x360e('0x4'))['db'];var utils=require(_0x360e('0x5'));var logger=require(_0x360e('0x6'))(_0x360e('0x7'));var config=require(_0x360e('0x8'));var jayson=require(_0x360e('0x9'));var client=jayson[_0x360e('0xa')][_0x360e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59f790,_0x87d4b4,_0x572baf){return new BPromise(function(_0x5bc228,_0x450fea){return client[_0x360e('0xc')](_0x59f790,_0x572baf)[_0x360e('0xd')](function(_0x5a0f9b){logger[_0x360e('0xe')](_0x360e('0xf'),_0x87d4b4,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x87d4b4,_0x360e('0x10'),JSON[_0x360e('0x11')](_0x5a0f9b));if(_0x5a0f9b[_0x360e('0x12')]){if(_0x5a0f9b[_0x360e('0x12')][_0x360e('0x13')]===0x1f4){logger[_0x360e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x87d4b4,_0x5a0f9b[_0x360e('0x12')]['message']);return _0x450fea(_0x5a0f9b[_0x360e('0x12')][_0x360e('0x14')]);}logger[_0x360e('0x12')](_0x360e('0xf'),_0x87d4b4,_0x5a0f9b[_0x360e('0x12')][_0x360e('0x14')]);return _0x5bc228(_0x5a0f9b[_0x360e('0x12')]['message']);}else{logger[_0x360e('0xe')](_0x360e('0xf'),_0x87d4b4,_0x360e('0x10'));_0x5bc228(_0x5a0f9b[_0x360e('0x15')][_0x360e('0x14')]);}})[_0x360e('0x16')](function(_0x259dd){logger[_0x360e('0x12')](_0x360e('0xf'),_0x87d4b4,_0x259dd);_0x450fea(_0x259dd);});});}
\ No newline at end of file
index c80f96d..fc56a47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fbf=['delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0fbf,0xb7));var _0xf0fb=function(_0x15172a,_0x10b8e6){_0x15172a=_0x15172a-0x0;var _0x293677=_0x0fbf[_0x15172a];return _0x293677;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0fb('0x0'));var timeout=require('connect-timeout');var express=require(_0xf0fb('0x1'));var router=express[_0xf0fb('0x2')]();var fs_extra=require(_0xf0fb('0x3'));var auth=require(_0xf0fb('0x4'));var interaction=require(_0xf0fb('0x5'));var config=require(_0xf0fb('0x6'));var controller=require(_0xf0fb('0x7'));router[_0xf0fb('0x8')]('/',auth[_0xf0fb('0x9')](),controller[_0xf0fb('0xa')]);router['get'](_0xf0fb('0xb'),auth['isAuthenticated'](),controller[_0xf0fb('0xc')]);router[_0xf0fb('0xd')]('/',auth[_0xf0fb('0x9')](),controller['create']);router[_0xf0fb('0xe')](_0xf0fb('0xb'),auth[_0xf0fb('0x9')](),controller['update']);router[_0xf0fb('0xf')](_0xf0fb('0xb'),auth[_0xf0fb('0x9')](),controller[_0xf0fb('0x10')]);module[_0xf0fb('0x11')]=router;
\ No newline at end of file
+var _0x6432=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x63b22,_0x54be3e){var _0x14f429=function(_0x296faf){while(--_0x296faf){_0x63b22['push'](_0x63b22['shift']());}};_0x14f429(++_0x54be3e);}(_0x6432,0x150));var _0x2643=function(_0x5a12d3,_0x16a29a){_0x5a12d3=_0x5a12d3-0x0;var _0x28ab88=_0x6432[_0x5a12d3];return _0x28ab88;};'use strict';var multer=require(_0x2643('0x0'));var util=require(_0x2643('0x1'));var path=require(_0x2643('0x2'));var timeout=require('connect-timeout');var express=require(_0x2643('0x3'));var router=express[_0x2643('0x4')]();var fs_extra=require(_0x2643('0x5'));var auth=require(_0x2643('0x6'));var interaction=require(_0x2643('0x7'));var config=require(_0x2643('0x8'));var controller=require(_0x2643('0x9'));router[_0x2643('0xa')]('/',auth[_0x2643('0xb')](),controller[_0x2643('0xc')]);router[_0x2643('0xa')](_0x2643('0xd'),auth[_0x2643('0xb')](),controller[_0x2643('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2643('0xf')]);router[_0x2643('0x10')](_0x2643('0xd'),auth['isAuthenticated'](),controller[_0x2643('0x11')]);router[_0x2643('0x12')](_0x2643('0xd'),auth[_0x2643('0xb')](),controller[_0x2643('0x13')]);module[_0x2643('0x14')]=router;
\ No newline at end of file
index 723a516..a585829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x828f=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x556b1d,_0xa0f67e){var _0x346381=function(_0x31a455){while(--_0x31a455){_0x556b1d['push'](_0x556b1d['shift']());}};_0x346381(++_0xa0f67e);}(_0x828f,0x196));var _0xf828=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x828f[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0xf828('0x0'));module[_0xf828('0x1')]={'type':{'type':Sequelize[_0xf828('0x2')](_0xf828('0x3'),_0xf828('0x4'),_0xf828('0x5'),_0xf828('0x6'),_0xf828('0x7')),'defaultValue':_0xf828('0x3')},'content':{'type':Sequelize[_0xf828('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf828('0x3'),'variable',_0xf828('0x5'))},'keyContent':{'type':Sequelize[_0xf828('0x8')]},'idField':{'type':Sequelize[_0xf828('0x8')]},'nameField':{'type':Sequelize[_0xf828('0x8')]},'customField':{'type':Sequelize[_0xf828('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf828('0x8')]}};
\ No newline at end of file
+var _0x981c=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','picklist'];(function(_0x53dfb6,_0x1fd19b){var _0x5abc60=function(_0x519fb8){while(--_0x519fb8){_0x53dfb6['push'](_0x53dfb6['shift']());}};_0x5abc60(++_0x1fd19b);}(_0x981c,0xe4));var _0xc981=function(_0x57fd68,_0x4ec961){_0x57fd68=_0x57fd68-0x0;var _0x509109=_0x981c[_0x57fd68];return _0x509109;};'use strict';var Sequelize=require(_0xc981('0x0'));module[_0xc981('0x1')]={'type':{'type':Sequelize[_0xc981('0x2')](_0xc981('0x3'),'variable',_0xc981('0x4'),'keyValue',_0xc981('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc981('0x6')]},'key':{'type':Sequelize[_0xc981('0x6')]},'keyType':{'type':Sequelize[_0xc981('0x2')](_0xc981('0x3'),_0xc981('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xc981('0x6')]},'idField':{'type':Sequelize[_0xc981('0x6')]},'nameField':{'type':Sequelize[_0xc981('0x6')]},'customField':{'type':Sequelize[_0xc981('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc981('0x6')]}};
\ No newline at end of file
index 4d1dac6..fb44059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b94=['set','Content-Range','reject','update','then','error','stack','name','send','map','ZohoField','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x18890e,_0x50bdd9){var _0x4216a7=function(_0x5e9061){while(--_0x5e9061){_0x18890e['push'](_0x18890e['shift']());}};_0x4216a7(++_0x50bdd9);}(_0x3b94,0xb3));var _0x43b9=function(_0x433358,_0x20353a){_0x433358=_0x433358-0x0;var _0x55d824=_0x3b94[_0x433358];return _0x55d824;};'use strict';var emlformat=require(_0x43b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43b9('0x1'));var jsonpatch=require(_0x43b9('0x2'));var rp=require(_0x43b9('0x3'));var moment=require(_0x43b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x43b9('0x5'));var util=require('util');var path=require(_0x43b9('0x6'));var sox=require('sox');var csv=require(_0x43b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43b9('0x8'));var _=require(_0x43b9('0x9'));var squel=require(_0x43b9('0xa'));var crypto=require(_0x43b9('0xb'));var jsforce=require(_0x43b9('0xc'));var deskjs=require(_0x43b9('0xd'));var toCsv=require(_0x43b9('0x7'));var querystring=require(_0x43b9('0xe'));var Papa=require(_0x43b9('0xf'));var Redis=require('ioredis');var authService=require(_0x43b9('0x10'));var qs=require(_0x43b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43b9('0x12'));var logger=require(_0x43b9('0x13'))(_0x43b9('0x14'));var utils=require(_0x43b9('0x15'));var config=require(_0x43b9('0x16'));var licenseUtil=require(_0x43b9('0x17'));var db=require(_0x43b9('0x18'))['db'];function respondWithStatusCode(_0x43abdb,_0x22ad83){_0x22ad83=_0x22ad83||0xcc;return function(_0x3821d8){if(_0x3821d8){return _0x43abdb[_0x43b9('0x19')](_0x22ad83);}return _0x43abdb[_0x43b9('0x1a')](_0x22ad83)[_0x43b9('0x1b')]();};}function respondWithResult(_0x1aef77,_0xc1b8f5){_0xc1b8f5=_0xc1b8f5||0xc8;return function(_0x4413f0){if(_0x4413f0){return _0x1aef77[_0x43b9('0x1a')](_0xc1b8f5)['json'](_0x4413f0);}};}function respondWithFilteredResult(_0x53d974,_0x3df370){return function(_0x3bd84f){if(_0x3bd84f){var _0xbeb065=typeof _0x3df370[_0x43b9('0x1c')]===_0x43b9('0x1d')&&typeof _0x3df370['limit']==='undefined';var _0x49aa8f=_0x3bd84f[_0x43b9('0x1e')];var _0x4a8982=_0xbeb065?0x0:_0x3df370['offset'];var _0x5053b2=_0xbeb065?_0x3bd84f[_0x43b9('0x1e')]:_0x3df370[_0x43b9('0x1c')]+_0x3df370['limit'];var _0x2f8bb7;if(_0x5053b2>=_0x49aa8f){_0x5053b2=_0x49aa8f;_0x2f8bb7=0xc8;}else{_0x2f8bb7=0xce;}_0x53d974['status'](_0x2f8bb7);return _0x53d974[_0x43b9('0x1f')](_0x43b9('0x20'),_0x4a8982+'-'+_0x5053b2+'/'+_0x49aa8f)['json'](_0x3bd84f);}return null;};}function patchUpdates(_0x58f5a2){return function(_0x5a97fc){try{jsonpatch['apply'](_0x5a97fc,_0x58f5a2,!![]);}catch(_0x492727){return BPromise[_0x43b9('0x21')](_0x492727);}return _0x5a97fc['save']();};}function saveUpdates(_0x296660,_0x5db5c5){return function(_0x2a6393){if(_0x2a6393){return _0x2a6393[_0x43b9('0x22')](_0x296660)[_0x43b9('0x23')](function(_0x336e2b){return _0x336e2b;});}return null;};}function removeEntity(_0x5218a8,_0x3730b4){return function(_0x12e02e){if(_0x12e02e){return _0x12e02e['destroy']()['then'](function(){_0x5218a8[_0x43b9('0x1a')](0xcc)[_0x43b9('0x1b')]();});}};}function handleEntityNotFound(_0x5f4988,_0x5aed84){return function(_0x1d17c5){if(!_0x1d17c5){_0x5f4988[_0x43b9('0x19')](0x194);}return _0x1d17c5;};}function handleError(_0x1ebf63,_0x5de910){_0x5de910=_0x5de910||0x1f4;return function(_0x8d1ee8){logger[_0x43b9('0x24')](_0x8d1ee8[_0x43b9('0x25')]);if(_0x8d1ee8['name']){delete _0x8d1ee8[_0x43b9('0x26')];}_0x1ebf63['status'](_0x5de910)[_0x43b9('0x27')](_0x8d1ee8);};}exports['index']=function(_0x471c3d,_0x30ecb4){var _0x116890={},_0x15f536={},_0x28e9dc={'count':0x0,'rows':[]};var _0x40f14d=_[_0x43b9('0x28')](db[_0x43b9('0x29')][_0x43b9('0x2a')],function(_0x1f76b0){return{'name':_0x1f76b0['fieldName'],'type':_0x1f76b0[_0x43b9('0x2b')][_0x43b9('0x2c')]};});_0x15f536[_0x43b9('0x2d')]=_[_0x43b9('0x28')](_0x40f14d,_0x43b9('0x26'));_0x15f536['query']=_[_0x43b9('0x2e')](_0x471c3d['query']);_0x15f536[_0x43b9('0x2f')]=_[_0x43b9('0x30')](_0x15f536['model'],_0x15f536['query']);_0x116890[_0x43b9('0x31')]=_['intersection'](_0x15f536[_0x43b9('0x2d')],qs[_0x43b9('0x32')](_0x471c3d[_0x43b9('0x33')][_0x43b9('0x32')]));_0x116890[_0x43b9('0x31')]=_0x116890[_0x43b9('0x31')]['length']?_0x116890['attributes']:_0x15f536['model'];if(!_0x471c3d['query']['hasOwnProperty'](_0x43b9('0x34'))){_0x116890[_0x43b9('0x35')]=qs['limit'](_0x471c3d[_0x43b9('0x33')]['limit']);_0x116890[_0x43b9('0x1c')]=qs['offset'](_0x471c3d[_0x43b9('0x33')]['offset']);}_0x116890['order']=qs[_0x43b9('0x36')](_0x471c3d[_0x43b9('0x33')][_0x43b9('0x36')]);_0x116890[_0x43b9('0x37')]=qs[_0x43b9('0x2f')](_[_0x43b9('0x38')](_0x471c3d[_0x43b9('0x33')],_0x15f536[_0x43b9('0x2f')]),_0x40f14d);if(_0x471c3d[_0x43b9('0x33')][_0x43b9('0x39')]){_0x116890['where']=_[_0x43b9('0x3a')](_0x116890[_0x43b9('0x37')],{'$or':_['map'](_0x40f14d,function(_0x311a87){if(_0x311a87['type']!==_0x43b9('0x3b')){var _0xcaf8e0={};_0xcaf8e0[_0x311a87['name']]={'$like':'%'+_0x471c3d['query'][_0x43b9('0x39')]+'%'};return _0xcaf8e0;}})});}_0x116890=_[_0x43b9('0x3a')]({},_0x116890,_0x471c3d[_0x43b9('0x3c')]);var _0x5a32ec={'where':_0x116890[_0x43b9('0x37')]};return db['ZohoField']['count'](_0x5a32ec)[_0x43b9('0x23')](function(_0xfa6a8c){_0x28e9dc[_0x43b9('0x1e')]=_0xfa6a8c;if(_0x471c3d[_0x43b9('0x33')]['includeAll']){_0x116890[_0x43b9('0x3d')]=[{'all':!![]}];}return db['ZohoField'][_0x43b9('0x3e')](_0x116890);})[_0x43b9('0x23')](function(_0x1858f0){_0x28e9dc['rows']=_0x1858f0;return _0x28e9dc;})[_0x43b9('0x23')](respondWithFilteredResult(_0x30ecb4,_0x116890))[_0x43b9('0x3f')](handleError(_0x30ecb4,null));};exports[_0x43b9('0x40')]=function(_0x7224d0,_0x212890){var _0x1b86b3={'raw':!![],'where':{'id':_0x7224d0[_0x43b9('0x41')]['id']}},_0x323a0d={};_0x323a0d[_0x43b9('0x2d')]=_['keys'](db[_0x43b9('0x29')][_0x43b9('0x2a')]);_0x323a0d[_0x43b9('0x33')]=_[_0x43b9('0x2e')](_0x7224d0[_0x43b9('0x33')]);_0x323a0d['filters']=_['intersection'](_0x323a0d['model'],_0x323a0d['query']);_0x1b86b3[_0x43b9('0x31')]=_[_0x43b9('0x30')](_0x323a0d[_0x43b9('0x2d')],qs[_0x43b9('0x32')](_0x7224d0['query']['fields']));_0x1b86b3[_0x43b9('0x31')]=_0x1b86b3['attributes']['length']?_0x1b86b3[_0x43b9('0x31')]:_0x323a0d[_0x43b9('0x2d')];if(_0x7224d0[_0x43b9('0x33')]['includeAll']){_0x1b86b3[_0x43b9('0x3d')]=[{'all':!![]}];}_0x1b86b3=_[_0x43b9('0x3a')]({},_0x1b86b3,_0x7224d0[_0x43b9('0x3c')]);return db['ZohoField']['find'](_0x1b86b3)[_0x43b9('0x23')](handleEntityNotFound(_0x212890,null))[_0x43b9('0x23')](respondWithResult(_0x212890,null))[_0x43b9('0x3f')](handleError(_0x212890,null));};exports[_0x43b9('0x42')]=function(_0x49b747,_0x3c27ac){return db[_0x43b9('0x29')][_0x43b9('0x42')](_0x49b747['body'],{})[_0x43b9('0x23')](respondWithResult(_0x3c27ac,0xc9))[_0x43b9('0x3f')](handleError(_0x3c27ac,null));};exports[_0x43b9('0x22')]=function(_0x5f721,_0x4125f2){if(_0x5f721[_0x43b9('0x43')]['id']){delete _0x5f721[_0x43b9('0x43')]['id'];}return db[_0x43b9('0x29')][_0x43b9('0x44')]({'where':{'id':_0x5f721[_0x43b9('0x41')]['id']}})[_0x43b9('0x23')](handleEntityNotFound(_0x4125f2,null))['then'](saveUpdates(_0x5f721['body'],null))['then'](respondWithResult(_0x4125f2,null))[_0x43b9('0x3f')](handleError(_0x4125f2,null));};exports[_0x43b9('0x45')]=function(_0x57335f,_0xd955){return db[_0x43b9('0x29')][_0x43b9('0x44')]({'where':{'id':_0x57335f[_0x43b9('0x41')]['id']}})['then'](handleEntityNotFound(_0xd955,null))[_0x43b9('0x23')](removeEntity(_0xd955,null))[_0x43b9('0x3f')](handleError(_0xd955,null));};
\ No newline at end of file
+var _0x731b=['key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','then','name','index','map','ZohoField','type'];(function(_0x3a6c2a,_0x3e9d6e){var _0x3f0ff4=function(_0x58210f){while(--_0x58210f){_0x3a6c2a['push'](_0x3a6c2a['shift']());}};_0x3f0ff4(++_0x3e9d6e);}(_0x731b,0xf7));var _0xb731=function(_0x596c6f,_0x3a8b1e){_0x596c6f=_0x596c6f-0x0;var _0x27ef30=_0x731b[_0x596c6f];return _0x27ef30;};'use strict';var emlformat=require(_0xb731('0x0'));var rimraf=require(_0xb731('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb731('0x2'));var rp=require(_0xb731('0x3'));var moment=require(_0xb731('0x4'));var BPromise=require(_0xb731('0x5'));var Mustache=require(_0xb731('0x6'));var util=require(_0xb731('0x7'));var path=require('path');var sox=require(_0xb731('0x8'));var csv=require(_0xb731('0x9'));var ejs=require(_0xb731('0xa'));var fs=require('fs');var fs_extra=require(_0xb731('0xb'));var _=require(_0xb731('0xc'));var squel=require(_0xb731('0xd'));var crypto=require(_0xb731('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb731('0xf'));var toCsv=require(_0xb731('0x9'));var querystring=require(_0xb731('0x10'));var Papa=require(_0xb731('0x11'));var Redis=require(_0xb731('0x12'));var authService=require(_0xb731('0x13'));var qs=require(_0xb731('0x14'));var as=require(_0xb731('0x15'));var hardwareService=require(_0xb731('0x16'));var logger=require(_0xb731('0x17'))(_0xb731('0x18'));var utils=require(_0xb731('0x19'));var config=require(_0xb731('0x1a'));var licenseUtil=require(_0xb731('0x1b'));var db=require(_0xb731('0x1c'))['db'];function respondWithStatusCode(_0x5899e0,_0x36bac7){_0x36bac7=_0x36bac7||0xcc;return function(_0x5f4f12){if(_0x5f4f12){return _0x5899e0[_0xb731('0x1d')](_0x36bac7);}return _0x5899e0[_0xb731('0x1e')](_0x36bac7)[_0xb731('0x1f')]();};}function respondWithResult(_0x5b668d,_0x12d9c6){_0x12d9c6=_0x12d9c6||0xc8;return function(_0x4b433a){if(_0x4b433a){return _0x5b668d['status'](_0x12d9c6)['json'](_0x4b433a);}};}function respondWithFilteredResult(_0x3662e0,_0x29cb36){return function(_0x4962e8){if(_0x4962e8){var _0x47829e=typeof _0x29cb36[_0xb731('0x20')]==='undefined'&&typeof _0x29cb36[_0xb731('0x21')]===_0xb731('0x22');var _0x35baac=_0x4962e8[_0xb731('0x23')];var _0x4e0c6d=_0x47829e?0x0:_0x29cb36[_0xb731('0x20')];var _0x1eaaf7=_0x47829e?_0x4962e8[_0xb731('0x23')]:_0x29cb36[_0xb731('0x20')]+_0x29cb36['limit'];var _0x1f9de6;if(_0x1eaaf7>=_0x35baac){_0x1eaaf7=_0x35baac;_0x1f9de6=0xc8;}else{_0x1f9de6=0xce;}_0x3662e0['status'](_0x1f9de6);return _0x3662e0['set'](_0xb731('0x24'),_0x4e0c6d+'-'+_0x1eaaf7+'/'+_0x35baac)['json'](_0x4962e8);}return null;};}function patchUpdates(_0x396997){return function(_0x1b47cb){try{jsonpatch[_0xb731('0x25')](_0x1b47cb,_0x396997,!![]);}catch(_0x36374e){return BPromise[_0xb731('0x26')](_0x36374e);}return _0x1b47cb['save']();};}function saveUpdates(_0x5670f5,_0x16fabf){return function(_0x3e4623){if(_0x3e4623){return _0x3e4623['update'](_0x5670f5)['then'](function(_0x12a0df){return _0x12a0df;});}return null;};}function removeEntity(_0x4ed3ce,_0x1f6bc3){return function(_0x15be09){if(_0x15be09){return _0x15be09['destroy']()[_0xb731('0x27')](function(){_0x4ed3ce[_0xb731('0x1e')](0xcc)[_0xb731('0x1f')]();});}};}function handleEntityNotFound(_0x29944a,_0x5d30e1){return function(_0x9fabd8){if(!_0x9fabd8){_0x29944a[_0xb731('0x1d')](0x194);}return _0x9fabd8;};}function handleError(_0x1bf4af,_0x21efff){_0x21efff=_0x21efff||0x1f4;return function(_0x17ab32){logger['error'](_0x17ab32['stack']);if(_0x17ab32[_0xb731('0x28')]){delete _0x17ab32[_0xb731('0x28')];}_0x1bf4af['status'](_0x21efff)['send'](_0x17ab32);};}exports[_0xb731('0x29')]=function(_0x5e4a21,_0x41f8d3){var _0x4fbad1={},_0x16eead={},_0x32a863={'count':0x0,'rows':[]};var _0xc14f79=_[_0xb731('0x2a')](db[_0xb731('0x2b')]['rawAttributes'],function(_0x53ba29){return{'name':_0x53ba29['fieldName'],'type':_0x53ba29[_0xb731('0x2c')][_0xb731('0x2d')]};});_0x16eead[_0xb731('0x2e')]=_['map'](_0xc14f79,_0xb731('0x28'));_0x16eead['query']=_[_0xb731('0x2f')](_0x5e4a21[_0xb731('0x30')]);_0x16eead['filters']=_[_0xb731('0x31')](_0x16eead[_0xb731('0x2e')],_0x16eead['query']);_0x4fbad1[_0xb731('0x32')]=_[_0xb731('0x31')](_0x16eead[_0xb731('0x2e')],qs[_0xb731('0x33')](_0x5e4a21[_0xb731('0x30')][_0xb731('0x33')]));_0x4fbad1[_0xb731('0x32')]=_0x4fbad1['attributes'][_0xb731('0x34')]?_0x4fbad1[_0xb731('0x32')]:_0x16eead[_0xb731('0x2e')];if(!_0x5e4a21[_0xb731('0x30')][_0xb731('0x35')](_0xb731('0x36'))){_0x4fbad1[_0xb731('0x21')]=qs[_0xb731('0x21')](_0x5e4a21[_0xb731('0x30')][_0xb731('0x21')]);_0x4fbad1[_0xb731('0x20')]=qs[_0xb731('0x20')](_0x5e4a21[_0xb731('0x30')][_0xb731('0x20')]);}_0x4fbad1[_0xb731('0x37')]=qs[_0xb731('0x38')](_0x5e4a21[_0xb731('0x30')][_0xb731('0x38')]);_0x4fbad1['where']=qs[_0xb731('0x39')](_['pick'](_0x5e4a21[_0xb731('0x30')],_0x16eead[_0xb731('0x39')]),_0xc14f79);if(_0x5e4a21[_0xb731('0x30')]['filter']){_0x4fbad1['where']=_[_0xb731('0x3a')](_0x4fbad1[_0xb731('0x3b')],{'$or':_[_0xb731('0x2a')](_0xc14f79,function(_0x5b41b5){if(_0x5b41b5['type']!=='VIRTUAL'){var _0x3187fe={};_0x3187fe[_0x5b41b5[_0xb731('0x28')]]={'$like':'%'+_0x5e4a21[_0xb731('0x30')][_0xb731('0x3c')]+'%'};return _0x3187fe;}})});}_0x4fbad1=_[_0xb731('0x3a')]({},_0x4fbad1,_0x5e4a21[_0xb731('0x3d')]);var _0x41a709={'where':_0x4fbad1[_0xb731('0x3b')]};return db[_0xb731('0x2b')][_0xb731('0x23')](_0x41a709)[_0xb731('0x27')](function(_0xed1e94){_0x32a863[_0xb731('0x23')]=_0xed1e94;if(_0x5e4a21[_0xb731('0x30')][_0xb731('0x3e')]){_0x4fbad1[_0xb731('0x3f')]=[{'all':!![]}];}return db[_0xb731('0x2b')][_0xb731('0x40')](_0x4fbad1);})[_0xb731('0x27')](function(_0x373f07){_0x32a863[_0xb731('0x41')]=_0x373f07;return _0x32a863;})[_0xb731('0x27')](respondWithFilteredResult(_0x41f8d3,_0x4fbad1))[_0xb731('0x42')](handleError(_0x41f8d3,null));};exports['show']=function(_0x43e9ca,_0x1cba5b){var _0x17a085={'raw':!![],'where':{'id':_0x43e9ca['params']['id']}},_0x2078d1={};_0x2078d1['model']=_[_0xb731('0x2f')](db[_0xb731('0x2b')][_0xb731('0x43')]);_0x2078d1[_0xb731('0x30')]=_[_0xb731('0x2f')](_0x43e9ca[_0xb731('0x30')]);_0x2078d1[_0xb731('0x39')]=_['intersection'](_0x2078d1[_0xb731('0x2e')],_0x2078d1[_0xb731('0x30')]);_0x17a085[_0xb731('0x32')]=_['intersection'](_0x2078d1[_0xb731('0x2e')],qs[_0xb731('0x33')](_0x43e9ca[_0xb731('0x30')][_0xb731('0x33')]));_0x17a085[_0xb731('0x32')]=_0x17a085[_0xb731('0x32')][_0xb731('0x34')]?_0x17a085[_0xb731('0x32')]:_0x2078d1[_0xb731('0x2e')];if(_0x43e9ca['query']['includeAll']){_0x17a085[_0xb731('0x3f')]=[{'all':!![]}];}_0x17a085=_[_0xb731('0x3a')]({},_0x17a085,_0x43e9ca[_0xb731('0x3d')]);return db[_0xb731('0x2b')][_0xb731('0x44')](_0x17a085)[_0xb731('0x27')](handleEntityNotFound(_0x1cba5b,null))[_0xb731('0x27')](respondWithResult(_0x1cba5b,null))[_0xb731('0x42')](handleError(_0x1cba5b,null));};exports['create']=function(_0x5eb0ce,_0x18fdd5){return db[_0xb731('0x2b')][_0xb731('0x45')](_0x5eb0ce[_0xb731('0x46')],{})['then'](respondWithResult(_0x18fdd5,0xc9))[_0xb731('0x42')](handleError(_0x18fdd5,null));};exports['update']=function(_0x301d34,_0x37ab96){if(_0x301d34['body']['id']){delete _0x301d34['body']['id'];}return db[_0xb731('0x2b')]['find']({'where':{'id':_0x301d34[_0xb731('0x47')]['id']}})[_0xb731('0x27')](handleEntityNotFound(_0x37ab96,null))[_0xb731('0x27')](saveUpdates(_0x301d34['body'],null))[_0xb731('0x27')](respondWithResult(_0x37ab96,null))[_0xb731('0x42')](handleError(_0x37ab96,null));};exports[_0xb731('0x48')]=function(_0x3c4785,_0x2df6e4){return db['ZohoField'][_0xb731('0x44')]({'where':{'id':_0x3c4785['params']['id']}})['then'](handleEntityNotFound(_0x2df6e4,null))[_0xb731('0x27')](removeEntity(_0x2df6e4,null))[_0xb731('0x42')](handleError(_0x2df6e4,null));};
\ No newline at end of file
index 6ab14ca..96ae399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','int_zoho_fields','zoho_unique_index','lodash','util','../../config/logger'];(function(_0x55391f,_0x4f5c06){var _0x4cf117=function(_0x5c5c87){while(--_0x5c5c87){_0x55391f['push'](_0x55391f['shift']());}};_0x4cf117(++_0x4f5c06);}(_0xd943,0x15d));var _0x3d94=function(_0x2b73e8,_0x21fd8f){_0x2b73e8=_0x2b73e8-0x0;var _0x1ca5c3=_0xd943[_0x2b73e8];return _0x1ca5c3;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('ZohoField',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a6b=['int_zoho_fields','zoho_unique_index','lodash','moment','request-promise','path','rimraf','./intZohoField.attributes','ZohoField'];(function(_0x1bad6f,_0x5ae873){var _0x29bb2e=function(_0xf062d5){while(--_0xf062d5){_0x1bad6f['push'](_0x1bad6f['shift']());}};_0x29bb2e(++_0x5ae873);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x596283,_0x37e664){_0x596283=_0x596283-0x0;var _0x3546a0=_0x0a6b[_0x596283];return _0x3546a0;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'paranoid':![],'indexes':[{'name':_0xb0a6('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 347b21d..4ab844c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe598=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x119a07,_0x2289f6){var _0x36025c=function(_0xf28f4){while(--_0xf28f4){_0x119a07['push'](_0x119a07['shift']());}};_0x36025c(++_0x2289f6);}(_0xe598,0x123));var _0x8e59=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xe598[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0x8e59('0x0'));var util=require(_0x8e59('0x1'));var moment=require(_0x8e59('0x2'));var BPromise=require(_0x8e59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e59('0x4'));var db=require(_0x8e59('0x5'))['db'];var utils=require(_0x8e59('0x6'));var logger=require(_0x8e59('0x7'))(_0x8e59('0x8'));var config=require('../../config/environment');var jayson=require(_0x8e59('0x9'));var client=jayson[_0x8e59('0xa')][_0x8e59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4511af,_0x39e09e,_0x25cef6){return new BPromise(function(_0xbb6f52,_0x211533){return client[_0x8e59('0xc')](_0x4511af,_0x25cef6)[_0x8e59('0xd')](function(_0xda220a){logger[_0x8e59('0xe')](_0x8e59('0xf'),_0x39e09e,'request\x20sent');logger[_0x8e59('0x10')](_0x8e59('0x11'),_0x39e09e,_0x8e59('0x12'),JSON[_0x8e59('0x13')](_0xda220a));if(_0xda220a[_0x8e59('0x14')]){if(_0xda220a['error'][_0x8e59('0x15')]===0x1f4){logger[_0x8e59('0x14')]('ZohoField,\x20%s,\x20%s',_0x39e09e,_0xda220a[_0x8e59('0x14')]['message']);return _0x211533(_0xda220a[_0x8e59('0x14')][_0x8e59('0x16')]);}logger[_0x8e59('0x14')](_0x8e59('0xf'),_0x39e09e,_0xda220a[_0x8e59('0x14')]['message']);return _0xbb6f52(_0xda220a[_0x8e59('0x14')][_0x8e59('0x16')]);}else{logger[_0x8e59('0xe')](_0x8e59('0xf'),_0x39e09e,_0x8e59('0x12'));_0xbb6f52(_0xda220a['result'][_0x8e59('0x16')]);}})[_0x8e59('0x17')](function(_0x1409ab){logger['error'](_0x8e59('0xf'),_0x39e09e,_0x1409ab);_0x211533(_0x1409ab);});});}
\ No newline at end of file
+var _0x003a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x556410,_0x508cc8){var _0x415e7f=function(_0x43c1d5){while(--_0x43c1d5){_0x556410['push'](_0x556410['shift']());}};_0x415e7f(++_0x508cc8);}(_0x003a,0xa2));var _0xa003=function(_0x687334,_0x45ca77){_0x687334=_0x687334-0x0;var _0x5ef3b7=_0x003a[_0x687334];return _0x5ef3b7;};'use strict';var _=require(_0xa003('0x0'));var util=require(_0xa003('0x1'));var moment=require(_0xa003('0x2'));var BPromise=require(_0xa003('0x3'));var rs=require(_0xa003('0x4'));var fs=require('fs');var Redis=require(_0xa003('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa003('0x6'))(_0xa003('0x7'));var config=require(_0xa003('0x8'));var jayson=require(_0xa003('0x9'));var client=jayson[_0xa003('0xa')][_0xa003('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5139e6,_0x117638,_0xf034ea){return new BPromise(function(_0xbb8da2,_0x5c88be){return client[_0xa003('0xc')](_0x5139e6,_0xf034ea)[_0xa003('0xd')](function(_0x3efa77){logger['info'](_0xa003('0xe'),_0x117638,'request\x20sent');logger[_0xa003('0xf')](_0xa003('0x10'),_0x117638,_0xa003('0x11'),JSON[_0xa003('0x12')](_0x3efa77));if(_0x3efa77[_0xa003('0x13')]){if(_0x3efa77['error'][_0xa003('0x14')]===0x1f4){logger[_0xa003('0x13')](_0xa003('0xe'),_0x117638,_0x3efa77['error'][_0xa003('0x15')]);return _0x5c88be(_0x3efa77['error'][_0xa003('0x15')]);}logger[_0xa003('0x13')](_0xa003('0xe'),_0x117638,_0x3efa77[_0xa003('0x13')][_0xa003('0x15')]);return _0xbb8da2(_0x3efa77['error'][_0xa003('0x15')]);}else{logger[_0xa003('0x16')]('ZohoField,\x20%s,\x20%s',_0x117638,_0xa003('0x11'));_0xbb8da2(_0x3efa77[_0xa003('0x17')][_0xa003('0x15')]);}})['catch'](function(_0xa13974){logger[_0xa003('0x13')](_0xa003('0xe'),_0x117638,_0xa13974);_0x5c88be(_0xa13974);});});}
\ No newline at end of file
index 756ce81..abaadab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x71e44b,_0x119946){var _0x30bc2d=function(_0x4af7ad){while(--_0x4af7ad){_0x71e44b['push'](_0x71e44b['shift']());}};_0x30bc2d(++_0x119946);}(_0xe706,0xa3));var _0x6e70=function(_0x62b58e,_0x46fe1e){_0x62b58e=_0x62b58e-0x0;var _0x37fe84=_0xe706[_0x62b58e];return _0x37fe84;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x23d47a,_0x488764){var _0xdf6c26=function(_0x46c276){while(--_0x46c276){_0x23d47a['push'](_0x23d47a['shift']());}};_0xdf6c26(++_0x488764);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xcb91[_0x1b1a3b];return _0x385347;};'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 27e7976..5a6e1d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9628=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x437f60,_0x1bc142){var _0x3e484f=function(_0x47348c){while(--_0x47348c){_0x437f60['push'](_0x437f60['shift']());}};_0x3e484f(++_0x1bc142);}(_0x9628,0x1c2));var _0x8962=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x9628[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x8962('0x0'));module[_0x8962('0x1')]={'name':{'type':Sequelize[_0x8962('0x2')],'allowNull':![],'unique':_0x8962('0x3')},'version':{'type':Sequelize[_0x8962('0x2')],'allowNull':![],'unique':_0x8962('0x3')},'main':{'type':Sequelize[_0x8962('0x2')],'defaultValue':_0x8962('0x4')},'filename':{'type':Sequelize[_0x8962('0x2')]},'path':{'type':Sequelize[_0x8962('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x8962('0x5')]},'active':{'type':Sequelize[_0x8962('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x8962('0x2')]},'state':{'type':Sequelize[_0x8962('0x2')],'unique':_0x8962('0x7')},'description':{'type':Sequelize[_0x8962('0x2')]},'title':{'type':Sequelize[_0x8962('0x2')]},'remoteUri':{'type':Sequelize[_0x8962('0x2')]},'link':{'type':Sequelize[_0x8962('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x3e35=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x3f6f09,_0x1d747a){var _0x459008=function(_0x88090c){while(--_0x88090c){_0x3f6f09['push'](_0x3f6f09['shift']());}};_0x459008(++_0x1d747a);}(_0x3e35,0x1ad));var _0x53e3=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x3e35[_0x3fd3a3];return _0xa3e4d5;};'use strict';var Sequelize=require(_0x53e3('0x0'));module[_0x53e3('0x1')]={'name':{'type':Sequelize[_0x53e3('0x2')],'allowNull':![],'unique':_0x53e3('0x3')},'version':{'type':Sequelize[_0x53e3('0x2')],'allowNull':![],'unique':_0x53e3('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x53e3('0x4')},'filename':{'type':Sequelize[_0x53e3('0x2')]},'path':{'type':Sequelize[_0x53e3('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x53e3('0x5')]},'active':{'type':Sequelize[_0x53e3('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x53e3('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x53e3('0x2')],'unique':_0x53e3('0x7')},'description':{'type':Sequelize[_0x53e3('0x2')]},'title':{'type':Sequelize[_0x53e3('0x2')]},'remoteUri':{'type':Sequelize[_0x53e3('0x2')]},'link':{'type':Sequelize[_0x53e3('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 7d4819c..ffcaf08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Integration','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body'];(function(_0x345db8,_0x22534c){var _0x191f2b=function(_0x232116){while(--_0x232116){_0x345db8['push'](_0x345db8['shift']());}};_0x191f2b(++_0x22534c);}(_0xb016,0x159));var _0x6b01=function(_0x426848,_0x10ce46){_0x426848=_0x426848-0x0;var _0x188e1c=_0xb016[_0x426848];return _0x188e1c;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['Integration'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};
\ No newline at end of file
+var _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x2fce06,_0x910bc1){var _0x559a49=function(_0x37f97d){while(--_0x37f97d){_0x2fce06['push'](_0x2fce06['shift']());}};_0x559a49(++_0x910bc1);}(_0x7096,0x10c));var _0x6709=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x7096[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};
\ No newline at end of file
index 7e56c8e..8eb7a85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ceb=['./integration.attributes','exports','integrations','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x305ae7,_0x3c885c){var _0x156ea5=function(_0x5bb01a){while(--_0x5bb01a){_0x305ae7['push'](_0x305ae7['shift']());}};_0x156ea5(++_0x3c885c);}(_0x9ceb,0xfb));var _0xb9ce=function(_0x5cf18c,_0x111e22){_0x5cf18c=_0x5cf18c-0x0;var _0x1aa773=_0x9ceb[_0x5cf18c];return _0x1aa773;};'use strict';var _=require('lodash');var util=require(_0xb9ce('0x0'));var logger=require(_0xb9ce('0x1'))('api');var moment=require(_0xb9ce('0x2'));var BPromise=require('bluebird');var rp=require(_0xb9ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9ce('0x4'));var config=require('../../config/environment');var attributes=require(_0xb9ce('0x5'));module[_0xb9ce('0x6')]=function(_0x53a9e0,_0x1053cc){return _0x53a9e0['define']('Integration',attributes,{'tableName':_0xb9ce('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a17=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./integration.attributes','exports','define','integrations'];(function(_0x53a56b,_0x465644){var _0x609a4c=function(_0x1d5b5b){while(--_0x1d5b5b){_0x53a56b['push'](_0x53a56b['shift']());}};_0x609a4c(++_0x465644);}(_0x9a17,0x1a4));var _0x79a1=function(_0x8feba0,_0x52423e){_0x8feba0=_0x8feba0-0x0;var _0x2cd346=_0x9a17[_0x8feba0];return _0x2cd346;};'use strict';var _=require(_0x79a1('0x0'));var util=require(_0x79a1('0x1'));var logger=require(_0x79a1('0x2'))(_0x79a1('0x3'));var moment=require(_0x79a1('0x4'));var BPromise=require(_0x79a1('0x5'));var rp=require(_0x79a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x79a1('0x8'));module[_0x79a1('0x9')]=function(_0x21245f,_0x596c31){return _0x21245f[_0x79a1('0xa')]('Integration',attributes,{'tableName':_0x79a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2ddbc8..89859d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x149497,_0x21e2c9){var _0x24d93b=function(_0xc9c087){while(--_0xc9c087){_0x149497['push'](_0x149497['shift']());}};_0x24d93b(++_0x21e2c9);}(_0x9f0e,0x116));var _0xe9f0=function(_0x381c2c,_0x518577){_0x381c2c=_0x381c2c-0x0;var _0x378484=_0x9f0e[_0x381c2c];return _0x378484;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}
\ No newline at end of file
+var _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x4287cb,_0xe75c02){var _0x2b5fd3=function(_0xdb577){while(--_0xdb577){_0x4287cb['push'](_0x4287cb['shift']());}};_0x2b5fd3(++_0xe75c02);}(_0x9f0e,0x116));var _0xe9f0=function(_0x55a009,_0x4ee025){_0x55a009=_0x55a009-0x0;var _0x42d610=_0x9f0e[_0x55a009];return _0x42d610;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}
\ No newline at end of file
index 8df2842..af636cd 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(_0x1eacb3,_0x179115){var _0x7c6ec2=function(_0x247c26){while(--_0x247c26){_0x1eacb3['push'](_0x1eacb3['shift']());}};_0x7c6ec2(++_0x179115);}(_0x2542,0x169));var _0x2254=function(_0x1e88d0,_0x43c435){_0x1e88d0=_0x1e88d0-0x0;var _0x433d90=_0x2542[_0x1e88d0];return _0x433d90;};'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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0xadb5,0xad));var _0x5adb=function(_0x53a04e,_0x4d22c7){_0x53a04e=_0x53a04e-0x0;var _0x43698c=_0xadb5[_0x53a04e];return _0x43698c;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router;
\ No newline at end of file
index 4df3de8..e8d4497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a86=['DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x8a86,0xf9));var _0x68a8=function(_0x2f3f36,_0x46f53f){_0x2f3f36=_0x2f3f36-0x0;var _0x56cc53=_0x8a86[_0x2f3f36];return _0x56cc53;};'use strict';var Sequelize=require(_0x68a8('0x0'));module[_0x68a8('0x1')]={'integration':{'type':Sequelize[_0x68a8('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x68a8('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x68a8('0x3')]},'contacts':{'type':Sequelize[_0x68a8('0x2')]},'uniqueid':{'type':Sequelize[_0x68a8('0x2')]},'calleridnum':{'type':Sequelize[_0x68a8('0x2')]},'calleridname':{'type':Sequelize[_0x68a8('0x2')]},'queue':{'type':Sequelize[_0x68a8('0x2')]},'interface':{'type':Sequelize[_0x68a8('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x68a8('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x68a8('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x68a8('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x68a8('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x68a8('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x68a8('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x68a8('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x68a8('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x68a8('0x2')]},'channelstate':{'type':Sequelize[_0x68a8('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68a8('0x2')]},'connectedlinename':{'type':Sequelize[_0x68a8('0x2')]},'language':{'type':Sequelize[_0x68a8('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x68a8('0x2')]},'exten':{'type':Sequelize[_0x68a8('0x2')]},'priority':{'type':Sequelize[_0x68a8('0x2')]},'destchannel':{'type':Sequelize[_0x68a8('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x68a8('0x2')]},'destcalleridname':{'type':Sequelize[_0x68a8('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68a8('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68a8('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x68a8('0x2')]},'destexten':{'type':Sequelize[_0x68a8('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x68a8('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x68a8('0x2')]},'subject':{'type':Sequelize[_0x68a8('0x2')]},'from':{'type':Sequelize[_0x68a8('0x2')]},'to':{'type':Sequelize[_0x68a8('0x2')]},'cc':{'type':Sequelize[_0x68a8('0x2')]},'attachment':{'type':Sequelize[_0x68a8('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x68a8('0x6')]},'status':{'type':Sequelize[_0x68a8('0x7')](_0x68a8('0x8'),'SENDING',_0x68a8('0x9'),_0x68a8('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x68a8('0x2')]},'appdata':{'type':Sequelize[_0x68a8('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xad66=['TEXT','SENDING','RECEIVED','sequelize','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x3438d7,_0x3b0e09){var _0x4e6c29=function(_0x47c415){while(--_0x47c415){_0x3438d7['push'](_0x3438d7['shift']());}};_0x4e6c29(++_0x3b0e09);}(_0xad66,0x19b));var _0x6ad6=function(_0x2e8a3f,_0x541086){_0x2e8a3f=_0x2e8a3f-0x0;var _0x1f4f80=_0xad66[_0x2e8a3f];return _0x1f4f80;};'use strict';var Sequelize=require(_0x6ad6('0x0'));module['exports']={'integration':{'type':Sequelize[_0x6ad6('0x1')]},'eventChannel':{'type':Sequelize[_0x6ad6('0x1')]},'exitStatus':{'type':Sequelize[_0x6ad6('0x1')]},'ticketId':{'type':Sequelize[_0x6ad6('0x1')]},'integrationId':{'type':Sequelize[_0x6ad6('0x2')]},'contacts':{'type':Sequelize[_0x6ad6('0x1')]},'uniqueid':{'type':Sequelize[_0x6ad6('0x1')]},'calleridnum':{'type':Sequelize[_0x6ad6('0x1')]},'calleridname':{'type':Sequelize[_0x6ad6('0x1')]},'queue':{'type':Sequelize[_0x6ad6('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6ad6('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6ad6('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6ad6('0x3')]},'holdtime':{'type':Sequelize[_0x6ad6('0x2')]},'agentcomplete':{'type':Sequelize[_0x6ad6('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6ad6('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x6ad6('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6ad6('0x3')]},'agentdump':{'type':Sequelize[_0x6ad6('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6ad6('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6ad6('0x1')]},'channelstate':{'type':Sequelize[_0x6ad6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6ad6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6ad6('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6ad6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6ad6('0x1')]},'exten':{'type':Sequelize[_0x6ad6('0x1')]},'priority':{'type':Sequelize[_0x6ad6('0x1')]},'destchannel':{'type':Sequelize[_0x6ad6('0x1')]},'destchannelstate':{'type':Sequelize[_0x6ad6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6ad6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6ad6('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6ad6('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6ad6('0x1')]},'destaccountcode':{'type':Sequelize[_0x6ad6('0x1')]},'destcontext':{'type':Sequelize[_0x6ad6('0x1')]},'destexten':{'type':Sequelize[_0x6ad6('0x1')]},'destpriority':{'type':Sequelize[_0x6ad6('0x1')]},'destuniqueid':{'type':Sequelize[_0x6ad6('0x1')]},'messageId':{'type':Sequelize[_0x6ad6('0x1')]},'inReplyTo':{'type':Sequelize[_0x6ad6('0x1')]},'subject':{'type':Sequelize[_0x6ad6('0x1')]},'from':{'type':Sequelize[_0x6ad6('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x6ad6('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT',_0x6ad6('0x6'),_0x6ad6('0x7'),'FAILED')},'url':{'type':Sequelize[_0x6ad6('0x1')]},'app':{'type':Sequelize[_0x6ad6('0x1')]},'appdata':{'type':Sequelize[_0x6ad6('0x1')]},'projectId':{'type':Sequelize[_0x6ad6('0x2')]}};
\ No newline at end of file
index 27da053..e37626b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f31=['create','body','params','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','IntegrationReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x795024,_0x121da5){var _0x1f5110=function(_0x251a23){while(--_0x251a23){_0x795024['push'](_0x795024['shift']());}};_0x1f5110(++_0x121da5);}(_0x6f31,0x1c0));var _0x16f3=function(_0x112dfd,_0x2100e2){_0x112dfd=_0x112dfd-0x0;var _0x290056=_0x6f31[_0x112dfd];return _0x290056;};'use strict';var emlformat=require(_0x16f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16f3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16f3('0x2'));var moment=require(_0x16f3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x16f3('0x4'));var util=require(_0x16f3('0x5'));var path=require(_0x16f3('0x6'));var sox=require(_0x16f3('0x7'));var csv=require(_0x16f3('0x8'));var ejs=require(_0x16f3('0x9'));var fs=require('fs');var fs_extra=require(_0x16f3('0xa'));var _=require(_0x16f3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x16f3('0xc'));var deskjs=require(_0x16f3('0xd'));var toCsv=require(_0x16f3('0x8'));var querystring=require(_0x16f3('0xe'));var Papa=require(_0x16f3('0xf'));var Redis=require(_0x16f3('0x10'));var authService=require(_0x16f3('0x11'));var qs=require(_0x16f3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f3('0x13'))(_0x16f3('0x14'));var utils=require('../../config/utils');var config=require(_0x16f3('0x15'));var licenseUtil=require(_0x16f3('0x16'));var db=require(_0x16f3('0x17'))['db'];function respondWithStatusCode(_0x485e27,_0xa6e2d4){_0xa6e2d4=_0xa6e2d4||0xcc;return function(_0x5622d1){if(_0x5622d1){return _0x485e27[_0x16f3('0x18')](_0xa6e2d4);}return _0x485e27['status'](_0xa6e2d4)[_0x16f3('0x19')]();};}function respondWithResult(_0x367f4b,_0x25bb59){_0x25bb59=_0x25bb59||0xc8;return function(_0x14c57){if(_0x14c57){return _0x367f4b[_0x16f3('0x1a')](_0x25bb59)[_0x16f3('0x1b')](_0x14c57);}};}function respondWithFilteredResult(_0x26fbd5,_0x74eec1){return function(_0x49405b){if(_0x49405b){var _0x16f625=typeof _0x74eec1[_0x16f3('0x1c')]===_0x16f3('0x1d')&&typeof _0x74eec1[_0x16f3('0x1e')]===_0x16f3('0x1d');var _0x25a0bc=_0x49405b[_0x16f3('0x1f')];var _0x38c4fe=_0x16f625?0x0:_0x74eec1[_0x16f3('0x1c')];var _0x2f6487=_0x16f625?_0x49405b[_0x16f3('0x1f')]:_0x74eec1[_0x16f3('0x1c')]+_0x74eec1[_0x16f3('0x1e')];var _0x2002a0;if(_0x2f6487>=_0x25a0bc){_0x2f6487=_0x25a0bc;_0x2002a0=0xc8;}else{_0x2002a0=0xce;}_0x26fbd5[_0x16f3('0x1a')](_0x2002a0);return _0x26fbd5['set'](_0x16f3('0x20'),_0x38c4fe+'-'+_0x2f6487+'/'+_0x25a0bc)[_0x16f3('0x1b')](_0x49405b);}return null;};}function patchUpdates(_0x3fc35b){return function(_0x30d3ea){try{jsonpatch[_0x16f3('0x21')](_0x30d3ea,_0x3fc35b,!![]);}catch(_0x3cbab8){return BPromise[_0x16f3('0x22')](_0x3cbab8);}return _0x30d3ea[_0x16f3('0x23')]();};}function saveUpdates(_0x23a489,_0x431bd9){return function(_0x26ab0d){if(_0x26ab0d){return _0x26ab0d[_0x16f3('0x24')](_0x23a489)[_0x16f3('0x25')](function(_0x1c3394){return _0x1c3394;});}return null;};}function removeEntity(_0x10734a,_0x2ae32b){return function(_0x45858e){if(_0x45858e){return _0x45858e['destroy']()['then'](function(){_0x10734a[_0x16f3('0x1a')](0xcc)[_0x16f3('0x19')]();});}};}function handleEntityNotFound(_0x3cbe23,_0x56bf35){return function(_0x40439d){if(!_0x40439d){_0x3cbe23[_0x16f3('0x18')](0x194);}return _0x40439d;};}function handleError(_0x5a67f1,_0x575725){_0x575725=_0x575725||0x1f4;return function(_0x1e5689){logger[_0x16f3('0x26')](_0x1e5689['stack']);if(_0x1e5689[_0x16f3('0x27')]){delete _0x1e5689[_0x16f3('0x27')];}_0x5a67f1[_0x16f3('0x1a')](_0x575725)[_0x16f3('0x28')](_0x1e5689);};}exports[_0x16f3('0x29')]=function(_0xabb845,_0x7bd2df){var _0x1f4039={},_0x48fd49={},_0xbf0ba5={'count':0x0,'rows':[]};var _0x2396bf=_['map'](db[_0x16f3('0x2a')][_0x16f3('0x2b')],function(_0x1013cd){return{'name':_0x1013cd['fieldName'],'type':_0x1013cd[_0x16f3('0x2c')][_0x16f3('0x2d')]};});_0x48fd49[_0x16f3('0x2e')]=_['map'](_0x2396bf,_0x16f3('0x27'));_0x48fd49['query']=_[_0x16f3('0x2f')](_0xabb845[_0x16f3('0x30')]);_0x48fd49[_0x16f3('0x31')]=_[_0x16f3('0x32')](_0x48fd49[_0x16f3('0x2e')],_0x48fd49['query']);_0x1f4039[_0x16f3('0x33')]=_[_0x16f3('0x32')](_0x48fd49[_0x16f3('0x2e')],qs[_0x16f3('0x34')](_0xabb845[_0x16f3('0x30')]['fields']));_0x1f4039[_0x16f3('0x33')]=_0x1f4039[_0x16f3('0x33')][_0x16f3('0x35')]?_0x1f4039[_0x16f3('0x33')]:_0x48fd49[_0x16f3('0x2e')];if(!_0xabb845[_0x16f3('0x30')]['hasOwnProperty'](_0x16f3('0x36'))){_0x1f4039[_0x16f3('0x1e')]=qs[_0x16f3('0x1e')](_0xabb845[_0x16f3('0x30')][_0x16f3('0x1e')]);_0x1f4039['offset']=qs[_0x16f3('0x1c')](_0xabb845[_0x16f3('0x30')][_0x16f3('0x1c')]);}_0x1f4039[_0x16f3('0x37')]=qs['sort'](_0xabb845[_0x16f3('0x30')]['sort']);_0x1f4039[_0x16f3('0x38')]=qs[_0x16f3('0x31')](_[_0x16f3('0x39')](_0xabb845['query'],_0x48fd49[_0x16f3('0x31')]),_0x2396bf);if(_0xabb845['query'][_0x16f3('0x3a')]){_0x1f4039[_0x16f3('0x38')]=_['merge'](_0x1f4039[_0x16f3('0x38')],{'$or':_[_0x16f3('0x3b')](_0x2396bf,function(_0x5e41eb){if(_0x5e41eb[_0x16f3('0x2c')]!==_0x16f3('0x3c')){var _0x256d70={};_0x256d70[_0x5e41eb[_0x16f3('0x27')]]={'$like':'%'+_0xabb845['query']['filter']+'%'};return _0x256d70;}})});}_0x1f4039=_[_0x16f3('0x3d')]({},_0x1f4039,_0xabb845[_0x16f3('0x3e')]);var _0x2a5b4b={'where':_0x1f4039[_0x16f3('0x38')]};return db[_0x16f3('0x2a')][_0x16f3('0x1f')](_0x2a5b4b)['then'](function(_0x5816d8){_0xbf0ba5[_0x16f3('0x1f')]=_0x5816d8;if(_0xabb845[_0x16f3('0x30')][_0x16f3('0x3f')]){_0x1f4039[_0x16f3('0x40')]=[{'all':!![]}];}return db[_0x16f3('0x2a')][_0x16f3('0x41')](_0x1f4039);})['then'](function(_0x2b3fba){_0xbf0ba5[_0x16f3('0x42')]=_0x2b3fba;return _0xbf0ba5;})['then'](respondWithFilteredResult(_0x7bd2df,_0x1f4039))[_0x16f3('0x43')](handleError(_0x7bd2df,null));};exports[_0x16f3('0x44')]=function(_0x3552d5,_0x578be7){var _0x215163={'raw':![],'where':{'id':_0x3552d5['params']['id']}},_0x483eb2={};_0x483eb2['model']=_[_0x16f3('0x2f')](db[_0x16f3('0x2a')]['rawAttributes']);_0x483eb2[_0x16f3('0x30')]=_[_0x16f3('0x2f')](_0x3552d5[_0x16f3('0x30')]);_0x483eb2['filters']=_[_0x16f3('0x32')](_0x483eb2[_0x16f3('0x2e')],_0x483eb2['query']);_0x215163[_0x16f3('0x33')]=_[_0x16f3('0x32')](_0x483eb2[_0x16f3('0x2e')],qs[_0x16f3('0x34')](_0x3552d5['query'][_0x16f3('0x34')]));_0x215163[_0x16f3('0x33')]=_0x215163[_0x16f3('0x33')]['length']?_0x215163[_0x16f3('0x33')]:_0x483eb2[_0x16f3('0x2e')];if(_0x3552d5['query'][_0x16f3('0x3f')]){_0x215163[_0x16f3('0x40')]=[{'all':!![]}];}_0x215163=_['merge']({},_0x215163,_0x3552d5[_0x16f3('0x3e')]);return db[_0x16f3('0x2a')][_0x16f3('0x45')](_0x215163)['then'](handleEntityNotFound(_0x578be7,null))[_0x16f3('0x25')](respondWithResult(_0x578be7,null))[_0x16f3('0x43')](handleError(_0x578be7,null));};exports[_0x16f3('0x46')]=function(_0x3c2d6d,_0x2ebae4){return db[_0x16f3('0x2a')][_0x16f3('0x46')](_0x3c2d6d[_0x16f3('0x47')],{})['then'](respondWithResult(_0x2ebae4,0xc9))[_0x16f3('0x43')](handleError(_0x2ebae4,null));};exports[_0x16f3('0x24')]=function(_0x2bda9e,_0x30ec06){if(_0x2bda9e[_0x16f3('0x47')]['id']){delete _0x2bda9e['body']['id'];}return db[_0x16f3('0x2a')][_0x16f3('0x45')]({'where':{'id':_0x2bda9e[_0x16f3('0x48')]['id']}})[_0x16f3('0x25')](handleEntityNotFound(_0x30ec06,null))[_0x16f3('0x25')](saveUpdates(_0x2bda9e['body'],null))[_0x16f3('0x25')](respondWithResult(_0x30ec06,null))[_0x16f3('0x43')](handleError(_0x30ec06,null));};exports[_0x16f3('0x49')]=function(_0x2b3d79,_0x1c039f){return db[_0x16f3('0x2a')][_0x16f3('0x45')]({'where':{'id':_0x2b3d79[_0x16f3('0x48')]['id']}})[_0x16f3('0x25')](handleEntityNotFound(_0x1c039f,null))[_0x16f3('0x25')](removeEntity(_0x1c039f,null))['catch'](handleError(_0x1c039f,null));};exports['describe']=function(_0x57cfbe,_0x126cb2){return db[_0x16f3('0x2a')]['describe']()[_0x16f3('0x25')](respondWithResult(_0x126cb2,null))[_0x16f3('0x43')](handleError(_0x126cb2,null));};
\ No newline at end of file
+var _0xc230=['where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1364f9,_0x422296){var _0x1af7b9=function(_0x193612){while(--_0x193612){_0x1364f9['push'](_0x1364f9['shift']());}};_0x1af7b9(++_0x422296);}(_0xc230,0x194));var _0x0c23=function(_0x391007,_0x5c4eaf){_0x391007=_0x391007-0x0;var _0x118e75=_0xc230[_0x391007];return _0x118e75;};'use strict';var emlformat=require(_0x0c23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c23('0x1'));var jsonpatch=require(_0x0c23('0x2'));var rp=require(_0x0c23('0x3'));var moment=require(_0x0c23('0x4'));var BPromise=require(_0x0c23('0x5'));var Mustache=require('mustache');var util=require(_0x0c23('0x6'));var path=require(_0x0c23('0x7'));var sox=require(_0x0c23('0x8'));var csv=require(_0x0c23('0x9'));var ejs=require(_0x0c23('0xa'));var fs=require('fs');var fs_extra=require(_0x0c23('0xb'));var _=require(_0x0c23('0xc'));var squel=require(_0x0c23('0xd'));var crypto=require(_0x0c23('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0c23('0xf'));var toCsv=require(_0x0c23('0x9'));var querystring=require(_0x0c23('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0c23('0x11'));var as=require(_0x0c23('0x12'));var hardwareService=require(_0x0c23('0x13'));var logger=require(_0x0c23('0x14'))('api');var utils=require(_0x0c23('0x15'));var config=require(_0x0c23('0x16'));var licenseUtil=require(_0x0c23('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ea339,_0x4ab5e5){_0x4ab5e5=_0x4ab5e5||0xcc;return function(_0x43e8a2){if(_0x43e8a2){return _0x2ea339[_0x0c23('0x18')](_0x4ab5e5);}return _0x2ea339['status'](_0x4ab5e5)[_0x0c23('0x19')]();};}function respondWithResult(_0xf6705f,_0x3e8eb3){_0x3e8eb3=_0x3e8eb3||0xc8;return function(_0x4b41b7){if(_0x4b41b7){return _0xf6705f['status'](_0x3e8eb3)[_0x0c23('0x1a')](_0x4b41b7);}};}function respondWithFilteredResult(_0x5635a2,_0x41d7dd){return function(_0xdc7891){if(_0xdc7891){var _0x2ac804=typeof _0x41d7dd[_0x0c23('0x1b')]===_0x0c23('0x1c')&&typeof _0x41d7dd[_0x0c23('0x1d')]===_0x0c23('0x1c');var _0x38eab5=_0xdc7891[_0x0c23('0x1e')];var _0x339c52=_0x2ac804?0x0:_0x41d7dd['offset'];var _0x2c8df0=_0x2ac804?_0xdc7891[_0x0c23('0x1e')]:_0x41d7dd['offset']+_0x41d7dd[_0x0c23('0x1d')];var _0x299a45;if(_0x2c8df0>=_0x38eab5){_0x2c8df0=_0x38eab5;_0x299a45=0xc8;}else{_0x299a45=0xce;}_0x5635a2[_0x0c23('0x1f')](_0x299a45);return _0x5635a2[_0x0c23('0x20')]('Content-Range',_0x339c52+'-'+_0x2c8df0+'/'+_0x38eab5)[_0x0c23('0x1a')](_0xdc7891);}return null;};}function patchUpdates(_0x4a19ec){return function(_0x33cd89){try{jsonpatch[_0x0c23('0x21')](_0x33cd89,_0x4a19ec,!![]);}catch(_0x5b7e36){return BPromise[_0x0c23('0x22')](_0x5b7e36);}return _0x33cd89[_0x0c23('0x23')]();};}function saveUpdates(_0x1a6151,_0x309a82){return function(_0x24ddac){if(_0x24ddac){return _0x24ddac[_0x0c23('0x24')](_0x1a6151)[_0x0c23('0x25')](function(_0x55fcaf){return _0x55fcaf;});}return null;};}function removeEntity(_0x389446,_0x330c60){return function(_0x314d90){if(_0x314d90){return _0x314d90[_0x0c23('0x26')]()['then'](function(){_0x389446['status'](0xcc)[_0x0c23('0x19')]();});}};}function handleEntityNotFound(_0x2c52d3,_0xc6c141){return function(_0x17eff9){if(!_0x17eff9){_0x2c52d3['sendStatus'](0x194);}return _0x17eff9;};}function handleError(_0xbdefca,_0x546273){_0x546273=_0x546273||0x1f4;return function(_0x1b3bc6){logger[_0x0c23('0x27')](_0x1b3bc6[_0x0c23('0x28')]);if(_0x1b3bc6['name']){delete _0x1b3bc6[_0x0c23('0x29')];}_0xbdefca['status'](_0x546273)[_0x0c23('0x2a')](_0x1b3bc6);};}exports[_0x0c23('0x2b')]=function(_0x4d90ab,_0x12ba76){var _0x4c0f67={},_0x450bee={},_0x4bb118={'count':0x0,'rows':[]};var _0x1be182=_['map'](db[_0x0c23('0x2c')][_0x0c23('0x2d')],function(_0x43b1cc){return{'name':_0x43b1cc[_0x0c23('0x2e')],'type':_0x43b1cc['type'][_0x0c23('0x2f')]};});_0x450bee[_0x0c23('0x30')]=_[_0x0c23('0x31')](_0x1be182,_0x0c23('0x29'));_0x450bee[_0x0c23('0x32')]=_['keys'](_0x4d90ab[_0x0c23('0x32')]);_0x450bee[_0x0c23('0x33')]=_['intersection'](_0x450bee['model'],_0x450bee['query']);_0x4c0f67[_0x0c23('0x34')]=_['intersection'](_0x450bee[_0x0c23('0x30')],qs[_0x0c23('0x35')](_0x4d90ab['query'][_0x0c23('0x35')]));_0x4c0f67['attributes']=_0x4c0f67[_0x0c23('0x34')][_0x0c23('0x36')]?_0x4c0f67['attributes']:_0x450bee['model'];if(!_0x4d90ab['query'][_0x0c23('0x37')](_0x0c23('0x38'))){_0x4c0f67[_0x0c23('0x1d')]=qs[_0x0c23('0x1d')](_0x4d90ab[_0x0c23('0x32')][_0x0c23('0x1d')]);_0x4c0f67['offset']=qs[_0x0c23('0x1b')](_0x4d90ab[_0x0c23('0x32')]['offset']);}_0x4c0f67['order']=qs[_0x0c23('0x39')](_0x4d90ab[_0x0c23('0x32')]['sort']);_0x4c0f67[_0x0c23('0x3a')]=qs[_0x0c23('0x33')](_[_0x0c23('0x3b')](_0x4d90ab['query'],_0x450bee[_0x0c23('0x33')]),_0x1be182);if(_0x4d90ab[_0x0c23('0x32')]['filter']){_0x4c0f67[_0x0c23('0x3a')]=_[_0x0c23('0x3c')](_0x4c0f67[_0x0c23('0x3a')],{'$or':_[_0x0c23('0x31')](_0x1be182,function(_0x45531a){if(_0x45531a[_0x0c23('0x3d')]!=='VIRTUAL'){var _0x1c47db={};_0x1c47db[_0x45531a[_0x0c23('0x29')]]={'$like':'%'+_0x4d90ab['query'][_0x0c23('0x3e')]+'%'};return _0x1c47db;}})});}_0x4c0f67=_['merge']({},_0x4c0f67,_0x4d90ab[_0x0c23('0x3f')]);var _0x40c9da={'where':_0x4c0f67[_0x0c23('0x3a')]};return db[_0x0c23('0x2c')]['count'](_0x40c9da)[_0x0c23('0x25')](function(_0x40424c){_0x4bb118[_0x0c23('0x1e')]=_0x40424c;if(_0x4d90ab['query'][_0x0c23('0x40')]){_0x4c0f67[_0x0c23('0x41')]=[{'all':!![]}];}return db[_0x0c23('0x2c')][_0x0c23('0x42')](_0x4c0f67);})[_0x0c23('0x25')](function(_0x458759){_0x4bb118[_0x0c23('0x43')]=_0x458759;return _0x4bb118;})['then'](respondWithFilteredResult(_0x12ba76,_0x4c0f67))[_0x0c23('0x44')](handleError(_0x12ba76,null));};exports[_0x0c23('0x45')]=function(_0x9828bf,_0x4e6678){var _0xf6515={'raw':![],'where':{'id':_0x9828bf[_0x0c23('0x46')]['id']}},_0x3f7710={};_0x3f7710['model']=_[_0x0c23('0x47')](db['IntegrationReport']['rawAttributes']);_0x3f7710[_0x0c23('0x32')]=_['keys'](_0x9828bf[_0x0c23('0x32')]);_0x3f7710[_0x0c23('0x33')]=_[_0x0c23('0x48')](_0x3f7710[_0x0c23('0x30')],_0x3f7710[_0x0c23('0x32')]);_0xf6515[_0x0c23('0x34')]=_[_0x0c23('0x48')](_0x3f7710['model'],qs[_0x0c23('0x35')](_0x9828bf[_0x0c23('0x32')][_0x0c23('0x35')]));_0xf6515['attributes']=_0xf6515[_0x0c23('0x34')][_0x0c23('0x36')]?_0xf6515[_0x0c23('0x34')]:_0x3f7710[_0x0c23('0x30')];if(_0x9828bf[_0x0c23('0x32')][_0x0c23('0x40')]){_0xf6515[_0x0c23('0x41')]=[{'all':!![]}];}_0xf6515=_[_0x0c23('0x3c')]({},_0xf6515,_0x9828bf[_0x0c23('0x3f')]);return db['IntegrationReport']['find'](_0xf6515)[_0x0c23('0x25')](handleEntityNotFound(_0x4e6678,null))['then'](respondWithResult(_0x4e6678,null))['catch'](handleError(_0x4e6678,null));};exports['create']=function(_0x15960d,_0x604a17){return db[_0x0c23('0x2c')][_0x0c23('0x49')](_0x15960d['body'],{})[_0x0c23('0x25')](respondWithResult(_0x604a17,0xc9))['catch'](handleError(_0x604a17,null));};exports[_0x0c23('0x24')]=function(_0x54df9b,_0x128c39){if(_0x54df9b[_0x0c23('0x4a')]['id']){delete _0x54df9b[_0x0c23('0x4a')]['id'];}return db[_0x0c23('0x2c')][_0x0c23('0x4b')]({'where':{'id':_0x54df9b[_0x0c23('0x46')]['id']}})['then'](handleEntityNotFound(_0x128c39,null))[_0x0c23('0x25')](saveUpdates(_0x54df9b[_0x0c23('0x4a')],null))['then'](respondWithResult(_0x128c39,null))[_0x0c23('0x44')](handleError(_0x128c39,null));};exports[_0x0c23('0x26')]=function(_0x3a752c,_0x5eb3d5){return db[_0x0c23('0x2c')][_0x0c23('0x4b')]({'where':{'id':_0x3a752c[_0x0c23('0x46')]['id']}})[_0x0c23('0x25')](handleEntityNotFound(_0x5eb3d5,null))[_0x0c23('0x25')](removeEntity(_0x5eb3d5,null))[_0x0c23('0x44')](handleError(_0x5eb3d5,null));};exports[_0x0c23('0x4c')]=function(_0x524c1a,_0x346477){return db[_0x0c23('0x2c')][_0x0c23('0x4c')]()[_0x0c23('0x25')](respondWithResult(_0x346477,null))['catch'](handleError(_0x346477,null));};
\ No newline at end of file
index d2668bf..ffc3701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e1=['util','../../config/logger','api','bluebird','request-promise','./integrationReport.attributes','report_integration','lodash'];(function(_0x46f549,_0x21c79c){var _0x2bf5e1=function(_0x7ef519){while(--_0x7ef519){_0x46f549['push'](_0x46f549['shift']());}};_0x2bf5e1(++_0x21c79c);}(_0x46e1,0x1ef));var _0x146e=function(_0x17ddda,_0x131e3c){_0x17ddda=_0x17ddda-0x0;var _0x2a5b22=_0x46e1[_0x17ddda];return _0x2a5b22;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var logger=require(_0x146e('0x2'))(_0x146e('0x3'));var moment=require('moment');var BPromise=require(_0x146e('0x4'));var rp=require(_0x146e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x146e('0x6'));module['exports']=function(_0x1f8e08,_0x373167){return _0x1f8e08['define']('IntegrationReport',attributes,{'tableName':_0x146e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe695=['exports','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x35b17e,_0x4c8914){var _0x491ab8=function(_0x2d877b){while(--_0x2d877b){_0x35b17e['push'](_0x35b17e['shift']());}};_0x491ab8(++_0x4c8914);}(_0xe695,0x1a7));var _0x5e69=function(_0x284c5e,_0x2af098){_0x284c5e=_0x284c5e-0x0;var _0x387aa2=_0xe695[_0x284c5e];return _0x387aa2;};'use strict';var _=require('lodash');var util=require(_0x5e69('0x0'));var logger=require(_0x5e69('0x1'))(_0x5e69('0x2'));var moment=require('moment');var BPromise=require(_0x5e69('0x3'));var rp=require(_0x5e69('0x4'));var fs=require('fs');var path=require(_0x5e69('0x5'));var rimraf=require(_0x5e69('0x6'));var config=require(_0x5e69('0x7'));var attributes=require(_0x5e69('0x8'));module[_0x5e69('0x9')]=function(_0x4fdc7b,_0x40f848){return _0x4fdc7b['define'](_0x5e69('0xa'),attributes,{'tableName':_0x5e69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c9c4419..9219dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x5bd0ac,_0x3012ab){var _0x5da8c4=function(_0x5eeb8a){while(--_0x5eeb8a){_0x5bd0ac['push'](_0x5bd0ac['shift']());}};_0x5da8c4(++_0x3012ab);}(_0x4819,0xcd));var _0x9481=function(_0x477aab,_0x4d08fd){_0x477aab=_0x477aab-0x0;var _0x2cd294=_0x4819[_0x477aab];return _0x2cd294;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x53ec,0x192));var _0xc53e=function(_0x44a998,_0x2e1f91){_0x44a998=_0x44a998-0x0;var _0x1a8c53=_0x53ec[_0x44a998];return _0x1a8c53;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index 5220019..b504d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ec=['addIntervals','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','create','post','addInterval'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x42ec,0x1e8));var _0xc42e=function(_0x41c1eb,_0x232ddc){_0x41c1eb=_0x41c1eb-0x0;var _0x417659=_0x42ec[_0x41c1eb];return _0x417659;};'use strict';var multer=require(_0xc42e('0x0'));var util=require(_0xc42e('0x1'));var path=require(_0xc42e('0x2'));var timeout=require(_0xc42e('0x3'));var express=require(_0xc42e('0x4'));var router=express['Router']();var fs_extra=require(_0xc42e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc42e('0x6'));var config=require(_0xc42e('0x7'));var controller=require(_0xc42e('0x8'));router[_0xc42e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc42e('0xa')]);router['get'](_0xc42e('0xb'),auth[_0xc42e('0xc')](),controller['show']);router[_0xc42e('0x9')](_0xc42e('0xd'),auth[_0xc42e('0xc')](),controller[_0xc42e('0xe')]);router['post']('/',auth[_0xc42e('0xc')](),controller[_0xc42e('0xf')]);router[_0xc42e('0x10')]('/:id/sub_intervals',auth[_0xc42e('0xc')](),controller[_0xc42e('0x11')]);router[_0xc42e('0x10')]('/:id/sub_intervals/create_many',auth[_0xc42e('0xc')](),controller[_0xc42e('0x12')]);router[_0xc42e('0x13')](_0xc42e('0xb'),auth['isAuthenticated'](),controller[_0xc42e('0x14')]);router['delete'](_0xc42e('0xb'),auth[_0xc42e('0xc')](),controller[_0xc42e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xc8e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','addIntervals','put','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xc8e9,0x1f4));var _0x9c8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc8e9[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x9c8e('0x0'));var path=require(_0x9c8e('0x1'));var timeout=require(_0x9c8e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c8e('0x3'));var auth=require(_0x9c8e('0x4'));var interaction=require(_0x9c8e('0x5'));var config=require(_0x9c8e('0x6'));var controller=require('./interval.controller');router[_0x9c8e('0x7')]('/',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x9')]);router[_0x9c8e('0x7')](_0x9c8e('0xa'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0xb')]);router[_0x9c8e('0x7')]('/:id/sub_intervals',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0xc')]);router[_0x9c8e('0xd')]('/',auth['isAuthenticated'](),controller[_0x9c8e('0xe')]);router[_0x9c8e('0xd')](_0x9c8e('0xf'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x10')]);router[_0x9c8e('0xd')]('/:id/sub_intervals/create_many',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x11')]);router[_0x9c8e('0x12')]('/:id',auth[_0x9c8e('0x8')](),controller['update']);router['delete'](_0x9c8e('0xa'),auth['isAuthenticated'](),controller[_0x9c8e('0x13')]);module[_0x9c8e('0x14')]=router;
\ No newline at end of file
index 25cbb82..7c0b73b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19d1=['exports','STRING','sequelize'];(function(_0x2226f5,_0x7b8df0){var _0x5d2661=function(_0x2255b8){while(--_0x2255b8){_0x2226f5['push'](_0x2226f5['shift']());}};_0x5d2661(++_0x7b8df0);}(_0x19d1,0xe3));var _0x119d=function(_0x214d31,_0x408c64){_0x214d31=_0x214d31-0x0;var _0x1fe1eb=_0x19d1[_0x214d31];return _0x1fe1eb;};'use strict';var Sequelize=require(_0x119d('0x0'));module[_0x119d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x119d('0x2')]},'interval':{'type':Sequelize[_0x119d('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x396d=['sequelize','STRING'];(function(_0x47bfff,_0x20f3c3){var _0x2f7c23=function(_0x18b433){while(--_0x18b433){_0x47bfff['push'](_0x47bfff['shift']());}};_0x2f7c23(++_0x20f3c3);}(_0x396d,0xdc));var _0xd396=function(_0x58401d,_0x5d423d){_0x58401d=_0x58401d-0x0;var _0x571b1a=_0x396d[_0x58401d];return _0x571b1a;};'use strict';var Sequelize=require(_0xd396('0x0'));module['exports']={'name':{'type':Sequelize[_0xd396('0x1')]},'description':{'type':Sequelize[_0xd396('0x1')]},'interval':{'type':Sequelize[_0xd396('0x1')],'allowNull':!![]}};
\ No newline at end of file
index b9c0183..d77c35f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6df=['offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Intervals','UserProfileResource','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','addInterval','IntervalId','findOne','getIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb6df,0x9d));var _0xfb6d=function(_0x3b9c62,_0x25e2b4){_0x3b9c62=_0x3b9c62-0x0;var _0xd7cdff=_0xb6df[_0x3b9c62];return _0xd7cdff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb6d('0x0'));var zipdir=require(_0xfb6d('0x1'));var jsonpatch=require(_0xfb6d('0x2'));var rp=require(_0xfb6d('0x3'));var moment=require(_0xfb6d('0x4'));var BPromise=require(_0xfb6d('0x5'));var Mustache=require(_0xfb6d('0x6'));var util=require(_0xfb6d('0x7'));var path=require(_0xfb6d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfb6d('0x9'));var fs=require('fs');var fs_extra=require(_0xfb6d('0xa'));var _=require(_0xfb6d('0xb'));var squel=require(_0xfb6d('0xc'));var crypto=require(_0xfb6d('0xd'));var jsforce=require(_0xfb6d('0xe'));var deskjs=require(_0xfb6d('0xf'));var toCsv=require(_0xfb6d('0x10'));var querystring=require('querystring');var Papa=require(_0xfb6d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb6d('0x12'));var as=require(_0xfb6d('0x13'));var hardwareService=require(_0xfb6d('0x14'));var logger=require(_0xfb6d('0x15'))(_0xfb6d('0x16'));var utils=require('../../config/utils');var config=require(_0xfb6d('0x17'));var licenseUtil=require(_0xfb6d('0x18'));var db=require(_0xfb6d('0x19'))['db'];var extensions=require(_0xfb6d('0x1a'));function respondWithStatusCode(_0x50378b,_0x4f24b7){_0x4f24b7=_0x4f24b7||0xcc;return function(_0x49ed96){if(_0x49ed96){return _0x50378b[_0xfb6d('0x1b')](_0x4f24b7);}return _0x50378b[_0xfb6d('0x1c')](_0x4f24b7)[_0xfb6d('0x1d')]();};}function respondWithResult(_0x4a1a19,_0x4670e8){_0x4670e8=_0x4670e8||0xc8;return function(_0x45c83b){if(_0x45c83b){return _0x4a1a19[_0xfb6d('0x1c')](_0x4670e8)[_0xfb6d('0x1e')](_0x45c83b);}};}function respondWithFilteredResult(_0x4bd799,_0x543d22){return function(_0x5a6c3c){if(_0x5a6c3c){var _0x360049=typeof _0x543d22[_0xfb6d('0x1f')]===_0xfb6d('0x20')&&typeof _0x543d22[_0xfb6d('0x21')]===_0xfb6d('0x20');var _0x8cc7e7=_0x5a6c3c[_0xfb6d('0x22')];var _0x5e5910=_0x360049?0x0:_0x543d22['offset'];var _0x5f4365=_0x360049?_0x5a6c3c[_0xfb6d('0x22')]:_0x543d22[_0xfb6d('0x1f')]+_0x543d22[_0xfb6d('0x21')];var _0x587317;if(_0x5f4365>=_0x8cc7e7){_0x5f4365=_0x8cc7e7;_0x587317=0xc8;}else{_0x587317=0xce;}_0x4bd799['status'](_0x587317);return _0x4bd799['set'](_0xfb6d('0x23'),_0x5e5910+'-'+_0x5f4365+'/'+_0x8cc7e7)[_0xfb6d('0x1e')](_0x5a6c3c);}return null;};}function patchUpdates(_0x43a873){return function(_0x3ea165){try{jsonpatch[_0xfb6d('0x24')](_0x3ea165,_0x43a873,!![]);}catch(_0x23dd57){return BPromise[_0xfb6d('0x25')](_0x23dd57);}return _0x3ea165[_0xfb6d('0x26')]();};}function saveUpdates(_0x2e81c8,_0x4a73d4){return function(_0x1e2c96){if(_0x1e2c96){return _0x1e2c96['update'](_0x2e81c8)['then'](function(_0x4799e0){return _0x4799e0;});}return null;};}function removeEntity(_0xa8701a,_0x30369a){return function(_0x57be70){if(_0x57be70){return _0x57be70['destroy']()[_0xfb6d('0x27')](function(){var _0x281cac=_0x57be70[_0xfb6d('0x28')]({'plain':!![]});var _0x43d537=_0xfb6d('0x29');return db[_0xfb6d('0x2a')]['destroy']({'where':{'type':_0x43d537,'resourceId':_0x281cac['id']}})[_0xfb6d('0x27')](function(){return _0x57be70;});})[_0xfb6d('0x27')](function(){_0xa8701a[_0xfb6d('0x1c')](0xcc)[_0xfb6d('0x1d')]();});}};}function handleEntityNotFound(_0x31ae82,_0x9fcaf5){return function(_0x24539e){if(!_0x24539e){_0x31ae82[_0xfb6d('0x1b')](0x194);}return _0x24539e;};}function handleError(_0x3fe2cd,_0x3653a8){_0x3653a8=_0x3653a8||0x1f4;return function(_0x422c8d){logger[_0xfb6d('0x2b')](_0x422c8d[_0xfb6d('0x2c')]);if(_0x422c8d[_0xfb6d('0x2d')]){delete _0x422c8d['name'];}_0x3fe2cd[_0xfb6d('0x1c')](_0x3653a8)[_0xfb6d('0x2e')](_0x422c8d);};}exports['index']=function(_0x1445d5,_0x364420){var _0x14bbd9={},_0x270b07={},_0x2512f2={'count':0x0,'rows':[]};var _0x49c0b7=_['map'](db[_0xfb6d('0x2f')][_0xfb6d('0x30')],function(_0x56c660){return{'name':_0x56c660[_0xfb6d('0x31')],'type':_0x56c660[_0xfb6d('0x32')][_0xfb6d('0x33')]};});_0x270b07[_0xfb6d('0x34')]=_[_0xfb6d('0x35')](_0x49c0b7,'name');_0x270b07[_0xfb6d('0x36')]=_[_0xfb6d('0x37')](_0x1445d5[_0xfb6d('0x36')]);_0x270b07[_0xfb6d('0x38')]=_[_0xfb6d('0x39')](_0x270b07[_0xfb6d('0x34')],_0x270b07[_0xfb6d('0x36')]);_0x14bbd9[_0xfb6d('0x3a')]=_[_0xfb6d('0x39')](_0x270b07[_0xfb6d('0x34')],qs[_0xfb6d('0x3b')](_0x1445d5['query']['fields']));_0x14bbd9[_0xfb6d('0x3a')]=_0x14bbd9[_0xfb6d('0x3a')]['length']?_0x14bbd9[_0xfb6d('0x3a')]:_0x270b07[_0xfb6d('0x34')];if(!_0x1445d5[_0xfb6d('0x36')][_0xfb6d('0x3c')](_0xfb6d('0x3d'))){_0x14bbd9[_0xfb6d('0x21')]=qs[_0xfb6d('0x21')](_0x1445d5[_0xfb6d('0x36')]['limit']);_0x14bbd9[_0xfb6d('0x1f')]=qs[_0xfb6d('0x1f')](_0x1445d5[_0xfb6d('0x36')][_0xfb6d('0x1f')]);}_0x14bbd9[_0xfb6d('0x3e')]=qs[_0xfb6d('0x3f')](_0x1445d5[_0xfb6d('0x36')]['sort']);_0x14bbd9[_0xfb6d('0x40')]=qs[_0xfb6d('0x38')](_[_0xfb6d('0x41')](_0x1445d5[_0xfb6d('0x36')],_0x270b07[_0xfb6d('0x38')]),_0x49c0b7);if(_0x1445d5[_0xfb6d('0x36')][_0xfb6d('0x42')]){_0x14bbd9['where']=_[_0xfb6d('0x43')](_0x14bbd9[_0xfb6d('0x40')],{'$or':_['map'](_0x49c0b7,function(_0x490774){if(_0x490774['type']!==_0xfb6d('0x44')){var _0x2563c5={};_0x2563c5[_0x490774['name']]={'$like':'%'+_0x1445d5[_0xfb6d('0x36')][_0xfb6d('0x42')]+'%'};return _0x2563c5;}})});}_0x14bbd9=_['merge']({},_0x14bbd9,_0x1445d5['options']);var _0x3b91db={'where':_0x14bbd9['where']};return db[_0xfb6d('0x2f')][_0xfb6d('0x22')](_0x3b91db)[_0xfb6d('0x27')](function(_0x37b185){_0x2512f2['count']=_0x37b185;if(_0x1445d5['query'][_0xfb6d('0x45')]){_0x14bbd9['include']=[{'all':!![]}];}return db[_0xfb6d('0x2f')][_0xfb6d('0x46')](_0x14bbd9);})[_0xfb6d('0x27')](function(_0x157705){_0x2512f2[_0xfb6d('0x47')]=_0x157705;return _0x2512f2;})['then'](respondWithFilteredResult(_0x364420,_0x14bbd9))[_0xfb6d('0x48')](handleError(_0x364420,null));};exports[_0xfb6d('0x49')]=function(_0x2e872c,_0x31e6d8){var _0x3ff968={'raw':!![],'where':{'id':_0x2e872c[_0xfb6d('0x4a')]['id']}},_0x50d4e6={};_0x50d4e6['model']=_['keys'](db[_0xfb6d('0x2f')]['rawAttributes']);_0x50d4e6['query']=_['keys'](_0x2e872c[_0xfb6d('0x36')]);_0x50d4e6[_0xfb6d('0x38')]=_[_0xfb6d('0x39')](_0x50d4e6['model'],_0x50d4e6[_0xfb6d('0x36')]);_0x3ff968[_0xfb6d('0x3a')]=_[_0xfb6d('0x39')](_0x50d4e6['model'],qs['fields'](_0x2e872c[_0xfb6d('0x36')][_0xfb6d('0x3b')]));_0x3ff968['attributes']=_0x3ff968[_0xfb6d('0x3a')][_0xfb6d('0x4b')]?_0x3ff968['attributes']:_0x50d4e6[_0xfb6d('0x34')];if(_0x2e872c['query'][_0xfb6d('0x45')]){_0x3ff968[_0xfb6d('0x4c')]=[{'all':!![]}];}_0x3ff968=_[_0xfb6d('0x43')]({},_0x3ff968,_0x2e872c[_0xfb6d('0x4d')]);return db[_0xfb6d('0x2f')]['find'](_0x3ff968)[_0xfb6d('0x27')](handleEntityNotFound(_0x31e6d8,null))[_0xfb6d('0x27')](respondWithResult(_0x31e6d8,null))['catch'](handleError(_0x31e6d8,null));};exports[_0xfb6d('0x4e')]=function(_0x144e63,_0x41dd0b){return db[_0xfb6d('0x2f')][_0xfb6d('0x4e')](_0x144e63[_0xfb6d('0x4f')],{})['then'](function(_0x3f49e2){var _0x28e77a=_0x144e63['user'][_0xfb6d('0x28')]({'plain':!![]});if(!_0x28e77a)throw new Error(_0xfb6d('0x50'));if(_0x28e77a['role']==='user'){var _0x3af6e2=_0x3f49e2[_0xfb6d('0x28')]({'plain':!![]});var _0x5cff02=_0xfb6d('0x29');return db[_0xfb6d('0x51')][_0xfb6d('0x52')]({'where':{'name':_0x5cff02,'userProfileId':_0x28e77a[_0xfb6d('0x53')]},'raw':!![]})[_0xfb6d('0x27')](function(_0x26cea6){if(_0x26cea6&&_0x26cea6['autoAssociation']===0x0){return db[_0xfb6d('0x2a')][_0xfb6d('0x4e')]({'name':_0x3af6e2['name'],'resourceId':_0x3af6e2['id'],'type':_0x26cea6['name'],'sectionId':_0x26cea6['id']},{})[_0xfb6d('0x27')](function(){return _0x3f49e2;});}else{return _0x3f49e2;}})[_0xfb6d('0x48')](function(_0x9f70){logger[_0xfb6d('0x2b')](_0xfb6d('0x54'),_0x9f70);throw _0x9f70;});}return _0x3f49e2;})[_0xfb6d('0x27')](respondWithResult(_0x41dd0b,0xc9))[_0xfb6d('0x48')](handleError(_0x41dd0b,null));};exports[_0xfb6d('0x55')]=function(_0x50462d,_0x391163){if(_0x50462d[_0xfb6d('0x4f')]['id']){delete _0x50462d[_0xfb6d('0x4f')]['id'];}return db[_0xfb6d('0x2f')]['find']({'where':{'id':_0x50462d[_0xfb6d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x391163,null))[_0xfb6d('0x27')](saveUpdates(_0x50462d[_0xfb6d('0x4f')],null))['then'](respondWithResult(_0x391163,null))[_0xfb6d('0x48')](handleError(_0x391163,null));};exports[_0xfb6d('0x56')]=function(_0x16c847,_0x9333bc){return db[_0xfb6d('0x2f')][_0xfb6d('0x52')]({'where':{'id':_0x16c847[_0xfb6d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9333bc,null))[_0xfb6d('0x27')](removeEntity(_0x9333bc,null))[_0xfb6d('0x48')](handleError(_0x9333bc,null));};exports[_0xfb6d('0x57')]=function(_0xf25f26,_0x7e6342,_0x150cf4){if(_0xf25f26[_0xfb6d('0x4f')]['id']){delete _0xf25f26[_0xfb6d('0x4f')]['id'];}return db['Interval'][_0xfb6d('0x52')]({'where':{'id':_0xf25f26[_0xfb6d('0x4a')]['id']}})[_0xfb6d('0x27')](handleEntityNotFound(_0x7e6342,null))['then'](function(_0x2421ef){if(_0x2421ef){_0xf25f26['body'][_0xfb6d('0x58')]=_0x2421ef['id'];return db[_0xfb6d('0x2f')][_0xfb6d('0x4e')](_0xf25f26[_0xfb6d('0x4f')]);}})[_0xfb6d('0x27')](respondWithResult(_0x7e6342,null))[_0xfb6d('0x48')](handleError(_0x7e6342,null));};exports['getIntervals']=function(_0x517ddc,_0x4c0a24,_0x1ae935){var _0x572d67={};var _0x1cbca1={};var _0xcc8f9d;var _0x699889;return db[_0xfb6d('0x2f')][_0xfb6d('0x59')]({'where':{'id':_0x517ddc['params']['id']}})['then'](handleEntityNotFound(_0x4c0a24,null))[_0xfb6d('0x27')](function(_0x1c1064){if(_0x1c1064){_0xcc8f9d=_0x1c1064;_0x1cbca1[_0xfb6d('0x34')]=_[_0xfb6d('0x37')](db[_0xfb6d('0x2f')]['rawAttributes']);_0x1cbca1[_0xfb6d('0x36')]=_[_0xfb6d('0x37')](_0x517ddc['query']);_0x1cbca1[_0xfb6d('0x38')]=_[_0xfb6d('0x39')](_0x1cbca1['model'],_0x1cbca1['query']);_0x572d67[_0xfb6d('0x3a')]=_[_0xfb6d('0x39')](_0x1cbca1[_0xfb6d('0x34')],qs[_0xfb6d('0x3b')](_0x517ddc['query']['fields']));_0x572d67[_0xfb6d('0x3a')]=_0x572d67['attributes'][_0xfb6d('0x4b')]?_0x572d67['attributes']:_0x1cbca1['model'];_0x572d67[_0xfb6d('0x3e')]=qs['sort'](_0x517ddc[_0xfb6d('0x36')][_0xfb6d('0x3f')]);_0x572d67[_0xfb6d('0x40')]=qs[_0xfb6d('0x38')](_[_0xfb6d('0x41')](_0x517ddc['query'],_0x1cbca1[_0xfb6d('0x38')]));if(_0x517ddc[_0xfb6d('0x36')]['filter']){_0x572d67[_0xfb6d('0x40')]=_[_0xfb6d('0x43')](_0x572d67[_0xfb6d('0x40')],{'$or':_[_0xfb6d('0x35')](_0x572d67['attributes'],function(_0x2e6858){var _0x7ee1fb={};_0x7ee1fb[_0x2e6858]={'$like':'%'+_0x517ddc[_0xfb6d('0x36')][_0xfb6d('0x42')]+'%'};return _0x7ee1fb;})});}_0x572d67=_[_0xfb6d('0x43')]({},_0x572d67,_0x517ddc[_0xfb6d('0x4d')]);return _0xcc8f9d[_0xfb6d('0x5a')](_0x572d67);}})[_0xfb6d('0x27')](function(_0x2610c4){if(_0x2610c4){_0x699889=_0x2610c4[_0xfb6d('0x4b')];if(!_0x517ddc[_0xfb6d('0x36')]['hasOwnProperty']('nolimit')){_0x572d67[_0xfb6d('0x21')]=qs[_0xfb6d('0x21')](_0x517ddc[_0xfb6d('0x36')][_0xfb6d('0x21')]);_0x572d67[_0xfb6d('0x1f')]=qs['offset'](_0x517ddc['query'][_0xfb6d('0x1f')]);}return _0xcc8f9d[_0xfb6d('0x5a')](_0x572d67);}})[_0xfb6d('0x27')](function(_0x1c39b3){if(_0x1c39b3){return _0x1c39b3?{'count':_0x699889,'rows':_0x1c39b3}:null;}})[_0xfb6d('0x27')](respondWithResult(_0x4c0a24,null))[_0xfb6d('0x48')](handleError(_0x4c0a24,null));};exports['addIntervals']=function(_0x614f5,_0x43c324,_0x3edbfe){return db[_0xfb6d('0x2f')][_0xfb6d('0x59')]({'where':{'id':_0x614f5['params']['id']}})[_0xfb6d('0x27')](handleEntityNotFound(_0x43c324,null))['then'](function(_0xddb2e8){if(_0xddb2e8){return db[_0xfb6d('0x5b')][_0xfb6d('0x5c')](function(_0x3e4868){return db[_0xfb6d('0x2f')][_0xfb6d('0x56')]({'where':{'IntervalId':_0x614f5[_0xfb6d('0x4a')]['id']},'transaction':_0x3e4868})[_0xfb6d('0x27')](function(_0x44e796){var _0x347ab1=_[_0xfb6d('0x35')](_0x614f5['body'],function(_0x126b60){delete _0x126b60['id'];_0x126b60[_0xfb6d('0x58')]=_0x614f5['params']['id'];return _0x126b60;});return db[_0xfb6d('0x2f')][_0xfb6d('0x5d')](_0x347ab1,{'transaction':_0x3e4868});});})[_0xfb6d('0x27')](function(){return db[_0xfb6d('0x2f')][_0xfb6d('0x46')]({'where':{'IntervalId':_0x614f5['params']['id']}});});}})[_0xfb6d('0x27')](respondWithResult(_0x43c324,null))['catch'](handleError(_0x43c324,null));};
\ No newline at end of file
+var _0xc28f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','Intervals','UserProfileResource','destroy','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x24392e,_0xc15ef6){var _0x3c2246=function(_0x59af62){while(--_0x59af62){_0x24392e['push'](_0x24392e['shift']());}};_0x3c2246(++_0xc15ef6);}(_0xc28f,0xd3));var _0xfc28=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xc28f[_0x187ee1];return _0x388160;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc28('0x0'));var zipdir=require(_0xfc28('0x1'));var jsonpatch=require(_0xfc28('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc28('0x3'));var Mustache=require(_0xfc28('0x4'));var util=require(_0xfc28('0x5'));var path=require(_0xfc28('0x6'));var sox=require(_0xfc28('0x7'));var csv=require(_0xfc28('0x8'));var ejs=require(_0xfc28('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc28('0xa'));var crypto=require(_0xfc28('0xb'));var jsforce=require(_0xfc28('0xc'));var deskjs=require(_0xfc28('0xd'));var toCsv=require(_0xfc28('0x8'));var querystring=require('querystring');var Papa=require(_0xfc28('0xe'));var Redis=require(_0xfc28('0xf'));var authService=require(_0xfc28('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc28('0x11'));var logger=require('../../config/logger')(_0xfc28('0x12'));var utils=require(_0xfc28('0x13'));var config=require(_0xfc28('0x14'));var licenseUtil=require(_0xfc28('0x15'));var db=require(_0xfc28('0x16'))['db'];var extensions=require(_0xfc28('0x17'));function respondWithStatusCode(_0x271654,_0x29aa1e){_0x29aa1e=_0x29aa1e||0xcc;return function(_0x17dce7){if(_0x17dce7){return _0x271654[_0xfc28('0x18')](_0x29aa1e);}return _0x271654[_0xfc28('0x19')](_0x29aa1e)[_0xfc28('0x1a')]();};}function respondWithResult(_0x3a517a,_0x35d352){_0x35d352=_0x35d352||0xc8;return function(_0x372fe2){if(_0x372fe2){return _0x3a517a[_0xfc28('0x19')](_0x35d352)[_0xfc28('0x1b')](_0x372fe2);}};}function respondWithFilteredResult(_0xf70ce3,_0x4fdb30){return function(_0x26a039){if(_0x26a039){var _0x4ae151=typeof _0x4fdb30['offset']===_0xfc28('0x1c')&&typeof _0x4fdb30[_0xfc28('0x1d')]===_0xfc28('0x1c');var _0x473c4c=_0x26a039[_0xfc28('0x1e')];var _0x289099=_0x4ae151?0x0:_0x4fdb30['offset'];var _0x9e468=_0x4ae151?_0x26a039[_0xfc28('0x1e')]:_0x4fdb30[_0xfc28('0x1f')]+_0x4fdb30['limit'];var _0x3c890a;if(_0x9e468>=_0x473c4c){_0x9e468=_0x473c4c;_0x3c890a=0xc8;}else{_0x3c890a=0xce;}_0xf70ce3[_0xfc28('0x19')](_0x3c890a);return _0xf70ce3[_0xfc28('0x20')](_0xfc28('0x21'),_0x289099+'-'+_0x9e468+'/'+_0x473c4c)['json'](_0x26a039);}return null;};}function patchUpdates(_0x48fc2d){return function(_0xfce19c){try{jsonpatch[_0xfc28('0x22')](_0xfce19c,_0x48fc2d,!![]);}catch(_0x2fd38c){return BPromise[_0xfc28('0x23')](_0x2fd38c);}return _0xfce19c['save']();};}function saveUpdates(_0x85ad63,_0x87abfc){return function(_0x2547ca){if(_0x2547ca){return _0x2547ca[_0xfc28('0x24')](_0x85ad63)[_0xfc28('0x25')](function(_0x2189a0){return _0x2189a0;});}return null;};}function removeEntity(_0x5f3d12,_0x21832f){return function(_0xe5c1ff){if(_0xe5c1ff){return _0xe5c1ff['destroy']()['then'](function(){var _0x2b5592=_0xe5c1ff[_0xfc28('0x26')]({'plain':!![]});var _0x2e82cd=_0xfc28('0x27');return db[_0xfc28('0x28')][_0xfc28('0x29')]({'where':{'type':_0x2e82cd,'resourceId':_0x2b5592['id']}})['then'](function(){return _0xe5c1ff;});})[_0xfc28('0x25')](function(){_0x5f3d12[_0xfc28('0x19')](0xcc)[_0xfc28('0x1a')]();});}};}function handleEntityNotFound(_0x323894,_0x1e4aea){return function(_0x1c6bb0){if(!_0x1c6bb0){_0x323894['sendStatus'](0x194);}return _0x1c6bb0;};}function handleError(_0x11f34b,_0x16b1c0){_0x16b1c0=_0x16b1c0||0x1f4;return function(_0x1e519b){logger['error'](_0x1e519b[_0xfc28('0x2a')]);if(_0x1e519b[_0xfc28('0x2b')]){delete _0x1e519b[_0xfc28('0x2b')];}_0x11f34b[_0xfc28('0x19')](_0x16b1c0)['send'](_0x1e519b);};}exports[_0xfc28('0x2c')]=function(_0x42c37d,_0x58bece){var _0x18e70c={},_0x101a20={},_0x529688={'count':0x0,'rows':[]};var _0xb1ded1=_[_0xfc28('0x2d')](db[_0xfc28('0x2e')][_0xfc28('0x2f')],function(_0x3a1b73){return{'name':_0x3a1b73[_0xfc28('0x30')],'type':_0x3a1b73[_0xfc28('0x31')][_0xfc28('0x32')]};});_0x101a20['model']=_[_0xfc28('0x2d')](_0xb1ded1,_0xfc28('0x2b'));_0x101a20[_0xfc28('0x33')]=_[_0xfc28('0x34')](_0x42c37d[_0xfc28('0x33')]);_0x101a20[_0xfc28('0x35')]=_[_0xfc28('0x36')](_0x101a20[_0xfc28('0x37')],_0x101a20['query']);_0x18e70c[_0xfc28('0x38')]=_[_0xfc28('0x36')](_0x101a20[_0xfc28('0x37')],qs[_0xfc28('0x39')](_0x42c37d['query']['fields']));_0x18e70c[_0xfc28('0x38')]=_0x18e70c[_0xfc28('0x38')][_0xfc28('0x3a')]?_0x18e70c[_0xfc28('0x38')]:_0x101a20[_0xfc28('0x37')];if(!_0x42c37d[_0xfc28('0x33')][_0xfc28('0x3b')](_0xfc28('0x3c'))){_0x18e70c['limit']=qs[_0xfc28('0x1d')](_0x42c37d['query'][_0xfc28('0x1d')]);_0x18e70c['offset']=qs[_0xfc28('0x1f')](_0x42c37d['query'][_0xfc28('0x1f')]);}_0x18e70c[_0xfc28('0x3d')]=qs[_0xfc28('0x3e')](_0x42c37d[_0xfc28('0x33')][_0xfc28('0x3e')]);_0x18e70c[_0xfc28('0x3f')]=qs['filters'](_[_0xfc28('0x40')](_0x42c37d['query'],_0x101a20[_0xfc28('0x35')]),_0xb1ded1);if(_0x42c37d[_0xfc28('0x33')][_0xfc28('0x41')]){_0x18e70c[_0xfc28('0x3f')]=_[_0xfc28('0x42')](_0x18e70c[_0xfc28('0x3f')],{'$or':_[_0xfc28('0x2d')](_0xb1ded1,function(_0x11dc7a){if(_0x11dc7a[_0xfc28('0x31')]!==_0xfc28('0x43')){var _0x22bdce={};_0x22bdce[_0x11dc7a[_0xfc28('0x2b')]]={'$like':'%'+_0x42c37d[_0xfc28('0x33')][_0xfc28('0x41')]+'%'};return _0x22bdce;}})});}_0x18e70c=_[_0xfc28('0x42')]({},_0x18e70c,_0x42c37d[_0xfc28('0x44')]);var _0x29bc71={'where':_0x18e70c[_0xfc28('0x3f')]};return db[_0xfc28('0x2e')][_0xfc28('0x1e')](_0x29bc71)[_0xfc28('0x25')](function(_0x74f056){_0x529688[_0xfc28('0x1e')]=_0x74f056;if(_0x42c37d[_0xfc28('0x33')][_0xfc28('0x45')]){_0x18e70c[_0xfc28('0x46')]=[{'all':!![]}];}return db[_0xfc28('0x2e')][_0xfc28('0x47')](_0x18e70c);})[_0xfc28('0x25')](function(_0x5bdd5d){_0x529688['rows']=_0x5bdd5d;return _0x529688;})[_0xfc28('0x25')](respondWithFilteredResult(_0x58bece,_0x18e70c))[_0xfc28('0x48')](handleError(_0x58bece,null));};exports['show']=function(_0x39e49e,_0x182214){var _0x505703={'raw':!![],'where':{'id':_0x39e49e[_0xfc28('0x49')]['id']}},_0x4f537e={};_0x4f537e[_0xfc28('0x37')]=_['keys'](db['Interval'][_0xfc28('0x2f')]);_0x4f537e[_0xfc28('0x33')]=_[_0xfc28('0x34')](_0x39e49e[_0xfc28('0x33')]);_0x4f537e[_0xfc28('0x35')]=_[_0xfc28('0x36')](_0x4f537e['model'],_0x4f537e[_0xfc28('0x33')]);_0x505703[_0xfc28('0x38')]=_['intersection'](_0x4f537e[_0xfc28('0x37')],qs[_0xfc28('0x39')](_0x39e49e['query'][_0xfc28('0x39')]));_0x505703[_0xfc28('0x38')]=_0x505703[_0xfc28('0x38')][_0xfc28('0x3a')]?_0x505703[_0xfc28('0x38')]:_0x4f537e[_0xfc28('0x37')];if(_0x39e49e[_0xfc28('0x33')][_0xfc28('0x45')]){_0x505703['include']=[{'all':!![]}];}_0x505703=_[_0xfc28('0x42')]({},_0x505703,_0x39e49e['options']);return db[_0xfc28('0x2e')][_0xfc28('0x4a')](_0x505703)[_0xfc28('0x25')](handleEntityNotFound(_0x182214,null))[_0xfc28('0x25')](respondWithResult(_0x182214,null))[_0xfc28('0x48')](handleError(_0x182214,null));};exports[_0xfc28('0x4b')]=function(_0x46a9eb,_0x2cf546){return db[_0xfc28('0x2e')][_0xfc28('0x4b')](_0x46a9eb[_0xfc28('0x4c')],{})[_0xfc28('0x25')](function(_0x46f0d2){var _0x321744=_0x46a9eb[_0xfc28('0x4d')][_0xfc28('0x26')]({'plain':!![]});if(!_0x321744)throw new Error(_0xfc28('0x4e'));if(_0x321744['role']===_0xfc28('0x4d')){var _0x42f353=_0x46f0d2[_0xfc28('0x26')]({'plain':!![]});var _0x4fdb8e=_0xfc28('0x27');return db['UserProfileSection'][_0xfc28('0x4a')]({'where':{'name':_0x4fdb8e,'userProfileId':_0x321744['userProfileId']},'raw':!![]})[_0xfc28('0x25')](function(_0x6b2401){if(_0x6b2401&&_0x6b2401[_0xfc28('0x4f')]===0x0){return db[_0xfc28('0x28')][_0xfc28('0x4b')]({'name':_0x42f353['name'],'resourceId':_0x42f353['id'],'type':_0x6b2401['name'],'sectionId':_0x6b2401['id']},{})['then'](function(){return _0x46f0d2;});}else{return _0x46f0d2;}})['catch'](function(_0x2b67f6){logger[_0xfc28('0x50')](_0xfc28('0x51'),_0x2b67f6);throw _0x2b67f6;});}return _0x46f0d2;})[_0xfc28('0x25')](respondWithResult(_0x2cf546,0xc9))[_0xfc28('0x48')](handleError(_0x2cf546,null));};exports['update']=function(_0x298453,_0x2b57d3){if(_0x298453[_0xfc28('0x4c')]['id']){delete _0x298453[_0xfc28('0x4c')]['id'];}return db[_0xfc28('0x2e')][_0xfc28('0x4a')]({'where':{'id':_0x298453['params']['id']}})[_0xfc28('0x25')](handleEntityNotFound(_0x2b57d3,null))['then'](saveUpdates(_0x298453['body'],null))[_0xfc28('0x25')](respondWithResult(_0x2b57d3,null))['catch'](handleError(_0x2b57d3,null));};exports['destroy']=function(_0x184d09,_0x46774d){return db[_0xfc28('0x2e')]['find']({'where':{'id':_0x184d09[_0xfc28('0x49')]['id']}})[_0xfc28('0x25')](handleEntityNotFound(_0x46774d,null))[_0xfc28('0x25')](removeEntity(_0x46774d,null))[_0xfc28('0x48')](handleError(_0x46774d,null));};exports[_0xfc28('0x52')]=function(_0x2b9bf5,_0x43c35b,_0x5cccb2){if(_0x2b9bf5['body']['id']){delete _0x2b9bf5[_0xfc28('0x4c')]['id'];}return db[_0xfc28('0x2e')]['find']({'where':{'id':_0x2b9bf5['params']['id']}})[_0xfc28('0x25')](handleEntityNotFound(_0x43c35b,null))[_0xfc28('0x25')](function(_0x3584c6){if(_0x3584c6){_0x2b9bf5['body'][_0xfc28('0x53')]=_0x3584c6['id'];return db[_0xfc28('0x2e')][_0xfc28('0x4b')](_0x2b9bf5['body']);}})[_0xfc28('0x25')](respondWithResult(_0x43c35b,null))['catch'](handleError(_0x43c35b,null));};exports[_0xfc28('0x54')]=function(_0x1bbc6a,_0x1f24c3,_0x290abd){var _0x5dfc34={};var _0x22f1fa={};var _0x49935d;var _0x4af647;return db['Interval'][_0xfc28('0x55')]({'where':{'id':_0x1bbc6a[_0xfc28('0x49')]['id']}})[_0xfc28('0x25')](handleEntityNotFound(_0x1f24c3,null))[_0xfc28('0x25')](function(_0x6c6b04){if(_0x6c6b04){_0x49935d=_0x6c6b04;_0x22f1fa[_0xfc28('0x37')]=_[_0xfc28('0x34')](db[_0xfc28('0x2e')][_0xfc28('0x2f')]);_0x22f1fa[_0xfc28('0x33')]=_[_0xfc28('0x34')](_0x1bbc6a[_0xfc28('0x33')]);_0x22f1fa[_0xfc28('0x35')]=_[_0xfc28('0x36')](_0x22f1fa[_0xfc28('0x37')],_0x22f1fa[_0xfc28('0x33')]);_0x5dfc34[_0xfc28('0x38')]=_[_0xfc28('0x36')](_0x22f1fa[_0xfc28('0x37')],qs[_0xfc28('0x39')](_0x1bbc6a[_0xfc28('0x33')][_0xfc28('0x39')]));_0x5dfc34['attributes']=_0x5dfc34[_0xfc28('0x38')]['length']?_0x5dfc34[_0xfc28('0x38')]:_0x22f1fa[_0xfc28('0x37')];_0x5dfc34['order']=qs['sort'](_0x1bbc6a[_0xfc28('0x33')][_0xfc28('0x3e')]);_0x5dfc34['where']=qs['filters'](_[_0xfc28('0x40')](_0x1bbc6a[_0xfc28('0x33')],_0x22f1fa[_0xfc28('0x35')]));if(_0x1bbc6a[_0xfc28('0x33')][_0xfc28('0x41')]){_0x5dfc34[_0xfc28('0x3f')]=_[_0xfc28('0x42')](_0x5dfc34[_0xfc28('0x3f')],{'$or':_[_0xfc28('0x2d')](_0x5dfc34[_0xfc28('0x38')],function(_0x17f4c6){var _0x2f2ac7={};_0x2f2ac7[_0x17f4c6]={'$like':'%'+_0x1bbc6a['query'][_0xfc28('0x41')]+'%'};return _0x2f2ac7;})});}_0x5dfc34=_[_0xfc28('0x42')]({},_0x5dfc34,_0x1bbc6a['options']);return _0x49935d[_0xfc28('0x54')](_0x5dfc34);}})[_0xfc28('0x25')](function(_0x2efcc2){if(_0x2efcc2){_0x4af647=_0x2efcc2[_0xfc28('0x3a')];if(!_0x1bbc6a['query'][_0xfc28('0x3b')](_0xfc28('0x3c'))){_0x5dfc34[_0xfc28('0x1d')]=qs[_0xfc28('0x1d')](_0x1bbc6a[_0xfc28('0x33')][_0xfc28('0x1d')]);_0x5dfc34[_0xfc28('0x1f')]=qs['offset'](_0x1bbc6a['query'][_0xfc28('0x1f')]);}return _0x49935d[_0xfc28('0x54')](_0x5dfc34);}})['then'](function(_0x55cd3a){if(_0x55cd3a){return _0x55cd3a?{'count':_0x4af647,'rows':_0x55cd3a}:null;}})['then'](respondWithResult(_0x1f24c3,null))[_0xfc28('0x48')](handleError(_0x1f24c3,null));};exports['addIntervals']=function(_0x5a8dbd,_0x38f16d,_0x352c58){return db['Interval'][_0xfc28('0x55')]({'where':{'id':_0x5a8dbd[_0xfc28('0x49')]['id']}})[_0xfc28('0x25')](handleEntityNotFound(_0x38f16d,null))[_0xfc28('0x25')](function(_0x292028){if(_0x292028){return db[_0xfc28('0x56')][_0xfc28('0x57')](function(_0x29ab06){return db[_0xfc28('0x2e')]['destroy']({'where':{'IntervalId':_0x5a8dbd[_0xfc28('0x49')]['id']},'transaction':_0x29ab06})[_0xfc28('0x25')](function(_0x40e7a2){var _0x218579=_[_0xfc28('0x2d')](_0x5a8dbd['body'],function(_0x16145b){delete _0x16145b['id'];_0x16145b[_0xfc28('0x53')]=_0x5a8dbd[_0xfc28('0x49')]['id'];return _0x16145b;});return db['Interval'][_0xfc28('0x58')](_0x218579,{'transaction':_0x29ab06});});})[_0xfc28('0x25')](function(){return db['Interval'][_0xfc28('0x47')]({'where':{'IntervalId':_0x5a8dbd['params']['id']}});});}})[_0xfc28('0x25')](respondWithResult(_0x38f16d,null))[_0xfc28('0x48')](handleError(_0x38f16d,null));};
\ No newline at end of file
index 92896d5..6c66c84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80e0=['exports','Interval','rewrite','../../config/logger','api','moment','request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x80e0,0x9d));var _0x080e=function(_0x1acf9d,_0x2ca967){_0x1acf9d=_0x1acf9d-0x0;var _0x457468=_0x80e0[_0x1acf9d];return _0x457468;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x080e('0x0'))(_0x080e('0x1'));var moment=require(_0x080e('0x2'));var BPromise=require('bluebird');var rp=require(_0x080e('0x3'));var fs=require('fs');var path=require(_0x080e('0x4'));var rimraf=require(_0x080e('0x5'));var config=require('../../config/environment');var attributes=require(_0x080e('0x6'));var extensions=require(_0x080e('0x7'));module[_0x080e('0x8')]=function(_0x52548f,_0x4b61b7){return _0x52548f['define'](_0x080e('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2886dd,_0x5d48f0){extensions[_0x080e('0xa')](_0x52548f,_0x2886dd);},'afterBulkCreate':function(_0x1241ec,_0x15ce45,_0x43d2d5){_0x43d2d5();extensions[_0x080e('0xa')](_0x52548f,_0x1241ec[0x0]);},'afterUpdate':function(_0x5cf77c,_0x498a67){extensions[_0x080e('0xa')](_0x52548f,_0x5cf77c);},'afterDestroy':function(_0x358b11,_0x453e2e){extensions[_0x080e('0xa')](_0x52548f,_0x358b11);}}});};
\ No newline at end of file
+var _0x9a1f=['../../config/environment','./interval.attributes','exports','Interval','tools_intervals','rewrite','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3bffc5,_0x39ae01){var _0x31ccfa=function(_0x4b7d91){while(--_0x4b7d91){_0x3bffc5['push'](_0x3bffc5['shift']());}};_0x31ccfa(++_0x39ae01);}(_0x9a1f,0xde));var _0xf9a1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x9a1f[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xf9a1('0x0'));var util=require('util');var logger=require(_0xf9a1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf9a1('0x2'));var rp=require(_0xf9a1('0x3'));var fs=require('fs');var path=require(_0xf9a1('0x4'));var rimraf=require(_0xf9a1('0x5'));var config=require(_0xf9a1('0x6'));var attributes=require(_0xf9a1('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xf9a1('0x8')]=function(_0x16b150,_0x34529b){return _0x16b150['define'](_0xf9a1('0x9'),attributes,{'tableName':_0xf9a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x404bbf,_0x4e04fb){extensions[_0xf9a1('0xb')](_0x16b150,_0x404bbf);},'afterBulkCreate':function(_0x2fe3c2,_0x44a7f0,_0x363fec){_0x363fec();extensions[_0xf9a1('0xb')](_0x16b150,_0x2fe3c2[0x0]);},'afterUpdate':function(_0xbf9d36,_0x29a5da){extensions['rewrite'](_0x16b150,_0xbf9d36);},'afterDestroy':function(_0x541653,_0x221ab2){extensions[_0xf9a1('0xb')](_0x16b150,_0x541653);}}});};
\ No newline at end of file
index d5c8cb7..4423a3a 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(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 d3750ca..2d76f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x5b5bae,_0x3d9920){var _0x456eaf=function(_0x2effd8){while(--_0x2effd8){_0x5b5bae['push'](_0x5b5bae['shift']());}};_0x456eaf(++_0x3d9920);}(_0x2ef3,0xba));var _0x32ef=function(_0x32be08,_0x5847cd){_0x32be08=_0x32be08-0x0;var _0x1edca0=_0x2ef3[_0x32be08];return _0x1edca0;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
+var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x18f2b5,_0x1d776f){var _0x2aa56b=function(_0x77d8f4){while(--_0x77d8f4){_0x18f2b5['push'](_0x18f2b5['shift']());}};_0x2aa56b(++_0x1d776f);}(_0xdb28,0x106));var _0x8db2=function(_0x4b172f,_0x367689){_0x4b172f=_0x4b172f-0x0;var _0x1a107d=_0xdb28[_0x4b172f];return _0x1a107d;};'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 d693f60..5bbde5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x392f=['Basic\x20','toString','base64','request','setEncoding','utf8','end','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','fields','customfield_11501','customfield_11502','newToken','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x392f,0xf1));var _0xf392=function(_0x542f45,_0x37468a){_0x542f45=_0x542f45-0x0;var _0x38c609=_0x392f[_0x542f45];return _0x38c609;};'use strict';var BPromise=require(_0xf392('0x0'));var https=require(_0xf392('0x1'));var logger=require(_0xf392('0x2'))('api');var USERNAME=_0xf392('0x3');var PASSWORD=_0xf392('0x4');function openIssue(_0x14c898,_0xc71d7f){var _0x49ed68={'fields':{'project':{'key':_0x14c898[_0xf392('0x5')]||_0xf392('0x6')},'summary':(_0x14c898[_0xf392('0x7')]||_0xf392('0x8'))+_0xf392('0x9')+_0x14c898['ip'],'description':_0x14c898['description']||JSON[_0xf392('0xa')](_0x14c898),'issuetype':{'name':_0x14c898[_0xf392('0xb')]||'Bug'}}};_0x49ed68[_0xf392('0xc')]['customfield_11500']=_0x14c898['email'];_0x49ed68[_0xf392('0xc')][_0xf392('0xd')]=_0x14c898['oldToken'];_0x49ed68[_0xf392('0xc')][_0xf392('0xe')]=_0x14c898[_0xf392('0xf')];_0x49ed68['fields']['customfield_11503']=_0x14c898[_0xf392('0x10')];_0x49ed68['fields']['customfield_11504']=_0x14c898[_0xf392('0x11')];_0x49ed68[_0xf392('0xc')][_0xf392('0x12')]=_0x14c898['ip'];var _0xf4e50a={'host':_0xf392('0x13'),'port':0x1bb,'path':_0xf392('0x14'),'method':_0xf392('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xf392('0x16'),'Authorization':_0xf392('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xf392('0x18')](_0xf392('0x19'))}};var _0x98d809=JSON[_0xf392('0xa')](_0x49ed68);var _0x394cfd=https[_0xf392('0x1a')](_0xf4e50a,function(_0x4b3abf){_0x4b3abf[_0xf392('0x1b')](_0xf392('0x1c'));var _0x16b3df='';_0x4b3abf['on']('data',function(_0x43043a){_0x16b3df+=_0x43043a;});_0x4b3abf['on'](_0xf392('0x1d'),function(){if(_0xc71d7f){return _0xc71d7f['status'](_0x4b3abf[_0xf392('0x1e')])[_0xf392('0x1f')](JSON[_0xf392('0x20')](_0x16b3df));}});});_0x394cfd['on'](_0xf392('0x21'),function(_0x30a2d3){if(_0xc71d7f){return _0xc71d7f['status'](0x1f4)['json']({'errors':[{'message':_0xf392('0x22'),'type':_0xf392('0x23')}]});}});_0x394cfd[_0xf392('0x24')](_0x98d809);_0x394cfd[_0xf392('0x1d')]();}exports[_0xf392('0x25')]=openIssue;exports['send']=function(_0x3da819,_0x423661){_0x3da819[_0xf392('0x26')]['ip']=_0x3da819[_0xf392('0x27')][_0xf392('0x28')]||_0x3da819[_0xf392('0x29')]['remoteAddress']||_0x3da819[_0xf392('0x2a')]['remoteAddress']||_0x3da819['connection'][_0xf392('0x2a')][_0xf392('0x2b')];return openIssue(_0x3da819[_0xf392('0x26')],_0x423661);};
\ No newline at end of file
+var _0x6cb8=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','toString','base64','request','setEncoding','data','status','statusCode','json'];(function(_0x149980,_0xeb67c8){var _0x3aacce=function(_0x276700){while(--_0x276700){_0x149980['push'](_0x149980['shift']());}};_0x3aacce(++_0xeb67c8);}(_0x6cb8,0x1e4));var _0x86cb=function(_0x5dd957,_0x3de3e7){_0x5dd957=_0x5dd957-0x0;var _0x58326c=_0x6cb8[_0x5dd957];return _0x58326c;};'use strict';var BPromise=require(_0x86cb('0x0'));var https=require(_0x86cb('0x1'));var logger=require(_0x86cb('0x2'))('api');var USERNAME=_0x86cb('0x3');var PASSWORD=_0x86cb('0x4');function openIssue(_0x14797b,_0x437b46){var _0x210788={'fields':{'project':{'key':_0x14797b['key']||_0x86cb('0x5')},'summary':(_0x14797b['summary']||_0x86cb('0x6'))+_0x86cb('0x7')+_0x14797b['ip'],'description':_0x14797b[_0x86cb('0x8')]||JSON[_0x86cb('0x9')](_0x14797b),'issuetype':{'name':_0x14797b['issuetype']||_0x86cb('0xa')}}};_0x210788[_0x86cb('0xb')][_0x86cb('0xc')]=_0x14797b[_0x86cb('0xd')];_0x210788[_0x86cb('0xb')][_0x86cb('0xe')]=_0x14797b[_0x86cb('0xf')];_0x210788[_0x86cb('0xb')]['customfield_11502']=_0x14797b['newToken'];_0x210788[_0x86cb('0xb')][_0x86cb('0x10')]=_0x14797b[_0x86cb('0x11')];_0x210788[_0x86cb('0xb')][_0x86cb('0x12')]=_0x14797b[_0x86cb('0x13')];_0x210788[_0x86cb('0xb')][_0x86cb('0x14')]=_0x14797b['ip'];var _0x4626fc={'host':_0x86cb('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x86cb('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x86cb('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x86cb('0x18')](_0x86cb('0x19'))}};var _0xcb3382=JSON[_0x86cb('0x9')](_0x210788);var _0x5df33a=https[_0x86cb('0x1a')](_0x4626fc,function(_0x505bbf){_0x505bbf[_0x86cb('0x1b')]('utf8');var _0x4c64c1='';_0x505bbf['on'](_0x86cb('0x1c'),function(_0x128d44){_0x4c64c1+=_0x128d44;});_0x505bbf['on']('end',function(){if(_0x437b46){return _0x437b46[_0x86cb('0x1d')](_0x505bbf[_0x86cb('0x1e')])[_0x86cb('0x1f')](JSON['parse'](_0x4c64c1));}});});_0x5df33a['on'](_0x86cb('0x20'),function(_0xc87793){if(_0x437b46){return _0x437b46[_0x86cb('0x1d')](0x1f4)[_0x86cb('0x1f')]({'errors':[{'message':_0x86cb('0x21'),'type':_0x86cb('0x22')}]});}});_0x5df33a[_0x86cb('0x23')](_0xcb3382);_0x5df33a[_0x86cb('0x24')]();}exports['openIssue']=openIssue;exports[_0x86cb('0x25')]=function(_0x447629,_0x210007){_0x447629[_0x86cb('0x26')]['ip']=_0x447629[_0x86cb('0x27')][_0x86cb('0x28')]||_0x447629['connection'][_0x86cb('0x29')]||_0x447629[_0x86cb('0x2a')][_0x86cb('0x29')]||_0x447629['connection'][_0x86cb('0x2a')][_0x86cb('0x29')];return openIssue(_0x447629['body'],_0x210007);};
\ No newline at end of file
index 14a8de7..2dd5aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','Router','../../components/interaction/service'];(function(_0x1040c1,_0x569bba){var _0x21cfee=function(_0x1f3e1c){while(--_0x1f3e1c){_0x1040c1['push'](_0x1040c1['shift']());}};_0x21cfee(++_0x569bba);}(_0xb821,0xa7));var _0x1b82=function(_0x11d12e,_0xc35df2){_0x11d12e=_0x11d12e-0x0;var _0x311edd=_0xb821[_0x11d12e];return _0x311edd;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['post']('/',auth[_0x1b82('0x9')](),controller[_0x1b82('0xd')]);router[_0x1b82('0xe')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xf')]);router[_0x1b82('0x10')](_0x1b82('0xb'),auth['isAuthenticated'](),controller[_0x1b82('0x11')]);module[_0x1b82('0x12')]=router;
\ No newline at end of file
+var _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x4b62db,_0x1b18d3){var _0x2935a0=function(_0x1c7e6e){while(--_0x1c7e6e){_0x4b62db['push'](_0x4b62db['shift']());}};_0x2935a0(++_0x1b18d3);}(_0xa8a8,0xec));var _0x8a8a=function(_0x52397b,_0x127904){_0x52397b=_0x52397b-0x0;var _0x201755=_0xa8a8[_0x52397b];return _0x201755;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router;
\ No newline at end of file
index 76107cf..ec67900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x23b08c,_0x59dd13){_0x23b08c=_0x23b08c-0x0;var _0x3dea1b=_0x7a54[_0x23b08c];return _0x3dea1b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x4510b5,_0x3d2534){_0x4510b5=_0x4510b5-0x0;var _0x3126e2=_0x7a54[_0x4510b5];return _0x3126e2;};'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 ee4708e..3ac778d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535f=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','JscriptyAnswerReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','fields','options','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0x2bd604,_0x2c3354){var _0x248ce8=function(_0x563c97){while(--_0x563c97){_0x2bd604['push'](_0x2bd604['shift']());}};_0x248ce8(++_0x2c3354);}(_0x535f,0x111));var _0xf535=function(_0x51004f,_0x1adf07){_0x51004f=_0x51004f-0x0;var _0x480599=_0x535f[_0x51004f];return _0x480599;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf535('0x0'));var zipdir=require(_0xf535('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf535('0x2'));var moment=require(_0xf535('0x3'));var BPromise=require(_0xf535('0x4'));var Mustache=require(_0xf535('0x5'));var util=require('util');var path=require(_0xf535('0x6'));var sox=require(_0xf535('0x7'));var csv=require(_0xf535('0x8'));var ejs=require(_0xf535('0x9'));var fs=require('fs');var fs_extra=require(_0xf535('0xa'));var _=require(_0xf535('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf535('0xc'));var deskjs=require(_0xf535('0xd'));var toCsv=require(_0xf535('0x8'));var querystring=require('querystring');var Papa=require(_0xf535('0xe'));var Redis=require(_0xf535('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf535('0x10'));var hardwareService=require(_0xf535('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf535('0x12'));var config=require(_0xf535('0x13'));var licenseUtil=require(_0xf535('0x14'));var db=require(_0xf535('0x15'))['db'];function respondWithStatusCode(_0x471d53,_0x5e4cbd){_0x5e4cbd=_0x5e4cbd||0xcc;return function(_0x11928e){if(_0x11928e){return _0x471d53[_0xf535('0x16')](_0x5e4cbd);}return _0x471d53[_0xf535('0x17')](_0x5e4cbd)[_0xf535('0x18')]();};}function respondWithResult(_0x46792d,_0x338f06){_0x338f06=_0x338f06||0xc8;return function(_0x183049){if(_0x183049){return _0x46792d[_0xf535('0x17')](_0x338f06)[_0xf535('0x19')](_0x183049);}};}function respondWithFilteredResult(_0xb52d7f,_0xc3db30){return function(_0x4dacbb){if(_0x4dacbb){var _0x938e7f=typeof _0xc3db30[_0xf535('0x1a')]===_0xf535('0x1b')&&typeof _0xc3db30[_0xf535('0x1c')]===_0xf535('0x1b');var _0x1fb901=_0x4dacbb[_0xf535('0x1d')];var _0x33a8c3=_0x938e7f?0x0:_0xc3db30[_0xf535('0x1a')];var _0x477c1d=_0x938e7f?_0x4dacbb['count']:_0xc3db30[_0xf535('0x1a')]+_0xc3db30[_0xf535('0x1c')];var _0x6f757f;if(_0x477c1d>=_0x1fb901){_0x477c1d=_0x1fb901;_0x6f757f=0xc8;}else{_0x6f757f=0xce;}_0xb52d7f[_0xf535('0x17')](_0x6f757f);return _0xb52d7f['set'](_0xf535('0x1e'),_0x33a8c3+'-'+_0x477c1d+'/'+_0x1fb901)[_0xf535('0x19')](_0x4dacbb);}return null;};}function patchUpdates(_0x5c45bf){return function(_0x4ff009){try{jsonpatch['apply'](_0x4ff009,_0x5c45bf,!![]);}catch(_0x12f5d0){return BPromise[_0xf535('0x1f')](_0x12f5d0);}return _0x4ff009[_0xf535('0x20')]();};}function saveUpdates(_0x5e0ff4,_0x5b4980){return function(_0x438cb1){if(_0x438cb1){return _0x438cb1[_0xf535('0x21')](_0x5e0ff4)[_0xf535('0x22')](function(_0x16bd23){return _0x16bd23;});}return null;};}function removeEntity(_0x138cbd,_0x273ad0){return function(_0x358c91){if(_0x358c91){return _0x358c91[_0xf535('0x23')]()[_0xf535('0x22')](function(){_0x138cbd[_0xf535('0x17')](0xcc)[_0xf535('0x18')]();});}};}function handleEntityNotFound(_0x5b3917,_0x44ce19){return function(_0x28e761){if(!_0x28e761){_0x5b3917[_0xf535('0x16')](0x194);}return _0x28e761;};}function handleError(_0x46ce43,_0x407c5b){_0x407c5b=_0x407c5b||0x1f4;return function(_0x1250a0){logger[_0xf535('0x24')](_0x1250a0[_0xf535('0x25')]);if(_0x1250a0[_0xf535('0x26')]){delete _0x1250a0[_0xf535('0x26')];}_0x46ce43[_0xf535('0x17')](_0x407c5b)[_0xf535('0x27')](_0x1250a0);};}exports['index']=function(_0x5d1887,_0x47151e){var _0x12a94a={},_0xfba892={},_0x2fceb0={'count':0x0,'rows':[]};var _0x3e2cfe=_['map'](db[_0xf535('0x28')]['rawAttributes'],function(_0x508e77){return{'name':_0x508e77[_0xf535('0x29')],'type':_0x508e77[_0xf535('0x2a')][_0xf535('0x2b')]};});_0xfba892[_0xf535('0x2c')]=_[_0xf535('0x2d')](_0x3e2cfe,_0xf535('0x26'));_0xfba892['query']=_[_0xf535('0x2e')](_0x5d1887[_0xf535('0x2f')]);_0xfba892[_0xf535('0x30')]=_[_0xf535('0x31')](_0xfba892[_0xf535('0x2c')],_0xfba892[_0xf535('0x2f')]);_0x12a94a[_0xf535('0x32')]=_[_0xf535('0x31')](_0xfba892[_0xf535('0x2c')],qs['fields'](_0x5d1887[_0xf535('0x2f')]['fields']));_0x12a94a['attributes']=_0x12a94a['attributes'][_0xf535('0x33')]?_0x12a94a[_0xf535('0x32')]:_0xfba892[_0xf535('0x2c')];if(!_0x5d1887['query'][_0xf535('0x34')](_0xf535('0x35'))){_0x12a94a[_0xf535('0x1c')]=qs[_0xf535('0x1c')](_0x5d1887[_0xf535('0x2f')][_0xf535('0x1c')]);_0x12a94a['offset']=qs['offset'](_0x5d1887['query']['offset']);}_0x12a94a['order']=qs['sort'](_0x5d1887['query']['sort']);_0x12a94a[_0xf535('0x36')]=qs[_0xf535('0x30')](_['pick'](_0x5d1887[_0xf535('0x2f')],_0xfba892[_0xf535('0x30')]),_0x3e2cfe);if(_0x5d1887['query'][_0xf535('0x37')]){_0x12a94a[_0xf535('0x36')]=_[_0xf535('0x38')](_0x12a94a['where'],{'$or':_[_0xf535('0x2d')](_0x3e2cfe,function(_0x241685){if(_0x241685[_0xf535('0x2a')]!==_0xf535('0x39')){var _0x4945ef={};_0x4945ef[_0x241685[_0xf535('0x26')]]={'$like':'%'+_0x5d1887[_0xf535('0x2f')][_0xf535('0x37')]+'%'};return _0x4945ef;}})});}_0x12a94a=_[_0xf535('0x38')]({},_0x12a94a,_0x5d1887['options']);var _0x1c8198={'where':_0x12a94a[_0xf535('0x36')]};return db['JscriptyAnswerReport'][_0xf535('0x1d')](_0x1c8198)[_0xf535('0x22')](function(_0x506f27){_0x2fceb0['count']=_0x506f27;if(_0x5d1887[_0xf535('0x2f')][_0xf535('0x3a')]){_0x12a94a[_0xf535('0x3b')]=[{'all':!![]}];}return db[_0xf535('0x28')][_0xf535('0x3c')](_0x12a94a);})[_0xf535('0x22')](function(_0x3ab527){_0x2fceb0['rows']=_0x3ab527;return _0x2fceb0;})[_0xf535('0x22')](respondWithFilteredResult(_0x47151e,_0x12a94a))['catch'](handleError(_0x47151e,null));};exports[_0xf535('0x3d')]=function(_0x5eb910,_0x3583ca){var _0x598359={'raw':!![],'where':{'id':_0x5eb910[_0xf535('0x3e')]['id']}},_0x4fb589={};_0x4fb589['model']=_[_0xf535('0x2e')](db['JscriptyAnswerReport'][_0xf535('0x3f')]);_0x4fb589['query']=_[_0xf535('0x2e')](_0x5eb910[_0xf535('0x2f')]);_0x4fb589['filters']=_['intersection'](_0x4fb589[_0xf535('0x2c')],_0x4fb589[_0xf535('0x2f')]);_0x598359[_0xf535('0x32')]=_['intersection'](_0x4fb589['model'],qs[_0xf535('0x40')](_0x5eb910['query'][_0xf535('0x40')]));_0x598359['attributes']=_0x598359[_0xf535('0x32')]['length']?_0x598359[_0xf535('0x32')]:_0x4fb589['model'];if(_0x5eb910[_0xf535('0x2f')][_0xf535('0x3a')]){_0x598359[_0xf535('0x3b')]=[{'all':!![]}];}_0x598359=_[_0xf535('0x38')]({},_0x598359,_0x5eb910[_0xf535('0x41')]);return db[_0xf535('0x28')][_0xf535('0x42')](_0x598359)['then'](handleEntityNotFound(_0x3583ca,null))[_0xf535('0x22')](respondWithResult(_0x3583ca,null))[_0xf535('0x43')](handleError(_0x3583ca,null));};exports[_0xf535('0x44')]=function(_0x55fe82,_0x3ac295){return db[_0xf535('0x28')]['create'](_0x55fe82['body'],{})['then'](respondWithResult(_0x3ac295,0xc9))[_0xf535('0x43')](handleError(_0x3ac295,null));};exports[_0xf535('0x21')]=function(_0x42751b,_0x3096ff){if(_0x42751b[_0xf535('0x45')]['id']){delete _0x42751b[_0xf535('0x45')]['id'];}return db[_0xf535('0x28')]['find']({'where':{'id':_0x42751b['params']['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x3096ff,null))[_0xf535('0x22')](saveUpdates(_0x42751b[_0xf535('0x45')],null))[_0xf535('0x22')](respondWithResult(_0x3096ff,null))['catch'](handleError(_0x3096ff,null));};exports[_0xf535('0x23')]=function(_0x499156,_0x132904){return db[_0xf535('0x28')][_0xf535('0x42')]({'where':{'id':_0x499156[_0xf535('0x3e')]['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x132904,null))[_0xf535('0x22')](removeEntity(_0x132904,null))[_0xf535('0x43')](handleError(_0x132904,null));};exports['describe']=function(_0xdff8aa,_0x100982){return db[_0xf535('0x28')]['describe']()[_0xf535('0x22')](respondWithResult(_0x100982,null))[_0xf535('0x43')](handleError(_0x100982,null));};
\ No newline at end of file
+var _0x3937=['reject','save','update','destroy','then','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','filter','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x3199f8,_0x43078b){var _0xd444b6=function(_0xbb2a19){while(--_0xbb2a19){_0x3199f8['push'](_0x3199f8['shift']());}};_0xd444b6(++_0x43078b);}(_0x3937,0xbf));var _0x7393=function(_0x53a933,_0x218f09){_0x53a933=_0x53a933-0x0;var _0x577555=_0x3937[_0x53a933];return _0x577555;};'use strict';var emlformat=require(_0x7393('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7393('0x1'));var jsonpatch=require(_0x7393('0x2'));var rp=require('request-promise');var moment=require(_0x7393('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7393('0x4'));var util=require('util');var path=require(_0x7393('0x5'));var sox=require(_0x7393('0x6'));var csv=require(_0x7393('0x7'));var ejs=require(_0x7393('0x8'));var fs=require('fs');var fs_extra=require(_0x7393('0x9'));var _=require(_0x7393('0xa'));var squel=require(_0x7393('0xb'));var crypto=require(_0x7393('0xc'));var jsforce=require(_0x7393('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7393('0xe'));var Papa=require(_0x7393('0xf'));var Redis=require(_0x7393('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7393('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7393('0x12'));var config=require(_0x7393('0x13'));var licenseUtil=require(_0x7393('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79fc4e,_0x470f09){_0x470f09=_0x470f09||0xcc;return function(_0x20fb41){if(_0x20fb41){return _0x79fc4e[_0x7393('0x15')](_0x470f09);}return _0x79fc4e[_0x7393('0x16')](_0x470f09)[_0x7393('0x17')]();};}function respondWithResult(_0x38eaad,_0x212f44){_0x212f44=_0x212f44||0xc8;return function(_0x11030d){if(_0x11030d){return _0x38eaad['status'](_0x212f44)['json'](_0x11030d);}};}function respondWithFilteredResult(_0x414c37,_0x5d0d2b){return function(_0x5b91a9){if(_0x5b91a9){var _0x4e7ec6=typeof _0x5d0d2b[_0x7393('0x18')]==='undefined'&&typeof _0x5d0d2b[_0x7393('0x19')]===_0x7393('0x1a');var _0x5b8b03=_0x5b91a9[_0x7393('0x1b')];var _0x5745cb=_0x4e7ec6?0x0:_0x5d0d2b['offset'];var _0x31c8c2=_0x4e7ec6?_0x5b91a9[_0x7393('0x1b')]:_0x5d0d2b[_0x7393('0x18')]+_0x5d0d2b[_0x7393('0x19')];var _0x31902f;if(_0x31c8c2>=_0x5b8b03){_0x31c8c2=_0x5b8b03;_0x31902f=0xc8;}else{_0x31902f=0xce;}_0x414c37[_0x7393('0x16')](_0x31902f);return _0x414c37[_0x7393('0x1c')](_0x7393('0x1d'),_0x5745cb+'-'+_0x31c8c2+'/'+_0x5b8b03)['json'](_0x5b91a9);}return null;};}function patchUpdates(_0x52cd6a){return function(_0x30eae3){try{jsonpatch[_0x7393('0x1e')](_0x30eae3,_0x52cd6a,!![]);}catch(_0x3979b7){return BPromise[_0x7393('0x1f')](_0x3979b7);}return _0x30eae3[_0x7393('0x20')]();};}function saveUpdates(_0x52f716,_0x4d7870){return function(_0x544487){if(_0x544487){return _0x544487[_0x7393('0x21')](_0x52f716)['then'](function(_0x4cfdf6){return _0x4cfdf6;});}return null;};}function removeEntity(_0x2bf7a9,_0xa8f852){return function(_0x5b4498){if(_0x5b4498){return _0x5b4498[_0x7393('0x22')]()[_0x7393('0x23')](function(){_0x2bf7a9[_0x7393('0x16')](0xcc)[_0x7393('0x17')]();});}};}function handleEntityNotFound(_0x3fe456,_0x2c025f){return function(_0x1b31b8){if(!_0x1b31b8){_0x3fe456[_0x7393('0x15')](0x194);}return _0x1b31b8;};}function handleError(_0x328c47,_0x3d8773){_0x3d8773=_0x3d8773||0x1f4;return function(_0x1d7188){logger[_0x7393('0x24')](_0x1d7188[_0x7393('0x25')]);if(_0x1d7188['name']){delete _0x1d7188[_0x7393('0x26')];}_0x328c47[_0x7393('0x16')](_0x3d8773)[_0x7393('0x27')](_0x1d7188);};}exports[_0x7393('0x28')]=function(_0x1013aa,_0xd8dfae){var _0x4a865e={},_0x850b37={},_0x4befa4={'count':0x0,'rows':[]};var _0xc3c5c0=_['map'](db[_0x7393('0x29')][_0x7393('0x2a')],function(_0x45ebe1){return{'name':_0x45ebe1[_0x7393('0x2b')],'type':_0x45ebe1[_0x7393('0x2c')][_0x7393('0x2d')]};});_0x850b37[_0x7393('0x2e')]=_[_0x7393('0x2f')](_0xc3c5c0,_0x7393('0x26'));_0x850b37[_0x7393('0x30')]=_[_0x7393('0x31')](_0x1013aa[_0x7393('0x30')]);_0x850b37['filters']=_['intersection'](_0x850b37[_0x7393('0x2e')],_0x850b37['query']);_0x4a865e[_0x7393('0x32')]=_['intersection'](_0x850b37[_0x7393('0x2e')],qs['fields'](_0x1013aa[_0x7393('0x30')][_0x7393('0x33')]));_0x4a865e[_0x7393('0x32')]=_0x4a865e[_0x7393('0x32')][_0x7393('0x34')]?_0x4a865e[_0x7393('0x32')]:_0x850b37[_0x7393('0x2e')];if(!_0x1013aa[_0x7393('0x30')][_0x7393('0x35')](_0x7393('0x36'))){_0x4a865e['limit']=qs[_0x7393('0x19')](_0x1013aa['query'][_0x7393('0x19')]);_0x4a865e['offset']=qs[_0x7393('0x18')](_0x1013aa[_0x7393('0x30')][_0x7393('0x18')]);}_0x4a865e[_0x7393('0x37')]=qs[_0x7393('0x38')](_0x1013aa['query'][_0x7393('0x38')]);_0x4a865e['where']=qs[_0x7393('0x39')](_[_0x7393('0x3a')](_0x1013aa[_0x7393('0x30')],_0x850b37[_0x7393('0x39')]),_0xc3c5c0);if(_0x1013aa[_0x7393('0x30')]['filter']){_0x4a865e['where']=_[_0x7393('0x3b')](_0x4a865e[_0x7393('0x3c')],{'$or':_[_0x7393('0x2f')](_0xc3c5c0,function(_0x327d2e){if(_0x327d2e['type']!=='VIRTUAL'){var _0x594926={};_0x594926[_0x327d2e[_0x7393('0x26')]]={'$like':'%'+_0x1013aa[_0x7393('0x30')][_0x7393('0x3d')]+'%'};return _0x594926;}})});}_0x4a865e=_[_0x7393('0x3b')]({},_0x4a865e,_0x1013aa[_0x7393('0x3e')]);var _0x406b35={'where':_0x4a865e[_0x7393('0x3c')]};return db[_0x7393('0x29')][_0x7393('0x1b')](_0x406b35)[_0x7393('0x23')](function(_0xc39c05){_0x4befa4[_0x7393('0x1b')]=_0xc39c05;if(_0x1013aa[_0x7393('0x30')][_0x7393('0x3f')]){_0x4a865e[_0x7393('0x40')]=[{'all':!![]}];}return db[_0x7393('0x29')][_0x7393('0x41')](_0x4a865e);})[_0x7393('0x23')](function(_0x445b39){_0x4befa4[_0x7393('0x42')]=_0x445b39;return _0x4befa4;})[_0x7393('0x23')](respondWithFilteredResult(_0xd8dfae,_0x4a865e))[_0x7393('0x43')](handleError(_0xd8dfae,null));};exports['show']=function(_0x28dd3e,_0x16bcbf){var _0x25a2a6={'raw':!![],'where':{'id':_0x28dd3e[_0x7393('0x44')]['id']}},_0x40ab6d={};_0x40ab6d[_0x7393('0x2e')]=_[_0x7393('0x31')](db[_0x7393('0x29')]['rawAttributes']);_0x40ab6d['query']=_[_0x7393('0x31')](_0x28dd3e['query']);_0x40ab6d[_0x7393('0x39')]=_[_0x7393('0x45')](_0x40ab6d[_0x7393('0x2e')],_0x40ab6d[_0x7393('0x30')]);_0x25a2a6[_0x7393('0x32')]=_[_0x7393('0x45')](_0x40ab6d['model'],qs[_0x7393('0x33')](_0x28dd3e[_0x7393('0x30')][_0x7393('0x33')]));_0x25a2a6[_0x7393('0x32')]=_0x25a2a6[_0x7393('0x32')]['length']?_0x25a2a6['attributes']:_0x40ab6d[_0x7393('0x2e')];if(_0x28dd3e['query'][_0x7393('0x3f')]){_0x25a2a6[_0x7393('0x40')]=[{'all':!![]}];}_0x25a2a6=_[_0x7393('0x3b')]({},_0x25a2a6,_0x28dd3e[_0x7393('0x3e')]);return db[_0x7393('0x29')][_0x7393('0x46')](_0x25a2a6)[_0x7393('0x23')](handleEntityNotFound(_0x16bcbf,null))[_0x7393('0x23')](respondWithResult(_0x16bcbf,null))[_0x7393('0x43')](handleError(_0x16bcbf,null));};exports[_0x7393('0x47')]=function(_0x2f19b6,_0x26c327){return db[_0x7393('0x29')][_0x7393('0x47')](_0x2f19b6[_0x7393('0x48')],{})['then'](respondWithResult(_0x26c327,0xc9))[_0x7393('0x43')](handleError(_0x26c327,null));};exports[_0x7393('0x21')]=function(_0x27b796,_0x351ba9){if(_0x27b796['body']['id']){delete _0x27b796[_0x7393('0x48')]['id'];}return db[_0x7393('0x29')][_0x7393('0x46')]({'where':{'id':_0x27b796[_0x7393('0x44')]['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x351ba9,null))[_0x7393('0x23')](saveUpdates(_0x27b796[_0x7393('0x48')],null))[_0x7393('0x23')](respondWithResult(_0x351ba9,null))[_0x7393('0x43')](handleError(_0x351ba9,null));};exports['destroy']=function(_0xd3d01d,_0x1f66cb){return db[_0x7393('0x29')]['find']({'where':{'id':_0xd3d01d[_0x7393('0x44')]['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x1f66cb,null))['then'](removeEntity(_0x1f66cb,null))[_0x7393('0x43')](handleError(_0x1f66cb,null));};exports['describe']=function(_0x396992,_0x575df2){return db[_0x7393('0x29')][_0x7393('0x49')]()['then'](respondWithResult(_0x575df2,null))[_0x7393('0x43')](handleError(_0x575df2,null));};
\ No newline at end of file
index 351d718..ece3eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dab=['path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ff939,_0x5f54ea){var _0x3f8ba8=function(_0x25e6f7){while(--_0x25e6f7){_0x4ff939['push'](_0x4ff939['shift']());}};_0x3f8ba8(++_0x5f54ea);}(_0x4dab,0xf5));var _0xb4da=function(_0x4c94d1,_0x573a4f){_0x4c94d1=_0x4c94d1-0x0;var _0x48c2c3=_0x4dab[_0x4c94d1];return _0x48c2c3;};'use strict';var _=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var logger=require(_0xb4da('0x2'))(_0xb4da('0x3'));var moment=require(_0xb4da('0x4'));var BPromise=require(_0xb4da('0x5'));var rp=require(_0xb4da('0x6'));var fs=require('fs');var path=require(_0xb4da('0x7'));var rimraf=require(_0xb4da('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4da('0x9'));module[_0xb4da('0xa')]=function(_0x2df5dc,_0x3baa05){return _0x2df5dc[_0xb4da('0xb')](_0xb4da('0xc'),attributes,{'tableName':_0xb4da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8e1=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2f9d8c,_0x436819){var _0x3de0ac=function(_0x1e152a){while(--_0x1e152a){_0x2f9d8c['push'](_0x2f9d8c['shift']());}};_0x3de0ac(++_0x436819);}(_0xf8e1,0x167));var _0x1f8e=function(_0x1b42e8,_0x4ef0d7){_0x1b42e8=_0x1b42e8-0x0;var _0x50b5b6=_0xf8e1[_0x1b42e8];return _0x50b5b6;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var logger=require(_0x1f8e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f8e('0x3'));var rp=require(_0x1f8e('0x4'));var fs=require('fs');var path=require(_0x1f8e('0x5'));var rimraf=require(_0x1f8e('0x6'));var config=require(_0x1f8e('0x7'));var attributes=require(_0x1f8e('0x8'));module[_0x1f8e('0x9')]=function(_0x5c8021,_0xa2dd9){return _0x5c8021[_0x1f8e('0xa')](_0x1f8e('0xb'),attributes,{'tableName':_0x1f8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e62cd6d..0c3a919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb71f=['rpc','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x447725,_0x49753b){var _0x399167=function(_0x1e47d9){while(--_0x1e47d9){_0x447725['push'](_0x447725['shift']());}};_0x399167(++_0x49753b);}(_0xb71f,0x139));var _0xfb71=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0xb71f[_0x46111d];return _0xe82586;};'use strict';var _=require(_0xfb71('0x0'));var util=require(_0xfb71('0x1'));var moment=require(_0xfb71('0x2'));var BPromise=require(_0xfb71('0x3'));var rs=require(_0xfb71('0x4'));var fs=require('fs');var Redis=require(_0xfb71('0x5'));var db=require(_0xfb71('0x6'))['db'];var utils=require(_0xfb71('0x7'));var logger=require(_0xfb71('0x8'))(_0xfb71('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb71('0xa')][_0xfb71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x115597,_0x1ad306,_0x11fdae){return new BPromise(function(_0x47cc63,_0x2e308d){return client[_0xfb71('0xc')](_0x115597,_0x11fdae)[_0xfb71('0xd')](function(_0x25f17a){logger[_0xfb71('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ad306,_0xfb71('0xf'));logger[_0xfb71('0x10')](_0xfb71('0x11'),_0x1ad306,'request\x20sent',JSON['stringify'](_0x25f17a));if(_0x25f17a[_0xfb71('0x12')]){if(_0x25f17a[_0xfb71('0x12')][_0xfb71('0x13')]===0x1f4){logger[_0xfb71('0x12')](_0xfb71('0x14'),_0x1ad306,_0x25f17a['error']['message']);return _0x2e308d(_0x25f17a[_0xfb71('0x12')][_0xfb71('0x15')]);}logger[_0xfb71('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ad306,_0x25f17a['error'][_0xfb71('0x15')]);return _0x47cc63(_0x25f17a['error'][_0xfb71('0x15')]);}else{logger[_0xfb71('0xe')](_0xfb71('0x14'),_0x1ad306,_0xfb71('0xf'));_0x47cc63(_0x25f17a[_0xfb71('0x16')][_0xfb71('0x15')]);}})['catch'](function(_0x543c29){logger[_0xfb71('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ad306,_0x543c29);_0x2e308d(_0x543c29);});});}
\ No newline at end of file
+var _0x2d53=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x120599,_0x4f7ab0){var _0x3b9d4b=function(_0x3e7b1a){while(--_0x3e7b1a){_0x120599['push'](_0x120599['shift']());}};_0x3b9d4b(++_0x4f7ab0);}(_0x2d53,0xaa));var _0x32d5=function(_0x3c729b,_0x2a4146){_0x3c729b=_0x3c729b-0x0;var _0x55894c=_0x2d53[_0x3c729b];return _0x55894c;};'use strict';var _=require(_0x32d5('0x0'));var util=require('util');var moment=require(_0x32d5('0x1'));var BPromise=require(_0x32d5('0x2'));var rs=require(_0x32d5('0x3'));var fs=require('fs');var Redis=require(_0x32d5('0x4'));var db=require(_0x32d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x32d5('0x6'))(_0x32d5('0x7'));var config=require(_0x32d5('0x8'));var jayson=require(_0x32d5('0x9'));var client=jayson[_0x32d5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5abb26,_0x45f512,_0x5e4d68){return new BPromise(function(_0x3dab95,_0x4f529f){return client[_0x32d5('0xb')](_0x5abb26,_0x5e4d68)[_0x32d5('0xc')](function(_0x54b019){logger[_0x32d5('0xd')](_0x32d5('0xe'),_0x45f512,_0x32d5('0xf'));logger[_0x32d5('0x10')](_0x32d5('0x11'),_0x45f512,_0x32d5('0xf'),JSON['stringify'](_0x54b019));if(_0x54b019[_0x32d5('0x12')]){if(_0x54b019[_0x32d5('0x12')][_0x32d5('0x13')]===0x1f4){logger[_0x32d5('0x12')](_0x32d5('0xe'),_0x45f512,_0x54b019[_0x32d5('0x12')][_0x32d5('0x14')]);return _0x4f529f(_0x54b019[_0x32d5('0x12')][_0x32d5('0x14')]);}logger[_0x32d5('0x12')](_0x32d5('0xe'),_0x45f512,_0x54b019[_0x32d5('0x12')][_0x32d5('0x14')]);return _0x3dab95(_0x54b019[_0x32d5('0x12')][_0x32d5('0x14')]);}else{logger[_0x32d5('0xd')](_0x32d5('0xe'),_0x45f512,_0x32d5('0xf'));_0x3dab95(_0x54b019[_0x32d5('0x15')][_0x32d5('0x14')]);}})['catch'](function(_0x24d2e5){logger['error'](_0x32d5('0xe'),_0x45f512,_0x24d2e5);_0x4f529f(_0x24d2e5);});});}
\ No newline at end of file
index 925a5f1..dab292b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c1=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x36da2a,_0x139b77){var _0x457b21=function(_0x36eba8){while(--_0x36eba8){_0x36da2a['push'](_0x36da2a['shift']());}};_0x457b21(++_0x139b77);}(_0x13c1,0x190));var _0x113c=function(_0x32e6e6,_0x140ece){_0x32e6e6=_0x32e6e6-0x0;var _0x57d42e=_0x13c1[_0x32e6e6];return _0x57d42e;};'use strict';var multer=require(_0x113c('0x0'));var util=require(_0x113c('0x1'));var path=require(_0x113c('0x2'));var timeout=require('connect-timeout');var express=require(_0x113c('0x3'));var router=express[_0x113c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x113c('0x5'));var interaction=require(_0x113c('0x6'));var config=require(_0x113c('0x7'));var controller=require(_0x113c('0x8'));router[_0x113c('0x9')]('/',auth['isAuthenticated'](),controller[_0x113c('0xa')]);router[_0x113c('0x9')](_0x113c('0xb'),auth[_0x113c('0xc')](),controller[_0x113c('0xd')]);router[_0x113c('0x9')](_0x113c('0xe'),auth['isAuthenticated'](),controller[_0x113c('0xf')]);router['get'](_0x113c('0x10'),auth['isAuthenticated'](),controller[_0x113c('0x11')]);router[_0x113c('0x9')](_0x113c('0x12'),auth['isAuthenticated'](),timeout(_0x113c('0x13')),controller[_0x113c('0x14')]);router[_0x113c('0x15')]('/',auth['isAuthenticated'](),controller[_0x113c('0x16')]);router[_0x113c('0x15')](_0x113c('0x17'),auth[_0x113c('0xc')](),controller[_0x113c('0x18')]);router[_0x113c('0x19')](_0x113c('0xb'),auth['isAuthenticated'](),controller[_0x113c('0x1a')]);router[_0x113c('0x1b')](_0x113c('0xb'),auth[_0x113c('0xc')](),controller['destroy']);module[_0x113c('0x1c')]=router;
\ No newline at end of file
+var _0xf6cb=['getSessions','getAnswers','30s','getSummary','post','create','clone','put','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','/:id','isAuthenticated','show','get'];(function(_0x13544c,_0x16eb6f){var _0xec6b=function(_0x51a028){while(--_0x51a028){_0x13544c['push'](_0x13544c['shift']());}};_0xec6b(++_0x16eb6f);}(_0xf6cb,0xf9));var _0xbf6c=function(_0x24cacd,_0x57b565){_0x24cacd=_0x24cacd-0x0;var _0x46e4e6=_0xf6cb[_0x24cacd];return _0x46e4e6;};'use strict';var multer=require('multer');var util=require(_0xbf6c('0x0'));var path=require(_0xbf6c('0x1'));var timeout=require(_0xbf6c('0x2'));var express=require(_0xbf6c('0x3'));var router=express[_0xbf6c('0x4')]();var fs_extra=require(_0xbf6c('0x5'));var auth=require(_0xbf6c('0x6'));var interaction=require(_0xbf6c('0x7'));var config=require(_0xbf6c('0x8'));var controller=require(_0xbf6c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xbf6c('0xa')]);router['get'](_0xbf6c('0xb'),auth[_0xbf6c('0xc')](),controller[_0xbf6c('0xd')]);router[_0xbf6c('0xe')]('/:id/sessions',auth[_0xbf6c('0xc')](),controller[_0xbf6c('0xf')]);router[_0xbf6c('0xe')]('/:id/answers',auth[_0xbf6c('0xc')](),controller[_0xbf6c('0x10')]);router[_0xbf6c('0xe')]('/:id/summary',auth[_0xbf6c('0xc')](),timeout(_0xbf6c('0x11')),controller[_0xbf6c('0x12')]);router[_0xbf6c('0x13')]('/',auth[_0xbf6c('0xc')](),controller[_0xbf6c('0x14')]);router['post']('/:id/clone',auth[_0xbf6c('0xc')](),controller[_0xbf6c('0x15')]);router[_0xbf6c('0x16')](_0xbf6c('0xb'),auth[_0xbf6c('0xc')](),controller['update']);router['delete']('/:id',auth[_0xbf6c('0xc')](),controller[_0xbf6c('0x17')]);module['exports']=router;
\ No newline at end of file
index 840cdba..e293b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ee=['formData','stringify','isString','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue'];(function(_0x54cfa6,_0x3dae45){var _0x274463=function(_0x54e7d5){while(--_0x54e7d5){_0x54cfa6['push'](_0x54cfa6['shift']());}};_0x274463(++_0x3dae45);}(_0xd0ee,0x1e6));var _0xed0e=function(_0x1a9861,_0x1f7ff9){_0x1a9861=_0x1a9861-0x0;var _0x13f03f=_0xd0ee[_0x1a9861];return _0x13f03f;};'use strict';var Sequelize=require(_0xed0e('0x0'));var _=require(_0xed0e('0x1'));var util=require(_0xed0e('0x2'));module[_0xed0e('0x3')]={'name':{'type':Sequelize[_0xed0e('0x4')],'unique':_0xed0e('0x5')},'description':{'type':Sequelize[_0xed0e('0x4')]},'formData':{'type':Sequelize['TEXT'](_0xed0e('0x6')),'set':function(_0xe49773){if(_[_0xed0e('0x7')](_0xe49773)){this[_0xed0e('0x8')](_0xed0e('0x9'),JSON[_0xed0e('0xa')](_0xe49773));}else if(_[_0xed0e('0xb')](_0xe49773)){this['setDataValue'](_0xed0e('0x9'),_0xe49773);}else{this[_0xed0e('0x8')](_0xed0e('0x9'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xed0e('0xc')](_0xed0e('0x5'))||'',this[_0xed0e('0xc')](_0xed0e('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xed0e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1104=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','setDataValue','formData'];(function(_0x54f10e,_0x328584){var _0x1cc01d=function(_0x1aa9c0){while(--_0x1aa9c0){_0x54f10e['push'](_0x54f10e['shift']());}};_0x1cc01d(++_0x328584);}(_0x1104,0xa6));var _0x4110=function(_0x151cf8,_0x3339f4){_0x151cf8=_0x151cf8-0x0;var _0xce1fd3=_0x1104[_0x151cf8];return _0xce1fd3;};'use strict';var Sequelize=require(_0x4110('0x0'));var _=require(_0x4110('0x1'));var util=require(_0x4110('0x2'));module[_0x4110('0x3')]={'name':{'type':Sequelize[_0x4110('0x4')],'unique':_0x4110('0x5')},'description':{'type':Sequelize[_0x4110('0x4')]},'formData':{'type':Sequelize[_0x4110('0x6')](_0x4110('0x7')),'set':function(_0x385a55){if(_['isObjectLike'](_0x385a55)){this[_0x4110('0x8')](_0x4110('0x9'),JSON['stringify'](_0x385a55));}else if(_[_0x4110('0xa')](_0x385a55)){this[_0x4110('0x8')](_0x4110('0x9'),_0x385a55);}else{this[_0x4110('0x8')]('formData',util[_0x4110('0xb')](_0x4110('0xc'),this[_0x4110('0xd')](_0x4110('0x5'))||'',this[_0x4110('0xd')](_0x4110('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4110('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4110('0xf')],'defaultValue':![]}};
\ No newline at end of file
index e3f7e26..de46947 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb139=['keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','getAnswers','pick','ProjectId','JscriptyAnswerReport','number','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Projects','name','send','JscriptyProject','type','key','model','map'];(function(_0x42a6c3,_0x919300){var _0x3dd666=function(_0x24c7c9){while(--_0x24c7c9){_0x42a6c3['push'](_0x42a6c3['shift']());}};_0x3dd666(++_0x919300);}(_0xb139,0x1ba));var _0x9b13=function(_0x5400f6,_0x2f8052){_0x5400f6=_0x5400f6-0x0;var _0x33e8b3=_0xb139[_0x5400f6];return _0x33e8b3;};'use strict';var emlformat=require(_0x9b13('0x0'));var rimraf=require(_0x9b13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b13('0x2'));var rp=require(_0x9b13('0x3'));var moment=require(_0x9b13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9b13('0x5'));var sox=require(_0x9b13('0x6'));var csv=require(_0x9b13('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b13('0x8'));var _=require(_0x9b13('0x9'));var squel=require(_0x9b13('0xa'));var crypto=require(_0x9b13('0xb'));var jsforce=require(_0x9b13('0xc'));var deskjs=require(_0x9b13('0xd'));var toCsv=require(_0x9b13('0x7'));var querystring=require('querystring');var Papa=require(_0x9b13('0xe'));var Redis=require(_0x9b13('0xf'));var authService=require(_0x9b13('0x10'));var qs=require(_0x9b13('0x11'));var as=require(_0x9b13('0x12'));var hardwareService=require(_0x9b13('0x13'));var logger=require(_0x9b13('0x14'))(_0x9b13('0x15'));var utils=require(_0x9b13('0x16'));var config=require(_0x9b13('0x17'));var licenseUtil=require(_0x9b13('0x18'));var db=require(_0x9b13('0x19'))['db'];function respondWithStatusCode(_0x57c6bb,_0x2acc39){_0x2acc39=_0x2acc39||0xcc;return function(_0xf73b78){if(_0xf73b78){return _0x57c6bb[_0x9b13('0x1a')](_0x2acc39);}return _0x57c6bb[_0x9b13('0x1b')](_0x2acc39)[_0x9b13('0x1c')]();};}function respondWithResult(_0x38bca4,_0x6bb190){_0x6bb190=_0x6bb190||0xc8;return function(_0x89509a){if(_0x89509a){return _0x38bca4[_0x9b13('0x1b')](_0x6bb190)['json'](_0x89509a);}};}function respondWithFilteredResult(_0x22e19f,_0x52bffa){return function(_0x3c49d4){if(_0x3c49d4){var _0x2e60cd=typeof _0x52bffa[_0x9b13('0x1d')]===_0x9b13('0x1e')&&typeof _0x52bffa[_0x9b13('0x1f')]===_0x9b13('0x1e');var _0x5d3624=_0x3c49d4[_0x9b13('0x20')];var _0x113926=_0x2e60cd?0x0:_0x52bffa[_0x9b13('0x1d')];var _0x54b0d5=_0x2e60cd?_0x3c49d4[_0x9b13('0x20')]:_0x52bffa[_0x9b13('0x1d')]+_0x52bffa[_0x9b13('0x1f')];var _0x3a3aa2;if(_0x54b0d5>=_0x5d3624){_0x54b0d5=_0x5d3624;_0x3a3aa2=0xc8;}else{_0x3a3aa2=0xce;}_0x22e19f[_0x9b13('0x1b')](_0x3a3aa2);return _0x22e19f[_0x9b13('0x21')](_0x9b13('0x22'),_0x113926+'-'+_0x54b0d5+'/'+_0x5d3624)[_0x9b13('0x23')](_0x3c49d4);}return null;};}function patchUpdates(_0x2a1b73){return function(_0x2aebf4){try{jsonpatch[_0x9b13('0x24')](_0x2aebf4,_0x2a1b73,!![]);}catch(_0x463229){return BPromise['reject'](_0x463229);}return _0x2aebf4[_0x9b13('0x25')]();};}function saveUpdates(_0xc6e24,_0x52eb75){return function(_0x7abfbe){if(_0x7abfbe){return _0x7abfbe[_0x9b13('0x26')](_0xc6e24)[_0x9b13('0x27')](function(_0x14da02){return _0x14da02;});}return null;};}function removeEntity(_0x510259,_0x15babe){return function(_0x24d267){if(_0x24d267){return _0x24d267[_0x9b13('0x28')]()[_0x9b13('0x27')](function(){var _0x543001=_0x24d267[_0x9b13('0x29')]({'plain':!![]});var _0x591c3c=_0x9b13('0x2a');return db['UserProfileResource'][_0x9b13('0x28')]({'where':{'type':_0x591c3c,'resourceId':_0x543001['id']}})[_0x9b13('0x27')](function(){return _0x24d267;});})[_0x9b13('0x27')](function(){_0x510259[_0x9b13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192631,_0x58419e){return function(_0x37c1e1){if(!_0x37c1e1){_0x192631['sendStatus'](0x194);}return _0x37c1e1;};}function handleError(_0x4eeaf2,_0x1ecf08){_0x1ecf08=_0x1ecf08||0x1f4;return function(_0x1905ca){logger['error'](_0x1905ca['stack']);if(_0x1905ca[_0x9b13('0x2b')]){delete _0x1905ca[_0x9b13('0x2b')];}_0x4eeaf2[_0x9b13('0x1b')](_0x1ecf08)[_0x9b13('0x2c')](_0x1905ca);};}exports['index']=function(_0x2da422,_0x582ad8){var _0x122b8b={},_0x3b6af={},_0x5660c6={'count':0x0,'rows':[]};var _0x4a0a17=_['map'](db[_0x9b13('0x2d')]['rawAttributes'],function(_0x3262d1){return{'name':_0x3262d1['fieldName'],'type':_0x3262d1[_0x9b13('0x2e')][_0x9b13('0x2f')]};});_0x3b6af[_0x9b13('0x30')]=_[_0x9b13('0x31')](_0x4a0a17,_0x9b13('0x2b'));_0x3b6af['query']=_[_0x9b13('0x32')](_0x2da422[_0x9b13('0x33')]);_0x3b6af['filters']=_[_0x9b13('0x34')](_0x3b6af[_0x9b13('0x30')],_0x3b6af[_0x9b13('0x33')]);_0x122b8b[_0x9b13('0x35')]=_['intersection'](_0x3b6af['model'],qs[_0x9b13('0x36')](_0x2da422[_0x9b13('0x33')][_0x9b13('0x36')]));_0x122b8b[_0x9b13('0x35')]=_0x122b8b[_0x9b13('0x35')][_0x9b13('0x37')]?_0x122b8b[_0x9b13('0x35')]:_0x3b6af['model'];if(!_0x2da422['query'][_0x9b13('0x38')](_0x9b13('0x39'))){_0x122b8b[_0x9b13('0x1f')]=qs['limit'](_0x2da422[_0x9b13('0x33')]['limit']);_0x122b8b['offset']=qs['offset'](_0x2da422[_0x9b13('0x33')]['offset']);}_0x122b8b[_0x9b13('0x3a')]=qs[_0x9b13('0x3b')](_0x2da422[_0x9b13('0x33')][_0x9b13('0x3b')]);_0x122b8b[_0x9b13('0x3c')]=qs[_0x9b13('0x3d')](_['pick'](_0x2da422['query'],_0x3b6af[_0x9b13('0x3d')]),_0x4a0a17);if(_0x2da422['query'][_0x9b13('0x3e')]){_0x122b8b[_0x9b13('0x3c')]=_[_0x9b13('0x3f')](_0x122b8b[_0x9b13('0x3c')],{'$or':_[_0x9b13('0x31')](_0x4a0a17,function(_0x5edfed){if(_0x5edfed[_0x9b13('0x2e')]!==_0x9b13('0x40')){var _0x2770eb={};_0x2770eb[_0x5edfed['name']]={'$like':'%'+_0x2da422[_0x9b13('0x33')]['filter']+'%'};return _0x2770eb;}})});}_0x122b8b=_[_0x9b13('0x3f')]({},_0x122b8b,_0x2da422[_0x9b13('0x41')]);var _0x27ee0b={'where':_0x122b8b[_0x9b13('0x3c')]};return db[_0x9b13('0x2d')][_0x9b13('0x20')](_0x27ee0b)['then'](function(_0x297e8d){_0x5660c6[_0x9b13('0x20')]=_0x297e8d;if(_0x2da422[_0x9b13('0x33')][_0x9b13('0x42')]){_0x122b8b['include']=[{'all':!![]}];}return db[_0x9b13('0x2d')][_0x9b13('0x43')](_0x122b8b);})[_0x9b13('0x27')](function(_0x56f558){_0x5660c6[_0x9b13('0x44')]=_0x56f558;return _0x5660c6;})[_0x9b13('0x27')](respondWithFilteredResult(_0x582ad8,_0x122b8b))[_0x9b13('0x45')](handleError(_0x582ad8,null));};exports[_0x9b13('0x46')]=function(_0x334739,_0x48d52f){var _0x4e6db6={'raw':![],'where':{'id':_0x334739[_0x9b13('0x47')]['id']}},_0x507387={};_0x507387['model']=_[_0x9b13('0x32')](db[_0x9b13('0x2d')][_0x9b13('0x48')]);_0x507387[_0x9b13('0x33')]=_[_0x9b13('0x32')](_0x334739[_0x9b13('0x33')]);_0x507387[_0x9b13('0x3d')]=_['intersection'](_0x507387[_0x9b13('0x30')],_0x507387[_0x9b13('0x33')]);_0x4e6db6[_0x9b13('0x35')]=_['intersection'](_0x507387[_0x9b13('0x30')],qs[_0x9b13('0x36')](_0x334739['query'][_0x9b13('0x36')]));_0x4e6db6[_0x9b13('0x35')]=_0x4e6db6[_0x9b13('0x35')][_0x9b13('0x37')]?_0x4e6db6[_0x9b13('0x35')]:_0x507387['model'];if(_0x334739['query'][_0x9b13('0x42')]){_0x4e6db6['include']=[{'all':!![]}];}_0x4e6db6=_[_0x9b13('0x3f')]({},_0x4e6db6,_0x334739['options']);return db[_0x9b13('0x2d')][_0x9b13('0x49')](_0x4e6db6)[_0x9b13('0x27')](handleEntityNotFound(_0x48d52f,null))[_0x9b13('0x27')](respondWithResult(_0x48d52f,null))[_0x9b13('0x45')](handleError(_0x48d52f,null));};exports['create']=function(_0x1b397b,_0x110998){return db[_0x9b13('0x2d')][_0x9b13('0x4a')](_0x1b397b[_0x9b13('0x4b')],{})[_0x9b13('0x27')](function(_0x1cb92e){var _0x582e98=_0x1b397b['user'][_0x9b13('0x29')]({'plain':!![]});if(!_0x582e98)throw new Error(_0x9b13('0x4c'));if(_0x582e98[_0x9b13('0x4d')]===_0x9b13('0x4e')){var _0x26c2c2=_0x1cb92e['get']({'plain':!![]});var _0x32661e=_0x9b13('0x2a');return db[_0x9b13('0x4f')][_0x9b13('0x49')]({'where':{'name':_0x32661e,'userProfileId':_0x582e98[_0x9b13('0x50')]},'raw':!![]})[_0x9b13('0x27')](function(_0xaed59b){if(_0xaed59b&&_0xaed59b[_0x9b13('0x51')]===0x0){return db[_0x9b13('0x52')][_0x9b13('0x4a')]({'name':_0x26c2c2['name'],'resourceId':_0x26c2c2['id'],'type':_0xaed59b['name'],'sectionId':_0xaed59b['id']},{})[_0x9b13('0x27')](function(){return _0x1cb92e;});}else{return _0x1cb92e;}})[_0x9b13('0x45')](function(_0x5107de){logger[_0x9b13('0x53')](_0x9b13('0x54'),_0x5107de);throw _0x5107de;});}return _0x1cb92e;})['then'](respondWithResult(_0x110998,0xc9))['catch'](handleError(_0x110998,null));};exports[_0x9b13('0x55')]=function(_0x36f92b,_0x4427f9){var _0x37fb97={'where':{'id':_0x36f92b[_0x9b13('0x47')]['id']}},_0x2a9ba2={};_0x2a9ba2[_0x9b13('0x30')]=_['keys'](db[_0x9b13('0x2d')]['rawAttributes']);_0x37fb97['attributes']=_[_0x9b13('0x34')](_0x2a9ba2['model'],qs['fields'](_0x36f92b[_0x9b13('0x33')][_0x9b13('0x36')]));_0x37fb97[_0x9b13('0x35')]=_0x37fb97[_0x9b13('0x35')][_0x9b13('0x37')]?_0x37fb97[_0x9b13('0x35')]:_0x2a9ba2[_0x9b13('0x30')];if(_0x36f92b[_0x9b13('0x33')][_0x9b13('0x42')]){_0x37fb97[_0x9b13('0x56')]=[{'all':!![]}];}_0x37fb97=_[_0x9b13('0x3f')]({},_0x37fb97,_0x36f92b[_0x9b13('0x41')]);return db[_0x9b13('0x2d')][_0x9b13('0x49')](_0x37fb97)[_0x9b13('0x27')](handleEntityNotFound(_0x4427f9,null))['then'](function(_0x3c061b){if(_0x3c061b){var _0xd4c104=_0x3c061b[_0x9b13('0x29')]({'plain':!![]});_0xd4c104=qs[_0x9b13('0x57')](_0xd4c104,['id',_0x9b13('0x58'),_0x9b13('0x59')]);_0x36f92b['body']=_[_0x9b13('0x57')](_0x36f92b[_0x9b13('0x4b')],['id',_0x9b13('0x58'),_0x9b13('0x59')]);return db[_0x9b13('0x2d')][_0x9b13('0x4a')](_[_0x9b13('0x3f')](_0xd4c104,_0x36f92b[_0x9b13('0x4b')]),{'include':_0x36f92b[_0x9b13('0x33')][_0x9b13('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x828720){var _0x362a66=_0x36f92b[_0x9b13('0x4e')]['get']({'plain':!![]});if(!_0x362a66)throw new Error(_0x9b13('0x4c'));if(_0x362a66[_0x9b13('0x4d')]===_0x9b13('0x4e')){var _0x97bec6=_0x828720[_0x9b13('0x29')]({'plain':!![]});var _0x5a4f1a=_0x9b13('0x2a');return db[_0x9b13('0x4f')][_0x9b13('0x49')]({'where':{'name':_0x5a4f1a,'userProfileId':_0x362a66[_0x9b13('0x50')]},'raw':!![]})[_0x9b13('0x27')](function(_0x51e63a){if(_0x51e63a&&_0x51e63a[_0x9b13('0x51')]===0x0){return db[_0x9b13('0x52')]['create']({'name':_0x97bec6['name'],'resourceId':_0x97bec6['id'],'type':_0x51e63a[_0x9b13('0x2b')],'sectionId':_0x51e63a['id']},{})['then'](function(){return _0x828720;});}else{return _0x828720;}})['catch'](function(_0x5c4837){logger[_0x9b13('0x53')](_0x9b13('0x54'),_0x5c4837);throw _0x5c4837;});}return _0x828720;});}})[_0x9b13('0x27')](respondWithResult(_0x4427f9,0xc9))[_0x9b13('0x45')](handleError(_0x4427f9,null));};exports[_0x9b13('0x26')]=function(_0x3bfc43,_0x3e4c6e){if(_0x3bfc43[_0x9b13('0x4b')]['id']){delete _0x3bfc43[_0x9b13('0x4b')]['id'];}return db[_0x9b13('0x2d')][_0x9b13('0x49')]({'where':{'id':_0x3bfc43[_0x9b13('0x47')]['id']}})[_0x9b13('0x27')](handleEntityNotFound(_0x3e4c6e,null))['then'](saveUpdates(_0x3bfc43['body'],null))[_0x9b13('0x27')](respondWithResult(_0x3e4c6e,null))[_0x9b13('0x45')](handleError(_0x3e4c6e,null));};exports['destroy']=function(_0x4594ca,_0x20b169){return db[_0x9b13('0x2d')]['find']({'where':{'id':_0x4594ca[_0x9b13('0x47')]['id']}})[_0x9b13('0x27')](handleEntityNotFound(_0x20b169,null))[_0x9b13('0x27')](removeEntity(_0x20b169,null))[_0x9b13('0x45')](handleError(_0x20b169,null));};exports[_0x9b13('0x5a')]=function(_0xca35b9,_0x2c7b0d,_0x3d156d){var _0x36537c={'raw':!![],'where':{}};var _0x5b48fa={};var _0x368990={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x9b13('0x5b')]({'where':{'id':_0xca35b9[_0x9b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c7b0d,null))[_0x9b13('0x27')](function(_0x1bd393){if(_0x1bd393){_0x5b48fa['model']=_[_0x9b13('0x32')](db[_0x9b13('0x5c')][_0x9b13('0x48')]);_0x5b48fa[_0x9b13('0x33')]=_[_0x9b13('0x32')](_0xca35b9[_0x9b13('0x33')]);_0x5b48fa[_0x9b13('0x3d')]=_[_0x9b13('0x34')](_0x5b48fa['model'],_0x5b48fa[_0x9b13('0x33')]);_0x36537c[_0x9b13('0x35')]=_['intersection'](_0x5b48fa[_0x9b13('0x30')],qs[_0x9b13('0x36')](_0xca35b9[_0x9b13('0x33')][_0x9b13('0x36')]));_0x36537c['attributes']=_0x36537c[_0x9b13('0x35')]['length']?_0x36537c['attributes']:_0x5b48fa[_0x9b13('0x30')];if(!_0xca35b9[_0x9b13('0x33')][_0x9b13('0x38')]('nolimit')){_0x36537c[_0x9b13('0x1f')]=qs[_0x9b13('0x1f')](_0xca35b9[_0x9b13('0x33')][_0x9b13('0x1f')]);_0x36537c[_0x9b13('0x1d')]=qs['offset'](_0xca35b9[_0x9b13('0x33')][_0x9b13('0x1d')]);}_0x36537c[_0x9b13('0x3a')]=qs['sort'](_0xca35b9[_0x9b13('0x33')][_0x9b13('0x3b')]);_0x36537c[_0x9b13('0x3c')]=qs[_0x9b13('0x3d')](_['pick'](_0xca35b9[_0x9b13('0x33')],_0x5b48fa[_0x9b13('0x3d')]));_0x36537c[_0x9b13('0x3c')]['ProjectId']=_0x1bd393['id'];if(_0xca35b9[_0x9b13('0x33')][_0x9b13('0x3e')]){_0x36537c[_0x9b13('0x3c')]=_[_0x9b13('0x3f')](_0x36537c[_0x9b13('0x3c')],{'$or':_[_0x9b13('0x31')](_0x36537c[_0x9b13('0x35')],function(_0x3311b7){var _0x2989a5={};_0x2989a5[_0x3311b7]={'$like':'%'+_0xca35b9['query'][_0x9b13('0x3e')]+'%'};return _0x2989a5;})});}_0x36537c=_['merge']({},_0x36537c,_0xca35b9[_0x9b13('0x41')]);return db[_0x9b13('0x5c')][_0x9b13('0x20')]({'where':_0x36537c[_0x9b13('0x3c')]})[_0x9b13('0x27')](function(_0x2a7b7c){_0x368990[_0x9b13('0x20')]=_0x2a7b7c;if(_0xca35b9[_0x9b13('0x33')][_0x9b13('0x42')]){_0x36537c['include']=[{'all':!![]}];}return db[_0x9b13('0x5c')][_0x9b13('0x43')](_0x36537c);})[_0x9b13('0x27')](function(_0x407c5a){_0x368990[_0x9b13('0x44')]=_0x407c5a;return _0x368990;});}})[_0x9b13('0x27')](respondWithFilteredResult(_0x2c7b0d,_0x36537c))[_0x9b13('0x45')](handleError(_0x2c7b0d,null));};exports[_0x9b13('0x5d')]=function(_0x122ebf,_0x257961,_0x24edc2){var _0x2a4a4a={'raw':!![],'where':{}};var _0x4d8594={};var _0x293400={'count':0x0,'rows':[]};return db[_0x9b13('0x2d')][_0x9b13('0x5b')]({'where':{'id':_0x122ebf['params']['id']}})[_0x9b13('0x27')](handleEntityNotFound(_0x257961,null))['then'](function(_0x1e40c4){if(_0x1e40c4){_0x4d8594[_0x9b13('0x30')]=_[_0x9b13('0x32')](db['JscriptyAnswerReport'][_0x9b13('0x48')]);_0x4d8594['query']=_[_0x9b13('0x32')](_0x122ebf['query']);_0x4d8594['filters']=_['intersection'](_0x4d8594['model'],_0x4d8594[_0x9b13('0x33')]);_0x2a4a4a[_0x9b13('0x35')]=_['intersection'](_0x4d8594['model'],qs[_0x9b13('0x36')](_0x122ebf[_0x9b13('0x33')][_0x9b13('0x36')]));_0x2a4a4a[_0x9b13('0x35')]=_0x2a4a4a['attributes'][_0x9b13('0x37')]?_0x2a4a4a['attributes']:_0x4d8594[_0x9b13('0x30')];if(!_0x122ebf[_0x9b13('0x33')][_0x9b13('0x38')](_0x9b13('0x39'))){_0x2a4a4a[_0x9b13('0x1f')]=qs[_0x9b13('0x1f')](_0x122ebf[_0x9b13('0x33')][_0x9b13('0x1f')]);_0x2a4a4a[_0x9b13('0x1d')]=qs['offset'](_0x122ebf['query']['offset']);}_0x2a4a4a[_0x9b13('0x3a')]=qs[_0x9b13('0x3b')](_0x122ebf['query']['sort']);_0x2a4a4a[_0x9b13('0x3c')]=qs[_0x9b13('0x3d')](_[_0x9b13('0x5e')](_0x122ebf[_0x9b13('0x33')],_0x4d8594[_0x9b13('0x3d')]));_0x2a4a4a[_0x9b13('0x3c')][_0x9b13('0x5f')]=_0x1e40c4['id'];if(_0x122ebf[_0x9b13('0x33')]['filter']){_0x2a4a4a['where']=_[_0x9b13('0x3f')](_0x2a4a4a[_0x9b13('0x3c')],{'$or':_['map'](_0x2a4a4a[_0x9b13('0x35')],function(_0x167ec){var _0x2a9c0b={};_0x2a9c0b[_0x167ec]={'$like':'%'+_0x122ebf[_0x9b13('0x33')]['filter']+'%'};return _0x2a9c0b;})});}_0x2a4a4a=_[_0x9b13('0x3f')]({},_0x2a4a4a,_0x122ebf[_0x9b13('0x41')]);return db[_0x9b13('0x60')]['count']({'where':_0x2a4a4a[_0x9b13('0x3c')]})[_0x9b13('0x27')](function(_0x272cc7){_0x293400[_0x9b13('0x20')]=_0x272cc7;if(_0x122ebf[_0x9b13('0x33')][_0x9b13('0x42')]){_0x2a4a4a[_0x9b13('0x56')]=[{'all':!![]}];}return db[_0x9b13('0x60')][_0x9b13('0x43')](_0x2a4a4a);})[_0x9b13('0x27')](function(_0x1b2511){_0x293400[_0x9b13('0x44')]=_0x1b2511;return _0x293400;});}})[_0x9b13('0x27')](respondWithFilteredResult(_0x257961,_0x2a4a4a))[_0x9b13('0x45')](handleError(_0x257961,null));};function char(_0x61beb1){return _0x9b13('0x61')===typeof _0x61beb1?String['fromCharCode']['apply'](null,arguments):_0x61beb1;}function needsEncapsulation(_0x29532a){return!!_0x29532a&&(_0x29532a[_0x9b13('0x62')]()[_0x9b13('0x63')](char(0xd))>=0x0||_0x29532a[_0x9b13('0x62')]()[_0x9b13('0x63')](char(0xa))>=0x0||_0x29532a[_0x9b13('0x62')]()[_0x9b13('0x63')](char(0x2c))>=0x0||_0x29532a[_0x9b13('0x62')]()[_0x9b13('0x63')](char(0x22))>=0x0);}function encapsulate(_0x1b087c){var _0x10c02c=char(0x22),_0x21322e='\x5c'+char(0x22),_0xefeac8=_0x1b087c['toString']()[_0x9b13('0x64')](new RegExp(_0x10c02c,'g'),_0x21322e);return _0x10c02c+_0xefeac8+_0x10c02c;}exports['getSummary']=function(_0x13e318,_0x43d559,_0x49fa31){var _0x2caa67,_0x2c342e;var _0x39cf12={'where':{'ProjectId':_0x13e318[_0x9b13('0x47')]['id']}};if(_0x13e318[_0x9b13('0x33')][_0x9b13('0x65')]){_0x39cf12['where'][_0x9b13('0x66')]=JSON[_0x9b13('0x67')](_0x13e318[_0x9b13('0x33')][_0x9b13('0x65')]);}return db[_0x9b13('0x5c')][_0x9b13('0x43')](_0x39cf12)[_0x9b13('0x27')](handleEntityNotFound(_0x43d559,null))[_0x9b13('0x27')](function(_0x3c3726){if(_0x3c3726){_0x2caa67=_0x3c3726;return db[_0x9b13('0x68')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x2caa67,'id')},'ProjectId':_0x13e318[_0x9b13('0x47')]['id']},'order':_0x9b13('0x69')});}})[_0x9b13('0x27')](handleEntityNotFound(_0x43d559,null))['then'](function(_0xc0e1bb){if(_0xc0e1bb){_0x2c342e=_0xc0e1bb;var _0x1da647={};for(var _0x1ffc24=0x0,_0x1239ee=_0x2c342e[_0x9b13('0x37')];_0x1ffc24<_0x1239ee;_0x1ffc24++){if(!_0x1da647['hasOwnProperty'](_0x2c342e[_0x1ffc24][_0x9b13('0x6a')])){_0x1da647[_0x2c342e[_0x1ffc24][_0x9b13('0x6a')]]=needsEncapsulation(_0x2c342e[_0x1ffc24][_0x9b13('0x6b')])?encapsulate(_0x2c342e[_0x1ffc24][_0x9b13('0x6b')]):_0x2c342e[_0x1ffc24][_0x9b13('0x6b')];}}var _0x59d0fd=[],_0x185082={};for(var _0x4b10e0=0x0,_0x52d1ee=_0x2caa67[_0x9b13('0x37')];_0x4b10e0<_0x52d1ee;_0x4b10e0++){_0x185082={'ProjectId':_0x13e318['params']['id'],'SessionId':_0x2caa67[_0x4b10e0]['id'],'StartTime':moment(_0x2caa67[_0x4b10e0][_0x9b13('0x66')])['format'](_0x9b13('0x6c'))};for(var _0x2aae31=0x0,_0x4e9aa5=_0x2c342e[_0x9b13('0x37')];_0x2aae31<_0x4e9aa5;_0x2aae31++){if(_0x2c342e[_0x2aae31][_0x9b13('0x6d')]==_0x2caa67[_0x4b10e0]['id']&&_0x1da647[_0x9b13('0x38')](_0x2c342e[_0x2aae31][_0x9b13('0x6a')])){_0x185082[_0x1da647[_0x2c342e[_0x2aae31]['questionId']]]=_0x2c342e[_0x2aae31][_0x9b13('0x6e')];}}for(var _0x490897 in _0x1da647){if(!_0x185082[_0x9b13('0x38')](_0x1da647[_0x490897])){_0x185082[_0x1da647[_0x490897]]=null;}}_0x59d0fd[_0x9b13('0x6f')](_0x185082);}return _0x59d0fd;}})['then'](function(_0x1ad546){if(!_[_0x9b13('0x70')](_0x1ad546)){var _0x1bfd64=toCsv(_0x1ad546);var _0x18b191=Date[_0x9b13('0x71')]();fs[_0x9b13('0x72')](util[_0x9b13('0x73')](_0x9b13('0x74'),_0x13e318[_0x9b13('0x47')]['id'],_0x18b191),_0x1bfd64);_0x43d559[_0x9b13('0x75')](_0x9b13('0x76'),_0x9b13('0x77')+util['format'](_0x9b13('0x78'),_0x13e318['params']['id'],_0x18b191));_0x43d559[_0x9b13('0x75')](_0x9b13('0x79'),'text/csv');return _0x43d559[_0x9b13('0x7a')](util[_0x9b13('0x73')](_0x9b13('0x74'),_0x13e318[_0x9b13('0x47')]['id'],_0x18b191));}else{return _0x43d559[_0x9b13('0x1a')](0xcc);}})[_0x9b13('0x45')](handleError(_0x43d559,null));};
\ No newline at end of file
+var _0x1bc6=['autoAssociation','UserProfileResource','clone','params','omit','createdAt','updatedAt','update','destroy','JscriptySessionReport','nolimit','order','sort','ProjectId','findOne','JscriptyAnswerReport','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','writeFileSync','format','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','Projects','end','sendStatus','error','stack','name','send','map','JscriptyProject','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x4de2e3,_0x7c3e2a){var _0x5df1c7=function(_0x2d2d8d){while(--_0x2d2d8d){_0x4de2e3['push'](_0x4de2e3['shift']());}};_0x5df1c7(++_0x7c3e2a);}(_0x1bc6,0x94));var _0x61bc=function(_0x5bc8d3,_0x2fe93d){_0x5bc8d3=_0x5bc8d3-0x0;var _0x4d1662=_0x1bc6[_0x5bc8d3];return _0x4d1662;};'use strict';var emlformat=require(_0x61bc('0x0'));var rimraf=require(_0x61bc('0x1'));var zipdir=require(_0x61bc('0x2'));var jsonpatch=require(_0x61bc('0x3'));var rp=require(_0x61bc('0x4'));var moment=require(_0x61bc('0x5'));var BPromise=require(_0x61bc('0x6'));var Mustache=require('mustache');var util=require(_0x61bc('0x7'));var path=require(_0x61bc('0x8'));var sox=require(_0x61bc('0x9'));var csv=require(_0x61bc('0xa'));var ejs=require(_0x61bc('0xb'));var fs=require('fs');var fs_extra=require(_0x61bc('0xc'));var _=require(_0x61bc('0xd'));var squel=require(_0x61bc('0xe'));var crypto=require(_0x61bc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x61bc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x61bc('0x11'));var Papa=require('papaparse');var Redis=require(_0x61bc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x61bc('0x13'));var as=require(_0x61bc('0x14'));var hardwareService=require(_0x61bc('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x61bc('0x16'))['db'];function respondWithStatusCode(_0x4feac0,_0x3ecf9e){_0x3ecf9e=_0x3ecf9e||0xcc;return function(_0xd3759c){if(_0xd3759c){return _0x4feac0['sendStatus'](_0x3ecf9e);}return _0x4feac0['status'](_0x3ecf9e)['end']();};}function respondWithResult(_0x1029ff,_0x2872f0){_0x2872f0=_0x2872f0||0xc8;return function(_0x4f6796){if(_0x4f6796){return _0x1029ff[_0x61bc('0x17')](_0x2872f0)[_0x61bc('0x18')](_0x4f6796);}};}function respondWithFilteredResult(_0x22b684,_0x10ec88){return function(_0x2d763e){if(_0x2d763e){var _0x16c23b=typeof _0x10ec88['offset']===_0x61bc('0x19')&&typeof _0x10ec88[_0x61bc('0x1a')]==='undefined';var _0x5cc088=_0x2d763e[_0x61bc('0x1b')];var _0x2a6f35=_0x16c23b?0x0:_0x10ec88[_0x61bc('0x1c')];var _0x4ca1c3=_0x16c23b?_0x2d763e[_0x61bc('0x1b')]:_0x10ec88[_0x61bc('0x1c')]+_0x10ec88[_0x61bc('0x1a')];var _0xad92ef;if(_0x4ca1c3>=_0x5cc088){_0x4ca1c3=_0x5cc088;_0xad92ef=0xc8;}else{_0xad92ef=0xce;}_0x22b684['status'](_0xad92ef);return _0x22b684[_0x61bc('0x1d')](_0x61bc('0x1e'),_0x2a6f35+'-'+_0x4ca1c3+'/'+_0x5cc088)[_0x61bc('0x18')](_0x2d763e);}return null;};}function patchUpdates(_0x144b07){return function(_0x48019f){try{jsonpatch[_0x61bc('0x1f')](_0x48019f,_0x144b07,!![]);}catch(_0x17a5e3){return BPromise[_0x61bc('0x20')](_0x17a5e3);}return _0x48019f[_0x61bc('0x21')]();};}function saveUpdates(_0x1895fc,_0x141db2){return function(_0x1f4f49){if(_0x1f4f49){return _0x1f4f49['update'](_0x1895fc)[_0x61bc('0x22')](function(_0x35fb36){return _0x35fb36;});}return null;};}function removeEntity(_0x14d391,_0x3a8d1f){return function(_0x270f1c){if(_0x270f1c){return _0x270f1c['destroy']()[_0x61bc('0x22')](function(){var _0x40cb55=_0x270f1c[_0x61bc('0x23')]({'plain':!![]});var _0x297f40=_0x61bc('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x297f40,'resourceId':_0x40cb55['id']}})[_0x61bc('0x22')](function(){return _0x270f1c;});})['then'](function(){_0x14d391[_0x61bc('0x17')](0xcc)[_0x61bc('0x25')]();});}};}function handleEntityNotFound(_0x22b21e,_0x1be82f){return function(_0x50c4f3){if(!_0x50c4f3){_0x22b21e[_0x61bc('0x26')](0x194);}return _0x50c4f3;};}function handleError(_0x6199d2,_0x308d42){_0x308d42=_0x308d42||0x1f4;return function(_0x256b54){logger[_0x61bc('0x27')](_0x256b54[_0x61bc('0x28')]);if(_0x256b54[_0x61bc('0x29')]){delete _0x256b54[_0x61bc('0x29')];}_0x6199d2[_0x61bc('0x17')](_0x308d42)[_0x61bc('0x2a')](_0x256b54);};}exports['index']=function(_0x173e7b,_0x3ba10e){var _0x240d15={},_0x384a55={},_0x1038d3={'count':0x0,'rows':[]};var _0x15e709=_[_0x61bc('0x2b')](db[_0x61bc('0x2c')][_0x61bc('0x2d')],function(_0x4d6b7d){return{'name':_0x4d6b7d['fieldName'],'type':_0x4d6b7d['type'][_0x61bc('0x2e')]};});_0x384a55[_0x61bc('0x2f')]=_[_0x61bc('0x2b')](_0x15e709,_0x61bc('0x29'));_0x384a55[_0x61bc('0x30')]=_[_0x61bc('0x31')](_0x173e7b[_0x61bc('0x30')]);_0x384a55[_0x61bc('0x32')]=_['intersection'](_0x384a55[_0x61bc('0x2f')],_0x384a55[_0x61bc('0x30')]);_0x240d15['attributes']=_[_0x61bc('0x33')](_0x384a55['model'],qs[_0x61bc('0x34')](_0x173e7b['query'][_0x61bc('0x34')]));_0x240d15[_0x61bc('0x35')]=_0x240d15[_0x61bc('0x35')]['length']?_0x240d15['attributes']:_0x384a55['model'];if(!_0x173e7b[_0x61bc('0x30')][_0x61bc('0x36')]('nolimit')){_0x240d15['limit']=qs[_0x61bc('0x1a')](_0x173e7b[_0x61bc('0x30')]['limit']);_0x240d15[_0x61bc('0x1c')]=qs[_0x61bc('0x1c')](_0x173e7b[_0x61bc('0x30')]['offset']);}_0x240d15['order']=qs['sort'](_0x173e7b[_0x61bc('0x30')]['sort']);_0x240d15[_0x61bc('0x37')]=qs[_0x61bc('0x32')](_[_0x61bc('0x38')](_0x173e7b[_0x61bc('0x30')],_0x384a55['filters']),_0x15e709);if(_0x173e7b[_0x61bc('0x30')]['filter']){_0x240d15[_0x61bc('0x37')]=_['merge'](_0x240d15[_0x61bc('0x37')],{'$or':_[_0x61bc('0x2b')](_0x15e709,function(_0x2cab6d){if(_0x2cab6d['type']!==_0x61bc('0x39')){var _0xf6c720={};_0xf6c720[_0x2cab6d['name']]={'$like':'%'+_0x173e7b[_0x61bc('0x30')][_0x61bc('0x3a')]+'%'};return _0xf6c720;}})});}_0x240d15=_['merge']({},_0x240d15,_0x173e7b[_0x61bc('0x3b')]);var _0x4322b6={'where':_0x240d15[_0x61bc('0x37')]};return db[_0x61bc('0x2c')][_0x61bc('0x1b')](_0x4322b6)[_0x61bc('0x22')](function(_0x328931){_0x1038d3[_0x61bc('0x1b')]=_0x328931;if(_0x173e7b[_0x61bc('0x30')][_0x61bc('0x3c')]){_0x240d15[_0x61bc('0x3d')]=[{'all':!![]}];}return db['JscriptyProject'][_0x61bc('0x3e')](_0x240d15);})['then'](function(_0x1f1788){_0x1038d3[_0x61bc('0x3f')]=_0x1f1788;return _0x1038d3;})['then'](respondWithFilteredResult(_0x3ba10e,_0x240d15))[_0x61bc('0x40')](handleError(_0x3ba10e,null));};exports[_0x61bc('0x41')]=function(_0x2909a3,_0x3d44a1){var _0x8d73d8={'raw':![],'where':{'id':_0x2909a3['params']['id']}},_0x176219={};_0x176219[_0x61bc('0x2f')]=_[_0x61bc('0x31')](db[_0x61bc('0x2c')]['rawAttributes']);_0x176219[_0x61bc('0x30')]=_[_0x61bc('0x31')](_0x2909a3[_0x61bc('0x30')]);_0x176219[_0x61bc('0x32')]=_['intersection'](_0x176219['model'],_0x176219[_0x61bc('0x30')]);_0x8d73d8[_0x61bc('0x35')]=_[_0x61bc('0x33')](_0x176219[_0x61bc('0x2f')],qs['fields'](_0x2909a3[_0x61bc('0x30')][_0x61bc('0x34')]));_0x8d73d8[_0x61bc('0x35')]=_0x8d73d8[_0x61bc('0x35')][_0x61bc('0x42')]?_0x8d73d8[_0x61bc('0x35')]:_0x176219['model'];if(_0x2909a3[_0x61bc('0x30')][_0x61bc('0x3c')]){_0x8d73d8[_0x61bc('0x3d')]=[{'all':!![]}];}_0x8d73d8=_[_0x61bc('0x43')]({},_0x8d73d8,_0x2909a3[_0x61bc('0x3b')]);return db[_0x61bc('0x2c')][_0x61bc('0x44')](_0x8d73d8)[_0x61bc('0x22')](handleEntityNotFound(_0x3d44a1,null))['then'](respondWithResult(_0x3d44a1,null))[_0x61bc('0x40')](handleError(_0x3d44a1,null));};exports[_0x61bc('0x45')]=function(_0x24b185,_0x52f2f2){return db[_0x61bc('0x2c')]['create'](_0x24b185[_0x61bc('0x46')],{})['then'](function(_0x5ef7d0){var _0x27d848=_0x24b185[_0x61bc('0x47')]['get']({'plain':!![]});if(!_0x27d848)throw new Error(_0x61bc('0x48'));if(_0x27d848[_0x61bc('0x49')]==='user'){var _0x37f626=_0x5ef7d0[_0x61bc('0x23')]({'plain':!![]});var _0x5b82cd=_0x61bc('0x24');return db[_0x61bc('0x4a')][_0x61bc('0x44')]({'where':{'name':_0x5b82cd,'userProfileId':_0x27d848[_0x61bc('0x4b')]},'raw':!![]})[_0x61bc('0x22')](function(_0x381370){if(_0x381370&&_0x381370[_0x61bc('0x4c')]===0x0){return db[_0x61bc('0x4d')][_0x61bc('0x45')]({'name':_0x37f626[_0x61bc('0x29')],'resourceId':_0x37f626['id'],'type':_0x381370['name'],'sectionId':_0x381370['id']},{})[_0x61bc('0x22')](function(){return _0x5ef7d0;});}else{return _0x5ef7d0;}})[_0x61bc('0x40')](function(_0x234a4d){logger[_0x61bc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x234a4d);throw _0x234a4d;});}return _0x5ef7d0;})['then'](respondWithResult(_0x52f2f2,0xc9))['catch'](handleError(_0x52f2f2,null));};exports[_0x61bc('0x4e')]=function(_0x55de45,_0x242410){var _0x559519={'where':{'id':_0x55de45[_0x61bc('0x4f')]['id']}},_0xc1c33e={};_0xc1c33e[_0x61bc('0x2f')]=_[_0x61bc('0x31')](db[_0x61bc('0x2c')]['rawAttributes']);_0x559519[_0x61bc('0x35')]=_[_0x61bc('0x33')](_0xc1c33e[_0x61bc('0x2f')],qs[_0x61bc('0x34')](_0x55de45['query'][_0x61bc('0x34')]));_0x559519[_0x61bc('0x35')]=_0x559519[_0x61bc('0x35')][_0x61bc('0x42')]?_0x559519['attributes']:_0xc1c33e['model'];if(_0x55de45[_0x61bc('0x30')][_0x61bc('0x3c')]){_0x559519[_0x61bc('0x3d')]=[{'all':!![]}];}_0x559519=_[_0x61bc('0x43')]({},_0x559519,_0x55de45[_0x61bc('0x3b')]);return db[_0x61bc('0x2c')]['find'](_0x559519)[_0x61bc('0x22')](handleEntityNotFound(_0x242410,null))['then'](function(_0x31b1b8){if(_0x31b1b8){var _0xc2cf32=_0x31b1b8[_0x61bc('0x23')]({'plain':!![]});_0xc2cf32=qs[_0x61bc('0x50')](_0xc2cf32,['id',_0x61bc('0x51'),'updatedAt']);_0x55de45[_0x61bc('0x46')]=_['omit'](_0x55de45[_0x61bc('0x46')],['id',_0x61bc('0x51'),_0x61bc('0x52')]);return db['JscriptyProject']['create'](_[_0x61bc('0x43')](_0xc2cf32,_0x55de45[_0x61bc('0x46')]),{'include':_0x55de45[_0x61bc('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x61bc('0x22')](function(_0x1b1072){var _0x368311=_0x55de45[_0x61bc('0x47')][_0x61bc('0x23')]({'plain':!![]});if(!_0x368311)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x368311[_0x61bc('0x49')]==='user'){var _0x2a16a7=_0x1b1072[_0x61bc('0x23')]({'plain':!![]});var _0x28f3b0=_0x61bc('0x24');return db[_0x61bc('0x4a')]['find']({'where':{'name':_0x28f3b0,'userProfileId':_0x368311[_0x61bc('0x4b')]},'raw':!![]})['then'](function(_0x221f5a){if(_0x221f5a&&_0x221f5a[_0x61bc('0x4c')]===0x0){return db[_0x61bc('0x4d')][_0x61bc('0x45')]({'name':_0x2a16a7[_0x61bc('0x29')],'resourceId':_0x2a16a7['id'],'type':_0x221f5a['name'],'sectionId':_0x221f5a['id']},{})[_0x61bc('0x22')](function(){return _0x1b1072;});}else{return _0x1b1072;}})['catch'](function(_0x218542){logger[_0x61bc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x218542);throw _0x218542;});}return _0x1b1072;});}})[_0x61bc('0x22')](respondWithResult(_0x242410,0xc9))['catch'](handleError(_0x242410,null));};exports[_0x61bc('0x53')]=function(_0x2549eb,_0x4f42db){if(_0x2549eb['body']['id']){delete _0x2549eb[_0x61bc('0x46')]['id'];}return db[_0x61bc('0x2c')]['find']({'where':{'id':_0x2549eb['params']['id']}})[_0x61bc('0x22')](handleEntityNotFound(_0x4f42db,null))[_0x61bc('0x22')](saveUpdates(_0x2549eb[_0x61bc('0x46')],null))[_0x61bc('0x22')](respondWithResult(_0x4f42db,null))[_0x61bc('0x40')](handleError(_0x4f42db,null));};exports[_0x61bc('0x54')]=function(_0x5517ed,_0xc498ac){return db[_0x61bc('0x2c')][_0x61bc('0x44')]({'where':{'id':_0x5517ed['params']['id']}})[_0x61bc('0x22')](handleEntityNotFound(_0xc498ac,null))['then'](removeEntity(_0xc498ac,null))['catch'](handleError(_0xc498ac,null));};exports['getSessions']=function(_0x112860,_0x251cb7,_0x128425){var _0x42809b={'raw':!![],'where':{}};var _0x213f9b={};var _0x31237d={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x112860[_0x61bc('0x4f')]['id']}})['then'](handleEntityNotFound(_0x251cb7,null))[_0x61bc('0x22')](function(_0x742aeb){if(_0x742aeb){_0x213f9b['model']=_['keys'](db[_0x61bc('0x55')][_0x61bc('0x2d')]);_0x213f9b['query']=_['keys'](_0x112860[_0x61bc('0x30')]);_0x213f9b[_0x61bc('0x32')]=_['intersection'](_0x213f9b['model'],_0x213f9b[_0x61bc('0x30')]);_0x42809b[_0x61bc('0x35')]=_['intersection'](_0x213f9b[_0x61bc('0x2f')],qs[_0x61bc('0x34')](_0x112860['query']['fields']));_0x42809b[_0x61bc('0x35')]=_0x42809b[_0x61bc('0x35')][_0x61bc('0x42')]?_0x42809b['attributes']:_0x213f9b[_0x61bc('0x2f')];if(!_0x112860[_0x61bc('0x30')]['hasOwnProperty'](_0x61bc('0x56'))){_0x42809b[_0x61bc('0x1a')]=qs[_0x61bc('0x1a')](_0x112860['query'][_0x61bc('0x1a')]);_0x42809b['offset']=qs[_0x61bc('0x1c')](_0x112860[_0x61bc('0x30')][_0x61bc('0x1c')]);}_0x42809b[_0x61bc('0x57')]=qs['sort'](_0x112860['query'][_0x61bc('0x58')]);_0x42809b[_0x61bc('0x37')]=qs[_0x61bc('0x32')](_[_0x61bc('0x38')](_0x112860[_0x61bc('0x30')],_0x213f9b[_0x61bc('0x32')]));_0x42809b[_0x61bc('0x37')][_0x61bc('0x59')]=_0x742aeb['id'];if(_0x112860[_0x61bc('0x30')][_0x61bc('0x3a')]){_0x42809b[_0x61bc('0x37')]=_[_0x61bc('0x43')](_0x42809b[_0x61bc('0x37')],{'$or':_[_0x61bc('0x2b')](_0x42809b[_0x61bc('0x35')],function(_0x2f2e7a){var _0x32d843={};_0x32d843[_0x2f2e7a]={'$like':'%'+_0x112860[_0x61bc('0x30')][_0x61bc('0x3a')]+'%'};return _0x32d843;})});}_0x42809b=_[_0x61bc('0x43')]({},_0x42809b,_0x112860[_0x61bc('0x3b')]);return db[_0x61bc('0x55')][_0x61bc('0x1b')]({'where':_0x42809b['where']})['then'](function(_0x3b5547){_0x31237d[_0x61bc('0x1b')]=_0x3b5547;if(_0x112860[_0x61bc('0x30')][_0x61bc('0x3c')]){_0x42809b[_0x61bc('0x3d')]=[{'all':!![]}];}return db[_0x61bc('0x55')]['findAll'](_0x42809b);})[_0x61bc('0x22')](function(_0x3dfe93){_0x31237d['rows']=_0x3dfe93;return _0x31237d;});}})[_0x61bc('0x22')](respondWithFilteredResult(_0x251cb7,_0x42809b))[_0x61bc('0x40')](handleError(_0x251cb7,null));};exports['getAnswers']=function(_0x1f3832,_0x3b4b11,_0x4e7cc7){var _0x1b924a={'raw':!![],'where':{}};var _0x2b8950={};var _0x40e4b9={'count':0x0,'rows':[]};return db[_0x61bc('0x2c')][_0x61bc('0x5a')]({'where':{'id':_0x1f3832['params']['id']}})[_0x61bc('0x22')](handleEntityNotFound(_0x3b4b11,null))[_0x61bc('0x22')](function(_0x2341c3){if(_0x2341c3){_0x2b8950['model']=_['keys'](db[_0x61bc('0x5b')][_0x61bc('0x2d')]);_0x2b8950['query']=_['keys'](_0x1f3832['query']);_0x2b8950[_0x61bc('0x32')]=_[_0x61bc('0x33')](_0x2b8950['model'],_0x2b8950['query']);_0x1b924a[_0x61bc('0x35')]=_[_0x61bc('0x33')](_0x2b8950[_0x61bc('0x2f')],qs[_0x61bc('0x34')](_0x1f3832[_0x61bc('0x30')][_0x61bc('0x34')]));_0x1b924a[_0x61bc('0x35')]=_0x1b924a[_0x61bc('0x35')][_0x61bc('0x42')]?_0x1b924a[_0x61bc('0x35')]:_0x2b8950[_0x61bc('0x2f')];if(!_0x1f3832[_0x61bc('0x30')]['hasOwnProperty'](_0x61bc('0x56'))){_0x1b924a[_0x61bc('0x1a')]=qs[_0x61bc('0x1a')](_0x1f3832['query'][_0x61bc('0x1a')]);_0x1b924a[_0x61bc('0x1c')]=qs[_0x61bc('0x1c')](_0x1f3832[_0x61bc('0x30')][_0x61bc('0x1c')]);}_0x1b924a[_0x61bc('0x57')]=qs[_0x61bc('0x58')](_0x1f3832[_0x61bc('0x30')][_0x61bc('0x58')]);_0x1b924a[_0x61bc('0x37')]=qs[_0x61bc('0x32')](_[_0x61bc('0x38')](_0x1f3832[_0x61bc('0x30')],_0x2b8950[_0x61bc('0x32')]));_0x1b924a[_0x61bc('0x37')][_0x61bc('0x59')]=_0x2341c3['id'];if(_0x1f3832[_0x61bc('0x30')]['filter']){_0x1b924a['where']=_[_0x61bc('0x43')](_0x1b924a[_0x61bc('0x37')],{'$or':_['map'](_0x1b924a['attributes'],function(_0x39f4f1){var _0x22592a={};_0x22592a[_0x39f4f1]={'$like':'%'+_0x1f3832['query']['filter']+'%'};return _0x22592a;})});}_0x1b924a=_[_0x61bc('0x43')]({},_0x1b924a,_0x1f3832[_0x61bc('0x3b')]);return db[_0x61bc('0x5b')]['count']({'where':_0x1b924a[_0x61bc('0x37')]})[_0x61bc('0x22')](function(_0x3e9a6f){_0x40e4b9[_0x61bc('0x1b')]=_0x3e9a6f;if(_0x1f3832[_0x61bc('0x30')]['includeAll']){_0x1b924a['include']=[{'all':!![]}];}return db[_0x61bc('0x5b')][_0x61bc('0x3e')](_0x1b924a);})['then'](function(_0x35f1c1){_0x40e4b9[_0x61bc('0x3f')]=_0x35f1c1;return _0x40e4b9;});}})[_0x61bc('0x22')](respondWithFilteredResult(_0x3b4b11,_0x1b924a))[_0x61bc('0x40')](handleError(_0x3b4b11,null));};function char(_0x237802){return'number'===typeof _0x237802?String['fromCharCode'][_0x61bc('0x1f')](null,arguments):_0x237802;}function needsEncapsulation(_0x4acaf5){return!!_0x4acaf5&&(_0x4acaf5[_0x61bc('0x5c')]()[_0x61bc('0x5d')](char(0xd))>=0x0||_0x4acaf5[_0x61bc('0x5c')]()[_0x61bc('0x5d')](char(0xa))>=0x0||_0x4acaf5['toString']()[_0x61bc('0x5d')](char(0x2c))>=0x0||_0x4acaf5['toString']()[_0x61bc('0x5d')](char(0x22))>=0x0);}function encapsulate(_0xc63dcc){var _0x5c3501=char(0x22),_0x18fcac='\x5c'+char(0x22),_0x1ce99b=_0xc63dcc[_0x61bc('0x5c')]()[_0x61bc('0x5e')](new RegExp(_0x5c3501,'g'),_0x18fcac);return _0x5c3501+_0x1ce99b+_0x5c3501;}exports[_0x61bc('0x5f')]=function(_0x4593da,_0x45b594,_0x118817){var _0x2950dd,_0x1c1a50;var _0x5e2505={'where':{'ProjectId':_0x4593da[_0x61bc('0x4f')]['id']}};if(_0x4593da[_0x61bc('0x30')][_0x61bc('0x60')]){_0x5e2505[_0x61bc('0x37')][_0x61bc('0x61')]=JSON['parse'](_0x4593da[_0x61bc('0x30')][_0x61bc('0x60')]);}return db['JscriptySessionReport'][_0x61bc('0x3e')](_0x5e2505)[_0x61bc('0x22')](handleEntityNotFound(_0x45b594,null))[_0x61bc('0x22')](function(_0x112ee0){if(_0x112ee0){_0x2950dd=_0x112ee0;return db[_0x61bc('0x62')]['findAll']({'where':{'SessionId':{'$in':_[_0x61bc('0x2b')](_0x2950dd,'id')},'ProjectId':_0x4593da[_0x61bc('0x4f')]['id']},'order':_0x61bc('0x63')});}})[_0x61bc('0x22')](handleEntityNotFound(_0x45b594,null))[_0x61bc('0x22')](function(_0x1a177f){if(_0x1a177f){_0x1c1a50=_0x1a177f;var _0x4f3146={};for(var _0xda9851=0x0,_0x6df9d4=_0x1c1a50[_0x61bc('0x42')];_0xda9851<_0x6df9d4;_0xda9851++){if(!_0x4f3146[_0x61bc('0x36')](_0x1c1a50[_0xda9851][_0x61bc('0x64')])){_0x4f3146[_0x1c1a50[_0xda9851][_0x61bc('0x64')]]=needsEncapsulation(_0x1c1a50[_0xda9851][_0x61bc('0x65')])?encapsulate(_0x1c1a50[_0xda9851][_0x61bc('0x65')]):_0x1c1a50[_0xda9851][_0x61bc('0x65')];}}var _0x260a6a=[],_0xb61835={};for(var _0x170ad7=0x0,_0xbdc37c=_0x2950dd[_0x61bc('0x42')];_0x170ad7<_0xbdc37c;_0x170ad7++){_0xb61835={'ProjectId':_0x4593da['params']['id'],'SessionId':_0x2950dd[_0x170ad7]['id'],'StartTime':moment(_0x2950dd[_0x170ad7][_0x61bc('0x61')])['format'](_0x61bc('0x66'))};for(var _0x387cfb=0x0,_0x16f419=_0x1c1a50['length'];_0x387cfb<_0x16f419;_0x387cfb++){if(_0x1c1a50[_0x387cfb][_0x61bc('0x67')]==_0x2950dd[_0x170ad7]['id']&&_0x4f3146[_0x61bc('0x36')](_0x1c1a50[_0x387cfb]['questionId'])){_0xb61835[_0x4f3146[_0x1c1a50[_0x387cfb][_0x61bc('0x64')]]]=_0x1c1a50[_0x387cfb][_0x61bc('0x68')];}}for(var _0x39a99b in _0x4f3146){if(!_0xb61835[_0x61bc('0x36')](_0x4f3146[_0x39a99b])){_0xb61835[_0x4f3146[_0x39a99b]]=null;}}_0x260a6a['push'](_0xb61835);}return _0x260a6a;}})[_0x61bc('0x22')](function(_0x47636f){if(!_['isEmpty'](_0x47636f)){var _0x50a3d4=toCsv(_0x47636f);var _0x467690=Date['now']();fs[_0x61bc('0x69')](util[_0x61bc('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4593da['params']['id'],_0x467690),_0x50a3d4);_0x45b594['setHeader']('Content-disposition',_0x61bc('0x6b')+util[_0x61bc('0x6a')](_0x61bc('0x6c'),_0x4593da[_0x61bc('0x4f')]['id'],_0x467690));_0x45b594[_0x61bc('0x6d')](_0x61bc('0x6e'),'text/csv');return _0x45b594['download'](util[_0x61bc('0x6a')](_0x61bc('0x6f'),_0x4593da[_0x61bc('0x4f')]['id'],_0x467690));}else{return _0x45b594[_0x61bc('0x26')](0xcc);}})[_0x61bc('0x40')](handleError(_0x45b594,null));};
\ No newline at end of file
index b87c56e..1569120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7250=['rimraf','./jscriptyProject.attributes','JscriptyProject','jscripty_projects','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7250,0x1b1));var _0x0725=function(_0x10ce1e,_0x211236){_0x10ce1e=_0x10ce1e-0x0;var _0x4a5c9e=_0x7250[_0x10ce1e];return _0x4a5c9e;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var logger=require('../../config/logger')(_0x0725('0x2'));var moment=require(_0x0725('0x3'));var BPromise=require(_0x0725('0x4'));var rp=require(_0x0725('0x5'));var fs=require('fs');var path=require(_0x0725('0x6'));var rimraf=require(_0x0725('0x7'));var config=require('../../config/environment');var attributes=require(_0x0725('0x8'));module['exports']=function(_0x4e8c6c,_0xa32c3f){return _0x4e8c6c['define'](_0x0725('0x9'),attributes,{'tableName':_0x0725('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x37cc=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x37cc,0x185));var _0xc37c=function(_0x176041,_0x30691e){_0x176041=_0x176041-0x0;var _0x31b51d=_0x37cc[_0x176041];return _0x31b51d;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var logger=require(_0xc37c('0x2'))(_0xc37c('0x3'));var moment=require(_0xc37c('0x4'));var BPromise=require(_0xc37c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var attributes=require(_0xc37c('0x8'));module[_0xc37c('0x9')]=function(_0x4c9dcd,_0x582100){return _0x4c9dcd[_0xc37c('0xa')](_0xc37c('0xb'),attributes,{'tableName':_0xc37c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f745561..73a4fe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3fbbfd,_0x8a2f7){var _0x1673bb=function(_0x3fe00a){while(--_0x3fe00a){_0x3fbbfd['push'](_0x3fbbfd['shift']());}};_0x1673bb(++_0x8a2f7);}(_0x70e0,0x17b));var _0x070e=function(_0x5079a2,_0x39c973){_0x5079a2=_0x5079a2-0x0;var _0x382060=_0x70e0[_0x5079a2];return _0x382060;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
+var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x292f9b,_0x63979a){var _0x1a8460=function(_0x7d8cef){while(--_0x7d8cef){_0x292f9b['push'](_0x292f9b['shift']());}};_0x1a8460(++_0x63979a);}(_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')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index 83ef3fe..7a4092f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255d=['show','post','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x5d5586,_0x4ae26a){var _0x1ade11=function(_0x3a4ada){while(--_0x3a4ada){_0x5d5586['push'](_0x5d5586['shift']());}};_0x1ade11(++_0x4ae26a);}(_0x255d,0xc5));var _0xd255=function(_0x27b923,_0x427b92){_0x27b923=_0x27b923-0x0;var _0x59f09c=_0x255d[_0x27b923];return _0x59f09c;};'use strict';var multer=require('multer');var util=require(_0xd255('0x0'));var path=require(_0xd255('0x1'));var timeout=require('connect-timeout');var express=require(_0xd255('0x2'));var router=express[_0xd255('0x3')]();var fs_extra=require(_0xd255('0x4'));var auth=require(_0xd255('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd255('0x6'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0xd255('0x7')](),controller[_0xd255('0x8')]);router['get']('/describe',auth[_0xd255('0x7')](),controller['describe']);router[_0xd255('0x9')](_0xd255('0xa'),auth[_0xd255('0x7')](),controller[_0xd255('0xb')]);router[_0xd255('0xc')]('/',auth[_0xd255('0x7')](),controller['create']);router[_0xd255('0xd')](_0xd255('0xa'),auth[_0xd255('0x7')](),controller[_0xd255('0xe')]);router['delete'](_0xd255('0xa'),auth[_0xd255('0x7')](),controller[_0xd255('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa610=['../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x58b613,_0x5cda1f){var _0x1f2ada=function(_0x3719d6){while(--_0x3719d6){_0x58b613['push'](_0x58b613['shift']());}};_0x1f2ada(++_0x5cda1f);}(_0xa610,0x162));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0a61('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a61('0x1'));var express=require('express');var router=express[_0x0a61('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0a61('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a61('0x4'));var controller=require(_0x0a61('0x5'));router[_0x0a61('0x6')]('/',auth[_0x0a61('0x7')](),controller['index']);router[_0x0a61('0x6')](_0x0a61('0x8'),auth[_0x0a61('0x7')](),controller[_0x0a61('0x9')]);router['get'](_0x0a61('0xa'),auth['isAuthenticated'](),controller[_0x0a61('0xb')]);router['post']('/',auth[_0x0a61('0x7')](),controller[_0x0a61('0xc')]);router[_0x0a61('0xd')](_0x0a61('0xa'),auth[_0x0a61('0x7')](),controller[_0x0a61('0xe')]);router[_0x0a61('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0a61('0x10')]=router;
\ No newline at end of file
index 6239341..07cc8fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7a54,0x106));var _0x47a5=function(_0x352fcb,_0x2be915){_0x352fcb=_0x352fcb-0x0;var _0x135c3f=_0x7a54[_0x352fcb];return _0x135c3f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x126009,_0x4aba9f){_0x126009=_0x126009-0x0;var _0x4589b6=_0x7a54[_0x126009];return _0x4589b6;};'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 26ff757..c272d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d88=['find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','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','../../mysqldb','status','json','offset','limit','count','set','apply','reject','update','then','end','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x1d88,0x1c1));var _0x81d8=function(_0x1299fe,_0x3888b6){_0x1299fe=_0x1299fe-0x0;var _0x9fe1a8=_0x1d88[_0x1299fe];return _0x9fe1a8;};'use strict';var emlformat=require(_0x81d8('0x0'));var rimraf=require(_0x81d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x81d8('0x2'));var moment=require(_0x81d8('0x3'));var BPromise=require(_0x81d8('0x4'));var Mustache=require(_0x81d8('0x5'));var util=require(_0x81d8('0x6'));var path=require(_0x81d8('0x7'));var sox=require('sox');var csv=require(_0x81d8('0x8'));var ejs=require(_0x81d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81d8('0xa'));var squel=require(_0x81d8('0xb'));var crypto=require(_0x81d8('0xc'));var jsforce=require(_0x81d8('0xd'));var deskjs=require(_0x81d8('0xe'));var toCsv=require(_0x81d8('0x8'));var querystring=require(_0x81d8('0xf'));var Papa=require(_0x81d8('0x10'));var Redis=require('ioredis');var authService=require(_0x81d8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x81d8('0x12'));var hardwareService=require(_0x81d8('0x13'));var logger=require(_0x81d8('0x14'))(_0x81d8('0x15'));var utils=require(_0x81d8('0x16'));var config=require(_0x81d8('0x17'));var licenseUtil=require(_0x81d8('0x18'));var db=require(_0x81d8('0x19'))['db'];function respondWithStatusCode(_0x5b59b6,_0x3d8f82){_0x3d8f82=_0x3d8f82||0xcc;return function(_0x59353b){if(_0x59353b){return _0x5b59b6['sendStatus'](_0x3d8f82);}return _0x5b59b6[_0x81d8('0x1a')](_0x3d8f82)['end']();};}function respondWithResult(_0x207e06,_0x1ee9ab){_0x1ee9ab=_0x1ee9ab||0xc8;return function(_0x53d12f){if(_0x53d12f){return _0x207e06[_0x81d8('0x1a')](_0x1ee9ab)[_0x81d8('0x1b')](_0x53d12f);}};}function respondWithFilteredResult(_0x24be15,_0x648b19){return function(_0x36c223){if(_0x36c223){var _0x1556a9=typeof _0x648b19[_0x81d8('0x1c')]==='undefined'&&typeof _0x648b19[_0x81d8('0x1d')]==='undefined';var _0x2a8d02=_0x36c223[_0x81d8('0x1e')];var _0x17c86d=_0x1556a9?0x0:_0x648b19[_0x81d8('0x1c')];var _0x156b74=_0x1556a9?_0x36c223[_0x81d8('0x1e')]:_0x648b19[_0x81d8('0x1c')]+_0x648b19[_0x81d8('0x1d')];var _0x414d51;if(_0x156b74>=_0x2a8d02){_0x156b74=_0x2a8d02;_0x414d51=0xc8;}else{_0x414d51=0xce;}_0x24be15[_0x81d8('0x1a')](_0x414d51);return _0x24be15[_0x81d8('0x1f')]('Content-Range',_0x17c86d+'-'+_0x156b74+'/'+_0x2a8d02)[_0x81d8('0x1b')](_0x36c223);}return null;};}function patchUpdates(_0x350cc5){return function(_0x2d7da0){try{jsonpatch[_0x81d8('0x20')](_0x2d7da0,_0x350cc5,!![]);}catch(_0x17a4a5){return BPromise[_0x81d8('0x21')](_0x17a4a5);}return _0x2d7da0['save']();};}function saveUpdates(_0x35450a,_0x1f6992){return function(_0x1e104c){if(_0x1e104c){return _0x1e104c[_0x81d8('0x22')](_0x35450a)[_0x81d8('0x23')](function(_0x493070){return _0x493070;});}return null;};}function removeEntity(_0x24e385,_0x46f44a){return function(_0x368af7){if(_0x368af7){return _0x368af7['destroy']()[_0x81d8('0x23')](function(){_0x24e385[_0x81d8('0x1a')](0xcc)[_0x81d8('0x24')]();});}};}function handleEntityNotFound(_0x5d2967,_0x2007f8){return function(_0x49ea7d){if(!_0x49ea7d){_0x5d2967['sendStatus'](0x194);}return _0x49ea7d;};}function handleError(_0x582c7e,_0x562d68){_0x562d68=_0x562d68||0x1f4;return function(_0x4e6da3){logger[_0x81d8('0x25')](_0x4e6da3[_0x81d8('0x26')]);if(_0x4e6da3[_0x81d8('0x27')]){delete _0x4e6da3['name'];}_0x582c7e[_0x81d8('0x1a')](_0x562d68)['send'](_0x4e6da3);};}exports[_0x81d8('0x28')]=function(_0x1df2cb,_0x479c4c){var _0x7fd99f={},_0xd4cf5e={},_0x171a83={'count':0x0,'rows':[]};var _0x18badb=_[_0x81d8('0x29')](db[_0x81d8('0x2a')][_0x81d8('0x2b')],function(_0x90899d){return{'name':_0x90899d[_0x81d8('0x2c')],'type':_0x90899d[_0x81d8('0x2d')][_0x81d8('0x2e')]};});_0xd4cf5e['model']=_[_0x81d8('0x29')](_0x18badb,_0x81d8('0x27'));_0xd4cf5e[_0x81d8('0x2f')]=_[_0x81d8('0x30')](_0x1df2cb[_0x81d8('0x2f')]);_0xd4cf5e[_0x81d8('0x31')]=_[_0x81d8('0x32')](_0xd4cf5e[_0x81d8('0x33')],_0xd4cf5e[_0x81d8('0x2f')]);_0x7fd99f[_0x81d8('0x34')]=_[_0x81d8('0x32')](_0xd4cf5e[_0x81d8('0x33')],qs[_0x81d8('0x35')](_0x1df2cb['query']['fields']));_0x7fd99f[_0x81d8('0x34')]=_0x7fd99f[_0x81d8('0x34')][_0x81d8('0x36')]?_0x7fd99f[_0x81d8('0x34')]:_0xd4cf5e[_0x81d8('0x33')];if(!_0x1df2cb[_0x81d8('0x2f')][_0x81d8('0x37')](_0x81d8('0x38'))){_0x7fd99f[_0x81d8('0x1d')]=qs['limit'](_0x1df2cb['query']['limit']);_0x7fd99f[_0x81d8('0x1c')]=qs[_0x81d8('0x1c')](_0x1df2cb[_0x81d8('0x2f')][_0x81d8('0x1c')]);}_0x7fd99f['order']=qs[_0x81d8('0x39')](_0x1df2cb[_0x81d8('0x2f')]['sort']);_0x7fd99f[_0x81d8('0x3a')]=qs[_0x81d8('0x31')](_[_0x81d8('0x3b')](_0x1df2cb[_0x81d8('0x2f')],_0xd4cf5e[_0x81d8('0x31')]),_0x18badb);if(_0x1df2cb[_0x81d8('0x2f')][_0x81d8('0x3c')]){_0x7fd99f[_0x81d8('0x3a')]=_['merge'](_0x7fd99f['where'],{'$or':_[_0x81d8('0x29')](_0x18badb,function(_0x477314){if(_0x477314[_0x81d8('0x2d')]!==_0x81d8('0x3d')){var _0x418c5c={};_0x418c5c[_0x477314[_0x81d8('0x27')]]={'$like':'%'+_0x1df2cb[_0x81d8('0x2f')][_0x81d8('0x3c')]+'%'};return _0x418c5c;}})});}_0x7fd99f=_[_0x81d8('0x3e')]({},_0x7fd99f,_0x1df2cb[_0x81d8('0x3f')]);var _0x46e3f1={'where':_0x7fd99f[_0x81d8('0x3a')]};return db['JscriptyQuestionReport'][_0x81d8('0x1e')](_0x46e3f1)[_0x81d8('0x23')](function(_0x50c3fb){_0x171a83[_0x81d8('0x1e')]=_0x50c3fb;if(_0x1df2cb[_0x81d8('0x2f')][_0x81d8('0x40')]){_0x7fd99f[_0x81d8('0x41')]=[{'all':!![]}];}return db[_0x81d8('0x2a')][_0x81d8('0x42')](_0x7fd99f);})[_0x81d8('0x23')](function(_0x15a684){_0x171a83['rows']=_0x15a684;return _0x171a83;})[_0x81d8('0x23')](respondWithFilteredResult(_0x479c4c,_0x7fd99f))[_0x81d8('0x43')](handleError(_0x479c4c,null));};exports['show']=function(_0x6751c3,_0x229ed0){var _0x2f3cd6={'raw':!![],'where':{'id':_0x6751c3[_0x81d8('0x44')]['id']}},_0x3225a6={};_0x3225a6[_0x81d8('0x33')]=_['keys'](db[_0x81d8('0x2a')]['rawAttributes']);_0x3225a6[_0x81d8('0x2f')]=_[_0x81d8('0x30')](_0x6751c3[_0x81d8('0x2f')]);_0x3225a6[_0x81d8('0x31')]=_[_0x81d8('0x32')](_0x3225a6[_0x81d8('0x33')],_0x3225a6['query']);_0x2f3cd6[_0x81d8('0x34')]=_[_0x81d8('0x32')](_0x3225a6[_0x81d8('0x33')],qs[_0x81d8('0x35')](_0x6751c3[_0x81d8('0x2f')]['fields']));_0x2f3cd6[_0x81d8('0x34')]=_0x2f3cd6[_0x81d8('0x34')]['length']?_0x2f3cd6[_0x81d8('0x34')]:_0x3225a6['model'];if(_0x6751c3[_0x81d8('0x2f')][_0x81d8('0x40')]){_0x2f3cd6['include']=[{'all':!![]}];}_0x2f3cd6=_['merge']({},_0x2f3cd6,_0x6751c3['options']);return db[_0x81d8('0x2a')][_0x81d8('0x45')](_0x2f3cd6)[_0x81d8('0x23')](handleEntityNotFound(_0x229ed0,null))[_0x81d8('0x23')](respondWithResult(_0x229ed0,null))[_0x81d8('0x43')](handleError(_0x229ed0,null));};exports[_0x81d8('0x46')]=function(_0x155eed,_0x14bb1d){return db[_0x81d8('0x2a')][_0x81d8('0x46')](_0x155eed[_0x81d8('0x47')],{})[_0x81d8('0x23')](respondWithResult(_0x14bb1d,0xc9))['catch'](handleError(_0x14bb1d,null));};exports['update']=function(_0x5eea75,_0x2a4dbb){if(_0x5eea75[_0x81d8('0x47')]['id']){delete _0x5eea75[_0x81d8('0x47')]['id'];}return db[_0x81d8('0x2a')][_0x81d8('0x45')]({'where':{'id':_0x5eea75[_0x81d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a4dbb,null))[_0x81d8('0x23')](saveUpdates(_0x5eea75[_0x81d8('0x47')],null))[_0x81d8('0x23')](respondWithResult(_0x2a4dbb,null))[_0x81d8('0x43')](handleError(_0x2a4dbb,null));};exports[_0x81d8('0x48')]=function(_0x432ce1,_0x17af8c){return db[_0x81d8('0x2a')][_0x81d8('0x45')]({'where':{'id':_0x432ce1[_0x81d8('0x44')]['id']}})[_0x81d8('0x23')](handleEntityNotFound(_0x17af8c,null))['then'](removeEntity(_0x17af8c,null))[_0x81d8('0x43')](handleError(_0x17af8c,null));};exports[_0x81d8('0x49')]=function(_0xb53688,_0x395c4d){return db[_0x81d8('0x2a')]['describe']()[_0x81d8('0x23')](respondWithResult(_0x395c4d,null))[_0x81d8('0x43')](handleError(_0x395c4d,null));};
\ No newline at end of file
+var _0x5685=['hasOwnProperty','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','keys','include','find','create','body','params','destroy','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x5685,0x9f));var _0x5568=function(_0x5f5164,_0xa128be){_0x5f5164=_0x5f5164-0x0;var _0x3ec41d=_0x5685[_0x5f5164];return _0x3ec41d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5568('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5568('0x1'));var moment=require(_0x5568('0x2'));var BPromise=require(_0x5568('0x3'));var Mustache=require(_0x5568('0x4'));var util=require(_0x5568('0x5'));var path=require(_0x5568('0x6'));var sox=require(_0x5568('0x7'));var csv=require(_0x5568('0x8'));var ejs=require(_0x5568('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5568('0xa'));var crypto=require(_0x5568('0xb'));var jsforce=require(_0x5568('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5568('0x8'));var querystring=require(_0x5568('0xd'));var Papa=require('papaparse');var Redis=require(_0x5568('0xe'));var authService=require(_0x5568('0xf'));var qs=require(_0x5568('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5568('0x11'));var logger=require(_0x5568('0x12'))(_0x5568('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5568('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23d1fc,_0x18a2a2){_0x18a2a2=_0x18a2a2||0xcc;return function(_0x1f552d){if(_0x1f552d){return _0x23d1fc[_0x5568('0x15')](_0x18a2a2);}return _0x23d1fc[_0x5568('0x16')](_0x18a2a2)[_0x5568('0x17')]();};}function respondWithResult(_0x3da189,_0x4f6e48){_0x4f6e48=_0x4f6e48||0xc8;return function(_0x536a2c){if(_0x536a2c){return _0x3da189['status'](_0x4f6e48)[_0x5568('0x18')](_0x536a2c);}};}function respondWithFilteredResult(_0x4174b9,_0x4438bc){return function(_0x496cb3){if(_0x496cb3){var _0x31073f=typeof _0x4438bc['offset']===_0x5568('0x19')&&typeof _0x4438bc[_0x5568('0x1a')]===_0x5568('0x19');var _0x358b12=_0x496cb3[_0x5568('0x1b')];var _0x27c3f0=_0x31073f?0x0:_0x4438bc['offset'];var _0x1fb97b=_0x31073f?_0x496cb3['count']:_0x4438bc['offset']+_0x4438bc[_0x5568('0x1a')];var _0x1a41fb;if(_0x1fb97b>=_0x358b12){_0x1fb97b=_0x358b12;_0x1a41fb=0xc8;}else{_0x1a41fb=0xce;}_0x4174b9[_0x5568('0x16')](_0x1a41fb);return _0x4174b9[_0x5568('0x1c')]('Content-Range',_0x27c3f0+'-'+_0x1fb97b+'/'+_0x358b12)[_0x5568('0x18')](_0x496cb3);}return null;};}function patchUpdates(_0x23c168){return function(_0x2450dd){try{jsonpatch[_0x5568('0x1d')](_0x2450dd,_0x23c168,!![]);}catch(_0x452bb1){return BPromise[_0x5568('0x1e')](_0x452bb1);}return _0x2450dd[_0x5568('0x1f')]();};}function saveUpdates(_0x45f2a5,_0x2e16b0){return function(_0xc32d2c){if(_0xc32d2c){return _0xc32d2c['update'](_0x45f2a5)[_0x5568('0x20')](function(_0x495bf5){return _0x495bf5;});}return null;};}function removeEntity(_0x6a067d,_0x4e6271){return function(_0x219a66){if(_0x219a66){return _0x219a66['destroy']()[_0x5568('0x20')](function(){_0x6a067d[_0x5568('0x16')](0xcc)[_0x5568('0x17')]();});}};}function handleEntityNotFound(_0x4e2ca2,_0x41a70e){return function(_0x2caf0c){if(!_0x2caf0c){_0x4e2ca2['sendStatus'](0x194);}return _0x2caf0c;};}function handleError(_0x56c9ea,_0x3e8373){_0x3e8373=_0x3e8373||0x1f4;return function(_0x594455){logger[_0x5568('0x21')](_0x594455[_0x5568('0x22')]);if(_0x594455['name']){delete _0x594455[_0x5568('0x23')];}_0x56c9ea['status'](_0x3e8373)['send'](_0x594455);};}exports[_0x5568('0x24')]=function(_0x45c19d,_0x16eee1){var _0x31707f={},_0x526965={},_0x2baf05={'count':0x0,'rows':[]};var _0x228fed=_[_0x5568('0x25')](db[_0x5568('0x26')][_0x5568('0x27')],function(_0x408f12){return{'name':_0x408f12['fieldName'],'type':_0x408f12['type'][_0x5568('0x28')]};});_0x526965[_0x5568('0x29')]=_[_0x5568('0x25')](_0x228fed,_0x5568('0x23'));_0x526965[_0x5568('0x2a')]=_['keys'](_0x45c19d[_0x5568('0x2a')]);_0x526965[_0x5568('0x2b')]=_[_0x5568('0x2c')](_0x526965[_0x5568('0x29')],_0x526965['query']);_0x31707f[_0x5568('0x2d')]=_[_0x5568('0x2c')](_0x526965[_0x5568('0x29')],qs[_0x5568('0x2e')](_0x45c19d['query'][_0x5568('0x2e')]));_0x31707f['attributes']=_0x31707f[_0x5568('0x2d')][_0x5568('0x2f')]?_0x31707f[_0x5568('0x2d')]:_0x526965[_0x5568('0x29')];if(!_0x45c19d[_0x5568('0x2a')][_0x5568('0x30')]('nolimit')){_0x31707f[_0x5568('0x1a')]=qs[_0x5568('0x1a')](_0x45c19d['query'][_0x5568('0x1a')]);_0x31707f[_0x5568('0x31')]=qs[_0x5568('0x31')](_0x45c19d['query']['offset']);}_0x31707f[_0x5568('0x32')]=qs[_0x5568('0x33')](_0x45c19d[_0x5568('0x2a')]['sort']);_0x31707f[_0x5568('0x34')]=qs['filters'](_[_0x5568('0x35')](_0x45c19d[_0x5568('0x2a')],_0x526965['filters']),_0x228fed);if(_0x45c19d[_0x5568('0x2a')]['filter']){_0x31707f[_0x5568('0x34')]=_[_0x5568('0x36')](_0x31707f[_0x5568('0x34')],{'$or':_['map'](_0x228fed,function(_0x295cc2){if(_0x295cc2['type']!==_0x5568('0x37')){var _0x3827d3={};_0x3827d3[_0x295cc2[_0x5568('0x23')]]={'$like':'%'+_0x45c19d[_0x5568('0x2a')][_0x5568('0x38')]+'%'};return _0x3827d3;}})});}_0x31707f=_[_0x5568('0x36')]({},_0x31707f,_0x45c19d[_0x5568('0x39')]);var _0x203a3b={'where':_0x31707f['where']};return db['JscriptyQuestionReport'][_0x5568('0x1b')](_0x203a3b)[_0x5568('0x20')](function(_0x679c84){_0x2baf05[_0x5568('0x1b')]=_0x679c84;if(_0x45c19d['query'][_0x5568('0x3a')]){_0x31707f['include']=[{'all':!![]}];}return db[_0x5568('0x26')]['findAll'](_0x31707f);})[_0x5568('0x20')](function(_0x280f01){_0x2baf05['rows']=_0x280f01;return _0x2baf05;})['then'](respondWithFilteredResult(_0x16eee1,_0x31707f))[_0x5568('0x3b')](handleError(_0x16eee1,null));};exports[_0x5568('0x3c')]=function(_0x3777e4,_0x377f7d){var _0x2e8cb1={'raw':!![],'where':{'id':_0x3777e4['params']['id']}},_0x77ce21={};_0x77ce21[_0x5568('0x29')]=_[_0x5568('0x3d')](db[_0x5568('0x26')]['rawAttributes']);_0x77ce21[_0x5568('0x2a')]=_[_0x5568('0x3d')](_0x3777e4['query']);_0x77ce21[_0x5568('0x2b')]=_[_0x5568('0x2c')](_0x77ce21[_0x5568('0x29')],_0x77ce21[_0x5568('0x2a')]);_0x2e8cb1[_0x5568('0x2d')]=_[_0x5568('0x2c')](_0x77ce21[_0x5568('0x29')],qs['fields'](_0x3777e4['query']['fields']));_0x2e8cb1[_0x5568('0x2d')]=_0x2e8cb1['attributes'][_0x5568('0x2f')]?_0x2e8cb1['attributes']:_0x77ce21[_0x5568('0x29')];if(_0x3777e4[_0x5568('0x2a')]['includeAll']){_0x2e8cb1[_0x5568('0x3e')]=[{'all':!![]}];}_0x2e8cb1=_[_0x5568('0x36')]({},_0x2e8cb1,_0x3777e4[_0x5568('0x39')]);return db['JscriptyQuestionReport'][_0x5568('0x3f')](_0x2e8cb1)[_0x5568('0x20')](handleEntityNotFound(_0x377f7d,null))[_0x5568('0x20')](respondWithResult(_0x377f7d,null))[_0x5568('0x3b')](handleError(_0x377f7d,null));};exports['create']=function(_0x3fc7c7,_0x240547){return db[_0x5568('0x26')][_0x5568('0x40')](_0x3fc7c7[_0x5568('0x41')],{})['then'](respondWithResult(_0x240547,0xc9))['catch'](handleError(_0x240547,null));};exports['update']=function(_0x65782b,_0x134aea){if(_0x65782b[_0x5568('0x41')]['id']){delete _0x65782b[_0x5568('0x41')]['id'];}return db[_0x5568('0x26')][_0x5568('0x3f')]({'where':{'id':_0x65782b[_0x5568('0x42')]['id']}})[_0x5568('0x20')](handleEntityNotFound(_0x134aea,null))['then'](saveUpdates(_0x65782b[_0x5568('0x41')],null))['then'](respondWithResult(_0x134aea,null))[_0x5568('0x3b')](handleError(_0x134aea,null));};exports[_0x5568('0x43')]=function(_0x662c48,_0x3f03ec){return db[_0x5568('0x26')]['find']({'where':{'id':_0x662c48[_0x5568('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f03ec,null))[_0x5568('0x20')](removeEntity(_0x3f03ec,null))['catch'](handleError(_0x3f03ec,null));};exports[_0x5568('0x44')]=function(_0x509b1f,_0x15aabb){return db[_0x5568('0x26')]['describe']()[_0x5568('0x20')](respondWithResult(_0x15aabb,null))[_0x5568('0x3b')](handleError(_0x15aabb,null));};
\ No newline at end of file
index 261ae51..00bc067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d9f=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x495d53,_0x1e4fd9){var _0x559534=function(_0x279fa5){while(--_0x279fa5){_0x495d53['push'](_0x495d53['shift']());}};_0x559534(++_0x1e4fd9);}(_0x3d9f,0x1e9));var _0xf3d9=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3d9f[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xf3d9('0x0'));var logger=require(_0xf3d9('0x1'))('api');var moment=require(_0xf3d9('0x2'));var BPromise=require(_0xf3d9('0x3'));var rp=require(_0xf3d9('0x4'));var fs=require('fs');var path=require(_0xf3d9('0x5'));var rimraf=require('rimraf');var config=require(_0xf3d9('0x6'));var attributes=require(_0xf3d9('0x7'));module['exports']=function(_0x2121da,_0x4cbca2){return _0x2121da['define'](_0xf3d9('0x8'),attributes,{'tableName':_0xf3d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9eb1=['report_jscripty_questions','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport'];(function(_0x4095ac,_0x4fe566){var _0x32ad1c=function(_0x4b716c){while(--_0x4b716c){_0x4095ac['push'](_0x4095ac['shift']());}};_0x32ad1c(++_0x4fe566);}(_0x9eb1,0x9d));var _0x19eb=function(_0x52fbc8,_0x9d40b2){_0x52fbc8=_0x52fbc8-0x0;var _0x5df1ff=_0x9eb1[_0x52fbc8];return _0x5df1ff;};'use strict';var _=require('lodash');var util=require(_0x19eb('0x0'));var logger=require(_0x19eb('0x1'))(_0x19eb('0x2'));var moment=require('moment');var BPromise=require(_0x19eb('0x3'));var rp=require(_0x19eb('0x4'));var fs=require('fs');var path=require(_0x19eb('0x5'));var rimraf=require(_0x19eb('0x6'));var config=require(_0x19eb('0x7'));var attributes=require(_0x19eb('0x8'));module['exports']=function(_0x1005ce,_0x39ff83){return _0x1005ce[_0x19eb('0x9')](_0x19eb('0xa'),attributes,{'tableName':_0x19eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c8e487..d98b4aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc99d=['jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x4b3c3f,_0x23872d){var _0x185f37=function(_0x28eb77){while(--_0x28eb77){_0x4b3c3f['push'](_0x4b3c3f['shift']());}};_0x185f37(++_0x23872d);}(_0xc99d,0x112));var _0xdc99=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xc99d[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xdc99('0x0'));var util=require('util');var moment=require(_0xdc99('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc99('0x2'));var fs=require('fs');var Redis=require(_0xdc99('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc99('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc99('0x5'));var jayson=require(_0xdc99('0x6'));var client=jayson[_0xdc99('0x7')][_0xdc99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a11ed,_0x19b737,_0x2468db){return new BPromise(function(_0x8a47c,_0xf89fb4){return client[_0xdc99('0x9')](_0x3a11ed,_0x2468db)[_0xdc99('0xa')](function(_0x677ed0){logger[_0xdc99('0xb')](_0xdc99('0xc'),_0x19b737,_0xdc99('0xd'));logger['debug'](_0xdc99('0xe'),_0x19b737,_0xdc99('0xd'),JSON['stringify'](_0x677ed0));if(_0x677ed0['error']){if(_0x677ed0[_0xdc99('0xf')][_0xdc99('0x10')]===0x1f4){logger['error'](_0xdc99('0xc'),_0x19b737,_0x677ed0['error'][_0xdc99('0x11')]);return _0xf89fb4(_0x677ed0[_0xdc99('0xf')]['message']);}logger['error'](_0xdc99('0xc'),_0x19b737,_0x677ed0[_0xdc99('0xf')][_0xdc99('0x11')]);return _0x8a47c(_0x677ed0[_0xdc99('0xf')][_0xdc99('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x19b737,'request\x20sent');_0x8a47c(_0x677ed0[_0xdc99('0x12')][_0xdc99('0x11')]);}})[_0xdc99('0x13')](function(_0x3968e2){logger[_0xdc99('0xf')](_0xdc99('0xc'),_0x19b737,_0x3968e2);_0xf89fb4(_0x3968e2);});});}
\ No newline at end of file
+var _0x61cf=['../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x26e613,_0x48ae90){var _0x39322c=function(_0x265c1d){while(--_0x265c1d){_0x26e613['push'](_0x26e613['shift']());}};_0x39322c(++_0x48ae90);}(_0x61cf,0x8c));var _0xf61c=function(_0xcac7fe,_0x552ef1){_0xcac7fe=_0xcac7fe-0x0;var _0x53f2ab=_0x61cf[_0xcac7fe];return _0x53f2ab;};'use strict';var _=require(_0xf61c('0x0'));var util=require(_0xf61c('0x1'));var moment=require(_0xf61c('0x2'));var BPromise=require(_0xf61c('0x3'));var rs=require(_0xf61c('0x4'));var fs=require('fs');var Redis=require(_0xf61c('0x5'));var db=require(_0xf61c('0x6'))['db'];var utils=require(_0xf61c('0x7'));var logger=require(_0xf61c('0x8'))(_0xf61c('0x9'));var config=require(_0xf61c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf61c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3158bd,_0x3e89c6,_0xed9c4c){return new BPromise(function(_0x3d6aed,_0x4b4f79){return client[_0xf61c('0xc')](_0x3158bd,_0xed9c4c)[_0xf61c('0xd')](function(_0x3a9d1c){logger[_0xf61c('0xe')](_0xf61c('0xf'),_0x3e89c6,'request\x20sent');logger[_0xf61c('0x10')](_0xf61c('0x11'),_0x3e89c6,_0xf61c('0x12'),JSON[_0xf61c('0x13')](_0x3a9d1c));if(_0x3a9d1c[_0xf61c('0x14')]){if(_0x3a9d1c[_0xf61c('0x14')][_0xf61c('0x15')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3e89c6,_0x3a9d1c[_0xf61c('0x14')]['message']);return _0x4b4f79(_0x3a9d1c[_0xf61c('0x14')]['message']);}logger[_0xf61c('0x14')](_0xf61c('0xf'),_0x3e89c6,_0x3a9d1c[_0xf61c('0x14')][_0xf61c('0x16')]);return _0x3d6aed(_0x3a9d1c['error'][_0xf61c('0x16')]);}else{logger[_0xf61c('0xe')](_0xf61c('0xf'),_0x3e89c6,_0xf61c('0x12'));_0x3d6aed(_0x3a9d1c[_0xf61c('0x17')][_0xf61c('0x16')]);}})[_0xf61c('0x18')](function(_0xf061b4){logger['error'](_0xf61c('0xf'),_0x3e89c6,_0xf061b4);_0x4b4f79(_0xf061b4);});});}
\ No newline at end of file
index 4c57a52..389a394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4710=['Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getQuestions','post','create','update','delete','util','connect-timeout','express'];(function(_0x1e3dc0,_0x409f2e){var _0xcf039f=function(_0x1e4f39){while(--_0x1e4f39){_0x1e3dc0['push'](_0x1e3dc0['shift']());}};_0xcf039f(++_0x409f2e);}(_0x4710,0x153));var _0x0471=function(_0x3c2ea6,_0x86346c){_0x3c2ea6=_0x3c2ea6-0x0;var _0x9ce03e=_0x4710[_0x3c2ea6];return _0x9ce03e;};'use strict';var multer=require('multer');var util=require(_0x0471('0x0'));var path=require('path');var timeout=require(_0x0471('0x1'));var express=require(_0x0471('0x2'));var router=express[_0x0471('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0471('0x4'));var config=require(_0x0471('0x5'));var controller=require(_0x0471('0x6'));router['get']('/',auth[_0x0471('0x7')](),controller[_0x0471('0x8')]);router[_0x0471('0x9')](_0x0471('0xa'),auth[_0x0471('0x7')](),controller[_0x0471('0xb')]);router[_0x0471('0x9')](_0x0471('0xc'),auth[_0x0471('0x7')](),controller[_0x0471('0xd')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller[_0x0471('0xe')]);router[_0x0471('0xf')]('/',auth[_0x0471('0x7')](),controller[_0x0471('0x10')]);router['put'](_0x0471('0xc'),auth['isAuthenticated'](),controller[_0x0471('0x11')]);router[_0x0471('0x12')](_0x0471('0xc'),auth[_0x0471('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x17db=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports'];(function(_0x5db46d,_0x3fc2a4){var _0x1f2064=function(_0x5d8654){while(--_0x5d8654){_0x5db46d['push'](_0x5db46d['shift']());}};_0x1f2064(++_0x3fc2a4);}(_0x17db,0x7e));var _0xb17d=function(_0xa4708f,_0x3f7b33){_0xa4708f=_0xa4708f-0x0;var _0x5aa48c=_0x17db[_0xa4708f];return _0x5aa48c;};'use strict';var multer=require(_0xb17d('0x0'));var util=require(_0xb17d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb17d('0x2'));var router=express[_0xb17d('0x3')]();var fs_extra=require(_0xb17d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb17d('0x5'));var config=require(_0xb17d('0x6'));var controller=require(_0xb17d('0x7'));router['get']('/',auth[_0xb17d('0x8')](),controller[_0xb17d('0x9')]);router[_0xb17d('0xa')]('/describe',auth[_0xb17d('0x8')](),controller['describe']);router[_0xb17d('0xa')](_0xb17d('0xb'),auth[_0xb17d('0x8')](),controller[_0xb17d('0xc')]);router[_0xb17d('0xa')](_0xb17d('0xd'),auth[_0xb17d('0x8')](),controller[_0xb17d('0xe')]);router[_0xb17d('0xf')]('/',auth['isAuthenticated'](),controller[_0xb17d('0x10')]);router[_0xb17d('0x11')]('/:id',auth[_0xb17d('0x8')](),controller[_0xb17d('0x12')]);router['delete'](_0xb17d('0xb'),auth['isAuthenticated'](),controller[_0xb17d('0x13')]);module[_0xb17d('0x14')]=router;
\ No newline at end of file
index 350a909..ce5bf2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4473=['DATE','STRING','BOOLEAN','setDataValue','starttime'];(function(_0x373338,_0x382ef5){var _0x2a3b06=function(_0x5b172d){while(--_0x5b172d){_0x373338['push'](_0x373338['shift']());}};_0x2a3b06(++_0x382ef5);}(_0x4473,0x15c));var _0x3447=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4473[_0x1caf6a];return _0x1bf493;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5aa220){this[_0x3447('0x0')](_0x3447('0x1'),_0x5aa220);this[_0x3447('0x0')]('endtime',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x3447('0x2')]},'membername':{'type':Sequelize[_0x3447('0x3')]},'projectname':{'type':Sequelize[_0x3447('0x3')]},'queue':{'type':Sequelize[_0x3447('0x3')]},'uniqueid':{'type':Sequelize[_0x3447('0x3')]},'calleridname':{'type':Sequelize[_0x3447('0x3')]},'calleridnum':{'type':Sequelize[_0x3447('0x3')]},'completed':{'type':Sequelize[_0x3447('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x27f7=['DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x17cc44,_0x25b61f){var _0x31efbc=function(_0x3aed80){while(--_0x3aed80){_0x17cc44['push'](_0x17cc44['shift']());}};_0x31efbc(++_0x25b61f);}(_0x27f7,0x177));var _0x727f=function(_0x8dff52,_0x3ac821){_0x8dff52=_0x8dff52-0x0;var _0x447cd2=_0x27f7[_0x8dff52];return _0x447cd2;};'use strict';var moment=require(_0x727f('0x0'));var Sequelize=require(_0x727f('0x1'));module[_0x727f('0x2')]={'starttime':{'type':Sequelize[_0x727f('0x3')],'set':function(_0x3b7444){this[_0x727f('0x4')](_0x727f('0x5'),_0x3b7444);this['setDataValue'](_0x727f('0x6'),moment()['format'](_0x727f('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x727f('0x8')]},'projectname':{'type':Sequelize[_0x727f('0x8')]},'queue':{'type':Sequelize[_0x727f('0x8')]},'uniqueid':{'type':Sequelize[_0x727f('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x727f('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index cff7e22..8c0c7a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','sort','pick','filter','where','VIRTUAL','options','JscriptySessionReport','findAll','catch','show','includeAll','include','merge','find','body','update','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','order','SessionId','rows','rimraf','zip-dir','fast-json-patch'];(function(_0x53694c,_0x1fae93){var _0x21a317=function(_0x2eff00){while(--_0x2eff00){_0x53694c['push'](_0x53694c['shift']());}};_0x21a317(++_0x1fae93);}(_0x209e,0xfc));var _0xe209=function(_0x51e5c0,_0x49aa81){_0x51e5c0=_0x51e5c0-0x0;var _0x290112=_0x209e[_0x51e5c0];return _0x290112;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe209('0x0'));var zipdir=require(_0xe209('0x1'));var jsonpatch=require(_0xe209('0x2'));var rp=require(_0xe209('0x3'));var moment=require(_0xe209('0x4'));var BPromise=require(_0xe209('0x5'));var Mustache=require(_0xe209('0x6'));var util=require(_0xe209('0x7'));var path=require(_0xe209('0x8'));var sox=require(_0xe209('0x9'));var csv=require('to-csv');var ejs=require(_0xe209('0xa'));var fs=require('fs');var fs_extra=require(_0xe209('0xb'));var _=require('lodash');var squel=require(_0xe209('0xc'));var crypto=require(_0xe209('0xd'));var jsforce=require(_0xe209('0xe'));var deskjs=require(_0xe209('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe209('0x10'));var Papa=require(_0xe209('0x11'));var Redis=require(_0xe209('0x12'));var authService=require(_0xe209('0x13'));var qs=require(_0xe209('0x14'));var as=require(_0xe209('0x15'));var hardwareService=require(_0xe209('0x16'));var logger=require(_0xe209('0x17'))(_0xe209('0x18'));var utils=require(_0xe209('0x19'));var config=require(_0xe209('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25884f,_0x5778ce){_0x5778ce=_0x5778ce||0xcc;return function(_0x541b2f){if(_0x541b2f){return _0x25884f['sendStatus'](_0x5778ce);}return _0x25884f[_0xe209('0x1b')](_0x5778ce)[_0xe209('0x1c')]();};}function respondWithResult(_0x74f52d,_0x50d69b){_0x50d69b=_0x50d69b||0xc8;return function(_0x1985a1){if(_0x1985a1){return _0x74f52d[_0xe209('0x1b')](_0x50d69b)[_0xe209('0x1d')](_0x1985a1);}};}function respondWithFilteredResult(_0xa7082,_0x5e19d0){return function(_0x50470a){if(_0x50470a){var _0x2b5973=typeof _0x5e19d0['offset']==='undefined'&&typeof _0x5e19d0[_0xe209('0x1e')]===_0xe209('0x1f');var _0x2bfb44=_0x50470a[_0xe209('0x20')];var _0x2da0b3=_0x2b5973?0x0:_0x5e19d0['offset'];var _0x2c33a0=_0x2b5973?_0x50470a['count']:_0x5e19d0['offset']+_0x5e19d0['limit'];var _0x278b81;if(_0x2c33a0>=_0x2bfb44){_0x2c33a0=_0x2bfb44;_0x278b81=0xc8;}else{_0x278b81=0xce;}_0xa7082[_0xe209('0x1b')](_0x278b81);return _0xa7082[_0xe209('0x21')]('Content-Range',_0x2da0b3+'-'+_0x2c33a0+'/'+_0x2bfb44)[_0xe209('0x1d')](_0x50470a);}return null;};}function patchUpdates(_0x354f26){return function(_0x76c8bd){try{jsonpatch[_0xe209('0x22')](_0x76c8bd,_0x354f26,!![]);}catch(_0x4c42d8){return BPromise[_0xe209('0x23')](_0x4c42d8);}return _0x76c8bd[_0xe209('0x24')]();};}function saveUpdates(_0x497f8a,_0x4d9796){return function(_0x27313c){if(_0x27313c){return _0x27313c['update'](_0x497f8a)[_0xe209('0x25')](function(_0x129cd1){return _0x129cd1;});}return null;};}function removeEntity(_0x2d649b,_0x3da580){return function(_0x3e47bb){if(_0x3e47bb){return _0x3e47bb['destroy']()[_0xe209('0x25')](function(){_0x2d649b[_0xe209('0x1b')](0xcc)[_0xe209('0x1c')]();});}};}function handleEntityNotFound(_0x9cfa4,_0x2ee9b8){return function(_0x2e3eab){if(!_0x2e3eab){_0x9cfa4[_0xe209('0x26')](0x194);}return _0x2e3eab;};}function handleError(_0x4a4365,_0x4a1169){_0x4a1169=_0x4a1169||0x1f4;return function(_0x4ceb65){logger[_0xe209('0x27')](_0x4ceb65[_0xe209('0x28')]);if(_0x4ceb65[_0xe209('0x29')]){delete _0x4ceb65[_0xe209('0x29')];}_0x4a4365[_0xe209('0x1b')](_0x4a1169)[_0xe209('0x2a')](_0x4ceb65);};}exports[_0xe209('0x2b')]=function(_0x276761,_0x2932ec){var _0xe28266={},_0x325227={},_0x2e64f4={'count':0x0,'rows':[]};var _0x2ba659=_[_0xe209('0x2c')](db['JscriptySessionReport'][_0xe209('0x2d')],function(_0x1e5e75){return{'name':_0x1e5e75[_0xe209('0x2e')],'type':_0x1e5e75[_0xe209('0x2f')][_0xe209('0x30')]};});_0x325227[_0xe209('0x31')]=_['map'](_0x2ba659,_0xe209('0x29'));_0x325227[_0xe209('0x32')]=_[_0xe209('0x33')](_0x276761[_0xe209('0x32')]);_0x325227[_0xe209('0x34')]=_[_0xe209('0x35')](_0x325227[_0xe209('0x31')],_0x325227[_0xe209('0x32')]);_0xe28266['attributes']=_[_0xe209('0x35')](_0x325227[_0xe209('0x31')],qs[_0xe209('0x36')](_0x276761['query']['fields']));_0xe28266[_0xe209('0x37')]=_0xe28266[_0xe209('0x37')][_0xe209('0x38')]?_0xe28266['attributes']:_0x325227[_0xe209('0x31')];if(!_0x276761[_0xe209('0x32')]['hasOwnProperty'](_0xe209('0x39'))){_0xe28266[_0xe209('0x1e')]=qs['limit'](_0x276761[_0xe209('0x32')][_0xe209('0x1e')]);_0xe28266[_0xe209('0x3a')]=qs[_0xe209('0x3a')](_0x276761['query'][_0xe209('0x3a')]);}_0xe28266['order']=qs[_0xe209('0x3b')](_0x276761[_0xe209('0x32')]['sort']);_0xe28266['where']=qs['filters'](_[_0xe209('0x3c')](_0x276761[_0xe209('0x32')],_0x325227[_0xe209('0x34')]),_0x2ba659);if(_0x276761['query'][_0xe209('0x3d')]){_0xe28266['where']=_['merge'](_0xe28266[_0xe209('0x3e')],{'$or':_['map'](_0x2ba659,function(_0x11bd7d){if(_0x11bd7d[_0xe209('0x2f')]!==_0xe209('0x3f')){var _0x1cca93={};_0x1cca93[_0x11bd7d[_0xe209('0x29')]]={'$like':'%'+_0x276761['query']['filter']+'%'};return _0x1cca93;}})});}_0xe28266=_['merge']({},_0xe28266,_0x276761[_0xe209('0x40')]);var _0x199cda={'where':_0xe28266[_0xe209('0x3e')]};return db[_0xe209('0x41')][_0xe209('0x20')](_0x199cda)[_0xe209('0x25')](function(_0x12b5e2){_0x2e64f4[_0xe209('0x20')]=_0x12b5e2;if(_0x276761[_0xe209('0x32')]['includeAll']){_0xe28266['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe209('0x42')](_0xe28266);})[_0xe209('0x25')](function(_0x4fedbc){_0x2e64f4['rows']=_0x4fedbc;return _0x2e64f4;})[_0xe209('0x25')](respondWithFilteredResult(_0x2932ec,_0xe28266))[_0xe209('0x43')](handleError(_0x2932ec,null));};exports[_0xe209('0x44')]=function(_0x2bb947,_0x5762e4){var _0x186af5={'raw':!![],'where':{'id':_0x2bb947['params']['id']}},_0x1060a8={};_0x1060a8[_0xe209('0x31')]=_['keys'](db[_0xe209('0x41')][_0xe209('0x2d')]);_0x1060a8[_0xe209('0x32')]=_[_0xe209('0x33')](_0x2bb947[_0xe209('0x32')]);_0x1060a8[_0xe209('0x34')]=_[_0xe209('0x35')](_0x1060a8[_0xe209('0x31')],_0x1060a8['query']);_0x186af5[_0xe209('0x37')]=_[_0xe209('0x35')](_0x1060a8['model'],qs['fields'](_0x2bb947['query'][_0xe209('0x36')]));_0x186af5[_0xe209('0x37')]=_0x186af5[_0xe209('0x37')][_0xe209('0x38')]?_0x186af5[_0xe209('0x37')]:_0x1060a8['model'];if(_0x2bb947[_0xe209('0x32')][_0xe209('0x45')]){_0x186af5[_0xe209('0x46')]=[{'all':!![]}];}_0x186af5=_[_0xe209('0x47')]({},_0x186af5,_0x2bb947['options']);return db[_0xe209('0x41')][_0xe209('0x48')](_0x186af5)[_0xe209('0x25')](handleEntityNotFound(_0x5762e4,null))[_0xe209('0x25')](respondWithResult(_0x5762e4,null))['catch'](handleError(_0x5762e4,null));};exports['create']=function(_0x85c6be,_0x257538){return db['JscriptySessionReport']['create'](_0x85c6be[_0xe209('0x49')],{})[_0xe209('0x25')](respondWithResult(_0x257538,0xc9))[_0xe209('0x43')](handleError(_0x257538,null));};exports[_0xe209('0x4a')]=function(_0x1c1454,_0x2ba150){if(_0x1c1454['body']['id']){delete _0x1c1454[_0xe209('0x49')]['id'];}return db['JscriptySessionReport'][_0xe209('0x48')]({'where':{'id':_0x1c1454[_0xe209('0x4b')]['id']}})[_0xe209('0x25')](handleEntityNotFound(_0x2ba150,null))[_0xe209('0x25')](saveUpdates(_0x1c1454[_0xe209('0x49')],null))[_0xe209('0x25')](respondWithResult(_0x2ba150,null))[_0xe209('0x43')](handleError(_0x2ba150,null));};exports[_0xe209('0x4c')]=function(_0x47e141,_0x2090b6){return db[_0xe209('0x41')][_0xe209('0x48')]({'where':{'id':_0x47e141[_0xe209('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2090b6,null))['then'](removeEntity(_0x2090b6,null))[_0xe209('0x43')](handleError(_0x2090b6,null));};exports[_0xe209('0x4d')]=function(_0x50ca9e,_0x19c7ad){return db[_0xe209('0x41')][_0xe209('0x4d')]()[_0xe209('0x25')](respondWithResult(_0x19c7ad,null))[_0xe209('0x43')](handleError(_0x19c7ad,null));};exports[_0xe209('0x4e')]=function(_0xef2065,_0x16afba,_0x7e185d){var _0x2d59fa={'raw':!![],'where':{}};var _0x46129a={};var _0x295b1d={'count':0x0,'rows':[]};return db[_0xe209('0x41')][_0xe209('0x4f')]({'where':{'id':_0xef2065['params']['id']}})[_0xe209('0x25')](handleEntityNotFound(_0x16afba,null))[_0xe209('0x25')](function(_0x3a4680){if(_0x3a4680){_0x46129a[_0xe209('0x31')]=_[_0xe209('0x33')](db[_0xe209('0x50')]['rawAttributes']);_0x46129a[_0xe209('0x32')]=_[_0xe209('0x33')](_0xef2065['query']);_0x46129a['filters']=_[_0xe209('0x35')](_0x46129a['model'],_0x46129a['query']);_0x2d59fa['attributes']=_[_0xe209('0x35')](_0x46129a[_0xe209('0x31')],qs[_0xe209('0x36')](_0xef2065['query'][_0xe209('0x36')]));_0x2d59fa[_0xe209('0x37')]=_0x2d59fa[_0xe209('0x37')][_0xe209('0x38')]?_0x2d59fa[_0xe209('0x37')]:_0x46129a[_0xe209('0x31')];if(!_0xef2065[_0xe209('0x32')][_0xe209('0x51')]('nolimit')){_0x2d59fa[_0xe209('0x1e')]=qs[_0xe209('0x1e')](_0xef2065[_0xe209('0x32')]['limit']);_0x2d59fa[_0xe209('0x3a')]=qs[_0xe209('0x3a')](_0xef2065[_0xe209('0x32')]['offset']);}_0x2d59fa[_0xe209('0x52')]=qs['sort'](_0xef2065[_0xe209('0x32')]['sort']);_0x2d59fa[_0xe209('0x3e')]=qs['filters'](_['pick'](_0xef2065['query'],_0x46129a[_0xe209('0x34')]));_0x2d59fa[_0xe209('0x3e')][_0xe209('0x53')]=_0x3a4680['id'];if(_0xef2065[_0xe209('0x32')]['filter']){_0x2d59fa['where']=_[_0xe209('0x47')](_0x2d59fa['where'],{'$or':_[_0xe209('0x2c')](_0x2d59fa[_0xe209('0x37')],function(_0x119299){var _0x5bcadb={};_0x5bcadb[_0x119299]={'$like':'%'+_0xef2065[_0xe209('0x32')][_0xe209('0x3d')]+'%'};return _0x5bcadb;})});}_0x2d59fa=_['merge']({},_0x2d59fa,_0xef2065[_0xe209('0x40')]);return db[_0xe209('0x50')][_0xe209('0x20')]({'where':_0x2d59fa[_0xe209('0x3e')]})['then'](function(_0x2dde4c){_0x295b1d[_0xe209('0x20')]=_0x2dde4c;if(_0xef2065[_0xe209('0x32')][_0xe209('0x45')]){_0x2d59fa['include']=[{'all':!![]}];}return db[_0xe209('0x50')][_0xe209('0x42')](_0x2d59fa);})[_0xe209('0x25')](function(_0x12120f){_0x295b1d[_0xe209('0x54')]=_0x12120f;return _0x295b1d;});}})[_0xe209('0x25')](respondWithFilteredResult(_0x16afba,_0x2d59fa))['catch'](handleError(_0x16afba,null));};
\ No newline at end of file
+var _0xe824=['destroy','sendStatus','error','name','index','map','JscriptySessionReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','catch','create','body','update','find','params','describe','getQuestions','findOne','hasOwnProperty','nolimit','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then'];(function(_0x1c551f,_0x56299c){var _0xd2b29=function(_0x415340){while(--_0x415340){_0x1c551f['push'](_0x1c551f['shift']());}};_0xd2b29(++_0x56299c);}(_0xe824,0x1f3));var _0x4e82=function(_0x34ece7,_0x197dce){_0x34ece7=_0x34ece7-0x0;var _0x2bb837=_0xe824[_0x34ece7];return _0x2bb837;};'use strict';var emlformat=require(_0x4e82('0x0'));var rimraf=require(_0x4e82('0x1'));var zipdir=require(_0x4e82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e82('0x3'));var moment=require('moment');var BPromise=require(_0x4e82('0x4'));var Mustache=require(_0x4e82('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4e82('0x6'));var csv=require(_0x4e82('0x7'));var ejs=require(_0x4e82('0x8'));var fs=require('fs');var fs_extra=require(_0x4e82('0x9'));var _=require(_0x4e82('0xa'));var squel=require(_0x4e82('0xb'));var crypto=require('crypto');var jsforce=require(_0x4e82('0xc'));var deskjs=require(_0x4e82('0xd'));var toCsv=require(_0x4e82('0x7'));var querystring=require(_0x4e82('0xe'));var Papa=require(_0x4e82('0xf'));var Redis=require(_0x4e82('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e82('0x11'));var hardwareService=require(_0x4e82('0x12'));var logger=require('../../config/logger')(_0x4e82('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e82('0x14'))['db'];function respondWithStatusCode(_0x32b686,_0x3caba9){_0x3caba9=_0x3caba9||0xcc;return function(_0x57e41a){if(_0x57e41a){return _0x32b686['sendStatus'](_0x3caba9);}return _0x32b686[_0x4e82('0x15')](_0x3caba9)[_0x4e82('0x16')]();};}function respondWithResult(_0x361e6b,_0x141ea1){_0x141ea1=_0x141ea1||0xc8;return function(_0x1dc1ba){if(_0x1dc1ba){return _0x361e6b[_0x4e82('0x15')](_0x141ea1)[_0x4e82('0x17')](_0x1dc1ba);}};}function respondWithFilteredResult(_0x471822,_0x46a759){return function(_0x223ac0){if(_0x223ac0){var _0x190a8d=typeof _0x46a759['offset']===_0x4e82('0x18')&&typeof _0x46a759[_0x4e82('0x19')]===_0x4e82('0x18');var _0x21cb1d=_0x223ac0[_0x4e82('0x1a')];var _0x58077f=_0x190a8d?0x0:_0x46a759[_0x4e82('0x1b')];var _0x57716e=_0x190a8d?_0x223ac0[_0x4e82('0x1a')]:_0x46a759[_0x4e82('0x1b')]+_0x46a759[_0x4e82('0x19')];var _0x417da7;if(_0x57716e>=_0x21cb1d){_0x57716e=_0x21cb1d;_0x417da7=0xc8;}else{_0x417da7=0xce;}_0x471822[_0x4e82('0x15')](_0x417da7);return _0x471822[_0x4e82('0x1c')](_0x4e82('0x1d'),_0x58077f+'-'+_0x57716e+'/'+_0x21cb1d)[_0x4e82('0x17')](_0x223ac0);}return null;};}function patchUpdates(_0x27b5d4){return function(_0x3a431b){try{jsonpatch[_0x4e82('0x1e')](_0x3a431b,_0x27b5d4,!![]);}catch(_0x340fae){return BPromise['reject'](_0x340fae);}return _0x3a431b[_0x4e82('0x1f')]();};}function saveUpdates(_0x64c2c6,_0x47e85d){return function(_0xc130dd){if(_0xc130dd){return _0xc130dd['update'](_0x64c2c6)[_0x4e82('0x20')](function(_0x2b95f6){return _0x2b95f6;});}return null;};}function removeEntity(_0x4d7a0f,_0x49d146){return function(_0x301af1){if(_0x301af1){return _0x301af1[_0x4e82('0x21')]()[_0x4e82('0x20')](function(){_0x4d7a0f[_0x4e82('0x15')](0xcc)[_0x4e82('0x16')]();});}};}function handleEntityNotFound(_0x212e26,_0x2e535a){return function(_0x4bca06){if(!_0x4bca06){_0x212e26[_0x4e82('0x22')](0x194);}return _0x4bca06;};}function handleError(_0x5c4f02,_0x4d23f7){_0x4d23f7=_0x4d23f7||0x1f4;return function(_0x55420d){logger[_0x4e82('0x23')](_0x55420d['stack']);if(_0x55420d[_0x4e82('0x24')]){delete _0x55420d[_0x4e82('0x24')];}_0x5c4f02[_0x4e82('0x15')](_0x4d23f7)['send'](_0x55420d);};}exports[_0x4e82('0x25')]=function(_0x5b4d94,_0x8f18b3){var _0x3fee62={},_0x1b3c4f={},_0xfd1808={'count':0x0,'rows':[]};var _0x5ea4e6=_[_0x4e82('0x26')](db[_0x4e82('0x27')]['rawAttributes'],function(_0x30dcdd){return{'name':_0x30dcdd[_0x4e82('0x28')],'type':_0x30dcdd[_0x4e82('0x29')]['key']};});_0x1b3c4f[_0x4e82('0x2a')]=_[_0x4e82('0x26')](_0x5ea4e6,'name');_0x1b3c4f[_0x4e82('0x2b')]=_[_0x4e82('0x2c')](_0x5b4d94[_0x4e82('0x2b')]);_0x1b3c4f[_0x4e82('0x2d')]=_[_0x4e82('0x2e')](_0x1b3c4f[_0x4e82('0x2a')],_0x1b3c4f[_0x4e82('0x2b')]);_0x3fee62['attributes']=_[_0x4e82('0x2e')](_0x1b3c4f['model'],qs[_0x4e82('0x2f')](_0x5b4d94[_0x4e82('0x2b')]['fields']));_0x3fee62['attributes']=_0x3fee62[_0x4e82('0x30')][_0x4e82('0x31')]?_0x3fee62[_0x4e82('0x30')]:_0x1b3c4f[_0x4e82('0x2a')];if(!_0x5b4d94[_0x4e82('0x2b')]['hasOwnProperty']('nolimit')){_0x3fee62[_0x4e82('0x19')]=qs[_0x4e82('0x19')](_0x5b4d94[_0x4e82('0x2b')][_0x4e82('0x19')]);_0x3fee62['offset']=qs[_0x4e82('0x1b')](_0x5b4d94[_0x4e82('0x2b')][_0x4e82('0x1b')]);}_0x3fee62[_0x4e82('0x32')]=qs[_0x4e82('0x33')](_0x5b4d94[_0x4e82('0x2b')][_0x4e82('0x33')]);_0x3fee62[_0x4e82('0x34')]=qs[_0x4e82('0x2d')](_[_0x4e82('0x35')](_0x5b4d94['query'],_0x1b3c4f[_0x4e82('0x2d')]),_0x5ea4e6);if(_0x5b4d94[_0x4e82('0x2b')][_0x4e82('0x36')]){_0x3fee62[_0x4e82('0x34')]=_[_0x4e82('0x37')](_0x3fee62[_0x4e82('0x34')],{'$or':_['map'](_0x5ea4e6,function(_0x3f55d2){if(_0x3f55d2['type']!==_0x4e82('0x38')){var _0x4ae377={};_0x4ae377[_0x3f55d2[_0x4e82('0x24')]]={'$like':'%'+_0x5b4d94[_0x4e82('0x2b')]['filter']+'%'};return _0x4ae377;}})});}_0x3fee62=_['merge']({},_0x3fee62,_0x5b4d94[_0x4e82('0x39')]);var _0x1c53a3={'where':_0x3fee62[_0x4e82('0x34')]};return db[_0x4e82('0x27')]['count'](_0x1c53a3)['then'](function(_0x356992){_0xfd1808[_0x4e82('0x1a')]=_0x356992;if(_0x5b4d94[_0x4e82('0x2b')][_0x4e82('0x3a')]){_0x3fee62[_0x4e82('0x3b')]=[{'all':!![]}];}return db[_0x4e82('0x27')][_0x4e82('0x3c')](_0x3fee62);})['then'](function(_0x583dff){_0xfd1808[_0x4e82('0x3d')]=_0x583dff;return _0xfd1808;})[_0x4e82('0x20')](respondWithFilteredResult(_0x8f18b3,_0x3fee62))['catch'](handleError(_0x8f18b3,null));};exports['show']=function(_0x23d916,_0x1ed59d){var _0x535c47={'raw':!![],'where':{'id':_0x23d916['params']['id']}},_0x4bafe5={};_0x4bafe5[_0x4e82('0x2a')]=_[_0x4e82('0x2c')](db[_0x4e82('0x27')][_0x4e82('0x3e')]);_0x4bafe5[_0x4e82('0x2b')]=_['keys'](_0x23d916[_0x4e82('0x2b')]);_0x4bafe5[_0x4e82('0x2d')]=_['intersection'](_0x4bafe5['model'],_0x4bafe5['query']);_0x535c47[_0x4e82('0x30')]=_[_0x4e82('0x2e')](_0x4bafe5[_0x4e82('0x2a')],qs[_0x4e82('0x2f')](_0x23d916['query'][_0x4e82('0x2f')]));_0x535c47[_0x4e82('0x30')]=_0x535c47[_0x4e82('0x30')][_0x4e82('0x31')]?_0x535c47[_0x4e82('0x30')]:_0x4bafe5[_0x4e82('0x2a')];if(_0x23d916[_0x4e82('0x2b')][_0x4e82('0x3a')]){_0x535c47[_0x4e82('0x3b')]=[{'all':!![]}];}_0x535c47=_[_0x4e82('0x37')]({},_0x535c47,_0x23d916[_0x4e82('0x39')]);return db[_0x4e82('0x27')]['find'](_0x535c47)[_0x4e82('0x20')](handleEntityNotFound(_0x1ed59d,null))[_0x4e82('0x20')](respondWithResult(_0x1ed59d,null))[_0x4e82('0x3f')](handleError(_0x1ed59d,null));};exports[_0x4e82('0x40')]=function(_0x146c8d,_0x56a35e){return db[_0x4e82('0x27')][_0x4e82('0x40')](_0x146c8d[_0x4e82('0x41')],{})['then'](respondWithResult(_0x56a35e,0xc9))[_0x4e82('0x3f')](handleError(_0x56a35e,null));};exports[_0x4e82('0x42')]=function(_0xbccc9e,_0x57b894){if(_0xbccc9e[_0x4e82('0x41')]['id']){delete _0xbccc9e[_0x4e82('0x41')]['id'];}return db[_0x4e82('0x27')][_0x4e82('0x43')]({'where':{'id':_0xbccc9e['params']['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x57b894,null))[_0x4e82('0x20')](saveUpdates(_0xbccc9e['body'],null))[_0x4e82('0x20')](respondWithResult(_0x57b894,null))[_0x4e82('0x3f')](handleError(_0x57b894,null));};exports[_0x4e82('0x21')]=function(_0x1b902d,_0x4b7df4){return db[_0x4e82('0x27')]['find']({'where':{'id':_0x1b902d[_0x4e82('0x44')]['id']}})[_0x4e82('0x20')](handleEntityNotFound(_0x4b7df4,null))[_0x4e82('0x20')](removeEntity(_0x4b7df4,null))['catch'](handleError(_0x4b7df4,null));};exports[_0x4e82('0x45')]=function(_0x406df7,_0x40e98e){return db[_0x4e82('0x27')][_0x4e82('0x45')]()[_0x4e82('0x20')](respondWithResult(_0x40e98e,null))[_0x4e82('0x3f')](handleError(_0x40e98e,null));};exports[_0x4e82('0x46')]=function(_0x16b819,_0x538d21,_0xb20c9){var _0x3d0afb={'raw':!![],'where':{}};var _0x1658c8={};var _0x43b872={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4e82('0x47')]({'where':{'id':_0x16b819[_0x4e82('0x44')]['id']}})['then'](handleEntityNotFound(_0x538d21,null))[_0x4e82('0x20')](function(_0x137794){if(_0x137794){_0x1658c8[_0x4e82('0x2a')]=_[_0x4e82('0x2c')](db['JscriptyQuestionReport'][_0x4e82('0x3e')]);_0x1658c8[_0x4e82('0x2b')]=_['keys'](_0x16b819['query']);_0x1658c8['filters']=_[_0x4e82('0x2e')](_0x1658c8[_0x4e82('0x2a')],_0x1658c8[_0x4e82('0x2b')]);_0x3d0afb['attributes']=_[_0x4e82('0x2e')](_0x1658c8[_0x4e82('0x2a')],qs['fields'](_0x16b819[_0x4e82('0x2b')][_0x4e82('0x2f')]));_0x3d0afb[_0x4e82('0x30')]=_0x3d0afb[_0x4e82('0x30')][_0x4e82('0x31')]?_0x3d0afb[_0x4e82('0x30')]:_0x1658c8[_0x4e82('0x2a')];if(!_0x16b819[_0x4e82('0x2b')][_0x4e82('0x48')](_0x4e82('0x49'))){_0x3d0afb[_0x4e82('0x19')]=qs[_0x4e82('0x19')](_0x16b819[_0x4e82('0x2b')][_0x4e82('0x19')]);_0x3d0afb[_0x4e82('0x1b')]=qs[_0x4e82('0x1b')](_0x16b819['query'][_0x4e82('0x1b')]);}_0x3d0afb[_0x4e82('0x32')]=qs[_0x4e82('0x33')](_0x16b819[_0x4e82('0x2b')][_0x4e82('0x33')]);_0x3d0afb['where']=qs[_0x4e82('0x2d')](_[_0x4e82('0x35')](_0x16b819['query'],_0x1658c8[_0x4e82('0x2d')]));_0x3d0afb[_0x4e82('0x34')][_0x4e82('0x4a')]=_0x137794['id'];if(_0x16b819[_0x4e82('0x2b')][_0x4e82('0x36')]){_0x3d0afb[_0x4e82('0x34')]=_[_0x4e82('0x37')](_0x3d0afb[_0x4e82('0x34')],{'$or':_['map'](_0x3d0afb[_0x4e82('0x30')],function(_0x2450db){var _0x43b452={};_0x43b452[_0x2450db]={'$like':'%'+_0x16b819[_0x4e82('0x2b')]['filter']+'%'};return _0x43b452;})});}_0x3d0afb=_['merge']({},_0x3d0afb,_0x16b819['options']);return db['JscriptyQuestionReport'][_0x4e82('0x1a')]({'where':_0x3d0afb[_0x4e82('0x34')]})['then'](function(_0x13e58b){_0x43b872['count']=_0x13e58b;if(_0x16b819[_0x4e82('0x2b')][_0x4e82('0x3a')]){_0x3d0afb[_0x4e82('0x3b')]=[{'all':!![]}];}return db[_0x4e82('0x4b')][_0x4e82('0x3c')](_0x3d0afb);})['then'](function(_0x4e7d1f){_0x43b872['rows']=_0x4e7d1f;return _0x43b872;});}})[_0x4e82('0x20')](respondWithFilteredResult(_0x538d21,_0x3d0afb))[_0x4e82('0x3f')](handleError(_0x538d21,null));};
\ No newline at end of file
index 487e740..6e2f20b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','api','moment','bluebird','path'];(function(_0x21d9ee,_0x1c2582){var _0x479536=function(_0x4312fe){while(--_0x4312fe){_0x21d9ee['push'](_0x21d9ee['shift']());}};_0x479536(++_0x1c2582);}(_0xeff8,0x186));var _0x8eff=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xeff8[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b8f=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','api','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x3cf21b,_0x14d335){var _0x119141=function(_0x3c883e){while(--_0x3c883e){_0x3cf21b['push'](_0x3cf21b['shift']());}};_0x119141(++_0x14d335);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4f6081,_0xcfb976){_0x4f6081=_0x4f6081-0x0;var _0x39aba3=_0x6b8f[_0x4f6081];return _0x39aba3;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));module[_0xf6b8('0x6')]=function(_0x549eac,_0x2d035e){return _0x549eac[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':_0xf6b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cff25b2..07bda37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xfcf0[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}
\ No newline at end of file
+var _0x32f4=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x32f4,0x154));var _0x432f=function(_0x2b0b13,_0x3edfee){_0x2b0b13=_0x2b0b13-0x0;var _0x4e4ffc=_0x32f4[_0x2b0b13];return _0x4e4ffc;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}
\ No newline at end of file
index 41fc431..ef87df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd217=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','/:id','isAuthenticated','update','exports','util'];(function(_0x2d3fda,_0xbf4d1c){var _0x52a41f=function(_0x150a9f){while(--_0x150a9f){_0x2d3fda['push'](_0x2d3fda['shift']());}};_0x52a41f(++_0xbf4d1c);}(_0xd217,0x141));var _0x7d21=function(_0xce78d,_0x332e80){_0xce78d=_0xce78d-0x0;var _0x2bd0df=_0xd217[_0xce78d];return _0x2bd0df;};'use strict';var multer=require('multer');var util=require(_0x7d21('0x0'));var path=require(_0x7d21('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d21('0x2'));var router=express[_0x7d21('0x3')]();var fs_extra=require(_0x7d21('0x4'));var auth=require(_0x7d21('0x5'));var interaction=require(_0x7d21('0x6'));var config=require(_0x7d21('0x7'));var controller=require(_0x7d21('0x8'));router[_0x7d21('0x9')]('/',controller['index']);router['put'](_0x7d21('0xa'),auth[_0x7d21('0xb')](),controller[_0x7d21('0xc')]);module[_0x7d21('0xd')]=router;
\ No newline at end of file
+var _0x2f7e=['update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated'];(function(_0x4bb593,_0x272ed0){var _0x2da2d8=function(_0x4b25e9){while(--_0x4b25e9){_0x4bb593['push'](_0x4bb593['shift']());}};_0x2da2d8(++_0x272ed0);}(_0x2f7e,0x122));var _0xe2f7=function(_0x2aad0d,_0x1d8235){_0x2aad0d=_0x2aad0d-0x0;var _0x271815=_0x2f7e[_0x2aad0d];return _0x271815;};'use strict';var multer=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var path=require('path');var timeout=require(_0xe2f7('0x2'));var express=require(_0xe2f7('0x3'));var router=express[_0xe2f7('0x4')]();var fs_extra=require(_0xe2f7('0x5'));var auth=require(_0xe2f7('0x6'));var interaction=require(_0xe2f7('0x7'));var config=require(_0xe2f7('0x8'));var controller=require(_0xe2f7('0x9'));router[_0xe2f7('0xa')]('/',controller[_0xe2f7('0xb')]);router['put'](_0xe2f7('0xc'),auth[_0xe2f7('0xd')](),controller[_0xe2f7('0xe')]);module[_0xe2f7('0xf')]=router;
\ No newline at end of file
index 3f79428..84cf50e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5322=['INTEGER','sequelize','exports','STRING'];(function(_0x38b66e,_0x5f13bb){var _0x1bc1ef=function(_0x4ceaf6){while(--_0x4ceaf6){_0x38b66e['push'](_0x38b66e['shift']());}};_0x1bc1ef(++_0x5f13bb);}(_0x5322,0x1ad));var _0x2532=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x5322[_0x64aff8];return _0x5488a3;};'use strict';var Sequelize=require(_0x2532('0x0'));module[_0x2532('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2532('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x2532('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3ff6=['exports','STRING','INTEGER','sequelize'];(function(_0x45081a,_0x3ae384){var _0x55bfe2=function(_0xdb8714){while(--_0xdb8714){_0x45081a['push'](_0x45081a['shift']());}};_0x55bfe2(++_0x3ae384);}(_0x3ff6,0x187));var _0x63ff=function(_0x48be29,_0x8f6d4f){_0x48be29=_0x48be29-0x0;var _0x37cf85=_0x3ff6[_0x48be29];return _0x37cf85;};'use strict';var Sequelize=require(_0x63ff('0x0'));module[_0x63ff('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x63ff('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x63ff('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 9ff8faf..41154d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['Content-Range','apply','reject','save','then','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x33964b,_0x1e3f03){var _0xbaeb6c=function(_0x32d335){while(--_0x32d335){_0x33964b['push'](_0x33964b['shift']());}};_0xbaeb6c(++_0x1e3f03);}(_0x53ec,0x192));var _0xc53e=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x53ec[_0x22b8a3];return _0x199a0c;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}var utilLicense=require('../../config/license/util');exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={'raw':!![],'where':{'id':0x1}},_0x6a62b0={};_0x6a62b0[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x6a62b0[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x5112d2['query']);_0x6a62b0[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x6a62b0[_0xc53e('0x29')],_0x6a62b0['query']);_0x8f0ee6[_0xc53e('0x30')]=_['intersection'](_0x6a62b0[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x5112d2['query']['fields']));_0x8f0ee6[_0xc53e('0x30')]=_0x8f0ee6[_0xc53e('0x30')][_0xc53e('0x32')]?_0x8f0ee6[_0xc53e('0x30')]:_0x6a62b0[_0xc53e('0x29')];_0x8f0ee6=_[_0xc53e('0x33')]({},_0x8f0ee6,_0x5112d2[_0xc53e('0x34')]);return utilLicense[_0xc53e('0x35')](_0x8f0ee6)['then'](respondWithResult(_0x5ce216,null))[_0xc53e('0x36')](handleError(_0x5ce216,null));};exports[_0xc53e('0x37')]=function(_0x19020b,_0x17ad32){if(_0x19020b[_0xc53e('0x38')]['id']){delete _0x19020b[_0xc53e('0x38')]['id'];}return db[_0xc53e('0x2b')][_0xc53e('0x39')]({'where':{'id':_0x19020b[_0xc53e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x17ad32,null))[_0xc53e('0x24')](function(_0x48d7d0){var _0x1059f3=_0x48d7d0[_0xc53e('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1059f3,_0x19020b[_0xc53e('0x38')][_0xc53e('0x3c')]);})[_0xc53e('0x24')](function(_0x5ed90b){if(!_0x5ed90b[_0xc53e('0x3d')]){return saveUpdates(_0x19020b[_0xc53e('0x38')],null);}return _0x5ed90b;})[_0xc53e('0x24')](respondWithResult(_0x17ad32,null))[_0xc53e('0x36')](handleError(_0x17ad32,null));};
\ No newline at end of file
+var _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','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','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x1bf619,_0xda1b19){var _0x4ed1a5=function(_0xc5d952){while(--_0xc5d952){_0x1bf619['push'](_0x1bf619['shift']());}};_0x4ed1a5(++_0xda1b19);}(_0x2ef3,0xba));var _0x32ef=function(_0x524fa2,_0x3ab743){_0x524fa2=_0x524fa2-0x0;var _0x41ffc9=_0x2ef3[_0x524fa2];return _0x41ffc9;};'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);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));};
\ No newline at end of file
index 380190b..86e0cab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x655e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license','lodash'];(function(_0x26ddc7,_0x4551df){var _0x4774f4=function(_0x1b154c){while(--_0x1b154c){_0x26ddc7['push'](_0x26ddc7['shift']());}};_0x4774f4(++_0x4551df);}(_0x655e,0x8b));var _0xe655=function(_0xbf82c4,_0x1e46c7){_0xbf82c4=_0xbf82c4-0x0;var _0xab335b=_0x655e[_0xbf82c4];return _0xab335b;};'use strict';var _=require(_0xe655('0x0'));var util=require(_0xe655('0x1'));var logger=require(_0xe655('0x2'))(_0xe655('0x3'));var moment=require(_0xe655('0x4'));var BPromise=require(_0xe655('0x5'));var rp=require(_0xe655('0x6'));var fs=require('fs');var path=require(_0xe655('0x7'));var rimraf=require(_0xe655('0x8'));var config=require(_0xe655('0x9'));var attributes=require(_0xe655('0xa'));module[_0xe655('0xb')]=function(_0x210d65,_0x83b37a){return _0x210d65['define'](_0xe655('0xc'),attributes,{'tableName':_0xe655('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79d8=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment'];(function(_0x1af9dc,_0x3ba3f7){var _0x282999=function(_0x11dbc3){while(--_0x11dbc3){_0x1af9dc['push'](_0x1af9dc['shift']());}};_0x282999(++_0x3ba3f7);}(_0x79d8,0xa3));var _0x879d=function(_0x397328,_0x3d0a01){_0x397328=_0x397328-0x0;var _0x1a8ec5=_0x79d8[_0x397328];return _0x1a8ec5;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var logger=require(_0x879d('0x2'))(_0x879d('0x3'));var moment=require(_0x879d('0x4'));var BPromise=require('bluebird');var rp=require(_0x879d('0x5'));var fs=require('fs');var path=require(_0x879d('0x6'));var rimraf=require(_0x879d('0x7'));var config=require(_0x879d('0x8'));var attributes=require(_0x879d('0x9'));module[_0x879d('0xa')]=function(_0x563f48,_0x490f36){return _0x563f48[_0x879d('0xb')](_0x879d('0xc'),attributes,{'tableName':_0x879d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bedf548..81254a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d1c=['License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x1d1c,0x137));var _0xc1d1=function(_0x3a7634,_0x2fc854){_0x3a7634=_0x3a7634-0x0;var _0x2f3c37=_0x1d1c[_0x3a7634];return _0x2f3c37;};'use strict';var _=require(_0xc1d1('0x0'));var util=require(_0xc1d1('0x1'));var moment=require(_0xc1d1('0x2'));var BPromise=require(_0xc1d1('0x3'));var rs=require(_0xc1d1('0x4'));var fs=require('fs');var Redis=require(_0xc1d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1d1('0x6'));var logger=require('../../config/logger')(_0xc1d1('0x7'));var config=require(_0xc1d1('0x8'));var jayson=require(_0xc1d1('0x9'));var client=jayson[_0xc1d1('0xa')][_0xc1d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219c2d,_0x38ea5e,_0x13144f){return new BPromise(function(_0x5b343b,_0x49a288){return client['request'](_0x219c2d,_0x13144f)['then'](function(_0x543fb2){logger['info'](_0xc1d1('0xc'),_0x38ea5e,'request\x20sent');logger[_0xc1d1('0xd')](_0xc1d1('0xe'),_0x38ea5e,_0xc1d1('0xf'),JSON['stringify'](_0x543fb2));if(_0x543fb2[_0xc1d1('0x10')]){if(_0x543fb2['error']['code']===0x1f4){logger[_0xc1d1('0x10')](_0xc1d1('0xc'),_0x38ea5e,_0x543fb2[_0xc1d1('0x10')][_0xc1d1('0x11')]);return _0x49a288(_0x543fb2[_0xc1d1('0x10')][_0xc1d1('0x11')]);}logger[_0xc1d1('0x10')](_0xc1d1('0xc'),_0x38ea5e,_0x543fb2['error'][_0xc1d1('0x11')]);return _0x5b343b(_0x543fb2['error']['message']);}else{logger['info'](_0xc1d1('0xc'),_0x38ea5e,_0xc1d1('0xf'));_0x5b343b(_0x543fb2[_0xc1d1('0x12')]['message']);}})['catch'](function(_0x36855a){logger['error']('License,\x20%s,\x20%s',_0x38ea5e,_0x36855a);_0x49a288(_0x36855a);});});}
\ No newline at end of file
+var _0xf712=['rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','stringify','error','License,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf712,0x1d4));var _0x2f71=function(_0x27dc5c,_0x3fcd4b){_0x27dc5c=_0x27dc5c-0x0;var _0x339abc=_0xf712[_0x27dc5c];return _0x339abc;};'use strict';var _=require(_0x2f71('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2f71('0x1'));var rs=require(_0x2f71('0x2'));var fs=require('fs');var Redis=require(_0x2f71('0x3'));var db=require(_0x2f71('0x4'))['db'];var utils=require(_0x2f71('0x5'));var logger=require(_0x2f71('0x6'))(_0x2f71('0x7'));var config=require(_0x2f71('0x8'));var jayson=require(_0x2f71('0x9'));var client=jayson[_0x2f71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59f23f,_0x554e84,_0x128763){return new BPromise(function(_0xfec858,_0xca1d03){return client['request'](_0x59f23f,_0x128763)[_0x2f71('0xb')](function(_0xb68c02){logger[_0x2f71('0xc')]('License,\x20%s,\x20%s',_0x554e84,_0x2f71('0xd'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x554e84,_0x2f71('0xd'),JSON[_0x2f71('0xe')](_0xb68c02));if(_0xb68c02[_0x2f71('0xf')]){if(_0xb68c02[_0x2f71('0xf')]['code']===0x1f4){logger[_0x2f71('0xf')](_0x2f71('0x10'),_0x554e84,_0xb68c02[_0x2f71('0xf')]['message']);return _0xca1d03(_0xb68c02[_0x2f71('0xf')][_0x2f71('0x11')]);}logger['error']('License,\x20%s,\x20%s',_0x554e84,_0xb68c02[_0x2f71('0xf')][_0x2f71('0x11')]);return _0xfec858(_0xb68c02['error'][_0x2f71('0x11')]);}else{logger[_0x2f71('0xc')]('License,\x20%s,\x20%s',_0x554e84,_0x2f71('0xd'));_0xfec858(_0xb68c02[_0x2f71('0x12')]['message']);}})['catch'](function(_0xedd0a2){logger[_0x2f71('0xf')](_0x2f71('0x10'),_0x554e84,_0xedd0a2);_0xca1d03(_0xedd0a2);});});}
\ No newline at end of file
index 6dfda3b..c4e7705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bea=['removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','/:id/interactions','send','addAgents','put','update'];(function(_0x5f2f72,_0x40e1e1){var _0x1b5292=function(_0x15701b){while(--_0x15701b){_0x5f2f72['push'](_0x5f2f72['shift']());}};_0x1b5292(++_0x40e1e1);}(_0x2bea,0x66));var _0xa2be=function(_0xd4df4e,_0x21055b){_0xd4df4e=_0xd4df4e-0x0;var _0x32bafb=_0x2bea[_0xd4df4e];return _0x32bafb;};'use strict';var multer=require(_0xa2be('0x0'));var util=require('util');var path=require(_0xa2be('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2be('0x2'));var router=express[_0xa2be('0x3')]();var fs_extra=require(_0xa2be('0x4'));var auth=require(_0xa2be('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa2be('0x6'));router['get']('/',auth[_0xa2be('0x7')](),controller[_0xa2be('0x8')]);router[_0xa2be('0x9')](_0xa2be('0xa'),auth[_0xa2be('0x7')](),controller[_0xa2be('0xb')]);router[_0xa2be('0x9')](_0xa2be('0xc'),auth[_0xa2be('0x7')](),controller[_0xa2be('0xd')]);router[_0xa2be('0x9')]('/:id/dispositions',auth[_0xa2be('0x7')](),controller[_0xa2be('0xe')]);router['get'](_0xa2be('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xa2be('0x9')](_0xa2be('0x10'),auth['isAuthenticated'](),controller[_0xa2be('0x11')]);router[_0xa2be('0x9')](_0xa2be('0x12'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x13')]);router[_0xa2be('0x9')]('/:id/interactions',auth[_0xa2be('0x7')](),controller[_0xa2be('0x14')]);router[_0xa2be('0x9')](_0xa2be('0x15'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x16')]);router[_0xa2be('0x9')](_0xa2be('0x17'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x18')]);router['get']('/:id/verify',auth[_0xa2be('0x7')](),controller[_0xa2be('0x19')]);router[_0xa2be('0x9')](_0xa2be('0x1a'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x1b')]);router[_0xa2be('0x1c')](_0xa2be('0x1d'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x1e')]);router[_0xa2be('0x1c')](_0xa2be('0xf'),auth[_0xa2be('0x7')](),controller['addAnswer']);router['post']('/',auth[_0xa2be('0x7')](),controller[_0xa2be('0x1f')]);router[_0xa2be('0x1c')](_0xa2be('0x10'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x20')]);router[_0xa2be('0x1c')](_0xa2be('0x12'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x21')]);router[_0xa2be('0x1c')](_0xa2be('0x22'),auth[_0xa2be('0x7')](),controller['addInteraction']);router[_0xa2be('0x1c')](_0xa2be('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa2be('0x1c')]('/:id/send',auth[_0xa2be('0x7')](),controller[_0xa2be('0x23')]);router[_0xa2be('0x1c')](_0xa2be('0x1a'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x24')]);router[_0xa2be('0x25')](_0xa2be('0xc'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x26')]);router['delete'](_0xa2be('0x1d'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x27')]);router[_0xa2be('0x28')]('/:id/canned_answers',auth[_0xa2be('0x7')](),controller[_0xa2be('0x29')]);router[_0xa2be('0x28')](_0xa2be('0x10'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x2a')]);router[_0xa2be('0x28')](_0xa2be('0x12'),auth[_0xa2be('0x7')](),controller[_0xa2be('0x2b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa2be('0x2c')]);router['delete']('/:id/users',auth[_0xa2be('0x7')](),controller[_0xa2be('0x2d')]);module[_0xa2be('0x2e')]=router;
\ No newline at end of file
+var _0x13b5=['getAnswers','getImap','/:id/interactions','getInteractions','/:id/messages','verifySmtp','/:id/users','post','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','/:id/send','send','addAgents','/:id','update','delete','/:id/dispositions','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','describe','getDispositions','/:id/canned_answers'];(function(_0x5c63db,_0x1e5ad2){var _0x41a1d1=function(_0x56e34a){while(--_0x56e34a){_0x5c63db['push'](_0x5c63db['shift']());}};_0x41a1d1(++_0x1e5ad2);}(_0x13b5,0x14a));var _0x513b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x13b5[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x513b('0x0'));var util=require(_0x513b('0x1'));var path=require(_0x513b('0x2'));var timeout=require(_0x513b('0x3'));var express=require(_0x513b('0x4'));var router=express[_0x513b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x513b('0x6'));var config=require(_0x513b('0x7'));var controller=require(_0x513b('0x8'));router[_0x513b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x513b('0x9')]('/describe',auth[_0x513b('0xa')](),controller[_0x513b('0xb')]);router[_0x513b('0x9')]('/:id',auth[_0x513b('0xa')](),controller['show']);router[_0x513b('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x513b('0xc')]);router[_0x513b('0x9')](_0x513b('0xd'),auth[_0x513b('0xa')](),controller[_0x513b('0xe')]);router[_0x513b('0x9')]('/:id/in_servers',auth[_0x513b('0xa')](),controller[_0x513b('0xf')]);router[_0x513b('0x9')]('/:id/out_servers',auth[_0x513b('0xa')](),controller['getSmtp']);router['get'](_0x513b('0x10'),auth['isAuthenticated'](),controller[_0x513b('0x11')]);router[_0x513b('0x9')]('/:id/applications',auth[_0x513b('0xa')](),controller['getApplications']);router[_0x513b('0x9')](_0x513b('0x12'),auth[_0x513b('0xa')](),controller['getMessages']);router['get']('/:id/verify',auth[_0x513b('0xa')](),controller[_0x513b('0x13')]);router[_0x513b('0x9')](_0x513b('0x14'),auth[_0x513b('0xa')](),controller['getAgents']);router[_0x513b('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x513b('0x15')](_0x513b('0xd'),auth['isAuthenticated'](),controller[_0x513b('0x16')]);router[_0x513b('0x15')]('/',auth[_0x513b('0xa')](),controller[_0x513b('0x17')]);router[_0x513b('0x15')]('/:id/in_servers',auth[_0x513b('0xa')](),controller[_0x513b('0x18')]);router['post'](_0x513b('0x19'),auth[_0x513b('0xa')](),controller[_0x513b('0x1a')]);router[_0x513b('0x15')]('/:id/interactions',auth[_0x513b('0xa')](),controller[_0x513b('0x1b')]);router[_0x513b('0x15')](_0x513b('0x1c'),auth[_0x513b('0xa')](),controller['addApplications']);router[_0x513b('0x15')](_0x513b('0x1d'),auth['isAuthenticated'](),controller[_0x513b('0x1e')]);router[_0x513b('0x15')](_0x513b('0x14'),auth[_0x513b('0xa')](),controller[_0x513b('0x1f')]);router['put'](_0x513b('0x20'),auth['isAuthenticated'](),controller[_0x513b('0x21')]);router[_0x513b('0x22')](_0x513b('0x23'),auth[_0x513b('0xa')](),controller[_0x513b('0x24')]);router[_0x513b('0x22')](_0x513b('0xd'),auth['isAuthenticated'](),controller[_0x513b('0x25')]);router['delete'](_0x513b('0x26'),auth[_0x513b('0xa')](),controller[_0x513b('0x27')]);router[_0x513b('0x22')](_0x513b('0x19'),auth['isAuthenticated'](),controller[_0x513b('0x28')]);router['delete'](_0x513b('0x20'),auth['isAuthenticated'](),controller[_0x513b('0x29')]);router[_0x513b('0x22')](_0x513b('0x14'),auth[_0x513b('0xa')](),controller['removeAgents']);module[_0x513b('0x2a')]=router;
\ No newline at end of file
index 2b23a7c..63945a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x453ae1,_0x39dae1){_0x453ae1=_0x453ae1-0x0;var _0xfc7d06=_0x34e5[_0x453ae1];return _0xfc7d06;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x534e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x534e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x534e('0x1')],'allowNull':![],'defaultValue':_0x534e('0x3')},'fontSize':{'type':Sequelize[_0x534e('0x4')](0x2)[_0x534e('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x534e('0x6')],'defaultValue':function(){return _0x534e('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x534e('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x534e('0x9'),'set':function(_0x310b6d){if(!_0x310b6d)this[_0x534e('0xa')]('mandatoryDispositionPauseId',null);this[_0x534e('0xa')](_0x534e('0xb'),_0x310b6d);}}};
\ No newline at end of file
+var _0x815b=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x3542bc,_0x167a58){var _0x4067b4=function(_0x5b90ac){while(--_0x5b90ac){_0x3542bc['push'](_0x3542bc['shift']());}};_0x4067b4(++_0x167a58);}(_0x815b,0xb4));var _0xb815=function(_0x374829,_0x29e94d){_0x374829=_0x374829-0x0;var _0x4ad897=_0x815b[_0x374829];return _0x4ad897;};'use strict';var Sequelize=require(_0xb815('0x0'));module[_0xb815('0x1')]={'description':{'type':Sequelize[_0xb815('0x2')]},'name':{'type':Sequelize[_0xb815('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb815('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb815('0x2')],'allowNull':![],'defaultValue':_0xb815('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xb815('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb815('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[_0xb815('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb815('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb815('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb815('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xb815('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![],'comment':_0xb815('0x9'),'set':function(_0x50f5f0){if(!_0x50f5f0)this[_0xb815('0xa')](_0xb815('0xb'),null);this[_0xb815('0xa')](_0xb815('0xc'),_0x50f5f0);}}};
\ No newline at end of file
index 149a753..94d06ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6397=['DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','isNil','pass','secure','sendMail','List\x20not\x20found','Contacts','defaults','out','messageId','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailAccount.socket','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','show','params','MailServerIn','MailServerOut','include','find','body','describe','addDisposition','MailAccountId','create','findOne','Disposition','findAll','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','cservice','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','updatedAt'];(function(_0x6677cc,_0x1ee607){var _0x5f44be=function(_0x1ac771){while(--_0x1ac771){_0x6677cc['push'](_0x6677cc['shift']());}};_0x5f44be(++_0x1ee607);}(_0x6397,0xdd));var _0x7639=function(_0x525290,_0x493c29){_0x525290=_0x525290-0x0;var _0x1231ca=_0x6397[_0x525290];return _0x1231ca;};'use strict';var emlformat=require(_0x7639('0x0'));var rimraf=require(_0x7639('0x1'));var zipdir=require(_0x7639('0x2'));var jsonpatch=require(_0x7639('0x3'));var rp=require(_0x7639('0x4'));var moment=require(_0x7639('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7639('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7639('0x7'));var csv=require(_0x7639('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7639('0x9'));var _=require(_0x7639('0xa'));var squel=require(_0x7639('0xb'));var crypto=require(_0x7639('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7639('0xd'));var toCsv=require(_0x7639('0x8'));var querystring=require(_0x7639('0xe'));var Papa=require('papaparse');var htmlToText=require(_0x7639('0xf'));var juice=require(_0x7639('0x10'));var Redis=require(_0x7639('0x11'));var authService=require(_0x7639('0x12'));var qs=require(_0x7639('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7639('0x14'));var logger=require(_0x7639('0x15'))(_0x7639('0x16'));var utils=require(_0x7639('0x17'));var config=require(_0x7639('0x18'));var licenseUtil=require(_0x7639('0x19'));var db=require('../../mysqldb')['db'];config[_0x7639('0x1a')]=_['defaults'](config[_0x7639('0x1a')],{'host':_0x7639('0x1b'),'port':0x18eb});var socket=require(_0x7639('0x1c'))(new Redis(config[_0x7639('0x1a')]));require(_0x7639('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7639('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x2ac561,_0x1a0443,_0x90f61b,_0x282f73){return new BPromise(function(_0x51975e,_0x4ae464){var _0x1a6800=_0x282f73||client;return _0x1a6800[_0x7639('0x1f')](_0x2ac561,_0x90f61b)[_0x7639('0x20')](function(_0x22e0bf){logger[_0x7639('0x21')](_0x7639('0x22'),_0x1a0443,_0x7639('0x23'));logger[_0x7639('0x24')](_0x7639('0x25'),_0x1a0443,_0x7639('0x23'),JSON['stringify'](_0x22e0bf));if(_0x22e0bf[_0x7639('0x26')]){if(_0x22e0bf['error'][_0x7639('0x27')]===0x1f4){logger[_0x7639('0x26')](_0x7639('0x22'),_0x1a0443,_0x22e0bf[_0x7639('0x26')]['message']);return _0x4ae464(_0x22e0bf['error'][_0x7639('0x28')]);}logger[_0x7639('0x26')](_0x7639('0x22'),_0x1a0443,_0x22e0bf[_0x7639('0x26')][_0x7639('0x28')]);return _0x51975e(_0x22e0bf[_0x7639('0x26')]['message']);}else{logger[_0x7639('0x21')](_0x7639('0x22'),_0x1a0443,'request\x20sent');_0x51975e(_0x22e0bf[_0x7639('0x29')][_0x7639('0x28')]);}})[_0x7639('0x2a')](function(_0x219f9b){logger[_0x7639('0x26')](_0x7639('0x22'),_0x1a0443,_0x219f9b);_0x4ae464(_0x219f9b);});});}function respondWithStatusCode(_0x17401a,_0x370d74){_0x370d74=_0x370d74||0xcc;return function(_0x2da4d8){if(_0x2da4d8){return _0x17401a['sendStatus'](_0x370d74);}return _0x17401a[_0x7639('0x2b')](_0x370d74)[_0x7639('0x2c')]();};}function respondWithResult(_0x3802d9,_0x8670e3){_0x8670e3=_0x8670e3||0xc8;return function(_0x516d05){if(_0x516d05){return _0x3802d9['status'](_0x8670e3)['json'](_0x516d05);}};}function respondWithFilteredResult(_0x31563a,_0xc18960){return function(_0x238558){if(_0x238558){var _0x1fff73=typeof _0xc18960[_0x7639('0x2d')]===_0x7639('0x2e')&&typeof _0xc18960['limit']===_0x7639('0x2e');var _0x497696=_0x238558[_0x7639('0x2f')];var _0x1f18e3=_0x1fff73?0x0:_0xc18960['offset'];var _0x539457=_0x1fff73?_0x238558[_0x7639('0x2f')]:_0xc18960[_0x7639('0x2d')]+_0xc18960[_0x7639('0x30')];var _0x484f1d;if(_0x539457>=_0x497696){_0x539457=_0x497696;_0x484f1d=0xc8;}else{_0x484f1d=0xce;}_0x31563a[_0x7639('0x2b')](_0x484f1d);return _0x31563a['set'](_0x7639('0x31'),_0x1f18e3+'-'+_0x539457+'/'+_0x497696)[_0x7639('0x32')](_0x238558);}return null;};}function patchUpdates(_0x3cd55e){return function(_0x4af7f9){try{jsonpatch[_0x7639('0x33')](_0x4af7f9,_0x3cd55e,!![]);}catch(_0x36c8b1){return BPromise['reject'](_0x36c8b1);}return _0x4af7f9[_0x7639('0x34')]();};}function saveUpdates(_0x4259d9,_0x5a893f){return function(_0x5153f4){if(_0x5153f4){return _0x5153f4[_0x7639('0x35')](_0x4259d9)[_0x7639('0x20')](function(_0x45e7fa){return _0x45e7fa;});}return null;};}function removeEntity(_0x207b48,_0x4798c5){return function(_0x3027e4){if(_0x3027e4){return _0x3027e4[_0x7639('0x36')]()[_0x7639('0x20')](function(){var _0x38d70d=_0x3027e4['get']({'plain':!![]});var _0x305fd1=_0x7639('0x37');return db[_0x7639('0x38')][_0x7639('0x36')]({'where':{'type':_0x305fd1,'resourceId':_0x38d70d['id']}})[_0x7639('0x20')](function(){return _0x3027e4;});})[_0x7639('0x20')](function(){_0x207b48[_0x7639('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5e47,_0x5892d7){return function(_0x4528b5){if(!_0x4528b5){_0x2f5e47[_0x7639('0x39')](0x194);}return _0x4528b5;};}function handleError(_0x4f70fc,_0x3d651b){_0x3d651b=_0x3d651b||0x1f4;return function(_0xcb7777){logger[_0x7639('0x26')](_0xcb7777[_0x7639('0x3a')]);if(_0xcb7777[_0x7639('0x3b')]){delete _0xcb7777['name'];}_0x4f70fc[_0x7639('0x2b')](_0x3d651b)[_0x7639('0x3c')](_0xcb7777);};}exports[_0x7639('0x3d')]=function(_0x1281c9,_0xd01cd2){var _0x2165c7={'include':[{'model':db['MailServerIn'],'as':_0x7639('0x3e')},{'model':db['MailServerOut'],'as':_0x7639('0x3f')},{'model':db[_0x7639('0x40')],'as':_0x7639('0x41')}]},_0x352c55={},_0x43c7af={'count':0x0,'rows':[]};var _0x4d23e4=_[_0x7639('0x42')](db[_0x7639('0x43')][_0x7639('0x44')],function(_0x2eb19d){return{'name':_0x2eb19d[_0x7639('0x45')],'type':_0x2eb19d['type'][_0x7639('0x46')]};});_0x352c55[_0x7639('0x47')]=_[_0x7639('0x42')](_0x4d23e4,_0x7639('0x3b'));_0x352c55[_0x7639('0x48')]=_[_0x7639('0x49')](_0x1281c9[_0x7639('0x48')]);_0x352c55[_0x7639('0x4a')]=_['intersection'](_0x352c55['model'],_0x352c55['query']);_0x2165c7[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x352c55[_0x7639('0x47')],qs['fields'](_0x1281c9['query'][_0x7639('0x4d')]));_0x2165c7['attributes']=_0x2165c7['attributes'][_0x7639('0x4e')]?_0x2165c7['attributes']:_0x352c55[_0x7639('0x47')];if(!_0x1281c9[_0x7639('0x48')][_0x7639('0x4f')](_0x7639('0x50'))){_0x2165c7['limit']=qs[_0x7639('0x30')](_0x1281c9[_0x7639('0x48')][_0x7639('0x30')]);_0x2165c7[_0x7639('0x2d')]=qs[_0x7639('0x2d')](_0x1281c9[_0x7639('0x48')]['offset']);}_0x2165c7[_0x7639('0x51')]=qs['sort'](_0x1281c9['query'][_0x7639('0x52')]);_0x2165c7['where']=qs[_0x7639('0x4a')](_[_0x7639('0x53')](_0x1281c9[_0x7639('0x48')],_0x352c55['filters']),_0x4d23e4);if(_0x1281c9[_0x7639('0x48')][_0x7639('0x54')]){_0x2165c7[_0x7639('0x55')]=_[_0x7639('0x56')](_0x2165c7[_0x7639('0x55')],{'$or':_[_0x7639('0x42')](_0x4d23e4,function(_0x4d267d){if(_0x4d267d[_0x7639('0x57')]!==_0x7639('0x58')){var _0x492f9a={};_0x492f9a[_0x4d267d[_0x7639('0x3b')]]={'$like':'%'+_0x1281c9[_0x7639('0x48')][_0x7639('0x54')]+'%'};return _0x492f9a;}})});}_0x2165c7=_[_0x7639('0x56')]({},_0x2165c7,_0x1281c9[_0x7639('0x59')]);var _0x3a8984={'where':_0x2165c7[_0x7639('0x55')]};return db['MailAccount'][_0x7639('0x2f')](_0x3a8984)[_0x7639('0x20')](function(_0x42b32b){_0x43c7af['count']=_0x42b32b;if(_0x1281c9[_0x7639('0x48')][_0x7639('0x5a')]){_0x2165c7['include']=[{'all':!![]}];}return db[_0x7639('0x43')]['findAll'](_0x2165c7);})[_0x7639('0x20')](function(_0x23f76c){_0x43c7af[_0x7639('0x5b')]=_0x23f76c;return _0x43c7af;})[_0x7639('0x20')](respondWithFilteredResult(_0xd01cd2,_0x2165c7))[_0x7639('0x2a')](handleError(_0xd01cd2,null));};exports[_0x7639('0x5c')]=function(_0x10cdb5,_0x12eb7c){var _0x158e80={'raw':![],'where':{'id':_0x10cdb5[_0x7639('0x5d')]['id']},'include':[{'model':db[_0x7639('0x5e')],'as':_0x7639('0x3e')},{'model':db[_0x7639('0x5f')],'as':'Smtp'},{'model':db[_0x7639('0x40')],'as':_0x7639('0x41')}]},_0x2f78ed={};_0x2f78ed[_0x7639('0x47')]=_['keys'](db['MailAccount']['rawAttributes']);_0x2f78ed[_0x7639('0x48')]=_[_0x7639('0x49')](_0x10cdb5[_0x7639('0x48')]);_0x2f78ed['filters']=_[_0x7639('0x4c')](_0x2f78ed[_0x7639('0x47')],_0x2f78ed[_0x7639('0x48')]);_0x158e80[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x2f78ed[_0x7639('0x47')],qs[_0x7639('0x4d')](_0x10cdb5[_0x7639('0x48')]['fields']));_0x158e80['attributes']=_0x158e80[_0x7639('0x4b')][_0x7639('0x4e')]?_0x158e80['attributes']:_0x2f78ed[_0x7639('0x47')];if(_0x10cdb5['query'][_0x7639('0x5a')]){_0x158e80[_0x7639('0x60')]=[{'all':!![]}];}_0x158e80=_[_0x7639('0x56')]({},_0x158e80,_0x10cdb5[_0x7639('0x59')]);return db['MailAccount'][_0x7639('0x61')](_0x158e80)[_0x7639('0x20')](handleEntityNotFound(_0x12eb7c,null))[_0x7639('0x20')](respondWithResult(_0x12eb7c,null))[_0x7639('0x2a')](handleError(_0x12eb7c,null));};exports[_0x7639('0x35')]=function(_0x230fb4,_0xbff2ea){if(_0x230fb4['body']['id']){delete _0x230fb4[_0x7639('0x62')]['id'];}return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x230fb4[_0x7639('0x5d')]['id']},'include':[{'model':db[_0x7639('0x5e')],'as':'Imap'},{'model':db[_0x7639('0x5f')],'as':_0x7639('0x3f')},{'model':db[_0x7639('0x40')],'as':_0x7639('0x41')}]})[_0x7639('0x20')](handleEntityNotFound(_0xbff2ea,null))[_0x7639('0x20')](saveUpdates(_0x230fb4['body'],null))[_0x7639('0x20')](function(_0x2a6118){if(_0x2a6118&&_0x230fb4[_0x7639('0x62')][_0x7639('0x3e')]){return db[_0x7639('0x5e')][_0x7639('0x35')](_0x230fb4[_0x7639('0x62')][_0x7639('0x3e')],{'where':{'MailAccountId':_0x2a6118['id']}})['then'](function(){return _0x2a6118;});}return _0x2a6118;})[_0x7639('0x20')](function(_0x5ca97b){if(_0x5ca97b&&_0x230fb4[_0x7639('0x62')][_0x7639('0x3f')]){return db['MailServerOut'][_0x7639('0x35')](_0x230fb4[_0x7639('0x62')][_0x7639('0x3f')],{'where':{'MailAccountId':_0x5ca97b['id']}})[_0x7639('0x20')](function(){return _0x5ca97b;});}return _0x5ca97b;})[_0x7639('0x20')](respondWithResult(_0xbff2ea,null))['catch'](handleError(_0xbff2ea,null));};exports[_0x7639('0x63')]=function(_0x280e42,_0x5b645b){return db[_0x7639('0x43')][_0x7639('0x63')]()[_0x7639('0x20')](respondWithResult(_0x5b645b,null))[_0x7639('0x2a')](handleError(_0x5b645b,null));};exports[_0x7639('0x64')]=function(_0x26e8f1,_0x32db67,_0x5112e4){if(_0x26e8f1[_0x7639('0x62')]['id']){delete _0x26e8f1[_0x7639('0x62')]['id'];}return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x26e8f1[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x32db67,null))[_0x7639('0x20')](function(_0x58ab74){if(_0x58ab74){_0x26e8f1[_0x7639('0x62')][_0x7639('0x65')]=_0x58ab74['id'];return db['Disposition'][_0x7639('0x66')](_0x26e8f1[_0x7639('0x62')]);}})['then'](respondWithResult(_0x32db67,null))[_0x7639('0x2a')](handleError(_0x32db67,null));};exports['getDispositions']=function(_0xaebfe,_0x32b9f0,_0x452c24){var _0x1e5283={'raw':![],'where':{}};var _0x85be06={};var _0x36a22a={'count':0x0,'rows':[]};return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0xaebfe[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x32b9f0,null))[_0x7639('0x20')](function(_0xc7692b){if(_0xc7692b){_0x85be06['model']=_[_0x7639('0x49')](db[_0x7639('0x68')][_0x7639('0x44')]);_0x85be06[_0x7639('0x48')]=_[_0x7639('0x49')](_0xaebfe['query']);_0x85be06[_0x7639('0x4a')]=_[_0x7639('0x4c')](_0x85be06[_0x7639('0x47')],_0x85be06[_0x7639('0x48')]);_0x1e5283['attributes']=_[_0x7639('0x4c')](_0x85be06['model'],qs[_0x7639('0x4d')](_0xaebfe[_0x7639('0x48')][_0x7639('0x4d')]));_0x1e5283[_0x7639('0x4b')]=_0x1e5283[_0x7639('0x4b')]['length']?_0x1e5283[_0x7639('0x4b')]:_0x85be06['model'];if(!_0xaebfe['query'][_0x7639('0x4f')](_0x7639('0x50'))){_0x1e5283[_0x7639('0x30')]=qs['limit'](_0xaebfe['query'][_0x7639('0x30')]);_0x1e5283[_0x7639('0x2d')]=qs['offset'](_0xaebfe[_0x7639('0x48')][_0x7639('0x2d')]);}_0x1e5283[_0x7639('0x51')]=qs[_0x7639('0x52')](_0xaebfe[_0x7639('0x48')][_0x7639('0x52')]);_0x1e5283[_0x7639('0x55')]=qs[_0x7639('0x4a')](_[_0x7639('0x53')](_0xaebfe[_0x7639('0x48')],_0x85be06['filters']));_0x1e5283[_0x7639('0x55')][_0x7639('0x65')]=_0xc7692b['id'];if(_0xaebfe[_0x7639('0x48')]['filter']){_0x1e5283['where']=_[_0x7639('0x56')](_0x1e5283['where'],{'$or':_[_0x7639('0x42')](_0x1e5283[_0x7639('0x4b')],function(_0x52530d){var _0x3c77d6={};_0x3c77d6[_0x52530d]={'$like':'%'+_0xaebfe['query'][_0x7639('0x54')]+'%'};return _0x3c77d6;})});}_0x1e5283=_[_0x7639('0x56')]({},_0x1e5283,_0xaebfe[_0x7639('0x59')]);return db[_0x7639('0x68')][_0x7639('0x2f')]({'where':_0x1e5283['where']})[_0x7639('0x20')](function(_0x593a5d){_0x36a22a[_0x7639('0x2f')]=_0x593a5d;if(_0xaebfe['query'][_0x7639('0x5a')]){_0x1e5283[_0x7639('0x60')]=[{'all':!![]}];}return db['Disposition'][_0x7639('0x69')](_0x1e5283);})[_0x7639('0x20')](function(_0x1cb36f){_0x36a22a['rows']=_0x1cb36f;return _0x36a22a;});}})[_0x7639('0x20')](respondWithFilteredResult(_0x32b9f0,_0x1e5283))[_0x7639('0x2a')](handleError(_0x32b9f0,null));};exports['removeDispositions']=function(_0x5c1c93,_0x591ce0,_0x959652){return db[_0x7639('0x43')]['find']({'where':{'id':_0x5c1c93[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x591ce0,null))['then'](function(_0x56fbba){if(_0x56fbba){return _0x56fbba['removeDispositions'](_0x5c1c93[_0x7639('0x48')][_0x7639('0x6a')]);}})[_0x7639('0x20')](respondWithStatusCode(_0x591ce0,null))['catch'](handleError(_0x591ce0,null));};exports['addAnswer']=function(_0x1f0e74,_0x3aa6c7,_0x27ff43){if(_0x1f0e74[_0x7639('0x62')]['id']){delete _0x1f0e74['body']['id'];}return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x1f0e74[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x3aa6c7,null))[_0x7639('0x20')](function(_0x2f8a51){if(_0x2f8a51){_0x1f0e74[_0x7639('0x62')][_0x7639('0x65')]=_0x2f8a51['id'];return db[_0x7639('0x6b')][_0x7639('0x66')](_0x1f0e74[_0x7639('0x62')]);}})['then'](respondWithResult(_0x3aa6c7,null))[_0x7639('0x2a')](handleError(_0x3aa6c7,null));};exports[_0x7639('0x6c')]=function(_0x19397a,_0x50a9c2,_0x1e10ec){var _0x3fe347={'raw':![],'where':{}};var _0x571b20={};var _0x1e0985={'count':0x0,'rows':[]};return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x19397a[_0x7639('0x5d')]['id']}})['then'](handleEntityNotFound(_0x50a9c2,null))[_0x7639('0x20')](function(_0x3b661){if(_0x3b661){_0x571b20[_0x7639('0x47')]=_['keys'](db[_0x7639('0x6b')][_0x7639('0x44')]);_0x571b20['query']=_[_0x7639('0x49')](_0x19397a['query']);_0x571b20['filters']=_[_0x7639('0x4c')](_0x571b20[_0x7639('0x47')],_0x571b20[_0x7639('0x48')]);_0x3fe347[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x571b20[_0x7639('0x47')],qs[_0x7639('0x4d')](_0x19397a[_0x7639('0x48')][_0x7639('0x4d')]));_0x3fe347[_0x7639('0x4b')]=_0x3fe347['attributes'][_0x7639('0x4e')]?_0x3fe347['attributes']:_0x571b20[_0x7639('0x47')];if(!_0x19397a[_0x7639('0x48')]['hasOwnProperty'](_0x7639('0x50'))){_0x3fe347[_0x7639('0x30')]=qs[_0x7639('0x30')](_0x19397a[_0x7639('0x48')][_0x7639('0x30')]);_0x3fe347[_0x7639('0x2d')]=qs[_0x7639('0x2d')](_0x19397a[_0x7639('0x48')][_0x7639('0x2d')]);}_0x3fe347['order']=qs[_0x7639('0x52')](_0x19397a[_0x7639('0x48')][_0x7639('0x52')]);_0x3fe347[_0x7639('0x55')]=qs[_0x7639('0x4a')](_['pick'](_0x19397a[_0x7639('0x48')],_0x571b20[_0x7639('0x4a')]));_0x3fe347[_0x7639('0x55')][_0x7639('0x65')]=_0x3b661['id'];if(_0x19397a[_0x7639('0x48')][_0x7639('0x54')]){_0x3fe347[_0x7639('0x55')]=_[_0x7639('0x56')](_0x3fe347[_0x7639('0x55')],{'$or':_[_0x7639('0x42')](_0x3fe347['attributes'],function(_0x3b2013){var _0x2d9bc9={};_0x2d9bc9[_0x3b2013]={'$like':'%'+_0x19397a['query']['filter']+'%'};return _0x2d9bc9;})});}_0x3fe347=_[_0x7639('0x56')]({},_0x3fe347,_0x19397a[_0x7639('0x59')]);return db[_0x7639('0x6b')][_0x7639('0x2f')]({'where':_0x3fe347[_0x7639('0x55')]})[_0x7639('0x20')](function(_0x1d93e4){_0x1e0985[_0x7639('0x2f')]=_0x1d93e4;if(_0x19397a[_0x7639('0x48')][_0x7639('0x5a')]){_0x3fe347[_0x7639('0x60')]=[{'all':!![]}];}return db[_0x7639('0x6b')][_0x7639('0x69')](_0x3fe347);})[_0x7639('0x20')](function(_0xc75db2){_0x1e0985[_0x7639('0x5b')]=_0xc75db2;return _0x1e0985;});}})['then'](respondWithFilteredResult(_0x50a9c2,_0x3fe347))['catch'](handleError(_0x50a9c2,null));};exports[_0x7639('0x6d')]=function(_0x526c8f,_0x253be9,_0x4851bb){return db[_0x7639('0x43')]['find']({'where':{'id':_0x526c8f[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x253be9,null))[_0x7639('0x20')](function(_0x42835f){if(_0x42835f){return _0x42835f[_0x7639('0x6d')](_0x526c8f[_0x7639('0x48')][_0x7639('0x6a')]);}})[_0x7639('0x20')](respondWithStatusCode(_0x253be9,null))[_0x7639('0x2a')](handleError(_0x253be9,null));};exports[_0x7639('0x66')]=function(_0x55112f,_0x559f72){var _0x8150e4={'name':_0x55112f[_0x7639('0x62')][_0x7639('0x3b')],'key':_0x55112f['body'][_0x7639('0x46')],'email':_0x55112f[_0x7639('0x62')][_0x7639('0x6e')],'ListId':_0x55112f['body'][_0x7639('0x6f')],'active':!_['isNil'](_0x55112f['body']['active'])?_0x55112f[_0x7639('0x62')][_0x7639('0x70')]:!![],'description':_0x55112f['body']['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x55112f[_0x7639('0x62')][_0x7639('0x71')])){if(_0x55112f[_0x7639('0x62')][_0x7639('0x72')]){_0x8150e4[_0x7639('0x3e')]['user']=_0x8150e4['Smtp'][_0x7639('0x73')]=_0x55112f['body'][_0x7639('0x74')];_0x8150e4[_0x7639('0x3e')][_0x7639('0x75')]=_0x8150e4['Smtp']['pass']=_0x55112f[_0x7639('0x62')][_0x7639('0x76')];}else{_0x8150e4[_0x7639('0x3e')][_0x7639('0x77')]=_0x8150e4[_0x7639('0x3f')]['authentication']=![];}_0x8150e4[_0x7639('0x3e')][_0x7639('0x78')]=_0x55112f[_0x7639('0x62')][_0x7639('0x3e')][_0x7639('0x78')];_0x8150e4[_0x7639('0x3e')]['port']=_0x55112f[_0x7639('0x62')]['Imap'][_0x7639('0x79')];_0x8150e4[_0x7639('0x3f')]['host']=_0x55112f[_0x7639('0x62')]['Smtp'][_0x7639('0x78')];_0x8150e4[_0x7639('0x3f')][_0x7639('0x79')]=_0x55112f[_0x7639('0x62')]['Smtp'][_0x7639('0x79')];}else{_0x8150e4[_0x7639('0x3e')]['service']=_0x8150e4[_0x7639('0x3f')][_0x7639('0x7a')]=_0x55112f[_0x7639('0x62')][_0x7639('0x71')];_0x8150e4['Imap']['user']=_0x8150e4[_0x7639('0x3f')][_0x7639('0x73')]=_0x55112f[_0x7639('0x62')][_0x7639('0x74')];_0x8150e4[_0x7639('0x3e')]['password']=_0x8150e4['Smtp']['pass']=_0x55112f['body'][_0x7639('0x76')];}return db[_0x7639('0x43')][_0x7639('0x66')](_0x8150e4,{'include':[{'model':db['MailServerOut'],'as':_0x7639('0x3f')},{'model':db[_0x7639('0x5e')],'as':'Imap'}]})[_0x7639('0x20')](function(_0x171c99){var _0x159586=_0x55112f[_0x7639('0x73')][_0x7639('0x7b')]({'plain':!![]});if(!_0x159586)throw new Error(_0x7639('0x7c'));if(_0x159586['role']==='user'){var _0xbbd943=_0x171c99[_0x7639('0x7b')]({'plain':!![]});return db[_0x7639('0x7d')][_0x7639('0x61')]({'where':{'name':'MailAccounts','userProfileId':_0x159586['userProfileId']},'raw':!![]})[_0x7639('0x20')](function(_0x2d10e8){if(_0x2d10e8&&_0x2d10e8[_0x7639('0x7e')]===0x0){return db[_0x7639('0x38')]['create']({'name':_0xbbd943[_0x7639('0x3b')],'resourceId':_0xbbd943['id'],'type':_0x2d10e8['name'],'sectionId':_0x2d10e8['id']},{})[_0x7639('0x20')](function(){return _0x171c99;});}else{return _0x171c99;}})[_0x7639('0x2a')](function(_0x5c2f1e){logger[_0x7639('0x26')](_0x7639('0x7f'),_0x5c2f1e);throw _0x5c2f1e;});}return _0x171c99;})[_0x7639('0x20')](respondWithResult(_0x559f72,0xc9))[_0x7639('0x2a')](handleError(_0x559f72,null));};exports[_0x7639('0x80')]=function(_0x136d06,_0x25f6f8,_0x59bbf1){return db['MailAccount'][_0x7639('0x67')]({'where':{'id':_0x136d06[_0x7639('0x5d')]['id']}})['then'](handleEntityNotFound(_0x25f6f8,null))[_0x7639('0x20')](function(_0x458660){if(_0x458660){return _0x458660[_0x7639('0x80')]();}return null;})[_0x7639('0x20')](respondWithResult(_0x25f6f8,null))[_0x7639('0x2a')](handleError(_0x25f6f8,null));};exports['addImap']=function(_0xb4dd9a,_0x1cfed8,_0x51085f){if(_0xb4dd9a[_0x7639('0x62')]['id']){delete _0xb4dd9a[_0x7639('0x62')]['id'];}return db[_0x7639('0x43')]['find']({'where':{'id':_0xb4dd9a['params']['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x1cfed8,null))[_0x7639('0x20')](function(_0x4f8470){if(_0x4f8470){_0xb4dd9a[_0x7639('0x62')]['MailAccountId']=_0x4f8470['id'];return db[_0x7639('0x5e')][_0x7639('0x66')](_0xb4dd9a[_0x7639('0x62')]);}})['then'](respondWithResult(_0x1cfed8,null))[_0x7639('0x2a')](handleError(_0x1cfed8,null));};exports[_0x7639('0x81')]=function(_0x13eb37,_0x4fc76d,_0x25e9b8){return db['MailAccount']['findOne']({'where':{'id':_0x13eb37[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x4fc76d,null))[_0x7639('0x20')](function(_0x298bbd){if(_0x298bbd){return _0x298bbd['setImap'](null);}return null;})[_0x7639('0x20')](respondWithStatusCode(_0x4fc76d,null))['catch'](handleError(_0x4fc76d,null));};exports[_0x7639('0x82')]=function(_0x22e0cb,_0x235fb8,_0x2a9ada){return db['MailAccount']['findOne']({'where':{'id':_0x22e0cb[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x235fb8,null))[_0x7639('0x20')](function(_0x47556d){if(_0x47556d){return _0x47556d['getSmtp']();}return null;})[_0x7639('0x20')](respondWithResult(_0x235fb8,null))[_0x7639('0x2a')](handleError(_0x235fb8,null));};exports[_0x7639('0x83')]=function(_0x2c6fe9,_0x2da115,_0x5c4051){if(_0x2c6fe9['body']['id']){delete _0x2c6fe9[_0x7639('0x62')]['id'];}return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x2c6fe9[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x2da115,null))[_0x7639('0x20')](function(_0x5766a2){if(_0x5766a2){_0x2c6fe9['body'][_0x7639('0x65')]=_0x5766a2['id'];return db[_0x7639('0x5f')][_0x7639('0x66')](_0x2c6fe9[_0x7639('0x62')]);}})[_0x7639('0x20')](respondWithResult(_0x2da115,null))['catch'](handleError(_0x2da115,null));};exports['removeSmtp']=function(_0x2d4aeb,_0x4dbd31,_0xeae040){return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x2d4aeb['params']['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x4dbd31,null))['then'](function(_0x499e42){if(_0x499e42){return _0x499e42[_0x7639('0x84')](null);}return null;})[_0x7639('0x20')](respondWithStatusCode(_0x4dbd31,null))[_0x7639('0x2a')](handleError(_0x4dbd31,null));};exports[_0x7639('0x85')]=function(_0x4281a0,_0x3fa1da,_0x5e272d){return db[_0x7639('0x86')]['find']({'where':{'id':_0x4281a0[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x3fa1da,null))[_0x7639('0x20')](function(_0x238537){if(_0x238537){return _0x238537['addInteraction'](_0x4281a0[_0x7639('0x62')][_0x7639('0x6a')],_['omit'](_0x4281a0[_0x7639('0x62')],[_0x7639('0x6a'),'id'])||{});}})[_0x7639('0x20')](respondWithResult(_0x3fa1da,null))[_0x7639('0x2a')](handleError(_0x3fa1da,null));};exports[_0x7639('0x87')]=function(_0x36a85d,_0x2365b2,_0x530df6){var _0x4d1328={'raw':![],'where':{}};var _0x16fce8={};var _0x22e3ae={'count':0x0,'rows':[]};return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x36a85d[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x2365b2,null))[_0x7639('0x20')](function(_0x3b3904){if(_0x3b3904){_0x16fce8[_0x7639('0x47')]=_[_0x7639('0x49')](db[_0x7639('0x86')][_0x7639('0x44')]);_0x16fce8[_0x7639('0x48')]=_[_0x7639('0x49')](_0x36a85d['query']);_0x16fce8[_0x7639('0x4a')]=_[_0x7639('0x4c')](_0x16fce8[_0x7639('0x47')],_0x16fce8[_0x7639('0x48')]);_0x4d1328[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x16fce8[_0x7639('0x47')],qs[_0x7639('0x4d')](_0x36a85d[_0x7639('0x48')]['fields']));_0x4d1328[_0x7639('0x4b')]=_0x4d1328[_0x7639('0x4b')][_0x7639('0x4e')]?_0x4d1328[_0x7639('0x4b')]:_0x16fce8[_0x7639('0x47')];if(!_0x36a85d['query'][_0x7639('0x4f')](_0x7639('0x50'))){_0x4d1328['limit']=qs['limit'](_0x36a85d[_0x7639('0x48')]['limit']);_0x4d1328[_0x7639('0x2d')]=qs['offset'](_0x36a85d['query'][_0x7639('0x2d')]);}_0x4d1328[_0x7639('0x51')]=qs[_0x7639('0x52')](_0x36a85d[_0x7639('0x48')][_0x7639('0x52')]);_0x4d1328[_0x7639('0x55')]=qs[_0x7639('0x4a')](_[_0x7639('0x53')](_0x36a85d[_0x7639('0x48')],_0x16fce8[_0x7639('0x4a')]));_0x4d1328['where'][_0x7639('0x65')]=_0x3b3904['id'];if(_0x36a85d[_0x7639('0x48')][_0x7639('0x54')]){_0x4d1328['where']=_['merge'](_0x4d1328[_0x7639('0x55')],{'$or':_[_0x7639('0x42')](_0x4d1328[_0x7639('0x4b')],function(_0x4024ef){var _0x2b081d={};_0x2b081d[_0x4024ef]={'$like':'%'+_0x36a85d[_0x7639('0x48')][_0x7639('0x54')]+'%'};return _0x2b081d;})});}_0x4d1328=_[_0x7639('0x56')]({},_0x4d1328,_0x36a85d[_0x7639('0x59')]);return db[_0x7639('0x86')]['count']({'where':_0x4d1328[_0x7639('0x55')]})['then'](function(_0x165e89){_0x22e3ae['count']=_0x165e89;if(_0x36a85d['query'][_0x7639('0x5a')]){_0x4d1328['include']=[{'model':db[_0x7639('0x88')],'as':_0x7639('0x89'),'required':![]},{'model':db['User'],'as':_0x7639('0x8a'),'attributes':[_0x7639('0x3b'),_0x7639('0x8b'),_0x7639('0x8c')],'required':![]},{'model':db[_0x7639('0x8d')],'as':_0x7639('0x8e'),'attributes':['id',_0x7639('0x3b'),_0x7639('0x8f')],'where':_0x36a85d[_0x7639('0x48')][_0x7639('0x90')]?{'id':_0x36a85d[_0x7639('0x48')][_0x7639('0x90')]}:undefined,'required':_0x36a85d[_0x7639('0x48')][_0x7639('0x90')]?!![]:![]}];}return db[_0x7639('0x86')][_0x7639('0x69')](_0x4d1328);})[_0x7639('0x20')](function(_0x5e70b7){_0x22e3ae[_0x7639('0x5b')]=_0x5e70b7;return _0x22e3ae;});}})[_0x7639('0x20')](respondWithFilteredResult(_0x2365b2,_0x4d1328))['catch'](handleError(_0x2365b2,null));};exports['addApplications']=function(_0x36cf56,_0x10439b,_0x145202){return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x36cf56[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x10439b,null))[_0x7639('0x20')](function(_0x2e7041){if(_0x2e7041){return db[_0x7639('0x91')][_0x7639('0x92')](function(_0x16573b){return db[_0x7639('0x93')][_0x7639('0x36')]({'where':{'MailAccountId':_0x36cf56[_0x7639('0x5d')]['id']},'transaction':_0x16573b})[_0x7639('0x20')](function(_0x199999){var _0xd5598f=_[_0x7639('0x42')](_0x36cf56[_0x7639('0x62')],function(_0x30b15e){_0x30b15e['MailAccountId']=_0x36cf56[_0x7639('0x5d')]['id'];return _0x30b15e;});return db[_0x7639('0x93')][_0x7639('0x94')](_0xd5598f,{'transaction':_0x16573b});});})['then'](function(){return db[_0x7639('0x93')][_0x7639('0x95')]({'where':{'MailAccountId':_0x36cf56['params']['id']},'order':_0x7639('0x96')});});}})[_0x7639('0x20')](respondWithResult(_0x10439b,null))[_0x7639('0x2a')](handleError(_0x10439b,null));};exports[_0x7639('0x97')]=function(_0x5567d7,_0x4ff431,_0x250d1c){var _0x37648b={};var _0x57d744={};var _0x51127b;var _0x5d34e5;return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x5567d7[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x4ff431,null))[_0x7639('0x20')](function(_0x48cc04){if(_0x48cc04){_0x51127b=_0x48cc04;_0x57d744['model']=_[_0x7639('0x49')](db[_0x7639('0x93')]['rawAttributes']);_0x57d744[_0x7639('0x48')]=_[_0x7639('0x49')](_0x5567d7['query']);_0x57d744[_0x7639('0x4a')]=_[_0x7639('0x4c')](_0x57d744['model'],_0x57d744['query']);_0x37648b[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x57d744[_0x7639('0x47')],qs[_0x7639('0x4d')](_0x5567d7['query']['fields']));_0x37648b[_0x7639('0x4b')]=_0x37648b[_0x7639('0x4b')][_0x7639('0x4e')]?_0x37648b[_0x7639('0x4b')]:_0x57d744[_0x7639('0x47')];_0x37648b[_0x7639('0x51')]=qs[_0x7639('0x52')](_0x5567d7[_0x7639('0x48')][_0x7639('0x52')]);_0x37648b[_0x7639('0x55')]=qs[_0x7639('0x4a')](_[_0x7639('0x53')](_0x5567d7[_0x7639('0x48')],_0x57d744[_0x7639('0x4a')]));if(_0x5567d7[_0x7639('0x48')][_0x7639('0x54')]){_0x37648b['where']=_[_0x7639('0x56')](_0x37648b['where'],{'$or':_[_0x7639('0x42')](_0x37648b['attributes'],function(_0x5ae2e3){var _0x3334ee={};_0x3334ee[_0x5ae2e3]={'$like':'%'+_0x5567d7[_0x7639('0x48')][_0x7639('0x54')]+'%'};return _0x3334ee;})});}_0x37648b=_[_0x7639('0x56')]({},_0x37648b,_0x5567d7['options']);return _0x51127b[_0x7639('0x97')](_0x37648b);}})[_0x7639('0x20')](function(_0x5d6985){if(_0x5d6985){_0x5d34e5=_0x5d6985[_0x7639('0x4e')];if(!_0x5567d7[_0x7639('0x48')]['hasOwnProperty'](_0x7639('0x50'))){_0x37648b[_0x7639('0x30')]=qs['limit'](_0x5567d7[_0x7639('0x48')][_0x7639('0x30')]);_0x37648b['offset']=qs[_0x7639('0x2d')](_0x5567d7['query'][_0x7639('0x2d')]);}return _0x51127b[_0x7639('0x97')](_0x37648b);}})['then'](function(_0x64a01){if(_0x64a01){return _0x64a01?{'count':_0x5d34e5,'rows':_0x64a01}:null;}})[_0x7639('0x20')](respondWithResult(_0x4ff431,null))[_0x7639('0x2a')](handleError(_0x4ff431,null));};exports['getMessages']=function(_0x4fedbd,_0xa06a1e,_0x431368){var _0x491a46={'raw':!![],'where':{}};var _0x1073ab={};var _0x5bd469={'count':0x0,'rows':[]};return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x4fedbd[_0x7639('0x5d')]['id']}})['then'](handleEntityNotFound(_0xa06a1e,null))[_0x7639('0x20')](function(_0x96caf6){if(_0x96caf6){_0x1073ab[_0x7639('0x47')]=_['keys'](db[_0x7639('0x98')]['rawAttributes']);_0x1073ab[_0x7639('0x48')]=_[_0x7639('0x49')](_0x4fedbd['query']);_0x1073ab[_0x7639('0x4a')]=_[_0x7639('0x4c')](_0x1073ab[_0x7639('0x47')],_0x1073ab['query']);_0x491a46[_0x7639('0x4b')]=_[_0x7639('0x4c')](_0x1073ab['model'],qs['fields'](_0x4fedbd[_0x7639('0x48')][_0x7639('0x4d')]));_0x491a46[_0x7639('0x4b')]=_0x491a46['attributes']['length']?_0x491a46[_0x7639('0x4b')]:_0x1073ab['model'];if(!_0x4fedbd[_0x7639('0x48')]['hasOwnProperty'](_0x7639('0x50'))){_0x491a46[_0x7639('0x30')]=qs[_0x7639('0x30')](_0x4fedbd[_0x7639('0x48')][_0x7639('0x30')]);_0x491a46[_0x7639('0x2d')]=qs[_0x7639('0x2d')](_0x4fedbd[_0x7639('0x48')][_0x7639('0x2d')]);}_0x491a46[_0x7639('0x51')]=qs[_0x7639('0x52')](_0x4fedbd[_0x7639('0x48')]['sort']);_0x491a46[_0x7639('0x55')]=qs[_0x7639('0x4a')](_[_0x7639('0x53')](_0x4fedbd['query'],_0x1073ab[_0x7639('0x4a')]));_0x491a46[_0x7639('0x55')][_0x7639('0x65')]=_0x96caf6['id'];if(_0x4fedbd[_0x7639('0x48')][_0x7639('0x54')]){_0x491a46['where']=_['merge'](_0x491a46[_0x7639('0x55')],{'$or':_['map'](_0x491a46[_0x7639('0x4b')],function(_0xad58e1){var _0x22a5c6={};_0x22a5c6[_0xad58e1]={'$like':'%'+_0x4fedbd[_0x7639('0x48')][_0x7639('0x54')]+'%'};return _0x22a5c6;})});}if(_0x4fedbd[_0x7639('0x48')][_0x7639('0x99')]){var _0x246c2c=_0x4fedbd['query'][_0x7639('0x99')][_0x7639('0x9a')](',');var _0x4d3c28={};_0x4d3c28[_0x246c2c[0x0]]={'$gte':moment(_0x246c2c[0x1])[_0x7639('0x9b')](_0x7639('0x9c'))};_0x491a46[_0x7639('0x55')]=_[_0x7639('0x56')](_0x491a46[_0x7639('0x55')],_0x4d3c28);}_0x491a46=_[_0x7639('0x56')]({},_0x491a46,_0x4fedbd['options']);return db[_0x7639('0x98')][_0x7639('0x2f')]({'where':_0x491a46['where']})['then'](function(_0x42b4b2){_0x5bd469[_0x7639('0x2f')]=_0x42b4b2;if(_0x4fedbd['query'][_0x7639('0x5a')]){_0x491a46[_0x7639('0x60')]=[{'all':!![]}];}return db[_0x7639('0x98')][_0x7639('0x69')](_0x491a46);})['then'](function(_0x5d9ece){if(_0x4fedbd[_0x7639('0x48')][_0x7639('0x9d')]==='true'){for(var _0x543ccf=0x0;_0x543ccf<_0x5d9ece[_0x7639('0x4e')];_0x543ccf++){_0x5d9ece[_0x543ccf][_0x7639('0x62')]=juice(_0x5d9ece[_0x543ccf][_0x7639('0x62')]);}}_0x5bd469[_0x7639('0x5b')]=_0x5d9ece;return _0x5bd469;});}})[_0x7639('0x20')](respondWithFilteredResult(_0xa06a1e,_0x491a46))[_0x7639('0x2a')](handleError(_0xa06a1e,null));};exports['send']=function(_0x55bc54,_0x1c8617,_0x586d35){var _0x56e0bb,_0x392ea3={},_0x2abbde;if(_0x55bc54[_0x7639('0x62')]['to']){_0x2abbde=_0x55bc54[_0x7639('0x62')]['to'][_0x7639('0x9a')](',')[0x0];}return db[_0x7639('0x43')]['find']({'where':{'id':_0x55bc54[_0x7639('0x5d')]['id']},'include':[{'model':db[_0x7639('0x9e')],'as':_0x7639('0x9f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x2abbde},'limit':0x1,'order':[[_0x7639('0xa0'),_0x7639('0xa1')]]}]},{'model':db[_0x7639('0x5f')],'as':_0x7639('0x3f'),'raw':!![]}]})[_0x7639('0x20')](handleEntityNotFound(_0x1c8617,null))[_0x7639('0x20')](function(_0x45f694){if(_0x45f694){_0x56e0bb=_0x45f694;if(_0x45f694[_0x7639('0x3f')]){if(_['isNil'](_0x55bc54[_0x7639('0x62')][_0x7639('0xa2')])){_0x55bc54[_0x7639('0x62')]['from']=util[_0x7639('0x9b')](_0x7639('0xa3'),_0x45f694[_0x7639('0x3b')],_0x45f694['email']||_0x45f694[_0x7639('0x3f')]['user']);}if(_0x55bc54[_0x7639('0x62')][_0x7639('0xa4')]&&_0x55bc54[_0x7639('0x62')][_0x7639('0xa4')]['length']){for(var _0x75a460=0x0;_0x75a460<_0x55bc54['body']['attachments']['length'];_0x75a460+=0x1){_0x55bc54[_0x7639('0x62')][_0x7639('0xa4')][_0x75a460]={'filename':_0x55bc54[_0x7639('0x62')][_0x7639('0xa4')][_0x75a460][_0x7639('0x3b')],'path':path[_0x7639('0xa5')](config['root'],_0x7639('0xa6'),_0x55bc54[_0x7639('0x62')][_0x7639('0xa4')][_0x75a460][_0x7639('0xa7')])};}}var _0x527bb8={'tls':{'rejectUnauthorized':![]}};if(_[_0x7639('0xa8')](_0x45f694[_0x7639('0x3f')][_0x7639('0x7a')])){if(_0x45f694[_0x7639('0x3f')][_0x7639('0x77')]){_0x527bb8['auth']={'user':_0x45f694[_0x7639('0x3f')]['user'],'pass':_0x45f694[_0x7639('0x3f')][_0x7639('0xa9')]};}_0x527bb8['host']=_0x45f694[_0x7639('0x3f')][_0x7639('0x78')];_0x527bb8[_0x7639('0x79')]=_0x45f694[_0x7639('0x3f')][_0x7639('0x79')];_0x527bb8[_0x7639('0xaa')]=_0x45f694[_0x7639('0x3f')][_0x7639('0xaa')];}else{_0x527bb8[_0x7639('0x7a')]=_0x45f694[_0x7639('0x3f')][_0x7639('0x7a')];_0x527bb8['auth']={'user':_0x45f694['Smtp'][_0x7639('0x73')],'pass':_0x45f694['Smtp'][_0x7639('0xa9')]};}return respondWithRpcPromise('SendMail',_0x7639('0xab'),{'account':_0x527bb8,'message':_0x55bc54[_0x7639('0x62')]});}else{throw new Error(_0x7639('0xac'));}}})[_0x7639('0x20')](function(_0x203d9e){if(_0x203d9e){_0x392ea3=_0x203d9e;if(_0x56e0bb[_0x7639('0x9f')]){if(_0x56e0bb[_0x7639('0x9f')][_0x7639('0xad')][_0x7639('0x4e')]){return _0x56e0bb[_0x7639('0x9f')][_0x7639('0xad')][0x0];}else{return db[_0x7639('0x88')][_0x7639('0x66')](_[_0x7639('0xae')](_0x55bc54[_0x7639('0x62')],{'firstName':_0x55bc54['body']['to'],'email':_0x55bc54['body']['to'],'phone':_0x55bc54[_0x7639('0x62')]['to'],'ListId':_0x56e0bb[_0x7639('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x8df647){if(_0x8df647){var _0x3cffa2={'UserId':_0x55bc54['user']['id'],'ContactId':_0x8df647['id'],'MailAccountId':_0x56e0bb['id'],'inReplyTo':_0x392ea3['messageId'],'to':_0x55bc54[_0x7639('0x62')][_0x7639('0xa2')],'cc':_0x55bc54[_0x7639('0x62')]['cc'],'subject':_0x55bc54[_0x7639('0x62')]['subject'],'attach':_0x55bc54[_0x7639('0x62')]['attach'],'firstMsgDirection':_0x7639('0xaf'),'lastMsgAt':moment()[_0x7639('0x9b')](_0x7639('0x9c')),'lastMsgDirection':_0x7639('0xaf'),'Messages':[_[_0x7639('0x56')](_0x55bc54[_0x7639('0x62')],{'messageId':_0x392ea3[_0x7639('0xb0')],'sentAt':moment()[_0x7639('0x9b')](_0x7639('0x9c')),'read':!![],'MailAccountId':_0x56e0bb['id'],'UserId':_0x55bc54[_0x7639('0x73')]['id'],'ContactId':_0x8df647['id']})]};if(_0x55bc54[_0x7639('0x62')][_0x7639('0xb1')]){_0x3cffa2=_[_0x7639('0x56')](_0x3cffa2,_0x55bc54[_0x7639('0x62')]['Interaction']);}return db[_0x7639('0x86')][_0x7639('0x66')](_0x3cffa2,{'include':[{'model':db[_0x7639('0x98')],'as':_0x7639('0xb2')}]});}})['then'](respondWithResult(_0x1c8617,null))[_0x7639('0x2a')](handleError(_0x1c8617,null));};exports[_0x7639('0xb3')]=function(_0x3bcd28,_0x55fcde,_0x1c3347){return db[_0x7639('0x43')]['find']({'where':{'id':_0x3bcd28['params']['id']},'include':[{'model':db[_0x7639('0x5f')],'as':_0x7639('0x3f'),'raw':!![]}]})[_0x7639('0x20')](handleEntityNotFound(_0x55fcde,null))[_0x7639('0x20')](function(_0x272b9a){if(_0x272b9a&&_0x272b9a[_0x7639('0x3f')]){var _0x58e607={'id':_0x272b9a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x272b9a['Smtp']['service']){_0x58e607[_0x7639('0x7a')]=_0x272b9a[_0x7639('0x3f')][_0x7639('0x7a')];}else{_0x58e607['host']=_0x272b9a['Smtp'][_0x7639('0x78')];_0x58e607[_0x7639('0x79')]=_0x272b9a[_0x7639('0x3f')]['port'];_0x58e607[_0x7639('0xaa')]=_0x272b9a[_0x7639('0x3f')][_0x7639('0xaa')];}if(_0x272b9a[_0x7639('0x3f')][_0x7639('0x77')]){_0x58e607['auth']={'user':_0x272b9a[_0x7639('0x3f')][_0x7639('0x73')],'pass':_0x272b9a[_0x7639('0x3f')][_0x7639('0xa9')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x58e607});}})[_0x7639('0x20')](respondWithResult(_0x55fcde,null))[_0x7639('0x2a')](handleError(_0x55fcde,null));};exports[_0x7639('0x36')]=function(_0x4f43b3,_0x341be8){return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x4f43b3[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x341be8,null))[_0x7639('0x20')](function(_0x596675){if(_0x596675&&_0x596675[_0x7639('0x7a')]){throw new db[(_0x7639('0xb4'))]['ValidationError'](_0x7639('0xb5'));}return _0x596675;})['then'](removeEntity(_0x341be8,null))[_0x7639('0x2a')](handleError(_0x341be8,null));};exports[_0x7639('0xb6')]=function(_0x5ec6b4,_0x4e294d,_0x51a7d4){return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x5ec6b4[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x4e294d,null))[_0x7639('0x20')](function(_0x2b149c){if(_0x2b149c){return _0x2b149c[_0x7639('0xb6')](_0x5ec6b4[_0x7639('0x62')]['ids'],_[_0x7639('0xb7')](_0x5ec6b4[_0x7639('0x62')],[_0x7639('0x6a'),'id'])||{})[_0x7639('0xb8')](function(_0x594da6){for(var _0x25db34=0x0;_0x25db34<_0x5ec6b4[_0x7639('0x62')][_0x7639('0x6a')]['length'];_0x25db34+=0x1){socket[_0x7639('0xb9')](_0x7639('0xba'),{'UserId':Number(_0x5ec6b4[_0x7639('0x62')][_0x7639('0x6a')][_0x25db34]),'MailAccountId':Number(_0x5ec6b4[_0x7639('0x5d')]['id'])});}return _0x594da6;});}})[_0x7639('0x20')](respondWithResult(_0x4e294d,null))['catch'](handleError(_0x4e294d,null));};exports[_0x7639('0xbb')]=function(_0x189a96,_0x33dcb3,_0x45d1af){return db[_0x7639('0x43')][_0x7639('0x61')]({'where':{'id':_0x189a96[_0x7639('0x5d')]['id']}})[_0x7639('0x20')](handleEntityNotFound(_0x33dcb3,null))[_0x7639('0x20')](function(_0x402efd){if(_0x402efd){return _0x402efd[_0x7639('0xbb')](_0x189a96['query'][_0x7639('0x6a')])[_0x7639('0x20')](function(){if(_[_0x7639('0xbc')](_0x189a96[_0x7639('0x48')]['ids'])){for(var _0x9fb81b=0x0;_0x9fb81b<_0x189a96['query'][_0x7639('0x6a')][_0x7639('0x4e')];_0x9fb81b+=0x1){socket[_0x7639('0xb9')](_0x7639('0xbd'),{'UserId':Number(_0x189a96['query']['ids'][_0x9fb81b]),'MailAccountId':Number(_0x189a96[_0x7639('0x5d')]['id'])});}}else{socket[_0x7639('0xb9')](_0x7639('0xbd'),{'UserId':Number(_0x189a96[_0x7639('0x48')][_0x7639('0x6a')]),'MailAccountId':Number(_0x189a96[_0x7639('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x33dcb3,null))[_0x7639('0x2a')](handleError(_0x33dcb3,null));};exports[_0x7639('0xbe')]=function(_0x424773,_0x81c226,_0x2256db){var _0x3afeec={};var _0x3c1b36={};var _0x135a17;var _0x239cd0;return db[_0x7639('0x43')][_0x7639('0x67')]({'where':{'id':_0x424773[_0x7639('0x5d')]['id']}})['then'](handleEntityNotFound(_0x81c226,null))[_0x7639('0x20')](function(_0x559f1c){if(_0x559f1c){_0x135a17=_0x559f1c;_0x3c1b36['model']=_[_0x7639('0x49')](db['User'][_0x7639('0x44')]);_0x3c1b36[_0x7639('0x48')]=_[_0x7639('0x49')](_0x424773[_0x7639('0x48')]);_0x3c1b36[_0x7639('0x4a')]=_[_0x7639('0x4c')](_0x3c1b36[_0x7639('0x47')],_0x3c1b36['query']);_0x3afeec[_0x7639('0x4b')]=_['intersection'](_0x3c1b36['model'],qs[_0x7639('0x4d')](_0x424773[_0x7639('0x48')][_0x7639('0x4d')]));_0x3afeec[_0x7639('0x4b')]=_0x3afeec[_0x7639('0x4b')][_0x7639('0x4e')]?_0x3afeec[_0x7639('0x4b')]:_0x3c1b36[_0x7639('0x47')];_0x3afeec[_0x7639('0x51')]=qs[_0x7639('0x52')](_0x424773['query'][_0x7639('0x52')]);_0x3afeec[_0x7639('0x55')]=qs[_0x7639('0x4a')](_['pick'](_0x424773['query'],_0x3c1b36['filters']));if(_0x424773[_0x7639('0x48')][_0x7639('0x54')]){_0x3afeec['where']=_[_0x7639('0x56')](_0x3afeec[_0x7639('0x55')],{'$or':_[_0x7639('0x42')](_0x3afeec[_0x7639('0x4b')],function(_0x43d667){var _0x171200={};_0x171200[_0x43d667]={'$like':'%'+_0x424773['query'][_0x7639('0x54')]+'%'};return _0x171200;})});}_0x3afeec=_[_0x7639('0x56')]({},_0x3afeec,_0x424773['options']);return _0x135a17[_0x7639('0xbe')](_0x3afeec);}})['then'](function(_0x3b0c0f){if(_0x3b0c0f){_0x239cd0=_0x3b0c0f[_0x7639('0x4e')];if(!_0x424773[_0x7639('0x48')][_0x7639('0x4f')](_0x7639('0x50'))){_0x3afeec[_0x7639('0x30')]=qs[_0x7639('0x30')](_0x424773['query'][_0x7639('0x30')]);_0x3afeec[_0x7639('0x2d')]=qs[_0x7639('0x2d')](_0x424773[_0x7639('0x48')][_0x7639('0x2d')]);}return _0x135a17[_0x7639('0xbe')](_0x3afeec);}})['then'](function(_0x56b61f){if(_0x56b61f){return _0x56b61f?{'count':_0x239cd0,'rows':_0x56b61f}:null;}})['then'](respondWithResult(_0x81c226,null))[_0x7639('0x2a')](handleError(_0x81c226,null));};
\ No newline at end of file
+var _0x9159=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','show','params','Imap','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','sort','map','removeDispositions','ids','addAnswer','CannedAnswer','findOne','rows','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','List','updatedAt','DESC','from','%s\x20<%s>','attachments','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','Contacts','attach','messageId','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','end','name','send','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type'];(function(_0x5e8fc,_0x1ccc06){var _0x41c58c=function(_0x495f2c){while(--_0x495f2c){_0x5e8fc['push'](_0x5e8fc['shift']());}};_0x41c58c(++_0x1ccc06);}(_0x9159,0x148));var _0x9915=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x9159[_0x1f5887];return _0x21774b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9915('0x0'));var zipdir=require(_0x9915('0x1'));var jsonpatch=require(_0x9915('0x2'));var rp=require(_0x9915('0x3'));var moment=require(_0x9915('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9915('0x5'));var util=require(_0x9915('0x6'));var path=require(_0x9915('0x7'));var sox=require(_0x9915('0x8'));var csv=require(_0x9915('0x9'));var ejs=require(_0x9915('0xa'));var fs=require('fs');var fs_extra=require(_0x9915('0xb'));var _=require('lodash');var squel=require(_0x9915('0xc'));var crypto=require('crypto');var jsforce=require(_0x9915('0xd'));var deskjs=require(_0x9915('0xe'));var toCsv=require(_0x9915('0x9'));var querystring=require(_0x9915('0xf'));var Papa=require(_0x9915('0x10'));var htmlToText=require(_0x9915('0x11'));var juice=require(_0x9915('0x12'));var Redis=require(_0x9915('0x13'));var authService=require(_0x9915('0x14'));var qs=require(_0x9915('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9915('0x16'));var logger=require(_0x9915('0x17'))(_0x9915('0x18'));var utils=require('../../config/utils');var config=require(_0x9915('0x19'));var licenseUtil=require(_0x9915('0x1a'));var db=require(_0x9915('0x1b'))['db'];config['redis']=_[_0x9915('0x1c')](config[_0x9915('0x1d')],{'host':_0x9915('0x1e'),'port':0x18eb});var socket=require(_0x9915('0x1f'))(new Redis(config['redis']));require(_0x9915('0x20'))[_0x9915('0x21')](socket);var jayson=require(_0x9915('0x22'));var client=jayson['client'][_0x9915('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x1ff172,_0x9b39f0,_0x366549,_0x525925){return new BPromise(function(_0x481887,_0x32602d){var _0x3c0cb0=_0x525925||client;return _0x3c0cb0['request'](_0x1ff172,_0x366549)[_0x9915('0x24')](function(_0x57604d){logger[_0x9915('0x25')](_0x9915('0x26'),_0x9b39f0,'request\x20sent');logger[_0x9915('0x27')](_0x9915('0x28'),_0x9b39f0,_0x9915('0x29'),JSON[_0x9915('0x2a')](_0x57604d));if(_0x57604d[_0x9915('0x2b')]){if(_0x57604d[_0x9915('0x2b')][_0x9915('0x2c')]===0x1f4){logger['error'](_0x9915('0x26'),_0x9b39f0,_0x57604d[_0x9915('0x2b')][_0x9915('0x2d')]);return _0x32602d(_0x57604d[_0x9915('0x2b')][_0x9915('0x2d')]);}logger[_0x9915('0x2b')](_0x9915('0x26'),_0x9b39f0,_0x57604d['error'][_0x9915('0x2d')]);return _0x481887(_0x57604d[_0x9915('0x2b')][_0x9915('0x2d')]);}else{logger[_0x9915('0x25')]('MailAccount,\x20%s,\x20%s',_0x9b39f0,_0x9915('0x29'));_0x481887(_0x57604d[_0x9915('0x2e')]['message']);}})[_0x9915('0x2f')](function(_0x53e46e){logger[_0x9915('0x2b')](_0x9915('0x26'),_0x9b39f0,_0x53e46e);_0x32602d(_0x53e46e);});});}function respondWithStatusCode(_0x21b80f,_0x30f7b1){_0x30f7b1=_0x30f7b1||0xcc;return function(_0x18f07b){if(_0x18f07b){return _0x21b80f[_0x9915('0x30')](_0x30f7b1);}return _0x21b80f[_0x9915('0x31')](_0x30f7b1)['end']();};}function respondWithResult(_0x29a7ab,_0x50891e){_0x50891e=_0x50891e||0xc8;return function(_0x2fd4e9){if(_0x2fd4e9){return _0x29a7ab[_0x9915('0x31')](_0x50891e)[_0x9915('0x32')](_0x2fd4e9);}};}function respondWithFilteredResult(_0x3b7468,_0x29bb68){return function(_0x5797c9){if(_0x5797c9){var _0x2c5a0a=typeof _0x29bb68['offset']==='undefined'&&typeof _0x29bb68[_0x9915('0x33')]===_0x9915('0x34');var _0x1bc069=_0x5797c9['count'];var _0x5d3a22=_0x2c5a0a?0x0:_0x29bb68[_0x9915('0x35')];var _0x1dd731=_0x2c5a0a?_0x5797c9[_0x9915('0x36')]:_0x29bb68['offset']+_0x29bb68[_0x9915('0x33')];var _0x496b5c;if(_0x1dd731>=_0x1bc069){_0x1dd731=_0x1bc069;_0x496b5c=0xc8;}else{_0x496b5c=0xce;}_0x3b7468[_0x9915('0x31')](_0x496b5c);return _0x3b7468[_0x9915('0x37')](_0x9915('0x38'),_0x5d3a22+'-'+_0x1dd731+'/'+_0x1bc069)[_0x9915('0x32')](_0x5797c9);}return null;};}function patchUpdates(_0x3c4f69){return function(_0x1e845d){try{jsonpatch[_0x9915('0x39')](_0x1e845d,_0x3c4f69,!![]);}catch(_0x364f0c){return BPromise[_0x9915('0x3a')](_0x364f0c);}return _0x1e845d[_0x9915('0x3b')]();};}function saveUpdates(_0x477808,_0x3f45da){return function(_0x2bd6f3){if(_0x2bd6f3){return _0x2bd6f3[_0x9915('0x3c')](_0x477808)[_0x9915('0x24')](function(_0x582b73){return _0x582b73;});}return null;};}function removeEntity(_0x49b3be,_0x3fbb8a){return function(_0x3beac5){if(_0x3beac5){return _0x3beac5[_0x9915('0x3d')]()['then'](function(){var _0x92f899=_0x3beac5[_0x9915('0x3e')]({'plain':!![]});var _0x7a0f7e=_0x9915('0x3f');return db['UserProfileResource']['destroy']({'where':{'type':_0x7a0f7e,'resourceId':_0x92f899['id']}})[_0x9915('0x24')](function(){return _0x3beac5;});})[_0x9915('0x24')](function(){_0x49b3be[_0x9915('0x31')](0xcc)[_0x9915('0x40')]();});}};}function handleEntityNotFound(_0x9aaa09,_0x5db17f){return function(_0x4cbe95){if(!_0x4cbe95){_0x9aaa09[_0x9915('0x30')](0x194);}return _0x4cbe95;};}function handleError(_0x11dea0,_0xbd5c43){_0xbd5c43=_0xbd5c43||0x1f4;return function(_0x336e68){logger[_0x9915('0x2b')](_0x336e68['stack']);if(_0x336e68[_0x9915('0x41')]){delete _0x336e68[_0x9915('0x41')];}_0x11dea0[_0x9915('0x31')](_0xbd5c43)[_0x9915('0x42')](_0x336e68);};}exports['index']=function(_0x12f4e6,_0x580bd3){var _0x9d219b={'include':[{'model':db[_0x9915('0x43')],'as':'Imap'},{'model':db[_0x9915('0x44')],'as':_0x9915('0x45')},{'model':db[_0x9915('0x46')],'as':_0x9915('0x47')}]},_0x1d7701={},_0x4b95ea={'count':0x0,'rows':[]};var _0x23b330=_['map'](db[_0x9915('0x48')][_0x9915('0x49')],function(_0x40051f){return{'name':_0x40051f[_0x9915('0x4a')],'type':_0x40051f[_0x9915('0x4b')][_0x9915('0x4c')]};});_0x1d7701[_0x9915('0x4d')]=_['map'](_0x23b330,_0x9915('0x41'));_0x1d7701[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x12f4e6['query']);_0x1d7701[_0x9915('0x50')]=_[_0x9915('0x51')](_0x1d7701[_0x9915('0x4d')],_0x1d7701[_0x9915('0x4e')]);_0x9d219b[_0x9915('0x52')]=_[_0x9915('0x51')](_0x1d7701[_0x9915('0x4d')],qs['fields'](_0x12f4e6[_0x9915('0x4e')][_0x9915('0x53')]));_0x9d219b['attributes']=_0x9d219b[_0x9915('0x52')][_0x9915('0x54')]?_0x9d219b['attributes']:_0x1d7701[_0x9915('0x4d')];if(!_0x12f4e6[_0x9915('0x4e')]['hasOwnProperty'](_0x9915('0x55'))){_0x9d219b[_0x9915('0x33')]=qs[_0x9915('0x33')](_0x12f4e6[_0x9915('0x4e')][_0x9915('0x33')]);_0x9d219b[_0x9915('0x35')]=qs[_0x9915('0x35')](_0x12f4e6[_0x9915('0x4e')][_0x9915('0x35')]);}_0x9d219b[_0x9915('0x56')]=qs['sort'](_0x12f4e6[_0x9915('0x4e')]['sort']);_0x9d219b[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0x12f4e6[_0x9915('0x4e')],_0x1d7701[_0x9915('0x50')]),_0x23b330);if(_0x12f4e6[_0x9915('0x4e')][_0x9915('0x59')]){_0x9d219b[_0x9915('0x57')]=_[_0x9915('0x5a')](_0x9d219b[_0x9915('0x57')],{'$or':_['map'](_0x23b330,function(_0x51ac48){if(_0x51ac48['type']!=='VIRTUAL'){var _0x534140={};_0x534140[_0x51ac48['name']]={'$like':'%'+_0x12f4e6[_0x9915('0x4e')][_0x9915('0x59')]+'%'};return _0x534140;}})});}_0x9d219b=_['merge']({},_0x9d219b,_0x12f4e6[_0x9915('0x5b')]);var _0x3b9dc8={'where':_0x9d219b['where']};return db['MailAccount'][_0x9915('0x36')](_0x3b9dc8)['then'](function(_0x147bfd){_0x4b95ea[_0x9915('0x36')]=_0x147bfd;if(_0x12f4e6[_0x9915('0x4e')][_0x9915('0x5c')]){_0x9d219b[_0x9915('0x5d')]=[{'all':!![]}];}return db['MailAccount'][_0x9915('0x5e')](_0x9d219b);})['then'](function(_0x582a2a){_0x4b95ea['rows']=_0x582a2a;return _0x4b95ea;})[_0x9915('0x24')](respondWithFilteredResult(_0x580bd3,_0x9d219b))['catch'](handleError(_0x580bd3,null));};exports[_0x9915('0x5f')]=function(_0x441bb9,_0x70c0de){var _0x434a3d={'raw':![],'where':{'id':_0x441bb9[_0x9915('0x60')]['id']},'include':[{'model':db[_0x9915('0x43')],'as':_0x9915('0x61')},{'model':db[_0x9915('0x44')],'as':_0x9915('0x45')},{'model':db['Pause'],'as':_0x9915('0x47')}]},_0x3ad912={};_0x3ad912[_0x9915('0x4d')]=_[_0x9915('0x4f')](db[_0x9915('0x48')][_0x9915('0x49')]);_0x3ad912[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x441bb9[_0x9915('0x4e')]);_0x3ad912[_0x9915('0x50')]=_[_0x9915('0x51')](_0x3ad912[_0x9915('0x4d')],_0x3ad912[_0x9915('0x4e')]);_0x434a3d['attributes']=_['intersection'](_0x3ad912['model'],qs['fields'](_0x441bb9[_0x9915('0x4e')][_0x9915('0x53')]));_0x434a3d[_0x9915('0x52')]=_0x434a3d[_0x9915('0x52')][_0x9915('0x54')]?_0x434a3d[_0x9915('0x52')]:_0x3ad912['model'];if(_0x441bb9[_0x9915('0x4e')]['includeAll']){_0x434a3d['include']=[{'all':!![]}];}_0x434a3d=_[_0x9915('0x5a')]({},_0x434a3d,_0x441bb9[_0x9915('0x5b')]);return db[_0x9915('0x48')][_0x9915('0x62')](_0x434a3d)[_0x9915('0x24')](handleEntityNotFound(_0x70c0de,null))[_0x9915('0x24')](respondWithResult(_0x70c0de,null))[_0x9915('0x2f')](handleError(_0x70c0de,null));};exports[_0x9915('0x3c')]=function(_0x372dc6,_0x34500d){if(_0x372dc6[_0x9915('0x63')]['id']){delete _0x372dc6[_0x9915('0x63')]['id'];}return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x372dc6[_0x9915('0x60')]['id']},'include':[{'model':db[_0x9915('0x43')],'as':_0x9915('0x61')},{'model':db[_0x9915('0x44')],'as':_0x9915('0x45')},{'model':db[_0x9915('0x46')],'as':_0x9915('0x47')}]})[_0x9915('0x24')](handleEntityNotFound(_0x34500d,null))[_0x9915('0x24')](saveUpdates(_0x372dc6[_0x9915('0x63')],null))[_0x9915('0x24')](function(_0x1ca990){if(_0x1ca990&&_0x372dc6[_0x9915('0x63')]['Imap']){return db[_0x9915('0x43')]['update'](_0x372dc6[_0x9915('0x63')][_0x9915('0x61')],{'where':{'MailAccountId':_0x1ca990['id']}})[_0x9915('0x24')](function(){return _0x1ca990;});}return _0x1ca990;})[_0x9915('0x24')](function(_0x182256){if(_0x182256&&_0x372dc6[_0x9915('0x63')][_0x9915('0x45')]){return db[_0x9915('0x44')][_0x9915('0x3c')](_0x372dc6[_0x9915('0x63')][_0x9915('0x45')],{'where':{'MailAccountId':_0x182256['id']}})['then'](function(){return _0x182256;});}return _0x182256;})[_0x9915('0x24')](respondWithResult(_0x34500d,null))['catch'](handleError(_0x34500d,null));};exports[_0x9915('0x64')]=function(_0x4005da,_0x57a64c){return db['MailAccount']['describe']()[_0x9915('0x24')](respondWithResult(_0x57a64c,null))[_0x9915('0x2f')](handleError(_0x57a64c,null));};exports[_0x9915('0x65')]=function(_0x4bf9b3,_0x5c26ec,_0x12a76f){if(_0x4bf9b3[_0x9915('0x63')]['id']){delete _0x4bf9b3[_0x9915('0x63')]['id'];}return db[_0x9915('0x48')]['find']({'where':{'id':_0x4bf9b3[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x5c26ec,null))['then'](function(_0x2615b1){if(_0x2615b1){_0x4bf9b3[_0x9915('0x63')][_0x9915('0x66')]=_0x2615b1['id'];return db[_0x9915('0x67')][_0x9915('0x68')](_0x4bf9b3[_0x9915('0x63')]);}})[_0x9915('0x24')](respondWithResult(_0x5c26ec,null))[_0x9915('0x2f')](handleError(_0x5c26ec,null));};exports[_0x9915('0x69')]=function(_0xcc4f1c,_0x1a0837,_0x4cc97d){var _0xc1d81e={'raw':![],'where':{}};var _0x2e9e5d={};var _0x593b54={'count':0x0,'rows':[]};return db[_0x9915('0x48')]['findOne']({'where':{'id':_0xcc4f1c[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x1a0837,null))[_0x9915('0x24')](function(_0x2a1434){if(_0x2a1434){_0x2e9e5d[_0x9915('0x4d')]=_['keys'](db['Disposition'][_0x9915('0x49')]);_0x2e9e5d[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0xcc4f1c[_0x9915('0x4e')]);_0x2e9e5d[_0x9915('0x50')]=_[_0x9915('0x51')](_0x2e9e5d['model'],_0x2e9e5d[_0x9915('0x4e')]);_0xc1d81e[_0x9915('0x52')]=_[_0x9915('0x51')](_0x2e9e5d['model'],qs['fields'](_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x53')]));_0xc1d81e[_0x9915('0x52')]=_0xc1d81e[_0x9915('0x52')][_0x9915('0x54')]?_0xc1d81e[_0x9915('0x52')]:_0x2e9e5d[_0x9915('0x4d')];if(!_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x6a')](_0x9915('0x55'))){_0xc1d81e['limit']=qs[_0x9915('0x33')](_0xcc4f1c[_0x9915('0x4e')]['limit']);_0xc1d81e[_0x9915('0x35')]=qs[_0x9915('0x35')](_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x35')]);}_0xc1d81e[_0x9915('0x56')]=qs[_0x9915('0x6b')](_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x6b')]);_0xc1d81e[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0xcc4f1c[_0x9915('0x4e')],_0x2e9e5d['filters']));_0xc1d81e[_0x9915('0x57')]['MailAccountId']=_0x2a1434['id'];if(_0xcc4f1c[_0x9915('0x4e')]['filter']){_0xc1d81e['where']=_[_0x9915('0x5a')](_0xc1d81e[_0x9915('0x57')],{'$or':_[_0x9915('0x6c')](_0xc1d81e[_0x9915('0x52')],function(_0x5aa3d9){var _0x3bda4e={};_0x3bda4e[_0x5aa3d9]={'$like':'%'+_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x59')]+'%'};return _0x3bda4e;})});}_0xc1d81e=_[_0x9915('0x5a')]({},_0xc1d81e,_0xcc4f1c[_0x9915('0x5b')]);return db[_0x9915('0x67')][_0x9915('0x36')]({'where':_0xc1d81e[_0x9915('0x57')]})['then'](function(_0x46b9de){_0x593b54[_0x9915('0x36')]=_0x46b9de;if(_0xcc4f1c[_0x9915('0x4e')][_0x9915('0x5c')]){_0xc1d81e[_0x9915('0x5d')]=[{'all':!![]}];}return db[_0x9915('0x67')][_0x9915('0x5e')](_0xc1d81e);})['then'](function(_0x1cc881){_0x593b54['rows']=_0x1cc881;return _0x593b54;});}})['then'](respondWithFilteredResult(_0x1a0837,_0xc1d81e))[_0x9915('0x2f')](handleError(_0x1a0837,null));};exports[_0x9915('0x6d')]=function(_0x28a3df,_0x14dbf7,_0x47209f){return db[_0x9915('0x48')]['find']({'where':{'id':_0x28a3df['params']['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x14dbf7,null))['then'](function(_0x58c565){if(_0x58c565){return _0x58c565['removeDispositions'](_0x28a3df[_0x9915('0x4e')][_0x9915('0x6e')]);}})[_0x9915('0x24')](respondWithStatusCode(_0x14dbf7,null))[_0x9915('0x2f')](handleError(_0x14dbf7,null));};exports[_0x9915('0x6f')]=function(_0x1ebae1,_0x2265be,_0x273cf9){if(_0x1ebae1[_0x9915('0x63')]['id']){delete _0x1ebae1['body']['id'];}return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x1ebae1['params']['id']}})['then'](handleEntityNotFound(_0x2265be,null))['then'](function(_0x1b9de1){if(_0x1b9de1){_0x1ebae1[_0x9915('0x63')][_0x9915('0x66')]=_0x1b9de1['id'];return db[_0x9915('0x70')][_0x9915('0x68')](_0x1ebae1[_0x9915('0x63')]);}})[_0x9915('0x24')](respondWithResult(_0x2265be,null))[_0x9915('0x2f')](handleError(_0x2265be,null));};exports['getAnswers']=function(_0x588b90,_0x17d583,_0x32c5a7){var _0x3b0a9e={'raw':![],'where':{}};var _0x2d7b5e={};var _0xd20c16={'count':0x0,'rows':[]};return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x588b90[_0x9915('0x60')]['id']}})['then'](handleEntityNotFound(_0x17d583,null))['then'](function(_0x344588){if(_0x344588){_0x2d7b5e['model']=_[_0x9915('0x4f')](db['CannedAnswer'][_0x9915('0x49')]);_0x2d7b5e[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x588b90[_0x9915('0x4e')]);_0x2d7b5e[_0x9915('0x50')]=_['intersection'](_0x2d7b5e[_0x9915('0x4d')],_0x2d7b5e[_0x9915('0x4e')]);_0x3b0a9e[_0x9915('0x52')]=_[_0x9915('0x51')](_0x2d7b5e[_0x9915('0x4d')],qs[_0x9915('0x53')](_0x588b90[_0x9915('0x4e')][_0x9915('0x53')]));_0x3b0a9e[_0x9915('0x52')]=_0x3b0a9e[_0x9915('0x52')]['length']?_0x3b0a9e[_0x9915('0x52')]:_0x2d7b5e[_0x9915('0x4d')];if(!_0x588b90[_0x9915('0x4e')]['hasOwnProperty']('nolimit')){_0x3b0a9e[_0x9915('0x33')]=qs['limit'](_0x588b90['query']['limit']);_0x3b0a9e['offset']=qs[_0x9915('0x35')](_0x588b90['query'][_0x9915('0x35')]);}_0x3b0a9e['order']=qs['sort'](_0x588b90[_0x9915('0x4e')][_0x9915('0x6b')]);_0x3b0a9e[_0x9915('0x57')]=qs['filters'](_[_0x9915('0x58')](_0x588b90['query'],_0x2d7b5e['filters']));_0x3b0a9e[_0x9915('0x57')][_0x9915('0x66')]=_0x344588['id'];if(_0x588b90[_0x9915('0x4e')][_0x9915('0x59')]){_0x3b0a9e[_0x9915('0x57')]=_['merge'](_0x3b0a9e[_0x9915('0x57')],{'$or':_[_0x9915('0x6c')](_0x3b0a9e[_0x9915('0x52')],function(_0x4909ec){var _0x146603={};_0x146603[_0x4909ec]={'$like':'%'+_0x588b90['query'][_0x9915('0x59')]+'%'};return _0x146603;})});}_0x3b0a9e=_[_0x9915('0x5a')]({},_0x3b0a9e,_0x588b90['options']);return db[_0x9915('0x70')][_0x9915('0x36')]({'where':_0x3b0a9e['where']})['then'](function(_0x2f65ef){_0xd20c16[_0x9915('0x36')]=_0x2f65ef;if(_0x588b90[_0x9915('0x4e')][_0x9915('0x5c')]){_0x3b0a9e['include']=[{'all':!![]}];}return db[_0x9915('0x70')]['findAll'](_0x3b0a9e);})[_0x9915('0x24')](function(_0x4dd1c4){_0xd20c16[_0x9915('0x72')]=_0x4dd1c4;return _0xd20c16;});}})[_0x9915('0x24')](respondWithFilteredResult(_0x17d583,_0x3b0a9e))[_0x9915('0x2f')](handleError(_0x17d583,null));};exports[_0x9915('0x73')]=function(_0x21acce,_0x42af28,_0x4facf5){return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x21acce[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x42af28,null))[_0x9915('0x24')](function(_0x43109c){if(_0x43109c){return _0x43109c['removeAnswers'](_0x21acce[_0x9915('0x4e')][_0x9915('0x6e')]);}})[_0x9915('0x24')](respondWithStatusCode(_0x42af28,null))[_0x9915('0x2f')](handleError(_0x42af28,null));};exports[_0x9915('0x68')]=function(_0x3924aa,_0x48c83f){var _0x7759aa={'name':_0x3924aa[_0x9915('0x63')][_0x9915('0x41')],'key':_0x3924aa[_0x9915('0x63')][_0x9915('0x4c')],'email':_0x3924aa['body'][_0x9915('0x74')],'ListId':_0x3924aa['body'][_0x9915('0x75')],'active':!_[_0x9915('0x76')](_0x3924aa['body']['active'])?_0x3924aa['body'][_0x9915('0x77')]:!![],'description':_0x3924aa[_0x9915('0x63')][_0x9915('0x78')]||null,'Imap':{},'Smtp':{}};if(_[_0x9915('0x76')](_0x3924aa[_0x9915('0x63')][_0x9915('0x79')])){if(_0x3924aa[_0x9915('0x63')][_0x9915('0x7a')]){_0x7759aa[_0x9915('0x61')][_0x9915('0x7b')]=_0x7759aa[_0x9915('0x45')]['user']=_0x3924aa[_0x9915('0x63')][_0x9915('0x7c')];_0x7759aa['Imap'][_0x9915('0x7d')]=_0x7759aa[_0x9915('0x45')][_0x9915('0x7e')]=_0x3924aa['body'][_0x9915('0x7f')];}else{_0x7759aa[_0x9915('0x61')][_0x9915('0x80')]=_0x7759aa['Smtp'][_0x9915('0x80')]=![];}_0x7759aa[_0x9915('0x61')][_0x9915('0x81')]=_0x3924aa['body'][_0x9915('0x61')]['host'];_0x7759aa[_0x9915('0x61')][_0x9915('0x82')]=_0x3924aa[_0x9915('0x63')][_0x9915('0x61')][_0x9915('0x82')];_0x7759aa[_0x9915('0x45')][_0x9915('0x81')]=_0x3924aa['body'][_0x9915('0x45')][_0x9915('0x81')];_0x7759aa[_0x9915('0x45')]['port']=_0x3924aa[_0x9915('0x63')][_0x9915('0x45')][_0x9915('0x82')];}else{_0x7759aa[_0x9915('0x61')][_0x9915('0x83')]=_0x7759aa['Smtp'][_0x9915('0x83')]=_0x3924aa['body'][_0x9915('0x79')];_0x7759aa[_0x9915('0x61')][_0x9915('0x7b')]=_0x7759aa[_0x9915('0x45')][_0x9915('0x7b')]=_0x3924aa[_0x9915('0x63')][_0x9915('0x7c')];_0x7759aa[_0x9915('0x61')][_0x9915('0x7d')]=_0x7759aa[_0x9915('0x45')]['pass']=_0x3924aa[_0x9915('0x63')]['cpassword'];}return db[_0x9915('0x48')][_0x9915('0x68')](_0x7759aa,{'include':[{'model':db[_0x9915('0x44')],'as':_0x9915('0x45')},{'model':db[_0x9915('0x43')],'as':_0x9915('0x61')}]})[_0x9915('0x24')](function(_0xe389a1){var _0x5b6eef=_0x3924aa[_0x9915('0x7b')][_0x9915('0x3e')]({'plain':!![]});if(!_0x5b6eef)throw new Error(_0x9915('0x84'));if(_0x5b6eef[_0x9915('0x85')]===_0x9915('0x7b')){var _0x2c7685=_0xe389a1[_0x9915('0x3e')]({'plain':!![]});return db[_0x9915('0x86')][_0x9915('0x62')]({'where':{'name':_0x9915('0x3f'),'userProfileId':_0x5b6eef[_0x9915('0x87')]},'raw':!![]})[_0x9915('0x24')](function(_0x4e8ce3){if(_0x4e8ce3&&_0x4e8ce3[_0x9915('0x88')]===0x0){return db['UserProfileResource'][_0x9915('0x68')]({'name':_0x2c7685[_0x9915('0x41')],'resourceId':_0x2c7685['id'],'type':_0x4e8ce3[_0x9915('0x41')],'sectionId':_0x4e8ce3['id']},{})[_0x9915('0x24')](function(){return _0xe389a1;});}else{return _0xe389a1;}})[_0x9915('0x2f')](function(_0x4f5e4b){logger[_0x9915('0x2b')](_0x9915('0x89'),_0x4f5e4b);throw _0x4f5e4b;});}return _0xe389a1;})[_0x9915('0x24')](respondWithResult(_0x48c83f,0xc9))[_0x9915('0x2f')](handleError(_0x48c83f,null));};exports[_0x9915('0x8a')]=function(_0x5ae5d6,_0xc2fdb9,_0x2d472c){return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x5ae5d6[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0xc2fdb9,null))[_0x9915('0x24')](function(_0x38876a){if(_0x38876a){return _0x38876a[_0x9915('0x8a')]();}return null;})[_0x9915('0x24')](respondWithResult(_0xc2fdb9,null))[_0x9915('0x2f')](handleError(_0xc2fdb9,null));};exports[_0x9915('0x8b')]=function(_0x934bc1,_0x2dcb6c,_0x2bfb89){if(_0x934bc1[_0x9915('0x63')]['id']){delete _0x934bc1[_0x9915('0x63')]['id'];}return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x934bc1['params']['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x2dcb6c,null))['then'](function(_0x5d3095){if(_0x5d3095){_0x934bc1[_0x9915('0x63')][_0x9915('0x66')]=_0x5d3095['id'];return db[_0x9915('0x43')][_0x9915('0x68')](_0x934bc1[_0x9915('0x63')]);}})[_0x9915('0x24')](respondWithResult(_0x2dcb6c,null))[_0x9915('0x2f')](handleError(_0x2dcb6c,null));};exports[_0x9915('0x8c')]=function(_0x5acbc7,_0x12431f,_0x2375b5){return db['MailAccount'][_0x9915('0x71')]({'where':{'id':_0x5acbc7[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x12431f,null))['then'](function(_0x4581ab){if(_0x4581ab){return _0x4581ab[_0x9915('0x8d')](null);}return null;})['then'](respondWithStatusCode(_0x12431f,null))['catch'](handleError(_0x12431f,null));};exports[_0x9915('0x8e')]=function(_0x26e367,_0x8b9815,_0x18ede7){return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x26e367[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x8b9815,null))[_0x9915('0x24')](function(_0x473bf3){if(_0x473bf3){return _0x473bf3['getSmtp']();}return null;})['then'](respondWithResult(_0x8b9815,null))[_0x9915('0x2f')](handleError(_0x8b9815,null));};exports['addSmtp']=function(_0x158363,_0x2bfdaa,_0x41d2f6){if(_0x158363['body']['id']){delete _0x158363['body']['id'];}return db['MailAccount'][_0x9915('0x62')]({'where':{'id':_0x158363['params']['id']}})['then'](handleEntityNotFound(_0x2bfdaa,null))[_0x9915('0x24')](function(_0x530fc2){if(_0x530fc2){_0x158363[_0x9915('0x63')]['MailAccountId']=_0x530fc2['id'];return db['MailServerOut'][_0x9915('0x68')](_0x158363[_0x9915('0x63')]);}})['then'](respondWithResult(_0x2bfdaa,null))[_0x9915('0x2f')](handleError(_0x2bfdaa,null));};exports[_0x9915('0x8f')]=function(_0x3be864,_0x1fa538,_0x4373ea){return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x3be864[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x1fa538,null))['then'](function(_0x38c4ca){if(_0x38c4ca){return _0x38c4ca[_0x9915('0x90')](null);}return null;})[_0x9915('0x24')](respondWithStatusCode(_0x1fa538,null))[_0x9915('0x2f')](handleError(_0x1fa538,null));};exports[_0x9915('0x91')]=function(_0x21e667,_0x558610,_0x132aae){return db['MailInteraction'][_0x9915('0x62')]({'where':{'id':_0x21e667['params']['id']}})['then'](handleEntityNotFound(_0x558610,null))[_0x9915('0x24')](function(_0x4c4b91){if(_0x4c4b91){return _0x4c4b91[_0x9915('0x91')](_0x21e667[_0x9915('0x63')]['ids'],_[_0x9915('0x92')](_0x21e667['body'],[_0x9915('0x6e'),'id'])||{});}})[_0x9915('0x24')](respondWithResult(_0x558610,null))['catch'](handleError(_0x558610,null));};exports[_0x9915('0x93')]=function(_0x3c24ae,_0x3f194c,_0xfb9bea){var _0xadce4c={'raw':![],'where':{}};var _0x4d0b3e={};var _0x1b02d0={'count':0x0,'rows':[]};return db['MailAccount'][_0x9915('0x71')]({'where':{'id':_0x3c24ae[_0x9915('0x60')]['id']}})['then'](handleEntityNotFound(_0x3f194c,null))[_0x9915('0x24')](function(_0x28e48a){if(_0x28e48a){_0x4d0b3e['model']=_[_0x9915('0x4f')](db[_0x9915('0x94')][_0x9915('0x49')]);_0x4d0b3e[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x3c24ae['query']);_0x4d0b3e[_0x9915('0x50')]=_['intersection'](_0x4d0b3e['model'],_0x4d0b3e[_0x9915('0x4e')]);_0xadce4c[_0x9915('0x52')]=_[_0x9915('0x51')](_0x4d0b3e[_0x9915('0x4d')],qs[_0x9915('0x53')](_0x3c24ae[_0x9915('0x4e')]['fields']));_0xadce4c['attributes']=_0xadce4c[_0x9915('0x52')][_0x9915('0x54')]?_0xadce4c[_0x9915('0x52')]:_0x4d0b3e[_0x9915('0x4d')];if(!_0x3c24ae[_0x9915('0x4e')]['hasOwnProperty'](_0x9915('0x55'))){_0xadce4c['limit']=qs[_0x9915('0x33')](_0x3c24ae[_0x9915('0x4e')][_0x9915('0x33')]);_0xadce4c['offset']=qs[_0x9915('0x35')](_0x3c24ae[_0x9915('0x4e')][_0x9915('0x35')]);}_0xadce4c[_0x9915('0x56')]=qs['sort'](_0x3c24ae['query'][_0x9915('0x6b')]);_0xadce4c[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0x3c24ae['query'],_0x4d0b3e[_0x9915('0x50')]));_0xadce4c[_0x9915('0x57')][_0x9915('0x66')]=_0x28e48a['id'];if(_0x3c24ae[_0x9915('0x4e')][_0x9915('0x59')]){_0xadce4c[_0x9915('0x57')]=_[_0x9915('0x5a')](_0xadce4c[_0x9915('0x57')],{'$or':_[_0x9915('0x6c')](_0xadce4c['attributes'],function(_0x22d723){var _0x50dff8={};_0x50dff8[_0x22d723]={'$like':'%'+_0x3c24ae[_0x9915('0x4e')][_0x9915('0x59')]+'%'};return _0x50dff8;})});}_0xadce4c=_[_0x9915('0x5a')]({},_0xadce4c,_0x3c24ae['options']);return db['MailInteraction'][_0x9915('0x36')]({'where':_0xadce4c[_0x9915('0x57')]})[_0x9915('0x24')](function(_0x27108e){_0x1b02d0[_0x9915('0x36')]=_0x27108e;if(_0x3c24ae[_0x9915('0x4e')][_0x9915('0x5c')]){_0xadce4c[_0x9915('0x5d')]=[{'model':db[_0x9915('0x95')],'as':_0x9915('0x96'),'required':![]},{'model':db['User'],'as':_0x9915('0x97'),'attributes':[_0x9915('0x41'),_0x9915('0x98'),_0x9915('0x99')],'required':![]},{'model':db[_0x9915('0x9a')],'as':_0x9915('0x9b'),'attributes':['id',_0x9915('0x41'),_0x9915('0x9c')],'where':_0x3c24ae['query']['tag']?{'id':_0x3c24ae[_0x9915('0x4e')]['tag']}:undefined,'required':_0x3c24ae[_0x9915('0x4e')][_0x9915('0x9d')]?!![]:![]}];}return db[_0x9915('0x94')][_0x9915('0x5e')](_0xadce4c);})[_0x9915('0x24')](function(_0x25ec95){_0x1b02d0[_0x9915('0x72')]=_0x25ec95;return _0x1b02d0;});}})[_0x9915('0x24')](respondWithFilteredResult(_0x3f194c,_0xadce4c))[_0x9915('0x2f')](handleError(_0x3f194c,null));};exports['addApplications']=function(_0x16cdb4,_0xcab447,_0x1f5d8a){return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x16cdb4[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0xcab447,null))[_0x9915('0x24')](function(_0x24f1e9){if(_0x24f1e9){return db['sequelize'][_0x9915('0x9e')](function(_0xd40ab8){return db[_0x9915('0x9f')]['destroy']({'where':{'MailAccountId':_0x16cdb4[_0x9915('0x60')]['id']},'transaction':_0xd40ab8})['then'](function(_0x35a4a9){var _0x3b7d14=_['map'](_0x16cdb4['body'],function(_0x3fdfc3){_0x3fdfc3[_0x9915('0x66')]=_0x16cdb4[_0x9915('0x60')]['id'];return _0x3fdfc3;});return db[_0x9915('0x9f')][_0x9915('0xa0')](_0x3b7d14,{'transaction':_0xd40ab8});});})[_0x9915('0x24')](function(){return db['MailApplication'][_0x9915('0xa1')]({'where':{'MailAccountId':_0x16cdb4['params']['id']},'order':'priority'});});}})[_0x9915('0x24')](respondWithResult(_0xcab447,null))[_0x9915('0x2f')](handleError(_0xcab447,null));};exports['getApplications']=function(_0x1d173c,_0xce34ac,_0x4ccafe){var _0x20cddb={};var _0x49c9f3={};var _0x4806f2;var _0x509f0b;return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x1d173c[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0xce34ac,null))[_0x9915('0x24')](function(_0x34e457){if(_0x34e457){_0x4806f2=_0x34e457;_0x49c9f3[_0x9915('0x4d')]=_['keys'](db[_0x9915('0x9f')]['rawAttributes']);_0x49c9f3[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x1d173c[_0x9915('0x4e')]);_0x49c9f3[_0x9915('0x50')]=_[_0x9915('0x51')](_0x49c9f3[_0x9915('0x4d')],_0x49c9f3[_0x9915('0x4e')]);_0x20cddb['attributes']=_[_0x9915('0x51')](_0x49c9f3[_0x9915('0x4d')],qs['fields'](_0x1d173c[_0x9915('0x4e')][_0x9915('0x53')]));_0x20cddb['attributes']=_0x20cddb[_0x9915('0x52')][_0x9915('0x54')]?_0x20cddb[_0x9915('0x52')]:_0x49c9f3[_0x9915('0x4d')];_0x20cddb[_0x9915('0x56')]=qs[_0x9915('0x6b')](_0x1d173c[_0x9915('0x4e')]['sort']);_0x20cddb[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0x1d173c[_0x9915('0x4e')],_0x49c9f3[_0x9915('0x50')]));if(_0x1d173c[_0x9915('0x4e')][_0x9915('0x59')]){_0x20cddb[_0x9915('0x57')]=_[_0x9915('0x5a')](_0x20cddb['where'],{'$or':_[_0x9915('0x6c')](_0x20cddb[_0x9915('0x52')],function(_0x295598){var _0x3a8f0f={};_0x3a8f0f[_0x295598]={'$like':'%'+_0x1d173c[_0x9915('0x4e')]['filter']+'%'};return _0x3a8f0f;})});}_0x20cddb=_[_0x9915('0x5a')]({},_0x20cddb,_0x1d173c['options']);return _0x4806f2[_0x9915('0xa2')](_0x20cddb);}})['then'](function(_0x3d88ae){if(_0x3d88ae){_0x509f0b=_0x3d88ae[_0x9915('0x54')];if(!_0x1d173c['query'][_0x9915('0x6a')](_0x9915('0x55'))){_0x20cddb[_0x9915('0x33')]=qs[_0x9915('0x33')](_0x1d173c[_0x9915('0x4e')][_0x9915('0x33')]);_0x20cddb['offset']=qs[_0x9915('0x35')](_0x1d173c[_0x9915('0x4e')][_0x9915('0x35')]);}return _0x4806f2[_0x9915('0xa2')](_0x20cddb);}})[_0x9915('0x24')](function(_0x29ea75){if(_0x29ea75){return _0x29ea75?{'count':_0x509f0b,'rows':_0x29ea75}:null;}})[_0x9915('0x24')](respondWithResult(_0xce34ac,null))['catch'](handleError(_0xce34ac,null));};exports[_0x9915('0xa3')]=function(_0x19a859,_0x23bd4f,_0x2198c8){var _0x237922={'raw':!![],'where':{}};var _0x5a6814={};var _0x1d4c6d={'count':0x0,'rows':[]};return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x19a859[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x23bd4f,null))[_0x9915('0x24')](function(_0x5861af){if(_0x5861af){_0x5a6814[_0x9915('0x4d')]=_[_0x9915('0x4f')](db[_0x9915('0xa4')][_0x9915('0x49')]);_0x5a6814[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x19a859[_0x9915('0x4e')]);_0x5a6814[_0x9915('0x50')]=_[_0x9915('0x51')](_0x5a6814[_0x9915('0x4d')],_0x5a6814[_0x9915('0x4e')]);_0x237922['attributes']=_['intersection'](_0x5a6814['model'],qs[_0x9915('0x53')](_0x19a859[_0x9915('0x4e')][_0x9915('0x53')]));_0x237922[_0x9915('0x52')]=_0x237922['attributes'][_0x9915('0x54')]?_0x237922[_0x9915('0x52')]:_0x5a6814[_0x9915('0x4d')];if(!_0x19a859[_0x9915('0x4e')][_0x9915('0x6a')](_0x9915('0x55'))){_0x237922[_0x9915('0x33')]=qs['limit'](_0x19a859['query'][_0x9915('0x33')]);_0x237922['offset']=qs[_0x9915('0x35')](_0x19a859['query'][_0x9915('0x35')]);}_0x237922['order']=qs[_0x9915('0x6b')](_0x19a859['query']['sort']);_0x237922[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0x19a859[_0x9915('0x4e')],_0x5a6814[_0x9915('0x50')]));_0x237922[_0x9915('0x57')]['MailAccountId']=_0x5861af['id'];if(_0x19a859[_0x9915('0x4e')][_0x9915('0x59')]){_0x237922['where']=_[_0x9915('0x5a')](_0x237922[_0x9915('0x57')],{'$or':_[_0x9915('0x6c')](_0x237922[_0x9915('0x52')],function(_0xca7a60){var _0x50d9bd={};_0x50d9bd[_0xca7a60]={'$like':'%'+_0x19a859[_0x9915('0x4e')][_0x9915('0x59')]+'%'};return _0x50d9bd;})});}if(_0x19a859[_0x9915('0x4e')][_0x9915('0xa5')]){var _0x2f9fcf=_0x19a859[_0x9915('0x4e')][_0x9915('0xa5')]['split'](',');var _0x5b6caf={};_0x5b6caf[_0x2f9fcf[0x0]]={'$gte':moment(_0x2f9fcf[0x1])[_0x9915('0xa6')](_0x9915('0xa7'))};_0x237922[_0x9915('0x57')]=_['merge'](_0x237922[_0x9915('0x57')],_0x5b6caf);}_0x237922=_[_0x9915('0x5a')]({},_0x237922,_0x19a859[_0x9915('0x5b')]);return db[_0x9915('0xa4')][_0x9915('0x36')]({'where':_0x237922[_0x9915('0x57')]})[_0x9915('0x24')](function(_0x259ca5){_0x1d4c6d[_0x9915('0x36')]=_0x259ca5;if(_0x19a859[_0x9915('0x4e')]['includeAll']){_0x237922[_0x9915('0x5d')]=[{'all':!![]}];}return db['MailMessage'][_0x9915('0x5e')](_0x237922);})['then'](function(_0x373e35){if(_0x19a859['query'][_0x9915('0xa8')]===_0x9915('0xa9')){for(var _0x27fc6e=0x0;_0x27fc6e<_0x373e35['length'];_0x27fc6e++){_0x373e35[_0x27fc6e][_0x9915('0x63')]=juice(_0x373e35[_0x27fc6e][_0x9915('0x63')]);}}_0x1d4c6d[_0x9915('0x72')]=_0x373e35;return _0x1d4c6d;});}})[_0x9915('0x24')](respondWithFilteredResult(_0x23bd4f,_0x237922))['catch'](handleError(_0x23bd4f,null));};exports[_0x9915('0x42')]=function(_0x25c14b,_0x146ee4,_0x3d6bfc){var _0x2405ca,_0x310dd2={},_0x28b087;if(_0x25c14b[_0x9915('0x63')]['to']){_0x28b087=_0x25c14b[_0x9915('0x63')]['to'][_0x9915('0xaa')](',')[0x0];}return db['MailAccount'][_0x9915('0x62')]({'where':{'id':_0x25c14b[_0x9915('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x9915('0xab'),'include':[{'model':db[_0x9915('0x95')],'as':'Contacts','where':{'email':_0x28b087},'limit':0x1,'order':[[_0x9915('0xac'),_0x9915('0xad')]]}]},{'model':db[_0x9915('0x44')],'as':_0x9915('0x45'),'raw':!![]}]})['then'](handleEntityNotFound(_0x146ee4,null))[_0x9915('0x24')](function(_0x3ec659){if(_0x3ec659){_0x2405ca=_0x3ec659;if(_0x3ec659[_0x9915('0x45')]){if(_['isNil'](_0x25c14b[_0x9915('0x63')][_0x9915('0xae')])){_0x25c14b[_0x9915('0x63')][_0x9915('0xae')]=util[_0x9915('0xa6')](_0x9915('0xaf'),_0x3ec659[_0x9915('0x41')],_0x3ec659['email']||_0x3ec659[_0x9915('0x45')]['user']);}if(_0x25c14b[_0x9915('0x63')][_0x9915('0xb0')]&&_0x25c14b[_0x9915('0x63')]['attachments'][_0x9915('0x54')]){for(var _0x4303fa=0x0;_0x4303fa<_0x25c14b['body'][_0x9915('0xb0')][_0x9915('0x54')];_0x4303fa+=0x1){_0x25c14b['body'][_0x9915('0xb0')][_0x4303fa]={'filename':_0x25c14b[_0x9915('0x63')]['attachments'][_0x4303fa][_0x9915('0x41')],'path':path['join'](config['root'],_0x9915('0xb1'),_0x25c14b[_0x9915('0x63')][_0x9915('0xb0')][_0x4303fa][_0x9915('0xb2')])};}}var _0x54becb={'tls':{'rejectUnauthorized':![]}};if(_[_0x9915('0x76')](_0x3ec659[_0x9915('0x45')][_0x9915('0x83')])){if(_0x3ec659['Smtp']['authentication']){_0x54becb['auth']={'user':_0x3ec659['Smtp'][_0x9915('0x7b')],'pass':_0x3ec659[_0x9915('0x45')]['pass']};}_0x54becb[_0x9915('0x81')]=_0x3ec659[_0x9915('0x45')][_0x9915('0x81')];_0x54becb[_0x9915('0x82')]=_0x3ec659[_0x9915('0x45')][_0x9915('0x82')];_0x54becb[_0x9915('0xb3')]=_0x3ec659['Smtp'][_0x9915('0xb3')];}else{_0x54becb[_0x9915('0x83')]=_0x3ec659[_0x9915('0x45')][_0x9915('0x83')];_0x54becb[_0x9915('0xb4')]={'user':_0x3ec659[_0x9915('0x45')][_0x9915('0x7b')],'pass':_0x3ec659[_0x9915('0x45')][_0x9915('0x7e')]};}return respondWithRpcPromise(_0x9915('0xb5'),_0x9915('0xb6'),{'account':_0x54becb,'message':_0x25c14b[_0x9915('0x63')]});}else{throw new Error(_0x9915('0xb7'));}}})[_0x9915('0x24')](function(_0x1fc1d3){if(_0x1fc1d3){_0x310dd2=_0x1fc1d3;if(_0x2405ca[_0x9915('0xab')]){if(_0x2405ca[_0x9915('0xab')][_0x9915('0xb8')][_0x9915('0x54')]){return _0x2405ca['List'][_0x9915('0xb8')][0x0];}else{return db['CmContact'][_0x9915('0x68')](_[_0x9915('0x1c')](_0x25c14b['body'],{'firstName':_0x25c14b[_0x9915('0x63')]['to'],'email':_0x25c14b[_0x9915('0x63')]['to'],'phone':_0x25c14b['body']['to'],'ListId':_0x2405ca['ListId']}));}}else{throw new Error(_0x9915('0xb7'));}}})[_0x9915('0x24')](function(_0x56dc33){if(_0x56dc33){var _0x1c381d={'UserId':_0x25c14b[_0x9915('0x7b')]['id'],'ContactId':_0x56dc33['id'],'MailAccountId':_0x2405ca['id'],'inReplyTo':_0x310dd2['messageId'],'to':_0x25c14b[_0x9915('0x63')][_0x9915('0xae')],'cc':_0x25c14b[_0x9915('0x63')]['cc'],'subject':_0x25c14b[_0x9915('0x63')]['subject'],'attach':_0x25c14b['body'][_0x9915('0xb9')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9915('0xa6')](_0x9915('0xa7')),'lastMsgDirection':'out','Messages':[_['merge'](_0x25c14b[_0x9915('0x63')],{'messageId':_0x310dd2[_0x9915('0xba')],'sentAt':moment()[_0x9915('0xa6')](_0x9915('0xa7')),'read':!![],'MailAccountId':_0x2405ca['id'],'UserId':_0x25c14b['user']['id'],'ContactId':_0x56dc33['id']})]};if(_0x25c14b['body']['Interaction']){_0x1c381d=_[_0x9915('0x5a')](_0x1c381d,_0x25c14b[_0x9915('0x63')][_0x9915('0xbb')]);}return db[_0x9915('0x94')][_0x9915('0x68')](_0x1c381d,{'include':[{'model':db[_0x9915('0xa4')],'as':'Messages'}]});}})['then'](respondWithResult(_0x146ee4,null))['catch'](handleError(_0x146ee4,null));};exports[_0x9915('0xbc')]=function(_0x3fcca0,_0x3a7e65,_0x180520){return db[_0x9915('0x48')]['find']({'where':{'id':_0x3fcca0[_0x9915('0x60')]['id']},'include':[{'model':db[_0x9915('0x44')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x3a7e65,null))[_0x9915('0x24')](function(_0x4ba11f){if(_0x4ba11f&&_0x4ba11f['Smtp']){var _0x5cd561={'id':_0x4ba11f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4ba11f[_0x9915('0x45')][_0x9915('0x83')]){_0x5cd561['service']=_0x4ba11f[_0x9915('0x45')][_0x9915('0x83')];}else{_0x5cd561[_0x9915('0x81')]=_0x4ba11f[_0x9915('0x45')][_0x9915('0x81')];_0x5cd561['port']=_0x4ba11f[_0x9915('0x45')][_0x9915('0x82')];_0x5cd561['secure']=_0x4ba11f[_0x9915('0x45')][_0x9915('0xb3')];}if(_0x4ba11f[_0x9915('0x45')]['authentication']){_0x5cd561['auth']={'user':_0x4ba11f[_0x9915('0x45')]['user'],'pass':_0x4ba11f[_0x9915('0x45')][_0x9915('0x7e')]};}return respondWithRpcPromise(_0x9915('0xbd'),_0x9915('0xbc'),{'account':_0x5cd561});}})['then'](respondWithResult(_0x3a7e65,null))[_0x9915('0x2f')](handleError(_0x3a7e65,null));};exports[_0x9915('0x3d')]=function(_0x383855,_0x21cae8){return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x383855['params']['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x21cae8,null))['then'](function(_0x244a72){if(_0x244a72&&_0x244a72[_0x9915('0x83')]){throw new db[(_0x9915('0xbe'))][(_0x9915('0xbf'))](_0x9915('0xc0'));}return _0x244a72;})[_0x9915('0x24')](removeEntity(_0x21cae8,null))['catch'](handleError(_0x21cae8,null));};exports[_0x9915('0xc1')]=function(_0x3fff01,_0x18dac1,_0x2bf161){return db['MailAccount']['find']({'where':{'id':_0x3fff01['params']['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x18dac1,null))[_0x9915('0x24')](function(_0x18626c){if(_0x18626c){return _0x18626c[_0x9915('0xc1')](_0x3fff01['body'][_0x9915('0x6e')],_['omit'](_0x3fff01[_0x9915('0x63')],[_0x9915('0x6e'),'id'])||{})[_0x9915('0xc2')](function(_0x294ee3){for(var _0x4b3cb2=0x0;_0x4b3cb2<_0x3fff01[_0x9915('0x63')]['ids'][_0x9915('0x54')];_0x4b3cb2+=0x1){socket[_0x9915('0xc3')](_0x9915('0xc4'),{'UserId':Number(_0x3fff01[_0x9915('0x63')][_0x9915('0x6e')][_0x4b3cb2]),'MailAccountId':Number(_0x3fff01[_0x9915('0x60')]['id'])});}return _0x294ee3;});}})[_0x9915('0x24')](respondWithResult(_0x18dac1,null))[_0x9915('0x2f')](handleError(_0x18dac1,null));};exports['removeAgents']=function(_0x86e42c,_0x1fc6d6,_0x1eaf33){return db[_0x9915('0x48')][_0x9915('0x62')]({'where':{'id':_0x86e42c[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x1fc6d6,null))[_0x9915('0x24')](function(_0x23e78b){if(_0x23e78b){return _0x23e78b[_0x9915('0xc5')](_0x86e42c[_0x9915('0x4e')][_0x9915('0x6e')])['then'](function(){if(_[_0x9915('0xc6')](_0x86e42c[_0x9915('0x4e')][_0x9915('0x6e')])){for(var _0x20b557=0x0;_0x20b557<_0x86e42c[_0x9915('0x4e')][_0x9915('0x6e')][_0x9915('0x54')];_0x20b557+=0x1){socket[_0x9915('0xc3')](_0x9915('0xc7'),{'UserId':Number(_0x86e42c[_0x9915('0x4e')][_0x9915('0x6e')][_0x20b557]),'MailAccountId':Number(_0x86e42c[_0x9915('0x60')]['id'])});}}else{socket[_0x9915('0xc3')](_0x9915('0xc7'),{'UserId':Number(_0x86e42c['query'][_0x9915('0x6e')]),'MailAccountId':Number(_0x86e42c[_0x9915('0x60')]['id'])});}});}})[_0x9915('0x24')](respondWithStatusCode(_0x1fc6d6,null))[_0x9915('0x2f')](handleError(_0x1fc6d6,null));};exports[_0x9915('0xc8')]=function(_0x242c22,_0x167a61,_0x538bbc){var _0x123019={};var _0x10a4cd={};var _0x444efb;var _0x7b6978;return db[_0x9915('0x48')][_0x9915('0x71')]({'where':{'id':_0x242c22[_0x9915('0x60')]['id']}})[_0x9915('0x24')](handleEntityNotFound(_0x167a61,null))['then'](function(_0x5c8eeb){if(_0x5c8eeb){_0x444efb=_0x5c8eeb;_0x10a4cd['model']=_[_0x9915('0x4f')](db[_0x9915('0xc9')][_0x9915('0x49')]);_0x10a4cd[_0x9915('0x4e')]=_[_0x9915('0x4f')](_0x242c22[_0x9915('0x4e')]);_0x10a4cd[_0x9915('0x50')]=_['intersection'](_0x10a4cd[_0x9915('0x4d')],_0x10a4cd[_0x9915('0x4e')]);_0x123019[_0x9915('0x52')]=_[_0x9915('0x51')](_0x10a4cd[_0x9915('0x4d')],qs[_0x9915('0x53')](_0x242c22[_0x9915('0x4e')][_0x9915('0x53')]));_0x123019[_0x9915('0x52')]=_0x123019['attributes']['length']?_0x123019[_0x9915('0x52')]:_0x10a4cd['model'];_0x123019[_0x9915('0x56')]=qs[_0x9915('0x6b')](_0x242c22[_0x9915('0x4e')][_0x9915('0x6b')]);_0x123019[_0x9915('0x57')]=qs[_0x9915('0x50')](_[_0x9915('0x58')](_0x242c22[_0x9915('0x4e')],_0x10a4cd[_0x9915('0x50')]));if(_0x242c22['query'][_0x9915('0x59')]){_0x123019['where']=_[_0x9915('0x5a')](_0x123019[_0x9915('0x57')],{'$or':_['map'](_0x123019['attributes'],function(_0x2f9fba){var _0x3416f9={};_0x3416f9[_0x2f9fba]={'$like':'%'+_0x242c22[_0x9915('0x4e')]['filter']+'%'};return _0x3416f9;})});}_0x123019=_[_0x9915('0x5a')]({},_0x123019,_0x242c22[_0x9915('0x5b')]);return _0x444efb[_0x9915('0xc8')](_0x123019);}})['then'](function(_0x28ace4){if(_0x28ace4){_0x7b6978=_0x28ace4[_0x9915('0x54')];if(!_0x242c22[_0x9915('0x4e')]['hasOwnProperty'](_0x9915('0x55'))){_0x123019[_0x9915('0x33')]=qs[_0x9915('0x33')](_0x242c22[_0x9915('0x4e')][_0x9915('0x33')]);_0x123019[_0x9915('0x35')]=qs[_0x9915('0x35')](_0x242c22['query']['offset']);}return _0x444efb[_0x9915('0xc8')](_0x123019);}})[_0x9915('0x24')](function(_0x1bbc5d){if(_0x1bbc5d){return _0x1bbc5d?{'count':_0x7b6978,'rows':_0x1bbc5d}:null;}})[_0x9915('0x24')](respondWithResult(_0x167a61,null))['catch'](handleError(_0x167a61,null));};
\ No newline at end of file
index 04465ba..58c300f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8277=['update','emit','hook','exports','../../mysqldb','MailAccount','save'];(function(_0x252cb3,_0x61bd0e){var _0x47668f=function(_0x4a0523){while(--_0x4a0523){_0x252cb3['push'](_0x252cb3['shift']());}};_0x47668f(++_0x61bd0e);}(_0x8277,0xcf));var _0x7827=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x8277[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x7827('0x0'))['db'][_0x7827('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7827('0x2'),'afterUpdate':_0x7827('0x3'),'afterDestroy':'remove'};function emitEvent(_0x141f27){return function(_0x202d8c,_0x56f066,_0x248be2){MailAccountEvents[_0x7827('0x4')](_0x141f27+':'+_0x202d8c['id'],_0x202d8c);MailAccountEvents[_0x7827('0x4')](_0x141f27,_0x202d8c);_0x248be2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x7827('0x5')](e,emitEvent(event));}}module[_0x7827('0x6')]=MailAccountEvents;
\ No newline at end of file
+var _0x7795=['../../mysqldb','save','update','emit','hook','exports'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x7795,0x1a4));var _0x5779=function(_0x4e3610,_0x433dea){_0x4e3610=_0x4e3610-0x0;var _0x21a024=_0x7795[_0x4e3610];return _0x21a024;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5779('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5779('0x1'),'afterUpdate':_0x5779('0x2'),'afterDestroy':'remove'};function emitEvent(_0x49b3df){return function(_0xd0fc2,_0x3a3905,_0x571cd2){MailAccountEvents[_0x5779('0x3')](_0x49b3df+':'+_0xd0fc2['id'],_0xd0fc2);MailAccountEvents['emit'](_0x49b3df,_0xd0fc2);_0x571cd2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x5779('0x4')](e,emitEvent(event));}}module[_0x5779('0x5')]=MailAccountEvents;
\ No newline at end of file
index 5268f14..df66c9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d3=['rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','../../config/logger','api','moment','request-promise','path'];(function(_0x3f6d50,_0x2b09ba){var _0x41c69f=function(_0x4450c5){while(--_0x4450c5){_0x3f6d50['push'](_0x3f6d50['shift']());}};_0x41c69f(++_0x2b09ba);}(_0xd2d3,0x16f));var _0x3d2d=function(_0x4bac2a,_0x16429a){_0x4bac2a=_0x4bac2a-0x0;var _0x3a3d95=_0xd2d3[_0x4bac2a];return _0x3a3d95;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3d2d('0x0'))(_0x3d2d('0x1'));var moment=require(_0x3d2d('0x2'));var BPromise=require('bluebird');var rp=require(_0x3d2d('0x3'));var fs=require('fs');var path=require(_0x3d2d('0x4'));var rimraf=require(_0x3d2d('0x5'));var config=require(_0x3d2d('0x6'));var attributes=require(_0x3d2d('0x7'));module[_0x3d2d('0x8')]=function(_0x42e054,_0x37d0b5){return _0x42e054[_0x3d2d('0x9')](_0x3d2d('0xa'),attributes,{'tableName':_0x3d2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2462=['bluebird','rimraf','../../config/environment','exports','define','MailAccount','lodash','moment'];(function(_0x4e0787,_0x7f4a21){var _0x4a9ce5=function(_0x1a0287){while(--_0x1a0287){_0x4e0787['push'](_0x4e0787['shift']());}};_0x4a9ce5(++_0x7f4a21);}(_0x2462,0x86));var _0x2246=function(_0x2f2a52,_0x5f0d9e){_0x2f2a52=_0x2f2a52-0x0;var _0x3b9ee6=_0x2462[_0x2f2a52];return _0x3b9ee6;};'use strict';var _=require(_0x2246('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2246('0x1'));var BPromise=require(_0x2246('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2246('0x3'));var config=require(_0x2246('0x4'));var attributes=require('./mailAccount.attributes');module[_0x2246('0x5')]=function(_0x518e2d,_0x212079){return _0x518e2d[_0x2246('0x6')](_0x2246('0x7'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dea6829..d747e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb798=['map','model','debug','ShowMailAccount','raw','NotifyMailAccount','body','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','MailApplication','Applications','Smtp','account','omit','List','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','contact','messageId','generate','subject','format','MailInteraction','find','MailMessage','Messages','create','spread','update','attach','get','interaction','created','attachments','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','include'];(function(_0x316e62,_0x323507){var _0x3afdd7=function(_0x4920aa){while(--_0x4920aa){_0x316e62['push'](_0x316e62['shift']());}};_0x3afdd7(++_0x323507);}(_0xb798,0x10d));var _0x8b79=function(_0x5cf344,_0x3584db){_0x5cf344=_0x5cf344-0x0;var _0x54e5b3=_0xb798[_0x5cf344];return _0x54e5b3;};'use strict';var _=require(_0x8b79('0x0'));var util=require(_0x8b79('0x1'));var moment=require(_0x8b79('0x2'));var BPromise=require(_0x8b79('0x3'));var rs=require(_0x8b79('0x4'));var fs=require('fs');var Redis=require(_0x8b79('0x5'));var db=require(_0x8b79('0x6'))['db'];var utils=require(_0x8b79('0x7'));var logger=require(_0x8b79('0x8'))(_0x8b79('0x9'));var config=require(_0x8b79('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8b79('0xb')][_0x8b79('0xc')]({'port':0x232c});config[_0x8b79('0xd')]=_[_0x8b79('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8b79('0xf'))(new Redis(config[_0x8b79('0xd')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0xac55e2,_0x18165a,_0x29d75e){return new BPromise(function(_0x124850,_0x2089f0){return client[_0x8b79('0x10')](_0xac55e2,_0x29d75e)[_0x8b79('0x11')](function(_0x501840){logger[_0x8b79('0x12')](_0x8b79('0x13'),_0x18165a,_0x8b79('0x14'));logger['debug'](_0x8b79('0x15'),_0x18165a,_0x8b79('0x14'),JSON[_0x8b79('0x16')](_0x501840));if(_0x501840['error']){if(_0x501840[_0x8b79('0x17')][_0x8b79('0x18')]===0x1f4){logger[_0x8b79('0x17')](_0x8b79('0x13'),_0x18165a,_0x501840[_0x8b79('0x17')][_0x8b79('0x19')]);return _0x2089f0(_0x501840['error'][_0x8b79('0x19')]);}logger[_0x8b79('0x17')](_0x8b79('0x13'),_0x18165a,_0x501840[_0x8b79('0x17')][_0x8b79('0x19')]);return _0x124850(_0x501840['error'][_0x8b79('0x19')]);}else{logger[_0x8b79('0x12')](_0x8b79('0x13'),_0x18165a,_0x8b79('0x14'));_0x124850(_0x501840['result']['message']);}})[_0x8b79('0x1a')](function(_0x49d854){logger[_0x8b79('0x17')](_0x8b79('0x13'),_0x18165a,_0x49d854);_0x2089f0(_0x49d854);});});}exports[_0x8b79('0x1b')]=function(_0x268ec8){var _0x81757f=this;return new Promise(function(_0x229768,_0x57a83b){return db[_0x8b79('0x1c')][_0x8b79('0x1d')]({'raw':_0x268ec8['options']?_0x268ec8[_0x8b79('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x268ec8[_0x8b79('0x1e')]?_0x268ec8['options'][_0x8b79('0x1f')]||null:null,'attributes':_0x268ec8[_0x8b79('0x1e')]?_0x268ec8[_0x8b79('0x1e')][_0x8b79('0x20')]||null:null,'limit':_0x268ec8[_0x8b79('0x1e')]?_0x268ec8[_0x8b79('0x1e')]['limit']||null:null,'include':_0x268ec8['options']?_0x268ec8[_0x8b79('0x1e')][_0x8b79('0x21')]?_[_0x8b79('0x22')](_0x268ec8[_0x8b79('0x1e')][_0x8b79('0x21')],function(_0x2d6f01){return{'model':db[_0x2d6f01[_0x8b79('0x23')]],'as':_0x2d6f01['as'],'attributes':_0x2d6f01[_0x8b79('0x20')],'include':_0x2d6f01[_0x8b79('0x21')]?_[_0x8b79('0x22')](_0x2d6f01['include'],function(_0x373b2a){return{'model':db[_0x373b2a[_0x8b79('0x23')]],'as':_0x373b2a['as'],'attributes':_0x373b2a['attributes'],'include':_0x373b2a['include']?_[_0x8b79('0x22')](_0x373b2a[_0x8b79('0x21')],function(_0x25c15f){return{'model':db[_0x25c15f['model']],'as':_0x25c15f['as'],'attributes':_0x25c15f[_0x8b79('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8b79('0x11')](function(_0xc6efe1){logger[_0x8b79('0x12')](_0x8b79('0x1b'),_0x268ec8);logger[_0x8b79('0x24')](_0x8b79('0x1b'),_0x268ec8,JSON[_0x8b79('0x16')](_0xc6efe1));_0x229768(_0xc6efe1);})[_0x8b79('0x1a')](function(_0x5d4fbb){logger[_0x8b79('0x17')](_0x8b79('0x1b'),_0x5d4fbb[_0x8b79('0x19')],_0x268ec8);_0x57a83b(_0x81757f['error'](0x1f4,_0x5d4fbb[_0x8b79('0x19')]));});});};exports[_0x8b79('0x25')]=function(_0x169a62){var _0x2995cb=this;return new Promise(function(_0x3bdd3e,_0x1efd44){return db['MailAccount']['find']({'raw':_0x169a62[_0x8b79('0x1e')]?_0x169a62['options'][_0x8b79('0x26')]===undefined?!![]:![]:!![],'where':_0x169a62['options']?_0x169a62['options'][_0x8b79('0x1f')]||null:null,'attributes':_0x169a62[_0x8b79('0x1e')]?_0x169a62[_0x8b79('0x1e')][_0x8b79('0x20')]||null:null,'include':_0x169a62[_0x8b79('0x1e')]?_0x169a62[_0x8b79('0x1e')][_0x8b79('0x21')]?_[_0x8b79('0x22')](_0x169a62[_0x8b79('0x1e')]['include'],function(_0x45fef7){return{'model':db[_0x45fef7['model']],'as':_0x45fef7['as'],'attributes':_0x45fef7['attributes'],'include':_0x45fef7[_0x8b79('0x21')]?_[_0x8b79('0x22')](_0x45fef7[_0x8b79('0x21')],function(_0x2631a1){return{'model':db[_0x2631a1['model']],'as':_0x2631a1['as'],'attributes':_0x2631a1[_0x8b79('0x20')],'include':_0x2631a1['include']?_[_0x8b79('0x22')](_0x2631a1[_0x8b79('0x21')],function(_0x4c6c50){return{'model':db[_0x4c6c50[_0x8b79('0x23')]],'as':_0x4c6c50['as'],'attributes':_0x4c6c50[_0x8b79('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4404e3){logger[_0x8b79('0x12')]('ShowMailAccount',_0x169a62);logger['debug'](_0x8b79('0x25'),_0x169a62,JSON[_0x8b79('0x16')](_0x4404e3));_0x3bdd3e(_0x4404e3);})[_0x8b79('0x1a')](function(_0x4ec79d){logger[_0x8b79('0x17')](_0x8b79('0x25'),_0x4ec79d[_0x8b79('0x19')],_0x169a62);_0x1efd44(_0x2995cb['error'](0x1f4,_0x4ec79d[_0x8b79('0x19')]));});});};exports[_0x8b79('0x27')]=function(_0x53a67e){var _0x323594=this;return new Promise(function(_0x5cac5a,_0x4f95bd){var _0x16abd5={'body':_0x53a67e[_0x8b79('0x28')],'channel':'mail'};var _0x9da1c4=_['difference'](_[_0x8b79('0x29')](db[_0x8b79('0x2a')][_0x8b79('0x2b')]),[_0x8b79('0x2c'),_0x8b79('0x2d'),_0x8b79('0x2e'),_0x8b79('0x2f')]);var _0x3dd71f=![];if(_0x53a67e['body']['id']){delete _0x53a67e[_0x8b79('0x28')]['id'];}if(_['isNil'](_0x53a67e[_0x8b79('0x28')][_0x8b79('0x30')])){return _0x4f95bd(_0x323594[_0x8b79('0x17')](0x1f4,_0x8b79('0x31')));}if(_[_0x8b79('0x32')](_0x53a67e[_0x8b79('0x28')][_0x8b79('0x28')])||_0x53a67e[_0x8b79('0x28')]['body']===''){return _0x4f95bd(_0x323594[_0x8b79('0x17')](0x1f4,_0x8b79('0x33')));}if(_[_0x8b79('0x32')](_0x53a67e[_0x8b79('0x28')]['mapKey'])){return _0x4f95bd(_0x323594[_0x8b79('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9da1c4));}if(!_[_0x8b79('0x34')](_0x9da1c4,_0x53a67e['body'][_0x8b79('0x35')])){return _0x4f95bd(_0x323594[_0x8b79('0x17')](0x1f4,_0x8b79('0x36')+_0x9da1c4));}var _0xd33fba={};_0xd33fba[_0x53a67e['body']['mapKey']]=_0x53a67e['body'][_0x8b79('0x30')];return db['MailAccount']['find']({'where':{'id':_0x53a67e['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8b79('0x2a')],'as':_0x8b79('0x37'),'where':_0xd33fba,'limit':0x1,'order':[[_0x8b79('0x2d'),_0x8b79('0x38')]]}]},{'model':db[_0x8b79('0x39')],'as':_0x8b79('0x3a')},{'model':db['MailServerOut'],'as':_0x8b79('0x3b')}]})['then'](function(_0x40d93c){if(_0x40d93c&&_0x40d93c['List']){var _0x496d88=_0x40d93c['get']({'plain':!![]});_0x16abd5[_0x8b79('0x3c')]=_[_0x8b79('0x3d')](_0x496d88,['Applications',_0x8b79('0x3e')]);_0x16abd5[_0x8b79('0x3f')]=_0x496d88[_0x8b79('0x3a')];_0x16abd5[_0x8b79('0x40')]=_0x496d88['List'];_0x16abd5[_0x8b79('0x3f')]=_[_0x8b79('0x41')](_0x16abd5['applications'],[_0x8b79('0x42')],[_0x8b79('0x43')]);if(_0x16abd5[_0x8b79('0x3c')]&&_0x16abd5[_0x8b79('0x3c')][_0x8b79('0x44')]){_0x16abd5['applications'][_0x8b79('0x45')]({'id':0x0,'priority':_0x16abd5[_0x8b79('0x3f')][_0x8b79('0x46')]+0x1,'app':_0x8b79('0x47'),'appdata':_0x8b79('0x44'),'interval':_0x8b79('0x48')});}if(_0x16abd5[_0x8b79('0x3c')]['Applications']){delete _0x16abd5[_0x8b79('0x3c')][_0x8b79('0x3a')];}if(_0x16abd5['account'][_0x8b79('0x3e')]){delete _0x16abd5['account'][_0x8b79('0x3e')];}if(_0x496d88['List']['Contacts']['length']){return _0x496d88[_0x8b79('0x3e')]['Contacts'][0x0];}var _0x4ce2f9=_[_0x8b79('0xe')](_0x53a67e[_0x8b79('0x28')],{'firstName':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x30')],'ListId':_0x496d88[_0x8b79('0x2f')]});_0x4ce2f9[_0x53a67e['body'][_0x8b79('0x35')]]=_0x53a67e[_0x8b79('0x28')][_0x8b79('0x30')];return db[_0x8b79('0x2a')]['create'](_0x4ce2f9);}else{throw new Error('List\x20not\x20found');}})[_0x8b79('0x11')](function(_0x49397e){_0x16abd5[_0x8b79('0x49')]=_0x49397e;if(_0x49397e){if(!_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['messageId']){_0x53a67e[_0x8b79('0x28')]['message'][_0x8b79('0x4a')]=rs[_0x8b79('0x4b')]()+'\x20'+_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['from'];}var _0x39297f={'ContactId':_0x49397e['id'],'MailAccountId':_0x53a67e[_0x8b79('0x3c')]['id'],'inReplyTo':_0x53a67e[_0x8b79('0x28')]['message']['messageId'],'to':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x30')],'cc':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['cc'],'subject':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x4c')],'attach':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['attach'],'lastMsgAt':moment()[_0x8b79('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x8b79('0x4e')][_0x8b79('0x4f')]({'where':{'closed':![],'MailAccountId':_0x53a67e['account']['id']},'include':[{'model':db[_0x8b79('0x50')],'as':_0x8b79('0x51'),'attributes':[_0x8b79('0x4a')],'where':{'messageId':_0x53a67e['body'][_0x8b79('0x19')]['inReplyTo']}}]})[_0x8b79('0x11')](function(_0x485875){if(_0x485875){return[_0x485875,![]];}return db['MailInteraction'][_0x8b79('0x52')](_0x39297f)['then'](function(_0x5d9015){return[_0x5d9015,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8b79('0x53')](function(_0x3d4d02,_0x18aef8){if(_0x3d4d02){_0x3dd71f=_0x18aef8;if(!_0x18aef8){return _0x3d4d02[_0x8b79('0x54')]({'inReplyTo':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['messageId'],'to':_0x53a67e[_0x8b79('0x28')]['message']['from'],'cc':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['cc'],'subject':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x4c')],'attach':_0x3d4d02[_0x8b79('0x55')]?_0x3d4d02[_0x8b79('0x55')]:_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x55')],'substatus':null,'substatusAt':moment()[_0x8b79('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x8b79('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3d4d02;}}})[_0x8b79('0x11')](function(_0x41ec98){_0x16abd5['interaction']=_0x41ec98[_0x8b79('0x56')]({'plain':!![]});_0x16abd5[_0x8b79('0x57')][_0x8b79('0x58')]=_0x3dd71f;return db[_0x8b79('0x50')][_0x8b79('0x52')]({'body':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x28')],'MailAccountId':_0x53a67e[_0x8b79('0x3c')]['id'],'MailInteractionId':_0x41ec98['id'],'direction':'in','ContactId':_0x16abd5[_0x8b79('0x49')]['id'],'messageId':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x4a')],'from':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['from'],'to':_0x53a67e['body'][_0x8b79('0x19')]['to'],'cc':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['cc'],'subject':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x4c')],'attach':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x55')],'Attachments':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x59')],'originTo':_0x53a67e[_0x8b79('0x28')]['message']['originTo'],'originCc':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')]['originCc'],'bcc':_0x53a67e['body'][_0x8b79('0x19')]['bcc'],'ChatWebsiteId':_0x53a67e[_0x8b79('0x28')]['message'][_0x8b79('0x5a')]||null,'originChannel':_0x53a67e[_0x8b79('0x28')][_0x8b79('0x19')][_0x8b79('0x5b')]||_0x8b79('0x5c'),'ChatOfflineMessageId':_0x53a67e['body'][_0x8b79('0x19')][_0x8b79('0x5d')]||null},{'include':[{'model':db['Attachment'],'as':_0x8b79('0x5e')}]});})[_0x8b79('0x11')](function(_0x59f0f4){_0x16abd5[_0x8b79('0x19')]=_0x59f0f4;if(_0x16abd5[_0x8b79('0x57')]['UserId']){return db[_0x8b79('0x5f')]['find']({'attributes':['id',_0x8b79('0x60')],'where':{'id':_0x16abd5[_0x8b79('0x57')]['UserId']}})[_0x8b79('0x11')](function(_0x4d27fe){if(_0x4d27fe){_0x16abd5[_0x8b79('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8b79('0x61'),'appdata':_0x4d27fe[_0x8b79('0x60')]+','+(_0x16abd5[_0x8b79('0x3c')][_0x8b79('0x62')]||0xa),'interval':_0x8b79('0x48')});}return respondWithRpcPromise(_0x8b79('0x63'),'startRouting',_0x16abd5);});}return respondWithRpcPromise('Start',_0x8b79('0x64'),_0x16abd5);})[_0x8b79('0x11')](function(_0x3553b2){_0x5cac5a(_0x3553b2);})['catch'](function(_0xec0bf7){_0x4f95bd(_0x323594[_0x8b79('0x17')](0x1f4,_0xec0bf7[_0x8b79('0x19')]));});});};
\ No newline at end of file
+var _0xd6c0=['find','then','NotifyMailAccount','body','difference','CmContact','rawAttributes','createdAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','get','omit','Applications','applications','list','orderBy','priority','asc','length','close','*,*,*,*','create','contact','messageId','generate','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','name','UserId','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','register','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','stringify','catch','ShowMailAccount'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xd6c0,0x1d4));var _0x0d6c=function(_0x34ad0a,_0x49f4e){_0x34ad0a=_0x34ad0a-0x0;var _0xd2c2b=_0xd6c0[_0x34ad0a];return _0xd2c2b;};'use strict';var _=require(_0x0d6c('0x0'));var util=require(_0x0d6c('0x1'));var moment=require(_0x0d6c('0x2'));var BPromise=require(_0x0d6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d6c('0x4'));var db=require(_0x0d6c('0x5'))['db'];var utils=require(_0x0d6c('0x6'));var logger=require(_0x0d6c('0x7'))(_0x0d6c('0x8'));var config=require('../../config/environment');var jayson=require(_0x0d6c('0x9'));var client=jayson['client']['http']({'port':0x232c});config[_0x0d6c('0xa')]=_[_0x0d6c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d6c('0xc'))(new Redis(config[_0x0d6c('0xa')]));require('./mailAccount.socket')[_0x0d6c('0xd')](socket);function respondWithRpcPromise(_0x913fb0,_0x7b315b,_0x2ac929){return new BPromise(function(_0x3fc951,_0x2fead3){return client[_0x0d6c('0xe')](_0x913fb0,_0x2ac929)['then'](function(_0xdc1a37){logger[_0x0d6c('0xf')]('MailAccount,\x20%s,\x20%s',_0x7b315b,_0x0d6c('0x10'));logger[_0x0d6c('0x11')](_0x0d6c('0x12'),_0x7b315b,_0x0d6c('0x10'),JSON['stringify'](_0xdc1a37));if(_0xdc1a37[_0x0d6c('0x13')]){if(_0xdc1a37[_0x0d6c('0x13')][_0x0d6c('0x14')]===0x1f4){logger[_0x0d6c('0x13')](_0x0d6c('0x15'),_0x7b315b,_0xdc1a37[_0x0d6c('0x13')][_0x0d6c('0x16')]);return _0x2fead3(_0xdc1a37['error'][_0x0d6c('0x16')]);}logger[_0x0d6c('0x13')](_0x0d6c('0x15'),_0x7b315b,_0xdc1a37[_0x0d6c('0x13')]['message']);return _0x3fc951(_0xdc1a37[_0x0d6c('0x13')][_0x0d6c('0x16')]);}else{logger[_0x0d6c('0xf')]('MailAccount,\x20%s,\x20%s',_0x7b315b,'request\x20sent');_0x3fc951(_0xdc1a37[_0x0d6c('0x17')][_0x0d6c('0x16')]);}})['catch'](function(_0x1a0817){logger[_0x0d6c('0x13')](_0x0d6c('0x15'),_0x7b315b,_0x1a0817);_0x2fead3(_0x1a0817);});});}exports[_0x0d6c('0x18')]=function(_0x26e432){var _0x5aaffe=this;return new Promise(function(_0x59cbdb,_0x3ae4ed){return db[_0x0d6c('0x19')][_0x0d6c('0x1a')]({'raw':_0x26e432[_0x0d6c('0x1b')]?_0x26e432['options'][_0x0d6c('0x1c')]===undefined?!![]:![]:!![],'where':_0x26e432['options']?_0x26e432[_0x0d6c('0x1b')][_0x0d6c('0x1d')]||null:null,'attributes':_0x26e432['options']?_0x26e432[_0x0d6c('0x1b')][_0x0d6c('0x1e')]||null:null,'limit':_0x26e432[_0x0d6c('0x1b')]?_0x26e432[_0x0d6c('0x1b')]['limit']||null:null,'include':_0x26e432[_0x0d6c('0x1b')]?_0x26e432[_0x0d6c('0x1b')][_0x0d6c('0x1f')]?_[_0x0d6c('0x20')](_0x26e432[_0x0d6c('0x1b')][_0x0d6c('0x1f')],function(_0x7a1968){return{'model':db[_0x7a1968[_0x0d6c('0x21')]],'as':_0x7a1968['as'],'attributes':_0x7a1968['attributes'],'include':_0x7a1968[_0x0d6c('0x1f')]?_[_0x0d6c('0x20')](_0x7a1968[_0x0d6c('0x1f')],function(_0x7bea13){return{'model':db[_0x7bea13[_0x0d6c('0x21')]],'as':_0x7bea13['as'],'attributes':_0x7bea13[_0x0d6c('0x1e')],'include':_0x7bea13['include']?_[_0x0d6c('0x20')](_0x7bea13[_0x0d6c('0x1f')],function(_0x5b8f97){return{'model':db[_0x5b8f97[_0x0d6c('0x21')]],'as':_0x5b8f97['as'],'attributes':_0x5b8f97[_0x0d6c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a3f8f){logger[_0x0d6c('0xf')]('GetMailAccount',_0x26e432);logger[_0x0d6c('0x11')](_0x0d6c('0x18'),_0x26e432,JSON[_0x0d6c('0x22')](_0x3a3f8f));_0x59cbdb(_0x3a3f8f);})[_0x0d6c('0x23')](function(_0x291f0d){logger[_0x0d6c('0x13')]('GetMailAccount',_0x291f0d['message'],_0x26e432);_0x3ae4ed(_0x5aaffe['error'](0x1f4,_0x291f0d[_0x0d6c('0x16')]));});});};exports[_0x0d6c('0x24')]=function(_0x3fff05){var _0x2f1ce5=this;return new Promise(function(_0x137ef0,_0x3f5e7f){return db['MailAccount'][_0x0d6c('0x25')]({'raw':_0x3fff05['options']?_0x3fff05[_0x0d6c('0x1b')][_0x0d6c('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fff05[_0x0d6c('0x1b')]?_0x3fff05[_0x0d6c('0x1b')][_0x0d6c('0x1d')]||null:null,'attributes':_0x3fff05['options']?_0x3fff05[_0x0d6c('0x1b')][_0x0d6c('0x1e')]||null:null,'include':_0x3fff05['options']?_0x3fff05[_0x0d6c('0x1b')]['include']?_['map'](_0x3fff05[_0x0d6c('0x1b')][_0x0d6c('0x1f')],function(_0x1ad875){return{'model':db[_0x1ad875[_0x0d6c('0x21')]],'as':_0x1ad875['as'],'attributes':_0x1ad875[_0x0d6c('0x1e')],'include':_0x1ad875['include']?_[_0x0d6c('0x20')](_0x1ad875[_0x0d6c('0x1f')],function(_0x127c03){return{'model':db[_0x127c03[_0x0d6c('0x21')]],'as':_0x127c03['as'],'attributes':_0x127c03[_0x0d6c('0x1e')],'include':_0x127c03[_0x0d6c('0x1f')]?_[_0x0d6c('0x20')](_0x127c03[_0x0d6c('0x1f')],function(_0x5f3d7a){return{'model':db[_0x5f3d7a[_0x0d6c('0x21')]],'as':_0x5f3d7a['as'],'attributes':_0x5f3d7a[_0x0d6c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d6c('0x26')](function(_0x21a2db){logger[_0x0d6c('0xf')](_0x0d6c('0x24'),_0x3fff05);logger[_0x0d6c('0x11')](_0x0d6c('0x24'),_0x3fff05,JSON[_0x0d6c('0x22')](_0x21a2db));_0x137ef0(_0x21a2db);})[_0x0d6c('0x23')](function(_0x19a66b){logger[_0x0d6c('0x13')](_0x0d6c('0x24'),_0x19a66b['message'],_0x3fff05);_0x3f5e7f(_0x2f1ce5['error'](0x1f4,_0x19a66b[_0x0d6c('0x16')]));});});};exports[_0x0d6c('0x27')]=function(_0x45af32){var _0x5593ee=this;return new Promise(function(_0x347a4b,_0x529de3){var _0x3d5c30={'body':_0x45af32[_0x0d6c('0x28')],'channel':'mail'};var _0x386dcb=_[_0x0d6c('0x29')](_['keys'](db[_0x0d6c('0x2a')][_0x0d6c('0x2b')]),[_0x0d6c('0x2c'),'updatedAt',_0x0d6c('0x2d'),_0x0d6c('0x2e')]);var _0x12b082=![];if(_0x45af32['body']['id']){delete _0x45af32['body']['id'];}if(_['isNil'](_0x45af32['body'][_0x0d6c('0x2f')])){return _0x529de3(_0x5593ee[_0x0d6c('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x28')])||_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x28')]===''){return _0x529de3(_0x5593ee[_0x0d6c('0x13')](0x1f4,_0x0d6c('0x30')));}if(_[_0x0d6c('0x31')](_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x32')])){return _0x529de3(_0x5593ee[_0x0d6c('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x386dcb));}if(!_[_0x0d6c('0x33')](_0x386dcb,_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x32')])){return _0x529de3(_0x5593ee[_0x0d6c('0x13')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x386dcb));}var _0x21adf4={};_0x21adf4[_0x45af32['body'][_0x0d6c('0x32')]]=_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x2f')];return db[_0x0d6c('0x19')][_0x0d6c('0x25')]({'where':{'id':_0x45af32[_0x0d6c('0x34')]['id']},'include':[{'model':db[_0x0d6c('0x35')],'as':_0x0d6c('0x36'),'include':[{'model':db[_0x0d6c('0x2a')],'as':_0x0d6c('0x37'),'where':_0x21adf4,'limit':0x1,'order':[['updatedAt',_0x0d6c('0x38')]]}]},{'model':db[_0x0d6c('0x39')],'as':'Applications'},{'model':db[_0x0d6c('0x3a')],'as':_0x0d6c('0x3b')}]})[_0x0d6c('0x26')](function(_0x4e6a99){if(_0x4e6a99&&_0x4e6a99[_0x0d6c('0x36')]){var _0x27a589=_0x4e6a99[_0x0d6c('0x3c')]({'plain':!![]});_0x3d5c30[_0x0d6c('0x34')]=_[_0x0d6c('0x3d')](_0x27a589,[_0x0d6c('0x3e'),_0x0d6c('0x36')]);_0x3d5c30[_0x0d6c('0x3f')]=_0x27a589[_0x0d6c('0x3e')];_0x3d5c30[_0x0d6c('0x40')]=_0x27a589['List'];_0x3d5c30[_0x0d6c('0x3f')]=_[_0x0d6c('0x41')](_0x3d5c30[_0x0d6c('0x3f')],[_0x0d6c('0x42')],[_0x0d6c('0x43')]);if(_0x3d5c30[_0x0d6c('0x34')]&&_0x3d5c30[_0x0d6c('0x34')]['autoclose']){_0x3d5c30[_0x0d6c('0x3f')]['push']({'id':0x0,'priority':_0x3d5c30['applications'][_0x0d6c('0x44')]+0x1,'app':_0x0d6c('0x45'),'appdata':'autoclose','interval':_0x0d6c('0x46')});}if(_0x3d5c30['account'][_0x0d6c('0x3e')]){delete _0x3d5c30[_0x0d6c('0x34')][_0x0d6c('0x3e')];}if(_0x3d5c30[_0x0d6c('0x34')][_0x0d6c('0x36')]){delete _0x3d5c30['account'][_0x0d6c('0x36')];}if(_0x27a589[_0x0d6c('0x36')][_0x0d6c('0x37')][_0x0d6c('0x44')]){return _0x27a589['List'][_0x0d6c('0x37')][0x0];}var _0xd2bbc3=_[_0x0d6c('0xb')](_0x45af32['body'],{'firstName':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x2f')],'ListId':_0x27a589[_0x0d6c('0x2e')]});_0xd2bbc3[_0x45af32[_0x0d6c('0x28')]['mapKey']]=_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x2f')];return db['CmContact'][_0x0d6c('0x47')](_0xd2bbc3);}else{throw new Error('List\x20not\x20found');}})[_0x0d6c('0x26')](function(_0x1643a6){_0x3d5c30[_0x0d6c('0x48')]=_0x1643a6;if(_0x1643a6){if(!_0x45af32[_0x0d6c('0x28')]['message'][_0x0d6c('0x49')]){_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x49')]=rs[_0x0d6c('0x4a')]()+'\x20'+_0x45af32['body']['message']['from'];}var _0x2707fc={'ContactId':_0x1643a6['id'],'MailAccountId':_0x45af32['account']['id'],'inReplyTo':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')]['messageId'],'to':_0x45af32['body'][_0x0d6c('0x16')][_0x0d6c('0x2f')],'cc':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')]['cc'],'subject':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')]['subject'],'attach':_0x45af32[_0x0d6c('0x28')]['message'][_0x0d6c('0x4b')],'lastMsgAt':moment()[_0x0d6c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x0d6c('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x45af32[_0x0d6c('0x34')]['id']},'include':[{'model':db[_0x0d6c('0x4e')],'as':_0x0d6c('0x4f'),'attributes':[_0x0d6c('0x49')],'where':{'messageId':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x50')]}}]})[_0x0d6c('0x26')](function(_0x39b4e5){if(_0x39b4e5){return[_0x39b4e5,![]];}return db[_0x0d6c('0x4d')]['create'](_0x2707fc)[_0x0d6c('0x26')](function(_0x47f312){return[_0x47f312,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0d6c('0x51')](function(_0x3ff913,_0x2f9efa){if(_0x3ff913){_0x12b082=_0x2f9efa;if(!_0x2f9efa){return _0x3ff913[_0x0d6c('0x52')]({'inReplyTo':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x49')],'to':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x2f')],'cc':_0x45af32[_0x0d6c('0x28')]['message']['cc'],'subject':_0x45af32['body'][_0x0d6c('0x16')][_0x0d6c('0x53')],'attach':_0x3ff913[_0x0d6c('0x4b')]?_0x3ff913[_0x0d6c('0x4b')]:_0x45af32['body']['message'][_0x0d6c('0x4b')],'substatus':null,'substatusAt':moment()[_0x0d6c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x0d6c('0x54')),'lastMsgDirection':'in'});}else{return _0x3ff913;}}})[_0x0d6c('0x26')](function(_0x25d183){_0x3d5c30[_0x0d6c('0x55')]=_0x25d183['get']({'plain':!![]});_0x3d5c30[_0x0d6c('0x55')][_0x0d6c('0x56')]=_0x12b082;return db[_0x0d6c('0x4e')][_0x0d6c('0x47')]({'body':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x28')],'MailAccountId':_0x45af32[_0x0d6c('0x34')]['id'],'MailInteractionId':_0x25d183['id'],'direction':'in','ContactId':_0x3d5c30[_0x0d6c('0x48')]['id'],'messageId':_0x45af32['body'][_0x0d6c('0x16')]['messageId'],'from':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x2f')],'to':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')]['to'],'cc':_0x45af32['body']['message']['cc'],'subject':_0x45af32['body'][_0x0d6c('0x16')]['subject'],'attach':_0x45af32['body']['message']['attach'],'Attachments':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x57')],'originTo':_0x45af32['body'][_0x0d6c('0x16')][_0x0d6c('0x58')],'originCc':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x59')],'bcc':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x5a')],'ChatWebsiteId':_0x45af32[_0x0d6c('0x28')][_0x0d6c('0x16')][_0x0d6c('0x5b')]||null,'originChannel':_0x45af32[_0x0d6c('0x28')]['message'][_0x0d6c('0x5c')]||_0x0d6c('0x5d'),'ChatOfflineMessageId':_0x45af32[_0x0d6c('0x28')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x0d6c('0x5e')],'as':'Attachments'}]});})[_0x0d6c('0x26')](function(_0xdab407){_0x3d5c30['message']=_0xdab407;if(_0x3d5c30[_0x0d6c('0x55')]['UserId']){return db['User'][_0x0d6c('0x25')]({'attributes':['id',_0x0d6c('0x5f')],'where':{'id':_0x3d5c30[_0x0d6c('0x55')][_0x0d6c('0x60')]}})[_0x0d6c('0x26')](function(_0x5367e9){if(_0x5367e9){_0x3d5c30['applications'][_0x0d6c('0x61')]({'id':0x0,'priority':0x0,'app':_0x0d6c('0x62'),'appdata':_0x5367e9[_0x0d6c('0x5f')]+','+(_0x3d5c30[_0x0d6c('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0x0d6c('0x46')});}return respondWithRpcPromise(_0x0d6c('0x63'),_0x0d6c('0x64'),_0x3d5c30);});}return respondWithRpcPromise(_0x0d6c('0x63'),_0x0d6c('0x64'),_0x3d5c30);})['then'](function(_0x50402e){_0x347a4b(_0x50402e);})[_0x0d6c('0x23')](function(_0x2fd971){_0x529de3(_0x5593ee['error'](0x1f4,_0x2fd971[_0x0d6c('0x16')]));});});};
\ No newline at end of file
index afd6f5c..7397538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5919=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','update'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x5919,0x15d));var _0x9591=function(_0x50798b,_0x22ccf8){_0x50798b=_0x50798b-0x0;var _0x4b1d26=_0x5919[_0x50798b];return _0x4b1d26;};'use strict';var MailAccountEvents=require(_0x9591('0x0'));var events=[_0x9591('0x1'),'remove',_0x9591('0x2')];function createListener(_0x12e84d,_0x5a7fa7){return function(_0x55b472){_0x5a7fa7[_0x9591('0x3')](_0x12e84d,_0x55b472);};}function removeListener(_0x77c97d,_0x1faf71){return function(){MailAccountEvents[_0x9591('0x4')](_0x77c97d,_0x1faf71);};}exports[_0x9591('0x5')]=function(_0x163a19){for(var _0x588d45=0x0,_0x347a03=events[_0x9591('0x6')];_0x588d45<_0x347a03;_0x588d45++){var _0x3d5677=events[_0x588d45];var _0x50ac28=createListener(_0x9591('0x7')+_0x3d5677,_0x163a19);MailAccountEvents['on'](_0x3d5677,_0x50ac28);}};
\ No newline at end of file
+var _0x88be=['save','remove','update','emit','removeListener','length','mailAccount:'];(function(_0x1b854f,_0x109222){var _0x57dd16=function(_0x2b79b8){while(--_0x2b79b8){_0x1b854f['push'](_0x1b854f['shift']());}};_0x57dd16(++_0x109222);}(_0x88be,0xcb));var _0xe88b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x88be[_0xb0f7c3];return _0x28ea68;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe88b('0x0'),_0xe88b('0x1'),_0xe88b('0x2')];function createListener(_0x16ed90,_0xf1f325){return function(_0x3bd96f){_0xf1f325[_0xe88b('0x3')](_0x16ed90,_0x3bd96f);};}function removeListener(_0x4acaad,_0x2b96bc){return function(){MailAccountEvents[_0xe88b('0x4')](_0x4acaad,_0x2b96bc);};}exports['register']=function(_0x172c97){for(var _0xadead7=0x0,_0x3c0570=events[_0xe88b('0x5')];_0xadead7<_0x3c0570;_0xadead7++){var _0x3ca74e=events[_0xadead7];var _0x238037=createListener(_0xe88b('0x6')+_0x3ca74e,_0x172c97);MailAccountEvents['on'](_0x3ca74e,_0x238037);}};
\ No newline at end of file
index febf4eb..79d12a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69db=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated'];(function(_0x4f8aac,_0x9c6bbc){var _0x1ad464=function(_0x522b0b){while(--_0x522b0b){_0x4f8aac['push'](_0x4f8aac['shift']());}};_0x1ad464(++_0x9c6bbc);}(_0x69db,0x148));var _0xb69d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x69db[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xb69d('0x0'));var util=require(_0xb69d('0x1'));var path=require(_0xb69d('0x2'));var timeout=require(_0xb69d('0x3'));var express=require(_0xb69d('0x4'));var router=express['Router']();var fs_extra=require(_0xb69d('0x5'));var auth=require(_0xb69d('0x6'));var interaction=require(_0xb69d('0x7'));var config=require(_0xb69d('0x8'));var controller=require(_0xb69d('0x9'));router[_0xb69d('0xa')]('/:id',auth[_0xb69d('0xb')](),controller['show']);router[_0xb69d('0xc')](_0xb69d('0xd'),auth['isAuthenticated'](),controller[_0xb69d('0xe')]);router['delete'](_0xb69d('0xd'),auth[_0xb69d('0xb')](),controller[_0xb69d('0xf')]);module[_0xb69d('0x10')]=router;
\ No newline at end of file
+var _0xccdc=['./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2460fc,_0x4ef77b){var _0x3cb385=function(_0x17018b){while(--_0x17018b){_0x2460fc['push'](_0x2460fc['shift']());}};_0x3cb385(++_0x4ef77b);}(_0xccdc,0x190));var _0xcccd=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xccdc[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcccd('0x0'));var timeout=require(_0xcccd('0x1'));var express=require('express');var router=express[_0xcccd('0x2')]();var fs_extra=require(_0xcccd('0x3'));var auth=require(_0xcccd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcccd('0x5'));var controller=require(_0xcccd('0x6'));router[_0xcccd('0x7')](_0xcccd('0x8'),auth[_0xcccd('0x9')](),controller[_0xcccd('0xa')]);router['put'](_0xcccd('0x8'),auth[_0xcccd('0x9')](),controller[_0xcccd('0xb')]);router[_0xcccd('0xc')](_0xcccd('0x8'),auth[_0xcccd('0x9')](),controller[_0xcccd('0xd')]);module['exports']=router;
\ No newline at end of file
index 45eb892..85208dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93c5=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1e4459,_0x1f20e5){var _0x2513ee=function(_0x302de1){while(--_0x302de1){_0x1e4459['push'](_0x1e4459['shift']());}};_0x2513ee(++_0x1f20e5);}(_0x93c5,0x19c));var _0x593c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x93c5[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x593c('0x0'));module[_0x593c('0x1')]={'priority':{'type':Sequelize[_0x593c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x593c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x593c('0x4')]()},'description':{'type':Sequelize[_0x593c('0x3')]},'interval':{'type':Sequelize[_0x593c('0x3')],'defaultValue':_0x593c('0x5')}};
\ No newline at end of file
+var _0xdcc4=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5e3b30,_0x1ea3eb){var _0x41f81f=function(_0x31f335){while(--_0x31f335){_0x5e3b30['push'](_0x5e3b30['shift']());}};_0x41f81f(++_0x1ea3eb);}(_0xdcc4,0x12e));var _0x4dcc=function(_0x3c4463,_0x397dd4){_0x3c4463=_0x3c4463-0x0;var _0x2d6f3c=_0xdcc4[_0x3c4463];return _0x2d6f3c;};'use strict';var Sequelize=require('sequelize');module[_0x4dcc('0x0')]={'priority':{'type':Sequelize[_0x4dcc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4dcc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4dcc('0x3')]()},'description':{'type':Sequelize[_0x4dcc('0x2')]},'interval':{'type':Sequelize[_0x4dcc('0x2')],'defaultValue':_0x4dcc('0x4')}};
\ No newline at end of file
index 99e9ed9..9a01787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x51327d,_0x415871){var _0x2a8a71=function(_0x1cc452){while(--_0x1cc452){_0x51327d['push'](_0x51327d['shift']());}};_0x2a8a71(++_0x415871);}(_0xac4a,0x13f));var _0xaac4=function(_0x31a714,_0x1957f3){_0x31a714=_0x31a714-0x0;var _0x146c29=_0xac4a[_0x31a714];return _0x146c29;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));};
\ No newline at end of file
+var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x478636,_0x27c881){var _0x1cb73d=function(_0x521706){while(--_0x521706){_0x478636['push'](_0x478636['shift']());}};_0x1cb73d(++_0x27c881);}(_0xb43b,0x1b2));var _0xbb43=function(_0x263a4c,_0x3e7e61){_0x263a4c=_0x263a4c-0x0;var _0x6afe6f=_0xb43b[_0x263a4c];return _0x6afe6f;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));};
\ No newline at end of file
index 7457b33..ed99960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x031c=['./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f5bdc,_0xddd7a6){var _0x18feea=function(_0x4de031){while(--_0x4de031){_0x2f5bdc['push'](_0x2f5bdc['shift']());}};_0x18feea(++_0xddd7a6);}(_0x031c,0x92));var _0xc031=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x031c[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc031('0x0'));var util=require('util');var logger=require(_0xc031('0x1'))(_0xc031('0x2'));var moment=require(_0xc031('0x3'));var BPromise=require(_0xc031('0x4'));var rp=require(_0xc031('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc031('0x6'));var config=require(_0xc031('0x7'));var attributes=require(_0xc031('0x8'));module[_0xc031('0x9')]=function(_0x832255,_0x415685){return _0x832255[_0xc031('0xa')]('MailApplication',attributes,{'tableName':_0xc031('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc031('0xc'),'collate':_0xc031('0xd')});};
\ No newline at end of file
+var _0x67c3=['util','../../config/logger','api','moment','bluebird','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci'];(function(_0x3fd70e,_0x48f3dc){var _0x976380=function(_0x1486b3){while(--_0x1486b3){_0x3fd70e['push'](_0x3fd70e['shift']());}};_0x976380(++_0x48f3dc);}(_0x67c3,0xc3));var _0x367c=function(_0x1b515f,_0x52aa6b){_0x1b515f=_0x1b515f-0x0;var _0x66ff73=_0x67c3[_0x1b515f];return _0x66ff73;};'use strict';var _=require('lodash');var util=require(_0x367c('0x0'));var logger=require(_0x367c('0x1'))(_0x367c('0x2'));var moment=require(_0x367c('0x3'));var BPromise=require(_0x367c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x367c('0x5'));var rimraf=require(_0x367c('0x6'));var config=require('../../config/environment');var attributes=require(_0x367c('0x7'));module[_0x367c('0x8')]=function(_0x2eb2de,_0x3d8ea1){return _0x2eb2de[_0x367c('0x9')](_0x367c('0xa'),attributes,{'tableName':_0x367c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x367c('0xc')});};
\ No newline at end of file
index 3926d46..9981148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe500=['client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','where','attributes','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x366655,_0x4d032){var _0x11e076=function(_0x3ce9b8){while(--_0x3ce9b8){_0x366655['push'](_0x366655['shift']());}};_0x11e076(++_0x4d032);}(_0xe500,0x1e5));var _0x0e50=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xe500[_0x575057];return _0x49dbc8;};'use strict';var _=require(_0x0e50('0x0'));var util=require(_0x0e50('0x1'));var moment=require(_0x0e50('0x2'));var BPromise=require(_0x0e50('0x3'));var rs=require(_0x0e50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e50('0x5'))['db'];var utils=require(_0x0e50('0x6'));var logger=require(_0x0e50('0x7'))(_0x0e50('0x8'));var config=require(_0x0e50('0x9'));var jayson=require(_0x0e50('0xa'));var client=jayson[_0x0e50('0xb')][_0x0e50('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x352fa6,_0x1aeac8,_0x1563dd){return new BPromise(function(_0x30a056,_0x41f2c6){return client['request'](_0x352fa6,_0x1563dd)[_0x0e50('0xd')](function(_0x59d780){logger[_0x0e50('0xe')](_0x0e50('0xf'),_0x1aeac8,_0x0e50('0x10'));logger[_0x0e50('0x11')](_0x0e50('0x12'),_0x1aeac8,_0x0e50('0x10'),JSON[_0x0e50('0x13')](_0x59d780));if(_0x59d780[_0x0e50('0x14')]){if(_0x59d780[_0x0e50('0x14')][_0x0e50('0x15')]===0x1f4){logger[_0x0e50('0x14')](_0x0e50('0xf'),_0x1aeac8,_0x59d780[_0x0e50('0x14')][_0x0e50('0x16')]);return _0x41f2c6(_0x59d780[_0x0e50('0x14')][_0x0e50('0x16')]);}logger[_0x0e50('0x14')](_0x0e50('0xf'),_0x1aeac8,_0x59d780[_0x0e50('0x14')]['message']);return _0x30a056(_0x59d780[_0x0e50('0x14')][_0x0e50('0x16')]);}else{logger[_0x0e50('0xe')](_0x0e50('0xf'),_0x1aeac8,'request\x20sent');_0x30a056(_0x59d780[_0x0e50('0x17')][_0x0e50('0x16')]);}})[_0x0e50('0x18')](function(_0x3bb96d){logger[_0x0e50('0x14')](_0x0e50('0xf'),_0x1aeac8,_0x3bb96d);_0x41f2c6(_0x3bb96d);});});}exports['UpdateMailApplication']=function(_0x1f750c){var _0x101789=this;return new Promise(function(_0x1ef1b2,_0x2887a7){return db['MailApplication']['update'](_0x1f750c[_0x0e50('0x19')],{'raw':_0x1f750c[_0x0e50('0x1a')]?_0x1f750c[_0x0e50('0x1a')][_0x0e50('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f750c[_0x0e50('0x1a')]?_0x1f750c[_0x0e50('0x1a')][_0x0e50('0x1c')]||null:null,'attributes':_0x1f750c[_0x0e50('0x1a')]?_0x1f750c[_0x0e50('0x1a')][_0x0e50('0x1d')]||null:null,'limit':_0x1f750c['options']?_0x1f750c[_0x0e50('0x1a')]['limit']||null:null})[_0x0e50('0xd')](function(_0x22caeb){logger[_0x0e50('0xe')]('UpdateMailApplication',_0x1f750c);logger[_0x0e50('0x11')](_0x0e50('0x1e'),_0x1f750c,JSON['stringify'](_0x22caeb));_0x1ef1b2(_0x22caeb);})['catch'](function(_0x523fa5){logger['error']('UpdateMailApplication',_0x523fa5[_0x0e50('0x16')],_0x1f750c);_0x2887a7(_0x101789[_0x0e50('0x14')](0x1f4,_0x523fa5[_0x0e50('0x16')]));});});};
\ No newline at end of file
+var _0xc9d6=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x12f451,_0xa3c32b){var _0x3ed9ef=function(_0x198c00){while(--_0x198c00){_0x12f451['push'](_0x12f451['shift']());}};_0x3ed9ef(++_0xa3c32b);}(_0xc9d6,0x1df));var _0x6c9d=function(_0x1ef365,_0x2bbade){_0x1ef365=_0x1ef365-0x0;var _0x5c750e=_0xc9d6[_0x1ef365];return _0x5c750e;};'use strict';var _=require('lodash');var util=require(_0x6c9d('0x0'));var moment=require('moment');var BPromise=require(_0x6c9d('0x1'));var rs=require(_0x6c9d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c9d('0x3'))['db'];var utils=require(_0x6c9d('0x4'));var logger=require(_0x6c9d('0x5'))(_0x6c9d('0x6'));var config=require(_0x6c9d('0x7'));var jayson=require(_0x6c9d('0x8'));var client=jayson['client'][_0x6c9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x402dc6,_0x33ef06,_0x27ec02){return new BPromise(function(_0x3d4902,_0x41d5fa){return client[_0x6c9d('0xa')](_0x402dc6,_0x27ec02)['then'](function(_0x1bdad1){logger[_0x6c9d('0xb')](_0x6c9d('0xc'),_0x33ef06,_0x6c9d('0xd'));logger[_0x6c9d('0xe')](_0x6c9d('0xf'),_0x33ef06,_0x6c9d('0xd'),JSON[_0x6c9d('0x10')](_0x1bdad1));if(_0x1bdad1[_0x6c9d('0x11')]){if(_0x1bdad1[_0x6c9d('0x11')][_0x6c9d('0x12')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x33ef06,_0x1bdad1[_0x6c9d('0x11')]['message']);return _0x41d5fa(_0x1bdad1[_0x6c9d('0x11')][_0x6c9d('0x13')]);}logger['error'](_0x6c9d('0xc'),_0x33ef06,_0x1bdad1[_0x6c9d('0x11')][_0x6c9d('0x13')]);return _0x3d4902(_0x1bdad1[_0x6c9d('0x11')]['message']);}else{logger[_0x6c9d('0xb')](_0x6c9d('0xc'),_0x33ef06,_0x6c9d('0xd'));_0x3d4902(_0x1bdad1[_0x6c9d('0x14')][_0x6c9d('0x13')]);}})[_0x6c9d('0x15')](function(_0x5e1b6a){logger[_0x6c9d('0x11')](_0x6c9d('0xc'),_0x33ef06,_0x5e1b6a);_0x41d5fa(_0x5e1b6a);});});}exports[_0x6c9d('0x16')]=function(_0x2c066f){var _0x9e579d=this;return new Promise(function(_0x4b5258,_0x50a252){return db[_0x6c9d('0x17')][_0x6c9d('0x18')](_0x2c066f['body'],{'raw':_0x2c066f[_0x6c9d('0x19')]?_0x2c066f['options'][_0x6c9d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c066f[_0x6c9d('0x19')]?_0x2c066f['options'][_0x6c9d('0x1b')]||null:null,'attributes':_0x2c066f[_0x6c9d('0x19')]?_0x2c066f['options'][_0x6c9d('0x1c')]||null:null,'limit':_0x2c066f[_0x6c9d('0x19')]?_0x2c066f['options']['limit']||null:null})['then'](function(_0x56949f){logger[_0x6c9d('0xb')](_0x6c9d('0x16'),_0x2c066f);logger[_0x6c9d('0xe')]('UpdateMailApplication',_0x2c066f,JSON[_0x6c9d('0x10')](_0x56949f));_0x4b5258(_0x56949f);})['catch'](function(_0x311d95){logger['error'](_0x6c9d('0x16'),_0x311d95[_0x6c9d('0x13')],_0x2c066f);_0x50a252(_0x9e579d[_0x6c9d('0x11')](0x1f4,_0x311d95[_0x6c9d('0x13')]));});});};
\ No newline at end of file
index 283b258..c67ab28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3af1=['index','/describe','/:id','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x11f977,_0x44a9f3){var _0x28b6f6=function(_0x36e532){while(--_0x36e532){_0x11f977['push'](_0x11f977['shift']());}};_0x28b6f6(++_0x44a9f3);}(_0x3af1,0x14b));var _0x13af=function(_0xf9b6ca,_0x3aa0b3){_0xf9b6ca=_0xf9b6ca-0x0;var _0x4f13d0=_0x3af1[_0xf9b6ca];return _0x4f13d0;};'use strict';var express=require('express');var router=express[_0x13af('0x0')]();var auth=require(_0x13af('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x13af('0x2'));router[_0x13af('0x3')]('/',auth[_0x13af('0x4')](),controller[_0x13af('0x5')]);router[_0x13af('0x3')](_0x13af('0x6'),auth[_0x13af('0x4')](),controller['describe']);router[_0x13af('0x3')](_0x13af('0x7'),auth[_0x13af('0x4')](),controller['show']);router['get'](_0x13af('0x8'),auth[_0x13af('0x4')](),controller['getMessages']);router[_0x13af('0x3')](_0x13af('0x9'),auth[_0x13af('0x4')](),controller[_0x13af('0xa')]);router[_0x13af('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x13af('0xb')](_0x13af('0x8'),auth[_0x13af('0x4')](),controller[_0x13af('0xc')]);router['post'](_0x13af('0xd'),auth[_0x13af('0x4')](),interaction[_0x13af('0xe')]('mail',_0x13af('0xf')),controller[_0x13af('0x10')]);router['put']('/:id',auth[_0x13af('0x4')](),interaction[_0x13af('0xe')](_0x13af('0x11'),_0x13af('0x12')),controller[_0x13af('0x13')]);router[_0x13af('0x14')](_0x13af('0x7'),auth[_0x13af('0x4')](),interaction['tracked'](_0x13af('0x11'),_0x13af('0x15')),controller[_0x13af('0x16')]);router[_0x13af('0x14')](_0x13af('0xd'),auth[_0x13af('0x4')](),controller[_0x13af('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xfd60=['mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','put','tracked','delete'];(function(_0x3cb15b,_0x597ce5){var _0x588527=function(_0x1cd794){while(--_0x1cd794){_0x3cb15b['push'](_0x3cb15b['shift']());}};_0x588527(++_0x597ce5);}(_0xfd60,0x189));var _0x0fd6=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xfd60[_0x39d544];return _0x5a5ff2;};'use strict';var express=require(_0x0fd6('0x0'));var router=express[_0x0fd6('0x1')]();var auth=require(_0x0fd6('0x2'));var interaction=require(_0x0fd6('0x3'));var controller=require(_0x0fd6('0x4'));router['get']('/',auth[_0x0fd6('0x5')](),controller[_0x0fd6('0x6')]);router[_0x0fd6('0x7')]('/describe',auth[_0x0fd6('0x5')](),controller['describe']);router['get'](_0x0fd6('0x8'),auth['isAuthenticated'](),controller[_0x0fd6('0x9')]);router[_0x0fd6('0x7')](_0x0fd6('0xa'),auth['isAuthenticated'](),controller[_0x0fd6('0xb')]);router['get'](_0x0fd6('0xc'),auth[_0x0fd6('0x5')](),controller[_0x0fd6('0xd')]);router[_0x0fd6('0xe')]('/',auth[_0x0fd6('0x5')](),controller[_0x0fd6('0xf')]);router[_0x0fd6('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0x0fd6('0x10')]);router[_0x0fd6('0xe')](_0x0fd6('0x11'),auth[_0x0fd6('0x5')](),interaction['tracked'](_0x0fd6('0x12'),_0x0fd6('0x13')),controller['addTags']);router[_0x0fd6('0x14')]('/:id',auth[_0x0fd6('0x5')](),interaction[_0x0fd6('0x15')](_0x0fd6('0x12'),'mailinteraction:update'),controller['update']);router[_0x0fd6('0x16')]('/:id',auth[_0x0fd6('0x5')](),interaction[_0x0fd6('0x15')](_0x0fd6('0x12'),_0x0fd6('0x17')),controller[_0x0fd6('0x18')]);router[_0x0fd6('0x16')]('/:id/tags',auth[_0x0fd6('0x5')](),controller[_0x0fd6('0x19')]);module['exports']=router;
\ No newline at end of file
index bc2f33f..4a1bb95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c8=['long','TEXT','DATE','out','sequelize','iconv','BOOLEAN','STRING'];(function(_0x45d384,_0x5c94a1){var _0x549d9a=function(_0x4d0ab1){while(--_0x4d0ab1){_0x45d384['push'](_0x45d384['shift']());}};_0x549d9a(++_0x5c94a1);}(_0x32c8,0x17c));var _0x832c=function(_0x1c7a1c,_0x2e1fde){_0x1c7a1c=_0x1c7a1c-0x0;var _0x49a614=_0x32c8[_0x1c7a1c];return _0x49a614;};'use strict';var Sequelize=require(_0x832c('0x0'));var iconv=require(_0x832c('0x1'));module['exports']={'closed':{'type':Sequelize[_0x832c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x832c('0x3')]},'secondDisposition':{'type':Sequelize[_0x832c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x832c('0x3')]},'note':{'type':Sequelize[_0x832c('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x832c('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x832c('0x4'))},'subject':{'type':Sequelize[_0x832c('0x5')]()},'attach':{'type':Sequelize[_0x832c('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x832c('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x832c('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x832c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x832c('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x832c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x832c('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5183=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv'];(function(_0x125f25,_0x2288bf){var _0x2a88d2=function(_0x518a40){while(--_0x518a40){_0x125f25['push'](_0x125f25['shift']());}};_0x2a88d2(++_0x2288bf);}(_0x5183,0x1a2));var _0x3518=function(_0x5447ee,_0x10dd0c){_0x5447ee=_0x5447ee-0x0;var _0x19af9=_0x5183[_0x5447ee];return _0x19af9;};'use strict';var Sequelize=require(_0x3518('0x0'));var iconv=require(_0x3518('0x1'));module[_0x3518('0x2')]={'closed':{'type':Sequelize[_0x3518('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3518('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3518('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3518('0x5')](0x1fe)},'to':{'type':Sequelize[_0x3518('0x5')]},'cc':{'type':Sequelize[_0x3518('0x6')](_0x3518('0x7'))},'subject':{'type':Sequelize[_0x3518('0x6')]()},'attach':{'type':Sequelize[_0x3518('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3518('0x4')]},'substatus':{'type':Sequelize[_0x3518('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3518('0x8')]('in',_0x3518('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3518('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3518('0x3')],'defaultValue':![]}};
\ No newline at end of file
index a93fc62..98a9ac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x35b7b3,_0x62c34e){_0x35b7b3=_0x35b7b3-0x0;var _0x5afb26=_0xb10b[_0x35b7b3];return _0x5afb26;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
+var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xb10b,0x12a));var _0xbb10=function(_0x16daee,_0xaf8850){_0x16daee=_0x16daee-0x0;var _0x436115=_0xb10b[_0x16daee];return _0x436115;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
index b2b18b6..812d271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04a7=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove'];(function(_0x8aa91a,_0x358eb3){var _0x39009c=function(_0x4076c9){while(--_0x4076c9){_0x8aa91a['push'](_0x8aa91a['shift']());}};_0x39009c(++_0x358eb3);}(_0x04a7,0xa3));var _0x704a=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0x04a7[_0x11309c];return _0x3fea9c;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x704a('0x0'))['db'][_0x704a('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x704a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x704a('0x3')](0x0);var events={'afterCreate':_0x704a('0x4'),'afterUpdate':_0x704a('0x5'),'afterDestroy':_0x704a('0x6')};function emitEvent(_0x3dfd49){return function(_0x255afe,_0x4b6edf,_0x1b103f){_0x255afe['getUsers']({'attributes':['id'],'raw':!![]})[_0x704a('0x7')](function(_0x1117d5){_0x255afe[_0x704a('0x8')](_0x704a('0x9'),_0x1117d5[_0x704a('0xa')](function(_0x4adb68){return{'id':_0x4adb68['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x255afe['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x647a88){_0x255afe[_0x704a('0x8')](_0x704a('0xb'),_0x647a88[_0x704a('0xc')]);MailInteractionEvents[_0x704a('0xd')](_0x3dfd49+':'+_0x255afe['id'],_0x255afe);MailInteractionEvents[_0x704a('0xd')](_0x3dfd49,_0x255afe);_0x1b103f(null);})[_0x704a('0xe')](_0x1b103f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x704a('0xf')](e,emitEvent(event));}}module[_0x704a('0x10')]=MailInteractionEvents;
\ No newline at end of file
+var _0x0fec=['getUsers','then','setDataValue','map','findAll','emit','hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0fec,0x174));var _0xc0fe=function(_0x4e3104,_0xab2502){_0x4e3104=_0x4e3104-0x0;var _0x3f7d20=_0x0fec[_0x4e3104];return _0x3f7d20;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xc0fe('0x0'))['db'][_0xc0fe('0x1')];var MailMessage=require(_0xc0fe('0x0'))['db'][_0xc0fe('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc0fe('0x3')](0x0);var events={'afterCreate':_0xc0fe('0x4'),'afterUpdate':_0xc0fe('0x5'),'afterDestroy':'remove'};function emitEvent(_0x580e60){return function(_0x1c52fc,_0x50583d,_0x5ae5e0){_0x1c52fc[_0xc0fe('0x6')]({'attributes':['id'],'raw':!![]})[_0xc0fe('0x7')](function(_0x5109c9){_0x1c52fc[_0xc0fe('0x8')]('Users',_0x5109c9[_0xc0fe('0x9')](function(_0xe7fae9){return{'id':_0xe7fae9['id']};}));return MailMessage[_0xc0fe('0xa')]({'where':{'MailInteractionId':_0x1c52fc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x145cc7){_0x1c52fc[_0xc0fe('0x8')]('unreadMessages',_0x145cc7['length']);MailInteractionEvents[_0xc0fe('0xb')](_0x580e60+':'+_0x1c52fc['id'],_0x1c52fc);MailInteractionEvents[_0xc0fe('0xb')](_0x580e60,_0x1c52fc);_0x5ae5e0(null);})['catch'](_0x5ae5e0(null));};}for(var e in events){if(events[_0xc0fe('0xc')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xc0fe('0xd')]=MailInteractionEvents;
\ No newline at end of file
index 006a65c..a289b0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4427=['rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path'];(function(_0x4b759d,_0x4bdbeb){var _0x474cdc=function(_0xf42d79){while(--_0xf42d79){_0x4b759d['push'](_0x4b759d['shift']());}};_0x474cdc(++_0x4bdbeb);}(_0x4427,0x190));var _0x7442=function(_0x2f169c,_0x130a86){_0x2f169c=_0x2f169c-0x0;var _0x39937f=_0x4427[_0x2f169c];return _0x39937f;};'use strict';var _=require('lodash');var util=require(_0x7442('0x0'));var logger=require(_0x7442('0x1'))(_0x7442('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7442('0x3'));var fs=require('fs');var path=require(_0x7442('0x4'));var rimraf=require(_0x7442('0x5'));var config=require(_0x7442('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x7442('0x7')]=function(_0x4a1189,_0x417e14){return _0x4a1189[_0x7442('0x8')](_0x7442('0x9'),attributes,{'tableName':_0x7442('0xa'),'paranoid':![],'indexes':[{'name':_0x7442('0xb'),'fields':[_0x7442('0xc'),'to'],'type':_0x7442('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17e88b,_0x2416b2,_0x262b0e){if(_0x17e88b[_0x7442('0xe')]){_0x17e88b[_0x7442('0xf')]=moment()['format'](_0x7442('0x10'));}if(_0x17e88b[_0x7442('0x11')]){_0x17e88b[_0x7442('0x12')]=moment()[_0x7442('0x13')](_0x7442('0x10'));}_0x262b0e(null,_0x2416b2);},'beforeUpdate':function(_0x263903,_0x1aff7e,_0x5039e3){if(_0x263903[_0x7442('0x14')](_0x7442('0xe'))){_0x263903[_0x7442('0xf')]=_0x263903[_0x7442('0xe')]?moment()[_0x7442('0x13')](_0x7442('0x10')):null;}if(_0x263903[_0x7442('0x14')](_0x7442('0x11'))){_0x263903[_0x7442('0x12')]=moment()['format'](_0x7442('0x10'));_0x263903['substatus']=null;_0x263903[_0x7442('0xf')]=null;}_0x5039e3(null,_0x263903);},'afterUpdate':function(_0x65afc0,_0x22660d,_0x1c8623){var _0x5c08de=_0x4a1189[_0x7442('0x15')];var _0x45a447=_0x65afc0[_0x7442('0x16')]({'plain':!![]});if(_0x45a447['closed']){return _0x5c08de['MailMessage'][_0x7442('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x45a447['id']}})[_0x7442('0x18')](function(){_0x1c8623();})[_0x7442('0x19')](function(_0x10cd12){_0x1c8623(_0x10cd12);});}else{_0x1c8623();}}},'charset':'utf8mb4','collate':_0x7442('0x1a')});};
\ No newline at end of file
+var _0x881a=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','subject','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','models','MailMessage','update','then','catch'];(function(_0x4cc0bc,_0x5679b5){var _0x2d45f4=function(_0x5398e7){while(--_0x5398e7){_0x4cc0bc['push'](_0x4cc0bc['shift']());}};_0x2d45f4(++_0x5679b5);}(_0x881a,0x120));var _0xa881=function(_0x42b8f5,_0x4b9730){_0x42b8f5=_0x42b8f5-0x0;var _0x31ca50=_0x881a[_0x42b8f5];return _0x31ca50;};'use strict';var _=require(_0xa881('0x0'));var util=require(_0xa881('0x1'));var logger=require(_0xa881('0x2'))(_0xa881('0x3'));var moment=require(_0xa881('0x4'));var BPromise=require(_0xa881('0x5'));var rp=require(_0xa881('0x6'));var fs=require('fs');var path=require(_0xa881('0x7'));var rimraf=require('rimraf');var config=require(_0xa881('0x8'));var attributes=require(_0xa881('0x9'));module[_0xa881('0xa')]=function(_0x2e2257,_0x49f5a0){return _0x2e2257['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xa881('0xb'),'to'],'type':_0xa881('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2572bc,_0x147033,_0x3d7d76){if(_0x2572bc['substatus']){_0x2572bc[_0xa881('0xd')]=moment()['format'](_0xa881('0xe'));}if(_0x2572bc['closed']){_0x2572bc[_0xa881('0xf')]=moment()['format'](_0xa881('0xe'));}_0x3d7d76(null,_0x147033);},'beforeUpdate':function(_0x5e6597,_0x26d81c,_0x5a2fe5){if(_0x5e6597[_0xa881('0x10')](_0xa881('0x11'))){_0x5e6597[_0xa881('0xd')]=_0x5e6597[_0xa881('0x11')]?moment()['format'](_0xa881('0xe')):null;}if(_0x5e6597['changed'](_0xa881('0x12'))){_0x5e6597[_0xa881('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e6597[_0xa881('0x11')]=null;_0x5e6597[_0xa881('0xd')]=null;}_0x5a2fe5(null,_0x5e6597);},'afterUpdate':function(_0x20887e,_0x1d27d7,_0x5e119d){var _0x1122c1=_0x2e2257[_0xa881('0x13')];var _0x1ac412=_0x20887e['get']({'plain':!![]});if(_0x1ac412[_0xa881('0x12')]){return _0x1122c1[_0xa881('0x14')][_0xa881('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x1ac412['id']}})[_0xa881('0x16')](function(){_0x5e119d();})[_0xa881('0x17')](function(_0x5bb538){_0x5e119d(_0x5bb538);});}else{_0x5e119d();}}},'charset':_0xa881('0x18'),'collate':_0xa881('0x19')});};
\ No newline at end of file
index e093e99..79fecd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd33=['MailInteraction','options','where','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction'];(function(_0x31e9ae,_0x4a40d4){var _0x5b1307=function(_0x3ae9d5){while(--_0x3ae9d5){_0x31e9ae['push'](_0x31e9ae['shift']());}};_0x5b1307(++_0x4a40d4);}(_0xdd33,0x1c6));var _0x3dd3=function(_0x17f52e,_0x342490){_0x17f52e=_0x17f52e-0x0;var _0x353f11=_0xdd33[_0x17f52e];return _0x353f11;};'use strict';var _=require(_0x3dd3('0x0'));var util=require(_0x3dd3('0x1'));var moment=require(_0x3dd3('0x2'));var BPromise=require(_0x3dd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dd3('0x4'))['db'];var utils=require(_0x3dd3('0x5'));var logger=require(_0x3dd3('0x6'))(_0x3dd3('0x7'));var config=require(_0x3dd3('0x8'));var jayson=require(_0x3dd3('0x9'));var client=jayson['client'][_0x3dd3('0xa')]({'port':0x232a});config[_0x3dd3('0xb')]=_[_0x3dd3('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3dd3('0xd'))(new Redis(config['redis']));require(_0x3dd3('0xe'))[_0x3dd3('0xf')](socket);function respondWithRpcPromise(_0xd8c171,_0x3f9d2a,_0xc06835){return new BPromise(function(_0x5a4fb1,_0x38afc1){return client[_0x3dd3('0x10')](_0xd8c171,_0xc06835)['then'](function(_0x8bddca){logger[_0x3dd3('0x11')](_0x3dd3('0x12'),_0x3f9d2a,_0x3dd3('0x13'));logger['debug'](_0x3dd3('0x14'),_0x3f9d2a,_0x3dd3('0x13'),JSON[_0x3dd3('0x15')](_0x8bddca));if(_0x8bddca[_0x3dd3('0x16')]){if(_0x8bddca[_0x3dd3('0x16')]['code']===0x1f4){logger[_0x3dd3('0x16')](_0x3dd3('0x12'),_0x3f9d2a,_0x8bddca[_0x3dd3('0x16')][_0x3dd3('0x17')]);return _0x38afc1(_0x8bddca['error'][_0x3dd3('0x17')]);}logger[_0x3dd3('0x16')](_0x3dd3('0x12'),_0x3f9d2a,_0x8bddca[_0x3dd3('0x16')][_0x3dd3('0x17')]);return _0x5a4fb1(_0x8bddca[_0x3dd3('0x16')][_0x3dd3('0x17')]);}else{logger[_0x3dd3('0x11')]('MailInteraction,\x20%s,\x20%s',_0x3f9d2a,_0x3dd3('0x13'));_0x5a4fb1(_0x8bddca['result'][_0x3dd3('0x17')]);}})[_0x3dd3('0x18')](function(_0x4315cf){logger[_0x3dd3('0x16')]('MailInteraction,\x20%s,\x20%s',_0x3f9d2a,_0x4315cf);_0x38afc1(_0x4315cf);});});}exports[_0x3dd3('0x19')]=function(_0x41d7c5){var _0x1f686e=this;return new Promise(function(_0x2072dc,_0x125ca2){return db[_0x3dd3('0x1a')]['update'](_0x41d7c5['body'],{'raw':_0x41d7c5[_0x3dd3('0x1b')]?_0x41d7c5[_0x3dd3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41d7c5['options']?_0x41d7c5[_0x3dd3('0x1b')][_0x3dd3('0x1c')]||null:null,'attributes':_0x41d7c5[_0x3dd3('0x1b')]?_0x41d7c5[_0x3dd3('0x1b')][_0x3dd3('0x1d')]||null:null,'limit':_0x41d7c5[_0x3dd3('0x1b')]?_0x41d7c5[_0x3dd3('0x1b')][_0x3dd3('0x1e')]||null:null})['then'](function(_0x887d62){logger[_0x3dd3('0x11')](_0x3dd3('0x19'),_0x41d7c5);logger[_0x3dd3('0x1f')](_0x3dd3('0x19'),_0x41d7c5,JSON[_0x3dd3('0x15')](_0x887d62));_0x2072dc(_0x887d62);})[_0x3dd3('0x18')](function(_0x2572a3){logger[_0x3dd3('0x16')](_0x3dd3('0x19'),_0x2572a3['message'],_0x41d7c5);_0x125ca2(_0x1f686e[_0x3dd3('0x16')](0x1f4,_0x2572a3[_0x3dd3('0x17')]));});});};exports[_0x3dd3('0x20')]=function(_0x165201){return new Promise(function(_0x4693f5,_0xf44510){return db[_0x3dd3('0x1a')][_0x3dd3('0x21')]({'where':_0x165201['options']?_0x165201[_0x3dd3('0x1b')]['where']||null:null})['then'](function(_0x2d8e97){if(_0x2d8e97){return _0x2d8e97[_0x3dd3('0x22')](_0x165201[_0x3dd3('0x23')][_0x3dd3('0x24')],_[_0x3dd3('0x25')](_0x165201[_0x3dd3('0x23')],['ids','id'])||{});}})[_0x3dd3('0x26')](function(_0x251f7d){logger['info'](_0x3dd3('0x27'),_0x165201);logger[_0x3dd3('0x1f')]('AddTags',_0x165201,JSON[_0x3dd3('0x15')](_0x251f7d));_0x4693f5(_0x251f7d);})[_0x3dd3('0x18')](function(_0x2d4ee0){logger[_0x3dd3('0x16')](_0x3dd3('0x27'),_0x2d4ee0['message'],_0x165201);_0xf44510(_this[_0x3dd3('0x16')](0x1f4,_0x2d4ee0['message']));});});};
\ No newline at end of file
+var _0x95c2=['info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToMailInteraction','find','ids','omit','spread','debug','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then'];(function(_0x52b55f,_0x522eb8){var _0x40ac8c=function(_0x39b126){while(--_0x39b126){_0x52b55f['push'](_0x52b55f['shift']());}};_0x40ac8c(++_0x522eb8);}(_0x95c2,0x9a));var _0x295c=function(_0x316cd7,_0x4a6e94){_0x316cd7=_0x316cd7-0x0;var _0x3994c4=_0x95c2[_0x316cd7];return _0x3994c4;};'use strict';var _=require(_0x295c('0x0'));var util=require(_0x295c('0x1'));var moment=require('moment');var BPromise=require(_0x295c('0x2'));var rs=require(_0x295c('0x3'));var fs=require('fs');var Redis=require(_0x295c('0x4'));var db=require(_0x295c('0x5'))['db'];var utils=require(_0x295c('0x6'));var logger=require('../../config/logger')(_0x295c('0x7'));var config=require(_0x295c('0x8'));var jayson=require(_0x295c('0x9'));var client=jayson['client'][_0x295c('0xa')]({'port':0x232a});config[_0x295c('0xb')]=_[_0x295c('0xc')](config[_0x295c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x295c('0xd'))(new Redis(config['redis']));require(_0x295c('0xe'))[_0x295c('0xf')](socket);function respondWithRpcPromise(_0x14f995,_0x37ff7b,_0x132807){return new BPromise(function(_0x11cfb5,_0x48af32){return client[_0x295c('0x10')](_0x14f995,_0x132807)[_0x295c('0x11')](function(_0x36f004){logger[_0x295c('0x12')](_0x295c('0x13'),_0x37ff7b,_0x295c('0x14'));logger['debug'](_0x295c('0x15'),_0x37ff7b,'request\x20sent',JSON['stringify'](_0x36f004));if(_0x36f004[_0x295c('0x16')]){if(_0x36f004[_0x295c('0x16')]['code']===0x1f4){logger[_0x295c('0x16')](_0x295c('0x13'),_0x37ff7b,_0x36f004[_0x295c('0x16')][_0x295c('0x17')]);return _0x48af32(_0x36f004[_0x295c('0x16')]['message']);}logger[_0x295c('0x16')](_0x295c('0x13'),_0x37ff7b,_0x36f004[_0x295c('0x16')]['message']);return _0x11cfb5(_0x36f004['error'][_0x295c('0x17')]);}else{logger[_0x295c('0x12')](_0x295c('0x13'),_0x37ff7b,_0x295c('0x14'));_0x11cfb5(_0x36f004[_0x295c('0x18')]['message']);}})[_0x295c('0x19')](function(_0x479d21){logger['error'](_0x295c('0x13'),_0x37ff7b,_0x479d21);_0x48af32(_0x479d21);});});}exports[_0x295c('0x1a')]=function(_0x9dfa97){var _0x38c157=this;return new Promise(function(_0x16b02d,_0x2638b2){return db[_0x295c('0x1b')][_0x295c('0x1c')](_0x9dfa97[_0x295c('0x1d')],{'raw':_0x9dfa97['options']?_0x9dfa97['options'][_0x295c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9dfa97[_0x295c('0x1f')]?_0x9dfa97['options'][_0x295c('0x20')]||null:null,'attributes':_0x9dfa97['options']?_0x9dfa97[_0x295c('0x1f')][_0x295c('0x21')]||null:null,'limit':_0x9dfa97[_0x295c('0x1f')]?_0x9dfa97['options'][_0x295c('0x22')]||null:null})[_0x295c('0x11')](function(_0x273eb8){logger[_0x295c('0x12')](_0x295c('0x1a'),_0x9dfa97);logger['debug'](_0x295c('0x1a'),_0x9dfa97,JSON[_0x295c('0x23')](_0x273eb8));_0x16b02d(_0x273eb8);})[_0x295c('0x19')](function(_0x325439){logger[_0x295c('0x16')](_0x295c('0x1a'),_0x325439[_0x295c('0x17')],_0x9dfa97);_0x2638b2(_0x38c157[_0x295c('0x16')](0x1f4,_0x325439[_0x295c('0x17')]));});});};exports[_0x295c('0x24')]=function(_0x35253b){return new Promise(function(_0x5b6a6b,_0x973e5c){return db[_0x295c('0x1b')][_0x295c('0x25')]({'where':_0x35253b[_0x295c('0x1f')]?_0x35253b['options'][_0x295c('0x20')]||null:null})[_0x295c('0x11')](function(_0x3c9dba){if(_0x3c9dba){return _0x3c9dba['addTags'](_0x35253b['body'][_0x295c('0x26')],_[_0x295c('0x27')](_0x35253b['body'],['ids','id'])||{});}})[_0x295c('0x28')](function(_0x499403){logger[_0x295c('0x12')]('AddTags',_0x35253b);logger[_0x295c('0x29')](_0x295c('0x2a'),_0x35253b,JSON[_0x295c('0x23')](_0x499403));_0x5b6a6b(_0x499403);})[_0x295c('0x19')](function(_0x298ae0){logger[_0x295c('0x16')]('AddTags',_0x298ae0[_0x295c('0x17')],_0x35253b);_0x973e5c(_this[_0x295c('0x16')](0x1f4,_0x298ae0['message']));});});};
\ No newline at end of file
index 9434b6e..81b7db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa78a=['register','length','./mailInteraction.events','remove','emit'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa78a,0x179));var _0xaa78=function(_0x102be0,_0x3bb4bb){_0x102be0=_0x102be0-0x0;var _0x112d3d=_0xa78a[_0x102be0];return _0x112d3d;};'use strict';var MailInteractionEvents=require(_0xaa78('0x0'));var events=['save',_0xaa78('0x1'),'update'];function createListener(_0x435fe5,_0x298671){return function(_0x47b9be){_0x298671[_0xaa78('0x2')](_0x435fe5,_0x47b9be);};}function removeListener(_0x21faef,_0x4ca381){return function(){MailInteractionEvents['removeListener'](_0x21faef,_0x4ca381);};}exports[_0xaa78('0x3')]=function(_0x2e3ef9){for(var _0x2e8519=0x0,_0xcc2bd6=events[_0xaa78('0x4')];_0x2e8519<_0xcc2bd6;_0x2e8519++){var _0x350ee7=events[_0x2e8519];var _0xa06dea=createListener('mailInteraction:'+_0x350ee7,_0x2e3ef9);MailInteractionEvents['on'](_0x350ee7,_0xa06dea);}};
\ No newline at end of file
+var _0x95bc=['update','mailInteraction:','./mailInteraction.events','save'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x95bc,0x1de));var _0xc95b=function(_0x3329fd,_0x36432c){_0x3329fd=_0x3329fd-0x0;var _0x178c4f=_0x95bc[_0x3329fd];return _0x178c4f;};'use strict';var MailInteractionEvents=require(_0xc95b('0x0'));var events=[_0xc95b('0x1'),'remove',_0xc95b('0x2')];function createListener(_0xb797fc,_0x3a3ec7){return function(_0x30519c){_0x3a3ec7['emit'](_0xb797fc,_0x30519c);};}function removeListener(_0x28e6b6,_0x289788){return function(){MailInteractionEvents['removeListener'](_0x28e6b6,_0x289788);};}exports['register']=function(_0x3b5b92){for(var _0x5a3a07=0x0,_0x1d4bcb=events['length'];_0x5a3a07<_0x1d4bcb;_0x5a3a07++){var _0x1cc32f=events[_0x5a3a07];var _0x3c82ed=createListener(_0xc95b('0x3')+_0x1cc32f,_0x3b5b92);MailInteractionEvents['on'](_0x1cc32f,_0x3c82ed);}};
\ No newline at end of file
index 7b98188..9012be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9756=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','mail','mailmessage:create','put','/:id','update','/:id/accept','/:id/reject','reject'];(function(_0x1034f3,_0x1222bc){var _0x51f2bd=function(_0xfbddd){while(--_0xfbddd){_0x1034f3['push'](_0x1034f3['shift']());}};_0x51f2bd(++_0x1222bc);}(_0x9756,0x108));var _0x6975=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x9756[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0x6975('0x0'));var util=require(_0x6975('0x1'));var path=require(_0x6975('0x2'));var timeout=require(_0x6975('0x3'));var express=require('express');var router=express[_0x6975('0x4')]();var fs_extra=require(_0x6975('0x5'));var auth=require(_0x6975('0x6'));var interaction=require(_0x6975('0x7'));var config=require(_0x6975('0x8'));var controller=require('./mailMessage.controller');router[_0x6975('0x9')]('/',auth[_0x6975('0xa')](),controller[_0x6975('0xb')]);router['get'](_0x6975('0xc'),auth['isAuthenticated'](),controller[_0x6975('0xd')]);router['get']('/:id',auth[_0x6975('0xa')](),controller[_0x6975('0xe')]);router[_0x6975('0x9')](_0x6975('0xf'),auth['isAuthenticated'](),controller[_0x6975('0x10')]);router[_0x6975('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x6975('0x12'),_0x6975('0x13')),controller['create']);router[_0x6975('0x14')](_0x6975('0x15'),auth[_0x6975('0xa')](),controller[_0x6975('0x16')]);router[_0x6975('0x14')](_0x6975('0x17'),auth[_0x6975('0xa')](),controller['accept']);router['put'](_0x6975('0x18'),auth['isAuthenticated'](),controller[_0x6975('0x19')]);router[_0x6975('0x1a')]('/:id',auth[_0x6975('0xa')](),controller[_0x6975('0x1b')]);module[_0x6975('0x1c')]=router;
\ No newline at end of file
+var _0x8d08=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','show','download','mail','mailmessage:create','create','update','put','/:id/accept','/:id/reject','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5b8155,_0x51c636){var _0x1d6f07=function(_0x206950){while(--_0x206950){_0x5b8155['push'](_0x5b8155['shift']());}};_0x1d6f07(++_0x51c636);}(_0x8d08,0x118));var _0x88d0=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0x8d08[_0x4d7241];return _0x59d9e2;};'use strict';var multer=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var path=require(_0x88d0('0x2'));var timeout=require(_0x88d0('0x3'));var express=require(_0x88d0('0x4'));var router=express[_0x88d0('0x5')]();var fs_extra=require(_0x88d0('0x6'));var auth=require(_0x88d0('0x7'));var interaction=require(_0x88d0('0x8'));var config=require(_0x88d0('0x9'));var controller=require(_0x88d0('0xa'));router[_0x88d0('0xb')]('/',auth['isAuthenticated'](),controller[_0x88d0('0xc')]);router[_0x88d0('0xb')]('/describe',auth[_0x88d0('0xd')](),controller['describe']);router[_0x88d0('0xb')]('/:id',auth[_0x88d0('0xd')](),controller[_0x88d0('0xe')]);router[_0x88d0('0xb')]('/:id/download',auth[_0x88d0('0xd')](),controller[_0x88d0('0xf')]);router['post']('/',auth[_0x88d0('0xd')](),interaction['tracked'](_0x88d0('0x10'),_0x88d0('0x11')),controller[_0x88d0('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x88d0('0x13')]);router[_0x88d0('0x14')](_0x88d0('0x15'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x88d0('0x16'),auth[_0x88d0('0xd')](),controller['reject']);router[_0x88d0('0x17')](_0x88d0('0x18'),auth[_0x88d0('0xd')](),controller[_0x88d0('0x19')]);module['exports']=router;
\ No newline at end of file
index b5628be..844a03f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c5=['INTEGER','BOOLEAN','DATE','Email','sequelize','exports','long','TEXT','ENUM','out','STRING'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xb8c5,0x1c7));var _0x5b8c=function(_0x1e6f26,_0x27d992){_0x1e6f26=_0x1e6f26-0x0;var _0x4820f9=_0xb8c5[_0x1e6f26];return _0x4820f9;};'use strict';var Sequelize=require(_0x5b8c('0x0'));var _=require('lodash');module[_0x5b8c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5b8c('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5b8c('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5b8c('0x4')]('in',_0x5b8c('0x5')),'defaultValue':_0x5b8c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x5b8c('0x6')]},'to':{'type':Sequelize[_0x5b8c('0x3')](_0x5b8c('0x2'))},'cc':{'type':Sequelize[_0x5b8c('0x3')](_0x5b8c('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x5b8c('0x2'))},'subject':{'type':Sequelize[_0x5b8c('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x5b8c('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5b8c('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5b8c('0x9')]},'originTo':{'type':Sequelize[_0x5b8c('0x3')](_0x5b8c('0x2'))},'originCc':{'type':Sequelize[_0x5b8c('0x3')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x5b8c('0xa'),'Chat'),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0xf2d1=['lodash','TEXT','long','medium','BOOLEAN','ENUM','STRING','DATE','INTEGER','Email','Chat','sequelize'];(function(_0x41a56c,_0xa9d2e6){var _0x2a7163=function(_0x3d736f){while(--_0x3d736f){_0x41a56c['push'](_0x41a56c['shift']());}};_0x2a7163(++_0xa9d2e6);}(_0xf2d1,0x6b));var _0x1f2d=function(_0xec2172,_0x3def75){_0xec2172=_0xec2172-0x0;var _0x203f38=_0xf2d1[_0xec2172];return _0x203f38;};'use strict';var Sequelize=require(_0x1f2d('0x0'));var _=require(_0x1f2d('0x1'));module['exports']={'body':{'type':Sequelize[_0x1f2d('0x2')](_0x1f2d('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x1f2d('0x4'))},'read':{'type':Sequelize[_0x1f2d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1f2d('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1f2d('0x7')](0x1fe)},'from':{'type':Sequelize[_0x1f2d('0x7')]},'to':{'type':Sequelize[_0x1f2d('0x2')]('long')},'cc':{'type':Sequelize[_0x1f2d('0x2')](_0x1f2d('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x1f2d('0x3'))},'subject':{'type':Sequelize[_0x1f2d('0x2')]},'sentAt':{'type':Sequelize[_0x1f2d('0x8')]},'attach':{'type':Sequelize[_0x1f2d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1f2d('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1f2d('0x8')]},'originTo':{'type':Sequelize[_0x1f2d('0x2')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x1f2d('0x3'))},'originChannel':{'type':Sequelize[_0x1f2d('0x6')](_0x1f2d('0xa'),_0x1f2d('0xb')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index 25457ae..0f3d4b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','MailInteractionId','RejectMessage','rejectMessage','Sequelize','User','fullname','interface','reject','fromString','rejectmessage','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','download','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','set','Content-Range','json','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','body','find','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','user','pass','auth','attachments','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x393b48,_0x30a9f3){var _0x7585d0=function(_0x13cf27){while(--_0x13cf27){_0x393b48['push'](_0x393b48['shift']());}};_0x7585d0(++_0x30a9f3);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var path=require(_0x49c4('0x2'));var fs=require('fs');var _=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var htmlToText=require(_0x49c4('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x49c4('0x6'));var interaction_log=require('../../config/logger')(_0x49c4('0x7'));var config=require(_0x49c4('0x8'));var db=require(_0x49c4('0x9'))['db'];config[_0x49c4('0xa')]=_[_0x49c4('0xb')](config['redis'],{'host':_0x49c4('0xc'),'port':0x18eb});var socket=require(_0x49c4('0xd'))(new Redis(config[_0x49c4('0xa')]));require(_0x49c4('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x49c4('0xf')][_0x49c4('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x49c4('0x10')]({'port':0x232b});var client9002=jayson[_0x49c4('0xf')]['http']({'port':0x232a});function respondWithRpcPromise(_0x536d42,_0x1d19bf,_0x6d1b08,_0x5487cd){return new BPromise(function(_0x7df3a9,_0x403bfb){var _0x5f2fd9=_0x5487cd||client;return _0x5f2fd9[_0x49c4('0x11')](_0x536d42,_0x6d1b08)[_0x49c4('0x12')](function(_0x21f15a){logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));logger[_0x49c4('0x16')](_0x49c4('0x17'),_0x1d19bf,'request\x20sent',JSON[_0x49c4('0x18')](_0x21f15a));if(_0x21f15a[_0x49c4('0x19')]){if(_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1a')]===0x1f4){logger[_0x49c4('0x19')]('MailMessage,\x20%s,\x20%s',_0x1d19bf,_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1b')]);return _0x403bfb(_0x21f15a['error']['message']);}logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x21f15a[_0x49c4('0x19')]['message']);return _0x7df3a9(_0x21f15a[_0x49c4('0x19')]['message']);}else{logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));_0x7df3a9(_0x21f15a[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x280893){logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x280893);_0x403bfb(_0x280893);});});}function respondWithResult(_0x578447,_0x527126){_0x527126=_0x527126||0xc8;return function(_0x57f502){if(_0x57f502){return _0x578447[_0x49c4('0x1e')](_0x527126)['json'](_0x57f502);}};}function respondWithFilteredResult(_0x592bb8,_0x2263ae){return function(_0x15581b){if(_0x15581b){var _0x26c640=typeof _0x2263ae[_0x49c4('0x1f')]==='undefined'&&typeof _0x2263ae['limit']===_0x49c4('0x20');var _0x9cb797=_0x15581b['count'];var _0x207358=_0x26c640?0x0:_0x2263ae[_0x49c4('0x1f')];var _0x210159=_0x26c640?_0x15581b[_0x49c4('0x21')]:_0x2263ae['offset']+_0x2263ae['limit'];var _0x449960;if(_0x210159>=_0x9cb797){_0x210159=_0x9cb797;_0x449960=0xc8;}else{_0x449960=0xce;}_0x592bb8['status'](_0x449960);return _0x592bb8[_0x49c4('0x22')](_0x49c4('0x23'),_0x207358+'-'+_0x210159+'/'+_0x9cb797)[_0x49c4('0x24')](_0x15581b);}return null;};}function saveUpdates(_0x372a47){return function(_0x5987ae){if(_0x5987ae){return _0x5987ae[_0x49c4('0x25')](_0x372a47)[_0x49c4('0x12')](function(_0x46e04d){return _0x46e04d;});}return null;};}function removeEntity(_0x4f28a2){return function(_0x6329b3){if(_0x6329b3){return _0x6329b3[_0x49c4('0x26')]()[_0x49c4('0x12')](function(){_0x4f28a2[_0x49c4('0x1e')](0xcc)[_0x49c4('0x27')]();});}};}function handleEntityNotFound(_0x2cbd88){return function(_0x46f7ea){if(!_0x46f7ea){_0x2cbd88['sendStatus'](0x194);}return _0x46f7ea;};}function handleError(_0x4f4495,_0x59eb84){_0x59eb84=_0x59eb84||0x1f4;return function(_0x134928){logger[_0x49c4('0x19')](_0x134928[_0x49c4('0x28')]);if(_0x134928[_0x49c4('0x29')]){delete _0x134928[_0x49c4('0x29')];}_0x4f4495['status'](_0x59eb84)[_0x49c4('0x2a')](_0x134928);};}exports[_0x49c4('0x2b')]=function(_0x2e7a69,_0x24bba9){var _0x58e252={},_0x57a29c={},_0xce57ef={'count':0x0,'rows':[]};var _0x9a1bed=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x4a0c7a){return{'name':_0x4a0c7a[_0x49c4('0x2f')],'type':_0x4a0c7a[_0x49c4('0x30')][_0x49c4('0x31')]};});_0x57a29c['model']=_['map'](_0x9a1bed,_0x49c4('0x29'));_0x57a29c[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2e7a69[_0x49c4('0x32')]);_0x57a29c[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x57a29c[_0x49c4('0x36')],_0x57a29c[_0x49c4('0x32')]);_0x58e252[_0x49c4('0x37')]=_['intersection'](_0x57a29c[_0x49c4('0x36')],qs['fields'](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x38')]));_0x58e252[_0x49c4('0x37')]=_0x58e252[_0x49c4('0x37')]['length']?_0x58e252[_0x49c4('0x37')]:_0x57a29c[_0x49c4('0x36')];if(!_0x2e7a69[_0x49c4('0x32')]['hasOwnProperty'](_0x49c4('0x39'))){_0x58e252[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x58e252[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x1f')]);}_0x58e252[_0x49c4('0x3b')]=qs[_0x49c4('0x3c')](_0x2e7a69['query'][_0x49c4('0x3c')]);_0x58e252[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3e')](_0x2e7a69[_0x49c4('0x32')],_0x57a29c[_0x49c4('0x34')]),_0x9a1bed);if(_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]){_0x58e252[_0x49c4('0x3d')]=_[_0x49c4('0x40')](_0x58e252[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x2c')](_0x9a1bed,function(_0x326142){if(_0x326142['type']!==_0x49c4('0x41')){var _0x49829e={};_0x49829e[_0x326142[_0x49c4('0x29')]]={'$like':'%'+_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]+'%'};return _0x49829e;}})});}_0x58e252=_[_0x49c4('0x40')]({},_0x58e252,_0x2e7a69[_0x49c4('0x42')]);var _0x281b83={'where':_0x58e252['where']};return db['MailMessage'][_0x49c4('0x21')](_0x281b83)[_0x49c4('0x12')](function(_0x38349b){_0xce57ef[_0x49c4('0x21')]=_0x38349b;if(_0x2e7a69['query'][_0x49c4('0x43')]){_0x58e252[_0x49c4('0x44')]=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x45')](_0x58e252);})[_0x49c4('0x12')](function(_0x3bde49){_0xce57ef[_0x49c4('0x46')]=_0x3bde49;return _0xce57ef;})[_0x49c4('0x12')](respondWithFilteredResult(_0x24bba9,_0x58e252))[_0x49c4('0x1d')](handleError(_0x24bba9,null));};exports['show']=function(_0x2ad771,_0x4d27d0){var _0x33696e={'raw':!![],'where':{'id':_0x2ad771[_0x49c4('0x47')]['id']}},_0x628423={};_0x628423[_0x49c4('0x36')]=_[_0x49c4('0x33')](db['MailMessage'][_0x49c4('0x2e')]);_0x628423[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2ad771[_0x49c4('0x32')]);_0x628423[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x628423[_0x49c4('0x36')],_0x628423['query']);_0x33696e[_0x49c4('0x37')]=_['intersection'](_0x628423[_0x49c4('0x36')],qs[_0x49c4('0x38')](_0x2ad771[_0x49c4('0x32')][_0x49c4('0x38')]));_0x33696e[_0x49c4('0x37')]=_0x33696e[_0x49c4('0x37')][_0x49c4('0x48')]?_0x33696e['attributes']:_0x628423[_0x49c4('0x36')];if(_0x2ad771[_0x49c4('0x32')]['includeAll']){_0x33696e[_0x49c4('0x44')]=[{'all':!![]}];}_0x33696e=_[_0x49c4('0x40')]({},_0x33696e,_0x2ad771[_0x49c4('0x42')]);return db[_0x49c4('0x2d')]['find'](_0x33696e)['then'](handleEntityNotFound(_0x4d27d0,null))[_0x49c4('0x12')](respondWithResult(_0x4d27d0,null))['catch'](handleError(_0x4d27d0,null));};exports[_0x49c4('0x25')]=function(_0x1f941f,_0x3811b2){if(_0x1f941f[_0x49c4('0x49')]['id']){delete _0x1f941f[_0x49c4('0x49')]['id'];}return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x1f941f['params']['id']}})[_0x49c4('0x12')](handleEntityNotFound(_0x3811b2,null))[_0x49c4('0x12')](saveUpdates(_0x1f941f[_0x49c4('0x49')],null))[_0x49c4('0x12')](respondWithResult(_0x3811b2,null))[_0x49c4('0x1d')](handleError(_0x3811b2,null));};exports[_0x49c4('0x26')]=function(_0x156748,_0x25d174){return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x156748['params']['id']}})['then'](handleEntityNotFound(_0x25d174,null))[_0x49c4('0x12')](removeEntity(_0x25d174,null))[_0x49c4('0x1d')](handleError(_0x25d174,null));};exports['describe']=function(_0x59a8bc,_0x77163d){return db['MailMessage']['describe']()[_0x49c4('0x12')](respondWithResult(_0x77163d,null))[_0x49c4('0x1d')](handleError(_0x77163d,null));};exports[_0x49c4('0x4b')]=function(_0x38c480,_0x2884ca){return db[_0x49c4('0x2d')][_0x49c4('0x4b')](_0x38c480['body'])[_0x49c4('0x12')](function(_0xcc6a2b){if(_0xcc6a2b){if(_0xcc6a2b[_0x49c4('0x4c')]===_0x49c4('0x4d')&&!_0xcc6a2b[_0x49c4('0x4e')]){var _0xa431d,_0x5d24f3,_0x5c7ddd;if(_0x38c480[_0x49c4('0x49')]['to']){_0x5d24f3=_0x38c480[_0x49c4('0x49')]['to'][_0x49c4('0x4f')](',')[0x0];}return db[_0x49c4('0x50')][_0x49c4('0x51')]({'where':{'id':_0xcc6a2b[_0x49c4('0x52')]},'include':[{'model':db[_0x49c4('0x53')],'as':'List','include':[{'model':db[_0x49c4('0x54')],'as':_0x49c4('0x55'),'where':{'email':_0x5d24f3},'limit':0x1,'order':[['updatedAt',_0x49c4('0x56')]]}]},{'model':db['MailServerOut'],'as':_0x49c4('0x57'),'raw':!![]}]})[_0x49c4('0x12')](function(_0x9eaa84){_0xa431d=_0x9eaa84;if(_0xa431d&&_0xa431d[_0x49c4('0x57')]){var _0x845f7e={'tls':{'rejectUnauthorized':![]}};if(_[_0x49c4('0x58')](_0xa431d[_0x49c4('0x57')][_0x49c4('0x59')])){_0x845f7e['host']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5a')];_0x845f7e['port']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5b')];_0x845f7e['secure']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5c')];if(_0xa431d['Smtp']['authentication']){_0x845f7e['auth']={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d['Smtp'][_0x49c4('0x5e')]};}}else{_0x845f7e[_0x49c4('0x59')]=_0xa431d['Smtp'][_0x49c4('0x59')];_0x845f7e[_0x49c4('0x5f')]={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d[_0x49c4('0x57')][_0x49c4('0x5e')]};_0x845f7e[_0x49c4('0x5c')]=_0xa431d['Smtp'][_0x49c4('0x5c')];}if(_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')]&&_0x38c480[_0x49c4('0x49')]['attachments'][_0x49c4('0x48')]){for(var _0x4a93bc=0x0;_0x4a93bc<_0x38c480['body']['attachments']['length'];_0x4a93bc+=0x1){_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]={'filename':_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]['name'],'path':path['join'](config[_0x49c4('0x61')],_0x49c4('0x62'),_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc][_0x49c4('0x63')])};}}_0x5c7ddd={'account':_0x845f7e,'message':_0x38c480[_0x49c4('0x49')]};return;}})[_0x49c4('0x12')](function(){if(_0xa431d[_0x49c4('0x64')]){if(_0xa431d['List'][_0x49c4('0x55')]['length']){return _0xa431d[_0x49c4('0x64')][_0x49c4('0x55')][0x0];}else{return db[_0x49c4('0x54')][_0x49c4('0x4b')](_[_0x49c4('0xb')](_0x38c480[_0x49c4('0x49')],{'firstName':_0x38c480[_0x49c4('0x49')]['to'],'email':_0x38c480[_0x49c4('0x49')]['to'],'phone':_0x38c480[_0x49c4('0x49')]['to'],'ListId':_0xa431d[_0x49c4('0x65')]}));}}else{throw new Error(_0x49c4('0x66'));}})[_0x49c4('0x12')](function(){if(_0x5c7ddd){return respondWithRpcPromise(_0x49c4('0x67'),_0x49c4('0x68'),_0x5c7ddd,client9003)[_0x49c4('0x12')](function(_0x453cf2){return _0xcc6a2b[_0x49c4('0x25')]({'read':!![],'messageId':_0x453cf2[_0x49c4('0x69')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x49c4('0x1d')](function(_0x16b3e8){logger['error']('%s',JSON[_0x49c4('0x18')](_0x16b3e8));return _0xcc6a2b;});}return _0xcc6a2b;});}return _0xcc6a2b;}})[_0x49c4('0x12')](respondWithResult(_0x2884ca,0xc9))[_0x49c4('0x1d')](handleError(_0x2884ca,null));};exports[_0x49c4('0x6a')]=function(_0x4d6aaa,_0x5a14a5){var _0x4a85d4={'agent':{},'channel':_0x49c4('0x6b')};if(_0x4d6aaa[_0x49c4('0x49')]['id']){delete _0x4d6aaa[_0x49c4('0x49')]['id'];}_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6c')]=!![];_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6d')]=moment()[_0x49c4('0x6e')](_0x49c4('0x6f'));_0x4d6aaa['body'][_0x49c4('0x70')]=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')]||_0x4d6aaa['user']['id'];_0x4a85d4[_0x49c4('0x71')]['id']=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))[_0x49c4('0x12')](saveUpdates(_0x4d6aaa['body'],null))[_0x49c4('0x12')](function(_0x20e2d5){if(_0x20e2d5){_0x4a85d4[_0x49c4('0x1b')]=_0x20e2d5[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')]['find']({'where':{'id':_0x20e2d5['MailInteractionId']}});}return null;})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))['then'](function(_0x34cf49){if(_0x34cf49){return _0x34cf49['update']({'UserId':_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')],'read1stAt':_[_0x49c4('0x58')](_0x34cf49[_0x49c4('0x74')])?moment()['format'](_0x49c4('0x6f')):undefined});}return null;})[_0x49c4('0x12')](function(_0x2ceada){if(_0x2ceada){_0x4a85d4[_0x49c4('0x75')]=_0x2ceada[_0x49c4('0x72')]({'plain':!![]});interaction_log[_0x49c4('0x13')](_0x49c4('0x76'),_0x4d6aaa[_0x49c4('0x5d')]['id'],_0x4d6aaa[_0x49c4('0x5d')][_0x49c4('0x29')],_0x4d6aaa['user'][_0x49c4('0x77')],_0x4a85d4[_0x49c4('0x75')]['id'],_0x4d6aaa['body']?JSON[_0x49c4('0x18')](_0x4d6aaa['body']):_0x49c4('0x78'));return respondWithRpcPromise(_0x49c4('0x79'),_0x49c4('0x7a'),_0x4a85d4);}return null;})[_0x49c4('0x12')](function(_0x2c32c0){var _0x58b90c=_0x49c4('0x7b')+_0x2c32c0[_0x49c4('0x1b')]['ContactId'];return db[_0x49c4('0x7c')][_0x49c4('0x32')](_0x58b90c,{'type':db['Sequelize'][_0x49c4('0x7d')][_0x49c4('0x7e')],'raw':!![]})['then'](function(_0x37fef1){return _0x37fef1;});})[_0x49c4('0x12')](function(_0x25989a){if(_0x25989a){_0x4a85d4[_0x49c4('0x1b')]['contact']=_0x25989a[0x0];if(!_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')])return;return db['User'][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa['body']['UserId'],'role':_0x49c4('0x71')},'attributes':['id','name','fullname',_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})['then'](function(_0x23e684){if(!_0x23e684)return null;_0x4a85d4['message']['agent']=_0x23e684;return _0x4a85d4;})['then'](function(_0x10d107){if(_0x10d107){if(_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x81')]){_0x4a85d4[_0x49c4('0x1b')]['interface']=util['format'](_0x49c4('0x82'),_0x4d6aaa['user'][_0x49c4('0x29')]);_0x4a85d4['message'][_0x49c4('0x83')]=_0x4a85d4[_0x49c4('0x83')];_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x84')]=_0x49c4('0x6a');_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]=htmlToText['fromString'](_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]);return respondWithRpcPromise(_0x49c4('0x85'),_0x49c4('0x85'),{'event':_0x49c4('0x86'),'message':_0x4a85d4['message']},client9002)[_0x49c4('0x12')](function(){return _0x4a85d4;});}return _0x4a85d4;}return null;})[_0x49c4('0x12')](respondWithResult(_0x5a14a5,null))[_0x49c4('0x1d')](handleError(_0x5a14a5,null));};exports['reject']=function(_0x530ff2,_0xbfff7){var _0x27b31d={'agent':{},'channel':_0x49c4('0x6b')};if(_0x530ff2[_0x49c4('0x49')]['id']){delete _0x530ff2[_0x49c4('0x49')]['id'];}_0x530ff2['body'][_0x49c4('0x70')]=_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')]||_0x530ff2[_0x49c4('0x5d')]['id'];_0x27b31d['agent']['id']=_0x530ff2['body'][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0xbfff7,null))['then'](function(_0x389edb){if(_0x389edb){_0x27b31d[_0x49c4('0x1b')]=_0x389edb[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')][_0x49c4('0x4a')]({'where':{'id':_0x389edb[_0x49c4('0x87')]}});}return null;})['then'](handleEntityNotFound(_0xbfff7,null))[_0x49c4('0x12')](function(_0x1c90ba){if(_0x1c90ba){_0x27b31d[_0x49c4('0x75')]=_0x1c90ba[_0x49c4('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x530ff2[_0x49c4('0x5d')]['id'],_0x530ff2['user'][_0x49c4('0x29')],_0x530ff2['user'][_0x49c4('0x77')],_0x27b31d[_0x49c4('0x75')]['id'],_0x530ff2[_0x49c4('0x49')]?JSON[_0x49c4('0x18')](_0x530ff2['body']):'null');return respondWithRpcPromise(_0x49c4('0x88'),_0x49c4('0x89'),_0x27b31d);}return null;})[_0x49c4('0x12')](function(_0x5f0116){var _0x4c0e9c=_0x49c4('0x7b')+_0x5f0116['message']['ContactId'];return db[_0x49c4('0x7c')]['query'](_0x4c0e9c,{'type':db[_0x49c4('0x8a')][_0x49c4('0x7d')]['SELECT'],'raw':!![]})[_0x49c4('0x12')](function(_0x45474e){return _0x45474e;});})['then'](function(_0x5428a9){if(_0x5428a9){_0x27b31d[_0x49c4('0x1b')]['contact']=_0x5428a9[0x0];if(!_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')])return;return db[_0x49c4('0x8b')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')],'role':_0x49c4('0x71')},'attributes':['id','name',_0x49c4('0x8c'),_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})[_0x49c4('0x12')](function(_0x3107c9){if(!_0x3107c9)return null;_0x27b31d['message'][_0x49c4('0x71')]=_0x3107c9;return _0x27b31d;})['then'](function(_0xb66e67){if(_0xb66e67){_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x8d')]=util[_0x49c4('0x6e')]('SIP/%s',_0x530ff2[_0x49c4('0x5d')][_0x49c4('0x29')]);_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x83')]=_0x27b31d[_0x49c4('0x83')];_0xb66e67[_0x49c4('0x1b')]['event']=_0x49c4('0x8e');_0xb66e67['message'][_0x49c4('0x49')]=htmlToText[_0x49c4('0x8f')](_0x27b31d[_0x49c4('0x1b')][_0x49c4('0x49')]);respondWithRpcPromise('EventManager',_0x49c4('0x85'),{'event':_0x49c4('0x90'),'message':_0xb66e67['message']},client9002);return _0x27b31d;}return null;})[_0x49c4('0x12')](respondWithResult(_0xbfff7,null))[_0x49c4('0x1d')](handleError(_0xbfff7,null));};exports['download']=function(_0x562f47,_0x25f1c7){var _0x3e5915=moment()[_0x49c4('0x91')]()[_0x49c4('0x92')]();var _0x32afd4=path[_0x49c4('0x93')](config[_0x49c4('0x61')],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x96'));var _0x269613=path['join'](config['root'],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x60'));var _0x5be042=util[_0x49c4('0x6e')](_0x49c4('0x97'),_0x3e5915);return db['MailMessage'][_0x49c4('0x4a')]({'where':{'id':_0x562f47['params']['id']},'attributes':['id',_0x49c4('0x49'),_0x49c4('0x98'),'to','cc',_0x49c4('0x99'),_0x49c4('0x9a'),'createdAt'],'include':_0x562f47[_0x49c4('0x32')][_0x49c4('0x60')]?[{'model':db[_0x49c4('0x9b')],'as':_0x49c4('0x9c')}]:undefined})[_0x49c4('0x12')](handleEntityNotFound(_0x25f1c7,null))['then'](function(_0x5a4e00){if(_0x5a4e00){var _0x5f4d82=_0x5a4e00;var _0x1856c7={'from':_0x5f4d82[_0x49c4('0x98')],'to':_0x5f4d82['to'],'subject':_0x5f4d82[_0x49c4('0x9a')],'html':_0x5f4d82[_0x49c4('0x49')],'headers':{'Date':moment(_0x5f4d82[_0x49c4('0x9d')])['format'](_0x49c4('0x9e'))},'attachments':[]};if(_0x5a4e00['cc']){_0x1856c7[_0x49c4('0x9f')]['Cc']=_0x5a4e00['cc'];}if(_0x5a4e00[_0x49c4('0x99')]){_0x1856c7[_0x49c4('0x9f')]['Bcc']=_0x5a4e00[_0x49c4('0x99')];}return new BPromise(function(_0x5bfccd,_0x10fa42){if(_0x5a4e00[_0x49c4('0x9c')]){for(var _0x2fda4f=0x0;_0x2fda4f<_0x5a4e00['Attachments'][_0x49c4('0x48')];_0x2fda4f++){var _0x9b622d=_0x5a4e00[_0x49c4('0x9c')][_0x2fda4f];var _0x494c7f=path[_0x49c4('0x93')](_0x269613,_0x9b622d[_0x49c4('0x63')]);if(fs[_0x49c4('0xa0')](_0x494c7f)){_0x1856c7['attachments'][_0x49c4('0xa1')]({'name':_0x9b622d['name'],'contentType':_0x9b622d['type'],'data':fs[_0x49c4('0xa2')](_0x494c7f)});}}}emlformat[_0x49c4('0xa3')](_0x1856c7,function(_0x4ef4aa,_0x815b34){if(_0x4ef4aa)return _0x10fa42(_0x4ef4aa);fs[_0x49c4('0xa4')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x815b34);return _0x5bfccd(_0x815b34);});});}})[_0x49c4('0x12')](function(_0x10f5fc){if(_0x10f5fc){return _0x25f1c7[_0x49c4('0xa5')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x5be042,function(_0x219133){if(!_0x219133)fs['unlinkSync'](path['join'](_0x32afd4,_0x5be042));});}})[_0x49c4('0x1d')](handleError(_0x25f1c7,null));};
\ No newline at end of file
+var _0x9c44=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','MailInteractionId','RejectMessage','rejectMessage','Sequelize','User','fullname','interface','reject','fromString','rejectmessage','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','download','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','set','Content-Range','json','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','body','find','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','user','pass','auth','attachments','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x4c4d07,_0x56516f){var _0x562455=function(_0x1e1df5){while(--_0x1e1df5){_0x4c4d07['push'](_0x4c4d07['shift']());}};_0x562455(++_0x56516f);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var path=require(_0x49c4('0x2'));var fs=require('fs');var _=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var htmlToText=require(_0x49c4('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x49c4('0x6'));var interaction_log=require('../../config/logger')(_0x49c4('0x7'));var config=require(_0x49c4('0x8'));var db=require(_0x49c4('0x9'))['db'];config[_0x49c4('0xa')]=_[_0x49c4('0xb')](config['redis'],{'host':_0x49c4('0xc'),'port':0x18eb});var socket=require(_0x49c4('0xd'))(new Redis(config[_0x49c4('0xa')]));require(_0x49c4('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x49c4('0xf')][_0x49c4('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x49c4('0x10')]({'port':0x232b});var client9002=jayson[_0x49c4('0xf')]['http']({'port':0x232a});function respondWithRpcPromise(_0x536d42,_0x1d19bf,_0x6d1b08,_0x5487cd){return new BPromise(function(_0x7df3a9,_0x403bfb){var _0x5f2fd9=_0x5487cd||client;return _0x5f2fd9[_0x49c4('0x11')](_0x536d42,_0x6d1b08)[_0x49c4('0x12')](function(_0x21f15a){logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));logger[_0x49c4('0x16')](_0x49c4('0x17'),_0x1d19bf,'request\x20sent',JSON[_0x49c4('0x18')](_0x21f15a));if(_0x21f15a[_0x49c4('0x19')]){if(_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1a')]===0x1f4){logger[_0x49c4('0x19')]('MailMessage,\x20%s,\x20%s',_0x1d19bf,_0x21f15a[_0x49c4('0x19')][_0x49c4('0x1b')]);return _0x403bfb(_0x21f15a['error']['message']);}logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x21f15a[_0x49c4('0x19')]['message']);return _0x7df3a9(_0x21f15a[_0x49c4('0x19')]['message']);}else{logger[_0x49c4('0x13')](_0x49c4('0x14'),_0x1d19bf,_0x49c4('0x15'));_0x7df3a9(_0x21f15a[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x280893){logger[_0x49c4('0x19')](_0x49c4('0x14'),_0x1d19bf,_0x280893);_0x403bfb(_0x280893);});});}function respondWithResult(_0x578447,_0x527126){_0x527126=_0x527126||0xc8;return function(_0x57f502){if(_0x57f502){return _0x578447[_0x49c4('0x1e')](_0x527126)['json'](_0x57f502);}};}function respondWithFilteredResult(_0x592bb8,_0x2263ae){return function(_0x15581b){if(_0x15581b){var _0x26c640=typeof _0x2263ae[_0x49c4('0x1f')]==='undefined'&&typeof _0x2263ae['limit']===_0x49c4('0x20');var _0x9cb797=_0x15581b['count'];var _0x207358=_0x26c640?0x0:_0x2263ae[_0x49c4('0x1f')];var _0x210159=_0x26c640?_0x15581b[_0x49c4('0x21')]:_0x2263ae['offset']+_0x2263ae['limit'];var _0x449960;if(_0x210159>=_0x9cb797){_0x210159=_0x9cb797;_0x449960=0xc8;}else{_0x449960=0xce;}_0x592bb8['status'](_0x449960);return _0x592bb8[_0x49c4('0x22')](_0x49c4('0x23'),_0x207358+'-'+_0x210159+'/'+_0x9cb797)[_0x49c4('0x24')](_0x15581b);}return null;};}function saveUpdates(_0x372a47){return function(_0x5987ae){if(_0x5987ae){return _0x5987ae[_0x49c4('0x25')](_0x372a47)[_0x49c4('0x12')](function(_0x46e04d){return _0x46e04d;});}return null;};}function removeEntity(_0x4f28a2){return function(_0x6329b3){if(_0x6329b3){return _0x6329b3[_0x49c4('0x26')]()[_0x49c4('0x12')](function(){_0x4f28a2[_0x49c4('0x1e')](0xcc)[_0x49c4('0x27')]();});}};}function handleEntityNotFound(_0x2cbd88){return function(_0x46f7ea){if(!_0x46f7ea){_0x2cbd88['sendStatus'](0x194);}return _0x46f7ea;};}function handleError(_0x4f4495,_0x59eb84){_0x59eb84=_0x59eb84||0x1f4;return function(_0x134928){logger[_0x49c4('0x19')](_0x134928[_0x49c4('0x28')]);if(_0x134928[_0x49c4('0x29')]){delete _0x134928[_0x49c4('0x29')];}_0x4f4495['status'](_0x59eb84)[_0x49c4('0x2a')](_0x134928);};}exports[_0x49c4('0x2b')]=function(_0x2e7a69,_0x24bba9){var _0x58e252={},_0x57a29c={},_0xce57ef={'count':0x0,'rows':[]};var _0x9a1bed=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x4a0c7a){return{'name':_0x4a0c7a[_0x49c4('0x2f')],'type':_0x4a0c7a[_0x49c4('0x30')][_0x49c4('0x31')]};});_0x57a29c['model']=_['map'](_0x9a1bed,_0x49c4('0x29'));_0x57a29c[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2e7a69[_0x49c4('0x32')]);_0x57a29c[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x57a29c[_0x49c4('0x36')],_0x57a29c[_0x49c4('0x32')]);_0x58e252[_0x49c4('0x37')]=_['intersection'](_0x57a29c[_0x49c4('0x36')],qs['fields'](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x38')]));_0x58e252[_0x49c4('0x37')]=_0x58e252[_0x49c4('0x37')]['length']?_0x58e252[_0x49c4('0x37')]:_0x57a29c[_0x49c4('0x36')];if(!_0x2e7a69[_0x49c4('0x32')]['hasOwnProperty'](_0x49c4('0x39'))){_0x58e252[_0x49c4('0x3a')]=qs[_0x49c4('0x3a')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3a')]);_0x58e252[_0x49c4('0x1f')]=qs[_0x49c4('0x1f')](_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x1f')]);}_0x58e252[_0x49c4('0x3b')]=qs[_0x49c4('0x3c')](_0x2e7a69['query'][_0x49c4('0x3c')]);_0x58e252[_0x49c4('0x3d')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3e')](_0x2e7a69[_0x49c4('0x32')],_0x57a29c[_0x49c4('0x34')]),_0x9a1bed);if(_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]){_0x58e252[_0x49c4('0x3d')]=_[_0x49c4('0x40')](_0x58e252[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x2c')](_0x9a1bed,function(_0x326142){if(_0x326142['type']!==_0x49c4('0x41')){var _0x49829e={};_0x49829e[_0x326142[_0x49c4('0x29')]]={'$like':'%'+_0x2e7a69[_0x49c4('0x32')][_0x49c4('0x3f')]+'%'};return _0x49829e;}})});}_0x58e252=_[_0x49c4('0x40')]({},_0x58e252,_0x2e7a69[_0x49c4('0x42')]);var _0x281b83={'where':_0x58e252['where']};return db['MailMessage'][_0x49c4('0x21')](_0x281b83)[_0x49c4('0x12')](function(_0x38349b){_0xce57ef[_0x49c4('0x21')]=_0x38349b;if(_0x2e7a69['query'][_0x49c4('0x43')]){_0x58e252[_0x49c4('0x44')]=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x45')](_0x58e252);})[_0x49c4('0x12')](function(_0x3bde49){_0xce57ef[_0x49c4('0x46')]=_0x3bde49;return _0xce57ef;})[_0x49c4('0x12')](respondWithFilteredResult(_0x24bba9,_0x58e252))[_0x49c4('0x1d')](handleError(_0x24bba9,null));};exports['show']=function(_0x2ad771,_0x4d27d0){var _0x33696e={'raw':!![],'where':{'id':_0x2ad771[_0x49c4('0x47')]['id']}},_0x628423={};_0x628423[_0x49c4('0x36')]=_[_0x49c4('0x33')](db['MailMessage'][_0x49c4('0x2e')]);_0x628423[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x2ad771[_0x49c4('0x32')]);_0x628423[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x628423[_0x49c4('0x36')],_0x628423['query']);_0x33696e[_0x49c4('0x37')]=_['intersection'](_0x628423[_0x49c4('0x36')],qs[_0x49c4('0x38')](_0x2ad771[_0x49c4('0x32')][_0x49c4('0x38')]));_0x33696e[_0x49c4('0x37')]=_0x33696e[_0x49c4('0x37')][_0x49c4('0x48')]?_0x33696e['attributes']:_0x628423[_0x49c4('0x36')];if(_0x2ad771[_0x49c4('0x32')]['includeAll']){_0x33696e[_0x49c4('0x44')]=[{'all':!![]}];}_0x33696e=_[_0x49c4('0x40')]({},_0x33696e,_0x2ad771[_0x49c4('0x42')]);return db[_0x49c4('0x2d')]['find'](_0x33696e)['then'](handleEntityNotFound(_0x4d27d0,null))[_0x49c4('0x12')](respondWithResult(_0x4d27d0,null))['catch'](handleError(_0x4d27d0,null));};exports[_0x49c4('0x25')]=function(_0x1f941f,_0x3811b2){if(_0x1f941f[_0x49c4('0x49')]['id']){delete _0x1f941f[_0x49c4('0x49')]['id'];}return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x1f941f['params']['id']}})[_0x49c4('0x12')](handleEntityNotFound(_0x3811b2,null))[_0x49c4('0x12')](saveUpdates(_0x1f941f[_0x49c4('0x49')],null))[_0x49c4('0x12')](respondWithResult(_0x3811b2,null))[_0x49c4('0x1d')](handleError(_0x3811b2,null));};exports[_0x49c4('0x26')]=function(_0x156748,_0x25d174){return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x156748['params']['id']}})['then'](handleEntityNotFound(_0x25d174,null))[_0x49c4('0x12')](removeEntity(_0x25d174,null))[_0x49c4('0x1d')](handleError(_0x25d174,null));};exports['describe']=function(_0x59a8bc,_0x77163d){return db['MailMessage']['describe']()[_0x49c4('0x12')](respondWithResult(_0x77163d,null))[_0x49c4('0x1d')](handleError(_0x77163d,null));};exports[_0x49c4('0x4b')]=function(_0x38c480,_0x2884ca){return db[_0x49c4('0x2d')][_0x49c4('0x4b')](_0x38c480['body'])[_0x49c4('0x12')](function(_0xcc6a2b){if(_0xcc6a2b){if(_0xcc6a2b[_0x49c4('0x4c')]===_0x49c4('0x4d')&&!_0xcc6a2b[_0x49c4('0x4e')]){var _0xa431d,_0x5d24f3,_0x5c7ddd;if(_0x38c480[_0x49c4('0x49')]['to']){_0x5d24f3=_0x38c480[_0x49c4('0x49')]['to'][_0x49c4('0x4f')](',')[0x0];}return db[_0x49c4('0x50')][_0x49c4('0x51')]({'where':{'id':_0xcc6a2b[_0x49c4('0x52')]},'include':[{'model':db[_0x49c4('0x53')],'as':'List','include':[{'model':db[_0x49c4('0x54')],'as':_0x49c4('0x55'),'where':{'email':_0x5d24f3},'limit':0x1,'order':[['updatedAt',_0x49c4('0x56')]]}]},{'model':db['MailServerOut'],'as':_0x49c4('0x57'),'raw':!![]}]})[_0x49c4('0x12')](function(_0x9eaa84){_0xa431d=_0x9eaa84;if(_0xa431d&&_0xa431d[_0x49c4('0x57')]){var _0x845f7e={'tls':{'rejectUnauthorized':![]}};if(_[_0x49c4('0x58')](_0xa431d[_0x49c4('0x57')][_0x49c4('0x59')])){_0x845f7e['host']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5a')];_0x845f7e['port']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5b')];_0x845f7e['secure']=_0xa431d[_0x49c4('0x57')][_0x49c4('0x5c')];if(_0xa431d['Smtp']['authentication']){_0x845f7e['auth']={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d['Smtp'][_0x49c4('0x5e')]};}}else{_0x845f7e[_0x49c4('0x59')]=_0xa431d['Smtp'][_0x49c4('0x59')];_0x845f7e[_0x49c4('0x5f')]={'user':_0xa431d['Smtp'][_0x49c4('0x5d')],'pass':_0xa431d[_0x49c4('0x57')][_0x49c4('0x5e')]};_0x845f7e[_0x49c4('0x5c')]=_0xa431d['Smtp'][_0x49c4('0x5c')];}if(_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')]&&_0x38c480[_0x49c4('0x49')]['attachments'][_0x49c4('0x48')]){for(var _0x4a93bc=0x0;_0x4a93bc<_0x38c480['body']['attachments']['length'];_0x4a93bc+=0x1){_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]={'filename':_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc]['name'],'path':path['join'](config[_0x49c4('0x61')],_0x49c4('0x62'),_0x38c480[_0x49c4('0x49')][_0x49c4('0x60')][_0x4a93bc][_0x49c4('0x63')])};}}_0x5c7ddd={'account':_0x845f7e,'message':_0x38c480[_0x49c4('0x49')]};return;}})[_0x49c4('0x12')](function(){if(_0xa431d[_0x49c4('0x64')]){if(_0xa431d['List'][_0x49c4('0x55')]['length']){return _0xa431d[_0x49c4('0x64')][_0x49c4('0x55')][0x0];}else{return db[_0x49c4('0x54')][_0x49c4('0x4b')](_[_0x49c4('0xb')](_0x38c480[_0x49c4('0x49')],{'firstName':_0x38c480[_0x49c4('0x49')]['to'],'email':_0x38c480[_0x49c4('0x49')]['to'],'phone':_0x38c480[_0x49c4('0x49')]['to'],'ListId':_0xa431d[_0x49c4('0x65')]}));}}else{throw new Error(_0x49c4('0x66'));}})[_0x49c4('0x12')](function(){if(_0x5c7ddd){return respondWithRpcPromise(_0x49c4('0x67'),_0x49c4('0x68'),_0x5c7ddd,client9003)[_0x49c4('0x12')](function(_0x453cf2){return _0xcc6a2b[_0x49c4('0x25')]({'read':!![],'messageId':_0x453cf2[_0x49c4('0x69')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x49c4('0x1d')](function(_0x16b3e8){logger['error']('%s',JSON[_0x49c4('0x18')](_0x16b3e8));return _0xcc6a2b;});}return _0xcc6a2b;});}return _0xcc6a2b;}})[_0x49c4('0x12')](respondWithResult(_0x2884ca,0xc9))[_0x49c4('0x1d')](handleError(_0x2884ca,null));};exports[_0x49c4('0x6a')]=function(_0x4d6aaa,_0x5a14a5){var _0x4a85d4={'agent':{},'channel':_0x49c4('0x6b')};if(_0x4d6aaa[_0x49c4('0x49')]['id']){delete _0x4d6aaa[_0x49c4('0x49')]['id'];}_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6c')]=!![];_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x6d')]=moment()[_0x49c4('0x6e')](_0x49c4('0x6f'));_0x4d6aaa['body'][_0x49c4('0x70')]=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')]||_0x4d6aaa['user']['id'];_0x4a85d4[_0x49c4('0x71')]['id']=_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))[_0x49c4('0x12')](saveUpdates(_0x4d6aaa['body'],null))[_0x49c4('0x12')](function(_0x20e2d5){if(_0x20e2d5){_0x4a85d4[_0x49c4('0x1b')]=_0x20e2d5[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')]['find']({'where':{'id':_0x20e2d5['MailInteractionId']}});}return null;})[_0x49c4('0x12')](handleEntityNotFound(_0x5a14a5,null))['then'](function(_0x34cf49){if(_0x34cf49){return _0x34cf49['update']({'UserId':_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')],'read1stAt':_[_0x49c4('0x58')](_0x34cf49[_0x49c4('0x74')])?moment()['format'](_0x49c4('0x6f')):undefined});}return null;})[_0x49c4('0x12')](function(_0x2ceada){if(_0x2ceada){_0x4a85d4[_0x49c4('0x75')]=_0x2ceada[_0x49c4('0x72')]({'plain':!![]});interaction_log[_0x49c4('0x13')](_0x49c4('0x76'),_0x4d6aaa[_0x49c4('0x5d')]['id'],_0x4d6aaa[_0x49c4('0x5d')][_0x49c4('0x29')],_0x4d6aaa['user'][_0x49c4('0x77')],_0x4a85d4[_0x49c4('0x75')]['id'],_0x4d6aaa['body']?JSON[_0x49c4('0x18')](_0x4d6aaa['body']):_0x49c4('0x78'));return respondWithRpcPromise(_0x49c4('0x79'),_0x49c4('0x7a'),_0x4a85d4);}return null;})[_0x49c4('0x12')](function(_0x2c32c0){var _0x58b90c=_0x49c4('0x7b')+_0x2c32c0[_0x49c4('0x1b')]['ContactId'];return db[_0x49c4('0x7c')][_0x49c4('0x32')](_0x58b90c,{'type':db['Sequelize'][_0x49c4('0x7d')][_0x49c4('0x7e')],'raw':!![]})['then'](function(_0x37fef1){return _0x37fef1;});})[_0x49c4('0x12')](function(_0x25989a){if(_0x25989a){_0x4a85d4[_0x49c4('0x1b')]['contact']=_0x25989a[0x0];if(!_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x70')])return;return db['User'][_0x49c4('0x4a')]({'where':{'id':_0x4d6aaa['body']['UserId'],'role':_0x49c4('0x71')},'attributes':['id','name','fullname',_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})['then'](function(_0x23e684){if(!_0x23e684)return null;_0x4a85d4['message']['agent']=_0x23e684;return _0x4a85d4;})['then'](function(_0x10d107){if(_0x10d107){if(_0x4d6aaa[_0x49c4('0x49')][_0x49c4('0x81')]){_0x4a85d4[_0x49c4('0x1b')]['interface']=util['format'](_0x49c4('0x82'),_0x4d6aaa['user'][_0x49c4('0x29')]);_0x4a85d4['message'][_0x49c4('0x83')]=_0x4a85d4[_0x49c4('0x83')];_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x84')]=_0x49c4('0x6a');_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]=htmlToText['fromString'](_0x4a85d4[_0x49c4('0x1b')][_0x49c4('0x49')]);return respondWithRpcPromise(_0x49c4('0x85'),_0x49c4('0x85'),{'event':_0x49c4('0x86'),'message':_0x4a85d4['message']},client9002)[_0x49c4('0x12')](function(){return _0x4a85d4;});}return _0x4a85d4;}return null;})[_0x49c4('0x12')](respondWithResult(_0x5a14a5,null))[_0x49c4('0x1d')](handleError(_0x5a14a5,null));};exports['reject']=function(_0x530ff2,_0xbfff7){var _0x27b31d={'agent':{},'channel':_0x49c4('0x6b')};if(_0x530ff2[_0x49c4('0x49')]['id']){delete _0x530ff2[_0x49c4('0x49')]['id'];}_0x530ff2['body'][_0x49c4('0x70')]=_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')]||_0x530ff2[_0x49c4('0x5d')]['id'];_0x27b31d['agent']['id']=_0x530ff2['body'][_0x49c4('0x70')];return db[_0x49c4('0x2d')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x47')]['id'],'UserId':null}})[_0x49c4('0x12')](handleEntityNotFound(_0xbfff7,null))['then'](function(_0x389edb){if(_0x389edb){_0x27b31d[_0x49c4('0x1b')]=_0x389edb[_0x49c4('0x72')]({'plain':!![]});return db[_0x49c4('0x73')][_0x49c4('0x4a')]({'where':{'id':_0x389edb[_0x49c4('0x87')]}});}return null;})['then'](handleEntityNotFound(_0xbfff7,null))[_0x49c4('0x12')](function(_0x1c90ba){if(_0x1c90ba){_0x27b31d[_0x49c4('0x75')]=_0x1c90ba[_0x49c4('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x530ff2[_0x49c4('0x5d')]['id'],_0x530ff2['user'][_0x49c4('0x29')],_0x530ff2['user'][_0x49c4('0x77')],_0x27b31d[_0x49c4('0x75')]['id'],_0x530ff2[_0x49c4('0x49')]?JSON[_0x49c4('0x18')](_0x530ff2['body']):'null');return respondWithRpcPromise(_0x49c4('0x88'),_0x49c4('0x89'),_0x27b31d);}return null;})[_0x49c4('0x12')](function(_0x5f0116){var _0x4c0e9c=_0x49c4('0x7b')+_0x5f0116['message']['ContactId'];return db[_0x49c4('0x7c')]['query'](_0x4c0e9c,{'type':db[_0x49c4('0x8a')][_0x49c4('0x7d')]['SELECT'],'raw':!![]})[_0x49c4('0x12')](function(_0x45474e){return _0x45474e;});})['then'](function(_0x5428a9){if(_0x5428a9){_0x27b31d[_0x49c4('0x1b')]['contact']=_0x5428a9[0x0];if(!_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')])return;return db[_0x49c4('0x8b')][_0x49c4('0x4a')]({'where':{'id':_0x530ff2[_0x49c4('0x49')][_0x49c4('0x70')],'role':_0x49c4('0x71')},'attributes':['id','name',_0x49c4('0x8c'),_0x49c4('0x7f'),_0x49c4('0x80')],'raw':!![]});}return null;})[_0x49c4('0x12')](function(_0x3107c9){if(!_0x3107c9)return null;_0x27b31d['message'][_0x49c4('0x71')]=_0x3107c9;return _0x27b31d;})['then'](function(_0xb66e67){if(_0xb66e67){_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x8d')]=util[_0x49c4('0x6e')]('SIP/%s',_0x530ff2[_0x49c4('0x5d')][_0x49c4('0x29')]);_0xb66e67[_0x49c4('0x1b')][_0x49c4('0x83')]=_0x27b31d[_0x49c4('0x83')];_0xb66e67[_0x49c4('0x1b')]['event']=_0x49c4('0x8e');_0xb66e67['message'][_0x49c4('0x49')]=htmlToText[_0x49c4('0x8f')](_0x27b31d[_0x49c4('0x1b')][_0x49c4('0x49')]);respondWithRpcPromise('EventManager',_0x49c4('0x85'),{'event':_0x49c4('0x90'),'message':_0xb66e67['message']},client9002);return _0x27b31d;}return null;})[_0x49c4('0x12')](respondWithResult(_0xbfff7,null))[_0x49c4('0x1d')](handleError(_0xbfff7,null));};exports['download']=function(_0x562f47,_0x25f1c7){var _0x3e5915=moment()[_0x49c4('0x91')]()[_0x49c4('0x92')]();var _0x32afd4=path[_0x49c4('0x93')](config[_0x49c4('0x61')],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x96'));var _0x269613=path['join'](config['root'],_0x49c4('0x94'),_0x49c4('0x95'),_0x49c4('0x60'));var _0x5be042=util[_0x49c4('0x6e')](_0x49c4('0x97'),_0x3e5915);return db['MailMessage'][_0x49c4('0x4a')]({'where':{'id':_0x562f47['params']['id']},'attributes':['id',_0x49c4('0x49'),_0x49c4('0x98'),'to','cc',_0x49c4('0x99'),_0x49c4('0x9a'),'createdAt'],'include':_0x562f47[_0x49c4('0x32')][_0x49c4('0x60')]?[{'model':db[_0x49c4('0x9b')],'as':_0x49c4('0x9c')}]:undefined})[_0x49c4('0x12')](handleEntityNotFound(_0x25f1c7,null))['then'](function(_0x5a4e00){if(_0x5a4e00){var _0x5f4d82=_0x5a4e00;var _0x1856c7={'from':_0x5f4d82[_0x49c4('0x98')],'to':_0x5f4d82['to'],'subject':_0x5f4d82[_0x49c4('0x9a')],'html':_0x5f4d82[_0x49c4('0x49')],'headers':{'Date':moment(_0x5f4d82[_0x49c4('0x9d')])['format'](_0x49c4('0x9e'))},'attachments':[]};if(_0x5a4e00['cc']){_0x1856c7[_0x49c4('0x9f')]['Cc']=_0x5a4e00['cc'];}if(_0x5a4e00[_0x49c4('0x99')]){_0x1856c7[_0x49c4('0x9f')]['Bcc']=_0x5a4e00[_0x49c4('0x99')];}return new BPromise(function(_0x5bfccd,_0x10fa42){if(_0x5a4e00[_0x49c4('0x9c')]){for(var _0x2fda4f=0x0;_0x2fda4f<_0x5a4e00['Attachments'][_0x49c4('0x48')];_0x2fda4f++){var _0x9b622d=_0x5a4e00[_0x49c4('0x9c')][_0x2fda4f];var _0x494c7f=path[_0x49c4('0x93')](_0x269613,_0x9b622d[_0x49c4('0x63')]);if(fs[_0x49c4('0xa0')](_0x494c7f)){_0x1856c7['attachments'][_0x49c4('0xa1')]({'name':_0x9b622d['name'],'contentType':_0x9b622d['type'],'data':fs[_0x49c4('0xa2')](_0x494c7f)});}}}emlformat[_0x49c4('0xa3')](_0x1856c7,function(_0x4ef4aa,_0x815b34){if(_0x4ef4aa)return _0x10fa42(_0x4ef4aa);fs[_0x49c4('0xa4')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x815b34);return _0x5bfccd(_0x815b34);});});}})[_0x49c4('0x12')](function(_0x10f5fc){if(_0x10f5fc){return _0x25f1c7[_0x49c4('0xa5')](path[_0x49c4('0x93')](_0x32afd4,_0x5be042),_0x5be042,function(_0x219133){if(!_0x219133)fs['unlinkSync'](path['join'](_0x32afd4,_0x5be042));});}})[_0x49c4('0x1d')](handleError(_0x25f1c7,null));};
\ No newline at end of file
index 669658f..ea3e35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc588=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x2efccf,_0x6d7311){var _0x433d78=function(_0xc68641){while(--_0xc68641){_0x2efccf['push'](_0x2efccf['shift']());}};_0x433d78(++_0x6d7311);}(_0xc588,0x1e3));var _0x8c58=function(_0x5cf53d,_0x29d8be){_0x5cf53d=_0x5cf53d-0x0;var _0x2c5588=_0xc588[_0x5cf53d];return _0x2c5588;};'use strict';var EventEmitter=require(_0x8c58('0x0'));var MailMessage=require(_0x8c58('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8c58('0x2')](0x0);var events={'afterCreate':_0x8c58('0x3'),'afterUpdate':_0x8c58('0x4'),'afterDestroy':_0x8c58('0x5')};function emitEvent(_0x5c99ad){return function(_0x478cf2,_0x24b430,_0x3b38dc){MailMessageEvents[_0x8c58('0x6')](_0x5c99ad+':'+_0x478cf2['id'],_0x478cf2);MailMessageEvents[_0x8c58('0x6')](_0x5c99ad,_0x478cf2);_0x3b38dc(null);};}for(var e in events){if(events[_0x8c58('0x7')](e)){var event=events[e];MailMessage[_0x8c58('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x61e4=['MailMessage','setMaxListeners','save','update','hasOwnProperty','hook','../../mysqldb'];(function(_0x34ce8c,_0x526c3c){var _0x31bde5=function(_0x302a21){while(--_0x302a21){_0x34ce8c['push'](_0x34ce8c['shift']());}};_0x31bde5(++_0x526c3c);}(_0x61e4,0xfb));var _0x461e=function(_0x3e5d32,_0x19ce13){_0x3e5d32=_0x3e5d32-0x0;var _0x3e7822=_0x61e4[_0x3e5d32];return _0x3e7822;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x461e('0x0'))['db'][_0x461e('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x461e('0x2')](0x0);var events={'afterCreate':_0x461e('0x3'),'afterUpdate':_0x461e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x286a3c){return function(_0x1b2812,_0x3b0dad,_0x3bb748){MailMessageEvents['emit'](_0x286a3c+':'+_0x1b2812['id'],_0x1b2812);MailMessageEvents['emit'](_0x286a3c,_0x1b2812);_0x3bb748(null);};}for(var e in events){if(events[_0x461e('0x5')](e)){var event=events[e];MailMessage[_0x461e('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index d2d9ba5..3aacfbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f57=['toLowerCase','out','secret','isNil','UserId','MailInteractionId','then','update','catch','error','utf8mb4','util','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','models','get','direction'];(function(_0x10a8fd,_0x2266f1){var _0x40c24f=function(_0x2d47b8){while(--_0x2d47b8){_0x10a8fd['push'](_0x10a8fd['shift']());}};_0x40c24f(++_0x2266f1);}(_0x8f57,0x19e));var _0x78f5=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x8f57[_0x19aa84];return _0x536146;};'use strict';var _=require('lodash');var util=require(_0x78f5('0x0'));var logger=require('../../config/logger')(_0x78f5('0x1'));var moment=require(_0x78f5('0x2'));var BPromise=require(_0x78f5('0x3'));var rp=require(_0x78f5('0x4'));var htmlToText=require(_0x78f5('0x5'));var fs=require('fs');var path=require(_0x78f5('0x6'));var rimraf=require('rimraf');var config=require(_0x78f5('0x7'));var attributes=require(_0x78f5('0x8'));module[_0x78f5('0x9')]=function(_0x20f13c,_0xdf27ce){return _0x20f13c[_0x78f5('0xa')]('MailMessage',attributes,{'tableName':_0x78f5('0xb'),'paranoid':![],'indexes':[{'name':_0x78f5('0xc'),'fields':[_0x78f5('0xc')]},{'name':_0x78f5('0xd'),'fields':[_0x78f5('0xe'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x186c9d,_0x27dfff,_0x45b69a){if(_0x186c9d[_0x78f5('0xf')]){_0x186c9d[_0x78f5('0xe')]=htmlToText[_0x78f5('0x10')](_0x186c9d[_0x78f5('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x45b69a(null,_0x27dfff);},'afterCreate':function(_0x49380d,_0x588075,_0x3d0656){var _0x561f0f=_0x20f13c[_0x78f5('0x11')];var _0xb53af9=_0x49380d[_0x78f5('0x12')]({'plain':!![]});if(_0xb53af9[_0x78f5('0x13')]['toLowerCase']()==='in'||_0xb53af9['direction'][_0x78f5('0x14')]()===_0x78f5('0x15')&&!_0xb53af9[_0x78f5('0x16')]&&!_[_0x78f5('0x17')](_0xb53af9[_0x78f5('0x18')])){_0x561f0f['MailInteraction']['findOne']({'where':{'id':_0xb53af9[_0x78f5('0x19')]}})[_0x78f5('0x1a')](function(_0x58cdfe){if(_0x58cdfe){_0x58cdfe[_0x78f5('0x1b')]({'lastMsgAt':_0xb53af9['createdAt'],'lastMsgDirection':_0xb53af9[_0x78f5('0x13')][_0x78f5('0x14')]()});}})[_0x78f5('0x1c')](function(_0x328e8a){console[_0x78f5('0x1d')](_0x328e8a);});}_0x3d0656();}},'charset':_0x78f5('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9d2e=['exports','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','fromString','get','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x5016c9,_0x57cdf0){var _0x5371ee=function(_0x494af9){while(--_0x494af9){_0x5016c9['push'](_0x5016c9['shift']());}};_0x5371ee(++_0x57cdf0);}(_0x9d2e,0x155));var _0xe9d2=function(_0x2c86e0,_0x5a3dac){_0x2c86e0=_0x2c86e0-0x0;var _0x10aa30=_0x9d2e[_0x2c86e0];return _0x10aa30;};'use strict';var _=require(_0xe9d2('0x0'));var util=require(_0xe9d2('0x1'));var logger=require(_0xe9d2('0x2'))(_0xe9d2('0x3'));var moment=require(_0xe9d2('0x4'));var BPromise=require(_0xe9d2('0x5'));var rp=require(_0xe9d2('0x6'));var htmlToText=require(_0xe9d2('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9d2('0x8'));var config=require(_0xe9d2('0x9'));var attributes=require(_0xe9d2('0xa'));module[_0xe9d2('0xb')]=function(_0x109712,_0x25057a){return _0x109712['define'](_0xe9d2('0xc'),attributes,{'tableName':_0xe9d2('0xd'),'paranoid':![],'indexes':[{'name':_0xe9d2('0xe'),'fields':['messageId']},{'name':'fti_mail_messages','fields':['plainBody',_0xe9d2('0xf')],'type':_0xe9d2('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15ae84,_0x335f19,_0xf5f5b4){if(_0x15ae84[_0xe9d2('0x11')]){_0x15ae84['plainBody']=htmlToText[_0xe9d2('0x12')](_0x15ae84['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xf5f5b4(null,_0x335f19);},'afterCreate':function(_0x4eedd1,_0x3ac7d4,_0x1a6e63){var _0x5ba9b9=_0x109712['models'];var _0x2ddafd=_0x4eedd1[_0xe9d2('0x13')]({'plain':!![]});if(_0x2ddafd['direction']['toLowerCase']()==='in'||_0x2ddafd['direction']['toLowerCase']()===_0xe9d2('0x14')&&!_0x2ddafd['secret']&&!_[_0xe9d2('0x15')](_0x2ddafd[_0xe9d2('0x16')])){_0x5ba9b9[_0xe9d2('0x17')][_0xe9d2('0x18')]({'where':{'id':_0x2ddafd[_0xe9d2('0x19')]}})[_0xe9d2('0x1a')](function(_0x17396b){if(_0x17396b){_0x17396b[_0xe9d2('0x1b')]({'lastMsgAt':_0x2ddafd[_0xe9d2('0x1c')],'lastMsgDirection':_0x2ddafd['direction']['toLowerCase']()});}})['catch'](function(_0xbbc1fd){console[_0xe9d2('0x1d')](_0xbbc1fd);});}_0x1a6e63();}},'charset':_0xe9d2('0x1e'),'collate':_0xe9d2('0x1f')});};
\ No newline at end of file
index 7b84264..640ab3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5464=['localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateMailMessage','MailMessage','body','options','raw','then','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x5464,0x15d));var _0x4546=function(_0x57a31e,_0x2e63a3){_0x57a31e=_0x57a31e-0x0;var _0x39591f=_0x5464[_0x57a31e];return _0x39591f;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4546('0x9')](config[_0x4546('0xa')],{'host':_0x4546('0xb'),'port':0x18eb});var socket=require(_0x4546('0xc'))(new Redis(config[_0x4546('0xa')]));require(_0x4546('0xd'))[_0x4546('0xe')](socket);function respondWithRpcPromise(_0x430b2e,_0x383bf2,_0x4ac723){return new BPromise(function(_0x1dd3f5,_0x8a15e2){return client[_0x4546('0xf')](_0x430b2e,_0x4ac723)['then'](function(_0x1f82c9){logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,_0x4546('0x12'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x383bf2,_0x4546('0x12'),JSON['stringify'](_0x1f82c9));if(_0x1f82c9['error']){if(_0x1f82c9['error']['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')]['message']);return _0x8a15e2(_0x1f82c9[_0x4546('0x13')]['message']);}logger[_0x4546('0x13')]('MailMessage,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);return _0x1dd3f5(_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);}else{logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,'request\x20sent');_0x1dd3f5(_0x1f82c9['result']['message']);}})[_0x4546('0x15')](function(_0x39f552){logger[_0x4546('0x13')](_0x4546('0x11'),_0x383bf2,_0x39f552);_0x8a15e2(_0x39f552);});});}exports[_0x4546('0x16')]=function(_0x337a44){var _0x3ec009=this;return new Promise(function(_0x2f6329,_0x4034a5){return db[_0x4546('0x17')]['create'](_0x337a44[_0x4546('0x18')],{'raw':_0x337a44[_0x4546('0x19')]?_0x337a44['options'][_0x4546('0x1a')]===undefined?!![]:![]:!![]})[_0x4546('0x1b')](function(_0x1a1984){logger[_0x4546('0x10')](_0x4546('0x16'),_0x337a44);logger[_0x4546('0x1c')]('CreateMailMessage',_0x337a44,JSON[_0x4546('0x1d')](_0x1a1984));_0x2f6329(_0x1a1984);})[_0x4546('0x15')](function(_0x4f9fcf){logger[_0x4546('0x13')](_0x4546('0x16'),_0x4f9fcf[_0x4546('0x14')],_0x337a44);_0x4034a5(_0x3ec009[_0x4546('0x13')](0x1f4,_0x4f9fcf[_0x4546('0x14')]));});});};
\ No newline at end of file
+var _0x282b=['MailMessage','body','options','CreateMailMessage','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x398c03,_0x41b686){var _0x3722df=function(_0x282745){while(--_0x282745){_0x398c03['push'](_0x398c03['shift']());}};_0x3722df(++_0x41b686);}(_0x282b,0xec));var _0xb282=function(_0x1d9ef2,_0x53bd86){_0x1d9ef2=_0x1d9ef2-0x0;var _0x1610ae=_0x282b[_0x1d9ef2];return _0x1610ae;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});config[_0xb282('0xb')]=_['defaults'](config['redis'],{'host':_0xb282('0xc'),'port':0x18eb});var socket=require(_0xb282('0xd'))(new Redis(config['redis']));require(_0xb282('0xe'))[_0xb282('0xf')](socket);function respondWithRpcPromise(_0x3435fc,_0x2d86ba,_0x56caf2){return new BPromise(function(_0x47e62e,_0x36b984){return client[_0xb282('0x10')](_0x3435fc,_0x56caf2)[_0xb282('0x11')](function(_0x1cbe28){logger[_0xb282('0x12')]('MailMessage,\x20%s,\x20%s',_0x2d86ba,'request\x20sent');logger[_0xb282('0x13')](_0xb282('0x14'),_0x2d86ba,_0xb282('0x15'),JSON[_0xb282('0x16')](_0x1cbe28));if(_0x1cbe28[_0xb282('0x17')]){if(_0x1cbe28['error'][_0xb282('0x18')]===0x1f4){logger['error'](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')]['message']);return _0x36b984(_0x1cbe28['error']['message']);}logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')][_0xb282('0x1a')]);return _0x47e62e(_0x1cbe28[_0xb282('0x17')]['message']);}else{logger[_0xb282('0x12')](_0xb282('0x19'),_0x2d86ba,_0xb282('0x15'));_0x47e62e(_0x1cbe28[_0xb282('0x1b')][_0xb282('0x1a')]);}})['catch'](function(_0x52e305){logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x52e305);_0x36b984(_0x52e305);});});}exports['CreateMailMessage']=function(_0x89543a){var _0x34b6c7=this;return new Promise(function(_0x2e3928,_0x438dbe){return db[_0xb282('0x1c')]['create'](_0x89543a[_0xb282('0x1d')],{'raw':_0x89543a[_0xb282('0x1e')]?_0x89543a[_0xb282('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xb282('0x11')](function(_0x2a7ef8){logger[_0xb282('0x12')](_0xb282('0x1f'),_0x89543a);logger[_0xb282('0x13')]('CreateMailMessage',_0x89543a,JSON['stringify'](_0x2a7ef8));_0x2e3928(_0x2a7ef8);})[_0xb282('0x20')](function(_0x3c7f1f){logger['error']('CreateMailMessage',_0x3c7f1f[_0xb282('0x1a')],_0x89543a);_0x438dbe(_0x34b6c7[_0xb282('0x17')](0x1f4,_0x3c7f1f[_0xb282('0x1a')]));});});};
\ No newline at end of file
index 6462177..d6754e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e1d=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9e1d,0x12e));var _0xd9e1=function(_0x48d130,_0xaa557b){_0x48d130=_0x48d130-0x0;var _0x37ebe9=_0x9e1d[_0x48d130];return _0x37ebe9;};'use strict';var MailMessageEvents=require(_0xd9e1('0x0'));var events=[_0xd9e1('0x1'),_0xd9e1('0x2'),_0xd9e1('0x3')];function createListener(_0x5d615f,_0x389dfd){return function(_0x40d737){_0x389dfd['emit'](_0x5d615f,_0x40d737);};}function removeListener(_0x18b2b0,_0x952ebd){return function(){MailMessageEvents[_0xd9e1('0x4')](_0x18b2b0,_0x952ebd);};}exports[_0xd9e1('0x5')]=function(_0x55a50c){for(var _0x4e1888=0x0,_0x2ea738=events['length'];_0x4e1888<_0x2ea738;_0x4e1888++){var _0x2dafdb=events[_0x4e1888];var _0x2a99be=createListener(_0xd9e1('0x6')+_0x2dafdb,_0x55a50c);MailMessageEvents['on'](_0x2dafdb,_0x2a99be);}};
\ No newline at end of file
+var _0x761a=['length','mailMessage:','save','emit'];(function(_0x48eae4,_0x3aae3e){var _0x3a8ad2=function(_0x136803){while(--_0x136803){_0x48eae4['push'](_0x48eae4['shift']());}};_0x3a8ad2(++_0x3aae3e);}(_0x761a,0xe2));var _0xa761=function(_0x4c78ee,_0x1202fa){_0x4c78ee=_0x4c78ee-0x0;var _0x1124b8=_0x761a[_0x4c78ee];return _0x1124b8;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xa761('0x0'),'remove','update'];function createListener(_0x2667ab,_0x2a2bbc){return function(_0x486f1c){_0x2a2bbc[_0xa761('0x1')](_0x2667ab,_0x486f1c);};}function removeListener(_0x2b0aef,_0x2bbe21){return function(){MailMessageEvents['removeListener'](_0x2b0aef,_0x2bbe21);};}exports['register']=function(_0x16bcf1){for(var _0x4d7b83=0x0,_0x46bf9a=events[_0xa761('0x2')];_0x4d7b83<_0x46bf9a;_0x4d7b83++){var _0x29db19=events[_0x4d7b83];var _0x453ad2=createListener(_0xa761('0x3')+_0x29db19,_0x16bcf1);MailMessageEvents['on'](_0x29db19,_0x453ad2);}};
\ No newline at end of file
index d2f3808..a54f604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc01=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','/:id','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc01,0x16c));var _0x1dc0=function(_0x1d3240,_0xd0457b){_0x1d3240=_0x1d3240-0x0;var _0x585460=_0xdc01[_0x1d3240];return _0x585460;};'use strict';var multer=require('multer');var util=require(_0x1dc0('0x0'));var path=require(_0x1dc0('0x1'));var timeout=require(_0x1dc0('0x2'));var express=require(_0x1dc0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dc0('0x4'));var interaction=require(_0x1dc0('0x5'));var config=require(_0x1dc0('0x6'));var controller=require(_0x1dc0('0x7'));router[_0x1dc0('0x8')]('/',auth[_0x1dc0('0x9')](),controller['index']);router[_0x1dc0('0x8')](_0x1dc0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x1dc0('0x8')]('/:id',auth[_0x1dc0('0x9')](),controller['show']);router[_0x1dc0('0x8')]('/:id/members',auth[_0x1dc0('0x9')](),controller[_0x1dc0('0xb')]);router[_0x1dc0('0x8')](_0x1dc0('0xc'),auth[_0x1dc0('0x9')](),controller[_0x1dc0('0xd')]);router['get'](_0x1dc0('0xe'),auth[_0x1dc0('0x9')](),controller['getAgents']);router[_0x1dc0('0xf')]('/',auth['isAuthenticated'](),controller[_0x1dc0('0x10')]);router[_0x1dc0('0xf')](_0x1dc0('0xc'),auth[_0x1dc0('0x9')](),controller[_0x1dc0('0x11')]);router['post'](_0x1dc0('0xe'),auth[_0x1dc0('0x9')](),controller['addAgents']);router[_0x1dc0('0x12')](_0x1dc0('0x13'),auth[_0x1dc0('0x9')](),controller[_0x1dc0('0x14')]);router[_0x1dc0('0x15')](_0x1dc0('0x13'),auth[_0x1dc0('0x9')](),controller['destroy']);router['delete'](_0x1dc0('0xc'),auth[_0x1dc0('0x9')](),controller[_0x1dc0('0x16')]);router['delete'](_0x1dc0('0xe'),auth[_0x1dc0('0x9')](),controller[_0x1dc0('0x17')]);module[_0x1dc0('0x18')]=router;
\ No newline at end of file
+var _0xd3f7=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express'];(function(_0xa89fa4,_0x479b08){var _0x1baf5a=function(_0x55006d){while(--_0x55006d){_0xa89fa4['push'](_0xa89fa4['shift']());}};_0x1baf5a(++_0x479b08);}(_0xd3f7,0x83));var _0x7d3f=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0xd3f7[_0x34325b];return _0x3da348;};'use strict';var multer=require('multer');var util=require(_0x7d3f('0x0'));var path=require(_0x7d3f('0x1'));var timeout=require(_0x7d3f('0x2'));var express=require(_0x7d3f('0x3'));var router=express['Router']();var fs_extra=require(_0x7d3f('0x4'));var auth=require(_0x7d3f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7d3f('0x6'));var controller=require('./mailQueue.controller');router[_0x7d3f('0x7')]('/',auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x9')]);router[_0x7d3f('0x7')]('/describe',auth[_0x7d3f('0x8')](),controller[_0x7d3f('0xa')]);router[_0x7d3f('0x7')](_0x7d3f('0xb'),auth['isAuthenticated'](),controller[_0x7d3f('0xc')]);router[_0x7d3f('0x7')]('/:id/members',auth[_0x7d3f('0x8')](),controller[_0x7d3f('0xd')]);router['get'](_0x7d3f('0xe'),auth[_0x7d3f('0x8')](),controller[_0x7d3f('0xf')]);router[_0x7d3f('0x7')]('/:id/users',auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x10')]);router[_0x7d3f('0x11')]('/',auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x12')]);router['post'](_0x7d3f('0xe'),auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x13')]);router[_0x7d3f('0x11')](_0x7d3f('0x14'),auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x15')]);router['put'](_0x7d3f('0xb'),auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x16')]);router[_0x7d3f('0x17')](_0x7d3f('0xb'),auth['isAuthenticated'](),controller[_0x7d3f('0x18')]);router['delete'](_0x7d3f('0xe'),auth[_0x7d3f('0x8')](),controller[_0x7d3f('0x19')]);router[_0x7d3f('0x17')](_0x7d3f('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7d3f('0x1a')]=router;
\ No newline at end of file
index ee1ead5..f18cfa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0079=['STRING','rrmemory','beepall','roundrobin'];(function(_0x1f7449,_0x2dd671){var _0x3f77c0=function(_0x11c4bb){while(--_0x11c4bb){_0x1f7449['push'](_0x1f7449['shift']());}};_0x3f77c0(++_0x2dd671);}(_0x0079,0x70));var _0x9007=function(_0x1a9234,_0x8017a9){_0x1a9234=_0x1a9234-0x0;var _0x17c03c=_0x0079[_0x1a9234];return _0x17c03c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9007('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9007('0x1'),_0x9007('0x2'),_0x9007('0x3'))}};
\ No newline at end of file
+var _0x59f9=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x4c3a31,_0x2efb1c){var _0x23e119=function(_0x349646){while(--_0x349646){_0x4c3a31['push'](_0x4c3a31['shift']());}};_0x23e119(++_0x2efb1c);}(_0x59f9,0xc9));var _0x959f=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0x59f9[_0x3f25db];return _0x54f29d;};'use strict';var Sequelize=require(_0x959f('0x0'));module[_0x959f('0x1')]={'name':{'type':Sequelize[_0x959f('0x2')],'unique':_0x959f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x959f('0x2')]},'timeout':{'type':Sequelize[_0x959f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x959f('0x5')](_0x959f('0x6'),'beepall',_0x959f('0x7'))}};
\ No newline at end of file
index 40227c8..cf39ce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x819c=['attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','MailQueue','count','includeAll','include','findAll','catch','keys','find','create','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','mailPause','createdAt','rows','SIP','updatedAt','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','get','MailQueues','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields'];(function(_0x4f5203,_0x2212a2){var _0x1ec395=function(_0x4c03ac){while(--_0x4c03ac){_0x4f5203['push'](_0x4f5203['shift']());}};_0x1ec395(++_0x2212a2);}(_0x819c,0x168));var _0xc819=function(_0x5a240a,_0x72cee0){_0x5a240a=_0x5a240a-0x0;var _0x2f9267=_0x819c[_0x5a240a];return _0x2f9267;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc819('0x0'));var zipdir=require(_0xc819('0x1'));var jsonpatch=require(_0xc819('0x2'));var rp=require(_0xc819('0x3'));var moment=require(_0xc819('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc819('0x5'));var util=require(_0xc819('0x6'));var path=require(_0xc819('0x7'));var sox=require('sox');var csv=require(_0xc819('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc819('0x9'));var _=require(_0xc819('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc819('0xb'));var deskjs=require(_0xc819('0xc'));var toCsv=require(_0xc819('0x8'));var querystring=require(_0xc819('0xd'));var Papa=require(_0xc819('0xe'));var Redis=require('ioredis');var authService=require(_0xc819('0xf'));var qs=require(_0xc819('0x10'));var as=require(_0xc819('0x11'));var hardwareService=require(_0xc819('0x12'));var logger=require(_0xc819('0x13'))(_0xc819('0x14'));var utils=require(_0xc819('0x15'));var config=require(_0xc819('0x16'));var licenseUtil=require(_0xc819('0x17'));var db=require(_0xc819('0x18'))['db'];config[_0xc819('0x19')]=_[_0xc819('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc819('0x19')]));require(_0xc819('0x1b'))[_0xc819('0x1c')](socket);function respondWithStatusCode(_0x17b0d5,_0x29b327){_0x29b327=_0x29b327||0xcc;return function(_0x5b8df5){if(_0x5b8df5){return _0x17b0d5[_0xc819('0x1d')](_0x29b327);}return _0x17b0d5[_0xc819('0x1e')](_0x29b327)['end']();};}function respondWithResult(_0x1085ac,_0x200459){_0x200459=_0x200459||0xc8;return function(_0x18f8f1){if(_0x18f8f1){return _0x1085ac[_0xc819('0x1e')](_0x200459)[_0xc819('0x1f')](_0x18f8f1);}};}function respondWithFilteredResult(_0x3e71fb,_0x259c17){return function(_0xc69e30){if(_0xc69e30){var _0x77e9a3=typeof _0x259c17[_0xc819('0x20')]===_0xc819('0x21')&&typeof _0x259c17[_0xc819('0x22')]===_0xc819('0x21');var _0x24ad86=_0xc69e30['count'];var _0x59fd89=_0x77e9a3?0x0:_0x259c17[_0xc819('0x20')];var _0x26c262=_0x77e9a3?_0xc69e30['count']:_0x259c17[_0xc819('0x20')]+_0x259c17[_0xc819('0x22')];var _0x4e97f8;if(_0x26c262>=_0x24ad86){_0x26c262=_0x24ad86;_0x4e97f8=0xc8;}else{_0x4e97f8=0xce;}_0x3e71fb[_0xc819('0x1e')](_0x4e97f8);return _0x3e71fb[_0xc819('0x23')](_0xc819('0x24'),_0x59fd89+'-'+_0x26c262+'/'+_0x24ad86)[_0xc819('0x1f')](_0xc69e30);}return null;};}function patchUpdates(_0x52d000){return function(_0x4a149e){try{jsonpatch[_0xc819('0x25')](_0x4a149e,_0x52d000,!![]);}catch(_0x4feb9d){return BPromise[_0xc819('0x26')](_0x4feb9d);}return _0x4a149e[_0xc819('0x27')]();};}function saveUpdates(_0x6851e2,_0xe14b40){return function(_0x43dcd4){if(_0x43dcd4){return _0x43dcd4['update'](_0x6851e2)[_0xc819('0x28')](function(_0x38ee2b){return _0x38ee2b;});}return null;};}function removeEntity(_0x36089b,_0x3db55c){return function(_0x397058){if(_0x397058){return _0x397058['destroy']()[_0xc819('0x28')](function(){var _0x3acb0e=_0x397058[_0xc819('0x29')]({'plain':!![]});var _0x3ca12f=_0xc819('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ca12f,'resourceId':_0x3acb0e['id']}})[_0xc819('0x28')](function(){return _0x397058;});})[_0xc819('0x28')](function(){_0x36089b[_0xc819('0x1e')](0xcc)[_0xc819('0x2b')]();});}};}function handleEntityNotFound(_0x32f6f8,_0x26db84){return function(_0x3b136a){if(!_0x3b136a){_0x32f6f8[_0xc819('0x1d')](0x194);}return _0x3b136a;};}function handleError(_0x5e69bc,_0x8cecea){_0x8cecea=_0x8cecea||0x1f4;return function(_0x965e20){logger[_0xc819('0x2c')](_0x965e20[_0xc819('0x2d')]);if(_0x965e20[_0xc819('0x2e')]){delete _0x965e20[_0xc819('0x2e')];}_0x5e69bc['status'](_0x8cecea)[_0xc819('0x2f')](_0x965e20);};}exports[_0xc819('0x30')]=function(_0x11b8a1,_0x2db743){var _0x499187={},_0x594577={},_0x328d61={'count':0x0,'rows':[]};var _0x55be53=_[_0xc819('0x31')](db['MailQueue'][_0xc819('0x32')],function(_0x1b2661){return{'name':_0x1b2661['fieldName'],'type':_0x1b2661[_0xc819('0x33')][_0xc819('0x34')]};});_0x594577[_0xc819('0x35')]=_[_0xc819('0x31')](_0x55be53,_0xc819('0x2e'));_0x594577['query']=_['keys'](_0x11b8a1[_0xc819('0x36')]);_0x594577['filters']=_[_0xc819('0x37')](_0x594577['model'],_0x594577['query']);_0x499187['attributes']=_[_0xc819('0x37')](_0x594577['model'],qs['fields'](_0x11b8a1[_0xc819('0x36')][_0xc819('0x38')]));_0x499187[_0xc819('0x39')]=_0x499187['attributes'][_0xc819('0x3a')]?_0x499187[_0xc819('0x39')]:_0x594577[_0xc819('0x35')];if(!_0x11b8a1[_0xc819('0x36')][_0xc819('0x3b')](_0xc819('0x3c'))){_0x499187['limit']=qs['limit'](_0x11b8a1[_0xc819('0x36')]['limit']);_0x499187[_0xc819('0x20')]=qs[_0xc819('0x20')](_0x11b8a1['query'][_0xc819('0x20')]);}_0x499187['order']=qs[_0xc819('0x3d')](_0x11b8a1['query']['sort']);_0x499187[_0xc819('0x3e')]=qs[_0xc819('0x3f')](_[_0xc819('0x40')](_0x11b8a1[_0xc819('0x36')],_0x594577[_0xc819('0x3f')]),_0x55be53);if(_0x11b8a1[_0xc819('0x36')]['filter']){_0x499187['where']=_[_0xc819('0x41')](_0x499187[_0xc819('0x3e')],{'$or':_[_0xc819('0x31')](_0x55be53,function(_0x34532b){if(_0x34532b[_0xc819('0x33')]!=='VIRTUAL'){var _0x40348b={};_0x40348b[_0x34532b['name']]={'$like':'%'+_0x11b8a1['query'][_0xc819('0x42')]+'%'};return _0x40348b;}})});}_0x499187=_['merge']({},_0x499187,_0x11b8a1[_0xc819('0x43')]);var _0x3f6cc6={'where':_0x499187[_0xc819('0x3e')]};return db[_0xc819('0x44')][_0xc819('0x45')](_0x3f6cc6)['then'](function(_0x3cb253){_0x328d61[_0xc819('0x45')]=_0x3cb253;if(_0x11b8a1[_0xc819('0x36')][_0xc819('0x46')]){_0x499187[_0xc819('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0xc819('0x48')](_0x499187);})['then'](function(_0x3ef6cc){_0x328d61['rows']=_0x3ef6cc;return _0x328d61;})['then'](respondWithFilteredResult(_0x2db743,_0x499187))[_0xc819('0x49')](handleError(_0x2db743,null));};exports['show']=function(_0x2f7e91,_0x2b1b41){var _0x180902={'raw':!![],'where':{'id':_0x2f7e91['params']['id']}},_0x393efb={};_0x393efb[_0xc819('0x35')]=_[_0xc819('0x4a')](db['MailQueue'][_0xc819('0x32')]);_0x393efb[_0xc819('0x36')]=_[_0xc819('0x4a')](_0x2f7e91[_0xc819('0x36')]);_0x393efb['filters']=_[_0xc819('0x37')](_0x393efb['model'],_0x393efb[_0xc819('0x36')]);_0x180902[_0xc819('0x39')]=_['intersection'](_0x393efb[_0xc819('0x35')],qs[_0xc819('0x38')](_0x2f7e91[_0xc819('0x36')][_0xc819('0x38')]));_0x180902[_0xc819('0x39')]=_0x180902[_0xc819('0x39')][_0xc819('0x3a')]?_0x180902[_0xc819('0x39')]:_0x393efb['model'];if(_0x2f7e91[_0xc819('0x36')]['includeAll']){_0x180902['include']=[{'all':!![]}];}_0x180902=_[_0xc819('0x41')]({},_0x180902,_0x2f7e91[_0xc819('0x43')]);return db[_0xc819('0x44')][_0xc819('0x4b')](_0x180902)[_0xc819('0x28')](handleEntityNotFound(_0x2b1b41,null))['then'](respondWithResult(_0x2b1b41,null))['catch'](handleError(_0x2b1b41,null));};exports[_0xc819('0x4c')]=function(_0x218875,_0xd98f01){return db[_0xc819('0x44')][_0xc819('0x4c')](_0x218875[_0xc819('0x4d')],{})['then'](function(_0x47e212){var _0x3297f6=_0x218875['user'][_0xc819('0x29')]({'plain':!![]});if(!_0x3297f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3297f6[_0xc819('0x4e')]===_0xc819('0x4f')){var _0xfc0004=_0x47e212[_0xc819('0x29')]({'plain':!![]});var _0x1295e3=_0xc819('0x2a');return db['UserProfileSection'][_0xc819('0x4b')]({'where':{'name':_0x1295e3,'userProfileId':_0x3297f6[_0xc819('0x50')]},'raw':!![]})[_0xc819('0x28')](function(_0x1768a6){if(_0x1768a6&&_0x1768a6['autoAssociation']===0x0){return db['UserProfileResource'][_0xc819('0x4c')]({'name':_0xfc0004[_0xc819('0x2e')],'resourceId':_0xfc0004['id'],'type':_0x1768a6[_0xc819('0x2e')],'sectionId':_0x1768a6['id']},{})['then'](function(){return _0x47e212;});}else{return _0x47e212;}})[_0xc819('0x49')](function(_0x2cf93c){logger[_0xc819('0x2c')](_0xc819('0x51'),_0x2cf93c);throw _0x2cf93c;});}return _0x47e212;})[_0xc819('0x28')](respondWithResult(_0xd98f01,0xc9))[_0xc819('0x49')](handleError(_0xd98f01,null));};exports[_0xc819('0x52')]=function(_0x47262d,_0x3ccea9){if(_0x47262d[_0xc819('0x4d')]['id']){delete _0x47262d[_0xc819('0x4d')]['id'];}return db[_0xc819('0x44')][_0xc819('0x4b')]({'where':{'id':_0x47262d[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x3ccea9,null))[_0xc819('0x28')](saveUpdates(_0x47262d[_0xc819('0x4d')],null))['then'](respondWithResult(_0x3ccea9,null))['catch'](handleError(_0x3ccea9,null));};exports[_0xc819('0x54')]=function(_0x4d73c8,_0x1c449b){return db[_0xc819('0x44')]['find']({'where':{'id':_0x4d73c8[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x1c449b,null))['then'](removeEntity(_0x1c449b,null))[_0xc819('0x49')](handleError(_0x1c449b,null));};exports[_0xc819('0x55')]=function(_0x1762c8,_0x211a07){return db[_0xc819('0x44')][_0xc819('0x55')]()[_0xc819('0x28')](respondWithResult(_0x211a07,null))[_0xc819('0x49')](handleError(_0x211a07,null));};exports[_0xc819('0x56')]=function(_0x4e8854,_0x69b0ff,_0x1deb21){var _0x45fc37={'raw':!![],'where':{}},_0x37038d={},_0x2d179a;return db['MailQueue'][_0xc819('0x57')]({'where':{'id':_0x4e8854[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x69b0ff,null))[_0xc819('0x28')](function(_0x19f6f0){if(_0x19f6f0){_0x2d179a=_0x19f6f0['get']({'plain':!![]});_0x37038d['model']=_['keys'](db[_0xc819('0x58')][_0xc819('0x32')]);_0x37038d[_0xc819('0x36')]=_['keys'](_0x4e8854[_0xc819('0x36')]);_0x37038d[_0xc819('0x3f')]=_[_0xc819('0x37')](_0x37038d[_0xc819('0x35')],_0x37038d[_0xc819('0x36')]);_0x45fc37[_0xc819('0x39')]=_['intersection'](_0x37038d[_0xc819('0x35')],qs[_0xc819('0x38')](_0x4e8854[_0xc819('0x36')][_0xc819('0x38')]));_0x45fc37[_0xc819('0x39')]=_0x45fc37[_0xc819('0x39')]['length']?_0x45fc37[_0xc819('0x39')]:_0x37038d[_0xc819('0x35')];if(!_0x4e8854[_0xc819('0x36')][_0xc819('0x3b')](_0xc819('0x3c'))){_0x45fc37[_0xc819('0x22')]=qs['limit'](_0x4e8854['query'][_0xc819('0x22')]);_0x45fc37[_0xc819('0x20')]=qs[_0xc819('0x20')](_0x4e8854[_0xc819('0x36')][_0xc819('0x20')]);}_0x45fc37['order']=qs['sort'](_0x4e8854[_0xc819('0x36')][_0xc819('0x3d')]);_0x45fc37['where']=qs['filters'](_[_0xc819('0x40')](_0x4e8854['query'],_0x37038d[_0xc819('0x3f')]));_0x45fc37[_0xc819('0x3e')][_0xc819('0x59')]=_0x19f6f0['id'];if(_0x4e8854[_0xc819('0x36')][_0xc819('0x42')]){_0x45fc37[_0xc819('0x3e')]=_['merge'](_0x45fc37[_0xc819('0x3e')],{'$or':_['map'](_0x45fc37[_0xc819('0x39')],function(_0x1f4344){var _0x2e60b7={};_0x2e60b7[_0x1f4344]={'$like':'%'+_0x4e8854[_0xc819('0x36')]['filter']+'%'};return _0x2e60b7;})});}_0x45fc37=_[_0xc819('0x41')]({},_0x45fc37,_0x4e8854['options']);return db[_0xc819('0x58')][_0xc819('0x48')](_0x45fc37);}})[_0xc819('0x28')](function(_0x15525a){if(_0x15525a){return db[_0xc819('0x5a')][_0xc819('0x5b')]({'where':{'id':_[_0xc819('0x31')](_0x15525a,_0xc819('0x5c')),'role':'agent'},'attributes':['id',_0xc819('0x2e'),_0xc819('0x5d'),'updatedAt',_0xc819('0x5e')]});}})[_0xc819('0x28')](function(_0x2ad7af){if(_0x2ad7af){return{'count':_0x2ad7af[_0xc819('0x45')],'rows':_[_0xc819('0x31')](_0x2ad7af[_0xc819('0x5f')],function(_0x4939f4){return{'membername':_0x4939f4['name'],'UserId':_0x4939f4['id'],'queue_name':_0x2d179a[_0xc819('0x2e')],'MailQueueId':_0x2d179a['id'],'interface':util['format']('%s/%s',_0xc819('0x60'),_0x4939f4['name']),'penalty':0x0,'paused':_0x4939f4[_0xc819('0x5d')],'createdAt':_0x4939f4['createdAt'],'updatedAt':_0x4939f4[_0xc819('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc819('0x28')](respondWithFilteredResult(_0x69b0ff,_0x45fc37))[_0xc819('0x49')](handleError(_0x69b0ff,null));};exports[_0xc819('0x62')]=function(_0x24f538,_0x1ba5a1,_0xb09797){var _0x1fea47={};var _0x596099={};var _0x29027c;var _0x254033;return db[_0xc819('0x44')][_0xc819('0x57')]({'where':{'id':_0x24f538['params']['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x1ba5a1,null))['then'](function(_0x5382b8){if(_0x5382b8){_0x29027c=_0x5382b8;_0x596099[_0xc819('0x35')]=_[_0xc819('0x4a')](db[_0xc819('0x63')][_0xc819('0x32')]);_0x596099['query']=_['keys'](_0x24f538[_0xc819('0x36')]);_0x596099[_0xc819('0x3f')]=_[_0xc819('0x37')](_0x596099[_0xc819('0x35')],_0x596099[_0xc819('0x36')]);_0x1fea47[_0xc819('0x39')]=_[_0xc819('0x37')](_0x596099[_0xc819('0x35')],qs[_0xc819('0x38')](_0x24f538[_0xc819('0x36')][_0xc819('0x38')]));_0x1fea47[_0xc819('0x39')]=_0x1fea47[_0xc819('0x39')][_0xc819('0x3a')]?_0x1fea47[_0xc819('0x39')]:_0x596099[_0xc819('0x35')];_0x1fea47[_0xc819('0x64')]=qs['sort'](_0x24f538[_0xc819('0x36')][_0xc819('0x3d')]);_0x1fea47[_0xc819('0x3e')]=qs[_0xc819('0x3f')](_['pick'](_0x24f538['query'],_0x596099[_0xc819('0x3f')]));if(_0x24f538[_0xc819('0x36')]['filter']){_0x1fea47[_0xc819('0x3e')]=_[_0xc819('0x41')](_0x1fea47[_0xc819('0x3e')],{'$or':_[_0xc819('0x31')](_0x1fea47[_0xc819('0x39')],function(_0x476f80){var _0x2a98d0={};_0x2a98d0[_0x476f80]={'$like':'%'+_0x24f538[_0xc819('0x36')][_0xc819('0x42')]+'%'};return _0x2a98d0;})});}_0x1fea47=_[_0xc819('0x41')]({},_0x1fea47,_0x24f538[_0xc819('0x43')]);return _0x29027c[_0xc819('0x62')](_0x1fea47);}})['then'](function(_0x1139c5){if(_0x1139c5){_0x254033=_0x1139c5[_0xc819('0x3a')];if(!_0x24f538[_0xc819('0x36')][_0xc819('0x3b')](_0xc819('0x3c'))){_0x1fea47['limit']=qs['limit'](_0x24f538[_0xc819('0x36')][_0xc819('0x22')]);_0x1fea47[_0xc819('0x20')]=qs[_0xc819('0x20')](_0x24f538[_0xc819('0x36')][_0xc819('0x20')]);}return _0x29027c[_0xc819('0x62')](_0x1fea47);}})[_0xc819('0x28')](function(_0x44da35){if(_0x44da35){return _0x44da35?{'count':_0x254033,'rows':_0x44da35}:null;}})[_0xc819('0x28')](respondWithResult(_0x1ba5a1,null))[_0xc819('0x49')](handleError(_0x1ba5a1,null));};exports[_0xc819('0x65')]=function(_0x59aae7,_0x5cf5bb,_0x1db7f7){var _0x2c2f53=_0x59aae7[_0xc819('0x4d')][_0xc819('0x66')];return db['Team'][_0xc819('0x48')]({'where':{'id':_0x2c2f53},'attributes':['id'],'include':[{'model':db[_0xc819('0x5a')],'as':_0xc819('0x67'),'attributes':['id',_0xc819('0x2e'),_0xc819('0x68'),_0xc819('0x69'),_0xc819('0x6a')],'raw':!![]}]})[_0xc819('0x28')](function(_0x121e12){if(_0x121e12){var _0x5e3a5d=_[_0xc819('0x6b')](_0x121e12,function(_0x46af1a){var _0x14bb07=_0x46af1a[_0xc819('0x29')]({'plain':!![]});return _0x14bb07['Agents'];});return db[_0xc819('0x44')][_0xc819('0x4b')]({'where':{'id':_0x59aae7['params']['id']}})['then'](function(_0x1c560b){return db[_0xc819('0x6c')][_0xc819('0x6d')](function(_0x1d9b33){return _0x1c560b[_0xc819('0x65')](_0x2c2f53,{'transaction':_0x1d9b33})[_0xc819('0x28')](function(){return BPromise[_0xc819('0x6e')](_0x5e3a5d,function(_0x26866a){return db[_0xc819('0x58')][_0xc819('0x6f')]({'where':{'UserId':_0x26866a['id'],'MailQueueId':_0x59aae7[_0xc819('0x53')]['id']},'transaction':_0x1d9b33});});})['then'](function(){_0x5e3a5d[_0xc819('0x70')](function(_0x56f9de){socket[_0xc819('0x71')](_0xc819('0x72'),{'UserId':_0x56f9de['id'],'MailQueueId':_0x1c560b['id']});});});});});}})[_0xc819('0x28')](respondWithStatusCode(_0x5cf5bb,null))[_0xc819('0x49')](handleError(_0x5cf5bb,null));};exports[_0xc819('0x73')]=function(_0x472447,_0x58d0b4,_0x231420){return db['Team'][_0xc819('0x48')]({'where':{'id':_0x472447[_0xc819('0x36')][_0xc819('0x66')]},'attributes':['id'],'include':[{'model':db[_0xc819('0x5a')],'as':_0xc819('0x67'),'attributes':['id'],'raw':!![]}]})[_0xc819('0x28')](handleEntityNotFound(_0x58d0b4,null))[_0xc819('0x28')](function(_0x476040){var _0x68252d=_['map'](_0x476040,'id');var _0x1c9238=[];var _0x56d44c=[];var _0x4ed387=squel[_0xc819('0x74')]();_0x4ed387[_0xc819('0x75')](_0xc819('0x76'))[_0xc819('0x77')](_0xc819('0x78'),'tq')[_0xc819('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x472447[_0xc819('0x53')]['id']);for(var _0xbcd188=0x0;_0xbcd188<_0x476040[_0xc819('0x3a')];_0xbcd188+=0x1){let _0x14f364=_0x476040[_0xbcd188];for(var _0x25fa79=0x0;_0x25fa79<_0x14f364[_0xc819('0x67')][_0xc819('0x3a')];_0x25fa79+=0x1){let _0x4323a8=_0x14f364[_0xc819('0x67')][_0x25fa79];var _0x37d353=_0x4ed387[_0xc819('0x7a')]();_0x37d353[_0xc819('0x3e')](_0xc819('0x7b'),_0x4323a8['id']);_0x56d44c['push'](db[_0xc819('0x6c')][_0xc819('0x36')](_0x37d353[_0xc819('0x7c')](),{'type':db[_0xc819('0x6c')][_0xc819('0x7d')][_0xc819('0x7e')]})[_0xc819('0x28')](function(_0x6c3fd5){if(_0x6c3fd5['length']===0x1){return _0x4323a8['id'];}else{var _0x29bde1=_['every'](_[_0xc819('0x31')](_0x6c3fd5,_0xc819('0x7f')),function(_0x35ab6c){return _['includes'](_0x68252d,_0x35ab6c);});if(_0x29bde1){return _0x4323a8['id'];}}}));}}return BPromise[_0xc819('0x80')](_0x56d44c)[_0xc819('0x28')](function(_0x362100){_0x1c9238=_(_0x1c9238)[_0xc819('0x81')](_0x362100)[_0xc819('0x82')]()[_0xc819('0x83')]();return db[_0xc819('0x44')][_0xc819('0x4b')]({'where':{'id':_0x472447['params']['id']}})[_0xc819('0x28')](function(_0x3ba2a1){return db[_0xc819('0x6c')][_0xc819('0x6d')](function(_0x5c13d9){return _0x3ba2a1[_0xc819('0x73')](_0x472447[_0xc819('0x36')]['ids'],{'transaction':_0x5c13d9})[_0xc819('0x28')](function(){if(!_[_0xc819('0x84')](_0x1c9238)){return _0x3ba2a1[_0xc819('0x85')](_0x1c9238,{'transaction':_0x5c13d9});}})[_0xc819('0x28')](function(){_0x1c9238[_0xc819('0x70')](function(_0xd31e2a){socket[_0xc819('0x71')](_0xc819('0x86'),{'UserId':_0xd31e2a,'MailQueueId':_0x3ba2a1['id']});});});});});});})[_0xc819('0x28')](respondWithStatusCode(_0x58d0b4,null))[_0xc819('0x49')](handleError(_0x58d0b4,null));};exports[_0xc819('0x87')]=function(_0x1310e8,_0x55d7fc,_0x5a92f2){return db[_0xc819('0x44')]['find']({'where':{'id':_0x1310e8[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x55d7fc,null))[_0xc819('0x28')](function(_0xe06ba9){if(_0xe06ba9){return _0xe06ba9[_0xc819('0x87')](_0x1310e8['body'][_0xc819('0x66')],_[_0xc819('0x88')](_0x1310e8['body'],[_0xc819('0x66'),'id'])||{})[_0xc819('0x89')](function(_0x261cb1){for(var _0x52cac2=0x0;_0x52cac2<_0x1310e8['body'][_0xc819('0x66')][_0xc819('0x3a')];_0x52cac2+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x1310e8[_0xc819('0x4d')]['ids'][_0x52cac2]),'MailQueueId':Number(_0x1310e8['params']['id'])});}return _0x261cb1;});}})[_0xc819('0x28')](respondWithResult(_0x55d7fc,null))[_0xc819('0x49')](handleError(_0x55d7fc,null));};exports['removeAgents']=function(_0x717f05,_0x41359c,_0x299b67){return db['MailQueue'][_0xc819('0x4b')]({'where':{'id':_0x717f05[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x41359c,null))['then'](function(_0x18f998){if(_0x18f998){return _0x18f998[_0xc819('0x85')](_0x717f05[_0xc819('0x36')][_0xc819('0x66')])[_0xc819('0x28')](function(){if(_['isArray'](_0x717f05[_0xc819('0x36')][_0xc819('0x66')])){for(var _0x2479be=0x0;_0x2479be<_0x717f05[_0xc819('0x36')][_0xc819('0x66')][_0xc819('0x3a')];_0x2479be+=0x1){socket[_0xc819('0x71')]('userMailQueue:remove',{'UserId':Number(_0x717f05[_0xc819('0x36')][_0xc819('0x66')][_0x2479be]),'MailQueueId':Number(_0x717f05['params']['id'])});}}else{socket[_0xc819('0x71')](_0xc819('0x86'),{'UserId':Number(_0x717f05[_0xc819('0x36')][_0xc819('0x66')]),'MailQueueId':Number(_0x717f05['params']['id'])});}});}})['then'](respondWithStatusCode(_0x41359c,null))[_0xc819('0x49')](handleError(_0x41359c,null));};exports[_0xc819('0x8a')]=function(_0x3f7d15,_0x4dce22,_0x3f28dd){var _0x2f3b58={};var _0xf32882={};var _0x42bbb2;var _0x4a44d7;return db[_0xc819('0x44')][_0xc819('0x57')]({'where':{'id':_0x3f7d15[_0xc819('0x53')]['id']}})[_0xc819('0x28')](handleEntityNotFound(_0x4dce22,null))[_0xc819('0x28')](function(_0x159f28){if(_0x159f28){_0x42bbb2=_0x159f28;_0xf32882[_0xc819('0x35')]=_[_0xc819('0x4a')](db[_0xc819('0x5a')][_0xc819('0x32')]);_0xf32882[_0xc819('0x36')]=_[_0xc819('0x4a')](_0x3f7d15[_0xc819('0x36')]);_0xf32882['filters']=_[_0xc819('0x37')](_0xf32882[_0xc819('0x35')],_0xf32882[_0xc819('0x36')]);_0x2f3b58[_0xc819('0x39')]=_[_0xc819('0x37')](_0xf32882[_0xc819('0x35')],qs[_0xc819('0x38')](_0x3f7d15['query'][_0xc819('0x38')]));_0x2f3b58[_0xc819('0x39')]=_0x2f3b58[_0xc819('0x39')][_0xc819('0x3a')]?_0x2f3b58[_0xc819('0x39')]:_0xf32882[_0xc819('0x35')];_0x2f3b58[_0xc819('0x64')]=qs[_0xc819('0x3d')](_0x3f7d15[_0xc819('0x36')]['sort']);_0x2f3b58[_0xc819('0x3e')]=qs['filters'](_['pick'](_0x3f7d15[_0xc819('0x36')],_0xf32882[_0xc819('0x3f')]));if(_0x3f7d15[_0xc819('0x36')][_0xc819('0x42')]){_0x2f3b58[_0xc819('0x3e')]=_['merge'](_0x2f3b58[_0xc819('0x3e')],{'$or':_['map'](_0x2f3b58['attributes'],function(_0x3616b4){var _0x4457a5={};_0x4457a5[_0x3616b4]={'$like':'%'+_0x3f7d15[_0xc819('0x36')][_0xc819('0x42')]+'%'};return _0x4457a5;})});}_0x2f3b58=_[_0xc819('0x41')]({},_0x2f3b58,_0x3f7d15[_0xc819('0x43')]);return _0x42bbb2[_0xc819('0x8a')](_0x2f3b58);}})[_0xc819('0x28')](function(_0x35534e){if(_0x35534e){_0x4a44d7=_0x35534e['length'];if(!_0x3f7d15[_0xc819('0x36')][_0xc819('0x3b')](_0xc819('0x3c'))){_0x2f3b58[_0xc819('0x22')]=qs['limit'](_0x3f7d15[_0xc819('0x36')][_0xc819('0x22')]);_0x2f3b58[_0xc819('0x20')]=qs[_0xc819('0x20')](_0x3f7d15[_0xc819('0x36')][_0xc819('0x20')]);}return _0x42bbb2['getAgents'](_0x2f3b58);}})['then'](function(_0x393696){if(_0x393696){return _0x393696?{'count':_0x4a44d7,'rows':_0x393696}:null;}})[_0xc819('0x28')](respondWithResult(_0x4dce22,null))[_0xc819('0x49')](handleError(_0x4dce22,null));};
\ No newline at end of file
+var _0x45eb=['findOrCreate','forEach','emit','removeTeams','Team','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','stack','name','index','MailQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','map','VIRTUAL','filter','includeAll','findAll','rows','catch','show','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','getMembers','UserMailQueue','nolimit','order','MailQueueId','User','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','findOne','getTeams','ids','Agents','interface','sequelize','transaction','each'];(function(_0x1359b0,_0x22ba15){var _0x138ba6=function(_0x278565){while(--_0x278565){_0x1359b0['push'](_0x1359b0['shift']());}};_0x138ba6(++_0x22ba15);}(_0x45eb,0x126));var _0xb45e=function(_0x489933,_0x13f6e6){_0x489933=_0x489933-0x0;var _0x2fa17a=_0x45eb[_0x489933];return _0x2fa17a;};'use strict';var emlformat=require(_0xb45e('0x0'));var rimraf=require(_0xb45e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb45e('0x2'));var rp=require('request-promise');var moment=require(_0xb45e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb45e('0x4'));var util=require('util');var path=require(_0xb45e('0x5'));var sox=require(_0xb45e('0x6'));var csv=require(_0xb45e('0x7'));var ejs=require(_0xb45e('0x8'));var fs=require('fs');var fs_extra=require(_0xb45e('0x9'));var _=require('lodash');var squel=require(_0xb45e('0xa'));var crypto=require(_0xb45e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb45e('0xc'));var toCsv=require(_0xb45e('0x7'));var querystring=require(_0xb45e('0xd'));var Papa=require(_0xb45e('0xe'));var Redis=require(_0xb45e('0xf'));var authService=require(_0xb45e('0x10'));var qs=require(_0xb45e('0x11'));var as=require(_0xb45e('0x12'));var hardwareService=require(_0xb45e('0x13'));var logger=require('../../config/logger')(_0xb45e('0x14'));var utils=require(_0xb45e('0x15'));var config=require(_0xb45e('0x16'));var licenseUtil=require(_0xb45e('0x17'));var db=require('../../mysqldb')['db'];config[_0xb45e('0x18')]=_['defaults'](config['redis'],{'host':_0xb45e('0x19'),'port':0x18eb});var socket=require(_0xb45e('0x1a'))(new Redis(config[_0xb45e('0x18')]));require(_0xb45e('0x1b'))[_0xb45e('0x1c')](socket);function respondWithStatusCode(_0x1c8bdb,_0x1bc37c){_0x1bc37c=_0x1bc37c||0xcc;return function(_0x1ab48b){if(_0x1ab48b){return _0x1c8bdb['sendStatus'](_0x1bc37c);}return _0x1c8bdb[_0xb45e('0x1d')](_0x1bc37c)[_0xb45e('0x1e')]();};}function respondWithResult(_0x5ea602,_0xdcb82){_0xdcb82=_0xdcb82||0xc8;return function(_0x4b0e6f){if(_0x4b0e6f){return _0x5ea602[_0xb45e('0x1d')](_0xdcb82)[_0xb45e('0x1f')](_0x4b0e6f);}};}function respondWithFilteredResult(_0x18a7c8,_0x50c1f0){return function(_0x2b76c8){if(_0x2b76c8){var _0x370a88=typeof _0x50c1f0[_0xb45e('0x20')]==='undefined'&&typeof _0x50c1f0[_0xb45e('0x21')]===_0xb45e('0x22');var _0x2f2883=_0x2b76c8[_0xb45e('0x23')];var _0x5830fa=_0x370a88?0x0:_0x50c1f0['offset'];var _0x48944e=_0x370a88?_0x2b76c8['count']:_0x50c1f0[_0xb45e('0x20')]+_0x50c1f0[_0xb45e('0x21')];var _0x142a79;if(_0x48944e>=_0x2f2883){_0x48944e=_0x2f2883;_0x142a79=0xc8;}else{_0x142a79=0xce;}_0x18a7c8[_0xb45e('0x1d')](_0x142a79);return _0x18a7c8[_0xb45e('0x24')](_0xb45e('0x25'),_0x5830fa+'-'+_0x48944e+'/'+_0x2f2883)['json'](_0x2b76c8);}return null;};}function patchUpdates(_0xcb2450){return function(_0x216fd0){try{jsonpatch['apply'](_0x216fd0,_0xcb2450,!![]);}catch(_0x29463e){return BPromise['reject'](_0x29463e);}return _0x216fd0[_0xb45e('0x26')]();};}function saveUpdates(_0x52e61b,_0xa4c083){return function(_0x591bf2){if(_0x591bf2){return _0x591bf2[_0xb45e('0x27')](_0x52e61b)[_0xb45e('0x28')](function(_0x249cb4){return _0x249cb4;});}return null;};}function removeEntity(_0x39abbc,_0x5810c1){return function(_0x193cb7){if(_0x193cb7){return _0x193cb7[_0xb45e('0x29')]()[_0xb45e('0x28')](function(){var _0x399354=_0x193cb7[_0xb45e('0x2a')]({'plain':!![]});var _0x3d81c0=_0xb45e('0x2b');return db[_0xb45e('0x2c')][_0xb45e('0x29')]({'where':{'type':_0x3d81c0,'resourceId':_0x399354['id']}})[_0xb45e('0x28')](function(){return _0x193cb7;});})[_0xb45e('0x28')](function(){_0x39abbc[_0xb45e('0x1d')](0xcc)[_0xb45e('0x1e')]();});}};}function handleEntityNotFound(_0x1be911,_0x1501f8){return function(_0x23769b){if(!_0x23769b){_0x1be911[_0xb45e('0x2d')](0x194);}return _0x23769b;};}function handleError(_0x4b05d4,_0x2b0d50){_0x2b0d50=_0x2b0d50||0x1f4;return function(_0x1f3d3c){logger['error'](_0x1f3d3c[_0xb45e('0x2e')]);if(_0x1f3d3c['name']){delete _0x1f3d3c[_0xb45e('0x2f')];}_0x4b05d4[_0xb45e('0x1d')](_0x2b0d50)['send'](_0x1f3d3c);};}exports[_0xb45e('0x30')]=function(_0x594744,_0x87f081){var _0x5b0f53={},_0x4502ac={},_0x10ceaf={'count':0x0,'rows':[]};var _0x11fa89=_['map'](db[_0xb45e('0x31')][_0xb45e('0x32')],function(_0x22bc8d){return{'name':_0x22bc8d[_0xb45e('0x33')],'type':_0x22bc8d['type'][_0xb45e('0x34')]};});_0x4502ac[_0xb45e('0x35')]=_['map'](_0x11fa89,_0xb45e('0x2f'));_0x4502ac[_0xb45e('0x36')]=_[_0xb45e('0x37')](_0x594744[_0xb45e('0x36')]);_0x4502ac['filters']=_[_0xb45e('0x38')](_0x4502ac[_0xb45e('0x35')],_0x4502ac[_0xb45e('0x36')]);_0x5b0f53['attributes']=_[_0xb45e('0x38')](_0x4502ac[_0xb45e('0x35')],qs['fields'](_0x594744[_0xb45e('0x36')]['fields']));_0x5b0f53[_0xb45e('0x39')]=_0x5b0f53[_0xb45e('0x39')][_0xb45e('0x3a')]?_0x5b0f53[_0xb45e('0x39')]:_0x4502ac['model'];if(!_0x594744[_0xb45e('0x36')][_0xb45e('0x3b')]('nolimit')){_0x5b0f53[_0xb45e('0x21')]=qs[_0xb45e('0x21')](_0x594744['query']['limit']);_0x5b0f53[_0xb45e('0x20')]=qs[_0xb45e('0x20')](_0x594744[_0xb45e('0x36')][_0xb45e('0x20')]);}_0x5b0f53['order']=qs[_0xb45e('0x3c')](_0x594744['query'][_0xb45e('0x3c')]);_0x5b0f53[_0xb45e('0x3d')]=qs[_0xb45e('0x3e')](_[_0xb45e('0x3f')](_0x594744[_0xb45e('0x36')],_0x4502ac[_0xb45e('0x3e')]),_0x11fa89);if(_0x594744[_0xb45e('0x36')]['filter']){_0x5b0f53[_0xb45e('0x3d')]=_[_0xb45e('0x40')](_0x5b0f53['where'],{'$or':_[_0xb45e('0x41')](_0x11fa89,function(_0x18b6ab){if(_0x18b6ab['type']!==_0xb45e('0x42')){var _0x69bad2={};_0x69bad2[_0x18b6ab[_0xb45e('0x2f')]]={'$like':'%'+_0x594744['query'][_0xb45e('0x43')]+'%'};return _0x69bad2;}})});}_0x5b0f53=_[_0xb45e('0x40')]({},_0x5b0f53,_0x594744['options']);var _0x2d884a={'where':_0x5b0f53['where']};return db[_0xb45e('0x31')][_0xb45e('0x23')](_0x2d884a)['then'](function(_0x5c714f){_0x10ceaf['count']=_0x5c714f;if(_0x594744['query'][_0xb45e('0x44')]){_0x5b0f53['include']=[{'all':!![]}];}return db['MailQueue'][_0xb45e('0x45')](_0x5b0f53);})[_0xb45e('0x28')](function(_0x2aa997){_0x10ceaf[_0xb45e('0x46')]=_0x2aa997;return _0x10ceaf;})[_0xb45e('0x28')](respondWithFilteredResult(_0x87f081,_0x5b0f53))[_0xb45e('0x47')](handleError(_0x87f081,null));};exports[_0xb45e('0x48')]=function(_0x353489,_0x3657cb){var _0x5c995c={'raw':!![],'where':{'id':_0x353489['params']['id']}},_0x2101fa={};_0x2101fa[_0xb45e('0x35')]=_[_0xb45e('0x37')](db[_0xb45e('0x31')][_0xb45e('0x32')]);_0x2101fa[_0xb45e('0x36')]=_['keys'](_0x353489[_0xb45e('0x36')]);_0x2101fa[_0xb45e('0x3e')]=_[_0xb45e('0x38')](_0x2101fa[_0xb45e('0x35')],_0x2101fa['query']);_0x5c995c[_0xb45e('0x39')]=_[_0xb45e('0x38')](_0x2101fa['model'],qs[_0xb45e('0x49')](_0x353489['query']['fields']));_0x5c995c['attributes']=_0x5c995c[_0xb45e('0x39')][_0xb45e('0x3a')]?_0x5c995c[_0xb45e('0x39')]:_0x2101fa[_0xb45e('0x35')];if(_0x353489[_0xb45e('0x36')][_0xb45e('0x44')]){_0x5c995c['include']=[{'all':!![]}];}_0x5c995c=_[_0xb45e('0x40')]({},_0x5c995c,_0x353489[_0xb45e('0x4a')]);return db[_0xb45e('0x31')][_0xb45e('0x4b')](_0x5c995c)['then'](handleEntityNotFound(_0x3657cb,null))[_0xb45e('0x28')](respondWithResult(_0x3657cb,null))['catch'](handleError(_0x3657cb,null));};exports['create']=function(_0x1bb309,_0x107002){return db[_0xb45e('0x31')][_0xb45e('0x4c')](_0x1bb309[_0xb45e('0x4d')],{})[_0xb45e('0x28')](function(_0x1c1648){var _0xe536d8=_0x1bb309[_0xb45e('0x4e')][_0xb45e('0x2a')]({'plain':!![]});if(!_0xe536d8)throw new Error(_0xb45e('0x4f'));if(_0xe536d8[_0xb45e('0x50')]==='user'){var _0x111277=_0x1c1648[_0xb45e('0x2a')]({'plain':!![]});var _0x9ce056=_0xb45e('0x2b');return db[_0xb45e('0x51')][_0xb45e('0x4b')]({'where':{'name':_0x9ce056,'userProfileId':_0xe536d8['userProfileId']},'raw':!![]})[_0xb45e('0x28')](function(_0x36bf86){if(_0x36bf86&&_0x36bf86[_0xb45e('0x52')]===0x0){return db[_0xb45e('0x2c')][_0xb45e('0x4c')]({'name':_0x111277[_0xb45e('0x2f')],'resourceId':_0x111277['id'],'type':_0x36bf86['name'],'sectionId':_0x36bf86['id']},{})[_0xb45e('0x28')](function(){return _0x1c1648;});}else{return _0x1c1648;}})[_0xb45e('0x47')](function(_0xff6947){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xff6947);throw _0xff6947;});}return _0x1c1648;})[_0xb45e('0x28')](respondWithResult(_0x107002,0xc9))[_0xb45e('0x47')](handleError(_0x107002,null));};exports[_0xb45e('0x27')]=function(_0x36b271,_0x4e8e39){if(_0x36b271[_0xb45e('0x4d')]['id']){delete _0x36b271[_0xb45e('0x4d')]['id'];}return db[_0xb45e('0x31')][_0xb45e('0x4b')]({'where':{'id':_0x36b271['params']['id']}})[_0xb45e('0x28')](handleEntityNotFound(_0x4e8e39,null))[_0xb45e('0x28')](saveUpdates(_0x36b271[_0xb45e('0x4d')],null))[_0xb45e('0x28')](respondWithResult(_0x4e8e39,null))[_0xb45e('0x47')](handleError(_0x4e8e39,null));};exports[_0xb45e('0x29')]=function(_0x62e505,_0x3101dc){return db[_0xb45e('0x31')]['find']({'where':{'id':_0x62e505[_0xb45e('0x53')]['id']}})[_0xb45e('0x28')](handleEntityNotFound(_0x3101dc,null))[_0xb45e('0x28')](removeEntity(_0x3101dc,null))[_0xb45e('0x47')](handleError(_0x3101dc,null));};exports['describe']=function(_0x157cc7,_0x13e98f){return db[_0xb45e('0x31')]['describe']()[_0xb45e('0x28')](respondWithResult(_0x13e98f,null))[_0xb45e('0x47')](handleError(_0x13e98f,null));};exports[_0xb45e('0x54')]=function(_0x57bf7,_0x213541,_0x1e6fae){var _0xc7e231={'raw':!![],'where':{}},_0xffac82={},_0x591176;return db[_0xb45e('0x31')]['findOne']({'where':{'id':_0x57bf7[_0xb45e('0x53')]['id']}})[_0xb45e('0x28')](handleEntityNotFound(_0x213541,null))[_0xb45e('0x28')](function(_0x5a0583){if(_0x5a0583){_0x591176=_0x5a0583[_0xb45e('0x2a')]({'plain':!![]});_0xffac82[_0xb45e('0x35')]=_[_0xb45e('0x37')](db[_0xb45e('0x55')][_0xb45e('0x32')]);_0xffac82[_0xb45e('0x36')]=_[_0xb45e('0x37')](_0x57bf7[_0xb45e('0x36')]);_0xffac82['filters']=_[_0xb45e('0x38')](_0xffac82[_0xb45e('0x35')],_0xffac82[_0xb45e('0x36')]);_0xc7e231[_0xb45e('0x39')]=_[_0xb45e('0x38')](_0xffac82[_0xb45e('0x35')],qs[_0xb45e('0x49')](_0x57bf7[_0xb45e('0x36')][_0xb45e('0x49')]));_0xc7e231['attributes']=_0xc7e231['attributes'][_0xb45e('0x3a')]?_0xc7e231['attributes']:_0xffac82['model'];if(!_0x57bf7[_0xb45e('0x36')][_0xb45e('0x3b')](_0xb45e('0x56'))){_0xc7e231[_0xb45e('0x21')]=qs[_0xb45e('0x21')](_0x57bf7['query'][_0xb45e('0x21')]);_0xc7e231['offset']=qs[_0xb45e('0x20')](_0x57bf7[_0xb45e('0x36')][_0xb45e('0x20')]);}_0xc7e231[_0xb45e('0x57')]=qs[_0xb45e('0x3c')](_0x57bf7[_0xb45e('0x36')][_0xb45e('0x3c')]);_0xc7e231[_0xb45e('0x3d')]=qs['filters'](_['pick'](_0x57bf7[_0xb45e('0x36')],_0xffac82['filters']));_0xc7e231['where'][_0xb45e('0x58')]=_0x5a0583['id'];if(_0x57bf7['query'][_0xb45e('0x43')]){_0xc7e231[_0xb45e('0x3d')]=_[_0xb45e('0x40')](_0xc7e231[_0xb45e('0x3d')],{'$or':_[_0xb45e('0x41')](_0xc7e231[_0xb45e('0x39')],function(_0x492573){var _0x59b252={};_0x59b252[_0x492573]={'$like':'%'+_0x57bf7[_0xb45e('0x36')]['filter']+'%'};return _0x59b252;})});}_0xc7e231=_[_0xb45e('0x40')]({},_0xc7e231,_0x57bf7[_0xb45e('0x4a')]);return db[_0xb45e('0x55')][_0xb45e('0x45')](_0xc7e231);}})['then'](function(_0x484148){if(_0x484148){return db[_0xb45e('0x59')]['findAndCountAll']({'where':{'id':_[_0xb45e('0x41')](_0x484148,'UserId'),'role':_0xb45e('0x5a')},'attributes':['id','name','mailPause',_0xb45e('0x5b'),_0xb45e('0x5c')]});}})[_0xb45e('0x28')](function(_0x485171){if(_0x485171){return{'count':_0x485171['count'],'rows':_[_0xb45e('0x41')](_0x485171[_0xb45e('0x46')],function(_0x25caa7){return{'membername':_0x25caa7[_0xb45e('0x2f')],'UserId':_0x25caa7['id'],'queue_name':_0x591176[_0xb45e('0x2f')],'MailQueueId':_0x591176['id'],'interface':util[_0xb45e('0x5d')](_0xb45e('0x5e'),_0xb45e('0x5f'),_0x25caa7[_0xb45e('0x2f')]),'penalty':0x0,'paused':_0x25caa7[_0xb45e('0x60')],'createdAt':_0x25caa7[_0xb45e('0x5c')],'updatedAt':_0x25caa7[_0xb45e('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb45e('0x28')](respondWithFilteredResult(_0x213541,_0xc7e231))['catch'](handleError(_0x213541,null));};exports['getTeams']=function(_0x2e03eb,_0x3c85d3,_0x59c589){var _0x1714d2={};var _0x3f8947={};var _0x46a053;var _0x2b0e53;return db[_0xb45e('0x31')][_0xb45e('0x61')]({'where':{'id':_0x2e03eb[_0xb45e('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c85d3,null))['then'](function(_0x357f7f){if(_0x357f7f){_0x46a053=_0x357f7f;_0x3f8947[_0xb45e('0x35')]=_[_0xb45e('0x37')](db['Team']['rawAttributes']);_0x3f8947[_0xb45e('0x36')]=_[_0xb45e('0x37')](_0x2e03eb[_0xb45e('0x36')]);_0x3f8947['filters']=_[_0xb45e('0x38')](_0x3f8947['model'],_0x3f8947[_0xb45e('0x36')]);_0x1714d2['attributes']=_[_0xb45e('0x38')](_0x3f8947[_0xb45e('0x35')],qs[_0xb45e('0x49')](_0x2e03eb[_0xb45e('0x36')][_0xb45e('0x49')]));_0x1714d2[_0xb45e('0x39')]=_0x1714d2[_0xb45e('0x39')][_0xb45e('0x3a')]?_0x1714d2[_0xb45e('0x39')]:_0x3f8947[_0xb45e('0x35')];_0x1714d2[_0xb45e('0x57')]=qs[_0xb45e('0x3c')](_0x2e03eb['query'][_0xb45e('0x3c')]);_0x1714d2[_0xb45e('0x3d')]=qs['filters'](_[_0xb45e('0x3f')](_0x2e03eb['query'],_0x3f8947[_0xb45e('0x3e')]));if(_0x2e03eb['query']['filter']){_0x1714d2[_0xb45e('0x3d')]=_['merge'](_0x1714d2[_0xb45e('0x3d')],{'$or':_[_0xb45e('0x41')](_0x1714d2[_0xb45e('0x39')],function(_0x6afe76){var _0x44f731={};_0x44f731[_0x6afe76]={'$like':'%'+_0x2e03eb[_0xb45e('0x36')][_0xb45e('0x43')]+'%'};return _0x44f731;})});}_0x1714d2=_[_0xb45e('0x40')]({},_0x1714d2,_0x2e03eb['options']);return _0x46a053['getTeams'](_0x1714d2);}})['then'](function(_0x4ed5a7){if(_0x4ed5a7){_0x2b0e53=_0x4ed5a7[_0xb45e('0x3a')];if(!_0x2e03eb['query'][_0xb45e('0x3b')](_0xb45e('0x56'))){_0x1714d2[_0xb45e('0x21')]=qs['limit'](_0x2e03eb['query'][_0xb45e('0x21')]);_0x1714d2[_0xb45e('0x20')]=qs['offset'](_0x2e03eb[_0xb45e('0x36')][_0xb45e('0x20')]);}return _0x46a053[_0xb45e('0x62')](_0x1714d2);}})[_0xb45e('0x28')](function(_0x54af81){if(_0x54af81){return _0x54af81?{'count':_0x2b0e53,'rows':_0x54af81}:null;}})['then'](respondWithResult(_0x3c85d3,null))[_0xb45e('0x47')](handleError(_0x3c85d3,null));};exports['addTeams']=function(_0x3b988e,_0x29c0f6,_0x20f44b){var _0x8b88cd=_0x3b988e[_0xb45e('0x4d')][_0xb45e('0x63')];return db['Team'][_0xb45e('0x45')]({'where':{'id':_0x8b88cd},'attributes':['id'],'include':[{'model':db[_0xb45e('0x59')],'as':_0xb45e('0x64'),'attributes':['id',_0xb45e('0x2f'),'online','voicePause',_0xb45e('0x65')],'raw':!![]}]})[_0xb45e('0x28')](function(_0x229030){if(_0x229030){var _0x1edf39=_['flatMap'](_0x229030,function(_0x50ec24){var _0x36f46b=_0x50ec24[_0xb45e('0x2a')]({'plain':!![]});return _0x36f46b[_0xb45e('0x64')];});return db[_0xb45e('0x31')][_0xb45e('0x4b')]({'where':{'id':_0x3b988e[_0xb45e('0x53')]['id']}})['then'](function(_0x1b39bf){return db[_0xb45e('0x66')][_0xb45e('0x67')](function(_0x46632b){return _0x1b39bf['addTeams'](_0x8b88cd,{'transaction':_0x46632b})['then'](function(){return BPromise[_0xb45e('0x68')](_0x1edf39,function(_0x363445){return db[_0xb45e('0x55')][_0xb45e('0x69')]({'where':{'UserId':_0x363445['id'],'MailQueueId':_0x3b988e[_0xb45e('0x53')]['id']},'transaction':_0x46632b});});})[_0xb45e('0x28')](function(){_0x1edf39[_0xb45e('0x6a')](function(_0x2f70a6){socket[_0xb45e('0x6b')]('userMailQueue:save',{'UserId':_0x2f70a6['id'],'MailQueueId':_0x1b39bf['id']});});});});});}})[_0xb45e('0x28')](respondWithStatusCode(_0x29c0f6,null))['catch'](handleError(_0x29c0f6,null));};exports[_0xb45e('0x6c')]=function(_0x43fa3d,_0x3334ab,_0x22d006){return db[_0xb45e('0x6d')][_0xb45e('0x45')]({'where':{'id':_0x43fa3d['query'][_0xb45e('0x63')]},'attributes':['id'],'include':[{'model':db[_0xb45e('0x59')],'as':_0xb45e('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3334ab,null))[_0xb45e('0x28')](function(_0x2a58d8){var _0x1a3618=_[_0xb45e('0x41')](_0x2a58d8,'id');var _0x416dd2=[];var _0x5cc8a3=[];var _0x30ae7f=squel[_0xb45e('0x6e')]();_0x30ae7f[_0xb45e('0x6f')](_0xb45e('0x70'))['from']('team_has_mail_queues','tq')['join'](_0xb45e('0x71'),'ut',_0xb45e('0x72'))['where'](_0xb45e('0x73'),_0x43fa3d[_0xb45e('0x53')]['id']);for(var _0xb8a06=0x0;_0xb8a06<_0x2a58d8[_0xb45e('0x3a')];_0xb8a06+=0x1){let _0x278138=_0x2a58d8[_0xb8a06];for(var _0x5c7287=0x0;_0x5c7287<_0x278138[_0xb45e('0x64')][_0xb45e('0x3a')];_0x5c7287+=0x1){let _0x3b3cd8=_0x278138['Agents'][_0x5c7287];var _0x283754=_0x30ae7f['clone']();_0x283754[_0xb45e('0x3d')]('ut.UserId\x20=\x20?',_0x3b3cd8['id']);_0x5cc8a3[_0xb45e('0x74')](db[_0xb45e('0x66')][_0xb45e('0x36')](_0x283754['toString'](),{'type':db[_0xb45e('0x66')][_0xb45e('0x75')][_0xb45e('0x76')]})[_0xb45e('0x28')](function(_0x14cafc){if(_0x14cafc[_0xb45e('0x3a')]===0x1){return _0x3b3cd8['id'];}else{var _0x243b58=_[_0xb45e('0x77')](_[_0xb45e('0x41')](_0x14cafc,_0xb45e('0x78')),function(_0x159c92){return _[_0xb45e('0x79')](_0x1a3618,_0x159c92);});if(_0x243b58){return _0x3b3cd8['id'];}}}));}}return BPromise[_0xb45e('0x7a')](_0x5cc8a3)['then'](function(_0x5425fb){_0x416dd2=_(_0x416dd2)['union'](_0x5425fb)[_0xb45e('0x7b')]()[_0xb45e('0x7c')]();return db[_0xb45e('0x31')][_0xb45e('0x4b')]({'where':{'id':_0x43fa3d[_0xb45e('0x53')]['id']}})[_0xb45e('0x28')](function(_0x252879){return db['sequelize']['transaction'](function(_0x46dc85){return _0x252879['removeTeams'](_0x43fa3d[_0xb45e('0x36')][_0xb45e('0x63')],{'transaction':_0x46dc85})[_0xb45e('0x28')](function(){if(!_[_0xb45e('0x7d')](_0x416dd2)){return _0x252879[_0xb45e('0x7e')](_0x416dd2,{'transaction':_0x46dc85});}})[_0xb45e('0x28')](function(){_0x416dd2[_0xb45e('0x6a')](function(_0x466eb6){socket['emit'](_0xb45e('0x7f'),{'UserId':_0x466eb6,'MailQueueId':_0x252879['id']});});});});});});})['then'](respondWithStatusCode(_0x3334ab,null))['catch'](handleError(_0x3334ab,null));};exports[_0xb45e('0x80')]=function(_0x1571e7,_0x4a3c41,_0x3b5e62){return db[_0xb45e('0x31')][_0xb45e('0x4b')]({'where':{'id':_0x1571e7[_0xb45e('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a3c41,null))[_0xb45e('0x28')](function(_0xb9a6a7){if(_0xb9a6a7){return _0xb9a6a7['addAgents'](_0x1571e7['body']['ids'],_[_0xb45e('0x81')](_0x1571e7[_0xb45e('0x4d')],[_0xb45e('0x63'),'id'])||{})[_0xb45e('0x82')](function(_0x3fae85){for(var _0x1af163=0x0;_0x1af163<_0x1571e7[_0xb45e('0x4d')]['ids']['length'];_0x1af163+=0x1){socket[_0xb45e('0x6b')]('userMailQueue:save',{'UserId':Number(_0x1571e7[_0xb45e('0x4d')]['ids'][_0x1af163]),'MailQueueId':Number(_0x1571e7[_0xb45e('0x53')]['id'])});}return _0x3fae85;});}})[_0xb45e('0x28')](respondWithResult(_0x4a3c41,null))[_0xb45e('0x47')](handleError(_0x4a3c41,null));};exports[_0xb45e('0x7e')]=function(_0x382254,_0x7eb430,_0x5bb885){return db[_0xb45e('0x31')][_0xb45e('0x4b')]({'where':{'id':_0x382254[_0xb45e('0x53')]['id']}})[_0xb45e('0x28')](handleEntityNotFound(_0x7eb430,null))['then'](function(_0x123fd6){if(_0x123fd6){return _0x123fd6['removeAgents'](_0x382254['query']['ids'])[_0xb45e('0x28')](function(){if(_[_0xb45e('0x83')](_0x382254[_0xb45e('0x36')]['ids'])){for(var _0xc36492=0x0;_0xc36492<_0x382254['query'][_0xb45e('0x63')][_0xb45e('0x3a')];_0xc36492+=0x1){socket[_0xb45e('0x6b')](_0xb45e('0x7f'),{'UserId':Number(_0x382254[_0xb45e('0x36')]['ids'][_0xc36492]),'MailQueueId':Number(_0x382254[_0xb45e('0x53')]['id'])});}}else{socket[_0xb45e('0x6b')]('userMailQueue:remove',{'UserId':Number(_0x382254['query'][_0xb45e('0x63')]),'MailQueueId':Number(_0x382254[_0xb45e('0x53')]['id'])});}});}})[_0xb45e('0x28')](respondWithStatusCode(_0x7eb430,null))[_0xb45e('0x47')](handleError(_0x7eb430,null));};exports[_0xb45e('0x84')]=function(_0x57e52a,_0x3b94e3,_0x28773b){var _0x1442e7={};var _0x481283={};var _0x482147;var _0x2e5fc6;return db[_0xb45e('0x31')][_0xb45e('0x61')]({'where':{'id':_0x57e52a['params']['id']}})[_0xb45e('0x28')](handleEntityNotFound(_0x3b94e3,null))[_0xb45e('0x28')](function(_0x41e8bf){if(_0x41e8bf){_0x482147=_0x41e8bf;_0x481283['model']=_[_0xb45e('0x37')](db[_0xb45e('0x59')][_0xb45e('0x32')]);_0x481283[_0xb45e('0x36')]=_[_0xb45e('0x37')](_0x57e52a[_0xb45e('0x36')]);_0x481283['filters']=_['intersection'](_0x481283[_0xb45e('0x35')],_0x481283['query']);_0x1442e7[_0xb45e('0x39')]=_[_0xb45e('0x38')](_0x481283[_0xb45e('0x35')],qs[_0xb45e('0x49')](_0x57e52a[_0xb45e('0x36')]['fields']));_0x1442e7[_0xb45e('0x39')]=_0x1442e7[_0xb45e('0x39')][_0xb45e('0x3a')]?_0x1442e7['attributes']:_0x481283[_0xb45e('0x35')];_0x1442e7[_0xb45e('0x57')]=qs[_0xb45e('0x3c')](_0x57e52a[_0xb45e('0x36')][_0xb45e('0x3c')]);_0x1442e7[_0xb45e('0x3d')]=qs['filters'](_[_0xb45e('0x3f')](_0x57e52a[_0xb45e('0x36')],_0x481283[_0xb45e('0x3e')]));if(_0x57e52a[_0xb45e('0x36')][_0xb45e('0x43')]){_0x1442e7[_0xb45e('0x3d')]=_[_0xb45e('0x40')](_0x1442e7['where'],{'$or':_[_0xb45e('0x41')](_0x1442e7[_0xb45e('0x39')],function(_0x49d8ee){var _0x469a77={};_0x469a77[_0x49d8ee]={'$like':'%'+_0x57e52a['query'][_0xb45e('0x43')]+'%'};return _0x469a77;})});}_0x1442e7=_[_0xb45e('0x40')]({},_0x1442e7,_0x57e52a[_0xb45e('0x4a')]);return _0x482147[_0xb45e('0x84')](_0x1442e7);}})[_0xb45e('0x28')](function(_0x532f50){if(_0x532f50){_0x2e5fc6=_0x532f50[_0xb45e('0x3a')];if(!_0x57e52a[_0xb45e('0x36')][_0xb45e('0x3b')](_0xb45e('0x56'))){_0x1442e7[_0xb45e('0x21')]=qs[_0xb45e('0x21')](_0x57e52a[_0xb45e('0x36')][_0xb45e('0x21')]);_0x1442e7[_0xb45e('0x20')]=qs[_0xb45e('0x20')](_0x57e52a[_0xb45e('0x36')][_0xb45e('0x20')]);}return _0x482147[_0xb45e('0x84')](_0x1442e7);}})[_0xb45e('0x28')](function(_0x5e3195){if(_0x5e3195){return _0x5e3195?{'count':_0x2e5fc6,'rows':_0x5e3195}:null;}})['then'](respondWithResult(_0x3b94e3,null))[_0xb45e('0x47')](handleError(_0x3b94e3,null));};
\ No newline at end of file
index 11c8ca5..3bd9485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67de=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x2b2bee,_0x16f4ed){var _0x5e7c58=function(_0x4e254c){while(--_0x4e254c){_0x2b2bee['push'](_0x2b2bee['shift']());}};_0x5e7c58(++_0x16f4ed);}(_0x67de,0xb0));var _0xe67d=function(_0x38673d,_0x40e907){_0x38673d=_0x38673d-0x0;var _0x318a24=_0x67de[_0x38673d];return _0x318a24;};'use strict';var EventEmitter=require(_0xe67d('0x0'));var MailQueue=require(_0xe67d('0x1'))['db'][_0xe67d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe67d('0x3')](0x0);var events={'afterCreate':_0xe67d('0x4'),'afterUpdate':_0xe67d('0x5'),'afterDestroy':_0xe67d('0x6')};function emitEvent(_0x15eb7e){return function(_0x3386bd,_0x218a23,_0x10d91b){MailQueueEvents[_0xe67d('0x7')](_0x15eb7e+':'+_0x3386bd['id'],_0x3386bd);MailQueueEvents[_0xe67d('0x7')](_0x15eb7e,_0x3386bd);_0x10d91b(null);};}for(var e in events){if(events[_0xe67d('0x8')](e)){var event=events[e];MailQueue[_0xe67d('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x76d7=['MailQueue','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0xcd4d8e,_0x1fc2fd){var _0x1c3c61=function(_0x293f3c){while(--_0x293f3c){_0xcd4d8e['push'](_0xcd4d8e['shift']());}};_0x1c3c61(++_0x1fc2fd);}(_0x76d7,0xa6));var _0x776d=function(_0x284bb4,_0x598e6c){_0x284bb4=_0x284bb4-0x0;var _0x574d5b=_0x76d7[_0x284bb4];return _0x574d5b;};'use strict';var EventEmitter=require(_0x776d('0x0'));var MailQueue=require(_0x776d('0x1'))['db'][_0x776d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x776d('0x3'),'afterDestroy':_0x776d('0x4')};function emitEvent(_0x1e2180){return function(_0x219f21,_0x7ddf5b,_0x3a6726){MailQueueEvents[_0x776d('0x5')](_0x1e2180+':'+_0x219f21['id'],_0x219f21);MailQueueEvents[_0x776d('0x5')](_0x1e2180,_0x219f21);_0x3a6726(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x776d('0x6')](e,emitEvent(event));}}module[_0x776d('0x7')]=MailQueueEvents;
\ No newline at end of file
index f803a75..599e959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb1=['exports','MailQueue','lodash','util','../../config/logger','api','moment','path','../../config/environment','./mailQueue.attributes'];(function(_0x3b3b27,_0x31d961){var _0xaca313=function(_0x38b1c3){while(--_0x38b1c3){_0x3b3b27['push'](_0x3b3b27['shift']());}};_0xaca313(++_0x31d961);}(_0xbdb1,0x12e));var _0x1bdb=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0xbdb1[_0x2ec5b9];return _0x10dcea;};'use strict';var _=require(_0x1bdb('0x0'));var util=require(_0x1bdb('0x1'));var logger=require(_0x1bdb('0x2'))(_0x1bdb('0x3'));var moment=require(_0x1bdb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bdb('0x5'));var rimraf=require('rimraf');var config=require(_0x1bdb('0x6'));var attributes=require(_0x1bdb('0x7'));module[_0x1bdb('0x8')]=function(_0x12ea3c,_0xb9d482){return _0x12ea3c['define'](_0x1bdb('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98a6=['path','rimraf','../../config/environment','exports','define','mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x37c925,_0x2ee082){var _0xa19ebc=function(_0xd820e0){while(--_0xd820e0){_0x37c925['push'](_0x37c925['shift']());}};_0xa19ebc(++_0x2ee082);}(_0x98a6,0x14a));var _0x698a=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x98a6[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x698a('0x0'));var util=require(_0x698a('0x1'));var logger=require(_0x698a('0x2'))(_0x698a('0x3'));var moment=require('moment');var BPromise=require(_0x698a('0x4'));var rp=require(_0x698a('0x5'));var fs=require('fs');var path=require(_0x698a('0x6'));var rimraf=require(_0x698a('0x7'));var config=require(_0x698a('0x8'));var attributes=require('./mailQueue.attributes');module[_0x698a('0x9')]=function(_0x1196d2,_0x382836){return _0x1196d2[_0x698a('0xa')]('MailQueue',attributes,{'tableName':_0x698a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a791ef3..4c81621 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fd=['localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','model','include','then','ShowMailQueue','find','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x331dbc,_0x9b23b6){var _0x299139=function(_0x1ac1ee){while(--_0x1ac1ee){_0x331dbc['push'](_0x331dbc['shift']());}};_0x299139(++_0x9b23b6);}(_0xd8fd,0x16c));var _0xdd8f=function(_0x16192a,_0x5ebefc){_0x16192a=_0x16192a-0x0;var _0x1274fd=_0xd8fd[_0x16192a];return _0x1274fd;};'use strict';var _=require(_0xdd8f('0x0'));var util=require(_0xdd8f('0x1'));var moment=require('moment');var BPromise=require(_0xdd8f('0x2'));var rs=require(_0xdd8f('0x3'));var fs=require('fs');var Redis=require(_0xdd8f('0x4'));var db=require(_0xdd8f('0x5'))['db'];var utils=require(_0xdd8f('0x6'));var logger=require(_0xdd8f('0x7'))(_0xdd8f('0x8'));var config=require(_0xdd8f('0x9'));var jayson=require(_0xdd8f('0xa'));var client=jayson[_0xdd8f('0xb')]['http']({'port':0x232a});config[_0xdd8f('0xc')]=_[_0xdd8f('0xd')](config['redis'],{'host':_0xdd8f('0xe'),'port':0x18eb});var socket=require(_0xdd8f('0xf'))(new Redis(config[_0xdd8f('0xc')]));require(_0xdd8f('0x10'))[_0xdd8f('0x11')](socket);function respondWithRpcPromise(_0x5613d4,_0xdcb2a2,_0x4c7e41){return new BPromise(function(_0xaad679,_0x383462){return client[_0xdd8f('0x12')](_0x5613d4,_0x4c7e41)['then'](function(_0x219a6b){logger[_0xdd8f('0x13')](_0xdd8f('0x14'),_0xdcb2a2,_0xdd8f('0x15'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0xdcb2a2,_0xdd8f('0x15'),JSON[_0xdd8f('0x16')](_0x219a6b));if(_0x219a6b['error']){if(_0x219a6b['error']['code']===0x1f4){logger[_0xdd8f('0x17')](_0xdd8f('0x14'),_0xdcb2a2,_0x219a6b[_0xdd8f('0x17')][_0xdd8f('0x18')]);return _0x383462(_0x219a6b[_0xdd8f('0x17')]['message']);}logger[_0xdd8f('0x17')]('MailQueue,\x20%s,\x20%s',_0xdcb2a2,_0x219a6b[_0xdd8f('0x17')][_0xdd8f('0x18')]);return _0xaad679(_0x219a6b[_0xdd8f('0x17')]['message']);}else{logger[_0xdd8f('0x13')]('MailQueue,\x20%s,\x20%s',_0xdcb2a2,_0xdd8f('0x15'));_0xaad679(_0x219a6b[_0xdd8f('0x19')]['message']);}})[_0xdd8f('0x1a')](function(_0x5226ba){logger[_0xdd8f('0x17')](_0xdd8f('0x14'),_0xdcb2a2,_0x5226ba);_0x383462(_0x5226ba);});});}exports[_0xdd8f('0x1b')]=function(_0x3d8d52){var _0x5ab32d=this;return new Promise(function(_0x24ebb3,_0x3c2bb3){return db[_0xdd8f('0x1c')][_0xdd8f('0x1d')]({'raw':_0x3d8d52[_0xdd8f('0x1e')]?_0x3d8d52[_0xdd8f('0x1e')][_0xdd8f('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d8d52[_0xdd8f('0x1e')]?_0x3d8d52['options'][_0xdd8f('0x20')]||null:null,'attributes':_0x3d8d52[_0xdd8f('0x1e')]?_0x3d8d52[_0xdd8f('0x1e')][_0xdd8f('0x21')]||null:null,'limit':_0x3d8d52['options']?_0x3d8d52[_0xdd8f('0x1e')][_0xdd8f('0x22')]||null:null,'include':_0x3d8d52[_0xdd8f('0x1e')]?_0x3d8d52[_0xdd8f('0x1e')]['include']?_[_0xdd8f('0x23')](_0x3d8d52['options']['include'],function(_0x3d0be7){return{'model':db[_0x3d0be7['model']],'as':_0x3d0be7['as'],'attributes':_0x3d0be7[_0xdd8f('0x21')],'include':_0x3d0be7['include']?_[_0xdd8f('0x23')](_0x3d0be7['include'],function(_0x1e5aa){return{'model':db[_0x1e5aa[_0xdd8f('0x24')]],'as':_0x1e5aa['as'],'attributes':_0x1e5aa[_0xdd8f('0x21')],'include':_0x1e5aa[_0xdd8f('0x25')]?_[_0xdd8f('0x23')](_0x1e5aa['include'],function(_0x254b03){return{'model':db[_0x254b03[_0xdd8f('0x24')]],'as':_0x254b03['as'],'attributes':_0x254b03[_0xdd8f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdd8f('0x26')](function(_0x4c7eec){logger[_0xdd8f('0x13')](_0xdd8f('0x1b'),_0x3d8d52);logger['debug'](_0xdd8f('0x1b'),_0x3d8d52,JSON[_0xdd8f('0x16')](_0x4c7eec));_0x24ebb3(_0x4c7eec);})[_0xdd8f('0x1a')](function(_0x4138c5){logger[_0xdd8f('0x17')]('GetMailQueue',_0x4138c5[_0xdd8f('0x18')],_0x3d8d52);_0x3c2bb3(_0x5ab32d[_0xdd8f('0x17')](0x1f4,_0x4138c5[_0xdd8f('0x18')]));});});};exports[_0xdd8f('0x27')]=function(_0x23f917){var _0x109463=this;return new Promise(function(_0x4b426c,_0x5da3c7){return db[_0xdd8f('0x1c')][_0xdd8f('0x28')]({'raw':_0x23f917[_0xdd8f('0x1e')]?_0x23f917['options'][_0xdd8f('0x1f')]===undefined?!![]:![]:!![],'where':_0x23f917['options']?_0x23f917[_0xdd8f('0x1e')]['where']||null:null,'attributes':_0x23f917[_0xdd8f('0x1e')]?_0x23f917[_0xdd8f('0x1e')]['attributes']||null:null,'include':_0x23f917[_0xdd8f('0x1e')]?_0x23f917[_0xdd8f('0x1e')][_0xdd8f('0x25')]?_[_0xdd8f('0x23')](_0x23f917[_0xdd8f('0x1e')][_0xdd8f('0x25')],function(_0x106399){return{'model':db[_0x106399['model']],'as':_0x106399['as'],'attributes':_0x106399[_0xdd8f('0x21')],'include':_0x106399[_0xdd8f('0x25')]?_[_0xdd8f('0x23')](_0x106399[_0xdd8f('0x25')],function(_0x592225){return{'model':db[_0x592225[_0xdd8f('0x24')]],'as':_0x592225['as'],'attributes':_0x592225[_0xdd8f('0x21')],'include':_0x592225[_0xdd8f('0x25')]?_['map'](_0x592225['include'],function(_0x19e902){return{'model':db[_0x19e902['model']],'as':_0x19e902['as'],'attributes':_0x19e902[_0xdd8f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdd8f('0x26')](function(_0x3b2914){logger[_0xdd8f('0x13')]('ShowMailQueue',_0x23f917);logger[_0xdd8f('0x29')](_0xdd8f('0x27'),_0x23f917,JSON[_0xdd8f('0x16')](_0x3b2914));_0x4b426c(_0x3b2914);})[_0xdd8f('0x1a')](function(_0xc2f562){logger[_0xdd8f('0x17')](_0xdd8f('0x27'),_0xc2f562[_0xdd8f('0x18')],_0x23f917);_0x5da3c7(_0x109463['error'](0x1f4,_0xc2f562[_0xdd8f('0x18')]));});});};
\ No newline at end of file
+var _0x8616=['result','catch','GetMailQueue','findAll','options','raw','where','include','model','attributes','map','ShowMailQueue','MailQueue','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x21f28e,_0x15f3f4){var _0x46241f=function(_0x31d1ce){while(--_0x31d1ce){_0x21f28e['push'](_0x21f28e['shift']());}};_0x46241f(++_0x15f3f4);}(_0x8616,0xc1));var _0x6861=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x8616[_0x393d69];return _0x3cee37;};'use strict';var _=require('lodash');var util=require(_0x6861('0x0'));var moment=require(_0x6861('0x1'));var BPromise=require(_0x6861('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6861('0x3'));var db=require(_0x6861('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6861('0x5'));var config=require('../../config/environment');var jayson=require(_0x6861('0x6'));var client=jayson[_0x6861('0x7')]['http']({'port':0x232a});config[_0x6861('0x8')]=_['defaults'](config[_0x6861('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6861('0x9'))(new Redis(config['redis']));require(_0x6861('0xa'))[_0x6861('0xb')](socket);function respondWithRpcPromise(_0x54372d,_0x230021,_0x5efd1f){return new BPromise(function(_0x329267,_0x58437d){return client[_0x6861('0xc')](_0x54372d,_0x5efd1f)[_0x6861('0xd')](function(_0x31127d){logger['info'](_0x6861('0xe'),_0x230021,_0x6861('0xf'));logger[_0x6861('0x10')](_0x6861('0x11'),_0x230021,_0x6861('0xf'),JSON[_0x6861('0x12')](_0x31127d));if(_0x31127d[_0x6861('0x13')]){if(_0x31127d[_0x6861('0x13')][_0x6861('0x14')]===0x1f4){logger[_0x6861('0x13')](_0x6861('0xe'),_0x230021,_0x31127d[_0x6861('0x13')][_0x6861('0x15')]);return _0x58437d(_0x31127d[_0x6861('0x13')][_0x6861('0x15')]);}logger[_0x6861('0x13')]('MailQueue,\x20%s,\x20%s',_0x230021,_0x31127d[_0x6861('0x13')]['message']);return _0x329267(_0x31127d[_0x6861('0x13')][_0x6861('0x15')]);}else{logger[_0x6861('0x16')](_0x6861('0xe'),_0x230021,'request\x20sent');_0x329267(_0x31127d[_0x6861('0x17')][_0x6861('0x15')]);}})[_0x6861('0x18')](function(_0x2161d7){logger['error'](_0x6861('0xe'),_0x230021,_0x2161d7);_0x58437d(_0x2161d7);});});}exports[_0x6861('0x19')]=function(_0x5b37fe){var _0x53519c=this;return new Promise(function(_0x2c0364,_0x529c23){return db['MailQueue'][_0x6861('0x1a')]({'raw':_0x5b37fe['options']?_0x5b37fe[_0x6861('0x1b')][_0x6861('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b37fe[_0x6861('0x1b')]?_0x5b37fe[_0x6861('0x1b')][_0x6861('0x1d')]||null:null,'attributes':_0x5b37fe[_0x6861('0x1b')]?_0x5b37fe[_0x6861('0x1b')]['attributes']||null:null,'limit':_0x5b37fe[_0x6861('0x1b')]?_0x5b37fe[_0x6861('0x1b')]['limit']||null:null,'include':_0x5b37fe[_0x6861('0x1b')]?_0x5b37fe['options'][_0x6861('0x1e')]?_['map'](_0x5b37fe[_0x6861('0x1b')][_0x6861('0x1e')],function(_0x21a3ac){return{'model':db[_0x21a3ac[_0x6861('0x1f')]],'as':_0x21a3ac['as'],'attributes':_0x21a3ac[_0x6861('0x20')],'include':_0x21a3ac[_0x6861('0x1e')]?_[_0x6861('0x21')](_0x21a3ac['include'],function(_0x33979e){return{'model':db[_0x33979e[_0x6861('0x1f')]],'as':_0x33979e['as'],'attributes':_0x33979e[_0x6861('0x20')],'include':_0x33979e['include']?_[_0x6861('0x21')](_0x33979e[_0x6861('0x1e')],function(_0x482832){return{'model':db[_0x482832[_0x6861('0x1f')]],'as':_0x482832['as'],'attributes':_0x482832['attributes']};}):[]};}):[]};}):[]:[]})[_0x6861('0xd')](function(_0x33fd9a){logger['info'](_0x6861('0x19'),_0x5b37fe);logger[_0x6861('0x10')](_0x6861('0x19'),_0x5b37fe,JSON[_0x6861('0x12')](_0x33fd9a));_0x2c0364(_0x33fd9a);})[_0x6861('0x18')](function(_0x2ac96a){logger[_0x6861('0x13')](_0x6861('0x19'),_0x2ac96a[_0x6861('0x15')],_0x5b37fe);_0x529c23(_0x53519c[_0x6861('0x13')](0x1f4,_0x2ac96a['message']));});});};exports[_0x6861('0x22')]=function(_0xadde24){var _0x301a29=this;return new Promise(function(_0x192239,_0xae4ee3){return db[_0x6861('0x23')]['find']({'raw':_0xadde24[_0x6861('0x1b')]?_0xadde24[_0x6861('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xadde24[_0x6861('0x1b')]?_0xadde24[_0x6861('0x1b')][_0x6861('0x1d')]||null:null,'attributes':_0xadde24[_0x6861('0x1b')]?_0xadde24['options'][_0x6861('0x20')]||null:null,'include':_0xadde24['options']?_0xadde24['options'][_0x6861('0x1e')]?_['map'](_0xadde24[_0x6861('0x1b')][_0x6861('0x1e')],function(_0x2bff81){return{'model':db[_0x2bff81['model']],'as':_0x2bff81['as'],'attributes':_0x2bff81[_0x6861('0x20')],'include':_0x2bff81[_0x6861('0x1e')]?_[_0x6861('0x21')](_0x2bff81[_0x6861('0x1e')],function(_0x5c08ed){return{'model':db[_0x5c08ed['model']],'as':_0x5c08ed['as'],'attributes':_0x5c08ed[_0x6861('0x20')],'include':_0x5c08ed[_0x6861('0x1e')]?_[_0x6861('0x21')](_0x5c08ed[_0x6861('0x1e')],function(_0x1ad91e){return{'model':db[_0x1ad91e['model']],'as':_0x1ad91e['as'],'attributes':_0x1ad91e[_0x6861('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6861('0xd')](function(_0x4ca2cd){logger[_0x6861('0x16')](_0x6861('0x22'),_0xadde24);logger['debug'](_0x6861('0x22'),_0xadde24,JSON[_0x6861('0x12')](_0x4ca2cd));_0x192239(_0x4ca2cd);})[_0x6861('0x18')](function(_0x57be7c){logger['error'](_0x6861('0x22'),_0x57be7c[_0x6861('0x15')],_0xadde24);_0xae4ee3(_0x301a29[_0x6861('0x13')](0x1f4,_0x57be7c[_0x6861('0x15')]));});});};
\ No newline at end of file
index eaaaae8..9612ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2966=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x144e5d,_0x2757aa){var _0x483cbd=function(_0x1a7b13){while(--_0x1a7b13){_0x144e5d['push'](_0x144e5d['shift']());}};_0x483cbd(++_0x2757aa);}(_0x2966,0x187));var _0x6296=function(_0x5d22be,_0x199ba1){_0x5d22be=_0x5d22be-0x0;var _0xb5c5d3=_0x2966[_0x5d22be];return _0xb5c5d3;};'use strict';var MailQueueEvents=require(_0x6296('0x0'));var events=[_0x6296('0x1'),_0x6296('0x2'),_0x6296('0x3')];function createListener(_0x5132b3,_0x4f8de0){return function(_0x43446f){_0x4f8de0[_0x6296('0x4')](_0x5132b3,_0x43446f);};}function removeListener(_0x2e51cd,_0x189802){return function(){MailQueueEvents[_0x6296('0x5')](_0x2e51cd,_0x189802);};}exports[_0x6296('0x6')]=function(_0x333c2d){for(var _0x42bacf=0x0,_0x5aa664=events[_0x6296('0x7')];_0x42bacf<_0x5aa664;_0x42bacf++){var _0x50c4cf=events[_0x42bacf];var _0x3672eb=createListener(_0x6296('0x8')+_0x50c4cf,_0x333c2d);MailQueueEvents['on'](_0x50c4cf,_0x3672eb);}};
\ No newline at end of file
+var _0x3276=['update','emit','mailQueue:','./mailQueue.events'];(function(_0x543f28,_0x216cab){var _0x951f97=function(_0x5930e1){while(--_0x5930e1){_0x543f28['push'](_0x543f28['shift']());}};_0x951f97(++_0x216cab);}(_0x3276,0xc7));var _0x6327=function(_0x57fe61,_0x878c60){_0x57fe61=_0x57fe61-0x0;var _0x47ff99=_0x3276[_0x57fe61];return _0x47ff99;};'use strict';var MailQueueEvents=require(_0x6327('0x0'));var events=['save','remove',_0x6327('0x1')];function createListener(_0x18ab44,_0x23e033){return function(_0x1ca8a6){_0x23e033[_0x6327('0x2')](_0x18ab44,_0x1ca8a6);};}function removeListener(_0x1486a6,_0x436055){return function(){MailQueueEvents['removeListener'](_0x1486a6,_0x436055);};}exports['register']=function(_0x10b982){for(var _0x37adde=0x0,_0x1e6278=events['length'];_0x37adde<_0x1e6278;_0x37adde++){var _0x29ba24=events[_0x37adde];var _0x3e9616=createListener(_0x6327('0x3')+_0x29ba24,_0x10b982);MailQueueEvents['on'](_0x29ba24,_0x3e9616);}};
\ No newline at end of file
index 351e53b..16e34d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','show','post','put','delete','/:id','multer','path','connect-timeout','Router'];(function(_0x536b0e,_0x410223){var _0x3fa660=function(_0x393bfa){while(--_0x393bfa){_0x536b0e['push'](_0x536b0e['shift']());}};_0x3fa660(++_0x410223);}(_0xceed,0x12e));var _0xdcee=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xceed[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0xdcee('0x0'));var util=require('util');var path=require(_0xdcee('0x1'));var timeout=require(_0xdcee('0x2'));var express=require('express');var router=express[_0xdcee('0x3')]();var fs_extra=require(_0xdcee('0x4'));var auth=require(_0xdcee('0x5'));var interaction=require(_0xdcee('0x6'));var config=require(_0xdcee('0x7'));var controller=require(_0xdcee('0x8'));router[_0xdcee('0x9')]('/',auth[_0xdcee('0xa')](),controller['index']);router[_0xdcee('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xdcee('0xb')]);router[_0xdcee('0x9')]('/:id',auth[_0xdcee('0xa')](),controller[_0xdcee('0xc')]);router[_0xdcee('0xd')]('/',auth[_0xdcee('0xa')](),controller['create']);router[_0xdcee('0xe')]('/:id',auth[_0xdcee('0xa')](),controller['update']);router[_0xdcee('0xf')](_0xdcee('0x10'),auth[_0xdcee('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0f9a=['/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','/describe','isAuthenticated'];(function(_0x274349,_0x1e1ab9){var _0x27f7bc=function(_0x36f81f){while(--_0x36f81f){_0x274349['push'](_0x274349['shift']());}};_0x27f7bc(++_0x1e1ab9);}(_0x0f9a,0x14a));var _0xa0f9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0f9a[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xa0f9('0x0'));var path=require(_0xa0f9('0x1'));var timeout=require(_0xa0f9('0x2'));var express=require(_0xa0f9('0x3'));var router=express[_0xa0f9('0x4')]();var fs_extra=require(_0xa0f9('0x5'));var auth=require(_0xa0f9('0x6'));var interaction=require(_0xa0f9('0x7'));var config=require('../../config/environment');var controller=require(_0xa0f9('0x8'));router[_0xa0f9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0f9('0xa'),auth[_0xa0f9('0xb')](),controller['describe']);router['get'](_0xa0f9('0xc'),auth[_0xa0f9('0xb')](),controller['show']);router[_0xa0f9('0xd')]('/',auth[_0xa0f9('0xb')](),controller[_0xa0f9('0xe')]);router[_0xa0f9('0xf')](_0xa0f9('0xc'),auth['isAuthenticated'](),controller[_0xa0f9('0x10')]);router[_0xa0f9('0x11')](_0xa0f9('0xc'),auth[_0xa0f9('0xb')](),controller[_0xa0f9('0x12')]);module['exports']=router;
\ No newline at end of file
index 3b51a52..ae346e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee26=['sequelize','exports','STRING','DATE'];(function(_0x13c5a9,_0x95fb6a){var _0x393ee6=function(_0x136d23){while(--_0x136d23){_0x13c5a9['push'](_0x13c5a9['shift']());}};_0x393ee6(++_0x95fb6a);}(_0xee26,0x9c));var _0x6ee2=function(_0xcbd84b,_0x473395){_0xcbd84b=_0xcbd84b-0x0;var _0x129e07=_0xee26[_0xcbd84b];return _0x129e07;};'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
+var _0x2982=['DATE','moment','exports','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2982,0x8d));var _0x2298=function(_0x490db4,_0x268bae){_0x490db4=_0x490db4-0x0;var _0x58f559=_0x2982[_0x490db4];return _0x58f559;};'use strict';var moment=require(_0x2298('0x0'));var Sequelize=require('sequelize');module[_0x2298('0x1')]={'uniqueid':{'type':Sequelize[_0x2298('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2298('0x2')]},'joinAt':{'type':Sequelize[_0x2298('0x3')]},'leaveAt':{'type':Sequelize[_0x2298('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2298('0x3')]},'reason':{'type':Sequelize[_0x2298('0x2')]}};
\ No newline at end of file
index ffd573f..00b7166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','MailQueueReport','findAll','rows','catch','merge','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x66fa,0x117));var _0xa66f=function(_0x18a1b3,_0x204ea2){_0x18a1b3=_0x18a1b3-0x0;var _0x56dfcd=_0x66fa[_0x18a1b3];return _0x56dfcd;};'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 hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['MailQueueReport'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['MailQueueReport'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':!![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['MailQueueReport'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['MailQueueReport'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));};exports[_0xa66f('0x4a')]=function(_0x5d77d1,_0x389b9a){return db['MailQueueReport'][_0xa66f('0x4a')]()['then'](respondWithResult(_0x389b9a,null))['catch'](handleError(_0x389b9a,null));};
\ No newline at end of file
+var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x4a88cd,_0x43e240){var _0x2c861a=function(_0x5d6634){while(--_0x5d6634){_0x4a88cd['push'](_0x4a88cd['shift']());}};_0x2c861a(++_0x43e240);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));};
\ No newline at end of file
index 56e47f1..a6a3d5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8dc=['util','../../config/logger','moment','request-promise','path','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xf8dc,0x15b));var _0xcf8d=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xf8dc[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xcf8d('0x0'));var util=require(_0xcf8d('0x1'));var logger=require(_0xcf8d('0x2'))('api');var moment=require(_0xcf8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf8d('0x4'));var fs=require('fs');var path=require(_0xcf8d('0x5'));var rimraf=require('rimraf');var config=require(_0xcf8d('0x6'));var attributes=require(_0xcf8d('0x7'));module['exports']=function(_0x394105,_0xbbbdca){return _0x394105[_0xcf8d('0x8')](_0xcf8d('0x9'),attributes,{'tableName':_0xcf8d('0xa'),'paranoid':![],'indexes':[{'name':_0xcf8d('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c03=['MailQueueReport','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x20d1b8,_0x3fc412){var _0x559a2a=function(_0x2338df){while(--_0x2338df){_0x20d1b8['push'](_0x20d1b8['shift']());}};_0x559a2a(++_0x3fc412);}(_0x6c03,0x1c4));var _0x36c0=function(_0xd0e888,_0x34ddfd){_0xd0e888=_0xd0e888-0x0;var _0x3f60fb=_0x6c03[_0xd0e888];return _0x3f60fb;};'use strict';var _=require(_0x36c0('0x0'));var util=require(_0x36c0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x36c0('0x2'));var rp=require(_0x36c0('0x3'));var fs=require('fs');var path=require(_0x36c0('0x4'));var rimraf=require(_0x36c0('0x5'));var config=require(_0x36c0('0x6'));var attributes=require(_0x36c0('0x7'));module['exports']=function(_0xf6acea,_0xaa2d4b){return _0xf6acea['define'](_0x36c0('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x36c0('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index b9217c7..085bf1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x394b27,_0x2a630a){var _0x4014a5=function(_0xb2fc30){while(--_0xb2fc30){_0x394b27['push'](_0x394b27['shift']());}};_0x4014a5(++_0x2a630a);}(_0x7a54,0x106));var _0x47a5=function(_0x49ce1e,_0x1ee258){_0x49ce1e=_0x49ce1e-0x0;var _0x30491c=_0x7a54[_0x49ce1e];return _0x30491c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4578a9,_0x5297b2){var _0x24eef8=function(_0x3b3d1a){while(--_0x3b3d1a){_0x4578a9['push'](_0x4578a9['shift']());}};_0x24eef8(++_0x5297b2);}(_0xadb5,0xad));var _0x5adb=function(_0x2647ff,_0x2b8588){_0x2647ff=_0x2647ff-0x0;var _0x44bfa9=_0xadb5[_0x2647ff];return _0x44bfa9;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index a20c5ee..a0e517e 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(_0x2fc1f6,_0x51543e){var _0x7a3346=function(_0x589b08){while(--_0x589b08){_0x2fc1f6['push'](_0x2fc1f6['shift']());}};_0x7a3346(++_0x51543e);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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 a020bef..76b255a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcffe=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x337cbf,_0x37d150){var _0x25e325=function(_0x4d2754){while(--_0x4d2754){_0x337cbf['push'](_0x337cbf['shift']());}};_0x25e325(++_0x37d150);}(_0xcffe,0x1a1));var _0xecff=function(_0x3b0999,_0x3c9835){_0x3b0999=_0x3b0999-0x0;var _0x585226=_0xcffe[_0x3b0999];return _0x585226;};'use strict';var Sequelize=require(_0xecff('0x0'));module[_0xecff('0x1')]={'description':{'type':Sequelize[_0xecff('0x2')]},'host':{'type':Sequelize[_0xecff('0x2')]},'authentication':{'type':Sequelize[_0xecff('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xecff('0x2')]},'password':{'type':Sequelize[_0xecff('0x2')]},'port':{'type':Sequelize[_0xecff('0x4')]},'tls':{'type':Sequelize[_0xecff('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xecff('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xecff('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xecff('0x2')]}};
\ No newline at end of file
+var _0x693f=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x45929e,_0x4d9b79){var _0x127e8f=function(_0x460fb7){while(--_0x460fb7){_0x45929e['push'](_0x45929e['shift']());}};_0x127e8f(++_0x4d9b79);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf693('0x0'));module[_0xf693('0x1')]={'description':{'type':Sequelize[_0xf693('0x2')]},'host':{'type':Sequelize[_0xf693('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xf693('0x2')]},'password':{'type':Sequelize[_0xf693('0x2')]},'port':{'type':Sequelize[_0xf693('0x3')]},'tls':{'type':Sequelize[_0xf693('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf693('0x2')],'defaultValue':_0xf693('0x5')},'connTimeout':{'type':Sequelize[_0xf693('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xf693('0x2')]}};
\ No newline at end of file
index 1f5a91b..62df763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b8=['./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1df378,_0x2c4af3){var _0x2cb9fe=function(_0x52c506){while(--_0x52c506){_0x1df378['push'](_0x1df378['shift']());}};_0x2cb9fe(++_0x2c4af3);}(_0x04b8,0x79));var _0x804b=function(_0x484fc9,_0x4598aa){_0x484fc9=_0x484fc9-0x0;var _0x89aa01=_0x04b8[_0x484fc9];return _0x89aa01;};'use strict';var _=require(_0x804b('0x0'));var util=require(_0x804b('0x1'));var logger=require(_0x804b('0x2'))(_0x804b('0x3'));var moment=require(_0x804b('0x4'));var BPromise=require(_0x804b('0x5'));var rp=require(_0x804b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x804b('0x7'));var config=require(_0x804b('0x8'));var attributes=require(_0x804b('0x9'));module[_0x804b('0xa')]=function(_0x455178,_0x57405a){return _0x455178[_0x804b('0xb')]('MailServerIn',attributes,{'tableName':_0x804b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5ad=['define','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x4d6748,_0x1e6997){var _0x5e8e6a=function(_0x385dc8){while(--_0x385dc8){_0x4d6748['push'](_0x4d6748['shift']());}};_0x5e8e6a(++_0x1e6997);}(_0xd5ad,0x16b));var _0xdd5a=function(_0x37ad1b,_0x356141){_0x37ad1b=_0x37ad1b-0x0;var _0x780998=_0xd5ad[_0x37ad1b];return _0x780998;};'use strict';var _=require('lodash');var util=require(_0xdd5a('0x0'));var logger=require(_0xdd5a('0x1'))(_0xdd5a('0x2'));var moment=require(_0xdd5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd5a('0x5'));var config=require(_0xdd5a('0x6'));var attributes=require(_0xdd5a('0x7'));module[_0xdd5a('0x8')]=function(_0x1d4784,_0x34b4aa){return _0x1d4784[_0xdd5a('0x9')](_0xdd5a('0xa'),attributes,{'tableName':_0xdd5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f7b4ab2..f519db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d4=['stringify','error','message','MailServerIn','options','attributes','include','map','model','GetMailServerIn','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0x35d4,0x1e7));var _0x435d=function(_0x374895,_0x3caad5){_0x374895=_0x374895-0x0;var _0x2e02ad=_0x35d4[_0x374895];return _0x2e02ad;};'use strict';var _=require(_0x435d('0x0'));var util=require('util');var moment=require(_0x435d('0x1'));var BPromise=require(_0x435d('0x2'));var rs=require(_0x435d('0x3'));var fs=require('fs');var Redis=require(_0x435d('0x4'));var db=require(_0x435d('0x5'))['db'];var utils=require(_0x435d('0x6'));var logger=require(_0x435d('0x7'))('rpc');var config=require(_0x435d('0x8'));var jayson=require(_0x435d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1cc7,_0x55b365,_0x5f39e1){return new BPromise(function(_0xfbcabe,_0x594ae1){return client[_0x435d('0xa')](_0x2b1cc7,_0x5f39e1)[_0x435d('0xb')](function(_0x40b818){logger[_0x435d('0xc')](_0x435d('0xd'),_0x55b365,_0x435d('0xe'));logger[_0x435d('0xf')](_0x435d('0x10'),_0x55b365,'request\x20sent',JSON[_0x435d('0x11')](_0x40b818));if(_0x40b818[_0x435d('0x12')]){if(_0x40b818[_0x435d('0x12')]['code']===0x1f4){logger[_0x435d('0x12')](_0x435d('0xd'),_0x55b365,_0x40b818[_0x435d('0x12')][_0x435d('0x13')]);return _0x594ae1(_0x40b818['error'][_0x435d('0x13')]);}logger['error'](_0x435d('0xd'),_0x55b365,_0x40b818[_0x435d('0x12')]['message']);return _0xfbcabe(_0x40b818[_0x435d('0x12')][_0x435d('0x13')]);}else{logger[_0x435d('0xc')]('MailServerIn,\x20%s,\x20%s',_0x55b365,'request\x20sent');_0xfbcabe(_0x40b818['result'][_0x435d('0x13')]);}})['catch'](function(_0x39eba7){logger[_0x435d('0x12')]('MailServerIn,\x20%s,\x20%s',_0x55b365,_0x39eba7);_0x594ae1(_0x39eba7);});});}exports['GetMailServerIn']=function(_0x7871b4){var _0x3f653a=this;return new Promise(function(_0x44dbbd,_0x583315){return db[_0x435d('0x14')]['findAll']({'raw':_0x7871b4[_0x435d('0x15')]?_0x7871b4[_0x435d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x7871b4['options']?_0x7871b4[_0x435d('0x15')]['where']||null:null,'attributes':_0x7871b4[_0x435d('0x15')]?_0x7871b4[_0x435d('0x15')][_0x435d('0x16')]||null:null,'limit':_0x7871b4['options']?_0x7871b4[_0x435d('0x15')]['limit']||null:null,'include':_0x7871b4[_0x435d('0x15')]?_0x7871b4['options'][_0x435d('0x17')]?_[_0x435d('0x18')](_0x7871b4[_0x435d('0x15')][_0x435d('0x17')],function(_0x41d91){return{'model':db[_0x41d91[_0x435d('0x19')]],'as':_0x41d91['as'],'attributes':_0x41d91[_0x435d('0x16')],'include':_0x41d91[_0x435d('0x17')]?_['map'](_0x41d91[_0x435d('0x17')],function(_0x2be3b8){return{'model':db[_0x2be3b8[_0x435d('0x19')]],'as':_0x2be3b8['as'],'attributes':_0x2be3b8[_0x435d('0x16')],'include':_0x2be3b8[_0x435d('0x17')]?_[_0x435d('0x18')](_0x2be3b8['include'],function(_0x165a47){return{'model':db[_0x165a47['model']],'as':_0x165a47['as'],'attributes':_0x165a47['attributes']};}):[]};}):[]};}):[]:[]})[_0x435d('0xb')](function(_0x219f59){logger[_0x435d('0xc')]('GetMailServerIn',_0x7871b4);logger['debug'](_0x435d('0x1a'),_0x7871b4,JSON[_0x435d('0x11')](_0x219f59));_0x44dbbd(_0x219f59);})[_0x435d('0x1b')](function(_0x112830){logger['error'](_0x435d('0x1a'),_0x112830[_0x435d('0x13')],_0x7871b4);_0x583315(_0x3f653a[_0x435d('0x12')](0x1f4,_0x112830[_0x435d('0x13')]));});});};
\ No newline at end of file
+var _0xc737=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','options','where','limit','include','map','model','attributes','GetMailServerIn','stringify','lodash'];(function(_0x3edb33,_0xa4302d){var _0x238608=function(_0xa0310f){while(--_0xa0310f){_0x3edb33['push'](_0x3edb33['shift']());}};_0x238608(++_0xa4302d);}(_0xc737,0x154));var _0x7c73=function(_0x208622,_0x124de9){_0x208622=_0x208622-0x0;var _0x5ae7d2=_0xc737[_0x208622];return _0x5ae7d2;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require(_0x7c73('0x2'));var BPromise=require(_0x7c73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require('../../config/logger')(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6f81,_0x57e442,_0x9264a9){return new BPromise(function(_0x3281fe,_0x5bf225){return client['request'](_0x3f6f81,_0x9264a9)[_0x7c73('0xa')](function(_0x8237f){logger[_0x7c73('0xb')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'));logger[_0x7c73('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'),JSON['stringify'](_0x8237f));if(_0x8237f[_0x7c73('0xe')]){if(_0x8237f[_0x7c73('0xe')][_0x7c73('0xf')]===0x1f4){logger['error'](_0x7c73('0x10'),_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x5bf225(_0x8237f[_0x7c73('0xe')]['message']);}logger[_0x7c73('0xe')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x3281fe(_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);}else{logger[_0x7c73('0xb')](_0x7c73('0x10'),_0x57e442,_0x7c73('0xc'));_0x3281fe(_0x8237f[_0x7c73('0x12')]['message']);}})[_0x7c73('0x13')](function(_0x562b50){logger[_0x7c73('0xe')](_0x7c73('0x10'),_0x57e442,_0x562b50);_0x5bf225(_0x562b50);});});}exports['GetMailServerIn']=function(_0x534a39){var _0x1932c2=this;return new Promise(function(_0x4a2ebc,_0x5cc261){return db[_0x7c73('0x14')][_0x7c73('0x15')]({'raw':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x17')]||null:null,'attributes':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['attributes']||null:null,'limit':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x18')]||null:null,'include':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')],function(_0x4c8933){return{'model':db[_0x4c8933[_0x7c73('0x1b')]],'as':_0x4c8933['as'],'attributes':_0x4c8933['attributes'],'include':_0x4c8933[_0x7c73('0x19')]?_['map'](_0x4c8933[_0x7c73('0x19')],function(_0x57dd84){return{'model':db[_0x57dd84[_0x7c73('0x1b')]],'as':_0x57dd84['as'],'attributes':_0x57dd84['attributes'],'include':_0x57dd84[_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x57dd84[_0x7c73('0x19')],function(_0x5b8bc9){return{'model':db[_0x5b8bc9[_0x7c73('0x1b')]],'as':_0x5b8bc9['as'],'attributes':_0x5b8bc9[_0x7c73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c73('0xa')](function(_0x5ad41e){logger[_0x7c73('0xb')](_0x7c73('0x1d'),_0x534a39);logger[_0x7c73('0xd')](_0x7c73('0x1d'),_0x534a39,JSON[_0x7c73('0x1e')](_0x5ad41e));_0x4a2ebc(_0x5ad41e);})[_0x7c73('0x13')](function(_0x5800eb){logger['error']('GetMailServerIn',_0x5800eb[_0x7c73('0x11')],_0x534a39);_0x5cc261(_0x1932c2[_0x7c73('0xe')](0x1f4,_0x5800eb[_0x7c73('0x11')]));});});};
\ No newline at end of file
index 457dbeb..dc219b4 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(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x55b24a,_0x327596){_0x55b24a=_0x55b24a-0x0;var _0xeba473=_0x7a54[_0x55b24a];return _0xeba473;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x35a8d7,_0x11b623){_0x35a8d7=_0x35a8d7-0x0;var _0x52761c=_0x7a54[_0x35a8d7];return _0x52761c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index e1591d3..248aa1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa151=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5e92be,_0x4ad0d2){var _0x41340c=function(_0x4d5cca){while(--_0x4d5cca){_0x5e92be['push'](_0x5e92be['shift']());}};_0x41340c(++_0x4ad0d2);}(_0xa151,0x13d));var _0x1a15=function(_0x4e5a80,_0x1e4e75){_0x4e5a80=_0x4e5a80-0x0;var _0x468bb0=_0xa151[_0x4e5a80];return _0x468bb0;};'use strict';var Sequelize=require(_0x1a15('0x0'));module[_0x1a15('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1a15('0x2')]},'user':{'type':Sequelize[_0x1a15('0x2')]},'pass':{'type':Sequelize[_0x1a15('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x1a15('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x1a15('0x2')]},'authentication':{'type':Sequelize[_0x1a15('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xaf4f=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x550691,_0x19fe04){var _0x25f1e2=function(_0xe2eebd){while(--_0xe2eebd){_0x550691['push'](_0x550691['shift']());}};_0x25f1e2(++_0x19fe04);}(_0xaf4f,0x136));var _0xfaf4=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0xaf4f[_0x2637ac];return _0x4a5758;};'use strict';var Sequelize=require(_0xfaf4('0x0'));module[_0xfaf4('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xfaf4('0x2')]},'user':{'type':Sequelize[_0xfaf4('0x2')]},'pass':{'type':Sequelize[_0xfaf4('0x2')]},'port':{'type':Sequelize[_0xfaf4('0x3')]},'secure':{'type':Sequelize[_0xfaf4('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xfaf4('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index cc5e802..b245523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ea=['then','sendStatus','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','rows','catch','show','params','include','options','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0xd4ea,0x112));var _0xad4e=function(_0x5bd0f1,_0x567887){_0x5bd0f1=_0x5bd0f1-0x0;var _0x17838c=_0xd4ea[_0x5bd0f1];return _0x17838c;};'use strict';var emlformat=require(_0xad4e('0x0'));var rimraf=require(_0xad4e('0x1'));var zipdir=require(_0xad4e('0x2'));var jsonpatch=require(_0xad4e('0x3'));var rp=require(_0xad4e('0x4'));var moment=require(_0xad4e('0x5'));var BPromise=require(_0xad4e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xad4e('0x7'));var csv=require(_0xad4e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad4e('0x9'));var _=require('lodash');var squel=require(_0xad4e('0xa'));var crypto=require(_0xad4e('0xb'));var jsforce=require(_0xad4e('0xc'));var deskjs=require(_0xad4e('0xd'));var toCsv=require(_0xad4e('0x8'));var querystring=require(_0xad4e('0xe'));var Papa=require(_0xad4e('0xf'));var Redis=require('ioredis');var authService=require(_0xad4e('0x10'));var qs=require(_0xad4e('0x11'));var as=require(_0xad4e('0x12'));var hardwareService=require(_0xad4e('0x13'));var logger=require(_0xad4e('0x14'))(_0xad4e('0x15'));var utils=require(_0xad4e('0x16'));var config=require(_0xad4e('0x17'));var licenseUtil=require(_0xad4e('0x18'));var db=require(_0xad4e('0x19'))['db'];function respondWithStatusCode(_0xd3a4d4,_0x3091e1){_0x3091e1=_0x3091e1||0xcc;return function(_0x188b88){if(_0x188b88){return _0xd3a4d4['sendStatus'](_0x3091e1);}return _0xd3a4d4[_0xad4e('0x1a')](_0x3091e1)[_0xad4e('0x1b')]();};}function respondWithResult(_0x3aeefb,_0x3c822b){_0x3c822b=_0x3c822b||0xc8;return function(_0xa6e755){if(_0xa6e755){return _0x3aeefb[_0xad4e('0x1a')](_0x3c822b)[_0xad4e('0x1c')](_0xa6e755);}};}function respondWithFilteredResult(_0x26e55c,_0x3d8017){return function(_0xb0a233){if(_0xb0a233){var _0x1f2d56=typeof _0x3d8017[_0xad4e('0x1d')]===_0xad4e('0x1e')&&typeof _0x3d8017[_0xad4e('0x1f')]===_0xad4e('0x1e');var _0x3b5c9c=_0xb0a233['count'];var _0x12739f=_0x1f2d56?0x0:_0x3d8017[_0xad4e('0x1d')];var _0x1969a1=_0x1f2d56?_0xb0a233[_0xad4e('0x20')]:_0x3d8017[_0xad4e('0x1d')]+_0x3d8017[_0xad4e('0x1f')];var _0x123f8a;if(_0x1969a1>=_0x3b5c9c){_0x1969a1=_0x3b5c9c;_0x123f8a=0xc8;}else{_0x123f8a=0xce;}_0x26e55c[_0xad4e('0x1a')](_0x123f8a);return _0x26e55c[_0xad4e('0x21')](_0xad4e('0x22'),_0x12739f+'-'+_0x1969a1+'/'+_0x3b5c9c)[_0xad4e('0x1c')](_0xb0a233);}return null;};}function patchUpdates(_0x25fb45){return function(_0x155864){try{jsonpatch[_0xad4e('0x23')](_0x155864,_0x25fb45,!![]);}catch(_0x4132d9){return BPromise[_0xad4e('0x24')](_0x4132d9);}return _0x155864[_0xad4e('0x25')]();};}function saveUpdates(_0xc8677e,_0x4c6323){return function(_0x5bb04a){if(_0x5bb04a){return _0x5bb04a['update'](_0xc8677e)[_0xad4e('0x26')](function(_0x1140e3){return _0x1140e3;});}return null;};}function removeEntity(_0x42718d,_0x471336){return function(_0x3d81a9){if(_0x3d81a9){return _0x3d81a9['destroy']()[_0xad4e('0x26')](function(){_0x42718d[_0xad4e('0x1a')](0xcc)[_0xad4e('0x1b')]();});}};}function handleEntityNotFound(_0x4065d0,_0x5a6c4a){return function(_0x5806b4){if(!_0x5806b4){_0x4065d0[_0xad4e('0x27')](0x194);}return _0x5806b4;};}function handleError(_0xdc5d28,_0x53ed89){_0x53ed89=_0x53ed89||0x1f4;return function(_0x3c56a1){logger[_0xad4e('0x28')](_0x3c56a1['stack']);if(_0x3c56a1[_0xad4e('0x29')]){delete _0x3c56a1[_0xad4e('0x29')];}_0xdc5d28[_0xad4e('0x1a')](_0x53ed89)[_0xad4e('0x2a')](_0x3c56a1);};}exports[_0xad4e('0x2b')]=function(_0x2bfb49,_0x223a18){var _0x10c046={},_0x2b6079={},_0x4920ea={'count':0x0,'rows':[]};var _0x48d15b=_[_0xad4e('0x2c')](db[_0xad4e('0x2d')][_0xad4e('0x2e')],function(_0x5409e8){return{'name':_0x5409e8[_0xad4e('0x2f')],'type':_0x5409e8[_0xad4e('0x30')][_0xad4e('0x31')]};});_0x2b6079['model']=_[_0xad4e('0x2c')](_0x48d15b,_0xad4e('0x29'));_0x2b6079['query']=_[_0xad4e('0x32')](_0x2bfb49[_0xad4e('0x33')]);_0x2b6079[_0xad4e('0x34')]=_[_0xad4e('0x35')](_0x2b6079['model'],_0x2b6079[_0xad4e('0x33')]);_0x10c046['attributes']=_[_0xad4e('0x35')](_0x2b6079[_0xad4e('0x36')],qs[_0xad4e('0x37')](_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x37')]));_0x10c046['attributes']=_0x10c046['attributes'][_0xad4e('0x38')]?_0x10c046[_0xad4e('0x39')]:_0x2b6079[_0xad4e('0x36')];if(!_0x2bfb49['query'][_0xad4e('0x3a')](_0xad4e('0x3b'))){_0x10c046[_0xad4e('0x1f')]=qs[_0xad4e('0x1f')](_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x1f')]);_0x10c046[_0xad4e('0x1d')]=qs[_0xad4e('0x1d')](_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x1d')]);}_0x10c046[_0xad4e('0x3c')]=qs['sort'](_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x3d')]);_0x10c046['where']=qs[_0xad4e('0x34')](_[_0xad4e('0x3e')](_0x2bfb49[_0xad4e('0x33')],_0x2b6079[_0xad4e('0x34')]),_0x48d15b);if(_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x3f')]){_0x10c046['where']=_[_0xad4e('0x40')](_0x10c046[_0xad4e('0x41')],{'$or':_[_0xad4e('0x2c')](_0x48d15b,function(_0x13d3ed){if(_0x13d3ed[_0xad4e('0x30')]!=='VIRTUAL'){var _0x18eda3={};_0x18eda3[_0x13d3ed[_0xad4e('0x29')]]={'$like':'%'+_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x3f')]+'%'};return _0x18eda3;}})});}_0x10c046=_[_0xad4e('0x40')]({},_0x10c046,_0x2bfb49['options']);var _0x1cae76={'where':_0x10c046[_0xad4e('0x41')]};return db[_0xad4e('0x2d')][_0xad4e('0x20')](_0x1cae76)[_0xad4e('0x26')](function(_0x5afd3f){_0x4920ea[_0xad4e('0x20')]=_0x5afd3f;if(_0x2bfb49[_0xad4e('0x33')][_0xad4e('0x42')]){_0x10c046['include']=[{'all':!![]}];}return db[_0xad4e('0x2d')]['findAll'](_0x10c046);})[_0xad4e('0x26')](function(_0x2c834f){_0x4920ea[_0xad4e('0x43')]=_0x2c834f;return _0x4920ea;})[_0xad4e('0x26')](respondWithFilteredResult(_0x223a18,_0x10c046))[_0xad4e('0x44')](handleError(_0x223a18,null));};exports[_0xad4e('0x45')]=function(_0x1d551a,_0x4e601f){var _0x25618e={'raw':!![],'where':{'id':_0x1d551a[_0xad4e('0x46')]['id']}},_0x16ecf5={};_0x16ecf5[_0xad4e('0x36')]=_[_0xad4e('0x32')](db[_0xad4e('0x2d')][_0xad4e('0x2e')]);_0x16ecf5['query']=_[_0xad4e('0x32')](_0x1d551a['query']);_0x16ecf5[_0xad4e('0x34')]=_[_0xad4e('0x35')](_0x16ecf5[_0xad4e('0x36')],_0x16ecf5['query']);_0x25618e[_0xad4e('0x39')]=_[_0xad4e('0x35')](_0x16ecf5[_0xad4e('0x36')],qs[_0xad4e('0x37')](_0x1d551a['query'][_0xad4e('0x37')]));_0x25618e[_0xad4e('0x39')]=_0x25618e['attributes'][_0xad4e('0x38')]?_0x25618e['attributes']:_0x16ecf5[_0xad4e('0x36')];if(_0x1d551a[_0xad4e('0x33')][_0xad4e('0x42')]){_0x25618e[_0xad4e('0x47')]=[{'all':!![]}];}_0x25618e=_[_0xad4e('0x40')]({},_0x25618e,_0x1d551a[_0xad4e('0x48')]);return db[_0xad4e('0x2d')][_0xad4e('0x49')](_0x25618e)['then'](handleEntityNotFound(_0x4e601f,null))[_0xad4e('0x26')](respondWithResult(_0x4e601f,null))[_0xad4e('0x44')](handleError(_0x4e601f,null));};exports[_0xad4e('0x4a')]=function(_0x3f8f78,_0x301d8e){return db['MailServerOut'][_0xad4e('0x4a')](_0x3f8f78[_0xad4e('0x4b')],{})[_0xad4e('0x26')](respondWithResult(_0x301d8e,0xc9))[_0xad4e('0x44')](handleError(_0x301d8e,null));};exports[_0xad4e('0x4c')]=function(_0x571d32,_0x298d1d){if(_0x571d32[_0xad4e('0x4b')]['id']){delete _0x571d32[_0xad4e('0x4b')]['id'];}return db[_0xad4e('0x2d')]['find']({'where':{'id':_0x571d32[_0xad4e('0x46')]['id']}})['then'](handleEntityNotFound(_0x298d1d,null))[_0xad4e('0x26')](saveUpdates(_0x571d32[_0xad4e('0x4b')],null))[_0xad4e('0x26')](respondWithResult(_0x298d1d,null))[_0xad4e('0x44')](handleError(_0x298d1d,null));};exports[_0xad4e('0x4d')]=function(_0x15bac4,_0x539d53){return db[_0xad4e('0x2d')][_0xad4e('0x49')]({'where':{'id':_0x15bac4['params']['id']}})['then'](handleEntityNotFound(_0x539d53,null))[_0xad4e('0x26')](removeEntity(_0x539d53,null))[_0xad4e('0x44')](handleError(_0x539d53,null));};
\ No newline at end of file
+var _0xead9=['findAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x14b5a5,_0x231b3a){var _0x2a7706=function(_0x2d451d){while(--_0x2d451d){_0x14b5a5['push'](_0x14b5a5['shift']());}};_0x2a7706(++_0x231b3a);}(_0xead9,0x12e));var _0x9ead=function(_0xb9ae86,_0x13133f){_0xb9ae86=_0xb9ae86-0x0;var _0x4d183b=_0xead9[_0xb9ae86];return _0x4d183b;};'use strict';var emlformat=require(_0x9ead('0x0'));var rimraf=require(_0x9ead('0x1'));var zipdir=require(_0x9ead('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ead('0x3'));var Mustache=require('mustache');var util=require(_0x9ead('0x4'));var path=require('path');var sox=require(_0x9ead('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ead('0x6'));var _=require(_0x9ead('0x7'));var squel=require(_0x9ead('0x8'));var crypto=require(_0x9ead('0x9'));var jsforce=require(_0x9ead('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9ead('0xb'));var querystring=require(_0x9ead('0xc'));var Papa=require(_0x9ead('0xd'));var Redis=require(_0x9ead('0xe'));var authService=require(_0x9ead('0xf'));var qs=require(_0x9ead('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ead('0x11'))(_0x9ead('0x12'));var utils=require(_0x9ead('0x13'));var config=require(_0x9ead('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20f857,_0x283466){_0x283466=_0x283466||0xcc;return function(_0xeb1c76){if(_0xeb1c76){return _0x20f857[_0x9ead('0x15')](_0x283466);}return _0x20f857[_0x9ead('0x16')](_0x283466)[_0x9ead('0x17')]();};}function respondWithResult(_0x293996,_0x503b49){_0x503b49=_0x503b49||0xc8;return function(_0x1b2d18){if(_0x1b2d18){return _0x293996[_0x9ead('0x16')](_0x503b49)[_0x9ead('0x18')](_0x1b2d18);}};}function respondWithFilteredResult(_0x3b4ba2,_0x4372e6){return function(_0x3b9c88){if(_0x3b9c88){var _0x1fec1c=typeof _0x4372e6['offset']===_0x9ead('0x19')&&typeof _0x4372e6[_0x9ead('0x1a')]==='undefined';var _0x226285=_0x3b9c88[_0x9ead('0x1b')];var _0x4dd5e4=_0x1fec1c?0x0:_0x4372e6[_0x9ead('0x1c')];var _0x1796b9=_0x1fec1c?_0x3b9c88[_0x9ead('0x1b')]:_0x4372e6[_0x9ead('0x1c')]+_0x4372e6['limit'];var _0x4d8beb;if(_0x1796b9>=_0x226285){_0x1796b9=_0x226285;_0x4d8beb=0xc8;}else{_0x4d8beb=0xce;}_0x3b4ba2[_0x9ead('0x16')](_0x4d8beb);return _0x3b4ba2[_0x9ead('0x1d')](_0x9ead('0x1e'),_0x4dd5e4+'-'+_0x1796b9+'/'+_0x226285)[_0x9ead('0x18')](_0x3b9c88);}return null;};}function patchUpdates(_0x19b4c9){return function(_0x4c5bb2){try{jsonpatch[_0x9ead('0x1f')](_0x4c5bb2,_0x19b4c9,!![]);}catch(_0x37aa1e){return BPromise[_0x9ead('0x20')](_0x37aa1e);}return _0x4c5bb2[_0x9ead('0x21')]();};}function saveUpdates(_0x460de4,_0x146c80){return function(_0x1dda6a){if(_0x1dda6a){return _0x1dda6a[_0x9ead('0x22')](_0x460de4)['then'](function(_0xe9ce23){return _0xe9ce23;});}return null;};}function removeEntity(_0x5f2e25,_0x5bb958){return function(_0x18ab96){if(_0x18ab96){return _0x18ab96['destroy']()[_0x9ead('0x23')](function(){_0x5f2e25[_0x9ead('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13f2e3,_0x5dfd6a){return function(_0xe7654f){if(!_0xe7654f){_0x13f2e3['sendStatus'](0x194);}return _0xe7654f;};}function handleError(_0x2dd097,_0x5cd90c){_0x5cd90c=_0x5cd90c||0x1f4;return function(_0x1f1896){logger[_0x9ead('0x24')](_0x1f1896['stack']);if(_0x1f1896[_0x9ead('0x25')]){delete _0x1f1896[_0x9ead('0x25')];}_0x2dd097[_0x9ead('0x16')](_0x5cd90c)[_0x9ead('0x26')](_0x1f1896);};}exports[_0x9ead('0x27')]=function(_0x508644,_0x513df3){var _0x3131bc={},_0x58a58f={},_0x19a2ab={'count':0x0,'rows':[]};var _0x1a14ae=_[_0x9ead('0x28')](db[_0x9ead('0x29')][_0x9ead('0x2a')],function(_0x309b02){return{'name':_0x309b02[_0x9ead('0x2b')],'type':_0x309b02[_0x9ead('0x2c')]['key']};});_0x58a58f[_0x9ead('0x2d')]=_[_0x9ead('0x28')](_0x1a14ae,_0x9ead('0x25'));_0x58a58f[_0x9ead('0x2e')]=_[_0x9ead('0x2f')](_0x508644[_0x9ead('0x2e')]);_0x58a58f[_0x9ead('0x30')]=_[_0x9ead('0x31')](_0x58a58f[_0x9ead('0x2d')],_0x58a58f['query']);_0x3131bc['attributes']=_[_0x9ead('0x31')](_0x58a58f['model'],qs[_0x9ead('0x32')](_0x508644[_0x9ead('0x2e')][_0x9ead('0x32')]));_0x3131bc['attributes']=_0x3131bc[_0x9ead('0x33')]['length']?_0x3131bc[_0x9ead('0x33')]:_0x58a58f['model'];if(!_0x508644[_0x9ead('0x2e')]['hasOwnProperty'](_0x9ead('0x34'))){_0x3131bc[_0x9ead('0x1a')]=qs[_0x9ead('0x1a')](_0x508644[_0x9ead('0x2e')][_0x9ead('0x1a')]);_0x3131bc[_0x9ead('0x1c')]=qs[_0x9ead('0x1c')](_0x508644[_0x9ead('0x2e')][_0x9ead('0x1c')]);}_0x3131bc[_0x9ead('0x35')]=qs[_0x9ead('0x36')](_0x508644[_0x9ead('0x2e')][_0x9ead('0x36')]);_0x3131bc['where']=qs[_0x9ead('0x30')](_[_0x9ead('0x37')](_0x508644[_0x9ead('0x2e')],_0x58a58f[_0x9ead('0x30')]),_0x1a14ae);if(_0x508644['query'][_0x9ead('0x38')]){_0x3131bc[_0x9ead('0x39')]=_['merge'](_0x3131bc[_0x9ead('0x39')],{'$or':_[_0x9ead('0x28')](_0x1a14ae,function(_0x596d0d){if(_0x596d0d['type']!==_0x9ead('0x3a')){var _0x2f02dc={};_0x2f02dc[_0x596d0d['name']]={'$like':'%'+_0x508644[_0x9ead('0x2e')]['filter']+'%'};return _0x2f02dc;}})});}_0x3131bc=_[_0x9ead('0x3b')]({},_0x3131bc,_0x508644[_0x9ead('0x3c')]);var _0x3e53be={'where':_0x3131bc['where']};return db[_0x9ead('0x29')][_0x9ead('0x1b')](_0x3e53be)[_0x9ead('0x23')](function(_0x35d477){_0x19a2ab[_0x9ead('0x1b')]=_0x35d477;if(_0x508644[_0x9ead('0x2e')][_0x9ead('0x3d')]){_0x3131bc[_0x9ead('0x3e')]=[{'all':!![]}];}return db[_0x9ead('0x29')][_0x9ead('0x3f')](_0x3131bc);})['then'](function(_0x59a9df){_0x19a2ab[_0x9ead('0x40')]=_0x59a9df;return _0x19a2ab;})[_0x9ead('0x23')](respondWithFilteredResult(_0x513df3,_0x3131bc))['catch'](handleError(_0x513df3,null));};exports[_0x9ead('0x41')]=function(_0x505797,_0x578a3e){var _0x464e2e={'raw':!![],'where':{'id':_0x505797[_0x9ead('0x42')]['id']}},_0x381e2e={};_0x381e2e['model']=_['keys'](db[_0x9ead('0x29')]['rawAttributes']);_0x381e2e[_0x9ead('0x2e')]=_['keys'](_0x505797[_0x9ead('0x2e')]);_0x381e2e[_0x9ead('0x30')]=_[_0x9ead('0x31')](_0x381e2e['model'],_0x381e2e[_0x9ead('0x2e')]);_0x464e2e[_0x9ead('0x33')]=_['intersection'](_0x381e2e[_0x9ead('0x2d')],qs[_0x9ead('0x32')](_0x505797[_0x9ead('0x2e')][_0x9ead('0x32')]));_0x464e2e[_0x9ead('0x33')]=_0x464e2e['attributes'][_0x9ead('0x43')]?_0x464e2e['attributes']:_0x381e2e[_0x9ead('0x2d')];if(_0x505797[_0x9ead('0x2e')][_0x9ead('0x3d')]){_0x464e2e[_0x9ead('0x3e')]=[{'all':!![]}];}_0x464e2e=_[_0x9ead('0x3b')]({},_0x464e2e,_0x505797['options']);return db['MailServerOut'][_0x9ead('0x44')](_0x464e2e)['then'](handleEntityNotFound(_0x578a3e,null))[_0x9ead('0x23')](respondWithResult(_0x578a3e,null))[_0x9ead('0x45')](handleError(_0x578a3e,null));};exports['create']=function(_0x3a9cfe,_0x108154){return db['MailServerOut'][_0x9ead('0x46')](_0x3a9cfe['body'],{})[_0x9ead('0x23')](respondWithResult(_0x108154,0xc9))[_0x9ead('0x45')](handleError(_0x108154,null));};exports[_0x9ead('0x22')]=function(_0x37e671,_0x516fa5){if(_0x37e671['body']['id']){delete _0x37e671[_0x9ead('0x47')]['id'];}return db[_0x9ead('0x29')]['find']({'where':{'id':_0x37e671[_0x9ead('0x42')]['id']}})[_0x9ead('0x23')](handleEntityNotFound(_0x516fa5,null))[_0x9ead('0x23')](saveUpdates(_0x37e671[_0x9ead('0x47')],null))[_0x9ead('0x23')](respondWithResult(_0x516fa5,null))[_0x9ead('0x45')](handleError(_0x516fa5,null));};exports[_0x9ead('0x48')]=function(_0x154c7a,_0x32273c){return db[_0x9ead('0x29')][_0x9ead('0x44')]({'where':{'id':_0x154c7a[_0x9ead('0x42')]['id']}})['then'](handleEntityNotFound(_0x32273c,null))[_0x9ead('0x23')](removeEntity(_0x32273c,null))[_0x9ead('0x45')](handleError(_0x32273c,null));};
\ No newline at end of file
index c6e29b2..618d5e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1182=['path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out','lodash','util','api','bluebird'];(function(_0x34a64e,_0x538e5e){var _0x43b95e=function(_0x6ae895){while(--_0x6ae895){_0x34a64e['push'](_0x34a64e['shift']());}};_0x43b95e(++_0x538e5e);}(_0x1182,0x92));var _0x2118=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x1182[_0x451735];return _0x41d1e2;};'use strict';var _=require(_0x2118('0x0'));var util=require(_0x2118('0x1'));var logger=require('../../config/logger')(_0x2118('0x2'));var moment=require('moment');var BPromise=require(_0x2118('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2118('0x4'));var rimraf=require(_0x2118('0x5'));var config=require(_0x2118('0x6'));var attributes=require(_0x2118('0x7'));module[_0x2118('0x8')]=function(_0x11f2d1,_0x7c5701){return _0x11f2d1['define']('MailServerOut',attributes,{'tableName':_0x2118('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb413=['moment','bluebird','path','rimraf','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xb413,0x168));var _0x3b41=function(_0x583fa2,_0x32a73b){_0x583fa2=_0x583fa2-0x0;var _0x2f5bf8=_0xb413[_0x583fa2];return _0x2f5bf8;};'use strict';var _=require(_0x3b41('0x0'));var util=require(_0x3b41('0x1'));var logger=require(_0x3b41('0x2'))('api');var moment=require(_0x3b41('0x3'));var BPromise=require(_0x3b41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b41('0x5'));var rimraf=require(_0x3b41('0x6'));var config=require('../../config/environment');var attributes=require(_0x3b41('0x7'));module[_0x3b41('0x8')]=function(_0x20a3fb,_0x1438d1){return _0x20a3fb[_0x3b41('0x9')]('MailServerOut',attributes,{'tableName':_0x3b41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 979a5ff..d09a9d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x18fec9,_0x3f3271){var _0x4769b4=function(_0x35c1b1){while(--_0x35c1b1){_0x18fec9['push'](_0x18fec9['shift']());}};_0x4769b4(++_0x3f3271);}(_0xdb28,0x106));var _0x8db2=function(_0x4ae1d0,_0x1bab90){_0x4ae1d0=_0x4ae1d0-0x0;var _0x3707d4=_0xdb28[_0x4ae1d0];return _0x3707d4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x54c820,_0xe1c4a7){var _0x33ea01=function(_0x5856dd){while(--_0x5856dd){_0x54c820['push'](_0x54c820['shift']());}};_0x33ea01(++_0xe1c4a7);}(_0xadb5,0xad));var _0x5adb=function(_0x4d0312,_0x46c937){_0x4d0312=_0x4d0312-0x0;var _0x134c76=_0xadb5[_0x4d0312];return _0x134c76;};'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']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index b90ef2f..37cc3b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3137=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3137,0x154));var _0x7313=function(_0x12a57d,_0x738bd1){_0x12a57d=_0x12a57d-0x0;var _0x4b26f6=_0x3137[_0x12a57d];return _0x4b26f6;};'use strict';var multer=require(_0x7313('0x0'));var util=require(_0x7313('0x1'));var path=require(_0x7313('0x2'));var timeout=require(_0x7313('0x3'));var express=require('express');var router=express[_0x7313('0x4')]();var fs_extra=require(_0x7313('0x5'));var auth=require(_0x7313('0x6'));var interaction=require(_0x7313('0x7'));var config=require(_0x7313('0x8'));var controller=require('./mailSubstatus.controller');router[_0x7313('0x9')]('/',auth[_0x7313('0xa')](),controller[_0x7313('0xb')]);router[_0x7313('0x9')](_0x7313('0xc'),auth['isAuthenticated'](),controller[_0x7313('0xd')]);router[_0x7313('0x9')]('/:id',auth[_0x7313('0xa')](),controller[_0x7313('0xe')]);router[_0x7313('0xf')]('/',auth[_0x7313('0xa')](),controller[_0x7313('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7313('0x11')]);router[_0x7313('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7313('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x444d=['/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3d231c,_0x1b7b3f){var _0x545c5d=function(_0x2d5ea0){while(--_0x2d5ea0){_0x3d231c['push'](_0x3d231c['shift']());}};_0x545c5d(++_0x1b7b3f);}(_0x444d,0x142));var _0xd444=function(_0x3678e7,_0x355e67){_0x3678e7=_0x3678e7-0x0;var _0x128493=_0x444d[_0x3678e7];return _0x128493;};'use strict';var multer=require(_0xd444('0x0'));var util=require(_0xd444('0x1'));var path=require(_0xd444('0x2'));var timeout=require('connect-timeout');var express=require(_0xd444('0x3'));var router=express[_0xd444('0x4')]();var fs_extra=require(_0xd444('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd444('0x6'));var config=require(_0xd444('0x7'));var controller=require(_0xd444('0x8'));router[_0xd444('0x9')]('/',auth[_0xd444('0xa')](),controller[_0xd444('0xb')]);router['get'](_0xd444('0xc'),auth[_0xd444('0xa')](),controller[_0xd444('0xd')]);router[_0xd444('0x9')](_0xd444('0xe'),auth['isAuthenticated'](),controller[_0xd444('0xf')]);router[_0xd444('0x10')]('/',auth['isAuthenticated'](),controller[_0xd444('0x11')]);router['put'](_0xd444('0xe'),auth[_0xd444('0xa')](),controller[_0xd444('0x12')]);router['delete'](_0xd444('0xe'),auth['isAuthenticated'](),controller[_0xd444('0x13')]);module[_0xd444('0x14')]=router;
\ No newline at end of file
index cdecc7f..db60537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec2=['sequelize','exports','STRING','name'];(function(_0x28360b,_0x162859){var _0x464836=function(_0xea6fdd){while(--_0xea6fdd){_0x28360b['push'](_0x28360b['shift']());}};_0x464836(++_0x162859);}(_0x6ec2,0x78));var _0x26ec=function(_0x2026d6,_0x1a32e7){_0x2026d6=_0x2026d6-0x0;var _0x5527c7=_0x6ec2[_0x2026d6];return _0x5527c7;};'use strict';var Sequelize=require(_0x26ec('0x0'));module[_0x26ec('0x1')]={'name':{'type':Sequelize[_0x26ec('0x2')],'unique':_0x26ec('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x26ec('0x2')]}};
\ No newline at end of file
+var _0x5a5a=['exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x3b7f91,_0x260ad7){_0x3b7f91=_0x3b7f91-0x0;var _0x34c1cc=_0x5a5a[_0x3b7f91];return _0x34c1cc;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'name':{'type':Sequelize[_0xa5a5('0x1')],'unique':_0xa5a5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa5a5('0x1')]}};
\ No newline at end of file
index d125cec..5f72d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40d8=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','MailSubstatus','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','index','fieldName','type','map','query','keys','filters','intersection','model'];(function(_0x1f3899,_0x297f38){var _0xeb5658=function(_0x3e0ac3){while(--_0x3e0ac3){_0x1f3899['push'](_0x1f3899['shift']());}};_0xeb5658(++_0x297f38);}(_0x40d8,0xfc));var _0x840d=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x40d8[_0x459423];return _0x42ed14;};'use strict';var emlformat=require(_0x840d('0x0'));var rimraf=require(_0x840d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x840d('0x2'));var rp=require(_0x840d('0x3'));var moment=require('moment');var BPromise=require(_0x840d('0x4'));var Mustache=require(_0x840d('0x5'));var util=require(_0x840d('0x6'));var path=require(_0x840d('0x7'));var sox=require(_0x840d('0x8'));var csv=require(_0x840d('0x9'));var ejs=require(_0x840d('0xa'));var fs=require('fs');var fs_extra=require(_0x840d('0xb'));var _=require(_0x840d('0xc'));var squel=require(_0x840d('0xd'));var crypto=require(_0x840d('0xe'));var jsforce=require(_0x840d('0xf'));var deskjs=require(_0x840d('0x10'));var toCsv=require(_0x840d('0x9'));var querystring=require(_0x840d('0x11'));var Papa=require(_0x840d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x840d('0x13'));var as=require(_0x840d('0x14'));var hardwareService=require(_0x840d('0x15'));var logger=require('../../config/logger')(_0x840d('0x16'));var utils=require(_0x840d('0x17'));var config=require(_0x840d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x840d('0x19'))['db'];function respondWithStatusCode(_0x1b8407,_0x5d3a93){_0x5d3a93=_0x5d3a93||0xcc;return function(_0x322a95){if(_0x322a95){return _0x1b8407[_0x840d('0x1a')](_0x5d3a93);}return _0x1b8407['status'](_0x5d3a93)[_0x840d('0x1b')]();};}function respondWithResult(_0xe66a27,_0x109a63){_0x109a63=_0x109a63||0xc8;return function(_0x2a01e2){if(_0x2a01e2){return _0xe66a27[_0x840d('0x1c')](_0x109a63)[_0x840d('0x1d')](_0x2a01e2);}};}function respondWithFilteredResult(_0x137eeb,_0x2042ac){return function(_0x26a967){if(_0x26a967){var _0x4969b2=typeof _0x2042ac[_0x840d('0x1e')]===_0x840d('0x1f')&&typeof _0x2042ac[_0x840d('0x20')]===_0x840d('0x1f');var _0x190448=_0x26a967[_0x840d('0x21')];var _0x479a4a=_0x4969b2?0x0:_0x2042ac[_0x840d('0x1e')];var _0x3706a0=_0x4969b2?_0x26a967['count']:_0x2042ac[_0x840d('0x1e')]+_0x2042ac[_0x840d('0x20')];var _0x52a493;if(_0x3706a0>=_0x190448){_0x3706a0=_0x190448;_0x52a493=0xc8;}else{_0x52a493=0xce;}_0x137eeb[_0x840d('0x1c')](_0x52a493);return _0x137eeb[_0x840d('0x22')](_0x840d('0x23'),_0x479a4a+'-'+_0x3706a0+'/'+_0x190448)['json'](_0x26a967);}return null;};}function patchUpdates(_0x4ae505){return function(_0x1e7ef5){try{jsonpatch[_0x840d('0x24')](_0x1e7ef5,_0x4ae505,!![]);}catch(_0x1b8ff2){return BPromise[_0x840d('0x25')](_0x1b8ff2);}return _0x1e7ef5[_0x840d('0x26')]();};}function saveUpdates(_0x4ef18d,_0x10a617){return function(_0xb6d0ea){if(_0xb6d0ea){return _0xb6d0ea[_0x840d('0x27')](_0x4ef18d)[_0x840d('0x28')](function(_0xcc428c){return _0xcc428c;});}return null;};}function removeEntity(_0x25496d,_0x563804){return function(_0x44bb29){if(_0x44bb29){return _0x44bb29[_0x840d('0x29')]()[_0x840d('0x28')](function(){_0x25496d[_0x840d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ac9a,_0x42e381){return function(_0x34ce39){if(!_0x34ce39){_0x23ac9a[_0x840d('0x1a')](0x194);}return _0x34ce39;};}function handleError(_0x156ccb,_0x3dce3c){_0x3dce3c=_0x3dce3c||0x1f4;return function(_0x36c7ee){logger['error'](_0x36c7ee['stack']);if(_0x36c7ee[_0x840d('0x2a')]){delete _0x36c7ee[_0x840d('0x2a')];}_0x156ccb[_0x840d('0x1c')](_0x3dce3c)['send'](_0x36c7ee);};}exports[_0x840d('0x2b')]=function(_0x197206,_0x1cf6a6){var _0x4a3c8b={},_0x50ea65={},_0x1ffdd4={'count':0x0,'rows':[]};var _0x3157f2=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x5d3a2c){return{'name':_0x5d3a2c[_0x840d('0x2c')],'type':_0x5d3a2c[_0x840d('0x2d')]['key']};});_0x50ea65['model']=_[_0x840d('0x2e')](_0x3157f2,_0x840d('0x2a'));_0x50ea65[_0x840d('0x2f')]=_[_0x840d('0x30')](_0x197206['query']);_0x50ea65[_0x840d('0x31')]=_[_0x840d('0x32')](_0x50ea65[_0x840d('0x33')],_0x50ea65[_0x840d('0x2f')]);_0x4a3c8b[_0x840d('0x34')]=_[_0x840d('0x32')](_0x50ea65['model'],qs[_0x840d('0x35')](_0x197206[_0x840d('0x2f')][_0x840d('0x35')]));_0x4a3c8b[_0x840d('0x34')]=_0x4a3c8b[_0x840d('0x34')][_0x840d('0x36')]?_0x4a3c8b[_0x840d('0x34')]:_0x50ea65['model'];if(!_0x197206[_0x840d('0x2f')][_0x840d('0x37')](_0x840d('0x38'))){_0x4a3c8b['limit']=qs['limit'](_0x197206['query'][_0x840d('0x20')]);_0x4a3c8b[_0x840d('0x1e')]=qs[_0x840d('0x1e')](_0x197206[_0x840d('0x2f')]['offset']);}_0x4a3c8b[_0x840d('0x39')]=qs['sort'](_0x197206[_0x840d('0x2f')][_0x840d('0x3a')]);_0x4a3c8b['where']=qs['filters'](_['pick'](_0x197206[_0x840d('0x2f')],_0x50ea65[_0x840d('0x31')]),_0x3157f2);if(_0x197206[_0x840d('0x2f')][_0x840d('0x3b')]){_0x4a3c8b[_0x840d('0x3c')]=_['merge'](_0x4a3c8b[_0x840d('0x3c')],{'$or':_[_0x840d('0x2e')](_0x3157f2,function(_0x36610d){if(_0x36610d['type']!==_0x840d('0x3d')){var _0x3c70cd={};_0x3c70cd[_0x36610d[_0x840d('0x2a')]]={'$like':'%'+_0x197206[_0x840d('0x2f')]['filter']+'%'};return _0x3c70cd;}})});}_0x4a3c8b=_[_0x840d('0x3e')]({},_0x4a3c8b,_0x197206[_0x840d('0x3f')]);var _0x3085d7={'where':_0x4a3c8b['where']};return db[_0x840d('0x40')]['count'](_0x3085d7)['then'](function(_0x1d3ab0){_0x1ffdd4['count']=_0x1d3ab0;if(_0x197206[_0x840d('0x2f')][_0x840d('0x41')]){_0x4a3c8b['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x840d('0x42')](_0x4a3c8b);})[_0x840d('0x28')](function(_0x30d188){_0x1ffdd4[_0x840d('0x43')]=_0x30d188;return _0x1ffdd4;})['then'](respondWithFilteredResult(_0x1cf6a6,_0x4a3c8b))['catch'](handleError(_0x1cf6a6,null));};exports['show']=function(_0x5d3c1f,_0x1cda86){var _0xd4d25={'raw':!![],'where':{'id':_0x5d3c1f[_0x840d('0x44')]['id']}},_0xacc16e={};_0xacc16e[_0x840d('0x33')]=_[_0x840d('0x30')](db[_0x840d('0x40')][_0x840d('0x45')]);_0xacc16e[_0x840d('0x2f')]=_[_0x840d('0x30')](_0x5d3c1f['query']);_0xacc16e[_0x840d('0x31')]=_['intersection'](_0xacc16e[_0x840d('0x33')],_0xacc16e[_0x840d('0x2f')]);_0xd4d25['attributes']=_[_0x840d('0x32')](_0xacc16e[_0x840d('0x33')],qs[_0x840d('0x35')](_0x5d3c1f[_0x840d('0x2f')][_0x840d('0x35')]));_0xd4d25[_0x840d('0x34')]=_0xd4d25[_0x840d('0x34')]['length']?_0xd4d25[_0x840d('0x34')]:_0xacc16e[_0x840d('0x33')];if(_0x5d3c1f['query'][_0x840d('0x41')]){_0xd4d25[_0x840d('0x46')]=[{'all':!![]}];}_0xd4d25=_[_0x840d('0x3e')]({},_0xd4d25,_0x5d3c1f[_0x840d('0x3f')]);return db[_0x840d('0x40')][_0x840d('0x47')](_0xd4d25)['then'](handleEntityNotFound(_0x1cda86,null))[_0x840d('0x28')](respondWithResult(_0x1cda86,null))[_0x840d('0x48')](handleError(_0x1cda86,null));};exports[_0x840d('0x49')]=function(_0x3099ed,_0x5a8ff7){return db['MailSubstatus'][_0x840d('0x49')](_0x3099ed[_0x840d('0x4a')],{})[_0x840d('0x28')](respondWithResult(_0x5a8ff7,0xc9))[_0x840d('0x48')](handleError(_0x5a8ff7,null));};exports['update']=function(_0x2b68a4,_0x150a26){if(_0x2b68a4[_0x840d('0x4a')]['id']){delete _0x2b68a4['body']['id'];}return db[_0x840d('0x40')][_0x840d('0x47')]({'where':{'id':_0x2b68a4['params']['id']}})['then'](handleEntityNotFound(_0x150a26,null))[_0x840d('0x28')](saveUpdates(_0x2b68a4['body'],null))[_0x840d('0x28')](respondWithResult(_0x150a26,null))[_0x840d('0x48')](handleError(_0x150a26,null));};exports['destroy']=function(_0x25c99c,_0x364bfd){return db[_0x840d('0x40')][_0x840d('0x47')]({'where':{'id':_0x25c99c[_0x840d('0x44')]['id']}})[_0x840d('0x28')](handleEntityNotFound(_0x364bfd,null))[_0x840d('0x28')](removeEntity(_0x364bfd,null))['catch'](handleError(_0x364bfd,null));};exports[_0x840d('0x4b')]=function(_0x252216,_0x3c8b6d){return db[_0x840d('0x40')][_0x840d('0x4b')]()[_0x840d('0x28')](respondWithResult(_0x3c8b6d,null))['catch'](handleError(_0x3c8b6d,null));};
\ No newline at end of file
+var _0x265e=['intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','MailSubstatus','findAll','show','params','find','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','attributes'];(function(_0x4677b6,_0x2d45cf){var _0x293646=function(_0x5c5dc3){while(--_0x5c5dc3){_0x4677b6['push'](_0x4677b6['shift']());}};_0x293646(++_0x2d45cf);}(_0x265e,0xec));var _0xe265=function(_0x2689f1,_0x12cb82){_0x2689f1=_0x2689f1-0x0;var _0x192afc=_0x265e[_0x2689f1];return _0x192afc;};'use strict';var emlformat=require(_0xe265('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe265('0x1'));var jsonpatch=require(_0xe265('0x2'));var rp=require(_0xe265('0x3'));var moment=require(_0xe265('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe265('0x5'));var util=require(_0xe265('0x6'));var path=require(_0xe265('0x7'));var sox=require(_0xe265('0x8'));var csv=require(_0xe265('0x9'));var ejs=require(_0xe265('0xa'));var fs=require('fs');var fs_extra=require(_0xe265('0xb'));var _=require(_0xe265('0xc'));var squel=require('squel');var crypto=require(_0xe265('0xd'));var jsforce=require(_0xe265('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe265('0x9'));var querystring=require('querystring');var Papa=require(_0xe265('0xf'));var Redis=require(_0xe265('0x10'));var authService=require(_0xe265('0x11'));var qs=require(_0xe265('0x12'));var as=require(_0xe265('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe265('0x14'))('api');var utils=require(_0xe265('0x15'));var config=require(_0xe265('0x16'));var licenseUtil=require(_0xe265('0x17'));var db=require(_0xe265('0x18'))['db'];function respondWithStatusCode(_0x5647c7,_0x2fd75f){_0x2fd75f=_0x2fd75f||0xcc;return function(_0x5cb9d2){if(_0x5cb9d2){return _0x5647c7[_0xe265('0x19')](_0x2fd75f);}return _0x5647c7[_0xe265('0x1a')](_0x2fd75f)[_0xe265('0x1b')]();};}function respondWithResult(_0x4258dd,_0x56b472){_0x56b472=_0x56b472||0xc8;return function(_0xf13d89){if(_0xf13d89){return _0x4258dd['status'](_0x56b472)['json'](_0xf13d89);}};}function respondWithFilteredResult(_0x3401fb,_0x31c40e){return function(_0x445778){if(_0x445778){var _0x242ac4=typeof _0x31c40e[_0xe265('0x1c')]==='undefined'&&typeof _0x31c40e[_0xe265('0x1d')]==='undefined';var _0x7f1e27=_0x445778['count'];var _0x345a3b=_0x242ac4?0x0:_0x31c40e['offset'];var _0x4c1c81=_0x242ac4?_0x445778[_0xe265('0x1e')]:_0x31c40e[_0xe265('0x1c')]+_0x31c40e[_0xe265('0x1d')];var _0x3c243b;if(_0x4c1c81>=_0x7f1e27){_0x4c1c81=_0x7f1e27;_0x3c243b=0xc8;}else{_0x3c243b=0xce;}_0x3401fb[_0xe265('0x1a')](_0x3c243b);return _0x3401fb['set']('Content-Range',_0x345a3b+'-'+_0x4c1c81+'/'+_0x7f1e27)['json'](_0x445778);}return null;};}function patchUpdates(_0x344811){return function(_0x750454){try{jsonpatch[_0xe265('0x1f')](_0x750454,_0x344811,!![]);}catch(_0xc2eac){return BPromise[_0xe265('0x20')](_0xc2eac);}return _0x750454[_0xe265('0x21')]();};}function saveUpdates(_0xaf96e5,_0x4b14dc){return function(_0x2da416){if(_0x2da416){return _0x2da416['update'](_0xaf96e5)[_0xe265('0x22')](function(_0x43e956){return _0x43e956;});}return null;};}function removeEntity(_0x615aae,_0x52a1d5){return function(_0x220840){if(_0x220840){return _0x220840[_0xe265('0x23')]()['then'](function(){_0x615aae[_0xe265('0x1a')](0xcc)[_0xe265('0x1b')]();});}};}function handleEntityNotFound(_0x361013,_0x50d50b){return function(_0x2fcbc2){if(!_0x2fcbc2){_0x361013[_0xe265('0x19')](0x194);}return _0x2fcbc2;};}function handleError(_0x46404a,_0x42ac4d){_0x42ac4d=_0x42ac4d||0x1f4;return function(_0x90ea8d){logger[_0xe265('0x24')](_0x90ea8d[_0xe265('0x25')]);if(_0x90ea8d[_0xe265('0x26')]){delete _0x90ea8d[_0xe265('0x26')];}_0x46404a[_0xe265('0x1a')](_0x42ac4d)[_0xe265('0x27')](_0x90ea8d);};}exports['index']=function(_0x3e026,_0x4964e3){var _0x4b4817={},_0x243459={},_0x3f1ec7={'count':0x0,'rows':[]};var _0x576ae4=_[_0xe265('0x28')](db['MailSubstatus'][_0xe265('0x29')],function(_0x2182dc){return{'name':_0x2182dc['fieldName'],'type':_0x2182dc[_0xe265('0x2a')][_0xe265('0x2b')]};});_0x243459['model']=_[_0xe265('0x28')](_0x576ae4,_0xe265('0x26'));_0x243459[_0xe265('0x2c')]=_[_0xe265('0x2d')](_0x3e026[_0xe265('0x2c')]);_0x243459[_0xe265('0x2e')]=_['intersection'](_0x243459['model'],_0x243459[_0xe265('0x2c')]);_0x4b4817[_0xe265('0x2f')]=_[_0xe265('0x30')](_0x243459[_0xe265('0x31')],qs['fields'](_0x3e026[_0xe265('0x2c')][_0xe265('0x32')]));_0x4b4817[_0xe265('0x2f')]=_0x4b4817[_0xe265('0x2f')][_0xe265('0x33')]?_0x4b4817[_0xe265('0x2f')]:_0x243459[_0xe265('0x31')];if(!_0x3e026[_0xe265('0x2c')][_0xe265('0x34')]('nolimit')){_0x4b4817[_0xe265('0x1d')]=qs['limit'](_0x3e026['query']['limit']);_0x4b4817['offset']=qs[_0xe265('0x1c')](_0x3e026[_0xe265('0x2c')][_0xe265('0x1c')]);}_0x4b4817[_0xe265('0x35')]=qs[_0xe265('0x36')](_0x3e026[_0xe265('0x2c')][_0xe265('0x36')]);_0x4b4817['where']=qs[_0xe265('0x2e')](_[_0xe265('0x37')](_0x3e026[_0xe265('0x2c')],_0x243459['filters']),_0x576ae4);if(_0x3e026[_0xe265('0x2c')][_0xe265('0x38')]){_0x4b4817[_0xe265('0x39')]=_[_0xe265('0x3a')](_0x4b4817[_0xe265('0x39')],{'$or':_[_0xe265('0x28')](_0x576ae4,function(_0x327424){if(_0x327424[_0xe265('0x2a')]!==_0xe265('0x3b')){var _0x1f896a={};_0x1f896a[_0x327424[_0xe265('0x26')]]={'$like':'%'+_0x3e026['query'][_0xe265('0x38')]+'%'};return _0x1f896a;}})});}_0x4b4817=_[_0xe265('0x3a')]({},_0x4b4817,_0x3e026[_0xe265('0x3c')]);var _0x56d044={'where':_0x4b4817[_0xe265('0x39')]};return db['MailSubstatus'][_0xe265('0x1e')](_0x56d044)[_0xe265('0x22')](function(_0x164517){_0x3f1ec7[_0xe265('0x1e')]=_0x164517;if(_0x3e026[_0xe265('0x2c')][_0xe265('0x3d')]){_0x4b4817[_0xe265('0x3e')]=[{'all':!![]}];}return db[_0xe265('0x3f')][_0xe265('0x40')](_0x4b4817);})['then'](function(_0x3ae845){_0x3f1ec7['rows']=_0x3ae845;return _0x3f1ec7;})[_0xe265('0x22')](respondWithFilteredResult(_0x4964e3,_0x4b4817))['catch'](handleError(_0x4964e3,null));};exports[_0xe265('0x41')]=function(_0x5a8fac,_0xe71984){var _0x55600a={'raw':!![],'where':{'id':_0x5a8fac[_0xe265('0x42')]['id']}},_0x65312d={};_0x65312d[_0xe265('0x31')]=_['keys'](db[_0xe265('0x3f')][_0xe265('0x29')]);_0x65312d[_0xe265('0x2c')]=_[_0xe265('0x2d')](_0x5a8fac['query']);_0x65312d['filters']=_[_0xe265('0x30')](_0x65312d[_0xe265('0x31')],_0x65312d[_0xe265('0x2c')]);_0x55600a['attributes']=_[_0xe265('0x30')](_0x65312d['model'],qs[_0xe265('0x32')](_0x5a8fac[_0xe265('0x2c')]['fields']));_0x55600a[_0xe265('0x2f')]=_0x55600a[_0xe265('0x2f')][_0xe265('0x33')]?_0x55600a[_0xe265('0x2f')]:_0x65312d[_0xe265('0x31')];if(_0x5a8fac[_0xe265('0x2c')][_0xe265('0x3d')]){_0x55600a['include']=[{'all':!![]}];}_0x55600a=_[_0xe265('0x3a')]({},_0x55600a,_0x5a8fac[_0xe265('0x3c')]);return db[_0xe265('0x3f')][_0xe265('0x43')](_0x55600a)[_0xe265('0x22')](handleEntityNotFound(_0xe71984,null))[_0xe265('0x22')](respondWithResult(_0xe71984,null))['catch'](handleError(_0xe71984,null));};exports['create']=function(_0x9d2c52,_0x384df1){return db[_0xe265('0x3f')]['create'](_0x9d2c52[_0xe265('0x44')],{})[_0xe265('0x22')](respondWithResult(_0x384df1,0xc9))[_0xe265('0x45')](handleError(_0x384df1,null));};exports['update']=function(_0x4558cf,_0x5f490a){if(_0x4558cf[_0xe265('0x44')]['id']){delete _0x4558cf[_0xe265('0x44')]['id'];}return db[_0xe265('0x3f')][_0xe265('0x43')]({'where':{'id':_0x4558cf[_0xe265('0x42')]['id']}})[_0xe265('0x22')](handleEntityNotFound(_0x5f490a,null))[_0xe265('0x22')](saveUpdates(_0x4558cf[_0xe265('0x44')],null))[_0xe265('0x22')](respondWithResult(_0x5f490a,null))[_0xe265('0x45')](handleError(_0x5f490a,null));};exports['destroy']=function(_0x3b1690,_0xb89d8d){return db[_0xe265('0x3f')]['find']({'where':{'id':_0x3b1690[_0xe265('0x42')]['id']}})['then'](handleEntityNotFound(_0xb89d8d,null))[_0xe265('0x22')](removeEntity(_0xb89d8d,null))[_0xe265('0x45')](handleError(_0xb89d8d,null));};exports[_0xe265('0x46')]=function(_0xaa1557,_0x430b58){return db[_0xe265('0x3f')][_0xe265('0x46')]()['then'](respondWithResult(_0x430b58,null))[_0xe265('0x45')](handleError(_0x430b58,null));};
\ No newline at end of file
index dc41edc..fb0ccc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20a6=['moment','bluebird','request-promise','path','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x20a6,0x1ab));var _0x620a=function(_0x5888b6,_0x5538d8){_0x5888b6=_0x5888b6-0x0;var _0x4f65d9=_0x20a6[_0x5888b6];return _0x4f65d9;};'use strict';var _=require(_0x620a('0x0'));var util=require(_0x620a('0x1'));var logger=require(_0x620a('0x2'))('api');var moment=require(_0x620a('0x3'));var BPromise=require(_0x620a('0x4'));var rp=require(_0x620a('0x5'));var fs=require('fs');var path=require(_0x620a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5a1121,_0x4f5506){return _0x5a1121[_0x620a('0x7')](_0x620a('0x8'),attributes,{'tableName':_0x620a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87e0=['bluebird','request-promise','path','rimraf','../../config/environment','define','MailSubstatus','mail_substatuses','lodash','util','api'];(function(_0x4383a7,_0x46b6d1){var _0x58346b=function(_0x315373){while(--_0x315373){_0x4383a7['push'](_0x4383a7['shift']());}};_0x58346b(++_0x46b6d1);}(_0x87e0,0x11b));var _0x087e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x87e0[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x087e('0x0'));var util=require(_0x087e('0x1'));var logger=require('../../config/logger')(_0x087e('0x2'));var moment=require('moment');var BPromise=require(_0x087e('0x3'));var rp=require(_0x087e('0x4'));var fs=require('fs');var path=require(_0x087e('0x5'));var rimraf=require(_0x087e('0x6'));var config=require(_0x087e('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5e72c5,_0x599dad){return _0x5e72c5[_0x087e('0x8')](_0x087e('0x9'),attributes,{'tableName':_0x087e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 452f178..b2a9d08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e06=['rpc','../../config/environment','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c906e,_0x4418b5){var _0x468227=function(_0x3ee77e){while(--_0x3ee77e){_0x2c906e['push'](_0x2c906e['shift']());}};_0x468227(++_0x4418b5);}(_0x7e06,0x1b0));var _0x67e0=function(_0x17db01,_0x4e3110){_0x17db01=_0x17db01-0x0;var _0x5b02aa=_0x7e06[_0x17db01];return _0x5b02aa;};'use strict';var _=require('lodash');var util=require(_0x67e0('0x0'));var moment=require(_0x67e0('0x1'));var BPromise=require(_0x67e0('0x2'));var rs=require(_0x67e0('0x3'));var fs=require('fs');var Redis=require(_0x67e0('0x4'));var db=require(_0x67e0('0x5'))['db'];var utils=require(_0x67e0('0x6'));var logger=require(_0x67e0('0x7'))(_0x67e0('0x8'));var config=require(_0x67e0('0x9'));var jayson=require(_0x67e0('0xa'));var client=jayson[_0x67e0('0xb')][_0x67e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d025f,_0x51660c,_0x496f18){return new BPromise(function(_0x4f9c4f,_0x3840b1){return client['request'](_0x3d025f,_0x496f18)['then'](function(_0x2b282a){logger[_0x67e0('0xd')](_0x67e0('0xe'),_0x51660c,_0x67e0('0xf'));logger[_0x67e0('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x51660c,_0x67e0('0xf'),JSON[_0x67e0('0x11')](_0x2b282a));if(_0x2b282a[_0x67e0('0x12')]){if(_0x2b282a[_0x67e0('0x12')]['code']===0x1f4){logger['error'](_0x67e0('0xe'),_0x51660c,_0x2b282a[_0x67e0('0x12')]['message']);return _0x3840b1(_0x2b282a[_0x67e0('0x12')][_0x67e0('0x13')]);}logger[_0x67e0('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x51660c,_0x2b282a[_0x67e0('0x12')][_0x67e0('0x13')]);return _0x4f9c4f(_0x2b282a[_0x67e0('0x12')][_0x67e0('0x13')]);}else{logger[_0x67e0('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x51660c,_0x67e0('0xf'));_0x4f9c4f(_0x2b282a[_0x67e0('0x14')]['message']);}})[_0x67e0('0x15')](function(_0x60e487){logger['error'](_0x67e0('0xe'),_0x51660c,_0x60e487);_0x3840b1(_0x60e487);});});}
\ No newline at end of file
+var _0x3831=['ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4e5d67,_0x54dffc){var _0x4acdf3=function(_0x53e5a3){while(--_0x53e5a3){_0x4e5d67['push'](_0x4e5d67['shift']());}};_0x4acdf3(++_0x54dffc);}(_0x3831,0x14c));var _0x1383=function(_0x581e1d,_0x1ed7d4){_0x581e1d=_0x581e1d-0x0;var _0x39965b=_0x3831[_0x581e1d];return _0x39965b;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var moment=require(_0x1383('0x1'));var BPromise=require(_0x1383('0x2'));var rs=require(_0x1383('0x3'));var fs=require('fs');var Redis=require(_0x1383('0x4'));var db=require(_0x1383('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1383('0x6'))('rpc');var config=require(_0x1383('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45a030,_0x5a6ba0,_0x187027){return new BPromise(function(_0x1ddd4c,_0x2e9a5b){return client[_0x1383('0x8')](_0x45a030,_0x187027)[_0x1383('0x9')](function(_0x7cb670){logger[_0x1383('0xa')](_0x1383('0xb'),_0x5a6ba0,'request\x20sent');logger[_0x1383('0xc')](_0x1383('0xd'),_0x5a6ba0,_0x1383('0xe'),JSON[_0x1383('0xf')](_0x7cb670));if(_0x7cb670[_0x1383('0x10')]){if(_0x7cb670['error'][_0x1383('0x11')]===0x1f4){logger[_0x1383('0x10')](_0x1383('0xb'),_0x5a6ba0,_0x7cb670['error']['message']);return _0x2e9a5b(_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);}logger[_0x1383('0x10')](_0x1383('0xb'),_0x5a6ba0,_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);return _0x1ddd4c(_0x7cb670[_0x1383('0x10')][_0x1383('0x12')]);}else{logger['info'](_0x1383('0xb'),_0x5a6ba0,_0x1383('0xe'));_0x1ddd4c(_0x7cb670[_0x1383('0x13')][_0x1383('0x12')]);}})[_0x1383('0x14')](function(_0x388b94){logger[_0x1383('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5a6ba0,_0x388b94);_0x2e9a5b(_0x388b94);});});}
\ No newline at end of file
index 2114a0e..0180890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed78=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/:id','show','post'];(function(_0x122481,_0x4ab9ec){var _0x8f8026=function(_0x146f26){while(--_0x146f26){_0x122481['push'](_0x122481['shift']());}};_0x8f8026(++_0x4ab9ec);}(_0xed78,0x1cd));var _0x8ed7=function(_0x2e1106,_0x55cf64){_0x2e1106=_0x2e1106-0x0;var _0x53e644=_0xed78[_0x2e1106];return _0x53e644;};'use strict';var multer=require(_0x8ed7('0x0'));var util=require(_0x8ed7('0x1'));var path=require(_0x8ed7('0x2'));var timeout=require(_0x8ed7('0x3'));var express=require(_0x8ed7('0x4'));var router=express[_0x8ed7('0x5')]();var fs_extra=require(_0x8ed7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ed7('0x7'));var controller=require(_0x8ed7('0x8'));router[_0x8ed7('0x9')]('/',auth[_0x8ed7('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8ed7('0x9')](_0x8ed7('0xb'),auth[_0x8ed7('0xa')](),controller[_0x8ed7('0xc')]);router[_0x8ed7('0xd')]('/',auth[_0x8ed7('0xa')](),controller[_0x8ed7('0xe')]);router[_0x8ed7('0xf')](_0x8ed7('0xb'),auth[_0x8ed7('0xa')](),controller[_0x8ed7('0x10')]);router[_0x8ed7('0x11')](_0x8ed7('0xb'),auth[_0x8ed7('0xa')](),controller['destroy']);module[_0x8ed7('0x12')]=router;
\ No newline at end of file
+var _0x822a=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','destroy'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x822a,0x17b));var _0xa822=function(_0xb0975b,_0x93b0d6){_0xb0975b=_0xb0975b-0x0;var _0x320d30=_0x822a[_0xb0975b];return _0x320d30;};'use strict';var multer=require('multer');var util=require(_0xa822('0x0'));var path=require(_0xa822('0x1'));var timeout=require(_0xa822('0x2'));var express=require('express');var router=express[_0xa822('0x3')]();var fs_extra=require(_0xa822('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa822('0x5'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xa822('0x6')]('/',auth[_0xa822('0x7')](),controller[_0xa822('0x8')]);router[_0xa822('0x6')](_0xa822('0x9'),auth[_0xa822('0x7')](),controller[_0xa822('0xa')]);router[_0xa822('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa822('0x7')](),controller[_0xa822('0xb')]);router[_0xa822('0xc')](_0xa822('0xd'),auth[_0xa822('0x7')](),controller[_0xa822('0xe')]);router[_0xa822('0xf')]('/:id',auth[_0xa822('0x7')](),controller[_0xa822('0x10')]);module[_0xa822('0x11')]=router;
\ No newline at end of file
index 0bf7e1d..c6c6b0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x586cee,_0xfd63a){var _0x2c6b88=function(_0x5d6a54){while(--_0x5d6a54){_0x586cee['push'](_0x586cee['shift']());}};_0x2c6b88(++_0xfd63a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2d0821,_0x244fd1){var _0x5354f9=function(_0x102316){while(--_0x102316){_0x2d0821['push'](_0x2d0821['shift']());}};_0x5354f9(++_0x244fd1);}(_0x70e0,0x17b));var _0x070e=function(_0x1084c6,_0x411d87){_0x1084c6=_0x1084c6-0x0;var _0x20b7d5=_0x70e0[_0x1084c6];return _0x20b7d5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index 9a49396..8dd2376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6ca=['query','keys','filters','intersection','model','fields','attributes','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','merge','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','map'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xd6ca,0xfb));var _0xad6c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd6ca[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xad6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad6c('0x1'));var jsonpatch=require(_0xad6c('0x2'));var rp=require(_0xad6c('0x3'));var moment=require(_0xad6c('0x4'));var BPromise=require(_0xad6c('0x5'));var Mustache=require(_0xad6c('0x6'));var util=require('util');var path=require(_0xad6c('0x7'));var sox=require('sox');var csv=require(_0xad6c('0x8'));var ejs=require(_0xad6c('0x9'));var fs=require('fs');var fs_extra=require(_0xad6c('0xa'));var _=require(_0xad6c('0xb'));var squel=require('squel');var crypto=require(_0xad6c('0xc'));var jsforce=require(_0xad6c('0xd'));var deskjs=require(_0xad6c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xad6c('0xf'));var Papa=require(_0xad6c('0x10'));var Redis=require('ioredis');var authService=require(_0xad6c('0x11'));var qs=require(_0xad6c('0x12'));var as=require(_0xad6c('0x13'));var hardwareService=require(_0xad6c('0x14'));var logger=require('../../config/logger')(_0xad6c('0x15'));var utils=require('../../config/utils');var config=require(_0xad6c('0x16'));var licenseUtil=require(_0xad6c('0x17'));var db=require(_0xad6c('0x18'))['db'];function respondWithStatusCode(_0x4c12d7,_0x96e65f){_0x96e65f=_0x96e65f||0xcc;return function(_0xd02b67){if(_0xd02b67){return _0x4c12d7[_0xad6c('0x19')](_0x96e65f);}return _0x4c12d7[_0xad6c('0x1a')](_0x96e65f)['end']();};}function respondWithResult(_0x1769ae,_0x4be185){_0x4be185=_0x4be185||0xc8;return function(_0x341f25){if(_0x341f25){return _0x1769ae[_0xad6c('0x1a')](_0x4be185)[_0xad6c('0x1b')](_0x341f25);}};}function respondWithFilteredResult(_0x20c9e4,_0x3ea7cc){return function(_0x45d50c){if(_0x45d50c){var _0x1c8c79=typeof _0x3ea7cc[_0xad6c('0x1c')]===_0xad6c('0x1d')&&typeof _0x3ea7cc[_0xad6c('0x1e')]===_0xad6c('0x1d');var _0xb1f729=_0x45d50c[_0xad6c('0x1f')];var _0x40bd57=_0x1c8c79?0x0:_0x3ea7cc[_0xad6c('0x1c')];var _0x1bc275=_0x1c8c79?_0x45d50c['count']:_0x3ea7cc['offset']+_0x3ea7cc[_0xad6c('0x1e')];var _0x58ef66;if(_0x1bc275>=_0xb1f729){_0x1bc275=_0xb1f729;_0x58ef66=0xc8;}else{_0x58ef66=0xce;}_0x20c9e4['status'](_0x58ef66);return _0x20c9e4[_0xad6c('0x20')](_0xad6c('0x21'),_0x40bd57+'-'+_0x1bc275+'/'+_0xb1f729)[_0xad6c('0x1b')](_0x45d50c);}return null;};}function patchUpdates(_0x3c0171){return function(_0xca3535){try{jsonpatch['apply'](_0xca3535,_0x3c0171,!![]);}catch(_0x2e358d){return BPromise[_0xad6c('0x22')](_0x2e358d);}return _0xca3535[_0xad6c('0x23')]();};}function saveUpdates(_0x4d58b9,_0x5d87a1){return function(_0x355a77){if(_0x355a77){return _0x355a77[_0xad6c('0x24')](_0x4d58b9)['then'](function(_0x2832eb){return _0x2832eb;});}return null;};}function removeEntity(_0x15bc46,_0x5410b2){return function(_0x2bdaad){if(_0x2bdaad){return _0x2bdaad[_0xad6c('0x25')]()[_0xad6c('0x26')](function(){_0x15bc46[_0xad6c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42562f,_0x2195f4){return function(_0x1e5598){if(!_0x1e5598){_0x42562f[_0xad6c('0x19')](0x194);}return _0x1e5598;};}function handleError(_0x558573,_0x3b7564){_0x3b7564=_0x3b7564||0x1f4;return function(_0x5d63d6){logger[_0xad6c('0x27')](_0x5d63d6[_0xad6c('0x28')]);if(_0x5d63d6[_0xad6c('0x29')]){delete _0x5d63d6[_0xad6c('0x29')];}_0x558573['status'](_0x3b7564)[_0xad6c('0x2a')](_0x5d63d6);};}exports[_0xad6c('0x2b')]=function(_0x5644c1,_0x53f36b){var _0x2d398a={},_0x12f3c6={},_0x3f2877={'count':0x0,'rows':[]};var _0x4b0039=_['map'](db[_0xad6c('0x2c')][_0xad6c('0x2d')],function(_0x511bba){return{'name':_0x511bba[_0xad6c('0x2e')],'type':_0x511bba[_0xad6c('0x2f')]['key']};});_0x12f3c6['model']=_[_0xad6c('0x30')](_0x4b0039,_0xad6c('0x29'));_0x12f3c6[_0xad6c('0x31')]=_[_0xad6c('0x32')](_0x5644c1[_0xad6c('0x31')]);_0x12f3c6[_0xad6c('0x33')]=_[_0xad6c('0x34')](_0x12f3c6[_0xad6c('0x35')],_0x12f3c6['query']);_0x2d398a['attributes']=_['intersection'](_0x12f3c6[_0xad6c('0x35')],qs[_0xad6c('0x36')](_0x5644c1[_0xad6c('0x31')][_0xad6c('0x36')]));_0x2d398a[_0xad6c('0x37')]=_0x2d398a[_0xad6c('0x37')]['length']?_0x2d398a[_0xad6c('0x37')]:_0x12f3c6[_0xad6c('0x35')];if(!_0x5644c1[_0xad6c('0x31')]['hasOwnProperty']('nolimit')){_0x2d398a[_0xad6c('0x1e')]=qs[_0xad6c('0x1e')](_0x5644c1['query']['limit']);_0x2d398a[_0xad6c('0x1c')]=qs['offset'](_0x5644c1['query'][_0xad6c('0x1c')]);}_0x2d398a['order']=qs[_0xad6c('0x38')](_0x5644c1['query'][_0xad6c('0x38')]);_0x2d398a[_0xad6c('0x39')]=qs[_0xad6c('0x33')](_[_0xad6c('0x3a')](_0x5644c1[_0xad6c('0x31')],_0x12f3c6[_0xad6c('0x33')]),_0x4b0039);if(_0x5644c1['query'][_0xad6c('0x3b')]){_0x2d398a[_0xad6c('0x39')]=_['merge'](_0x2d398a['where'],{'$or':_['map'](_0x4b0039,function(_0x1a4fce){if(_0x1a4fce[_0xad6c('0x2f')]!==_0xad6c('0x3c')){var _0x800f40={};_0x800f40[_0x1a4fce['name']]={'$like':'%'+_0x5644c1[_0xad6c('0x31')][_0xad6c('0x3b')]+'%'};return _0x800f40;}})});}_0x2d398a=_['merge']({},_0x2d398a,_0x5644c1[_0xad6c('0x3d')]);var _0x14f65f={'where':_0x2d398a[_0xad6c('0x39')]};return db['MailTransferReport'][_0xad6c('0x1f')](_0x14f65f)[_0xad6c('0x26')](function(_0x57d21e){_0x3f2877[_0xad6c('0x1f')]=_0x57d21e;if(_0x5644c1['query'][_0xad6c('0x3e')]){_0x2d398a[_0xad6c('0x3f')]=[{'all':!![]}];}return db[_0xad6c('0x2c')][_0xad6c('0x40')](_0x2d398a);})['then'](function(_0x3c3a54){_0x3f2877[_0xad6c('0x41')]=_0x3c3a54;return _0x3f2877;})[_0xad6c('0x26')](respondWithFilteredResult(_0x53f36b,_0x2d398a))['catch'](handleError(_0x53f36b,null));};exports[_0xad6c('0x42')]=function(_0x413699,_0x16e682){var _0x5195c3={'raw':!![],'where':{'id':_0x413699[_0xad6c('0x43')]['id']}},_0x797bb5={};_0x797bb5[_0xad6c('0x35')]=_[_0xad6c('0x32')](db[_0xad6c('0x2c')]['rawAttributes']);_0x797bb5['query']=_[_0xad6c('0x32')](_0x413699[_0xad6c('0x31')]);_0x797bb5[_0xad6c('0x33')]=_[_0xad6c('0x34')](_0x797bb5[_0xad6c('0x35')],_0x797bb5[_0xad6c('0x31')]);_0x5195c3[_0xad6c('0x37')]=_[_0xad6c('0x34')](_0x797bb5[_0xad6c('0x35')],qs[_0xad6c('0x36')](_0x413699[_0xad6c('0x31')][_0xad6c('0x36')]));_0x5195c3[_0xad6c('0x37')]=_0x5195c3['attributes'][_0xad6c('0x44')]?_0x5195c3['attributes']:_0x797bb5[_0xad6c('0x35')];if(_0x413699[_0xad6c('0x31')][_0xad6c('0x3e')]){_0x5195c3[_0xad6c('0x3f')]=[{'all':!![]}];}_0x5195c3=_[_0xad6c('0x45')]({},_0x5195c3,_0x413699[_0xad6c('0x3d')]);return db[_0xad6c('0x2c')][_0xad6c('0x46')](_0x5195c3)[_0xad6c('0x26')](handleEntityNotFound(_0x16e682,null))[_0xad6c('0x26')](respondWithResult(_0x16e682,null))[_0xad6c('0x47')](handleError(_0x16e682,null));};exports[_0xad6c('0x48')]=function(_0x5b8608,_0x33a605){return db[_0xad6c('0x2c')]['create'](_0x5b8608[_0xad6c('0x49')],{})[_0xad6c('0x26')](respondWithResult(_0x33a605,0xc9))[_0xad6c('0x47')](handleError(_0x33a605,null));};exports[_0xad6c('0x24')]=function(_0xaddebb,_0x39f20d){if(_0xaddebb[_0xad6c('0x49')]['id']){delete _0xaddebb[_0xad6c('0x49')]['id'];}return db[_0xad6c('0x2c')][_0xad6c('0x46')]({'where':{'id':_0xaddebb[_0xad6c('0x43')]['id']}})[_0xad6c('0x26')](handleEntityNotFound(_0x39f20d,null))[_0xad6c('0x26')](saveUpdates(_0xaddebb[_0xad6c('0x49')],null))['then'](respondWithResult(_0x39f20d,null))['catch'](handleError(_0x39f20d,null));};exports[_0xad6c('0x25')]=function(_0x3e8b4c,_0x4bf981){return db['MailTransferReport']['find']({'where':{'id':_0x3e8b4c[_0xad6c('0x43')]['id']}})[_0xad6c('0x26')](handleEntityNotFound(_0x4bf981,null))[_0xad6c('0x26')](removeEntity(_0x4bf981,null))[_0xad6c('0x47')](handleError(_0x4bf981,null));};exports[_0xad6c('0x4a')]=function(_0x183d38,_0x2419a7){return db[_0xad6c('0x2c')][_0xad6c('0x4a')]()[_0xad6c('0x26')](respondWithResult(_0x2419a7,null))[_0xad6c('0x47')](handleError(_0x2419a7,null));};
\ No newline at end of file
+var _0x6767=['destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','then','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0x6767,0x74));var _0x7676=function(_0x59fe23,_0x31dae9){_0x59fe23=_0x59fe23-0x0;var _0x21ebbe=_0x6767[_0x59fe23];return _0x21ebbe;};'use strict';var emlformat=require(_0x7676('0x0'));var rimraf=require(_0x7676('0x1'));var zipdir=require(_0x7676('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7676('0x3'));var moment=require(_0x7676('0x4'));var BPromise=require(_0x7676('0x5'));var Mustache=require(_0x7676('0x6'));var util=require(_0x7676('0x7'));var path=require(_0x7676('0x8'));var sox=require(_0x7676('0x9'));var csv=require(_0x7676('0xa'));var ejs=require(_0x7676('0xb'));var fs=require('fs');var fs_extra=require(_0x7676('0xc'));var _=require(_0x7676('0xd'));var squel=require(_0x7676('0xe'));var crypto=require('crypto');var jsforce=require(_0x7676('0xf'));var deskjs=require(_0x7676('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7676('0x11'));var Papa=require(_0x7676('0x12'));var Redis=require('ioredis');var authService=require(_0x7676('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7676('0x14'));var logger=require(_0x7676('0x15'))(_0x7676('0x16'));var utils=require('../../config/utils');var config=require(_0x7676('0x17'));var licenseUtil=require(_0x7676('0x18'));var db=require(_0x7676('0x19'))['db'];function respondWithStatusCode(_0x450d42,_0x274240){_0x274240=_0x274240||0xcc;return function(_0x39e686){if(_0x39e686){return _0x450d42[_0x7676('0x1a')](_0x274240);}return _0x450d42['status'](_0x274240)[_0x7676('0x1b')]();};}function respondWithResult(_0x514d98,_0x217b0a){_0x217b0a=_0x217b0a||0xc8;return function(_0x46ce71){if(_0x46ce71){return _0x514d98[_0x7676('0x1c')](_0x217b0a)[_0x7676('0x1d')](_0x46ce71);}};}function respondWithFilteredResult(_0x3a0849,_0x3262ce){return function(_0x18db18){if(_0x18db18){var _0xd1bbef=typeof _0x3262ce[_0x7676('0x1e')]===_0x7676('0x1f')&&typeof _0x3262ce[_0x7676('0x20')]===_0x7676('0x1f');var _0x545c9d=_0x18db18[_0x7676('0x21')];var _0x10f005=_0xd1bbef?0x0:_0x3262ce['offset'];var _0x37ed19=_0xd1bbef?_0x18db18[_0x7676('0x21')]:_0x3262ce[_0x7676('0x1e')]+_0x3262ce[_0x7676('0x20')];var _0xc8c80d;if(_0x37ed19>=_0x545c9d){_0x37ed19=_0x545c9d;_0xc8c80d=0xc8;}else{_0xc8c80d=0xce;}_0x3a0849[_0x7676('0x1c')](_0xc8c80d);return _0x3a0849['set'](_0x7676('0x22'),_0x10f005+'-'+_0x37ed19+'/'+_0x545c9d)['json'](_0x18db18);}return null;};}function patchUpdates(_0x546693){return function(_0x41e1ce){try{jsonpatch[_0x7676('0x23')](_0x41e1ce,_0x546693,!![]);}catch(_0xf72e5e){return BPromise[_0x7676('0x24')](_0xf72e5e);}return _0x41e1ce['save']();};}function saveUpdates(_0x24f5e3,_0x2bde8f){return function(_0x10590a){if(_0x10590a){return _0x10590a[_0x7676('0x25')](_0x24f5e3)['then'](function(_0x2fb25c){return _0x2fb25c;});}return null;};}function removeEntity(_0x10e81c,_0x3cbacf){return function(_0x579181){if(_0x579181){return _0x579181[_0x7676('0x26')]()['then'](function(){_0x10e81c[_0x7676('0x1c')](0xcc)[_0x7676('0x1b')]();});}};}function handleEntityNotFound(_0x2c9907,_0x40ffd4){return function(_0x1ea22e){if(!_0x1ea22e){_0x2c9907[_0x7676('0x1a')](0x194);}return _0x1ea22e;};}function handleError(_0x1d9f22,_0xe21453){_0xe21453=_0xe21453||0x1f4;return function(_0x3446a8){logger[_0x7676('0x27')](_0x3446a8[_0x7676('0x28')]);if(_0x3446a8[_0x7676('0x29')]){delete _0x3446a8[_0x7676('0x29')];}_0x1d9f22[_0x7676('0x1c')](_0xe21453)['send'](_0x3446a8);};}exports[_0x7676('0x2a')]=function(_0x5deec7,_0x112e48){var _0x211ef2={},_0x1b8968={},_0x1f7d15={'count':0x0,'rows':[]};var _0x3730fc=_[_0x7676('0x2b')](db[_0x7676('0x2c')][_0x7676('0x2d')],function(_0x2a69d9){return{'name':_0x2a69d9[_0x7676('0x2e')],'type':_0x2a69d9[_0x7676('0x2f')][_0x7676('0x30')]};});_0x1b8968[_0x7676('0x31')]=_['map'](_0x3730fc,_0x7676('0x29'));_0x1b8968[_0x7676('0x32')]=_[_0x7676('0x33')](_0x5deec7[_0x7676('0x32')]);_0x1b8968['filters']=_[_0x7676('0x34')](_0x1b8968[_0x7676('0x31')],_0x1b8968[_0x7676('0x32')]);_0x211ef2[_0x7676('0x35')]=_[_0x7676('0x34')](_0x1b8968[_0x7676('0x31')],qs[_0x7676('0x36')](_0x5deec7[_0x7676('0x32')]['fields']));_0x211ef2[_0x7676('0x35')]=_0x211ef2[_0x7676('0x35')][_0x7676('0x37')]?_0x211ef2[_0x7676('0x35')]:_0x1b8968[_0x7676('0x31')];if(!_0x5deec7[_0x7676('0x32')]['hasOwnProperty'](_0x7676('0x38'))){_0x211ef2[_0x7676('0x20')]=qs[_0x7676('0x20')](_0x5deec7[_0x7676('0x32')][_0x7676('0x20')]);_0x211ef2[_0x7676('0x1e')]=qs[_0x7676('0x1e')](_0x5deec7[_0x7676('0x32')][_0x7676('0x1e')]);}_0x211ef2[_0x7676('0x39')]=qs['sort'](_0x5deec7[_0x7676('0x32')][_0x7676('0x3a')]);_0x211ef2[_0x7676('0x3b')]=qs[_0x7676('0x3c')](_[_0x7676('0x3d')](_0x5deec7[_0x7676('0x32')],_0x1b8968[_0x7676('0x3c')]),_0x3730fc);if(_0x5deec7[_0x7676('0x32')][_0x7676('0x3e')]){_0x211ef2[_0x7676('0x3b')]=_[_0x7676('0x3f')](_0x211ef2[_0x7676('0x3b')],{'$or':_[_0x7676('0x2b')](_0x3730fc,function(_0x4af961){if(_0x4af961[_0x7676('0x2f')]!=='VIRTUAL'){var _0x1102a0={};_0x1102a0[_0x4af961[_0x7676('0x29')]]={'$like':'%'+_0x5deec7[_0x7676('0x32')]['filter']+'%'};return _0x1102a0;}})});}_0x211ef2=_[_0x7676('0x3f')]({},_0x211ef2,_0x5deec7[_0x7676('0x40')]);var _0x57d824={'where':_0x211ef2[_0x7676('0x3b')]};return db[_0x7676('0x2c')][_0x7676('0x21')](_0x57d824)['then'](function(_0x11e18c){_0x1f7d15['count']=_0x11e18c;if(_0x5deec7[_0x7676('0x32')]['includeAll']){_0x211ef2[_0x7676('0x41')]=[{'all':!![]}];}return db[_0x7676('0x2c')][_0x7676('0x42')](_0x211ef2);})[_0x7676('0x43')](function(_0x51334b){_0x1f7d15[_0x7676('0x44')]=_0x51334b;return _0x1f7d15;})[_0x7676('0x43')](respondWithFilteredResult(_0x112e48,_0x211ef2))[_0x7676('0x45')](handleError(_0x112e48,null));};exports[_0x7676('0x46')]=function(_0x133f4d,_0x1c28c0){var _0x1515be={'raw':!![],'where':{'id':_0x133f4d[_0x7676('0x47')]['id']}},_0x5c18f7={};_0x5c18f7[_0x7676('0x31')]=_[_0x7676('0x33')](db['MailTransferReport'][_0x7676('0x2d')]);_0x5c18f7['query']=_['keys'](_0x133f4d['query']);_0x5c18f7[_0x7676('0x3c')]=_[_0x7676('0x34')](_0x5c18f7[_0x7676('0x31')],_0x5c18f7[_0x7676('0x32')]);_0x1515be['attributes']=_[_0x7676('0x34')](_0x5c18f7[_0x7676('0x31')],qs['fields'](_0x133f4d[_0x7676('0x32')]['fields']));_0x1515be['attributes']=_0x1515be[_0x7676('0x35')][_0x7676('0x37')]?_0x1515be['attributes']:_0x5c18f7['model'];if(_0x133f4d[_0x7676('0x32')][_0x7676('0x48')]){_0x1515be[_0x7676('0x41')]=[{'all':!![]}];}_0x1515be=_[_0x7676('0x3f')]({},_0x1515be,_0x133f4d[_0x7676('0x40')]);return db[_0x7676('0x2c')]['find'](_0x1515be)[_0x7676('0x43')](handleEntityNotFound(_0x1c28c0,null))[_0x7676('0x43')](respondWithResult(_0x1c28c0,null))['catch'](handleError(_0x1c28c0,null));};exports[_0x7676('0x49')]=function(_0x24ceff,_0x29f48d){return db[_0x7676('0x2c')][_0x7676('0x49')](_0x24ceff[_0x7676('0x4a')],{})['then'](respondWithResult(_0x29f48d,0xc9))[_0x7676('0x45')](handleError(_0x29f48d,null));};exports[_0x7676('0x25')]=function(_0x13b01e,_0xd2840b){if(_0x13b01e[_0x7676('0x4a')]['id']){delete _0x13b01e[_0x7676('0x4a')]['id'];}return db[_0x7676('0x2c')][_0x7676('0x4b')]({'where':{'id':_0x13b01e['params']['id']}})[_0x7676('0x43')](handleEntityNotFound(_0xd2840b,null))[_0x7676('0x43')](saveUpdates(_0x13b01e[_0x7676('0x4a')],null))[_0x7676('0x43')](respondWithResult(_0xd2840b,null))['catch'](handleError(_0xd2840b,null));};exports[_0x7676('0x26')]=function(_0x3df0cf,_0x2c40cb){return db[_0x7676('0x2c')][_0x7676('0x4b')]({'where':{'id':_0x3df0cf[_0x7676('0x47')]['id']}})[_0x7676('0x43')](handleEntityNotFound(_0x2c40cb,null))['then'](removeEntity(_0x2c40cb,null))[_0x7676('0x45')](handleError(_0x2c40cb,null));};exports[_0x7676('0x4c')]=function(_0x29fb30,_0x11be11){return db[_0x7676('0x2c')][_0x7676('0x4c')]()[_0x7676('0x43')](respondWithResult(_0x11be11,null))['catch'](handleError(_0x11be11,null));};
\ No newline at end of file
index ca24618..f484cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d9f=['api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x4fe438,_0x3fbfe8){var _0x1164be=function(_0x5ad198){while(--_0x5ad198){_0x4fe438['push'](_0x4fe438['shift']());}};_0x1164be(++_0x3fbfe8);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x2c8df0,_0x32e64b){_0x2c8df0=_0x2c8df0-0x0;var _0x5753b1=_0x7d9f[_0x2c8df0];return _0x5753b1;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('MailTransferReport',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[{'name':_0xf7d9('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b1f,0x195));var _0xf4b1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b1f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 1e12546..3d95e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61aa=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x5b53dd,_0x50575d){var _0xdcf073=function(_0x51fbac){while(--_0x51fbac){_0x5b53dd['push'](_0x5b53dd['shift']());}};_0xdcf073(++_0x50575d);}(_0x61aa,0x17a));var _0xa61a=function(_0x1ea9e8,_0x518c3e){_0x1ea9e8=_0x1ea9e8-0x0;var _0x16a9ec=_0x61aa[_0x1ea9e8];return _0x16a9ec;};'use strict';var _=require('lodash');var util=require(_0xa61a('0x0'));var moment=require(_0xa61a('0x1'));var BPromise=require(_0xa61a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa61a('0x3'));var db=require(_0xa61a('0x4'))['db'];var utils=require(_0xa61a('0x5'));var logger=require(_0xa61a('0x6'))(_0xa61a('0x7'));var config=require('../../config/environment');var jayson=require(_0xa61a('0x8'));var client=jayson['client'][_0xa61a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3457ee,_0x19940b,_0x1295d9){return new BPromise(function(_0x45ee0d,_0x1c6127){return client[_0xa61a('0xa')](_0x3457ee,_0x1295d9)['then'](function(_0x3617fd){logger[_0xa61a('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x19940b,_0xa61a('0xc'));logger[_0xa61a('0xd')](_0xa61a('0xe'),_0x19940b,_0xa61a('0xc'),JSON['stringify'](_0x3617fd));if(_0x3617fd[_0xa61a('0xf')]){if(_0x3617fd[_0xa61a('0xf')][_0xa61a('0x10')]===0x1f4){logger[_0xa61a('0xf')](_0xa61a('0x11'),_0x19940b,_0x3617fd['error']['message']);return _0x1c6127(_0x3617fd[_0xa61a('0xf')]['message']);}logger['error'](_0xa61a('0x11'),_0x19940b,_0x3617fd[_0xa61a('0xf')][_0xa61a('0x12')]);return _0x45ee0d(_0x3617fd[_0xa61a('0xf')]['message']);}else{logger[_0xa61a('0xb')](_0xa61a('0x11'),_0x19940b,_0xa61a('0xc'));_0x45ee0d(_0x3617fd['result'][_0xa61a('0x12')]);}})[_0xa61a('0x13')](function(_0x37dad0){logger[_0xa61a('0xf')](_0xa61a('0x11'),_0x19940b,_0x37dad0);_0x1c6127(_0x37dad0);});});}
\ No newline at end of file
+var _0x3504=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0x3504,0xa7));var _0x4350=function(_0x34076d,_0x2abcd5){_0x34076d=_0x34076d-0x0;var _0x3d52e9=_0x3504[_0x34076d];return _0x3d52e9;};'use strict';var _=require(_0x4350('0x0'));var util=require('util');var moment=require(_0x4350('0x1'));var BPromise=require(_0x4350('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4350('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4350('0x4'))('rpc');var config=require(_0x4350('0x5'));var jayson=require(_0x4350('0x6'));var client=jayson['client'][_0x4350('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f66c6,_0x4db280,_0x26ab1f){return new BPromise(function(_0x161d23,_0x5014fa){return client[_0x4350('0x8')](_0x2f66c6,_0x26ab1f)[_0x4350('0x9')](function(_0x50505a){logger[_0x4350('0xa')](_0x4350('0xb'),_0x4db280,'request\x20sent');logger[_0x4350('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4db280,_0x4350('0xd'),JSON[_0x4350('0xe')](_0x50505a));if(_0x50505a[_0x4350('0xf')]){if(_0x50505a[_0x4350('0xf')][_0x4350('0x10')]===0x1f4){logger[_0x4350('0xf')](_0x4350('0xb'),_0x4db280,_0x50505a['error'][_0x4350('0x11')]);return _0x5014fa(_0x50505a[_0x4350('0xf')][_0x4350('0x11')]);}logger[_0x4350('0xf')](_0x4350('0xb'),_0x4db280,_0x50505a[_0x4350('0xf')]['message']);return _0x161d23(_0x50505a[_0x4350('0xf')]['message']);}else{logger[_0x4350('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x4db280,'request\x20sent');_0x161d23(_0x50505a[_0x4350('0x12')][_0x4350('0x11')]);}})['catch'](function(_0x9e8f2e){logger[_0x4350('0xf')](_0x4350('0xb'),_0x4db280,_0x9e8f2e);_0x5014fa(_0x9e8f2e);});});}
\ No newline at end of file
index 6ea31f3..fe97fce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b6=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','describe','/:id','put','update','delete'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x72b6,0x199));var _0x672b=function(_0x35c450,_0x1a68b0){_0x35c450=_0x35c450-0x0;var _0x2834fb=_0x72b6[_0x35c450];return _0x2834fb;};'use strict';var multer=require(_0x672b('0x0'));var util=require(_0x672b('0x1'));var path=require(_0x672b('0x2'));var timeout=require(_0x672b('0x3'));var express=require(_0x672b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x672b('0x5'));var interaction=require(_0x672b('0x6'));var config=require(_0x672b('0x7'));var controller=require(_0x672b('0x8'));router[_0x672b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x672b('0x9')]('/describe',auth[_0x672b('0xa')](),controller[_0x672b('0xb')]);router[_0x672b('0x9')](_0x672b('0xc'),auth[_0x672b('0xa')](),controller['show']);router['post']('/',auth[_0x672b('0xa')](),controller['create']);router[_0x672b('0xd')]('/:id',auth[_0x672b('0xa')](),controller[_0x672b('0xe')]);router[_0x672b('0xf')](_0x672b('0xc'),auth[_0x672b('0xa')](),controller['destroy']);module[_0x672b('0x10')]=router;
\ No newline at end of file
+var _0xb9eb=['isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x282999,_0x4df660){var _0x30681f=function(_0x50e926){while(--_0x50e926){_0x282999['push'](_0x282999['shift']());}};_0x30681f(++_0x4df660);}(_0xb9eb,0x11d));var _0xbb9e=function(_0x321289,_0x347398){_0x321289=_0x321289-0x0;var _0x19be0c=_0xb9eb[_0x321289];return _0x19be0c;};'use strict';var multer=require(_0xbb9e('0x0'));var util=require('util');var path=require(_0xbb9e('0x1'));var timeout=require(_0xbb9e('0x2'));var express=require('express');var router=express[_0xbb9e('0x3')]();var fs_extra=require(_0xbb9e('0x4'));var auth=require(_0xbb9e('0x5'));var interaction=require(_0xbb9e('0x6'));var config=require(_0xbb9e('0x7'));var controller=require(_0xbb9e('0x8'));router['get']('/',auth[_0xbb9e('0x9')](),controller[_0xbb9e('0xa')]);router[_0xbb9e('0xb')](_0xbb9e('0xc'),auth[_0xbb9e('0x9')](),controller[_0xbb9e('0xd')]);router[_0xbb9e('0xb')]('/:id',auth[_0xbb9e('0x9')](),controller[_0xbb9e('0xe')]);router[_0xbb9e('0xf')]('/',auth[_0xbb9e('0x9')](),controller[_0xbb9e('0x10')]);router[_0xbb9e('0x11')](_0xbb9e('0x12'),auth[_0xbb9e('0x9')](),controller[_0xbb9e('0x13')]);router[_0xbb9e('0x14')]('/:id',auth[_0xbb9e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3337b6a..4d60a1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae7=['diff','seconds','setDataValue','exitAt','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x567709,_0x24d144){var _0xfc920a=function(_0x271058){while(--_0x271058){_0x567709['push'](_0x567709['shift']());}};_0xfc920a(++_0x24d144);}(_0x7ae7,0xd9));var _0x77ae=function(_0x133bd4,_0x4b77ce){_0x133bd4=_0x133bd4-0x0;var _0x2fb252=_0x7ae7[_0x133bd4];return _0x2fb252;};'use strict';var Sequelize=require(_0x77ae('0x0'));var moment=require(_0x77ae('0x1'));module['exports']={'channel':{'type':Sequelize[_0x77ae('0x2')]},'membername':{'type':Sequelize[_0x77ae('0x2')]},'interface':{'type':Sequelize[_0x77ae('0x2')]},'type':{'type':Sequelize[_0x77ae('0x2')],'defaultValue':_0x77ae('0x3'),'comment':_0x77ae('0x4')},'duration':{'type':Sequelize[_0x77ae('0x5')]},'enterAt':{'type':Sequelize[_0x77ae('0x6')]},'exitAt':{'type':Sequelize[_0x77ae('0x6')],'set':function(_0x3dd200){var _0x276be6=moment(_0x3dd200);var _0x1fcff8=moment(this[_0x77ae('0x7')]('enterAt'));var _0x131f0b=_0x276be6[_0x77ae('0x8')](_0x1fcff8,_0x77ae('0x9'));this[_0x77ae('0xa')](_0x77ae('0xb'),_0x3dd200);this[_0x77ae('0xa')]('duration',_0x131f0b||null);}},'data1':{'type':Sequelize[_0x77ae('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x77ae('0xc')},'data3':{'type':Sequelize[_0x77ae('0x2')],'comment':_0x77ae('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x77ae('0xe')},'data5':{'type':Sequelize[_0x77ae('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x77ae('0x2')]},'internal':{'type':Sequelize[_0x77ae('0x5')]},'uniqueid':{'type':Sequelize[_0x77ae('0x2')]}};
\ No newline at end of file
+var _0x0d4e=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds'];(function(_0x5d0522,_0x562a37){var _0x2ee361=function(_0x5cd39a){while(--_0x5cd39a){_0x5d0522['push'](_0x5d0522['shift']());}};_0x2ee361(++_0x562a37);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0d4e[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xe0d4('0x0'));var moment=require(_0xe0d4('0x1'));module[_0xe0d4('0x2')]={'channel':{'type':Sequelize[_0xe0d4('0x3')]},'membername':{'type':Sequelize[_0xe0d4('0x3')]},'interface':{'type':Sequelize[_0xe0d4('0x3')]},'type':{'type':Sequelize[_0xe0d4('0x3')],'defaultValue':_0xe0d4('0x4'),'comment':_0xe0d4('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xe0d4('0x6')]},'exitAt':{'type':Sequelize[_0xe0d4('0x6')],'set':function(_0x2cc782){var _0x25bdbe=moment(_0x2cc782);var _0x54a11f=moment(this['getDataValue'](_0xe0d4('0x7')));var _0x1ba14d=_0x25bdbe[_0xe0d4('0x8')](_0x54a11f,_0xe0d4('0x9'));this[_0xe0d4('0xa')](_0xe0d4('0xb'),_0x2cc782);this[_0xe0d4('0xa')](_0xe0d4('0xc'),_0x1ba14d||null);}},'data1':{'type':Sequelize[_0xe0d4('0x3')],'comment':_0xe0d4('0xd')},'data2':{'type':Sequelize[_0xe0d4('0x3')],'comment':_0xe0d4('0xe')},'data3':{'type':Sequelize[_0xe0d4('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xe0d4('0x3')],'comment':_0xe0d4('0xf')},'data5':{'type':Sequelize[_0xe0d4('0x3')],'comment':_0xe0d4('0x10')},'role':{'type':Sequelize[_0xe0d4('0x3')]},'internal':{'type':Sequelize[_0xe0d4('0x11')]},'uniqueid':{'type':Sequelize[_0xe0d4('0x3')]}};
\ No newline at end of file
index 1e66316..3150033 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(_0x486f67,_0x31a5ba){var _0x51e075=function(_0x5aec97){while(--_0x5aec97){_0x486f67['push'](_0x486f67['shift']());}};_0x51e075(++_0x31a5ba);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x16647d,_0x13ea90){var _0x559eb2=function(_0x5e40dc){while(--_0x5e40dc){_0x16647d['push'](_0x16647d['shift']());}};_0x559eb2(++_0x13ea90);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'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 bf29852..7674d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f50=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f50,0xbb));var _0x05f5=function(_0x3f8d4f,_0x4c3868){_0x3f8d4f=_0x3f8d4f-0x0;var _0x5b3d89=_0x5f50[_0x3f8d4f];return _0x5b3d89;};'use strict';var _=require(_0x05f5('0x0'));var util=require(_0x05f5('0x1'));var logger=require(_0x05f5('0x2'))(_0x05f5('0x3'));var moment=require(_0x05f5('0x4'));var BPromise=require(_0x05f5('0x5'));var rp=require(_0x05f5('0x6'));var fs=require('fs');var path=require(_0x05f5('0x7'));var rimraf=require(_0x05f5('0x8'));var config=require(_0x05f5('0x9'));var attributes=require(_0x05f5('0xa'));module[_0x05f5('0xb')]=function(_0x1fe28e,_0x101399){return _0x1fe28e[_0x05f5('0xc')](_0x05f5('0xd'),attributes,{'tableName':_0x05f5('0xe'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x05f5('0xf'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf52f=['MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3f804f,_0x826fee){var _0x1b3809=function(_0x524f2b){while(--_0x524f2b){_0x3f804f['push'](_0x3f804f['shift']());}};_0x1b3809(++_0x826fee);}(_0xf52f,0x113));var _0xff52=function(_0x579a2f,_0x2a815a){_0x579a2f=_0x579a2f-0x0;var _0x5c9e93=_0xf52f[_0x579a2f];return _0x5c9e93;};'use strict';var _=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var logger=require(_0xff52('0x2'))('api');var moment=require(_0xff52('0x3'));var BPromise=require(_0xff52('0x4'));var rp=require(_0xff52('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff52('0x6'));var config=require(_0xff52('0x7'));var attributes=require('./memberReport.attributes');module[_0xff52('0x8')]=function(_0x3a3ca3,_0x2f8c21){return _0x3a3ca3[_0xff52('0x9')](_0xff52('0xa'),attributes,{'tableName':_0xff52('0xb'),'paranoid':![],'indexes':[{'name':_0xff52('0xc'),'fields':[_0xff52('0xd'),_0xff52('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index f66bbe3..2f52016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2c=['jayson/promise','client','info','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MemberReport','findAll','options','where','attributes','include','map','model','then','GetMemberReport','debug','CreateMemberReport','create','body','raw','update','limit','UpdateMemberReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40164c,_0xbd740b){var _0x22591f=function(_0x22e8dc){while(--_0x22e8dc){_0x40164c['push'](_0x40164c['shift']());}};_0x22591f(++_0xbd740b);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x12ddf6,_0x2e174b){_0x12ddf6=_0x12ddf6-0x0;var _0x46e959=_0xbe2c[_0x12ddf6];return _0x46e959;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var moment=require('moment');var BPromise=require(_0xcbe2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbe2('0x3'));var db=require(_0xcbe2('0x4'))['db'];var utils=require(_0xcbe2('0x5'));var logger=require(_0xcbe2('0x6'))(_0xcbe2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbe2('0x8'));var client=jayson[_0xcbe2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0389,_0x3eb920,_0x1c28ab){return new BPromise(function(_0x294a61,_0x21233e){return client['request'](_0x2c0389,_0x1c28ab)['then'](function(_0xb7fe3c){logger[_0xcbe2('0xa')](_0xcbe2('0xb'),_0x3eb920,_0xcbe2('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x3eb920,_0xcbe2('0xc'),JSON[_0xcbe2('0xd')](_0xb7fe3c));if(_0xb7fe3c[_0xcbe2('0xe')]){if(_0xb7fe3c[_0xcbe2('0xe')][_0xcbe2('0xf')]===0x1f4){logger[_0xcbe2('0xe')]('MemberReport,\x20%s,\x20%s',_0x3eb920,_0xb7fe3c[_0xcbe2('0xe')][_0xcbe2('0x10')]);return _0x21233e(_0xb7fe3c['error'][_0xcbe2('0x10')]);}logger['error'](_0xcbe2('0xb'),_0x3eb920,_0xb7fe3c['error'][_0xcbe2('0x10')]);return _0x294a61(_0xb7fe3c['error']['message']);}else{logger[_0xcbe2('0xa')]('MemberReport,\x20%s,\x20%s',_0x3eb920,_0xcbe2('0xc'));_0x294a61(_0xb7fe3c[_0xcbe2('0x11')][_0xcbe2('0x10')]);}})[_0xcbe2('0x12')](function(_0x40dc0f){logger[_0xcbe2('0xe')](_0xcbe2('0xb'),_0x3eb920,_0x40dc0f);_0x21233e(_0x40dc0f);});});}exports['GetMemberReport']=function(_0xb968ac){var _0x5acacd=this;return new Promise(function(_0x1c09cb,_0xff2918){return db[_0xcbe2('0x13')][_0xcbe2('0x14')]({'raw':_0xb968ac['options']?_0xb968ac[_0xcbe2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xb968ac['options']?_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x16')]||null:null,'attributes':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac['options'][_0xcbe2('0x17')]||null:null,'limit':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac[_0xcbe2('0x15')]['limit']||null:null,'include':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x18')],function(_0x2f1e25){return{'model':db[_0x2f1e25[_0xcbe2('0x1a')]],'as':_0x2f1e25['as'],'attributes':_0x2f1e25['attributes'],'include':_0x2f1e25[_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x2f1e25['include'],function(_0x40039f){return{'model':db[_0x40039f[_0xcbe2('0x1a')]],'as':_0x40039f['as'],'attributes':_0x40039f[_0xcbe2('0x17')],'include':_0x40039f[_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x40039f['include'],function(_0xbc5aab){return{'model':db[_0xbc5aab[_0xcbe2('0x1a')]],'as':_0xbc5aab['as'],'attributes':_0xbc5aab['attributes']};}):[]};}):[]};}):[]:[]})[_0xcbe2('0x1b')](function(_0x5ad2e9){logger[_0xcbe2('0xa')](_0xcbe2('0x1c'),_0xb968ac);logger[_0xcbe2('0x1d')](_0xcbe2('0x1c'),_0xb968ac,JSON['stringify'](_0x5ad2e9));_0x1c09cb(_0x5ad2e9);})[_0xcbe2('0x12')](function(_0x37eb8b){logger['error'](_0xcbe2('0x1c'),_0x37eb8b[_0xcbe2('0x10')],_0xb968ac);_0xff2918(_0x5acacd[_0xcbe2('0xe')](0x1f4,_0x37eb8b[_0xcbe2('0x10')]));});});};exports[_0xcbe2('0x1e')]=function(_0x3cffd1){var _0x3744f3=this;return new Promise(function(_0x8824fc,_0x39ab14){return db[_0xcbe2('0x13')][_0xcbe2('0x1f')](_0x3cffd1[_0xcbe2('0x20')],{'raw':_0x3cffd1[_0xcbe2('0x15')]?_0x3cffd1['options'][_0xcbe2('0x21')]===undefined?!![]:![]:!![]})[_0xcbe2('0x1b')](function(_0x55c233){logger['info'](_0xcbe2('0x1e'),_0x3cffd1);logger['debug'](_0xcbe2('0x1e'),_0x3cffd1,JSON[_0xcbe2('0xd')](_0x55c233));_0x8824fc(_0x55c233);})[_0xcbe2('0x12')](function(_0x8f97c3){logger[_0xcbe2('0xe')](_0xcbe2('0x1e'),_0x8f97c3[_0xcbe2('0x10')],_0x3cffd1);_0x39ab14(_0x3744f3['error'](0x1f4,_0x8f97c3[_0xcbe2('0x10')]));});});};exports['UpdateMemberReport']=function(_0x553af7){var _0x1464d=this;return new Promise(function(_0x4bd628,_0x1fa8f6){return db['MemberReport'][_0xcbe2('0x22')](_0x553af7[_0xcbe2('0x20')],{'raw':_0x553af7['options']?_0x553af7[_0xcbe2('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x553af7[_0xcbe2('0x15')]?_0x553af7['options']['where']||null:null,'attributes':_0x553af7[_0xcbe2('0x15')]?_0x553af7['options']['attributes']||null:null,'limit':_0x553af7[_0xcbe2('0x15')]?_0x553af7['options'][_0xcbe2('0x23')]||null:null})[_0xcbe2('0x1b')](function(_0x1e154e){logger['info'](_0xcbe2('0x24'),_0x553af7);logger[_0xcbe2('0x1d')]('UpdateMemberReport',_0x553af7,JSON['stringify'](_0x1e154e));_0x4bd628(_0x1e154e);})['catch'](function(_0x3eff90){logger[_0xcbe2('0xe')](_0xcbe2('0x24'),_0x3eff90[_0xcbe2('0x10')],_0x553af7);_0x1fa8f6(_0x1464d[_0xcbe2('0xe')](0x1f4,_0x3eff90['message']));});});};
\ No newline at end of file
+var _0x1a61=['http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','request\x20sent','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','model','map','info','catch','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x42737f,_0x5b12bd){var _0x1631a8=function(_0x129ee6){while(--_0x129ee6){_0x42737f['push'](_0x42737f['shift']());}};_0x1631a8(++_0x5b12bd);}(_0x1a61,0x1e6));var _0x11a6=function(_0x4b6300,_0x2c9fb9){_0x4b6300=_0x4b6300-0x0;var _0x22ce59=_0x1a61[_0x4b6300];return _0x22ce59;};'use strict';var _=require(_0x11a6('0x0'));var util=require('util');var moment=require(_0x11a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x11a6('0x2'));var fs=require('fs');var Redis=require(_0x11a6('0x3'));var db=require(_0x11a6('0x4'))['db'];var utils=require(_0x11a6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x11a6('0x6'));var jayson=require(_0x11a6('0x7'));var client=jayson['client'][_0x11a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c4b31,_0x124855,_0x333ec2){return new BPromise(function(_0x1c67ce,_0x33b9b4){return client[_0x11a6('0x9')](_0x1c4b31,_0x333ec2)[_0x11a6('0xa')](function(_0x1a7d57){logger['info']('MemberReport,\x20%s,\x20%s',_0x124855,'request\x20sent');logger[_0x11a6('0xb')](_0x11a6('0xc'),_0x124855,'request\x20sent',JSON[_0x11a6('0xd')](_0x1a7d57));if(_0x1a7d57[_0x11a6('0xe')]){if(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0xf')]===0x1f4){logger[_0x11a6('0xe')](_0x11a6('0x10'),_0x124855,_0x1a7d57['error']['message']);return _0x33b9b4(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0x11')]);}logger['error'](_0x11a6('0x10'),_0x124855,_0x1a7d57[_0x11a6('0xe')]['message']);return _0x1c67ce(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0x11')]);}else{logger['info'](_0x11a6('0x10'),_0x124855,_0x11a6('0x12'));_0x1c67ce(_0x1a7d57[_0x11a6('0x13')][_0x11a6('0x11')]);}})['catch'](function(_0x3d6457){logger[_0x11a6('0xe')](_0x11a6('0x10'),_0x124855,_0x3d6457);_0x33b9b4(_0x3d6457);});});}exports[_0x11a6('0x14')]=function(_0x1a9d43){var _0x1e3cdd=this;return new Promise(function(_0x2449bf,_0x2d9721){return db[_0x11a6('0x15')][_0x11a6('0x16')]({'raw':_0x1a9d43[_0x11a6('0x17')]?_0x1a9d43[_0x11a6('0x17')][_0x11a6('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9d43[_0x11a6('0x17')]?_0x1a9d43['options'][_0x11a6('0x19')]||null:null,'attributes':_0x1a9d43[_0x11a6('0x17')]?_0x1a9d43[_0x11a6('0x17')][_0x11a6('0x1a')]||null:null,'limit':_0x1a9d43['options']?_0x1a9d43['options'][_0x11a6('0x1b')]||null:null,'include':_0x1a9d43['options']?_0x1a9d43[_0x11a6('0x17')]['include']?_['map'](_0x1a9d43['options']['include'],function(_0x111a63){return{'model':db[_0x111a63['model']],'as':_0x111a63['as'],'attributes':_0x111a63[_0x11a6('0x1a')],'include':_0x111a63[_0x11a6('0x1c')]?_['map'](_0x111a63['include'],function(_0x2ffd7f){return{'model':db[_0x2ffd7f[_0x11a6('0x1d')]],'as':_0x2ffd7f['as'],'attributes':_0x2ffd7f[_0x11a6('0x1a')],'include':_0x2ffd7f[_0x11a6('0x1c')]?_[_0x11a6('0x1e')](_0x2ffd7f[_0x11a6('0x1c')],function(_0x40e3b4){return{'model':db[_0x40e3b4[_0x11a6('0x1d')]],'as':_0x40e3b4['as'],'attributes':_0x40e3b4[_0x11a6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11a6('0xa')](function(_0x1ceb50){logger[_0x11a6('0x1f')](_0x11a6('0x14'),_0x1a9d43);logger[_0x11a6('0xb')](_0x11a6('0x14'),_0x1a9d43,JSON[_0x11a6('0xd')](_0x1ceb50));_0x2449bf(_0x1ceb50);})[_0x11a6('0x20')](function(_0x1b7f4e){logger[_0x11a6('0xe')](_0x11a6('0x14'),_0x1b7f4e[_0x11a6('0x11')],_0x1a9d43);_0x2d9721(_0x1e3cdd[_0x11a6('0xe')](0x1f4,_0x1b7f4e[_0x11a6('0x11')]));});});};exports[_0x11a6('0x21')]=function(_0x3827e3){var _0x56f74d=this;return new Promise(function(_0x3ff058,_0x56f3e9){return db[_0x11a6('0x15')][_0x11a6('0x22')](_0x3827e3[_0x11a6('0x23')],{'raw':_0x3827e3[_0x11a6('0x17')]?_0x3827e3[_0x11a6('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x11a6('0xa')](function(_0x3bc3d2){logger['info']('CreateMemberReport',_0x3827e3);logger['debug'](_0x11a6('0x21'),_0x3827e3,JSON[_0x11a6('0xd')](_0x3bc3d2));_0x3ff058(_0x3bc3d2);})['catch'](function(_0x3c24f3){logger[_0x11a6('0xe')](_0x11a6('0x21'),_0x3c24f3[_0x11a6('0x11')],_0x3827e3);_0x56f3e9(_0x56f74d[_0x11a6('0xe')](0x1f4,_0x3c24f3['message']));});});};exports[_0x11a6('0x24')]=function(_0x226546){var _0x46d825=this;return new Promise(function(_0x2449fb,_0x36c352){return db[_0x11a6('0x15')][_0x11a6('0x25')](_0x226546[_0x11a6('0x23')],{'raw':_0x226546[_0x11a6('0x17')]?_0x226546[_0x11a6('0x17')][_0x11a6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x226546[_0x11a6('0x17')]?_0x226546[_0x11a6('0x17')]['where']||null:null,'attributes':_0x226546[_0x11a6('0x17')]?_0x226546[_0x11a6('0x17')][_0x11a6('0x1a')]||null:null,'limit':_0x226546[_0x11a6('0x17')]?_0x226546[_0x11a6('0x17')][_0x11a6('0x1b')]||null:null})[_0x11a6('0xa')](function(_0x3a89b8){logger[_0x11a6('0x1f')]('UpdateMemberReport',_0x226546);logger[_0x11a6('0xb')](_0x11a6('0x24'),_0x226546,JSON['stringify'](_0x3a89b8));_0x2449fb(_0x3a89b8);})[_0x11a6('0x20')](function(_0x745617){logger[_0x11a6('0xe')]('UpdateMemberReport',_0x745617[_0x11a6('0x11')],_0x226546);_0x36c352(_0x46d825[_0x11a6('0xe')](0x1f4,_0x745617['message']));});});};
\ No newline at end of file
index 388d4ba..f3a0a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed08=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout','express','Router'];(function(_0x1ee492,_0x23ea43){var _0x2ef645=function(_0x34ca1f){while(--_0x34ca1f){_0x1ee492['push'](_0x1ee492['shift']());}};_0x2ef645(++_0x23ea43);}(_0xed08,0x67));var _0x8ed0=function(_0x1a7e1d,_0x2c44c1){_0x1a7e1d=_0x1a7e1d-0x0;var _0x42d4d5=_0xed08[_0x1a7e1d];return _0x42d4d5;};'use strict';var multer=require('multer');var util=require(_0x8ed0('0x0'));var path=require(_0x8ed0('0x1'));var timeout=require(_0x8ed0('0x2'));var express=require(_0x8ed0('0x3'));var router=express[_0x8ed0('0x4')]();var fs_extra=require(_0x8ed0('0x5'));var auth=require(_0x8ed0('0x6'));var interaction=require(_0x8ed0('0x7'));var config=require(_0x8ed0('0x8'));var controller=require(_0x8ed0('0x9'));router[_0x8ed0('0xa')]('/',controller[_0x8ed0('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x1c73=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path','express'];(function(_0x18a0d1,_0x2576e5){var _0x1904dd=function(_0x2fecd1){while(--_0x2fecd1){_0x18a0d1['push'](_0x18a0d1['shift']());}};_0x1904dd(++_0x2576e5);}(_0x1c73,0x76));var _0x31c7=function(_0x11aaa1,_0x2ba002){_0x11aaa1=_0x11aaa1-0x0;var _0x300a0a=_0x1c73[_0x11aaa1];return _0x300a0a;};'use strict';var multer=require('multer');var util=require(_0x31c7('0x0'));var path=require(_0x31c7('0x1'));var timeout=require('connect-timeout');var express=require(_0x31c7('0x2'));var router=express['Router']();var fs_extra=require(_0x31c7('0x3'));var auth=require(_0x31c7('0x4'));var interaction=require(_0x31c7('0x5'));var config=require(_0x31c7('0x6'));var controller=require(_0x31c7('0x7'));router[_0x31c7('0x8')]('/',controller[_0x31c7('0x9')]);module[_0x31c7('0xa')]=router;
\ No newline at end of file
index e0abe63..a40f96a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x488c=['version','exports','STRING'];(function(_0x5e9d7c,_0x3111f6){var _0x1e7e9d=function(_0x343923){while(--_0x343923){_0x5e9d7c['push'](_0x5e9d7c['shift']());}};_0x1e7e9d(++_0x3111f6);}(_0x488c,0xb2));var _0xc488=function(_0x25446b,_0x5d05aa){_0x25446b=_0x25446b-0x0;var _0x11409e=_0x488c[_0x25446b];return _0x11409e;};'use strict';var Sequelize=require('sequelize');module[_0xc488('0x0')]={'version':{'type':Sequelize[_0xc488('0x1')],'unique':_0xc488('0x2')}};
\ No newline at end of file
+var _0x3b44=['exports','version','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x3b44,0xb0));var _0x43b4=function(_0x42b6eb,_0x54f3b2){_0x42b6eb=_0x42b6eb-0x0;var _0x54c051=_0x3b44[_0x42b6eb];return _0x54c051;};'use strict';var Sequelize=require(_0x43b4('0x0'));module[_0x43b4('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x43b4('0x2')}};
\ No newline at end of file
index fb099be..2242383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8708=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x4fd3dd,_0x2cb2ba){var _0x23447c=function(_0x10b29c){while(--_0x10b29c){_0x4fd3dd['push'](_0x4fd3dd['shift']());}};_0x23447c(++_0x2cb2ba);}(_0x8708,0x102));var _0x8870=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8708[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x8870('0x0'));var rimraf=require(_0x8870('0x1'));var zipdir=require(_0x8870('0x2'));var jsonpatch=require(_0x8870('0x3'));var rp=require(_0x8870('0x4'));var moment=require(_0x8870('0x5'));var BPromise=require(_0x8870('0x6'));var Mustache=require(_0x8870('0x7'));var util=require('util');var path=require(_0x8870('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8870('0x9'));var fs=require('fs');var fs_extra=require(_0x8870('0xa'));var _=require(_0x8870('0xb'));var squel=require(_0x8870('0xc'));var crypto=require(_0x8870('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8870('0xe'));var toCsv=require(_0x8870('0xf'));var querystring=require(_0x8870('0x10'));var Papa=require(_0x8870('0x11'));var Redis=require(_0x8870('0x12'));var authService=require(_0x8870('0x13'));var qs=require(_0x8870('0x14'));var as=require(_0x8870('0x15'));var hardwareService=require(_0x8870('0x16'));var logger=require('../../config/logger')(_0x8870('0x17'));var utils=require(_0x8870('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8870('0x19'));var db=require(_0x8870('0x1a'))['db'];function respondWithStatusCode(_0xb673f6,_0xb09d9e){_0xb09d9e=_0xb09d9e||0xcc;return function(_0x30d341){if(_0x30d341){return _0xb673f6[_0x8870('0x1b')](_0xb09d9e);}return _0xb673f6[_0x8870('0x1c')](_0xb09d9e)[_0x8870('0x1d')]();};}function respondWithResult(_0x1c58fb,_0x2077f5){_0x2077f5=_0x2077f5||0xc8;return function(_0x3f45c5){if(_0x3f45c5){return _0x1c58fb['status'](_0x2077f5)['json'](_0x3f45c5);}};}function respondWithFilteredResult(_0x568987,_0x2713ce){return function(_0x6f5847){if(_0x6f5847){var _0x135726=typeof _0x2713ce[_0x8870('0x1e')]===_0x8870('0x1f')&&typeof _0x2713ce[_0x8870('0x20')]===_0x8870('0x1f');var _0xf47644=_0x6f5847[_0x8870('0x21')];var _0x670a4c=_0x135726?0x0:_0x2713ce[_0x8870('0x1e')];var _0x38d7a3=_0x135726?_0x6f5847[_0x8870('0x21')]:_0x2713ce['offset']+_0x2713ce['limit'];var _0x2cd88e;if(_0x38d7a3>=_0xf47644){_0x38d7a3=_0xf47644;_0x2cd88e=0xc8;}else{_0x2cd88e=0xce;}_0x568987[_0x8870('0x1c')](_0x2cd88e);return _0x568987[_0x8870('0x22')](_0x8870('0x23'),_0x670a4c+'-'+_0x38d7a3+'/'+_0xf47644)['json'](_0x6f5847);}return null;};}function patchUpdates(_0x2c8d89){return function(_0x11d740){try{jsonpatch[_0x8870('0x24')](_0x11d740,_0x2c8d89,!![]);}catch(_0x431d48){return BPromise[_0x8870('0x25')](_0x431d48);}return _0x11d740[_0x8870('0x26')]();};}function saveUpdates(_0xb07e83,_0xefe521){return function(_0x4f050e){if(_0x4f050e){return _0x4f050e[_0x8870('0x27')](_0xb07e83)[_0x8870('0x28')](function(_0x2358f3){return _0x2358f3;});}return null;};}function removeEntity(_0x18895b,_0x2d190e){return function(_0x31f906){if(_0x31f906){return _0x31f906[_0x8870('0x29')]()[_0x8870('0x28')](function(){_0x18895b[_0x8870('0x1c')](0xcc)[_0x8870('0x1d')]();});}};}function handleEntityNotFound(_0xd0676f,_0x5b3d6f){return function(_0x20a5af){if(!_0x20a5af){_0xd0676f['sendStatus'](0x194);}return _0x20a5af;};}function handleError(_0x382cc5,_0x8a16ff){_0x8a16ff=_0x8a16ff||0x1f4;return function(_0x4d6c5e){logger[_0x8870('0x2a')](_0x4d6c5e[_0x8870('0x2b')]);if(_0x4d6c5e[_0x8870('0x2c')]){delete _0x4d6c5e[_0x8870('0x2c')];}_0x382cc5['status'](_0x8a16ff)[_0x8870('0x2d')](_0x4d6c5e);};}exports[_0x8870('0x2e')]=function(_0x3a7136,_0x1a9faf){var _0x587ab4={},_0x1362bd={},_0x1ef74f={'count':0x0,'rows':[]};var _0x251602=_[_0x8870('0x2f')](db['Migration']['rawAttributes'],function(_0x424821){return{'name':_0x424821['fieldName'],'type':_0x424821['type'][_0x8870('0x30')]};});_0x1362bd['model']=_['map'](_0x251602,'name');_0x1362bd[_0x8870('0x31')]=_[_0x8870('0x32')](_0x3a7136[_0x8870('0x31')]);_0x1362bd[_0x8870('0x33')]=_[_0x8870('0x34')](_0x1362bd[_0x8870('0x35')],_0x1362bd[_0x8870('0x31')]);_0x587ab4[_0x8870('0x36')]=_[_0x8870('0x34')](_0x1362bd[_0x8870('0x35')],qs[_0x8870('0x37')](_0x3a7136[_0x8870('0x31')][_0x8870('0x37')]));_0x587ab4['attributes']=_0x587ab4[_0x8870('0x36')][_0x8870('0x38')]?_0x587ab4[_0x8870('0x36')]:_0x1362bd['model'];if(!_0x3a7136[_0x8870('0x31')]['hasOwnProperty'](_0x8870('0x39'))){_0x587ab4[_0x8870('0x20')]=qs[_0x8870('0x20')](_0x3a7136['query'][_0x8870('0x20')]);_0x587ab4[_0x8870('0x1e')]=qs['offset'](_0x3a7136[_0x8870('0x31')][_0x8870('0x1e')]);}_0x587ab4[_0x8870('0x3a')]=qs[_0x8870('0x3b')](_0x3a7136['query'][_0x8870('0x3b')]);_0x587ab4['where']=qs['filters'](_[_0x8870('0x3c')](_0x3a7136[_0x8870('0x31')],_0x1362bd['filters']),_0x251602);if(_0x3a7136[_0x8870('0x31')][_0x8870('0x3d')]){_0x587ab4['where']=_[_0x8870('0x3e')](_0x587ab4['where'],{'$or':_[_0x8870('0x2f')](_0x251602,function(_0xc22b05){if(_0xc22b05[_0x8870('0x3f')]!==_0x8870('0x40')){var _0x1cc27e={};_0x1cc27e[_0xc22b05[_0x8870('0x2c')]]={'$like':'%'+_0x3a7136[_0x8870('0x31')][_0x8870('0x3d')]+'%'};return _0x1cc27e;}})});}_0x587ab4=_[_0x8870('0x3e')]({},_0x587ab4,_0x3a7136[_0x8870('0x41')]);var _0x281a4a={'where':_0x587ab4[_0x8870('0x42')]};return db[_0x8870('0x43')][_0x8870('0x21')](_0x281a4a)[_0x8870('0x28')](function(_0xbab593){_0x1ef74f[_0x8870('0x21')]=_0xbab593;if(_0x3a7136[_0x8870('0x31')][_0x8870('0x44')]){_0x587ab4[_0x8870('0x45')]=[{'all':!![]}];}return db[_0x8870('0x43')][_0x8870('0x46')](_0x587ab4);})['then'](function(_0x38aa82){_0x1ef74f[_0x8870('0x47')]=_0x38aa82;return _0x1ef74f;})['then'](respondWithFilteredResult(_0x1a9faf,_0x587ab4))[_0x8870('0x48')](handleError(_0x1a9faf,null));};
\ No newline at end of file
+var _0xb9c5=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','error','name','Migration','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x30f861,_0x3d9b61){_0x30f861=_0x30f861-0x0;var _0x539c81=_0xb9c5[_0x30f861];return _0x539c81;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b9c('0x0'));var jsonpatch=require(_0x5b9c('0x1'));var rp=require(_0x5b9c('0x2'));var moment=require(_0x5b9c('0x3'));var BPromise=require(_0x5b9c('0x4'));var Mustache=require(_0x5b9c('0x5'));var util=require(_0x5b9c('0x6'));var path=require(_0x5b9c('0x7'));var sox=require(_0x5b9c('0x8'));var csv=require('to-csv');var ejs=require(_0x5b9c('0x9'));var fs=require('fs');var fs_extra=require(_0x5b9c('0xa'));var _=require(_0x5b9c('0xb'));var squel=require('squel');var crypto=require(_0x5b9c('0xc'));var jsforce=require(_0x5b9c('0xd'));var deskjs=require(_0x5b9c('0xe'));var toCsv=require(_0x5b9c('0xf'));var querystring=require(_0x5b9c('0x10'));var Papa=require(_0x5b9c('0x11'));var Redis=require('ioredis');var authService=require(_0x5b9c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b9c('0x13'));var hardwareService=require(_0x5b9c('0x14'));var logger=require(_0x5b9c('0x15'))(_0x5b9c('0x16'));var utils=require(_0x5b9c('0x17'));var config=require(_0x5b9c('0x18'));var licenseUtil=require(_0x5b9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaf66c,_0x412c39){_0x412c39=_0x412c39||0xcc;return function(_0x2ce0be){if(_0x2ce0be){return _0xaf66c['sendStatus'](_0x412c39);}return _0xaf66c[_0x5b9c('0x1a')](_0x412c39)[_0x5b9c('0x1b')]();};}function respondWithResult(_0x14be16,_0x3df9fd){_0x3df9fd=_0x3df9fd||0xc8;return function(_0x574dc5){if(_0x574dc5){return _0x14be16[_0x5b9c('0x1a')](_0x3df9fd)['json'](_0x574dc5);}};}function respondWithFilteredResult(_0x2bcee0,_0xc20c8d){return function(_0x4eefe9){if(_0x4eefe9){var _0x39b375=typeof _0xc20c8d[_0x5b9c('0x1c')]===_0x5b9c('0x1d')&&typeof _0xc20c8d[_0x5b9c('0x1e')]==='undefined';var _0x594174=_0x4eefe9[_0x5b9c('0x1f')];var _0x43e1f5=_0x39b375?0x0:_0xc20c8d['offset'];var _0xaa00f9=_0x39b375?_0x4eefe9[_0x5b9c('0x1f')]:_0xc20c8d[_0x5b9c('0x1c')]+_0xc20c8d[_0x5b9c('0x1e')];var _0x12ab76;if(_0xaa00f9>=_0x594174){_0xaa00f9=_0x594174;_0x12ab76=0xc8;}else{_0x12ab76=0xce;}_0x2bcee0[_0x5b9c('0x1a')](_0x12ab76);return _0x2bcee0[_0x5b9c('0x20')](_0x5b9c('0x21'),_0x43e1f5+'-'+_0xaa00f9+'/'+_0x594174)[_0x5b9c('0x22')](_0x4eefe9);}return null;};}function patchUpdates(_0x513f04){return function(_0x238872){try{jsonpatch[_0x5b9c('0x23')](_0x238872,_0x513f04,!![]);}catch(_0x1f0df8){return BPromise[_0x5b9c('0x24')](_0x1f0df8);}return _0x238872[_0x5b9c('0x25')]();};}function saveUpdates(_0x5937e1,_0x520994){return function(_0x5737f1){if(_0x5737f1){return _0x5737f1[_0x5b9c('0x26')](_0x5937e1)['then'](function(_0x6b772e){return _0x6b772e;});}return null;};}function removeEntity(_0x1dc2a1,_0x6a057d){return function(_0x13af2e){if(_0x13af2e){return _0x13af2e['destroy']()['then'](function(){_0x1dc2a1[_0x5b9c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x135db8,_0x419d82){return function(_0x46f8ab){if(!_0x46f8ab){_0x135db8['sendStatus'](0x194);}return _0x46f8ab;};}function handleError(_0x151c81,_0x29b56a){_0x29b56a=_0x29b56a||0x1f4;return function(_0xbe34e7){logger[_0x5b9c('0x27')](_0xbe34e7['stack']);if(_0xbe34e7[_0x5b9c('0x28')]){delete _0xbe34e7[_0x5b9c('0x28')];}_0x151c81[_0x5b9c('0x1a')](_0x29b56a)['send'](_0xbe34e7);};}exports['index']=function(_0x3e3a12,_0x40f5f1){var _0x3a1208={},_0x5f15f5={},_0x18d0d2={'count':0x0,'rows':[]};var _0x3d1c65=_['map'](db[_0x5b9c('0x29')][_0x5b9c('0x2a')],function(_0x1fd6b4){return{'name':_0x1fd6b4['fieldName'],'type':_0x1fd6b4[_0x5b9c('0x2b')][_0x5b9c('0x2c')]};});_0x5f15f5['model']=_[_0x5b9c('0x2d')](_0x3d1c65,_0x5b9c('0x28'));_0x5f15f5[_0x5b9c('0x2e')]=_[_0x5b9c('0x2f')](_0x3e3a12['query']);_0x5f15f5['filters']=_[_0x5b9c('0x30')](_0x5f15f5['model'],_0x5f15f5[_0x5b9c('0x2e')]);_0x3a1208[_0x5b9c('0x31')]=_[_0x5b9c('0x30')](_0x5f15f5['model'],qs[_0x5b9c('0x32')](_0x3e3a12[_0x5b9c('0x2e')][_0x5b9c('0x32')]));_0x3a1208[_0x5b9c('0x31')]=_0x3a1208[_0x5b9c('0x31')][_0x5b9c('0x33')]?_0x3a1208[_0x5b9c('0x31')]:_0x5f15f5[_0x5b9c('0x34')];if(!_0x3e3a12[_0x5b9c('0x2e')]['hasOwnProperty'](_0x5b9c('0x35'))){_0x3a1208['limit']=qs['limit'](_0x3e3a12[_0x5b9c('0x2e')]['limit']);_0x3a1208['offset']=qs[_0x5b9c('0x1c')](_0x3e3a12['query'][_0x5b9c('0x1c')]);}_0x3a1208[_0x5b9c('0x36')]=qs['sort'](_0x3e3a12[_0x5b9c('0x2e')][_0x5b9c('0x37')]);_0x3a1208['where']=qs[_0x5b9c('0x38')](_[_0x5b9c('0x39')](_0x3e3a12[_0x5b9c('0x2e')],_0x5f15f5[_0x5b9c('0x38')]),_0x3d1c65);if(_0x3e3a12[_0x5b9c('0x2e')][_0x5b9c('0x3a')]){_0x3a1208[_0x5b9c('0x3b')]=_[_0x5b9c('0x3c')](_0x3a1208[_0x5b9c('0x3b')],{'$or':_[_0x5b9c('0x2d')](_0x3d1c65,function(_0x589cc7){if(_0x589cc7[_0x5b9c('0x2b')]!==_0x5b9c('0x3d')){var _0x28b6f1={};_0x28b6f1[_0x589cc7[_0x5b9c('0x28')]]={'$like':'%'+_0x3e3a12[_0x5b9c('0x2e')]['filter']+'%'};return _0x28b6f1;}})});}_0x3a1208=_['merge']({},_0x3a1208,_0x3e3a12['options']);var _0x21de82={'where':_0x3a1208['where']};return db[_0x5b9c('0x29')]['count'](_0x21de82)[_0x5b9c('0x3e')](function(_0x4dd971){_0x18d0d2[_0x5b9c('0x1f')]=_0x4dd971;if(_0x3e3a12['query'][_0x5b9c('0x3f')]){_0x3a1208[_0x5b9c('0x40')]=[{'all':!![]}];}return db['Migration'][_0x5b9c('0x41')](_0x3a1208);})['then'](function(_0x55bb2f){_0x18d0d2[_0x5b9c('0x42')]=_0x55bb2f;return _0x18d0d2;})[_0x5b9c('0x3e')](respondWithFilteredResult(_0x40f5f1,_0x3a1208))[_0x5b9c('0x43')](handleError(_0x40f5f1,null));};
\ No newline at end of file
index 91d5b5f..ebae4ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb34a=['bluebird','request-promise','path','rimraf','./migration.attributes','exports','migrations','lodash','util','api'];(function(_0x4c36bf,_0x561ef7){var _0x13c67a=function(_0x58011f){while(--_0x58011f){_0x4c36bf['push'](_0x4c36bf['shift']());}};_0x13c67a(++_0x561ef7);}(_0xb34a,0x101));var _0xab34=function(_0x4064ae,_0x3517b8){_0x4064ae=_0x4064ae-0x0;var _0x215842=_0xb34a[_0x4064ae];return _0x215842;};'use strict';var _=require(_0xab34('0x0'));var util=require(_0xab34('0x1'));var logger=require('../../config/logger')(_0xab34('0x2'));var moment=require('moment');var BPromise=require(_0xab34('0x3'));var rp=require(_0xab34('0x4'));var fs=require('fs');var path=require(_0xab34('0x5'));var rimraf=require(_0xab34('0x6'));var config=require('../../config/environment');var attributes=require(_0xab34('0x7'));module[_0xab34('0x8')]=function(_0x272942,_0x45cb53){return _0x272942['define']('Migration',attributes,{'tableName':_0xab34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7fa=['moment','bluebird','request-promise','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x23f4b7,_0x210129){var _0x524a32=function(_0x2b1c05){while(--_0x2b1c05){_0x23f4b7['push'](_0x23f4b7['shift']());}};_0x524a32(++_0x210129);}(_0xf7fa,0x130));var _0xaf7f=function(_0x5dbad9,_0x5040c7){_0x5dbad9=_0x5dbad9-0x0;var _0x45f0a7=_0xf7fa[_0x5dbad9];return _0x45f0a7;};'use strict';var _=require(_0xaf7f('0x0'));var util=require(_0xaf7f('0x1'));var logger=require(_0xaf7f('0x2'))(_0xaf7f('0x3'));var moment=require(_0xaf7f('0x4'));var BPromise=require(_0xaf7f('0x5'));var rp=require(_0xaf7f('0x6'));var fs=require('fs');var path=require(_0xaf7f('0x7'));var rimraf=require(_0xaf7f('0x8'));var config=require('../../config/environment');var attributes=require(_0xaf7f('0x9'));module[_0xaf7f('0xa')]=function(_0x15b1be,_0x297813){return _0x15b1be[_0xaf7f('0xb')](_0xaf7f('0xc'),attributes,{'tableName':_0xaf7f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16cbbf7..f800cc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc874=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment'];(function(_0x1168e7,_0xc55338){var _0x1d171d=function(_0x3b5422){while(--_0x3b5422){_0x1168e7['push'](_0x1168e7['shift']());}};_0x1d171d(++_0xc55338);}(_0xc874,0x154));var _0x4c87=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xc874[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dafe0,_0x30c939,_0xdc4a29){return new BPromise(function(_0x116649,_0x5b7720){return client[_0x4c87('0x9')](_0x3dafe0,_0xdc4a29)['then'](function(_0x384268){logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,_0x4c87('0xc'));logger[_0x4c87('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x30c939,_0x4c87('0xc'),JSON[_0x4c87('0xe')](_0x384268));if(_0x384268['error']){if(_0x384268[_0x4c87('0xf')][_0x4c87('0x10')]===0x1f4){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')]['message']);return _0x5b7720(_0x384268['error']['message']);}logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);return _0x116649(_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);}else{logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,'request\x20sent');_0x116649(_0x384268[_0x4c87('0x12')][_0x4c87('0x11')]);}})['catch'](function(_0x575de5){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x575de5);_0x5b7720(_0x575de5);});});}
\ No newline at end of file
+var _0xd353=['lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x371241,_0x1006c8){var _0x1eb44d=function(_0x587384){while(--_0x587384){_0x371241['push'](_0x371241['shift']());}};_0x1eb44d(++_0x1006c8);}(_0xd353,0x7e));var _0x3d35=function(_0x4fe956,_0x272141){_0x4fe956=_0x4fe956-0x0;var _0x5c4a39=_0xd353[_0x4fe956];return _0x5c4a39;};'use strict';var _=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var moment=require('moment');var BPromise=require(_0x3d35('0x2'));var rs=require(_0x3d35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d35('0x4'));var logger=require('../../config/logger')(_0x3d35('0x5'));var config=require(_0x3d35('0x6'));var jayson=require(_0x3d35('0x7'));var client=jayson[_0x3d35('0x8')][_0x3d35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174b6b,_0x1cf467,_0x5db879){return new BPromise(function(_0x2dd75b,_0x15e0d9){return client[_0x3d35('0xa')](_0x174b6b,_0x5db879)[_0x3d35('0xb')](function(_0x49c42d){logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,_0x3d35('0xe'));logger[_0x3d35('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x1cf467,'request\x20sent',JSON[_0x3d35('0x10')](_0x49c42d));if(_0x49c42d['error']){if(_0x49c42d['error']['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x1cf467,_0x49c42d[_0x3d35('0x11')]['message']);return _0x15e0d9(_0x49c42d[_0x3d35('0x11')][_0x3d35('0x12')]);}logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0x49c42d['error'][_0x3d35('0x12')]);return _0x2dd75b(_0x49c42d[_0x3d35('0x11')]['message']);}else{logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,'request\x20sent');_0x2dd75b(_0x49c42d[_0x3d35('0x13')][_0x3d35('0x12')]);}})[_0x3d35('0x14')](function(_0xdf29b0){logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0xdf29b0);_0x15e0d9(_0xdf29b0);});});}
\ No newline at end of file
index 3927910..cc876a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa37=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','post','create'];(function(_0x5236a7,_0x410673){var _0x55831a=function(_0x5ea8ab){while(--_0x5ea8ab){_0x5236a7['push'](_0x5236a7['shift']());}};_0x55831a(++_0x410673);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xaa37[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xe')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xf')]);router[_0x7aa3('0x10')](_0x7aa3('0x11'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x12')]);router[_0x7aa3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7aa3('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x2a8b=['isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','./network.controller'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2a8b,0x10a));var _0xb2a8=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2a8b[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xb2a8('0x0'));var util=require(_0xb2a8('0x1'));var path=require(_0xb2a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xb2a8('0x3'));var router=express[_0xb2a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb2a8('0x5'));router['get']('/',auth[_0xb2a8('0x6')](),controller[_0xb2a8('0x7')]);router[_0xb2a8('0x8')](_0xb2a8('0x9'),auth[_0xb2a8('0x6')](),controller[_0xb2a8('0xa')]);router[_0xb2a8('0xb')]('/',auth['isAuthenticated'](),controller[_0xb2a8('0xc')]);router['put'](_0xb2a8('0x9'),auth[_0xb2a8('0x6')](),controller[_0xb2a8('0xd')]);router[_0xb2a8('0xe')]('/:id',auth[_0xb2a8('0x6')](),controller[_0xb2a8('0xf')]);module[_0xb2a8('0x10')]=router;
\ No newline at end of file
index bc52f8c..5896ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095b=['STRING','ENUM','localnet','externip','turn'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x095b,0x11e));var _0xb095=function(_0xcd88db,_0x21d77a){_0xcd88db=_0xcd88db-0x0;var _0x3e97f4=_0x095b[_0xcd88db];return _0x3e97f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb095('0x0')](_0xb095('0x1'),_0xb095('0x2'),'stun',_0xb095('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb095('0x4')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x36a0=['turn','STRING','sequelize','exports','ENUM','stun'];(function(_0x12cfae,_0x3dcf7d){var _0x5679fb=function(_0x32af9d){while(--_0x32af9d){_0x12cfae['push'](_0x12cfae['shift']());}};_0x5679fb(++_0x3dcf7d);}(_0x36a0,0x1be));var _0x036a=function(_0x42eb0b,_0x102b9f){_0x42eb0b=_0x42eb0b-0x0;var _0x192dd3=_0x36a0[_0x42eb0b];return _0x192dd3;};'use strict';var Sequelize=require(_0x036a('0x0'));module[_0x036a('0x1')]={'type':{'type':Sequelize[_0x036a('0x2')]('localnet','externip',_0x036a('0x3'),_0x036a('0x4'))},'value':{'type':Sequelize[_0x036a('0x5')]},'username':{'type':Sequelize[_0x036a('0x5')]},'password':{'type':Sequelize[_0x036a('0x5')]}};
\ No newline at end of file
index 68bb05c..8e076b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce98=['join','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','params','STUN','TURN','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','destroy','stack','name','send','index','Network','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','length','find','create','sequelize','transaction','body','toUpperCase','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload'];(function(_0x3ce1cd,_0x22dcf1){var _0xe5fbc7=function(_0x5c76b8){while(--_0x5c76b8){_0x3ce1cd['push'](_0x3ce1cd['shift']());}};_0xe5fbc7(++_0x22dcf1);}(_0xce98,0xe2));var _0x8ce9=function(_0x4a86b8,_0x1a7ce1){_0x4a86b8=_0x4a86b8-0x0;var _0x464cd5=_0xce98[_0x4a86b8];return _0x464cd5;};'use strict';var emlformat=require(_0x8ce9('0x0'));var rimraf=require(_0x8ce9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ce9('0x2'));var rp=require(_0x8ce9('0x3'));var moment=require(_0x8ce9('0x4'));var BPromise=require(_0x8ce9('0x5'));var Mustache=require(_0x8ce9('0x6'));var util=require(_0x8ce9('0x7'));var path=require(_0x8ce9('0x8'));var sox=require(_0x8ce9('0x9'));var csv=require(_0x8ce9('0xa'));var ejs=require(_0x8ce9('0xb'));var fs=require('fs');var fs_extra=require(_0x8ce9('0xc'));var _=require(_0x8ce9('0xd'));var squel=require(_0x8ce9('0xe'));var crypto=require('crypto');var jsforce=require(_0x8ce9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8ce9('0xa'));var querystring=require('querystring');var Papa=require(_0x8ce9('0x10'));var Redis=require(_0x8ce9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8ce9('0x12'));var as=require(_0x8ce9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ce9('0x14'))(_0x8ce9('0x15'));var utils=require(_0x8ce9('0x16'));var config=require(_0x8ce9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ce9('0x18'))['db'];var jayson=require(_0x8ce9('0x19'));var client=jayson[_0x8ce9('0x1a')][_0x8ce9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2906f5,_0xd4154b,_0xcf2999,_0x58f688){return new BPromise(function(_0x2f6fce,_0x38bba2){var _0x1b4636=_0x58f688||client;return _0x1b4636[_0x8ce9('0x1c')](_0x2906f5,_0xcf2999)[_0x8ce9('0x1d')](function(_0x48e7f9){logger[_0x8ce9('0x1e')](_0x8ce9('0x1f'),_0xd4154b,'request\x20sent');logger[_0x8ce9('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0xd4154b,'request\x20sent',JSON[_0x8ce9('0x21')](_0x48e7f9));if(_0x48e7f9[_0x8ce9('0x22')]){if(_0x48e7f9['error'][_0x8ce9('0x23')]===0x1f4){logger[_0x8ce9('0x22')]('Network,\x20%s,\x20%s',_0xd4154b,_0x48e7f9[_0x8ce9('0x22')][_0x8ce9('0x24')]);return _0x38bba2(_0x48e7f9[_0x8ce9('0x22')][_0x8ce9('0x24')]);}logger['error'](_0x8ce9('0x1f'),_0xd4154b,_0x48e7f9[_0x8ce9('0x22')][_0x8ce9('0x24')]);return _0x2f6fce(_0x48e7f9[_0x8ce9('0x22')][_0x8ce9('0x24')]);}else{logger['info'](_0x8ce9('0x1f'),_0xd4154b,_0x8ce9('0x25'));_0x2f6fce(_0x48e7f9[_0x8ce9('0x26')][_0x8ce9('0x24')]);}})[_0x8ce9('0x27')](function(_0x1ef285){logger[_0x8ce9('0x22')]('Network,\x20%s,\x20%s',_0xd4154b,_0x1ef285);_0x38bba2(_0x1ef285);});});}function respondWithStatusCode(_0x445459,_0x527127){_0x527127=_0x527127||0xcc;return function(_0x3c130b){if(_0x3c130b){return _0x445459[_0x8ce9('0x28')](_0x527127);}return _0x445459['status'](_0x527127)['end']();};}function respondWithResult(_0xde6a37,_0x33278e){_0x33278e=_0x33278e||0xc8;return function(_0x3bcb07){if(_0x3bcb07){return _0xde6a37['status'](_0x33278e)['json'](_0x3bcb07);}};}function respondWithFilteredResult(_0x22785c,_0xfd1738){return function(_0x484a16){if(_0x484a16){var _0x33de2a=typeof _0xfd1738[_0x8ce9('0x29')]===_0x8ce9('0x2a')&&typeof _0xfd1738[_0x8ce9('0x2b')]===_0x8ce9('0x2a');var _0xba3dd1=_0x484a16[_0x8ce9('0x2c')];var _0x33add3=_0x33de2a?0x0:_0xfd1738['offset'];var _0x177319=_0x33de2a?_0x484a16[_0x8ce9('0x2c')]:_0xfd1738[_0x8ce9('0x29')]+_0xfd1738[_0x8ce9('0x2b')];var _0x1eb47e;if(_0x177319>=_0xba3dd1){_0x177319=_0xba3dd1;_0x1eb47e=0xc8;}else{_0x1eb47e=0xce;}_0x22785c[_0x8ce9('0x2d')](_0x1eb47e);return _0x22785c[_0x8ce9('0x2e')](_0x8ce9('0x2f'),_0x33add3+'-'+_0x177319+'/'+_0xba3dd1)[_0x8ce9('0x30')](_0x484a16);}return null;};}function patchUpdates(_0x537f52){return function(_0x3b9e4b){try{jsonpatch[_0x8ce9('0x31')](_0x3b9e4b,_0x537f52,!![]);}catch(_0xeea21c){return BPromise['reject'](_0xeea21c);}return _0x3b9e4b['save']();};}function saveUpdates(_0x470aca,_0xa47dfb){return function(_0x29887d){if(_0x29887d){return _0x29887d['update'](_0x470aca)['then'](function(_0x132d53){return _0x132d53;});}return null;};}function removeEntity(_0x980659,_0x15d839){return function(_0x1cecec){if(_0x1cecec){return _0x1cecec[_0x8ce9('0x32')]()[_0x8ce9('0x1d')](function(){_0x980659[_0x8ce9('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5734e4,_0x457285){return function(_0x5e4435){if(!_0x5e4435){_0x5734e4[_0x8ce9('0x28')](0x194);}return _0x5e4435;};}function handleError(_0x1ab24f,_0x33f20e){_0x33f20e=_0x33f20e||0x1f4;return function(_0x13ec1d){logger[_0x8ce9('0x22')](_0x13ec1d[_0x8ce9('0x33')]);if(_0x13ec1d[_0x8ce9('0x34')]){delete _0x13ec1d[_0x8ce9('0x34')];}_0x1ab24f[_0x8ce9('0x2d')](_0x33f20e)[_0x8ce9('0x35')](_0x13ec1d);};}exports[_0x8ce9('0x36')]=function(_0x5614ab,_0x3e3775){var _0x43196d={},_0xf286ae={},_0x1fbc87={'count':0x0,'rows':[]};var _0x5f66e7=_['map'](db[_0x8ce9('0x37')][_0x8ce9('0x38')],function(_0x5d8d1a){return{'name':_0x5d8d1a[_0x8ce9('0x39')],'type':_0x5d8d1a[_0x8ce9('0x3a')][_0x8ce9('0x3b')]};});_0xf286ae[_0x8ce9('0x3c')]=_[_0x8ce9('0x3d')](_0x5f66e7,_0x8ce9('0x34'));_0xf286ae['query']=_[_0x8ce9('0x3e')](_0x5614ab[_0x8ce9('0x3f')]);_0xf286ae[_0x8ce9('0x40')]=_[_0x8ce9('0x41')](_0xf286ae[_0x8ce9('0x3c')],_0xf286ae[_0x8ce9('0x3f')]);_0x43196d[_0x8ce9('0x42')]=_[_0x8ce9('0x41')](_0xf286ae[_0x8ce9('0x3c')],qs[_0x8ce9('0x43')](_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x43')]));_0x43196d['attributes']=_0x43196d[_0x8ce9('0x42')]['length']?_0x43196d['attributes']:_0xf286ae['model'];if(!_0x5614ab['query'][_0x8ce9('0x44')]('nolimit')){_0x43196d[_0x8ce9('0x2b')]=qs['limit'](_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x2b')]);_0x43196d[_0x8ce9('0x29')]=qs[_0x8ce9('0x29')](_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x29')]);}_0x43196d[_0x8ce9('0x45')]=qs[_0x8ce9('0x46')](_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x46')]);_0x43196d[_0x8ce9('0x47')]=qs[_0x8ce9('0x40')](_['pick'](_0x5614ab[_0x8ce9('0x3f')],_0xf286ae[_0x8ce9('0x40')]),_0x5f66e7);if(_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x48')]){_0x43196d[_0x8ce9('0x47')]=_[_0x8ce9('0x49')](_0x43196d['where'],{'$or':_[_0x8ce9('0x3d')](_0x5f66e7,function(_0x2ddad7){if(_0x2ddad7[_0x8ce9('0x3a')]!==_0x8ce9('0x4a')){var _0x1ec6ae={};_0x1ec6ae[_0x2ddad7[_0x8ce9('0x34')]]={'$like':'%'+_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x48')]+'%'};return _0x1ec6ae;}})});}_0x43196d=_[_0x8ce9('0x49')]({},_0x43196d,_0x5614ab['options']);var _0x33440f={'where':_0x43196d[_0x8ce9('0x47')]};return db['Network'][_0x8ce9('0x2c')](_0x33440f)[_0x8ce9('0x1d')](function(_0x375bd5){_0x1fbc87[_0x8ce9('0x2c')]=_0x375bd5;if(_0x5614ab[_0x8ce9('0x3f')][_0x8ce9('0x4b')]){_0x43196d[_0x8ce9('0x4c')]=[{'all':!![]}];}return db['Network'][_0x8ce9('0x4d')](_0x43196d);})[_0x8ce9('0x1d')](function(_0x438300){_0x1fbc87['rows']=_0x438300;return _0x1fbc87;})[_0x8ce9('0x1d')](respondWithFilteredResult(_0x3e3775,_0x43196d))[_0x8ce9('0x27')](handleError(_0x3e3775,null));};exports['show']=function(_0x4b12d8,_0x367265){var _0x45bb73={'raw':!![],'where':{'id':_0x4b12d8['params']['id']}},_0x3c21dd={};_0x3c21dd[_0x8ce9('0x3c')]=_[_0x8ce9('0x3e')](db['Network'][_0x8ce9('0x38')]);_0x3c21dd[_0x8ce9('0x3f')]=_[_0x8ce9('0x3e')](_0x4b12d8[_0x8ce9('0x3f')]);_0x3c21dd['filters']=_[_0x8ce9('0x41')](_0x3c21dd[_0x8ce9('0x3c')],_0x3c21dd[_0x8ce9('0x3f')]);_0x45bb73[_0x8ce9('0x42')]=_[_0x8ce9('0x41')](_0x3c21dd[_0x8ce9('0x3c')],qs[_0x8ce9('0x43')](_0x4b12d8['query'][_0x8ce9('0x43')]));_0x45bb73[_0x8ce9('0x42')]=_0x45bb73['attributes'][_0x8ce9('0x4e')]?_0x45bb73[_0x8ce9('0x42')]:_0x3c21dd[_0x8ce9('0x3c')];if(_0x4b12d8['query'][_0x8ce9('0x4b')]){_0x45bb73['include']=[{'all':!![]}];}_0x45bb73=_[_0x8ce9('0x49')]({},_0x45bb73,_0x4b12d8['options']);return db['Network'][_0x8ce9('0x4f')](_0x45bb73)[_0x8ce9('0x1d')](handleEntityNotFound(_0x367265,null))['then'](respondWithResult(_0x367265,null))[_0x8ce9('0x27')](handleError(_0x367265,null));};exports[_0x8ce9('0x50')]=function(_0x2262c7,_0x280164,_0xaa1d84){var _0x2de739;return db[_0x8ce9('0x51')][_0x8ce9('0x52')](function(_0x20dc3c){return db[_0x8ce9('0x37')]['create'](_0x2262c7[_0x8ce9('0x53')],{'raw':!![]})[_0x8ce9('0x1d')](function(_0x1d63ec){_0x2de739=_0x1d63ec;return db['Network'][_0x8ce9('0x4d')]({'where':{'type':_0x2262c7[_0x8ce9('0x53')][_0x8ce9('0x3a')]},'raw':!![]});})['then'](function(_0x57315a){if(_0x2de739['type'][_0x8ce9('0x54')]()=='STUN'){var _0x2476be=fs[_0x8ce9('0x55')](path['join'](config['root'],_0x8ce9('0x56')),_0x8ce9('0x57'));var _0x4f2dab=ejs[_0x8ce9('0x58')](_0x2476be,{'networks':_0x57315a||[]});fs[_0x8ce9('0x59')](_0x8ce9('0x5a'),_0x4f2dab);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x2de739[_0x8ce9('0x3a')][_0x8ce9('0x54')]()=='TURN'){var _0x5c0658=fs['readFileSync'](path[_0x8ce9('0x5c')](config[_0x8ce9('0x5d')],_0x8ce9('0x5e')),'utf8');var _0x3a8506=ejs[_0x8ce9('0x58')](_0x5c0658,{'networks':_0x57315a||[]});fs['writeFileSync'](_0x8ce9('0x5f'),_0x3a8506);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x50'),{'module':_0x8ce9('0x60')});}else{var _0x335909=fs['readFileSync'](path[_0x8ce9('0x5c')](config['root'],_0x8ce9('0x61')),_0x8ce9('0x57'));var _0x59758c=ejs['render'](_0x335909,{'networks':_0x57315a||[]});fs[_0x8ce9('0x59')](util[_0x8ce9('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x2262c7[_0x8ce9('0x53')]['type'][_0x8ce9('0x63')]()),_0x59758c);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x50'),{'module':_0x8ce9('0x64')});}return null;})[_0x8ce9('0x1d')](function(){return _0x2de739;});})['then'](respondWithResult(_0x280164,0xc9))['catch'](handleError(_0x280164,null));};exports[_0x8ce9('0x65')]=function(_0x495510,_0x5cbaa9,_0x589f90){var _0x490e04;return db[_0x8ce9('0x51')]['transaction'](function(_0x2fa498){return db[_0x8ce9('0x37')][_0x8ce9('0x4f')]({'where':{'id':_0x495510[_0x8ce9('0x66')]['id']}})[_0x8ce9('0x1d')](handleEntityNotFound(_0x5cbaa9,null))[_0x8ce9('0x1d')](saveUpdates(_0x495510['body'],null))[_0x8ce9('0x1d')](function(_0x339824){if(_0x339824){_0x490e04=_0x339824;return db['Network'][_0x8ce9('0x4d')]({'where':{'type':_0x490e04['type']},'raw':!![]});}return null;})[_0x8ce9('0x1d')](function(_0xee5eab){if(_0x490e04['type'][_0x8ce9('0x54')]()==_0x8ce9('0x67')){var _0x4597ca=fs[_0x8ce9('0x55')](path['join'](config[_0x8ce9('0x5d')],_0x8ce9('0x56')),_0x8ce9('0x57'));var _0x1abc94=ejs[_0x8ce9('0x58')](_0x4597ca,{'networks':_0xee5eab||[]});fs[_0x8ce9('0x59')]('/etc/asterisk/stun_xcally.conf',_0x1abc94);return respondWithRpcPromise(_0x8ce9('0x5b'),'update',{'module':'res_stun_monitor.so'});}else if(_0x490e04['type']['toUpperCase']()==_0x8ce9('0x68')){var _0x2323c4=fs[_0x8ce9('0x55')](path[_0x8ce9('0x5c')](config[_0x8ce9('0x5d')],_0x8ce9('0x5e')),_0x8ce9('0x57'));var _0x2cce87=ejs[_0x8ce9('0x58')](_0x2323c4,{'networks':_0xee5eab||[]});fs[_0x8ce9('0x59')](_0x8ce9('0x5f'),_0x2cce87);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x65'),{'module':'res_stun_monitor.so'});}else{var _0x5f4caa=fs[_0x8ce9('0x55')](path['join'](config[_0x8ce9('0x5d')],_0x8ce9('0x61')),_0x8ce9('0x57'));var _0x4ab0ce=ejs['render'](_0x5f4caa,{'networks':_0xee5eab||[]});fs[_0x8ce9('0x59')](util[_0x8ce9('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x495510[_0x8ce9('0x53')][_0x8ce9('0x3a')][_0x8ce9('0x63')]()),_0x4ab0ce);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x65'),{'module':'chan_sip.so'});}return null;})[_0x8ce9('0x1d')](function(_0xff3e1f){if(_0xff3e1f){return _0x490e04;}return null;});})[_0x8ce9('0x1d')](respondWithResult(_0x5cbaa9,null))[_0x8ce9('0x27')](handleError(_0x5cbaa9,null));};exports[_0x8ce9('0x32')]=function(_0x23db88,_0x2f5daf,_0x1151b1){var _0x3148db;return db['Network']['find']({'where':{'id':_0x23db88[_0x8ce9('0x66')]['id']}})['then'](function(_0x25094c){_0x3148db=_0x25094c;return _0x25094c;})[_0x8ce9('0x1d')](handleEntityNotFound(_0x2f5daf,null))['then'](removeEntity(_0x2f5daf,null))[_0x8ce9('0x1d')](function(){if(_0x3148db){return db['Network'][_0x8ce9('0x4d')]({'where':{'type':_0x3148db[_0x8ce9('0x3a')]},'raw':!![]});}})['then'](function(_0x19251d){if(_0x3148db['type'][_0x8ce9('0x54')]()==_0x8ce9('0x67')){var _0x47701f=fs[_0x8ce9('0x55')](path[_0x8ce9('0x5c')](config[_0x8ce9('0x5d')],_0x8ce9('0x56')),'utf8');var _0x289398=ejs['render'](_0x47701f,{'networks':_0x19251d||[]});fs['writeFileSync'](_0x8ce9('0x5a'),_0x289398);return respondWithRpcPromise(_0x8ce9('0x5b'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3148db[_0x8ce9('0x3a')][_0x8ce9('0x54')]()==_0x8ce9('0x68')){var _0x128476=fs[_0x8ce9('0x55')](path[_0x8ce9('0x5c')](config[_0x8ce9('0x5d')],_0x8ce9('0x5e')),_0x8ce9('0x57'));var _0x3f38e6=ejs[_0x8ce9('0x58')](_0x128476,{'networks':_0x19251d||[]});fs[_0x8ce9('0x59')](_0x8ce9('0x5f'),_0x3f38e6);return respondWithRpcPromise(_0x8ce9('0x5b'),_0x8ce9('0x32'),{'module':_0x8ce9('0x60')});}else{var _0x68a44d=fs[_0x8ce9('0x55')](path[_0x8ce9('0x5c')](config[_0x8ce9('0x5d')],_0x8ce9('0x61')),'utf8');var _0x42dbcd=ejs[_0x8ce9('0x58')](_0x68a44d,{'networks':_0x19251d||[]});fs[_0x8ce9('0x59')](util[_0x8ce9('0x62')](_0x8ce9('0x69'),_0x23db88[_0x8ce9('0x53')][_0x8ce9('0x3a')][_0x8ce9('0x63')]()),_0x42dbcd);return respondWithRpcPromise(_0x8ce9('0x5b'),'destroy',{'module':_0x8ce9('0x64')});}return null;})[_0x8ce9('0x27')](handleError(_0x2f5daf,null));};
\ No newline at end of file
+var _0xab09=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','Network,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','Network','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','find','create','sequelize','findAll','body','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','render','format','toLowerCase','transaction','/etc/asterisk/stun_xcally.conf','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xab09,0x6a));var _0x9ab0=function(_0x3b677a,_0x274ecc){_0x3b677a=_0x3b677a-0x0;var _0x2e2eb6=_0xab09[_0x3b677a];return _0x2e2eb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ab0('0x0'));var zipdir=require(_0x9ab0('0x1'));var jsonpatch=require(_0x9ab0('0x2'));var rp=require(_0x9ab0('0x3'));var moment=require(_0x9ab0('0x4'));var BPromise=require(_0x9ab0('0x5'));var Mustache=require(_0x9ab0('0x6'));var util=require(_0x9ab0('0x7'));var path=require(_0x9ab0('0x8'));var sox=require(_0x9ab0('0x9'));var csv=require(_0x9ab0('0xa'));var ejs=require(_0x9ab0('0xb'));var fs=require('fs');var fs_extra=require(_0x9ab0('0xc'));var _=require(_0x9ab0('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9ab0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ab0('0xf'));var Papa=require(_0x9ab0('0x10'));var Redis=require(_0x9ab0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9ab0('0x12'));var as=require(_0x9ab0('0x13'));var hardwareService=require(_0x9ab0('0x14'));var logger=require(_0x9ab0('0x15'))(_0x9ab0('0x16'));var utils=require('../../config/utils');var config=require(_0x9ab0('0x17'));var licenseUtil=require(_0x9ab0('0x18'));var db=require(_0x9ab0('0x19'))['db'];var jayson=require(_0x9ab0('0x1a'));var client=jayson[_0x9ab0('0x1b')][_0x9ab0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x53cc61,_0xb0e901,_0x261e6f,_0xb3d368){return new BPromise(function(_0x3a5dfd,_0x5e9b92){var _0x149165=_0xb3d368||client;return _0x149165['request'](_0x53cc61,_0x261e6f)[_0x9ab0('0x1d')](function(_0x4dcf82){logger[_0x9ab0('0x1e')]('Network,\x20%s,\x20%s',_0xb0e901,_0x9ab0('0x1f'));logger[_0x9ab0('0x20')](_0x9ab0('0x21'),_0xb0e901,_0x9ab0('0x1f'),JSON['stringify'](_0x4dcf82));if(_0x4dcf82[_0x9ab0('0x22')]){if(_0x4dcf82[_0x9ab0('0x22')][_0x9ab0('0x23')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0xb0e901,_0x4dcf82['error']['message']);return _0x5e9b92(_0x4dcf82[_0x9ab0('0x22')][_0x9ab0('0x24')]);}logger[_0x9ab0('0x22')]('Network,\x20%s,\x20%s',_0xb0e901,_0x4dcf82[_0x9ab0('0x22')][_0x9ab0('0x24')]);return _0x3a5dfd(_0x4dcf82[_0x9ab0('0x22')][_0x9ab0('0x24')]);}else{logger[_0x9ab0('0x1e')](_0x9ab0('0x25'),_0xb0e901,_0x9ab0('0x1f'));_0x3a5dfd(_0x4dcf82[_0x9ab0('0x26')]['message']);}})[_0x9ab0('0x27')](function(_0x2b7a11){logger[_0x9ab0('0x22')]('Network,\x20%s,\x20%s',_0xb0e901,_0x2b7a11);_0x5e9b92(_0x2b7a11);});});}function respondWithStatusCode(_0x172011,_0x4c5a5f){_0x4c5a5f=_0x4c5a5f||0xcc;return function(_0x46b44e){if(_0x46b44e){return _0x172011[_0x9ab0('0x28')](_0x4c5a5f);}return _0x172011[_0x9ab0('0x29')](_0x4c5a5f)['end']();};}function respondWithResult(_0x52b3e6,_0x46746d){_0x46746d=_0x46746d||0xc8;return function(_0x6ea1f1){if(_0x6ea1f1){return _0x52b3e6[_0x9ab0('0x29')](_0x46746d)[_0x9ab0('0x2a')](_0x6ea1f1);}};}function respondWithFilteredResult(_0x514afa,_0x2ab6e9){return function(_0x212b6a){if(_0x212b6a){var _0x10572d=typeof _0x2ab6e9[_0x9ab0('0x2b')]===_0x9ab0('0x2c')&&typeof _0x2ab6e9[_0x9ab0('0x2d')]===_0x9ab0('0x2c');var _0xbb29df=_0x212b6a[_0x9ab0('0x2e')];var _0x367b31=_0x10572d?0x0:_0x2ab6e9['offset'];var _0x3c3274=_0x10572d?_0x212b6a[_0x9ab0('0x2e')]:_0x2ab6e9[_0x9ab0('0x2b')]+_0x2ab6e9[_0x9ab0('0x2d')];var _0x401037;if(_0x3c3274>=_0xbb29df){_0x3c3274=_0xbb29df;_0x401037=0xc8;}else{_0x401037=0xce;}_0x514afa[_0x9ab0('0x29')](_0x401037);return _0x514afa['set'](_0x9ab0('0x2f'),_0x367b31+'-'+_0x3c3274+'/'+_0xbb29df)['json'](_0x212b6a);}return null;};}function patchUpdates(_0x2e2af8){return function(_0x4d4a52){try{jsonpatch[_0x9ab0('0x30')](_0x4d4a52,_0x2e2af8,!![]);}catch(_0x1f4521){return BPromise[_0x9ab0('0x31')](_0x1f4521);}return _0x4d4a52[_0x9ab0('0x32')]();};}function saveUpdates(_0x15d659,_0x176e07){return function(_0x51af03){if(_0x51af03){return _0x51af03[_0x9ab0('0x33')](_0x15d659)[_0x9ab0('0x1d')](function(_0x3fc23d){return _0x3fc23d;});}return null;};}function removeEntity(_0x1b297a,_0xa94eb3){return function(_0xe3f2c1){if(_0xe3f2c1){return _0xe3f2c1[_0x9ab0('0x34')]()['then'](function(){_0x1b297a[_0x9ab0('0x29')](0xcc)[_0x9ab0('0x35')]();});}};}function handleEntityNotFound(_0x3b9525,_0x4f739a){return function(_0xcac469){if(!_0xcac469){_0x3b9525[_0x9ab0('0x28')](0x194);}return _0xcac469;};}function handleError(_0x3d6f9d,_0x29039a){_0x29039a=_0x29039a||0x1f4;return function(_0x5267d1){logger[_0x9ab0('0x22')](_0x5267d1[_0x9ab0('0x36')]);if(_0x5267d1[_0x9ab0('0x37')]){delete _0x5267d1[_0x9ab0('0x37')];}_0x3d6f9d['status'](_0x29039a)[_0x9ab0('0x38')](_0x5267d1);};}exports[_0x9ab0('0x39')]=function(_0x1e17ba,_0x21d655){var _0x2434cd={},_0x2ccb6c={},_0x1b2abd={'count':0x0,'rows':[]};var _0xe4cef8=_[_0x9ab0('0x3a')](db[_0x9ab0('0x3b')]['rawAttributes'],function(_0x202999){return{'name':_0x202999[_0x9ab0('0x3c')],'type':_0x202999[_0x9ab0('0x3d')]['key']};});_0x2ccb6c[_0x9ab0('0x3e')]=_['map'](_0xe4cef8,_0x9ab0('0x37'));_0x2ccb6c[_0x9ab0('0x3f')]=_['keys'](_0x1e17ba[_0x9ab0('0x3f')]);_0x2ccb6c[_0x9ab0('0x40')]=_[_0x9ab0('0x41')](_0x2ccb6c['model'],_0x2ccb6c['query']);_0x2434cd[_0x9ab0('0x42')]=_[_0x9ab0('0x41')](_0x2ccb6c['model'],qs[_0x9ab0('0x43')](_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x43')]));_0x2434cd[_0x9ab0('0x42')]=_0x2434cd['attributes'][_0x9ab0('0x44')]?_0x2434cd[_0x9ab0('0x42')]:_0x2ccb6c[_0x9ab0('0x3e')];if(!_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x45')](_0x9ab0('0x46'))){_0x2434cd[_0x9ab0('0x2d')]=qs[_0x9ab0('0x2d')](_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x2d')]);_0x2434cd[_0x9ab0('0x2b')]=qs[_0x9ab0('0x2b')](_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x2b')]);}_0x2434cd[_0x9ab0('0x47')]=qs['sort'](_0x1e17ba[_0x9ab0('0x3f')]['sort']);_0x2434cd[_0x9ab0('0x48')]=qs[_0x9ab0('0x40')](_[_0x9ab0('0x49')](_0x1e17ba[_0x9ab0('0x3f')],_0x2ccb6c['filters']),_0xe4cef8);if(_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x4a')]){_0x2434cd[_0x9ab0('0x48')]=_[_0x9ab0('0x4b')](_0x2434cd[_0x9ab0('0x48')],{'$or':_[_0x9ab0('0x3a')](_0xe4cef8,function(_0x17479f){if(_0x17479f[_0x9ab0('0x3d')]!==_0x9ab0('0x4c')){var _0x4f1530={};_0x4f1530[_0x17479f[_0x9ab0('0x37')]]={'$like':'%'+_0x1e17ba['query']['filter']+'%'};return _0x4f1530;}})});}_0x2434cd=_['merge']({},_0x2434cd,_0x1e17ba[_0x9ab0('0x4d')]);var _0x34b9f4={'where':_0x2434cd['where']};return db[_0x9ab0('0x3b')][_0x9ab0('0x2e')](_0x34b9f4)[_0x9ab0('0x1d')](function(_0x19d5d2){_0x1b2abd[_0x9ab0('0x2e')]=_0x19d5d2;if(_0x1e17ba[_0x9ab0('0x3f')][_0x9ab0('0x4e')]){_0x2434cd[_0x9ab0('0x4f')]=[{'all':!![]}];}return db['Network']['findAll'](_0x2434cd);})[_0x9ab0('0x1d')](function(_0x4db354){_0x1b2abd[_0x9ab0('0x50')]=_0x4db354;return _0x1b2abd;})[_0x9ab0('0x1d')](respondWithFilteredResult(_0x21d655,_0x2434cd))[_0x9ab0('0x27')](handleError(_0x21d655,null));};exports[_0x9ab0('0x51')]=function(_0x4157cc,_0x2aa22c){var _0x58dd68={'raw':!![],'where':{'id':_0x4157cc[_0x9ab0('0x52')]['id']}},_0x25d9c1={};_0x25d9c1['model']=_[_0x9ab0('0x53')](db[_0x9ab0('0x3b')][_0x9ab0('0x54')]);_0x25d9c1['query']=_['keys'](_0x4157cc[_0x9ab0('0x3f')]);_0x25d9c1[_0x9ab0('0x40')]=_[_0x9ab0('0x41')](_0x25d9c1[_0x9ab0('0x3e')],_0x25d9c1['query']);_0x58dd68[_0x9ab0('0x42')]=_['intersection'](_0x25d9c1['model'],qs[_0x9ab0('0x43')](_0x4157cc[_0x9ab0('0x3f')]['fields']));_0x58dd68[_0x9ab0('0x42')]=_0x58dd68['attributes'][_0x9ab0('0x44')]?_0x58dd68[_0x9ab0('0x42')]:_0x25d9c1['model'];if(_0x4157cc['query'][_0x9ab0('0x4e')]){_0x58dd68['include']=[{'all':!![]}];}_0x58dd68=_[_0x9ab0('0x4b')]({},_0x58dd68,_0x4157cc['options']);return db['Network'][_0x9ab0('0x55')](_0x58dd68)[_0x9ab0('0x1d')](handleEntityNotFound(_0x2aa22c,null))[_0x9ab0('0x1d')](respondWithResult(_0x2aa22c,null))[_0x9ab0('0x27')](handleError(_0x2aa22c,null));};exports[_0x9ab0('0x56')]=function(_0x2dd7c6,_0x3baecd,_0x390b38){var _0x2c2c7d;return db[_0x9ab0('0x57')]['transaction'](function(_0x36c4cd){return db['Network'][_0x9ab0('0x56')](_0x2dd7c6['body'],{'raw':!![]})[_0x9ab0('0x1d')](function(_0x3b7e9b){_0x2c2c7d=_0x3b7e9b;return db['Network'][_0x9ab0('0x58')]({'where':{'type':_0x2dd7c6[_0x9ab0('0x59')]['type']},'raw':!![]});})[_0x9ab0('0x1d')](function(_0x2b7e50){if(_0x2c2c7d[_0x9ab0('0x3d')][_0x9ab0('0x5a')]()==_0x9ab0('0x5b')){var _0xf74c85=fs['readFileSync'](path[_0x9ab0('0x5c')](config['root'],_0x9ab0('0x5d')),_0x9ab0('0x5e'));var _0x597340=ejs['render'](_0xf74c85,{'networks':_0x2b7e50||[]});fs[_0x9ab0('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x597340);return respondWithRpcPromise(_0x9ab0('0x60'),'create',{'module':_0x9ab0('0x61')});}else if(_0x2c2c7d['type'][_0x9ab0('0x5a')]()==_0x9ab0('0x62')){var _0x383161=fs[_0x9ab0('0x63')](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x65')),_0x9ab0('0x5e'));var _0x133429=ejs['render'](_0x383161,{'networks':_0x2b7e50||[]});fs[_0x9ab0('0x5f')](_0x9ab0('0x66'),_0x133429);return respondWithRpcPromise('Reload',_0x9ab0('0x56'),{'module':_0x9ab0('0x61')});}else{var _0x4507f6=fs['readFileSync'](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x67')),_0x9ab0('0x5e'));var _0x164cac=ejs[_0x9ab0('0x68')](_0x4507f6,{'networks':_0x2b7e50||[]});fs[_0x9ab0('0x5f')](util[_0x9ab0('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x2dd7c6['body'][_0x9ab0('0x3d')][_0x9ab0('0x6a')]()),_0x164cac);return respondWithRpcPromise(_0x9ab0('0x60'),'create',{'module':'chan_sip.so'});}return null;})[_0x9ab0('0x1d')](function(){return _0x2c2c7d;});})[_0x9ab0('0x1d')](respondWithResult(_0x3baecd,0xc9))[_0x9ab0('0x27')](handleError(_0x3baecd,null));};exports['update']=function(_0x26cd6e,_0x1a5a1e,_0x4f0580){var _0x4e572c;return db[_0x9ab0('0x57')][_0x9ab0('0x6b')](function(_0x3a3e98){return db[_0x9ab0('0x3b')][_0x9ab0('0x55')]({'where':{'id':_0x26cd6e[_0x9ab0('0x52')]['id']}})[_0x9ab0('0x1d')](handleEntityNotFound(_0x1a5a1e,null))[_0x9ab0('0x1d')](saveUpdates(_0x26cd6e[_0x9ab0('0x59')],null))[_0x9ab0('0x1d')](function(_0x505653){if(_0x505653){_0x4e572c=_0x505653;return db[_0x9ab0('0x3b')][_0x9ab0('0x58')]({'where':{'type':_0x4e572c['type']},'raw':!![]});}return null;})['then'](function(_0x558a8e){if(_0x4e572c[_0x9ab0('0x3d')]['toUpperCase']()==_0x9ab0('0x5b')){var _0x1488e8=fs[_0x9ab0('0x63')](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x5d')),_0x9ab0('0x5e'));var _0x263e32=ejs['render'](_0x1488e8,{'networks':_0x558a8e||[]});fs[_0x9ab0('0x5f')](_0x9ab0('0x6c'),_0x263e32);return respondWithRpcPromise(_0x9ab0('0x60'),_0x9ab0('0x33'),{'module':_0x9ab0('0x61')});}else if(_0x4e572c[_0x9ab0('0x3d')][_0x9ab0('0x5a')]()==_0x9ab0('0x62')){var _0x361382=fs[_0x9ab0('0x63')](path['join'](config[_0x9ab0('0x64')],'server/files/templates/turn_multiple.ejs'),_0x9ab0('0x5e'));var _0x16eabd=ejs[_0x9ab0('0x68')](_0x361382,{'networks':_0x558a8e||[]});fs['writeFileSync'](_0x9ab0('0x66'),_0x16eabd);return respondWithRpcPromise('Reload',_0x9ab0('0x33'),{'module':_0x9ab0('0x61')});}else{var _0x1becdc=fs[_0x9ab0('0x63')](path['join'](config[_0x9ab0('0x64')],_0x9ab0('0x67')),_0x9ab0('0x5e'));var _0x3e5b5a=ejs[_0x9ab0('0x68')](_0x1becdc,{'networks':_0x558a8e||[]});fs[_0x9ab0('0x5f')](util[_0x9ab0('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x26cd6e[_0x9ab0('0x59')][_0x9ab0('0x3d')][_0x9ab0('0x6a')]()),_0x3e5b5a);return respondWithRpcPromise(_0x9ab0('0x60'),_0x9ab0('0x33'),{'module':_0x9ab0('0x6d')});}return null;})[_0x9ab0('0x1d')](function(_0x4e89b1){if(_0x4e89b1){return _0x4e572c;}return null;});})[_0x9ab0('0x1d')](respondWithResult(_0x1a5a1e,null))['catch'](handleError(_0x1a5a1e,null));};exports[_0x9ab0('0x34')]=function(_0x52656d,_0x4f2473,_0x555a2f){var _0x12cbc3;return db['Network']['find']({'where':{'id':_0x52656d['params']['id']}})['then'](function(_0x5ea873){_0x12cbc3=_0x5ea873;return _0x5ea873;})[_0x9ab0('0x1d')](handleEntityNotFound(_0x4f2473,null))['then'](removeEntity(_0x4f2473,null))[_0x9ab0('0x1d')](function(){if(_0x12cbc3){return db[_0x9ab0('0x3b')]['findAll']({'where':{'type':_0x12cbc3[_0x9ab0('0x3d')]},'raw':!![]});}})[_0x9ab0('0x1d')](function(_0x1d2309){if(_0x12cbc3[_0x9ab0('0x3d')][_0x9ab0('0x5a')]()==_0x9ab0('0x5b')){var _0x4bbee2=fs[_0x9ab0('0x63')](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x5d')),_0x9ab0('0x5e'));var _0x3eb6d3=ejs[_0x9ab0('0x68')](_0x4bbee2,{'networks':_0x1d2309||[]});fs[_0x9ab0('0x5f')](_0x9ab0('0x6c'),_0x3eb6d3);return respondWithRpcPromise('Reload',_0x9ab0('0x34'),{'module':_0x9ab0('0x61')});}else if(_0x12cbc3[_0x9ab0('0x3d')][_0x9ab0('0x5a')]()==_0x9ab0('0x62')){var _0x1edd84=fs[_0x9ab0('0x63')](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x65')),_0x9ab0('0x5e'));var _0x4ae435=ejs['render'](_0x1edd84,{'networks':_0x1d2309||[]});fs[_0x9ab0('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x4ae435);return respondWithRpcPromise('Reload',_0x9ab0('0x34'),{'module':_0x9ab0('0x61')});}else{var _0x45762f=fs[_0x9ab0('0x63')](path[_0x9ab0('0x5c')](config[_0x9ab0('0x64')],_0x9ab0('0x67')),_0x9ab0('0x5e'));var _0x39063b=ejs['render'](_0x45762f,{'networks':_0x1d2309||[]});fs[_0x9ab0('0x5f')](util['format'](_0x9ab0('0x6e'),_0x52656d[_0x9ab0('0x59')][_0x9ab0('0x3d')][_0x9ab0('0x6a')]()),_0x39063b);return respondWithRpcPromise('Reload','destroy',{'module':_0x9ab0('0x6d')});}return null;})[_0x9ab0('0x27')](handleError(_0x4f2473,null));};
\ No newline at end of file
index f834afb..295db30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01fe=['../../config/environment','exports','define','Network','network','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0x01fe,0x102));var _0xe01f=function(_0xe58ccf,_0x4fa8b9){_0xe58ccf=_0xe58ccf-0x0;var _0xd34544=_0x01fe[_0xe58ccf];return _0xd34544;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var logger=require(_0xe01f('0x1'))(_0xe01f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe01f('0x3'));var fs=require('fs');var path=require(_0xe01f('0x4'));var rimraf=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var attributes=require('./network.attributes');module[_0xe01f('0x7')]=function(_0x574969,_0x3effc4){return _0x574969[_0xe01f('0x8')](_0xe01f('0x9'),attributes,{'tableName':_0xe01f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e5c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','define','Network','network','lodash','util'];(function(_0x531607,_0x73fa88){var _0x1b1fbb=function(_0x4af491){while(--_0x4af491){_0x531607['push'](_0x531607['shift']());}};_0x1b1fbb(++_0x73fa88);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x3da3bc,_0x3ad8bc){_0x3da3bc=_0x3da3bc-0x0;var _0xa71efb=_0x3e5c[_0x3da3bc];return _0xa71efb;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var logger=require(_0xc3e5('0x2'))(_0xc3e5('0x3'));var moment=require('moment');var BPromise=require(_0xc3e5('0x4'));var rp=require(_0xc3e5('0x5'));var fs=require('fs');var path=require(_0xc3e5('0x6'));var rimraf=require(_0xc3e5('0x7'));var config=require(_0xc3e5('0x8'));var attributes=require(_0xc3e5('0x9'));module['exports']=function(_0xf61ec2,_0xdf5a06){return _0xf61ec2[_0xc3e5('0xa')](_0xc3e5('0xb'),attributes,{'tableName':_0xc3e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8407c6..73d31b4 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x1759b8,_0x370edc){_0x1759b8=_0x1759b8-0x0;var _0x19f8a4=_0x7a54[_0x1759b8];return _0x19f8a4;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ae3fe,_0x28d0d6){var _0x3f097b=function(_0x4e262e){while(--_0x4e262e){_0x3ae3fe['push'](_0x3ae3fe['shift']());}};_0x3f097b(++_0x28d0d6);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index 69630dc..8c7ef04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc5=['update','destroy','removeDispositions','delete','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','isAuthenticated','getApplications','/:id/interactions','post','/:id/notify','notify','addApplications','/:id/users','addAgents','put'];(function(_0x1c349a,_0x4f2ee0){var _0x4ec7b1=function(_0x5d4b9b){while(--_0x5d4b9b){_0x1c349a['push'](_0x1c349a['shift']());}};_0x4ec7b1(++_0x4f2ee0);}(_0x9bc5,0x9f));var _0x59bc=function(_0x33a1af,_0x2b3d99){_0x33a1af=_0x33a1af-0x0;var _0x13719d=_0x9bc5[_0x33a1af];return _0x13719d;};'use strict';var multer=require('multer');var util=require(_0x59bc('0x0'));var path=require(_0x59bc('0x1'));var timeout=require(_0x59bc('0x2'));var express=require('express');var router=express[_0x59bc('0x3')]();var fs_extra=require(_0x59bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x59bc('0x5'));var config=require(_0x59bc('0x6'));var controller=require(_0x59bc('0x7'));router[_0x59bc('0x8')]('/',auth['isAuthenticated'](),controller[_0x59bc('0x9')]);router[_0x59bc('0x8')](_0x59bc('0xa'),auth['isAuthenticated'](),controller[_0x59bc('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x59bc('0x8')](_0x59bc('0xc'),auth['isAuthenticated'](),controller[_0x59bc('0xd')]);router[_0x59bc('0x8')](_0x59bc('0xe'),auth['isAuthenticated'](),controller[_0x59bc('0xf')]);router[_0x59bc('0x8')](_0x59bc('0x10'),auth[_0x59bc('0x11')](),controller[_0x59bc('0x12')]);router['get'](_0x59bc('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x59bc('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x59bc('0x14')]('/',auth[_0x59bc('0x11')](),controller['create']);router['post'](_0x59bc('0xc'),auth[_0x59bc('0x11')](),controller['addDisposition']);router[_0x59bc('0x14')](_0x59bc('0xe'),auth[_0x59bc('0x11')](),controller['addAnswer']);router[_0x59bc('0x14')](_0x59bc('0x15'),controller[_0x59bc('0x16')]);router['post'](_0x59bc('0x10'),auth['isAuthenticated'](),controller[_0x59bc('0x17')]);router[_0x59bc('0x14')](_0x59bc('0x18'),auth[_0x59bc('0x11')](),controller[_0x59bc('0x19')]);router[_0x59bc('0x14')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x59bc('0x1a')]('/:id',auth[_0x59bc('0x11')](),controller[_0x59bc('0x1b')]);router['delete']('/:id',auth[_0x59bc('0x11')](),controller[_0x59bc('0x1c')]);router['delete'](_0x59bc('0xc'),auth[_0x59bc('0x11')](),controller[_0x59bc('0x1d')]);router['delete'](_0x59bc('0xe'),auth[_0x59bc('0x11')](),controller['removeAnswers']);router[_0x59bc('0x1e')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xae3e=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','addAnswer','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express'];(function(_0xe5ded3,_0x2b5b86){var _0x56b973=function(_0x3c69b1){while(--_0x3c69b1){_0xe5ded3['push'](_0xe5ded3['shift']());}};_0x56b973(++_0x2b5b86);}(_0xae3e,0x124));var _0xeae3=function(_0xcdc46b,_0x5007bf){_0xcdc46b=_0xcdc46b-0x0;var _0x4f46cb=_0xae3e[_0xcdc46b];return _0x4f46cb;};'use strict';var multer=require(_0xeae3('0x0'));var util=require(_0xeae3('0x1'));var path=require(_0xeae3('0x2'));var timeout=require(_0xeae3('0x3'));var express=require(_0xeae3('0x4'));var router=express['Router']();var fs_extra=require(_0xeae3('0x5'));var auth=require(_0xeae3('0x6'));var interaction=require(_0xeae3('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xeae3('0x8')]('/',auth[_0xeae3('0x9')](),controller[_0xeae3('0xa')]);router[_0xeae3('0x8')](_0xeae3('0xb'),auth[_0xeae3('0x9')](),controller[_0xeae3('0xc')]);router[_0xeae3('0x8')](_0xeae3('0xd'),auth[_0xeae3('0x9')](),controller['show']);router[_0xeae3('0x8')](_0xeae3('0xe'),auth[_0xeae3('0x9')](),controller[_0xeae3('0xf')]);router['get'](_0xeae3('0x10'),auth[_0xeae3('0x9')](),controller[_0xeae3('0x11')]);router['get']('/:id/applications',auth[_0xeae3('0x9')](),controller['getApplications']);router[_0xeae3('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xeae3('0x8')](_0xeae3('0x12'),auth['isAuthenticated'](),controller[_0xeae3('0x13')]);router[_0xeae3('0x14')]('/',auth[_0xeae3('0x9')](),controller[_0xeae3('0x15')]);router['post'](_0xeae3('0xe'),auth[_0xeae3('0x9')](),controller['addDisposition']);router[_0xeae3('0x14')]('/:id/canned_answers',auth[_0xeae3('0x9')](),controller[_0xeae3('0x16')]);router[_0xeae3('0x14')]('/:id/notify',controller['notify']);router['post'](_0xeae3('0x17'),auth[_0xeae3('0x9')](),controller[_0xeae3('0x18')]);router['post'](_0xeae3('0x12'),auth['isAuthenticated'](),controller[_0xeae3('0x19')]);router['post'](_0xeae3('0x1a'),auth[_0xeae3('0x9')](),controller[_0xeae3('0x1b')]);router[_0xeae3('0x1c')](_0xeae3('0xd'),auth[_0xeae3('0x9')](),controller[_0xeae3('0x1d')]);router[_0xeae3('0x1e')]('/:id',auth[_0xeae3('0x9')](),controller[_0xeae3('0x1f')]);router[_0xeae3('0x1e')](_0xeae3('0xe'),auth['isAuthenticated'](),controller[_0xeae3('0x20')]);router['delete']('/:id/canned_answers',auth[_0xeae3('0x9')](),controller['removeAnswers']);router['delete'](_0xeae3('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 27a46dc..b3edbfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f6=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x47a316,_0x22488f){var _0x5ac32c=function(_0x50647b){while(--_0x50647b){_0x47a316['push'](_0x47a316['shift']());}};_0x5ac32c(++_0x22488f);}(_0x04f6,0x18c));var _0x604f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x04f6[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x604f('0x0'));var rs=require(_0x604f('0x1'));module[_0x604f('0x2')]={'name':{'type':Sequelize[_0x604f('0x3')],'unique':_0x604f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x604f('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x604f('0x5')]();}},'replyUri':{'type':Sequelize[_0x604f('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x604f('0x6');}},'notificationSound':{'type':Sequelize[_0x604f('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x604f('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x604f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x604f('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x604f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x604f('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x604f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x604f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x604f('0x7')],'defaultValue':![],'comment':_0x604f('0xa'),'set':function(_0x240d5a){if(!_0x240d5a)this[_0x604f('0xb')](_0x604f('0xc'),null);this[_0x604f('0xb')](_0x604f('0xd'),_0x240d5a);}}};
\ No newline at end of file
+var _0xf127=['mandatoryDispositionPauseId','randomstring','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x5cd322,_0x310908){var _0x52df5c=function(_0x15153e){while(--_0x15153e){_0x5cd322['push'](_0x5cd322['shift']());}};_0x52df5c(++_0x310908);}(_0xf127,0x121));var _0x7f12=function(_0x3a105d,_0x326cdd){_0x3a105d=_0x3a105d-0x0;var _0x2825af=_0xf127[_0x3a105d];return _0x2825af;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x7f12('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f12('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x7f12('0x1')],'defaultValue':function(){return rs[_0x7f12('0x2')]();}},'replyUri':{'type':Sequelize[_0x7f12('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7f12('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7f12('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7f12('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f12('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f12('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x7f12('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f12('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f12('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x7f12('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x7f12('0x4')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x500d7e){if(!_0x500d7e)this['setDataValue'](_0x7f12('0x7'),null);this['setDataValue']('mandatoryDisposition',_0x500d7e);}}};
\ No newline at end of file
index 77c038a..8b31a9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab1=['Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','length','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','OpenchannelAccountId','getDispositions','Disposition','nolimit','removeDispositions','ids','addAnswer','create','getAnswers','findOne','CannedAnswer','includeAll','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','DESC','OpenchannelApplication','Applications','list','applications','orderBy','priority','asc','account','Contacts','CmContact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','contact','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','transaction','bulkCreate','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x9ab1,0x17e));var _0x19ab=function(_0x76e91a,_0x4035cc){_0x76e91a=_0x76e91a-0x0;var _0x2d5ab7=_0x9ab1[_0x76e91a];return _0x2d5ab7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x19ab('0x0'));var zipdir=require(_0x19ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19ab('0x2'));var moment=require(_0x19ab('0x3'));var BPromise=require(_0x19ab('0x4'));var Mustache=require(_0x19ab('0x5'));var util=require(_0x19ab('0x6'));var path=require(_0x19ab('0x7'));var sox=require('sox');var csv=require(_0x19ab('0x8'));var ejs=require(_0x19ab('0x9'));var fs=require('fs');var fs_extra=require(_0x19ab('0xa'));var _=require(_0x19ab('0xb'));var squel=require(_0x19ab('0xc'));var crypto=require(_0x19ab('0xd'));var jsforce=require(_0x19ab('0xe'));var deskjs=require(_0x19ab('0xf'));var toCsv=require(_0x19ab('0x8'));var querystring=require(_0x19ab('0x10'));var Papa=require('papaparse');var Redis=require(_0x19ab('0x11'));var authService=require(_0x19ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x19ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x19ab('0x14'))('api');var utils=require(_0x19ab('0x15'));var config=require(_0x19ab('0x16'));var licenseUtil=require(_0x19ab('0x17'));var db=require(_0x19ab('0x18'))['db'];config[_0x19ab('0x19')]=_[_0x19ab('0x1a')](config[_0x19ab('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x19ab('0x1b'))(new Redis(config[_0x19ab('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x19ab('0x1c'));var client=jayson[_0x19ab('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x19ab('0x1d')][_0x19ab('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3fc61a,_0x50a03f,_0x4d290d,_0x455765){return new BPromise(function(_0x2db350,_0x3149ec){var _0x35b227=_0x455765||client;return _0x35b227[_0x19ab('0x1f')](_0x3fc61a,_0x4d290d)[_0x19ab('0x20')](function(_0x3f9f21){logger[_0x19ab('0x21')](_0x19ab('0x22'),_0x50a03f,_0x19ab('0x23'));logger[_0x19ab('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x50a03f,_0x19ab('0x23'),JSON[_0x19ab('0x25')](_0x3f9f21));if(_0x3f9f21[_0x19ab('0x26')]){if(_0x3f9f21[_0x19ab('0x26')][_0x19ab('0x27')]===0x1f4){logger[_0x19ab('0x26')](_0x19ab('0x22'),_0x50a03f,_0x3f9f21['error'][_0x19ab('0x28')]);return _0x3149ec(_0x3f9f21[_0x19ab('0x26')][_0x19ab('0x28')]);}logger[_0x19ab('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x50a03f,_0x3f9f21[_0x19ab('0x26')][_0x19ab('0x28')]);return _0x2db350(_0x3f9f21[_0x19ab('0x26')][_0x19ab('0x28')]);}else{logger[_0x19ab('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x50a03f,_0x19ab('0x23'));_0x2db350(_0x3f9f21[_0x19ab('0x29')]['message']);}})[_0x19ab('0x2a')](function(_0x2994fa){logger[_0x19ab('0x26')](_0x19ab('0x22'),_0x50a03f,_0x2994fa);_0x3149ec(_0x2994fa);});});}function respondWithStatusCode(_0x523b6b,_0x3ce4e7){_0x3ce4e7=_0x3ce4e7||0xcc;return function(_0x165bee){if(_0x165bee){return _0x523b6b[_0x19ab('0x2b')](_0x3ce4e7);}return _0x523b6b[_0x19ab('0x2c')](_0x3ce4e7)[_0x19ab('0x2d')]();};}function respondWithResult(_0x5c5956,_0xa8b5bd){_0xa8b5bd=_0xa8b5bd||0xc8;return function(_0x336e19){if(_0x336e19){return _0x5c5956[_0x19ab('0x2c')](_0xa8b5bd)['json'](_0x336e19);}};}function respondWithFilteredResult(_0x368219,_0x53a6d5){return function(_0xc50346){if(_0xc50346){var _0x453248=typeof _0x53a6d5[_0x19ab('0x2e')]===_0x19ab('0x2f')&&typeof _0x53a6d5['limit']===_0x19ab('0x2f');var _0x28dba2=_0xc50346['count'];var _0x4adad6=_0x453248?0x0:_0x53a6d5['offset'];var _0x2b979c=_0x453248?_0xc50346[_0x19ab('0x30')]:_0x53a6d5[_0x19ab('0x2e')]+_0x53a6d5[_0x19ab('0x31')];var _0x378d90;if(_0x2b979c>=_0x28dba2){_0x2b979c=_0x28dba2;_0x378d90=0xc8;}else{_0x378d90=0xce;}_0x368219[_0x19ab('0x2c')](_0x378d90);return _0x368219[_0x19ab('0x32')](_0x19ab('0x33'),_0x4adad6+'-'+_0x2b979c+'/'+_0x28dba2)['json'](_0xc50346);}return null;};}function patchUpdates(_0x53bb7e){return function(_0x3757fb){try{jsonpatch[_0x19ab('0x34')](_0x3757fb,_0x53bb7e,!![]);}catch(_0x206cc3){return BPromise[_0x19ab('0x35')](_0x206cc3);}return _0x3757fb[_0x19ab('0x36')]();};}function saveUpdates(_0x59803d,_0x5b8e26){return function(_0x20e04e){if(_0x20e04e){return _0x20e04e['update'](_0x59803d)[_0x19ab('0x20')](function(_0x41b2d7){return _0x41b2d7;});}return null;};}function removeEntity(_0x15630b,_0x22c01f){return function(_0x683e42){if(_0x683e42){return _0x683e42[_0x19ab('0x37')]()[_0x19ab('0x20')](function(){var _0x3c2353=_0x683e42[_0x19ab('0x38')]({'plain':!![]});var _0x4692fa=_0x19ab('0x39');return db[_0x19ab('0x3a')]['destroy']({'where':{'type':_0x4692fa,'resourceId':_0x3c2353['id']}})[_0x19ab('0x20')](function(){return _0x683e42;});})[_0x19ab('0x20')](function(){_0x15630b['status'](0xcc)[_0x19ab('0x2d')]();});}};}function handleEntityNotFound(_0x102eca,_0x32abb2){return function(_0x1b4003){if(!_0x1b4003){_0x102eca['sendStatus'](0x194);}return _0x1b4003;};}function handleError(_0x3ef964,_0x4e53e1){_0x4e53e1=_0x4e53e1||0x1f4;return function(_0x575476){logger[_0x19ab('0x26')](_0x575476[_0x19ab('0x3b')]);if(_0x575476[_0x19ab('0x3c')]){delete _0x575476[_0x19ab('0x3c')];}_0x3ef964[_0x19ab('0x2c')](_0x4e53e1)[_0x19ab('0x3d')](_0x575476);};}exports[_0x19ab('0x3e')]=function(_0x232f1b,_0x2a3e1d){var _0x14b7a1={'include':[{'model':db[_0x19ab('0x3f')],'as':_0x19ab('0x40')}]},_0x5aeca8={},_0x971115={'count':0x0,'rows':[]};var _0x55cc64=_[_0x19ab('0x41')](db[_0x19ab('0x42')][_0x19ab('0x43')],function(_0x706afa){return{'name':_0x706afa[_0x19ab('0x44')],'type':_0x706afa[_0x19ab('0x45')][_0x19ab('0x46')]};});_0x5aeca8[_0x19ab('0x47')]=_[_0x19ab('0x41')](_0x55cc64,_0x19ab('0x3c'));_0x5aeca8['query']=_[_0x19ab('0x48')](_0x232f1b[_0x19ab('0x49')]);_0x5aeca8[_0x19ab('0x4a')]=_['intersection'](_0x5aeca8['model'],_0x5aeca8[_0x19ab('0x49')]);_0x14b7a1[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x5aeca8[_0x19ab('0x47')],qs[_0x19ab('0x4d')](_0x232f1b['query'][_0x19ab('0x4d')]));_0x14b7a1[_0x19ab('0x4b')]=_0x14b7a1[_0x19ab('0x4b')]['length']?_0x14b7a1[_0x19ab('0x4b')]:_0x5aeca8[_0x19ab('0x47')];if(!_0x232f1b[_0x19ab('0x49')][_0x19ab('0x4e')]('nolimit')){_0x14b7a1['limit']=qs[_0x19ab('0x31')](_0x232f1b[_0x19ab('0x49')][_0x19ab('0x31')]);_0x14b7a1[_0x19ab('0x2e')]=qs[_0x19ab('0x2e')](_0x232f1b[_0x19ab('0x49')][_0x19ab('0x2e')]);}_0x14b7a1[_0x19ab('0x4f')]=qs[_0x19ab('0x50')](_0x232f1b[_0x19ab('0x49')][_0x19ab('0x50')]);_0x14b7a1[_0x19ab('0x51')]=qs[_0x19ab('0x4a')](_[_0x19ab('0x52')](_0x232f1b[_0x19ab('0x49')],_0x5aeca8[_0x19ab('0x4a')]),_0x55cc64);if(_0x232f1b[_0x19ab('0x49')][_0x19ab('0x53')]){_0x14b7a1[_0x19ab('0x51')]=_[_0x19ab('0x54')](_0x14b7a1[_0x19ab('0x51')],{'$or':_[_0x19ab('0x41')](_0x55cc64,function(_0x2afb81){if(_0x2afb81[_0x19ab('0x45')]!==_0x19ab('0x55')){var _0x3e2555={};_0x3e2555[_0x2afb81[_0x19ab('0x3c')]]={'$like':'%'+_0x232f1b[_0x19ab('0x49')][_0x19ab('0x53')]+'%'};return _0x3e2555;}})});}_0x14b7a1=_[_0x19ab('0x54')]({},_0x14b7a1,_0x232f1b[_0x19ab('0x56')]);var _0x1bce8b={'where':_0x14b7a1[_0x19ab('0x51')]};return db[_0x19ab('0x42')][_0x19ab('0x30')](_0x1bce8b)[_0x19ab('0x20')](function(_0x161072){_0x971115['count']=_0x161072;if(_0x232f1b['query']['includeAll']){_0x14b7a1[_0x19ab('0x57')]=[{'all':!![]}];}return db[_0x19ab('0x42')]['findAll'](_0x14b7a1);})[_0x19ab('0x20')](function(_0x57b307){_0x971115[_0x19ab('0x58')]=_0x57b307;return _0x971115;})[_0x19ab('0x20')](respondWithFilteredResult(_0x2a3e1d,_0x14b7a1))[_0x19ab('0x2a')](handleError(_0x2a3e1d,null));};exports['show']=function(_0x3f834f,_0x452279){var _0xe84181={'raw':![],'where':{'id':_0x3f834f[_0x19ab('0x59')]['id']},'include':[{'model':db[_0x19ab('0x3f')],'as':_0x19ab('0x40')}]},_0x482f4c={};_0x482f4c[_0x19ab('0x47')]=_[_0x19ab('0x48')](db[_0x19ab('0x42')][_0x19ab('0x43')]);_0x482f4c[_0x19ab('0x49')]=_[_0x19ab('0x48')](_0x3f834f['query']);_0x482f4c[_0x19ab('0x4a')]=_[_0x19ab('0x4c')](_0x482f4c[_0x19ab('0x47')],_0x482f4c[_0x19ab('0x49')]);_0xe84181[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x482f4c[_0x19ab('0x47')],qs['fields'](_0x3f834f[_0x19ab('0x49')][_0x19ab('0x4d')]));_0xe84181[_0x19ab('0x4b')]=_0xe84181[_0x19ab('0x4b')][_0x19ab('0x5a')]?_0xe84181['attributes']:_0x482f4c[_0x19ab('0x47')];if(_0x3f834f['query']['includeAll']){_0xe84181['include']=[{'all':!![]}];}_0xe84181=_[_0x19ab('0x54')]({},_0xe84181,_0x3f834f['options']);return db['OpenchannelAccount']['find'](_0xe84181)[_0x19ab('0x20')](handleEntityNotFound(_0x452279,null))[_0x19ab('0x20')](respondWithResult(_0x452279,null))[_0x19ab('0x2a')](handleError(_0x452279,null));};exports['create']=function(_0x316576,_0x82a8a0){return db[_0x19ab('0x42')]['create'](_0x316576[_0x19ab('0x5b')],{})[_0x19ab('0x20')](function(_0x22e9e9){var _0x5a10b1=_0x316576[_0x19ab('0x5c')]['get']({'plain':!![]});if(!_0x5a10b1)throw new Error(_0x19ab('0x5d'));if(_0x5a10b1[_0x19ab('0x5e')]==='user'){var _0x457570=_0x22e9e9[_0x19ab('0x38')]({'plain':!![]});var _0x494333=_0x19ab('0x39');return db[_0x19ab('0x5f')]['find']({'where':{'name':_0x494333,'userProfileId':_0x5a10b1['userProfileId']},'raw':!![]})[_0x19ab('0x20')](function(_0x3dc571){if(_0x3dc571&&_0x3dc571[_0x19ab('0x60')]===0x0){return db[_0x19ab('0x3a')]['create']({'name':_0x457570[_0x19ab('0x3c')],'resourceId':_0x457570['id'],'type':_0x3dc571[_0x19ab('0x3c')],'sectionId':_0x3dc571['id']},{})[_0x19ab('0x20')](function(){return _0x22e9e9;});}else{return _0x22e9e9;}})[_0x19ab('0x2a')](function(_0x5accc1){logger[_0x19ab('0x26')](_0x19ab('0x61'),_0x5accc1);throw _0x5accc1;});}return _0x22e9e9;})[_0x19ab('0x20')](respondWithResult(_0x82a8a0,0xc9))[_0x19ab('0x2a')](handleError(_0x82a8a0,null));};exports[_0x19ab('0x62')]=function(_0x2cbcd6,_0x2f0902){if(_0x2cbcd6[_0x19ab('0x5b')]['id']){delete _0x2cbcd6[_0x19ab('0x5b')]['id'];}return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x2cbcd6[_0x19ab('0x59')]['id']},'include':[{'model':db[_0x19ab('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x19ab('0x20')](handleEntityNotFound(_0x2f0902,null))[_0x19ab('0x20')](saveUpdates(_0x2cbcd6['body'],null))[_0x19ab('0x20')](respondWithResult(_0x2f0902,null))[_0x19ab('0x2a')](handleError(_0x2f0902,null));};exports[_0x19ab('0x37')]=function(_0x120834,_0xcad5cc){return db['OpenchannelAccount'][_0x19ab('0x63')]({'where':{'id':_0x120834[_0x19ab('0x59')]['id']}})['then'](handleEntityNotFound(_0xcad5cc,null))[_0x19ab('0x20')](removeEntity(_0xcad5cc,null))[_0x19ab('0x2a')](handleError(_0xcad5cc,null));};exports[_0x19ab('0x64')]=function(_0xa94e6e,_0x3b11d0){return db['OpenchannelAccount'][_0x19ab('0x64')]()[_0x19ab('0x20')](respondWithResult(_0x3b11d0,null))['catch'](handleError(_0x3b11d0,null));};exports['addDisposition']=function(_0x5c94ec,_0x586153,_0x24b11a){if(_0x5c94ec[_0x19ab('0x5b')]['id']){delete _0x5c94ec[_0x19ab('0x5b')]['id'];}return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x5c94ec[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x586153,null))['then'](function(_0xd5b4e9){if(_0xd5b4e9){_0x5c94ec[_0x19ab('0x5b')][_0x19ab('0x65')]=_0xd5b4e9['id'];return db['Disposition']['create'](_0x5c94ec[_0x19ab('0x5b')]);}})[_0x19ab('0x20')](respondWithResult(_0x586153,null))[_0x19ab('0x2a')](handleError(_0x586153,null));};exports[_0x19ab('0x66')]=function(_0x1ee432,_0x5b32d8,_0x5ecb19){var _0x58ba3a={'raw':![],'where':{}};var _0x3d6441={};var _0x346189={'count':0x0,'rows':[]};return db[_0x19ab('0x42')]['findOne']({'where':{'id':_0x1ee432[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x5b32d8,null))[_0x19ab('0x20')](function(_0x9e9f86){if(_0x9e9f86){_0x3d6441['model']=_[_0x19ab('0x48')](db[_0x19ab('0x67')]['rawAttributes']);_0x3d6441[_0x19ab('0x49')]=_[_0x19ab('0x48')](_0x1ee432[_0x19ab('0x49')]);_0x3d6441[_0x19ab('0x4a')]=_[_0x19ab('0x4c')](_0x3d6441[_0x19ab('0x47')],_0x3d6441[_0x19ab('0x49')]);_0x58ba3a[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x3d6441[_0x19ab('0x47')],qs[_0x19ab('0x4d')](_0x1ee432[_0x19ab('0x49')][_0x19ab('0x4d')]));_0x58ba3a['attributes']=_0x58ba3a[_0x19ab('0x4b')]['length']?_0x58ba3a[_0x19ab('0x4b')]:_0x3d6441[_0x19ab('0x47')];if(!_0x1ee432[_0x19ab('0x49')][_0x19ab('0x4e')](_0x19ab('0x68'))){_0x58ba3a['limit']=qs[_0x19ab('0x31')](_0x1ee432[_0x19ab('0x49')][_0x19ab('0x31')]);_0x58ba3a['offset']=qs['offset'](_0x1ee432[_0x19ab('0x49')]['offset']);}_0x58ba3a['order']=qs[_0x19ab('0x50')](_0x1ee432[_0x19ab('0x49')][_0x19ab('0x50')]);_0x58ba3a['where']=qs[_0x19ab('0x4a')](_[_0x19ab('0x52')](_0x1ee432[_0x19ab('0x49')],_0x3d6441[_0x19ab('0x4a')]));_0x58ba3a[_0x19ab('0x51')][_0x19ab('0x65')]=_0x9e9f86['id'];if(_0x1ee432[_0x19ab('0x49')][_0x19ab('0x53')]){_0x58ba3a['where']=_[_0x19ab('0x54')](_0x58ba3a[_0x19ab('0x51')],{'$or':_[_0x19ab('0x41')](_0x58ba3a['attributes'],function(_0x216371){var _0x1b8a32={};_0x1b8a32[_0x216371]={'$like':'%'+_0x1ee432['query'][_0x19ab('0x53')]+'%'};return _0x1b8a32;})});}_0x58ba3a=_[_0x19ab('0x54')]({},_0x58ba3a,_0x1ee432['options']);return db['Disposition']['count']({'where':_0x58ba3a[_0x19ab('0x51')]})[_0x19ab('0x20')](function(_0x36666e){_0x346189[_0x19ab('0x30')]=_0x36666e;if(_0x1ee432[_0x19ab('0x49')]['includeAll']){_0x58ba3a[_0x19ab('0x57')]=[{'all':!![]}];}return db[_0x19ab('0x67')]['findAll'](_0x58ba3a);})['then'](function(_0x35974b){_0x346189['rows']=_0x35974b;return _0x346189;});}})['then'](respondWithFilteredResult(_0x5b32d8,_0x58ba3a))[_0x19ab('0x2a')](handleError(_0x5b32d8,null));};exports[_0x19ab('0x69')]=function(_0x5a33a4,_0x38e3f7,_0x233ac2){return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x5a33a4[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x38e3f7,null))[_0x19ab('0x20')](function(_0x1bdfd5){if(_0x1bdfd5){return _0x1bdfd5[_0x19ab('0x69')](_0x5a33a4[_0x19ab('0x49')][_0x19ab('0x6a')]);}})[_0x19ab('0x20')](respondWithStatusCode(_0x38e3f7,null))[_0x19ab('0x2a')](handleError(_0x38e3f7,null));};exports[_0x19ab('0x6b')]=function(_0x1fc30d,_0x5c2cb2,_0xd77a56){if(_0x1fc30d['body']['id']){delete _0x1fc30d[_0x19ab('0x5b')]['id'];}return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x1fc30d[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x5c2cb2,null))[_0x19ab('0x20')](function(_0x10b5eb){if(_0x10b5eb){_0x1fc30d[_0x19ab('0x5b')]['OpenchannelAccountId']=_0x10b5eb['id'];return db['CannedAnswer'][_0x19ab('0x6c')](_0x1fc30d['body']);}})[_0x19ab('0x20')](respondWithResult(_0x5c2cb2,null))[_0x19ab('0x2a')](handleError(_0x5c2cb2,null));};exports[_0x19ab('0x6d')]=function(_0x4ac5e8,_0x55f002,_0x3f0d7e){var _0x537b76={'raw':![],'where':{}};var _0x20a6c8={};var _0xca748b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x19ab('0x6e')]({'where':{'id':_0x4ac5e8[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x55f002,null))[_0x19ab('0x20')](function(_0x42aaf4){if(_0x42aaf4){_0x20a6c8['model']=_[_0x19ab('0x48')](db[_0x19ab('0x6f')][_0x19ab('0x43')]);_0x20a6c8[_0x19ab('0x49')]=_[_0x19ab('0x48')](_0x4ac5e8[_0x19ab('0x49')]);_0x20a6c8[_0x19ab('0x4a')]=_[_0x19ab('0x4c')](_0x20a6c8['model'],_0x20a6c8[_0x19ab('0x49')]);_0x537b76[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x20a6c8[_0x19ab('0x47')],qs[_0x19ab('0x4d')](_0x4ac5e8['query']['fields']));_0x537b76[_0x19ab('0x4b')]=_0x537b76[_0x19ab('0x4b')][_0x19ab('0x5a')]?_0x537b76[_0x19ab('0x4b')]:_0x20a6c8[_0x19ab('0x47')];if(!_0x4ac5e8['query']['hasOwnProperty'](_0x19ab('0x68'))){_0x537b76['limit']=qs[_0x19ab('0x31')](_0x4ac5e8['query'][_0x19ab('0x31')]);_0x537b76[_0x19ab('0x2e')]=qs[_0x19ab('0x2e')](_0x4ac5e8[_0x19ab('0x49')][_0x19ab('0x2e')]);}_0x537b76['order']=qs[_0x19ab('0x50')](_0x4ac5e8['query'][_0x19ab('0x50')]);_0x537b76[_0x19ab('0x51')]=qs['filters'](_['pick'](_0x4ac5e8[_0x19ab('0x49')],_0x20a6c8[_0x19ab('0x4a')]));_0x537b76['where'][_0x19ab('0x65')]=_0x42aaf4['id'];if(_0x4ac5e8[_0x19ab('0x49')][_0x19ab('0x53')]){_0x537b76[_0x19ab('0x51')]=_[_0x19ab('0x54')](_0x537b76['where'],{'$or':_[_0x19ab('0x41')](_0x537b76[_0x19ab('0x4b')],function(_0xb54353){var _0x381a59={};_0x381a59[_0xb54353]={'$like':'%'+_0x4ac5e8['query'][_0x19ab('0x53')]+'%'};return _0x381a59;})});}_0x537b76=_[_0x19ab('0x54')]({},_0x537b76,_0x4ac5e8[_0x19ab('0x56')]);return db[_0x19ab('0x6f')]['count']({'where':_0x537b76[_0x19ab('0x51')]})[_0x19ab('0x20')](function(_0x1e4793){_0xca748b['count']=_0x1e4793;if(_0x4ac5e8[_0x19ab('0x49')][_0x19ab('0x70')]){_0x537b76['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x537b76);})['then'](function(_0x4fd351){_0xca748b['rows']=_0x4fd351;return _0xca748b;});}})['then'](respondWithFilteredResult(_0x55f002,_0x537b76))[_0x19ab('0x2a')](handleError(_0x55f002,null));};exports[_0x19ab('0x71')]=function(_0x5bbcc3,_0x3b7c0c,_0x5e2063){return db[_0x19ab('0x42')]['find']({'where':{'id':_0x5bbcc3['params']['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x3b7c0c,null))[_0x19ab('0x20')](function(_0x1217c3){if(_0x1217c3){return _0x1217c3['removeAnswers'](_0x5bbcc3['query'][_0x19ab('0x6a')]);}})[_0x19ab('0x20')](respondWithStatusCode(_0x3b7c0c,null))[_0x19ab('0x2a')](handleError(_0x3b7c0c,null));};exports[_0x19ab('0x72')]=function(_0x2870e8,_0x2c845b,_0x33043a){var _0x115e14={'body':_0x2870e8['body'],'channel':_0x19ab('0x73')};var _0xf4cd26=[];var _0x3b4a41=[];var _0x4a5d39={};var _0x19b8b4=![];return db['CmContact']['describe']()[_0x19ab('0x20')](function(_0x3c8831){if(!_0x3c8831){throw new db[(_0x19ab('0x74'))][(_0x19ab('0x75'))](_0x19ab('0x76'));}_0xf4cd26=_['difference'](_[_0x19ab('0x48')](_0x3c8831),[_0x19ab('0x77'),_0x19ab('0x78')]);_0x3b4a41=_[_0x19ab('0x79')](_['keys'](_0x3c8831),[_0x19ab('0x77'),_0x19ab('0x78'),_0x19ab('0x7a'),_0x19ab('0x7b')]);if(_0x2870e8[_0x19ab('0x5b')]['id']){delete _0x2870e8['body']['id'];}if(_[_0x19ab('0x7c')](_0x2870e8['body']['from'])){throw new db[(_0x19ab('0x74'))][(_0x19ab('0x75'))](_0x19ab('0x7d'));}if(_[_0x19ab('0x7c')](_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x5b')])||_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x5b')]===''){throw new db[(_0x19ab('0x74'))][(_0x19ab('0x75'))](_0x19ab('0x7e'));}if(_[_0x19ab('0x7c')](_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x7f')])){throw new db[(_0x19ab('0x74'))][(_0x19ab('0x75'))](_0x19ab('0x80')+_0x3b4a41);}if(!_[_0x19ab('0x81')](_0x3b4a41,_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x7f')])){throw new db[(_0x19ab('0x74'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b4a41);}_0x4a5d39[_0x2870e8[_0x19ab('0x5b')]['mapKey']]=_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x82')];})[_0x19ab('0x20')](function(){return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x2870e8[_0x19ab('0x59')]['id']},'include':[{'model':db[_0x19ab('0x83')],'as':_0x19ab('0x84'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4a5d39,'limit':0x1,'order':[[_0x19ab('0x78'),_0x19ab('0x85')]]}]},{'model':db[_0x19ab('0x86')],'as':_0x19ab('0x87')}]});})[_0x19ab('0x20')](handleEntityNotFound(_0x2c845b,null))[_0x19ab('0x20')](function(_0x3a62ba){if(_0x3a62ba&&_0x3a62ba[_0x19ab('0x84')]){_0x115e14['account']=_0x3a62ba;_0x115e14['applications']=_0x3a62ba[_0x19ab('0x87')];_0x115e14[_0x19ab('0x88')]=_0x3a62ba['List'];_0x115e14[_0x19ab('0x89')]=_[_0x19ab('0x8a')](_0x115e14[_0x19ab('0x89')],[_0x19ab('0x8b')],[_0x19ab('0x8c')]);if(_0x115e14['account'][_0x19ab('0x87')]){delete _0x115e14[_0x19ab('0x8d')][_0x19ab('0x87')];}if(_0x115e14[_0x19ab('0x8d')]['List']&&_0x115e14[_0x19ab('0x8d')]['List'][_0x19ab('0x8e')][_0x19ab('0x5a')]){return _0x115e14[_0x19ab('0x8d')]['List'][_0x19ab('0x8e')][0x0];}var _0x23829a=_[_0x19ab('0x1a')](_0x2870e8['body'],{'firstName':_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x82')],'ListId':_0x3a62ba[_0x19ab('0x7b')]});_0x23829a[_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x7f')]]=_0x2870e8[_0x19ab('0x5b')]['from'];return db[_0x19ab('0x8f')][_0x19ab('0x6c')](_0x23829a,{'fields':_0xf4cd26,'raw':!![]});}})[_0x19ab('0x20')](handleEntityNotFound(_0x2c845b,null))[_0x19ab('0x20')](function(_0x18db52){_0x115e14['contact']=_0x18db52;if(_0x18db52){var _0x3d5675={'ContactId':_0x18db52['id'],'OpenchannelAccountId':_0x2870e8[_0x19ab('0x59')]['id'],'from':(_0x18db52[_0x19ab('0x90')]||'')+'\x20'+(_0x18db52[_0x19ab('0x91')]||'')};var _0x525646={'OpenchannelAccountId':_0x2870e8[_0x19ab('0x59')]['id'],'closed':![]};if(_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x92')]){_0x525646['threadId']=_0x2870e8['body'][_0x19ab('0x92')];return db[_0x19ab('0x93')][_0x19ab('0x63')]({'where':_0x525646})[_0x19ab('0x20')](function(_0x2fc9f3){if(_0x2fc9f3){return[_0x2fc9f3,![]];}_0x3d5675['threadId']=_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x92')];_0x3d5675['externalUrl']=_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x94')];return db[_0x19ab('0x93')][_0x19ab('0x6c')](_0x3d5675)[_0x19ab('0x20')](function(_0x54bddc){return[_0x54bddc,!![]];});});}else{_0x525646['threadId']=null;}_0x525646['ContactId']=_0x18db52['id'];return db[_0x19ab('0x93')][_0x19ab('0x63')]({'where':_0x525646})[_0x19ab('0x20')](function(_0x27d53b){if(_0x27d53b){return[_0x27d53b,![]];}return db[_0x19ab('0x93')][_0x19ab('0x6c')](_0x3d5675)['then'](function(_0x48412e){return[_0x48412e,!![]];});});}})[_0x19ab('0x95')](function(_0x39221e,_0x34ed16){if(_0x39221e){_0x19b8b4=_0x34ed16;if(!_0x34ed16){var _0x41cc2f={'from':(_0x115e14['contact']['firstName']||'')+'\x20'+(_0x115e14['contact'][_0x19ab('0x91')]||'')};if(_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x92')]&&_0x2870e8[_0x19ab('0x5b')]['messageId']&&_0x2870e8['body']['threadId']!=_0x2870e8[_0x19ab('0x5b')]['messageId']){_0x41cc2f[_0x19ab('0x92')]=_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x96')];}return _0x39221e['update'](_0x41cc2f);}else{return _0x39221e;}}})[_0x19ab('0x20')](function(_0x4aa170){_0x115e14[_0x19ab('0x97')]=_0x4aa170[_0x19ab('0x38')]({'plain':!![]});_0x115e14[_0x19ab('0x97')][_0x19ab('0x98')]=_0x19b8b4;if(_0x115e14[_0x19ab('0x97')][_0x19ab('0x98')]){if(_0x115e14[_0x19ab('0x8d')][_0x19ab('0x99')]){_0x115e14[_0x19ab('0x89')][_0x19ab('0x9a')]({'id':0x0,'priority':_0x115e14[_0x19ab('0x89')]['length']+0x1,'app':_0x19ab('0x9b'),'appdata':_0x19ab('0x9c'),'interval':'*,*,*,*'});}}return db[_0x19ab('0x9d')][_0x19ab('0x6c')]({'body':_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x5b')],'OpenchannelAccountId':_0x2870e8[_0x19ab('0x59')]['id'],'OpenchannelInteractionId':_0x4aa170['id'],'direction':'in','ContactId':_0x115e14[_0x19ab('0x9e')]['id'],'AttachmentId':_0x2870e8[_0x19ab('0x5b')][_0x19ab('0x9f')]});})[_0x19ab('0x20')](function(_0x4f7263){_0x115e14[_0x19ab('0x28')]=_0x4f7263;if(_0x115e14[_0x19ab('0x97')][_0x19ab('0xa0')]){return db[_0x19ab('0xa1')][_0x19ab('0x63')]({'attributes':['id',_0x19ab('0x3c')],'where':{'id':_0x115e14['interaction']['UserId']}})['then'](function(_0x245cb5){if(_0x245cb5){_0x115e14[_0x19ab('0x89')][_0x19ab('0xa2')]({'id':0x0,'priority':0x0,'app':_0x19ab('0xa3'),'appdata':_0x245cb5[_0x19ab('0x3c')]+','+(_0x115e14[_0x19ab('0x8d')][_0x19ab('0xa4')]||0xa),'interval':'*,*,*,*'});_0x115e14[_0x19ab('0xa5')]=![];}return respondWithRpcPromise(_0x19ab('0xa6'),'startRouting',_0x115e14);});}return respondWithRpcPromise('Start',_0x19ab('0xa7'),_0x115e14);})[_0x19ab('0x20')](function(_0x2437e4){respondWithRpcPromise(_0x19ab('0xa8'),_0x19ab('0xa8'),{'event':'notify','message':_0x2437e4},client9002);return _0x2437e4;})[_0x19ab('0x20')](respondWithResult(_0x2c845b,null))[_0x19ab('0x2a')](handleError(_0x2c845b,null));};exports['addApplications']=function(_0xeba80e,_0x286d70,_0x142fe8){return db[_0x19ab('0x42')][_0x19ab('0x6e')]({'where':{'id':_0xeba80e['params']['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x286d70,null))[_0x19ab('0x20')](function(_0x26d867){if(_0x26d867){return db['sequelize'][_0x19ab('0xa9')](function(_0x58db27){return db[_0x19ab('0x86')][_0x19ab('0x37')]({'where':{'OpenchannelAccountId':_0xeba80e['params']['id']},'transaction':_0x58db27})['then'](function(_0x28d09c){var _0x4445f7=_['map'](_0xeba80e[_0x19ab('0x5b')],function(_0x3ac999){_0x3ac999[_0x19ab('0x65')]=_0xeba80e[_0x19ab('0x59')]['id'];return _0x3ac999;});return db[_0x19ab('0x86')][_0x19ab('0xaa')](_0x4445f7,{'transaction':_0x58db27});});})[_0x19ab('0x20')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0xeba80e['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x286d70,null))['catch'](handleError(_0x286d70,null));};exports['getApplications']=function(_0x1f38ca,_0x5cbda3,_0x3023b5){var _0x2a2ea7={};var _0x40d01f={};var _0x4cbfc6;var _0x161e56;return db[_0x19ab('0x42')][_0x19ab('0x6e')]({'where':{'id':_0x1f38ca[_0x19ab('0x59')]['id']}})['then'](handleEntityNotFound(_0x5cbda3,null))[_0x19ab('0x20')](function(_0x520e2d){if(_0x520e2d){_0x4cbfc6=_0x520e2d;_0x40d01f['model']=_['keys'](db[_0x19ab('0x86')][_0x19ab('0x43')]);_0x40d01f['query']=_[_0x19ab('0x48')](_0x1f38ca['query']);_0x40d01f[_0x19ab('0x4a')]=_['intersection'](_0x40d01f['model'],_0x40d01f[_0x19ab('0x49')]);_0x2a2ea7[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x40d01f['model'],qs[_0x19ab('0x4d')](_0x1f38ca[_0x19ab('0x49')]['fields']));_0x2a2ea7['attributes']=_0x2a2ea7[_0x19ab('0x4b')][_0x19ab('0x5a')]?_0x2a2ea7[_0x19ab('0x4b')]:_0x40d01f['model'];_0x2a2ea7[_0x19ab('0x4f')]=qs[_0x19ab('0x50')](_0x1f38ca[_0x19ab('0x49')]['sort']);_0x2a2ea7['where']=qs['filters'](_['pick'](_0x1f38ca['query'],_0x40d01f[_0x19ab('0x4a')]));if(_0x1f38ca[_0x19ab('0x49')][_0x19ab('0x53')]){_0x2a2ea7[_0x19ab('0x51')]=_[_0x19ab('0x54')](_0x2a2ea7['where'],{'$or':_[_0x19ab('0x41')](_0x2a2ea7[_0x19ab('0x4b')],function(_0x5de105){var _0x25f91c={};_0x25f91c[_0x5de105]={'$like':'%'+_0x1f38ca[_0x19ab('0x49')]['filter']+'%'};return _0x25f91c;})});}_0x2a2ea7=_[_0x19ab('0x54')]({},_0x2a2ea7,_0x1f38ca['options']);return _0x4cbfc6['getApplications'](_0x2a2ea7);}})['then'](function(_0x1254bd){if(_0x1254bd){_0x161e56=_0x1254bd['length'];if(!_0x1f38ca['query'][_0x19ab('0x4e')](_0x19ab('0x68'))){_0x2a2ea7['limit']=qs[_0x19ab('0x31')](_0x1f38ca[_0x19ab('0x49')][_0x19ab('0x31')]);_0x2a2ea7['offset']=qs[_0x19ab('0x2e')](_0x1f38ca[_0x19ab('0x49')][_0x19ab('0x2e')]);}return _0x4cbfc6['getApplications'](_0x2a2ea7);}})['then'](function(_0x300291){if(_0x300291){return _0x300291?{'count':_0x161e56,'rows':_0x300291}:null;}})[_0x19ab('0x20')](respondWithResult(_0x5cbda3,null))[_0x19ab('0x2a')](handleError(_0x5cbda3,null));};exports[_0x19ab('0xab')]=function(_0x3315fc,_0x2bb74b,_0x5a1a7a){var _0x397e2f={'raw':![],'where':{}};var _0x3a8828={};var _0x291501={'count':0x0,'rows':[]};return db[_0x19ab('0x42')][_0x19ab('0x6e')]({'where':{'id':_0x3315fc[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x2bb74b,null))['then'](function(_0x2247b8){if(_0x2247b8){_0x3a8828[_0x19ab('0x47')]=_[_0x19ab('0x48')](db[_0x19ab('0x93')]['rawAttributes']);_0x3a8828[_0x19ab('0x49')]=_[_0x19ab('0x48')](_0x3315fc[_0x19ab('0x49')]);_0x3a8828[_0x19ab('0x4a')]=_['intersection'](_0x3a8828[_0x19ab('0x47')],_0x3a8828[_0x19ab('0x49')]);_0x397e2f[_0x19ab('0x4b')]=_[_0x19ab('0x4c')](_0x3a8828[_0x19ab('0x47')],qs[_0x19ab('0x4d')](_0x3315fc[_0x19ab('0x49')]['fields']));_0x397e2f[_0x19ab('0x4b')]=_0x397e2f['attributes'][_0x19ab('0x5a')]?_0x397e2f[_0x19ab('0x4b')]:_0x3a8828[_0x19ab('0x47')];if(!_0x3315fc[_0x19ab('0x49')]['hasOwnProperty'](_0x19ab('0x68'))){_0x397e2f['limit']=qs[_0x19ab('0x31')](_0x3315fc[_0x19ab('0x49')]['limit']);_0x397e2f[_0x19ab('0x2e')]=qs[_0x19ab('0x2e')](_0x3315fc[_0x19ab('0x49')][_0x19ab('0x2e')]);}_0x397e2f[_0x19ab('0x4f')]=qs[_0x19ab('0x50')](_0x3315fc[_0x19ab('0x49')][_0x19ab('0x50')]);_0x397e2f[_0x19ab('0x51')]=qs[_0x19ab('0x4a')](_[_0x19ab('0x52')](_0x3315fc[_0x19ab('0x49')],_0x3a8828[_0x19ab('0x4a')]));_0x397e2f[_0x19ab('0x51')]['OpenchannelAccountId']=_0x2247b8['id'];if(_0x3315fc['query'][_0x19ab('0x53')]){_0x397e2f[_0x19ab('0x51')]=_[_0x19ab('0x54')](_0x397e2f[_0x19ab('0x51')],{'$or':_[_0x19ab('0x41')](_0x397e2f[_0x19ab('0x4b')],function(_0x441bbe){var _0x21cfe1={};_0x21cfe1[_0x441bbe]={'$like':'%'+_0x3315fc[_0x19ab('0x49')][_0x19ab('0x53')]+'%'};return _0x21cfe1;})});}_0x397e2f=_['merge']({},_0x397e2f,_0x3315fc[_0x19ab('0x56')]);return db[_0x19ab('0x93')]['count']({'where':_0x397e2f[_0x19ab('0x51')]})[_0x19ab('0x20')](function(_0x4ea753){_0x291501[_0x19ab('0x30')]=_0x4ea753;if(_0x3315fc[_0x19ab('0x49')][_0x19ab('0x70')]){_0x397e2f[_0x19ab('0x57')]=[{'model':db['CmContact'],'as':_0x19ab('0xac'),'required':![]},{'model':db[_0x19ab('0xa1')],'as':_0x19ab('0xad'),'attributes':['name',_0x19ab('0xae'),_0x19ab('0xaf')],'required':![]},{'model':db[_0x19ab('0xb0')],'as':_0x19ab('0xb1'),'attributes':['id',_0x19ab('0x3c'),_0x19ab('0xb2')],'where':_0x3315fc[_0x19ab('0x49')][_0x19ab('0xb3')]?{'id':_0x3315fc[_0x19ab('0x49')][_0x19ab('0xb3')]}:undefined,'required':_0x3315fc[_0x19ab('0x49')][_0x19ab('0xb3')]?!![]:![]}];}return db[_0x19ab('0x93')]['findAll'](_0x397e2f);})['then'](function(_0x505857){_0x291501[_0x19ab('0x58')]=_0x505857;return _0x291501;});}})[_0x19ab('0x20')](respondWithFilteredResult(_0x2bb74b,_0x397e2f))[_0x19ab('0x2a')](handleError(_0x2bb74b,null));};exports[_0x19ab('0xb4')]=function(_0x50e115,_0x236b0f,_0xbad25b){return db['OpenchannelAccount']['find']({'where':{'id':_0x50e115[_0x19ab('0x59')]['id']}})['then'](handleEntityNotFound(_0x236b0f,null))['then'](function(_0x5974e0){if(_0x5974e0){return _0x5974e0[_0x19ab('0xb4')](_0x50e115[_0x19ab('0x5b')][_0x19ab('0x6a')],_[_0x19ab('0xb5')](_0x50e115['body'],[_0x19ab('0x6a'),'id'])||{})[_0x19ab('0x95')](function(_0x316917){for(var _0x565153=0x0;_0x565153<_0x50e115[_0x19ab('0x5b')][_0x19ab('0x6a')][_0x19ab('0x5a')];_0x565153+=0x1){socket[_0x19ab('0xb6')]('userOpenchannelAccount:save',{'UserId':Number(_0x50e115[_0x19ab('0x5b')][_0x19ab('0x6a')][_0x565153]),'OpenchannelAccountId':Number(_0x50e115[_0x19ab('0x59')]['id'])});}return _0x316917;});}})[_0x19ab('0x20')](respondWithResult(_0x236b0f,null))['catch'](handleError(_0x236b0f,null));};exports[_0x19ab('0xb7')]=function(_0x540d46,_0x2dc90c,_0x210bc6){return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x540d46[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x2dc90c,null))[_0x19ab('0x20')](function(_0x1c40d2){if(_0x1c40d2){return _0x1c40d2[_0x19ab('0xb7')](_0x540d46[_0x19ab('0x49')]['ids'])[_0x19ab('0x20')](function(){if(_[_0x19ab('0xb8')](_0x540d46['query'][_0x19ab('0x6a')])){for(var _0xb8c322=0x0;_0xb8c322<_0x540d46['query']['ids'][_0x19ab('0x5a')];_0xb8c322+=0x1){socket[_0x19ab('0xb6')](_0x19ab('0xb9'),{'UserId':Number(_0x540d46[_0x19ab('0x49')][_0x19ab('0x6a')][_0xb8c322]),'OpenchannelAccountId':Number(_0x540d46[_0x19ab('0x59')]['id'])});}}else{socket[_0x19ab('0xb6')](_0x19ab('0xb9'),{'UserId':Number(_0x540d46[_0x19ab('0x49')]['ids']),'OpenchannelAccountId':Number(_0x540d46[_0x19ab('0x59')]['id'])});}});}})[_0x19ab('0x20')](respondWithStatusCode(_0x2dc90c,null))[_0x19ab('0x2a')](handleError(_0x2dc90c,null));};exports[_0x19ab('0xba')]=function(_0x356fe5,_0x2019a9,_0x2c5106){var _0x25fd59={};var _0x9af22c={};var _0x4b532c;var _0x4f2d6a;return db[_0x19ab('0x42')][_0x19ab('0x6e')]({'where':{'id':_0x356fe5['params']['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x2019a9,null))[_0x19ab('0x20')](function(_0x3094a0){if(_0x3094a0){_0x4b532c=_0x3094a0;_0x9af22c[_0x19ab('0x47')]=_[_0x19ab('0x48')](db[_0x19ab('0xa1')][_0x19ab('0x43')]);_0x9af22c[_0x19ab('0x49')]=_[_0x19ab('0x48')](_0x356fe5[_0x19ab('0x49')]);_0x9af22c['filters']=_[_0x19ab('0x4c')](_0x9af22c[_0x19ab('0x47')],_0x9af22c[_0x19ab('0x49')]);_0x25fd59['attributes']=_['intersection'](_0x9af22c[_0x19ab('0x47')],qs[_0x19ab('0x4d')](_0x356fe5['query'][_0x19ab('0x4d')]));_0x25fd59[_0x19ab('0x4b')]=_0x25fd59[_0x19ab('0x4b')][_0x19ab('0x5a')]?_0x25fd59[_0x19ab('0x4b')]:_0x9af22c['model'];_0x25fd59[_0x19ab('0x4f')]=qs[_0x19ab('0x50')](_0x356fe5[_0x19ab('0x49')][_0x19ab('0x50')]);_0x25fd59['where']=qs[_0x19ab('0x4a')](_['pick'](_0x356fe5[_0x19ab('0x49')],_0x9af22c[_0x19ab('0x4a')]));if(_0x356fe5['query'][_0x19ab('0x53')]){_0x25fd59[_0x19ab('0x51')]=_['merge'](_0x25fd59[_0x19ab('0x51')],{'$or':_[_0x19ab('0x41')](_0x25fd59[_0x19ab('0x4b')],function(_0xcaead5){var _0xb69208={};_0xb69208[_0xcaead5]={'$like':'%'+_0x356fe5['query'][_0x19ab('0x53')]+'%'};return _0xb69208;})});}_0x25fd59=_['merge']({},_0x25fd59,_0x356fe5[_0x19ab('0x56')]);return _0x4b532c[_0x19ab('0xba')](_0x25fd59);}})['then'](function(_0x629235){if(_0x629235){_0x4f2d6a=_0x629235[_0x19ab('0x5a')];if(!_0x356fe5[_0x19ab('0x49')][_0x19ab('0x4e')](_0x19ab('0x68'))){_0x25fd59[_0x19ab('0x31')]=qs['limit'](_0x356fe5[_0x19ab('0x49')][_0x19ab('0x31')]);_0x25fd59[_0x19ab('0x2e')]=qs['offset'](_0x356fe5[_0x19ab('0x49')][_0x19ab('0x2e')]);}return _0x4b532c[_0x19ab('0xba')](_0x25fd59);}})[_0x19ab('0x20')](function(_0xf65b56){if(_0xf65b56){return _0xf65b56?{'count':_0x4f2d6a,'rows':_0xf65b56}:null;}})[_0x19ab('0x20')](respondWithResult(_0x2019a9,null))[_0x19ab('0x2a')](handleError(_0x2019a9,null));};exports[_0x19ab('0x3d')]=function(_0x5d36ea,_0x59d7e9,_0x4543fb){var _0x2dec72,_0x2e952c,_0x35553d;if(_[_0x19ab('0x7c')](_0x5d36ea[_0x19ab('0x5b')]['body'])||_0x5d36ea['body'][_0x19ab('0x5b')]===''){throw new db[(_0x19ab('0x74'))][(_0x19ab('0x75'))](_0x19ab('0x7e'));}if(_[_0x19ab('0x7c')](_0x5d36ea['body']['to'])){}_0x2dec72=_0x5d36ea[_0x19ab('0x5b')]['to'];return db[_0x19ab('0x42')][_0x19ab('0x6e')]({'where':{'id':_0x5d36ea[_0x19ab('0x59')]['id']}})[_0x19ab('0x20')](handleEntityNotFound(_0x59d7e9,null))[_0x19ab('0x20')](function(_0x5543d2){if(_0x5543d2){return db[_0x19ab('0x42')][_0x19ab('0x63')]({'where':{'id':_0x5543d2['id']},'include':[{'model':db[_0x19ab('0x83')],'as':_0x19ab('0x84'),'include':[{'model':db['CmContact'],'as':_0x19ab('0x8e'),'where':{[_0x5543d2['mapKey']]:_0x2dec72},'limit':0x1,'order':[['updatedAt',_0x19ab('0x85')]]}]}]})['then'](handleEntityNotFound(_0x59d7e9,null))[_0x19ab('0x20')](function(_0x38ebf4){if(_0x38ebf4&&_0x38ebf4['List']){_0x2e952c=_0x38ebf4[_0x19ab('0x38')]({'plain':!![]});if(_0x2e952c[_0x19ab('0x84')]&&_0x2e952c[_0x19ab('0x84')][_0x19ab('0x8e')][_0x19ab('0x5a')]){return _0x2e952c[_0x19ab('0x84')]['Contacts'][0x0];}return db[_0x19ab('0x8f')][_0x19ab('0x6c')](_[_0x19ab('0x1a')](_0x5d36ea['body'],{'firstName':_0x2dec72,[_0x38ebf4[_0x19ab('0x7f')]]:_0x2dec72,'phone':_0x2dec72,'ListId':_0x2e952c[_0x19ab('0x7b')]}));}})[_0x19ab('0x20')](handleEntityNotFound(_0x59d7e9,null))['then'](function(_0x47a037){if(_0x47a037){_0x35553d=_0x47a037;return db[_0x19ab('0x93')][_0x19ab('0x63')]({'where':{'ContactId':_0x35553d['id'],'closed':![],'OpenchannelAccountId':_0x2e952c['id']}})[_0x19ab('0x20')](function(_0xb71a2f){if(_0xb71a2f){return[_0xb71a2f,![]];}return db[_0x19ab('0x93')]['create']({'UserId':_0x5d36ea[_0x19ab('0x5c')]['id'],'ContactId':_0x35553d['id'],'OpenchannelAccountId':_0x2e952c['id'],'lastMsgDirection':_0x19ab('0xbb'),'Messages':[_[_0x19ab('0x54')](_0x5d36ea[_0x19ab('0x5b')],{'read':![],'body':_0x5d36ea[_0x19ab('0x5b')][_0x19ab('0x5b')],'OpenchannelAccountId':_0x2e952c['id'],'UserId':_0x5d36ea[_0x19ab('0x5c')]['id'],'ContactId':_0x35553d['id']})]},{'include':[{'model':db[_0x19ab('0x9d')],'as':_0x19ab('0xbc')}]})[_0x19ab('0x20')](function(_0x233f6e){return[_0x233f6e,!![]];});});}})[_0x19ab('0x95')](function(_0x2305d5,_0x326818){if(_0x326818){return _0x2305d5;}return db[_0x19ab('0x9d')][_0x19ab('0x6c')](_[_0x19ab('0x54')](_0x5d36ea[_0x19ab('0x5b')],{'read':![],'body':_0x5d36ea['body'][_0x19ab('0x5b')],'OpenchannelAccountId':_0x2e952c['id'],'OpenchannelInteractionId':_0x2305d5['id'],'UserId':_0x5d36ea[_0x19ab('0x5c')]['id'],'ContactId':_0x35553d['id']}))[_0x19ab('0x20')](function(_0x4b6e81){_0x2305d5[_0x19ab('0xbd')][_0x19ab('0xbc')]=[];_0x2305d5[_0x19ab('0xbd')]['Messages'][_0x19ab('0x9a')](_0x4b6e81[_0x19ab('0xbd')]);return _0x2305d5;});});}})['then'](respondWithResult(_0x59d7e9,null))[_0x19ab('0x2a')](handleError(_0x59d7e9,null));};
\ No newline at end of file
+var _0x2c7f=['UserProfileResource','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','OpenchannelAccount','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','sort','options','removeDispositions','ids','CannedAnswer','order','removeAnswers','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','OpenchannelApplication','Applications','List','account','list','applications','orderBy','priority','asc','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag','Tags','color','tag','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','save','destroy','get','OpenchannelAccounts'];(function(_0x497136,_0x507d89){var _0x5ebf49=function(_0x40343b){while(--_0x40343b){_0x497136['push'](_0x497136['shift']());}};_0x5ebf49(++_0x507d89);}(_0x2c7f,0x84));var _0xf2c7=function(_0x2d3135,_0xa838c4){_0x2d3135=_0x2d3135-0x0;var _0x3ca180=_0x2c7f[_0x2d3135];return _0x3ca180;};'use strict';var emlformat=require(_0xf2c7('0x0'));var rimraf=require(_0xf2c7('0x1'));var zipdir=require(_0xf2c7('0x2'));var jsonpatch=require(_0xf2c7('0x3'));var rp=require(_0xf2c7('0x4'));var moment=require('moment');var BPromise=require(_0xf2c7('0x5'));var Mustache=require(_0xf2c7('0x6'));var util=require(_0xf2c7('0x7'));var path=require(_0xf2c7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2c7('0x9'));var _=require(_0xf2c7('0xa'));var squel=require(_0xf2c7('0xb'));var crypto=require(_0xf2c7('0xc'));var jsforce=require(_0xf2c7('0xd'));var deskjs=require(_0xf2c7('0xe'));var toCsv=require(_0xf2c7('0xf'));var querystring=require(_0xf2c7('0x10'));var Papa=require(_0xf2c7('0x11'));var Redis=require('ioredis');var authService=require(_0xf2c7('0x12'));var qs=require(_0xf2c7('0x13'));var as=require(_0xf2c7('0x14'));var hardwareService=require(_0xf2c7('0x15'));var logger=require(_0xf2c7('0x16'))(_0xf2c7('0x17'));var utils=require(_0xf2c7('0x18'));var config=require(_0xf2c7('0x19'));var licenseUtil=require(_0xf2c7('0x1a'));var db=require(_0xf2c7('0x1b'))['db'];config[_0xf2c7('0x1c')]=_['defaults'](config[_0xf2c7('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2c7('0x1d'))(new Redis(config[_0xf2c7('0x1c')]));require(_0xf2c7('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf2c7('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x208c9b,_0x3a6069,_0x18b2a7,_0x5548f2){return new BPromise(function(_0x2aed4b,_0x41bb0e){var _0x4ac2d3=_0x5548f2||client;return _0x4ac2d3['request'](_0x208c9b,_0x18b2a7)[_0xf2c7('0x20')](function(_0x23435e){logger['info'](_0xf2c7('0x21'),_0x3a6069,_0xf2c7('0x22'));logger[_0xf2c7('0x23')](_0xf2c7('0x24'),_0x3a6069,_0xf2c7('0x22'),JSON[_0xf2c7('0x25')](_0x23435e));if(_0x23435e[_0xf2c7('0x26')]){if(_0x23435e[_0xf2c7('0x26')][_0xf2c7('0x27')]===0x1f4){logger[_0xf2c7('0x26')](_0xf2c7('0x21'),_0x3a6069,_0x23435e[_0xf2c7('0x26')][_0xf2c7('0x28')]);return _0x41bb0e(_0x23435e[_0xf2c7('0x26')][_0xf2c7('0x28')]);}logger[_0xf2c7('0x26')](_0xf2c7('0x21'),_0x3a6069,_0x23435e[_0xf2c7('0x26')][_0xf2c7('0x28')]);return _0x2aed4b(_0x23435e[_0xf2c7('0x26')][_0xf2c7('0x28')]);}else{logger[_0xf2c7('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x3a6069,_0xf2c7('0x22'));_0x2aed4b(_0x23435e[_0xf2c7('0x2a')][_0xf2c7('0x28')]);}})['catch'](function(_0x203f5e){logger[_0xf2c7('0x26')](_0xf2c7('0x21'),_0x3a6069,_0x203f5e);_0x41bb0e(_0x203f5e);});});}function respondWithStatusCode(_0x3dce84,_0x69ea3){_0x69ea3=_0x69ea3||0xcc;return function(_0x41c641){if(_0x41c641){return _0x3dce84[_0xf2c7('0x2b')](_0x69ea3);}return _0x3dce84[_0xf2c7('0x2c')](_0x69ea3)['end']();};}function respondWithResult(_0x57f54d,_0x1c216b){_0x1c216b=_0x1c216b||0xc8;return function(_0x4b1044){if(_0x4b1044){return _0x57f54d[_0xf2c7('0x2c')](_0x1c216b)['json'](_0x4b1044);}};}function respondWithFilteredResult(_0x5b554e,_0x26f61f){return function(_0x3e3300){if(_0x3e3300){var _0x1beef2=typeof _0x26f61f['offset']===_0xf2c7('0x2d')&&typeof _0x26f61f[_0xf2c7('0x2e')]==='undefined';var _0x52d118=_0x3e3300[_0xf2c7('0x2f')];var _0x3e830b=_0x1beef2?0x0:_0x26f61f[_0xf2c7('0x30')];var _0x1bb36e=_0x1beef2?_0x3e3300[_0xf2c7('0x2f')]:_0x26f61f[_0xf2c7('0x30')]+_0x26f61f[_0xf2c7('0x2e')];var _0x31b289;if(_0x1bb36e>=_0x52d118){_0x1bb36e=_0x52d118;_0x31b289=0xc8;}else{_0x31b289=0xce;}_0x5b554e['status'](_0x31b289);return _0x5b554e['set'](_0xf2c7('0x31'),_0x3e830b+'-'+_0x1bb36e+'/'+_0x52d118)[_0xf2c7('0x32')](_0x3e3300);}return null;};}function patchUpdates(_0x47b549){return function(_0x2d7c81){try{jsonpatch[_0xf2c7('0x33')](_0x2d7c81,_0x47b549,!![]);}catch(_0x18fde7){return BPromise['reject'](_0x18fde7);}return _0x2d7c81[_0xf2c7('0x34')]();};}function saveUpdates(_0x3468ee,_0x371ff5){return function(_0x3d33af){if(_0x3d33af){return _0x3d33af['update'](_0x3468ee)[_0xf2c7('0x20')](function(_0x3d6812){return _0x3d6812;});}return null;};}function removeEntity(_0x29ebfb,_0x19cbd1){return function(_0x4cb7b1){if(_0x4cb7b1){return _0x4cb7b1[_0xf2c7('0x35')]()['then'](function(){var _0x31fade=_0x4cb7b1[_0xf2c7('0x36')]({'plain':!![]});var _0x90d82b=_0xf2c7('0x37');return db[_0xf2c7('0x38')][_0xf2c7('0x35')]({'where':{'type':_0x90d82b,'resourceId':_0x31fade['id']}})[_0xf2c7('0x20')](function(){return _0x4cb7b1;});})['then'](function(){_0x29ebfb[_0xf2c7('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fdd84,_0x2d6bb7){return function(_0x5dce4f){if(!_0x5dce4f){_0x2fdd84[_0xf2c7('0x2b')](0x194);}return _0x5dce4f;};}function handleError(_0x22361a,_0x1290ff){_0x1290ff=_0x1290ff||0x1f4;return function(_0x238097){logger[_0xf2c7('0x26')](_0x238097['stack']);if(_0x238097['name']){delete _0x238097['name'];}_0x22361a[_0xf2c7('0x2c')](_0x1290ff)[_0xf2c7('0x39')](_0x238097);};}exports[_0xf2c7('0x3a')]=function(_0x2b80f5,_0x508c96){var _0x392177={'include':[{'model':db[_0xf2c7('0x3b')],'as':_0xf2c7('0x3c')}]},_0x3aa656={},_0xf5e1f3={'count':0x0,'rows':[]};var _0x28da0c=_[_0xf2c7('0x3d')](db['OpenchannelAccount'][_0xf2c7('0x3e')],function(_0x31fdb5){return{'name':_0x31fdb5[_0xf2c7('0x3f')],'type':_0x31fdb5[_0xf2c7('0x40')]['key']};});_0x3aa656[_0xf2c7('0x41')]=_[_0xf2c7('0x3d')](_0x28da0c,_0xf2c7('0x42'));_0x3aa656[_0xf2c7('0x43')]=_['keys'](_0x2b80f5['query']);_0x3aa656[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x3aa656[_0xf2c7('0x41')],_0x3aa656[_0xf2c7('0x43')]);_0x392177['attributes']=_['intersection'](_0x3aa656[_0xf2c7('0x41')],qs[_0xf2c7('0x46')](_0x2b80f5['query'][_0xf2c7('0x46')]));_0x392177[_0xf2c7('0x47')]=_0x392177['attributes'][_0xf2c7('0x48')]?_0x392177['attributes']:_0x3aa656[_0xf2c7('0x41')];if(!_0x2b80f5[_0xf2c7('0x43')][_0xf2c7('0x49')](_0xf2c7('0x4a'))){_0x392177['limit']=qs['limit'](_0x2b80f5[_0xf2c7('0x43')][_0xf2c7('0x2e')]);_0x392177['offset']=qs[_0xf2c7('0x30')](_0x2b80f5['query'][_0xf2c7('0x30')]);}_0x392177['order']=qs['sort'](_0x2b80f5[_0xf2c7('0x43')]['sort']);_0x392177[_0xf2c7('0x4b')]=qs[_0xf2c7('0x44')](_[_0xf2c7('0x4c')](_0x2b80f5[_0xf2c7('0x43')],_0x3aa656[_0xf2c7('0x44')]),_0x28da0c);if(_0x2b80f5['query'][_0xf2c7('0x4d')]){_0x392177['where']=_[_0xf2c7('0x4e')](_0x392177[_0xf2c7('0x4b')],{'$or':_['map'](_0x28da0c,function(_0x46b23f){if(_0x46b23f[_0xf2c7('0x40')]!==_0xf2c7('0x4f')){var _0x45babd={};_0x45babd[_0x46b23f['name']]={'$like':'%'+_0x2b80f5['query'][_0xf2c7('0x4d')]+'%'};return _0x45babd;}})});}_0x392177=_['merge']({},_0x392177,_0x2b80f5['options']);var _0x4860ae={'where':_0x392177['where']};return db[_0xf2c7('0x50')][_0xf2c7('0x2f')](_0x4860ae)[_0xf2c7('0x20')](function(_0x45c57e){_0xf5e1f3[_0xf2c7('0x2f')]=_0x45c57e;if(_0x2b80f5[_0xf2c7('0x43')][_0xf2c7('0x51')]){_0x392177[_0xf2c7('0x52')]=[{'all':!![]}];}return db[_0xf2c7('0x50')][_0xf2c7('0x53')](_0x392177);})['then'](function(_0x530d0c){_0xf5e1f3[_0xf2c7('0x54')]=_0x530d0c;return _0xf5e1f3;})[_0xf2c7('0x20')](respondWithFilteredResult(_0x508c96,_0x392177))[_0xf2c7('0x55')](handleError(_0x508c96,null));};exports[_0xf2c7('0x56')]=function(_0x256e5e,_0x1830c4){var _0x49f70a={'raw':![],'where':{'id':_0x256e5e[_0xf2c7('0x57')]['id']},'include':[{'model':db[_0xf2c7('0x3b')],'as':_0xf2c7('0x3c')}]},_0x1abaa1={};_0x1abaa1[_0xf2c7('0x41')]=_[_0xf2c7('0x58')](db[_0xf2c7('0x50')]['rawAttributes']);_0x1abaa1[_0xf2c7('0x43')]=_['keys'](_0x256e5e[_0xf2c7('0x43')]);_0x1abaa1['filters']=_[_0xf2c7('0x45')](_0x1abaa1[_0xf2c7('0x41')],_0x1abaa1['query']);_0x49f70a[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x1abaa1[_0xf2c7('0x41')],qs[_0xf2c7('0x46')](_0x256e5e[_0xf2c7('0x43')][_0xf2c7('0x46')]));_0x49f70a['attributes']=_0x49f70a[_0xf2c7('0x47')][_0xf2c7('0x48')]?_0x49f70a[_0xf2c7('0x47')]:_0x1abaa1[_0xf2c7('0x41')];if(_0x256e5e[_0xf2c7('0x43')][_0xf2c7('0x51')]){_0x49f70a['include']=[{'all':!![]}];}_0x49f70a=_[_0xf2c7('0x4e')]({},_0x49f70a,_0x256e5e['options']);return db['OpenchannelAccount']['find'](_0x49f70a)[_0xf2c7('0x20')](handleEntityNotFound(_0x1830c4,null))[_0xf2c7('0x20')](respondWithResult(_0x1830c4,null))['catch'](handleError(_0x1830c4,null));};exports[_0xf2c7('0x59')]=function(_0x42d85a,_0x45e338){return db[_0xf2c7('0x50')][_0xf2c7('0x59')](_0x42d85a[_0xf2c7('0x5a')],{})[_0xf2c7('0x20')](function(_0x51ab49){var _0x3dfecf=_0x42d85a[_0xf2c7('0x5b')][_0xf2c7('0x36')]({'plain':!![]});if(!_0x3dfecf)throw new Error(_0xf2c7('0x5c'));if(_0x3dfecf[_0xf2c7('0x5d')]===_0xf2c7('0x5b')){var _0x28dca2=_0x51ab49[_0xf2c7('0x36')]({'plain':!![]});var _0x21d43b=_0xf2c7('0x37');return db[_0xf2c7('0x5e')]['find']({'where':{'name':_0x21d43b,'userProfileId':_0x3dfecf['userProfileId']},'raw':!![]})[_0xf2c7('0x20')](function(_0x1cdc7f){if(_0x1cdc7f&&_0x1cdc7f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x28dca2[_0xf2c7('0x42')],'resourceId':_0x28dca2['id'],'type':_0x1cdc7f['name'],'sectionId':_0x1cdc7f['id']},{})[_0xf2c7('0x20')](function(){return _0x51ab49;});}else{return _0x51ab49;}})[_0xf2c7('0x55')](function(_0x4fd3c6){logger[_0xf2c7('0x26')](_0xf2c7('0x5f'),_0x4fd3c6);throw _0x4fd3c6;});}return _0x51ab49;})[_0xf2c7('0x20')](respondWithResult(_0x45e338,0xc9))[_0xf2c7('0x55')](handleError(_0x45e338,null));};exports[_0xf2c7('0x60')]=function(_0x21acff,_0x7ca501){if(_0x21acff[_0xf2c7('0x5a')]['id']){delete _0x21acff[_0xf2c7('0x5a')]['id'];}return db[_0xf2c7('0x50')][_0xf2c7('0x61')]({'where':{'id':_0x21acff[_0xf2c7('0x57')]['id']},'include':[{'model':db[_0xf2c7('0x3b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x7ca501,null))['then'](saveUpdates(_0x21acff['body'],null))[_0xf2c7('0x20')](respondWithResult(_0x7ca501,null))['catch'](handleError(_0x7ca501,null));};exports[_0xf2c7('0x35')]=function(_0x5064bf,_0x3740d6){return db['OpenchannelAccount'][_0xf2c7('0x61')]({'where':{'id':_0x5064bf[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x3740d6,null))[_0xf2c7('0x20')](removeEntity(_0x3740d6,null))[_0xf2c7('0x55')](handleError(_0x3740d6,null));};exports[_0xf2c7('0x62')]=function(_0x20dd14,_0x332a31){return db[_0xf2c7('0x50')][_0xf2c7('0x62')]()['then'](respondWithResult(_0x332a31,null))[_0xf2c7('0x55')](handleError(_0x332a31,null));};exports[_0xf2c7('0x63')]=function(_0x2df3ed,_0x4a420d,_0x16d5be){if(_0x2df3ed['body']['id']){delete _0x2df3ed[_0xf2c7('0x5a')]['id'];}return db['OpenchannelAccount'][_0xf2c7('0x61')]({'where':{'id':_0x2df3ed[_0xf2c7('0x57')]['id']}})['then'](handleEntityNotFound(_0x4a420d,null))[_0xf2c7('0x20')](function(_0x1643b0){if(_0x1643b0){_0x2df3ed[_0xf2c7('0x5a')][_0xf2c7('0x64')]=_0x1643b0['id'];return db[_0xf2c7('0x65')][_0xf2c7('0x59')](_0x2df3ed[_0xf2c7('0x5a')]);}})[_0xf2c7('0x20')](respondWithResult(_0x4a420d,null))[_0xf2c7('0x55')](handleError(_0x4a420d,null));};exports[_0xf2c7('0x66')]=function(_0x21baac,_0x224dd7,_0x4163e3){var _0x1d0fb6={'raw':![],'where':{}};var _0x5b3ba4={};var _0x19ac39={'count':0x0,'rows':[]};return db[_0xf2c7('0x50')][_0xf2c7('0x67')]({'where':{'id':_0x21baac[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x224dd7,null))[_0xf2c7('0x20')](function(_0x1e7f8f){if(_0x1e7f8f){_0x5b3ba4[_0xf2c7('0x41')]=_[_0xf2c7('0x58')](db['Disposition'][_0xf2c7('0x3e')]);_0x5b3ba4[_0xf2c7('0x43')]=_[_0xf2c7('0x58')](_0x21baac[_0xf2c7('0x43')]);_0x5b3ba4[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x5b3ba4[_0xf2c7('0x41')],_0x5b3ba4['query']);_0x1d0fb6[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x5b3ba4[_0xf2c7('0x41')],qs[_0xf2c7('0x46')](_0x21baac['query'][_0xf2c7('0x46')]));_0x1d0fb6[_0xf2c7('0x47')]=_0x1d0fb6[_0xf2c7('0x47')]['length']?_0x1d0fb6['attributes']:_0x5b3ba4[_0xf2c7('0x41')];if(!_0x21baac[_0xf2c7('0x43')][_0xf2c7('0x49')]('nolimit')){_0x1d0fb6[_0xf2c7('0x2e')]=qs[_0xf2c7('0x2e')](_0x21baac[_0xf2c7('0x43')][_0xf2c7('0x2e')]);_0x1d0fb6[_0xf2c7('0x30')]=qs[_0xf2c7('0x30')](_0x21baac[_0xf2c7('0x43')]['offset']);}_0x1d0fb6['order']=qs[_0xf2c7('0x68')](_0x21baac[_0xf2c7('0x43')][_0xf2c7('0x68')]);_0x1d0fb6[_0xf2c7('0x4b')]=qs['filters'](_['pick'](_0x21baac[_0xf2c7('0x43')],_0x5b3ba4[_0xf2c7('0x44')]));_0x1d0fb6[_0xf2c7('0x4b')]['OpenchannelAccountId']=_0x1e7f8f['id'];if(_0x21baac['query'][_0xf2c7('0x4d')]){_0x1d0fb6[_0xf2c7('0x4b')]=_[_0xf2c7('0x4e')](_0x1d0fb6[_0xf2c7('0x4b')],{'$or':_[_0xf2c7('0x3d')](_0x1d0fb6[_0xf2c7('0x47')],function(_0x3a26c0){var _0x37bf63={};_0x37bf63[_0x3a26c0]={'$like':'%'+_0x21baac[_0xf2c7('0x43')][_0xf2c7('0x4d')]+'%'};return _0x37bf63;})});}_0x1d0fb6=_['merge']({},_0x1d0fb6,_0x21baac[_0xf2c7('0x69')]);return db[_0xf2c7('0x65')][_0xf2c7('0x2f')]({'where':_0x1d0fb6['where']})[_0xf2c7('0x20')](function(_0x5f4e5c){_0x19ac39[_0xf2c7('0x2f')]=_0x5f4e5c;if(_0x21baac[_0xf2c7('0x43')][_0xf2c7('0x51')]){_0x1d0fb6[_0xf2c7('0x52')]=[{'all':!![]}];}return db[_0xf2c7('0x65')]['findAll'](_0x1d0fb6);})[_0xf2c7('0x20')](function(_0x4b7126){_0x19ac39[_0xf2c7('0x54')]=_0x4b7126;return _0x19ac39;});}})[_0xf2c7('0x20')](respondWithFilteredResult(_0x224dd7,_0x1d0fb6))['catch'](handleError(_0x224dd7,null));};exports[_0xf2c7('0x6a')]=function(_0x17b2a8,_0x1b3e42,_0x3bd8ae){return db[_0xf2c7('0x50')]['find']({'where':{'id':_0x17b2a8['params']['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x1b3e42,null))[_0xf2c7('0x20')](function(_0x265cb0){if(_0x265cb0){return _0x265cb0[_0xf2c7('0x6a')](_0x17b2a8['query'][_0xf2c7('0x6b')]);}})['then'](respondWithStatusCode(_0x1b3e42,null))[_0xf2c7('0x55')](handleError(_0x1b3e42,null));};exports['addAnswer']=function(_0x9de9af,_0x51c31f,_0x2a565a){if(_0x9de9af[_0xf2c7('0x5a')]['id']){delete _0x9de9af[_0xf2c7('0x5a')]['id'];}return db[_0xf2c7('0x50')][_0xf2c7('0x61')]({'where':{'id':_0x9de9af['params']['id']}})['then'](handleEntityNotFound(_0x51c31f,null))['then'](function(_0x3a0517){if(_0x3a0517){_0x9de9af[_0xf2c7('0x5a')][_0xf2c7('0x64')]=_0x3a0517['id'];return db[_0xf2c7('0x6c')][_0xf2c7('0x59')](_0x9de9af['body']);}})[_0xf2c7('0x20')](respondWithResult(_0x51c31f,null))[_0xf2c7('0x55')](handleError(_0x51c31f,null));};exports['getAnswers']=function(_0xb5cfd7,_0x2679c6,_0x3ddcd6){var _0x3c0966={'raw':![],'where':{}};var _0x566b0c={};var _0x9c8bc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf2c7('0x67')]({'where':{'id':_0xb5cfd7[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x2679c6,null))['then'](function(_0x39d8ef){if(_0x39d8ef){_0x566b0c['model']=_[_0xf2c7('0x58')](db[_0xf2c7('0x6c')]['rawAttributes']);_0x566b0c[_0xf2c7('0x43')]=_['keys'](_0xb5cfd7[_0xf2c7('0x43')]);_0x566b0c[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x566b0c['model'],_0x566b0c[_0xf2c7('0x43')]);_0x3c0966[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x566b0c[_0xf2c7('0x41')],qs['fields'](_0xb5cfd7[_0xf2c7('0x43')][_0xf2c7('0x46')]));_0x3c0966[_0xf2c7('0x47')]=_0x3c0966[_0xf2c7('0x47')][_0xf2c7('0x48')]?_0x3c0966[_0xf2c7('0x47')]:_0x566b0c[_0xf2c7('0x41')];if(!_0xb5cfd7[_0xf2c7('0x43')][_0xf2c7('0x49')](_0xf2c7('0x4a'))){_0x3c0966[_0xf2c7('0x2e')]=qs[_0xf2c7('0x2e')](_0xb5cfd7[_0xf2c7('0x43')][_0xf2c7('0x2e')]);_0x3c0966[_0xf2c7('0x30')]=qs[_0xf2c7('0x30')](_0xb5cfd7[_0xf2c7('0x43')][_0xf2c7('0x30')]);}_0x3c0966[_0xf2c7('0x6d')]=qs[_0xf2c7('0x68')](_0xb5cfd7[_0xf2c7('0x43')][_0xf2c7('0x68')]);_0x3c0966[_0xf2c7('0x4b')]=qs[_0xf2c7('0x44')](_[_0xf2c7('0x4c')](_0xb5cfd7[_0xf2c7('0x43')],_0x566b0c[_0xf2c7('0x44')]));_0x3c0966[_0xf2c7('0x4b')][_0xf2c7('0x64')]=_0x39d8ef['id'];if(_0xb5cfd7[_0xf2c7('0x43')]['filter']){_0x3c0966['where']=_['merge'](_0x3c0966[_0xf2c7('0x4b')],{'$or':_['map'](_0x3c0966[_0xf2c7('0x47')],function(_0x2204c8){var _0x3ea175={};_0x3ea175[_0x2204c8]={'$like':'%'+_0xb5cfd7['query'][_0xf2c7('0x4d')]+'%'};return _0x3ea175;})});}_0x3c0966=_[_0xf2c7('0x4e')]({},_0x3c0966,_0xb5cfd7['options']);return db[_0xf2c7('0x6c')][_0xf2c7('0x2f')]({'where':_0x3c0966[_0xf2c7('0x4b')]})['then'](function(_0x266a91){_0x9c8bc[_0xf2c7('0x2f')]=_0x266a91;if(_0xb5cfd7['query'][_0xf2c7('0x51')]){_0x3c0966[_0xf2c7('0x52')]=[{'all':!![]}];}return db[_0xf2c7('0x6c')][_0xf2c7('0x53')](_0x3c0966);})[_0xf2c7('0x20')](function(_0x2c7258){_0x9c8bc[_0xf2c7('0x54')]=_0x2c7258;return _0x9c8bc;});}})['then'](respondWithFilteredResult(_0x2679c6,_0x3c0966))['catch'](handleError(_0x2679c6,null));};exports[_0xf2c7('0x6e')]=function(_0x101c92,_0x2b104c,_0xb12dc8){return db['OpenchannelAccount'][_0xf2c7('0x61')]({'where':{'id':_0x101c92[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x2b104c,null))[_0xf2c7('0x20')](function(_0x3edfa2){if(_0x3edfa2){return _0x3edfa2[_0xf2c7('0x6e')](_0x101c92['query'][_0xf2c7('0x6b')]);}})[_0xf2c7('0x20')](respondWithStatusCode(_0x2b104c,null))[_0xf2c7('0x55')](handleError(_0x2b104c,null));};exports['notify']=function(_0x4abeca,_0x5bafd6,_0x18ca87){var _0x10c764={'body':_0x4abeca[_0xf2c7('0x5a')],'channel':'openchannel'};var _0x5184e9=[];var _0x2b66e9=[];var _0x320831={};var _0x529c46=![];return db[_0xf2c7('0x6f')][_0xf2c7('0x62')]()[_0xf2c7('0x20')](function(_0x56452c){if(!_0x56452c){throw new db[(_0xf2c7('0x70'))][(_0xf2c7('0x71'))](_0xf2c7('0x72'));}_0x5184e9=_[_0xf2c7('0x73')](_[_0xf2c7('0x58')](_0x56452c),[_0xf2c7('0x74'),_0xf2c7('0x75')]);_0x2b66e9=_[_0xf2c7('0x73')](_['keys'](_0x56452c),['createdAt','updatedAt',_0xf2c7('0x76'),_0xf2c7('0x77')]);if(_0x4abeca[_0xf2c7('0x5a')]['id']){delete _0x4abeca[_0xf2c7('0x5a')]['id'];}if(_[_0xf2c7('0x78')](_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x79')])){throw new db[(_0xf2c7('0x70'))]['ValidationError'](_0xf2c7('0x7a'));}if(_[_0xf2c7('0x78')](_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x5a')])||_0x4abeca['body'][_0xf2c7('0x5a')]===''){throw new db[(_0xf2c7('0x70'))]['ValidationError'](_0xf2c7('0x7b'));}if(_[_0xf2c7('0x78')](_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x7c')])){throw new db[(_0xf2c7('0x70'))][(_0xf2c7('0x71'))](_0xf2c7('0x7d')+_0x2b66e9);}if(!_['includes'](_0x2b66e9,_0x4abeca[_0xf2c7('0x5a')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xf2c7('0x7e')+_0x2b66e9);}_0x320831[_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x7c')]]=_0x4abeca['body'][_0xf2c7('0x79')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x4abeca[_0xf2c7('0x57')]['id']},'include':[{'model':db[_0xf2c7('0x7f')],'as':'List','include':[{'model':db[_0xf2c7('0x6f')],'as':_0xf2c7('0x80'),'where':_0x320831,'limit':0x1,'order':[[_0xf2c7('0x75'),'DESC']]}]},{'model':db[_0xf2c7('0x81')],'as':_0xf2c7('0x82')}]});})[_0xf2c7('0x20')](handleEntityNotFound(_0x5bafd6,null))[_0xf2c7('0x20')](function(_0x4ffdba){if(_0x4ffdba&&_0x4ffdba[_0xf2c7('0x83')]){_0x10c764[_0xf2c7('0x84')]=_0x4ffdba;_0x10c764['applications']=_0x4ffdba[_0xf2c7('0x82')];_0x10c764[_0xf2c7('0x85')]=_0x4ffdba[_0xf2c7('0x83')];_0x10c764[_0xf2c7('0x86')]=_[_0xf2c7('0x87')](_0x10c764[_0xf2c7('0x86')],[_0xf2c7('0x88')],[_0xf2c7('0x89')]);if(_0x10c764['account'][_0xf2c7('0x82')]){delete _0x10c764[_0xf2c7('0x84')]['Applications'];}if(_0x10c764[_0xf2c7('0x84')]['List']&&_0x10c764['account']['List'][_0xf2c7('0x80')][_0xf2c7('0x48')]){return _0x10c764[_0xf2c7('0x84')][_0xf2c7('0x83')][_0xf2c7('0x80')][0x0];}var _0x4ae443=_[_0xf2c7('0x8a')](_0x4abeca[_0xf2c7('0x5a')],{'firstName':_0x4abeca['body'][_0xf2c7('0x79')],'ListId':_0x4ffdba[_0xf2c7('0x77')]});_0x4ae443[_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x7c')]]=_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x79')];return db[_0xf2c7('0x6f')][_0xf2c7('0x59')](_0x4ae443,{'fields':_0x5184e9,'raw':!![]});}})[_0xf2c7('0x20')](handleEntityNotFound(_0x5bafd6,null))['then'](function(_0x18de39){_0x10c764[_0xf2c7('0x8b')]=_0x18de39;if(_0x18de39){var _0x5dd2ea={'ContactId':_0x18de39['id'],'OpenchannelAccountId':_0x4abeca[_0xf2c7('0x57')]['id'],'from':(_0x18de39[_0xf2c7('0x8c')]||'')+'\x20'+(_0x18de39[_0xf2c7('0x8d')]||'')};var _0x346734={'OpenchannelAccountId':_0x4abeca[_0xf2c7('0x57')]['id'],'closed':![]};if(_0x4abeca['body'][_0xf2c7('0x8e')]){_0x346734[_0xf2c7('0x8e')]=_0x4abeca[_0xf2c7('0x5a')]['threadId'];return db[_0xf2c7('0x8f')][_0xf2c7('0x61')]({'where':_0x346734})[_0xf2c7('0x20')](function(_0x229946){if(_0x229946){return[_0x229946,![]];}_0x5dd2ea['threadId']=_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x8e')];_0x5dd2ea[_0xf2c7('0x90')]=_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x90')];return db[_0xf2c7('0x8f')][_0xf2c7('0x59')](_0x5dd2ea)['then'](function(_0xe32995){return[_0xe32995,!![]];});});}else{_0x346734[_0xf2c7('0x8e')]=null;}_0x346734[_0xf2c7('0x91')]=_0x18de39['id'];return db[_0xf2c7('0x8f')]['find']({'where':_0x346734})[_0xf2c7('0x20')](function(_0x404dcf){if(_0x404dcf){return[_0x404dcf,![]];}return db[_0xf2c7('0x8f')]['create'](_0x5dd2ea)[_0xf2c7('0x20')](function(_0x4400d8){return[_0x4400d8,!![]];});});}})[_0xf2c7('0x92')](function(_0x3a8957,_0x56d44d){if(_0x3a8957){_0x529c46=_0x56d44d;if(!_0x56d44d){var _0x7071e4={'from':(_0x10c764[_0xf2c7('0x8b')][_0xf2c7('0x8c')]||'')+'\x20'+(_0x10c764['contact']['lastName']||'')};if(_0x4abeca[_0xf2c7('0x5a')]['threadId']&&_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x93')]&&_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x8e')]!=_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x93')]){_0x7071e4['threadId']=_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x93')];}return _0x3a8957[_0xf2c7('0x60')](_0x7071e4);}else{return _0x3a8957;}}})[_0xf2c7('0x20')](function(_0x55a296){_0x10c764[_0xf2c7('0x94')]=_0x55a296[_0xf2c7('0x36')]({'plain':!![]});_0x10c764[_0xf2c7('0x94')]['created']=_0x529c46;if(_0x10c764[_0xf2c7('0x94')][_0xf2c7('0x95')]){if(_0x10c764['account'][_0xf2c7('0x96')]){_0x10c764[_0xf2c7('0x86')][_0xf2c7('0x97')]({'id':0x0,'priority':_0x10c764[_0xf2c7('0x86')][_0xf2c7('0x48')]+0x1,'app':'close','appdata':_0xf2c7('0x98'),'interval':_0xf2c7('0x99')});}}return db['OpenchannelMessage'][_0xf2c7('0x59')]({'body':_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x5a')],'OpenchannelAccountId':_0x4abeca[_0xf2c7('0x57')]['id'],'OpenchannelInteractionId':_0x55a296['id'],'direction':'in','ContactId':_0x10c764[_0xf2c7('0x8b')]['id'],'AttachmentId':_0x4abeca[_0xf2c7('0x5a')][_0xf2c7('0x9a')]});})[_0xf2c7('0x20')](function(_0x2432dd){_0x10c764['message']=_0x2432dd;if(_0x10c764[_0xf2c7('0x94')][_0xf2c7('0x9b')]){return db[_0xf2c7('0x9c')][_0xf2c7('0x61')]({'attributes':['id','name'],'where':{'id':_0x10c764[_0xf2c7('0x94')][_0xf2c7('0x9b')]}})['then'](function(_0x55b3b0){if(_0x55b3b0){_0x10c764['applications'][_0xf2c7('0x9d')]({'id':0x0,'priority':0x0,'app':_0xf2c7('0x9e'),'appdata':_0x55b3b0[_0xf2c7('0x42')]+','+(_0x10c764[_0xf2c7('0x84')][_0xf2c7('0x9f')]||0xa),'interval':_0xf2c7('0x99')});_0x10c764[_0xf2c7('0xa0')]=![];}return respondWithRpcPromise('Start','startRouting',_0x10c764);});}return respondWithRpcPromise(_0xf2c7('0xa1'),_0xf2c7('0xa2'),_0x10c764);})[_0xf2c7('0x20')](function(_0x5931ca){respondWithRpcPromise('EventManager',_0xf2c7('0xa3'),{'event':_0xf2c7('0xa4'),'message':_0x5931ca},client9002);return _0x5931ca;})[_0xf2c7('0x20')](respondWithResult(_0x5bafd6,null))['catch'](handleError(_0x5bafd6,null));};exports['addApplications']=function(_0x20bfa7,_0x1cf902,_0x46e26f){return db['OpenchannelAccount'][_0xf2c7('0x67')]({'where':{'id':_0x20bfa7[_0xf2c7('0x57')]['id']}})['then'](handleEntityNotFound(_0x1cf902,null))[_0xf2c7('0x20')](function(_0x1ccc03){if(_0x1ccc03){return db[_0xf2c7('0xa5')][_0xf2c7('0xa6')](function(_0x17eefa){return db[_0xf2c7('0x81')][_0xf2c7('0x35')]({'where':{'OpenchannelAccountId':_0x20bfa7[_0xf2c7('0x57')]['id']},'transaction':_0x17eefa})[_0xf2c7('0x20')](function(_0x3c42cf){var _0x1b61dc=_['map'](_0x20bfa7[_0xf2c7('0x5a')],function(_0xa802a3){_0xa802a3[_0xf2c7('0x64')]=_0x20bfa7[_0xf2c7('0x57')]['id'];return _0xa802a3;});return db[_0xf2c7('0x81')][_0xf2c7('0xa7')](_0x1b61dc,{'transaction':_0x17eefa});});})[_0xf2c7('0x20')](function(){return db[_0xf2c7('0x81')][_0xf2c7('0xa8')]({'where':{'OpenchannelAccountId':_0x20bfa7[_0xf2c7('0x57')]['id']},'order':_0xf2c7('0x88')});});}})[_0xf2c7('0x20')](respondWithResult(_0x1cf902,null))[_0xf2c7('0x55')](handleError(_0x1cf902,null));};exports['getApplications']=function(_0x10f289,_0x3ef170,_0x534b18){var _0x47eaf6={};var _0x54e7d9={};var _0x5743ae;var _0x2b6b1f;return db[_0xf2c7('0x50')][_0xf2c7('0x67')]({'where':{'id':_0x10f289[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x3ef170,null))[_0xf2c7('0x20')](function(_0x5c7dbe){if(_0x5c7dbe){_0x5743ae=_0x5c7dbe;_0x54e7d9[_0xf2c7('0x41')]=_[_0xf2c7('0x58')](db['OpenchannelApplication']['rawAttributes']);_0x54e7d9['query']=_['keys'](_0x10f289[_0xf2c7('0x43')]);_0x54e7d9[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x54e7d9[_0xf2c7('0x41')],_0x54e7d9[_0xf2c7('0x43')]);_0x47eaf6[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x54e7d9['model'],qs[_0xf2c7('0x46')](_0x10f289[_0xf2c7('0x43')][_0xf2c7('0x46')]));_0x47eaf6['attributes']=_0x47eaf6['attributes'][_0xf2c7('0x48')]?_0x47eaf6[_0xf2c7('0x47')]:_0x54e7d9['model'];_0x47eaf6[_0xf2c7('0x6d')]=qs[_0xf2c7('0x68')](_0x10f289['query'][_0xf2c7('0x68')]);_0x47eaf6[_0xf2c7('0x4b')]=qs[_0xf2c7('0x44')](_[_0xf2c7('0x4c')](_0x10f289[_0xf2c7('0x43')],_0x54e7d9[_0xf2c7('0x44')]));if(_0x10f289[_0xf2c7('0x43')][_0xf2c7('0x4d')]){_0x47eaf6[_0xf2c7('0x4b')]=_['merge'](_0x47eaf6[_0xf2c7('0x4b')],{'$or':_[_0xf2c7('0x3d')](_0x47eaf6[_0xf2c7('0x47')],function(_0x192ef9){var _0x5be080={};_0x5be080[_0x192ef9]={'$like':'%'+_0x10f289[_0xf2c7('0x43')][_0xf2c7('0x4d')]+'%'};return _0x5be080;})});}_0x47eaf6=_[_0xf2c7('0x4e')]({},_0x47eaf6,_0x10f289[_0xf2c7('0x69')]);return _0x5743ae[_0xf2c7('0xa9')](_0x47eaf6);}})[_0xf2c7('0x20')](function(_0x5176dc){if(_0x5176dc){_0x2b6b1f=_0x5176dc[_0xf2c7('0x48')];if(!_0x10f289[_0xf2c7('0x43')]['hasOwnProperty'](_0xf2c7('0x4a'))){_0x47eaf6[_0xf2c7('0x2e')]=qs[_0xf2c7('0x2e')](_0x10f289[_0xf2c7('0x43')][_0xf2c7('0x2e')]);_0x47eaf6[_0xf2c7('0x30')]=qs[_0xf2c7('0x30')](_0x10f289[_0xf2c7('0x43')]['offset']);}return _0x5743ae['getApplications'](_0x47eaf6);}})[_0xf2c7('0x20')](function(_0x194b7c){if(_0x194b7c){return _0x194b7c?{'count':_0x2b6b1f,'rows':_0x194b7c}:null;}})[_0xf2c7('0x20')](respondWithResult(_0x3ef170,null))[_0xf2c7('0x55')](handleError(_0x3ef170,null));};exports[_0xf2c7('0xaa')]=function(_0x4e06b5,_0x5db653,_0x2ddbc6){var _0x474f98={'raw':![],'where':{}};var _0x112a36={};var _0x8ac947={'count':0x0,'rows':[]};return db[_0xf2c7('0x50')][_0xf2c7('0x67')]({'where':{'id':_0x4e06b5[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x5db653,null))[_0xf2c7('0x20')](function(_0xf56d14){if(_0xf56d14){_0x112a36[_0xf2c7('0x41')]=_['keys'](db[_0xf2c7('0x8f')][_0xf2c7('0x3e')]);_0x112a36[_0xf2c7('0x43')]=_[_0xf2c7('0x58')](_0x4e06b5[_0xf2c7('0x43')]);_0x112a36[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x112a36[_0xf2c7('0x41')],_0x112a36[_0xf2c7('0x43')]);_0x474f98[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x112a36[_0xf2c7('0x41')],qs[_0xf2c7('0x46')](_0x4e06b5['query'][_0xf2c7('0x46')]));_0x474f98[_0xf2c7('0x47')]=_0x474f98['attributes'][_0xf2c7('0x48')]?_0x474f98['attributes']:_0x112a36[_0xf2c7('0x41')];if(!_0x4e06b5[_0xf2c7('0x43')][_0xf2c7('0x49')](_0xf2c7('0x4a'))){_0x474f98[_0xf2c7('0x2e')]=qs[_0xf2c7('0x2e')](_0x4e06b5['query'][_0xf2c7('0x2e')]);_0x474f98[_0xf2c7('0x30')]=qs[_0xf2c7('0x30')](_0x4e06b5[_0xf2c7('0x43')][_0xf2c7('0x30')]);}_0x474f98[_0xf2c7('0x6d')]=qs[_0xf2c7('0x68')](_0x4e06b5['query'][_0xf2c7('0x68')]);_0x474f98['where']=qs['filters'](_[_0xf2c7('0x4c')](_0x4e06b5[_0xf2c7('0x43')],_0x112a36[_0xf2c7('0x44')]));_0x474f98[_0xf2c7('0x4b')][_0xf2c7('0x64')]=_0xf56d14['id'];if(_0x4e06b5[_0xf2c7('0x43')]['filter']){_0x474f98['where']=_[_0xf2c7('0x4e')](_0x474f98[_0xf2c7('0x4b')],{'$or':_[_0xf2c7('0x3d')](_0x474f98[_0xf2c7('0x47')],function(_0x513d11){var _0xb165ce={};_0xb165ce[_0x513d11]={'$like':'%'+_0x4e06b5['query'][_0xf2c7('0x4d')]+'%'};return _0xb165ce;})});}_0x474f98=_[_0xf2c7('0x4e')]({},_0x474f98,_0x4e06b5['options']);return db[_0xf2c7('0x8f')][_0xf2c7('0x2f')]({'where':_0x474f98[_0xf2c7('0x4b')]})['then'](function(_0x10b9fd){_0x8ac947[_0xf2c7('0x2f')]=_0x10b9fd;if(_0x4e06b5['query'][_0xf2c7('0x51')]){_0x474f98[_0xf2c7('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xf2c7('0xab'),'attributes':['name',_0xf2c7('0xac'),'internal'],'required':![]},{'model':db[_0xf2c7('0xad')],'as':_0xf2c7('0xae'),'attributes':['id',_0xf2c7('0x42'),_0xf2c7('0xaf')],'where':_0x4e06b5[_0xf2c7('0x43')][_0xf2c7('0xb0')]?{'id':_0x4e06b5[_0xf2c7('0x43')][_0xf2c7('0xb0')]}:undefined,'required':_0x4e06b5['query'][_0xf2c7('0xb0')]?!![]:![]}];}return db[_0xf2c7('0x8f')][_0xf2c7('0x53')](_0x474f98);})[_0xf2c7('0x20')](function(_0x3c2043){_0x8ac947[_0xf2c7('0x54')]=_0x3c2043;return _0x8ac947;});}})[_0xf2c7('0x20')](respondWithFilteredResult(_0x5db653,_0x474f98))[_0xf2c7('0x55')](handleError(_0x5db653,null));};exports['addAgents']=function(_0x331441,_0x41614e,_0x2e4edb){return db[_0xf2c7('0x50')][_0xf2c7('0x61')]({'where':{'id':_0x331441[_0xf2c7('0x57')]['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x41614e,null))[_0xf2c7('0x20')](function(_0x5313be){if(_0x5313be){return _0x5313be['addAgents'](_0x331441[_0xf2c7('0x5a')][_0xf2c7('0x6b')],_[_0xf2c7('0xb1')](_0x331441[_0xf2c7('0x5a')],['ids','id'])||{})[_0xf2c7('0x92')](function(_0x55cf22){for(var _0x42a837=0x0;_0x42a837<_0x331441['body'][_0xf2c7('0x6b')][_0xf2c7('0x48')];_0x42a837+=0x1){socket[_0xf2c7('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x331441[_0xf2c7('0x5a')][_0xf2c7('0x6b')][_0x42a837]),'OpenchannelAccountId':Number(_0x331441['params']['id'])});}return _0x55cf22;});}})[_0xf2c7('0x20')](respondWithResult(_0x41614e,null))['catch'](handleError(_0x41614e,null));};exports[_0xf2c7('0xb3')]=function(_0x3ad80c,_0x204ca9,_0x294d45){return db[_0xf2c7('0x50')][_0xf2c7('0x61')]({'where':{'id':_0x3ad80c['params']['id']}})['then'](handleEntityNotFound(_0x204ca9,null))[_0xf2c7('0x20')](function(_0x563e4a){if(_0x563e4a){return _0x563e4a[_0xf2c7('0xb3')](_0x3ad80c[_0xf2c7('0x43')][_0xf2c7('0x6b')])['then'](function(){if(_[_0xf2c7('0xb4')](_0x3ad80c[_0xf2c7('0x43')][_0xf2c7('0x6b')])){for(var _0xaf16f7=0x0;_0xaf16f7<_0x3ad80c['query'][_0xf2c7('0x6b')]['length'];_0xaf16f7+=0x1){socket[_0xf2c7('0xb2')](_0xf2c7('0xb5'),{'UserId':Number(_0x3ad80c['query'][_0xf2c7('0x6b')][_0xaf16f7]),'OpenchannelAccountId':Number(_0x3ad80c['params']['id'])});}}else{socket[_0xf2c7('0xb2')](_0xf2c7('0xb5'),{'UserId':Number(_0x3ad80c['query']['ids']),'OpenchannelAccountId':Number(_0x3ad80c['params']['id'])});}});}})[_0xf2c7('0x20')](respondWithStatusCode(_0x204ca9,null))[_0xf2c7('0x55')](handleError(_0x204ca9,null));};exports[_0xf2c7('0xb6')]=function(_0x3efabe,_0x200eb3,_0x46ba2d){var _0x1e2303={};var _0x1ed656={};var _0x1f59fa;var _0x33c098;return db['OpenchannelAccount'][_0xf2c7('0x67')]({'where':{'id':_0x3efabe['params']['id']}})[_0xf2c7('0x20')](handleEntityNotFound(_0x200eb3,null))[_0xf2c7('0x20')](function(_0x549584){if(_0x549584){_0x1f59fa=_0x549584;_0x1ed656[_0xf2c7('0x41')]=_[_0xf2c7('0x58')](db[_0xf2c7('0x9c')][_0xf2c7('0x3e')]);_0x1ed656[_0xf2c7('0x43')]=_[_0xf2c7('0x58')](_0x3efabe[_0xf2c7('0x43')]);_0x1ed656[_0xf2c7('0x44')]=_[_0xf2c7('0x45')](_0x1ed656[_0xf2c7('0x41')],_0x1ed656[_0xf2c7('0x43')]);_0x1e2303[_0xf2c7('0x47')]=_[_0xf2c7('0x45')](_0x1ed656['model'],qs[_0xf2c7('0x46')](_0x3efabe[_0xf2c7('0x43')][_0xf2c7('0x46')]));_0x1e2303['attributes']=_0x1e2303[_0xf2c7('0x47')][_0xf2c7('0x48')]?_0x1e2303['attributes']:_0x1ed656[_0xf2c7('0x41')];_0x1e2303[_0xf2c7('0x6d')]=qs[_0xf2c7('0x68')](_0x3efabe[_0xf2c7('0x43')][_0xf2c7('0x68')]);_0x1e2303[_0xf2c7('0x4b')]=qs['filters'](_[_0xf2c7('0x4c')](_0x3efabe[_0xf2c7('0x43')],_0x1ed656['filters']));if(_0x3efabe[_0xf2c7('0x43')][_0xf2c7('0x4d')]){_0x1e2303[_0xf2c7('0x4b')]=_[_0xf2c7('0x4e')](_0x1e2303[_0xf2c7('0x4b')],{'$or':_[_0xf2c7('0x3d')](_0x1e2303[_0xf2c7('0x47')],function(_0x72c47b){var _0x8d0e31={};_0x8d0e31[_0x72c47b]={'$like':'%'+_0x3efabe[_0xf2c7('0x43')][_0xf2c7('0x4d')]+'%'};return _0x8d0e31;})});}_0x1e2303=_[_0xf2c7('0x4e')]({},_0x1e2303,_0x3efabe[_0xf2c7('0x69')]);return _0x1f59fa['getAgents'](_0x1e2303);}})[_0xf2c7('0x20')](function(_0x26403c){if(_0x26403c){_0x33c098=_0x26403c[_0xf2c7('0x48')];if(!_0x3efabe[_0xf2c7('0x43')]['hasOwnProperty'](_0xf2c7('0x4a'))){_0x1e2303[_0xf2c7('0x2e')]=qs[_0xf2c7('0x2e')](_0x3efabe[_0xf2c7('0x43')][_0xf2c7('0x2e')]);_0x1e2303[_0xf2c7('0x30')]=qs[_0xf2c7('0x30')](_0x3efabe['query'][_0xf2c7('0x30')]);}return _0x1f59fa[_0xf2c7('0xb6')](_0x1e2303);}})[_0xf2c7('0x20')](function(_0x569e38){if(_0x569e38){return _0x569e38?{'count':_0x33c098,'rows':_0x569e38}:null;}})[_0xf2c7('0x20')](respondWithResult(_0x200eb3,null))[_0xf2c7('0x55')](handleError(_0x200eb3,null));};exports[_0xf2c7('0x39')]=function(_0x1da1c2,_0x18a2bd,_0x20b12d){var _0x1fb629,_0x323c93,_0x568903;if(_[_0xf2c7('0x78')](_0x1da1c2[_0xf2c7('0x5a')][_0xf2c7('0x5a')])||_0x1da1c2[_0xf2c7('0x5a')][_0xf2c7('0x5a')]===''){throw new db[(_0xf2c7('0x70'))][(_0xf2c7('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf2c7('0x78')](_0x1da1c2[_0xf2c7('0x5a')]['to'])){}_0x1fb629=_0x1da1c2['body']['to'];return db[_0xf2c7('0x50')]['findOne']({'where':{'id':_0x1da1c2['params']['id']}})['then'](handleEntityNotFound(_0x18a2bd,null))[_0xf2c7('0x20')](function(_0x170a34){if(_0x170a34){return db[_0xf2c7('0x50')]['find']({'where':{'id':_0x170a34['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xf2c7('0x80'),'where':{[_0x170a34['mapKey']]:_0x1fb629},'limit':0x1,'order':[['updatedAt',_0xf2c7('0xb7')]]}]}]})[_0xf2c7('0x20')](handleEntityNotFound(_0x18a2bd,null))['then'](function(_0xeb0a55){if(_0xeb0a55&&_0xeb0a55[_0xf2c7('0x83')]){_0x323c93=_0xeb0a55['get']({'plain':!![]});if(_0x323c93[_0xf2c7('0x83')]&&_0x323c93[_0xf2c7('0x83')]['Contacts'][_0xf2c7('0x48')]){return _0x323c93[_0xf2c7('0x83')]['Contacts'][0x0];}return db[_0xf2c7('0x6f')][_0xf2c7('0x59')](_[_0xf2c7('0x8a')](_0x1da1c2['body'],{'firstName':_0x1fb629,[_0xeb0a55['mapKey']]:_0x1fb629,'phone':_0x1fb629,'ListId':_0x323c93[_0xf2c7('0x77')]}));}})[_0xf2c7('0x20')](handleEntityNotFound(_0x18a2bd,null))[_0xf2c7('0x20')](function(_0x1c6b18){if(_0x1c6b18){_0x568903=_0x1c6b18;return db[_0xf2c7('0x8f')][_0xf2c7('0x61')]({'where':{'ContactId':_0x568903['id'],'closed':![],'OpenchannelAccountId':_0x323c93['id']}})['then'](function(_0x6cd62c){if(_0x6cd62c){return[_0x6cd62c,![]];}return db[_0xf2c7('0x8f')][_0xf2c7('0x59')]({'UserId':_0x1da1c2[_0xf2c7('0x5b')]['id'],'ContactId':_0x568903['id'],'OpenchannelAccountId':_0x323c93['id'],'lastMsgDirection':_0xf2c7('0xb8'),'Messages':[_['merge'](_0x1da1c2[_0xf2c7('0x5a')],{'read':![],'body':_0x1da1c2['body'][_0xf2c7('0x5a')],'OpenchannelAccountId':_0x323c93['id'],'UserId':_0x1da1c2[_0xf2c7('0x5b')]['id'],'ContactId':_0x568903['id']})]},{'include':[{'model':db[_0xf2c7('0xb9')],'as':_0xf2c7('0xba')}]})[_0xf2c7('0x20')](function(_0x4f29ba){return[_0x4f29ba,!![]];});});}})[_0xf2c7('0x92')](function(_0x3d9eca,_0x1f404a){if(_0x1f404a){return _0x3d9eca;}return db[_0xf2c7('0xb9')][_0xf2c7('0x59')](_[_0xf2c7('0x4e')](_0x1da1c2[_0xf2c7('0x5a')],{'read':![],'body':_0x1da1c2[_0xf2c7('0x5a')][_0xf2c7('0x5a')],'OpenchannelAccountId':_0x323c93['id'],'OpenchannelInteractionId':_0x3d9eca['id'],'UserId':_0x1da1c2[_0xf2c7('0x5b')]['id'],'ContactId':_0x568903['id']}))['then'](function(_0x230d47){_0x3d9eca[_0xf2c7('0xbb')][_0xf2c7('0xba')]=[];_0x3d9eca['dataValues'][_0xf2c7('0xba')][_0xf2c7('0x97')](_0x230d47[_0xf2c7('0xbb')]);return _0x3d9eca;});});}})[_0xf2c7('0x20')](respondWithResult(_0x18a2bd,null))[_0xf2c7('0x55')](handleError(_0x18a2bd,null));};
\ No newline at end of file
index 5df2405..b1837c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x351739,_0x3e74e6){var _0x764126=function(_0x19fcfb){while(--_0x19fcfb){_0x351739['push'](_0x351739['shift']());}};_0x764126(++_0x3e74e6);}(_0xe706,0xa3));var _0x6e70=function(_0x248d46,_0xba08ec){_0x248d46=_0x248d46-0x0;var _0x354942=_0xe706[_0x248d46];return _0x354942;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var OpenchannelAccount=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];OpenchannelAccount[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xb4e6[_0x211fef];return _0x5447bf;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index eaea97b..c68f434 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(_0x2451bb,_0x542336){var _0x1d5305=function(_0x567462){while(--_0x567462){_0x2451bb['push'](_0x2451bb['shift']());}};_0x1d5305(++_0x542336);}(_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(_0x26876b,_0x33c95e){var _0x1c4223=function(_0x7a6ab3){while(--_0x7a6ab3){_0x26876b['push'](_0x26876b['shift']());}};_0x1c4223(++_0x33c95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 3f2a51b..2f2ef9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','code','message','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./openchannelAccount.socket','register'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0xf4eb,0xec));var _0xbf4e=function(_0x983c71,_0x31b474){_0x983c71=_0x983c71-0x0;var _0x579438=_0xf4eb[_0x983c71];return _0x579438;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});config[_0xbf4e('0x8')]=_['defaults'](config[_0xbf4e('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x8')]));require(_0xbf4e('0x9'))[_0xbf4e('0xa')](socket);function respondWithRpcPromise(_0xc86f04,_0x5da823,_0x22668b){return new BPromise(function(_0x177342,_0x580a26){return client['request'](_0xc86f04,_0x22668b)[_0xbf4e('0xb')](function(_0x5a8397){logger[_0xbf4e('0xc')](_0xbf4e('0xd'),_0x5da823,'request\x20sent');logger[_0xbf4e('0xe')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5da823,'request\x20sent',JSON[_0xbf4e('0xf')](_0x5a8397));if(_0x5a8397[_0xbf4e('0x10')]){if(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x11')]===0x1f4){logger[_0xbf4e('0x10')](_0xbf4e('0xd'),_0x5da823,_0x5a8397['error']['message']);return _0x580a26(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);}logger[_0xbf4e('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x5da823,_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);return _0x177342(_0x5a8397[_0xbf4e('0x10')][_0xbf4e('0x12')]);}else{logger['info'](_0xbf4e('0xd'),_0x5da823,'request\x20sent');_0x177342(_0x5a8397['result']['message']);}})['catch'](function(_0x35992b){logger[_0xbf4e('0x10')](_0xbf4e('0xd'),_0x5da823,_0x35992b);_0x580a26(_0x35992b);});});}
\ No newline at end of file
+var _0x3c81=['bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x57000c,_0x4e5015){var _0x475aa1=function(_0x260c32){while(--_0x260c32){_0x57000c['push'](_0x57000c['shift']());}};_0x475aa1(++_0x4e5015);}(_0x3c81,0x102));var _0x13c8=function(_0x1fccd0,_0x2ac197){_0x1fccd0=_0x1fccd0-0x0;var _0x1ec659=_0x3c81[_0x1fccd0];return _0x1ec659;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});config[_0x13c8('0x9')]=_[_0x13c8('0xa')](config['redis'],{'host':_0x13c8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13c8('0x9')]));require(_0x13c8('0xc'))[_0x13c8('0xd')](socket);function respondWithRpcPromise(_0x30b4d6,_0xaa58b6,_0x13c717){return new BPromise(function(_0x29074d,_0x2ce95a){return client[_0x13c8('0xe')](_0x30b4d6,_0x13c717)[_0x13c8('0xf')](function(_0x3ca0a6){logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));logger['debug'](_0x13c8('0x13'),_0xaa58b6,_0x13c8('0x12'),JSON[_0x13c8('0x14')](_0x3ca0a6));if(_0x3ca0a6[_0x13c8('0x15')]){if(_0x3ca0a6['error'][_0x13c8('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0xaa58b6,_0x3ca0a6['error'][_0x13c8('0x17')]);return _0x2ce95a(_0x3ca0a6['error'][_0x13c8('0x17')]);}logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x3ca0a6[_0x13c8('0x15')]['message']);return _0x29074d(_0x3ca0a6[_0x13c8('0x15')][_0x13c8('0x17')]);}else{logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));_0x29074d(_0x3ca0a6[_0x13c8('0x18')][_0x13c8('0x17')]);}})[_0x13c8('0x19')](function(_0x34fbc0){logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x34fbc0);_0x2ce95a(_0x34fbc0);});});}
\ No newline at end of file
index 21b7350..8526ce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf996=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit'];(function(_0x3ffadf,_0x47c3b1){var _0x46223d=function(_0x1a3ddd){while(--_0x1a3ddd){_0x3ffadf['push'](_0x3ffadf['shift']());}};_0x46223d(++_0x47c3b1);}(_0xf996,0x74));var _0x6f99=function(_0x422d6a,_0x20d24f){_0x422d6a=_0x422d6a-0x0;var _0x3bff4b=_0xf996[_0x422d6a];return _0x3bff4b;};'use strict';var OpenchannelAccountEvents=require(_0x6f99('0x0'));var events=[_0x6f99('0x1'),_0x6f99('0x2'),'update'];function createListener(_0x12ac12,_0x56fd3f){return function(_0x5ceb57){_0x56fd3f[_0x6f99('0x3')](_0x12ac12,_0x5ceb57);};}function removeListener(_0xa0b3d7,_0x274f12){return function(){OpenchannelAccountEvents[_0x6f99('0x4')](_0xa0b3d7,_0x274f12);};}exports[_0x6f99('0x5')]=function(_0xf2b5ee){for(var _0xa07ac1=0x0,_0x2883cb=events[_0x6f99('0x6')];_0xa07ac1<_0x2883cb;_0xa07ac1++){var _0x1e4805=events[_0xa07ac1];var _0x5d8b7f=createListener(_0x6f99('0x7')+_0x1e4805,_0xf2b5ee);OpenchannelAccountEvents['on'](_0x1e4805,_0x5d8b7f);}};
\ No newline at end of file
+var _0xd404=['save','update','emit','removeListener','register','./openchannelAccount.events'];(function(_0x5651ab,_0x3ea2ee){var _0x38b6c7=function(_0x3713a7){while(--_0x3713a7){_0x5651ab['push'](_0x5651ab['shift']());}};_0x38b6c7(++_0x3ea2ee);}(_0xd404,0x15b));var _0x4d40=function(_0x4f0d44,_0x45aea7){_0x4f0d44=_0x4f0d44-0x0;var _0x41245=_0xd404[_0x4f0d44];return _0x41245;};'use strict';var OpenchannelAccountEvents=require(_0x4d40('0x0'));var events=[_0x4d40('0x1'),'remove',_0x4d40('0x2')];function createListener(_0x2322e5,_0x502a67){return function(_0x3e9bbc){_0x502a67[_0x4d40('0x3')](_0x2322e5,_0x3e9bbc);};}function removeListener(_0xba821,_0x8bde12){return function(){OpenchannelAccountEvents[_0x4d40('0x4')](_0xba821,_0x8bde12);};}exports[_0x4d40('0x5')]=function(_0xc2a9db){for(var _0x24a237=0x0,_0x2e4bd8=events['length'];_0x24a237<_0x2e4bd8;_0x24a237++){var _0x292180=events[_0x24a237];var _0x116941=createListener('openchannelAccount:'+_0x292180,_0xc2a9db);OpenchannelAccountEvents['on'](_0x292180,_0x116941);}};
\ No newline at end of file
index 2bdaf06..e75b21f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cec=['./openchannelApplication.controller','isAuthenticated','/:id','show','post','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0cec,0x93));var _0xc0ce=function(_0x192025,_0x38c685){_0x192025=_0x192025-0x0;var _0x3454a5=_0x0cec[_0x192025];return _0x3454a5;};'use strict';var multer=require(_0xc0ce('0x0'));var util=require(_0xc0ce('0x1'));var path=require(_0xc0ce('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0ce('0x3'));var router=express[_0xc0ce('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0ce('0x5'));var config=require(_0xc0ce('0x6'));var controller=require(_0xc0ce('0x7'));router['get']('/',auth[_0xc0ce('0x8')](),controller['index']);router['get'](_0xc0ce('0x9'),auth[_0xc0ce('0x8')](),controller[_0xc0ce('0xa')]);router[_0xc0ce('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc0ce('0xc')](_0xc0ce('0x9'),auth[_0xc0ce('0x8')](),controller[_0xc0ce('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x2c1a=['post','create','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','get','/:id','isAuthenticated','show'];(function(_0x50d74d,_0x2296b0){var _0x3b3b18=function(_0x5865e8){while(--_0x5865e8){_0x50d74d['push'](_0x50d74d['shift']());}};_0x3b3b18(++_0x2296b0);}(_0x2c1a,0x1a9));var _0xa2c1=function(_0x1c73e4,_0x527cc8){_0x1c73e4=_0x1c73e4-0x0;var _0x33190f=_0x2c1a[_0x1c73e4];return _0x33190f;};'use strict';var multer=require(_0xa2c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2c1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa2c1('0x2'));var auth=require(_0xa2c1('0x3'));var interaction=require(_0xa2c1('0x4'));var config=require(_0xa2c1('0x5'));var controller=require(_0xa2c1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa2c1('0x7')]);router[_0xa2c1('0x8')](_0xa2c1('0x9'),auth[_0xa2c1('0xa')](),controller[_0xa2c1('0xb')]);router[_0xa2c1('0xc')]('/',auth[_0xa2c1('0xa')](),controller[_0xa2c1('0xd')]);router[_0xa2c1('0xe')](_0xa2c1('0x9'),auth[_0xa2c1('0xa')](),controller[_0xa2c1('0xf')]);router[_0xa2c1('0x10')](_0xa2c1('0x9'),auth['isAuthenticated'](),controller[_0xa2c1('0x11')]);module[_0xa2c1('0x12')]=router;
\ No newline at end of file
index 8569be3..705ffa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6366=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5e4bf9,_0x1da760){var _0xf37cbe=function(_0xe87c10){while(--_0xe87c10){_0x5e4bf9['push'](_0x5e4bf9['shift']());}};_0xf37cbe(++_0x1da760);}(_0x6366,0x129));var _0x6636=function(_0x12d008,_0x181899){_0x12d008=_0x12d008-0x0;var _0x42d69b=_0x6366[_0x12d008];return _0x42d69b;};'use strict';var Sequelize=require(_0x6636('0x0'));module[_0x6636('0x1')]={'priority':{'type':Sequelize[_0x6636('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6636('0x3')],'allowNull':![],'defaultValue':_0x6636('0x4')},'appdata':{'type':Sequelize[_0x6636('0x5')]()},'description':{'type':Sequelize[_0x6636('0x3')]},'interval':{'type':Sequelize[_0x6636('0x3')],'defaultValue':_0x6636('0x6')}};
\ No newline at end of file
+var _0xbaaa=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x4294b3,_0x1043f0){var _0x1e4d5e=function(_0x20252b){while(--_0x20252b){_0x4294b3['push'](_0x4294b3['shift']());}};_0x1e4d5e(++_0x1043f0);}(_0xbaaa,0x137));var _0xabaa=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xbaaa[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0xabaa('0x0'));module['exports']={'priority':{'type':Sequelize[_0xabaa('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xabaa('0x2')],'allowNull':![],'defaultValue':_0xabaa('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xabaa('0x2')]},'interval':{'type':Sequelize[_0xabaa('0x2')],'defaultValue':_0xabaa('0x4')}};
\ No newline at end of file
index e86fc3a..9f071ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5035=['nolimit','order','sort','where','filter','VIRTUAL','options','include','rows','catch','params','includeAll','merge','find','create','update','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','error','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty'];(function(_0x36a6f3,_0x29790d){var _0x12b8cc=function(_0x218581){while(--_0x218581){_0x36a6f3['push'](_0x36a6f3['shift']());}};_0x12b8cc(++_0x29790d);}(_0x5035,0x1c1));var _0x5503=function(_0x273d9c,_0x3f1c61){_0x273d9c=_0x273d9c-0x0;var _0x108341=_0x5035[_0x273d9c];return _0x108341;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5503('0x0'));var jsonpatch=require(_0x5503('0x1'));var rp=require(_0x5503('0x2'));var moment=require(_0x5503('0x3'));var BPromise=require(_0x5503('0x4'));var Mustache=require(_0x5503('0x5'));var util=require(_0x5503('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(_0x5503('0x7'));var _=require(_0x5503('0x8'));var squel=require(_0x5503('0x9'));var crypto=require(_0x5503('0xa'));var jsforce=require(_0x5503('0xb'));var deskjs=require(_0x5503('0xc'));var toCsv=require(_0x5503('0xd'));var querystring=require('querystring');var Papa=require(_0x5503('0xe'));var Redis=require('ioredis');var authService=require(_0x5503('0xf'));var qs=require(_0x5503('0x10'));var as=require(_0x5503('0x11'));var hardwareService=require(_0x5503('0x12'));var logger=require(_0x5503('0x13'))(_0x5503('0x14'));var utils=require(_0x5503('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5503('0x16'))['db'];function respondWithStatusCode(_0x246d5c,_0x517bce){_0x517bce=_0x517bce||0xcc;return function(_0x2066ce){if(_0x2066ce){return _0x246d5c[_0x5503('0x17')](_0x517bce);}return _0x246d5c['status'](_0x517bce)['end']();};}function respondWithResult(_0x40e4ef,_0x5aa31f){_0x5aa31f=_0x5aa31f||0xc8;return function(_0x170888){if(_0x170888){return _0x40e4ef['status'](_0x5aa31f)[_0x5503('0x18')](_0x170888);}};}function respondWithFilteredResult(_0x237e00,_0x16a890){return function(_0xf575e5){if(_0xf575e5){var _0x520e1b=typeof _0x16a890[_0x5503('0x19')]===_0x5503('0x1a')&&typeof _0x16a890[_0x5503('0x1b')]==='undefined';var _0x27b290=_0xf575e5[_0x5503('0x1c')];var _0x270932=_0x520e1b?0x0:_0x16a890[_0x5503('0x19')];var _0x2a9605=_0x520e1b?_0xf575e5['count']:_0x16a890[_0x5503('0x19')]+_0x16a890['limit'];var _0x515383;if(_0x2a9605>=_0x27b290){_0x2a9605=_0x27b290;_0x515383=0xc8;}else{_0x515383=0xce;}_0x237e00[_0x5503('0x1d')](_0x515383);return _0x237e00['set'](_0x5503('0x1e'),_0x270932+'-'+_0x2a9605+'/'+_0x27b290)['json'](_0xf575e5);}return null;};}function patchUpdates(_0x5288e9){return function(_0x3b75ff){try{jsonpatch[_0x5503('0x1f')](_0x3b75ff,_0x5288e9,!![]);}catch(_0x513a96){return BPromise[_0x5503('0x20')](_0x513a96);}return _0x3b75ff[_0x5503('0x21')]();};}function saveUpdates(_0x3e33ff,_0x1aaabf){return function(_0x4df9f8){if(_0x4df9f8){return _0x4df9f8['update'](_0x3e33ff)[_0x5503('0x22')](function(_0xd6d32){return _0xd6d32;});}return null;};}function removeEntity(_0x4b5815,_0x9c306){return function(_0x2d1ad1){if(_0x2d1ad1){return _0x2d1ad1[_0x5503('0x23')]()[_0x5503('0x22')](function(){_0x4b5815['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb96bd6,_0x4765cc){return function(_0x268c43){if(!_0x268c43){_0xb96bd6[_0x5503('0x17')](0x194);}return _0x268c43;};}function handleError(_0x4ef08c,_0xe3ae46){_0xe3ae46=_0xe3ae46||0x1f4;return function(_0x3009d4){logger[_0x5503('0x24')](_0x3009d4['stack']);if(_0x3009d4['name']){delete _0x3009d4[_0x5503('0x25')];}_0x4ef08c[_0x5503('0x1d')](_0xe3ae46)[_0x5503('0x26')](_0x3009d4);};}exports[_0x5503('0x27')]=function(_0x2ad2d4,_0x53976d){var _0x18c9c4={},_0x157b60={},_0x1d8303={'count':0x0,'rows':[]};var _0x403afb=_['map'](db[_0x5503('0x28')][_0x5503('0x29')],function(_0x39fe7c){return{'name':_0x39fe7c[_0x5503('0x2a')],'type':_0x39fe7c[_0x5503('0x2b')][_0x5503('0x2c')]};});_0x157b60['model']=_[_0x5503('0x2d')](_0x403afb,_0x5503('0x25'));_0x157b60[_0x5503('0x2e')]=_[_0x5503('0x2f')](_0x2ad2d4['query']);_0x157b60[_0x5503('0x30')]=_[_0x5503('0x31')](_0x157b60['model'],_0x157b60['query']);_0x18c9c4[_0x5503('0x32')]=_[_0x5503('0x31')](_0x157b60['model'],qs[_0x5503('0x33')](_0x2ad2d4[_0x5503('0x2e')][_0x5503('0x33')]));_0x18c9c4[_0x5503('0x32')]=_0x18c9c4[_0x5503('0x32')][_0x5503('0x34')]?_0x18c9c4[_0x5503('0x32')]:_0x157b60[_0x5503('0x35')];if(!_0x2ad2d4['query'][_0x5503('0x36')](_0x5503('0x37'))){_0x18c9c4['limit']=qs[_0x5503('0x1b')](_0x2ad2d4[_0x5503('0x2e')][_0x5503('0x1b')]);_0x18c9c4[_0x5503('0x19')]=qs[_0x5503('0x19')](_0x2ad2d4[_0x5503('0x2e')][_0x5503('0x19')]);}_0x18c9c4[_0x5503('0x38')]=qs[_0x5503('0x39')](_0x2ad2d4[_0x5503('0x2e')][_0x5503('0x39')]);_0x18c9c4[_0x5503('0x3a')]=qs[_0x5503('0x30')](_['pick'](_0x2ad2d4[_0x5503('0x2e')],_0x157b60[_0x5503('0x30')]),_0x403afb);if(_0x2ad2d4[_0x5503('0x2e')][_0x5503('0x3b')]){_0x18c9c4['where']=_['merge'](_0x18c9c4[_0x5503('0x3a')],{'$or':_[_0x5503('0x2d')](_0x403afb,function(_0x300029){if(_0x300029[_0x5503('0x2b')]!==_0x5503('0x3c')){var _0x458542={};_0x458542[_0x300029[_0x5503('0x25')]]={'$like':'%'+_0x2ad2d4['query'][_0x5503('0x3b')]+'%'};return _0x458542;}})});}_0x18c9c4=_['merge']({},_0x18c9c4,_0x2ad2d4[_0x5503('0x3d')]);var _0x4fbd5e={'where':_0x18c9c4[_0x5503('0x3a')]};return db[_0x5503('0x28')][_0x5503('0x1c')](_0x4fbd5e)['then'](function(_0x5acb9e){_0x1d8303[_0x5503('0x1c')]=_0x5acb9e;if(_0x2ad2d4[_0x5503('0x2e')]['includeAll']){_0x18c9c4[_0x5503('0x3e')]=[{'all':!![]}];}return db[_0x5503('0x28')]['findAll'](_0x18c9c4);})[_0x5503('0x22')](function(_0x5b43c5){_0x1d8303[_0x5503('0x3f')]=_0x5b43c5;return _0x1d8303;})['then'](respondWithFilteredResult(_0x53976d,_0x18c9c4))[_0x5503('0x40')](handleError(_0x53976d,null));};exports['show']=function(_0x3954b5,_0x131778){var _0x151d1e={'raw':!![],'where':{'id':_0x3954b5[_0x5503('0x41')]['id']}},_0x249b38={};_0x249b38[_0x5503('0x35')]=_[_0x5503('0x2f')](db[_0x5503('0x28')][_0x5503('0x29')]);_0x249b38[_0x5503('0x2e')]=_['keys'](_0x3954b5[_0x5503('0x2e')]);_0x249b38['filters']=_[_0x5503('0x31')](_0x249b38[_0x5503('0x35')],_0x249b38[_0x5503('0x2e')]);_0x151d1e['attributes']=_[_0x5503('0x31')](_0x249b38[_0x5503('0x35')],qs[_0x5503('0x33')](_0x3954b5[_0x5503('0x2e')][_0x5503('0x33')]));_0x151d1e[_0x5503('0x32')]=_0x151d1e[_0x5503('0x32')][_0x5503('0x34')]?_0x151d1e[_0x5503('0x32')]:_0x249b38[_0x5503('0x35')];if(_0x3954b5[_0x5503('0x2e')][_0x5503('0x42')]){_0x151d1e[_0x5503('0x3e')]=[{'all':!![]}];}_0x151d1e=_[_0x5503('0x43')]({},_0x151d1e,_0x3954b5[_0x5503('0x3d')]);return db['OpenchannelApplication'][_0x5503('0x44')](_0x151d1e)['then'](handleEntityNotFound(_0x131778,null))[_0x5503('0x22')](respondWithResult(_0x131778,null))['catch'](handleError(_0x131778,null));};exports[_0x5503('0x45')]=function(_0x1841bc,_0x445fb8){return db[_0x5503('0x28')][_0x5503('0x45')](_0x1841bc['body'],{})[_0x5503('0x22')](respondWithResult(_0x445fb8,0xc9))[_0x5503('0x40')](handleError(_0x445fb8,null));};exports[_0x5503('0x46')]=function(_0x5f1add,_0x1bc20a){if(_0x5f1add[_0x5503('0x47')]['id']){delete _0x5f1add[_0x5503('0x47')]['id'];}return db[_0x5503('0x28')][_0x5503('0x44')]({'where':{'id':_0x5f1add['params']['id']}})['then'](handleEntityNotFound(_0x1bc20a,null))[_0x5503('0x22')](saveUpdates(_0x5f1add[_0x5503('0x47')],null))[_0x5503('0x22')](respondWithResult(_0x1bc20a,null))['catch'](handleError(_0x1bc20a,null));};exports['destroy']=function(_0x54ba44,_0x2280fd){return db['OpenchannelApplication']['find']({'where':{'id':_0x54ba44[_0x5503('0x41')]['id']}})[_0x5503('0x22')](handleEntityNotFound(_0x2280fd,null))['then'](removeEntity(_0x2280fd,null))[_0x5503('0x40')](handleError(_0x2280fd,null));};
\ No newline at end of file
+var _0x70ea=['keys','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','type','key','query'];(function(_0x100838,_0x394220){var _0x233119=function(_0x10c759){while(--_0x10c759){_0x100838['push'](_0x100838['shift']());}};_0x233119(++_0x394220);}(_0x70ea,0x1e7));var _0xa70e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x70ea[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa70e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa70e('0x1'));var moment=require(_0xa70e('0x2'));var BPromise=require(_0xa70e('0x3'));var Mustache=require(_0xa70e('0x4'));var util=require(_0xa70e('0x5'));var path=require(_0xa70e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa70e('0x7'));var fs=require('fs');var fs_extra=require(_0xa70e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa70e('0x9'));var deskjs=require(_0xa70e('0xa'));var toCsv=require(_0xa70e('0xb'));var querystring=require('querystring');var Papa=require(_0xa70e('0xc'));var Redis=require(_0xa70e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa70e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa70e('0xf'));var logger=require('../../config/logger')(_0xa70e('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa70e('0x11'))['db'];function respondWithStatusCode(_0x26a04e,_0x16ed38){_0x16ed38=_0x16ed38||0xcc;return function(_0x2df48d){if(_0x2df48d){return _0x26a04e[_0xa70e('0x12')](_0x16ed38);}return _0x26a04e['status'](_0x16ed38)[_0xa70e('0x13')]();};}function respondWithResult(_0xb04954,_0x331c56){_0x331c56=_0x331c56||0xc8;return function(_0x6790a0){if(_0x6790a0){return _0xb04954['status'](_0x331c56)[_0xa70e('0x14')](_0x6790a0);}};}function respondWithFilteredResult(_0x2a19f3,_0x1afa8c){return function(_0x42afd5){if(_0x42afd5){var _0x3f21ab=typeof _0x1afa8c['offset']===_0xa70e('0x15')&&typeof _0x1afa8c[_0xa70e('0x16')]==='undefined';var _0x3d926c=_0x42afd5[_0xa70e('0x17')];var _0x74937c=_0x3f21ab?0x0:_0x1afa8c[_0xa70e('0x18')];var _0xa71b76=_0x3f21ab?_0x42afd5[_0xa70e('0x17')]:_0x1afa8c[_0xa70e('0x18')]+_0x1afa8c[_0xa70e('0x16')];var _0x188335;if(_0xa71b76>=_0x3d926c){_0xa71b76=_0x3d926c;_0x188335=0xc8;}else{_0x188335=0xce;}_0x2a19f3[_0xa70e('0x19')](_0x188335);return _0x2a19f3['set'](_0xa70e('0x1a'),_0x74937c+'-'+_0xa71b76+'/'+_0x3d926c)[_0xa70e('0x14')](_0x42afd5);}return null;};}function patchUpdates(_0x5b2296){return function(_0xf686a2){try{jsonpatch['apply'](_0xf686a2,_0x5b2296,!![]);}catch(_0x564498){return BPromise[_0xa70e('0x1b')](_0x564498);}return _0xf686a2[_0xa70e('0x1c')]();};}function saveUpdates(_0x21c8d6,_0x56693d){return function(_0x47b6f6){if(_0x47b6f6){return _0x47b6f6['update'](_0x21c8d6)[_0xa70e('0x1d')](function(_0x32d017){return _0x32d017;});}return null;};}function removeEntity(_0x54beb5,_0x31357d){return function(_0x487a0d){if(_0x487a0d){return _0x487a0d[_0xa70e('0x1e')]()[_0xa70e('0x1d')](function(){_0x54beb5[_0xa70e('0x19')](0xcc)[_0xa70e('0x13')]();});}};}function handleEntityNotFound(_0x6031d6,_0x1b2264){return function(_0x4af7a9){if(!_0x4af7a9){_0x6031d6[_0xa70e('0x12')](0x194);}return _0x4af7a9;};}function handleError(_0x4a6e43,_0x452c81){_0x452c81=_0x452c81||0x1f4;return function(_0x22cc02){logger[_0xa70e('0x1f')](_0x22cc02[_0xa70e('0x20')]);if(_0x22cc02[_0xa70e('0x21')]){delete _0x22cc02['name'];}_0x4a6e43[_0xa70e('0x19')](_0x452c81)[_0xa70e('0x22')](_0x22cc02);};}exports[_0xa70e('0x23')]=function(_0x314d62,_0x1823f7){var _0x38d791={},_0x1fb83b={},_0x8049b3={'count':0x0,'rows':[]};var _0x198dbe=_[_0xa70e('0x24')](db[_0xa70e('0x25')]['rawAttributes'],function(_0x59fa67){return{'name':_0x59fa67['fieldName'],'type':_0x59fa67[_0xa70e('0x26')][_0xa70e('0x27')]};});_0x1fb83b['model']=_['map'](_0x198dbe,_0xa70e('0x21'));_0x1fb83b[_0xa70e('0x28')]=_[_0xa70e('0x29')](_0x314d62['query']);_0x1fb83b[_0xa70e('0x2a')]=_['intersection'](_0x1fb83b[_0xa70e('0x2b')],_0x1fb83b[_0xa70e('0x28')]);_0x38d791[_0xa70e('0x2c')]=_[_0xa70e('0x2d')](_0x1fb83b[_0xa70e('0x2b')],qs[_0xa70e('0x2e')](_0x314d62[_0xa70e('0x28')]['fields']));_0x38d791[_0xa70e('0x2c')]=_0x38d791[_0xa70e('0x2c')][_0xa70e('0x2f')]?_0x38d791[_0xa70e('0x2c')]:_0x1fb83b['model'];if(!_0x314d62[_0xa70e('0x28')]['hasOwnProperty'](_0xa70e('0x30'))){_0x38d791['limit']=qs[_0xa70e('0x16')](_0x314d62[_0xa70e('0x28')]['limit']);_0x38d791[_0xa70e('0x18')]=qs[_0xa70e('0x18')](_0x314d62[_0xa70e('0x28')]['offset']);}_0x38d791['order']=qs[_0xa70e('0x31')](_0x314d62[_0xa70e('0x28')][_0xa70e('0x31')]);_0x38d791[_0xa70e('0x32')]=qs[_0xa70e('0x2a')](_['pick'](_0x314d62[_0xa70e('0x28')],_0x1fb83b[_0xa70e('0x2a')]),_0x198dbe);if(_0x314d62[_0xa70e('0x28')][_0xa70e('0x33')]){_0x38d791[_0xa70e('0x32')]=_[_0xa70e('0x34')](_0x38d791['where'],{'$or':_[_0xa70e('0x24')](_0x198dbe,function(_0x3c89ef){if(_0x3c89ef[_0xa70e('0x26')]!=='VIRTUAL'){var _0x127fc0={};_0x127fc0[_0x3c89ef['name']]={'$like':'%'+_0x314d62['query']['filter']+'%'};return _0x127fc0;}})});}_0x38d791=_[_0xa70e('0x34')]({},_0x38d791,_0x314d62[_0xa70e('0x35')]);var _0x12abd7={'where':_0x38d791[_0xa70e('0x32')]};return db[_0xa70e('0x25')]['count'](_0x12abd7)[_0xa70e('0x1d')](function(_0x2156f5){_0x8049b3[_0xa70e('0x17')]=_0x2156f5;if(_0x314d62[_0xa70e('0x28')][_0xa70e('0x36')]){_0x38d791['include']=[{'all':!![]}];}return db[_0xa70e('0x25')][_0xa70e('0x37')](_0x38d791);})[_0xa70e('0x1d')](function(_0x4dd6fe){_0x8049b3[_0xa70e('0x38')]=_0x4dd6fe;return _0x8049b3;})['then'](respondWithFilteredResult(_0x1823f7,_0x38d791))[_0xa70e('0x39')](handleError(_0x1823f7,null));};exports[_0xa70e('0x3a')]=function(_0x43427c,_0x1c8102){var _0x43fb21={'raw':!![],'where':{'id':_0x43427c[_0xa70e('0x3b')]['id']}},_0x4be730={};_0x4be730[_0xa70e('0x2b')]=_[_0xa70e('0x29')](db[_0xa70e('0x25')][_0xa70e('0x3c')]);_0x4be730[_0xa70e('0x28')]=_['keys'](_0x43427c[_0xa70e('0x28')]);_0x4be730[_0xa70e('0x2a')]=_[_0xa70e('0x2d')](_0x4be730[_0xa70e('0x2b')],_0x4be730[_0xa70e('0x28')]);_0x43fb21[_0xa70e('0x2c')]=_[_0xa70e('0x2d')](_0x4be730[_0xa70e('0x2b')],qs[_0xa70e('0x2e')](_0x43427c[_0xa70e('0x28')][_0xa70e('0x2e')]));_0x43fb21[_0xa70e('0x2c')]=_0x43fb21['attributes'][_0xa70e('0x2f')]?_0x43fb21[_0xa70e('0x2c')]:_0x4be730[_0xa70e('0x2b')];if(_0x43427c[_0xa70e('0x28')][_0xa70e('0x36')]){_0x43fb21[_0xa70e('0x3d')]=[{'all':!![]}];}_0x43fb21=_[_0xa70e('0x34')]({},_0x43fb21,_0x43427c[_0xa70e('0x35')]);return db[_0xa70e('0x25')][_0xa70e('0x3e')](_0x43fb21)['then'](handleEntityNotFound(_0x1c8102,null))[_0xa70e('0x1d')](respondWithResult(_0x1c8102,null))[_0xa70e('0x39')](handleError(_0x1c8102,null));};exports[_0xa70e('0x3f')]=function(_0x30871a,_0x5303c5){return db[_0xa70e('0x25')][_0xa70e('0x3f')](_0x30871a[_0xa70e('0x40')],{})[_0xa70e('0x1d')](respondWithResult(_0x5303c5,0xc9))[_0xa70e('0x39')](handleError(_0x5303c5,null));};exports[_0xa70e('0x41')]=function(_0x570f66,_0x37a732){if(_0x570f66['body']['id']){delete _0x570f66[_0xa70e('0x40')]['id'];}return db[_0xa70e('0x25')][_0xa70e('0x3e')]({'where':{'id':_0x570f66['params']['id']}})[_0xa70e('0x1d')](handleEntityNotFound(_0x37a732,null))[_0xa70e('0x1d')](saveUpdates(_0x570f66[_0xa70e('0x40')],null))['then'](respondWithResult(_0x37a732,null))[_0xa70e('0x39')](handleError(_0x37a732,null));};exports[_0xa70e('0x1e')]=function(_0x546f2f,_0x32bc3d){return db['OpenchannelApplication'][_0xa70e('0x3e')]({'where':{'id':_0x546f2f['params']['id']}})[_0xa70e('0x1d')](handleEntityNotFound(_0x32bc3d,null))[_0xa70e('0x1d')](removeEntity(_0x32bc3d,null))[_0xa70e('0x39')](handleError(_0x32bc3d,null));};
\ No newline at end of file
index 6bc0813..a8c3f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc3d=['moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x304429,_0x5c956f){var _0x26a77f=function(_0xe50d9d){while(--_0xe50d9d){_0x304429['push'](_0x304429['shift']());}};_0x26a77f(++_0x5c956f);}(_0xcc3d,0x1d8));var _0xdcc3=function(_0x2e57e2,_0x2b42d8){_0x2e57e2=_0x2e57e2-0x0;var _0x53b74e=_0xcc3d[_0x2e57e2];return _0x53b74e;};'use strict';var _=require(_0xdcc3('0x0'));var util=require(_0xdcc3('0x1'));var logger=require(_0xdcc3('0x2'))(_0xdcc3('0x3'));var moment=require(_0xdcc3('0x4'));var BPromise=require(_0xdcc3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcc3('0x6'));var rimraf=require(_0xdcc3('0x7'));var config=require(_0xdcc3('0x8'));var attributes=require(_0xdcc3('0x9'));module[_0xdcc3('0xa')]=function(_0x4aa9f0,_0x56b5ab){return _0x4aa9f0[_0xdcc3('0xb')](_0xdcc3('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdcc3('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd383=['../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd383,0x116));var _0x3d38=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xd383[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x3d38('0x0'));var util=require('util');var logger=require(_0x3d38('0x1'))(_0x3d38('0x2'));var moment=require(_0x3d38('0x3'));var BPromise=require(_0x3d38('0x4'));var rp=require(_0x3d38('0x5'));var fs=require('fs');var path=require(_0x3d38('0x6'));var rimraf=require(_0x3d38('0x7'));var config=require(_0x3d38('0x8'));var attributes=require(_0x3d38('0x9'));module['exports']=function(_0xe3885d,_0x2efbf0){return _0xe3885d[_0x3d38('0xa')](_0x3d38('0xb'),attributes,{'tableName':_0x3d38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index a62f858..2c32498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4626=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','update','body','options','raw','where','limit','then','UpdateOpenchannelApplication'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4626,0x1dc));var _0x6462=function(_0x1d6a86,_0x5602b5){_0x1d6a86=_0x1d6a86-0x0;var _0x47008a=_0x4626[_0x1d6a86];return _0x47008a;};'use strict';var _=require(_0x6462('0x0'));var util=require('util');var moment=require(_0x6462('0x1'));var BPromise=require('bluebird');var rs=require(_0x6462('0x2'));var fs=require('fs');var Redis=require(_0x6462('0x3'));var db=require(_0x6462('0x4'))['db'];var utils=require(_0x6462('0x5'));var logger=require(_0x6462('0x6'))(_0x6462('0x7'));var config=require(_0x6462('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6462('0x9')][_0x6462('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b53c5,_0x2e1581,_0x50a974){return new BPromise(function(_0x422160,_0x595324){return client[_0x6462('0xb')](_0x5b53c5,_0x50a974)['then'](function(_0x5b9d95){logger[_0x6462('0xc')](_0x6462('0xd'),_0x2e1581,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2e1581,_0x6462('0xe'),JSON[_0x6462('0xf')](_0x5b9d95));if(_0x5b9d95[_0x6462('0x10')]){if(_0x5b9d95[_0x6462('0x10')][_0x6462('0x11')]===0x1f4){logger[_0x6462('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x2e1581,_0x5b9d95[_0x6462('0x10')][_0x6462('0x12')]);return _0x595324(_0x5b9d95[_0x6462('0x10')][_0x6462('0x12')]);}logger['error'](_0x6462('0xd'),_0x2e1581,_0x5b9d95[_0x6462('0x10')][_0x6462('0x12')]);return _0x422160(_0x5b9d95['error']['message']);}else{logger[_0x6462('0xc')](_0x6462('0xd'),_0x2e1581,'request\x20sent');_0x422160(_0x5b9d95['result'][_0x6462('0x12')]);}})[_0x6462('0x13')](function(_0x43c618){logger['error'](_0x6462('0xd'),_0x2e1581,_0x43c618);_0x595324(_0x43c618);});});}exports['UpdateOpenchannelApplication']=function(_0x3e03d2){var _0x5e4a1d=this;return new Promise(function(_0x286a7a,_0x1ce21c){return db['OpenchannelApplication'][_0x6462('0x14')](_0x3e03d2[_0x6462('0x15')],{'raw':_0x3e03d2[_0x6462('0x16')]?_0x3e03d2[_0x6462('0x16')][_0x6462('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e03d2[_0x6462('0x16')]?_0x3e03d2[_0x6462('0x16')][_0x6462('0x18')]||null:null,'attributes':_0x3e03d2[_0x6462('0x16')]?_0x3e03d2[_0x6462('0x16')]['attributes']||null:null,'limit':_0x3e03d2[_0x6462('0x16')]?_0x3e03d2[_0x6462('0x16')][_0x6462('0x19')]||null:null})[_0x6462('0x1a')](function(_0x1556c2){logger[_0x6462('0xc')]('UpdateOpenchannelApplication',_0x3e03d2);logger['debug'](_0x6462('0x1b'),_0x3e03d2,JSON['stringify'](_0x1556c2));_0x286a7a(_0x1556c2);})[_0x6462('0x13')](function(_0x46bec6){logger[_0x6462('0x10')]('UpdateOpenchannelApplication',_0x46bec6[_0x6462('0x12')],_0x3e03d2);_0x1ce21c(_0x5e4a1d[_0x6462('0x10')](0x1f4,_0x46bec6[_0x6462('0x12')]));});});};
\ No newline at end of file
+var _0x711e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','OpenchannelApplication','update','body','raw','options','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util','bluebird','randomstring'];(function(_0x28effd,_0xb8c371){var _0x3aba88=function(_0x421465){while(--_0x421465){_0x28effd['push'](_0x28effd['shift']());}};_0x3aba88(++_0xb8c371);}(_0x711e,0x9c));var _0xe711=function(_0x3671e1,_0x2332ef){_0x3671e1=_0x3671e1-0x0;var _0xd6b3e=_0x711e[_0x3671e1];return _0xd6b3e;};'use strict';var _=require(_0xe711('0x0'));var util=require(_0xe711('0x1'));var moment=require('moment');var BPromise=require(_0xe711('0x2'));var rs=require(_0xe711('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe711('0x4'))['db'];var utils=require(_0xe711('0x5'));var logger=require(_0xe711('0x6'))(_0xe711('0x7'));var config=require(_0xe711('0x8'));var jayson=require(_0xe711('0x9'));var client=jayson[_0xe711('0xa')][_0xe711('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce29b,_0xd6337a,_0xb75bb){return new BPromise(function(_0x5d1ffb,_0xddc62b){return client[_0xe711('0xc')](_0x5ce29b,_0xb75bb)[_0xe711('0xd')](function(_0x3751c1){logger[_0xe711('0xe')](_0xe711('0xf'),_0xd6337a,_0xe711('0x10'));logger[_0xe711('0x11')](_0xe711('0x12'),_0xd6337a,_0xe711('0x10'),JSON['stringify'](_0x3751c1));if(_0x3751c1['error']){if(_0x3751c1[_0xe711('0x13')][_0xe711('0x14')]===0x1f4){logger[_0xe711('0x13')](_0xe711('0xf'),_0xd6337a,_0x3751c1['error']['message']);return _0xddc62b(_0x3751c1[_0xe711('0x13')][_0xe711('0x15')]);}logger[_0xe711('0x13')](_0xe711('0xf'),_0xd6337a,_0x3751c1[_0xe711('0x13')][_0xe711('0x15')]);return _0x5d1ffb(_0x3751c1[_0xe711('0x13')][_0xe711('0x15')]);}else{logger[_0xe711('0xe')](_0xe711('0xf'),_0xd6337a,'request\x20sent');_0x5d1ffb(_0x3751c1[_0xe711('0x16')][_0xe711('0x15')]);}})['catch'](function(_0x2796c0){logger[_0xe711('0x13')](_0xe711('0xf'),_0xd6337a,_0x2796c0);_0xddc62b(_0x2796c0);});});}exports['UpdateOpenchannelApplication']=function(_0x38fd27){var _0x190835=this;return new Promise(function(_0x4974ad,_0x46df48){return db[_0xe711('0x17')][_0xe711('0x18')](_0x38fd27[_0xe711('0x19')],{'raw':_0x38fd27['options']?_0x38fd27['options'][_0xe711('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38fd27[_0xe711('0x1b')]?_0x38fd27[_0xe711('0x1b')]['where']||null:null,'attributes':_0x38fd27[_0xe711('0x1b')]?_0x38fd27['options'][_0xe711('0x1c')]||null:null,'limit':_0x38fd27[_0xe711('0x1b')]?_0x38fd27['options'][_0xe711('0x1d')]||null:null})[_0xe711('0xd')](function(_0xedf186){logger[_0xe711('0xe')]('UpdateOpenchannelApplication',_0x38fd27);logger[_0xe711('0x11')](_0xe711('0x1e'),_0x38fd27,JSON['stringify'](_0xedf186));_0x4974ad(_0xedf186);})[_0xe711('0x1f')](function(_0x1ba207){logger[_0xe711('0x13')](_0xe711('0x1e'),_0x1ba207[_0xe711('0x15')],_0x38fd27);_0x46df48(_0x190835[_0xe711('0x13')](0x1f4,_0x1ba207[_0xe711('0x15')]));});});};
\ No newline at end of file
index 4a99590..eecce75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0a=['openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/:id','show','/:id/messages','download','post','create','addMessage'];(function(_0x10e21a,_0x532e1b){var _0x1912ee=function(_0x34ad8e){while(--_0x34ad8e){_0x10e21a['push'](_0x10e21a['shift']());}};_0x1912ee(++_0x532e1b);}(_0x3c0a,0xba));var _0xa3c0=function(_0x3e28bf,_0x29fd37){_0x3e28bf=_0x3e28bf-0x0;var _0x178107=_0x3c0a[_0x3e28bf];return _0x178107;};'use strict';var multer=require(_0xa3c0('0x0'));var util=require(_0xa3c0('0x1'));var path=require('path');var timeout=require(_0xa3c0('0x2'));var express=require(_0xa3c0('0x3'));var router=express['Router']();var fs_extra=require(_0xa3c0('0x4'));var auth=require(_0xa3c0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3c0('0x6'));var controller=require(_0xa3c0('0x7'));router[_0xa3c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xa3c0('0x9')](),controller['describe']);router[_0xa3c0('0x8')](_0xa3c0('0xa'),auth[_0xa3c0('0x9')](),controller[_0xa3c0('0xb')]);router['get'](_0xa3c0('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xa3c0('0x8')]('/:id/download',auth[_0xa3c0('0x9')](),controller[_0xa3c0('0xd')]);router[_0xa3c0('0xe')]('/',auth['isAuthenticated'](),controller[_0xa3c0('0xf')]);router[_0xa3c0('0xe')]('/:id/messages',auth[_0xa3c0('0x9')](),controller[_0xa3c0('0x10')]);router[_0xa3c0('0xe')]('/:id/tags',auth[_0xa3c0('0x9')](),interaction['tracked'](_0xa3c0('0x11'),_0xa3c0('0x12')),controller[_0xa3c0('0x13')]);router[_0xa3c0('0x14')](_0xa3c0('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0xa3c0('0x11'),_0xa3c0('0x15')),controller[_0xa3c0('0x16')]);router[_0xa3c0('0x17')](_0xa3c0('0xa'),auth[_0xa3c0('0x9')](),interaction['tracked']('openchannel',_0xa3c0('0x18')),controller[_0xa3c0('0x19')]);router[_0xa3c0('0x17')](_0xa3c0('0x1a'),auth['isAuthenticated'](),controller[_0xa3c0('0x1b')]);module[_0xa3c0('0x1c')]=router;
\ No newline at end of file
+var _0xee52=['download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download'];(function(_0x1c6b1e,_0x86bb49){var _0x3b548f=function(_0x5f09a0){while(--_0x5f09a0){_0x1c6b1e['push'](_0x1c6b1e['shift']());}};_0x3b548f(++_0x86bb49);}(_0xee52,0x19b));var _0x2ee5=function(_0x4eb72c,_0x1b482f){_0x4eb72c=_0x4eb72c-0x0;var _0x1c8dca=_0xee52[_0x4eb72c];return _0x1c8dca;};'use strict';var multer=require('multer');var util=require(_0x2ee5('0x0'));var path=require(_0x2ee5('0x1'));var timeout=require(_0x2ee5('0x2'));var express=require(_0x2ee5('0x3'));var router=express[_0x2ee5('0x4')]();var fs_extra=require(_0x2ee5('0x5'));var auth=require(_0x2ee5('0x6'));var interaction=require(_0x2ee5('0x7'));var config=require(_0x2ee5('0x8'));var controller=require(_0x2ee5('0x9'));router[_0x2ee5('0xa')]('/',auth[_0x2ee5('0xb')](),controller[_0x2ee5('0xc')]);router[_0x2ee5('0xa')]('/describe',auth[_0x2ee5('0xb')](),controller[_0x2ee5('0xd')]);router[_0x2ee5('0xa')](_0x2ee5('0xe'),auth[_0x2ee5('0xb')](),controller[_0x2ee5('0xf')]);router[_0x2ee5('0xa')](_0x2ee5('0x10'),auth[_0x2ee5('0xb')](),controller['getMessages']);router['get'](_0x2ee5('0x11'),auth[_0x2ee5('0xb')](),controller[_0x2ee5('0x12')]);router['post']('/',auth[_0x2ee5('0xb')](),controller[_0x2ee5('0x13')]);router[_0x2ee5('0x14')](_0x2ee5('0x10'),auth[_0x2ee5('0xb')](),controller[_0x2ee5('0x15')]);router[_0x2ee5('0x14')](_0x2ee5('0x16'),auth[_0x2ee5('0xb')](),interaction[_0x2ee5('0x17')](_0x2ee5('0x18'),_0x2ee5('0x19')),controller[_0x2ee5('0x1a')]);router['put'](_0x2ee5('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x2ee5('0x18'),_0x2ee5('0x1b')),controller[_0x2ee5('0x1c')]);router[_0x2ee5('0x1d')](_0x2ee5('0xe'),auth[_0x2ee5('0xb')](),interaction[_0x2ee5('0x17')]('openchannel',_0x2ee5('0x1e')),controller['destroy']);router[_0x2ee5('0x1d')](_0x2ee5('0x16'),auth['isAuthenticated'](),controller[_0x2ee5('0x1f')]);module[_0x2ee5('0x20')]=router;
\ No newline at end of file
index 10c2786..aa9b031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e9=['sequelize','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x52e28a,_0x4d180b){var _0x3737d5=function(_0x4cc60d){while(--_0x4cc60d){_0x52e28a['push'](_0x52e28a['shift']());}};_0x3737d5(++_0x4d180b);}(_0x58e9,0x15e));var _0x958e=function(_0x4e5f55,_0x1464a7){_0x4e5f55=_0x4e5f55-0x0;var _0x522ae6=_0x58e9[_0x4e5f55];return _0x522ae6;};'use strict';var Sequelize=require(_0x958e('0x0'));module[_0x958e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x958e('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x958e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x958e('0x3')]},'note':{'type':Sequelize[_0x958e('0x3')]},'read1stAt':{'type':Sequelize[_0x958e('0x2')]},'threadId':{'type':Sequelize[_0x958e('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x958e('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x958e('0x4')]('in',_0x958e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x958e('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1fdc=['exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x47ed1,_0x2e8365){var _0x28c5f1=function(_0x3af310){while(--_0x3af310){_0x47ed1['push'](_0x47ed1['shift']());}};_0x28c5f1(++_0x2e8365);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x1fdc[_0x4e8286];return _0x44a440;};'use strict';var Sequelize=require(_0xc1fd('0x0'));module[_0xc1fd('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc1fd('0x2')]},'disposition':{'type':Sequelize[_0xc1fd('0x3')]},'secondDisposition':{'type':Sequelize[_0xc1fd('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc1fd('0x3')]},'note':{'type':Sequelize[_0xc1fd('0x3')]},'read1stAt':{'type':Sequelize[_0xc1fd('0x2')]},'threadId':{'type':Sequelize[_0xc1fd('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xc1fd('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc1fd('0x4')]('in',_0xc1fd('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc1fd('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xc1fd('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 6cbbbe7..caa1451 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4764=['zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','json','update','destroy','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','then','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','having','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','push','all','rows','show','params','include','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','merge','includeAll','findAll','setTags','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','lastName','Attachment','Messages','Account','Owner','mkdirSync','Openchannel','N.A.','closed','Public','Private','basename','createReadStream','pipe','createWriteStream','direction','out','System','firstName','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x4764,0x1d0));var _0x4476=function(_0x349835,_0x1cbe17){_0x349835=_0x349835-0x0;var _0x3f2547=_0x4764[_0x349835];return _0x3f2547;};'use strict';var emlformat=require(_0x4476('0x0'));var rimraf=require(_0x4476('0x1'));var zipdir=require(_0x4476('0x2'));var jsonpatch=require(_0x4476('0x3'));var rp=require(_0x4476('0x4'));var moment=require(_0x4476('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4476('0x6'));var ejs=require(_0x4476('0x7'));var fs=require('fs');var fs_extra=require(_0x4476('0x8'));var _=require(_0x4476('0x9'));var squel=require('squel');var crypto=require(_0x4476('0xa'));var jsforce=require(_0x4476('0xb'));var deskjs=require(_0x4476('0xc'));var toCsv=require(_0x4476('0x6'));var querystring=require(_0x4476('0xd'));var Papa=require(_0x4476('0xe'));var Redis=require(_0x4476('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4476('0x10'));var as=require(_0x4476('0x11'));var pdf=require(_0x4476('0x12'));var hardwareService=require(_0x4476('0x13'));var logger=require(_0x4476('0x14'))(_0x4476('0x15'));var utils=require(_0x4476('0x16'));var config=require(_0x4476('0x17'));var licenseUtil=require(_0x4476('0x18'));var db=require('../../mysqldb')['db'];config[_0x4476('0x19')]=_[_0x4476('0x1a')](config[_0x4476('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4476('0x1b'))(new Redis(config[_0x4476('0x19')]));require(_0x4476('0x1c'))[_0x4476('0x1d')](socket);function respondWithStatusCode(_0x22ee0f,_0x29e6a4){_0x29e6a4=_0x29e6a4||0xcc;return function(_0x35a669){if(_0x35a669){return _0x22ee0f['sendStatus'](_0x29e6a4);}return _0x22ee0f[_0x4476('0x1e')](_0x29e6a4)[_0x4476('0x1f')]();};}function respondWithResult(_0x5b74a2,_0x3b20e7){_0x3b20e7=_0x3b20e7||0xc8;return function(_0x372546){if(_0x372546){return _0x5b74a2[_0x4476('0x1e')](_0x3b20e7)['json'](_0x372546);}};}function respondWithFilteredResult(_0x5de5c4,_0x57d4d0){return function(_0x54ec24){if(_0x54ec24){var _0x18517d=typeof _0x57d4d0[_0x4476('0x20')]==='undefined'&&typeof _0x57d4d0[_0x4476('0x21')]===_0x4476('0x22');var _0x29b3a1=_0x54ec24[_0x4476('0x23')];var _0x10c28c=_0x18517d?0x0:_0x57d4d0[_0x4476('0x20')];var _0x55fee3=_0x18517d?_0x54ec24[_0x4476('0x23')]:_0x57d4d0[_0x4476('0x20')]+_0x57d4d0['limit'];var _0x21fc15;if(_0x55fee3>=_0x29b3a1){_0x55fee3=_0x29b3a1;_0x21fc15=0xc8;}else{_0x21fc15=0xce;}_0x5de5c4[_0x4476('0x1e')](_0x21fc15);return _0x5de5c4[_0x4476('0x24')](_0x4476('0x25'),_0x10c28c+'-'+_0x55fee3+'/'+_0x29b3a1)[_0x4476('0x26')](_0x54ec24);}return null;};}function patchUpdates(_0x8f402e){return function(_0x57ce3c){try{jsonpatch['apply'](_0x57ce3c,_0x8f402e,!![]);}catch(_0x2fa584){return BPromise['reject'](_0x2fa584);}return _0x57ce3c['save']();};}function saveUpdates(_0x3decef,_0x5c2209){return function(_0x279043){if(_0x279043){return _0x279043[_0x4476('0x27')](_0x3decef)['then'](function(_0x450064){return _0x450064;});}return null;};}function removeEntity(_0x436a96,_0x584550){return function(_0x2571e7){if(_0x2571e7){return _0x2571e7[_0x4476('0x28')]()['then'](function(){_0x436a96[_0x4476('0x1e')](0xcc)[_0x4476('0x1f')]();});}};}function handleEntityNotFound(_0x1b145d,_0x33c42d){return function(_0x32bb6e){if(!_0x32bb6e){_0x1b145d[_0x4476('0x29')](0x194);}return _0x32bb6e;};}function handleError(_0x5d2721,_0x433113){_0x433113=_0x433113||0x1f4;return function(_0x21b4d8){logger[_0x4476('0x2a')](_0x21b4d8[_0x4476('0x2b')]);if(_0x21b4d8['name']){delete _0x21b4d8[_0x4476('0x2c')];}_0x5d2721[_0x4476('0x1e')](_0x433113)[_0x4476('0x2d')](_0x21b4d8);};}function getInteractionUsers(_0xbe319e,_0x269fe4){return new BPromise(function(_0x1546f7,_0x422d8e){try{if(_0x269fe4[_0xbe319e['id']]){_0xbe319e[_0x4476('0x2e')]=_[_0x4476('0x2f')](_0x269fe4[_0xbe319e['id']],function(_0x1e714e){return{'id':_0x1e714e['id'],'fullname':_0x1e714e[_0x4476('0x30')]};});}}catch(_0x4fd3f1){_0x422d8e(_0x4fd3f1);}_0x1546f7(_0xbe319e);});}function getInteractionTags(_0x300ff0,_0x50b750){return new BPromise(function(_0x2c2a5c,_0x33eb42){try{if(_0x300ff0['TagIds']){_0x300ff0[_0x4476('0x31')]=[];_0x300ff0['TagIds']['split'](',')['forEach'](function(_0x3004dd){_0x300ff0[_0x4476('0x31')]['push'](_0x50b750[_0x3004dd]);});}delete _0x300ff0[_0x4476('0x32')];}catch(_0x1079b9){_0x33eb42(_0x1079b9);}_0x2c2a5c(_0x300ff0);});}function updateOpenchannelInteraction(_0x5eeddf,_0x240212,_0x202b10){return new BPromise(function(_0x16c9d7,_0x4a8f25){return getInteractionUsers(_0x5eeddf,_0x202b10)[_0x4476('0x33')](function(_0x39b463){return getInteractionTags(_0x39b463,_0x240212);})['then'](function(_0x236f54){_0x16c9d7(_0x236f54);})[_0x4476('0x34')](function(_0x25c351){_0x4a8f25(_0x25c351);});});}exports[_0x4476('0x35')]=function(_0x2e9e25,_0x5cf996){var _0x66135d={},_0xa8803f={},_0x380a8a={'count':0x0,'rows':[]};var _0x336fb5=_[_0x4476('0x2f')](db[_0x4476('0x36')][_0x4476('0x37')],function(_0x3c3335){return{'name':_0x3c3335[_0x4476('0x38')],'type':_0x3c3335[_0x4476('0x39')][_0x4476('0x3a')]};});_0xa8803f[_0x4476('0x3b')]=_[_0x4476('0x2f')](_0x336fb5,_0x4476('0x2c'));_0xa8803f[_0x4476('0x3c')]=_[_0x4476('0x3d')](_0x2e9e25[_0x4476('0x3c')]);_0xa8803f['filters']=_[_0x4476('0x3e')](_0xa8803f[_0x4476('0x3b')],_0xa8803f[_0x4476('0x3c')]);_0x66135d[_0x4476('0x3f')]=_['intersection'](_0xa8803f[_0x4476('0x3b')],qs[_0x4476('0x40')](_0x2e9e25['query'][_0x4476('0x40')]));_0x66135d[_0x4476('0x3f')]=_0x66135d[_0x4476('0x3f')][_0x4476('0x41')]?_0x66135d[_0x4476('0x3f')]:_0xa8803f['model'];if(!_0x2e9e25[_0x4476('0x3c')][_0x4476('0x42')](_0x4476('0x43'))){_0x66135d[_0x4476('0x21')]=qs['limit'](_0x2e9e25[_0x4476('0x3c')][_0x4476('0x21')]);_0x66135d[_0x4476('0x20')]=qs[_0x4476('0x20')](_0x2e9e25[_0x4476('0x3c')][_0x4476('0x20')]);}_0x66135d[_0x4476('0x44')]=qs[_0x4476('0x45')](_0x2e9e25[_0x4476('0x3c')]['sort']);_0x66135d[_0x4476('0x46')]=qs[_0x4476('0x47')](_[_0x4476('0x48')](_0x2e9e25[_0x4476('0x3c')],_0xa8803f[_0x4476('0x47')]),_0x336fb5);var _0x2d082c=[];var _0x4a2741=squel[_0x4476('0x49')]()[_0x4476('0x4a')]('id')[_0x4476('0x4a')](_0x4476('0x2c'))[_0x4476('0x4a')](_0x4476('0x4b'))[_0x4476('0x4c')](_0x4476('0x4d'));var _0x281a92=squel['select']()[_0x4476('0x4a')]('u.id')['field'](_0x4476('0x4e'))['field'](_0x4476('0x4f'))['from']('user_has_openchannel_interactions','ui')['left_join']('users','u',_0x4476('0x50'));var _0x29f23c=squel[_0x4476('0x49')]()[_0x4476('0x4c')](_0x4476('0x51'),'i')[_0x4476('0x52')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x4476('0x53'))[_0x4476('0x52')](_0x4476('0x54'),'a',_0x4476('0x55'))[_0x4476('0x52')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x4476('0x52')](_0x4476('0x56'),'it',_0x4476('0x57'))[_0x4476('0x52')]('tools_tags','t',_0x4476('0x58'));var _0x9e96e2=squel[_0x4476('0x59')]();var _0x80fda4=[];var _0x562efa=squel[_0x4476('0x59')]();var _0x1bda8d;if(_0x2e9e25[_0x4476('0x3c')][_0x4476('0x5a')]){_0x1bda8d=as[_0x4476('0x5b')](_0x2e9e25[_0x4476('0x3c')][_0x4476('0x5a')]);var _0x3dd9be=_0x1bda8d[_0x4476('0x5c')];for(var _0x35b174=0x0;_0x35b174<_0x1bda8d['conditions'][_0x4476('0x41')];_0x35b174++){var _0xa88fe3=_0x1bda8d['conditions'][_0x35b174];var _0x1a6eae='i';var _0x4671e=_[_0x4476('0x5d')](_0x336fb5,[_0x4476('0x2c'),_0xa88fe3['field']]);if(!_0x4671e){switch(_0xa88fe3['field']){case _0x4476('0x5e'):if(_0xa88fe3[_0x4476('0x5f')]==0x1){_0x29f23c[_0x4476('0x60')]('`'+_0xa88fe3[_0x4476('0x4a')]+'`\x20=\x200');}else{_0x29f23c[_0x4476('0x60')]('`'+_0xa88fe3[_0x4476('0x4a')]+'`\x20>\x200');}break;case'Contact':if(_0xa88fe3[_0x4476('0x61')]===_0x4476('0x62')){if(_0xa88fe3['value'][_0x4476('0x63')]('\x20')[_0x4476('0x41')]>0x1){_0x9e96e2[_0x3dd9be](_0x4476('0x64'),qs[_0x4476('0x65')](_0xa88fe3[_0x4476('0x5f')]),null);}else{var _0x155de4='%'+_0xa88fe3['value']+'%';_0x9e96e2[_0x3dd9be](_0x4476('0x66'),_0x155de4,_0x155de4,_0x155de4);}}else{_0x4671e=_[_0x4476('0x5d')](_0x336fb5,[_0x4476('0x2c'),_0x4476('0x67')]);_0xa88fe3[_0x4476('0x4a')]=_0x4476('0x67');_0x2128b0=as['buildExpression'](_0x1a6eae,_0x4671e['type'],_0xa88fe3);_0x9e96e2[_0x3dd9be](_0x2128b0[_0x4476('0x68')],_0x2128b0['value'][_0x4476('0x69')],_0x2128b0[_0x4476('0x5f')][_0x4476('0x1f')]);}break;case _0x4476('0x6a'):var _0x1d69ba=_0xa88fe3['value'][_0x4476('0x63')](',')[_0x4476('0x2f')](function(_0x5d8761){return Number(_0x5d8761);});_0x1d69ba[_0x4476('0x6b')](function(_0x33c8d8){_0x562efa['or'](_0x4476('0x6c'),'%,'+_0x33c8d8+',%');});_0x80fda4=_['union'](_0x80fda4,_0x1d69ba);break;case _0x4476('0x6d'):if(_0xa88fe3['operator']===_0x4476('0x62')){_0x9e96e2[_0x3dd9be](_0x4476('0x6e'),'%'+_0xa88fe3[_0x4476('0x5f')]+'%',null);}else{_0x4671e=_[_0x4476('0x5d')](_0x336fb5,['name','UserId']);_0xa88fe3['field']=_0x4476('0x6f');_0x2128b0=as['buildExpression'](_0x1a6eae,_0x4671e[_0x4476('0x39')],_0xa88fe3);_0x9e96e2[_0x3dd9be](_0x2128b0[_0x4476('0x68')],_0x2128b0['value'][_0x4476('0x69')],_0x2128b0[_0x4476('0x5f')]['end']);}break;case _0x4476('0x70'):_0x2128b0=as[_0x4476('0x71')]('me',null,_0xa88fe3);_0x9e96e2[_0x3dd9be](_0x2128b0['text'],_0x2128b0[_0x4476('0x5f')][_0x4476('0x69')],_0x2128b0['value'][_0x4476('0x1f')]);break;}}else{var _0x2128b0=as[_0x4476('0x71')](_0x1a6eae,_0x4671e[_0x4476('0x39')],_0xa88fe3);_0x9e96e2[_0x3dd9be](_0x2128b0[_0x4476('0x68')],_0x2128b0[_0x4476('0x5f')][_0x4476('0x69')],_0x2128b0[_0x4476('0x5f')][_0x4476('0x1f')]);}}}else{var _0x1a891c=_(_0x2e9e25[_0x4476('0x3c')])[_0x4476('0x3d')]()[_0x4476('0x2f')](function(_0x23691f){return _[_0x4476('0x72')](_0x336fb5,[_0x4476('0x2c'),_0x23691f])?_0x23691f:undefined;})[_0x4476('0x73')]()['value']();if(!_[_0x4476('0x74')](_0x1a891c)){_0x1a891c[_0x4476('0x6b')](function(_0xb62a6f){if(_0xb62a6f===_0x4476('0x75')){_0x29f23c[_0x4476('0x46')](_0x4476('0x76'),[][_0x4476('0x77')](_0x2e9e25['query'][_0xb62a6f]));}else if(_0xb62a6f===_0x4476('0x78')){var _0x4fd03d=JSON[_0x4476('0x79')](_0x2e9e25[_0x4476('0x3c')][_0xb62a6f])[_0x4476('0x7a')];var _0x1a2816=JSON[_0x4476('0x79')](_0x2e9e25['query'][_0xb62a6f])[_0x4476('0x7b')];_0x29f23c[_0x4476('0x46')](_0x4476('0x7c'),_0x4fd03d,_0x1a2816);}else{if(_0x2e9e25[_0x4476('0x3c')][_0xb62a6f]===_0x4476('0x7d')){_0x29f23c[_0x4476('0x46')]('i.'+_0xb62a6f+'\x20IS\x20NULL');}else{_0x29f23c[_0x4476('0x46')]('i.'+_0xb62a6f+_0x4476('0x7e'),_0x2e9e25[_0x4476('0x3c')][_0xb62a6f]);}}});}if(_0x2e9e25[_0x4476('0x3c')]['read']){if(_0x2e9e25['query'][_0x4476('0x7f')]==0x1){_0x29f23c[_0x4476('0x60')](_0x4476('0x80'));}else{_0x29f23c[_0x4476('0x60')](_0x4476('0x81'));}}if(_0x2e9e25[_0x4476('0x3c')][_0x4476('0x82')]){_0x80fda4=_['isArray'](_0x2e9e25['query'][_0x4476('0x82')])?_0x2e9e25[_0x4476('0x3c')][_0x4476('0x82')]:new Array(_0x2e9e25[_0x4476('0x3c')][_0x4476('0x82')]);_0x80fda4['forEach'](function(_0x2f0db1){_0x562efa['or'](_0x4476('0x6c'),'%,'+_0x2f0db1+',%');});}if(_0x2e9e25[_0x4476('0x3c')][_0x4476('0x83')]){var _0x4e82b9=_0x2e9e25['query']['filter'][_0x4476('0x84')]('\x5c','\x5c\x5c')[_0x4476('0x84')](/'/g,'\x27\x27');if(qs[_0x4476('0x85')](_0x4e82b9)){_0x9e96e2['or'](_0x4476('0x86'),_0x4e82b9+'%');}else{_0x9e96e2['or'](_0x4476('0x87'),qs[_0x4476('0x65')](_0x4e82b9))['or'](_0x4476('0x88'),_0x4e82b9+'%')['or'](_0x4476('0x89'),_0x4e82b9+'%');}}}_0x29f23c[_0x4476('0x46')](_0x9e96e2);_0x29f23c[_0x4476('0x8a')]('i.id');var _0x26c3dd={'type':db[_0x4476('0x8b')][_0x4476('0x8c')][_0x4476('0x8d')],'raw':!![]};var _0x5d5db0=_0x29f23c['clone']();_0x5d5db0[_0x4476('0x4a')](_0x4476('0x8e'));_0x5d5db0[_0x4476('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4476('0x5e'));if(_0x66135d[_0x4476('0x44')]){_0x66135d[_0x4476('0x44')]['forEach'](function(_0x16a444){var _0x5c4b79=_0x16a444[0x0]===_0x4476('0x8f')?_0x16a444[0x0]:'i.'+_0x16a444[0x0];_0x29f23c[_0x4476('0x44')](_0x5c4b79,_0x16a444[0x1]===_0x4476('0x90')?![]:!![]);});}if(!_[_0x4476('0x74')](_0x80fda4)){_0x29f23c[_0x4476('0x60')](_0x562efa);_0x5d5db0[_0x4476('0x46')](_0x4476('0x91'),_0x80fda4);}BPromise[_0x4476('0x92')]()[_0x4476('0x33')](function(){if(!_0x1bda8d){if(_0x2e9e25['query'][_0x4476('0x75')])return;_0x5d5db0['where'](_0x4476('0x93'));_0x29f23c[_0x4476('0x46')](_0x4476('0x93'));return;}if(_0x2e9e25[_0x4476('0x94')][_0x4476('0x95')]!=='agent')return;return _0x2e9e25[_0x4476('0x94')][_0x4476('0x96')]({'attributes':['id'],'raw':!![]})[_0x4476('0x33')](function(_0x238653){if(_[_0x4476('0x74')](_0x238653)){_0x5d5db0[_0x4476('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x29f23c['where'](_0x4476('0x97'));}else{_0x5d5db0[_0x4476('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x238653,'id'));_0x29f23c[_0x4476('0x46')](_0x4476('0x76'),_['map'](_0x238653,'id'));}});})[_0x4476('0x33')](function(){if(_0x2e9e25[_0x4476('0x94')][_0x4476('0x95')]===_0x4476('0x98')&&!_0x1bda8d&&!_0x2e9e25[_0x4476('0x3c')][_0x4476('0x75')])return[];return db[_0x4476('0x99')]['query'](_0x5d5db0[_0x4476('0x9a')](),_0x26c3dd);})['then'](function(_0x4f1248){_0x380a8a['count']=_0x4f1248[_0x4476('0x41')];if(_0x380a8a[_0x4476('0x23')]===0x0)return[];return db[_0x4476('0x99')][_0x4476('0x3c')](_0x4a2741[_0x4476('0x9a')](),_0x26c3dd)[_0x4476('0x33')](function(_0x253537){_0x2d082c=_[_0x4476('0x9b')](_0x253537,'id');_0x26c3dd=_['merge'](_0x26c3dd,{'model':db[_0x4476('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e9e25['query'][_0x4476('0x40')]){_0x66135d[_0x4476('0x3f')][_0x4476('0x6b')](function(_0x18a915){_0x29f23c[_0x4476('0x4a')]('i.'+_0x18a915);});}else{_0x29f23c[_0x4476('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4476('0x5e'));_0x29f23c[_0x4476('0x4a')]('a.key',_0x4476('0x9c'));_0x29f23c[_0x4476('0x4a')](_0x4476('0x9d'),_0x4476('0x9e'));_0x29f23c[_0x4476('0x4a')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x4476('0x8f'));_0x29f23c[_0x4476('0x4a')](_0x4476('0x9f'));_0x29f23c['field'](_0x4476('0xa0'),_0x4476('0xa1'));_0x29f23c[_0x4476('0x4a')](_0x4476('0xa2'),_0x4476('0xa3'));_0x29f23c[_0x4476('0x4a')](_0x4476('0xa4'),_0x4476('0xa5'));_0x29f23c[_0x4476('0x4a')]('c.phone',_0x4476('0xa6'));_0x29f23c[_0x4476('0x4a')](_0x4476('0xa7'),_0x4476('0xa8'));_0x29f23c[_0x4476('0x4a')]('c.fax',_0x4476('0xa9'));_0x29f23c[_0x4476('0x4a')](_0x4476('0xaa'),_0x4476('0xab'));_0x29f23c[_0x4476('0x4a')](_0x4476('0xac'),'Owner.internal');_0x29f23c[_0x4476('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x66135d[_0x4476('0x21')])_0x29f23c[_0x4476('0x21')](_0x66135d[_0x4476('0x21')]);if(_0x66135d['offset'])_0x29f23c[_0x4476('0x20')](_0x66135d[_0x4476('0x20')]);return db['sequelize']['query'](_0x29f23c[_0x4476('0x9a')](),_0x26c3dd);})[_0x4476('0x33')](function(_0x504304){if(_0x504304[_0x4476('0x41')]>0x0)_0x281a92[_0x4476('0x46')](_0x4476('0xad'),_['map'](_0x504304,'id'));return db[_0x4476('0x99')]['query'](_0x281a92[_0x4476('0x9a')](),_0x26c3dd)['then'](function(_0x16a569){var _0xda13a3=_['groupBy'](_0x16a569,_0x4476('0xae'));var _0x560381=[];_0x504304[_0x4476('0x6b')](function(_0x400bd2){_0x560381[_0x4476('0xaf')](updateOpenchannelInteraction(_0x400bd2,_0x2d082c,_0xda13a3));});return BPromise[_0x4476('0xb0')](_0x560381);});});})[_0x4476('0x33')](function(_0x4a4831){_0x380a8a[_0x4476('0xb1')]=_0x4a4831;return _0x380a8a;})[_0x4476('0x33')](respondWithFilteredResult(_0x5cf996,_0x66135d))[_0x4476('0x34')](handleError(_0x5cf996,null));};exports[_0x4476('0xb2')]=function(_0xa7e01d,_0x4a9786){var _0x292887={};if(_0xa7e01d[_0x4476('0x3c')][_0x4476('0x39')]&&_0xa7e01d[_0x4476('0x3c')][_0x4476('0x39')]==='from'){_0x292887[_0x4476('0x4c')]=_0xa7e01d['params']['id'];}else{_0x292887['id']=_0xa7e01d[_0x4476('0xb3')]['id'];}var _0x29b6e9={'raw':![],'where':_0x292887},_0x5dfd8f={};_0x5dfd8f['model']=_['keys'](db[_0x4476('0x36')][_0x4476('0x37')]);_0x5dfd8f[_0x4476('0x3c')]=_[_0x4476('0x3d')](_0xa7e01d[_0x4476('0x3c')]);_0x5dfd8f[_0x4476('0x47')]=_[_0x4476('0x3e')](_0x5dfd8f[_0x4476('0x3b')],_0x5dfd8f[_0x4476('0x3c')]);_0x29b6e9['attributes']=_[_0x4476('0x3e')](_0x5dfd8f[_0x4476('0x3b')],qs[_0x4476('0x40')](_0xa7e01d[_0x4476('0x3c')][_0x4476('0x40')]));_0x29b6e9[_0x4476('0x3f')]=_0x29b6e9[_0x4476('0x3f')][_0x4476('0x41')]?_0x29b6e9[_0x4476('0x3f')]:_0x5dfd8f['model'];if(_0xa7e01d[_0x4476('0x3c')]['includeAll']){_0x29b6e9[_0x4476('0xb4')]=[{'all':!![]}];}_0x29b6e9=_['merge']({},_0x29b6e9,_0xa7e01d[_0x4476('0xb5')]);return db[_0x4476('0x36')][_0x4476('0x5d')](_0x29b6e9)[_0x4476('0x33')](handleEntityNotFound(_0x4a9786,null))[_0x4476('0x33')](respondWithResult(_0x4a9786,null))[_0x4476('0x34')](handleError(_0x4a9786,null));};exports[_0x4476('0xb6')]=function(_0x396eae,_0x360c14){return db[_0x4476('0x36')][_0x4476('0xb6')](_0x396eae[_0x4476('0x70')],{})[_0x4476('0x33')](respondWithResult(_0x360c14,0xc9))[_0x4476('0x34')](handleError(_0x360c14,null));};exports['update']=function(_0x4bfd7b,_0x5f1456){if(_0x4bfd7b[_0x4476('0x70')]['id']){delete _0x4bfd7b[_0x4476('0x70')]['id'];}return db[_0x4476('0x36')]['find']({'where':{'id':_0x4bfd7b[_0x4476('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5f1456,null))[_0x4476('0x33')](saveUpdates(_0x4bfd7b[_0x4476('0x70')],null))[_0x4476('0x33')](respondWithResult(_0x5f1456,null))[_0x4476('0x34')](handleError(_0x5f1456,null));};exports['destroy']=function(_0x2597dd,_0x1d538d){return db[_0x4476('0x36')][_0x4476('0x5d')]({'where':{'id':_0x2597dd[_0x4476('0xb3')]['id']}})[_0x4476('0x33')](handleEntityNotFound(_0x1d538d,null))[_0x4476('0x33')](removeEntity(_0x1d538d,null))[_0x4476('0x34')](handleError(_0x1d538d,null));};exports[_0x4476('0xb7')]=function(_0x523ad3,_0x2ec543){return db[_0x4476('0x36')][_0x4476('0xb7')]()['then'](respondWithResult(_0x2ec543,null))[_0x4476('0x34')](handleError(_0x2ec543,null));};exports[_0x4476('0xb8')]=function(_0x4f1592,_0x530611,_0x43b696){return db[_0x4476('0xb9')][_0x4476('0x5d')]({'where':{'id':_0x4f1592[_0x4476('0xb3')]['id']}})['then'](handleEntityNotFound(_0x530611,null))[_0x4476('0x33')](function(_0x477155){if(_0x477155){return _0x477155['addMessage'](_0x4f1592[_0x4476('0x70')][_0x4476('0xba')],_['omit'](_0x4f1592[_0x4476('0x70')],[_0x4476('0xba'),'id'])||{});}})[_0x4476('0x33')](respondWithResult(_0x530611,null))['catch'](handleError(_0x530611,null));};exports[_0x4476('0xbb')]=function(_0x5e960d,_0x4157c8,_0x3f47a2){var _0x2734de={'raw':![],'where':{}};var _0x559942={};var _0x474bf5={'count':0x0,'rows':[]};return db[_0x4476('0x36')]['findOne']({'where':{'id':_0x5e960d['params']['id']}})['then'](handleEntityNotFound(_0x4157c8,null))['then'](function(_0x5882ea){if(_0x5882ea){_0x559942[_0x4476('0x3b')]=_[_0x4476('0x3d')](db[_0x4476('0xb9')][_0x4476('0x37')]);_0x559942[_0x4476('0x3c')]=_[_0x4476('0x3d')](_0x5e960d[_0x4476('0x3c')]);_0x559942[_0x4476('0x47')]=_[_0x4476('0x3e')](_0x559942[_0x4476('0x3b')],_0x559942[_0x4476('0x3c')]);_0x2734de[_0x4476('0x3f')]=_[_0x4476('0x3e')](_0x559942['model'],qs['fields'](_0x5e960d[_0x4476('0x3c')][_0x4476('0x40')]));_0x2734de['attributes']=_0x2734de[_0x4476('0x3f')][_0x4476('0x41')]?_0x2734de[_0x4476('0x3f')]:_0x559942[_0x4476('0x3b')];if(!_0x5e960d[_0x4476('0x3c')][_0x4476('0x42')](_0x4476('0x43'))){_0x2734de[_0x4476('0x21')]=qs[_0x4476('0x21')](_0x5e960d[_0x4476('0x3c')]['limit']);_0x2734de[_0x4476('0x20')]=qs['offset'](_0x5e960d[_0x4476('0x3c')]['offset']);}_0x2734de['order']=qs[_0x4476('0x45')](_0x5e960d[_0x4476('0x3c')]['sort']);_0x2734de[_0x4476('0x46')]=qs[_0x4476('0x47')](_[_0x4476('0x48')](_0x5e960d[_0x4476('0x3c')],_0x559942[_0x4476('0x47')]));_0x2734de[_0x4476('0x46')][_0x4476('0xae')]=_0x5882ea['id'];if(_0x5e960d[_0x4476('0x3c')][_0x4476('0x83')]){_0x2734de[_0x4476('0x46')]=_['merge'](_0x2734de['where'],{'$or':_[_0x4476('0x2f')](_0x2734de['attributes'],function(_0x4eeda5){var _0x1c47a3={};_0x1c47a3[_0x4eeda5]={'$like':'%'+_0x5e960d[_0x4476('0x3c')][_0x4476('0x83')]+'%'};return _0x1c47a3;})});}if(_0x5e960d[_0x4476('0x3c')][_0x4476('0x7a')]){var _0x469e3c=_0x5e960d[_0x4476('0x3c')][_0x4476('0x7a')][_0x4476('0x63')](',');var _0x1c0b5f={};_0x1c0b5f[_0x469e3c[0x0]]={'$gte':moment(_0x469e3c[0x1])[_0x4476('0xbc')](_0x4476('0xbd'))};_0x2734de['where']=_['merge'](_0x2734de['where'],_0x1c0b5f);}_0x2734de=_[_0x4476('0xbe')]({},_0x2734de,_0x5e960d[_0x4476('0xb5')]);return db[_0x4476('0xb9')][_0x4476('0x23')]({'where':_0x2734de[_0x4476('0x46')]})['then'](function(_0x448dd0){_0x474bf5[_0x4476('0x23')]=_0x448dd0;if(_0x5e960d['query'][_0x4476('0xbf')]){_0x2734de[_0x4476('0xb4')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x4476('0xc0')](_0x2734de);})[_0x4476('0x33')](function(_0x5e1e24){_0x474bf5['rows']=_0x5e1e24;return _0x474bf5;});}})[_0x4476('0x33')](respondWithFilteredResult(_0x4157c8,_0x2734de))[_0x4476('0x34')](handleError(_0x4157c8,null));};exports['addTags']=function(_0x4019e2,_0x146550,_0x36e68b){return db['OpenchannelInteraction'][_0x4476('0x5d')]({'where':{'id':_0x4019e2[_0x4476('0xb3')]['id']}})['then'](handleEntityNotFound(_0x146550,null))[_0x4476('0x33')](function(_0x38b4da){if(_0x38b4da){return _0x38b4da[_0x4476('0xc1')](_0x4019e2[_0x4476('0x70')][_0x4476('0xba')],_['omit'](_0x4019e2[_0x4476('0x70')],[_0x4476('0xba'),'id'])||{})['spread'](function(){return db[_0x4476('0x6a')][_0x4476('0xc0')]({'attributes':['id',_0x4476('0x2c'),_0x4476('0x4b')],'where':{'id':_0x4019e2['body'][_0x4476('0xba')]}});})[_0x4476('0x33')](function(_0x2e7db9){socket[_0x4476('0xc2')]('openchannelInteractionTags:save',{'id':Number(_0x4019e2['params']['id']),'tags':_0x2e7db9||[]});return{'id':Number(_0x4019e2[_0x4476('0xb3')]['id']),'tags':_0x2e7db9||[]};});}})[_0x4476('0x33')](respondWithResult(_0x146550,null))['catch'](handleError(_0x146550,null));};exports[_0x4476('0xc3')]=function(_0x11b251,_0x5dda44,_0x892f58){return db[_0x4476('0x36')][_0x4476('0x5d')]({'where':{'id':_0x11b251['params']['id']}})[_0x4476('0x33')](handleEntityNotFound(_0x5dda44,null))[_0x4476('0x33')](function(_0x4741ae){if(_0x4741ae){return _0x4741ae[_0x4476('0xc3')](_0x11b251[_0x4476('0x3c')]['ids']);}})[_0x4476('0x33')](respondWithStatusCode(_0x5dda44,null))['catch'](handleError(_0x5dda44,null));};exports[_0x4476('0xc4')]=function(_0x5e1ed5,_0x2bb262){var _0x1f121b=moment()[_0x4476('0xc5')]()[_0x4476('0x9a')]();var _0x4756bf=path[_0x4476('0xc6')](config[_0x4476('0xc7')],_0x4476('0xc8'),_0x4476('0xc9'),_0x4476('0xca'));var _0x5285a6=path['join'](config[_0x4476('0xc7')],'server','files',_0x4476('0xcb'));var _0x285dfc=path['join'](_0x4756bf,_0x1f121b);var _0x131aea=util[_0x4476('0xbc')](_0x4476('0xcc'),_0x5e1ed5[_0x4476('0xb3')]['id'],_0x1f121b);var _0x2852cc=path['join'](_0x4756bf,_0x131aea);var _0x15f9fa=[];_0x15f9fa['push']({'model':db[_0x4476('0x6d')],'as':_0x4476('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x15f9fa[_0x4476('0xaf')]({'model':db['CmContact'],'as':_0x4476('0xcd'),'attributes':['id','firstName',_0x4476('0xce')],'raw':!![]});if(_0x5e1ed5[_0x4476('0x3c')][_0x4476('0xcb')]){_0x15f9fa['push']({'model':db[_0x4476('0xcf')],'as':_0x4476('0xcf'),'raw':!![]});}var _0xbe80c1=[{'model':db[_0x4476('0xb9')],'as':_0x4476('0xd0'),'attributes':['id',_0x4476('0x70'),_0x4476('0x78'),'direction','secret',_0x4476('0x7f')],'include':_0x15f9fa}];_0xbe80c1['push']({'model':db['OpenchannelAccount'],'as':_0x4476('0xd1'),'attributes':['id',_0x4476('0x2c')]});_0xbe80c1[_0x4476('0xaf')]({'model':db[_0x4476('0x6d')],'as':_0x4476('0xd2'),'attributes':['id',_0x4476('0x30')]});return db[_0x4476('0x36')]['find']({'where':{'id':_0x5e1ed5['params']['id']},'include':_0xbe80c1})[_0x4476('0x33')](handleEntityNotFound(_0x2bb262,null))[_0x4476('0x33')](function(_0x4489f1){if(_0x4489f1){var _0x59042c=_0x4489f1['get']({'plain':!![]});fs[_0x4476('0xd3')](_0x285dfc);var _0x5f18bb={'channel':_0x4476('0xd4'),'account':_0x59042c[_0x4476('0xd1')][_0x4476('0x2c')],'agent':_0x59042c['Owner']?_0x59042c[_0x4476('0xd2')][_0x4476('0x30')]:_0x4476('0xd5'),'createdAt':moment(_0x59042c[_0x4476('0x78')])['format'](_0x4476('0xbd'))['toString'](),'closedAt':_0x59042c[_0x4476('0xd6')]?moment(_0x59042c['closedAt'])[_0x4476('0xbc')](_0x4476('0xbd'))[_0x4476('0x9a')]():'','disposition':_0x59042c['disposition'],'visibility':_0x59042c['threadId']?_0x4476('0xd7'):_0x4476('0xd8'),'messages':_(_0x59042c[_0x4476('0xd0')])[_0x4476('0x83')]({'secret':![]})[_0x4476('0x2f')](function(_0x3c4d91){if(_0x3c4d91[_0x4476('0xcf')]){var _0x4eb5b5=path[_0x4476('0xc6')](_0x5285a6,_0x3c4d91[_0x4476('0xcf')][_0x4476('0xd9')]);if(fs['existsSync'](_0x4eb5b5)){fs[_0x4476('0xda')](_0x4eb5b5)[_0x4476('0xdb')](fs[_0x4476('0xdc')](path['join'](_0x285dfc,_0x3c4d91[_0x4476('0xcf')][_0x4476('0xd9')])));}}return{'date':moment(_0x3c4d91[_0x4476('0x78')])[_0x4476('0xbc')](_0x4476('0xbd'))[_0x4476('0x9a')](),'sender':_0x3c4d91[_0x4476('0xdd')]===_0x4476('0xde')?_0x3c4d91[_0x4476('0x6d')]?_0x3c4d91[_0x4476('0x6d')][_0x4476('0x30')]:_0x4476('0xdf'):_0x3c4d91[_0x4476('0xcd')][_0x4476('0xe0')]+(_0x3c4d91['Contact'][_0x4476('0xce')]?'\x20'+_0x3c4d91[_0x4476('0xcd')][_0x4476('0xce')]:''),'body':_0x3c4d91[_0x4476('0xcf')]?_0x3c4d91[_0x4476('0xcf')]['basename']:_0x3c4d91['body'],'direction':_0x3c4d91['direction']===_0x4476('0xde')?'A':'C','secret':_0x3c4d91[_0x4476('0xe1')],'read':_0x3c4d91[_0x4476('0x7f')],'attachment':_0x3c4d91['Attachment']};})['value']()};return ejs[_0x4476('0xe2')](path[_0x4476('0xc6')](config[_0x4476('0xc7')],'server',_0x4476('0xe3'),_0x4476('0xe4')),{'interaction':_0x5f18bb})[_0x4476('0x33')](function(_0x1bf1f1){var _0x418439=path[_0x4476('0xc6')](_0x285dfc,_0x4476('0xe5')+_0x59042c['id']+'-'+_0x1f121b+_0x4476('0xe6'));var _0x4cab53={'path':_0x418439,'channel':_0x4476('0xd4'),'interactionId':_0x59042c['id']};return pdf[_0x4476('0xe7')](_0x1bf1f1,_0x4cab53);})[_0x4476('0x33')](function(){return new BPromise(function(_0x198b96,_0x221f05){zipdir(_0x285dfc,{'saveTo':_0x2852cc},function(_0x1941fb,_0x305365){if(_0x1941fb)return _0x221f05(_0x1941fb);return _0x198b96(_0x305365);});})[_0x4476('0x33')](function(){return new BPromise(function(_0x13f10a,_0x426646){rimraf(_0x285dfc,function(_0x55a171){if(_0x55a171)_0x426646(_0x55a171);return _0x13f10a();});});})[_0x4476('0x33')](function(){return _0x2bb262['download'](_0x2852cc,_0x131aea,function(_0xb60617){if(_0xb60617){console['log'](_0x4476('0xe8'),_0xb60617);}else{fs['unlinkSync'](_0x2852cc);}});});});}else{return _0x2bb262[_0x4476('0x29')](0xc8);}})['catch'](handleError(_0x2bb262,null));};
\ No newline at end of file
+var _0xec60=['apply','reject','save','update','then','destroy','stack','name','send','Users','map','Tags','split','push','catch','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','forEach','union','User','text','body','start','keys','compact','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','TagIds','groupBy','all','rows','show','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','N.A.','closed','closedAt','disposition','Public','existsSync','createWriteStream','System','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2918e1,_0x9613bc){var _0x2f5165=function(_0x12d6e2){while(--_0x12d6e2){_0x2918e1['push'](_0x2918e1['shift']());}};_0x2f5165(++_0x9613bc);}(_0xec60,0xc6));var _0x0ec6=function(_0x4238c2,_0xeb8534){_0x4238c2=_0x4238c2-0x0;var _0x40ff40=_0xec60[_0x4238c2];return _0x40ff40;};'use strict';var emlformat=require(_0x0ec6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ec6('0x1'));var jsonpatch=require(_0x0ec6('0x2'));var rp=require(_0x0ec6('0x3'));var moment=require(_0x0ec6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ec6('0x5'));var util=require(_0x0ec6('0x6'));var path=require(_0x0ec6('0x7'));var sox=require(_0x0ec6('0x8'));var csv=require(_0x0ec6('0x9'));var ejs=require(_0x0ec6('0xa'));var fs=require('fs');var fs_extra=require(_0x0ec6('0xb'));var _=require(_0x0ec6('0xc'));var squel=require(_0x0ec6('0xd'));var crypto=require(_0x0ec6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0ec6('0xf'));var Papa=require('papaparse');var Redis=require(_0x0ec6('0x10'));var authService=require(_0x0ec6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0ec6('0x12'));var pdf=require(_0x0ec6('0x13'));var hardwareService=require(_0x0ec6('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0ec6('0x15'));var licenseUtil=require(_0x0ec6('0x16'));var db=require(_0x0ec6('0x17'))['db'];config['redis']=_[_0x0ec6('0x18')](config[_0x0ec6('0x19')],{'host':_0x0ec6('0x1a'),'port':0x18eb});var socket=require(_0x0ec6('0x1b'))(new Redis(config[_0x0ec6('0x19')]));require('./openchannelInteraction.socket')[_0x0ec6('0x1c')](socket);function respondWithStatusCode(_0x30b4df,_0x10fae9){_0x10fae9=_0x10fae9||0xcc;return function(_0xddb3b4){if(_0xddb3b4){return _0x30b4df[_0x0ec6('0x1d')](_0x10fae9);}return _0x30b4df[_0x0ec6('0x1e')](_0x10fae9)[_0x0ec6('0x1f')]();};}function respondWithResult(_0x113ff2,_0x46ff57){_0x46ff57=_0x46ff57||0xc8;return function(_0xd0b171){if(_0xd0b171){return _0x113ff2['status'](_0x46ff57)[_0x0ec6('0x20')](_0xd0b171);}};}function respondWithFilteredResult(_0x33e5f8,_0x414459){return function(_0x410162){if(_0x410162){var _0x150d47=typeof _0x414459[_0x0ec6('0x21')]===_0x0ec6('0x22')&&typeof _0x414459[_0x0ec6('0x23')]===_0x0ec6('0x22');var _0x2b2acc=_0x410162[_0x0ec6('0x24')];var _0x550295=_0x150d47?0x0:_0x414459[_0x0ec6('0x21')];var _0x31dbad=_0x150d47?_0x410162[_0x0ec6('0x24')]:_0x414459[_0x0ec6('0x21')]+_0x414459[_0x0ec6('0x23')];var _0x1d5c73;if(_0x31dbad>=_0x2b2acc){_0x31dbad=_0x2b2acc;_0x1d5c73=0xc8;}else{_0x1d5c73=0xce;}_0x33e5f8[_0x0ec6('0x1e')](_0x1d5c73);return _0x33e5f8[_0x0ec6('0x25')](_0x0ec6('0x26'),_0x550295+'-'+_0x31dbad+'/'+_0x2b2acc)['json'](_0x410162);}return null;};}function patchUpdates(_0x186efe){return function(_0x3580e7){try{jsonpatch[_0x0ec6('0x27')](_0x3580e7,_0x186efe,!![]);}catch(_0x46a828){return BPromise[_0x0ec6('0x28')](_0x46a828);}return _0x3580e7[_0x0ec6('0x29')]();};}function saveUpdates(_0x4e1e66,_0x302132){return function(_0x5a1306){if(_0x5a1306){return _0x5a1306[_0x0ec6('0x2a')](_0x4e1e66)[_0x0ec6('0x2b')](function(_0x33d779){return _0x33d779;});}return null;};}function removeEntity(_0x48b13a,_0x220b76){return function(_0x253164){if(_0x253164){return _0x253164[_0x0ec6('0x2c')]()[_0x0ec6('0x2b')](function(){_0x48b13a[_0x0ec6('0x1e')](0xcc)[_0x0ec6('0x1f')]();});}};}function handleEntityNotFound(_0x5b328b,_0x2027e1){return function(_0x5a6146){if(!_0x5a6146){_0x5b328b[_0x0ec6('0x1d')](0x194);}return _0x5a6146;};}function handleError(_0x5c29a1,_0xa14a8f){_0xa14a8f=_0xa14a8f||0x1f4;return function(_0xe341e1){logger['error'](_0xe341e1[_0x0ec6('0x2d')]);if(_0xe341e1['name']){delete _0xe341e1[_0x0ec6('0x2e')];}_0x5c29a1[_0x0ec6('0x1e')](_0xa14a8f)[_0x0ec6('0x2f')](_0xe341e1);};}function getInteractionUsers(_0x163c24,_0xb5fd9d){return new BPromise(function(_0x1d4903,_0x26bd4d){try{if(_0xb5fd9d[_0x163c24['id']]){_0x163c24[_0x0ec6('0x30')]=_[_0x0ec6('0x31')](_0xb5fd9d[_0x163c24['id']],function(_0x38d62b){return{'id':_0x38d62b['id'],'fullname':_0x38d62b['fullname']};});}}catch(_0x4ae695){_0x26bd4d(_0x4ae695);}_0x1d4903(_0x163c24);});}function getInteractionTags(_0x3a74a3,_0x3eb8cf){return new BPromise(function(_0x4feff9,_0x313bd7){try{if(_0x3a74a3['TagIds']){_0x3a74a3[_0x0ec6('0x32')]=[];_0x3a74a3['TagIds'][_0x0ec6('0x33')](',')['forEach'](function(_0x1ca431){_0x3a74a3[_0x0ec6('0x32')][_0x0ec6('0x34')](_0x3eb8cf[_0x1ca431]);});}delete _0x3a74a3['TagIds'];}catch(_0xf818a3){_0x313bd7(_0xf818a3);}_0x4feff9(_0x3a74a3);});}function updateOpenchannelInteraction(_0x3bc9f5,_0x5efb15,_0x350edb){return new BPromise(function(_0x111941,_0x406df8){return getInteractionUsers(_0x3bc9f5,_0x350edb)[_0x0ec6('0x2b')](function(_0x5ce241){return getInteractionTags(_0x5ce241,_0x5efb15);})['then'](function(_0x32fb98){_0x111941(_0x32fb98);})[_0x0ec6('0x35')](function(_0x29d7d4){_0x406df8(_0x29d7d4);});});}exports['index']=function(_0x13e96a,_0x444214){var _0x5af985={},_0x51cfbc={},_0x4ae4a0={'count':0x0,'rows':[]};var _0x2b666c=_['map'](db['OpenchannelInteraction'][_0x0ec6('0x36')],function(_0x12f5b8){return{'name':_0x12f5b8[_0x0ec6('0x37')],'type':_0x12f5b8[_0x0ec6('0x38')][_0x0ec6('0x39')]};});_0x51cfbc[_0x0ec6('0x3a')]=_['map'](_0x2b666c,_0x0ec6('0x2e'));_0x51cfbc[_0x0ec6('0x3b')]=_['keys'](_0x13e96a[_0x0ec6('0x3b')]);_0x51cfbc[_0x0ec6('0x3c')]=_[_0x0ec6('0x3d')](_0x51cfbc[_0x0ec6('0x3a')],_0x51cfbc[_0x0ec6('0x3b')]);_0x5af985[_0x0ec6('0x3e')]=_[_0x0ec6('0x3d')](_0x51cfbc[_0x0ec6('0x3a')],qs[_0x0ec6('0x3f')](_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x3f')]));_0x5af985[_0x0ec6('0x3e')]=_0x5af985[_0x0ec6('0x3e')]['length']?_0x5af985[_0x0ec6('0x3e')]:_0x51cfbc['model'];if(!_0x13e96a['query'][_0x0ec6('0x40')](_0x0ec6('0x41'))){_0x5af985['limit']=qs[_0x0ec6('0x23')](_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x23')]);_0x5af985[_0x0ec6('0x21')]=qs['offset'](_0x13e96a['query'][_0x0ec6('0x21')]);}_0x5af985[_0x0ec6('0x42')]=qs[_0x0ec6('0x43')](_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x43')]);_0x5af985['where']=qs[_0x0ec6('0x3c')](_[_0x0ec6('0x44')](_0x13e96a[_0x0ec6('0x3b')],_0x51cfbc[_0x0ec6('0x3c')]),_0x2b666c);var _0x4b13f0=[];var _0xd21ef9=squel[_0x0ec6('0x45')]()[_0x0ec6('0x46')]('id')[_0x0ec6('0x46')](_0x0ec6('0x2e'))[_0x0ec6('0x46')](_0x0ec6('0x47'))[_0x0ec6('0x48')](_0x0ec6('0x49'));var _0x430f8d=squel[_0x0ec6('0x45')]()[_0x0ec6('0x46')]('u.id')[_0x0ec6('0x46')](_0x0ec6('0x4a'))[_0x0ec6('0x46')](_0x0ec6('0x4b'))[_0x0ec6('0x48')](_0x0ec6('0x4c'),'ui')['left_join'](_0x0ec6('0x4d'),'u',_0x0ec6('0x4e'));var _0xc17d3c=squel['select']()[_0x0ec6('0x48')](_0x0ec6('0x4f'),'i')[_0x0ec6('0x50')](_0x0ec6('0x51'),'c',_0x0ec6('0x52'))['left_join'](_0x0ec6('0x4d'),'o',_0x0ec6('0x53'))[_0x0ec6('0x50')](_0x0ec6('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x0ec6('0x55'),'me',_0x0ec6('0x56'))['left_join'](_0x0ec6('0x57'),'it',_0x0ec6('0x58'))['left_join'](_0x0ec6('0x49'),'t',_0x0ec6('0x59'));var _0x3ba488=squel[_0x0ec6('0x5a')]();var _0x391fd7=[];var _0x5c7187=squel[_0x0ec6('0x5a')]();var _0x42136f;if(_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x5b')]){_0x42136f=as[_0x0ec6('0x5c')](_0x13e96a['query'][_0x0ec6('0x5b')]);var _0x4c0349=_0x42136f['sqlOperator'];for(var _0x3ac105=0x0;_0x3ac105<_0x42136f[_0x0ec6('0x5d')]['length'];_0x3ac105++){var _0x2fa24d=_0x42136f['conditions'][_0x3ac105];var _0x4cf4a3='i';var _0x11901d=_[_0x0ec6('0x5e')](_0x2b666c,[_0x0ec6('0x2e'),_0x2fa24d[_0x0ec6('0x46')]]);if(!_0x11901d){switch(_0x2fa24d[_0x0ec6('0x46')]){case _0x0ec6('0x5f'):if(_0x2fa24d['value']==0x1){_0xc17d3c[_0x0ec6('0x60')]('`'+_0x2fa24d[_0x0ec6('0x46')]+_0x0ec6('0x61'));}else{_0xc17d3c[_0x0ec6('0x60')]('`'+_0x2fa24d[_0x0ec6('0x46')]+'`\x20>\x200');}break;case _0x0ec6('0x62'):if(_0x2fa24d[_0x0ec6('0x63')]===_0x0ec6('0x64')){if(_0x2fa24d[_0x0ec6('0x65')][_0x0ec6('0x33')]('\x20')[_0x0ec6('0x66')]>0x1){_0x3ba488[_0x4c0349](_0x0ec6('0x67'),qs['getFullTextValue'](_0x2fa24d[_0x0ec6('0x65')]),null);}else{var _0x1c5c19='%'+_0x2fa24d[_0x0ec6('0x65')]+'%';_0x3ba488[_0x4c0349](_0x0ec6('0x68'),_0x1c5c19,_0x1c5c19,_0x1c5c19);}}else{_0x11901d=_[_0x0ec6('0x5e')](_0x2b666c,[_0x0ec6('0x2e'),_0x0ec6('0x69')]);_0x2fa24d[_0x0ec6('0x46')]=_0x0ec6('0x69');_0x2e59cf=as[_0x0ec6('0x6a')](_0x4cf4a3,_0x11901d[_0x0ec6('0x38')],_0x2fa24d);_0x3ba488[_0x4c0349](_0x2e59cf['text'],_0x2e59cf[_0x0ec6('0x65')]['start'],_0x2e59cf[_0x0ec6('0x65')][_0x0ec6('0x1f')]);}break;case _0x0ec6('0x6b'):var _0xd01ec6=_0x2fa24d[_0x0ec6('0x65')][_0x0ec6('0x33')](',')[_0x0ec6('0x31')](function(_0x4b2f51){return Number(_0x4b2f51);});_0xd01ec6[_0x0ec6('0x6c')](function(_0x235fef){_0x5c7187['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x235fef+',%');});_0x391fd7=_[_0x0ec6('0x6d')](_0x391fd7,_0xd01ec6);break;case _0x0ec6('0x6e'):if(_0x2fa24d['operator']===_0x0ec6('0x64')){_0x3ba488[_0x4c0349]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2fa24d[_0x0ec6('0x65')]+'%',null);}else{_0x11901d=_[_0x0ec6('0x5e')](_0x2b666c,[_0x0ec6('0x2e'),'UserId']);_0x2fa24d[_0x0ec6('0x46')]='UserId';_0x2e59cf=as[_0x0ec6('0x6a')](_0x4cf4a3,_0x11901d[_0x0ec6('0x38')],_0x2fa24d);_0x3ba488[_0x4c0349](_0x2e59cf[_0x0ec6('0x6f')],_0x2e59cf[_0x0ec6('0x65')]['start'],_0x2e59cf[_0x0ec6('0x65')][_0x0ec6('0x1f')]);}break;case _0x0ec6('0x70'):_0x2e59cf=as[_0x0ec6('0x6a')]('me',null,_0x2fa24d);_0x3ba488[_0x4c0349](_0x2e59cf[_0x0ec6('0x6f')],_0x2e59cf[_0x0ec6('0x65')][_0x0ec6('0x71')],_0x2e59cf['value'][_0x0ec6('0x1f')]);break;}}else{var _0x2e59cf=as[_0x0ec6('0x6a')](_0x4cf4a3,_0x11901d[_0x0ec6('0x38')],_0x2fa24d);_0x3ba488[_0x4c0349](_0x2e59cf[_0x0ec6('0x6f')],_0x2e59cf[_0x0ec6('0x65')][_0x0ec6('0x71')],_0x2e59cf['value'][_0x0ec6('0x1f')]);}}}else{var _0x5e584c=_(_0x13e96a[_0x0ec6('0x3b')])[_0x0ec6('0x72')]()[_0x0ec6('0x31')](function(_0x426de1){return _['some'](_0x2b666c,['name',_0x426de1])?_0x426de1:undefined;})[_0x0ec6('0x73')]()[_0x0ec6('0x65')]();if(!_['isEmpty'](_0x5e584c)){_0x5e584c[_0x0ec6('0x6c')](function(_0x4d653d){if(_0x4d653d==='OpenchannelAccountId'){_0xc17d3c[_0x0ec6('0x74')](_0x0ec6('0x75'),[][_0x0ec6('0x76')](_0x13e96a['query'][_0x4d653d]));}else if(_0x4d653d===_0x0ec6('0x77')){var _0x4d9920=JSON[_0x0ec6('0x78')](_0x13e96a[_0x0ec6('0x3b')][_0x4d653d])[_0x0ec6('0x79')];var _0x3f2b22=JSON[_0x0ec6('0x78')](_0x13e96a['query'][_0x4d653d])['$lte'];_0xc17d3c[_0x0ec6('0x74')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4d9920,_0x3f2b22);}else{if(_0x13e96a[_0x0ec6('0x3b')][_0x4d653d]===_0x0ec6('0x7a')){_0xc17d3c['where']('i.'+_0x4d653d+_0x0ec6('0x7b'));}else{_0xc17d3c[_0x0ec6('0x74')]('i.'+_0x4d653d+_0x0ec6('0x7c'),_0x13e96a[_0x0ec6('0x3b')][_0x4d653d]);}}});}if(_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x7d')]){if(_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x7d')]==0x1){_0xc17d3c[_0x0ec6('0x60')](_0x0ec6('0x7e'));}else{_0xc17d3c['having'](_0x0ec6('0x7f'));}}if(_0x13e96a['query'][_0x0ec6('0x80')]){_0x391fd7=_[_0x0ec6('0x81')](_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x80')])?_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x80')]:new Array(_0x13e96a[_0x0ec6('0x3b')]['tag']);_0x391fd7[_0x0ec6('0x6c')](function(_0x5d0ff1){_0x5c7187['or'](_0x0ec6('0x82'),'%,'+_0x5d0ff1+',%');});}if(_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x83')]){var _0x5dc67e=_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x83')][_0x0ec6('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0ec6('0x85')](_0x5dc67e)){_0x3ba488['or'](_0x0ec6('0x86'),_0x5dc67e+'%');}else{_0x3ba488['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0ec6('0x87')](_0x5dc67e))['or'](_0x0ec6('0x88'),_0x5dc67e+'%')['or'](_0x0ec6('0x89'),_0x5dc67e+'%');}}}_0xc17d3c[_0x0ec6('0x74')](_0x3ba488);_0xc17d3c[_0x0ec6('0x8a')]('i.id');var _0x41c056={'type':db[_0x0ec6('0x8b')][_0x0ec6('0x8c')][_0x0ec6('0x8d')],'raw':!![]};var _0x420bc7=_0xc17d3c[_0x0ec6('0x8e')]();_0x420bc7[_0x0ec6('0x46')]('i.id');_0x420bc7[_0x0ec6('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0ec6('0x5f'));if(_0x5af985[_0x0ec6('0x42')]){_0x5af985['order'][_0x0ec6('0x6c')](function(_0x5db31d){var _0x42be3c=_0x5db31d[0x0]===_0x0ec6('0x8f')?_0x5db31d[0x0]:'i.'+_0x5db31d[0x0];_0xc17d3c[_0x0ec6('0x42')](_0x42be3c,_0x5db31d[0x1]===_0x0ec6('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x391fd7)){_0xc17d3c[_0x0ec6('0x60')](_0x5c7187);_0x420bc7[_0x0ec6('0x74')](_0x0ec6('0x91'),_0x391fd7);}BPromise[_0x0ec6('0x92')]()['then'](function(){if(!_0x42136f){if(_0x13e96a[_0x0ec6('0x3b')][_0x0ec6('0x93')])return;_0x420bc7[_0x0ec6('0x74')](_0x0ec6('0x94'));_0xc17d3c[_0x0ec6('0x74')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x13e96a[_0x0ec6('0x95')][_0x0ec6('0x96')]!==_0x0ec6('0x97'))return;return _0x13e96a['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x0ec6('0x2b')](function(_0x5ef358){if(_[_0x0ec6('0x98')](_0x5ef358)){_0x420bc7[_0x0ec6('0x74')]('i.OpenchannelAccountId\x20IS\x20NULL');_0xc17d3c['where'](_0x0ec6('0x99'));}else{_0x420bc7[_0x0ec6('0x74')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x5ef358,'id'));_0xc17d3c[_0x0ec6('0x74')](_0x0ec6('0x75'),_[_0x0ec6('0x31')](_0x5ef358,'id'));}});})['then'](function(){if(_0x13e96a['user'][_0x0ec6('0x96')]===_0x0ec6('0x97')&&!_0x42136f&&!_0x13e96a['query'][_0x0ec6('0x93')])return[];return db[_0x0ec6('0x9a')][_0x0ec6('0x3b')](_0x420bc7[_0x0ec6('0x9b')](),_0x41c056);})['then'](function(_0xba9634){_0x4ae4a0[_0x0ec6('0x24')]=_0xba9634['length'];if(_0x4ae4a0[_0x0ec6('0x24')]===0x0)return[];return db['sequelize'][_0x0ec6('0x3b')](_0xd21ef9[_0x0ec6('0x9b')](),_0x41c056)[_0x0ec6('0x2b')](function(_0x4cbfaf){_0x4b13f0=_[_0x0ec6('0x9c')](_0x4cbfaf,'id');_0x41c056=_[_0x0ec6('0x9d')](_0x41c056,{'model':db[_0x0ec6('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13e96a[_0x0ec6('0x3b')]['fields']){_0x5af985[_0x0ec6('0x3e')][_0x0ec6('0x6c')](function(_0x21f6f6){_0xc17d3c[_0x0ec6('0x46')]('i.'+_0x21f6f6);});}else{_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0x9f'),_0x0ec6('0x5f'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xa0'),_0x0ec6('0xa1'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xa2'),_0x0ec6('0xa3'));_0xc17d3c[_0x0ec6('0x46')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x0ec6('0x8f'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xa4'));_0xc17d3c[_0x0ec6('0x46')]('c.firstName',_0x0ec6('0xa5'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xa6'),_0x0ec6('0xa7'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xa8'),'Contact.email');_0xc17d3c['field'](_0x0ec6('0xa9'),_0x0ec6('0xaa'));_0xc17d3c['field'](_0x0ec6('0xab'),'Contact.mobile');_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xac'),_0x0ec6('0xad'));_0xc17d3c['field'](_0x0ec6('0xae'),_0x0ec6('0xaf'));_0xc17d3c[_0x0ec6('0x46')](_0x0ec6('0xb0'),'Owner.internal');_0xc17d3c[_0x0ec6('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0ec6('0xb1'));}if(_0x5af985[_0x0ec6('0x23')])_0xc17d3c['limit'](_0x5af985['limit']);if(_0x5af985[_0x0ec6('0x21')])_0xc17d3c[_0x0ec6('0x21')](_0x5af985[_0x0ec6('0x21')]);return db[_0x0ec6('0x9a')][_0x0ec6('0x3b')](_0xc17d3c['toString'](),_0x41c056);})['then'](function(_0x38ac6a){if(_0x38ac6a[_0x0ec6('0x66')]>0x0)_0x430f8d[_0x0ec6('0x74')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x0ec6('0x31')](_0x38ac6a,'id'));return db[_0x0ec6('0x9a')][_0x0ec6('0x3b')](_0x430f8d[_0x0ec6('0x9b')](),_0x41c056)[_0x0ec6('0x2b')](function(_0x5e694a){var _0x412ab7=_[_0x0ec6('0xb2')](_0x5e694a,'OpenchannelInteractionId');var _0x51c4a7=[];_0x38ac6a[_0x0ec6('0x6c')](function(_0x417d33){_0x51c4a7[_0x0ec6('0x34')](updateOpenchannelInteraction(_0x417d33,_0x4b13f0,_0x412ab7));});return BPromise[_0x0ec6('0xb3')](_0x51c4a7);});});})[_0x0ec6('0x2b')](function(_0xb79ea0){_0x4ae4a0[_0x0ec6('0xb4')]=_0xb79ea0;return _0x4ae4a0;})[_0x0ec6('0x2b')](respondWithFilteredResult(_0x444214,_0x5af985))['catch'](handleError(_0x444214,null));};exports[_0x0ec6('0xb5')]=function(_0x4bf756,_0x4e87c2){var _0x572058={};if(_0x4bf756[_0x0ec6('0x3b')]['type']&&_0x4bf756[_0x0ec6('0x3b')]['type']===_0x0ec6('0x48')){_0x572058[_0x0ec6('0x48')]=_0x4bf756['params']['id'];}else{_0x572058['id']=_0x4bf756[_0x0ec6('0xb6')]['id'];}var _0x1e7935={'raw':![],'where':_0x572058},_0xa392ef={};_0xa392ef['model']=_['keys'](db[_0x0ec6('0x9e')][_0x0ec6('0x36')]);_0xa392ef['query']=_[_0x0ec6('0x72')](_0x4bf756[_0x0ec6('0x3b')]);_0xa392ef['filters']=_[_0x0ec6('0x3d')](_0xa392ef[_0x0ec6('0x3a')],_0xa392ef['query']);_0x1e7935['attributes']=_['intersection'](_0xa392ef[_0x0ec6('0x3a')],qs[_0x0ec6('0x3f')](_0x4bf756['query'][_0x0ec6('0x3f')]));_0x1e7935[_0x0ec6('0x3e')]=_0x1e7935['attributes'][_0x0ec6('0x66')]?_0x1e7935[_0x0ec6('0x3e')]:_0xa392ef['model'];if(_0x4bf756[_0x0ec6('0x3b')][_0x0ec6('0xb7')]){_0x1e7935[_0x0ec6('0xb8')]=[{'all':!![]}];}_0x1e7935=_[_0x0ec6('0x9d')]({},_0x1e7935,_0x4bf756[_0x0ec6('0xb9')]);return db[_0x0ec6('0x9e')][_0x0ec6('0x5e')](_0x1e7935)[_0x0ec6('0x2b')](handleEntityNotFound(_0x4e87c2,null))[_0x0ec6('0x2b')](respondWithResult(_0x4e87c2,null))[_0x0ec6('0x35')](handleError(_0x4e87c2,null));};exports[_0x0ec6('0xba')]=function(_0x450585,_0xc73f9e){return db[_0x0ec6('0x9e')][_0x0ec6('0xba')](_0x450585[_0x0ec6('0x70')],{})[_0x0ec6('0x2b')](respondWithResult(_0xc73f9e,0xc9))[_0x0ec6('0x35')](handleError(_0xc73f9e,null));};exports[_0x0ec6('0x2a')]=function(_0xc63842,_0x3caa3e){if(_0xc63842[_0x0ec6('0x70')]['id']){delete _0xc63842['body']['id'];}return db[_0x0ec6('0x9e')][_0x0ec6('0x5e')]({'where':{'id':_0xc63842[_0x0ec6('0xb6')]['id']}})[_0x0ec6('0x2b')](handleEntityNotFound(_0x3caa3e,null))[_0x0ec6('0x2b')](saveUpdates(_0xc63842[_0x0ec6('0x70')],null))[_0x0ec6('0x2b')](respondWithResult(_0x3caa3e,null))[_0x0ec6('0x35')](handleError(_0x3caa3e,null));};exports['destroy']=function(_0x2acefc,_0x38b739){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2acefc[_0x0ec6('0xb6')]['id']}})[_0x0ec6('0x2b')](handleEntityNotFound(_0x38b739,null))['then'](removeEntity(_0x38b739,null))[_0x0ec6('0x35')](handleError(_0x38b739,null));};exports['describe']=function(_0x5475b0,_0x1b5b06){return db[_0x0ec6('0x9e')][_0x0ec6('0xbb')]()[_0x0ec6('0x2b')](respondWithResult(_0x1b5b06,null))[_0x0ec6('0x35')](handleError(_0x1b5b06,null));};exports[_0x0ec6('0xbc')]=function(_0x30cfcf,_0x16dd60,_0x5b30f2){return db[_0x0ec6('0xbd')]['find']({'where':{'id':_0x30cfcf[_0x0ec6('0xb6')]['id']}})['then'](handleEntityNotFound(_0x16dd60,null))[_0x0ec6('0x2b')](function(_0x246d1a){if(_0x246d1a){return _0x246d1a[_0x0ec6('0xbc')](_0x30cfcf[_0x0ec6('0x70')][_0x0ec6('0xbe')],_['omit'](_0x30cfcf[_0x0ec6('0x70')],['ids','id'])||{});}})[_0x0ec6('0x2b')](respondWithResult(_0x16dd60,null))[_0x0ec6('0x35')](handleError(_0x16dd60,null));};exports[_0x0ec6('0xbf')]=function(_0x5e726e,_0x798a9e,_0x57d02c){var _0x2e54c4={'raw':![],'where':{}};var _0x48edc3={};var _0x56d3ae={'count':0x0,'rows':[]};return db[_0x0ec6('0x9e')][_0x0ec6('0xc0')]({'where':{'id':_0x5e726e[_0x0ec6('0xb6')]['id']}})[_0x0ec6('0x2b')](handleEntityNotFound(_0x798a9e,null))[_0x0ec6('0x2b')](function(_0x2f9715){if(_0x2f9715){_0x48edc3[_0x0ec6('0x3a')]=_[_0x0ec6('0x72')](db[_0x0ec6('0xbd')]['rawAttributes']);_0x48edc3['query']=_[_0x0ec6('0x72')](_0x5e726e[_0x0ec6('0x3b')]);_0x48edc3[_0x0ec6('0x3c')]=_[_0x0ec6('0x3d')](_0x48edc3[_0x0ec6('0x3a')],_0x48edc3[_0x0ec6('0x3b')]);_0x2e54c4[_0x0ec6('0x3e')]=_[_0x0ec6('0x3d')](_0x48edc3['model'],qs['fields'](_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x3f')]));_0x2e54c4[_0x0ec6('0x3e')]=_0x2e54c4[_0x0ec6('0x3e')][_0x0ec6('0x66')]?_0x2e54c4[_0x0ec6('0x3e')]:_0x48edc3[_0x0ec6('0x3a')];if(!_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x40')](_0x0ec6('0x41'))){_0x2e54c4[_0x0ec6('0x23')]=qs[_0x0ec6('0x23')](_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x23')]);_0x2e54c4[_0x0ec6('0x21')]=qs[_0x0ec6('0x21')](_0x5e726e['query'][_0x0ec6('0x21')]);}_0x2e54c4[_0x0ec6('0x42')]=qs['sort'](_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x43')]);_0x2e54c4[_0x0ec6('0x74')]=qs[_0x0ec6('0x3c')](_[_0x0ec6('0x44')](_0x5e726e[_0x0ec6('0x3b')],_0x48edc3['filters']));_0x2e54c4['where'][_0x0ec6('0xc1')]=_0x2f9715['id'];if(_0x5e726e[_0x0ec6('0x3b')]['filter']){_0x2e54c4[_0x0ec6('0x74')]=_['merge'](_0x2e54c4[_0x0ec6('0x74')],{'$or':_[_0x0ec6('0x31')](_0x2e54c4['attributes'],function(_0x4ab17e){var _0x19d379={};_0x19d379[_0x4ab17e]={'$like':'%'+_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x83')]+'%'};return _0x19d379;})});}if(_0x5e726e[_0x0ec6('0x3b')][_0x0ec6('0x79')]){var _0x45707a=_0x5e726e[_0x0ec6('0x3b')]['$gte'][_0x0ec6('0x33')](',');var _0x592c9d={};_0x592c9d[_0x45707a[0x0]]={'$gte':moment(_0x45707a[0x1])[_0x0ec6('0xc2')](_0x0ec6('0xc3'))};_0x2e54c4['where']=_[_0x0ec6('0x9d')](_0x2e54c4['where'],_0x592c9d);}_0x2e54c4=_[_0x0ec6('0x9d')]({},_0x2e54c4,_0x5e726e['options']);return db[_0x0ec6('0xbd')][_0x0ec6('0x24')]({'where':_0x2e54c4[_0x0ec6('0x74')]})['then'](function(_0x47d5d5){_0x56d3ae['count']=_0x47d5d5;if(_0x5e726e['query'][_0x0ec6('0xb7')]){_0x2e54c4[_0x0ec6('0xb8')]=[{'all':!![]}];}return db[_0x0ec6('0xbd')]['findAll'](_0x2e54c4);})[_0x0ec6('0x2b')](function(_0x49f294){_0x56d3ae['rows']=_0x49f294;return _0x56d3ae;});}})[_0x0ec6('0x2b')](respondWithFilteredResult(_0x798a9e,_0x2e54c4))['catch'](handleError(_0x798a9e,null));};exports[_0x0ec6('0xc4')]=function(_0xb203de,_0x1f0c54,_0x5b52de){return db[_0x0ec6('0x9e')][_0x0ec6('0x5e')]({'where':{'id':_0xb203de['params']['id']}})['then'](handleEntityNotFound(_0x1f0c54,null))[_0x0ec6('0x2b')](function(_0xd23334){if(_0xd23334){return _0xd23334[_0x0ec6('0xc5')](_0xb203de[_0x0ec6('0x70')][_0x0ec6('0xbe')],_[_0x0ec6('0xc6')](_0xb203de['body'],[_0x0ec6('0xbe'),'id'])||{})[_0x0ec6('0xc7')](function(){return db[_0x0ec6('0x6b')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0xb203de[_0x0ec6('0x70')][_0x0ec6('0xbe')]}});})[_0x0ec6('0x2b')](function(_0x5d48a3){socket[_0x0ec6('0xc8')](_0x0ec6('0xc9'),{'id':Number(_0xb203de['params']['id']),'tags':_0x5d48a3||[]});return{'id':Number(_0xb203de[_0x0ec6('0xb6')]['id']),'tags':_0x5d48a3||[]};});}})[_0x0ec6('0x2b')](respondWithResult(_0x1f0c54,null))[_0x0ec6('0x35')](handleError(_0x1f0c54,null));};exports[_0x0ec6('0xca')]=function(_0x194072,_0x4a623f,_0x3472b7){return db[_0x0ec6('0x9e')][_0x0ec6('0x5e')]({'where':{'id':_0x194072[_0x0ec6('0xb6')]['id']}})[_0x0ec6('0x2b')](handleEntityNotFound(_0x4a623f,null))[_0x0ec6('0x2b')](function(_0x2ac834){if(_0x2ac834){return _0x2ac834['removeTags'](_0x194072['query'][_0x0ec6('0xbe')]);}})[_0x0ec6('0x2b')](respondWithStatusCode(_0x4a623f,null))['catch'](handleError(_0x4a623f,null));};exports[_0x0ec6('0xcb')]=function(_0x45a14a,_0x1f7afe){var _0x296e42=moment()['unix']()[_0x0ec6('0x9b')]();var _0x49423b=path[_0x0ec6('0xcc')](config[_0x0ec6('0xcd')],_0x0ec6('0xce'),_0x0ec6('0xcf'),'tmp');var _0x51f017=path[_0x0ec6('0xcc')](config[_0x0ec6('0xcd')],_0x0ec6('0xce'),_0x0ec6('0xcf'),_0x0ec6('0xd0'));var _0x20731d=path[_0x0ec6('0xcc')](_0x49423b,_0x296e42);var _0x28fca4=util[_0x0ec6('0xc2')](_0x0ec6('0xd1'),_0x45a14a['params']['id'],_0x296e42);var _0xb682c4=path[_0x0ec6('0xcc')](_0x49423b,_0x28fca4);var _0x1ce7b5=[];_0x1ce7b5[_0x0ec6('0x34')]({'model':db[_0x0ec6('0x6e')],'as':_0x0ec6('0x6e'),'attributes':['id',_0x0ec6('0xd2')],'raw':!![]});_0x1ce7b5[_0x0ec6('0x34')]({'model':db[_0x0ec6('0xd3')],'as':'Contact','attributes':['id',_0x0ec6('0xd4'),_0x0ec6('0xd5')],'raw':!![]});if(_0x45a14a[_0x0ec6('0x3b')]['attachments']){_0x1ce7b5[_0x0ec6('0x34')]({'model':db[_0x0ec6('0xd6')],'as':_0x0ec6('0xd6'),'raw':!![]});}var _0x4303fb=[{'model':db[_0x0ec6('0xbd')],'as':_0x0ec6('0xd7'),'attributes':['id',_0x0ec6('0x70'),'createdAt',_0x0ec6('0xd8'),_0x0ec6('0xd9'),_0x0ec6('0x7d')],'include':_0x1ce7b5}];_0x4303fb['push']({'model':db[_0x0ec6('0xda')],'as':_0x0ec6('0xdb'),'attributes':['id',_0x0ec6('0x2e')]});_0x4303fb[_0x0ec6('0x34')]({'model':db[_0x0ec6('0x6e')],'as':_0x0ec6('0xdc'),'attributes':['id',_0x0ec6('0xd2')]});return db['OpenchannelInteraction'][_0x0ec6('0x5e')]({'where':{'id':_0x45a14a['params']['id']},'include':_0x4303fb})[_0x0ec6('0x2b')](handleEntityNotFound(_0x1f7afe,null))[_0x0ec6('0x2b')](function(_0x5e9f7a){if(_0x5e9f7a){var _0x80d8ac=_0x5e9f7a['get']({'plain':!![]});fs['mkdirSync'](_0x20731d);var _0x493840={'channel':'Openchannel','account':_0x80d8ac[_0x0ec6('0xdb')]['name'],'agent':_0x80d8ac[_0x0ec6('0xdc')]?_0x80d8ac[_0x0ec6('0xdc')][_0x0ec6('0xd2')]:_0x0ec6('0xdd'),'createdAt':moment(_0x80d8ac['createdAt'])[_0x0ec6('0xc2')](_0x0ec6('0xc3'))[_0x0ec6('0x9b')](),'closedAt':_0x80d8ac[_0x0ec6('0xde')]?moment(_0x80d8ac[_0x0ec6('0xdf')])[_0x0ec6('0xc2')](_0x0ec6('0xc3'))[_0x0ec6('0x9b')]():'','disposition':_0x80d8ac[_0x0ec6('0xe0')],'visibility':_0x80d8ac['threadId']?_0x0ec6('0xe1'):'Private','messages':_(_0x80d8ac[_0x0ec6('0xd7')])[_0x0ec6('0x83')]({'secret':![]})[_0x0ec6('0x31')](function(_0x13caa9){if(_0x13caa9[_0x0ec6('0xd6')]){var _0x301996=path[_0x0ec6('0xcc')](_0x51f017,_0x13caa9[_0x0ec6('0xd6')]['basename']);if(fs[_0x0ec6('0xe2')](_0x301996)){fs['createReadStream'](_0x301996)['pipe'](fs[_0x0ec6('0xe3')](path[_0x0ec6('0xcc')](_0x20731d,_0x13caa9[_0x0ec6('0xd6')]['basename'])));}}return{'date':moment(_0x13caa9[_0x0ec6('0x77')])[_0x0ec6('0xc2')](_0x0ec6('0xc3'))[_0x0ec6('0x9b')](),'sender':_0x13caa9['direction']==='out'?_0x13caa9[_0x0ec6('0x6e')]?_0x13caa9[_0x0ec6('0x6e')][_0x0ec6('0xd2')]:_0x0ec6('0xe4'):_0x13caa9[_0x0ec6('0x62')][_0x0ec6('0xd4')]+(_0x13caa9[_0x0ec6('0x62')]['lastName']?'\x20'+_0x13caa9[_0x0ec6('0x62')]['lastName']:''),'body':_0x13caa9['Attachment']?_0x13caa9['Attachment']['basename']:_0x13caa9[_0x0ec6('0x70')],'direction':_0x13caa9[_0x0ec6('0xd8')]===_0x0ec6('0xe5')?'A':'C','secret':_0x13caa9['secret'],'read':_0x13caa9[_0x0ec6('0x7d')],'attachment':_0x13caa9[_0x0ec6('0xd6')]};})['value']()};return ejs[_0x0ec6('0xe6')](path[_0x0ec6('0xcc')](config[_0x0ec6('0xcd')],_0x0ec6('0xce'),'views',_0x0ec6('0xe7')),{'interaction':_0x493840})[_0x0ec6('0x2b')](function(_0x3bf75e){var _0x22dc0d=path[_0x0ec6('0xcc')](_0x20731d,_0x0ec6('0xe8')+_0x80d8ac['id']+'-'+_0x296e42+_0x0ec6('0xe9'));var _0xa13258={'path':_0x22dc0d,'channel':_0x0ec6('0xea'),'interactionId':_0x80d8ac['id']};return pdf[_0x0ec6('0xeb')](_0x3bf75e,_0xa13258);})[_0x0ec6('0x2b')](function(){return new BPromise(function(_0x13bc9e,_0x50e85a){zipdir(_0x20731d,{'saveTo':_0xb682c4},function(_0x358b9e,_0x17dd6d){if(_0x358b9e)return _0x50e85a(_0x358b9e);return _0x13bc9e(_0x17dd6d);});})[_0x0ec6('0x2b')](function(){return new BPromise(function(_0x35980f,_0x2716f7){rimraf(_0x20731d,function(_0x18e63d){if(_0x18e63d)_0x2716f7(_0x18e63d);return _0x35980f();});});})['then'](function(){return _0x1f7afe[_0x0ec6('0xcb')](_0xb682c4,_0x28fca4,function(_0x40dc15){if(_0x40dc15){console['log'](_0x0ec6('0xec'),_0x40dc15);}else{fs['unlinkSync'](_0xb682c4);}});});});}else{return _0x1f7afe['sendStatus'](0xc8);}})['catch'](handleError(_0x1f7afe,null));};
\ No newline at end of file
index 059dba3..b8d8dd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9886=['catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','then','setDataValue','findAll','unreadMessages','emit'];(function(_0x15d7f0,_0x4e5484){var _0x1ab6c2=function(_0x32d079){while(--_0x32d079){_0x15d7f0['push'](_0x15d7f0['shift']());}};_0x1ab6c2(++_0x4e5484);}(_0x9886,0xf1));var _0x6988=function(_0x524691,_0x4a6ef8){_0x524691=_0x524691-0x0;var _0x326001=_0x9886[_0x524691];return _0x326001;};'use strict';var EventEmitter=require(_0x6988('0x0'));var OpenchannelInteraction=require(_0x6988('0x1'))['db'][_0x6988('0x2')];var OpenchannelMessage=require(_0x6988('0x1'))['db'][_0x6988('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6988('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6988('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2fb30a){return function(_0x6060d1,_0x365716,_0x30ee66){_0x6060d1['getUsers']({'attributes':['id'],'raw':!![]})[_0x6988('0x6')](function(_0x2da586){_0x6060d1[_0x6988('0x7')]('Users',_0x2da586['map'](function(_0x12014e){return{'id':_0x12014e['id']};}));return OpenchannelMessage[_0x6988('0x8')]({'where':{'OpenchannelInteractionId':_0x6060d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6988('0x6')](function(_0x27fda2){_0x6060d1['setDataValue'](_0x6988('0x9'),_0x27fda2['length']);OpenchannelInteractionEvents[_0x6988('0xa')](_0x2fb30a+':'+_0x6060d1['id'],_0x6060d1);OpenchannelInteractionEvents[_0x6988('0xa')](_0x2fb30a,_0x6060d1);_0x30ee66(null);})[_0x6988('0xb')](_0x30ee66(null));};}for(var e in events){if(events[_0x6988('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x6988('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x8959=['OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','OpenchannelInteraction','../../mysqldb'];(function(_0xc8be2e,_0x12485a){var _0x4bb08=function(_0x2ff397){while(--_0x2ff397){_0xc8be2e['push'](_0xc8be2e['shift']());}};_0x4bb08(++_0x12485a);}(_0x8959,0x1eb));var _0x9895=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x8959[_0x57da0a];return _0x3145d5;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x9895('0x0')];var OpenchannelMessage=require(_0x9895('0x1'))['db'][_0x9895('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9895('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9895('0x4')};function emitEvent(_0x38b8b){return function(_0x5a8845,_0xb4b89f,_0x50a062){_0x5a8845[_0x9895('0x5')]({'attributes':['id'],'raw':!![]})[_0x9895('0x6')](function(_0x1e45c2){_0x5a8845[_0x9895('0x7')](_0x9895('0x8'),_0x1e45c2[_0x9895('0x9')](function(_0x3bb668){return{'id':_0x3bb668['id']};}));return OpenchannelMessage[_0x9895('0xa')]({'where':{'OpenchannelInteractionId':_0x5a8845['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9895('0x6')](function(_0x77f4c5){_0x5a8845[_0x9895('0x7')]('unreadMessages',_0x77f4c5[_0x9895('0xb')]);OpenchannelInteractionEvents['emit'](_0x38b8b+':'+_0x5a8845['id'],_0x5a8845);OpenchannelInteractionEvents[_0x9895('0xc')](_0x38b8b,_0x5a8845);_0x50a062(null);})[_0x9895('0xd')](_0x50a062(null));};}for(var e in events){if(events[_0x9895('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x9895('0xf')](e,emitEvent(event));}}module[_0x9895('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 2cbc0ac..eb0e271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec0c=['path','rimraf','../../config/environment','exports','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec0c,0x15f));var _0xcec0=function(_0x4636e9,_0x31f91e){_0x4636e9=_0x4636e9-0x0;var _0x2f3e08=_0xec0c[_0x4636e9];return _0x2f3e08;};'use strict';var _=require(_0xcec0('0x0'));var util=require(_0xcec0('0x1'));var logger=require('../../config/logger')(_0xcec0('0x2'));var moment=require(_0xcec0('0x3'));var BPromise=require(_0xcec0('0x4'));var rp=require(_0xcec0('0x5'));var fs=require('fs');var path=require(_0xcec0('0x6'));var rimraf=require(_0xcec0('0x7'));var config=require(_0xcec0('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0xcec0('0x9')]=function(_0x586579,_0x268428){return _0x586579['define'](_0xcec0('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcec0('0xb'),'collate':_0xcec0('0xc'),'hooks':{'beforeUpdate':function(_0x2d0874,_0x303c56,_0x2aa8fb){if(_0x2d0874[_0xcec0('0xd')](_0xcec0('0xe'))){_0x2d0874[_0xcec0('0xf')]=moment()[_0xcec0('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2aa8fb(null,_0x2d0874);}}});};
\ No newline at end of file
+var _0x2a6b=['request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','util','../../config/logger','api','moment','bluebird'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2a6b,0x193));var _0xb2a6=function(_0x548d08,_0x283950){_0x548d08=_0x548d08-0x0;var _0x559eed=_0x2a6b[_0x548d08];return _0x559eed;};'use strict';var _=require('lodash');var util=require(_0xb2a6('0x0'));var logger=require(_0xb2a6('0x1'))(_0xb2a6('0x2'));var moment=require(_0xb2a6('0x3'));var BPromise=require(_0xb2a6('0x4'));var rp=require(_0xb2a6('0x5'));var fs=require('fs');var path=require(_0xb2a6('0x6'));var rimraf=require(_0xb2a6('0x7'));var config=require('../../config/environment');var attributes=require(_0xb2a6('0x8'));module[_0xb2a6('0x9')]=function(_0x449e51,_0x20bb13){return _0x449e51[_0xb2a6('0xa')](_0xb2a6('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2a6('0xc'),'collate':_0xb2a6('0xd'),'hooks':{'beforeUpdate':function(_0x493878,_0x553d52,_0x124d40){if(_0x493878[_0xb2a6('0xe')](_0xb2a6('0xf'))){_0x493878['closedAt']=moment()[_0xb2a6('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x124d40(null,_0x493878);}}});};
\ No newline at end of file
index eba13d5..60e44dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe099=['localhost','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelInteraction','update','body','options','where','limit','then','stringify','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults'];(function(_0x57c0b7,_0x38b3c7){var _0x17a93d=function(_0x21cf10){while(--_0x21cf10){_0x57c0b7['push'](_0x57c0b7['shift']());}};_0x17a93d(++_0x38b3c7);}(_0xe099,0xd2));var _0x9e09=function(_0x4564f1,_0x547042){_0x4564f1=_0x4564f1-0x0;var _0x48d947=_0xe099[_0x4564f1];return _0x48d947;};'use strict';var _=require(_0x9e09('0x0'));var util=require(_0x9e09('0x1'));var moment=require(_0x9e09('0x2'));var BPromise=require(_0x9e09('0x3'));var rs=require(_0x9e09('0x4'));var fs=require('fs');var Redis=require(_0x9e09('0x5'));var db=require(_0x9e09('0x6'))['db'];var utils=require(_0x9e09('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e09('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e09('0x9')]['http']({'port':0x232a});config[_0x9e09('0xa')]=_[_0x9e09('0xb')](config[_0x9e09('0xa')],{'host':_0x9e09('0xc'),'port':0x18eb});var socket=require(_0x9e09('0xd'))(new Redis(config[_0x9e09('0xa')]));require('./openchannelInteraction.socket')[_0x9e09('0xe')](socket);function respondWithRpcPromise(_0x14cf9f,_0x220414,_0x1167da){return new BPromise(function(_0x2a1511,_0x52b6c7){return client[_0x9e09('0xf')](_0x14cf9f,_0x1167da)['then'](function(_0x1c1128){logger[_0x9e09('0x10')](_0x9e09('0x11'),_0x220414,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x220414,_0x9e09('0x12'),JSON['stringify'](_0x1c1128));if(_0x1c1128['error']){if(_0x1c1128['error']['code']===0x1f4){logger[_0x9e09('0x13')](_0x9e09('0x11'),_0x220414,_0x1c1128['error'][_0x9e09('0x14')]);return _0x52b6c7(_0x1c1128[_0x9e09('0x13')]['message']);}logger[_0x9e09('0x13')](_0x9e09('0x11'),_0x220414,_0x1c1128[_0x9e09('0x13')][_0x9e09('0x14')]);return _0x2a1511(_0x1c1128['error'][_0x9e09('0x14')]);}else{logger[_0x9e09('0x10')](_0x9e09('0x11'),_0x220414,_0x9e09('0x12'));_0x2a1511(_0x1c1128[_0x9e09('0x15')][_0x9e09('0x14')]);}})[_0x9e09('0x16')](function(_0x5ade2b){logger[_0x9e09('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x220414,_0x5ade2b);_0x52b6c7(_0x5ade2b);});});}exports[_0x9e09('0x17')]=function(_0x49eee3){var _0x5e7fe2=this;return new Promise(function(_0xd3461c,_0x229af4){return db['OpenchannelInteraction'][_0x9e09('0x18')](_0x49eee3[_0x9e09('0x19')],{'raw':_0x49eee3['options']?_0x49eee3[_0x9e09('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49eee3[_0x9e09('0x1a')]?_0x49eee3[_0x9e09('0x1a')][_0x9e09('0x1b')]||null:null,'attributes':_0x49eee3[_0x9e09('0x1a')]?_0x49eee3['options']['attributes']||null:null,'limit':_0x49eee3['options']?_0x49eee3[_0x9e09('0x1a')][_0x9e09('0x1c')]||null:null})[_0x9e09('0x1d')](function(_0x45ea91){logger[_0x9e09('0x10')]('UpdateOpenchannelInteraction',_0x49eee3);logger['debug'](_0x9e09('0x17'),_0x49eee3,JSON[_0x9e09('0x1e')](_0x45ea91));_0xd3461c(_0x45ea91);})['catch'](function(_0x6dd989){logger[_0x9e09('0x13')]('UpdateOpenchannelInteraction',_0x6dd989[_0x9e09('0x14')],_0x49eee3);_0x229af4(_0x5e7fe2[_0x9e09('0x13')](0x1f4,_0x6dd989[_0x9e09('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x387c03){return new Promise(function(_0x3005fe,_0x19d808){return db['OpenchannelInteraction'][_0x9e09('0x1f')]({'where':_0x387c03[_0x9e09('0x1a')]?_0x387c03[_0x9e09('0x1a')][_0x9e09('0x1b')]||null:null})[_0x9e09('0x1d')](function(_0x4b2c32){if(_0x4b2c32){return _0x4b2c32[_0x9e09('0x20')](_0x387c03[_0x9e09('0x19')]['ids'],_[_0x9e09('0x21')](_0x387c03['body'],[_0x9e09('0x22'),'id'])||{});}})[_0x9e09('0x23')](function(_0x4ad263){logger[_0x9e09('0x10')](_0x9e09('0x24'),_0x387c03);logger['debug'](_0x9e09('0x24'),_0x387c03,JSON[_0x9e09('0x1e')](_0x4ad263));_0x3005fe(_0x4ad263);})[_0x9e09('0x16')](function(_0x466f4e){logger[_0x9e09('0x13')](_0x9e09('0x24'),_0x466f4e[_0x9e09('0x14')],_0x387c03);_0x19d808(_this[_0x9e09('0x13')](0x1f4,_0x466f4e[_0x9e09('0x14')]));});});};
\ No newline at end of file
+var _0xa17e=['limit','debug','stringify','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes'];(function(_0x4736cf,_0x4fab78){var _0x12507d=function(_0x4aabda){while(--_0x4aabda){_0x4736cf['push'](_0x4736cf['shift']());}};_0x12507d(++_0x4fab78);}(_0xa17e,0xb7));var _0xea17=function(_0x548529,_0x26b1b2){_0x548529=_0x548529-0x0;var _0x53c9e9=_0xa17e[_0x548529];return _0x53c9e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xea17('0x0'));var rs=require(_0xea17('0x1'));var fs=require('fs');var Redis=require(_0xea17('0x2'));var db=require(_0xea17('0x3'))['db'];var utils=require(_0xea17('0x4'));var logger=require(_0xea17('0x5'))(_0xea17('0x6'));var config=require(_0xea17('0x7'));var jayson=require(_0xea17('0x8'));var client=jayson[_0xea17('0x9')][_0xea17('0xa')]({'port':0x232a});config[_0xea17('0xb')]=_[_0xea17('0xc')](config['redis'],{'host':_0xea17('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea17('0xb')]));require(_0xea17('0xe'))['register'](socket);function respondWithRpcPromise(_0xa61fd4,_0x35dcd0,_0xa40874){return new BPromise(function(_0x1ad810,_0x82cac7){return client[_0xea17('0xf')](_0xa61fd4,_0xa40874)['then'](function(_0xa03e6){logger[_0xea17('0x10')](_0xea17('0x11'),_0x35dcd0,_0xea17('0x12'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x35dcd0,_0xea17('0x12'),JSON['stringify'](_0xa03e6));if(_0xa03e6[_0xea17('0x13')]){if(_0xa03e6['error'][_0xea17('0x14')]===0x1f4){logger[_0xea17('0x13')](_0xea17('0x11'),_0x35dcd0,_0xa03e6['error'][_0xea17('0x15')]);return _0x82cac7(_0xa03e6[_0xea17('0x13')][_0xea17('0x15')]);}logger[_0xea17('0x13')](_0xea17('0x11'),_0x35dcd0,_0xa03e6[_0xea17('0x13')][_0xea17('0x15')]);return _0x1ad810(_0xa03e6[_0xea17('0x13')][_0xea17('0x15')]);}else{logger[_0xea17('0x10')](_0xea17('0x11'),_0x35dcd0,'request\x20sent');_0x1ad810(_0xa03e6[_0xea17('0x16')][_0xea17('0x15')]);}})[_0xea17('0x17')](function(_0x595fc2){logger[_0xea17('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x35dcd0,_0x595fc2);_0x82cac7(_0x595fc2);});});}exports[_0xea17('0x18')]=function(_0x46b0f6){var _0x545e01=this;return new Promise(function(_0x84839a,_0x4618f7){return db[_0xea17('0x19')][_0xea17('0x1a')](_0x46b0f6[_0xea17('0x1b')],{'raw':_0x46b0f6[_0xea17('0x1c')]?_0x46b0f6[_0xea17('0x1c')][_0xea17('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46b0f6[_0xea17('0x1c')]?_0x46b0f6[_0xea17('0x1c')][_0xea17('0x1e')]||null:null,'attributes':_0x46b0f6['options']?_0x46b0f6[_0xea17('0x1c')][_0xea17('0x1f')]||null:null,'limit':_0x46b0f6[_0xea17('0x1c')]?_0x46b0f6[_0xea17('0x1c')][_0xea17('0x20')]||null:null})['then'](function(_0x20039e){logger[_0xea17('0x10')](_0xea17('0x18'),_0x46b0f6);logger[_0xea17('0x21')](_0xea17('0x18'),_0x46b0f6,JSON[_0xea17('0x22')](_0x20039e));_0x84839a(_0x20039e);})['catch'](function(_0x250078){logger['error'](_0xea17('0x18'),_0x250078['message'],_0x46b0f6);_0x4618f7(_0x545e01[_0xea17('0x13')](0x1f4,_0x250078['message']));});});};exports[_0xea17('0x23')]=function(_0xcf66bc){return new Promise(function(_0x24c39a,_0x65bece){return db['OpenchannelInteraction'][_0xea17('0x24')]({'where':_0xcf66bc[_0xea17('0x1c')]?_0xcf66bc[_0xea17('0x1c')][_0xea17('0x1e')]||null:null})[_0xea17('0x25')](function(_0x250d8c){if(_0x250d8c){return _0x250d8c[_0xea17('0x26')](_0xcf66bc['body'][_0xea17('0x27')],_[_0xea17('0x28')](_0xcf66bc[_0xea17('0x1b')],['ids','id'])||{});}})[_0xea17('0x29')](function(_0x107c45){logger[_0xea17('0x10')](_0xea17('0x2a'),_0xcf66bc);logger[_0xea17('0x21')]('AddTags',_0xcf66bc,JSON['stringify'](_0x107c45));_0x24c39a(_0x107c45);})[_0xea17('0x17')](function(_0x21fcb2){logger['error'](_0xea17('0x2a'),_0x21fcb2[_0xea17('0x15')],_0xcf66bc);_0x65bece(_this[_0xea17('0x13')](0x1f4,_0x21fcb2[_0xea17('0x15')]));});});};
\ No newline at end of file
index c64b3e9..5af2190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8a=['remove','emit','register','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0xed8a,0x1ae));var _0xaed8=function(_0x2eed70,_0x682dee){_0x2eed70=_0x2eed70-0x0;var _0xec92a7=_0xed8a[_0x2eed70];return _0xec92a7;};'use strict';var OpenchannelInteractionEvents=require(_0xaed8('0x0'));var events=[_0xaed8('0x1'),_0xaed8('0x2'),'update'];function createListener(_0x3607ca,_0x1b4600){return function(_0x5b8cb3){_0x1b4600[_0xaed8('0x3')](_0x3607ca,_0x5b8cb3);};}function removeListener(_0x2075b7,_0x32cac6){return function(){OpenchannelInteractionEvents['removeListener'](_0x2075b7,_0x32cac6);};}exports[_0xaed8('0x4')]=function(_0x103ce1){for(var _0x4c1858=0x0,_0x483775=events['length'];_0x4c1858<_0x483775;_0x4c1858++){var _0x32d2d7=events[_0x4c1858];var _0x66d1b6=createListener(_0xaed8('0x5')+_0x32d2d7,_0x103ce1);OpenchannelInteractionEvents['on'](_0x32d2d7,_0x66d1b6);}};
\ No newline at end of file
+var _0x9915=['update','emit','removeListener','register','length','./openchannelInteraction.events','save','remove'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9915,0x1bd));var _0x5991=function(_0x265882,_0x2c01e9){_0x265882=_0x265882-0x0;var _0x11c5e2=_0x9915[_0x265882];return _0x11c5e2;};'use strict';var OpenchannelInteractionEvents=require(_0x5991('0x0'));var events=[_0x5991('0x1'),_0x5991('0x2'),_0x5991('0x3')];function createListener(_0x58145c,_0x28de29){return function(_0x587fb0){_0x28de29[_0x5991('0x4')](_0x58145c,_0x587fb0);};}function removeListener(_0x5a2670,_0x4813fc){return function(){OpenchannelInteractionEvents[_0x5991('0x5')](_0x5a2670,_0x4813fc);};}exports[_0x5991('0x6')]=function(_0x3dff84){for(var _0x1d8135=0x0,_0x294e7a=events[_0x5991('0x7')];_0x1d8135<_0x294e7a;_0x1d8135++){var _0x14a8d3=events[_0x1d8135];var _0x4caafc=createListener('openchannelInteraction:'+_0x14a8d3,_0x3dff84);OpenchannelInteractionEvents['on'](_0x14a8d3,_0x4caafc);}};
\ No newline at end of file
index dfe641a..02e9450 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x845672,_0x2a2b2a){var _0x24f4b4=function(_0x1108d7){while(--_0x1108d7){_0x845672['push'](_0x845672['shift']());}};_0x24f4b4(++_0x2a2b2a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x2cf062,_0x3c15c6){var _0x376203=function(_0x23ca8e){while(--_0x23ca8e){_0x2cf062['push'](_0x2cf062['shift']());}};_0x376203(++_0x3c15c6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xcb91[_0x58c20f];return _0x3b0318;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
index d834799..8ae58c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97db=['TEXT','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0x3451ab,_0x4bfb11){var _0x406e89=function(_0xe142c7){while(--_0xe142c7){_0x3451ab['push'](_0x3451ab['shift']());}};_0x406e89(++_0x4bfb11);}(_0x97db,0x1b4));var _0xb97d=function(_0x171e1e,_0x45ae7b){_0x171e1e=_0x171e1e-0x0;var _0x178377=_0x97db[_0x171e1e];return _0x178377;};'use strict';var Sequelize=require(_0xb97d('0x0'));module[_0xb97d('0x1')]={'body':{'type':Sequelize[_0xb97d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xb97d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb97d('0x4')]('in',_0xb97d('0x5')),'defaultValue':_0xb97d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb97d('0x2')]}};
\ No newline at end of file
+var _0x8286=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x193685,_0x2802b5){var _0x159aaa=function(_0x3789cb){while(--_0x3789cb){_0x193685['push'](_0x193685['shift']());}};_0x159aaa(++_0x2802b5);}(_0x8286,0x66));var _0x6828=function(_0x515379,_0x2cd970){_0x515379=_0x515379-0x0;var _0x2db7d6=_0x8286[_0x515379];return _0x2db7d6;};'use strict';var Sequelize=require(_0x6828('0x0'));module[_0x6828('0x1')]={'body':{'type':Sequelize[_0x6828('0x2')](_0x6828('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6828('0x5')]('in',_0x6828('0x6')),'defaultValue':_0x6828('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6828('0x7')]},'providerName':{'type':Sequelize[_0x6828('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 3145b9d..6cba606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ba9=['../../mysqldb','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','sequelize','Sequelize','QueryTypes','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x34cc9f,_0x4d891a){var _0x1991d3=function(_0x47284b){while(--_0x47284b){_0x34cc9f['push'](_0x34cc9f['shift']());}};_0x1991d3(++_0x4d891a);}(_0x5ba9,0x17f));var _0x95ba=function(_0x58c864,_0x40cd1c){_0x58c864=_0x58c864-0x0;var _0x5ed350=_0x5ba9[_0x58c864];return _0x5ed350;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95ba('0x0'));var zipdir=require(_0x95ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95ba('0x2'));var moment=require('moment');var BPromise=require(_0x95ba('0x3'));var Mustache=require(_0x95ba('0x4'));var util=require(_0x95ba('0x5'));var path=require(_0x95ba('0x6'));var sox=require(_0x95ba('0x7'));var csv=require(_0x95ba('0x8'));var ejs=require(_0x95ba('0x9'));var fs=require('fs');var fs_extra=require(_0x95ba('0xa'));var _=require(_0x95ba('0xb'));var squel=require(_0x95ba('0xc'));var crypto=require(_0x95ba('0xd'));var jsforce=require(_0x95ba('0xe'));var deskjs=require(_0x95ba('0xf'));var toCsv=require(_0x95ba('0x8'));var querystring=require(_0x95ba('0x10'));var Papa=require(_0x95ba('0x11'));var Redis=require('ioredis');var authService=require(_0x95ba('0x12'));var qs=require(_0x95ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95ba('0x14'));var logger=require('../../config/logger')(_0x95ba('0x15'));var utils=require(_0x95ba('0x16'));var config=require(_0x95ba('0x17'));var licenseUtil=require(_0x95ba('0x18'));var db=require(_0x95ba('0x19'))['db'];config[_0x95ba('0x1a')]=_['defaults'](config['redis'],{'host':_0x95ba('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95ba('0x1a')]));require(_0x95ba('0x1c'))[_0x95ba('0x1d')](socket);var jayson=require(_0x95ba('0x1e'));var client=jayson[_0x95ba('0x1f')][_0x95ba('0x20')]({'port':0x232c});var client9002=jayson[_0x95ba('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x282f7c,_0x57e2fc,_0x27c3cb,_0x2bd069){return new BPromise(function(_0x7b37d3,_0x175784){var _0x32931a=_0x2bd069||client;return _0x32931a['request'](_0x282f7c,_0x27c3cb)[_0x95ba('0x21')](function(_0x3b5db9){logger[_0x95ba('0x22')](_0x95ba('0x23'),_0x57e2fc,_0x95ba('0x24'));logger[_0x95ba('0x25')](_0x95ba('0x26'),_0x57e2fc,_0x95ba('0x24'),JSON['stringify'](_0x3b5db9));if(_0x3b5db9['error']){if(_0x3b5db9['error'][_0x95ba('0x27')]===0x1f4){logger[_0x95ba('0x28')](_0x95ba('0x23'),_0x57e2fc,_0x3b5db9['error'][_0x95ba('0x29')]);return _0x175784(_0x3b5db9[_0x95ba('0x28')]['message']);}logger['error'](_0x95ba('0x23'),_0x57e2fc,_0x3b5db9['error'][_0x95ba('0x29')]);return _0x7b37d3(_0x3b5db9[_0x95ba('0x28')]['message']);}else{logger[_0x95ba('0x22')](_0x95ba('0x23'),_0x57e2fc,_0x95ba('0x24'));_0x7b37d3(_0x3b5db9[_0x95ba('0x2a')][_0x95ba('0x29')]);}})['catch'](function(_0x7de842){logger[_0x95ba('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x57e2fc,_0x7de842);_0x175784(_0x7de842);});});}function respondWithStatusCode(_0x1afc4a,_0x5e9d16){_0x5e9d16=_0x5e9d16||0xcc;return function(_0x33ca26){if(_0x33ca26){return _0x1afc4a[_0x95ba('0x2b')](_0x5e9d16);}return _0x1afc4a[_0x95ba('0x2c')](_0x5e9d16)[_0x95ba('0x2d')]();};}function respondWithResult(_0x9848e3,_0xa0603b){_0xa0603b=_0xa0603b||0xc8;return function(_0x4c2140){if(_0x4c2140){return _0x9848e3[_0x95ba('0x2c')](_0xa0603b)[_0x95ba('0x2e')](_0x4c2140);}};}function respondWithFilteredResult(_0x24339a,_0x2e34c0){return function(_0x34430f){if(_0x34430f){var _0x23e674=typeof _0x2e34c0['offset']==='undefined'&&typeof _0x2e34c0[_0x95ba('0x2f')]===_0x95ba('0x30');var _0x12fcd4=_0x34430f[_0x95ba('0x31')];var _0x1b31af=_0x23e674?0x0:_0x2e34c0[_0x95ba('0x32')];var _0x3fa769=_0x23e674?_0x34430f[_0x95ba('0x31')]:_0x2e34c0['offset']+_0x2e34c0[_0x95ba('0x2f')];var _0x53bee5;if(_0x3fa769>=_0x12fcd4){_0x3fa769=_0x12fcd4;_0x53bee5=0xc8;}else{_0x53bee5=0xce;}_0x24339a['status'](_0x53bee5);return _0x24339a[_0x95ba('0x33')](_0x95ba('0x34'),_0x1b31af+'-'+_0x3fa769+'/'+_0x12fcd4)[_0x95ba('0x2e')](_0x34430f);}return null;};}function patchUpdates(_0x28e0c1){return function(_0x46b92e){try{jsonpatch['apply'](_0x46b92e,_0x28e0c1,!![]);}catch(_0x392d6c){return BPromise['reject'](_0x392d6c);}return _0x46b92e[_0x95ba('0x35')]();};}function saveUpdates(_0xb5c8e0,_0x4b027f){return function(_0x25932a){if(_0x25932a){return _0x25932a['update'](_0xb5c8e0)[_0x95ba('0x21')](function(_0xa370ec){return _0xa370ec;});}return null;};}function removeEntity(_0x175989,_0x691800){return function(_0x41baf3){if(_0x41baf3){return _0x41baf3[_0x95ba('0x36')]()[_0x95ba('0x21')](function(){_0x175989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae718,_0x23bf03){return function(_0x21149a){if(!_0x21149a){_0x2ae718[_0x95ba('0x2b')](0x194);}return _0x21149a;};}function handleError(_0x532b44,_0xf9fe80){_0xf9fe80=_0xf9fe80||0x1f4;return function(_0x7c7620){logger[_0x95ba('0x28')](_0x7c7620[_0x95ba('0x37')]);if(_0x7c7620[_0x95ba('0x38')]){delete _0x7c7620[_0x95ba('0x38')];}_0x532b44[_0x95ba('0x2c')](_0xf9fe80)[_0x95ba('0x39')](_0x7c7620);};}exports[_0x95ba('0x3a')]=function(_0x1b83f9,_0x31f565){var _0x2cbded={},_0x23770a={},_0x3af1e6={'count':0x0,'rows':[]};var _0x12f954=_['map'](db[_0x95ba('0x3b')][_0x95ba('0x3c')],function(_0x3e4337){return{'name':_0x3e4337[_0x95ba('0x3d')],'type':_0x3e4337[_0x95ba('0x3e')][_0x95ba('0x3f')]};});_0x23770a[_0x95ba('0x40')]=_[_0x95ba('0x41')](_0x12f954,'name');_0x23770a[_0x95ba('0x42')]=_[_0x95ba('0x43')](_0x1b83f9[_0x95ba('0x42')]);_0x23770a[_0x95ba('0x44')]=_[_0x95ba('0x45')](_0x23770a[_0x95ba('0x40')],_0x23770a[_0x95ba('0x42')]);_0x2cbded[_0x95ba('0x46')]=_['intersection'](_0x23770a[_0x95ba('0x40')],qs[_0x95ba('0x47')](_0x1b83f9['query'][_0x95ba('0x47')]));_0x2cbded[_0x95ba('0x46')]=_0x2cbded[_0x95ba('0x46')][_0x95ba('0x48')]?_0x2cbded[_0x95ba('0x46')]:_0x23770a[_0x95ba('0x40')];if(!_0x1b83f9[_0x95ba('0x42')][_0x95ba('0x49')](_0x95ba('0x4a'))){_0x2cbded[_0x95ba('0x2f')]=qs['limit'](_0x1b83f9[_0x95ba('0x42')][_0x95ba('0x2f')]);_0x2cbded['offset']=qs[_0x95ba('0x32')](_0x1b83f9[_0x95ba('0x42')]['offset']);}_0x2cbded['order']=qs[_0x95ba('0x4b')](_0x1b83f9[_0x95ba('0x42')][_0x95ba('0x4b')]);_0x2cbded[_0x95ba('0x4c')]=qs['filters'](_[_0x95ba('0x4d')](_0x1b83f9[_0x95ba('0x42')],_0x23770a['filters']),_0x12f954);if(_0x1b83f9[_0x95ba('0x42')][_0x95ba('0x4e')]){_0x2cbded[_0x95ba('0x4c')]=_['merge'](_0x2cbded[_0x95ba('0x4c')],{'$or':_[_0x95ba('0x41')](_0x12f954,function(_0xd328f2){if(_0xd328f2[_0x95ba('0x3e')]!==_0x95ba('0x4f')){var _0x4ba75a={};_0x4ba75a[_0xd328f2[_0x95ba('0x38')]]={'$like':'%'+_0x1b83f9[_0x95ba('0x42')]['filter']+'%'};return _0x4ba75a;}})});}_0x2cbded=_[_0x95ba('0x50')]({},_0x2cbded,_0x1b83f9[_0x95ba('0x51')]);var _0x5bb42c={'where':_0x2cbded[_0x95ba('0x4c')]};return db[_0x95ba('0x3b')][_0x95ba('0x31')](_0x5bb42c)[_0x95ba('0x21')](function(_0xd8763a){_0x3af1e6[_0x95ba('0x31')]=_0xd8763a;if(_0x1b83f9[_0x95ba('0x42')][_0x95ba('0x52')]){_0x2cbded[_0x95ba('0x53')]=[{'all':!![]}];}return db[_0x95ba('0x3b')][_0x95ba('0x54')](_0x2cbded);})[_0x95ba('0x21')](function(_0xb01426){_0x3af1e6[_0x95ba('0x55')]=_0xb01426;return _0x3af1e6;})[_0x95ba('0x21')](respondWithFilteredResult(_0x31f565,_0x2cbded))[_0x95ba('0x56')](handleError(_0x31f565,null));};exports[_0x95ba('0x57')]=function(_0x1eae25,_0x370295){var _0x959a0e={'raw':!![],'where':{'id':_0x1eae25[_0x95ba('0x58')]['id']}},_0x16915a={};_0x16915a[_0x95ba('0x40')]=_[_0x95ba('0x43')](db[_0x95ba('0x3b')]['rawAttributes']);_0x16915a[_0x95ba('0x42')]=_[_0x95ba('0x43')](_0x1eae25['query']);_0x16915a[_0x95ba('0x44')]=_[_0x95ba('0x45')](_0x16915a[_0x95ba('0x40')],_0x16915a['query']);_0x959a0e[_0x95ba('0x46')]=_[_0x95ba('0x45')](_0x16915a['model'],qs[_0x95ba('0x47')](_0x1eae25[_0x95ba('0x42')][_0x95ba('0x47')]));_0x959a0e[_0x95ba('0x46')]=_0x959a0e['attributes'][_0x95ba('0x48')]?_0x959a0e['attributes']:_0x16915a[_0x95ba('0x40')];if(_0x1eae25[_0x95ba('0x42')]['includeAll']){_0x959a0e['include']=[{'all':!![]}];}_0x959a0e=_[_0x95ba('0x50')]({},_0x959a0e,_0x1eae25[_0x95ba('0x51')]);return db['OpenchannelMessage'][_0x95ba('0x59')](_0x959a0e)[_0x95ba('0x21')](handleEntityNotFound(_0x370295,null))['then'](respondWithResult(_0x370295,null))[_0x95ba('0x56')](handleError(_0x370295,null));};exports[_0x95ba('0x5a')]=function(_0x5c29c5,_0x499b64){return db[_0x95ba('0x3b')][_0x95ba('0x5a')](_0x5c29c5[_0x95ba('0x5b')],{})['then'](respondWithResult(_0x499b64,0xc9))[_0x95ba('0x56')](handleError(_0x499b64,null));};exports[_0x95ba('0x5c')]=function(_0x7b420f,_0x472215){if(_0x7b420f[_0x95ba('0x5b')]['id']){delete _0x7b420f[_0x95ba('0x5b')]['id'];}return db['OpenchannelMessage'][_0x95ba('0x59')]({'where':{'id':_0x7b420f[_0x95ba('0x58')]['id']}})[_0x95ba('0x21')](handleEntityNotFound(_0x472215,null))['then'](saveUpdates(_0x7b420f['body'],null))['then'](respondWithResult(_0x472215,null))[_0x95ba('0x56')](handleError(_0x472215,null));};exports[_0x95ba('0x36')]=function(_0x40fb30,_0x38c2b0){return db[_0x95ba('0x3b')][_0x95ba('0x59')]({'where':{'id':_0x40fb30['params']['id']}})['then'](handleEntityNotFound(_0x38c2b0,null))[_0x95ba('0x21')](removeEntity(_0x38c2b0,null))[_0x95ba('0x56')](handleError(_0x38c2b0,null));};exports[_0x95ba('0x5d')]=function(_0x50ae7c,_0x6381){return db['OpenchannelMessage'][_0x95ba('0x5d')]()['then'](respondWithResult(_0x6381,null))[_0x95ba('0x56')](handleError(_0x6381,null));};var interaction_log=require(_0x95ba('0x5e'))(_0x95ba('0x5f'));exports[_0x95ba('0x60')]=function(_0x5678e5,_0x2153c0,_0x5b1d12){var _0x43874e={'agent':{},'channel':_0x95ba('0x61')};if(_0x5678e5[_0x95ba('0x5b')]['id']){delete _0x5678e5[_0x95ba('0x5b')]['id'];}_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x62')]=!![];_0x5678e5['body'][_0x95ba('0x63')]=moment()[_0x95ba('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x65')]=_0x5678e5['body']['UserId']||_0x5678e5[_0x95ba('0x66')]['id'];_0x43874e['agent']['id']=_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x65')];return db[_0x95ba('0x3b')][_0x95ba('0x59')]({'where':{'id':_0x5678e5[_0x95ba('0x58')]['id'],'UserId':null}})[_0x95ba('0x21')](handleEntityNotFound(_0x2153c0,null))[_0x95ba('0x21')](saveUpdates(_0x5678e5[_0x95ba('0x5b')],null))[_0x95ba('0x21')](function(_0x547b4f){if(_0x547b4f){_0x43874e[_0x95ba('0x29')]=_0x547b4f[_0x95ba('0x67')]({'plain':!![]});return db[_0x95ba('0x68')][_0x95ba('0x59')]({'where':{'id':_0x547b4f[_0x95ba('0x69')]}});}return null;})[_0x95ba('0x21')](handleEntityNotFound(_0x2153c0,null))[_0x95ba('0x21')](function(_0x5d1a72){if(_0x5d1a72){return _0x5d1a72[_0x95ba('0x5c')]({'UserId':_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x65')],'read1stAt':_['isNil'](_0x5d1a72[_0x95ba('0x6a')])?moment()['format'](_0x95ba('0x6b')):undefined});}return null;})['then'](function(_0x1cae01){if(_0x1cae01){_0x43874e[_0x95ba('0x6c')]=_0x1cae01[_0x95ba('0x67')]({'plain':!![]});interaction_log[_0x95ba('0x22')](_0x95ba('0x6d'),_0x5678e5[_0x95ba('0x66')]['id'],_0x5678e5[_0x95ba('0x66')][_0x95ba('0x38')],_0x5678e5['user'][_0x95ba('0x6e')],_0x43874e[_0x95ba('0x6c')]['id'],_0x5678e5[_0x95ba('0x5b')]?JSON[_0x95ba('0x6f')](_0x5678e5[_0x95ba('0x5b')]):_0x95ba('0x70'));return respondWithRpcPromise(_0x95ba('0x71'),'acceptMessage',_0x43874e);}return null;})[_0x95ba('0x21')](function(_0x412b1d){var _0x1c8412='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x412b1d[_0x95ba('0x29')]['ContactId'];return db[_0x95ba('0x72')]['query'](_0x1c8412,{'type':db[_0x95ba('0x73')][_0x95ba('0x74')]['SELECT'],'raw':!![]})[_0x95ba('0x21')](function(_0x47ca96){return _0x47ca96;});})[_0x95ba('0x21')](function(_0x2dde3e){if(_0x2dde3e){_0x43874e[_0x95ba('0x29')]['contact']=_0x2dde3e[0x0];if(!_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x65')])return;return db['User'][_0x95ba('0x59')]({'where':{'id':_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x65')],'role':_0x95ba('0x75')},'attributes':['id',_0x95ba('0x38'),_0x95ba('0x76'),_0x95ba('0x77'),_0x95ba('0x78')],'raw':!![]});}return null;})['then'](function(_0x1c07c7){if(!_0x1c07c7)return null;_0x43874e[_0x95ba('0x29')][_0x95ba('0x75')]=_0x1c07c7;return _0x43874e;})[_0x95ba('0x21')](function(_0x4061a){if(_0x4061a){if(_0x5678e5[_0x95ba('0x5b')][_0x95ba('0x79')]){_0x43874e[_0x95ba('0x29')][_0x95ba('0x7a')]=util['format'](_0x95ba('0x7b'),_0x5678e5['user'][_0x95ba('0x38')]);_0x43874e[_0x95ba('0x29')][_0x95ba('0x7c')]=_0x43874e['channel'];_0x43874e[_0x95ba('0x29')][_0x95ba('0x7d')]=_0x95ba('0x60');return respondWithRpcPromise(_0x95ba('0x7e'),_0x95ba('0x7e'),{'event':_0x95ba('0x7f'),'message':_0x43874e[_0x95ba('0x29')]},client9002)[_0x95ba('0x21')](function(){return _0x43874e;});}return _0x43874e;}return null;})[_0x95ba('0x21')](respondWithResult(_0x2153c0,null))[_0x95ba('0x56')](handleError(_0x2153c0,null));};var interaction_log=require(_0x95ba('0x5e'))(_0x95ba('0x5f'));exports[_0x95ba('0x80')]=function(_0x5bee0c,_0x24d41b,_0x42846e){var _0x2df029={'agent':{},'channel':'openchannel'};if(_0x5bee0c[_0x95ba('0x5b')]['id']){delete _0x5bee0c[_0x95ba('0x5b')]['id'];}_0x5bee0c[_0x95ba('0x5b')]['UserId']=_0x5bee0c[_0x95ba('0x5b')][_0x95ba('0x65')]||_0x5bee0c[_0x95ba('0x66')]['id'];_0x2df029[_0x95ba('0x75')]['id']=_0x5bee0c[_0x95ba('0x5b')]['UserId'];return db[_0x95ba('0x3b')][_0x95ba('0x59')]({'where':{'id':_0x5bee0c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24d41b,null))['then'](function(_0x581197){if(_0x581197){_0x2df029[_0x95ba('0x29')]=_0x581197[_0x95ba('0x67')]({'plain':!![]});return db[_0x95ba('0x68')][_0x95ba('0x59')]({'where':{'id':_0x581197['OpenchannelInteractionId']}});}return null;})[_0x95ba('0x21')](handleEntityNotFound(_0x24d41b,null))[_0x95ba('0x21')](function(_0x299404){if(_0x299404){_0x2df029[_0x95ba('0x6c')]=_0x299404[_0x95ba('0x67')]({'plain':!![]});interaction_log[_0x95ba('0x22')](_0x95ba('0x81'),_0x5bee0c[_0x95ba('0x66')]['id'],_0x5bee0c[_0x95ba('0x66')]['name'],_0x5bee0c[_0x95ba('0x66')][_0x95ba('0x6e')],_0x2df029[_0x95ba('0x6c')]['id'],_0x5bee0c[_0x95ba('0x5b')]?JSON[_0x95ba('0x6f')](_0x5bee0c[_0x95ba('0x5b')]):_0x95ba('0x70'));return respondWithRpcPromise(_0x95ba('0x82'),_0x95ba('0x83'),_0x2df029);}return null;})['then'](function(_0x3716cc){var _0xb52cdc=_0x95ba('0x84')+_0x3716cc['message'][_0x95ba('0x85')];return db[_0x95ba('0x72')]['query'](_0xb52cdc,{'type':db[_0x95ba('0x73')][_0x95ba('0x74')]['SELECT'],'raw':!![]})[_0x95ba('0x21')](function(_0x20319f){return _0x20319f;});})[_0x95ba('0x21')](function(_0x515502){if(_0x515502){_0x2df029[_0x95ba('0x29')][_0x95ba('0x86')]=_0x515502[0x0];if(!_0x5bee0c[_0x95ba('0x5b')][_0x95ba('0x65')])return;return db[_0x95ba('0x87')][_0x95ba('0x59')]({'where':{'id':_0x5bee0c[_0x95ba('0x5b')][_0x95ba('0x65')],'role':_0x95ba('0x75')},'attributes':['id',_0x95ba('0x38'),_0x95ba('0x76'),_0x95ba('0x77'),_0x95ba('0x78')],'raw':!![]});}return null;})['then'](function(_0x234f89){if(!_0x234f89)return null;_0x2df029[_0x95ba('0x29')][_0x95ba('0x75')]=_0x234f89;return _0x2df029;})[_0x95ba('0x21')](function(_0x39e2cf){if(_0x39e2cf){_0x39e2cf[_0x95ba('0x29')][_0x95ba('0x7a')]=util[_0x95ba('0x64')](_0x95ba('0x7b'),_0x5bee0c[_0x95ba('0x66')][_0x95ba('0x38')]);_0x39e2cf[_0x95ba('0x29')][_0x95ba('0x7c')]=_0x2df029[_0x95ba('0x7c')];_0x39e2cf['message']['event']=_0x95ba('0x80');respondWithRpcPromise('EventManager',_0x95ba('0x7e'),{'event':'rejectmessage','message':_0x39e2cf[_0x95ba('0x29')]},client9002);return _0x2df029;}return null;})[_0x95ba('0x21')](respondWithResult(_0x24d41b,null))[_0x95ba('0x56')](handleError(_0x24d41b,null));};
\ No newline at end of file
+var _0x0a1c=['json','undefined','limit','count','offset','set','save','update','destroy','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','findAll','params','keys','include','options','find','create','body','describe','openchannel-interactions','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','format','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','zip-dir','fast-json-patch','request-promise','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end'];(function(_0x6b8d0d,_0x3b1d9d){var _0x3fe5e7=function(_0x161dfd){while(--_0x161dfd){_0x6b8d0d['push'](_0x6b8d0d['shift']());}};_0x3fe5e7(++_0x3b1d9d);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x0a1c[_0x4d45c1];return _0x244478;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0a1('0x0'));var jsonpatch=require(_0xc0a1('0x1'));var rp=require(_0xc0a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0a1('0x3'));var util=require(_0xc0a1('0x4'));var path=require(_0xc0a1('0x5'));var sox=require(_0xc0a1('0x6'));var csv=require(_0xc0a1('0x7'));var ejs=require(_0xc0a1('0x8'));var fs=require('fs');var fs_extra=require(_0xc0a1('0x9'));var _=require(_0xc0a1('0xa'));var squel=require(_0xc0a1('0xb'));var crypto=require(_0xc0a1('0xc'));var jsforce=require(_0xc0a1('0xd'));var deskjs=require(_0xc0a1('0xe'));var toCsv=require(_0xc0a1('0x7'));var querystring=require(_0xc0a1('0xf'));var Papa=require(_0xc0a1('0x10'));var Redis=require(_0xc0a1('0x11'));var authService=require(_0xc0a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc0a1('0x13'));var hardwareService=require(_0xc0a1('0x14'));var logger=require(_0xc0a1('0x15'))('api');var utils=require(_0xc0a1('0x16'));var config=require(_0xc0a1('0x17'));var licenseUtil=require(_0xc0a1('0x18'));var db=require('../../mysqldb')['db'];config[_0xc0a1('0x19')]=_[_0xc0a1('0x1a')](config['redis'],{'host':_0xc0a1('0x1b'),'port':0x18eb});var socket=require(_0xc0a1('0x1c'))(new Redis(config[_0xc0a1('0x19')]));require(_0xc0a1('0x1d'))[_0xc0a1('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc0a1('0x1f')]({'port':0x232c});var client9002=jayson[_0xc0a1('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a3e1d,_0x8aa354,_0x38170d,_0x587c1e){return new BPromise(function(_0x334cc4,_0xcec062){var _0x27ad22=_0x587c1e||client;return _0x27ad22[_0xc0a1('0x21')](_0x5a3e1d,_0x38170d)[_0xc0a1('0x22')](function(_0x124d0f){logger[_0xc0a1('0x23')](_0xc0a1('0x24'),_0x8aa354,_0xc0a1('0x25'));logger[_0xc0a1('0x26')](_0xc0a1('0x27'),_0x8aa354,_0xc0a1('0x25'),JSON[_0xc0a1('0x28')](_0x124d0f));if(_0x124d0f[_0xc0a1('0x29')]){if(_0x124d0f[_0xc0a1('0x29')][_0xc0a1('0x2a')]===0x1f4){logger['error'](_0xc0a1('0x24'),_0x8aa354,_0x124d0f['error'][_0xc0a1('0x2b')]);return _0xcec062(_0x124d0f[_0xc0a1('0x29')][_0xc0a1('0x2b')]);}logger[_0xc0a1('0x29')](_0xc0a1('0x24'),_0x8aa354,_0x124d0f['error'][_0xc0a1('0x2b')]);return _0x334cc4(_0x124d0f[_0xc0a1('0x29')][_0xc0a1('0x2b')]);}else{logger[_0xc0a1('0x23')](_0xc0a1('0x24'),_0x8aa354,_0xc0a1('0x25'));_0x334cc4(_0x124d0f[_0xc0a1('0x2c')][_0xc0a1('0x2b')]);}})[_0xc0a1('0x2d')](function(_0x161bff){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x8aa354,_0x161bff);_0xcec062(_0x161bff);});});}function respondWithStatusCode(_0x17806a,_0xcd9b89){_0xcd9b89=_0xcd9b89||0xcc;return function(_0x5b5d13){if(_0x5b5d13){return _0x17806a['sendStatus'](_0xcd9b89);}return _0x17806a[_0xc0a1('0x2e')](_0xcd9b89)[_0xc0a1('0x2f')]();};}function respondWithResult(_0x4a5c37,_0x203ab8){_0x203ab8=_0x203ab8||0xc8;return function(_0x95b026){if(_0x95b026){return _0x4a5c37[_0xc0a1('0x2e')](_0x203ab8)[_0xc0a1('0x30')](_0x95b026);}};}function respondWithFilteredResult(_0x8f4588,_0x1814ac){return function(_0x114f76){if(_0x114f76){var _0x2bc99f=typeof _0x1814ac['offset']===_0xc0a1('0x31')&&typeof _0x1814ac[_0xc0a1('0x32')]===_0xc0a1('0x31');var _0x185ee4=_0x114f76[_0xc0a1('0x33')];var _0x38750d=_0x2bc99f?0x0:_0x1814ac['offset'];var _0x5741a6=_0x2bc99f?_0x114f76[_0xc0a1('0x33')]:_0x1814ac[_0xc0a1('0x34')]+_0x1814ac['limit'];var _0xa341c0;if(_0x5741a6>=_0x185ee4){_0x5741a6=_0x185ee4;_0xa341c0=0xc8;}else{_0xa341c0=0xce;}_0x8f4588['status'](_0xa341c0);return _0x8f4588[_0xc0a1('0x35')]('Content-Range',_0x38750d+'-'+_0x5741a6+'/'+_0x185ee4)[_0xc0a1('0x30')](_0x114f76);}return null;};}function patchUpdates(_0x2658dc){return function(_0x3016f4){try{jsonpatch['apply'](_0x3016f4,_0x2658dc,!![]);}catch(_0x3d84f6){return BPromise['reject'](_0x3d84f6);}return _0x3016f4[_0xc0a1('0x36')]();};}function saveUpdates(_0x1f78ee,_0x58c1a7){return function(_0x4268a7){if(_0x4268a7){return _0x4268a7[_0xc0a1('0x37')](_0x1f78ee)[_0xc0a1('0x22')](function(_0x3b4247){return _0x3b4247;});}return null;};}function removeEntity(_0x4719b5,_0x21937d){return function(_0x50012b){if(_0x50012b){return _0x50012b[_0xc0a1('0x38')]()[_0xc0a1('0x22')](function(){_0x4719b5[_0xc0a1('0x2e')](0xcc)[_0xc0a1('0x2f')]();});}};}function handleEntityNotFound(_0x27e8dd,_0x2fbd72){return function(_0x5f56a1){if(!_0x5f56a1){_0x27e8dd['sendStatus'](0x194);}return _0x5f56a1;};}function handleError(_0x198c10,_0x406dd1){_0x406dd1=_0x406dd1||0x1f4;return function(_0x226a3e){logger['error'](_0x226a3e['stack']);if(_0x226a3e[_0xc0a1('0x39')]){delete _0x226a3e[_0xc0a1('0x39')];}_0x198c10[_0xc0a1('0x2e')](_0x406dd1)['send'](_0x226a3e);};}exports[_0xc0a1('0x3a')]=function(_0x423da0,_0x5893ab){var _0x2cbeaa={},_0x34dc3b={},_0x56c1ec={'count':0x0,'rows':[]};var _0x3fa7cd=_[_0xc0a1('0x3b')](db[_0xc0a1('0x3c')][_0xc0a1('0x3d')],function(_0x442c1c){return{'name':_0x442c1c[_0xc0a1('0x3e')],'type':_0x442c1c[_0xc0a1('0x3f')][_0xc0a1('0x40')]};});_0x34dc3b['model']=_['map'](_0x3fa7cd,_0xc0a1('0x39'));_0x34dc3b[_0xc0a1('0x41')]=_['keys'](_0x423da0[_0xc0a1('0x41')]);_0x34dc3b[_0xc0a1('0x42')]=_[_0xc0a1('0x43')](_0x34dc3b[_0xc0a1('0x44')],_0x34dc3b[_0xc0a1('0x41')]);_0x2cbeaa[_0xc0a1('0x45')]=_['intersection'](_0x34dc3b[_0xc0a1('0x44')],qs[_0xc0a1('0x46')](_0x423da0['query'][_0xc0a1('0x46')]));_0x2cbeaa[_0xc0a1('0x45')]=_0x2cbeaa[_0xc0a1('0x45')][_0xc0a1('0x47')]?_0x2cbeaa[_0xc0a1('0x45')]:_0x34dc3b[_0xc0a1('0x44')];if(!_0x423da0[_0xc0a1('0x41')]['hasOwnProperty']('nolimit')){_0x2cbeaa[_0xc0a1('0x32')]=qs['limit'](_0x423da0[_0xc0a1('0x41')]['limit']);_0x2cbeaa['offset']=qs[_0xc0a1('0x34')](_0x423da0[_0xc0a1('0x41')][_0xc0a1('0x34')]);}_0x2cbeaa[_0xc0a1('0x48')]=qs[_0xc0a1('0x49')](_0x423da0[_0xc0a1('0x41')][_0xc0a1('0x49')]);_0x2cbeaa[_0xc0a1('0x4a')]=qs[_0xc0a1('0x42')](_[_0xc0a1('0x4b')](_0x423da0[_0xc0a1('0x41')],_0x34dc3b[_0xc0a1('0x42')]),_0x3fa7cd);if(_0x423da0[_0xc0a1('0x41')][_0xc0a1('0x4c')]){_0x2cbeaa[_0xc0a1('0x4a')]=_[_0xc0a1('0x4d')](_0x2cbeaa['where'],{'$or':_[_0xc0a1('0x3b')](_0x3fa7cd,function(_0x279d75){if(_0x279d75['type']!=='VIRTUAL'){var _0x187e91={};_0x187e91[_0x279d75['name']]={'$like':'%'+_0x423da0[_0xc0a1('0x41')][_0xc0a1('0x4c')]+'%'};return _0x187e91;}})});}_0x2cbeaa=_[_0xc0a1('0x4d')]({},_0x2cbeaa,_0x423da0['options']);var _0x406b66={'where':_0x2cbeaa[_0xc0a1('0x4a')]};return db['OpenchannelMessage'][_0xc0a1('0x33')](_0x406b66)[_0xc0a1('0x22')](function(_0x571a31){_0x56c1ec['count']=_0x571a31;if(_0x423da0[_0xc0a1('0x41')][_0xc0a1('0x4e')]){_0x2cbeaa['include']=[{'all':!![]}];}return db[_0xc0a1('0x3c')][_0xc0a1('0x4f')](_0x2cbeaa);})[_0xc0a1('0x22')](function(_0x1b75e9){_0x56c1ec['rows']=_0x1b75e9;return _0x56c1ec;})['then'](respondWithFilteredResult(_0x5893ab,_0x2cbeaa))[_0xc0a1('0x2d')](handleError(_0x5893ab,null));};exports['show']=function(_0x966369,_0x4cbcb0){var _0x46d4a0={'raw':!![],'where':{'id':_0x966369[_0xc0a1('0x50')]['id']}},_0x530341={};_0x530341[_0xc0a1('0x44')]=_['keys'](db[_0xc0a1('0x3c')][_0xc0a1('0x3d')]);_0x530341[_0xc0a1('0x41')]=_[_0xc0a1('0x51')](_0x966369[_0xc0a1('0x41')]);_0x530341['filters']=_['intersection'](_0x530341[_0xc0a1('0x44')],_0x530341['query']);_0x46d4a0[_0xc0a1('0x45')]=_['intersection'](_0x530341[_0xc0a1('0x44')],qs[_0xc0a1('0x46')](_0x966369[_0xc0a1('0x41')][_0xc0a1('0x46')]));_0x46d4a0[_0xc0a1('0x45')]=_0x46d4a0[_0xc0a1('0x45')][_0xc0a1('0x47')]?_0x46d4a0[_0xc0a1('0x45')]:_0x530341[_0xc0a1('0x44')];if(_0x966369[_0xc0a1('0x41')][_0xc0a1('0x4e')]){_0x46d4a0[_0xc0a1('0x52')]=[{'all':!![]}];}_0x46d4a0=_[_0xc0a1('0x4d')]({},_0x46d4a0,_0x966369[_0xc0a1('0x53')]);return db[_0xc0a1('0x3c')][_0xc0a1('0x54')](_0x46d4a0)[_0xc0a1('0x22')](handleEntityNotFound(_0x4cbcb0,null))['then'](respondWithResult(_0x4cbcb0,null))['catch'](handleError(_0x4cbcb0,null));};exports[_0xc0a1('0x55')]=function(_0x5acaa,_0x23b3e0){return db[_0xc0a1('0x3c')][_0xc0a1('0x55')](_0x5acaa[_0xc0a1('0x56')],{})[_0xc0a1('0x22')](respondWithResult(_0x23b3e0,0xc9))[_0xc0a1('0x2d')](handleError(_0x23b3e0,null));};exports[_0xc0a1('0x37')]=function(_0x5ac979,_0x25266c){if(_0x5ac979[_0xc0a1('0x56')]['id']){delete _0x5ac979[_0xc0a1('0x56')]['id'];}return db[_0xc0a1('0x3c')]['find']({'where':{'id':_0x5ac979[_0xc0a1('0x50')]['id']}})[_0xc0a1('0x22')](handleEntityNotFound(_0x25266c,null))[_0xc0a1('0x22')](saveUpdates(_0x5ac979['body'],null))[_0xc0a1('0x22')](respondWithResult(_0x25266c,null))['catch'](handleError(_0x25266c,null));};exports[_0xc0a1('0x38')]=function(_0x57bcb,_0x4a363f){return db[_0xc0a1('0x3c')]['find']({'where':{'id':_0x57bcb['params']['id']}})[_0xc0a1('0x22')](handleEntityNotFound(_0x4a363f,null))[_0xc0a1('0x22')](removeEntity(_0x4a363f,null))[_0xc0a1('0x2d')](handleError(_0x4a363f,null));};exports[_0xc0a1('0x57')]=function(_0x5be7ee,_0x539593){return db['OpenchannelMessage'][_0xc0a1('0x57')]()['then'](respondWithResult(_0x539593,null))[_0xc0a1('0x2d')](handleError(_0x539593,null));};var interaction_log=require(_0xc0a1('0x15'))(_0xc0a1('0x58'));exports['accept']=function(_0x4188a7,_0x246a05,_0x20d116){var _0x11ff04={'agent':{},'channel':_0xc0a1('0x59')};if(_0x4188a7['body']['id']){delete _0x4188a7[_0xc0a1('0x56')]['id'];}_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5a')]=!![];_0x4188a7['body']['readAt']=moment()['format'](_0xc0a1('0x5b'));_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5c')]=_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5c')]||_0x4188a7[_0xc0a1('0x5d')]['id'];_0x11ff04[_0xc0a1('0x5e')]['id']=_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5c')];return db[_0xc0a1('0x3c')]['find']({'where':{'id':_0x4188a7[_0xc0a1('0x50')]['id'],'UserId':null}})[_0xc0a1('0x22')](handleEntityNotFound(_0x246a05,null))[_0xc0a1('0x22')](saveUpdates(_0x4188a7[_0xc0a1('0x56')],null))[_0xc0a1('0x22')](function(_0x194ae9){if(_0x194ae9){_0x11ff04[_0xc0a1('0x2b')]=_0x194ae9['get']({'plain':!![]});return db[_0xc0a1('0x5f')][_0xc0a1('0x54')]({'where':{'id':_0x194ae9['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x246a05,null))['then'](function(_0x4f72e4){if(_0x4f72e4){return _0x4f72e4[_0xc0a1('0x37')]({'UserId':_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5c')],'read1stAt':_[_0xc0a1('0x60')](_0x4f72e4[_0xc0a1('0x61')])?moment()[_0xc0a1('0x62')](_0xc0a1('0x5b')):undefined});}return null;})[_0xc0a1('0x22')](function(_0x273e86){if(_0x273e86){_0x11ff04[_0xc0a1('0x63')]=_0x273e86[_0xc0a1('0x64')]({'plain':!![]});interaction_log['info'](_0xc0a1('0x65'),_0x4188a7[_0xc0a1('0x5d')]['id'],_0x4188a7[_0xc0a1('0x5d')][_0xc0a1('0x39')],_0x4188a7[_0xc0a1('0x5d')][_0xc0a1('0x66')],_0x11ff04[_0xc0a1('0x63')]['id'],_0x4188a7[_0xc0a1('0x56')]?JSON[_0xc0a1('0x28')](_0x4188a7[_0xc0a1('0x56')]):_0xc0a1('0x67'));return respondWithRpcPromise(_0xc0a1('0x68'),_0xc0a1('0x69'),_0x11ff04);}return null;})['then'](function(_0x33d134){var _0x4f68cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33d134['message'][_0xc0a1('0x6a')];return db[_0xc0a1('0x6b')]['query'](_0x4f68cf,{'type':db[_0xc0a1('0x6c')][_0xc0a1('0x6d')][_0xc0a1('0x6e')],'raw':!![]})[_0xc0a1('0x22')](function(_0x186e22){return _0x186e22;});})[_0xc0a1('0x22')](function(_0x5345df){if(_0x5345df){_0x11ff04[_0xc0a1('0x2b')][_0xc0a1('0x6f')]=_0x5345df[0x0];if(!_0x4188a7[_0xc0a1('0x56')][_0xc0a1('0x5c')])return;return db[_0xc0a1('0x70')][_0xc0a1('0x54')]({'where':{'id':_0x4188a7[_0xc0a1('0x56')]['UserId'],'role':_0xc0a1('0x5e')},'attributes':['id','name',_0xc0a1('0x71'),_0xc0a1('0x72'),_0xc0a1('0x73')],'raw':!![]});}return null;})[_0xc0a1('0x22')](function(_0x577e18){if(!_0x577e18)return null;_0x11ff04[_0xc0a1('0x2b')]['agent']=_0x577e18;return _0x11ff04;})[_0xc0a1('0x22')](function(_0x4458d9){if(_0x4458d9){if(_0x4188a7['body'][_0xc0a1('0x74')]){_0x11ff04['message'][_0xc0a1('0x75')]=util[_0xc0a1('0x62')](_0xc0a1('0x76'),_0x4188a7[_0xc0a1('0x5d')][_0xc0a1('0x39')]);_0x11ff04[_0xc0a1('0x2b')]['channel']=_0x11ff04[_0xc0a1('0x77')];_0x11ff04['message'][_0xc0a1('0x78')]=_0xc0a1('0x79');return respondWithRpcPromise(_0xc0a1('0x7a'),_0xc0a1('0x7a'),{'event':_0xc0a1('0x7b'),'message':_0x11ff04['message']},client9002)[_0xc0a1('0x22')](function(){return _0x11ff04;});}return _0x11ff04;}return null;})[_0xc0a1('0x22')](respondWithResult(_0x246a05,null))[_0xc0a1('0x2d')](handleError(_0x246a05,null));};var interaction_log=require('../../config/logger')(_0xc0a1('0x58'));exports[_0xc0a1('0x7c')]=function(_0xae97f2,_0x4c7f17,_0x47ac33){var _0x11f26a={'agent':{},'channel':_0xc0a1('0x59')};if(_0xae97f2[_0xc0a1('0x56')]['id']){delete _0xae97f2[_0xc0a1('0x56')]['id'];}_0xae97f2['body'][_0xc0a1('0x5c')]=_0xae97f2['body'][_0xc0a1('0x5c')]||_0xae97f2[_0xc0a1('0x5d')]['id'];_0x11f26a[_0xc0a1('0x5e')]['id']=_0xae97f2[_0xc0a1('0x56')]['UserId'];return db[_0xc0a1('0x3c')]['find']({'where':{'id':_0xae97f2[_0xc0a1('0x50')]['id'],'UserId':null}})[_0xc0a1('0x22')](handleEntityNotFound(_0x4c7f17,null))[_0xc0a1('0x22')](function(_0x4ea85a){if(_0x4ea85a){_0x11f26a[_0xc0a1('0x2b')]=_0x4ea85a[_0xc0a1('0x64')]({'plain':!![]});return db[_0xc0a1('0x5f')]['find']({'where':{'id':_0x4ea85a[_0xc0a1('0x7d')]}});}return null;})[_0xc0a1('0x22')](handleEntityNotFound(_0x4c7f17,null))[_0xc0a1('0x22')](function(_0x4df55a){if(_0x4df55a){_0x11f26a[_0xc0a1('0x63')]=_0x4df55a[_0xc0a1('0x64')]({'plain':!![]});interaction_log[_0xc0a1('0x23')](_0xc0a1('0x7e'),_0xae97f2[_0xc0a1('0x5d')]['id'],_0xae97f2['user']['name'],_0xae97f2['user'][_0xc0a1('0x66')],_0x11f26a['interaction']['id'],_0xae97f2['body']?JSON[_0xc0a1('0x28')](_0xae97f2[_0xc0a1('0x56')]):_0xc0a1('0x67'));return respondWithRpcPromise(_0xc0a1('0x7f'),'rejectMessage',_0x11f26a);}return null;})[_0xc0a1('0x22')](function(_0x6f04d6){var _0xa8f906=_0xc0a1('0x80')+_0x6f04d6[_0xc0a1('0x2b')][_0xc0a1('0x6a')];return db[_0xc0a1('0x6b')][_0xc0a1('0x41')](_0xa8f906,{'type':db[_0xc0a1('0x6c')][_0xc0a1('0x6d')][_0xc0a1('0x6e')],'raw':!![]})[_0xc0a1('0x22')](function(_0x3c232f){return _0x3c232f;});})['then'](function(_0x31f086){if(_0x31f086){_0x11f26a[_0xc0a1('0x2b')][_0xc0a1('0x6f')]=_0x31f086[0x0];if(!_0xae97f2[_0xc0a1('0x56')]['UserId'])return;return db[_0xc0a1('0x70')][_0xc0a1('0x54')]({'where':{'id':_0xae97f2['body'][_0xc0a1('0x5c')],'role':_0xc0a1('0x5e')},'attributes':['id',_0xc0a1('0x39'),_0xc0a1('0x71'),_0xc0a1('0x72'),_0xc0a1('0x73')],'raw':!![]});}return null;})[_0xc0a1('0x22')](function(_0x28fff2){if(!_0x28fff2)return null;_0x11f26a[_0xc0a1('0x2b')][_0xc0a1('0x5e')]=_0x28fff2;return _0x11f26a;})['then'](function(_0x1d0307){if(_0x1d0307){_0x1d0307['message']['interface']=util[_0xc0a1('0x62')](_0xc0a1('0x76'),_0xae97f2[_0xc0a1('0x5d')][_0xc0a1('0x39')]);_0x1d0307[_0xc0a1('0x2b')]['channel']=_0x11f26a['channel'];_0x1d0307[_0xc0a1('0x2b')][_0xc0a1('0x78')]=_0xc0a1('0x7c');respondWithRpcPromise(_0xc0a1('0x7a'),_0xc0a1('0x7a'),{'event':'rejectmessage','message':_0x1d0307['message']},client9002);return _0x11f26a;}return null;})[_0xc0a1('0x22')](respondWithResult(_0x4c7f17,null))[_0xc0a1('0x2d')](handleError(_0x4c7f17,null));};
\ No newline at end of file
index 95451e3..f571c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc548=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5b092f,_0x497479){var _0x216dd3=function(_0x23a3c7){while(--_0x23a3c7){_0x5b092f['push'](_0x5b092f['shift']());}};_0x216dd3(++_0x497479);}(_0xc548,0x18c));var _0x8c54=function(_0x39bfa4,_0x24c341){_0x39bfa4=_0x39bfa4-0x0;var _0x3915f8=_0xc548[_0x39bfa4];return _0x3915f8;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8c54('0x0'))['db'][_0x8c54('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8c54('0x2')](0x0);var events={'afterCreate':_0x8c54('0x3'),'afterUpdate':_0x8c54('0x4'),'afterDestroy':_0x8c54('0x5')};function emitEvent(_0x3b7b6b){return function(_0x47f233,_0x37e4ba,_0x4c922b){OpenchannelMessageEvents['emit'](_0x3b7b6b+':'+_0x47f233['id'],_0x47f233);OpenchannelMessageEvents[_0x8c54('0x6')](_0x3b7b6b,_0x47f233);_0x4c922b(null);};}for(var e in events){if(events[_0x8c54('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x8c54('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x700c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x700c,0x18c));var _0xc700=function(_0xb06d04,_0x1a87b0){_0xb06d04=_0xb06d04-0x0;var _0x15454a=_0x700c[_0xb06d04];return _0x15454a;};'use strict';var EventEmitter=require(_0xc700('0x0'));var OpenchannelMessage=require(_0xc700('0x1'))['db'][_0xc700('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc700('0x3')](0x0);var events={'afterCreate':_0xc700('0x4'),'afterUpdate':_0xc700('0x5'),'afterDestroy':_0xc700('0x6')};function emitEvent(_0x5e2b99){return function(_0xeeda10,_0x59cb1a,_0x1b557d){OpenchannelMessageEvents['emit'](_0x5e2b99+':'+_0xeeda10['id'],_0xeeda10);OpenchannelMessageEvents[_0xc700('0x7')](_0x5e2b99,_0xeeda10);_0x1b557d(null);};}for(var e in events){if(events[_0xc700('0x8')](e)){var event=events[e];OpenchannelMessage[_0xc700('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 4725b34..967b977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eba=['format','Interaction','omit','POST','replyUri','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','secret','isNil','OpenchannelInteraction','then','update','createdAt','catch','error','out','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate'];(function(_0x377e0a,_0x30e100){var _0x21c8f0=function(_0x282ff3){while(--_0x282ff3){_0x377e0a['push'](_0x377e0a['shift']());}};_0x21c8f0(++_0x30e100);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x1eba[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[{'name':_0xa1eb('0xd'),'fields':[_0xa1eb('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ecd20,_0x4d4aaf,_0x219802){var _0x54cdad=_0x2933d0[_0xa1eb('0xf')];var _0x5d7101=_0x1ecd20[_0xa1eb('0x10')]({'plain':!![]});if(_0x5d7101['direction'][_0xa1eb('0x11')]()==='in'||_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()==='out'&&!_0x5d7101[_0xa1eb('0x13')]&&!_[_0xa1eb('0x14')](_0x5d7101['UserId'])){_0x54cdad[_0xa1eb('0x15')]['findOne']({'where':{'id':_0x5d7101['OpenchannelInteractionId']}})[_0xa1eb('0x16')](function(_0x4c7983){if(_0x4c7983){_0x4c7983[_0xa1eb('0x17')]({'lastMsgAt':_0x5d7101[_0xa1eb('0x18')],'lastMsgDirection':_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()});}})[_0xa1eb('0x19')](function(_0x44f37d){console[_0xa1eb('0x1a')](_0x44f37d);});}if(_0x5d7101[_0xa1eb('0x12')]===_0xa1eb('0x1b')&&!_0x5d7101['secret']){var _0xbd6a6b;_0x54cdad['CmContact'][_0xa1eb('0x1c')]()[_0xa1eb('0x16')](function(_0x33c4e3){return _0x54cdad[_0xa1eb('0x1d')]['find']({'where':{'id':_0x5d7101[_0xa1eb('0x1e')]},'include':[{'model':_0x54cdad[_0xa1eb('0x15')],'as':_0xa1eb('0x1f'),'where':{'id':_0x5d7101[_0xa1eb('0x20')]},'limit':0x1,'include':[{'model':_0x54cdad[_0xa1eb('0x21')],'as':_0xa1eb('0x22'),'attributes':_[_0xa1eb('0x23')](_0x33c4e3)}]}]});})[_0xa1eb('0x16')](function(_0x4fc14a){_0xbd6a6b=_0x4fc14a[_0xa1eb('0x10')]({'plain':!![]});if(_0xbd6a6b&&_0xbd6a6b['replyUri']){logger[_0xa1eb('0x24')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b['replyUri']));if(_0xbd6a6b[_0xa1eb('0x1f')]&&_0xbd6a6b[_0xa1eb('0x1f')]['length']){_0x5d7101[_0xa1eb('0x28')]=_[_0xa1eb('0x29')](_0xbd6a6b[_0xa1eb('0x1f')][0x0],_0xa1eb('0x22'));_0x5d7101[_0xa1eb('0x22')]=_0xbd6a6b[_0xa1eb('0x1f')][0x0][_0xa1eb('0x22')];}var _0x4d4aaf={'method':_0xa1eb('0x2a'),'uri':encodeURI(_0xbd6a6b[_0xa1eb('0x2b')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d4aaf[_0xa1eb('0x2c')]){case _0xa1eb('0x2d'):_0x4d4aaf['qs']=_0x5d7101;break;case'POST':_0x4d4aaf[_0xa1eb('0xe')]=_0x5d7101;break;}return rp(_0x4d4aaf)[_0xa1eb('0x16')](function(_0x491f37){logger[_0xa1eb('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b[_0xa1eb('0x2b')]));if(_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]&&_0x491f37['body'][_0xa1eb('0x2e')]!=_0x5d7101[_0xa1eb('0x28')]['threadId']){return _0x54cdad[_0xa1eb('0x15')][_0xa1eb('0x17')]({'threadId':_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]},{'logging':!![],'where':{'id':_0x5d7101[_0xa1eb('0x28')]['id']}});}else{return;}})['then'](function(){return _0x1ecd20[_0xa1eb('0x17')]({'read':!![]});})[_0xa1eb('0x19')](function(_0x198fdb){logger[_0xa1eb('0x1a')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x2f')](_0x198fdb,{'showHidden':![],'depth':null}));_0x219802();});}else{_0x219802();}})[_0xa1eb('0x30')](function(){_0x219802();});}else{_0x219802();}}},'charset':_0xa1eb('0x31'),'collate':_0xa1eb('0x32')});};
\ No newline at end of file
+var _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x491961,_0x500bfb){var _0x3a8a5b=function(_0x5a8d96){while(--_0x5a8d96){_0x491961['push'](_0x491961['shift']());}};_0x3a8a5b(++_0x500bfb);}(_0x2032,0xd9));var _0x2203=function(_0x2de8c7,_0x2f1528){_0x2de8c7=_0x2de8c7-0x0;var _0x5d28ac=_0x2032[_0x2de8c7];return _0x5d28ac;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});};
\ No newline at end of file
index abbe94b..49595c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3debae,_0x5ae90f){var _0x2a19a6=function(_0x167cad){while(--_0x167cad){_0x3debae['push'](_0x3debae['shift']());}};_0x2a19a6(++_0x5ae90f);}(_0xadb5,0xad));var _0x5adb=function(_0x36b6a5,_0x5fa385){_0x36b6a5=_0x36b6a5-0x0;var _0x3c62a1=_0xadb5[_0x36b6a5];return _0x3c62a1;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
+var _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(_0x254532,_0x28d351){var _0x5eabeb=function(_0x3439e4){while(--_0x3439e4){_0x254532['push'](_0x254532['shift']());}};_0x5eabeb(++_0x28d351);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52fae1,_0x46537f){_0x52fae1=_0x52fae1-0x0;var _0x4beb6f=_0x5f2f[_0x52fae1];return _0x4beb6f;};'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 eaea4e3..c38f72d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aee=['remove','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x34468f,_0x3debbe){var _0x5be5ca=function(_0x43fc72){while(--_0x43fc72){_0x34468f['push'](_0x34468f['shift']());}};_0x5be5ca(++_0x3debbe);}(_0x0aee,0x1a3));var _0xe0ae=function(_0x1f31f7,_0x7b0ec3){_0x1f31f7=_0x1f31f7-0x0;var _0x512140=_0x0aee[_0x1f31f7];return _0x512140;};'use strict';var OpenchannelMessageEvents=require(_0xe0ae('0x0'));var events=['save',_0xe0ae('0x1'),'update'];function createListener(_0x474185,_0x54aa83){return function(_0x4be96a){_0x54aa83[_0xe0ae('0x2')](_0x474185,_0x4be96a);};}function removeListener(_0x252f8f,_0x369e5a){return function(){OpenchannelMessageEvents['removeListener'](_0x252f8f,_0x369e5a);};}exports[_0xe0ae('0x3')]=function(_0x28eae7){for(var _0x532ba5=0x0,_0x3fa50a=events[_0xe0ae('0x4')];_0x532ba5<_0x3fa50a;_0x532ba5++){var _0x496ce1=events[_0x532ba5];var _0x128c96=createListener(_0xe0ae('0x5')+_0x496ce1,_0x28eae7);OpenchannelMessageEvents['on'](_0x496ce1,_0x128c96);}};
\ No newline at end of file
+var _0x548f=['openchannelMessage:','./openchannelMessage.events','save','remove','removeListener','register','length'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0x548f,0x104));var _0xf548=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x548f[_0x2e4e19];return _0x9ba20b;};'use strict';var OpenchannelMessageEvents=require(_0xf548('0x0'));var events=[_0xf548('0x1'),_0xf548('0x2'),'update'];function createListener(_0x3c25b1,_0x3edaed){return function(_0x165140){_0x3edaed['emit'](_0x3c25b1,_0x165140);};}function removeListener(_0x5a6d7a,_0xefe728){return function(){OpenchannelMessageEvents[_0xf548('0x3')](_0x5a6d7a,_0xefe728);};}exports[_0xf548('0x4')]=function(_0x1b5b52){for(var _0x46459d=0x0,_0xd792cd=events[_0xf548('0x5')];_0x46459d<_0xd792cd;_0x46459d++){var _0x5bfe40=events[_0x46459d];var _0x25aa35=createListener(_0xf548('0x6')+_0x5bfe40,_0x1b5b52);OpenchannelMessageEvents['on'](_0x5bfe40,_0x25aa35);}};
\ No newline at end of file
index 00f08f5..193cc39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9c3=['show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xe9c3,0x1b3));var _0x3e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e9c('0x0'));var util=require(_0x3e9c('0x1'));var path=require('path');var timeout=require(_0x3e9c('0x2'));var express=require(_0x3e9c('0x3'));var router=express[_0x3e9c('0x4')]();var fs_extra=require(_0x3e9c('0x5'));var auth=require(_0x3e9c('0x6'));var interaction=require(_0x3e9c('0x7'));var config=require(_0x3e9c('0x8'));var controller=require(_0x3e9c('0x9'));router[_0x3e9c('0xa')]('/',auth[_0x3e9c('0xb')](),controller[_0x3e9c('0xc')]);router['get'](_0x3e9c('0xd'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0xe')]);router[_0x3e9c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3e9c('0xf')]);router[_0x3e9c('0xa')]('/:id/members',auth[_0x3e9c('0xb')](),controller['getMembers']);router[_0x3e9c('0xa')](_0x3e9c('0x10'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x11')]);router[_0x3e9c('0xa')](_0x3e9c('0x12'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x13')]);router[_0x3e9c('0x14')]('/',auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x15')]);router['post'](_0x3e9c('0x10'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x16')]);router[_0x3e9c('0x14')](_0x3e9c('0x12'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x17')]);router[_0x3e9c('0x18')](_0x3e9c('0x19'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x1a')]);router[_0x3e9c('0x1b')]('/:id',auth[_0x3e9c('0xb')](),controller['destroy']);router[_0x3e9c('0x1b')](_0x3e9c('0x10'),auth[_0x3e9c('0xb')](),controller[_0x3e9c('0x1c')]);router[_0x3e9c('0x1b')](_0x3e9c('0x12'),auth[_0x3e9c('0xb')](),controller['removeAgents']);module[_0x3e9c('0x1d')]=router;
\ No newline at end of file
+var _0x4317=['update','delete','/:id','removeTeams','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','addAgents','put'];(function(_0x2b40e1,_0x495c47){var _0x30b65c=function(_0x5781f9){while(--_0x5781f9){_0x2b40e1['push'](_0x2b40e1['shift']());}};_0x30b65c(++_0x495c47);}(_0x4317,0x64));var _0x7431=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4317[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x7431('0x0'));var util=require(_0x7431('0x1'));var path=require('path');var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7431('0x4'));var config=require(_0x7431('0x5'));var controller=require('./openchannelQueue.controller');router[_0x7431('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7431('0x6')](_0x7431('0x7'),auth[_0x7431('0x8')](),controller['describe']);router['get']('/:id',auth[_0x7431('0x8')](),controller[_0x7431('0x9')]);router['get'](_0x7431('0xa'),auth[_0x7431('0x8')](),controller[_0x7431('0xb')]);router['get'](_0x7431('0xc'),auth[_0x7431('0x8')](),controller[_0x7431('0xd')]);router[_0x7431('0x6')](_0x7431('0xe'),auth[_0x7431('0x8')](),controller[_0x7431('0xf')]);router['post']('/',auth[_0x7431('0x8')](),controller[_0x7431('0x10')]);router['post'](_0x7431('0xc'),auth[_0x7431('0x8')](),controller[_0x7431('0x11')]);router['post'](_0x7431('0xe'),auth[_0x7431('0x8')](),controller[_0x7431('0x12')]);router[_0x7431('0x13')]('/:id',auth[_0x7431('0x8')](),controller[_0x7431('0x14')]);router[_0x7431('0x15')](_0x7431('0x16'),auth[_0x7431('0x8')](),controller['destroy']);router[_0x7431('0x15')](_0x7431('0xc'),auth[_0x7431('0x8')](),controller[_0x7431('0x17')]);router[_0x7431('0x15')](_0x7431('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index e9bc1ed..9d86dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfece=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x288065,_0x48e980){var _0x4c585a=function(_0x2080ce){while(--_0x2080ce){_0x288065['push'](_0x288065['shift']());}};_0x4c585a(++_0x48e980);}(_0xfece,0xc0));var _0xefec=function(_0x5680db,_0x96cd64){_0x5680db=_0x5680db-0x0;var _0x4823f2=_0xfece[_0x5680db];return _0x4823f2;};'use strict';var Sequelize=require(_0xefec('0x0'));module[_0xefec('0x1')]={'name':{'type':Sequelize[_0xefec('0x2')],'unique':_0xefec('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefec('0x2')]},'timeout':{'type':Sequelize[_0xefec('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xefec('0x5')](_0xefec('0x6'),'beepall',_0xefec('0x7'))}};
\ No newline at end of file
+var _0x3de7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3de7,0x1b3));var _0x73de=function(_0xebdd6a,_0x105a09){_0xebdd6a=_0xebdd6a-0x0;var _0x323618=_0x3de7[_0xebdd6a];return _0x323618;};'use strict';var Sequelize=require(_0x73de('0x0'));module[_0x73de('0x1')]={'name':{'type':Sequelize[_0x73de('0x2')],'unique':_0x73de('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x73de('0x2')]},'timeout':{'type':Sequelize[_0x73de('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x73de('0x5')](_0x73de('0x6'),_0x73de('0x7'),_0x73de('0x8'))}};
\ No newline at end of file
index 0b33916..25a7b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1107=['OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','forEach','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','end','name','send','index','map','OpenchannelQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x475690,_0x129d29){var _0x8e878a=function(_0x3226c8){while(--_0x3226c8){_0x475690['push'](_0x475690['shift']());}};_0x8e878a(++_0x129d29);}(_0x1107,0xcb));var _0x7110=function(_0x495c52,_0x53c0cc){_0x495c52=_0x495c52-0x0;var _0x2b4bb2=_0x1107[_0x495c52];return _0x2b4bb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7110('0x0'));var zipdir=require(_0x7110('0x1'));var jsonpatch=require(_0x7110('0x2'));var rp=require(_0x7110('0x3'));var moment=require('moment');var BPromise=require(_0x7110('0x4'));var Mustache=require('mustache');var util=require(_0x7110('0x5'));var path=require(_0x7110('0x6'));var sox=require(_0x7110('0x7'));var csv=require('to-csv');var ejs=require(_0x7110('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7110('0x9'));var squel=require('squel');var crypto=require(_0x7110('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7110('0xb'));var toCsv=require(_0x7110('0xc'));var querystring=require(_0x7110('0xd'));var Papa=require(_0x7110('0xe'));var Redis=require('ioredis');var authService=require(_0x7110('0xf'));var qs=require(_0x7110('0x10'));var as=require(_0x7110('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7110('0x12'));var config=require(_0x7110('0x13'));var licenseUtil=require(_0x7110('0x14'));var db=require(_0x7110('0x15'))['db'];config['redis']=_[_0x7110('0x16')](config[_0x7110('0x17')],{'host':_0x7110('0x18'),'port':0x18eb});var socket=require(_0x7110('0x19'))(new Redis(config['redis']));require(_0x7110('0x1a'))[_0x7110('0x1b')](socket);function respondWithStatusCode(_0x30620d,_0x1d3a94){_0x1d3a94=_0x1d3a94||0xcc;return function(_0x1f120e){if(_0x1f120e){return _0x30620d[_0x7110('0x1c')](_0x1d3a94);}return _0x30620d['status'](_0x1d3a94)['end']();};}function respondWithResult(_0x2ac0cd,_0x130d04){_0x130d04=_0x130d04||0xc8;return function(_0xa95a9){if(_0xa95a9){return _0x2ac0cd[_0x7110('0x1d')](_0x130d04)['json'](_0xa95a9);}};}function respondWithFilteredResult(_0x2e46bb,_0x17a5d1){return function(_0x9d7ef8){if(_0x9d7ef8){var _0x4f18f9=typeof _0x17a5d1['offset']===_0x7110('0x1e')&&typeof _0x17a5d1[_0x7110('0x1f')]===_0x7110('0x1e');var _0x3b6c31=_0x9d7ef8[_0x7110('0x20')];var _0x4e3df6=_0x4f18f9?0x0:_0x17a5d1[_0x7110('0x21')];var _0x3b041a=_0x4f18f9?_0x9d7ef8[_0x7110('0x20')]:_0x17a5d1[_0x7110('0x21')]+_0x17a5d1['limit'];var _0x422495;if(_0x3b041a>=_0x3b6c31){_0x3b041a=_0x3b6c31;_0x422495=0xc8;}else{_0x422495=0xce;}_0x2e46bb['status'](_0x422495);return _0x2e46bb['set'](_0x7110('0x22'),_0x4e3df6+'-'+_0x3b041a+'/'+_0x3b6c31)[_0x7110('0x23')](_0x9d7ef8);}return null;};}function patchUpdates(_0x318da4){return function(_0x2383f2){try{jsonpatch[_0x7110('0x24')](_0x2383f2,_0x318da4,!![]);}catch(_0x5e2d4e){return BPromise[_0x7110('0x25')](_0x5e2d4e);}return _0x2383f2[_0x7110('0x26')]();};}function saveUpdates(_0x4fce09,_0x2497a6){return function(_0x169e67){if(_0x169e67){return _0x169e67[_0x7110('0x27')](_0x4fce09)[_0x7110('0x28')](function(_0x249fa8){return _0x249fa8;});}return null;};}function removeEntity(_0x1ab773,_0x2efe5a){return function(_0x468403){if(_0x468403){return _0x468403[_0x7110('0x29')]()['then'](function(){var _0x2bca42=_0x468403['get']({'plain':!![]});var _0x3a19d6='OpenchannelQueues';return db[_0x7110('0x2a')][_0x7110('0x29')]({'where':{'type':_0x3a19d6,'resourceId':_0x2bca42['id']}})[_0x7110('0x28')](function(){return _0x468403;});})['then'](function(){_0x1ab773['status'](0xcc)[_0x7110('0x2b')]();});}};}function handleEntityNotFound(_0x2a8d88,_0x12743e){return function(_0x224243){if(!_0x224243){_0x2a8d88[_0x7110('0x1c')](0x194);}return _0x224243;};}function handleError(_0x3843f2,_0x15a0d1){_0x15a0d1=_0x15a0d1||0x1f4;return function(_0x32550a){logger['error'](_0x32550a['stack']);if(_0x32550a[_0x7110('0x2c')]){delete _0x32550a[_0x7110('0x2c')];}_0x3843f2['status'](_0x15a0d1)[_0x7110('0x2d')](_0x32550a);};}exports[_0x7110('0x2e')]=function(_0x469f1b,_0x458915){var _0x30e720={},_0x4babd0={},_0x540f5f={'count':0x0,'rows':[]};var _0x221004=_[_0x7110('0x2f')](db[_0x7110('0x30')][_0x7110('0x31')],function(_0x2376c2){return{'name':_0x2376c2['fieldName'],'type':_0x2376c2['type'][_0x7110('0x32')]};});_0x4babd0[_0x7110('0x33')]=_['map'](_0x221004,'name');_0x4babd0['query']=_['keys'](_0x469f1b[_0x7110('0x34')]);_0x4babd0[_0x7110('0x35')]=_[_0x7110('0x36')](_0x4babd0['model'],_0x4babd0[_0x7110('0x34')]);_0x30e720[_0x7110('0x37')]=_['intersection'](_0x4babd0['model'],qs[_0x7110('0x38')](_0x469f1b[_0x7110('0x34')][_0x7110('0x38')]));_0x30e720[_0x7110('0x37')]=_0x30e720[_0x7110('0x37')][_0x7110('0x39')]?_0x30e720[_0x7110('0x37')]:_0x4babd0[_0x7110('0x33')];if(!_0x469f1b[_0x7110('0x34')][_0x7110('0x3a')](_0x7110('0x3b'))){_0x30e720[_0x7110('0x1f')]=qs[_0x7110('0x1f')](_0x469f1b[_0x7110('0x34')][_0x7110('0x1f')]);_0x30e720[_0x7110('0x21')]=qs[_0x7110('0x21')](_0x469f1b[_0x7110('0x34')][_0x7110('0x21')]);}_0x30e720[_0x7110('0x3c')]=qs[_0x7110('0x3d')](_0x469f1b[_0x7110('0x34')][_0x7110('0x3d')]);_0x30e720['where']=qs[_0x7110('0x35')](_[_0x7110('0x3e')](_0x469f1b[_0x7110('0x34')],_0x4babd0['filters']),_0x221004);if(_0x469f1b[_0x7110('0x34')]['filter']){_0x30e720[_0x7110('0x3f')]=_[_0x7110('0x40')](_0x30e720['where'],{'$or':_[_0x7110('0x2f')](_0x221004,function(_0x42f5e0){if(_0x42f5e0[_0x7110('0x41')]!==_0x7110('0x42')){var _0x26d026={};_0x26d026[_0x42f5e0[_0x7110('0x2c')]]={'$like':'%'+_0x469f1b[_0x7110('0x34')][_0x7110('0x43')]+'%'};return _0x26d026;}})});}_0x30e720=_[_0x7110('0x40')]({},_0x30e720,_0x469f1b[_0x7110('0x44')]);var _0x2a7ad2={'where':_0x30e720[_0x7110('0x3f')]};return db['OpenchannelQueue'][_0x7110('0x20')](_0x2a7ad2)[_0x7110('0x28')](function(_0x3536d8){_0x540f5f[_0x7110('0x20')]=_0x3536d8;if(_0x469f1b[_0x7110('0x34')]['includeAll']){_0x30e720[_0x7110('0x45')]=[{'all':!![]}];}return db[_0x7110('0x30')][_0x7110('0x46')](_0x30e720);})['then'](function(_0x418a84){_0x540f5f[_0x7110('0x47')]=_0x418a84;return _0x540f5f;})[_0x7110('0x28')](respondWithFilteredResult(_0x458915,_0x30e720))[_0x7110('0x48')](handleError(_0x458915,null));};exports[_0x7110('0x49')]=function(_0x287bfa,_0x2a8263){var _0x2c7136={'raw':!![],'where':{'id':_0x287bfa[_0x7110('0x4a')]['id']}},_0x210e76={};_0x210e76[_0x7110('0x33')]=_[_0x7110('0x4b')](db['OpenchannelQueue'][_0x7110('0x31')]);_0x210e76[_0x7110('0x34')]=_[_0x7110('0x4b')](_0x287bfa[_0x7110('0x34')]);_0x210e76[_0x7110('0x35')]=_['intersection'](_0x210e76[_0x7110('0x33')],_0x210e76['query']);_0x2c7136['attributes']=_['intersection'](_0x210e76[_0x7110('0x33')],qs[_0x7110('0x38')](_0x287bfa[_0x7110('0x34')][_0x7110('0x38')]));_0x2c7136[_0x7110('0x37')]=_0x2c7136[_0x7110('0x37')][_0x7110('0x39')]?_0x2c7136[_0x7110('0x37')]:_0x210e76['model'];if(_0x287bfa['query'][_0x7110('0x4c')]){_0x2c7136[_0x7110('0x45')]=[{'all':!![]}];}_0x2c7136=_[_0x7110('0x40')]({},_0x2c7136,_0x287bfa[_0x7110('0x44')]);return db[_0x7110('0x30')][_0x7110('0x4d')](_0x2c7136)[_0x7110('0x28')](handleEntityNotFound(_0x2a8263,null))[_0x7110('0x28')](respondWithResult(_0x2a8263,null))[_0x7110('0x48')](handleError(_0x2a8263,null));};exports[_0x7110('0x4e')]=function(_0x1a331,_0x1b289c){return db[_0x7110('0x30')][_0x7110('0x4e')](_0x1a331[_0x7110('0x4f')],{})[_0x7110('0x28')](function(_0x143ffe){var _0x46aefe=_0x1a331[_0x7110('0x50')][_0x7110('0x51')]({'plain':!![]});if(!_0x46aefe)throw new Error(_0x7110('0x52'));if(_0x46aefe['role']===_0x7110('0x50')){var _0x52c4f4=_0x143ffe[_0x7110('0x51')]({'plain':!![]});var _0xf4632f=_0x7110('0x53');return db[_0x7110('0x54')]['find']({'where':{'name':_0xf4632f,'userProfileId':_0x46aefe[_0x7110('0x55')]},'raw':!![]})['then'](function(_0x9f6b3){if(_0x9f6b3&&_0x9f6b3[_0x7110('0x56')]===0x0){return db[_0x7110('0x2a')][_0x7110('0x4e')]({'name':_0x52c4f4[_0x7110('0x2c')],'resourceId':_0x52c4f4['id'],'type':_0x9f6b3[_0x7110('0x2c')],'sectionId':_0x9f6b3['id']},{})['then'](function(){return _0x143ffe;});}else{return _0x143ffe;}})[_0x7110('0x48')](function(_0x2a0891){logger[_0x7110('0x57')](_0x7110('0x58'),_0x2a0891);throw _0x2a0891;});}return _0x143ffe;})[_0x7110('0x28')](respondWithResult(_0x1b289c,0xc9))['catch'](handleError(_0x1b289c,null));};exports[_0x7110('0x27')]=function(_0x405ed6,_0x131074){if(_0x405ed6[_0x7110('0x4f')]['id']){delete _0x405ed6[_0x7110('0x4f')]['id'];}return db[_0x7110('0x30')][_0x7110('0x4d')]({'where':{'id':_0x405ed6[_0x7110('0x4a')]['id']}})[_0x7110('0x28')](handleEntityNotFound(_0x131074,null))[_0x7110('0x28')](saveUpdates(_0x405ed6[_0x7110('0x4f')],null))[_0x7110('0x28')](respondWithResult(_0x131074,null))['catch'](handleError(_0x131074,null));};exports['destroy']=function(_0x46776e,_0x58e3bc){return db[_0x7110('0x30')]['find']({'where':{'id':_0x46776e[_0x7110('0x4a')]['id']}})[_0x7110('0x28')](handleEntityNotFound(_0x58e3bc,null))[_0x7110('0x28')](removeEntity(_0x58e3bc,null))[_0x7110('0x48')](handleError(_0x58e3bc,null));};exports['describe']=function(_0x2afdfe,_0x196a77){return db[_0x7110('0x30')][_0x7110('0x59')]()['then'](respondWithResult(_0x196a77,null))[_0x7110('0x48')](handleError(_0x196a77,null));};exports['getMembers']=function(_0xaa64bb,_0x4a6935,_0x2a11b9){var _0x57cf2c={'raw':!![],'where':{}},_0x4e1b45={},_0x2949c5;return db[_0x7110('0x30')][_0x7110('0x5a')]({'where':{'id':_0xaa64bb[_0x7110('0x4a')]['id']}})[_0x7110('0x28')](handleEntityNotFound(_0x4a6935,null))[_0x7110('0x28')](function(_0x2bfa25){if(_0x2bfa25){_0x2949c5=_0x2bfa25[_0x7110('0x51')]({'plain':!![]});_0x4e1b45['model']=_[_0x7110('0x4b')](db[_0x7110('0x5b')][_0x7110('0x31')]);_0x4e1b45[_0x7110('0x34')]=_['keys'](_0xaa64bb['query']);_0x4e1b45[_0x7110('0x35')]=_[_0x7110('0x36')](_0x4e1b45[_0x7110('0x33')],_0x4e1b45[_0x7110('0x34')]);_0x57cf2c[_0x7110('0x37')]=_[_0x7110('0x36')](_0x4e1b45[_0x7110('0x33')],qs[_0x7110('0x38')](_0xaa64bb[_0x7110('0x34')][_0x7110('0x38')]));_0x57cf2c[_0x7110('0x37')]=_0x57cf2c[_0x7110('0x37')][_0x7110('0x39')]?_0x57cf2c[_0x7110('0x37')]:_0x4e1b45[_0x7110('0x33')];if(!_0xaa64bb[_0x7110('0x34')][_0x7110('0x3a')]('nolimit')){_0x57cf2c[_0x7110('0x1f')]=qs[_0x7110('0x1f')](_0xaa64bb['query'][_0x7110('0x1f')]);_0x57cf2c[_0x7110('0x21')]=qs[_0x7110('0x21')](_0xaa64bb[_0x7110('0x34')][_0x7110('0x21')]);}_0x57cf2c['order']=qs['sort'](_0xaa64bb[_0x7110('0x34')][_0x7110('0x3d')]);_0x57cf2c['where']=qs[_0x7110('0x35')](_[_0x7110('0x3e')](_0xaa64bb[_0x7110('0x34')],_0x4e1b45['filters']));_0x57cf2c[_0x7110('0x3f')][_0x7110('0x5c')]=_0x2bfa25['id'];if(_0xaa64bb['query'][_0x7110('0x43')]){_0x57cf2c[_0x7110('0x3f')]=_[_0x7110('0x40')](_0x57cf2c['where'],{'$or':_[_0x7110('0x2f')](_0x57cf2c['attributes'],function(_0xa33ba2){var _0x1e09cc={};_0x1e09cc[_0xa33ba2]={'$like':'%'+_0xaa64bb['query'][_0x7110('0x43')]+'%'};return _0x1e09cc;})});}_0x57cf2c=_['merge']({},_0x57cf2c,_0xaa64bb[_0x7110('0x44')]);return db['UserOpenchannelQueue'][_0x7110('0x46')](_0x57cf2c);}})[_0x7110('0x28')](function(_0x227657){if(_0x227657){return db[_0x7110('0x5d')][_0x7110('0x5e')]({'where':{'id':_[_0x7110('0x2f')](_0x227657,_0x7110('0x5f')),'role':_0x7110('0x60')},'attributes':['id',_0x7110('0x2c'),_0x7110('0x61'),_0x7110('0x62'),_0x7110('0x63')]});}})[_0x7110('0x28')](function(_0x363236){if(_0x363236){return{'count':_0x363236[_0x7110('0x20')],'rows':_['map'](_0x363236['rows'],function(_0x55dcaf){return{'membername':_0x55dcaf[_0x7110('0x2c')],'UserId':_0x55dcaf['id'],'queue_name':_0x2949c5[_0x7110('0x2c')],'OpenchannelQueueId':_0x2949c5['id'],'interface':util[_0x7110('0x64')](_0x7110('0x65'),_0x7110('0x66'),_0x55dcaf[_0x7110('0x2c')]),'penalty':0x0,'paused':_0x55dcaf['openchannelPause'],'createdAt':_0x55dcaf[_0x7110('0x63')],'updatedAt':_0x55dcaf[_0x7110('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a6935,_0x57cf2c))[_0x7110('0x48')](handleError(_0x4a6935,null));};exports[_0x7110('0x67')]=function(_0x53a08c,_0x56607e,_0x32ec21){var _0x5ef0e1={};var _0x13745f={};var _0x13f7cc;var _0x331cce;return db[_0x7110('0x30')]['findOne']({'where':{'id':_0x53a08c['params']['id']}})[_0x7110('0x28')](handleEntityNotFound(_0x56607e,null))['then'](function(_0x52703d){if(_0x52703d){_0x13f7cc=_0x52703d;_0x13745f['model']=_[_0x7110('0x4b')](db['Team'][_0x7110('0x31')]);_0x13745f['query']=_[_0x7110('0x4b')](_0x53a08c[_0x7110('0x34')]);_0x13745f[_0x7110('0x35')]=_['intersection'](_0x13745f[_0x7110('0x33')],_0x13745f[_0x7110('0x34')]);_0x5ef0e1[_0x7110('0x37')]=_['intersection'](_0x13745f[_0x7110('0x33')],qs[_0x7110('0x38')](_0x53a08c[_0x7110('0x34')][_0x7110('0x38')]));_0x5ef0e1[_0x7110('0x37')]=_0x5ef0e1['attributes'][_0x7110('0x39')]?_0x5ef0e1[_0x7110('0x37')]:_0x13745f[_0x7110('0x33')];_0x5ef0e1[_0x7110('0x3c')]=qs[_0x7110('0x3d')](_0x53a08c[_0x7110('0x34')][_0x7110('0x3d')]);_0x5ef0e1[_0x7110('0x3f')]=qs[_0x7110('0x35')](_['pick'](_0x53a08c['query'],_0x13745f[_0x7110('0x35')]));if(_0x53a08c[_0x7110('0x34')][_0x7110('0x43')]){_0x5ef0e1[_0x7110('0x3f')]=_['merge'](_0x5ef0e1[_0x7110('0x3f')],{'$or':_[_0x7110('0x2f')](_0x5ef0e1[_0x7110('0x37')],function(_0x184d23){var _0x4b92e1={};_0x4b92e1[_0x184d23]={'$like':'%'+_0x53a08c[_0x7110('0x34')][_0x7110('0x43')]+'%'};return _0x4b92e1;})});}_0x5ef0e1=_[_0x7110('0x40')]({},_0x5ef0e1,_0x53a08c[_0x7110('0x44')]);return _0x13f7cc[_0x7110('0x67')](_0x5ef0e1);}})[_0x7110('0x28')](function(_0x1830aa){if(_0x1830aa){_0x331cce=_0x1830aa[_0x7110('0x39')];if(!_0x53a08c[_0x7110('0x34')][_0x7110('0x3a')](_0x7110('0x3b'))){_0x5ef0e1[_0x7110('0x1f')]=qs[_0x7110('0x1f')](_0x53a08c[_0x7110('0x34')][_0x7110('0x1f')]);_0x5ef0e1[_0x7110('0x21')]=qs[_0x7110('0x21')](_0x53a08c[_0x7110('0x34')][_0x7110('0x21')]);}return _0x13f7cc[_0x7110('0x67')](_0x5ef0e1);}})[_0x7110('0x28')](function(_0x36db26){if(_0x36db26){return _0x36db26?{'count':_0x331cce,'rows':_0x36db26}:null;}})['then'](respondWithResult(_0x56607e,null))['catch'](handleError(_0x56607e,null));};exports[_0x7110('0x68')]=function(_0x33dacd,_0x492116,_0x386a63){var _0x441794=_0x33dacd[_0x7110('0x4f')][_0x7110('0x69')];return db['Team']['findAll']({'where':{'id':_0x441794},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x7110('0x6a'),_0x7110('0x6b'),_0x7110('0x6c')],'raw':!![]}]})[_0x7110('0x28')](function(_0x43eef2){if(_0x43eef2){var _0x513c5e=_[_0x7110('0x6d')](_0x43eef2,function(_0x18c176){var _0x3f9de7=_0x18c176[_0x7110('0x51')]({'plain':!![]});return _0x3f9de7[_0x7110('0x6e')];});return db['OpenchannelQueue'][_0x7110('0x4d')]({'where':{'id':_0x33dacd[_0x7110('0x4a')]['id']}})['then'](function(_0x1d26e1){return db[_0x7110('0x6f')][_0x7110('0x70')](function(_0x389d8a){return _0x1d26e1[_0x7110('0x68')](_0x441794,{'transaction':_0x389d8a})['then'](function(){return BPromise[_0x7110('0x71')](_0x513c5e,function(_0x51f064){return db[_0x7110('0x5b')][_0x7110('0x72')]({'where':{'UserId':_0x51f064['id'],'OpenchannelQueueId':_0x33dacd[_0x7110('0x4a')]['id']},'transaction':_0x389d8a});});})[_0x7110('0x28')](function(){_0x513c5e['forEach'](function(_0x37e19d){socket[_0x7110('0x73')](_0x7110('0x74'),{'UserId':_0x37e19d['id'],'OpenchannelQueueId':_0x1d26e1['id']});});});});});}})[_0x7110('0x28')](respondWithStatusCode(_0x492116,null))[_0x7110('0x48')](handleError(_0x492116,null));};exports[_0x7110('0x75')]=function(_0x248693,_0x34ba4b,_0x1f521d){return db['Team']['findAll']({'where':{'id':_0x248693[_0x7110('0x34')][_0x7110('0x69')]},'attributes':['id'],'include':[{'model':db[_0x7110('0x5d')],'as':_0x7110('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x7110('0x28')](handleEntityNotFound(_0x34ba4b,null))[_0x7110('0x28')](function(_0xba2493){var _0x408af5=_[_0x7110('0x2f')](_0xba2493,'id');var _0xcc48a1=[];var _0x3f0503=[];var _0xe9b951=squel[_0x7110('0x76')]();_0xe9b951[_0x7110('0x77')](_0x7110('0x78'))[_0x7110('0x79')](_0x7110('0x7a'),'tq')['join'](_0x7110('0x7b'),'ut',_0x7110('0x7c'))[_0x7110('0x3f')](_0x7110('0x7d'),_0x248693[_0x7110('0x4a')]['id']);for(var _0x14a0c9=0x0;_0x14a0c9<_0xba2493[_0x7110('0x39')];_0x14a0c9+=0x1){let _0x318d8e=_0xba2493[_0x14a0c9];for(var _0x2ef9cb=0x0;_0x2ef9cb<_0x318d8e[_0x7110('0x6e')][_0x7110('0x39')];_0x2ef9cb+=0x1){let _0x5aa883=_0x318d8e[_0x7110('0x6e')][_0x2ef9cb];var _0x273ecc=_0xe9b951[_0x7110('0x7e')]();_0x273ecc[_0x7110('0x3f')](_0x7110('0x7f'),_0x5aa883['id']);_0x3f0503['push'](db[_0x7110('0x6f')][_0x7110('0x34')](_0x273ecc[_0x7110('0x80')](),{'type':db[_0x7110('0x6f')][_0x7110('0x81')]['SELECT']})[_0x7110('0x28')](function(_0x39c1a0){if(_0x39c1a0[_0x7110('0x39')]===0x1){return _0x5aa883['id'];}else{var _0x216490=_[_0x7110('0x82')](_[_0x7110('0x2f')](_0x39c1a0,_0x7110('0x83')),function(_0x3479ac){return _[_0x7110('0x84')](_0x408af5,_0x3479ac);});if(_0x216490){return _0x5aa883['id'];}}}));}}return BPromise[_0x7110('0x85')](_0x3f0503)['then'](function(_0x2d63ed){_0xcc48a1=_(_0xcc48a1)[_0x7110('0x86')](_0x2d63ed)[_0x7110('0x87')]()['value']();return db[_0x7110('0x30')][_0x7110('0x4d')]({'where':{'id':_0x248693[_0x7110('0x4a')]['id']}})[_0x7110('0x28')](function(_0x149897){return db[_0x7110('0x6f')][_0x7110('0x70')](function(_0x2371b0){return _0x149897['removeTeams'](_0x248693[_0x7110('0x34')]['ids'],{'transaction':_0x2371b0})[_0x7110('0x28')](function(){if(!_['isEmpty'](_0xcc48a1)){return _0x149897[_0x7110('0x88')](_0xcc48a1,{'transaction':_0x2371b0});}})[_0x7110('0x28')](function(){_0xcc48a1[_0x7110('0x89')](function(_0x38ef4a){socket[_0x7110('0x73')]('userOpenchannelQueue:remove',{'UserId':_0x38ef4a,'OpenchannelQueueId':_0x149897['id']});});});});});});})[_0x7110('0x28')](respondWithStatusCode(_0x34ba4b,null))['catch'](handleError(_0x34ba4b,null));};exports[_0x7110('0x8a')]=function(_0x26aabd,_0x31d022,_0xeb98d4){return db[_0x7110('0x30')][_0x7110('0x4d')]({'where':{'id':_0x26aabd[_0x7110('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31d022,null))[_0x7110('0x28')](function(_0x465933){if(_0x465933){return _0x465933['addAgents'](_0x26aabd[_0x7110('0x4f')][_0x7110('0x69')],_['omit'](_0x26aabd[_0x7110('0x4f')],[_0x7110('0x69'),'id'])||{})[_0x7110('0x8b')](function(_0x28754b){for(var _0x3b593d=0x0;_0x3b593d<_0x26aabd[_0x7110('0x4f')][_0x7110('0x69')][_0x7110('0x39')];_0x3b593d+=0x1){socket[_0x7110('0x73')](_0x7110('0x74'),{'UserId':Number(_0x26aabd[_0x7110('0x4f')]['ids'][_0x3b593d]),'OpenchannelQueueId':Number(_0x26aabd[_0x7110('0x4a')]['id'])});}return _0x28754b;});}})[_0x7110('0x28')](respondWithResult(_0x31d022,null))[_0x7110('0x48')](handleError(_0x31d022,null));};exports[_0x7110('0x88')]=function(_0x4174f8,_0x7a36a8,_0x5bba03){return db['OpenchannelQueue']['find']({'where':{'id':_0x4174f8[_0x7110('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7a36a8,null))[_0x7110('0x28')](function(_0x276162){if(_0x276162){return _0x276162[_0x7110('0x88')](_0x4174f8[_0x7110('0x34')][_0x7110('0x69')])['then'](function(){if(_[_0x7110('0x8c')](_0x4174f8[_0x7110('0x34')]['ids'])){for(var _0x326948=0x0;_0x326948<_0x4174f8['query'][_0x7110('0x69')]['length'];_0x326948+=0x1){socket[_0x7110('0x73')](_0x7110('0x8d'),{'UserId':Number(_0x4174f8[_0x7110('0x34')][_0x7110('0x69')][_0x326948]),'OpenchannelQueueId':Number(_0x4174f8['params']['id'])});}}else{socket[_0x7110('0x73')](_0x7110('0x8d'),{'UserId':Number(_0x4174f8[_0x7110('0x34')][_0x7110('0x69')]),'OpenchannelQueueId':Number(_0x4174f8[_0x7110('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x7a36a8,null))[_0x7110('0x48')](handleError(_0x7a36a8,null));};exports['getAgents']=function(_0x43db90,_0x28832d,_0x23a9ad){var _0xdfa6e8={};var _0x2d9d6c={};var _0x3e4377;var _0x42aaf8;return db[_0x7110('0x30')]['findOne']({'where':{'id':_0x43db90['params']['id']}})[_0x7110('0x28')](handleEntityNotFound(_0x28832d,null))['then'](function(_0x30e80c){if(_0x30e80c){_0x3e4377=_0x30e80c;_0x2d9d6c[_0x7110('0x33')]=_['keys'](db[_0x7110('0x5d')][_0x7110('0x31')]);_0x2d9d6c['query']=_['keys'](_0x43db90[_0x7110('0x34')]);_0x2d9d6c[_0x7110('0x35')]=_[_0x7110('0x36')](_0x2d9d6c[_0x7110('0x33')],_0x2d9d6c[_0x7110('0x34')]);_0xdfa6e8[_0x7110('0x37')]=_[_0x7110('0x36')](_0x2d9d6c[_0x7110('0x33')],qs[_0x7110('0x38')](_0x43db90[_0x7110('0x34')][_0x7110('0x38')]));_0xdfa6e8[_0x7110('0x37')]=_0xdfa6e8['attributes'][_0x7110('0x39')]?_0xdfa6e8['attributes']:_0x2d9d6c[_0x7110('0x33')];_0xdfa6e8[_0x7110('0x3c')]=qs[_0x7110('0x3d')](_0x43db90[_0x7110('0x34')]['sort']);_0xdfa6e8[_0x7110('0x3f')]=qs[_0x7110('0x35')](_['pick'](_0x43db90[_0x7110('0x34')],_0x2d9d6c[_0x7110('0x35')]));if(_0x43db90[_0x7110('0x34')][_0x7110('0x43')]){_0xdfa6e8['where']=_[_0x7110('0x40')](_0xdfa6e8[_0x7110('0x3f')],{'$or':_[_0x7110('0x2f')](_0xdfa6e8[_0x7110('0x37')],function(_0x5a69bb){var _0x3b73ad={};_0x3b73ad[_0x5a69bb]={'$like':'%'+_0x43db90['query'][_0x7110('0x43')]+'%'};return _0x3b73ad;})});}_0xdfa6e8=_[_0x7110('0x40')]({},_0xdfa6e8,_0x43db90['options']);return _0x3e4377[_0x7110('0x8e')](_0xdfa6e8);}})[_0x7110('0x28')](function(_0x3b9c38){if(_0x3b9c38){_0x42aaf8=_0x3b9c38['length'];if(!_0x43db90[_0x7110('0x34')][_0x7110('0x3a')]('nolimit')){_0xdfa6e8[_0x7110('0x1f')]=qs['limit'](_0x43db90[_0x7110('0x34')][_0x7110('0x1f')]);_0xdfa6e8[_0x7110('0x21')]=qs[_0x7110('0x21')](_0x43db90['query'][_0x7110('0x21')]);}return _0x3e4377[_0x7110('0x8e')](_0xdfa6e8);}})[_0x7110('0x28')](function(_0x3b7f1){if(_0x3b7f1){return _0x3b7f1?{'count':_0x42aaf8,'rows':_0x3b7f1}:null;}})['then'](respondWithResult(_0x28832d,null))['catch'](handleError(_0x28832d,null));};
\ No newline at end of file
+var _0x455e=['rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','%s/%s','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','get','UserProfileResource','destroy','then','end','error','stack','OpenchannelQueue','rawAttributes','type','key','model','map','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include'];(function(_0x1c36d8,_0xc952a8){var _0x2bd373=function(_0x13018f){while(--_0x13018f){_0x1c36d8['push'](_0x1c36d8['shift']());}};_0x2bd373(++_0xc952a8);}(_0x455e,0x1db));var _0xe455=function(_0x35ec56,_0x23641d){_0x35ec56=_0x35ec56-0x0;var _0x149ee3=_0x455e[_0x35ec56];return _0x149ee3;};'use strict';var emlformat=require(_0xe455('0x0'));var rimraf=require(_0xe455('0x1'));var zipdir=require(_0xe455('0x2'));var jsonpatch=require(_0xe455('0x3'));var rp=require(_0xe455('0x4'));var moment=require(_0xe455('0x5'));var BPromise=require(_0xe455('0x6'));var Mustache=require(_0xe455('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe455('0x8'));var csv=require(_0xe455('0x9'));var ejs=require(_0xe455('0xa'));var fs=require('fs');var fs_extra=require(_0xe455('0xb'));var _=require(_0xe455('0xc'));var squel=require(_0xe455('0xd'));var crypto=require(_0xe455('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe455('0xf'));var toCsv=require(_0xe455('0x9'));var querystring=require(_0xe455('0x10'));var Papa=require(_0xe455('0x11'));var Redis=require(_0xe455('0x12'));var authService=require(_0xe455('0x13'));var qs=require(_0xe455('0x14'));var as=require(_0xe455('0x15'));var hardwareService=require(_0xe455('0x16'));var logger=require(_0xe455('0x17'))(_0xe455('0x18'));var utils=require(_0xe455('0x19'));var config=require(_0xe455('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe455('0x1b')]=_[_0xe455('0x1c')](config[_0xe455('0x1b')],{'host':_0xe455('0x1d'),'port':0x18eb});var socket=require(_0xe455('0x1e'))(new Redis(config[_0xe455('0x1b')]));require(_0xe455('0x1f'))[_0xe455('0x20')](socket);function respondWithStatusCode(_0x5de817,_0x138108){_0x138108=_0x138108||0xcc;return function(_0x4a4407){if(_0x4a4407){return _0x5de817[_0xe455('0x21')](_0x138108);}return _0x5de817[_0xe455('0x22')](_0x138108)['end']();};}function respondWithResult(_0x1609da,_0x5e3aa6){_0x5e3aa6=_0x5e3aa6||0xc8;return function(_0x2d3d36){if(_0x2d3d36){return _0x1609da[_0xe455('0x22')](_0x5e3aa6)['json'](_0x2d3d36);}};}function respondWithFilteredResult(_0x185744,_0x4bc90b){return function(_0xf65eb7){if(_0xf65eb7){var _0x2c1a6e=typeof _0x4bc90b[_0xe455('0x23')]===_0xe455('0x24')&&typeof _0x4bc90b[_0xe455('0x25')]===_0xe455('0x24');var _0x127555=_0xf65eb7['count'];var _0x355f9b=_0x2c1a6e?0x0:_0x4bc90b[_0xe455('0x23')];var _0x5134d8=_0x2c1a6e?_0xf65eb7[_0xe455('0x26')]:_0x4bc90b[_0xe455('0x23')]+_0x4bc90b[_0xe455('0x25')];var _0xa60ce7;if(_0x5134d8>=_0x127555){_0x5134d8=_0x127555;_0xa60ce7=0xc8;}else{_0xa60ce7=0xce;}_0x185744[_0xe455('0x22')](_0xa60ce7);return _0x185744['set'](_0xe455('0x27'),_0x355f9b+'-'+_0x5134d8+'/'+_0x127555)[_0xe455('0x28')](_0xf65eb7);}return null;};}function patchUpdates(_0x4455da){return function(_0x29606f){try{jsonpatch['apply'](_0x29606f,_0x4455da,!![]);}catch(_0x339526){return BPromise['reject'](_0x339526);}return _0x29606f['save']();};}function saveUpdates(_0x2cb1f0,_0x154465){return function(_0x760707){if(_0x760707){return _0x760707[_0xe455('0x29')](_0x2cb1f0)['then'](function(_0x273113){return _0x273113;});}return null;};}function removeEntity(_0x3baffe,_0x501e31){return function(_0x436139){if(_0x436139){return _0x436139['destroy']()['then'](function(){var _0x48768b=_0x436139[_0xe455('0x2a')]({'plain':!![]});var _0x2ac56d='OpenchannelQueues';return db[_0xe455('0x2b')][_0xe455('0x2c')]({'where':{'type':_0x2ac56d,'resourceId':_0x48768b['id']}})[_0xe455('0x2d')](function(){return _0x436139;});})[_0xe455('0x2d')](function(){_0x3baffe[_0xe455('0x22')](0xcc)[_0xe455('0x2e')]();});}};}function handleEntityNotFound(_0x4c83bc,_0x18e82c){return function(_0x259afd){if(!_0x259afd){_0x4c83bc['sendStatus'](0x194);}return _0x259afd;};}function handleError(_0x79b7ce,_0x4702c9){_0x4702c9=_0x4702c9||0x1f4;return function(_0x25c145){logger[_0xe455('0x2f')](_0x25c145[_0xe455('0x30')]);if(_0x25c145['name']){delete _0x25c145['name'];}_0x79b7ce[_0xe455('0x22')](_0x4702c9)['send'](_0x25c145);};}exports['index']=function(_0x8cac62,_0x25c9ef){var _0x32c961={},_0x1aadc9={},_0x363efb={'count':0x0,'rows':[]};var _0x3e911e=_['map'](db[_0xe455('0x31')][_0xe455('0x32')],function(_0x52ffb1){return{'name':_0x52ffb1['fieldName'],'type':_0x52ffb1[_0xe455('0x33')][_0xe455('0x34')]};});_0x1aadc9[_0xe455('0x35')]=_[_0xe455('0x36')](_0x3e911e,_0xe455('0x37'));_0x1aadc9[_0xe455('0x38')]=_[_0xe455('0x39')](_0x8cac62[_0xe455('0x38')]);_0x1aadc9['filters']=_[_0xe455('0x3a')](_0x1aadc9[_0xe455('0x35')],_0x1aadc9[_0xe455('0x38')]);_0x32c961['attributes']=_['intersection'](_0x1aadc9[_0xe455('0x35')],qs[_0xe455('0x3b')](_0x8cac62['query'][_0xe455('0x3b')]));_0x32c961[_0xe455('0x3c')]=_0x32c961[_0xe455('0x3c')][_0xe455('0x3d')]?_0x32c961[_0xe455('0x3c')]:_0x1aadc9[_0xe455('0x35')];if(!_0x8cac62['query']['hasOwnProperty'](_0xe455('0x3e'))){_0x32c961[_0xe455('0x25')]=qs[_0xe455('0x25')](_0x8cac62[_0xe455('0x38')][_0xe455('0x25')]);_0x32c961[_0xe455('0x23')]=qs[_0xe455('0x23')](_0x8cac62[_0xe455('0x38')][_0xe455('0x23')]);}_0x32c961[_0xe455('0x3f')]=qs[_0xe455('0x40')](_0x8cac62[_0xe455('0x38')][_0xe455('0x40')]);_0x32c961[_0xe455('0x41')]=qs[_0xe455('0x42')](_[_0xe455('0x43')](_0x8cac62[_0xe455('0x38')],_0x1aadc9[_0xe455('0x42')]),_0x3e911e);if(_0x8cac62['query'][_0xe455('0x44')]){_0x32c961[_0xe455('0x41')]=_[_0xe455('0x45')](_0x32c961[_0xe455('0x41')],{'$or':_[_0xe455('0x36')](_0x3e911e,function(_0x5ea0d5){if(_0x5ea0d5[_0xe455('0x33')]!=='VIRTUAL'){var _0x48f3d5={};_0x48f3d5[_0x5ea0d5[_0xe455('0x37')]]={'$like':'%'+_0x8cac62[_0xe455('0x38')][_0xe455('0x44')]+'%'};return _0x48f3d5;}})});}_0x32c961=_[_0xe455('0x45')]({},_0x32c961,_0x8cac62[_0xe455('0x46')]);var _0xecb8d9={'where':_0x32c961[_0xe455('0x41')]};return db[_0xe455('0x31')]['count'](_0xecb8d9)[_0xe455('0x2d')](function(_0x5764a6){_0x363efb[_0xe455('0x26')]=_0x5764a6;if(_0x8cac62[_0xe455('0x38')][_0xe455('0x47')]){_0x32c961[_0xe455('0x48')]=[{'all':!![]}];}return db[_0xe455('0x31')]['findAll'](_0x32c961);})['then'](function(_0x57226a){_0x363efb[_0xe455('0x49')]=_0x57226a;return _0x363efb;})[_0xe455('0x2d')](respondWithFilteredResult(_0x25c9ef,_0x32c961))[_0xe455('0x4a')](handleError(_0x25c9ef,null));};exports['show']=function(_0x425f87,_0x339bec){var _0x4e8bb0={'raw':!![],'where':{'id':_0x425f87[_0xe455('0x4b')]['id']}},_0x420cd9={};_0x420cd9[_0xe455('0x35')]=_[_0xe455('0x39')](db[_0xe455('0x31')][_0xe455('0x32')]);_0x420cd9[_0xe455('0x38')]=_['keys'](_0x425f87[_0xe455('0x38')]);_0x420cd9[_0xe455('0x42')]=_[_0xe455('0x3a')](_0x420cd9[_0xe455('0x35')],_0x420cd9['query']);_0x4e8bb0['attributes']=_[_0xe455('0x3a')](_0x420cd9[_0xe455('0x35')],qs['fields'](_0x425f87[_0xe455('0x38')][_0xe455('0x3b')]));_0x4e8bb0['attributes']=_0x4e8bb0[_0xe455('0x3c')][_0xe455('0x3d')]?_0x4e8bb0[_0xe455('0x3c')]:_0x420cd9[_0xe455('0x35')];if(_0x425f87[_0xe455('0x38')]['includeAll']){_0x4e8bb0[_0xe455('0x48')]=[{'all':!![]}];}_0x4e8bb0=_[_0xe455('0x45')]({},_0x4e8bb0,_0x425f87[_0xe455('0x46')]);return db[_0xe455('0x31')][_0xe455('0x4c')](_0x4e8bb0)[_0xe455('0x2d')](handleEntityNotFound(_0x339bec,null))[_0xe455('0x2d')](respondWithResult(_0x339bec,null))[_0xe455('0x4a')](handleError(_0x339bec,null));};exports[_0xe455('0x4d')]=function(_0x43a673,_0x4d8095){return db['OpenchannelQueue']['create'](_0x43a673[_0xe455('0x4e')],{})[_0xe455('0x2d')](function(_0x1fd7b5){var _0x13e807=_0x43a673[_0xe455('0x4f')][_0xe455('0x2a')]({'plain':!![]});if(!_0x13e807)throw new Error(_0xe455('0x50'));if(_0x13e807[_0xe455('0x51')]===_0xe455('0x4f')){var _0x5aecb8=_0x1fd7b5[_0xe455('0x2a')]({'plain':!![]});var _0x2e417a=_0xe455('0x52');return db['UserProfileSection'][_0xe455('0x4c')]({'where':{'name':_0x2e417a,'userProfileId':_0x13e807[_0xe455('0x53')]},'raw':!![]})[_0xe455('0x2d')](function(_0x2f3554){if(_0x2f3554&&_0x2f3554[_0xe455('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5aecb8['name'],'resourceId':_0x5aecb8['id'],'type':_0x2f3554['name'],'sectionId':_0x2f3554['id']},{})['then'](function(){return _0x1fd7b5;});}else{return _0x1fd7b5;}})[_0xe455('0x4a')](function(_0x48df7c){logger[_0xe455('0x2f')](_0xe455('0x55'),_0x48df7c);throw _0x48df7c;});}return _0x1fd7b5;})[_0xe455('0x2d')](respondWithResult(_0x4d8095,0xc9))[_0xe455('0x4a')](handleError(_0x4d8095,null));};exports[_0xe455('0x29')]=function(_0x47ab8a,_0x1abea6){if(_0x47ab8a[_0xe455('0x4e')]['id']){delete _0x47ab8a[_0xe455('0x4e')]['id'];}return db['OpenchannelQueue'][_0xe455('0x4c')]({'where':{'id':_0x47ab8a[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x1abea6,null))['then'](saveUpdates(_0x47ab8a[_0xe455('0x4e')],null))[_0xe455('0x2d')](respondWithResult(_0x1abea6,null))['catch'](handleError(_0x1abea6,null));};exports[_0xe455('0x2c')]=function(_0x280e27,_0x9f6555){return db[_0xe455('0x31')][_0xe455('0x4c')]({'where':{'id':_0x280e27[_0xe455('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9f6555,null))[_0xe455('0x2d')](removeEntity(_0x9f6555,null))['catch'](handleError(_0x9f6555,null));};exports[_0xe455('0x56')]=function(_0x531145,_0x4411e4){return db[_0xe455('0x31')]['describe']()['then'](respondWithResult(_0x4411e4,null))['catch'](handleError(_0x4411e4,null));};exports[_0xe455('0x57')]=function(_0x55db4a,_0x517154,_0x53d70b){var _0x3b9e97={'raw':!![],'where':{}},_0x4130df={},_0x2370a1;return db[_0xe455('0x31')]['findOne']({'where':{'id':_0x55db4a['params']['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x517154,null))['then'](function(_0x8a15e6){if(_0x8a15e6){_0x2370a1=_0x8a15e6['get']({'plain':!![]});_0x4130df[_0xe455('0x35')]=_[_0xe455('0x39')](db[_0xe455('0x58')][_0xe455('0x32')]);_0x4130df[_0xe455('0x38')]=_[_0xe455('0x39')](_0x55db4a[_0xe455('0x38')]);_0x4130df[_0xe455('0x42')]=_['intersection'](_0x4130df[_0xe455('0x35')],_0x4130df[_0xe455('0x38')]);_0x3b9e97[_0xe455('0x3c')]=_[_0xe455('0x3a')](_0x4130df['model'],qs[_0xe455('0x3b')](_0x55db4a['query'][_0xe455('0x3b')]));_0x3b9e97[_0xe455('0x3c')]=_0x3b9e97[_0xe455('0x3c')][_0xe455('0x3d')]?_0x3b9e97[_0xe455('0x3c')]:_0x4130df['model'];if(!_0x55db4a[_0xe455('0x38')]['hasOwnProperty'](_0xe455('0x3e'))){_0x3b9e97['limit']=qs['limit'](_0x55db4a[_0xe455('0x38')][_0xe455('0x25')]);_0x3b9e97[_0xe455('0x23')]=qs[_0xe455('0x23')](_0x55db4a[_0xe455('0x38')][_0xe455('0x23')]);}_0x3b9e97['order']=qs[_0xe455('0x40')](_0x55db4a[_0xe455('0x38')][_0xe455('0x40')]);_0x3b9e97['where']=qs['filters'](_['pick'](_0x55db4a[_0xe455('0x38')],_0x4130df[_0xe455('0x42')]));_0x3b9e97['where'][_0xe455('0x59')]=_0x8a15e6['id'];if(_0x55db4a[_0xe455('0x38')]['filter']){_0x3b9e97[_0xe455('0x41')]=_[_0xe455('0x45')](_0x3b9e97[_0xe455('0x41')],{'$or':_[_0xe455('0x36')](_0x3b9e97[_0xe455('0x3c')],function(_0x4b6c74){var _0x5c61fe={};_0x5c61fe[_0x4b6c74]={'$like':'%'+_0x55db4a['query']['filter']+'%'};return _0x5c61fe;})});}_0x3b9e97=_[_0xe455('0x45')]({},_0x3b9e97,_0x55db4a[_0xe455('0x46')]);return db[_0xe455('0x58')][_0xe455('0x5a')](_0x3b9e97);}})['then'](function(_0x335872){if(_0x335872){return db[_0xe455('0x5b')][_0xe455('0x5c')]({'where':{'id':_[_0xe455('0x36')](_0x335872,'UserId'),'role':_0xe455('0x5d')},'attributes':['id',_0xe455('0x37'),_0xe455('0x5e'),_0xe455('0x5f'),_0xe455('0x60')]});}})['then'](function(_0x238a89){if(_0x238a89){return{'count':_0x238a89[_0xe455('0x26')],'rows':_[_0xe455('0x36')](_0x238a89[_0xe455('0x49')],function(_0x233e2f){return{'membername':_0x233e2f['name'],'UserId':_0x233e2f['id'],'queue_name':_0x2370a1[_0xe455('0x37')],'OpenchannelQueueId':_0x2370a1['id'],'interface':util['format'](_0xe455('0x61'),'SIP',_0x233e2f[_0xe455('0x37')]),'penalty':0x0,'paused':_0x233e2f[_0xe455('0x5e')],'createdAt':_0x233e2f[_0xe455('0x60')],'updatedAt':_0x233e2f[_0xe455('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x517154,_0x3b9e97))[_0xe455('0x4a')](handleError(_0x517154,null));};exports[_0xe455('0x62')]=function(_0x38fe52,_0x4248bd,_0x5af651){var _0x259563={};var _0x1f183c={};var _0x18a288;var _0x419216;return db[_0xe455('0x31')][_0xe455('0x63')]({'where':{'id':_0x38fe52[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x4248bd,null))[_0xe455('0x2d')](function(_0x4a30a8){if(_0x4a30a8){_0x18a288=_0x4a30a8;_0x1f183c['model']=_[_0xe455('0x39')](db['Team']['rawAttributes']);_0x1f183c['query']=_[_0xe455('0x39')](_0x38fe52['query']);_0x1f183c[_0xe455('0x42')]=_[_0xe455('0x3a')](_0x1f183c[_0xe455('0x35')],_0x1f183c['query']);_0x259563[_0xe455('0x3c')]=_[_0xe455('0x3a')](_0x1f183c['model'],qs[_0xe455('0x3b')](_0x38fe52[_0xe455('0x38')]['fields']));_0x259563['attributes']=_0x259563[_0xe455('0x3c')][_0xe455('0x3d')]?_0x259563[_0xe455('0x3c')]:_0x1f183c['model'];_0x259563[_0xe455('0x3f')]=qs[_0xe455('0x40')](_0x38fe52[_0xe455('0x38')][_0xe455('0x40')]);_0x259563[_0xe455('0x41')]=qs[_0xe455('0x42')](_[_0xe455('0x43')](_0x38fe52['query'],_0x1f183c[_0xe455('0x42')]));if(_0x38fe52['query']['filter']){_0x259563['where']=_[_0xe455('0x45')](_0x259563[_0xe455('0x41')],{'$or':_[_0xe455('0x36')](_0x259563[_0xe455('0x3c')],function(_0x389048){var _0xe86f22={};_0xe86f22[_0x389048]={'$like':'%'+_0x38fe52['query'][_0xe455('0x44')]+'%'};return _0xe86f22;})});}_0x259563=_['merge']({},_0x259563,_0x38fe52[_0xe455('0x46')]);return _0x18a288[_0xe455('0x62')](_0x259563);}})['then'](function(_0x2185f7){if(_0x2185f7){_0x419216=_0x2185f7['length'];if(!_0x38fe52[_0xe455('0x38')]['hasOwnProperty'](_0xe455('0x3e'))){_0x259563[_0xe455('0x25')]=qs[_0xe455('0x25')](_0x38fe52[_0xe455('0x38')][_0xe455('0x25')]);_0x259563[_0xe455('0x23')]=qs[_0xe455('0x23')](_0x38fe52[_0xe455('0x38')][_0xe455('0x23')]);}return _0x18a288['getTeams'](_0x259563);}})[_0xe455('0x2d')](function(_0x353d2c){if(_0x353d2c){return _0x353d2c?{'count':_0x419216,'rows':_0x353d2c}:null;}})[_0xe455('0x2d')](respondWithResult(_0x4248bd,null))['catch'](handleError(_0x4248bd,null));};exports[_0xe455('0x64')]=function(_0x339adb,_0x16f4be,_0xfb6e09){var _0x4081cc=_0x339adb[_0xe455('0x4e')][_0xe455('0x65')];return db[_0xe455('0x66')][_0xe455('0x5a')]({'where':{'id':_0x4081cc},'attributes':['id'],'include':[{'model':db[_0xe455('0x5b')],'as':_0xe455('0x67'),'attributes':['id',_0xe455('0x37'),_0xe455('0x68'),_0xe455('0x69'),_0xe455('0x6a')],'raw':!![]}]})[_0xe455('0x2d')](function(_0x2f3d53){if(_0x2f3d53){var _0xa81014=_['flatMap'](_0x2f3d53,function(_0x25055b){var _0x3e92a2=_0x25055b[_0xe455('0x2a')]({'plain':!![]});return _0x3e92a2[_0xe455('0x67')];});return db['OpenchannelQueue'][_0xe455('0x4c')]({'where':{'id':_0x339adb[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](function(_0x28725b){return db[_0xe455('0x6b')][_0xe455('0x6c')](function(_0xdc0270){return _0x28725b[_0xe455('0x64')](_0x4081cc,{'transaction':_0xdc0270})[_0xe455('0x2d')](function(){return BPromise[_0xe455('0x6d')](_0xa81014,function(_0x27061d){return db[_0xe455('0x58')]['findOrCreate']({'where':{'UserId':_0x27061d['id'],'OpenchannelQueueId':_0x339adb[_0xe455('0x4b')]['id']},'transaction':_0xdc0270});});})[_0xe455('0x2d')](function(){_0xa81014[_0xe455('0x6e')](function(_0x32a257){socket[_0xe455('0x6f')](_0xe455('0x70'),{'UserId':_0x32a257['id'],'OpenchannelQueueId':_0x28725b['id']});});});});});}})[_0xe455('0x2d')](respondWithStatusCode(_0x16f4be,null))[_0xe455('0x4a')](handleError(_0x16f4be,null));};exports[_0xe455('0x71')]=function(_0x2922b4,_0xef7caf,_0x1b3cb3){return db[_0xe455('0x66')][_0xe455('0x5a')]({'where':{'id':_0x2922b4[_0xe455('0x38')][_0xe455('0x65')]},'attributes':['id'],'include':[{'model':db[_0xe455('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe455('0x2d')](handleEntityNotFound(_0xef7caf,null))[_0xe455('0x2d')](function(_0x436aa4){var _0x35a7af=_[_0xe455('0x36')](_0x436aa4,'id');var _0x491387=[];var _0xdc2803=[];var _0x3ac77d=squel[_0xe455('0x72')]();_0x3ac77d['field'](_0xe455('0x73'))[_0xe455('0x74')](_0xe455('0x75'),'tq')['join'](_0xe455('0x76'),'ut',_0xe455('0x77'))['where'](_0xe455('0x78'),_0x2922b4[_0xe455('0x4b')]['id']);for(var _0x54cf30=0x0;_0x54cf30<_0x436aa4[_0xe455('0x3d')];_0x54cf30+=0x1){let _0x234670=_0x436aa4[_0x54cf30];for(var _0x1a1695=0x0;_0x1a1695<_0x234670[_0xe455('0x67')][_0xe455('0x3d')];_0x1a1695+=0x1){let _0x591957=_0x234670[_0xe455('0x67')][_0x1a1695];var _0x2a8e3e=_0x3ac77d[_0xe455('0x79')]();_0x2a8e3e[_0xe455('0x41')](_0xe455('0x7a'),_0x591957['id']);_0xdc2803['push'](db[_0xe455('0x6b')][_0xe455('0x38')](_0x2a8e3e['toString'](),{'type':db['sequelize']['QueryTypes'][_0xe455('0x7b')]})['then'](function(_0xfc537b){if(_0xfc537b['length']===0x1){return _0x591957['id'];}else{var _0x479640=_[_0xe455('0x7c')](_['map'](_0xfc537b,_0xe455('0x7d')),function(_0x295d5f){return _[_0xe455('0x7e')](_0x35a7af,_0x295d5f);});if(_0x479640){return _0x591957['id'];}}}));}}return BPromise[_0xe455('0x7f')](_0xdc2803)[_0xe455('0x2d')](function(_0x24b97d){_0x491387=_(_0x491387)['union'](_0x24b97d)[_0xe455('0x80')]()[_0xe455('0x81')]();return db[_0xe455('0x31')][_0xe455('0x4c')]({'where':{'id':_0x2922b4[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](function(_0x2bb731){return db[_0xe455('0x6b')][_0xe455('0x6c')](function(_0x3f30e8){return _0x2bb731['removeTeams'](_0x2922b4['query'][_0xe455('0x65')],{'transaction':_0x3f30e8})[_0xe455('0x2d')](function(){if(!_[_0xe455('0x82')](_0x491387)){return _0x2bb731[_0xe455('0x83')](_0x491387,{'transaction':_0x3f30e8});}})[_0xe455('0x2d')](function(){_0x491387[_0xe455('0x6e')](function(_0x616510){socket[_0xe455('0x6f')](_0xe455('0x84'),{'UserId':_0x616510,'OpenchannelQueueId':_0x2bb731['id']});});});});});});})[_0xe455('0x2d')](respondWithStatusCode(_0xef7caf,null))[_0xe455('0x4a')](handleError(_0xef7caf,null));};exports['addAgents']=function(_0x30cde5,_0x446d13,_0x2d9a3d){return db[_0xe455('0x31')][_0xe455('0x4c')]({'where':{'id':_0x30cde5[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x446d13,null))[_0xe455('0x2d')](function(_0x596bc8){if(_0x596bc8){return _0x596bc8[_0xe455('0x85')](_0x30cde5[_0xe455('0x4e')][_0xe455('0x65')],_[_0xe455('0x86')](_0x30cde5[_0xe455('0x4e')],[_0xe455('0x65'),'id'])||{})['spread'](function(_0x14a320){for(var _0x3c082e=0x0;_0x3c082e<_0x30cde5['body'][_0xe455('0x65')]['length'];_0x3c082e+=0x1){socket[_0xe455('0x6f')](_0xe455('0x70'),{'UserId':Number(_0x30cde5[_0xe455('0x4e')]['ids'][_0x3c082e]),'OpenchannelQueueId':Number(_0x30cde5[_0xe455('0x4b')]['id'])});}return _0x14a320;});}})[_0xe455('0x2d')](respondWithResult(_0x446d13,null))[_0xe455('0x4a')](handleError(_0x446d13,null));};exports['removeAgents']=function(_0x2ef8a6,_0x2b2d1d,_0xe62d2){return db[_0xe455('0x31')][_0xe455('0x4c')]({'where':{'id':_0x2ef8a6[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x2b2d1d,null))[_0xe455('0x2d')](function(_0x5c0f54){if(_0x5c0f54){return _0x5c0f54[_0xe455('0x83')](_0x2ef8a6[_0xe455('0x38')][_0xe455('0x65')])[_0xe455('0x2d')](function(){if(_[_0xe455('0x87')](_0x2ef8a6[_0xe455('0x38')][_0xe455('0x65')])){for(var _0x5a651a=0x0;_0x5a651a<_0x2ef8a6[_0xe455('0x38')]['ids']['length'];_0x5a651a+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2ef8a6[_0xe455('0x38')][_0xe455('0x65')][_0x5a651a]),'OpenchannelQueueId':Number(_0x2ef8a6[_0xe455('0x4b')]['id'])});}}else{socket[_0xe455('0x6f')](_0xe455('0x84'),{'UserId':Number(_0x2ef8a6[_0xe455('0x38')][_0xe455('0x65')]),'OpenchannelQueueId':Number(_0x2ef8a6['params']['id'])});}});}})[_0xe455('0x2d')](respondWithStatusCode(_0x2b2d1d,null))['catch'](handleError(_0x2b2d1d,null));};exports[_0xe455('0x88')]=function(_0x773179,_0x3cca57,_0x3af686){var _0x49e349={};var _0x1bcf8c={};var _0x42680b;var _0x58b2a6;return db['OpenchannelQueue'][_0xe455('0x63')]({'where':{'id':_0x773179[_0xe455('0x4b')]['id']}})[_0xe455('0x2d')](handleEntityNotFound(_0x3cca57,null))['then'](function(_0x5e8073){if(_0x5e8073){_0x42680b=_0x5e8073;_0x1bcf8c[_0xe455('0x35')]=_[_0xe455('0x39')](db['User'][_0xe455('0x32')]);_0x1bcf8c[_0xe455('0x38')]=_[_0xe455('0x39')](_0x773179[_0xe455('0x38')]);_0x1bcf8c[_0xe455('0x42')]=_[_0xe455('0x3a')](_0x1bcf8c['model'],_0x1bcf8c[_0xe455('0x38')]);_0x49e349[_0xe455('0x3c')]=_[_0xe455('0x3a')](_0x1bcf8c[_0xe455('0x35')],qs[_0xe455('0x3b')](_0x773179['query'][_0xe455('0x3b')]));_0x49e349[_0xe455('0x3c')]=_0x49e349[_0xe455('0x3c')]['length']?_0x49e349['attributes']:_0x1bcf8c['model'];_0x49e349[_0xe455('0x3f')]=qs[_0xe455('0x40')](_0x773179['query'][_0xe455('0x40')]);_0x49e349[_0xe455('0x41')]=qs['filters'](_['pick'](_0x773179['query'],_0x1bcf8c[_0xe455('0x42')]));if(_0x773179[_0xe455('0x38')]['filter']){_0x49e349[_0xe455('0x41')]=_[_0xe455('0x45')](_0x49e349['where'],{'$or':_[_0xe455('0x36')](_0x49e349['attributes'],function(_0x2ddc9f){var _0x1b58b7={};_0x1b58b7[_0x2ddc9f]={'$like':'%'+_0x773179[_0xe455('0x38')][_0xe455('0x44')]+'%'};return _0x1b58b7;})});}_0x49e349=_[_0xe455('0x45')]({},_0x49e349,_0x773179[_0xe455('0x46')]);return _0x42680b['getAgents'](_0x49e349);}})[_0xe455('0x2d')](function(_0x5e481d){if(_0x5e481d){_0x58b2a6=_0x5e481d[_0xe455('0x3d')];if(!_0x773179[_0xe455('0x38')]['hasOwnProperty']('nolimit')){_0x49e349[_0xe455('0x25')]=qs[_0xe455('0x25')](_0x773179[_0xe455('0x38')][_0xe455('0x25')]);_0x49e349['offset']=qs['offset'](_0x773179[_0xe455('0x38')][_0xe455('0x23')]);}return _0x42680b[_0xe455('0x88')](_0x49e349);}})[_0xe455('0x2d')](function(_0x5cebf9){if(_0x5cebf9){return _0x5cebf9?{'count':_0x58b2a6,'rows':_0x5cebf9}:null;}})['then'](respondWithResult(_0x3cca57,null))[_0xe455('0x4a')](handleError(_0x3cca57,null));};
\ No newline at end of file
index 49affa6..7fe8daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d3f=['events','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6d3f,0xa2));var _0xf6d3=function(_0x5bc0b7,_0x45cb7d){_0x5bc0b7=_0x5bc0b7-0x0;var _0x33f7a0=_0x6d3f[_0x5bc0b7];return _0x33f7a0;};'use strict';var EventEmitter=require(_0xf6d3('0x0'));var OpenchannelQueue=require(_0xf6d3('0x1'))['db'][_0xf6d3('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf6d3('0x3'),'afterUpdate':_0xf6d3('0x4'),'afterDestroy':_0xf6d3('0x5')};function emitEvent(_0x400a52){return function(_0x41671e,_0x247b40,_0x8e650d){OpenchannelQueueEvents['emit'](_0x400a52+':'+_0x41671e['id'],_0x41671e);OpenchannelQueueEvents[_0xf6d3('0x6')](_0x400a52,_0x41671e);_0x8e650d(null);};}for(var e in events){if(events[_0xf6d3('0x7')](e)){var event=events[e];OpenchannelQueue[_0xf6d3('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xd115=['hook','events','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x45a7a3,_0x49891c){var _0x4220d1=function(_0x544690){while(--_0x544690){_0x45a7a3['push'](_0x45a7a3['shift']());}};_0x4220d1(++_0x49891c);}(_0xd115,0x184));var _0x5d11=function(_0xe22018,_0x2b4c0d){_0xe22018=_0xe22018-0x0;var _0x273ec5=_0xd115[_0xe22018];return _0x273ec5;};'use strict';var EventEmitter=require(_0x5d11('0x0'));var OpenchannelQueue=require(_0x5d11('0x1'))['db'][_0x5d11('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d11('0x3'),'afterUpdate':_0x5d11('0x4'),'afterDestroy':_0x5d11('0x5')};function emitEvent(_0x30b71e){return function(_0x114a7f,_0x47a3a3,_0x2342ae){OpenchannelQueueEvents[_0x5d11('0x6')](_0x30b71e+':'+_0x114a7f['id'],_0x114a7f);OpenchannelQueueEvents[_0x5d11('0x6')](_0x30b71e,_0x114a7f);_0x2342ae(null);};}for(var e in events){if(events[_0x5d11('0x7')](e)){var event=events[e];OpenchannelQueue[_0x5d11('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index fb433af..f873c94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee01=['path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x148f94,_0x58c56a){var _0x58e4b4=function(_0x1b20af){while(--_0x1b20af){_0x148f94['push'](_0x148f94['shift']());}};_0x58e4b4(++_0x58c56a);}(_0xee01,0x103));var _0x1ee0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee01[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1ee0('0x0'));var util=require('util');var logger=require(_0x1ee0('0x1'))(_0x1ee0('0x2'));var moment=require(_0x1ee0('0x3'));var BPromise=require(_0x1ee0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee0('0x5'));var rimraf=require(_0x1ee0('0x6'));var config=require(_0x1ee0('0x7'));var attributes=require(_0x1ee0('0x8'));module['exports']=function(_0x5ec491,_0x594536){return _0x5ec491[_0x1ee0('0x9')](_0x1ee0('0xa'),attributes,{'tableName':_0x1ee0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x49b0=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelQueue.attributes','exports','define'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x49b0,0x1a2));var _0x049b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var logger=require(_0x049b('0x2'))(_0x049b('0x3'));var moment=require(_0x049b('0x4'));var BPromise=require(_0x049b('0x5'));var rp=require(_0x049b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x049b('0x7'));var config=require('../../config/environment');var attributes=require(_0x049b('0x8'));module[_0x049b('0x9')]=function(_0x302e12,_0x1dd99a){return _0x302e12[_0x049b('0xa')](_0x049b('0xb'),attributes,{'tableName':_0x049b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3dbd753..a1fc284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf362=['lodash','util','randomstring','ioredis','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','include','map','model','attributes','info','GetOpenchannelQueue','ShowOpenchannelQueue','where'];(function(_0x3f1915,_0x2b3288){var _0x26f6b4=function(_0x169201){while(--_0x169201){_0x3f1915['push'](_0x3f1915['shift']());}};_0x26f6b4(++_0x2b3288);}(_0xf362,0x16b));var _0x2f36=function(_0x27d487,_0x45683e){_0x27d487=_0x27d487-0x0;var _0x1c9602=_0xf362[_0x27d487];return _0x1c9602;};'use strict';var _=require(_0x2f36('0x0'));var util=require(_0x2f36('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f36('0x2'));var fs=require('fs');var Redis=require(_0x2f36('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2f36('0x4'));var config=require(_0x2f36('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2f36('0x6')][_0x2f36('0x7')]({'port':0x232a});config[_0x2f36('0x8')]=_['defaults'](config[_0x2f36('0x8')],{'host':_0x2f36('0x9'),'port':0x18eb});var socket=require(_0x2f36('0xa'))(new Redis(config[_0x2f36('0x8')]));require(_0x2f36('0xb'))['register'](socket);function respondWithRpcPromise(_0x1ad39b,_0xf9f148,_0xf88ac2){return new BPromise(function(_0x1643ca,_0x5080e2){return client['request'](_0x1ad39b,_0xf88ac2)[_0x2f36('0xc')](function(_0x3b3a38){logger['info'](_0x2f36('0xd'),_0xf9f148,_0x2f36('0xe'));logger[_0x2f36('0xf')](_0x2f36('0x10'),_0xf9f148,'request\x20sent',JSON[_0x2f36('0x11')](_0x3b3a38));if(_0x3b3a38[_0x2f36('0x12')]){if(_0x3b3a38[_0x2f36('0x12')][_0x2f36('0x13')]===0x1f4){logger[_0x2f36('0x12')](_0x2f36('0xd'),_0xf9f148,_0x3b3a38['error'][_0x2f36('0x14')]);return _0x5080e2(_0x3b3a38[_0x2f36('0x12')][_0x2f36('0x14')]);}logger[_0x2f36('0x12')](_0x2f36('0xd'),_0xf9f148,_0x3b3a38[_0x2f36('0x12')]['message']);return _0x1643ca(_0x3b3a38[_0x2f36('0x12')][_0x2f36('0x14')]);}else{logger['info'](_0x2f36('0xd'),_0xf9f148,_0x2f36('0xe'));_0x1643ca(_0x3b3a38['result']['message']);}})[_0x2f36('0x15')](function(_0x3479a9){logger[_0x2f36('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0xf9f148,_0x3479a9);_0x5080e2(_0x3479a9);});});}exports['GetOpenchannelQueue']=function(_0x2ede2b){var _0x1720a2=this;return new Promise(function(_0x6ffc44,_0x47983f){return db['OpenchannelQueue'][_0x2f36('0x16')]({'raw':_0x2ede2b[_0x2f36('0x17')]?_0x2ede2b[_0x2f36('0x17')][_0x2f36('0x18')]===undefined?!![]:![]:!![],'where':_0x2ede2b['options']?_0x2ede2b[_0x2f36('0x17')]['where']||null:null,'attributes':_0x2ede2b[_0x2f36('0x17')]?_0x2ede2b['options']['attributes']||null:null,'limit':_0x2ede2b[_0x2f36('0x17')]?_0x2ede2b[_0x2f36('0x17')]['limit']||null:null,'include':_0x2ede2b['options']?_0x2ede2b[_0x2f36('0x17')][_0x2f36('0x19')]?_[_0x2f36('0x1a')](_0x2ede2b['options'][_0x2f36('0x19')],function(_0x474046){return{'model':db[_0x474046[_0x2f36('0x1b')]],'as':_0x474046['as'],'attributes':_0x474046[_0x2f36('0x1c')],'include':_0x474046[_0x2f36('0x19')]?_[_0x2f36('0x1a')](_0x474046[_0x2f36('0x19')],function(_0x575ded){return{'model':db[_0x575ded[_0x2f36('0x1b')]],'as':_0x575ded['as'],'attributes':_0x575ded[_0x2f36('0x1c')],'include':_0x575ded[_0x2f36('0x19')]?_[_0x2f36('0x1a')](_0x575ded['include'],function(_0x10553f){return{'model':db[_0x10553f[_0x2f36('0x1b')]],'as':_0x10553f['as'],'attributes':_0x10553f[_0x2f36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2f36('0xc')](function(_0x4ee1b6){logger[_0x2f36('0x1d')](_0x2f36('0x1e'),_0x2ede2b);logger[_0x2f36('0xf')](_0x2f36('0x1e'),_0x2ede2b,JSON[_0x2f36('0x11')](_0x4ee1b6));_0x6ffc44(_0x4ee1b6);})[_0x2f36('0x15')](function(_0x19f228){logger[_0x2f36('0x12')]('GetOpenchannelQueue',_0x19f228[_0x2f36('0x14')],_0x2ede2b);_0x47983f(_0x1720a2[_0x2f36('0x12')](0x1f4,_0x19f228['message']));});});};exports[_0x2f36('0x1f')]=function(_0x17802b){var _0x349387=this;return new Promise(function(_0x11ab66,_0x424de3){return db['OpenchannelQueue']['find']({'raw':_0x17802b[_0x2f36('0x17')]?_0x17802b[_0x2f36('0x17')][_0x2f36('0x18')]===undefined?!![]:![]:!![],'where':_0x17802b[_0x2f36('0x17')]?_0x17802b['options'][_0x2f36('0x20')]||null:null,'attributes':_0x17802b['options']?_0x17802b[_0x2f36('0x17')]['attributes']||null:null,'include':_0x17802b[_0x2f36('0x17')]?_0x17802b[_0x2f36('0x17')][_0x2f36('0x19')]?_[_0x2f36('0x1a')](_0x17802b[_0x2f36('0x17')]['include'],function(_0xb78301){return{'model':db[_0xb78301[_0x2f36('0x1b')]],'as':_0xb78301['as'],'attributes':_0xb78301[_0x2f36('0x1c')],'include':_0xb78301['include']?_['map'](_0xb78301[_0x2f36('0x19')],function(_0x2462c3){return{'model':db[_0x2462c3[_0x2f36('0x1b')]],'as':_0x2462c3['as'],'attributes':_0x2462c3['attributes'],'include':_0x2462c3[_0x2f36('0x19')]?_[_0x2f36('0x1a')](_0x2462c3[_0x2f36('0x19')],function(_0x363030){return{'model':db[_0x363030[_0x2f36('0x1b')]],'as':_0x363030['as'],'attributes':_0x363030[_0x2f36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2f36('0xc')](function(_0x3dab1f){logger[_0x2f36('0x1d')](_0x2f36('0x1f'),_0x17802b);logger[_0x2f36('0xf')]('ShowOpenchannelQueue',_0x17802b,JSON[_0x2f36('0x11')](_0x3dab1f));_0x11ab66(_0x3dab1f);})[_0x2f36('0x15')](function(_0xeb6bd5){logger[_0x2f36('0x12')](_0x2f36('0x1f'),_0xeb6bd5[_0x2f36('0x14')],_0x17802b);_0x424de3(_0x349387[_0x2f36('0x12')](0x1f4,_0xeb6bd5[_0x2f36('0x14')]));});});};
\ No newline at end of file
+var _0x5423=['localhost','socket.io-emitter','./openchannelQueue.socket','register','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message','info','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','model','map','attributes','find','ShowOpenchannelQueue','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x44ee29,_0x43e5b8){var _0x3b5047=function(_0x25098c){while(--_0x25098c){_0x44ee29['push'](_0x44ee29['shift']());}};_0x3b5047(++_0x43e5b8);}(_0x5423,0x14a));var _0x3542=function(_0x2865d3,_0x1fadcc){_0x2865d3=_0x2865d3-0x0;var _0xd46c0=_0x5423[_0x2865d3];return _0xd46c0;};'use strict';var _=require(_0x3542('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3542('0x1'));var rs=require(_0x3542('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x3'))['db'];var utils=require(_0x3542('0x4'));var logger=require(_0x3542('0x5'))(_0x3542('0x6'));var config=require(_0x3542('0x7'));var jayson=require(_0x3542('0x8'));var client=jayson['client'][_0x3542('0x9')]({'port':0x232a});config[_0x3542('0xa')]=_[_0x3542('0xb')](config[_0x3542('0xa')],{'host':_0x3542('0xc'),'port':0x18eb});var socket=require(_0x3542('0xd'))(new Redis(config[_0x3542('0xa')]));require(_0x3542('0xe'))[_0x3542('0xf')](socket);function respondWithRpcPromise(_0x517293,_0x2f0b0,_0x16093d){return new BPromise(function(_0x32cfd3,_0x2f63b1){return client['request'](_0x517293,_0x16093d)[_0x3542('0x10')](function(_0x4806b2){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x2f0b0,_0x3542('0x11'));logger[_0x3542('0x12')](_0x3542('0x13'),_0x2f0b0,_0x3542('0x11'),JSON['stringify'](_0x4806b2));if(_0x4806b2[_0x3542('0x14')]){if(_0x4806b2['error']['code']===0x1f4){logger[_0x3542('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2f0b0,_0x4806b2['error']['message']);return _0x2f63b1(_0x4806b2[_0x3542('0x14')]['message']);}logger[_0x3542('0x14')](_0x3542('0x15'),_0x2f0b0,_0x4806b2[_0x3542('0x14')]['message']);return _0x32cfd3(_0x4806b2[_0x3542('0x14')][_0x3542('0x16')]);}else{logger[_0x3542('0x17')](_0x3542('0x15'),_0x2f0b0,_0x3542('0x11'));_0x32cfd3(_0x4806b2['result']['message']);}})['catch'](function(_0x468d53){logger[_0x3542('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2f0b0,_0x468d53);_0x2f63b1(_0x468d53);});});}exports[_0x3542('0x18')]=function(_0x408c27){var _0x1a2bd9=this;return new Promise(function(_0x43f2e8,_0x35dd08){return db[_0x3542('0x19')][_0x3542('0x1a')]({'raw':_0x408c27[_0x3542('0x1b')]?_0x408c27[_0x3542('0x1b')][_0x3542('0x1c')]===undefined?!![]:![]:!![],'where':_0x408c27[_0x3542('0x1b')]?_0x408c27['options'][_0x3542('0x1d')]||null:null,'attributes':_0x408c27[_0x3542('0x1b')]?_0x408c27[_0x3542('0x1b')]['attributes']||null:null,'limit':_0x408c27[_0x3542('0x1b')]?_0x408c27[_0x3542('0x1b')][_0x3542('0x1e')]||null:null,'include':_0x408c27[_0x3542('0x1b')]?_0x408c27[_0x3542('0x1b')][_0x3542('0x1f')]?_['map'](_0x408c27[_0x3542('0x1b')][_0x3542('0x1f')],function(_0x401dfc){return{'model':db[_0x401dfc[_0x3542('0x20')]],'as':_0x401dfc['as'],'attributes':_0x401dfc['attributes'],'include':_0x401dfc['include']?_[_0x3542('0x21')](_0x401dfc[_0x3542('0x1f')],function(_0x4aa5b4){return{'model':db[_0x4aa5b4[_0x3542('0x20')]],'as':_0x4aa5b4['as'],'attributes':_0x4aa5b4['attributes'],'include':_0x4aa5b4[_0x3542('0x1f')]?_[_0x3542('0x21')](_0x4aa5b4[_0x3542('0x1f')],function(_0x509f9c){return{'model':db[_0x509f9c[_0x3542('0x20')]],'as':_0x509f9c['as'],'attributes':_0x509f9c[_0x3542('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10b832){logger[_0x3542('0x17')]('GetOpenchannelQueue',_0x408c27);logger['debug'](_0x3542('0x18'),_0x408c27,JSON['stringify'](_0x10b832));_0x43f2e8(_0x10b832);})['catch'](function(_0x581761){logger[_0x3542('0x14')](_0x3542('0x18'),_0x581761[_0x3542('0x16')],_0x408c27);_0x35dd08(_0x1a2bd9['error'](0x1f4,_0x581761[_0x3542('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x23884b){var _0x263f3d=this;return new Promise(function(_0x3520ea,_0x2c08f1){return db[_0x3542('0x19')][_0x3542('0x23')]({'raw':_0x23884b[_0x3542('0x1b')]?_0x23884b['options']['raw']===undefined?!![]:![]:!![],'where':_0x23884b[_0x3542('0x1b')]?_0x23884b['options'][_0x3542('0x1d')]||null:null,'attributes':_0x23884b[_0x3542('0x1b')]?_0x23884b[_0x3542('0x1b')][_0x3542('0x22')]||null:null,'include':_0x23884b[_0x3542('0x1b')]?_0x23884b[_0x3542('0x1b')]['include']?_['map'](_0x23884b['options'][_0x3542('0x1f')],function(_0xf6121){return{'model':db[_0xf6121[_0x3542('0x20')]],'as':_0xf6121['as'],'attributes':_0xf6121[_0x3542('0x22')],'include':_0xf6121['include']?_['map'](_0xf6121['include'],function(_0x46a44b){return{'model':db[_0x46a44b['model']],'as':_0x46a44b['as'],'attributes':_0x46a44b[_0x3542('0x22')],'include':_0x46a44b[_0x3542('0x1f')]?_[_0x3542('0x21')](_0x46a44b[_0x3542('0x1f')],function(_0x11dcfb){return{'model':db[_0x11dcfb[_0x3542('0x20')]],'as':_0x11dcfb['as'],'attributes':_0x11dcfb['attributes']};}):[]};}):[]};}):[]:[]})[_0x3542('0x10')](function(_0x318a60){logger[_0x3542('0x17')](_0x3542('0x24'),_0x23884b);logger[_0x3542('0x12')](_0x3542('0x24'),_0x23884b,JSON[_0x3542('0x25')](_0x318a60));_0x3520ea(_0x318a60);})['catch'](function(_0x42bd45){logger['error']('ShowOpenchannelQueue',_0x42bd45[_0x3542('0x16')],_0x23884b);_0x2c08f1(_0x263f3d[_0x3542('0x14')](0x1f4,_0x42bd45[_0x3542('0x16')]));});});};
\ No newline at end of file
index 33946d9..19a9593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92f0=['update','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x92f0,0xa0));var _0x092f=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0x92f0[_0x303862];return _0xe6f228;};'use strict';var OpenchannelQueueEvents=require(_0x092f('0x0'));var events=[_0x092f('0x1'),'remove',_0x092f('0x2')];function createListener(_0x24e38e,_0x30a940){return function(_0x33658e){_0x30a940['emit'](_0x24e38e,_0x33658e);};}function removeListener(_0x41eb39,_0x534716){return function(){OpenchannelQueueEvents['removeListener'](_0x41eb39,_0x534716);};}exports[_0x092f('0x3')]=function(_0x181a89){for(var _0x39e68d=0x0,_0x581903=events[_0x092f('0x4')];_0x39e68d<_0x581903;_0x39e68d++){var _0x4ba224=events[_0x39e68d];var _0x2439c7=createListener(_0x092f('0x5')+_0x4ba224,_0x181a89);OpenchannelQueueEvents['on'](_0x4ba224,_0x2439c7);}};
\ No newline at end of file
+var _0x340c=['remove','update','emit','removeListener','register','length','./openchannelQueue.events','save'];(function(_0x258926,_0x5c185a){var _0x21d5dd=function(_0x1fa92d){while(--_0x1fa92d){_0x258926['push'](_0x258926['shift']());}};_0x21d5dd(++_0x5c185a);}(_0x340c,0x116));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require(_0xc340('0x0'));var events=[_0xc340('0x1'),_0xc340('0x2'),_0xc340('0x3')];function createListener(_0x1ada51,_0x557825){return function(_0x14b8bd){_0x557825[_0xc340('0x4')](_0x1ada51,_0x14b8bd);};}function removeListener(_0x2540b2,_0x2291ab){return function(){OpenchannelQueueEvents[_0xc340('0x5')](_0x2540b2,_0x2291ab);};}exports[_0xc340('0x6')]=function(_0x42b29d){for(var _0x1d6f9d=0x0,_0x2c82c6=events[_0xc340('0x7')];_0x1d6f9d<_0x2c82c6;_0x1d6f9d++){var _0xcb67b6=events[_0x1d6f9d];var _0x14f372=createListener('openchannelQueue:'+_0xcb67b6,_0x42b29d);OpenchannelQueueEvents['on'](_0xcb67b6,_0x14f372);}};
\ No newline at end of file
index 5a4bee9..e641fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55eb=['/:id','post','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','/describe'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x55eb,0x1e7));var _0xb55e=function(_0xf934e8,_0xb44eb8){_0xf934e8=_0xf934e8-0x0;var _0x3f3705=_0x55eb[_0xf934e8];return _0x3f3705;};'use strict';var multer=require(_0xb55e('0x0'));var util=require(_0xb55e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb55e('0x2'));var router=express[_0xb55e('0x3')]();var fs_extra=require(_0xb55e('0x4'));var auth=require(_0xb55e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb55e('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0xb55e('0x7')](),controller['index']);router['get'](_0xb55e('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb55e('0x9'),auth[_0xb55e('0x7')](),controller['show']);router[_0xb55e('0xa')]('/',auth[_0xb55e('0x7')](),controller[_0xb55e('0xb')]);router[_0xb55e('0xc')](_0xb55e('0x9'),auth[_0xb55e('0x7')](),controller[_0xb55e('0xd')]);router[_0xb55e('0xe')](_0xb55e('0x9'),auth[_0xb55e('0x7')](),controller['destroy']);module[_0xb55e('0xf')]=router;
\ No newline at end of file
+var _0x540f=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x540f,0x190));var _0xf540=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x540f[_0x42bc91];return _0x3f5507;};'use strict';var multer=require('multer');var util=require(_0xf540('0x0'));var path=require(_0xf540('0x1'));var timeout=require(_0xf540('0x2'));var express=require(_0xf540('0x3'));var router=express[_0xf540('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf540('0x5'));var config=require(_0xf540('0x6'));var controller=require(_0xf540('0x7'));router[_0xf540('0x8')]('/',auth[_0xf540('0x9')](),controller[_0xf540('0xa')]);router[_0xf540('0x8')](_0xf540('0xb'),auth['isAuthenticated'](),controller[_0xf540('0xc')]);router['get'](_0xf540('0xd'),auth[_0xf540('0x9')](),controller[_0xf540('0xe')]);router[_0xf540('0xf')]('/',auth[_0xf540('0x9')](),controller[_0xf540('0x10')]);router['put']('/:id',auth[_0xf540('0x9')](),controller[_0xf540('0x11')]);router[_0xf540('0x12')](_0xf540('0xd'),auth[_0xf540('0x9')](),controller[_0xf540('0x13')]);module['exports']=router;
\ No newline at end of file
index a485917..cd147da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e58=['sequelize','exports','STRING','DATE'];(function(_0x19e0eb,_0x4414a2){var _0x30c528=function(_0x3956c0){while(--_0x3956c0){_0x19e0eb['push'](_0x19e0eb['shift']());}};_0x30c528(++_0x4414a2);}(_0x9e58,0xec));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x89e5('0x0'));module[_0x89e5('0x1')]={'uniqueid':{'type':Sequelize[_0x89e5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x89e5('0x2')]},'joinAt':{'type':Sequelize[_0x89e5('0x3')]},'leaveAt':{'type':Sequelize[_0x89e5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x89e5('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6e12=['moment','sequelize','exports','STRING','DATE'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x6e12,0x154));var _0x26e1=function(_0xb1f3d6,_0x50949f){_0xb1f3d6=_0xb1f3d6-0x0;var _0x8d7926=_0x6e12[_0xb1f3d6];return _0x8d7926;};'use strict';var moment=require(_0x26e1('0x0'));var Sequelize=require(_0x26e1('0x1'));module[_0x26e1('0x2')]={'uniqueid':{'type':Sequelize[_0x26e1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x26e1('0x4')]},'leaveAt':{'type':Sequelize[_0x26e1('0x4')]},'acceptAt':{'type':Sequelize[_0x26e1('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0bc1d80..7d8e039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8c1=['order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8c1,0x128));var _0x1e8c=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0xe8c1[_0x507965];return _0x3608fc;};'use strict';var emlformat=require(_0x1e8c('0x0'));var rimraf=require(_0x1e8c('0x1'));var zipdir=require(_0x1e8c('0x2'));var jsonpatch=require(_0x1e8c('0x3'));var rp=require(_0x1e8c('0x4'));var moment=require(_0x1e8c('0x5'));var BPromise=require(_0x1e8c('0x6'));var Mustache=require(_0x1e8c('0x7'));var util=require(_0x1e8c('0x8'));var path=require(_0x1e8c('0x9'));var sox=require(_0x1e8c('0xa'));var csv=require('to-csv');var ejs=require(_0x1e8c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e8c('0xc'));var jsforce=require(_0x1e8c('0xd'));var deskjs=require(_0x1e8c('0xe'));var toCsv=require(_0x1e8c('0xf'));var querystring=require(_0x1e8c('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e8c('0x11'));var authService=require(_0x1e8c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1e8c('0x13'));var hardwareService=require(_0x1e8c('0x14'));var logger=require('../../config/logger')(_0x1e8c('0x15'));var utils=require(_0x1e8c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1e8c('0x17'))['db'];function respondWithStatusCode(_0x4da5c6,_0x5aedc4){_0x5aedc4=_0x5aedc4||0xcc;return function(_0x1fd7af){if(_0x1fd7af){return _0x4da5c6[_0x1e8c('0x18')](_0x5aedc4);}return _0x4da5c6[_0x1e8c('0x19')](_0x5aedc4)['end']();};}function respondWithResult(_0x407181,_0x534555){_0x534555=_0x534555||0xc8;return function(_0x439f80){if(_0x439f80){return _0x407181[_0x1e8c('0x19')](_0x534555)[_0x1e8c('0x1a')](_0x439f80);}};}function respondWithFilteredResult(_0x1dffed,_0x1771bb){return function(_0x5bbf31){if(_0x5bbf31){var _0x114c0c=typeof _0x1771bb['offset']===_0x1e8c('0x1b')&&typeof _0x1771bb[_0x1e8c('0x1c')]===_0x1e8c('0x1b');var _0x37f9a0=_0x5bbf31[_0x1e8c('0x1d')];var _0x1d4050=_0x114c0c?0x0:_0x1771bb['offset'];var _0x4eb296=_0x114c0c?_0x5bbf31[_0x1e8c('0x1d')]:_0x1771bb[_0x1e8c('0x1e')]+_0x1771bb['limit'];var _0x2eb335;if(_0x4eb296>=_0x37f9a0){_0x4eb296=_0x37f9a0;_0x2eb335=0xc8;}else{_0x2eb335=0xce;}_0x1dffed[_0x1e8c('0x19')](_0x2eb335);return _0x1dffed[_0x1e8c('0x1f')](_0x1e8c('0x20'),_0x1d4050+'-'+_0x4eb296+'/'+_0x37f9a0)[_0x1e8c('0x1a')](_0x5bbf31);}return null;};}function patchUpdates(_0xfe2c55){return function(_0x3ba70b){try{jsonpatch[_0x1e8c('0x21')](_0x3ba70b,_0xfe2c55,!![]);}catch(_0xc93e3c){return BPromise['reject'](_0xc93e3c);}return _0x3ba70b[_0x1e8c('0x22')]();};}function saveUpdates(_0x360d68,_0x391ed0){return function(_0x266e60){if(_0x266e60){return _0x266e60[_0x1e8c('0x23')](_0x360d68)[_0x1e8c('0x24')](function(_0x4e7074){return _0x4e7074;});}return null;};}function removeEntity(_0x113041,_0x22ee02){return function(_0x31780f){if(_0x31780f){return _0x31780f[_0x1e8c('0x25')]()[_0x1e8c('0x24')](function(){_0x113041[_0x1e8c('0x19')](0xcc)[_0x1e8c('0x26')]();});}};}function handleEntityNotFound(_0x46de0e,_0x225322){return function(_0x17e321){if(!_0x17e321){_0x46de0e[_0x1e8c('0x18')](0x194);}return _0x17e321;};}function handleError(_0x30ba1c,_0x1d3ba3){_0x1d3ba3=_0x1d3ba3||0x1f4;return function(_0xa58fc2){logger['error'](_0xa58fc2[_0x1e8c('0x27')]);if(_0xa58fc2[_0x1e8c('0x28')]){delete _0xa58fc2['name'];}_0x30ba1c['status'](_0x1d3ba3)['send'](_0xa58fc2);};}exports['index']=function(_0x8da3b7,_0x532e98){var _0xeee47f={},_0x13ec74={},_0x2e3bee={'count':0x0,'rows':[]};var _0x1bf9c5=_[_0x1e8c('0x29')](db[_0x1e8c('0x2a')][_0x1e8c('0x2b')],function(_0x29e1de){return{'name':_0x29e1de[_0x1e8c('0x2c')],'type':_0x29e1de[_0x1e8c('0x2d')]['key']};});_0x13ec74[_0x1e8c('0x2e')]=_[_0x1e8c('0x29')](_0x1bf9c5,_0x1e8c('0x28'));_0x13ec74[_0x1e8c('0x2f')]=_[_0x1e8c('0x30')](_0x8da3b7[_0x1e8c('0x2f')]);_0x13ec74['filters']=_[_0x1e8c('0x31')](_0x13ec74[_0x1e8c('0x2e')],_0x13ec74['query']);_0xeee47f[_0x1e8c('0x32')]=_[_0x1e8c('0x31')](_0x13ec74[_0x1e8c('0x2e')],qs['fields'](_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x33')]));_0xeee47f[_0x1e8c('0x32')]=_0xeee47f[_0x1e8c('0x32')][_0x1e8c('0x34')]?_0xeee47f[_0x1e8c('0x32')]:_0x13ec74[_0x1e8c('0x2e')];if(!_0x8da3b7['query']['hasOwnProperty'](_0x1e8c('0x35'))){_0xeee47f[_0x1e8c('0x1c')]=qs[_0x1e8c('0x1c')](_0x8da3b7[_0x1e8c('0x2f')]['limit']);_0xeee47f['offset']=qs[_0x1e8c('0x1e')](_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x1e')]);}_0xeee47f[_0x1e8c('0x36')]=qs[_0x1e8c('0x37')](_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x37')]);_0xeee47f[_0x1e8c('0x38')]=qs[_0x1e8c('0x39')](_['pick'](_0x8da3b7[_0x1e8c('0x2f')],_0x13ec74[_0x1e8c('0x39')]),_0x1bf9c5);if(_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x3a')]){_0xeee47f[_0x1e8c('0x38')]=_[_0x1e8c('0x3b')](_0xeee47f[_0x1e8c('0x38')],{'$or':_[_0x1e8c('0x29')](_0x1bf9c5,function(_0x1fdc62){if(_0x1fdc62[_0x1e8c('0x2d')]!==_0x1e8c('0x3c')){var _0x18602d={};_0x18602d[_0x1fdc62['name']]={'$like':'%'+_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x3a')]+'%'};return _0x18602d;}})});}_0xeee47f=_[_0x1e8c('0x3b')]({},_0xeee47f,_0x8da3b7[_0x1e8c('0x3d')]);var _0x2e32ac={'where':_0xeee47f[_0x1e8c('0x38')]};return db[_0x1e8c('0x2a')][_0x1e8c('0x1d')](_0x2e32ac)[_0x1e8c('0x24')](function(_0x59cd0d){_0x2e3bee[_0x1e8c('0x1d')]=_0x59cd0d;if(_0x8da3b7[_0x1e8c('0x2f')][_0x1e8c('0x3e')]){_0xeee47f[_0x1e8c('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0xeee47f);})['then'](function(_0x6702c8){_0x2e3bee[_0x1e8c('0x40')]=_0x6702c8;return _0x2e3bee;})['then'](respondWithFilteredResult(_0x532e98,_0xeee47f))[_0x1e8c('0x41')](handleError(_0x532e98,null));};exports[_0x1e8c('0x42')]=function(_0x42076a,_0x21180b){var _0x2ddac1={'raw':!![],'where':{'id':_0x42076a['params']['id']}},_0x7d4cda={};_0x7d4cda[_0x1e8c('0x2e')]=_[_0x1e8c('0x30')](db['OpenchannelQueueReport'][_0x1e8c('0x2b')]);_0x7d4cda[_0x1e8c('0x2f')]=_[_0x1e8c('0x30')](_0x42076a[_0x1e8c('0x2f')]);_0x7d4cda[_0x1e8c('0x39')]=_[_0x1e8c('0x31')](_0x7d4cda[_0x1e8c('0x2e')],_0x7d4cda[_0x1e8c('0x2f')]);_0x2ddac1[_0x1e8c('0x32')]=_['intersection'](_0x7d4cda['model'],qs['fields'](_0x42076a[_0x1e8c('0x2f')][_0x1e8c('0x33')]));_0x2ddac1[_0x1e8c('0x32')]=_0x2ddac1[_0x1e8c('0x32')][_0x1e8c('0x34')]?_0x2ddac1[_0x1e8c('0x32')]:_0x7d4cda['model'];if(_0x42076a[_0x1e8c('0x2f')][_0x1e8c('0x3e')]){_0x2ddac1[_0x1e8c('0x3f')]=[{'all':!![]}];}_0x2ddac1=_[_0x1e8c('0x3b')]({},_0x2ddac1,_0x42076a[_0x1e8c('0x3d')]);return db[_0x1e8c('0x2a')][_0x1e8c('0x43')](_0x2ddac1)[_0x1e8c('0x24')](handleEntityNotFound(_0x21180b,null))[_0x1e8c('0x24')](respondWithResult(_0x21180b,null))[_0x1e8c('0x41')](handleError(_0x21180b,null));};exports['create']=function(_0x300a58,_0x3a26aa){return db[_0x1e8c('0x2a')]['create'](_0x300a58[_0x1e8c('0x44')],{})[_0x1e8c('0x24')](respondWithResult(_0x3a26aa,0xc9))['catch'](handleError(_0x3a26aa,null));};exports[_0x1e8c('0x23')]=function(_0x1d790b,_0x3bed91){if(_0x1d790b['body']['id']){delete _0x1d790b['body']['id'];}return db['OpenchannelQueueReport'][_0x1e8c('0x43')]({'where':{'id':_0x1d790b['params']['id']}})[_0x1e8c('0x24')](handleEntityNotFound(_0x3bed91,null))['then'](saveUpdates(_0x1d790b[_0x1e8c('0x44')],null))[_0x1e8c('0x24')](respondWithResult(_0x3bed91,null))[_0x1e8c('0x41')](handleError(_0x3bed91,null));};exports[_0x1e8c('0x25')]=function(_0x56a578,_0x5f3dc0){return db[_0x1e8c('0x2a')][_0x1e8c('0x43')]({'where':{'id':_0x56a578['params']['id']}})[_0x1e8c('0x24')](handleEntityNotFound(_0x5f3dc0,null))['then'](removeEntity(_0x5f3dc0,null))[_0x1e8c('0x41')](handleError(_0x5f3dc0,null));};exports[_0x1e8c('0x45')]=function(_0x9f7aed,_0x7eec){return db[_0x1e8c('0x2a')][_0x1e8c('0x45')]()[_0x1e8c('0x24')](respondWithResult(_0x7eec,null))['catch'](handleError(_0x7eec,null));};
\ No newline at end of file
+var _0x79d1=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','fieldName','type','key','model','query','keys'];(function(_0x25f486,_0xd02cf5){var _0x4ad0d3=function(_0x292a4d){while(--_0x292a4d){_0x25f486['push'](_0x25f486['shift']());}};_0x4ad0d3(++_0xd02cf5);}(_0x79d1,0x1a0));var _0x179d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x79d1[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x179d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x179d('0x1'));var jsonpatch=require(_0x179d('0x2'));var rp=require(_0x179d('0x3'));var moment=require(_0x179d('0x4'));var BPromise=require(_0x179d('0x5'));var Mustache=require(_0x179d('0x6'));var util=require(_0x179d('0x7'));var path=require(_0x179d('0x8'));var sox=require(_0x179d('0x9'));var csv=require(_0x179d('0xa'));var ejs=require(_0x179d('0xb'));var fs=require('fs');var fs_extra=require(_0x179d('0xc'));var _=require(_0x179d('0xd'));var squel=require(_0x179d('0xe'));var crypto=require(_0x179d('0xf'));var jsforce=require(_0x179d('0x10'));var deskjs=require(_0x179d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x179d('0x12'));var authService=require(_0x179d('0x13'));var qs=require(_0x179d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x179d('0x15'))(_0x179d('0x16'));var utils=require('../../config/utils');var config=require(_0x179d('0x17'));var licenseUtil=require(_0x179d('0x18'));var db=require(_0x179d('0x19'))['db'];function respondWithStatusCode(_0x2ad44c,_0x134d6a){_0x134d6a=_0x134d6a||0xcc;return function(_0x346baf){if(_0x346baf){return _0x2ad44c[_0x179d('0x1a')](_0x134d6a);}return _0x2ad44c[_0x179d('0x1b')](_0x134d6a)[_0x179d('0x1c')]();};}function respondWithResult(_0xeed635,_0x2bcc54){_0x2bcc54=_0x2bcc54||0xc8;return function(_0x43255b){if(_0x43255b){return _0xeed635[_0x179d('0x1b')](_0x2bcc54)[_0x179d('0x1d')](_0x43255b);}};}function respondWithFilteredResult(_0x360443,_0x339f51){return function(_0x5eeced){if(_0x5eeced){var _0x4e8cd3=typeof _0x339f51[_0x179d('0x1e')]===_0x179d('0x1f')&&typeof _0x339f51[_0x179d('0x20')]===_0x179d('0x1f');var _0xfe76d3=_0x5eeced[_0x179d('0x21')];var _0x4b52b4=_0x4e8cd3?0x0:_0x339f51[_0x179d('0x1e')];var _0x3f667b=_0x4e8cd3?_0x5eeced[_0x179d('0x21')]:_0x339f51[_0x179d('0x1e')]+_0x339f51[_0x179d('0x20')];var _0x5ee889;if(_0x3f667b>=_0xfe76d3){_0x3f667b=_0xfe76d3;_0x5ee889=0xc8;}else{_0x5ee889=0xce;}_0x360443[_0x179d('0x1b')](_0x5ee889);return _0x360443[_0x179d('0x22')](_0x179d('0x23'),_0x4b52b4+'-'+_0x3f667b+'/'+_0xfe76d3)['json'](_0x5eeced);}return null;};}function patchUpdates(_0x14c1c7){return function(_0x47fd88){try{jsonpatch[_0x179d('0x24')](_0x47fd88,_0x14c1c7,!![]);}catch(_0x1f55cd){return BPromise[_0x179d('0x25')](_0x1f55cd);}return _0x47fd88[_0x179d('0x26')]();};}function saveUpdates(_0x418041,_0x389a7f){return function(_0x2b63a0){if(_0x2b63a0){return _0x2b63a0[_0x179d('0x27')](_0x418041)['then'](function(_0x36be44){return _0x36be44;});}return null;};}function removeEntity(_0x26de0a,_0x1e3b1e){return function(_0x4571d3){if(_0x4571d3){return _0x4571d3[_0x179d('0x28')]()[_0x179d('0x29')](function(){_0x26de0a[_0x179d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x487eda,_0x3ebbfd){return function(_0xd69623){if(!_0xd69623){_0x487eda['sendStatus'](0x194);}return _0xd69623;};}function handleError(_0x2e8c17,_0x391cdf){_0x391cdf=_0x391cdf||0x1f4;return function(_0x204f20){logger[_0x179d('0x2a')](_0x204f20['stack']);if(_0x204f20['name']){delete _0x204f20[_0x179d('0x2b')];}_0x2e8c17[_0x179d('0x1b')](_0x391cdf)[_0x179d('0x2c')](_0x204f20);};}exports['index']=function(_0x258298,_0x2abc8a){var _0x124523={},_0x25f973={},_0x3bf42c={'count':0x0,'rows':[]};var _0x1690de=_[_0x179d('0x2d')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x367441){return{'name':_0x367441[_0x179d('0x2e')],'type':_0x367441[_0x179d('0x2f')][_0x179d('0x30')]};});_0x25f973[_0x179d('0x31')]=_[_0x179d('0x2d')](_0x1690de,_0x179d('0x2b'));_0x25f973[_0x179d('0x32')]=_[_0x179d('0x33')](_0x258298[_0x179d('0x32')]);_0x25f973[_0x179d('0x34')]=_['intersection'](_0x25f973[_0x179d('0x31')],_0x25f973[_0x179d('0x32')]);_0x124523[_0x179d('0x35')]=_[_0x179d('0x36')](_0x25f973[_0x179d('0x31')],qs[_0x179d('0x37')](_0x258298[_0x179d('0x32')][_0x179d('0x37')]));_0x124523[_0x179d('0x35')]=_0x124523[_0x179d('0x35')][_0x179d('0x38')]?_0x124523['attributes']:_0x25f973[_0x179d('0x31')];if(!_0x258298[_0x179d('0x32')][_0x179d('0x39')](_0x179d('0x3a'))){_0x124523[_0x179d('0x20')]=qs[_0x179d('0x20')](_0x258298[_0x179d('0x32')]['limit']);_0x124523[_0x179d('0x1e')]=qs[_0x179d('0x1e')](_0x258298['query'][_0x179d('0x1e')]);}_0x124523[_0x179d('0x3b')]=qs[_0x179d('0x3c')](_0x258298['query'][_0x179d('0x3c')]);_0x124523[_0x179d('0x3d')]=qs[_0x179d('0x34')](_['pick'](_0x258298[_0x179d('0x32')],_0x25f973['filters']),_0x1690de);if(_0x258298['query']['filter']){_0x124523[_0x179d('0x3d')]=_[_0x179d('0x3e')](_0x124523[_0x179d('0x3d')],{'$or':_['map'](_0x1690de,function(_0x36e883){if(_0x36e883[_0x179d('0x2f')]!==_0x179d('0x3f')){var _0x310db1={};_0x310db1[_0x36e883[_0x179d('0x2b')]]={'$like':'%'+_0x258298[_0x179d('0x32')][_0x179d('0x40')]+'%'};return _0x310db1;}})});}_0x124523=_[_0x179d('0x3e')]({},_0x124523,_0x258298[_0x179d('0x41')]);var _0x2b3e50={'where':_0x124523[_0x179d('0x3d')]};return db[_0x179d('0x42')][_0x179d('0x21')](_0x2b3e50)['then'](function(_0x37e387){_0x3bf42c[_0x179d('0x21')]=_0x37e387;if(_0x258298[_0x179d('0x32')][_0x179d('0x43')]){_0x124523[_0x179d('0x44')]=[{'all':!![]}];}return db[_0x179d('0x42')]['findAll'](_0x124523);})['then'](function(_0x4d0de1){_0x3bf42c[_0x179d('0x45')]=_0x4d0de1;return _0x3bf42c;})['then'](respondWithFilteredResult(_0x2abc8a,_0x124523))[_0x179d('0x46')](handleError(_0x2abc8a,null));};exports[_0x179d('0x47')]=function(_0x26d884,_0x26cfb0){var _0x41bd58={'raw':!![],'where':{'id':_0x26d884[_0x179d('0x48')]['id']}},_0x5c0c7d={};_0x5c0c7d[_0x179d('0x31')]=_[_0x179d('0x33')](db[_0x179d('0x42')][_0x179d('0x49')]);_0x5c0c7d[_0x179d('0x32')]=_[_0x179d('0x33')](_0x26d884[_0x179d('0x32')]);_0x5c0c7d[_0x179d('0x34')]=_['intersection'](_0x5c0c7d['model'],_0x5c0c7d[_0x179d('0x32')]);_0x41bd58[_0x179d('0x35')]=_[_0x179d('0x36')](_0x5c0c7d[_0x179d('0x31')],qs[_0x179d('0x37')](_0x26d884[_0x179d('0x32')][_0x179d('0x37')]));_0x41bd58['attributes']=_0x41bd58['attributes'][_0x179d('0x38')]?_0x41bd58[_0x179d('0x35')]:_0x5c0c7d['model'];if(_0x26d884[_0x179d('0x32')][_0x179d('0x43')]){_0x41bd58['include']=[{'all':!![]}];}_0x41bd58=_[_0x179d('0x3e')]({},_0x41bd58,_0x26d884[_0x179d('0x41')]);return db[_0x179d('0x42')][_0x179d('0x4a')](_0x41bd58)[_0x179d('0x29')](handleEntityNotFound(_0x26cfb0,null))[_0x179d('0x29')](respondWithResult(_0x26cfb0,null))[_0x179d('0x46')](handleError(_0x26cfb0,null));};exports[_0x179d('0x4b')]=function(_0x16e5e9,_0x2f26fb){return db['OpenchannelQueueReport'][_0x179d('0x4b')](_0x16e5e9[_0x179d('0x4c')],{})[_0x179d('0x29')](respondWithResult(_0x2f26fb,0xc9))[_0x179d('0x46')](handleError(_0x2f26fb,null));};exports[_0x179d('0x27')]=function(_0x39aff9,_0x2e48d5){if(_0x39aff9[_0x179d('0x4c')]['id']){delete _0x39aff9[_0x179d('0x4c')]['id'];}return db[_0x179d('0x42')][_0x179d('0x4a')]({'where':{'id':_0x39aff9[_0x179d('0x48')]['id']}})[_0x179d('0x29')](handleEntityNotFound(_0x2e48d5,null))[_0x179d('0x29')](saveUpdates(_0x39aff9[_0x179d('0x4c')],null))[_0x179d('0x29')](respondWithResult(_0x2e48d5,null))[_0x179d('0x46')](handleError(_0x2e48d5,null));};exports[_0x179d('0x28')]=function(_0x3b3bc5,_0x5808e1){return db[_0x179d('0x42')][_0x179d('0x4a')]({'where':{'id':_0x3b3bc5[_0x179d('0x48')]['id']}})[_0x179d('0x29')](handleEntityNotFound(_0x5808e1,null))[_0x179d('0x29')](removeEntity(_0x5808e1,null))[_0x179d('0x46')](handleError(_0x5808e1,null));};exports[_0x179d('0x4d')]=function(_0x5ac896,_0x134321){return db[_0x179d('0x42')][_0x179d('0x4d')]()['then'](respondWithResult(_0x134321,null))[_0x179d('0x46')](handleError(_0x134321,null));};
\ No newline at end of file
index 6e7bbb9..5e3a1c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x4fa484,_0x1718c4){var _0xc3c83f=function(_0x3f0bcb){while(--_0x3f0bcb){_0x4fa484['push'](_0x4fa484['shift']());}};_0xc3c83f(++_0x1718c4);}(_0x2ef3,0xba));var _0x32ef=function(_0x61cea6,_0x134e60){_0x61cea6=_0x61cea6-0x0;var _0x5d3fb2=_0x2ef3[_0x61cea6];return _0x5d3fb2;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x312d8d,_0x2ba859){var _0x179d81=function(_0x376c7b){while(--_0x376c7b){_0x312d8d['push'](_0x312d8d['shift']());}};_0x179d81(++_0x2ba859);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x5fc3[_0x54b283];return _0x2462b3;};'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
index 9cc64a7..8509bc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2884=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','attributes','limit','lodash','moment'];(function(_0x1146b0,_0x5ff33){var _0x5f5a21=function(_0x59d3a9){while(--_0x59d3a9){_0x1146b0['push'](_0x1146b0['shift']());}};_0x5f5a21(++_0x5ff33);}(_0x2884,0x1eb));var _0x4288=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0x2884[_0x2f16e5];return _0x5d082a;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});}exports[_0x4288('0x15')]=function(_0x53fb81){var _0x199919=this;return new Promise(function(_0xde03f4,_0x5e6de1){return db['OpenchannelQueueReport']['create'](_0x53fb81[_0x4288('0x16')],{'raw':_0x53fb81[_0x4288('0x17')]?_0x53fb81['options'][_0x4288('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x865365){logger[_0x4288('0xa')](_0x4288('0x15'),_0x53fb81);logger['debug'](_0x4288('0x15'),_0x53fb81,JSON[_0x4288('0xe')](_0x865365));_0xde03f4(_0x865365);})[_0x4288('0x14')](function(_0x4b9cda){logger['error'](_0x4288('0x15'),_0x4b9cda[_0x4288('0x12')],_0x53fb81);_0x5e6de1(_0x199919[_0x4288('0xf')](0x1f4,_0x4b9cda[_0x4288('0x12')]));});});};exports[_0x4288('0x19')]=function(_0x292e74){var _0x500c1e=this;return new Promise(function(_0x5f0c29,_0x1ff415){return db[_0x4288('0x1a')]['update'](_0x292e74[_0x4288('0x16')],{'raw':_0x292e74['options']?_0x292e74['options'][_0x4288('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')]['where']||null:null,'attributes':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1b')]||null:null,'limit':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1c')]||null:null})['then'](function(_0x3a8e3e){logger[_0x4288('0xa')](_0x4288('0x19'),_0x292e74);logger[_0x4288('0xb')](_0x4288('0x19'),_0x292e74,JSON[_0x4288('0xe')](_0x3a8e3e));_0x5f0c29(_0x3a8e3e);})[_0x4288('0x14')](function(_0x5bca41){logger[_0x4288('0xf')](_0x4288('0x19'),_0x5bca41[_0x4288('0x12')],_0x292e74);_0x1ff415(_0x500c1e[_0x4288('0xf')](0x1f4,_0x5bca41[_0x4288('0x12')]));});});};
\ No newline at end of file
+var _0x32b6=['stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent'];(function(_0x4c1bc3,_0x428439){var _0x363296=function(_0x5f260c){while(--_0x5f260c){_0x4c1bc3['push'](_0x4c1bc3['shift']());}};_0x363296(++_0x428439);}(_0x32b6,0x1d1));var _0x632b=function(_0x40bbe1,_0x20bac7){_0x40bbe1=_0x40bbe1-0x0;var _0x499994=_0x32b6[_0x40bbe1];return _0x499994;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x116f62){logger['info']('CreateOpenchannelQueueReport',_0x3bb27f);logger[_0x632b('0xd')]('CreateOpenchannelQueueReport',_0x3bb27f,JSON[_0x632b('0xf')](_0x116f62));_0x51c894(_0x116f62);})[_0x632b('0x1b')](function(_0x2a6833){logger['error'](_0x632b('0x15'),_0x2a6833[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472['error'](0x1f4,_0x2a6833[_0x632b('0x13')]));});});};exports[_0x632b('0x1c')]=function(_0x30ffb9){var _0x1e448c=this;return new Promise(function(_0x45d017,_0x183c5c){return db['OpenchannelQueueReport']['update'](_0x30ffb9[_0x632b('0x18')],{'raw':_0x30ffb9['options']?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30ffb9['options']?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1d')]||null:null,'attributes':_0x30ffb9[_0x632b('0x19')]?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1e')]||null:null,'limit':_0x30ffb9[_0x632b('0x19')]?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1f')]||null:null})[_0x632b('0xc')](function(_0x4f8410){logger[_0x632b('0x14')](_0x632b('0x1c'),_0x30ffb9);logger[_0x632b('0xd')](_0x632b('0x1c'),_0x30ffb9,JSON[_0x632b('0xf')](_0x4f8410));_0x45d017(_0x4f8410);})[_0x632b('0x1b')](function(_0x3c5dc9){logger[_0x632b('0x10')](_0x632b('0x1c'),_0x3c5dc9[_0x632b('0x13')],_0x30ffb9);_0x183c5c(_0x1e448c[_0x632b('0x10')](0x1f4,_0x3c5dc9[_0x632b('0x13')]));});});};
\ No newline at end of file
index 0eb05b7..50ad4ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x272f=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0xcea17,_0xb2db78){var _0x139b25=function(_0x1dec08){while(--_0x1dec08){_0xcea17['push'](_0xcea17['shift']());}};_0x139b25(++_0xb2db78);}(_0x272f,0xde));var _0xf272=function(_0x59440e,_0x1c2ded){_0x59440e=_0x59440e-0x0;var _0x3d639f=_0x272f[_0x59440e];return _0x3d639f;};'use strict';var multer=require(_0xf272('0x0'));var util=require(_0xf272('0x1'));var path=require(_0xf272('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf272('0x3')]();var fs_extra=require(_0xf272('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf272('0x5'));var config=require(_0xf272('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0xf272('0x7')]('/',auth[_0xf272('0x8')](),controller[_0xf272('0x9')]);router[_0xf272('0x7')]('/describe',auth[_0xf272('0x8')](),controller[_0xf272('0xa')]);router[_0xf272('0x7')](_0xf272('0xb'),auth[_0xf272('0x8')](),controller[_0xf272('0xc')]);router[_0xf272('0xd')]('/',auth['isAuthenticated'](),controller[_0xf272('0xe')]);router[_0xf272('0xf')](_0xf272('0xb'),auth[_0xf272('0x8')](),controller['update']);router[_0xf272('0x10')](_0xf272('0xb'),auth[_0xf272('0x8')](),controller[_0xf272('0x11')]);module[_0xf272('0x12')]=router;
\ No newline at end of file
+var _0x6dc9=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy'];(function(_0x5c0abb,_0x48a252){var _0x3ad581=function(_0x2d1aae){while(--_0x2d1aae){_0x5c0abb['push'](_0x5c0abb['shift']());}};_0x3ad581(++_0x48a252);}(_0x6dc9,0x1a5));var _0x96dc=function(_0x1690a3,_0x11b6c4){_0x1690a3=_0x1690a3-0x0;var _0x3d64f6=_0x6dc9[_0x1690a3];return _0x3d64f6;};'use strict';var multer=require(_0x96dc('0x0'));var util=require(_0x96dc('0x1'));var path=require(_0x96dc('0x2'));var timeout=require(_0x96dc('0x3'));var express=require('express');var router=express[_0x96dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x96dc('0x5'));var interaction=require(_0x96dc('0x6'));var config=require(_0x96dc('0x7'));var controller=require(_0x96dc('0x8'));router[_0x96dc('0x9')]('/',auth[_0x96dc('0xa')](),controller[_0x96dc('0xb')]);router[_0x96dc('0x9')]('/describe',auth[_0x96dc('0xa')](),controller[_0x96dc('0xc')]);router[_0x96dc('0x9')](_0x96dc('0xd'),auth[_0x96dc('0xa')](),controller[_0x96dc('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x96dc('0xf')]);router['put'](_0x96dc('0xd'),auth[_0x96dc('0xa')](),controller[_0x96dc('0x10')]);router[_0x96dc('0x11')]('/:id',auth[_0x96dc('0xa')](),controller[_0x96dc('0x12')]);module[_0x96dc('0x13')]=router;
\ No newline at end of file
index 6d91416..431edc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3727ae,_0x165f88){var _0x1c3f01=function(_0x5cd5a5){while(--_0x5cd5a5){_0x3727ae['push'](_0x3727ae['shift']());}};_0x1c3f01(++_0x165f88);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x30755f,_0x59215e){var _0xec41a1=function(_0x45b479){while(--_0x45b479){_0x30755f['push'](_0x30755f['shift']());}};_0xec41a1(++_0x59215e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xcb91[_0x40927b];return _0x2635e8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index a058ac5..ff2a3e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e2=['rows','catch','params','merge','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','OpenchannelTransferReport','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x5398db,_0xd69970){var _0x7aeb65=function(_0x2536d4){while(--_0x2536d4){_0x5398db['push'](_0x5398db['shift']());}};_0x7aeb65(++_0xd69970);}(_0xf2e2,0x1cb));var _0x2f2e=function(_0x2e03fb,_0x139a94){_0x2e03fb=_0x2e03fb-0x0;var _0x5ee02e=_0xf2e2[_0x2e03fb];return _0x5ee02e;};'use strict';var emlformat=require(_0x2f2e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f2e('0x1'));var rp=require(_0x2f2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2f2e('0x3'));var path=require(_0x2f2e('0x4'));var sox=require(_0x2f2e('0x5'));var csv=require(_0x2f2e('0x6'));var ejs=require(_0x2f2e('0x7'));var fs=require('fs');var fs_extra=require(_0x2f2e('0x8'));var _=require('lodash');var squel=require(_0x2f2e('0x9'));var crypto=require(_0x2f2e('0xa'));var jsforce=require(_0x2f2e('0xb'));var deskjs=require(_0x2f2e('0xc'));var toCsv=require(_0x2f2e('0x6'));var querystring=require(_0x2f2e('0xd'));var Papa=require(_0x2f2e('0xe'));var Redis=require(_0x2f2e('0xf'));var authService=require(_0x2f2e('0x10'));var qs=require(_0x2f2e('0x11'));var as=require(_0x2f2e('0x12'));var hardwareService=require(_0x2f2e('0x13'));var logger=require(_0x2f2e('0x14'))(_0x2f2e('0x15'));var utils=require(_0x2f2e('0x16'));var config=require(_0x2f2e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f2e('0x18'))['db'];function respondWithStatusCode(_0x24082d,_0x40407b){_0x40407b=_0x40407b||0xcc;return function(_0x16d5c4){if(_0x16d5c4){return _0x24082d[_0x2f2e('0x19')](_0x40407b);}return _0x24082d[_0x2f2e('0x1a')](_0x40407b)[_0x2f2e('0x1b')]();};}function respondWithResult(_0x583620,_0xd95275){_0xd95275=_0xd95275||0xc8;return function(_0x345fb8){if(_0x345fb8){return _0x583620[_0x2f2e('0x1a')](_0xd95275)[_0x2f2e('0x1c')](_0x345fb8);}};}function respondWithFilteredResult(_0x5124a0,_0x2bfcc6){return function(_0x273c7f){if(_0x273c7f){var _0x58aa92=typeof _0x2bfcc6[_0x2f2e('0x1d')]==='undefined'&&typeof _0x2bfcc6[_0x2f2e('0x1e')]===_0x2f2e('0x1f');var _0x35e32a=_0x273c7f[_0x2f2e('0x20')];var _0x9f123e=_0x58aa92?0x0:_0x2bfcc6['offset'];var _0x134f9c=_0x58aa92?_0x273c7f['count']:_0x2bfcc6[_0x2f2e('0x1d')]+_0x2bfcc6[_0x2f2e('0x1e')];var _0x274ed8;if(_0x134f9c>=_0x35e32a){_0x134f9c=_0x35e32a;_0x274ed8=0xc8;}else{_0x274ed8=0xce;}_0x5124a0['status'](_0x274ed8);return _0x5124a0['set'](_0x2f2e('0x21'),_0x9f123e+'-'+_0x134f9c+'/'+_0x35e32a)[_0x2f2e('0x1c')](_0x273c7f);}return null;};}function patchUpdates(_0x3c9a51){return function(_0x2b38e2){try{jsonpatch[_0x2f2e('0x22')](_0x2b38e2,_0x3c9a51,!![]);}catch(_0x1baa28){return BPromise[_0x2f2e('0x23')](_0x1baa28);}return _0x2b38e2[_0x2f2e('0x24')]();};}function saveUpdates(_0x52f44e,_0x32eae8){return function(_0xf48413){if(_0xf48413){return _0xf48413[_0x2f2e('0x25')](_0x52f44e)[_0x2f2e('0x26')](function(_0x15e426){return _0x15e426;});}return null;};}function removeEntity(_0x381929,_0x4a54d5){return function(_0xd2c921){if(_0xd2c921){return _0xd2c921['destroy']()[_0x2f2e('0x26')](function(){_0x381929[_0x2f2e('0x1a')](0xcc)[_0x2f2e('0x1b')]();});}};}function handleEntityNotFound(_0x1502a9,_0x41906d){return function(_0x513cb7){if(!_0x513cb7){_0x1502a9[_0x2f2e('0x19')](0x194);}return _0x513cb7;};}function handleError(_0xc8f2a3,_0x2254c2){_0x2254c2=_0x2254c2||0x1f4;return function(_0x3a3515){logger[_0x2f2e('0x27')](_0x3a3515[_0x2f2e('0x28')]);if(_0x3a3515[_0x2f2e('0x29')]){delete _0x3a3515[_0x2f2e('0x29')];}_0xc8f2a3[_0x2f2e('0x1a')](_0x2254c2)[_0x2f2e('0x2a')](_0x3a3515);};}exports['index']=function(_0x1f924c,_0x1fc6e8){var _0x14e4fa={},_0x12d532={},_0x294709={'count':0x0,'rows':[]};var _0x5d3bc3=_['map'](db[_0x2f2e('0x2b')][_0x2f2e('0x2c')],function(_0x10925f){return{'name':_0x10925f['fieldName'],'type':_0x10925f['type'][_0x2f2e('0x2d')]};});_0x12d532['model']=_[_0x2f2e('0x2e')](_0x5d3bc3,'name');_0x12d532[_0x2f2e('0x2f')]=_[_0x2f2e('0x30')](_0x1f924c[_0x2f2e('0x2f')]);_0x12d532[_0x2f2e('0x31')]=_[_0x2f2e('0x32')](_0x12d532['model'],_0x12d532[_0x2f2e('0x2f')]);_0x14e4fa['attributes']=_[_0x2f2e('0x32')](_0x12d532[_0x2f2e('0x33')],qs[_0x2f2e('0x34')](_0x1f924c[_0x2f2e('0x2f')][_0x2f2e('0x34')]));_0x14e4fa[_0x2f2e('0x35')]=_0x14e4fa[_0x2f2e('0x35')][_0x2f2e('0x36')]?_0x14e4fa[_0x2f2e('0x35')]:_0x12d532[_0x2f2e('0x33')];if(!_0x1f924c[_0x2f2e('0x2f')]['hasOwnProperty'](_0x2f2e('0x37'))){_0x14e4fa[_0x2f2e('0x1e')]=qs[_0x2f2e('0x1e')](_0x1f924c[_0x2f2e('0x2f')][_0x2f2e('0x1e')]);_0x14e4fa[_0x2f2e('0x1d')]=qs[_0x2f2e('0x1d')](_0x1f924c['query'][_0x2f2e('0x1d')]);}_0x14e4fa[_0x2f2e('0x38')]=qs[_0x2f2e('0x39')](_0x1f924c[_0x2f2e('0x2f')]['sort']);_0x14e4fa[_0x2f2e('0x3a')]=qs['filters'](_['pick'](_0x1f924c['query'],_0x12d532[_0x2f2e('0x31')]),_0x5d3bc3);if(_0x1f924c[_0x2f2e('0x2f')][_0x2f2e('0x3b')]){_0x14e4fa[_0x2f2e('0x3a')]=_['merge'](_0x14e4fa[_0x2f2e('0x3a')],{'$or':_[_0x2f2e('0x2e')](_0x5d3bc3,function(_0x4bb986){if(_0x4bb986[_0x2f2e('0x3c')]!==_0x2f2e('0x3d')){var _0x2e6783={};_0x2e6783[_0x4bb986['name']]={'$like':'%'+_0x1f924c['query'][_0x2f2e('0x3b')]+'%'};return _0x2e6783;}})});}_0x14e4fa=_['merge']({},_0x14e4fa,_0x1f924c[_0x2f2e('0x3e')]);var _0x22b49d={'where':_0x14e4fa[_0x2f2e('0x3a')]};return db['OpenchannelTransferReport']['count'](_0x22b49d)[_0x2f2e('0x26')](function(_0x58cf75){_0x294709[_0x2f2e('0x20')]=_0x58cf75;if(_0x1f924c[_0x2f2e('0x2f')][_0x2f2e('0x3f')]){_0x14e4fa[_0x2f2e('0x40')]=[{'all':!![]}];}return db[_0x2f2e('0x2b')][_0x2f2e('0x41')](_0x14e4fa);})[_0x2f2e('0x26')](function(_0xaffb0d){_0x294709[_0x2f2e('0x42')]=_0xaffb0d;return _0x294709;})[_0x2f2e('0x26')](respondWithFilteredResult(_0x1fc6e8,_0x14e4fa))[_0x2f2e('0x43')](handleError(_0x1fc6e8,null));};exports['show']=function(_0x47f578,_0x572f72){var _0x398f69={'raw':!![],'where':{'id':_0x47f578[_0x2f2e('0x44')]['id']}},_0x5b5fa7={};_0x5b5fa7[_0x2f2e('0x33')]=_[_0x2f2e('0x30')](db['OpenchannelTransferReport'][_0x2f2e('0x2c')]);_0x5b5fa7['query']=_[_0x2f2e('0x30')](_0x47f578['query']);_0x5b5fa7['filters']=_[_0x2f2e('0x32')](_0x5b5fa7[_0x2f2e('0x33')],_0x5b5fa7[_0x2f2e('0x2f')]);_0x398f69['attributes']=_[_0x2f2e('0x32')](_0x5b5fa7['model'],qs[_0x2f2e('0x34')](_0x47f578[_0x2f2e('0x2f')][_0x2f2e('0x34')]));_0x398f69[_0x2f2e('0x35')]=_0x398f69['attributes']['length']?_0x398f69[_0x2f2e('0x35')]:_0x5b5fa7[_0x2f2e('0x33')];if(_0x47f578[_0x2f2e('0x2f')]['includeAll']){_0x398f69[_0x2f2e('0x40')]=[{'all':!![]}];}_0x398f69=_[_0x2f2e('0x45')]({},_0x398f69,_0x47f578[_0x2f2e('0x3e')]);return db['OpenchannelTransferReport'][_0x2f2e('0x46')](_0x398f69)['then'](handleEntityNotFound(_0x572f72,null))[_0x2f2e('0x26')](respondWithResult(_0x572f72,null))['catch'](handleError(_0x572f72,null));};exports['create']=function(_0x273bd8,_0x56de08){return db['OpenchannelTransferReport'][_0x2f2e('0x47')](_0x273bd8[_0x2f2e('0x48')],{})[_0x2f2e('0x26')](respondWithResult(_0x56de08,0xc9))[_0x2f2e('0x43')](handleError(_0x56de08,null));};exports['update']=function(_0x42cb87,_0x2f1916){if(_0x42cb87[_0x2f2e('0x48')]['id']){delete _0x42cb87[_0x2f2e('0x48')]['id'];}return db[_0x2f2e('0x2b')][_0x2f2e('0x46')]({'where':{'id':_0x42cb87[_0x2f2e('0x44')]['id']}})[_0x2f2e('0x26')](handleEntityNotFound(_0x2f1916,null))['then'](saveUpdates(_0x42cb87[_0x2f2e('0x48')],null))[_0x2f2e('0x26')](respondWithResult(_0x2f1916,null))[_0x2f2e('0x43')](handleError(_0x2f1916,null));};exports[_0x2f2e('0x49')]=function(_0x601cb0,_0x157834){return db[_0x2f2e('0x2b')]['find']({'where':{'id':_0x601cb0['params']['id']}})[_0x2f2e('0x26')](handleEntityNotFound(_0x157834,null))['then'](removeEntity(_0x157834,null))[_0x2f2e('0x43')](handleError(_0x157834,null));};exports[_0x2f2e('0x4a')]=function(_0x6e1867,_0x5b241c){return db['OpenchannelTransferReport'][_0x2f2e('0x4a')]()[_0x2f2e('0x26')](respondWithResult(_0x5b241c,null))[_0x2f2e('0x43')](handleError(_0x5b241c,null));};
\ No newline at end of file
+var _0x4db7=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','destroy','then','name','send','OpenchannelTransferReport','fieldName','type'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4db7,0x6c));var _0x74db=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4db7[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x74db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74db('0x1'));var rp=require(_0x74db('0x2'));var moment=require(_0x74db('0x3'));var BPromise=require(_0x74db('0x4'));var Mustache=require(_0x74db('0x5'));var util=require(_0x74db('0x6'));var path=require(_0x74db('0x7'));var sox=require(_0x74db('0x8'));var csv=require(_0x74db('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74db('0xa'));var _=require(_0x74db('0xb'));var squel=require('squel');var crypto=require(_0x74db('0xc'));var jsforce=require(_0x74db('0xd'));var deskjs=require(_0x74db('0xe'));var toCsv=require(_0x74db('0x9'));var querystring=require('querystring');var Papa=require(_0x74db('0xf'));var Redis=require(_0x74db('0x10'));var authService=require(_0x74db('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x74db('0x12'));var hardwareService=require(_0x74db('0x13'));var logger=require('../../config/logger')(_0x74db('0x14'));var utils=require(_0x74db('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x74db('0x16'));var db=require(_0x74db('0x17'))['db'];function respondWithStatusCode(_0x638266,_0x4c957d){_0x4c957d=_0x4c957d||0xcc;return function(_0x4ffe73){if(_0x4ffe73){return _0x638266[_0x74db('0x18')](_0x4c957d);}return _0x638266[_0x74db('0x19')](_0x4c957d)[_0x74db('0x1a')]();};}function respondWithResult(_0x5f7bac,_0x17845c){_0x17845c=_0x17845c||0xc8;return function(_0x538139){if(_0x538139){return _0x5f7bac[_0x74db('0x19')](_0x17845c)[_0x74db('0x1b')](_0x538139);}};}function respondWithFilteredResult(_0x28d5a9,_0x170a47){return function(_0xea63b3){if(_0xea63b3){var _0x2b6eef=typeof _0x170a47['offset']===_0x74db('0x1c')&&typeof _0x170a47[_0x74db('0x1d')]===_0x74db('0x1c');var _0x31a205=_0xea63b3[_0x74db('0x1e')];var _0x205487=_0x2b6eef?0x0:_0x170a47['offset'];var _0x3d8be8=_0x2b6eef?_0xea63b3['count']:_0x170a47['offset']+_0x170a47['limit'];var _0x3b4844;if(_0x3d8be8>=_0x31a205){_0x3d8be8=_0x31a205;_0x3b4844=0xc8;}else{_0x3b4844=0xce;}_0x28d5a9[_0x74db('0x19')](_0x3b4844);return _0x28d5a9[_0x74db('0x1f')]('Content-Range',_0x205487+'-'+_0x3d8be8+'/'+_0x31a205)[_0x74db('0x1b')](_0xea63b3);}return null;};}function patchUpdates(_0x28e4fd){return function(_0x3be832){try{jsonpatch['apply'](_0x3be832,_0x28e4fd,!![]);}catch(_0x1a1d68){return BPromise[_0x74db('0x20')](_0x1a1d68);}return _0x3be832[_0x74db('0x21')]();};}function saveUpdates(_0x141d58,_0x4e67d6){return function(_0x40cecf){if(_0x40cecf){return _0x40cecf[_0x74db('0x22')](_0x141d58)['then'](function(_0x54f565){return _0x54f565;});}return null;};}function removeEntity(_0x3c022e,_0x5eb48e){return function(_0x2d3c10){if(_0x2d3c10){return _0x2d3c10[_0x74db('0x23')]()[_0x74db('0x24')](function(){_0x3c022e[_0x74db('0x19')](0xcc)[_0x74db('0x1a')]();});}};}function handleEntityNotFound(_0x42b51d,_0x39918c){return function(_0x213f39){if(!_0x213f39){_0x42b51d[_0x74db('0x18')](0x194);}return _0x213f39;};}function handleError(_0x408891,_0xcd5efa){_0xcd5efa=_0xcd5efa||0x1f4;return function(_0x2ebf37){logger['error'](_0x2ebf37['stack']);if(_0x2ebf37[_0x74db('0x25')]){delete _0x2ebf37[_0x74db('0x25')];}_0x408891['status'](_0xcd5efa)[_0x74db('0x26')](_0x2ebf37);};}exports['index']=function(_0xd0eb84,_0x2d8cba){var _0x1f3341={},_0x100eea={},_0x13d466={'count':0x0,'rows':[]};var _0x553809=_['map'](db[_0x74db('0x27')]['rawAttributes'],function(_0x21dfb2){return{'name':_0x21dfb2[_0x74db('0x28')],'type':_0x21dfb2[_0x74db('0x29')][_0x74db('0x2a')]};});_0x100eea[_0x74db('0x2b')]=_['map'](_0x553809,_0x74db('0x25'));_0x100eea[_0x74db('0x2c')]=_['keys'](_0xd0eb84[_0x74db('0x2c')]);_0x100eea[_0x74db('0x2d')]=_[_0x74db('0x2e')](_0x100eea[_0x74db('0x2b')],_0x100eea[_0x74db('0x2c')]);_0x1f3341[_0x74db('0x2f')]=_[_0x74db('0x2e')](_0x100eea['model'],qs[_0x74db('0x30')](_0xd0eb84['query'][_0x74db('0x30')]));_0x1f3341[_0x74db('0x2f')]=_0x1f3341[_0x74db('0x2f')][_0x74db('0x31')]?_0x1f3341[_0x74db('0x2f')]:_0x100eea[_0x74db('0x2b')];if(!_0xd0eb84[_0x74db('0x2c')][_0x74db('0x32')](_0x74db('0x33'))){_0x1f3341['limit']=qs[_0x74db('0x1d')](_0xd0eb84[_0x74db('0x2c')][_0x74db('0x1d')]);_0x1f3341[_0x74db('0x34')]=qs['offset'](_0xd0eb84[_0x74db('0x2c')][_0x74db('0x34')]);}_0x1f3341[_0x74db('0x35')]=qs[_0x74db('0x36')](_0xd0eb84['query'][_0x74db('0x36')]);_0x1f3341[_0x74db('0x37')]=qs[_0x74db('0x2d')](_[_0x74db('0x38')](_0xd0eb84['query'],_0x100eea[_0x74db('0x2d')]),_0x553809);if(_0xd0eb84['query'][_0x74db('0x39')]){_0x1f3341[_0x74db('0x37')]=_[_0x74db('0x3a')](_0x1f3341[_0x74db('0x37')],{'$or':_[_0x74db('0x3b')](_0x553809,function(_0x525465){if(_0x525465[_0x74db('0x29')]!==_0x74db('0x3c')){var _0x45c94e={};_0x45c94e[_0x525465[_0x74db('0x25')]]={'$like':'%'+_0xd0eb84[_0x74db('0x2c')][_0x74db('0x39')]+'%'};return _0x45c94e;}})});}_0x1f3341=_[_0x74db('0x3a')]({},_0x1f3341,_0xd0eb84['options']);var _0x363635={'where':_0x1f3341[_0x74db('0x37')]};return db['OpenchannelTransferReport']['count'](_0x363635)[_0x74db('0x24')](function(_0x37bb7d){_0x13d466['count']=_0x37bb7d;if(_0xd0eb84[_0x74db('0x2c')][_0x74db('0x3d')]){_0x1f3341[_0x74db('0x3e')]=[{'all':!![]}];}return db[_0x74db('0x27')][_0x74db('0x3f')](_0x1f3341);})['then'](function(_0x4360b4){_0x13d466[_0x74db('0x40')]=_0x4360b4;return _0x13d466;})[_0x74db('0x24')](respondWithFilteredResult(_0x2d8cba,_0x1f3341))['catch'](handleError(_0x2d8cba,null));};exports[_0x74db('0x41')]=function(_0x2c7001,_0x26f588){var _0x39a7eb={'raw':!![],'where':{'id':_0x2c7001[_0x74db('0x42')]['id']}},_0x5a5db8={};_0x5a5db8['model']=_[_0x74db('0x43')](db['OpenchannelTransferReport'][_0x74db('0x44')]);_0x5a5db8[_0x74db('0x2c')]=_[_0x74db('0x43')](_0x2c7001[_0x74db('0x2c')]);_0x5a5db8[_0x74db('0x2d')]=_[_0x74db('0x2e')](_0x5a5db8[_0x74db('0x2b')],_0x5a5db8[_0x74db('0x2c')]);_0x39a7eb[_0x74db('0x2f')]=_[_0x74db('0x2e')](_0x5a5db8[_0x74db('0x2b')],qs[_0x74db('0x30')](_0x2c7001[_0x74db('0x2c')]['fields']));_0x39a7eb['attributes']=_0x39a7eb['attributes'][_0x74db('0x31')]?_0x39a7eb[_0x74db('0x2f')]:_0x5a5db8[_0x74db('0x2b')];if(_0x2c7001['query']['includeAll']){_0x39a7eb[_0x74db('0x3e')]=[{'all':!![]}];}_0x39a7eb=_[_0x74db('0x3a')]({},_0x39a7eb,_0x2c7001[_0x74db('0x45')]);return db[_0x74db('0x27')][_0x74db('0x46')](_0x39a7eb)['then'](handleEntityNotFound(_0x26f588,null))[_0x74db('0x24')](respondWithResult(_0x26f588,null))[_0x74db('0x47')](handleError(_0x26f588,null));};exports[_0x74db('0x48')]=function(_0x460c2e,_0x2c167e){return db[_0x74db('0x27')][_0x74db('0x48')](_0x460c2e[_0x74db('0x49')],{})[_0x74db('0x24')](respondWithResult(_0x2c167e,0xc9))[_0x74db('0x47')](handleError(_0x2c167e,null));};exports[_0x74db('0x22')]=function(_0x5589e0,_0x46a02a){if(_0x5589e0[_0x74db('0x49')]['id']){delete _0x5589e0[_0x74db('0x49')]['id'];}return db[_0x74db('0x27')][_0x74db('0x46')]({'where':{'id':_0x5589e0[_0x74db('0x42')]['id']}})['then'](handleEntityNotFound(_0x46a02a,null))[_0x74db('0x24')](saveUpdates(_0x5589e0[_0x74db('0x49')],null))[_0x74db('0x24')](respondWithResult(_0x46a02a,null))[_0x74db('0x47')](handleError(_0x46a02a,null));};exports[_0x74db('0x23')]=function(_0x19fa1f,_0x27e3fd){return db[_0x74db('0x27')][_0x74db('0x46')]({'where':{'id':_0x19fa1f['params']['id']}})[_0x74db('0x24')](handleEntityNotFound(_0x27e3fd,null))[_0x74db('0x24')](removeEntity(_0x27e3fd,null))[_0x74db('0x47')](handleError(_0x27e3fd,null));};exports[_0x74db('0x4a')]=function(_0x3124f4,_0x33b06d){return db[_0x74db('0x27')][_0x74db('0x4a')]()[_0x74db('0x24')](respondWithResult(_0x33b06d,null))[_0x74db('0x47')](handleError(_0x33b06d,null));};
\ No newline at end of file
index 8e6b396..a29dbb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa29c=['exports','define','report_openchannel_transfer','uniqueid','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x1beeb6,_0x34ec37){var _0x56066c=function(_0x2eae13){while(--_0x2eae13){_0x1beeb6['push'](_0x1beeb6['shift']());}};_0x56066c(++_0x34ec37);}(_0xa29c,0x199));var _0xca29=function(_0x331947,_0x30ad2e){_0x331947=_0x331947-0x0;var _0x9911b6=_0xa29c[_0x331947];return _0x9911b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca29('0x0'))(_0xca29('0x1'));var moment=require('moment');var BPromise=require(_0xca29('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca29('0x3'));var rimraf=require('rimraf');var config=require(_0xca29('0x4'));var attributes=require('./openchannelTransferReport.attributes');module[_0xca29('0x5')]=function(_0x607292,_0x290226){return _0x607292[_0xca29('0x6')]('OpenchannelTransferReport',attributes,{'tableName':_0xca29('0x7'),'paranoid':![],'indexes':[{'name':_0xca29('0x8'),'fields':[_0xca29('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3eb=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0x17e128,_0x257bbc){var _0x21a64a=function(_0x3944f7){while(--_0x3944f7){_0x17e128['push'](_0x17e128['shift']());}};_0x21a64a(++_0x257bbc);}(_0xc3eb,0x7e));var _0xbc3e=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xc3eb[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0xbc3e('0x0'));var util=require(_0xbc3e('0x1'));var logger=require(_0xbc3e('0x2'))('api');var moment=require(_0xbc3e('0x3'));var BPromise=require(_0xbc3e('0x4'));var rp=require(_0xbc3e('0x5'));var fs=require('fs');var path=require(_0xbc3e('0x6'));var rimraf=require(_0xbc3e('0x7'));var config=require(_0xbc3e('0x8'));var attributes=require(_0xbc3e('0x9'));module[_0xbc3e('0xa')]=function(_0x5178f3,_0x3c320d){return _0x5178f3[_0xbc3e('0xb')](_0xbc3e('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xbc3e('0xd'),'fields':[_0xbc3e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 910d910..2005a59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x102b=['error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','stringify'];(function(_0x1ac564,_0x20a4d1){var _0x5edc48=function(_0x3e4798){while(--_0x3e4798){_0x1ac564['push'](_0x1ac564['shift']());}};_0x5edc48(++_0x20a4d1);}(_0x102b,0x1be));var _0xb102=function(_0x9b69a2,_0x51386a){_0x9b69a2=_0x9b69a2-0x0;var _0x3a1ed1=_0x102b[_0x9b69a2];return _0x3a1ed1;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var moment=require('moment');var BPromise=require(_0xb102('0x1'));var rs=require(_0xb102('0x2'));var fs=require('fs');var Redis=require(_0xb102('0x3'));var db=require(_0xb102('0x4'))['db'];var utils=require(_0xb102('0x5'));var logger=require(_0xb102('0x6'))(_0xb102('0x7'));var config=require(_0xb102('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb102('0x9')][_0xb102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd131eb,_0x256052,_0x1ee0c0){return new BPromise(function(_0x5879bb,_0x338e0f){return client['request'](_0xd131eb,_0x1ee0c0)['then'](function(_0xee2164){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x256052,_0xb102('0xb'));logger[_0xb102('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x256052,_0xb102('0xb'),JSON[_0xb102('0xd')](_0xee2164));if(_0xee2164[_0xb102('0xe')]){if(_0xee2164[_0xb102('0xe')][_0xb102('0xf')]===0x1f4){logger[_0xb102('0xe')](_0xb102('0x10'),_0x256052,_0xee2164['error'][_0xb102('0x11')]);return _0x338e0f(_0xee2164['error'][_0xb102('0x11')]);}logger[_0xb102('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x256052,_0xee2164[_0xb102('0xe')][_0xb102('0x11')]);return _0x5879bb(_0xee2164['error'][_0xb102('0x11')]);}else{logger[_0xb102('0x12')](_0xb102('0x10'),_0x256052,'request\x20sent');_0x5879bb(_0xee2164['result']['message']);}})[_0xb102('0x13')](function(_0x7f3487){logger[_0xb102('0xe')](_0xb102('0x10'),_0x256052,_0x7f3487);_0x338e0f(_0x7f3487);});});}
\ No newline at end of file
+var _0x9829=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0xdacf27,_0x2edf99){var _0x2dd836=function(_0x7a6ab7){while(--_0x7a6ab7){_0xdacf27['push'](_0xdacf27['shift']());}};_0x2dd836(++_0x2edf99);}(_0x9829,0xc4));var _0x9982=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x9829[_0x4bd950];return _0x5dc59a;};'use strict';var _=require(_0x9982('0x0'));var util=require(_0x9982('0x1'));var moment=require(_0x9982('0x2'));var BPromise=require(_0x9982('0x3'));var rs=require(_0x9982('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9982('0x5'))['db'];var utils=require(_0x9982('0x6'));var logger=require(_0x9982('0x7'))('rpc');var config=require(_0x9982('0x8'));var jayson=require(_0x9982('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x340d62,_0x35a93f,_0x5d0824){return new BPromise(function(_0x25f30a,_0x1a3931){return client[_0x9982('0xa')](_0x340d62,_0x5d0824)[_0x9982('0xb')](function(_0x1e7881){logger[_0x9982('0xc')](_0x9982('0xd'),_0x35a93f,_0x9982('0xe'));logger[_0x9982('0xf')](_0x9982('0x10'),_0x35a93f,_0x9982('0xe'),JSON[_0x9982('0x11')](_0x1e7881));if(_0x1e7881[_0x9982('0x12')]){if(_0x1e7881[_0x9982('0x12')][_0x9982('0x13')]===0x1f4){logger[_0x9982('0x12')](_0x9982('0xd'),_0x35a93f,_0x1e7881[_0x9982('0x12')]['message']);return _0x1a3931(_0x1e7881[_0x9982('0x12')][_0x9982('0x14')]);}logger['error'](_0x9982('0xd'),_0x35a93f,_0x1e7881['error'][_0x9982('0x14')]);return _0x25f30a(_0x1e7881[_0x9982('0x12')][_0x9982('0x14')]);}else{logger[_0x9982('0xc')](_0x9982('0xd'),_0x35a93f,_0x9982('0xe'));_0x25f30a(_0x1e7881[_0x9982('0x15')][_0x9982('0x14')]);}})[_0x9982('0x16')](function(_0x50ca89){logger[_0x9982('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x35a93f,_0x50ca89);_0x1a3931(_0x50ca89);});});}
\ No newline at end of file
index aadbbdd..8613865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8103=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','destroy','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x53d198,_0x32c22b){var _0x753342=function(_0x207c8c){while(--_0x207c8c){_0x53d198['push'](_0x53d198['shift']());}};_0x753342(++_0x32c22b);}(_0x8103,0x1ae));var _0x3810=function(_0x3e4b44,_0x29db5a){_0x3e4b44=_0x3e4b44-0x0;var _0x10d797=_0x8103[_0x3e4b44];return _0x10d797;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3810('0x0'));var timeout=require(_0x3810('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3810('0x2'));var auth=require(_0x3810('0x3'));var interaction=require(_0x3810('0x4'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x3810('0x5')]('/',auth[_0x3810('0x6')](),controller[_0x3810('0x7')]);router[_0x3810('0x5')](_0x3810('0x8'),auth[_0x3810('0x6')](),controller[_0x3810('0x9')]);router[_0x3810('0xa')]('/',auth[_0x3810('0x6')](),controller[_0x3810('0xb')]);router[_0x3810('0xc')](_0x3810('0x8'),auth[_0x3810('0x6')](),controller['update']);router['delete'](_0x3810('0x8'),auth['isAuthenticated'](),controller[_0x3810('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xff1b=['isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x38fcef,_0x153ae0){var _0x92934=function(_0x66663d){while(--_0x66663d){_0x38fcef['push'](_0x38fcef['shift']());}};_0x92934(++_0x153ae0);}(_0xff1b,0x171));var _0xbff1=function(_0x263999,_0x477176){_0x263999=_0x263999-0x0;var _0x336996=_0xff1b[_0x263999];return _0x336996;};'use strict';var multer=require(_0xbff1('0x0'));var util=require(_0xbff1('0x1'));var path=require(_0xbff1('0x2'));var timeout=require(_0xbff1('0x3'));var express=require(_0xbff1('0x4'));var router=express[_0xbff1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbff1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbff1('0x7'));var controller=require('./pause.controller');router[_0xbff1('0x8')]('/',auth[_0xbff1('0x9')](),controller['index']);router[_0xbff1('0x8')](_0xbff1('0xa'),auth['isAuthenticated'](),controller[_0xbff1('0xb')]);router[_0xbff1('0xc')]('/',auth[_0xbff1('0x9')](),controller[_0xbff1('0xd')]);router[_0xbff1('0xe')](_0xbff1('0xa'),auth[_0xbff1('0x9')](),controller['update']);router[_0xbff1('0xf')](_0xbff1('0xa'),auth[_0xbff1('0x9')](),controller[_0xbff1('0x10')]);module[_0xbff1('0x11')]=router;
\ No newline at end of file
index 16f93c1..7859be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x863e=['name','sequelize','exports','STRING'];(function(_0x3841b1,_0x44b2d4){var _0x37bb11=function(_0x19d2e4){while(--_0x19d2e4){_0x3841b1['push'](_0x3841b1['shift']());}};_0x37bb11(++_0x44b2d4);}(_0x863e,0x191));var _0xe863=function(_0x38f1a5,_0x3d2d78){_0x38f1a5=_0x38f1a5-0x0;var _0x4ee6a7=_0x863e[_0x38f1a5];return _0x4ee6a7;};'use strict';var Sequelize=require(_0xe863('0x0'));module[_0xe863('0x1')]={'name':{'type':Sequelize[_0xe863('0x2')],'unique':_0xe863('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe863('0x2')]}};
\ No newline at end of file
+var _0x2294=['exports','STRING','sequelize'];(function(_0x115d83,_0x3f4062){var _0x2f161b=function(_0x783abd){while(--_0x783abd){_0x115d83['push'](_0x115d83['shift']());}};_0x2f161b(++_0x3f4062);}(_0x2294,0x143));var _0x4229=function(_0x257017,_0x330627){_0x257017=_0x257017-0x0;var _0x38536d=_0x2294[_0x257017];return _0x38536d;};'use strict';var Sequelize=require(_0x4229('0x0'));module[_0x4229('0x1')]={'name':{'type':Sequelize[_0x4229('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4229('0x2')]}};
\ No newline at end of file
index 0efd259..cc54a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5740=['save','update','then','destroy','Pauses','UserProfileResource','name','send','index','map','Pause','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5740,0x184));var _0x0574=function(_0x296295,_0x218428){_0x296295=_0x296295-0x0;var _0x546d2c=_0x5740[_0x296295];return _0x546d2c;};'use strict';var emlformat=require(_0x0574('0x0'));var rimraf=require(_0x0574('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0574('0x2'));var rp=require(_0x0574('0x3'));var moment=require('moment');var BPromise=require(_0x0574('0x4'));var Mustache=require(_0x0574('0x5'));var util=require(_0x0574('0x6'));var path=require(_0x0574('0x7'));var sox=require(_0x0574('0x8'));var csv=require(_0x0574('0x9'));var ejs=require(_0x0574('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0574('0xb'));var squel=require(_0x0574('0xc'));var crypto=require(_0x0574('0xd'));var jsforce=require(_0x0574('0xe'));var deskjs=require(_0x0574('0xf'));var toCsv=require(_0x0574('0x9'));var querystring=require(_0x0574('0x10'));var Papa=require(_0x0574('0x11'));var Redis=require(_0x0574('0x12'));var authService=require(_0x0574('0x13'));var qs=require(_0x0574('0x14'));var as=require(_0x0574('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0574('0x16'))(_0x0574('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0574('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f91d8,_0x5d09d6){_0x5d09d6=_0x5d09d6||0xcc;return function(_0x1a249f){if(_0x1a249f){return _0x2f91d8[_0x0574('0x19')](_0x5d09d6);}return _0x2f91d8[_0x0574('0x1a')](_0x5d09d6)[_0x0574('0x1b')]();};}function respondWithResult(_0x3b071b,_0x376414){_0x376414=_0x376414||0xc8;return function(_0x4818ed){if(_0x4818ed){return _0x3b071b[_0x0574('0x1a')](_0x376414)[_0x0574('0x1c')](_0x4818ed);}};}function respondWithFilteredResult(_0x375438,_0x142da8){return function(_0x1935ef){if(_0x1935ef){var _0x296eb9=typeof _0x142da8['offset']==='undefined'&&typeof _0x142da8['limit']===_0x0574('0x1d');var _0x1fc917=_0x1935ef[_0x0574('0x1e')];var _0x2157b2=_0x296eb9?0x0:_0x142da8[_0x0574('0x1f')];var _0x2e0395=_0x296eb9?_0x1935ef[_0x0574('0x1e')]:_0x142da8[_0x0574('0x1f')]+_0x142da8[_0x0574('0x20')];var _0x1659f9;if(_0x2e0395>=_0x1fc917){_0x2e0395=_0x1fc917;_0x1659f9=0xc8;}else{_0x1659f9=0xce;}_0x375438[_0x0574('0x1a')](_0x1659f9);return _0x375438[_0x0574('0x21')](_0x0574('0x22'),_0x2157b2+'-'+_0x2e0395+'/'+_0x1fc917)['json'](_0x1935ef);}return null;};}function patchUpdates(_0x581eb1){return function(_0x434b9f){try{jsonpatch[_0x0574('0x23')](_0x434b9f,_0x581eb1,!![]);}catch(_0x366db5){return BPromise[_0x0574('0x24')](_0x366db5);}return _0x434b9f[_0x0574('0x25')]();};}function saveUpdates(_0x34b76,_0x50428a){return function(_0x4878af){if(_0x4878af){return _0x4878af[_0x0574('0x26')](_0x34b76)[_0x0574('0x27')](function(_0x1eb2f3){return _0x1eb2f3;});}return null;};}function removeEntity(_0x26dcb1,_0x21c2b8){return function(_0x22b45a){if(_0x22b45a){return _0x22b45a[_0x0574('0x28')]()[_0x0574('0x27')](function(){var _0x1cf262=_0x22b45a['get']({'plain':!![]});var _0x10035c=_0x0574('0x29');return db[_0x0574('0x2a')][_0x0574('0x28')]({'where':{'type':_0x10035c,'resourceId':_0x1cf262['id']}})[_0x0574('0x27')](function(){return _0x22b45a;});})[_0x0574('0x27')](function(){_0x26dcb1['status'](0xcc)[_0x0574('0x1b')]();});}};}function handleEntityNotFound(_0x5a4814,_0x5ad76e){return function(_0x452147){if(!_0x452147){_0x5a4814[_0x0574('0x19')](0x194);}return _0x452147;};}function handleError(_0x10fafe,_0x142e2a){_0x142e2a=_0x142e2a||0x1f4;return function(_0x1711f8){logger['error'](_0x1711f8['stack']);if(_0x1711f8[_0x0574('0x2b')]){delete _0x1711f8[_0x0574('0x2b')];}_0x10fafe[_0x0574('0x1a')](_0x142e2a)[_0x0574('0x2c')](_0x1711f8);};}exports[_0x0574('0x2d')]=function(_0x435cfb,_0x17dab5){var _0xc9da7c={},_0xe9376b={},_0x3b3e10={'count':0x0,'rows':[]};var _0xc3adba=_[_0x0574('0x2e')](db[_0x0574('0x2f')]['rawAttributes'],function(_0x3d64fc){return{'name':_0x3d64fc[_0x0574('0x30')],'type':_0x3d64fc[_0x0574('0x31')][_0x0574('0x32')]};});_0xe9376b[_0x0574('0x33')]=_[_0x0574('0x2e')](_0xc3adba,_0x0574('0x2b'));_0xe9376b[_0x0574('0x34')]=_[_0x0574('0x35')](_0x435cfb[_0x0574('0x34')]);_0xe9376b['filters']=_[_0x0574('0x36')](_0xe9376b[_0x0574('0x33')],_0xe9376b['query']);_0xc9da7c[_0x0574('0x37')]=_[_0x0574('0x36')](_0xe9376b['model'],qs[_0x0574('0x38')](_0x435cfb[_0x0574('0x34')]['fields']));_0xc9da7c[_0x0574('0x37')]=_0xc9da7c[_0x0574('0x37')][_0x0574('0x39')]?_0xc9da7c[_0x0574('0x37')]:_0xe9376b[_0x0574('0x33')];if(!_0x435cfb[_0x0574('0x34')][_0x0574('0x3a')]('nolimit')){_0xc9da7c[_0x0574('0x20')]=qs['limit'](_0x435cfb[_0x0574('0x34')]['limit']);_0xc9da7c[_0x0574('0x1f')]=qs[_0x0574('0x1f')](_0x435cfb[_0x0574('0x34')][_0x0574('0x1f')]);}_0xc9da7c[_0x0574('0x3b')]=qs[_0x0574('0x3c')](_0x435cfb[_0x0574('0x34')][_0x0574('0x3c')]);_0xc9da7c[_0x0574('0x3d')]=qs[_0x0574('0x3e')](_[_0x0574('0x3f')](_0x435cfb[_0x0574('0x34')],_0xe9376b['filters']),_0xc3adba);if(_0x435cfb['query'][_0x0574('0x40')]){_0xc9da7c[_0x0574('0x3d')]=_[_0x0574('0x41')](_0xc9da7c[_0x0574('0x3d')],{'$or':_[_0x0574('0x2e')](_0xc3adba,function(_0x53e7e8){if(_0x53e7e8[_0x0574('0x31')]!==_0x0574('0x42')){var _0x15a59d={};_0x15a59d[_0x53e7e8['name']]={'$like':'%'+_0x435cfb[_0x0574('0x34')]['filter']+'%'};return _0x15a59d;}})});}_0xc9da7c=_[_0x0574('0x41')]({},_0xc9da7c,_0x435cfb[_0x0574('0x43')]);var _0x55d737={'where':_0xc9da7c[_0x0574('0x3d')]};return db['Pause'][_0x0574('0x1e')](_0x55d737)[_0x0574('0x27')](function(_0x24a9b0){_0x3b3e10['count']=_0x24a9b0;if(_0x435cfb['query']['includeAll']){_0xc9da7c[_0x0574('0x44')]=[{'all':!![]}];}return db[_0x0574('0x2f')]['findAll'](_0xc9da7c);})[_0x0574('0x27')](function(_0x1d41cb){_0x3b3e10[_0x0574('0x45')]=_0x1d41cb;return _0x3b3e10;})[_0x0574('0x27')](respondWithFilteredResult(_0x17dab5,_0xc9da7c))[_0x0574('0x46')](handleError(_0x17dab5,null));};exports[_0x0574('0x47')]=function(_0x229b04,_0x519271){var _0x401ab3={'raw':!![],'where':{'id':_0x229b04[_0x0574('0x48')]['id']}},_0x6553d9={};_0x6553d9[_0x0574('0x33')]=_[_0x0574('0x35')](db[_0x0574('0x2f')][_0x0574('0x49')]);_0x6553d9['query']=_[_0x0574('0x35')](_0x229b04['query']);_0x6553d9[_0x0574('0x3e')]=_[_0x0574('0x36')](_0x6553d9[_0x0574('0x33')],_0x6553d9[_0x0574('0x34')]);_0x401ab3[_0x0574('0x37')]=_[_0x0574('0x36')](_0x6553d9[_0x0574('0x33')],qs[_0x0574('0x38')](_0x229b04[_0x0574('0x34')][_0x0574('0x38')]));_0x401ab3[_0x0574('0x37')]=_0x401ab3[_0x0574('0x37')][_0x0574('0x39')]?_0x401ab3[_0x0574('0x37')]:_0x6553d9['model'];if(_0x229b04['query']['includeAll']){_0x401ab3[_0x0574('0x44')]=[{'all':!![]}];}_0x401ab3=_[_0x0574('0x41')]({},_0x401ab3,_0x229b04[_0x0574('0x43')]);return db[_0x0574('0x2f')]['find'](_0x401ab3)[_0x0574('0x27')](handleEntityNotFound(_0x519271,null))['then'](respondWithResult(_0x519271,null))[_0x0574('0x46')](handleError(_0x519271,null));};exports['create']=function(_0x2a8dd1,_0xee727e){return db[_0x0574('0x2f')][_0x0574('0x4a')](_0x2a8dd1['body'],{})[_0x0574('0x27')](function(_0x4e7337){var _0x5142ff=_0x2a8dd1[_0x0574('0x4b')][_0x0574('0x4c')]({'plain':!![]});if(!_0x5142ff)throw new Error(_0x0574('0x4d'));if(_0x5142ff[_0x0574('0x4e')]==='user'){var _0x4ff31a=_0x4e7337[_0x0574('0x4c')]({'plain':!![]});var _0x12062a=_0x0574('0x29');return db[_0x0574('0x4f')]['find']({'where':{'name':_0x12062a,'userProfileId':_0x5142ff['userProfileId']},'raw':!![]})[_0x0574('0x27')](function(_0x26e6de){if(_0x26e6de&&_0x26e6de[_0x0574('0x50')]===0x0){return db[_0x0574('0x2a')][_0x0574('0x4a')]({'name':_0x4ff31a[_0x0574('0x2b')],'resourceId':_0x4ff31a['id'],'type':_0x26e6de[_0x0574('0x2b')],'sectionId':_0x26e6de['id']},{})['then'](function(){return _0x4e7337;});}else{return _0x4e7337;}})[_0x0574('0x46')](function(_0x43b488){logger[_0x0574('0x51')](_0x0574('0x52'),_0x43b488);throw _0x43b488;});}return _0x4e7337;})[_0x0574('0x27')](respondWithResult(_0xee727e,0xc9))[_0x0574('0x46')](handleError(_0xee727e,null));};exports['update']=function(_0x26e88b,_0x4447d0){if(_0x26e88b[_0x0574('0x53')]['id']){delete _0x26e88b[_0x0574('0x53')]['id'];}return db[_0x0574('0x2f')][_0x0574('0x54')]({'where':{'id':_0x26e88b[_0x0574('0x48')]['id']}})['then'](handleEntityNotFound(_0x4447d0,null))[_0x0574('0x27')](saveUpdates(_0x26e88b[_0x0574('0x53')],null))[_0x0574('0x27')](respondWithResult(_0x4447d0,null))[_0x0574('0x46')](handleError(_0x4447d0,null));};exports[_0x0574('0x28')]=function(_0x20909c,_0x531412){return db[_0x0574('0x2f')][_0x0574('0x54')]({'where':{'id':_0x20909c['params']['id']}})['then'](handleEntityNotFound(_0x531412,null))[_0x0574('0x27')](removeEntity(_0x531412,null))[_0x0574('0x46')](handleError(_0x531412,null));};
\ No newline at end of file
+var _0x8126=['show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','Pauses','destroy','error','stack','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch'];(function(_0x564d4b,_0x1246a7){var _0xc5a7d6=function(_0x4c7746){while(--_0x4c7746){_0x564d4b['push'](_0x564d4b['shift']());}};_0xc5a7d6(++_0x1246a7);}(_0x8126,0x178));var _0x6812=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0x8126[_0x4eeca4];return _0x430031;};'use strict';var emlformat=require(_0x6812('0x0'));var rimraf=require(_0x6812('0x1'));var zipdir=require(_0x6812('0x2'));var jsonpatch=require(_0x6812('0x3'));var rp=require(_0x6812('0x4'));var moment=require(_0x6812('0x5'));var BPromise=require(_0x6812('0x6'));var Mustache=require(_0x6812('0x7'));var util=require(_0x6812('0x8'));var path=require(_0x6812('0x9'));var sox=require(_0x6812('0xa'));var csv=require(_0x6812('0xb'));var ejs=require(_0x6812('0xc'));var fs=require('fs');var fs_extra=require(_0x6812('0xd'));var _=require(_0x6812('0xe'));var squel=require(_0x6812('0xf'));var crypto=require('crypto');var jsforce=require(_0x6812('0x10'));var deskjs=require(_0x6812('0x11'));var toCsv=require(_0x6812('0xb'));var querystring=require(_0x6812('0x12'));var Papa=require('papaparse');var Redis=require(_0x6812('0x13'));var authService=require(_0x6812('0x14'));var qs=require(_0x6812('0x15'));var as=require(_0x6812('0x16'));var hardwareService=require(_0x6812('0x17'));var logger=require(_0x6812('0x18'))(_0x6812('0x19'));var utils=require(_0x6812('0x1a'));var config=require(_0x6812('0x1b'));var licenseUtil=require(_0x6812('0x1c'));var db=require(_0x6812('0x1d'))['db'];function respondWithStatusCode(_0x4ef164,_0x2dfb2f){_0x2dfb2f=_0x2dfb2f||0xcc;return function(_0x2b771e){if(_0x2b771e){return _0x4ef164[_0x6812('0x1e')](_0x2dfb2f);}return _0x4ef164[_0x6812('0x1f')](_0x2dfb2f)[_0x6812('0x20')]();};}function respondWithResult(_0x4faa7c,_0x140b26){_0x140b26=_0x140b26||0xc8;return function(_0x59004d){if(_0x59004d){return _0x4faa7c[_0x6812('0x1f')](_0x140b26)[_0x6812('0x21')](_0x59004d);}};}function respondWithFilteredResult(_0x2b0419,_0x4391b1){return function(_0x103356){if(_0x103356){var _0x120c27=typeof _0x4391b1[_0x6812('0x22')]===_0x6812('0x23')&&typeof _0x4391b1[_0x6812('0x24')]===_0x6812('0x23');var _0x55b1a8=_0x103356[_0x6812('0x25')];var _0x40cf02=_0x120c27?0x0:_0x4391b1[_0x6812('0x22')];var _0x2f2c62=_0x120c27?_0x103356['count']:_0x4391b1['offset']+_0x4391b1[_0x6812('0x24')];var _0x243165;if(_0x2f2c62>=_0x55b1a8){_0x2f2c62=_0x55b1a8;_0x243165=0xc8;}else{_0x243165=0xce;}_0x2b0419[_0x6812('0x1f')](_0x243165);return _0x2b0419[_0x6812('0x26')](_0x6812('0x27'),_0x40cf02+'-'+_0x2f2c62+'/'+_0x55b1a8)[_0x6812('0x21')](_0x103356);}return null;};}function patchUpdates(_0x392a83){return function(_0x412af1){try{jsonpatch[_0x6812('0x28')](_0x412af1,_0x392a83,!![]);}catch(_0x323a50){return BPromise['reject'](_0x323a50);}return _0x412af1[_0x6812('0x29')]();};}function saveUpdates(_0x40f1b9,_0x5dab67){return function(_0x379a95){if(_0x379a95){return _0x379a95['update'](_0x40f1b9)[_0x6812('0x2a')](function(_0x398864){return _0x398864;});}return null;};}function removeEntity(_0xd6fe77,_0x38982e){return function(_0x1c6088){if(_0x1c6088){return _0x1c6088['destroy']()['then'](function(){var _0x45a19a=_0x1c6088[_0x6812('0x2b')]({'plain':!![]});var _0x2bd8ce=_0x6812('0x2c');return db['UserProfileResource'][_0x6812('0x2d')]({'where':{'type':_0x2bd8ce,'resourceId':_0x45a19a['id']}})[_0x6812('0x2a')](function(){return _0x1c6088;});})['then'](function(){_0xd6fe77[_0x6812('0x1f')](0xcc)[_0x6812('0x20')]();});}};}function handleEntityNotFound(_0x1943ae,_0xadaac0){return function(_0x1f2082){if(!_0x1f2082){_0x1943ae['sendStatus'](0x194);}return _0x1f2082;};}function handleError(_0xde3f,_0x5e73ae){_0x5e73ae=_0x5e73ae||0x1f4;return function(_0x57e9f5){logger[_0x6812('0x2e')](_0x57e9f5[_0x6812('0x2f')]);if(_0x57e9f5['name']){delete _0x57e9f5['name'];}_0xde3f[_0x6812('0x1f')](_0x5e73ae)['send'](_0x57e9f5);};}exports[_0x6812('0x30')]=function(_0x167fff,_0x51ea80){var _0x1bc1fc={},_0x4fd50e={},_0x3ef0f7={'count':0x0,'rows':[]};var _0x110889=_[_0x6812('0x31')](db[_0x6812('0x32')][_0x6812('0x33')],function(_0x49c35e){return{'name':_0x49c35e['fieldName'],'type':_0x49c35e[_0x6812('0x34')][_0x6812('0x35')]};});_0x4fd50e[_0x6812('0x36')]=_[_0x6812('0x31')](_0x110889,'name');_0x4fd50e[_0x6812('0x37')]=_[_0x6812('0x38')](_0x167fff[_0x6812('0x37')]);_0x4fd50e[_0x6812('0x39')]=_[_0x6812('0x3a')](_0x4fd50e[_0x6812('0x36')],_0x4fd50e[_0x6812('0x37')]);_0x1bc1fc[_0x6812('0x3b')]=_[_0x6812('0x3a')](_0x4fd50e['model'],qs['fields'](_0x167fff['query'][_0x6812('0x3c')]));_0x1bc1fc[_0x6812('0x3b')]=_0x1bc1fc[_0x6812('0x3b')][_0x6812('0x3d')]?_0x1bc1fc[_0x6812('0x3b')]:_0x4fd50e[_0x6812('0x36')];if(!_0x167fff[_0x6812('0x37')][_0x6812('0x3e')]('nolimit')){_0x1bc1fc[_0x6812('0x24')]=qs[_0x6812('0x24')](_0x167fff[_0x6812('0x37')][_0x6812('0x24')]);_0x1bc1fc['offset']=qs[_0x6812('0x22')](_0x167fff[_0x6812('0x37')][_0x6812('0x22')]);}_0x1bc1fc[_0x6812('0x3f')]=qs['sort'](_0x167fff[_0x6812('0x37')][_0x6812('0x40')]);_0x1bc1fc[_0x6812('0x41')]=qs['filters'](_[_0x6812('0x42')](_0x167fff[_0x6812('0x37')],_0x4fd50e['filters']),_0x110889);if(_0x167fff[_0x6812('0x37')][_0x6812('0x43')]){_0x1bc1fc[_0x6812('0x41')]=_[_0x6812('0x44')](_0x1bc1fc['where'],{'$or':_[_0x6812('0x31')](_0x110889,function(_0xb8b8b8){if(_0xb8b8b8['type']!==_0x6812('0x45')){var _0x19c7e0={};_0x19c7e0[_0xb8b8b8['name']]={'$like':'%'+_0x167fff['query']['filter']+'%'};return _0x19c7e0;}})});}_0x1bc1fc=_[_0x6812('0x44')]({},_0x1bc1fc,_0x167fff[_0x6812('0x46')]);var _0x4e5b3c={'where':_0x1bc1fc[_0x6812('0x41')]};return db[_0x6812('0x32')][_0x6812('0x25')](_0x4e5b3c)[_0x6812('0x2a')](function(_0x54c8d0){_0x3ef0f7[_0x6812('0x25')]=_0x54c8d0;if(_0x167fff[_0x6812('0x37')]['includeAll']){_0x1bc1fc['include']=[{'all':!![]}];}return db['Pause'][_0x6812('0x47')](_0x1bc1fc);})['then'](function(_0x47a818){_0x3ef0f7[_0x6812('0x48')]=_0x47a818;return _0x3ef0f7;})[_0x6812('0x2a')](respondWithFilteredResult(_0x51ea80,_0x1bc1fc))[_0x6812('0x49')](handleError(_0x51ea80,null));};exports[_0x6812('0x4a')]=function(_0x337efc,_0x4426e3){var _0x4af320={'raw':!![],'where':{'id':_0x337efc[_0x6812('0x4b')]['id']}},_0x366c2a={};_0x366c2a['model']=_[_0x6812('0x38')](db['Pause'][_0x6812('0x33')]);_0x366c2a[_0x6812('0x37')]=_[_0x6812('0x38')](_0x337efc[_0x6812('0x37')]);_0x366c2a[_0x6812('0x39')]=_[_0x6812('0x3a')](_0x366c2a[_0x6812('0x36')],_0x366c2a['query']);_0x4af320['attributes']=_[_0x6812('0x3a')](_0x366c2a[_0x6812('0x36')],qs[_0x6812('0x3c')](_0x337efc[_0x6812('0x37')]['fields']));_0x4af320[_0x6812('0x3b')]=_0x4af320['attributes'][_0x6812('0x3d')]?_0x4af320[_0x6812('0x3b')]:_0x366c2a[_0x6812('0x36')];if(_0x337efc[_0x6812('0x37')][_0x6812('0x4c')]){_0x4af320[_0x6812('0x4d')]=[{'all':!![]}];}_0x4af320=_[_0x6812('0x44')]({},_0x4af320,_0x337efc[_0x6812('0x46')]);return db[_0x6812('0x32')]['find'](_0x4af320)[_0x6812('0x2a')](handleEntityNotFound(_0x4426e3,null))[_0x6812('0x2a')](respondWithResult(_0x4426e3,null))[_0x6812('0x49')](handleError(_0x4426e3,null));};exports[_0x6812('0x4e')]=function(_0x12152c,_0x57b31f){return db['Pause']['create'](_0x12152c[_0x6812('0x4f')],{})[_0x6812('0x2a')](function(_0x323e85){var _0x4b1c9c=_0x12152c[_0x6812('0x50')][_0x6812('0x2b')]({'plain':!![]});if(!_0x4b1c9c)throw new Error(_0x6812('0x51'));if(_0x4b1c9c[_0x6812('0x52')]===_0x6812('0x50')){var _0xc5899a=_0x323e85[_0x6812('0x2b')]({'plain':!![]});var _0x21a9fc='Pauses';return db[_0x6812('0x53')][_0x6812('0x54')]({'where':{'name':_0x21a9fc,'userProfileId':_0x4b1c9c[_0x6812('0x55')]},'raw':!![]})[_0x6812('0x2a')](function(_0x236dcb){if(_0x236dcb&&_0x236dcb['autoAssociation']===0x0){return db[_0x6812('0x56')][_0x6812('0x4e')]({'name':_0xc5899a[_0x6812('0x57')],'resourceId':_0xc5899a['id'],'type':_0x236dcb[_0x6812('0x57')],'sectionId':_0x236dcb['id']},{})['then'](function(){return _0x323e85;});}else{return _0x323e85;}})[_0x6812('0x49')](function(_0xe86fb4){logger['error'](_0x6812('0x58'),_0xe86fb4);throw _0xe86fb4;});}return _0x323e85;})[_0x6812('0x2a')](respondWithResult(_0x57b31f,0xc9))['catch'](handleError(_0x57b31f,null));};exports[_0x6812('0x59')]=function(_0x556dc6,_0xbe4634){if(_0x556dc6['body']['id']){delete _0x556dc6[_0x6812('0x4f')]['id'];}return db[_0x6812('0x32')]['find']({'where':{'id':_0x556dc6[_0x6812('0x4b')]['id']}})[_0x6812('0x2a')](handleEntityNotFound(_0xbe4634,null))[_0x6812('0x2a')](saveUpdates(_0x556dc6[_0x6812('0x4f')],null))[_0x6812('0x2a')](respondWithResult(_0xbe4634,null))[_0x6812('0x49')](handleError(_0xbe4634,null));};exports[_0x6812('0x2d')]=function(_0x28926b,_0x42de7d){return db[_0x6812('0x32')][_0x6812('0x54')]({'where':{'id':_0x28926b[_0x6812('0x4b')]['id']}})[_0x6812('0x2a')](handleEntityNotFound(_0x42de7d,null))['then'](removeEntity(_0x42de7d,null))[_0x6812('0x49')](handleError(_0x42de7d,null));};
\ No newline at end of file
index 668b6e2..9d0e27a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x34d451,_0x467ffe){var _0x10401e=function(_0x21597e){while(--_0x21597e){_0x34d451['push'](_0x34d451['shift']());}};_0x10401e(++_0x467ffe);}(_0xf494,0x1c6));var _0x4f49=function(_0x123d03,_0x2b9a8d){_0x123d03=_0x123d03-0x0;var _0x5e723b=_0xf494[_0x123d03];return _0x5e723b;};'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')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x4362d2,_0x35b91c){var _0x1a344a=function(_0x881ee){while(--_0x881ee){_0x4362d2['push'](_0x4362d2['shift']());}};_0x1a344a(++_0x35b91c);}(_0x5fab,0x177));var _0xb5fa=function(_0xddcb6f,_0x34f5c1){_0xddcb6f=_0xddcb6f-0x0;var _0x22a491=_0x5fab[_0xddcb6f];return _0x22a491;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e76d1d4..a6456c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x54162c,_0x2ed9c4){var _0x1983e8=function(_0x296f0a){while(--_0x296f0a){_0x54162c['push'](_0x54162c['shift']());}};_0x1983e8(++_0x2ed9c4);}(_0xb10b,0x12a));var _0xbb10=function(_0x4def98,_0x421f3f){_0x4def98=_0x4def98-0x0;var _0x40f8cc=_0xb10b[_0x4def98];return _0x40f8cc;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x176bac,_0xd6148f){var _0x1a2c5e=function(_0x306e8e){while(--_0x306e8e){_0x176bac['push'](_0x176bac['shift']());}};_0x1a2c5e(++_0xd6148f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5da0e9,_0x43c898){_0x5da0e9=_0x5da0e9-0x0;var _0x4b022d=_0xb10b[_0x5da0e9];return _0x4b022d;};'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 fa65a61..1804cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c6d=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','/webhook','/:id','isAuthenticated','/:id/download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put'];(function(_0x4f35ec,_0x840f6e){var _0x111757=function(_0x107271){while(--_0x107271){_0x4f35ec['push'](_0x4f35ec['shift']());}};_0x111757(++_0x840f6e);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x3922b9,_0x311a3d){_0x3922b9=_0x3922b9-0x0;var _0x2f1b10=_0x4c6d[_0x3922b9];return _0x2f1b10;};'use strict';var multer=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var path=require(_0xd4c6('0x2'));var timeout=require(_0xd4c6('0x3'));var express=require(_0xd4c6('0x4'));var router=express['Router']();var fs_extra=require(_0xd4c6('0x5'));var auth=require(_0xd4c6('0x6'));var interaction=require(_0xd4c6('0x7'));var config=require('../../config/environment');var controller=require(_0xd4c6('0x8'));router[_0xd4c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xd4c6('0xa')]);router[_0xd4c6('0x9')](_0xd4c6('0xb'),controller['webhookGet']);router[_0xd4c6('0x9')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['show']);router[_0xd4c6('0x9')](_0xd4c6('0xe'),auth[_0xd4c6('0xd')](),controller['download']);var upload=multer({'storage':multer[_0xd4c6('0xf')]({'destination':function(_0x38f0a6,_0x3eaa96,_0x2790e7){_0x2790e7(null,path[_0xd4c6('0x10')](config[_0xd4c6('0x11')],'server/files/plugins'));},'filename':function(_0x52bbc9,_0x35b902,_0x489171){_0x35b902[_0xd4c6('0x12')]=_0x35b902[_0xd4c6('0x12')][_0xd4c6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x489171(null,util[_0xd4c6('0x14')](_0xd4c6('0x15'),path[_0xd4c6('0x16')](_0x35b902[_0xd4c6('0x12')],path['extname'](_0x35b902['originalname'])),Date[_0xd4c6('0x17')](),path[_0xd4c6('0x18')](_0x35b902[_0xd4c6('0x12')])));}})});router[_0xd4c6('0x19')]('/',upload[_0xd4c6('0x1a')](_0xd4c6('0x1b')),controller[_0xd4c6('0x1c')]);router['post'](_0xd4c6('0xb'),controller[_0xd4c6('0x1d')]);router[_0xd4c6('0x1e')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['update']);router[_0xd4c6('0x1f')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['delete']);module[_0xd4c6('0x20')]=router;
\ No newline at end of file
+var _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1546c2,_0x22e822){var _0x24583c=function(_0x3906f8){while(--_0x3906f8){_0x1546c2['push'](_0x1546c2['shift']());}};_0x24583c(++_0x22e822);}(_0xd2ea,0x15f));var _0xad2e=function(_0x50558c,_0x3a60aa){_0x50558c=_0x50558c-0x0;var _0x431bdc=_0xd2ea[_0x50558c];return _0x431bdc;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router;
\ No newline at end of file
index 87a3445..385bbf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ce=['STRING','ENUM','html','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x538759,_0x2f18f2){var _0x5e30c6=function(_0x4ac515){while(--_0x4ac515){_0x538759['push'](_0x538759['shift']());}};_0x5e30c6(++_0x2f18f2);}(_0x61ce,0x8e));var _0xe61c=function(_0x83c7af,_0x43d07c){_0x83c7af=_0x83c7af-0x0;var _0x3008fe=_0x61ce[_0x83c7af];return _0x3008fe;};'use strict';var Sequelize=require(_0xe61c('0x0'));module[_0xe61c('0x1')]={'name':{'type':Sequelize[_0xe61c('0x2')]},'type':{'type':Sequelize[_0xe61c('0x3')](_0xe61c('0x4'),'script')},'description':{'type':Sequelize[_0xe61c('0x5')]},'version':{'type':Sequelize[_0xe61c('0x5')]},'path':{'type':Sequelize[_0xe61c('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe61c('0x6')},'sidebar':{'type':Sequelize[_0xe61c('0x3')]('adminOnly','agentOnly',_0xe61c('0x7'),'never'),'defaultValue':'always','comment':_0xe61c('0x8')},'icon':{'type':Sequelize[_0xe61c('0x2')]},'adminUrl':{'type':Sequelize[_0xe61c('0x2')]},'agentUrl':{'type':Sequelize[_0xe61c('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0614=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT'];(function(_0x230a2c,_0x1dcb97){var _0x76556d=function(_0x50c6f9){while(--_0x50c6f9){_0x230a2c['push'](_0x230a2c['shift']());}};_0x76556d(++_0x1dcb97);}(_0x0614,0x12e));var _0x4061=function(_0x5ce35d,_0x3cb0a1){_0x5ce35d=_0x5ce35d-0x0;var _0x456b24=_0x0614[_0x5ce35d];return _0x456b24;};'use strict';var Sequelize=require(_0x4061('0x0'));module[_0x4061('0x1')]={'name':{'type':Sequelize[_0x4061('0x2')]},'type':{'type':Sequelize[_0x4061('0x3')]('html',_0x4061('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x4061('0x5')]},'path':{'type':Sequelize[_0x4061('0x2')],'comment':_0x4061('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4061('0x7')},'sidebar':{'type':Sequelize[_0x4061('0x3')]('adminOnly',_0x4061('0x8'),'always','never'),'defaultValue':_0x4061('0x9'),'comment':_0x4061('0xa')},'icon':{'type':Sequelize[_0x4061('0x2')]},'adminUrl':{'type':Sequelize[_0x4061('0x2')]},'agentUrl':{'type':Sequelize[_0x4061('0x2')]},'scriptName':{'type':Sequelize[_0x4061('0x2')]},'scriptPath':{'type':Sequelize[_0x4061('0x2')]}};
\ No newline at end of file
index 6a33ca4..a94a640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa9d=['**/*','join','server/files/plugins','node_modules/**/*','close','existsSync','Plugin\x20not\x20found','Sequelize','Download\x20completed','info','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','script','admin','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','headers','content-length','content-type','endsWith','statusCode','http://localhost:','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','download','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa9d,0xf9));var _0xdfa9=function(_0x2d7e90,_0xb2b118){_0x2d7e90=_0x2d7e90-0x0;var _0x3dd10a=_0xfa9d[_0x2d7e90];return _0x3dd10a;};'use strict';var emlformat=require(_0xdfa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfa9('0x1'));var jsonpatch=require(_0xdfa9('0x2'));var rp=require(_0xdfa9('0x3'));var moment=require(_0xdfa9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdfa9('0x5'));var path=require(_0xdfa9('0x6'));var sox=require(_0xdfa9('0x7'));var csv=require(_0xdfa9('0x8'));var ejs=require(_0xdfa9('0x9'));var fs=require('fs');var fs_extra=require(_0xdfa9('0xa'));var _=require(_0xdfa9('0xb'));var squel=require(_0xdfa9('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfa9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfa9('0xe'));var Papa=require(_0xdfa9('0xf'));var extract=require(_0xdfa9('0x10'));var rimraf=require(_0xdfa9('0x11'));var archiver=require(_0xdfa9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa9('0x13'));var as=require(_0xdfa9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdfa9('0x15'));var utils=require('../../config/utils');var config=require(_0xdfa9('0x16'));var licenseUtil=require(_0xdfa9('0x17'));var db=require(_0xdfa9('0x18'))['db'];config[_0xdfa9('0x19')]=_[_0xdfa9('0x1a')](config[_0xdfa9('0x19')],{'host':_0xdfa9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfa9('0x1c'))[_0xdfa9('0x1d')](socket);function respondWithStatusCode(_0x329e6e,_0x70969){_0x70969=_0x70969||0xcc;return function(_0x325f46){if(_0x325f46){return _0x329e6e[_0xdfa9('0x1e')](_0x70969);}return _0x329e6e['status'](_0x70969)[_0xdfa9('0x1f')]();};}function respondWithResult(_0x3e539a,_0x42a4a7){_0x42a4a7=_0x42a4a7||0xc8;return function(_0x53cc92){if(_0x53cc92){return _0x3e539a[_0xdfa9('0x20')](_0x42a4a7)[_0xdfa9('0x21')](_0x53cc92);}};}function respondWithFilteredResult(_0xebf0f8,_0x34c35e){return function(_0x50528d){if(_0x50528d){var _0x37caac=typeof _0x34c35e[_0xdfa9('0x22')]===_0xdfa9('0x23')&&typeof _0x34c35e[_0xdfa9('0x24')]==='undefined';var _0x4503a2=_0x50528d['count'];var _0x53bcdd=_0x37caac?0x0:_0x34c35e[_0xdfa9('0x22')];var _0x5deedf=_0x37caac?_0x50528d[_0xdfa9('0x25')]:_0x34c35e[_0xdfa9('0x22')]+_0x34c35e[_0xdfa9('0x24')];var _0x2a634d;if(_0x5deedf>=_0x4503a2){_0x5deedf=_0x4503a2;_0x2a634d=0xc8;}else{_0x2a634d=0xce;}_0xebf0f8['status'](_0x2a634d);return _0xebf0f8[_0xdfa9('0x26')](_0xdfa9('0x27'),_0x53bcdd+'-'+_0x5deedf+'/'+_0x4503a2)[_0xdfa9('0x21')](_0x50528d);}return null;};}function patchUpdates(_0x472e69){return function(_0x5e2237){try{jsonpatch[_0xdfa9('0x28')](_0x5e2237,_0x472e69,!![]);}catch(_0x5297a7){return BPromise['reject'](_0x5297a7);}return _0x5e2237[_0xdfa9('0x29')]();};}function saveUpdates(_0x6fff65,_0xbe4a3b){return function(_0x31475b){if(_0x31475b){return _0x31475b[_0xdfa9('0x2a')](_0x6fff65)[_0xdfa9('0x2b')](function(_0x33048d){return _0x33048d;});}return null;};}function removeEntity(_0x2471a9,_0x51592d){return function(_0x1a7a39){if(_0x1a7a39){return _0x1a7a39[_0xdfa9('0x2c')]()[_0xdfa9('0x2b')](function(){var _0x385bb6=_0x1a7a39[_0xdfa9('0x2d')]({'plain':!![]});var _0x550f3a=_0xdfa9('0x2e');return db[_0xdfa9('0x2f')][_0xdfa9('0x2c')]({'where':{'type':_0x550f3a,'resourceId':_0x385bb6['id']}})[_0xdfa9('0x2b')](function(){return _0x1a7a39;});})[_0xdfa9('0x2b')](function(){_0x2471a9[_0xdfa9('0x20')](0xcc)[_0xdfa9('0x1f')]();});}};}function handleEntityNotFound(_0x4daf52,_0x36e2b3){return function(_0x3bbac7){if(!_0x3bbac7){_0x4daf52[_0xdfa9('0x1e')](0x194);}return _0x3bbac7;};}function handleError(_0x10a293,_0x318f9c){_0x318f9c=_0x318f9c||0x1f4;return function(_0x4261b3){logger[_0xdfa9('0x30')](_0x4261b3[_0xdfa9('0x31')]);if(_0x4261b3[_0xdfa9('0x32')]){delete _0x4261b3[_0xdfa9('0x32')];}_0x10a293[_0xdfa9('0x20')](_0x318f9c)[_0xdfa9('0x33')](_0x4261b3);};}exports[_0xdfa9('0x34')]=function(_0x242f3f,_0x55966b){var _0x52473a={},_0x27edec={},_0x482636={'count':0x0,'rows':[]};var _0x58c90c=_['map'](db[_0xdfa9('0x35')][_0xdfa9('0x36')],function(_0x22b2be){return{'name':_0x22b2be[_0xdfa9('0x37')],'type':_0x22b2be[_0xdfa9('0x38')]['key']};});_0x27edec['model']=_[_0xdfa9('0x39')](_0x58c90c,_0xdfa9('0x32'));_0x27edec[_0xdfa9('0x3a')]=_['keys'](_0x242f3f[_0xdfa9('0x3a')]);_0x27edec[_0xdfa9('0x3b')]=_[_0xdfa9('0x3c')](_0x27edec[_0xdfa9('0x3d')],_0x27edec[_0xdfa9('0x3a')]);_0x52473a[_0xdfa9('0x3e')]=_[_0xdfa9('0x3c')](_0x27edec[_0xdfa9('0x3d')],qs[_0xdfa9('0x3f')](_0x242f3f[_0xdfa9('0x3a')][_0xdfa9('0x3f')]));_0x52473a[_0xdfa9('0x3e')]=_0x52473a[_0xdfa9('0x3e')][_0xdfa9('0x40')]?_0x52473a[_0xdfa9('0x3e')]:_0x27edec[_0xdfa9('0x3d')];if(!_0x242f3f[_0xdfa9('0x3a')][_0xdfa9('0x41')](_0xdfa9('0x42'))){_0x52473a[_0xdfa9('0x24')]=qs[_0xdfa9('0x24')](_0x242f3f['query'][_0xdfa9('0x24')]);_0x52473a[_0xdfa9('0x22')]=qs[_0xdfa9('0x22')](_0x242f3f['query'][_0xdfa9('0x22')]);}_0x52473a[_0xdfa9('0x43')]=qs['sort'](_0x242f3f[_0xdfa9('0x3a')]['sort']);_0x52473a[_0xdfa9('0x44')]=qs[_0xdfa9('0x3b')](_[_0xdfa9('0x45')](_0x242f3f[_0xdfa9('0x3a')],_0x27edec[_0xdfa9('0x3b')]),_0x58c90c);if(_0x242f3f[_0xdfa9('0x3a')]['filter']){_0x52473a[_0xdfa9('0x44')]=_['merge'](_0x52473a[_0xdfa9('0x44')],{'$or':_[_0xdfa9('0x39')](_0x58c90c,function(_0x48d186){if(_0x48d186[_0xdfa9('0x38')]!==_0xdfa9('0x46')){var _0x56fda3={};_0x56fda3[_0x48d186[_0xdfa9('0x32')]]={'$like':'%'+_0x242f3f['query'][_0xdfa9('0x47')]+'%'};return _0x56fda3;}})});}_0x52473a=_[_0xdfa9('0x48')]({},_0x52473a,_0x242f3f[_0xdfa9('0x49')]);var _0x1ccb47={'where':_0x52473a[_0xdfa9('0x44')]};return db[_0xdfa9('0x35')][_0xdfa9('0x25')](_0x1ccb47)[_0xdfa9('0x2b')](function(_0x4835bd){_0x482636[_0xdfa9('0x25')]=_0x4835bd;if(_0x242f3f[_0xdfa9('0x3a')]['includeAll']){_0x52473a[_0xdfa9('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xdfa9('0x4b')](_0x52473a);})[_0xdfa9('0x2b')](function(_0x58c06c){_0x482636[_0xdfa9('0x4c')]=_0x58c06c;return _0x482636;})[_0xdfa9('0x2b')](respondWithFilteredResult(_0x55966b,_0x52473a))[_0xdfa9('0x4d')](handleError(_0x55966b,null));};exports[_0xdfa9('0x4e')]=function(_0x2c0bd3,_0x159820){var _0x170c50={'raw':!![],'where':{'id':_0x2c0bd3[_0xdfa9('0x4f')]['id']}},_0x5228d3={};_0x5228d3[_0xdfa9('0x3d')]=_[_0xdfa9('0x50')](db['Plugin'][_0xdfa9('0x36')]);_0x5228d3[_0xdfa9('0x3a')]=_[_0xdfa9('0x50')](_0x2c0bd3[_0xdfa9('0x3a')]);_0x5228d3[_0xdfa9('0x3b')]=_[_0xdfa9('0x3c')](_0x5228d3[_0xdfa9('0x3d')],_0x5228d3['query']);_0x170c50[_0xdfa9('0x3e')]=_[_0xdfa9('0x3c')](_0x5228d3[_0xdfa9('0x3d')],qs[_0xdfa9('0x3f')](_0x2c0bd3[_0xdfa9('0x3a')][_0xdfa9('0x3f')]));_0x170c50[_0xdfa9('0x3e')]=_0x170c50[_0xdfa9('0x3e')][_0xdfa9('0x40')]?_0x170c50['attributes']:_0x5228d3['model'];if(_0x2c0bd3[_0xdfa9('0x3a')][_0xdfa9('0x51')]){_0x170c50[_0xdfa9('0x4a')]=[{'all':!![]}];}_0x170c50=_[_0xdfa9('0x48')]({},_0x170c50,_0x2c0bd3[_0xdfa9('0x49')]);return db['Plugin'][_0xdfa9('0x52')](_0x170c50)[_0xdfa9('0x2b')](handleEntityNotFound(_0x159820,null))['then'](respondWithResult(_0x159820,null))[_0xdfa9('0x4d')](handleError(_0x159820,null));};exports[_0xdfa9('0x53')]=function(_0x4e43b9,_0x2120d4,_0x403a54){return db[_0xdfa9('0x35')][_0xdfa9('0x52')]({'where':{'id':_0x4e43b9[_0xdfa9('0x4f')]['id']},'attributes':[_0xdfa9('0x32'),_0xdfa9('0x6')],'raw':!![]})[_0xdfa9('0x2b')](handleEntityNotFound(_0x2120d4,null))[_0xdfa9('0x2b')](function(_0x320a89){if(_0x320a89){var _0x55b85b=path['join'](config[_0xdfa9('0x54')],'server/files/plugins',util[_0xdfa9('0x55')](_0xdfa9('0x56'),path[_0xdfa9('0x57')](_0x320a89[_0xdfa9('0x6')])));var _0x51bd82=fs[_0xdfa9('0x58')](_0x55b85b);var _0x1513b2=archiver(_0xdfa9('0x59'),{'zlib':{'level':0x9}});_0x1513b2['on'](_0xdfa9('0x5a'),function(_0x437c06){if(_0x437c06[_0xdfa9('0x5b')]===_0xdfa9('0x5c')){logger[_0xdfa9('0x30')](_0x437c06);}else{throw new db['Sequelize']['Error'](_0xdfa9('0x5d'));}});_0x1513b2['on'](_0xdfa9('0x30'),function(_0x33d36a){throw new db['Sequelize'][(_0xdfa9('0x5e'))](_0xdfa9('0x5d'));});_0x1513b2[_0xdfa9('0x5f')](_0x51bd82);_0x1513b2[_0xdfa9('0x60')](_0xdfa9('0x61'),{'cwd':path[_0xdfa9('0x62')](config[_0xdfa9('0x54')],_0xdfa9('0x63'),path['dirname'](_0x320a89['path'])),'ignore':[path[_0xdfa9('0x62')](path[_0xdfa9('0x57')](_0x320a89[_0xdfa9('0x6')]),_0xdfa9('0x64')),path[_0xdfa9('0x62')](path[_0xdfa9('0x57')](_0x320a89[_0xdfa9('0x6')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x51bd82['on'](_0xdfa9('0x65'),function(){if(!fs[_0xdfa9('0x66')](_0x55b85b)){throw new db['Sequelize'][(_0xdfa9('0x5e'))](_0xdfa9('0x67'));}return _0x2120d4[_0xdfa9('0x53')](_0x55b85b,util[_0xdfa9('0x55')]('%s.zip',path[_0xdfa9('0x57')](_0x320a89['path'])),function(_0x335892){if(_0x335892){throw new db[(_0xdfa9('0x68'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x55b85b);logger['info'](_0xdfa9('0x69'));logger[_0xdfa9('0x6a')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x2120d4,null));};exports[_0xdfa9('0x6b')]=function(_0x5511be,_0xe6114f,_0x5d7d85){var _0x299a0c=path['basename'](_0x5511be['file'][_0xdfa9('0x6c')],path[_0xdfa9('0x6d')](_0x5511be['file'][_0xdfa9('0x6c')]));var _0x58b5ad=path['join'](config['root'],'server/files/plugins',_0x5511be[_0xdfa9('0x6e')][_0xdfa9('0x6c')]);var _0x4ce98b=path['join'](config[_0xdfa9('0x54')],_0xdfa9('0x63'),_0x299a0c);logger[_0xdfa9('0x6a')](_0xdfa9('0x6f'),_0x58b5ad);logger[_0xdfa9('0x6a')](_0xdfa9('0x70'),_0x4ce98b);try{fs[_0xdfa9('0x71')](_0x58b5ad,parseInt(_0xdfa9('0x72'),0x8));extract(_0x58b5ad,{'dir':_0x4ce98b},function(_0x58ccd5){if(_0x58ccd5){logger[_0xdfa9('0x30')](_0x58ccd5);handleError(_0x58ccd5,!![]);};var _0x478c5b=fs[_0xdfa9('0x73')](_0x4ce98b);if(_0x478c5b['length']>0x1){removeReferences(_0x58b5ad,_0x4ce98b);logger[_0xdfa9('0x30')](_0xdfa9('0x74'));return _0x5d7d85(new Error('Invalid\x20plugin\x20structure'));}var _0x2fd651=fs[_0xdfa9('0x75')](path['join'](_0x4ce98b,_0x478c5b[0x0]));if(_0x2fd651[_0xdfa9('0x76')]()){removeReferences(_0x58b5ad,_0x4ce98b);logger['error'](_0xdfa9('0x74'));return _0x5d7d85(new Error('Invalid\x20plugin\x20structure'));}if(_0x2fd651[_0xdfa9('0x77')]()){var _0x178226=fs['readdirSync'](path['join'](_0x4ce98b,_0x478c5b[0x0]));if(_0x178226['length']===0x0){removeReferences(_0x58b5ad,_0x4ce98b);logger[_0xdfa9('0x30')](_0xdfa9('0x74'));return _0x5d7d85(new Error(_0xdfa9('0x74')));}var _0xc37d1a=_0x178226[_0xdfa9('0x78')](function(_0xd21770){return _0xd21770==='manifest.json';});if(!_0xc37d1a){return _0x5d7d85(new Error(_0xdfa9('0x79')));}var _0x430f4d=fs[_0xdfa9('0x7a')](path[_0xdfa9('0x62')](_0x4ce98b,_0x478c5b[0x0],_0xdfa9('0x7b')));var _0x2978bd=JSON[_0xdfa9('0x7c')](_0x430f4d);if('undefined'==typeof _0x2978bd[_0xdfa9('0x32')]){return _0x5d7d85(new Error(_0xdfa9('0x7d')));}if(_0xdfa9('0x23')==typeof _0x2978bd['type']){return _0x5d7d85(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xdfa9('0x23')==typeof _0x2978bd[_0xdfa9('0x7e')]){return _0x5d7d85(new Error(_0xdfa9('0x7f')));}if('undefined'==typeof _0x2978bd['parameters']){return _0x5d7d85(new Error(_0xdfa9('0x80')));}if(_0x2978bd[_0xdfa9('0x38')]===_0xdfa9('0x81')){if('undefined'==typeof _0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x83')]){return _0x5d7d85(new Error(_0xdfa9('0x84')));}if(_0xdfa9('0x23')==typeof _0x2978bd[_0xdfa9('0x82')]['views']['admin']&&_0xdfa9('0x23')==typeof _0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x83')][_0xdfa9('0x85')]){return _0x5d7d85(new Error(_0xdfa9('0x86')));}}else if(_0x2978bd['type']==='script'){if('undefined'==typeof _0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x87')]){return _0x5d7d85(new Error(_0xdfa9('0x88')));}if(_0xdfa9('0x23')==typeof _0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x89')]){return _0x5d7d85(new Error(_0xdfa9('0x8a')));}}else{return _0x5d7d85(new Error(_0xdfa9('0x8b')));}var _0x2ed047=_0x2978bd[_0xdfa9('0x32')];var _0x29d378=_0x2978bd[_0xdfa9('0x8c')];var _0xc3ae78=_0x2978bd['type'];var _0x3af923=_0x2978bd[_0xdfa9('0x8d')]?_0x2978bd[_0xdfa9('0x8d')]:'always';var _0x539e0a=_0x2978bd[_0xdfa9('0x8e')]?_0x2978bd['icon']:_0xdfa9('0x8f');var _0x565347='';var _0x290304='';var _0xa49759='';var _0x26f21a='';var _0x465d0f=_0x2978bd[_0xdfa9('0x7e')];if(_0xc3ae78==='html'){if(_0xdfa9('0x23')!=typeof _0x2978bd[_0xdfa9('0x82')]['views']['admin']){var _0x55fded=_0x2978bd['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdfa9('0x90')](_0x55fded)){_0x565347=path[_0xdfa9('0x62')](_0xdfa9('0x91'),_0x299a0c,_0x478c5b[0x0],_0x55fded);}else{_0x565347=_0x55fded;}}else{logger['info'](_0xdfa9('0x92'));}if(_0xdfa9('0x23')!=typeof _0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x83')]['agent']){var _0x10d528=_0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xdfa9('0x90')](_0x10d528)){_0x290304=path[_0xdfa9('0x62')](_0xdfa9('0x91'),_0x299a0c,_0x478c5b[0x0],_0x10d528);}else{_0x290304=_0x10d528;}}else{logger[_0xdfa9('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xc3ae78===_0xdfa9('0x93')){_0xa49759=_0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x87')];_0x26f21a=_0x2978bd['parameters']['scriptPath'];if(_0xdfa9('0x23')!=typeof _0x2978bd[_0xdfa9('0x82')]['views']){if(_0xdfa9('0x23')!=typeof _0x2978bd['parameters'][_0xdfa9('0x83')][_0xdfa9('0x94')]){var _0x55fded=_0x2978bd[_0xdfa9('0x82')][_0xdfa9('0x83')][_0xdfa9('0x94')];if(!/^(f|ht)tps?:\/\//i[_0xdfa9('0x90')](_0x55fded)){_0x565347=path[_0xdfa9('0x62')](_0xdfa9('0x91'),_0x299a0c,_0x478c5b[0x0],_0x55fded);}else{_0x565347=_0x55fded;}}if(_0xdfa9('0x23')!=typeof _0x2978bd['parameters'][_0xdfa9('0x83')]['agent']){var _0x10d528=_0x2978bd['parameters'][_0xdfa9('0x83')][_0xdfa9('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xdfa9('0x90')](_0x10d528)){_0x290304=path[_0xdfa9('0x62')](_0xdfa9('0x91'),_0x299a0c,_0x478c5b[0x0],_0x10d528);}else{_0x290304=_0x10d528;}}}}var _0x57edbe={'name':_0x2ed047,'description':_0x29d378,'path':path[_0xdfa9('0x62')](_0x299a0c,_0x478c5b[0x0]),'type':_0xc3ae78,'sidebar':_0x3af923,'icon':_0x539e0a,'adminUrl':_0x565347,'agentUrl':_0x290304,'scriptName':_0xa49759,'scriptPath':_0x26f21a,'version':_0x465d0f};removeReferences(_0x58b5ad,null);return db[_0xdfa9('0x35')][_0xdfa9('0x95')](_0x57edbe)['then'](function(_0x1b9db1){var _0x1da07d={'role':_0x5511be['body']['role'],'userProfileId':_0x5511be[_0xdfa9('0x96')]['userProfileId']};if(!_0x1da07d)throw new Error(_0xdfa9('0x97'));if(_0x1da07d[_0xdfa9('0x98')]==='user'){var _0x1ffc8b=_0x1b9db1[_0xdfa9('0x2d')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x1da07d[_0xdfa9('0x99')]},'raw':!![]})[_0xdfa9('0x2b')](function(_0xfbfbd0){if(_0xfbfbd0&&_0xfbfbd0[_0xdfa9('0x9a')]===0x0){return db[_0xdfa9('0x2f')][_0xdfa9('0x95')]({'name':_0x1ffc8b[_0xdfa9('0x32')],'resourceId':_0x1ffc8b['id'],'type':_0xfbfbd0[_0xdfa9('0x32')],'sectionId':_0xfbfbd0['id']},{})[_0xdfa9('0x2b')](function(){return _0x1b9db1;});}else{return _0x1b9db1;}})[_0xdfa9('0x4d')](function(_0x3af805){logger[_0xdfa9('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3af805);throw _0x3af805;});}return _0x1b9db1;})[_0xdfa9('0x2b')](respondWithResult(_0xe6114f,null))[_0xdfa9('0x4d')](handleError(_0xe6114f,null));}});}catch(_0x15302c){_0xe6114f[_0xdfa9('0x20')](0x1f4)[_0xdfa9('0x33')](_0x15302c);}};function removeReferences(_0x518e08,_0x54ed25){try{if(_0x518e08){fs[_0xdfa9('0x9b')](_0x518e08);logger[_0xdfa9('0x6a')](_0xdfa9('0x9c'));}if(_0x54ed25){rimraf(_0x54ed25,function(){});logger[_0xdfa9('0x6a')](_0xdfa9('0x9d'));}}catch(_0x2fea38){logger[_0xdfa9('0x30')](_0x2fea38);}}exports[_0xdfa9('0x2a')]=function(_0x3e3490,_0x5a794d,_0x506433){return db[_0xdfa9('0x35')][_0xdfa9('0x52')]({'where':{'id':_0x3e3490[_0xdfa9('0x4f')]['id']}})[_0xdfa9('0x2b')](handleEntityNotFound(_0x5a794d,null))['then'](saveUpdates(_0x3e3490[_0xdfa9('0x96')],null))[_0xdfa9('0x2b')](respondWithResult(_0x5a794d,null))['catch'](handleError(_0x5a794d,null));};exports[_0xdfa9('0x9e')]=function(_0xc4a27b,_0x1936d8,_0x2efdba){return db['Plugin']['find']({'where':{'id':_0xc4a27b[_0xdfa9('0x4f')]['id']}})[_0xdfa9('0x2b')](function(_0x3e19a3){if(_0x3e19a3){return _0x3e19a3[_0xdfa9('0x2c')]();}})[_0xdfa9('0x2b')](function(_0x40a778){rimraf(path['join'](config[_0xdfa9('0x54')],_0xdfa9('0x63'),path[_0xdfa9('0x9f')](_0x40a778['path'])),function(){});return _0x40a778;})['then'](handleEntityNotFound(_0x1936d8,null))[_0xdfa9('0x2b')](respondWithStatusCode(_0x1936d8,null))['catch'](handleError(_0x1936d8,null));};exports[_0xdfa9('0xa0')]=function(_0x5a1901,_0x3322d7,_0xf24db8){return BPromise[_0xdfa9('0xa1')]()[_0xdfa9('0x2b')](function(){if(!_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0x6')]){throw new Error(_0xdfa9('0xa2'));}if(!_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x234c0b=_0x5a1901['query'][_0xdfa9('0xa4')]?_0x5a1901['query'][_0xdfa9('0xa4')]+':'+_0x5a1901['query'][_0xdfa9('0xa3')]:'http://localhost:'+_0x5a1901[_0xdfa9('0x3a')]['port'];var _0x573059=_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0x21')]?_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0x21')]:!![];var _0x60198f=_0x5a1901['query']['encoding']?_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0xa5')]:null;var _0x45fbb8={'method':_0x5a1901['method'],'uri':util[_0xdfa9('0x55')]('%s%s',_0x234c0b,_0x5a1901['query'][_0xdfa9('0x6')]),'json':_0x573059,'resolveWithFullResponse':!![],'encoding':_0x60198f,'qs':_0x5a1901['query']};if(_0x5a1901[_0xdfa9('0xa6')]){_0x45fbb8[_0xdfa9('0xa6')]=_0x5a1901[_0xdfa9('0xa6')];if(_0x45fbb8[_0xdfa9('0xa6')][_0xdfa9('0xa7')]){delete _0x45fbb8[_0xdfa9('0xa6')]['content-length'];}}if(_0x45fbb8['headers'][_0xdfa9('0xa8')]){delete _0x45fbb8[_0xdfa9('0xa6')][_0xdfa9('0xa8')];}return rp(_0x45fbb8);})[_0xdfa9('0x2b')](function(_0x55eb49){if(_0x55eb49){_0x3322d7['set'](_0x55eb49['headers']);logger[_0xdfa9('0x6a')](_0x55eb49[_0xdfa9('0x96')]);if(_[_0xdfa9('0xa9')](_0x5a1901[_0xdfa9('0x3a')][_0xdfa9('0x6')],_0xdfa9('0x53'))&&_0x55eb49['statusCode']==0x1f4){return _0x3322d7[_0xdfa9('0x1e')](_0x55eb49[_0xdfa9('0xaa')]);}else{return _0x3322d7[_0xdfa9('0x20')](_0x55eb49[_0xdfa9('0xaa')])[_0xdfa9('0x33')](_0x55eb49[_0xdfa9('0x96')]);}}else{return _0x3322d7[_0xdfa9('0x1e')](0xc8);}})[_0xdfa9('0x4d')](handleError(_0x3322d7,null));};exports['webhookPost']=function(_0x359585,_0x5e1eb2,_0x58fac9){return BPromise[_0xdfa9('0xa1')]()[_0xdfa9('0x2b')](function(){if(!_0x359585[_0xdfa9('0x3a')][_0xdfa9('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x359585[_0xdfa9('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x19ccc6=_0x359585[_0xdfa9('0x3a')][_0xdfa9('0xa4')]?_0x359585[_0xdfa9('0x3a')][_0xdfa9('0xa4')]+':'+_0x359585['query'][_0xdfa9('0xa3')]:_0xdfa9('0xab')+_0x359585['query'][_0xdfa9('0xa3')];var _0x5db0b3=_0x359585['query'][_0xdfa9('0x21')]?_0x359585['query']['json']:!![];var _0xcdebd6=_0x359585['query'][_0xdfa9('0xa5')]?_0x359585[_0xdfa9('0x3a')][_0xdfa9('0xa5')]:null;var _0x5d4595={'method':_0x359585[_0xdfa9('0xac')],'uri':util[_0xdfa9('0x55')]('%s%s',_0x19ccc6,_0x359585['query'][_0xdfa9('0x6')]),'json':_0x5db0b3,'resolveWithFullResponse':!![],'encoding':_0xcdebd6,'body':_0x359585[_0xdfa9('0x96')]};if(_0x359585[_0xdfa9('0xa6')]){_0x5d4595['headers']=_0x359585[_0xdfa9('0xa6')];if(_0x5d4595['headers'][_0xdfa9('0xa7')]){delete _0x5d4595[_0xdfa9('0xa6')][_0xdfa9('0xa7')];}}if(_0x5d4595[_0xdfa9('0xa6')][_0xdfa9('0xa8')]){delete _0x5d4595[_0xdfa9('0xa6')][_0xdfa9('0xa8')];}return rp(_0x5d4595);})[_0xdfa9('0x2b')](function(_0x16dadc){if(_0x16dadc){_0x5e1eb2[_0xdfa9('0x26')](_0x16dadc[_0xdfa9('0xa6')]);logger[_0xdfa9('0x6a')](_0x16dadc['body']);return _0x5e1eb2['status'](_0x16dadc[_0xdfa9('0xaa')])['send'](_0x16dadc[_0xdfa9('0x96')]);}else{return _0x5e1eb2[_0xdfa9('0x1e')](0xc8);}})[_0xdfa9('0x4d')](handleError(_0x5e1eb2,null));};
\ No newline at end of file
+var _0x39e4=['Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','register','status','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','sendStatus','error','name','send','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','params','length','find','download','join','root','format','%s.zip','createWriteStream','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','basename','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s'];(function(_0x45191d,_0x44c31d){var _0x57ef7b=function(_0x54c357){while(--_0x54c357){_0x45191d['push'](_0x45191d['shift']());}};_0x57ef7b(++_0x44c31d);}(_0x39e4,0xe7));var _0x439e=function(_0x54c7e0,_0x2dc77b){_0x54c7e0=_0x54c7e0-0x0;var _0x412643=_0x39e4[_0x54c7e0];return _0x412643;};'use strict';var emlformat=require(_0x439e('0x0'));var rimraf=require(_0x439e('0x1'));var zipdir=require(_0x439e('0x2'));var jsonpatch=require(_0x439e('0x3'));var rp=require(_0x439e('0x4'));var moment=require(_0x439e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x439e('0x6'));var util=require(_0x439e('0x7'));var path=require(_0x439e('0x8'));var sox=require(_0x439e('0x9'));var csv=require('to-csv');var ejs=require(_0x439e('0xa'));var fs=require('fs');var fs_extra=require(_0x439e('0xb'));var _=require('lodash');var squel=require(_0x439e('0xc'));var crypto=require(_0x439e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x439e('0xe'));var querystring=require(_0x439e('0xf'));var Papa=require(_0x439e('0x10'));var extract=require(_0x439e('0x11'));var rimraf=require(_0x439e('0x1'));var archiver=require(_0x439e('0x12'));var Redis=require(_0x439e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x439e('0x14'));var as=require(_0x439e('0x15'));var hardwareService=require(_0x439e('0x16'));var logger=require(_0x439e('0x17'))(_0x439e('0x18'));var utils=require(_0x439e('0x19'));var config=require(_0x439e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x439e('0x1b'))['db'];config['redis']=_[_0x439e('0x1c')](config['redis'],{'host':_0x439e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x439e('0x1e')]));require('./plugin.socket')[_0x439e('0x1f')](socket);function respondWithStatusCode(_0x3b6754,_0x2da1b7){_0x2da1b7=_0x2da1b7||0xcc;return function(_0x763bff){if(_0x763bff){return _0x3b6754['sendStatus'](_0x2da1b7);}return _0x3b6754[_0x439e('0x20')](_0x2da1b7)[_0x439e('0x21')]();};}function respondWithResult(_0x4d70c8,_0x519c19){_0x519c19=_0x519c19||0xc8;return function(_0x50980f){if(_0x50980f){return _0x4d70c8[_0x439e('0x20')](_0x519c19)[_0x439e('0x22')](_0x50980f);}};}function respondWithFilteredResult(_0x1f53fb,_0x3a191e){return function(_0x513186){if(_0x513186){var _0x4205d7=typeof _0x3a191e['offset']===_0x439e('0x23')&&typeof _0x3a191e['limit']===_0x439e('0x23');var _0x18db84=_0x513186[_0x439e('0x24')];var _0x514643=_0x4205d7?0x0:_0x3a191e[_0x439e('0x25')];var _0x277fff=_0x4205d7?_0x513186[_0x439e('0x24')]:_0x3a191e[_0x439e('0x25')]+_0x3a191e[_0x439e('0x26')];var _0x36a72d;if(_0x277fff>=_0x18db84){_0x277fff=_0x18db84;_0x36a72d=0xc8;}else{_0x36a72d=0xce;}_0x1f53fb[_0x439e('0x20')](_0x36a72d);return _0x1f53fb['set']('Content-Range',_0x514643+'-'+_0x277fff+'/'+_0x18db84)[_0x439e('0x22')](_0x513186);}return null;};}function patchUpdates(_0x107bdf){return function(_0x5b0538){try{jsonpatch[_0x439e('0x27')](_0x5b0538,_0x107bdf,!![]);}catch(_0x40e570){return BPromise[_0x439e('0x28')](_0x40e570);}return _0x5b0538[_0x439e('0x29')]();};}function saveUpdates(_0x33b4a6,_0x38a5b8){return function(_0x399c95){if(_0x399c95){return _0x399c95[_0x439e('0x2a')](_0x33b4a6)['then'](function(_0x46e101){return _0x46e101;});}return null;};}function removeEntity(_0x250636,_0x54e75d){return function(_0x2ecc24){if(_0x2ecc24){return _0x2ecc24[_0x439e('0x2b')]()[_0x439e('0x2c')](function(){var _0x30ed9e=_0x2ecc24[_0x439e('0x2d')]({'plain':!![]});var _0x3584e0=_0x439e('0x2e');return db[_0x439e('0x2f')][_0x439e('0x2b')]({'where':{'type':_0x3584e0,'resourceId':_0x30ed9e['id']}})[_0x439e('0x2c')](function(){return _0x2ecc24;});})[_0x439e('0x2c')](function(){_0x250636[_0x439e('0x20')](0xcc)[_0x439e('0x21')]();});}};}function handleEntityNotFound(_0x4c30cd,_0x38bf75){return function(_0x239cf3){if(!_0x239cf3){_0x4c30cd[_0x439e('0x30')](0x194);}return _0x239cf3;};}function handleError(_0x37904f,_0x4e7957){_0x4e7957=_0x4e7957||0x1f4;return function(_0x3f20e8){logger[_0x439e('0x31')](_0x3f20e8['stack']);if(_0x3f20e8[_0x439e('0x32')]){delete _0x3f20e8['name'];}_0x37904f[_0x439e('0x20')](_0x4e7957)[_0x439e('0x33')](_0x3f20e8);};}exports['index']=function(_0x2a9ad0,_0x3c5eb4){var _0x1677a3={},_0x3c346a={},_0x4b5fed={'count':0x0,'rows':[]};var _0x33e508=_['map'](db[_0x439e('0x34')][_0x439e('0x35')],function(_0x324fdc){return{'name':_0x324fdc[_0x439e('0x36')],'type':_0x324fdc[_0x439e('0x37')][_0x439e('0x38')]};});_0x3c346a[_0x439e('0x39')]=_[_0x439e('0x3a')](_0x33e508,_0x439e('0x32'));_0x3c346a[_0x439e('0x3b')]=_[_0x439e('0x3c')](_0x2a9ad0[_0x439e('0x3b')]);_0x3c346a['filters']=_[_0x439e('0x3d')](_0x3c346a[_0x439e('0x39')],_0x3c346a[_0x439e('0x3b')]);_0x1677a3['attributes']=_['intersection'](_0x3c346a[_0x439e('0x39')],qs['fields'](_0x2a9ad0['query'][_0x439e('0x3e')]));_0x1677a3[_0x439e('0x3f')]=_0x1677a3[_0x439e('0x3f')]['length']?_0x1677a3[_0x439e('0x3f')]:_0x3c346a[_0x439e('0x39')];if(!_0x2a9ad0['query'][_0x439e('0x40')](_0x439e('0x41'))){_0x1677a3[_0x439e('0x26')]=qs[_0x439e('0x26')](_0x2a9ad0[_0x439e('0x3b')][_0x439e('0x26')]);_0x1677a3[_0x439e('0x25')]=qs[_0x439e('0x25')](_0x2a9ad0[_0x439e('0x3b')][_0x439e('0x25')]);}_0x1677a3[_0x439e('0x42')]=qs[_0x439e('0x43')](_0x2a9ad0[_0x439e('0x3b')]['sort']);_0x1677a3[_0x439e('0x44')]=qs['filters'](_[_0x439e('0x45')](_0x2a9ad0[_0x439e('0x3b')],_0x3c346a[_0x439e('0x46')]),_0x33e508);if(_0x2a9ad0[_0x439e('0x3b')][_0x439e('0x47')]){_0x1677a3[_0x439e('0x44')]=_[_0x439e('0x48')](_0x1677a3[_0x439e('0x44')],{'$or':_[_0x439e('0x3a')](_0x33e508,function(_0x51a9bc){if(_0x51a9bc[_0x439e('0x37')]!=='VIRTUAL'){var _0x57f6c6={};_0x57f6c6[_0x51a9bc['name']]={'$like':'%'+_0x2a9ad0[_0x439e('0x3b')][_0x439e('0x47')]+'%'};return _0x57f6c6;}})});}_0x1677a3=_[_0x439e('0x48')]({},_0x1677a3,_0x2a9ad0[_0x439e('0x49')]);var _0x3dbe4f={'where':_0x1677a3[_0x439e('0x44')]};return db[_0x439e('0x34')][_0x439e('0x24')](_0x3dbe4f)[_0x439e('0x2c')](function(_0x3d08c0){_0x4b5fed['count']=_0x3d08c0;if(_0x2a9ad0['query'][_0x439e('0x4a')]){_0x1677a3[_0x439e('0x4b')]=[{'all':!![]}];}return db[_0x439e('0x34')][_0x439e('0x4c')](_0x1677a3);})[_0x439e('0x2c')](function(_0x38365b){_0x4b5fed['rows']=_0x38365b;return _0x4b5fed;})[_0x439e('0x2c')](respondWithFilteredResult(_0x3c5eb4,_0x1677a3))['catch'](handleError(_0x3c5eb4,null));};exports[_0x439e('0x4d')]=function(_0x151373,_0x4a7604){var _0x95d698={'raw':!![],'where':{'id':_0x151373[_0x439e('0x4e')]['id']}},_0x1b8977={};_0x1b8977[_0x439e('0x39')]=_[_0x439e('0x3c')](db[_0x439e('0x34')][_0x439e('0x35')]);_0x1b8977['query']=_['keys'](_0x151373['query']);_0x1b8977[_0x439e('0x46')]=_[_0x439e('0x3d')](_0x1b8977[_0x439e('0x39')],_0x1b8977['query']);_0x95d698['attributes']=_[_0x439e('0x3d')](_0x1b8977['model'],qs[_0x439e('0x3e')](_0x151373[_0x439e('0x3b')]['fields']));_0x95d698['attributes']=_0x95d698[_0x439e('0x3f')][_0x439e('0x4f')]?_0x95d698[_0x439e('0x3f')]:_0x1b8977[_0x439e('0x39')];if(_0x151373[_0x439e('0x3b')][_0x439e('0x4a')]){_0x95d698[_0x439e('0x4b')]=[{'all':!![]}];}_0x95d698=_[_0x439e('0x48')]({},_0x95d698,_0x151373[_0x439e('0x49')]);return db[_0x439e('0x34')][_0x439e('0x50')](_0x95d698)[_0x439e('0x2c')](handleEntityNotFound(_0x4a7604,null))[_0x439e('0x2c')](respondWithResult(_0x4a7604,null))['catch'](handleError(_0x4a7604,null));};exports[_0x439e('0x51')]=function(_0x3f01b9,_0x3e8ca7,_0xab6d8b){return db['Plugin'][_0x439e('0x50')]({'where':{'id':_0x3f01b9[_0x439e('0x4e')]['id']},'attributes':['name',_0x439e('0x8')],'raw':!![]})[_0x439e('0x2c')](handleEntityNotFound(_0x3e8ca7,null))[_0x439e('0x2c')](function(_0x538df7){if(_0x538df7){var _0x34e31a=path[_0x439e('0x52')](config[_0x439e('0x53')],'server/files/plugins',util[_0x439e('0x54')](_0x439e('0x55'),path['basename'](_0x538df7[_0x439e('0x8')])));var _0x29c060=fs[_0x439e('0x56')](_0x34e31a);var _0xb34d5d=archiver('zip',{'zlib':{'level':0x9}});_0xb34d5d['on'](_0x439e('0x57'),function(_0x2caebe){if(_0x2caebe[_0x439e('0x58')]==='ENOENT'){logger[_0x439e('0x31')](_0x2caebe);}else{throw new db['Sequelize'][(_0x439e('0x59'))](_0x439e('0x5a'));}});_0xb34d5d['on'](_0x439e('0x31'),function(_0x49e995){throw new db[(_0x439e('0x5b'))][(_0x439e('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xb34d5d[_0x439e('0x5c')](_0x29c060);_0xb34d5d[_0x439e('0x5d')](_0x439e('0x5e'),{'cwd':path[_0x439e('0x52')](config[_0x439e('0x53')],_0x439e('0x5f'),path[_0x439e('0x60')](_0x538df7[_0x439e('0x8')])),'ignore':[path[_0x439e('0x52')](path['basename'](_0x538df7['path']),_0x439e('0x61')),path['join'](path[_0x439e('0x62')](_0x538df7[_0x439e('0x8')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x29c060['on'](_0x439e('0x63'),function(){if(!fs['existsSync'](_0x34e31a)){throw new db[(_0x439e('0x5b'))]['Error'](_0x439e('0x64'));}return _0x3e8ca7['download'](_0x34e31a,util[_0x439e('0x54')]('%s.zip',path[_0x439e('0x62')](_0x538df7[_0x439e('0x8')])),function(_0x49e646){if(_0x49e646){throw new db[(_0x439e('0x5b'))]['Error'](_0x439e('0x65'));}fs['unlinkSync'](_0x34e31a);logger[_0x439e('0x66')](_0x439e('0x67'));logger[_0x439e('0x66')](_0x439e('0x68'));});});}return null;})[_0x439e('0x69')](handleError(_0x3e8ca7,null));};exports[_0x439e('0x6a')]=function(_0x392350,_0x47364b,_0x1553d9){var _0x336ca1=path[_0x439e('0x62')](_0x392350[_0x439e('0x6b')][_0x439e('0x6c')],path[_0x439e('0x6d')](_0x392350[_0x439e('0x6b')][_0x439e('0x6c')]));var _0x3d4884=path[_0x439e('0x52')](config[_0x439e('0x53')],'server/files/plugins',_0x392350[_0x439e('0x6b')][_0x439e('0x6c')]);var _0x260d4b=path[_0x439e('0x52')](config['root'],_0x439e('0x5f'),_0x336ca1);logger[_0x439e('0x66')](_0x439e('0x6e'),_0x3d4884);logger['info'](_0x439e('0x6f'),_0x260d4b);try{fs['chmodSync'](_0x3d4884,parseInt(_0x439e('0x70'),0x8));extract(_0x3d4884,{'dir':_0x260d4b},function(_0x1c2fa4){if(_0x1c2fa4){logger[_0x439e('0x31')](_0x1c2fa4);handleError(_0x1c2fa4,!![]);};var _0x13383a=fs[_0x439e('0x71')](_0x260d4b);if(_0x13383a[_0x439e('0x4f')]>0x1){removeReferences(_0x3d4884,_0x260d4b);logger['error']('Invalid\x20plugin\x20structure');return _0x1553d9(new Error(_0x439e('0x72')));}var _0x31bb06=fs['lstatSync'](path[_0x439e('0x52')](_0x260d4b,_0x13383a[0x0]));if(_0x31bb06['isFile']()){removeReferences(_0x3d4884,_0x260d4b);logger['error'](_0x439e('0x72'));return _0x1553d9(new Error(_0x439e('0x72')));}if(_0x31bb06[_0x439e('0x73')]()){var _0x3231a2=fs[_0x439e('0x71')](path['join'](_0x260d4b,_0x13383a[0x0]));if(_0x3231a2[_0x439e('0x4f')]===0x0){removeReferences(_0x3d4884,_0x260d4b);logger[_0x439e('0x31')]('Invalid\x20plugin\x20structure');return _0x1553d9(new Error(_0x439e('0x72')));}var _0x301011=_0x3231a2[_0x439e('0x74')](function(_0x3825f7){return _0x3825f7==='manifest.json';});if(!_0x301011){return _0x1553d9(new Error(_0x439e('0x75')));}var _0x23b386=fs[_0x439e('0x76')](path[_0x439e('0x52')](_0x260d4b,_0x13383a[0x0],_0x439e('0x77')));var _0x115cd7=JSON['parse'](_0x23b386);if(_0x439e('0x23')==typeof _0x115cd7[_0x439e('0x32')]){return _0x1553d9(new Error(_0x439e('0x78')));}if(_0x439e('0x23')==typeof _0x115cd7[_0x439e('0x37')]){return _0x1553d9(new Error(_0x439e('0x79')));}if('undefined'==typeof _0x115cd7[_0x439e('0x7a')]){return _0x1553d9(new Error(_0x439e('0x7b')));}if('undefined'==typeof _0x115cd7[_0x439e('0x7c')]){return _0x1553d9(new Error(_0x439e('0x7d')));}if(_0x115cd7['type']===_0x439e('0x7e')){if(_0x439e('0x23')==typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')]){return _0x1553d9(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x439e('0x23')==typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x80')]&&'undefined'==typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x81')]){return _0x1553d9(new Error(_0x439e('0x82')));}}else if(_0x115cd7[_0x439e('0x37')]===_0x439e('0x83')){if('undefined'==typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x84')]){return _0x1553d9(new Error(_0x439e('0x85')));}if(_0x439e('0x23')==typeof _0x115cd7['parameters']['scriptPath']){return _0x1553d9(new Error(_0x439e('0x86')));}}else{return _0x1553d9(new Error(_0x439e('0x87')));}var _0x45bf46=_0x115cd7[_0x439e('0x32')];var _0x3b80f9=_0x115cd7['description'];var _0x9c368d=_0x115cd7[_0x439e('0x37')];var _0x575eaa=_0x115cd7[_0x439e('0x88')]?_0x115cd7[_0x439e('0x88')]:'always';var _0x71609e=_0x115cd7[_0x439e('0x89')]?_0x115cd7[_0x439e('0x89')]:_0x439e('0x8a');var _0xd5212c='';var _0x59c98c='';var _0x1aabd4='';var _0x2bba05='';var _0x41f8c1=_0x115cd7['version'];if(_0x9c368d===_0x439e('0x7e')){if(_0x439e('0x23')!=typeof _0x115cd7[_0x439e('0x7c')]['views'][_0x439e('0x80')]){var _0x5df7d7=_0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x439e('0x8b')](_0x5df7d7)){_0xd5212c=path[_0x439e('0x52')]('plugins',_0x336ca1,_0x13383a[0x0],_0x5df7d7);}else{_0xd5212c=_0x5df7d7;}}else{logger[_0x439e('0x66')](_0x439e('0x8c'));}if('undefined'!=typeof _0x115cd7['parameters'][_0x439e('0x7f')][_0x439e('0x81')]){var _0x5c326d=_0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x439e('0x8b')](_0x5c326d)){_0x59c98c=path[_0x439e('0x52')](_0x439e('0x8d'),_0x336ca1,_0x13383a[0x0],_0x5c326d);}else{_0x59c98c=_0x5c326d;}}else{logger[_0x439e('0x66')](_0x439e('0x8e'));}}else if(_0x9c368d===_0x439e('0x83')){_0x1aabd4=_0x115cd7[_0x439e('0x7c')][_0x439e('0x84')];_0x2bba05=_0x115cd7[_0x439e('0x7c')][_0x439e('0x8f')];if(_0x439e('0x23')!=typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')]){if(_0x439e('0x23')!=typeof _0x115cd7['parameters'][_0x439e('0x7f')]['admin']){var _0x5df7d7=_0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5df7d7)){_0xd5212c=path[_0x439e('0x52')]('plugins',_0x336ca1,_0x13383a[0x0],_0x5df7d7);}else{_0xd5212c=_0x5df7d7;}}if('undefined'!=typeof _0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')]['agent']){var _0x5c326d=_0x115cd7[_0x439e('0x7c')][_0x439e('0x7f')][_0x439e('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c326d)){_0x59c98c=path[_0x439e('0x52')](_0x439e('0x8d'),_0x336ca1,_0x13383a[0x0],_0x5c326d);}else{_0x59c98c=_0x5c326d;}}}}var _0x2a151d={'name':_0x45bf46,'description':_0x3b80f9,'path':path[_0x439e('0x52')](_0x336ca1,_0x13383a[0x0]),'type':_0x9c368d,'sidebar':_0x575eaa,'icon':_0x71609e,'adminUrl':_0xd5212c,'agentUrl':_0x59c98c,'scriptName':_0x1aabd4,'scriptPath':_0x2bba05,'version':_0x41f8c1};removeReferences(_0x3d4884,null);return db['Plugin'][_0x439e('0x90')](_0x2a151d)[_0x439e('0x2c')](function(_0xc2f43d){var _0x3e9c34={'role':_0x392350['body'][_0x439e('0x91')],'userProfileId':_0x392350[_0x439e('0x92')]['userProfileId']};if(!_0x3e9c34)throw new Error(_0x439e('0x93'));if(_0x3e9c34[_0x439e('0x91')]==='user'){var _0x4a0582=_0xc2f43d[_0x439e('0x2d')]({'plain':!![]});return db[_0x439e('0x94')]['find']({'where':{'name':_0x439e('0x2e'),'userProfileId':_0x3e9c34[_0x439e('0x95')]},'raw':!![]})[_0x439e('0x2c')](function(_0x43b740){if(_0x43b740&&_0x43b740['autoAssociation']===0x0){return db[_0x439e('0x2f')][_0x439e('0x90')]({'name':_0x4a0582[_0x439e('0x32')],'resourceId':_0x4a0582['id'],'type':_0x43b740['name'],'sectionId':_0x43b740['id']},{})[_0x439e('0x2c')](function(){return _0xc2f43d;});}else{return _0xc2f43d;}})[_0x439e('0x69')](function(_0x16631e){logger[_0x439e('0x31')](_0x439e('0x96'),_0x16631e);throw _0x16631e;});}return _0xc2f43d;})['then'](respondWithResult(_0x47364b,null))[_0x439e('0x69')](handleError(_0x47364b,null));}});}catch(_0x5c6311){_0x47364b['status'](0x1f4)[_0x439e('0x33')](_0x5c6311);}};function removeReferences(_0x36da27,_0x3e2bb1){try{if(_0x36da27){fs['unlinkSync'](_0x36da27);logger['info'](_0x439e('0x97'));}if(_0x3e2bb1){rimraf(_0x3e2bb1,function(){});logger[_0x439e('0x66')](_0x439e('0x98'));}}catch(_0x564aa7){logger['error'](_0x564aa7);}}exports[_0x439e('0x2a')]=function(_0x15881d,_0x259aa6,_0x231c04){return db[_0x439e('0x34')][_0x439e('0x50')]({'where':{'id':_0x15881d[_0x439e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x259aa6,null))[_0x439e('0x2c')](saveUpdates(_0x15881d[_0x439e('0x92')],null))[_0x439e('0x2c')](respondWithResult(_0x259aa6,null))[_0x439e('0x69')](handleError(_0x259aa6,null));};exports[_0x439e('0x99')]=function(_0x5bca4a,_0x23e5e2,_0x4e372c){return db[_0x439e('0x34')][_0x439e('0x50')]({'where':{'id':_0x5bca4a[_0x439e('0x4e')]['id']}})[_0x439e('0x2c')](function(_0x22b31c){if(_0x22b31c){return _0x22b31c['destroy']();}})[_0x439e('0x2c')](function(_0x3cb8af){rimraf(path[_0x439e('0x52')](config[_0x439e('0x53')],_0x439e('0x5f'),path[_0x439e('0x60')](_0x3cb8af[_0x439e('0x8')])),function(){});return _0x3cb8af;})[_0x439e('0x2c')](handleEntityNotFound(_0x23e5e2,null))['then'](respondWithStatusCode(_0x23e5e2,null))['catch'](handleError(_0x23e5e2,null));};exports[_0x439e('0x9a')]=function(_0x5e1e83,_0x434859,_0x5c6600){return BPromise[_0x439e('0x9b')]()[_0x439e('0x2c')](function(){if(!_0x5e1e83[_0x439e('0x3b')][_0x439e('0x8')]){throw new Error(_0x439e('0x9c'));}if(!_0x5e1e83[_0x439e('0x3b')]['port']){throw new Error(_0x439e('0x9d'));}var _0x34a462=_0x5e1e83['query']['hostname']?_0x5e1e83[_0x439e('0x3b')][_0x439e('0x9e')]+':'+_0x5e1e83[_0x439e('0x3b')][_0x439e('0x9f')]:_0x439e('0xa0')+_0x5e1e83[_0x439e('0x3b')]['port'];var _0x1541b4=_0x5e1e83[_0x439e('0x3b')][_0x439e('0x22')]?_0x5e1e83['query'][_0x439e('0x22')]:!![];var _0x28ff71=_0x5e1e83[_0x439e('0x3b')][_0x439e('0xa1')]?_0x5e1e83[_0x439e('0x3b')]['encoding']:null;var _0x29d534={'method':_0x5e1e83[_0x439e('0xa2')],'uri':util[_0x439e('0x54')](_0x439e('0xa3'),_0x34a462,_0x5e1e83['query'][_0x439e('0x8')]),'json':_0x1541b4,'resolveWithFullResponse':!![],'encoding':_0x28ff71,'qs':_0x5e1e83[_0x439e('0x3b')]};if(_0x5e1e83[_0x439e('0xa4')]){_0x29d534[_0x439e('0xa4')]=_0x5e1e83[_0x439e('0xa4')];if(_0x29d534[_0x439e('0xa4')][_0x439e('0xa5')]){delete _0x29d534[_0x439e('0xa4')][_0x439e('0xa5')];}}if(_0x29d534['headers'][_0x439e('0xa6')]){delete _0x29d534['headers'][_0x439e('0xa6')];}return rp(_0x29d534);})[_0x439e('0x2c')](function(_0x454f0e){if(_0x454f0e){_0x434859[_0x439e('0xa7')](_0x454f0e[_0x439e('0xa4')]);logger[_0x439e('0x66')](_0x454f0e['body']);if(_[_0x439e('0xa8')](_0x5e1e83['query'][_0x439e('0x8')],_0x439e('0x51'))&&_0x454f0e['statusCode']==0x1f4){return _0x434859['sendStatus'](_0x454f0e[_0x439e('0xa9')]);}else{return _0x434859[_0x439e('0x20')](_0x454f0e[_0x439e('0xa9')])[_0x439e('0x33')](_0x454f0e[_0x439e('0x92')]);}}else{return _0x434859[_0x439e('0x30')](0xc8);}})['catch'](handleError(_0x434859,null));};exports[_0x439e('0xaa')]=function(_0x271199,_0x14c37d,_0x1abb93){return BPromise[_0x439e('0x9b')]()[_0x439e('0x2c')](function(){if(!_0x271199[_0x439e('0x3b')][_0x439e('0x8')]){throw new Error(_0x439e('0x9c'));}if(!_0x271199[_0x439e('0x3b')][_0x439e('0x9f')]){throw new Error(_0x439e('0x9d'));}var _0x538419=_0x271199['query'][_0x439e('0x9e')]?_0x271199[_0x439e('0x3b')][_0x439e('0x9e')]+':'+_0x271199['query'][_0x439e('0x9f')]:_0x439e('0xa0')+_0x271199['query'][_0x439e('0x9f')];var _0x3941d5=_0x271199[_0x439e('0x3b')][_0x439e('0x22')]?_0x271199[_0x439e('0x3b')][_0x439e('0x22')]:!![];var _0x575166=_0x271199[_0x439e('0x3b')][_0x439e('0xa1')]?_0x271199[_0x439e('0x3b')][_0x439e('0xa1')]:null;var _0x4ecc9c={'method':_0x271199['method'],'uri':util[_0x439e('0x54')](_0x439e('0xa3'),_0x538419,_0x271199['query'][_0x439e('0x8')]),'json':_0x3941d5,'resolveWithFullResponse':!![],'encoding':_0x575166,'body':_0x271199[_0x439e('0x92')]};if(_0x271199[_0x439e('0xa4')]){_0x4ecc9c[_0x439e('0xa4')]=_0x271199['headers'];if(_0x4ecc9c['headers'][_0x439e('0xa5')]){delete _0x4ecc9c[_0x439e('0xa4')][_0x439e('0xa5')];}}if(_0x4ecc9c[_0x439e('0xa4')][_0x439e('0xa6')]){delete _0x4ecc9c[_0x439e('0xa4')][_0x439e('0xa6')];}return rp(_0x4ecc9c);})[_0x439e('0x2c')](function(_0x2ea1cc){if(_0x2ea1cc){_0x14c37d[_0x439e('0xa7')](_0x2ea1cc[_0x439e('0xa4')]);logger[_0x439e('0x66')](_0x2ea1cc[_0x439e('0x92')]);return _0x14c37d[_0x439e('0x20')](_0x2ea1cc['statusCode'])[_0x439e('0x33')](_0x2ea1cc[_0x439e('0x92')]);}else{return _0x14c37d['sendStatus'](0xc8);}})[_0x439e('0x69')](handleError(_0x14c37d,null));};
\ No newline at end of file
index ad42657..9625ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d4b=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2722c7,_0x3c20f2){var _0x53d344=function(_0x4c25f1){while(--_0x4c25f1){_0x2722c7['push'](_0x2722c7['shift']());}};_0x53d344(++_0x3c20f2);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x334e54,_0x4aadf3){_0x334e54=_0x334e54-0x0;var _0x5190f8=_0x3d4b[_0x334e54];return _0x5190f8;};'use strict';var EventEmitter=require(_0xb3d4('0x0'));var Plugin=require(_0xb3d4('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xb3d4('0x2')](0x0);var events={'afterCreate':_0xb3d4('0x3'),'afterUpdate':_0xb3d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6a7869){return function(_0x1f81be,_0x19a897,_0x4242a3){PluginEvents[_0xb3d4('0x5')](_0x6a7869+':'+_0x1f81be['id'],_0x1f81be);PluginEvents[_0xb3d4('0x5')](_0x6a7869,_0x1f81be);_0x4242a3(null);};}for(var e in events){if(events[_0xb3d4('0x6')](e)){var event=events[e];Plugin[_0xb3d4('0x7')](e,emitEvent(event));}}module[_0xb3d4('0x8')]=PluginEvents;
\ No newline at end of file
+var _0x87d3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x4b6b44,_0x3e4dc6){var _0x57db3a=function(_0x354049){while(--_0x354049){_0x4b6b44['push'](_0x4b6b44['shift']());}};_0x57db3a(++_0x3e4dc6);}(_0x87d3,0x86));var _0x387d=function(_0x3e754a,_0x6d4db5){_0x3e754a=_0x3e754a-0x0;var _0x12325b=_0x87d3[_0x3e754a];return _0x12325b;};'use strict';var EventEmitter=require(_0x387d('0x0'));var Plugin=require(_0x387d('0x1'))['db'][_0x387d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x387d('0x3')](0x0);var events={'afterCreate':_0x387d('0x4'),'afterUpdate':_0x387d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x385feb){return function(_0x54c387,_0xde245d,_0x1ccfb7){PluginEvents[_0x387d('0x6')](_0x385feb+':'+_0x54c387['id'],_0x54c387);PluginEvents['emit'](_0x385feb,_0x54c387);_0x1ccfb7(null);};}for(var e in events){if(events[_0x387d('0x7')](e)){var event=events[e];Plugin[_0x387d('0x8')](e,emitEvent(event));}}module[_0x387d('0x9')]=PluginEvents;
\ No newline at end of file
index 7161352..c4a89cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb218=['request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','plugins','util','../../config/logger','api','bluebird'];(function(_0x385232,_0x431d33){var _0xf5a172=function(_0x4177d7){while(--_0x4177d7){_0x385232['push'](_0x385232['shift']());}};_0xf5a172(++_0x431d33);}(_0xb218,0x1bf));var _0x8b21=function(_0x4afd7f,_0x124b6f){_0x4afd7f=_0x4afd7f-0x0;var _0x4d1b6c=_0xb218[_0x4afd7f];return _0x4d1b6c;};'use strict';var _=require('lodash');var util=require(_0x8b21('0x0'));var logger=require(_0x8b21('0x1'))(_0x8b21('0x2'));var moment=require('moment');var BPromise=require(_0x8b21('0x3'));var rp=require(_0x8b21('0x4'));var fs=require('fs');var path=require(_0x8b21('0x5'));var rimraf=require(_0x8b21('0x6'));var config=require(_0x8b21('0x7'));var attributes=require(_0x8b21('0x8'));module[_0x8b21('0x9')]=function(_0x3bfde1,_0x5dc769){return _0x3bfde1['define']('Plugin',attributes,{'tableName':_0x8b21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8ed=['request-promise','path','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','api','moment'];(function(_0x591cb2,_0x10045b){var _0x32df21=function(_0x4f7a86){while(--_0x4f7a86){_0x591cb2['push'](_0x591cb2['shift']());}};_0x32df21(++_0x10045b);}(_0xd8ed,0xe4));var _0xdd8e=function(_0x278760,_0x2581a1){_0x278760=_0x278760-0x0;var _0x32cc73=_0xd8ed[_0x278760];return _0x32cc73;};'use strict';var _=require(_0xdd8e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdd8e('0x1'));var moment=require(_0xdd8e('0x2'));var BPromise=require('bluebird');var rp=require(_0xdd8e('0x3'));var fs=require('fs');var path=require(_0xdd8e('0x4'));var rimraf=require('rimraf');var config=require(_0xdd8e('0x5'));var attributes=require(_0xdd8e('0x6'));module[_0xdd8e('0x7')]=function(_0x22b9dd,_0x1a3e47){return _0x22b9dd[_0xdd8e('0x8')](_0xdd8e('0x9'),attributes,{'tableName':_0xdd8e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe1c6b5..ce9eafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8f2=['message','info','result','catch','CreatePlugin','Plugin','create','body','debug','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0xc8f2,0x120));var _0x2c8f=function(_0x559b54,_0x342f17){_0x559b54=_0x559b54-0x0;var _0x24dbf7=_0xc8f2[_0x559b54];return _0x24dbf7;};'use strict';var _=require(_0x2c8f('0x0'));var util=require('util');var moment=require(_0x2c8f('0x1'));var BPromise=require(_0x2c8f('0x2'));var rs=require(_0x2c8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c8f('0x4'));var logger=require(_0x2c8f('0x5'))(_0x2c8f('0x6'));var config=require(_0x2c8f('0x7'));var jayson=require(_0x2c8f('0x8'));var client=jayson[_0x2c8f('0x9')][_0x2c8f('0xa')]({'port':0x232a});config['redis']=_[_0x2c8f('0xb')](config[_0x2c8f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c8f('0xd'))(new Redis(config[_0x2c8f('0xc')]));require('./plugin.socket')[_0x2c8f('0xe')](socket);function respondWithRpcPromise(_0x4bf7cd,_0x58efbf,_0x552a7c){return new BPromise(function(_0x48ff4b,_0x3bf683){return client[_0x2c8f('0xf')](_0x4bf7cd,_0x552a7c)[_0x2c8f('0x10')](function(_0x2aaf0c){logger['info'](_0x2c8f('0x11'),_0x58efbf,_0x2c8f('0x12'));logger['debug'](_0x2c8f('0x13'),_0x58efbf,_0x2c8f('0x12'),JSON[_0x2c8f('0x14')](_0x2aaf0c));if(_0x2aaf0c['error']){if(_0x2aaf0c[_0x2c8f('0x15')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x58efbf,_0x2aaf0c[_0x2c8f('0x15')][_0x2c8f('0x16')]);return _0x3bf683(_0x2aaf0c[_0x2c8f('0x15')][_0x2c8f('0x16')]);}logger['error'](_0x2c8f('0x11'),_0x58efbf,_0x2aaf0c[_0x2c8f('0x15')]['message']);return _0x48ff4b(_0x2aaf0c['error']['message']);}else{logger[_0x2c8f('0x17')](_0x2c8f('0x11'),_0x58efbf,'request\x20sent');_0x48ff4b(_0x2aaf0c[_0x2c8f('0x18')]['message']);}})[_0x2c8f('0x19')](function(_0x2b6480){logger[_0x2c8f('0x15')](_0x2c8f('0x11'),_0x58efbf,_0x2b6480);_0x3bf683(_0x2b6480);});});}exports[_0x2c8f('0x1a')]=function(_0x4859b6){var _0x395117=this;return new Promise(function(_0x419b2f,_0xc3a2d){return db[_0x2c8f('0x1b')][_0x2c8f('0x1c')](_0x4859b6[_0x2c8f('0x1d')],{'raw':_0x4859b6['options']?_0x4859b6['options']['raw']===undefined?!![]:![]:!![]})[_0x2c8f('0x10')](function(_0xc46e89){logger[_0x2c8f('0x17')](_0x2c8f('0x1a'),_0x4859b6);logger[_0x2c8f('0x1e')]('CreatePlugin',_0x4859b6,JSON[_0x2c8f('0x14')](_0xc46e89));_0x419b2f(_0xc46e89);})[_0x2c8f('0x19')](function(_0x3d9f99){logger['error']('CreatePlugin',_0x3d9f99[_0x2c8f('0x16')],_0x4859b6);_0xc3a2d(_0x395117[_0x2c8f('0x15')](0x1f4,_0x3d9f99[_0x2c8f('0x16')]));});});};
\ No newline at end of file
+var _0x768a=['debug','request\x20sent','stringify','error','message','info','result','CreatePlugin','Plugin','create','body','options','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s'];(function(_0x249b95,_0x3a37fe){var _0x34e43b=function(_0xb6d70b){while(--_0xb6d70b){_0x249b95['push'](_0x249b95['shift']());}};_0x34e43b(++_0x3a37fe);}(_0x768a,0x10d));var _0xa768=function(_0x5d3f0e,_0x36023d){_0x5d3f0e=_0x5d3f0e-0x0;var _0x280a32=_0x768a[_0x5d3f0e];return _0x280a32;};'use strict';var _=require('lodash');var util=require(_0xa768('0x0'));var moment=require(_0xa768('0x1'));var BPromise=require(_0xa768('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa768('0x3'));var db=require(_0xa768('0x4'))['db'];var utils=require(_0xa768('0x5'));var logger=require(_0xa768('0x6'))('rpc');var config=require(_0xa768('0x7'));var jayson=require(_0xa768('0x8'));var client=jayson[_0xa768('0x9')][_0xa768('0xa')]({'port':0x232a});config[_0xa768('0xb')]=_[_0xa768('0xc')](config[_0xa768('0xb')],{'host':_0xa768('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa768('0xb')]));require(_0xa768('0xe'))[_0xa768('0xf')](socket);function respondWithRpcPromise(_0x5b5a75,_0x57cfc5,_0x1b383f){return new BPromise(function(_0x2171c7,_0x33b6b9){return client[_0xa768('0x10')](_0x5b5a75,_0x1b383f)[_0xa768('0x11')](function(_0x2c564c){logger['info'](_0xa768('0x12'),_0x57cfc5,'request\x20sent');logger[_0xa768('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x57cfc5,_0xa768('0x14'),JSON[_0xa768('0x15')](_0x2c564c));if(_0x2c564c['error']){if(_0x2c564c[_0xa768('0x16')]['code']===0x1f4){logger['error'](_0xa768('0x12'),_0x57cfc5,_0x2c564c['error']['message']);return _0x33b6b9(_0x2c564c[_0xa768('0x16')][_0xa768('0x17')]);}logger['error'](_0xa768('0x12'),_0x57cfc5,_0x2c564c[_0xa768('0x16')][_0xa768('0x17')]);return _0x2171c7(_0x2c564c['error'][_0xa768('0x17')]);}else{logger[_0xa768('0x18')]('Plugin,\x20%s,\x20%s',_0x57cfc5,_0xa768('0x14'));_0x2171c7(_0x2c564c[_0xa768('0x19')][_0xa768('0x17')]);}})['catch'](function(_0x491795){logger[_0xa768('0x16')](_0xa768('0x12'),_0x57cfc5,_0x491795);_0x33b6b9(_0x491795);});});}exports[_0xa768('0x1a')]=function(_0x17ce0b){var _0x356ac6=this;return new Promise(function(_0x2db524,_0x5199b3){return db[_0xa768('0x1b')][_0xa768('0x1c')](_0x17ce0b[_0xa768('0x1d')],{'raw':_0x17ce0b[_0xa768('0x1e')]?_0x17ce0b[_0xa768('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xa768('0x11')](function(_0x5749c2){logger[_0xa768('0x18')](_0xa768('0x1a'),_0x17ce0b);logger[_0xa768('0x13')](_0xa768('0x1a'),_0x17ce0b,JSON[_0xa768('0x15')](_0x5749c2));_0x2db524(_0x5749c2);})[_0xa768('0x1f')](function(_0x49529a){logger[_0xa768('0x16')](_0xa768('0x1a'),_0x49529a[_0xa768('0x17')],_0x17ce0b);_0x5199b3(_0x356ac6[_0xa768('0x16')](0x1f4,_0x49529a['message']));});});};
\ No newline at end of file
index 97d48bb..199dada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f4=['register','length','plugin:','./plugin.events','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf7f4,0x6b));var _0x4f7f=function(_0x4cc9eb,_0x1f596b){_0x4cc9eb=_0x4cc9eb-0x0;var _0x192fdf=_0xf7f4[_0x4cc9eb];return _0x192fdf;};'use strict';var PluginEvents=require(_0x4f7f('0x0'));var events=['save',_0x4f7f('0x1'),_0x4f7f('0x2')];function createListener(_0x351855,_0x599f33){return function(_0xcbc02){_0x599f33[_0x4f7f('0x3')](_0x351855,_0xcbc02);};}function removeListener(_0x303d6a,_0x498bec){return function(){PluginEvents[_0x4f7f('0x4')](_0x303d6a,_0x498bec);};}exports[_0x4f7f('0x5')]=function(_0x52fa7b){for(var _0x5eb377=0x0,_0x409fe2=events[_0x4f7f('0x6')];_0x5eb377<_0x409fe2;_0x5eb377++){var _0x1a0110=events[_0x5eb377];var _0x3ab064=createListener(_0x4f7f('0x7')+_0x1a0110,_0x52fa7b);PluginEvents['on'](_0x1a0110,_0x3ab064);}};
\ No newline at end of file
+var _0x72ab=['removeListener','register','plugin:','./plugin.events','remove','update','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x72ab,0x16f));var _0xb72a=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x72ab[_0x334841];return _0x5beb4b;};'use strict';var PluginEvents=require(_0xb72a('0x0'));var events=['save',_0xb72a('0x1'),_0xb72a('0x2')];function createListener(_0x5d7e0,_0x462d4b){return function(_0x36ad40){_0x462d4b[_0xb72a('0x3')](_0x5d7e0,_0x36ad40);};}function removeListener(_0x1e2a4c,_0x30946d){return function(){PluginEvents[_0xb72a('0x4')](_0x1e2a4c,_0x30946d);};}exports[_0xb72a('0x5')]=function(_0x3dfb23){for(var _0x31593e=0x0,_0x760bbd=events['length'];_0x31593e<_0x760bbd;_0x31593e++){var _0x172a49=events[_0x31593e];var _0x4e201a=createListener(_0xb72a('0x6')+_0x172a49,_0x3dfb23);PluginEvents['on'](_0x172a49,_0x4e201a);}};
\ No newline at end of file
index a0c38f8..b1b5484 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(_0x118e51,_0x3a92a3){var _0x40ed50=function(_0x2afd81){while(--_0x2afd81){_0x118e51['push'](_0x118e51['shift']());}};_0x40ed50(++_0x3a92a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x4030ee,_0x41fadd){var _0x27f309=function(_0x506771){while(--_0x506771){_0x4030ee['push'](_0x4030ee['shift']());}};_0x27f309(++_0x41fadd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 5cdc843..49f9d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','body','script','cwd','chdir','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','params','delete','dump','../../config/logger'];(function(_0x59cc0e,_0x31a716){var _0x14738f=function(_0x5c76d9){while(--_0x5c76d9){_0x59cc0e['push'](_0x59cc0e['shift']());}};_0x14738f(++_0x31a716);}(_0xa74f,0x9a));var _0xfa74=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0xa74f[_0x100682];return _0xcb6e87;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0xfa74('0x0'))('api');var path=require('path');var exec=require(_0xfa74('0x1'))[_0xfa74('0x2')];var BPromise=require(_0xfa74('0x3'));function handleEntityNotFound(_0x25a9b7,_0x5b367b){return function(_0x141625){if(!_0x141625){_0x25a9b7['sendStatus'](0x194);;}return _0x141625;};}function respondWithResult(_0x543cfe,_0x43dd2f){_0x43dd2f=_0x43dd2f||0xc8;return function(_0x9ddbd2){if(_0x9ddbd2){return _0x543cfe[_0xfa74('0x4')](_0x43dd2f)[_0xfa74('0x5')](_0x9ddbd2);}return null;};}function handleError(_0x287921,_0x344e04){_0x344e04=_0x344e04||0x1f4;return function(_0x5c0eb2){logger[_0xfa74('0x6')](_0x5c0eb2[_0xfa74('0x7')]);if(_0x5c0eb2[_0xfa74('0x8')]){delete _0x5c0eb2[_0xfa74('0x8')];}_0x287921['status'](_0x344e04)[_0xfa74('0x9')](_0x5c0eb2);};}function execChildProcess(){return new BPromise(function(_0x4f8891,_0x48695c){exec(_0xfa74('0xa'),function(_0x1d919d,_0x30b2d5,_0x307d35){logger['info'](_0x30b2d5);logger[_0xfa74('0xb')](_0x307d35);if(_0x1d919d){logger[_0xfa74('0x6')](_0x1d919d);return _0x48695c(_0x1d919d);}return _0x4f8891(_0x30b2d5);});});}exports[_0xfa74('0xc')]=function(_0x278e8b,_0x4ad407){return pm2[_0xfa74('0xd')]()[_0xfa74('0xe')](function(_0x3eb49b){if(_0x3eb49b){var _0x3947ca=_[_0xfa74('0xf')](_0x3eb49b,function(_0x47c8fb){return _0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x10')||_0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x11');});return{'rows':_0x3947ca,'count':_0x3947ca[_0xfa74('0x12')]};}return null;})[_0xfa74('0xe')](respondWithResult(_0x4ad407,null))[_0xfa74('0x13')](handleError(_0x4ad407,null));};exports['show']=function(_0x58a67a,_0xe0e33d){return pm2['describe'](_0x58a67a['params']['id'])[_0xfa74('0xe')](respondWithResult(_0xe0e33d,null))[_0xfa74('0xe')](handleEntityNotFound(_0xe0e33d,null))[_0xfa74('0x13')](handleError(_0xe0e33d,null));};exports['create']=function(_0x3bede6,_0x2edebb){if(_0x3bede6[_0xfa74('0x14')]['name']&&_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]){var _0x2e6c33=path['join'](__dirname,'../../files/plugins',_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]);var _0x9932db=process[_0xfa74('0x16')]();process[_0xfa74('0x17')](path['dirname'](_0x2e6c33));return execChildProcess()['then'](function(_0x3721bf){process['chdir'](_0x9932db);return pm2['start']({'name':_0x3bede6['body'][_0xfa74('0x8')],'script':_0x2e6c33});})[_0xfa74('0xe')](function(_0x42d9bf){pm2['dump']();return _0x42d9bf[0x0];})['then'](respondWithResult(_0x2edebb,0xc9))[_0xfa74('0x13')](handleError(_0x2edebb,null));}else{return _0x2edebb[_0xfa74('0x4')](0x1f4)['send']({'message':_0xfa74('0x18')});}};exports['update']=function(_0x1a8cf7,_0x153b2a){if(_0x1a8cf7['body']['id']){delete _0x1a8cf7[_0xfa74('0x14')]['id'];}var _0x1130de={'online':_0xfa74('0x19'),'stopped':_0xfa74('0x1a')};if(_0x1130de['hasOwnProperty'](_0x1a8cf7[_0xfa74('0x14')][_0xfa74('0x4')])){return pm2[_0x1130de[_0x1a8cf7[_0xfa74('0x14')]['status']]](_0x1a8cf7['params']['id'])[_0xfa74('0xe')](respondWithResult(_0x153b2a,0xc8))[_0xfa74('0x13')](handleError(_0x153b2a,null));}else{return _0x153b2a['status'](0x1f4)['send']({'message':_0xfa74('0x1b')});}};exports['destroy']=function(_0x2238d4,_0x4d6d0a){if(_0x2238d4[_0xfa74('0x14')]['id']){delete _0x2238d4[_0xfa74('0x14')]['id'];}if(_0x2238d4[_0xfa74('0x1c')]['id']){return pm2[_0xfa74('0x1d')](_0x2238d4['params']['id'])[_0xfa74('0xe')](function(_0x102d47){pm2[_0xfa74('0x1e')]();return _0x102d47[0x0];})[_0xfa74('0xe')](respondWithResult(_0x4d6d0a,null))[_0xfa74('0x13')](handleError(_0x4d6d0a,null));}else{return _0x4d6d0a[_0xfa74('0x4')](0x1f4)[_0xfa74('0x9')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0xbee3=['sendStatus','status','json','error','name','send','info','index','then','reject','length','describe','params','catch','create','body','join','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20id','../../config/pm2','path','child_process','bluebird'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xbee3,0xd5));var _0x3bee=function(_0x11e6f0,_0x1f9c3d){_0x11e6f0=_0x11e6f0-0x0;var _0x2eccbb=_0xbee3[_0x11e6f0];return _0x2eccbb;};'use strict';var _=require('lodash');var pm2=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var path=require(_0x3bee('0x1'));var exec=require(_0x3bee('0x2'))['exec'];var BPromise=require(_0x3bee('0x3'));function handleEntityNotFound(_0x1956c1,_0x1cf379){return function(_0x507c6a){if(!_0x507c6a){_0x1956c1[_0x3bee('0x4')](0x194);;}return _0x507c6a;};}function respondWithResult(_0x3baf77,_0x4c5ef5){_0x4c5ef5=_0x4c5ef5||0xc8;return function(_0x2fdeec){if(_0x2fdeec){return _0x3baf77[_0x3bee('0x5')](_0x4c5ef5)[_0x3bee('0x6')](_0x2fdeec);}return null;};}function handleError(_0x339223,_0xbdd5d5){_0xbdd5d5=_0xbdd5d5||0x1f4;return function(_0x9aab05){logger[_0x3bee('0x7')](_0x9aab05['stack']);if(_0x9aab05[_0x3bee('0x8')]){delete _0x9aab05[_0x3bee('0x8')];}_0x339223[_0x3bee('0x5')](_0xbdd5d5)[_0x3bee('0x9')](_0x9aab05);};}function execChildProcess(){return new BPromise(function(_0x356fef,_0xc53ada){exec('npm\x20install',function(_0x32c0b,_0x5bb283,_0x2da716){logger[_0x3bee('0xa')](_0x5bb283);logger[_0x3bee('0xa')](_0x2da716);if(_0x32c0b){logger[_0x3bee('0x7')](_0x32c0b);return _0xc53ada(_0x32c0b);}return _0x356fef(_0x5bb283);});});}exports[_0x3bee('0xb')]=function(_0x459129,_0xc8c1f0){return pm2['list']()[_0x3bee('0xc')](function(_0x33504d){if(_0x33504d){var _0x31ac52=_[_0x3bee('0xd')](_0x33504d,function(_0x3a0396){return _0x3a0396['name']==='express'||_0x3a0396[_0x3bee('0x8')]==='motion2';});return{'rows':_0x31ac52,'count':_0x31ac52[_0x3bee('0xe')]};}return null;})[_0x3bee('0xc')](respondWithResult(_0xc8c1f0,null))['catch'](handleError(_0xc8c1f0,null));};exports['show']=function(_0x1582a4,_0x36c5aa){return pm2[_0x3bee('0xf')](_0x1582a4[_0x3bee('0x10')]['id'])['then'](respondWithResult(_0x36c5aa,null))[_0x3bee('0xc')](handleEntityNotFound(_0x36c5aa,null))[_0x3bee('0x11')](handleError(_0x36c5aa,null));};exports[_0x3bee('0x12')]=function(_0x49b32d,_0x33d812){if(_0x49b32d[_0x3bee('0x13')][_0x3bee('0x8')]&&_0x49b32d['body']['script']){var _0x1afd0f=path[_0x3bee('0x14')](__dirname,'../../files/plugins',_0x49b32d[_0x3bee('0x13')][_0x3bee('0x15')]);var _0x2eea75=process[_0x3bee('0x16')]();process[_0x3bee('0x17')](path[_0x3bee('0x18')](_0x1afd0f));return execChildProcess()[_0x3bee('0xc')](function(_0x582fa9){process[_0x3bee('0x17')](_0x2eea75);return pm2[_0x3bee('0x19')]({'name':_0x49b32d[_0x3bee('0x13')][_0x3bee('0x8')],'script':_0x1afd0f});})['then'](function(_0x45249c){pm2[_0x3bee('0x1a')]();return _0x45249c[0x0];})[_0x3bee('0xc')](respondWithResult(_0x33d812,0xc9))['catch'](handleError(_0x33d812,null));}else{return _0x33d812['status'](0x1f4)[_0x3bee('0x9')]({'message':_0x3bee('0x1b')});}};exports['update']=function(_0x2c0e50,_0x1b4ce0){if(_0x2c0e50[_0x3bee('0x13')]['id']){delete _0x2c0e50['body']['id'];}var _0x1984c4={'online':_0x3bee('0x1c'),'stopped':_0x3bee('0x1d')};if(_0x1984c4['hasOwnProperty'](_0x2c0e50[_0x3bee('0x13')][_0x3bee('0x5')])){return pm2[_0x1984c4[_0x2c0e50[_0x3bee('0x13')]['status']]](_0x2c0e50[_0x3bee('0x10')]['id'])[_0x3bee('0xc')](respondWithResult(_0x1b4ce0,0xc8))[_0x3bee('0x11')](handleError(_0x1b4ce0,null));}else{return _0x1b4ce0[_0x3bee('0x5')](0x1f4)[_0x3bee('0x9')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x3fbc8c,_0x1e1529){if(_0x3fbc8c[_0x3bee('0x13')]['id']){delete _0x3fbc8c[_0x3bee('0x13')]['id'];}if(_0x3fbc8c['params']['id']){return pm2['delete'](_0x3fbc8c[_0x3bee('0x10')]['id'])[_0x3bee('0xc')](function(_0x4f5b58){pm2['dump']();return _0x4f5b58[0x0];})[_0x3bee('0xc')](respondWithResult(_0x1e1529,null))[_0x3bee('0x11')](handleError(_0x1e1529,null));}else{return _0x1e1529[_0x3bee('0x5')](0x1f4)[_0x3bee('0x9')]({'message':_0x3bee('0x1e')});}};
\ No newline at end of file
index 03f22d7..7e9cbc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd668=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./realtime.controller','isAuthenticated','getQueues','exports'];(function(_0x162232,_0x4f7f03){var _0x598128=function(_0x589a01){while(--_0x589a01){_0x162232['push'](_0x162232['shift']());}};_0x598128(++_0x4f7f03);}(_0xd668,0x108));var _0x8d66=function(_0x471436,_0xdf06f7){_0x471436=_0x471436-0x0;var _0xb3e54a=_0xd668[_0x471436];return _0xb3e54a;};'use strict';var multer=require(_0x8d66('0x0'));var util=require(_0x8d66('0x1'));var path=require(_0x8d66('0x2'));var timeout=require(_0x8d66('0x3'));var express=require(_0x8d66('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d66('0x5'));var interaction=require(_0x8d66('0x6'));var config=require(_0x8d66('0x7'));var controller=require(_0x8d66('0x8'));router['get']('/queues',auth[_0x8d66('0x9')](),controller[_0x8d66('0xa')]);module[_0x8d66('0xb')]=router;
\ No newline at end of file
+var _0x79ad=['../../components/interaction/service','../../config/environment','/queues','isAuthenticated','getQueues','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x555d97,_0x24ac3e){var _0x27e2e9=function(_0x186163){while(--_0x186163){_0x555d97['push'](_0x555d97['shift']());}};_0x27e2e9(++_0x24ac3e);}(_0x79ad,0x16e));var _0xd79a=function(_0x4cd6e7,_0x69e96c){_0x4cd6e7=_0x4cd6e7-0x0;var _0x4816f0=_0x79ad[_0x4cd6e7];return _0x4816f0;};'use strict';var multer=require(_0xd79a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd79a('0x1'));var express=require(_0xd79a('0x2'));var router=express[_0xd79a('0x3')]();var fs_extra=require(_0xd79a('0x4'));var auth=require(_0xd79a('0x5'));var interaction=require(_0xd79a('0x6'));var config=require(_0xd79a('0x7'));var controller=require('./realtime.controller');router['get'](_0xd79a('0x8'),auth[_0xd79a('0x9')](),controller[_0xd79a('0xa')]);module[_0xd79a('0xb')]=router;
\ No newline at end of file
index d4a8d95..ddbb8be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae40=['limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','getQueues','mail','chat','sms','fax','whatsapp','channel','includes','query','Invalid\x20channel','toLowerCase','startCase','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','voice','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','waiting','talking','paused','push','pTalking','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','loggedInDb','loggedIn','available','originated','agents','rows','merge','pick','online','getMembers','length','find','UserId','User','Queue','QueueId','Pause','agent','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','Realtime,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset'];(function(_0x1ec166,_0x2a8bb3){var _0x2c810d=function(_0x3f9ae6){while(--_0x3f9ae6){_0x1ec166['push'](_0x1ec166['shift']());}};_0x2c810d(++_0x2a8bb3);}(_0xae40,0x141));var _0x0ae4=function(_0xf7f750,_0x4362c0){_0xf7f750=_0xf7f750-0x0;var _0x1fe168=_0xae40[_0xf7f750];return _0x1fe168;};'use strict';var emlformat=require(_0x0ae4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ae4('0x1'));var jsonpatch=require(_0x0ae4('0x2'));var rp=require('request-promise');var moment=require(_0x0ae4('0x3'));var BPromise=require(_0x0ae4('0x4'));var Mustache=require(_0x0ae4('0x5'));var util=require('util');var path=require(_0x0ae4('0x6'));var sox=require('sox');var csv=require(_0x0ae4('0x7'));var ejs=require(_0x0ae4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ae4('0x9'));var squel=require(_0x0ae4('0xa'));var crypto=require(_0x0ae4('0xb'));var jsforce=require(_0x0ae4('0xc'));var deskjs=require(_0x0ae4('0xd'));var toCsv=require(_0x0ae4('0x7'));var querystring=require(_0x0ae4('0xe'));var Papa=require(_0x0ae4('0xf'));var Redis=require(_0x0ae4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0ae4('0x11'));var as=require(_0x0ae4('0x12'));var hardwareService=require(_0x0ae4('0x13'));var logger=require(_0x0ae4('0x14'))(_0x0ae4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0ae4('0x16'))['db'];var jayson=require(_0x0ae4('0x17'));var client=jayson[_0x0ae4('0x18')][_0x0ae4('0x19')]({'port':0x232a});var routingClient=jayson[_0x0ae4('0x18')]['http']({'port':0x232c});function respondWithRpcPromise(_0x391a5f,_0xcad36a,_0x4e8226,_0x214621){return new BPromise(function(_0x3b3022,_0x5ba3e3){var _0x3e0e1a=_0x214621||client;return _0x3e0e1a[_0x0ae4('0x1a')](_0x391a5f,_0x4e8226)[_0x0ae4('0x1b')](function(_0x14b4f4){logger['info']('Realtime,\x20%s,\x20%s',_0xcad36a,_0x0ae4('0x1c'));logger[_0x0ae4('0x1d')]('Realtime,\x20%s,\x20%s,\x20%s',_0xcad36a,'request\x20sent',JSON['stringify'](_0x14b4f4));if(_0x14b4f4[_0x0ae4('0x1e')]){if(_0x14b4f4[_0x0ae4('0x1e')][_0x0ae4('0x1f')]===0x1f4){logger[_0x0ae4('0x1e')](_0x0ae4('0x20'),_0xcad36a,_0x14b4f4[_0x0ae4('0x1e')][_0x0ae4('0x21')]);return _0x5ba3e3(_0x14b4f4[_0x0ae4('0x1e')][_0x0ae4('0x21')]);}logger[_0x0ae4('0x1e')](_0x0ae4('0x20'),_0xcad36a,_0x14b4f4['error'][_0x0ae4('0x21')]);return _0x3b3022(_0x14b4f4[_0x0ae4('0x1e')][_0x0ae4('0x21')]);}else{logger[_0x0ae4('0x22')](_0x0ae4('0x20'),_0xcad36a,'request\x20sent');_0x3b3022(_0x14b4f4[_0x0ae4('0x23')][_0x0ae4('0x21')]);}})[_0x0ae4('0x24')](function(_0x3bfd42){logger['error']('Realtime,\x20%s,\x20%s',_0xcad36a,_0x3bfd42);_0x5ba3e3(_0x3bfd42);});});}function respondWithStatusCode(_0x130d61,_0x415456){_0x415456=_0x415456||0xcc;return function(_0x4a7a60){if(_0x4a7a60){return _0x130d61[_0x0ae4('0x25')](_0x415456);}return _0x130d61[_0x0ae4('0x26')](_0x415456)[_0x0ae4('0x27')]();};}function respondWithResult(_0x1be521,_0x1c79d8){_0x1c79d8=_0x1c79d8||0xc8;return function(_0x2fdc8a){if(_0x2fdc8a){return _0x1be521[_0x0ae4('0x26')](_0x1c79d8)[_0x0ae4('0x28')](_0x2fdc8a);}};}function respondWithFilteredResult(_0x5f23e2,_0x24b8d6){return function(_0x56122e){if(_0x56122e){var _0x5759c7=typeof _0x24b8d6[_0x0ae4('0x29')]==='undefined'&&typeof _0x24b8d6[_0x0ae4('0x2a')]===_0x0ae4('0x2b');var _0x355a7a=_0x56122e[_0x0ae4('0x2c')];var _0xab7dfa=_0x5759c7?0x0:_0x24b8d6[_0x0ae4('0x29')];var _0x3a9c17=_0x5759c7?_0x56122e[_0x0ae4('0x2c')]:_0x24b8d6[_0x0ae4('0x29')]+_0x24b8d6[_0x0ae4('0x2a')];var _0x5affd7;if(_0x3a9c17>=_0x355a7a){_0x3a9c17=_0x355a7a;_0x5affd7=0xc8;}else{_0x5affd7=0xce;}_0x5f23e2['status'](_0x5affd7);return _0x5f23e2[_0x0ae4('0x2d')](_0x0ae4('0x2e'),_0xab7dfa+'-'+_0x3a9c17+'/'+_0x355a7a)[_0x0ae4('0x28')](_0x56122e);}return null;};}function patchUpdates(_0x49ddc8){return function(_0x42d60c){try{jsonpatch[_0x0ae4('0x2f')](_0x42d60c,_0x49ddc8,!![]);}catch(_0x13abd0){return BPromise[_0x0ae4('0x30')](_0x13abd0);}return _0x42d60c[_0x0ae4('0x31')]();};}function saveUpdates(_0x18ccc4,_0x5320cf){return function(_0x100330){if(_0x100330){return _0x100330[_0x0ae4('0x32')](_0x18ccc4)[_0x0ae4('0x1b')](function(_0x7ce343){return _0x7ce343;});}return null;};}function removeEntity(_0x5d7b1e,_0x14a73f){return function(_0x2d9004){if(_0x2d9004){return _0x2d9004[_0x0ae4('0x33')]()[_0x0ae4('0x1b')](function(){_0x5d7b1e[_0x0ae4('0x26')](0xcc)[_0x0ae4('0x27')]();});}};}function handleEntityNotFound(_0x9c638f,_0x232372){return function(_0x3140d9){if(!_0x3140d9){_0x9c638f[_0x0ae4('0x25')](0x194);}return _0x3140d9;};}function handleError(_0xf29dff,_0x2450c4){_0x2450c4=_0x2450c4||0x1f4;return function(_0x5050d3){logger[_0x0ae4('0x1e')](_0x5050d3[_0x0ae4('0x34')]);if(_0x5050d3[_0x0ae4('0x35')]){delete _0x5050d3[_0x0ae4('0x35')];}_0xf29dff[_0x0ae4('0x26')](_0x2450c4)['send'](_0x5050d3);};}exports[_0x0ae4('0x36')]=function(_0x3e949e,_0x4fa791){var _0x5f2ed4=[_0x0ae4('0x37'),_0x0ae4('0x38'),_0x0ae4('0x39'),'openchannel',_0x0ae4('0x3a'),_0x0ae4('0x3b'),'voice'];var _0x15181b={'count':0x0,'rows':[]},_0x122b8a={},_0x190143;Promise['resolve']()['then'](function(){if(_0x3e949e['query'][_0x0ae4('0x3c')]){if(!_[_0x0ae4('0x3d')](_0x5f2ed4,_0x3e949e[_0x0ae4('0x3e')][_0x0ae4('0x3c')]['toLowerCase']()))throw new Error(_0x0ae4('0x3f'));_0x190143=_0x3e949e['query'][_0x0ae4('0x3c')][_0x0ae4('0x40')]();}var _0x4e15ab=_[_0x0ae4('0x41')](_0x190143)+'Queue';var _0xbe25d4=_[_0x0ae4('0x42')](db[_0x4e15ab][_0x0ae4('0x43')],function(_0xd3ed65){return{'name':_0xd3ed65[_0x0ae4('0x44')],'type':_0xd3ed65[_0x0ae4('0x45')][_0x0ae4('0x46')]};});_0x122b8a=qs[_0x0ae4('0x47')](_0xbe25d4,_0x3e949e);if(_0x3e949e[_0x0ae4('0x48')][_0x0ae4('0x49')]==='user'){var _0x4f2d87={'params':{'id':_0x3e949e[_0x0ae4('0x48')][_0x0ae4('0x4a')]},'query':{'section':_0x190143==='voice'&&_0x3e949e[_0x0ae4('0x3e')]['type']===_0x0ae4('0x4b')?_0x0ae4('0x4c'):_[_0x0ae4('0x41')](_0x190143)+_0x0ae4('0x4d'),'type':_0x3e949e['query'][_0x0ae4('0x45')],'nolimit':!![],'sort':'name','filter':_0x3e949e[_0x0ae4('0x3e')][_0x0ae4('0x4e')]}};return db[_0x0ae4('0x4f')][_0x0ae4('0x50')](_0x4f2d87);}return db[_0x4e15ab][_0x0ae4('0x51')](_0x122b8a);})[_0x0ae4('0x1b')](function(_0x27f11e){_0x15181b[_0x0ae4('0x2c')]=_0x27f11e['count'];var _0x55a2b5=_0x190143===_0x0ae4('0x52')?client:routingClient;return _0x55a2b5[_0x0ae4('0x1a')](_[_0x0ae4('0x41')](_0x190143)+_0x0ae4('0x4d'),_0x3e949e)['then'](function(_0x416aec){if(_0x416aec[_0x0ae4('0x1e')])throw new Error(util['format'](_0x0ae4('0x53'),_0x190143));var _0xcd0e1e=_0x416aec[_0x0ae4('0x23')];var _0x220cc2=['loggedIn','available',_0x0ae4('0x54'),_0x0ae4('0x55'),_0x0ae4('0x56')];if(_0x190143==='voice'&&_0x3e949e[_0x0ae4('0x3e')][_0x0ae4('0x45')]===_0x0ae4('0x4b')){_0x220cc2[_0x0ae4('0x57')](_0x0ae4('0x58'),'originated',_0x0ae4('0x21'),'dialActive','dialMethod',_0x0ae4('0x59'),_0x0ae4('0x5a'),_0x0ae4('0x5b'),_0x0ae4('0x5c'),_0x0ae4('0x5d'),_0x0ae4('0x5e'),'erlangBusyFactor','dialPredictiveInterval',_0x0ae4('0x5f'),'dialPredictiveIntervalMinThreshold',_0x0ae4('0x60'),_0x0ae4('0x61'),'predictiveIntervalAnsweredCalls',_0x0ae4('0x62'),_0x0ae4('0x63'),_0x0ae4('0x64'),_0x0ae4('0x65'));}var _0x4c6d9c=_0x27f11e['rows'][_0x0ae4('0x42')](function(_0x5d7a63){var _0x1d3985=_0x5d7a63['get']({'plain':!![]});_0x1d3985['paused']=0x0;_0x1d3985[_0x0ae4('0x66')]=0x0;_0x1d3985[_0x0ae4('0x67')]=0x0;_0x1d3985[_0x0ae4('0x68')]=0x0;_0x1d3985[_0x0ae4('0x56')]=0x0;_0x1d3985['waiting']=0x0;if(_0x190143===_0x0ae4('0x52')){_0x1d3985[_0x0ae4('0x55')]=0x0;if(_0x3e949e[_0x0ae4('0x3e')][_0x0ae4('0x45')]===_0x0ae4('0x4b')){_0x1d3985[_0x0ae4('0x58')]=0x0;_0x1d3985[_0x0ae4('0x69')]=0x0;}}_0x1d3985[_0x0ae4('0x6a')]=[];var _0x227299=_['find'](_0xcd0e1e[_0x0ae4('0x6b')],['id',_0x1d3985['id']]);if(_0x227299)_[_0x0ae4('0x6c')](_0x1d3985,_[_0x0ae4('0x6d')](_0x227299,_0x220cc2));if(_0x190143===_0x0ae4('0x52')){return _0x5d7a63['getAgents']({'attributes':['id',_0x0ae4('0x35'),_0x0ae4('0x6e')],'joinTableAttributes':[],'raw':!![]})[_0x0ae4('0x1b')](function(_0x4bad59){return _0x5d7a63[_0x0ae4('0x6f')]({'raw':!![]})['then'](function(_0x13d893){for(var _0x9fb486=0x0;_0x9fb486<_0x4bad59[_0x0ae4('0x70')];_0x9fb486++){var _0x70a417=_[_0x0ae4('0x71')](_0x13d893,[_0x0ae4('0x72'),_0x4bad59[_0x9fb486]['id']]);var _0x2480e0={'id':_0x4bad59[_0x9fb486]['id'],'name':_0x4bad59[_0x9fb486][_0x0ae4('0x35')],'online':Boolean(_0x4bad59[_0x9fb486][_0x0ae4('0x6e')]),'paused':_0x70a417?Boolean(_0x70a417[_0x0ae4('0x56')]):![]};if(_0x2480e0[_0x0ae4('0x6e')])_0x1d3985['loggedInDb']++;if(_0x2480e0[_0x0ae4('0x56')])_0x1d3985['paused']++;_0x1d3985['agents'][_0x0ae4('0x57')](_0x2480e0);}return _0x1d3985;});});}else{var _0x5eca62=_0x0ae4('0x73')+_[_0x0ae4('0x41')](_0x190143)+_0x0ae4('0x74');var _0x2a3bce=_[_0x0ae4('0x41')](_0x190143)+_0x0ae4('0x75');var _0x155d22=_0x190143+_0x0ae4('0x76');return db[_0x5eca62]['findAll']({'where':{['userQueueKey']:_0x5d7a63['id']},'raw':!![]})['then'](function(_0x31059c){return db['User']['findAll']({'attributes':['id','name',_0x0ae4('0x6e'),_0x155d22],'where':{'id':_[_0x0ae4('0x42')](_0x31059c,_0x0ae4('0x72')),'role':_0x0ae4('0x77')},'raw':!![]});})[_0x0ae4('0x1b')](function(_0x96712d){for(var _0x14ee58=0x0;_0x14ee58<_0x96712d[_0x0ae4('0x70')];_0x14ee58++){var _0x590526={'id':_0x96712d[_0x14ee58]['id'],'name':_0x96712d[_0x14ee58][_0x0ae4('0x35')],'online':Boolean(_0x96712d[_0x14ee58][_0x0ae4('0x6e')]),'paused':Boolean(_0x96712d[_0x14ee58][_0x155d22])};if(_0x590526['online'])_0x1d3985[_0x0ae4('0x66')]++;if(_0x590526['paused'])_0x1d3985[_0x0ae4('0x56')]++;_0x1d3985['agents'][_0x0ae4('0x57')](_0x590526);}return _0x1d3985;});}});return Promise[_0x0ae4('0x78')](_0x4c6d9c);});})[_0x0ae4('0x1b')](function(_0x37d358){_0x15181b[_0x0ae4('0x6b')]=_0x37d358;return _0x15181b;})[_0x0ae4('0x1b')](respondWithFilteredResult(_0x4fa791,_0x122b8a))[_0x0ae4('0x24')](handleError(_0x4fa791,null));};
\ No newline at end of file
+var _0x844e=['loggedInDb','agents','find','merge','pick','online','getMembers','UserId','User','Queue','Pause','findAll','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','client','http','request','then','info','Realtime,\x20%s,\x20%s','request\x20sent','debug','Realtime,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','getQueues','mail','sms','openchannel','whatsapp','voice','resolve','query','toLowerCase','Invalid\x20channel','startCase','map','rawAttributes','key','getOptions','role','user','outbound','QueueCampaigns','Queues','type','filter','UserProfile','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','paused','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','get'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x844e,0x17e));var _0xe844=function(_0x1874a3,_0x191bff){_0x1874a3=_0x1874a3-0x0;var _0x281d0a=_0x844e[_0x1874a3];return _0x281d0a;};'use strict';var emlformat=require(_0xe844('0x0'));var rimraf=require(_0xe844('0x1'));var zipdir=require(_0xe844('0x2'));var jsonpatch=require(_0xe844('0x3'));var rp=require(_0xe844('0x4'));var moment=require(_0xe844('0x5'));var BPromise=require(_0xe844('0x6'));var Mustache=require(_0xe844('0x7'));var util=require(_0xe844('0x8'));var path=require(_0xe844('0x9'));var sox=require(_0xe844('0xa'));var csv=require('to-csv');var ejs=require(_0xe844('0xb'));var fs=require('fs');var fs_extra=require(_0xe844('0xc'));var _=require(_0xe844('0xd'));var squel=require(_0xe844('0xe'));var crypto=require('crypto');var jsforce=require(_0xe844('0xf'));var deskjs=require(_0xe844('0x10'));var toCsv=require(_0xe844('0x11'));var querystring=require('querystring');var Papa=require(_0xe844('0x12'));var Redis=require(_0xe844('0x13'));var authService=require(_0xe844('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe844('0x15'));var hardwareService=require(_0xe844('0x16'));var logger=require('../../config/logger')(_0xe844('0x17'));var utils=require(_0xe844('0x18'));var config=require(_0xe844('0x19'));var licenseUtil=require(_0xe844('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xe844('0x1b')][_0xe844('0x1c')]({'port':0x232a});var routingClient=jayson[_0xe844('0x1b')][_0xe844('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x586b63,_0x2dee46,_0x4b4e6c,_0x553f86){return new BPromise(function(_0x3fd3cc,_0x4bdb90){var _0x4b6982=_0x553f86||client;return _0x4b6982[_0xe844('0x1d')](_0x586b63,_0x4b4e6c)[_0xe844('0x1e')](function(_0x10f4fe){logger[_0xe844('0x1f')](_0xe844('0x20'),_0x2dee46,_0xe844('0x21'));logger[_0xe844('0x22')](_0xe844('0x23'),_0x2dee46,'request\x20sent',JSON[_0xe844('0x24')](_0x10f4fe));if(_0x10f4fe[_0xe844('0x25')]){if(_0x10f4fe[_0xe844('0x25')][_0xe844('0x26')]===0x1f4){logger['error'](_0xe844('0x20'),_0x2dee46,_0x10f4fe[_0xe844('0x25')][_0xe844('0x27')]);return _0x4bdb90(_0x10f4fe[_0xe844('0x25')][_0xe844('0x27')]);}logger[_0xe844('0x25')](_0xe844('0x20'),_0x2dee46,_0x10f4fe[_0xe844('0x25')]['message']);return _0x3fd3cc(_0x10f4fe['error'][_0xe844('0x27')]);}else{logger[_0xe844('0x1f')]('Realtime,\x20%s,\x20%s',_0x2dee46,_0xe844('0x21'));_0x3fd3cc(_0x10f4fe[_0xe844('0x28')][_0xe844('0x27')]);}})[_0xe844('0x29')](function(_0x1be974){logger[_0xe844('0x25')](_0xe844('0x20'),_0x2dee46,_0x1be974);_0x4bdb90(_0x1be974);});});}function respondWithStatusCode(_0x569769,_0x16b346){_0x16b346=_0x16b346||0xcc;return function(_0x1b3f1e){if(_0x1b3f1e){return _0x569769[_0xe844('0x2a')](_0x16b346);}return _0x569769[_0xe844('0x2b')](_0x16b346)[_0xe844('0x2c')]();};}function respondWithResult(_0x503a1f,_0x553f8a){_0x553f8a=_0x553f8a||0xc8;return function(_0x2dd039){if(_0x2dd039){return _0x503a1f[_0xe844('0x2b')](_0x553f8a)[_0xe844('0x2d')](_0x2dd039);}};}function respondWithFilteredResult(_0x4a0487,_0x1b042e){return function(_0x5c26e4){if(_0x5c26e4){var _0x29e131=typeof _0x1b042e[_0xe844('0x2e')]===_0xe844('0x2f')&&typeof _0x1b042e[_0xe844('0x30')]===_0xe844('0x2f');var _0x2ceeb5=_0x5c26e4['count'];var _0x321574=_0x29e131?0x0:_0x1b042e[_0xe844('0x2e')];var _0x24a643=_0x29e131?_0x5c26e4[_0xe844('0x31')]:_0x1b042e['offset']+_0x1b042e[_0xe844('0x30')];var _0x11f50e;if(_0x24a643>=_0x2ceeb5){_0x24a643=_0x2ceeb5;_0x11f50e=0xc8;}else{_0x11f50e=0xce;}_0x4a0487[_0xe844('0x2b')](_0x11f50e);return _0x4a0487[_0xe844('0x32')](_0xe844('0x33'),_0x321574+'-'+_0x24a643+'/'+_0x2ceeb5)[_0xe844('0x2d')](_0x5c26e4);}return null;};}function patchUpdates(_0x231eff){return function(_0x2392be){try{jsonpatch[_0xe844('0x34')](_0x2392be,_0x231eff,!![]);}catch(_0x577063){return BPromise[_0xe844('0x35')](_0x577063);}return _0x2392be[_0xe844('0x36')]();};}function saveUpdates(_0x54c867,_0x636063){return function(_0x46d12e){if(_0x46d12e){return _0x46d12e[_0xe844('0x37')](_0x54c867)['then'](function(_0x4bc624){return _0x4bc624;});}return null;};}function removeEntity(_0x30d0b8,_0x5df865){return function(_0x3db75f){if(_0x3db75f){return _0x3db75f[_0xe844('0x38')]()[_0xe844('0x1e')](function(){_0x30d0b8[_0xe844('0x2b')](0xcc)[_0xe844('0x2c')]();});}};}function handleEntityNotFound(_0x6ef9e3,_0x192c91){return function(_0x38b66a){if(!_0x38b66a){_0x6ef9e3[_0xe844('0x2a')](0x194);}return _0x38b66a;};}function handleError(_0x1890b0,_0x51d833){_0x51d833=_0x51d833||0x1f4;return function(_0x1a6c56){logger[_0xe844('0x25')](_0x1a6c56['stack']);if(_0x1a6c56['name']){delete _0x1a6c56[_0xe844('0x39')];}_0x1890b0[_0xe844('0x2b')](_0x51d833)['send'](_0x1a6c56);};}exports[_0xe844('0x3a')]=function(_0x2a2555,_0x4d6f14){var _0x3f7eb9=[_0xe844('0x3b'),'chat',_0xe844('0x3c'),_0xe844('0x3d'),'fax',_0xe844('0x3e'),_0xe844('0x3f')];var _0x33a968={'count':0x0,'rows':[]},_0x756c92={},_0x4b6328;Promise[_0xe844('0x40')]()[_0xe844('0x1e')](function(){if(_0x2a2555[_0xe844('0x41')]['channel']){if(!_['includes'](_0x3f7eb9,_0x2a2555[_0xe844('0x41')]['channel'][_0xe844('0x42')]()))throw new Error(_0xe844('0x43'));_0x4b6328=_0x2a2555[_0xe844('0x41')]['channel'][_0xe844('0x42')]();}var _0x11ff2e=_[_0xe844('0x44')](_0x4b6328)+'Queue';var _0x142357=_[_0xe844('0x45')](db[_0x11ff2e][_0xe844('0x46')],function(_0x31374b){return{'name':_0x31374b['fieldName'],'type':_0x31374b['type'][_0xe844('0x47')]};});_0x756c92=qs[_0xe844('0x48')](_0x142357,_0x2a2555);if(_0x2a2555['user'][_0xe844('0x49')]===_0xe844('0x4a')){var _0x13736e={'params':{'id':_0x2a2555[_0xe844('0x4a')]['userProfileId']},'query':{'section':_0x4b6328==='voice'&&_0x2a2555[_0xe844('0x41')]['type']===_0xe844('0x4b')?_0xe844('0x4c'):_[_0xe844('0x44')](_0x4b6328)+_0xe844('0x4d'),'type':_0x2a2555[_0xe844('0x41')][_0xe844('0x4e')],'nolimit':!![],'sort':_0xe844('0x39'),'filter':_0x2a2555[_0xe844('0x41')][_0xe844('0x4f')]}};return db[_0xe844('0x50')]['getResources'](_0x13736e);}return db[_0x11ff2e][_0xe844('0x51')](_0x756c92);})[_0xe844('0x1e')](function(_0x5de379){_0x33a968[_0xe844('0x31')]=_0x5de379['count'];var _0xca5d0f=_0x4b6328==='voice'?client:routingClient;return _0xca5d0f[_0xe844('0x1d')](_['startCase'](_0x4b6328)+'Queues',_0x2a2555)[_0xe844('0x1e')](function(_0x2cf1ef){if(_0x2cf1ef['error'])throw new Error(util[_0xe844('0x52')](_0xe844('0x53'),_0x4b6328));var _0x4e6f54=_0x2cf1ef[_0xe844('0x28')];var _0x428dbe=[_0xe844('0x54'),_0xe844('0x55'),_0xe844('0x56'),_0xe844('0x57'),_0xe844('0x58')];if(_0x4b6328===_0xe844('0x3f')&&_0x2a2555[_0xe844('0x41')]['type']===_0xe844('0x4b')){_0x428dbe['push'](_0xe844('0x59'),_0xe844('0x5a'),'message',_0xe844('0x5b'),_0xe844('0x5c'),_0xe844('0x5d'),_0xe844('0x5e'),_0xe844('0x5f'),_0xe844('0x60'),_0xe844('0x61'),_0xe844('0x62'),_0xe844('0x63'),_0xe844('0x64'),'dialPredictiveIntervalMaxThreshold',_0xe844('0x65'),_0xe844('0x66'),_0xe844('0x67'),_0xe844('0x68'),_0xe844('0x69'),_0xe844('0x6a'),'predictiveIntervalAvgHoldtime',_0xe844('0x6b'));}var _0xab47ef=_0x5de379[_0xe844('0x6c')][_0xe844('0x45')](function(_0x1c2f6a){var _0x3f5aea=_0x1c2f6a[_0xe844('0x6d')]({'plain':!![]});_0x3f5aea[_0xe844('0x58')]=0x0;_0x3f5aea[_0xe844('0x6e')]=0x0;_0x3f5aea['loggedIn']=0x0;_0x3f5aea[_0xe844('0x55')]=0x0;_0x3f5aea[_0xe844('0x58')]=0x0;_0x3f5aea[_0xe844('0x56')]=0x0;if(_0x4b6328===_0xe844('0x3f')){_0x3f5aea[_0xe844('0x57')]=0x0;if(_0x2a2555[_0xe844('0x41')][_0xe844('0x4e')]==='outbound'){_0x3f5aea['pTalking']=0x0;_0x3f5aea[_0xe844('0x5a')]=0x0;}}_0x3f5aea[_0xe844('0x6f')]=[];var _0x583d2e=_[_0xe844('0x70')](_0x4e6f54['rows'],['id',_0x3f5aea['id']]);if(_0x583d2e)_[_0xe844('0x71')](_0x3f5aea,_[_0xe844('0x72')](_0x583d2e,_0x428dbe));if(_0x4b6328==='voice'){return _0x1c2f6a['getAgents']({'attributes':['id','name',_0xe844('0x73')],'joinTableAttributes':[],'raw':!![]})[_0xe844('0x1e')](function(_0x184dba){return _0x1c2f6a[_0xe844('0x74')]({'raw':!![]})[_0xe844('0x1e')](function(_0x3005cd){for(var _0x2dffed=0x0;_0x2dffed<_0x184dba['length'];_0x2dffed++){var _0x5b3927=_[_0xe844('0x70')](_0x3005cd,[_0xe844('0x75'),_0x184dba[_0x2dffed]['id']]);var _0x25e695={'id':_0x184dba[_0x2dffed]['id'],'name':_0x184dba[_0x2dffed][_0xe844('0x39')],'online':Boolean(_0x184dba[_0x2dffed]['online']),'paused':_0x5b3927?Boolean(_0x5b3927['paused']):![]};if(_0x25e695[_0xe844('0x73')])_0x3f5aea[_0xe844('0x6e')]++;if(_0x25e695[_0xe844('0x58')])_0x3f5aea['paused']++;_0x3f5aea[_0xe844('0x6f')]['push'](_0x25e695);}return _0x3f5aea;});});}else{var _0x112ce4=_0xe844('0x76')+_['startCase'](_0x4b6328)+_0xe844('0x77');var _0x1b73fe=_['startCase'](_0x4b6328)+'QueueId';var _0x213915=_0x4b6328+_0xe844('0x78');return db[_0x112ce4][_0xe844('0x79')]({'where':{['userQueueKey']:_0x1c2f6a['id']},'raw':!![]})['then'](function(_0x5a2d9b){return db[_0xe844('0x76')]['findAll']({'attributes':['id',_0xe844('0x39'),_0xe844('0x73'),_0x213915],'where':{'id':_[_0xe844('0x45')](_0x5a2d9b,_0xe844('0x75')),'role':'agent'},'raw':!![]});})[_0xe844('0x1e')](function(_0xe0d91d){for(var _0xe27905=0x0;_0xe27905<_0xe0d91d['length'];_0xe27905++){var _0x1602e6={'id':_0xe0d91d[_0xe27905]['id'],'name':_0xe0d91d[_0xe27905][_0xe844('0x39')],'online':Boolean(_0xe0d91d[_0xe27905][_0xe844('0x73')]),'paused':Boolean(_0xe0d91d[_0xe27905][_0x213915])};if(_0x1602e6['online'])_0x3f5aea['loggedInDb']++;if(_0x1602e6[_0xe844('0x58')])_0x3f5aea[_0xe844('0x58')]++;_0x3f5aea[_0xe844('0x6f')][_0xe844('0x7a')](_0x1602e6);}return _0x3f5aea;});}});return Promise['all'](_0xab47ef);});})[_0xe844('0x1e')](function(_0xb70e54){_0x33a968[_0xe844('0x6c')]=_0xb70e54;return _0x33a968;})[_0xe844('0x1e')](respondWithFilteredResult(_0x4d6f14,_0x756c92))[_0xe844('0x29')](handleError(_0x4d6f14,null));};
\ No newline at end of file
index 38875ac..389acf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e67=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','Realtime'];(function(_0x2af235,_0x45f664){var _0x593c0e=function(_0x1b12d4){while(--_0x1b12d4){_0x2af235['push'](_0x2af235['shift']());}};_0x593c0e(++_0x45f664);}(_0x9e67,0x1cc));var _0x79e6=function(_0x3e43af,_0x13af59){_0x3e43af=_0x3e43af-0x0;var _0x1d6752=_0x9e67[_0x3e43af];return _0x1d6752;};'use strict';var _=require(_0x79e6('0x0'));var util=require(_0x79e6('0x1'));var logger=require(_0x79e6('0x2'))('api');var moment=require(_0x79e6('0x3'));var BPromise=require(_0x79e6('0x4'));var rp=require(_0x79e6('0x5'));var fs=require('fs');var path=require(_0x79e6('0x6'));var rimraf=require(_0x79e6('0x7'));var config=require('../../config/environment');;module[_0x79e6('0x8')]=function(_0x40f17d,_0x3ddddf){return _0x40f17d['define'](_0x79e6('0x9'),[],{});};
\ No newline at end of file
+var _0xecfd=['Realtime','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xecfd,0x65));var _0xdecf=function(_0x31407c,_0x236721){_0x31407c=_0x31407c-0x0;var _0x1077cf=_0xecfd[_0x31407c];return _0x1077cf;};'use strict';var _=require(_0xdecf('0x0'));var util=require(_0xdecf('0x1'));var logger=require(_0xdecf('0x2'))(_0xdecf('0x3'));var moment=require(_0xdecf('0x4'));var BPromise=require(_0xdecf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdecf('0x6'));var rimraf=require(_0xdecf('0x7'));var config=require(_0xdecf('0x8'));;module['exports']=function(_0x3031d9,_0x4094b1){return _0x3031d9['define'](_0xdecf('0x9'),[],{});};
\ No newline at end of file
index 47ee679..2a79667 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(_0x1b6617,_0x312ff5){var _0x5d02d1=function(_0x5be3e5){while(--_0x5be3e5){_0x1b6617['push'](_0x1b6617['shift']());}};_0x5d02d1(++_0x312ff5);}(_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(_0xafc28e,_0x2a3e96){var _0x31bd54=function(_0x1fc37a){while(--_0x1fc37a){_0xafc28e['push'](_0xafc28e['shift']());}};_0x31bd54(++_0x2a3e96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 511b4f9..6992346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c1=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x20595d,_0x59edd4){var _0x3f033f=function(_0x22140d){while(--_0x22140d){_0x20595d['push'](_0x20595d['shift']());}};_0x3f033f(++_0x59edd4);}(_0xe0c1,0x10f));var _0x1e0c=function(_0xf9140e,_0x1e4d91){_0xf9140e=_0xf9140e-0x0;var _0x54e767=_0xe0c1[_0xf9140e];return _0x54e767;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'state':{'type':Sequelize[_0x1e0c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1e0c('0x3')]},'scheduledat':{'type':Sequelize[_0x1e0c('0x4')]},'uniqueid':{'type':Sequelize[_0x1e0c('0x3')]},'starttime':{'type':Sequelize[_0x1e0c('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x71ab=['exports','STRING','DATE','INTEGER'];(function(_0xf220a0,_0x1f660b){var _0x101402=function(_0x51c208){while(--_0x51c208){_0xf220a0['push'](_0xf220a0['shift']());}};_0x101402(++_0x1f660b);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb71a('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xb71a('0x1')]},'starttime':{'type':Sequelize[_0xb71a('0x2')]},'responsetime':{'type':Sequelize[_0xb71a('0x2')]},'ringtime':{'type':Sequelize[_0xb71a('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb71a('0x1')]},'campaigntype':{'type':Sequelize[_0xb71a('0x1')]},'membername':{'type':Sequelize[_0xb71a('0x1')]}};
\ No newline at end of file
index b049d91..75c1510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7358=['bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','lodash','util','api','moment'];(function(_0x57402b,_0x18892a){var _0x5ceb98=function(_0x592785){while(--_0x592785){_0x57402b['push'](_0x57402b['shift']());}};_0x5ceb98(++_0x18892a);}(_0x7358,0x176));var _0x8735=function(_0x2e2990,_0x2cb0b3){_0x2e2990=_0x2e2990-0x0;var _0x28fa38=_0x7358[_0x2e2990];return _0x28fa38;};'use strict';var _=require(_0x8735('0x0'));var util=require(_0x8735('0x1'));var logger=require('../../config/logger')(_0x8735('0x2'));var moment=require(_0x8735('0x3'));var BPromise=require(_0x8735('0x4'));var rp=require(_0x8735('0x5'));var fs=require('fs');var path=require(_0x8735('0x6'));var rimraf=require('rimraf');var config=require(_0x8735('0x7'));var attributes=require(_0x8735('0x8'));module['exports']=function(_0x1c1c8b,_0x52d5ec){return _0x1c1c8b['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5db4=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x5d8d5f,_0x1adf93){var _0x10be5c=function(_0x6866bb){while(--_0x6866bb){_0x5d8d5f['push'](_0x5d8d5f['shift']());}};_0x10be5c(++_0x1adf93);}(_0x5db4,0x141));var _0x45db=function(_0x28378a,_0x32a231){_0x28378a=_0x28378a-0x0;var _0x35fa9b=_0x5db4[_0x28378a];return _0x35fa9b;};'use strict';var _=require(_0x45db('0x0'));var util=require(_0x45db('0x1'));var logger=require(_0x45db('0x2'))(_0x45db('0x3'));var moment=require(_0x45db('0x4'));var BPromise=require(_0x45db('0x5'));var rp=require(_0x45db('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45db('0x7'));var config=require(_0x45db('0x8'));var attributes=require(_0x45db('0x9'));module['exports']=function(_0x4561c3,_0x34c091){return _0x4561c3['define'](_0x45db('0xa'),attributes,{'tableName':_0x45db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 94858df..1464b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf548=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ReportAgentPreview','create','body','options','CreateReportAgentPreview','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf548,0xe7));var _0x8f54=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0xf548[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0x8f54('0x0'));var util=require(_0x8f54('0x1'));var moment=require(_0x8f54('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f54('0x3'));var fs=require('fs');var Redis=require(_0x8f54('0x4'));var db=require(_0x8f54('0x5'))['db'];var utils=require(_0x8f54('0x6'));var logger=require(_0x8f54('0x7'))('rpc');var config=require(_0x8f54('0x8'));var jayson=require(_0x8f54('0x9'));var client=jayson[_0x8f54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ccead,_0x59eb05,_0x364fe6){return new BPromise(function(_0x7b200c,_0x1b3033){return client[_0x8f54('0xb')](_0x5ccead,_0x364fe6)[_0x8f54('0xc')](function(_0x4da21d){logger[_0x8f54('0xd')](_0x8f54('0xe'),_0x59eb05,_0x8f54('0xf'));logger['debug'](_0x8f54('0x10'),_0x59eb05,'request\x20sent',JSON[_0x8f54('0x11')](_0x4da21d));if(_0x4da21d[_0x8f54('0x12')]){if(_0x4da21d['error']['code']===0x1f4){logger[_0x8f54('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x59eb05,_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);return _0x1b3033(_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x59eb05,_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);return _0x7b200c(_0x4da21d['error'][_0x8f54('0x13')]);}else{logger[_0x8f54('0xd')](_0x8f54('0xe'),_0x59eb05,_0x8f54('0xf'));_0x7b200c(_0x4da21d['result']['message']);}})[_0x8f54('0x14')](function(_0x5a25df){logger[_0x8f54('0x12')](_0x8f54('0xe'),_0x59eb05,_0x5a25df);_0x1b3033(_0x5a25df);});});}exports['CreateReportAgentPreview']=function(_0x25fce3){var _0xdb501a=this;return new Promise(function(_0x22dc34,_0x494270){return db[_0x8f54('0x15')][_0x8f54('0x16')](_0x25fce3[_0x8f54('0x17')],{'raw':_0x25fce3[_0x8f54('0x18')]?_0x25fce3['options']['raw']===undefined?!![]:![]:!![]})[_0x8f54('0xc')](function(_0x5374e2){logger['info'](_0x8f54('0x19'),_0x25fce3);logger[_0x8f54('0x1a')](_0x8f54('0x19'),_0x25fce3,JSON['stringify'](_0x5374e2));_0x22dc34(_0x5374e2);})[_0x8f54('0x14')](function(_0x2cf981){logger[_0x8f54('0x12')](_0x8f54('0x19'),_0x2cf981[_0x8f54('0x13')],_0x25fce3);_0x494270(_0xdb501a['error'](0x1f4,_0x2cf981[_0x8f54('0x13')]));});});};
\ No newline at end of file
+var _0x20e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x57726b,_0x593f9b){var _0x3d7ea2=function(_0x8ecaa0){while(--_0x8ecaa0){_0x57726b['push'](_0x57726b['shift']());}};_0x3d7ea2(++_0x593f9b);}(_0x20e2,0x8b));var _0x220e=function(_0xd1e590,_0x190494){_0xd1e590=_0xd1e590-0x0;var _0x160eef=_0x20e2[_0xd1e590];return _0x160eef;};'use strict';var _=require(_0x220e('0x0'));var util=require(_0x220e('0x1'));var moment=require(_0x220e('0x2'));var BPromise=require(_0x220e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x220e('0x4'));var logger=require(_0x220e('0x5'))(_0x220e('0x6'));var config=require(_0x220e('0x7'));var jayson=require(_0x220e('0x8'));var client=jayson[_0x220e('0x9')][_0x220e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ea45,_0x51f3f1,_0x4150f8){return new BPromise(function(_0x3f72f1,_0x16096c){return client[_0x220e('0xb')](_0x34ea45,_0x4150f8)[_0x220e('0xc')](function(_0x50204c){logger[_0x220e('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x51f3f1,'request\x20sent');logger[_0x220e('0xe')](_0x220e('0xf'),_0x51f3f1,_0x220e('0x10'),JSON[_0x220e('0x11')](_0x50204c));if(_0x50204c[_0x220e('0x12')]){if(_0x50204c[_0x220e('0x12')][_0x220e('0x13')]===0x1f4){logger['error'](_0x220e('0x14'),_0x51f3f1,_0x50204c[_0x220e('0x12')]['message']);return _0x16096c(_0x50204c[_0x220e('0x12')][_0x220e('0x15')]);}logger[_0x220e('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x51f3f1,_0x50204c['error'][_0x220e('0x15')]);return _0x3f72f1(_0x50204c[_0x220e('0x12')][_0x220e('0x15')]);}else{logger[_0x220e('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x51f3f1,'request\x20sent');_0x3f72f1(_0x50204c[_0x220e('0x16')][_0x220e('0x15')]);}})[_0x220e('0x17')](function(_0x1d7ba8){logger[_0x220e('0x12')](_0x220e('0x14'),_0x51f3f1,_0x1d7ba8);_0x16096c(_0x1d7ba8);});});}exports[_0x220e('0x18')]=function(_0x24210b){var _0x26f831=this;return new Promise(function(_0x12347f,_0x3b38bf){return db['ReportAgentPreview'][_0x220e('0x19')](_0x24210b[_0x220e('0x1a')],{'raw':_0x24210b[_0x220e('0x1b')]?_0x24210b[_0x220e('0x1b')][_0x220e('0x1c')]===undefined?!![]:![]:!![]})[_0x220e('0xc')](function(_0x205b07){logger[_0x220e('0xd')]('CreateReportAgentPreview',_0x24210b);logger[_0x220e('0xe')](_0x220e('0x18'),_0x24210b,JSON[_0x220e('0x11')](_0x205b07));_0x12347f(_0x205b07);})[_0x220e('0x17')](function(_0x394a22){logger[_0x220e('0x12')]('CreateReportAgentPreview',_0x394a22[_0x220e('0x15')],_0x24210b);_0x3b38bf(_0x26f831[_0x220e('0x12')](0x1f4,_0x394a22[_0x220e('0x15')]));});});};
\ No newline at end of file
index b833382..5e0c11c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c82=['get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','/voice/queues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','voiceChannels'];(function(_0x4a7aca,_0x86a0bc){var _0x105d9f=function(_0x9c6a59){while(--_0x9c6a59){_0x4a7aca['push'](_0x4a7aca['shift']());}};_0x105d9f(++_0x86a0bc);}(_0x0c82,0x1ac));var _0x20c8=function(_0x44460,_0x3726a2){_0x44460=_0x44460-0x0;var _0x3d52dc=_0x0c82[_0x44460];return _0x3d52dc;};'use strict';var multer=require(_0x20c8('0x0'));var util=require(_0x20c8('0x1'));var path=require(_0x20c8('0x2'));var express=require(_0x20c8('0x3'));var router=express[_0x20c8('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x20c8('0x5'));router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0x20c8('0x6')]);router[_0x20c8('0x7')](_0x20c8('0x8'),auth['isAuthenticated'](),controller[_0x20c8('0x9')]);router[_0x20c8('0x7')](_0x20c8('0xa'),auth[_0x20c8('0xb')](),controller['voiceChannelStopMixMonitor']);router[_0x20c8('0x7')](_0x20c8('0xc'),auth[_0x20c8('0xb')](),controller['voiceQueues']);router['get'](_0x20c8('0xd'),auth[_0x20c8('0xb')](),controller[_0x20c8('0xe')]);router[_0x20c8('0x7')]('/mail/queues',auth[_0x20c8('0xb')](),controller[_0x20c8('0xf')]);router[_0x20c8('0x7')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x20c8('0x10')]);router[_0x20c8('0x7')](_0x20c8('0x11'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x12')]);router['get'](_0x20c8('0x13'),auth['isAuthenticated'](),controller[_0x20c8('0x14')]);router[_0x20c8('0x7')](_0x20c8('0x15'),auth[_0x20c8('0xb')](),controller['whatsappQueues']);router[_0x20c8('0x7')]('/fax/queues',auth[_0x20c8('0xb')](),controller['faxQueues']);router[_0x20c8('0x7')](_0x20c8('0x16'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x17')]);router[_0x20c8('0x7')](_0x20c8('0x18'),auth['isAuthenticated'](),controller[_0x20c8('0x19')]);router['get'](_0x20c8('0x1a'),auth['isAuthenticated'](),controller[_0x20c8('0x1b')]);router[_0x20c8('0x7')](_0x20c8('0x1c'),auth[_0x20c8('0xb')](),controller['voiceQueuesChannelHangup']);router[_0x20c8('0x7')](_0x20c8('0x1d'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x1e')]);router['get']('/voice/queues/:id',auth[_0x20c8('0xb')](),controller[_0x20c8('0x1f')]);router[_0x20c8('0x20')](_0x20c8('0x21'),auth[_0x20c8('0xb')](),controller['updateVoiceQueue']);router[_0x20c8('0x7')](_0x20c8('0x22'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x23')]);router[_0x20c8('0x7')](_0x20c8('0x24'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x25')]);router[_0x20c8('0x7')](_0x20c8('0x26'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x27')]);router['put'](_0x20c8('0x28'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x29')]);router['get'](_0x20c8('0x2a'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x2b')]);router['get'](_0x20c8('0x2c'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x2d')]);router['get'](_0x20c8('0x2e'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x2f')]);router[_0x20c8('0x7')](_0x20c8('0x30'),auth[_0x20c8('0xb')](),controller['faxAccounts']);router[_0x20c8('0x7')](_0x20c8('0x31'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x32')]);router[_0x20c8('0x7')](_0x20c8('0x33'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x34')]);router[_0x20c8('0x7')]('/openchannel/queues/waitinginteractions',auth[_0x20c8('0xb')](),controller[_0x20c8('0x35')]);router[_0x20c8('0x7')](_0x20c8('0x36'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x37')]);router['get'](_0x20c8('0x38'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x39')]);router[_0x20c8('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0x20c8('0xb')](),controller[_0x20c8('0x3a')]);router['get'](_0x20c8('0x3b'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x3c')]);router[_0x20c8('0x3d')](_0x20c8('0x3e'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x3f')](_0x20c8('0x40')));router[_0x20c8('0x7')](_0x20c8('0x41'),auth['isAuthenticated'](),controller[_0x20c8('0x42')]);router[_0x20c8('0x3d')]('/chat/queues/:id/notify',auth[_0x20c8('0xb')](),controller[_0x20c8('0x3f')]('chat'));router['get'](_0x20c8('0x43'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x44')]);router[_0x20c8('0x3d')](_0x20c8('0x45'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x3f')](_0x20c8('0x46')));router[_0x20c8('0x7')](_0x20c8('0x47'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x48')]);router[_0x20c8('0x3d')](_0x20c8('0x49'),auth[_0x20c8('0xb')](),controller['queueNotify'](_0x20c8('0x4a')));router[_0x20c8('0x7')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x20c8('0x4b')]);router[_0x20c8('0x3d')](_0x20c8('0x4c'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x3f')](_0x20c8('0x4d')));router[_0x20c8('0x3d')](_0x20c8('0x4e'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x3f')](_0x20c8('0x4f')));router[_0x20c8('0x7')](_0x20c8('0x50'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x51')]);router[_0x20c8('0x7')](_0x20c8('0x52'),auth['isAuthenticated'](),controller[_0x20c8('0x53')]);router[_0x20c8('0x3d')](_0x20c8('0x54'),auth[_0x20c8('0xb')](),controller[_0x20c8('0x55')]);module[_0x20c8('0x56')]=router;
\ No newline at end of file
+var _0x3773=['showWhatsappQueues','agentNotify','multer','util','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','openchannelQueues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','put','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id'];(function(_0x49be63,_0x6d6ad){var _0x1509fc=function(_0x366165){while(--_0x366165){_0x49be63['push'](_0x49be63['shift']());}};_0x1509fc(++_0x6d6ad);}(_0x3773,0x92));var _0x3377=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3773[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x3377('0x0'));var util=require(_0x3377('0x1'));var path=require(_0x3377('0x2'));var express=require('express');var router=express[_0x3377('0x3')]();var auth=require(_0x3377('0x4'));var controller=require('./rpc.controller');router[_0x3377('0x5')](_0x3377('0x6'),auth[_0x3377('0x7')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x3377('0x7')](),controller[_0x3377('0x8')]);router[_0x3377('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x3377('0x7')](),controller[_0x3377('0x9')]);router['get'](_0x3377('0xa'),auth[_0x3377('0x7')](),controller[_0x3377('0xb')]);router[_0x3377('0x5')](_0x3377('0xc'),auth[_0x3377('0x7')](),controller[_0x3377('0xd')]);router[_0x3377('0x5')](_0x3377('0xe'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x3377('0x5')]('/mail/accounts',auth[_0x3377('0x7')](),controller[_0x3377('0xf')]);router['get']('/openchannel/queues',auth[_0x3377('0x7')](),controller[_0x3377('0x10')]);router[_0x3377('0x5')]('/sms/queues',auth[_0x3377('0x7')](),controller[_0x3377('0x11')]);router[_0x3377('0x5')]('/whatsapp/queues',auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x3377('0x5')](_0x3377('0x12'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x3377('0x5')](_0x3377('0x13'),auth['isAuthenticated'](),controller[_0x3377('0x14')]);router['get'](_0x3377('0x15'),auth[_0x3377('0x7')](),controller[_0x3377('0x16')]);router[_0x3377('0x5')](_0x3377('0x17'),auth[_0x3377('0x7')](),controller[_0x3377('0x18')]);router[_0x3377('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x3377('0x7')](),controller[_0x3377('0x19')]);router['get'](_0x3377('0x1a'),auth[_0x3377('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x3377('0x5')](_0x3377('0x1b'),auth[_0x3377('0x7')](),controller['showVoiceQueues']);router[_0x3377('0x1c')](_0x3377('0x1b'),auth['isAuthenticated'](),controller[_0x3377('0x1d')]);router['get']('/outbound',auth[_0x3377('0x7')](),controller[_0x3377('0x1e')]);router['get'](_0x3377('0x1f'),auth[_0x3377('0x7')](),controller['outboundChannels']);router['get'](_0x3377('0x20'),auth[_0x3377('0x7')](),controller[_0x3377('0x21')]);router[_0x3377('0x1c')](_0x3377('0x22'),auth[_0x3377('0x7')](),controller['agentCapacity']);router[_0x3377('0x5')](_0x3377('0x23'),auth[_0x3377('0x7')](),controller[_0x3377('0x24')]);router[_0x3377('0x5')](_0x3377('0x25'),auth[_0x3377('0x7')](),controller[_0x3377('0x26')]);router[_0x3377('0x5')](_0x3377('0x27'),auth[_0x3377('0x7')](),controller[_0x3377('0x28')]);router[_0x3377('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x3377('0x5')]('/chat/queues/waitinginteractions',auth[_0x3377('0x7')](),controller[_0x3377('0x29')]);router['get'](_0x3377('0x2a'),auth['isAuthenticated'](),controller[_0x3377('0x2b')]);router[_0x3377('0x5')](_0x3377('0x2c'),auth[_0x3377('0x7')](),controller[_0x3377('0x2d')]);router[_0x3377('0x5')](_0x3377('0x2e'),auth[_0x3377('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x3377('0x2f'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x3377('0x5')](_0x3377('0x30'),auth[_0x3377('0x7')](),controller[_0x3377('0x31')]);router['get'](_0x3377('0x32'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3377('0x33')]('mail'));router[_0x3377('0x5')](_0x3377('0x34'),auth[_0x3377('0x7')](),controller[_0x3377('0x35')]);router[_0x3377('0x36')](_0x3377('0x37'),auth[_0x3377('0x7')](),controller[_0x3377('0x33')](_0x3377('0x38')));router[_0x3377('0x5')]('/chat/queues/:id',auth[_0x3377('0x7')](),controller['showChatQueues']);router[_0x3377('0x36')](_0x3377('0x39'),auth[_0x3377('0x7')](),controller[_0x3377('0x33')](_0x3377('0x3a')));router['get'](_0x3377('0x3b'),auth[_0x3377('0x7')](),controller['showFaxQueues']);router[_0x3377('0x36')](_0x3377('0x3c'),auth[_0x3377('0x7')](),controller[_0x3377('0x33')](_0x3377('0x3d')));router[_0x3377('0x5')](_0x3377('0x3e'),auth[_0x3377('0x7')](),controller[_0x3377('0x3f')]);router['post'](_0x3377('0x40'),auth[_0x3377('0x7')](),controller[_0x3377('0x33')]('sms'));router['post'](_0x3377('0x41'),auth[_0x3377('0x7')](),controller[_0x3377('0x33')](_0x3377('0x42')));router[_0x3377('0x5')](_0x3377('0x43'),auth[_0x3377('0x7')](),controller[_0x3377('0x44')]);router[_0x3377('0x5')](_0x3377('0x45'),auth['isAuthenticated'](),controller[_0x3377('0x46')]);router[_0x3377('0x36')]('/agents/:id/notify',auth[_0x3377('0x7')](),controller[_0x3377('0x47')]);module['exports']=router;
\ No newline at end of file
index 28cf64c..a6e4001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','Message','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','agent','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api'];(function(_0x41f01d,_0x19f328){var _0x1a1220=function(_0x40830e){while(--_0x40830e){_0x41f01d['push'](_0x41f01d['shift']());}};_0x1a1220(++_0x19f328);}(_0x81bd,0x7c));var _0xd81b=function(_0x28ff30,_0x342f9c){_0x28ff30=_0x28ff30-0x0;var _0x453c8b=_0x81bd[_0x28ff30];return _0x453c8b;};'use strict';var BPromise=require(_0xd81b('0x0'));var moment=require(_0xd81b('0x1'));var _=require(_0xd81b('0x2'));var util=require(_0xd81b('0x3'));var db=require(_0xd81b('0x4'))['db'];var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232a});var mailClient=jayson[_0xd81b('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){var _0x223515=_0x5e14e8?_0x5e14e8:amiClient;return _0x223515[_0xd81b('0x9')](_0x1f3f2c,_0x562084)[_0xd81b('0xa')](function(_0x86dab6){if(_0x86dab6[_0xd81b('0xb')]){if(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xc')]===0x1f4){return _0x5468d5(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}return _0xa4cf97(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}else{_0xa4cf97(_0x86dab6[_0xd81b('0xe')]);}})[_0xd81b('0xf')](function(_0x560530){_0x5468d5(_0x560530);});});}function respondWithResult(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xc8;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x10')](_0x57f71d)['json'](_0x3f2405);}return _0x21dfff[_0xd81b('0x11')](0x194);};}function handleError(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0x1f4;return function(_0x41bf7a){logger[_0xd81b('0xb')](_0x41bf7a[_0xd81b('0x12')]);if(_0x41bf7a[_0xd81b('0x13')]){delete _0x41bf7a['name'];}_0x47dd04[_0xd81b('0x10')](_0x13dd00)[_0xd81b('0x14')](_0x41bf7a);};}function findById(_0x5c2863){return function(_0x2abef4){if(!_[_0xd81b('0x15')](_0x5c2863)&&!_[_0xd81b('0x15')](_0x2abef4)&&!_[_0xd81b('0x15')](_0x2abef4[_0xd81b('0x16')])){return _[_0xd81b('0x17')](_0x2abef4[_0xd81b('0x16')],function(_0x3d4d34){return _0x3d4d34['id']==_0x5c2863;});}return null;};}exports[_0xd81b('0x18')]=function(_0x285164,_0x1ff3c6){return respondWithRpcPromise(_0xd81b('0x19'),_0x285164[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x1ff3c6,null))[_0xd81b('0xf')](handleError(_0x1ff3c6,null));};exports[_0xd81b('0x1b')]=function(_0x5f101a,_0x4d566e){return respondWithRpcPromise(_0xd81b('0x1c'),_[_0xd81b('0x1d')](_0x5f101a[_0xd81b('0x1a')],_0x5f101a['params']))[_0xd81b('0xa')](respondWithResult(_0x4d566e,null))[_0xd81b('0xf')](handleError(_0x4d566e,null));};exports['voiceChannelStopMixMonitor']=function(_0xcd6474,_0x13d687){return respondWithRpcPromise(_0xd81b('0x1e'),_[_0xd81b('0x1d')](_0xcd6474[_0xd81b('0x1a')],_0xcd6474[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x13d687,null))[_0xd81b('0xf')](handleError(_0x13d687,null));};exports[_0xd81b('0x20')]=function(_0x212c4e,_0x2ccedf){return respondWithRpcPromise(_0xd81b('0x21'),_0x212c4e['query'])[_0xd81b('0xa')](respondWithResult(_0x2ccedf,null))[_0xd81b('0xf')](handleError(_0x2ccedf,null));};exports[_0xd81b('0x22')]=function(_0x31b9fd,_0x3266c2){return respondWithRpcPromise(_0xd81b('0x21'),_0x31b9fd[_0xd81b('0x1a')])[_0xd81b('0xa')](findById(_0x31b9fd[_0xd81b('0x1f')]['id']))['then'](respondWithResult(_0x3266c2,null))[_0xd81b('0xf')](handleError(_0x3266c2,null));};exports['updateVoiceQueue']=function(_0x5c8aee,_0xb9ff9f){return respondWithRpcPromise(_0xd81b('0x23'),_['merge'](_0x5c8aee['body'],_0x5c8aee[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0xb9ff9f,null))[_0xd81b('0xf')](handleError(_0xb9ff9f,null));};exports[_0xd81b('0x24')]=function(_0x1a1572,_0x4654ba){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xd81b('0x1d')](_0x1a1572[_0xd81b('0x1a')],_0x1a1572['params']))['then'](respondWithResult(_0x4654ba,null))[_0xd81b('0xf')](handleError(_0x4654ba,null));};exports[_0xd81b('0x25')]=function(_0x50472a,_0x50ce25){return respondWithRpcPromise('VoiceQueuesChannels',_0x50472a[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x50ce25,null))[_0xd81b('0xf')](handleError(_0x50ce25,null));};exports[_0xd81b('0x26')]=function(_0xa56339,_0x12ee8f){return respondWithRpcPromise(_0xd81b('0x27'),_['merge'](_0xa56339[_0xd81b('0x1a')],_0xa56339['params']))[_0xd81b('0xa')](respondWithResult(_0x12ee8f,null))[_0xd81b('0xf')](handleError(_0x12ee8f,null));};exports[_0xd81b('0x28')]=function(_0xcd9e86,_0x36c69f){return respondWithRpcPromise(_0xd81b('0x29'),_[_0xd81b('0x1d')](_0xcd9e86[_0xd81b('0x1a')],_0xcd9e86[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x36c69f,null))[_0xd81b('0xf')](handleError(_0x36c69f,null));};exports[_0xd81b('0x2a')]=function(_0x346038,_0x57bc0c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd81b('0x1d')](_0x346038[_0xd81b('0x1a')],_0x346038[_0xd81b('0x1f')]))['then'](respondWithResult(_0x57bc0c,null))[_0xd81b('0xf')](handleError(_0x57bc0c,null));};exports[_0xd81b('0x2b')]=function(_0x5a236a,_0x46f058){return respondWithRpcPromise(_0xd81b('0x2c'),_0x5a236a['query'])[_0xd81b('0xa')](respondWithResult(_0x46f058,null))['catch'](handleError(_0x46f058,null));};exports[_0xd81b('0x2d')]=function(_0x2502d1,_0x203365){return respondWithRpcPromise(_0xd81b('0x2e'),_0x2502d1['query'])[_0xd81b('0xa')](respondWithResult(_0x203365,null))[_0xd81b('0xf')](handleError(_0x203365,null));};exports[_0xd81b('0x2f')]=function(_0x67fbe5,_0x3abd60){var _0x466e98;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'])[_0xd81b('0xa')](function(_0x35a295){_0x466e98=_0x35a295;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'],routingClient);})[_0xd81b('0xa')](function(_0x3a05f4){return _[_0xd81b('0x1d')]({},_0x3a05f4,_0x466e98);})[_0xd81b('0xa')](respondWithResult(_0x3abd60,null))[_0xd81b('0xf')](handleError(_0x3abd60,null));};exports['agentCapacity']=function(_0x3dfba7,_0x11d617){if(_0x3dfba7[_0xd81b('0x31')]&&_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]&&_0x3dfba7[_0xd81b('0x33')]&&_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]){for(var _0x4405a8 in _0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]){if(_0x3dfba7['body'][_0xd81b('0x32')][_0xd81b('0x34')](_0x4405a8)){db[_0xd81b('0x35')][_0xd81b('0x36')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'exitAt':null,'uniqueid':_0x3dfba7[_0xd81b('0x31')]['interaction'][_0x4405a8]&&_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')]?{'$notIn':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8]}:{'$ne':null}}})[_0xd81b('0xa')](function(_0x37031b){var _0x334bd0=moment()[_0xd81b('0x39')](_0xd81b('0x3a'));for(var _0xcfbbc2=0x0,_0x41e2e6=_0x37031b[_0xd81b('0x38')];_0xcfbbc2<_0x41e2e6;_0xcfbbc2+=0x1){_0x37031b[_0xcfbbc2]['updateAttributes']({'exitAt':_0x334bd0});}});for(var _0x27d18a=0x0;_0x27d18a<_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')];_0x27d18a+=0x1){db[_0xd81b('0x35')][_0xd81b('0x3b')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'uniqueid':_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0x27d18a],'exitAt':null},'defaults':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'interface':_[_0xd81b('0x15')](_0x3dfba7['user'][_0xd81b('0x3c')])?util[_0xd81b('0x39')](_0xd81b('0x3d'),_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]):_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3c')],'type':_0xd81b('0x37'),'enterAt':moment()[_0xd81b('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3e')],'uniqueid':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0x27d18a]}});}}}}return respondWithRpcPromise(_0xd81b('0x3f'),{'id':_0x3dfba7[_0xd81b('0x1f')]['id'],'capacity':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x40')]},routingClient)['then'](respondWithResult(_0x11d617,null))[_0xd81b('0xf')](handleError(_0x11d617,null));};exports[_0xd81b('0x41')]=function(_0x1b523c,_0x3d171a){return respondWithRpcPromise(_0xd81b('0x42'),_0x1b523c['query'])[_0xd81b('0xa')](respondWithResult(_0x3d171a,null))[_0xd81b('0xf')](handleError(_0x3d171a,null));};exports['trunks']=function(_0x1f13c3,_0x315bd5){return respondWithRpcPromise(_0xd81b('0x43'),_0x1f13c3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x315bd5,null))[_0xd81b('0xf')](handleError(_0x315bd5,null));};exports[_0xd81b('0x44')]=function(_0x22f588,_0x3ed626){return respondWithRpcPromise(_0xd81b('0x45'),_0x22f588[_0xd81b('0x1a')])['then'](respondWithResult(_0x3ed626,null))[_0xd81b('0xf')](handleError(_0x3ed626,null));};exports['chatQueues']=function(_0x1800fa,_0x7b438c){return respondWithRpcPromise(_0xd81b('0x46'),_0x1800fa[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x7b438c,null))[_0xd81b('0xf')](handleError(_0x7b438c,null));};exports['showChatQueues']=function(_0x2d978d,_0xe0c9c6){return respondWithRpcPromise('ChatQueues',_0x2d978d['query'],routingClient)[_0xd81b('0xa')](findById(_0x2d978d['params']['id']))[_0xd81b('0xa')](respondWithResult(_0xe0c9c6,null))['catch'](handleError(_0xe0c9c6,null));};exports[_0xd81b('0x47')]=function(_0x315a66,_0x3d97ba){return respondWithRpcPromise('MailQueues',_0x315a66[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3d97ba,null))['catch'](handleError(_0x3d97ba,null));};exports[_0xd81b('0x48')]=function(_0x108aaf,_0x5951ec){return respondWithRpcPromise(_0xd81b('0x49'),_0x108aaf['query'],routingClient)[_0xd81b('0xa')](findById(_0x108aaf[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5951ec,null))[_0xd81b('0xf')](handleError(_0x5951ec,null));};exports[_0xd81b('0x4a')]=function(_0x32eab4,_0x2f2afe){return respondWithRpcPromise(_0xd81b('0x4b'),_0x32eab4[_0xd81b('0x1a')],mailClient)[_0xd81b('0xa')](respondWithResult(_0x2f2afe,null))['catch'](handleError(_0x2f2afe,null));};exports[_0xd81b('0x4c')]=function(_0x434434,_0x385841){return respondWithRpcPromise(_0xd81b('0x4d'),_0x434434[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x385841,null))[_0xd81b('0xf')](handleError(_0x385841,null));};exports['showOpenchannelQueues']=function(_0x57f0fb,_0x5de22d){return respondWithRpcPromise(_0xd81b('0x4d'),_0x57f0fb[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x57f0fb[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5de22d,null))[_0xd81b('0xf')](handleError(_0x5de22d,null));};exports[_0xd81b('0x4e')]=function(_0x5afecf,_0x3fcd8c){return respondWithRpcPromise(_0xd81b('0x4f'),_0x5afecf[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3fcd8c,null))[_0xd81b('0xf')](handleError(_0x3fcd8c,null));};exports[_0xd81b('0x50')]=function(_0xb5fca8,_0x4ed17d){return respondWithRpcPromise(_0xd81b('0x4f'),_0xb5fca8[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0xb5fca8[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x4ed17d,null))[_0xd81b('0xf')](handleError(_0x4ed17d,null));};exports[_0xd81b('0x51')]=function(_0x19d4f0,_0x8fa8cd){return respondWithRpcPromise(_0xd81b('0x52'),_0x19d4f0[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x8fa8cd,null))['catch'](handleError(_0x8fa8cd,null));};exports[_0xd81b('0x53')]=function(_0x5358a6,_0x2e7141){return respondWithRpcPromise(_0xd81b('0x52'),_0x5358a6[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x5358a6[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x2e7141,null))[_0xd81b('0xf')](handleError(_0x2e7141,null));};exports[_0xd81b('0x54')]=function(_0x10d6d2,_0x36fb7a){return respondWithRpcPromise('FaxQueues',_0x10d6d2[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x36fb7a,null))[_0xd81b('0xf')](handleError(_0x36fb7a,null));};exports[_0xd81b('0x55')]=function(_0x7720d3,_0x5abbb4){return respondWithRpcPromise('FaxQueues',_0x7720d3[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x7720d3[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5abbb4,null))[_0xd81b('0xf')](handleError(_0x5abbb4,null));};exports[_0xd81b('0x56')]=function(_0xaee7e3,_0x539132){return respondWithRpcPromise(_0xd81b('0x57'),_0xaee7e3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x539132,null))[_0xd81b('0xf')](handleError(_0x539132,null));};exports[_0xd81b('0x58')]=function(_0x21d039,_0x1e0da3){return respondWithRpcPromise(_0xd81b('0x59'),_0x21d039[_0xd81b('0x1a')],routingClient)['then'](respondWithResult(_0x1e0da3,null))[_0xd81b('0xf')](handleError(_0x1e0da3,null));};exports[_0xd81b('0x5a')]=function(_0x3858eb,_0x9c30e7){return respondWithRpcPromise(_0xd81b('0x5b'),_0x3858eb['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x9c30e7,null))[_0xd81b('0xf')](handleError(_0x9c30e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xa00645,_0x43e593){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xa00645[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x43e593,null))[_0xd81b('0xf')](handleError(_0x43e593,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2aff4b,_0x3db4d7){return respondWithRpcPromise(_0xd81b('0x5c'),_0x2aff4b['query'],routingClient)['then'](function(_0xdd970d){if(_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')]!==undefined){var _0x5d601d=_(_0xdd970d[_0xd81b('0x16')])[_0xd81b('0x5e')]([_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')],_0x2aff4b['params']['id']])['map'](_0xd81b('0x5f'))[_0xd81b('0x60')]()[_0xd81b('0x61')]();return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x1b8b17){return _0x5d601d[_0xd81b('0x62')](_0x1b8b17['queue_id'])>-0x1;});}else{return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x32a8f4){return _0x32a8f4[_0xd81b('0x5f')]===parseInt(_0x2aff4b['params']['id']);});}})[_0xd81b('0xa')](respondWithResult(_0x3db4d7,null))[_0xd81b('0xf')](handleError(_0x3db4d7,null));};exports[_0xd81b('0x63')]=function(_0x2490f1,_0x2b0fe4){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2490f1[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b0fe4,null))[_0xd81b('0xf')](handleError(_0x2b0fe4,null));};exports[_0xd81b('0x64')]=function(_0x1919b2,_0x2b1d96){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x1919b2['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b1d96,null))[_0xd81b('0xf')](handleError(_0x2b1d96,null));};exports[_0xd81b('0x65')]=function(_0x15aed5,_0x4dd8ac){return respondWithRpcPromise(_0xd81b('0x66'),_0x15aed5[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x4dd8ac,null))[_0xd81b('0xf')](handleError(_0x4dd8ac,null));};exports[_0xd81b('0x67')]=function(_0x589882){return function(_0x3744bf,_0x374ac0){var _0x159b28,_0x40b468;var _0x1d596c=_[_0xd81b('0x68')](_0x589882);var _0x402eb9=_0x589882==='chat'?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0x1d596c+_0xd81b('0x6b')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x3744bf[_0xd81b('0x1f')]['id']}})[_0xd81b('0xa')](function(_0x59bee6){if(_[_0xd81b('0x15')](_0x59bee6)){throw new Error(_0x1d596c+'\x20Queue\x20not\x20found');}_0x159b28=_0x59bee6;return db[_0x1d596c+_0xd81b('0x6d')][_0xd81b('0x6c')]({'where':{'id':_0x3744bf[_0xd81b('0x31')]['messageId']},'include':[{'model':db[_0x1d596c+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x1d596c+_0x402eb9],'as':_0xd81b('0x6a')}]});})[_0xd81b('0xa')](function(_0x254105){if(_[_0xd81b('0x15')](_0x254105)){throw new Error(_0x1d596c+'\x20Message\x20not\x20found');}_0x40b468=_0x254105;return _0x254105[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5f5514={'uniqueid':_0x589882+'.'+_0x40b468['id']+'.'+_0x40b468[_0xd81b('0x6e')]['id'],'FromUserId':_0x3744bf[_0xd81b('0x33')]['id'],'type':_0xd81b('0x70')};_0x5f5514[_0x1d596c+'MessageId']=_0x40b468['id'];_0x5f5514[_0x1d596c+_0xd81b('0x71')]=_0x40b468[_0xd81b('0x6e')]['id'];_0x5f5514[_0xd81b('0x72')+_0x1d596c+_0x402eb9+'Id']=_0x40b468[_0xd81b('0x6a')]['id'];_0x5f5514['To'+_0x1d596c+_0xd81b('0x73')]=_0x159b28['id'];return db[_0x1d596c+_0xd81b('0x74')]['create'](_0x5f5514);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x589882,'interaction':_0x40b468[_0xd81b('0x6e')],'message':_0x40b468,'account':_0x40b468[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x70'),'appdata':_0x159b28[_0xd81b('0x13')]+','+(_0x40b468[_0xd81b('0x6a')][_0xd81b('0x76')]||0x12c),'interval':_0xd81b('0x77')}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x374ac0,null))[_0xd81b('0xf')](handleError(_0x374ac0,null));};};exports[_0xd81b('0x78')]=function(_0x42eb62,_0x2c19fd){var _0x36d8fd,_0x5adfe4;if(_[_0xd81b('0x15')](_0x42eb62['body'][_0xd81b('0x79')])){throw new Error(_0xd81b('0x7a'));}var _0x1ca94b=_0x42eb62[_0xd81b('0x31')][_0xd81b('0x79')];var _0x115805=_['capitalize'](_0x1ca94b);var _0x3a41e6=_0x1ca94b===_0xd81b('0x7b')?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0xd81b('0x7c')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x42eb62[_0xd81b('0x1f')]['id'],'role':_0xd81b('0x7d')}})[_0xd81b('0xa')](function(_0xfacc8f){if(_[_0xd81b('0x15')](_0xfacc8f)){throw new Error(_0xd81b('0x7e'));}_0x36d8fd=_0xfacc8f;return db[_0x115805+'Message'][_0xd81b('0x6c')]({'where':{'id':_0x42eb62[_0xd81b('0x31')][_0xd81b('0x7f')]},'include':[{'model':db[_0x115805+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x115805+_0x3a41e6],'as':'Account'}]});})[_0xd81b('0xa')](function(_0x1e61d8){if(_[_0xd81b('0x15')](_0x1e61d8)){throw new Error(_0x115805+_0xd81b('0x80'));}_0x5adfe4=_0x1e61d8;return _0x1e61d8[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd81b('0xa')](function(){var _0x4e4919={'uniqueid':_0x1ca94b+'.'+_0x5adfe4['id']+'.'+_0x5adfe4[_0xd81b('0x6e')]['id'],'FromUserId':_0x42eb62['user']['id'],'type':_0xd81b('0x70'),'ToUserId':_0x36d8fd['id']};_0x4e4919[_0x115805+_0xd81b('0x81')]=_0x5adfe4['id'];_0x4e4919[_0x115805+_0xd81b('0x71')]=_0x5adfe4[_0xd81b('0x6e')]['id'];_0x4e4919['From'+_0x115805+_0x3a41e6+'Id']=_0x5adfe4[_0xd81b('0x6a')]['id'];return db[_0x115805+_0xd81b('0x74')]['create'](_0x4e4919);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x1ca94b,'interaction':_0x5adfe4[_0xd81b('0x6e')],'message':_0x5adfe4,'account':_0x5adfe4[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x7d'),'appdata':_0x36d8fd['name']+','+(_0x5adfe4['Account'][_0xd81b('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x2c19fd,null))['catch'](handleError(_0x2c19fd,null));};
\ No newline at end of file
+var _0xdc97=['agents','Agents','agentCapacity','user','interaction','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','TransferReport','create','Start','queue','*,*,*,*','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','InteractionId','bluebird','moment','lodash','../../mysqldb','api','jayson/promise','http','client','request','then','error','code','message','json','sendStatus','name','status','send','isNil','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels'];(function(_0xc5b3ec,_0x167a23){var _0x15c6a5=function(_0x16c1cc){while(--_0x16c1cc){_0xc5b3ec['push'](_0xc5b3ec['shift']());}};_0x15c6a5(++_0x167a23);}(_0xdc97,0x13b));var _0x7dc9=function(_0x37cb7e,_0x5652d8){_0x37cb7e=_0x37cb7e-0x0;var _0x2b22d2=_0xdc97[_0x37cb7e];return _0x2b22d2;};'use strict';var BPromise=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var _=require(_0x7dc9('0x2'));var util=require('util');var db=require(_0x7dc9('0x3'))['db'];var logger=require('../../config/logger')(_0x7dc9('0x4'));var jayson=require(_0x7dc9('0x5'));var amiClient=jayson['client'][_0x7dc9('0x6')]({'port':0x232a});var mailClient=jayson[_0x7dc9('0x7')][_0x7dc9('0x6')]({'port':0x232b});var routingClient=jayson[_0x7dc9('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){var _0x3318ea=_0x4b3229?_0x4b3229:amiClient;return _0x3318ea[_0x7dc9('0x8')](_0x2636ef,_0x4f91c7)[_0x7dc9('0x9')](function(_0x5ca05b){if(_0x5ca05b[_0x7dc9('0xa')]){if(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xb')]===0x1f4){return _0x23737d(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}return _0x2ff923(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}else{_0x2ff923(_0x5ca05b['result']);}})['catch'](function(_0x4be1c8){_0x23737d(_0x4be1c8);});});}function respondWithResult(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xc8;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['status'](_0x94c75a)[_0x7dc9('0xd')](_0x14e5db);}return _0x599ef1[_0x7dc9('0xe')](0x194);};}function handleError(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0x1f4;return function(_0x31d43d){logger[_0x7dc9('0xa')](_0x31d43d['stack']);if(_0x31d43d[_0x7dc9('0xf')]){delete _0x31d43d[_0x7dc9('0xf')];}_0xaadf2[_0x7dc9('0x10')](_0xf37bc7)[_0x7dc9('0x11')](_0x31d43d);};}function findById(_0x11606f){return function(_0xbe0437){if(!_[_0x7dc9('0x12')](_0x11606f)&&!_[_0x7dc9('0x12')](_0xbe0437)&&!_[_0x7dc9('0x12')](_0xbe0437['rows'])){return _[_0x7dc9('0x13')](_0xbe0437['rows'],function(_0x1f5906){return _0x1f5906['id']==_0x11606f;});}return null;};}exports[_0x7dc9('0x14')]=function(_0x5d61d7,_0x41f66e){return respondWithRpcPromise(_0x7dc9('0x15'),_0x5d61d7[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x41f66e,null))[_0x7dc9('0x17')](handleError(_0x41f66e,null));};exports[_0x7dc9('0x18')]=function(_0x2dad65,_0x2895f5){return respondWithRpcPromise(_0x7dc9('0x19'),_[_0x7dc9('0x1a')](_0x2dad65['query'],_0x2dad65['params']))[_0x7dc9('0x9')](respondWithResult(_0x2895f5,null))[_0x7dc9('0x17')](handleError(_0x2895f5,null));};exports['voiceChannelStopMixMonitor']=function(_0x349001,_0x27f7fa){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7dc9('0x1a')](_0x349001[_0x7dc9('0x16')],_0x349001[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x27f7fa,null))[_0x7dc9('0x17')](handleError(_0x27f7fa,null));};exports[_0x7dc9('0x1c')]=function(_0xf95336,_0x55a482){return respondWithRpcPromise('VoiceQueues',_0xf95336['query'])[_0x7dc9('0x9')](respondWithResult(_0x55a482,null))[_0x7dc9('0x17')](handleError(_0x55a482,null));};exports['showVoiceQueues']=function(_0x585eef,_0x47771b){return respondWithRpcPromise('VoiceQueues',_0x585eef[_0x7dc9('0x16')])[_0x7dc9('0x9')](findById(_0x585eef[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x47771b,null))[_0x7dc9('0x17')](handleError(_0x47771b,null));};exports[_0x7dc9('0x1d')]=function(_0x236d42,_0x229f8e){return respondWithRpcPromise(_0x7dc9('0x1e'),_[_0x7dc9('0x1a')](_0x236d42[_0x7dc9('0x1f')],_0x236d42[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x229f8e,null))['catch'](handleError(_0x229f8e,null));};exports['voiceQueuesPreview']=function(_0x49a4a5,_0x4a68f0){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x49a4a5['query'],_0x49a4a5[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4a68f0,null))[_0x7dc9('0x17')](handleError(_0x4a68f0,null));};exports[_0x7dc9('0x20')]=function(_0x3300ff,_0x154e22){return respondWithRpcPromise('VoiceQueuesChannels',_0x3300ff['query'])['then'](respondWithResult(_0x154e22,null))[_0x7dc9('0x17')](handleError(_0x154e22,null));};exports['voiceQueuesChannel']=function(_0x2b9ca0,_0x448e46){return respondWithRpcPromise(_0x7dc9('0x21'),_[_0x7dc9('0x1a')](_0x2b9ca0[_0x7dc9('0x16')],_0x2b9ca0[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x448e46,null))[_0x7dc9('0x17')](handleError(_0x448e46,null));};exports['voiceQueuesChannelHangup']=function(_0x2b56d7,_0x4cdec4){return respondWithRpcPromise(_0x7dc9('0x22'),_[_0x7dc9('0x1a')](_0x2b56d7[_0x7dc9('0x16')],_0x2b56d7[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x4cdec4,null))[_0x7dc9('0x17')](handleError(_0x4cdec4,null));};exports['voiceQueuesChannelRedirect']=function(_0x289560,_0x4f47af){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x7dc9('0x1a')](_0x289560[_0x7dc9('0x16')],_0x289560[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4f47af,null))['catch'](handleError(_0x4f47af,null));};exports[_0x7dc9('0x23')]=function(_0x183d87,_0x138f33){return respondWithRpcPromise(_0x7dc9('0x24'),_0x183d87[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x138f33,null))[_0x7dc9('0x17')](handleError(_0x138f33,null));};exports[_0x7dc9('0x25')]=function(_0x166906,_0x21bcfc){return respondWithRpcPromise(_0x7dc9('0x26'),_0x166906[_0x7dc9('0x16')])['then'](respondWithResult(_0x21bcfc,null))[_0x7dc9('0x17')](handleError(_0x21bcfc,null));};exports[_0x7dc9('0x27')]=function(_0x466b02,_0xfd2612){var _0x4bcdce;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')])[_0x7dc9('0x9')](function(_0x3876b6){_0x4bcdce=_0x3876b6;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')],routingClient);})['then'](function(_0x553230){return _[_0x7dc9('0x1a')]({},_0x553230,_0x4bcdce);})[_0x7dc9('0x9')](respondWithResult(_0xfd2612,null))['catch'](handleError(_0xfd2612,null));};exports[_0x7dc9('0x29')]=function(_0x4a37ec,_0x315d65){if(_0x4a37ec[_0x7dc9('0x1f')]&&_0x4a37ec[_0x7dc9('0x1f')]['interaction']&&_0x4a37ec[_0x7dc9('0x2a')]&&_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]){for(var _0x95513c in _0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')]){if(_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x7dc9('0x2c')](_0x95513c)){db['MemberReport']['findAll']({'where':{'channel':_0x95513c,'membername':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')],'type':_0x7dc9('0x2d'),'exitAt':null,'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c]&&_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')]?{'$notIn':_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x95513c]}:{'$ne':null}}})[_0x7dc9('0x9')](function(_0x1971c7){var _0x3c4d4c=moment()[_0x7dc9('0x2f')](_0x7dc9('0x30'));for(var _0x19957f=0x0,_0x575393=_0x1971c7[_0x7dc9('0x2e')];_0x19957f<_0x575393;_0x19957f+=0x1){_0x1971c7[_0x19957f][_0x7dc9('0x31')]({'exitAt':_0x3c4d4c});}});for(var _0x49bffe=0x0;_0x49bffe<_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')];_0x49bffe+=0x1){db['MemberReport'][_0x7dc9('0x32')]({'where':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'type':_0x7dc9('0x2d'),'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe],'exitAt':null},'defaults':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'interface':_[_0x7dc9('0x12')](_0x4a37ec['user'][_0x7dc9('0x33')])?util[_0x7dc9('0x2f')]('SIP/%s',_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]):_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x33')],'type':_0x7dc9('0x2d'),'enterAt':moment()[_0x7dc9('0x2f')](_0x7dc9('0x30')),'role':_0x7dc9('0x34'),'internal':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x35')],'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe]}});}}}}return respondWithRpcPromise(_0x7dc9('0x36'),{'id':_0x4a37ec['params']['id'],'capacity':_0x4a37ec[_0x7dc9('0x1f')]['capacity']},routingClient)['then'](respondWithResult(_0x315d65,null))[_0x7dc9('0x17')](handleError(_0x315d65,null));};exports[_0x7dc9('0x37')]=function(_0x40e382,_0x3902aa){return respondWithRpcPromise(_0x7dc9('0x38'),_0x40e382['query'])[_0x7dc9('0x9')](respondWithResult(_0x3902aa,null))[_0x7dc9('0x17')](handleError(_0x3902aa,null));};exports[_0x7dc9('0x39')]=function(_0x4a9b75,_0x341909){return respondWithRpcPromise(_0x7dc9('0x3a'),_0x4a9b75[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x341909,null))[_0x7dc9('0x17')](handleError(_0x341909,null));};exports[_0x7dc9('0x3b')]=function(_0x593132,_0x366b8b){return respondWithRpcPromise(_0x7dc9('0x3c'),_0x593132[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x3d')]=function(_0x31baf1,_0x24abb6){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x31baf1[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x24abb6,null))[_0x7dc9('0x17')](handleError(_0x24abb6,null));};exports['showChatQueues']=function(_0x1767b6,_0x39be46){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x1767b6[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x1767b6['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x39be46,null))[_0x7dc9('0x17')](handleError(_0x39be46,null));};exports[_0x7dc9('0x3f')]=function(_0x17ed6c,_0x2a1db8){return respondWithRpcPromise(_0x7dc9('0x40'),_0x17ed6c['query'],routingClient)['then'](respondWithResult(_0x2a1db8,null))['catch'](handleError(_0x2a1db8,null));};exports[_0x7dc9('0x41')]=function(_0x3daf33,_0x32a64f){return respondWithRpcPromise(_0x7dc9('0x40'),_0x3daf33['query'],routingClient)['then'](findById(_0x3daf33[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x32a64f,null))[_0x7dc9('0x17')](handleError(_0x32a64f,null));};exports[_0x7dc9('0x42')]=function(_0x2caf7f,_0x2272ef){return respondWithRpcPromise(_0x7dc9('0x43'),_0x2caf7f['query'],mailClient)[_0x7dc9('0x9')](respondWithResult(_0x2272ef,null))[_0x7dc9('0x17')](handleError(_0x2272ef,null));};exports[_0x7dc9('0x44')]=function(_0x1dad95,_0x4683b3){return respondWithRpcPromise('OpenchannelQueues',_0x1dad95[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x4683b3,null))[_0x7dc9('0x17')](handleError(_0x4683b3,null));};exports[_0x7dc9('0x45')]=function(_0x2454d7,_0x3a93c4){return respondWithRpcPromise(_0x7dc9('0x46'),_0x2454d7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x2454d7[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x3a93c4,null))[_0x7dc9('0x17')](handleError(_0x3a93c4,null));};exports[_0x7dc9('0x47')]=function(_0x5eee27,_0x3485b6){return respondWithRpcPromise('SmsQueues',_0x5eee27[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3485b6,null))['catch'](handleError(_0x3485b6,null));};exports[_0x7dc9('0x48')]=function(_0x24d2c7,_0x50e9a9){return respondWithRpcPromise(_0x7dc9('0x49'),_0x24d2c7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x24d2c7['params']['id']))['then'](respondWithResult(_0x50e9a9,null))[_0x7dc9('0x17')](handleError(_0x50e9a9,null));};exports[_0x7dc9('0x4a')]=function(_0x4ed60e,_0x3aba59){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x4ed60e[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3aba59,null))[_0x7dc9('0x17')](handleError(_0x3aba59,null));};exports[_0x7dc9('0x4c')]=function(_0x51b834,_0x35f31e){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x51b834[_0x7dc9('0x16')],routingClient)['then'](findById(_0x51b834['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x35f31e,null))[_0x7dc9('0x17')](handleError(_0x35f31e,null));};exports[_0x7dc9('0x4d')]=function(_0x2cf485,_0x59f3bd){return respondWithRpcPromise('FaxQueues',_0x2cf485[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x59f3bd,null))[_0x7dc9('0x17')](handleError(_0x59f3bd,null));};exports[_0x7dc9('0x4e')]=function(_0x5d211b,_0xea1728){return respondWithRpcPromise(_0x7dc9('0x4f'),_0x5d211b[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x5d211b[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0xea1728,null))[_0x7dc9('0x17')](handleError(_0xea1728,null));};exports['faxAccounts']=function(_0x2d7c33,_0x2cde0c){return respondWithRpcPromise('FaxAccounts',_0x2d7c33['query'])[_0x7dc9('0x9')](respondWithResult(_0x2cde0c,null))['catch'](handleError(_0x2cde0c,null));};exports[_0x7dc9('0x50')]=function(_0x466602,_0xd99a2){return respondWithRpcPromise(_0x7dc9('0x51'),_0x466602[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0xd99a2,null))[_0x7dc9('0x17')](handleError(_0xd99a2,null));};exports[_0x7dc9('0x52')]=function(_0x25f970,_0x30ce2f){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x25f970[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x30ce2f,null))[_0x7dc9('0x17')](handleError(_0x30ce2f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x45c1b3,_0x585e42){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x45c1b3[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x585e42,null))['catch'](handleError(_0x585e42,null));};exports[_0x7dc9('0x53')]=function(_0x533738,_0x5a585a){return respondWithRpcPromise(_0x7dc9('0x54'),_0x533738[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](function(_0xb8be9){if(_0x533738['query'][_0x7dc9('0x55')]!==undefined){var _0xe944a4=_(_0xb8be9[_0x7dc9('0x56')])[_0x7dc9('0x57')]([_0x533738[_0x7dc9('0x16')][_0x7dc9('0x55')],_0x533738[_0x7dc9('0x1b')]['id']])[_0x7dc9('0x58')]('queue_id')['uniq']()[_0x7dc9('0x59')]();return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x1da142){return _0xe944a4[_0x7dc9('0x5a')](_0x1da142[_0x7dc9('0x5b')])>-0x1;});}else{return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x51a7e5){return _0x51a7e5['queue_id']===parseInt(_0x533738[_0x7dc9('0x1b')]['id']);});}})[_0x7dc9('0x9')](respondWithResult(_0x5a585a,null))[_0x7dc9('0x17')](handleError(_0x5a585a,null));};exports[_0x7dc9('0x5c')]=function(_0x5bc1c3,_0x2c3434){return respondWithRpcPromise(_0x7dc9('0x5d'),_0x5bc1c3['query'],routingClient)['then'](respondWithResult(_0x2c3434,null))[_0x7dc9('0x17')](handleError(_0x2c3434,null));};exports[_0x7dc9('0x5e')]=function(_0x49d7ef,_0x114078){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x49d7ef[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x114078,null))[_0x7dc9('0x17')](handleError(_0x114078,null));};exports['faxQueuesWaitingInteractions']=function(_0x33d68c,_0x3c7daf){return respondWithRpcPromise(_0x7dc9('0x5f'),_0x33d68c['query'],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3c7daf,null))['catch'](handleError(_0x3c7daf,null));};exports['queueNotify']=function(_0xa899){return function(_0x26244a,_0x31faa4){var _0x3657b6,_0x26d94e;var _0x56a00d=_[_0x7dc9('0x60')](_0xa899);var _0x1daf80=_0xa899===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x56a00d+'Queue'][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x26244a[_0x7dc9('0x1b')]['id']}})[_0x7dc9('0x9')](function(_0x200df7){if(_['isNil'](_0x200df7)){throw new Error(_0x56a00d+_0x7dc9('0x65'));}_0x3657b6=_0x200df7;return db[_0x56a00d+'Message']['findOne']({'where':{'id':_0x26244a[_0x7dc9('0x1f')]['messageId']},'include':[{'model':db[_0x56a00d+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x56a00d+_0x1daf80],'as':_0x7dc9('0x63')}]});})[_0x7dc9('0x9')](function(_0x38dccc){if(_[_0x7dc9('0x12')](_0x38dccc)){throw new Error(_0x56a00d+'\x20Message\x20not\x20found');}_0x26d94e=_0x38dccc;return _0x38dccc[_0x7dc9('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x1a4bfb={'uniqueid':_0xa899+'.'+_0x26d94e['id']+'.'+_0x26d94e[_0x7dc9('0x66')]['id'],'FromUserId':_0x26244a[_0x7dc9('0x2a')]['id'],'type':'queue'};_0x1a4bfb[_0x56a00d+_0x7dc9('0x68')]=_0x26d94e['id'];_0x1a4bfb[_0x56a00d+'InteractionId']=_0x26d94e[_0x7dc9('0x66')]['id'];_0x1a4bfb[_0x7dc9('0x69')+_0x56a00d+_0x1daf80+'Id']=_0x26d94e[_0x7dc9('0x63')]['id'];_0x1a4bfb['To'+_0x56a00d+'QueueId']=_0x3657b6['id'];return db[_0x56a00d+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x1a4bfb);})['then'](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0xa899,'interaction':_0x26d94e[_0x7dc9('0x66')],'message':_0x26d94e,'account':_0x26d94e[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x6d'),'appdata':_0x3657b6['name']+','+(_0x26d94e[_0x7dc9('0x63')]['queueTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})[_0x7dc9('0x9')](respondWithResult(_0x31faa4,null))[_0x7dc9('0x17')](handleError(_0x31faa4,null));};};exports['agentNotify']=function(_0x160bf0,_0x4588a7){var _0x23da2e,_0x568705;if(_['isNil'](_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x573fa9=_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')];var _0x5f3487=_[_0x7dc9('0x60')](_0x573fa9);var _0x5a44a1=_0x573fa9===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x7dc9('0x70')][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x160bf0[_0x7dc9('0x1b')]['id'],'role':'agent'}})[_0x7dc9('0x9')](function(_0x3fb268){if(_[_0x7dc9('0x12')](_0x3fb268)){throw new Error(_0x7dc9('0x71'));}_0x23da2e=_0x3fb268;return db[_0x5f3487+_0x7dc9('0x72')]['findOne']({'where':{'id':_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x73')]},'include':[{'model':db[_0x5f3487+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x5f3487+_0x5a44a1],'as':'Account'}]});})[_0x7dc9('0x9')](function(_0x54bd64){if(_['isNil'](_0x54bd64)){throw new Error(_0x5f3487+_0x7dc9('0x74'));}_0x568705=_0x54bd64;return _0x54bd64['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x19c880={'uniqueid':_0x573fa9+'.'+_0x568705['id']+'.'+_0x568705[_0x7dc9('0x66')]['id'],'FromUserId':_0x160bf0[_0x7dc9('0x2a')]['id'],'type':_0x7dc9('0x6d'),'ToUserId':_0x23da2e['id']};_0x19c880[_0x5f3487+_0x7dc9('0x68')]=_0x568705['id'];_0x19c880[_0x5f3487+_0x7dc9('0x75')]=_0x568705[_0x7dc9('0x66')]['id'];_0x19c880['From'+_0x5f3487+_0x5a44a1+'Id']=_0x568705[_0x7dc9('0x63')]['id'];return db[_0x5f3487+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x19c880);})[_0x7dc9('0x9')](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0x573fa9,'interaction':_0x568705['Interaction'],'message':_0x568705,'account':_0x568705[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x34'),'appdata':_0x23da2e[_0x7dc9('0xf')]+','+(_0x568705[_0x7dc9('0x63')]['agentTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})['then'](respondWithResult(_0x4588a7,null))[_0x7dc9('0x17')](handleError(_0x4588a7,null));};
\ No newline at end of file
index e8ac0d8..b6a91a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9efc=['put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x4a1e25,_0x452e0b){var _0x312e64=function(_0x2192eb){while(--_0x2192eb){_0x4a1e25['push'](_0x4a1e25['shift']());}};_0x312e64(++_0x452e0b);}(_0x9efc,0xdc));var _0xc9ef=function(_0x3bac2b,_0x2de937){_0x3bac2b=_0x3bac2b-0x0;var _0xc43b6a=_0x9efc[_0x3bac2b];return _0xc43b6a;};'use strict';var multer=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var path=require(_0xc9ef('0x2'));var timeout=require(_0xc9ef('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc9ef('0x4'));var interaction=require(_0xc9ef('0x5'));var config=require(_0xc9ef('0x6'));var controller=require(_0xc9ef('0x7'));router['get']('/',auth[_0xc9ef('0x8')](),controller[_0xc9ef('0x9')]);router[_0xc9ef('0xa')](_0xc9ef('0xb'),auth[_0xc9ef('0x8')](),controller[_0xc9ef('0xc')]);router[_0xc9ef('0xa')]('/:id/run',auth[_0xc9ef('0x8')](),controller['run']);router[_0xc9ef('0xd')]('/',auth[_0xc9ef('0x8')](),controller['create']);router[_0xc9ef('0xe')](_0xc9ef('0xb'),auth['isAuthenticated'](),controller[_0xc9ef('0xf')]);router[_0xc9ef('0x10')]('/:id',auth[_0xc9ef('0x8')](),controller[_0xc9ef('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7e92=['fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x33d2e7,_0x4c1260){var _0x53c6e0=function(_0x345fd8){while(--_0x345fd8){_0x33d2e7['push'](_0x33d2e7['shift']());}};_0x53c6e0(++_0x4c1260);}(_0x7e92,0x119));var _0x27e9=function(_0x356276,_0x525d26){_0x356276=_0x356276-0x0;var _0x3521ac=_0x7e92[_0x356276];return _0x3521ac;};'use strict';var multer=require(_0x27e9('0x0'));var util=require('util');var path=require(_0x27e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x27e9('0x2'));var router=express[_0x27e9('0x3')]();var fs_extra=require(_0x27e9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x27e9('0x5'));var config=require('../../config/environment');var controller=require(_0x27e9('0x6'));router[_0x27e9('0x7')]('/',auth[_0x27e9('0x8')](),controller['index']);router[_0x27e9('0x7')](_0x27e9('0x9'),auth[_0x27e9('0x8')](),controller[_0x27e9('0xa')]);router[_0x27e9('0x7')](_0x27e9('0xb'),auth[_0x27e9('0x8')](),controller[_0x27e9('0xc')]);router['post']('/',auth[_0x27e9('0x8')](),controller[_0x27e9('0xd')]);router[_0x27e9('0xe')](_0x27e9('0x9'),auth['isAuthenticated'](),controller[_0x27e9('0xf')]);router[_0x27e9('0x10')]('/:id',auth[_0x27e9('0x8')](),controller[_0x27e9('0x11')]);module[_0x27e9('0x12')]=router;
\ No newline at end of file
index c208998..e07ff67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1e8=['custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','days','hours','minutes','csv','xlsx'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf1e8,0x112));var _0x8f1e=function(_0x226008,_0x1c6290){_0x226008=_0x226008-0x0;var _0x419f39=_0xf1e8[_0x226008];return _0x419f39;};'use strict';var Sequelize=require(_0x8f1e('0x0'));module[_0x8f1e('0x1')]={'name':{'type':Sequelize[_0x8f1e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8f1e('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8f1e('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x8f1e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8f1e('0x5')](_0x8f1e('0x6'),_0x8f1e('0x7'),_0x8f1e('0x8'),'weeks',_0x8f1e('0x9'),_0x8f1e('0xa'),_0x8f1e('0xb')),'allowNull':![],'defaultValue':_0x8f1e('0x9')},'output':{'type':Sequelize[_0x8f1e('0x5')](_0x8f1e('0xc'),'pdf',_0x8f1e('0xd')),'allowNull':![],'defaultValue':_0x8f1e('0xc')},'type':{'type':Sequelize['ENUM'](_0x8f1e('0xe'),_0x8f1e('0xf')),'allowNull':![],'defaultValue':_0x8f1e('0xe')},'sendMail':{'type':Sequelize[_0x8f1e('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x8f1e('0x2')]},'cc':{'type':Sequelize[_0x8f1e('0x11')]},'bcc':{'type':Sequelize[_0x8f1e('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x8f1e('0x10')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x15b3=['pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','days','hours'];(function(_0x6a615e,_0x56b1f8){var _0x13adf1=function(_0x13f58c){while(--_0x13f58c){_0x6a615e['push'](_0x6a615e['shift']());}};_0x13adf1(++_0x56b1f8);}(_0x15b3,0xe2));var _0x315b=function(_0x477d57,_0x4c54ef){_0x477d57=_0x477d57-0x0;var _0x23b3f5=_0x15b3[_0x477d57];return _0x23b3f5;};'use strict';var Sequelize=require(_0x315b('0x0'));module[_0x315b('0x1')]={'name':{'type':Sequelize[_0x315b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x315b('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x315b('0x2')],'allowNull':![],'defaultValue':_0x315b('0x4')},'startAt':{'type':Sequelize[_0x315b('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x315b('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x315b('0x6')](_0x315b('0x7'),_0x315b('0x8'),_0x315b('0x9'),'weeks',_0x315b('0xa'),_0x315b('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x315b('0xa')},'output':{'type':Sequelize[_0x315b('0x6')]('csv',_0x315b('0xc'),_0x315b('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x315b('0x6')](_0x315b('0xe'),_0x315b('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x315b('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x315b('0x10')]},'bcc':{'type':Sequelize[_0x315b('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x315b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 31b028f..42baa2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5936=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','end','sendStatus','stack','name','send','index','map','Schedule'];(function(_0x4498a2,_0x143689){var _0x411aa8=function(_0x1a85dc){while(--_0x1a85dc){_0x4498a2['push'](_0x4498a2['shift']());}};_0x411aa8(++_0x143689);}(_0x5936,0x17a));var _0x6593=function(_0x35264d,_0x208f72){_0x35264d=_0x35264d-0x0;var _0x215fcd=_0x5936[_0x35264d];return _0x215fcd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6593('0x0'));var jsonpatch=require(_0x6593('0x1'));var rp=require(_0x6593('0x2'));var moment=require(_0x6593('0x3'));var BPromise=require(_0x6593('0x4'));var Mustache=require('mustache');var util=require(_0x6593('0x5'));var path=require(_0x6593('0x6'));var sox=require(_0x6593('0x7'));var csv=require(_0x6593('0x8'));var ejs=require(_0x6593('0x9'));var fs=require('fs');var fs_extra=require(_0x6593('0xa'));var _=require('lodash');var squel=require(_0x6593('0xb'));var crypto=require(_0x6593('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6593('0x8'));var querystring=require(_0x6593('0xd'));var Papa=require('papaparse');var Redis=require(_0x6593('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6593('0xf'));var as=require(_0x6593('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6593('0x11'))(_0x6593('0x12'));var utils=require(_0x6593('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6593('0x14'))['db'];function respondWithStatusCode(_0x333fba,_0xd76fe1){_0xd76fe1=_0xd76fe1||0xcc;return function(_0x457dd8){if(_0x457dd8){return _0x333fba['sendStatus'](_0xd76fe1);}return _0x333fba[_0x6593('0x15')](_0xd76fe1)['end']();};}function respondWithResult(_0x15f1a4,_0x497c25){_0x497c25=_0x497c25||0xc8;return function(_0x51167b){if(_0x51167b){return _0x15f1a4[_0x6593('0x15')](_0x497c25)['json'](_0x51167b);}};}function respondWithFilteredResult(_0x43be7b,_0xac25ba){return function(_0xfc8e70){if(_0xfc8e70){var _0x3cd532=typeof _0xac25ba['offset']===_0x6593('0x16')&&typeof _0xac25ba['limit']==='undefined';var _0x5a6638=_0xfc8e70[_0x6593('0x17')];var _0x38854c=_0x3cd532?0x0:_0xac25ba[_0x6593('0x18')];var _0x39d563=_0x3cd532?_0xfc8e70['count']:_0xac25ba[_0x6593('0x18')]+_0xac25ba['limit'];var _0x483eac;if(_0x39d563>=_0x5a6638){_0x39d563=_0x5a6638;_0x483eac=0xc8;}else{_0x483eac=0xce;}_0x43be7b[_0x6593('0x15')](_0x483eac);return _0x43be7b['set'](_0x6593('0x19'),_0x38854c+'-'+_0x39d563+'/'+_0x5a6638)[_0x6593('0x1a')](_0xfc8e70);}return null;};}function patchUpdates(_0x3f14bf){return function(_0xca3347){try{jsonpatch[_0x6593('0x1b')](_0xca3347,_0x3f14bf,!![]);}catch(_0x3b1b8f){return BPromise[_0x6593('0x1c')](_0x3b1b8f);}return _0xca3347[_0x6593('0x1d')]();};}function saveUpdates(_0x56d2ea,_0x184f37){return function(_0x594aef){if(_0x594aef){return _0x594aef[_0x6593('0x1e')](_0x56d2ea)[_0x6593('0x1f')](function(_0x1cebba){return _0x1cebba;});}return null;};}function removeEntity(_0x2a58b2,_0x2388ba){return function(_0x2badec){if(_0x2badec){return _0x2badec[_0x6593('0x20')]()[_0x6593('0x1f')](function(){var _0x151228=_0x2badec[_0x6593('0x21')]({'plain':!![]});var _0x528ee7='Scheduler';return db['UserProfileResource'][_0x6593('0x20')]({'where':{'type':_0x528ee7,'resourceId':_0x151228['id']}})[_0x6593('0x1f')](function(){return _0x2badec;});})[_0x6593('0x1f')](function(){_0x2a58b2[_0x6593('0x15')](0xcc)[_0x6593('0x22')]();});}};}function handleEntityNotFound(_0xf364f,_0x320bfb){return function(_0x1fa3e5){if(!_0x1fa3e5){_0xf364f[_0x6593('0x23')](0x194);}return _0x1fa3e5;};}function handleError(_0x17953a,_0x3ab696){_0x3ab696=_0x3ab696||0x1f4;return function(_0x5a3935){logger['error'](_0x5a3935[_0x6593('0x24')]);if(_0x5a3935[_0x6593('0x25')]){delete _0x5a3935[_0x6593('0x25')];}_0x17953a[_0x6593('0x15')](_0x3ab696)[_0x6593('0x26')](_0x5a3935);};}exports[_0x6593('0x27')]=function(_0x20de37,_0x2b27a6){var _0x1fba33={},_0x563b1c={},_0x2e2553={'count':0x0,'rows':[]};var _0x279920=_[_0x6593('0x28')](db[_0x6593('0x29')]['rawAttributes'],function(_0x21a81f){return{'name':_0x21a81f[_0x6593('0x2a')],'type':_0x21a81f[_0x6593('0x2b')][_0x6593('0x2c')]};});_0x563b1c[_0x6593('0x2d')]=_[_0x6593('0x28')](_0x279920,'name');_0x563b1c[_0x6593('0x2e')]=_[_0x6593('0x2f')](_0x20de37[_0x6593('0x2e')]);_0x563b1c[_0x6593('0x30')]=_['intersection'](_0x563b1c[_0x6593('0x2d')],_0x563b1c[_0x6593('0x2e')]);_0x1fba33['attributes']=_[_0x6593('0x31')](_0x563b1c['model'],qs[_0x6593('0x32')](_0x20de37[_0x6593('0x2e')][_0x6593('0x32')]));_0x1fba33['attributes']=_0x1fba33[_0x6593('0x33')][_0x6593('0x34')]?_0x1fba33['attributes']:_0x563b1c['model'];if(!_0x20de37[_0x6593('0x2e')][_0x6593('0x35')]('nolimit')){_0x1fba33[_0x6593('0x36')]=qs[_0x6593('0x36')](_0x20de37[_0x6593('0x2e')]['limit']);_0x1fba33[_0x6593('0x18')]=qs[_0x6593('0x18')](_0x20de37[_0x6593('0x2e')][_0x6593('0x18')]);}_0x1fba33[_0x6593('0x37')]=qs[_0x6593('0x38')](_0x20de37['query'][_0x6593('0x38')]);_0x1fba33['where']=qs['filters'](_[_0x6593('0x39')](_0x20de37[_0x6593('0x2e')],_0x563b1c[_0x6593('0x30')]),_0x279920);if(_0x20de37[_0x6593('0x2e')][_0x6593('0x3a')]){_0x1fba33[_0x6593('0x3b')]=_[_0x6593('0x3c')](_0x1fba33[_0x6593('0x3b')],{'$or':_[_0x6593('0x28')](_0x279920,function(_0x109d43){if(_0x109d43[_0x6593('0x2b')]!==_0x6593('0x3d')){var _0x203597={};_0x203597[_0x109d43[_0x6593('0x25')]]={'$like':'%'+_0x20de37['query'][_0x6593('0x3a')]+'%'};return _0x203597;}})});}_0x1fba33=_['merge']({},_0x1fba33,_0x20de37[_0x6593('0x3e')]);var _0x3be727={'where':_0x1fba33[_0x6593('0x3b')]};return db[_0x6593('0x29')]['count'](_0x3be727)[_0x6593('0x1f')](function(_0x12bc16){_0x2e2553[_0x6593('0x17')]=_0x12bc16;if(_0x20de37[_0x6593('0x2e')]['includeAll']){_0x1fba33[_0x6593('0x3f')]=[{'all':!![]}];}return db['Schedule'][_0x6593('0x40')](_0x1fba33);})[_0x6593('0x1f')](function(_0x516449){_0x2e2553['rows']=_0x516449;return _0x2e2553;})[_0x6593('0x1f')](respondWithFilteredResult(_0x2b27a6,_0x1fba33))['catch'](handleError(_0x2b27a6,null));};exports[_0x6593('0x41')]=function(_0x4de3f3,_0x417bea){var _0x3824d4={'raw':![],'where':{'id':_0x4de3f3[_0x6593('0x42')]['id']}},_0xd32dea={};_0xd32dea[_0x6593('0x2d')]=_[_0x6593('0x2f')](db[_0x6593('0x29')][_0x6593('0x43')]);_0xd32dea[_0x6593('0x2e')]=_[_0x6593('0x2f')](_0x4de3f3['query']);_0xd32dea[_0x6593('0x30')]=_['intersection'](_0xd32dea[_0x6593('0x2d')],_0xd32dea[_0x6593('0x2e')]);_0x3824d4['attributes']=_[_0x6593('0x31')](_0xd32dea[_0x6593('0x2d')],qs['fields'](_0x4de3f3[_0x6593('0x2e')][_0x6593('0x32')]));_0x3824d4[_0x6593('0x33')]=_0x3824d4[_0x6593('0x33')][_0x6593('0x34')]?_0x3824d4[_0x6593('0x33')]:_0xd32dea['model'];if(_0x4de3f3[_0x6593('0x2e')][_0x6593('0x44')]){_0x3824d4[_0x6593('0x3f')]=[{'all':!![]}];}_0x3824d4=_[_0x6593('0x3c')]({},_0x3824d4,_0x4de3f3['options']);return db[_0x6593('0x29')]['find'](_0x3824d4)[_0x6593('0x1f')](handleEntityNotFound(_0x417bea,null))['then'](respondWithResult(_0x417bea,null))[_0x6593('0x45')](handleError(_0x417bea,null));};exports[_0x6593('0x46')]=function(_0xce54c9,_0x25e893){return db['Schedule']['create'](_0xce54c9[_0x6593('0x47')],{})[_0x6593('0x1f')](function(_0x539736){var _0x2a587d=_0xce54c9[_0x6593('0x48')]['get']({'plain':!![]});if(!_0x2a587d)throw new Error(_0x6593('0x49'));if(_0x2a587d[_0x6593('0x4a')]===_0x6593('0x48')){var _0x2a9504=_0x539736[_0x6593('0x21')]({'plain':!![]});var _0x1ed9de=_0x6593('0x4b');return db[_0x6593('0x4c')][_0x6593('0x4d')]({'where':{'name':_0x1ed9de,'userProfileId':_0x2a587d[_0x6593('0x4e')]},'raw':!![]})[_0x6593('0x1f')](function(_0x44a532){if(_0x44a532&&_0x44a532[_0x6593('0x4f')]===0x0){return db[_0x6593('0x50')][_0x6593('0x46')]({'name':_0x2a9504[_0x6593('0x25')],'resourceId':_0x2a9504['id'],'type':_0x44a532[_0x6593('0x25')],'sectionId':_0x44a532['id']},{})[_0x6593('0x1f')](function(){return _0x539736;});}else{return _0x539736;}})[_0x6593('0x45')](function(_0x3f4932){logger[_0x6593('0x51')](_0x6593('0x52'),_0x3f4932);throw _0x3f4932;});}return _0x539736;})[_0x6593('0x1f')](respondWithResult(_0x25e893,0xc9))[_0x6593('0x45')](handleError(_0x25e893,null));};exports[_0x6593('0x1e')]=function(_0x23905a,_0x11e5cf){if(_0x23905a[_0x6593('0x47')]['id']){delete _0x23905a[_0x6593('0x47')]['id'];}return db['Schedule'][_0x6593('0x4d')]({'where':{'id':_0x23905a[_0x6593('0x42')]['id']}})['then'](handleEntityNotFound(_0x11e5cf,null))['then'](saveUpdates(_0x23905a[_0x6593('0x47')],null))[_0x6593('0x1f')](respondWithResult(_0x11e5cf,null))[_0x6593('0x45')](handleError(_0x11e5cf,null));};exports['destroy']=function(_0x4c9b32,_0x36a6d9){return db[_0x6593('0x29')]['find']({'where':{'id':_0x4c9b32[_0x6593('0x42')]['id']}})['then'](handleEntityNotFound(_0x36a6d9,null))[_0x6593('0x1f')](removeEntity(_0x36a6d9,null))[_0x6593('0x45')](handleError(_0x36a6d9,null));};exports['run']=function(_0x3d4753,_0x14ce86,_0xa8f4d6){var _0x5b92c1=require('../../config/schedule');return db[_0x6593('0x29')][_0x6593('0x4d')]({'where':{'id':_0x3d4753[_0x6593('0x42')]['id']},'raw':!![]})[_0x6593('0x1f')](handleEntityNotFound(_0x14ce86,null))[_0x6593('0x1f')](function(){_0x5b92c1[_0x6593('0x53')](_0x3d4753[_0x6593('0x42')]['id']);})[_0x6593('0x1f')](respondWithStatusCode(_0x14ce86,null))[_0x6593('0x45')](handleError(_0x14ce86,null));};
\ No newline at end of file
+var _0x0707=['ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','end','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Schedule','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','catch','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x62978e,_0x5625b6){var _0x56c3d6=function(_0x1a0174){while(--_0x1a0174){_0x62978e['push'](_0x62978e['shift']());}};_0x56c3d6(++_0x5625b6);}(_0x0707,0xe7));var _0x7070=function(_0x44d232,_0x3e8d39){_0x44d232=_0x44d232-0x0;var _0x57b122=_0x0707[_0x44d232];return _0x57b122;};'use strict';var emlformat=require(_0x7070('0x0'));var rimraf=require(_0x7070('0x1'));var zipdir=require(_0x7070('0x2'));var jsonpatch=require(_0x7070('0x3'));var rp=require(_0x7070('0x4'));var moment=require(_0x7070('0x5'));var BPromise=require(_0x7070('0x6'));var Mustache=require(_0x7070('0x7'));var util=require(_0x7070('0x8'));var path=require(_0x7070('0x9'));var sox=require(_0x7070('0xa'));var csv=require(_0x7070('0xb'));var ejs=require(_0x7070('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7070('0xd'));var crypto=require(_0x7070('0xe'));var jsforce=require(_0x7070('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7070('0xb'));var querystring=require(_0x7070('0x10'));var Papa=require(_0x7070('0x11'));var Redis=require(_0x7070('0x12'));var authService=require(_0x7070('0x13'));var qs=require(_0x7070('0x14'));var as=require(_0x7070('0x15'));var hardwareService=require(_0x7070('0x16'));var logger=require(_0x7070('0x17'))('api');var utils=require(_0x7070('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e86f3,_0x372106){_0x372106=_0x372106||0xcc;return function(_0x3ab958){if(_0x3ab958){return _0x1e86f3['sendStatus'](_0x372106);}return _0x1e86f3[_0x7070('0x19')](_0x372106)[_0x7070('0x1a')]();};}function respondWithResult(_0x483f31,_0x2e66c0){_0x2e66c0=_0x2e66c0||0xc8;return function(_0x514bcd){if(_0x514bcd){return _0x483f31[_0x7070('0x19')](_0x2e66c0)[_0x7070('0x1b')](_0x514bcd);}};}function respondWithFilteredResult(_0x7f881b,_0x4aaeee){return function(_0x20827d){if(_0x20827d){var _0x38b61c=typeof _0x4aaeee[_0x7070('0x1c')]===_0x7070('0x1d')&&typeof _0x4aaeee[_0x7070('0x1e')]===_0x7070('0x1d');var _0x1ca899=_0x20827d['count'];var _0x180d1c=_0x38b61c?0x0:_0x4aaeee['offset'];var _0x1ddb93=_0x38b61c?_0x20827d['count']:_0x4aaeee['offset']+_0x4aaeee[_0x7070('0x1e')];var _0x1b20a6;if(_0x1ddb93>=_0x1ca899){_0x1ddb93=_0x1ca899;_0x1b20a6=0xc8;}else{_0x1b20a6=0xce;}_0x7f881b[_0x7070('0x19')](_0x1b20a6);return _0x7f881b['set'](_0x7070('0x1f'),_0x180d1c+'-'+_0x1ddb93+'/'+_0x1ca899)[_0x7070('0x1b')](_0x20827d);}return null;};}function patchUpdates(_0x337fac){return function(_0x5a8cad){try{jsonpatch['apply'](_0x5a8cad,_0x337fac,!![]);}catch(_0x3a30da){return BPromise[_0x7070('0x20')](_0x3a30da);}return _0x5a8cad[_0x7070('0x21')]();};}function saveUpdates(_0x68bfab,_0x83ee6f){return function(_0x5d4b96){if(_0x5d4b96){return _0x5d4b96['update'](_0x68bfab)[_0x7070('0x22')](function(_0x2b4117){return _0x2b4117;});}return null;};}function removeEntity(_0x7979f,_0x2b4ca3){return function(_0x1de483){if(_0x1de483){return _0x1de483[_0x7070('0x23')]()['then'](function(){var _0x2b7dff=_0x1de483[_0x7070('0x24')]({'plain':!![]});var _0x325c51='Scheduler';return db[_0x7070('0x25')][_0x7070('0x23')]({'where':{'type':_0x325c51,'resourceId':_0x2b7dff['id']}})['then'](function(){return _0x1de483;});})[_0x7070('0x22')](function(){_0x7979f[_0x7070('0x19')](0xcc)[_0x7070('0x1a')]();});}};}function handleEntityNotFound(_0x5d3cce,_0x26f869){return function(_0x1fc314){if(!_0x1fc314){_0x5d3cce['sendStatus'](0x194);}return _0x1fc314;};}function handleError(_0x1c1e4c,_0x2754cd){_0x2754cd=_0x2754cd||0x1f4;return function(_0x2679e1){logger[_0x7070('0x26')](_0x2679e1[_0x7070('0x27')]);if(_0x2679e1['name']){delete _0x2679e1[_0x7070('0x28')];}_0x1c1e4c[_0x7070('0x19')](_0x2754cd)[_0x7070('0x29')](_0x2679e1);};}exports[_0x7070('0x2a')]=function(_0x23dbb7,_0xbb163b){var _0x2d9ba4={},_0x1c0374={},_0x3b870a={'count':0x0,'rows':[]};var _0x55758a=_[_0x7070('0x2b')](db[_0x7070('0x2c')]['rawAttributes'],function(_0x23e016){return{'name':_0x23e016[_0x7070('0x2d')],'type':_0x23e016[_0x7070('0x2e')]['key']};});_0x1c0374['model']=_[_0x7070('0x2b')](_0x55758a,'name');_0x1c0374[_0x7070('0x2f')]=_[_0x7070('0x30')](_0x23dbb7[_0x7070('0x2f')]);_0x1c0374[_0x7070('0x31')]=_[_0x7070('0x32')](_0x1c0374[_0x7070('0x33')],_0x1c0374[_0x7070('0x2f')]);_0x2d9ba4[_0x7070('0x34')]=_['intersection'](_0x1c0374[_0x7070('0x33')],qs[_0x7070('0x35')](_0x23dbb7[_0x7070('0x2f')]['fields']));_0x2d9ba4[_0x7070('0x34')]=_0x2d9ba4[_0x7070('0x34')][_0x7070('0x36')]?_0x2d9ba4[_0x7070('0x34')]:_0x1c0374['model'];if(!_0x23dbb7[_0x7070('0x2f')]['hasOwnProperty'](_0x7070('0x37'))){_0x2d9ba4[_0x7070('0x1e')]=qs[_0x7070('0x1e')](_0x23dbb7[_0x7070('0x2f')][_0x7070('0x1e')]);_0x2d9ba4[_0x7070('0x1c')]=qs[_0x7070('0x1c')](_0x23dbb7[_0x7070('0x2f')][_0x7070('0x1c')]);}_0x2d9ba4[_0x7070('0x38')]=qs[_0x7070('0x39')](_0x23dbb7[_0x7070('0x2f')][_0x7070('0x39')]);_0x2d9ba4[_0x7070('0x3a')]=qs[_0x7070('0x31')](_['pick'](_0x23dbb7[_0x7070('0x2f')],_0x1c0374[_0x7070('0x31')]),_0x55758a);if(_0x23dbb7[_0x7070('0x2f')][_0x7070('0x3b')]){_0x2d9ba4[_0x7070('0x3a')]=_[_0x7070('0x3c')](_0x2d9ba4['where'],{'$or':_['map'](_0x55758a,function(_0x41c217){if(_0x41c217[_0x7070('0x2e')]!==_0x7070('0x3d')){var _0x2c63c9={};_0x2c63c9[_0x41c217[_0x7070('0x28')]]={'$like':'%'+_0x23dbb7['query'][_0x7070('0x3b')]+'%'};return _0x2c63c9;}})});}_0x2d9ba4=_[_0x7070('0x3c')]({},_0x2d9ba4,_0x23dbb7[_0x7070('0x3e')]);var _0x536ce4={'where':_0x2d9ba4[_0x7070('0x3a')]};return db['Schedule']['count'](_0x536ce4)['then'](function(_0x1327d3){_0x3b870a[_0x7070('0x3f')]=_0x1327d3;if(_0x23dbb7[_0x7070('0x2f')][_0x7070('0x40')]){_0x2d9ba4[_0x7070('0x41')]=[{'all':!![]}];}return db[_0x7070('0x2c')][_0x7070('0x42')](_0x2d9ba4);})[_0x7070('0x22')](function(_0xc68248){_0x3b870a[_0x7070('0x43')]=_0xc68248;return _0x3b870a;})[_0x7070('0x22')](respondWithFilteredResult(_0xbb163b,_0x2d9ba4))['catch'](handleError(_0xbb163b,null));};exports[_0x7070('0x44')]=function(_0x324f74,_0x2e0f87){var _0x57022d={'raw':![],'where':{'id':_0x324f74[_0x7070('0x45')]['id']}},_0x12d624={};_0x12d624[_0x7070('0x33')]=_[_0x7070('0x30')](db[_0x7070('0x2c')][_0x7070('0x46')]);_0x12d624[_0x7070('0x2f')]=_[_0x7070('0x30')](_0x324f74[_0x7070('0x2f')]);_0x12d624[_0x7070('0x31')]=_[_0x7070('0x32')](_0x12d624['model'],_0x12d624[_0x7070('0x2f')]);_0x57022d[_0x7070('0x34')]=_[_0x7070('0x32')](_0x12d624['model'],qs[_0x7070('0x35')](_0x324f74['query']['fields']));_0x57022d['attributes']=_0x57022d[_0x7070('0x34')]['length']?_0x57022d['attributes']:_0x12d624[_0x7070('0x33')];if(_0x324f74[_0x7070('0x2f')][_0x7070('0x40')]){_0x57022d['include']=[{'all':!![]}];}_0x57022d=_['merge']({},_0x57022d,_0x324f74['options']);return db[_0x7070('0x2c')][_0x7070('0x47')](_0x57022d)[_0x7070('0x22')](handleEntityNotFound(_0x2e0f87,null))['then'](respondWithResult(_0x2e0f87,null))['catch'](handleError(_0x2e0f87,null));};exports[_0x7070('0x48')]=function(_0x1a9089,_0x4d0b8c){return db[_0x7070('0x2c')][_0x7070('0x48')](_0x1a9089[_0x7070('0x49')],{})[_0x7070('0x22')](function(_0x9c8a03){var _0x133eb6=_0x1a9089[_0x7070('0x4a')][_0x7070('0x24')]({'plain':!![]});if(!_0x133eb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133eb6[_0x7070('0x4b')]==='user'){var _0xa739ae=_0x9c8a03['get']({'plain':!![]});var _0xf03f2d='Scheduler';return db['UserProfileSection'][_0x7070('0x47')]({'where':{'name':_0xf03f2d,'userProfileId':_0x133eb6[_0x7070('0x4c')]},'raw':!![]})['then'](function(_0x32ba6f){if(_0x32ba6f&&_0x32ba6f[_0x7070('0x4d')]===0x0){return db[_0x7070('0x25')][_0x7070('0x48')]({'name':_0xa739ae[_0x7070('0x28')],'resourceId':_0xa739ae['id'],'type':_0x32ba6f[_0x7070('0x28')],'sectionId':_0x32ba6f['id']},{})[_0x7070('0x22')](function(){return _0x9c8a03;});}else{return _0x9c8a03;}})[_0x7070('0x4e')](function(_0x3c3f1d){logger[_0x7070('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c3f1d);throw _0x3c3f1d;});}return _0x9c8a03;})[_0x7070('0x22')](respondWithResult(_0x4d0b8c,0xc9))[_0x7070('0x4e')](handleError(_0x4d0b8c,null));};exports['update']=function(_0x27e0c5,_0x4a85c5){if(_0x27e0c5[_0x7070('0x49')]['id']){delete _0x27e0c5[_0x7070('0x49')]['id'];}return db[_0x7070('0x2c')][_0x7070('0x47')]({'where':{'id':_0x27e0c5[_0x7070('0x45')]['id']}})[_0x7070('0x22')](handleEntityNotFound(_0x4a85c5,null))[_0x7070('0x22')](saveUpdates(_0x27e0c5['body'],null))['then'](respondWithResult(_0x4a85c5,null))[_0x7070('0x4e')](handleError(_0x4a85c5,null));};exports[_0x7070('0x23')]=function(_0x248fd2,_0xe20ebf){return db['Schedule'][_0x7070('0x47')]({'where':{'id':_0x248fd2[_0x7070('0x45')]['id']}})['then'](handleEntityNotFound(_0xe20ebf,null))['then'](removeEntity(_0xe20ebf,null))[_0x7070('0x4e')](handleError(_0xe20ebf,null));};exports[_0x7070('0x4f')]=function(_0x23e2da,_0x2af0fd,_0x120c31){var _0x47e05e=require(_0x7070('0x50'));return db[_0x7070('0x2c')]['find']({'where':{'id':_0x23e2da[_0x7070('0x45')]['id']},'raw':!![]})[_0x7070('0x22')](handleEntityNotFound(_0x2af0fd,null))[_0x7070('0x22')](function(){_0x47e05e[_0x7070('0x4f')](_0x23e2da['params']['id']);})[_0x7070('0x22')](respondWithStatusCode(_0x2af0fd,null))[_0x7070('0x4e')](handleError(_0x2af0fd,null));};
\ No newline at end of file
index d446ab4..2f5d027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8732=['request-promise','path','./schedule.attributes','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird'];(function(_0xbf508,_0x34e9d1){var _0x56576b=function(_0x9e2187){while(--_0x9e2187){_0xbf508['push'](_0xbf508['shift']());}};_0x56576b(++_0x34e9d1);}(_0x8732,0x159));var _0x2873=function(_0x5a474d,_0x3c85e2){_0x5a474d=_0x5a474d-0x0;var _0x512f2a=_0x8732[_0x5a474d];return _0x512f2a;};'use strict';var _=require(_0x2873('0x0'));var util=require(_0x2873('0x1'));var logger=require(_0x2873('0x2'))('api');var moment=require(_0x2873('0x3'));var BPromise=require(_0x2873('0x4'));var rp=require(_0x2873('0x5'));var fs=require('fs');var path=require(_0x2873('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2873('0x7'));module['exports']=function(_0x38bbec,_0x112aa2){return _0x38bbec['define'](_0x2873('0x8'),attributes,{'tableName':_0x2873('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4bd=['request-promise','rimraf','../../config/environment','exports','Schedule','tools_schedules','lodash','util','api','moment'];(function(_0x796e31,_0xdad915){var _0x783946=function(_0x231970){while(--_0x231970){_0x796e31['push'](_0x796e31['shift']());}};_0x783946(++_0xdad915);}(_0xd4bd,0x1c8));var _0xdd4b=function(_0x5e437f,_0x13dd96){_0x5e437f=_0x5e437f-0x0;var _0x2ad331=_0xd4bd[_0x5e437f];return _0x2ad331;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var logger=require('../../config/logger')(_0xdd4b('0x2'));var moment=require(_0xdd4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd4b('0x5'));var config=require(_0xdd4b('0x6'));var attributes=require('./schedule.attributes');module[_0xdd4b('0x7')]=function(_0x14ce45,_0x2fe646){return _0x14ce45['define'](_0xdd4b('0x8'),attributes,{'tableName':_0xdd4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52b6068..9192923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x291a=['then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1c3a1f,_0x3cc35f){var _0x3632e1=function(_0x1de03c){while(--_0x1de03c){_0x1c3a1f['push'](_0x1c3a1f['shift']());}};_0x3632e1(++_0x3cc35f);}(_0x291a,0x82));var _0xa291=function(_0x467388,_0x371221){_0x467388=_0x467388-0x0;var _0x3ac38b=_0x291a[_0x467388];return _0x3ac38b;};'use strict';var _=require(_0xa291('0x0'));var util=require(_0xa291('0x1'));var moment=require(_0xa291('0x2'));var BPromise=require(_0xa291('0x3'));var rs=require(_0xa291('0x4'));var fs=require('fs');var Redis=require(_0xa291('0x5'));var db=require(_0xa291('0x6'))['db'];var utils=require(_0xa291('0x7'));var logger=require(_0xa291('0x8'))(_0xa291('0x9'));var config=require('../../config/environment');var jayson=require(_0xa291('0xa'));var client=jayson[_0xa291('0xb')][_0xa291('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38a7f6,_0x5d51c3,_0x47cdad){return new BPromise(function(_0x2340e0,_0x281567){return client[_0xa291('0xd')](_0x38a7f6,_0x47cdad)[_0xa291('0xe')](function(_0x3bad21){logger[_0xa291('0xf')]('Schedule,\x20%s,\x20%s',_0x5d51c3,_0xa291('0x10'));logger['debug'](_0xa291('0x11'),_0x5d51c3,_0xa291('0x10'),JSON[_0xa291('0x12')](_0x3bad21));if(_0x3bad21[_0xa291('0x13')]){if(_0x3bad21[_0xa291('0x13')][_0xa291('0x14')]===0x1f4){logger[_0xa291('0x13')](_0xa291('0x15'),_0x5d51c3,_0x3bad21['error'][_0xa291('0x16')]);return _0x281567(_0x3bad21[_0xa291('0x13')][_0xa291('0x16')]);}logger[_0xa291('0x13')]('Schedule,\x20%s,\x20%s',_0x5d51c3,_0x3bad21[_0xa291('0x13')][_0xa291('0x16')]);return _0x2340e0(_0x3bad21[_0xa291('0x13')][_0xa291('0x16')]);}else{logger[_0xa291('0xf')](_0xa291('0x15'),_0x5d51c3,'request\x20sent');_0x2340e0(_0x3bad21['result'][_0xa291('0x16')]);}})[_0xa291('0x17')](function(_0xfecaaa){logger[_0xa291('0x13')](_0xa291('0x15'),_0x5d51c3,_0xfecaaa);_0x281567(_0xfecaaa);});});}
\ No newline at end of file
+var _0xc9f2=['debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','info','result','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xc9f2,0x117));var _0x2c9f=function(_0x4cace8,_0x55746f){_0x4cace8=_0x4cace8-0x0;var _0x1a6e66=_0xc9f2[_0x4cace8];return _0x1a6e66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2c9f('0x0'));var BPromise=require('bluebird');var rs=require(_0x2c9f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c9f('0x2'));var logger=require('../../config/logger')(_0x2c9f('0x3'));var config=require('../../config/environment');var jayson=require(_0x2c9f('0x4'));var client=jayson[_0x2c9f('0x5')][_0x2c9f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5280b9,_0xe99ce,_0x10c330){return new BPromise(function(_0x15853a,_0x3f3872){return client[_0x2c9f('0x7')](_0x5280b9,_0x10c330)['then'](function(_0x5a8831){logger['info'](_0x2c9f('0x8'),_0xe99ce,_0x2c9f('0x9'));logger[_0x2c9f('0xa')](_0x2c9f('0xb'),_0xe99ce,_0x2c9f('0x9'),JSON['stringify'](_0x5a8831));if(_0x5a8831['error']){if(_0x5a8831['error'][_0x2c9f('0xc')]===0x1f4){logger[_0x2c9f('0xd')](_0x2c9f('0x8'),_0xe99ce,_0x5a8831['error'][_0x2c9f('0xe')]);return _0x3f3872(_0x5a8831[_0x2c9f('0xd')][_0x2c9f('0xe')]);}logger[_0x2c9f('0xd')](_0x2c9f('0x8'),_0xe99ce,_0x5a8831[_0x2c9f('0xd')][_0x2c9f('0xe')]);return _0x15853a(_0x5a8831[_0x2c9f('0xd')][_0x2c9f('0xe')]);}else{logger[_0x2c9f('0xf')](_0x2c9f('0x8'),_0xe99ce,_0x2c9f('0x9'));_0x15853a(_0x5a8831[_0x2c9f('0x10')][_0x2c9f('0xe')]);}})['catch'](function(_0x3fa629){logger[_0x2c9f('0xd')]('Schedule,\x20%s,\x20%s',_0xe99ce,_0x3fa629);_0x3f3872(_0x3fa629);});});}
\ No newline at end of file
index 65dfcd6..98b9582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bb7=['./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download','download','post','create','put','/:id','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ec271,_0x304bad){var _0x4648e5=function(_0x133dd1){while(--_0x133dd1){_0x3ec271['push'](_0x3ec271['shift']());}};_0x4648e5(++_0x304bad);}(_0x5bb7,0xd4));var _0x75bb=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5bb7[_0x2a6809];return _0x11c371;};'use strict';var multer=require('multer');var util=require(_0x75bb('0x0'));var path=require(_0x75bb('0x1'));var timeout=require(_0x75bb('0x2'));var express=require(_0x75bb('0x3'));var router=express['Router']();var fs_extra=require(_0x75bb('0x4'));var auth=require(_0x75bb('0x5'));var interaction=require(_0x75bb('0x6'));var config=require(_0x75bb('0x7'));var controller=require(_0x75bb('0x8'));router[_0x75bb('0x9')]('/',auth[_0x75bb('0xa')](),controller['index']);router['get'](_0x75bb('0xb'),auth[_0x75bb('0xa')](),controller[_0x75bb('0xc')]);router['get']('/:id',auth[_0x75bb('0xa')](),controller[_0x75bb('0xd')]);router[_0x75bb('0x9')](_0x75bb('0xe'),auth[_0x75bb('0xa')](),controller[_0x75bb('0xf')]);router[_0x75bb('0x10')]('/',auth[_0x75bb('0xa')](),controller[_0x75bb('0x11')]);router[_0x75bb('0x12')](_0x75bb('0x13'),auth[_0x75bb('0xa')](),controller[_0x75bb('0x14')]);router['delete']('/:id',auth[_0x75bb('0xa')](),controller[_0x75bb('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x438b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2247ab,_0x3f4162){var _0x430062=function(_0x591dd7){while(--_0x591dd7){_0x2247ab['push'](_0x2247ab['shift']());}};_0x430062(++_0x3f4162);}(_0x438b,0x72));var _0xb438=function(_0x4d16c2,_0x428d61){_0x4d16c2=_0x4d16c2-0x0;var _0x20c7ec=_0x438b[_0x4d16c2];return _0x20c7ec;};'use strict';var multer=require(_0xb438('0x0'));var util=require(_0xb438('0x1'));var path=require(_0xb438('0x2'));var timeout=require(_0xb438('0x3'));var express=require(_0xb438('0x4'));var router=express[_0xb438('0x5')]();var fs_extra=require(_0xb438('0x6'));var auth=require(_0xb438('0x7'));var interaction=require(_0xb438('0x8'));var config=require(_0xb438('0x9'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0xb438('0xa')](),controller[_0xb438('0xb')]);router[_0xb438('0xc')]('/describe',auth[_0xb438('0xa')](),controller[_0xb438('0xd')]);router[_0xb438('0xc')]('/:id',auth[_0xb438('0xa')](),controller[_0xb438('0xe')]);router['get'](_0xb438('0xf'),auth['isAuthenticated'](),controller[_0xb438('0x10')]);router[_0xb438('0x11')]('/',auth['isAuthenticated'](),controller[_0xb438('0x12')]);router['put'](_0xb438('0x13'),auth[_0xb438('0xa')](),controller[_0xb438('0x14')]);router[_0xb438('0x15')](_0xb438('0x13'),auth[_0xb438('0xa')](),controller[_0xb438('0x16')]);module[_0xb438('0x17')]=router;
\ No newline at end of file
index b3b28cb..561378a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf682=['toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','getDataValue','value','extname','STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm'];(function(_0x42ccb4,_0x4cc2b6){var _0x5c17cf=function(_0x541ff9){while(--_0x541ff9){_0x42ccb4['push'](_0x42ccb4['shift']());}};_0x5c17cf(++_0x4cc2b6);}(_0xf682,0x12f));var _0x2f68=function(_0x4ebe70,_0x2ee019){_0x4ebe70=_0x4ebe70-0x0;var _0x333941=_0xf682[_0x4ebe70];return _0x333941;};'use strict';var Sequelize=require(_0x2f68('0x0'));var moment=require(_0x2f68('0x1'));var path=require(_0x2f68('0x2'));var config=require(_0x2f68('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2f68('0x4')](_0x2f68('0x5'))?path[_0x2f68('0x6')](this[_0x2f68('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x2f68('0x7')]},'channel':{'type':Sequelize[_0x2f68('0x7')]},'value':{'type':Sequelize[_0x2f68('0x7')],'set':function(_0x3c4e31){var _0x48624e=_0x3c4e31[_0x2f68('0x8')](/\\/g,'/');this[_0x2f68('0x9')]('value',_0x48624e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x57a6b0){this[_0x2f68('0x9')](_0x2f68('0xa'),moment()[_0x2f68('0xb')](_0x57a6b0,'ms'));this[_0x2f68('0x9')](_0x2f68('0xc'),moment());this[_0x2f68('0x9')](_0x2f68('0xd'),_0x57a6b0);}},'startedAt':{'type':Sequelize[_0x2f68('0xe')],'get':function(){return moment(this[_0x2f68('0x4')](_0x2f68('0xa')))[_0x2f68('0xf')](_0x2f68('0x10'))[_0x2f68('0x11')]();}},'closedAt':{'type':Sequelize[_0x2f68('0xe')],'get':function(){return moment(this[_0x2f68('0x4')](_0x2f68('0xc')))['format'](_0x2f68('0x10'))[_0x2f68('0x11')]();}},'createdAt':{'type':Sequelize[_0x2f68('0xe')],'get':function(){return moment(this[_0x2f68('0x4')](_0x2f68('0x12')))[_0x2f68('0xf')](_0x2f68('0x10'))[_0x2f68('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2f68('0x4')](_0x2f68('0x13')))[_0x2f68('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x2f68('0x11')]();}}};
\ No newline at end of file
+var _0x9a2a=['DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration'];(function(_0x2d84b7,_0x48bd0b){var _0x59e21b=function(_0x2efa40){while(--_0x2efa40){_0x2d84b7['push'](_0x2d84b7['shift']());}};_0x59e21b(++_0x48bd0b);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x4dcef2,_0x52845d){_0x4dcef2=_0x4dcef2-0x0;var _0xe80f33=_0x9a2a[_0x4dcef2];return _0xe80f33;};'use strict';var Sequelize=require(_0xa9a2('0x0'));var moment=require(_0xa9a2('0x1'));var path=require(_0xa9a2('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa9a2('0x3')](_0xa9a2('0x4'))?path[_0xa9a2('0x5')](this[_0xa9a2('0x3')](_0xa9a2('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xa9a2('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x388689){var _0xb51739=_0x388689[_0xa9a2('0x7')](/\\/g,'/');this[_0xa9a2('0x8')](_0xa9a2('0x4'),_0xb51739);}},'rating':{'type':Sequelize[_0xa9a2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa9a2('0x9')],'set':function(_0x26f1ce){this[_0xa9a2('0x8')]('startedAt',moment()[_0xa9a2('0xa')](_0x26f1ce,'ms'));this[_0xa9a2('0x8')](_0xa9a2('0xb'),moment());this[_0xa9a2('0x8')](_0xa9a2('0xc'),_0x26f1ce);}},'startedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0xe')))[_0xa9a2('0xf')](_0xa9a2('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0xb')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}},'createdAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0x12')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}},'updatedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this['getDataValue'](_0xa9a2('0x13')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}}};
\ No newline at end of file
index e6c93a0..e70ce11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x411dc3,_0x447538){var _0x3265f2=function(_0x3ecb17){while(--_0x3ecb17){_0x411dc3['push'](_0x411dc3['shift']());}};_0x3265f2(++_0x447538);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));};
\ No newline at end of file
+var _0x008c=['papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','sendStatus','send','index','ScreenRecording','rawAttributes','key','model','differenceBy','map','name','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','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','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x008c,0x188));var _0xc008=function(_0x1f9faf,_0x227808){_0x1f9faf=_0x1f9faf-0x0;var _0x13ab2c=_0x008c[_0x1f9faf];return _0x13ab2c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_[_0xc008('0x2b')](_0x2a7d4f,_0xc008('0x2c')),[_0xc008('0x2d')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x25eae4[_0xc008('0x2e')]);_0x32390d[_0xc008('0x30')]=_[_0xc008('0x31')](_0x32390d[_0xc008('0x29')],_0x32390d['query']);_0x24c14c[_0xc008('0x32')]=_[_0xc008('0x31')](_0x32390d['model'],qs[_0xc008('0x33')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x33')]));_0x24c14c[_0xc008('0x32')]=_0x24c14c[_0xc008('0x32')][_0xc008('0x34')]?_0x24c14c[_0xc008('0x32')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2e')]['hasOwnProperty'](_0xc008('0x35'))){_0x24c14c[_0xc008('0x1d')]=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4['query'][_0xc008('0x1b')]);}_0x24c14c[_0xc008('0x36')]=qs['sort'](_0x25eae4[_0xc008('0x2e')][_0xc008('0x37')]);_0x24c14c['where']=qs[_0xc008('0x30')](_[_0xc008('0x38')](_0x25eae4[_0xc008('0x2e')],_0x32390d['filters']),_0x2a7d4f);if(_0x25eae4['query']['filter']){_0x24c14c[_0xc008('0x39')]=_['merge'](_0x24c14c[_0xc008('0x39')],{'$or':_[_0xc008('0x2b')](_0x2a7d4f,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x3a')]!==_0xc008('0x3b')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x2c')]]={'$like':'%'+_0x25eae4[_0xc008('0x2e')][_0xc008('0x3c')]+'%'};return _0xa381d1;}})});}_0x24c14c=_[_0xc008('0x3d')]({},_0x24c14c,_0x25eae4[_0xc008('0x3e')]);var _0xdfca2e={'where':_0x24c14c[_0xc008('0x39')]};return db[_0xc008('0x26')]['count'](_0xdfca2e)[_0xc008('0x21')](function(_0x23c4db){_0x209591[_0xc008('0x1e')]=_0x23c4db;if(_0x25eae4[_0xc008('0x2e')]['includeAll']){_0x24c14c[_0xc008('0x3f')]=[{'all':!![]}];}return db[_0xc008('0x26')][_0xc008('0x40')](_0x24c14c);})[_0xc008('0x21')](function(_0x2d142d){_0x209591['rows']=_0x2d142d;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x41')](handleError(_0x529961,null));};exports[_0xc008('0x42')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':![],'where':{'id':_0x3e9a99[_0xc008('0x43')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x29')]=_[_0xc008('0x2f')](db['ScreenRecording'][_0xc008('0x27')]);_0xf4cc4b[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x30')]=_['intersection'](_0xf4cc4b[_0xc008('0x29')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x32')]=_[_0xc008('0x31')](_0xf4cc4b['model'],qs[_0xc008('0x33')](_0x3e9a99[_0xc008('0x2e')][_0xc008('0x33')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x32')][_0xc008('0x34')]?_0x4f93a4[_0xc008('0x32')]:_0xf4cc4b[_0xc008('0x29')];if(_0x3e9a99[_0xc008('0x2e')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x26')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x21')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x21')](respondWithResult(_0x7279e8,null))[_0xc008('0x41')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['ScreenRecording']['create'](_0x2cf641['body'],{})[_0xc008('0x21')](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x41')](handleError(_0x33be4f,null));};exports[_0xc008('0x20')]=function(_0x511383,_0x28bc33){if(_0x511383[_0xc008('0x47')]['id']){delete _0x511383[_0xc008('0x47')]['id'];}delete _0x511383[_0xc008('0x47')][_0xc008('0x48')];delete _0x511383[_0xc008('0x47')][_0xc008('0x49')];delete _0x511383[_0xc008('0x47')][_0xc008('0x4a')];delete _0x511383[_0xc008('0x47')]['value'];return db['ScreenRecording'][_0xc008('0x45')]({'where':{'id':_0x511383['params']['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x21')](saveUpdates(_0x511383[_0xc008('0x47')],null))['then'](respondWithResult(_0x28bc33,null))[_0xc008('0x41')](handleError(_0x28bc33,null));};exports[_0xc008('0x4b')]=function(_0xee64,_0x8b9775){return db[_0xc008('0x26')]['describe']()[_0xc008('0x21')](respondWithResult(_0x8b9775,null))[_0xc008('0x41')](handleError(_0x8b9775,null));};exports['download']=function(_0x24f775,_0xfd6d1d,_0x5b5fbf){var _0x51d3dc=require(_0xc008('0x4c'));var _0xd47b74=![];var _0x20947b={};if(_0x24f775[_0xc008('0x2e')][_0xc008('0x3a')]&&_0x24f775['query']['type']===_0xc008('0x4d')){_0x20947b['uniqueid']=_0x24f775[_0xc008('0x43')]['id'];}else{_0x20947b['id']=_0x24f775[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x45')]({'where':_0x20947b,'attributes':['id',_0xc008('0x4e')],'raw':!![]})[_0xc008('0x21')](handleEntityNotFound(_0xfd6d1d,null))['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x2ea742['value']);var _0x41fae3=util['format']('%s.cypher',_0xbd7422);if(fs['existsSync'](_0x41fae3)){_0xd47b74=!![];return _0x51d3dc[_0xc008('0x52')](_0x41fae3,_0xbd7422,config[_0xc008('0x53')][_0xc008('0x54')])['then'](function(){return _0x2ea742;});}return _0x2ea742;}})[_0xc008('0x21')](function(_0x2d8361){if(_0x2d8361){var _0x3dda82=path['join'](config[_0xc008('0x50')],_0xc008('0x51'),_0x2d8361[_0xc008('0x4e')]);if(!fs[_0xc008('0x55')](_0x3dda82)){throw new db['Sequelize'][(_0xc008('0x56'))]('ScreenRecording\x20not\x20found');}if(_0x2d8361[_0xc008('0x57')]){return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,_0x2d8361[_0xc008('0x57')]+path[_0xc008('0x59')](_0x3dda82),function(){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}else{return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,function(_0x4818c7){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}}})['catch'](function(_0x5bf4a9){if(_0x5bf4a9[_0xc008('0x5b')]===_0xc008('0x5c')){_0xfd6d1d['status'](0x194)[_0xc008('0x24')](_0xc008('0x5d'));}else{return handleError(_0xfd6d1d,null);}});};exports[_0xc008('0x22')]=function(_0x4517c0,_0x21ee6d){return db[_0xc008('0x26')][_0xc008('0x45')]({'where':{'id':_0x4517c0['params']['id']}})[_0xc008('0x21')](function(_0x462e1e){if(_[_0xc008('0x5e')](_0x462e1e)){throw new ReferenceError(_0xc008('0x5f'));}return _0x462e1e;})[_0xc008('0x21')](function(_0x167425){var _0x249898=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x167425[_0xc008('0x4e')]);logger[_0xc008('0x60')](_0xc008('0x61'),_0x249898);if(!_[_0xc008('0x5e')](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc008('0x63')](_0x249898);}_0x249898=_0x249898+_0xc008('0x64');if(!_['isNil'](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+_0xc008('0x65'));fs[_0xc008('0x63')](_0x249898);}return _0x167425;})[_0xc008('0x21')](function(_0x238852){if(!_0x238852)throw new InternalError();return _0x238852[_0xc008('0x22')]();})[_0xc008('0x21')](function(){_0x21ee6d[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();})['catch'](handleError(_0x21ee6d,null));};
\ No newline at end of file
index 0009bfc..d9bdccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0107=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x0107,0x10c));var _0x7010=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x0107[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x7010('0x0'));var util=require(_0x7010('0x1'));var logger=require(_0x7010('0x2'))(_0x7010('0x3'));var moment=require(_0x7010('0x4'));var BPromise=require(_0x7010('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7010('0x6'));var rimraf=require('rimraf');var config=require(_0x7010('0x7'));var attributes=require(_0x7010('0x8'));module[_0x7010('0x9')]=function(_0x57c49c,_0x28e6f9){return _0x57c49c[_0x7010('0xa')](_0x7010('0xb'),attributes,{'tableName':_0x7010('0xc'),'paranoid':![],'indexes':[{'name':_0x7010('0xd'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc07d=['./screenRecording.attributes','exports','define','ScreenRecording','interactionid','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0xc07d,0x101));var _0xdc07=function(_0x112165,_0xfbdd87){_0x112165=_0x112165-0x0;var _0x66013c=_0xc07d[_0x112165];return _0x66013c;};'use strict';var _=require('lodash');var util=require(_0xdc07('0x0'));var logger=require(_0xdc07('0x1'))('api');var moment=require(_0xdc07('0x2'));var BPromise=require('bluebird');var rp=require(_0xdc07('0x3'));var fs=require('fs');var path=require(_0xdc07('0x4'));var rimraf=require(_0xdc07('0x5'));var config=require(_0xdc07('0x6'));var attributes=require(_0xdc07('0x7'));module[_0xdc07('0x8')]=function(_0x24463b,_0x37fa8e){return _0x24463b[_0xdc07('0x9')](_0xdc07('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xdc07('0xb'),'fields':[_0xdc07('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 310c54b..39a306a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9592=['stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x196056,_0x3f4194){var _0x4d077c=function(_0x4f390b){while(--_0x4f390b){_0x196056['push'](_0x196056['shift']());}};_0x4d077c(++_0x3f4194);}(_0x9592,0x19f));var _0x2959=function(_0x4d73b3,_0x1bd756){_0x4d73b3=_0x4d73b3-0x0;var _0x356cc1=_0x9592[_0x4d73b3];return _0x356cc1;};'use strict';var _=require(_0x2959('0x0'));var util=require(_0x2959('0x1'));var moment=require(_0x2959('0x2'));var BPromise=require('bluebird');var rs=require(_0x2959('0x3'));var fs=require('fs');var Redis=require(_0x2959('0x4'));var db=require(_0x2959('0x5'))['db'];var utils=require(_0x2959('0x6'));var logger=require(_0x2959('0x7'))(_0x2959('0x8'));var config=require(_0x2959('0x9'));var jayson=require(_0x2959('0xa'));var client=jayson[_0x2959('0xb')][_0x2959('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x303019,_0x7ce025,_0x246d48){return new BPromise(function(_0x7c71a5,_0x39c724){return client['request'](_0x303019,_0x246d48)[_0x2959('0xd')](function(_0x30f9de){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x7ce025,_0x2959('0xe'));logger[_0x2959('0xf')](_0x2959('0x10'),_0x7ce025,_0x2959('0xe'),JSON[_0x2959('0x11')](_0x30f9de));if(_0x30f9de[_0x2959('0x12')]){if(_0x30f9de[_0x2959('0x12')][_0x2959('0x13')]===0x1f4){logger[_0x2959('0x12')](_0x2959('0x14'),_0x7ce025,_0x30f9de[_0x2959('0x12')][_0x2959('0x15')]);return _0x39c724(_0x30f9de[_0x2959('0x12')][_0x2959('0x15')]);}logger[_0x2959('0x12')](_0x2959('0x14'),_0x7ce025,_0x30f9de[_0x2959('0x12')][_0x2959('0x15')]);return _0x7c71a5(_0x30f9de[_0x2959('0x12')][_0x2959('0x15')]);}else{logger['info'](_0x2959('0x14'),_0x7ce025,_0x2959('0xe'));_0x7c71a5(_0x30f9de[_0x2959('0x16')][_0x2959('0x15')]);}})[_0x2959('0x17')](function(_0x3de2fd){logger[_0x2959('0x12')](_0x2959('0x14'),_0x7ce025,_0x3de2fd);_0x39c724(_0x3de2fd);});});}
\ No newline at end of file
+var _0x05db=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34ac5b,_0xbb91ec){var _0x240cbf=function(_0x2b348c){while(--_0x2b348c){_0x34ac5b['push'](_0x34ac5b['shift']());}};_0x240cbf(++_0xbb91ec);}(_0x05db,0xe8));var _0xb05d=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x05db[_0x10b317];return _0x1e3054;};'use strict';var _=require(_0xb05d('0x0'));var util=require(_0xb05d('0x1'));var moment=require(_0xb05d('0x2'));var BPromise=require(_0xb05d('0x3'));var rs=require(_0xb05d('0x4'));var fs=require('fs');var Redis=require(_0xb05d('0x5'));var db=require(_0xb05d('0x6'))['db'];var utils=require(_0xb05d('0x7'));var logger=require('../../config/logger')(_0xb05d('0x8'));var config=require('../../config/environment');var jayson=require(_0xb05d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x315124,_0x322f75,_0x26982e){return new BPromise(function(_0x184d06,_0x35cc5d){return client[_0xb05d('0xa')](_0x315124,_0x26982e)[_0xb05d('0xb')](function(_0x2b7778){logger[_0xb05d('0xc')](_0xb05d('0xd'),_0x322f75,_0xb05d('0xe'));logger['debug'](_0xb05d('0xf'),_0x322f75,_0xb05d('0xe'),JSON[_0xb05d('0x10')](_0x2b7778));if(_0x2b7778[_0xb05d('0x11')]){if(_0x2b7778[_0xb05d('0x11')][_0xb05d('0x12')]===0x1f4){logger[_0xb05d('0x11')](_0xb05d('0xd'),_0x322f75,_0x2b7778[_0xb05d('0x11')][_0xb05d('0x13')]);return _0x35cc5d(_0x2b7778[_0xb05d('0x11')][_0xb05d('0x13')]);}logger[_0xb05d('0x11')](_0xb05d('0xd'),_0x322f75,_0x2b7778[_0xb05d('0x11')]['message']);return _0x184d06(_0x2b7778[_0xb05d('0x11')][_0xb05d('0x13')]);}else{logger[_0xb05d('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x322f75,_0xb05d('0xe'));_0x184d06(_0x2b7778[_0xb05d('0x14')][_0xb05d('0x13')]);}})['catch'](function(_0x478086){logger[_0xb05d('0x11')](_0xb05d('0xd'),_0x322f75,_0x478086);_0x35cc5d(_0x478086);});});}
\ No newline at end of file
index b3c64bd..c0c634f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa19=['extname','post','/:id/logo','single','file','addLogo','logologin','originalname','addLogoLogin','preferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','index','/now','getDate','get','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa19,0xf6));var _0x9aa1=function(_0x48e5f4,_0x5e4411){_0x48e5f4=_0x48e5f4-0x0;var _0x298d7d=_0xaa19[_0x48e5f4];return _0x298d7d;};'use strict';var multer=require(_0x9aa1('0x0'));var util=require('util');var path=require(_0x9aa1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9aa1('0x2')]();var fs_extra=require(_0x9aa1('0x3'));var auth=require(_0x9aa1('0x4'));var interaction=require(_0x9aa1('0x5'));var config=require(_0x9aa1('0x6'));var controller=require(_0x9aa1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9aa1('0x8')]);router['get'](_0x9aa1('0x9'),controller[_0x9aa1('0xa')]);router[_0x9aa1('0xb')](_0x9aa1('0xc'),controller[_0x9aa1('0xd')]);router[_0x9aa1('0xb')]('/:id/logo',controller[_0x9aa1('0xe')]);router[_0x9aa1('0xb')](_0x9aa1('0xf'),controller[_0x9aa1('0x10')]);router[_0x9aa1('0xb')](_0x9aa1('0x11'),controller[_0x9aa1('0x12')]);router['get'](_0x9aa1('0x13'),controller[_0x9aa1('0x14')]);router[_0x9aa1('0xb')](_0x9aa1('0x15'),controller[_0x9aa1('0x16')]);var upload=multer({'storage':multer[_0x9aa1('0x17')]({'destination':function(_0x2c102c,_0x38673d,_0xf1daa9){_0xf1daa9(null,path[_0x9aa1('0x18')](config[_0x9aa1('0x19')],_0x9aa1('0x1a')));},'filename':function(_0x191327,_0x16602a,_0x5c3908){_0x5c3908(null,util[_0x9aa1('0x1b')](_0x9aa1('0x1c'),_0x9aa1('0x1d'),path[_0x9aa1('0x1e')](_0x16602a['originalname'])));}})});router[_0x9aa1('0x1f')](_0x9aa1('0x20'),upload[_0x9aa1('0x21')](_0x9aa1('0x22')),controller[_0x9aa1('0x23')]);var upload=multer({'storage':multer[_0x9aa1('0x17')]({'destination':function(_0x26c59d,_0x49a801,_0x3b7863){_0x3b7863(null,path['join'](config[_0x9aa1('0x19')],_0x9aa1('0x1a')));},'filename':function(_0x33e9aa,_0x1a923e,_0x355398){_0x355398(null,util[_0x9aa1('0x1b')](_0x9aa1('0x1c'),_0x9aa1('0x24'),path[_0x9aa1('0x1e')](_0x1a923e[_0x9aa1('0x25')])));}})});router[_0x9aa1('0x1f')](_0x9aa1('0xf'),upload[_0x9aa1('0x21')](_0x9aa1('0x22')),controller[_0x9aa1('0x26')]);var upload=multer({'storage':multer[_0x9aa1('0x17')]({'destination':function(_0xdd0388,_0x127c68,_0x430f1b){_0x430f1b(null,path[_0x9aa1('0x18')](config[_0x9aa1('0x19')],_0x9aa1('0x1a')));},'filename':function(_0x470aef,_0x486da2,_0x394bfc){_0x394bfc(null,util[_0x9aa1('0x1b')](_0x9aa1('0x1c'),_0x9aa1('0x27'),path[_0x9aa1('0x1e')](_0x486da2['originalname'])));}})});router[_0x9aa1('0x1f')](_0x9aa1('0x13'),upload['single'](_0x9aa1('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0x9aa1('0x17')]({'destination':function(_0x49e7a7,_0x36c7bf,_0x4992b8){_0x4992b8(null,path[_0x9aa1('0x18')](config['root'],_0x9aa1('0x1a')));},'filename':function(_0x279700,_0x14276a,_0x3e49ef){_0x3e49ef(null,util[_0x9aa1('0x1b')](_0x9aa1('0x1c'),_0x9aa1('0x28'),path[_0x9aa1('0x1e')](_0x14276a[_0x9aa1('0x25')])));}})});router[_0x9aa1('0x1f')](_0x9aa1('0x15'),upload[_0x9aa1('0x21')](_0x9aa1('0x22')),controller[_0x9aa1('0x29')]);router[_0x9aa1('0x2a')](_0x9aa1('0xc'),auth[_0x9aa1('0x2b')](),controller[_0x9aa1('0x2c')]);module[_0x9aa1('0x2d')]=router;
\ No newline at end of file
+var _0x0b6c=['addPreferred','addFavicon','put','update','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','index','/now','getDate','get','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','extname','originalname','single','file','addLogo','logologin','post','addLogoLogin','join','preferred'];(function(_0x551160,_0x3ba006){var _0x28fdd7=function(_0x123b2d){while(--_0x123b2d){_0x551160['push'](_0x551160['shift']());}};_0x28fdd7(++_0x3ba006);}(_0x0b6c,0x14c));var _0xc0b6=function(_0x25b19d,_0xe570b5){_0x25b19d=_0x25b19d-0x0;var _0x48449e=_0x0b6c[_0x25b19d];return _0x48449e;};'use strict';var multer=require(_0xc0b6('0x0'));var util=require('util');var path=require(_0xc0b6('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0b6('0x2'));var router=express['Router']();var fs_extra=require(_0xc0b6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc0b6('0x4'));var config=require(_0xc0b6('0x5'));var controller=require(_0xc0b6('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc0b6('0x7')]);router['get'](_0xc0b6('0x8'),controller[_0xc0b6('0x9')]);router[_0xc0b6('0xa')](_0xc0b6('0xb'),controller[_0xc0b6('0xc')]);router[_0xc0b6('0xa')](_0xc0b6('0xd'),controller[_0xc0b6('0xe')]);router[_0xc0b6('0xa')]('/:id/logo_login',controller[_0xc0b6('0xf')]);router['get'](_0xc0b6('0x10'),controller[_0xc0b6('0x11')]);router[_0xc0b6('0xa')](_0xc0b6('0x12'),controller[_0xc0b6('0x13')]);router[_0xc0b6('0xa')](_0xc0b6('0x14'),controller[_0xc0b6('0x15')]);var upload=multer({'storage':multer[_0xc0b6('0x16')]({'destination':function(_0x10281c,_0x10ec27,_0x3a7d11){_0x3a7d11(null,path['join'](config[_0xc0b6('0x17')],_0xc0b6('0x18')));},'filename':function(_0x201cad,_0x2c3730,_0xaeae54){_0xaeae54(null,util[_0xc0b6('0x19')](_0xc0b6('0x1a'),'logo',path[_0xc0b6('0x1b')](_0x2c3730[_0xc0b6('0x1c')])));}})});router['post'](_0xc0b6('0xd'),upload[_0xc0b6('0x1d')](_0xc0b6('0x1e')),controller[_0xc0b6('0x1f')]);var upload=multer({'storage':multer[_0xc0b6('0x16')]({'destination':function(_0x31bd2d,_0x214cad,_0x59534b){_0x59534b(null,path['join'](config[_0xc0b6('0x17')],'server/files/images/logos/'));},'filename':function(_0x80f5b6,_0x3b2281,_0x1370ec){_0x1370ec(null,util[_0xc0b6('0x19')]('%s%s',_0xc0b6('0x20'),path[_0xc0b6('0x1b')](_0x3b2281[_0xc0b6('0x1c')])));}})});router[_0xc0b6('0x21')]('/:id/logo_login',upload['single'](_0xc0b6('0x1e')),controller[_0xc0b6('0x22')]);var upload=multer({'storage':multer[_0xc0b6('0x16')]({'destination':function(_0x4ad455,_0x58d1b4,_0x3c634f){_0x3c634f(null,path[_0xc0b6('0x23')](config[_0xc0b6('0x17')],_0xc0b6('0x18')));},'filename':function(_0x55c796,_0x184309,_0x38fd75){_0x38fd75(null,util['format'](_0xc0b6('0x1a'),_0xc0b6('0x24'),path['extname'](_0x184309[_0xc0b6('0x1c')])));}})});router[_0xc0b6('0x21')]('/:id/preferred',upload['single']('file'),controller[_0xc0b6('0x25')]);var upload=multer({'storage':multer[_0xc0b6('0x16')]({'destination':function(_0x554de0,_0x25d5ab,_0x49924c){_0x49924c(null,path[_0xc0b6('0x23')](config[_0xc0b6('0x17')],'server/files/images/logos/'));},'filename':function(_0x3c0eb7,_0x26801c,_0x1c9756){_0x1c9756(null,util[_0xc0b6('0x19')]('%s%s','favicon',path['extname'](_0x26801c[_0xc0b6('0x1c')])));}})});router[_0xc0b6('0x21')](_0xc0b6('0x14'),upload['single'](_0xc0b6('0x1e')),controller[_0xc0b6('0x26')]);router[_0xc0b6('0x27')](_0xc0b6('0xb'),auth['isAuthenticated'](),controller[_0xc0b6('0x28')]);module['exports']=router;
\ No newline at end of file
index b9baa65..c20ccd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xdb28,0x106));var _0x8db2=function(_0x2395f8,_0x5d7333){_0x2395f8=_0x2395f8-0x0;var _0x22df7e=_0xdb28[_0x2395f8];return _0x22df7e;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'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(_0x54be3f,_0x5a84c6){var _0x58895f=function(_0x46373c){while(--_0x46373c){_0x54be3f['push'](_0x54be3f['shift']());}};_0x58895f(++_0x5a84c6);}(_0x7a54,0x106));var _0x47a5=function(_0x4e2d6a,_0x44c99e){_0x4e2d6a=_0x4e2d6a-0x0;var _0x5c5eb2=_0x7a54[_0x4e2d6a];return _0x5c5eb2;};'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 7ef6b6a..7b958c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1703=['default_loginLogo.svg','custom','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','send','map','Setting','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','preferred','defaultLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','favicon','defaultLoginLogo','existsSync'];(function(_0x53d2c9,_0x559313){var _0x47f8bd=function(_0x33da2b){while(--_0x33da2b){_0x53d2c9['push'](_0x53d2c9['shift']());}};_0x47f8bd(++_0x559313);}(_0x1703,0x16a));var _0x3170=function(_0x18dbdd,_0x3290c3){_0x18dbdd=_0x18dbdd-0x0;var _0x50d6c0=_0x1703[_0x18dbdd];return _0x50d6c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3170('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3170('0x1'));var rp=require(_0x3170('0x2'));var moment=require(_0x3170('0x3'));var BPromise=require(_0x3170('0x4'));var Mustache=require(_0x3170('0x5'));var util=require('util');var path=require(_0x3170('0x6'));var sox=require('sox');var csv=require(_0x3170('0x7'));var ejs=require(_0x3170('0x8'));var fs=require('fs');var fs_extra=require(_0x3170('0x9'));var _=require('lodash');var squel=require(_0x3170('0xa'));var crypto=require(_0x3170('0xb'));var jsforce=require(_0x3170('0xc'));var deskjs=require(_0x3170('0xd'));var toCsv=require(_0x3170('0x7'));var querystring=require(_0x3170('0xe'));var Papa=require(_0x3170('0xf'));var Redis=require(_0x3170('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3170('0x11'));var as=require(_0x3170('0x12'));var hardwareService=require(_0x3170('0x13'));var logger=require(_0x3170('0x14'))('api');var utils=require(_0x3170('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3170('0x16'));var db=require(_0x3170('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3170('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c0d0e,_0x17714a,_0x28cca6,_0x2980c3){return new BPromise(function(_0x26352e,_0x3a651a){var _0x5331ac=_0x2980c3||client;return _0x5331ac[_0x3170('0x19')](_0x1c0d0e,_0x28cca6)[_0x3170('0x1a')](function(_0x2cdf8a){logger['info'](_0x3170('0x1b'),_0x17714a,_0x3170('0x1c'));logger[_0x3170('0x1d')](_0x3170('0x1e'),_0x17714a,'request\x20sent',JSON['stringify'](_0x2cdf8a));if(_0x2cdf8a[_0x3170('0x1f')]){if(_0x2cdf8a[_0x3170('0x1f')][_0x3170('0x20')]===0x1f4){logger[_0x3170('0x1f')](_0x3170('0x1b'),_0x17714a,_0x2cdf8a[_0x3170('0x1f')]['message']);return _0x3a651a(_0x2cdf8a[_0x3170('0x1f')][_0x3170('0x21')]);}logger[_0x3170('0x1f')](_0x3170('0x1b'),_0x17714a,_0x2cdf8a['error'][_0x3170('0x21')]);return _0x26352e(_0x2cdf8a[_0x3170('0x1f')]['message']);}else{logger[_0x3170('0x22')]('Setting,\x20%s,\x20%s',_0x17714a,'request\x20sent');_0x26352e(_0x2cdf8a[_0x3170('0x23')][_0x3170('0x21')]);}})['catch'](function(_0x3d927a){logger['error']('Setting,\x20%s,\x20%s',_0x17714a,_0x3d927a);_0x3a651a(_0x3d927a);});});}function respondWithStatusCode(_0x5c6e9a,_0x58e0e1){_0x58e0e1=_0x58e0e1||0xcc;return function(_0x30a869){if(_0x30a869){return _0x5c6e9a[_0x3170('0x24')](_0x58e0e1);}return _0x5c6e9a['status'](_0x58e0e1)[_0x3170('0x25')]();};}function respondWithResult(_0x286cf0,_0x2ceaa2){_0x2ceaa2=_0x2ceaa2||0xc8;return function(_0x4fdf43){if(_0x4fdf43){return _0x286cf0[_0x3170('0x26')](_0x2ceaa2)[_0x3170('0x27')](_0x4fdf43);}};}function respondWithFilteredResult(_0x2f3dee,_0x4eda85){return function(_0x4933e3){if(_0x4933e3){var _0x329f53=typeof _0x4eda85[_0x3170('0x28')]===_0x3170('0x29')&&typeof _0x4eda85[_0x3170('0x2a')]===_0x3170('0x29');var _0x3144dd=_0x4933e3['count'];var _0xe879c8=_0x329f53?0x0:_0x4eda85[_0x3170('0x28')];var _0x3e9dd1=_0x329f53?_0x4933e3[_0x3170('0x2b')]:_0x4eda85[_0x3170('0x28')]+_0x4eda85[_0x3170('0x2a')];var _0x39100e;if(_0x3e9dd1>=_0x3144dd){_0x3e9dd1=_0x3144dd;_0x39100e=0xc8;}else{_0x39100e=0xce;}_0x2f3dee['status'](_0x39100e);return _0x2f3dee[_0x3170('0x2c')](_0x3170('0x2d'),_0xe879c8+'-'+_0x3e9dd1+'/'+_0x3144dd)[_0x3170('0x27')](_0x4933e3);}return null;};}function patchUpdates(_0x5ccf2d){return function(_0x5be547){try{jsonpatch[_0x3170('0x2e')](_0x5be547,_0x5ccf2d,!![]);}catch(_0x490640){return BPromise['reject'](_0x490640);}return _0x5be547[_0x3170('0x2f')]();};}function saveUpdates(_0x219ea9,_0x25154a){return function(_0x3718d5){if(_0x3718d5){return _0x3718d5[_0x3170('0x30')](_0x219ea9)[_0x3170('0x1a')](function(_0x1d732e){return _0x1d732e;});}return null;};}function removeEntity(_0x44d249,_0x1fc7f6){return function(_0x7b0a24){if(_0x7b0a24){return _0x7b0a24['destroy']()[_0x3170('0x1a')](function(){_0x44d249[_0x3170('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58206c,_0x3a0019){return function(_0x2fbdeb){if(!_0x2fbdeb){_0x58206c['sendStatus'](0x194);}return _0x2fbdeb;};}function handleError(_0x439425,_0x3ecbf1){_0x3ecbf1=_0x3ecbf1||0x1f4;return function(_0x4d4142){logger['error'](_0x4d4142[_0x3170('0x31')]);if(_0x4d4142[_0x3170('0x32')]){delete _0x4d4142[_0x3170('0x32')];}_0x439425[_0x3170('0x26')](_0x3ecbf1)[_0x3170('0x33')](_0x4d4142);};}exports['index']=function(_0x587752,_0x3d856d){var _0x37369b={},_0x13a594={},_0xd475c1={'count':0x0,'rows':[]};var _0x1afdce=_[_0x3170('0x34')](db[_0x3170('0x35')]['rawAttributes'],function(_0x31e55b){return{'name':_0x31e55b['fieldName'],'type':_0x31e55b[_0x3170('0x36')][_0x3170('0x37')]};});_0x13a594['model']=_['map'](_0x1afdce,_0x3170('0x32'));_0x13a594[_0x3170('0x38')]=_[_0x3170('0x39')](_0x587752[_0x3170('0x38')]);_0x13a594[_0x3170('0x3a')]=_[_0x3170('0x3b')](_0x13a594[_0x3170('0x3c')],_0x13a594[_0x3170('0x38')]);_0x37369b[_0x3170('0x3d')]=_[_0x3170('0x3b')](_0x13a594[_0x3170('0x3c')],qs[_0x3170('0x3e')](_0x587752[_0x3170('0x38')]['fields']));_0x37369b[_0x3170('0x3d')]=_0x37369b['attributes'][_0x3170('0x3f')]?_0x37369b['attributes']:_0x13a594[_0x3170('0x3c')];if(!_0x587752['query'][_0x3170('0x40')](_0x3170('0x41'))){_0x37369b['limit']=qs[_0x3170('0x2a')](_0x587752[_0x3170('0x38')]['limit']);_0x37369b[_0x3170('0x28')]=qs[_0x3170('0x28')](_0x587752[_0x3170('0x38')][_0x3170('0x28')]);}_0x37369b[_0x3170('0x42')]=qs[_0x3170('0x43')](_0x587752[_0x3170('0x38')][_0x3170('0x43')]);_0x37369b[_0x3170('0x44')]=qs[_0x3170('0x3a')](_[_0x3170('0x45')](_0x587752[_0x3170('0x38')],_0x13a594[_0x3170('0x3a')]),_0x1afdce);if(_0x587752['query'][_0x3170('0x46')]){_0x37369b[_0x3170('0x44')]=_[_0x3170('0x47')](_0x37369b['where'],{'$or':_[_0x3170('0x34')](_0x1afdce,function(_0x339483){if(_0x339483[_0x3170('0x36')]!=='VIRTUAL'){var _0x4b620e={};_0x4b620e[_0x339483[_0x3170('0x32')]]={'$like':'%'+_0x587752[_0x3170('0x38')][_0x3170('0x46')]+'%'};return _0x4b620e;}})});}_0x37369b=_[_0x3170('0x47')]({},_0x37369b,_0x587752['options']);var _0x569dae={'where':_0x37369b[_0x3170('0x44')]};return db[_0x3170('0x35')][_0x3170('0x2b')](_0x569dae)[_0x3170('0x1a')](function(_0x25cafe){_0xd475c1[_0x3170('0x2b')]=_0x25cafe;if(_0x587752[_0x3170('0x38')][_0x3170('0x48')]){_0x37369b[_0x3170('0x49')]=[{'all':!![]}];}return db['Setting'][_0x3170('0x4a')](_0x37369b);})['then'](function(_0x187bb0){_0xd475c1['rows']=_0x187bb0;return _0xd475c1;})['then'](respondWithFilteredResult(_0x3d856d,_0x37369b))[_0x3170('0x4b')](handleError(_0x3d856d,null));};exports[_0x3170('0x4c')]=function(_0x368a65,_0x11800f){var _0x46e11f={'raw':![],'where':{'id':_0x368a65[_0x3170('0x4d')]['id']}},_0x4faf42={};_0x4faf42[_0x3170('0x3c')]=_['keys'](db[_0x3170('0x35')][_0x3170('0x4e')]);_0x4faf42[_0x3170('0x38')]=_[_0x3170('0x39')](_0x368a65[_0x3170('0x38')]);_0x4faf42[_0x3170('0x3a')]=_[_0x3170('0x3b')](_0x4faf42[_0x3170('0x3c')],_0x4faf42['query']);_0x46e11f[_0x3170('0x3d')]=_[_0x3170('0x3b')](_0x4faf42['model'],qs[_0x3170('0x3e')](_0x368a65[_0x3170('0x38')][_0x3170('0x3e')]));_0x46e11f[_0x3170('0x3d')]=_0x46e11f[_0x3170('0x3d')][_0x3170('0x3f')]?_0x46e11f['attributes']:_0x4faf42[_0x3170('0x3c')];if(_0x368a65[_0x3170('0x38')][_0x3170('0x48')]){_0x46e11f[_0x3170('0x49')]=[{'all':!![]}];}_0x46e11f=_['merge']({},_0x46e11f,_0x368a65['options']);return db[_0x3170('0x35')]['find'](_0x46e11f)['then'](handleEntityNotFound(_0x11800f,null))[_0x3170('0x1a')](respondWithResult(_0x11800f,null))[_0x3170('0x4b')](handleError(_0x11800f,null));};exports[_0x3170('0x30')]=function(_0x13c466,_0x3a1059){if(_0x13c466[_0x3170('0x4f')]['id']){delete _0x13c466['body']['id'];}return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x13c466[_0x3170('0x4d')]['id']}})[_0x3170('0x1a')](handleEntityNotFound(_0x3a1059,null))[_0x3170('0x1a')](saveUpdates(_0x13c466[_0x3170('0x4f')],null))[_0x3170('0x1a')](respondWithResult(_0x3a1059,null))[_0x3170('0x4b')](handleError(_0x3a1059,null));};exports['addLogo']=function(_0x11b83c,_0x390e32,_0x2cf166){if(_0x11b83c[_0x3170('0x51')]&&_0x11b83c[_0x3170('0x51')][_0x3170('0x52')]){_0x11b83c[_0x3170('0x4f')][_0x3170('0x53')]=_0x11b83c['file'][_0x3170('0x52')];}return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x11b83c['params']['id']}})[_0x3170('0x1a')](handleEntityNotFound(_0x390e32,null))[_0x3170('0x1a')](saveUpdates(_0x11b83c[_0x3170('0x4f')],null))['then'](respondWithResult(_0x390e32,null))[_0x3170('0x4b')](handleError(_0x390e32,null));};exports[_0x3170('0x54')]=function(_0x4ced41,_0x1055bf,_0x15cf71){if(_0x4ced41[_0x3170('0x51')]&&_0x4ced41['file']['filename']){_0x4ced41[_0x3170('0x4f')][_0x3170('0x55')]=_0x4ced41[_0x3170('0x51')][_0x3170('0x52')];}return db['Setting'][_0x3170('0x50')]({'where':{'id':_0x4ced41['params']['id']}})[_0x3170('0x1a')](handleEntityNotFound(_0x1055bf,null))[_0x3170('0x1a')](saveUpdates(_0x4ced41[_0x3170('0x4f')],null))[_0x3170('0x1a')](respondWithResult(_0x1055bf,null))[_0x3170('0x4b')](handleError(_0x1055bf,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1270f0,_0x1fbfd4,_0x578006){var _0xd0489f=_0x3170('0x56');var _0x28a47b={'custom':![]};return utilLicense['getLicense']()[_0x3170('0x1a')](function(_0x5f5dd1){if(_0x5f5dd1){_0x28a47b=_0x5f5dd1;}return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x1270f0[_0x3170('0x4d')]['id']},'attributes':['logo',_0x3170('0x55'),_0x3170('0x57'),'favicon',_0x3170('0x58'),'defaultLoginLogo',_0x3170('0x59'),_0x3170('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x1fbfd4,null))[_0x3170('0x1a')](function(_0x99c8e2){if(_0x99c8e2){var _0x2e104e=_0x99c8e2['logo']&&fs['existsSync'](path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0xd0489f,_['toLower'](_0x99c8e2[_0x3170('0x53')])))?path[_0x3170('0x5b')](config['root'],_0xd0489f,_[_0x3170('0x5d')](_0x99c8e2[_0x3170('0x53')])):path['join'](config[_0x3170('0x5c')],_0xd0489f,_[_0x3170('0x5d')](_0x3170('0x5e')));var _0x1789ce=_0x3170('0x5f')+_[_0x3170('0x60')]('logo');if(_0x99c8e2[_0x1789ce]||!_0x28a47b['custom']){_0x2e104e=path['join'](config[_0x3170('0x5c')],_0xd0489f,_[_0x3170('0x5d')](_0x3170('0x5e')));}if(!fs['existsSync'](_0x2e104e)){throw new db[(_0x3170('0x61'))][(_0x3170('0x62'))](_[_0x3170('0x60')](_0x3170('0x53'))+_0x3170('0x63'));}return _0x1fbfd4[_0x3170('0x64')](_0x2e104e);}})[_0x3170('0x4b')](handleError(_0x1fbfd4,null));};var utilLicense=require(_0x3170('0x16'));exports[_0x3170('0x65')]=function(_0x1d300d,_0x3bb127,_0x330ce5){var _0x56ac5f=_0x3170('0x56');var _0xd37885={'custom':![]};return utilLicense[_0x3170('0x66')]()[_0x3170('0x1a')](function(_0x24ca8b){if(_0x24ca8b){_0xd37885=_0x24ca8b;}return db[_0x3170('0x35')]['find']({'where':{'id':_0x1d300d[_0x3170('0x4d')]['id']},'attributes':[_0x3170('0x53'),_0x3170('0x55'),_0x3170('0x57'),_0x3170('0x67'),_0x3170('0x58'),_0x3170('0x68'),_0x3170('0x59'),'defaultFavicon'],'raw':!![]});})[_0x3170('0x1a')](handleEntityNotFound(_0x3bb127,null))[_0x3170('0x1a')](function(_0x1474cf){if(_0x1474cf){var _0x29f70d=_0x1474cf[_0x3170('0x55')]&&fs[_0x3170('0x69')](path['join'](config['root'],_0x56ac5f,_['toLower'](_0x1474cf[_0x3170('0x55')])))?path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0x56ac5f,_[_0x3170('0x5d')](_0x1474cf['loginLogo'])):path[_0x3170('0x5b')](config['root'],_0x56ac5f,_[_0x3170('0x5d')](_0x3170('0x6a')));var _0x2ef87d=_0x3170('0x5f')+_[_0x3170('0x60')]('loginLogo');if(_0x1474cf[_0x2ef87d]||!_0xd37885[_0x3170('0x6b')]){_0x29f70d=path[_0x3170('0x5b')](config['root'],_0x56ac5f,_['toLower'](_0x3170('0x6a')));}if(!fs['existsSync'](_0x29f70d)){throw new db[(_0x3170('0x61'))][(_0x3170('0x62'))](_[_0x3170('0x60')](_0x3170('0x55'))+_0x3170('0x63'));}return _0x3bb127['download'](_0x29f70d);}})[_0x3170('0x4b')](handleError(_0x3bb127,null));};exports[_0x3170('0x6c')]=function(_0x12db23,_0x5dadf7){return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x12db23[_0x3170('0x4d')]['id']},'attributes':[_0x3170('0x6d')]})[_0x3170('0x1a')](respondWithResult(_0x5dadf7,null))[_0x3170('0x4b')](handleError(_0x5dadf7,null));};exports[_0x3170('0x6e')]=function(_0x443ce5,_0x269eb4,_0x3b73ac){if(_0x443ce5[_0x3170('0x51')]&&_0x443ce5['file'][_0x3170('0x52')]){_0x443ce5[_0x3170('0x4f')][_0x3170('0x57')]=_0x443ce5[_0x3170('0x51')][_0x3170('0x52')];}return db['Setting'][_0x3170('0x50')]({'where':{'id':_0x443ce5['params']['id']}})[_0x3170('0x1a')](handleEntityNotFound(_0x269eb4,null))[_0x3170('0x1a')](saveUpdates(_0x443ce5[_0x3170('0x4f')],null))['then'](respondWithResult(_0x269eb4,null))[_0x3170('0x4b')](handleError(_0x269eb4,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x3edce3,_0x1b88c1,_0x39123c){var _0xa21340=_0x3170('0x56');var _0x22b9c6={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2bf4b0){if(_0x2bf4b0){_0x22b9c6=_0x2bf4b0;}return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x3edce3['params']['id']},'attributes':[_0x3170('0x53'),'loginLogo','preferred',_0x3170('0x67'),'defaultLogo',_0x3170('0x68'),_0x3170('0x59'),'defaultFavicon'],'raw':!![]});})[_0x3170('0x1a')](handleEntityNotFound(_0x1b88c1,null))[_0x3170('0x1a')](function(_0x1bdaf0){if(_0x1bdaf0){var _0x22bff1=_0x1bdaf0[_0x3170('0x57')]&&fs[_0x3170('0x69')](path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0xa21340,_[_0x3170('0x5d')](_0x1bdaf0[_0x3170('0x57')])))?path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0xa21340,_['toLower'](_0x1bdaf0['preferred'])):path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0xa21340,_[_0x3170('0x5d')]('default_preferred.png'));var _0x67fbf0=_0x3170('0x5f')+_['upperFirst'](_0x3170('0x57'));if(_0x1bdaf0[_0x67fbf0]||!_0x22b9c6[_0x3170('0x6b')]||!_0x22b9c6[_0x3170('0x57')]){_0x22bff1=path['join'](config[_0x3170('0x5c')],_0xa21340,_['toLower'](_0x3170('0x6f')));}if(!fs['existsSync'](_0x22bff1)){throw new db[(_0x3170('0x61'))][(_0x3170('0x62'))](_['upperFirst'](_0x3170('0x57'))+'\x20not\x20found');}return _0x1b88c1['download'](_0x22bff1);}})[_0x3170('0x4b')](handleError(_0x1b88c1,null));};exports[_0x3170('0x70')]=function(_0x19766e,_0x19cc9a,_0x4f4492){if(_0x19766e[_0x3170('0x51')]&&_0x19766e[_0x3170('0x51')][_0x3170('0x52')]){_0x19766e[_0x3170('0x4f')][_0x3170('0x67')]=_0x19766e['file'][_0x3170('0x52')];}return db[_0x3170('0x35')][_0x3170('0x50')]({'where':{'id':_0x19766e[_0x3170('0x4d')]['id']}})[_0x3170('0x1a')](handleEntityNotFound(_0x19cc9a,null))[_0x3170('0x1a')](saveUpdates(_0x19766e['body'],null))['then'](respondWithResult(_0x19cc9a,null))[_0x3170('0x4b')](handleError(_0x19cc9a,null));};var utilLicense=require(_0x3170('0x16'));exports[_0x3170('0x71')]=function(_0x1b6523,_0x38a939,_0x419a4b){var _0x2cbb06='server/files/images/logos';var _0x9c9c7={'custom':![]};return utilLicense[_0x3170('0x66')]()[_0x3170('0x1a')](function(_0x5eb925){if(_0x5eb925){_0x9c9c7=_0x5eb925;}return db['Setting']['find']({'where':{'id':_0x1b6523[_0x3170('0x4d')]['id']},'attributes':[_0x3170('0x53'),_0x3170('0x55'),'preferred','favicon',_0x3170('0x58'),_0x3170('0x68'),_0x3170('0x59'),'defaultFavicon'],'raw':!![]});})[_0x3170('0x1a')](handleEntityNotFound(_0x38a939,null))['then'](function(_0x230d5b){if(_0x230d5b){var _0x4d3d18=_0x230d5b[_0x3170('0x67')]&&fs[_0x3170('0x69')](path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0x2cbb06,_[_0x3170('0x5d')](_0x230d5b[_0x3170('0x67')])))?path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0x2cbb06,_[_0x3170('0x5d')](_0x230d5b[_0x3170('0x67')])):path[_0x3170('0x5b')](config[_0x3170('0x5c')],_0x2cbb06,_[_0x3170('0x5d')]('default_favicon.ico'));var _0x5ac0ed=_0x3170('0x5f')+_[_0x3170('0x60')](_0x3170('0x67'));if(_0x230d5b[_0x5ac0ed]||!_0x9c9c7['custom']){_0x4d3d18=path['join'](config['root'],_0x2cbb06,_[_0x3170('0x5d')](_0x3170('0x72')));}if(!fs['existsSync'](_0x4d3d18)){throw new db['Sequelize'][(_0x3170('0x62'))](_[_0x3170('0x60')](_0x3170('0x67'))+_0x3170('0x63'));}return _0x38a939[_0x3170('0x64')](_0x4d3d18);}})[_0x3170('0x4b')](handleError(_0x38a939,null));};exports[_0x3170('0x73')]=function(_0x1bd976,_0x50ba47){var _0x356517={'offset':moment()['utcOffset']()};_0x356517[_0x3170('0x74')]=moment()['utcOffset'](_0x356517[_0x3170('0x28')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x50ba47[_0x3170('0x26')](0xc8)[_0x3170('0x33')](_0x356517);};
\ No newline at end of file
+var _0x3870=['api','../../config/utils','../../config/license/util','jayson/promise','client','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','end','offset','undefined','limit','count','status','set','Content-Range','json','save','update','then','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','show','params','keys','find','body','addLogo','filename','file','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','utcOffset','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x33d2dd,_0x17f1eb){var _0x5054e0=function(_0x227b94){while(--_0x227b94){_0x33d2dd['push'](_0x33d2dd['shift']());}};_0x5054e0(++_0x17f1eb);}(_0x3870,0x15b));var _0x0387=function(_0x77e590,_0x514ccc){_0x77e590=_0x77e590-0x0;var _0x5985a7=_0x3870[_0x77e590];return _0x5985a7;};'use strict';var emlformat=require(_0x0387('0x0'));var rimraf=require(_0x0387('0x1'));var zipdir=require(_0x0387('0x2'));var jsonpatch=require(_0x0387('0x3'));var rp=require(_0x0387('0x4'));var moment=require(_0x0387('0x5'));var BPromise=require(_0x0387('0x6'));var Mustache=require(_0x0387('0x7'));var util=require(_0x0387('0x8'));var path=require(_0x0387('0x9'));var sox=require(_0x0387('0xa'));var csv=require(_0x0387('0xb'));var ejs=require(_0x0387('0xc'));var fs=require('fs');var fs_extra=require(_0x0387('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0387('0xe'));var jsforce=require(_0x0387('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0387('0xb'));var querystring=require(_0x0387('0x10'));var Papa=require(_0x0387('0x11'));var Redis=require(_0x0387('0x12'));var authService=require(_0x0387('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0387('0x14'));var hardwareService=require(_0x0387('0x15'));var logger=require('../../config/logger')(_0x0387('0x16'));var utils=require(_0x0387('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0387('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0387('0x19'));var client=jayson[_0x0387('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fe2f,_0xb5e31b,_0x42d06a,_0x237ba3){return new BPromise(function(_0x389e85,_0x2baf2b){var _0x22e771=_0x237ba3||client;return _0x22e771[_0x0387('0x1b')](_0x31fe2f,_0x42d06a)['then'](function(_0x4f2d8a){logger[_0x0387('0x1c')]('Setting,\x20%s,\x20%s',_0xb5e31b,_0x0387('0x1d'));logger[_0x0387('0x1e')](_0x0387('0x1f'),_0xb5e31b,_0x0387('0x1d'),JSON[_0x0387('0x20')](_0x4f2d8a));if(_0x4f2d8a[_0x0387('0x21')]){if(_0x4f2d8a[_0x0387('0x21')][_0x0387('0x22')]===0x1f4){logger[_0x0387('0x21')](_0x0387('0x23'),_0xb5e31b,_0x4f2d8a[_0x0387('0x21')][_0x0387('0x24')]);return _0x2baf2b(_0x4f2d8a[_0x0387('0x21')][_0x0387('0x24')]);}logger[_0x0387('0x21')](_0x0387('0x23'),_0xb5e31b,_0x4f2d8a['error'][_0x0387('0x24')]);return _0x389e85(_0x4f2d8a[_0x0387('0x21')][_0x0387('0x24')]);}else{logger[_0x0387('0x1c')](_0x0387('0x23'),_0xb5e31b,'request\x20sent');_0x389e85(_0x4f2d8a[_0x0387('0x25')][_0x0387('0x24')]);}})[_0x0387('0x26')](function(_0x4336d3){logger[_0x0387('0x21')](_0x0387('0x23'),_0xb5e31b,_0x4336d3);_0x2baf2b(_0x4336d3);});});}function respondWithStatusCode(_0x2190a1,_0x5b7648){_0x5b7648=_0x5b7648||0xcc;return function(_0x314de6){if(_0x314de6){return _0x2190a1['sendStatus'](_0x5b7648);}return _0x2190a1['status'](_0x5b7648)[_0x0387('0x27')]();};}function respondWithResult(_0x301b30,_0x38bd14){_0x38bd14=_0x38bd14||0xc8;return function(_0x501c0){if(_0x501c0){return _0x301b30['status'](_0x38bd14)['json'](_0x501c0);}};}function respondWithFilteredResult(_0x240231,_0x5b6b8d){return function(_0x934392){if(_0x934392){var _0x1794b1=typeof _0x5b6b8d[_0x0387('0x28')]===_0x0387('0x29')&&typeof _0x5b6b8d[_0x0387('0x2a')]===_0x0387('0x29');var _0x1772aa=_0x934392[_0x0387('0x2b')];var _0x1ca6ca=_0x1794b1?0x0:_0x5b6b8d[_0x0387('0x28')];var _0x40d40e=_0x1794b1?_0x934392[_0x0387('0x2b')]:_0x5b6b8d[_0x0387('0x28')]+_0x5b6b8d[_0x0387('0x2a')];var _0x3ba63a;if(_0x40d40e>=_0x1772aa){_0x40d40e=_0x1772aa;_0x3ba63a=0xc8;}else{_0x3ba63a=0xce;}_0x240231[_0x0387('0x2c')](_0x3ba63a);return _0x240231[_0x0387('0x2d')](_0x0387('0x2e'),_0x1ca6ca+'-'+_0x40d40e+'/'+_0x1772aa)[_0x0387('0x2f')](_0x934392);}return null;};}function patchUpdates(_0x5bd827){return function(_0x1ad307){try{jsonpatch['apply'](_0x1ad307,_0x5bd827,!![]);}catch(_0x19d17f){return BPromise['reject'](_0x19d17f);}return _0x1ad307[_0x0387('0x30')]();};}function saveUpdates(_0x1e5dab,_0xa9d686){return function(_0x6fd07c){if(_0x6fd07c){return _0x6fd07c[_0x0387('0x31')](_0x1e5dab)[_0x0387('0x32')](function(_0x4c0147){return _0x4c0147;});}return null;};}function removeEntity(_0x58b393,_0x1168c3){return function(_0x2ba569){if(_0x2ba569){return _0x2ba569['destroy']()['then'](function(){_0x58b393['status'](0xcc)[_0x0387('0x27')]();});}};}function handleEntityNotFound(_0x3fe791,_0x5dec32){return function(_0x3134fb){if(!_0x3134fb){_0x3fe791[_0x0387('0x33')](0x194);}return _0x3134fb;};}function handleError(_0x132c56,_0x219b1c){_0x219b1c=_0x219b1c||0x1f4;return function(_0x5268d4){logger[_0x0387('0x21')](_0x5268d4[_0x0387('0x34')]);if(_0x5268d4[_0x0387('0x35')]){delete _0x5268d4[_0x0387('0x35')];}_0x132c56[_0x0387('0x2c')](_0x219b1c)[_0x0387('0x36')](_0x5268d4);};}exports[_0x0387('0x37')]=function(_0x3cc690,_0x29d7c6){var _0x156764={},_0x492c9c={},_0x39aa46={'count':0x0,'rows':[]};var _0x494a03=_[_0x0387('0x38')](db[_0x0387('0x39')][_0x0387('0x3a')],function(_0x3415e0){return{'name':_0x3415e0[_0x0387('0x3b')],'type':_0x3415e0[_0x0387('0x3c')][_0x0387('0x3d')]};});_0x492c9c[_0x0387('0x3e')]=_[_0x0387('0x38')](_0x494a03,_0x0387('0x35'));_0x492c9c[_0x0387('0x3f')]=_['keys'](_0x3cc690[_0x0387('0x3f')]);_0x492c9c['filters']=_[_0x0387('0x40')](_0x492c9c[_0x0387('0x3e')],_0x492c9c['query']);_0x156764[_0x0387('0x41')]=_['intersection'](_0x492c9c[_0x0387('0x3e')],qs[_0x0387('0x42')](_0x3cc690['query'][_0x0387('0x42')]));_0x156764[_0x0387('0x41')]=_0x156764[_0x0387('0x41')][_0x0387('0x43')]?_0x156764[_0x0387('0x41')]:_0x492c9c[_0x0387('0x3e')];if(!_0x3cc690['query'][_0x0387('0x44')](_0x0387('0x45'))){_0x156764['limit']=qs['limit'](_0x3cc690[_0x0387('0x3f')]['limit']);_0x156764[_0x0387('0x28')]=qs['offset'](_0x3cc690[_0x0387('0x3f')][_0x0387('0x28')]);}_0x156764[_0x0387('0x46')]=qs[_0x0387('0x47')](_0x3cc690[_0x0387('0x3f')][_0x0387('0x47')]);_0x156764[_0x0387('0x48')]=qs[_0x0387('0x49')](_[_0x0387('0x4a')](_0x3cc690[_0x0387('0x3f')],_0x492c9c[_0x0387('0x49')]),_0x494a03);if(_0x3cc690['query'][_0x0387('0x4b')]){_0x156764[_0x0387('0x48')]=_['merge'](_0x156764[_0x0387('0x48')],{'$or':_[_0x0387('0x38')](_0x494a03,function(_0x339972){if(_0x339972[_0x0387('0x3c')]!==_0x0387('0x4c')){var _0x271970={};_0x271970[_0x339972['name']]={'$like':'%'+_0x3cc690[_0x0387('0x3f')][_0x0387('0x4b')]+'%'};return _0x271970;}})});}_0x156764=_[_0x0387('0x4d')]({},_0x156764,_0x3cc690[_0x0387('0x4e')]);var _0x34cdec={'where':_0x156764[_0x0387('0x48')]};return db[_0x0387('0x39')][_0x0387('0x2b')](_0x34cdec)[_0x0387('0x32')](function(_0x1880ae){_0x39aa46['count']=_0x1880ae;if(_0x3cc690[_0x0387('0x3f')]['includeAll']){_0x156764[_0x0387('0x4f')]=[{'all':!![]}];}return db[_0x0387('0x39')]['findAll'](_0x156764);})[_0x0387('0x32')](function(_0x34f998){_0x39aa46['rows']=_0x34f998;return _0x39aa46;})[_0x0387('0x32')](respondWithFilteredResult(_0x29d7c6,_0x156764))[_0x0387('0x26')](handleError(_0x29d7c6,null));};exports[_0x0387('0x50')]=function(_0x2d2773,_0xf1fcb){var _0x477241={'raw':![],'where':{'id':_0x2d2773[_0x0387('0x51')]['id']}},_0x7d7041={};_0x7d7041[_0x0387('0x3e')]=_[_0x0387('0x52')](db['Setting'][_0x0387('0x3a')]);_0x7d7041['query']=_[_0x0387('0x52')](_0x2d2773['query']);_0x7d7041[_0x0387('0x49')]=_[_0x0387('0x40')](_0x7d7041['model'],_0x7d7041[_0x0387('0x3f')]);_0x477241['attributes']=_[_0x0387('0x40')](_0x7d7041['model'],qs['fields'](_0x2d2773[_0x0387('0x3f')]['fields']));_0x477241[_0x0387('0x41')]=_0x477241[_0x0387('0x41')][_0x0387('0x43')]?_0x477241['attributes']:_0x7d7041[_0x0387('0x3e')];if(_0x2d2773[_0x0387('0x3f')]['includeAll']){_0x477241[_0x0387('0x4f')]=[{'all':!![]}];}_0x477241=_[_0x0387('0x4d')]({},_0x477241,_0x2d2773['options']);return db[_0x0387('0x39')][_0x0387('0x53')](_0x477241)[_0x0387('0x32')](handleEntityNotFound(_0xf1fcb,null))[_0x0387('0x32')](respondWithResult(_0xf1fcb,null))[_0x0387('0x26')](handleError(_0xf1fcb,null));};exports['update']=function(_0x310096,_0x201956){if(_0x310096[_0x0387('0x54')]['id']){delete _0x310096[_0x0387('0x54')]['id'];}return db[_0x0387('0x39')]['find']({'where':{'id':_0x310096['params']['id']}})['then'](handleEntityNotFound(_0x201956,null))[_0x0387('0x32')](saveUpdates(_0x310096['body'],null))[_0x0387('0x32')](respondWithResult(_0x201956,null))[_0x0387('0x26')](handleError(_0x201956,null));};exports[_0x0387('0x55')]=function(_0x493a95,_0x1acf98,_0x23c6ad){if(_0x493a95['file']&&_0x493a95['file'][_0x0387('0x56')]){_0x493a95[_0x0387('0x54')]['logo']=_0x493a95[_0x0387('0x57')][_0x0387('0x56')];}return db[_0x0387('0x39')]['find']({'where':{'id':_0x493a95[_0x0387('0x51')]['id']}})[_0x0387('0x32')](handleEntityNotFound(_0x1acf98,null))[_0x0387('0x32')](saveUpdates(_0x493a95[_0x0387('0x54')],null))['then'](respondWithResult(_0x1acf98,null))[_0x0387('0x26')](handleError(_0x1acf98,null));};exports[_0x0387('0x58')]=function(_0x4010b5,_0x347dd5,_0x4e6488){if(_0x4010b5['file']&&_0x4010b5['file'][_0x0387('0x56')]){_0x4010b5[_0x0387('0x54')][_0x0387('0x59')]=_0x4010b5[_0x0387('0x57')][_0x0387('0x56')];}return db[_0x0387('0x39')]['find']({'where':{'id':_0x4010b5[_0x0387('0x51')]['id']}})[_0x0387('0x32')](handleEntityNotFound(_0x347dd5,null))[_0x0387('0x32')](saveUpdates(_0x4010b5[_0x0387('0x54')],null))[_0x0387('0x32')](respondWithResult(_0x347dd5,null))[_0x0387('0x26')](handleError(_0x347dd5,null));};var utilLicense=require('../../config/license/util');exports[_0x0387('0x5a')]=function(_0x390feb,_0x194495,_0x1fdfff){var _0x105c6e=_0x0387('0x5b');var _0x3d53d9={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5289ce){if(_0x5289ce){_0x3d53d9=_0x5289ce;}return db[_0x0387('0x39')][_0x0387('0x53')]({'where':{'id':_0x390feb['params']['id']},'attributes':[_0x0387('0x5c'),_0x0387('0x59'),'preferred',_0x0387('0x5d'),_0x0387('0x5e'),_0x0387('0x5f'),'defaultPreferred',_0x0387('0x60')],'raw':!![]});})[_0x0387('0x32')](handleEntityNotFound(_0x194495,null))[_0x0387('0x32')](function(_0x511bb0){if(_0x511bb0){var _0x10c54e=_0x511bb0[_0x0387('0x5c')]&&fs[_0x0387('0x61')](path[_0x0387('0x62')](config['root'],_0x105c6e,_['toLower'](_0x511bb0[_0x0387('0x5c')])))?path[_0x0387('0x62')](config[_0x0387('0x63')],_0x105c6e,_[_0x0387('0x64')](_0x511bb0[_0x0387('0x5c')])):path[_0x0387('0x62')](config['root'],_0x105c6e,_[_0x0387('0x64')](_0x0387('0x65')));var _0x53e05e=_0x0387('0x66')+_[_0x0387('0x67')](_0x0387('0x5c'));if(_0x511bb0[_0x53e05e]||!_0x3d53d9[_0x0387('0x68')]){_0x10c54e=path[_0x0387('0x62')](config[_0x0387('0x63')],_0x105c6e,_[_0x0387('0x64')](_0x0387('0x65')));}if(!fs[_0x0387('0x61')](_0x10c54e)){throw new db[(_0x0387('0x69'))][(_0x0387('0x6a'))](_['upperFirst']('logo')+_0x0387('0x6b'));}return _0x194495[_0x0387('0x6c')](_0x10c54e);}})[_0x0387('0x26')](handleError(_0x194495,null));};var utilLicense=require(_0x0387('0x18'));exports[_0x0387('0x6d')]=function(_0x4c406e,_0x5d84f0,_0x35bdde){var _0x50710a='server/files/images/logos';var _0x13249c={'custom':![]};return utilLicense['getLicense']()[_0x0387('0x32')](function(_0x114b7b){if(_0x114b7b){_0x13249c=_0x114b7b;}return db['Setting']['find']({'where':{'id':_0x4c406e['params']['id']},'attributes':[_0x0387('0x5c'),'loginLogo',_0x0387('0x6e'),_0x0387('0x5d'),_0x0387('0x5e'),_0x0387('0x5f'),_0x0387('0x6f'),_0x0387('0x60')],'raw':!![]});})[_0x0387('0x32')](handleEntityNotFound(_0x5d84f0,null))[_0x0387('0x32')](function(_0x2fde29){if(_0x2fde29){var _0xbabc1c=_0x2fde29[_0x0387('0x59')]&&fs['existsSync'](path[_0x0387('0x62')](config['root'],_0x50710a,_[_0x0387('0x64')](_0x2fde29[_0x0387('0x59')])))?path[_0x0387('0x62')](config[_0x0387('0x63')],_0x50710a,_[_0x0387('0x64')](_0x2fde29['loginLogo'])):path['join'](config['root'],_0x50710a,_[_0x0387('0x64')](_0x0387('0x70')));var _0x21f8d0=_0x0387('0x66')+_[_0x0387('0x67')](_0x0387('0x59'));if(_0x2fde29[_0x21f8d0]||!_0x13249c[_0x0387('0x68')]){_0xbabc1c=path['join'](config['root'],_0x50710a,_[_0x0387('0x64')](_0x0387('0x70')));}if(!fs[_0x0387('0x61')](_0xbabc1c)){throw new db[(_0x0387('0x69'))]['ValidationError'](_[_0x0387('0x67')](_0x0387('0x59'))+_0x0387('0x6b'));}return _0x5d84f0[_0x0387('0x6c')](_0xbabc1c);}})['catch'](handleError(_0x5d84f0,null));};exports[_0x0387('0x71')]=function(_0x1c2c2f,_0x4dc9db){return db[_0x0387('0x39')][_0x0387('0x53')]({'where':{'id':_0x1c2c2f[_0x0387('0x51')]['id']},'attributes':[_0x0387('0x72')]})[_0x0387('0x32')](respondWithResult(_0x4dc9db,null))['catch'](handleError(_0x4dc9db,null));};exports[_0x0387('0x73')]=function(_0x2f444c,_0xf86e9e,_0x3e5349){if(_0x2f444c['file']&&_0x2f444c[_0x0387('0x57')][_0x0387('0x56')]){_0x2f444c[_0x0387('0x54')][_0x0387('0x6e')]=_0x2f444c['file'][_0x0387('0x56')];}return db[_0x0387('0x39')][_0x0387('0x53')]({'where':{'id':_0x2f444c['params']['id']}})[_0x0387('0x32')](handleEntityNotFound(_0xf86e9e,null))[_0x0387('0x32')](saveUpdates(_0x2f444c[_0x0387('0x54')],null))[_0x0387('0x32')](respondWithResult(_0xf86e9e,null))[_0x0387('0x26')](handleError(_0xf86e9e,null));};var utilLicense=require('../../config/license/util');exports[_0x0387('0x74')]=function(_0x482e03,_0x1d72ea,_0xebd93a){var _0x1c21fe=_0x0387('0x5b');var _0x2fa079={'custom':![]};return utilLicense['getLicense']()[_0x0387('0x32')](function(_0x3995fc){if(_0x3995fc){_0x2fa079=_0x3995fc;}return db['Setting']['find']({'where':{'id':_0x482e03[_0x0387('0x51')]['id']},'attributes':[_0x0387('0x5c'),'loginLogo',_0x0387('0x6e'),_0x0387('0x5d'),'defaultLogo',_0x0387('0x5f'),'defaultPreferred',_0x0387('0x60')],'raw':!![]});})[_0x0387('0x32')](handleEntityNotFound(_0x1d72ea,null))[_0x0387('0x32')](function(_0x2f861e){if(_0x2f861e){var _0xd53d00=_0x2f861e[_0x0387('0x6e')]&&fs[_0x0387('0x61')](path[_0x0387('0x62')](config[_0x0387('0x63')],_0x1c21fe,_[_0x0387('0x64')](_0x2f861e[_0x0387('0x6e')])))?path['join'](config[_0x0387('0x63')],_0x1c21fe,_['toLower'](_0x2f861e[_0x0387('0x6e')])):path[_0x0387('0x62')](config[_0x0387('0x63')],_0x1c21fe,_[_0x0387('0x64')]('default_preferred.png'));var _0xba73f5=_0x0387('0x66')+_[_0x0387('0x67')]('preferred');if(_0x2f861e[_0xba73f5]||!_0x2fa079[_0x0387('0x68')]||!_0x2fa079[_0x0387('0x6e')]){_0xd53d00=path['join'](config[_0x0387('0x63')],_0x1c21fe,_[_0x0387('0x64')](_0x0387('0x75')));}if(!fs[_0x0387('0x61')](_0xd53d00)){throw new db['Sequelize'][(_0x0387('0x6a'))](_[_0x0387('0x67')]('preferred')+_0x0387('0x6b'));}return _0x1d72ea[_0x0387('0x6c')](_0xd53d00);}})['catch'](handleError(_0x1d72ea,null));};exports[_0x0387('0x76')]=function(_0x334364,_0x545ce4,_0x104371){if(_0x334364[_0x0387('0x57')]&&_0x334364['file'][_0x0387('0x56')]){_0x334364[_0x0387('0x54')][_0x0387('0x5d')]=_0x334364[_0x0387('0x57')][_0x0387('0x56')];}return db[_0x0387('0x39')][_0x0387('0x53')]({'where':{'id':_0x334364[_0x0387('0x51')]['id']}})[_0x0387('0x32')](handleEntityNotFound(_0x545ce4,null))['then'](saveUpdates(_0x334364['body'],null))['then'](respondWithResult(_0x545ce4,null))[_0x0387('0x26')](handleError(_0x545ce4,null));};var utilLicense=require(_0x0387('0x18'));exports['getFavicon']=function(_0xed4d4e,_0x35d130,_0x2743a2){var _0x55d4a7=_0x0387('0x5b');var _0x483699={'custom':![]};return utilLicense['getLicense']()[_0x0387('0x32')](function(_0x5d07ec){if(_0x5d07ec){_0x483699=_0x5d07ec;}return db[_0x0387('0x39')]['find']({'where':{'id':_0xed4d4e[_0x0387('0x51')]['id']},'attributes':['logo',_0x0387('0x59'),_0x0387('0x6e'),'favicon',_0x0387('0x5e'),_0x0387('0x5f'),_0x0387('0x6f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x35d130,null))[_0x0387('0x32')](function(_0x5eca91){if(_0x5eca91){var _0x53afc4=_0x5eca91['favicon']&&fs['existsSync'](path[_0x0387('0x62')](config[_0x0387('0x63')],_0x55d4a7,_[_0x0387('0x64')](_0x5eca91[_0x0387('0x5d')])))?path[_0x0387('0x62')](config[_0x0387('0x63')],_0x55d4a7,_[_0x0387('0x64')](_0x5eca91[_0x0387('0x5d')])):path['join'](config[_0x0387('0x63')],_0x55d4a7,_['toLower']('default_favicon.ico'));var _0x5cd246=_0x0387('0x66')+_[_0x0387('0x67')]('favicon');if(_0x5eca91[_0x5cd246]||!_0x483699['custom']){_0x53afc4=path[_0x0387('0x62')](config[_0x0387('0x63')],_0x55d4a7,_[_0x0387('0x64')](_0x0387('0x77')));}if(!fs[_0x0387('0x61')](_0x53afc4)){throw new db[(_0x0387('0x69'))][(_0x0387('0x6a'))](_['upperFirst'](_0x0387('0x5d'))+_0x0387('0x6b'));}return _0x35d130['download'](_0x53afc4);}})[_0x0387('0x26')](handleError(_0x35d130,null));};exports[_0x0387('0x78')]=function(_0x56a6e1,_0x592a92){var _0x4e7cc5={'offset':moment()['utcOffset']()};_0x4e7cc5[_0x0387('0x79')]=moment()[_0x0387('0x7a')](_0x4e7cc5['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x592a92['status'](0xc8)['send'](_0x4e7cc5);};
\ No newline at end of file
index 80595f0..7e497a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0x3e74,0x175));var _0x43e7=function(_0x31c2cd,_0x5d7762){_0x31c2cd=_0x31c2cd-0x0;var _0x3bee0f=_0x3e74[_0x31c2cd];return _0x3bee0f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'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 419423f..6b20900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc813=['find','options','attributes','include','model','map','lodash','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc813,0x1e2));var _0x3c81=function(_0x43ad57,_0x463504){_0x43ad57=_0x43ad57-0x0;var _0x38c75f=_0xc813[_0x43ad57];return _0x38c75f;};'use strict';var _=require(_0x3c81('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3c81('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3c81('0x2'));var logger=require('../../config/logger')(_0x3c81('0x3'));var config=require(_0x3c81('0x4'));var jayson=require(_0x3c81('0x5'));var client=jayson['client'][_0x3c81('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a5dd6,_0x50b7f6,_0x31d7da){return new BPromise(function(_0x5f1f9f,_0x16cbb2){return client[_0x3c81('0x7')](_0x1a5dd6,_0x31d7da)[_0x3c81('0x8')](function(_0x1f6f40){logger[_0x3c81('0x9')](_0x3c81('0xa'),_0x50b7f6,_0x3c81('0xb'));logger[_0x3c81('0xc')](_0x3c81('0xd'),_0x50b7f6,_0x3c81('0xb'),JSON[_0x3c81('0xe')](_0x1f6f40));if(_0x1f6f40[_0x3c81('0xf')]){if(_0x1f6f40[_0x3c81('0xf')][_0x3c81('0x10')]===0x1f4){logger[_0x3c81('0xf')](_0x3c81('0xa'),_0x50b7f6,_0x1f6f40[_0x3c81('0xf')][_0x3c81('0x11')]);return _0x16cbb2(_0x1f6f40[_0x3c81('0xf')][_0x3c81('0x11')]);}logger[_0x3c81('0xf')](_0x3c81('0xa'),_0x50b7f6,_0x1f6f40[_0x3c81('0xf')]['message']);return _0x5f1f9f(_0x1f6f40[_0x3c81('0xf')]['message']);}else{logger[_0x3c81('0x9')](_0x3c81('0xa'),_0x50b7f6,'request\x20sent');_0x5f1f9f(_0x1f6f40[_0x3c81('0x12')][_0x3c81('0x11')]);}})[_0x3c81('0x13')](function(_0x3ece82){logger['error'](_0x3c81('0xa'),_0x50b7f6,_0x3ece82);_0x16cbb2(_0x3ece82);});});}exports[_0x3c81('0x14')]=function(_0xc576a1){var _0x5ea5a3=this;return new Promise(function(_0x26fc4b,_0x124a2f){return db[_0x3c81('0x15')][_0x3c81('0x16')]({'raw':_0xc576a1['options']?_0xc576a1['options']['raw']===undefined?!![]:![]:!![],'where':_0xc576a1[_0x3c81('0x17')]?_0xc576a1[_0x3c81('0x17')]['where']||null:null,'attributes':_0xc576a1['options']?_0xc576a1[_0x3c81('0x17')][_0x3c81('0x18')]||null:null,'include':_0xc576a1['options']?_0xc576a1['options']['include']?_['map'](_0xc576a1['options'][_0x3c81('0x19')],function(_0x20478b){return{'model':db[_0x20478b[_0x3c81('0x1a')]],'as':_0x20478b['as'],'attributes':_0x20478b[_0x3c81('0x18')],'include':_0x20478b['include']?_[_0x3c81('0x1b')](_0x20478b['include'],function(_0xdd8d5f){return{'model':db[_0xdd8d5f[_0x3c81('0x1a')]],'as':_0xdd8d5f['as'],'attributes':_0xdd8d5f['attributes'],'include':_0xdd8d5f[_0x3c81('0x19')]?_[_0x3c81('0x1b')](_0xdd8d5f[_0x3c81('0x19')],function(_0x17d086){return{'model':db[_0x17d086[_0x3c81('0x1a')]],'as':_0x17d086['as'],'attributes':_0x17d086['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e0fc1){logger[_0x3c81('0x9')](_0x3c81('0x14'),_0xc576a1);logger[_0x3c81('0xc')](_0x3c81('0x14'),_0xc576a1,JSON[_0x3c81('0xe')](_0x1e0fc1));_0x26fc4b(_0x1e0fc1);})[_0x3c81('0x13')](function(_0x3c5cce){logger['error'](_0x3c81('0x14'),_0x3c5cce[_0x3c81('0x11')],_0xc576a1);_0x124a2f(_0x5ea5a3['error'](0x1f4,_0x3c5cce[_0x3c81('0x11')]));});});};
\ No newline at end of file
+var _0x8e0a=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','options','raw','where','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x143a08,_0x67f11a){var _0x27c6e1=function(_0x200fe4){while(--_0x200fe4){_0x143a08['push'](_0x143a08['shift']());}};_0x27c6e1(++_0x67f11a);}(_0x8e0a,0xa4));var _0xa8e0=function(_0x3c7273,_0x36f762){_0x3c7273=_0x3c7273-0x0;var _0x452ee4=_0x8e0a[_0x3c7273];return _0x452ee4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa8e0('0x0'));var BPromise=require(_0xa8e0('0x1'));var rs=require(_0xa8e0('0x2'));var fs=require('fs');var Redis=require(_0xa8e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8e0('0x4'));var logger=require(_0xa8e0('0x5'))(_0xa8e0('0x6'));var config=require(_0xa8e0('0x7'));var jayson=require(_0xa8e0('0x8'));var client=jayson['client'][_0xa8e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c7eff,_0x1fb624,_0x56fe89){return new BPromise(function(_0x53bc5e,_0x53246b){return client[_0xa8e0('0xa')](_0x3c7eff,_0x56fe89)[_0xa8e0('0xb')](function(_0x2479fb){logger[_0xa8e0('0xc')](_0xa8e0('0xd'),_0x1fb624,_0xa8e0('0xe'));logger[_0xa8e0('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x1fb624,_0xa8e0('0xe'),JSON[_0xa8e0('0x10')](_0x2479fb));if(_0x2479fb[_0xa8e0('0x11')]){if(_0x2479fb['error'][_0xa8e0('0x12')]===0x1f4){logger[_0xa8e0('0x11')](_0xa8e0('0xd'),_0x1fb624,_0x2479fb[_0xa8e0('0x11')][_0xa8e0('0x13')]);return _0x53246b(_0x2479fb[_0xa8e0('0x11')][_0xa8e0('0x13')]);}logger['error'](_0xa8e0('0xd'),_0x1fb624,_0x2479fb[_0xa8e0('0x11')]['message']);return _0x53bc5e(_0x2479fb[_0xa8e0('0x11')]['message']);}else{logger[_0xa8e0('0xc')](_0xa8e0('0xd'),_0x1fb624,_0xa8e0('0xe'));_0x53bc5e(_0x2479fb['result']['message']);}})[_0xa8e0('0x14')](function(_0x35fa79){logger[_0xa8e0('0x11')](_0xa8e0('0xd'),_0x1fb624,_0x35fa79);_0x53246b(_0x35fa79);});});}exports[_0xa8e0('0x15')]=function(_0x278065){var _0x25e8a9=this;return new Promise(function(_0x2e8dc8,_0x4e20bb){return db['Setting']['find']({'raw':_0x278065[_0xa8e0('0x16')]?_0x278065[_0xa8e0('0x16')][_0xa8e0('0x17')]===undefined?!![]:![]:!![],'where':_0x278065[_0xa8e0('0x16')]?_0x278065[_0xa8e0('0x16')][_0xa8e0('0x18')]||null:null,'attributes':_0x278065[_0xa8e0('0x16')]?_0x278065['options'][_0xa8e0('0x19')]||null:null,'include':_0x278065['options']?_0x278065['options'][_0xa8e0('0x1a')]?_[_0xa8e0('0x1b')](_0x278065[_0xa8e0('0x16')][_0xa8e0('0x1a')],function(_0x1dbe78){return{'model':db[_0x1dbe78[_0xa8e0('0x1c')]],'as':_0x1dbe78['as'],'attributes':_0x1dbe78[_0xa8e0('0x19')],'include':_0x1dbe78[_0xa8e0('0x1a')]?_[_0xa8e0('0x1b')](_0x1dbe78[_0xa8e0('0x1a')],function(_0x39246c){return{'model':db[_0x39246c[_0xa8e0('0x1c')]],'as':_0x39246c['as'],'attributes':_0x39246c[_0xa8e0('0x19')],'include':_0x39246c[_0xa8e0('0x1a')]?_[_0xa8e0('0x1b')](_0x39246c['include'],function(_0x2820a0){return{'model':db[_0x2820a0[_0xa8e0('0x1c')]],'as':_0x2820a0['as'],'attributes':_0x2820a0[_0xa8e0('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa8e0('0xb')](function(_0x21deed){logger[_0xa8e0('0xc')](_0xa8e0('0x15'),_0x278065);logger['debug'](_0xa8e0('0x15'),_0x278065,JSON['stringify'](_0x21deed));_0x2e8dc8(_0x21deed);})[_0xa8e0('0x14')](function(_0x17fb1d){logger[_0xa8e0('0x11')](_0xa8e0('0x15'),_0x17fb1d[_0xa8e0('0x13')],_0x278065);_0x4e20bb(_0x25e8a9['error'](0x1f4,_0x17fb1d[_0xa8e0('0x13')]));});});};
\ No newline at end of file
index 390336f..768ff80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xe14b,0x93));var _0xbe14=function(_0x2180b1,_0x1650ba){_0x2180b1=_0x2180b1-0x0;var _0x51d4b0=_0xe14b[_0x2180b1];return _0x51d4b0;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x5135a9,_0x507851){var _0x2139c1=function(_0x28bc7b){while(--_0x28bc7b){_0x5135a9['push'](_0x5135a9['shift']());}};_0x2139c1(++_0x507851);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x7fbe[_0x34325b];return _0x3da348;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index fbf8d1b..2acafee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf56c=['name','generate','twilio','skebby','clicksend','clickatell','bandwidth','csc','infobip','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x43db86,_0x34184b){var _0x27bda2=function(_0x3f95aa){while(--_0x3f95aa){_0x43db86['push'](_0x43db86['shift']());}};_0x27bda2(++_0x34184b);}(_0xf56c,0x19e));var _0xcf56=function(_0x2d86b4,_0x4b4ff0){_0x2d86b4=_0x2d86b4-0x0;var _0x41f5ed=_0xf56c[_0x2d86b4];return _0x41f5ed;};'use strict';var Sequelize=require(_0xcf56('0x0'));var rs=require(_0xcf56('0x1'));module[_0xcf56('0x2')]={'name':{'type':Sequelize[_0xcf56('0x3')],'unique':_0xcf56('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xcf56('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcf56('0x3')],'defaultValue':function(){return rs[_0xcf56('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xcf56('0x6'),_0xcf56('0x7'),'connectel',_0xcf56('0x8'),'plivo',_0xcf56('0x9'),_0xcf56('0xa'),_0xcf56('0xb'),_0xcf56('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xcf56('0x3')]},'authId':{'type':Sequelize[_0xcf56('0x3')]},'authToken':{'type':Sequelize[_0xcf56('0x3')]},'smsMethod':{'type':Sequelize[_0xcf56('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xcf56('0x3')]},'applicationId':{'type':Sequelize[_0xcf56('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xcf56('0x3')]},'deliveryReport':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xcf56('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcf56('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcf56('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcf56('0x10')],'comment':_0xcf56('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xcf56('0xe')],'defaultValue':![],'comment':_0xcf56('0x12'),'set':function(_0x47f497){if(!_0x47f497)this[_0xcf56('0x13')](_0xcf56('0x14'),null);this[_0xcf56('0x13')](_0xcf56('0x15'),_0x47f497);}}};
\ No newline at end of file
+var _0x4efa=['infobip','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','connectel','plivo','clickatell','csc'];(function(_0x4e917e,_0x1719c4){var _0x530d1c=function(_0x2ff881){while(--_0x2ff881){_0x4e917e['push'](_0x4e917e['shift']());}};_0x530d1c(++_0x1719c4);}(_0x4efa,0x108));var _0xa4ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4efa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa4ef('0x0'));var rs=require(_0xa4ef('0x1'));module[_0xa4ef('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa4ef('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa4ef('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xa4ef('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xa4ef('0x4')],'defaultValue':function(){return rs[_0xa4ef('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa4ef('0x6'),_0xa4ef('0x7'),_0xa4ef('0x8'),'clicksend',_0xa4ef('0x9'),_0xa4ef('0xa'),'bandwidth',_0xa4ef('0xb'),_0xa4ef('0xc'),_0xa4ef('0xd'))},'accountSid':{'type':Sequelize[_0xa4ef('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa4ef('0x4')]},'smsMethod':{'type':Sequelize[_0xa4ef('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa4ef('0x4')]},'password':{'type':Sequelize[_0xa4ef('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xa4ef('0x4')]},'senderString':{'type':Sequelize[_0xa4ef('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa4ef('0xf')],'defaultValue':function(){return _0xa4ef('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4ef('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa4ef('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa4ef('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4ef('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa4ef('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa4ef('0x13'),'set':function(_0x14edf8){if(!_0x14edf8)this[_0xa4ef('0x14')](_0xa4ef('0x15'),null);this[_0xa4ef('0x14')](_0xa4ef('0x16'),_0x14edf8);}}};
\ No newline at end of file
index 99fae50..0b0e35d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xced7=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','SmsAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','priority','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','MessageUUID','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','push','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','map','SmsAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','findAll','show','params','mandatoryDispositionPause','length','includeAll','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x524c7e,_0x6c3ce){var _0xad17cf=function(_0x530208){while(--_0x530208){_0x524c7e['push'](_0x524c7e['shift']());}};_0xad17cf(++_0x6c3ce);}(_0xced7,0x80));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7ced('0x0'));var rimraf=require(_0x7ced('0x1'));var zipdir=require(_0x7ced('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ced('0x3'));var moment=require(_0x7ced('0x4'));var BPromise=require(_0x7ced('0x5'));var Mustache=require('mustache');var util=require(_0x7ced('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ced('0x7'));var fs=require('fs');var fs_extra=require(_0x7ced('0x8'));var _=require(_0x7ced('0x9'));var squel=require(_0x7ced('0xa'));var crypto=require(_0x7ced('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7ced('0xc'));var toCsv=require(_0x7ced('0xd'));var querystring=require(_0x7ced('0xe'));var Papa=require(_0x7ced('0xf'));var Redis=require(_0x7ced('0x10'));var authService=require(_0x7ced('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ced('0x12'));var logger=require(_0x7ced('0x13'))(_0x7ced('0x14'));var utils=require(_0x7ced('0x15'));var config=require(_0x7ced('0x16'));var licenseUtil=require(_0x7ced('0x17'));var db=require(_0x7ced('0x18'))['db'];config[_0x7ced('0x19')]=_[_0x7ced('0x1a')](config[_0x7ced('0x19')],{'host':_0x7ced('0x1b'),'port':0x18eb});var socket=require(_0x7ced('0x1c'))(new Redis(config[_0x7ced('0x19')]));require('./smsAccount.socket')[_0x7ced('0x1d')](socket);var jayson=require(_0x7ced('0x1e'));var client=jayson[_0x7ced('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5c08fe,_0x2eaeaa,_0x2ab6a9,_0x36de30){return new BPromise(function(_0x4b15b2,_0x1fcf22){var _0x48c27b=_0x36de30||client;return _0x48c27b[_0x7ced('0x20')](_0x5c08fe,_0x2ab6a9)[_0x7ced('0x21')](function(_0x5dfd52){logger['info'](_0x7ced('0x22'),_0x2eaeaa,'request\x20sent');logger[_0x7ced('0x23')](_0x7ced('0x24'),_0x2eaeaa,_0x7ced('0x25'),JSON[_0x7ced('0x26')](_0x5dfd52));if(_0x5dfd52[_0x7ced('0x27')]){if(_0x5dfd52[_0x7ced('0x27')][_0x7ced('0x28')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2eaeaa,_0x5dfd52[_0x7ced('0x27')][_0x7ced('0x29')]);return _0x1fcf22(_0x5dfd52[_0x7ced('0x27')]['message']);}logger['error'](_0x7ced('0x22'),_0x2eaeaa,_0x5dfd52[_0x7ced('0x27')][_0x7ced('0x29')]);return _0x4b15b2(_0x5dfd52[_0x7ced('0x27')][_0x7ced('0x29')]);}else{logger[_0x7ced('0x2a')](_0x7ced('0x22'),_0x2eaeaa,_0x7ced('0x25'));_0x4b15b2(_0x5dfd52[_0x7ced('0x2b')][_0x7ced('0x29')]);}})[_0x7ced('0x2c')](function(_0x9c3376){logger[_0x7ced('0x27')](_0x7ced('0x22'),_0x2eaeaa,_0x9c3376);_0x1fcf22(_0x9c3376);});});}function respondWithStatusCode(_0x109565,_0xa8ec1e){_0xa8ec1e=_0xa8ec1e||0xcc;return function(_0x4f2176){if(_0x4f2176){return _0x109565['sendStatus'](_0xa8ec1e);}return _0x109565[_0x7ced('0x2d')](_0xa8ec1e)[_0x7ced('0x2e')]();};}function respondWithResult(_0x3a489d,_0x350fdb){_0x350fdb=_0x350fdb||0xc8;return function(_0x9d1dce){if(_0x9d1dce){return _0x3a489d[_0x7ced('0x2d')](_0x350fdb)[_0x7ced('0x2f')](_0x9d1dce);}};}function respondWithFilteredResult(_0x33c1de,_0x216703){return function(_0x57ca2c){if(_0x57ca2c){var _0x2c7b94=typeof _0x216703['offset']==='undefined'&&typeof _0x216703[_0x7ced('0x30')]===_0x7ced('0x31');var _0x5f168d=_0x57ca2c[_0x7ced('0x32')];var _0x238c9a=_0x2c7b94?0x0:_0x216703[_0x7ced('0x33')];var _0x1b0926=_0x2c7b94?_0x57ca2c['count']:_0x216703[_0x7ced('0x33')]+_0x216703[_0x7ced('0x30')];var _0x3fe487;if(_0x1b0926>=_0x5f168d){_0x1b0926=_0x5f168d;_0x3fe487=0xc8;}else{_0x3fe487=0xce;}_0x33c1de[_0x7ced('0x2d')](_0x3fe487);return _0x33c1de[_0x7ced('0x34')](_0x7ced('0x35'),_0x238c9a+'-'+_0x1b0926+'/'+_0x5f168d)[_0x7ced('0x2f')](_0x57ca2c);}return null;};}function patchUpdates(_0x130496){return function(_0x4b6274){try{jsonpatch[_0x7ced('0x36')](_0x4b6274,_0x130496,!![]);}catch(_0xeb9851){return BPromise[_0x7ced('0x37')](_0xeb9851);}return _0x4b6274[_0x7ced('0x38')]();};}function saveUpdates(_0x3c31d6,_0x17ba7e){return function(_0x388a9a){if(_0x388a9a){return _0x388a9a[_0x7ced('0x39')](_0x3c31d6)[_0x7ced('0x21')](function(_0x463082){return _0x463082;});}return null;};}function removeEntity(_0x3c67c9,_0x532a){return function(_0x3cde3e){if(_0x3cde3e){return _0x3cde3e[_0x7ced('0x3a')]()['then'](function(){var _0x15603d=_0x3cde3e[_0x7ced('0x3b')]({'plain':!![]});var _0x23cefb=_0x7ced('0x3c');return db[_0x7ced('0x3d')][_0x7ced('0x3a')]({'where':{'type':_0x23cefb,'resourceId':_0x15603d['id']}})[_0x7ced('0x21')](function(){return _0x3cde3e;});})[_0x7ced('0x21')](function(){_0x3c67c9[_0x7ced('0x2d')](0xcc)[_0x7ced('0x2e')]();});}};}function handleEntityNotFound(_0x143a48,_0x526e1d){return function(_0x571ce4){if(!_0x571ce4){_0x143a48['sendStatus'](0x194);}return _0x571ce4;};}function handleError(_0x14e127,_0x5b2224){_0x5b2224=_0x5b2224||0x1f4;return function(_0x19b645){logger[_0x7ced('0x27')](_0x19b645['stack']);if(_0x19b645[_0x7ced('0x3e')]){delete _0x19b645[_0x7ced('0x3e')];}_0x14e127[_0x7ced('0x2d')](_0x5b2224)[_0x7ced('0x3f')](_0x19b645);};}exports['index']=function(_0x371892,_0x33a07a){var _0x533c00={'include':[{'model':db[_0x7ced('0x40')],'as':'mandatoryDispositionPause'}]},_0x47e16c={},_0x4f77fd={'count':0x0,'rows':[]};var _0x4aeb80=_[_0x7ced('0x41')](db[_0x7ced('0x42')][_0x7ced('0x43')],function(_0x4f64a8){return{'name':_0x4f64a8['fieldName'],'type':_0x4f64a8[_0x7ced('0x44')][_0x7ced('0x45')]};});_0x47e16c[_0x7ced('0x46')]=_[_0x7ced('0x41')](_0x4aeb80,'name');_0x47e16c[_0x7ced('0x47')]=_[_0x7ced('0x48')](_0x371892['query']);_0x47e16c[_0x7ced('0x49')]=_[_0x7ced('0x4a')](_0x47e16c['model'],_0x47e16c[_0x7ced('0x47')]);_0x533c00[_0x7ced('0x4b')]=_[_0x7ced('0x4a')](_0x47e16c['model'],qs[_0x7ced('0x4c')](_0x371892[_0x7ced('0x47')][_0x7ced('0x4c')]));_0x533c00[_0x7ced('0x4b')]=_0x533c00[_0x7ced('0x4b')]['length']?_0x533c00['attributes']:_0x47e16c[_0x7ced('0x46')];if(!_0x371892[_0x7ced('0x47')][_0x7ced('0x4d')](_0x7ced('0x4e'))){_0x533c00[_0x7ced('0x30')]=qs[_0x7ced('0x30')](_0x371892[_0x7ced('0x47')]['limit']);_0x533c00[_0x7ced('0x33')]=qs[_0x7ced('0x33')](_0x371892[_0x7ced('0x47')]['offset']);}_0x533c00[_0x7ced('0x4f')]=qs[_0x7ced('0x50')](_0x371892[_0x7ced('0x47')][_0x7ced('0x50')]);_0x533c00['where']=qs[_0x7ced('0x49')](_[_0x7ced('0x51')](_0x371892[_0x7ced('0x47')],_0x47e16c[_0x7ced('0x49')]),_0x4aeb80);if(_0x371892[_0x7ced('0x47')][_0x7ced('0x52')]){_0x533c00[_0x7ced('0x53')]=_[_0x7ced('0x54')](_0x533c00[_0x7ced('0x53')],{'$or':_['map'](_0x4aeb80,function(_0x1b5251){if(_0x1b5251[_0x7ced('0x44')]!=='VIRTUAL'){var _0x34fbed={};_0x34fbed[_0x1b5251[_0x7ced('0x3e')]]={'$like':'%'+_0x371892[_0x7ced('0x47')][_0x7ced('0x52')]+'%'};return _0x34fbed;}})});}_0x533c00=_[_0x7ced('0x54')]({},_0x533c00,_0x371892[_0x7ced('0x55')]);var _0x3478aa={'where':_0x533c00[_0x7ced('0x53')]};return db[_0x7ced('0x42')][_0x7ced('0x32')](_0x3478aa)[_0x7ced('0x21')](function(_0x3db7ed){_0x4f77fd[_0x7ced('0x32')]=_0x3db7ed;if(_0x371892[_0x7ced('0x47')]['includeAll']){_0x533c00['include']=[{'all':!![]}];}return db['SmsAccount'][_0x7ced('0x56')](_0x533c00);})[_0x7ced('0x21')](function(_0x2de1e8){_0x4f77fd['rows']=_0x2de1e8;return _0x4f77fd;})[_0x7ced('0x21')](respondWithFilteredResult(_0x33a07a,_0x533c00))[_0x7ced('0x2c')](handleError(_0x33a07a,null));};exports[_0x7ced('0x57')]=function(_0x292623,_0x35b9d1){var _0x4f41ae={'raw':![],'where':{'id':_0x292623[_0x7ced('0x58')]['id']},'include':[{'model':db[_0x7ced('0x40')],'as':_0x7ced('0x59')}]},_0x3045fe={};_0x3045fe[_0x7ced('0x46')]=_['keys'](db[_0x7ced('0x42')][_0x7ced('0x43')]);_0x3045fe[_0x7ced('0x47')]=_[_0x7ced('0x48')](_0x292623[_0x7ced('0x47')]);_0x3045fe[_0x7ced('0x49')]=_[_0x7ced('0x4a')](_0x3045fe['model'],_0x3045fe['query']);_0x4f41ae['attributes']=_[_0x7ced('0x4a')](_0x3045fe[_0x7ced('0x46')],qs['fields'](_0x292623[_0x7ced('0x47')][_0x7ced('0x4c')]));_0x4f41ae[_0x7ced('0x4b')]=_0x4f41ae[_0x7ced('0x4b')][_0x7ced('0x5a')]?_0x4f41ae[_0x7ced('0x4b')]:_0x3045fe[_0x7ced('0x46')];if(_0x292623['query'][_0x7ced('0x5b')]){_0x4f41ae[_0x7ced('0x5c')]=[{'all':!![]}];}_0x4f41ae=_['merge']({},_0x4f41ae,_0x292623[_0x7ced('0x55')]);return db[_0x7ced('0x42')]['find'](_0x4f41ae)[_0x7ced('0x21')](handleEntityNotFound(_0x35b9d1,null))[_0x7ced('0x21')](respondWithResult(_0x35b9d1,null))[_0x7ced('0x2c')](handleError(_0x35b9d1,null));};exports[_0x7ced('0x5d')]=function(_0x17a5d7,_0x4edf22){return db[_0x7ced('0x42')][_0x7ced('0x5d')](_0x17a5d7['body'],{})[_0x7ced('0x21')](function(_0x84841d){var _0x2375e5=_0x17a5d7['user'][_0x7ced('0x3b')]({'plain':!![]});if(!_0x2375e5)throw new Error(_0x7ced('0x5e'));if(_0x2375e5['role']===_0x7ced('0x5f')){var _0x1dfba6=_0x84841d['get']({'plain':!![]});var _0x321ccd=_0x7ced('0x3c');return db[_0x7ced('0x60')]['find']({'where':{'name':_0x321ccd,'userProfileId':_0x2375e5[_0x7ced('0x61')]},'raw':!![]})[_0x7ced('0x21')](function(_0x20ab42){if(_0x20ab42&&_0x20ab42['autoAssociation']===0x0){return db[_0x7ced('0x3d')][_0x7ced('0x5d')]({'name':_0x1dfba6[_0x7ced('0x3e')],'resourceId':_0x1dfba6['id'],'type':_0x20ab42[_0x7ced('0x3e')],'sectionId':_0x20ab42['id']},{})[_0x7ced('0x21')](function(){return _0x84841d;});}else{return _0x84841d;}})[_0x7ced('0x2c')](function(_0x2dd8e7){logger[_0x7ced('0x27')](_0x7ced('0x62'),_0x2dd8e7);throw _0x2dd8e7;});}return _0x84841d;})[_0x7ced('0x21')](respondWithResult(_0x4edf22,0xc9))[_0x7ced('0x2c')](handleError(_0x4edf22,null));};exports[_0x7ced('0x39')]=function(_0x60b715,_0x4ef768){if(_0x60b715[_0x7ced('0x63')]['id']){delete _0x60b715[_0x7ced('0x63')]['id'];}return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x60b715['params']['id']},'include':[{'model':db[_0x7ced('0x40')],'as':'mandatoryDispositionPause'}]})[_0x7ced('0x21')](handleEntityNotFound(_0x4ef768,null))[_0x7ced('0x21')](saveUpdates(_0x60b715[_0x7ced('0x63')],null))[_0x7ced('0x21')](respondWithResult(_0x4ef768,null))[_0x7ced('0x2c')](handleError(_0x4ef768,null));};exports[_0x7ced('0x3a')]=function(_0x463734,_0xfd6414){return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x463734['params']['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0xfd6414,null))[_0x7ced('0x21')](removeEntity(_0xfd6414,null))['catch'](handleError(_0xfd6414,null));};exports['describe']=function(_0x51549a,_0x3270d4){return db[_0x7ced('0x42')][_0x7ced('0x65')]()[_0x7ced('0x21')](respondWithResult(_0x3270d4,null))[_0x7ced('0x2c')](handleError(_0x3270d4,null));};exports['addDisposition']=function(_0x5832c6,_0x18d6fb,_0x30c392){if(_0x5832c6[_0x7ced('0x63')]['id']){delete _0x5832c6[_0x7ced('0x63')]['id'];}return db['SmsAccount'][_0x7ced('0x64')]({'where':{'id':_0x5832c6['params']['id']}})['then'](handleEntityNotFound(_0x18d6fb,null))['then'](function(_0x402e5e){if(_0x402e5e){_0x5832c6[_0x7ced('0x63')][_0x7ced('0x66')]=_0x402e5e['id'];return db['Disposition'][_0x7ced('0x5d')](_0x5832c6[_0x7ced('0x63')]);}})[_0x7ced('0x21')](respondWithResult(_0x18d6fb,null))['catch'](handleError(_0x18d6fb,null));};exports[_0x7ced('0x67')]=function(_0x4b8011,_0x3d41de,_0x2b7bbd){var _0x16cfca={'raw':![],'where':{}};var _0x439098={};var _0x284c07={'count':0x0,'rows':[]};return db[_0x7ced('0x42')][_0x7ced('0x68')]({'where':{'id':_0x4b8011[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x3d41de,null))['then'](function(_0x59aa32){if(_0x59aa32){_0x439098[_0x7ced('0x46')]=_[_0x7ced('0x48')](db['Disposition'][_0x7ced('0x43')]);_0x439098[_0x7ced('0x47')]=_['keys'](_0x4b8011[_0x7ced('0x47')]);_0x439098[_0x7ced('0x49')]=_[_0x7ced('0x4a')](_0x439098[_0x7ced('0x46')],_0x439098[_0x7ced('0x47')]);_0x16cfca[_0x7ced('0x4b')]=_['intersection'](_0x439098[_0x7ced('0x46')],qs[_0x7ced('0x4c')](_0x4b8011[_0x7ced('0x47')][_0x7ced('0x4c')]));_0x16cfca[_0x7ced('0x4b')]=_0x16cfca[_0x7ced('0x4b')]['length']?_0x16cfca[_0x7ced('0x4b')]:_0x439098[_0x7ced('0x46')];if(!_0x4b8011[_0x7ced('0x47')]['hasOwnProperty']('nolimit')){_0x16cfca[_0x7ced('0x30')]=qs[_0x7ced('0x30')](_0x4b8011[_0x7ced('0x47')][_0x7ced('0x30')]);_0x16cfca[_0x7ced('0x33')]=qs[_0x7ced('0x33')](_0x4b8011[_0x7ced('0x47')][_0x7ced('0x33')]);}_0x16cfca['order']=qs[_0x7ced('0x50')](_0x4b8011[_0x7ced('0x47')][_0x7ced('0x50')]);_0x16cfca[_0x7ced('0x53')]=qs['filters'](_[_0x7ced('0x51')](_0x4b8011[_0x7ced('0x47')],_0x439098[_0x7ced('0x49')]));_0x16cfca[_0x7ced('0x53')]['SmsAccountId']=_0x59aa32['id'];if(_0x4b8011[_0x7ced('0x47')][_0x7ced('0x52')]){_0x16cfca['where']=_[_0x7ced('0x54')](_0x16cfca['where'],{'$or':_[_0x7ced('0x41')](_0x16cfca['attributes'],function(_0x5e86d0){var _0xc2d7a8={};_0xc2d7a8[_0x5e86d0]={'$like':'%'+_0x4b8011[_0x7ced('0x47')][_0x7ced('0x52')]+'%'};return _0xc2d7a8;})});}_0x16cfca=_['merge']({},_0x16cfca,_0x4b8011[_0x7ced('0x55')]);return db[_0x7ced('0x69')][_0x7ced('0x32')]({'where':_0x16cfca['where']})[_0x7ced('0x21')](function(_0x50de9f){_0x284c07['count']=_0x50de9f;if(_0x4b8011['query']['includeAll']){_0x16cfca['include']=[{'all':!![]}];}return db[_0x7ced('0x69')][_0x7ced('0x56')](_0x16cfca);})['then'](function(_0x3b2834){_0x284c07[_0x7ced('0x6a')]=_0x3b2834;return _0x284c07;});}})['then'](respondWithFilteredResult(_0x3d41de,_0x16cfca))['catch'](handleError(_0x3d41de,null));};exports['removeDispositions']=function(_0x5a3e49,_0x2ece7f,_0x171b62){return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x5a3e49[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x2ece7f,null))[_0x7ced('0x21')](function(_0x30b679){if(_0x30b679){return _0x30b679[_0x7ced('0x6b')](_0x5a3e49['query']['ids']);}})[_0x7ced('0x21')](respondWithStatusCode(_0x2ece7f,null))[_0x7ced('0x2c')](handleError(_0x2ece7f,null));};exports[_0x7ced('0x6c')]=function(_0x2254f3,_0x5a7381,_0x6f4dd4){if(_0x2254f3['body']['id']){delete _0x2254f3[_0x7ced('0x63')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2254f3['params']['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x5a7381,null))[_0x7ced('0x21')](function(_0x278779){if(_0x278779){_0x2254f3[_0x7ced('0x63')][_0x7ced('0x66')]=_0x278779['id'];return db['CannedAnswer'][_0x7ced('0x5d')](_0x2254f3[_0x7ced('0x63')]);}})['then'](respondWithResult(_0x5a7381,null))[_0x7ced('0x2c')](handleError(_0x5a7381,null));};exports[_0x7ced('0x6d')]=function(_0x1c43f3,_0x5e5df8,_0x2756ff){var _0x39367c={'raw':![],'where':{}};var _0x4340e8={};var _0x2a6902={'count':0x0,'rows':[]};return db[_0x7ced('0x42')][_0x7ced('0x68')]({'where':{'id':_0x1c43f3['params']['id']}})['then'](handleEntityNotFound(_0x5e5df8,null))[_0x7ced('0x21')](function(_0x146e03){if(_0x146e03){_0x4340e8[_0x7ced('0x46')]=_[_0x7ced('0x48')](db[_0x7ced('0x6e')][_0x7ced('0x43')]);_0x4340e8[_0x7ced('0x47')]=_[_0x7ced('0x48')](_0x1c43f3['query']);_0x4340e8[_0x7ced('0x49')]=_[_0x7ced('0x4a')](_0x4340e8[_0x7ced('0x46')],_0x4340e8[_0x7ced('0x47')]);_0x39367c['attributes']=_['intersection'](_0x4340e8['model'],qs[_0x7ced('0x4c')](_0x1c43f3[_0x7ced('0x47')][_0x7ced('0x4c')]));_0x39367c[_0x7ced('0x4b')]=_0x39367c[_0x7ced('0x4b')][_0x7ced('0x5a')]?_0x39367c[_0x7ced('0x4b')]:_0x4340e8[_0x7ced('0x46')];if(!_0x1c43f3[_0x7ced('0x47')][_0x7ced('0x4d')](_0x7ced('0x4e'))){_0x39367c[_0x7ced('0x30')]=qs[_0x7ced('0x30')](_0x1c43f3[_0x7ced('0x47')][_0x7ced('0x30')]);_0x39367c[_0x7ced('0x33')]=qs['offset'](_0x1c43f3['query'][_0x7ced('0x33')]);}_0x39367c[_0x7ced('0x4f')]=qs[_0x7ced('0x50')](_0x1c43f3[_0x7ced('0x47')][_0x7ced('0x50')]);_0x39367c[_0x7ced('0x53')]=qs['filters'](_['pick'](_0x1c43f3[_0x7ced('0x47')],_0x4340e8[_0x7ced('0x49')]));_0x39367c['where'][_0x7ced('0x66')]=_0x146e03['id'];if(_0x1c43f3[_0x7ced('0x47')][_0x7ced('0x52')]){_0x39367c['where']=_[_0x7ced('0x54')](_0x39367c[_0x7ced('0x53')],{'$or':_[_0x7ced('0x41')](_0x39367c[_0x7ced('0x4b')],function(_0x33d67c){var _0x44a9d3={};_0x44a9d3[_0x33d67c]={'$like':'%'+_0x1c43f3['query'][_0x7ced('0x52')]+'%'};return _0x44a9d3;})});}_0x39367c=_[_0x7ced('0x54')]({},_0x39367c,_0x1c43f3['options']);return db[_0x7ced('0x6e')]['count']({'where':_0x39367c[_0x7ced('0x53')]})[_0x7ced('0x21')](function(_0x1d138d){_0x2a6902[_0x7ced('0x32')]=_0x1d138d;if(_0x1c43f3['query'][_0x7ced('0x5b')]){_0x39367c[_0x7ced('0x5c')]=[{'all':!![]}];}return db[_0x7ced('0x6e')]['findAll'](_0x39367c);})[_0x7ced('0x21')](function(_0x38bd76){_0x2a6902[_0x7ced('0x6a')]=_0x38bd76;return _0x2a6902;});}})['then'](respondWithFilteredResult(_0x5e5df8,_0x39367c))[_0x7ced('0x2c')](handleError(_0x5e5df8,null));};exports[_0x7ced('0x6f')]=function(_0x32bf90,_0x2ab208,_0x5134d4){return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x32bf90[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x2ab208,null))[_0x7ced('0x21')](function(_0x5dcab1){if(_0x5dcab1){return _0x5dcab1[_0x7ced('0x6f')](_0x32bf90[_0x7ced('0x47')][_0x7ced('0x70')]);}})[_0x7ced('0x21')](respondWithStatusCode(_0x2ab208,null))['catch'](handleError(_0x2ab208,null));};exports[_0x7ced('0x71')]=function(_0x566d11,_0x4c74f3,_0x10a4a9){var _0x347051={'channel':_0x7ced('0x72')};var _0x30168b=[];var _0x58800c=[];var _0x2fc18a={};return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x566d11[_0x7ced('0x58')]['id']},'include':[{'model':db[_0x7ced('0x73')],'as':_0x7ced('0x74')}]})['then'](handleEntityNotFound(_0x4c74f3,null))['then'](function(_0x1dca2f){_0x347051[_0x7ced('0x75')]=_0x1dca2f;_0x347051['applications']=_[_0x7ced('0x76')](_0x1dca2f[_0x7ced('0x74')],[_0x7ced('0x77')],['asc']);if(_0x347051['account'][_0x7ced('0x74')]){delete _0x347051[_0x7ced('0x75')][_0x7ced('0x74')];}return db[_0x7ced('0x78')][_0x7ced('0x65')]();})[_0x7ced('0x21')](function(_0x2c0826){if(!_0x2c0826){throw new db[(_0x7ced('0x79'))]['ValidationError']('no\x20available\x20attributes');}_0x30168b=_['difference'](_[_0x7ced('0x48')](_0x2c0826),['createdAt','updatedAt']);_0x58800c=_[_0x7ced('0x7a')](_[_0x7ced('0x48')](_0x2c0826),[_0x7ced('0x7b'),_0x7ced('0x7c'),_0x7ced('0x7d'),'ListId']);_0x347051[_0x7ced('0x63')]={'mapKey':_0x7ced('0x7e')};if(_0x347051[_0x7ced('0x75')]['type']){switch(_0x347051[_0x7ced('0x75')][_0x7ced('0x44')]){case _0x7ced('0x7f'):_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]=_0x566d11[_0x7ced('0x63')]['From'];_0x347051['body'][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x81')];_0x347051[_0x7ced('0x63')]['messageId']=_0x566d11[_0x7ced('0x63')][_0x7ced('0x82')];break;case _0x7ced('0x83'):_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]='+'+_0x566d11['body'][_0x7ced('0x84')];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x85')];break;case _0x7ced('0x86'):_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x80')];_0x347051['body']['body']=_0x566d11['body'][_0x7ced('0x29')];break;case _0x7ced('0x87'):_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]=_0x566d11['body'][_0x7ced('0x80')];_0x347051['body'][_0x7ced('0x63')]=_0x566d11['body'][_0x7ced('0x63')];_0x347051[_0x7ced('0x63')][_0x7ced('0x88')]=_0x566d11['body'][_0x7ced('0x89')];break;case _0x7ced('0x8a'):_0x347051['body'][_0x7ced('0x80')]=_0x566d11[_0x7ced('0x63')]['From'];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')]['Text'];_0x347051[_0x7ced('0x63')][_0x7ced('0x88')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x8b')];break;case'infobip':_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]='+'+_0x566d11[_0x7ced('0x63')][_0x7ced('0x8c')][0x0]['from'];_0x347051['body']['body']=_0x566d11[_0x7ced('0x63')][_0x7ced('0x8c')][0x0]['text'];_0x347051['body'][_0x7ced('0x88')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x8c')][0x0]['messageId'];break;case _0x7ced('0x8d'):_0x347051[_0x7ced('0x63')]['from']=_0x566d11[_0x7ced('0x63')][_0x7ced('0x8e')];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')]['segmentedMessage'][_0x7ced('0x29')];break;case _0x7ced('0x8f'):_0x347051[_0x7ced('0x63')][_0x7ced('0x80')]=_0x566d11[_0x7ced('0x63')]['fromNumber'];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x85')];_0x347051[_0x7ced('0x63')][_0x7ced('0x88')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x90')];break;case _0x7ced('0x91'):_0x347051[_0x7ced('0x63')][_0x7ced('0x88')]=_0x566d11[_0x7ced('0x63')][0x0]['message']['id'];_0x347051['body']['from']=_0x566d11[_0x7ced('0x63')][0x0][_0x7ced('0x29')][_0x7ced('0x80')];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')][0x0][_0x7ced('0x29')][_0x7ced('0x85')];break;case _0x7ced('0x92'):_0x347051[_0x7ced('0x63')]['from']=_0x566d11[_0x7ced('0x63')]['from'];_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x29')];_0x347051['body'][_0x7ced('0x88')]=_0x566d11[_0x7ced('0x63')][_0x7ced('0x93')];break;}}if(_0x347051[_0x7ced('0x63')]['id']){delete _0x347051[_0x7ced('0x63')]['id'];}if(_[_0x7ced('0x94')](_0x347051[_0x7ced('0x63')]['from'])){throw new db['Sequelize']['ValidationError'](_0x7ced('0x95'));}if(_[_0x7ced('0x94')](_0x347051[_0x7ced('0x63')]['body'])||_0x347051[_0x7ced('0x63')][_0x7ced('0x63')]===''){throw new db['Sequelize'][(_0x7ced('0x96'))](_0x7ced('0x97'));}if(_[_0x7ced('0x94')](_0x347051[_0x7ced('0x63')]['mapKey'])){throw new db[(_0x7ced('0x79'))][(_0x7ced('0x96'))](_0x7ced('0x98')+_0x58800c);}if(!_[_0x7ced('0x99')](_0x58800c,_0x347051['body']['mapKey'])){throw new db[(_0x7ced('0x79'))][(_0x7ced('0x96'))](_0x7ced('0x9a')+_0x58800c);}_0x2fc18a[_0x347051[_0x7ced('0x63')][_0x7ced('0x9b')]]=_0x347051[_0x7ced('0x63')][_0x7ced('0x80')];return db[_0x7ced('0x9c')][_0x7ced('0x64')]({'where':{'id':_0x347051[_0x7ced('0x75')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x7ced('0x9d'),'where':_0x2fc18a,'limit':0x1,'order':[[_0x7ced('0x7c'),_0x7ced('0x9e')]]}]});})['then'](handleEntityNotFound(_0x4c74f3,null))[_0x7ced('0x21')](function(_0x4e7b3f){if(_0x4e7b3f){_0x347051['list']=_[_0x7ced('0x9f')](_0x4e7b3f,[_0x7ced('0x9d')]);if(_0x4e7b3f[_0x7ced('0x9d')][_0x7ced('0x5a')]){return _0x4e7b3f['Contacts'][0x0];}var _0x48ce30=_['defaults'](_0x347051[_0x7ced('0x63')],{'firstName':_0x347051[_0x7ced('0x63')][_0x7ced('0x80')],'ListId':_0x4e7b3f['id']});_0x48ce30[_0x347051['body'][_0x7ced('0x9b')]]=_0x347051[_0x7ced('0x63')][_0x7ced('0x80')];return db[_0x7ced('0x78')][_0x7ced('0x5d')](_0x48ce30,{'fields':_0x30168b,'raw':!![]});}})[_0x7ced('0x21')](handleEntityNotFound(_0x4c74f3,null))[_0x7ced('0x21')](function(_0x5a0436){if(_0x5a0436){_0x347051[_0x7ced('0xa0')]=_0x5a0436;var _0x841c63={'ContactId':_0x5a0436['id'],'phone':_0x347051[_0x7ced('0x63')][_0x7ced('0x80')],'SmsAccountId':_0x566d11[_0x7ced('0x58')]['id']};var _0x34f7ff={'ContactId':_0x5a0436['id'],'SmsAccountId':_0x566d11[_0x7ced('0x58')]['id'],'closed':![]};return db['SmsInteraction'][_0x7ced('0x64')]({'where':_0x34f7ff})[_0x7ced('0x21')](function(_0x1698d3){if(_0x1698d3){return[_0x1698d3,![]];}return db[_0x7ced('0xa1')][_0x7ced('0x5d')](_0x841c63)[_0x7ced('0x21')](function(_0x2acd28){return[_0x2acd28,!![]];});});}})[_0x7ced('0xa2')](function(_0x139990,_0x212154){_0x347051[_0x7ced('0xa3')]=_0x139990[_0x7ced('0x3b')]({'plain':!![]});_0x347051[_0x7ced('0xa3')][_0x7ced('0xa4')]=![];if(_0x212154){if(_0x347051['account'][_0x7ced('0xa5')]){_0x347051[_0x7ced('0xa6')]['push']({'id':0x0,'priority':_0x347051['applications'][_0x7ced('0x5a')]+0x1,'app':_0x7ced('0xa7'),'appdata':_0x7ced('0xa8'),'interval':_0x7ced('0xa9')});}_0x347051[_0x7ced('0xa3')]['created']=!![];}return db[_0x7ced('0xaa')]['create']({'phone':_0x347051[_0x7ced('0x63')]['from'],'messageId':_0x347051[_0x7ced('0x63')]['messageId'],'body':_0x347051[_0x7ced('0x63')]['body'],'SmsAccountId':_0x566d11[_0x7ced('0x58')]['id'],'SmsInteractionId':_0x139990['id'],'direction':'in','ContactId':_0x139990[_0x7ced('0xab')],'AttachmentId':_0x347051[_0x7ced('0x63')]['AttachmentId']});})['then'](function(_0x2f3ac0){_0x347051[_0x7ced('0x29')]=_0x2f3ac0;if(_0x347051[_0x7ced('0xa3')][_0x7ced('0xac')]){return db[_0x7ced('0xad')][_0x7ced('0x64')]({'attributes':['id',_0x7ced('0x3e')],'where':{'id':_0x347051[_0x7ced('0xa3')][_0x7ced('0xac')]}})[_0x7ced('0x21')](function(_0x2c0f75){if(_0x2c0f75){_0x347051[_0x7ced('0xa6')][_0x7ced('0xae')]({'id':0x0,'priority':0x0,'app':_0x7ced('0xaf'),'appdata':_0x2c0f75['name']+','+(_0x347051[_0x7ced('0x75')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7ced('0xb0'),_0x7ced('0xb1'),_0x347051);});}return respondWithRpcPromise(_0x7ced('0xb0'),_0x7ced('0xb1'),_0x347051);})[_0x7ced('0x21')](function(_0xd7989d){if(_0xd7989d){var _0x436a5f=0xc8;var _0x34547e=_0x7ced('0xb2');logger[_0x7ced('0x2a')](_0x7ced('0x24'),_0x34547e,_0x436a5f,_0x7ced('0xb3'));logger[_0x7ced('0x23')](_0x7ced('0xb4'),_0x34547e,_0x436a5f,'entity\x20found',JSON[_0x7ced('0x26')](_0xd7989d));if(_0x347051[_0x7ced('0x75')][_0x7ced('0x44')]===_0x7ced('0x7f')){return _0x4c74f3['status'](_0x436a5f)['set'](_0x7ced('0xb5'),_0x7ced('0xb6'))[_0x7ced('0x3f')](_0x7ced('0xb7'));}else{return _0x4c74f3[_0x7ced('0x2d')](_0x436a5f)[_0x7ced('0x2f')](_0xd7989d);}}})[_0x7ced('0x2c')](handleError(_0x4c74f3,null));};exports[_0x7ced('0xb8')]=function(_0x5ef9f1,_0x47078d,_0x3a4c4f){return db[_0x7ced('0x42')][_0x7ced('0x68')]({'where':{'id':_0x5ef9f1[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x47078d,null))[_0x7ced('0x21')](function(_0x172bb5){if(_0x172bb5){return db[_0x7ced('0xb9')]['transaction'](function(_0x103235){return db[_0x7ced('0x73')][_0x7ced('0x3a')]({'where':{'SmsAccountId':_0x5ef9f1[_0x7ced('0x58')]['id']},'transaction':_0x103235})[_0x7ced('0x21')](function(_0x3c6edd){var _0x44cb42=_[_0x7ced('0x41')](_0x5ef9f1[_0x7ced('0x63')],function(_0x7207f2){_0x7207f2[_0x7ced('0x66')]=_0x5ef9f1[_0x7ced('0x58')]['id'];return _0x7207f2;});return db[_0x7ced('0x73')]['bulkCreate'](_0x44cb42,{'transaction':_0x103235});});})[_0x7ced('0x21')](function(){return db[_0x7ced('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x5ef9f1[_0x7ced('0x58')]['id']},'order':_0x7ced('0x77')});});}})[_0x7ced('0x21')](respondWithResult(_0x47078d,null))[_0x7ced('0x2c')](handleError(_0x47078d,null));};exports[_0x7ced('0xba')]=function(_0x59478c,_0x35b8c8,_0x503a8f){var _0x3799e1={};var _0x258a27={};var _0x1a0612;var _0x1b83ce;return db[_0x7ced('0x42')][_0x7ced('0x68')]({'where':{'id':_0x59478c[_0x7ced('0x58')]['id']}})['then'](handleEntityNotFound(_0x35b8c8,null))[_0x7ced('0x21')](function(_0xc804e9){if(_0xc804e9){_0x1a0612=_0xc804e9;_0x258a27[_0x7ced('0x46')]=_[_0x7ced('0x48')](db[_0x7ced('0x73')][_0x7ced('0x43')]);_0x258a27['query']=_[_0x7ced('0x48')](_0x59478c[_0x7ced('0x47')]);_0x258a27['filters']=_['intersection'](_0x258a27[_0x7ced('0x46')],_0x258a27[_0x7ced('0x47')]);_0x3799e1[_0x7ced('0x4b')]=_[_0x7ced('0x4a')](_0x258a27['model'],qs[_0x7ced('0x4c')](_0x59478c[_0x7ced('0x47')][_0x7ced('0x4c')]));_0x3799e1[_0x7ced('0x4b')]=_0x3799e1[_0x7ced('0x4b')][_0x7ced('0x5a')]?_0x3799e1[_0x7ced('0x4b')]:_0x258a27[_0x7ced('0x46')];_0x3799e1[_0x7ced('0x4f')]=qs[_0x7ced('0x50')](_0x59478c[_0x7ced('0x47')][_0x7ced('0x50')]);_0x3799e1[_0x7ced('0x53')]=qs[_0x7ced('0x49')](_[_0x7ced('0x51')](_0x59478c['query'],_0x258a27[_0x7ced('0x49')]));if(_0x59478c[_0x7ced('0x47')][_0x7ced('0x52')]){_0x3799e1[_0x7ced('0x53')]=_[_0x7ced('0x54')](_0x3799e1[_0x7ced('0x53')],{'$or':_[_0x7ced('0x41')](_0x3799e1[_0x7ced('0x4b')],function(_0x342d8c){var _0x4ec12d={};_0x4ec12d[_0x342d8c]={'$like':'%'+_0x59478c['query'][_0x7ced('0x52')]+'%'};return _0x4ec12d;})});}_0x3799e1=_[_0x7ced('0x54')]({},_0x3799e1,_0x59478c[_0x7ced('0x55')]);return _0x1a0612['getApplications'](_0x3799e1);}})['then'](function(_0x2e0a85){if(_0x2e0a85){_0x1b83ce=_0x2e0a85[_0x7ced('0x5a')];if(!_0x59478c[_0x7ced('0x47')]['hasOwnProperty'](_0x7ced('0x4e'))){_0x3799e1['limit']=qs[_0x7ced('0x30')](_0x59478c[_0x7ced('0x47')][_0x7ced('0x30')]);_0x3799e1[_0x7ced('0x33')]=qs[_0x7ced('0x33')](_0x59478c[_0x7ced('0x47')][_0x7ced('0x33')]);}return _0x1a0612['getApplications'](_0x3799e1);}})[_0x7ced('0x21')](function(_0x539888){if(_0x539888){return _0x539888?{'count':_0x1b83ce,'rows':_0x539888}:null;}})[_0x7ced('0x21')](respondWithResult(_0x35b8c8,null))[_0x7ced('0x2c')](handleError(_0x35b8c8,null));};exports[_0x7ced('0xbb')]=function(_0x23ba1d,_0x141e74,_0x34010f){var _0x49c765={'raw':![],'where':{}};var _0x27899d={};var _0x17b88d={'count':0x0,'rows':[]};return db[_0x7ced('0x42')][_0x7ced('0x68')]({'where':{'id':_0x23ba1d['params']['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x141e74,null))[_0x7ced('0x21')](function(_0x311112){if(_0x311112){_0x27899d[_0x7ced('0x46')]=_[_0x7ced('0x48')](db[_0x7ced('0xa1')][_0x7ced('0x43')]);_0x27899d[_0x7ced('0x47')]=_[_0x7ced('0x48')](_0x23ba1d['query']);_0x27899d['filters']=_[_0x7ced('0x4a')](_0x27899d[_0x7ced('0x46')],_0x27899d[_0x7ced('0x47')]);_0x49c765[_0x7ced('0x4b')]=_[_0x7ced('0x4a')](_0x27899d[_0x7ced('0x46')],qs[_0x7ced('0x4c')](_0x23ba1d[_0x7ced('0x47')]['fields']));_0x49c765[_0x7ced('0x4b')]=_0x49c765[_0x7ced('0x4b')][_0x7ced('0x5a')]?_0x49c765[_0x7ced('0x4b')]:_0x27899d[_0x7ced('0x46')];if(!_0x23ba1d[_0x7ced('0x47')][_0x7ced('0x4d')](_0x7ced('0x4e'))){_0x49c765[_0x7ced('0x30')]=qs[_0x7ced('0x30')](_0x23ba1d['query'][_0x7ced('0x30')]);_0x49c765[_0x7ced('0x33')]=qs['offset'](_0x23ba1d['query']['offset']);}_0x49c765[_0x7ced('0x4f')]=qs[_0x7ced('0x50')](_0x23ba1d[_0x7ced('0x47')][_0x7ced('0x50')]);_0x49c765[_0x7ced('0x53')]=qs[_0x7ced('0x49')](_['pick'](_0x23ba1d[_0x7ced('0x47')],_0x27899d[_0x7ced('0x49')]));_0x49c765[_0x7ced('0x53')]['SmsAccountId']=_0x311112['id'];if(_0x23ba1d[_0x7ced('0x47')][_0x7ced('0x52')]){_0x49c765['where']=_[_0x7ced('0x54')](_0x49c765[_0x7ced('0x53')],{'$or':_[_0x7ced('0x41')](_0x49c765[_0x7ced('0x4b')],function(_0x350fd7){var _0x590801={};_0x590801[_0x350fd7]={'$like':'%'+_0x23ba1d['query'][_0x7ced('0x52')]+'%'};return _0x590801;})});}_0x49c765=_[_0x7ced('0x54')]({},_0x49c765,_0x23ba1d[_0x7ced('0x55')]);return db['SmsInteraction']['count']({'where':_0x49c765['where']})[_0x7ced('0x21')](function(_0x4207ce){_0x17b88d[_0x7ced('0x32')]=_0x4207ce;if(_0x23ba1d[_0x7ced('0x47')]['includeAll']){_0x49c765[_0x7ced('0x5c')]=[{'model':db[_0x7ced('0x78')],'as':_0x7ced('0xbc'),'required':![]},{'model':db[_0x7ced('0xad')],'as':_0x7ced('0xbd'),'attributes':[_0x7ced('0x3e'),_0x7ced('0xbe'),'internal'],'required':![]},{'model':db[_0x7ced('0xbf')],'as':_0x7ced('0xc0'),'attributes':['id','name',_0x7ced('0xc1')],'where':_0x23ba1d[_0x7ced('0x47')][_0x7ced('0xc2')]?{'id':_0x23ba1d[_0x7ced('0x47')][_0x7ced('0xc2')]}:undefined,'required':_0x23ba1d['query'][_0x7ced('0xc2')]?!![]:![]}];}return db[_0x7ced('0xa1')]['findAll'](_0x49c765);})[_0x7ced('0x21')](function(_0x40844b){_0x17b88d[_0x7ced('0x6a')]=_0x40844b;return _0x17b88d;});}})['then'](respondWithFilteredResult(_0x141e74,_0x49c765))['catch'](handleError(_0x141e74,null));};exports[_0x7ced('0x3f')]=function(_0x45dc03,_0x70cf61,_0x21768a){var _0x3a4446,_0x4e6fd3,_0x333842;if(_['isNil'](_0x45dc03[_0x7ced('0x63')][_0x7ced('0x63')])||_0x45dc03[_0x7ced('0x63')][_0x7ced('0x63')]===''){throw new db[(_0x7ced('0x79'))][(_0x7ced('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7ced('0x94')](_0x45dc03[_0x7ced('0x63')]['to'])){throw new db[(_0x7ced('0x79'))][(_0x7ced('0x96'))](_0x7ced('0xc3'));}_0x3a4446=_0x45dc03[_0x7ced('0x63')]['to'];return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x45dc03[_0x7ced('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7ced('0x78')],'as':_0x7ced('0x9d'),'where':{'mobile':_0x3a4446},'limit':0x1,'order':[[_0x7ced('0x7c'),'DESC']]}]}]})[_0x7ced('0x21')](handleEntityNotFound(_0x70cf61,null))[_0x7ced('0x21')](function(_0x299943){if(_0x299943&&_0x299943[_0x7ced('0xc4')]){_0x4e6fd3=_0x299943[_0x7ced('0x3b')]({'plain':!![]});if(_0x4e6fd3[_0x7ced('0xc4')]&&_0x4e6fd3[_0x7ced('0xc4')][_0x7ced('0x9d')]['length']){return _0x4e6fd3[_0x7ced('0xc4')][_0x7ced('0x9d')][0x0];}return db[_0x7ced('0x78')]['create'](_[_0x7ced('0x1a')](_0x45dc03['body'],{'firstName':_0x3a4446,'mobile':_0x3a4446,'phone':_0x3a4446,'ListId':_0x4e6fd3[_0x7ced('0xc5')]}));}})[_0x7ced('0x21')](handleEntityNotFound(_0x70cf61,null))['then'](function(_0x53b8db){if(_0x53b8db){_0x333842=_0x53b8db;return db[_0x7ced('0xa1')][_0x7ced('0x64')]({'where':{'ContactId':_0x333842['id'],'closed':![],'SmsAccountId':_0x4e6fd3['id']}})[_0x7ced('0x21')](function(_0x2281a3){if(_0x2281a3){return[_0x2281a3,![]];}return db[_0x7ced('0xa1')][_0x7ced('0x5d')]({'UserId':_0x45dc03[_0x7ced('0x5f')]['id'],'ContactId':_0x333842['id'],'SmsAccountId':_0x4e6fd3['id'],'phone':_0x3a4446,'firstMsgDirection':_0x7ced('0xc6'),'Messages':[_[_0x7ced('0x54')](_0x45dc03[_0x7ced('0x63')],{'read':![],'body':_0x45dc03['body'][_0x7ced('0x63')],'phone':_0x3a4446,'SmsAccountId':_0x4e6fd3['id'],'UserId':_0x45dc03[_0x7ced('0x5f')]['id'],'ContactId':_0x333842['id']})]},{'include':[{'model':db[_0x7ced('0xaa')],'as':_0x7ced('0xc7')}]})[_0x7ced('0x21')](function(_0x2c2be9){return[_0x2c2be9,!![]];});});}})[_0x7ced('0xa2')](function(_0x1301f5,_0x45becb){if(_0x45becb){return _0x1301f5;}return db[_0x7ced('0xaa')][_0x7ced('0x5d')](_[_0x7ced('0x54')](_0x45dc03['body'],{'read':![],'body':_0x45dc03['body'][_0x7ced('0x63')],'phone':_0x3a4446,'SmsAccountId':_0x4e6fd3['id'],'SmsInteractionId':_0x1301f5['id'],'UserId':_0x45dc03[_0x7ced('0x5f')]['id'],'ContactId':_0x333842['id']}))[_0x7ced('0x21')](function(_0x3212f5){_0x1301f5[_0x7ced('0xc8')][_0x7ced('0xc7')]=[];_0x1301f5[_0x7ced('0xc8')][_0x7ced('0xc7')][_0x7ced('0xc9')](_0x3212f5[_0x7ced('0xc8')]);return _0x1301f5;});})[_0x7ced('0x21')](respondWithResult(_0x70cf61,null))[_0x7ced('0x2c')](handleError(_0x70cf61,null));};exports[_0x7ced('0x2d')]=function(_0x1fbc89,_0xa97b73,_0x22fd92){if(_0x1fbc89[_0x7ced('0x63')]['id']){delete _0x1fbc89[_0x7ced('0x63')]['id'];}var _0x59da9b,_0x372419,_0x22e65f;return db[_0x7ced('0x42')]['find']({'where':{'id':_0x1fbc89[_0x7ced('0x58')]['id']}})['then'](handleEntityNotFound(_0xa97b73,null))['then'](function(_0x5825fa){if(_0x5825fa){_0x22e65f=_0x5825fa;logger[_0x7ced('0x23')](_0x7ced('0x24'),_0x7ced('0x2d'),'received\x20delivery\x20report\x20from',_0x5825fa[_0x7ced('0x44')],util['inspect'](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));switch(_0x5825fa[_0x7ced('0x44')]){case _0x7ced('0x83'):if(_0x1fbc89['body'][_0x7ced('0xca')]&&_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x2d')]){_0x372419=_0x1fbc89['body'][_0x7ced('0x2d')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xca')]}});}break;case'connectel':if(_0x1fbc89['body'][_0x7ced('0xcb')]&&_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xcc')]){_0x372419=_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xcc')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xcb')]}});}break;case _0x7ced('0x87'):if(_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x89')]&&_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xcd')]){_0x372419=_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xcd')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x89')]}});}break;case _0x7ced('0xce'):var _0x9b02cb=_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x8c')][0x0];if(_0x9b02cb['messageId']&&_0x9b02cb[_0x7ced('0x2d')][_0x7ced('0xcf')]===_0x7ced('0xd0')){_0x372419=_0x9b02cb[_0x7ced('0x2d')][_0x7ced('0xcf')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x9b02cb['messageId']}});}break;case'clickatell':if(_0x1fbc89[_0x7ced('0x63')]['messageId']&&_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x2d')]){_0x372419=_0x1fbc89['body'][_0x7ced('0x2d')];return db[_0x7ced('0xaa')]['find']({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x88')]}});}break;case _0x7ced('0x91'):if(_0x1fbc89[_0x7ced('0x63')][0x0][_0x7ced('0x29')]['id']){_0x372419=_0x1fbc89[_0x7ced('0x63')][0x0][_0x7ced('0x44')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')][0x0][_0x7ced('0x29')]['id']}});}break;case _0x7ced('0x92'):if(_0x1fbc89[_0x7ced('0x63')][_0x7ced('0xd1')]&&_0x1fbc89['body']['status']){_0x372419=_0x1fbc89[_0x7ced('0x63')][_0x7ced('0x2d')];return db[_0x7ced('0xaa')][_0x7ced('0x64')]({'where':{'messageId':_0x1fbc89[_0x7ced('0x63')]['redif']}});}break;}}})[_0x7ced('0x21')](handleEntityNotFound(_0xa97b73,null))[_0x7ced('0x21')](function(_0x38b1fa){if(_0x38b1fa){_0x59da9b=_0x38b1fa;switch(_0x22e65f['type']){case _0x7ced('0x83'):if(_0x372419==='DELIVERED'){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7ced('0x2d'),_0x7ced('0x83'),util['inspect'](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x372419==='1'){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),_0x7ced('0x2d'),'skebby',util[_0x7ced('0xd2')](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1fbc89[_0x7ced('0x63')]['error_code']&&_0x372419>=0xc8&&_0x372419<=0xce){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),'status',_0x7ced('0x87'),util[_0x7ced('0xd2')](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;case _0x7ced('0xce'):var _0x1da259=_0x1fbc89[_0x7ced('0x63')]['results'][0x0];if(_0x1da259['status'][_0x7ced('0xcf')]==='DELIVERED'){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7ced('0x2d'),_0x7ced('0xce'),util[_0x7ced('0xd2')](_0x1fbc89['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x372419==_0x7ced('0xd3')||_0x372419==_0x7ced('0xd4')){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),'status','clickatell',util[_0x7ced('0xd2')](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x372419=='message-delivered'){return _0x59da9b[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),_0x7ced('0x2d'),_0x7ced('0x91'),util['inspect'](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x372419===_0x7ced('0xd5')||_0x372419===_0x7ced('0xd6')){return _0x59da9b['update']({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),'status','intelepeer',util[_0x7ced('0xd2')](_0x1fbc89[_0x7ced('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x59da9b;}})[_0x7ced('0x21')](respondWithResult(_0xa97b73,null))[_0x7ced('0x2c')](handleError(_0xa97b73,null));};exports[_0x7ced('0xd7')]=function(_0x1657d8,_0x5e5f60,_0xd2b4e7){var _0x3ab696,_0x579213,_0x49697b;return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x1657d8[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x5e5f60,null))['then'](function(_0x4e17ea){if(_0x4e17ea){_0x49697b=_0x4e17ea;logger[_0x7ced('0x23')](_0x7ced('0x24'),_0x7ced('0x2d'),_0x7ced('0xd8'),_0x4e17ea[_0x7ced('0x44')],util['inspect'](_0x1657d8['query'],{'showHidden':![],'depth':null}));switch(_0x4e17ea[_0x7ced('0x44')]){case'csc':if(_0x1657d8[_0x7ced('0x47')][_0x7ced('0xd9')]&&_0x1657d8['query'][_0x7ced('0xda')]){_0x579213=_0x1657d8[_0x7ced('0x47')][_0x7ced('0xda')];return db['SmsMessage'][_0x7ced('0x64')]({'where':{'messageId':_0x1657d8['query'][_0x7ced('0xd9')]}});}break;}}})[_0x7ced('0x21')](handleEntityNotFound(_0x5e5f60,null))[_0x7ced('0x21')](function(_0x1d4786){if(_0x1d4786){_0x3ab696=_0x1d4786;switch(_0x49697b[_0x7ced('0x44')]){case _0x7ced('0x8d'):if(_0x579213==='2'||_0x579213==='6'){return _0x3ab696[_0x7ced('0x39')]({'read':!![]});}else{logger[_0x7ced('0x27')](_0x7ced('0x24'),'status','csc',util[_0x7ced('0xd2')](_0x1657d8['query'],{'showHidden':![],'depth':null}));};break;}return _0x3ab696;}})['then'](respondWithResult(_0x5e5f60,null))[_0x7ced('0x2c')](handleError(_0x5e5f60,null));};exports[_0x7ced('0xdb')]=function(_0x42063c,_0x2b4382,_0x5a5c70){return db[_0x7ced('0x42')][_0x7ced('0x64')]({'where':{'id':_0x42063c[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x2b4382,null))[_0x7ced('0x21')](function(_0x508f56){if(_0x508f56){return _0x508f56[_0x7ced('0xdb')](_0x42063c[_0x7ced('0x63')][_0x7ced('0x70')],_[_0x7ced('0x9f')](_0x42063c[_0x7ced('0x63')],[_0x7ced('0x70'),'id'])||{})[_0x7ced('0xa2')](function(_0x4dfca8){for(var _0x1f0673=0x0;_0x1f0673<_0x42063c[_0x7ced('0x63')][_0x7ced('0x70')][_0x7ced('0x5a')];_0x1f0673+=0x1){socket['emit'](_0x7ced('0xdc'),{'UserId':Number(_0x42063c['body'][_0x7ced('0x70')][_0x1f0673]),'SmsAccountId':Number(_0x42063c[_0x7ced('0x58')]['id'])});}return _0x4dfca8;});}})[_0x7ced('0x21')](respondWithResult(_0x2b4382,null))[_0x7ced('0x2c')](handleError(_0x2b4382,null));};exports[_0x7ced('0xdd')]=function(_0x46cffc,_0xa1f62b,_0x1cfdaa){return db['SmsAccount'][_0x7ced('0x64')]({'where':{'id':_0x46cffc[_0x7ced('0x58')]['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0xa1f62b,null))[_0x7ced('0x21')](function(_0xca1bea){if(_0xca1bea){return _0xca1bea[_0x7ced('0xdd')](_0x46cffc[_0x7ced('0x47')][_0x7ced('0x70')])[_0x7ced('0x21')](function(){if(_[_0x7ced('0xde')](_0x46cffc[_0x7ced('0x47')]['ids'])){for(var _0x43b23d=0x0;_0x43b23d<_0x46cffc[_0x7ced('0x47')][_0x7ced('0x70')][_0x7ced('0x5a')];_0x43b23d+=0x1){socket[_0x7ced('0xdf')](_0x7ced('0xe0'),{'UserId':Number(_0x46cffc[_0x7ced('0x47')][_0x7ced('0x70')][_0x43b23d]),'SmsAccountId':Number(_0x46cffc[_0x7ced('0x58')]['id'])});}}else{socket[_0x7ced('0xdf')](_0x7ced('0xe0'),{'UserId':Number(_0x46cffc[_0x7ced('0x47')][_0x7ced('0x70')]),'SmsAccountId':Number(_0x46cffc[_0x7ced('0x58')]['id'])});}});}})[_0x7ced('0x21')](respondWithStatusCode(_0xa1f62b,null))[_0x7ced('0x2c')](handleError(_0xa1f62b,null));};exports[_0x7ced('0xe1')]=function(_0x122a25,_0x3cb835,_0x5f236b){var _0x17a1fb={};var _0x4f8d10={};var _0x447be4;var _0x14cfd9;return db[_0x7ced('0x42')]['findOne']({'where':{'id':_0x122a25['params']['id']}})[_0x7ced('0x21')](handleEntityNotFound(_0x3cb835,null))[_0x7ced('0x21')](function(_0x53c4df){if(_0x53c4df){_0x447be4=_0x53c4df;_0x4f8d10[_0x7ced('0x46')]=_['keys'](db['User'][_0x7ced('0x43')]);_0x4f8d10[_0x7ced('0x47')]=_[_0x7ced('0x48')](_0x122a25[_0x7ced('0x47')]);_0x4f8d10[_0x7ced('0x49')]=_[_0x7ced('0x4a')](_0x4f8d10[_0x7ced('0x46')],_0x4f8d10[_0x7ced('0x47')]);_0x17a1fb[_0x7ced('0x4b')]=_['intersection'](_0x4f8d10[_0x7ced('0x46')],qs['fields'](_0x122a25[_0x7ced('0x47')]['fields']));_0x17a1fb[_0x7ced('0x4b')]=_0x17a1fb['attributes'][_0x7ced('0x5a')]?_0x17a1fb[_0x7ced('0x4b')]:_0x4f8d10[_0x7ced('0x46')];_0x17a1fb['order']=qs[_0x7ced('0x50')](_0x122a25[_0x7ced('0x47')][_0x7ced('0x50')]);_0x17a1fb[_0x7ced('0x53')]=qs[_0x7ced('0x49')](_[_0x7ced('0x51')](_0x122a25[_0x7ced('0x47')],_0x4f8d10[_0x7ced('0x49')]));if(_0x122a25[_0x7ced('0x47')][_0x7ced('0x52')]){_0x17a1fb[_0x7ced('0x53')]=_[_0x7ced('0x54')](_0x17a1fb[_0x7ced('0x53')],{'$or':_['map'](_0x17a1fb[_0x7ced('0x4b')],function(_0x483862){var _0x453870={};_0x453870[_0x483862]={'$like':'%'+_0x122a25['query'][_0x7ced('0x52')]+'%'};return _0x453870;})});}_0x17a1fb=_[_0x7ced('0x54')]({},_0x17a1fb,_0x122a25[_0x7ced('0x55')]);return _0x447be4[_0x7ced('0xe1')](_0x17a1fb);}})[_0x7ced('0x21')](function(_0x19e8e9){if(_0x19e8e9){_0x14cfd9=_0x19e8e9[_0x7ced('0x5a')];if(!_0x122a25['query'][_0x7ced('0x4d')]('nolimit')){_0x17a1fb['limit']=qs['limit'](_0x122a25[_0x7ced('0x47')][_0x7ced('0x30')]);_0x17a1fb['offset']=qs['offset'](_0x122a25[_0x7ced('0x47')][_0x7ced('0x33')]);}return _0x447be4[_0x7ced('0xe1')](_0x17a1fb);}})['then'](function(_0x5c28f4){if(_0x5c28f4){return _0x5c28f4?{'count':_0x14cfd9,'rows':_0x5c28f4}:null;}})[_0x7ced('0x21')](respondWithResult(_0x3cb835,null))[_0x7ced('0x2c')](handleError(_0x3cb835,null));};
\ No newline at end of file
+var _0x474d=['notify','sms','SmsApplication','applications','orderBy','Applications','priority','asc','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','agent','startRouting','Start','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','getApplications','getInteractions','Contact','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','info','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','where','merge','map','VIRTUAL','filter','includeAll','rows','params','Pause','include','options','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','describe','addDisposition','find','SmsAccountId','create','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','findAll','removeAnswers'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x474d,0x150));var _0xd474=function(_0x1e8bec,_0x3028fe){_0x1e8bec=_0x1e8bec-0x0;var _0x4c2117=_0x474d[_0x1e8bec];return _0x4c2117;};'use strict';var emlformat=require(_0xd474('0x0'));var rimraf=require(_0xd474('0x1'));var zipdir=require(_0xd474('0x2'));var jsonpatch=require(_0xd474('0x3'));var rp=require(_0xd474('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd474('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd474('0x6'));var csv=require('to-csv');var ejs=require(_0xd474('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd474('0x8'));var crypto=require(_0xd474('0x9'));var jsforce=require(_0xd474('0xa'));var deskjs=require(_0xd474('0xb'));var toCsv=require(_0xd474('0xc'));var querystring=require(_0xd474('0xd'));var Papa=require(_0xd474('0xe'));var Redis=require(_0xd474('0xf'));var authService=require(_0xd474('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd474('0x11'));var hardwareService=require(_0xd474('0x12'));var logger=require('../../config/logger')(_0xd474('0x13'));var utils=require(_0xd474('0x14'));var config=require(_0xd474('0x15'));var licenseUtil=require(_0xd474('0x16'));var db=require(_0xd474('0x17'))['db'];config[_0xd474('0x18')]=_[_0xd474('0x19')](config[_0xd474('0x18')],{'host':_0xd474('0x1a'),'port':0x18eb});var socket=require(_0xd474('0x1b'))(new Redis(config[_0xd474('0x18')]));require('./smsAccount.socket')[_0xd474('0x1c')](socket);var jayson=require(_0xd474('0x1d'));var client=jayson['client'][_0xd474('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3afb9b,_0x33298e,_0x3ef07a,_0x58c4a0){return new BPromise(function(_0x3c2778,_0xa7aa82){var _0x4f92bb=_0x58c4a0||client;return _0x4f92bb['request'](_0x3afb9b,_0x3ef07a)['then'](function(_0x4a910e){logger[_0xd474('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x33298e,_0xd474('0x20'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33298e,_0xd474('0x20'),JSON[_0xd474('0x21')](_0x4a910e));if(_0x4a910e[_0xd474('0x22')]){if(_0x4a910e[_0xd474('0x22')][_0xd474('0x23')]===0x1f4){logger['error'](_0xd474('0x24'),_0x33298e,_0x4a910e[_0xd474('0x22')][_0xd474('0x25')]);return _0xa7aa82(_0x4a910e[_0xd474('0x22')]['message']);}logger[_0xd474('0x22')](_0xd474('0x24'),_0x33298e,_0x4a910e[_0xd474('0x22')]['message']);return _0x3c2778(_0x4a910e[_0xd474('0x22')]['message']);}else{logger[_0xd474('0x1f')](_0xd474('0x24'),_0x33298e,_0xd474('0x20'));_0x3c2778(_0x4a910e[_0xd474('0x26')][_0xd474('0x25')]);}})[_0xd474('0x27')](function(_0x271057){logger[_0xd474('0x22')](_0xd474('0x24'),_0x33298e,_0x271057);_0xa7aa82(_0x271057);});});}function respondWithStatusCode(_0x24eee3,_0x5d9c39){_0x5d9c39=_0x5d9c39||0xcc;return function(_0x752fc6){if(_0x752fc6){return _0x24eee3[_0xd474('0x28')](_0x5d9c39);}return _0x24eee3['status'](_0x5d9c39)[_0xd474('0x29')]();};}function respondWithResult(_0x3a0364,_0x585ece){_0x585ece=_0x585ece||0xc8;return function(_0x2d55d3){if(_0x2d55d3){return _0x3a0364[_0xd474('0x2a')](_0x585ece)['json'](_0x2d55d3);}};}function respondWithFilteredResult(_0x5aa760,_0x1ce177){return function(_0x4f8220){if(_0x4f8220){var _0x4b056b=typeof _0x1ce177[_0xd474('0x2b')]==='undefined'&&typeof _0x1ce177['limit']==='undefined';var _0x3069d4=_0x4f8220[_0xd474('0x2c')];var _0x12d753=_0x4b056b?0x0:_0x1ce177[_0xd474('0x2b')];var _0x1a6793=_0x4b056b?_0x4f8220['count']:_0x1ce177['offset']+_0x1ce177['limit'];var _0x5ec875;if(_0x1a6793>=_0x3069d4){_0x1a6793=_0x3069d4;_0x5ec875=0xc8;}else{_0x5ec875=0xce;}_0x5aa760[_0xd474('0x2a')](_0x5ec875);return _0x5aa760[_0xd474('0x2d')](_0xd474('0x2e'),_0x12d753+'-'+_0x1a6793+'/'+_0x3069d4)[_0xd474('0x2f')](_0x4f8220);}return null;};}function patchUpdates(_0x533e87){return function(_0x11677d){try{jsonpatch[_0xd474('0x30')](_0x11677d,_0x533e87,!![]);}catch(_0x21af26){return BPromise[_0xd474('0x31')](_0x21af26);}return _0x11677d[_0xd474('0x32')]();};}function saveUpdates(_0x1f865c,_0xce33af){return function(_0x1c399c){if(_0x1c399c){return _0x1c399c[_0xd474('0x33')](_0x1f865c)[_0xd474('0x34')](function(_0x34a15e){return _0x34a15e;});}return null;};}function removeEntity(_0x1e3be9,_0x5eaa7c){return function(_0x1cf5cd){if(_0x1cf5cd){return _0x1cf5cd[_0xd474('0x35')]()[_0xd474('0x34')](function(){var _0x5c50b7=_0x1cf5cd[_0xd474('0x36')]({'plain':!![]});var _0x47d556=_0xd474('0x37');return db[_0xd474('0x38')][_0xd474('0x35')]({'where':{'type':_0x47d556,'resourceId':_0x5c50b7['id']}})[_0xd474('0x34')](function(){return _0x1cf5cd;});})['then'](function(){_0x1e3be9[_0xd474('0x2a')](0xcc)[_0xd474('0x29')]();});}};}function handleEntityNotFound(_0x289990,_0x333f0c){return function(_0x16981a){if(!_0x16981a){_0x289990[_0xd474('0x28')](0x194);}return _0x16981a;};}function handleError(_0x3697fc,_0x2494a8){_0x2494a8=_0x2494a8||0x1f4;return function(_0x58b529){logger['error'](_0x58b529[_0xd474('0x39')]);if(_0x58b529[_0xd474('0x3a')]){delete _0x58b529[_0xd474('0x3a')];}_0x3697fc[_0xd474('0x2a')](_0x2494a8)[_0xd474('0x3b')](_0x58b529);};}exports['index']=function(_0x2e7b15,_0x55f3ec){var _0x17d90a={'include':[{'model':db['Pause'],'as':_0xd474('0x3c')}]},_0x1e2c28={},_0x173e1a={'count':0x0,'rows':[]};var _0x26a3e5=_['map'](db[_0xd474('0x3d')][_0xd474('0x3e')],function(_0x32c4da){return{'name':_0x32c4da[_0xd474('0x3f')],'type':_0x32c4da[_0xd474('0x40')]['key']};});_0x1e2c28[_0xd474('0x41')]=_['map'](_0x26a3e5,'name');_0x1e2c28[_0xd474('0x42')]=_[_0xd474('0x43')](_0x2e7b15['query']);_0x1e2c28[_0xd474('0x44')]=_['intersection'](_0x1e2c28[_0xd474('0x41')],_0x1e2c28[_0xd474('0x42')]);_0x17d90a['attributes']=_[_0xd474('0x45')](_0x1e2c28[_0xd474('0x41')],qs[_0xd474('0x46')](_0x2e7b15['query'][_0xd474('0x46')]));_0x17d90a[_0xd474('0x47')]=_0x17d90a['attributes'][_0xd474('0x48')]?_0x17d90a[_0xd474('0x47')]:_0x1e2c28[_0xd474('0x41')];if(!_0x2e7b15[_0xd474('0x42')]['hasOwnProperty'](_0xd474('0x49'))){_0x17d90a[_0xd474('0x4a')]=qs[_0xd474('0x4a')](_0x2e7b15[_0xd474('0x42')][_0xd474('0x4a')]);_0x17d90a['offset']=qs['offset'](_0x2e7b15[_0xd474('0x42')][_0xd474('0x2b')]);}_0x17d90a[_0xd474('0x4b')]=qs[_0xd474('0x4c')](_0x2e7b15[_0xd474('0x42')]['sort']);_0x17d90a['where']=qs['filters'](_[_0xd474('0x4d')](_0x2e7b15[_0xd474('0x42')],_0x1e2c28[_0xd474('0x44')]),_0x26a3e5);if(_0x2e7b15[_0xd474('0x42')]['filter']){_0x17d90a[_0xd474('0x4e')]=_[_0xd474('0x4f')](_0x17d90a[_0xd474('0x4e')],{'$or':_[_0xd474('0x50')](_0x26a3e5,function(_0x4b5984){if(_0x4b5984['type']!==_0xd474('0x51')){var _0xe31576={};_0xe31576[_0x4b5984[_0xd474('0x3a')]]={'$like':'%'+_0x2e7b15[_0xd474('0x42')][_0xd474('0x52')]+'%'};return _0xe31576;}})});}_0x17d90a=_['merge']({},_0x17d90a,_0x2e7b15['options']);var _0x1e8692={'where':_0x17d90a[_0xd474('0x4e')]};return db['SmsAccount'][_0xd474('0x2c')](_0x1e8692)[_0xd474('0x34')](function(_0x34953f){_0x173e1a[_0xd474('0x2c')]=_0x34953f;if(_0x2e7b15[_0xd474('0x42')][_0xd474('0x53')]){_0x17d90a['include']=[{'all':!![]}];}return db[_0xd474('0x3d')]['findAll'](_0x17d90a);})[_0xd474('0x34')](function(_0x2011f7){_0x173e1a[_0xd474('0x54')]=_0x2011f7;return _0x173e1a;})[_0xd474('0x34')](respondWithFilteredResult(_0x55f3ec,_0x17d90a))[_0xd474('0x27')](handleError(_0x55f3ec,null));};exports['show']=function(_0x100981,_0x50a5b9){var _0x3ee5c6={'raw':![],'where':{'id':_0x100981[_0xd474('0x55')]['id']},'include':[{'model':db[_0xd474('0x56')],'as':'mandatoryDispositionPause'}]},_0x2c13f2={};_0x2c13f2[_0xd474('0x41')]=_[_0xd474('0x43')](db[_0xd474('0x3d')][_0xd474('0x3e')]);_0x2c13f2[_0xd474('0x42')]=_['keys'](_0x100981[_0xd474('0x42')]);_0x2c13f2[_0xd474('0x44')]=_[_0xd474('0x45')](_0x2c13f2[_0xd474('0x41')],_0x2c13f2[_0xd474('0x42')]);_0x3ee5c6[_0xd474('0x47')]=_[_0xd474('0x45')](_0x2c13f2[_0xd474('0x41')],qs[_0xd474('0x46')](_0x100981[_0xd474('0x42')][_0xd474('0x46')]));_0x3ee5c6[_0xd474('0x47')]=_0x3ee5c6[_0xd474('0x47')][_0xd474('0x48')]?_0x3ee5c6[_0xd474('0x47')]:_0x2c13f2[_0xd474('0x41')];if(_0x100981[_0xd474('0x42')]['includeAll']){_0x3ee5c6[_0xd474('0x57')]=[{'all':!![]}];}_0x3ee5c6=_['merge']({},_0x3ee5c6,_0x100981[_0xd474('0x58')]);return db[_0xd474('0x3d')]['find'](_0x3ee5c6)[_0xd474('0x34')](handleEntityNotFound(_0x50a5b9,null))[_0xd474('0x34')](respondWithResult(_0x50a5b9,null))[_0xd474('0x27')](handleError(_0x50a5b9,null));};exports['create']=function(_0x1739a9,_0x5f2558){return db['SmsAccount']['create'](_0x1739a9['body'],{})[_0xd474('0x34')](function(_0x33e080){var _0x5e5903=_0x1739a9['user']['get']({'plain':!![]});if(!_0x5e5903)throw new Error(_0xd474('0x59'));if(_0x5e5903[_0xd474('0x5a')]===_0xd474('0x5b')){var _0x15ab13=_0x33e080[_0xd474('0x36')]({'plain':!![]});var _0x3cf3b6=_0xd474('0x37');return db[_0xd474('0x5c')]['find']({'where':{'name':_0x3cf3b6,'userProfileId':_0x5e5903[_0xd474('0x5d')]},'raw':!![]})['then'](function(_0x3e8763){if(_0x3e8763&&_0x3e8763['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x15ab13['name'],'resourceId':_0x15ab13['id'],'type':_0x3e8763[_0xd474('0x3a')],'sectionId':_0x3e8763['id']},{})[_0xd474('0x34')](function(){return _0x33e080;});}else{return _0x33e080;}})['catch'](function(_0x58ced2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58ced2);throw _0x58ced2;});}return _0x33e080;})[_0xd474('0x34')](respondWithResult(_0x5f2558,0xc9))[_0xd474('0x27')](handleError(_0x5f2558,null));};exports['update']=function(_0x4a6548,_0x17bbc7){if(_0x4a6548[_0xd474('0x5e')]['id']){delete _0x4a6548['body']['id'];}return db[_0xd474('0x3d')]['find']({'where':{'id':_0x4a6548['params']['id']},'include':[{'model':db[_0xd474('0x56')],'as':_0xd474('0x3c')}]})[_0xd474('0x34')](handleEntityNotFound(_0x17bbc7,null))[_0xd474('0x34')](saveUpdates(_0x4a6548[_0xd474('0x5e')],null))[_0xd474('0x34')](respondWithResult(_0x17bbc7,null))[_0xd474('0x27')](handleError(_0x17bbc7,null));};exports[_0xd474('0x35')]=function(_0x53d251,_0x4335e8){return db[_0xd474('0x3d')]['find']({'where':{'id':_0x53d251[_0xd474('0x55')]['id']}})['then'](handleEntityNotFound(_0x4335e8,null))[_0xd474('0x34')](removeEntity(_0x4335e8,null))[_0xd474('0x27')](handleError(_0x4335e8,null));};exports['describe']=function(_0x212c15,_0x17d154){return db[_0xd474('0x3d')][_0xd474('0x5f')]()[_0xd474('0x34')](respondWithResult(_0x17d154,null))[_0xd474('0x27')](handleError(_0x17d154,null));};exports[_0xd474('0x60')]=function(_0x317925,_0x291b92,_0x221c83){if(_0x317925[_0xd474('0x5e')]['id']){delete _0x317925[_0xd474('0x5e')]['id'];}return db[_0xd474('0x3d')][_0xd474('0x61')]({'where':{'id':_0x317925[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x291b92,null))[_0xd474('0x34')](function(_0x1b4527){if(_0x1b4527){_0x317925[_0xd474('0x5e')][_0xd474('0x62')]=_0x1b4527['id'];return db['Disposition'][_0xd474('0x63')](_0x317925[_0xd474('0x5e')]);}})[_0xd474('0x34')](respondWithResult(_0x291b92,null))[_0xd474('0x27')](handleError(_0x291b92,null));};exports[_0xd474('0x64')]=function(_0x1c1447,_0x11da7d,_0x50aa3f){var _0x371a05={'raw':![],'where':{}};var _0x56d1a0={};var _0x331911={'count':0x0,'rows':[]};return db[_0xd474('0x3d')][_0xd474('0x65')]({'where':{'id':_0x1c1447[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x11da7d,null))[_0xd474('0x34')](function(_0x13d91a){if(_0x13d91a){_0x56d1a0['model']=_[_0xd474('0x43')](db[_0xd474('0x66')][_0xd474('0x3e')]);_0x56d1a0[_0xd474('0x42')]=_[_0xd474('0x43')](_0x1c1447[_0xd474('0x42')]);_0x56d1a0['filters']=_['intersection'](_0x56d1a0[_0xd474('0x41')],_0x56d1a0[_0xd474('0x42')]);_0x371a05['attributes']=_[_0xd474('0x45')](_0x56d1a0[_0xd474('0x41')],qs[_0xd474('0x46')](_0x1c1447['query'][_0xd474('0x46')]));_0x371a05[_0xd474('0x47')]=_0x371a05[_0xd474('0x47')][_0xd474('0x48')]?_0x371a05[_0xd474('0x47')]:_0x56d1a0['model'];if(!_0x1c1447[_0xd474('0x42')][_0xd474('0x67')](_0xd474('0x49'))){_0x371a05['limit']=qs[_0xd474('0x4a')](_0x1c1447[_0xd474('0x42')][_0xd474('0x4a')]);_0x371a05[_0xd474('0x2b')]=qs['offset'](_0x1c1447[_0xd474('0x42')][_0xd474('0x2b')]);}_0x371a05[_0xd474('0x4b')]=qs[_0xd474('0x4c')](_0x1c1447['query'][_0xd474('0x4c')]);_0x371a05[_0xd474('0x4e')]=qs[_0xd474('0x44')](_[_0xd474('0x4d')](_0x1c1447[_0xd474('0x42')],_0x56d1a0['filters']));_0x371a05[_0xd474('0x4e')]['SmsAccountId']=_0x13d91a['id'];if(_0x1c1447[_0xd474('0x42')][_0xd474('0x52')]){_0x371a05[_0xd474('0x4e')]=_[_0xd474('0x4f')](_0x371a05[_0xd474('0x4e')],{'$or':_[_0xd474('0x50')](_0x371a05[_0xd474('0x47')],function(_0x5f4d1c){var _0x509a2c={};_0x509a2c[_0x5f4d1c]={'$like':'%'+_0x1c1447[_0xd474('0x42')][_0xd474('0x52')]+'%'};return _0x509a2c;})});}_0x371a05=_[_0xd474('0x4f')]({},_0x371a05,_0x1c1447[_0xd474('0x58')]);return db[_0xd474('0x66')][_0xd474('0x2c')]({'where':_0x371a05[_0xd474('0x4e')]})[_0xd474('0x34')](function(_0x4e1465){_0x331911[_0xd474('0x2c')]=_0x4e1465;if(_0x1c1447[_0xd474('0x42')][_0xd474('0x53')]){_0x371a05[_0xd474('0x57')]=[{'all':!![]}];}return db[_0xd474('0x66')]['findAll'](_0x371a05);})[_0xd474('0x34')](function(_0x1a1ce5){_0x331911['rows']=_0x1a1ce5;return _0x331911;});}})[_0xd474('0x34')](respondWithFilteredResult(_0x11da7d,_0x371a05))[_0xd474('0x27')](handleError(_0x11da7d,null));};exports[_0xd474('0x68')]=function(_0x2acd24,_0x5b5d3f,_0x4574b4){return db[_0xd474('0x3d')][_0xd474('0x61')]({'where':{'id':_0x2acd24[_0xd474('0x55')]['id']}})['then'](handleEntityNotFound(_0x5b5d3f,null))['then'](function(_0xd6e7c5){if(_0xd6e7c5){return _0xd6e7c5['removeDispositions'](_0x2acd24[_0xd474('0x42')][_0xd474('0x69')]);}})[_0xd474('0x34')](respondWithStatusCode(_0x5b5d3f,null))[_0xd474('0x27')](handleError(_0x5b5d3f,null));};exports[_0xd474('0x6a')]=function(_0x22753c,_0x18474c,_0x1fbf2f){if(_0x22753c[_0xd474('0x5e')]['id']){delete _0x22753c['body']['id'];}return db[_0xd474('0x3d')][_0xd474('0x61')]({'where':{'id':_0x22753c[_0xd474('0x55')]['id']}})['then'](handleEntityNotFound(_0x18474c,null))[_0xd474('0x34')](function(_0x3a2d11){if(_0x3a2d11){_0x22753c['body'][_0xd474('0x62')]=_0x3a2d11['id'];return db[_0xd474('0x6b')][_0xd474('0x63')](_0x22753c[_0xd474('0x5e')]);}})[_0xd474('0x34')](respondWithResult(_0x18474c,null))['catch'](handleError(_0x18474c,null));};exports['getAnswers']=function(_0x85397f,_0x4b4828,_0x204b07){var _0x52f475={'raw':![],'where':{}};var _0xf4d45a={};var _0x4a203a={'count':0x0,'rows':[]};return db[_0xd474('0x3d')][_0xd474('0x65')]({'where':{'id':_0x85397f['params']['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x4b4828,null))['then'](function(_0x1a7033){if(_0x1a7033){_0xf4d45a[_0xd474('0x41')]=_[_0xd474('0x43')](db[_0xd474('0x6b')][_0xd474('0x3e')]);_0xf4d45a['query']=_[_0xd474('0x43')](_0x85397f[_0xd474('0x42')]);_0xf4d45a[_0xd474('0x44')]=_['intersection'](_0xf4d45a[_0xd474('0x41')],_0xf4d45a['query']);_0x52f475[_0xd474('0x47')]=_[_0xd474('0x45')](_0xf4d45a[_0xd474('0x41')],qs[_0xd474('0x46')](_0x85397f[_0xd474('0x42')][_0xd474('0x46')]));_0x52f475['attributes']=_0x52f475['attributes'][_0xd474('0x48')]?_0x52f475[_0xd474('0x47')]:_0xf4d45a[_0xd474('0x41')];if(!_0x85397f['query'][_0xd474('0x67')](_0xd474('0x49'))){_0x52f475[_0xd474('0x4a')]=qs[_0xd474('0x4a')](_0x85397f[_0xd474('0x42')][_0xd474('0x4a')]);_0x52f475[_0xd474('0x2b')]=qs[_0xd474('0x2b')](_0x85397f['query'][_0xd474('0x2b')]);}_0x52f475[_0xd474('0x4b')]=qs['sort'](_0x85397f[_0xd474('0x42')][_0xd474('0x4c')]);_0x52f475[_0xd474('0x4e')]=qs[_0xd474('0x44')](_[_0xd474('0x4d')](_0x85397f[_0xd474('0x42')],_0xf4d45a[_0xd474('0x44')]));_0x52f475['where'][_0xd474('0x62')]=_0x1a7033['id'];if(_0x85397f[_0xd474('0x42')][_0xd474('0x52')]){_0x52f475[_0xd474('0x4e')]=_[_0xd474('0x4f')](_0x52f475[_0xd474('0x4e')],{'$or':_[_0xd474('0x50')](_0x52f475[_0xd474('0x47')],function(_0x545398){var _0x42a13e={};_0x42a13e[_0x545398]={'$like':'%'+_0x85397f[_0xd474('0x42')]['filter']+'%'};return _0x42a13e;})});}_0x52f475=_['merge']({},_0x52f475,_0x85397f[_0xd474('0x58')]);return db[_0xd474('0x6b')][_0xd474('0x2c')]({'where':_0x52f475[_0xd474('0x4e')]})[_0xd474('0x34')](function(_0x2177e0){_0x4a203a[_0xd474('0x2c')]=_0x2177e0;if(_0x85397f[_0xd474('0x42')]['includeAll']){_0x52f475[_0xd474('0x57')]=[{'all':!![]}];}return db[_0xd474('0x6b')][_0xd474('0x6c')](_0x52f475);})['then'](function(_0x2a0c38){_0x4a203a[_0xd474('0x54')]=_0x2a0c38;return _0x4a203a;});}})[_0xd474('0x34')](respondWithFilteredResult(_0x4b4828,_0x52f475))[_0xd474('0x27')](handleError(_0x4b4828,null));};exports[_0xd474('0x6d')]=function(_0x1404d4,_0x40de87,_0xde845c){return db['SmsAccount'][_0xd474('0x61')]({'where':{'id':_0x1404d4[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x40de87,null))[_0xd474('0x34')](function(_0x1f5728){if(_0x1f5728){return _0x1f5728[_0xd474('0x6d')](_0x1404d4[_0xd474('0x42')][_0xd474('0x69')]);}})['then'](respondWithStatusCode(_0x40de87,null))[_0xd474('0x27')](handleError(_0x40de87,null));};exports[_0xd474('0x6e')]=function(_0x4b69a3,_0x30be2d,_0x144355){var _0x49bf48={'channel':_0xd474('0x6f')};var _0x10dc45=[];var _0x55a33c=[];var _0x2e40ca={};return db['SmsAccount'][_0xd474('0x61')]({'where':{'id':_0x4b69a3[_0xd474('0x55')]['id']},'include':[{'model':db[_0xd474('0x70')],'as':'Applications'}]})[_0xd474('0x34')](handleEntityNotFound(_0x30be2d,null))[_0xd474('0x34')](function(_0x3ad88d){_0x49bf48['account']=_0x3ad88d;_0x49bf48[_0xd474('0x71')]=_[_0xd474('0x72')](_0x3ad88d[_0xd474('0x73')],[_0xd474('0x74')],[_0xd474('0x75')]);if(_0x49bf48['account'][_0xd474('0x73')]){delete _0x49bf48[_0xd474('0x76')][_0xd474('0x73')];}return db[_0xd474('0x77')][_0xd474('0x5f')]();})[_0xd474('0x34')](function(_0x17b7c5){if(!_0x17b7c5){throw new db['Sequelize']['ValidationError'](_0xd474('0x78'));}_0x10dc45=_[_0xd474('0x79')](_[_0xd474('0x43')](_0x17b7c5),['createdAt','updatedAt']);_0x55a33c=_[_0xd474('0x79')](_[_0xd474('0x43')](_0x17b7c5),[_0xd474('0x7a'),_0xd474('0x7b'),_0xd474('0x7c'),_0xd474('0x7d')]);_0x49bf48[_0xd474('0x5e')]={'mapKey':'mobile'};if(_0x49bf48[_0xd474('0x76')][_0xd474('0x40')]){switch(_0x49bf48[_0xd474('0x76')][_0xd474('0x40')]){case _0xd474('0x7e'):_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x80')];_0x49bf48[_0xd474('0x5e')]['body']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x81')];_0x49bf48[_0xd474('0x5e')]['messageId']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x82')];break;case _0xd474('0x83'):_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')]='+'+_0x4b69a3[_0xd474('0x5e')]['sender'];_0x49bf48['body'][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x84')];break;case _0xd474('0x85'):_0x49bf48[_0xd474('0x5e')]['from']=_0x4b69a3['body'][_0xd474('0x7f')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x25')];break;case _0xd474('0x86'):_0x49bf48['body']['from']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x7f')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')]['body'];_0x49bf48[_0xd474('0x5e')]['messageId']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x87')];break;case _0xd474('0x88'):_0x49bf48[_0xd474('0x5e')]['from']=_0x4b69a3[_0xd474('0x5e')]['From'];_0x49bf48['body'][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x89')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x8a')]=_0x4b69a3['body'][_0xd474('0x8b')];break;case _0xd474('0x8c'):_0x49bf48['body'][_0xd474('0x7f')]='+'+_0x4b69a3[_0xd474('0x5e')][_0xd474('0x8d')][0x0][_0xd474('0x7f')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')]['results'][0x0]['text'];_0x49bf48[_0xd474('0x5e')]['messageId']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x8d')][0x0]['messageId'];break;case _0xd474('0x8e'):_0x49bf48['body']['from']=_0x4b69a3[_0xd474('0x5e')]['originatingAddress'];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x8f')]['message'];break;case'clickatell':_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')]=_0x4b69a3[_0xd474('0x5e')]['fromNumber'];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3['body']['text'];_0x49bf48[_0xd474('0x5e')]['messageId']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x90')];break;case _0xd474('0x91'):_0x49bf48[_0xd474('0x5e')][_0xd474('0x8a')]=_0x4b69a3[_0xd474('0x5e')][0x0][_0xd474('0x25')]['id'];_0x49bf48['body'][_0xd474('0x7f')]=_0x4b69a3[_0xd474('0x5e')][0x0]['message'][_0xd474('0x7f')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][0x0][_0xd474('0x25')]['text'];break;case _0xd474('0x92'):_0x49bf48[_0xd474('0x5e')]['from']=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x7f')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x5e')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x25')];_0x49bf48[_0xd474('0x5e')][_0xd474('0x8a')]=_0x4b69a3[_0xd474('0x5e')][_0xd474('0x93')];break;}}if(_0x49bf48[_0xd474('0x5e')]['id']){delete _0x49bf48[_0xd474('0x5e')]['id'];}if(_[_0xd474('0x94')](_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')])){throw new db['Sequelize'][(_0xd474('0x95'))](_0xd474('0x96'));}if(_[_0xd474('0x94')](_0x49bf48[_0xd474('0x5e')]['body'])||_0x49bf48['body'][_0xd474('0x5e')]===''){throw new db[(_0xd474('0x97'))][(_0xd474('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd474('0x94')](_0x49bf48['body'][_0xd474('0x98')])){throw new db[(_0xd474('0x97'))][(_0xd474('0x95'))](_0xd474('0x99')+_0x55a33c);}if(!_[_0xd474('0x9a')](_0x55a33c,_0x49bf48['body'][_0xd474('0x98')])){throw new db['Sequelize']['ValidationError'](_0xd474('0x9b')+_0x55a33c);}_0x2e40ca[_0x49bf48[_0xd474('0x5e')][_0xd474('0x98')]]=_0x49bf48['body'][_0xd474('0x7f')];return db[_0xd474('0x9c')][_0xd474('0x61')]({'where':{'id':_0x49bf48['account']['ListId']},'include':[{'model':db[_0xd474('0x77')],'as':_0xd474('0x9d'),'where':_0x2e40ca,'limit':0x1,'order':[[_0xd474('0x7b'),_0xd474('0x9e')]]}]});})[_0xd474('0x34')](handleEntityNotFound(_0x30be2d,null))[_0xd474('0x34')](function(_0x39e32b){if(_0x39e32b){_0x49bf48[_0xd474('0x9f')]=_[_0xd474('0xa0')](_0x39e32b,[_0xd474('0x9d')]);if(_0x39e32b[_0xd474('0x9d')][_0xd474('0x48')]){return _0x39e32b[_0xd474('0x9d')][0x0];}var _0x4e4643=_[_0xd474('0x19')](_0x49bf48[_0xd474('0x5e')],{'firstName':_0x49bf48['body'][_0xd474('0x7f')],'ListId':_0x39e32b['id']});_0x4e4643[_0x49bf48[_0xd474('0x5e')]['mapKey']]=_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')];return db['CmContact'][_0xd474('0x63')](_0x4e4643,{'fields':_0x10dc45,'raw':!![]});}})['then'](handleEntityNotFound(_0x30be2d,null))['then'](function(_0x91d3c7){if(_0x91d3c7){_0x49bf48[_0xd474('0xa1')]=_0x91d3c7;var _0x4748df={'ContactId':_0x91d3c7['id'],'phone':_0x49bf48[_0xd474('0x5e')]['from'],'SmsAccountId':_0x4b69a3[_0xd474('0x55')]['id']};var _0x501897={'ContactId':_0x91d3c7['id'],'SmsAccountId':_0x4b69a3[_0xd474('0x55')]['id'],'closed':![]};return db[_0xd474('0xa2')][_0xd474('0x61')]({'where':_0x501897})[_0xd474('0x34')](function(_0x5e3787){if(_0x5e3787){return[_0x5e3787,![]];}return db[_0xd474('0xa2')]['create'](_0x4748df)[_0xd474('0x34')](function(_0x4de02f){return[_0x4de02f,!![]];});});}})[_0xd474('0xa3')](function(_0x2d0e9a,_0x2bdfa9){_0x49bf48[_0xd474('0xa4')]=_0x2d0e9a[_0xd474('0x36')]({'plain':!![]});_0x49bf48[_0xd474('0xa4')][_0xd474('0xa5')]=![];if(_0x2bdfa9){if(_0x49bf48[_0xd474('0x76')][_0xd474('0xa6')]){_0x49bf48[_0xd474('0x71')][_0xd474('0xa7')]({'id':0x0,'priority':_0x49bf48[_0xd474('0x71')][_0xd474('0x48')]+0x1,'app':_0xd474('0xa8'),'appdata':_0xd474('0xa9'),'interval':_0xd474('0xaa')});}_0x49bf48[_0xd474('0xa4')][_0xd474('0xa5')]=!![];}return db['SmsMessage'][_0xd474('0x63')]({'phone':_0x49bf48[_0xd474('0x5e')][_0xd474('0x7f')],'messageId':_0x49bf48[_0xd474('0x5e')][_0xd474('0x8a')],'body':_0x49bf48[_0xd474('0x5e')]['body'],'SmsAccountId':_0x4b69a3[_0xd474('0x55')]['id'],'SmsInteractionId':_0x2d0e9a['id'],'direction':'in','ContactId':_0x2d0e9a[_0xd474('0xab')],'AttachmentId':_0x49bf48[_0xd474('0x5e')][_0xd474('0xac')]});})[_0xd474('0x34')](function(_0x4cdf0a){_0x49bf48['message']=_0x4cdf0a;if(_0x49bf48[_0xd474('0xa4')][_0xd474('0xad')]){return db[_0xd474('0xae')]['find']({'attributes':['id',_0xd474('0x3a')],'where':{'id':_0x49bf48[_0xd474('0xa4')][_0xd474('0xad')]}})[_0xd474('0x34')](function(_0x313e9e){if(_0x313e9e){_0x49bf48['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd474('0xaf'),'appdata':_0x313e9e[_0xd474('0x3a')]+','+(_0x49bf48[_0xd474('0x76')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xd474('0xb0'),_0x49bf48);});}return respondWithRpcPromise(_0xd474('0xb1'),_0xd474('0xb0'),_0x49bf48);})['then'](function(_0x11e8c3){if(_0x11e8c3){var _0x5ea4c8=0xc8;var _0x3e7dd1='receiveMessage';logger['info'](_0xd474('0xb2'),_0x3e7dd1,_0x5ea4c8,_0xd474('0xb3'));logger[_0xd474('0xb4')](_0xd474('0xb5'),_0x3e7dd1,_0x5ea4c8,'entity\x20found',JSON['stringify'](_0x11e8c3));if(_0x49bf48[_0xd474('0x76')][_0xd474('0x40')]==='twilio'){return _0x30be2d['status'](_0x5ea4c8)['set']('Content-Type',_0xd474('0xb6'))[_0xd474('0x3b')](_0xd474('0xb7'));}else{return _0x30be2d['status'](_0x5ea4c8)[_0xd474('0x2f')](_0x11e8c3);}}})[_0xd474('0x27')](handleError(_0x30be2d,null));};exports[_0xd474('0xb8')]=function(_0x1adabe,_0x2de533,_0xdd2904){return db[_0xd474('0x3d')][_0xd474('0x65')]({'where':{'id':_0x1adabe['params']['id']}})['then'](handleEntityNotFound(_0x2de533,null))[_0xd474('0x34')](function(_0x5bbfd8){if(_0x5bbfd8){return db[_0xd474('0xb9')][_0xd474('0xba')](function(_0x21c333){return db[_0xd474('0x70')][_0xd474('0x35')]({'where':{'SmsAccountId':_0x1adabe['params']['id']},'transaction':_0x21c333})[_0xd474('0x34')](function(_0x5a2dc2){var _0x3db24f=_[_0xd474('0x50')](_0x1adabe['body'],function(_0x73a48d){_0x73a48d[_0xd474('0x62')]=_0x1adabe['params']['id'];return _0x73a48d;});return db['SmsApplication']['bulkCreate'](_0x3db24f,{'transaction':_0x21c333});});})[_0xd474('0x34')](function(){return db[_0xd474('0x70')]['findAndCountAll']({'where':{'SmsAccountId':_0x1adabe['params']['id']},'order':_0xd474('0x74')});});}})['then'](respondWithResult(_0x2de533,null))[_0xd474('0x27')](handleError(_0x2de533,null));};exports['getApplications']=function(_0x532922,_0x51b4d8,_0x3e5091){var _0x4be1e9={};var _0x33cd01={};var _0x4feda9;var _0x152dc3;return db[_0xd474('0x3d')][_0xd474('0x65')]({'where':{'id':_0x532922[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x51b4d8,null))[_0xd474('0x34')](function(_0x5309e9){if(_0x5309e9){_0x4feda9=_0x5309e9;_0x33cd01['model']=_[_0xd474('0x43')](db[_0xd474('0x70')][_0xd474('0x3e')]);_0x33cd01[_0xd474('0x42')]=_[_0xd474('0x43')](_0x532922['query']);_0x33cd01[_0xd474('0x44')]=_[_0xd474('0x45')](_0x33cd01['model'],_0x33cd01[_0xd474('0x42')]);_0x4be1e9['attributes']=_[_0xd474('0x45')](_0x33cd01[_0xd474('0x41')],qs[_0xd474('0x46')](_0x532922[_0xd474('0x42')][_0xd474('0x46')]));_0x4be1e9[_0xd474('0x47')]=_0x4be1e9['attributes']['length']?_0x4be1e9[_0xd474('0x47')]:_0x33cd01[_0xd474('0x41')];_0x4be1e9[_0xd474('0x4b')]=qs[_0xd474('0x4c')](_0x532922[_0xd474('0x42')][_0xd474('0x4c')]);_0x4be1e9[_0xd474('0x4e')]=qs[_0xd474('0x44')](_['pick'](_0x532922[_0xd474('0x42')],_0x33cd01['filters']));if(_0x532922['query'][_0xd474('0x52')]){_0x4be1e9[_0xd474('0x4e')]=_['merge'](_0x4be1e9[_0xd474('0x4e')],{'$or':_['map'](_0x4be1e9['attributes'],function(_0x3147c1){var _0x4dfb6e={};_0x4dfb6e[_0x3147c1]={'$like':'%'+_0x532922['query'][_0xd474('0x52')]+'%'};return _0x4dfb6e;})});}_0x4be1e9=_[_0xd474('0x4f')]({},_0x4be1e9,_0x532922[_0xd474('0x58')]);return _0x4feda9[_0xd474('0xbb')](_0x4be1e9);}})[_0xd474('0x34')](function(_0xe6a76a){if(_0xe6a76a){_0x152dc3=_0xe6a76a[_0xd474('0x48')];if(!_0x532922['query'][_0xd474('0x67')](_0xd474('0x49'))){_0x4be1e9[_0xd474('0x4a')]=qs[_0xd474('0x4a')](_0x532922[_0xd474('0x42')]['limit']);_0x4be1e9[_0xd474('0x2b')]=qs[_0xd474('0x2b')](_0x532922[_0xd474('0x42')][_0xd474('0x2b')]);}return _0x4feda9['getApplications'](_0x4be1e9);}})[_0xd474('0x34')](function(_0x2e3fdd){if(_0x2e3fdd){return _0x2e3fdd?{'count':_0x152dc3,'rows':_0x2e3fdd}:null;}})['then'](respondWithResult(_0x51b4d8,null))['catch'](handleError(_0x51b4d8,null));};exports[_0xd474('0xbc')]=function(_0x2453d1,_0x123fc7,_0x351a38){var _0x329109={'raw':![],'where':{}};var _0x20b5c2={};var _0x216ac3={'count':0x0,'rows':[]};return db[_0xd474('0x3d')]['findOne']({'where':{'id':_0x2453d1[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x123fc7,null))[_0xd474('0x34')](function(_0x12a3c0){if(_0x12a3c0){_0x20b5c2[_0xd474('0x41')]=_[_0xd474('0x43')](db[_0xd474('0xa2')][_0xd474('0x3e')]);_0x20b5c2[_0xd474('0x42')]=_[_0xd474('0x43')](_0x2453d1[_0xd474('0x42')]);_0x20b5c2['filters']=_[_0xd474('0x45')](_0x20b5c2[_0xd474('0x41')],_0x20b5c2[_0xd474('0x42')]);_0x329109[_0xd474('0x47')]=_[_0xd474('0x45')](_0x20b5c2[_0xd474('0x41')],qs['fields'](_0x2453d1[_0xd474('0x42')][_0xd474('0x46')]));_0x329109[_0xd474('0x47')]=_0x329109[_0xd474('0x47')][_0xd474('0x48')]?_0x329109[_0xd474('0x47')]:_0x20b5c2[_0xd474('0x41')];if(!_0x2453d1[_0xd474('0x42')]['hasOwnProperty']('nolimit')){_0x329109[_0xd474('0x4a')]=qs[_0xd474('0x4a')](_0x2453d1[_0xd474('0x42')][_0xd474('0x4a')]);_0x329109['offset']=qs['offset'](_0x2453d1[_0xd474('0x42')][_0xd474('0x2b')]);}_0x329109[_0xd474('0x4b')]=qs[_0xd474('0x4c')](_0x2453d1['query'][_0xd474('0x4c')]);_0x329109[_0xd474('0x4e')]=qs[_0xd474('0x44')](_[_0xd474('0x4d')](_0x2453d1['query'],_0x20b5c2[_0xd474('0x44')]));_0x329109[_0xd474('0x4e')][_0xd474('0x62')]=_0x12a3c0['id'];if(_0x2453d1[_0xd474('0x42')][_0xd474('0x52')]){_0x329109[_0xd474('0x4e')]=_[_0xd474('0x4f')](_0x329109[_0xd474('0x4e')],{'$or':_[_0xd474('0x50')](_0x329109['attributes'],function(_0x3eb67a){var _0x10e9ad={};_0x10e9ad[_0x3eb67a]={'$like':'%'+_0x2453d1[_0xd474('0x42')][_0xd474('0x52')]+'%'};return _0x10e9ad;})});}_0x329109=_[_0xd474('0x4f')]({},_0x329109,_0x2453d1[_0xd474('0x58')]);return db[_0xd474('0xa2')][_0xd474('0x2c')]({'where':_0x329109['where']})[_0xd474('0x34')](function(_0x58399b){_0x216ac3['count']=_0x58399b;if(_0x2453d1[_0xd474('0x42')][_0xd474('0x53')]){_0x329109[_0xd474('0x57')]=[{'model':db[_0xd474('0x77')],'as':_0xd474('0xbd'),'required':![]},{'model':db[_0xd474('0xae')],'as':'Owner','attributes':['name','fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xd474('0xbe'),'attributes':['id',_0xd474('0x3a'),_0xd474('0xbf')],'where':_0x2453d1[_0xd474('0x42')]['tag']?{'id':_0x2453d1[_0xd474('0x42')][_0xd474('0xc0')]}:undefined,'required':_0x2453d1[_0xd474('0x42')][_0xd474('0xc0')]?!![]:![]}];}return db[_0xd474('0xa2')]['findAll'](_0x329109);})[_0xd474('0x34')](function(_0x487070){_0x216ac3[_0xd474('0x54')]=_0x487070;return _0x216ac3;});}})[_0xd474('0x34')](respondWithFilteredResult(_0x123fc7,_0x329109))[_0xd474('0x27')](handleError(_0x123fc7,null));};exports['send']=function(_0x21a10b,_0x102dbe,_0x18e4f7){var _0x1754a8,_0x211e00,_0x196c88;if(_[_0xd474('0x94')](_0x21a10b[_0xd474('0x5e')]['body'])||_0x21a10b['body'][_0xd474('0x5e')]===''){throw new db[(_0xd474('0x97'))][(_0xd474('0x95'))](_0xd474('0xc1'));}if(_[_0xd474('0x94')](_0x21a10b[_0xd474('0x5e')]['to'])){throw new db[(_0xd474('0x97'))]['ValidationError'](_0xd474('0xc2'));}_0x1754a8=_0x21a10b[_0xd474('0x5e')]['to'];return db[_0xd474('0x3d')]['find']({'where':{'id':_0x21a10b[_0xd474('0x55')]['id']},'include':[{'model':db[_0xd474('0x9c')],'as':_0xd474('0xc3'),'include':[{'model':db[_0xd474('0x77')],'as':'Contacts','where':{'mobile':_0x1754a8},'limit':0x1,'order':[[_0xd474('0x7b'),_0xd474('0x9e')]]}]}]})[_0xd474('0x34')](handleEntityNotFound(_0x102dbe,null))['then'](function(_0x3aa257){if(_0x3aa257&&_0x3aa257[_0xd474('0xc3')]){_0x211e00=_0x3aa257[_0xd474('0x36')]({'plain':!![]});if(_0x211e00[_0xd474('0xc3')]&&_0x211e00[_0xd474('0xc3')]['Contacts'][_0xd474('0x48')]){return _0x211e00[_0xd474('0xc3')][_0xd474('0x9d')][0x0];}return db[_0xd474('0x77')][_0xd474('0x63')](_['defaults'](_0x21a10b[_0xd474('0x5e')],{'firstName':_0x1754a8,'mobile':_0x1754a8,'phone':_0x1754a8,'ListId':_0x211e00[_0xd474('0x7d')]}));}})[_0xd474('0x34')](handleEntityNotFound(_0x102dbe,null))[_0xd474('0x34')](function(_0x383871){if(_0x383871){_0x196c88=_0x383871;return db[_0xd474('0xa2')][_0xd474('0x61')]({'where':{'ContactId':_0x196c88['id'],'closed':![],'SmsAccountId':_0x211e00['id']}})['then'](function(_0x294c0e){if(_0x294c0e){return[_0x294c0e,![]];}return db[_0xd474('0xa2')][_0xd474('0x63')]({'UserId':_0x21a10b[_0xd474('0x5b')]['id'],'ContactId':_0x196c88['id'],'SmsAccountId':_0x211e00['id'],'phone':_0x1754a8,'firstMsgDirection':'out','Messages':[_['merge'](_0x21a10b['body'],{'read':![],'body':_0x21a10b[_0xd474('0x5e')]['body'],'phone':_0x1754a8,'SmsAccountId':_0x211e00['id'],'UserId':_0x21a10b['user']['id'],'ContactId':_0x196c88['id']})]},{'include':[{'model':db[_0xd474('0xc4')],'as':'Messages'}]})[_0xd474('0x34')](function(_0x353503){return[_0x353503,!![]];});});}})[_0xd474('0xa3')](function(_0x327598,_0x1de77d){if(_0x1de77d){return _0x327598;}return db[_0xd474('0xc4')][_0xd474('0x63')](_[_0xd474('0x4f')](_0x21a10b['body'],{'read':![],'body':_0x21a10b[_0xd474('0x5e')][_0xd474('0x5e')],'phone':_0x1754a8,'SmsAccountId':_0x211e00['id'],'SmsInteractionId':_0x327598['id'],'UserId':_0x21a10b[_0xd474('0x5b')]['id'],'ContactId':_0x196c88['id']}))[_0xd474('0x34')](function(_0x5db1b1){_0x327598['dataValues']['Messages']=[];_0x327598['dataValues'][_0xd474('0xc5')][_0xd474('0xa7')](_0x5db1b1[_0xd474('0xc6')]);return _0x327598;});})[_0xd474('0x34')](respondWithResult(_0x102dbe,null))['catch'](handleError(_0x102dbe,null));};exports[_0xd474('0x2a')]=function(_0x5a198f,_0x598ec9,_0x180933){if(_0x5a198f[_0xd474('0x5e')]['id']){delete _0x5a198f[_0xd474('0x5e')]['id'];}var _0x25ed19,_0x56a54e,_0x2bbaf0;return db['SmsAccount'][_0xd474('0x61')]({'where':{'id':_0x5a198f[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x598ec9,null))['then'](function(_0x1e3019){if(_0x1e3019){_0x2bbaf0=_0x1e3019;logger[_0xd474('0xb4')](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0xc7'),_0x1e3019[_0xd474('0x40')],util['inspect'](_0x5a198f['body'],{'showHidden':![],'depth':null}));switch(_0x1e3019['type']){case'skebby':if(_0x5a198f['body'][_0xd474('0xc8')]&&_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')]){_0x56a54e=_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')];return db[_0xd474('0xc4')][_0xd474('0x61')]({'where':{'messageId':_0x5a198f[_0xd474('0x5e')][_0xd474('0xc8')]}});}break;case _0xd474('0x85'):if(_0x5a198f[_0xd474('0x5e')]['requestid']&&_0x5a198f['body']['statusInt']){_0x56a54e=_0x5a198f[_0xd474('0x5e')][_0xd474('0xc9')];return db[_0xd474('0xc4')][_0xd474('0x61')]({'where':{'messageId':_0x5a198f['body'][_0xd474('0xca')]}});}break;case _0xd474('0x86'):if(_0x5a198f[_0xd474('0x5e')]['message_id']&&_0x5a198f[_0xd474('0x5e')][_0xd474('0xcb')]){_0x56a54e=_0x5a198f[_0xd474('0x5e')][_0xd474('0xcb')];return db[_0xd474('0xc4')]['find']({'where':{'messageId':_0x5a198f[_0xd474('0x5e')][_0xd474('0x87')]}});}break;case _0xd474('0x8c'):var _0x5c04c8=_0x5a198f['body'][_0xd474('0x8d')][0x0];if(_0x5c04c8['messageId']&&_0x5c04c8['status'][_0xd474('0xcc')]===_0xd474('0xcd')){_0x56a54e=_0x5c04c8[_0xd474('0x2a')]['groupName'];return db['SmsMessage'][_0xd474('0x61')]({'where':{'messageId':_0x5c04c8['messageId']}});}break;case _0xd474('0xce'):if(_0x5a198f[_0xd474('0x5e')]['messageId']&&_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')]){_0x56a54e=_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')];return db[_0xd474('0xc4')][_0xd474('0x61')]({'where':{'messageId':_0x5a198f[_0xd474('0x5e')][_0xd474('0x8a')]}});}break;case'bandwidth':if(_0x5a198f[_0xd474('0x5e')][0x0][_0xd474('0x25')]['id']){_0x56a54e=_0x5a198f[_0xd474('0x5e')][0x0][_0xd474('0x40')];return db['SmsMessage']['find']({'where':{'messageId':_0x5a198f[_0xd474('0x5e')][0x0]['message']['id']}});}break;case _0xd474('0x92'):if(_0x5a198f[_0xd474('0x5e')][_0xd474('0xcf')]&&_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')]){_0x56a54e=_0x5a198f[_0xd474('0x5e')][_0xd474('0x2a')];return db[_0xd474('0xc4')][_0xd474('0x61')]({'where':{'messageId':_0x5a198f[_0xd474('0x5e')][_0xd474('0xcf')]}});}break;}}})['then'](handleEntityNotFound(_0x598ec9,null))[_0xd474('0x34')](function(_0x2fab8f){if(_0x2fab8f){_0x25ed19=_0x2fab8f;switch(_0x2bbaf0[_0xd474('0x40')]){case _0xd474('0x83'):if(_0x56a54e===_0xd474('0xcd')){return _0x25ed19[_0xd474('0x33')]({'read':!![]});}else{logger['error'](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0x83'),util[_0xd474('0xd0')](_0x5a198f[_0xd474('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x56a54e==='1'){return _0x25ed19[_0xd474('0x33')]({'read':!![]});}else{logger[_0xd474('0x22')](_0xd474('0xb2'),'status',_0xd474('0x83'),util['inspect'](_0x5a198f['body'],{'showHidden':![],'depth':null}));}break;case _0xd474('0x86'):if(!_0x5a198f[_0xd474('0x5e')]['error_code']&&_0x56a54e>=0xc8&&_0x56a54e<=0xce){return _0x25ed19[_0xd474('0x33')]({'read':!![]});}else{logger['error'](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0x86'),util[_0xd474('0xd0')](_0x5a198f[_0xd474('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd474('0x8c'):var _0x3d4a99=_0x5a198f[_0xd474('0x5e')][_0xd474('0x8d')][0x0];if(_0x3d4a99['status'][_0xd474('0xcc')]===_0xd474('0xcd')){return _0x25ed19[_0xd474('0x33')]({'read':!![]});}else{logger['error'](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0x8c'),util[_0xd474('0xd0')](_0x5a198f[_0xd474('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd474('0xce'):if(_0x56a54e==_0xd474('0xd1')||_0x56a54e==_0xd474('0xd2')){return _0x25ed19[_0xd474('0x33')]({'read':!![]});}else{logger[_0xd474('0x22')](_0xd474('0xb2'),'status',_0xd474('0xce'),util['inspect'](_0x5a198f['body'],{'showHidden':![],'depth':null}));}break;case _0xd474('0x91'):if(_0x56a54e==_0xd474('0xd3')){return _0x25ed19['update']({'read':!![]});}else{logger[_0xd474('0x22')](_0xd474('0xb2'),'status','bandwidth',util[_0xd474('0xd0')](_0x5a198f[_0xd474('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd474('0x92'):if(_0x56a54e==='DELIVRD'||_0x56a54e===_0xd474('0xd4')){return _0x25ed19['update']({'read':!![]});}else{logger[_0xd474('0x22')](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0x92'),util[_0xd474('0xd0')](_0x5a198f[_0xd474('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x25ed19;}})['then'](respondWithResult(_0x598ec9,null))[_0xd474('0x27')](handleError(_0x598ec9,null));};exports[_0xd474('0xd5')]=function(_0x14c078,_0x47d317,_0x3e6324){var _0x44e45b,_0x3c58f3,_0x305fbf;return db[_0xd474('0x3d')]['find']({'where':{'id':_0x14c078[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x47d317,null))['then'](function(_0x507e98){if(_0x507e98){_0x305fbf=_0x507e98;logger[_0xd474('0xb4')](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0xc7'),_0x507e98[_0xd474('0x40')],util[_0xd474('0xd0')](_0x14c078[_0xd474('0x42')],{'showHidden':![],'depth':null}));switch(_0x507e98[_0xd474('0x40')]){case'csc':if(_0x14c078[_0xd474('0x42')][_0xd474('0xd6')]&&_0x14c078['query']['state']){_0x3c58f3=_0x14c078[_0xd474('0x42')][_0xd474('0xd7')];return db[_0xd474('0xc4')][_0xd474('0x61')]({'where':{'messageId':_0x14c078['query'][_0xd474('0xd6')]}});}break;}}})[_0xd474('0x34')](handleEntityNotFound(_0x47d317,null))['then'](function(_0xd23a5b){if(_0xd23a5b){_0x44e45b=_0xd23a5b;switch(_0x305fbf[_0xd474('0x40')]){case _0xd474('0x8e'):if(_0x3c58f3==='2'||_0x3c58f3==='6'){return _0x44e45b[_0xd474('0x33')]({'read':!![]});}else{logger[_0xd474('0x22')](_0xd474('0xb2'),_0xd474('0x2a'),_0xd474('0x8e'),util[_0xd474('0xd0')](_0x14c078[_0xd474('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x44e45b;}})[_0xd474('0x34')](respondWithResult(_0x47d317,null))['catch'](handleError(_0x47d317,null));};exports[_0xd474('0xd8')]=function(_0x21de74,_0x44271a,_0x47fb99){return db[_0xd474('0x3d')][_0xd474('0x61')]({'where':{'id':_0x21de74['params']['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x44271a,null))[_0xd474('0x34')](function(_0x251676){if(_0x251676){return _0x251676['addAgents'](_0x21de74[_0xd474('0x5e')][_0xd474('0x69')],_['omit'](_0x21de74['body'],[_0xd474('0x69'),'id'])||{})[_0xd474('0xa3')](function(_0x3b6b4f){for(var _0x43c662=0x0;_0x43c662<_0x21de74[_0xd474('0x5e')]['ids'][_0xd474('0x48')];_0x43c662+=0x1){socket[_0xd474('0xd9')](_0xd474('0xda'),{'UserId':Number(_0x21de74['body'][_0xd474('0x69')][_0x43c662]),'SmsAccountId':Number(_0x21de74[_0xd474('0x55')]['id'])});}return _0x3b6b4f;});}})[_0xd474('0x34')](respondWithResult(_0x44271a,null))[_0xd474('0x27')](handleError(_0x44271a,null));};exports[_0xd474('0xdb')]=function(_0x5a1031,_0x23003b,_0x2e8ef3){return db[_0xd474('0x3d')][_0xd474('0x61')]({'where':{'id':_0x5a1031[_0xd474('0x55')]['id']}})[_0xd474('0x34')](handleEntityNotFound(_0x23003b,null))[_0xd474('0x34')](function(_0x237181){if(_0x237181){return _0x237181[_0xd474('0xdb')](_0x5a1031[_0xd474('0x42')][_0xd474('0x69')])[_0xd474('0x34')](function(){if(_[_0xd474('0xdc')](_0x5a1031[_0xd474('0x42')][_0xd474('0x69')])){for(var _0xd2faef=0x0;_0xd2faef<_0x5a1031[_0xd474('0x42')]['ids']['length'];_0xd2faef+=0x1){socket['emit'](_0xd474('0xdd'),{'UserId':Number(_0x5a1031['query'][_0xd474('0x69')][_0xd2faef]),'SmsAccountId':Number(_0x5a1031['params']['id'])});}}else{socket[_0xd474('0xd9')]('userSmsAccount:remove',{'UserId':Number(_0x5a1031[_0xd474('0x42')][_0xd474('0x69')]),'SmsAccountId':Number(_0x5a1031[_0xd474('0x55')]['id'])});}});}})[_0xd474('0x34')](respondWithStatusCode(_0x23003b,null))[_0xd474('0x27')](handleError(_0x23003b,null));};exports[_0xd474('0xde')]=function(_0x47538c,_0xf68914,_0x770c24){var _0x488e6e={};var _0x5749c6={};var _0x26d422;var _0x2fd38e;return db[_0xd474('0x3d')][_0xd474('0x65')]({'where':{'id':_0x47538c['params']['id']}})[_0xd474('0x34')](handleEntityNotFound(_0xf68914,null))[_0xd474('0x34')](function(_0x273dbf){if(_0x273dbf){_0x26d422=_0x273dbf;_0x5749c6[_0xd474('0x41')]=_[_0xd474('0x43')](db['User'][_0xd474('0x3e')]);_0x5749c6[_0xd474('0x42')]=_[_0xd474('0x43')](_0x47538c[_0xd474('0x42')]);_0x5749c6[_0xd474('0x44')]=_[_0xd474('0x45')](_0x5749c6[_0xd474('0x41')],_0x5749c6[_0xd474('0x42')]);_0x488e6e[_0xd474('0x47')]=_[_0xd474('0x45')](_0x5749c6[_0xd474('0x41')],qs[_0xd474('0x46')](_0x47538c[_0xd474('0x42')]['fields']));_0x488e6e[_0xd474('0x47')]=_0x488e6e[_0xd474('0x47')][_0xd474('0x48')]?_0x488e6e['attributes']:_0x5749c6['model'];_0x488e6e[_0xd474('0x4b')]=qs[_0xd474('0x4c')](_0x47538c[_0xd474('0x42')][_0xd474('0x4c')]);_0x488e6e[_0xd474('0x4e')]=qs[_0xd474('0x44')](_[_0xd474('0x4d')](_0x47538c['query'],_0x5749c6['filters']));if(_0x47538c[_0xd474('0x42')]['filter']){_0x488e6e[_0xd474('0x4e')]=_['merge'](_0x488e6e[_0xd474('0x4e')],{'$or':_[_0xd474('0x50')](_0x488e6e[_0xd474('0x47')],function(_0x15affe){var _0x5495ed={};_0x5495ed[_0x15affe]={'$like':'%'+_0x47538c[_0xd474('0x42')]['filter']+'%'};return _0x5495ed;})});}_0x488e6e=_[_0xd474('0x4f')]({},_0x488e6e,_0x47538c[_0xd474('0x58')]);return _0x26d422[_0xd474('0xde')](_0x488e6e);}})['then'](function(_0x2c927d){if(_0x2c927d){_0x2fd38e=_0x2c927d[_0xd474('0x48')];if(!_0x47538c[_0xd474('0x42')][_0xd474('0x67')](_0xd474('0x49'))){_0x488e6e['limit']=qs[_0xd474('0x4a')](_0x47538c[_0xd474('0x42')]['limit']);_0x488e6e['offset']=qs['offset'](_0x47538c[_0xd474('0x42')][_0xd474('0x2b')]);}return _0x26d422[_0xd474('0xde')](_0x488e6e);}})['then'](function(_0x478100){if(_0x478100){return _0x478100?{'count':_0x2fd38e,'rows':_0x478100}:null;}})[_0xd474('0x34')](respondWithResult(_0xf68914,null))[_0xd474('0x27')](handleError(_0xf68914,null));};
\ No newline at end of file
index 77c81b1..e7d13f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7798=['events','../../mysqldb','SmsAccount','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x7a112,_0x2eb4a0){var _0x136dc5=function(_0x437650){while(--_0x437650){_0x7a112['push'](_0x7a112['shift']());}};_0x136dc5(++_0x2eb4a0);}(_0x7798,0x17a));var _0x8779=function(_0x219daf,_0x36b307){_0x219daf=_0x219daf-0x0;var _0x4c2e61=_0x7798[_0x219daf];return _0x4c2e61;};'use strict';var EventEmitter=require(_0x8779('0x0'));var SmsAccount=require(_0x8779('0x1'))['db'][_0x8779('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8779('0x3'),'afterUpdate':_0x8779('0x4'),'afterDestroy':_0x8779('0x5')};function emitEvent(_0x563e38){return function(_0x3c862c,_0x1ad222,_0x5dc183){SmsAccountEvents[_0x8779('0x6')](_0x563e38+':'+_0x3c862c['id'],_0x3c862c);SmsAccountEvents[_0x8779('0x6')](_0x563e38,_0x3c862c);_0x5dc183(null);};}for(var e in events){if(events[_0x8779('0x7')](e)){var event=events[e];SmsAccount[_0x8779('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0xf50a=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2671be,_0x4c091d){var _0x357bb6=function(_0x4ee304){while(--_0x4ee304){_0x2671be['push'](_0x2671be['shift']());}};_0x357bb6(++_0x4c091d);}(_0xf50a,0xa0));var _0xaf50=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0xf50a[_0x451735];return _0x41d1e2;};'use strict';var EventEmitter=require(_0xaf50('0x0'));var SmsAccount=require(_0xaf50('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf50('0x2'),'afterUpdate':'update','afterDestroy':_0xaf50('0x3')};function emitEvent(_0x1b8a7a){return function(_0x62019d,_0x4ee618,_0x4224de){SmsAccountEvents[_0xaf50('0x4')](_0x1b8a7a+':'+_0x62019d['id'],_0x62019d);SmsAccountEvents[_0xaf50('0x4')](_0x1b8a7a,_0x62019d);_0x4224de(null);};}for(var e in events){if(events[_0xaf50('0x5')](e)){var event=events[e];SmsAccount[_0xaf50('0x6')](e,emitEvent(event));}}module[_0xaf50('0x7')]=SmsAccountEvents;
\ No newline at end of file
index d654af2..08c8689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e0=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts'];(function(_0x20e2fc,_0x5fe9a6){var _0xa92f2f=function(_0x545925){while(--_0x545925){_0x20e2fc['push'](_0x20e2fc['shift']());}};_0xa92f2f(++_0x5fe9a6);}(_0x46e0,0x1e4));var _0x046e=function(_0x29790b,_0x507ccc){_0x29790b=_0x29790b-0x0;var _0x2aecb9=_0x46e0[_0x29790b];return _0x2aecb9;};'use strict';var _=require('lodash');var util=require(_0x046e('0x0'));var logger=require(_0x046e('0x1'))('api');var moment=require(_0x046e('0x2'));var BPromise=require('bluebird');var rp=require(_0x046e('0x3'));var fs=require('fs');var path=require(_0x046e('0x4'));var rimraf=require(_0x046e('0x5'));var config=require(_0x046e('0x6'));var attributes=require(_0x046e('0x7'));module[_0x046e('0x8')]=function(_0x5c426a,_0xa102a3){return _0x5c426a['define'](_0x046e('0x9'),attributes,{'tableName':_0x046e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdaf=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','../../config/logger','api'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xbdaf,0x80));var _0xfbda=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xbdaf[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfbda('0x0'))(_0xfbda('0x1'));var moment=require(_0xfbda('0x2'));var BPromise=require(_0xfbda('0x3'));var rp=require(_0xfbda('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbda('0x5'));var config=require(_0xfbda('0x6'));var attributes=require(_0xfbda('0x7'));module[_0xfbda('0x8')]=function(_0x36ddde,_0x22770c){return _0x36ddde['define'](_0xfbda('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6aa1b87..1d1e7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4127=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x381318,_0x36bc70){var _0x49174f=function(_0x4b0026){while(--_0x4b0026){_0x381318['push'](_0x381318['shift']());}};_0x49174f(++_0x36bc70);}(_0x4127,0x100));var _0x7412=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4127[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7412('0x0'));var util=require('util');var moment=require(_0x7412('0x1'));var BPromise=require(_0x7412('0x2'));var rs=require(_0x7412('0x3'));var fs=require('fs');var Redis=require(_0x7412('0x4'));var db=require(_0x7412('0x5'))['db'];var utils=require(_0x7412('0x6'));var logger=require(_0x7412('0x7'))(_0x7412('0x8'));var config=require(_0x7412('0x9'));var jayson=require(_0x7412('0xa'));var client=jayson['client'][_0x7412('0xb')]({'port':0x232a});config[_0x7412('0xc')]=_[_0x7412('0xd')](config[_0x7412('0xc')],{'host':_0x7412('0xe'),'port':0x18eb});var socket=require(_0x7412('0xf'))(new Redis(config[_0x7412('0xc')]));require(_0x7412('0x10'))['register'](socket);function respondWithRpcPromise(_0xdfe896,_0x2dcdf7,_0x126d1b){return new BPromise(function(_0x265fcd,_0x3533d0){return client['request'](_0xdfe896,_0x126d1b)[_0x7412('0x11')](function(_0x4ede86){logger[_0x7412('0x12')](_0x7412('0x13'),_0x2dcdf7,_0x7412('0x14'));logger['debug'](_0x7412('0x15'),_0x2dcdf7,_0x7412('0x14'),JSON['stringify'](_0x4ede86));if(_0x4ede86[_0x7412('0x16')]){if(_0x4ede86[_0x7412('0x16')]['code']===0x1f4){logger[_0x7412('0x16')](_0x7412('0x13'),_0x2dcdf7,_0x4ede86['error'][_0x7412('0x17')]);return _0x3533d0(_0x4ede86[_0x7412('0x16')][_0x7412('0x17')]);}logger[_0x7412('0x16')](_0x7412('0x13'),_0x2dcdf7,_0x4ede86[_0x7412('0x16')]['message']);return _0x265fcd(_0x4ede86['error'][_0x7412('0x17')]);}else{logger[_0x7412('0x12')]('SmsAccount,\x20%s,\x20%s',_0x2dcdf7,_0x7412('0x14'));_0x265fcd(_0x4ede86[_0x7412('0x18')][_0x7412('0x17')]);}})[_0x7412('0x19')](function(_0x285cf4){logger[_0x7412('0x16')](_0x7412('0x13'),_0x2dcdf7,_0x285cf4);_0x3533d0(_0x285cf4);});});}exports[_0x7412('0x1a')]=function(_0x51371d){var _0xbdabd6=this;return new Promise(function(_0x1faaa1,_0x52688a){return db[_0x7412('0x1b')][_0x7412('0x1c')]({'raw':_0x51371d['options']?_0x51371d[_0x7412('0x1d')][_0x7412('0x1e')]===undefined?!![]:![]:!![],'where':_0x51371d[_0x7412('0x1d')]?_0x51371d['options'][_0x7412('0x1f')]||null:null,'attributes':_0x51371d['options']?_0x51371d['options'][_0x7412('0x20')]||null:null,'include':_0x51371d[_0x7412('0x1d')]?_0x51371d[_0x7412('0x1d')][_0x7412('0x21')]?_[_0x7412('0x22')](_0x51371d[_0x7412('0x1d')][_0x7412('0x21')],function(_0x13d58f){return{'model':db[_0x13d58f['model']],'as':_0x13d58f['as'],'attributes':_0x13d58f[_0x7412('0x20')],'include':_0x13d58f['include']?_[_0x7412('0x22')](_0x13d58f['include'],function(_0x228eb4){return{'model':db[_0x228eb4[_0x7412('0x23')]],'as':_0x228eb4['as'],'attributes':_0x228eb4['attributes'],'include':_0x228eb4[_0x7412('0x21')]?_[_0x7412('0x22')](_0x228eb4[_0x7412('0x21')],function(_0x3a0069){return{'model':db[_0x3a0069[_0x7412('0x23')]],'as':_0x3a0069['as'],'attributes':_0x3a0069['attributes']};}):[]};}):[]};}):[]:[]})[_0x7412('0x11')](function(_0x15e752){logger['info']('ShowSmsAccount',_0x51371d);logger[_0x7412('0x24')](_0x7412('0x1a'),_0x51371d,JSON[_0x7412('0x25')](_0x15e752));_0x1faaa1(_0x15e752);})[_0x7412('0x19')](function(_0x2c98d9){logger['error'](_0x7412('0x1a'),_0x2c98d9[_0x7412('0x17')],_0x51371d);_0x52688a(_0xbdabd6[_0x7412('0x16')](0x1f4,_0x2c98d9[_0x7412('0x17')]));});});};
\ No newline at end of file
+var _0x5aed=['SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsAccount','find','options','where','include','map','model','attributes','ShowSmsAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x5aed,0x16c));var _0xd5ae=function(_0x182b3b,_0x18723e){_0x182b3b=_0x182b3b-0x0;var _0x42edca=_0x5aed[_0x182b3b];return _0x42edca;};'use strict';var _=require(_0xd5ae('0x0'));var util=require('util');var moment=require(_0xd5ae('0x1'));var BPromise=require(_0xd5ae('0x2'));var rs=require(_0xd5ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd5ae('0x4'));var logger=require(_0xd5ae('0x5'))(_0xd5ae('0x6'));var config=require(_0xd5ae('0x7'));var jayson=require(_0xd5ae('0x8'));var client=jayson[_0xd5ae('0x9')][_0xd5ae('0xa')]({'port':0x232a});config[_0xd5ae('0xb')]=_['defaults'](config[_0xd5ae('0xb')],{'host':_0xd5ae('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd5ae('0xd'))[_0xd5ae('0xe')](socket);function respondWithRpcPromise(_0x2d79f3,_0x5e5803,_0x129593){return new BPromise(function(_0x184113,_0x23e70){return client[_0xd5ae('0xf')](_0x2d79f3,_0x129593)[_0xd5ae('0x10')](function(_0x2d1e09){logger[_0xd5ae('0x11')](_0xd5ae('0x12'),_0x5e5803,_0xd5ae('0x13'));logger[_0xd5ae('0x14')](_0xd5ae('0x15'),_0x5e5803,_0xd5ae('0x13'),JSON[_0xd5ae('0x16')](_0x2d1e09));if(_0x2d1e09[_0xd5ae('0x17')]){if(_0x2d1e09[_0xd5ae('0x17')]['code']===0x1f4){logger['error'](_0xd5ae('0x12'),_0x5e5803,_0x2d1e09[_0xd5ae('0x17')][_0xd5ae('0x18')]);return _0x23e70(_0x2d1e09[_0xd5ae('0x17')][_0xd5ae('0x18')]);}logger[_0xd5ae('0x17')](_0xd5ae('0x12'),_0x5e5803,_0x2d1e09[_0xd5ae('0x17')][_0xd5ae('0x18')]);return _0x184113(_0x2d1e09['error'][_0xd5ae('0x18')]);}else{logger[_0xd5ae('0x11')](_0xd5ae('0x12'),_0x5e5803,_0xd5ae('0x13'));_0x184113(_0x2d1e09[_0xd5ae('0x19')][_0xd5ae('0x18')]);}})['catch'](function(_0x45900f){logger[_0xd5ae('0x17')](_0xd5ae('0x12'),_0x5e5803,_0x45900f);_0x23e70(_0x45900f);});});}exports['ShowSmsAccount']=function(_0x591f39){var _0x39f5ba=this;return new Promise(function(_0x36a167,_0x265280){return db[_0xd5ae('0x1a')][_0xd5ae('0x1b')]({'raw':_0x591f39[_0xd5ae('0x1c')]?_0x591f39['options']['raw']===undefined?!![]:![]:!![],'where':_0x591f39[_0xd5ae('0x1c')]?_0x591f39['options'][_0xd5ae('0x1d')]||null:null,'attributes':_0x591f39[_0xd5ae('0x1c')]?_0x591f39[_0xd5ae('0x1c')]['attributes']||null:null,'include':_0x591f39[_0xd5ae('0x1c')]?_0x591f39[_0xd5ae('0x1c')][_0xd5ae('0x1e')]?_[_0xd5ae('0x1f')](_0x591f39['options']['include'],function(_0x4e33af){return{'model':db[_0x4e33af[_0xd5ae('0x20')]],'as':_0x4e33af['as'],'attributes':_0x4e33af[_0xd5ae('0x21')],'include':_0x4e33af[_0xd5ae('0x1e')]?_[_0xd5ae('0x1f')](_0x4e33af['include'],function(_0x44e94e){return{'model':db[_0x44e94e[_0xd5ae('0x20')]],'as':_0x44e94e['as'],'attributes':_0x44e94e[_0xd5ae('0x21')],'include':_0x44e94e[_0xd5ae('0x1e')]?_[_0xd5ae('0x1f')](_0x44e94e[_0xd5ae('0x1e')],function(_0x5e2328){return{'model':db[_0x5e2328[_0xd5ae('0x20')]],'as':_0x5e2328['as'],'attributes':_0x5e2328[_0xd5ae('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd5ae('0x10')](function(_0x3bc7ca){logger[_0xd5ae('0x11')](_0xd5ae('0x22'),_0x591f39);logger['debug'](_0xd5ae('0x22'),_0x591f39,JSON[_0xd5ae('0x16')](_0x3bc7ca));_0x36a167(_0x3bc7ca);})['catch'](function(_0xb208ae){logger[_0xd5ae('0x17')](_0xd5ae('0x22'),_0xb208ae[_0xd5ae('0x18')],_0x591f39);_0x265280(_0x39f5ba['error'](0x1f4,_0xb208ae[_0xd5ae('0x18')]));});});};
\ No newline at end of file
index ac0bd7c..6aacfbf 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(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 4a1dc7b..b372eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30bb30,_0x564af1){var _0xce44e7=function(_0x5b96aa){while(--_0x5b96aa){_0x30bb30['push'](_0x30bb30['shift']());}};_0xce44e7(++_0x564af1);}(_0x34e8,0x12c));var _0x834e=function(_0xe50a3f,_0x1574d3){_0xe50a3f=_0xe50a3f-0x0;var _0x5d40c7=_0x34e8[_0xe50a3f];return _0x5d40c7;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
index 8549c08..398e043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaa4=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdaa4,0x195));var _0x4daa=function(_0x32e68f,_0x57a2df){_0x32e68f=_0x32e68f-0x0;var _0x31ce49=_0xdaa4[_0x32e68f];return _0x31ce49;};'use strict';var Sequelize=require(_0x4daa('0x0'));module[_0x4daa('0x1')]={'priority':{'type':Sequelize[_0x4daa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4daa('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4daa('0x4')]()},'description':{'type':Sequelize[_0x4daa('0x3')]},'interval':{'type':Sequelize[_0x4daa('0x3')],'defaultValue':_0x4daa('0x5')}};
\ No newline at end of file
+var _0xa35d=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x492fb6,_0x1d5737){var _0x4d4758=function(_0x41d5ab){while(--_0x41d5ab){_0x492fb6['push'](_0x492fb6['shift']());}};_0x4d4758(++_0x1d5737);}(_0xa35d,0x120));var _0xda35=function(_0x4eaa96,_0x53b203){_0x4eaa96=_0x4eaa96-0x0;var _0x390958=_0xa35d[_0x4eaa96];return _0x390958;};'use strict';var Sequelize=require(_0xda35('0x0'));module[_0xda35('0x1')]={'priority':{'type':Sequelize[_0xda35('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xda35('0x3')],'allowNull':![],'defaultValue':_0xda35('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xda35('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 3a7ab4e..8e92695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a3e=['catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','SmsApplication','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','update','find'];(function(_0x1ac41c,_0x1dacbf){var _0x561d64=function(_0x2654df){while(--_0x2654df){_0x1ac41c['push'](_0x1ac41c['shift']());}};_0x561d64(++_0x1dacbf);}(_0x8a3e,0x16e));var _0xe8a3=function(_0x25c0cc,_0x1b98d1){_0x25c0cc=_0x25c0cc-0x0;var _0x385788=_0x8a3e[_0x25c0cc];return _0x385788;};'use strict';var emlformat=require(_0xe8a3('0x0'));var rimraf=require(_0xe8a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8a3('0x2'));var rp=require(_0xe8a3('0x3'));var moment=require(_0xe8a3('0x4'));var BPromise=require(_0xe8a3('0x5'));var Mustache=require(_0xe8a3('0x6'));var util=require('util');var path=require(_0xe8a3('0x7'));var sox=require('sox');var csv=require(_0xe8a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8a3('0x9'));var _=require(_0xe8a3('0xa'));var squel=require(_0xe8a3('0xb'));var crypto=require(_0xe8a3('0xc'));var jsforce=require(_0xe8a3('0xd'));var deskjs=require(_0xe8a3('0xe'));var toCsv=require(_0xe8a3('0x8'));var querystring=require(_0xe8a3('0xf'));var Papa=require(_0xe8a3('0x10'));var Redis=require(_0xe8a3('0x11'));var authService=require(_0xe8a3('0x12'));var qs=require(_0xe8a3('0x13'));var as=require(_0xe8a3('0x14'));var hardwareService=require(_0xe8a3('0x15'));var logger=require(_0xe8a3('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe8a3('0x17'));var db=require(_0xe8a3('0x18'))['db'];function respondWithStatusCode(_0xfb8574,_0x2f8386){_0x2f8386=_0x2f8386||0xcc;return function(_0x398817){if(_0x398817){return _0xfb8574['sendStatus'](_0x2f8386);}return _0xfb8574[_0xe8a3('0x19')](_0x2f8386)[_0xe8a3('0x1a')]();};}function respondWithResult(_0x4e82a3,_0x52c5d4){_0x52c5d4=_0x52c5d4||0xc8;return function(_0x56c32d){if(_0x56c32d){return _0x4e82a3[_0xe8a3('0x19')](_0x52c5d4)[_0xe8a3('0x1b')](_0x56c32d);}};}function respondWithFilteredResult(_0x5beacd,_0x2c713c){return function(_0x50571c){if(_0x50571c){var _0x30074e=typeof _0x2c713c[_0xe8a3('0x1c')]===_0xe8a3('0x1d')&&typeof _0x2c713c[_0xe8a3('0x1e')]===_0xe8a3('0x1d');var _0x527063=_0x50571c[_0xe8a3('0x1f')];var _0x293971=_0x30074e?0x0:_0x2c713c[_0xe8a3('0x1c')];var _0x59e954=_0x30074e?_0x50571c[_0xe8a3('0x1f')]:_0x2c713c[_0xe8a3('0x1c')]+_0x2c713c[_0xe8a3('0x1e')];var _0xb0dc3e;if(_0x59e954>=_0x527063){_0x59e954=_0x527063;_0xb0dc3e=0xc8;}else{_0xb0dc3e=0xce;}_0x5beacd[_0xe8a3('0x19')](_0xb0dc3e);return _0x5beacd[_0xe8a3('0x20')](_0xe8a3('0x21'),_0x293971+'-'+_0x59e954+'/'+_0x527063)['json'](_0x50571c);}return null;};}function patchUpdates(_0x5c5603){return function(_0x449be1){try{jsonpatch[_0xe8a3('0x22')](_0x449be1,_0x5c5603,!![]);}catch(_0x389b72){return BPromise[_0xe8a3('0x23')](_0x389b72);}return _0x449be1[_0xe8a3('0x24')]();};}function saveUpdates(_0x40d487,_0x22b05d){return function(_0x3df705){if(_0x3df705){return _0x3df705['update'](_0x40d487)[_0xe8a3('0x25')](function(_0x601fe2){return _0x601fe2;});}return null;};}function removeEntity(_0x3c8346,_0x550440){return function(_0x4779ab){if(_0x4779ab){return _0x4779ab[_0xe8a3('0x26')]()[_0xe8a3('0x25')](function(){_0x3c8346[_0xe8a3('0x19')](0xcc)[_0xe8a3('0x1a')]();});}};}function handleEntityNotFound(_0xf82070,_0x277ac9){return function(_0x7246d2){if(!_0x7246d2){_0xf82070[_0xe8a3('0x27')](0x194);}return _0x7246d2;};}function handleError(_0x27e608,_0x8f4279){_0x8f4279=_0x8f4279||0x1f4;return function(_0x24f99f){logger[_0xe8a3('0x28')](_0x24f99f['stack']);if(_0x24f99f[_0xe8a3('0x29')]){delete _0x24f99f[_0xe8a3('0x29')];}_0x27e608[_0xe8a3('0x19')](_0x8f4279)[_0xe8a3('0x2a')](_0x24f99f);};}exports['index']=function(_0x5b0966,_0x268a38){var _0x47e321={},_0x3c769f={},_0x465904={'count':0x0,'rows':[]};var _0x4fc9bd=_[_0xe8a3('0x2b')](db[_0xe8a3('0x2c')]['rawAttributes'],function(_0x537d85){return{'name':_0x537d85[_0xe8a3('0x2d')],'type':_0x537d85[_0xe8a3('0x2e')][_0xe8a3('0x2f')]};});_0x3c769f[_0xe8a3('0x30')]=_[_0xe8a3('0x2b')](_0x4fc9bd,_0xe8a3('0x29'));_0x3c769f[_0xe8a3('0x31')]=_[_0xe8a3('0x32')](_0x5b0966[_0xe8a3('0x31')]);_0x3c769f[_0xe8a3('0x33')]=_['intersection'](_0x3c769f[_0xe8a3('0x30')],_0x3c769f[_0xe8a3('0x31')]);_0x47e321[_0xe8a3('0x34')]=_[_0xe8a3('0x35')](_0x3c769f['model'],qs[_0xe8a3('0x36')](_0x5b0966[_0xe8a3('0x31')][_0xe8a3('0x36')]));_0x47e321[_0xe8a3('0x34')]=_0x47e321[_0xe8a3('0x34')][_0xe8a3('0x37')]?_0x47e321[_0xe8a3('0x34')]:_0x3c769f['model'];if(!_0x5b0966[_0xe8a3('0x31')]['hasOwnProperty'](_0xe8a3('0x38'))){_0x47e321['limit']=qs[_0xe8a3('0x1e')](_0x5b0966[_0xe8a3('0x31')][_0xe8a3('0x1e')]);_0x47e321[_0xe8a3('0x1c')]=qs[_0xe8a3('0x1c')](_0x5b0966[_0xe8a3('0x31')][_0xe8a3('0x1c')]);}_0x47e321['order']=qs[_0xe8a3('0x39')](_0x5b0966['query'][_0xe8a3('0x39')]);_0x47e321[_0xe8a3('0x3a')]=qs[_0xe8a3('0x33')](_['pick'](_0x5b0966[_0xe8a3('0x31')],_0x3c769f['filters']),_0x4fc9bd);if(_0x5b0966[_0xe8a3('0x31')][_0xe8a3('0x3b')]){_0x47e321['where']=_[_0xe8a3('0x3c')](_0x47e321[_0xe8a3('0x3a')],{'$or':_[_0xe8a3('0x2b')](_0x4fc9bd,function(_0x382b4f){if(_0x382b4f['type']!==_0xe8a3('0x3d')){var _0x51762b={};_0x51762b[_0x382b4f[_0xe8a3('0x29')]]={'$like':'%'+_0x5b0966[_0xe8a3('0x31')][_0xe8a3('0x3b')]+'%'};return _0x51762b;}})});}_0x47e321=_[_0xe8a3('0x3c')]({},_0x47e321,_0x5b0966[_0xe8a3('0x3e')]);var _0x3e6794={'where':_0x47e321[_0xe8a3('0x3a')]};return db[_0xe8a3('0x2c')][_0xe8a3('0x1f')](_0x3e6794)[_0xe8a3('0x25')](function(_0x24864f){_0x465904[_0xe8a3('0x1f')]=_0x24864f;if(_0x5b0966['query'][_0xe8a3('0x3f')]){_0x47e321[_0xe8a3('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0xe8a3('0x41')](_0x47e321);})[_0xe8a3('0x25')](function(_0x3ae1ee){_0x465904[_0xe8a3('0x42')]=_0x3ae1ee;return _0x465904;})[_0xe8a3('0x25')](respondWithFilteredResult(_0x268a38,_0x47e321))['catch'](handleError(_0x268a38,null));};exports['show']=function(_0x8efd76,_0x36e835){var _0x27236f={'raw':!![],'where':{'id':_0x8efd76[_0xe8a3('0x43')]['id']}},_0x3ba132={};_0x3ba132[_0xe8a3('0x30')]=_[_0xe8a3('0x32')](db[_0xe8a3('0x2c')]['rawAttributes']);_0x3ba132[_0xe8a3('0x31')]=_[_0xe8a3('0x32')](_0x8efd76[_0xe8a3('0x31')]);_0x3ba132[_0xe8a3('0x33')]=_[_0xe8a3('0x35')](_0x3ba132[_0xe8a3('0x30')],_0x3ba132[_0xe8a3('0x31')]);_0x27236f[_0xe8a3('0x34')]=_['intersection'](_0x3ba132['model'],qs['fields'](_0x8efd76[_0xe8a3('0x31')][_0xe8a3('0x36')]));_0x27236f[_0xe8a3('0x34')]=_0x27236f['attributes']['length']?_0x27236f[_0xe8a3('0x34')]:_0x3ba132[_0xe8a3('0x30')];if(_0x8efd76['query']['includeAll']){_0x27236f[_0xe8a3('0x40')]=[{'all':!![]}];}_0x27236f=_[_0xe8a3('0x3c')]({},_0x27236f,_0x8efd76['options']);return db[_0xe8a3('0x2c')]['find'](_0x27236f)[_0xe8a3('0x25')](handleEntityNotFound(_0x36e835,null))[_0xe8a3('0x25')](respondWithResult(_0x36e835,null))['catch'](handleError(_0x36e835,null));};exports['create']=function(_0x87382c,_0x309408){return db[_0xe8a3('0x2c')][_0xe8a3('0x44')](_0x87382c[_0xe8a3('0x45')],{})[_0xe8a3('0x25')](respondWithResult(_0x309408,0xc9))['catch'](handleError(_0x309408,null));};exports[_0xe8a3('0x46')]=function(_0x143dfb,_0x20de3a){if(_0x143dfb[_0xe8a3('0x45')]['id']){delete _0x143dfb[_0xe8a3('0x45')]['id'];}return db[_0xe8a3('0x2c')]['find']({'where':{'id':_0x143dfb[_0xe8a3('0x43')]['id']}})[_0xe8a3('0x25')](handleEntityNotFound(_0x20de3a,null))[_0xe8a3('0x25')](saveUpdates(_0x143dfb[_0xe8a3('0x45')],null))[_0xe8a3('0x25')](respondWithResult(_0x20de3a,null))['catch'](handleError(_0x20de3a,null));};exports[_0xe8a3('0x26')]=function(_0x10f527,_0x433709){return db[_0xe8a3('0x2c')][_0xe8a3('0x47')]({'where':{'id':_0x10f527[_0xe8a3('0x43')]['id']}})[_0xe8a3('0x25')](handleEntityNotFound(_0x433709,null))[_0xe8a3('0x25')](removeEntity(_0x433709,null))[_0xe8a3('0x48')](handleError(_0x433709,null));};
\ No newline at end of file
+var _0xb175=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','SmsApplication','findAll','rows','show','params','includeAll','catch','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys'];(function(_0x47abc,_0x31249b){var _0x47fa8f=function(_0x29e870){while(--_0x29e870){_0x47abc['push'](_0x47abc['shift']());}};_0x47fa8f(++_0x31249b);}(_0xb175,0x197));var _0x5b17=function(_0x1761e6,_0x2282db){_0x1761e6=_0x1761e6-0x0;var _0xb0db52=_0xb175[_0x1761e6];return _0xb0db52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b17('0x0'));var zipdir=require(_0x5b17('0x1'));var jsonpatch=require(_0x5b17('0x2'));var rp=require('request-promise');var moment=require(_0x5b17('0x3'));var BPromise=require(_0x5b17('0x4'));var Mustache=require('mustache');var util=require(_0x5b17('0x5'));var path=require(_0x5b17('0x6'));var sox=require(_0x5b17('0x7'));var csv=require('to-csv');var ejs=require(_0x5b17('0x8'));var fs=require('fs');var fs_extra=require(_0x5b17('0x9'));var _=require(_0x5b17('0xa'));var squel=require(_0x5b17('0xb'));var crypto=require(_0x5b17('0xc'));var jsforce=require(_0x5b17('0xd'));var deskjs=require(_0x5b17('0xe'));var toCsv=require(_0x5b17('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b17('0x10'));var qs=require(_0x5b17('0x11'));var as=require(_0x5b17('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b17('0x13'));var utils=require(_0x5b17('0x14'));var config=require(_0x5b17('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b17('0x16'))['db'];function respondWithStatusCode(_0x507ca6,_0x242aec){_0x242aec=_0x242aec||0xcc;return function(_0x9a9633){if(_0x9a9633){return _0x507ca6[_0x5b17('0x17')](_0x242aec);}return _0x507ca6[_0x5b17('0x18')](_0x242aec)['end']();};}function respondWithResult(_0x415cd4,_0x3ce4e3){_0x3ce4e3=_0x3ce4e3||0xc8;return function(_0x56cf24){if(_0x56cf24){return _0x415cd4[_0x5b17('0x18')](_0x3ce4e3)[_0x5b17('0x19')](_0x56cf24);}};}function respondWithFilteredResult(_0x2841a5,_0x10649f){return function(_0x152192){if(_0x152192){var _0x13fdd5=typeof _0x10649f[_0x5b17('0x1a')]===_0x5b17('0x1b')&&typeof _0x10649f[_0x5b17('0x1c')]===_0x5b17('0x1b');var _0x9efccf=_0x152192['count'];var _0x45067f=_0x13fdd5?0x0:_0x10649f[_0x5b17('0x1a')];var _0x53d44a=_0x13fdd5?_0x152192['count']:_0x10649f[_0x5b17('0x1a')]+_0x10649f['limit'];var _0x485dc1;if(_0x53d44a>=_0x9efccf){_0x53d44a=_0x9efccf;_0x485dc1=0xc8;}else{_0x485dc1=0xce;}_0x2841a5[_0x5b17('0x18')](_0x485dc1);return _0x2841a5[_0x5b17('0x1d')](_0x5b17('0x1e'),_0x45067f+'-'+_0x53d44a+'/'+_0x9efccf)['json'](_0x152192);}return null;};}function patchUpdates(_0xfd32cb){return function(_0x2f07dc){try{jsonpatch[_0x5b17('0x1f')](_0x2f07dc,_0xfd32cb,!![]);}catch(_0x2c7377){return BPromise[_0x5b17('0x20')](_0x2c7377);}return _0x2f07dc[_0x5b17('0x21')]();};}function saveUpdates(_0x1204c5,_0x4c0e25){return function(_0x4208d7){if(_0x4208d7){return _0x4208d7[_0x5b17('0x22')](_0x1204c5)[_0x5b17('0x23')](function(_0x3199da){return _0x3199da;});}return null;};}function removeEntity(_0x3d262e,_0x40da25){return function(_0x19e0c9){if(_0x19e0c9){return _0x19e0c9[_0x5b17('0x24')]()['then'](function(){_0x3d262e[_0x5b17('0x18')](0xcc)[_0x5b17('0x25')]();});}};}function handleEntityNotFound(_0x8affa2,_0x1557e8){return function(_0x441e3a){if(!_0x441e3a){_0x8affa2[_0x5b17('0x17')](0x194);}return _0x441e3a;};}function handleError(_0x5d8df5,_0x3e2fc8){_0x3e2fc8=_0x3e2fc8||0x1f4;return function(_0x5ce870){logger['error'](_0x5ce870[_0x5b17('0x26')]);if(_0x5ce870[_0x5b17('0x27')]){delete _0x5ce870[_0x5b17('0x27')];}_0x5d8df5[_0x5b17('0x18')](_0x3e2fc8)[_0x5b17('0x28')](_0x5ce870);};}exports[_0x5b17('0x29')]=function(_0x3ffcc9,_0x2c91a2){var _0x50b028={},_0x3bb426={},_0x50ea62={'count':0x0,'rows':[]};var _0x39faf3=_[_0x5b17('0x2a')](db['SmsApplication'][_0x5b17('0x2b')],function(_0x37949b){return{'name':_0x37949b[_0x5b17('0x2c')],'type':_0x37949b[_0x5b17('0x2d')][_0x5b17('0x2e')]};});_0x3bb426['model']=_[_0x5b17('0x2a')](_0x39faf3,_0x5b17('0x27'));_0x3bb426[_0x5b17('0x2f')]=_[_0x5b17('0x30')](_0x3ffcc9[_0x5b17('0x2f')]);_0x3bb426[_0x5b17('0x31')]=_[_0x5b17('0x32')](_0x3bb426[_0x5b17('0x33')],_0x3bb426['query']);_0x50b028[_0x5b17('0x34')]=_[_0x5b17('0x32')](_0x3bb426[_0x5b17('0x33')],qs[_0x5b17('0x35')](_0x3ffcc9['query'][_0x5b17('0x35')]));_0x50b028[_0x5b17('0x34')]=_0x50b028['attributes'][_0x5b17('0x36')]?_0x50b028[_0x5b17('0x34')]:_0x3bb426[_0x5b17('0x33')];if(!_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x37')](_0x5b17('0x38'))){_0x50b028['limit']=qs['limit'](_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x1c')]);_0x50b028['offset']=qs['offset'](_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x1a')]);}_0x50b028[_0x5b17('0x39')]=qs[_0x5b17('0x3a')](_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x3a')]);_0x50b028[_0x5b17('0x3b')]=qs['filters'](_[_0x5b17('0x3c')](_0x3ffcc9['query'],_0x3bb426['filters']),_0x39faf3);if(_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x3d')]){_0x50b028[_0x5b17('0x3b')]=_[_0x5b17('0x3e')](_0x50b028[_0x5b17('0x3b')],{'$or':_[_0x5b17('0x2a')](_0x39faf3,function(_0x5a6092){if(_0x5a6092[_0x5b17('0x2d')]!=='VIRTUAL'){var _0x8c31cb={};_0x8c31cb[_0x5a6092[_0x5b17('0x27')]]={'$like':'%'+_0x3ffcc9[_0x5b17('0x2f')][_0x5b17('0x3d')]+'%'};return _0x8c31cb;}})});}_0x50b028=_[_0x5b17('0x3e')]({},_0x50b028,_0x3ffcc9[_0x5b17('0x3f')]);var _0x46d248={'where':_0x50b028['where']};return db['SmsApplication'][_0x5b17('0x40')](_0x46d248)[_0x5b17('0x23')](function(_0x4cf053){_0x50ea62[_0x5b17('0x40')]=_0x4cf053;if(_0x3ffcc9['query']['includeAll']){_0x50b028[_0x5b17('0x41')]=[{'all':!![]}];}return db[_0x5b17('0x42')][_0x5b17('0x43')](_0x50b028);})['then'](function(_0x5a0067){_0x50ea62[_0x5b17('0x44')]=_0x5a0067;return _0x50ea62;})[_0x5b17('0x23')](respondWithFilteredResult(_0x2c91a2,_0x50b028))['catch'](handleError(_0x2c91a2,null));};exports[_0x5b17('0x45')]=function(_0x5ae29c,_0x52f75c){var _0x49302d={'raw':!![],'where':{'id':_0x5ae29c[_0x5b17('0x46')]['id']}},_0x5e1b6c={};_0x5e1b6c['model']=_[_0x5b17('0x30')](db[_0x5b17('0x42')]['rawAttributes']);_0x5e1b6c[_0x5b17('0x2f')]=_[_0x5b17('0x30')](_0x5ae29c[_0x5b17('0x2f')]);_0x5e1b6c['filters']=_[_0x5b17('0x32')](_0x5e1b6c[_0x5b17('0x33')],_0x5e1b6c[_0x5b17('0x2f')]);_0x49302d[_0x5b17('0x34')]=_['intersection'](_0x5e1b6c[_0x5b17('0x33')],qs['fields'](_0x5ae29c['query']['fields']));_0x49302d[_0x5b17('0x34')]=_0x49302d['attributes'][_0x5b17('0x36')]?_0x49302d[_0x5b17('0x34')]:_0x5e1b6c[_0x5b17('0x33')];if(_0x5ae29c[_0x5b17('0x2f')][_0x5b17('0x47')]){_0x49302d[_0x5b17('0x41')]=[{'all':!![]}];}_0x49302d=_['merge']({},_0x49302d,_0x5ae29c[_0x5b17('0x3f')]);return db[_0x5b17('0x42')]['find'](_0x49302d)[_0x5b17('0x23')](handleEntityNotFound(_0x52f75c,null))[_0x5b17('0x23')](respondWithResult(_0x52f75c,null))[_0x5b17('0x48')](handleError(_0x52f75c,null));};exports['create']=function(_0x16cf24,_0xee60fc){return db[_0x5b17('0x42')][_0x5b17('0x49')](_0x16cf24['body'],{})['then'](respondWithResult(_0xee60fc,0xc9))[_0x5b17('0x48')](handleError(_0xee60fc,null));};exports[_0x5b17('0x22')]=function(_0x27e702,_0x35d23e){if(_0x27e702[_0x5b17('0x4a')]['id']){delete _0x27e702[_0x5b17('0x4a')]['id'];}return db[_0x5b17('0x42')][_0x5b17('0x4b')]({'where':{'id':_0x27e702['params']['id']}})['then'](handleEntityNotFound(_0x35d23e,null))[_0x5b17('0x23')](saveUpdates(_0x27e702[_0x5b17('0x4a')],null))[_0x5b17('0x23')](respondWithResult(_0x35d23e,null))[_0x5b17('0x48')](handleError(_0x35d23e,null));};exports['destroy']=function(_0xc93d7d,_0x47cb4f){return db['SmsApplication'][_0x5b17('0x4b')]({'where':{'id':_0xc93d7d[_0x5b17('0x46')]['id']}})['then'](handleEntityNotFound(_0x47cb4f,null))[_0x5b17('0x23')](removeEntity(_0x47cb4f,null))[_0x5b17('0x48')](handleError(_0x47cb4f,null));};
\ No newline at end of file
index b9ec86f..843bbbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1862=['api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','define','sms_applications','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1862,0x6c));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2186('0x0'));var util=require('util');var logger=require(_0x2186('0x1'))(_0x2186('0x2'));var moment=require(_0x2186('0x3'));var BPromise=require(_0x2186('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2186('0x5'));var rimraf=require(_0x2186('0x6'));var config=require(_0x2186('0x7'));var attributes=require(_0x2186('0x8'));module['exports']=function(_0x13515d,_0x2ada49){return _0x13515d[_0x2186('0x9')]('SmsApplication',attributes,{'tableName':_0x2186('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x605b=['bluebird','path','rimraf','../../config/environment','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x50e3c1,_0x289f05){var _0x4c622f=function(_0x4c61fb){while(--_0x4c61fb){_0x50e3c1['push'](_0x50e3c1['shift']());}};_0x4c622f(++_0x289f05);}(_0x605b,0x134));var _0xb605=function(_0x583956,_0x55767e){_0x583956=_0x583956-0x0;var _0x2c4e7f=_0x605b[_0x583956];return _0x2c4e7f;};'use strict';var _=require(_0xb605('0x0'));var util=require('util');var logger=require(_0xb605('0x1'))(_0xb605('0x2'));var moment=require(_0xb605('0x3'));var BPromise=require(_0xb605('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb605('0x5'));var rimraf=require(_0xb605('0x6'));var config=require(_0xb605('0x7'));var attributes=require('./smsApplication.attributes');module[_0xb605('0x8')]=function(_0x139166,_0xe02b4e){return _0x139166[_0xb605('0x9')]('SmsApplication',attributes,{'tableName':_0xb605('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb605('0xb'),'collate':_0xb605('0xc')});};
\ No newline at end of file
index 803226a..5803a1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b4d06,_0x4666f4){var _0x5c541a=function(_0x553329){while(--_0x553329){_0x4b4d06['push'](_0x4b4d06['shift']());}};_0x5c541a(++_0x4666f4);}(_0xef0f,0x168));var _0xfef0=function(_0x163513,_0x500220){_0x163513=_0x163513-0x0;var _0x1439c7=_0xef0f[_0x163513];return _0x1439c7;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('SmsApplication,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}
\ No newline at end of file
+var _0x4e7b=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','SmsApplication,\x20%s,\x20%s'];(function(_0x222cae,_0x4592b5){var _0x3a9a50=function(_0x353aa5){while(--_0x353aa5){_0x222cae['push'](_0x222cae['shift']());}};_0x3a9a50(++_0x4592b5);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x144c90,_0x33c9d7){_0x144c90=_0x144c90-0x0;var _0xce092b=_0x4e7b[_0x144c90];return _0xce092b;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var moment=require('moment');var BPromise=require(_0xb4e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e7('0x3'));var db=require(_0xb4e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4e7('0x5'))(_0xb4e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4e7('0x7'));var client=jayson[_0xb4e7('0x8')][_0xb4e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf05,_0x315c27,_0x490b1b){return new BPromise(function(_0x366595,_0x3e621e){return client['request'](_0x1dcf05,_0x490b1b)[_0xb4e7('0xa')](function(_0x472973){logger[_0xb4e7('0xb')]('SmsApplication,\x20%s,\x20%s',_0x315c27,_0xb4e7('0xc'));logger[_0xb4e7('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x315c27,'request\x20sent',JSON['stringify'](_0x472973));if(_0x472973['error']){if(_0x472973[_0xb4e7('0xe')][_0xb4e7('0xf')]===0x1f4){logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x3e621e(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x366595(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}else{logger['info'](_0xb4e7('0x10'),_0x315c27,_0xb4e7('0xc'));_0x366595(_0x472973[_0xb4e7('0x12')][_0xb4e7('0x11')]);}})[_0xb4e7('0x13')](function(_0x3078a0){logger['error']('SmsApplication,\x20%s,\x20%s',_0x315c27,_0x3078a0);_0x3e621e(_0x3078a0);});});}
\ No newline at end of file
index 19e25f6..7535dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','sms','addTags','put','update','tracked','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get'];(function(_0xfc3f65,_0x21f988){var _0xc3d341=function(_0x1705bc){while(--_0x1705bc){_0xfc3f65['push'](_0xfc3f65['shift']());}};_0xc3d341(++_0x21f988);}(_0xd4a2,0x173));var _0x2d4a=function(_0x437539,_0x50467d){_0x437539=_0x437539-0x0;var _0x53e06b=_0xd4a2[_0x437539];return _0x53e06b;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['post']('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:addtags'),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x16')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:update'),controller[_0x2d4a('0x17')]);router['delete'](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction[_0x2d4a('0x18')](_0x2d4a('0x14'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x2d4a('0x13'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x19')]);module[_0x2d4a('0x1a')]=router;
\ No newline at end of file
+var _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5c00,0x17e));var _0x05c0=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x5c00[_0x397bfb];return _0x16c9b9;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router;
\ No newline at end of file
index ec38845..e489025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa990=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3d8a41,_0x2b0fbe){var _0x28675e=function(_0x222859){while(--_0x222859){_0x3d8a41['push'](_0x3d8a41['shift']());}};_0x28675e(++_0x2b0fbe);}(_0xa990,0xc9));var _0x0a99=function(_0x56e631,_0x2f2b46){_0x56e631=_0x56e631-0x0;var _0x40123a=_0xa990[_0x56e631];return _0x40123a;};'use strict';var Sequelize=require(_0x0a99('0x0'));var moment=require(_0x0a99('0x1'));module[_0x0a99('0x2')]={'closed':{'type':Sequelize[_0x0a99('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0a99('0x4')]},'disposition':{'type':Sequelize[_0x0a99('0x5')]},'secondDisposition':{'type':Sequelize[_0x0a99('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0a99('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0a99('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0a99('0x6')]('in',_0x0a99('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0a99('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0a99('0x6')]('in',_0x0a99('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0a99('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6b8f=['moment','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x2ce499,_0x36f053){var _0x137bf2=function(_0x51ad94){while(--_0x51ad94){_0x2ce499['push'](_0x2ce499['shift']());}};_0x137bf2(++_0x36f053);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4f15bd,_0x4a4bf0){_0x4f15bd=_0x4f15bd-0x0;var _0x50ddd1=_0x6b8f[_0x4f15bd];return _0x50ddd1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf6b8('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf6b8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf6b8('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf6b8('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf6b8('0x2')]},'read1stAt':{'type':Sequelize[_0xf6b8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf6b8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf6b8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf6b8('0x4')]('in',_0xf6b8('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf6b8('0x1')],'defaultValue':![]}};
\ No newline at end of file
index a1065c8..a640628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb87d=['length','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','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','include','options','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','emit','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','direction','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','closed','closedAt','disposition','System','lastName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb87d,0x8d));var _0xdb87=function(_0x1f5145,_0x1896ba){_0x1f5145=_0x1f5145-0x0;var _0xe55cfd=_0xb87d[_0x1f5145];return _0xe55cfd;};'use strict';var emlformat=require(_0xdb87('0x0'));var rimraf=require(_0xdb87('0x1'));var zipdir=require(_0xdb87('0x2'));var jsonpatch=require(_0xdb87('0x3'));var rp=require(_0xdb87('0x4'));var moment=require(_0xdb87('0x5'));var BPromise=require(_0xdb87('0x6'));var Mustache=require(_0xdb87('0x7'));var util=require(_0xdb87('0x8'));var path=require(_0xdb87('0x9'));var sox=require('sox');var csv=require(_0xdb87('0xa'));var ejs=require(_0xdb87('0xb'));var fs=require('fs');var fs_extra=require(_0xdb87('0xc'));var _=require(_0xdb87('0xd'));var squel=require(_0xdb87('0xe'));var crypto=require(_0xdb87('0xf'));var jsforce=require(_0xdb87('0x10'));var deskjs=require(_0xdb87('0x11'));var toCsv=require(_0xdb87('0xa'));var querystring=require(_0xdb87('0x12'));var Papa=require(_0xdb87('0x13'));var Redis=require('ioredis');var authService=require(_0xdb87('0x14'));var qs=require(_0xdb87('0x15'));var as=require(_0xdb87('0x16'));var pdf=require(_0xdb87('0x17'));var hardwareService=require(_0xdb87('0x18'));var logger=require(_0xdb87('0x19'))(_0xdb87('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdb87('0x1b')]=_['defaults'](config[_0xdb87('0x1b')],{'host':_0xdb87('0x1c'),'port':0x18eb});var socket=require(_0xdb87('0x1d'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xdb87('0x1e')](socket);function respondWithStatusCode(_0x34ae87,_0x1d4fc7){_0x1d4fc7=_0x1d4fc7||0xcc;return function(_0x5b572c){if(_0x5b572c){return _0x34ae87[_0xdb87('0x1f')](_0x1d4fc7);}return _0x34ae87[_0xdb87('0x20')](_0x1d4fc7)['end']();};}function respondWithResult(_0xd36f10,_0x28ae91){_0x28ae91=_0x28ae91||0xc8;return function(_0xa18302){if(_0xa18302){return _0xd36f10[_0xdb87('0x20')](_0x28ae91)[_0xdb87('0x21')](_0xa18302);}};}function respondWithFilteredResult(_0x5d1dee,_0x41cfc6){return function(_0x50362d){if(_0x50362d){var _0x4866bb=typeof _0x41cfc6[_0xdb87('0x22')]===_0xdb87('0x23')&&typeof _0x41cfc6['limit']==='undefined';var _0x12e617=_0x50362d[_0xdb87('0x24')];var _0xa58fa4=_0x4866bb?0x0:_0x41cfc6[_0xdb87('0x22')];var _0x20a07b=_0x4866bb?_0x50362d[_0xdb87('0x24')]:_0x41cfc6[_0xdb87('0x22')]+_0x41cfc6['limit'];var _0x2c6f45;if(_0x20a07b>=_0x12e617){_0x20a07b=_0x12e617;_0x2c6f45=0xc8;}else{_0x2c6f45=0xce;}_0x5d1dee[_0xdb87('0x20')](_0x2c6f45);return _0x5d1dee['set'](_0xdb87('0x25'),_0xa58fa4+'-'+_0x20a07b+'/'+_0x12e617)[_0xdb87('0x21')](_0x50362d);}return null;};}function patchUpdates(_0x822d69){return function(_0x21c2f0){try{jsonpatch[_0xdb87('0x26')](_0x21c2f0,_0x822d69,!![]);}catch(_0x59039a){return BPromise[_0xdb87('0x27')](_0x59039a);}return _0x21c2f0['save']();};}function saveUpdates(_0x3e0a3c,_0x11cf9b){return function(_0x1cf368){if(_0x1cf368){return _0x1cf368[_0xdb87('0x28')](_0x3e0a3c)[_0xdb87('0x29')](function(_0x47610f){return _0x47610f;});}return null;};}function removeEntity(_0x44aa59,_0x5c4ef8){return function(_0x35ba25){if(_0x35ba25){return _0x35ba25[_0xdb87('0x2a')]()['then'](function(){_0x44aa59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xefdd57,_0x1a1f45){return function(_0x1b0419){if(!_0x1b0419){_0xefdd57['sendStatus'](0x194);}return _0x1b0419;};}function handleError(_0x15b1ce,_0x4763ac){_0x4763ac=_0x4763ac||0x1f4;return function(_0x32f0ad){logger[_0xdb87('0x2b')](_0x32f0ad[_0xdb87('0x2c')]);if(_0x32f0ad[_0xdb87('0x2d')]){delete _0x32f0ad[_0xdb87('0x2d')];}_0x15b1ce['status'](_0x4763ac)['send'](_0x32f0ad);};}function getInteractionUsers(_0x9f812e,_0x23267a){return new BPromise(function(_0x27e56c,_0x4c15f7){try{if(_0x23267a[_0x9f812e['id']]){_0x9f812e['Users']=_[_0xdb87('0x2e')](_0x23267a[_0x9f812e['id']],function(_0x11f551){return{'id':_0x11f551['id'],'fullname':_0x11f551['fullname']};});}}catch(_0x23a0ce){_0x4c15f7(_0x23a0ce);}_0x27e56c(_0x9f812e);});}function getInteractionTags(_0x3d2a50,_0x2f8b40){return new BPromise(function(_0x33435a,_0x39b8ef){try{if(_0x3d2a50['TagIds']){_0x3d2a50[_0xdb87('0x2f')]=[];_0x3d2a50[_0xdb87('0x30')][_0xdb87('0x31')](',')[_0xdb87('0x32')](function(_0xcd0d7d){_0x3d2a50[_0xdb87('0x2f')][_0xdb87('0x33')](_0x2f8b40[_0xcd0d7d]);});}delete _0x3d2a50[_0xdb87('0x30')];}catch(_0x4291ce){_0x39b8ef(_0x4291ce);}_0x33435a(_0x3d2a50);});}function updateSmsInteraction(_0x21bc89,_0x285c2c,_0x2481bf){return new BPromise(function(_0x527443,_0x4188c0){return getInteractionUsers(_0x21bc89,_0x2481bf)[_0xdb87('0x29')](function(_0x42bca3){return getInteractionTags(_0x42bca3,_0x285c2c);})[_0xdb87('0x29')](function(_0xf9f520){_0x527443(_0xf9f520);})[_0xdb87('0x34')](function(_0x1ad399){_0x4188c0(_0x1ad399);});});}exports['index']=function(_0x35e887,_0x5b9afc){var _0x51a7e7={},_0x410fb7={},_0x17da6e={'count':0x0,'rows':[]};var _0x24742f=_[_0xdb87('0x2e')](db['SmsInteraction'][_0xdb87('0x35')],function(_0x3eb633){return{'name':_0x3eb633[_0xdb87('0x36')],'type':_0x3eb633[_0xdb87('0x37')][_0xdb87('0x38')]};});_0x410fb7[_0xdb87('0x39')]=_[_0xdb87('0x2e')](_0x24742f,_0xdb87('0x2d'));_0x410fb7['query']=_[_0xdb87('0x3a')](_0x35e887['query']);_0x410fb7[_0xdb87('0x3b')]=_['intersection'](_0x410fb7[_0xdb87('0x39')],_0x410fb7[_0xdb87('0x3c')]);_0x51a7e7[_0xdb87('0x3d')]=_[_0xdb87('0x3e')](_0x410fb7['model'],qs[_0xdb87('0x3f')](_0x35e887[_0xdb87('0x3c')][_0xdb87('0x3f')]));_0x51a7e7[_0xdb87('0x3d')]=_0x51a7e7[_0xdb87('0x3d')]['length']?_0x51a7e7[_0xdb87('0x3d')]:_0x410fb7[_0xdb87('0x39')];if(!_0x35e887[_0xdb87('0x3c')][_0xdb87('0x40')](_0xdb87('0x41'))){_0x51a7e7[_0xdb87('0x42')]=qs['limit'](_0x35e887['query']['limit']);_0x51a7e7[_0xdb87('0x22')]=qs[_0xdb87('0x22')](_0x35e887['query'][_0xdb87('0x22')]);}_0x51a7e7[_0xdb87('0x43')]=qs[_0xdb87('0x44')](_0x35e887[_0xdb87('0x3c')][_0xdb87('0x44')]);_0x51a7e7['where']=qs[_0xdb87('0x3b')](_[_0xdb87('0x45')](_0x35e887[_0xdb87('0x3c')],_0x410fb7['filters']),_0x24742f);var _0x28a74a=[];var _0xfc4e15=squel[_0xdb87('0x46')]()['field']('id')[_0xdb87('0x47')]('name')[_0xdb87('0x47')](_0xdb87('0x48'))[_0xdb87('0x49')](_0xdb87('0x4a'));var _0x5ed987=squel[_0xdb87('0x46')]()[_0xdb87('0x47')]('u.id')[_0xdb87('0x47')](_0xdb87('0x4b'))[_0xdb87('0x47')]('ui.SmsInteractionId')[_0xdb87('0x49')](_0xdb87('0x4c'),'ui')[_0xdb87('0x4d')]('users','u','u.id\x20=\x20ui.UserId');var _0x5a2ff6=squel[_0xdb87('0x46')]()[_0xdb87('0x49')]('sms_interactions','i')[_0xdb87('0x4d')](_0xdb87('0x4e'),'c',_0xdb87('0x4f'))[_0xdb87('0x4d')](_0xdb87('0x50'),'o',_0xdb87('0x51'))[_0xdb87('0x4d')](_0xdb87('0x52'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xdb87('0x53'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xdb87('0x4d')](_0xdb87('0x54'),'it',_0xdb87('0x55'))[_0xdb87('0x4d')](_0xdb87('0x4a'),'t',_0xdb87('0x56'));var _0x45dff4=squel[_0xdb87('0x57')]();var _0x5bf250=[];var _0x11421e=squel[_0xdb87('0x57')]();var _0xb3955;if(_0x35e887[_0xdb87('0x3c')][_0xdb87('0x58')]){_0xb3955=as[_0xdb87('0x59')](_0x35e887[_0xdb87('0x3c')][_0xdb87('0x58')]);var _0x3756d4=_0xb3955[_0xdb87('0x5a')];for(var _0x4c2a2f=0x0;_0x4c2a2f<_0xb3955[_0xdb87('0x5b')][_0xdb87('0x5c')];_0x4c2a2f++){var _0x5b12d5=_0xb3955['conditions'][_0x4c2a2f];var _0xf7bd63='i';var _0x9daf86=_[_0xdb87('0x5d')](_0x24742f,['name',_0x5b12d5[_0xdb87('0x47')]]);if(!_0x9daf86){switch(_0x5b12d5[_0xdb87('0x47')]){case _0xdb87('0x5e'):if(_0x5b12d5[_0xdb87('0x5f')]==0x1){_0x5a2ff6[_0xdb87('0x60')]('`'+_0x5b12d5['field']+_0xdb87('0x61'));}else{_0x5a2ff6[_0xdb87('0x60')]('`'+_0x5b12d5[_0xdb87('0x47')]+_0xdb87('0x62'));}break;case _0xdb87('0x63'):if(_0x5b12d5[_0xdb87('0x64')]===_0xdb87('0x65')){if(_0x5b12d5['value']['split']('\x20')[_0xdb87('0x5c')]>0x1){_0x45dff4[_0x3756d4](_0xdb87('0x66'),qs['getFullTextValue'](_0x5b12d5[_0xdb87('0x5f')]),null);}else{var _0x3a0152='%'+_0x5b12d5[_0xdb87('0x5f')]+'%';_0x45dff4[_0x3756d4](_0xdb87('0x67'),_0x3a0152,_0x3a0152,_0x3a0152);}}else{_0x9daf86=_[_0xdb87('0x5d')](_0x24742f,[_0xdb87('0x2d'),'ContactId']);_0x5b12d5[_0xdb87('0x47')]=_0xdb87('0x68');_0x2a3dd1=as[_0xdb87('0x69')](_0xf7bd63,_0x9daf86['type'],_0x5b12d5);_0x45dff4[_0x3756d4](_0x2a3dd1[_0xdb87('0x6a')],_0x2a3dd1[_0xdb87('0x5f')][_0xdb87('0x6b')],_0x2a3dd1[_0xdb87('0x5f')][_0xdb87('0x6c')]);}break;case _0xdb87('0x6d'):var _0x12aa55=_0x5b12d5[_0xdb87('0x5f')]['split'](',')['map'](function(_0x3d8574){return Number(_0x3d8574);});_0x12aa55[_0xdb87('0x32')](function(_0x1ef853){_0x11421e['or'](_0xdb87('0x6e'),'%,'+_0x1ef853+',%');});_0x5bf250=_[_0xdb87('0x6f')](_0x5bf250,_0x12aa55);break;case'User':if(_0x5b12d5['operator']==='$substring'){_0x45dff4[_0x3756d4](_0xdb87('0x70'),'%'+_0x5b12d5[_0xdb87('0x5f')]+'%',null);}else{_0x9daf86=_[_0xdb87('0x5d')](_0x24742f,[_0xdb87('0x2d'),_0xdb87('0x71')]);_0x5b12d5[_0xdb87('0x47')]='UserId';_0x2a3dd1=as['buildExpression'](_0xf7bd63,_0x9daf86[_0xdb87('0x37')],_0x5b12d5);_0x45dff4[_0x3756d4](_0x2a3dd1['text'],_0x2a3dd1[_0xdb87('0x5f')][_0xdb87('0x6b')],_0x2a3dd1['value'][_0xdb87('0x6c')]);}break;case'body':_0x2a3dd1=as[_0xdb87('0x69')]('me',null,_0x5b12d5);_0x45dff4[_0x3756d4](_0x2a3dd1[_0xdb87('0x6a')],_0x2a3dd1[_0xdb87('0x5f')]['start'],_0x2a3dd1[_0xdb87('0x5f')][_0xdb87('0x6c')]);break;}}else{var _0x2a3dd1=as[_0xdb87('0x69')](_0xf7bd63,_0x9daf86[_0xdb87('0x37')],_0x5b12d5);_0x45dff4[_0x3756d4](_0x2a3dd1[_0xdb87('0x6a')],_0x2a3dd1[_0xdb87('0x5f')][_0xdb87('0x6b')],_0x2a3dd1['value'][_0xdb87('0x6c')]);}}}else{var _0x4cc661=_(_0x35e887[_0xdb87('0x3c')])[_0xdb87('0x3a')]()[_0xdb87('0x2e')](function(_0x255127){return _[_0xdb87('0x72')](_0x24742f,[_0xdb87('0x2d'),_0x255127])?_0x255127:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x4cc661)){_0x4cc661['forEach'](function(_0x73aabe){if(_0x73aabe===_0xdb87('0x73')){_0x5a2ff6[_0xdb87('0x74')](_0xdb87('0x75'),[][_0xdb87('0x76')](_0x35e887[_0xdb87('0x3c')][_0x73aabe]));}else if(_0x73aabe===_0xdb87('0x77')){var _0x28ba93=JSON[_0xdb87('0x78')](_0x35e887[_0xdb87('0x3c')][_0x73aabe])[_0xdb87('0x79')];var _0x148fca=JSON['parse'](_0x35e887['query'][_0x73aabe])[_0xdb87('0x7a')];_0x5a2ff6[_0xdb87('0x74')](_0xdb87('0x7b'),_0x28ba93,_0x148fca);}else{if(_0x35e887[_0xdb87('0x3c')][_0x73aabe]===_0xdb87('0x7c')){_0x5a2ff6['where']('i.'+_0x73aabe+'\x20IS\x20NULL');}else{_0x5a2ff6[_0xdb87('0x74')]('i.'+_0x73aabe+_0xdb87('0x7d'),_0x35e887['query'][_0x73aabe]);}}});}if(_0x35e887['query'][_0xdb87('0x7e')]){if(_0x35e887['query'][_0xdb87('0x7e')]==0x1){_0x5a2ff6[_0xdb87('0x60')](_0xdb87('0x7f'));}else{_0x5a2ff6[_0xdb87('0x60')](_0xdb87('0x80'));}}if(_0x35e887[_0xdb87('0x3c')][_0xdb87('0x81')]){_0x5bf250=_[_0xdb87('0x82')](_0x35e887['query']['tag'])?_0x35e887[_0xdb87('0x3c')]['tag']:new Array(_0x35e887[_0xdb87('0x3c')][_0xdb87('0x81')]);_0x5bf250[_0xdb87('0x32')](function(_0x585bf0){_0x11421e['or'](_0xdb87('0x6e'),'%,'+_0x585bf0+',%');});}if(_0x35e887['query'][_0xdb87('0x83')]){var _0x9349f5=_0x35e887['query']['filter'][_0xdb87('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xdb87('0x85')](_0x9349f5)){_0x45dff4['or']('i.id\x20LIKE\x20?',_0x9349f5+'%')['or']('i.phone\x20LIKE\x20?',_0x9349f5+'%');}else{_0x45dff4['or'](_0xdb87('0x86'),qs[_0xdb87('0x87')](_0x9349f5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9349f5+'%');}}}_0x5a2ff6['where'](_0x45dff4);_0x5a2ff6[_0xdb87('0x88')](_0xdb87('0x89'));var _0xa67b8f={'type':db[_0xdb87('0x8a')][_0xdb87('0x8b')]['SELECT'],'raw':!![]};var _0x4dde42=_0x5a2ff6['clone']();_0x4dde42[_0xdb87('0x47')]('i.id');_0x4dde42[_0xdb87('0x47')](_0xdb87('0x8c'),_0xdb87('0x5e'));if(_0x51a7e7[_0xdb87('0x43')]){_0x51a7e7[_0xdb87('0x43')][_0xdb87('0x32')](function(_0xdf768c){var _0x3ea185=_0xdf768c[0x0]===_0xdb87('0x8d')?_0xdf768c[0x0]:'i.'+_0xdf768c[0x0];_0x5a2ff6[_0xdb87('0x43')](_0x3ea185,_0xdf768c[0x1]===_0xdb87('0x8e')?![]:!![]);});}if(!_[_0xdb87('0x8f')](_0x5bf250)){_0x5a2ff6[_0xdb87('0x60')](_0x11421e);_0x4dde42[_0xdb87('0x74')]('t.id\x20IN\x20?',_0x5bf250);}BPromise[_0xdb87('0x90')]()['then'](function(){if(!_0xb3955){if(_0x35e887[_0xdb87('0x3c')][_0xdb87('0x73')])return;_0x4dde42[_0xdb87('0x74')](_0xdb87('0x91'));_0x5a2ff6['where'](_0xdb87('0x91'));return;}if(_0x35e887[_0xdb87('0x92')][_0xdb87('0x93')]!==_0xdb87('0x94'))return;return _0x35e887[_0xdb87('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xdb87('0x29')](function(_0x2b80c7){if(_[_0xdb87('0x8f')](_0x2b80c7)){_0x4dde42[_0xdb87('0x74')](_0xdb87('0x95'));_0x5a2ff6['where'](_0xdb87('0x95'));}else{_0x4dde42[_0xdb87('0x74')](_0xdb87('0x75'),_['map'](_0x2b80c7,'id'));_0x5a2ff6[_0xdb87('0x74')](_0xdb87('0x75'),_[_0xdb87('0x2e')](_0x2b80c7,'id'));}});})[_0xdb87('0x29')](function(){if(_0x35e887[_0xdb87('0x92')]['role']===_0xdb87('0x94')&&!_0xb3955&&!_0x35e887[_0xdb87('0x3c')][_0xdb87('0x73')])return[];return db['sequelize']['query'](_0x4dde42[_0xdb87('0x96')](),_0xa67b8f);})[_0xdb87('0x29')](function(_0x14e7e6){_0x17da6e[_0xdb87('0x24')]=_0x14e7e6[_0xdb87('0x5c')];if(_0x17da6e[_0xdb87('0x24')]===0x0)return[];return db[_0xdb87('0x97')][_0xdb87('0x3c')](_0xfc4e15['toString'](),_0xa67b8f)[_0xdb87('0x29')](function(_0x1ac583){_0x28a74a=_[_0xdb87('0x98')](_0x1ac583,'id');_0xa67b8f=_[_0xdb87('0x99')](_0xa67b8f,{'model':db[_0xdb87('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35e887[_0xdb87('0x3c')][_0xdb87('0x3f')]){_0x51a7e7[_0xdb87('0x3d')][_0xdb87('0x32')](function(_0x5b3e73){_0x5a2ff6[_0xdb87('0x47')]('i.'+_0x5b3e73);});}else{_0x5a2ff6['field'](_0xdb87('0x8c'),_0xdb87('0x5e'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0x9b'),_0xdb87('0x9c'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0x9d'),_0xdb87('0x9e'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0x9f'),_0xdb87('0x8d'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0xa0'));_0x5a2ff6['field'](_0xdb87('0xa1'),'Contact.firstName');_0x5a2ff6[_0xdb87('0x47')]('c.lastName','Contact.lastName');_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0xa2'),_0xdb87('0xa3'));_0x5a2ff6['field'](_0xdb87('0xa4'),_0xdb87('0xa5'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0xa6'),'Contact.mobile');_0x5a2ff6['field']('c.fax','Contact.fax');_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0xa7'),_0xdb87('0xa8'));_0x5a2ff6['field'](_0xdb87('0xa9'),_0xdb87('0xaa'));_0x5a2ff6[_0xdb87('0x47')](_0xdb87('0xab'),_0xdb87('0x30'));}if(_0x51a7e7[_0xdb87('0x42')])_0x5a2ff6[_0xdb87('0x42')](_0x51a7e7[_0xdb87('0x42')]);if(_0x51a7e7[_0xdb87('0x22')])_0x5a2ff6[_0xdb87('0x22')](_0x51a7e7[_0xdb87('0x22')]);return db[_0xdb87('0x97')][_0xdb87('0x3c')](_0x5a2ff6[_0xdb87('0x96')](),_0xa67b8f);})['then'](function(_0x209ceb){if(_0x209ceb['length']>0x0)_0x5ed987['where'](_0xdb87('0xac'),_[_0xdb87('0x2e')](_0x209ceb,'id'));return db['sequelize'][_0xdb87('0x3c')](_0x5ed987['toString'](),_0xa67b8f)[_0xdb87('0x29')](function(_0x1cfd5c){var _0x165f65=_[_0xdb87('0xad')](_0x1cfd5c,_0xdb87('0xae'));var _0x160d7e=[];_0x209ceb[_0xdb87('0x32')](function(_0x40d0d3){_0x160d7e[_0xdb87('0x33')](updateSmsInteraction(_0x40d0d3,_0x28a74a,_0x165f65));});return BPromise['all'](_0x160d7e);});});})['then'](function(_0x2a7015){_0x17da6e[_0xdb87('0xaf')]=_0x2a7015;return _0x17da6e;})[_0xdb87('0x29')](respondWithFilteredResult(_0x5b9afc,_0x51a7e7))[_0xdb87('0x34')](handleError(_0x5b9afc,null));};exports[_0xdb87('0xb0')]=function(_0x1a1ca9,_0x73b6b3){var _0xfddba={'raw':![],'where':{'id':_0x1a1ca9[_0xdb87('0xb1')]['id']}},_0x41aaf8={};_0x41aaf8[_0xdb87('0x39')]=_[_0xdb87('0x3a')](db[_0xdb87('0x9a')][_0xdb87('0x35')]);_0x41aaf8[_0xdb87('0x3c')]=_[_0xdb87('0x3a')](_0x1a1ca9[_0xdb87('0x3c')]);_0x41aaf8['filters']=_['intersection'](_0x41aaf8[_0xdb87('0x39')],_0x41aaf8[_0xdb87('0x3c')]);_0xfddba[_0xdb87('0x3d')]=_['intersection'](_0x41aaf8[_0xdb87('0x39')],qs[_0xdb87('0x3f')](_0x1a1ca9['query'][_0xdb87('0x3f')]));_0xfddba[_0xdb87('0x3d')]=_0xfddba[_0xdb87('0x3d')][_0xdb87('0x5c')]?_0xfddba[_0xdb87('0x3d')]:_0x41aaf8[_0xdb87('0x39')];if(_0x1a1ca9['query']['includeAll']){_0xfddba[_0xdb87('0xb2')]=[{'all':!![]}];}_0xfddba=_[_0xdb87('0x99')]({},_0xfddba,_0x1a1ca9[_0xdb87('0xb3')]);return db[_0xdb87('0x9a')][_0xdb87('0x5d')](_0xfddba)[_0xdb87('0x29')](handleEntityNotFound(_0x73b6b3,null))[_0xdb87('0x29')](respondWithResult(_0x73b6b3,null))[_0xdb87('0x34')](handleError(_0x73b6b3,null));};exports['create']=function(_0x4d89ae,_0x508f09){return db[_0xdb87('0x9a')][_0xdb87('0xb4')](_0x4d89ae['body'],{})[_0xdb87('0x29')](respondWithResult(_0x508f09,0xc9))['catch'](handleError(_0x508f09,null));};exports[_0xdb87('0x28')]=function(_0x295009,_0x229cd2){if(_0x295009['body']['id']){delete _0x295009[_0xdb87('0xb5')]['id'];}return db[_0xdb87('0x9a')]['find']({'where':{'id':_0x295009['params']['id']}})['then'](handleEntityNotFound(_0x229cd2,null))[_0xdb87('0x29')](saveUpdates(_0x295009[_0xdb87('0xb5')],null))[_0xdb87('0x29')](respondWithResult(_0x229cd2,null))[_0xdb87('0x34')](handleError(_0x229cd2,null));};exports[_0xdb87('0x2a')]=function(_0x14eb0d,_0x4b7f7d){return db['SmsInteraction'][_0xdb87('0x5d')]({'where':{'id':_0x14eb0d[_0xdb87('0xb1')]['id']}})[_0xdb87('0x29')](handleEntityNotFound(_0x4b7f7d,null))[_0xdb87('0x29')](removeEntity(_0x4b7f7d,null))[_0xdb87('0x34')](handleError(_0x4b7f7d,null));};exports[_0xdb87('0xb6')]=function(_0x5bc6de,_0x553b1a){return db['SmsInteraction'][_0xdb87('0xb6')]()[_0xdb87('0x29')](respondWithResult(_0x553b1a,null))['catch'](handleError(_0x553b1a,null));};exports[_0xdb87('0xb7')]=function(_0x277876,_0x5be32f,_0x569bab){return db['SmsMessage'][_0xdb87('0x5d')]({'where':{'id':_0x277876[_0xdb87('0xb1')]['id']}})[_0xdb87('0x29')](handleEntityNotFound(_0x5be32f,null))['then'](function(_0x4b4cd3){if(_0x4b4cd3){return _0x4b4cd3[_0xdb87('0xb7')](_0x277876[_0xdb87('0xb5')]['ids'],_[_0xdb87('0xb8')](_0x277876[_0xdb87('0xb5')],[_0xdb87('0xb9'),'id'])||{});}})[_0xdb87('0x29')](respondWithResult(_0x5be32f,null))[_0xdb87('0x34')](handleError(_0x5be32f,null));};exports[_0xdb87('0xba')]=function(_0x3d60ba,_0x333a28,_0x1aa06b){var _0x323e88={'raw':![],'where':{}};var _0x17ada0={};var _0x545926={'count':0x0,'rows':[]};return db[_0xdb87('0x9a')][_0xdb87('0xbb')]({'where':{'id':_0x3d60ba['params']['id']}})[_0xdb87('0x29')](handleEntityNotFound(_0x333a28,null))['then'](function(_0x59980f){if(_0x59980f){_0x17ada0['model']=_[_0xdb87('0x3a')](db[_0xdb87('0xbc')][_0xdb87('0x35')]);_0x17ada0[_0xdb87('0x3c')]=_['keys'](_0x3d60ba['query']);_0x17ada0['filters']=_[_0xdb87('0x3e')](_0x17ada0[_0xdb87('0x39')],_0x17ada0[_0xdb87('0x3c')]);_0x323e88[_0xdb87('0x3d')]=_['intersection'](_0x17ada0[_0xdb87('0x39')],qs[_0xdb87('0x3f')](_0x3d60ba['query'][_0xdb87('0x3f')]));_0x323e88[_0xdb87('0x3d')]=_0x323e88[_0xdb87('0x3d')][_0xdb87('0x5c')]?_0x323e88[_0xdb87('0x3d')]:_0x17ada0[_0xdb87('0x39')];if(!_0x3d60ba[_0xdb87('0x3c')][_0xdb87('0x40')]('nolimit')){_0x323e88['limit']=qs[_0xdb87('0x42')](_0x3d60ba['query'][_0xdb87('0x42')]);_0x323e88[_0xdb87('0x22')]=qs['offset'](_0x3d60ba[_0xdb87('0x3c')][_0xdb87('0x22')]);}_0x323e88['order']=qs['sort'](_0x3d60ba[_0xdb87('0x3c')][_0xdb87('0x44')]);_0x323e88[_0xdb87('0x74')]=qs[_0xdb87('0x3b')](_[_0xdb87('0x45')](_0x3d60ba[_0xdb87('0x3c')],_0x17ada0[_0xdb87('0x3b')]));_0x323e88[_0xdb87('0x74')][_0xdb87('0xae')]=_0x59980f['id'];if(_0x3d60ba['query'][_0xdb87('0x83')]){_0x323e88[_0xdb87('0x74')]=_[_0xdb87('0x99')](_0x323e88[_0xdb87('0x74')],{'$or':_[_0xdb87('0x2e')](_0x323e88['attributes'],function(_0x52b41b){var _0x360504={};_0x360504[_0x52b41b]={'$like':'%'+_0x3d60ba['query'][_0xdb87('0x83')]+'%'};return _0x360504;})});}if(_0x3d60ba[_0xdb87('0x3c')][_0xdb87('0x79')]){var _0x5596ef=_0x3d60ba[_0xdb87('0x3c')][_0xdb87('0x79')][_0xdb87('0x31')](',');var _0x373513={};_0x373513[_0x5596ef[0x0]]={'$gte':moment(_0x5596ef[0x1])[_0xdb87('0xbd')](_0xdb87('0xbe'))};_0x323e88[_0xdb87('0x74')]=_['merge'](_0x323e88[_0xdb87('0x74')],_0x373513);}_0x323e88=_[_0xdb87('0x99')]({},_0x323e88,_0x3d60ba[_0xdb87('0xb3')]);return db[_0xdb87('0xbc')][_0xdb87('0x24')]({'where':_0x323e88['where']})[_0xdb87('0x29')](function(_0x581844){_0x545926[_0xdb87('0x24')]=_0x581844;if(_0x3d60ba['query'][_0xdb87('0xbf')]){_0x323e88['include']=[{'all':!![]}];}return db[_0xdb87('0xbc')]['findAll'](_0x323e88);})[_0xdb87('0x29')](function(_0x37a5c5){_0x545926[_0xdb87('0xaf')]=_0x37a5c5;return _0x545926;});}})[_0xdb87('0x29')](respondWithFilteredResult(_0x333a28,_0x323e88))[_0xdb87('0x34')](handleError(_0x333a28,null));};exports[_0xdb87('0xc0')]=function(_0x6f1ddd,_0x2d57cf,_0x452a64){return db['SmsInteraction'][_0xdb87('0x5d')]({'where':{'id':_0x6f1ddd[_0xdb87('0xb1')]['id']}})[_0xdb87('0x29')](handleEntityNotFound(_0x2d57cf,null))[_0xdb87('0x29')](function(_0x424210){if(_0x424210){return _0x424210[_0xdb87('0xc1')](_0x6f1ddd[_0xdb87('0xb5')][_0xdb87('0xb9')],_['omit'](_0x6f1ddd[_0xdb87('0xb5')],['ids','id'])||{})[_0xdb87('0xc2')](function(){return db[_0xdb87('0x6d')]['findAll']({'attributes':['id',_0xdb87('0x2d'),_0xdb87('0x48')],'where':{'id':_0x6f1ddd[_0xdb87('0xb5')]['ids']}});})[_0xdb87('0x29')](function(_0x5e19c6){socket[_0xdb87('0xc3')]('smsInteractionTags:save',{'id':Number(_0x6f1ddd[_0xdb87('0xb1')]['id']),'tags':_0x5e19c6||[]});return{'id':Number(_0x6f1ddd[_0xdb87('0xb1')]['id']),'tags':_0x5e19c6||[]};});}})[_0xdb87('0x29')](respondWithResult(_0x2d57cf,null))[_0xdb87('0x34')](handleError(_0x2d57cf,null));};exports[_0xdb87('0xc4')]=function(_0x232485,_0x379b55,_0x5c4917){return db[_0xdb87('0x9a')][_0xdb87('0x5d')]({'where':{'id':_0x232485[_0xdb87('0xb1')]['id']}})['then'](handleEntityNotFound(_0x379b55,null))[_0xdb87('0x29')](function(_0x12e491){if(_0x12e491){return _0x12e491[_0xdb87('0xc4')](_0x232485[_0xdb87('0x3c')][_0xdb87('0xb9')]);}})['then'](respondWithStatusCode(_0x379b55,null))[_0xdb87('0x34')](handleError(_0x379b55,null));};exports['download']=function(_0x332557,_0x1d97bd){var _0x2c03ba=moment()[_0xdb87('0xc5')]()[_0xdb87('0x96')]();var _0x14cc4d=path[_0xdb87('0xc6')](config[_0xdb87('0xc7')],_0xdb87('0xc8'),_0xdb87('0xc9'),_0xdb87('0xca'));var _0x741f6d=path[_0xdb87('0xc6')](config['root'],_0xdb87('0xc8'),_0xdb87('0xc9'),_0xdb87('0xcb'));var _0x51ebe0=path[_0xdb87('0xc6')](_0x14cc4d,_0x2c03ba);var _0x29f6b7=util['format'](_0xdb87('0xcc'),_0x332557['params']['id'],_0x2c03ba);var _0x11175f=path['join'](_0x14cc4d,_0x29f6b7);var _0x568800=[];_0x568800[_0xdb87('0x33')]({'model':db['User'],'as':_0xdb87('0xcd'),'attributes':['id','fullname'],'raw':!![]});_0x568800['push']({'model':db[_0xdb87('0xce')],'as':_0xdb87('0x63'),'attributes':['id',_0xdb87('0xcf'),'lastName'],'raw':!![]});var _0x5da871=[{'model':db[_0xdb87('0xbc')],'as':_0xdb87('0xd0'),'attributes':['id',_0xdb87('0xb5'),_0xdb87('0x77'),_0xdb87('0xd1'),'secret','read'],'include':_0x568800}];_0x5da871[_0xdb87('0x33')]({'model':db[_0xdb87('0xd2')],'as':_0xdb87('0xd3'),'attributes':['id',_0xdb87('0x2d')]});_0x5da871['push']({'model':db[_0xdb87('0xcd')],'as':'Owner','attributes':['id',_0xdb87('0xd4')]});return db[_0xdb87('0x9a')][_0xdb87('0x5d')]({'where':{'id':_0x332557[_0xdb87('0xb1')]['id']},'include':_0x5da871})[_0xdb87('0x29')](handleEntityNotFound(_0x1d97bd,null))['then'](function(_0x20ae44){if(_0x20ae44){var _0x1b07bd=_0x20ae44[_0xdb87('0xd5')]({'plain':!![]});fs[_0xdb87('0xd6')](_0x51ebe0);var _0x50afc3={'channel':_0xdb87('0xd7'),'account':_0x1b07bd[_0xdb87('0xd3')][_0xdb87('0x2d')],'agent':_0x1b07bd[_0xdb87('0xd8')]?_0x1b07bd[_0xdb87('0xd8')][_0xdb87('0xd4')]:_0xdb87('0xd9'),'createdAt':moment(_0x1b07bd[_0xdb87('0x77')])['format'](_0xdb87('0xbe'))[_0xdb87('0x96')](),'closedAt':_0x1b07bd[_0xdb87('0xda')]?moment(_0x1b07bd[_0xdb87('0xdb')])[_0xdb87('0xbd')](_0xdb87('0xbe'))[_0xdb87('0x96')]():'','disposition':_0x1b07bd[_0xdb87('0xdc')],'messages':_(_0x1b07bd[_0xdb87('0xd0')])[_0xdb87('0x83')]({'secret':![]})[_0xdb87('0x2e')](function(_0x397000){return{'date':moment(_0x397000[_0xdb87('0x77')])[_0xdb87('0xbd')](_0xdb87('0xbe'))[_0xdb87('0x96')](),'sender':_0x397000['direction']==='out'?_0x397000[_0xdb87('0xcd')]?_0x397000[_0xdb87('0xcd')]['fullname']:_0xdb87('0xdd'):_0x397000[_0xdb87('0x63')][_0xdb87('0xcf')]+(_0x397000[_0xdb87('0x63')][_0xdb87('0xde')]?'\x20'+_0x397000['Contact'][_0xdb87('0xde')]:''),'body':_0x397000[_0xdb87('0xb5')],'direction':_0x397000[_0xdb87('0xd1')]===_0xdb87('0xdf')?'A':'C','secret':_0x397000['secret'],'read':_0x397000[_0xdb87('0x7e')]};})['value']()};return ejs[_0xdb87('0xe0')](path[_0xdb87('0xc6')](config['root'],_0xdb87('0xc8'),_0xdb87('0xe1'),_0xdb87('0xe2')),{'interaction':_0x50afc3})[_0xdb87('0x29')](function(_0x5489e4){var _0xb79ae8=path[_0xdb87('0xc6')](_0x51ebe0,_0xdb87('0xe3')+_0x1b07bd['id']+'-'+_0x2c03ba+_0xdb87('0xe4'));var _0x530302={'path':_0xb79ae8,'channel':'Sms','interactionId':_0x1b07bd['id']};return pdf[_0xdb87('0xe5')](_0x5489e4,_0x530302);})[_0xdb87('0x29')](function(){return new BPromise(function(_0x2ac1d7,_0x1cda84){zipdir(_0x51ebe0,{'saveTo':_0x11175f},function(_0x57f3a1,_0x3b6f6b){if(_0x57f3a1)return _0x1cda84(_0x57f3a1);return _0x2ac1d7(_0x3b6f6b);});})[_0xdb87('0x29')](function(){return new BPromise(function(_0x501339,_0x442baf){rimraf(_0x51ebe0,function(_0x52a557){if(_0x52a557)_0x442baf(_0x52a557);return _0x501339();});});})[_0xdb87('0x29')](function(){return _0x1d97bd[_0xdb87('0xe6')](_0x11175f,_0x29f6b7,function(_0x4dfccc){if(_0x4dfccc){console['log'](_0xdb87('0xe7'),_0x4dfccc);}else{fs[_0xdb87('0xe8')](_0x11175f);}});});});}else{return _0x1d97bd[_0xdb87('0x1f')](0xc8);}})['catch'](handleError(_0x1d97bd,null));};
\ No newline at end of file
+var _0xb385=['create','params','describe','addMessage','SmsMessage','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','ids','emit','download','unix','join','root','server','files','tmp','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','out','System','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../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','register','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','SmsInteraction','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','text','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','SmsInteractionId','show','rawAttributes','includeAll','include','options'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xb385,0x109));var _0x5b38=function(_0x548baa,_0x37846f){_0x548baa=_0x548baa-0x0;var _0x289be5=_0xb385[_0x548baa];return _0x289be5;};'use strict';var emlformat=require(_0x5b38('0x0'));var rimraf=require(_0x5b38('0x1'));var zipdir=require(_0x5b38('0x2'));var jsonpatch=require(_0x5b38('0x3'));var rp=require('request-promise');var moment=require(_0x5b38('0x4'));var BPromise=require(_0x5b38('0x5'));var Mustache=require(_0x5b38('0x6'));var util=require(_0x5b38('0x7'));var path=require(_0x5b38('0x8'));var sox=require('sox');var csv=require(_0x5b38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b38('0xa'));var _=require(_0x5b38('0xb'));var squel=require('squel');var crypto=require(_0x5b38('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5b38('0xd'));var toCsv=require(_0x5b38('0x9'));var querystring=require(_0x5b38('0xe'));var Papa=require('papaparse');var Redis=require(_0x5b38('0xf'));var authService=require(_0x5b38('0x10'));var qs=require(_0x5b38('0x11'));var as=require(_0x5b38('0x12'));var pdf=require(_0x5b38('0x13'));var hardwareService=require(_0x5b38('0x14'));var logger=require(_0x5b38('0x15'))('api');var utils=require(_0x5b38('0x16'));var config=require(_0x5b38('0x17'));var licenseUtil=require(_0x5b38('0x18'));var db=require(_0x5b38('0x19'))['db'];config[_0x5b38('0x1a')]=_[_0x5b38('0x1b')](config[_0x5b38('0x1a')],{'host':_0x5b38('0x1c'),'port':0x18eb});var socket=require(_0x5b38('0x1d'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x5b38('0x1e')](socket);function respondWithStatusCode(_0x305d17,_0x38c4dd){_0x38c4dd=_0x38c4dd||0xcc;return function(_0x58400d){if(_0x58400d){return _0x305d17[_0x5b38('0x1f')](_0x38c4dd);}return _0x305d17[_0x5b38('0x20')](_0x38c4dd)[_0x5b38('0x21')]();};}function respondWithResult(_0x2b00c5,_0x2cf66f){_0x2cf66f=_0x2cf66f||0xc8;return function(_0x490864){if(_0x490864){return _0x2b00c5[_0x5b38('0x20')](_0x2cf66f)['json'](_0x490864);}};}function respondWithFilteredResult(_0x33357b,_0x40d182){return function(_0x3d5e57){if(_0x3d5e57){var _0x45dfcc=typeof _0x40d182[_0x5b38('0x22')]==='undefined'&&typeof _0x40d182['limit']==='undefined';var _0x111da3=_0x3d5e57[_0x5b38('0x23')];var _0x592c05=_0x45dfcc?0x0:_0x40d182[_0x5b38('0x22')];var _0x3d03ba=_0x45dfcc?_0x3d5e57[_0x5b38('0x23')]:_0x40d182['offset']+_0x40d182[_0x5b38('0x24')];var _0x51a277;if(_0x3d03ba>=_0x111da3){_0x3d03ba=_0x111da3;_0x51a277=0xc8;}else{_0x51a277=0xce;}_0x33357b[_0x5b38('0x20')](_0x51a277);return _0x33357b[_0x5b38('0x25')](_0x5b38('0x26'),_0x592c05+'-'+_0x3d03ba+'/'+_0x111da3)[_0x5b38('0x27')](_0x3d5e57);}return null;};}function patchUpdates(_0x5ed8a8){return function(_0x83bba0){try{jsonpatch[_0x5b38('0x28')](_0x83bba0,_0x5ed8a8,!![]);}catch(_0x530152){return BPromise[_0x5b38('0x29')](_0x530152);}return _0x83bba0[_0x5b38('0x2a')]();};}function saveUpdates(_0x3be216,_0x7b3ad5){return function(_0x26e784){if(_0x26e784){return _0x26e784[_0x5b38('0x2b')](_0x3be216)[_0x5b38('0x2c')](function(_0x4b1398){return _0x4b1398;});}return null;};}function removeEntity(_0x40ae94,_0x50203f){return function(_0x49e1f9){if(_0x49e1f9){return _0x49e1f9[_0x5b38('0x2d')]()['then'](function(){_0x40ae94[_0x5b38('0x20')](0xcc)[_0x5b38('0x21')]();});}};}function handleEntityNotFound(_0x482a20,_0x580e68){return function(_0x347a81){if(!_0x347a81){_0x482a20[_0x5b38('0x1f')](0x194);}return _0x347a81;};}function handleError(_0xabf9d,_0x5d7ecb){_0x5d7ecb=_0x5d7ecb||0x1f4;return function(_0x110b9c){logger['error'](_0x110b9c[_0x5b38('0x2e')]);if(_0x110b9c[_0x5b38('0x2f')]){delete _0x110b9c['name'];}_0xabf9d[_0x5b38('0x20')](_0x5d7ecb)[_0x5b38('0x30')](_0x110b9c);};}function getInteractionUsers(_0x349c05,_0x5b9927){return new BPromise(function(_0x57f01f,_0x4c3309){try{if(_0x5b9927[_0x349c05['id']]){_0x349c05['Users']=_[_0x5b38('0x31')](_0x5b9927[_0x349c05['id']],function(_0x5e9768){return{'id':_0x5e9768['id'],'fullname':_0x5e9768[_0x5b38('0x32')]};});}}catch(_0x1895d9){_0x4c3309(_0x1895d9);}_0x57f01f(_0x349c05);});}function getInteractionTags(_0x1fcc8c,_0x2cf8f1){return new BPromise(function(_0x1ce79a,_0x5d4ffe){try{if(_0x1fcc8c[_0x5b38('0x33')]){_0x1fcc8c[_0x5b38('0x34')]=[];_0x1fcc8c[_0x5b38('0x33')][_0x5b38('0x35')](',')[_0x5b38('0x36')](function(_0x404e1a){_0x1fcc8c[_0x5b38('0x34')][_0x5b38('0x37')](_0x2cf8f1[_0x404e1a]);});}delete _0x1fcc8c[_0x5b38('0x33')];}catch(_0x3dbdc9){_0x5d4ffe(_0x3dbdc9);}_0x1ce79a(_0x1fcc8c);});}function updateSmsInteraction(_0x14bf31,_0xe24ac9,_0x8d9172){return new BPromise(function(_0x42710c,_0x59806b){return getInteractionUsers(_0x14bf31,_0x8d9172)[_0x5b38('0x2c')](function(_0x26f06f){return getInteractionTags(_0x26f06f,_0xe24ac9);})[_0x5b38('0x2c')](function(_0x377bb2){_0x42710c(_0x377bb2);})[_0x5b38('0x38')](function(_0x36faa8){_0x59806b(_0x36faa8);});});}exports['index']=function(_0x12ddb7,_0x28e738){var _0x38a115={},_0xa0656={},_0x1ba505={'count':0x0,'rows':[]};var _0xd7c485=_['map'](db[_0x5b38('0x39')]['rawAttributes'],function(_0x2a1d6d){return{'name':_0x2a1d6d['fieldName'],'type':_0x2a1d6d[_0x5b38('0x3a')][_0x5b38('0x3b')]};});_0xa0656[_0x5b38('0x3c')]=_[_0x5b38('0x31')](_0xd7c485,_0x5b38('0x2f'));_0xa0656[_0x5b38('0x3d')]=_[_0x5b38('0x3e')](_0x12ddb7[_0x5b38('0x3d')]);_0xa0656[_0x5b38('0x3f')]=_['intersection'](_0xa0656['model'],_0xa0656['query']);_0x38a115[_0x5b38('0x40')]=_[_0x5b38('0x41')](_0xa0656[_0x5b38('0x3c')],qs[_0x5b38('0x42')](_0x12ddb7['query']['fields']));_0x38a115[_0x5b38('0x40')]=_0x38a115[_0x5b38('0x40')][_0x5b38('0x43')]?_0x38a115[_0x5b38('0x40')]:_0xa0656[_0x5b38('0x3c')];if(!_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x44')](_0x5b38('0x45'))){_0x38a115[_0x5b38('0x24')]=qs[_0x5b38('0x24')](_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x24')]);_0x38a115[_0x5b38('0x22')]=qs[_0x5b38('0x22')](_0x12ddb7[_0x5b38('0x3d')]['offset']);}_0x38a115[_0x5b38('0x46')]=qs[_0x5b38('0x47')](_0x12ddb7['query']['sort']);_0x38a115[_0x5b38('0x48')]=qs[_0x5b38('0x3f')](_['pick'](_0x12ddb7['query'],_0xa0656[_0x5b38('0x3f')]),_0xd7c485);var _0x9d22ab=[];var _0x3f4037=squel[_0x5b38('0x49')]()[_0x5b38('0x4a')]('id')[_0x5b38('0x4a')](_0x5b38('0x2f'))['field']('color')[_0x5b38('0x4b')](_0x5b38('0x4c'));var _0x458694=squel[_0x5b38('0x49')]()['field'](_0x5b38('0x4d'))[_0x5b38('0x4a')](_0x5b38('0x4e'))[_0x5b38('0x4a')](_0x5b38('0x4f'))[_0x5b38('0x4b')](_0x5b38('0x50'),'ui')[_0x5b38('0x51')]('users','u','u.id\x20=\x20ui.UserId');var _0x5ab307=squel['select']()[_0x5b38('0x4b')](_0x5b38('0x52'),'i')[_0x5b38('0x51')](_0x5b38('0x53'),'c',_0x5b38('0x54'))[_0x5b38('0x51')](_0x5b38('0x55'),'o',_0x5b38('0x56'))[_0x5b38('0x51')](_0x5b38('0x57'),'a',_0x5b38('0x58'))[_0x5b38('0x51')]('sms_messages','me',_0x5b38('0x59'))['left_join']('sms_interaction_has_tags','it',_0x5b38('0x5a'))[_0x5b38('0x51')]('tools_tags','t',_0x5b38('0x5b'));var _0x46b18c=squel[_0x5b38('0x5c')]();var _0x896eec=[];var _0x30db65=squel['expr']();var _0x3c7ce0;if(_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x5d')]){_0x3c7ce0=as[_0x5b38('0x5e')](_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x5d')]);var _0x286b86=_0x3c7ce0[_0x5b38('0x5f')];for(var _0x91e6ad=0x0;_0x91e6ad<_0x3c7ce0[_0x5b38('0x60')][_0x5b38('0x43')];_0x91e6ad++){var _0x29eb16=_0x3c7ce0[_0x5b38('0x60')][_0x91e6ad];var _0x17b368='i';var _0x2f7fee=_[_0x5b38('0x61')](_0xd7c485,['name',_0x29eb16[_0x5b38('0x4a')]]);if(!_0x2f7fee){switch(_0x29eb16[_0x5b38('0x4a')]){case _0x5b38('0x62'):if(_0x29eb16[_0x5b38('0x63')]==0x1){_0x5ab307[_0x5b38('0x64')]('`'+_0x29eb16[_0x5b38('0x4a')]+_0x5b38('0x65'));}else{_0x5ab307['having']('`'+_0x29eb16[_0x5b38('0x4a')]+_0x5b38('0x66'));}break;case _0x5b38('0x67'):if(_0x29eb16[_0x5b38('0x68')]==='$substring'){if(_0x29eb16[_0x5b38('0x63')]['split']('\x20')['length']>0x1){_0x46b18c[_0x286b86](_0x5b38('0x69'),qs[_0x5b38('0x6a')](_0x29eb16[_0x5b38('0x63')]),null);}else{var _0x24c9c3='%'+_0x29eb16[_0x5b38('0x63')]+'%';_0x46b18c[_0x286b86](_0x5b38('0x6b'),_0x24c9c3,_0x24c9c3,_0x24c9c3);}}else{_0x2f7fee=_['find'](_0xd7c485,['name',_0x5b38('0x6c')]);_0x29eb16[_0x5b38('0x4a')]=_0x5b38('0x6c');_0x3ae61b=as[_0x5b38('0x6d')](_0x17b368,_0x2f7fee[_0x5b38('0x3a')],_0x29eb16);_0x46b18c[_0x286b86](_0x3ae61b['text'],_0x3ae61b[_0x5b38('0x63')]['start'],_0x3ae61b[_0x5b38('0x63')]['end']);}break;case'Tag':var _0x5084b5=_0x29eb16[_0x5b38('0x63')][_0x5b38('0x35')](',')['map'](function(_0x2486b4){return Number(_0x2486b4);});_0x5084b5[_0x5b38('0x36')](function(_0x29b92f){_0x30db65['or'](_0x5b38('0x6e'),'%,'+_0x29b92f+',%');});_0x896eec=_[_0x5b38('0x6f')](_0x896eec,_0x5084b5);break;case _0x5b38('0x70'):if(_0x29eb16['operator']==='$substring'){_0x46b18c[_0x286b86](_0x5b38('0x71'),'%'+_0x29eb16[_0x5b38('0x63')]+'%',null);}else{_0x2f7fee=_[_0x5b38('0x61')](_0xd7c485,[_0x5b38('0x2f'),_0x5b38('0x72')]);_0x29eb16[_0x5b38('0x4a')]=_0x5b38('0x72');_0x3ae61b=as[_0x5b38('0x6d')](_0x17b368,_0x2f7fee[_0x5b38('0x3a')],_0x29eb16);_0x46b18c[_0x286b86](_0x3ae61b['text'],_0x3ae61b[_0x5b38('0x63')][_0x5b38('0x73')],_0x3ae61b[_0x5b38('0x63')][_0x5b38('0x21')]);}break;case _0x5b38('0x74'):_0x3ae61b=as['buildExpression']('me',null,_0x29eb16);_0x46b18c[_0x286b86](_0x3ae61b['text'],_0x3ae61b[_0x5b38('0x63')][_0x5b38('0x73')],_0x3ae61b[_0x5b38('0x63')][_0x5b38('0x21')]);break;}}else{var _0x3ae61b=as['buildExpression'](_0x17b368,_0x2f7fee[_0x5b38('0x3a')],_0x29eb16);_0x46b18c[_0x286b86](_0x3ae61b[_0x5b38('0x75')],_0x3ae61b[_0x5b38('0x63')]['start'],_0x3ae61b[_0x5b38('0x63')][_0x5b38('0x21')]);}}}else{var _0x4625a2=_(_0x12ddb7['query'])[_0x5b38('0x3e')]()[_0x5b38('0x31')](function(_0x26ad42){return _[_0x5b38('0x76')](_0xd7c485,[_0x5b38('0x2f'),_0x26ad42])?_0x26ad42:undefined;})[_0x5b38('0x77')]()[_0x5b38('0x63')]();if(!_[_0x5b38('0x78')](_0x4625a2)){_0x4625a2[_0x5b38('0x36')](function(_0x5b6860){if(_0x5b6860===_0x5b38('0x79')){_0x5ab307[_0x5b38('0x48')](_0x5b38('0x7a'),[][_0x5b38('0x7b')](_0x12ddb7[_0x5b38('0x3d')][_0x5b6860]));}else if(_0x5b6860===_0x5b38('0x7c')){var _0x374e85=JSON['parse'](_0x12ddb7[_0x5b38('0x3d')][_0x5b6860])[_0x5b38('0x7d')];var _0x4da000=JSON['parse'](_0x12ddb7[_0x5b38('0x3d')][_0x5b6860])[_0x5b38('0x7e')];_0x5ab307[_0x5b38('0x48')](_0x5b38('0x7f'),_0x374e85,_0x4da000);}else{if(_0x12ddb7[_0x5b38('0x3d')][_0x5b6860]==='null'){_0x5ab307[_0x5b38('0x48')]('i.'+_0x5b6860+_0x5b38('0x80'));}else{_0x5ab307[_0x5b38('0x48')]('i.'+_0x5b6860+_0x5b38('0x81'),_0x12ddb7['query'][_0x5b6860]);}}});}if(_0x12ddb7['query']['read']){if(_0x12ddb7['query'][_0x5b38('0x82')]==0x1){_0x5ab307['having'](_0x5b38('0x83'));}else{_0x5ab307[_0x5b38('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x12ddb7['query'][_0x5b38('0x84')]){_0x896eec=_['isArray'](_0x12ddb7['query'][_0x5b38('0x84')])?_0x12ddb7[_0x5b38('0x3d')]['tag']:new Array(_0x12ddb7[_0x5b38('0x3d')]['tag']);_0x896eec[_0x5b38('0x36')](function(_0x1701f1){_0x30db65['or'](_0x5b38('0x6e'),'%,'+_0x1701f1+',%');});}if(_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x85')]){var _0x4c54d6=_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x85')][_0x5b38('0x86')]('\x5c','\x5c\x5c')[_0x5b38('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4c54d6)){_0x46b18c['or']('i.id\x20LIKE\x20?',_0x4c54d6+'%')['or']('i.phone\x20LIKE\x20?',_0x4c54d6+'%');}else{_0x46b18c['or'](_0x5b38('0x87'),qs[_0x5b38('0x6a')](_0x4c54d6))['or'](_0x5b38('0x88'),_0x4c54d6+'%');}}}_0x5ab307['where'](_0x46b18c);_0x5ab307[_0x5b38('0x89')]('i.id');var _0x3f04a9={'type':db[_0x5b38('0x8a')][_0x5b38('0x8b')][_0x5b38('0x8c')],'raw':!![]};var _0x24ea6a=_0x5ab307['clone']();_0x24ea6a[_0x5b38('0x4a')](_0x5b38('0x8d'));_0x24ea6a[_0x5b38('0x4a')](_0x5b38('0x8e'),'unreadMessages');if(_0x38a115[_0x5b38('0x46')]){_0x38a115[_0x5b38('0x46')][_0x5b38('0x36')](function(_0x31c14d){var _0x213980=_0x31c14d[0x0]===_0x5b38('0x8f')?_0x31c14d[0x0]:'i.'+_0x31c14d[0x0];_0x5ab307[_0x5b38('0x46')](_0x213980,_0x31c14d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5b38('0x78')](_0x896eec)){_0x5ab307['having'](_0x30db65);_0x24ea6a[_0x5b38('0x48')](_0x5b38('0x90'),_0x896eec);}BPromise[_0x5b38('0x91')]()['then'](function(){if(!_0x3c7ce0){if(_0x12ddb7[_0x5b38('0x3d')][_0x5b38('0x79')])return;_0x24ea6a[_0x5b38('0x48')](_0x5b38('0x92'));_0x5ab307[_0x5b38('0x48')](_0x5b38('0x92'));return;}if(_0x12ddb7[_0x5b38('0x93')][_0x5b38('0x94')]!==_0x5b38('0x95'))return;return _0x12ddb7['user'][_0x5b38('0x96')]({'attributes':['id'],'raw':!![]})[_0x5b38('0x2c')](function(_0x352d72){if(_[_0x5b38('0x78')](_0x352d72)){_0x24ea6a[_0x5b38('0x48')](_0x5b38('0x97'));_0x5ab307[_0x5b38('0x48')](_0x5b38('0x97'));}else{_0x24ea6a[_0x5b38('0x48')](_0x5b38('0x7a'),_[_0x5b38('0x31')](_0x352d72,'id'));_0x5ab307[_0x5b38('0x48')]('i.SmsAccountId\x20IN\x20?',_[_0x5b38('0x31')](_0x352d72,'id'));}});})[_0x5b38('0x2c')](function(){if(_0x12ddb7['user']['role']==='agent'&&!_0x3c7ce0&&!_0x12ddb7['query'][_0x5b38('0x79')])return[];return db[_0x5b38('0x98')]['query'](_0x24ea6a['toString'](),_0x3f04a9);})['then'](function(_0x64093f){_0x1ba505[_0x5b38('0x23')]=_0x64093f['length'];if(_0x1ba505['count']===0x0)return[];return db[_0x5b38('0x98')][_0x5b38('0x3d')](_0x3f4037[_0x5b38('0x99')](),_0x3f04a9)['then'](function(_0x422e8c){_0x9d22ab=_[_0x5b38('0x9a')](_0x422e8c,'id');_0x3f04a9=_[_0x5b38('0x9b')](_0x3f04a9,{'model':db[_0x5b38('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12ddb7[_0x5b38('0x3d')]['fields']){_0x38a115['attributes'][_0x5b38('0x36')](function(_0x4ebaf3){_0x5ab307[_0x5b38('0x4a')]('i.'+_0x4ebaf3);});}else{_0x5ab307[_0x5b38('0x4a')](_0x5b38('0x8e'),_0x5b38('0x62'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0x9c'),_0x5b38('0x9d'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0x9e'),'Account.mandatoryDisposition');_0x5ab307[_0x5b38('0x4a')](_0x5b38('0x9f'),'contactName');_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xa0'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xa1'),_0x5b38('0xa2'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xa3'),_0x5b38('0xa4'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xa5'),_0x5b38('0xa6'));_0x5ab307['field'](_0x5b38('0xa7'),_0x5b38('0xa8'));_0x5ab307['field'](_0x5b38('0xa9'),_0x5b38('0xaa'));_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xab'),_0x5b38('0xac'));_0x5ab307['field'](_0x5b38('0xad'),'Owner.fullname');_0x5ab307[_0x5b38('0x4a')](_0x5b38('0xae'),_0x5b38('0xaf'));_0x5ab307[_0x5b38('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5b38('0x33'));}if(_0x38a115[_0x5b38('0x24')])_0x5ab307[_0x5b38('0x24')](_0x38a115[_0x5b38('0x24')]);if(_0x38a115[_0x5b38('0x22')])_0x5ab307['offset'](_0x38a115[_0x5b38('0x22')]);return db[_0x5b38('0x98')][_0x5b38('0x3d')](_0x5ab307[_0x5b38('0x99')](),_0x3f04a9);})[_0x5b38('0x2c')](function(_0x134125){if(_0x134125[_0x5b38('0x43')]>0x0)_0x458694[_0x5b38('0x48')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x134125,'id'));return db[_0x5b38('0x98')][_0x5b38('0x3d')](_0x458694['toString'](),_0x3f04a9)['then'](function(_0x564ece){var _0x4d2d61=_[_0x5b38('0xb0')](_0x564ece,_0x5b38('0xb1'));var _0x41dbe9=[];_0x134125[_0x5b38('0x36')](function(_0x1c6c18){_0x41dbe9[_0x5b38('0x37')](updateSmsInteraction(_0x1c6c18,_0x9d22ab,_0x4d2d61));});return BPromise['all'](_0x41dbe9);});});})[_0x5b38('0x2c')](function(_0x4357de){_0x1ba505['rows']=_0x4357de;return _0x1ba505;})[_0x5b38('0x2c')](respondWithFilteredResult(_0x28e738,_0x38a115))['catch'](handleError(_0x28e738,null));};exports[_0x5b38('0xb2')]=function(_0x3d165a,_0xca260c){var _0x5259b2={'raw':![],'where':{'id':_0x3d165a['params']['id']}},_0x41796c={};_0x41796c[_0x5b38('0x3c')]=_[_0x5b38('0x3e')](db[_0x5b38('0x39')][_0x5b38('0xb3')]);_0x41796c[_0x5b38('0x3d')]=_['keys'](_0x3d165a['query']);_0x41796c[_0x5b38('0x3f')]=_[_0x5b38('0x41')](_0x41796c['model'],_0x41796c[_0x5b38('0x3d')]);_0x5259b2['attributes']=_[_0x5b38('0x41')](_0x41796c[_0x5b38('0x3c')],qs[_0x5b38('0x42')](_0x3d165a[_0x5b38('0x3d')][_0x5b38('0x42')]));_0x5259b2[_0x5b38('0x40')]=_0x5259b2[_0x5b38('0x40')][_0x5b38('0x43')]?_0x5259b2['attributes']:_0x41796c[_0x5b38('0x3c')];if(_0x3d165a['query'][_0x5b38('0xb4')]){_0x5259b2[_0x5b38('0xb5')]=[{'all':!![]}];}_0x5259b2=_[_0x5b38('0x9b')]({},_0x5259b2,_0x3d165a[_0x5b38('0xb6')]);return db['SmsInteraction'][_0x5b38('0x61')](_0x5259b2)[_0x5b38('0x2c')](handleEntityNotFound(_0xca260c,null))[_0x5b38('0x2c')](respondWithResult(_0xca260c,null))['catch'](handleError(_0xca260c,null));};exports[_0x5b38('0xb7')]=function(_0x592c8b,_0x593160){return db['SmsInteraction'][_0x5b38('0xb7')](_0x592c8b[_0x5b38('0x74')],{})['then'](respondWithResult(_0x593160,0xc9))[_0x5b38('0x38')](handleError(_0x593160,null));};exports[_0x5b38('0x2b')]=function(_0x123cdc,_0x528001){if(_0x123cdc['body']['id']){delete _0x123cdc[_0x5b38('0x74')]['id'];}return db[_0x5b38('0x39')]['find']({'where':{'id':_0x123cdc[_0x5b38('0xb8')]['id']}})['then'](handleEntityNotFound(_0x528001,null))[_0x5b38('0x2c')](saveUpdates(_0x123cdc[_0x5b38('0x74')],null))['then'](respondWithResult(_0x528001,null))[_0x5b38('0x38')](handleError(_0x528001,null));};exports[_0x5b38('0x2d')]=function(_0x730142,_0x163e75){return db[_0x5b38('0x39')][_0x5b38('0x61')]({'where':{'id':_0x730142['params']['id']}})[_0x5b38('0x2c')](handleEntityNotFound(_0x163e75,null))[_0x5b38('0x2c')](removeEntity(_0x163e75,null))[_0x5b38('0x38')](handleError(_0x163e75,null));};exports[_0x5b38('0xb9')]=function(_0x2cd6c4,_0x306081){return db[_0x5b38('0x39')][_0x5b38('0xb9')]()[_0x5b38('0x2c')](respondWithResult(_0x306081,null))[_0x5b38('0x38')](handleError(_0x306081,null));};exports[_0x5b38('0xba')]=function(_0x2f8f7c,_0x3bae37,_0xb088bb){return db[_0x5b38('0xbb')][_0x5b38('0x61')]({'where':{'id':_0x2f8f7c[_0x5b38('0xb8')]['id']}})['then'](handleEntityNotFound(_0x3bae37,null))[_0x5b38('0x2c')](function(_0x3d1804){if(_0x3d1804){return _0x3d1804[_0x5b38('0xba')](_0x2f8f7c[_0x5b38('0x74')]['ids'],_['omit'](_0x2f8f7c[_0x5b38('0x74')],['ids','id'])||{});}})[_0x5b38('0x2c')](respondWithResult(_0x3bae37,null))['catch'](handleError(_0x3bae37,null));};exports['getMessages']=function(_0x2f6bf0,_0x38059d,_0x5ea4ad){var _0x31435c={'raw':![],'where':{}};var _0x2e5022={};var _0x4b61b9={'count':0x0,'rows':[]};return db[_0x5b38('0x39')][_0x5b38('0xbc')]({'where':{'id':_0x2f6bf0[_0x5b38('0xb8')]['id']}})['then'](handleEntityNotFound(_0x38059d,null))['then'](function(_0x3c7f6f){if(_0x3c7f6f){_0x2e5022[_0x5b38('0x3c')]=_[_0x5b38('0x3e')](db[_0x5b38('0xbb')][_0x5b38('0xb3')]);_0x2e5022[_0x5b38('0x3d')]=_[_0x5b38('0x3e')](_0x2f6bf0[_0x5b38('0x3d')]);_0x2e5022[_0x5b38('0x3f')]=_[_0x5b38('0x41')](_0x2e5022[_0x5b38('0x3c')],_0x2e5022[_0x5b38('0x3d')]);_0x31435c[_0x5b38('0x40')]=_['intersection'](_0x2e5022[_0x5b38('0x3c')],qs['fields'](_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x42')]));_0x31435c[_0x5b38('0x40')]=_0x31435c[_0x5b38('0x40')][_0x5b38('0x43')]?_0x31435c[_0x5b38('0x40')]:_0x2e5022[_0x5b38('0x3c')];if(!_0x2f6bf0['query'][_0x5b38('0x44')](_0x5b38('0x45'))){_0x31435c['limit']=qs['limit'](_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x24')]);_0x31435c[_0x5b38('0x22')]=qs['offset'](_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x22')]);}_0x31435c[_0x5b38('0x46')]=qs[_0x5b38('0x47')](_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x47')]);_0x31435c[_0x5b38('0x48')]=qs[_0x5b38('0x3f')](_[_0x5b38('0xbd')](_0x2f6bf0['query'],_0x2e5022[_0x5b38('0x3f')]));_0x31435c[_0x5b38('0x48')][_0x5b38('0xb1')]=_0x3c7f6f['id'];if(_0x2f6bf0['query'][_0x5b38('0x85')]){_0x31435c[_0x5b38('0x48')]=_[_0x5b38('0x9b')](_0x31435c[_0x5b38('0x48')],{'$or':_[_0x5b38('0x31')](_0x31435c[_0x5b38('0x40')],function(_0x1be85f){var _0x2eeb0b={};_0x2eeb0b[_0x1be85f]={'$like':'%'+_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x85')]+'%'};return _0x2eeb0b;})});}if(_0x2f6bf0[_0x5b38('0x3d')][_0x5b38('0x7d')]){var _0x2872e5=_0x2f6bf0['query'][_0x5b38('0x7d')][_0x5b38('0x35')](',');var _0x486992={};_0x486992[_0x2872e5[0x0]]={'$gte':moment(_0x2872e5[0x1])[_0x5b38('0xbe')](_0x5b38('0xbf'))};_0x31435c['where']=_[_0x5b38('0x9b')](_0x31435c[_0x5b38('0x48')],_0x486992);}_0x31435c=_[_0x5b38('0x9b')]({},_0x31435c,_0x2f6bf0[_0x5b38('0xb6')]);return db[_0x5b38('0xbb')][_0x5b38('0x23')]({'where':_0x31435c['where']})[_0x5b38('0x2c')](function(_0x12629a){_0x4b61b9['count']=_0x12629a;if(_0x2f6bf0['query'][_0x5b38('0xb4')]){_0x31435c[_0x5b38('0xb5')]=[{'all':!![]}];}return db[_0x5b38('0xbb')][_0x5b38('0xc0')](_0x31435c);})[_0x5b38('0x2c')](function(_0x21131c){_0x4b61b9['rows']=_0x21131c;return _0x4b61b9;});}})[_0x5b38('0x2c')](respondWithFilteredResult(_0x38059d,_0x31435c))['catch'](handleError(_0x38059d,null));};exports[_0x5b38('0xc1')]=function(_0x489413,_0x3cd07a,_0x210e0e){return db[_0x5b38('0x39')][_0x5b38('0x61')]({'where':{'id':_0x489413[_0x5b38('0xb8')]['id']}})[_0x5b38('0x2c')](handleEntityNotFound(_0x3cd07a,null))[_0x5b38('0x2c')](function(_0x29c0e8){if(_0x29c0e8){return _0x29c0e8['setTags'](_0x489413['body'][_0x5b38('0xc2')],_['omit'](_0x489413[_0x5b38('0x74')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x489413[_0x5b38('0x74')][_0x5b38('0xc2')]}});})['then'](function(_0x398c2f){socket[_0x5b38('0xc3')]('smsInteractionTags:save',{'id':Number(_0x489413[_0x5b38('0xb8')]['id']),'tags':_0x398c2f||[]});return{'id':Number(_0x489413[_0x5b38('0xb8')]['id']),'tags':_0x398c2f||[]};});}})[_0x5b38('0x2c')](respondWithResult(_0x3cd07a,null))[_0x5b38('0x38')](handleError(_0x3cd07a,null));};exports['removeTags']=function(_0x37181a,_0x1e45e1,_0x55c445){return db['SmsInteraction'][_0x5b38('0x61')]({'where':{'id':_0x37181a[_0x5b38('0xb8')]['id']}})[_0x5b38('0x2c')](handleEntityNotFound(_0x1e45e1,null))[_0x5b38('0x2c')](function(_0x1be1a0){if(_0x1be1a0){return _0x1be1a0['removeTags'](_0x37181a[_0x5b38('0x3d')]['ids']);}})[_0x5b38('0x2c')](respondWithStatusCode(_0x1e45e1,null))[_0x5b38('0x38')](handleError(_0x1e45e1,null));};exports[_0x5b38('0xc4')]=function(_0x4218d4,_0x1bdef3){var _0x518822=moment()[_0x5b38('0xc5')]()[_0x5b38('0x99')]();var _0x18a340=path[_0x5b38('0xc6')](config[_0x5b38('0xc7')],_0x5b38('0xc8'),_0x5b38('0xc9'),_0x5b38('0xca'));var _0x458eba=path[_0x5b38('0xc6')](config[_0x5b38('0xc7')],_0x5b38('0xc8'),_0x5b38('0xc9'),'attachments');var _0x40a967=path['join'](_0x18a340,_0x518822);var _0x130e50=util[_0x5b38('0xbe')]('transcript-%d-%s.zip',_0x4218d4[_0x5b38('0xb8')]['id'],_0x518822);var _0x169cdc=path[_0x5b38('0xc6')](_0x18a340,_0x130e50);var _0x2986bc=[];_0x2986bc['push']({'model':db[_0x5b38('0x70')],'as':_0x5b38('0x70'),'attributes':['id',_0x5b38('0x32')],'raw':!![]});_0x2986bc[_0x5b38('0x37')]({'model':db[_0x5b38('0xcb')],'as':_0x5b38('0x67'),'attributes':['id',_0x5b38('0xcc'),_0x5b38('0xcd')],'raw':!![]});var _0x59079f=[{'model':db[_0x5b38('0xbb')],'as':_0x5b38('0xce'),'attributes':['id',_0x5b38('0x74'),_0x5b38('0x7c'),_0x5b38('0xcf'),_0x5b38('0xd0'),'read'],'include':_0x2986bc}];_0x59079f[_0x5b38('0x37')]({'model':db[_0x5b38('0xd1')],'as':_0x5b38('0xd2'),'attributes':['id',_0x5b38('0x2f')]});_0x59079f[_0x5b38('0x37')]({'model':db['User'],'as':_0x5b38('0xd3'),'attributes':['id','fullname']});return db[_0x5b38('0x39')]['find']({'where':{'id':_0x4218d4[_0x5b38('0xb8')]['id']},'include':_0x59079f})[_0x5b38('0x2c')](handleEntityNotFound(_0x1bdef3,null))[_0x5b38('0x2c')](function(_0x3163ad){if(_0x3163ad){var _0x3656e0=_0x3163ad[_0x5b38('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x40a967);var _0x5862d3={'channel':_0x5b38('0xd5'),'account':_0x3656e0[_0x5b38('0xd2')][_0x5b38('0x2f')],'agent':_0x3656e0['Owner']?_0x3656e0['Owner'][_0x5b38('0x32')]:_0x5b38('0xd6'),'createdAt':moment(_0x3656e0[_0x5b38('0x7c')])['format'](_0x5b38('0xbf'))[_0x5b38('0x99')](),'closedAt':_0x3656e0[_0x5b38('0xd7')]?moment(_0x3656e0[_0x5b38('0xd8')])[_0x5b38('0xbe')](_0x5b38('0xbf'))[_0x5b38('0x99')]():'','disposition':_0x3656e0['disposition'],'messages':_(_0x3656e0[_0x5b38('0xce')])[_0x5b38('0x85')]({'secret':![]})['map'](function(_0x339a59){return{'date':moment(_0x339a59[_0x5b38('0x7c')])[_0x5b38('0xbe')](_0x5b38('0xbf'))[_0x5b38('0x99')](),'sender':_0x339a59[_0x5b38('0xcf')]===_0x5b38('0xd9')?_0x339a59[_0x5b38('0x70')]?_0x339a59[_0x5b38('0x70')][_0x5b38('0x32')]:_0x5b38('0xda'):_0x339a59[_0x5b38('0x67')][_0x5b38('0xcc')]+(_0x339a59[_0x5b38('0x67')][_0x5b38('0xcd')]?'\x20'+_0x339a59['Contact'][_0x5b38('0xcd')]:''),'body':_0x339a59[_0x5b38('0x74')],'direction':_0x339a59[_0x5b38('0xcf')]===_0x5b38('0xd9')?'A':'C','secret':_0x339a59[_0x5b38('0xd0')],'read':_0x339a59[_0x5b38('0x82')]};})[_0x5b38('0x63')]()};return ejs['renderFile'](path['join'](config[_0x5b38('0xc7')],_0x5b38('0xc8'),'views',_0x5b38('0xdb')),{'interaction':_0x5862d3})[_0x5b38('0x2c')](function(_0x382f60){var _0x5687a9=path['join'](_0x40a967,'transcript-'+_0x3656e0['id']+'-'+_0x518822+_0x5b38('0xdc'));var _0x359a43={'path':_0x5687a9,'channel':'Sms','interactionId':_0x3656e0['id']};return pdf[_0x5b38('0xdd')](_0x382f60,_0x359a43);})['then'](function(){return new BPromise(function(_0x25b01a,_0x2d2f57){zipdir(_0x40a967,{'saveTo':_0x169cdc},function(_0x30d084,_0x33bf14){if(_0x30d084)return _0x2d2f57(_0x30d084);return _0x25b01a(_0x33bf14);});})[_0x5b38('0x2c')](function(){return new BPromise(function(_0x5b2849,_0x21f447){rimraf(_0x40a967,function(_0x19e842){if(_0x19e842)_0x21f447(_0x19e842);return _0x5b2849();});});})[_0x5b38('0x2c')](function(){return _0x1bdef3[_0x5b38('0xc4')](_0x169cdc,_0x130e50,function(_0x18ce6a){if(_0x18ce6a){console[_0x5b38('0xde')](_0x5b38('0xdf'),_0x18ce6a);}else{fs['unlinkSync'](_0x169cdc);}});});});}else{return _0x1bdef3[_0x5b38('0x1f')](0xc8);}})[_0x5b38('0x38')](handleError(_0x1bdef3,null));};
\ No newline at end of file
index 2129201..7e2a811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cf=['update','remove','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x322719,_0x16b381){_0x322719=_0x322719-0x0;var _0x30cb6f=_0xe2cf[_0x322719];return _0x30cb6f;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xfe2c('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0xfe2c('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfe2c('0x1')](0x0);var events={'afterCreate':_0xfe2c('0x2'),'afterUpdate':_0xfe2c('0x3'),'afterDestroy':_0xfe2c('0x4')};function emitEvent(_0x494978){return function(_0xd40c31,_0x14674d,_0x55bb12){_0xd40c31['getUsers']({'attributes':['id'],'raw':!![]})[_0xfe2c('0x5')](function(_0x417bc4){_0xd40c31['setDataValue']('Users',_0x417bc4[_0xfe2c('0x6')](function(_0x2e2933){return{'id':_0x2e2933['id']};}));return SmsMessage[_0xfe2c('0x7')]({'where':{'SmsInteractionId':_0xd40c31['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b616c){_0xd40c31[_0xfe2c('0x8')](_0xfe2c('0x9'),_0x5b616c['length']);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978+':'+_0xd40c31['id'],_0xd40c31);SmsInteractionEvents[_0xfe2c('0xa')](_0x494978,_0xd40c31);_0x55bb12(null);})[_0xfe2c('0xb')](_0x55bb12(null));};}for(var e in events){if(events[_0xfe2c('0xc')](e)){var event=events[e];SmsInteraction[_0xfe2c('0xd')](e,emitEvent(event));}}module[_0xfe2c('0xe')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xb574=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','SmsMessage','save','update','remove','getUsers','map','findAll','then'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xb574,0x106));var _0x4b57=function(_0x2508e6,_0x55a932){_0x2508e6=_0x2508e6-0x0;var _0x2a6b3e=_0xb574[_0x2508e6];return _0x2a6b3e;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var SmsInteraction=require(_0x4b57('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4b57('0x1'))['db'][_0x4b57('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b57('0x3'),'afterUpdate':_0x4b57('0x4'),'afterDestroy':_0x4b57('0x5')};function emitEvent(_0x919851){return function(_0xe2ae86,_0x4a3efa,_0x4eb019){_0xe2ae86[_0x4b57('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x585d86){_0xe2ae86['setDataValue']('Users',_0x585d86[_0x4b57('0x7')](function(_0x2bf397){return{'id':_0x2bf397['id']};}));return SmsMessage[_0x4b57('0x8')]({'where':{'SmsInteractionId':_0xe2ae86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b57('0x9')](function(_0xce47ad){_0xe2ae86[_0x4b57('0xa')](_0x4b57('0xb'),_0xce47ad[_0x4b57('0xc')]);SmsInteractionEvents['emit'](_0x919851+':'+_0xe2ae86['id'],_0xe2ae86);SmsInteractionEvents[_0x4b57('0xd')](_0x919851,_0xe2ae86);_0x4eb019(null);})[_0x4b57('0xe')](_0x4eb019(null));};}for(var e in events){if(events[_0x4b57('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index d9d43b3..d7305fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc55=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xdc55,0x166));var _0x5dc5=function(_0x350ed7,_0x4e0bf8){_0x350ed7=_0x350ed7-0x0;var _0x3f07ce=_0xdc55[_0x350ed7];return _0x3f07ce;};'use strict';var _=require(_0x5dc5('0x0'));var util=require('util');var logger=require(_0x5dc5('0x1'))(_0x5dc5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5dc5('0x3'));var fs=require('fs');var path=require(_0x5dc5('0x4'));var rimraf=require(_0x5dc5('0x5'));var config=require(_0x5dc5('0x6'));var attributes=require(_0x5dc5('0x7'));module[_0x5dc5('0x8')]=function(_0x4a7038,_0x14e048){return _0x4a7038[_0x5dc5('0x9')](_0x5dc5('0xa'),attributes,{'tableName':_0x5dc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e859c,_0x1594e5,_0x5de2d3){if(_0x1e859c[_0x5dc5('0xc')](_0x5dc5('0xd'))){_0x1e859c[_0x5dc5('0xe')]=moment()[_0x5dc5('0xf')](_0x5dc5('0x10'));}_0x5de2d3(null,_0x1e859c);}}});};
\ No newline at end of file
+var _0x2c38=['closedAt','YYYY-MM-DD\x20HH:mm:ss','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','changed'];(function(_0x2459b4,_0x56b89a){var _0xf1caab=function(_0x1b413b){while(--_0x1b413b){_0x2459b4['push'](_0x2459b4['shift']());}};_0xf1caab(++_0x56b89a);}(_0x2c38,0x1d8));var _0x82c3=function(_0x2a4b08,_0xd1d8c){_0x2a4b08=_0x2a4b08-0x0;var _0x131536=_0x2c38[_0x2a4b08];return _0x131536;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x82c3('0x0'));var BPromise=require(_0x82c3('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82c3('0x2'));var rimraf=require(_0x82c3('0x3'));var config=require(_0x82c3('0x4'));var attributes=require(_0x82c3('0x5'));module['exports']=function(_0x3fe12d,_0x22bdf0){return _0x3fe12d['define'](_0x82c3('0x6'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4144b5,_0x41c486,_0x89ff02){if(_0x4144b5[_0x82c3('0x7')]('closed')){_0x4144b5[_0x82c3('0x8')]=moment()['format'](_0x82c3('0x9'));}_0x89ff02(null,_0x4144b5);}}});};
\ No newline at end of file
index 8aba152..0596ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa209=['where','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','attributes','AddTagsToSmsInteraction','find'];(function(_0x5c8c8b,_0x21631c){var _0x3cc99c=function(_0x5e6b2c){while(--_0x5e6b2c){_0x5c8c8b['push'](_0x5c8c8b['shift']());}};_0x3cc99c(++_0x21631c);}(_0xa209,0x11e));var _0x9a20=function(_0x50a6fd,_0x1b5cb3){_0x50a6fd=_0x50a6fd-0x0;var _0x29e61c=_0xa209[_0x50a6fd];return _0x29e61c;};'use strict';var _=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var moment=require(_0x9a20('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a20('0x3'));var fs=require('fs');var Redis=require(_0x9a20('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a20('0x5'))(_0x9a20('0x6'));var config=require(_0x9a20('0x7'));var jayson=require(_0x9a20('0x8'));var client=jayson['client'][_0x9a20('0x9')]({'port':0x232a});config['redis']=_[_0x9a20('0xa')](config[_0x9a20('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a20('0xc'))(new Redis(config[_0x9a20('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x41a33a,_0x3f7ca4,_0x197e98){return new BPromise(function(_0x169b5b,_0x11674f){return client[_0x9a20('0xd')](_0x41a33a,_0x197e98)[_0x9a20('0xe')](function(_0x5e0bf0){logger[_0x9a20('0xf')](_0x9a20('0x10'),_0x3f7ca4,_0x9a20('0x11'));logger[_0x9a20('0x12')](_0x9a20('0x13'),_0x3f7ca4,'request\x20sent',JSON[_0x9a20('0x14')](_0x5e0bf0));if(_0x5e0bf0[_0x9a20('0x15')]){if(_0x5e0bf0['error'][_0x9a20('0x16')]===0x1f4){logger[_0x9a20('0x15')](_0x9a20('0x10'),_0x3f7ca4,_0x5e0bf0[_0x9a20('0x15')][_0x9a20('0x17')]);return _0x11674f(_0x5e0bf0['error'][_0x9a20('0x17')]);}logger[_0x9a20('0x15')](_0x9a20('0x10'),_0x3f7ca4,_0x5e0bf0[_0x9a20('0x15')][_0x9a20('0x17')]);return _0x169b5b(_0x5e0bf0[_0x9a20('0x15')]['message']);}else{logger['info'](_0x9a20('0x10'),_0x3f7ca4,_0x9a20('0x11'));_0x169b5b(_0x5e0bf0[_0x9a20('0x18')][_0x9a20('0x17')]);}})[_0x9a20('0x19')](function(_0x11592e){logger['error'](_0x9a20('0x10'),_0x3f7ca4,_0x11592e);_0x11674f(_0x11592e);});});}exports[_0x9a20('0x1a')]=function(_0x1ce166){var _0x1c29df=this;return new Promise(function(_0x58164b,_0x58dae3){return db[_0x9a20('0x1b')][_0x9a20('0x1c')](_0x1ce166['body'],{'raw':_0x1ce166[_0x9a20('0x1d')]?_0x1ce166[_0x9a20('0x1d')][_0x9a20('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce166[_0x9a20('0x1d')]?_0x1ce166[_0x9a20('0x1d')]['where']||null:null,'attributes':_0x1ce166['options']?_0x1ce166['options'][_0x9a20('0x1f')]||null:null,'limit':_0x1ce166[_0x9a20('0x1d')]?_0x1ce166[_0x9a20('0x1d')]['limit']||null:null})[_0x9a20('0xe')](function(_0x1bdc03){logger['info']('UpdateSmsInteraction',_0x1ce166);logger[_0x9a20('0x12')]('UpdateSmsInteraction',_0x1ce166,JSON[_0x9a20('0x14')](_0x1bdc03));_0x58164b(_0x1bdc03);})['catch'](function(_0x16a305){logger['error']('UpdateSmsInteraction',_0x16a305[_0x9a20('0x17')],_0x1ce166);_0x58dae3(_0x1c29df[_0x9a20('0x15')](0x1f4,_0x16a305['message']));});});};exports[_0x9a20('0x20')]=function(_0x1ee6f7){return new Promise(function(_0x292c2a,_0xc39434){return db[_0x9a20('0x1b')][_0x9a20('0x21')]({'where':_0x1ee6f7['options']?_0x1ee6f7[_0x9a20('0x1d')][_0x9a20('0x22')]||null:null})[_0x9a20('0xe')](function(_0x49eb02){if(_0x49eb02){return _0x49eb02[_0x9a20('0x23')](_0x1ee6f7[_0x9a20('0x24')][_0x9a20('0x25')],_['omit'](_0x1ee6f7[_0x9a20('0x24')],[_0x9a20('0x25'),'id'])||{});}})[_0x9a20('0x26')](function(_0x4be3d3){logger[_0x9a20('0xf')]('AddTags',_0x1ee6f7);logger[_0x9a20('0x12')](_0x9a20('0x27'),_0x1ee6f7,JSON['stringify'](_0x4be3d3));_0x292c2a(_0x4be3d3);})['catch'](function(_0x321319){logger[_0x9a20('0x15')]('AddTags',_0x321319[_0x9a20('0x17')],_0x1ee6f7);_0xc39434(_this[_0x9a20('0x15')](0x1f4,_0x321319['message']));});});};
\ No newline at end of file
+var _0x533a=['AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','find','addTags','omit','spread'];(function(_0x4c11ce,_0x4e2bcb){var _0x9e4915=function(_0x432e37){while(--_0x432e37){_0x4c11ce['push'](_0x4c11ce['shift']());}};_0x9e4915(++_0x4e2bcb);}(_0x533a,0x121));var _0xa533=function(_0x4d95db,_0x28b7e9){_0x4d95db=_0x4d95db-0x0;var _0x1cc484=_0x533a[_0x4d95db];return _0x1cc484;};'use strict';var _=require(_0xa533('0x0'));var util=require(_0xa533('0x1'));var moment=require(_0xa533('0x2'));var BPromise=require(_0xa533('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa533('0x4'));var db=require(_0xa533('0x5'))['db'];var utils=require(_0xa533('0x6'));var logger=require(_0xa533('0x7'))(_0xa533('0x8'));var config=require(_0xa533('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa533('0xa')][_0xa533('0xb')]({'port':0x232a});config[_0xa533('0xc')]=_['defaults'](config['redis'],{'host':_0xa533('0xd'),'port':0x18eb});var socket=require(_0xa533('0xe'))(new Redis(config[_0xa533('0xc')]));require('./smsInteraction.socket')[_0xa533('0xf')](socket);function respondWithRpcPromise(_0x2f2d6f,_0x21798d,_0x3b091b){return new BPromise(function(_0x13f16a,_0x1699ce){return client[_0xa533('0x10')](_0x2f2d6f,_0x3b091b)[_0xa533('0x11')](function(_0x3015de){logger[_0xa533('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x21798d,'request\x20sent');logger['debug'](_0xa533('0x13'),_0x21798d,_0xa533('0x14'),JSON[_0xa533('0x15')](_0x3015de));if(_0x3015de[_0xa533('0x16')]){if(_0x3015de[_0xa533('0x16')]['code']===0x1f4){logger[_0xa533('0x16')](_0xa533('0x17'),_0x21798d,_0x3015de['error'][_0xa533('0x18')]);return _0x1699ce(_0x3015de['error']['message']);}logger[_0xa533('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x21798d,_0x3015de[_0xa533('0x16')][_0xa533('0x18')]);return _0x13f16a(_0x3015de[_0xa533('0x16')]['message']);}else{logger[_0xa533('0x12')](_0xa533('0x17'),_0x21798d,_0xa533('0x14'));_0x13f16a(_0x3015de[_0xa533('0x19')][_0xa533('0x18')]);}})[_0xa533('0x1a')](function(_0x81bf97){logger['error'](_0xa533('0x17'),_0x21798d,_0x81bf97);_0x1699ce(_0x81bf97);});});}exports['UpdateSmsInteraction']=function(_0x4e6db9){var _0x637f2f=this;return new Promise(function(_0x5eafc6,_0x380ef8){return db['SmsInteraction'][_0xa533('0x1b')](_0x4e6db9[_0xa533('0x1c')],{'raw':_0x4e6db9[_0xa533('0x1d')]?_0x4e6db9['options'][_0xa533('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e6db9[_0xa533('0x1d')]?_0x4e6db9[_0xa533('0x1d')][_0xa533('0x1f')]||null:null,'attributes':_0x4e6db9[_0xa533('0x1d')]?_0x4e6db9['options'][_0xa533('0x20')]||null:null,'limit':_0x4e6db9['options']?_0x4e6db9[_0xa533('0x1d')][_0xa533('0x21')]||null:null})['then'](function(_0x466731){logger[_0xa533('0x12')](_0xa533('0x22'),_0x4e6db9);logger['debug'](_0xa533('0x22'),_0x4e6db9,JSON[_0xa533('0x15')](_0x466731));_0x5eafc6(_0x466731);})['catch'](function(_0x46c7d0){logger[_0xa533('0x16')](_0xa533('0x22'),_0x46c7d0[_0xa533('0x18')],_0x4e6db9);_0x380ef8(_0x637f2f[_0xa533('0x16')](0x1f4,_0x46c7d0[_0xa533('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x176dba){return new Promise(function(_0x3218e4,_0x4c70dc){return db['SmsInteraction'][_0xa533('0x23')]({'where':_0x176dba['options']?_0x176dba[_0xa533('0x1d')][_0xa533('0x1f')]||null:null})[_0xa533('0x11')](function(_0x3df222){if(_0x3df222){return _0x3df222[_0xa533('0x24')](_0x176dba[_0xa533('0x1c')]['ids'],_[_0xa533('0x25')](_0x176dba['body'],['ids','id'])||{});}})[_0xa533('0x26')](function(_0x346c06){logger[_0xa533('0x12')](_0xa533('0x27'),_0x176dba);logger[_0xa533('0x28')](_0xa533('0x27'),_0x176dba,JSON['stringify'](_0x346c06));_0x3218e4(_0x346c06);})[_0xa533('0x1a')](function(_0x5d291b){logger[_0xa533('0x16')](_0xa533('0x27'),_0x5d291b[_0xa533('0x18')],_0x176dba);_0x4c70dc(_this[_0xa533('0x16')](0x1f4,_0x5d291b[_0xa533('0x18')]));});});};
\ No newline at end of file
index df50d8a..4c1c7fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2efe=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x4a1a1e,_0x17ac89){var _0x37df93=function(_0x4d5e8a){while(--_0x4d5e8a){_0x4a1a1e['push'](_0x4a1a1e['shift']());}};_0x37df93(++_0x17ac89);}(_0x2efe,0x167));var _0xe2ef=function(_0x55231c,_0x1bb997){_0x55231c=_0x55231c-0x0;var _0xb07ab0=_0x2efe[_0x55231c];return _0xb07ab0;};'use strict';var SmsInteractionEvents=require(_0xe2ef('0x0'));var events=[_0xe2ef('0x1'),_0xe2ef('0x2'),_0xe2ef('0x3')];function createListener(_0xc68829,_0x406163){return function(_0x35f272){_0x406163[_0xe2ef('0x4')](_0xc68829,_0x35f272);};}function removeListener(_0x2b739f,_0x54d4f1){return function(){SmsInteractionEvents['removeListener'](_0x2b739f,_0x54d4f1);};}exports['register']=function(_0x3f6617){for(var _0x244638=0x0,_0x106a43=events[_0xe2ef('0x5')];_0x244638<_0x106a43;_0x244638++){var _0x188914=events[_0x244638];var _0x28a963=createListener(_0xe2ef('0x6')+_0x188914,_0x3f6617);SmsInteractionEvents['on'](_0x188914,_0x28a963);}};
\ No newline at end of file
+var _0x0f7e=['smsInteraction:','./smsInteraction.events','save','remove','emit','register','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0f7e,0xcc));var _0xe0f7=function(_0x46014b,_0x45c1c3){_0x46014b=_0x46014b-0x0;var _0x22cee3=_0x0f7e[_0x46014b];return _0x22cee3;};'use strict';var SmsInteractionEvents=require(_0xe0f7('0x0'));var events=[_0xe0f7('0x1'),_0xe0f7('0x2'),'update'];function createListener(_0x511a71,_0x463d63){return function(_0x9bbd9c){_0x463d63[_0xe0f7('0x3')](_0x511a71,_0x9bbd9c);};}function removeListener(_0x1c650f,_0x209ef7){return function(){SmsInteractionEvents['removeListener'](_0x1c650f,_0x209ef7);};}exports[_0xe0f7('0x4')]=function(_0x320c3e){for(var _0x233829=0x0,_0x380f57=events[_0xe0f7('0x5')];_0x233829<_0x380f57;_0x233829++){var _0x125c75=events[_0x233829];var _0x398bc2=createListener(_0xe0f7('0x6')+_0x125c75,_0x320c3e);SmsInteractionEvents['on'](_0x125c75,_0x398bc2);}};
\ No newline at end of file
index 22f03c3..bba90d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc175=['/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','update','put','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc175,0x196));var _0x5c17=function(_0xe89493,_0x35fdee){_0xe89493=_0xe89493-0x0;var _0x5d049f=_0xc175[_0xe89493];return _0x5d049f;};'use strict';var multer=require(_0x5c17('0x0'));var util=require(_0x5c17('0x1'));var path=require(_0x5c17('0x2'));var timeout=require(_0x5c17('0x3'));var express=require(_0x5c17('0x4'));var router=express[_0x5c17('0x5')]();var fs_extra=require(_0x5c17('0x6'));var auth=require(_0x5c17('0x7'));var interaction=require(_0x5c17('0x8'));var config=require(_0x5c17('0x9'));var controller=require(_0x5c17('0xa'));router[_0x5c17('0xb')]('/',auth[_0x5c17('0xc')](),controller['index']);router[_0x5c17('0xb')](_0x5c17('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x5c17('0xb')](_0x5c17('0xe'),auth[_0x5c17('0xc')](),controller[_0x5c17('0xf')]);router[_0x5c17('0x10')]('/',auth[_0x5c17('0xc')](),interaction[_0x5c17('0x11')](_0x5c17('0x12'),_0x5c17('0x13')),controller[_0x5c17('0x14')]);router[_0x5c17('0x10')](_0x5c17('0x15'),controller['status']);router['put'](_0x5c17('0xe'),auth[_0x5c17('0xc')](),controller[_0x5c17('0x16')]);router[_0x5c17('0x17')]('/:id/accept',auth[_0x5c17('0xc')](),controller[_0x5c17('0x18')]);router[_0x5c17('0x17')](_0x5c17('0x19'),auth[_0x5c17('0xc')](),controller[_0x5c17('0x1a')]);router['delete']('/:id',auth[_0x5c17('0xc')](),controller[_0x5c17('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x691a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','smsmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x691a,0xfb));var _0xa691=function(_0x18b314,_0x42e3d9){_0x18b314=_0x18b314-0x0;var _0x36160f=_0x691a[_0x18b314];return _0x36160f;};'use strict';var multer=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var path=require(_0xa691('0x2'));var timeout=require(_0xa691('0x3'));var express=require(_0xa691('0x4'));var router=express['Router']();var fs_extra=require(_0xa691('0x5'));var auth=require(_0xa691('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa691('0x7'));var controller=require('./smsMessage.controller');router[_0xa691('0x8')]('/',auth[_0xa691('0x9')](),controller[_0xa691('0xa')]);router['get'](_0xa691('0xb'),auth[_0xa691('0x9')](),controller[_0xa691('0xc')]);router[_0xa691('0x8')](_0xa691('0xd'),auth[_0xa691('0x9')](),controller[_0xa691('0xe')]);router[_0xa691('0xf')]('/',auth[_0xa691('0x9')](),interaction['tracked']('sms',_0xa691('0x10')),controller[_0xa691('0x11')]);router[_0xa691('0xf')](_0xa691('0x12'),controller['status']);router[_0xa691('0x13')](_0xa691('0xd'),auth[_0xa691('0x9')](),controller[_0xa691('0x14')]);router[_0xa691('0x13')](_0xa691('0x15'),auth[_0xa691('0x9')](),controller[_0xa691('0x16')]);router[_0xa691('0x13')](_0xa691('0x17'),auth[_0xa691('0x9')](),controller[_0xa691('0x18')]);router[_0xa691('0x19')](_0xa691('0xd'),auth[_0xa691('0x9')](),controller[_0xa691('0x1a')]);module[_0xa691('0x1b')]=router;
\ No newline at end of file
index 7daaead..3b8401a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa26d=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa26d,0x91));var _0xda26=function(_0x465552,_0x5d974d){_0x465552=_0x465552-0x0;var _0xc92a2e=_0xa26d[_0x465552];return _0xc92a2e;};'use strict';var Sequelize=require(_0xda26('0x0'));module[_0xda26('0x1')]={'body':{'type':Sequelize[_0xda26('0x2')](_0xda26('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xda26('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xda26('0x5')]('in','out'),'defaultValue':_0xda26('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xda26('0x7')](0xbe)},'phone':{'type':Sequelize[_0xda26('0x7')]},'readAt':{'type':Sequelize[_0xda26('0x8')]},'secret':{'type':Sequelize[_0xda26('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xda26('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x416d=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','exports'];(function(_0x4fc297,_0x304e7a){var _0x105060=function(_0x1f57b1){while(--_0x1f57b1){_0x4fc297['push'](_0x4fc297['shift']());}};_0x105060(++_0x304e7a);}(_0x416d,0x1b7));var _0xd416=function(_0x289874,_0x1b6752){_0x289874=_0x289874-0x0;var _0x2f8bbb=_0x416d[_0x289874];return _0x2f8bbb;};'use strict';var Sequelize=require(_0xd416('0x0'));module[_0xd416('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd416('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd416('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd416('0x4')]('in',_0xd416('0x5')),'defaultValue':_0xd416('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd416('0x6')](0xbe)},'phone':{'type':Sequelize[_0xd416('0x6')]},'readAt':{'type':Sequelize[_0xd416('0x7')]},'secret':{'type':Sequelize[_0xd416('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd416('0x6')]},'providerResponse':{'type':Sequelize[_0xd416('0x8')]}};
\ No newline at end of file
index d7224e0..9559029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad0=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','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','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','stack','name','index','SmsMessage','rawAttributes','fieldName','key','map','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','intersection','find','create','body','params','../../config/logger','sms-interactions','accept','sms','read','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x17cca1,_0x4cd1f6){var _0x2a1d4a=function(_0x33c8a1){while(--_0x33c8a1){_0x17cca1['push'](_0x17cca1['shift']());}};_0x2a1d4a(++_0x4cd1f6);}(_0x1ad0,0x92));var _0x01ad=function(_0xe2f7d9,_0x194487){_0xe2f7d9=_0xe2f7d9-0x0;var _0x427969=_0x1ad0[_0xe2f7d9];return _0x427969;};'use strict';var emlformat=require(_0x01ad('0x0'));var rimraf=require(_0x01ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ad('0x2'));var rp=require(_0x01ad('0x3'));var moment=require(_0x01ad('0x4'));var BPromise=require(_0x01ad('0x5'));var Mustache=require(_0x01ad('0x6'));var util=require(_0x01ad('0x7'));var path=require(_0x01ad('0x8'));var sox=require(_0x01ad('0x9'));var csv=require(_0x01ad('0xa'));var ejs=require(_0x01ad('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x01ad('0xc'));var jsforce=require(_0x01ad('0xd'));var deskjs=require(_0x01ad('0xe'));var toCsv=require(_0x01ad('0xa'));var querystring=require(_0x01ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x01ad('0x10'));var authService=require(_0x01ad('0x11'));var qs=require(_0x01ad('0x12'));var as=require(_0x01ad('0x13'));var hardwareService=require(_0x01ad('0x14'));var logger=require('../../config/logger')(_0x01ad('0x15'));var utils=require(_0x01ad('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x01ad('0x17'));var db=require(_0x01ad('0x18'))['db'];config[_0x01ad('0x19')]=_[_0x01ad('0x1a')](config[_0x01ad('0x19')],{'host':_0x01ad('0x1b'),'port':0x18eb});var socket=require(_0x01ad('0x1c'))(new Redis(config[_0x01ad('0x19')]));require(_0x01ad('0x1d'))[_0x01ad('0x1e')](socket);var jayson=require(_0x01ad('0x1f'));var client=jayson[_0x01ad('0x20')][_0x01ad('0x21')]({'port':0x232c});var client9002=jayson[_0x01ad('0x20')][_0x01ad('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4f882b,_0x1dc7fe,_0x23d068,_0x560bd4){return new BPromise(function(_0x86b055,_0x3b2220){var _0x212f2f=_0x560bd4||client;return _0x212f2f[_0x01ad('0x22')](_0x4f882b,_0x23d068)['then'](function(_0x3ce373){logger[_0x01ad('0x23')](_0x01ad('0x24'),_0x1dc7fe,_0x01ad('0x25'));logger[_0x01ad('0x26')](_0x01ad('0x27'),_0x1dc7fe,_0x01ad('0x25'),JSON['stringify'](_0x3ce373));if(_0x3ce373['error']){if(_0x3ce373[_0x01ad('0x28')][_0x01ad('0x29')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1dc7fe,_0x3ce373[_0x01ad('0x28')]['message']);return _0x3b2220(_0x3ce373[_0x01ad('0x28')]['message']);}logger[_0x01ad('0x28')]('SmsMessage,\x20%s,\x20%s',_0x1dc7fe,_0x3ce373[_0x01ad('0x28')][_0x01ad('0x2a')]);return _0x86b055(_0x3ce373[_0x01ad('0x28')][_0x01ad('0x2a')]);}else{logger[_0x01ad('0x23')]('SmsMessage,\x20%s,\x20%s',_0x1dc7fe,_0x01ad('0x25'));_0x86b055(_0x3ce373[_0x01ad('0x2b')]['message']);}})[_0x01ad('0x2c')](function(_0x177ff2){logger['error'](_0x01ad('0x24'),_0x1dc7fe,_0x177ff2);_0x3b2220(_0x177ff2);});});}function respondWithStatusCode(_0x63155c,_0x19339a){_0x19339a=_0x19339a||0xcc;return function(_0x4bc814){if(_0x4bc814){return _0x63155c[_0x01ad('0x2d')](_0x19339a);}return _0x63155c[_0x01ad('0x2e')](_0x19339a)[_0x01ad('0x2f')]();};}function respondWithResult(_0x12eb2a,_0x13e3a2){_0x13e3a2=_0x13e3a2||0xc8;return function(_0xdda097){if(_0xdda097){return _0x12eb2a['status'](_0x13e3a2)[_0x01ad('0x30')](_0xdda097);}};}function respondWithFilteredResult(_0x278863,_0x4e0484){return function(_0x384749){if(_0x384749){var _0x4a402c=typeof _0x4e0484['offset']===_0x01ad('0x31')&&typeof _0x4e0484[_0x01ad('0x32')]===_0x01ad('0x31');var _0x516369=_0x384749[_0x01ad('0x33')];var _0x42b865=_0x4a402c?0x0:_0x4e0484[_0x01ad('0x34')];var _0x1cbcbf=_0x4a402c?_0x384749['count']:_0x4e0484['offset']+_0x4e0484[_0x01ad('0x32')];var _0x429809;if(_0x1cbcbf>=_0x516369){_0x1cbcbf=_0x516369;_0x429809=0xc8;}else{_0x429809=0xce;}_0x278863[_0x01ad('0x2e')](_0x429809);return _0x278863['set'](_0x01ad('0x35'),_0x42b865+'-'+_0x1cbcbf+'/'+_0x516369)['json'](_0x384749);}return null;};}function patchUpdates(_0x4746f8){return function(_0x3c4cf){try{jsonpatch[_0x01ad('0x36')](_0x3c4cf,_0x4746f8,!![]);}catch(_0x32f34b){return BPromise['reject'](_0x32f34b);}return _0x3c4cf[_0x01ad('0x37')]();};}function saveUpdates(_0x56e9f2,_0x3d8906){return function(_0x372823){if(_0x372823){return _0x372823[_0x01ad('0x38')](_0x56e9f2)['then'](function(_0x113ac7){return _0x113ac7;});}return null;};}function removeEntity(_0x51c245,_0x3a8a3d){return function(_0x57293e){if(_0x57293e){return _0x57293e[_0x01ad('0x39')]()[_0x01ad('0x3a')](function(){_0x51c245[_0x01ad('0x2e')](0xcc)[_0x01ad('0x2f')]();});}};}function handleEntityNotFound(_0x57a3d4,_0x3003e5){return function(_0x3007a6){if(!_0x3007a6){_0x57a3d4[_0x01ad('0x2d')](0x194);}return _0x3007a6;};}function handleError(_0x808b8e,_0xa13fa1){_0xa13fa1=_0xa13fa1||0x1f4;return function(_0x48582e){logger[_0x01ad('0x28')](_0x48582e[_0x01ad('0x3b')]);if(_0x48582e[_0x01ad('0x3c')]){delete _0x48582e[_0x01ad('0x3c')];}_0x808b8e[_0x01ad('0x2e')](_0xa13fa1)['send'](_0x48582e);};}exports[_0x01ad('0x3d')]=function(_0x5b0b7d,_0x148bfb){var _0x37e753={},_0x4d1ca3={},_0x56163f={'count':0x0,'rows':[]};var _0x3e2d87=_['map'](db[_0x01ad('0x3e')][_0x01ad('0x3f')],function(_0x29a215){return{'name':_0x29a215[_0x01ad('0x40')],'type':_0x29a215['type'][_0x01ad('0x41')]};});_0x4d1ca3['model']=_[_0x01ad('0x42')](_0x3e2d87,_0x01ad('0x3c'));_0x4d1ca3[_0x01ad('0x43')]=_[_0x01ad('0x44')](_0x5b0b7d[_0x01ad('0x43')]);_0x4d1ca3['filters']=_['intersection'](_0x4d1ca3[_0x01ad('0x45')],_0x4d1ca3[_0x01ad('0x43')]);_0x37e753[_0x01ad('0x46')]=_['intersection'](_0x4d1ca3[_0x01ad('0x45')],qs['fields'](_0x5b0b7d['query'][_0x01ad('0x47')]));_0x37e753['attributes']=_0x37e753[_0x01ad('0x46')][_0x01ad('0x48')]?_0x37e753['attributes']:_0x4d1ca3[_0x01ad('0x45')];if(!_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x49')](_0x01ad('0x4a'))){_0x37e753[_0x01ad('0x32')]=qs[_0x01ad('0x32')](_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x32')]);_0x37e753[_0x01ad('0x34')]=qs[_0x01ad('0x34')](_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x34')]);}_0x37e753[_0x01ad('0x4b')]=qs['sort'](_0x5b0b7d['query']['sort']);_0x37e753['where']=qs[_0x01ad('0x4c')](_[_0x01ad('0x4d')](_0x5b0b7d[_0x01ad('0x43')],_0x4d1ca3[_0x01ad('0x4c')]),_0x3e2d87);if(_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x4e')]){_0x37e753[_0x01ad('0x4f')]=_[_0x01ad('0x50')](_0x37e753[_0x01ad('0x4f')],{'$or':_[_0x01ad('0x42')](_0x3e2d87,function(_0x249df6){if(_0x249df6['type']!==_0x01ad('0x51')){var _0x1c2bf2={};_0x1c2bf2[_0x249df6[_0x01ad('0x3c')]]={'$like':'%'+_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x4e')]+'%'};return _0x1c2bf2;}})});}_0x37e753=_[_0x01ad('0x50')]({},_0x37e753,_0x5b0b7d[_0x01ad('0x52')]);var _0x26ec58={'where':_0x37e753[_0x01ad('0x4f')]};return db['SmsMessage'][_0x01ad('0x33')](_0x26ec58)[_0x01ad('0x3a')](function(_0x1d36bb){_0x56163f[_0x01ad('0x33')]=_0x1d36bb;if(_0x5b0b7d[_0x01ad('0x43')][_0x01ad('0x53')]){_0x37e753[_0x01ad('0x54')]=[{'all':!![]}];}return db[_0x01ad('0x3e')]['findAll'](_0x37e753);})['then'](function(_0x3cce18){_0x56163f[_0x01ad('0x55')]=_0x3cce18;return _0x56163f;})['then'](respondWithFilteredResult(_0x148bfb,_0x37e753))[_0x01ad('0x2c')](handleError(_0x148bfb,null));};exports[_0x01ad('0x56')]=function(_0xb61706,_0x20dff1){var _0x3729d2={'raw':!![],'where':{'id':_0xb61706['params']['id']}},_0x39cf11={};_0x39cf11[_0x01ad('0x45')]=_[_0x01ad('0x44')](db[_0x01ad('0x3e')][_0x01ad('0x3f')]);_0x39cf11[_0x01ad('0x43')]=_[_0x01ad('0x44')](_0xb61706[_0x01ad('0x43')]);_0x39cf11['filters']=_[_0x01ad('0x57')](_0x39cf11[_0x01ad('0x45')],_0x39cf11[_0x01ad('0x43')]);_0x3729d2['attributes']=_[_0x01ad('0x57')](_0x39cf11[_0x01ad('0x45')],qs[_0x01ad('0x47')](_0xb61706[_0x01ad('0x43')][_0x01ad('0x47')]));_0x3729d2[_0x01ad('0x46')]=_0x3729d2[_0x01ad('0x46')][_0x01ad('0x48')]?_0x3729d2[_0x01ad('0x46')]:_0x39cf11[_0x01ad('0x45')];if(_0xb61706[_0x01ad('0x43')][_0x01ad('0x53')]){_0x3729d2[_0x01ad('0x54')]=[{'all':!![]}];}_0x3729d2=_[_0x01ad('0x50')]({},_0x3729d2,_0xb61706[_0x01ad('0x52')]);return db[_0x01ad('0x3e')][_0x01ad('0x58')](_0x3729d2)[_0x01ad('0x3a')](handleEntityNotFound(_0x20dff1,null))[_0x01ad('0x3a')](respondWithResult(_0x20dff1,null))[_0x01ad('0x2c')](handleError(_0x20dff1,null));};exports[_0x01ad('0x59')]=function(_0x271eff,_0x3f1429){return db['SmsMessage']['create'](_0x271eff[_0x01ad('0x5a')],{})[_0x01ad('0x3a')](respondWithResult(_0x3f1429,0xc9))[_0x01ad('0x2c')](handleError(_0x3f1429,null));};exports['update']=function(_0x3701fb,_0x5b26c9){if(_0x3701fb[_0x01ad('0x5a')]['id']){delete _0x3701fb['body']['id'];}return db[_0x01ad('0x3e')][_0x01ad('0x58')]({'where':{'id':_0x3701fb[_0x01ad('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b26c9,null))[_0x01ad('0x3a')](saveUpdates(_0x3701fb[_0x01ad('0x5a')],null))[_0x01ad('0x3a')](respondWithResult(_0x5b26c9,null))[_0x01ad('0x2c')](handleError(_0x5b26c9,null));};exports['destroy']=function(_0x3d7563,_0x1ea7cc){return db[_0x01ad('0x3e')][_0x01ad('0x58')]({'where':{'id':_0x3d7563[_0x01ad('0x5b')]['id']}})[_0x01ad('0x3a')](handleEntityNotFound(_0x1ea7cc,null))[_0x01ad('0x3a')](removeEntity(_0x1ea7cc,null))[_0x01ad('0x2c')](handleError(_0x1ea7cc,null));};exports['describe']=function(_0x1b55cf,_0x3d3477){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x3d3477,null))['catch'](handleError(_0x3d3477,null));};var interaction_log=require(_0x01ad('0x5c'))(_0x01ad('0x5d'));exports[_0x01ad('0x5e')]=function(_0x2e2066,_0x1f323f,_0x2e3a23){var _0x414eee={'agent':{},'channel':_0x01ad('0x5f')};if(_0x2e2066[_0x01ad('0x5a')]['id']){delete _0x2e2066[_0x01ad('0x5a')]['id'];}_0x2e2066['body'][_0x01ad('0x60')]=!![];_0x2e2066['body'][_0x01ad('0x61')]=moment()[_0x01ad('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e2066[_0x01ad('0x5a')][_0x01ad('0x63')]=_0x2e2066[_0x01ad('0x5a')]['UserId']||_0x2e2066['user']['id'];_0x414eee[_0x01ad('0x64')]['id']=_0x2e2066['body']['UserId'];return db[_0x01ad('0x3e')][_0x01ad('0x58')]({'where':{'id':_0x2e2066[_0x01ad('0x5b')]['id'],'UserId':null}})[_0x01ad('0x3a')](handleEntityNotFound(_0x1f323f,null))[_0x01ad('0x3a')](saveUpdates(_0x2e2066[_0x01ad('0x5a')],null))[_0x01ad('0x3a')](function(_0x154e77){if(_0x154e77){_0x414eee['message']=_0x154e77[_0x01ad('0x65')]({'plain':!![]});return db[_0x01ad('0x66')]['find']({'where':{'id':_0x154e77[_0x01ad('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1f323f,null))[_0x01ad('0x3a')](function(_0x196810){if(_0x196810){return _0x196810['update']({'UserId':_0x2e2066[_0x01ad('0x5a')][_0x01ad('0x63')],'read1stAt':_[_0x01ad('0x68')](_0x196810[_0x01ad('0x69')])?moment()[_0x01ad('0x62')](_0x01ad('0x6a')):undefined});}return null;})[_0x01ad('0x3a')](function(_0x31ef04){if(_0x31ef04){_0x414eee[_0x01ad('0x6b')]=_0x31ef04[_0x01ad('0x65')]({'plain':!![]});interaction_log['info'](_0x01ad('0x6c'),_0x2e2066[_0x01ad('0x6d')]['id'],_0x2e2066[_0x01ad('0x6d')][_0x01ad('0x3c')],_0x2e2066[_0x01ad('0x6d')][_0x01ad('0x6e')],_0x414eee[_0x01ad('0x6b')]['id'],_0x2e2066[_0x01ad('0x5a')]?JSON['stringify'](_0x2e2066[_0x01ad('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x414eee);}return null;})['then'](function(_0x3173ea){var _0x5c660f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3173ea[_0x01ad('0x2a')][_0x01ad('0x6f')];return db['sequelize'][_0x01ad('0x43')](_0x5c660f,{'type':db['Sequelize'][_0x01ad('0x70')][_0x01ad('0x71')],'raw':!![]})[_0x01ad('0x3a')](function(_0x3ad7bd){return _0x3ad7bd;});})['then'](function(_0x5648ee){if(_0x5648ee){_0x414eee[_0x01ad('0x2a')][_0x01ad('0x72')]=_0x5648ee[0x0];if(!_0x2e2066[_0x01ad('0x5a')][_0x01ad('0x63')])return;return db[_0x01ad('0x73')][_0x01ad('0x58')]({'where':{'id':_0x2e2066[_0x01ad('0x5a')][_0x01ad('0x63')],'role':_0x01ad('0x64')},'attributes':['id',_0x01ad('0x3c'),_0x01ad('0x74'),_0x01ad('0x75'),_0x01ad('0x76')],'raw':!![]});}return null;})['then'](function(_0x5cf1de){if(!_0x5cf1de)return null;_0x414eee[_0x01ad('0x2a')][_0x01ad('0x64')]=_0x5cf1de;return _0x414eee;})[_0x01ad('0x3a')](function(_0x3f8c62){if(_0x3f8c62){if(_0x2e2066[_0x01ad('0x5a')][_0x01ad('0x77')]){_0x414eee[_0x01ad('0x2a')][_0x01ad('0x78')]=util[_0x01ad('0x62')](_0x01ad('0x79'),_0x2e2066[_0x01ad('0x6d')][_0x01ad('0x3c')]);_0x414eee[_0x01ad('0x2a')][_0x01ad('0x7a')]=_0x414eee['channel'];_0x414eee[_0x01ad('0x2a')][_0x01ad('0x7b')]=_0x01ad('0x5e');return respondWithRpcPromise(_0x01ad('0x7c'),_0x01ad('0x7c'),{'event':_0x01ad('0x7d'),'message':_0x414eee[_0x01ad('0x2a')]},client9002)[_0x01ad('0x3a')](function(){return _0x414eee;});}return _0x414eee;}return null;})[_0x01ad('0x3a')](respondWithResult(_0x1f323f,null))['catch'](handleError(_0x1f323f,null));};var interaction_log=require(_0x01ad('0x5c'))('sms-interactions');exports[_0x01ad('0x7e')]=function(_0xbdb7e1,_0x4bb752,_0x1128d5){var _0x39a261={'agent':{},'channel':'sms'};if(_0xbdb7e1[_0x01ad('0x5a')]['id']){delete _0xbdb7e1[_0x01ad('0x5a')]['id'];}_0xbdb7e1['body'][_0x01ad('0x63')]=_0xbdb7e1[_0x01ad('0x5a')][_0x01ad('0x63')]||_0xbdb7e1[_0x01ad('0x6d')]['id'];_0x39a261[_0x01ad('0x64')]['id']=_0xbdb7e1[_0x01ad('0x5a')]['UserId'];return db[_0x01ad('0x3e')]['find']({'where':{'id':_0xbdb7e1[_0x01ad('0x5b')]['id'],'UserId':null}})[_0x01ad('0x3a')](handleEntityNotFound(_0x4bb752,null))[_0x01ad('0x3a')](function(_0x150c78){if(_0x150c78){_0x39a261['message']=_0x150c78['get']({'plain':!![]});return db[_0x01ad('0x66')]['find']({'where':{'id':_0x150c78[_0x01ad('0x67')]}});}return null;})[_0x01ad('0x3a')](handleEntityNotFound(_0x4bb752,null))[_0x01ad('0x3a')](function(_0x319652){if(_0x319652){_0x39a261['interaction']=_0x319652[_0x01ad('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xbdb7e1['user']['id'],_0xbdb7e1[_0x01ad('0x6d')][_0x01ad('0x3c')],_0xbdb7e1[_0x01ad('0x6d')][_0x01ad('0x6e')],_0x39a261['interaction']['id'],_0xbdb7e1[_0x01ad('0x5a')]?JSON[_0x01ad('0x7f')](_0xbdb7e1[_0x01ad('0x5a')]):'null');return respondWithRpcPromise(_0x01ad('0x80'),_0x01ad('0x81'),_0x39a261);}return null;})[_0x01ad('0x3a')](function(_0x476607){var _0x59deb6=_0x01ad('0x82')+_0x476607[_0x01ad('0x2a')]['ContactId'];return db[_0x01ad('0x83')][_0x01ad('0x43')](_0x59deb6,{'type':db[_0x01ad('0x84')][_0x01ad('0x70')][_0x01ad('0x71')],'raw':!![]})[_0x01ad('0x3a')](function(_0x33b0cf){return _0x33b0cf;});})['then'](function(_0x355689){if(_0x355689){_0x39a261['message']['contact']=_0x355689[0x0];if(!_0xbdb7e1[_0x01ad('0x5a')][_0x01ad('0x63')])return;return db[_0x01ad('0x73')][_0x01ad('0x58')]({'where':{'id':_0xbdb7e1[_0x01ad('0x5a')][_0x01ad('0x63')],'role':'agent'},'attributes':['id',_0x01ad('0x3c'),'fullname',_0x01ad('0x75'),'internal'],'raw':!![]});}return null;})[_0x01ad('0x3a')](function(_0x1bab0e){if(!_0x1bab0e)return null;_0x39a261['message'][_0x01ad('0x64')]=_0x1bab0e;return _0x39a261;})[_0x01ad('0x3a')](function(_0x2425e2){if(_0x2425e2){_0x2425e2[_0x01ad('0x2a')][_0x01ad('0x78')]=util[_0x01ad('0x62')]('SIP/%s',_0xbdb7e1[_0x01ad('0x6d')]['name']);_0x2425e2[_0x01ad('0x2a')][_0x01ad('0x7a')]=_0x39a261['channel'];_0x2425e2['message']['event']=_0x01ad('0x7e');respondWithRpcPromise(_0x01ad('0x7c'),_0x01ad('0x7c'),{'event':_0x01ad('0x85'),'message':_0x2425e2['message']},client9002);return _0x39a261;}return null;})[_0x01ad('0x3a')](respondWithResult(_0x4bb752,null))['catch'](handleError(_0x4bb752,null));};exports['status']=function(_0x56162e,_0x1114e3,_0x4ed756){if(_0x56162e[_0x01ad('0x5a')]['id']){delete _0x56162e['body']['id'];}var _0x23996b;return db[_0x01ad('0x3e')]['find']({'where':{'id':_0x56162e[_0x01ad('0x5b')]['id']}})[_0x01ad('0x3a')](handleEntityNotFound(_0x1114e3,null))[_0x01ad('0x3a')](function(_0x6f4c8e){if(_0x6f4c8e){_0x23996b=_0x6f4c8e;return db[_0x01ad('0x86')][_0x01ad('0x58')]({'where':{'id':_0x6f4c8e[_0x01ad('0x87')]}});}})['then'](handleEntityNotFound(_0x1114e3,null))[_0x01ad('0x3a')](function(_0xc8398f){if(_0xc8398f){logger[_0x01ad('0x26')](_0x01ad('0x27'),_0x01ad('0x2e'),_0x01ad('0x88'),_0xc8398f[_0x01ad('0x89')],util[_0x01ad('0x8a')](_0x56162e['body'],{'showHidden':![],'depth':null}));switch(_0xc8398f[_0x01ad('0x89')]){case _0x01ad('0x8b'):if(_0x56162e[_0x01ad('0x5a')][_0x01ad('0x8c')]&&_0x56162e[_0x01ad('0x5a')][_0x01ad('0x8c')]===_0x23996b[_0x01ad('0x8d')]){return _0x23996b['update']({'read':!![]});}else{logger['error'](_0x01ad('0x8e'),_0x01ad('0x2e'),_0x01ad('0x8b'),util[_0x01ad('0x8a')](_0x56162e[_0x01ad('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x56162e[_0x01ad('0x5a')][_0x01ad('0x8f')]&&_0x56162e['body']['MessageUUID']===_0x23996b[_0x01ad('0x8d')]&&_[_0x01ad('0x90')]([_0x01ad('0x91'),_0x01ad('0x92')],_0x56162e[_0x01ad('0x5a')][_0x01ad('0x93')])>=0x0){return _0x23996b[_0x01ad('0x38')]({'read':!![]});}else{logger[_0x01ad('0x28')](_0x01ad('0x8e'),_0x01ad('0x2e'),_0x01ad('0x94'),util['inspect'](_0x56162e[_0x01ad('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x01ad('0x95'):var _0x1041fa=_0x56162e['body'][_0x01ad('0x96')][0x0];if(_0x1041fa[_0x01ad('0x2e')][_0x01ad('0x97')]===_0x01ad('0x98')){return _0x23996b[_0x01ad('0x38')]({'read':!![]});}else{logger[_0x01ad('0x28')](_0x01ad('0x8e'),_0x01ad('0x2e'),_0x01ad('0x95'),util[_0x01ad('0x8a')](_0x56162e[_0x01ad('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x23996b;}})[_0x01ad('0x3a')](respondWithResult(_0x1114e3,null))[_0x01ad('0x2c')](handleError(_0x1114e3,null));};
\ No newline at end of file
+var _0xdd25=['MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','show','params','options','find','create','body','sms-interactions','accept','sms','read','UserId','get','SmsInteraction','SmsInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','internal','EventManager','rejectmessage','SmsAccount','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio'];(function(_0x58d1dd,_0x561ed6){var _0x4172f5=function(_0x431747){while(--_0x431747){_0x58d1dd['push'](_0x58d1dd['shift']());}};_0x4172f5(++_0x561ed6);}(_0xdd25,0x128));var _0x5dd2=function(_0x2fbc55,_0x345e9f){_0x2fbc55=_0x2fbc55-0x0;var _0x266c6a=_0xdd25[_0x2fbc55];return _0x266c6a;};'use strict';var emlformat=require(_0x5dd2('0x0'));var rimraf=require(_0x5dd2('0x1'));var zipdir=require(_0x5dd2('0x2'));var jsonpatch=require(_0x5dd2('0x3'));var rp=require(_0x5dd2('0x4'));var moment=require(_0x5dd2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5dd2('0x6'));var util=require(_0x5dd2('0x7'));var path=require(_0x5dd2('0x8'));var sox=require(_0x5dd2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5dd2('0xa'));var _=require(_0x5dd2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5dd2('0xc'));var deskjs=require(_0x5dd2('0xd'));var toCsv=require(_0x5dd2('0xe'));var querystring=require(_0x5dd2('0xf'));var Papa=require(_0x5dd2('0x10'));var Redis=require('ioredis');var authService=require(_0x5dd2('0x11'));var qs=require(_0x5dd2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5dd2('0x13'));var logger=require(_0x5dd2('0x14'))(_0x5dd2('0x15'));var utils=require(_0x5dd2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5dd2('0x17'));var db=require(_0x5dd2('0x18'))['db'];config[_0x5dd2('0x19')]=_[_0x5dd2('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5dd2('0x1b'))(new Redis(config[_0x5dd2('0x19')]));require(_0x5dd2('0x1c'))[_0x5dd2('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5dd2('0x1e')][_0x5dd2('0x1f')]({'port':0x232c});var client9002=jayson[_0x5dd2('0x1e')][_0x5dd2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1a3377,_0x1af1e4,_0x203689,_0x2a7026){return new BPromise(function(_0x34d186,_0x5c5f77){var _0x15b8ef=_0x2a7026||client;return _0x15b8ef[_0x5dd2('0x20')](_0x1a3377,_0x203689)['then'](function(_0x4eb6d1){logger[_0x5dd2('0x21')](_0x5dd2('0x22'),_0x1af1e4,_0x5dd2('0x23'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1af1e4,_0x5dd2('0x23'),JSON['stringify'](_0x4eb6d1));if(_0x4eb6d1['error']){if(_0x4eb6d1[_0x5dd2('0x24')]['code']===0x1f4){logger[_0x5dd2('0x24')](_0x5dd2('0x22'),_0x1af1e4,_0x4eb6d1[_0x5dd2('0x24')][_0x5dd2('0x25')]);return _0x5c5f77(_0x4eb6d1[_0x5dd2('0x24')][_0x5dd2('0x25')]);}logger[_0x5dd2('0x24')](_0x5dd2('0x22'),_0x1af1e4,_0x4eb6d1[_0x5dd2('0x24')][_0x5dd2('0x25')]);return _0x34d186(_0x4eb6d1['error'][_0x5dd2('0x25')]);}else{logger[_0x5dd2('0x21')](_0x5dd2('0x22'),_0x1af1e4,_0x5dd2('0x23'));_0x34d186(_0x4eb6d1[_0x5dd2('0x26')][_0x5dd2('0x25')]);}})[_0x5dd2('0x27')](function(_0x1de2ba){logger['error'](_0x5dd2('0x22'),_0x1af1e4,_0x1de2ba);_0x5c5f77(_0x1de2ba);});});}function respondWithStatusCode(_0x46713e,_0x10ffd9){_0x10ffd9=_0x10ffd9||0xcc;return function(_0x4db83b){if(_0x4db83b){return _0x46713e[_0x5dd2('0x28')](_0x10ffd9);}return _0x46713e['status'](_0x10ffd9)[_0x5dd2('0x29')]();};}function respondWithResult(_0x53ab1f,_0x1e4b03){_0x1e4b03=_0x1e4b03||0xc8;return function(_0x435ffc){if(_0x435ffc){return _0x53ab1f[_0x5dd2('0x2a')](_0x1e4b03)['json'](_0x435ffc);}};}function respondWithFilteredResult(_0x1bbe22,_0x1141f7){return function(_0x4132c4){if(_0x4132c4){var _0x2ff331=typeof _0x1141f7['offset']==='undefined'&&typeof _0x1141f7['limit']===_0x5dd2('0x2b');var _0x1eb557=_0x4132c4['count'];var _0x5a95e9=_0x2ff331?0x0:_0x1141f7[_0x5dd2('0x2c')];var _0x2baace=_0x2ff331?_0x4132c4[_0x5dd2('0x2d')]:_0x1141f7[_0x5dd2('0x2c')]+_0x1141f7[_0x5dd2('0x2e')];var _0x20e2cc;if(_0x2baace>=_0x1eb557){_0x2baace=_0x1eb557;_0x20e2cc=0xc8;}else{_0x20e2cc=0xce;}_0x1bbe22[_0x5dd2('0x2a')](_0x20e2cc);return _0x1bbe22[_0x5dd2('0x2f')](_0x5dd2('0x30'),_0x5a95e9+'-'+_0x2baace+'/'+_0x1eb557)[_0x5dd2('0x31')](_0x4132c4);}return null;};}function patchUpdates(_0x15bf82){return function(_0x508b00){try{jsonpatch[_0x5dd2('0x32')](_0x508b00,_0x15bf82,!![]);}catch(_0x25ff37){return BPromise[_0x5dd2('0x33')](_0x25ff37);}return _0x508b00[_0x5dd2('0x34')]();};}function saveUpdates(_0x20965d,_0x206d8b){return function(_0x38e9ca){if(_0x38e9ca){return _0x38e9ca[_0x5dd2('0x35')](_0x20965d)['then'](function(_0x3aa0fa){return _0x3aa0fa;});}return null;};}function removeEntity(_0x5aa6a2,_0x439021){return function(_0x2e47e4){if(_0x2e47e4){return _0x2e47e4[_0x5dd2('0x36')]()[_0x5dd2('0x37')](function(){_0x5aa6a2['status'](0xcc)[_0x5dd2('0x29')]();});}};}function handleEntityNotFound(_0x363ad1,_0x1cdd7a){return function(_0x1b089b){if(!_0x1b089b){_0x363ad1['sendStatus'](0x194);}return _0x1b089b;};}function handleError(_0x1b2a6c,_0x1b8ba0){_0x1b8ba0=_0x1b8ba0||0x1f4;return function(_0x55d2a2){logger[_0x5dd2('0x24')](_0x55d2a2['stack']);if(_0x55d2a2[_0x5dd2('0x38')]){delete _0x55d2a2[_0x5dd2('0x38')];}_0x1b2a6c[_0x5dd2('0x2a')](_0x1b8ba0)[_0x5dd2('0x39')](_0x55d2a2);};}exports[_0x5dd2('0x3a')]=function(_0x16e1fd,_0x3ec577){var _0x3114a3={},_0x460b58={},_0x14c1ff={'count':0x0,'rows':[]};var _0x335ccd=_[_0x5dd2('0x3b')](db[_0x5dd2('0x3c')][_0x5dd2('0x3d')],function(_0x4477c0){return{'name':_0x4477c0[_0x5dd2('0x3e')],'type':_0x4477c0[_0x5dd2('0x3f')]['key']};});_0x460b58[_0x5dd2('0x40')]=_[_0x5dd2('0x3b')](_0x335ccd,_0x5dd2('0x38'));_0x460b58[_0x5dd2('0x41')]=_[_0x5dd2('0x42')](_0x16e1fd[_0x5dd2('0x41')]);_0x460b58[_0x5dd2('0x43')]=_[_0x5dd2('0x44')](_0x460b58[_0x5dd2('0x40')],_0x460b58[_0x5dd2('0x41')]);_0x3114a3[_0x5dd2('0x45')]=_[_0x5dd2('0x44')](_0x460b58['model'],qs[_0x5dd2('0x46')](_0x16e1fd[_0x5dd2('0x41')][_0x5dd2('0x46')]));_0x3114a3[_0x5dd2('0x45')]=_0x3114a3[_0x5dd2('0x45')][_0x5dd2('0x47')]?_0x3114a3['attributes']:_0x460b58[_0x5dd2('0x40')];if(!_0x16e1fd['query'][_0x5dd2('0x48')](_0x5dd2('0x49'))){_0x3114a3[_0x5dd2('0x2e')]=qs['limit'](_0x16e1fd[_0x5dd2('0x41')][_0x5dd2('0x2e')]);_0x3114a3['offset']=qs['offset'](_0x16e1fd[_0x5dd2('0x41')]['offset']);}_0x3114a3[_0x5dd2('0x4a')]=qs[_0x5dd2('0x4b')](_0x16e1fd[_0x5dd2('0x41')][_0x5dd2('0x4b')]);_0x3114a3[_0x5dd2('0x4c')]=qs['filters'](_[_0x5dd2('0x4d')](_0x16e1fd[_0x5dd2('0x41')],_0x460b58[_0x5dd2('0x43')]),_0x335ccd);if(_0x16e1fd['query'][_0x5dd2('0x4e')]){_0x3114a3[_0x5dd2('0x4c')]=_[_0x5dd2('0x4f')](_0x3114a3[_0x5dd2('0x4c')],{'$or':_[_0x5dd2('0x3b')](_0x335ccd,function(_0x557306){if(_0x557306[_0x5dd2('0x3f')]!=='VIRTUAL'){var _0x3869a4={};_0x3869a4[_0x557306[_0x5dd2('0x38')]]={'$like':'%'+_0x16e1fd[_0x5dd2('0x41')][_0x5dd2('0x4e')]+'%'};return _0x3869a4;}})});}_0x3114a3=_[_0x5dd2('0x4f')]({},_0x3114a3,_0x16e1fd['options']);var _0x8bea16={'where':_0x3114a3[_0x5dd2('0x4c')]};return db[_0x5dd2('0x3c')][_0x5dd2('0x2d')](_0x8bea16)[_0x5dd2('0x37')](function(_0x20ebc4){_0x14c1ff[_0x5dd2('0x2d')]=_0x20ebc4;if(_0x16e1fd['query'][_0x5dd2('0x50')]){_0x3114a3['include']=[{'all':!![]}];}return db[_0x5dd2('0x3c')]['findAll'](_0x3114a3);})[_0x5dd2('0x37')](function(_0x5cd74e){_0x14c1ff[_0x5dd2('0x51')]=_0x5cd74e;return _0x14c1ff;})[_0x5dd2('0x37')](respondWithFilteredResult(_0x3ec577,_0x3114a3))[_0x5dd2('0x27')](handleError(_0x3ec577,null));};exports[_0x5dd2('0x52')]=function(_0x2b1aa2,_0xe911b3){var _0x58162f={'raw':!![],'where':{'id':_0x2b1aa2[_0x5dd2('0x53')]['id']}},_0x2d6bc5={};_0x2d6bc5[_0x5dd2('0x40')]=_[_0x5dd2('0x42')](db[_0x5dd2('0x3c')]['rawAttributes']);_0x2d6bc5[_0x5dd2('0x41')]=_[_0x5dd2('0x42')](_0x2b1aa2[_0x5dd2('0x41')]);_0x2d6bc5['filters']=_[_0x5dd2('0x44')](_0x2d6bc5[_0x5dd2('0x40')],_0x2d6bc5[_0x5dd2('0x41')]);_0x58162f[_0x5dd2('0x45')]=_['intersection'](_0x2d6bc5[_0x5dd2('0x40')],qs[_0x5dd2('0x46')](_0x2b1aa2['query']['fields']));_0x58162f[_0x5dd2('0x45')]=_0x58162f['attributes'][_0x5dd2('0x47')]?_0x58162f[_0x5dd2('0x45')]:_0x2d6bc5[_0x5dd2('0x40')];if(_0x2b1aa2[_0x5dd2('0x41')][_0x5dd2('0x50')]){_0x58162f['include']=[{'all':!![]}];}_0x58162f=_[_0x5dd2('0x4f')]({},_0x58162f,_0x2b1aa2[_0x5dd2('0x54')]);return db[_0x5dd2('0x3c')][_0x5dd2('0x55')](_0x58162f)[_0x5dd2('0x37')](handleEntityNotFound(_0xe911b3,null))[_0x5dd2('0x37')](respondWithResult(_0xe911b3,null))[_0x5dd2('0x27')](handleError(_0xe911b3,null));};exports[_0x5dd2('0x56')]=function(_0x28ec6c,_0x13c087){return db[_0x5dd2('0x3c')]['create'](_0x28ec6c[_0x5dd2('0x57')],{})[_0x5dd2('0x37')](respondWithResult(_0x13c087,0xc9))['catch'](handleError(_0x13c087,null));};exports[_0x5dd2('0x35')]=function(_0x4f83bd,_0x44ae76){if(_0x4f83bd[_0x5dd2('0x57')]['id']){delete _0x4f83bd[_0x5dd2('0x57')]['id'];}return db[_0x5dd2('0x3c')][_0x5dd2('0x55')]({'where':{'id':_0x4f83bd[_0x5dd2('0x53')]['id']}})[_0x5dd2('0x37')](handleEntityNotFound(_0x44ae76,null))[_0x5dd2('0x37')](saveUpdates(_0x4f83bd[_0x5dd2('0x57')],null))['then'](respondWithResult(_0x44ae76,null))[_0x5dd2('0x27')](handleError(_0x44ae76,null));};exports[_0x5dd2('0x36')]=function(_0x30c7a5,_0x2e8296){return db[_0x5dd2('0x3c')]['find']({'where':{'id':_0x30c7a5['params']['id']}})[_0x5dd2('0x37')](handleEntityNotFound(_0x2e8296,null))['then'](removeEntity(_0x2e8296,null))[_0x5dd2('0x27')](handleError(_0x2e8296,null));};exports['describe']=function(_0x773e85,_0x4c073e){return db[_0x5dd2('0x3c')]['describe']()[_0x5dd2('0x37')](respondWithResult(_0x4c073e,null))[_0x5dd2('0x27')](handleError(_0x4c073e,null));};var interaction_log=require(_0x5dd2('0x14'))(_0x5dd2('0x58'));exports[_0x5dd2('0x59')]=function(_0x22cbbb,_0x3ef485,_0x3925c3){var _0x3d414f={'agent':{},'channel':_0x5dd2('0x5a')};if(_0x22cbbb[_0x5dd2('0x57')]['id']){delete _0x22cbbb['body']['id'];}_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x5b')]=!![];_0x22cbbb[_0x5dd2('0x57')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x22cbbb['body'][_0x5dd2('0x5c')]=_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x5c')]||_0x22cbbb['user']['id'];_0x3d414f['agent']['id']=_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x5c')];return db[_0x5dd2('0x3c')]['find']({'where':{'id':_0x22cbbb['params']['id'],'UserId':null}})[_0x5dd2('0x37')](handleEntityNotFound(_0x3ef485,null))[_0x5dd2('0x37')](saveUpdates(_0x22cbbb[_0x5dd2('0x57')],null))[_0x5dd2('0x37')](function(_0x3b70b0){if(_0x3b70b0){_0x3d414f[_0x5dd2('0x25')]=_0x3b70b0[_0x5dd2('0x5d')]({'plain':!![]});return db[_0x5dd2('0x5e')][_0x5dd2('0x55')]({'where':{'id':_0x3b70b0[_0x5dd2('0x5f')]}});}return null;})[_0x5dd2('0x37')](handleEntityNotFound(_0x3ef485,null))[_0x5dd2('0x37')](function(_0x16c7ee){if(_0x16c7ee){return _0x16c7ee[_0x5dd2('0x35')]({'UserId':_0x22cbbb[_0x5dd2('0x57')]['UserId'],'read1stAt':_['isNil'](_0x16c7ee[_0x5dd2('0x60')])?moment()[_0x5dd2('0x61')](_0x5dd2('0x62')):undefined});}return null;})[_0x5dd2('0x37')](function(_0x108707){if(_0x108707){_0x3d414f[_0x5dd2('0x63')]=_0x108707[_0x5dd2('0x5d')]({'plain':!![]});interaction_log[_0x5dd2('0x21')](_0x5dd2('0x64'),_0x22cbbb[_0x5dd2('0x65')]['id'],_0x22cbbb['user'][_0x5dd2('0x38')],_0x22cbbb[_0x5dd2('0x65')]['role'],_0x3d414f[_0x5dd2('0x63')]['id'],_0x22cbbb[_0x5dd2('0x57')]?JSON[_0x5dd2('0x66')](_0x22cbbb[_0x5dd2('0x57')]):_0x5dd2('0x67'));return respondWithRpcPromise(_0x5dd2('0x68'),_0x5dd2('0x69'),_0x3d414f);}return null;})[_0x5dd2('0x37')](function(_0x3a8689){var _0x5e16b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a8689[_0x5dd2('0x25')]['ContactId'];return db[_0x5dd2('0x6a')][_0x5dd2('0x41')](_0x5e16b3,{'type':db[_0x5dd2('0x6b')]['QueryTypes'][_0x5dd2('0x6c')],'raw':!![]})[_0x5dd2('0x37')](function(_0x58d514){return _0x58d514;});})[_0x5dd2('0x37')](function(_0xa10479){if(_0xa10479){_0x3d414f['message'][_0x5dd2('0x6d')]=_0xa10479[0x0];if(!_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x5c')])return;return db[_0x5dd2('0x6e')]['find']({'where':{'id':_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x5c')],'role':_0x5dd2('0x6f')},'attributes':['id',_0x5dd2('0x38'),_0x5dd2('0x70'),_0x5dd2('0x71'),'internal'],'raw':!![]});}return null;})[_0x5dd2('0x37')](function(_0xf2c241){if(!_0xf2c241)return null;_0x3d414f[_0x5dd2('0x25')][_0x5dd2('0x6f')]=_0xf2c241;return _0x3d414f;})[_0x5dd2('0x37')](function(_0x3b9afb){if(_0x3b9afb){if(_0x22cbbb[_0x5dd2('0x57')][_0x5dd2('0x72')]){_0x3d414f['message'][_0x5dd2('0x73')]=util['format'](_0x5dd2('0x74'),_0x22cbbb['user'][_0x5dd2('0x38')]);_0x3d414f['message']['channel']=_0x3d414f[_0x5dd2('0x75')];_0x3d414f[_0x5dd2('0x25')][_0x5dd2('0x76')]=_0x5dd2('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x3d414f[_0x5dd2('0x25')]},client9002)[_0x5dd2('0x37')](function(){return _0x3d414f;});}return _0x3d414f;}return null;})[_0x5dd2('0x37')](respondWithResult(_0x3ef485,null))[_0x5dd2('0x27')](handleError(_0x3ef485,null));};var interaction_log=require(_0x5dd2('0x14'))(_0x5dd2('0x58'));exports['reject']=function(_0x3be6d1,_0x2efad8,_0x253546){var _0x293f49={'agent':{},'channel':'sms'};if(_0x3be6d1[_0x5dd2('0x57')]['id']){delete _0x3be6d1[_0x5dd2('0x57')]['id'];}_0x3be6d1[_0x5dd2('0x57')][_0x5dd2('0x5c')]=_0x3be6d1['body'][_0x5dd2('0x5c')]||_0x3be6d1[_0x5dd2('0x65')]['id'];_0x293f49[_0x5dd2('0x6f')]['id']=_0x3be6d1[_0x5dd2('0x57')]['UserId'];return db[_0x5dd2('0x3c')]['find']({'where':{'id':_0x3be6d1[_0x5dd2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2efad8,null))['then'](function(_0x21eeb6){if(_0x21eeb6){_0x293f49[_0x5dd2('0x25')]=_0x21eeb6[_0x5dd2('0x5d')]({'plain':!![]});return db[_0x5dd2('0x5e')][_0x5dd2('0x55')]({'where':{'id':_0x21eeb6['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2efad8,null))[_0x5dd2('0x37')](function(_0x4ff176){if(_0x4ff176){_0x293f49[_0x5dd2('0x63')]=_0x4ff176[_0x5dd2('0x5d')]({'plain':!![]});interaction_log[_0x5dd2('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3be6d1[_0x5dd2('0x65')]['id'],_0x3be6d1[_0x5dd2('0x65')][_0x5dd2('0x38')],_0x3be6d1[_0x5dd2('0x65')]['role'],_0x293f49[_0x5dd2('0x63')]['id'],_0x3be6d1[_0x5dd2('0x57')]?JSON[_0x5dd2('0x66')](_0x3be6d1[_0x5dd2('0x57')]):_0x5dd2('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x293f49);}return null;})['then'](function(_0x2b6e35){var _0x2691c9=_0x5dd2('0x77')+_0x2b6e35[_0x5dd2('0x25')]['ContactId'];return db[_0x5dd2('0x6a')]['query'](_0x2691c9,{'type':db[_0x5dd2('0x6b')][_0x5dd2('0x78')][_0x5dd2('0x6c')],'raw':!![]})[_0x5dd2('0x37')](function(_0x21b655){return _0x21b655;});})[_0x5dd2('0x37')](function(_0x6f2262){if(_0x6f2262){_0x293f49[_0x5dd2('0x25')][_0x5dd2('0x6d')]=_0x6f2262[0x0];if(!_0x3be6d1[_0x5dd2('0x57')][_0x5dd2('0x5c')])return;return db[_0x5dd2('0x6e')][_0x5dd2('0x55')]({'where':{'id':_0x3be6d1[_0x5dd2('0x57')][_0x5dd2('0x5c')],'role':_0x5dd2('0x6f')},'attributes':['id','name',_0x5dd2('0x70'),_0x5dd2('0x71'),_0x5dd2('0x79')],'raw':!![]});}return null;})['then'](function(_0x172544){if(!_0x172544)return null;_0x293f49['message'][_0x5dd2('0x6f')]=_0x172544;return _0x293f49;})[_0x5dd2('0x37')](function(_0x22ab03){if(_0x22ab03){_0x22ab03['message'][_0x5dd2('0x73')]=util[_0x5dd2('0x61')](_0x5dd2('0x74'),_0x3be6d1[_0x5dd2('0x65')]['name']);_0x22ab03[_0x5dd2('0x25')][_0x5dd2('0x75')]=_0x293f49['channel'];_0x22ab03[_0x5dd2('0x25')]['event']=_0x5dd2('0x33');respondWithRpcPromise(_0x5dd2('0x7a'),'EventManager',{'event':_0x5dd2('0x7b'),'message':_0x22ab03['message']},client9002);return _0x293f49;}return null;})[_0x5dd2('0x37')](respondWithResult(_0x2efad8,null))[_0x5dd2('0x27')](handleError(_0x2efad8,null));};exports[_0x5dd2('0x2a')]=function(_0x69403a,_0x4c8233,_0x6dd35a){if(_0x69403a[_0x5dd2('0x57')]['id']){delete _0x69403a[_0x5dd2('0x57')]['id'];}var _0xedfbde;return db[_0x5dd2('0x3c')][_0x5dd2('0x55')]({'where':{'id':_0x69403a[_0x5dd2('0x53')]['id']}})[_0x5dd2('0x37')](handleEntityNotFound(_0x4c8233,null))[_0x5dd2('0x37')](function(_0xb8d60){if(_0xb8d60){_0xedfbde=_0xb8d60;return db[_0x5dd2('0x7c')]['find']({'where':{'id':_0xb8d60[_0x5dd2('0x7d')]}});}})[_0x5dd2('0x37')](handleEntityNotFound(_0x4c8233,null))[_0x5dd2('0x37')](function(_0x2ddf4f){if(_0x2ddf4f){logger[_0x5dd2('0x7e')](_0x5dd2('0x7f'),_0x5dd2('0x2a'),'received\x20delivery\x20report\x20from',_0x2ddf4f[_0x5dd2('0x3f')],util[_0x5dd2('0x80')](_0x69403a[_0x5dd2('0x57')],{'showHidden':![],'depth':null}));switch(_0x2ddf4f[_0x5dd2('0x3f')]){case _0x5dd2('0x81'):if(_0x69403a[_0x5dd2('0x57')][_0x5dd2('0x82')]&&_0x69403a['body'][_0x5dd2('0x82')]===_0xedfbde[_0x5dd2('0x83')]){return _0xedfbde[_0x5dd2('0x35')]({'read':!![]});}else{logger[_0x5dd2('0x24')](_0x5dd2('0x84'),_0x5dd2('0x2a'),_0x5dd2('0x81'),util[_0x5dd2('0x80')](_0x69403a[_0x5dd2('0x57')],{'showHidden':![],'depth':null}));}break;case _0x5dd2('0x85'):if(_0x69403a[_0x5dd2('0x57')]['MessageUUID']&&_0x69403a['body'][_0x5dd2('0x86')]===_0xedfbde[_0x5dd2('0x83')]&&_[_0x5dd2('0x87')]([_0x5dd2('0x88'),'delivered'],_0x69403a[_0x5dd2('0x57')]['Status'])>=0x0){return _0xedfbde[_0x5dd2('0x35')]({'read':!![]});}else{logger[_0x5dd2('0x24')](_0x5dd2('0x84'),_0x5dd2('0x2a'),_0x5dd2('0x89'),util['inspect'](_0x69403a[_0x5dd2('0x57')],{'showHidden':![],'depth':null}));}break;case _0x5dd2('0x8a'):var _0x2a1b05=_0x69403a[_0x5dd2('0x57')][_0x5dd2('0x8b')][0x0];if(_0x2a1b05[_0x5dd2('0x2a')][_0x5dd2('0x8c')]===_0x5dd2('0x8d')){return _0xedfbde[_0x5dd2('0x35')]({'read':!![]});}else{logger[_0x5dd2('0x24')](_0x5dd2('0x84'),_0x5dd2('0x2a'),_0x5dd2('0x8a'),util['inspect'](_0x69403a[_0x5dd2('0x57')],{'showHidden':![],'depth':null}));}break;}return _0xedfbde;}})[_0x5dd2('0x37')](respondWithResult(_0x4c8233,null))[_0x5dd2('0x27')](handleError(_0x4c8233,null));};
\ No newline at end of file
index b2e61c8..5320ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e0d=['hasOwnProperty','setMaxListeners','save','update','remove','emit'];(function(_0x279a11,_0x2d08a9){var _0x2dfc11=function(_0x10a58b){while(--_0x10a58b){_0x279a11['push'](_0x279a11['shift']());}};_0x2dfc11(++_0x2d08a9);}(_0x4e0d,0x16f));var _0xd4e0=function(_0xac289b,_0x271c2b){_0xac289b=_0xac289b-0x0;var _0x40e5c9=_0x4e0d[_0xac289b];return _0x40e5c9;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd4e0('0x0')](0x0);var events={'afterCreate':_0xd4e0('0x1'),'afterUpdate':_0xd4e0('0x2'),'afterDestroy':_0xd4e0('0x3')};function emitEvent(_0x3144d2){return function(_0x5da86e,_0x12f0ca,_0x5bde4a){SmsMessageEvents['emit'](_0x3144d2+':'+_0x5da86e['id'],_0x5da86e);SmsMessageEvents[_0xd4e0('0x4')](_0x3144d2,_0x5da86e);_0x5bde4a(null);};}for(var e in events){if(events[_0xd4e0('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0x3177=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','SmsMessage'];(function(_0x4c637b,_0x326ee8){var _0x5c2e10=function(_0x2674f9){while(--_0x2674f9){_0x4c637b['push'](_0x4c637b['shift']());}};_0x5c2e10(++_0x326ee8);}(_0x3177,0xa6));var _0x7317=function(_0x2abd03,_0x15bd78){_0x2abd03=_0x2abd03-0x0;var _0x397306=_0x3177[_0x2abd03];return _0x397306;};'use strict';var EventEmitter=require(_0x7317('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x7317('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7317('0x2')](0x0);var events={'afterCreate':_0x7317('0x3'),'afterUpdate':_0x7317('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5097ff){return function(_0x45affa,_0x48e3f3,_0x36096f){SmsMessageEvents[_0x7317('0x5')](_0x5097ff+':'+_0x45affa['id'],_0x45affa);SmsMessageEvents['emit'](_0x5097ff,_0x45affa);_0x36096f(null);};}for(var e in events){if(events[_0x7317('0x6')](e)){var event=events[e];SmsMessage[_0x7317('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
index ab373a8..f7c622e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8482=['SmsInteraction','findOne','then','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','session_key','total_sent','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','head','clickSend','plivo','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','sort','md5','digest','hex','signature=','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','messageId','body','models','get','direction','toLowerCase','out','secret','UserId'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x8482,0x14e));var _0x2848=function(_0x31a835,_0x251551){_0x31a835=_0x31a835-0x0;var _0x59e35a=_0x8482[_0x31a835];return _0x59e35a;};'use strict';var _=require('lodash');var util=require(_0x2848('0x0'));var logger=require(_0x2848('0x1'))(_0x2848('0x2'));var moment=require(_0x2848('0x3'));var BPromise=require(_0x2848('0x4'));var rp=require(_0x2848('0x5'));var fs=require('fs');var path=require(_0x2848('0x6'));var rimraf=require(_0x2848('0x7'));var config=require(_0x2848('0x8'));var attributes=require(_0x2848('0x9'));module['exports']=function(_0x1eb602,_0x44e406){return _0x1eb602['define'](_0x2848('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2848('0xb')]},{'name':'fti_sms_messages','fields':[_0x2848('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bcc65,_0x490172,_0x2e1940){var _0x241c2f=_0x1eb602[_0x2848('0xd')];var _0x4250a0=_0x5bcc65[_0x2848('0xe')]({'plain':!![]});if(_0x4250a0[_0x2848('0xf')]['toLowerCase']()==='in'||_0x4250a0['direction'][_0x2848('0x10')]()===_0x2848('0x11')&&!_0x4250a0[_0x2848('0x12')]&&!_['isNil'](_0x4250a0[_0x2848('0x13')])){_0x241c2f[_0x2848('0x14')][_0x2848('0x15')]({'where':{'id':_0x4250a0['SmsInteractionId']}})[_0x2848('0x16')](function(_0x501a0e){if(_0x501a0e){_0x501a0e[_0x2848('0x17')]({'lastMsgAt':_0x4250a0['createdAt'],'lastMsgDirection':_0x4250a0[_0x2848('0xf')][_0x2848('0x10')]()});}})[_0x2848('0x18')](function(_0x59f39a){console['error'](_0x59f39a);});}if(_0x4250a0['direction']==='out'&&!_0x4250a0[_0x2848('0x12')]){var _0x1acd41;_0x241c2f[_0x2848('0x19')][_0x2848('0x1a')]({'where':{'id':_0x4250a0[_0x2848('0x1b')]},'raw':!![]})[_0x2848('0x16')](function(_0x34de28){_0x1acd41=_0x34de28;if(_0x1acd41&&_0x1acd41[_0x2848('0x1c')]){switch(_0x1acd41[_0x2848('0x1c')]){case _0x2848('0x1d'):var _0x165f21=require('twilio');if(_0x1acd41[_0x2848('0x1e')]&&_0x1acd41[_0x2848('0x1f')]&&_0x1acd41[_0x2848('0x20')]){var _0x5748ae=new _0x165f21(_0x1acd41[_0x2848('0x1e')],_0x1acd41[_0x2848('0x1f')]);_0x5748ae[_0x2848('0x21')][_0x2848('0x22')]({'body':_0x4250a0[_0x2848('0xc')],'to':_0x4250a0['phone'],'from':_0x1acd41[_0x2848('0x20')],'statusCallback':_0x1acd41[_0x2848('0x23')]+_0x2848('0x24')+_0x4250a0['id']+_0x2848('0x25')+_0x1acd41[_0x2848('0x26')]})[_0x2848('0x16')](function(_0x5f38e2){if(_0x5f38e2[_0x2848('0x27')]){return _0x5bcc65['update']({'messageId':_0x5f38e2[_0x2848('0x27')]});}})[_0x2848('0x18')](function(_0x2d936a){logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2848('0x29'),_0x2848('0x1d'),util[_0x2848('0x2a')](_0x2d936a,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x4cb6db=_0x2848('0x2c');if(_0x1acd41[_0x2848('0x2d')]&&_0x1acd41[_0x2848('0x2e')]){var _0x3f915b={'recipient':[_0x4250a0[_0x2848('0x20')]],'message':_0x4250a0[_0x2848('0xc')],'message_type':_0x1acd41['smsMethod']};if(_0x1acd41['smsMethod']&&_0x1acd41[_0x2848('0x2f')]!=='SI'){_0x3f915b[_0x2848('0x30')]=_0x1acd41[_0x2848('0x20')];}var _0x6249a={'url':_0x4cb6db+_0x2848('0x31')+_0x1acd41[_0x2848('0x2d')]+_0x2848('0x32')+_0x1acd41[_0x2848('0x2e')],'method':_0x2848('0x33')};rp(_0x6249a)[_0x2848('0x16')](function(_0x1c23b8){var _0x479d5f=_0x1c23b8[_0x2848('0x34')](';');var _0x376438={'user_key':_0x479d5f[0x0],'session_key':_0x479d5f[0x1]};_0x6249a={'url':_0x4cb6db+_0x2848('0x35'),'method':_0x2848('0x36'),'headers':{'user_key':_0x376438['user_key'],'Session_key':_0x376438[_0x2848('0x37')]},'json':!![],'body':_0x3f915b};return rp(_0x6249a);})[_0x2848('0x16')](function(_0x163889){if(_0x163889[_0x2848('0x38')]>=0x1){var _0x4f6206={'messageId':_0x163889['internal_order_id']};if(_0x1acd41['smsMethod']!=='GP'||!_0x1acd41['deliveryReport']){_0x4f6206[_0x2848('0x39')]=!![];}return _0x5bcc65[_0x2848('0x17')](_0x4f6206);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2848('0x29'),_0x2848('0x3a'),util[_0x2848('0x2a')](_0x163889,{'showHidden':![],'depth':null}));}})[_0x2848('0x18')](function(_0x29bb2f){return logger['error'](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x3a'),util['inspect'](_0x29bb2f,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x3a'),_0x2848('0x3b'));}break;case'connectel':if(_0x1acd41['authToken']){var _0x3c3092={'recipient':_0x4250a0[_0x2848('0x20')],'message':_0x4250a0[_0x2848('0xc')],'sender':_0x1acd41[_0x2848('0x3c')]||_0x1acd41[_0x2848('0x20')],'authorization':_0x1acd41[_0x2848('0x1f')]};var _0x490172={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x3c3092,'json':!![]};rp(_0x490172)['then'](function(_0x5c3d4e){var _0x419ed2={'messageId':_0x5c3d4e['requestid']};if(!_0x1acd41[_0x2848('0x3d')]){_0x419ed2['read']=!![];}return _0x5bcc65[_0x2848('0x17')](_0x419ed2);})[_0x2848('0x18')](function(_0x600b12){logger['error'](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x3e'),util[_0x2848('0x2a')](_0x600b12,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2848('0x3e'),_0x2848('0x3f'));}break;case _0x2848('0x40'):if(_0x1acd41[_0x2848('0x2d')]&&_0x1acd41[_0x2848('0x2e')]){var _0x3c3092={'messages':[{'source':'xCALLY\x20Motion','to':_0x4250a0[_0x2848('0x20')],'body':_0x4250a0['body'],'from':_0x1acd41[_0x2848('0x3c')]||_0x1acd41['phone']}]};var _0x308e2f=util['format']('%s:%s',_0x1acd41['username'],_0x1acd41['password']);var _0x490172={'method':_0x2848('0x36'),'uri':_0x2848('0x41'),'body':_0x3c3092,'headers':{'Authorization':util[_0x2848('0x42')](_0x2848('0x43'),new Buffer(_0x308e2f)[_0x2848('0x44')](_0x2848('0x45')))},'json':!![]};rp(_0x490172)[_0x2848('0x16')](function(_0x2f5393){if(_0x2f5393['http_code']>=0xc8&&_0x2f5393[_0x2848('0x46')]<=0xce){if(_0x2f5393[_0x2848('0x47')]&&_0x2f5393[_0x2848('0x47')]['queued_count']>0x0){var _0x1178ef=_[_0x2848('0x48')](_0x2f5393[_0x2848('0x47')][_0x2848('0x21')]);var _0x10d2f6={'messageId':_0x1178ef['message_id']};if(!_0x1acd41[_0x2848('0x3d')]){_0x10d2f6[_0x2848('0x39')]=!![];}return _0x5bcc65[_0x2848('0x17')](_0x10d2f6);}else{logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2848('0x29'),_0x2848('0x49'),util[_0x2848('0x2a')](_0x2f5393,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x2848('0x2b'),_0x2848('0x29'),'clickSend',util['inspect'](_0x2f5393,{'showHidden':![],'depth':null}));}})[_0x2848('0x18')](function(_0x23c8a3){logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),'clickSend',util[_0x2848('0x2a')](_0x23c8a3,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x49'),_0x2848('0x3b'));}break;case _0x2848('0x4a'):if(_0x1acd41[_0x2848('0x4b')]&&_0x1acd41[_0x2848('0x1f')]){var _0x3c3092={'dst':_0x4250a0[_0x2848('0x20')],'text':_0x4250a0[_0x2848('0xc')],'src':_0x1acd41[_0x2848('0x3c')]||_0x1acd41[_0x2848('0x20')],'url':_0x1acd41[_0x2848('0x23')]+_0x2848('0x24')+_0x4250a0['id']+_0x2848('0x25')+_0x1acd41[_0x2848('0x26')]};var _0x308e2f=util[_0x2848('0x42')]('%s:%s',_0x1acd41[_0x2848('0x4b')],_0x1acd41[_0x2848('0x1f')]);var _0x490172={'method':_0x2848('0x36'),'uri':util[_0x2848('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1acd41[_0x2848('0x4b')]),'body':_0x3c3092,'headers':{'Authorization':util['format'](_0x2848('0x43'),new Buffer(_0x308e2f)[_0x2848('0x44')]('base64'))},'json':!![]};rp(_0x490172)[_0x2848('0x16')](function(_0x463a51){var _0x16a9ab={'messageId':_0x463a51[_0x2848('0x4c')][0x0]};return _0x5bcc65[_0x2848('0x17')](_0x16a9ab);})[_0x2848('0x18')](function(_0x444ad7){logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util['inspect'](_0x444ad7,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x4a'),_0x2848('0x4d'));}break;case'infobip':if(_0x1acd41[_0x2848('0x2d')]&&_0x1acd41[_0x2848('0x2e')]){if(_0x1acd41[_0x2848('0x4e')]){var _0x22eebe={'method':_0x2848('0x36'),'uri':_0x1acd41[_0x2848('0x4e')]+'/auth/1/session','body':{'username':_0x1acd41['username'],'password':_0x1acd41[_0x2848('0x2e')]},'json':!![]};return rp(_0x22eebe)['then'](function(_0xfd55e4){var _0x35d01a={'method':_0x2848('0x36'),'uri':_0x1acd41[_0x2848('0x4e')]+_0x2848('0x4f'),'body':{'messages':[{'from':_0x1acd41[_0x2848('0x20')],'destinations':[{'to':_0x4250a0[_0x2848('0x20')]}],'text':_0x4250a0['body'],'notifyUrl':_0x1acd41['remote']+'/api/sms/messages/'+_0x4250a0['id']+_0x2848('0x25')+_0x1acd41['token'],'notifyContentType':_0x2848('0x50'),'callbackData':_0x1acd41[_0x2848('0x20')]+';'+_0x4250a0[_0x2848('0xc')]}]},'headers':{'Authorization':_0x2848('0x51')+_0xfd55e4['token']},'json':!![]};return rp(_0x35d01a)['then'](function(_0x10fbed){if(_0x10fbed[_0x2848('0x21')]){var _0x28831c={'messageId':_0x10fbed[_0x2848('0x21')][0x0][_0x2848('0xb')]};if(!_0x1acd41['deliveryReport']){_0x28831c[_0x2848('0x39')]=!![];}return _0x5bcc65[_0x2848('0x17')](_0x28831c);}else{return logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),'infobip',util[_0x2848('0x2a')](_0x10fbed,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x59819d){return logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2848('0x29'),_0x2848('0x52'),util[_0x2848('0x2a')](_0x59819d,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x52'),_0x2848('0x53'));}}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2848('0x54'):var _0x1fc1e0=require(_0x2848('0x55'));if(_0x1acd41[_0x2848('0x56')]){var _0x4cffc8={};_0x4cffc8[_0x2848('0x57')]=_0x1acd41[_0x2848('0x2d')];_0x4cffc8['phone']=_0x4250a0[_0x2848('0x20')];_0x4cffc8[_0x2848('0x30')]=_0x1acd41[_0x2848('0x20')];_0x4cffc8[_0x2848('0x58')]=_0x4250a0[_0x2848('0xc')];_0x4cffc8['timestamp']=+new Date();var _0x55ebb8='';var _0xa60a2='';var _0x11a126=Object['keys'](_0x4cffc8);_0x11a126[_0x2848('0x59')]();for(var _0x41ec3a=0x0;_0x41ec3a<_0x11a126['length'];_0x41ec3a++){if(_0x55ebb8!=''){_0x55ebb8+='&';}_0x55ebb8+=_0x11a126[_0x41ec3a]+'='+encodeURIComponent(_0x4cffc8[_0x11a126[_0x41ec3a]]);_0xa60a2+=_0x4cffc8[_0x11a126[_0x41ec3a]];}_0xa60a2+=_0x1acd41[_0x2848('0x56')];_0xa60a2=_0x1fc1e0['createHash'](_0x2848('0x5a'))[_0x2848('0x17')](_0xa60a2)[_0x2848('0x5b')](_0x2848('0x5c'));if(_0x55ebb8!==''){_0x55ebb8+='&';}_0x55ebb8+=_0x2848('0x5d')+_0xa60a2;var _0x6249a={'method':_0x2848('0x33'),'uri':_0x1acd41[_0x2848('0x4e')]+_0x2848('0x5e')+_0x55ebb8,'json':!![]};return rp(_0x6249a)[_0x2848('0x16')](function(_0x169f47){var _0xe24f7f=Object[_0x2848('0x5f')](_0x169f47);if(_0x169f47[_0xe24f7f[0x0]]['error']&&parseInt(_0x169f47[_0xe24f7f[0x0]][_0x2848('0x28')])===0x0){var _0x3775aa={'messageId':_0x169f47[_0xe24f7f[0x0]]['id_sms']};if(!_0x1acd41['deliveryReport']){_0x3775aa[_0x2848('0x39')]=!![];}return _0x5bcc65[_0x2848('0x17')](_0x3775aa);}else{return logger['error'](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x54'),util[_0x2848('0x2a')](_0x169f47['error'],{'showHidden':![],'depth':null}));}})[_0x2848('0x18')](function(_0x5431ae){return logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x54'),util[_0x2848('0x2a')](_0x5431ae,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2848('0x2b'),_0x2848('0x29'),'csc',_0x2848('0x60'));}break;case'clickatell':if(_0x1acd41[_0x2848('0x56')]){var _0x12bd10={'method':_0x2848('0x36'),'uri':_0x2848('0x61'),'headers':{'Authorization':_0x1acd41[_0x2848('0x56')]},'body':{'content':_0x4250a0['body'],'to':[_0x4250a0['phone']],'from':_0x1acd41[_0x2848('0x20')],'binary':![],'clientMessageId':_0x2848('0x62'),'charset':_0x2848('0x63')},'json':!![]};rp(_0x12bd10)[_0x2848('0x16')](function(_0x398f3d){if(!_0x398f3d[_0x2848('0x28')]){var _0x3cb153={'messageId':_0x398f3d[_0x2848('0x21')][0x0][_0x2848('0x64')]};if(!_0x1acd41[_0x2848('0x3d')]){_0x3cb153['read']=!![];}return _0x5bcc65[_0x2848('0x17')](_0x3cb153);}else{return logger[_0x2848('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2848('0x29'),_0x2848('0x65'),util[_0x2848('0x2a')](_0x398f3d['error'],{'showHidden':![],'depth':null}));}})[_0x2848('0x18')](function(_0x108ea5){return logger['error'](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x65'),util[_0x2848('0x2a')](_0x108ea5,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x65'),_0x2848('0x60'));}break;case _0x2848('0x66'):if(_0x1acd41[_0x2848('0x2d')]&&_0x1acd41['password']){var _0x308e2f=util[_0x2848('0x42')](_0x2848('0x67'),_0x1acd41['username'],_0x1acd41[_0x2848('0x2e')]);var _0x490172={'method':_0x2848('0x36'),'uri':_0x2848('0x68')+_0x1acd41[_0x2848('0x69')]+'/messages','body':{'to':[_0x4250a0[_0x2848('0x20')]],'text':_0x4250a0[_0x2848('0xc')],'from':_0x1acd41[_0x2848('0x20')],'applicationId':_0x1acd41[_0x2848('0x6a')]},'headers':{'Authorization':util[_0x2848('0x42')](_0x2848('0x43'),new Buffer(_0x308e2f)[_0x2848('0x44')](_0x2848('0x45')))},'json':!![]};rp(_0x490172)[_0x2848('0x16')](function(_0x490156){if(_0x490156['id']){var _0x4cba0c={'messageId':_0x490156['id']};return _0x5bcc65[_0x2848('0x17')](_0x4cba0c);}else{logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x66'),util[_0x2848('0x2a')](_0x490156,{'showHidden':![],'depth':null}));}})['catch'](function(_0x442df1){logger[_0x2848('0x28')](_0x2848('0x2b'),'afterCreate',_0x2848('0x66'),util[_0x2848('0x2a')](_0x442df1,{'showHidden':![],'depth':null}));});}else{logger[_0x2848('0x28')](_0x2848('0x2b'),'afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x1acd41[_0x2848('0x56')]){var _0x2cfa4b={};var _0x6249a={'method':_0x2848('0x36'),'uri':_0x2848('0x6b'),'headers':{'Authorization':_0x2848('0x6c')+_0x1acd41[_0x2848('0x56')],'Content-Type':_0x2848('0x50')},'body':{'from':_0x1acd41['phone'],'to':_0x4250a0[_0x2848('0x20')],'text':_0x4250a0[_0x2848('0xc')]},'json':!![]};return rp(_0x6249a)[_0x2848('0x16')](function(_0x58f228){if(_0x58f228[_0x2848('0x6d')]==0xca){_0x2cfa4b[_0x2848('0x6e')]=_0x58f228;var _0xd80715={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x1acd41[_0x2848('0x56')],'Content-Type':'application/json'},'body':{'refid':_0x2cfa4b[_0x2848('0x6e')][_0x2848('0x6f')]},'json':!![]};return rp(_0xd80715)[_0x2848('0x16')](function(_0x18fadf){_0x2cfa4b[_0x2848('0x70')]=_0x18fadf;var _0x82326a={'messageId':_0x2cfa4b['message']['refid'],'read':!![]};return _0x5bcc65[_0x2848('0x17')](_0x82326a);});}else{return logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x71'),util['inspect'](_0x58f228,{'showHidden':![],'depth':null}));}})[_0x2848('0x18')](function(_0x1ddd7b){return logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x71'),util[_0x2848('0x2a')](_0x1ddd7b,{'showHidden':![],'depth':null}));});}else{return logger[_0x2848('0x28')](_0x2848('0x2b'),_0x2848('0x29'),_0x2848('0x71'),_0x2848('0x72'));}break;}}})[_0x2848('0x73')](function(){_0x2e1940();});}else{_0x2e1940();}}},'charset':_0x2848('0x74'),'collate':_0x2848('0x75')});};
\ No newline at end of file
+var _0x4ef1=['models','get','direction','toLowerCase','secret','isNil','UserId','findOne','SmsInteractionId','then','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','/status?token=','token','sid','update','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','queued_count','head','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','remote','/api/sms/messages/','format','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','message_uuid','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','keys','sort','length','createHash','digest','hex','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT'];(function(_0x11c02d,_0x27550c){var _0x6f50c9=function(_0x5711a5){while(--_0x5711a5){_0x11c02d['push'](_0x11c02d['shift']());}};_0x6f50c9(++_0x27550c);}(_0x4ef1,0xeb));var _0x14ef=function(_0x5c65ee,_0x57b017){_0x5c65ee=_0x5c65ee-0x0;var _0x4b8689=_0x4ef1[_0x5c65ee];return _0x4b8689;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var logger=require('../../config/logger')(_0x14ef('0x2'));var moment=require(_0x14ef('0x3'));var BPromise=require(_0x14ef('0x4'));var rp=require(_0x14ef('0x5'));var fs=require('fs');var path=require(_0x14ef('0x6'));var rimraf=require(_0x14ef('0x7'));var config=require(_0x14ef('0x8'));var attributes=require(_0x14ef('0x9'));module[_0x14ef('0xa')]=function(_0x10ed4b,_0x50bfea){return _0x10ed4b[_0x14ef('0xb')](_0x14ef('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x14ef('0xd'),'fields':[_0x14ef('0xd')]},{'name':_0x14ef('0xe'),'fields':[_0x14ef('0xf')],'type':_0x14ef('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59d889,_0x16fb7d,_0x5134d2){var _0x407c42=_0x10ed4b[_0x14ef('0x11')];var _0x3198f1=_0x59d889[_0x14ef('0x12')]({'plain':!![]});if(_0x3198f1['direction']['toLowerCase']()==='in'||_0x3198f1[_0x14ef('0x13')][_0x14ef('0x14')]()==='out'&&!_0x3198f1[_0x14ef('0x15')]&&!_[_0x14ef('0x16')](_0x3198f1[_0x14ef('0x17')])){_0x407c42['SmsInteraction'][_0x14ef('0x18')]({'where':{'id':_0x3198f1[_0x14ef('0x19')]}})[_0x14ef('0x1a')](function(_0xa9e67d){if(_0xa9e67d){_0xa9e67d['update']({'lastMsgAt':_0x3198f1[_0x14ef('0x1b')],'lastMsgDirection':_0x3198f1[_0x14ef('0x13')][_0x14ef('0x14')]()});}})[_0x14ef('0x1c')](function(_0x5364e5){console[_0x14ef('0x1d')](_0x5364e5);});}if(_0x3198f1[_0x14ef('0x13')]===_0x14ef('0x1e')&&!_0x3198f1[_0x14ef('0x15')]){var _0x42f3cc;_0x407c42[_0x14ef('0x1f')][_0x14ef('0x20')]({'where':{'id':_0x3198f1[_0x14ef('0x21')]},'raw':!![]})[_0x14ef('0x1a')](function(_0x3b5b23){_0x42f3cc=_0x3b5b23;if(_0x42f3cc&&_0x42f3cc[_0x14ef('0x22')]){switch(_0x42f3cc[_0x14ef('0x22')]){case _0x14ef('0x23'):var _0x4f6314=require('twilio');if(_0x42f3cc['accountSid']&&_0x42f3cc[_0x14ef('0x24')]&&_0x42f3cc[_0x14ef('0x25')]){var _0x376bac=new _0x4f6314(_0x42f3cc[_0x14ef('0x26')],_0x42f3cc[_0x14ef('0x24')]);_0x376bac[_0x14ef('0x27')][_0x14ef('0x28')]({'body':_0x3198f1[_0x14ef('0xf')],'to':_0x3198f1['phone'],'from':_0x42f3cc[_0x14ef('0x25')],'statusCallback':_0x42f3cc['remote']+'/api/sms/messages/'+_0x3198f1['id']+_0x14ef('0x29')+_0x42f3cc[_0x14ef('0x2a')]})[_0x14ef('0x1a')](function(_0x275cc7){if(_0x275cc7[_0x14ef('0x2b')]){return _0x59d889[_0x14ef('0x2c')]({'messageId':_0x275cc7[_0x14ef('0x2b')]});}})[_0x14ef('0x1c')](function(_0x45105f){logger[_0x14ef('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x23'),util[_0x14ef('0x2e')](_0x45105f,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),'twilio',_0x14ef('0x30'));}break;case'skebby':var _0x597b37=_0x14ef('0x31');if(_0x42f3cc[_0x14ef('0x32')]&&_0x42f3cc[_0x14ef('0x33')]){var _0x344c2a={'recipient':[_0x3198f1[_0x14ef('0x25')]],'message':_0x3198f1[_0x14ef('0xf')],'message_type':_0x42f3cc[_0x14ef('0x34')]};if(_0x42f3cc[_0x14ef('0x34')]&&_0x42f3cc['smsMethod']!=='SI'){_0x344c2a[_0x14ef('0x35')]=_0x42f3cc[_0x14ef('0x25')];}var _0x17719d={'url':_0x597b37+_0x14ef('0x36')+_0x42f3cc[_0x14ef('0x32')]+_0x14ef('0x37')+_0x42f3cc[_0x14ef('0x33')],'method':_0x14ef('0x38')};rp(_0x17719d)[_0x14ef('0x1a')](function(_0x461600){var _0x14945d=_0x461600['split'](';');var _0x5639e7={'user_key':_0x14945d[0x0],'session_key':_0x14945d[0x1]};_0x17719d={'url':_0x597b37+_0x14ef('0x39'),'method':_0x14ef('0x3a'),'headers':{'user_key':_0x5639e7[_0x14ef('0x3b')],'Session_key':_0x5639e7[_0x14ef('0x3c')]},'json':!![],'body':_0x344c2a};return rp(_0x17719d);})['then'](function(_0x59fcbb){if(_0x59fcbb[_0x14ef('0x3d')]>=0x1){var _0x161a78={'messageId':_0x59fcbb[_0x14ef('0x3e')]};if(_0x42f3cc[_0x14ef('0x34')]!=='GP'||!_0x42f3cc[_0x14ef('0x3f')]){_0x161a78[_0x14ef('0x40')]=!![];}return _0x59d889['update'](_0x161a78);}else{return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),'skebby',util['inspect'](_0x59fcbb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x212ea5){return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate','skebby',util[_0x14ef('0x2e')](_0x212ea5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x41'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x14ef('0x42'):if(_0x42f3cc[_0x14ef('0x24')]){var _0x4e8ded={'recipient':_0x3198f1['phone'],'message':_0x3198f1[_0x14ef('0xf')],'sender':_0x42f3cc['senderString']||_0x42f3cc[_0x14ef('0x25')],'authorization':_0x42f3cc[_0x14ef('0x24')]};var _0x16fb7d={'method':_0x14ef('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4e8ded,'json':!![]};rp(_0x16fb7d)[_0x14ef('0x1a')](function(_0x35115e){var _0x471773={'messageId':_0x35115e['requestid']};if(!_0x42f3cc[_0x14ef('0x3f')]){_0x471773[_0x14ef('0x40')]=!![];}return _0x59d889['update'](_0x471773);})[_0x14ef('0x1c')](function(_0x5b0924){logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x42'),util['inspect'](_0x5b0924,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate',_0x14ef('0x42'),_0x14ef('0x43'));}break;case'clicksend':if(_0x42f3cc[_0x14ef('0x32')]&&_0x42f3cc[_0x14ef('0x33')]){var _0x4e8ded={'messages':[{'source':_0x14ef('0x44'),'to':_0x3198f1[_0x14ef('0x25')],'body':_0x3198f1[_0x14ef('0xf')],'from':_0x42f3cc[_0x14ef('0x45')]||_0x42f3cc[_0x14ef('0x25')]}]};var _0x513e8c=util['format'](_0x14ef('0x46'),_0x42f3cc[_0x14ef('0x32')],_0x42f3cc[_0x14ef('0x33')]);var _0x16fb7d={'method':'POST','uri':_0x14ef('0x47'),'body':_0x4e8ded,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x513e8c)['toString'](_0x14ef('0x48')))},'json':!![]};rp(_0x16fb7d)[_0x14ef('0x1a')](function(_0x52e374){if(_0x52e374[_0x14ef('0x49')]>=0xc8&&_0x52e374['http_code']<=0xce){if(_0x52e374['data']&&_0x52e374['data'][_0x14ef('0x4a')]>0x0){var _0x30fc54=_[_0x14ef('0x4b')](_0x52e374[_0x14ef('0x4c')][_0x14ef('0x27')]);var _0x552d1c={'messageId':_0x30fc54[_0x14ef('0x4d')]};if(!_0x42f3cc['deliveryReport']){_0x552d1c[_0x14ef('0x40')]=!![];}return _0x59d889[_0x14ef('0x2c')](_0x552d1c);}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate',_0x14ef('0x4e'),util['inspect'](_0x52e374,{'showHidden':![],'depth':null}));}}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x4e'),util['inspect'](_0x52e374,{'showHidden':![],'depth':null}));}})[_0x14ef('0x1c')](function(_0x4aa604){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x4e'),util['inspect'](_0x4aa604,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x4e'),_0x14ef('0x4f'));}break;case _0x14ef('0x50'):if(_0x42f3cc['authId']&&_0x42f3cc[_0x14ef('0x24')]){var _0x4e8ded={'dst':_0x3198f1[_0x14ef('0x25')],'text':_0x3198f1[_0x14ef('0xf')],'src':_0x42f3cc[_0x14ef('0x45')]||_0x42f3cc[_0x14ef('0x25')],'url':_0x42f3cc[_0x14ef('0x51')]+_0x14ef('0x52')+_0x3198f1['id']+_0x14ef('0x29')+_0x42f3cc[_0x14ef('0x2a')]};var _0x513e8c=util[_0x14ef('0x53')](_0x14ef('0x46'),_0x42f3cc[_0x14ef('0x54')],_0x42f3cc['authToken']);var _0x16fb7d={'method':_0x14ef('0x3a'),'uri':util[_0x14ef('0x53')](_0x14ef('0x55'),_0x42f3cc[_0x14ef('0x54')]),'body':_0x4e8ded,'headers':{'Authorization':util[_0x14ef('0x53')](_0x14ef('0x56'),new Buffer(_0x513e8c)[_0x14ef('0x57')](_0x14ef('0x48')))},'json':!![]};rp(_0x16fb7d)[_0x14ef('0x1a')](function(_0x42b669){var _0x1f4b3f={'messageId':_0x42b669[_0x14ef('0x58')][0x0]};return _0x59d889[_0x14ef('0x2c')](_0x1f4b3f);})[_0x14ef('0x1c')](function(_0x32cdf5){logger[_0x14ef('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x50'),util[_0x14ef('0x2e')](_0x32cdf5,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x14ef('0x59'):if(_0x42f3cc[_0x14ef('0x32')]&&_0x42f3cc['password']){if(_0x42f3cc[_0x14ef('0x5a')]){var _0x5ea9fe={'method':_0x14ef('0x3a'),'uri':_0x42f3cc[_0x14ef('0x5a')]+'/auth/1/session','body':{'username':_0x42f3cc[_0x14ef('0x32')],'password':_0x42f3cc[_0x14ef('0x33')]},'json':!![]};return rp(_0x5ea9fe)[_0x14ef('0x1a')](function(_0x2e5635){var _0x57be94={'method':'POST','uri':_0x42f3cc[_0x14ef('0x5a')]+_0x14ef('0x5b'),'body':{'messages':[{'from':_0x42f3cc[_0x14ef('0x25')],'destinations':[{'to':_0x3198f1[_0x14ef('0x25')]}],'text':_0x3198f1['body'],'notifyUrl':_0x42f3cc['remote']+_0x14ef('0x52')+_0x3198f1['id']+_0x14ef('0x29')+_0x42f3cc['token'],'notifyContentType':'application/json','callbackData':_0x42f3cc[_0x14ef('0x25')]+';'+_0x3198f1[_0x14ef('0xf')]}]},'headers':{'Authorization':_0x14ef('0x5c')+_0x2e5635[_0x14ef('0x2a')]},'json':!![]};return rp(_0x57be94)[_0x14ef('0x1a')](function(_0x450863){if(_0x450863[_0x14ef('0x27')]){var _0x9090b8={'messageId':_0x450863['messages'][0x0][_0x14ef('0xd')]};if(!_0x42f3cc['deliveryReport']){_0x9090b8['read']=!![];}return _0x59d889[_0x14ef('0x2c')](_0x9090b8);}else{return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x59'),util[_0x14ef('0x2e')](_0x450863,{'showHidden':![],'depth':null}));}});})[_0x14ef('0x1c')](function(_0x4d4925){return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),'infobip',util['inspect'](_0x4d4925,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x59'),_0x14ef('0x5d'));}}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x14ef('0x5e'):var _0x326619=require('crypto');if(_0x42f3cc[_0x14ef('0x5f')]){var _0x295042={};_0x295042[_0x14ef('0x60')]=_0x42f3cc[_0x14ef('0x32')];_0x295042[_0x14ef('0x25')]=_0x3198f1[_0x14ef('0x25')];_0x295042[_0x14ef('0x35')]=_0x42f3cc['phone'];_0x295042[_0x14ef('0x61')]=_0x3198f1[_0x14ef('0xf')];_0x295042['timestamp']=+new Date();var _0xf0380a='';var _0x5225df='';var _0xb671b9=Object[_0x14ef('0x62')](_0x295042);_0xb671b9[_0x14ef('0x63')]();for(var _0x3ceeee=0x0;_0x3ceeee<_0xb671b9[_0x14ef('0x64')];_0x3ceeee++){if(_0xf0380a!=''){_0xf0380a+='&';}_0xf0380a+=_0xb671b9[_0x3ceeee]+'='+encodeURIComponent(_0x295042[_0xb671b9[_0x3ceeee]]);_0x5225df+=_0x295042[_0xb671b9[_0x3ceeee]];}_0x5225df+=_0x42f3cc['apiKey'];_0x5225df=_0x326619[_0x14ef('0x65')]('md5')[_0x14ef('0x2c')](_0x5225df)[_0x14ef('0x66')](_0x14ef('0x67'));if(_0xf0380a!==''){_0xf0380a+='&';}_0xf0380a+='signature='+_0x5225df;var _0x17719d={'method':_0x14ef('0x38'),'uri':_0x42f3cc[_0x14ef('0x5a')]+_0x14ef('0x68')+_0xf0380a,'json':!![]};return rp(_0x17719d)[_0x14ef('0x1a')](function(_0x1e6484){var _0x217d57=Object[_0x14ef('0x62')](_0x1e6484);if(_0x1e6484[_0x217d57[0x0]][_0x14ef('0x1d')]&&parseInt(_0x1e6484[_0x217d57[0x0]][_0x14ef('0x1d')])===0x0){var _0x4672de={'messageId':_0x1e6484[_0x217d57[0x0]][_0x14ef('0x69')]};if(!_0x42f3cc['deliveryReport']){_0x4672de[_0x14ef('0x40')]=!![];}return _0x59d889[_0x14ef('0x2c')](_0x4672de);}else{return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x5e'),util[_0x14ef('0x2e')](_0x1e6484[_0x14ef('0x1d')],{'showHidden':![],'depth':null}));}})[_0x14ef('0x1c')](function(_0x5c7dea){return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate','csc',util[_0x14ef('0x2e')](_0x5c7dea,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x42f3cc[_0x14ef('0x5f')]){var _0x48cb68={'method':_0x14ef('0x3a'),'uri':_0x14ef('0x6a'),'headers':{'Authorization':_0x42f3cc[_0x14ef('0x5f')]},'body':{'content':_0x3198f1[_0x14ef('0xf')],'to':[_0x3198f1[_0x14ef('0x25')]],'from':_0x42f3cc[_0x14ef('0x25')],'binary':![],'clientMessageId':_0x14ef('0x6b'),'charset':_0x14ef('0x6c')},'json':!![]};rp(_0x48cb68)['then'](function(_0x4abede){if(!_0x4abede[_0x14ef('0x1d')]){var _0x3bf082={'messageId':_0x4abede[_0x14ef('0x27')][0x0][_0x14ef('0x6d')]};if(!_0x42f3cc['deliveryReport']){_0x3bf082[_0x14ef('0x40')]=!![];}return _0x59d889[_0x14ef('0x2c')](_0x3bf082);}else{return logger['error'](_0x14ef('0x2f'),'afterCreate',_0x14ef('0x6e'),util[_0x14ef('0x2e')](_0x4abede[_0x14ef('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e9114){return logger[_0x14ef('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x6e'),util[_0x14ef('0x2e')](_0x1e9114,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x6e'),_0x14ef('0x6f'));}break;case _0x14ef('0x70'):if(_0x42f3cc['username']&&_0x42f3cc[_0x14ef('0x33')]){var _0x513e8c=util[_0x14ef('0x53')](_0x14ef('0x46'),_0x42f3cc[_0x14ef('0x32')],_0x42f3cc[_0x14ef('0x33')]);var _0x16fb7d={'method':_0x14ef('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x42f3cc[_0x14ef('0x71')]+_0x14ef('0x72'),'body':{'to':[_0x3198f1[_0x14ef('0x25')]],'text':_0x3198f1[_0x14ef('0xf')],'from':_0x42f3cc['phone'],'applicationId':_0x42f3cc['applicationId']},'headers':{'Authorization':util[_0x14ef('0x53')](_0x14ef('0x56'),new Buffer(_0x513e8c)['toString'](_0x14ef('0x48')))},'json':!![]};rp(_0x16fb7d)[_0x14ef('0x1a')](function(_0x27965a){if(_0x27965a['id']){var _0xb59207={'messageId':_0x27965a['id']};return _0x59d889['update'](_0xb59207);}else{logger['error'](_0x14ef('0x2f'),'afterCreate','bandwidth',util[_0x14ef('0x2e')](_0x27965a,{'showHidden':![],'depth':null}));}})[_0x14ef('0x1c')](function(_0x274f9f){logger[_0x14ef('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x14ef('0x2d'),_0x14ef('0x70'),util[_0x14ef('0x2e')](_0x274f9f,{'showHidden':![],'depth':null}));});}else{logger[_0x14ef('0x1d')](_0x14ef('0x2f'),_0x14ef('0x2d'),_0x14ef('0x70'),_0x14ef('0x4f'));}break;case _0x14ef('0x73'):if(_0x42f3cc['apiKey']){var _0x351b6d={};var _0x17719d={'method':_0x14ef('0x3a'),'uri':_0x14ef('0x74'),'headers':{'Authorization':_0x14ef('0x75')+_0x42f3cc[_0x14ef('0x5f')],'Content-Type':_0x14ef('0x76')},'body':{'from':_0x42f3cc[_0x14ef('0x25')],'to':_0x3198f1['phone'],'text':_0x3198f1[_0x14ef('0xf')]},'json':!![]};return rp(_0x17719d)[_0x14ef('0x1a')](function(_0x48ed6b){if(_0x48ed6b['code']==0xca){_0x351b6d['message']=_0x48ed6b;var _0x556b19={'method':_0x14ef('0x3a'),'uri':_0x14ef('0x77'),'headers':{'Authorization':_0x14ef('0x75')+_0x42f3cc[_0x14ef('0x5f')],'Content-Type':_0x14ef('0x76')},'body':{'refid':_0x351b6d[_0x14ef('0x78')][_0x14ef('0x79')]},'json':!![]};return rp(_0x556b19)[_0x14ef('0x1a')](function(_0x5e79ab){_0x351b6d[_0x14ef('0x7a')]=_0x5e79ab;var _0x26ebde={'messageId':_0x351b6d[_0x14ef('0x78')][_0x14ef('0x79')],'read':!![]};return _0x59d889[_0x14ef('0x2c')](_0x26ebde);});}else{return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate','intelepeer',util[_0x14ef('0x2e')](_0x48ed6b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x501a72){return logger['error'](_0x14ef('0x2f'),'afterCreate',_0x14ef('0x73'),util[_0x14ef('0x2e')](_0x501a72,{'showHidden':![],'depth':null}));});}else{return logger[_0x14ef('0x1d')](_0x14ef('0x2f'),'afterCreate','intelepeer',_0x14ef('0x7b'));}break;}}})['finally'](function(){_0x5134d2();});}else{_0x5134d2();}}},'charset':_0x14ef('0x7c'),'collate':_0x14ef('0x7d')});};
\ No newline at end of file
index 503d586..dea5c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8607=['request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateSmsMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket'];(function(_0x499a73,_0x520b6c){var _0x151821=function(_0x50f29a){while(--_0x50f29a){_0x499a73['push'](_0x499a73['shift']());}};_0x151821(++_0x520b6c);}(_0x8607,0x19c));var _0x7860=function(_0x547ef1,_0x142039){_0x547ef1=_0x547ef1-0x0;var _0x1563df=_0x8607[_0x547ef1];return _0x1563df;};'use strict';var _=require(_0x7860('0x0'));var util=require('util');var moment=require(_0x7860('0x1'));var BPromise=require(_0x7860('0x2'));var rs=require(_0x7860('0x3'));var fs=require('fs');var Redis=require(_0x7860('0x4'));var db=require(_0x7860('0x5'))['db'];var utils=require(_0x7860('0x6'));var logger=require(_0x7860('0x7'))(_0x7860('0x8'));var config=require(_0x7860('0x9'));var jayson=require(_0x7860('0xa'));var client=jayson[_0x7860('0xb')][_0x7860('0xc')]({'port':0x232a});config[_0x7860('0xd')]=_[_0x7860('0xe')](config[_0x7860('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7860('0xf'))(new Redis(config[_0x7860('0xd')]));require(_0x7860('0x10'))['register'](socket);function respondWithRpcPromise(_0x4d4813,_0x4b6acd,_0xe8c235){return new BPromise(function(_0x2bd0e2,_0x268fae){return client[_0x7860('0x11')](_0x4d4813,_0xe8c235)[_0x7860('0x12')](function(_0x5d43df){logger['info'](_0x7860('0x13'),_0x4b6acd,_0x7860('0x14'));logger[_0x7860('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4b6acd,_0x7860('0x14'),JSON['stringify'](_0x5d43df));if(_0x5d43df[_0x7860('0x16')]){if(_0x5d43df[_0x7860('0x16')][_0x7860('0x17')]===0x1f4){logger[_0x7860('0x16')](_0x7860('0x13'),_0x4b6acd,_0x5d43df[_0x7860('0x16')]['message']);return _0x268fae(_0x5d43df[_0x7860('0x16')][_0x7860('0x18')]);}logger[_0x7860('0x16')](_0x7860('0x13'),_0x4b6acd,_0x5d43df[_0x7860('0x16')][_0x7860('0x18')]);return _0x2bd0e2(_0x5d43df[_0x7860('0x16')][_0x7860('0x18')]);}else{logger[_0x7860('0x19')]('SmsMessage,\x20%s,\x20%s',_0x4b6acd,_0x7860('0x14'));_0x2bd0e2(_0x5d43df[_0x7860('0x1a')][_0x7860('0x18')]);}})[_0x7860('0x1b')](function(_0x1d6196){logger[_0x7860('0x16')]('SmsMessage,\x20%s,\x20%s',_0x4b6acd,_0x1d6196);_0x268fae(_0x1d6196);});});}exports[_0x7860('0x1c')]=function(_0x2fa1d0){var _0x458e93=this;return new Promise(function(_0x1ae222,_0x3d0f23){return db['SmsMessage'][_0x7860('0x1d')](_0x2fa1d0[_0x7860('0x1e')],{'raw':_0x2fa1d0[_0x7860('0x1f')]?_0x2fa1d0[_0x7860('0x1f')][_0x7860('0x20')]===undefined?!![]:![]:!![]})[_0x7860('0x12')](function(_0x20f99f){logger['info'](_0x7860('0x1c'),_0x2fa1d0);logger[_0x7860('0x15')](_0x7860('0x1c'),_0x2fa1d0,JSON['stringify'](_0x20f99f));_0x1ae222(_0x20f99f);})[_0x7860('0x1b')](function(_0x4bdb5e){logger['error'](_0x7860('0x1c'),_0x4bdb5e[_0x7860('0x18')],_0x2fa1d0);_0x3d0f23(_0x458e93[_0x7860('0x16')](0x1f4,_0x4bdb5e[_0x7860('0x18')]));});});};
\ No newline at end of file
+var _0x527f=['options','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','body'];(function(_0x31f7c5,_0x3bf428){var _0x19fabc=function(_0x268080){while(--_0x268080){_0x31f7c5['push'](_0x31f7c5['shift']());}};_0x19fabc(++_0x3bf428);}(_0x527f,0x1dd));var _0xf527=function(_0x2b4068,_0x529be2){_0x2b4068=_0x2b4068-0x0;var _0x41886b=_0x527f[_0x2b4068];return _0x41886b;};'use strict';var _=require('lodash');var util=require(_0xf527('0x0'));var moment=require(_0xf527('0x1'));var BPromise=require(_0xf527('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf527('0x3'));var db=require(_0xf527('0x4'))['db'];var utils=require(_0xf527('0x5'));var logger=require(_0xf527('0x6'))(_0xf527('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf527('0x8')][_0xf527('0x9')]({'port':0x232a});config[_0xf527('0xa')]=_['defaults'](config[_0xf527('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf527('0xb'))(new Redis(config[_0xf527('0xa')]));require(_0xf527('0xc'))[_0xf527('0xd')](socket);function respondWithRpcPromise(_0x5fd9f,_0x167e79,_0x1b1501){return new BPromise(function(_0x2712a1,_0x2ac946){return client['request'](_0x5fd9f,_0x1b1501)[_0xf527('0xe')](function(_0xdc72f){logger[_0xf527('0xf')](_0xf527('0x10'),_0x167e79,_0xf527('0x11'));logger[_0xf527('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167e79,_0xf527('0x11'),JSON[_0xf527('0x13')](_0xdc72f));if(_0xdc72f[_0xf527('0x14')]){if(_0xdc72f[_0xf527('0x14')][_0xf527('0x15')]===0x1f4){logger['error'](_0xf527('0x10'),_0x167e79,_0xdc72f['error'][_0xf527('0x16')]);return _0x2ac946(_0xdc72f[_0xf527('0x14')][_0xf527('0x16')]);}logger[_0xf527('0x14')](_0xf527('0x10'),_0x167e79,_0xdc72f['error']['message']);return _0x2712a1(_0xdc72f[_0xf527('0x14')][_0xf527('0x16')]);}else{logger['info'](_0xf527('0x10'),_0x167e79,'request\x20sent');_0x2712a1(_0xdc72f[_0xf527('0x17')]['message']);}})['catch'](function(_0x1f02eb){logger['error'](_0xf527('0x10'),_0x167e79,_0x1f02eb);_0x2ac946(_0x1f02eb);});});}exports[_0xf527('0x18')]=function(_0xa96668){var _0x440ada=this;return new Promise(function(_0x1bf761,_0x7c697c){return db[_0xf527('0x19')]['create'](_0xa96668[_0xf527('0x1a')],{'raw':_0xa96668[_0xf527('0x1b')]?_0xa96668[_0xf527('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf527('0xe')](function(_0x2bdb7a){logger[_0xf527('0xf')](_0xf527('0x18'),_0xa96668);logger[_0xf527('0x12')](_0xf527('0x18'),_0xa96668,JSON['stringify'](_0x2bdb7a));_0x1bf761(_0x2bdb7a);})['catch'](function(_0x20c153){logger[_0xf527('0x14')]('CreateSmsMessage',_0x20c153[_0xf527('0x16')],_0xa96668);_0x7c697c(_0x440ada[_0xf527('0x14')](0x1f4,_0x20c153[_0xf527('0x16')]));});});};
\ No newline at end of file
index 67d9062..f2d50e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1238=['save','update','removeListener','./smsMessage.events'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x1238,0xb3));var _0x8123=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0x1238[_0x2c2a8e];return _0x3b9e38;};'use strict';var SmsMessageEvents=require(_0x8123('0x0'));var events=[_0x8123('0x1'),'remove',_0x8123('0x2')];function createListener(_0x14fe39,_0x39c67d){return function(_0x1f84ca){_0x39c67d['emit'](_0x14fe39,_0x1f84ca);};}function removeListener(_0x50e4c3,_0x35682a){return function(){SmsMessageEvents[_0x8123('0x3')](_0x50e4c3,_0x35682a);};}exports['register']=function(_0x3b3582){for(var _0x3807e2=0x0,_0x55979d=events['length'];_0x3807e2<_0x55979d;_0x3807e2++){var _0x3c6526=events[_0x3807e2];var _0x27dc6e=createListener('smsMessage:'+_0x3c6526,_0x3b3582);SmsMessageEvents['on'](_0x3c6526,_0x27dc6e);}};
\ No newline at end of file
+var _0x906b=['update','emit','register','./smsMessage.events'];(function(_0xa19758,_0x2c5dba){var _0x2397cc=function(_0x103778){while(--_0x103778){_0xa19758['push'](_0xa19758['shift']());}};_0x2397cc(++_0x2c5dba);}(_0x906b,0xef));var _0xb906=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x906b[_0x53afa6];return _0x51f86a;};'use strict';var SmsMessageEvents=require(_0xb906('0x0'));var events=['save','remove',_0xb906('0x1')];function createListener(_0x25dba0,_0xcd810a){return function(_0x27a325){_0xcd810a[_0xb906('0x2')](_0x25dba0,_0x27a325);};}function removeListener(_0x425d1c,_0x2cabc3){return function(){SmsMessageEvents['removeListener'](_0x425d1c,_0x2cabc3);};}exports[_0xb906('0x3')]=function(_0x5e0a9a){for(var _0x245438=0x0,_0x4d8d58=events['length'];_0x245438<_0x4d8d58;_0x245438++){var _0x5c0725=events[_0x245438];var _0x5010d8=createListener('smsMessage:'+_0x5c0725,_0x5e0a9a);SmsMessageEvents['on'](_0x5c0725,_0x5010d8);}};
\ No newline at end of file
index bf9046f..935b5b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd5e=['/:id/teams','addTeams','addAgents','put','update','delete','/:id','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','show','/:id/members','getTeams','/:id/users','post','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xcd5e,0x95));var _0xecd5=function(_0x57f84c,_0x4cc063){_0x57f84c=_0x57f84c-0x0;var _0xd3109f=_0xcd5e[_0x57f84c];return _0xd3109f;};'use strict';var multer=require(_0xecd5('0x0'));var util=require(_0xecd5('0x1'));var path=require(_0xecd5('0x2'));var timeout=require(_0xecd5('0x3'));var express=require(_0xecd5('0x4'));var router=express[_0xecd5('0x5')]();var fs_extra=require(_0xecd5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xecd5('0x7'));var config=require(_0xecd5('0x8'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0xecd5('0x9')](),controller['index']);router['get'](_0xecd5('0xa'),auth[_0xecd5('0x9')](),controller[_0xecd5('0xb')]);router[_0xecd5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xecd5('0xd')]);router[_0xecd5('0xc')](_0xecd5('0xe'),auth[_0xecd5('0x9')](),controller['getMembers']);router[_0xecd5('0xc')]('/:id/teams',auth[_0xecd5('0x9')](),controller[_0xecd5('0xf')]);router[_0xecd5('0xc')](_0xecd5('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0xecd5('0x11')]('/',auth['isAuthenticated'](),controller[_0xecd5('0x12')]);router['post'](_0xecd5('0x13'),auth['isAuthenticated'](),controller[_0xecd5('0x14')]);router[_0xecd5('0x11')]('/:id/users',auth[_0xecd5('0x9')](),controller[_0xecd5('0x15')]);router[_0xecd5('0x16')]('/:id',auth[_0xecd5('0x9')](),controller[_0xecd5('0x17')]);router[_0xecd5('0x18')](_0xecd5('0x19'),auth[_0xecd5('0x9')](),controller['destroy']);router[_0xecd5('0x18')](_0xecd5('0x13'),auth[_0xecd5('0x9')](),controller['removeTeams']);router[_0xecd5('0x18')](_0xecd5('0x10'),auth[_0xecd5('0x9')](),controller[_0xecd5('0x1a')]);module[_0xecd5('0x1b')]=router;
\ No newline at end of file
+var _0x7e5f=['getMembers','/:id/users','post','create','/:id/teams','addAgents','update','delete','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/:id','show'];(function(_0x46d4af,_0x1f255e){var _0x3d7870=function(_0x432257){while(--_0x432257){_0x46d4af['push'](_0x46d4af['shift']());}};_0x3d7870(++_0x1f255e);}(_0x7e5f,0x99));var _0xf7e5=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x7e5f[_0x5948dd];return _0xb1f8be;};'use strict';var multer=require(_0xf7e5('0x0'));var util=require('util');var path=require(_0xf7e5('0x1'));var timeout=require(_0xf7e5('0x2'));var express=require(_0xf7e5('0x3'));var router=express[_0xf7e5('0x4')]();var fs_extra=require(_0xf7e5('0x5'));var auth=require(_0xf7e5('0x6'));var interaction=require(_0xf7e5('0x7'));var config=require(_0xf7e5('0x8'));var controller=require(_0xf7e5('0x9'));router['get']('/',auth[_0xf7e5('0xa')](),controller[_0xf7e5('0xb')]);router[_0xf7e5('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf7e5('0xc')](_0xf7e5('0xd'),auth[_0xf7e5('0xa')](),controller[_0xf7e5('0xe')]);router[_0xf7e5('0xc')]('/:id/members',auth[_0xf7e5('0xa')](),controller[_0xf7e5('0xf')]);router[_0xf7e5('0xc')]('/:id/teams',auth[_0xf7e5('0xa')](),controller['getTeams']);router[_0xf7e5('0xc')](_0xf7e5('0x10'),auth[_0xf7e5('0xa')](),controller['getAgents']);router[_0xf7e5('0x11')]('/',auth[_0xf7e5('0xa')](),controller[_0xf7e5('0x12')]);router['post'](_0xf7e5('0x13'),auth[_0xf7e5('0xa')](),controller['addTeams']);router[_0xf7e5('0x11')](_0xf7e5('0x10'),auth[_0xf7e5('0xa')](),controller[_0xf7e5('0x14')]);router['put'](_0xf7e5('0xd'),auth[_0xf7e5('0xa')](),controller[_0xf7e5('0x15')]);router[_0xf7e5('0x16')](_0xf7e5('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xf7e5('0x16')](_0xf7e5('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xf7e5('0x16')](_0xf7e5('0x10'),auth['isAuthenticated'](),controller[_0xf7e5('0x17')]);module['exports']=router;
\ No newline at end of file
index 0b83154..8508217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd787=['INTEGER','ENUM','beepall','roundrobin','sequelize','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd787,0xcf));var _0x7d78=function(_0x7532e2,_0x3bb229){_0x7532e2=_0x7532e2-0x0;var _0xa42ad1=_0xd787[_0x7532e2];return _0xa42ad1;};'use strict';var Sequelize=require(_0x7d78('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d78('0x1')],'unique':_0x7d78('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d78('0x1')]},'timeout':{'type':Sequelize[_0x7d78('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d78('0x4')]('rrmemory',_0x7d78('0x5'),_0x7d78('0x6'))}};
\ No newline at end of file
+var _0x3de9=['beepall','roundrobin','exports','name','STRING','INTEGER','ENUM'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x3de9,0x1b4));var _0x93de=function(_0x4b67bf,_0x575a83){_0x4b67bf=_0x4b67bf-0x0;var _0x2cf0ee=_0x3de9[_0x4b67bf];return _0x2cf0ee;};'use strict';var Sequelize=require('sequelize');module[_0x93de('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x93de('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x93de('0x2')]},'timeout':{'type':Sequelize[_0x93de('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x93de('0x4')]('rrmemory',_0x93de('0x5'),_0x93de('0x6'))}};
\ No newline at end of file
index 03df0d7..33f63c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6f=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','filter','merge','SmsQueue','count','includeAll','include','findAll','catch','show','params','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','SIP','getTeams','findOne','Team','nolimit','Agents','online','voicePause','flatMap','sequelize','addTeams','UserSmsQueue','forEach','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents'];(function(_0x314841,_0x65f8a){var _0x58f682=function(_0x293b8b){while(--_0x293b8b){_0x314841['push'](_0x314841['shift']());}};_0x58f682(++_0x65f8a);}(_0x3a6f,0x1b3));var _0xf3a6=function(_0x42637a,_0x2f3700){_0x42637a=_0x42637a-0x0;var _0x2f577e=_0x3a6f[_0x42637a];return _0x2f577e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3a6('0x0'));var zipdir=require(_0xf3a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3a6('0x2'));var moment=require(_0xf3a6('0x3'));var BPromise=require(_0xf3a6('0x4'));var Mustache=require(_0xf3a6('0x5'));var util=require(_0xf3a6('0x6'));var path=require('path');var sox=require(_0xf3a6('0x7'));var csv=require('to-csv');var ejs=require(_0xf3a6('0x8'));var fs=require('fs');var fs_extra=require(_0xf3a6('0x9'));var _=require(_0xf3a6('0xa'));var squel=require(_0xf3a6('0xb'));var crypto=require(_0xf3a6('0xc'));var jsforce=require(_0xf3a6('0xd'));var deskjs=require(_0xf3a6('0xe'));var toCsv=require(_0xf3a6('0xf'));var querystring=require(_0xf3a6('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3a6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf3a6('0x12'));var as=require(_0xf3a6('0x13'));var hardwareService=require(_0xf3a6('0x14'));var logger=require(_0xf3a6('0x15'))(_0xf3a6('0x16'));var utils=require(_0xf3a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf3a6('0x18'));var db=require(_0xf3a6('0x19'))['db'];config['redis']=_[_0xf3a6('0x1a')](config['redis'],{'host':_0xf3a6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3a6('0x1c')]));require(_0xf3a6('0x1d'))[_0xf3a6('0x1e')](socket);function respondWithStatusCode(_0xd6f862,_0x503838){_0x503838=_0x503838||0xcc;return function(_0x227767){if(_0x227767){return _0xd6f862[_0xf3a6('0x1f')](_0x503838);}return _0xd6f862[_0xf3a6('0x20')](_0x503838)[_0xf3a6('0x21')]();};}function respondWithResult(_0x4824d9,_0x47307a){_0x47307a=_0x47307a||0xc8;return function(_0x56b5b3){if(_0x56b5b3){return _0x4824d9['status'](_0x47307a)['json'](_0x56b5b3);}};}function respondWithFilteredResult(_0x1f1d51,_0x43bb98){return function(_0x1986ab){if(_0x1986ab){var _0x4206dc=typeof _0x43bb98[_0xf3a6('0x22')]===_0xf3a6('0x23')&&typeof _0x43bb98[_0xf3a6('0x24')]===_0xf3a6('0x23');var _0x5cf164=_0x1986ab['count'];var _0x2079a5=_0x4206dc?0x0:_0x43bb98[_0xf3a6('0x22')];var _0x291acd=_0x4206dc?_0x1986ab['count']:_0x43bb98['offset']+_0x43bb98[_0xf3a6('0x24')];var _0x15a3aa;if(_0x291acd>=_0x5cf164){_0x291acd=_0x5cf164;_0x15a3aa=0xc8;}else{_0x15a3aa=0xce;}_0x1f1d51['status'](_0x15a3aa);return _0x1f1d51[_0xf3a6('0x25')](_0xf3a6('0x26'),_0x2079a5+'-'+_0x291acd+'/'+_0x5cf164)['json'](_0x1986ab);}return null;};}function patchUpdates(_0x4aee7b){return function(_0x1402dd){try{jsonpatch[_0xf3a6('0x27')](_0x1402dd,_0x4aee7b,!![]);}catch(_0x346584){return BPromise[_0xf3a6('0x28')](_0x346584);}return _0x1402dd[_0xf3a6('0x29')]();};}function saveUpdates(_0x955db,_0x233871){return function(_0x55c156){if(_0x55c156){return _0x55c156[_0xf3a6('0x2a')](_0x955db)[_0xf3a6('0x2b')](function(_0x48158f){return _0x48158f;});}return null;};}function removeEntity(_0x1704aa,_0xd3917c){return function(_0x32c79d){if(_0x32c79d){return _0x32c79d['destroy']()[_0xf3a6('0x2b')](function(){var _0x2ede9f=_0x32c79d[_0xf3a6('0x2c')]({'plain':!![]});var _0x137d63=_0xf3a6('0x2d');return db[_0xf3a6('0x2e')][_0xf3a6('0x2f')]({'where':{'type':_0x137d63,'resourceId':_0x2ede9f['id']}})[_0xf3a6('0x2b')](function(){return _0x32c79d;});})[_0xf3a6('0x2b')](function(){_0x1704aa[_0xf3a6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4dcb,_0xb0e039){return function(_0x474530){if(!_0x474530){_0x5f4dcb[_0xf3a6('0x1f')](0x194);}return _0x474530;};}function handleError(_0xdd8dc,_0xcba8d8){_0xcba8d8=_0xcba8d8||0x1f4;return function(_0x2ea7ab){logger[_0xf3a6('0x30')](_0x2ea7ab[_0xf3a6('0x31')]);if(_0x2ea7ab['name']){delete _0x2ea7ab['name'];}_0xdd8dc[_0xf3a6('0x20')](_0xcba8d8)[_0xf3a6('0x32')](_0x2ea7ab);};}exports[_0xf3a6('0x33')]=function(_0x1e5744,_0x1c58c6){var _0x48f15f={},_0x24be4b={},_0x226a1b={'count':0x0,'rows':[]};var _0x538297=_[_0xf3a6('0x34')](db['SmsQueue'][_0xf3a6('0x35')],function(_0x467937){return{'name':_0x467937[_0xf3a6('0x36')],'type':_0x467937[_0xf3a6('0x37')][_0xf3a6('0x38')]};});_0x24be4b['model']=_[_0xf3a6('0x34')](_0x538297,_0xf3a6('0x39'));_0x24be4b[_0xf3a6('0x3a')]=_[_0xf3a6('0x3b')](_0x1e5744[_0xf3a6('0x3a')]);_0x24be4b['filters']=_[_0xf3a6('0x3c')](_0x24be4b[_0xf3a6('0x3d')],_0x24be4b['query']);_0x48f15f[_0xf3a6('0x3e')]=_[_0xf3a6('0x3c')](_0x24be4b['model'],qs[_0xf3a6('0x3f')](_0x1e5744[_0xf3a6('0x3a')][_0xf3a6('0x3f')]));_0x48f15f[_0xf3a6('0x3e')]=_0x48f15f[_0xf3a6('0x3e')][_0xf3a6('0x40')]?_0x48f15f[_0xf3a6('0x3e')]:_0x24be4b[_0xf3a6('0x3d')];if(!_0x1e5744[_0xf3a6('0x3a')][_0xf3a6('0x41')]('nolimit')){_0x48f15f[_0xf3a6('0x24')]=qs[_0xf3a6('0x24')](_0x1e5744['query'][_0xf3a6('0x24')]);_0x48f15f['offset']=qs[_0xf3a6('0x22')](_0x1e5744[_0xf3a6('0x3a')][_0xf3a6('0x22')]);}_0x48f15f[_0xf3a6('0x42')]=qs[_0xf3a6('0x43')](_0x1e5744[_0xf3a6('0x3a')]['sort']);_0x48f15f['where']=qs[_0xf3a6('0x44')](_[_0xf3a6('0x45')](_0x1e5744[_0xf3a6('0x3a')],_0x24be4b[_0xf3a6('0x44')]),_0x538297);if(_0x1e5744['query']['filter']){_0x48f15f[_0xf3a6('0x46')]=_['merge'](_0x48f15f[_0xf3a6('0x46')],{'$or':_[_0xf3a6('0x34')](_0x538297,function(_0x11cd97){if(_0x11cd97['type']!==_0xf3a6('0x47')){var _0x49afa1={};_0x49afa1[_0x11cd97[_0xf3a6('0x39')]]={'$like':'%'+_0x1e5744[_0xf3a6('0x3a')][_0xf3a6('0x48')]+'%'};return _0x49afa1;}})});}_0x48f15f=_[_0xf3a6('0x49')]({},_0x48f15f,_0x1e5744['options']);var _0x3be851={'where':_0x48f15f[_0xf3a6('0x46')]};return db[_0xf3a6('0x4a')][_0xf3a6('0x4b')](_0x3be851)['then'](function(_0x18266c){_0x226a1b[_0xf3a6('0x4b')]=_0x18266c;if(_0x1e5744[_0xf3a6('0x3a')][_0xf3a6('0x4c')]){_0x48f15f[_0xf3a6('0x4d')]=[{'all':!![]}];}return db[_0xf3a6('0x4a')][_0xf3a6('0x4e')](_0x48f15f);})['then'](function(_0x48b78c){_0x226a1b['rows']=_0x48b78c;return _0x226a1b;})[_0xf3a6('0x2b')](respondWithFilteredResult(_0x1c58c6,_0x48f15f))[_0xf3a6('0x4f')](handleError(_0x1c58c6,null));};exports[_0xf3a6('0x50')]=function(_0x4beece,_0x17ed35){var _0x56d0e9={'raw':!![],'where':{'id':_0x4beece[_0xf3a6('0x51')]['id']}},_0x111c8a={};_0x111c8a[_0xf3a6('0x3d')]=_['keys'](db[_0xf3a6('0x4a')][_0xf3a6('0x35')]);_0x111c8a['query']=_[_0xf3a6('0x3b')](_0x4beece['query']);_0x111c8a[_0xf3a6('0x44')]=_[_0xf3a6('0x3c')](_0x111c8a[_0xf3a6('0x3d')],_0x111c8a[_0xf3a6('0x3a')]);_0x56d0e9[_0xf3a6('0x3e')]=_[_0xf3a6('0x3c')](_0x111c8a[_0xf3a6('0x3d')],qs['fields'](_0x4beece[_0xf3a6('0x3a')][_0xf3a6('0x3f')]));_0x56d0e9[_0xf3a6('0x3e')]=_0x56d0e9[_0xf3a6('0x3e')][_0xf3a6('0x40')]?_0x56d0e9[_0xf3a6('0x3e')]:_0x111c8a[_0xf3a6('0x3d')];if(_0x4beece[_0xf3a6('0x3a')][_0xf3a6('0x4c')]){_0x56d0e9[_0xf3a6('0x4d')]=[{'all':!![]}];}_0x56d0e9=_[_0xf3a6('0x49')]({},_0x56d0e9,_0x4beece[_0xf3a6('0x52')]);return db['SmsQueue'][_0xf3a6('0x53')](_0x56d0e9)[_0xf3a6('0x2b')](handleEntityNotFound(_0x17ed35,null))[_0xf3a6('0x2b')](respondWithResult(_0x17ed35,null))[_0xf3a6('0x4f')](handleError(_0x17ed35,null));};exports['create']=function(_0x220ebd,_0x3c89fd){return db[_0xf3a6('0x4a')][_0xf3a6('0x54')](_0x220ebd[_0xf3a6('0x55')],{})['then'](function(_0x4fe5d0){var _0x417fff=_0x220ebd['user'][_0xf3a6('0x2c')]({'plain':!![]});if(!_0x417fff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x417fff['role']===_0xf3a6('0x56')){var _0x402b0b=_0x4fe5d0[_0xf3a6('0x2c')]({'plain':!![]});var _0x3a6470=_0xf3a6('0x2d');return db[_0xf3a6('0x57')]['find']({'where':{'name':_0x3a6470,'userProfileId':_0x417fff[_0xf3a6('0x58')]},'raw':!![]})['then'](function(_0x1ab46a){if(_0x1ab46a&&_0x1ab46a[_0xf3a6('0x59')]===0x0){return db[_0xf3a6('0x2e')][_0xf3a6('0x54')]({'name':_0x402b0b[_0xf3a6('0x39')],'resourceId':_0x402b0b['id'],'type':_0x1ab46a[_0xf3a6('0x39')],'sectionId':_0x1ab46a['id']},{})[_0xf3a6('0x2b')](function(){return _0x4fe5d0;});}else{return _0x4fe5d0;}})[_0xf3a6('0x4f')](function(_0x8c3892){logger[_0xf3a6('0x30')](_0xf3a6('0x5a'),_0x8c3892);throw _0x8c3892;});}return _0x4fe5d0;})['then'](respondWithResult(_0x3c89fd,0xc9))[_0xf3a6('0x4f')](handleError(_0x3c89fd,null));};exports[_0xf3a6('0x2a')]=function(_0x248c0a,_0x26b451){if(_0x248c0a['body']['id']){delete _0x248c0a['body']['id'];}return db[_0xf3a6('0x4a')][_0xf3a6('0x53')]({'where':{'id':_0x248c0a[_0xf3a6('0x51')]['id']}})[_0xf3a6('0x2b')](handleEntityNotFound(_0x26b451,null))['then'](saveUpdates(_0x248c0a[_0xf3a6('0x55')],null))[_0xf3a6('0x2b')](respondWithResult(_0x26b451,null))['catch'](handleError(_0x26b451,null));};exports[_0xf3a6('0x2f')]=function(_0x952fe5,_0x5924d5){return db[_0xf3a6('0x4a')][_0xf3a6('0x53')]({'where':{'id':_0x952fe5[_0xf3a6('0x51')]['id']}})[_0xf3a6('0x2b')](handleEntityNotFound(_0x5924d5,null))['then'](removeEntity(_0x5924d5,null))[_0xf3a6('0x4f')](handleError(_0x5924d5,null));};exports[_0xf3a6('0x5b')]=function(_0x4216ea,_0x2eece3){return db[_0xf3a6('0x4a')][_0xf3a6('0x5b')]()['then'](respondWithResult(_0x2eece3,null))[_0xf3a6('0x4f')](handleError(_0x2eece3,null));};exports[_0xf3a6('0x5c')]=function(_0x244e24,_0x16de0c,_0x59c776){var _0x1fc765={'raw':!![],'where':{}},_0x5e1197={},_0x4b430f;return db[_0xf3a6('0x4a')]['findOne']({'where':{'id':_0x244e24[_0xf3a6('0x51')]['id']}})['then'](handleEntityNotFound(_0x16de0c,null))['then'](function(_0x555b76){if(_0x555b76){_0x4b430f=_0x555b76[_0xf3a6('0x2c')]({'plain':!![]});_0x5e1197[_0xf3a6('0x3d')]=_[_0xf3a6('0x3b')](db['UserSmsQueue'][_0xf3a6('0x35')]);_0x5e1197[_0xf3a6('0x3a')]=_['keys'](_0x244e24[_0xf3a6('0x3a')]);_0x5e1197[_0xf3a6('0x44')]=_[_0xf3a6('0x3c')](_0x5e1197[_0xf3a6('0x3d')],_0x5e1197['query']);_0x1fc765[_0xf3a6('0x3e')]=_[_0xf3a6('0x3c')](_0x5e1197[_0xf3a6('0x3d')],qs[_0xf3a6('0x3f')](_0x244e24[_0xf3a6('0x3a')][_0xf3a6('0x3f')]));_0x1fc765[_0xf3a6('0x3e')]=_0x1fc765['attributes']['length']?_0x1fc765[_0xf3a6('0x3e')]:_0x5e1197[_0xf3a6('0x3d')];if(!_0x244e24[_0xf3a6('0x3a')][_0xf3a6('0x41')]('nolimit')){_0x1fc765[_0xf3a6('0x24')]=qs[_0xf3a6('0x24')](_0x244e24[_0xf3a6('0x3a')][_0xf3a6('0x24')]);_0x1fc765[_0xf3a6('0x22')]=qs[_0xf3a6('0x22')](_0x244e24[_0xf3a6('0x3a')][_0xf3a6('0x22')]);}_0x1fc765[_0xf3a6('0x42')]=qs[_0xf3a6('0x43')](_0x244e24[_0xf3a6('0x3a')][_0xf3a6('0x43')]);_0x1fc765[_0xf3a6('0x46')]=qs['filters'](_[_0xf3a6('0x45')](_0x244e24[_0xf3a6('0x3a')],_0x5e1197['filters']));_0x1fc765[_0xf3a6('0x46')][_0xf3a6('0x5d')]=_0x555b76['id'];if(_0x244e24[_0xf3a6('0x3a')]['filter']){_0x1fc765[_0xf3a6('0x46')]=_[_0xf3a6('0x49')](_0x1fc765[_0xf3a6('0x46')],{'$or':_[_0xf3a6('0x34')](_0x1fc765[_0xf3a6('0x3e')],function(_0xaa4761){var _0x5b5d27={};_0x5b5d27[_0xaa4761]={'$like':'%'+_0x244e24['query'][_0xf3a6('0x48')]+'%'};return _0x5b5d27;})});}_0x1fc765=_[_0xf3a6('0x49')]({},_0x1fc765,_0x244e24[_0xf3a6('0x52')]);return db['UserSmsQueue']['findAll'](_0x1fc765);}})[_0xf3a6('0x2b')](function(_0x5eab92){if(_0x5eab92){return db[_0xf3a6('0x5e')][_0xf3a6('0x5f')]({'where':{'id':_[_0xf3a6('0x34')](_0x5eab92,_0xf3a6('0x60')),'role':_0xf3a6('0x61')},'attributes':['id',_0xf3a6('0x39'),_0xf3a6('0x62'),_0xf3a6('0x63'),_0xf3a6('0x64')]});}})[_0xf3a6('0x2b')](function(_0x374003){if(_0x374003){return{'count':_0x374003[_0xf3a6('0x4b')],'rows':_[_0xf3a6('0x34')](_0x374003[_0xf3a6('0x65')],function(_0xc1dc62){return{'membername':_0xc1dc62[_0xf3a6('0x39')],'UserId':_0xc1dc62['id'],'queue_name':_0x4b430f[_0xf3a6('0x39')],'SmsQueueId':_0x4b430f['id'],'interface':util['format']('%s/%s',_0xf3a6('0x66'),_0xc1dc62[_0xf3a6('0x39')]),'penalty':0x0,'paused':_0xc1dc62['smsPause'],'createdAt':_0xc1dc62['createdAt'],'updatedAt':_0xc1dc62[_0xf3a6('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3a6('0x2b')](respondWithFilteredResult(_0x16de0c,_0x1fc765))[_0xf3a6('0x4f')](handleError(_0x16de0c,null));};exports[_0xf3a6('0x67')]=function(_0x517999,_0x5d608d,_0x21db27){var _0x3dfe02={};var _0x218d2c={};var _0x4b5f37;var _0x21a3ec;return db['SmsQueue'][_0xf3a6('0x68')]({'where':{'id':_0x517999['params']['id']}})[_0xf3a6('0x2b')](handleEntityNotFound(_0x5d608d,null))[_0xf3a6('0x2b')](function(_0x2e9b5d){if(_0x2e9b5d){_0x4b5f37=_0x2e9b5d;_0x218d2c[_0xf3a6('0x3d')]=_[_0xf3a6('0x3b')](db[_0xf3a6('0x69')][_0xf3a6('0x35')]);_0x218d2c[_0xf3a6('0x3a')]=_['keys'](_0x517999[_0xf3a6('0x3a')]);_0x218d2c['filters']=_['intersection'](_0x218d2c[_0xf3a6('0x3d')],_0x218d2c['query']);_0x3dfe02[_0xf3a6('0x3e')]=_['intersection'](_0x218d2c['model'],qs[_0xf3a6('0x3f')](_0x517999['query']['fields']));_0x3dfe02[_0xf3a6('0x3e')]=_0x3dfe02[_0xf3a6('0x3e')]['length']?_0x3dfe02[_0xf3a6('0x3e')]:_0x218d2c[_0xf3a6('0x3d')];_0x3dfe02[_0xf3a6('0x42')]=qs[_0xf3a6('0x43')](_0x517999[_0xf3a6('0x3a')]['sort']);_0x3dfe02[_0xf3a6('0x46')]=qs[_0xf3a6('0x44')](_[_0xf3a6('0x45')](_0x517999[_0xf3a6('0x3a')],_0x218d2c[_0xf3a6('0x44')]));if(_0x517999[_0xf3a6('0x3a')]['filter']){_0x3dfe02[_0xf3a6('0x46')]=_[_0xf3a6('0x49')](_0x3dfe02[_0xf3a6('0x46')],{'$or':_[_0xf3a6('0x34')](_0x3dfe02[_0xf3a6('0x3e')],function(_0x290f8c){var _0x4870bb={};_0x4870bb[_0x290f8c]={'$like':'%'+_0x517999['query'][_0xf3a6('0x48')]+'%'};return _0x4870bb;})});}_0x3dfe02=_[_0xf3a6('0x49')]({},_0x3dfe02,_0x517999[_0xf3a6('0x52')]);return _0x4b5f37[_0xf3a6('0x67')](_0x3dfe02);}})[_0xf3a6('0x2b')](function(_0x53101d){if(_0x53101d){_0x21a3ec=_0x53101d['length'];if(!_0x517999[_0xf3a6('0x3a')][_0xf3a6('0x41')](_0xf3a6('0x6a'))){_0x3dfe02[_0xf3a6('0x24')]=qs[_0xf3a6('0x24')](_0x517999[_0xf3a6('0x3a')][_0xf3a6('0x24')]);_0x3dfe02[_0xf3a6('0x22')]=qs[_0xf3a6('0x22')](_0x517999[_0xf3a6('0x3a')][_0xf3a6('0x22')]);}return _0x4b5f37[_0xf3a6('0x67')](_0x3dfe02);}})['then'](function(_0x26f86a){if(_0x26f86a){return _0x26f86a?{'count':_0x21a3ec,'rows':_0x26f86a}:null;}})[_0xf3a6('0x2b')](respondWithResult(_0x5d608d,null))[_0xf3a6('0x4f')](handleError(_0x5d608d,null));};exports['addTeams']=function(_0x1e2ca9,_0x441c0d,_0x31013d){var _0xe90f8c=_0x1e2ca9[_0xf3a6('0x55')]['ids'];return db[_0xf3a6('0x69')]['findAll']({'where':{'id':_0xe90f8c},'attributes':['id'],'include':[{'model':db[_0xf3a6('0x5e')],'as':_0xf3a6('0x6b'),'attributes':['id',_0xf3a6('0x39'),_0xf3a6('0x6c'),_0xf3a6('0x6d'),'interface'],'raw':!![]}]})[_0xf3a6('0x2b')](function(_0x2a5907){if(_0x2a5907){var _0x4d2733=_[_0xf3a6('0x6e')](_0x2a5907,function(_0x3153cb){var _0x4b7f98=_0x3153cb[_0xf3a6('0x2c')]({'plain':!![]});return _0x4b7f98[_0xf3a6('0x6b')];});return db[_0xf3a6('0x4a')][_0xf3a6('0x53')]({'where':{'id':_0x1e2ca9[_0xf3a6('0x51')]['id']}})[_0xf3a6('0x2b')](function(_0x3edf62){return db[_0xf3a6('0x6f')]['transaction'](function(_0x2a1194){return _0x3edf62[_0xf3a6('0x70')](_0xe90f8c,{'transaction':_0x2a1194})[_0xf3a6('0x2b')](function(){return BPromise['each'](_0x4d2733,function(_0x59fa8d){return db[_0xf3a6('0x71')]['findOrCreate']({'where':{'UserId':_0x59fa8d['id'],'SmsQueueId':_0x1e2ca9[_0xf3a6('0x51')]['id']},'transaction':_0x2a1194});});})[_0xf3a6('0x2b')](function(){_0x4d2733[_0xf3a6('0x72')](function(_0x2aca69){socket[_0xf3a6('0x73')](_0xf3a6('0x74'),{'UserId':_0x2aca69['id'],'SmsQueueId':_0x3edf62['id']});});});});});}})[_0xf3a6('0x2b')](respondWithStatusCode(_0x441c0d,null))[_0xf3a6('0x4f')](handleError(_0x441c0d,null));};exports[_0xf3a6('0x75')]=function(_0x27f705,_0xc0fa8b,_0x105d7d){return db[_0xf3a6('0x69')][_0xf3a6('0x4e')]({'where':{'id':_0x27f705['query'][_0xf3a6('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf3a6('0x2b')](handleEntityNotFound(_0xc0fa8b,null))[_0xf3a6('0x2b')](function(_0xb7b784){var _0x471843=_[_0xf3a6('0x34')](_0xb7b784,'id');var _0x3197f6=[];var _0x5a1f87=[];var _0x16c246=squel[_0xf3a6('0x77')]();_0x16c246[_0xf3a6('0x78')](_0xf3a6('0x79'))[_0xf3a6('0x7a')](_0xf3a6('0x7b'),'tq')['join'](_0xf3a6('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf3a6('0x46')](_0xf3a6('0x7d'),_0x27f705['params']['id']);for(var _0x490f93=0x0;_0x490f93<_0xb7b784[_0xf3a6('0x40')];_0x490f93+=0x1){let _0x2e8bfc=_0xb7b784[_0x490f93];for(var _0x1a440c=0x0;_0x1a440c<_0x2e8bfc[_0xf3a6('0x6b')][_0xf3a6('0x40')];_0x1a440c+=0x1){let _0x5ae3f3=_0x2e8bfc['Agents'][_0x1a440c];var _0x1663ef=_0x16c246['clone']();_0x1663ef[_0xf3a6('0x46')](_0xf3a6('0x7e'),_0x5ae3f3['id']);_0x5a1f87[_0xf3a6('0x7f')](db[_0xf3a6('0x6f')]['query'](_0x1663ef[_0xf3a6('0x80')](),{'type':db['sequelize']['QueryTypes'][_0xf3a6('0x81')]})[_0xf3a6('0x2b')](function(_0x4a7224){if(_0x4a7224['length']===0x1){return _0x5ae3f3['id'];}else{var _0x1bb690=_[_0xf3a6('0x82')](_[_0xf3a6('0x34')](_0x4a7224,_0xf3a6('0x83')),function(_0x3e9cf9){return _[_0xf3a6('0x84')](_0x471843,_0x3e9cf9);});if(_0x1bb690){return _0x5ae3f3['id'];}}}));}}return BPromise[_0xf3a6('0x85')](_0x5a1f87)[_0xf3a6('0x2b')](function(_0x5cef2b){_0x3197f6=_(_0x3197f6)[_0xf3a6('0x86')](_0x5cef2b)[_0xf3a6('0x87')]()[_0xf3a6('0x88')]();return db['SmsQueue'][_0xf3a6('0x53')]({'where':{'id':_0x27f705[_0xf3a6('0x51')]['id']}})['then'](function(_0x551a78){return db[_0xf3a6('0x6f')][_0xf3a6('0x89')](function(_0x4be1da){return _0x551a78[_0xf3a6('0x75')](_0x27f705[_0xf3a6('0x3a')]['ids'],{'transaction':_0x4be1da})[_0xf3a6('0x2b')](function(){if(!_['isEmpty'](_0x3197f6)){return _0x551a78[_0xf3a6('0x8a')](_0x3197f6,{'transaction':_0x4be1da});}})[_0xf3a6('0x2b')](function(){_0x3197f6[_0xf3a6('0x72')](function(_0x3f754d){socket[_0xf3a6('0x73')](_0xf3a6('0x8b'),{'UserId':_0x3f754d,'SmsQueueId':_0x551a78['id']});});});});});});})['then'](respondWithStatusCode(_0xc0fa8b,null))[_0xf3a6('0x4f')](handleError(_0xc0fa8b,null));};exports['addAgents']=function(_0x63652e,_0x554b84,_0x24a245){return db['SmsQueue']['find']({'where':{'id':_0x63652e['params']['id']}})['then'](handleEntityNotFound(_0x554b84,null))[_0xf3a6('0x2b')](function(_0x27a471){if(_0x27a471){return _0x27a471[_0xf3a6('0x8c')](_0x63652e['body'][_0xf3a6('0x76')],_[_0xf3a6('0x8d')](_0x63652e[_0xf3a6('0x55')],['ids','id'])||{})[_0xf3a6('0x8e')](function(_0x12f246){for(var _0x966da6=0x0;_0x966da6<_0x63652e[_0xf3a6('0x55')]['ids'][_0xf3a6('0x40')];_0x966da6+=0x1){socket['emit'](_0xf3a6('0x74'),{'UserId':Number(_0x63652e[_0xf3a6('0x55')][_0xf3a6('0x76')][_0x966da6]),'SmsQueueId':Number(_0x63652e[_0xf3a6('0x51')]['id'])});}return _0x12f246;});}})['then'](respondWithResult(_0x554b84,null))[_0xf3a6('0x4f')](handleError(_0x554b84,null));};exports[_0xf3a6('0x8a')]=function(_0x399fc2,_0x16ba1e,_0x11b8a6){return db[_0xf3a6('0x4a')][_0xf3a6('0x53')]({'where':{'id':_0x399fc2[_0xf3a6('0x51')]['id']}})[_0xf3a6('0x2b')](handleEntityNotFound(_0x16ba1e,null))[_0xf3a6('0x2b')](function(_0x3d2159){if(_0x3d2159){return _0x3d2159[_0xf3a6('0x8a')](_0x399fc2[_0xf3a6('0x3a')][_0xf3a6('0x76')])[_0xf3a6('0x2b')](function(){if(_[_0xf3a6('0x8f')](_0x399fc2[_0xf3a6('0x3a')][_0xf3a6('0x76')])){for(var _0x3bba0d=0x0;_0x3bba0d<_0x399fc2[_0xf3a6('0x3a')][_0xf3a6('0x76')]['length'];_0x3bba0d+=0x1){socket['emit'](_0xf3a6('0x8b'),{'UserId':Number(_0x399fc2['query'][_0xf3a6('0x76')][_0x3bba0d]),'SmsQueueId':Number(_0x399fc2['params']['id'])});}}else{socket[_0xf3a6('0x73')](_0xf3a6('0x8b'),{'UserId':Number(_0x399fc2[_0xf3a6('0x3a')][_0xf3a6('0x76')]),'SmsQueueId':Number(_0x399fc2['params']['id'])});}});}})[_0xf3a6('0x2b')](respondWithStatusCode(_0x16ba1e,null))[_0xf3a6('0x4f')](handleError(_0x16ba1e,null));};exports[_0xf3a6('0x90')]=function(_0x251b4e,_0x3628b0,_0x579931){var _0x637a49={};var _0x1d7246={};var _0x18a5e6;var _0x42e958;return db[_0xf3a6('0x4a')][_0xf3a6('0x68')]({'where':{'id':_0x251b4e['params']['id']}})[_0xf3a6('0x2b')](handleEntityNotFound(_0x3628b0,null))[_0xf3a6('0x2b')](function(_0x29ad22){if(_0x29ad22){_0x18a5e6=_0x29ad22;_0x1d7246[_0xf3a6('0x3d')]=_[_0xf3a6('0x3b')](db[_0xf3a6('0x5e')][_0xf3a6('0x35')]);_0x1d7246['query']=_[_0xf3a6('0x3b')](_0x251b4e[_0xf3a6('0x3a')]);_0x1d7246[_0xf3a6('0x44')]=_['intersection'](_0x1d7246[_0xf3a6('0x3d')],_0x1d7246[_0xf3a6('0x3a')]);_0x637a49['attributes']=_[_0xf3a6('0x3c')](_0x1d7246['model'],qs['fields'](_0x251b4e['query'][_0xf3a6('0x3f')]));_0x637a49[_0xf3a6('0x3e')]=_0x637a49[_0xf3a6('0x3e')]['length']?_0x637a49[_0xf3a6('0x3e')]:_0x1d7246[_0xf3a6('0x3d')];_0x637a49[_0xf3a6('0x42')]=qs[_0xf3a6('0x43')](_0x251b4e[_0xf3a6('0x3a')]['sort']);_0x637a49['where']=qs['filters'](_[_0xf3a6('0x45')](_0x251b4e[_0xf3a6('0x3a')],_0x1d7246['filters']));if(_0x251b4e['query']['filter']){_0x637a49[_0xf3a6('0x46')]=_[_0xf3a6('0x49')](_0x637a49[_0xf3a6('0x46')],{'$or':_['map'](_0x637a49[_0xf3a6('0x3e')],function(_0x3b40e4){var _0x125d05={};_0x125d05[_0x3b40e4]={'$like':'%'+_0x251b4e[_0xf3a6('0x3a')][_0xf3a6('0x48')]+'%'};return _0x125d05;})});}_0x637a49=_['merge']({},_0x637a49,_0x251b4e[_0xf3a6('0x52')]);return _0x18a5e6[_0xf3a6('0x90')](_0x637a49);}})['then'](function(_0x1d6976){if(_0x1d6976){_0x42e958=_0x1d6976['length'];if(!_0x251b4e['query'][_0xf3a6('0x41')]('nolimit')){_0x637a49[_0xf3a6('0x24')]=qs[_0xf3a6('0x24')](_0x251b4e[_0xf3a6('0x3a')][_0xf3a6('0x24')]);_0x637a49[_0xf3a6('0x22')]=qs[_0xf3a6('0x22')](_0x251b4e[_0xf3a6('0x3a')][_0xf3a6('0x22')]);}return _0x18a5e6['getAgents'](_0x637a49);}})['then'](function(_0x21138e){if(_0x21138e){return _0x21138e?{'count':_0x42e958,'rows':_0x21138e}:null;}})[_0xf3a6('0x2b')](respondWithResult(_0x3628b0,null))['catch'](handleError(_0x3628b0,null));};
\ No newline at end of file
+var _0xcabf=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','eml-format','rimraf','moment','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xcabf,0x102));var _0xfcab=function(_0x127037,_0x3e0439){_0x127037=_0x127037-0x0;var _0x48e875=_0xcabf[_0x127037];return _0x48e875;};'use strict';var emlformat=require(_0xfcab('0x0'));var rimraf=require(_0xfcab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfcab('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfcab('0x3'));var sox=require('sox');var csv=require(_0xfcab('0x4'));var ejs=require(_0xfcab('0x5'));var fs=require('fs');var fs_extra=require(_0xfcab('0x6'));var _=require('lodash');var squel=require(_0xfcab('0x7'));var crypto=require(_0xfcab('0x8'));var jsforce=require(_0xfcab('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xfcab('0x4'));var querystring=require(_0xfcab('0xa'));var Papa=require(_0xfcab('0xb'));var Redis=require(_0xfcab('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfcab('0xd'));var as=require(_0xfcab('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcab('0xf'))('api');var utils=require(_0xfcab('0x10'));var config=require(_0xfcab('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcab('0x12'))['db'];config[_0xfcab('0x13')]=_['defaults'](config['redis'],{'host':_0xfcab('0x14'),'port':0x18eb});var socket=require(_0xfcab('0x15'))(new Redis(config[_0xfcab('0x13')]));require(_0xfcab('0x16'))['register'](socket);function respondWithStatusCode(_0x5006b0,_0x45fda7){_0x45fda7=_0x45fda7||0xcc;return function(_0x1a88dd){if(_0x1a88dd){return _0x5006b0[_0xfcab('0x17')](_0x45fda7);}return _0x5006b0[_0xfcab('0x18')](_0x45fda7)[_0xfcab('0x19')]();};}function respondWithResult(_0x5057e5,_0x198fce){_0x198fce=_0x198fce||0xc8;return function(_0x3cd1d4){if(_0x3cd1d4){return _0x5057e5[_0xfcab('0x18')](_0x198fce)[_0xfcab('0x1a')](_0x3cd1d4);}};}function respondWithFilteredResult(_0x12bd97,_0x50ebd6){return function(_0x32da6e){if(_0x32da6e){var _0x340011=typeof _0x50ebd6[_0xfcab('0x1b')]===_0xfcab('0x1c')&&typeof _0x50ebd6['limit']===_0xfcab('0x1c');var _0x562f98=_0x32da6e['count'];var _0x485ff5=_0x340011?0x0:_0x50ebd6[_0xfcab('0x1b')];var _0x5cb321=_0x340011?_0x32da6e[_0xfcab('0x1d')]:_0x50ebd6['offset']+_0x50ebd6['limit'];var _0x303f06;if(_0x5cb321>=_0x562f98){_0x5cb321=_0x562f98;_0x303f06=0xc8;}else{_0x303f06=0xce;}_0x12bd97[_0xfcab('0x18')](_0x303f06);return _0x12bd97[_0xfcab('0x1e')](_0xfcab('0x1f'),_0x485ff5+'-'+_0x5cb321+'/'+_0x562f98)[_0xfcab('0x1a')](_0x32da6e);}return null;};}function patchUpdates(_0x50cb53){return function(_0x261bd5){try{jsonpatch[_0xfcab('0x20')](_0x261bd5,_0x50cb53,!![]);}catch(_0x4ce1c9){return BPromise[_0xfcab('0x21')](_0x4ce1c9);}return _0x261bd5[_0xfcab('0x22')]();};}function saveUpdates(_0x351fe8,_0x415d9e){return function(_0x2e7021){if(_0x2e7021){return _0x2e7021[_0xfcab('0x23')](_0x351fe8)[_0xfcab('0x24')](function(_0x21adb0){return _0x21adb0;});}return null;};}function removeEntity(_0x5ce6e3,_0x3f553a){return function(_0x479df4){if(_0x479df4){return _0x479df4[_0xfcab('0x25')]()[_0xfcab('0x24')](function(){var _0x1eb7e6=_0x479df4[_0xfcab('0x26')]({'plain':!![]});var _0x5c949e=_0xfcab('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5c949e,'resourceId':_0x1eb7e6['id']}})['then'](function(){return _0x479df4;});})[_0xfcab('0x24')](function(){_0x5ce6e3[_0xfcab('0x18')](0xcc)[_0xfcab('0x19')]();});}};}function handleEntityNotFound(_0x4e282d,_0x25982c){return function(_0x96bcf0){if(!_0x96bcf0){_0x4e282d[_0xfcab('0x17')](0x194);}return _0x96bcf0;};}function handleError(_0x214d2a,_0x450d2e){_0x450d2e=_0x450d2e||0x1f4;return function(_0xd75c3b){logger[_0xfcab('0x28')](_0xd75c3b[_0xfcab('0x29')]);if(_0xd75c3b['name']){delete _0xd75c3b[_0xfcab('0x2a')];}_0x214d2a['status'](_0x450d2e)[_0xfcab('0x2b')](_0xd75c3b);};}exports[_0xfcab('0x2c')]=function(_0x536923,_0x336680){var _0x521cbe={},_0x5dd68c={},_0x1e2e1e={'count':0x0,'rows':[]};var _0x450e76=_[_0xfcab('0x2d')](db[_0xfcab('0x2e')][_0xfcab('0x2f')],function(_0x509c9d){return{'name':_0x509c9d[_0xfcab('0x30')],'type':_0x509c9d[_0xfcab('0x31')][_0xfcab('0x32')]};});_0x5dd68c[_0xfcab('0x33')]=_['map'](_0x450e76,_0xfcab('0x2a'));_0x5dd68c[_0xfcab('0x34')]=_[_0xfcab('0x35')](_0x536923[_0xfcab('0x34')]);_0x5dd68c['filters']=_[_0xfcab('0x36')](_0x5dd68c[_0xfcab('0x33')],_0x5dd68c[_0xfcab('0x34')]);_0x521cbe[_0xfcab('0x37')]=_['intersection'](_0x5dd68c[_0xfcab('0x33')],qs['fields'](_0x536923[_0xfcab('0x34')][_0xfcab('0x38')]));_0x521cbe[_0xfcab('0x37')]=_0x521cbe['attributes']['length']?_0x521cbe[_0xfcab('0x37')]:_0x5dd68c['model'];if(!_0x536923[_0xfcab('0x34')][_0xfcab('0x39')]('nolimit')){_0x521cbe[_0xfcab('0x3a')]=qs[_0xfcab('0x3a')](_0x536923[_0xfcab('0x34')][_0xfcab('0x3a')]);_0x521cbe[_0xfcab('0x1b')]=qs['offset'](_0x536923[_0xfcab('0x34')][_0xfcab('0x1b')]);}_0x521cbe[_0xfcab('0x3b')]=qs[_0xfcab('0x3c')](_0x536923['query'][_0xfcab('0x3c')]);_0x521cbe[_0xfcab('0x3d')]=qs[_0xfcab('0x3e')](_[_0xfcab('0x3f')](_0x536923[_0xfcab('0x34')],_0x5dd68c[_0xfcab('0x3e')]),_0x450e76);if(_0x536923[_0xfcab('0x34')][_0xfcab('0x40')]){_0x521cbe[_0xfcab('0x3d')]=_[_0xfcab('0x41')](_0x521cbe['where'],{'$or':_[_0xfcab('0x2d')](_0x450e76,function(_0x43f77f){if(_0x43f77f['type']!==_0xfcab('0x42')){var _0x3cf991={};_0x3cf991[_0x43f77f['name']]={'$like':'%'+_0x536923[_0xfcab('0x34')][_0xfcab('0x40')]+'%'};return _0x3cf991;}})});}_0x521cbe=_['merge']({},_0x521cbe,_0x536923[_0xfcab('0x43')]);var _0x5a81c7={'where':_0x521cbe[_0xfcab('0x3d')]};return db[_0xfcab('0x2e')][_0xfcab('0x1d')](_0x5a81c7)[_0xfcab('0x24')](function(_0x13c434){_0x1e2e1e[_0xfcab('0x1d')]=_0x13c434;if(_0x536923['query'][_0xfcab('0x44')]){_0x521cbe[_0xfcab('0x45')]=[{'all':!![]}];}return db[_0xfcab('0x2e')][_0xfcab('0x46')](_0x521cbe);})['then'](function(_0x434b01){_0x1e2e1e[_0xfcab('0x47')]=_0x434b01;return _0x1e2e1e;})[_0xfcab('0x24')](respondWithFilteredResult(_0x336680,_0x521cbe))[_0xfcab('0x48')](handleError(_0x336680,null));};exports['show']=function(_0x39e098,_0x2ad1e3){var _0x2bdb79={'raw':!![],'where':{'id':_0x39e098['params']['id']}},_0x51bf34={};_0x51bf34[_0xfcab('0x33')]=_[_0xfcab('0x35')](db[_0xfcab('0x2e')][_0xfcab('0x2f')]);_0x51bf34['query']=_[_0xfcab('0x35')](_0x39e098[_0xfcab('0x34')]);_0x51bf34[_0xfcab('0x3e')]=_[_0xfcab('0x36')](_0x51bf34[_0xfcab('0x33')],_0x51bf34[_0xfcab('0x34')]);_0x2bdb79[_0xfcab('0x37')]=_[_0xfcab('0x36')](_0x51bf34[_0xfcab('0x33')],qs['fields'](_0x39e098[_0xfcab('0x34')]['fields']));_0x2bdb79['attributes']=_0x2bdb79['attributes'][_0xfcab('0x49')]?_0x2bdb79[_0xfcab('0x37')]:_0x51bf34[_0xfcab('0x33')];if(_0x39e098[_0xfcab('0x34')][_0xfcab('0x44')]){_0x2bdb79['include']=[{'all':!![]}];}_0x2bdb79=_[_0xfcab('0x41')]({},_0x2bdb79,_0x39e098[_0xfcab('0x43')]);return db['SmsQueue']['find'](_0x2bdb79)[_0xfcab('0x24')](handleEntityNotFound(_0x2ad1e3,null))['then'](respondWithResult(_0x2ad1e3,null))['catch'](handleError(_0x2ad1e3,null));};exports['create']=function(_0x2d8178,_0xc77eed){return db['SmsQueue']['create'](_0x2d8178[_0xfcab('0x4a')],{})[_0xfcab('0x24')](function(_0x26ecc7){var _0x503cd0=_0x2d8178['user'][_0xfcab('0x26')]({'plain':!![]});if(!_0x503cd0)throw new Error(_0xfcab('0x4b'));if(_0x503cd0['role']===_0xfcab('0x4c')){var _0x3ac6ba=_0x26ecc7['get']({'plain':!![]});var _0x374a1e=_0xfcab('0x27');return db[_0xfcab('0x4d')][_0xfcab('0x4e')]({'where':{'name':_0x374a1e,'userProfileId':_0x503cd0[_0xfcab('0x4f')]},'raw':!![]})[_0xfcab('0x24')](function(_0x33d0d3){if(_0x33d0d3&&_0x33d0d3[_0xfcab('0x50')]===0x0){return db[_0xfcab('0x51')]['create']({'name':_0x3ac6ba[_0xfcab('0x2a')],'resourceId':_0x3ac6ba['id'],'type':_0x33d0d3[_0xfcab('0x2a')],'sectionId':_0x33d0d3['id']},{})[_0xfcab('0x24')](function(){return _0x26ecc7;});}else{return _0x26ecc7;}})[_0xfcab('0x48')](function(_0xa6a631){logger[_0xfcab('0x28')](_0xfcab('0x52'),_0xa6a631);throw _0xa6a631;});}return _0x26ecc7;})['then'](respondWithResult(_0xc77eed,0xc9))['catch'](handleError(_0xc77eed,null));};exports[_0xfcab('0x23')]=function(_0x495dbc,_0xa5cbc){if(_0x495dbc[_0xfcab('0x4a')]['id']){delete _0x495dbc['body']['id'];}return db[_0xfcab('0x2e')]['find']({'where':{'id':_0x495dbc[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0xa5cbc,null))[_0xfcab('0x24')](saveUpdates(_0x495dbc[_0xfcab('0x4a')],null))['then'](respondWithResult(_0xa5cbc,null))[_0xfcab('0x48')](handleError(_0xa5cbc,null));};exports[_0xfcab('0x25')]=function(_0x1dae0f,_0x31656a){return db['SmsQueue'][_0xfcab('0x4e')]({'where':{'id':_0x1dae0f[_0xfcab('0x53')]['id']}})['then'](handleEntityNotFound(_0x31656a,null))[_0xfcab('0x24')](removeEntity(_0x31656a,null))[_0xfcab('0x48')](handleError(_0x31656a,null));};exports[_0xfcab('0x54')]=function(_0x106d4e,_0x27fb9c){return db[_0xfcab('0x2e')][_0xfcab('0x54')]()[_0xfcab('0x24')](respondWithResult(_0x27fb9c,null))[_0xfcab('0x48')](handleError(_0x27fb9c,null));};exports[_0xfcab('0x55')]=function(_0x3eae9d,_0x58f5f4,_0x2a47a7){var _0x50cbe4={'raw':!![],'where':{}},_0x5e811b={},_0x1bc708;return db['SmsQueue'][_0xfcab('0x56')]({'where':{'id':_0x3eae9d['params']['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0x58f5f4,null))[_0xfcab('0x24')](function(_0xc23359){if(_0xc23359){_0x1bc708=_0xc23359[_0xfcab('0x26')]({'plain':!![]});_0x5e811b[_0xfcab('0x33')]=_['keys'](db[_0xfcab('0x57')]['rawAttributes']);_0x5e811b[_0xfcab('0x34')]=_[_0xfcab('0x35')](_0x3eae9d[_0xfcab('0x34')]);_0x5e811b[_0xfcab('0x3e')]=_[_0xfcab('0x36')](_0x5e811b[_0xfcab('0x33')],_0x5e811b['query']);_0x50cbe4[_0xfcab('0x37')]=_[_0xfcab('0x36')](_0x5e811b[_0xfcab('0x33')],qs[_0xfcab('0x38')](_0x3eae9d[_0xfcab('0x34')]['fields']));_0x50cbe4[_0xfcab('0x37')]=_0x50cbe4['attributes'][_0xfcab('0x49')]?_0x50cbe4['attributes']:_0x5e811b[_0xfcab('0x33')];if(!_0x3eae9d[_0xfcab('0x34')]['hasOwnProperty']('nolimit')){_0x50cbe4['limit']=qs['limit'](_0x3eae9d['query'][_0xfcab('0x3a')]);_0x50cbe4[_0xfcab('0x1b')]=qs[_0xfcab('0x1b')](_0x3eae9d['query'][_0xfcab('0x1b')]);}_0x50cbe4[_0xfcab('0x3b')]=qs['sort'](_0x3eae9d[_0xfcab('0x34')][_0xfcab('0x3c')]);_0x50cbe4[_0xfcab('0x3d')]=qs['filters'](_[_0xfcab('0x3f')](_0x3eae9d[_0xfcab('0x34')],_0x5e811b[_0xfcab('0x3e')]));_0x50cbe4['where'][_0xfcab('0x58')]=_0xc23359['id'];if(_0x3eae9d[_0xfcab('0x34')][_0xfcab('0x40')]){_0x50cbe4[_0xfcab('0x3d')]=_[_0xfcab('0x41')](_0x50cbe4['where'],{'$or':_[_0xfcab('0x2d')](_0x50cbe4[_0xfcab('0x37')],function(_0x15245f){var _0x2674ce={};_0x2674ce[_0x15245f]={'$like':'%'+_0x3eae9d[_0xfcab('0x34')]['filter']+'%'};return _0x2674ce;})});}_0x50cbe4=_[_0xfcab('0x41')]({},_0x50cbe4,_0x3eae9d['options']);return db[_0xfcab('0x57')][_0xfcab('0x46')](_0x50cbe4);}})[_0xfcab('0x24')](function(_0x2923cd){if(_0x2923cd){return db[_0xfcab('0x59')][_0xfcab('0x5a')]({'where':{'id':_[_0xfcab('0x2d')](_0x2923cd,_0xfcab('0x5b')),'role':_0xfcab('0x5c')},'attributes':['id',_0xfcab('0x2a'),_0xfcab('0x5d'),'updatedAt',_0xfcab('0x5e')]});}})['then'](function(_0x255d74){if(_0x255d74){return{'count':_0x255d74[_0xfcab('0x1d')],'rows':_[_0xfcab('0x2d')](_0x255d74[_0xfcab('0x47')],function(_0x550abc){return{'membername':_0x550abc['name'],'UserId':_0x550abc['id'],'queue_name':_0x1bc708['name'],'SmsQueueId':_0x1bc708['id'],'interface':util[_0xfcab('0x5f')](_0xfcab('0x60'),_0xfcab('0x61'),_0x550abc['name']),'penalty':0x0,'paused':_0x550abc['smsPause'],'createdAt':_0x550abc[_0xfcab('0x5e')],'updatedAt':_0x550abc[_0xfcab('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfcab('0x24')](respondWithFilteredResult(_0x58f5f4,_0x50cbe4))['catch'](handleError(_0x58f5f4,null));};exports[_0xfcab('0x63')]=function(_0xdf1dd0,_0x2b5354,_0x51ec30){var _0xe6561a={};var _0x648684={};var _0x4147ef;var _0x1e4406;return db[_0xfcab('0x2e')][_0xfcab('0x56')]({'where':{'id':_0xdf1dd0[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0x2b5354,null))[_0xfcab('0x24')](function(_0x24c45d){if(_0x24c45d){_0x4147ef=_0x24c45d;_0x648684[_0xfcab('0x33')]=_[_0xfcab('0x35')](db['Team'][_0xfcab('0x2f')]);_0x648684[_0xfcab('0x34')]=_['keys'](_0xdf1dd0[_0xfcab('0x34')]);_0x648684['filters']=_[_0xfcab('0x36')](_0x648684[_0xfcab('0x33')],_0x648684[_0xfcab('0x34')]);_0xe6561a[_0xfcab('0x37')]=_['intersection'](_0x648684[_0xfcab('0x33')],qs[_0xfcab('0x38')](_0xdf1dd0[_0xfcab('0x34')][_0xfcab('0x38')]));_0xe6561a['attributes']=_0xe6561a[_0xfcab('0x37')][_0xfcab('0x49')]?_0xe6561a[_0xfcab('0x37')]:_0x648684[_0xfcab('0x33')];_0xe6561a[_0xfcab('0x3b')]=qs[_0xfcab('0x3c')](_0xdf1dd0[_0xfcab('0x34')][_0xfcab('0x3c')]);_0xe6561a[_0xfcab('0x3d')]=qs[_0xfcab('0x3e')](_[_0xfcab('0x3f')](_0xdf1dd0['query'],_0x648684[_0xfcab('0x3e')]));if(_0xdf1dd0[_0xfcab('0x34')][_0xfcab('0x40')]){_0xe6561a['where']=_[_0xfcab('0x41')](_0xe6561a[_0xfcab('0x3d')],{'$or':_[_0xfcab('0x2d')](_0xe6561a[_0xfcab('0x37')],function(_0x450cf9){var _0x450945={};_0x450945[_0x450cf9]={'$like':'%'+_0xdf1dd0[_0xfcab('0x34')][_0xfcab('0x40')]+'%'};return _0x450945;})});}_0xe6561a=_[_0xfcab('0x41')]({},_0xe6561a,_0xdf1dd0[_0xfcab('0x43')]);return _0x4147ef[_0xfcab('0x63')](_0xe6561a);}})[_0xfcab('0x24')](function(_0x59854b){if(_0x59854b){_0x1e4406=_0x59854b[_0xfcab('0x49')];if(!_0xdf1dd0[_0xfcab('0x34')]['hasOwnProperty']('nolimit')){_0xe6561a[_0xfcab('0x3a')]=qs[_0xfcab('0x3a')](_0xdf1dd0[_0xfcab('0x34')][_0xfcab('0x3a')]);_0xe6561a[_0xfcab('0x1b')]=qs[_0xfcab('0x1b')](_0xdf1dd0['query'][_0xfcab('0x1b')]);}return _0x4147ef[_0xfcab('0x63')](_0xe6561a);}})[_0xfcab('0x24')](function(_0x22f55f){if(_0x22f55f){return _0x22f55f?{'count':_0x1e4406,'rows':_0x22f55f}:null;}})[_0xfcab('0x24')](respondWithResult(_0x2b5354,null))[_0xfcab('0x48')](handleError(_0x2b5354,null));};exports['addTeams']=function(_0x5eaf10,_0x17c84d,_0x4ede1c){var _0x5143da=_0x5eaf10[_0xfcab('0x4a')][_0xfcab('0x64')];return db['Team'][_0xfcab('0x46')]({'where':{'id':_0x5143da},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xfcab('0x2a'),_0xfcab('0x65'),_0xfcab('0x66'),_0xfcab('0x67')],'raw':!![]}]})[_0xfcab('0x24')](function(_0x18e05f){if(_0x18e05f){var _0x16ac1a=_[_0xfcab('0x68')](_0x18e05f,function(_0x12910a){var _0x5f5d4e=_0x12910a[_0xfcab('0x26')]({'plain':!![]});return _0x5f5d4e[_0xfcab('0x69')];});return db[_0xfcab('0x2e')][_0xfcab('0x4e')]({'where':{'id':_0x5eaf10[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](function(_0x4bc11e){return db[_0xfcab('0x6a')][_0xfcab('0x6b')](function(_0x41171e){return _0x4bc11e['addTeams'](_0x5143da,{'transaction':_0x41171e})[_0xfcab('0x24')](function(){return BPromise[_0xfcab('0x6c')](_0x16ac1a,function(_0x148946){return db['UserSmsQueue'][_0xfcab('0x6d')]({'where':{'UserId':_0x148946['id'],'SmsQueueId':_0x5eaf10[_0xfcab('0x53')]['id']},'transaction':_0x41171e});});})['then'](function(){_0x16ac1a[_0xfcab('0x6e')](function(_0x179a0b){socket[_0xfcab('0x6f')](_0xfcab('0x70'),{'UserId':_0x179a0b['id'],'SmsQueueId':_0x4bc11e['id']});});});});});}})[_0xfcab('0x24')](respondWithStatusCode(_0x17c84d,null))[_0xfcab('0x48')](handleError(_0x17c84d,null));};exports[_0xfcab('0x71')]=function(_0x55dab0,_0x335840,_0x21b92d){return db[_0xfcab('0x72')][_0xfcab('0x46')]({'where':{'id':_0x55dab0['query'][_0xfcab('0x64')]},'attributes':['id'],'include':[{'model':db[_0xfcab('0x59')],'as':_0xfcab('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfcab('0x24')](handleEntityNotFound(_0x335840,null))['then'](function(_0x151483){var _0x1d399c=_['map'](_0x151483,'id');var _0x1464f2=[];var _0x4fa636=[];var _0x227a45=squel['select']();_0x227a45[_0xfcab('0x73')](_0xfcab('0x74'))[_0xfcab('0x75')](_0xfcab('0x76'),'tq')[_0xfcab('0x77')](_0xfcab('0x78'),'ut',_0xfcab('0x79'))[_0xfcab('0x3d')](_0xfcab('0x7a'),_0x55dab0['params']['id']);for(var _0xea7ed=0x0;_0xea7ed<_0x151483['length'];_0xea7ed+=0x1){let _0x3721b1=_0x151483[_0xea7ed];for(var _0x3bd162=0x0;_0x3bd162<_0x3721b1[_0xfcab('0x69')][_0xfcab('0x49')];_0x3bd162+=0x1){let _0x55a8fe=_0x3721b1[_0xfcab('0x69')][_0x3bd162];var _0x119250=_0x227a45[_0xfcab('0x7b')]();_0x119250[_0xfcab('0x3d')](_0xfcab('0x7c'),_0x55a8fe['id']);_0x4fa636[_0xfcab('0x7d')](db[_0xfcab('0x6a')]['query'](_0x119250['toString'](),{'type':db['sequelize'][_0xfcab('0x7e')][_0xfcab('0x7f')]})[_0xfcab('0x24')](function(_0x4e5bff){if(_0x4e5bff['length']===0x1){return _0x55a8fe['id'];}else{var _0x3b7d7a=_[_0xfcab('0x80')](_[_0xfcab('0x2d')](_0x4e5bff,_0xfcab('0x81')),function(_0x275b30){return _[_0xfcab('0x82')](_0x1d399c,_0x275b30);});if(_0x3b7d7a){return _0x55a8fe['id'];}}}));}}return BPromise['all'](_0x4fa636)['then'](function(_0x1f9f47){_0x1464f2=_(_0x1464f2)[_0xfcab('0x83')](_0x1f9f47)[_0xfcab('0x84')]()[_0xfcab('0x85')]();return db[_0xfcab('0x2e')]['find']({'where':{'id':_0x55dab0['params']['id']}})[_0xfcab('0x24')](function(_0x294b80){return db['sequelize'][_0xfcab('0x6b')](function(_0x157014){return _0x294b80['removeTeams'](_0x55dab0[_0xfcab('0x34')][_0xfcab('0x64')],{'transaction':_0x157014})[_0xfcab('0x24')](function(){if(!_[_0xfcab('0x86')](_0x1464f2)){return _0x294b80[_0xfcab('0x87')](_0x1464f2,{'transaction':_0x157014});}})['then'](function(){_0x1464f2[_0xfcab('0x6e')](function(_0x24741a){socket[_0xfcab('0x6f')](_0xfcab('0x88'),{'UserId':_0x24741a,'SmsQueueId':_0x294b80['id']});});});});});});})[_0xfcab('0x24')](respondWithStatusCode(_0x335840,null))[_0xfcab('0x48')](handleError(_0x335840,null));};exports[_0xfcab('0x89')]=function(_0x584f3,_0x10fe14,_0xe1efe6){return db[_0xfcab('0x2e')][_0xfcab('0x4e')]({'where':{'id':_0x584f3[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0x10fe14,null))[_0xfcab('0x24')](function(_0x187f10){if(_0x187f10){return _0x187f10[_0xfcab('0x89')](_0x584f3[_0xfcab('0x4a')][_0xfcab('0x64')],_[_0xfcab('0x8a')](_0x584f3[_0xfcab('0x4a')],[_0xfcab('0x64'),'id'])||{})[_0xfcab('0x8b')](function(_0x52ff29){for(var _0x3bfa19=0x0;_0x3bfa19<_0x584f3['body']['ids'][_0xfcab('0x49')];_0x3bfa19+=0x1){socket['emit'](_0xfcab('0x70'),{'UserId':Number(_0x584f3['body'][_0xfcab('0x64')][_0x3bfa19]),'SmsQueueId':Number(_0x584f3[_0xfcab('0x53')]['id'])});}return _0x52ff29;});}})[_0xfcab('0x24')](respondWithResult(_0x10fe14,null))['catch'](handleError(_0x10fe14,null));};exports[_0xfcab('0x87')]=function(_0x38811e,_0x544bfe,_0x10fdca){return db[_0xfcab('0x2e')]['find']({'where':{'id':_0x38811e[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0x544bfe,null))[_0xfcab('0x24')](function(_0x52a06c){if(_0x52a06c){return _0x52a06c['removeAgents'](_0x38811e[_0xfcab('0x34')][_0xfcab('0x64')])[_0xfcab('0x24')](function(){if(_[_0xfcab('0x8c')](_0x38811e[_0xfcab('0x34')][_0xfcab('0x64')])){for(var _0x366079=0x0;_0x366079<_0x38811e['query'][_0xfcab('0x64')][_0xfcab('0x49')];_0x366079+=0x1){socket[_0xfcab('0x6f')]('userSmsQueue:remove',{'UserId':Number(_0x38811e[_0xfcab('0x34')][_0xfcab('0x64')][_0x366079]),'SmsQueueId':Number(_0x38811e[_0xfcab('0x53')]['id'])});}}else{socket['emit'](_0xfcab('0x88'),{'UserId':Number(_0x38811e[_0xfcab('0x34')][_0xfcab('0x64')]),'SmsQueueId':Number(_0x38811e[_0xfcab('0x53')]['id'])});}});}})[_0xfcab('0x24')](respondWithStatusCode(_0x544bfe,null))[_0xfcab('0x48')](handleError(_0x544bfe,null));};exports[_0xfcab('0x8d')]=function(_0x1b68ba,_0x328c99,_0x50b85a){var _0x2bd93b={};var _0x162894={};var _0x14cb46;var _0x373a4b;return db[_0xfcab('0x2e')]['findOne']({'where':{'id':_0x1b68ba[_0xfcab('0x53')]['id']}})[_0xfcab('0x24')](handleEntityNotFound(_0x328c99,null))[_0xfcab('0x24')](function(_0x1e0b28){if(_0x1e0b28){_0x14cb46=_0x1e0b28;_0x162894[_0xfcab('0x33')]=_['keys'](db['User'][_0xfcab('0x2f')]);_0x162894[_0xfcab('0x34')]=_[_0xfcab('0x35')](_0x1b68ba[_0xfcab('0x34')]);_0x162894[_0xfcab('0x3e')]=_[_0xfcab('0x36')](_0x162894[_0xfcab('0x33')],_0x162894['query']);_0x2bd93b['attributes']=_[_0xfcab('0x36')](_0x162894[_0xfcab('0x33')],qs[_0xfcab('0x38')](_0x1b68ba['query'][_0xfcab('0x38')]));_0x2bd93b['attributes']=_0x2bd93b[_0xfcab('0x37')]['length']?_0x2bd93b['attributes']:_0x162894[_0xfcab('0x33')];_0x2bd93b[_0xfcab('0x3b')]=qs[_0xfcab('0x3c')](_0x1b68ba['query'][_0xfcab('0x3c')]);_0x2bd93b[_0xfcab('0x3d')]=qs[_0xfcab('0x3e')](_[_0xfcab('0x3f')](_0x1b68ba[_0xfcab('0x34')],_0x162894[_0xfcab('0x3e')]));if(_0x1b68ba[_0xfcab('0x34')][_0xfcab('0x40')]){_0x2bd93b[_0xfcab('0x3d')]=_[_0xfcab('0x41')](_0x2bd93b['where'],{'$or':_[_0xfcab('0x2d')](_0x2bd93b[_0xfcab('0x37')],function(_0x3a4271){var _0x3d4838={};_0x3d4838[_0x3a4271]={'$like':'%'+_0x1b68ba[_0xfcab('0x34')][_0xfcab('0x40')]+'%'};return _0x3d4838;})});}_0x2bd93b=_['merge']({},_0x2bd93b,_0x1b68ba['options']);return _0x14cb46[_0xfcab('0x8d')](_0x2bd93b);}})['then'](function(_0x5ce41a){if(_0x5ce41a){_0x373a4b=_0x5ce41a[_0xfcab('0x49')];if(!_0x1b68ba['query']['hasOwnProperty'](_0xfcab('0x8e'))){_0x2bd93b[_0xfcab('0x3a')]=qs[_0xfcab('0x3a')](_0x1b68ba['query'][_0xfcab('0x3a')]);_0x2bd93b['offset']=qs[_0xfcab('0x1b')](_0x1b68ba[_0xfcab('0x34')][_0xfcab('0x1b')]);}return _0x14cb46['getAgents'](_0x2bd93b);}})['then'](function(_0x2f639d){if(_0x2f639d){return _0x2f639d?{'count':_0x373a4b,'rows':_0x2f639d}:null;}})[_0xfcab('0x24')](respondWithResult(_0x328c99,null))[_0xfcab('0x48')](handleError(_0x328c99,null));};
\ No newline at end of file
index f54b981..b36e074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b88=['exports','events','../../mysqldb','save','emit','hasOwnProperty'];(function(_0x317fe4,_0x57f01f){var _0x5ce3e5=function(_0x3aa64b){while(--_0x3aa64b){_0x317fe4['push'](_0x317fe4['shift']());}};_0x5ce3e5(++_0x57f01f);}(_0x4b88,0x1bd));var _0x84b8=function(_0x278cf3,_0x35b27a){_0x278cf3=_0x278cf3-0x0;var _0x4e50ee=_0x4b88[_0x278cf3];return _0x4e50ee;};'use strict';var EventEmitter=require(_0x84b8('0x0'));var SmsQueue=require(_0x84b8('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84b8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xea8e6f){return function(_0x55e635,_0x1fddee,_0x316c5d){SmsQueueEvents[_0x84b8('0x3')](_0xea8e6f+':'+_0x55e635['id'],_0x55e635);SmsQueueEvents[_0x84b8('0x3')](_0xea8e6f,_0x55e635);_0x316c5d(null);};}for(var e in events){if(events[_0x84b8('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x84b8('0x5')]=SmsQueueEvents;
\ No newline at end of file
+var _0x0f96=['events','../../mysqldb','SmsQueue','remove','emit','hasOwnProperty','hook','exports'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x0f96,0x1c8));var _0x60f9=function(_0x3dc727,_0x3a51a6){_0x3dc727=_0x3dc727-0x0;var _0x1a0bc6=_0x0f96[_0x3dc727];return _0x1a0bc6;};'use strict';var EventEmitter=require(_0x60f9('0x0'));var SmsQueue=require(_0x60f9('0x1'))['db'][_0x60f9('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x60f9('0x3')};function emitEvent(_0x2d30d9){return function(_0x353446,_0xd516aa,_0x11c9a4){SmsQueueEvents[_0x60f9('0x4')](_0x2d30d9+':'+_0x353446['id'],_0x353446);SmsQueueEvents[_0x60f9('0x4')](_0x2d30d9,_0x353446);_0x11c9a4(null);};}for(var e in events){if(events[_0x60f9('0x5')](e)){var event=events[e];SmsQueue[_0x60f9('0x6')](e,emitEvent(event));}}module[_0x60f9('0x7')]=SmsQueueEvents;
\ No newline at end of file
index 0ec845f..cac8a0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13f=['lodash','util','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues'];(function(_0x21cfed,_0x12ad6d){var _0x2b5c24=function(_0x5aee31){while(--_0x5aee31){_0x21cfed['push'](_0x21cfed['shift']());}};_0x2b5c24(++_0x12ad6d);}(_0xe13f,0xe4));var _0xfe13=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe13f[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xfe13('0x0'));var util=require(_0xfe13('0x1'));var logger=require('../../config/logger')(_0xfe13('0x2'));var moment=require('moment');var BPromise=require(_0xfe13('0x3'));var rp=require(_0xfe13('0x4'));var fs=require('fs');var path=require(_0xfe13('0x5'));var rimraf=require(_0xfe13('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe13('0x7'));module[_0xfe13('0x8')]=function(_0x439011,_0xf04e7f){return _0x439011[_0xfe13('0x9')](_0xfe13('0xa'),attributes,{'tableName':_0xfe13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f5d=['SmsQueue','sms_queues','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x7f5d,0x120));var _0xd7f5=function(_0x54b4b6,_0x3d2580){_0x54b4b6=_0x54b4b6-0x0;var _0x19347b=_0x7f5d[_0x54b4b6];return _0x19347b;};'use strict';var _=require('lodash');var util=require(_0xd7f5('0x0'));var logger=require('../../config/logger')(_0xd7f5('0x1'));var moment=require(_0xd7f5('0x2'));var BPromise=require('bluebird');var rp=require(_0xd7f5('0x3'));var fs=require('fs');var path=require(_0xd7f5('0x4'));var rimraf=require(_0xd7f5('0x5'));var config=require(_0xd7f5('0x6'));var attributes=require('./smsQueue.attributes');module[_0xd7f5('0x7')]=function(_0x19f70e,_0x54271f){return _0x19f70e[_0xd7f5('0x8')](_0xd7f5('0x9'),attributes,{'tableName':_0xd7f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index deb90c5..ee532a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4f=['attributes','limit','map','include','model','debug','GetSmsQueue','stringify','catch','ShowSmsQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','request\x20sent','error','code','SmsQueue,\x20%s,\x20%s','message','SmsQueue','findAll','options','raw','where'];(function(_0x7540e5,_0x26cb75){var _0x35f44f=function(_0xdbd41){while(--_0xdbd41){_0x7540e5['push'](_0x7540e5['shift']());}};_0x35f44f(++_0x26cb75);}(_0xac4f,0xfb));var _0xfac4=function(_0x370597,_0x39eaf2){_0x370597=_0x370597-0x0;var _0x3e5ca2=_0xac4f[_0x370597];return _0x3e5ca2;};'use strict';var _=require('lodash');var util=require(_0xfac4('0x0'));var moment=require(_0xfac4('0x1'));var BPromise=require('bluebird');var rs=require(_0xfac4('0x2'));var fs=require('fs');var Redis=require(_0xfac4('0x3'));var db=require(_0xfac4('0x4'))['db'];var utils=require(_0xfac4('0x5'));var logger=require(_0xfac4('0x6'))(_0xfac4('0x7'));var config=require(_0xfac4('0x8'));var jayson=require(_0xfac4('0x9'));var client=jayson[_0xfac4('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfac4('0xb')](config[_0xfac4('0xc')],{'host':_0xfac4('0xd'),'port':0x18eb});var socket=require(_0xfac4('0xe'))(new Redis(config[_0xfac4('0xc')]));require(_0xfac4('0xf'))[_0xfac4('0x10')](socket);function respondWithRpcPromise(_0x29f4ae,_0xda17e9,_0x91199b){return new BPromise(function(_0x43097a,_0x5ab0da){return client['request'](_0x29f4ae,_0x91199b)[_0xfac4('0x11')](function(_0x439992){logger[_0xfac4('0x12')]('SmsQueue,\x20%s,\x20%s',_0xda17e9,_0xfac4('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xda17e9,_0xfac4('0x13'),JSON['stringify'](_0x439992));if(_0x439992[_0xfac4('0x14')]){if(_0x439992[_0xfac4('0x14')][_0xfac4('0x15')]===0x1f4){logger[_0xfac4('0x14')](_0xfac4('0x16'),_0xda17e9,_0x439992[_0xfac4('0x14')][_0xfac4('0x17')]);return _0x5ab0da(_0x439992[_0xfac4('0x14')][_0xfac4('0x17')]);}logger['error'](_0xfac4('0x16'),_0xda17e9,_0x439992['error'][_0xfac4('0x17')]);return _0x43097a(_0x439992[_0xfac4('0x14')][_0xfac4('0x17')]);}else{logger[_0xfac4('0x12')](_0xfac4('0x16'),_0xda17e9,'request\x20sent');_0x43097a(_0x439992['result'][_0xfac4('0x17')]);}})['catch'](function(_0x222018){logger[_0xfac4('0x14')](_0xfac4('0x16'),_0xda17e9,_0x222018);_0x5ab0da(_0x222018);});});}exports['GetSmsQueue']=function(_0x2d14aa){var _0x2630c5=this;return new Promise(function(_0x19c21f,_0x4bcd56){return db[_0xfac4('0x18')][_0xfac4('0x19')]({'raw':_0x2d14aa['options']?_0x2d14aa[_0xfac4('0x1a')][_0xfac4('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d14aa[_0xfac4('0x1a')]?_0x2d14aa[_0xfac4('0x1a')][_0xfac4('0x1c')]||null:null,'attributes':_0x2d14aa['options']?_0x2d14aa[_0xfac4('0x1a')][_0xfac4('0x1d')]||null:null,'limit':_0x2d14aa[_0xfac4('0x1a')]?_0x2d14aa[_0xfac4('0x1a')][_0xfac4('0x1e')]||null:null,'include':_0x2d14aa[_0xfac4('0x1a')]?_0x2d14aa[_0xfac4('0x1a')]['include']?_[_0xfac4('0x1f')](_0x2d14aa[_0xfac4('0x1a')][_0xfac4('0x20')],function(_0x5c3b82){return{'model':db[_0x5c3b82['model']],'as':_0x5c3b82['as'],'attributes':_0x5c3b82[_0xfac4('0x1d')],'include':_0x5c3b82[_0xfac4('0x20')]?_[_0xfac4('0x1f')](_0x5c3b82[_0xfac4('0x20')],function(_0x3fbd6c){return{'model':db[_0x3fbd6c['model']],'as':_0x3fbd6c['as'],'attributes':_0x3fbd6c[_0xfac4('0x1d')],'include':_0x3fbd6c[_0xfac4('0x20')]?_[_0xfac4('0x1f')](_0x3fbd6c[_0xfac4('0x20')],function(_0xa9fc4e){return{'model':db[_0xa9fc4e[_0xfac4('0x21')]],'as':_0xa9fc4e['as'],'attributes':_0xa9fc4e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x380fbd){logger[_0xfac4('0x12')]('GetSmsQueue',_0x2d14aa);logger[_0xfac4('0x22')](_0xfac4('0x23'),_0x2d14aa,JSON[_0xfac4('0x24')](_0x380fbd));_0x19c21f(_0x380fbd);})[_0xfac4('0x25')](function(_0x47c89a){logger[_0xfac4('0x14')]('GetSmsQueue',_0x47c89a['message'],_0x2d14aa);_0x4bcd56(_0x2630c5[_0xfac4('0x14')](0x1f4,_0x47c89a['message']));});});};exports[_0xfac4('0x26')]=function(_0x3b1ca8){var _0x2658b4=this;return new Promise(function(_0x4ab01d,_0xa49713){return db['SmsQueue'][_0xfac4('0x27')]({'raw':_0x3b1ca8['options']?_0x3b1ca8[_0xfac4('0x1a')][_0xfac4('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b1ca8[_0xfac4('0x1a')]?_0x3b1ca8[_0xfac4('0x1a')]['where']||null:null,'attributes':_0x3b1ca8[_0xfac4('0x1a')]?_0x3b1ca8['options']['attributes']||null:null,'include':_0x3b1ca8[_0xfac4('0x1a')]?_0x3b1ca8[_0xfac4('0x1a')][_0xfac4('0x20')]?_['map'](_0x3b1ca8['options'][_0xfac4('0x20')],function(_0x1b0a67){return{'model':db[_0x1b0a67[_0xfac4('0x21')]],'as':_0x1b0a67['as'],'attributes':_0x1b0a67[_0xfac4('0x1d')],'include':_0x1b0a67[_0xfac4('0x20')]?_[_0xfac4('0x1f')](_0x1b0a67['include'],function(_0x51c15f){return{'model':db[_0x51c15f[_0xfac4('0x21')]],'as':_0x51c15f['as'],'attributes':_0x51c15f[_0xfac4('0x1d')],'include':_0x51c15f[_0xfac4('0x20')]?_[_0xfac4('0x1f')](_0x51c15f[_0xfac4('0x20')],function(_0x4811c2){return{'model':db[_0x4811c2[_0xfac4('0x21')]],'as':_0x4811c2['as'],'attributes':_0x4811c2[_0xfac4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfac4('0x11')](function(_0x2da5d0){logger[_0xfac4('0x12')](_0xfac4('0x26'),_0x3b1ca8);logger[_0xfac4('0x22')](_0xfac4('0x26'),_0x3b1ca8,JSON[_0xfac4('0x24')](_0x2da5d0));_0x4ab01d(_0x2da5d0);})[_0xfac4('0x25')](function(_0x1c80ca){logger['error'](_0xfac4('0x26'),_0x1c80ca[_0xfac4('0x17')],_0x3b1ca8);_0xa49713(_0x2658b4[_0xfac4('0x14')](0x1f4,_0x1c80ca[_0xfac4('0x17')]));});});};
\ No newline at end of file
+var _0x0231=['client','http','defaults','redis','localhost','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowSmsQueue','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0231,0x1e4));var _0x1023=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0231[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var util=require(_0x1023('0x0'));var moment=require(_0x1023('0x1'));var BPromise=require(_0x1023('0x2'));var rs=require(_0x1023('0x3'));var fs=require('fs');var Redis=require(_0x1023('0x4'));var db=require(_0x1023('0x5'))['db'];var utils=require(_0x1023('0x6'));var logger=require(_0x1023('0x7'))(_0x1023('0x8'));var config=require('../../config/environment');var jayson=require(_0x1023('0x9'));var client=jayson[_0x1023('0xa')][_0x1023('0xb')]({'port':0x232a});config['redis']=_[_0x1023('0xc')](config[_0x1023('0xd')],{'host':_0x1023('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x52f2c2,_0x975802,_0x303802){return new BPromise(function(_0x1af05c,_0x416040){return client[_0x1023('0xf')](_0x52f2c2,_0x303802)[_0x1023('0x10')](function(_0x55be9a){logger[_0x1023('0x11')](_0x1023('0x12'),_0x975802,'request\x20sent');logger[_0x1023('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x975802,_0x1023('0x14'),JSON['stringify'](_0x55be9a));if(_0x55be9a['error']){if(_0x55be9a[_0x1023('0x15')]['code']===0x1f4){logger['error'](_0x1023('0x12'),_0x975802,_0x55be9a['error'][_0x1023('0x16')]);return _0x416040(_0x55be9a[_0x1023('0x15')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x975802,_0x55be9a[_0x1023('0x15')][_0x1023('0x16')]);return _0x1af05c(_0x55be9a[_0x1023('0x15')]['message']);}else{logger['info'](_0x1023('0x12'),_0x975802,'request\x20sent');_0x1af05c(_0x55be9a[_0x1023('0x17')][_0x1023('0x16')]);}})[_0x1023('0x18')](function(_0x21d148){logger[_0x1023('0x15')](_0x1023('0x12'),_0x975802,_0x21d148);_0x416040(_0x21d148);});});}exports[_0x1023('0x19')]=function(_0x20985b){var _0x1dff87=this;return new Promise(function(_0x56af71,_0x53b920){return db[_0x1023('0x1a')][_0x1023('0x1b')]({'raw':_0x20985b['options']?_0x20985b[_0x1023('0x1c')][_0x1023('0x1d')]===undefined?!![]:![]:!![],'where':_0x20985b[_0x1023('0x1c')]?_0x20985b['options'][_0x1023('0x1e')]||null:null,'attributes':_0x20985b[_0x1023('0x1c')]?_0x20985b[_0x1023('0x1c')][_0x1023('0x1f')]||null:null,'limit':_0x20985b[_0x1023('0x1c')]?_0x20985b[_0x1023('0x1c')][_0x1023('0x20')]||null:null,'include':_0x20985b[_0x1023('0x1c')]?_0x20985b[_0x1023('0x1c')]['include']?_[_0x1023('0x21')](_0x20985b['options'][_0x1023('0x22')],function(_0x48fa5b){return{'model':db[_0x48fa5b['model']],'as':_0x48fa5b['as'],'attributes':_0x48fa5b[_0x1023('0x1f')],'include':_0x48fa5b[_0x1023('0x22')]?_[_0x1023('0x21')](_0x48fa5b[_0x1023('0x22')],function(_0x40664e){return{'model':db[_0x40664e[_0x1023('0x23')]],'as':_0x40664e['as'],'attributes':_0x40664e[_0x1023('0x1f')],'include':_0x40664e['include']?_[_0x1023('0x21')](_0x40664e[_0x1023('0x22')],function(_0x5c514c){return{'model':db[_0x5c514c['model']],'as':_0x5c514c['as'],'attributes':_0x5c514c[_0x1023('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1023('0x10')](function(_0x396cf8){logger['info'](_0x1023('0x19'),_0x20985b);logger[_0x1023('0x13')]('GetSmsQueue',_0x20985b,JSON['stringify'](_0x396cf8));_0x56af71(_0x396cf8);})[_0x1023('0x18')](function(_0x10b8bd){logger[_0x1023('0x15')]('GetSmsQueue',_0x10b8bd[_0x1023('0x16')],_0x20985b);_0x53b920(_0x1dff87[_0x1023('0x15')](0x1f4,_0x10b8bd['message']));});});};exports[_0x1023('0x24')]=function(_0x5e19b7){var _0x1d9332=this;return new Promise(function(_0x7f09ca,_0x4c0b66){return db['SmsQueue']['find']({'raw':_0x5e19b7[_0x1023('0x1c')]?_0x5e19b7['options'][_0x1023('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e19b7[_0x1023('0x1c')]?_0x5e19b7[_0x1023('0x1c')][_0x1023('0x1e')]||null:null,'attributes':_0x5e19b7[_0x1023('0x1c')]?_0x5e19b7[_0x1023('0x1c')][_0x1023('0x1f')]||null:null,'include':_0x5e19b7[_0x1023('0x1c')]?_0x5e19b7[_0x1023('0x1c')][_0x1023('0x22')]?_[_0x1023('0x21')](_0x5e19b7[_0x1023('0x1c')][_0x1023('0x22')],function(_0x210a5c){return{'model':db[_0x210a5c[_0x1023('0x23')]],'as':_0x210a5c['as'],'attributes':_0x210a5c[_0x1023('0x1f')],'include':_0x210a5c[_0x1023('0x22')]?_['map'](_0x210a5c[_0x1023('0x22')],function(_0x35e8b4){return{'model':db[_0x35e8b4[_0x1023('0x23')]],'as':_0x35e8b4['as'],'attributes':_0x35e8b4[_0x1023('0x1f')],'include':_0x35e8b4[_0x1023('0x22')]?_['map'](_0x35e8b4[_0x1023('0x22')],function(_0x488406){return{'model':db[_0x488406[_0x1023('0x23')]],'as':_0x488406['as'],'attributes':_0x488406[_0x1023('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1023('0x10')](function(_0x15c6b4){logger[_0x1023('0x11')]('ShowSmsQueue',_0x5e19b7);logger[_0x1023('0x13')](_0x1023('0x24'),_0x5e19b7,JSON[_0x1023('0x25')](_0x15c6b4));_0x7f09ca(_0x15c6b4);})[_0x1023('0x18')](function(_0x3f92ad){logger[_0x1023('0x15')](_0x1023('0x24'),_0x3f92ad[_0x1023('0x16')],_0x5e19b7);_0x4c0b66(_0x1d9332[_0x1023('0x15')](0x1f4,_0x3f92ad['message']));});});};
\ No newline at end of file
index ae467a4..fe2e1a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87f=['length','./smsQueue.events','save','remove','update','removeListener'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xa87f,0x1d5));var _0xfa87=function(_0x24f40c,_0x42c4b3){_0x24f40c=_0x24f40c-0x0;var _0x72206d=_0xa87f[_0x24f40c];return _0x72206d;};'use strict';var SmsQueueEvents=require(_0xfa87('0x0'));var events=[_0xfa87('0x1'),_0xfa87('0x2'),_0xfa87('0x3')];function createListener(_0x545a63,_0x4a4dc8){return function(_0x2595af){_0x4a4dc8['emit'](_0x545a63,_0x2595af);};}function removeListener(_0x2d6855,_0x46600f){return function(){SmsQueueEvents[_0xfa87('0x4')](_0x2d6855,_0x46600f);};}exports['register']=function(_0x1a0fd6){for(var _0x21e6d3=0x0,_0x57c8b5=events[_0xfa87('0x5')];_0x21e6d3<_0x57c8b5;_0x21e6d3++){var _0x5b0ed0=events[_0x21e6d3];var _0x47a391=createListener('smsQueue:'+_0x5b0ed0,_0x1a0fd6);SmsQueueEvents['on'](_0x5b0ed0,_0x47a391);}};
\ No newline at end of file
+var _0x7d51=['register','length','save','remove','removeListener'];(function(_0x360bde,_0x34e333){var _0x598f63=function(_0x447b3d){while(--_0x447b3d){_0x360bde['push'](_0x360bde['shift']());}};_0x598f63(++_0x34e333);}(_0x7d51,0xb1));var _0x17d5=function(_0x30e0d9,_0x30f011){_0x30e0d9=_0x30e0d9-0x0;var _0x3b4602=_0x7d51[_0x30e0d9];return _0x3b4602;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x17d5('0x0'),_0x17d5('0x1'),'update'];function createListener(_0x12f933,_0x4ac244){return function(_0x376e5f){_0x4ac244['emit'](_0x12f933,_0x376e5f);};}function removeListener(_0x46c933,_0x39c433){return function(){SmsQueueEvents[_0x17d5('0x2')](_0x46c933,_0x39c433);};}exports[_0x17d5('0x3')]=function(_0x2486b4){for(var _0x152ee4=0x0,_0x29c6cb=events[_0x17d5('0x4')];_0x152ee4<_0x29c6cb;_0x152ee4++){var _0x519200=events[_0x152ee4];var _0x6b44cd=createListener('smsQueue:'+_0x519200,_0x2486b4);SmsQueueEvents['on'](_0x519200,_0x6b44cd);}};
\ No newline at end of file
index 026d12e..b4d448a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd829=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x134c80,_0xfe9fd8){var _0x348eab=function(_0x1c8130){while(--_0x1c8130){_0x134c80['push'](_0x134c80['shift']());}};_0x348eab(++_0xfe9fd8);}(_0xd829,0x1d0));var _0x9d82=function(_0x466337,_0x22610e){_0x466337=_0x466337-0x0;var _0x549964=_0xd829[_0x466337];return _0x549964;};'use strict';var multer=require(_0x9d82('0x0'));var util=require(_0x9d82('0x1'));var path=require('path');var timeout=require(_0x9d82('0x2'));var express=require('express');var router=express[_0x9d82('0x3')]();var fs_extra=require(_0x9d82('0x4'));var auth=require(_0x9d82('0x5'));var interaction=require(_0x9d82('0x6'));var config=require(_0x9d82('0x7'));var controller=require('./smsQueueReport.controller');router[_0x9d82('0x8')]('/',auth[_0x9d82('0x9')](),controller[_0x9d82('0xa')]);router[_0x9d82('0x8')](_0x9d82('0xb'),auth[_0x9d82('0x9')](),controller[_0x9d82('0xc')]);router[_0x9d82('0x8')](_0x9d82('0xd'),auth[_0x9d82('0x9')](),controller[_0x9d82('0xe')]);router[_0x9d82('0xf')]('/',auth[_0x9d82('0x9')](),controller[_0x9d82('0x10')]);router[_0x9d82('0x11')](_0x9d82('0xd'),auth[_0x9d82('0x9')](),controller[_0x9d82('0x12')]);router[_0x9d82('0x13')](_0x9d82('0xd'),auth[_0x9d82('0x9')](),controller['destroy']);module[_0x9d82('0x14')]=router;
\ No newline at end of file
+var _0x7fd4=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fd4,0x117));var _0x47fd=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x7fd4[_0x595604];return _0x1466f3;};'use strict';var multer=require(_0x47fd('0x0'));var util=require(_0x47fd('0x1'));var path=require('path');var timeout=require(_0x47fd('0x2'));var express=require(_0x47fd('0x3'));var router=express[_0x47fd('0x4')]();var fs_extra=require(_0x47fd('0x5'));var auth=require(_0x47fd('0x6'));var interaction=require(_0x47fd('0x7'));var config=require('../../config/environment');var controller=require(_0x47fd('0x8'));router[_0x47fd('0x9')]('/',auth[_0x47fd('0xa')](),controller[_0x47fd('0xb')]);router[_0x47fd('0x9')](_0x47fd('0xc'),auth[_0x47fd('0xa')](),controller[_0x47fd('0xd')]);router[_0x47fd('0x9')]('/:id',auth[_0x47fd('0xa')](),controller[_0x47fd('0xe')]);router[_0x47fd('0xf')]('/',auth[_0x47fd('0xa')](),controller[_0x47fd('0x10')]);router[_0x47fd('0x11')](_0x47fd('0x12'),auth[_0x47fd('0xa')](),controller[_0x47fd('0x13')]);router[_0x47fd('0x14')]('/:id',auth[_0x47fd('0xa')](),controller[_0x47fd('0x15')]);module[_0x47fd('0x16')]=router;
\ No newline at end of file
index 0611f84..7dcc06b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46b9=['STRING','DATE','moment','sequelize'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x46b9,0x13e));var _0x946b=function(_0x397911,_0x1d2e61){_0x397911=_0x397911-0x0;var _0x429c87=_0x46b9[_0x397911];return _0x429c87;};'use strict';var moment=require(_0x946b('0x0'));var Sequelize=require(_0x946b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x946b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x946b('0x2')]},'joinAt':{'type':Sequelize[_0x946b('0x3')]},'leaveAt':{'type':Sequelize[_0x946b('0x3')]},'acceptAt':{'type':Sequelize[_0x946b('0x3')]},'exitAt':{'type':Sequelize[_0x946b('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7086=['moment','sequelize','exports','STRING','DATE'];(function(_0x99f838,_0xe376e2){var _0x432cd7=function(_0x2cd5dc){while(--_0x2cd5dc){_0x99f838['push'](_0x99f838['shift']());}};_0x432cd7(++_0xe376e2);}(_0x7086,0x181));var _0x6708=function(_0x598093,_0xa31df0){_0x598093=_0x598093-0x0;var _0x116a51=_0x7086[_0x598093];return _0x116a51;};'use strict';var moment=require(_0x6708('0x0'));var Sequelize=require(_0x6708('0x1'));module[_0x6708('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6708('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6708('0x4')]},'exitAt':{'type':Sequelize[_0x6708('0x4')]},'reason':{'type':Sequelize[_0x6708('0x3')]}};
\ No newline at end of file
index 2d47b78..03c2cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3633=['limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsQueueReport','findAll','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x452801,_0x4b7c3e){var _0x34ba64=function(_0x38c1ff){while(--_0x38c1ff){_0x452801['push'](_0x452801['shift']());}};_0x34ba64(++_0x4b7c3e);}(_0x3633,0x74));var _0x3363=function(_0x4046f9,_0x1551a1){_0x4046f9=_0x4046f9-0x0;var _0x13fcd2=_0x3633[_0x4046f9];return _0x13fcd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3363('0x0'));var zipdir=require(_0x3363('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3363('0x2'));var moment=require(_0x3363('0x3'));var BPromise=require(_0x3363('0x4'));var Mustache=require(_0x3363('0x5'));var util=require(_0x3363('0x6'));var path=require(_0x3363('0x7'));var sox=require(_0x3363('0x8'));var csv=require(_0x3363('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3363('0xa'));var _=require(_0x3363('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3363('0xc'));var toCsv=require(_0x3363('0x9'));var querystring=require(_0x3363('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3363('0xe'));var qs=require(_0x3363('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3363('0x10'))(_0x3363('0x11'));var utils=require('../../config/utils');var config=require(_0x3363('0x12'));var licenseUtil=require(_0x3363('0x13'));var db=require(_0x3363('0x14'))['db'];function respondWithStatusCode(_0xee133f,_0xc08c79){_0xc08c79=_0xc08c79||0xcc;return function(_0x16b00c){if(_0x16b00c){return _0xee133f[_0x3363('0x15')](_0xc08c79);}return _0xee133f['status'](_0xc08c79)[_0x3363('0x16')]();};}function respondWithResult(_0x33f567,_0x4e4198){_0x4e4198=_0x4e4198||0xc8;return function(_0x48bb98){if(_0x48bb98){return _0x33f567[_0x3363('0x17')](_0x4e4198)[_0x3363('0x18')](_0x48bb98);}};}function respondWithFilteredResult(_0x4a772c,_0x3454db){return function(_0x44c0fc){if(_0x44c0fc){var _0x2be0d0=typeof _0x3454db[_0x3363('0x19')]==='undefined'&&typeof _0x3454db[_0x3363('0x1a')]==='undefined';var _0x2658d9=_0x44c0fc[_0x3363('0x1b')];var _0x4f5c8d=_0x2be0d0?0x0:_0x3454db[_0x3363('0x19')];var _0x1b0c47=_0x2be0d0?_0x44c0fc[_0x3363('0x1b')]:_0x3454db['offset']+_0x3454db['limit'];var _0x575315;if(_0x1b0c47>=_0x2658d9){_0x1b0c47=_0x2658d9;_0x575315=0xc8;}else{_0x575315=0xce;}_0x4a772c[_0x3363('0x17')](_0x575315);return _0x4a772c[_0x3363('0x1c')]('Content-Range',_0x4f5c8d+'-'+_0x1b0c47+'/'+_0x2658d9)[_0x3363('0x18')](_0x44c0fc);}return null;};}function patchUpdates(_0x2224fe){return function(_0x12bc73){try{jsonpatch[_0x3363('0x1d')](_0x12bc73,_0x2224fe,!![]);}catch(_0x64b0){return BPromise[_0x3363('0x1e')](_0x64b0);}return _0x12bc73[_0x3363('0x1f')]();};}function saveUpdates(_0x505435,_0x1467ec){return function(_0x539f5b){if(_0x539f5b){return _0x539f5b[_0x3363('0x20')](_0x505435)[_0x3363('0x21')](function(_0x23c8e8){return _0x23c8e8;});}return null;};}function removeEntity(_0x18eee0,_0x2ec2c3){return function(_0x124c9b){if(_0x124c9b){return _0x124c9b[_0x3363('0x22')]()['then'](function(){_0x18eee0[_0x3363('0x17')](0xcc)[_0x3363('0x16')]();});}};}function handleEntityNotFound(_0x3d2dce,_0x3fd6ab){return function(_0x14abec){if(!_0x14abec){_0x3d2dce[_0x3363('0x15')](0x194);}return _0x14abec;};}function handleError(_0x2c0182,_0x48389c){_0x48389c=_0x48389c||0x1f4;return function(_0x2e1700){logger[_0x3363('0x23')](_0x2e1700[_0x3363('0x24')]);if(_0x2e1700[_0x3363('0x25')]){delete _0x2e1700[_0x3363('0x25')];}_0x2c0182['status'](_0x48389c)[_0x3363('0x26')](_0x2e1700);};}exports['index']=function(_0x190eb5,_0x579c4d){var _0x1273de={},_0x41c217={},_0x3e77ca={'count':0x0,'rows':[]};var _0x749965=_[_0x3363('0x27')](db['SmsQueueReport'][_0x3363('0x28')],function(_0x5c096a){return{'name':_0x5c096a[_0x3363('0x29')],'type':_0x5c096a[_0x3363('0x2a')][_0x3363('0x2b')]};});_0x41c217['model']=_[_0x3363('0x27')](_0x749965,_0x3363('0x25'));_0x41c217['query']=_[_0x3363('0x2c')](_0x190eb5[_0x3363('0x2d')]);_0x41c217[_0x3363('0x2e')]=_[_0x3363('0x2f')](_0x41c217['model'],_0x41c217[_0x3363('0x2d')]);_0x1273de['attributes']=_[_0x3363('0x2f')](_0x41c217[_0x3363('0x30')],qs[_0x3363('0x31')](_0x190eb5[_0x3363('0x2d')][_0x3363('0x31')]));_0x1273de[_0x3363('0x32')]=_0x1273de[_0x3363('0x32')][_0x3363('0x33')]?_0x1273de[_0x3363('0x32')]:_0x41c217['model'];if(!_0x190eb5['query']['hasOwnProperty'](_0x3363('0x34'))){_0x1273de['limit']=qs[_0x3363('0x1a')](_0x190eb5[_0x3363('0x2d')]['limit']);_0x1273de[_0x3363('0x19')]=qs['offset'](_0x190eb5[_0x3363('0x2d')]['offset']);}_0x1273de[_0x3363('0x35')]=qs[_0x3363('0x36')](_0x190eb5[_0x3363('0x2d')][_0x3363('0x36')]);_0x1273de[_0x3363('0x37')]=qs[_0x3363('0x2e')](_[_0x3363('0x38')](_0x190eb5[_0x3363('0x2d')],_0x41c217[_0x3363('0x2e')]),_0x749965);if(_0x190eb5['query'][_0x3363('0x39')]){_0x1273de['where']=_[_0x3363('0x3a')](_0x1273de[_0x3363('0x37')],{'$or':_[_0x3363('0x27')](_0x749965,function(_0x9c205b){if(_0x9c205b[_0x3363('0x2a')]!==_0x3363('0x3b')){var _0x585e81={};_0x585e81[_0x9c205b['name']]={'$like':'%'+_0x190eb5[_0x3363('0x2d')][_0x3363('0x39')]+'%'};return _0x585e81;}})});}_0x1273de=_[_0x3363('0x3a')]({},_0x1273de,_0x190eb5[_0x3363('0x3c')]);var _0xbaabb3={'where':_0x1273de[_0x3363('0x37')]};return db['SmsQueueReport'][_0x3363('0x1b')](_0xbaabb3)[_0x3363('0x21')](function(_0x339431){_0x3e77ca[_0x3363('0x1b')]=_0x339431;if(_0x190eb5[_0x3363('0x2d')][_0x3363('0x3d')]){_0x1273de[_0x3363('0x3e')]=[{'all':!![]}];}return db[_0x3363('0x3f')][_0x3363('0x40')](_0x1273de);})['then'](function(_0x11d53e){_0x3e77ca['rows']=_0x11d53e;return _0x3e77ca;})['then'](respondWithFilteredResult(_0x579c4d,_0x1273de))[_0x3363('0x41')](handleError(_0x579c4d,null));};exports['show']=function(_0x5e623d,_0x4026d2){var _0x52e294={'raw':!![],'where':{'id':_0x5e623d[_0x3363('0x42')]['id']}},_0x3801fd={};_0x3801fd[_0x3363('0x30')]=_[_0x3363('0x2c')](db[_0x3363('0x3f')][_0x3363('0x28')]);_0x3801fd[_0x3363('0x2d')]=_[_0x3363('0x2c')](_0x5e623d['query']);_0x3801fd['filters']=_[_0x3363('0x2f')](_0x3801fd[_0x3363('0x30')],_0x3801fd[_0x3363('0x2d')]);_0x52e294[_0x3363('0x32')]=_['intersection'](_0x3801fd[_0x3363('0x30')],qs[_0x3363('0x31')](_0x5e623d[_0x3363('0x2d')]['fields']));_0x52e294[_0x3363('0x32')]=_0x52e294['attributes'][_0x3363('0x33')]?_0x52e294[_0x3363('0x32')]:_0x3801fd[_0x3363('0x30')];if(_0x5e623d[_0x3363('0x2d')][_0x3363('0x3d')]){_0x52e294[_0x3363('0x3e')]=[{'all':!![]}];}_0x52e294=_['merge']({},_0x52e294,_0x5e623d[_0x3363('0x3c')]);return db[_0x3363('0x3f')][_0x3363('0x43')](_0x52e294)[_0x3363('0x21')](handleEntityNotFound(_0x4026d2,null))[_0x3363('0x21')](respondWithResult(_0x4026d2,null))['catch'](handleError(_0x4026d2,null));};exports['create']=function(_0x2606c8,_0x1d4aff){return db[_0x3363('0x3f')][_0x3363('0x44')](_0x2606c8['body'],{})[_0x3363('0x21')](respondWithResult(_0x1d4aff,0xc9))[_0x3363('0x41')](handleError(_0x1d4aff,null));};exports[_0x3363('0x20')]=function(_0x597744,_0x440393){if(_0x597744[_0x3363('0x45')]['id']){delete _0x597744[_0x3363('0x45')]['id'];}return db['SmsQueueReport'][_0x3363('0x43')]({'where':{'id':_0x597744[_0x3363('0x42')]['id']}})[_0x3363('0x21')](handleEntityNotFound(_0x440393,null))[_0x3363('0x21')](saveUpdates(_0x597744[_0x3363('0x45')],null))[_0x3363('0x21')](respondWithResult(_0x440393,null))[_0x3363('0x41')](handleError(_0x440393,null));};exports['destroy']=function(_0x427738,_0x2e2846){return db['SmsQueueReport'][_0x3363('0x43')]({'where':{'id':_0x427738[_0x3363('0x42')]['id']}})[_0x3363('0x21')](handleEntityNotFound(_0x2e2846,null))['then'](removeEntity(_0x2e2846,null))[_0x3363('0x41')](handleError(_0x2e2846,null));};exports[_0x3363('0x46')]=function(_0x1ebae4,_0x850254){return db[_0x3363('0x3f')][_0x3363('0x46')]()[_0x3363('0x21')](respondWithResult(_0x850254,null))[_0x3363('0x41')](handleError(_0x850254,null));};
\ No newline at end of file
+var _0x82f2=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x512a42,_0x37e447){var _0x21938c=function(_0x288aba){while(--_0x288aba){_0x512a42['push'](_0x512a42['shift']());}};_0x21938c(++_0x37e447);}(_0x82f2,0x16c));var _0x282f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x82f2[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x282f('0x0'));var jsonpatch=require(_0x282f('0x1'));var rp=require(_0x282f('0x2'));var moment=require('moment');var BPromise=require(_0x282f('0x3'));var Mustache=require(_0x282f('0x4'));var util=require(_0x282f('0x5'));var path=require(_0x282f('0x6'));var sox=require(_0x282f('0x7'));var csv=require(_0x282f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x282f('0x9'));var _=require('lodash');var squel=require(_0x282f('0xa'));var crypto=require(_0x282f('0xb'));var jsforce=require(_0x282f('0xc'));var deskjs=require(_0x282f('0xd'));var toCsv=require(_0x282f('0x8'));var querystring=require(_0x282f('0xe'));var Papa=require(_0x282f('0xf'));var Redis=require(_0x282f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x282f('0x11'));var logger=require(_0x282f('0x12'))('api');var utils=require(_0x282f('0x13'));var config=require(_0x282f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x282f('0x15'))['db'];function respondWithStatusCode(_0x39f640,_0x3b28fe){_0x3b28fe=_0x3b28fe||0xcc;return function(_0x45f7b9){if(_0x45f7b9){return _0x39f640[_0x282f('0x16')](_0x3b28fe);}return _0x39f640['status'](_0x3b28fe)[_0x282f('0x17')]();};}function respondWithResult(_0x4102fb,_0x15f2a0){_0x15f2a0=_0x15f2a0||0xc8;return function(_0x56b232){if(_0x56b232){return _0x4102fb['status'](_0x15f2a0)[_0x282f('0x18')](_0x56b232);}};}function respondWithFilteredResult(_0x4beedf,_0x157b75){return function(_0x43997b){if(_0x43997b){var _0x309a6b=typeof _0x157b75[_0x282f('0x19')]==='undefined'&&typeof _0x157b75[_0x282f('0x1a')]===_0x282f('0x1b');var _0x455c71=_0x43997b[_0x282f('0x1c')];var _0xdc96ee=_0x309a6b?0x0:_0x157b75['offset'];var _0x12bd79=_0x309a6b?_0x43997b[_0x282f('0x1c')]:_0x157b75[_0x282f('0x19')]+_0x157b75[_0x282f('0x1a')];var _0x34b2b8;if(_0x12bd79>=_0x455c71){_0x12bd79=_0x455c71;_0x34b2b8=0xc8;}else{_0x34b2b8=0xce;}_0x4beedf[_0x282f('0x1d')](_0x34b2b8);return _0x4beedf['set'](_0x282f('0x1e'),_0xdc96ee+'-'+_0x12bd79+'/'+_0x455c71)[_0x282f('0x18')](_0x43997b);}return null;};}function patchUpdates(_0x3f2053){return function(_0x321881){try{jsonpatch[_0x282f('0x1f')](_0x321881,_0x3f2053,!![]);}catch(_0x21750c){return BPromise[_0x282f('0x20')](_0x21750c);}return _0x321881['save']();};}function saveUpdates(_0xeafe21,_0x5d5bc7){return function(_0x2fe24e){if(_0x2fe24e){return _0x2fe24e[_0x282f('0x21')](_0xeafe21)[_0x282f('0x22')](function(_0x276f50){return _0x276f50;});}return null;};}function removeEntity(_0x5ce481,_0x24588b){return function(_0x435384){if(_0x435384){return _0x435384['destroy']()['then'](function(){_0x5ce481[_0x282f('0x1d')](0xcc)[_0x282f('0x17')]();});}};}function handleEntityNotFound(_0xfdbb99,_0x29d478){return function(_0x4eec66){if(!_0x4eec66){_0xfdbb99['sendStatus'](0x194);}return _0x4eec66;};}function handleError(_0x2fe00f,_0x40675f){_0x40675f=_0x40675f||0x1f4;return function(_0x4a8601){logger[_0x282f('0x23')](_0x4a8601[_0x282f('0x24')]);if(_0x4a8601[_0x282f('0x25')]){delete _0x4a8601[_0x282f('0x25')];}_0x2fe00f[_0x282f('0x1d')](_0x40675f)[_0x282f('0x26')](_0x4a8601);};}exports[_0x282f('0x27')]=function(_0x55af5c,_0x37da95){var _0x4b64aa={},_0x216d02={},_0x4e581f={'count':0x0,'rows':[]};var _0x505c25=_[_0x282f('0x28')](db[_0x282f('0x29')][_0x282f('0x2a')],function(_0x39af23){return{'name':_0x39af23[_0x282f('0x2b')],'type':_0x39af23[_0x282f('0x2c')]['key']};});_0x216d02['model']=_[_0x282f('0x28')](_0x505c25,_0x282f('0x25'));_0x216d02['query']=_[_0x282f('0x2d')](_0x55af5c['query']);_0x216d02[_0x282f('0x2e')]=_[_0x282f('0x2f')](_0x216d02[_0x282f('0x30')],_0x216d02['query']);_0x4b64aa[_0x282f('0x31')]=_['intersection'](_0x216d02[_0x282f('0x30')],qs[_0x282f('0x32')](_0x55af5c[_0x282f('0x33')][_0x282f('0x32')]));_0x4b64aa[_0x282f('0x31')]=_0x4b64aa[_0x282f('0x31')]['length']?_0x4b64aa[_0x282f('0x31')]:_0x216d02[_0x282f('0x30')];if(!_0x55af5c[_0x282f('0x33')][_0x282f('0x34')]('nolimit')){_0x4b64aa[_0x282f('0x1a')]=qs[_0x282f('0x1a')](_0x55af5c['query'][_0x282f('0x1a')]);_0x4b64aa[_0x282f('0x19')]=qs[_0x282f('0x19')](_0x55af5c[_0x282f('0x33')][_0x282f('0x19')]);}_0x4b64aa[_0x282f('0x35')]=qs['sort'](_0x55af5c[_0x282f('0x33')][_0x282f('0x36')]);_0x4b64aa['where']=qs[_0x282f('0x2e')](_[_0x282f('0x37')](_0x55af5c[_0x282f('0x33')],_0x216d02[_0x282f('0x2e')]),_0x505c25);if(_0x55af5c[_0x282f('0x33')]['filter']){_0x4b64aa[_0x282f('0x38')]=_[_0x282f('0x39')](_0x4b64aa[_0x282f('0x38')],{'$or':_['map'](_0x505c25,function(_0x3d3c81){if(_0x3d3c81[_0x282f('0x2c')]!==_0x282f('0x3a')){var _0x4fcea5={};_0x4fcea5[_0x3d3c81['name']]={'$like':'%'+_0x55af5c[_0x282f('0x33')][_0x282f('0x3b')]+'%'};return _0x4fcea5;}})});}_0x4b64aa=_[_0x282f('0x39')]({},_0x4b64aa,_0x55af5c['options']);var _0x5e110a={'where':_0x4b64aa['where']};return db[_0x282f('0x29')]['count'](_0x5e110a)[_0x282f('0x22')](function(_0x21fb58){_0x4e581f[_0x282f('0x1c')]=_0x21fb58;if(_0x55af5c[_0x282f('0x33')]['includeAll']){_0x4b64aa[_0x282f('0x3c')]=[{'all':!![]}];}return db[_0x282f('0x29')][_0x282f('0x3d')](_0x4b64aa);})[_0x282f('0x22')](function(_0x362563){_0x4e581f[_0x282f('0x3e')]=_0x362563;return _0x4e581f;})['then'](respondWithFilteredResult(_0x37da95,_0x4b64aa))[_0x282f('0x3f')](handleError(_0x37da95,null));};exports[_0x282f('0x40')]=function(_0x551589,_0x1ec3bb){var _0xd67ca9={'raw':!![],'where':{'id':_0x551589[_0x282f('0x41')]['id']}},_0x7ac9d1={};_0x7ac9d1[_0x282f('0x30')]=_['keys'](db['SmsQueueReport'][_0x282f('0x2a')]);_0x7ac9d1[_0x282f('0x33')]=_['keys'](_0x551589['query']);_0x7ac9d1[_0x282f('0x2e')]=_[_0x282f('0x2f')](_0x7ac9d1[_0x282f('0x30')],_0x7ac9d1['query']);_0xd67ca9['attributes']=_[_0x282f('0x2f')](_0x7ac9d1[_0x282f('0x30')],qs[_0x282f('0x32')](_0x551589[_0x282f('0x33')][_0x282f('0x32')]));_0xd67ca9[_0x282f('0x31')]=_0xd67ca9[_0x282f('0x31')][_0x282f('0x42')]?_0xd67ca9[_0x282f('0x31')]:_0x7ac9d1[_0x282f('0x30')];if(_0x551589[_0x282f('0x33')][_0x282f('0x43')]){_0xd67ca9[_0x282f('0x3c')]=[{'all':!![]}];}_0xd67ca9=_[_0x282f('0x39')]({},_0xd67ca9,_0x551589[_0x282f('0x44')]);return db[_0x282f('0x29')][_0x282f('0x45')](_0xd67ca9)[_0x282f('0x22')](handleEntityNotFound(_0x1ec3bb,null))['then'](respondWithResult(_0x1ec3bb,null))[_0x282f('0x3f')](handleError(_0x1ec3bb,null));};exports['create']=function(_0x5ee414,_0x5bb598){return db['SmsQueueReport'][_0x282f('0x46')](_0x5ee414['body'],{})['then'](respondWithResult(_0x5bb598,0xc9))[_0x282f('0x3f')](handleError(_0x5bb598,null));};exports['update']=function(_0x53f9d2,_0x185873){if(_0x53f9d2['body']['id']){delete _0x53f9d2[_0x282f('0x47')]['id'];}return db[_0x282f('0x29')]['find']({'where':{'id':_0x53f9d2[_0x282f('0x41')]['id']}})[_0x282f('0x22')](handleEntityNotFound(_0x185873,null))['then'](saveUpdates(_0x53f9d2['body'],null))[_0x282f('0x22')](respondWithResult(_0x185873,null))[_0x282f('0x3f')](handleError(_0x185873,null));};exports[_0x282f('0x48')]=function(_0x3a2a10,_0x1c945f){return db['SmsQueueReport'][_0x282f('0x45')]({'where':{'id':_0x3a2a10[_0x282f('0x41')]['id']}})[_0x282f('0x22')](handleEntityNotFound(_0x1c945f,null))[_0x282f('0x22')](removeEntity(_0x1c945f,null))[_0x282f('0x3f')](handleError(_0x1c945f,null));};exports[_0x282f('0x49')]=function(_0x33912f,_0x581578){return db[_0x282f('0x29')][_0x282f('0x49')]()[_0x282f('0x22')](respondWithResult(_0x581578,null))[_0x282f('0x3f')](handleError(_0x581578,null));};
\ No newline at end of file
index ed662ce..83da313 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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
index 3a10194..8578b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd648=['options','raw','UpdateSmsQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0x29760f,_0x32b984){var _0x287c29=function(_0x5d41d5){while(--_0x5d41d5){_0x29760f['push'](_0x29760f['shift']());}};_0x287c29(++_0x32b984);}(_0xd648,0x19e));var _0x8d64=function(_0x17e87b,_0x27839a){_0x17e87b=_0x17e87b-0x0;var _0x25cbc0=_0xd648[_0x17e87b];return _0x25cbc0;};'use strict';var _=require(_0x8d64('0x0'));var util=require('util');var moment=require(_0x8d64('0x1'));var BPromise=require(_0x8d64('0x2'));var rs=require(_0x8d64('0x3'));var fs=require('fs');var Redis=require(_0x8d64('0x4'));var db=require(_0x8d64('0x5'))['db'];var utils=require(_0x8d64('0x6'));var logger=require('../../config/logger')(_0x8d64('0x7'));var config=require(_0x8d64('0x8'));var jayson=require(_0x8d64('0x9'));var client=jayson[_0x8d64('0xa')][_0x8d64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x248892,_0x115c64,_0x4a0d01){return new BPromise(function(_0x213e87,_0x2659a0){return client[_0x8d64('0xc')](_0x248892,_0x4a0d01)[_0x8d64('0xd')](function(_0x210904){logger[_0x8d64('0xe')](_0x8d64('0xf'),_0x115c64,_0x8d64('0x10'));logger[_0x8d64('0x11')](_0x8d64('0x12'),_0x115c64,_0x8d64('0x10'),JSON[_0x8d64('0x13')](_0x210904));if(_0x210904[_0x8d64('0x14')]){if(_0x210904[_0x8d64('0x14')][_0x8d64('0x15')]===0x1f4){logger[_0x8d64('0x14')](_0x8d64('0xf'),_0x115c64,_0x210904['error'][_0x8d64('0x16')]);return _0x2659a0(_0x210904[_0x8d64('0x14')]['message']);}logger['error'](_0x8d64('0xf'),_0x115c64,_0x210904[_0x8d64('0x14')]['message']);return _0x213e87(_0x210904[_0x8d64('0x14')][_0x8d64('0x16')]);}else{logger[_0x8d64('0xe')](_0x8d64('0xf'),_0x115c64,_0x8d64('0x10'));_0x213e87(_0x210904[_0x8d64('0x17')][_0x8d64('0x16')]);}})[_0x8d64('0x18')](function(_0x5626a4){logger['error'](_0x8d64('0xf'),_0x115c64,_0x5626a4);_0x2659a0(_0x5626a4);});});}exports[_0x8d64('0x19')]=function(_0xd8bdbf){var _0x4cb31a=this;return new Promise(function(_0x36b338,_0x37b344){return db[_0x8d64('0x1a')][_0x8d64('0x1b')](_0xd8bdbf['body'],{'raw':_0xd8bdbf['options']?_0xd8bdbf[_0x8d64('0x1c')][_0x8d64('0x1d')]===undefined?!![]:![]:!![]})[_0x8d64('0xd')](function(_0x5b8672){logger['info'](_0x8d64('0x19'),_0xd8bdbf);logger['debug'](_0x8d64('0x19'),_0xd8bdbf,JSON[_0x8d64('0x13')](_0x5b8672));_0x36b338(_0x5b8672);})[_0x8d64('0x18')](function(_0x52fa71){logger[_0x8d64('0x14')](_0x8d64('0x19'),_0x52fa71[_0x8d64('0x16')],_0xd8bdbf);_0x37b344(_0x4cb31a[_0x8d64('0x14')](0x1f4,_0x52fa71[_0x8d64('0x16')]));});});};exports[_0x8d64('0x1e')]=function(_0x540492){var _0x2cbc6f=this;return new Promise(function(_0x13f591,_0x52336c){return db[_0x8d64('0x1a')][_0x8d64('0x1f')](_0x540492['body'],{'raw':_0x540492[_0x8d64('0x1c')]?_0x540492[_0x8d64('0x1c')][_0x8d64('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540492[_0x8d64('0x1c')]?_0x540492[_0x8d64('0x1c')][_0x8d64('0x20')]||null:null,'attributes':_0x540492['options']?_0x540492[_0x8d64('0x1c')]['attributes']||null:null,'limit':_0x540492['options']?_0x540492[_0x8d64('0x1c')][_0x8d64('0x21')]||null:null})[_0x8d64('0xd')](function(_0x1e83b3){logger[_0x8d64('0xe')](_0x8d64('0x1e'),_0x540492);logger[_0x8d64('0x11')]('UpdateSmsQueueReport',_0x540492,JSON[_0x8d64('0x13')](_0x1e83b3));_0x13f591(_0x1e83b3);})['catch'](function(_0x543ee2){logger['error'](_0x8d64('0x1e'),_0x543ee2[_0x8d64('0x16')],_0x540492);_0x52336c(_0x2cbc6f[_0x8d64('0x14')](0x1f4,_0x543ee2[_0x8d64('0x16')]));});});};
\ No newline at end of file
+var _0x7917=['attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsQueueReport','create','body','options','CreateSmsQueueReport','UpdateSmsQueueReport','raw','where'];(function(_0x1522db,_0x7efece){var _0x165585=function(_0x1c8f19){while(--_0x1c8f19){_0x1522db['push'](_0x1522db['shift']());}};_0x165585(++_0x7efece);}(_0x7917,0xea));var _0x7791=function(_0x46e65b,_0x3689cb){_0x46e65b=_0x46e65b-0x0;var _0x2e63d4=_0x7917[_0x46e65b];return _0x2e63d4;};'use strict';var _=require('lodash');var util=require(_0x7791('0x0'));var moment=require(_0x7791('0x1'));var BPromise=require(_0x7791('0x2'));var rs=require(_0x7791('0x3'));var fs=require('fs');var Redis=require(_0x7791('0x4'));var db=require(_0x7791('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7791('0x6'))(_0x7791('0x7'));var config=require(_0x7791('0x8'));var jayson=require(_0x7791('0x9'));var client=jayson[_0x7791('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35b8e8,_0x470d1c,_0x3bc9d4){return new BPromise(function(_0xbfeb52,_0x5b46a7){return client[_0x7791('0xb')](_0x35b8e8,_0x3bc9d4)[_0x7791('0xc')](function(_0x5ebe09){logger[_0x7791('0xd')](_0x7791('0xe'),_0x470d1c,_0x7791('0xf'));logger['debug'](_0x7791('0x10'),_0x470d1c,_0x7791('0xf'),JSON[_0x7791('0x11')](_0x5ebe09));if(_0x5ebe09[_0x7791('0x12')]){if(_0x5ebe09[_0x7791('0x12')][_0x7791('0x13')]===0x1f4){logger['error'](_0x7791('0xe'),_0x470d1c,_0x5ebe09[_0x7791('0x12')][_0x7791('0x14')]);return _0x5b46a7(_0x5ebe09[_0x7791('0x12')][_0x7791('0x14')]);}logger[_0x7791('0x12')](_0x7791('0xe'),_0x470d1c,_0x5ebe09['error'][_0x7791('0x14')]);return _0xbfeb52(_0x5ebe09[_0x7791('0x12')][_0x7791('0x14')]);}else{logger['info'](_0x7791('0xe'),_0x470d1c,_0x7791('0xf'));_0xbfeb52(_0x5ebe09['result'][_0x7791('0x14')]);}})[_0x7791('0x15')](function(_0x137269){logger[_0x7791('0x12')](_0x7791('0xe'),_0x470d1c,_0x137269);_0x5b46a7(_0x137269);});});}exports['CreateSmsQueueReport']=function(_0x71631a){var _0x4ec11b=this;return new Promise(function(_0x27b09e,_0x2f772c){return db[_0x7791('0x16')][_0x7791('0x17')](_0x71631a[_0x7791('0x18')],{'raw':_0x71631a[_0x7791('0x19')]?_0x71631a[_0x7791('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x535f9f){logger[_0x7791('0xd')](_0x7791('0x1a'),_0x71631a);logger['debug'](_0x7791('0x1a'),_0x71631a,JSON['stringify'](_0x535f9f));_0x27b09e(_0x535f9f);})[_0x7791('0x15')](function(_0x306c4c){logger['error'](_0x7791('0x1a'),_0x306c4c[_0x7791('0x14')],_0x71631a);_0x2f772c(_0x4ec11b[_0x7791('0x12')](0x1f4,_0x306c4c[_0x7791('0x14')]));});});};exports[_0x7791('0x1b')]=function(_0x29680c){var _0x1aecda=this;return new Promise(function(_0x5617c7,_0x311023){return db[_0x7791('0x16')]['update'](_0x29680c[_0x7791('0x18')],{'raw':_0x29680c[_0x7791('0x19')]?_0x29680c[_0x7791('0x19')][_0x7791('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29680c['options']?_0x29680c[_0x7791('0x19')][_0x7791('0x1d')]||null:null,'attributes':_0x29680c[_0x7791('0x19')]?_0x29680c[_0x7791('0x19')][_0x7791('0x1e')]||null:null,'limit':_0x29680c[_0x7791('0x19')]?_0x29680c['options'][_0x7791('0x1f')]||null:null})[_0x7791('0xc')](function(_0x304895){logger[_0x7791('0xd')](_0x7791('0x1b'),_0x29680c);logger[_0x7791('0x20')](_0x7791('0x1b'),_0x29680c,JSON[_0x7791('0x11')](_0x304895));_0x5617c7(_0x304895);})[_0x7791('0x15')](function(_0xb619bd){logger[_0x7791('0x12')](_0x7791('0x1b'),_0xb619bd['message'],_0x29680c);_0x311023(_0x1aecda[_0x7791('0x12')](0x1f4,_0xb619bd[_0x7791('0x14')]));});});};
\ No newline at end of file
index 075de7a..567ef86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x3ed203,_0x4e3a3c){var _0x558502=function(_0x454c3b){while(--_0x454c3b){_0x3ed203['push'](_0x3ed203['shift']());}};_0x558502(++_0x4e3a3c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x473719,_0x1fdb11){_0x473719=_0x473719-0x0;var _0x3a6122=_0xdc97[_0x473719];return _0x3a6122;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['post']('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7f42=['delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x1a362a,_0x532d2e){var _0x1c6fc4=function(_0x57b081){while(--_0x57b081){_0x1a362a['push'](_0x1a362a['shift']());}};_0x1c6fc4(++_0x532d2e);}(_0x7f42,0x1dd));var _0x27f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f42[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x27f4('0x0'));var util=require('util');var path=require(_0x27f4('0x1'));var timeout=require(_0x27f4('0x2'));var express=require('express');var router=express[_0x27f4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x27f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x27f4('0x5'));var controller=require('./smsTransferReport.controller');router[_0x27f4('0x6')]('/',auth['isAuthenticated'](),controller[_0x27f4('0x7')]);router[_0x27f4('0x6')](_0x27f4('0x8'),auth[_0x27f4('0x9')](),controller[_0x27f4('0xa')]);router[_0x27f4('0x6')](_0x27f4('0xb'),auth[_0x27f4('0x9')](),controller[_0x27f4('0xc')]);router[_0x27f4('0xd')]('/',auth[_0x27f4('0x9')](),controller[_0x27f4('0xe')]);router[_0x27f4('0xf')](_0x27f4('0xb'),auth[_0x27f4('0x9')](),controller[_0x27f4('0x10')]);router[_0x27f4('0x11')](_0x27f4('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x27f4('0x12')]=router;
\ No newline at end of file
index e49e550..b49d725 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(_0x5c96dd,_0x3017af){var _0x20416f=function(_0x30a54e){while(--_0x30a54e){_0x5c96dd['push'](_0x5c96dd['shift']());}};_0x20416f(++_0x3017af);}(_0x34e8,0x12c));var _0x834e=function(_0x426862,_0x4e9a91){_0x426862=_0x426862-0x0;var _0x2e536c=_0x34e8[_0x426862];return _0x2e536c;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4eaf72,_0x306e55){var _0x595136=function(_0x72a57b){while(--_0x72a57b){_0x4eaf72['push'](_0x4eaf72['shift']());}};_0x595136(++_0x306e55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
index 6ae878d..c2f669e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9902=['map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','intersection','length','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x9902,0x1dc));var _0x2990=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9902[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x2990('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2990('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2990('0x2'));var moment=require(_0x2990('0x3'));var BPromise=require(_0x2990('0x4'));var Mustache=require(_0x2990('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2990('0x6'));var ejs=require(_0x2990('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2990('0x8'));var squel=require(_0x2990('0x9'));var crypto=require(_0x2990('0xa'));var jsforce=require(_0x2990('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2990('0x6'));var querystring=require(_0x2990('0xc'));var Papa=require(_0x2990('0xd'));var Redis=require(_0x2990('0xe'));var authService=require(_0x2990('0xf'));var qs=require(_0x2990('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2990('0x11'))(_0x2990('0x12'));var utils=require(_0x2990('0x13'));var config=require(_0x2990('0x14'));var licenseUtil=require(_0x2990('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x237b5e,_0x4d0e3c){_0x4d0e3c=_0x4d0e3c||0xcc;return function(_0x59230a){if(_0x59230a){return _0x237b5e[_0x2990('0x16')](_0x4d0e3c);}return _0x237b5e[_0x2990('0x17')](_0x4d0e3c)[_0x2990('0x18')]();};}function respondWithResult(_0x1e0de8,_0x412a5b){_0x412a5b=_0x412a5b||0xc8;return function(_0x38e38c){if(_0x38e38c){return _0x1e0de8['status'](_0x412a5b)[_0x2990('0x19')](_0x38e38c);}};}function respondWithFilteredResult(_0x39937b,_0x34c0d7){return function(_0x3d0851){if(_0x3d0851){var _0x5d8749=typeof _0x34c0d7[_0x2990('0x1a')]===_0x2990('0x1b')&&typeof _0x34c0d7[_0x2990('0x1c')]===_0x2990('0x1b');var _0x27f91c=_0x3d0851['count'];var _0x1d3b38=_0x5d8749?0x0:_0x34c0d7[_0x2990('0x1a')];var _0x22412c=_0x5d8749?_0x3d0851[_0x2990('0x1d')]:_0x34c0d7[_0x2990('0x1a')]+_0x34c0d7[_0x2990('0x1c')];var _0x4c7d52;if(_0x22412c>=_0x27f91c){_0x22412c=_0x27f91c;_0x4c7d52=0xc8;}else{_0x4c7d52=0xce;}_0x39937b[_0x2990('0x17')](_0x4c7d52);return _0x39937b[_0x2990('0x1e')](_0x2990('0x1f'),_0x1d3b38+'-'+_0x22412c+'/'+_0x27f91c)[_0x2990('0x19')](_0x3d0851);}return null;};}function patchUpdates(_0x6d6b42){return function(_0x207a3a){try{jsonpatch[_0x2990('0x20')](_0x207a3a,_0x6d6b42,!![]);}catch(_0x40403a){return BPromise[_0x2990('0x21')](_0x40403a);}return _0x207a3a['save']();};}function saveUpdates(_0x4ca3d1,_0x383531){return function(_0x2a627d){if(_0x2a627d){return _0x2a627d[_0x2990('0x22')](_0x4ca3d1)[_0x2990('0x23')](function(_0x22f61a){return _0x22f61a;});}return null;};}function removeEntity(_0x36122a,_0x3bac70){return function(_0x6a15e2){if(_0x6a15e2){return _0x6a15e2[_0x2990('0x24')]()['then'](function(){_0x36122a[_0x2990('0x17')](0xcc)[_0x2990('0x18')]();});}};}function handleEntityNotFound(_0x323383,_0x12fc52){return function(_0x1e40ed){if(!_0x1e40ed){_0x323383[_0x2990('0x16')](0x194);}return _0x1e40ed;};}function handleError(_0x111ab8,_0x16f810){_0x16f810=_0x16f810||0x1f4;return function(_0x4e2533){logger[_0x2990('0x25')](_0x4e2533[_0x2990('0x26')]);if(_0x4e2533['name']){delete _0x4e2533[_0x2990('0x27')];}_0x111ab8[_0x2990('0x17')](_0x16f810)[_0x2990('0x28')](_0x4e2533);};}exports[_0x2990('0x29')]=function(_0x22a238,_0x5927cd){var _0x3fa4e0={},_0x5baf8c={},_0x43f41d={'count':0x0,'rows':[]};var _0x5385ad=_[_0x2990('0x2a')](db[_0x2990('0x2b')][_0x2990('0x2c')],function(_0x470ea2){return{'name':_0x470ea2[_0x2990('0x2d')],'type':_0x470ea2['type'][_0x2990('0x2e')]};});_0x5baf8c[_0x2990('0x2f')]=_['map'](_0x5385ad,_0x2990('0x27'));_0x5baf8c[_0x2990('0x30')]=_[_0x2990('0x31')](_0x22a238[_0x2990('0x30')]);_0x5baf8c['filters']=_['intersection'](_0x5baf8c[_0x2990('0x2f')],_0x5baf8c[_0x2990('0x30')]);_0x3fa4e0['attributes']=_['intersection'](_0x5baf8c[_0x2990('0x2f')],qs[_0x2990('0x32')](_0x22a238[_0x2990('0x30')][_0x2990('0x32')]));_0x3fa4e0[_0x2990('0x33')]=_0x3fa4e0[_0x2990('0x33')]['length']?_0x3fa4e0['attributes']:_0x5baf8c[_0x2990('0x2f')];if(!_0x22a238[_0x2990('0x30')][_0x2990('0x34')](_0x2990('0x35'))){_0x3fa4e0[_0x2990('0x1c')]=qs[_0x2990('0x1c')](_0x22a238[_0x2990('0x30')][_0x2990('0x1c')]);_0x3fa4e0[_0x2990('0x1a')]=qs[_0x2990('0x1a')](_0x22a238[_0x2990('0x30')]['offset']);}_0x3fa4e0['order']=qs[_0x2990('0x36')](_0x22a238[_0x2990('0x30')][_0x2990('0x36')]);_0x3fa4e0[_0x2990('0x37')]=qs[_0x2990('0x38')](_['pick'](_0x22a238['query'],_0x5baf8c[_0x2990('0x38')]),_0x5385ad);if(_0x22a238['query'][_0x2990('0x39')]){_0x3fa4e0[_0x2990('0x37')]=_['merge'](_0x3fa4e0[_0x2990('0x37')],{'$or':_[_0x2990('0x2a')](_0x5385ad,function(_0x4aa6f6){if(_0x4aa6f6[_0x2990('0x3a')]!==_0x2990('0x3b')){var _0x5002a7={};_0x5002a7[_0x4aa6f6[_0x2990('0x27')]]={'$like':'%'+_0x22a238[_0x2990('0x30')]['filter']+'%'};return _0x5002a7;}})});}_0x3fa4e0=_[_0x2990('0x3c')]({},_0x3fa4e0,_0x22a238[_0x2990('0x3d')]);var _0x57089b={'where':_0x3fa4e0[_0x2990('0x37')]};return db[_0x2990('0x2b')][_0x2990('0x1d')](_0x57089b)[_0x2990('0x23')](function(_0x52680d){_0x43f41d[_0x2990('0x1d')]=_0x52680d;if(_0x22a238[_0x2990('0x30')][_0x2990('0x3e')]){_0x3fa4e0[_0x2990('0x3f')]=[{'all':!![]}];}return db[_0x2990('0x2b')]['findAll'](_0x3fa4e0);})['then'](function(_0x148b5f){_0x43f41d[_0x2990('0x40')]=_0x148b5f;return _0x43f41d;})[_0x2990('0x23')](respondWithFilteredResult(_0x5927cd,_0x3fa4e0))[_0x2990('0x41')](handleError(_0x5927cd,null));};exports[_0x2990('0x42')]=function(_0x4c327e,_0xc0660){var _0x3d8e12={'raw':!![],'where':{'id':_0x4c327e[_0x2990('0x43')]['id']}},_0xdf0631={};_0xdf0631[_0x2990('0x2f')]=_[_0x2990('0x31')](db['SmsTransferReport']['rawAttributes']);_0xdf0631[_0x2990('0x30')]=_[_0x2990('0x31')](_0x4c327e[_0x2990('0x30')]);_0xdf0631[_0x2990('0x38')]=_[_0x2990('0x44')](_0xdf0631[_0x2990('0x2f')],_0xdf0631[_0x2990('0x30')]);_0x3d8e12['attributes']=_[_0x2990('0x44')](_0xdf0631[_0x2990('0x2f')],qs[_0x2990('0x32')](_0x4c327e['query']['fields']));_0x3d8e12[_0x2990('0x33')]=_0x3d8e12[_0x2990('0x33')][_0x2990('0x45')]?_0x3d8e12[_0x2990('0x33')]:_0xdf0631[_0x2990('0x2f')];if(_0x4c327e[_0x2990('0x30')]['includeAll']){_0x3d8e12[_0x2990('0x3f')]=[{'all':!![]}];}_0x3d8e12=_[_0x2990('0x3c')]({},_0x3d8e12,_0x4c327e[_0x2990('0x3d')]);return db['SmsTransferReport']['find'](_0x3d8e12)[_0x2990('0x23')](handleEntityNotFound(_0xc0660,null))[_0x2990('0x23')](respondWithResult(_0xc0660,null))[_0x2990('0x41')](handleError(_0xc0660,null));};exports[_0x2990('0x46')]=function(_0x414241,_0x4a6ffe){return db[_0x2990('0x2b')]['create'](_0x414241[_0x2990('0x47')],{})['then'](respondWithResult(_0x4a6ffe,0xc9))[_0x2990('0x41')](handleError(_0x4a6ffe,null));};exports['update']=function(_0x5df2af,_0x3f7666){if(_0x5df2af[_0x2990('0x47')]['id']){delete _0x5df2af[_0x2990('0x47')]['id'];}return db[_0x2990('0x2b')][_0x2990('0x48')]({'where':{'id':_0x5df2af[_0x2990('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f7666,null))[_0x2990('0x23')](saveUpdates(_0x5df2af[_0x2990('0x47')],null))[_0x2990('0x23')](respondWithResult(_0x3f7666,null))[_0x2990('0x41')](handleError(_0x3f7666,null));};exports[_0x2990('0x24')]=function(_0x31caff,_0x59f1c6){return db['SmsTransferReport'][_0x2990('0x48')]({'where':{'id':_0x31caff[_0x2990('0x43')]['id']}})[_0x2990('0x23')](handleEntityNotFound(_0x59f1c6,null))[_0x2990('0x23')](removeEntity(_0x59f1c6,null))[_0x2990('0x41')](handleError(_0x59f1c6,null));};exports[_0x2990('0x49')]=function(_0x5474d7,_0x4a76f8){return db[_0x2990('0x2b')]['describe']()['then'](respondWithResult(_0x4a76f8,null))['catch'](handleError(_0x4a76f8,null));};
\ No newline at end of file
+var _0xa9bc=['limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x3f52ee,_0x468aab){var _0x4f7924=function(_0x405846){while(--_0x405846){_0x3f52ee['push'](_0x3f52ee['shift']());}};_0x4f7924(++_0x468aab);}(_0xa9bc,0xcc));var _0xca9b=function(_0x2e5a22,_0x58140a){_0x2e5a22=_0x2e5a22-0x0;var _0x28ea33=_0xa9bc[_0x2e5a22];return _0x28ea33;};'use strict';var emlformat=require(_0xca9b('0x0'));var rimraf=require(_0xca9b('0x1'));var zipdir=require(_0xca9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca9b('0x3'));var moment=require(_0xca9b('0x4'));var BPromise=require(_0xca9b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca9b('0x6'));var sox=require('sox');var csv=require(_0xca9b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca9b('0x8'));var _=require(_0xca9b('0x9'));var squel=require('squel');var crypto=require(_0xca9b('0xa'));var jsforce=require(_0xca9b('0xb'));var deskjs=require(_0xca9b('0xc'));var toCsv=require(_0xca9b('0x7'));var querystring=require(_0xca9b('0xd'));var Papa=require(_0xca9b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca9b('0xf'));var as=require(_0xca9b('0x10'));var hardwareService=require(_0xca9b('0x11'));var logger=require(_0xca9b('0x12'))(_0xca9b('0x13'));var utils=require(_0xca9b('0x14'));var config=require(_0xca9b('0x15'));var licenseUtil=require(_0xca9b('0x16'));var db=require(_0xca9b('0x17'))['db'];function respondWithStatusCode(_0x301a3c,_0x544b3c){_0x544b3c=_0x544b3c||0xcc;return function(_0x226a94){if(_0x226a94){return _0x301a3c[_0xca9b('0x18')](_0x544b3c);}return _0x301a3c[_0xca9b('0x19')](_0x544b3c)[_0xca9b('0x1a')]();};}function respondWithResult(_0x3880c4,_0x253a7f){_0x253a7f=_0x253a7f||0xc8;return function(_0x4d8f87){if(_0x4d8f87){return _0x3880c4[_0xca9b('0x19')](_0x253a7f)['json'](_0x4d8f87);}};}function respondWithFilteredResult(_0x4abea1,_0x46da66){return function(_0x26f0f0){if(_0x26f0f0){var _0x339949=typeof _0x46da66[_0xca9b('0x1b')]===_0xca9b('0x1c')&&typeof _0x46da66['limit']==='undefined';var _0x411304=_0x26f0f0[_0xca9b('0x1d')];var _0x3688f9=_0x339949?0x0:_0x46da66[_0xca9b('0x1b')];var _0x4a37bb=_0x339949?_0x26f0f0['count']:_0x46da66[_0xca9b('0x1b')]+_0x46da66[_0xca9b('0x1e')];var _0x199e18;if(_0x4a37bb>=_0x411304){_0x4a37bb=_0x411304;_0x199e18=0xc8;}else{_0x199e18=0xce;}_0x4abea1[_0xca9b('0x19')](_0x199e18);return _0x4abea1[_0xca9b('0x1f')](_0xca9b('0x20'),_0x3688f9+'-'+_0x4a37bb+'/'+_0x411304)[_0xca9b('0x21')](_0x26f0f0);}return null;};}function patchUpdates(_0xce1f25){return function(_0x306f29){try{jsonpatch[_0xca9b('0x22')](_0x306f29,_0xce1f25,!![]);}catch(_0x8338c){return BPromise[_0xca9b('0x23')](_0x8338c);}return _0x306f29[_0xca9b('0x24')]();};}function saveUpdates(_0x507ca1,_0x2550cb){return function(_0xfd2e93){if(_0xfd2e93){return _0xfd2e93[_0xca9b('0x25')](_0x507ca1)['then'](function(_0x1e2557){return _0x1e2557;});}return null;};}function removeEntity(_0x525c5b,_0x1ec8b3){return function(_0x218750){if(_0x218750){return _0x218750[_0xca9b('0x26')]()['then'](function(){_0x525c5b[_0xca9b('0x19')](0xcc)[_0xca9b('0x1a')]();});}};}function handleEntityNotFound(_0x2822cc,_0x3083e0){return function(_0x5da435){if(!_0x5da435){_0x2822cc[_0xca9b('0x18')](0x194);}return _0x5da435;};}function handleError(_0x5b498f,_0x2cdceb){_0x2cdceb=_0x2cdceb||0x1f4;return function(_0x212d7c){logger[_0xca9b('0x27')](_0x212d7c[_0xca9b('0x28')]);if(_0x212d7c[_0xca9b('0x29')]){delete _0x212d7c['name'];}_0x5b498f[_0xca9b('0x19')](_0x2cdceb)[_0xca9b('0x2a')](_0x212d7c);};}exports[_0xca9b('0x2b')]=function(_0x4785a5,_0x51473f){var _0x15d22b={},_0x2b82b1={},_0x313e83={'count':0x0,'rows':[]};var _0x18004a=_[_0xca9b('0x2c')](db[_0xca9b('0x2d')]['rawAttributes'],function(_0x14c89b){return{'name':_0x14c89b[_0xca9b('0x2e')],'type':_0x14c89b[_0xca9b('0x2f')][_0xca9b('0x30')]};});_0x2b82b1[_0xca9b('0x31')]=_[_0xca9b('0x2c')](_0x18004a,_0xca9b('0x29'));_0x2b82b1[_0xca9b('0x32')]=_[_0xca9b('0x33')](_0x4785a5[_0xca9b('0x32')]);_0x2b82b1['filters']=_[_0xca9b('0x34')](_0x2b82b1[_0xca9b('0x31')],_0x2b82b1['query']);_0x15d22b[_0xca9b('0x35')]=_[_0xca9b('0x34')](_0x2b82b1[_0xca9b('0x31')],qs[_0xca9b('0x36')](_0x4785a5[_0xca9b('0x32')][_0xca9b('0x36')]));_0x15d22b[_0xca9b('0x35')]=_0x15d22b['attributes'][_0xca9b('0x37')]?_0x15d22b[_0xca9b('0x35')]:_0x2b82b1[_0xca9b('0x31')];if(!_0x4785a5['query'][_0xca9b('0x38')]('nolimit')){_0x15d22b[_0xca9b('0x1e')]=qs[_0xca9b('0x1e')](_0x4785a5[_0xca9b('0x32')]['limit']);_0x15d22b[_0xca9b('0x1b')]=qs[_0xca9b('0x1b')](_0x4785a5[_0xca9b('0x32')][_0xca9b('0x1b')]);}_0x15d22b[_0xca9b('0x39')]=qs['sort'](_0x4785a5[_0xca9b('0x32')]['sort']);_0x15d22b[_0xca9b('0x3a')]=qs[_0xca9b('0x3b')](_[_0xca9b('0x3c')](_0x4785a5[_0xca9b('0x32')],_0x2b82b1[_0xca9b('0x3b')]),_0x18004a);if(_0x4785a5[_0xca9b('0x32')]['filter']){_0x15d22b[_0xca9b('0x3a')]=_[_0xca9b('0x3d')](_0x15d22b[_0xca9b('0x3a')],{'$or':_[_0xca9b('0x2c')](_0x18004a,function(_0x32d34c){if(_0x32d34c[_0xca9b('0x2f')]!==_0xca9b('0x3e')){var _0x2abbc2={};_0x2abbc2[_0x32d34c[_0xca9b('0x29')]]={'$like':'%'+_0x4785a5[_0xca9b('0x32')][_0xca9b('0x3f')]+'%'};return _0x2abbc2;}})});}_0x15d22b=_[_0xca9b('0x3d')]({},_0x15d22b,_0x4785a5[_0xca9b('0x40')]);var _0x21cee3={'where':_0x15d22b[_0xca9b('0x3a')]};return db[_0xca9b('0x2d')][_0xca9b('0x1d')](_0x21cee3)[_0xca9b('0x41')](function(_0x24626a){_0x313e83[_0xca9b('0x1d')]=_0x24626a;if(_0x4785a5[_0xca9b('0x32')][_0xca9b('0x42')]){_0x15d22b[_0xca9b('0x43')]=[{'all':!![]}];}return db[_0xca9b('0x2d')][_0xca9b('0x44')](_0x15d22b);})[_0xca9b('0x41')](function(_0x389a){_0x313e83[_0xca9b('0x45')]=_0x389a;return _0x313e83;})[_0xca9b('0x41')](respondWithFilteredResult(_0x51473f,_0x15d22b))['catch'](handleError(_0x51473f,null));};exports[_0xca9b('0x46')]=function(_0x1b491e,_0x5347ce){var _0x24fa3b={'raw':!![],'where':{'id':_0x1b491e[_0xca9b('0x47')]['id']}},_0x478598={};_0x478598[_0xca9b('0x31')]=_[_0xca9b('0x33')](db[_0xca9b('0x2d')][_0xca9b('0x48')]);_0x478598[_0xca9b('0x32')]=_['keys'](_0x1b491e[_0xca9b('0x32')]);_0x478598[_0xca9b('0x3b')]=_[_0xca9b('0x34')](_0x478598[_0xca9b('0x31')],_0x478598[_0xca9b('0x32')]);_0x24fa3b['attributes']=_[_0xca9b('0x34')](_0x478598[_0xca9b('0x31')],qs[_0xca9b('0x36')](_0x1b491e[_0xca9b('0x32')][_0xca9b('0x36')]));_0x24fa3b['attributes']=_0x24fa3b[_0xca9b('0x35')]['length']?_0x24fa3b[_0xca9b('0x35')]:_0x478598['model'];if(_0x1b491e[_0xca9b('0x32')][_0xca9b('0x42')]){_0x24fa3b[_0xca9b('0x43')]=[{'all':!![]}];}_0x24fa3b=_[_0xca9b('0x3d')]({},_0x24fa3b,_0x1b491e[_0xca9b('0x40')]);return db[_0xca9b('0x2d')][_0xca9b('0x49')](_0x24fa3b)['then'](handleEntityNotFound(_0x5347ce,null))[_0xca9b('0x41')](respondWithResult(_0x5347ce,null))[_0xca9b('0x4a')](handleError(_0x5347ce,null));};exports[_0xca9b('0x4b')]=function(_0x15ffee,_0x59d769){return db[_0xca9b('0x2d')]['create'](_0x15ffee[_0xca9b('0x4c')],{})[_0xca9b('0x41')](respondWithResult(_0x59d769,0xc9))[_0xca9b('0x4a')](handleError(_0x59d769,null));};exports['update']=function(_0x2b258f,_0x563f23){if(_0x2b258f['body']['id']){delete _0x2b258f[_0xca9b('0x4c')]['id'];}return db[_0xca9b('0x2d')][_0xca9b('0x49')]({'where':{'id':_0x2b258f['params']['id']}})['then'](handleEntityNotFound(_0x563f23,null))[_0xca9b('0x41')](saveUpdates(_0x2b258f[_0xca9b('0x4c')],null))[_0xca9b('0x41')](respondWithResult(_0x563f23,null))[_0xca9b('0x4a')](handleError(_0x563f23,null));};exports[_0xca9b('0x26')]=function(_0x31fb80,_0x47232f){return db[_0xca9b('0x2d')][_0xca9b('0x49')]({'where':{'id':_0x31fb80[_0xca9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x47232f,null))[_0xca9b('0x41')](removeEntity(_0x47232f,null))[_0xca9b('0x4a')](handleError(_0x47232f,null));};exports['describe']=function(_0x189ac2,_0xfeaf64){return db[_0xca9b('0x2d')][_0xca9b('0x4d')]()[_0xca9b('0x41')](respondWithResult(_0xfeaf64,null))[_0xca9b('0x4a')](handleError(_0xfeaf64,null));};
\ No newline at end of file
index af5a143..ec2c3db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d17=['api','moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x21311e,_0x2e3ca0){var _0x57eae3=function(_0x1e6b5b){while(--_0x1e6b5b){_0x21311e['push'](_0x21311e['shift']());}};_0x57eae3(++_0x2e3ca0);}(_0x3d17,0x1cb));var _0x73d1=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x3d17[_0x243217];return _0x478029;};'use strict';var _=require(_0x73d1('0x0'));var util=require(_0x73d1('0x1'));var logger=require(_0x73d1('0x2'))(_0x73d1('0x3'));var moment=require(_0x73d1('0x4'));var BPromise=require(_0x73d1('0x5'));var rp=require(_0x73d1('0x6'));var fs=require('fs');var path=require(_0x73d1('0x7'));var rimraf=require('rimraf');var config=require(_0x73d1('0x8'));var attributes=require(_0x73d1('0x9'));module[_0x73d1('0xa')]=function(_0x2e9308,_0x765488){return _0x2e9308['define'](_0x73d1('0xb'),attributes,{'tableName':_0x73d1('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x73d1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x80d0=['request-promise','path','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d64fc,_0x42b2a7){var _0x2c8556=function(_0x4b29da){while(--_0x4b29da){_0x2d64fc['push'](_0x2d64fc['shift']());}};_0x2c8556(++_0x42b2a7);}(_0x80d0,0x1b5));var _0x080d=function(_0x1bc873,_0x5e9d4b){_0x1bc873=_0x1bc873-0x0;var _0x1d13de=_0x80d0[_0x1bc873];return _0x1d13de;};'use strict';var _=require(_0x080d('0x0'));var util=require('util');var logger=require(_0x080d('0x1'))(_0x080d('0x2'));var moment=require(_0x080d('0x3'));var BPromise=require(_0x080d('0x4'));var rp=require(_0x080d('0x5'));var fs=require('fs');var path=require(_0x080d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x080d('0x7'));module[_0x080d('0x8')]=function(_0x5884f8,_0x56fa1f){return _0x5884f8[_0x080d('0x9')](_0x080d('0xa'),attributes,{'tableName':_0x080d('0xb'),'paranoid':![],'indexes':[{'name':_0x080d('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 06874a0..f12f100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b3=['request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x27fbcc,_0x444194){var _0x75d195=function(_0x341fb8){while(--_0x341fb8){_0x27fbcc['push'](_0x27fbcc['shift']());}};_0x75d195(++_0x444194);}(_0x00b3,0x97));var _0x300b=function(_0x1bd3ad,_0x4dd641){_0x1bd3ad=_0x1bd3ad-0x0;var _0x3213f8=_0x00b3[_0x1bd3ad];return _0x3213f8;};'use strict';var _=require(_0x300b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x300b('0x1'));var rs=require(_0x300b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x300b('0x3'));var logger=require(_0x300b('0x4'))(_0x300b('0x5'));var config=require('../../config/environment');var jayson=require(_0x300b('0x6'));var client=jayson[_0x300b('0x7')][_0x300b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4294fe,_0x643a7b,_0x2cf1c5){return new BPromise(function(_0x103922,_0xcd2a68){return client[_0x300b('0x9')](_0x4294fe,_0x2cf1c5)[_0x300b('0xa')](function(_0x1b9048){logger[_0x300b('0xb')](_0x300b('0xc'),_0x643a7b,'request\x20sent');logger[_0x300b('0xd')](_0x300b('0xe'),_0x643a7b,_0x300b('0xf'),JSON['stringify'](_0x1b9048));if(_0x1b9048[_0x300b('0x10')]){if(_0x1b9048[_0x300b('0x10')]['code']===0x1f4){logger['error'](_0x300b('0xc'),_0x643a7b,_0x1b9048['error'][_0x300b('0x11')]);return _0xcd2a68(_0x1b9048[_0x300b('0x10')][_0x300b('0x11')]);}logger[_0x300b('0x10')](_0x300b('0xc'),_0x643a7b,_0x1b9048[_0x300b('0x10')]['message']);return _0x103922(_0x1b9048['error'][_0x300b('0x11')]);}else{logger[_0x300b('0xb')](_0x300b('0xc'),_0x643a7b,_0x300b('0xf'));_0x103922(_0x1b9048[_0x300b('0x12')][_0x300b('0x11')]);}})[_0x300b('0x13')](function(_0x3e1dbd){logger['error'](_0x300b('0xc'),_0x643a7b,_0x3e1dbd);_0xcd2a68(_0x3e1dbd);});});}
\ No newline at end of file
+var _0xd67b=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0xbfc77c,_0x28db03){var _0x24f386=function(_0xb8d53c){while(--_0xb8d53c){_0xbfc77c['push'](_0xbfc77c['shift']());}};_0x24f386(++_0x28db03);}(_0xd67b,0x133));var _0xbd67=function(_0x475a03,_0x1c80f7){_0x475a03=_0x475a03-0x0;var _0x20b367=_0xd67b[_0x475a03];return _0x20b367;};'use strict';var _=require('lodash');var util=require(_0xbd67('0x0'));var moment=require('moment');var BPromise=require(_0xbd67('0x1'));var rs=require(_0xbd67('0x2'));var fs=require('fs');var Redis=require(_0xbd67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd67('0x4'));var logger=require('../../config/logger')(_0xbd67('0x5'));var config=require('../../config/environment');var jayson=require(_0xbd67('0x6'));var client=jayson[_0xbd67('0x7')][_0xbd67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27b016,_0x1860c9,_0x72f9ac){return new BPromise(function(_0x2d4af6,_0xfad775){return client[_0xbd67('0x9')](_0x27b016,_0x72f9ac)[_0xbd67('0xa')](function(_0x177f41){logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,'request\x20sent');logger['debug'](_0xbd67('0xd'),_0x1860c9,'request\x20sent',JSON[_0xbd67('0xe')](_0x177f41));if(_0x177f41[_0xbd67('0xf')]){if(_0x177f41[_0xbd67('0xf')][_0xbd67('0x10')]===0x1f4){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0xfad775(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}logger['error'](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0x2d4af6(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}else{logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,_0xbd67('0x12'));_0x2d4af6(_0x177f41[_0xbd67('0x13')][_0xbd67('0x11')]);}})['catch'](function(_0x4ab3a6){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x4ab3a6);_0xfad775(_0x4ab3a6);});});}
\ No newline at end of file
index b166b04..257d108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0897=['isAuthenticated','index','/:id','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','file','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x3ebbb1,_0x12a95b){var _0x487747=function(_0x5ad458){while(--_0x5ad458){_0x3ebbb1['push'](_0x3ebbb1['shift']());}};_0x487747(++_0x12a95b);}(_0x0897,0x1a2));var _0x7089=function(_0x1920a1,_0x1d15bf){_0x1920a1=_0x1920a1-0x0;var _0x1dec82=_0x0897[_0x1920a1];return _0x1dec82;};'use strict';var multer=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var path=require('path');var timeout=require(_0x7089('0x2'));var express=require(_0x7089('0x3'));var router=express[_0x7089('0x4')]();var fs_extra=require(_0x7089('0x5'));var auth=require(_0x7089('0x6'));var interaction=require(_0x7089('0x7'));var config=require(_0x7089('0x8'));var controller=require(_0x7089('0x9'));router[_0x7089('0xa')]('/',auth[_0x7089('0xb')](),controller[_0x7089('0xc')]);router[_0x7089('0xa')](_0x7089('0xd'),auth[_0x7089('0xb')](),controller[_0x7089('0xe')]);router[_0x7089('0xa')](_0x7089('0xf'),auth['isAuthenticated'](),controller[_0x7089('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6979d4,_0x1dd9f2,_0x88f31){_0x88f31(null,path[_0x7089('0x11')](config[_0x7089('0x12')],_0x7089('0x13')));},'filename':function(_0x2a58bf,_0x4d1906,_0x6a1339){_0x4d1906['originalname']=_0x4d1906[_0x7089('0x14')][_0x7089('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6a1339(null,util['format'](_0x7089('0x16'),path[_0x7089('0x17')](_0x4d1906[_0x7089('0x14')],path[_0x7089('0x18')](_0x4d1906[_0x7089('0x14')])),Date[_0x7089('0x19')](),path[_0x7089('0x18')](_0x4d1906[_0x7089('0x14')])));}})});router[_0x7089('0x1a')]('/',upload['single'](_0x7089('0x1b')),controller[_0x7089('0x1c')]);router[_0x7089('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x7089('0x1e')]);router[_0x7089('0x1f')](_0x7089('0xd'),auth[_0x7089('0xb')](),controller['delete']);module[_0x7089('0x20')]=router;
\ No newline at end of file
+var _0xa642=['extname','now','single','file','create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','replace','format','basename','originalname'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xa642,0xd9));var _0x2a64=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0xa642[_0xfcdda0];return _0x17ebe3;};'use strict';var multer=require(_0x2a64('0x0'));var util=require(_0x2a64('0x1'));var path=require(_0x2a64('0x2'));var timeout=require(_0x2a64('0x3'));var express=require(_0x2a64('0x4'));var router=express[_0x2a64('0x5')]();var fs_extra=require(_0x2a64('0x6'));var auth=require(_0x2a64('0x7'));var interaction=require(_0x2a64('0x8'));var config=require(_0x2a64('0x9'));var controller=require(_0x2a64('0xa'));router[_0x2a64('0xb')]('/',auth[_0x2a64('0xc')](),controller[_0x2a64('0xd')]);router['get'](_0x2a64('0xe'),auth[_0x2a64('0xc')](),controller['show']);router['get'](_0x2a64('0xf'),auth['isAuthenticated'](),controller[_0x2a64('0x10')]);var upload=multer({'storage':multer[_0x2a64('0x11')]({'destination':function(_0x4f97e2,_0x14fac8,_0x5859f2){_0x5859f2(null,path[_0x2a64('0x12')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x17cd27,_0x53637e,_0x25ddfd){_0x53637e['originalname']=_0x53637e['originalname'][_0x2a64('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25ddfd(null,util[_0x2a64('0x14')]('%s-%s%s',path[_0x2a64('0x15')](_0x53637e[_0x2a64('0x16')],path[_0x2a64('0x17')](_0x53637e[_0x2a64('0x16')])),Date[_0x2a64('0x18')](),path[_0x2a64('0x17')](_0x53637e[_0x2a64('0x16')])));}})});router['post']('/',upload[_0x2a64('0x19')](_0x2a64('0x1a')),controller[_0x2a64('0x1b')]);router['put'](_0x2a64('0xe'),auth[_0x2a64('0xc')](),controller[_0x2a64('0x1c')]);router[_0x2a64('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x2a64('0x1d')]);module['exports']=router;
\ No newline at end of file
index 6fceb3c..e1d7c31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5db=['INTEGER','FLOAT','sequelize','STRING','BIGINT'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xc5db,0x18d));var _0xbc5d=function(_0x4be718,_0x199f19){_0x4be718=_0x4be718-0x0;var _0x2ca6f4=_0xc5db[_0x4be718];return _0x2ca6f4;};'use strict';var Sequelize=require(_0xbc5d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xbc5d('0x1')]},'display_name':{'type':Sequelize[_0xbc5d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xbc5d('0x1')]},'original_format':{'type':Sequelize[_0xbc5d('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xbc5d('0x2')]},'original_channelCount':{'type':Sequelize[_0xbc5d('0x3')]},'original_bitRate':{'type':Sequelize[_0xbc5d('0x2')]},'original_sampleRate':{'type':Sequelize[_0xbc5d('0x3')]},'converted_format':{'type':Sequelize[_0xbc5d('0x1')]},'converted_duration':{'type':Sequelize[_0xbc5d('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xbc5d('0x2')]},'converted_channelCount':{'type':Sequelize[_0xbc5d('0x3')]},'converted_bitRate':{'type':Sequelize[_0xbc5d('0x2')]},'converted_sampleRate':{'type':Sequelize[_0xbc5d('0x3')]}};
\ No newline at end of file
+var _0x4278=['INTEGER','BIGINT','exports','STRING','name'];(function(_0x6d9ad7,_0x2e8ff3){var _0x8b9b51=function(_0x5edf41){while(--_0x5edf41){_0x6d9ad7['push'](_0x6d9ad7['shift']());}};_0x8b9b51(++_0x2e8ff3);}(_0x4278,0x18d));var _0x8427=function(_0x40f308,_0x4bf2b6){_0x40f308=_0x40f308-0x0;var _0x25e8b0=_0x4278[_0x40f308];return _0x25e8b0;};'use strict';var Sequelize=require('sequelize');module[_0x8427('0x0')]={'name':{'type':Sequelize[_0x8427('0x1')],'unique':_0x8427('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8427('0x1')]},'display_name':{'type':Sequelize[_0x8427('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x8427('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8427('0x3')]},'original_bitRate':{'type':Sequelize[_0x8427('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8427('0x3')]},'converted_format':{'type':Sequelize[_0x8427('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x8427('0x4')]},'converted_channelCount':{'type':Sequelize[_0x8427('0x3')]},'converted_bitRate':{'type':Sequelize[_0x8427('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index bbf1ea9..419c5f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ebd=['basename','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','autoAssociation','start','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','Sound','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','%s.%s','format','originalname','extname','file','filename','substring','wav'];(function(_0x9f12a7,_0x5cccb6){var _0x2ed407=function(_0x5a8b65){while(--_0x5a8b65){_0x9f12a7['push'](_0x9f12a7['shift']());}};_0x2ed407(++_0x5cccb6);}(_0x6ebd,0x177));var _0xd6eb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ebd[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xd6eb('0x0'));var rimraf=require(_0xd6eb('0x1'));var zipdir=require(_0xd6eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd6eb('0x3'));var Mustache=require(_0xd6eb('0x4'));var util=require(_0xd6eb('0x5'));var path=require(_0xd6eb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6eb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6eb('0x8'));var squel=require(_0xd6eb('0x9'));var crypto=require('crypto');var jsforce=require(_0xd6eb('0xa'));var deskjs=require(_0xd6eb('0xb'));var toCsv=require(_0xd6eb('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd6eb('0xd'));var qs=require(_0xd6eb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6eb('0xf'));var logger=require(_0xd6eb('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xd6eb('0x11'));var licenseUtil=require(_0xd6eb('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x254526,_0x11d6ff){_0x11d6ff=_0x11d6ff||0xcc;return function(_0xc7c728){if(_0xc7c728){return _0x254526[_0xd6eb('0x13')](_0x11d6ff);}return _0x254526[_0xd6eb('0x14')](_0x11d6ff)[_0xd6eb('0x15')]();};}function respondWithResult(_0x14910a,_0x35e36b){_0x35e36b=_0x35e36b||0xc8;return function(_0x11fb7b){if(_0x11fb7b){return _0x14910a['status'](_0x35e36b)[_0xd6eb('0x16')](_0x11fb7b);}};}function respondWithFilteredResult(_0x408d66,_0x25e6f3){return function(_0x4f8711){if(_0x4f8711){var _0x56bcd9=typeof _0x25e6f3['offset']==='undefined'&&typeof _0x25e6f3[_0xd6eb('0x17')]===_0xd6eb('0x18');var _0x597510=_0x4f8711[_0xd6eb('0x19')];var _0x5d7008=_0x56bcd9?0x0:_0x25e6f3[_0xd6eb('0x1a')];var _0x468657=_0x56bcd9?_0x4f8711[_0xd6eb('0x19')]:_0x25e6f3[_0xd6eb('0x1a')]+_0x25e6f3[_0xd6eb('0x17')];var _0x4d9022;if(_0x468657>=_0x597510){_0x468657=_0x597510;_0x4d9022=0xc8;}else{_0x4d9022=0xce;}_0x408d66[_0xd6eb('0x14')](_0x4d9022);return _0x408d66[_0xd6eb('0x1b')]('Content-Range',_0x5d7008+'-'+_0x468657+'/'+_0x597510)[_0xd6eb('0x16')](_0x4f8711);}return null;};}function patchUpdates(_0xb2abae){return function(_0x118325){try{jsonpatch[_0xd6eb('0x1c')](_0x118325,_0xb2abae,!![]);}catch(_0x3e0be8){return BPromise[_0xd6eb('0x1d')](_0x3e0be8);}return _0x118325[_0xd6eb('0x1e')]();};}function saveUpdates(_0x1c89c0,_0x9b6fa6){return function(_0x1219ca){if(_0x1219ca){return _0x1219ca[_0xd6eb('0x1f')](_0x1c89c0)[_0xd6eb('0x20')](function(_0xca2fdb){return _0xca2fdb;});}return null;};}function removeEntity(_0x4d56e7,_0x38ea4b){return function(_0x25ddef){if(_0x25ddef){return _0x25ddef['destroy']()[_0xd6eb('0x20')](function(){var _0x1a0340=_0x25ddef['get']({'plain':!![]});var _0x828779='Sounds';return db['UserProfileResource'][_0xd6eb('0x21')]({'where':{'type':_0x828779,'resourceId':_0x1a0340['id']}})[_0xd6eb('0x20')](function(){return _0x25ddef;});})['then'](function(){_0x4d56e7[_0xd6eb('0x14')](0xcc)[_0xd6eb('0x15')]();});}};}function handleEntityNotFound(_0x3e9c30,_0x38ae86){return function(_0x41a87e){if(!_0x41a87e){_0x3e9c30['sendStatus'](0x194);}return _0x41a87e;};}function handleError(_0x17fd71,_0x18ac9e){_0x18ac9e=_0x18ac9e||0x1f4;return function(_0x3e30cc){logger[_0xd6eb('0x22')](_0x3e30cc[_0xd6eb('0x23')]);if(_0x3e30cc[_0xd6eb('0x24')]){delete _0x3e30cc[_0xd6eb('0x24')];}_0x17fd71[_0xd6eb('0x14')](_0x18ac9e)['send'](_0x3e30cc);};}exports[_0xd6eb('0x25')]=function(_0x16a7a2,_0x5da4e1){var _0x10f046={},_0xf91a72={},_0x16adde={'count':0x0,'rows':[]};var _0x2ccba2=_['map'](db[_0xd6eb('0x26')]['rawAttributes'],function(_0x52452d){return{'name':_0x52452d['fieldName'],'type':_0x52452d['type']['key']};});_0xf91a72[_0xd6eb('0x27')]=_['map'](_0x2ccba2,_0xd6eb('0x24'));_0xf91a72[_0xd6eb('0x28')]=_[_0xd6eb('0x29')](_0x16a7a2[_0xd6eb('0x28')]);_0xf91a72[_0xd6eb('0x2a')]=_[_0xd6eb('0x2b')](_0xf91a72[_0xd6eb('0x27')],_0xf91a72[_0xd6eb('0x28')]);_0x10f046[_0xd6eb('0x2c')]=_[_0xd6eb('0x2b')](_0xf91a72[_0xd6eb('0x27')],qs[_0xd6eb('0x2d')](_0x16a7a2[_0xd6eb('0x28')][_0xd6eb('0x2d')]));_0x10f046[_0xd6eb('0x2c')]=_0x10f046[_0xd6eb('0x2c')][_0xd6eb('0x2e')]?_0x10f046[_0xd6eb('0x2c')]:_0xf91a72[_0xd6eb('0x27')];if(!_0x16a7a2[_0xd6eb('0x28')]['hasOwnProperty'](_0xd6eb('0x2f'))){_0x10f046[_0xd6eb('0x17')]=qs[_0xd6eb('0x17')](_0x16a7a2[_0xd6eb('0x28')][_0xd6eb('0x17')]);_0x10f046[_0xd6eb('0x1a')]=qs[_0xd6eb('0x1a')](_0x16a7a2[_0xd6eb('0x28')]['offset']);}_0x10f046['order']=qs[_0xd6eb('0x30')](_0x16a7a2[_0xd6eb('0x28')]['sort']);_0x10f046[_0xd6eb('0x31')]=qs[_0xd6eb('0x2a')](_['pick'](_0x16a7a2[_0xd6eb('0x28')],_0xf91a72[_0xd6eb('0x2a')]),_0x2ccba2);if(_0x16a7a2[_0xd6eb('0x28')][_0xd6eb('0x32')]){_0x10f046['where']=_[_0xd6eb('0x33')](_0x10f046['where'],{'$or':_[_0xd6eb('0x34')](_0x2ccba2,function(_0x467b55){if(_0x467b55[_0xd6eb('0x35')]!==_0xd6eb('0x36')){var _0x177499={};_0x177499[_0x467b55[_0xd6eb('0x24')]]={'$like':'%'+_0x16a7a2['query'][_0xd6eb('0x32')]+'%'};return _0x177499;}})});}_0x10f046=_['merge']({},_0x10f046,_0x16a7a2[_0xd6eb('0x37')]);var _0x4036cc={'where':_0x10f046[_0xd6eb('0x31')]};return db[_0xd6eb('0x26')][_0xd6eb('0x19')](_0x4036cc)[_0xd6eb('0x20')](function(_0x43987b){_0x16adde[_0xd6eb('0x19')]=_0x43987b;if(_0x16a7a2[_0xd6eb('0x28')][_0xd6eb('0x38')]){_0x10f046[_0xd6eb('0x39')]=[{'all':!![]}];}return db[_0xd6eb('0x26')][_0xd6eb('0x3a')](_0x10f046);})[_0xd6eb('0x20')](function(_0x257f83){_0x16adde[_0xd6eb('0x3b')]=_0x257f83;return _0x16adde;})[_0xd6eb('0x20')](respondWithFilteredResult(_0x5da4e1,_0x10f046))[_0xd6eb('0x3c')](handleError(_0x5da4e1,null));};exports[_0xd6eb('0x3d')]=function(_0x11cfea,_0x18e6ca){var _0x58c7c7={'raw':!![],'where':{'id':_0x11cfea[_0xd6eb('0x3e')]['id']}},_0xadf500={};_0xadf500[_0xd6eb('0x27')]=_['keys'](db['Sound']['rawAttributes']);_0xadf500[_0xd6eb('0x28')]=_[_0xd6eb('0x29')](_0x11cfea['query']);_0xadf500[_0xd6eb('0x2a')]=_[_0xd6eb('0x2b')](_0xadf500['model'],_0xadf500[_0xd6eb('0x28')]);_0x58c7c7[_0xd6eb('0x2c')]=_[_0xd6eb('0x2b')](_0xadf500[_0xd6eb('0x27')],qs[_0xd6eb('0x2d')](_0x11cfea[_0xd6eb('0x28')]['fields']));_0x58c7c7[_0xd6eb('0x2c')]=_0x58c7c7[_0xd6eb('0x2c')][_0xd6eb('0x2e')]?_0x58c7c7[_0xd6eb('0x2c')]:_0xadf500['model'];if(_0x11cfea[_0xd6eb('0x28')][_0xd6eb('0x38')]){_0x58c7c7['include']=[{'all':!![]}];}_0x58c7c7=_[_0xd6eb('0x33')]({},_0x58c7c7,_0x11cfea['options']);return db['Sound'][_0xd6eb('0x3f')](_0x58c7c7)['then'](handleEntityNotFound(_0x18e6ca,null))[_0xd6eb('0x20')](respondWithResult(_0x18e6ca,null))[_0xd6eb('0x3c')](handleError(_0x18e6ca,null));};exports[_0xd6eb('0x40')]=function(_0x938167,_0x5aa2ba,_0x348ec2){return db[_0xd6eb('0x26')]['find']({'where':{'id':_0x938167['params']['id']},'attributes':[_0xd6eb('0x24'),_0xd6eb('0x41'),_0xd6eb('0x42')],'raw':!![]})['then'](handleEntityNotFound(_0x5aa2ba,null))[_0xd6eb('0x20')](function(_0x4495a4){if(_0x4495a4){if(!fs[_0xd6eb('0x43')](path[_0xd6eb('0x44')](config[_0xd6eb('0x45')],_0xd6eb('0x46'),_0x4495a4[_0xd6eb('0x41')]+'.'+_0x4495a4['converted_format']))){throw new db[(_0xd6eb('0x47'))]['ValidationError'](_0xd6eb('0x48'));}return _0x5aa2ba[_0xd6eb('0x40')](path[_0xd6eb('0x44')](config[_0xd6eb('0x45')],_0xd6eb('0x46'),util['format'](_0xd6eb('0x49'),_0x4495a4[_0xd6eb('0x41')],_0x4495a4[_0xd6eb('0x42')])),util[_0xd6eb('0x4a')](_0xd6eb('0x49'),_0x4495a4[_0xd6eb('0x24')],_0x4495a4['converted_format']));}return null;})['catch'](handleError(_0x5aa2ba,null));};exports['create']=function(_0x55dfd6,_0x4fa25f,_0x21fde7){var _0x1769be={'name':path['basename'](_0x55dfd6['file'][_0xd6eb('0x4b')],path[_0xd6eb('0x4c')](_0x55dfd6[_0xd6eb('0x4d')]['originalname'])),'save_name':path['basename'](_0x55dfd6['file']['filename'],path['extname'](_0x55dfd6[_0xd6eb('0x4d')][_0xd6eb('0x4e')])),'original_format':path[_0xd6eb('0x4c')](_0x55dfd6[_0xd6eb('0x4d')][_0xd6eb('0x4b')])[_0xd6eb('0x4f')](0x1),'converted_format':_0xd6eb('0x50')};var _0x54868e=path[_0xd6eb('0x44')](config['root'],'server/files/sounds/original',_0x55dfd6[_0xd6eb('0x4d')][_0xd6eb('0x4e')]);var _0x1093ba=path['join'](config[_0xd6eb('0x45')],_0xd6eb('0x46'),util[_0xd6eb('0x4a')](_0xd6eb('0x49'),path[_0xd6eb('0x51')](_0x55dfd6[_0xd6eb('0x4d')][_0xd6eb('0x4e')],path[_0xd6eb('0x4c')](_0x55dfd6[_0xd6eb('0x4d')][_0xd6eb('0x4e')])),_0x1769be[_0xd6eb('0x42')]));logger[_0xd6eb('0x52')](_0xd6eb('0x53'),_0x54868e);logger[_0xd6eb('0x52')]('Sound\x20upload\x20destination:\x20%s',_0x1093ba);try{fs[_0xd6eb('0x54')](_0x54868e,parseInt('0777',0x8));var _0x4df202=sox[_0xd6eb('0x55')](_0x54868e,_0x1093ba,{'sampleRate':0x1f40,'format':_0xd6eb('0x50'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4df202['on'](_0xd6eb('0x22'),function(_0x3acae5){fs[_0xd6eb('0x56')](_0x54868e);_0x4fa25f[_0xd6eb('0x14')](0x1f4)['send'](_0x3acae5);});_0x4df202['on'](_0xd6eb('0x57'),function(_0x4779d3){_0x1769be[_0xd6eb('0x58')]=isNaN(_0x4779d3['duration'])?null:_0x4779d3[_0xd6eb('0x59')]*0x3e8;_0x1769be[_0xd6eb('0x5a')]=isNaN(_0x4779d3[_0xd6eb('0x5b')])?null:_0x4779d3[_0xd6eb('0x5b')];_0x1769be[_0xd6eb('0x5c')]=isNaN(_0x4779d3[_0xd6eb('0x5d')])?null:_0x4779d3['channelCount'];_0x1769be[_0xd6eb('0x5e')]=isNaN(_0x4779d3[_0xd6eb('0x5f')])?null:_0x4779d3['bitRate'];_0x1769be[_0xd6eb('0x60')]=isNaN(_0x4779d3[_0xd6eb('0x61')])?null:_0x4779d3[_0xd6eb('0x61')];});_0x4df202['on']('dest',function(_0x51e5d2){_0x1769be[_0xd6eb('0x62')]=isNaN(_0x51e5d2[_0xd6eb('0x59')])?null:_0x51e5d2[_0xd6eb('0x59')]*0x3e8;_0x1769be[_0xd6eb('0x63')]=isNaN(_0x51e5d2['sampleCount'])?null:_0x51e5d2[_0xd6eb('0x5b')];_0x1769be[_0xd6eb('0x64')]=isNaN(_0x51e5d2[_0xd6eb('0x5d')])?null:_0x51e5d2['channelCount'];_0x1769be['converted_bitRate']=isNaN(_0x51e5d2[_0xd6eb('0x5f')])?null:_0x51e5d2['bitRate'];_0x1769be[_0xd6eb('0x65')]=isNaN(_0x51e5d2[_0xd6eb('0x61')])?null:_0x51e5d2[_0xd6eb('0x61')];});_0x4df202['on']('end',function(){fs[_0xd6eb('0x54')](_0x1093ba,parseInt('0777',0x8));return db[_0xd6eb('0x26')][_0xd6eb('0x66')](_0x1769be)['then'](function(_0x285d59){var _0x5950d3={'role':_0x55dfd6[_0xd6eb('0x67')][_0xd6eb('0x68')],'userProfileId':_0x55dfd6['body'][_0xd6eb('0x69')]};if(!_0x5950d3)throw new Error(_0xd6eb('0x6a'));if(_0x5950d3[_0xd6eb('0x68')]==='user'){var _0x36c029=_0x285d59['get']({'plain':!![]});return db[_0xd6eb('0x6b')][_0xd6eb('0x3f')]({'where':{'name':_0xd6eb('0x6c'),'userProfileId':_0x5950d3[_0xd6eb('0x69')]},'raw':!![]})[_0xd6eb('0x20')](function(_0x1130b5){if(_0x1130b5&&_0x1130b5[_0xd6eb('0x6d')]===0x0){return db['UserProfileResource'][_0xd6eb('0x66')]({'name':_0x36c029[_0xd6eb('0x24')],'resourceId':_0x36c029['id'],'type':_0x1130b5[_0xd6eb('0x24')],'sectionId':_0x1130b5['id']},{})[_0xd6eb('0x20')](function(){return _0x285d59;});}else{return _0x285d59;}})[_0xd6eb('0x3c')](function(_0x53c269){logger[_0xd6eb('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53c269);throw _0x53c269;});}return _0x285d59;})[_0xd6eb('0x20')](respondWithResult(_0x4fa25f,null))[_0xd6eb('0x3c')](handleError(_0x4fa25f,null));});_0x4df202[_0xd6eb('0x6e')]();}catch(_0x4a07df){_0x4fa25f['status'](0x1f4)['send'](_0x4a07df);}};exports[_0xd6eb('0x1f')]=function(_0x323144,_0x21fbf3,_0x45ea3c){return db['Sound']['find']({'where':{'id':_0x323144[_0xd6eb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x21fbf3,null))[_0xd6eb('0x20')](saveUpdates(_['pick'](_0x323144[_0xd6eb('0x67')],[_0xd6eb('0x24'),'description']),null))['then'](respondWithResult(_0x21fbf3,null))[_0xd6eb('0x3c')](handleError(_0x21fbf3,null));};exports[_0xd6eb('0x6f')]=function(_0x29d285,_0x1308be,_0x46679a){return db[_0xd6eb('0x26')]['find']({'where':{'id':_0x29d285[_0xd6eb('0x3e')]['id']}})[_0xd6eb('0x20')](function(_0x419e34){if(_0x419e34){return _0x419e34[_0xd6eb('0x21')]();}})[_0xd6eb('0x20')](function(_0xb7fce9){var _0x44e9d4=path['join'](config[_0xd6eb('0x45')],_0xd6eb('0x70'),util['format']('%s.%s',_0xb7fce9[_0xd6eb('0x41')],_0xb7fce9[_0xd6eb('0x71')]));var _0x3e57fb=path['join'](config[_0xd6eb('0x45')],_0xd6eb('0x46'),util['format'](_0xd6eb('0x49'),_0xb7fce9[_0xd6eb('0x41')],_0xb7fce9[_0xd6eb('0x42')]));fs[_0xd6eb('0x56')](_0x44e9d4);fs[_0xd6eb('0x56')](_0x3e57fb);return _0xb7fce9;})['then'](function(_0x37d8b2){if(_0x37d8b2){return _0x1308be[_0xd6eb('0x14')](0xcc)['end']();}})[_0xd6eb('0x20')](handleEntityNotFound(_0x1308be,null))[_0xd6eb('0x3c')](handleError(_0x1308be,null));};
\ No newline at end of file
+var _0x98e8=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','map','Sound','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','findAll','rows','catch','show','keys','includeAll','include','find','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','download','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','wav','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','0777','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2bbf89,_0x116b0d){var _0x5479f7=function(_0xefcc3d){while(--_0xefcc3d){_0x2bbf89['push'](_0x2bbf89['shift']());}};_0x5479f7(++_0x116b0d);}(_0x98e8,0x1d1));var _0x898e=function(_0x3ce99d,_0x27289d){_0x3ce99d=_0x3ce99d-0x0;var _0x5b358d=_0x98e8[_0x3ce99d];return _0x5b358d;};'use strict';var emlformat=require(_0x898e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x898e('0x1'));var jsonpatch=require(_0x898e('0x2'));var rp=require(_0x898e('0x3'));var moment=require(_0x898e('0x4'));var BPromise=require(_0x898e('0x5'));var Mustache=require(_0x898e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x898e('0x7'));var csv=require(_0x898e('0x8'));var ejs=require(_0x898e('0x9'));var fs=require('fs');var fs_extra=require(_0x898e('0xa'));var _=require(_0x898e('0xb'));var squel=require(_0x898e('0xc'));var crypto=require(_0x898e('0xd'));var jsforce=require(_0x898e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x898e('0x8'));var querystring=require('querystring');var Papa=require(_0x898e('0xf'));var Redis=require(_0x898e('0x10'));var authService=require(_0x898e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x898e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x898e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x898e('0x14'));var licenseUtil=require(_0x898e('0x15'));var db=require(_0x898e('0x16'))['db'];function respondWithStatusCode(_0x510b72,_0x226bfd){_0x226bfd=_0x226bfd||0xcc;return function(_0x4c021d){if(_0x4c021d){return _0x510b72['sendStatus'](_0x226bfd);}return _0x510b72[_0x898e('0x17')](_0x226bfd)[_0x898e('0x18')]();};}function respondWithResult(_0x14b4e0,_0x2411f8){_0x2411f8=_0x2411f8||0xc8;return function(_0x8598bb){if(_0x8598bb){return _0x14b4e0['status'](_0x2411f8)['json'](_0x8598bb);}};}function respondWithFilteredResult(_0x19d244,_0x243e8a){return function(_0x143915){if(_0x143915){var _0x401a5b=typeof _0x243e8a[_0x898e('0x19')]===_0x898e('0x1a')&&typeof _0x243e8a[_0x898e('0x1b')]==='undefined';var _0x38dc90=_0x143915[_0x898e('0x1c')];var _0x5c71b0=_0x401a5b?0x0:_0x243e8a[_0x898e('0x19')];var _0x1b3b7b=_0x401a5b?_0x143915['count']:_0x243e8a[_0x898e('0x19')]+_0x243e8a[_0x898e('0x1b')];var _0x29763e;if(_0x1b3b7b>=_0x38dc90){_0x1b3b7b=_0x38dc90;_0x29763e=0xc8;}else{_0x29763e=0xce;}_0x19d244[_0x898e('0x17')](_0x29763e);return _0x19d244[_0x898e('0x1d')](_0x898e('0x1e'),_0x5c71b0+'-'+_0x1b3b7b+'/'+_0x38dc90)[_0x898e('0x1f')](_0x143915);}return null;};}function patchUpdates(_0x499526){return function(_0x310039){try{jsonpatch[_0x898e('0x20')](_0x310039,_0x499526,!![]);}catch(_0x395258){return BPromise[_0x898e('0x21')](_0x395258);}return _0x310039['save']();};}function saveUpdates(_0x30dcca,_0x5d062e){return function(_0x503e84){if(_0x503e84){return _0x503e84[_0x898e('0x22')](_0x30dcca)[_0x898e('0x23')](function(_0x394d02){return _0x394d02;});}return null;};}function removeEntity(_0x22d561,_0x2ffc07){return function(_0x79547e){if(_0x79547e){return _0x79547e[_0x898e('0x24')]()['then'](function(){var _0x53cc18=_0x79547e[_0x898e('0x25')]({'plain':!![]});var _0x2ad676=_0x898e('0x26');return db[_0x898e('0x27')][_0x898e('0x24')]({'where':{'type':_0x2ad676,'resourceId':_0x53cc18['id']}})[_0x898e('0x23')](function(){return _0x79547e;});})[_0x898e('0x23')](function(){_0x22d561[_0x898e('0x17')](0xcc)[_0x898e('0x18')]();});}};}function handleEntityNotFound(_0x46cf04,_0x48de07){return function(_0x58d20e){if(!_0x58d20e){_0x46cf04[_0x898e('0x28')](0x194);}return _0x58d20e;};}function handleError(_0x3294dc,_0x3fa832){_0x3fa832=_0x3fa832||0x1f4;return function(_0x12ba98){logger[_0x898e('0x29')](_0x12ba98[_0x898e('0x2a')]);if(_0x12ba98[_0x898e('0x2b')]){delete _0x12ba98['name'];}_0x3294dc[_0x898e('0x17')](_0x3fa832)[_0x898e('0x2c')](_0x12ba98);};}exports['index']=function(_0x357339,_0x56dc16){var _0x350f67={},_0x325f58={},_0x1d2588={'count':0x0,'rows':[]};var _0x15bd00=_[_0x898e('0x2d')](db[_0x898e('0x2e')][_0x898e('0x2f')],function(_0x30a345){return{'name':_0x30a345[_0x898e('0x30')],'type':_0x30a345['type'][_0x898e('0x31')]};});_0x325f58[_0x898e('0x32')]=_['map'](_0x15bd00,_0x898e('0x2b'));_0x325f58['query']=_['keys'](_0x357339[_0x898e('0x33')]);_0x325f58[_0x898e('0x34')]=_[_0x898e('0x35')](_0x325f58[_0x898e('0x32')],_0x325f58[_0x898e('0x33')]);_0x350f67[_0x898e('0x36')]=_['intersection'](_0x325f58[_0x898e('0x32')],qs['fields'](_0x357339[_0x898e('0x33')][_0x898e('0x37')]));_0x350f67[_0x898e('0x36')]=_0x350f67[_0x898e('0x36')][_0x898e('0x38')]?_0x350f67[_0x898e('0x36')]:_0x325f58[_0x898e('0x32')];if(!_0x357339['query']['hasOwnProperty']('nolimit')){_0x350f67['limit']=qs[_0x898e('0x1b')](_0x357339[_0x898e('0x33')][_0x898e('0x1b')]);_0x350f67[_0x898e('0x19')]=qs['offset'](_0x357339['query'][_0x898e('0x19')]);}_0x350f67[_0x898e('0x39')]=qs[_0x898e('0x3a')](_0x357339[_0x898e('0x33')][_0x898e('0x3a')]);_0x350f67[_0x898e('0x3b')]=qs[_0x898e('0x34')](_[_0x898e('0x3c')](_0x357339[_0x898e('0x33')],_0x325f58[_0x898e('0x34')]),_0x15bd00);if(_0x357339[_0x898e('0x33')][_0x898e('0x3d')]){_0x350f67[_0x898e('0x3b')]=_[_0x898e('0x3e')](_0x350f67['where'],{'$or':_[_0x898e('0x2d')](_0x15bd00,function(_0x46b83c){if(_0x46b83c[_0x898e('0x3f')]!=='VIRTUAL'){var _0x52d4ad={};_0x52d4ad[_0x46b83c[_0x898e('0x2b')]]={'$like':'%'+_0x357339['query'][_0x898e('0x3d')]+'%'};return _0x52d4ad;}})});}_0x350f67=_[_0x898e('0x3e')]({},_0x350f67,_0x357339['options']);var _0x3582a6={'where':_0x350f67[_0x898e('0x3b')]};return db[_0x898e('0x2e')][_0x898e('0x1c')](_0x3582a6)[_0x898e('0x23')](function(_0x1d3442){_0x1d2588[_0x898e('0x1c')]=_0x1d3442;if(_0x357339[_0x898e('0x33')]['includeAll']){_0x350f67['include']=[{'all':!![]}];}return db[_0x898e('0x2e')][_0x898e('0x40')](_0x350f67);})['then'](function(_0x231357){_0x1d2588[_0x898e('0x41')]=_0x231357;return _0x1d2588;})['then'](respondWithFilteredResult(_0x56dc16,_0x350f67))[_0x898e('0x42')](handleError(_0x56dc16,null));};exports[_0x898e('0x43')]=function(_0x494c09,_0x357e08){var _0x28bfd7={'raw':!![],'where':{'id':_0x494c09['params']['id']}},_0x23c5bb={};_0x23c5bb[_0x898e('0x32')]=_[_0x898e('0x44')](db[_0x898e('0x2e')][_0x898e('0x2f')]);_0x23c5bb[_0x898e('0x33')]=_[_0x898e('0x44')](_0x494c09[_0x898e('0x33')]);_0x23c5bb[_0x898e('0x34')]=_[_0x898e('0x35')](_0x23c5bb[_0x898e('0x32')],_0x23c5bb['query']);_0x28bfd7[_0x898e('0x36')]=_[_0x898e('0x35')](_0x23c5bb[_0x898e('0x32')],qs[_0x898e('0x37')](_0x494c09[_0x898e('0x33')][_0x898e('0x37')]));_0x28bfd7[_0x898e('0x36')]=_0x28bfd7[_0x898e('0x36')]['length']?_0x28bfd7['attributes']:_0x23c5bb[_0x898e('0x32')];if(_0x494c09[_0x898e('0x33')][_0x898e('0x45')]){_0x28bfd7[_0x898e('0x46')]=[{'all':!![]}];}_0x28bfd7=_[_0x898e('0x3e')]({},_0x28bfd7,_0x494c09['options']);return db[_0x898e('0x2e')][_0x898e('0x47')](_0x28bfd7)[_0x898e('0x23')](handleEntityNotFound(_0x357e08,null))['then'](respondWithResult(_0x357e08,null))[_0x898e('0x42')](handleError(_0x357e08,null));};exports['download']=function(_0x3e0301,_0x52ae33,_0x119067){return db[_0x898e('0x2e')][_0x898e('0x47')]({'where':{'id':_0x3e0301[_0x898e('0x48')]['id']},'attributes':[_0x898e('0x2b'),_0x898e('0x49'),_0x898e('0x4a')],'raw':!![]})[_0x898e('0x23')](handleEntityNotFound(_0x52ae33,null))[_0x898e('0x23')](function(_0x5ae628){if(_0x5ae628){if(!fs[_0x898e('0x4b')](path['join'](config[_0x898e('0x4c')],_0x898e('0x4d'),_0x5ae628[_0x898e('0x49')]+'.'+_0x5ae628[_0x898e('0x4a')]))){throw new db[(_0x898e('0x4e'))][(_0x898e('0x4f'))]('Sound\x20not\x20found');}return _0x52ae33[_0x898e('0x50')](path[_0x898e('0x51')](config[_0x898e('0x4c')],_0x898e('0x4d'),util[_0x898e('0x52')](_0x898e('0x53'),_0x5ae628['save_name'],_0x5ae628[_0x898e('0x4a')])),util[_0x898e('0x52')]('%s.%s',_0x5ae628[_0x898e('0x2b')],_0x5ae628['converted_format']));}return null;})[_0x898e('0x42')](handleError(_0x52ae33,null));};exports[_0x898e('0x54')]=function(_0x3e1eb7,_0x39aca4,_0x249bad){var _0x285c59={'name':path[_0x898e('0x55')](_0x3e1eb7[_0x898e('0x56')][_0x898e('0x57')],path[_0x898e('0x58')](_0x3e1eb7['file']['originalname'])),'save_name':path['basename'](_0x3e1eb7['file'][_0x898e('0x59')],path[_0x898e('0x58')](_0x3e1eb7['file'][_0x898e('0x59')])),'original_format':path[_0x898e('0x58')](_0x3e1eb7['file']['originalname'])[_0x898e('0x5a')](0x1),'converted_format':'wav'};var _0xbbb240=path[_0x898e('0x51')](config[_0x898e('0x4c')],'server/files/sounds/original',_0x3e1eb7[_0x898e('0x56')][_0x898e('0x59')]);var _0x44f4be=path[_0x898e('0x51')](config['root'],_0x898e('0x4d'),util[_0x898e('0x52')](_0x898e('0x53'),path[_0x898e('0x55')](_0x3e1eb7[_0x898e('0x56')]['filename'],path[_0x898e('0x58')](_0x3e1eb7[_0x898e('0x56')][_0x898e('0x59')])),_0x285c59[_0x898e('0x4a')]));logger[_0x898e('0x5b')](_0x898e('0x5c'),_0xbbb240);logger[_0x898e('0x5b')](_0x898e('0x5d'),_0x44f4be);try{fs[_0x898e('0x5e')](_0xbbb240,parseInt('0777',0x8));var _0x1b8af0=sox['transcode'](_0xbbb240,_0x44f4be,{'sampleRate':0x1f40,'format':_0x898e('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b8af0['on'](_0x898e('0x29'),function(_0x31a1a3){fs[_0x898e('0x60')](_0xbbb240);_0x39aca4['status'](0x1f4)['send'](_0x31a1a3);});_0x1b8af0['on'](_0x898e('0x61'),function(_0x1fc504){_0x285c59['original_duration']=isNaN(_0x1fc504[_0x898e('0x62')])?null:_0x1fc504['duration']*0x3e8;_0x285c59[_0x898e('0x63')]=isNaN(_0x1fc504['sampleCount'])?null:_0x1fc504[_0x898e('0x64')];_0x285c59[_0x898e('0x65')]=isNaN(_0x1fc504[_0x898e('0x66')])?null:_0x1fc504[_0x898e('0x66')];_0x285c59['original_bitRate']=isNaN(_0x1fc504[_0x898e('0x67')])?null:_0x1fc504[_0x898e('0x67')];_0x285c59['original_sampleRate']=isNaN(_0x1fc504['sampleRate'])?null:_0x1fc504['sampleRate'];});_0x1b8af0['on']('dest',function(_0x910075){_0x285c59[_0x898e('0x68')]=isNaN(_0x910075[_0x898e('0x62')])?null:_0x910075[_0x898e('0x62')]*0x3e8;_0x285c59[_0x898e('0x69')]=isNaN(_0x910075[_0x898e('0x64')])?null:_0x910075[_0x898e('0x64')];_0x285c59[_0x898e('0x6a')]=isNaN(_0x910075['channelCount'])?null:_0x910075[_0x898e('0x66')];_0x285c59[_0x898e('0x6b')]=isNaN(_0x910075[_0x898e('0x67')])?null:_0x910075[_0x898e('0x67')];_0x285c59[_0x898e('0x6c')]=isNaN(_0x910075['sampleRate'])?null:_0x910075[_0x898e('0x6d')];});_0x1b8af0['on'](_0x898e('0x18'),function(){fs[_0x898e('0x5e')](_0x44f4be,parseInt(_0x898e('0x6e'),0x8));return db[_0x898e('0x2e')][_0x898e('0x54')](_0x285c59)[_0x898e('0x23')](function(_0x2efa53){var _0xc06bc9={'role':_0x3e1eb7[_0x898e('0x6f')][_0x898e('0x70')],'userProfileId':_0x3e1eb7[_0x898e('0x6f')][_0x898e('0x71')]};if(!_0xc06bc9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc06bc9[_0x898e('0x70')]===_0x898e('0x72')){var _0x3f2dc3=_0x2efa53[_0x898e('0x25')]({'plain':!![]});return db[_0x898e('0x73')]['find']({'where':{'name':_0x898e('0x26'),'userProfileId':_0xc06bc9[_0x898e('0x71')]},'raw':!![]})[_0x898e('0x23')](function(_0x1a8ab4){if(_0x1a8ab4&&_0x1a8ab4[_0x898e('0x74')]===0x0){return db[_0x898e('0x27')][_0x898e('0x54')]({'name':_0x3f2dc3[_0x898e('0x2b')],'resourceId':_0x3f2dc3['id'],'type':_0x1a8ab4[_0x898e('0x2b')],'sectionId':_0x1a8ab4['id']},{})[_0x898e('0x23')](function(){return _0x2efa53;});}else{return _0x2efa53;}})[_0x898e('0x42')](function(_0x35f8e2){logger[_0x898e('0x29')](_0x898e('0x75'),_0x35f8e2);throw _0x35f8e2;});}return _0x2efa53;})[_0x898e('0x23')](respondWithResult(_0x39aca4,null))[_0x898e('0x42')](handleError(_0x39aca4,null));});_0x1b8af0['start']();}catch(_0x81f8db){_0x39aca4[_0x898e('0x17')](0x1f4)[_0x898e('0x2c')](_0x81f8db);}};exports[_0x898e('0x22')]=function(_0x1b720f,_0x592071,_0x2f6fc0){return db[_0x898e('0x2e')]['find']({'where':{'id':_0x1b720f['params']['id']}})[_0x898e('0x23')](handleEntityNotFound(_0x592071,null))[_0x898e('0x23')](saveUpdates(_[_0x898e('0x3c')](_0x1b720f[_0x898e('0x6f')],[_0x898e('0x2b'),_0x898e('0x76')]),null))[_0x898e('0x23')](respondWithResult(_0x592071,null))['catch'](handleError(_0x592071,null));};exports[_0x898e('0x77')]=function(_0x578091,_0x318706,_0x508b75){return db['Sound'][_0x898e('0x47')]({'where':{'id':_0x578091['params']['id']}})['then'](function(_0xf80ec2){if(_0xf80ec2){return _0xf80ec2[_0x898e('0x24')]();}})[_0x898e('0x23')](function(_0x23c74d){var _0x1a18b2=path[_0x898e('0x51')](config[_0x898e('0x4c')],_0x898e('0x78'),util[_0x898e('0x52')]('%s.%s',_0x23c74d[_0x898e('0x49')],_0x23c74d[_0x898e('0x79')]));var _0x1055aa=path['join'](config[_0x898e('0x4c')],_0x898e('0x4d'),util[_0x898e('0x52')](_0x898e('0x53'),_0x23c74d[_0x898e('0x49')],_0x23c74d['converted_format']));fs['unlinkSync'](_0x1a18b2);fs['unlinkSync'](_0x1055aa);return _0x23c74d;})[_0x898e('0x23')](function(_0x172f37){if(_0x172f37){return _0x318706[_0x898e('0x17')](0xcc)[_0x898e('0x18')]();}})['then'](handleEntityNotFound(_0x318706,null))['catch'](handleError(_0x318706,null));};
\ No newline at end of file
index dad7c3f..3606d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de4=['exports','define','Sound','tools_sounds','lodash','util','moment','bluebird','request-promise','path','rimraf','./sound.attributes'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x4de4,0x94));var _0x44de=function(_0x2d5862,_0x4d79dc){_0x2d5862=_0x2d5862-0x0;var _0x7a622f=_0x4de4[_0x2d5862];return _0x7a622f;};'use strict';var _=require(_0x44de('0x0'));var util=require(_0x44de('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44de('0x2'));var BPromise=require(_0x44de('0x3'));var rp=require(_0x44de('0x4'));var fs=require('fs');var path=require(_0x44de('0x5'));var rimraf=require(_0x44de('0x6'));var config=require('../../config/environment');var attributes=require(_0x44de('0x7'));module[_0x44de('0x8')]=function(_0x4f3fbe,_0x22a59f){return _0x4f3fbe[_0x44de('0x9')](_0x44de('0xa'),attributes,{'tableName':_0x44de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51d2=['../../config/logger','api','moment','rimraf','../../config/environment','define','Sound','tools_sounds','lodash','util'];(function(_0x261993,_0x418cb0){var _0x141682=function(_0xfcbbde){while(--_0xfcbbde){_0x261993['push'](_0x261993['shift']());}};_0x141682(++_0x418cb0);}(_0x51d2,0x18e));var _0x251d=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0x51d2[_0x26721d];return _0x1035c5;};'use strict';var _=require(_0x251d('0x0'));var util=require(_0x251d('0x1'));var logger=require(_0x251d('0x2'))(_0x251d('0x3'));var moment=require(_0x251d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x251d('0x5'));var config=require(_0x251d('0x6'));var attributes=require('./sound.attributes');module['exports']=function(_0x3f618f,_0x1109b4){return _0x3f618f[_0x251d('0x7')](_0x251d('0x8'),attributes,{'tableName':_0x251d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6b08cc2..867fc9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cbd=['stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','include','model','attributes','map','then','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','Sound,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x543e89,_0x69a89f){var _0x4d7320=function(_0x2e7f9a){while(--_0x2e7f9a){_0x543e89['push'](_0x543e89['shift']());}};_0x4d7320(++_0x69a89f);}(_0x0cbd,0x82));var _0xd0cb=function(_0x170bc0,_0x321b81){_0x170bc0=_0x170bc0-0x0;var _0x1557c4=_0x0cbd[_0x170bc0];return _0x1557c4;};'use strict';var _=require(_0xd0cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd0cb('0x1'));var fs=require('fs');var Redis=require(_0xd0cb('0x2'));var db=require(_0xd0cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd0cb('0x4'));var config=require(_0xd0cb('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd0cb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5d3972,_0x2e1ea1,_0x141a6e){return new BPromise(function(_0x6cf127,_0x4c6244){return client['request'](_0x5d3972,_0x141a6e)['then'](function(_0x123dd3){logger['info'](_0xd0cb('0x7'),_0x2e1ea1,_0xd0cb('0x8'));logger[_0xd0cb('0x9')]('Sound,\x20%s,\x20%s,\x20%s',_0x2e1ea1,'request\x20sent',JSON[_0xd0cb('0xa')](_0x123dd3));if(_0x123dd3[_0xd0cb('0xb')]){if(_0x123dd3[_0xd0cb('0xb')][_0xd0cb('0xc')]===0x1f4){logger[_0xd0cb('0xb')]('Sound,\x20%s,\x20%s',_0x2e1ea1,_0x123dd3[_0xd0cb('0xb')][_0xd0cb('0xd')]);return _0x4c6244(_0x123dd3[_0xd0cb('0xb')]['message']);}logger[_0xd0cb('0xb')](_0xd0cb('0x7'),_0x2e1ea1,_0x123dd3['error']['message']);return _0x6cf127(_0x123dd3['error'][_0xd0cb('0xd')]);}else{logger[_0xd0cb('0xe')](_0xd0cb('0x7'),_0x2e1ea1,_0xd0cb('0x8'));_0x6cf127(_0x123dd3[_0xd0cb('0xf')][_0xd0cb('0xd')]);}})[_0xd0cb('0x10')](function(_0xa314cf){logger[_0xd0cb('0xb')](_0xd0cb('0x7'),_0x2e1ea1,_0xa314cf);_0x4c6244(_0xa314cf);});});}exports[_0xd0cb('0x11')]=function(_0x5b8f7e){var _0x20cfaf=this;return new Promise(function(_0x2d7564,_0x52115b){return db[_0xd0cb('0x12')][_0xd0cb('0x13')]({'raw':_0x5b8f7e[_0xd0cb('0x14')]?_0x5b8f7e[_0xd0cb('0x14')][_0xd0cb('0x15')]===undefined?!![]:![]:!![],'where':_0x5b8f7e['options']?_0x5b8f7e[_0xd0cb('0x14')][_0xd0cb('0x16')]||null:null,'attributes':_0x5b8f7e[_0xd0cb('0x14')]?_0x5b8f7e[_0xd0cb('0x14')]['attributes']||null:null,'include':_0x5b8f7e[_0xd0cb('0x14')]?_0x5b8f7e[_0xd0cb('0x14')]['include']?_['map'](_0x5b8f7e[_0xd0cb('0x14')][_0xd0cb('0x17')],function(_0x35d39b){return{'model':db[_0x35d39b[_0xd0cb('0x18')]],'as':_0x35d39b['as'],'attributes':_0x35d39b['attributes'],'include':_0x35d39b[_0xd0cb('0x17')]?_['map'](_0x35d39b[_0xd0cb('0x17')],function(_0x22ff30){return{'model':db[_0x22ff30['model']],'as':_0x22ff30['as'],'attributes':_0x22ff30[_0xd0cb('0x19')],'include':_0x22ff30[_0xd0cb('0x17')]?_[_0xd0cb('0x1a')](_0x22ff30[_0xd0cb('0x17')],function(_0x1270b5){return{'model':db[_0x1270b5[_0xd0cb('0x18')]],'as':_0x1270b5['as'],'attributes':_0x1270b5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0cb('0x1b')](function(_0x240c1a){logger[_0xd0cb('0xe')](_0xd0cb('0x11'),_0x5b8f7e);logger[_0xd0cb('0x9')](_0xd0cb('0x11'),_0x5b8f7e,JSON['stringify'](_0x240c1a));_0x2d7564(_0x240c1a);})['catch'](function(_0x335fa4){logger[_0xd0cb('0xb')](_0xd0cb('0x11'),_0x335fa4[_0xd0cb('0xd')],_0x5b8f7e);_0x52115b(_0x20cfaf[_0xd0cb('0xb')](0x1f4,_0x335fa4[_0xd0cb('0xd')]));});});};
\ No newline at end of file
+var _0xf771=['attributes','map','include','model','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','Sound,\x20%s,\x20%s','message','info','result','ShowSound','Sound','options','where'];(function(_0x3b7add,_0x14558d){var _0x187221=function(_0x2ed203){while(--_0x2ed203){_0x3b7add['push'](_0x3b7add['shift']());}};_0x187221(++_0x14558d);}(_0xf771,0x79));var _0x1f77=function(_0x531e03,_0x559af9){_0x531e03=_0x531e03-0x0;var _0x15c807=_0xf771[_0x531e03];return _0x15c807;};'use strict';var _=require(_0x1f77('0x0'));var util=require(_0x1f77('0x1'));var moment=require(_0x1f77('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f77('0x3'));var db=require(_0x1f77('0x4'))['db'];var utils=require(_0x1f77('0x5'));var logger=require('../../config/logger')(_0x1f77('0x6'));var config=require(_0x1f77('0x7'));var jayson=require(_0x1f77('0x8'));var client=jayson['client'][_0x1f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x332b7f,_0x505513,_0x1a2f17){return new BPromise(function(_0x3c56f2,_0x31c892){return client['request'](_0x332b7f,_0x1a2f17)[_0x1f77('0xa')](function(_0xd45d44){logger['info']('Sound,\x20%s,\x20%s',_0x505513,_0x1f77('0xb'));logger[_0x1f77('0xc')](_0x1f77('0xd'),_0x505513,'request\x20sent',JSON[_0x1f77('0xe')](_0xd45d44));if(_0xd45d44[_0x1f77('0xf')]){if(_0xd45d44['error']['code']===0x1f4){logger[_0x1f77('0xf')](_0x1f77('0x10'),_0x505513,_0xd45d44[_0x1f77('0xf')][_0x1f77('0x11')]);return _0x31c892(_0xd45d44[_0x1f77('0xf')]['message']);}logger[_0x1f77('0xf')](_0x1f77('0x10'),_0x505513,_0xd45d44[_0x1f77('0xf')][_0x1f77('0x11')]);return _0x3c56f2(_0xd45d44[_0x1f77('0xf')]['message']);}else{logger[_0x1f77('0x12')]('Sound,\x20%s,\x20%s',_0x505513,'request\x20sent');_0x3c56f2(_0xd45d44[_0x1f77('0x13')][_0x1f77('0x11')]);}})['catch'](function(_0x3de975){logger[_0x1f77('0xf')](_0x1f77('0x10'),_0x505513,_0x3de975);_0x31c892(_0x3de975);});});}exports[_0x1f77('0x14')]=function(_0x351b77){var _0xf997a6=this;return new Promise(function(_0x4b1a45,_0x372e2f){return db[_0x1f77('0x15')]['find']({'raw':_0x351b77[_0x1f77('0x16')]?_0x351b77[_0x1f77('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x351b77[_0x1f77('0x16')]?_0x351b77['options'][_0x1f77('0x17')]||null:null,'attributes':_0x351b77[_0x1f77('0x16')]?_0x351b77['options'][_0x1f77('0x18')]||null:null,'include':_0x351b77[_0x1f77('0x16')]?_0x351b77[_0x1f77('0x16')]['include']?_[_0x1f77('0x19')](_0x351b77[_0x1f77('0x16')]['include'],function(_0x177a94){return{'model':db[_0x177a94['model']],'as':_0x177a94['as'],'attributes':_0x177a94[_0x1f77('0x18')],'include':_0x177a94['include']?_[_0x1f77('0x19')](_0x177a94[_0x1f77('0x1a')],function(_0x4b0177){return{'model':db[_0x4b0177[_0x1f77('0x1b')]],'as':_0x4b0177['as'],'attributes':_0x4b0177[_0x1f77('0x18')],'include':_0x4b0177['include']?_[_0x1f77('0x19')](_0x4b0177[_0x1f77('0x1a')],function(_0x58076b){return{'model':db[_0x58076b[_0x1f77('0x1b')]],'as':_0x58076b['as'],'attributes':_0x58076b[_0x1f77('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2978c6){logger[_0x1f77('0x12')](_0x1f77('0x14'),_0x351b77);logger[_0x1f77('0xc')](_0x1f77('0x14'),_0x351b77,JSON[_0x1f77('0xe')](_0x2978c6));_0x4b1a45(_0x2978c6);})[_0x1f77('0x1c')](function(_0xa31c65){logger['error']('ShowSound',_0xa31c65[_0x1f77('0x11')],_0x351b77);_0x372e2f(_0xf997a6[_0x1f77('0xf')](0x1f4,_0xa31c65[_0x1f77('0x11')]));});});};
\ No newline at end of file
index 6309166..4ae1ce3 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(_0x18e7e5,_0x5ad463){var _0x30c78a=function(_0x473e33){while(--_0x473e33){_0x18e7e5['push'](_0x18e7e5['shift']());}};_0x30c78a(++_0x5ad463);}(_0xda2d,0x102));var _0xdda2=function(_0x1a18d0,_0xfe5f13){_0x1a18d0=_0x1a18d0-0x0;var _0x14f7ea=_0xda2d[_0x1a18d0];return _0x14f7ea;};'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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x8603,0x190));var _0x3860=function(_0x209e6a,_0x34e31a){_0x209e6a=_0x209e6a-0x0;var _0x226857=_0x8603[_0x209e6a];return _0x226857;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index 10ac66a..c537afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4955=['sequelize','exports','STRING','TEXT','medium','out'];(function(_0x8a817d,_0x37c17a){var _0x547ea1=function(_0x302fc4){while(--_0x302fc4){_0x8a817d['push'](_0x8a817d['shift']());}};_0x547ea1(++_0x37c17a);}(_0x4955,0x19e));var _0x5495=function(_0x22fabf,_0x12cd2e){_0x22fabf=_0x22fabf-0x0;var _0x710b52=_0x4955[_0x22fabf];return _0x710b52;};'use strict';var Sequelize=require(_0x5495('0x0'));module[_0x5495('0x1')]={'uniqueid':{'type':Sequelize[_0x5495('0x2')]},'body':{'type':Sequelize[_0x5495('0x3')](_0x5495('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5495('0x5')),'defaultValue':_0x5495('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5495('0x2')]},'providerResponse':{'type':Sequelize[_0x5495('0x3')]}};
\ No newline at end of file
+var _0xf966=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x36c23b,_0x45f539){var _0x52e488=function(_0x2c9f12){while(--_0x2c9f12){_0x36c23b['push'](_0x36c23b['shift']());}};_0x52e488(++_0x45f539);}(_0xf966,0x1d5));var _0x6f96=function(_0x303cdf,_0x2fc65a){_0x303cdf=_0x303cdf-0x0;var _0x24db2e=_0xf966[_0x303cdf];return _0x24db2e;};'use strict';var Sequelize=require(_0x6f96('0x0'));module[_0x6f96('0x1')]={'uniqueid':{'type':Sequelize[_0x6f96('0x2')]},'body':{'type':Sequelize[_0x6f96('0x3')](_0x6f96('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6f96('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6f96('0x3')]}};
\ No newline at end of file
index 7359640..882e25e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcabf=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','index','map','SquareMessage','rawAttributes','fieldName','key','keys','intersection','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','show','params','includeAll','find','catch','create','body','eml-format','rimraf','moment','path','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0xcabf,0x102));var _0xfcab=function(_0x39f249,_0x5a8057){_0x39f249=_0x39f249-0x0;var _0x5f5b6a=_0xcabf[_0x39f249];return _0x5f5b6a;};'use strict';var emlformat=require(_0xfcab('0x0'));var rimraf=require(_0xfcab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfcab('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfcab('0x3'));var sox=require('sox');var csv=require(_0xfcab('0x4'));var ejs=require(_0xfcab('0x5'));var fs=require('fs');var fs_extra=require(_0xfcab('0x6'));var _=require('lodash');var squel=require(_0xfcab('0x7'));var crypto=require(_0xfcab('0x8'));var jsforce=require(_0xfcab('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xfcab('0x4'));var querystring=require(_0xfcab('0xa'));var Papa=require(_0xfcab('0xb'));var Redis=require(_0xfcab('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfcab('0xd'));var as=require(_0xfcab('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcab('0xf'))('api');var utils=require(_0xfcab('0x10'));var config=require(_0xfcab('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcab('0x12'))['db'];function respondWithStatusCode(_0x3f129f,_0x594fa6){_0x594fa6=_0x594fa6||0xcc;return function(_0x4ed9f4){if(_0x4ed9f4){return _0x3f129f[_0xfcab('0x13')](_0x594fa6);}return _0x3f129f[_0xfcab('0x14')](_0x594fa6)[_0xfcab('0x15')]();};}function respondWithResult(_0xf429d8,_0x5e074b){_0x5e074b=_0x5e074b||0xc8;return function(_0x5006b0){if(_0x5006b0){return _0xf429d8[_0xfcab('0x14')](_0x5e074b)[_0xfcab('0x16')](_0x5006b0);}};}function respondWithFilteredResult(_0x1412d0,_0x2c4f5e){return function(_0x14ad8e){if(_0x14ad8e){var _0x5057e5=typeof _0x2c4f5e[_0xfcab('0x17')]===_0xfcab('0x18')&&typeof _0x2c4f5e[_0xfcab('0x19')]===_0xfcab('0x18');var _0x12bd97=_0x14ad8e['count'];var _0x32da6e=_0x5057e5?0x0:_0x2c4f5e[_0xfcab('0x17')];var _0x391f44=_0x5057e5?_0x14ad8e[_0xfcab('0x1a')]:_0x2c4f5e['offset']+_0x2c4f5e[_0xfcab('0x19')];var _0x562f98;if(_0x391f44>=_0x12bd97){_0x391f44=_0x12bd97;_0x562f98=0xc8;}else{_0x562f98=0xce;}_0x1412d0['status'](_0x562f98);return _0x1412d0['set'](_0xfcab('0x1b'),_0x32da6e+'-'+_0x391f44+'/'+_0x12bd97)[_0xfcab('0x16')](_0x14ad8e);}return null;};}function patchUpdates(_0x1f59b1){return function(_0x48e9f9){try{jsonpatch['apply'](_0x48e9f9,_0x1f59b1,!![]);}catch(_0x303f06){return BPromise[_0xfcab('0x1c')](_0x303f06);}return _0x48e9f9[_0xfcab('0x1d')]();};}function saveUpdates(_0x29c1ef,_0x466190){return function(_0x50cb53){if(_0x50cb53){return _0x50cb53[_0xfcab('0x1e')](_0x29c1ef)[_0xfcab('0x1f')](function(_0x4ce1c9){return _0x4ce1c9;});}return null;};}function removeEntity(_0x430adf,_0x76740b){return function(_0x351fe8){if(_0x351fe8){return _0x351fe8[_0xfcab('0x20')]()[_0xfcab('0x1f')](function(){_0x430adf[_0xfcab('0x14')](0xcc)[_0xfcab('0x15')]();});}};}function handleEntityNotFound(_0x21adb0,_0x5ce6e3){return function(_0x3f553a){if(!_0x3f553a){_0x21adb0['sendStatus'](0x194);}return _0x3f553a;};}function handleError(_0x750f01,_0xc4ed52){_0xc4ed52=_0xc4ed52||0x1f4;return function(_0x1eb7e6){logger[_0xfcab('0x21')](_0x1eb7e6['stack']);if(_0x1eb7e6[_0xfcab('0x22')]){delete _0x1eb7e6['name'];}_0x750f01['status'](_0xc4ed52)['send'](_0x1eb7e6);};}exports[_0xfcab('0x23')]=function(_0x2195de,_0x321d82){var _0x4e282d={},_0x25982c={},_0x96bcf0={'count':0x0,'rows':[]};var _0x221c69=_[_0xfcab('0x24')](db[_0xfcab('0x25')][_0xfcab('0x26')],function(_0x306ad5){return{'name':_0x306ad5[_0xfcab('0x27')],'type':_0x306ad5['type'][_0xfcab('0x28')]};});_0x25982c['model']=_[_0xfcab('0x24')](_0x221c69,_0xfcab('0x22'));_0x25982c['query']=_[_0xfcab('0x29')](_0x2195de['query']);_0x25982c['filters']=_[_0xfcab('0x2a')](_0x25982c[_0xfcab('0x2b')],_0x25982c[_0xfcab('0x2c')]);_0x4e282d[_0xfcab('0x2d')]=_[_0xfcab('0x2a')](_0x25982c['model'],qs[_0xfcab('0x2e')](_0x2195de[_0xfcab('0x2c')][_0xfcab('0x2e')]));_0x4e282d[_0xfcab('0x2d')]=_0x4e282d['attributes'][_0xfcab('0x2f')]?_0x4e282d[_0xfcab('0x2d')]:_0x25982c[_0xfcab('0x2b')];if(!_0x2195de[_0xfcab('0x2c')]['hasOwnProperty'](_0xfcab('0x30'))){_0x4e282d[_0xfcab('0x19')]=qs[_0xfcab('0x19')](_0x2195de[_0xfcab('0x2c')]['limit']);_0x4e282d[_0xfcab('0x17')]=qs['offset'](_0x2195de[_0xfcab('0x2c')][_0xfcab('0x17')]);}_0x4e282d[_0xfcab('0x31')]=qs['sort'](_0x2195de['query'][_0xfcab('0x32')]);_0x4e282d['where']=qs[_0xfcab('0x33')](_[_0xfcab('0x34')](_0x2195de['query'],_0x25982c[_0xfcab('0x33')]),_0x221c69);if(_0x2195de[_0xfcab('0x2c')][_0xfcab('0x35')]){_0x4e282d[_0xfcab('0x36')]=_[_0xfcab('0x37')](_0x4e282d['where'],{'$or':_[_0xfcab('0x24')](_0x221c69,function(_0x223f21){if(_0x223f21[_0xfcab('0x38')]!==_0xfcab('0x39')){var _0x5aef71={};_0x5aef71[_0x223f21[_0xfcab('0x22')]]={'$like':'%'+_0x2195de[_0xfcab('0x2c')][_0xfcab('0x35')]+'%'};return _0x5aef71;}})});}_0x4e282d=_[_0xfcab('0x37')]({},_0x4e282d,_0x2195de[_0xfcab('0x3a')]);var _0x127d3f={'where':_0x4e282d[_0xfcab('0x36')]};return db[_0xfcab('0x25')][_0xfcab('0x1a')](_0x127d3f)[_0xfcab('0x1f')](function(_0x5de193){_0x96bcf0[_0xfcab('0x1a')]=_0x5de193;if(_0x2195de[_0xfcab('0x2c')]['includeAll']){_0x4e282d[_0xfcab('0x3b')]=[{'all':!![]}];}return db[_0xfcab('0x25')]['findAll'](_0x4e282d);})[_0xfcab('0x1f')](function(_0x3ecfc6){_0x96bcf0['rows']=_0x3ecfc6;return _0x96bcf0;})[_0xfcab('0x1f')](respondWithFilteredResult(_0x321d82,_0x4e282d))['catch'](handleError(_0x321d82,null));};exports[_0xfcab('0x3c')]=function(_0x2ce116,_0x3e8652){var _0x2685df={'raw':!![],'where':{'id':_0x2ce116[_0xfcab('0x3d')]['id']}},_0x13c434={};_0x13c434['model']=_[_0xfcab('0x29')](db[_0xfcab('0x25')][_0xfcab('0x26')]);_0x13c434[_0xfcab('0x2c')]=_['keys'](_0x2ce116[_0xfcab('0x2c')]);_0x13c434[_0xfcab('0x33')]=_[_0xfcab('0x2a')](_0x13c434[_0xfcab('0x2b')],_0x13c434['query']);_0x2685df[_0xfcab('0x2d')]=_[_0xfcab('0x2a')](_0x13c434[_0xfcab('0x2b')],qs['fields'](_0x2ce116['query'][_0xfcab('0x2e')]));_0x2685df[_0xfcab('0x2d')]=_0x2685df[_0xfcab('0x2d')][_0xfcab('0x2f')]?_0x2685df['attributes']:_0x13c434[_0xfcab('0x2b')];if(_0x2ce116[_0xfcab('0x2c')][_0xfcab('0x3e')]){_0x2685df[_0xfcab('0x3b')]=[{'all':!![]}];}_0x2685df=_[_0xfcab('0x37')]({},_0x2685df,_0x2ce116[_0xfcab('0x3a')]);return db[_0xfcab('0x25')][_0xfcab('0x3f')](_0x2685df)[_0xfcab('0x1f')](handleEntityNotFound(_0x3e8652,null))['then'](respondWithResult(_0x3e8652,null))[_0xfcab('0x40')](handleError(_0x3e8652,null));};exports['create']=function(_0x57b9d2,_0x5666e2){return db[_0xfcab('0x25')][_0xfcab('0x41')](_0x57b9d2[_0xfcab('0x42')],{})[_0xfcab('0x1f')](respondWithResult(_0x5666e2,0xc9))[_0xfcab('0x40')](handleError(_0x5666e2,null));};exports['update']=function(_0x1c813a,_0x452d51){if(_0x1c813a['body']['id']){delete _0x1c813a['body']['id'];}return db[_0xfcab('0x25')]['find']({'where':{'id':_0x1c813a['params']['id']}})['then'](handleEntityNotFound(_0x452d51,null))[_0xfcab('0x1f')](saveUpdates(_0x1c813a[_0xfcab('0x42')],null))['then'](respondWithResult(_0x452d51,null))['catch'](handleError(_0x452d51,null));};exports[_0xfcab('0x20')]=function(_0x214461,_0x26ecc7){return db['SquareMessage']['find']({'where':{'id':_0x214461[_0xfcab('0x3d')]['id']}})[_0xfcab('0x1f')](handleEntityNotFound(_0x26ecc7,null))['then'](removeEntity(_0x26ecc7,null))[_0xfcab('0x40')](handleError(_0x26ecc7,null));};
\ No newline at end of file
+var _0xeff9=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','eml-format'];(function(_0x22d6f4,_0x58fc64){var _0xfa02e3=function(_0x19f23b){while(--_0x19f23b){_0x22d6f4['push'](_0x22d6f4['shift']());}};_0xfa02e3(++_0x58fc64);}(_0xeff9,0x15d));var _0x9eff=function(_0x2bd7a6,_0x2cf153){_0x2bd7a6=_0x2bd7a6-0x0;var _0x11d4a4=_0xeff9[_0x2bd7a6];return _0x11d4a4;};'use strict';var emlformat=require(_0x9eff('0x0'));var rimraf=require(_0x9eff('0x1'));var zipdir=require(_0x9eff('0x2'));var jsonpatch=require(_0x9eff('0x3'));var rp=require(_0x9eff('0x4'));var moment=require(_0x9eff('0x5'));var BPromise=require(_0x9eff('0x6'));var Mustache=require(_0x9eff('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9eff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9eff('0x9'));var _=require('lodash');var squel=require(_0x9eff('0xa'));var crypto=require(_0x9eff('0xb'));var jsforce=require(_0x9eff('0xc'));var deskjs=require(_0x9eff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9eff('0xe'));var Papa=require(_0x9eff('0xf'));var Redis=require('ioredis');var authService=require(_0x9eff('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9eff('0x11'));var hardwareService=require(_0x9eff('0x12'));var logger=require(_0x9eff('0x13'))('api');var utils=require(_0x9eff('0x14'));var config=require(_0x9eff('0x15'));var licenseUtil=require(_0x9eff('0x16'));var db=require(_0x9eff('0x17'))['db'];function respondWithStatusCode(_0x39d821,_0x3cc068){_0x3cc068=_0x3cc068||0xcc;return function(_0xe7e7b9){if(_0xe7e7b9){return _0x39d821[_0x9eff('0x18')](_0x3cc068);}return _0x39d821[_0x9eff('0x19')](_0x3cc068)[_0x9eff('0x1a')]();};}function respondWithResult(_0x1f4629,_0x1d3ec6){_0x1d3ec6=_0x1d3ec6||0xc8;return function(_0x3f4a26){if(_0x3f4a26){return _0x1f4629[_0x9eff('0x19')](_0x1d3ec6)[_0x9eff('0x1b')](_0x3f4a26);}};}function respondWithFilteredResult(_0x174be7,_0x24a3fa){return function(_0x328645){if(_0x328645){var _0x11aaae=typeof _0x24a3fa['offset']===_0x9eff('0x1c')&&typeof _0x24a3fa['limit']===_0x9eff('0x1c');var _0x1681b6=_0x328645[_0x9eff('0x1d')];var _0x24f460=_0x11aaae?0x0:_0x24a3fa[_0x9eff('0x1e')];var _0x1964a3=_0x11aaae?_0x328645[_0x9eff('0x1d')]:_0x24a3fa[_0x9eff('0x1e')]+_0x24a3fa[_0x9eff('0x1f')];var _0x5615f6;if(_0x1964a3>=_0x1681b6){_0x1964a3=_0x1681b6;_0x5615f6=0xc8;}else{_0x5615f6=0xce;}_0x174be7[_0x9eff('0x19')](_0x5615f6);return _0x174be7['set'](_0x9eff('0x20'),_0x24f460+'-'+_0x1964a3+'/'+_0x1681b6)['json'](_0x328645);}return null;};}function patchUpdates(_0x5458ec){return function(_0xacf6d9){try{jsonpatch['apply'](_0xacf6d9,_0x5458ec,!![]);}catch(_0x4761b5){return BPromise[_0x9eff('0x21')](_0x4761b5);}return _0xacf6d9[_0x9eff('0x22')]();};}function saveUpdates(_0x187158,_0x462f34){return function(_0x42927c){if(_0x42927c){return _0x42927c[_0x9eff('0x23')](_0x187158)[_0x9eff('0x24')](function(_0x35f56c){return _0x35f56c;});}return null;};}function removeEntity(_0x2101e0,_0x5d4ce9){return function(_0x5087d3){if(_0x5087d3){return _0x5087d3['destroy']()['then'](function(){_0x2101e0[_0x9eff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x461b80,_0x20c14b){return function(_0xa22f5){if(!_0xa22f5){_0x461b80[_0x9eff('0x18')](0x194);}return _0xa22f5;};}function handleError(_0x286ccb,_0x477d96){_0x477d96=_0x477d96||0x1f4;return function(_0x4f9694){logger[_0x9eff('0x25')](_0x4f9694[_0x9eff('0x26')]);if(_0x4f9694[_0x9eff('0x27')]){delete _0x4f9694[_0x9eff('0x27')];}_0x286ccb[_0x9eff('0x19')](_0x477d96)[_0x9eff('0x28')](_0x4f9694);};}exports['index']=function(_0x5ced4b,_0x3ae788){var _0x314778={},_0x2a7de2={},_0x26e6f7={'count':0x0,'rows':[]};var _0x4bacb2=_[_0x9eff('0x29')](db[_0x9eff('0x2a')][_0x9eff('0x2b')],function(_0x4e65dd){return{'name':_0x4e65dd[_0x9eff('0x2c')],'type':_0x4e65dd[_0x9eff('0x2d')][_0x9eff('0x2e')]};});_0x2a7de2[_0x9eff('0x2f')]=_[_0x9eff('0x29')](_0x4bacb2,_0x9eff('0x27'));_0x2a7de2[_0x9eff('0x30')]=_[_0x9eff('0x31')](_0x5ced4b[_0x9eff('0x30')]);_0x2a7de2[_0x9eff('0x32')]=_[_0x9eff('0x33')](_0x2a7de2[_0x9eff('0x2f')],_0x2a7de2['query']);_0x314778[_0x9eff('0x34')]=_[_0x9eff('0x33')](_0x2a7de2['model'],qs['fields'](_0x5ced4b[_0x9eff('0x30')]['fields']));_0x314778['attributes']=_0x314778[_0x9eff('0x34')][_0x9eff('0x35')]?_0x314778[_0x9eff('0x34')]:_0x2a7de2['model'];if(!_0x5ced4b[_0x9eff('0x30')]['hasOwnProperty']('nolimit')){_0x314778[_0x9eff('0x1f')]=qs[_0x9eff('0x1f')](_0x5ced4b[_0x9eff('0x30')][_0x9eff('0x1f')]);_0x314778[_0x9eff('0x1e')]=qs[_0x9eff('0x1e')](_0x5ced4b[_0x9eff('0x30')]['offset']);}_0x314778['order']=qs[_0x9eff('0x36')](_0x5ced4b['query'][_0x9eff('0x36')]);_0x314778[_0x9eff('0x37')]=qs[_0x9eff('0x32')](_[_0x9eff('0x38')](_0x5ced4b[_0x9eff('0x30')],_0x2a7de2[_0x9eff('0x32')]),_0x4bacb2);if(_0x5ced4b[_0x9eff('0x30')][_0x9eff('0x39')]){_0x314778[_0x9eff('0x37')]=_[_0x9eff('0x3a')](_0x314778[_0x9eff('0x37')],{'$or':_[_0x9eff('0x29')](_0x4bacb2,function(_0x24f5c1){if(_0x24f5c1[_0x9eff('0x2d')]!=='VIRTUAL'){var _0x648b2b={};_0x648b2b[_0x24f5c1[_0x9eff('0x27')]]={'$like':'%'+_0x5ced4b[_0x9eff('0x30')][_0x9eff('0x39')]+'%'};return _0x648b2b;}})});}_0x314778=_[_0x9eff('0x3a')]({},_0x314778,_0x5ced4b[_0x9eff('0x3b')]);var _0x56eb00={'where':_0x314778[_0x9eff('0x37')]};return db['SquareMessage']['count'](_0x56eb00)[_0x9eff('0x24')](function(_0x1cf02d){_0x26e6f7['count']=_0x1cf02d;if(_0x5ced4b['query'][_0x9eff('0x3c')]){_0x314778[_0x9eff('0x3d')]=[{'all':!![]}];}return db[_0x9eff('0x2a')]['findAll'](_0x314778);})[_0x9eff('0x24')](function(_0x40db50){_0x26e6f7[_0x9eff('0x3e')]=_0x40db50;return _0x26e6f7;})[_0x9eff('0x24')](respondWithFilteredResult(_0x3ae788,_0x314778))[_0x9eff('0x3f')](handleError(_0x3ae788,null));};exports[_0x9eff('0x40')]=function(_0x233327,_0x18a477){var _0x5a87ec={'raw':!![],'where':{'id':_0x233327[_0x9eff('0x41')]['id']}},_0x24d924={};_0x24d924[_0x9eff('0x2f')]=_['keys'](db['SquareMessage'][_0x9eff('0x2b')]);_0x24d924[_0x9eff('0x30')]=_['keys'](_0x233327[_0x9eff('0x30')]);_0x24d924[_0x9eff('0x32')]=_[_0x9eff('0x33')](_0x24d924[_0x9eff('0x2f')],_0x24d924[_0x9eff('0x30')]);_0x5a87ec[_0x9eff('0x34')]=_['intersection'](_0x24d924['model'],qs['fields'](_0x233327[_0x9eff('0x30')][_0x9eff('0x42')]));_0x5a87ec['attributes']=_0x5a87ec[_0x9eff('0x34')][_0x9eff('0x35')]?_0x5a87ec[_0x9eff('0x34')]:_0x24d924[_0x9eff('0x2f')];if(_0x233327[_0x9eff('0x30')]['includeAll']){_0x5a87ec[_0x9eff('0x3d')]=[{'all':!![]}];}_0x5a87ec=_[_0x9eff('0x3a')]({},_0x5a87ec,_0x233327[_0x9eff('0x3b')]);return db[_0x9eff('0x2a')][_0x9eff('0x43')](_0x5a87ec)['then'](handleEntityNotFound(_0x18a477,null))[_0x9eff('0x24')](respondWithResult(_0x18a477,null))[_0x9eff('0x3f')](handleError(_0x18a477,null));};exports[_0x9eff('0x44')]=function(_0x35e3e4,_0x5bb000){return db[_0x9eff('0x2a')]['create'](_0x35e3e4['body'],{})['then'](respondWithResult(_0x5bb000,0xc9))['catch'](handleError(_0x5bb000,null));};exports[_0x9eff('0x23')]=function(_0x1a273e,_0x1488b0){if(_0x1a273e[_0x9eff('0x45')]['id']){delete _0x1a273e[_0x9eff('0x45')]['id'];}return db[_0x9eff('0x2a')][_0x9eff('0x43')]({'where':{'id':_0x1a273e[_0x9eff('0x41')]['id']}})['then'](handleEntityNotFound(_0x1488b0,null))['then'](saveUpdates(_0x1a273e[_0x9eff('0x45')],null))[_0x9eff('0x24')](respondWithResult(_0x1488b0,null))[_0x9eff('0x3f')](handleError(_0x1488b0,null));};exports['destroy']=function(_0x12ba85,_0x36d05c){return db[_0x9eff('0x2a')][_0x9eff('0x43')]({'where':{'id':_0x12ba85['params']['id']}})['then'](handleEntityNotFound(_0x36d05c,null))['then'](removeEntity(_0x36d05c,null))['catch'](handleError(_0x36d05c,null));};
\ No newline at end of file
index 54e4535..f9ef75e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb33f=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x29f994,_0x1555de){var _0x4d9708=function(_0x5046ec){while(--_0x5046ec){_0x29f994['push'](_0x29f994['shift']());}};_0x4d9708(++_0x1555de);}(_0xb33f,0x198));var _0xfb33=function(_0x185546,_0x13edd2){_0x185546=_0x185546-0x0;var _0x2aca0b=_0xb33f[_0x185546];return _0x2aca0b;};'use strict';var _=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var logger=require('../../config/logger')(_0xfb33('0x2'));var moment=require(_0xfb33('0x3'));var BPromise=require(_0xfb33('0x4'));var rp=require(_0xfb33('0x5'));var fs=require('fs');var path=require(_0xfb33('0x6'));var rimraf=require(_0xfb33('0x7'));var config=require(_0xfb33('0x8'));var attributes=require(_0xfb33('0x9'));module[_0xfb33('0xa')]=function(_0x3e1f10,_0x31e730){return _0x3e1f10['define'](_0xfb33('0xb'),attributes,{'tableName':_0xfb33('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9819=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','square_messages','util','api'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x9819,0x13e));var _0x9981=function(_0x2ee0ed,_0x98975e){_0x2ee0ed=_0x2ee0ed-0x0;var _0x483839=_0x9819[_0x2ee0ed];return _0x483839;};'use strict';var _=require('lodash');var util=require(_0x9981('0x0'));var logger=require('../../config/logger')(_0x9981('0x1'));var moment=require(_0x9981('0x2'));var BPromise=require(_0x9981('0x3'));var rp=require(_0x9981('0x4'));var fs=require('fs');var path=require(_0x9981('0x5'));var rimraf=require(_0x9981('0x6'));var config=require(_0x9981('0x7'));var attributes=require('./squareMessage.attributes');module[_0x9981('0x8')]=function(_0x2f0986,_0x4dc674){return _0x2f0986['define']('SquareMessage',attributes,{'tableName':_0x9981('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e19d621..7f14f60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe42b=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SquareMessage,\x20%s,\x20%s','info','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','stringify'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xe42b,0x10e));var _0xbe42=function(_0x3c68ac,_0x38b406){_0x3c68ac=_0x3c68ac-0x0;var _0x35d849=_0xe42b[_0x3c68ac];return _0x35d849;};'use strict';var _=require(_0xbe42('0x0'));var util=require(_0xbe42('0x1'));var moment=require(_0xbe42('0x2'));var BPromise=require(_0xbe42('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe42('0x4'));var db=require(_0xbe42('0x5'))['db'];var utils=require(_0xbe42('0x6'));var logger=require(_0xbe42('0x7'))(_0xbe42('0x8'));var config=require(_0xbe42('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9790,_0x3781ca,_0x394769){return new BPromise(function(_0x152127,_0x4b3e0c){return client[_0xbe42('0xa')](_0x2e9790,_0x394769)[_0xbe42('0xb')](function(_0x2c6c65){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3781ca,'request\x20sent');logger['debug'](_0xbe42('0xc'),_0x3781ca,_0xbe42('0xd'),JSON['stringify'](_0x2c6c65));if(_0x2c6c65[_0xbe42('0xe')]){if(_0x2c6c65[_0xbe42('0xe')]['code']===0x1f4){logger[_0xbe42('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3781ca,_0x2c6c65[_0xbe42('0xe')][_0xbe42('0xf')]);return _0x4b3e0c(_0x2c6c65[_0xbe42('0xe')][_0xbe42('0xf')]);}logger[_0xbe42('0xe')](_0xbe42('0x10'),_0x3781ca,_0x2c6c65[_0xbe42('0xe')][_0xbe42('0xf')]);return _0x152127(_0x2c6c65[_0xbe42('0xe')][_0xbe42('0xf')]);}else{logger[_0xbe42('0x11')](_0xbe42('0x10'),_0x3781ca,'request\x20sent');_0x152127(_0x2c6c65['result'][_0xbe42('0xf')]);}})[_0xbe42('0x12')](function(_0x26d7b0){logger[_0xbe42('0xe')](_0xbe42('0x10'),_0x3781ca,_0x26d7b0);_0x4b3e0c(_0x26d7b0);});});}exports[_0xbe42('0x13')]=function(_0x358fc4){var _0x58ac31=this;return new Promise(function(_0x2f1ca3,_0x399700){return db[_0xbe42('0x14')][_0xbe42('0x15')](_0x358fc4[_0xbe42('0x16')],{'raw':_0x358fc4[_0xbe42('0x17')]?_0x358fc4['options'][_0xbe42('0x18')]===undefined?!![]:![]:!![]})[_0xbe42('0xb')](function(_0x472bc4){logger[_0xbe42('0x11')](_0xbe42('0x13'),_0x358fc4);logger[_0xbe42('0x19')](_0xbe42('0x13'),_0x358fc4,JSON[_0xbe42('0x1a')](_0x472bc4));_0x2f1ca3(_0x472bc4);})['catch'](function(_0x166839){logger[_0xbe42('0xe')](_0xbe42('0x13'),_0x166839[_0xbe42('0xf')],_0x358fc4);_0x399700(_0x58ac31[_0xbe42('0xe')](0x1f4,_0x166839[_0xbe42('0xf')]));});});};
\ No newline at end of file
+var _0x2e61=['../../config/utils','rpc','jayson/promise','client','request','then','info','debug','request\x20sent','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x2e61,0x1d6));var _0x12e6=function(_0x4771fb,_0x19f380){_0x4771fb=_0x4771fb-0x0;var _0x3416e5=_0x2e61[_0x4771fb];return _0x3416e5;};'use strict';var _=require(_0x12e6('0x0'));var util=require(_0x12e6('0x1'));var moment=require(_0x12e6('0x2'));var BPromise=require(_0x12e6('0x3'));var rs=require(_0x12e6('0x4'));var fs=require('fs');var Redis=require(_0x12e6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x12e6('0x6'));var logger=require('../../config/logger')(_0x12e6('0x7'));var config=require('../../config/environment');var jayson=require(_0x12e6('0x8'));var client=jayson[_0x12e6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47d16a,_0x3a27fc,_0x40fe38){return new BPromise(function(_0x5475a4,_0x33a619){return client[_0x12e6('0xa')](_0x47d16a,_0x40fe38)[_0x12e6('0xb')](function(_0x52805f){logger[_0x12e6('0xc')]('SquareMessage,\x20%s,\x20%s',_0x3a27fc,'request\x20sent');logger[_0x12e6('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3a27fc,_0x12e6('0xe'),JSON['stringify'](_0x52805f));if(_0x52805f[_0x12e6('0xf')]){if(_0x52805f[_0x12e6('0xf')][_0x12e6('0x10')]===0x1f4){logger[_0x12e6('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3a27fc,_0x52805f[_0x12e6('0xf')][_0x12e6('0x11')]);return _0x33a619(_0x52805f[_0x12e6('0xf')][_0x12e6('0x11')]);}logger[_0x12e6('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3a27fc,_0x52805f[_0x12e6('0xf')][_0x12e6('0x11')]);return _0x5475a4(_0x52805f['error'][_0x12e6('0x11')]);}else{logger['info'](_0x12e6('0x12'),_0x3a27fc,_0x12e6('0xe'));_0x5475a4(_0x52805f[_0x12e6('0x13')][_0x12e6('0x11')]);}})[_0x12e6('0x14')](function(_0x5b74a2){logger['error'](_0x12e6('0x12'),_0x3a27fc,_0x5b74a2);_0x33a619(_0x5b74a2);});});}exports['CreateSquareMessage']=function(_0xfd7bc2){var _0x30b77e=this;return new Promise(function(_0x1b9659,_0x518ec4){return db[_0x12e6('0x15')][_0x12e6('0x16')](_0xfd7bc2[_0x12e6('0x17')],{'raw':_0xfd7bc2[_0x12e6('0x18')]?_0xfd7bc2[_0x12e6('0x18')][_0x12e6('0x19')]===undefined?!![]:![]:!![]})[_0x12e6('0xb')](function(_0x1048fd){logger[_0x12e6('0xc')](_0x12e6('0x1a'),_0xfd7bc2);logger['debug'](_0x12e6('0x1a'),_0xfd7bc2,JSON[_0x12e6('0x1b')](_0x1048fd));_0x1b9659(_0x1048fd);})['catch'](function(_0x1c98e7){logger[_0x12e6('0xf')](_0x12e6('0x1a'),_0x1c98e7['message'],_0xfd7bc2);_0x518ec4(_0x30b77e[_0x12e6('0xf')](0x1f4,_0x1c98e7[_0x12e6('0x11')]));});});};
\ No newline at end of file
index 94e0ba7..519295a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5d6=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','/:id/test','test','post','put','update','delete','destroy','exports'];(function(_0x113517,_0x147fc1){var _0x1237b7=function(_0x3827d2){while(--_0x3827d2){_0x113517['push'](_0x113517['shift']());}};_0x1237b7(++_0x147fc1);}(_0xb5d6,0x1a4));var _0x6b5d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb5d6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x6b5d('0x0'));var util=require(_0x6b5d('0x1'));var path=require('path');var timeout=require(_0x6b5d('0x2'));var express=require(_0x6b5d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b5d('0x4'));var interaction=require(_0x6b5d('0x5'));var config=require(_0x6b5d('0x6'));var controller=require(_0x6b5d('0x7'));router[_0x6b5d('0x8')]('/',auth['isAuthenticated'](),controller[_0x6b5d('0x9')]);router[_0x6b5d('0x8')](_0x6b5d('0xa'),auth[_0x6b5d('0xb')](),controller['show']);router[_0x6b5d('0x8')](_0x6b5d('0xc'),auth[_0x6b5d('0xb')](),timeout('15s'),controller[_0x6b5d('0xd')]);router[_0x6b5d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b5d('0xf')](_0x6b5d('0xa'),auth[_0x6b5d('0xb')](),controller[_0x6b5d('0x10')]);router[_0x6b5d('0x11')]('/:id',auth[_0x6b5d('0xb')](),controller[_0x6b5d('0x12')]);module[_0x6b5d('0x13')]=router;
\ No newline at end of file
+var _0x67b2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','test','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67b2,0x131));var _0x267b=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x67b2[_0x1558ab];return _0x53b64a;};'use strict';var multer=require(_0x267b('0x0'));var util=require(_0x267b('0x1'));var path=require(_0x267b('0x2'));var timeout=require(_0x267b('0x3'));var express=require(_0x267b('0x4'));var router=express['Router']();var fs_extra=require(_0x267b('0x5'));var auth=require(_0x267b('0x6'));var interaction=require(_0x267b('0x7'));var config=require(_0x267b('0x8'));var controller=require('./squareOdbc.controller');router[_0x267b('0x9')]('/',auth[_0x267b('0xa')](),controller[_0x267b('0xb')]);router[_0x267b('0x9')](_0x267b('0xc'),auth[_0x267b('0xa')](),controller[_0x267b('0xd')]);router['get'](_0x267b('0xe'),auth['isAuthenticated'](),timeout('15s'),controller[_0x267b('0xf')]);router[_0x267b('0x10')]('/',auth['isAuthenticated'](),controller[_0x267b('0x11')]);router[_0x267b('0x12')](_0x267b('0xc'),auth[_0x267b('0xa')](),controller[_0x267b('0x13')]);router[_0x267b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x267b('0x15')]);module[_0x267b('0x16')]=router;
\ No newline at end of file
index 44f5604..3afeef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f51=['STRING','name','exports'];(function(_0x45b3b7,_0x2b645e){var _0x2849dd=function(_0x2e79bd){while(--_0x2e79bd){_0x45b3b7['push'](_0x45b3b7['shift']());}};_0x2849dd(++_0x2b645e);}(_0x9f51,0x1af));var _0x19f5=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x9f51[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require('sequelize');module[_0x19f5('0x0')]={'name':{'type':Sequelize[_0x19f5('0x1')],'unique':_0x19f5('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x19f5('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9a73=['exports','name','STRING','sequelize'];(function(_0x5e984d,_0x346e72){var _0xa8b93=function(_0x53c030){while(--_0x53c030){_0x5e984d['push'](_0x5e984d['shift']());}};_0xa8b93(++_0x346e72);}(_0x9a73,0x17b));var _0x39a7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9a73[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x39a7('0x0'));module[_0x39a7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x39a7('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x39a7('0x3')]},'description':{'type':Sequelize[_0x39a7('0x3')]}};
\ No newline at end of file
index 64427b2..f1b1261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc64c=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x50798b,_0x22ccf8){var _0x4b1d26=function(_0x26107f){while(--_0x26107f){_0x50798b['push'](_0x50798b['shift']());}};_0x4b1d26(++_0x22ccf8);}(_0xc64c,0xb4));var _0xcc64=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0xc64c[_0x4bcfa6];return _0x1c0165;};'use strict';var emlformat=require(_0xcc64('0x0'));var rimraf=require(_0xcc64('0x1'));var zipdir=require(_0xcc64('0x2'));var jsonpatch=require(_0xcc64('0x3'));var rp=require(_0xcc64('0x4'));var moment=require(_0xcc64('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc64('0x6'));var util=require(_0xcc64('0x7'));var path=require(_0xcc64('0x8'));var sox=require(_0xcc64('0x9'));var csv=require(_0xcc64('0xa'));var ejs=require(_0xcc64('0xb'));var fs=require('fs');var fs_extra=require(_0xcc64('0xc'));var _=require(_0xcc64('0xd'));var squel=require(_0xcc64('0xe'));var crypto=require(_0xcc64('0xf'));var jsforce=require(_0xcc64('0x10'));var deskjs=require(_0xcc64('0x11'));var toCsv=require(_0xcc64('0xa'));var querystring=require(_0xcc64('0x12'));var Papa=require('papaparse');var Redis=require(_0xcc64('0x13'));var authService=require(_0xcc64('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc64('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc64('0x16'))(_0xcc64('0x17'));var utils=require(_0xcc64('0x18'));var config=require(_0xcc64('0x19'));var licenseUtil=require(_0xcc64('0x1a'));var db=require(_0xcc64('0x1b'))['db'];function respondWithStatusCode(_0x5d4e4e,_0x59ebdb){_0x59ebdb=_0x59ebdb||0xcc;return function(_0x5326ea){if(_0x5326ea){return _0x5d4e4e[_0xcc64('0x1c')](_0x59ebdb);}return _0x5d4e4e[_0xcc64('0x1d')](_0x59ebdb)['end']();};}function respondWithResult(_0x19db11,_0x5a22b5){_0x5a22b5=_0x5a22b5||0xc8;return function(_0x4bc64f){if(_0x4bc64f){return _0x19db11[_0xcc64('0x1d')](_0x5a22b5)['json'](_0x4bc64f);}};}function respondWithFilteredResult(_0x35099a,_0x3a3268){return function(_0x23fecb){if(_0x23fecb){var _0x1d8cf5=typeof _0x3a3268['offset']===_0xcc64('0x1e')&&typeof _0x3a3268['limit']===_0xcc64('0x1e');var _0x5e0441=_0x23fecb[_0xcc64('0x1f')];var _0x34d045=_0x1d8cf5?0x0:_0x3a3268['offset'];var _0x3c9d5c=_0x1d8cf5?_0x23fecb[_0xcc64('0x1f')]:_0x3a3268[_0xcc64('0x20')]+_0x3a3268[_0xcc64('0x21')];var _0x1315a6;if(_0x3c9d5c>=_0x5e0441){_0x3c9d5c=_0x5e0441;_0x1315a6=0xc8;}else{_0x1315a6=0xce;}_0x35099a[_0xcc64('0x1d')](_0x1315a6);return _0x35099a[_0xcc64('0x22')](_0xcc64('0x23'),_0x34d045+'-'+_0x3c9d5c+'/'+_0x5e0441)[_0xcc64('0x24')](_0x23fecb);}return null;};}function patchUpdates(_0x14e243){return function(_0x12e117){try{jsonpatch[_0xcc64('0x25')](_0x12e117,_0x14e243,!![]);}catch(_0x30c7bb){return BPromise[_0xcc64('0x26')](_0x30c7bb);}return _0x12e117[_0xcc64('0x27')]();};}function saveUpdates(_0x2f2274,_0x343a04){return function(_0x36a528){if(_0x36a528){return _0x36a528[_0xcc64('0x28')](_0x2f2274)['then'](function(_0x317712){return _0x317712;});}return null;};}function removeEntity(_0x52381c,_0x51e385){return function(_0x2ce523){if(_0x2ce523){return _0x2ce523[_0xcc64('0x29')]()[_0xcc64('0x2a')](function(){var _0x8d7792=_0x2ce523['get']({'plain':!![]});var _0x3f3d92=_0xcc64('0x2b');return db[_0xcc64('0x2c')][_0xcc64('0x29')]({'where':{'type':_0x3f3d92,'resourceId':_0x8d7792['id']}})[_0xcc64('0x2a')](function(){return _0x2ce523;});})[_0xcc64('0x2a')](function(){_0x52381c[_0xcc64('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca15ed,_0x14386b){return function(_0xedf459){if(!_0xedf459){_0xca15ed[_0xcc64('0x1c')](0x194);}return _0xedf459;};}function handleError(_0x24c419,_0x187a90){_0x187a90=_0x187a90||0x1f4;return function(_0x2eedc5){logger[_0xcc64('0x2d')](_0x2eedc5[_0xcc64('0x2e')]);if(_0x2eedc5[_0xcc64('0x2f')]){delete _0x2eedc5['name'];}_0x24c419[_0xcc64('0x1d')](_0x187a90)[_0xcc64('0x30')](_0x2eedc5);};}exports[_0xcc64('0x31')]=function(_0x125f79,_0x1d7b8e){var _0x1e2a9f={},_0x7a413c={},_0x469828={'count':0x0,'rows':[]};var _0x50ff7f=_[_0xcc64('0x32')](db[_0xcc64('0x33')][_0xcc64('0x34')],function(_0x3007f9){return{'name':_0x3007f9[_0xcc64('0x35')],'type':_0x3007f9[_0xcc64('0x36')][_0xcc64('0x37')]};});_0x7a413c['model']=_[_0xcc64('0x32')](_0x50ff7f,_0xcc64('0x2f'));_0x7a413c[_0xcc64('0x38')]=_[_0xcc64('0x39')](_0x125f79[_0xcc64('0x38')]);_0x7a413c['filters']=_[_0xcc64('0x3a')](_0x7a413c[_0xcc64('0x3b')],_0x7a413c[_0xcc64('0x38')]);_0x1e2a9f[_0xcc64('0x3c')]=_[_0xcc64('0x3a')](_0x7a413c[_0xcc64('0x3b')],qs[_0xcc64('0x3d')](_0x125f79[_0xcc64('0x38')][_0xcc64('0x3d')]));_0x1e2a9f['attributes']=_0x1e2a9f[_0xcc64('0x3c')][_0xcc64('0x3e')]?_0x1e2a9f[_0xcc64('0x3c')]:_0x7a413c[_0xcc64('0x3b')];if(!_0x125f79[_0xcc64('0x38')]['hasOwnProperty'](_0xcc64('0x3f'))){_0x1e2a9f[_0xcc64('0x21')]=qs[_0xcc64('0x21')](_0x125f79[_0xcc64('0x38')][_0xcc64('0x21')]);_0x1e2a9f[_0xcc64('0x20')]=qs[_0xcc64('0x20')](_0x125f79[_0xcc64('0x38')][_0xcc64('0x20')]);}_0x1e2a9f[_0xcc64('0x40')]=qs[_0xcc64('0x41')](_0x125f79['query']['sort']);_0x1e2a9f['where']=qs['filters'](_[_0xcc64('0x42')](_0x125f79[_0xcc64('0x38')],_0x7a413c[_0xcc64('0x43')]),_0x50ff7f);if(_0x125f79['query']['filter']){_0x1e2a9f[_0xcc64('0x44')]=_['merge'](_0x1e2a9f[_0xcc64('0x44')],{'$or':_[_0xcc64('0x32')](_0x50ff7f,function(_0x51d1b1){if(_0x51d1b1[_0xcc64('0x36')]!==_0xcc64('0x45')){var _0x2b5201={};_0x2b5201[_0x51d1b1[_0xcc64('0x2f')]]={'$like':'%'+_0x125f79[_0xcc64('0x38')][_0xcc64('0x46')]+'%'};return _0x2b5201;}})});}_0x1e2a9f=_[_0xcc64('0x47')]({},_0x1e2a9f,_0x125f79[_0xcc64('0x48')]);var _0x420fd7={'where':_0x1e2a9f[_0xcc64('0x44')]};return db[_0xcc64('0x33')][_0xcc64('0x1f')](_0x420fd7)[_0xcc64('0x2a')](function(_0x3f71bf){_0x469828[_0xcc64('0x1f')]=_0x3f71bf;if(_0x125f79[_0xcc64('0x38')][_0xcc64('0x49')]){_0x1e2a9f[_0xcc64('0x4a')]=[{'all':!![]}];}return db[_0xcc64('0x33')][_0xcc64('0x4b')](_0x1e2a9f);})[_0xcc64('0x2a')](function(_0x417027){_0x469828['rows']=_0x417027;return _0x469828;})[_0xcc64('0x2a')](respondWithFilteredResult(_0x1d7b8e,_0x1e2a9f))[_0xcc64('0x4c')](handleError(_0x1d7b8e,null));};exports[_0xcc64('0x4d')]=function(_0x4b8347,_0x2dc866){var _0x418581={'raw':!![],'where':{'id':_0x4b8347[_0xcc64('0x4e')]['id']}},_0x1a8c15={};_0x1a8c15[_0xcc64('0x3b')]=_['keys'](db[_0xcc64('0x33')][_0xcc64('0x34')]);_0x1a8c15[_0xcc64('0x38')]=_[_0xcc64('0x39')](_0x4b8347[_0xcc64('0x38')]);_0x1a8c15[_0xcc64('0x43')]=_[_0xcc64('0x3a')](_0x1a8c15[_0xcc64('0x3b')],_0x1a8c15[_0xcc64('0x38')]);_0x418581[_0xcc64('0x3c')]=_[_0xcc64('0x3a')](_0x1a8c15[_0xcc64('0x3b')],qs['fields'](_0x4b8347[_0xcc64('0x38')][_0xcc64('0x3d')]));_0x418581[_0xcc64('0x3c')]=_0x418581[_0xcc64('0x3c')][_0xcc64('0x3e')]?_0x418581[_0xcc64('0x3c')]:_0x1a8c15[_0xcc64('0x3b')];if(_0x4b8347[_0xcc64('0x38')][_0xcc64('0x49')]){_0x418581['include']=[{'all':!![]}];}_0x418581=_[_0xcc64('0x47')]({},_0x418581,_0x4b8347[_0xcc64('0x48')]);return db[_0xcc64('0x33')][_0xcc64('0x4f')](_0x418581)[_0xcc64('0x2a')](handleEntityNotFound(_0x2dc866,null))[_0xcc64('0x2a')](respondWithResult(_0x2dc866,null))[_0xcc64('0x4c')](handleError(_0x2dc866,null));};exports[_0xcc64('0x50')]=function(_0x477528,_0x23fd08){return db[_0xcc64('0x33')][_0xcc64('0x50')](_0x477528[_0xcc64('0x51')],{})[_0xcc64('0x2a')](function(_0x1e55ef){var _0x1723a6=_0x477528[_0xcc64('0x52')][_0xcc64('0x53')]({'plain':!![]});if(!_0x1723a6)throw new Error(_0xcc64('0x54'));if(_0x1723a6[_0xcc64('0x55')]===_0xcc64('0x52')){var _0x1c4730=_0x1e55ef[_0xcc64('0x53')]({'plain':!![]});var _0x402f55=_0xcc64('0x2b');return db[_0xcc64('0x56')]['find']({'where':{'name':_0x402f55,'userProfileId':_0x1723a6['userProfileId']},'raw':!![]})['then'](function(_0x3c1578){if(_0x3c1578&&_0x3c1578['autoAssociation']===0x0){return db[_0xcc64('0x2c')]['create']({'name':_0x1c4730['name'],'resourceId':_0x1c4730['id'],'type':_0x3c1578[_0xcc64('0x2f')],'sectionId':_0x3c1578['id']},{})['then'](function(){return _0x1e55ef;});}else{return _0x1e55ef;}})[_0xcc64('0x4c')](function(_0x1f5f86){logger['error'](_0xcc64('0x57'),_0x1f5f86);throw _0x1f5f86;});}return _0x1e55ef;})[_0xcc64('0x2a')](respondWithResult(_0x23fd08,0xc9))[_0xcc64('0x4c')](handleError(_0x23fd08,null));};exports[_0xcc64('0x28')]=function(_0x5cd67b,_0x578512){if(_0x5cd67b['body']['id']){delete _0x5cd67b['body']['id'];}return db[_0xcc64('0x33')][_0xcc64('0x4f')]({'where':{'id':_0x5cd67b[_0xcc64('0x4e')]['id']}})[_0xcc64('0x2a')](handleEntityNotFound(_0x578512,null))[_0xcc64('0x2a')](saveUpdates(_0x5cd67b[_0xcc64('0x51')],null))[_0xcc64('0x2a')](respondWithResult(_0x578512,null))[_0xcc64('0x4c')](handleError(_0x578512,null));};exports[_0xcc64('0x29')]=function(_0x5bf973,_0x557da8){return db[_0xcc64('0x33')]['find']({'where':{'id':_0x5bf973[_0xcc64('0x4e')]['id']}})[_0xcc64('0x2a')](handleEntityNotFound(_0x557da8,null))[_0xcc64('0x2a')](removeEntity(_0x557da8,null))[_0xcc64('0x4c')](handleError(_0x557da8,null));};exports[_0xcc64('0x58')]=function(_0x1c97be,_0x5f1a88,_0x2a8c8a){var _0xbd2c66;return db[_0xcc64('0x33')][_0xcc64('0x4f')]({'where':{'id':_0x1c97be[_0xcc64('0x4e')]['id']},'attributes':['id',_0xcc64('0x59')]})[_0xcc64('0x2a')](handleEntityNotFound(_0x5f1a88,null))[_0xcc64('0x2a')](function(_0x55ea65){if(_0x55ea65){var _0xf5ecee=require(_0xcc64('0x5a'))();_0xf5ecee[_0xcc64('0x5b')](_0x55ea65[_0xcc64('0x59')]);_0xf5ecee[_0xcc64('0x5c')]();return _0x55ea65;}})['then'](respondWithResult(_0x5f1a88,null))[_0xcc64('0x4c')](handleError(_0x5f1a88,null));};
\ No newline at end of file
+var _0xa65f=['get','ODBC','end','sendStatus','error','stack','name','send','index','SquareOdbc','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then'];(function(_0x31000b,_0x18f927){var _0x51261e=function(_0x1f1337){while(--_0x1f1337){_0x31000b['push'](_0x31000b['shift']());}};_0x51261e(++_0x18f927);}(_0xa65f,0x83));var _0xfa65=function(_0x340bb4,_0x38e88c){_0x340bb4=_0x340bb4-0x0;var _0x49dd92=_0xa65f[_0x340bb4];return _0x49dd92;};'use strict';var emlformat=require(_0xfa65('0x0'));var rimraf=require(_0xfa65('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa65('0x2'));var rp=require(_0xfa65('0x3'));var moment=require(_0xfa65('0x4'));var BPromise=require(_0xfa65('0x5'));var Mustache=require(_0xfa65('0x6'));var util=require(_0xfa65('0x7'));var path=require(_0xfa65('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa65('0x9'));var fs=require('fs');var fs_extra=require(_0xfa65('0xa'));var _=require('lodash');var squel=require(_0xfa65('0xb'));var crypto=require(_0xfa65('0xc'));var jsforce=require(_0xfa65('0xd'));var deskjs=require(_0xfa65('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfa65('0xf'));var Papa=require(_0xfa65('0x10'));var Redis=require(_0xfa65('0x11'));var authService=require(_0xfa65('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfa65('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa65('0x14'))(_0xfa65('0x15'));var utils=require(_0xfa65('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfa65('0x17'));var db=require(_0xfa65('0x18'))['db'];function respondWithStatusCode(_0x4f7df9,_0x316550){_0x316550=_0x316550||0xcc;return function(_0x560777){if(_0x560777){return _0x4f7df9['sendStatus'](_0x316550);}return _0x4f7df9[_0xfa65('0x19')](_0x316550)['end']();};}function respondWithResult(_0xceac49,_0x36033a){_0x36033a=_0x36033a||0xc8;return function(_0x2528d0){if(_0x2528d0){return _0xceac49[_0xfa65('0x19')](_0x36033a)['json'](_0x2528d0);}};}function respondWithFilteredResult(_0x424631,_0x160a3f){return function(_0x1184c4){if(_0x1184c4){var _0x3ea5be=typeof _0x160a3f[_0xfa65('0x1a')]===_0xfa65('0x1b')&&typeof _0x160a3f[_0xfa65('0x1c')]===_0xfa65('0x1b');var _0x51dd4a=_0x1184c4[_0xfa65('0x1d')];var _0xdc7ebf=_0x3ea5be?0x0:_0x160a3f[_0xfa65('0x1a')];var _0x45a7b4=_0x3ea5be?_0x1184c4[_0xfa65('0x1d')]:_0x160a3f['offset']+_0x160a3f['limit'];var _0x366da9;if(_0x45a7b4>=_0x51dd4a){_0x45a7b4=_0x51dd4a;_0x366da9=0xc8;}else{_0x366da9=0xce;}_0x424631['status'](_0x366da9);return _0x424631[_0xfa65('0x1e')](_0xfa65('0x1f'),_0xdc7ebf+'-'+_0x45a7b4+'/'+_0x51dd4a)[_0xfa65('0x20')](_0x1184c4);}return null;};}function patchUpdates(_0x34d499){return function(_0x4da350){try{jsonpatch['apply'](_0x4da350,_0x34d499,!![]);}catch(_0x183760){return BPromise[_0xfa65('0x21')](_0x183760);}return _0x4da350[_0xfa65('0x22')]();};}function saveUpdates(_0xc7f1a,_0x331b4c){return function(_0x3f6b97){if(_0x3f6b97){return _0x3f6b97[_0xfa65('0x23')](_0xc7f1a)[_0xfa65('0x24')](function(_0x440865){return _0x440865;});}return null;};}function removeEntity(_0x24ae49,_0x231cb2){return function(_0x4299d1){if(_0x4299d1){return _0x4299d1['destroy']()[_0xfa65('0x24')](function(){var _0xf19ee8=_0x4299d1[_0xfa65('0x25')]({'plain':!![]});var _0x1e0c76=_0xfa65('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x1e0c76,'resourceId':_0xf19ee8['id']}})['then'](function(){return _0x4299d1;});})[_0xfa65('0x24')](function(){_0x24ae49[_0xfa65('0x19')](0xcc)[_0xfa65('0x27')]();});}};}function handleEntityNotFound(_0x343b72,_0x4bc953){return function(_0x4f9c6d){if(!_0x4f9c6d){_0x343b72[_0xfa65('0x28')](0x194);}return _0x4f9c6d;};}function handleError(_0x398b66,_0x4afad5){_0x4afad5=_0x4afad5||0x1f4;return function(_0x4beb3b){logger[_0xfa65('0x29')](_0x4beb3b[_0xfa65('0x2a')]);if(_0x4beb3b[_0xfa65('0x2b')]){delete _0x4beb3b[_0xfa65('0x2b')];}_0x398b66['status'](_0x4afad5)[_0xfa65('0x2c')](_0x4beb3b);};}exports[_0xfa65('0x2d')]=function(_0x32e75e,_0x463844){var _0x1c7339={},_0x399fdd={},_0x112819={'count':0x0,'rows':[]};var _0x4f6542=_['map'](db[_0xfa65('0x2e')]['rawAttributes'],function(_0xeccfe7){return{'name':_0xeccfe7[_0xfa65('0x2f')],'type':_0xeccfe7['type'][_0xfa65('0x30')]};});_0x399fdd[_0xfa65('0x31')]=_[_0xfa65('0x32')](_0x4f6542,'name');_0x399fdd[_0xfa65('0x33')]=_[_0xfa65('0x34')](_0x32e75e[_0xfa65('0x33')]);_0x399fdd[_0xfa65('0x35')]=_[_0xfa65('0x36')](_0x399fdd[_0xfa65('0x31')],_0x399fdd[_0xfa65('0x33')]);_0x1c7339[_0xfa65('0x37')]=_['intersection'](_0x399fdd['model'],qs[_0xfa65('0x38')](_0x32e75e[_0xfa65('0x33')][_0xfa65('0x38')]));_0x1c7339[_0xfa65('0x37')]=_0x1c7339[_0xfa65('0x37')][_0xfa65('0x39')]?_0x1c7339[_0xfa65('0x37')]:_0x399fdd[_0xfa65('0x31')];if(!_0x32e75e[_0xfa65('0x33')]['hasOwnProperty']('nolimit')){_0x1c7339[_0xfa65('0x1c')]=qs[_0xfa65('0x1c')](_0x32e75e['query'][_0xfa65('0x1c')]);_0x1c7339[_0xfa65('0x1a')]=qs[_0xfa65('0x1a')](_0x32e75e['query']['offset']);}_0x1c7339['order']=qs[_0xfa65('0x3a')](_0x32e75e[_0xfa65('0x33')][_0xfa65('0x3a')]);_0x1c7339[_0xfa65('0x3b')]=qs[_0xfa65('0x35')](_[_0xfa65('0x3c')](_0x32e75e[_0xfa65('0x33')],_0x399fdd[_0xfa65('0x35')]),_0x4f6542);if(_0x32e75e[_0xfa65('0x33')][_0xfa65('0x3d')]){_0x1c7339[_0xfa65('0x3b')]=_[_0xfa65('0x3e')](_0x1c7339[_0xfa65('0x3b')],{'$or':_[_0xfa65('0x32')](_0x4f6542,function(_0x5e0516){if(_0x5e0516['type']!==_0xfa65('0x3f')){var _0x2a4e65={};_0x2a4e65[_0x5e0516['name']]={'$like':'%'+_0x32e75e['query'][_0xfa65('0x3d')]+'%'};return _0x2a4e65;}})});}_0x1c7339=_[_0xfa65('0x3e')]({},_0x1c7339,_0x32e75e[_0xfa65('0x40')]);var _0x1cdf42={'where':_0x1c7339['where']};return db['SquareOdbc']['count'](_0x1cdf42)['then'](function(_0x5620d2){_0x112819[_0xfa65('0x1d')]=_0x5620d2;if(_0x32e75e[_0xfa65('0x33')][_0xfa65('0x41')]){_0x1c7339[_0xfa65('0x42')]=[{'all':!![]}];}return db[_0xfa65('0x2e')][_0xfa65('0x43')](_0x1c7339);})['then'](function(_0x3dd5bf){_0x112819[_0xfa65('0x44')]=_0x3dd5bf;return _0x112819;})['then'](respondWithFilteredResult(_0x463844,_0x1c7339))['catch'](handleError(_0x463844,null));};exports[_0xfa65('0x45')]=function(_0x59e389,_0xbbb419){var _0x25b80f={'raw':!![],'where':{'id':_0x59e389[_0xfa65('0x46')]['id']}},_0x470de4={};_0x470de4[_0xfa65('0x31')]=_['keys'](db['SquareOdbc']['rawAttributes']);_0x470de4[_0xfa65('0x33')]=_[_0xfa65('0x34')](_0x59e389[_0xfa65('0x33')]);_0x470de4['filters']=_[_0xfa65('0x36')](_0x470de4[_0xfa65('0x31')],_0x470de4['query']);_0x25b80f[_0xfa65('0x37')]=_['intersection'](_0x470de4[_0xfa65('0x31')],qs[_0xfa65('0x38')](_0x59e389[_0xfa65('0x33')][_0xfa65('0x38')]));_0x25b80f[_0xfa65('0x37')]=_0x25b80f[_0xfa65('0x37')][_0xfa65('0x39')]?_0x25b80f['attributes']:_0x470de4[_0xfa65('0x31')];if(_0x59e389[_0xfa65('0x33')][_0xfa65('0x41')]){_0x25b80f[_0xfa65('0x42')]=[{'all':!![]}];}_0x25b80f=_[_0xfa65('0x3e')]({},_0x25b80f,_0x59e389[_0xfa65('0x40')]);return db[_0xfa65('0x2e')][_0xfa65('0x47')](_0x25b80f)[_0xfa65('0x24')](handleEntityNotFound(_0xbbb419,null))[_0xfa65('0x24')](respondWithResult(_0xbbb419,null))[_0xfa65('0x48')](handleError(_0xbbb419,null));};exports[_0xfa65('0x49')]=function(_0x49af3e,_0x473ab8){return db[_0xfa65('0x2e')][_0xfa65('0x49')](_0x49af3e[_0xfa65('0x4a')],{})[_0xfa65('0x24')](function(_0xf9794f){var _0x5e4276=_0x49af3e[_0xfa65('0x4b')]['get']({'plain':!![]});if(!_0x5e4276)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e4276[_0xfa65('0x4c')]==='user'){var _0x4637e9=_0xf9794f[_0xfa65('0x25')]({'plain':!![]});var _0xa18e9d=_0xfa65('0x26');return db['UserProfileSection'][_0xfa65('0x47')]({'where':{'name':_0xa18e9d,'userProfileId':_0x5e4276['userProfileId']},'raw':!![]})[_0xfa65('0x24')](function(_0x2da921){if(_0x2da921&&_0x2da921[_0xfa65('0x4d')]===0x0){return db[_0xfa65('0x4e')][_0xfa65('0x49')]({'name':_0x4637e9['name'],'resourceId':_0x4637e9['id'],'type':_0x2da921[_0xfa65('0x2b')],'sectionId':_0x2da921['id']},{})[_0xfa65('0x24')](function(){return _0xf9794f;});}else{return _0xf9794f;}})[_0xfa65('0x48')](function(_0x38df78){logger[_0xfa65('0x29')](_0xfa65('0x4f'),_0x38df78);throw _0x38df78;});}return _0xf9794f;})[_0xfa65('0x24')](respondWithResult(_0x473ab8,0xc9))['catch'](handleError(_0x473ab8,null));};exports[_0xfa65('0x23')]=function(_0x3dd901,_0xa5243f){if(_0x3dd901[_0xfa65('0x4a')]['id']){delete _0x3dd901[_0xfa65('0x4a')]['id'];}return db[_0xfa65('0x2e')][_0xfa65('0x47')]({'where':{'id':_0x3dd901[_0xfa65('0x46')]['id']}})[_0xfa65('0x24')](handleEntityNotFound(_0xa5243f,null))[_0xfa65('0x24')](saveUpdates(_0x3dd901['body'],null))[_0xfa65('0x24')](respondWithResult(_0xa5243f,null))[_0xfa65('0x48')](handleError(_0xa5243f,null));};exports[_0xfa65('0x50')]=function(_0xf5a476,_0x14ff2a){return db[_0xfa65('0x2e')][_0xfa65('0x47')]({'where':{'id':_0xf5a476[_0xfa65('0x46')]['id']}})[_0xfa65('0x24')](handleEntityNotFound(_0x14ff2a,null))['then'](removeEntity(_0x14ff2a,null))[_0xfa65('0x48')](handleError(_0x14ff2a,null));};exports[_0xfa65('0x51')]=function(_0x1916c5,_0x5f0936,_0x3ae132){var _0x1f94cb;return db[_0xfa65('0x2e')][_0xfa65('0x47')]({'where':{'id':_0x1916c5['params']['id']},'attributes':['id',_0xfa65('0x52')]})[_0xfa65('0x24')](handleEntityNotFound(_0x5f0936,null))['then'](function(_0x26e0dd){if(_0x26e0dd){var _0x2bdf77=require('odbc')();_0x2bdf77['openSync'](_0x26e0dd[_0xfa65('0x52')]);_0x2bdf77[_0xfa65('0x53')]();return _0x26e0dd;}})[_0xfa65('0x24')](respondWithResult(_0x5f0936,null))[_0xfa65('0x48')](handleError(_0x5f0936,null));};
\ No newline at end of file
index 0f7ef09..d983eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd54=['moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api'];(function(_0x5cad15,_0x1dfaa2){var _0x54941a=function(_0x6d1067){while(--_0x6d1067){_0x5cad15['push'](_0x5cad15['shift']());}};_0x54941a(++_0x1dfaa2);}(_0xfd54,0xb3));var _0x4fd5=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xfd54[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x4fd5('0x0'));var util=require('util');var logger=require(_0x4fd5('0x1'))(_0x4fd5('0x2'));var moment=require(_0x4fd5('0x3'));var BPromise=require(_0x4fd5('0x4'));var rp=require(_0x4fd5('0x5'));var fs=require('fs');var path=require(_0x4fd5('0x6'));var rimraf=require(_0x4fd5('0x7'));var config=require('../../config/environment');var attributes=require(_0x4fd5('0x8'));module[_0x4fd5('0x9')]=function(_0x28f10f,_0x30b758){return _0x28f10f[_0x4fd5('0xa')](_0x4fd5('0xb'),attributes,{'tableName':_0x4fd5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef1f=['moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util','../../config/logger','api'];(function(_0x1982bc,_0x1a6071){var _0x403a4f=function(_0x4d3b55){while(--_0x4d3b55){_0x1982bc['push'](_0x1982bc['shift']());}};_0x403a4f(++_0x1a6071);}(_0xef1f,0xbd));var _0xfef1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xef1f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xfef1('0x0'));var logger=require(_0xfef1('0x1'))(_0xfef1('0x2'));var moment=require(_0xfef1('0x3'));var BPromise=require(_0xfef1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfef1('0x5'));var rimraf=require(_0xfef1('0x6'));var config=require(_0xfef1('0x7'));var attributes=require(_0xfef1('0x8'));module['exports']=function(_0x30d631,_0x1c78e1){return _0x30d631[_0xfef1('0x9')](_0xfef1('0xa'),attributes,{'tableName':_0xfef1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40f940a..4ef5c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x050c=['where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','ShowSquareOdbc','SquareOdbc','options','raw'];(function(_0x59b48b,_0x584733){var _0x4c3f79=function(_0x3f2e94){while(--_0x3f2e94){_0x59b48b['push'](_0x59b48b['shift']());}};_0x4c3f79(++_0x584733);}(_0x050c,0x1e1));var _0xc050=function(_0x57da42,_0x2b299a){_0x57da42=_0x57da42-0x0;var _0x5f0dbc=_0x050c[_0x57da42];return _0x5f0dbc;};'use strict';var _=require(_0xc050('0x0'));var util=require(_0xc050('0x1'));var moment=require(_0xc050('0x2'));var BPromise=require(_0xc050('0x3'));var rs=require(_0xc050('0x4'));var fs=require('fs');var Redis=require(_0xc050('0x5'));var db=require(_0xc050('0x6'))['db'];var utils=require(_0xc050('0x7'));var logger=require('../../config/logger')(_0xc050('0x8'));var config=require(_0xc050('0x9'));var jayson=require(_0xc050('0xa'));var client=jayson['client'][_0xc050('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bda75,_0x344cb3,_0x534f7f){return new BPromise(function(_0x5a0ea6,_0x540ebd){return client[_0xc050('0xc')](_0x3bda75,_0x534f7f)[_0xc050('0xd')](function(_0x33361f){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x344cb3,_0xc050('0xe'));logger[_0xc050('0xf')](_0xc050('0x10'),_0x344cb3,_0xc050('0xe'),JSON[_0xc050('0x11')](_0x33361f));if(_0x33361f[_0xc050('0x12')]){if(_0x33361f[_0xc050('0x12')][_0xc050('0x13')]===0x1f4){logger[_0xc050('0x12')](_0xc050('0x14'),_0x344cb3,_0x33361f[_0xc050('0x12')][_0xc050('0x15')]);return _0x540ebd(_0x33361f['error'][_0xc050('0x15')]);}logger[_0xc050('0x12')](_0xc050('0x14'),_0x344cb3,_0x33361f[_0xc050('0x12')]['message']);return _0x5a0ea6(_0x33361f[_0xc050('0x12')][_0xc050('0x15')]);}else{logger[_0xc050('0x16')](_0xc050('0x14'),_0x344cb3,_0xc050('0xe'));_0x5a0ea6(_0x33361f[_0xc050('0x17')][_0xc050('0x15')]);}})[_0xc050('0x18')](function(_0x10eb6f){logger['error'](_0xc050('0x14'),_0x344cb3,_0x10eb6f);_0x540ebd(_0x10eb6f);});});}exports[_0xc050('0x19')]=function(_0x43bfe6){var _0x5b9c78=this;return new Promise(function(_0x2daadc,_0x357eda){return db[_0xc050('0x1a')]['find']({'raw':_0x43bfe6[_0xc050('0x1b')]?_0x43bfe6[_0xc050('0x1b')][_0xc050('0x1c')]===undefined?!![]:![]:!![],'where':_0x43bfe6[_0xc050('0x1b')]?_0x43bfe6[_0xc050('0x1b')][_0xc050('0x1d')]||null:null,'attributes':_0x43bfe6[_0xc050('0x1b')]?_0x43bfe6[_0xc050('0x1b')][_0xc050('0x1e')]||null:null,'include':_0x43bfe6[_0xc050('0x1b')]?_0x43bfe6['options'][_0xc050('0x1f')]?_[_0xc050('0x20')](_0x43bfe6['options'][_0xc050('0x1f')],function(_0x214e2b){return{'model':db[_0x214e2b[_0xc050('0x21')]],'as':_0x214e2b['as'],'attributes':_0x214e2b[_0xc050('0x1e')],'include':_0x214e2b[_0xc050('0x1f')]?_['map'](_0x214e2b[_0xc050('0x1f')],function(_0x213612){return{'model':db[_0x213612[_0xc050('0x21')]],'as':_0x213612['as'],'attributes':_0x213612[_0xc050('0x1e')],'include':_0x213612[_0xc050('0x1f')]?_['map'](_0x213612[_0xc050('0x1f')],function(_0x23bc67){return{'model':db[_0x23bc67[_0xc050('0x21')]],'as':_0x23bc67['as'],'attributes':_0x23bc67[_0xc050('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc050('0xd')](function(_0x125966){logger['info']('ShowSquareOdbc',_0x43bfe6);logger[_0xc050('0xf')](_0xc050('0x19'),_0x43bfe6,JSON[_0xc050('0x11')](_0x125966));_0x2daadc(_0x125966);})[_0xc050('0x18')](function(_0x280d2e){logger[_0xc050('0x12')](_0xc050('0x19'),_0x280d2e[_0xc050('0x15')],_0x43bfe6);_0x357eda(_0x5b9c78[_0xc050('0x12')](0x1f4,_0x280d2e['message']));});});};
\ No newline at end of file
+var _0x2c33=['stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSquareOdbc','SquareOdbc','options','raw','attributes','include','model','map','then'];(function(_0x48f3fb,_0x4d2b2b){var _0x2c39ff=function(_0x3a6463){while(--_0x3a6463){_0x48f3fb['push'](_0x48f3fb['shift']());}};_0x2c39ff(++_0x4d2b2b);}(_0x2c33,0xf1));var _0x32c3=function(_0x2d5df7,_0x3e7ec3){_0x2d5df7=_0x2d5df7-0x0;var _0x4e27ea=_0x2c33[_0x2d5df7];return _0x4e27ea;};'use strict';var _=require(_0x32c3('0x0'));var util=require('util');var moment=require(_0x32c3('0x1'));var BPromise=require(_0x32c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32c3('0x3'));var db=require(_0x32c3('0x4'))['db'];var utils=require(_0x32c3('0x5'));var logger=require(_0x32c3('0x6'))('rpc');var config=require(_0x32c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32c3('0x8')][_0x32c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8cd49d,_0x442ec4,_0x29af08){return new BPromise(function(_0x16d25d,_0x1cb165){return client[_0x32c3('0xa')](_0x8cd49d,_0x29af08)['then'](function(_0x2745c2){logger[_0x32c3('0xb')](_0x32c3('0xc'),_0x442ec4,_0x32c3('0xd'));logger[_0x32c3('0xe')](_0x32c3('0xf'),_0x442ec4,_0x32c3('0xd'),JSON['stringify'](_0x2745c2));if(_0x2745c2[_0x32c3('0x10')]){if(_0x2745c2[_0x32c3('0x10')][_0x32c3('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x442ec4,_0x2745c2['error']['message']);return _0x1cb165(_0x2745c2[_0x32c3('0x10')][_0x32c3('0x12')]);}logger[_0x32c3('0x10')](_0x32c3('0xc'),_0x442ec4,_0x2745c2['error']['message']);return _0x16d25d(_0x2745c2[_0x32c3('0x10')][_0x32c3('0x12')]);}else{logger[_0x32c3('0xb')](_0x32c3('0xc'),_0x442ec4,_0x32c3('0xd'));_0x16d25d(_0x2745c2['result']['message']);}})[_0x32c3('0x13')](function(_0x391f90){logger[_0x32c3('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x442ec4,_0x391f90);_0x1cb165(_0x391f90);});});}exports[_0x32c3('0x14')]=function(_0x202ba5){var _0x54b70e=this;return new Promise(function(_0x1d302c,_0x28794c){return db[_0x32c3('0x15')]['find']({'raw':_0x202ba5[_0x32c3('0x16')]?_0x202ba5[_0x32c3('0x16')][_0x32c3('0x17')]===undefined?!![]:![]:!![],'where':_0x202ba5['options']?_0x202ba5[_0x32c3('0x16')]['where']||null:null,'attributes':_0x202ba5[_0x32c3('0x16')]?_0x202ba5['options'][_0x32c3('0x18')]||null:null,'include':_0x202ba5[_0x32c3('0x16')]?_0x202ba5[_0x32c3('0x16')][_0x32c3('0x19')]?_['map'](_0x202ba5[_0x32c3('0x16')][_0x32c3('0x19')],function(_0x134909){return{'model':db[_0x134909[_0x32c3('0x1a')]],'as':_0x134909['as'],'attributes':_0x134909['attributes'],'include':_0x134909['include']?_[_0x32c3('0x1b')](_0x134909['include'],function(_0x25edd2){return{'model':db[_0x25edd2['model']],'as':_0x25edd2['as'],'attributes':_0x25edd2['attributes'],'include':_0x25edd2[_0x32c3('0x19')]?_[_0x32c3('0x1b')](_0x25edd2[_0x32c3('0x19')],function(_0x280ee1){return{'model':db[_0x280ee1['model']],'as':_0x280ee1['as'],'attributes':_0x280ee1[_0x32c3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x32c3('0x1c')](function(_0x4bb288){logger[_0x32c3('0xb')](_0x32c3('0x14'),_0x202ba5);logger[_0x32c3('0xe')](_0x32c3('0x14'),_0x202ba5,JSON[_0x32c3('0x1d')](_0x4bb288));_0x1d302c(_0x4bb288);})['catch'](function(_0x2f5f5f){logger[_0x32c3('0x10')](_0x32c3('0x14'),_0x2f5f5f['message'],_0x202ba5);_0x28794c(_0x54b70e[_0x32c3('0x10')](0x1f4,_0x2f5f5f[_0x32c3('0x12')]));});});};
\ No newline at end of file
index ee158c0..728a471 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf793=['post','create','addUsers','put','delete','/:id','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id/users','getUsers'];(function(_0x1f5b5b,_0xc706f8){var _0x287c76=function(_0x4f2c3c){while(--_0x4f2c3c){_0x1f5b5b['push'](_0x1f5b5b['shift']());}};_0x287c76(++_0xc706f8);}(_0xf793,0x1ac));var _0x3f79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf793[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x3f79('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f79('0x1'));var router=express[_0x3f79('0x2')]();var fs_extra=require(_0x3f79('0x3'));var auth=require(_0x3f79('0x4'));var interaction=require(_0x3f79('0x5'));var config=require(_0x3f79('0x6'));var controller=require(_0x3f79('0x7'));router[_0x3f79('0x8')]('/',auth[_0x3f79('0x9')](),controller[_0x3f79('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3f79('0x8')](_0x3f79('0xb'),auth[_0x3f79('0x9')](),controller[_0x3f79('0xc')]);router[_0x3f79('0xd')]('/',auth[_0x3f79('0x9')](),controller[_0x3f79('0xe')]);router[_0x3f79('0xd')](_0x3f79('0xb'),auth[_0x3f79('0x9')](),controller[_0x3f79('0xf')]);router[_0x3f79('0x10')]('/:id',auth[_0x3f79('0x9')](),controller['update']);router[_0x3f79('0x11')](_0x3f79('0x12'),auth[_0x3f79('0x9')](),controller[_0x3f79('0x13')]);router[_0x3f79('0x11')](_0x3f79('0xb'),auth[_0x3f79('0x9')](),controller['removeUsers']);module[_0x3f79('0x14')]=router;
\ No newline at end of file
+var _0x40a3=['destroy','removeUsers','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','create','post','put','update','delete'];(function(_0x467d8a,_0x1278fc){var _0x3cfba0=function(_0x48ecf8){while(--_0x48ecf8){_0x467d8a['push'](_0x467d8a['shift']());}};_0x3cfba0(++_0x1278fc);}(_0x40a3,0x153));var _0x340a=function(_0x1d5d49,_0x3629dc){_0x1d5d49=_0x1d5d49-0x0;var _0x3545f3=_0x40a3[_0x1d5d49];return _0x3545f3;};'use strict';var multer=require(_0x340a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x340a('0x1'));var router=express['Router']();var fs_extra=require(_0x340a('0x2'));var auth=require(_0x340a('0x3'));var interaction=require(_0x340a('0x4'));var config=require(_0x340a('0x5'));var controller=require(_0x340a('0x6'));router[_0x340a('0x7')]('/',auth[_0x340a('0x8')](),controller['index']);router[_0x340a('0x7')](_0x340a('0x9'),auth['isAuthenticated'](),controller[_0x340a('0xa')]);router[_0x340a('0x7')](_0x340a('0xb'),auth[_0x340a('0x8')](),controller[_0x340a('0xc')]);router['post']('/',auth[_0x340a('0x8')](),controller[_0x340a('0xd')]);router[_0x340a('0xe')]('/:id/users',auth[_0x340a('0x8')](),controller['addUsers']);router[_0x340a('0xf')](_0x340a('0x9'),auth['isAuthenticated'](),controller[_0x340a('0x10')]);router[_0x340a('0x11')](_0x340a('0x9'),auth[_0x340a('0x8')](),controller[_0x340a('0x12')]);router[_0x340a('0x11')](_0x340a('0xb'),auth[_0x340a('0x8')](),controller[_0x340a('0x13')]);module[_0x340a('0x14')]=router;
\ No newline at end of file
index a98b5e3..1c90b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dfd=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x3c1cae,_0x1c66c7){var _0x360f8c=function(_0x22fbea){while(--_0x22fbea){_0x3c1cae['push'](_0x3c1cae['shift']());}};_0x360f8c(++_0x1c66c7);}(_0x4dfd,0xa2));var _0xd4df=function(_0x4a0aff,_0x8f7ca8){_0x4a0aff=_0x4a0aff-0x0;var _0x3cac4d=_0x4dfd[_0x4a0aff];return _0x3cac4d;};'use strict';var Sequelize=require(_0xd4df('0x0'));module[_0xd4df('0x1')]={'name':{'type':Sequelize[_0xd4df('0x2')],'unique':_0xd4df('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd4df('0x2')]},'notes':{'type':Sequelize[_0xd4df('0x4')]},'preproduction':{'type':Sequelize[_0xd4df('0x5')](_0xd4df('0x6')),'get':function(){if(this[_0xd4df('0x7')]('preproduction')){return this[_0xd4df('0x7')](_0xd4df('0x8'))[_0xd4df('0x9')](_0xd4df('0xa'));}}},'production':{'type':Sequelize[_0xd4df('0x5')]('long'),'get':function(){if(this[_0xd4df('0x7')](_0xd4df('0xb'))){return this[_0xd4df('0x7')](_0xd4df('0xb'))[_0xd4df('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0xd4df('0xc')]},'publishedAt':{'type':Sequelize[_0xd4df('0xc')]}};
\ No newline at end of file
+var _0x59cd=['BLOB','production','utf8','DATE','sequelize','exports','STRING','name','TEXT','long','getDataValue','preproduction','toString'];(function(_0x46c47b,_0x409a5d){var _0xd2b550=function(_0x2cbcb7){while(--_0x2cbcb7){_0x46c47b['push'](_0x46c47b['shift']());}};_0xd2b550(++_0x409a5d);}(_0x59cd,0x108));var _0xd59c=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x59cd[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require(_0xd59c('0x0'));module[_0xd59c('0x1')]={'name':{'type':Sequelize[_0xd59c('0x2')],'unique':_0xd59c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd59c('0x2')]},'notes':{'type':Sequelize[_0xd59c('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xd59c('0x5')),'get':function(){if(this[_0xd59c('0x6')](_0xd59c('0x7'))){return this[_0xd59c('0x6')](_0xd59c('0x7'))[_0xd59c('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xd59c('0x9')](_0xd59c('0x5')),'get':function(){if(this[_0xd59c('0x6')]('production')){return this[_0xd59c('0x6')](_0xd59c('0xa'))[_0xd59c('0x8')](_0xd59c('0xb'));}}},'savedAt':{'type':Sequelize[_0xd59c('0xc')]},'publishedAt':{'type':Sequelize[_0xd59c('0xc')]}};
\ No newline at end of file
index 78ecde5..9c622eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c69=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','addUsers','omit','ids','removeUsers','userSquareProject:remove','emit','getUsers','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','error','stack','name','index','map','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','SquareProject','includeAll','include','findAll','rows','catch','params','rawAttributes'];(function(_0x4d71a9,_0x3e63da){var _0x5b1682=function(_0x1173d8){while(--_0x1173d8){_0x4d71a9['push'](_0x4d71a9['shift']());}};_0x5b1682(++_0x3e63da);}(_0x8c69,0x189));var _0x98c6=function(_0x512a1b,_0x1943a5){_0x512a1b=_0x512a1b-0x0;var _0x491211=_0x8c69[_0x512a1b];return _0x491211;};'use strict';var emlformat=require(_0x98c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98c6('0x1'));var jsonpatch=require(_0x98c6('0x2'));var rp=require(_0x98c6('0x3'));var moment=require(_0x98c6('0x4'));var BPromise=require(_0x98c6('0x5'));var Mustache=require(_0x98c6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x98c6('0x7'));var csv=require(_0x98c6('0x8'));var ejs=require(_0x98c6('0x9'));var fs=require('fs');var fs_extra=require(_0x98c6('0xa'));var _=require('lodash');var squel=require(_0x98c6('0xb'));var crypto=require(_0x98c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98c6('0xd'));var toCsv=require(_0x98c6('0x8'));var querystring=require(_0x98c6('0xe'));var Papa=require(_0x98c6('0xf'));var Redis=require('ioredis');var authService=require(_0x98c6('0x10'));var qs=require(_0x98c6('0x11'));var as=require(_0x98c6('0x12'));var hardwareService=require(_0x98c6('0x13'));var logger=require(_0x98c6('0x14'))(_0x98c6('0x15'));var utils=require('../../config/utils');var config=require(_0x98c6('0x16'));var licenseUtil=require(_0x98c6('0x17'));var db=require('../../mysqldb')['db'];config[_0x98c6('0x18')]=_[_0x98c6('0x19')](config[_0x98c6('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98c6('0x18')]));require(_0x98c6('0x1a'))['register'](socket);function respondWithStatusCode(_0x5991bc,_0x1d032e){_0x1d032e=_0x1d032e||0xcc;return function(_0x509d06){if(_0x509d06){return _0x5991bc['sendStatus'](_0x1d032e);}return _0x5991bc[_0x98c6('0x1b')](_0x1d032e)['end']();};}function respondWithResult(_0x2d3f11,_0x5718b4){_0x5718b4=_0x5718b4||0xc8;return function(_0x4785f2){if(_0x4785f2){return _0x2d3f11[_0x98c6('0x1b')](_0x5718b4)[_0x98c6('0x1c')](_0x4785f2);}};}function respondWithFilteredResult(_0x32fd51,_0x39ad88){return function(_0x2f3958){if(_0x2f3958){var _0x112478=typeof _0x39ad88[_0x98c6('0x1d')]===_0x98c6('0x1e')&&typeof _0x39ad88[_0x98c6('0x1f')]===_0x98c6('0x1e');var _0x115d55=_0x2f3958['count'];var _0x4f3609=_0x112478?0x0:_0x39ad88['offset'];var _0x38d68f=_0x112478?_0x2f3958[_0x98c6('0x20')]:_0x39ad88[_0x98c6('0x1d')]+_0x39ad88[_0x98c6('0x1f')];var _0x1419e0;if(_0x38d68f>=_0x115d55){_0x38d68f=_0x115d55;_0x1419e0=0xc8;}else{_0x1419e0=0xce;}_0x32fd51[_0x98c6('0x1b')](_0x1419e0);return _0x32fd51[_0x98c6('0x21')](_0x98c6('0x22'),_0x4f3609+'-'+_0x38d68f+'/'+_0x115d55)[_0x98c6('0x1c')](_0x2f3958);}return null;};}function patchUpdates(_0xc8a96a){return function(_0xc59827){try{jsonpatch['apply'](_0xc59827,_0xc8a96a,!![]);}catch(_0x222c03){return BPromise[_0x98c6('0x23')](_0x222c03);}return _0xc59827[_0x98c6('0x24')]();};}function saveUpdates(_0xb90d75,_0xd39f82){return function(_0x409144){if(_0x409144){return _0x409144[_0x98c6('0x25')](_0xb90d75)[_0x98c6('0x26')](function(_0x37ccba){return _0x37ccba;});}return null;};}function removeEntity(_0x435b68,_0x51ad7f){return function(_0x30ae66){if(_0x30ae66){return _0x30ae66[_0x98c6('0x27')]()[_0x98c6('0x26')](function(){var _0x1354cb=_0x30ae66[_0x98c6('0x28')]({'plain':!![]});var _0x156021=_0x98c6('0x29');return db[_0x98c6('0x2a')][_0x98c6('0x27')]({'where':{'type':_0x156021,'resourceId':_0x1354cb['id']}})[_0x98c6('0x26')](function(){return _0x30ae66;});})[_0x98c6('0x26')](function(){_0x435b68[_0x98c6('0x1b')](0xcc)[_0x98c6('0x2b')]();});}};}function handleEntityNotFound(_0x47a3d8,_0x28608d){return function(_0x5eb382){if(!_0x5eb382){_0x47a3d8[_0x98c6('0x2c')](0x194);}return _0x5eb382;};}function handleError(_0x17b837,_0x432d4a){_0x432d4a=_0x432d4a||0x1f4;return function(_0x56a245){logger[_0x98c6('0x2d')](_0x56a245[_0x98c6('0x2e')]);if(_0x56a245[_0x98c6('0x2f')]){delete _0x56a245['name'];}_0x17b837['status'](_0x432d4a)['send'](_0x56a245);};}exports[_0x98c6('0x30')]=function(_0x3998b5,_0x4b49e7){var _0x59c38b={},_0xb0db22={},_0x4000ef={'count':0x0,'rows':[]};var _0x18b894=_[_0x98c6('0x31')](db['SquareProject']['rawAttributes'],function(_0xa9a680){return{'name':_0xa9a680['fieldName'],'type':_0xa9a680[_0x98c6('0x32')][_0x98c6('0x33')]};});_0xb0db22['model']=_[_0x98c6('0x31')](_0x18b894,_0x98c6('0x2f'));_0xb0db22['query']=_[_0x98c6('0x34')](_0x3998b5[_0x98c6('0x35')]);_0xb0db22[_0x98c6('0x36')]=_[_0x98c6('0x37')](_0xb0db22[_0x98c6('0x38')],_0xb0db22[_0x98c6('0x35')]);_0x59c38b[_0x98c6('0x39')]=_['intersection'](_0xb0db22[_0x98c6('0x38')],qs[_0x98c6('0x3a')](_0x3998b5[_0x98c6('0x35')][_0x98c6('0x3a')]));_0x59c38b[_0x98c6('0x39')]=_0x59c38b[_0x98c6('0x39')][_0x98c6('0x3b')]?_0x59c38b['attributes']:_0xb0db22[_0x98c6('0x38')];if(!_0x3998b5[_0x98c6('0x35')][_0x98c6('0x3c')](_0x98c6('0x3d'))){_0x59c38b[_0x98c6('0x1f')]=qs['limit'](_0x3998b5[_0x98c6('0x35')][_0x98c6('0x1f')]);_0x59c38b[_0x98c6('0x1d')]=qs['offset'](_0x3998b5[_0x98c6('0x35')][_0x98c6('0x1d')]);}_0x59c38b[_0x98c6('0x3e')]=qs[_0x98c6('0x3f')](_0x3998b5['query'][_0x98c6('0x3f')]);_0x59c38b['where']=qs['filters'](_[_0x98c6('0x40')](_0x3998b5['query'],_0xb0db22['filters']),_0x18b894);if(_0x3998b5['query'][_0x98c6('0x41')]){_0x59c38b[_0x98c6('0x42')]=_[_0x98c6('0x43')](_0x59c38b['where'],{'$or':_[_0x98c6('0x31')](_0x18b894,function(_0x153f10){if(_0x153f10['type']!=='VIRTUAL'){var _0x3579ce={};_0x3579ce[_0x153f10[_0x98c6('0x2f')]]={'$like':'%'+_0x3998b5['query']['filter']+'%'};return _0x3579ce;}})});}_0x59c38b=_[_0x98c6('0x43')]({},_0x59c38b,_0x3998b5[_0x98c6('0x44')]);var _0x4a5344={'where':_0x59c38b[_0x98c6('0x42')]};return db[_0x98c6('0x45')]['count'](_0x4a5344)[_0x98c6('0x26')](function(_0x23dbae){_0x4000ef['count']=_0x23dbae;if(_0x3998b5['query'][_0x98c6('0x46')]){_0x59c38b[_0x98c6('0x47')]=[{'all':!![]}];}return db[_0x98c6('0x45')][_0x98c6('0x48')](_0x59c38b);})[_0x98c6('0x26')](function(_0x9f23fe){_0x4000ef[_0x98c6('0x49')]=_0x9f23fe;return _0x4000ef;})[_0x98c6('0x26')](respondWithFilteredResult(_0x4b49e7,_0x59c38b))[_0x98c6('0x4a')](handleError(_0x4b49e7,null));};exports['show']=function(_0x18468c,_0x320ea9){var _0x356d5e={'raw':![],'where':{'id':_0x18468c[_0x98c6('0x4b')]['id']}},_0x9ddeb8={};_0x9ddeb8[_0x98c6('0x38')]=_['keys'](db[_0x98c6('0x45')][_0x98c6('0x4c')]);_0x9ddeb8['query']=_[_0x98c6('0x34')](_0x18468c[_0x98c6('0x35')]);_0x9ddeb8['filters']=_[_0x98c6('0x37')](_0x9ddeb8[_0x98c6('0x38')],_0x9ddeb8['query']);_0x356d5e['attributes']=_[_0x98c6('0x37')](_0x9ddeb8[_0x98c6('0x38')],qs[_0x98c6('0x3a')](_0x18468c[_0x98c6('0x35')][_0x98c6('0x3a')]));_0x356d5e['attributes']=_0x356d5e[_0x98c6('0x39')][_0x98c6('0x3b')]?_0x356d5e[_0x98c6('0x39')]:_0x9ddeb8[_0x98c6('0x38')];if(_0x18468c['query'][_0x98c6('0x46')]){_0x356d5e[_0x98c6('0x47')]=[{'all':!![]}];}_0x356d5e=_[_0x98c6('0x43')]({},_0x356d5e,_0x18468c[_0x98c6('0x44')]);return db['SquareProject']['find'](_0x356d5e)[_0x98c6('0x26')](handleEntityNotFound(_0x320ea9,null))[_0x98c6('0x26')](respondWithResult(_0x320ea9,null))['catch'](handleError(_0x320ea9,null));};exports[_0x98c6('0x4d')]=function(_0x186d6e,_0x172b50){return db[_0x98c6('0x45')]['create'](_0x186d6e[_0x98c6('0x4e')],{})['then'](function(_0x5d3b16){var _0x451399=_0x186d6e['user'][_0x98c6('0x28')]({'plain':!![]});if(!_0x451399)throw new Error(_0x98c6('0x4f'));if(_0x451399[_0x98c6('0x50')]===_0x98c6('0x51')){var _0x1810a4=_0x5d3b16['get']({'plain':!![]});var _0x584df6='SquareProjects';return db[_0x98c6('0x52')][_0x98c6('0x53')]({'where':{'name':_0x584df6,'userProfileId':_0x451399[_0x98c6('0x54')]},'raw':!![]})[_0x98c6('0x26')](function(_0x58ac9f){if(_0x58ac9f&&_0x58ac9f[_0x98c6('0x55')]===0x0){return db['UserProfileResource'][_0x98c6('0x4d')]({'name':_0x1810a4[_0x98c6('0x2f')],'resourceId':_0x1810a4['id'],'type':_0x58ac9f[_0x98c6('0x2f')],'sectionId':_0x58ac9f['id']},{})[_0x98c6('0x26')](function(){return _0x5d3b16;});}else{return _0x5d3b16;}})['catch'](function(_0x482658){logger[_0x98c6('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482658);throw _0x482658;});}return _0x5d3b16;})[_0x98c6('0x26')](respondWithResult(_0x172b50,0xc9))[_0x98c6('0x4a')](handleError(_0x172b50,null));};exports['update']=function(_0x2ab9d9,_0x21b207){if(_0x2ab9d9[_0x98c6('0x4e')]['id']){delete _0x2ab9d9[_0x98c6('0x4e')]['id'];}return db[_0x98c6('0x45')][_0x98c6('0x53')]({'where':{'id':_0x2ab9d9[_0x98c6('0x4b')]['id']}})[_0x98c6('0x26')](handleEntityNotFound(_0x21b207,null))[_0x98c6('0x26')](saveUpdates(_0x2ab9d9[_0x98c6('0x4e')],null))[_0x98c6('0x26')](respondWithResult(_0x21b207,null))[_0x98c6('0x4a')](handleError(_0x21b207,null));};exports['destroy']=function(_0x4bf338,_0x3cfedb){return db[_0x98c6('0x45')][_0x98c6('0x53')]({'where':{'id':_0x4bf338[_0x98c6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3cfedb,null))[_0x98c6('0x26')](removeEntity(_0x3cfedb,null))[_0x98c6('0x4a')](handleError(_0x3cfedb,null));};exports[_0x98c6('0x56')]=function(_0x47946e,_0x4a17a5,_0x191d28){return db['SquareProject'][_0x98c6('0x53')]({'where':{'id':_0x47946e['params']['id']}})[_0x98c6('0x26')](handleEntityNotFound(_0x4a17a5,null))[_0x98c6('0x26')](function(_0x30e596){if(_0x30e596){return _0x30e596[_0x98c6('0x56')](_0x47946e[_0x98c6('0x4e')]['ids'],_[_0x98c6('0x57')](_0x47946e['body'],[_0x98c6('0x58'),'id'])||{});}})[_0x98c6('0x26')](respondWithResult(_0x4a17a5,null))['catch'](handleError(_0x4a17a5,null));};exports[_0x98c6('0x59')]=function(_0x55da92,_0x49b306,_0x33a6c9){return db[_0x98c6('0x45')][_0x98c6('0x53')]({'where':{'id':_0x55da92['params']['id']}})[_0x98c6('0x26')](handleEntityNotFound(_0x49b306,null))[_0x98c6('0x26')](function(_0x2f608a){if(_0x2f608a){return _0x2f608a[_0x98c6('0x59')](_0x55da92[_0x98c6('0x35')]['ids'])[_0x98c6('0x26')](function(){if(_['isArray'](_0x55da92[_0x98c6('0x35')][_0x98c6('0x58')])){for(var _0x33db3d=0x0;_0x33db3d<_0x55da92[_0x98c6('0x35')]['ids'][_0x98c6('0x3b')];_0x33db3d+=0x1){socket['emit'](_0x98c6('0x5a'),{'UserId':Number(_0x55da92['query'][_0x98c6('0x58')][_0x33db3d]),'SquareProjectId':Number(_0x55da92[_0x98c6('0x4b')]['id'])});}}else{socket[_0x98c6('0x5b')](_0x98c6('0x5a'),{'UserId':Number(_0x55da92[_0x98c6('0x35')]['ids']),'SquareProjectId':Number(_0x55da92[_0x98c6('0x4b')]['id'])});}});}})[_0x98c6('0x26')](respondWithStatusCode(_0x49b306,null))['catch'](handleError(_0x49b306,null));};exports[_0x98c6('0x5c')]=function(_0x40003a,_0x1c3632,_0x26bd8c){var _0xafe401={};var _0x5d5721={};var _0x20c9e4;var _0x49a1de;return db[_0x98c6('0x45')][_0x98c6('0x5d')]({'where':{'id':_0x40003a[_0x98c6('0x4b')]['id']}})[_0x98c6('0x26')](handleEntityNotFound(_0x1c3632,null))[_0x98c6('0x26')](function(_0x15f2d8){if(_0x15f2d8){_0x20c9e4=_0x15f2d8;_0x5d5721[_0x98c6('0x38')]=_[_0x98c6('0x34')](db['User']['rawAttributes']);_0x5d5721[_0x98c6('0x35')]=_['keys'](_0x40003a[_0x98c6('0x35')]);_0x5d5721['filters']=_[_0x98c6('0x37')](_0x5d5721[_0x98c6('0x38')],_0x5d5721[_0x98c6('0x35')]);_0xafe401[_0x98c6('0x39')]=_[_0x98c6('0x37')](_0x5d5721['model'],qs[_0x98c6('0x3a')](_0x40003a[_0x98c6('0x35')][_0x98c6('0x3a')]));_0xafe401[_0x98c6('0x39')]=_0xafe401[_0x98c6('0x39')][_0x98c6('0x3b')]?_0xafe401['attributes']:_0x5d5721[_0x98c6('0x38')];_0xafe401[_0x98c6('0x3e')]=qs['sort'](_0x40003a[_0x98c6('0x35')][_0x98c6('0x3f')]);_0xafe401[_0x98c6('0x42')]=qs[_0x98c6('0x36')](_[_0x98c6('0x40')](_0x40003a[_0x98c6('0x35')],_0x5d5721[_0x98c6('0x36')]));if(_0x40003a[_0x98c6('0x35')]['filter']){_0xafe401[_0x98c6('0x42')]=_[_0x98c6('0x43')](_0xafe401[_0x98c6('0x42')],{'$or':_[_0x98c6('0x31')](_0xafe401['attributes'],function(_0x13f7b5){var _0x5bbb6c={};_0x5bbb6c[_0x13f7b5]={'$like':'%'+_0x40003a['query']['filter']+'%'};return _0x5bbb6c;})});}_0xafe401=_[_0x98c6('0x43')]({},_0xafe401,_0x40003a['options']);return _0x20c9e4[_0x98c6('0x5c')](_0xafe401);}})[_0x98c6('0x26')](function(_0x1ba3d2){if(_0x1ba3d2){_0x49a1de=_0x1ba3d2['length'];if(!_0x40003a[_0x98c6('0x35')][_0x98c6('0x3c')](_0x98c6('0x3d'))){_0xafe401[_0x98c6('0x1f')]=qs[_0x98c6('0x1f')](_0x40003a[_0x98c6('0x35')][_0x98c6('0x1f')]);_0xafe401[_0x98c6('0x1d')]=qs['offset'](_0x40003a[_0x98c6('0x35')]['offset']);}return _0x20c9e4['getUsers'](_0xafe401);}})[_0x98c6('0x26')](function(_0x54f966){if(_0x54f966){return _0x54f966?{'count':_0x49a1de,'rows':_0x54f966}:null;}})[_0x98c6('0x26')](respondWithResult(_0x1c3632,null))['catch'](handleError(_0x1c3632,null));};
\ No newline at end of file
+var _0x457d=['desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','get','SquareProjects','end','error','name','send','index','SquareProject','fieldName','type','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','length','merge','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1aaa52,_0x442418){var _0x1a3b6a=function(_0x4a168a){while(--_0x4a168a){_0x1aaa52['push'](_0x1aaa52['shift']());}};_0x1a3b6a(++_0x442418);}(_0x457d,0x169));var _0xd457=function(_0x1b29b2,_0x3b6b11){_0x1b29b2=_0x1b29b2-0x0;var _0x560b68=_0x457d[_0x1b29b2];return _0x560b68;};'use strict';var emlformat=require(_0xd457('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd457('0x1'));var jsonpatch=require(_0xd457('0x2'));var rp=require('request-promise');var moment=require(_0xd457('0x3'));var BPromise=require(_0xd457('0x4'));var Mustache=require(_0xd457('0x5'));var util=require(_0xd457('0x6'));var path=require(_0xd457('0x7'));var sox=require('sox');var csv=require(_0xd457('0x8'));var ejs=require(_0xd457('0x9'));var fs=require('fs');var fs_extra=require(_0xd457('0xa'));var _=require(_0xd457('0xb'));var squel=require(_0xd457('0xc'));var crypto=require(_0xd457('0xd'));var jsforce=require(_0xd457('0xe'));var deskjs=require(_0xd457('0xf'));var toCsv=require(_0xd457('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd457('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd457('0x11'));var as=require(_0xd457('0x12'));var hardwareService=require(_0xd457('0x13'));var logger=require('../../config/logger')(_0xd457('0x14'));var utils=require(_0xd457('0x15'));var config=require(_0xd457('0x16'));var licenseUtil=require(_0xd457('0x17'));var db=require('../../mysqldb')['db'];config[_0xd457('0x18')]=_[_0xd457('0x19')](config[_0xd457('0x18')],{'host':_0xd457('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd457('0x18')]));require(_0xd457('0x1b'))[_0xd457('0x1c')](socket);function respondWithStatusCode(_0x5c82db,_0x4f2ee6){_0x4f2ee6=_0x4f2ee6||0xcc;return function(_0x1d0d09){if(_0x1d0d09){return _0x5c82db[_0xd457('0x1d')](_0x4f2ee6);}return _0x5c82db[_0xd457('0x1e')](_0x4f2ee6)['end']();};}function respondWithResult(_0x31110e,_0x274b04){_0x274b04=_0x274b04||0xc8;return function(_0x313218){if(_0x313218){return _0x31110e['status'](_0x274b04)[_0xd457('0x1f')](_0x313218);}};}function respondWithFilteredResult(_0x657b12,_0x2ec95d){return function(_0x43fac3){if(_0x43fac3){var _0x28fd6f=typeof _0x2ec95d['offset']===_0xd457('0x20')&&typeof _0x2ec95d[_0xd457('0x21')]===_0xd457('0x20');var _0x1fac9f=_0x43fac3[_0xd457('0x22')];var _0x127359=_0x28fd6f?0x0:_0x2ec95d[_0xd457('0x23')];var _0x2db5a1=_0x28fd6f?_0x43fac3[_0xd457('0x22')]:_0x2ec95d['offset']+_0x2ec95d['limit'];var _0x22a120;if(_0x2db5a1>=_0x1fac9f){_0x2db5a1=_0x1fac9f;_0x22a120=0xc8;}else{_0x22a120=0xce;}_0x657b12[_0xd457('0x1e')](_0x22a120);return _0x657b12[_0xd457('0x24')](_0xd457('0x25'),_0x127359+'-'+_0x2db5a1+'/'+_0x1fac9f)[_0xd457('0x1f')](_0x43fac3);}return null;};}function patchUpdates(_0x30df2a){return function(_0x3fc8d1){try{jsonpatch[_0xd457('0x26')](_0x3fc8d1,_0x30df2a,!![]);}catch(_0xfecb8e){return BPromise['reject'](_0xfecb8e);}return _0x3fc8d1['save']();};}function saveUpdates(_0x3c21bd,_0x5891f0){return function(_0x1c90bd){if(_0x1c90bd){return _0x1c90bd['update'](_0x3c21bd)[_0xd457('0x27')](function(_0x761afc){return _0x761afc;});}return null;};}function removeEntity(_0x3812cc,_0x3972fb){return function(_0x25c955){if(_0x25c955){return _0x25c955[_0xd457('0x28')]()['then'](function(){var _0xf5304b=_0x25c955[_0xd457('0x29')]({'plain':!![]});var _0x3f1eb2=_0xd457('0x2a');return db['UserProfileResource'][_0xd457('0x28')]({'where':{'type':_0x3f1eb2,'resourceId':_0xf5304b['id']}})[_0xd457('0x27')](function(){return _0x25c955;});})[_0xd457('0x27')](function(){_0x3812cc[_0xd457('0x1e')](0xcc)[_0xd457('0x2b')]();});}};}function handleEntityNotFound(_0x11096e,_0xa76655){return function(_0x398978){if(!_0x398978){_0x11096e[_0xd457('0x1d')](0x194);}return _0x398978;};}function handleError(_0x1fcf51,_0x4b80c4){_0x4b80c4=_0x4b80c4||0x1f4;return function(_0x52b5ad){logger[_0xd457('0x2c')](_0x52b5ad['stack']);if(_0x52b5ad[_0xd457('0x2d')]){delete _0x52b5ad[_0xd457('0x2d')];}_0x1fcf51[_0xd457('0x1e')](_0x4b80c4)[_0xd457('0x2e')](_0x52b5ad);};}exports[_0xd457('0x2f')]=function(_0x43104b,_0x253df5){var _0x12e8f4={},_0x292813={},_0x164400={'count':0x0,'rows':[]};var _0x3c3dc6=_['map'](db[_0xd457('0x30')]['rawAttributes'],function(_0x3a8826){return{'name':_0x3a8826[_0xd457('0x31')],'type':_0x3a8826[_0xd457('0x32')]['key']};});_0x292813[_0xd457('0x33')]=_[_0xd457('0x34')](_0x3c3dc6,_0xd457('0x2d'));_0x292813['query']=_[_0xd457('0x35')](_0x43104b[_0xd457('0x36')]);_0x292813['filters']=_[_0xd457('0x37')](_0x292813[_0xd457('0x33')],_0x292813[_0xd457('0x36')]);_0x12e8f4[_0xd457('0x38')]=_[_0xd457('0x37')](_0x292813[_0xd457('0x33')],qs['fields'](_0x43104b[_0xd457('0x36')][_0xd457('0x39')]));_0x12e8f4[_0xd457('0x38')]=_0x12e8f4['attributes']['length']?_0x12e8f4['attributes']:_0x292813['model'];if(!_0x43104b[_0xd457('0x36')][_0xd457('0x3a')](_0xd457('0x3b'))){_0x12e8f4[_0xd457('0x21')]=qs['limit'](_0x43104b[_0xd457('0x36')][_0xd457('0x21')]);_0x12e8f4[_0xd457('0x23')]=qs[_0xd457('0x23')](_0x43104b[_0xd457('0x36')]['offset']);}_0x12e8f4[_0xd457('0x3c')]=qs['sort'](_0x43104b[_0xd457('0x36')][_0xd457('0x3d')]);_0x12e8f4[_0xd457('0x3e')]=qs[_0xd457('0x3f')](_['pick'](_0x43104b[_0xd457('0x36')],_0x292813[_0xd457('0x3f')]),_0x3c3dc6);if(_0x43104b['query'][_0xd457('0x40')]){_0x12e8f4[_0xd457('0x3e')]=_['merge'](_0x12e8f4[_0xd457('0x3e')],{'$or':_['map'](_0x3c3dc6,function(_0xb495a3){if(_0xb495a3[_0xd457('0x32')]!==_0xd457('0x41')){var _0x342729={};_0x342729[_0xb495a3[_0xd457('0x2d')]]={'$like':'%'+_0x43104b['query'][_0xd457('0x40')]+'%'};return _0x342729;}})});}_0x12e8f4=_['merge']({},_0x12e8f4,_0x43104b['options']);var _0x6e980f={'where':_0x12e8f4[_0xd457('0x3e')]};return db[_0xd457('0x30')][_0xd457('0x22')](_0x6e980f)['then'](function(_0x38c5c5){_0x164400[_0xd457('0x22')]=_0x38c5c5;if(_0x43104b[_0xd457('0x36')][_0xd457('0x42')]){_0x12e8f4[_0xd457('0x43')]=[{'all':!![]}];}return db[_0xd457('0x30')][_0xd457('0x44')](_0x12e8f4);})[_0xd457('0x27')](function(_0x438bef){_0x164400['rows']=_0x438bef;return _0x164400;})[_0xd457('0x27')](respondWithFilteredResult(_0x253df5,_0x12e8f4))[_0xd457('0x45')](handleError(_0x253df5,null));};exports[_0xd457('0x46')]=function(_0x1306c1,_0x5e6dad){var _0x1f5d5d={'raw':![],'where':{'id':_0x1306c1[_0xd457('0x47')]['id']}},_0x361394={};_0x361394['model']=_[_0xd457('0x35')](db[_0xd457('0x30')][_0xd457('0x48')]);_0x361394[_0xd457('0x36')]=_['keys'](_0x1306c1['query']);_0x361394['filters']=_[_0xd457('0x37')](_0x361394[_0xd457('0x33')],_0x361394[_0xd457('0x36')]);_0x1f5d5d[_0xd457('0x38')]=_[_0xd457('0x37')](_0x361394[_0xd457('0x33')],qs['fields'](_0x1306c1[_0xd457('0x36')]['fields']));_0x1f5d5d[_0xd457('0x38')]=_0x1f5d5d[_0xd457('0x38')][_0xd457('0x49')]?_0x1f5d5d[_0xd457('0x38')]:_0x361394[_0xd457('0x33')];if(_0x1306c1[_0xd457('0x36')][_0xd457('0x42')]){_0x1f5d5d[_0xd457('0x43')]=[{'all':!![]}];}_0x1f5d5d=_[_0xd457('0x4a')]({},_0x1f5d5d,_0x1306c1[_0xd457('0x4b')]);return db['SquareProject'][_0xd457('0x4c')](_0x1f5d5d)[_0xd457('0x27')](handleEntityNotFound(_0x5e6dad,null))[_0xd457('0x27')](respondWithResult(_0x5e6dad,null))[_0xd457('0x45')](handleError(_0x5e6dad,null));};exports[_0xd457('0x4d')]=function(_0x487b19,_0x5f3fdb){return db[_0xd457('0x30')][_0xd457('0x4d')](_0x487b19[_0xd457('0x4e')],{})[_0xd457('0x27')](function(_0x57fe85){var _0x9f60f9=_0x487b19[_0xd457('0x4f')]['get']({'plain':!![]});if(!_0x9f60f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9f60f9['role']===_0xd457('0x4f')){var _0x5d76e4=_0x57fe85[_0xd457('0x29')]({'plain':!![]});var _0x5ad9d3=_0xd457('0x2a');return db[_0xd457('0x50')][_0xd457('0x4c')]({'where':{'name':_0x5ad9d3,'userProfileId':_0x9f60f9[_0xd457('0x51')]},'raw':!![]})[_0xd457('0x27')](function(_0x16230d){if(_0x16230d&&_0x16230d[_0xd457('0x52')]===0x0){return db[_0xd457('0x53')][_0xd457('0x4d')]({'name':_0x5d76e4[_0xd457('0x2d')],'resourceId':_0x5d76e4['id'],'type':_0x16230d[_0xd457('0x2d')],'sectionId':_0x16230d['id']},{})['then'](function(){return _0x57fe85;});}else{return _0x57fe85;}})[_0xd457('0x45')](function(_0x3ccb15){logger[_0xd457('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ccb15);throw _0x3ccb15;});}return _0x57fe85;})[_0xd457('0x27')](respondWithResult(_0x5f3fdb,0xc9))['catch'](handleError(_0x5f3fdb,null));};exports[_0xd457('0x54')]=function(_0xd0d407,_0x201fbc){if(_0xd0d407[_0xd457('0x4e')]['id']){delete _0xd0d407[_0xd457('0x4e')]['id'];}return db[_0xd457('0x30')]['find']({'where':{'id':_0xd0d407['params']['id']}})[_0xd457('0x27')](handleEntityNotFound(_0x201fbc,null))['then'](saveUpdates(_0xd0d407[_0xd457('0x4e')],null))[_0xd457('0x27')](respondWithResult(_0x201fbc,null))[_0xd457('0x45')](handleError(_0x201fbc,null));};exports[_0xd457('0x28')]=function(_0x1c4d96,_0x3b0a81){return db[_0xd457('0x30')][_0xd457('0x4c')]({'where':{'id':_0x1c4d96[_0xd457('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b0a81,null))[_0xd457('0x27')](removeEntity(_0x3b0a81,null))[_0xd457('0x45')](handleError(_0x3b0a81,null));};exports[_0xd457('0x55')]=function(_0x4acd22,_0x2e9bbf,_0x5d640e){return db[_0xd457('0x30')][_0xd457('0x4c')]({'where':{'id':_0x4acd22[_0xd457('0x47')]['id']}})[_0xd457('0x27')](handleEntityNotFound(_0x2e9bbf,null))['then'](function(_0x5957d9){if(_0x5957d9){return _0x5957d9['addUsers'](_0x4acd22[_0xd457('0x4e')][_0xd457('0x56')],_[_0xd457('0x57')](_0x4acd22[_0xd457('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x2e9bbf,null))['catch'](handleError(_0x2e9bbf,null));};exports['removeUsers']=function(_0x1f11ab,_0x40caf2,_0x409c93){return db[_0xd457('0x30')][_0xd457('0x4c')]({'where':{'id':_0x1f11ab[_0xd457('0x47')]['id']}})[_0xd457('0x27')](handleEntityNotFound(_0x40caf2,null))[_0xd457('0x27')](function(_0x315f58){if(_0x315f58){return _0x315f58[_0xd457('0x58')](_0x1f11ab[_0xd457('0x36')][_0xd457('0x56')])['then'](function(){if(_['isArray'](_0x1f11ab[_0xd457('0x36')][_0xd457('0x56')])){for(var _0x58e217=0x0;_0x58e217<_0x1f11ab['query'][_0xd457('0x56')][_0xd457('0x49')];_0x58e217+=0x1){socket[_0xd457('0x59')](_0xd457('0x5a'),{'UserId':Number(_0x1f11ab['query'][_0xd457('0x56')][_0x58e217]),'SquareProjectId':Number(_0x1f11ab[_0xd457('0x47')]['id'])});}}else{socket[_0xd457('0x59')]('userSquareProject:remove',{'UserId':Number(_0x1f11ab['query']['ids']),'SquareProjectId':Number(_0x1f11ab['params']['id'])});}});}})['then'](respondWithStatusCode(_0x40caf2,null))[_0xd457('0x45')](handleError(_0x40caf2,null));};exports[_0xd457('0x5b')]=function(_0x4b7a61,_0x1fc634,_0x1d89c7){var _0x3ec4e8={};var _0x57056e={};var _0x4e2e5a;var _0x9950c7;return db[_0xd457('0x30')][_0xd457('0x5c')]({'where':{'id':_0x4b7a61['params']['id']}})[_0xd457('0x27')](handleEntityNotFound(_0x1fc634,null))[_0xd457('0x27')](function(_0x3fc10c){if(_0x3fc10c){_0x4e2e5a=_0x3fc10c;_0x57056e[_0xd457('0x33')]=_[_0xd457('0x35')](db[_0xd457('0x5d')][_0xd457('0x48')]);_0x57056e[_0xd457('0x36')]=_[_0xd457('0x35')](_0x4b7a61[_0xd457('0x36')]);_0x57056e[_0xd457('0x3f')]=_[_0xd457('0x37')](_0x57056e[_0xd457('0x33')],_0x57056e[_0xd457('0x36')]);_0x3ec4e8[_0xd457('0x38')]=_[_0xd457('0x37')](_0x57056e[_0xd457('0x33')],qs[_0xd457('0x39')](_0x4b7a61[_0xd457('0x36')]['fields']));_0x3ec4e8['attributes']=_0x3ec4e8['attributes']['length']?_0x3ec4e8[_0xd457('0x38')]:_0x57056e[_0xd457('0x33')];_0x3ec4e8[_0xd457('0x3c')]=qs['sort'](_0x4b7a61['query']['sort']);_0x3ec4e8[_0xd457('0x3e')]=qs[_0xd457('0x3f')](_['pick'](_0x4b7a61[_0xd457('0x36')],_0x57056e['filters']));if(_0x4b7a61[_0xd457('0x36')][_0xd457('0x40')]){_0x3ec4e8[_0xd457('0x3e')]=_[_0xd457('0x4a')](_0x3ec4e8[_0xd457('0x3e')],{'$or':_[_0xd457('0x34')](_0x3ec4e8[_0xd457('0x38')],function(_0x1fd2a2){var _0xcf5af4={};_0xcf5af4[_0x1fd2a2]={'$like':'%'+_0x4b7a61[_0xd457('0x36')]['filter']+'%'};return _0xcf5af4;})});}_0x3ec4e8=_['merge']({},_0x3ec4e8,_0x4b7a61[_0xd457('0x4b')]);return _0x4e2e5a[_0xd457('0x5b')](_0x3ec4e8);}})[_0xd457('0x27')](function(_0x1c2dae){if(_0x1c2dae){_0x9950c7=_0x1c2dae[_0xd457('0x49')];if(!_0x4b7a61[_0xd457('0x36')]['hasOwnProperty'](_0xd457('0x3b'))){_0x3ec4e8[_0xd457('0x21')]=qs[_0xd457('0x21')](_0x4b7a61[_0xd457('0x36')][_0xd457('0x21')]);_0x3ec4e8[_0xd457('0x23')]=qs[_0xd457('0x23')](_0x4b7a61[_0xd457('0x36')][_0xd457('0x23')]);}return _0x4e2e5a[_0xd457('0x5b')](_0x3ec4e8);}})[_0xd457('0x27')](function(_0x38b832){if(_0x38b832){return _0x38b832?{'count':_0x9950c7,'rows':_0x38b832}:null;}})[_0xd457('0x27')](respondWithResult(_0x1fc634,null))[_0xd457('0x45')](handleError(_0x1fc634,null));};
\ No newline at end of file
index 91dca78..c02ff30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc34=['update','remove','emit','exports','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0xdc34,0x15a));var _0x4dc3=function(_0x4848f6,_0x2657ba){_0x4848f6=_0x4848f6-0x0;var _0x1554aa=_0xdc34[_0x4848f6];return _0x1554aa;};'use strict';var EventEmitter=require(_0x4dc3('0x0'));var SquareProject=require(_0x4dc3('0x1'))['db'][_0x4dc3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x4dc3('0x3')](0x0);var events={'afterCreate':_0x4dc3('0x4'),'afterUpdate':_0x4dc3('0x5'),'afterDestroy':_0x4dc3('0x6')};function emitEvent(_0x241245){return function(_0xa11e1c,_0x11aa0c,_0x48c12b){SquareProjectEvents[_0x4dc3('0x7')](_0x241245+':'+_0xa11e1c['id'],_0xa11e1c);SquareProjectEvents['emit'](_0x241245,_0xa11e1c);_0x48c12b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x4dc3('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0xa296=['hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x3fdaf5,_0x19e0d5){var _0x592d3f=function(_0x580c81){while(--_0x580c81){_0x3fdaf5['push'](_0x3fdaf5['shift']());}};_0x592d3f(++_0x19e0d5);}(_0xa296,0xca));var _0x6a29=function(_0x2fe0a5,_0x4f67b9){_0x2fe0a5=_0x2fe0a5-0x0;var _0x3acbcc=_0xa296[_0x2fe0a5];return _0x3acbcc;};'use strict';var EventEmitter=require(_0x6a29('0x0'));var SquareProject=require(_0x6a29('0x1'))['db'][_0x6a29('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6a29('0x3')](0x0);var events={'afterCreate':_0x6a29('0x4'),'afterUpdate':_0x6a29('0x5'),'afterDestroy':_0x6a29('0x6')};function emitEvent(_0x5addf9){return function(_0x264142,_0x564796,_0x1315bc){SquareProjectEvents[_0x6a29('0x7')](_0x5addf9+':'+_0x264142['id'],_0x264142);SquareProjectEvents[_0x6a29('0x7')](_0x5addf9,_0x264142);_0x1315bc(null);};}for(var e in events){if(events[_0x6a29('0x8')](e)){var event=events[e];SquareProject[_0x6a29('0x9')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
index 5b030cd..02398b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb33f=['SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','rimraf','./squareProject.attributes','exports'];(function(_0x19b9d1,_0x4f603f){var _0x1ca4f7=function(_0x2d1ea7){while(--_0x2d1ea7){_0x19b9d1['push'](_0x19b9d1['shift']());}};_0x1ca4f7(++_0x4f603f);}(_0xb33f,0xad));var _0xfb33=function(_0x54afc3,_0x14764b){_0x54afc3=_0x54afc3-0x0;var _0x578747=_0xb33f[_0x54afc3];return _0x578747;};'use strict';var _=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var logger=require(_0xfb33('0x2'))(_0xfb33('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(_0xfb33('0x4'));var config=require('../../config/environment');var attributes=require(_0xfb33('0x5'));module[_0xfb33('0x6')]=function(_0x1491dd,_0x38d16e){return _0x1491dd['define'](_0xfb33('0x7'),attributes,{'tableName':_0xfb33('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ff4ac,_0x313fcf,_0x52d1b7){if(_0x1ff4ac[_0xfb33('0x9')](_0xfb33('0xa'))){_0x1ff4ac[_0xfb33('0xb')]=moment()[_0xfb33('0xc')](_0xfb33('0xd'));}if(_0x1ff4ac[_0xfb33('0x9')](_0xfb33('0xe'))){_0x1ff4ac['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x52d1b7(null,_0x1ff4ac);}}});};
\ No newline at end of file
+var _0x78b2=['./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x484481,_0xbbb427){var _0x4de480=function(_0x45aee4){while(--_0x45aee4){_0x484481['push'](_0x484481['shift']());}};_0x4de480(++_0xbbb427);}(_0x78b2,0xe8));var _0x278b=function(_0x13eea8,_0x4ef496){_0x13eea8=_0x13eea8-0x0;var _0x243d32=_0x78b2[_0x13eea8];return _0x243d32;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var logger=require(_0x278b('0x2'))('api');var moment=require(_0x278b('0x3'));var BPromise=require(_0x278b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x278b('0x5'));var attributes=require(_0x278b('0x6'));module[_0x278b('0x7')]=function(_0x24dc88,_0x567c10){return _0x24dc88[_0x278b('0x8')](_0x278b('0x9'),attributes,{'tableName':_0x278b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8ce5ee,_0x478c92,_0x2469e3){if(_0x8ce5ee[_0x278b('0xb')]('preproduction')){_0x8ce5ee[_0x278b('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x8ce5ee[_0x278b('0xb')](_0x278b('0xd'))){_0x8ce5ee[_0x278b('0xe')]=moment()[_0x278b('0xf')](_0x278b('0x10'));}_0x2469e3(null,_0x8ce5ee);}}});};
\ No newline at end of file
index f1c1fc5..5c104af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89a0=['defaults','localhost','socket.io-emitter','./squareProject.socket','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','map','attributes','model','then','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2a2b31,_0x15ff14){var _0x53b872=function(_0x291f6d){while(--_0x291f6d){_0x2a2b31['push'](_0x2a2b31['shift']());}};_0x53b872(++_0x15ff14);}(_0x89a0,0xa4));var _0x089a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89a0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x089a('0x0'));var util=require('util');var moment=require(_0x089a('0x1'));var BPromise=require(_0x089a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x089a('0x3'));var logger=require(_0x089a('0x4'))(_0x089a('0x5'));var config=require(_0x089a('0x6'));var jayson=require(_0x089a('0x7'));var client=jayson[_0x089a('0x8')][_0x089a('0x9')]({'port':0x232a});config[_0x089a('0xa')]=_[_0x089a('0xb')](config[_0x089a('0xa')],{'host':_0x089a('0xc'),'port':0x18eb});var socket=require(_0x089a('0xd'))(new Redis(config[_0x089a('0xa')]));require(_0x089a('0xe'))['register'](socket);function respondWithRpcPromise(_0x862105,_0xc72e02,_0x3e2203){return new BPromise(function(_0x1fa508,_0x4b0abe){return client['request'](_0x862105,_0x3e2203)['then'](function(_0x2fd54a){logger['info'](_0x089a('0xf'),_0xc72e02,_0x089a('0x10'));logger[_0x089a('0x11')](_0x089a('0x12'),_0xc72e02,_0x089a('0x10'),JSON[_0x089a('0x13')](_0x2fd54a));if(_0x2fd54a[_0x089a('0x14')]){if(_0x2fd54a[_0x089a('0x14')][_0x089a('0x15')]===0x1f4){logger[_0x089a('0x14')]('SquareProject,\x20%s,\x20%s',_0xc72e02,_0x2fd54a['error']['message']);return _0x4b0abe(_0x2fd54a[_0x089a('0x14')][_0x089a('0x16')]);}logger[_0x089a('0x14')](_0x089a('0xf'),_0xc72e02,_0x2fd54a['error']['message']);return _0x1fa508(_0x2fd54a['error']['message']);}else{logger['info'](_0x089a('0xf'),_0xc72e02,_0x089a('0x10'));_0x1fa508(_0x2fd54a['result'][_0x089a('0x16')]);}})[_0x089a('0x17')](function(_0x26e49b){logger['error'](_0x089a('0xf'),_0xc72e02,_0x26e49b);_0x4b0abe(_0x26e49b);});});}exports[_0x089a('0x18')]=function(_0x408c79){var _0x2ee6cd=this;return new Promise(function(_0x59498f,_0x25df36){return db[_0x089a('0x19')][_0x089a('0x1a')]({'raw':_0x408c79['options']?_0x408c79[_0x089a('0x1b')][_0x089a('0x1c')]===undefined?!![]:![]:!![],'where':_0x408c79[_0x089a('0x1b')]?_0x408c79[_0x089a('0x1b')][_0x089a('0x1d')]||null:null,'attributes':_0x408c79[_0x089a('0x1b')]?_0x408c79[_0x089a('0x1b')]['attributes']||null:null,'include':_0x408c79[_0x089a('0x1b')]?_0x408c79[_0x089a('0x1b')][_0x089a('0x1e')]?_[_0x089a('0x1f')](_0x408c79['options'][_0x089a('0x1e')],function(_0x2d5b97){return{'model':db[_0x2d5b97['model']],'as':_0x2d5b97['as'],'attributes':_0x2d5b97[_0x089a('0x20')],'include':_0x2d5b97[_0x089a('0x1e')]?_[_0x089a('0x1f')](_0x2d5b97['include'],function(_0x467664){return{'model':db[_0x467664[_0x089a('0x21')]],'as':_0x467664['as'],'attributes':_0x467664[_0x089a('0x20')],'include':_0x467664['include']?_[_0x089a('0x1f')](_0x467664[_0x089a('0x1e')],function(_0x26d09c){return{'model':db[_0x26d09c[_0x089a('0x21')]],'as':_0x26d09c['as'],'attributes':_0x26d09c['attributes']};}):[]};}):[]};}):[]:[]})[_0x089a('0x22')](function(_0x5b9c33){logger['info'](_0x089a('0x18'),_0x408c79);logger[_0x089a('0x11')](_0x089a('0x18'),_0x408c79,JSON[_0x089a('0x13')](_0x5b9c33));_0x59498f(_0x5b9c33);})[_0x089a('0x17')](function(_0x23afdb){logger[_0x089a('0x14')](_0x089a('0x18'),_0x23afdb[_0x089a('0x16')],_0x408c79);_0x25df36(_0x2ee6cd['error'](0x1f4,_0x23afdb[_0x089a('0x16')]));});});};
\ No newline at end of file
+var _0x6cc5=['map','model','info','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','catch','ShowSquareProject','find','options','raw','where','attributes','include'];(function(_0xfcc5be,_0x3f6c94){var _0x547d20=function(_0x56388c){while(--_0x56388c){_0xfcc5be['push'](_0xfcc5be['shift']());}};_0x547d20(++_0x3f6c94);}(_0x6cc5,0x1df));var _0x56cc=function(_0x21cecd,_0x36b404){_0x21cecd=_0x21cecd-0x0;var _0xe1fd53=_0x6cc5[_0x21cecd];return _0xe1fd53;};'use strict';var _=require(_0x56cc('0x0'));var util=require(_0x56cc('0x1'));var moment=require(_0x56cc('0x2'));var BPromise=require('bluebird');var rs=require(_0x56cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56cc('0x4'))['db'];var utils=require(_0x56cc('0x5'));var logger=require(_0x56cc('0x6'))(_0x56cc('0x7'));var config=require('../../config/environment');var jayson=require(_0x56cc('0x8'));var client=jayson['client'][_0x56cc('0x9')]({'port':0x232a});config[_0x56cc('0xa')]=_[_0x56cc('0xb')](config['redis'],{'host':_0x56cc('0xc'),'port':0x18eb});var socket=require(_0x56cc('0xd'))(new Redis(config[_0x56cc('0xa')]));require('./squareProject.socket')[_0x56cc('0xe')](socket);function respondWithRpcPromise(_0x2c9661,_0x4a42a1,_0x355769){return new BPromise(function(_0xea9a79,_0x450632){return client['request'](_0x2c9661,_0x355769)[_0x56cc('0xf')](function(_0x25a106){logger['info']('SquareProject,\x20%s,\x20%s',_0x4a42a1,_0x56cc('0x10'));logger[_0x56cc('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x4a42a1,'request\x20sent',JSON[_0x56cc('0x12')](_0x25a106));if(_0x25a106[_0x56cc('0x13')]){if(_0x25a106['error'][_0x56cc('0x14')]===0x1f4){logger['error'](_0x56cc('0x15'),_0x4a42a1,_0x25a106[_0x56cc('0x13')][_0x56cc('0x16')]);return _0x450632(_0x25a106[_0x56cc('0x13')][_0x56cc('0x16')]);}logger[_0x56cc('0x13')]('SquareProject,\x20%s,\x20%s',_0x4a42a1,_0x25a106[_0x56cc('0x13')][_0x56cc('0x16')]);return _0xea9a79(_0x25a106[_0x56cc('0x13')][_0x56cc('0x16')]);}else{logger['info'](_0x56cc('0x15'),_0x4a42a1,_0x56cc('0x10'));_0xea9a79(_0x25a106['result']['message']);}})[_0x56cc('0x17')](function(_0x3210a3){logger[_0x56cc('0x13')](_0x56cc('0x15'),_0x4a42a1,_0x3210a3);_0x450632(_0x3210a3);});});}exports[_0x56cc('0x18')]=function(_0x13aab7){var _0x12f689=this;return new Promise(function(_0x50a12b,_0x57e45b){return db['SquareProject'][_0x56cc('0x19')]({'raw':_0x13aab7['options']?_0x13aab7[_0x56cc('0x1a')][_0x56cc('0x1b')]===undefined?!![]:![]:!![],'where':_0x13aab7[_0x56cc('0x1a')]?_0x13aab7[_0x56cc('0x1a')][_0x56cc('0x1c')]||null:null,'attributes':_0x13aab7['options']?_0x13aab7[_0x56cc('0x1a')][_0x56cc('0x1d')]||null:null,'include':_0x13aab7[_0x56cc('0x1a')]?_0x13aab7[_0x56cc('0x1a')][_0x56cc('0x1e')]?_[_0x56cc('0x1f')](_0x13aab7[_0x56cc('0x1a')][_0x56cc('0x1e')],function(_0x28149f){return{'model':db[_0x28149f['model']],'as':_0x28149f['as'],'attributes':_0x28149f[_0x56cc('0x1d')],'include':_0x28149f['include']?_[_0x56cc('0x1f')](_0x28149f[_0x56cc('0x1e')],function(_0x42a674){return{'model':db[_0x42a674['model']],'as':_0x42a674['as'],'attributes':_0x42a674[_0x56cc('0x1d')],'include':_0x42a674[_0x56cc('0x1e')]?_['map'](_0x42a674[_0x56cc('0x1e')],function(_0x594198){return{'model':db[_0x594198[_0x56cc('0x20')]],'as':_0x594198['as'],'attributes':_0x594198['attributes']};}):[]};}):[]};}):[]:[]})[_0x56cc('0xf')](function(_0x5a9585){logger[_0x56cc('0x21')](_0x56cc('0x18'),_0x13aab7);logger[_0x56cc('0x11')](_0x56cc('0x18'),_0x13aab7,JSON[_0x56cc('0x12')](_0x5a9585));_0x50a12b(_0x5a9585);})[_0x56cc('0x17')](function(_0x54c98a){logger[_0x56cc('0x13')](_0x56cc('0x18'),_0x54c98a['message'],_0x13aab7);_0x57e45b(_0x12f689[_0x56cc('0x13')](0x1f4,_0x54c98a[_0x56cc('0x16')]));});});};
\ No newline at end of file
index d102ce6..8e1e711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fb7=['./squareProject.events','save','update','emit','removeListener','register','length'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5fb7,0x85));var _0x75fb=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5fb7[_0x344a3f];return _0x264712;};'use strict';var SquareProjectEvents=require(_0x75fb('0x0'));var events=[_0x75fb('0x1'),'remove',_0x75fb('0x2')];function createListener(_0x5c07f7,_0x10206e){return function(_0x1a12ef){_0x10206e[_0x75fb('0x3')](_0x5c07f7,_0x1a12ef);};}function removeListener(_0x517199,_0x2cc18f){return function(){SquareProjectEvents[_0x75fb('0x4')](_0x517199,_0x2cc18f);};}exports[_0x75fb('0x5')]=function(_0x43900a){for(var _0x1f5819=0x0,_0x2459bf=events[_0x75fb('0x6')];_0x1f5819<_0x2459bf;_0x1f5819++){var _0x2d425f=events[_0x1f5819];var _0x22e260=createListener('squareProject:'+_0x2d425f,_0x43900a);SquareProjectEvents['on'](_0x2d425f,_0x22e260);}};
\ No newline at end of file
+var _0xd51a=['update','register','length','squareProject:'];(function(_0x286c33,_0x4ba29b){var _0x447b00=function(_0x2ebadd){while(--_0x2ebadd){_0x286c33['push'](_0x286c33['shift']());}};_0x447b00(++_0x4ba29b);}(_0xd51a,0x158));var _0xad51=function(_0x419b41,_0x3eaa93){_0x419b41=_0x419b41-0x0;var _0x19c319=_0xd51a[_0x419b41];return _0x19c319;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0xad51('0x0')];function createListener(_0x7aafc8,_0x19d815){return function(_0x100b51){_0x19d815['emit'](_0x7aafc8,_0x100b51);};}function removeListener(_0x324081,_0x49f37a){return function(){SquareProjectEvents['removeListener'](_0x324081,_0x49f37a);};}exports[_0xad51('0x1')]=function(_0xdf6b75){for(var _0x20dcfd=0x0,_0x5f471e=events[_0xad51('0x2')];_0x20dcfd<_0x5f471e;_0x20dcfd++){var _0x3539aa=events[_0x20dcfd];var _0xe49ff9=createListener(_0xad51('0x3')+_0x3539aa,_0xdf6b75);SquareProjectEvents['on'](_0x3539aa,_0xe49ff9);}};
\ No newline at end of file
index 378871b..a18679f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x35e388,_0x4e8612){var _0x13fb2a=function(_0x3bfdbd){while(--_0x3bfdbd){_0x35e388['push'](_0x35e388['shift']());}};_0x13fb2a(++_0x4e8612);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4eff93,_0x341f39){_0x4eff93=_0x4eff93-0x0;var _0x15abbf=_0x1cb9[_0x4eff93];return _0x15abbf;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router;
\ No newline at end of file
+var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41471a,_0x2d6104){var _0x547846=function(_0x57388c){while(--_0x57388c){_0x41471a['push'](_0x41471a['shift']());}};_0x547846(++_0x2d6104);}(_0xf494,0x1c6));var _0x4f49=function(_0xdf0d53,_0x50032d){_0xdf0d53=_0xdf0d53-0x0;var _0x2945b7=_0xf494[_0xdf0d53];return _0x2945b7;};'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')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router;
\ No newline at end of file
index c2397c9..de95648 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2bd8,0x130));var _0x82bd=function(_0x3133bf,_0x517ae3){_0x3133bf=_0x3133bf-0x0;var _0x5a5692=_0x2bd8[_0x3133bf];return _0x5a5692;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}};
\ No newline at end of file
+var _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x138c85,_0x4c3dac){var _0x56d08b=function(_0x28b9e0){while(--_0x28b9e0){_0x138c85['push'](_0x138c85['shift']());}};_0x56d08b(++_0x4c3dac);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}};
\ No newline at end of file
index 9426a34..88278a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0240=['rows','catch','show','params','rawAttributes','create','body','update','find','download','uniqueid','savePath','filename','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','index','SquareRecording','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','VIRTUAL','count','includeAll','include','findAll'];(function(_0x54aa6f,_0x30b5ea){var _0x49fa53=function(_0x4e2138){while(--_0x4e2138){_0x54aa6f['push'](_0x54aa6f['shift']());}};_0x49fa53(++_0x30b5ea);}(_0x0240,0x135));var _0x0024=function(_0x3d07d8,_0x18b96b){_0x3d07d8=_0x3d07d8-0x0;var _0x165ae9=_0x0240[_0x3d07d8];return _0x165ae9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0024('0x0'));var zipdir=require(_0x0024('0x1'));var jsonpatch=require(_0x0024('0x2'));var rp=require(_0x0024('0x3'));var moment=require('moment');var BPromise=require(_0x0024('0x4'));var Mustache=require(_0x0024('0x5'));var util=require(_0x0024('0x6'));var path=require('path');var sox=require(_0x0024('0x7'));var csv=require(_0x0024('0x8'));var ejs=require(_0x0024('0x9'));var fs=require('fs');var fs_extra=require(_0x0024('0xa'));var _=require(_0x0024('0xb'));var squel=require(_0x0024('0xc'));var crypto=require(_0x0024('0xd'));var jsforce=require(_0x0024('0xe'));var deskjs=require(_0x0024('0xf'));var toCsv=require(_0x0024('0x8'));var querystring=require(_0x0024('0x10'));var Papa=require(_0x0024('0x11'));var Redis=require('ioredis');var authService=require(_0x0024('0x12'));var qs=require(_0x0024('0x13'));var as=require(_0x0024('0x14'));var hardwareService=require(_0x0024('0x15'));var logger=require(_0x0024('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0024('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0024('0x18'))['db'];function respondWithStatusCode(_0x539c36,_0x1cb726){_0x1cb726=_0x1cb726||0xcc;return function(_0x59e62c){if(_0x59e62c){return _0x539c36['sendStatus'](_0x1cb726);}return _0x539c36['status'](_0x1cb726)[_0x0024('0x19')]();};}function respondWithResult(_0x5e06cf,_0xef4f78){_0xef4f78=_0xef4f78||0xc8;return function(_0x170e6c){if(_0x170e6c){return _0x5e06cf[_0x0024('0x1a')](_0xef4f78)[_0x0024('0x1b')](_0x170e6c);}};}function respondWithFilteredResult(_0x4f3b94,_0x36efea){return function(_0x168dfa){if(_0x168dfa){var _0x45f1a2=typeof _0x36efea[_0x0024('0x1c')]==='undefined'&&typeof _0x36efea['limit']==='undefined';var _0x11e70e=_0x168dfa['count'];var _0x1cf0ee=_0x45f1a2?0x0:_0x36efea['offset'];var _0x183e20=_0x45f1a2?_0x168dfa['count']:_0x36efea['offset']+_0x36efea[_0x0024('0x1d')];var _0x2814fa;if(_0x183e20>=_0x11e70e){_0x183e20=_0x11e70e;_0x2814fa=0xc8;}else{_0x2814fa=0xce;}_0x4f3b94[_0x0024('0x1a')](_0x2814fa);return _0x4f3b94[_0x0024('0x1e')](_0x0024('0x1f'),_0x1cf0ee+'-'+_0x183e20+'/'+_0x11e70e)[_0x0024('0x1b')](_0x168dfa);}return null;};}function patchUpdates(_0x3934da){return function(_0x489e6f){try{jsonpatch[_0x0024('0x20')](_0x489e6f,_0x3934da,!![]);}catch(_0x43faa6){return BPromise['reject'](_0x43faa6);}return _0x489e6f[_0x0024('0x21')]();};}function saveUpdates(_0x58b9c8,_0x401598){return function(_0x5ba0ba){if(_0x5ba0ba){return _0x5ba0ba['update'](_0x58b9c8)[_0x0024('0x22')](function(_0xe8c333){return _0xe8c333;});}return null;};}function removeEntity(_0x366c77,_0x201f4a){return function(_0x3c84a1){if(_0x3c84a1){return _0x3c84a1['destroy']()[_0x0024('0x22')](function(){_0x366c77['status'](0xcc)[_0x0024('0x19')]();});}};}function handleEntityNotFound(_0x133be4,_0x273774){return function(_0x1e65fd){if(!_0x1e65fd){_0x133be4[_0x0024('0x23')](0x194);}return _0x1e65fd;};}function handleError(_0x24eaca,_0x31c2b5){_0x31c2b5=_0x31c2b5||0x1f4;return function(_0x3ae1ef){logger[_0x0024('0x24')](_0x3ae1ef[_0x0024('0x25')]);if(_0x3ae1ef[_0x0024('0x26')]){delete _0x3ae1ef[_0x0024('0x26')];}_0x24eaca['status'](_0x31c2b5)[_0x0024('0x27')](_0x3ae1ef);};}exports[_0x0024('0x28')]=function(_0x196946,_0x1d8a5c){var _0xd3cd83={},_0x196bf4={},_0x55332d={'count':0x0,'rows':[]};var _0x340691=_['map'](db[_0x0024('0x29')]['rawAttributes'],function(_0x10198d){return{'name':_0x10198d[_0x0024('0x2a')],'type':_0x10198d[_0x0024('0x2b')]['key']};});_0x196bf4[_0x0024('0x2c')]=_['map'](_0x340691,_0x0024('0x26'));_0x196bf4[_0x0024('0x2d')]=_[_0x0024('0x2e')](_0x196946[_0x0024('0x2d')]);_0x196bf4[_0x0024('0x2f')]=_[_0x0024('0x30')](_0x196bf4[_0x0024('0x2c')],_0x196bf4['query']);_0xd3cd83[_0x0024('0x31')]=_[_0x0024('0x30')](_0x196bf4['model'],qs[_0x0024('0x32')](_0x196946[_0x0024('0x2d')][_0x0024('0x32')]));_0xd3cd83[_0x0024('0x31')]=_0xd3cd83[_0x0024('0x31')][_0x0024('0x33')]?_0xd3cd83[_0x0024('0x31')]:_0x196bf4[_0x0024('0x2c')];if(!_0x196946[_0x0024('0x2d')][_0x0024('0x34')]('nolimit')){_0xd3cd83[_0x0024('0x1d')]=qs[_0x0024('0x1d')](_0x196946[_0x0024('0x2d')][_0x0024('0x1d')]);_0xd3cd83[_0x0024('0x1c')]=qs['offset'](_0x196946[_0x0024('0x2d')][_0x0024('0x1c')]);}_0xd3cd83['order']=qs[_0x0024('0x35')](_0x196946[_0x0024('0x2d')][_0x0024('0x35')]);_0xd3cd83[_0x0024('0x36')]=qs['filters'](_[_0x0024('0x37')](_0x196946[_0x0024('0x2d')],_0x196bf4[_0x0024('0x2f')]),_0x340691);if(_0x196946[_0x0024('0x2d')]['filter']){_0xd3cd83[_0x0024('0x36')]=_[_0x0024('0x38')](_0xd3cd83['where'],{'$or':_[_0x0024('0x39')](_0x340691,function(_0x5d8c6e){if(_0x5d8c6e[_0x0024('0x2b')]!==_0x0024('0x3a')){var _0x3d9cc0={};_0x3d9cc0[_0x5d8c6e[_0x0024('0x26')]]={'$like':'%'+_0x196946[_0x0024('0x2d')]['filter']+'%'};return _0x3d9cc0;}})});}_0xd3cd83=_[_0x0024('0x38')]({},_0xd3cd83,_0x196946['options']);var _0x59dc09={'where':_0xd3cd83[_0x0024('0x36')]};return db[_0x0024('0x29')]['count'](_0x59dc09)[_0x0024('0x22')](function(_0x49e20e){_0x55332d[_0x0024('0x3b')]=_0x49e20e;if(_0x196946[_0x0024('0x2d')][_0x0024('0x3c')]){_0xd3cd83[_0x0024('0x3d')]=[{'all':!![]}];}return db[_0x0024('0x29')][_0x0024('0x3e')](_0xd3cd83);})[_0x0024('0x22')](function(_0x5394d1){_0x55332d[_0x0024('0x3f')]=_0x5394d1;return _0x55332d;})['then'](respondWithFilteredResult(_0x1d8a5c,_0xd3cd83))[_0x0024('0x40')](handleError(_0x1d8a5c,null));};exports[_0x0024('0x41')]=function(_0x5b2af8,_0x2eac8e){var _0x893978={'raw':!![],'where':{'id':_0x5b2af8[_0x0024('0x42')]['id']}},_0xeb0581={};_0xeb0581['model']=_['keys'](db[_0x0024('0x29')][_0x0024('0x43')]);_0xeb0581[_0x0024('0x2d')]=_['keys'](_0x5b2af8[_0x0024('0x2d')]);_0xeb0581[_0x0024('0x2f')]=_[_0x0024('0x30')](_0xeb0581[_0x0024('0x2c')],_0xeb0581[_0x0024('0x2d')]);_0x893978[_0x0024('0x31')]=_[_0x0024('0x30')](_0xeb0581['model'],qs[_0x0024('0x32')](_0x5b2af8[_0x0024('0x2d')][_0x0024('0x32')]));_0x893978[_0x0024('0x31')]=_0x893978[_0x0024('0x31')][_0x0024('0x33')]?_0x893978[_0x0024('0x31')]:_0xeb0581[_0x0024('0x2c')];if(_0x5b2af8[_0x0024('0x2d')]['includeAll']){_0x893978[_0x0024('0x3d')]=[{'all':!![]}];}_0x893978=_[_0x0024('0x38')]({},_0x893978,_0x5b2af8['options']);return db['SquareRecording']['find'](_0x893978)[_0x0024('0x22')](handleEntityNotFound(_0x2eac8e,null))[_0x0024('0x22')](respondWithResult(_0x2eac8e,null))[_0x0024('0x40')](handleError(_0x2eac8e,null));};exports[_0x0024('0x44')]=function(_0x1bdaa1,_0x3b51c7){return db['SquareRecording']['create'](_0x1bdaa1[_0x0024('0x45')],{})[_0x0024('0x22')](respondWithResult(_0x3b51c7,0xc9))[_0x0024('0x40')](handleError(_0x3b51c7,null));};exports[_0x0024('0x46')]=function(_0x1babdd,_0x565141){if(_0x1babdd['body']['id']){delete _0x1babdd[_0x0024('0x45')]['id'];}return db[_0x0024('0x29')][_0x0024('0x47')]({'where':{'id':_0x1babdd[_0x0024('0x42')]['id']}})['then'](handleEntityNotFound(_0x565141,null))[_0x0024('0x22')](saveUpdates(_0x1babdd['body'],null))['then'](respondWithResult(_0x565141,null))[_0x0024('0x40')](handleError(_0x565141,null));};exports[_0x0024('0x48')]=function(_0x525011,_0x5f158b,_0x3fc740){var _0x1aad98=require('../../components/encryptor');var _0x29d7f2=![];var _0x2847f1={};if(_0x525011[_0x0024('0x2d')]['type']&&_0x525011[_0x0024('0x2d')][_0x0024('0x2b')]===_0x0024('0x49')){_0x2847f1[_0x0024('0x49')]=_0x525011[_0x0024('0x42')]['id'];}else{_0x2847f1['id']=_0x525011[_0x0024('0x42')]['id'];}return db[_0x0024('0x29')][_0x0024('0x47')]({'where':_0x2847f1,'attributes':['id',_0x0024('0x4a'),_0x0024('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x5f158b,null))[_0x0024('0x22')](function(_0x17a6c5){if(_0x17a6c5){var _0x1eb0c3=_0x17a6c5['savePath'];var _0x20624f=util['format'](_0x0024('0x4c'),_0x1eb0c3);if(fs[_0x0024('0x4d')](_0x20624f)){_0x29d7f2=!![];return _0x1aad98['decryptFile'](_0x20624f,_0x1eb0c3,config[_0x0024('0x4e')][_0x0024('0x4f')])[_0x0024('0x22')](function(){return _0x17a6c5;});}return _0x17a6c5;}})[_0x0024('0x22')](function(_0x1410dd){if(_0x1410dd){var _0x2144e6=_0x1410dd[_0x0024('0x4a')];if(!fs[_0x0024('0x4d')](_0x2144e6)){throw new db[(_0x0024('0x50'))][(_0x0024('0x51'))](_0x0024('0x52'));}if(_0x1410dd['filename']){return _0x5f158b['download'](_0x2144e6,_0x1410dd[_0x0024('0x4b')]+path['extname'](_0x2144e6),function(){if(_0x29d7f2){fs['unlink'](_0x2144e6);}});}else{return _0x5f158b[_0x0024('0x48')](_0x2144e6,function(_0x22f738){if(_0x29d7f2){fs[_0x0024('0x53')](_0x2144e6);}});}}})[_0x0024('0x40')](function(_0xb7f206){if(_0xb7f206['message']===_0x0024('0x52')){_0x5f158b['status'](0x194)[_0x0024('0x27')](_0x0024('0x54'));}else{return handleError(_0x5f158b,null);}});};exports[_0x0024('0x55')]=function(_0x23f41f,_0x13e9f4){return db[_0x0024('0x29')][_0x0024('0x47')]({'where':{'id':_0x23f41f[_0x0024('0x42')]['id']}})['then'](function(_0xca5a52){if(_[_0x0024('0x56')](_0xca5a52)){throw new ReferenceError(_0x0024('0x57'));}return _0xca5a52;})[_0x0024('0x22')](function(_0x52c42c){var _0x55f8e5=_0x52c42c[_0x0024('0x4a')];logger[_0x0024('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x55f8e5);if(!_[_0x0024('0x56')](_0x52c42c[_0x0024('0x4a')])&&fs[_0x0024('0x4d')](_0x55f8e5)){logger[_0x0024('0x58')](_0x0024('0x59')+_0x55f8e5+_0x0024('0x5a'));fs[_0x0024('0x5b')](_0x55f8e5);}_0x55f8e5=_0x55f8e5+_0x0024('0x5c');if(!_[_0x0024('0x56')](_0x52c42c[_0x0024('0x4a')])&&fs[_0x0024('0x4d')](_0x55f8e5)){logger['info'](_0x0024('0x59')+_0x55f8e5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0024('0x5b')](_0x55f8e5);}return _0x52c42c;})['then'](function(_0x5de161){if(!_0x5de161)throw new InternalError();return _0x5de161[_0x0024('0x55')]();})[_0x0024('0x22')](function(){_0x13e9f4[_0x0024('0x1a')](0xcc)['end']();})[_0x0024('0x40')](handleError(_0x13e9f4,null));};
\ No newline at end of file
+var _0x962d=['cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','isNil','Entity\x20not\x20found'];(function(_0x4c2a66,_0x5abaaf){var _0x3fbe5f=function(_0x5a1beb){while(--_0x5a1beb){_0x4c2a66['push'](_0x4c2a66['shift']());}};_0x3fbe5f(++_0x5abaaf);}(_0x962d,0x66));var _0xd962=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x962d[_0x440917];return _0x5e906b;};'use strict';var emlformat=require(_0xd962('0x0'));var rimraf=require(_0xd962('0x1'));var zipdir=require(_0xd962('0x2'));var jsonpatch=require(_0xd962('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd962('0x4'));var util=require(_0xd962('0x5'));var path=require(_0xd962('0x6'));var sox=require('sox');var csv=require(_0xd962('0x7'));var ejs=require(_0xd962('0x8'));var fs=require('fs');var fs_extra=require(_0xd962('0x9'));var _=require('lodash');var squel=require(_0xd962('0xa'));var crypto=require('crypto');var jsforce=require(_0xd962('0xb'));var deskjs=require(_0xd962('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd962('0xd'));var Papa=require(_0xd962('0xe'));var Redis=require('ioredis');var authService=require(_0xd962('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd962('0x10'));var hardwareService=require(_0xd962('0x11'));var logger=require(_0xd962('0x12'))(_0xd962('0x13'));var utils=require(_0xd962('0x14'));var config=require(_0xd962('0x15'));var licenseUtil=require(_0xd962('0x16'));var db=require(_0xd962('0x17'))['db'];function respondWithStatusCode(_0x27bbad,_0x42bb1d){_0x42bb1d=_0x42bb1d||0xcc;return function(_0x9ef95c){if(_0x9ef95c){return _0x27bbad[_0xd962('0x18')](_0x42bb1d);}return _0x27bbad[_0xd962('0x19')](_0x42bb1d)['end']();};}function respondWithResult(_0x4e27ac,_0x55e779){_0x55e779=_0x55e779||0xc8;return function(_0x11d11c){if(_0x11d11c){return _0x4e27ac[_0xd962('0x19')](_0x55e779)['json'](_0x11d11c);}};}function respondWithFilteredResult(_0x4fac7b,_0x5a90fe){return function(_0x33a497){if(_0x33a497){var _0x347f0e=typeof _0x5a90fe['offset']===_0xd962('0x1a')&&typeof _0x5a90fe[_0xd962('0x1b')]==='undefined';var _0x3c9884=_0x33a497[_0xd962('0x1c')];var _0x22b903=_0x347f0e?0x0:_0x5a90fe[_0xd962('0x1d')];var _0x371c08=_0x347f0e?_0x33a497[_0xd962('0x1c')]:_0x5a90fe[_0xd962('0x1d')]+_0x5a90fe[_0xd962('0x1b')];var _0x4ff475;if(_0x371c08>=_0x3c9884){_0x371c08=_0x3c9884;_0x4ff475=0xc8;}else{_0x4ff475=0xce;}_0x4fac7b[_0xd962('0x19')](_0x4ff475);return _0x4fac7b[_0xd962('0x1e')]('Content-Range',_0x22b903+'-'+_0x371c08+'/'+_0x3c9884)[_0xd962('0x1f')](_0x33a497);}return null;};}function patchUpdates(_0x35a325){return function(_0x11c881){try{jsonpatch[_0xd962('0x20')](_0x11c881,_0x35a325,!![]);}catch(_0x182a10){return BPromise[_0xd962('0x21')](_0x182a10);}return _0x11c881[_0xd962('0x22')]();};}function saveUpdates(_0x401045,_0x10a3d7){return function(_0x463850){if(_0x463850){return _0x463850[_0xd962('0x23')](_0x401045)[_0xd962('0x24')](function(_0x333327){return _0x333327;});}return null;};}function removeEntity(_0x3c67ac,_0x19d640){return function(_0x38896d){if(_0x38896d){return _0x38896d[_0xd962('0x25')]()[_0xd962('0x24')](function(){_0x3c67ac[_0xd962('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107cc6,_0x29c2ee){return function(_0x388cef){if(!_0x388cef){_0x107cc6[_0xd962('0x18')](0x194);}return _0x388cef;};}function handleError(_0x4c4bef,_0x1900a2){_0x1900a2=_0x1900a2||0x1f4;return function(_0x2adfc2){logger[_0xd962('0x26')](_0x2adfc2[_0xd962('0x27')]);if(_0x2adfc2[_0xd962('0x28')]){delete _0x2adfc2['name'];}_0x4c4bef[_0xd962('0x19')](_0x1900a2)[_0xd962('0x29')](_0x2adfc2);};}exports[_0xd962('0x2a')]=function(_0x230205,_0x36ccf2){var _0x2a5223={},_0x47186a={},_0x58f93c={'count':0x0,'rows':[]};var _0x2b9ffa=_[_0xd962('0x2b')](db[_0xd962('0x2c')][_0xd962('0x2d')],function(_0x570af7){return{'name':_0x570af7['fieldName'],'type':_0x570af7[_0xd962('0x2e')][_0xd962('0x2f')]};});_0x47186a[_0xd962('0x30')]=_[_0xd962('0x2b')](_0x2b9ffa,'name');_0x47186a[_0xd962('0x31')]=_[_0xd962('0x32')](_0x230205['query']);_0x47186a[_0xd962('0x33')]=_[_0xd962('0x34')](_0x47186a[_0xd962('0x30')],_0x47186a[_0xd962('0x31')]);_0x2a5223[_0xd962('0x35')]=_[_0xd962('0x34')](_0x47186a[_0xd962('0x30')],qs[_0xd962('0x36')](_0x230205[_0xd962('0x31')][_0xd962('0x36')]));_0x2a5223[_0xd962('0x35')]=_0x2a5223['attributes'][_0xd962('0x37')]?_0x2a5223['attributes']:_0x47186a[_0xd962('0x30')];if(!_0x230205[_0xd962('0x31')]['hasOwnProperty'](_0xd962('0x38'))){_0x2a5223[_0xd962('0x1b')]=qs[_0xd962('0x1b')](_0x230205['query'][_0xd962('0x1b')]);_0x2a5223['offset']=qs[_0xd962('0x1d')](_0x230205[_0xd962('0x31')][_0xd962('0x1d')]);}_0x2a5223[_0xd962('0x39')]=qs[_0xd962('0x3a')](_0x230205[_0xd962('0x31')][_0xd962('0x3a')]);_0x2a5223[_0xd962('0x3b')]=qs[_0xd962('0x33')](_[_0xd962('0x3c')](_0x230205['query'],_0x47186a[_0xd962('0x33')]),_0x2b9ffa);if(_0x230205[_0xd962('0x31')]['filter']){_0x2a5223[_0xd962('0x3b')]=_['merge'](_0x2a5223[_0xd962('0x3b')],{'$or':_[_0xd962('0x2b')](_0x2b9ffa,function(_0x52963d){if(_0x52963d[_0xd962('0x2e')]!==_0xd962('0x3d')){var _0x3c3e0a={};_0x3c3e0a[_0x52963d[_0xd962('0x28')]]={'$like':'%'+_0x230205['query'][_0xd962('0x3e')]+'%'};return _0x3c3e0a;}})});}_0x2a5223=_[_0xd962('0x3f')]({},_0x2a5223,_0x230205[_0xd962('0x40')]);var _0x3c7f6d={'where':_0x2a5223[_0xd962('0x3b')]};return db[_0xd962('0x2c')][_0xd962('0x1c')](_0x3c7f6d)['then'](function(_0x21a3a9){_0x58f93c[_0xd962('0x1c')]=_0x21a3a9;if(_0x230205[_0xd962('0x31')][_0xd962('0x41')]){_0x2a5223[_0xd962('0x42')]=[{'all':!![]}];}return db[_0xd962('0x2c')][_0xd962('0x43')](_0x2a5223);})[_0xd962('0x24')](function(_0x1b794c){_0x58f93c[_0xd962('0x44')]=_0x1b794c;return _0x58f93c;})[_0xd962('0x24')](respondWithFilteredResult(_0x36ccf2,_0x2a5223))[_0xd962('0x45')](handleError(_0x36ccf2,null));};exports[_0xd962('0x46')]=function(_0x591c42,_0x70f114){var _0x496897={'raw':!![],'where':{'id':_0x591c42['params']['id']}},_0x34a2db={};_0x34a2db[_0xd962('0x30')]=_[_0xd962('0x32')](db[_0xd962('0x2c')][_0xd962('0x2d')]);_0x34a2db[_0xd962('0x31')]=_[_0xd962('0x32')](_0x591c42[_0xd962('0x31')]);_0x34a2db[_0xd962('0x33')]=_[_0xd962('0x34')](_0x34a2db['model'],_0x34a2db['query']);_0x496897[_0xd962('0x35')]=_[_0xd962('0x34')](_0x34a2db[_0xd962('0x30')],qs[_0xd962('0x36')](_0x591c42['query']['fields']));_0x496897[_0xd962('0x35')]=_0x496897['attributes'][_0xd962('0x37')]?_0x496897[_0xd962('0x35')]:_0x34a2db[_0xd962('0x30')];if(_0x591c42[_0xd962('0x31')][_0xd962('0x41')]){_0x496897['include']=[{'all':!![]}];}_0x496897=_[_0xd962('0x3f')]({},_0x496897,_0x591c42[_0xd962('0x40')]);return db[_0xd962('0x2c')][_0xd962('0x47')](_0x496897)['then'](handleEntityNotFound(_0x70f114,null))[_0xd962('0x24')](respondWithResult(_0x70f114,null))[_0xd962('0x45')](handleError(_0x70f114,null));};exports[_0xd962('0x48')]=function(_0x286937,_0x374953){return db[_0xd962('0x2c')][_0xd962('0x48')](_0x286937[_0xd962('0x49')],{})[_0xd962('0x24')](respondWithResult(_0x374953,0xc9))[_0xd962('0x45')](handleError(_0x374953,null));};exports[_0xd962('0x23')]=function(_0x5f4617,_0x273322){if(_0x5f4617[_0xd962('0x49')]['id']){delete _0x5f4617[_0xd962('0x49')]['id'];}return db[_0xd962('0x2c')][_0xd962('0x47')]({'where':{'id':_0x5f4617[_0xd962('0x4a')]['id']}})[_0xd962('0x24')](handleEntityNotFound(_0x273322,null))['then'](saveUpdates(_0x5f4617['body'],null))[_0xd962('0x24')](respondWithResult(_0x273322,null))[_0xd962('0x45')](handleError(_0x273322,null));};exports[_0xd962('0x4b')]=function(_0x2b78f4,_0xa63090,_0x2738ce){var _0x541719=require(_0xd962('0x4c'));var _0x28fa67=![];var _0x2774a7={};if(_0x2b78f4[_0xd962('0x31')]['type']&&_0x2b78f4[_0xd962('0x31')][_0xd962('0x2e')]===_0xd962('0x4d')){_0x2774a7[_0xd962('0x4d')]=_0x2b78f4[_0xd962('0x4a')]['id'];}else{_0x2774a7['id']=_0x2b78f4[_0xd962('0x4a')]['id'];}return db[_0xd962('0x2c')][_0xd962('0x47')]({'where':_0x2774a7,'attributes':['id',_0xd962('0x4e'),'filename'],'raw':!![]})[_0xd962('0x24')](handleEntityNotFound(_0xa63090,null))['then'](function(_0x3f619c){if(_0x3f619c){var _0x3e5984=_0x3f619c[_0xd962('0x4e')];var _0xeb2b8e=util[_0xd962('0x4f')](_0xd962('0x50'),_0x3e5984);if(fs[_0xd962('0x51')](_0xeb2b8e)){_0x28fa67=!![];return _0x541719[_0xd962('0x52')](_0xeb2b8e,_0x3e5984,config[_0xd962('0x53')][_0xd962('0x54')])[_0xd962('0x24')](function(){return _0x3f619c;});}return _0x3f619c;}})[_0xd962('0x24')](function(_0x57a0b1){if(_0x57a0b1){var _0x21e336=_0x57a0b1['savePath'];if(!fs[_0xd962('0x51')](_0x21e336)){throw new db[(_0xd962('0x55'))][(_0xd962('0x56'))](_0xd962('0x57'));}if(_0x57a0b1['filename']){return _0xa63090['download'](_0x21e336,_0x57a0b1['filename']+path['extname'](_0x21e336),function(){if(_0x28fa67){fs[_0xd962('0x58')](_0x21e336);}});}else{return _0xa63090[_0xd962('0x4b')](_0x21e336,function(_0x4fadf4){if(_0x28fa67){fs[_0xd962('0x58')](_0x21e336);}});}}})['catch'](function(_0x46b0b4){if(_0x46b0b4[_0xd962('0x59')]===_0xd962('0x57')){_0xa63090[_0xd962('0x19')](0x194)[_0xd962('0x29')]('Not\x20found');}else{return handleError(_0xa63090,null);}});};exports[_0xd962('0x25')]=function(_0x39cea8,_0x5799a4){return db['SquareRecording'][_0xd962('0x47')]({'where':{'id':_0x39cea8['params']['id']}})['then'](function(_0x1dbf99){if(_[_0xd962('0x5a')](_0x1dbf99)){throw new ReferenceError(_0xd962('0x5b'));}return _0x1dbf99;})[_0xd962('0x24')](function(_0x561c43){var _0x333302=_0x561c43[_0xd962('0x4e')];logger['info'](_0xd962('0x5c'),_0x333302);if(!_['isNil'](_0x561c43[_0xd962('0x4e')])&&fs[_0xd962('0x51')](_0x333302)){logger[_0xd962('0x5d')](_0xd962('0x5e')+_0x333302+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd962('0x5f')](_0x333302);}_0x333302=_0x333302+_0xd962('0x60');if(!_[_0xd962('0x5a')](_0x561c43[_0xd962('0x4e')])&&fs[_0xd962('0x51')](_0x333302)){logger[_0xd962('0x5d')](_0xd962('0x5e')+_0x333302+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd962('0x5f')](_0x333302);}return _0x561c43;})[_0xd962('0x24')](function(_0x1b8388){if(!_0x1b8388)throw new InternalError();return _0x1b8388[_0xd962('0x25')]();})['then'](function(){_0x5799a4[_0xd962('0x19')](0xcc)['end']();})[_0xd962('0x45')](handleError(_0x5799a4,null));};
\ No newline at end of file
index 5c5cce5..e3f53d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc962=['square_recordings','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x3cb7c1,_0x1bde10){var _0x3f6ffc=function(_0xc1901f){while(--_0xc1901f){_0x3cb7c1['push'](_0x3cb7c1['shift']());}};_0x3f6ffc(++_0x1bde10);}(_0xc962,0x6d));var _0x2c96=function(_0x617ac8,_0x28bea8){_0x617ac8=_0x617ac8-0x0;var _0x28ce1a=_0xc962[_0x617ac8];return _0x28ce1a;};'use strict';var _=require(_0x2c96('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2c96('0x1'));var BPromise=require(_0x2c96('0x2'));var rp=require(_0x2c96('0x3'));var fs=require('fs');var path=require(_0x2c96('0x4'));var rimraf=require(_0x2c96('0x5'));var config=require(_0x2c96('0x6'));var attributes=require(_0x2c96('0x7'));module[_0x2c96('0x8')]=function(_0x599a47,_0x1b7ca9){return _0x599a47[_0x2c96('0x9')](_0x2c96('0xa'),attributes,{'tableName':_0x2c96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89fb=['SquareRecording','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x89fb,0x14b));var _0xb89f=function(_0x156972,_0x3276e4){_0x156972=_0x156972-0x0;var _0x5e0250=_0x89fb[_0x156972];return _0x5e0250;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var logger=require(_0xb89f('0x1'))(_0xb89f('0x2'));var moment=require(_0xb89f('0x3'));var BPromise=require(_0xb89f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb89f('0x5'));var rimraf=require(_0xb89f('0x6'));var config=require(_0xb89f('0x7'));var attributes=require(_0xb89f('0x8'));module[_0xb89f('0x9')]=function(_0x564ef3,_0x2ce32a){return _0x564ef3['define'](_0xb89f('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fba1f26..e7946c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41c=['then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x4e92ce,_0xf2753e){var _0x41b8f3=function(_0x14665d){while(--_0x14665d){_0x4e92ce['push'](_0x4e92ce['shift']());}};_0x41b8f3(++_0xf2753e);}(_0xa41c,0x17a));var _0xca41=function(_0x381350,_0x254cbd){_0x381350=_0x381350-0x0;var _0xf188b8=_0xa41c[_0x381350];return _0xf188b8;};'use strict';var _=require('lodash');var util=require(_0xca41('0x0'));var moment=require(_0xca41('0x1'));var BPromise=require(_0xca41('0x2'));var rs=require(_0xca41('0x3'));var fs=require('fs');var Redis=require(_0xca41('0x4'));var db=require(_0xca41('0x5'))['db'];var utils=require(_0xca41('0x6'));var logger=require(_0xca41('0x7'))('rpc');var config=require(_0xca41('0x8'));var jayson=require(_0xca41('0x9'));var client=jayson[_0xca41('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d0322,_0x5e26c7,_0x4cba56){return new BPromise(function(_0x1edda6,_0x1ff6c6){return client[_0xca41('0xb')](_0x5d0322,_0x4cba56)[_0xca41('0xc')](function(_0x156982){logger[_0xca41('0xd')](_0xca41('0xe'),_0x5e26c7,'request\x20sent');logger[_0xca41('0xf')](_0xca41('0x10'),_0x5e26c7,_0xca41('0x11'),JSON['stringify'](_0x156982));if(_0x156982[_0xca41('0x12')]){if(_0x156982[_0xca41('0x12')][_0xca41('0x13')]===0x1f4){logger[_0xca41('0x12')](_0xca41('0xe'),_0x5e26c7,_0x156982[_0xca41('0x12')][_0xca41('0x14')]);return _0x1ff6c6(_0x156982['error']['message']);}logger[_0xca41('0x12')](_0xca41('0xe'),_0x5e26c7,_0x156982[_0xca41('0x12')][_0xca41('0x14')]);return _0x1edda6(_0x156982[_0xca41('0x12')][_0xca41('0x14')]);}else{logger[_0xca41('0xd')](_0xca41('0xe'),_0x5e26c7,_0xca41('0x11'));_0x1edda6(_0x156982[_0xca41('0x15')]['message']);}})[_0xca41('0x16')](function(_0x116fcc){logger[_0xca41('0x12')](_0xca41('0xe'),_0x5e26c7,_0x116fcc);_0x1ff6c6(_0x116fcc);});});}exports[_0xca41('0x17')]=function(_0x5bcda4){var _0x39247c=this;return new Promise(function(_0x4972aa,_0x49d7bf){return db[_0xca41('0x18')][_0xca41('0x19')](_0x5bcda4[_0xca41('0x1a')],{'raw':_0x5bcda4[_0xca41('0x1b')]?_0x5bcda4[_0xca41('0x1b')][_0xca41('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4bfdaa){logger['info'](_0xca41('0x17'),_0x5bcda4);logger[_0xca41('0xf')](_0xca41('0x17'),_0x5bcda4,JSON[_0xca41('0x1d')](_0x4bfdaa));_0x4972aa(_0x4bfdaa);})[_0xca41('0x16')](function(_0x292477){logger[_0xca41('0x12')](_0xca41('0x17'),_0x292477[_0xca41('0x14')],_0x5bcda4);_0x49d7bf(_0x39247c[_0xca41('0x12')](0x1f4,_0x292477[_0xca41('0x14')]));});});};
\ No newline at end of file
+var _0x40f1=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','debug','lodash'];(function(_0x6aba6b,_0x58db26){var _0xbd5df3=function(_0x5502fe){while(--_0x5502fe){_0x6aba6b['push'](_0x6aba6b['shift']());}};_0xbd5df3(++_0x58db26);}(_0x40f1,0x1db));var _0x140f=function(_0x1cf7d2,_0x4853b5){_0x1cf7d2=_0x1cf7d2-0x0;var _0xe92506=_0x40f1[_0x1cf7d2];return _0xe92506;};'use strict';var _=require(_0x140f('0x0'));var util=require(_0x140f('0x1'));var moment=require('moment');var BPromise=require(_0x140f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x140f('0x3'));var db=require(_0x140f('0x4'))['db'];var utils=require(_0x140f('0x5'));var logger=require(_0x140f('0x6'))('rpc');var config=require(_0x140f('0x7'));var jayson=require(_0x140f('0x8'));var client=jayson[_0x140f('0x9')][_0x140f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37c578,_0x2592eb,_0xa03f10){return new BPromise(function(_0x10da09,_0x10dc5f){return client[_0x140f('0xb')](_0x37c578,_0xa03f10)['then'](function(_0x69f04f){logger[_0x140f('0xc')](_0x140f('0xd'),_0x2592eb,_0x140f('0xe'));logger['debug'](_0x140f('0xf'),_0x2592eb,_0x140f('0xe'),JSON[_0x140f('0x10')](_0x69f04f));if(_0x69f04f['error']){if(_0x69f04f[_0x140f('0x11')][_0x140f('0x12')]===0x1f4){logger[_0x140f('0x11')](_0x140f('0xd'),_0x2592eb,_0x69f04f['error'][_0x140f('0x13')]);return _0x10dc5f(_0x69f04f[_0x140f('0x11')][_0x140f('0x13')]);}logger[_0x140f('0x11')](_0x140f('0xd'),_0x2592eb,_0x69f04f[_0x140f('0x11')]['message']);return _0x10da09(_0x69f04f[_0x140f('0x11')]['message']);}else{logger[_0x140f('0xc')]('SquareRecording,\x20%s,\x20%s',_0x2592eb,_0x140f('0xe'));_0x10da09(_0x69f04f[_0x140f('0x14')][_0x140f('0x13')]);}})[_0x140f('0x15')](function(_0x53ee18){logger[_0x140f('0x11')](_0x140f('0xd'),_0x2592eb,_0x53ee18);_0x10dc5f(_0x53ee18);});});}exports[_0x140f('0x16')]=function(_0x49f681){var _0x2ec94f=this;return new Promise(function(_0xd74559,_0xd8b54a){return db[_0x140f('0x17')][_0x140f('0x18')](_0x49f681[_0x140f('0x19')],{'raw':_0x49f681[_0x140f('0x1a')]?_0x49f681['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xf4f6d2){logger[_0x140f('0xc')](_0x140f('0x16'),_0x49f681);logger[_0x140f('0x1b')]('CreateSquareRecording',_0x49f681,JSON[_0x140f('0x10')](_0xf4f6d2));_0xd74559(_0xf4f6d2);})[_0x140f('0x15')](function(_0xd3eddb){logger[_0x140f('0x11')](_0x140f('0x16'),_0xd3eddb[_0x140f('0x13')],_0x49f681);_0xd8b54a(_0x2ec94f['error'](0x1f4,_0xd3eddb[_0x140f('0x13')]));});});};
\ No newline at end of file
index d18a8d1..fea4820 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x17a2a5,_0x589a60){var _0x386c43=function(_0x3db104){while(--_0x3db104){_0x17a2a5['push'](_0x17a2a5['shift']());}};_0x386c43(++_0x589a60);}(_0xe706,0xa3));var _0x6e70=function(_0x53e19d,_0x604957){_0x53e19d=_0x53e19d-0x0;var _0x5ba332=_0xe706[_0x53e19d];return _0x5ba332;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+var _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(_0x4c3efb,_0x513fd3){var _0x21d90a=function(_0x2576ec){while(--_0x2576ec){_0x4c3efb['push'](_0x4c3efb['shift']());}};_0x21d90a(++_0x513fd3);}(_0xe706,0xa3));var _0x6e70=function(_0x490e0a,_0x1eca50){_0x490e0a=_0x490e0a-0x0;var _0x212ff2=_0xe706[_0x490e0a];return _0x212ff2;};'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 68da572..4270071 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3b2=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x56a205,_0x531290){var _0x584466=function(_0xf104a9){while(--_0xf104a9){_0x56a205['push'](_0x56a205['shift']());}};_0x584466(++_0x531290);}(_0xf3b2,0x152));var _0x2f3b=function(_0x21f3ca,_0x493fa1){_0x21f3ca=_0x21f3ca-0x0;var _0x51e18e=_0xf3b2[_0x21f3ca];return _0x51e18e;};'use strict';var Sequelize=require(_0x2f3b('0x0'));module['exports']={'network':{'type':Sequelize[_0x2f3b('0x1')]},'network_script':{'type':Sequelize[_0x2f3b('0x1')]},'request':{'type':Sequelize[_0x2f3b('0x1')]},'channel':{'type':Sequelize[_0x2f3b('0x1')]},'language':{'type':Sequelize[_0x2f3b('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x2f3b('0x1')]},'callerid':{'type':Sequelize[_0x2f3b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x2f3b('0x1')]},'callingani2':{'type':Sequelize[_0x2f3b('0x1')]},'callington':{'type':Sequelize[_0x2f3b('0x1')]},'callingtns':{'type':Sequelize[_0x2f3b('0x1')]},'dnid':{'type':Sequelize[_0x2f3b('0x1')]},'rdnis':{'type':Sequelize[_0x2f3b('0x1')]},'context':{'type':Sequelize[_0x2f3b('0x1')]},'extension':{'type':Sequelize[_0x2f3b('0x1')]},'priority':{'type':Sequelize[_0x2f3b('0x1')]},'enhanced':{'type':Sequelize[_0x2f3b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2f3b('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2f3b('0x2')]},'bot':{'type':Sequelize[_0x2f3b('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcb7b=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xcb7b,0x16d));var _0xbcb7=function(_0x1d77db,_0x4cccb9){_0x1d77db=_0x1d77db-0x0;var _0x38420e=_0xcb7b[_0x1d77db];return _0x38420e;};'use strict';var Sequelize=require(_0xbcb7('0x0'));module[_0xbcb7('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xbcb7('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbcb7('0x2')]},'type':{'type':Sequelize[_0xbcb7('0x2')]},'uniqueid':{'type':Sequelize[_0xbcb7('0x2')]},'version':{'type':Sequelize[_0xbcb7('0x2')]},'callerid':{'type':Sequelize[_0xbcb7('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xbcb7('0x2')]},'callingtns':{'type':Sequelize[_0xbcb7('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xbcb7('0x2')]},'context':{'type':Sequelize[_0xbcb7('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbcb7('0x2')]},'enhanced':{'type':Sequelize[_0xbcb7('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xbcb7('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbcb7('0x3')]},'leaveAt':{'type':Sequelize[_0xbcb7('0x3')]},'bot':{'type':Sequelize[_0xbcb7('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 42472be..0020213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd146=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','SquareReport','model','map','query','filters','intersection','fields','attributes'];(function(_0xe3de43,_0x3bf64c){var _0x1bc1ed=function(_0x3c8cba){while(--_0x3c8cba){_0xe3de43['push'](_0xe3de43['shift']());}};_0x1bc1ed(++_0x3bf64c);}(_0xd146,0x12f));var _0x6d14=function(_0x52f149,_0x120dab){_0x52f149=_0x52f149-0x0;var _0x1df773=_0xd146[_0x52f149];return _0x1df773;};'use strict';var emlformat=require(_0x6d14('0x0'));var rimraf=require(_0x6d14('0x1'));var zipdir=require(_0x6d14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d14('0x3'));var moment=require(_0x6d14('0x4'));var BPromise=require(_0x6d14('0x5'));var Mustache=require(_0x6d14('0x6'));var util=require(_0x6d14('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6d14('0x8'));var ejs=require(_0x6d14('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6d14('0xa'));var crypto=require(_0x6d14('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6d14('0xc'));var toCsv=require(_0x6d14('0x8'));var querystring=require('querystring');var Papa=require(_0x6d14('0xd'));var Redis=require(_0x6d14('0xe'));var authService=require(_0x6d14('0xf'));var qs=require(_0x6d14('0x10'));var as=require(_0x6d14('0x11'));var hardwareService=require(_0x6d14('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6d14('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6d14('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121fc6,_0x458c0b){_0x458c0b=_0x458c0b||0xcc;return function(_0x5bd3ce){if(_0x5bd3ce){return _0x121fc6[_0x6d14('0x15')](_0x458c0b);}return _0x121fc6[_0x6d14('0x16')](_0x458c0b)[_0x6d14('0x17')]();};}function respondWithResult(_0x59a4ba,_0x1bbc35){_0x1bbc35=_0x1bbc35||0xc8;return function(_0x1b263f){if(_0x1b263f){return _0x59a4ba['status'](_0x1bbc35)[_0x6d14('0x18')](_0x1b263f);}};}function respondWithFilteredResult(_0x541dc1,_0xa90d05){return function(_0xc59419){if(_0xc59419){var _0x36f7a7=typeof _0xa90d05['offset']===_0x6d14('0x19')&&typeof _0xa90d05[_0x6d14('0x1a')]===_0x6d14('0x19');var _0x211123=_0xc59419[_0x6d14('0x1b')];var _0x5a68a1=_0x36f7a7?0x0:_0xa90d05['offset'];var _0x487504=_0x36f7a7?_0xc59419[_0x6d14('0x1b')]:_0xa90d05[_0x6d14('0x1c')]+_0xa90d05[_0x6d14('0x1a')];var _0xb4182c;if(_0x487504>=_0x211123){_0x487504=_0x211123;_0xb4182c=0xc8;}else{_0xb4182c=0xce;}_0x541dc1['status'](_0xb4182c);return _0x541dc1[_0x6d14('0x1d')]('Content-Range',_0x5a68a1+'-'+_0x487504+'/'+_0x211123)[_0x6d14('0x18')](_0xc59419);}return null;};}function patchUpdates(_0x2a716d){return function(_0x416dd6){try{jsonpatch[_0x6d14('0x1e')](_0x416dd6,_0x2a716d,!![]);}catch(_0x4ce05d){return BPromise[_0x6d14('0x1f')](_0x4ce05d);}return _0x416dd6[_0x6d14('0x20')]();};}function saveUpdates(_0x5c41e1,_0x224349){return function(_0x3c842a){if(_0x3c842a){return _0x3c842a[_0x6d14('0x21')](_0x5c41e1)[_0x6d14('0x22')](function(_0x5c5715){return _0x5c5715;});}return null;};}function removeEntity(_0xb8801e,_0xed98c3){return function(_0x43b615){if(_0x43b615){return _0x43b615[_0x6d14('0x23')]()['then'](function(){_0xb8801e['status'](0xcc)[_0x6d14('0x17')]();});}};}function handleEntityNotFound(_0x36739b,_0x5d9a6b){return function(_0x55983f){if(!_0x55983f){_0x36739b[_0x6d14('0x15')](0x194);}return _0x55983f;};}function handleError(_0x43290b,_0x254d8a){_0x254d8a=_0x254d8a||0x1f4;return function(_0x4b9c71){logger['error'](_0x4b9c71[_0x6d14('0x24')]);if(_0x4b9c71['name']){delete _0x4b9c71[_0x6d14('0x25')];}_0x43290b['status'](_0x254d8a)[_0x6d14('0x26')](_0x4b9c71);};}exports['index']=function(_0x5c66a3,_0x405ebc){var _0x35fc13={},_0x2f76b0={},_0x224a5c={'count':0x0,'rows':[]};var _0x5c1d8f=_['map'](db[_0x6d14('0x27')]['rawAttributes'],function(_0x46ac9e){return{'name':_0x46ac9e['fieldName'],'type':_0x46ac9e['type']['key']};});_0x2f76b0[_0x6d14('0x28')]=_[_0x6d14('0x29')](_0x5c1d8f,_0x6d14('0x25'));_0x2f76b0[_0x6d14('0x2a')]=_['keys'](_0x5c66a3['query']);_0x2f76b0[_0x6d14('0x2b')]=_[_0x6d14('0x2c')](_0x2f76b0[_0x6d14('0x28')],_0x2f76b0[_0x6d14('0x2a')]);_0x35fc13['attributes']=_[_0x6d14('0x2c')](_0x2f76b0[_0x6d14('0x28')],qs[_0x6d14('0x2d')](_0x5c66a3['query'][_0x6d14('0x2d')]));_0x35fc13[_0x6d14('0x2e')]=_0x35fc13[_0x6d14('0x2e')]['length']?_0x35fc13['attributes']:_0x2f76b0[_0x6d14('0x28')];if(!_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x2f')](_0x6d14('0x30'))){_0x35fc13[_0x6d14('0x1a')]=qs[_0x6d14('0x1a')](_0x5c66a3[_0x6d14('0x2a')]['limit']);_0x35fc13[_0x6d14('0x1c')]=qs[_0x6d14('0x1c')](_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x1c')]);}_0x35fc13['order']=qs[_0x6d14('0x31')](_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x31')]);_0x35fc13[_0x6d14('0x32')]=qs['filters'](_[_0x6d14('0x33')](_0x5c66a3['query'],_0x2f76b0[_0x6d14('0x2b')]),_0x5c1d8f);if(_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x34')]){_0x35fc13['where']=_[_0x6d14('0x35')](_0x35fc13['where'],{'$or':_[_0x6d14('0x29')](_0x5c1d8f,function(_0x3bd895){if(_0x3bd895[_0x6d14('0x36')]!==_0x6d14('0x37')){var _0x58051e={};_0x58051e[_0x3bd895[_0x6d14('0x25')]]={'$like':'%'+_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x34')]+'%'};return _0x58051e;}})});}_0x35fc13=_['merge']({},_0x35fc13,_0x5c66a3[_0x6d14('0x38')]);var _0x1a815a={'where':_0x35fc13['where']};return db[_0x6d14('0x27')][_0x6d14('0x1b')](_0x1a815a)[_0x6d14('0x22')](function(_0x382b68){_0x224a5c['count']=_0x382b68;if(_0x5c66a3[_0x6d14('0x2a')][_0x6d14('0x39')]){_0x35fc13['include']=[{'all':!![]}];}return db['SquareReport'][_0x6d14('0x3a')](_0x35fc13);})['then'](function(_0x8e8a6e){_0x224a5c[_0x6d14('0x3b')]=_0x8e8a6e;return _0x224a5c;})[_0x6d14('0x22')](respondWithFilteredResult(_0x405ebc,_0x35fc13))[_0x6d14('0x3c')](handleError(_0x405ebc,null));};exports[_0x6d14('0x3d')]=function(_0x35ba20,_0x508819){var _0x5b4c98={'raw':!![],'where':{'id':_0x35ba20[_0x6d14('0x3e')]['id']}},_0x2d86b7={};_0x2d86b7[_0x6d14('0x28')]=_[_0x6d14('0x3f')](db[_0x6d14('0x27')]['rawAttributes']);_0x2d86b7[_0x6d14('0x2a')]=_[_0x6d14('0x3f')](_0x35ba20[_0x6d14('0x2a')]);_0x2d86b7['filters']=_['intersection'](_0x2d86b7[_0x6d14('0x28')],_0x2d86b7[_0x6d14('0x2a')]);_0x5b4c98[_0x6d14('0x2e')]=_['intersection'](_0x2d86b7[_0x6d14('0x28')],qs[_0x6d14('0x2d')](_0x35ba20[_0x6d14('0x2a')][_0x6d14('0x2d')]));_0x5b4c98[_0x6d14('0x2e')]=_0x5b4c98[_0x6d14('0x2e')][_0x6d14('0x40')]?_0x5b4c98['attributes']:_0x2d86b7['model'];if(_0x35ba20['query'][_0x6d14('0x39')]){_0x5b4c98[_0x6d14('0x41')]=[{'all':!![]}];}_0x5b4c98=_[_0x6d14('0x35')]({},_0x5b4c98,_0x35ba20['options']);return db['SquareReport'][_0x6d14('0x42')](_0x5b4c98)[_0x6d14('0x22')](handleEntityNotFound(_0x508819,null))['then'](respondWithResult(_0x508819,null))['catch'](handleError(_0x508819,null));};exports[_0x6d14('0x43')]=function(_0x26c1e7,_0x52c1f8){return db['SquareReport'][_0x6d14('0x43')](_0x26c1e7[_0x6d14('0x44')],{})[_0x6d14('0x22')](respondWithResult(_0x52c1f8,0xc9))[_0x6d14('0x3c')](handleError(_0x52c1f8,null));};exports[_0x6d14('0x21')]=function(_0x721d40,_0x36b0f4){if(_0x721d40[_0x6d14('0x44')]['id']){delete _0x721d40[_0x6d14('0x44')]['id'];}return db[_0x6d14('0x27')][_0x6d14('0x42')]({'where':{'id':_0x721d40[_0x6d14('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36b0f4,null))[_0x6d14('0x22')](saveUpdates(_0x721d40[_0x6d14('0x44')],null))[_0x6d14('0x22')](respondWithResult(_0x36b0f4,null))[_0x6d14('0x3c')](handleError(_0x36b0f4,null));};exports[_0x6d14('0x23')]=function(_0x3db899,_0x564fc2){return db['SquareReport'][_0x6d14('0x42')]({'where':{'id':_0x3db899[_0x6d14('0x3e')]['id']}})['then'](handleEntityNotFound(_0x564fc2,null))[_0x6d14('0x22')](removeEntity(_0x564fc2,null))[_0x6d14('0x3c')](handleError(_0x564fc2,null));};exports[_0x6d14('0x45')]=function(_0xc61f2c,_0x5194c0){return db[_0x6d14('0x27')][_0x6d14('0x45')]()[_0x6d14('0x22')](respondWithResult(_0x5194c0,null))['catch'](handleError(_0x5194c0,null));};
\ No newline at end of file
+var _0x6435=['rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x18fddc,_0xf5f2e4){var _0x5b793e=function(_0x391089){while(--_0x391089){_0x18fddc['push'](_0x18fddc['shift']());}};_0x5b793e(++_0xf5f2e4);}(_0x6435,0xa6));var _0x5643=function(_0x2b81a8,_0x31ae45){_0x2b81a8=_0x2b81a8-0x0;var _0x3526e8=_0x6435[_0x2b81a8];return _0x3526e8;};'use strict';var emlformat=require(_0x5643('0x0'));var rimraf=require(_0x5643('0x1'));var zipdir=require(_0x5643('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5643('0x3'));var moment=require(_0x5643('0x4'));var BPromise=require(_0x5643('0x5'));var Mustache=require('mustache');var util=require(_0x5643('0x6'));var path=require(_0x5643('0x7'));var sox=require(_0x5643('0x8'));var csv=require(_0x5643('0x9'));var ejs=require(_0x5643('0xa'));var fs=require('fs');var fs_extra=require(_0x5643('0xb'));var _=require(_0x5643('0xc'));var squel=require('squel');var crypto=require(_0x5643('0xd'));var jsforce=require(_0x5643('0xe'));var deskjs=require(_0x5643('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5643('0x10'));var Redis=require(_0x5643('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5643('0x12'));var as=require(_0x5643('0x13'));var hardwareService=require(_0x5643('0x14'));var logger=require(_0x5643('0x15'))(_0x5643('0x16'));var utils=require('../../config/utils');var config=require(_0x5643('0x17'));var licenseUtil=require(_0x5643('0x18'));var db=require(_0x5643('0x19'))['db'];function respondWithStatusCode(_0x5ecc40,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x53c3ff){if(_0x53c3ff){return _0x5ecc40['sendStatus'](_0x406340);}return _0x5ecc40[_0x5643('0x1a')](_0x406340)[_0x5643('0x1b')]();};}function respondWithResult(_0x381456,_0x3f1d18){_0x3f1d18=_0x3f1d18||0xc8;return function(_0x3e11b3){if(_0x3e11b3){return _0x381456[_0x5643('0x1a')](_0x3f1d18)[_0x5643('0x1c')](_0x3e11b3);}};}function respondWithFilteredResult(_0x133e43,_0x5b6c15){return function(_0x4b8ee6){if(_0x4b8ee6){var _0x384132=typeof _0x5b6c15['offset']===_0x5643('0x1d')&&typeof _0x5b6c15[_0x5643('0x1e')]===_0x5643('0x1d');var _0x4e07a7=_0x4b8ee6['count'];var _0x4946e4=_0x384132?0x0:_0x5b6c15[_0x5643('0x1f')];var _0x3ab096=_0x384132?_0x4b8ee6[_0x5643('0x20')]:_0x5b6c15[_0x5643('0x1f')]+_0x5b6c15['limit'];var _0x26a534;if(_0x3ab096>=_0x4e07a7){_0x3ab096=_0x4e07a7;_0x26a534=0xc8;}else{_0x26a534=0xce;}_0x133e43[_0x5643('0x1a')](_0x26a534);return _0x133e43[_0x5643('0x21')](_0x5643('0x22'),_0x4946e4+'-'+_0x3ab096+'/'+_0x4e07a7)[_0x5643('0x1c')](_0x4b8ee6);}return null;};}function patchUpdates(_0x3c885b){return function(_0x4d6b58){try{jsonpatch[_0x5643('0x23')](_0x4d6b58,_0x3c885b,!![]);}catch(_0x24cb09){return BPromise[_0x5643('0x24')](_0x24cb09);}return _0x4d6b58[_0x5643('0x25')]();};}function saveUpdates(_0x451dc9,_0x52c75c){return function(_0x6f5065){if(_0x6f5065){return _0x6f5065[_0x5643('0x26')](_0x451dc9)[_0x5643('0x27')](function(_0x4aebe7){return _0x4aebe7;});}return null;};}function removeEntity(_0x3b5832,_0x25d027){return function(_0x1b6d11){if(_0x1b6d11){return _0x1b6d11[_0x5643('0x28')]()[_0x5643('0x27')](function(){_0x3b5832[_0x5643('0x1a')](0xcc)[_0x5643('0x1b')]();});}};}function handleEntityNotFound(_0x2d28d6,_0x1e7e02){return function(_0x3d62ba){if(!_0x3d62ba){_0x2d28d6[_0x5643('0x29')](0x194);}return _0x3d62ba;};}function handleError(_0x1a465d,_0x1ffcd5){_0x1ffcd5=_0x1ffcd5||0x1f4;return function(_0x207b8f){logger['error'](_0x207b8f[_0x5643('0x2a')]);if(_0x207b8f['name']){delete _0x207b8f[_0x5643('0x2b')];}_0x1a465d['status'](_0x1ffcd5)[_0x5643('0x2c')](_0x207b8f);};}exports[_0x5643('0x2d')]=function(_0x2fe1f2,_0x1a4e70){var _0x47cf7b={},_0x514322={},_0x968665={'count':0x0,'rows':[]};var _0x2d13dd=_[_0x5643('0x2e')](db[_0x5643('0x2f')][_0x5643('0x30')],function(_0x9a3ad3){return{'name':_0x9a3ad3['fieldName'],'type':_0x9a3ad3['type']['key']};});_0x514322[_0x5643('0x31')]=_[_0x5643('0x2e')](_0x2d13dd,_0x5643('0x2b'));_0x514322['query']=_[_0x5643('0x32')](_0x2fe1f2[_0x5643('0x33')]);_0x514322[_0x5643('0x34')]=_[_0x5643('0x35')](_0x514322['model'],_0x514322[_0x5643('0x33')]);_0x47cf7b[_0x5643('0x36')]=_['intersection'](_0x514322['model'],qs[_0x5643('0x37')](_0x2fe1f2[_0x5643('0x33')]['fields']));_0x47cf7b[_0x5643('0x36')]=_0x47cf7b['attributes'][_0x5643('0x38')]?_0x47cf7b['attributes']:_0x514322[_0x5643('0x31')];if(!_0x2fe1f2['query'][_0x5643('0x39')](_0x5643('0x3a'))){_0x47cf7b[_0x5643('0x1e')]=qs[_0x5643('0x1e')](_0x2fe1f2[_0x5643('0x33')][_0x5643('0x1e')]);_0x47cf7b[_0x5643('0x1f')]=qs[_0x5643('0x1f')](_0x2fe1f2[_0x5643('0x33')][_0x5643('0x1f')]);}_0x47cf7b[_0x5643('0x3b')]=qs[_0x5643('0x3c')](_0x2fe1f2[_0x5643('0x33')]['sort']);_0x47cf7b[_0x5643('0x3d')]=qs['filters'](_[_0x5643('0x3e')](_0x2fe1f2[_0x5643('0x33')],_0x514322[_0x5643('0x34')]),_0x2d13dd);if(_0x2fe1f2['query'][_0x5643('0x3f')]){_0x47cf7b[_0x5643('0x3d')]=_[_0x5643('0x40')](_0x47cf7b[_0x5643('0x3d')],{'$or':_['map'](_0x2d13dd,function(_0x4c9651){if(_0x4c9651[_0x5643('0x41')]!==_0x5643('0x42')){var _0xbea8f2={};_0xbea8f2[_0x4c9651[_0x5643('0x2b')]]={'$like':'%'+_0x2fe1f2[_0x5643('0x33')][_0x5643('0x3f')]+'%'};return _0xbea8f2;}})});}_0x47cf7b=_['merge']({},_0x47cf7b,_0x2fe1f2[_0x5643('0x43')]);var _0x349d4e={'where':_0x47cf7b[_0x5643('0x3d')]};return db[_0x5643('0x2f')][_0x5643('0x20')](_0x349d4e)[_0x5643('0x27')](function(_0x2218aa){_0x968665[_0x5643('0x20')]=_0x2218aa;if(_0x2fe1f2[_0x5643('0x33')][_0x5643('0x44')]){_0x47cf7b[_0x5643('0x45')]=[{'all':!![]}];}return db[_0x5643('0x2f')][_0x5643('0x46')](_0x47cf7b);})[_0x5643('0x27')](function(_0x4bedd9){_0x968665[_0x5643('0x47')]=_0x4bedd9;return _0x968665;})[_0x5643('0x27')](respondWithFilteredResult(_0x1a4e70,_0x47cf7b))[_0x5643('0x48')](handleError(_0x1a4e70,null));};exports[_0x5643('0x49')]=function(_0x247b44,_0x1d7985){var _0x52c162={'raw':!![],'where':{'id':_0x247b44['params']['id']}},_0x4fc24a={};_0x4fc24a[_0x5643('0x31')]=_[_0x5643('0x32')](db[_0x5643('0x2f')][_0x5643('0x30')]);_0x4fc24a[_0x5643('0x33')]=_['keys'](_0x247b44[_0x5643('0x33')]);_0x4fc24a[_0x5643('0x34')]=_[_0x5643('0x35')](_0x4fc24a[_0x5643('0x31')],_0x4fc24a['query']);_0x52c162[_0x5643('0x36')]=_[_0x5643('0x35')](_0x4fc24a['model'],qs['fields'](_0x247b44[_0x5643('0x33')][_0x5643('0x37')]));_0x52c162[_0x5643('0x36')]=_0x52c162[_0x5643('0x36')]['length']?_0x52c162[_0x5643('0x36')]:_0x4fc24a[_0x5643('0x31')];if(_0x247b44[_0x5643('0x33')][_0x5643('0x44')]){_0x52c162[_0x5643('0x45')]=[{'all':!![]}];}_0x52c162=_[_0x5643('0x40')]({},_0x52c162,_0x247b44['options']);return db[_0x5643('0x2f')][_0x5643('0x4a')](_0x52c162)[_0x5643('0x27')](handleEntityNotFound(_0x1d7985,null))[_0x5643('0x27')](respondWithResult(_0x1d7985,null))['catch'](handleError(_0x1d7985,null));};exports[_0x5643('0x4b')]=function(_0x10bd09,_0x4c7a78){return db[_0x5643('0x2f')][_0x5643('0x4b')](_0x10bd09[_0x5643('0x4c')],{})[_0x5643('0x27')](respondWithResult(_0x4c7a78,0xc9))[_0x5643('0x48')](handleError(_0x4c7a78,null));};exports[_0x5643('0x26')]=function(_0x1dad76,_0x411704){if(_0x1dad76[_0x5643('0x4c')]['id']){delete _0x1dad76[_0x5643('0x4c')]['id'];}return db[_0x5643('0x2f')][_0x5643('0x4a')]({'where':{'id':_0x1dad76[_0x5643('0x4d')]['id']}})[_0x5643('0x27')](handleEntityNotFound(_0x411704,null))['then'](saveUpdates(_0x1dad76[_0x5643('0x4c')],null))[_0x5643('0x27')](respondWithResult(_0x411704,null))['catch'](handleError(_0x411704,null));};exports[_0x5643('0x28')]=function(_0x449b76,_0x10e393){return db['SquareReport']['find']({'where':{'id':_0x449b76['params']['id']}})[_0x5643('0x27')](handleEntityNotFound(_0x10e393,null))['then'](removeEntity(_0x10e393,null))['catch'](handleError(_0x10e393,null));};exports[_0x5643('0x4e')]=function(_0x56530d,_0x39b93b){return db[_0x5643('0x2f')]['describe']()[_0x5643('0x27')](respondWithResult(_0x39b93b,null))[_0x5643('0x48')](handleError(_0x39b93b,null));};
\ No newline at end of file
index 6d1da03..117a9ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0088=['project_name','leaveAt','lodash','../../config/logger','moment','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid'];(function(_0x115c76,_0x1eb5e6){var _0x176ada=function(_0x3f0f51){while(--_0x3f0f51){_0x115c76['push'](_0x115c76['shift']());}};_0x176ada(++_0x1eb5e6);}(_0x0088,0x1ca));var _0x8008=function(_0x2a3ff1,_0x415e9f){_0x2a3ff1=_0x2a3ff1-0x0;var _0x2324b7=_0x0088[_0x2a3ff1];return _0x2324b7;};'use strict';var _=require(_0x8008('0x0'));var util=require('util');var logger=require(_0x8008('0x1'))('api');var moment=require(_0x8008('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8008('0x3'));var config=require('../../config/environment');var attributes=require(_0x8008('0x4'));module[_0x8008('0x5')]=function(_0x47e1da,_0x4efab4){return _0x47e1da[_0x8008('0x6')](_0x8008('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x8008('0x8'),'fields':[_0x8008('0x9'),_0x8008('0xa')]},{'name':_0x8008('0xb'),'fields':[_0x8008('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xafaf=['leaveAt','util','../../config/logger','api','bluebird','request-promise','./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xafaf,0xe5));var _0xfafa=function(_0x5b8735,_0x5f2b0e){_0x5b8735=_0x5b8735-0x0;var _0x178aa3=_0xafaf[_0x5b8735];return _0x178aa3;};'use strict';var _=require('lodash');var util=require(_0xfafa('0x0'));var logger=require(_0xfafa('0x1'))(_0xfafa('0x2'));var moment=require('moment');var BPromise=require(_0xfafa('0x3'));var rp=require(_0xfafa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfafa('0x5'));module[_0xfafa('0x6')]=function(_0x21fb0a,_0x2e4c61){return _0x21fb0a[_0xfafa('0x7')](_0xfafa('0x8'),attributes,{'tableName':_0xfafa('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xfafa('0xa'),'project_name']},{'name':_0xfafa('0xb'),'fields':[_0xfafa('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 53ccfbb..759b580 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4357=['body','where','attributes','limit','UpdateSquareReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','SquareReport,\x20%s,\x20%s','message','CreateSquareReport','SquareReport','create','options','raw','info','stringify','update'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x4357,0x1c6));var _0x7435=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x4357[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x7435('0x0'));var util=require('util');var moment=require(_0x7435('0x1'));var BPromise=require(_0x7435('0x2'));var rs=require(_0x7435('0x3'));var fs=require('fs');var Redis=require(_0x7435('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7435('0x5'));var logger=require('../../config/logger')(_0x7435('0x6'));var config=require(_0x7435('0x7'));var jayson=require(_0x7435('0x8'));var client=jayson[_0x7435('0x9')][_0x7435('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x587619,_0x1dab6a,_0x1dc885){return new BPromise(function(_0x3e7038,_0x37c5a5){return client['request'](_0x587619,_0x1dc885)[_0x7435('0xb')](function(_0x95de74){logger['info']('SquareReport,\x20%s,\x20%s',_0x1dab6a,_0x7435('0xc'));logger[_0x7435('0xd')](_0x7435('0xe'),_0x1dab6a,_0x7435('0xc'),JSON['stringify'](_0x95de74));if(_0x95de74[_0x7435('0xf')]){if(_0x95de74[_0x7435('0xf')]['code']===0x1f4){logger[_0x7435('0xf')](_0x7435('0x10'),_0x1dab6a,_0x95de74['error'][_0x7435('0x11')]);return _0x37c5a5(_0x95de74[_0x7435('0xf')]['message']);}logger['error'](_0x7435('0x10'),_0x1dab6a,_0x95de74[_0x7435('0xf')]['message']);return _0x3e7038(_0x95de74[_0x7435('0xf')][_0x7435('0x11')]);}else{logger['info'](_0x7435('0x10'),_0x1dab6a,'request\x20sent');_0x3e7038(_0x95de74['result'][_0x7435('0x11')]);}})['catch'](function(_0x1e45e3){logger['error'](_0x7435('0x10'),_0x1dab6a,_0x1e45e3);_0x37c5a5(_0x1e45e3);});});}exports[_0x7435('0x12')]=function(_0x4588e1){var _0x49c42a=this;return new Promise(function(_0x206c22,_0x4eaded){return db[_0x7435('0x13')][_0x7435('0x14')](_0x4588e1['body'],{'raw':_0x4588e1[_0x7435('0x15')]?_0x4588e1[_0x7435('0x15')][_0x7435('0x16')]===undefined?!![]:![]:!![]})[_0x7435('0xb')](function(_0x2267bf){logger[_0x7435('0x17')](_0x7435('0x12'),_0x4588e1);logger[_0x7435('0xd')](_0x7435('0x12'),_0x4588e1,JSON[_0x7435('0x18')](_0x2267bf));_0x206c22(_0x2267bf);})['catch'](function(_0xcf9397){logger['error']('CreateSquareReport',_0xcf9397[_0x7435('0x11')],_0x4588e1);_0x4eaded(_0x49c42a[_0x7435('0xf')](0x1f4,_0xcf9397['message']));});});};exports['UpdateSquareReport']=function(_0x5d1e6e){var _0x37e456=this;return new Promise(function(_0x2502e1,_0x34d300){return db[_0x7435('0x13')][_0x7435('0x19')](_0x5d1e6e[_0x7435('0x1a')],{'raw':_0x5d1e6e[_0x7435('0x15')]?_0x5d1e6e[_0x7435('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d1e6e[_0x7435('0x15')]?_0x5d1e6e[_0x7435('0x15')][_0x7435('0x1b')]||null:null,'attributes':_0x5d1e6e[_0x7435('0x15')]?_0x5d1e6e['options'][_0x7435('0x1c')]||null:null,'limit':_0x5d1e6e['options']?_0x5d1e6e[_0x7435('0x15')][_0x7435('0x1d')]||null:null})[_0x7435('0xb')](function(_0x4b21f1){logger[_0x7435('0x17')](_0x7435('0x1e'),_0x5d1e6e);logger[_0x7435('0xd')](_0x7435('0x1e'),_0x5d1e6e,JSON[_0x7435('0x18')](_0x4b21f1));_0x2502e1(_0x4b21f1);})[_0x7435('0x1f')](function(_0x4c20c2){logger[_0x7435('0xf')](_0x7435('0x1e'),_0x4c20c2[_0x7435('0x11')],_0x5d1e6e);_0x34d300(_0x37e456['error'](0x1f4,_0x4c20c2[_0x7435('0x11')]));});});};
\ No newline at end of file
+var _0xaebb=['jayson/promise','client','http','request','then','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','create','body','options','raw','stringify','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xaebb,0x1d4));var _0xbaeb=function(_0x1750a5,_0x4e2311){_0x1750a5=_0x1750a5-0x0;var _0x17c181=_0xaebb[_0x1750a5];return _0x17c181;};'use strict';var _=require(_0xbaeb('0x0'));var util=require(_0xbaeb('0x1'));var moment=require(_0xbaeb('0x2'));var BPromise=require(_0xbaeb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbaeb('0x4'));var db=require(_0xbaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbaeb('0x6'));var config=require(_0xbaeb('0x7'));var jayson=require(_0xbaeb('0x8'));var client=jayson[_0xbaeb('0x9')][_0xbaeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d69f6,_0x3b9976,_0x2b9f7f){return new BPromise(function(_0x4190b1,_0x11e59a){return client[_0xbaeb('0xb')](_0x1d69f6,_0x2b9f7f)[_0xbaeb('0xc')](function(_0xf42c02){logger[_0xbaeb('0xd')]('SquareReport,\x20%s,\x20%s',_0x3b9976,'request\x20sent');logger[_0xbaeb('0xe')](_0xbaeb('0xf'),_0x3b9976,'request\x20sent',JSON['stringify'](_0xf42c02));if(_0xf42c02[_0xbaeb('0x10')]){if(_0xf42c02[_0xbaeb('0x10')][_0xbaeb('0x11')]===0x1f4){logger[_0xbaeb('0x10')](_0xbaeb('0x12'),_0x3b9976,_0xf42c02[_0xbaeb('0x10')][_0xbaeb('0x13')]);return _0x11e59a(_0xf42c02[_0xbaeb('0x10')][_0xbaeb('0x13')]);}logger[_0xbaeb('0x10')](_0xbaeb('0x12'),_0x3b9976,_0xf42c02['error'][_0xbaeb('0x13')]);return _0x4190b1(_0xf42c02['error'][_0xbaeb('0x13')]);}else{logger[_0xbaeb('0xd')]('SquareReport,\x20%s,\x20%s',_0x3b9976,'request\x20sent');_0x4190b1(_0xf42c02[_0xbaeb('0x14')]['message']);}})[_0xbaeb('0x15')](function(_0x14a744){logger[_0xbaeb('0x10')]('SquareReport,\x20%s,\x20%s',_0x3b9976,_0x14a744);_0x11e59a(_0x14a744);});});}exports[_0xbaeb('0x16')]=function(_0x560a7b){var _0x1e80e4=this;return new Promise(function(_0x1f0634,_0x252be6){return db['SquareReport'][_0xbaeb('0x17')](_0x560a7b[_0xbaeb('0x18')],{'raw':_0x560a7b[_0xbaeb('0x19')]?_0x560a7b[_0xbaeb('0x19')][_0xbaeb('0x1a')]===undefined?!![]:![]:!![]})[_0xbaeb('0xc')](function(_0x5b8bca){logger['info'](_0xbaeb('0x16'),_0x560a7b);logger[_0xbaeb('0xe')](_0xbaeb('0x16'),_0x560a7b,JSON[_0xbaeb('0x1b')](_0x5b8bca));_0x1f0634(_0x5b8bca);})[_0xbaeb('0x15')](function(_0x18f942){logger[_0xbaeb('0x10')](_0xbaeb('0x16'),_0x18f942[_0xbaeb('0x13')],_0x560a7b);_0x252be6(_0x1e80e4['error'](0x1f4,_0x18f942[_0xbaeb('0x13')]));});});};exports[_0xbaeb('0x1c')]=function(_0x26f0a3){var _0x3faca1=this;return new Promise(function(_0x28fd8e,_0x5d8cfa){return db[_0xbaeb('0x1d')][_0xbaeb('0x1e')](_0x26f0a3[_0xbaeb('0x18')],{'raw':_0x26f0a3[_0xbaeb('0x19')]?_0x26f0a3['options'][_0xbaeb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26f0a3['options']?_0x26f0a3['options'][_0xbaeb('0x1f')]||null:null,'attributes':_0x26f0a3[_0xbaeb('0x19')]?_0x26f0a3['options'][_0xbaeb('0x20')]||null:null,'limit':_0x26f0a3['options']?_0x26f0a3[_0xbaeb('0x19')][_0xbaeb('0x21')]||null:null})[_0xbaeb('0xc')](function(_0x39259e){logger[_0xbaeb('0xd')](_0xbaeb('0x1c'),_0x26f0a3);logger['debug']('UpdateSquareReport',_0x26f0a3,JSON[_0xbaeb('0x1b')](_0x39259e));_0x28fd8e(_0x39259e);})[_0xbaeb('0x15')](function(_0x204357){logger[_0xbaeb('0x10')](_0xbaeb('0x1c'),_0x204357['message'],_0x26f0a3);_0x5d8cfa(_0x3faca1[_0xbaeb('0x10')](0x1f4,_0x204357[_0xbaeb('0x13')]));});});};
\ No newline at end of file
index f325ebe..f5a3c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4134=['isAuthenticated','index','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0x4134,0x182));var _0x4413=function(_0x4128fb,_0x3579d7){_0x4128fb=_0x4128fb-0x0;var _0x430033=_0x4134[_0x4128fb];return _0x430033;};'use strict';var multer=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var path=require(_0x4413('0x2'));var timeout=require(_0x4413('0x3'));var express=require('express');var router=express[_0x4413('0x4')]();var fs_extra=require(_0x4413('0x5'));var auth=require(_0x4413('0x6'));var interaction=require(_0x4413('0x7'));var config=require(_0x4413('0x8'));var controller=require('./squareReportDetail.controller');router[_0x4413('0x9')]('/',auth[_0x4413('0xa')](),controller[_0x4413('0xb')]);router[_0x4413('0x9')](_0x4413('0xc'),auth['isAuthenticated'](),controller[_0x4413('0xd')]);router[_0x4413('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4413('0xe')]);router[_0x4413('0xf')]('/',auth[_0x4413('0xa')](),controller['create']);router[_0x4413('0x10')]('/:id',auth[_0x4413('0xa')](),controller[_0x4413('0x11')]);router[_0x4413('0x12')](_0x4413('0x13'),auth[_0x4413('0xa')](),controller[_0x4413('0x14')]);module[_0x4413('0x15')]=router;
\ No newline at end of file
+var _0xd796=['/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index'];(function(_0x3ab7a3,_0x273f93){var _0x4679e0=function(_0xbd5fa8){while(--_0xbd5fa8){_0x3ab7a3['push'](_0x3ab7a3['shift']());}};_0x4679e0(++_0x273f93);}(_0xd796,0x1e9));var _0x6d79=function(_0x185369,_0x46be46){_0x185369=_0x185369-0x0;var _0x4b98ba=_0xd796[_0x185369];return _0x4b98ba;};'use strict';var multer=require('multer');var util=require(_0x6d79('0x0'));var path=require(_0x6d79('0x1'));var timeout=require(_0x6d79('0x2'));var express=require(_0x6d79('0x3'));var router=express['Router']();var fs_extra=require(_0x6d79('0x4'));var auth=require(_0x6d79('0x5'));var interaction=require(_0x6d79('0x6'));var config=require(_0x6d79('0x7'));var controller=require(_0x6d79('0x8'));router[_0x6d79('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d79('0xa')]);router[_0x6d79('0x9')](_0x6d79('0xb'),auth[_0x6d79('0xc')](),controller[_0x6d79('0xd')]);router[_0x6d79('0x9')](_0x6d79('0xe'),auth[_0x6d79('0xc')](),controller[_0x6d79('0xf')]);router[_0x6d79('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6d79('0x11')](_0x6d79('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d79('0xe'),auth[_0x6d79('0xc')](),controller[_0x6d79('0x12')]);module[_0x6d79('0x13')]=router;
\ No newline at end of file
index 659de3a..79be0f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cf8=['exports','STRING','sequelize'];(function(_0x2ac2a4,_0x2ad5cd){var _0x596193=function(_0x1a9756){while(--_0x1a9756){_0x2ac2a4['push'](_0x2ac2a4['shift']());}};_0x596193(++_0x2ad5cd);}(_0x4cf8,0x134));var _0x84cf=function(_0xe7d655,_0x184955){_0xe7d655=_0xe7d655-0x0;var _0x3e4804=_0x4cf8[_0xe7d655];return _0x3e4804;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x84cf('0x2')]},'callerid':{'type':Sequelize[_0x84cf('0x2')]}};
\ No newline at end of file
+var _0x9e5c=['sequelize','exports','STRING'];(function(_0x2af261,_0x521c96){var _0x17930a=function(_0x56b799){while(--_0x56b799){_0x2af261['push'](_0x2af261['shift']());}};_0x17930a(++_0x521c96);}(_0x9e5c,0x174));var _0xc9e5=function(_0x48cc0c,_0x74f3d3){_0x48cc0c=_0x48cc0c-0x0;var _0x2fa4b4=_0x9e5c[_0x48cc0c];return _0x2fa4b4;};'use strict';var Sequelize=require(_0xc9e5('0x0'));module[_0xc9e5('0x1')]={'uniqueid':{'type':Sequelize[_0xc9e5('0x2')]},'node':{'type':Sequelize[_0xc9e5('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xc9e5('0x2')]},'callerid':{'type':Sequelize[_0xc9e5('0x2')]}};
\ No newline at end of file
index 2072c75..df8c765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a01=['index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name'];(function(_0xb95f61,_0x30a749){var _0x2622c5=function(_0x457d27){while(--_0x457d27){_0xb95f61['push'](_0xb95f61['shift']());}};_0x2622c5(++_0x30a749);}(_0x0a01,0x156));var _0x10a0=function(_0xb90123,_0xf61a41){_0xb90123=_0xb90123-0x0;var _0xc22741=_0x0a01[_0xb90123];return _0xc22741;};'use strict';var emlformat=require(_0x10a0('0x0'));var rimraf=require(_0x10a0('0x1'));var zipdir=require(_0x10a0('0x2'));var jsonpatch=require(_0x10a0('0x3'));var rp=require(_0x10a0('0x4'));var moment=require(_0x10a0('0x5'));var BPromise=require(_0x10a0('0x6'));var Mustache=require('mustache');var util=require(_0x10a0('0x7'));var path=require(_0x10a0('0x8'));var sox=require(_0x10a0('0x9'));var csv=require(_0x10a0('0xa'));var ejs=require(_0x10a0('0xb'));var fs=require('fs');var fs_extra=require(_0x10a0('0xc'));var _=require(_0x10a0('0xd'));var squel=require('squel');var crypto=require(_0x10a0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x10a0('0xf'));var toCsv=require(_0x10a0('0xa'));var querystring=require('querystring');var Papa=require(_0x10a0('0x10'));var Redis=require(_0x10a0('0x11'));var authService=require(_0x10a0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x10a0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10a0('0x14'))(_0x10a0('0x15'));var utils=require(_0x10a0('0x16'));var config=require(_0x10a0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x10a0('0x18'))['db'];function respondWithStatusCode(_0x3912d3,_0x4c1463){_0x4c1463=_0x4c1463||0xcc;return function(_0x37d22f){if(_0x37d22f){return _0x3912d3[_0x10a0('0x19')](_0x4c1463);}return _0x3912d3[_0x10a0('0x1a')](_0x4c1463)[_0x10a0('0x1b')]();};}function respondWithResult(_0x12c168,_0x2d0317){_0x2d0317=_0x2d0317||0xc8;return function(_0x14335b){if(_0x14335b){return _0x12c168[_0x10a0('0x1a')](_0x2d0317)[_0x10a0('0x1c')](_0x14335b);}};}function respondWithFilteredResult(_0x183166,_0x380ae3){return function(_0x580eab){if(_0x580eab){var _0x35c976=typeof _0x380ae3[_0x10a0('0x1d')]===_0x10a0('0x1e')&&typeof _0x380ae3[_0x10a0('0x1f')]===_0x10a0('0x1e');var _0x52654a=_0x580eab[_0x10a0('0x20')];var _0x5ecf41=_0x35c976?0x0:_0x380ae3[_0x10a0('0x1d')];var _0x1912aa=_0x35c976?_0x580eab[_0x10a0('0x20')]:_0x380ae3[_0x10a0('0x1d')]+_0x380ae3[_0x10a0('0x1f')];var _0x24630d;if(_0x1912aa>=_0x52654a){_0x1912aa=_0x52654a;_0x24630d=0xc8;}else{_0x24630d=0xce;}_0x183166['status'](_0x24630d);return _0x183166[_0x10a0('0x21')](_0x10a0('0x22'),_0x5ecf41+'-'+_0x1912aa+'/'+_0x52654a)[_0x10a0('0x1c')](_0x580eab);}return null;};}function patchUpdates(_0x30b92b){return function(_0x196350){try{jsonpatch[_0x10a0('0x23')](_0x196350,_0x30b92b,!![]);}catch(_0x5540b8){return BPromise[_0x10a0('0x24')](_0x5540b8);}return _0x196350[_0x10a0('0x25')]();};}function saveUpdates(_0x493c3d,_0xb1ce15){return function(_0x54607d){if(_0x54607d){return _0x54607d[_0x10a0('0x26')](_0x493c3d)[_0x10a0('0x27')](function(_0x4214de){return _0x4214de;});}return null;};}function removeEntity(_0x5c2f71,_0x559557){return function(_0x3ae200){if(_0x3ae200){return _0x3ae200[_0x10a0('0x28')]()[_0x10a0('0x27')](function(){_0x5c2f71[_0x10a0('0x1a')](0xcc)[_0x10a0('0x1b')]();});}};}function handleEntityNotFound(_0x5a96ae,_0x1c5b4b){return function(_0x2e073a){if(!_0x2e073a){_0x5a96ae['sendStatus'](0x194);}return _0x2e073a;};}function handleError(_0x555845,_0x53c152){_0x53c152=_0x53c152||0x1f4;return function(_0x5172e5){logger['error'](_0x5172e5[_0x10a0('0x29')]);if(_0x5172e5[_0x10a0('0x2a')]){delete _0x5172e5[_0x10a0('0x2a')];}_0x555845[_0x10a0('0x1a')](_0x53c152)['send'](_0x5172e5);};}exports[_0x10a0('0x2b')]=function(_0x2b76ca,_0x3c485b){var _0x1761f3={},_0x2efb61={},_0xce9301={'count':0x0,'rows':[]};var _0x4ddc6b=_[_0x10a0('0x2c')](db[_0x10a0('0x2d')][_0x10a0('0x2e')],function(_0x28c6a5){return{'name':_0x28c6a5[_0x10a0('0x2f')],'type':_0x28c6a5['type'][_0x10a0('0x30')]};});_0x2efb61[_0x10a0('0x31')]=_[_0x10a0('0x2c')](_0x4ddc6b,'name');_0x2efb61[_0x10a0('0x32')]=_[_0x10a0('0x33')](_0x2b76ca[_0x10a0('0x32')]);_0x2efb61[_0x10a0('0x34')]=_['intersection'](_0x2efb61['model'],_0x2efb61['query']);_0x1761f3[_0x10a0('0x35')]=_[_0x10a0('0x36')](_0x2efb61['model'],qs[_0x10a0('0x37')](_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x37')]));_0x1761f3[_0x10a0('0x35')]=_0x1761f3[_0x10a0('0x35')][_0x10a0('0x38')]?_0x1761f3[_0x10a0('0x35')]:_0x2efb61[_0x10a0('0x31')];if(!_0x2b76ca[_0x10a0('0x32')]['hasOwnProperty'](_0x10a0('0x39'))){_0x1761f3[_0x10a0('0x1f')]=qs[_0x10a0('0x1f')](_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x1f')]);_0x1761f3[_0x10a0('0x1d')]=qs[_0x10a0('0x1d')](_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x1d')]);}_0x1761f3[_0x10a0('0x3a')]=qs[_0x10a0('0x3b')](_0x2b76ca['query'][_0x10a0('0x3b')]);_0x1761f3['where']=qs['filters'](_[_0x10a0('0x3c')](_0x2b76ca[_0x10a0('0x32')],_0x2efb61[_0x10a0('0x34')]),_0x4ddc6b);if(_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x3d')]){_0x1761f3[_0x10a0('0x3e')]=_[_0x10a0('0x3f')](_0x1761f3[_0x10a0('0x3e')],{'$or':_[_0x10a0('0x2c')](_0x4ddc6b,function(_0x3291a1){if(_0x3291a1[_0x10a0('0x40')]!==_0x10a0('0x41')){var _0x24cd8b={};_0x24cd8b[_0x3291a1[_0x10a0('0x2a')]]={'$like':'%'+_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x3d')]+'%'};return _0x24cd8b;}})});}_0x1761f3=_[_0x10a0('0x3f')]({},_0x1761f3,_0x2b76ca['options']);var _0x17598c={'where':_0x1761f3[_0x10a0('0x3e')]};return db[_0x10a0('0x2d')]['count'](_0x17598c)[_0x10a0('0x27')](function(_0x43aa1f){_0xce9301['count']=_0x43aa1f;if(_0x2b76ca[_0x10a0('0x32')][_0x10a0('0x42')]){_0x1761f3[_0x10a0('0x43')]=[{'all':!![]}];}return db[_0x10a0('0x2d')][_0x10a0('0x44')](_0x1761f3);})[_0x10a0('0x27')](function(_0x108b41){_0xce9301[_0x10a0('0x45')]=_0x108b41;return _0xce9301;})['then'](respondWithFilteredResult(_0x3c485b,_0x1761f3))[_0x10a0('0x46')](handleError(_0x3c485b,null));};exports[_0x10a0('0x47')]=function(_0x122c62,_0x1ac7f5){var _0x55f31d={'raw':!![],'where':{'id':_0x122c62[_0x10a0('0x48')]['id']}},_0x4dbc1b={};_0x4dbc1b[_0x10a0('0x31')]=_[_0x10a0('0x33')](db[_0x10a0('0x2d')][_0x10a0('0x2e')]);_0x4dbc1b[_0x10a0('0x32')]=_['keys'](_0x122c62['query']);_0x4dbc1b[_0x10a0('0x34')]=_[_0x10a0('0x36')](_0x4dbc1b[_0x10a0('0x31')],_0x4dbc1b['query']);_0x55f31d[_0x10a0('0x35')]=_[_0x10a0('0x36')](_0x4dbc1b['model'],qs[_0x10a0('0x37')](_0x122c62['query'][_0x10a0('0x37')]));_0x55f31d[_0x10a0('0x35')]=_0x55f31d[_0x10a0('0x35')][_0x10a0('0x38')]?_0x55f31d[_0x10a0('0x35')]:_0x4dbc1b[_0x10a0('0x31')];if(_0x122c62[_0x10a0('0x32')][_0x10a0('0x42')]){_0x55f31d[_0x10a0('0x43')]=[{'all':!![]}];}_0x55f31d=_[_0x10a0('0x3f')]({},_0x55f31d,_0x122c62['options']);return db[_0x10a0('0x2d')][_0x10a0('0x49')](_0x55f31d)[_0x10a0('0x27')](handleEntityNotFound(_0x1ac7f5,null))[_0x10a0('0x27')](respondWithResult(_0x1ac7f5,null))[_0x10a0('0x46')](handleError(_0x1ac7f5,null));};exports[_0x10a0('0x4a')]=function(_0x508a1b,_0x3bb727){return db[_0x10a0('0x2d')][_0x10a0('0x4a')](_0x508a1b['body'],{})[_0x10a0('0x27')](respondWithResult(_0x3bb727,0xc9))[_0x10a0('0x46')](handleError(_0x3bb727,null));};exports['update']=function(_0x36bfc9,_0x105c5a){if(_0x36bfc9['body']['id']){delete _0x36bfc9[_0x10a0('0x4b')]['id'];}return db[_0x10a0('0x2d')][_0x10a0('0x49')]({'where':{'id':_0x36bfc9[_0x10a0('0x48')]['id']}})[_0x10a0('0x27')](handleEntityNotFound(_0x105c5a,null))[_0x10a0('0x27')](saveUpdates(_0x36bfc9['body'],null))['then'](respondWithResult(_0x105c5a,null))[_0x10a0('0x46')](handleError(_0x105c5a,null));};exports[_0x10a0('0x28')]=function(_0x443beb,_0x13860c){return db[_0x10a0('0x2d')][_0x10a0('0x49')]({'where':{'id':_0x443beb[_0x10a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x13860c,null))[_0x10a0('0x27')](removeEntity(_0x13860c,null))[_0x10a0('0x46')](handleError(_0x13860c,null));};exports['describe']=function(_0x173e88,_0x3979dd){return db['SquareDetailsReport'][_0x10a0('0x4c')]()[_0x10a0('0x27')](respondWithResult(_0x3979dd,null))[_0x10a0('0x46')](handleError(_0x3979dd,null));};
\ No newline at end of file
+var _0x4b5f=['order','sort','filters','where','merge','VIRTUAL','filter','count','include','rows','catch','show','params','length','includeAll','options','find','create','body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','set','Content-Range','reject','save','destroy','then','end','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b5f,0x17c));var _0xf4b5=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x4b5f[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0xf4b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4b5('0x1'));var jsonpatch=require(_0xf4b5('0x2'));var rp=require('request-promise');var moment=require(_0xf4b5('0x3'));var BPromise=require(_0xf4b5('0x4'));var Mustache=require('mustache');var util=require(_0xf4b5('0x5'));var path=require(_0xf4b5('0x6'));var sox=require(_0xf4b5('0x7'));var csv=require('to-csv');var ejs=require(_0xf4b5('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b5('0x9'));var _=require('lodash');var squel=require(_0xf4b5('0xa'));var crypto=require(_0xf4b5('0xb'));var jsforce=require(_0xf4b5('0xc'));var deskjs=require(_0xf4b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf4b5('0xe'));var Papa=require(_0xf4b5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b5('0x10'));var hardwareService=require(_0xf4b5('0x11'));var logger=require(_0xf4b5('0x12'))(_0xf4b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4b5('0x14'));var db=require(_0xf4b5('0x15'))['db'];function respondWithStatusCode(_0x116b0d,_0x17e043){_0x17e043=_0x17e043||0xcc;return function(_0x1bf70b){if(_0x1bf70b){return _0x116b0d[_0xf4b5('0x16')](_0x17e043);}return _0x116b0d['status'](_0x17e043)['end']();};}function respondWithResult(_0x5269f2,_0x3e78f8){_0x3e78f8=_0x3e78f8||0xc8;return function(_0x5032e9){if(_0x5032e9){return _0x5269f2[_0xf4b5('0x17')](_0x3e78f8)['json'](_0x5032e9);}};}function respondWithFilteredResult(_0x58185d,_0x16fe28){return function(_0x2d61c0){if(_0x2d61c0){var _0x35b6ac=typeof _0x16fe28[_0xf4b5('0x18')]===_0xf4b5('0x19')&&typeof _0x16fe28['limit']===_0xf4b5('0x19');var _0x28c51f=_0x2d61c0['count'];var _0x253ff1=_0x35b6ac?0x0:_0x16fe28[_0xf4b5('0x18')];var _0x436e63=_0x35b6ac?_0x2d61c0['count']:_0x16fe28[_0xf4b5('0x18')]+_0x16fe28['limit'];var _0x418335;if(_0x436e63>=_0x28c51f){_0x436e63=_0x28c51f;_0x418335=0xc8;}else{_0x418335=0xce;}_0x58185d[_0xf4b5('0x17')](_0x418335);return _0x58185d[_0xf4b5('0x1a')](_0xf4b5('0x1b'),_0x253ff1+'-'+_0x436e63+'/'+_0x28c51f)['json'](_0x2d61c0);}return null;};}function patchUpdates(_0x1a04c7){return function(_0x1f223b){try{jsonpatch['apply'](_0x1f223b,_0x1a04c7,!![]);}catch(_0x5665fd){return BPromise[_0xf4b5('0x1c')](_0x5665fd);}return _0x1f223b[_0xf4b5('0x1d')]();};}function saveUpdates(_0x18f79f,_0x24f103){return function(_0x28c89d){if(_0x28c89d){return _0x28c89d['update'](_0x18f79f)['then'](function(_0x365853){return _0x365853;});}return null;};}function removeEntity(_0x343fc4,_0x29e89b){return function(_0x434d09){if(_0x434d09){return _0x434d09[_0xf4b5('0x1e')]()[_0xf4b5('0x1f')](function(){_0x343fc4[_0xf4b5('0x17')](0xcc)[_0xf4b5('0x20')]();});}};}function handleEntityNotFound(_0x1c2f86,_0x78d40a){return function(_0x2835c0){if(!_0x2835c0){_0x1c2f86['sendStatus'](0x194);}return _0x2835c0;};}function handleError(_0x3da653,_0x29ece7){_0x29ece7=_0x29ece7||0x1f4;return function(_0x97d721){logger[_0xf4b5('0x21')](_0x97d721[_0xf4b5('0x22')]);if(_0x97d721[_0xf4b5('0x23')]){delete _0x97d721[_0xf4b5('0x23')];}_0x3da653['status'](_0x29ece7)['send'](_0x97d721);};}exports[_0xf4b5('0x24')]=function(_0x2c2ede,_0x212b3f){var _0x3a5744={},_0x2d5c38={},_0x412535={'count':0x0,'rows':[]};var _0x25c20f=_[_0xf4b5('0x25')](db[_0xf4b5('0x26')][_0xf4b5('0x27')],function(_0x1842cb){return{'name':_0x1842cb[_0xf4b5('0x28')],'type':_0x1842cb[_0xf4b5('0x29')][_0xf4b5('0x2a')]};});_0x2d5c38['model']=_[_0xf4b5('0x25')](_0x25c20f,_0xf4b5('0x23'));_0x2d5c38[_0xf4b5('0x2b')]=_[_0xf4b5('0x2c')](_0x2c2ede['query']);_0x2d5c38['filters']=_[_0xf4b5('0x2d')](_0x2d5c38['model'],_0x2d5c38[_0xf4b5('0x2b')]);_0x3a5744[_0xf4b5('0x2e')]=_[_0xf4b5('0x2d')](_0x2d5c38['model'],qs['fields'](_0x2c2ede[_0xf4b5('0x2b')][_0xf4b5('0x2f')]));_0x3a5744[_0xf4b5('0x2e')]=_0x3a5744[_0xf4b5('0x2e')]['length']?_0x3a5744[_0xf4b5('0x2e')]:_0x2d5c38[_0xf4b5('0x30')];if(!_0x2c2ede[_0xf4b5('0x2b')][_0xf4b5('0x31')](_0xf4b5('0x32'))){_0x3a5744['limit']=qs[_0xf4b5('0x33')](_0x2c2ede['query']['limit']);_0x3a5744[_0xf4b5('0x18')]=qs['offset'](_0x2c2ede[_0xf4b5('0x2b')][_0xf4b5('0x18')]);}_0x3a5744[_0xf4b5('0x34')]=qs[_0xf4b5('0x35')](_0x2c2ede[_0xf4b5('0x2b')][_0xf4b5('0x35')]);_0x3a5744['where']=qs[_0xf4b5('0x36')](_['pick'](_0x2c2ede[_0xf4b5('0x2b')],_0x2d5c38['filters']),_0x25c20f);if(_0x2c2ede['query']['filter']){_0x3a5744[_0xf4b5('0x37')]=_[_0xf4b5('0x38')](_0x3a5744[_0xf4b5('0x37')],{'$or':_[_0xf4b5('0x25')](_0x25c20f,function(_0x27963a){if(_0x27963a[_0xf4b5('0x29')]!==_0xf4b5('0x39')){var _0x39c08e={};_0x39c08e[_0x27963a[_0xf4b5('0x23')]]={'$like':'%'+_0x2c2ede[_0xf4b5('0x2b')][_0xf4b5('0x3a')]+'%'};return _0x39c08e;}})});}_0x3a5744=_['merge']({},_0x3a5744,_0x2c2ede['options']);var _0x24f08f={'where':_0x3a5744['where']};return db['SquareDetailsReport'][_0xf4b5('0x3b')](_0x24f08f)[_0xf4b5('0x1f')](function(_0x1856c5){_0x412535[_0xf4b5('0x3b')]=_0x1856c5;if(_0x2c2ede['query']['includeAll']){_0x3a5744[_0xf4b5('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x3a5744);})[_0xf4b5('0x1f')](function(_0x2d6b56){_0x412535[_0xf4b5('0x3d')]=_0x2d6b56;return _0x412535;})[_0xf4b5('0x1f')](respondWithFilteredResult(_0x212b3f,_0x3a5744))[_0xf4b5('0x3e')](handleError(_0x212b3f,null));};exports[_0xf4b5('0x3f')]=function(_0x236d5f,_0x3c1189){var _0x1b6685={'raw':!![],'where':{'id':_0x236d5f[_0xf4b5('0x40')]['id']}},_0x435477={};_0x435477[_0xf4b5('0x30')]=_[_0xf4b5('0x2c')](db[_0xf4b5('0x26')]['rawAttributes']);_0x435477[_0xf4b5('0x2b')]=_[_0xf4b5('0x2c')](_0x236d5f[_0xf4b5('0x2b')]);_0x435477[_0xf4b5('0x36')]=_[_0xf4b5('0x2d')](_0x435477[_0xf4b5('0x30')],_0x435477['query']);_0x1b6685[_0xf4b5('0x2e')]=_['intersection'](_0x435477['model'],qs[_0xf4b5('0x2f')](_0x236d5f[_0xf4b5('0x2b')]['fields']));_0x1b6685[_0xf4b5('0x2e')]=_0x1b6685[_0xf4b5('0x2e')][_0xf4b5('0x41')]?_0x1b6685[_0xf4b5('0x2e')]:_0x435477[_0xf4b5('0x30')];if(_0x236d5f[_0xf4b5('0x2b')][_0xf4b5('0x42')]){_0x1b6685[_0xf4b5('0x3c')]=[{'all':!![]}];}_0x1b6685=_[_0xf4b5('0x38')]({},_0x1b6685,_0x236d5f[_0xf4b5('0x43')]);return db['SquareDetailsReport'][_0xf4b5('0x44')](_0x1b6685)[_0xf4b5('0x1f')](handleEntityNotFound(_0x3c1189,null))['then'](respondWithResult(_0x3c1189,null))[_0xf4b5('0x3e')](handleError(_0x3c1189,null));};exports[_0xf4b5('0x45')]=function(_0x933722,_0x45edd1){return db['SquareDetailsReport'][_0xf4b5('0x45')](_0x933722[_0xf4b5('0x46')],{})[_0xf4b5('0x1f')](respondWithResult(_0x45edd1,0xc9))[_0xf4b5('0x3e')](handleError(_0x45edd1,null));};exports[_0xf4b5('0x47')]=function(_0x448c90,_0x2deef3){if(_0x448c90[_0xf4b5('0x46')]['id']){delete _0x448c90[_0xf4b5('0x46')]['id'];}return db[_0xf4b5('0x26')][_0xf4b5('0x44')]({'where':{'id':_0x448c90[_0xf4b5('0x40')]['id']}})[_0xf4b5('0x1f')](handleEntityNotFound(_0x2deef3,null))[_0xf4b5('0x1f')](saveUpdates(_0x448c90['body'],null))[_0xf4b5('0x1f')](respondWithResult(_0x2deef3,null))[_0xf4b5('0x3e')](handleError(_0x2deef3,null));};exports[_0xf4b5('0x1e')]=function(_0x5b90a7,_0x521583){return db[_0xf4b5('0x26')][_0xf4b5('0x44')]({'where':{'id':_0x5b90a7[_0xf4b5('0x40')]['id']}})[_0xf4b5('0x1f')](handleEntityNotFound(_0x521583,null))[_0xf4b5('0x1f')](removeEntity(_0x521583,null))[_0xf4b5('0x3e')](handleError(_0x521583,null));};exports['describe']=function(_0x5bef33,_0xb9629){return db[_0xf4b5('0x26')]['describe']()[_0xf4b5('0x1f')](respondWithResult(_0xb9629,null))['catch'](handleError(_0xb9629,null));};
\ No newline at end of file
index 62392c1..39bf882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3c2=['../../config/environment','./squareReportDetail.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xc3c2,0x117));var _0x2c3c=function(_0x55b0c8,_0x55d558){_0x55b0c8=_0x55b0c8-0x0;var _0x5c873f=_0xc3c2[_0x55b0c8];return _0x5c873f;};'use strict';var _=require(_0x2c3c('0x0'));var util=require('util');var logger=require(_0x2c3c('0x1'))(_0x2c3c('0x2'));var moment=require(_0x2c3c('0x3'));var BPromise=require(_0x2c3c('0x4'));var rp=require(_0x2c3c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c3c('0x6'));var config=require(_0x2c3c('0x7'));var attributes=require(_0x2c3c('0x8'));module[_0x2c3c('0x9')]=function(_0x5b5489,_0x698196){return _0x5b5489[_0x2c3c('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d17=['define','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x5c6092,_0x4c6be7){var _0x7da528=function(_0x49b524){while(--_0x49b524){_0x5c6092['push'](_0x5c6092['shift']());}};_0x7da528(++_0x4c6be7);}(_0x7d17,0x12a));var _0x77d1=function(_0x51aef6,_0x46fb55){_0x51aef6=_0x51aef6-0x0;var _0x2ed347=_0x7d17[_0x51aef6];return _0x2ed347;};'use strict';var _=require('lodash');var util=require(_0x77d1('0x0'));var logger=require(_0x77d1('0x1'))(_0x77d1('0x2'));var moment=require('moment');var BPromise=require(_0x77d1('0x3'));var rp=require(_0x77d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77d1('0x5'));var attributes=require(_0x77d1('0x6'));module[_0x77d1('0x7')]=function(_0x494225,_0x3ac0c9){return _0x494225[_0x77d1('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97139f4..cc73151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x5dda94,_0x291970){var _0x355c37=function(_0x5b3cfc){while(--_0x5b3cfc){_0x5dda94['push'](_0x5dda94['shift']());}};_0x355c37(++_0x291970);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xb9be[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')](_0x21aca6[_0xeb9b('0x1b')],{'raw':_0x21aca6[_0xeb9b('0x1c')]?_0x21aca6['options'][_0xeb9b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5d5f54){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x5d5f54));_0x3cbe3e(_0x5d5f54);})[_0xeb9b('0x17')](function(_0x37d7e0){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x37d7e0[_0xeb9b('0x16')],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x37d7e0[_0xeb9b('0x16')]));});});};
\ No newline at end of file
+var _0xe605=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw'];(function(_0x2005b0,_0x43cef2){var _0x1dda4d=function(_0x2d987a){while(--_0x2d987a){_0x2005b0['push'](_0x2005b0['shift']());}};_0x1dda4d(++_0x43cef2);}(_0xe605,0x92));var _0x5e60=function(_0x4b6d3c,_0x31cb35){_0x4b6d3c=_0x4b6d3c-0x0;var _0x56a931=_0xe605[_0x4b6d3c];return _0x56a931;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')](_0x5c485d[_0x5e60('0x19')],{'raw':_0x5c485d[_0x5e60('0x1a')]?_0x5c485d[_0x5e60('0x1a')][_0x5e60('0x1b')]===undefined?!![]:![]:!![]})[_0x5e60('0xd')](function(_0x524c93){logger[_0x5e60('0xe')](_0x5e60('0x16'),_0x5c485d);logger[_0x5e60('0x11')]('CreateSquareDetailsReport',_0x5c485d,JSON[_0x5e60('0x1c')](_0x524c93));_0x22d718(_0x524c93);})['catch'](function(_0x376069){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x376069[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x376069[_0x5e60('0x14')]));});});};
\ No newline at end of file
index 1df080c..df6a25e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b4a=['isAuthenticated','killProcess','express','../../components/auth/service','./system.controller','get','index'];(function(_0xc71578,_0x1cb2c6){var _0x294cfd=function(_0x6aa586){while(--_0x6aa586){_0xc71578['push'](_0xc71578['shift']());}};_0x294cfd(++_0x1cb2c6);}(_0x0b4a,0x1f3));var _0xa0b4=function(_0x33b732,_0x31a3fb){_0x33b732=_0x33b732-0x0;var _0x36955d=_0x0b4a[_0x33b732];return _0x36955d;};'use strict';var express=require(_0xa0b4('0x0'));var router=express['Router']();var auth=require(_0xa0b4('0x1'));var controller=require(_0xa0b4('0x2'));router[_0xa0b4('0x3')]('/',auth['isAuthenticated'](),controller[_0xa0b4('0x4')]);router['get']('/process/:pid/kill',auth[_0xa0b4('0x5')](),controller[_0xa0b4('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0xcfa9=['index','get','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x2e8ab0,_0x139531){var _0x37869c=function(_0x20a0b2){while(--_0x20a0b2){_0x2e8ab0['push'](_0x2e8ab0['shift']());}};_0x37869c(++_0x139531);}(_0xcfa9,0x19f));var _0x9cfa=function(_0x199b54,_0x27a324){_0x199b54=_0x199b54-0x0;var _0x44d5da=_0xcfa9[_0x199b54];return _0x44d5da;};'use strict';var express=require(_0x9cfa('0x0'));var router=express[_0x9cfa('0x1')]();var auth=require(_0x9cfa('0x2'));var controller=require(_0x9cfa('0x3'));router['get']('/',auth[_0x9cfa('0x4')](),controller[_0x9cfa('0x5')]);router[_0x9cfa('0x6')](_0x9cfa('0x7'),auth[_0x9cfa('0x4')](),controller[_0x9cfa('0x8')]);module[_0x9cfa('0x9')]=router;
\ No newline at end of file
index cd4eaeb..e37b112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc3=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','getAllData','json','killProcess','components/import/cm','params','pid','then','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT'];(function(_0x3304d7,_0x550912){var _0x2f6b15=function(_0x643057){while(--_0x643057){_0x3304d7['push'](_0x3304d7['shift']());}};_0x2f6b15(++_0x550912);}(_0x4cc3,0x1c4));var _0x34cc=function(_0x3d33b5,_0x3b312a){_0x3d33b5=_0x3d33b5-0x0;var _0xffb9b0=_0x4cc3[_0x3d33b5];return _0xffb9b0;};'use strict';var info=require(_0x34cc('0x0'));var exec=require(_0x34cc('0x1'))[_0x34cc('0x2')];var logger=require('../../config/logger')(_0x34cc('0x3'));var util=require('util');var BPromise=require(_0x34cc('0x4'));var _=require('lodash');function handleError(_0x257071,_0x7e92e7,_0x5e2e01){_0x7e92e7=_0x7e92e7||0x1f4;return function(_0x49ab5c){logger[_0x34cc('0x5')](_0x34cc('0x6'),_0x5e2e01,_0x7e92e7,util[_0x34cc('0x7')](_0x49ab5c,{'showHidden':![],'depth':null}));delete _0x49ab5c[_0x34cc('0x8')];_0x257071[_0x34cc('0x9')](_0x7e92e7)['send'](_0x49ab5c);};}exports['index']=function(_0x563e06,_0x635c37){return info[_0x34cc('0xa')]()['then'](function(_0x1a1e76){return _0x635c37[_0x34cc('0x9')](0xc8)[_0x34cc('0xb')](_0x1a1e76);})['catch'](function(_0x2627f3){return _0x635c37[_0x34cc('0x9')](0x1f4)['json'](_0x2627f3);});};exports[_0x34cc('0xc')]=function(_0xea84fb,_0x6704b6){var _0xbf4974=[_0x34cc('0xd')];return new BPromise(function(_0x4b0f0b,_0x30a970){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xea84fb[_0x34cc('0xe')][_0x34cc('0xf')]),function(_0x35d7f0,_0x41f109,_0x280547){if(_0x35d7f0){return _0x30a970(_0x35d7f0);}return _0x4b0f0b(_0x41f109);});})[_0x34cc('0x10')](function(_0x48d372){var _0x2b1217=![];var _0x169c0b=_0x48d372[_0x34cc('0x11')](/\n/);for(var _0x68d4b8=0x0,_0x396210=_0xbf4974[_0x34cc('0x12')];_0x68d4b8<_0x396210,_0x2b1217===![];_0x68d4b8+=0x1){if(_0x48d372[_0x34cc('0x13')](_0xbf4974[_0x68d4b8])>=0x0){_0x2b1217=!![];}}if(!_0x2b1217){throw new Error(util[_0x34cc('0x14')](_0x34cc('0x15'),_0xea84fb['params']['pid']));}process['kill'](_0xea84fb[_0x34cc('0xe')][_0x34cc('0xf')],_0x34cc('0x16'));return _0x6704b6[_0x34cc('0x9')](0xc8)['json']({'message':util['format'](_0x34cc('0x17'),_0xea84fb[_0x34cc('0xe')][_0x34cc('0xf')])});})[_0x34cc('0x18')](handleError(_0x6704b6,null,_0x34cc('0xc')));};
\ No newline at end of file
+var _0xdeb0=['indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','killProcess','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','index','getAllData','then','status','json','catch','components/import/cm','format','params','pid','length'];(function(_0x3b1c65,_0x258888){var _0x45c0e8=function(_0x3e48b3){while(--_0x3e48b3){_0x3b1c65['push'](_0x3b1c65['shift']());}};_0x45c0e8(++_0x258888);}(_0xdeb0,0x146));var _0x0deb=function(_0x35d59c,_0x4aa57e){_0x35d59c=_0x35d59c-0x0;var _0x55d5cc=_0xdeb0[_0x35d59c];return _0x55d5cc;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x0deb('0x0')];var logger=require(_0x0deb('0x1'))(_0x0deb('0x2'));var util=require('util');var BPromise=require(_0x0deb('0x3'));var _=require(_0x0deb('0x4'));function handleError(_0xb2454e,_0x1cbf75,_0x51a092){_0x1cbf75=_0x1cbf75||0x1f4;return function(_0x1f40be){logger[_0x0deb('0x5')](_0x0deb('0x6'),_0x51a092,_0x1cbf75,util['inspect'](_0x1f40be,{'showHidden':![],'depth':null}));delete _0x1f40be[_0x0deb('0x7')];_0xb2454e['status'](_0x1cbf75)['send'](_0x1f40be);};}exports[_0x0deb('0x8')]=function(_0x1b1466,_0x41af9c){return info[_0x0deb('0x9')]()[_0x0deb('0xa')](function(_0x280542){return _0x41af9c[_0x0deb('0xb')](0xc8)[_0x0deb('0xc')](_0x280542);})[_0x0deb('0xd')](function(_0x40d6de){return _0x41af9c[_0x0deb('0xb')](0x1f4)['json'](_0x40d6de);});};exports['killProcess']=function(_0x3470c8,_0x57f4f0){var _0x51c235=[_0x0deb('0xe')];return new BPromise(function(_0x457dd9,_0xebb6a5){return exec(util[_0x0deb('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3470c8[_0x0deb('0x10')][_0x0deb('0x11')]),function(_0x2f1736,_0x17aedf,_0x482440){if(_0x2f1736){return _0xebb6a5(_0x2f1736);}return _0x457dd9(_0x17aedf);});})['then'](function(_0x4303ce){var _0x26d645=![];var _0x50fa0e=_0x4303ce['split'](/\n/);for(var _0x263789=0x0,_0x58132b=_0x51c235[_0x0deb('0x12')];_0x263789<_0x58132b,_0x26d645===![];_0x263789+=0x1){if(_0x4303ce[_0x0deb('0x13')](_0x51c235[_0x263789])>=0x0){_0x26d645=!![];}}if(!_0x26d645){throw new Error(util['format'](_0x0deb('0x14'),_0x3470c8['params'][_0x0deb('0x11')]));}process['kill'](_0x3470c8[_0x0deb('0x10')][_0x0deb('0x11')],_0x0deb('0x15'));return _0x57f4f0[_0x0deb('0xb')](0xc8)[_0x0deb('0xc')]({'message':util[_0x0deb('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3470c8[_0x0deb('0x10')][_0x0deb('0x11')])});})[_0x0deb('0xd')](handleError(_0x57f4f0,null,_0x0deb('0x16')));};
\ No newline at end of file
index 35c97c6..759c231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94cc=['../../components/interaction/service','../../config/environment','./tag.controller','get','index','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x358a70,_0x1d3f61){var _0x209547=function(_0xd98467){while(--_0xd98467){_0x358a70['push'](_0x358a70['shift']());}};_0x209547(++_0x1d3f61);}(_0x94cc,0xf0));var _0xc94c=function(_0x5e1b2a,_0x91364f){_0x5e1b2a=_0x5e1b2a-0x0;var _0x485381=_0x94cc[_0x5e1b2a];return _0x485381;};'use strict';var multer=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var path=require(_0xc94c('0x2'));var timeout=require(_0xc94c('0x3'));var express=require(_0xc94c('0x4'));var router=express[_0xc94c('0x5')]();var fs_extra=require(_0xc94c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc94c('0x7'));var config=require(_0xc94c('0x8'));var controller=require(_0xc94c('0x9'));router[_0xc94c('0xa')]('/',auth['isAuthenticated'](),controller[_0xc94c('0xb')]);router[_0xc94c('0xa')]('/:id',auth[_0xc94c('0xc')](),controller[_0xc94c('0xd')]);router[_0xc94c('0xe')]('/',auth[_0xc94c('0xc')](),controller[_0xc94c('0xf')]);router[_0xc94c('0x10')]('/:id',auth[_0xc94c('0xc')](),controller['update']);router[_0xc94c('0x11')]('/:id',auth[_0xc94c('0xc')](),controller['destroy']);module[_0xc94c('0x12')]=router;
\ No newline at end of file
+var _0x275f=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./tag.controller','get','index','/:id','isAuthenticated','put','update'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x275f,0x1e2));var _0xf275=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x275f[_0x5e9d35];return _0x3beb2e;};'use strict';var multer=require(_0xf275('0x0'));var util=require('util');var path=require(_0xf275('0x1'));var timeout=require(_0xf275('0x2'));var express=require(_0xf275('0x3'));var router=express[_0xf275('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf275('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf275('0x6'));router[_0xf275('0x7')]('/',auth['isAuthenticated'](),controller[_0xf275('0x8')]);router['get'](_0xf275('0x9'),auth[_0xf275('0xa')](),controller['show']);router['post']('/',auth[_0xf275('0xa')](),controller['create']);router[_0xf275('0xb')]('/:id',auth[_0xf275('0xa')](),controller[_0xf275('0xc')]);router['delete'](_0xf275('0x9'),auth[_0xf275('0xa')](),controller[_0xf275('0xd')]);module[_0xf275('0xe')]=router;
\ No newline at end of file
index 9190840..217b25f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaec5=['#0091EA','sequelize','exports','STRING','name'];(function(_0x4f762f,_0xa5031c){var _0x4be10a=function(_0x44d394){while(--_0x44d394){_0x4f762f['push'](_0x4f762f['shift']());}};_0x4be10a(++_0xa5031c);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5aec('0x0'));module[_0x5aec('0x1')]={'name':{'type':Sequelize[_0x5aec('0x2')],'unique':_0x5aec('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5aec('0x2')],'defaultValue':_0x5aec('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6888=['name','#0091EA','sequelize','STRING'];(function(_0x3ac71b,_0x49e5cc){var _0x270718=function(_0x1c7400){while(--_0x1c7400){_0x3ac71b['push'](_0x3ac71b['shift']());}};_0x270718(++_0x49e5cc);}(_0x6888,0xd2));var _0x8688=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x6888[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0x8688('0x0'));module['exports']={'name':{'type':Sequelize[_0x8688('0x1')],'unique':_0x8688('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8688('0x1')],'defaultValue':_0x8688('0x3')},'description':{'type':Sequelize[_0x8688('0x1')]}};
\ No newline at end of file
index 0f3b037..d4c7faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984b=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','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','end','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','get','Tags','UserProfileResource','error','name','send','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x78c9,_0x402460){var _0x435b67=function(_0x430f36){while(--_0x430f36){_0x78c9['push'](_0x78c9['shift']());}};_0x435b67(++_0x402460);}(_0x984b,0xee));var _0xb984=function(_0x3dcaf5,_0x3317e8){_0x3dcaf5=_0x3dcaf5-0x0;var _0x4ab0cd=_0x984b[_0x3dcaf5];return _0x4ab0cd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb984('0x0'));var rp=require(_0xb984('0x1'));var moment=require(_0xb984('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb984('0x3'));var path=require(_0xb984('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb984('0x5'));var fs=require('fs');var fs_extra=require(_0xb984('0x6'));var _=require('lodash');var squel=require(_0xb984('0x7'));var crypto=require(_0xb984('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb984('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb984('0xa'));var Papa=require(_0xb984('0xb'));var Redis=require(_0xb984('0xc'));var authService=require(_0xb984('0xd'));var qs=require(_0xb984('0xe'));var as=require(_0xb984('0xf'));var hardwareService=require(_0xb984('0x10'));var logger=require(_0xb984('0x11'))(_0xb984('0x12'));var utils=require(_0xb984('0x13'));var config=require(_0xb984('0x14'));var licenseUtil=require(_0xb984('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b922b,_0x4b9c75){_0x4b9c75=_0x4b9c75||0xcc;return function(_0x61432f){if(_0x61432f){return _0x1b922b[_0xb984('0x16')](_0x4b9c75);}return _0x1b922b['status'](_0x4b9c75)[_0xb984('0x17')]();};}function respondWithResult(_0x2e7986,_0x564d24){_0x564d24=_0x564d24||0xc8;return function(_0x203dba){if(_0x203dba){return _0x2e7986[_0xb984('0x18')](_0x564d24)['json'](_0x203dba);}};}function respondWithFilteredResult(_0xede12d,_0x4073cb){return function(_0x57365c){if(_0x57365c){var _0x6fae41=typeof _0x4073cb['offset']===_0xb984('0x19')&&typeof _0x4073cb[_0xb984('0x1a')]===_0xb984('0x19');var _0x3f7cff=_0x57365c['count'];var _0x396c36=_0x6fae41?0x0:_0x4073cb[_0xb984('0x1b')];var _0x3a5c96=_0x6fae41?_0x57365c[_0xb984('0x1c')]:_0x4073cb[_0xb984('0x1b')]+_0x4073cb[_0xb984('0x1a')];var _0x5c2e25;if(_0x3a5c96>=_0x3f7cff){_0x3a5c96=_0x3f7cff;_0x5c2e25=0xc8;}else{_0x5c2e25=0xce;}_0xede12d[_0xb984('0x18')](_0x5c2e25);return _0xede12d[_0xb984('0x1d')](_0xb984('0x1e'),_0x396c36+'-'+_0x3a5c96+'/'+_0x3f7cff)[_0xb984('0x1f')](_0x57365c);}return null;};}function patchUpdates(_0x32831b){return function(_0xcf9365){try{jsonpatch['apply'](_0xcf9365,_0x32831b,!![]);}catch(_0x39d16f){return BPromise[_0xb984('0x20')](_0x39d16f);}return _0xcf9365['save']();};}function saveUpdates(_0x44b570,_0x97af5c){return function(_0x14734a){if(_0x14734a){return _0x14734a[_0xb984('0x21')](_0x44b570)[_0xb984('0x22')](function(_0x286033){return _0x286033;});}return null;};}function removeEntity(_0x41510a,_0x52c581){return function(_0x391a1e){if(_0x391a1e){return _0x391a1e[_0xb984('0x23')]()[_0xb984('0x22')](function(){var _0x5d4d38=_0x391a1e[_0xb984('0x24')]({'plain':!![]});var _0x2e806e=_0xb984('0x25');return db[_0xb984('0x26')][_0xb984('0x23')]({'where':{'type':_0x2e806e,'resourceId':_0x5d4d38['id']}})[_0xb984('0x22')](function(){return _0x391a1e;});})[_0xb984('0x22')](function(){_0x41510a[_0xb984('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249d47,_0x469af6){return function(_0x3e254b){if(!_0x3e254b){_0x249d47[_0xb984('0x16')](0x194);}return _0x3e254b;};}function handleError(_0x4fb896,_0xa44895){_0xa44895=_0xa44895||0x1f4;return function(_0x67e4d3){logger[_0xb984('0x27')](_0x67e4d3['stack']);if(_0x67e4d3[_0xb984('0x28')]){delete _0x67e4d3[_0xb984('0x28')];}_0x4fb896[_0xb984('0x18')](_0xa44895)[_0xb984('0x29')](_0x67e4d3);};}exports['index']=function(_0x5b8da1,_0x4dcf73){var _0x10b9ac={},_0x23ecf6={},_0x58a98c={'count':0x0,'rows':[]};var _0x320bef=_[_0xb984('0x2a')](db[_0xb984('0x2b')][_0xb984('0x2c')],function(_0x518bef){return{'name':_0x518bef['fieldName'],'type':_0x518bef[_0xb984('0x2d')][_0xb984('0x2e')]};});_0x23ecf6[_0xb984('0x2f')]=_[_0xb984('0x2a')](_0x320bef,'name');_0x23ecf6[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5b8da1[_0xb984('0x30')]);_0x23ecf6[_0xb984('0x32')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],_0x23ecf6['query']);_0x10b9ac[_0xb984('0x34')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],qs[_0xb984('0x35')](_0x5b8da1[_0xb984('0x30')][_0xb984('0x35')]));_0x10b9ac['attributes']=_0x10b9ac[_0xb984('0x34')][_0xb984('0x36')]?_0x10b9ac['attributes']:_0x23ecf6['model'];if(!_0x5b8da1[_0xb984('0x30')]['hasOwnProperty'](_0xb984('0x37'))){_0x10b9ac[_0xb984('0x1a')]=qs['limit'](_0x5b8da1[_0xb984('0x30')]['limit']);_0x10b9ac[_0xb984('0x1b')]=qs['offset'](_0x5b8da1[_0xb984('0x30')]['offset']);}_0x10b9ac['order']=qs[_0xb984('0x38')](_0x5b8da1[_0xb984('0x30')]['sort']);_0x10b9ac[_0xb984('0x39')]=qs[_0xb984('0x32')](_['pick'](_0x5b8da1[_0xb984('0x30')],_0x23ecf6[_0xb984('0x32')]),_0x320bef);if(_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]){_0x10b9ac['where']=_[_0xb984('0x3b')](_0x10b9ac[_0xb984('0x39')],{'$or':_[_0xb984('0x2a')](_0x320bef,function(_0x474fbd){if(_0x474fbd[_0xb984('0x2d')]!==_0xb984('0x3c')){var _0xc257ee={};_0xc257ee[_0x474fbd[_0xb984('0x28')]]={'$like':'%'+_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]+'%'};return _0xc257ee;}})});}_0x10b9ac=_['merge']({},_0x10b9ac,_0x5b8da1[_0xb984('0x3d')]);var _0xd10521={'where':_0x10b9ac[_0xb984('0x39')]};return db[_0xb984('0x2b')][_0xb984('0x1c')](_0xd10521)[_0xb984('0x22')](function(_0x1e8323){_0x58a98c[_0xb984('0x1c')]=_0x1e8323;if(_0x5b8da1['query']['includeAll']){_0x10b9ac[_0xb984('0x3e')]=[{'all':!![]}];}return db['Tag'][_0xb984('0x3f')](_0x10b9ac);})[_0xb984('0x22')](function(_0x216df6){_0x58a98c[_0xb984('0x40')]=_0x216df6;return _0x58a98c;})['then'](respondWithFilteredResult(_0x4dcf73,_0x10b9ac))[_0xb984('0x41')](handleError(_0x4dcf73,null));};exports[_0xb984('0x42')]=function(_0x5d5e85,_0x21a5bb){var _0xb61add={'raw':!![],'where':{'id':_0x5d5e85[_0xb984('0x43')]['id']}},_0x38a025={};_0x38a025[_0xb984('0x2f')]=_[_0xb984('0x31')](db[_0xb984('0x2b')]['rawAttributes']);_0x38a025[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5d5e85['query']);_0x38a025['filters']=_[_0xb984('0x33')](_0x38a025[_0xb984('0x2f')],_0x38a025[_0xb984('0x30')]);_0xb61add[_0xb984('0x34')]=_[_0xb984('0x33')](_0x38a025['model'],qs[_0xb984('0x35')](_0x5d5e85[_0xb984('0x30')][_0xb984('0x35')]));_0xb61add[_0xb984('0x34')]=_0xb61add[_0xb984('0x34')][_0xb984('0x36')]?_0xb61add[_0xb984('0x34')]:_0x38a025[_0xb984('0x2f')];if(_0x5d5e85[_0xb984('0x30')][_0xb984('0x44')]){_0xb61add['include']=[{'all':!![]}];}_0xb61add=_[_0xb984('0x3b')]({},_0xb61add,_0x5d5e85[_0xb984('0x3d')]);return db['Tag'][_0xb984('0x45')](_0xb61add)[_0xb984('0x22')](handleEntityNotFound(_0x21a5bb,null))[_0xb984('0x22')](respondWithResult(_0x21a5bb,null))[_0xb984('0x41')](handleError(_0x21a5bb,null));};exports[_0xb984('0x46')]=function(_0x49dde7,_0x10f813){return db[_0xb984('0x2b')][_0xb984('0x46')](_0x49dde7[_0xb984('0x47')],{})['then'](function(_0x2753e3){var _0x303280=_0x49dde7[_0xb984('0x48')][_0xb984('0x24')]({'plain':!![]});if(!_0x303280)throw new Error(_0xb984('0x49'));if(_0x303280[_0xb984('0x4a')]===_0xb984('0x48')){var _0x445f90=_0x2753e3[_0xb984('0x24')]({'plain':!![]});var _0x5c3d82=_0xb984('0x25');return db[_0xb984('0x4b')][_0xb984('0x45')]({'where':{'name':_0x5c3d82,'userProfileId':_0x303280['userProfileId']},'raw':!![]})[_0xb984('0x22')](function(_0x42a9f8){if(_0x42a9f8&&_0x42a9f8['autoAssociation']===0x0){return db[_0xb984('0x26')]['create']({'name':_0x445f90[_0xb984('0x28')],'resourceId':_0x445f90['id'],'type':_0x42a9f8[_0xb984('0x28')],'sectionId':_0x42a9f8['id']},{})['then'](function(){return _0x2753e3;});}else{return _0x2753e3;}})[_0xb984('0x41')](function(_0x38b1cb){logger[_0xb984('0x27')](_0xb984('0x4c'),_0x38b1cb);throw _0x38b1cb;});}return _0x2753e3;})[_0xb984('0x22')](respondWithResult(_0x10f813,0xc9))[_0xb984('0x41')](handleError(_0x10f813,null));};exports['update']=function(_0x1774a3,_0x5d06f8){if(_0x1774a3[_0xb984('0x47')]['id']){delete _0x1774a3[_0xb984('0x47')]['id'];}return db[_0xb984('0x2b')]['find']({'where':{'id':_0x1774a3['params']['id']}})[_0xb984('0x22')](handleEntityNotFound(_0x5d06f8,null))[_0xb984('0x22')](saveUpdates(_0x1774a3['body'],null))['then'](respondWithResult(_0x5d06f8,null))[_0xb984('0x41')](handleError(_0x5d06f8,null));};exports[_0xb984('0x23')]=function(_0x38cca4,_0x3daaa0){return db[_0xb984('0x2b')][_0xb984('0x45')]({'where':{'id':_0x38cca4['params']['id']}})['then'](handleEntityNotFound(_0x3daaa0,null))[_0xb984('0x22')](removeEntity(_0x3daaa0,null))[_0xb984('0x41')](handleError(_0x3daaa0,null));};
\ No newline at end of file
+var _0x76dc=['where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','name','send','Tag','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x50e001,_0x45aa55){var _0x3fe4a2=function(_0x42dd11){while(--_0x42dd11){_0x50e001['push'](_0x50e001['shift']());}};_0x3fe4a2(++_0x45aa55);}(_0x76dc,0x1f2));var _0xc76d=function(_0x2cc5d2,_0x2e07bd){_0x2cc5d2=_0x2cc5d2-0x0;var _0x165ba1=_0x76dc[_0x2cc5d2];return _0x165ba1;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['Tag']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['Tag']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['Tag']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));};
\ No newline at end of file
index 2a16df0..e48cf18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3def=['../../config/logger','api','moment','request-promise','rimraf','./tag.attributes','define','Tag','lodash','util'];(function(_0x40d80a,_0x5e5089){var _0x335bfb=function(_0x3bb568){while(--_0x3bb568){_0x40d80a['push'](_0x40d80a['shift']());}};_0x335bfb(++_0x5e5089);}(_0x3def,0x18e));var _0xf3de=function(_0x2672ce,_0x399d79){_0x2672ce=_0x2672ce-0x0;var _0x41d450=_0x3def[_0x2672ce];return _0x41d450;};'use strict';var _=require(_0xf3de('0x0'));var util=require(_0xf3de('0x1'));var logger=require(_0xf3de('0x2'))(_0xf3de('0x3'));var moment=require(_0xf3de('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3de('0x6'));var config=require('../../config/environment');var attributes=require(_0xf3de('0x7'));module['exports']=function(_0x421771,_0x241d06){return _0x421771[_0xf3de('0x8')](_0xf3de('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf18d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','Tag','tools_tags','lodash','util'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0xf18d,0x142));var _0xdf18=function(_0xa0ec9c,_0x1d05ff){_0xa0ec9c=_0xa0ec9c-0x0;var _0x367422=_0xf18d[_0xa0ec9c];return _0x367422;};'use strict';var _=require(_0xdf18('0x0'));var util=require(_0xdf18('0x1'));var logger=require('../../config/logger')(_0xdf18('0x2'));var moment=require(_0xdf18('0x3'));var BPromise=require(_0xdf18('0x4'));var rp=require(_0xdf18('0x5'));var fs=require('fs');var path=require(_0xdf18('0x6'));var rimraf=require(_0xdf18('0x7'));var config=require(_0xdf18('0x8'));var attributes=require(_0xdf18('0x9'));module['exports']=function(_0x18f9bf,_0x1b5744){return _0x18f9bf['define'](_0xdf18('0xa'),attributes,{'tableName':_0xdf18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b5c2a9c..32d6883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d8=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x372151,_0x203510){var _0x435475=function(_0x599b75){while(--_0x599b75){_0x372151['push'](_0x372151['shift']());}};_0x435475(++_0x203510);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xc6d8[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Tag,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}
\ No newline at end of file
+var _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2704c2,_0x513202){var _0x2dda59=function(_0x4da30f){while(--_0x4da30f){_0x2704c2['push'](_0x2704c2['shift']());}};_0x2dda59(++_0x513202);}(_0xe13a,0x178));var _0xae13=function(_0x221749,_0x494bee){_0x221749=_0x221749-0x0;var _0x2f9a96=_0xe13a[_0x221749];return _0x2f9a96;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});}
\ No newline at end of file
index 529a5e4..49e2991 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 b41ed55..1a94124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x10fe3b,_0x272fb4){var _0x5c8fa1=function(_0x59080d){while(--_0x59080d){_0x10fe3b['push'](_0x10fe3b['shift']());}};_0x5c8fa1(++_0x272fb4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0713=['STRING','name'];(function(_0x2e9736,_0x159e11){var _0x37bdc7=function(_0x5c02f6){while(--_0x5c02f6){_0x2e9736['push'](_0x2e9736['shift']());}};_0x37bdc7(++_0x159e11);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
index f7b003c..16ed80b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62fd=['filter','merge','where','type','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','channel','isValidChannel','Sequelize','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','Unknown\x20channel','addAgents','Voice','Chat','Mail','Whatsapp','transaction','through','penalty','User','findOrCreate','emit','Queue:save','online','UserVoiceQueueRt','upsert','isNil','format','interface','voicePause','TeamVoiceQueue','all','spread','removeAgents','Sms','Fax','parse','QueueId','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','Teams','end','error','stack','send','index','Team','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x306481,_0x20527a){var _0x33d816=function(_0x4fee0e){while(--_0x4fee0e){_0x306481['push'](_0x306481['shift']());}};_0x33d816(++_0x20527a);}(_0x62fd,0x14b));var _0xd62f=function(_0xce1bba,_0x22f3c4){_0xce1bba=_0xce1bba-0x0;var _0x44f562=_0x62fd[_0xce1bba];return _0x44f562;};'use strict';var emlformat=require(_0xd62f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd62f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd62f('0x2'));var moment=require('moment');var BPromise=require(_0xd62f('0x3'));var Mustache=require(_0xd62f('0x4'));var util=require(_0xd62f('0x5'));var path=require(_0xd62f('0x6'));var sox=require('sox');var csv=require(_0xd62f('0x7'));var ejs=require(_0xd62f('0x8'));var fs=require('fs');var fs_extra=require(_0xd62f('0x9'));var _=require(_0xd62f('0xa'));var squel=require(_0xd62f('0xb'));var crypto=require(_0xd62f('0xc'));var jsforce=require(_0xd62f('0xd'));var deskjs=require(_0xd62f('0xe'));var toCsv=require(_0xd62f('0x7'));var querystring=require(_0xd62f('0xf'));var Papa=require(_0xd62f('0x10'));var Redis=require('ioredis');var authService=require(_0xd62f('0x11'));var qs=require(_0xd62f('0x12'));var as=require(_0xd62f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd62f('0x14'))(_0xd62f('0x15'));var utils=require('../../config/utils');var config=require(_0xd62f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd62f('0x17')]=_[_0xd62f('0x18')](config['redis'],{'host':_0xd62f('0x19'),'port':0x18eb});var socket=require(_0xd62f('0x1a'))(new Redis(config[_0xd62f('0x17')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x4dbad4,_0x5cb0a5){_0x5cb0a5=_0x5cb0a5||0xcc;return function(_0x367d47){if(_0x367d47){return _0x4dbad4[_0xd62f('0x1b')](_0x5cb0a5);}return _0x4dbad4[_0xd62f('0x1c')](_0x5cb0a5)['end']();};}function respondWithResult(_0x340a51,_0x2b7060){_0x2b7060=_0x2b7060||0xc8;return function(_0x346001){if(_0x346001){return _0x340a51[_0xd62f('0x1c')](_0x2b7060)[_0xd62f('0x1d')](_0x346001);}};}function respondWithFilteredResult(_0x2d7111,_0x6918cc){return function(_0x435893){if(_0x435893){var _0x55d3f0=typeof _0x6918cc['offset']===_0xd62f('0x1e')&&typeof _0x6918cc[_0xd62f('0x1f')]===_0xd62f('0x1e');var _0x228f04=_0x435893[_0xd62f('0x20')];var _0x31f12d=_0x55d3f0?0x0:_0x6918cc['offset'];var _0x2ccf57=_0x55d3f0?_0x435893[_0xd62f('0x20')]:_0x6918cc[_0xd62f('0x21')]+_0x6918cc[_0xd62f('0x1f')];var _0x33b642;if(_0x2ccf57>=_0x228f04){_0x2ccf57=_0x228f04;_0x33b642=0xc8;}else{_0x33b642=0xce;}_0x2d7111['status'](_0x33b642);return _0x2d7111[_0xd62f('0x22')](_0xd62f('0x23'),_0x31f12d+'-'+_0x2ccf57+'/'+_0x228f04)[_0xd62f('0x1d')](_0x435893);}return null;};}function patchUpdates(_0x507ff0){return function(_0x185c18){try{jsonpatch[_0xd62f('0x24')](_0x185c18,_0x507ff0,!![]);}catch(_0x147ef0){return BPromise[_0xd62f('0x25')](_0x147ef0);}return _0x185c18['save']();};}function saveUpdates(_0xc2352d,_0x3ad8eb){return function(_0x633068){if(_0x633068){return _0x633068[_0xd62f('0x26')](_0xc2352d)[_0xd62f('0x27')](function(_0x376d9b){return _0x376d9b;});}return null;};}function removeEntity(_0x768869,_0x560fe0){return function(_0x88eb7e){if(_0x88eb7e){return _0x88eb7e[_0xd62f('0x28')]()[_0xd62f('0x27')](function(){var _0x4c1a40=_0x88eb7e['get']({'plain':!![]});var _0x1ab757=_0xd62f('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ab757,'resourceId':_0x4c1a40['id']}})['then'](function(){return _0x88eb7e;});})[_0xd62f('0x27')](function(){_0x768869[_0xd62f('0x1c')](0xcc)[_0xd62f('0x2a')]();});}};}function handleEntityNotFound(_0x284791,_0x5ac9e0){return function(_0x4a9db9){if(!_0x4a9db9){_0x284791[_0xd62f('0x1b')](0x194);}return _0x4a9db9;};}function handleError(_0x2c0ee4,_0x4e3a13){_0x4e3a13=_0x4e3a13||0x1f4;return function(_0x27ab80){logger[_0xd62f('0x2b')](_0x27ab80[_0xd62f('0x2c')]);if(_0x27ab80['name']){delete _0x27ab80['name'];}_0x2c0ee4[_0xd62f('0x1c')](_0x4e3a13)[_0xd62f('0x2d')](_0x27ab80);};}exports[_0xd62f('0x2e')]=function(_0x128b37,_0x5f259e){var _0x2f1e55={},_0x455462={},_0x4ff60f={'count':0x0,'rows':[]};var _0xfbbdb8=_['map'](db[_0xd62f('0x2f')]['rawAttributes'],function(_0x3dc465){return{'name':_0x3dc465['fieldName'],'type':_0x3dc465['type'][_0xd62f('0x30')]};});_0x455462[_0xd62f('0x31')]=_[_0xd62f('0x32')](_0xfbbdb8,'name');_0x455462['query']=_[_0xd62f('0x33')](_0x128b37[_0xd62f('0x34')]);_0x455462[_0xd62f('0x35')]=_['intersection'](_0x455462['model'],_0x455462[_0xd62f('0x34')]);_0x2f1e55[_0xd62f('0x36')]=_['intersection'](_0x455462[_0xd62f('0x31')],qs['fields'](_0x128b37['query'][_0xd62f('0x37')]));_0x2f1e55['attributes']=_0x2f1e55[_0xd62f('0x36')][_0xd62f('0x38')]?_0x2f1e55[_0xd62f('0x36')]:_0x455462['model'];if(!_0x128b37[_0xd62f('0x34')][_0xd62f('0x39')](_0xd62f('0x3a'))){_0x2f1e55[_0xd62f('0x1f')]=qs[_0xd62f('0x1f')](_0x128b37[_0xd62f('0x34')][_0xd62f('0x1f')]);_0x2f1e55[_0xd62f('0x21')]=qs[_0xd62f('0x21')](_0x128b37['query'][_0xd62f('0x21')]);}_0x2f1e55[_0xd62f('0x3b')]=qs[_0xd62f('0x3c')](_0x128b37[_0xd62f('0x34')]['sort']);_0x2f1e55['where']=qs[_0xd62f('0x35')](_[_0xd62f('0x3d')](_0x128b37['query'],_0x455462[_0xd62f('0x35')]),_0xfbbdb8);if(_0x128b37[_0xd62f('0x34')][_0xd62f('0x3e')]){_0x2f1e55['where']=_[_0xd62f('0x3f')](_0x2f1e55[_0xd62f('0x40')],{'$or':_[_0xd62f('0x32')](_0xfbbdb8,function(_0x597000){if(_0x597000[_0xd62f('0x41')]!==_0xd62f('0x42')){var _0x231248={};_0x231248[_0x597000[_0xd62f('0x43')]]={'$like':'%'+_0x128b37[_0xd62f('0x34')][_0xd62f('0x3e')]+'%'};return _0x231248;}})});}_0x2f1e55=_['merge']({},_0x2f1e55,_0x128b37['options']);var _0x30a2cb={'where':_0x2f1e55[_0xd62f('0x40')]};return db[_0xd62f('0x2f')]['count'](_0x30a2cb)['then'](function(_0x304b62){_0x4ff60f[_0xd62f('0x20')]=_0x304b62;if(_0x128b37['query'][_0xd62f('0x44')]){_0x2f1e55[_0xd62f('0x45')]=[{'all':!![]}];}return db[_0xd62f('0x2f')][_0xd62f('0x46')](_0x2f1e55);})['then'](function(_0xbb2663){_0x4ff60f[_0xd62f('0x47')]=_0xbb2663;return _0x4ff60f;})['then'](respondWithFilteredResult(_0x5f259e,_0x2f1e55))[_0xd62f('0x48')](handleError(_0x5f259e,null));};exports[_0xd62f('0x49')]=function(_0x23f114,_0x2be267){var _0x39ee1e={'raw':![],'where':{'id':_0x23f114[_0xd62f('0x4a')]['id']}},_0x550d9b={};_0x550d9b['model']=_[_0xd62f('0x33')](db[_0xd62f('0x2f')][_0xd62f('0x4b')]);_0x550d9b[_0xd62f('0x34')]=_[_0xd62f('0x33')](_0x23f114[_0xd62f('0x34')]);_0x550d9b['filters']=_['intersection'](_0x550d9b[_0xd62f('0x31')],_0x550d9b[_0xd62f('0x34')]);_0x39ee1e[_0xd62f('0x36')]=_[_0xd62f('0x4c')](_0x550d9b[_0xd62f('0x31')],qs['fields'](_0x23f114[_0xd62f('0x34')][_0xd62f('0x37')]));_0x39ee1e[_0xd62f('0x36')]=_0x39ee1e[_0xd62f('0x36')][_0xd62f('0x38')]?_0x39ee1e[_0xd62f('0x36')]:_0x550d9b['model'];if(_0x23f114[_0xd62f('0x34')]['includeAll']){_0x39ee1e[_0xd62f('0x45')]=[{'all':!![]}];}_0x39ee1e=_[_0xd62f('0x3f')]({},_0x39ee1e,_0x23f114[_0xd62f('0x4d')]);return db[_0xd62f('0x2f')]['find'](_0x39ee1e)['then'](handleEntityNotFound(_0x2be267,null))[_0xd62f('0x27')](respondWithResult(_0x2be267,null))[_0xd62f('0x48')](handleError(_0x2be267,null));};exports[_0xd62f('0x4e')]=function(_0x8ebb0a,_0x41b0ed){return db['Team']['create'](_0x8ebb0a['body'],{})[_0xd62f('0x27')](function(_0x5232e2){var _0x4524ac=_0x8ebb0a['user'][_0xd62f('0x4f')]({'plain':!![]});if(!_0x4524ac)throw new Error(_0xd62f('0x50'));if(_0x4524ac[_0xd62f('0x51')]===_0xd62f('0x52')){var _0x4aeccb=_0x5232e2[_0xd62f('0x4f')]({'plain':!![]});var _0x54dc54=_0xd62f('0x29');return db[_0xd62f('0x53')][_0xd62f('0x54')]({'where':{'name':_0x54dc54,'userProfileId':_0x4524ac[_0xd62f('0x55')]},'raw':!![]})['then'](function(_0x700313){if(_0x700313&&_0x700313[_0xd62f('0x56')]===0x0){return db[_0xd62f('0x57')][_0xd62f('0x4e')]({'name':_0x4aeccb[_0xd62f('0x43')],'resourceId':_0x4aeccb['id'],'type':_0x700313['name'],'sectionId':_0x700313['id']},{})['then'](function(){return _0x5232e2;});}else{return _0x5232e2;}})[_0xd62f('0x48')](function(_0x4f163c){logger[_0xd62f('0x2b')](_0xd62f('0x58'),_0x4f163c);throw _0x4f163c;});}return _0x5232e2;})[_0xd62f('0x27')](respondWithResult(_0x41b0ed,0xc9))[_0xd62f('0x48')](handleError(_0x41b0ed,null));};exports[_0xd62f('0x26')]=function(_0x473622,_0x177ecd){if(_0x473622['body']['id']){delete _0x473622[_0xd62f('0x59')]['id'];}return db[_0xd62f('0x2f')][_0xd62f('0x54')]({'where':{'id':_0x473622['params']['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x177ecd,null))[_0xd62f('0x27')](saveUpdates(_0x473622['body'],null))[_0xd62f('0x27')](respondWithResult(_0x177ecd,null))[_0xd62f('0x48')](handleError(_0x177ecd,null));};exports['destroy']=function(_0x21a9f2,_0x539262){return db[_0xd62f('0x2f')][_0xd62f('0x54')]({'where':{'id':_0x21a9f2['params']['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x539262,null))['then'](removeEntity(_0x539262,null))[_0xd62f('0x48')](handleError(_0x539262,null));};exports['getQueues']=function(_0x21522b,_0x130027,_0x2a1222){return db[_0xd62f('0x2f')][_0xd62f('0x5a')]({'where':{'id':_0x21522b[_0xd62f('0x4a')]['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x130027,null))[_0xd62f('0x27')](function(_0x559ee0){if(!_0x21522b[_0xd62f('0x34')][_0xd62f('0x5b')]||!utils[_0xd62f('0x5c')](_0x21522b[_0xd62f('0x34')][_0xd62f('0x5b')])){throw new db[(_0xd62f('0x5d'))]['ValidationError']('Unknown\x20channel');}var _0x223638={};var _0x2eaba3={};_0x2eaba3['model']=_[_0xd62f('0x33')](db[_[_0xd62f('0x5e')](_0x21522b['query'][_0xd62f('0x5b')][_0xd62f('0x5f')]())+_0xd62f('0x60')]['rawAttributes']);_0x2eaba3[_0xd62f('0x34')]=_['keys'](_0x21522b['query']);_0x2eaba3['filters']=_[_0xd62f('0x4c')](_0x2eaba3['model'],_0x2eaba3[_0xd62f('0x34')]);_0x223638[_0xd62f('0x36')]=_['intersection'](_0x2eaba3['model'],qs[_0xd62f('0x37')](_0x21522b[_0xd62f('0x34')][_0xd62f('0x37')]));_0x223638[_0xd62f('0x36')]=_0x223638[_0xd62f('0x36')]['length']?_0x223638[_0xd62f('0x36')]:_0x2eaba3[_0xd62f('0x31')];_0x223638['limit']=qs[_0xd62f('0x1f')](_0x21522b[_0xd62f('0x34')]['limit']);_0x223638[_0xd62f('0x21')]=qs['offset'](_0x21522b[_0xd62f('0x34')][_0xd62f('0x21')]);_0x223638[_0xd62f('0x3b')]=qs[_0xd62f('0x3c')](_0x21522b['query'][_0xd62f('0x3c')]);_0x223638['where']=qs['filters'](_[_0xd62f('0x3d')](_0x21522b[_0xd62f('0x34')],_0x2eaba3[_0xd62f('0x35')]));_0x223638=_[_0xd62f('0x3f')]({},_0x223638,_0x21522b[_0xd62f('0x4d')]);return _0x559ee0[_0xd62f('0x4f')+_[_0xd62f('0x5e')](_0x21522b[_0xd62f('0x34')][_0xd62f('0x5b')][_0xd62f('0x5f')]())+_0xd62f('0x61')](_0x223638);})[_0xd62f('0x27')](respondWithResult(_0x130027,null))[_0xd62f('0x48')](handleError(_0x130027,null));};exports[_0xd62f('0x62')]=function(_0x22af7b,_0x10e641,_0x3b1506){return db[_0xd62f('0x2f')]['findOne']({'where':{'id':_0x22af7b[_0xd62f('0x4a')]['id']}})[_0xd62f('0x27')](function(_0x50383a){if(_0x50383a){if(!_0x22af7b[_0xd62f('0x59')][_0xd62f('0x5b')]||!utils[_0xd62f('0x5c')](_0x22af7b[_0xd62f('0x59')][_0xd62f('0x5b')])){throw new db[(_0xd62f('0x5d'))]['ValidationError']('Unknown\x20channel');}return _0x50383a[_0xd62f('0x63')+_[_0xd62f('0x5e')](_0x22af7b[_0xd62f('0x59')][_0xd62f('0x5b')][_0xd62f('0x5f')]())+_0xd62f('0x61')](_0x22af7b[_0xd62f('0x59')][_0xd62f('0x64')]);}return null;})[_0xd62f('0x27')](handleEntityNotFound(_0x10e641,null))[_0xd62f('0x27')](respondWithStatusCode(_0x10e641,null))[_0xd62f('0x48')](handleError(_0x10e641,null));};exports[_0xd62f('0x65')]=function(_0x576fc1,_0x3fae4f,_0x4ca749){return db[_0xd62f('0x2f')][_0xd62f('0x5a')]({'where':{'id':_0x576fc1[_0xd62f('0x4a')]['id']}})[_0xd62f('0x27')](function(_0x28016b){if(_0x28016b){if(!_0x576fc1[_0xd62f('0x34')]['channel']||!utils[_0xd62f('0x5c')](_0x576fc1[_0xd62f('0x34')][_0xd62f('0x5b')])){throw new db[(_0xd62f('0x5d'))]['ValidationError'](_0xd62f('0x66'));}return _0x28016b['remove'+_[_0xd62f('0x5e')](_0x576fc1['query']['channel']['toLowerCase']())+_0xd62f('0x61')](_0x576fc1[_0xd62f('0x34')]['ids']);}return null;})['then'](handleEntityNotFound(_0x3fae4f,null))[_0xd62f('0x27')](respondWithStatusCode(_0x3fae4f,null))[_0xd62f('0x48')](handleError(_0x3fae4f,null));};exports[_0xd62f('0x67')]=function(_0x259f04,_0x5f47db){return db['Team'][_0xd62f('0x54')]({'where':{'id':_0x259f04[_0xd62f('0x4a')]['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x5f47db,null))[_0xd62f('0x27')](function(_0x278842){if(_0x278842){var _0x369aa8=[_0xd62f('0x68'),_0xd62f('0x69'),_0xd62f('0x6a'),'Sms','Fax','Openchannel',_0xd62f('0x6b')];return db['sequelize'][_0xd62f('0x6c')](function(_0x494aa0){var _0x148d03=_[_0xd62f('0x32')](_0x369aa8,function(_0x581c39){var _0x1152f2={'attributes':['id',_0xd62f('0x43')]};if(_0x581c39==='Voice'){_0x1152f2[_0xd62f('0x6d')]={'attributes':[_0xd62f('0x6e')]};}return _0x278842['get'+_0x581c39+'Queues'](_0x1152f2)[_0xd62f('0x27')](function(_0x115666){var _0x27bee3=_[_0xd62f('0x32')](_0x115666,function(_0x287650){var _0x5959c1=_[_0xd62f('0x32')](_0x259f04['body'][_0xd62f('0x64')],function(_0x224c24){var _0x27aa00={'where':{'UserId':_0x224c24,[_0x581c39+'QueueId']:_0x287650['id']},'transaction':_0x494aa0};if(_0x581c39==='Voice'){_0x27aa00['defaults']={'penalty':_0x287650['TeamVoiceQueue'][_0xd62f('0x6e')]};}return db[_0xd62f('0x6f')+_0x581c39+'Queue'][_0xd62f('0x70')](_0x27aa00)[_0xd62f('0x27')](function(){socket[_0xd62f('0x71')](_0xd62f('0x52')+_0x581c39+_0xd62f('0x72'),{'UserId':_0x224c24,[_0x581c39+'QueueId']:_0x287650['id']});if(_0x581c39!==_0xd62f('0x68'))return;return db[_0xd62f('0x6f')][_0xd62f('0x46')]({'where':{'id':_0x259f04['body']['ids'],'online':0x1},'attributes':['id',_0xd62f('0x43'),_0xd62f('0x73'),'voicePause','interface'],'raw':!![]})[_0xd62f('0x27')](function(_0x262860){var _0x54bc3c=_[_0xd62f('0x32')](_0x262860,function(_0x26c9d2){return db[_0xd62f('0x74')][_0xd62f('0x75')]({'membername':_0x26c9d2[_0xd62f('0x43')],'UserId':_0x26c9d2['id'],'queue_name':_0x287650[_0xd62f('0x43')],'VoiceQueueId':_0x287650['id'],'interface':_[_0xd62f('0x76')](_0x26c9d2['interface'])?util[_0xd62f('0x77')]('SIP/%s',_0x26c9d2[_0xd62f('0x43')]):_0x26c9d2[_0xd62f('0x78')],'paused':_0x26c9d2[_0xd62f('0x79')]||![],'penalty':_0x287650[_0xd62f('0x7a')][_0xd62f('0x6e')]},{'transaction':_0x494aa0});});return Promise[_0xd62f('0x7b')](_0x54bc3c);});});});return Promise[_0xd62f('0x7b')](_0x5959c1);});return Promise['all'](_0x27bee3);});});return Promise[_0xd62f('0x7b')](_0x148d03)[_0xd62f('0x27')](function(){return _0x278842['addAgents'](_0x259f04[_0xd62f('0x59')]['ids'],{'transaction':_0x494aa0})[_0xd62f('0x7c')](function(_0x16fe0e){return _0x16fe0e;});});});}})['then'](respondWithResult(_0x5f47db,null))[_0xd62f('0x48')](handleError(_0x5f47db,null));};exports[_0xd62f('0x7d')]=function(_0x1fd377,_0x1bf60d){return db['Team'][_0xd62f('0x54')]({'where':{'id':_0x1fd377[_0xd62f('0x4a')]['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x1bf60d,null))[_0xd62f('0x27')](function(_0x2fd91d){if(_0x2fd91d){var _0x2ee8de=[_0xd62f('0x68'),_0xd62f('0x69'),_0xd62f('0x6a'),_0xd62f('0x7e'),_0xd62f('0x7f'),'Openchannel',_0xd62f('0x6b')];return db['sequelize'][_0xd62f('0x6c')](function(_0x462ba4){var _0x296738=_[_0xd62f('0x32')](_0x2ee8de,function(_0x4ee699){var _0x47b298={'attributes':['id',_0xd62f('0x43')]};return _0x2fd91d['get'+_0x4ee699+_0xd62f('0x61')](_0x47b298)[_0xd62f('0x27')](function(_0x15a36a){var _0x40a538=_[_0xd62f('0x32')](_0x15a36a,function(_0x5b41e8){return _0x5b41e8[_0xd62f('0x7d')](_0x1fd377[_0xd62f('0x34')][_0xd62f('0x64')],{'transaction':_0x462ba4})['then'](function(){var _0x14f398=JSON[_0xd62f('0x80')]('['+_0x1fd377[_0xd62f('0x34')][_0xd62f('0x64')]+']');var _0x974ad5=_[_0xd62f('0x32')](_0x14f398,function(_0x4c824a){socket[_0xd62f('0x71')](_0xd62f('0x52')+_0x4ee699+'Queue:remove',{'UserId':Number(_0x4c824a),[_0x4ee699+_0xd62f('0x81')]:_0x5b41e8['id']});if(_0x4ee699!==_0xd62f('0x68'))return;return db[_0xd62f('0x74')]['destroy']({'where':{'VoiceQueueId':_0x5b41e8['id'],'UserId':_0x4c824a},'transaction':_0x462ba4});});return Promise[_0xd62f('0x7b')](_0x974ad5);});});return Promise['all'](_0x40a538);});});return Promise[_0xd62f('0x7b')](_0x296738)['then'](function(){return _0x2fd91d[_0xd62f('0x7d')](_0x1fd377['query'][_0xd62f('0x64')],{'transaction':_0x462ba4});});});}})[_0xd62f('0x27')](respondWithStatusCode(_0x1bf60d,null))[_0xd62f('0x48')](handleError(_0x1bf60d,null));};exports[_0xd62f('0x82')]=function(_0x25d26f,_0x21baf9,_0x4945c9){var _0x41c289={};var _0x3a623b={};var _0x18e5ff;var _0x11e843;return db['Team']['findOne']({'where':{'id':_0x25d26f['params']['id']}})[_0xd62f('0x27')](handleEntityNotFound(_0x21baf9,null))[_0xd62f('0x27')](function(_0xacb9e1){if(_0xacb9e1){_0x18e5ff=_0xacb9e1;_0x3a623b[_0xd62f('0x31')]=_[_0xd62f('0x33')](db[_0xd62f('0x6f')][_0xd62f('0x4b')]);_0x3a623b['query']=_[_0xd62f('0x33')](_0x25d26f[_0xd62f('0x34')]);_0x3a623b[_0xd62f('0x35')]=_['intersection'](_0x3a623b['model'],_0x3a623b[_0xd62f('0x34')]);_0x41c289[_0xd62f('0x36')]=_[_0xd62f('0x4c')](_0x3a623b[_0xd62f('0x31')],qs[_0xd62f('0x37')](_0x25d26f[_0xd62f('0x34')]['fields']));_0x41c289[_0xd62f('0x36')]=_0x41c289[_0xd62f('0x36')]['length']?_0x41c289[_0xd62f('0x36')]:_0x3a623b['model'];_0x41c289[_0xd62f('0x3b')]=qs[_0xd62f('0x3c')](_0x25d26f[_0xd62f('0x34')][_0xd62f('0x3c')]);_0x41c289[_0xd62f('0x40')]=qs[_0xd62f('0x35')](_[_0xd62f('0x3d')](_0x25d26f[_0xd62f('0x34')],_0x3a623b[_0xd62f('0x35')]));if(_0x25d26f['query'][_0xd62f('0x3e')]){_0x41c289[_0xd62f('0x40')]=_[_0xd62f('0x3f')](_0x41c289[_0xd62f('0x40')],{'$or':_[_0xd62f('0x32')](_0x41c289['attributes'],function(_0xdc330d){var _0x1d366a={};_0x1d366a[_0xdc330d]={'$like':'%'+_0x25d26f[_0xd62f('0x34')][_0xd62f('0x3e')]+'%'};return _0x1d366a;})});}_0x41c289=_[_0xd62f('0x3f')]({},_0x41c289,_0x25d26f[_0xd62f('0x4d')]);return _0x18e5ff[_0xd62f('0x82')](_0x41c289);}})[_0xd62f('0x27')](function(_0x172347){if(_0x172347){_0x11e843=_0x172347[_0xd62f('0x38')];if(!_0x25d26f[_0xd62f('0x34')]['hasOwnProperty']('nolimit')){_0x41c289['limit']=qs[_0xd62f('0x1f')](_0x25d26f[_0xd62f('0x34')][_0xd62f('0x1f')]);_0x41c289['offset']=qs[_0xd62f('0x21')](_0x25d26f[_0xd62f('0x34')][_0xd62f('0x21')]);}return _0x18e5ff[_0xd62f('0x82')](_0x41c289);}})['then'](function(_0x241206){if(_0x241206){return _0x241206?{'count':_0x11e843,'rows':_0x241206}:null;}})[_0xd62f('0x27')](respondWithResult(_0x21baf9,null))['catch'](handleError(_0x21baf9,null));};
\ No newline at end of file
+var _0x9780=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Team','includeAll','include','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','find','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','capitalize','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','isNil','SIP/%s','all','spread','removeAgents','parse','Queue:remove','getAgents','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Teams','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model'];(function(_0x3eafc0,_0x216fc2){var _0x126113=function(_0x9f42df){while(--_0x9f42df){_0x3eafc0['push'](_0x3eafc0['shift']());}};_0x126113(++_0x216fc2);}(_0x9780,0x14e));var _0x0978=function(_0x1d484c,_0x27c954){_0x1d484c=_0x1d484c-0x0;var _0xb2ec18=_0x9780[_0x1d484c];return _0xb2ec18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0978('0x0'));var zipdir=require(_0x0978('0x1'));var jsonpatch=require(_0x0978('0x2'));var rp=require(_0x0978('0x3'));var moment=require(_0x0978('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0978('0x5'));var path=require(_0x0978('0x6'));var sox=require(_0x0978('0x7'));var csv=require('to-csv');var ejs=require(_0x0978('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0978('0x9'));var squel=require(_0x0978('0xa'));var crypto=require(_0x0978('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0978('0xc'));var toCsv=require(_0x0978('0xd'));var querystring=require(_0x0978('0xe'));var Papa=require(_0x0978('0xf'));var Redis=require(_0x0978('0x10'));var authService=require(_0x0978('0x11'));var qs=require(_0x0978('0x12'));var as=require(_0x0978('0x13'));var hardwareService=require(_0x0978('0x14'));var logger=require(_0x0978('0x15'))('api');var utils=require(_0x0978('0x16'));var config=require(_0x0978('0x17'));var licenseUtil=require(_0x0978('0x18'));var db=require(_0x0978('0x19'))['db'];config[_0x0978('0x1a')]=_[_0x0978('0x1b')](config[_0x0978('0x1a')],{'host':_0x0978('0x1c'),'port':0x18eb});var socket=require(_0x0978('0x1d'))(new Redis(config[_0x0978('0x1a')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x19b0c4,_0x2bcc95){_0x2bcc95=_0x2bcc95||0xcc;return function(_0xd44dcf){if(_0xd44dcf){return _0x19b0c4[_0x0978('0x1e')](_0x2bcc95);}return _0x19b0c4[_0x0978('0x1f')](_0x2bcc95)['end']();};}function respondWithResult(_0x1db3b0,_0x5467cf){_0x5467cf=_0x5467cf||0xc8;return function(_0xd064ad){if(_0xd064ad){return _0x1db3b0[_0x0978('0x1f')](_0x5467cf)[_0x0978('0x20')](_0xd064ad);}};}function respondWithFilteredResult(_0x3ea329,_0x178f26){return function(_0x152291){if(_0x152291){var _0x11b5ca=typeof _0x178f26[_0x0978('0x21')]===_0x0978('0x22')&&typeof _0x178f26[_0x0978('0x23')]===_0x0978('0x22');var _0x5dde99=_0x152291[_0x0978('0x24')];var _0x16634f=_0x11b5ca?0x0:_0x178f26[_0x0978('0x21')];var _0x9e178c=_0x11b5ca?_0x152291[_0x0978('0x24')]:_0x178f26[_0x0978('0x21')]+_0x178f26[_0x0978('0x23')];var _0x4b69f5;if(_0x9e178c>=_0x5dde99){_0x9e178c=_0x5dde99;_0x4b69f5=0xc8;}else{_0x4b69f5=0xce;}_0x3ea329[_0x0978('0x1f')](_0x4b69f5);return _0x3ea329[_0x0978('0x25')](_0x0978('0x26'),_0x16634f+'-'+_0x9e178c+'/'+_0x5dde99)['json'](_0x152291);}return null;};}function patchUpdates(_0x198fb1){return function(_0x57e0e){try{jsonpatch[_0x0978('0x27')](_0x57e0e,_0x198fb1,!![]);}catch(_0x54f704){return BPromise[_0x0978('0x28')](_0x54f704);}return _0x57e0e[_0x0978('0x29')]();};}function saveUpdates(_0x59dbf2,_0x173c81){return function(_0x2398c5){if(_0x2398c5){return _0x2398c5[_0x0978('0x2a')](_0x59dbf2)['then'](function(_0x244c6a){return _0x244c6a;});}return null;};}function removeEntity(_0x2551c4,_0x4147b6){return function(_0x2d6f08){if(_0x2d6f08){return _0x2d6f08[_0x0978('0x2b')]()[_0x0978('0x2c')](function(){var _0x3fb0bf=_0x2d6f08[_0x0978('0x2d')]({'plain':!![]});var _0x3ce399=_0x0978('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ce399,'resourceId':_0x3fb0bf['id']}})[_0x0978('0x2c')](function(){return _0x2d6f08;});})[_0x0978('0x2c')](function(){_0x2551c4[_0x0978('0x1f')](0xcc)[_0x0978('0x2f')]();});}};}function handleEntityNotFound(_0x32292c,_0xb42dcf){return function(_0x3b5bb3){if(!_0x3b5bb3){_0x32292c[_0x0978('0x1e')](0x194);}return _0x3b5bb3;};}function handleError(_0x1b94f3,_0x55c295){_0x55c295=_0x55c295||0x1f4;return function(_0x3c29ce){logger[_0x0978('0x30')](_0x3c29ce[_0x0978('0x31')]);if(_0x3c29ce[_0x0978('0x32')]){delete _0x3c29ce[_0x0978('0x32')];}_0x1b94f3[_0x0978('0x1f')](_0x55c295)[_0x0978('0x33')](_0x3c29ce);};}exports[_0x0978('0x34')]=function(_0xdc87cf,_0x4b18ee){var _0x59ae43={},_0x45d455={},_0x4cb9bd={'count':0x0,'rows':[]};var _0x4f990e=_[_0x0978('0x35')](db['Team'][_0x0978('0x36')],function(_0x45fc42){return{'name':_0x45fc42[_0x0978('0x37')],'type':_0x45fc42[_0x0978('0x38')]['key']};});_0x45d455['model']=_[_0x0978('0x35')](_0x4f990e,_0x0978('0x32'));_0x45d455[_0x0978('0x39')]=_[_0x0978('0x3a')](_0xdc87cf[_0x0978('0x39')]);_0x45d455[_0x0978('0x3b')]=_[_0x0978('0x3c')](_0x45d455[_0x0978('0x3d')],_0x45d455[_0x0978('0x39')]);_0x59ae43['attributes']=_[_0x0978('0x3c')](_0x45d455[_0x0978('0x3d')],qs[_0x0978('0x3e')](_0xdc87cf['query'][_0x0978('0x3e')]));_0x59ae43[_0x0978('0x3f')]=_0x59ae43[_0x0978('0x3f')][_0x0978('0x40')]?_0x59ae43[_0x0978('0x3f')]:_0x45d455['model'];if(!_0xdc87cf['query'][_0x0978('0x41')](_0x0978('0x42'))){_0x59ae43[_0x0978('0x23')]=qs['limit'](_0xdc87cf[_0x0978('0x39')][_0x0978('0x23')]);_0x59ae43[_0x0978('0x21')]=qs[_0x0978('0x21')](_0xdc87cf[_0x0978('0x39')]['offset']);}_0x59ae43[_0x0978('0x43')]=qs[_0x0978('0x44')](_0xdc87cf[_0x0978('0x39')]['sort']);_0x59ae43[_0x0978('0x45')]=qs[_0x0978('0x3b')](_['pick'](_0xdc87cf[_0x0978('0x39')],_0x45d455['filters']),_0x4f990e);if(_0xdc87cf[_0x0978('0x39')][_0x0978('0x46')]){_0x59ae43['where']=_[_0x0978('0x47')](_0x59ae43['where'],{'$or':_[_0x0978('0x35')](_0x4f990e,function(_0x2153d0){if(_0x2153d0[_0x0978('0x38')]!==_0x0978('0x48')){var _0x4f0f1e={};_0x4f0f1e[_0x2153d0['name']]={'$like':'%'+_0xdc87cf[_0x0978('0x39')][_0x0978('0x46')]+'%'};return _0x4f0f1e;}})});}_0x59ae43=_[_0x0978('0x47')]({},_0x59ae43,_0xdc87cf[_0x0978('0x49')]);var _0x2bc6eb={'where':_0x59ae43[_0x0978('0x45')]};return db[_0x0978('0x4a')][_0x0978('0x24')](_0x2bc6eb)[_0x0978('0x2c')](function(_0x2bdc70){_0x4cb9bd['count']=_0x2bdc70;if(_0xdc87cf[_0x0978('0x39')][_0x0978('0x4b')]){_0x59ae43[_0x0978('0x4c')]=[{'all':!![]}];}return db['Team']['findAll'](_0x59ae43);})['then'](function(_0x22b6ee){_0x4cb9bd[_0x0978('0x4d')]=_0x22b6ee;return _0x4cb9bd;})[_0x0978('0x2c')](respondWithFilteredResult(_0x4b18ee,_0x59ae43))[_0x0978('0x4e')](handleError(_0x4b18ee,null));};exports['show']=function(_0x5c3133,_0x44d21c){var _0x1a3f1a={'raw':![],'where':{'id':_0x5c3133[_0x0978('0x4f')]['id']}},_0x36ba96={};_0x36ba96['model']=_[_0x0978('0x3a')](db[_0x0978('0x4a')][_0x0978('0x36')]);_0x36ba96['query']=_[_0x0978('0x3a')](_0x5c3133[_0x0978('0x39')]);_0x36ba96[_0x0978('0x3b')]=_[_0x0978('0x3c')](_0x36ba96[_0x0978('0x3d')],_0x36ba96['query']);_0x1a3f1a[_0x0978('0x3f')]=_['intersection'](_0x36ba96[_0x0978('0x3d')],qs[_0x0978('0x3e')](_0x5c3133[_0x0978('0x39')][_0x0978('0x3e')]));_0x1a3f1a[_0x0978('0x3f')]=_0x1a3f1a['attributes']['length']?_0x1a3f1a[_0x0978('0x3f')]:_0x36ba96[_0x0978('0x3d')];if(_0x5c3133['query']['includeAll']){_0x1a3f1a[_0x0978('0x4c')]=[{'all':!![]}];}_0x1a3f1a=_[_0x0978('0x47')]({},_0x1a3f1a,_0x5c3133[_0x0978('0x49')]);return db[_0x0978('0x4a')]['find'](_0x1a3f1a)[_0x0978('0x2c')](handleEntityNotFound(_0x44d21c,null))['then'](respondWithResult(_0x44d21c,null))[_0x0978('0x4e')](handleError(_0x44d21c,null));};exports[_0x0978('0x50')]=function(_0x3e319e,_0x3fa7b3){return db[_0x0978('0x4a')][_0x0978('0x50')](_0x3e319e[_0x0978('0x51')],{})[_0x0978('0x2c')](function(_0x1f5f57){var _0x34cd04=_0x3e319e[_0x0978('0x52')][_0x0978('0x2d')]({'plain':!![]});if(!_0x34cd04)throw new Error(_0x0978('0x53'));if(_0x34cd04['role']==='user'){var _0x107f28=_0x1f5f57[_0x0978('0x2d')]({'plain':!![]});var _0xd4f2a6=_0x0978('0x2e');return db[_0x0978('0x54')]['find']({'where':{'name':_0xd4f2a6,'userProfileId':_0x34cd04['userProfileId']},'raw':!![]})[_0x0978('0x2c')](function(_0x5e1342){if(_0x5e1342&&_0x5e1342[_0x0978('0x55')]===0x0){return db[_0x0978('0x56')][_0x0978('0x50')]({'name':_0x107f28['name'],'resourceId':_0x107f28['id'],'type':_0x5e1342[_0x0978('0x32')],'sectionId':_0x5e1342['id']},{})['then'](function(){return _0x1f5f57;});}else{return _0x1f5f57;}})[_0x0978('0x4e')](function(_0x5924cf){logger[_0x0978('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5924cf);throw _0x5924cf;});}return _0x1f5f57;})[_0x0978('0x2c')](respondWithResult(_0x3fa7b3,0xc9))[_0x0978('0x4e')](handleError(_0x3fa7b3,null));};exports[_0x0978('0x2a')]=function(_0x43c80e,_0x566d28){if(_0x43c80e[_0x0978('0x51')]['id']){delete _0x43c80e['body']['id'];}return db[_0x0978('0x4a')][_0x0978('0x57')]({'where':{'id':_0x43c80e[_0x0978('0x4f')]['id']}})[_0x0978('0x2c')](handleEntityNotFound(_0x566d28,null))[_0x0978('0x2c')](saveUpdates(_0x43c80e[_0x0978('0x51')],null))[_0x0978('0x2c')](respondWithResult(_0x566d28,null))['catch'](handleError(_0x566d28,null));};exports[_0x0978('0x2b')]=function(_0x1bce0f,_0x26d6cf){return db[_0x0978('0x4a')]['find']({'where':{'id':_0x1bce0f[_0x0978('0x4f')]['id']}})['then'](handleEntityNotFound(_0x26d6cf,null))[_0x0978('0x2c')](removeEntity(_0x26d6cf,null))[_0x0978('0x4e')](handleError(_0x26d6cf,null));};exports['getQueues']=function(_0x3485f2,_0x33c351,_0x48ed59){return db[_0x0978('0x4a')][_0x0978('0x58')]({'where':{'id':_0x3485f2['params']['id']}})['then'](handleEntityNotFound(_0x33c351,null))['then'](function(_0x56f0d8){if(!_0x3485f2['query']['channel']||!utils[_0x0978('0x59')](_0x3485f2[_0x0978('0x39')][_0x0978('0x5a')])){throw new db['Sequelize'][(_0x0978('0x5b'))](_0x0978('0x5c'));}var _0x174220={};var _0x46ec6a={};_0x46ec6a[_0x0978('0x3d')]=_[_0x0978('0x3a')](db[_['capitalize'](_0x3485f2[_0x0978('0x39')][_0x0978('0x5a')][_0x0978('0x5d')]())+'Queue']['rawAttributes']);_0x46ec6a[_0x0978('0x39')]=_[_0x0978('0x3a')](_0x3485f2[_0x0978('0x39')]);_0x46ec6a['filters']=_['intersection'](_0x46ec6a[_0x0978('0x3d')],_0x46ec6a['query']);_0x174220['attributes']=_[_0x0978('0x3c')](_0x46ec6a[_0x0978('0x3d')],qs[_0x0978('0x3e')](_0x3485f2[_0x0978('0x39')][_0x0978('0x3e')]));_0x174220[_0x0978('0x3f')]=_0x174220['attributes'][_0x0978('0x40')]?_0x174220[_0x0978('0x3f')]:_0x46ec6a[_0x0978('0x3d')];_0x174220[_0x0978('0x23')]=qs[_0x0978('0x23')](_0x3485f2[_0x0978('0x39')][_0x0978('0x23')]);_0x174220[_0x0978('0x21')]=qs[_0x0978('0x21')](_0x3485f2[_0x0978('0x39')][_0x0978('0x21')]);_0x174220[_0x0978('0x43')]=qs[_0x0978('0x44')](_0x3485f2[_0x0978('0x39')]['sort']);_0x174220[_0x0978('0x45')]=qs[_0x0978('0x3b')](_['pick'](_0x3485f2['query'],_0x46ec6a['filters']));_0x174220=_['merge']({},_0x174220,_0x3485f2[_0x0978('0x49')]);return _0x56f0d8[_0x0978('0x2d')+_[_0x0978('0x5e')](_0x3485f2['query'][_0x0978('0x5a')]['toLowerCase']())+_0x0978('0x5f')](_0x174220);})[_0x0978('0x2c')](respondWithResult(_0x33c351,null))[_0x0978('0x4e')](handleError(_0x33c351,null));};exports[_0x0978('0x60')]=function(_0x3e15fe,_0x17c019,_0x4f9798){return db['Team'][_0x0978('0x58')]({'where':{'id':_0x3e15fe[_0x0978('0x4f')]['id']}})['then'](function(_0x4c7e49){if(_0x4c7e49){if(!_0x3e15fe[_0x0978('0x51')][_0x0978('0x5a')]||!utils['isValidChannel'](_0x3e15fe[_0x0978('0x51')][_0x0978('0x5a')])){throw new db['Sequelize'][(_0x0978('0x5b'))](_0x0978('0x5c'));}return _0x4c7e49[_0x0978('0x61')+_[_0x0978('0x5e')](_0x3e15fe[_0x0978('0x51')][_0x0978('0x5a')][_0x0978('0x5d')]())+_0x0978('0x5f')](_0x3e15fe[_0x0978('0x51')][_0x0978('0x62')]);}return null;})[_0x0978('0x2c')](handleEntityNotFound(_0x17c019,null))[_0x0978('0x2c')](respondWithStatusCode(_0x17c019,null))['catch'](handleError(_0x17c019,null));};exports[_0x0978('0x63')]=function(_0x4536f6,_0x29076a,_0x2823ba){return db['Team']['findOne']({'where':{'id':_0x4536f6[_0x0978('0x4f')]['id']}})[_0x0978('0x2c')](function(_0xc3b54a){if(_0xc3b54a){if(!_0x4536f6[_0x0978('0x39')]['channel']||!utils[_0x0978('0x59')](_0x4536f6['query'][_0x0978('0x5a')])){throw new db['Sequelize']['ValidationError'](_0x0978('0x5c'));}return _0xc3b54a[_0x0978('0x64')+_[_0x0978('0x5e')](_0x4536f6[_0x0978('0x39')]['channel'][_0x0978('0x5d')]())+_0x0978('0x5f')](_0x4536f6[_0x0978('0x39')][_0x0978('0x62')]);}return null;})[_0x0978('0x2c')](handleEntityNotFound(_0x29076a,null))[_0x0978('0x2c')](respondWithStatusCode(_0x29076a,null))[_0x0978('0x4e')](handleError(_0x29076a,null));};exports[_0x0978('0x65')]=function(_0x349007,_0x23730b){return db[_0x0978('0x4a')][_0x0978('0x57')]({'where':{'id':_0x349007[_0x0978('0x4f')]['id']}})[_0x0978('0x2c')](handleEntityNotFound(_0x23730b,null))[_0x0978('0x2c')](function(_0x27dbbf){if(_0x27dbbf){var _0x281299=[_0x0978('0x66'),_0x0978('0x67'),_0x0978('0x68'),_0x0978('0x69'),_0x0978('0x6a'),_0x0978('0x6b'),_0x0978('0x6c')];return db[_0x0978('0x6d')][_0x0978('0x6e')](function(_0x53e333){var _0x48b89f=_[_0x0978('0x35')](_0x281299,function(_0x371ef3){var _0x4ac742={'attributes':['id',_0x0978('0x32')]};if(_0x371ef3===_0x0978('0x66')){_0x4ac742[_0x0978('0x6f')]={'attributes':[_0x0978('0x70')]};}return _0x27dbbf[_0x0978('0x2d')+_0x371ef3+_0x0978('0x5f')](_0x4ac742)['then'](function(_0x4e7e57){var _0x101978=_[_0x0978('0x35')](_0x4e7e57,function(_0x633260){var _0x48f144=_[_0x0978('0x35')](_0x349007['body'][_0x0978('0x62')],function(_0x262cee){var _0x22a910={'where':{'UserId':_0x262cee,[_0x371ef3+_0x0978('0x71')]:_0x633260['id']},'transaction':_0x53e333};if(_0x371ef3===_0x0978('0x66')){_0x22a910[_0x0978('0x1b')]={'penalty':_0x633260[_0x0978('0x72')]['penalty']};}return db[_0x0978('0x73')+_0x371ef3+_0x0978('0x74')][_0x0978('0x75')](_0x22a910)[_0x0978('0x2c')](function(){socket[_0x0978('0x76')]('user'+_0x371ef3+_0x0978('0x77'),{'UserId':_0x262cee,[_0x371ef3+_0x0978('0x71')]:_0x633260['id']});if(_0x371ef3!=='Voice')return;return db[_0x0978('0x73')]['findAll']({'where':{'id':_0x349007['body'][_0x0978('0x62')],'online':0x1},'attributes':['id',_0x0978('0x32'),'online',_0x0978('0x78'),_0x0978('0x79')],'raw':!![]})[_0x0978('0x2c')](function(_0x56160c){var _0x1d523d=_[_0x0978('0x35')](_0x56160c,function(_0x349c82){return db[_0x0978('0x7a')]['upsert']({'membername':_0x349c82[_0x0978('0x32')],'UserId':_0x349c82['id'],'queue_name':_0x633260[_0x0978('0x32')],'VoiceQueueId':_0x633260['id'],'interface':_[_0x0978('0x7b')](_0x349c82['interface'])?util['format'](_0x0978('0x7c'),_0x349c82[_0x0978('0x32')]):_0x349c82[_0x0978('0x79')],'paused':_0x349c82['voicePause']||![],'penalty':_0x633260[_0x0978('0x72')][_0x0978('0x70')]},{'transaction':_0x53e333});});return Promise['all'](_0x1d523d);});});});return Promise[_0x0978('0x7d')](_0x48f144);});return Promise['all'](_0x101978);});});return Promise[_0x0978('0x7d')](_0x48b89f)[_0x0978('0x2c')](function(){return _0x27dbbf[_0x0978('0x65')](_0x349007[_0x0978('0x51')][_0x0978('0x62')],{'transaction':_0x53e333})[_0x0978('0x7e')](function(_0x2d8845){return _0x2d8845;});});});}})[_0x0978('0x2c')](respondWithResult(_0x23730b,null))['catch'](handleError(_0x23730b,null));};exports['removeAgents']=function(_0x1b95bb,_0x1e8f11){return db[_0x0978('0x4a')][_0x0978('0x57')]({'where':{'id':_0x1b95bb['params']['id']}})['then'](handleEntityNotFound(_0x1e8f11,null))[_0x0978('0x2c')](function(_0x2aefbf){if(_0x2aefbf){var _0x2bbb37=[_0x0978('0x66'),_0x0978('0x67'),_0x0978('0x68'),_0x0978('0x69'),'Fax','Openchannel','Whatsapp'];return db[_0x0978('0x6d')][_0x0978('0x6e')](function(_0x1800f4){var _0x3aeffd=_[_0x0978('0x35')](_0x2bbb37,function(_0x226749){var _0x382e38={'attributes':['id','name']};return _0x2aefbf[_0x0978('0x2d')+_0x226749+_0x0978('0x5f')](_0x382e38)['then'](function(_0x5d761f){var _0x5d3faf=_['map'](_0x5d761f,function(_0x265d52){return _0x265d52[_0x0978('0x7f')](_0x1b95bb[_0x0978('0x39')]['ids'],{'transaction':_0x1800f4})[_0x0978('0x2c')](function(){var _0x15198c=JSON[_0x0978('0x80')]('['+_0x1b95bb['query']['ids']+']');var _0xb1c2ac=_[_0x0978('0x35')](_0x15198c,function(_0x2438a2){socket[_0x0978('0x76')](_0x0978('0x52')+_0x226749+_0x0978('0x81'),{'UserId':Number(_0x2438a2),[_0x226749+_0x0978('0x71')]:_0x265d52['id']});if(_0x226749!=='Voice')return;return db[_0x0978('0x7a')][_0x0978('0x2b')]({'where':{'VoiceQueueId':_0x265d52['id'],'UserId':_0x2438a2},'transaction':_0x1800f4});});return Promise[_0x0978('0x7d')](_0xb1c2ac);});});return Promise[_0x0978('0x7d')](_0x5d3faf);});});return Promise[_0x0978('0x7d')](_0x3aeffd)[_0x0978('0x2c')](function(){return _0x2aefbf[_0x0978('0x7f')](_0x1b95bb[_0x0978('0x39')][_0x0978('0x62')],{'transaction':_0x1800f4});});});}})[_0x0978('0x2c')](respondWithStatusCode(_0x1e8f11,null))[_0x0978('0x4e')](handleError(_0x1e8f11,null));};exports[_0x0978('0x82')]=function(_0x33254b,_0x1a2626,_0x3b4b6f){var _0xfee899={};var _0x5a4db2={};var _0x2c2cc8;var _0x502f33;return db['Team'][_0x0978('0x58')]({'where':{'id':_0x33254b[_0x0978('0x4f')]['id']}})[_0x0978('0x2c')](handleEntityNotFound(_0x1a2626,null))[_0x0978('0x2c')](function(_0x1b4c6b){if(_0x1b4c6b){_0x2c2cc8=_0x1b4c6b;_0x5a4db2['model']=_['keys'](db[_0x0978('0x73')]['rawAttributes']);_0x5a4db2['query']=_[_0x0978('0x3a')](_0x33254b[_0x0978('0x39')]);_0x5a4db2[_0x0978('0x3b')]=_[_0x0978('0x3c')](_0x5a4db2[_0x0978('0x3d')],_0x5a4db2[_0x0978('0x39')]);_0xfee899['attributes']=_[_0x0978('0x3c')](_0x5a4db2[_0x0978('0x3d')],qs[_0x0978('0x3e')](_0x33254b[_0x0978('0x39')]['fields']));_0xfee899[_0x0978('0x3f')]=_0xfee899[_0x0978('0x3f')][_0x0978('0x40')]?_0xfee899[_0x0978('0x3f')]:_0x5a4db2[_0x0978('0x3d')];_0xfee899['order']=qs[_0x0978('0x44')](_0x33254b[_0x0978('0x39')]['sort']);_0xfee899[_0x0978('0x45')]=qs[_0x0978('0x3b')](_[_0x0978('0x83')](_0x33254b[_0x0978('0x39')],_0x5a4db2[_0x0978('0x3b')]));if(_0x33254b[_0x0978('0x39')]['filter']){_0xfee899[_0x0978('0x45')]=_['merge'](_0xfee899['where'],{'$or':_['map'](_0xfee899[_0x0978('0x3f')],function(_0x236f5b){var _0x4d5109={};_0x4d5109[_0x236f5b]={'$like':'%'+_0x33254b[_0x0978('0x39')][_0x0978('0x46')]+'%'};return _0x4d5109;})});}_0xfee899=_[_0x0978('0x47')]({},_0xfee899,_0x33254b[_0x0978('0x49')]);return _0x2c2cc8[_0x0978('0x82')](_0xfee899);}})[_0x0978('0x2c')](function(_0x35ea3a){if(_0x35ea3a){_0x502f33=_0x35ea3a['length'];if(!_0x33254b[_0x0978('0x39')][_0x0978('0x41')](_0x0978('0x42'))){_0xfee899[_0x0978('0x23')]=qs[_0x0978('0x23')](_0x33254b[_0x0978('0x39')][_0x0978('0x23')]);_0xfee899[_0x0978('0x21')]=qs['offset'](_0x33254b[_0x0978('0x39')][_0x0978('0x21')]);}return _0x2c2cc8[_0x0978('0x82')](_0xfee899);}})[_0x0978('0x2c')](function(_0x34b5cf){if(_0x34b5cf){return _0x34b5cf?{'count':_0x502f33,'rows':_0x34b5cf}:null;}})['then'](respondWithResult(_0x1a2626,null))[_0x0978('0x4e')](handleError(_0x1a2626,null));};
\ No newline at end of file
index 68c3ec1..15b428f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x273f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x46e69a,_0x57b6d8){var _0x5090e0=function(_0x19210e){while(--_0x19210e){_0x46e69a['push'](_0x46e69a['shift']());}};_0x5090e0(++_0x57b6d8);}(_0x273f,0x188));var _0xf273=function(_0x2171e0,_0x4bc8f4){_0x2171e0=_0x2171e0-0x0;var _0x37a523=_0x273f[_0x2171e0];return _0x37a523;};'use strict';var EventEmitter=require(_0xf273('0x0'));var Team=require(_0xf273('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xf273('0x2')](0x0);var events={'afterCreate':_0xf273('0x3'),'afterUpdate':'update','afterDestroy':_0xf273('0x4')};function emitEvent(_0x238081){return function(_0x2a6fe7,_0x517c89,_0x1ad1d6){TeamEvents[_0xf273('0x5')](_0x238081+':'+_0x2a6fe7['id'],_0x2a6fe7);TeamEvents[_0xf273('0x5')](_0x238081,_0x2a6fe7);_0x1ad1d6(null);};}for(var e in events){if(events[_0xf273('0x6')](e)){var event=events[e];Team[_0xf273('0x7')](e,emitEvent(event));}}module[_0xf273('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x5a5e=['hasOwnProperty','exports','setMaxListeners','save','update','remove','emit'];(function(_0x1975d3,_0x17bde9){var _0x33aa13=function(_0x2408ab){while(--_0x2408ab){_0x1975d3['push'](_0x1975d3['shift']());}};_0x33aa13(++_0x17bde9);}(_0x5a5e,0x6b));var _0xe5a5=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x5a5e[_0x17c483];return _0x112bdb;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xe5a5('0x0')](0x0);var events={'afterCreate':_0xe5a5('0x1'),'afterUpdate':_0xe5a5('0x2'),'afterDestroy':_0xe5a5('0x3')};function emitEvent(_0x229202){return function(_0x13a596,_0x16df6f,_0xaa2277){TeamEvents[_0xe5a5('0x4')](_0x229202+':'+_0x13a596['id'],_0x13a596);TeamEvents['emit'](_0x229202,_0x13a596);_0xaa2277(null);};}for(var e in events){if(events[_0xe5a5('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xe5a5('0x6')]=TeamEvents;
\ No newline at end of file
index 2016a30..1ca8751 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ecf=['Team','teams','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x6ecf,0xde));var _0xf6ec=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x6ecf[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xf6ec('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf6ec('0x1'));var BPromise=require(_0xf6ec('0x2'));var rp=require(_0xf6ec('0x3'));var fs=require('fs');var path=require(_0xf6ec('0x4'));var rimraf=require(_0xf6ec('0x5'));var config=require(_0xf6ec('0x6'));var attributes=require('./team.attributes');module['exports']=function(_0x4dfd5,_0x113c0c){return _0x4dfd5[_0xf6ec('0x7')](_0xf6ec('0x8'),attributes,{'tableName':_0xf6ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad12=['rimraf','exports','define','Team','teams','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5407b5,_0x5e101a){var _0x183940=function(_0xa74dd6){while(--_0xa74dd6){_0x5407b5['push'](_0x5407b5['shift']());}};_0x183940(++_0x5e101a);}(_0xad12,0x1cd));var _0x2ad1=function(_0x4ba00a,_0x4d29ad){_0x4ba00a=_0x4ba00a-0x0;var _0x46086c=_0xad12[_0x4ba00a];return _0x46086c;};'use strict';var _=require(_0x2ad1('0x0'));var util=require(_0x2ad1('0x1'));var logger=require('../../config/logger')(_0x2ad1('0x2'));var moment=require(_0x2ad1('0x3'));var BPromise=require(_0x2ad1('0x4'));var rp=require(_0x2ad1('0x5'));var fs=require('fs');var path=require(_0x2ad1('0x6'));var rimraf=require(_0x2ad1('0x7'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x2ad1('0x8')]=function(_0x18786d,_0x5c5c5a){return _0x18786d[_0x2ad1('0x9')](_0x2ad1('0xa'),attributes,{'tableName':_0x2ad1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 967baa2..926156f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1115=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','info'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x1115,0x146));var _0x5111=function(_0x3a8458,_0x1d3825){_0x3a8458=_0x3a8458-0x0;var _0x1aea2d=_0x1115[_0x3a8458];return _0x1aea2d;};'use strict';var _=require(_0x5111('0x0'));var util=require(_0x5111('0x1'));var moment=require('moment');var BPromise=require(_0x5111('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5111('0x3'));var db=require(_0x5111('0x4'))['db'];var utils=require(_0x5111('0x5'));var logger=require(_0x5111('0x6'))(_0x5111('0x7'));var config=require('../../config/environment');var jayson=require(_0x5111('0x8'));var client=jayson[_0x5111('0x9')][_0x5111('0xa')]({'port':0x232a});config[_0x5111('0xb')]=_[_0x5111('0xc')](config['redis'],{'host':_0x5111('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x5111('0xe')](socket);function respondWithRpcPromise(_0x5c8485,_0xa23ee6,_0x37ee43){return new BPromise(function(_0x22f8d1,_0x477f55){return client['request'](_0x5c8485,_0x37ee43)[_0x5111('0xf')](function(_0x50cf53){logger['info']('Team,\x20%s,\x20%s',_0xa23ee6,_0x5111('0x10'));logger[_0x5111('0x11')](_0x5111('0x12'),_0xa23ee6,_0x5111('0x10'),JSON[_0x5111('0x13')](_0x50cf53));if(_0x50cf53['error']){if(_0x50cf53[_0x5111('0x14')][_0x5111('0x15')]===0x1f4){logger[_0x5111('0x14')](_0x5111('0x16'),_0xa23ee6,_0x50cf53[_0x5111('0x14')][_0x5111('0x17')]);return _0x477f55(_0x50cf53[_0x5111('0x14')][_0x5111('0x17')]);}logger[_0x5111('0x14')](_0x5111('0x16'),_0xa23ee6,_0x50cf53[_0x5111('0x14')][_0x5111('0x17')]);return _0x22f8d1(_0x50cf53['error'][_0x5111('0x17')]);}else{logger[_0x5111('0x18')](_0x5111('0x16'),_0xa23ee6,_0x5111('0x10'));_0x22f8d1(_0x50cf53[_0x5111('0x19')]['message']);}})[_0x5111('0x1a')](function(_0x4e4e60){logger['error'](_0x5111('0x16'),_0xa23ee6,_0x4e4e60);_0x477f55(_0x4e4e60);});});}
\ No newline at end of file
+var _0x3e6e=['then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x35ce94,_0x539bf2){var _0x48b7b5=function(_0x3c2b0f){while(--_0x3c2b0f){_0x35ce94['push'](_0x35ce94['shift']());}};_0x48b7b5(++_0x539bf2);}(_0x3e6e,0x1dd));var _0xe3e6=function(_0x108a92,_0x4e4d4f){_0x108a92=_0x108a92-0x0;var _0x2ae004=_0x3e6e[_0x108a92];return _0x2ae004;};'use strict';var _=require(_0xe3e6('0x0'));var util=require('util');var moment=require(_0xe3e6('0x1'));var BPromise=require(_0xe3e6('0x2'));var rs=require(_0xe3e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe3e6('0x4'));var logger=require(_0xe3e6('0x5'))('rpc');var config=require(_0xe3e6('0x6'));var jayson=require(_0xe3e6('0x7'));var client=jayson[_0xe3e6('0x8')][_0xe3e6('0x9')]({'port':0x232a});config[_0xe3e6('0xa')]=_[_0xe3e6('0xb')](config[_0xe3e6('0xa')],{'host':_0xe3e6('0xc'),'port':0x18eb});var socket=require(_0xe3e6('0xd'))(new Redis(config[_0xe3e6('0xa')]));require(_0xe3e6('0xe'))[_0xe3e6('0xf')](socket);function respondWithRpcPromise(_0x3e0e34,_0x1055bf,_0x11abfe){return new BPromise(function(_0x358c8b,_0x13cf6e){return client[_0xe3e6('0x10')](_0x3e0e34,_0x11abfe)[_0xe3e6('0x11')](function(_0x2773c1){logger[_0xe3e6('0x12')](_0xe3e6('0x13'),_0x1055bf,_0xe3e6('0x14'));logger['debug'](_0xe3e6('0x15'),_0x1055bf,_0xe3e6('0x14'),JSON['stringify'](_0x2773c1));if(_0x2773c1['error']){if(_0x2773c1['error'][_0xe3e6('0x16')]===0x1f4){logger['error'](_0xe3e6('0x13'),_0x1055bf,_0x2773c1[_0xe3e6('0x17')]['message']);return _0x13cf6e(_0x2773c1[_0xe3e6('0x17')][_0xe3e6('0x18')]);}logger[_0xe3e6('0x17')](_0xe3e6('0x13'),_0x1055bf,_0x2773c1[_0xe3e6('0x17')]['message']);return _0x358c8b(_0x2773c1[_0xe3e6('0x17')][_0xe3e6('0x18')]);}else{logger[_0xe3e6('0x12')](_0xe3e6('0x13'),_0x1055bf,_0xe3e6('0x14'));_0x358c8b(_0x2773c1['result'][_0xe3e6('0x18')]);}})[_0xe3e6('0x19')](function(_0x3c417b){logger[_0xe3e6('0x17')](_0xe3e6('0x13'),_0x1055bf,_0x3c417b);_0x13cf6e(_0x3c417b);});});}
\ No newline at end of file
index 15c9ebd..d552d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6460=['remove','emit','register','length','team:','save'];(function(_0x146965,_0x56aabc){var _0x1b9bbb=function(_0x27553c){while(--_0x27553c){_0x146965['push'](_0x146965['shift']());}};_0x1b9bbb(++_0x56aabc);}(_0x6460,0x1f1));var _0x0646=function(_0x41bbd7,_0x3041f8){_0x41bbd7=_0x41bbd7-0x0;var _0x116b13=_0x6460[_0x41bbd7];return _0x116b13;};'use strict';var TeamEvents=require('./team.events');var events=[_0x0646('0x0'),_0x0646('0x1'),'update'];function createListener(_0x8a9b79,_0xf241d7){return function(_0x177f0b){_0xf241d7[_0x0646('0x2')](_0x8a9b79,_0x177f0b);};}function removeListener(_0x28e044,_0xab8982){return function(){TeamEvents['removeListener'](_0x28e044,_0xab8982);};}exports[_0x0646('0x3')]=function(_0x38d80e){for(var _0x5636f2=0x0,_0xfad912=events[_0x0646('0x4')];_0x5636f2<_0xfad912;_0x5636f2++){var _0x3c9ba2=events[_0x5636f2];var _0x162003=createListener(_0x0646('0x5')+_0x3c9ba2,_0x38d80e);TeamEvents['on'](_0x3c9ba2,_0x162003);}};
\ No newline at end of file
+var _0x3715=['removeListener','register','team:','./team.events','save','remove','update','emit'];(function(_0x59ccec,_0x44350b){var _0x17cc7f=function(_0x479bb9){while(--_0x479bb9){_0x59ccec['push'](_0x59ccec['shift']());}};_0x17cc7f(++_0x44350b);}(_0x3715,0xc3));var _0x5371=function(_0x161f66,_0x35d5c2){_0x161f66=_0x161f66-0x0;var _0x4c76ca=_0x3715[_0x161f66];return _0x4c76ca;};'use strict';var TeamEvents=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(){TeamEvents[_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);TeamEvents['on'](_0x426a2a,_0x16c64a);}};
\ No newline at end of file
index 93422c6..d243452 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(_0x49a654,_0x884f71){var _0x57fe19=function(_0x4db4c9){while(--_0x4db4c9){_0x49a654['push'](_0x49a654['shift']());}};_0x57fe19(++_0x884f71);}(_0xedd9,0xfc));var _0x9edd=function(_0x4f06a8,_0xd31bff){_0x4f06a8=_0x4f06a8-0x0;var _0xa7311f=_0xedd9[_0x4f06a8];return _0xa7311f;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5241c1,_0x369329){var _0xce94af=function(_0x54c90a){while(--_0x54c90a){_0x5241c1['push'](_0x5241c1['shift']());}};_0xce94af(++_0x369329);}(_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 61d79c0..3f6ae71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cac=['sequelize'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x0cac,0x18a));var _0xc0ca=function(_0x374c4a,_0x5afa32){_0x374c4a=_0x374c4a-0x0;var _0x103f4a=_0x0cac[_0x374c4a];return _0x103f4a;};'use strict';var Sequelize=require(_0xc0ca('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3531=['sequelize','exports','INTEGER'];(function(_0x499c7f,_0x2d8184){var _0x433bee=function(_0xd1543a){while(--_0xd1543a){_0x499c7f['push'](_0x499c7f['shift']());}};_0x433bee(++_0x2d8184);}(_0x3531,0x177));var _0x1353=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x3531[_0x40bffc];return _0x3007e9;};'use strict';var Sequelize=require(_0x1353('0x0'));module[_0x1353('0x1')]={'penalty':{'type':Sequelize[_0x1353('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 62c6c69..c278f18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2c7=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x35db40,_0x25e1fc){var _0x3e0cc5=function(_0x5caf68){while(--_0x5caf68){_0x35db40['push'](_0x35db40['shift']());}};_0x3e0cc5(++_0x25e1fc);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0xf2c7[_0xba1760];return _0x1f3143;};'use strict';var _=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var logger=require(_0x7f2c('0x2'))(_0x7f2c('0x3'));var moment=require('moment');var BPromise=require(_0x7f2c('0x4'));var rp=require(_0x7f2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7f2c('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x7f2c('0x7')]=function(_0x835eeb,_0x4e348c){return _0x835eeb[_0x7f2c('0x8')](_0x7f2c('0x9'),attributes,{'tableName':_0x7f2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x851c=['bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x712aa3,_0x4593e0){var _0x1e3d5c=function(_0x3e8411){while(--_0x3e8411){_0x712aa3['push'](_0x712aa3['shift']());}};_0x1e3d5c(++_0x4593e0);}(_0x851c,0x19d));var _0xc851=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x851c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var logger=require(_0xc851('0x2'))(_0xc851('0x3'));var moment=require(_0xc851('0x4'));var BPromise=require(_0xc851('0x5'));var rp=require(_0xc851('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc851('0x7'));var config=require(_0xc851('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0xc851('0x9')]=function(_0x272e34,_0x535cf1){return _0x272e34[_0xc851('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 834e8f2..32275a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ec3=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x425213,_0x5b0300){var _0x4c2ba2=function(_0x2bf696){while(--_0x2bf696){_0x425213['push'](_0x425213['shift']());}};_0x4c2ba2(++_0x5b0300);}(_0x8ec3,0x19c));var _0x38ec=function(_0x214a72,_0x135565){_0x214a72=_0x214a72-0x0;var _0x58512a=_0x8ec3[_0x214a72];return _0x58512a;};'use strict';var _=require(_0x38ec('0x0'));var util=require('util');var moment=require(_0x38ec('0x1'));var BPromise=require(_0x38ec('0x2'));var rs=require(_0x38ec('0x3'));var fs=require('fs');var Redis=require(_0x38ec('0x4'));var db=require(_0x38ec('0x5'))['db'];var utils=require(_0x38ec('0x6'));var logger=require('../../config/logger')(_0x38ec('0x7'));var config=require('../../config/environment');var jayson=require(_0x38ec('0x8'));var client=jayson[_0x38ec('0x9')][_0x38ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c713,_0x219bf2,_0x327d39){return new BPromise(function(_0x8ac564,_0xb7e8b){return client[_0x38ec('0xb')](_0x24c713,_0x327d39)[_0x38ec('0xc')](function(_0x575dd1){logger[_0x38ec('0xd')](_0x38ec('0xe'),_0x219bf2,_0x38ec('0xf'));logger[_0x38ec('0x10')](_0x38ec('0x11'),_0x219bf2,_0x38ec('0xf'),JSON[_0x38ec('0x12')](_0x575dd1));if(_0x575dd1[_0x38ec('0x13')]){if(_0x575dd1[_0x38ec('0x13')][_0x38ec('0x14')]===0x1f4){logger[_0x38ec('0x13')](_0x38ec('0xe'),_0x219bf2,_0x575dd1[_0x38ec('0x13')]['message']);return _0xb7e8b(_0x575dd1[_0x38ec('0x13')][_0x38ec('0x15')]);}logger[_0x38ec('0x13')](_0x38ec('0xe'),_0x219bf2,_0x575dd1[_0x38ec('0x13')][_0x38ec('0x15')]);return _0x8ac564(_0x575dd1[_0x38ec('0x13')][_0x38ec('0x15')]);}else{logger['info'](_0x38ec('0xe'),_0x219bf2,_0x38ec('0xf'));_0x8ac564(_0x575dd1[_0x38ec('0x16')][_0x38ec('0x15')]);}})[_0x38ec('0x17')](function(_0x60bf77){logger[_0x38ec('0x13')](_0x38ec('0xe'),_0x219bf2,_0x60bf77);_0xb7e8b(_0x60bf77);});});}
\ No newline at end of file
+var _0xe23d=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x2cc4e4,_0x310026){var _0x366401=function(_0x229071){while(--_0x229071){_0x2cc4e4['push'](_0x2cc4e4['shift']());}};_0x366401(++_0x310026);}(_0xe23d,0x93));var _0xde23=function(_0xa8c37,_0x20f5ae){_0xa8c37=_0xa8c37-0x0;var _0x2f380a=_0xe23d[_0xa8c37];return _0x2f380a;};'use strict';var _=require(_0xde23('0x0'));var util=require('util');var moment=require(_0xde23('0x1'));var BPromise=require('bluebird');var rs=require(_0xde23('0x2'));var fs=require('fs');var Redis=require(_0xde23('0x3'));var db=require(_0xde23('0x4'))['db'];var utils=require(_0xde23('0x5'));var logger=require(_0xde23('0x6'))(_0xde23('0x7'));var config=require(_0xde23('0x8'));var jayson=require(_0xde23('0x9'));var client=jayson[_0xde23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x553964,_0x4c88ac,_0x5d3d6a){return new BPromise(function(_0xca6249,_0x338993){return client[_0xde23('0xb')](_0x553964,_0x5d3d6a)[_0xde23('0xc')](function(_0x18f6e2){logger[_0xde23('0xd')](_0xde23('0xe'),_0x4c88ac,_0xde23('0xf'));logger[_0xde23('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4c88ac,_0xde23('0xf'),JSON[_0xde23('0x11')](_0x18f6e2));if(_0x18f6e2[_0xde23('0x12')]){if(_0x18f6e2['error'][_0xde23('0x13')]===0x1f4){logger[_0xde23('0x12')](_0xde23('0xe'),_0x4c88ac,_0x18f6e2['error'][_0xde23('0x14')]);return _0x338993(_0x18f6e2[_0xde23('0x12')][_0xde23('0x14')]);}logger[_0xde23('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4c88ac,_0x18f6e2[_0xde23('0x12')][_0xde23('0x14')]);return _0xca6249(_0x18f6e2[_0xde23('0x12')]['message']);}else{logger[_0xde23('0xd')](_0xde23('0xe'),_0x4c88ac,_0xde23('0xf'));_0xca6249(_0x18f6e2[_0xde23('0x15')][_0xde23('0x14')]);}})[_0xde23('0x16')](function(_0x143ccc){logger['error'](_0xde23('0xe'),_0x4c88ac,_0x143ccc);_0x338993(_0x143ccc);});});}
\ No newline at end of file
index 53aa8a6..23a62f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40f3=['update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','create','put'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0x40f3,0x8b));var _0x340f=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x40f3[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x340f('0x0'));var path=require(_0x340f('0x1'));var timeout=require('connect-timeout');var express=require(_0x340f('0x2'));var router=express[_0x340f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x340f('0x4'));var config=require(_0x340f('0x5'));var controller=require('./template.controller');router[_0x340f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x340f('0x6')](_0x340f('0x7'),auth[_0x340f('0x8')](),controller['show']);router['post']('/',auth[_0x340f('0x8')](),controller[_0x340f('0x9')]);router[_0x340f('0xa')](_0x340f('0x7'),auth[_0x340f('0x8')](),controller[_0x340f('0xb')]);router[_0x340f('0xc')](_0x340f('0x7'),auth[_0x340f('0x8')](),controller[_0x340f('0xd')]);module[_0x340f('0xe')]=router;
\ No newline at end of file
+var _0x677a=['../../config/environment','./template.controller','get','isAuthenticated','/:id','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x148f70,_0x489b9a){var _0x5d85d0=function(_0x4a4ac9){while(--_0x4a4ac9){_0x148f70['push'](_0x148f70['shift']());}};_0x5d85d0(++_0x489b9a);}(_0x677a,0xd6));var _0xa677=function(_0xad92d9,_0x3f9084){_0xad92d9=_0xad92d9-0x0;var _0x229033=_0x677a[_0xad92d9];return _0x229033;};'use strict';var multer=require(_0xa677('0x0'));var util=require('util');var path=require(_0xa677('0x1'));var timeout=require(_0xa677('0x2'));var express=require(_0xa677('0x3'));var router=express[_0xa677('0x4')]();var fs_extra=require(_0xa677('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa677('0x6'));var config=require(_0xa677('0x7'));var controller=require(_0xa677('0x8'));router[_0xa677('0x9')]('/',auth[_0xa677('0xa')](),controller['index']);router[_0xa677('0x9')](_0xa677('0xb'),auth[_0xa677('0xa')](),controller[_0xa677('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa677('0xd')]('/:id',auth[_0xa677('0xa')](),controller[_0xa677('0xe')]);router['delete'](_0xa677('0xb'),auth[_0xa677('0xa')](),controller[_0xa677('0xf')]);module[_0xa677('0x10')]=router;
\ No newline at end of file
index f49946b..5b8a7ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf25f=['STRING','TEXT','exports'];(function(_0x5a4bbd,_0x9522bc){var _0x3bdd47=function(_0x4f15a5){while(--_0x4f15a5){_0x5a4bbd['push'](_0x5a4bbd['shift']());}};_0x3bdd47(++_0x9522bc);}(_0xf25f,0x14c));var _0xff25=function(_0x2ab349,_0x440584){_0x2ab349=_0x2ab349-0x0;var _0x522395=_0xf25f[_0x2ab349];return _0x522395;};'use strict';var Sequelize=require('sequelize');module[_0xff25('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xff25('0x1')]},'html':{'type':Sequelize[_0xff25('0x2')]}};
\ No newline at end of file
+var _0x7e49=['TEXT','sequelize','exports','STRING'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x7e49,0x101));var _0x97e4=function(_0x348537,_0x5171fe){_0x348537=_0x348537-0x0;var _0x123896=_0x7e49[_0x348537];return _0x123896;};'use strict';var Sequelize=require(_0x97e4('0x0'));module[_0x97e4('0x1')]={'name':{'type':Sequelize[_0x97e4('0x2')]},'description':{'type':Sequelize[_0x97e4('0x2')]},'html':{'type':Sequelize[_0x97e4('0x3')]}};
\ No newline at end of file
index 0a74d50..414319d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cac=['findAll','rows','show','params','include','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','Template','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x8cac,0x1c4));var _0xc8ca=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8cac[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8ca('0x0'));var jsonpatch=require(_0xc8ca('0x1'));var rp=require(_0xc8ca('0x2'));var moment=require(_0xc8ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc8ca('0x4'));var util=require(_0xc8ca('0x5'));var path=require(_0xc8ca('0x6'));var sox=require(_0xc8ca('0x7'));var csv=require(_0xc8ca('0x8'));var ejs=require(_0xc8ca('0x9'));var fs=require('fs');var fs_extra=require(_0xc8ca('0xa'));var _=require(_0xc8ca('0xb'));var squel=require(_0xc8ca('0xc'));var crypto=require(_0xc8ca('0xd'));var jsforce=require(_0xc8ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc8ca('0x8'));var querystring=require(_0xc8ca('0xf'));var Papa=require(_0xc8ca('0x10'));var Redis=require(_0xc8ca('0x11'));var authService=require(_0xc8ca('0x12'));var qs=require(_0xc8ca('0x13'));var as=require(_0xc8ca('0x14'));var hardwareService=require(_0xc8ca('0x15'));var logger=require(_0xc8ca('0x16'))(_0xc8ca('0x17'));var utils=require(_0xc8ca('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc8ca('0x19'));var db=require(_0xc8ca('0x1a'))['db'];function respondWithStatusCode(_0x1993ed,_0x56c458){_0x56c458=_0x56c458||0xcc;return function(_0xeeb3de){if(_0xeeb3de){return _0x1993ed['sendStatus'](_0x56c458);}return _0x1993ed['status'](_0x56c458)[_0xc8ca('0x1b')]();};}function respondWithResult(_0x3d85f0,_0x134a0c){_0x134a0c=_0x134a0c||0xc8;return function(_0x230c47){if(_0x230c47){return _0x3d85f0[_0xc8ca('0x1c')](_0x134a0c)[_0xc8ca('0x1d')](_0x230c47);}};}function respondWithFilteredResult(_0x46bff8,_0x12c5bb){return function(_0x17ed6e){if(_0x17ed6e){var _0x5c89a9=typeof _0x12c5bb[_0xc8ca('0x1e')]===_0xc8ca('0x1f')&&typeof _0x12c5bb[_0xc8ca('0x20')]===_0xc8ca('0x1f');var _0x5278b2=_0x17ed6e[_0xc8ca('0x21')];var _0x18dc62=_0x5c89a9?0x0:_0x12c5bb[_0xc8ca('0x1e')];var _0x3f7777=_0x5c89a9?_0x17ed6e['count']:_0x12c5bb['offset']+_0x12c5bb[_0xc8ca('0x20')];var _0x45c525;if(_0x3f7777>=_0x5278b2){_0x3f7777=_0x5278b2;_0x45c525=0xc8;}else{_0x45c525=0xce;}_0x46bff8['status'](_0x45c525);return _0x46bff8[_0xc8ca('0x22')]('Content-Range',_0x18dc62+'-'+_0x3f7777+'/'+_0x5278b2)[_0xc8ca('0x1d')](_0x17ed6e);}return null;};}function patchUpdates(_0xc1f1de){return function(_0x5165d7){try{jsonpatch['apply'](_0x5165d7,_0xc1f1de,!![]);}catch(_0x439d3f){return BPromise[_0xc8ca('0x23')](_0x439d3f);}return _0x5165d7[_0xc8ca('0x24')]();};}function saveUpdates(_0x51a2a9,_0x4b2c95){return function(_0x3059f3){if(_0x3059f3){return _0x3059f3[_0xc8ca('0x25')](_0x51a2a9)[_0xc8ca('0x26')](function(_0x17b7ed){return _0x17b7ed;});}return null;};}function removeEntity(_0x1f8f3c,_0x4e747){return function(_0x73b356){if(_0x73b356){return _0x73b356['destroy']()[_0xc8ca('0x26')](function(){var _0x400033=_0x73b356['get']({'plain':!![]});var _0x2cc624=_0xc8ca('0x27');return db[_0xc8ca('0x28')]['destroy']({'where':{'type':_0x2cc624,'resourceId':_0x400033['id']}})[_0xc8ca('0x26')](function(){return _0x73b356;});})[_0xc8ca('0x26')](function(){_0x1f8f3c[_0xc8ca('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f36d,_0x48d65a){return function(_0x14b973){if(!_0x14b973){_0x54f36d[_0xc8ca('0x29')](0x194);}return _0x14b973;};}function handleError(_0x40d6f5,_0x51e97c){_0x51e97c=_0x51e97c||0x1f4;return function(_0x57048b){logger[_0xc8ca('0x2a')](_0x57048b[_0xc8ca('0x2b')]);if(_0x57048b[_0xc8ca('0x2c')]){delete _0x57048b['name'];}_0x40d6f5[_0xc8ca('0x1c')](_0x51e97c)[_0xc8ca('0x2d')](_0x57048b);};}exports[_0xc8ca('0x2e')]=function(_0x4d8dac,_0x362575){var _0x194054={},_0x505b3d={},_0x500ccb={'count':0x0,'rows':[]};var _0x1ef19e=_['map'](db[_0xc8ca('0x2f')][_0xc8ca('0x30')],function(_0x132fb7){return{'name':_0x132fb7[_0xc8ca('0x31')],'type':_0x132fb7[_0xc8ca('0x32')]['key']};});_0x505b3d[_0xc8ca('0x33')]=_['map'](_0x1ef19e,_0xc8ca('0x2c'));_0x505b3d['query']=_[_0xc8ca('0x34')](_0x4d8dac[_0xc8ca('0x35')]);_0x505b3d[_0xc8ca('0x36')]=_['intersection'](_0x505b3d[_0xc8ca('0x33')],_0x505b3d[_0xc8ca('0x35')]);_0x194054['attributes']=_[_0xc8ca('0x37')](_0x505b3d[_0xc8ca('0x33')],qs['fields'](_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x38')]));_0x194054[_0xc8ca('0x39')]=_0x194054[_0xc8ca('0x39')][_0xc8ca('0x3a')]?_0x194054[_0xc8ca('0x39')]:_0x505b3d[_0xc8ca('0x33')];if(!_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x3b')]('nolimit')){_0x194054['limit']=qs[_0xc8ca('0x20')](_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x20')]);_0x194054[_0xc8ca('0x1e')]=qs[_0xc8ca('0x1e')](_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x1e')]);}_0x194054[_0xc8ca('0x3c')]=qs[_0xc8ca('0x3d')](_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x3d')]);_0x194054[_0xc8ca('0x3e')]=qs[_0xc8ca('0x36')](_[_0xc8ca('0x3f')](_0x4d8dac[_0xc8ca('0x35')],_0x505b3d[_0xc8ca('0x36')]),_0x1ef19e);if(_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x40')]){_0x194054[_0xc8ca('0x3e')]=_[_0xc8ca('0x41')](_0x194054['where'],{'$or':_[_0xc8ca('0x42')](_0x1ef19e,function(_0x215f48){if(_0x215f48['type']!==_0xc8ca('0x43')){var _0x4ab0b5={};_0x4ab0b5[_0x215f48[_0xc8ca('0x2c')]]={'$like':'%'+_0x4d8dac['query'][_0xc8ca('0x40')]+'%'};return _0x4ab0b5;}})});}_0x194054=_[_0xc8ca('0x41')]({},_0x194054,_0x4d8dac[_0xc8ca('0x44')]);var _0x366efa={'where':_0x194054[_0xc8ca('0x3e')]};return db[_0xc8ca('0x2f')][_0xc8ca('0x21')](_0x366efa)[_0xc8ca('0x26')](function(_0x310255){_0x500ccb['count']=_0x310255;if(_0x4d8dac[_0xc8ca('0x35')][_0xc8ca('0x45')]){_0x194054['include']=[{'all':!![]}];}return db[_0xc8ca('0x2f')][_0xc8ca('0x46')](_0x194054);})['then'](function(_0x136ee8){_0x500ccb[_0xc8ca('0x47')]=_0x136ee8;return _0x500ccb;})[_0xc8ca('0x26')](respondWithFilteredResult(_0x362575,_0x194054))['catch'](handleError(_0x362575,null));};exports[_0xc8ca('0x48')]=function(_0x2a0c88,_0xa10ad){var _0x397a57={'raw':!![],'where':{'id':_0x2a0c88[_0xc8ca('0x49')]['id']}},_0x4a88b6={};_0x4a88b6[_0xc8ca('0x33')]=_[_0xc8ca('0x34')](db['Template'][_0xc8ca('0x30')]);_0x4a88b6['query']=_['keys'](_0x2a0c88['query']);_0x4a88b6[_0xc8ca('0x36')]=_[_0xc8ca('0x37')](_0x4a88b6['model'],_0x4a88b6['query']);_0x397a57[_0xc8ca('0x39')]=_[_0xc8ca('0x37')](_0x4a88b6[_0xc8ca('0x33')],qs[_0xc8ca('0x38')](_0x2a0c88[_0xc8ca('0x35')][_0xc8ca('0x38')]));_0x397a57[_0xc8ca('0x39')]=_0x397a57[_0xc8ca('0x39')][_0xc8ca('0x3a')]?_0x397a57['attributes']:_0x4a88b6[_0xc8ca('0x33')];if(_0x2a0c88['query']['includeAll']){_0x397a57[_0xc8ca('0x4a')]=[{'all':!![]}];}_0x397a57=_[_0xc8ca('0x41')]({},_0x397a57,_0x2a0c88[_0xc8ca('0x44')]);return db[_0xc8ca('0x2f')][_0xc8ca('0x4b')](_0x397a57)[_0xc8ca('0x26')](handleEntityNotFound(_0xa10ad,null))[_0xc8ca('0x26')](respondWithResult(_0xa10ad,null))[_0xc8ca('0x4c')](handleError(_0xa10ad,null));};exports[_0xc8ca('0x4d')]=function(_0x47d8e5,_0x386a90){return db['Template'][_0xc8ca('0x4d')](_0x47d8e5[_0xc8ca('0x4e')],{})[_0xc8ca('0x26')](function(_0x1a6df3){var _0xc9bc8a=_0x47d8e5[_0xc8ca('0x4f')][_0xc8ca('0x50')]({'plain':!![]});if(!_0xc9bc8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc9bc8a[_0xc8ca('0x51')]===_0xc8ca('0x4f')){var _0x486577=_0x1a6df3[_0xc8ca('0x50')]({'plain':!![]});var _0x3001ef=_0xc8ca('0x27');return db[_0xc8ca('0x52')][_0xc8ca('0x4b')]({'where':{'name':_0x3001ef,'userProfileId':_0xc9bc8a[_0xc8ca('0x53')]},'raw':!![]})[_0xc8ca('0x26')](function(_0xbfe4d8){if(_0xbfe4d8&&_0xbfe4d8[_0xc8ca('0x54')]===0x0){return db[_0xc8ca('0x28')][_0xc8ca('0x4d')]({'name':_0x486577[_0xc8ca('0x2c')],'resourceId':_0x486577['id'],'type':_0xbfe4d8['name'],'sectionId':_0xbfe4d8['id']},{})[_0xc8ca('0x26')](function(){return _0x1a6df3;});}else{return _0x1a6df3;}})['catch'](function(_0x4148aa){logger[_0xc8ca('0x2a')](_0xc8ca('0x55'),_0x4148aa);throw _0x4148aa;});}return _0x1a6df3;})[_0xc8ca('0x26')](respondWithResult(_0x386a90,0xc9))['catch'](handleError(_0x386a90,null));};exports['update']=function(_0x27390e,_0xcadfa1){if(_0x27390e[_0xc8ca('0x4e')]['id']){delete _0x27390e[_0xc8ca('0x4e')]['id'];}return db[_0xc8ca('0x2f')]['find']({'where':{'id':_0x27390e[_0xc8ca('0x49')]['id']}})[_0xc8ca('0x26')](handleEntityNotFound(_0xcadfa1,null))['then'](saveUpdates(_0x27390e[_0xc8ca('0x4e')],null))['then'](respondWithResult(_0xcadfa1,null))[_0xc8ca('0x4c')](handleError(_0xcadfa1,null));};exports[_0xc8ca('0x56')]=function(_0x218835,_0x500196){return db[_0xc8ca('0x2f')][_0xc8ca('0x4b')]({'where':{'id':_0x218835[_0xc8ca('0x49')]['id']}})[_0xc8ca('0x26')](handleEntityNotFound(_0x500196,null))[_0xc8ca('0x26')](removeEntity(_0x500196,null))[_0xc8ca('0x4c')](handleError(_0x500196,null));};
\ No newline at end of file
+var _0xe921=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','get','Templates','UserProfileResource','name','index','map','Template','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','update','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x4b90c1,_0x3b4415){var _0x29f1fc=function(_0x95cc1a){while(--_0x95cc1a){_0x4b90c1['push'](_0x4b90c1['shift']());}};_0x29f1fc(++_0x3b4415);}(_0xe921,0x1f1));var _0x1e92=function(_0x458d83,_0x33a54f){_0x458d83=_0x458d83-0x0;var _0x24a90e=_0xe921[_0x458d83];return _0x24a90e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e92('0x0'));var zipdir=require(_0x1e92('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1e92('0x2'));var BPromise=require(_0x1e92('0x3'));var Mustache=require('mustache');var util=require(_0x1e92('0x4'));var path=require(_0x1e92('0x5'));var sox=require(_0x1e92('0x6'));var csv=require('to-csv');var ejs=require(_0x1e92('0x7'));var fs=require('fs');var fs_extra=require(_0x1e92('0x8'));var _=require(_0x1e92('0x9'));var squel=require(_0x1e92('0xa'));var crypto=require('crypto');var jsforce=require(_0x1e92('0xb'));var deskjs=require(_0x1e92('0xc'));var toCsv=require(_0x1e92('0xd'));var querystring=require(_0x1e92('0xe'));var Papa=require(_0x1e92('0xf'));var Redis=require(_0x1e92('0x10'));var authService=require(_0x1e92('0x11'));var qs=require(_0x1e92('0x12'));var as=require(_0x1e92('0x13'));var hardwareService=require(_0x1e92('0x14'));var logger=require(_0x1e92('0x15'))(_0x1e92('0x16'));var utils=require(_0x1e92('0x17'));var config=require(_0x1e92('0x18'));var licenseUtil=require(_0x1e92('0x19'));var db=require(_0x1e92('0x1a'))['db'];function respondWithStatusCode(_0x310308,_0x34dfd7){_0x34dfd7=_0x34dfd7||0xcc;return function(_0x280b22){if(_0x280b22){return _0x310308[_0x1e92('0x1b')](_0x34dfd7);}return _0x310308[_0x1e92('0x1c')](_0x34dfd7)[_0x1e92('0x1d')]();};}function respondWithResult(_0x30dd83,_0x14287f){_0x14287f=_0x14287f||0xc8;return function(_0x29698a){if(_0x29698a){return _0x30dd83[_0x1e92('0x1c')](_0x14287f)['json'](_0x29698a);}};}function respondWithFilteredResult(_0x55a2fc,_0x55d27f){return function(_0x5ca18e){if(_0x5ca18e){var _0xfc63a2=typeof _0x55d27f[_0x1e92('0x1e')]===_0x1e92('0x1f')&&typeof _0x55d27f[_0x1e92('0x20')]==='undefined';var _0x2d612a=_0x5ca18e[_0x1e92('0x21')];var _0x2f9943=_0xfc63a2?0x0:_0x55d27f[_0x1e92('0x1e')];var _0x21e8fa=_0xfc63a2?_0x5ca18e[_0x1e92('0x21')]:_0x55d27f['offset']+_0x55d27f['limit'];var _0x1ed914;if(_0x21e8fa>=_0x2d612a){_0x21e8fa=_0x2d612a;_0x1ed914=0xc8;}else{_0x1ed914=0xce;}_0x55a2fc['status'](_0x1ed914);return _0x55a2fc[_0x1e92('0x22')]('Content-Range',_0x2f9943+'-'+_0x21e8fa+'/'+_0x2d612a)[_0x1e92('0x23')](_0x5ca18e);}return null;};}function patchUpdates(_0x48a946){return function(_0x81379f){try{jsonpatch[_0x1e92('0x24')](_0x81379f,_0x48a946,!![]);}catch(_0x15ede8){return BPromise[_0x1e92('0x25')](_0x15ede8);}return _0x81379f[_0x1e92('0x26')]();};}function saveUpdates(_0x43028f,_0x3147ba){return function(_0x269d7c){if(_0x269d7c){return _0x269d7c['update'](_0x43028f)['then'](function(_0x8a9dc7){return _0x8a9dc7;});}return null;};}function removeEntity(_0x2adc12,_0x42f4be){return function(_0x58a5d4){if(_0x58a5d4){return _0x58a5d4[_0x1e92('0x27')]()[_0x1e92('0x28')](function(){var _0x5b6751=_0x58a5d4[_0x1e92('0x29')]({'plain':!![]});var _0x31462c=_0x1e92('0x2a');return db[_0x1e92('0x2b')][_0x1e92('0x27')]({'where':{'type':_0x31462c,'resourceId':_0x5b6751['id']}})['then'](function(){return _0x58a5d4;});})[_0x1e92('0x28')](function(){_0x2adc12[_0x1e92('0x1c')](0xcc)[_0x1e92('0x1d')]();});}};}function handleEntityNotFound(_0x308a2d,_0x1585eb){return function(_0x483fd5){if(!_0x483fd5){_0x308a2d[_0x1e92('0x1b')](0x194);}return _0x483fd5;};}function handleError(_0x19ca32,_0x4a0081){_0x4a0081=_0x4a0081||0x1f4;return function(_0x3fc37b){logger['error'](_0x3fc37b['stack']);if(_0x3fc37b[_0x1e92('0x2c')]){delete _0x3fc37b[_0x1e92('0x2c')];}_0x19ca32[_0x1e92('0x1c')](_0x4a0081)['send'](_0x3fc37b);};}exports[_0x1e92('0x2d')]=function(_0x34a715,_0x744cdf){var _0x4b7ec7={},_0x21b87c={},_0x152398={'count':0x0,'rows':[]};var _0x3040f5=_[_0x1e92('0x2e')](db[_0x1e92('0x2f')]['rawAttributes'],function(_0x8b7245){return{'name':_0x8b7245[_0x1e92('0x30')],'type':_0x8b7245['type']['key']};});_0x21b87c[_0x1e92('0x31')]=_[_0x1e92('0x2e')](_0x3040f5,'name');_0x21b87c[_0x1e92('0x32')]=_[_0x1e92('0x33')](_0x34a715[_0x1e92('0x32')]);_0x21b87c[_0x1e92('0x34')]=_[_0x1e92('0x35')](_0x21b87c[_0x1e92('0x31')],_0x21b87c[_0x1e92('0x32')]);_0x4b7ec7[_0x1e92('0x36')]=_[_0x1e92('0x35')](_0x21b87c[_0x1e92('0x31')],qs[_0x1e92('0x37')](_0x34a715[_0x1e92('0x32')][_0x1e92('0x37')]));_0x4b7ec7['attributes']=_0x4b7ec7['attributes'][_0x1e92('0x38')]?_0x4b7ec7[_0x1e92('0x36')]:_0x21b87c[_0x1e92('0x31')];if(!_0x34a715[_0x1e92('0x32')]['hasOwnProperty'](_0x1e92('0x39'))){_0x4b7ec7[_0x1e92('0x20')]=qs['limit'](_0x34a715[_0x1e92('0x32')][_0x1e92('0x20')]);_0x4b7ec7[_0x1e92('0x1e')]=qs[_0x1e92('0x1e')](_0x34a715[_0x1e92('0x32')][_0x1e92('0x1e')]);}_0x4b7ec7[_0x1e92('0x3a')]=qs[_0x1e92('0x3b')](_0x34a715[_0x1e92('0x32')][_0x1e92('0x3b')]);_0x4b7ec7['where']=qs[_0x1e92('0x34')](_[_0x1e92('0x3c')](_0x34a715['query'],_0x21b87c['filters']),_0x3040f5);if(_0x34a715[_0x1e92('0x32')][_0x1e92('0x3d')]){_0x4b7ec7['where']=_[_0x1e92('0x3e')](_0x4b7ec7['where'],{'$or':_[_0x1e92('0x2e')](_0x3040f5,function(_0x57c35f){if(_0x57c35f[_0x1e92('0x3f')]!==_0x1e92('0x40')){var _0x4c1948={};_0x4c1948[_0x57c35f['name']]={'$like':'%'+_0x34a715[_0x1e92('0x32')][_0x1e92('0x3d')]+'%'};return _0x4c1948;}})});}_0x4b7ec7=_[_0x1e92('0x3e')]({},_0x4b7ec7,_0x34a715[_0x1e92('0x41')]);var _0x43fe83={'where':_0x4b7ec7[_0x1e92('0x42')]};return db[_0x1e92('0x2f')][_0x1e92('0x21')](_0x43fe83)[_0x1e92('0x28')](function(_0xd701b4){_0x152398[_0x1e92('0x21')]=_0xd701b4;if(_0x34a715[_0x1e92('0x32')][_0x1e92('0x43')]){_0x4b7ec7[_0x1e92('0x44')]=[{'all':!![]}];}return db[_0x1e92('0x2f')][_0x1e92('0x45')](_0x4b7ec7);})[_0x1e92('0x28')](function(_0x4350d8){_0x152398[_0x1e92('0x46')]=_0x4350d8;return _0x152398;})[_0x1e92('0x28')](respondWithFilteredResult(_0x744cdf,_0x4b7ec7))['catch'](handleError(_0x744cdf,null));};exports['show']=function(_0x3e5fcf,_0x56d45c){var _0x64b6f2={'raw':!![],'where':{'id':_0x3e5fcf[_0x1e92('0x47')]['id']}},_0x31668a={};_0x31668a[_0x1e92('0x31')]=_['keys'](db[_0x1e92('0x2f')][_0x1e92('0x48')]);_0x31668a[_0x1e92('0x32')]=_[_0x1e92('0x33')](_0x3e5fcf[_0x1e92('0x32')]);_0x31668a[_0x1e92('0x34')]=_[_0x1e92('0x35')](_0x31668a['model'],_0x31668a[_0x1e92('0x32')]);_0x64b6f2[_0x1e92('0x36')]=_[_0x1e92('0x35')](_0x31668a[_0x1e92('0x31')],qs[_0x1e92('0x37')](_0x3e5fcf[_0x1e92('0x32')][_0x1e92('0x37')]));_0x64b6f2['attributes']=_0x64b6f2['attributes'][_0x1e92('0x38')]?_0x64b6f2['attributes']:_0x31668a[_0x1e92('0x31')];if(_0x3e5fcf[_0x1e92('0x32')][_0x1e92('0x43')]){_0x64b6f2['include']=[{'all':!![]}];}_0x64b6f2=_[_0x1e92('0x3e')]({},_0x64b6f2,_0x3e5fcf[_0x1e92('0x41')]);return db[_0x1e92('0x2f')][_0x1e92('0x49')](_0x64b6f2)[_0x1e92('0x28')](handleEntityNotFound(_0x56d45c,null))['then'](respondWithResult(_0x56d45c,null))['catch'](handleError(_0x56d45c,null));};exports['create']=function(_0x1d28a1,_0x5ed1b3){return db['Template'][_0x1e92('0x4a')](_0x1d28a1[_0x1e92('0x4b')],{})[_0x1e92('0x28')](function(_0x494a6a){var _0x26d743=_0x1d28a1[_0x1e92('0x4c')][_0x1e92('0x29')]({'plain':!![]});if(!_0x26d743)throw new Error(_0x1e92('0x4d'));if(_0x26d743[_0x1e92('0x4e')]===_0x1e92('0x4c')){var _0x252a31=_0x494a6a[_0x1e92('0x29')]({'plain':!![]});var _0x50bf74=_0x1e92('0x2a');return db[_0x1e92('0x4f')]['find']({'where':{'name':_0x50bf74,'userProfileId':_0x26d743[_0x1e92('0x50')]},'raw':!![]})[_0x1e92('0x28')](function(_0x29efcd){if(_0x29efcd&&_0x29efcd[_0x1e92('0x51')]===0x0){return db[_0x1e92('0x2b')][_0x1e92('0x4a')]({'name':_0x252a31[_0x1e92('0x2c')],'resourceId':_0x252a31['id'],'type':_0x29efcd[_0x1e92('0x2c')],'sectionId':_0x29efcd['id']},{})[_0x1e92('0x28')](function(){return _0x494a6a;});}else{return _0x494a6a;}})[_0x1e92('0x52')](function(_0x8ac10f){logger[_0x1e92('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8ac10f);throw _0x8ac10f;});}return _0x494a6a;})[_0x1e92('0x28')](respondWithResult(_0x5ed1b3,0xc9))[_0x1e92('0x52')](handleError(_0x5ed1b3,null));};exports[_0x1e92('0x54')]=function(_0x3e2c05,_0x245cba){if(_0x3e2c05['body']['id']){delete _0x3e2c05['body']['id'];}return db['Template'][_0x1e92('0x49')]({'where':{'id':_0x3e2c05['params']['id']}})[_0x1e92('0x28')](handleEntityNotFound(_0x245cba,null))[_0x1e92('0x28')](saveUpdates(_0x3e2c05[_0x1e92('0x4b')],null))[_0x1e92('0x28')](respondWithResult(_0x245cba,null))[_0x1e92('0x52')](handleError(_0x245cba,null));};exports[_0x1e92('0x27')]=function(_0x13a28a,_0x2b4df6){return db[_0x1e92('0x2f')][_0x1e92('0x49')]({'where':{'id':_0x13a28a[_0x1e92('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b4df6,null))[_0x1e92('0x28')](removeEntity(_0x2b4df6,null))['catch'](handleError(_0x2b4df6,null));};
\ No newline at end of file
index 90665f4..4cc68e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c6a=['tools_templates','util','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c6a,0x1cc));var _0xa1c6=function(_0x56bd0c,_0x51c525){_0x56bd0c=_0x56bd0c-0x0;var _0x8b5f15=_0x1c6a[_0x56bd0c];return _0x8b5f15;};'use strict';var _=require('lodash');var util=require(_0xa1c6('0x0'));var logger=require('../../config/logger')(_0xa1c6('0x1'));var moment=require(_0xa1c6('0x2'));var BPromise=require(_0xa1c6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1c6('0x4'));var rimraf=require(_0xa1c6('0x5'));var config=require(_0xa1c6('0x6'));var attributes=require('./template.attributes');module['exports']=function(_0x123999,_0x3baf4a){return _0x123999[_0xa1c6('0x7')]('Template',attributes,{'tableName':_0xa1c6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9b9=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','Template'];(function(_0x2c2f63,_0x434e6e){var _0x405b19=function(_0x598f59){while(--_0x598f59){_0x2c2f63['push'](_0x2c2f63['shift']());}};_0x405b19(++_0x434e6e);}(_0xf9b9,0xeb));var _0x9f9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9b9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9f9b('0x0'));var util=require(_0x9f9b('0x1'));var logger=require(_0x9f9b('0x2'))(_0x9f9b('0x3'));var moment=require(_0x9f9b('0x4'));var BPromise=require(_0x9f9b('0x5'));var rp=require(_0x9f9b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f9b('0x7'));var config=require(_0x9f9b('0x8'));var attributes=require(_0x9f9b('0x9'));module[_0x9f9b('0xa')]=function(_0x3bf3b9,_0x43a398){return _0x3bf3b9['define'](_0x9f9b('0xb'),attributes,{'tableName':_0x9f9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c672df..f7dfa70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2972=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','message','Template,\x20%s,\x20%s','catch','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTemplate','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2972,0x144));var _0x2297=function(_0x1ab29,_0xfa18cf){_0x1ab29=_0x1ab29-0x0;var _0x3b0b0a=_0x2972[_0x1ab29];return _0x3b0b0a;};'use strict';var _=require(_0x2297('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2297('0x1'));var rs=require(_0x2297('0x2'));var fs=require('fs');var Redis=require(_0x2297('0x3'));var db=require(_0x2297('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2297('0x5'))(_0x2297('0x6'));var config=require(_0x2297('0x7'));var jayson=require(_0x2297('0x8'));var client=jayson[_0x2297('0x9')][_0x2297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f65a3,_0x4d0c06,_0x50bff7){return new BPromise(function(_0x41f7a0,_0x414dbb){return client[_0x2297('0xb')](_0x4f65a3,_0x50bff7)['then'](function(_0x845a95){logger[_0x2297('0xc')]('Template,\x20%s,\x20%s',_0x4d0c06,_0x2297('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x4d0c06,_0x2297('0xd'),JSON[_0x2297('0xe')](_0x845a95));if(_0x845a95[_0x2297('0xf')]){if(_0x845a95[_0x2297('0xf')][_0x2297('0x10')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x4d0c06,_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);return _0x414dbb(_0x845a95['error'][_0x2297('0x11')]);}logger['error'](_0x2297('0x12'),_0x4d0c06,_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);return _0x41f7a0(_0x845a95[_0x2297('0xf')][_0x2297('0x11')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x4d0c06,'request\x20sent');_0x41f7a0(_0x845a95['result'][_0x2297('0x11')]);}})[_0x2297('0x13')](function(_0x38d337){logger[_0x2297('0xf')](_0x2297('0x12'),_0x4d0c06,_0x38d337);_0x414dbb(_0x38d337);});});}exports['GetTemplate']=function(_0x7266e6){var _0x3021f8=this;return new Promise(function(_0x1492ef,_0x5976eb){return db[_0x2297('0x14')][_0x2297('0x15')]({'raw':_0x7266e6[_0x2297('0x16')]?_0x7266e6[_0x2297('0x16')][_0x2297('0x17')]===undefined?!![]:![]:!![],'where':_0x7266e6[_0x2297('0x16')]?_0x7266e6[_0x2297('0x16')][_0x2297('0x18')]||null:null,'attributes':_0x7266e6[_0x2297('0x16')]?_0x7266e6[_0x2297('0x16')][_0x2297('0x19')]||null:null,'limit':_0x7266e6['options']?_0x7266e6['options'][_0x2297('0x1a')]||null:null,'include':_0x7266e6[_0x2297('0x16')]?_0x7266e6[_0x2297('0x16')][_0x2297('0x1b')]?_[_0x2297('0x1c')](_0x7266e6[_0x2297('0x16')]['include'],function(_0x5e0e89){return{'model':db[_0x5e0e89[_0x2297('0x1d')]],'as':_0x5e0e89['as'],'attributes':_0x5e0e89[_0x2297('0x19')],'include':_0x5e0e89[_0x2297('0x1b')]?_[_0x2297('0x1c')](_0x5e0e89[_0x2297('0x1b')],function(_0xb51344){return{'model':db[_0xb51344[_0x2297('0x1d')]],'as':_0xb51344['as'],'attributes':_0xb51344[_0x2297('0x19')],'include':_0xb51344[_0x2297('0x1b')]?_[_0x2297('0x1c')](_0xb51344[_0x2297('0x1b')],function(_0x2d30f1){return{'model':db[_0x2d30f1[_0x2297('0x1d')]],'as':_0x2d30f1['as'],'attributes':_0x2d30f1[_0x2297('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2297('0x1e')](function(_0x5e07c4){logger[_0x2297('0xc')](_0x2297('0x1f'),_0x7266e6);logger[_0x2297('0x20')](_0x2297('0x1f'),_0x7266e6,JSON[_0x2297('0xe')](_0x5e07c4));_0x1492ef(_0x5e07c4);})[_0x2297('0x13')](function(_0x18a111){logger[_0x2297('0xf')](_0x2297('0x1f'),_0x18a111[_0x2297('0x11')],_0x7266e6);_0x5976eb(_0x3021f8[_0x2297('0xf')](0x1f4,_0x18a111[_0x2297('0x11')]));});});};
\ No newline at end of file
+var _0x657b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','model','map','info','stringify','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x657b,0x131));var _0xb657=function(_0x322cd4,_0x46cc8a){_0x322cd4=_0x322cd4-0x0;var _0x424f64=_0x657b[_0x322cd4];return _0x424f64;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var moment=require(_0xb657('0x2'));var BPromise=require(_0xb657('0x3'));var rs=require(_0xb657('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb657('0x5'))['db'];var utils=require(_0xb657('0x6'));var logger=require('../../config/logger')(_0xb657('0x7'));var config=require(_0xb657('0x8'));var jayson=require(_0xb657('0x9'));var client=jayson[_0xb657('0xa')][_0xb657('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d54f6,_0x471e78,_0x55acdf){return new BPromise(function(_0x326dd7,_0x42a844){return client[_0xb657('0xc')](_0x5d54f6,_0x55acdf)['then'](function(_0x36b334){logger['info'](_0xb657('0xd'),_0x471e78,'request\x20sent');logger[_0xb657('0xe')](_0xb657('0xf'),_0x471e78,_0xb657('0x10'),JSON['stringify'](_0x36b334));if(_0x36b334[_0xb657('0x11')]){if(_0x36b334[_0xb657('0x11')][_0xb657('0x12')]===0x1f4){logger[_0xb657('0x11')]('Template,\x20%s,\x20%s',_0x471e78,_0x36b334[_0xb657('0x11')][_0xb657('0x13')]);return _0x42a844(_0x36b334['error'][_0xb657('0x13')]);}logger[_0xb657('0x11')](_0xb657('0xd'),_0x471e78,_0x36b334[_0xb657('0x11')]['message']);return _0x326dd7(_0x36b334[_0xb657('0x11')][_0xb657('0x13')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x471e78,_0xb657('0x10'));_0x326dd7(_0x36b334[_0xb657('0x14')][_0xb657('0x13')]);}})[_0xb657('0x15')](function(_0x17c045){logger[_0xb657('0x11')](_0xb657('0xd'),_0x471e78,_0x17c045);_0x42a844(_0x17c045);});});}exports[_0xb657('0x16')]=function(_0x9e98be){var _0x1218e5=this;return new Promise(function(_0x2f0ba0,_0x4918ff){return db[_0xb657('0x17')][_0xb657('0x18')]({'raw':_0x9e98be[_0xb657('0x19')]?_0x9e98be[_0xb657('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x9e98be['options']?_0x9e98be[_0xb657('0x19')][_0xb657('0x1a')]||null:null,'attributes':_0x9e98be[_0xb657('0x19')]?_0x9e98be['options'][_0xb657('0x1b')]||null:null,'limit':_0x9e98be['options']?_0x9e98be[_0xb657('0x19')][_0xb657('0x1c')]||null:null,'include':_0x9e98be[_0xb657('0x19')]?_0x9e98be[_0xb657('0x19')][_0xb657('0x1d')]?_['map'](_0x9e98be[_0xb657('0x19')][_0xb657('0x1d')],function(_0x38b4a0){return{'model':db[_0x38b4a0[_0xb657('0x1e')]],'as':_0x38b4a0['as'],'attributes':_0x38b4a0['attributes'],'include':_0x38b4a0[_0xb657('0x1d')]?_['map'](_0x38b4a0[_0xb657('0x1d')],function(_0x4e8587){return{'model':db[_0x4e8587[_0xb657('0x1e')]],'as':_0x4e8587['as'],'attributes':_0x4e8587['attributes'],'include':_0x4e8587[_0xb657('0x1d')]?_[_0xb657('0x1f')](_0x4e8587['include'],function(_0x241301){return{'model':db[_0x241301[_0xb657('0x1e')]],'as':_0x241301['as'],'attributes':_0x241301[_0xb657('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d91f3){logger[_0xb657('0x20')](_0xb657('0x16'),_0x9e98be);logger[_0xb657('0xe')](_0xb657('0x16'),_0x9e98be,JSON[_0xb657('0x21')](_0x1d91f3));_0x2f0ba0(_0x1d91f3);})[_0xb657('0x15')](function(_0x3be5de){logger[_0xb657('0x11')](_0xb657('0x16'),_0x3be5de[_0xb657('0x13')],_0x9e98be);_0x4918ff(_0x1218e5[_0xb657('0x11')](0x1f4,_0x3be5de[_0xb657('0x13')]));});});};
\ No newline at end of file
index d444a89..4002237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af9=['getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./trigger.controller','isAuthenticated','index','/:id','show','get','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions'];(function(_0x1eecc5,_0x110927){var _0xcad326=function(_0xa30f0f){while(--_0xa30f0f){_0x1eecc5['push'](_0x1eecc5['shift']());}};_0xcad326(++_0x110927);}(_0x7af9,0x7c));var _0x97af=function(_0x2d3bb6,_0x4039db){_0x2d3bb6=_0x2d3bb6-0x0;var _0x33c4e7=_0x7af9[_0x2d3bb6];return _0x33c4e7;};'use strict';var multer=require(_0x97af('0x0'));var util=require(_0x97af('0x1'));var path=require(_0x97af('0x2'));var timeout=require(_0x97af('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x97af('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x97af('0x5'));var config=require('../../config/environment');var controller=require(_0x97af('0x6'));router['get']('/',auth[_0x97af('0x7')](),controller[_0x97af('0x8')]);router['get'](_0x97af('0x9'),auth[_0x97af('0x7')](),controller[_0x97af('0xa')]);router[_0x97af('0xb')](_0x97af('0xc'),auth['isAuthenticated'](),controller[_0x97af('0xd')]);router[_0x97af('0xb')]('/:id/any_conditions',auth[_0x97af('0x7')](),controller[_0x97af('0xe')]);router['get'](_0x97af('0xf'),auth[_0x97af('0x7')](),controller[_0x97af('0x10')]);router[_0x97af('0x11')]('/',auth['isAuthenticated'](),controller[_0x97af('0x12')]);router[_0x97af('0x11')](_0x97af('0xc'),auth[_0x97af('0x7')](),controller[_0x97af('0x13')]);router[_0x97af('0x11')](_0x97af('0x14'),auth['isAuthenticated'](),controller[_0x97af('0x15')]);router[_0x97af('0x11')](_0x97af('0xf'),auth['isAuthenticated'](),controller[_0x97af('0x16')]);router[_0x97af('0x17')](_0x97af('0x9'),auth[_0x97af('0x7')](),controller[_0x97af('0x18')]);router[_0x97af('0x19')](_0x97af('0x9'),auth['isAuthenticated'](),controller[_0x97af('0x1a')]);module[_0x97af('0x1b')]=router;
\ No newline at end of file
+var _0x36e1=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','delete'];(function(_0x3ca689,_0x56f0b0){var _0x234f86=function(_0x59429e){while(--_0x59429e){_0x3ca689['push'](_0x3ca689['shift']());}};_0x234f86(++_0x56f0b0);}(_0x36e1,0x187));var _0x136e=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x36e1[_0x16ea87];return _0x6e7b1c;};'use strict';var multer=require(_0x136e('0x0'));var util=require(_0x136e('0x1'));var path=require(_0x136e('0x2'));var timeout=require('connect-timeout');var express=require(_0x136e('0x3'));var router=express[_0x136e('0x4')]();var fs_extra=require(_0x136e('0x5'));var auth=require(_0x136e('0x6'));var interaction=require(_0x136e('0x7'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x136e('0x8')]('/',auth[_0x136e('0x9')](),controller['index']);router[_0x136e('0x8')](_0x136e('0xa'),auth[_0x136e('0x9')](),controller[_0x136e('0xb')]);router[_0x136e('0x8')](_0x136e('0xc'),auth[_0x136e('0x9')](),controller['getAllConditions']);router[_0x136e('0x8')](_0x136e('0xd'),auth['isAuthenticated'](),controller[_0x136e('0xe')]);router[_0x136e('0x8')]('/:id/actions',auth[_0x136e('0x9')](),controller[_0x136e('0xf')]);router[_0x136e('0x10')]('/',auth['isAuthenticated'](),controller[_0x136e('0x11')]);router[_0x136e('0x10')](_0x136e('0xc'),auth[_0x136e('0x9')](),controller[_0x136e('0x12')]);router[_0x136e('0x10')](_0x136e('0xd'),auth['isAuthenticated'](),controller[_0x136e('0x13')]);router[_0x136e('0x10')](_0x136e('0x14'),auth['isAuthenticated'](),controller[_0x136e('0x15')]);router[_0x136e('0x16')](_0x136e('0xa'),auth[_0x136e('0x9')](),controller[_0x136e('0x17')]);router[_0x136e('0x18')](_0x136e('0xa'),auth[_0x136e('0x9')](),controller[_0x136e('0x19')]);module['exports']=router;
\ No newline at end of file
index 11bac76..2e705a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2f3=['STRING','exports'];(function(_0x2d9b22,_0x3ae033){var _0x3c3a18=function(_0x10a23e){while(--_0x10a23e){_0x2d9b22['push'](_0x2d9b22['shift']());}};_0x3c3a18(++_0x3ae033);}(_0xa2f3,0x149));var _0x3a2f=function(_0x5bc88f,_0x413ba0){_0x5bc88f=_0x5bc88f-0x0;var _0x3364aa=_0xa2f3[_0x5bc88f];return _0x3364aa;};'use strict';var Sequelize=require('sequelize');module[_0x3a2f('0x0')]={'name':{'type':Sequelize[_0x3a2f('0x1')]},'channel':{'type':Sequelize[_0x3a2f('0x1')]},'description':{'type':Sequelize[_0x3a2f('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x68b6=['exports','STRING','sequelize'];(function(_0x3b69e3,_0x40bb88){var _0x1f5b5e=function(_0x4fdd01){while(--_0x4fdd01){_0x3b69e3['push'](_0x3b69e3['shift']());}};_0x1f5b5e(++_0x40bb88);}(_0x68b6,0x1a3));var _0x668b=function(_0x2a1a82,_0x3fdaa6){_0x2a1a82=_0x2a1a82-0x0;var _0x1b3e71=_0x68b6[_0x2a1a82];return _0x1b3e71;};'use strict';var Sequelize=require(_0x668b('0x0'));module[_0x668b('0x1')]={'name':{'type':Sequelize[_0x668b('0x2')]},'channel':{'type':Sequelize[_0x668b('0x2')]},'description':{'type':Sequelize[_0x668b('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 64c8626..31e4028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa48e=['sort','pick','merge','where','VIRTUAL','filter','options','Trigger','includeAll','include','rows','show','params','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','UserProfileSection','userProfileId','autoAssociation','error','body','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','hasOwnProperty','addAction','Action','getActions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','limit','offset','count','set','json','apply','reject','save','update','then','get','UserProfileResource','sendStatus','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order'];(function(_0x11abef,_0x30fd75){var _0xb0bf55=function(_0x3f6d75){while(--_0x3f6d75){_0x11abef['push'](_0x11abef['shift']());}};_0xb0bf55(++_0x30fd75);}(_0xa48e,0x7f));var _0xea48=function(_0x278f72,_0x564a31){_0x278f72=_0x278f72-0x0;var _0x1f0726=_0xa48e[_0x278f72];return _0x1f0726;};'use strict';var emlformat=require(_0xea48('0x0'));var rimraf=require(_0xea48('0x1'));var zipdir=require(_0xea48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea48('0x3'));var moment=require(_0xea48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea48('0x5'));var util=require(_0xea48('0x6'));var path=require(_0xea48('0x7'));var sox=require(_0xea48('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea48('0x9'));var _=require('lodash');var squel=require(_0xea48('0xa'));var crypto=require('crypto');var jsforce=require(_0xea48('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea48('0xc'));var Papa=require(_0xea48('0xd'));var Redis=require('ioredis');var authService=require(_0xea48('0xe'));var qs=require(_0xea48('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea48('0x10'));var logger=require(_0xea48('0x11'))('api');var utils=require(_0xea48('0x12'));var config=require(_0xea48('0x13'));var licenseUtil=require(_0xea48('0x14'));var db=require(_0xea48('0x15'))['db'];function respondWithStatusCode(_0x3324d5,_0x3c521c){_0x3c521c=_0x3c521c||0xcc;return function(_0x569b08){if(_0x569b08){return _0x3324d5['sendStatus'](_0x3c521c);}return _0x3324d5['status'](_0x3c521c)[_0xea48('0x16')]();};}function respondWithResult(_0x455137,_0x1614c2){_0x1614c2=_0x1614c2||0xc8;return function(_0xf6806c){if(_0xf6806c){return _0x455137[_0xea48('0x17')](_0x1614c2)['json'](_0xf6806c);}};}function respondWithFilteredResult(_0xb9960,_0xd2060a){return function(_0xe8ec75){if(_0xe8ec75){var _0x213d90=typeof _0xd2060a['offset']==='undefined'&&typeof _0xd2060a[_0xea48('0x18')]==='undefined';var _0x166003=_0xe8ec75['count'];var _0x4c8ada=_0x213d90?0x0:_0xd2060a[_0xea48('0x19')];var _0x29d92e=_0x213d90?_0xe8ec75[_0xea48('0x1a')]:_0xd2060a['offset']+_0xd2060a[_0xea48('0x18')];var _0x817319;if(_0x29d92e>=_0x166003){_0x29d92e=_0x166003;_0x817319=0xc8;}else{_0x817319=0xce;}_0xb9960[_0xea48('0x17')](_0x817319);return _0xb9960[_0xea48('0x1b')]('Content-Range',_0x4c8ada+'-'+_0x29d92e+'/'+_0x166003)[_0xea48('0x1c')](_0xe8ec75);}return null;};}function patchUpdates(_0x460586){return function(_0x23df1d){try{jsonpatch[_0xea48('0x1d')](_0x23df1d,_0x460586,!![]);}catch(_0x298f26){return BPromise[_0xea48('0x1e')](_0x298f26);}return _0x23df1d[_0xea48('0x1f')]();};}function saveUpdates(_0x27466b,_0x2c1a19){return function(_0x1d2ab9){if(_0x1d2ab9){return _0x1d2ab9[_0xea48('0x20')](_0x27466b)['then'](function(_0x3a989a){return _0x3a989a;});}return null;};}function removeEntity(_0x4502d8,_0x13ce66){return function(_0x5dccf5){if(_0x5dccf5){return _0x5dccf5['destroy']()[_0xea48('0x21')](function(){var _0x43d24f=_0x5dccf5[_0xea48('0x22')]({'plain':!![]});var _0x55401e='Triggers';return db[_0xea48('0x23')]['destroy']({'where':{'type':_0x55401e,'resourceId':_0x43d24f['id']}})['then'](function(){return _0x5dccf5;});})[_0xea48('0x21')](function(){_0x4502d8['status'](0xcc)[_0xea48('0x16')]();});}};}function handleEntityNotFound(_0x5b85bf,_0x482f31){return function(_0x541b15){if(!_0x541b15){_0x5b85bf[_0xea48('0x24')](0x194);}return _0x541b15;};}function handleError(_0x16e0d5,_0x7dbe94){_0x7dbe94=_0x7dbe94||0x1f4;return function(_0x4a6677){logger['error'](_0x4a6677['stack']);if(_0x4a6677[_0xea48('0x25')]){delete _0x4a6677[_0xea48('0x25')];}_0x16e0d5['status'](_0x7dbe94)[_0xea48('0x26')](_0x4a6677);};}exports['index']=function(_0x3ed3c9,_0x1e8371){var _0x436cde={},_0x10106b={},_0x1e258b={'count':0x0,'rows':[]};var _0x7ec631=_[_0xea48('0x27')](db['Trigger'][_0xea48('0x28')],function(_0x1bd25b){return{'name':_0x1bd25b[_0xea48('0x29')],'type':_0x1bd25b[_0xea48('0x2a')][_0xea48('0x2b')]};});_0x10106b[_0xea48('0x2c')]=_[_0xea48('0x27')](_0x7ec631,_0xea48('0x25'));_0x10106b[_0xea48('0x2d')]=_[_0xea48('0x2e')](_0x3ed3c9['query']);_0x10106b[_0xea48('0x2f')]=_[_0xea48('0x30')](_0x10106b[_0xea48('0x2c')],_0x10106b[_0xea48('0x2d')]);_0x436cde['attributes']=_[_0xea48('0x30')](_0x10106b['model'],qs[_0xea48('0x31')](_0x3ed3c9[_0xea48('0x2d')]['fields']));_0x436cde[_0xea48('0x32')]=_0x436cde[_0xea48('0x32')]['length']?_0x436cde['attributes']:_0x10106b[_0xea48('0x2c')];if(!_0x3ed3c9['query']['hasOwnProperty'](_0xea48('0x33'))){_0x436cde['limit']=qs['limit'](_0x3ed3c9['query']['limit']);_0x436cde[_0xea48('0x19')]=qs['offset'](_0x3ed3c9['query'][_0xea48('0x19')]);}_0x436cde[_0xea48('0x34')]=qs['sort'](_0x3ed3c9[_0xea48('0x2d')][_0xea48('0x35')]);_0x436cde['where']=qs[_0xea48('0x2f')](_[_0xea48('0x36')](_0x3ed3c9['query'],_0x10106b[_0xea48('0x2f')]),_0x7ec631);if(_0x3ed3c9[_0xea48('0x2d')]['filter']){_0x436cde['where']=_[_0xea48('0x37')](_0x436cde[_0xea48('0x38')],{'$or':_[_0xea48('0x27')](_0x7ec631,function(_0x58ce75){if(_0x58ce75[_0xea48('0x2a')]!==_0xea48('0x39')){var _0x215bda={};_0x215bda[_0x58ce75['name']]={'$like':'%'+_0x3ed3c9[_0xea48('0x2d')][_0xea48('0x3a')]+'%'};return _0x215bda;}})});}_0x436cde=_[_0xea48('0x37')]({},_0x436cde,_0x3ed3c9[_0xea48('0x3b')]);var _0x154706={'where':_0x436cde['where']};return db[_0xea48('0x3c')][_0xea48('0x1a')](_0x154706)[_0xea48('0x21')](function(_0x4d181e){_0x1e258b[_0xea48('0x1a')]=_0x4d181e;if(_0x3ed3c9[_0xea48('0x2d')][_0xea48('0x3d')]){_0x436cde[_0xea48('0x3e')]=[{'all':!![]}];}return db[_0xea48('0x3c')]['findAll'](_0x436cde);})[_0xea48('0x21')](function(_0x69bfb){_0x1e258b[_0xea48('0x3f')]=_0x69bfb;return _0x1e258b;})[_0xea48('0x21')](respondWithFilteredResult(_0x1e8371,_0x436cde))['catch'](handleError(_0x1e8371,null));};exports[_0xea48('0x40')]=function(_0x5d29b3,_0x54f6a1){var _0x3b4840={'raw':![],'where':{'id':_0x5d29b3[_0xea48('0x41')]['id']}},_0x362b29={};_0x362b29[_0xea48('0x2c')]=_[_0xea48('0x2e')](db['Trigger'][_0xea48('0x28')]);_0x362b29[_0xea48('0x2d')]=_[_0xea48('0x2e')](_0x5d29b3[_0xea48('0x2d')]);_0x362b29[_0xea48('0x2f')]=_[_0xea48('0x30')](_0x362b29[_0xea48('0x2c')],_0x362b29[_0xea48('0x2d')]);_0x3b4840[_0xea48('0x32')]=_[_0xea48('0x30')](_0x362b29['model'],qs['fields'](_0x5d29b3[_0xea48('0x2d')]['fields']));_0x3b4840[_0xea48('0x32')]=_0x3b4840['attributes'][_0xea48('0x42')]?_0x3b4840[_0xea48('0x32')]:_0x362b29[_0xea48('0x2c')];if(_0x5d29b3[_0xea48('0x2d')][_0xea48('0x3d')]){_0x3b4840['include']=[{'all':!![]}];}_0x3b4840=_[_0xea48('0x37')]({},_0x3b4840,_0x5d29b3['options']);return db[_0xea48('0x3c')][_0xea48('0x43')](_0x3b4840)[_0xea48('0x21')](handleEntityNotFound(_0x54f6a1,null))['then'](respondWithResult(_0x54f6a1,null))[_0xea48('0x44')](handleError(_0x54f6a1,null));};exports[_0xea48('0x45')]=function(_0x349862,_0x3713e2){return db[_0xea48('0x3c')][_0xea48('0x45')](_0x349862['body'],{})[_0xea48('0x21')](function(_0x3c7008){var _0x1d61af=_0x349862['user'][_0xea48('0x22')]({'plain':!![]});if(!_0x1d61af)throw new Error(_0xea48('0x46'));if(_0x1d61af[_0xea48('0x47')]===_0xea48('0x48')){var _0x442403=_0x3c7008[_0xea48('0x22')]({'plain':!![]});var _0x222397=_0xea48('0x49');return db[_0xea48('0x4a')][_0xea48('0x43')]({'where':{'name':_0x222397,'userProfileId':_0x1d61af[_0xea48('0x4b')]},'raw':!![]})[_0xea48('0x21')](function(_0x149d96){if(_0x149d96&&_0x149d96[_0xea48('0x4c')]===0x0){return db[_0xea48('0x23')]['create']({'name':_0x442403[_0xea48('0x25')],'resourceId':_0x442403['id'],'type':_0x149d96['name'],'sectionId':_0x149d96['id']},{})[_0xea48('0x21')](function(){return _0x3c7008;});}else{return _0x3c7008;}})[_0xea48('0x44')](function(_0x333915){logger[_0xea48('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x333915);throw _0x333915;});}return _0x3c7008;})[_0xea48('0x21')](respondWithResult(_0x3713e2,0xc9))[_0xea48('0x44')](handleError(_0x3713e2,null));};exports[_0xea48('0x20')]=function(_0xa1d9dc,_0x4f001f){if(_0xa1d9dc[_0xea48('0x4e')]['id']){delete _0xa1d9dc[_0xea48('0x4e')]['id'];}return db[_0xea48('0x3c')][_0xea48('0x43')]({'where':{'id':_0xa1d9dc[_0xea48('0x41')]['id']}})[_0xea48('0x21')](handleEntityNotFound(_0x4f001f,null))[_0xea48('0x21')](saveUpdates(_0xa1d9dc['body'],null))['then'](respondWithResult(_0x4f001f,null))[_0xea48('0x44')](handleError(_0x4f001f,null));};exports['destroy']=function(_0x398afc,_0x139363){return db['Trigger'][_0xea48('0x43')]({'where':{'id':_0x398afc['params']['id']}})[_0xea48('0x21')](handleEntityNotFound(_0x139363,null))['then'](removeEntity(_0x139363,null))['catch'](handleError(_0x139363,null));};exports['addAllCondition']=function(_0x51b950,_0x5e70e7,_0x13ebc0){if(_0x51b950[_0xea48('0x4e')]['id']){delete _0x51b950['body']['id'];}return db[_0xea48('0x3c')][_0xea48('0x43')]({'where':{'id':_0x51b950['params']['id']}})[_0xea48('0x21')](handleEntityNotFound(_0x5e70e7,null))[_0xea48('0x21')](function(_0x7cac3b){if(_0x7cac3b){_0x51b950['body'][_0xea48('0x4f')]=_0x7cac3b['id'];return db[_0xea48('0x50')][_0xea48('0x45')](_0x51b950[_0xea48('0x4e')]);}})[_0xea48('0x21')](respondWithResult(_0x5e70e7,null))[_0xea48('0x44')](handleError(_0x5e70e7,null));};exports[_0xea48('0x51')]=function(_0x27bb86,_0x5c2430,_0x4ab150){if(_0x27bb86['body']['id']){delete _0x27bb86[_0xea48('0x4e')]['id'];}return db['Trigger'][_0xea48('0x43')]({'where':{'id':_0x27bb86['params']['id']}})[_0xea48('0x21')](handleEntityNotFound(_0x5c2430,null))[_0xea48('0x21')](function(_0x3f8568){if(_0x3f8568){_0x27bb86[_0xea48('0x4e')][_0xea48('0x52')]=_0x3f8568['id'];return db[_0xea48('0x50')][_0xea48('0x45')](_0x27bb86[_0xea48('0x4e')]);}})[_0xea48('0x21')](respondWithResult(_0x5c2430,null))['catch'](handleError(_0x5c2430,null));};exports['getAllConditions']=function(_0x191ee0,_0x287929,_0x5b9f92){var _0x26c5d9={};var _0x29bb1d={};var _0x5a13b7;var _0x49f3c1;return db[_0xea48('0x3c')]['findOne']({'where':{'id':_0x191ee0[_0xea48('0x41')]['id']}})['then'](handleEntityNotFound(_0x287929,null))[_0xea48('0x21')](function(_0x29cb0e){if(_0x29cb0e){_0x5a13b7=_0x29cb0e;_0x29bb1d['model']=_['keys'](db['Condition'][_0xea48('0x28')]);_0x29bb1d['query']=_[_0xea48('0x2e')](_0x191ee0[_0xea48('0x2d')]);_0x29bb1d[_0xea48('0x2f')]=_[_0xea48('0x30')](_0x29bb1d[_0xea48('0x2c')],_0x29bb1d['query']);_0x26c5d9[_0xea48('0x32')]=_[_0xea48('0x30')](_0x29bb1d[_0xea48('0x2c')],qs[_0xea48('0x31')](_0x191ee0[_0xea48('0x2d')][_0xea48('0x31')]));_0x26c5d9[_0xea48('0x32')]=_0x26c5d9[_0xea48('0x32')]['length']?_0x26c5d9['attributes']:_0x29bb1d['model'];_0x26c5d9[_0xea48('0x34')]=qs[_0xea48('0x35')](_0x191ee0[_0xea48('0x2d')][_0xea48('0x35')]);_0x26c5d9[_0xea48('0x38')]=qs[_0xea48('0x2f')](_[_0xea48('0x36')](_0x191ee0[_0xea48('0x2d')],_0x29bb1d[_0xea48('0x2f')]));if(_0x191ee0[_0xea48('0x2d')][_0xea48('0x3a')]){_0x26c5d9[_0xea48('0x38')]=_[_0xea48('0x37')](_0x26c5d9['where'],{'$or':_[_0xea48('0x27')](_0x26c5d9['attributes'],function(_0xdcd0d2){var _0x1b27b1={};_0x1b27b1[_0xdcd0d2]={'$like':'%'+_0x191ee0[_0xea48('0x2d')][_0xea48('0x3a')]+'%'};return _0x1b27b1;})});}_0x26c5d9=_[_0xea48('0x37')]({},_0x26c5d9,_0x191ee0['options']);return _0x5a13b7[_0xea48('0x53')](_0x26c5d9);}})['then'](function(_0x71dbc6){if(_0x71dbc6){_0x49f3c1=_0x71dbc6[_0xea48('0x42')];if(!_0x191ee0[_0xea48('0x2d')]['hasOwnProperty'](_0xea48('0x33'))){_0x26c5d9[_0xea48('0x18')]=qs['limit'](_0x191ee0['query'][_0xea48('0x18')]);_0x26c5d9[_0xea48('0x19')]=qs[_0xea48('0x19')](_0x191ee0[_0xea48('0x2d')][_0xea48('0x19')]);}return _0x5a13b7[_0xea48('0x53')](_0x26c5d9);}})['then'](function(_0x387b69){if(_0x387b69){return _0x387b69?{'count':_0x49f3c1,'rows':_0x387b69}:null;}})[_0xea48('0x21')](respondWithResult(_0x287929,null))['catch'](handleError(_0x287929,null));};exports[_0xea48('0x54')]=function(_0x9980b3,_0xdbfe38,_0x32205c){var _0x38710c={};var _0x5309ca={};var _0x3f74da;var _0x4fa626;return db[_0xea48('0x3c')]['findOne']({'where':{'id':_0x9980b3[_0xea48('0x41')]['id']}})[_0xea48('0x21')](handleEntityNotFound(_0xdbfe38,null))[_0xea48('0x21')](function(_0x2a3f6f){if(_0x2a3f6f){_0x3f74da=_0x2a3f6f;_0x5309ca[_0xea48('0x2c')]=_[_0xea48('0x2e')](db[_0xea48('0x50')][_0xea48('0x28')]);_0x5309ca['query']=_['keys'](_0x9980b3[_0xea48('0x2d')]);_0x5309ca[_0xea48('0x2f')]=_[_0xea48('0x30')](_0x5309ca['model'],_0x5309ca[_0xea48('0x2d')]);_0x38710c[_0xea48('0x32')]=_[_0xea48('0x30')](_0x5309ca[_0xea48('0x2c')],qs[_0xea48('0x31')](_0x9980b3[_0xea48('0x2d')][_0xea48('0x31')]));_0x38710c[_0xea48('0x32')]=_0x38710c['attributes'][_0xea48('0x42')]?_0x38710c[_0xea48('0x32')]:_0x5309ca[_0xea48('0x2c')];_0x38710c[_0xea48('0x34')]=qs[_0xea48('0x35')](_0x9980b3['query'][_0xea48('0x35')]);_0x38710c[_0xea48('0x38')]=qs[_0xea48('0x2f')](_['pick'](_0x9980b3[_0xea48('0x2d')],_0x5309ca[_0xea48('0x2f')]));if(_0x9980b3['query'][_0xea48('0x3a')]){_0x38710c[_0xea48('0x38')]=_[_0xea48('0x37')](_0x38710c[_0xea48('0x38')],{'$or':_['map'](_0x38710c[_0xea48('0x32')],function(_0x57da64){var _0x5a7428={};_0x5a7428[_0x57da64]={'$like':'%'+_0x9980b3[_0xea48('0x2d')][_0xea48('0x3a')]+'%'};return _0x5a7428;})});}_0x38710c=_[_0xea48('0x37')]({},_0x38710c,_0x9980b3[_0xea48('0x3b')]);return _0x3f74da[_0xea48('0x54')](_0x38710c);}})[_0xea48('0x21')](function(_0x33d771){if(_0x33d771){_0x4fa626=_0x33d771[_0xea48('0x42')];if(!_0x9980b3[_0xea48('0x2d')][_0xea48('0x55')](_0xea48('0x33'))){_0x38710c['limit']=qs[_0xea48('0x18')](_0x9980b3[_0xea48('0x2d')]['limit']);_0x38710c[_0xea48('0x19')]=qs[_0xea48('0x19')](_0x9980b3[_0xea48('0x2d')]['offset']);}return _0x3f74da[_0xea48('0x54')](_0x38710c);}})[_0xea48('0x21')](function(_0x26d824){if(_0x26d824){return _0x26d824?{'count':_0x4fa626,'rows':_0x26d824}:null;}})[_0xea48('0x21')](respondWithResult(_0xdbfe38,null))[_0xea48('0x44')](handleError(_0xdbfe38,null));};exports[_0xea48('0x56')]=function(_0x51ba5a,_0x197e36,_0x52eb00){if(_0x51ba5a[_0xea48('0x4e')]['id']){delete _0x51ba5a['body']['id'];}return db[_0xea48('0x3c')]['find']({'where':{'id':_0x51ba5a[_0xea48('0x41')]['id']}})[_0xea48('0x21')](handleEntityNotFound(_0x197e36,null))['then'](function(_0x22e172){if(_0x22e172){_0x51ba5a[_0xea48('0x4e')]['TriggerId']=_0x22e172['id'];return db[_0xea48('0x57')][_0xea48('0x45')](_0x51ba5a[_0xea48('0x4e')]);}})['then'](respondWithResult(_0x197e36,null))[_0xea48('0x44')](handleError(_0x197e36,null));};exports[_0xea48('0x58')]=function(_0x2ea7f5,_0x3b638d,_0x122d6e){var _0x1116b5={};var _0x4584e8={};var _0x3a8fda;var _0x37b429;return db['Trigger'][_0xea48('0x59')]({'where':{'id':_0x2ea7f5[_0xea48('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b638d,null))[_0xea48('0x21')](function(_0x536075){if(_0x536075){_0x3a8fda=_0x536075;_0x4584e8[_0xea48('0x2c')]=_['keys'](db['Action']['rawAttributes']);_0x4584e8[_0xea48('0x2d')]=_[_0xea48('0x2e')](_0x2ea7f5[_0xea48('0x2d')]);_0x4584e8[_0xea48('0x2f')]=_['intersection'](_0x4584e8[_0xea48('0x2c')],_0x4584e8[_0xea48('0x2d')]);_0x1116b5['attributes']=_['intersection'](_0x4584e8[_0xea48('0x2c')],qs[_0xea48('0x31')](_0x2ea7f5[_0xea48('0x2d')][_0xea48('0x31')]));_0x1116b5[_0xea48('0x32')]=_0x1116b5[_0xea48('0x32')][_0xea48('0x42')]?_0x1116b5[_0xea48('0x32')]:_0x4584e8[_0xea48('0x2c')];_0x1116b5[_0xea48('0x34')]=qs[_0xea48('0x35')](_0x2ea7f5[_0xea48('0x2d')]['sort']);_0x1116b5[_0xea48('0x38')]=qs['filters'](_[_0xea48('0x36')](_0x2ea7f5['query'],_0x4584e8['filters']));if(_0x2ea7f5[_0xea48('0x2d')][_0xea48('0x3a')]){_0x1116b5['where']=_[_0xea48('0x37')](_0x1116b5[_0xea48('0x38')],{'$or':_[_0xea48('0x27')](_0x1116b5['attributes'],function(_0xffd523){var _0xe60acc={};_0xe60acc[_0xffd523]={'$like':'%'+_0x2ea7f5[_0xea48('0x2d')][_0xea48('0x3a')]+'%'};return _0xe60acc;})});}_0x1116b5=_[_0xea48('0x37')]({},_0x1116b5,_0x2ea7f5['options']);return _0x3a8fda['getActions'](_0x1116b5);}})['then'](function(_0x1a5ebf){if(_0x1a5ebf){_0x37b429=_0x1a5ebf['length'];if(!_0x2ea7f5[_0xea48('0x2d')][_0xea48('0x55')](_0xea48('0x33'))){_0x1116b5[_0xea48('0x18')]=qs[_0xea48('0x18')](_0x2ea7f5[_0xea48('0x2d')][_0xea48('0x18')]);_0x1116b5[_0xea48('0x19')]=qs[_0xea48('0x19')](_0x2ea7f5['query'][_0xea48('0x19')]);}return _0x3a8fda[_0xea48('0x58')](_0x1116b5);}})[_0xea48('0x21')](function(_0x59490b){if(_0x59490b){return _0x59490b?{'count':_0x37b429,'rows':_0x59490b}:null;}})[_0xea48('0x21')](respondWithResult(_0x3b638d,null))[_0xea48('0x44')](handleError(_0x3b638d,null));};
\ No newline at end of file
+var _0x5441=['save','update','then','destroy','get','Triggers','UserProfileResource','stack','name','index','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','map','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','nolimit','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x3c424f,_0x1c61c2){var _0x3fee82=function(_0xc78512){while(--_0xc78512){_0x3c424f['push'](_0x3c424f['shift']());}};_0x3fee82(++_0x1c61c2);}(_0x5441,0x98));var _0x1544=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5441[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x1544('0x0'));var rimraf=require(_0x1544('0x1'));var zipdir=require(_0x1544('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1544('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1544('0x4'));var util=require(_0x1544('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1544('0x6'));var ejs=require(_0x1544('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1544('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1544('0x9'));var toCsv=require(_0x1544('0x6'));var querystring=require(_0x1544('0xa'));var Papa=require(_0x1544('0xb'));var Redis=require(_0x1544('0xc'));var authService=require(_0x1544('0xd'));var qs=require(_0x1544('0xe'));var as=require(_0x1544('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1544('0x10'))(_0x1544('0x11'));var utils=require('../../config/utils');var config=require(_0x1544('0x12'));var licenseUtil=require(_0x1544('0x13'));var db=require(_0x1544('0x14'))['db'];function respondWithStatusCode(_0x3a8d77,_0x31b0a0){_0x31b0a0=_0x31b0a0||0xcc;return function(_0x1559e8){if(_0x1559e8){return _0x3a8d77[_0x1544('0x15')](_0x31b0a0);}return _0x3a8d77['status'](_0x31b0a0)[_0x1544('0x16')]();};}function respondWithResult(_0x51d845,_0x52b778){_0x52b778=_0x52b778||0xc8;return function(_0x5e2391){if(_0x5e2391){return _0x51d845[_0x1544('0x17')](_0x52b778)[_0x1544('0x18')](_0x5e2391);}};}function respondWithFilteredResult(_0x54a599,_0x49787f){return function(_0x4834e6){if(_0x4834e6){var _0x4041c9=typeof _0x49787f[_0x1544('0x19')]===_0x1544('0x1a')&&typeof _0x49787f[_0x1544('0x1b')]===_0x1544('0x1a');var _0x19e366=_0x4834e6[_0x1544('0x1c')];var _0xaff8d8=_0x4041c9?0x0:_0x49787f[_0x1544('0x19')];var _0x16e7da=_0x4041c9?_0x4834e6[_0x1544('0x1c')]:_0x49787f[_0x1544('0x19')]+_0x49787f[_0x1544('0x1b')];var _0x15dc0c;if(_0x16e7da>=_0x19e366){_0x16e7da=_0x19e366;_0x15dc0c=0xc8;}else{_0x15dc0c=0xce;}_0x54a599[_0x1544('0x17')](_0x15dc0c);return _0x54a599['set'](_0x1544('0x1d'),_0xaff8d8+'-'+_0x16e7da+'/'+_0x19e366)[_0x1544('0x18')](_0x4834e6);}return null;};}function patchUpdates(_0x5ba6d8){return function(_0x2ae40b){try{jsonpatch[_0x1544('0x1e')](_0x2ae40b,_0x5ba6d8,!![]);}catch(_0x46fc5c){return BPromise[_0x1544('0x1f')](_0x46fc5c);}return _0x2ae40b[_0x1544('0x20')]();};}function saveUpdates(_0x1f67e4,_0x345f69){return function(_0x40d213){if(_0x40d213){return _0x40d213[_0x1544('0x21')](_0x1f67e4)[_0x1544('0x22')](function(_0x5e88b4){return _0x5e88b4;});}return null;};}function removeEntity(_0x4317c8,_0x3b16c0){return function(_0x3f77a8){if(_0x3f77a8){return _0x3f77a8[_0x1544('0x23')]()[_0x1544('0x22')](function(){var _0x339d04=_0x3f77a8[_0x1544('0x24')]({'plain':!![]});var _0x186145=_0x1544('0x25');return db[_0x1544('0x26')]['destroy']({'where':{'type':_0x186145,'resourceId':_0x339d04['id']}})[_0x1544('0x22')](function(){return _0x3f77a8;});})[_0x1544('0x22')](function(){_0x4317c8[_0x1544('0x17')](0xcc)[_0x1544('0x16')]();});}};}function handleEntityNotFound(_0x433abd,_0x3d4884){return function(_0x42116a){if(!_0x42116a){_0x433abd[_0x1544('0x15')](0x194);}return _0x42116a;};}function handleError(_0x5d3603,_0x15c6cb){_0x15c6cb=_0x15c6cb||0x1f4;return function(_0x52529d){logger['error'](_0x52529d[_0x1544('0x27')]);if(_0x52529d[_0x1544('0x28')]){delete _0x52529d[_0x1544('0x28')];}_0x5d3603[_0x1544('0x17')](_0x15c6cb)['send'](_0x52529d);};}exports[_0x1544('0x29')]=function(_0x427b12,_0x4362ae){var _0x3c00eb={},_0x4eeb16={},_0x5afad7={'count':0x0,'rows':[]};var _0x12d1be=_['map'](db[_0x1544('0x2a')][_0x1544('0x2b')],function(_0x3a9902){return{'name':_0x3a9902[_0x1544('0x2c')],'type':_0x3a9902[_0x1544('0x2d')][_0x1544('0x2e')]};});_0x4eeb16[_0x1544('0x2f')]=_['map'](_0x12d1be,'name');_0x4eeb16[_0x1544('0x30')]=_[_0x1544('0x31')](_0x427b12[_0x1544('0x30')]);_0x4eeb16[_0x1544('0x32')]=_[_0x1544('0x33')](_0x4eeb16[_0x1544('0x2f')],_0x4eeb16[_0x1544('0x30')]);_0x3c00eb['attributes']=_['intersection'](_0x4eeb16['model'],qs[_0x1544('0x34')](_0x427b12['query'][_0x1544('0x34')]));_0x3c00eb[_0x1544('0x35')]=_0x3c00eb['attributes'][_0x1544('0x36')]?_0x3c00eb[_0x1544('0x35')]:_0x4eeb16[_0x1544('0x2f')];if(!_0x427b12[_0x1544('0x30')][_0x1544('0x37')]('nolimit')){_0x3c00eb[_0x1544('0x1b')]=qs[_0x1544('0x1b')](_0x427b12[_0x1544('0x30')][_0x1544('0x1b')]);_0x3c00eb[_0x1544('0x19')]=qs[_0x1544('0x19')](_0x427b12[_0x1544('0x30')]['offset']);}_0x3c00eb[_0x1544('0x38')]=qs['sort'](_0x427b12['query'][_0x1544('0x39')]);_0x3c00eb['where']=qs['filters'](_[_0x1544('0x3a')](_0x427b12['query'],_0x4eeb16['filters']),_0x12d1be);if(_0x427b12[_0x1544('0x30')]['filter']){_0x3c00eb['where']=_[_0x1544('0x3b')](_0x3c00eb[_0x1544('0x3c')],{'$or':_[_0x1544('0x3d')](_0x12d1be,function(_0x2d9f23){if(_0x2d9f23[_0x1544('0x2d')]!==_0x1544('0x3e')){var _0x7308a4={};_0x7308a4[_0x2d9f23[_0x1544('0x28')]]={'$like':'%'+_0x427b12[_0x1544('0x30')][_0x1544('0x3f')]+'%'};return _0x7308a4;}})});}_0x3c00eb=_['merge']({},_0x3c00eb,_0x427b12[_0x1544('0x40')]);var _0x7083e8={'where':_0x3c00eb[_0x1544('0x3c')]};return db[_0x1544('0x2a')][_0x1544('0x1c')](_0x7083e8)['then'](function(_0x28c224){_0x5afad7[_0x1544('0x1c')]=_0x28c224;if(_0x427b12['query'][_0x1544('0x41')]){_0x3c00eb['include']=[{'all':!![]}];}return db[_0x1544('0x2a')][_0x1544('0x42')](_0x3c00eb);})[_0x1544('0x22')](function(_0x86ca71){_0x5afad7['rows']=_0x86ca71;return _0x5afad7;})[_0x1544('0x22')](respondWithFilteredResult(_0x4362ae,_0x3c00eb))['catch'](handleError(_0x4362ae,null));};exports[_0x1544('0x43')]=function(_0x1f3d9a,_0x8a4af4){var _0x388559={'raw':![],'where':{'id':_0x1f3d9a[_0x1544('0x44')]['id']}},_0x3a6765={};_0x3a6765[_0x1544('0x2f')]=_[_0x1544('0x31')](db['Trigger']['rawAttributes']);_0x3a6765[_0x1544('0x30')]=_[_0x1544('0x31')](_0x1f3d9a[_0x1544('0x30')]);_0x3a6765['filters']=_[_0x1544('0x33')](_0x3a6765[_0x1544('0x2f')],_0x3a6765[_0x1544('0x30')]);_0x388559[_0x1544('0x35')]=_['intersection'](_0x3a6765[_0x1544('0x2f')],qs[_0x1544('0x34')](_0x1f3d9a[_0x1544('0x30')][_0x1544('0x34')]));_0x388559['attributes']=_0x388559['attributes'][_0x1544('0x36')]?_0x388559[_0x1544('0x35')]:_0x3a6765[_0x1544('0x2f')];if(_0x1f3d9a['query'][_0x1544('0x41')]){_0x388559[_0x1544('0x45')]=[{'all':!![]}];}_0x388559=_[_0x1544('0x3b')]({},_0x388559,_0x1f3d9a['options']);return db['Trigger'][_0x1544('0x46')](_0x388559)[_0x1544('0x22')](handleEntityNotFound(_0x8a4af4,null))[_0x1544('0x22')](respondWithResult(_0x8a4af4,null))[_0x1544('0x47')](handleError(_0x8a4af4,null));};exports['create']=function(_0x17deeb,_0x5e7cb4){return db['Trigger'][_0x1544('0x48')](_0x17deeb[_0x1544('0x49')],{})[_0x1544('0x22')](function(_0x3c9591){var _0x2772e0=_0x17deeb[_0x1544('0x4a')]['get']({'plain':!![]});if(!_0x2772e0)throw new Error(_0x1544('0x4b'));if(_0x2772e0['role']===_0x1544('0x4a')){var _0x50d7ce=_0x3c9591[_0x1544('0x24')]({'plain':!![]});var _0x4032af=_0x1544('0x25');return db[_0x1544('0x4c')][_0x1544('0x46')]({'where':{'name':_0x4032af,'userProfileId':_0x2772e0[_0x1544('0x4d')]},'raw':!![]})['then'](function(_0x7e1bd5){if(_0x7e1bd5&&_0x7e1bd5[_0x1544('0x4e')]===0x0){return db[_0x1544('0x26')][_0x1544('0x48')]({'name':_0x50d7ce[_0x1544('0x28')],'resourceId':_0x50d7ce['id'],'type':_0x7e1bd5[_0x1544('0x28')],'sectionId':_0x7e1bd5['id']},{})[_0x1544('0x22')](function(){return _0x3c9591;});}else{return _0x3c9591;}})[_0x1544('0x47')](function(_0x5b8da4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b8da4);throw _0x5b8da4;});}return _0x3c9591;})[_0x1544('0x22')](respondWithResult(_0x5e7cb4,0xc9))[_0x1544('0x47')](handleError(_0x5e7cb4,null));};exports[_0x1544('0x21')]=function(_0x1f0fa2,_0x1751ab){if(_0x1f0fa2['body']['id']){delete _0x1f0fa2[_0x1544('0x49')]['id'];}return db['Trigger'][_0x1544('0x46')]({'where':{'id':_0x1f0fa2[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x1751ab,null))['then'](saveUpdates(_0x1f0fa2[_0x1544('0x49')],null))[_0x1544('0x22')](respondWithResult(_0x1751ab,null))[_0x1544('0x47')](handleError(_0x1751ab,null));};exports[_0x1544('0x23')]=function(_0x51fdcc,_0x2cacf6){return db[_0x1544('0x2a')][_0x1544('0x46')]({'where':{'id':_0x51fdcc[_0x1544('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cacf6,null))['then'](removeEntity(_0x2cacf6,null))[_0x1544('0x47')](handleError(_0x2cacf6,null));};exports[_0x1544('0x4f')]=function(_0x3a4f49,_0x1f4040,_0x31f63c){if(_0x3a4f49[_0x1544('0x49')]['id']){delete _0x3a4f49[_0x1544('0x49')]['id'];}return db[_0x1544('0x2a')][_0x1544('0x46')]({'where':{'id':_0x3a4f49[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x1f4040,null))[_0x1544('0x22')](function(_0x45a94e){if(_0x45a94e){_0x3a4f49[_0x1544('0x49')][_0x1544('0x50')]=_0x45a94e['id'];return db[_0x1544('0x51')][_0x1544('0x48')](_0x3a4f49[_0x1544('0x49')]);}})[_0x1544('0x22')](respondWithResult(_0x1f4040,null))[_0x1544('0x47')](handleError(_0x1f4040,null));};exports[_0x1544('0x52')]=function(_0xdbd8bd,_0x32f94f,_0x5ec8d6){if(_0xdbd8bd[_0x1544('0x49')]['id']){delete _0xdbd8bd[_0x1544('0x49')]['id'];}return db[_0x1544('0x2a')][_0x1544('0x46')]({'where':{'id':_0xdbd8bd[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x32f94f,null))[_0x1544('0x22')](function(_0x14b4b8){if(_0x14b4b8){_0xdbd8bd[_0x1544('0x49')][_0x1544('0x53')]=_0x14b4b8['id'];return db[_0x1544('0x51')][_0x1544('0x48')](_0xdbd8bd[_0x1544('0x49')]);}})[_0x1544('0x22')](respondWithResult(_0x32f94f,null))[_0x1544('0x47')](handleError(_0x32f94f,null));};exports['getAllConditions']=function(_0x9ab9e9,_0x5e241b,_0x133d1a){var _0x117a42={};var _0x274928={};var _0x36b696;var _0xa0c101;return db['Trigger']['findOne']({'where':{'id':_0x9ab9e9[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x5e241b,null))[_0x1544('0x22')](function(_0x3a3a6b){if(_0x3a3a6b){_0x36b696=_0x3a3a6b;_0x274928[_0x1544('0x2f')]=_[_0x1544('0x31')](db[_0x1544('0x51')][_0x1544('0x2b')]);_0x274928['query']=_[_0x1544('0x31')](_0x9ab9e9['query']);_0x274928[_0x1544('0x32')]=_['intersection'](_0x274928[_0x1544('0x2f')],_0x274928['query']);_0x117a42[_0x1544('0x35')]=_[_0x1544('0x33')](_0x274928[_0x1544('0x2f')],qs[_0x1544('0x34')](_0x9ab9e9[_0x1544('0x30')][_0x1544('0x34')]));_0x117a42[_0x1544('0x35')]=_0x117a42[_0x1544('0x35')][_0x1544('0x36')]?_0x117a42[_0x1544('0x35')]:_0x274928['model'];_0x117a42['order']=qs[_0x1544('0x39')](_0x9ab9e9['query']['sort']);_0x117a42['where']=qs['filters'](_['pick'](_0x9ab9e9[_0x1544('0x30')],_0x274928[_0x1544('0x32')]));if(_0x9ab9e9[_0x1544('0x30')][_0x1544('0x3f')]){_0x117a42[_0x1544('0x3c')]=_[_0x1544('0x3b')](_0x117a42[_0x1544('0x3c')],{'$or':_[_0x1544('0x3d')](_0x117a42['attributes'],function(_0x1449a3){var _0x32e951={};_0x32e951[_0x1449a3]={'$like':'%'+_0x9ab9e9['query'][_0x1544('0x3f')]+'%'};return _0x32e951;})});}_0x117a42=_[_0x1544('0x3b')]({},_0x117a42,_0x9ab9e9[_0x1544('0x40')]);return _0x36b696['getAllConditions'](_0x117a42);}})[_0x1544('0x22')](function(_0x3afdba){if(_0x3afdba){_0xa0c101=_0x3afdba[_0x1544('0x36')];if(!_0x9ab9e9[_0x1544('0x30')][_0x1544('0x37')](_0x1544('0x54'))){_0x117a42['limit']=qs[_0x1544('0x1b')](_0x9ab9e9[_0x1544('0x30')]['limit']);_0x117a42[_0x1544('0x19')]=qs[_0x1544('0x19')](_0x9ab9e9['query'][_0x1544('0x19')]);}return _0x36b696[_0x1544('0x55')](_0x117a42);}})[_0x1544('0x22')](function(_0x48ae92){if(_0x48ae92){return _0x48ae92?{'count':_0xa0c101,'rows':_0x48ae92}:null;}})['then'](respondWithResult(_0x5e241b,null))['catch'](handleError(_0x5e241b,null));};exports['getAnyConditions']=function(_0x18bcf8,_0x373320,_0x7cb13){var _0x1966cb={};var _0xc136ca={};var _0x5bcfa7;var _0x33c9df;return db[_0x1544('0x2a')][_0x1544('0x56')]({'where':{'id':_0x18bcf8[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x373320,null))[_0x1544('0x22')](function(_0x2bf7c3){if(_0x2bf7c3){_0x5bcfa7=_0x2bf7c3;_0xc136ca[_0x1544('0x2f')]=_['keys'](db['Condition'][_0x1544('0x2b')]);_0xc136ca[_0x1544('0x30')]=_[_0x1544('0x31')](_0x18bcf8[_0x1544('0x30')]);_0xc136ca[_0x1544('0x32')]=_['intersection'](_0xc136ca[_0x1544('0x2f')],_0xc136ca['query']);_0x1966cb['attributes']=_['intersection'](_0xc136ca[_0x1544('0x2f')],qs['fields'](_0x18bcf8[_0x1544('0x30')][_0x1544('0x34')]));_0x1966cb['attributes']=_0x1966cb[_0x1544('0x35')][_0x1544('0x36')]?_0x1966cb[_0x1544('0x35')]:_0xc136ca[_0x1544('0x2f')];_0x1966cb['order']=qs['sort'](_0x18bcf8['query'][_0x1544('0x39')]);_0x1966cb[_0x1544('0x3c')]=qs[_0x1544('0x32')](_[_0x1544('0x3a')](_0x18bcf8[_0x1544('0x30')],_0xc136ca[_0x1544('0x32')]));if(_0x18bcf8['query'][_0x1544('0x3f')]){_0x1966cb['where']=_[_0x1544('0x3b')](_0x1966cb[_0x1544('0x3c')],{'$or':_['map'](_0x1966cb[_0x1544('0x35')],function(_0x318ab0){var _0x51160a={};_0x51160a[_0x318ab0]={'$like':'%'+_0x18bcf8['query'][_0x1544('0x3f')]+'%'};return _0x51160a;})});}_0x1966cb=_['merge']({},_0x1966cb,_0x18bcf8['options']);return _0x5bcfa7[_0x1544('0x57')](_0x1966cb);}})[_0x1544('0x22')](function(_0x49e5c6){if(_0x49e5c6){_0x33c9df=_0x49e5c6[_0x1544('0x36')];if(!_0x18bcf8['query'][_0x1544('0x37')](_0x1544('0x54'))){_0x1966cb['limit']=qs['limit'](_0x18bcf8['query'][_0x1544('0x1b')]);_0x1966cb['offset']=qs[_0x1544('0x19')](_0x18bcf8['query'][_0x1544('0x19')]);}return _0x5bcfa7[_0x1544('0x57')](_0x1966cb);}})[_0x1544('0x22')](function(_0x129b35){if(_0x129b35){return _0x129b35?{'count':_0x33c9df,'rows':_0x129b35}:null;}})[_0x1544('0x22')](respondWithResult(_0x373320,null))[_0x1544('0x47')](handleError(_0x373320,null));};exports[_0x1544('0x58')]=function(_0x4cf261,_0x3af496,_0x5a21ec){if(_0x4cf261[_0x1544('0x49')]['id']){delete _0x4cf261[_0x1544('0x49')]['id'];}return db[_0x1544('0x2a')][_0x1544('0x46')]({'where':{'id':_0x4cf261[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x3af496,null))[_0x1544('0x22')](function(_0x26be75){if(_0x26be75){_0x4cf261[_0x1544('0x49')][_0x1544('0x59')]=_0x26be75['id'];return db[_0x1544('0x5a')][_0x1544('0x48')](_0x4cf261[_0x1544('0x49')]);}})[_0x1544('0x22')](respondWithResult(_0x3af496,null))[_0x1544('0x47')](handleError(_0x3af496,null));};exports['getActions']=function(_0x1c2558,_0x1d68f8,_0x430998){var _0x283a70={};var _0x521cc9={};var _0x510417;var _0x2b6e9b;return db[_0x1544('0x2a')][_0x1544('0x56')]({'where':{'id':_0x1c2558[_0x1544('0x44')]['id']}})[_0x1544('0x22')](handleEntityNotFound(_0x1d68f8,null))[_0x1544('0x22')](function(_0x22eb5f){if(_0x22eb5f){_0x510417=_0x22eb5f;_0x521cc9['model']=_[_0x1544('0x31')](db[_0x1544('0x5a')][_0x1544('0x2b')]);_0x521cc9[_0x1544('0x30')]=_['keys'](_0x1c2558[_0x1544('0x30')]);_0x521cc9[_0x1544('0x32')]=_[_0x1544('0x33')](_0x521cc9[_0x1544('0x2f')],_0x521cc9[_0x1544('0x30')]);_0x283a70[_0x1544('0x35')]=_[_0x1544('0x33')](_0x521cc9['model'],qs[_0x1544('0x34')](_0x1c2558[_0x1544('0x30')][_0x1544('0x34')]));_0x283a70[_0x1544('0x35')]=_0x283a70[_0x1544('0x35')]['length']?_0x283a70['attributes']:_0x521cc9[_0x1544('0x2f')];_0x283a70[_0x1544('0x38')]=qs[_0x1544('0x39')](_0x1c2558[_0x1544('0x30')][_0x1544('0x39')]);_0x283a70['where']=qs['filters'](_[_0x1544('0x3a')](_0x1c2558[_0x1544('0x30')],_0x521cc9[_0x1544('0x32')]));if(_0x1c2558['query'][_0x1544('0x3f')]){_0x283a70[_0x1544('0x3c')]=_[_0x1544('0x3b')](_0x283a70[_0x1544('0x3c')],{'$or':_[_0x1544('0x3d')](_0x283a70[_0x1544('0x35')],function(_0x2a04d5){var _0x4219ab={};_0x4219ab[_0x2a04d5]={'$like':'%'+_0x1c2558[_0x1544('0x30')][_0x1544('0x3f')]+'%'};return _0x4219ab;})});}_0x283a70=_['merge']({},_0x283a70,_0x1c2558['options']);return _0x510417[_0x1544('0x5b')](_0x283a70);}})['then'](function(_0xd8a714){if(_0xd8a714){_0x2b6e9b=_0xd8a714['length'];if(!_0x1c2558['query']['hasOwnProperty']('nolimit')){_0x283a70[_0x1544('0x1b')]=qs[_0x1544('0x1b')](_0x1c2558[_0x1544('0x30')][_0x1544('0x1b')]);_0x283a70[_0x1544('0x19')]=qs[_0x1544('0x19')](_0x1c2558['query'][_0x1544('0x19')]);}return _0x510417['getActions'](_0x283a70);}})[_0x1544('0x22')](function(_0xf4f024){if(_0xf4f024){return _0xf4f024?{'count':_0x2b6e9b,'rows':_0xf4f024}:null;}})[_0x1544('0x22')](respondWithResult(_0x1d68f8,null))['catch'](handleError(_0x1d68f8,null));};
\ No newline at end of file
index 1c822cd..8db0950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af0=['moment','bluebird','request-promise','path','../../config/environment','exports','Trigger','lodash','util','../../config/logger','api'];(function(_0x41cb02,_0x3deeb0){var _0x2db9f1=function(_0x49c3a3){while(--_0x49c3a3){_0x41cb02['push'](_0x41cb02['shift']());}};_0x2db9f1(++_0x3deeb0);}(_0x5af0,0x1eb));var _0x05af=function(_0x4c6fa0,_0x15d3b7){_0x4c6fa0=_0x4c6fa0-0x0;var _0x318edc=_0x5af0[_0x4c6fa0];return _0x318edc;};'use strict';var _=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var logger=require(_0x05af('0x2'))(_0x05af('0x3'));var moment=require(_0x05af('0x4'));var BPromise=require(_0x05af('0x5'));var rp=require(_0x05af('0x6'));var fs=require('fs');var path=require(_0x05af('0x7'));var rimraf=require('rimraf');var config=require(_0x05af('0x8'));var attributes=require('./trigger.attributes');module[_0x05af('0x9')]=function(_0x27a3e2,_0x2a8ef6){return _0x27a3e2['define'](_0x05af('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae1c=['Trigger','tools_triggers','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x50bb8,_0x316977){var _0x522085=function(_0x261719){while(--_0x261719){_0x50bb8['push'](_0x50bb8['shift']());}};_0x522085(++_0x316977);}(_0xae1c,0xff));var _0xcae1=function(_0x2b81a6,_0x35b4d9){_0x2b81a6=_0x2b81a6-0x0;var _0x59296d=_0xae1c[_0x2b81a6];return _0x59296d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcae1('0x0'));var BPromise=require(_0xcae1('0x1'));var rp=require(_0xcae1('0x2'));var fs=require('fs');var path=require(_0xcae1('0x3'));var rimraf=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var attributes=require(_0xcae1('0x6'));module[_0xcae1('0x7')]=function(_0x3513e5,_0x40fcec){return _0x3513e5[_0xcae1('0x8')](_0xcae1('0x9'),attributes,{'tableName':_0xcae1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d24a60..f7f7e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x198b=['find','ShowTrigger','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','where','attributes','limit','include','map','model','GetTrigger'];(function(_0x6463cf,_0x4ed714){var _0x506555=function(_0x4d0de8){while(--_0x4d0de8){_0x6463cf['push'](_0x6463cf['shift']());}};_0x506555(++_0x4ed714);}(_0x198b,0x160));var _0xb198=function(_0x9c92dc,_0x285a42){_0x9c92dc=_0x9c92dc-0x0;var _0x41c18e=_0x198b[_0x9c92dc];return _0x41c18e;};'use strict';var _=require(_0xb198('0x0'));var util=require(_0xb198('0x1'));var moment=require(_0xb198('0x2'));var BPromise=require('bluebird');var rs=require(_0xb198('0x3'));var fs=require('fs');var Redis=require(_0xb198('0x4'));var db=require(_0xb198('0x5'))['db'];var utils=require(_0xb198('0x6'));var logger=require('../../config/logger')(_0xb198('0x7'));var config=require(_0xb198('0x8'));var jayson=require(_0xb198('0x9'));var client=jayson[_0xb198('0xa')][_0xb198('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x444f7e,_0x29fac2,_0x5c59cc){return new BPromise(function(_0x3656d0,_0x5611ca){return client[_0xb198('0xc')](_0x444f7e,_0x5c59cc)[_0xb198('0xd')](function(_0x521ee5){logger[_0xb198('0xe')]('Trigger,\x20%s,\x20%s',_0x29fac2,_0xb198('0xf'));logger[_0xb198('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x29fac2,'request\x20sent',JSON[_0xb198('0x11')](_0x521ee5));if(_0x521ee5['error']){if(_0x521ee5[_0xb198('0x12')]['code']===0x1f4){logger[_0xb198('0x12')](_0xb198('0x13'),_0x29fac2,_0x521ee5['error']['message']);return _0x5611ca(_0x521ee5[_0xb198('0x12')][_0xb198('0x14')]);}logger[_0xb198('0x12')]('Trigger,\x20%s,\x20%s',_0x29fac2,_0x521ee5[_0xb198('0x12')][_0xb198('0x14')]);return _0x3656d0(_0x521ee5[_0xb198('0x12')][_0xb198('0x14')]);}else{logger[_0xb198('0xe')](_0xb198('0x13'),_0x29fac2,_0xb198('0xf'));_0x3656d0(_0x521ee5[_0xb198('0x15')][_0xb198('0x14')]);}})[_0xb198('0x16')](function(_0x1e4d3c){logger[_0xb198('0x12')]('Trigger,\x20%s,\x20%s',_0x29fac2,_0x1e4d3c);_0x5611ca(_0x1e4d3c);});});}exports['GetTrigger']=function(_0x517e69){var _0x56b5a1=this;return new Promise(function(_0x44b559,_0x486321){return db[_0xb198('0x17')][_0xb198('0x18')]({'raw':_0x517e69[_0xb198('0x19')]?_0x517e69['options']['raw']===undefined?!![]:![]:!![],'where':_0x517e69['options']?_0x517e69[_0xb198('0x19')][_0xb198('0x1a')]||null:null,'attributes':_0x517e69[_0xb198('0x19')]?_0x517e69[_0xb198('0x19')][_0xb198('0x1b')]||null:null,'limit':_0x517e69['options']?_0x517e69['options'][_0xb198('0x1c')]||null:null,'include':_0x517e69['options']?_0x517e69['options'][_0xb198('0x1d')]?_[_0xb198('0x1e')](_0x517e69['options'][_0xb198('0x1d')],function(_0x6476fc){return{'model':db[_0x6476fc[_0xb198('0x1f')]],'as':_0x6476fc['as'],'attributes':_0x6476fc[_0xb198('0x1b')],'include':_0x6476fc[_0xb198('0x1d')]?_['map'](_0x6476fc[_0xb198('0x1d')],function(_0x4307b6){return{'model':db[_0x4307b6['model']],'as':_0x4307b6['as'],'attributes':_0x4307b6[_0xb198('0x1b')],'include':_0x4307b6[_0xb198('0x1d')]?_[_0xb198('0x1e')](_0x4307b6[_0xb198('0x1d')],function(_0x1e1118){return{'model':db[_0x1e1118[_0xb198('0x1f')]],'as':_0x1e1118['as'],'attributes':_0x1e1118[_0xb198('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb198('0xd')](function(_0x4ce459){logger[_0xb198('0xe')](_0xb198('0x20'),_0x517e69);logger[_0xb198('0x10')](_0xb198('0x20'),_0x517e69,JSON[_0xb198('0x11')](_0x4ce459));_0x44b559(_0x4ce459);})[_0xb198('0x16')](function(_0x1f8ebe){logger['error'](_0xb198('0x20'),_0x1f8ebe['message'],_0x517e69);_0x486321(_0x56b5a1[_0xb198('0x12')](0x1f4,_0x1f8ebe['message']));});});};exports['ShowTrigger']=function(_0x22697c){var _0xdd5043=this;return new Promise(function(_0x1fc69f,_0x46b68f){return db[_0xb198('0x17')][_0xb198('0x21')]({'raw':_0x22697c[_0xb198('0x19')]?_0x22697c[_0xb198('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x22697c[_0xb198('0x19')]?_0x22697c['options'][_0xb198('0x1a')]||null:null,'attributes':_0x22697c[_0xb198('0x19')]?_0x22697c[_0xb198('0x19')][_0xb198('0x1b')]||null:null,'include':_0x22697c[_0xb198('0x19')]?_0x22697c[_0xb198('0x19')]['include']?_[_0xb198('0x1e')](_0x22697c['options'][_0xb198('0x1d')],function(_0x5bd52b){return{'model':db[_0x5bd52b[_0xb198('0x1f')]],'as':_0x5bd52b['as'],'attributes':_0x5bd52b[_0xb198('0x1b')],'include':_0x5bd52b['include']?_['map'](_0x5bd52b[_0xb198('0x1d')],function(_0x56c9ca){return{'model':db[_0x56c9ca[_0xb198('0x1f')]],'as':_0x56c9ca['as'],'attributes':_0x56c9ca[_0xb198('0x1b')],'include':_0x56c9ca[_0xb198('0x1d')]?_[_0xb198('0x1e')](_0x56c9ca[_0xb198('0x1d')],function(_0xc88551){return{'model':db[_0xc88551[_0xb198('0x1f')]],'as':_0xc88551['as'],'attributes':_0xc88551[_0xb198('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb198('0xd')](function(_0x22dc31){logger['info'](_0xb198('0x22'),_0x22697c);logger[_0xb198('0x10')]('ShowTrigger',_0x22697c,JSON[_0xb198('0x11')](_0x22dc31));_0x1fc69f(_0x22dc31);})['catch'](function(_0x5ec3de){logger[_0xb198('0x12')](_0xb198('0x22'),_0x5ec3de['message'],_0x22697c);_0x46b68f(_0xdd5043[_0xb198('0x12')](0x1f4,_0x5ec3de[_0xb198('0x14')]));});});};
\ No newline at end of file
+var _0x86a7=['code','message','Trigger,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','map','include','model','GetTrigger','Trigger','find','ShowTrigger','util','bluebird','../../config/utils','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x458cc9,_0x339c9c){var _0x2ed851=function(_0x512b47){while(--_0x512b47){_0x458cc9['push'](_0x458cc9['shift']());}};_0x2ed851(++_0x339c9c);}(_0x86a7,0xe3));var _0x786a=function(_0x246ea5,_0x42e57e){_0x246ea5=_0x246ea5-0x0;var _0x16a218=_0x86a7[_0x246ea5];return _0x16a218;};'use strict';var _=require('lodash');var util=require(_0x786a('0x0'));var moment=require('moment');var BPromise=require(_0x786a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x786a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x786a('0x3'));var jayson=require(_0x786a('0x4'));var client=jayson[_0x786a('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44b52f,_0x587ba8,_0x175a1d){return new BPromise(function(_0x138377,_0x409920){return client['request'](_0x44b52f,_0x175a1d)[_0x786a('0x6')](function(_0x501130){logger[_0x786a('0x7')]('Trigger,\x20%s,\x20%s',_0x587ba8,_0x786a('0x8'));logger[_0x786a('0x9')](_0x786a('0xa'),_0x587ba8,'request\x20sent',JSON[_0x786a('0xb')](_0x501130));if(_0x501130[_0x786a('0xc')]){if(_0x501130[_0x786a('0xc')][_0x786a('0xd')]===0x1f4){logger[_0x786a('0xc')]('Trigger,\x20%s,\x20%s',_0x587ba8,_0x501130[_0x786a('0xc')]['message']);return _0x409920(_0x501130[_0x786a('0xc')][_0x786a('0xe')]);}logger[_0x786a('0xc')]('Trigger,\x20%s,\x20%s',_0x587ba8,_0x501130[_0x786a('0xc')][_0x786a('0xe')]);return _0x138377(_0x501130[_0x786a('0xc')][_0x786a('0xe')]);}else{logger[_0x786a('0x7')](_0x786a('0xf'),_0x587ba8,_0x786a('0x8'));_0x138377(_0x501130[_0x786a('0x10')]['message']);}})[_0x786a('0x11')](function(_0x2f6bbe){logger[_0x786a('0xc')](_0x786a('0xf'),_0x587ba8,_0x2f6bbe);_0x409920(_0x2f6bbe);});});}exports['GetTrigger']=function(_0x5d8809){var _0x149117=this;return new Promise(function(_0x145eac,_0x46142e){return db['Trigger'][_0x786a('0x12')]({'raw':_0x5d8809[_0x786a('0x13')]?_0x5d8809['options'][_0x786a('0x14')]===undefined?!![]:![]:!![],'where':_0x5d8809['options']?_0x5d8809['options'][_0x786a('0x15')]||null:null,'attributes':_0x5d8809[_0x786a('0x13')]?_0x5d8809[_0x786a('0x13')][_0x786a('0x16')]||null:null,'limit':_0x5d8809[_0x786a('0x13')]?_0x5d8809[_0x786a('0x13')]['limit']||null:null,'include':_0x5d8809['options']?_0x5d8809[_0x786a('0x13')]['include']?_[_0x786a('0x17')](_0x5d8809[_0x786a('0x13')][_0x786a('0x18')],function(_0x1ae55d){return{'model':db[_0x1ae55d[_0x786a('0x19')]],'as':_0x1ae55d['as'],'attributes':_0x1ae55d[_0x786a('0x16')],'include':_0x1ae55d[_0x786a('0x18')]?_[_0x786a('0x17')](_0x1ae55d[_0x786a('0x18')],function(_0x43eab1){return{'model':db[_0x43eab1['model']],'as':_0x43eab1['as'],'attributes':_0x43eab1['attributes'],'include':_0x43eab1[_0x786a('0x18')]?_['map'](_0x43eab1[_0x786a('0x18')],function(_0x4f61dc){return{'model':db[_0x4f61dc[_0x786a('0x19')]],'as':_0x4f61dc['as'],'attributes':_0x4f61dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x786a('0x6')](function(_0xb8d23d){logger[_0x786a('0x7')](_0x786a('0x1a'),_0x5d8809);logger[_0x786a('0x9')](_0x786a('0x1a'),_0x5d8809,JSON['stringify'](_0xb8d23d));_0x145eac(_0xb8d23d);})[_0x786a('0x11')](function(_0x4ee5a8){logger[_0x786a('0xc')]('GetTrigger',_0x4ee5a8['message'],_0x5d8809);_0x46142e(_0x149117['error'](0x1f4,_0x4ee5a8['message']));});});};exports['ShowTrigger']=function(_0x4d6098){var _0x51f8de=this;return new Promise(function(_0x349bb7,_0x518380){return db[_0x786a('0x1b')][_0x786a('0x1c')]({'raw':_0x4d6098[_0x786a('0x13')]?_0x4d6098['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d6098[_0x786a('0x13')]?_0x4d6098[_0x786a('0x13')][_0x786a('0x15')]||null:null,'attributes':_0x4d6098['options']?_0x4d6098[_0x786a('0x13')]['attributes']||null:null,'include':_0x4d6098[_0x786a('0x13')]?_0x4d6098[_0x786a('0x13')][_0x786a('0x18')]?_[_0x786a('0x17')](_0x4d6098[_0x786a('0x13')][_0x786a('0x18')],function(_0x3e62a7){return{'model':db[_0x3e62a7[_0x786a('0x19')]],'as':_0x3e62a7['as'],'attributes':_0x3e62a7['attributes'],'include':_0x3e62a7[_0x786a('0x18')]?_['map'](_0x3e62a7[_0x786a('0x18')],function(_0x2024d8){return{'model':db[_0x2024d8['model']],'as':_0x2024d8['as'],'attributes':_0x2024d8[_0x786a('0x16')],'include':_0x2024d8[_0x786a('0x18')]?_[_0x786a('0x17')](_0x2024d8[_0x786a('0x18')],function(_0x4d06b3){return{'model':db[_0x4d06b3[_0x786a('0x19')]],'as':_0x4d06b3['as'],'attributes':_0x4d06b3[_0x786a('0x16')]};}):[]};}):[]};}):[]:[]})[_0x786a('0x6')](function(_0x291f0b){logger['info']('ShowTrigger',_0x4d6098);logger[_0x786a('0x9')](_0x786a('0x1d'),_0x4d6098,JSON['stringify'](_0x291f0b));_0x349bb7(_0x291f0b);})[_0x786a('0x11')](function(_0x191ccd){logger['error'](_0x786a('0x1d'),_0x191ccd[_0x786a('0xe')],_0x4d6098);_0x518380(_0x51f8de[_0x786a('0xc')](0x1f4,_0x191ccd['message']));});});};
\ No newline at end of file
index 5c90857..679af07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a8=['index','/:id','show','post','/:id/clone','clone','create','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x282c32,_0x527bc8){var _0x536d06=function(_0x1281a3){while(--_0x1281a3){_0x282c32['push'](_0x282c32['shift']());}};_0x536d06(++_0x527bc8);}(_0xb8a8,0x109));var _0x8b8a=function(_0x5b7083,_0x37db47){_0x5b7083=_0x5b7083-0x0;var _0x359b8c=_0xb8a8[_0x5b7083];return _0x359b8c;};'use strict';var multer=require('multer');var util=require(_0x8b8a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b8a('0x1')]();var fs_extra=require(_0x8b8a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8b8a('0x3'));var config=require(_0x8b8a('0x4'));var controller=require('./trunk.controller');router[_0x8b8a('0x5')]('/',auth[_0x8b8a('0x6')](),controller[_0x8b8a('0x7')]);router['get'](_0x8b8a('0x8'),auth[_0x8b8a('0x6')](),controller[_0x8b8a('0x9')]);router[_0x8b8a('0xa')](_0x8b8a('0xb'),auth[_0x8b8a('0x6')](),controller[_0x8b8a('0xc')]);router[_0x8b8a('0xa')]('/',auth['isAuthenticated'](),controller[_0x8b8a('0xd')]);router['put'](_0x8b8a('0x8'),auth[_0x8b8a('0x6')](),controller['update']);router[_0x8b8a('0xe')]('/:id',auth[_0x8b8a('0x6')](),controller[_0x8b8a('0xf')]);module[_0x8b8a('0x10')]=router;
\ No newline at end of file
+var _0x07a9=['/:id','isAuthenticated','show','post','/:id/clone','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x07a9,0x16f));var _0x907a=function(_0x4c5119,_0x3dd533){_0x4c5119=_0x4c5119-0x0;var _0x3e3e85=_0x07a9[_0x4c5119];return _0x3e3e85;};'use strict';var multer=require(_0x907a('0x0'));var util=require(_0x907a('0x1'));var path=require(_0x907a('0x2'));var timeout=require('connect-timeout');var express=require(_0x907a('0x3'));var router=express[_0x907a('0x4')]();var fs_extra=require(_0x907a('0x5'));var auth=require(_0x907a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x907a('0x7'));var controller=require(_0x907a('0x8'));router[_0x907a('0x9')]('/',auth['isAuthenticated'](),controller[_0x907a('0xa')]);router['get'](_0x907a('0xb'),auth[_0x907a('0xc')](),controller[_0x907a('0xd')]);router[_0x907a('0xe')](_0x907a('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x907a('0xe')]('/',auth[_0x907a('0xc')](),controller[_0x907a('0x10')]);router[_0x907a('0x11')](_0x907a('0xb'),auth[_0x907a('0xc')](),controller[_0x907a('0x12')]);router[_0x907a('0x13')](_0x907a('0xb'),auth[_0x907a('0xc')](),controller[_0x907a('0x14')]);module['exports']=router;
\ No newline at end of file
index a77485a..df4eee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05bb=['ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','split','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','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]','INTEGER','always','accept','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x35e017,_0x2d38c8){var _0x535c49=function(_0x2e9b2e){while(--_0x2e9b2e){_0x35e017['push'](_0x35e017['shift']());}};_0x535c49(++_0x2d38c8);}(_0x05bb,0x156));var _0xb05b=function(_0x2198c9,_0x2aeaa2){_0x2198c9=_0x2198c9-0x0;var _0x3eae45=_0x05bb[_0x2198c9];return _0x3eae45;};'use strict';var Sequelize=require(_0xb05b('0x0'));module[_0xb05b('0x1')]={'name':{'type':Sequelize[_0xb05b('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xb05b('0x3'),_0xb05b('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb05b('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xb05b('0x6'),_0xb05b('0x7'),_0xb05b('0x8'),_0xb05b('0x9'),_0xb05b('0xa'),_0xb05b('0xb'),_0xb05b('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xb05b('0x2')]},'permit':{'type':Sequelize[_0xb05b('0x2')]},'secret':{'type':Sequelize[_0xb05b('0x2')]},'md5secret':{'type':Sequelize[_0xb05b('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':'udp','set':function(_0x2b7966){this[_0xb05b('0xd')](_0xb05b('0xe'),_0x2b7966?_0x2b7966[_0xb05b('0xf')](','):null);},'get':function(){return this[_0xb05b('0x10')]('transport')?this[_0xb05b('0x10')]('transport')[_0xb05b('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x13'),_0xb05b('0x14'),_0xb05b('0x15'),_0xb05b('0x16'),_0xb05b('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no',_0xb05b('0x19'),_0xb05b('0x1a'),_0xb05b('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb05b('0x12')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb05b('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x11b11b){this[_0xb05b('0xd')](_0xb05b('0x1c'),_0x11b11b?_0x11b11b['join'](','):null);},'get':function(){return this[_0xb05b('0x10')]('nat')?this['getDataValue'](_0xb05b('0x1c'))[_0xb05b('0x11')](','):null;},'comment':_0xb05b('0x1d')},'callgroup':{'type':Sequelize[_0xb05b('0x2')]},'namedcallgroup':{'type':Sequelize[_0xb05b('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb05b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':_0xb05b('0x1e')},'allow':{'type':Sequelize[_0xb05b('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x41fcc4){this['setDataValue']('allow',_0x41fcc4?_0x41fcc4['join'](';'):_0xb05b('0x1f'));},'get':function(){return this[_0xb05b('0x10')](_0xb05b('0x20'))?this['getDataValue']('allow')[_0xb05b('0x11')](';'):null;},'comment':_0xb05b('0x21')},'autoframing':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xb05b('0x22'),'set':function(_0xd9b6e3){this[_0xb05b('0xd')](_0xb05b('0x23'),_0xd9b6e3?_0xd9b6e3['join'](','):null);},'get':function(){return this[_0xb05b('0x10')](_0xb05b('0x23'))?this[_0xb05b('0x10')]('insecure')[_0xb05b('0x11')](','):null;},'comment':_0xb05b('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb05b('0x12')]('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no')},'accountcode':{'type':Sequelize[_0xb05b('0x25')](0xb)},'setvar':{'type':Sequelize[_0xb05b('0x2')]},'callerid':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xb05b('0x2')]},'callcounter':{'type':Sequelize[_0xb05b('0x12')]('yes','no'),'defaultValue':_0xb05b('0x18')},'busylevel':{'type':Sequelize[_0xb05b('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xb05b('0x12')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xb05b('0x12')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xb05b('0x2')]},'template':{'type':Sequelize[_0xb05b('0x2')]},'videosupport':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no',_0xb05b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no')},'mailbox':{'type':Sequelize[_0xb05b('0x2')]},'session_timers':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb05b('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xb05b('0x28'),_0xb05b('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xb05b('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xb05b('0x2')]},'fromuser':{'type':Sequelize[_0xb05b('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xb05b('0x12')]('yes','no'),'defaultValue':_0xb05b('0x18')},'keepalive':{'type':Sequelize[_0xb05b('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xb05b('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb05b('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb05b('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no',_0xb05b('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb05b('0x2')]},'callbackextension':{'type':Sequelize[_0xb05b('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xb05b('0x2')]},'contactdeny':{'type':Sequelize[_0xb05b('0x2')]},'contactacl':{'type':Sequelize[_0xb05b('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xb05b('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no')},'force_avp':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no')},'icesupport':{'type':Sequelize[_0xb05b('0x12')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no',_0xb05b('0x2b'),_0xb05b('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xb05b('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xb05b('0x2')]},'dtlscipher':{'type':Sequelize[_0xb05b('0x2')]},'dtlscafile':{'type':Sequelize[_0xb05b('0x2')]},'dtlscapath':{'type':Sequelize[_0xb05b('0x2')]},'dtlssetup':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x2d'),'passive',_0xb05b('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb05b('0x2')]},'usereqphone':{'type':Sequelize[_0xb05b('0x12')](_0xb05b('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xb05b('0x2')]},'call_limit':{'type':Sequelize[_0xb05b('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb05b('0x12')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xb05b('0x18'),'no')},'vmexten':{'type':Sequelize[_0xb05b('0x2')]},'mohinterpret':{'type':Sequelize[_0xb05b('0x2')]},'mohsuggest':{'type':Sequelize[_0xb05b('0x2')]},'parkinglot':{'type':Sequelize[_0xb05b('0x2')]},'description':{'type':Sequelize[_0xb05b('0x2')]},'host':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':_0xb05b('0x2f')},'canreinvite':{'type':Sequelize[_0xb05b('0x12')]('yes','no',_0xb05b('0x19'),_0xb05b('0x1a'),_0xb05b('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb05b('0x2')]},'otherFields':{'type':Sequelize[_0xb05b('0x2')]},'active':{'type':Sequelize[_0xb05b('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xb05b('0x2')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xe7b3=['INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','STRING','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xe7b3,0xe0));var _0x3e7b=function(_0x506a8f,_0x31a629){_0x506a8f=_0x506a8f-0x0;var _0x1031bd=_0xe7b3[_0x506a8f];return _0x1031bd;};'use strict';var Sequelize=require(_0x3e7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e7b('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x3'),_0x3e7b('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3e7b('0x5')},'callingpres':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x6'),_0x3e7b('0x7'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x3e7b('0x8'),_0x3e7b('0x9'),'PROHIB_FAILED_SCREEN',_0x3e7b('0xa'))},'deny':{'type':Sequelize[_0x3e7b('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3e7b('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x3e7b('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x3e7b('0xb'),'set':function(_0x26db3a){this[_0x3e7b('0xc')](_0x3e7b('0xd'),_0x26db3a?_0x26db3a[_0x3e7b('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x3e7b('0xd'))?this[_0x3e7b('0xf')](_0x3e7b('0xd'))['split'](','):null;},'comment':_0x3e7b('0x10')},'dtmfmode':{'type':Sequelize[_0x3e7b('0x2')]('rfc2833',_0x3e7b('0x11'),_0x3e7b('0x12'),_0x3e7b('0x13'),_0x3e7b('0x14')),'defaultValue':_0x3e7b('0x15')},'directmedia':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no','nonat',_0x3e7b('0x17'),_0x3e7b('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3e7b('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3e7b('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3e7b('0x19'),'set':function(_0x15c16a){this[_0x3e7b('0xc')](_0x3e7b('0x1a'),_0x15c16a?_0x15c16a[_0x3e7b('0xe')](','):null);},'get':function(){return this[_0x3e7b('0xf')]('nat')?this[_0x3e7b('0xf')](_0x3e7b('0x1a'))[_0x3e7b('0x1b')](','):null;},'comment':_0x3e7b('0x1c')},'callgroup':{'type':Sequelize[_0x3e7b('0x1')]},'namedcallgroup':{'type':Sequelize[_0x3e7b('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3e7b('0x1')]},'language':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3e7b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':_0x3e7b('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3e7b('0x1e'),'set':function(_0x35d38e){this[_0x3e7b('0xc')](_0x3e7b('0x1f'),_0x35d38e?_0x35d38e['join'](';'):_0x3e7b('0x1e'));},'get':function(){return this[_0x3e7b('0xf')](_0x3e7b('0x1f'))?this[_0x3e7b('0xf')](_0x3e7b('0x1f'))[_0x3e7b('0x1b')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'insecure':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':_0x3e7b('0x20'),'set':function(_0x9a0945){this['setDataValue']('insecure',_0x9a0945?_0x9a0945[_0x3e7b('0xe')](','):null);},'get':function(){return this[_0x3e7b('0xf')]('insecure')?this[_0x3e7b('0xf')](_0x3e7b('0x21'))[_0x3e7b('0x1b')](','):null;},'comment':_0x3e7b('0x22')},'trustrpid':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3e7b('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no',_0x3e7b('0x23'))},'promiscredir':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'accountcode':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'setvar':{'type':Sequelize[_0x3e7b('0x1')]},'callerid':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':_0x3e7b('0x25')},'amaflags':{'type':Sequelize[_0x3e7b('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0x3e7b('0x16'),'no'),'defaultValue':_0x3e7b('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x3e7b('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3e7b('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x3e7b('0x1')]},'videosupport':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no',_0x3e7b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'mailbox':{'type':Sequelize[_0x3e7b('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x3e7b('0x27'),_0x3e7b('0x28'),_0x3e7b('0x29'))},'session_expires':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x2a'),_0x3e7b('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x3e7b('0x1')]},'regexten':{'type':Sequelize[_0x3e7b('0x1')]},'fromdomain':{'type':Sequelize[_0x3e7b('0x1')]},'fromuser':{'type':Sequelize[_0x3e7b('0x1')]},'port':{'type':Sequelize[_0x3e7b('0x24')](0x5)},'qualify':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no'),'defaultValue':_0x3e7b('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3e7b('0x1')]},'defaultuser':{'type':Sequelize[_0x3e7b('0x1')]},'rtptimeout':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no',_0x3e7b('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3e7b('0x1')]},'callbackextension':{'type':Sequelize[_0x3e7b('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x3e7b('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x3e7b('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x3e7b('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3e7b('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3e7b('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'icesupport':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x3e7b('0x2')](_0x3e7b('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x3e7b('0x16'),'no',_0x3e7b('0x2d'),_0x3e7b('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3e7b('0x1')]},'dtlscafile':{'type':Sequelize[_0x3e7b('0x1')]},'dtlscapath':{'type':Sequelize[_0x3e7b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3e7b('0x2f'),_0x3e7b('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3e7b('0x1')]},'usereqphone':{'type':Sequelize[_0x3e7b('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3e7b('0x1')]},'recordofffeature':{'type':Sequelize[_0x3e7b('0x1')]},'call_limit':{'type':Sequelize[_0x3e7b('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3e7b('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x3e7b('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0x3e7b('0x1')]},'mohinterpret':{'type':Sequelize[_0x3e7b('0x1')]},'mohsuggest':{'type':Sequelize[_0x3e7b('0x1')]},'parkinglot':{'type':Sequelize[_0x3e7b('0x1')]},'description':{'type':Sequelize[_0x3e7b('0x1')]},'host':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':_0x3e7b('0x31')},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0x3e7b('0x17'),_0x3e7b('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3e7b('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3e7b('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3e7b('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index 7274910..afbbc97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x267618,_0x2761f6){var _0x50c8cd=function(_0x132194){while(--_0x132194){_0x267618['push'](_0x267618['shift']());}};_0x50c8cd(++_0x2761f6);}(_0xe14d,0x1ee));var _0xde14=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe14d[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));};
\ No newline at end of file
+var _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0xc25389,_0x4d62c4){var _0x4c5850=function(_0x1c4792){while(--_0x1c4792){_0xc25389['push'](_0xc25389['shift']());}};_0x4c5850(++_0x4d62c4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1e0dbc,_0x56e02e){_0x1e0dbc=_0x1e0dbc-0x0;var _0x494413=_0x9bde[_0x1e0dbc];return _0x494413;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));};
\ No newline at end of file
index a6072ce..0f38ff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d44=['Trunk','lodash','util','api','request-promise','path','rimraf','define'];(function(_0x5af8e6,_0x383c08){var _0x3cf053=function(_0x339946){while(--_0x339946){_0x5af8e6['push'](_0x5af8e6['shift']());}};_0x3cf053(++_0x383c08);}(_0x8d44,0x1a9));var _0x48d4=function(_0x51a089,_0xb177){_0x51a089=_0x51a089-0x0;var _0x4f6fc2=_0x8d44[_0x51a089];return _0x4f6fc2;};'use strict';var _=require(_0x48d4('0x0'));var util=require(_0x48d4('0x1'));var logger=require('../../config/logger')(_0x48d4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48d4('0x3'));var fs=require('fs');var path=require(_0x48d4('0x4'));var rimraf=require(_0x48d4('0x5'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module['exports']=function(_0x4adee0,_0x3ef3ce){return _0x4adee0[_0x48d4('0x6')](_0x48d4('0x7'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa314=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x337c39,_0x249dfe){var _0x13366f=function(_0x29d99e){while(--_0x29d99e){_0x337c39['push'](_0x337c39['shift']());}};_0x13366f(++_0x249dfe);}(_0xa314,0x125));var _0x4a31=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xa314[_0x7b484];return _0x2ae1cf;};'use strict';var _=require(_0x4a31('0x0'));var util=require(_0x4a31('0x1'));var logger=require(_0x4a31('0x2'))(_0x4a31('0x3'));var moment=require(_0x4a31('0x4'));var BPromise=require(_0x4a31('0x5'));var rp=require(_0x4a31('0x6'));var fs=require('fs');var path=require(_0x4a31('0x7'));var rimraf=require(_0x4a31('0x8'));var config=require(_0x4a31('0x9'));var attributes=require(_0x4a31('0xa'));module['exports']=function(_0x62f29,_0x2eecbf){return _0x62f29[_0x4a31('0xb')](_0x4a31('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b303f1d..99a376a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71b9=['model','ShowTrunk','find','raw','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetTrunk','Trunk','options','where','attributes','limit','include','map'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x71b9,0x19d));var _0x971b=function(_0x3e9592,_0x26f9ae){_0x3e9592=_0x3e9592-0x0;var _0x13298c=_0x71b9[_0x3e9592];return _0x13298c;};'use strict';var _=require(_0x971b('0x0'));var util=require('util');var moment=require(_0x971b('0x1'));var BPromise=require('bluebird');var rs=require(_0x971b('0x2'));var fs=require('fs');var Redis=require(_0x971b('0x3'));var db=require(_0x971b('0x4'))['db'];var utils=require(_0x971b('0x5'));var logger=require(_0x971b('0x6'))(_0x971b('0x7'));var config=require('../../config/environment');var jayson=require(_0x971b('0x8'));var client=jayson[_0x971b('0x9')][_0x971b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x285ae3,_0x6086ae,_0xe35b6b){return new BPromise(function(_0x28e3,_0xf17b97){return client[_0x971b('0xb')](_0x285ae3,_0xe35b6b)['then'](function(_0xb69f48){logger[_0x971b('0xc')](_0x971b('0xd'),_0x6086ae,'request\x20sent');logger[_0x971b('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x6086ae,_0x971b('0xf'),JSON[_0x971b('0x10')](_0xb69f48));if(_0xb69f48[_0x971b('0x11')]){if(_0xb69f48[_0x971b('0x11')]['code']===0x1f4){logger['error'](_0x971b('0xd'),_0x6086ae,_0xb69f48[_0x971b('0x11')][_0x971b('0x12')]);return _0xf17b97(_0xb69f48[_0x971b('0x11')][_0x971b('0x12')]);}logger[_0x971b('0x11')]('Trunk,\x20%s,\x20%s',_0x6086ae,_0xb69f48[_0x971b('0x11')][_0x971b('0x12')]);return _0x28e3(_0xb69f48[_0x971b('0x11')][_0x971b('0x12')]);}else{logger[_0x971b('0xc')]('Trunk,\x20%s,\x20%s',_0x6086ae,_0x971b('0xf'));_0x28e3(_0xb69f48[_0x971b('0x13')][_0x971b('0x12')]);}})[_0x971b('0x14')](function(_0x253f6e){logger['error'](_0x971b('0xd'),_0x6086ae,_0x253f6e);_0xf17b97(_0x253f6e);});});}exports[_0x971b('0x15')]=function(_0x3e5ff4){var _0x454ffe=this;return new Promise(function(_0x594dd4,_0x4b9239){return db[_0x971b('0x16')]['findAll']({'raw':_0x3e5ff4[_0x971b('0x17')]?_0x3e5ff4[_0x971b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e5ff4[_0x971b('0x17')]?_0x3e5ff4['options'][_0x971b('0x18')]||null:null,'attributes':_0x3e5ff4[_0x971b('0x17')]?_0x3e5ff4[_0x971b('0x17')][_0x971b('0x19')]||null:null,'limit':_0x3e5ff4[_0x971b('0x17')]?_0x3e5ff4[_0x971b('0x17')][_0x971b('0x1a')]||null:null,'include':_0x3e5ff4['options']?_0x3e5ff4[_0x971b('0x17')][_0x971b('0x1b')]?_[_0x971b('0x1c')](_0x3e5ff4[_0x971b('0x17')][_0x971b('0x1b')],function(_0x1fce0e){return{'model':db[_0x1fce0e[_0x971b('0x1d')]],'as':_0x1fce0e['as'],'attributes':_0x1fce0e['attributes'],'include':_0x1fce0e[_0x971b('0x1b')]?_['map'](_0x1fce0e[_0x971b('0x1b')],function(_0x2295c3){return{'model':db[_0x2295c3[_0x971b('0x1d')]],'as':_0x2295c3['as'],'attributes':_0x2295c3[_0x971b('0x19')],'include':_0x2295c3['include']?_[_0x971b('0x1c')](_0x2295c3['include'],function(_0x19d46a){return{'model':db[_0x19d46a[_0x971b('0x1d')]],'as':_0x19d46a['as'],'attributes':_0x19d46a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c85dc){logger['info'](_0x971b('0x15'),_0x3e5ff4);logger[_0x971b('0xe')](_0x971b('0x15'),_0x3e5ff4,JSON[_0x971b('0x10')](_0x3c85dc));_0x594dd4(_0x3c85dc);})[_0x971b('0x14')](function(_0x3ff5d5){logger[_0x971b('0x11')](_0x971b('0x15'),_0x3ff5d5[_0x971b('0x12')],_0x3e5ff4);_0x4b9239(_0x454ffe[_0x971b('0x11')](0x1f4,_0x3ff5d5['message']));});});};exports[_0x971b('0x1e')]=function(_0x4e3619){var _0x4b1eb3=this;return new Promise(function(_0x5c1a94,_0x38d706){return db[_0x971b('0x16')][_0x971b('0x1f')]({'raw':_0x4e3619['options']?_0x4e3619[_0x971b('0x17')][_0x971b('0x20')]===undefined?!![]:![]:!![],'where':_0x4e3619[_0x971b('0x17')]?_0x4e3619[_0x971b('0x17')]['where']||null:null,'attributes':_0x4e3619[_0x971b('0x17')]?_0x4e3619[_0x971b('0x17')][_0x971b('0x19')]||null:null,'include':_0x4e3619[_0x971b('0x17')]?_0x4e3619[_0x971b('0x17')]['include']?_['map'](_0x4e3619[_0x971b('0x17')][_0x971b('0x1b')],function(_0x231bc6){return{'model':db[_0x231bc6[_0x971b('0x1d')]],'as':_0x231bc6['as'],'attributes':_0x231bc6[_0x971b('0x19')],'include':_0x231bc6[_0x971b('0x1b')]?_[_0x971b('0x1c')](_0x231bc6[_0x971b('0x1b')],function(_0x45dde9){return{'model':db[_0x45dde9[_0x971b('0x1d')]],'as':_0x45dde9['as'],'attributes':_0x45dde9['attributes'],'include':_0x45dde9[_0x971b('0x1b')]?_[_0x971b('0x1c')](_0x45dde9[_0x971b('0x1b')],function(_0x5af44a){return{'model':db[_0x5af44a[_0x971b('0x1d')]],'as':_0x5af44a['as'],'attributes':_0x5af44a['attributes']};}):[]};}):[]};}):[]:[]})[_0x971b('0x21')](function(_0x12be4e){logger[_0x971b('0xc')](_0x971b('0x1e'),_0x4e3619);logger[_0x971b('0xe')]('ShowTrunk',_0x4e3619,JSON['stringify'](_0x12be4e));_0x5c1a94(_0x12be4e);})[_0x971b('0x14')](function(_0x504aec){logger[_0x971b('0x11')]('ShowTrunk',_0x504aec[_0x971b('0x12')],_0x4e3619);_0x38d706(_0x4b1eb3['error'](0x1f4,_0x504aec['message']));});});};
\ No newline at end of file
+var _0x644c=['model','GetTrunk','ShowTrunk','find','raw','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Trunk','findAll','options','attributes','limit','include'];(function(_0x536f1c,_0x183d0e){var _0x1fd568=function(_0x1aa667){while(--_0x1aa667){_0x536f1c['push'](_0x536f1c['shift']());}};_0x1fd568(++_0x183d0e);}(_0x644c,0x75));var _0xc644=function(_0x4d0baa,_0x2b4ff8){_0x4d0baa=_0x4d0baa-0x0;var _0x224217=_0x644c[_0x4d0baa];return _0x224217;};'use strict';var _=require(_0xc644('0x0'));var util=require(_0xc644('0x1'));var moment=require(_0xc644('0x2'));var BPromise=require(_0xc644('0x3'));var rs=require(_0xc644('0x4'));var fs=require('fs');var Redis=require(_0xc644('0x5'));var db=require(_0xc644('0x6'))['db'];var utils=require(_0xc644('0x7'));var logger=require(_0xc644('0x8'))(_0xc644('0x9'));var config=require('../../config/environment');var jayson=require(_0xc644('0xa'));var client=jayson[_0xc644('0xb')][_0xc644('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cd16c,_0x56095f,_0x3fe748){return new BPromise(function(_0x2eae0b,_0x5efbda){return client['request'](_0x4cd16c,_0x3fe748)[_0xc644('0xd')](function(_0x415044){logger[_0xc644('0xe')](_0xc644('0xf'),_0x56095f,'request\x20sent');logger[_0xc644('0x10')](_0xc644('0x11'),_0x56095f,_0xc644('0x12'),JSON[_0xc644('0x13')](_0x415044));if(_0x415044[_0xc644('0x14')]){if(_0x415044[_0xc644('0x14')][_0xc644('0x15')]===0x1f4){logger[_0xc644('0x14')](_0xc644('0xf'),_0x56095f,_0x415044[_0xc644('0x14')]['message']);return _0x5efbda(_0x415044[_0xc644('0x14')][_0xc644('0x16')]);}logger['error'](_0xc644('0xf'),_0x56095f,_0x415044[_0xc644('0x14')][_0xc644('0x16')]);return _0x2eae0b(_0x415044[_0xc644('0x14')]['message']);}else{logger['info'](_0xc644('0xf'),_0x56095f,'request\x20sent');_0x2eae0b(_0x415044[_0xc644('0x17')]['message']);}})[_0xc644('0x18')](function(_0x3b890c){logger[_0xc644('0x14')](_0xc644('0xf'),_0x56095f,_0x3b890c);_0x5efbda(_0x3b890c);});});}exports['GetTrunk']=function(_0x3f3a8a){var _0x9722ea=this;return new Promise(function(_0x3e3fb1,_0x5acea5){return db[_0xc644('0x19')][_0xc644('0x1a')]({'raw':_0x3f3a8a[_0xc644('0x1b')]?_0x3f3a8a[_0xc644('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3a8a[_0xc644('0x1b')]?_0x3f3a8a['options']['where']||null:null,'attributes':_0x3f3a8a['options']?_0x3f3a8a['options'][_0xc644('0x1c')]||null:null,'limit':_0x3f3a8a[_0xc644('0x1b')]?_0x3f3a8a[_0xc644('0x1b')][_0xc644('0x1d')]||null:null,'include':_0x3f3a8a[_0xc644('0x1b')]?_0x3f3a8a['options']['include']?_['map'](_0x3f3a8a[_0xc644('0x1b')][_0xc644('0x1e')],function(_0x4deb6f){return{'model':db[_0x4deb6f['model']],'as':_0x4deb6f['as'],'attributes':_0x4deb6f['attributes'],'include':_0x4deb6f[_0xc644('0x1e')]?_['map'](_0x4deb6f['include'],function(_0x597b49){return{'model':db[_0x597b49[_0xc644('0x1f')]],'as':_0x597b49['as'],'attributes':_0x597b49[_0xc644('0x1c')],'include':_0x597b49[_0xc644('0x1e')]?_['map'](_0x597b49[_0xc644('0x1e')],function(_0x34cf17){return{'model':db[_0x34cf17['model']],'as':_0x34cf17['as'],'attributes':_0x34cf17[_0xc644('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b1fef){logger[_0xc644('0xe')](_0xc644('0x20'),_0x3f3a8a);logger[_0xc644('0x10')](_0xc644('0x20'),_0x3f3a8a,JSON[_0xc644('0x13')](_0x1b1fef));_0x3e3fb1(_0x1b1fef);})['catch'](function(_0x1eab4b){logger[_0xc644('0x14')](_0xc644('0x20'),_0x1eab4b[_0xc644('0x16')],_0x3f3a8a);_0x5acea5(_0x9722ea[_0xc644('0x14')](0x1f4,_0x1eab4b[_0xc644('0x16')]));});});};exports[_0xc644('0x21')]=function(_0x3b27ab){var _0x1527ad=this;return new Promise(function(_0x106193,_0x11801d){return db[_0xc644('0x19')][_0xc644('0x22')]({'raw':_0x3b27ab[_0xc644('0x1b')]?_0x3b27ab[_0xc644('0x1b')][_0xc644('0x23')]===undefined?!![]:![]:!![],'where':_0x3b27ab[_0xc644('0x1b')]?_0x3b27ab[_0xc644('0x1b')]['where']||null:null,'attributes':_0x3b27ab[_0xc644('0x1b')]?_0x3b27ab['options'][_0xc644('0x1c')]||null:null,'include':_0x3b27ab[_0xc644('0x1b')]?_0x3b27ab['options'][_0xc644('0x1e')]?_[_0xc644('0x24')](_0x3b27ab[_0xc644('0x1b')]['include'],function(_0xa296e5){return{'model':db[_0xa296e5['model']],'as':_0xa296e5['as'],'attributes':_0xa296e5[_0xc644('0x1c')],'include':_0xa296e5[_0xc644('0x1e')]?_[_0xc644('0x24')](_0xa296e5['include'],function(_0x19ef2e){return{'model':db[_0x19ef2e[_0xc644('0x1f')]],'as':_0x19ef2e['as'],'attributes':_0x19ef2e[_0xc644('0x1c')],'include':_0x19ef2e[_0xc644('0x1e')]?_[_0xc644('0x24')](_0x19ef2e[_0xc644('0x1e')],function(_0x28cb6e){return{'model':db[_0x28cb6e[_0xc644('0x1f')]],'as':_0x28cb6e['as'],'attributes':_0x28cb6e[_0xc644('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc644('0xd')](function(_0x8318d0){logger[_0xc644('0xe')](_0xc644('0x21'),_0x3b27ab);logger[_0xc644('0x10')](_0xc644('0x21'),_0x3b27ab,JSON[_0xc644('0x13')](_0x8318d0));_0x106193(_0x8318d0);})['catch'](function(_0x46a222){logger[_0xc644('0x14')](_0xc644('0x21'),_0x46a222[_0xc644('0x16')],_0x3b27ab);_0x11801d(_0x1527ad[_0xc644('0x14')](0x1f4,_0x46a222['message']));});});};
\ No newline at end of file
index 3ba130d..d78fbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa775=['removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','whoami','/presence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','/:id/recordings','getRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','now','originalname','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts'];(function(_0x30d719,_0x22729b){var _0x21358e=function(_0x9c8042){while(--_0x9c8042){_0x30d719['push'](_0x30d719['shift']());}};_0x21358e(++_0x22729b);}(_0xa775,0x155));var _0x5a77=function(_0x30dcb4,_0x52c1d2){_0x30dcb4=_0x30dcb4-0x0;var _0x114fc6=_0xa775[_0x30dcb4];return _0x114fc6;};'use strict';var multer=require(_0x5a77('0x0'));var util=require(_0x5a77('0x1'));var path=require(_0x5a77('0x2'));var timeout=require(_0x5a77('0x3'));var express=require(_0x5a77('0x4'));var router=express[_0x5a77('0x5')]();var fs_extra=require(_0x5a77('0x6'));var auth=require(_0x5a77('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a77('0x8'));var controller=require('./user.controller');router[_0x5a77('0x9')]('/',auth[_0x5a77('0xa')](),controller['index']);router[_0x5a77('0x9')]('/describe',auth[_0x5a77('0xa')](),controller['describe']);router[_0x5a77('0x9')]('/whoami',auth['isAuthenticated'](),controller[_0x5a77('0xb')]);router['get'](_0x5a77('0xc'),auth[_0x5a77('0xa')](),controller['getPresence']);router[_0x5a77('0x9')]('/:id',auth[_0x5a77('0xa')](),controller[_0x5a77('0xd')]);router[_0x5a77('0x9')](_0x5a77('0xe'),controller['getAvatar']);router[_0x5a77('0x9')](_0x5a77('0xf'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x10')]);router['get'](_0x5a77('0x11'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x12')]);router['get'](_0x5a77('0x13'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x14')]);router[_0x5a77('0x9')](_0x5a77('0x15'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router['get'](_0x5a77('0x16'),auth[_0x5a77('0xa')](),controller['getGroups']);router['get'](_0x5a77('0x17'),auth['isAuthenticated'](),controller[_0x5a77('0x18')]);router[_0x5a77('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x5a77('0x9')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x5a77('0x19')]);router[_0x5a77('0x9')](_0x5a77('0x1a'),auth[_0x5a77('0xa')](),controller['getOpenchannelInteractions']);router[_0x5a77('0x9')](_0x5a77('0x1b'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x1c')]);router[_0x5a77('0x9')](_0x5a77('0x1d'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x1e')]);router[_0x5a77('0x9')]('/:id/fax/interactions',auth[_0x5a77('0xa')](),controller[_0x5a77('0x1f')]);router[_0x5a77('0x9')](_0x5a77('0x20'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x21')]);router[_0x5a77('0x9')](_0x5a77('0x22'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x23')]);router[_0x5a77('0x9')](_0x5a77('0x24'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x25')]);router['get'](_0x5a77('0x26'),auth[_0x5a77('0xa')](),controller['getAgents']);router['get'](_0x5a77('0x27'),auth[_0x5a77('0xa')](),controller['getVoicePrefixes']);router['get'](_0x5a77('0x28'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x29')]);router['get'](_0x5a77('0x2a'),auth[_0x5a77('0xa')](),controller['getMailAccounts']);router[_0x5a77('0x9')](_0x5a77('0x2b'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x2c')]);router['get'](_0x5a77('0x2d'),auth[_0x5a77('0xa')](),controller['getSmsAccounts']);router[_0x5a77('0x9')](_0x5a77('0x2e'),auth['isAuthenticated'](),controller[_0x5a77('0x2f')]);router['get'](_0x5a77('0x30'),auth['isAuthenticated'](),controller[_0x5a77('0x31')]);router['get'](_0x5a77('0x32'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x33')]);router[_0x5a77('0x9')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x5a77('0x9')](_0x5a77('0x34'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x35')]);router[_0x5a77('0x36')](_0x5a77('0x11'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x37')]);router[_0x5a77('0x36')]('/',auth[_0x5a77('0xa')](),controller['create']);router['post'](_0x5a77('0x38'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x39')]);router[_0x5a77('0x36')](_0x5a77('0x13'),auth[_0x5a77('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xac010,_0x1a1a37,_0x354b35){_0x354b35(null,path[_0x5a77('0x3a')](config[_0x5a77('0x3b')],_0x5a77('0x3c')));},'filename':function(_0x59aa75,_0x131d3a,_0x1183a2){_0x1183a2(null,util[_0x5a77('0x3d')](_0x5a77('0x3e'),Date[_0x5a77('0x3f')](),_0x131d3a[_0x5a77('0x40')]));}})});router['post'](_0x5a77('0xe'),upload['single']('file'),controller[_0x5a77('0x41')]);router[_0x5a77('0x36')]('/:id/login',auth[_0x5a77('0xa')](),controller[_0x5a77('0x42')]);router[_0x5a77('0x36')]('/:id/logout',auth[_0x5a77('0xa')](),controller[_0x5a77('0x43')]);router[_0x5a77('0x36')](_0x5a77('0x44'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x45')]);router[_0x5a77('0x36')](_0x5a77('0x46'),auth[_0x5a77('0xa')](),controller['unpause']);router[_0x5a77('0x36')](_0x5a77('0x22'),auth['isAuthenticated'](),controller[_0x5a77('0x47')]);router[_0x5a77('0x36')](_0x5a77('0x48'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x49')]);router['post'](_0x5a77('0x4a'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x4b')]);router[_0x5a77('0x36')](_0x5a77('0x4c'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x4d')]);router[_0x5a77('0x36')](_0x5a77('0x4e'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x4f')]);router[_0x5a77('0x36')](_0x5a77('0x50'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x51')]);router[_0x5a77('0x36')](_0x5a77('0x52'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x53')]);router[_0x5a77('0x36')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x5a77('0x54')]);router[_0x5a77('0x36')](_0x5a77('0x2a'),auth['isAuthenticated'](),controller[_0x5a77('0x55')]);router[_0x5a77('0x36')](_0x5a77('0x2b'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x56')]);router['post'](_0x5a77('0x2d'),auth['isAuthenticated'](),controller[_0x5a77('0x57')]);router[_0x5a77('0x36')](_0x5a77('0x2e'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x58')]);router[_0x5a77('0x36')]('/:id/whatsapp_accounts',auth[_0x5a77('0xa')](),controller[_0x5a77('0x59')]);router[_0x5a77('0x36')]('/:id/square_projects',auth[_0x5a77('0xa')](),controller[_0x5a77('0x5a')]);router[_0x5a77('0x36')](_0x5a77('0x34'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x5a77('0x5b')](_0x5a77('0x5c'),auth['isAuthenticated'](),controller[_0x5a77('0x5d')]);router[_0x5a77('0x5b')](_0x5a77('0x5e'),auth['isAuthenticated'](),controller[_0x5a77('0x5f')]);router[_0x5a77('0x60')](_0x5a77('0x13'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x61')]);router[_0x5a77('0x60')](_0x5a77('0x22'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x62')]);router[_0x5a77('0x60')]('/:id',auth[_0x5a77('0xa')](),controller[_0x5a77('0x63')]);router['delete'](_0x5a77('0x48'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x64')]);router[_0x5a77('0x60')](_0x5a77('0x4a'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x65')]);router[_0x5a77('0x60')]('/:id/fax_interactions',auth[_0x5a77('0xa')](),controller[_0x5a77('0x66')]);router[_0x5a77('0x60')](_0x5a77('0x4e'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x67')]);router[_0x5a77('0x60')](_0x5a77('0x50'),auth['isAuthenticated'](),controller[_0x5a77('0x68')]);router[_0x5a77('0x60')](_0x5a77('0x52'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x69')]);router[_0x5a77('0x60')](_0x5a77('0x28'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x5a77('0x60')](_0x5a77('0x2a'),auth['isAuthenticated'](),controller[_0x5a77('0x6a')]);router['delete'](_0x5a77('0x2b'),auth['isAuthenticated'](),controller[_0x5a77('0x6b')]);router[_0x5a77('0x60')](_0x5a77('0x2d'),auth[_0x5a77('0xa')](),controller['removeSmsAccounts']);router[_0x5a77('0x60')](_0x5a77('0x2e'),auth[_0x5a77('0xa')](),controller[_0x5a77('0x6c')]);router[_0x5a77('0x60')]('/:id/whatsapp_accounts',auth[_0x5a77('0xa')](),controller[_0x5a77('0x6d')]);router[_0x5a77('0x60')](_0x5a77('0x32'),auth[_0x5a77('0xa')](),controller['removeSquareProjects']);router[_0x5a77('0x60')](_0x5a77('0x34'),auth['isAuthenticated'](),controller[_0x5a77('0x6e')]);module[_0x5a77('0x6f')]=router;
\ No newline at end of file
+var _0x8c42=['removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','describe','get','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/: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','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getApiKey','addContacts','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','/:id','update','changePassword','delete','removeQueues','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts'];(function(_0x35b4c6,_0x5e57a2){var _0xa45f4c=function(_0x347b3e){while(--_0x347b3e){_0x35b4c6['push'](_0x35b4c6['shift']());}};_0xa45f4c(++_0x5e57a2);}(_0x8c42,0x173));var _0x28c4=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x8c42[_0x4d1ee9];return _0x9a5456;};'use strict';var multer=require(_0x28c4('0x0'));var util=require(_0x28c4('0x1'));var path=require(_0x28c4('0x2'));var timeout=require(_0x28c4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x28c4('0x4'));var auth=require(_0x28c4('0x5'));var interaction=require(_0x28c4('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0x28c4('0x7')](),controller[_0x28c4('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x28c4('0x9')]);router[_0x28c4('0xa')](_0x28c4('0xb'),auth['isAuthenticated'](),controller[_0x28c4('0xc')]);router[_0x28c4('0xa')](_0x28c4('0xd'),auth['isAuthenticated'](),controller[_0x28c4('0xe')]);router[_0x28c4('0xa')]('/:id',auth[_0x28c4('0x7')](),controller[_0x28c4('0xf')]);router['get'](_0x28c4('0x10'),controller['getAvatar']);router['get']('/:id/open_tabs',auth[_0x28c4('0x7')](),controller[_0x28c4('0x11')]);router[_0x28c4('0xa')](_0x28c4('0x12'),auth['isAuthenticated'](),controller[_0x28c4('0x13')]);router['get'](_0x28c4('0x14'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x15')]);router[_0x28c4('0xa')](_0x28c4('0x16'),auth['isAuthenticated'](),controller[_0x28c4('0x17')]);router[_0x28c4('0xa')](_0x28c4('0x18'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x19')]);router[_0x28c4('0xa')](_0x28c4('0x1a'),auth['isAuthenticated'](),controller[_0x28c4('0x1b')]);router[_0x28c4('0xa')](_0x28c4('0x1c'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x1d')]);router[_0x28c4('0xa')](_0x28c4('0x1e'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x1f')]);router[_0x28c4('0xa')](_0x28c4('0x20'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x21')]);router[_0x28c4('0xa')](_0x28c4('0x22'),auth[_0x28c4('0x7')](),controller['getMailInteractions']);router[_0x28c4('0xa')](_0x28c4('0x23'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x24')]);router[_0x28c4('0xa')](_0x28c4('0x25'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x26')]);router[_0x28c4('0xa')](_0x28c4('0x27'),auth[_0x28c4('0x7')](),controller['getWhatsappInteractions']);router['get'](_0x28c4('0x28'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x29')]);router[_0x28c4('0xa')](_0x28c4('0x2a'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x2b')]);router['get'](_0x28c4('0x2c'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x2d')]);router[_0x28c4('0xa')](_0x28c4('0x2e'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x2f')]);router[_0x28c4('0xa')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x28c4('0x30')]);router[_0x28c4('0xa')](_0x28c4('0x31'),auth[_0x28c4('0x7')](),controller['getMailAccounts']);router[_0x28c4('0xa')]('/:id/openchannel_accounts',auth[_0x28c4('0x7')](),controller[_0x28c4('0x32')]);router[_0x28c4('0xa')](_0x28c4('0x33'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x34')]);router[_0x28c4('0xa')](_0x28c4('0x35'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x36')]);router[_0x28c4('0xa')](_0x28c4('0x37'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x38')]);router[_0x28c4('0xa')](_0x28c4('0x39'),auth['isAuthenticated'](),controller[_0x28c4('0x3a')]);router['get']('/:id/scheduled_calls',auth[_0x28c4('0x7')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0x28c4('0x7')](),controller[_0x28c4('0x3b')]);router['post'](_0x28c4('0x12'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x3c')]);router[_0x28c4('0x3d')]('/',auth['isAuthenticated'](),controller[_0x28c4('0x3e')]);router['post'](_0x28c4('0x3f'),auth[_0x28c4('0x7')](),controller['bulkCreate']);router[_0x28c4('0x3d')](_0x28c4('0x14'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x40')]);var upload=multer({'storage':multer[_0x28c4('0x41')]({'destination':function(_0x498bc6,_0x35f1eb,_0xb10a6f){_0xb10a6f(null,path[_0x28c4('0x42')](config[_0x28c4('0x43')],_0x28c4('0x44')));},'filename':function(_0x4e02fe,_0x5b1016,_0x4cd09e){_0x4cd09e(null,util[_0x28c4('0x45')](_0x28c4('0x46'),Date[_0x28c4('0x47')](),_0x5b1016[_0x28c4('0x48')]));}})});router[_0x28c4('0x3d')](_0x28c4('0x10'),upload['single'](_0x28c4('0x49')),controller[_0x28c4('0x4a')]);router['post'](_0x28c4('0x4b'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x4c')]);router[_0x28c4('0x3d')](_0x28c4('0x4d'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x4e')]);router[_0x28c4('0x3d')]('/:id/pause',auth[_0x28c4('0x7')](),controller['pause']);router[_0x28c4('0x3d')]('/:id/unpause',auth[_0x28c4('0x7')](),controller[_0x28c4('0x4f')]);router[_0x28c4('0x3d')](_0x28c4('0x28'),auth['isAuthenticated'](),controller[_0x28c4('0x50')]);router[_0x28c4('0x3d')](_0x28c4('0x51'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x52')]);router[_0x28c4('0x3d')](_0x28c4('0x53'),auth['isAuthenticated'](),controller[_0x28c4('0x54')]);router[_0x28c4('0x3d')](_0x28c4('0x55'),auth[_0x28c4('0x7')](),controller['addFaxInteractions']);router[_0x28c4('0x3d')](_0x28c4('0x56'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x57')]);router[_0x28c4('0x3d')](_0x28c4('0x58'),auth['isAuthenticated'](),controller[_0x28c4('0x59')]);router[_0x28c4('0x3d')](_0x28c4('0x5a'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x5b')]);router[_0x28c4('0x3d')](_0x28c4('0x5c'),auth[_0x28c4('0x7')](),controller['addFaxAccounts']);router[_0x28c4('0x3d')](_0x28c4('0x31'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x5d')]);router[_0x28c4('0x3d')](_0x28c4('0x5e'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x5f')]);router['post'](_0x28c4('0x33'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x60')]);router[_0x28c4('0x3d')]('/:id/chat_websites',auth[_0x28c4('0x7')](),controller[_0x28c4('0x61')]);router[_0x28c4('0x3d')](_0x28c4('0x37'),auth['isAuthenticated'](),controller[_0x28c4('0x62')]);router[_0x28c4('0x3d')]('/:id/square_projects',auth[_0x28c4('0x7')](),controller['addSquareProjects']);router['post'](_0x28c4('0x63'),auth['isAuthenticated'](),controller[_0x28c4('0x64')]);router[_0x28c4('0x65')](_0x28c4('0x66'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x67')]);router['put']('/:id/password',auth[_0x28c4('0x7')](),controller[_0x28c4('0x68')]);router[_0x28c4('0x69')](_0x28c4('0x14'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x6a')]);router[_0x28c4('0x69')](_0x28c4('0x28'),auth[_0x28c4('0x7')](),controller['removeTeams']);router['delete'](_0x28c4('0x66'),auth['isAuthenticated'](),controller['destroy']);router[_0x28c4('0x69')]('/:id/chat_interactions',auth[_0x28c4('0x7')](),controller[_0x28c4('0x6b')]);router[_0x28c4('0x69')]('/:id/mail_interactions',auth[_0x28c4('0x7')](),controller[_0x28c4('0x6c')]);router[_0x28c4('0x69')](_0x28c4('0x55'),auth['isAuthenticated'](),controller[_0x28c4('0x6d')]);router[_0x28c4('0x69')](_0x28c4('0x56'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x6e')]);router[_0x28c4('0x69')](_0x28c4('0x58'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x6f')]);router[_0x28c4('0x69')](_0x28c4('0x5a'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x70')]);router[_0x28c4('0x69')](_0x28c4('0x5c'),auth['isAuthenticated'](),controller[_0x28c4('0x71')]);router[_0x28c4('0x69')](_0x28c4('0x31'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x72')]);router['delete']('/:id/openchannel_accounts',auth[_0x28c4('0x7')](),controller[_0x28c4('0x73')]);router['delete'](_0x28c4('0x33'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x74')]);router['delete'](_0x28c4('0x35'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x75')]);router[_0x28c4('0x69')](_0x28c4('0x37'),auth['isAuthenticated'](),controller[_0x28c4('0x76')]);router[_0x28c4('0x69')](_0x28c4('0x39'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x77')]);router['delete'](_0x28c4('0x63'),auth[_0x28c4('0x7')](),controller[_0x28c4('0x78')]);module[_0x28c4('0x79')]=router;
\ No newline at end of file
index bb7b1f5..8988dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x631c=['STRING','fullname','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','accountcode','callerid','format','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','\x22\x22\x20<>','always','accept','refuse','uas','fingerprint','certificate','passive','actpass','TEXT','showWebBar','get','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','string','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','defaultuser'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x631c,0x1b6));var _0xc631=function(_0x11bc04,_0x76019a){_0x11bc04=_0x11bc04-0x0;var _0x68d45d=_0x631c[_0x11bc04];return _0x68d45d;};'use strict';var Sequelize=require(_0xc631('0x0'));var moment=require(_0xc631('0x1'));var util=require('util');var _=require(_0xc631('0x2'));module[_0xc631('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc631('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x854d5b){this[_0xc631('0x5')]('name',_0x854d5b);this[_0xc631('0x5')](_0xc631('0x6'),_0x854d5b);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xc631('0x7')],'allowNull':![],'set':function(_0x556c29){this[_0xc631('0x5')](_0xc631('0x8'),_0x556c29);this['setDataValue']('callerid',util['format'](_0xc631('0x9'),_0x556c29,this['getDataValue'](_0xc631('0xa'))));}},'alias':{'type':Sequelize[_0xc631('0x7')]},'email':{'type':Sequelize[_0xc631('0x7')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x895dd6){if(_0x895dd6){this[_0xc631('0x5')](_0xc631('0xb'),_0x895dd6[_0xc631('0xc')]());}}},'role':{'type':Sequelize[_0xc631('0xd')](_0xc631('0xe'),'user',_0xc631('0xf'),_0xc631('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xc631('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc631('0x7')],'defaultValue':_0xc631('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xc631('0xa'),'set':function(_0x1aba68){this['setDataValue'](_0xc631('0xa'),_0x1aba68);this[_0xc631('0x5')](_0xc631('0x12'),_0x1aba68);this[_0xc631('0x5')](_0xc631('0x13'),util[_0xc631('0x14')](_0xc631('0x9'),this[_0xc631('0x15')](_0xc631('0x8')),_0x1aba68));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc631('0x7')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xc631('0x7')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc631('0x7')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc631('0x7')]},'online':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc631('0x17')]},'voicePause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xc631('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc631('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![],'defaultValue':_0xc631('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xc631('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x1b'),'user',_0xc631('0x1c')),'allowNull':!![],'defaultValue':_0xc631('0x1b')},'context':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![],'defaultValue':_0xc631('0x1d')},'callingpres':{'type':Sequelize[_0xc631('0xd')]('ALLOWED_NOT_SCREENED',_0xc631('0x1e'),_0xc631('0x1f'),_0xc631('0x20'),'PROHIB_NOT_SCREENED',_0xc631('0x21'),_0xc631('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![],'defaultValue':_0xc631('0x23'),'set':function(_0x28dca4){this[_0xc631('0x5')](_0xc631('0x24'),_0x28dca4?_0x28dca4[_0xc631('0x25')](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue']('transport')[_0xc631('0x26')](','):null;},'comment':_0xc631('0x27')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xc631('0x28'),_0xc631('0x29'),_0xc631('0x2a'),'auto'),'allowNull':!![],'defaultValue':_0xc631('0x2b')},'directmedia':{'type':Sequelize[_0xc631('0xd')]('yes','no',_0xc631('0x2c'),_0xc631('0x2d'),_0xc631('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc631('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![],'defaultValue':_0xc631('0x2f'),'set':function(_0x52255b){this[_0xc631('0x5')](_0xc631('0x30'),_0x52255b?_0x52255b[_0xc631('0x25')](','):null);},'get':function(){return this[_0xc631('0x15')]('nat')?this[_0xc631('0x15')](_0xc631('0x30'))['split'](','):null;},'comment':_0xc631('0x31')},'callgroup':{'type':Sequelize[_0xc631('0x7')]},'namedcallgroup':{'type':Sequelize[_0xc631('0x7')]},'pickupgroup':{'type':Sequelize[_0xc631('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xc631('0x7')]},'language':{'type':Sequelize[_0xc631('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc631('0x7')]},'disallow':{'type':Sequelize[_0xc631('0x7')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xc631('0x7')],'allowNull':![],'defaultValue':_0xc631('0x32'),'set':function(_0x172484){this[_0xc631('0x5')](_0xc631('0x33'),_0x172484?_0x172484[_0xc631('0x25')](';'):_0xc631('0x32'));},'get':function(){return this[_0xc631('0x15')](_0xc631('0x33'))?this[_0xc631('0x15')](_0xc631('0x33'))[_0xc631('0x26')](';'):null;},'comment':_0xc631('0x34')},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x50b8bf){this[_0xc631('0x5')](_0xc631('0x35'),_0x50b8bf?_0x50b8bf[_0xc631('0x25')](','):null);},'get':function(){return this[_0xc631('0x15')](_0xc631('0x35'))?this[_0xc631('0x15')]('insecure')['split'](','):null;},'comment':_0xc631('0x36')},'trustrpid':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc631('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc631('0x37'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xc631('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc631('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':_0xc631('0x37')},'busylevel':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no',_0xc631('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xc631('0x3a'),_0xc631('0x3b'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc631('0xd')]('uac',_0xc631('0x3c')),'allowNull':!![],'defaultValue':_0xc631('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':_0xc631('0x37')},'keepalive':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc631('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xc631('0x37'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no',_0xc631('0x3d'),_0xc631('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xc631('0x3f'),_0xc631('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc631('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc631('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc631('0xd')](_0xc631('0x37'),'no',_0xc631('0x2c'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc631('0x7')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xc631('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc631('0x41')]},'showWebBar':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0,'set':function(_0x4a0f1f){this[_0xc631('0x5')](_0xc631('0x42'),_0x4a0f1f);var _0x197a1a=this[_0xc631('0x43')]({'plain':!![]});switch(_0x4a0f1f){case 0x0:case 0x1:var _0x24371c=_0x197a1a[_0xc631('0x24')]?_['isArray'](_0x197a1a[_0xc631('0x24')])?_0x197a1a[_0xc631('0x24')][_0xc631('0x25')]():_0x197a1a[_0xc631('0x24')]:_0xc631('0x23');if(_0x24371c===_0xc631('0x44')){_0x24371c='udp';}this[_0xc631('0x5')]('transport',_0x24371c);this[_0xc631('0x5')](_0xc631('0x45'),'no');this[_0xc631('0x5')](_0xc631('0x46'),null);this[_0xc631('0x5')]('force_avp',null);this[_0xc631('0x5')](_0xc631('0x47'),null);this[_0xc631('0x5')](_0xc631('0x48'),null);this['setDataValue'](_0xc631('0x49'),null);this[_0xc631('0x5')]('dtlssetup',null);this[_0xc631('0x5')](_0xc631('0x4a'),null);this[_0xc631('0x5')](_0xc631('0x4b'),null);this[_0xc631('0x5')](_0xc631('0x4c'),'no');break;case 0x2:this[_0xc631('0x5')](_0xc631('0x24'),_0xc631('0x44'));this[_0xc631('0x5')](_0xc631('0x45'),_0xc631('0x37'));this['setDataValue'](_0xc631('0x46'),_0xc631('0x37'));this[_0xc631('0x5')](_0xc631('0x4d'),'yes');this[_0xc631('0x5')](_0xc631('0x47'),_0xc631('0x37'));this[_0xc631('0x5')]('dtlsenable',_0xc631('0x37'));this[_0xc631('0x5')](_0xc631('0x49'),'no');this[_0xc631('0x5')](_0xc631('0x4e'),_0xc631('0x40'));this['setDataValue'](_0xc631('0x4a'),_0x197a1a[_0xc631('0x4a')]||_0xc631('0x4f'));this[_0xc631('0x5')](_0xc631('0x4b'),_0x197a1a[_0xc631('0x4b')]||_0xc631('0x50'));this[_0xc631('0x5')](_0xc631('0x4c'),_0xc631('0x37'));break;default:}}},'permissions':{'type':Sequelize[_0xc631('0x41')],'set':function(_0x48fa8e){this[_0xc631('0x5')]('permissions',_0x48fa8e?_0x48fa8e[_0xc631('0x25')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0xc631('0x51')](this[_0xc631('0x15')](_0xc631('0x52'))[_0xc631('0x26')](','),function(_0x509614){return parseInt(_0x509614,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc631('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc631('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc631('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc631('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc631('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0xc631('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xc631('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc631('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![],'set':function(_0x3c3b62){if(typeof _0x3c3b62===_0xc631('0x53')){var _0x25bfab=_0x3c3b62==='1'?!![]:_0x3c3b62==='0'?![]:_0x3c3b62==='true'?!![]:_0x3c3b62===_0xc631('0x54')?![]:![];this['setDataValue'](_0xc631('0x55'),_0x25bfab);}else{this['setDataValue']('screenrecording',_0x3c3b62);}}},'blocked':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![],'set':function(_0x258480){this[_0xc631('0x5')](_0xc631('0x56'),_0x258480);if(_0x258480===!![]){this[_0xc631('0x5')]('blockedAt',moment());this[_0xc631('0x5')](_0xc631('0x57'),0x0);}else{this[_0xc631('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xc631('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc631('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc631('0x19')](0x5)[_0xc631('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc631('0x16')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbecd=['icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','wss','avpf','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','toLowerCase','ENUM','admin','user','agent','telephone','local','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uac','uas','certificate','passive','actpass','nonat','update,nonat','TEXT','get','isArray','encryption','force_avp'];(function(_0x2b1b8d,_0x24ed2f){var _0x51f032=function(_0x5c92ed){while(--_0x5c92ed){_0x2b1b8d['push'](_0x2b1b8d['shift']());}};_0x51f032(++_0x24ed2f);}(_0xbecd,0x6a));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xdbec('0x0'));var moment=require('moment');var util=require(_0xdbec('0x1'));var _=require(_0xdbec('0x2'));module['exports']={'name':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'unique':_0xdbec('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x343f68){this[_0xdbec('0x5')](_0xdbec('0x4'),_0x343f68);this[_0xdbec('0x5')](_0xdbec('0x6'),_0x343f68);},'comment':_0xdbec('0x7')},'fullname':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'set':function(_0x38cac4){this[_0xdbec('0x5')](_0xdbec('0x8'),_0x38cac4);this[_0xdbec('0x5')](_0xdbec('0x9'),util[_0xdbec('0xa')]('\x22%s\x22\x20<%s>',_0x38cac4,this[_0xdbec('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x19c62a){if(_0x19c62a){this[_0xdbec('0x5')]('email',_0x19c62a[_0xdbec('0xc')]());}}},'role':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0xe'),_0xdbec('0xf'),_0xdbec('0x10'),_0xdbec('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':_0xdbec('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xdbec('0x13'),'set':function(_0x109dd7){this['setDataValue'](_0xdbec('0x13'),_0x109dd7);this['setDataValue'](_0xdbec('0x14'),_0x109dd7);this['setDataValue'](_0xdbec('0x9'),util['format']('\x22%s\x22\x20<%s>',this[_0xdbec('0xb')](_0xdbec('0x8')),_0x109dd7));}},'salt':{'type':Sequelize[_0xdbec('0x3')]},'phone':{'type':Sequelize[_0xdbec('0x3')]},'mobile':{'type':Sequelize[_0xdbec('0x3')]},'address':{'type':Sequelize[_0xdbec('0x3')]},'zipcode':{'type':Sequelize[_0xdbec('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdbec('0x3')]},'country':{'type':Sequelize[_0xdbec('0x3')]},'online':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdbec('0x16')]},'voicePause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xdbec('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x19')},'ipaddr':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xdbec('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x1a'),_0xdbec('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xdbec('0x1a')},'context':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xdbec('0x1c'),'ALLOWED_PASSED_SCREEN',_0xdbec('0x1d'),'ALLOWED',_0xdbec('0x1e'),'PROHIB_PASSED_SCREEN',_0xdbec('0x1f'),_0xdbec('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x21'),'set':function(_0x40c6d9){this[_0xdbec('0x5')](_0xdbec('0x22'),_0x40c6d9?_0x40c6d9['join'](','):null);},'get':function(){return this[_0xdbec('0xb')]('transport')?this[_0xdbec('0xb')](_0xdbec('0x22'))[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x24')},'dtmfmode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x25'),'info',_0xdbec('0x26'),_0xdbec('0x27'),_0xdbec('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no','nonat',_0xdbec('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x2b'),'set':function(_0x4e0f96){this['setDataValue'](_0xdbec('0x2c'),_0x4e0f96?_0x4e0f96[_0xdbec('0x2d')](','):null);},'get':function(){return this['getDataValue'](_0xdbec('0x2c'))?this['getDataValue']('nat')[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x2e')},'callgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdbec('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x429a53){this[_0xdbec('0x5')](_0xdbec('0x2f'),_0x429a53?_0x429a53[_0xdbec('0x2d')](';'):_0xdbec('0x30'));},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x2f'))?this[_0xdbec('0xb')](_0xdbec('0x2f'))[_0xdbec('0x23')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x48a477){this['setDataValue']('insecure',_0x48a477?_0x48a477['join'](','):null);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x31'))?this['getDataValue'](_0xdbec('0x31'))['split'](','):null;},'comment':_0xdbec('0x32')},'trustrpid':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no',_0xdbec('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x34')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'busylevel':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x36'),'refuse',_0xdbec('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x38'),'uas'),'allowNull':!![],'defaultValue':_0xdbec('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'keepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no','fingerprint',_0xdbec('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdbec('0xd')]('active',_0xdbec('0x3b'),_0xdbec('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x3d'),_0xdbec('0x2a'),_0xdbec('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xdbec('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xdbec('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdbec('0x3f')]},'showWebBar':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0,'set':function(_0x43d839){this[_0xdbec('0x5')]('showWebBar',_0x43d839);var _0xaea659=this[_0xdbec('0x40')]({'plain':!![]});switch(_0x43d839){case 0x0:case 0x1:var _0x2ff4b3=_0xaea659[_0xdbec('0x22')]?_[_0xdbec('0x41')](_0xaea659[_0xdbec('0x22')])?_0xaea659[_0xdbec('0x22')]['join']():_0xaea659['transport']:'udp';if(_0x2ff4b3==='wss'){_0x2ff4b3=_0xdbec('0x21');}this['setDataValue']('transport',_0x2ff4b3);this[_0xdbec('0x5')](_0xdbec('0x42'),'no');this[_0xdbec('0x5')]('avpf',null);this[_0xdbec('0x5')](_0xdbec('0x43'),null);this[_0xdbec('0x5')](_0xdbec('0x44'),null);this[_0xdbec('0x5')](_0xdbec('0x45'),null);this['setDataValue'](_0xdbec('0x46'),null);this[_0xdbec('0x5')]('dtlssetup',null);this[_0xdbec('0x5')]('dtlscertfile',null);this[_0xdbec('0x5')](_0xdbec('0x47'),null);this[_0xdbec('0x5')](_0xdbec('0x48'),'no');break;case 0x2:this[_0xdbec('0x5')](_0xdbec('0x22'),_0xdbec('0x49'));this[_0xdbec('0x5')](_0xdbec('0x42'),_0xdbec('0x29'));this['setDataValue'](_0xdbec('0x4a'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x43'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x44'),'yes');this[_0xdbec('0x5')](_0xdbec('0x45'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x46'),'no');this[_0xdbec('0x5')](_0xdbec('0x4b'),_0xdbec('0x3c'));this['setDataValue'](_0xdbec('0x4c'),_0xaea659[_0xdbec('0x4c')]||_0xdbec('0x4d'));this['setDataValue'](_0xdbec('0x47'),_0xaea659['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0xdbec('0x48'),_0xdbec('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xdbec('0x3f')],'set':function(_0x59d797){this[_0xdbec('0x5')](_0xdbec('0x4e'),_0x59d797?_0x59d797[_0xdbec('0x2d')](','):[]);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x4e'))?_[_0xdbec('0x4f')](this[_0xdbec('0xb')](_0xdbec('0x4e'))[_0xdbec('0x23')](','),function(_0x22fef7){return parseInt(_0x22fef7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x50'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x14d56b){if(typeof _0x14d56b==='string'){var _0x2554e2=_0x14d56b==='1'?!![]:_0x14d56b==='0'?![]:_0x14d56b===_0xdbec('0x51')?!![]:_0x14d56b===_0xdbec('0x52')?![]:![];this[_0xdbec('0x5')](_0xdbec('0x53'),_0x2554e2);}else{this[_0xdbec('0x5')](_0xdbec('0x53'),_0x14d56b);}}},'blocked':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x234346){this[_0xdbec('0x5')]('blocked',_0x234346);if(_0x234346===!![]){this['setDataValue'](_0xdbec('0x54'),moment());this['setDataValue'](_0xdbec('0x55'),0x0);}else{this[_0xdbec('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xdbec('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xdbec('0x18')](0x5)[_0xdbec('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]}};
\ No newline at end of file
index ae51769..0abe85e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['SmsAccount','getSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lt','$ne','$eq','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contained','$any','phone','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','apiKeyIat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','getAgents','asc','desc','substring','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','client','offline','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','SELECT','select','field','ui.','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','path','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','http','request','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','find','name','UserProfileResource','stack','User','rawAttributes','fieldName','type','key','filter','includes','password','salt','includeAll','include','attributes','push','findAll','rows','query','openTabs','true','length','chat','sms','dataValues','fax','mail','openchannel','all','params','model','differenceBy','keys','filters','intersection','fields','merge','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','VoiceMail','email','102','113','110','104','105','106','107','108','109','100','111','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','create','UserProfileSection','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','autoAssociation','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','loginInPause','voicePause','interface','isValidChannel','add','Queues','penalty','spread','capitalize','toLowerCase','emit','VoiceQueue','voice','online','format','UserVoiceQueueRt','upsert','removeQueues','channel','Unknown\x20channel','remove','isArray','QueueId','Queue:remove','addAvatar','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','existsSync','server/files/images/','download','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','createdAt','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','CmContact','order','sort','where','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','options','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','QueuePause','manual','%s%s','Pause','getTeams','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getOpenchannelQueues','flatten','transaction','getDataValue','removeTeams','Team','Fax','removeAgent','getLists','values','send','addChatInteractions','omit','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','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts'];(function(_0xf59f3c,_0x1b8005){var _0x5e794d=function(_0x309abc){while(--_0x309abc){_0xf59f3c['push'](_0xf59f3c['shift']());}};_0x5e794d(++_0x1b8005);}(_0x32b6,0x1d1));var _0x632b=function(_0x3c1bc5,_0x2084b3){_0x3c1bc5=_0x3c1bc5-0x0;var _0x2cf674=_0x32b6[_0x3c1bc5];return _0x2cf674;};'use strict';var moment=require(_0x632b('0x0'));var BPromise=require(_0x632b('0x1'));var util=require('util');var path=require(_0x632b('0x2'));var fs=require('fs');var _=require(_0x632b('0x3'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0x632b('0x4'));var authService=require(_0x632b('0x5'));var qs=require(_0x632b('0x6'));var logger=require(_0x632b('0x7'))(_0x632b('0x8'));var utils=require(_0x632b('0x9'));var config=require(_0x632b('0xa'));var licenseUtil=require(_0x632b('0xb'));var db=require(_0x632b('0xc'))['db'];var socket=require(_0x632b('0xd'))(new Redis(config['redis']));require(_0x632b('0xe'))[_0x632b('0xf')](socket);config[_0x632b('0x10')]=_[_0x632b('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var client=jayson['client'][_0x632b('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x484b3a,_0x3e162c,_0x359d6e,_0x2eca51){return new BPromise(function(_0x485440,_0x249417){var _0x2e1dbc=_0x2eca51||client;return _0x2e1dbc[_0x632b('0x13')](_0x484b3a,_0x359d6e)[_0x632b('0x14')](function(_0x22c182){logger['info'](_0x632b('0x15'),_0x3e162c,_0x632b('0x16'));logger[_0x632b('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x3e162c,_0x632b('0x16'),JSON[_0x632b('0x18')](_0x22c182));if(_0x22c182[_0x632b('0x19')]){if(_0x22c182[_0x632b('0x19')][_0x632b('0x1a')]===0x1f4){logger[_0x632b('0x19')]('User,\x20%s,\x20%s',_0x3e162c,_0x22c182[_0x632b('0x19')]['message']);return _0x249417(_0x22c182['error'][_0x632b('0x1b')]);}logger['error'](_0x632b('0x15'),_0x3e162c,_0x22c182[_0x632b('0x19')][_0x632b('0x1b')]);return _0x485440(_0x22c182['error'][_0x632b('0x1b')]);}else{logger[_0x632b('0x1c')](_0x632b('0x15'),_0x3e162c,_0x632b('0x16'));_0x485440(_0x22c182['result'][_0x632b('0x1b')]);}})[_0x632b('0x1d')](function(_0x4f377f){logger[_0x632b('0x19')]('User,\x20%s,\x20%s',_0x3e162c,_0x4f377f);_0x249417(_0x4f377f);});});}function respondWithStatusCode(_0x4b5618,_0x1b1092){_0x1b1092=_0x1b1092||0xcc;return function(_0x5ce3fa){if(_0x5ce3fa){return _0x4b5618[_0x632b('0x1e')](_0x1b1092);}return _0x4b5618[_0x632b('0x1f')](_0x1b1092)[_0x632b('0x20')]();};}function respondWithResult(_0x540bfb,_0x10fc32){_0x10fc32=_0x10fc32||0xc8;return function(_0x43cf26){if(_0x43cf26){return _0x540bfb['status'](_0x10fc32)[_0x632b('0x21')](_0x43cf26);}};}function respondWithFilteredResult(_0x379dc2,_0x30ffb9){return function(_0x1e448c){if(_0x1e448c){var _0x45d017=typeof _0x30ffb9[_0x632b('0x22')]==='undefined'&&typeof _0x30ffb9['limit']===_0x632b('0x23');var _0x4d3a70=_0x1e448c[_0x632b('0x24')];var _0x954fa0=_0x45d017?0x0:_0x30ffb9['offset'];var _0x273e89=_0x45d017?_0x1e448c[_0x632b('0x24')]:_0x30ffb9[_0x632b('0x22')]+_0x30ffb9[_0x632b('0x25')];var _0x4728a8;if(_0x273e89>=_0x4d3a70){_0x273e89=_0x4d3a70;_0x4728a8=0xc8;}else{_0x4728a8=0xce;}_0x379dc2[_0x632b('0x1f')](_0x4728a8);return _0x379dc2[_0x632b('0x26')](_0x632b('0x27'),_0x954fa0+'-'+_0x273e89+'/'+_0x4d3a70)[_0x632b('0x21')](_0x1e448c);}return null;};}function saveUpdates(_0x4f8410){return function(_0x1bb484){if(_0x1bb484){return _0x1bb484[_0x632b('0x28')](_0x4f8410)[_0x632b('0x14')](function(_0x3999aa){return _0x3999aa;});}return null;};}function removeEntity(_0x17a5ba){return function(_0x2a34fa){if(_0x2a34fa){return _0x2a34fa[_0x632b('0x29')]()[_0x632b('0x14')](function(){var _0x1ace1b=_0x2a34fa[_0x632b('0x2a')]({'plain':!![]});if(_0x1ace1b[_0x632b('0x2b')]===_0x632b('0x2c'))return;var _0x2a7a44=[{'name':_0x632b('0x2d'),'value':_0x632b('0x2e'),'ignore':!![]},{'name':_0x632b('0x2f'),'value':_0x632b('0x30'),'ignore':![]},{'name':_0x632b('0x31'),'value':_0x632b('0x32'),'ignore':![]}];var _0x12f00=_(_0x2a7a44)['filter'](_0x632b('0x33'))[_0x632b('0x34')](_0x632b('0x35'))[_0x632b('0x35')]();if(_['includes'](_0x12f00,_0x1ace1b[_0x632b('0x2b')])){return;}var _0x4ebef2=_[_0x632b('0x36')](_0x2a7a44,[_0x632b('0x35'),_0x1ace1b['role']])[_0x632b('0x37')];return db[_0x632b('0x38')][_0x632b('0x29')]({'where':{'type':_0x4ebef2,'resourceId':_0x1ace1b['id']}})[_0x632b('0x14')](function(){return _0x2a34fa;});})[_0x632b('0x14')](function(){_0x17a5ba[_0x632b('0x1f')](0xcc)[_0x632b('0x20')]();});}};}function handleEntityNotFound(_0x300b60){return function(_0x4d374f){if(!_0x4d374f){_0x300b60['sendStatus'](0x194);}return _0x4d374f;};}function handleError(_0x22ae6a,_0x18e484){_0x18e484=_0x18e484||0x1f4;return function(_0x52872a){logger[_0x632b('0x19')](_0x52872a[_0x632b('0x39')]);if(_0x52872a[_0x632b('0x37')]){delete _0x52872a[_0x632b('0x37')];}_0x22ae6a[_0x632b('0x1f')](_0x18e484)['send'](_0x52872a);};}exports['index']=function(_0x3a0311,_0x581b92){var _0x3a416c={},_0x31f7bb={'count':0x0,'rows':[]};var _0x3d6199=_(db[_0x632b('0x3a')][_0x632b('0x3b')])[_0x632b('0x34')](function(_0x30b493){return{'name':_0x30b493[_0x632b('0x3c')],'type':_0x30b493[_0x632b('0x3d')][_0x632b('0x3e')]};})[_0x632b('0x3f')](function(_0x3d4c46){return!_[_0x632b('0x40')]([_0x632b('0x41'),_0x632b('0x42')],_0x3d4c46[_0x632b('0x37')]);})[_0x632b('0x35')]();_0x3a416c=qs['getOptions'](_0x3d6199,_0x3a0311);var _0x5dfe1d={'where':_0x3a416c['where']};return db['User']['count'](_0x5dfe1d)[_0x632b('0x14')](function(_0x4b04a1){_0x31f7bb['count']=_0x4b04a1;if(_0x3a0311['query'][_0x632b('0x43')]){_0x3a416c[_0x632b('0x44')]=[{'all':!![]}];}if(!_[_0x632b('0x40')](_0x3a416c[_0x632b('0x45')],'id')){_0x3a416c['attributes'][_0x632b('0x46')]('id');}return db[_0x632b('0x3a')][_0x632b('0x47')](_0x3a416c);})['then'](function(_0x15bb30){_0x31f7bb[_0x632b('0x48')]=_0x15bb30;if(_0x3a0311[_0x632b('0x49')][_0x632b('0x4a')]===_0x632b('0x4b')){var _0xd006b4=[];for(var _0x5b510a=0x0;_0x5b510a<_0x31f7bb[_0x632b('0x48')][_0x632b('0x4c')];_0x5b510a++){_0xd006b4[_0x632b('0x46')](get_open_tabs(_0x632b('0x4d'),_0x31f7bb['rows'][_0x5b510a]['dataValues']));_0xd006b4[_0x632b('0x46')](get_open_tabs(_0x632b('0x4e'),_0x31f7bb[_0x632b('0x48')][_0x5b510a][_0x632b('0x4f')]));_0xd006b4[_0x632b('0x46')](get_open_tabs(_0x632b('0x50'),_0x31f7bb['rows'][_0x5b510a][_0x632b('0x4f')]));_0xd006b4[_0x632b('0x46')](get_open_tabs(_0x632b('0x51'),_0x31f7bb[_0x632b('0x48')][_0x5b510a][_0x632b('0x4f')]));_0xd006b4[_0x632b('0x46')](get_open_tabs(_0x632b('0x52'),_0x31f7bb[_0x632b('0x48')][_0x5b510a]['dataValues']));_0xd006b4[_0x632b('0x46')](get_open_tabs('whatsapp',_0x31f7bb[_0x632b('0x48')][_0x5b510a]['dataValues']));}return BPromise[_0x632b('0x53')](_0xd006b4)[_0x632b('0x14')](function(_0x16dfc7){return _0x31f7bb;});}else{return _0x31f7bb;}})[_0x632b('0x14')](respondWithFilteredResult(_0x581b92,_0x3a416c))[_0x632b('0x1d')](handleError(_0x581b92,null));};exports['show']=function(_0x3e582e,_0x33ffcc){var _0xc8579d={'raw':![],'where':{'id':_0x3e582e[_0x632b('0x54')]['id']}},_0x585006={};_0x585006[_0x632b('0x55')]=_[_0x632b('0x56')](_[_0x632b('0x57')](db[_0x632b('0x3a')]['rawAttributes']),[_0x632b('0x41'),'salt']);_0x585006[_0x632b('0x49')]=_[_0x632b('0x57')](_0x3e582e[_0x632b('0x49')]);_0x585006[_0x632b('0x58')]=_[_0x632b('0x59')](_0x585006['model'],_0x585006['query']);_0xc8579d[_0x632b('0x45')]=_[_0x632b('0x59')](_0x585006[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x3e582e[_0x632b('0x49')][_0x632b('0x5a')]));_0xc8579d['attributes']=_0xc8579d[_0x632b('0x45')][_0x632b('0x4c')]?_0xc8579d[_0x632b('0x45')]:_0x585006['model'];if(_0x3e582e[_0x632b('0x49')][_0x632b('0x43')]){_0xc8579d[_0x632b('0x44')]=[{'all':!![]}];}_0xc8579d=_[_0x632b('0x5b')]({},_0xc8579d,_0x3e582e['options']);if(!_[_0x632b('0x40')](_0xc8579d[_0x632b('0x45')],'id')){_0xc8579d[_0x632b('0x45')][_0x632b('0x46')]('id');}return db[_0x632b('0x3a')]['find'](_0xc8579d)[_0x632b('0x14')](handleEntityNotFound(_0x33ffcc,null))[_0x632b('0x14')](function(_0x39ccc7){var _0x36a7c5=[];values=_0x39ccc7;if(_0x3e582e[_0x632b('0x49')]['openTabs']===_0x632b('0x4b')){_0x36a7c5[_0x632b('0x46')](get_open_tabs(_0x632b('0x4d'),_0x39ccc7[_0x632b('0x4f')]));_0x36a7c5[_0x632b('0x46')](get_open_tabs(_0x632b('0x4e'),_0x39ccc7[_0x632b('0x4f')]));_0x36a7c5[_0x632b('0x46')](get_open_tabs(_0x632b('0x52'),_0x39ccc7[_0x632b('0x4f')]));_0x36a7c5[_0x632b('0x46')](get_open_tabs('whatsapp',_0x39ccc7[_0x632b('0x4f')]));_0x36a7c5[_0x632b('0x46')](get_open_tabs(_0x632b('0x50'),_0x39ccc7[_0x632b('0x4f')]));_0x36a7c5[_0x632b('0x46')](get_open_tabs('mail',_0x39ccc7[_0x632b('0x4f')]));return BPromise[_0x632b('0x53')](_0x36a7c5);}else{return values;}})[_0x632b('0x14')](function(_0x335b8e){return values;})[_0x632b('0x14')](respondWithResult(_0x33ffcc,null))[_0x632b('0x1d')](handleError(_0x33ffcc,null));};exports[_0x632b('0x28')]=function(_0x4ffa35,_0x14ee44){if(_0x4ffa35['body']['id']){delete _0x4ffa35[_0x632b('0x5c')]['id'];}delete _0x4ffa35['body'][_0x632b('0x2b')];return db['User'][_0x632b('0x36')]({'where':{'id':_0x4ffa35[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x14ee44,null))['then'](saveUpdates(_0x4ffa35[_0x632b('0x5c')],null))[_0x632b('0x14')](respondWithResult(_0x14ee44,null))[_0x632b('0x1d')](handleError(_0x14ee44,null));};exports[_0x632b('0x5d')]=function(_0x52eed9,_0x1420d9){return db[_0x632b('0x3a')]['describe']()[_0x632b('0x14')](respondWithResult(_0x1420d9,null))['catch'](handleError(_0x1420d9,null));};exports[_0x632b('0x5e')]=function(_0x388b27,_0x5dc254){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x388b27[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x5dc254,null))['then'](function(_0x2711d5){if(_0x2711d5){return _0x2711d5[_0x632b('0x5e')](_0x388b27[_0x632b('0x5c')][_0x632b('0x5f')],_['omit'](_0x388b27[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x5dc254,null))[_0x632b('0x1d')](handleError(_0x5dc254,null));};function validateUser(_0x35bbcd){return new BPromise(function(_0x20065b,_0x5c614e){if(_0x35bbcd[_0x632b('0x60')])return _0x20065b(_0x35bbcd);return db[_0x632b('0x61')][_0x632b('0x62')](0x1)['then'](function(_0x518fa7){if(_0x518fa7[_0x632b('0x63')])authService[_0x632b('0x64')](_0x35bbcd[_0x632b('0x41')]);db[_0x632b('0x3a')][_0x632b('0x65')](_0x632b('0x60'))[_0x632b('0x14')](function(_0x52c080){if(_[_0x632b('0x66')](_0x52c080)){_0x35bbcd[_0x632b('0x60')]=_0x518fa7[_0x632b('0x67')]||0x1;return;}if(_[_0x632b('0x66')](_0x518fa7[_0x632b('0x67')])||_0x518fa7[_0x632b('0x67')]===_0x52c080){_0x35bbcd['internal']=_0x52c080+0x1;return;}if(_0x518fa7[_0x632b('0x67')]>_0x52c080){_0x35bbcd[_0x632b('0x60')]=_0x518fa7[_0x632b('0x67')];return;}return db[_0x632b('0x68')]['query'](_0x632b('0x69'),{'type':db[_0x632b('0x68')][_0x632b('0x6a')]['SELECT']})[_0x632b('0x14')](function(_0x66449d){if(_0x66449d&&_0x66449d[_0x632b('0x4c')]){for(var _0x26f891=0x0,_0x225d81=_0x66449d[_0x632b('0x4c')];_0x26f891<_0x225d81&&_['isNil'](_0x35bbcd[_0x632b('0x60')]);_0x26f891++){if(_0x518fa7[_0x632b('0x67')]<=_0x66449d[_0x26f891]['from']){_0x35bbcd['internal']=_0x66449d[_0x26f891]['from'];}else if(_0x518fa7[_0x632b('0x67')]>_0x66449d[_0x26f891][_0x632b('0x6b')]&&_0x518fa7[_0x632b('0x67')]<=_0x66449d[_0x26f891]['to']){_0x35bbcd[_0x632b('0x60')]=_0x518fa7[_0x632b('0x67')];}}}if(_['isNil'](_0x35bbcd['internal'])){_0x35bbcd[_0x632b('0x60')]=_0x52c080+0x1;}return _0x20065b(_0x35bbcd);});});})[_0x632b('0x1d')](function(_0x5c591c){_0x5c614e(_0x5c591c);});});}function updateUser(_0x580b12){return new BPromise(function(_0x11cc11,_0x73b100){try{if(_0x580b12['voicemail']){_0x580b12[_0x632b('0x6c')]=_0x580b12[_0x632b('0x60')];_0x580b12[_0x632b('0x6d')]={'mailbox':_0x580b12['internal'],'password':_0x580b12['password'],'fullname':_0x580b12['fullname'],'email':_0x580b12[_0x632b('0x6e')]};}if(_0x580b12[_0x632b('0x2b')]===_0x632b('0x30')){if(!_0x580b12['permissions'])_0x580b12['permissions']=['101',_0x632b('0x6f'),'103',_0x632b('0x70'),_0x632b('0x71'),_0x632b('0x72'),_0x632b('0x73'),_0x632b('0x74'),_0x632b('0x75'),_0x632b('0x76'),_0x632b('0x77'),_0x632b('0x78'),_0x632b('0x79'),'114','115'];}_0x11cc11(_0x580b12);}catch(_0x270c08){_0x73b100(_0x270c08);}});}exports['create']=function(_0x44278c,_0xfc37c6){if(_0x44278c[_0x632b('0x2e')][_0x632b('0x2b')]==='agent')throw new Error(_0x632b('0x7a'));if(_0x44278c['body']['role']==='user'&&_0x44278c[_0x632b('0x2e')]['role']!==_0x632b('0x2c')){throw new Error(_0x632b('0x7b'));}if(_0x44278c[_0x632b('0x5c')][_0x632b('0x2b')]===_0x632b('0x2c')&&_0x44278c['user']['role']!==_0x632b('0x2c')){throw new Error(_0x632b('0x7c'));}return licenseUtil[_0x632b('0x7d')]([_0x44278c[_0x632b('0x5c')]])[_0x632b('0x14')](function(){return validateUser(_0x44278c[_0x632b('0x5c')]);})[_0x632b('0x14')](function(_0x570aac){return updateUser(_0x570aac)[_0x632b('0x14')](function(_0x3c0cb1){if(_0x3c0cb1['role']==='admin'){_0x3c0cb1[_0x632b('0x7e')]=_0x44278c['user']['settingsEnabled'];delete _0x3c0cb1[_0x632b('0x7f')];}return _0x3c0cb1;});})['then'](function(_0x402f58){return db['User'][_0x632b('0x80')](_0x402f58,{'include':[{'model':db['VoiceMail'],'as':_0x632b('0x6d')}]});})[_0x632b('0x14')](function(_0x57a2a6){if(_0x44278c[_0x632b('0x5c')][_0x632b('0x2b')]===_0x632b('0x2e'))return _0x57a2a6;if(_0x44278c[_0x632b('0x2e')][_0x632b('0x2b')]!==_0x632b('0x2e'))return _0x57a2a6;return db[_0x632b('0x81')][_0x632b('0x36')]({'where':{'name':_0x57a2a6['role']==='agent'?_0x632b('0x2f'):_0x632b('0x31'),'userProfileId':_0x44278c[_0x632b('0x2e')][_0x632b('0x7f')]},'raw':!![]})[_0x632b('0x14')](function(_0x1b916a){if(!_0x1b916a||_0x1b916a['autoAssociation']!=0x0)return _0x57a2a6;return db[_0x632b('0x38')]['create']({'name':_0x57a2a6[_0x632b('0x37')],'resourceId':_0x57a2a6['id'],'type':_0x1b916a['name'],'sectionId':_0x1b916a['id']},{})[_0x632b('0x14')](function(){return _0x57a2a6;});})[_0x632b('0x1d')](function(_0x4fb55d){logger[_0x632b('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fb55d);throw _0x4fb55d;});})[_0x632b('0x14')](respondWithResult(_0xfc37c6,0xc9))[_0x632b('0x1d')](handleError(_0xfc37c6,null));};exports['bulkCreate']=function(_0x127dc3,_0x321e3e){var _0x2bbfef=_0x127dc3[_0x632b('0x5c')];var _0x132eac=[];if(_0x127dc3['user'][_0x632b('0x2b')]===_0x632b('0x30'))throw new Error('Unauthorized');if(_[_0x632b('0x82')](_0x2bbfef,['role',_0x632b('0x2e')])&&_0x127dc3['user'][_0x632b('0x2b')]!=='admin'){throw new Error(_0x632b('0x7b'));}if(_[_0x632b('0x82')](_0x2bbfef,[_0x632b('0x2b'),_0x632b('0x2c')])&&_0x127dc3[_0x632b('0x2e')]['role']!==_0x632b('0x2c')){throw new Error(_0x632b('0x83'));}return licenseUtil['checkUserLimits'](_0x2bbfef)[_0x632b('0x14')](function(){return validateUser(_0x2bbfef[0x0]);})['then'](function(){for(var _0x1bbb23=0x1;_0x1bbb23<_0x2bbfef['length'];_0x1bbb23++){var _0x3cf05f=_0x2bbfef[_0x1bbb23-0x1]['internal'];if(!_0x2bbfef[_0x1bbb23][_0x632b('0x60')])_0x2bbfef[_0x1bbb23][_0x632b('0x60')]=_0x3cf05f+0x1;_0x132eac[_0x632b('0x46')](validateUser(_0x2bbfef[_0x1bbb23]));}return BPromise['all'](_0x132eac);})[_0x632b('0x14')](function(){_0x132eac=[];for(var _0x4524fe=0x0;_0x4524fe<_0x2bbfef[_0x632b('0x4c')];_0x4524fe++){_0x132eac[_0x632b('0x46')](updateUser(_0x2bbfef[_0x4524fe]));}return BPromise[_0x632b('0x53')](_0x132eac);})[_0x632b('0x14')](function(){return BPromise[_0x632b('0x84')](_0x2bbfef,function(_0x31eee9){return db[_0x632b('0x3a')][_0x632b('0x80')](_0x31eee9,{'include':[{'model':db[_0x632b('0x6d')],'as':_0x632b('0x6d')}]})[_0x632b('0x14')](function(_0x55c36d){_0x31eee9['id']=_0x55c36d['id'];return _0x31eee9;});});})[_0x632b('0x14')](function(_0x376112){if(_0x127dc3[_0x632b('0x5c')][_0x632b('0x2b')]===_0x632b('0x2e'))return _0x376112;if(_0x127dc3[_0x632b('0x2e')][_0x632b('0x2b')]!==_0x632b('0x2e'))return _0x376112;var _0x191991=_[_0x632b('0x82')](_0x376112,function(_0x233e05){return _0x233e05[_0x632b('0x2b')]==='agent'||_0x233e05[_0x632b('0x2b')]===_0x632b('0x32');});if(!_0x191991)return _0x376112;return db[_0x632b('0x81')][_0x632b('0x47')]({'where':{'name':{'$or':[_0x632b('0x2f'),_0x632b('0x31')]},'userProfileId':_0x127dc3[_0x632b('0x2e')][_0x632b('0x7f')]},'raw':!![]})['then'](function(_0x33072f){if(_[_0x632b('0x85')](_0x33072f)||!_[_0x632b('0x82')](_0x33072f,[_0x632b('0x86'),0x0]))return _0x376112;_0x132eac=[];var _0x1e5166=_(_0x33072f)[_0x632b('0x34')](function(_0x45beba){if(_0x45beba[_0x632b('0x86')]===0x1)return;return _0x45beba[_0x632b('0x37')]==='Agents'?_0x632b('0x30'):_0x632b('0x32');})[_0x632b('0x87')]()[_0x632b('0x35')]();for(var _0x18bb94=0x0;_0x18bb94<_0x376112[_0x632b('0x4c')];_0x18bb94++){if(!_['includes'](_0x1e5166,_0x376112[_0x18bb94][_0x632b('0x2b')]))return;var _0x5cf232=_0x376112[_0x18bb94][_0x632b('0x2b')]==='agent'?'Agents':_0x632b('0x31');_0x132eac[_0x632b('0x46')](db[_0x632b('0x38')][_0x632b('0x80')]({'name':_0x376112[_0x18bb94][_0x632b('0x37')],'resourceId':_0x376112[_0x18bb94]['id'],'type':_0x5cf232,'sectionId':_[_0x632b('0x36')](_0x33072f,[_0x632b('0x37'),_0x5cf232])['id']},{}));}return BPromise['all'](_0x132eac);});})[_0x632b('0x14')](respondWithResult(_0x321e3e,0xc9))['catch'](handleError(_0x321e3e,null));};exports[_0x632b('0x88')]=function(_0x4837ae,_0x4d3bb7){if(_0x4837ae[_0x632b('0x5c')]['id']){delete _0x4837ae[_0x632b('0x5c')]['id'];}return db[_0x632b('0x3a')]['find']({'where':{'id':_0x4837ae['params']['id']}})[_0x632b('0x14')](function(_0x31bd25){if(!_0x31bd25)return null;if(_0x31bd25['id']===_0x4837ae[_0x632b('0x2e')]['id']){if(!_0x4837ae['body']['oldPassword']||!_0x4837ae[_0x632b('0x5c')][_0x632b('0x89')]){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0x8c'));}if(!_0x31bd25[_0x632b('0x8d')](_0x4837ae['body'][_0x632b('0x8e')])){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0x8f'));}if(_0x4837ae[_0x632b('0x5c')][_0x632b('0x8e')]===_0x4837ae['body']['newPassword']){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4837ae[_0x632b('0x2e')][_0x632b('0x2b')]===_0x632b('0x2c')){if(!_0x4837ae[_0x632b('0x5c')][_0x632b('0x89')]){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0x90'));}}else if(_0x4837ae['user']['role']===_0x632b('0x2e')){if(!_0x4837ae[_0x632b('0x5c')]['newPassword']){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0x90'));}if(_0x31bd25[_0x632b('0x2b')]!==_0x632b('0x30')){throw new db['Sequelize']['ValidationError'](_0x632b('0x7a'));}}else{throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0x7a'));}return _0x31bd25;})[_0x632b('0x14')](handleEntityNotFound(_0x4d3bb7,null))[_0x632b('0x14')](function(_0x4e7637){return db[_0x632b('0x61')]['findOne']({'attributes':['id',_0x632b('0x63'),_0x632b('0x91'),_0x632b('0x92')]})[_0x632b('0x14')](function(_0x3c067a){if(_0x3c067a[_0x632b('0x63')])authService[_0x632b('0x64')](_0x4837ae[_0x632b('0x5c')][_0x632b('0x89')]);if(!_0x3c067a[_0x632b('0x91')]||!_0x4e7637['previousPasswords'])return _0x4e7637;authService[_0x632b('0x93')](_0x4837ae[_0x632b('0x5c')][_0x632b('0x89')],_0x4e7637[_0x632b('0x94')],_0x3c067a['passwordHistoryLimit']);return _0x4e7637;})[_0x632b('0x14')](saveUpdates({'password':_0x4837ae[_0x632b('0x5c')]['newPassword'],'passwordResetAt':_0x4837ae['user']['id']==_0x4837ae['params']['id']?moment():null,'previousPasswords':authService[_0x632b('0x95')](_0x4837ae[_0x632b('0x5c')][_0x632b('0x89')],_0x4e7637[_0x632b('0x94')])},null));})['then'](respondWithResult(_0x4d3bb7,null))[_0x632b('0x1d')](handleError(_0x4d3bb7,null));};exports[_0x632b('0x96')]=function(_0x1cfc20,_0x5bd1bb){var _0x1a50da=_0x1cfc20['body']['channel'];return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x1cfc20[_0x632b('0x54')]['id']},'attributes':['id','name','role','online',_0x632b('0x97'),_0x632b('0x98'),_0x632b('0x99')]})['then'](handleEntityNotFound(_0x5bd1bb,null))[_0x632b('0x14')](function(_0x90b25c){if(_0x90b25c){if(!utils[_0x632b('0x9a')](_0x1a50da)){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))]('Unknown\x20channel');}return _0x90b25c[_0x632b('0x9b')+_['capitalize'](_0x1a50da['toLowerCase']())+_0x632b('0x9c')](_0x1cfc20[_0x632b('0x5c')]['ids'],{'penalty':_0x1cfc20['body'][_0x632b('0x9d')]||0x0})[_0x632b('0x9e')](function(_0x586c9d){for(var _0x587aac=0x0;_0x587aac<_0x1cfc20[_0x632b('0x5c')]['ids']['length'];_0x587aac+=0x1){var _0x112ecc={'UserId':Number(_0x1cfc20[_0x632b('0x54')]['id'])};_0x112ecc[_[_0x632b('0x9f')](_0x1a50da[_0x632b('0xa0')]())+'QueueId']=Number(_0x1cfc20[_0x632b('0x5c')][_0x632b('0x5f')][_0x587aac]);socket[_0x632b('0xa1')](_0x632b('0x2e')+_[_0x632b('0x9f')](_0x1a50da[_0x632b('0xa0')]())+'Queue:save',_0x112ecc);}return _0x586c9d;})[_0x632b('0x14')](function(){if(_0x1a50da==='voice'){return db[_0x632b('0xa2')]['findAll']({'where':{'id':_0x1cfc20[_0x632b('0x5c')][_0x632b('0x5f')]||[]},'raw':!![],'attributes':['id',_0x632b('0x37')]});}})[_0x632b('0x14')](function(_0x130486){var _0x143d46=_0x90b25c[_0x632b('0x2a')]({'plain':!![]});var _0x42aded=[];if(_0x1a50da===_0x632b('0xa3')&&_0x143d46[_0x632b('0x2b')]===_0x632b('0x30')&&_0x143d46[_0x632b('0xa4')]){for(var _0x3784d2=0x0;_0x3784d2<_0x130486[_0x632b('0x4c')];_0x3784d2+=0x1){_0x42aded[_0x632b('0x46')]({'membername':_0x143d46['name'],'UserId':_0x143d46['id'],'queue_name':_0x130486[_0x3784d2][_0x632b('0x37')],'VoiceQueueId':_0x130486[_0x3784d2]['id'],'interface':_[_0x632b('0x66')](_0x143d46[_0x632b('0x99')])?util[_0x632b('0xa5')]('SIP/%s',_0x143d46['name']):_0x143d46[_0x632b('0x99')],'paused':_0x143d46['voicePause']||![],'penalty':_0x1cfc20[_0x632b('0x5c')][_0x632b('0x9d')]||0x0});}return BPromise[_0x632b('0x84')](_0x42aded,function(_0x54a2b3){return db[_0x632b('0xa6')][_0x632b('0xa7')](_0x54a2b3);});}return _0x90b25c;});}})[_0x632b('0x14')](respondWithStatusCode(_0x5bd1bb,null))[_0x632b('0x1d')](handleError(_0x5bd1bb,null));};exports[_0x632b('0xa8')]=function(_0x23ba69,_0x8f0512){var _0x119844;return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x23ba69[_0x632b('0x54')]['id']},'attributes':['id',_0x632b('0x37'),_0x632b('0x2b')]})[_0x632b('0x14')](handleEntityNotFound(_0x8f0512,null))[_0x632b('0x14')](function(_0x4df0aa){if(_0x4df0aa){_0x119844=_0x4df0aa;if(!_0x23ba69[_0x632b('0x49')][_0x632b('0xa9')]||!utils['isValidChannel'](_0x23ba69[_0x632b('0x49')]['channel'])){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0xaa'));}return _0x4df0aa[_0x632b('0xab')+_['capitalize'](_0x23ba69['query'][_0x632b('0xa9')][_0x632b('0xa0')]())+_0x632b('0x9c')](_0x23ba69['query'][_0x632b('0x5f')]);}})[_0x632b('0x14')](function(_0x1b7f2d){if(_[_0x632b('0xac')](_0x23ba69[_0x632b('0x49')][_0x632b('0x5f')])){for(var _0x121d88=0x0;_0x121d88<_0x23ba69[_0x632b('0x49')][_0x632b('0x5f')][_0x632b('0x4c')];_0x121d88+=0x1){var _0x5ce06a={'UserId':Number(_0x23ba69[_0x632b('0x54')]['id'])};_0x5ce06a[_['capitalize'](_0x23ba69[_0x632b('0x49')][_0x632b('0xa9')][_0x632b('0xa0')]())+_0x632b('0xad')]=Number(_0x23ba69[_0x632b('0x49')][_0x632b('0x5f')][_0x121d88]);socket[_0x632b('0xa1')](_0x632b('0x2e')+_[_0x632b('0x9f')](_0x23ba69['query'][_0x632b('0xa9')][_0x632b('0xa0')]())+'Queue:remove',_0x5ce06a);}}else{var _0x5ce06a={'UserId':Number(_0x23ba69[_0x632b('0x54')]['id'])};_0x5ce06a[_[_0x632b('0x9f')](_0x23ba69[_0x632b('0x49')][_0x632b('0xa9')][_0x632b('0xa0')]())+_0x632b('0xad')]=Number(_0x23ba69[_0x632b('0x49')][_0x632b('0x5f')]);socket['emit']('user'+_['capitalize'](_0x23ba69['query'][_0x632b('0xa9')][_0x632b('0xa0')]())+_0x632b('0xae'),_0x5ce06a);}return _0x1b7f2d;})[_0x632b('0x14')](function(){if(_0x23ba69['query'][_0x632b('0xa9')]==='voice'){return db[_0x632b('0xa6')][_0x632b('0x29')]({'where':{'UserId':_0x23ba69[_0x632b('0x54')]['id'],'VoiceQueueId':_0x23ba69['query'][_0x632b('0x5f')]},'individualHooks':!![]})[_0x632b('0x14')](function(){return _0x119844;});}return _0x119844;})[_0x632b('0x14')](respondWithStatusCode(_0x8f0512,null))[_0x632b('0x1d')](handleError(_0x8f0512,null));};exports[_0x632b('0xaf')]=function(_0x49e447,_0x29c5a8){_0x49e447[_0x632b('0x5c')]['userpic']=_0x49e447[_0x632b('0xb0')]['filename'];return db[_0x632b('0x3a')]['find']({'where':{'id':_0x49e447[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x29c5a8,null))[_0x632b('0x14')](saveUpdates(_0x49e447['body'],null))['then'](respondWithResult(_0x29c5a8,null))[_0x632b('0x1d')](handleError(_0x29c5a8,null));};exports[_0x632b('0xb1')]=function(_0x3e8235,_0x237aab){var _0x3f21fe=path[_0x632b('0xb2')](config[_0x632b('0xb3')],_0x632b('0xb4'));return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x3e8235[_0x632b('0x54')]['id']},'attributes':['id',_0x632b('0xb5')],'raw':!![]})[_0x632b('0x14')](handleEntityNotFound(_0x237aab,null))[_0x632b('0x14')](function(_0x54c55a){if(_0x54c55a){if(_[_0x632b('0x66')](_0x54c55a[_0x632b('0xb5')])){return _0x237aab['download'](_0x3f21fe);}else{if(!fs[_0x632b('0xb6')](path['join'](config[_0x632b('0xb3')],_0x632b('0xb7'),_0x54c55a[_0x632b('0xb5')]))){return _0x237aab[_0x632b('0xb8')](_0x3f21fe);}return _0x237aab[_0x632b('0xb8')](path[_0x632b('0xb2')](config[_0x632b('0xb3')],_0x632b('0xb7'),_0x54c55a[_0x632b('0xb5')]));}}})['catch'](handleError(_0x237aab,null));};exports[_0x632b('0xb9')]=function(_0x22962f,_0x404ddf){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x22962f[_0x632b('0x54')]['id']},'attributes':['id']})[_0x632b('0x14')](handleEntityNotFound(_0x404ddf,null))['then'](function(_0x1e9ccb){var _0x1d5880=[];values=_0x1e9ccb[_0x632b('0x4f')];_0x1d5880['push'](get_open_tabs(_0x632b('0x4d'),_0x1e9ccb[_0x632b('0x4f')]));_0x1d5880[_0x632b('0x46')](get_open_tabs('sms',_0x1e9ccb['dataValues']));_0x1d5880[_0x632b('0x46')](get_open_tabs(_0x632b('0x52'),_0x1e9ccb[_0x632b('0x4f')]));_0x1d5880['push'](get_open_tabs(_0x632b('0xba'),_0x1e9ccb[_0x632b('0x4f')]));_0x1d5880['push'](get_open_tabs('fax',_0x1e9ccb[_0x632b('0x4f')]));_0x1d5880[_0x632b('0x46')](get_open_tabs(_0x632b('0x51'),_0x1e9ccb[_0x632b('0x4f')]));return BPromise[_0x632b('0x53')](_0x1d5880);})[_0x632b('0x14')](function(_0x207e8a){var _0x2b9f5b=[];if(_0x207e8a){for(var _0x1f5324=0x0;_0x1f5324<values[_0x632b('0xbb')][_0x632b('0x4c')];_0x1f5324++){var _0x40184d=values[_0x632b('0xbb')][_0x1f5324];_0x2b9f5b['push']({'channel':_0x632b('0xbc'),'id':_0x40184d['id'],'createdAt':_0x40184d['createdAt']});}for(var _0x1f5324=0x0;_0x1f5324<values[_0x632b('0xbd')]['length'];_0x1f5324++){var _0x40184d=values[_0x632b('0xbd')][_0x1f5324];_0x2b9f5b['push']({'channel':_0x632b('0xbe'),'id':_0x40184d['id'],'createdAt':_0x40184d['createdAt']});}for(var _0x1f5324=0x0;_0x1f5324<values[_0x632b('0xbf')][_0x632b('0x4c')];_0x1f5324++){var _0x40184d=values[_0x632b('0xbf')][_0x1f5324];_0x2b9f5b[_0x632b('0x46')]({'channel':_0x632b('0xc0'),'id':_0x40184d['id'],'createdAt':_0x40184d['createdAt']});}for(var _0x1f5324=0x0;_0x1f5324<values['MailOpenTabs'][_0x632b('0x4c')];_0x1f5324++){var _0x40184d=values[_0x632b('0xc1')][_0x1f5324];_0x2b9f5b[_0x632b('0x46')]({'channel':'MAIL','id':_0x40184d['id'],'createdAt':_0x40184d[_0x632b('0xc2')]});}for(var _0x1f5324=0x0;_0x1f5324<values['SmsOpenTabs']['length'];_0x1f5324++){var _0x40184d=values[_0x632b('0xc3')][_0x1f5324];_0x2b9f5b['push']({'channel':_0x632b('0xc4'),'id':_0x40184d['id'],'createdAt':_0x40184d[_0x632b('0xc2')]});}for(var _0x1f5324=0x0;_0x1f5324<values[_0x632b('0xc5')][_0x632b('0x4c')];_0x1f5324++){var _0x40184d=values['WhatsappOpenTabs'][_0x1f5324];_0x2b9f5b[_0x632b('0x46')]({'channel':_0x632b('0xc6'),'id':_0x40184d['id'],'createdAt':_0x40184d[_0x632b('0xc2')]});}var _0x2226cd={'count':_0x2b9f5b[_0x632b('0x4c')],'rows':_0x2b9f5b};return _0x2226cd;}else return null;})[_0x632b('0x14')](respondWithResult(_0x404ddf,null))['catch'](handleError(_0x404ddf,null));};exports[_0x632b('0xc7')]=function(_0x12b1ff,_0x1b9948){var _0x21d1d6={};var _0x14ffc1={};var _0x5a982a;var _0x5d563c;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x12b1ff[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b9948,null))['then'](function(_0x24b47c){if(_0x24b47c){_0x5a982a=_0x24b47c;_0x14ffc1[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xc9')]['rawAttributes']);_0x14ffc1[_0x632b('0x49')]=_[_0x632b('0x57')](_0x12b1ff['query']);_0x14ffc1[_0x632b('0x58')]=_[_0x632b('0x59')](_0x14ffc1[_0x632b('0x55')],_0x14ffc1[_0x632b('0x49')]);_0x21d1d6[_0x632b('0x45')]=_[_0x632b('0x59')](_0x14ffc1[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x12b1ff['query'][_0x632b('0x5a')]));_0x21d1d6[_0x632b('0x45')]=_0x21d1d6[_0x632b('0x45')]['length']?_0x21d1d6[_0x632b('0x45')]:_0x14ffc1[_0x632b('0x55')];_0x21d1d6[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x12b1ff[_0x632b('0x49')][_0x632b('0xcb')]);_0x21d1d6[_0x632b('0xcc')]=qs['filters'](_[_0x632b('0xcd')](_0x12b1ff['query'],_0x14ffc1['filters']));if(_0x12b1ff['query'][_0x632b('0x3f')]){_0x21d1d6[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x21d1d6[_0x632b('0xcc')],{'$or':_['map'](_0x21d1d6[_0x632b('0x45')],function(_0x27070c){var _0x111edb={};_0x111edb[_0x27070c]={'$like':'%'+_0x12b1ff[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x111edb;})});}_0x21d1d6=_[_0x632b('0x5b')]({},_0x21d1d6,_0x12b1ff['options']);return _0x5a982a[_0x632b('0xc7')](_0x21d1d6);}})[_0x632b('0x14')](function(_0x22d30b){if(_0x22d30b){_0x5d563c=_0x22d30b[_0x632b('0x4c')];if(_0x12b1ff['query'][_0x632b('0xce')](_0x632b('0x43'))){_0x21d1d6[_0x632b('0x44')]=[{'model':db[_0x632b('0xcf')],'as':_0x632b('0xd0'),'required':![]},{'model':db[_0x632b('0xd1')],'as':_0x632b('0xd2'),'attributes':['id',_0x632b('0x37'),_0x632b('0xd3')],'where':_0x12b1ff[_0x632b('0x49')][_0x632b('0xd4')]?{'id':_0x12b1ff[_0x632b('0x49')][_0x632b('0xd4')]}:undefined,'required':_0x12b1ff[_0x632b('0x49')][_0x632b('0xd4')]?!![]:![]}];}if(!_0x12b1ff['query']['hasOwnProperty'](_0x632b('0xd5'))){_0x21d1d6['limit']=qs[_0x632b('0x25')](_0x12b1ff[_0x632b('0x49')][_0x632b('0x25')]);_0x21d1d6['offset']=qs['offset'](_0x12b1ff[_0x632b('0x49')][_0x632b('0x22')]);}return _0x5a982a['getContacts'](_0x21d1d6);}})[_0x632b('0x14')](function(_0x3bbc40){if(_0x3bbc40){return _0x3bbc40?{'count':_0x5d563c,'rows':_0x3bbc40}:null;}})[_0x632b('0x14')](respondWithResult(_0x1b9948,null))[_0x632b('0x1d')](handleError(_0x1b9948,null));};exports[_0x632b('0xd6')]=function(_0x19e134,_0xc264f5){var _0x13ed57;var _0x54fce9;var _0x5a4b8c={};var _0xf7ca7b;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x19e134['params']['id']},'attributes':['id','name','role']})[_0x632b('0x14')](handleEntityNotFound(_0xc264f5,null))['then'](function(_0x509dff){if(!utils[_0x632b('0x9a')](_0x19e134[_0x632b('0x49')]['channel'])){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))]('Unknown\x20channel');}_0x13ed57=_0x509dff;var _0x1050e5={};_0x1050e5[_0x632b('0x55')]=_[_0x632b('0x57')](db[_[_0x632b('0x9f')](_0x19e134['query']['channel'])+_0x632b('0xd7')]['rawAttributes']);_0x1050e5['query']=_[_0x632b('0x57')](_0x19e134[_0x632b('0x49')]);_0x1050e5[_0x632b('0x58')]=_[_0x632b('0x59')](_0x1050e5[_0x632b('0x55')],_0x1050e5[_0x632b('0x49')]);_0x5a4b8c[_0x632b('0x45')]=_[_0x632b('0x59')](_0x1050e5[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x19e134['query'][_0x632b('0x5a')]));_0x5a4b8c[_0x632b('0x45')]=_0x5a4b8c['attributes'][_0x632b('0x4c')]?_0x5a4b8c['attributes']:_0x1050e5[_0x632b('0x55')];_0x5a4b8c[_0x632b('0xca')]=qs['sort'](_0x19e134[_0x632b('0x49')][_0x632b('0xcb')]);_0x5a4b8c['where']=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x19e134[_0x632b('0x49')],_0x1050e5[_0x632b('0x58')]));if(_0x19e134['query'][_0x632b('0x3f')]){_0x5a4b8c[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x5a4b8c['where'],{'$or':_[_0x632b('0x34')](_0x5a4b8c[_0x632b('0x45')],function(_0x5a157a){var _0xa8e5e0={};_0xa8e5e0[_0x5a157a]={'$like':'%'+_0x19e134['query'][_0x632b('0x3f')]+'%'};return _0xa8e5e0;})});}_0x5a4b8c=_[_0x632b('0x5b')]({},_0x5a4b8c,_0x19e134[_0x632b('0xd8')]);switch(_0x13ed57[_0x632b('0x2b')]){case'admin':return db[_[_0x632b('0x9f')](_0x19e134[_0x632b('0x49')][_0x632b('0xa9')])+'Queue']['findAll'](_0x5a4b8c);case _0x632b('0x2e'):case'agent':return _0x13ed57[_0x632b('0x2a')+_['capitalize'](_0x19e134[_0x632b('0x49')][_0x632b('0xa9')])+_0x632b('0x9c')](_0x5a4b8c);default:throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0xd9'));}})['then'](function(_0x5998a6){_0xf7ca7b=_0x5998a6[_0x632b('0x4c')];if(!_0x19e134[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x5a4b8c['limit']=qs['limit'](_0x19e134[_0x632b('0x49')][_0x632b('0x25')]);_0x5a4b8c[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x19e134[_0x632b('0x49')][_0x632b('0x22')]);}switch(_0x13ed57[_0x632b('0x2b')]){case'admin':return db[_[_0x632b('0x9f')](_0x19e134[_0x632b('0x49')]['channel'])+_0x632b('0xd7')]['findAll'](_0x5a4b8c);case'user':case _0x632b('0x30'):return _0x13ed57['get'+_[_0x632b('0x9f')](_0x19e134[_0x632b('0x49')][_0x632b('0xa9')])+_0x632b('0x9c')](_0x5a4b8c);}})[_0x632b('0x14')](function(_0x5ae310){return{'count':_0xf7ca7b,'rows':_0x5ae310};})['then'](respondWithResult(_0xc264f5,null))[_0x632b('0x1d')](handleError(_0xc264f5,null));};exports[_0x632b('0xda')]=function(_0x399cc1,_0xb7a331){var _0x49b10a={};var _0x4c8751={};var _0x2dddd6;var _0x2b0b41;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x399cc1[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xb7a331,null))['then'](function(_0x3e638b){if(_0x3e638b){_0x2dddd6=_0x3e638b;_0x4c8751[_0x632b('0x55')]=_['keys'](db['UserVoiceQueueRt'][_0x632b('0x3b')]);_0x4c8751[_0x632b('0x49')]=_['keys'](_0x399cc1[_0x632b('0x49')]);_0x4c8751['filters']=_[_0x632b('0x59')](_0x4c8751[_0x632b('0x55')],_0x4c8751[_0x632b('0x49')]);_0x49b10a[_0x632b('0x45')]=_[_0x632b('0x59')](_0x4c8751[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x399cc1[_0x632b('0x49')][_0x632b('0x5a')]));_0x49b10a[_0x632b('0x45')]=_0x49b10a[_0x632b('0x45')][_0x632b('0x4c')]?_0x49b10a[_0x632b('0x45')]:_0x4c8751[_0x632b('0x55')];_0x49b10a['order']=qs[_0x632b('0xcb')](_0x399cc1[_0x632b('0x49')][_0x632b('0xcb')]);_0x49b10a[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x399cc1[_0x632b('0x49')],_0x4c8751['filters']));if(_0x399cc1[_0x632b('0x49')][_0x632b('0x3f')]){_0x49b10a['where']=_[_0x632b('0x5b')](_0x49b10a[_0x632b('0xcc')],{'$or':_['map'](_0x49b10a[_0x632b('0x45')],function(_0x1215a5){var _0x2ab724={};_0x2ab724[_0x1215a5]={'$like':'%'+_0x399cc1[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x2ab724;})});}_0x49b10a=_[_0x632b('0x5b')]({},_0x49b10a,_0x399cc1[_0x632b('0xd8')]);return _0x2dddd6[_0x632b('0xda')](_0x49b10a);}})[_0x632b('0x14')](function(_0x3f1040){if(_0x3f1040){_0x2b0b41=_0x3f1040[_0x632b('0x4c')];if(!_0x399cc1[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x49b10a[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x399cc1[_0x632b('0x49')][_0x632b('0x25')]);_0x49b10a[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x399cc1[_0x632b('0x49')][_0x632b('0x22')]);}return _0x2dddd6['getVoiceQueuesRt'](_0x49b10a);}})[_0x632b('0x14')](function(_0x275c3d){if(_0x275c3d){return _0x275c3d?{'count':_0x2b0b41,'rows':_0x275c3d}:null;}})[_0x632b('0x14')](respondWithResult(_0xb7a331,null))[_0x632b('0x1d')](handleError(_0xb7a331,null));};exports[_0x632b('0xdb')]=function(_0x51ddc3,_0xd0a72){var _0x30c6aa={};var _0x4f4b2={};var _0x46be1c;var _0x37793d;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x51ddc3[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xd0a72,null))[_0x632b('0x14')](function(_0x177256){if(_0x177256){_0x46be1c=_0x177256;_0x4f4b2[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xdc')][_0x632b('0x3b')]);_0x4f4b2[_0x632b('0x49')]=_[_0x632b('0x57')](_0x51ddc3['query']);_0x4f4b2[_0x632b('0x58')]=_['intersection'](_0x4f4b2[_0x632b('0x55')],_0x4f4b2[_0x632b('0x49')]);_0x30c6aa[_0x632b('0x45')]=_[_0x632b('0x59')](_0x4f4b2[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x51ddc3[_0x632b('0x49')][_0x632b('0x5a')]));_0x30c6aa[_0x632b('0x45')]=_0x30c6aa['attributes'][_0x632b('0x4c')]?_0x30c6aa[_0x632b('0x45')]:_0x4f4b2[_0x632b('0x55')];_0x30c6aa['order']=qs[_0x632b('0xcb')](_0x51ddc3[_0x632b('0x49')][_0x632b('0xcb')]);_0x30c6aa['where']=qs['filters'](_[_0x632b('0xcd')](_0x51ddc3['query'],_0x4f4b2['filters']));if(_0x51ddc3['query'][_0x632b('0x3f')]){_0x30c6aa['where']=_[_0x632b('0x5b')](_0x30c6aa[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x30c6aa[_0x632b('0x45')],function(_0x17e9ea){var _0x845749={};_0x845749[_0x17e9ea]={'$like':'%'+_0x51ddc3[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x845749;})});}_0x30c6aa=_[_0x632b('0x5b')]({},_0x30c6aa,_0x51ddc3[_0x632b('0xd8')]);return _0x46be1c['getGroups'](_0x30c6aa);}})[_0x632b('0x14')](function(_0x2cfc22){if(_0x2cfc22){_0x37793d=_0x2cfc22['length'];if(!_0x51ddc3[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x30c6aa['limit']=qs[_0x632b('0x25')](_0x51ddc3[_0x632b('0x49')][_0x632b('0x25')]);_0x30c6aa[_0x632b('0x22')]=qs['offset'](_0x51ddc3[_0x632b('0x49')][_0x632b('0x22')]);}return _0x46be1c[_0x632b('0xdb')](_0x30c6aa);}})[_0x632b('0x14')](function(_0x319933){if(_0x319933){return _0x319933?{'count':_0x37793d,'rows':_0x319933}:null;}})[_0x632b('0x14')](respondWithResult(_0xd0a72,null))[_0x632b('0x1d')](handleError(_0xd0a72,null));};exports[_0x632b('0xdd')]=function(_0x41e142,_0x1e45a0){var _0x33125c={'raw':!![],'where':{}};var _0x5dc400={};var _0x480393={'count':0x0,'rows':[]};return db['User'][_0x632b('0xc8')]({'where':{'id':_0x41e142[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x1e45a0,null))[_0x632b('0x14')](function(_0x2ca1a1){if(_0x2ca1a1){_0x5dc400['model']=_[_0x632b('0x57')](db['VoiceRecording'][_0x632b('0x3b')]);_0x5dc400[_0x632b('0x49')]=_[_0x632b('0x57')](_0x41e142['query']);_0x5dc400[_0x632b('0x58')]=_[_0x632b('0x59')](_0x5dc400[_0x632b('0x55')],_0x5dc400[_0x632b('0x49')]);_0x33125c[_0x632b('0x45')]=_['intersection'](_0x5dc400[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x41e142['query'][_0x632b('0x5a')]));_0x33125c[_0x632b('0x45')]=_0x33125c[_0x632b('0x45')][_0x632b('0x4c')]?_0x33125c[_0x632b('0x45')]:_0x5dc400['model'];if(!_0x41e142['query'][_0x632b('0xce')](_0x632b('0xd5'))){_0x33125c[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x41e142[_0x632b('0x49')][_0x632b('0x25')]);_0x33125c['offset']=qs[_0x632b('0x22')](_0x41e142[_0x632b('0x49')][_0x632b('0x22')]);}_0x33125c['order']=qs[_0x632b('0xcb')](_0x41e142[_0x632b('0x49')][_0x632b('0xcb')]);_0x33125c['where']=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x41e142[_0x632b('0x49')],_0x5dc400['filters']));_0x33125c[_0x632b('0xcc')][_0x632b('0xde')]=_0x2ca1a1['id'];if(_0x41e142[_0x632b('0x49')][_0x632b('0x3f')]){_0x33125c[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x33125c['where'],{'$or':_[_0x632b('0x34')](_0x33125c[_0x632b('0x45')],function(_0x201284){var _0x3303c8={};_0x3303c8[_0x201284]={'$like':'%'+_0x41e142[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x3303c8;})});}_0x33125c=_[_0x632b('0x5b')]({},_0x33125c,_0x41e142[_0x632b('0xd8')]);return db[_0x632b('0xdf')]['count']({'where':_0x33125c[_0x632b('0xcc')]})['then'](function(_0x387deb){_0x480393[_0x632b('0x24')]=_0x387deb;if(_0x41e142[_0x632b('0x49')]['includeAll']){_0x33125c['include']=[{'all':!![]}];}return db[_0x632b('0xdf')][_0x632b('0x47')](_0x33125c);})[_0x632b('0x14')](function(_0xd7278){_0x480393[_0x632b('0x48')]=_0xd7278;return _0x480393;});}})[_0x632b('0x14')](respondWithFilteredResult(_0x1e45a0,_0x33125c))['catch'](handleError(_0x1e45a0,null));};exports['getScreenRecordings']=function(_0x26c459,_0x9af446){var _0x304878={'raw':!![],'where':{}};var _0x28f3fa={};var _0x47bc1e={'count':0x0,'rows':[]};return db[_0x632b('0x3a')]['findOne']({'where':{'id':_0x26c459['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x9af446,null))[_0x632b('0x14')](function(_0x3d31ef){if(_0x3d31ef){_0x28f3fa[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xe0')]['rawAttributes']);_0x28f3fa['query']=_[_0x632b('0x57')](_0x26c459[_0x632b('0x49')]);_0x28f3fa[_0x632b('0x58')]=_[_0x632b('0x59')](_0x28f3fa[_0x632b('0x55')],_0x28f3fa[_0x632b('0x49')]);_0x304878['attributes']=_[_0x632b('0x59')](_0x28f3fa[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x26c459[_0x632b('0x49')]['fields']));_0x304878['attributes']=_0x304878[_0x632b('0x45')][_0x632b('0x4c')]?_0x304878[_0x632b('0x45')]:_0x28f3fa[_0x632b('0x55')];if(!_0x26c459[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x304878[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x26c459['query']['limit']);_0x304878['offset']=qs[_0x632b('0x22')](_0x26c459[_0x632b('0x49')]['offset']);}_0x304878[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x26c459[_0x632b('0x49')][_0x632b('0xcb')]);_0x304878[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x26c459[_0x632b('0x49')],_0x28f3fa[_0x632b('0x58')]));_0x304878[_0x632b('0xcc')][_0x632b('0xde')]=_0x3d31ef['id'];if(_0x26c459[_0x632b('0x49')][_0x632b('0x3f')]){_0x304878[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x304878[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x304878[_0x632b('0x45')],function(_0x48dab0){var _0x537012={};_0x537012[_0x48dab0]={'$like':'%'+_0x26c459[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x537012;})});}_0x304878=_[_0x632b('0x5b')]({},_0x304878,_0x26c459[_0x632b('0xd8')]);return db[_0x632b('0xe0')][_0x632b('0x24')]({'where':_0x304878[_0x632b('0xcc')]})['then'](function(_0xa8ec8a){_0x47bc1e[_0x632b('0x24')]=_0xa8ec8a;if(_0x26c459[_0x632b('0x49')][_0x632b('0x43')]){_0x304878[_0x632b('0x44')]=[{'all':!![]}];}return db[_0x632b('0xe0')][_0x632b('0x47')](_0x304878);})[_0x632b('0x14')](function(_0x48b650){_0x47bc1e[_0x632b('0x48')]=_0x48b650;return _0x47bc1e;});}})[_0x632b('0x14')](respondWithFilteredResult(_0x9af446,_0x304878))[_0x632b('0x1d')](handleError(_0x9af446,null));};exports[_0x632b('0xe1')]=function(_0xc9f853,_0x4c4259){var _0x4e9323={};var _0x302102={};var _0xc4d3dc;var _0x3dd738;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0xc9f853[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x4c4259,null))[_0x632b('0x14')](function(_0x4976d9){if(_0x4976d9){_0xc4d3dc=_0x4976d9;_0x302102[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xe2')][_0x632b('0x3b')]);_0x302102[_0x632b('0x49')]=_[_0x632b('0x57')](_0xc9f853[_0x632b('0x49')]);_0x302102[_0x632b('0x58')]=_['intersection'](_0x302102['model'],_0x302102[_0x632b('0x49')]);_0x4e9323['attributes']=_['intersection'](_0x302102[_0x632b('0x55')],qs[_0x632b('0x5a')](_0xc9f853[_0x632b('0x49')]['fields']));_0x4e9323[_0x632b('0x45')]=_0x4e9323[_0x632b('0x45')][_0x632b('0x4c')]?_0x4e9323[_0x632b('0x45')]:_0x302102['model'];_0x4e9323[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0xc9f853[_0x632b('0x49')][_0x632b('0xcb')]);_0x4e9323['where']=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0xc9f853[_0x632b('0x49')],_0x302102[_0x632b('0x58')]));if(_0xc9f853[_0x632b('0x49')][_0x632b('0x3f')]){_0x4e9323['where']=_[_0x632b('0x5b')](_0x4e9323['where'],{'$or':_[_0x632b('0x34')](_0x4e9323[_0x632b('0x45')],function(_0x4d7b11){var _0x248d87={};_0x248d87[_0x4d7b11]={'$like':'%'+_0xc9f853[_0x632b('0x49')]['filter']+'%'};return _0x248d87;})});}_0x4e9323=_[_0x632b('0x5b')]({},_0x4e9323,_0xc9f853[_0x632b('0xd8')]);return _0xc4d3dc[_0x632b('0xe1')](_0x4e9323);}})[_0x632b('0x14')](function(_0x3cb38f){if(_0x3cb38f){_0x3dd738=_0x3cb38f[_0x632b('0x4c')];if(!_0xc9f853[_0x632b('0x49')]['hasOwnProperty'](_0x632b('0xd5'))){_0x4e9323[_0x632b('0x25')]=qs['limit'](_0xc9f853['query'][_0x632b('0x25')]);_0x4e9323[_0x632b('0x22')]=qs[_0x632b('0x22')](_0xc9f853['query'][_0x632b('0x22')]);}return _0xc4d3dc[_0x632b('0xe1')](_0x4e9323);}})[_0x632b('0x14')](function(_0x4a4aa2){if(_0x4a4aa2){return _0x4a4aa2?{'count':_0x3dd738,'rows':_0x4a4aa2}:null;}})['then'](respondWithResult(_0x4c4259,null))[_0x632b('0x1d')](handleError(_0x4c4259,null));};exports[_0x632b('0xe3')]=function(_0x1f0174,_0x47072e){var _0x4268b9={};var _0x43feb9={};var _0x1caf31;var _0x423aeb;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x1f0174[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x47072e,null))[_0x632b('0x14')](function(_0x4591ed){if(_0x4591ed){_0x1caf31=_0x4591ed;_0x43feb9[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xe4')][_0x632b('0x3b')]);_0x43feb9[_0x632b('0x49')]=_[_0x632b('0x57')](_0x1f0174[_0x632b('0x49')]);_0x43feb9[_0x632b('0x58')]=_[_0x632b('0x59')](_0x43feb9[_0x632b('0x55')],_0x43feb9[_0x632b('0x49')]);_0x4268b9[_0x632b('0x45')]=_[_0x632b('0x59')](_0x43feb9['model'],qs['fields'](_0x1f0174[_0x632b('0x49')]['fields']));_0x4268b9[_0x632b('0x45')]=_0x4268b9[_0x632b('0x45')][_0x632b('0x4c')]?_0x4268b9['attributes']:_0x43feb9[_0x632b('0x55')];_0x4268b9[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x1f0174[_0x632b('0x49')]['sort']);_0x4268b9[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x1f0174[_0x632b('0x49')],_0x43feb9[_0x632b('0x58')]));if(_0x1f0174[_0x632b('0x49')]['filter']){_0x4268b9[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x4268b9[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x4268b9[_0x632b('0x45')],function(_0x5af5c5){var _0x198ece={};_0x198ece[_0x5af5c5]={'$like':'%'+_0x1f0174[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x198ece;})});}_0x4268b9=_[_0x632b('0x5b')]({},_0x4268b9,_0x1f0174[_0x632b('0xd8')]);return _0x1caf31[_0x632b('0xe3')](_0x4268b9);}})[_0x632b('0x14')](function(_0x129842){if(_0x129842){_0x423aeb=_0x129842['length'];if(!_0x1f0174[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x4268b9['limit']=qs[_0x632b('0x25')](_0x1f0174['query']['limit']);_0x4268b9[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x1f0174[_0x632b('0x49')][_0x632b('0x22')]);}return _0x1caf31[_0x632b('0xe3')](_0x4268b9);}})[_0x632b('0x14')](function(_0x4c810a){if(_0x4c810a){return _0x4c810a?{'count':_0x423aeb,'rows':_0x4c810a}:null;}})[_0x632b('0x14')](respondWithResult(_0x47072e,null))[_0x632b('0x1d')](handleError(_0x47072e,null));};exports[_0x632b('0xe5')]=function(_0x475341,_0x4d7a81){var _0x5d2437={'raw':!![],'where':{}};var _0x378300={};var _0x3dc39d={'count':0x0,'rows':[]};return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x475341['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x4d7a81,null))[_0x632b('0x14')](function(_0x5bb77e){if(_0x5bb77e){_0x378300['model']=_[_0x632b('0x57')](db[_0x632b('0xe6')]['rawAttributes']);_0x378300['query']=_[_0x632b('0x57')](_0x475341[_0x632b('0x49')]);_0x378300[_0x632b('0x58')]=_[_0x632b('0x59')](_0x378300[_0x632b('0x55')],_0x378300['query']);_0x5d2437[_0x632b('0x45')]=_[_0x632b('0x59')](_0x378300[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x475341[_0x632b('0x49')][_0x632b('0x5a')]));_0x5d2437[_0x632b('0x45')]=_0x5d2437[_0x632b('0x45')][_0x632b('0x4c')]?_0x5d2437[_0x632b('0x45')]:_0x378300[_0x632b('0x55')];if(!_0x475341['query'][_0x632b('0xce')](_0x632b('0xd5'))){_0x5d2437[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x475341[_0x632b('0x49')]['limit']);_0x5d2437[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x475341[_0x632b('0x49')][_0x632b('0x22')]);}_0x5d2437[_0x632b('0xca')]=qs['sort'](_0x475341[_0x632b('0x49')][_0x632b('0xcb')]);_0x5d2437[_0x632b('0xcc')]=qs['filters'](_[_0x632b('0xcd')](_0x475341[_0x632b('0x49')],_0x378300[_0x632b('0x58')]));_0x5d2437['where']['UserId']=_0x5bb77e['id'];if(_0x475341[_0x632b('0x49')][_0x632b('0x3f')]){_0x5d2437[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x5d2437['where'],{'$or':_[_0x632b('0x34')](_0x5d2437[_0x632b('0x45')],function(_0x2764b7){var _0x5950ee={};_0x5950ee[_0x2764b7]={'$like':'%'+_0x475341[_0x632b('0x49')]['filter']+'%'};return _0x5950ee;})});}_0x5d2437=_['merge']({},_0x5d2437,_0x475341[_0x632b('0xd8')]);return db[_0x632b('0xe6')][_0x632b('0x24')]({'where':_0x5d2437[_0x632b('0xcc')]})[_0x632b('0x14')](function(_0xc27d6){_0x3dc39d['count']=_0xc27d6;if(_0x475341[_0x632b('0x49')][_0x632b('0x43')]){_0x5d2437['include']=[{'all':!![]}];}return db[_0x632b('0xe6')][_0x632b('0x47')](_0x5d2437);})['then'](function(_0x3c168e){_0x3dc39d[_0x632b('0x48')]=_0x3c168e;return _0x3dc39d;});}})[_0x632b('0x14')](respondWithFilteredResult(_0x4d7a81,_0x5d2437))[_0x632b('0x1d')](handleError(_0x4d7a81,null));};exports['getSmsInteractions']=function(_0x3fb750,_0x4443a3){var _0x4e03e5={};var _0x5a9b56={};var _0x5f146e;var _0x13867e;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x3fb750[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x4443a3,null))[_0x632b('0x14')](function(_0x133285){if(_0x133285){_0x5f146e=_0x133285;_0x5a9b56[_0x632b('0x55')]=_[_0x632b('0x57')](db['SmsInteraction']['rawAttributes']);_0x5a9b56[_0x632b('0x49')]=_[_0x632b('0x57')](_0x3fb750[_0x632b('0x49')]);_0x5a9b56[_0x632b('0x58')]=_['intersection'](_0x5a9b56[_0x632b('0x55')],_0x5a9b56[_0x632b('0x49')]);_0x4e03e5[_0x632b('0x45')]=_[_0x632b('0x59')](_0x5a9b56[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x3fb750['query'][_0x632b('0x5a')]));_0x4e03e5[_0x632b('0x45')]=_0x4e03e5[_0x632b('0x45')]['length']?_0x4e03e5[_0x632b('0x45')]:_0x5a9b56[_0x632b('0x55')];_0x4e03e5[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x3fb750['query'][_0x632b('0xcb')]);_0x4e03e5[_0x632b('0xcc')]=qs['filters'](_[_0x632b('0xcd')](_0x3fb750[_0x632b('0x49')],_0x5a9b56[_0x632b('0x58')]));if(_0x3fb750[_0x632b('0x49')][_0x632b('0x3f')]){_0x4e03e5['where']=_['merge'](_0x4e03e5[_0x632b('0xcc')],{'$or':_['map'](_0x4e03e5['attributes'],function(_0x5b8e7f){var _0x150b19={};_0x150b19[_0x5b8e7f]={'$like':'%'+_0x3fb750[_0x632b('0x49')]['filter']+'%'};return _0x150b19;})});}_0x4e03e5=_[_0x632b('0x5b')]({},_0x4e03e5,_0x3fb750[_0x632b('0xd8')]);return _0x5f146e[_0x632b('0xe7')](_0x4e03e5);}})[_0x632b('0x14')](function(_0x2b3ba7){if(_0x2b3ba7){_0x13867e=_0x2b3ba7['length'];if(!_0x3fb750[_0x632b('0x49')]['hasOwnProperty'](_0x632b('0xd5'))){_0x4e03e5[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x3fb750['query']['limit']);_0x4e03e5[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x3fb750[_0x632b('0x49')][_0x632b('0x22')]);}return _0x5f146e['getSmsInteractions'](_0x4e03e5);}})[_0x632b('0x14')](function(_0x472c84){if(_0x472c84){return _0x472c84?{'count':_0x13867e,'rows':_0x472c84}:null;}})[_0x632b('0x14')](respondWithResult(_0x4443a3,null))['catch'](handleError(_0x4443a3,null));};exports['getFaxInteractions']=function(_0x422b7c,_0x5afaa4){var _0x174374={};var _0x128fa2={};var _0x40b903;var _0x555fe8;return db['User'][_0x632b('0xc8')]({'where':{'id':_0x422b7c[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x5afaa4,null))[_0x632b('0x14')](function(_0x5638d7){if(_0x5638d7){_0x40b903=_0x5638d7;_0x128fa2[_0x632b('0x55')]=_['keys'](db[_0x632b('0xe8')]['rawAttributes']);_0x128fa2[_0x632b('0x49')]=_['keys'](_0x422b7c[_0x632b('0x49')]);_0x128fa2['filters']=_['intersection'](_0x128fa2[_0x632b('0x55')],_0x128fa2[_0x632b('0x49')]);_0x174374[_0x632b('0x45')]=_[_0x632b('0x59')](_0x128fa2['model'],qs[_0x632b('0x5a')](_0x422b7c['query'][_0x632b('0x5a')]));_0x174374['attributes']=_0x174374[_0x632b('0x45')][_0x632b('0x4c')]?_0x174374[_0x632b('0x45')]:_0x128fa2[_0x632b('0x55')];_0x174374[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x422b7c[_0x632b('0x49')][_0x632b('0xcb')]);_0x174374[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x422b7c[_0x632b('0x49')],_0x128fa2[_0x632b('0x58')]));if(_0x422b7c[_0x632b('0x49')]['filter']){_0x174374[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x174374[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x174374[_0x632b('0x45')],function(_0x17d5fc){var _0x37410c={};_0x37410c[_0x17d5fc]={'$like':'%'+_0x422b7c[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x37410c;})});}_0x174374=_[_0x632b('0x5b')]({},_0x174374,_0x422b7c[_0x632b('0xd8')]);return _0x40b903[_0x632b('0xe9')](_0x174374);}})[_0x632b('0x14')](function(_0x822136){if(_0x822136){_0x555fe8=_0x822136['length'];if(!_0x422b7c[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x174374[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x422b7c[_0x632b('0x49')][_0x632b('0x25')]);_0x174374['offset']=qs[_0x632b('0x22')](_0x422b7c[_0x632b('0x49')]['offset']);}return _0x40b903[_0x632b('0xe9')](_0x174374);}})[_0x632b('0x14')](function(_0x3260b1){if(_0x3260b1){return _0x3260b1?{'count':_0x555fe8,'rows':_0x3260b1}:null;}})[_0x632b('0x14')](respondWithResult(_0x5afaa4,null))[_0x632b('0x1d')](handleError(_0x5afaa4,null));};exports[_0x632b('0xea')]=function(_0x3afc2a,_0x24732a){var _0x572561={};var _0x33f29f={};var _0x529160;var _0x2f05c0;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x3afc2a['params']['id']}})['then'](handleEntityNotFound(_0x24732a,null))[_0x632b('0x14')](function(_0x36b0ff){if(_0x36b0ff){_0x529160=_0x36b0ff;_0x33f29f[_0x632b('0x55')]=_['keys'](db[_0x632b('0xeb')]['rawAttributes']);_0x33f29f[_0x632b('0x49')]=_[_0x632b('0x57')](_0x3afc2a[_0x632b('0x49')]);_0x33f29f[_0x632b('0x58')]=_[_0x632b('0x59')](_0x33f29f['model'],_0x33f29f[_0x632b('0x49')]);_0x572561[_0x632b('0x45')]=_['intersection'](_0x33f29f[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x3afc2a[_0x632b('0x49')][_0x632b('0x5a')]));_0x572561[_0x632b('0x45')]=_0x572561[_0x632b('0x45')][_0x632b('0x4c')]?_0x572561[_0x632b('0x45')]:_0x33f29f[_0x632b('0x55')];_0x572561[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x3afc2a[_0x632b('0x49')]['sort']);_0x572561['where']=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x3afc2a[_0x632b('0x49')],_0x33f29f[_0x632b('0x58')]));if(_0x3afc2a[_0x632b('0x49')]['filter']){_0x572561[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x572561[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x572561[_0x632b('0x45')],function(_0x4d4413){var _0x4b1bc7={};_0x4b1bc7[_0x4d4413]={'$like':'%'+_0x3afc2a[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x4b1bc7;})});}_0x572561=_[_0x632b('0x5b')]({},_0x572561,_0x3afc2a[_0x632b('0xd8')]);return _0x529160[_0x632b('0xea')](_0x572561);}})[_0x632b('0x14')](function(_0x2e4ac5){if(_0x2e4ac5){_0x2f05c0=_0x2e4ac5[_0x632b('0x4c')];if(!_0x3afc2a[_0x632b('0x49')][_0x632b('0xce')]('nolimit')){_0x572561[_0x632b('0x25')]=qs['limit'](_0x3afc2a[_0x632b('0x49')][_0x632b('0x25')]);_0x572561[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x3afc2a[_0x632b('0x49')]['offset']);}return _0x529160[_0x632b('0xea')](_0x572561);}})[_0x632b('0x14')](function(_0x50f84d){if(_0x50f84d){return _0x50f84d?{'count':_0x2f05c0,'rows':_0x50f84d}:null;}})[_0x632b('0x14')](respondWithResult(_0x24732a,null))[_0x632b('0x1d')](handleError(_0x24732a,null));};exports[_0x632b('0xec')]=function(_0x3d4b68,_0x1f90fb,_0x5294d3){var _0x26130c;var _0x2c5d16;var _0x41cc52;var _0x1a3709=!_['isNil'](_0x3d4b68['params']['id'])?_0x3d4b68[_0x632b('0x54')]['id']:!_[_0x632b('0x66')](_0x3d4b68[_0x632b('0x2e')]['id'])?_0x3d4b68[_0x632b('0x2e')]['id']:null;return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x1a3709,'role':{'$or':[_0x632b('0x2c'),_0x632b('0x2e'),'agent']}},'attributes':['id',_0x632b('0x37'),'phone',_0x632b('0xed'),'role',_0x632b('0x60'),_0x632b('0x97')]})['then'](function(_0x230e7e){if(_0x230e7e){if(_0x230e7e['role']===_0x632b('0x30')){_0x26130c=_0x230e7e;if(_0x3d4b68[_0x632b('0x5c')][_0x632b('0x99')]){_0x41cc52=util[_0x632b('0xa5')]('LOCAL/%s@from-sip/n',_0x26130c[_0x3d4b68[_0x632b('0x5c')][_0x632b('0x99')]]);}else if(_0x3d4b68[_0x632b('0x5c')][_0x632b('0xee')]){_0x41cc52=util[_0x632b('0xa5')](_0x632b('0xef'),_0x3d4b68[_0x632b('0x5c')][_0x632b('0xee')]);}else{_0x41cc52=util[_0x632b('0xa5')]('SIP/%s',_0x26130c[_0x632b('0x37')]);}socket['to'](util[_0x632b('0xa5')](_0x632b('0xf0'),_0x26130c['name']))[_0x632b('0xa1')](_0x632b('0xf1'),{'user':{'id':_0x26130c['id'],'name':_0x26130c[_0x632b('0x37')]},'ip':_0x3d4b68[_0x632b('0xf2')]['x-forwarded-for']||_0x3d4b68[_0x632b('0xf3')][_0x632b('0xf4')]||_0x3d4b68['socket'][_0x632b('0xf4')]||_0x3d4b68[_0x632b('0xf3')][_0x632b('0xf5')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x632b('0x29')]({'where':{'membername':_0x26130c[_0x632b('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0xf6'));}})[_0x632b('0x14')](function(){if(_0x26130c){return _0x26130c[_0x632b('0xf7')]({'raw':!![]});}})[_0x632b('0x14')](function(_0xb249d0){if(_0x26130c){var _0x46138a=[];if(_0xb249d0){_0x2c5d16=_0xb249d0;if(_0x2c5d16[_0x632b('0x4c')]){for(var _0x1de302=0x0;_0x1de302<_0x2c5d16[_0x632b('0x4c')];_0x1de302++){_0x46138a[_0x632b('0x46')]({'membername':_0x26130c[_0x632b('0x37')],'UserId':_0x26130c['id'],'queue_name':_0x2c5d16[_0x1de302][_0x632b('0x37')],'VoiceQueueId':_0x2c5d16[_0x1de302]['id'],'interface':_0x41cc52,'paused':_0x26130c['loginInPause']||![],'penalty':_0x2c5d16[_0x1de302]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x46138a,function(_0x37937c){return db['UserVoiceQueueRt']['upsert'](_0x37937c);});}}}})[_0x632b('0x14')](function(){if(_0x26130c){return db[_0x632b('0xf8')][_0x632b('0x47')]({'where':{'membername':_0x26130c[_0x632b('0x37')],'exitAt':null}});}})['then'](function(_0x3b67a8){if(_0x26130c){var _0x4cc09d=[];_0x3b67a8[_0x632b('0xf9')](function(_0xcde22){_0x4cc09d[_0x632b('0x46')](_0xcde22[_0x632b('0x28')]({'exitAt':moment()[_0x632b('0xa5')](_0x632b('0xfa'))}));});return BPromise[_0x632b('0x53')](_0x4cc09d);}})['then'](function(){if(_0x26130c){var _0x481699=[];var _0x24a733=[];var _0x2e194e=utils[_0x632b('0xfb')]();var _0x2c4c0d={'membername':_0x26130c[_0x632b('0x37')],'interface':_0x41cc52,'enterAt':moment()[_0x632b('0xa5')](_0x632b('0xfa')),'role':_0x26130c[_0x632b('0x2b')],'internal':_0x26130c[_0x632b('0x60')]};_0x2e194e['forEach'](function(_0x25a8f8){_0x481699['push'](_[_0x632b('0x5b')]({'channel':_0x25a8f8,'type':_0x632b('0xfc'),'data1':_0x3d4b68[_0x632b('0x5c')][_0x632b('0xfd')],'data2':_0x41cc52},_0x2c4c0d));if(_0x26130c['loginInPause']){_0x24a733[_0x632b('0x46')](_[_0x632b('0x5b')]({'channel':_0x25a8f8,'type':_0x632b('0xfe'),'data1':_0x632b('0xff')},_0x2c4c0d));}});return db[_0x632b('0xf8')][_0x632b('0x100')](_0x481699[_0x632b('0x101')](_0x24a733),{'individualHooks':!![]});}})[_0x632b('0x14')](function(){if(_0x26130c){return _0x26130c[_0x632b('0x28')]({'online':!![],'lastLoginAt':moment()[_0x632b('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x26130c['loginInPause']||![],'mailPause':_0x26130c[_0x632b('0x97')]||![],'chatPause':_0x26130c[_0x632b('0x97')]||![],'faxPause':_0x26130c[_0x632b('0x97')]||![],'smsPause':_0x26130c[_0x632b('0x97')]||![],'openchannelPause':_0x26130c[_0x632b('0x97')]||![],'whatsappPause':_0x26130c['loginInPause']||![],'pauseType':_0x26130c[_0x632b('0x97')]?_0x632b('0xff'):null,'interface':_0x41cc52,'lastPauseAt':moment()['format'](_0x632b('0xfa'))});}})[_0x632b('0x14')](function(_0x331997){if(_0x3d4b68[_0x632b('0x102')]){return _0x5294d3();}else{return BPromise[_0x632b('0x103')](_0x331997)[_0x632b('0x14')](respondWithResult(_0x1f90fb,null));}})[_0x632b('0x1d')](handleError(_0x1f90fb,null));};exports[_0x632b('0x104')]=function(_0x3fe8e6,_0x182fae){var _0x1ff80b;return db[_0x632b('0x3a')]['find']({'where':{'id':_0x3fe8e6[_0x632b('0x54')]['id'],'role':_0x632b('0x30')},'attributes':['id',_0x632b('0x37'),_0x632b('0x2b')]})[_0x632b('0x14')](handleEntityNotFound(_0x182fae,null))[_0x632b('0x14')](function(_0x352188){if(_0x352188){_0x1ff80b=_0x352188;return db['UserVoiceQueueRt'][_0x632b('0x29')]({'where':{'membername':_0x1ff80b['name']},'individualHooks':!![]});}})[_0x632b('0x14')](function(){return db[_0x632b('0xf8')][_0x632b('0x47')]({'where':{'membername':_0x1ff80b[_0x632b('0x37')],'exitAt':null}});})['then'](function(_0x13798b){var _0xb00d09=[];_0x13798b[_0x632b('0xf9')](function(_0x1da410){_0xb00d09[_0x632b('0x46')](_0x1da410[_0x632b('0x28')]({'exitAt':moment()[_0x632b('0xa5')](_0x632b('0xfa'))}));});return BPromise[_0x632b('0x53')](_0xb00d09);})[_0x632b('0x14')](function(){return _0x1ff80b[_0x632b('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x632b('0x14')](respondWithResult(_0x182fae,null))[_0x632b('0x1d')](handleError(_0x182fae,null));};exports[_0x632b('0x105')]=function(_0x5e282f,_0x4edd68){var _0x57e7f6;return db[_0x632b('0xa6')][_0x632b('0x28')]({'paused':0x1},{'where':{'UserId':_0x5e282f[_0x632b('0x54')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x5e282f[_0x632b('0x54')]['id'],'role':_0x632b('0x30')},'attributes':['id',_0x632b('0x37'),_0x632b('0x2b'),_0x632b('0x60'),_0x632b('0x99')]});})[_0x632b('0x14')](handleEntityNotFound(_0x4edd68,null))[_0x632b('0x14')](function(_0x17f868){if(_0x17f868){_0x57e7f6=_0x17f868;return respondWithRpcPromise('QueuePause','pause',{'id':_0x57e7f6['id'],'name':_0x57e7f6[_0x632b('0x37')],'pause':!![]});}})[_0x632b('0x14')](function(){if(_0x57e7f6){return db['MemberReport'][_0x632b('0x47')]({'where':{'membername':_0x57e7f6[_0x632b('0x37')],'type':'PAUSE','exitAt':null}});}})[_0x632b('0x14')](function(_0x303183){if(_0x303183['length']){var _0x4d9523=moment()[_0x632b('0xa5')](_0x632b('0xfa'));for(var _0x389921=0x0,_0x57be14=_0x303183['length'];_0x389921<_0x57be14;_0x389921++){_0x303183[_0x389921]['updateAttributes']({'exitAt':_0x4d9523});}}})[_0x632b('0x14')](function(){var _0x31e16a=[];var _0xc902a7=utils[_0x632b('0xfb')]();_0xc902a7[_0x632b('0xf9')](function(_0x420f32){_0x31e16a['push']({'channel':_0x420f32,'membername':_0x57e7f6[_0x632b('0x37')],'interface':_[_0x632b('0x66')](_0x57e7f6[_0x632b('0x99')])?util[_0x632b('0xa5')](_0x632b('0xef'),_0x57e7f6[_0x632b('0x37')]):_0x57e7f6[_0x632b('0x99')],'type':_0x632b('0xfe'),'enterAt':moment()[_0x632b('0xa5')](_0x632b('0xfa')),'data1':_0x5e282f[_0x632b('0x5c')]['type']||_0x632b('0x106'),'role':_0x57e7f6['role'],'internal':_0x57e7f6[_0x632b('0x60')]});});return db[_0x632b('0xf8')]['bulkCreate'](_0x31e16a,{'individualHooks':!![]});})[_0x632b('0x14')](function(){return _0x57e7f6[_0x632b('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5e282f['body'][_0x632b('0x3d')]||_0x632b('0x106'),'lastPauseAt':moment()[_0x632b('0xa5')](_0x632b('0xfa'))});})[_0x632b('0x14')](respondWithResult(_0x4edd68,null))['catch'](handleError(_0x4edd68,null));};exports[_0x632b('0x107')]=function(_0x573b3b,_0x392e1d){var _0x1ff662;return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x573b3b[_0x632b('0x54')]['id']},'attributes':['id','name',_0x632b('0x2b'),_0x632b('0x98'),_0x632b('0x108'),_0x632b('0x109'),_0x632b('0x10a'),_0x632b('0x10b'),_0x632b('0x10c'),'whatsapppause',_0x632b('0x10d'),_0x632b('0x10e')]})['then'](handleEntityNotFound(_0x392e1d,null))[_0x632b('0x14')](function(_0x462133){if(_0x462133){_0x1ff662=_0x462133;if(_0x573b3b[_0x632b('0x5c')][_0x632b('0xa9')]&&!utils['isValidChannel'](_0x573b3b[_0x632b('0x5c')][_0x632b('0xa9')])){throw new db[(_0x632b('0x8a'))][(_0x632b('0x8b'))](_0x632b('0xaa'));}switch(_0x573b3b[_0x632b('0x5c')]['channel']){case _0x632b('0xa3'):return respondWithRpcPromise(_0x632b('0x10f'),_0x632b('0x107'),{'id':_0x1ff662['id'],'name':_0x1ff662[_0x632b('0x37')],'pause':![]})[_0x632b('0x14')](function(){return db[_0x632b('0xa6')][_0x632b('0x28')]({'paused':0x0},{'where':{'UserId':_0x1ff662['id']},'individualHooks':!![]});})[_0x632b('0x14')](function(){return db['MemberReport'][_0x632b('0x36')]({'where':{'channel':_0x573b3b['body'][_0x632b('0xa9')],'membername':_0x1ff662['name'],'type':_0x632b('0xfe'),'exitAt':null}});})[_0x632b('0x14')](function(_0x4da1e2){if(_0x4da1e2){return _0x4da1e2[_0x632b('0x28')]({'exitAt':moment()[_0x632b('0xa5')](_0x632b('0xfa')),'data2':_0x632b('0x110')},{'individualHooks':!![]});}return null;})[_0x632b('0x14')](function(){return _0x1ff662[_0x632b('0x28')]({'voicePause':![]});});case'mail':case'chat':case _0x632b('0x50'):case _0x632b('0x4e'):case'whatsapp':case _0x632b('0x52'):return db['MemberReport'][_0x632b('0x36')]({'where':{'channel':_0x573b3b[_0x632b('0x5c')][_0x632b('0xa9')],'membername':_0x1ff662['name'],'type':_0x632b('0xfe'),'exitAt':null}})[_0x632b('0x14')](function(_0x2ec267){if(_0x2ec267){return _0x2ec267[_0x632b('0x28')]({'exitAt':moment()[_0x632b('0xa5')](_0x632b('0xfa')),'data2':_0x632b('0x110')},{'individualHooks':!![]});}return null;})[_0x632b('0x14')](function(){var _0x119a00={};_[_0x632b('0x26')](_0x119a00,util[_0x632b('0xa5')](_0x632b('0x111'),_0x573b3b[_0x632b('0x5c')][_0x632b('0xa9')],_0x632b('0x112')),![]);return _0x1ff662[_0x632b('0x28')](_0x119a00);});default:return respondWithRpcPromise(_0x632b('0x10f'),_0x632b('0x107'),{'id':_0x1ff662['id'],'name':_0x1ff662['name'],'pause':![]})[_0x632b('0x14')](function(){return db[_0x632b('0xa6')][_0x632b('0x28')]({'paused':0x0},{'where':{'UserId':_0x1ff662['id']}});})['then'](function(){return db[_0x632b('0xf8')][_0x632b('0x47')]({'where':{'membername':_0x1ff662[_0x632b('0x37')],'type':_0x632b('0xfe'),'exitAt':null}});})[_0x632b('0x14')](function(_0x8d4b71){var _0xe5efd3=[];_0x8d4b71[_0x632b('0xf9')](function(_0x4f3a22){_0xe5efd3[_0x632b('0x46')](_0x4f3a22[_0x632b('0x28')]({'exitAt':moment()[_0x632b('0xa5')](_0x632b('0xfa')),'data2':_0x632b('0x110')}));});return BPromise['all'](_0xe5efd3);})['then'](function(){return _0x1ff662[_0x632b('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x632b('0x14')](respondWithResult(_0x392e1d,null))['catch'](handleError(_0x392e1d,null));};exports[_0x632b('0x113')]=function(_0x26f681,_0x58595f){var _0x31fe66={};var _0x47f1b2={};var _0x2ae9ed;var _0x59966c;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x26f681[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x58595f,null))[_0x632b('0x14')](function(_0x3d602b){if(_0x3d602b){_0x2ae9ed=_0x3d602b;_0x47f1b2[_0x632b('0x55')]=_[_0x632b('0x57')](db['Team'][_0x632b('0x3b')]);_0x47f1b2[_0x632b('0x49')]=_[_0x632b('0x57')](_0x26f681[_0x632b('0x49')]);_0x47f1b2[_0x632b('0x58')]=_[_0x632b('0x59')](_0x47f1b2[_0x632b('0x55')],_0x47f1b2['query']);_0x31fe66[_0x632b('0x45')]=_[_0x632b('0x59')](_0x47f1b2[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x26f681['query'][_0x632b('0x5a')]));_0x31fe66[_0x632b('0x45')]=_0x31fe66[_0x632b('0x45')]['length']?_0x31fe66['attributes']:_0x47f1b2['model'];_0x31fe66[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x26f681[_0x632b('0x49')][_0x632b('0xcb')]);_0x31fe66[_0x632b('0xcc')]=qs[_0x632b('0x58')](_['pick'](_0x26f681[_0x632b('0x49')],_0x47f1b2[_0x632b('0x58')]));if(_0x26f681[_0x632b('0x49')][_0x632b('0x3f')]){_0x31fe66[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x31fe66['where'],{'$or':_['map'](_0x31fe66['attributes'],function(_0x163845){var _0x32492c={};_0x32492c[_0x163845]={'$like':'%'+_0x26f681['query'][_0x632b('0x3f')]+'%'};return _0x32492c;})});}_0x31fe66=_[_0x632b('0x5b')]({},_0x31fe66,_0x26f681[_0x632b('0xd8')]);return _0x2ae9ed[_0x632b('0x113')](_0x31fe66);}})['then'](function(_0x382f69){if(_0x382f69){_0x59966c=_0x382f69[_0x632b('0x4c')];if(!_0x26f681['query']['hasOwnProperty'](_0x632b('0xd5'))){_0x31fe66[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x26f681['query'][_0x632b('0x25')]);_0x31fe66[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x26f681[_0x632b('0x49')]['offset']);}return _0x2ae9ed[_0x632b('0x113')](_0x31fe66);}})[_0x632b('0x14')](function(_0x4c5fd7){if(_0x4c5fd7){return _0x4c5fd7?{'count':_0x59966c,'rows':_0x4c5fd7}:null;}})['then'](respondWithResult(_0x58595f,null))[_0x632b('0x1d')](handleError(_0x58595f,null));};exports[_0x632b('0x114')]=function(_0x477576,_0x494b89){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x477576[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x494b89,null))[_0x632b('0x14')](function(_0x5b7021){if(_0x5b7021){var _0x5882d4=_0x5b7021[_0x632b('0x2a')]({'plain':!![]});return _0x5b7021[_0x632b('0x114')](_0x477576[_0x632b('0x5c')]['ids'],_['omit'](_0x477576[_0x632b('0x5c')],['ids','id'])||{})['then'](function(){for(var _0x4c1de2=0x0;_0x4c1de2<_0x477576[_0x632b('0x5c')][_0x632b('0x5f')][_0x632b('0x4c')];_0x4c1de2++){var _0x286e36=[];db['Team'][_0x632b('0xc8')]({'where':{'id':_0x477576[_0x632b('0x5c')][_0x632b('0x5f')][_0x4c1de2]}})[_0x632b('0x14')](function(_0x42ca87){_0x286e36['push'](_0x42ca87[_0x632b('0xf7')]()[_0x632b('0x14')](function(_0x1fb1d9){for(var _0x104471=0x0;_0x104471<_0x1fb1d9['length'];_0x104471++){_0x1fb1d9[_0x104471]['setDataValue'](_0x632b('0xa9'),_0x632b('0x115'));}return _0x1fb1d9;}));_0x286e36['push'](_0x42ca87[_0x632b('0x116')]()[_0x632b('0x14')](function(_0x477d44){for(var _0x3579cf=0x0;_0x3579cf<_0x477d44['length'];_0x3579cf++){_0x477d44[_0x3579cf][_0x632b('0x117')]('channel',_0x632b('0x118'));}return _0x477d44;}));_0x286e36[_0x632b('0x46')](_0x42ca87[_0x632b('0x119')]()['then'](function(_0x1121b5){for(var _0x12d7d4=0x0;_0x12d7d4<_0x1121b5['length'];_0x12d7d4++){_0x1121b5[_0x12d7d4][_0x632b('0x117')](_0x632b('0xa9'),_0x632b('0x11a'));}return _0x1121b5;}));_0x286e36[_0x632b('0x46')](_0x42ca87[_0x632b('0x11b')]()[_0x632b('0x14')](function(_0x3a2321){for(var _0x28b45f=0x0;_0x28b45f<_0x3a2321[_0x632b('0x4c')];_0x28b45f++){_0x3a2321[_0x28b45f][_0x632b('0x117')](_0x632b('0xa9'),_0x632b('0x11c'));}return _0x3a2321;}));_0x286e36[_0x632b('0x46')](_0x42ca87['getWhatsappQueues']()['then'](function(_0x4bc0ea){for(var _0x34712e=0x0;_0x34712e<_0x4bc0ea[_0x632b('0x4c')];_0x34712e++){_0x4bc0ea[_0x34712e]['setDataValue'](_0x632b('0xa9'),'Whatsapp');}return _0x4bc0ea;}));_0x286e36[_0x632b('0x46')](_0x42ca87['getFaxQueues']()[_0x632b('0x14')](function(_0x124a98){for(var _0x53f709=0x0;_0x53f709<_0x124a98[_0x632b('0x4c')];_0x53f709++){_0x124a98[_0x53f709][_0x632b('0x117')](_0x632b('0xa9'),'Fax');}return _0x124a98;}));_0x286e36['push'](_0x42ca87[_0x632b('0x11d')]()[_0x632b('0x14')](function(_0x9682f8){for(var _0xbb466=0x0;_0xbb466<_0x9682f8['length'];_0xbb466++){_0x9682f8[_0xbb466]['setDataValue'](_0x632b('0xa9'),'Openchannel');}return _0x9682f8;}));return BPromise[_0x632b('0x53')](_0x286e36);})[_0x632b('0x14')](function(_0x1dd78e){var _0x2ee1eb=_[_0x632b('0x11e')](_0x1dd78e);_0x286e36=[];return db[_0x632b('0x68')][_0x632b('0x11f')](function(_0x19d648){for(var _0x346e7d=0x0;_0x346e7d<_0x2ee1eb[_0x632b('0x4c')];_0x346e7d++){_0x286e36[_0x632b('0x46')](_0x2ee1eb[_0x346e7d]['addAgent'](_0x5882d4['id']),{'transaction':_0x19d648});}return BPromise[_0x632b('0x53')](_0x286e36)[_0x632b('0x14')](function(){if(_0x5882d4[_0x632b('0xa4')]){return BPromise['each'](_[_0x632b('0x3f')](_0x2ee1eb,function(_0x2ca0e5){return _0x2ca0e5[_0x632b('0x120')]('channel')===_0x632b('0x115');}),function(_0x3f1c65){return db[_0x632b('0xa6')]['upsert']({'membername':_0x5882d4[_0x632b('0x37')],'UserId':_0x5882d4['id'],'queue_name':_0x3f1c65[_0x632b('0x37')],'VoiceQueueId':_0x3f1c65['id'],'interface':_[_0x632b('0x66')](_0x5882d4[_0x632b('0x99')])?util[_0x632b('0xa5')]('SIP/%s',_0x5882d4[_0x632b('0x37')]):_0x5882d4['interface'],'paused':_0x5882d4[_0x632b('0x98')]||![],'penalty':_0x5882d4[_0x632b('0x9d')]},{'transaction':_0x19d648});});}else{return;}})[_0x632b('0x14')](function(){for(var _0xc27c10=0x0;_0xc27c10<_0x2ee1eb[_0x632b('0x4c')];_0xc27c10++){var _0x339f4f=_0x2ee1eb[_0xc27c10][_0x632b('0x120')](_0x632b('0xa9'));var _0x589835=_0x339f4f+_0x632b('0xad');socket[_0x632b('0xa1')]('user'+_0x339f4f+'Queue:save',{'UserId':_0x5882d4['id'],['queueField']:_0x2ee1eb[_0xc27c10]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x494b89,null))[_0x632b('0x1d')](handleError(_0x494b89,null));};exports[_0x632b('0x121')]=function(_0x5b736d,_0x41d73b){return db[_0x632b('0x3a')]['findOne']({'where':{'id':_0x5b736d[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x41d73b,null))[_0x632b('0x14')](function(_0xa34f8b){if(_0xa34f8b){var _0x4a8f1c=_0xa34f8b[_0x632b('0x2a')]({'plain':!![]});var _0x7c4a61=_0x5b736d['query'][_0x632b('0x5f')];return _0xa34f8b[_0x632b('0x121')](_0x7c4a61)[_0x632b('0x14')](function(){for(var _0x76f9c3=0x0;_0x76f9c3<_0x7c4a61['length'];_0x76f9c3++){var _0x4f121a=[];db[_0x632b('0x122')]['findOne']({'where':{'id':_0x7c4a61[_0x76f9c3]}})[_0x632b('0x14')](function(_0x11e7cd){_0x4f121a['push'](_0x11e7cd[_0x632b('0xf7')]()[_0x632b('0x14')](function(_0x1c633f){for(var _0x5d5f3e=0x0;_0x5d5f3e<_0x1c633f['length'];_0x5d5f3e++){_0x1c633f[_0x5d5f3e][_0x632b('0x117')](_0x632b('0xa9'),_0x632b('0x115'));}return _0x1c633f;}));_0x4f121a[_0x632b('0x46')](_0x11e7cd['getChatQueues']()[_0x632b('0x14')](function(_0x35b28c){for(var _0x429828=0x0;_0x429828<_0x35b28c['length'];_0x429828++){_0x35b28c[_0x429828][_0x632b('0x117')](_0x632b('0xa9'),_0x632b('0x118'));}return _0x35b28c;}));_0x4f121a[_0x632b('0x46')](_0x11e7cd[_0x632b('0x119')]()[_0x632b('0x14')](function(_0x19efa5){for(var _0xedfcb4=0x0;_0xedfcb4<_0x19efa5[_0x632b('0x4c')];_0xedfcb4++){_0x19efa5[_0xedfcb4][_0x632b('0x117')]('channel',_0x632b('0x11a'));}return _0x19efa5;}));_0x4f121a[_0x632b('0x46')](_0x11e7cd['getSmsQueues']()[_0x632b('0x14')](function(_0x23b9b5){for(var _0x18db25=0x0;_0x18db25<_0x23b9b5[_0x632b('0x4c')];_0x18db25++){_0x23b9b5[_0x18db25][_0x632b('0x117')]('channel',_0x632b('0x11c'));}return _0x23b9b5;}));_0x4f121a['push'](_0x11e7cd['getWhatsappQueues']()[_0x632b('0x14')](function(_0x798952){for(var _0x12e229=0x0;_0x12e229<_0x798952[_0x632b('0x4c')];_0x12e229++){_0x798952[_0x12e229]['setDataValue'](_0x632b('0xa9'),'Whatsapp');}return _0x798952;}));_0x4f121a[_0x632b('0x46')](_0x11e7cd['getFaxQueues']()[_0x632b('0x14')](function(_0x10fbcf){for(var _0x4306ff=0x0;_0x4306ff<_0x10fbcf[_0x632b('0x4c')];_0x4306ff++){_0x10fbcf[_0x4306ff]['setDataValue'](_0x632b('0xa9'),_0x632b('0x123'));}return _0x10fbcf;}));_0x4f121a[_0x632b('0x46')](_0x11e7cd[_0x632b('0x11d')]()[_0x632b('0x14')](function(_0x6a6652){for(var _0xc61ad=0x0;_0xc61ad<_0x6a6652[_0x632b('0x4c')];_0xc61ad++){_0x6a6652[_0xc61ad]['setDataValue'](_0x632b('0xa9'),'Openchannel');}return _0x6a6652;}));return BPromise[_0x632b('0x53')](_0x4f121a);})[_0x632b('0x14')](function(_0x50b0c1){var _0x3ebb27=_[_0x632b('0x11e')](_0x50b0c1);_0x4f121a=[];return db[_0x632b('0x68')][_0x632b('0x11f')](function(_0x488e25){for(var _0x2f1055=0x0;_0x2f1055<_0x3ebb27['length'];_0x2f1055++){_0x4f121a[_0x632b('0x46')](_0x3ebb27[_0x2f1055][_0x632b('0x124')](_0x4a8f1c['id']),{'transaction':_0x488e25});}return BPromise[_0x632b('0x53')](_0x4f121a)[_0x632b('0x14')](function(){if(_0x4a8f1c['online']){return BPromise[_0x632b('0x84')](_[_0x632b('0x3f')](_0x3ebb27,function(_0x5dae5b){return _0x5dae5b[_0x632b('0x120')]('channel')===_0x632b('0x115');}),function(_0x5169cd){return db['UserVoiceQueueRt'][_0x632b('0x29')]({'where':{'VoiceQueueId':_0x5169cd['id'],'UserId':_0x4a8f1c['id']},'transaction':_0x488e25});});}else{return;}})[_0x632b('0x14')](function(){for(var _0x3a2df5=0x0;_0x3a2df5<_0x3ebb27[_0x632b('0x4c')];_0x3a2df5++){var _0x17088f=_0x3ebb27[_0x3a2df5][_0x632b('0x120')](_0x632b('0xa9'));var _0x17fcbe=_0x17088f+_0x632b('0xad');socket[_0x632b('0xa1')](_0x632b('0x2e')+_0x17088f+_0x632b('0xae'),{'UserId':_0x4a8f1c['id'],['queueField']:_0x3ebb27[_0x3a2df5]['id']});}});});});}});}})[_0x632b('0x14')](respondWithStatusCode(_0x41d73b,null))['catch'](handleError(_0x41d73b,null));};exports[_0x632b('0x125')]=function(_0x5b282c,_0x44338e){var _0x38408f={};var _0x24d829={};var _0x56e85a;var _0x1a9bfd;return db['User'][_0x632b('0xc8')]({'where':{'id':_0x5b282c[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x44338e,null))[_0x632b('0x14')](function(_0xaf2e46){if(_0xaf2e46){_0x56e85a=_0xaf2e46;_0x24d829[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0xcf')][_0x632b('0x3b')]);_0x24d829['query']=_[_0x632b('0x57')](_0x5b282c[_0x632b('0x49')]);_0x24d829[_0x632b('0x58')]=_[_0x632b('0x59')](_0x24d829['model'],_0x24d829[_0x632b('0x49')]);_0x38408f['attributes']=_[_0x632b('0x59')](_0x24d829[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x5b282c[_0x632b('0x49')][_0x632b('0x5a')]));_0x38408f['attributes']=_0x38408f[_0x632b('0x45')][_0x632b('0x4c')]?_0x38408f['attributes']:_0x24d829[_0x632b('0x55')];_0x38408f[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x5b282c[_0x632b('0x49')][_0x632b('0xcb')]);_0x38408f[_0x632b('0xcc')]=qs[_0x632b('0x58')](_['pick'](_0x5b282c[_0x632b('0x49')],_0x24d829[_0x632b('0x58')]));if(_0x5b282c[_0x632b('0x49')][_0x632b('0x3f')]){_0x38408f[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x38408f[_0x632b('0xcc')],{'$or':_['map'](_0x38408f[_0x632b('0x45')],function(_0x5153e6){var _0x5ee565={};_0x5ee565[_0x5153e6]={'$like':'%'+_0x5b282c[_0x632b('0x49')]['filter']+'%'};return _0x5ee565;})});}_0x38408f=_[_0x632b('0x5b')]({},_0x38408f,_0x5b282c[_0x632b('0xd8')]);return _0x56e85a['getLists'](_0x38408f);}})[_0x632b('0x14')](function(_0x20a0e4){if(_0x20a0e4){_0x1a9bfd=_0x20a0e4[_0x632b('0x4c')];if(!_0x5b282c[_0x632b('0x49')][_0x632b('0xce')]('nolimit')){_0x38408f['limit']=qs[_0x632b('0x25')](_0x5b282c[_0x632b('0x49')]['limit']);_0x38408f[_0x632b('0x22')]=qs['offset'](_0x5b282c[_0x632b('0x49')][_0x632b('0x22')]);}return _0x56e85a[_0x632b('0x125')](_0x38408f);}})[_0x632b('0x14')](function(_0x16980f){if(_0x16980f){return _0x16980f?{'count':_0x1a9bfd,'rows':_0x16980f}:null;}})[_0x632b('0x14')](respondWithResult(_0x44338e,null))[_0x632b('0x1d')](handleError(_0x44338e,null));};exports['getAgents']=function(_0x6d5867,_0xe65b98){var _0x1a94ed={};var _0x25b3e6={};var _0x1b6a06;var _0x24b9e0;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x6d5867[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xe65b98,null))[_0x632b('0x14')](function(_0x112724){if(_0x112724){_0x1b6a06=_0x112724;_0x25b3e6[_0x632b('0x55')]=_['keys'](db[_0x632b('0x3a')][_0x632b('0x3b')]);_0x25b3e6[_0x632b('0x49')]=_[_0x632b('0x57')](_0x6d5867['query']);_0x25b3e6[_0x632b('0x58')]=_[_0x632b('0x59')](_0x25b3e6[_0x632b('0x55')],_0x25b3e6['query']);_0x1a94ed[_0x632b('0x45')]=_[_0x632b('0x59')](_0x25b3e6[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x6d5867[_0x632b('0x49')][_0x632b('0x5a')]));_0x1a94ed['attributes']=_0x1a94ed[_0x632b('0x45')][_0x632b('0x4c')]?_0x1a94ed[_0x632b('0x45')]:_0x25b3e6[_0x632b('0x55')];_0x1a94ed['order']=qs[_0x632b('0xcb')](_0x6d5867[_0x632b('0x49')][_0x632b('0xcb')]);_0x1a94ed[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x6d5867[_0x632b('0x49')],_0x25b3e6[_0x632b('0x58')]));if(_0x6d5867[_0x632b('0x49')]['filter']){_0x1a94ed[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x1a94ed[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x1a94ed['attributes'],function(_0x20e0c1){var _0x2f747f={};_0x2f747f[_0x20e0c1]={'$like':'%'+_0x6d5867[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x2f747f;})});}_0x1a94ed['model']=db['User'];_0x1a94ed['as']='Agents';_0x1a94ed=_[_0x632b('0x5b')]({},_0x1a94ed,_0x6d5867[_0x632b('0xd8')]);return _0x1b6a06['getVoiceQueues']({'include':[_0x1a94ed]});}})['then'](function(_0x57f28f){if(_0x57f28f){var _0x13be27={},_0x3d0536=[],_0x11b982=0x0;for(var _0x58133f=0x0;_0x58133f<_0x57f28f[_0x632b('0x4c')];_0x58133f+=0x1){for(var _0x368d9c=0x0,_0x17fc95;_0x368d9c<_0x57f28f[_0x58133f][_0x632b('0x2f')][_0x632b('0x4c')];_0x368d9c+=0x1){_0x17fc95=_0x57f28f[_0x58133f][_0x632b('0x2f')][_0x368d9c]['get']({'plain':!![]});_0x13be27[_0x17fc95['id']]=_0x17fc95;}}_0x13be27=_[_0x632b('0x126')](_0x13be27);for(var _0x39ab5c=qs[_0x632b('0x22')](_0x6d5867[_0x632b('0x49')][_0x632b('0x22')]);_0x39ab5c<_0x13be27[_0x632b('0x4c')]&&_0x3d0536[_0x632b('0x4c')]<qs[_0x632b('0x25')](_0x6d5867[_0x632b('0x49')]['limit']);_0x39ab5c+=0x1){if(_0x13be27[_0x39ab5c]){_0x3d0536[_0x632b('0x46')](_0x13be27[_0x39ab5c]);}}return{'count':_0x13be27[_0x632b('0x4c')],'rows':_0x3d0536};}})[_0x632b('0x14')](respondWithResult(_0xe65b98,null))['catch'](handleError(_0xe65b98,null));};exports[_0x632b('0x29')]=function(_0x4014ba,_0x1ba71b){if(_0x4014ba['user']['id']==_0x4014ba[_0x632b('0x54')]['id']){return _0x1ba71b[_0x632b('0x1f')](0x1f4)[_0x632b('0x127')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db['User'][_0x632b('0x36')]({'where':{'id':_0x4014ba[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x1ba71b,null))[_0x632b('0x14')](removeEntity(_0x1ba71b,null))['catch'](handleError(_0x1ba71b,null));};exports[_0x632b('0x128')]=function(_0x41e834,_0x33ac01){return db[_0x632b('0x3a')]['find']({'where':{'id':_0x41e834['params']['id']}})['then'](handleEntityNotFound(_0x33ac01,null))['then'](function(_0x1c21cb){if(_0x1c21cb){return _0x1c21cb['addChatInteractions'](_0x41e834[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x41e834[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{})[_0x632b('0x9e')](function(){for(var _0x34a8f2=0x0;_0x34a8f2<_0x41e834[_0x632b('0x5c')][_0x632b('0x5f')][_0x632b('0x4c')];_0x34a8f2+=0x1){socket[_0x632b('0xa1')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x41e834[_0x632b('0x5c')][_0x632b('0x5f')][_0x34a8f2]),'UserId':Number(_0x41e834[_0x632b('0x54')]['id'])});}return _0x41e834[_0x632b('0x5c')][_0x632b('0x5f')];});}})[_0x632b('0x14')](respondWithResult(_0x33ac01,null))[_0x632b('0x1d')](handleError(_0x33ac01,null));};exports[_0x632b('0x12a')]=function(_0x599694,_0x410677){return db[_0x632b('0x3a')]['find']({'where':{'id':_0x599694[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x410677,null))['then'](function(_0x538eae){if(_0x538eae){return _0x538eae['removeChatInteractions'](_0x599694['query'][_0x632b('0x5f')])['then'](function(){if(_['isArray'](_0x599694[_0x632b('0x49')][_0x632b('0x5f')])){for(var _0x5c6244=0x0;_0x5c6244<_0x599694['query'][_0x632b('0x5f')]['length'];_0x5c6244+=0x1){socket[_0x632b('0xa1')](_0x632b('0x12b'),{'ChatInteractionId':Number(_0x599694['query'][_0x632b('0x5f')][_0x5c6244]),'UserId':Number(_0x599694['params']['id'])});}}else{socket[_0x632b('0xa1')](_0x632b('0x12b'),{'ChatInteractionId':Number(_0x599694['query'][_0x632b('0x5f')]),'UserId':Number(_0x599694[_0x632b('0x54')]['id'])});}});}})[_0x632b('0x14')](respondWithStatusCode(_0x410677,null))[_0x632b('0x1d')](handleError(_0x410677,null));};exports[_0x632b('0x12c')]=function(_0x6959ef,_0x359548){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x6959ef['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x359548,null))[_0x632b('0x14')](function(_0x53490b){if(_0x53490b){return _0x53490b[_0x632b('0x12c')](_0x6959ef[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x6959ef[_0x632b('0x5c')],['ids','id'])||{})[_0x632b('0x9e')](function(){for(var _0x18d4a=0x0;_0x18d4a<_0x6959ef['body']['ids'][_0x632b('0x4c')];_0x18d4a+=0x1){socket[_0x632b('0xa1')](_0x632b('0x12d'),{'MailInteractionId':Number(_0x6959ef[_0x632b('0x5c')][_0x632b('0x5f')][_0x18d4a]),'UserId':Number(_0x6959ef[_0x632b('0x54')]['id'])});}return _0x6959ef[_0x632b('0x5c')][_0x632b('0x5f')];});}})['then'](respondWithResult(_0x359548,null))[_0x632b('0x1d')](handleError(_0x359548,null));};exports[_0x632b('0x12e')]=function(_0x21d9b6,_0x27f8e2){return db['User']['find']({'where':{'id':_0x21d9b6[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x27f8e2,null))[_0x632b('0x14')](function(_0x408acf){if(_0x408acf){return _0x408acf[_0x632b('0x12e')](_0x21d9b6['query']['ids'])[_0x632b('0x14')](function(){if(_[_0x632b('0xac')](_0x21d9b6[_0x632b('0x49')][_0x632b('0x5f')])){for(var _0xf3ea02=0x0;_0xf3ea02<_0x21d9b6['query'][_0x632b('0x5f')][_0x632b('0x4c')];_0xf3ea02+=0x1){socket[_0x632b('0xa1')](_0x632b('0x12f'),{'MailInteractionId':Number(_0x21d9b6[_0x632b('0x49')][_0x632b('0x5f')][_0xf3ea02]),'UserId':Number(_0x21d9b6['params']['id'])});}}else{socket[_0x632b('0xa1')](_0x632b('0x12f'),{'MailInteractionId':Number(_0x21d9b6[_0x632b('0x49')][_0x632b('0x5f')]),'UserId':Number(_0x21d9b6[_0x632b('0x54')]['id'])});}});}})[_0x632b('0x14')](respondWithStatusCode(_0x27f8e2,null))['catch'](handleError(_0x27f8e2,null));};exports['addFaxInteractions']=function(_0x3529b3,_0xd3d81e){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x3529b3[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xd3d81e,null))[_0x632b('0x14')](function(_0x2004fd){if(_0x2004fd){return _0x2004fd[_0x632b('0x130')](_0x3529b3[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x3529b3[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{})[_0x632b('0x9e')](function(){for(var _0x582967=0x0;_0x582967<_0x3529b3['body'][_0x632b('0x5f')][_0x632b('0x4c')];_0x582967+=0x1){socket[_0x632b('0xa1')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x3529b3[_0x632b('0x5c')]['ids'][_0x582967]),'UserId':Number(_0x3529b3['params']['id'])});}return _0x3529b3[_0x632b('0x5c')]['ids'];});}})[_0x632b('0x14')](respondWithResult(_0xd3d81e,null))[_0x632b('0x1d')](handleError(_0xd3d81e,null));};exports[_0x632b('0x131')]=function(_0xd8a1aa,_0x33cfdf){return db['User'][_0x632b('0x36')]({'where':{'id':_0xd8a1aa[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x33cfdf,null))[_0x632b('0x14')](function(_0x2830f1){if(_0x2830f1){return _0x2830f1[_0x632b('0x131')](_0xd8a1aa[_0x632b('0x49')]['ids'])['then'](function(){if(_[_0x632b('0xac')](_0xd8a1aa[_0x632b('0x49')][_0x632b('0x5f')])){for(var _0x2d9671=0x0;_0x2d9671<_0xd8a1aa['query'][_0x632b('0x5f')][_0x632b('0x4c')];_0x2d9671+=0x1){socket[_0x632b('0xa1')](_0x632b('0x132'),{'FaxInteractionId':Number(_0xd8a1aa[_0x632b('0x49')][_0x632b('0x5f')][_0x2d9671]),'UserId':Number(_0xd8a1aa[_0x632b('0x54')]['id'])});}}else{socket[_0x632b('0xa1')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xd8a1aa[_0x632b('0x49')][_0x632b('0x5f')]),'UserId':Number(_0xd8a1aa[_0x632b('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x33cfdf,null))[_0x632b('0x1d')](handleError(_0x33cfdf,null));};exports[_0x632b('0x133')]=function(_0x29f284,_0x8d344d){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x29f284[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x8d344d,null))[_0x632b('0x14')](function(_0x92d38c){if(_0x92d38c){return _0x92d38c[_0x632b('0x133')](_0x29f284['body']['ids'],_['omit'](_0x29f284[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{})[_0x632b('0x9e')](function(){for(var _0x13073d=0x0;_0x13073d<_0x29f284[_0x632b('0x5c')][_0x632b('0x5f')][_0x632b('0x4c')];_0x13073d+=0x1){socket[_0x632b('0xa1')](_0x632b('0x134'),{'SmsInteractionId':Number(_0x29f284[_0x632b('0x5c')]['ids'][_0x13073d]),'UserId':Number(_0x29f284[_0x632b('0x54')]['id'])});}return _0x29f284[_0x632b('0x5c')][_0x632b('0x5f')];});}})[_0x632b('0x14')](respondWithResult(_0x8d344d,null))['catch'](handleError(_0x8d344d,null));};exports['removeSmsInteractions']=function(_0x5de002,_0xf1bff0){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x5de002['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xf1bff0,null))['then'](function(_0x395381){if(_0x395381){return _0x395381['removeSmsInteractions'](_0x5de002[_0x632b('0x49')]['ids'])['then'](function(){if(_[_0x632b('0xac')](_0x5de002['query']['ids'])){for(var _0x36e397=0x0;_0x36e397<_0x5de002['query'][_0x632b('0x5f')][_0x632b('0x4c')];_0x36e397+=0x1){socket[_0x632b('0xa1')](_0x632b('0x135'),{'SmsInteractionId':Number(_0x5de002[_0x632b('0x49')][_0x632b('0x5f')][_0x36e397]),'UserId':Number(_0x5de002[_0x632b('0x54')]['id'])});}}else{socket[_0x632b('0xa1')](_0x632b('0x135'),{'SmsInteractionId':Number(_0x5de002[_0x632b('0x49')][_0x632b('0x5f')]),'UserId':Number(_0x5de002[_0x632b('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0xf1bff0,null))[_0x632b('0x1d')](handleError(_0xf1bff0,null));};exports[_0x632b('0x136')]=function(_0x101013,_0xb3f239){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x101013['params']['id']}})['then'](handleEntityNotFound(_0xb3f239,null))['then'](function(_0x504526){if(_0x504526){return _0x504526[_0x632b('0x136')](_0x101013['body'][_0x632b('0x5f')],_[_0x632b('0x129')](_0x101013['body'],[_0x632b('0x5f'),'id'])||{})['spread'](function(){for(var _0x4ba5ec=0x0;_0x4ba5ec<_0x101013[_0x632b('0x5c')]['ids'][_0x632b('0x4c')];_0x4ba5ec+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x101013['body']['ids'][_0x4ba5ec]),'UserId':Number(_0x101013['params']['id'])});}return _0x101013[_0x632b('0x5c')][_0x632b('0x5f')];});}})[_0x632b('0x14')](respondWithResult(_0xb3f239,null))[_0x632b('0x1d')](handleError(_0xb3f239,null));};exports['removeOpenchannelInteractions']=function(_0x3315e4,_0x20a066){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x3315e4['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x20a066,null))[_0x632b('0x14')](function(_0x566821){if(_0x566821){return _0x566821['removeOpenchannelInteractions'](_0x3315e4[_0x632b('0x49')][_0x632b('0x5f')])[_0x632b('0x14')](function(){if(_[_0x632b('0xac')](_0x3315e4[_0x632b('0x49')][_0x632b('0x5f')])){for(var _0x3a25d9=0x0;_0x3a25d9<_0x3315e4[_0x632b('0x49')]['ids'][_0x632b('0x4c')];_0x3a25d9+=0x1){socket[_0x632b('0xa1')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3315e4[_0x632b('0x49')][_0x632b('0x5f')][_0x3a25d9]),'UserId':Number(_0x3315e4[_0x632b('0x54')]['id'])});}}else{socket[_0x632b('0xa1')](_0x632b('0x137'),{'OpenchannelInteractionId':Number(_0x3315e4[_0x632b('0x49')]['ids']),'UserId':Number(_0x3315e4[_0x632b('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x20a066,null))['catch'](handleError(_0x20a066,null));};exports[_0x632b('0x138')]=function(_0x54ab81,_0xb0996e){return db['User'][_0x632b('0x36')]({'where':{'id':_0x54ab81[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xb0996e,null))[_0x632b('0x14')](function(_0x1035f7){if(_0x1035f7){return _0x1035f7[_0x632b('0x138')](_0x54ab81[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x54ab81[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{})['spread'](function(){for(var _0x4c27ea=0x0;_0x4c27ea<_0x54ab81[_0x632b('0x5c')][_0x632b('0x5f')][_0x632b('0x4c')];_0x4c27ea+=0x1){socket[_0x632b('0xa1')](_0x632b('0x139'),{'WhatsappInteractionId':Number(_0x54ab81[_0x632b('0x5c')][_0x632b('0x5f')][_0x4c27ea]),'UserId':Number(_0x54ab81[_0x632b('0x54')]['id'])});}return _0x54ab81[_0x632b('0x5c')][_0x632b('0x5f')];});}})[_0x632b('0x14')](respondWithResult(_0xb0996e,null))[_0x632b('0x1d')](handleError(_0xb0996e,null));};exports[_0x632b('0x13a')]=function(_0x5311f7,_0x74a0c5){return db['User'][_0x632b('0x36')]({'where':{'id':_0x5311f7[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x74a0c5,null))[_0x632b('0x14')](function(_0x38699a){if(_0x38699a){return _0x38699a[_0x632b('0x13a')](_0x5311f7[_0x632b('0x49')][_0x632b('0x5f')]);}})[_0x632b('0x14')](respondWithStatusCode(_0x74a0c5,null))[_0x632b('0x1d')](handleError(_0x74a0c5,null));};exports['getVoicePrefixes']=function(_0x593d73,_0x378f05){var _0x47aec7={};var _0x223ee8={};var _0x3fb00f;var _0x4b45d3;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x593d73[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x378f05,null))[_0x632b('0x14')](function(_0x155b7c){if(_0x155b7c){_0x3fb00f=_0x155b7c;_0x223ee8[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x13b')][_0x632b('0x3b')]);_0x223ee8[_0x632b('0x49')]=_[_0x632b('0x57')](_0x593d73['query']);_0x223ee8[_0x632b('0x58')]=_['intersection'](_0x223ee8[_0x632b('0x55')],_0x223ee8[_0x632b('0x49')]);_0x47aec7[_0x632b('0x45')]=_[_0x632b('0x59')](_0x223ee8[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x593d73['query']['fields']));_0x47aec7[_0x632b('0x45')]=_0x47aec7[_0x632b('0x45')][_0x632b('0x4c')]?_0x47aec7[_0x632b('0x45')]:_0x223ee8[_0x632b('0x55')];_0x47aec7[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x593d73['query'][_0x632b('0xcb')]);_0x47aec7[_0x632b('0xcc')]=qs[_0x632b('0x58')](_['pick'](_0x593d73[_0x632b('0x49')],_0x223ee8['filters']));if(_0x593d73[_0x632b('0x49')][_0x632b('0x3f')]){_0x47aec7['where']=_[_0x632b('0x5b')](_0x47aec7['where'],{'$or':_['map'](_0x47aec7[_0x632b('0x45')],function(_0x26706c){var _0x4a2bfa={};_0x4a2bfa[_0x26706c]={'$like':'%'+_0x593d73[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x4a2bfa;})});}_0x47aec7=_[_0x632b('0x5b')]({},_0x47aec7,_0x593d73[_0x632b('0xd8')]);return _0x3fb00f['getVoicePrefixes'](_0x47aec7);}})[_0x632b('0x14')](function(_0x2d9e4e){if(_0x2d9e4e){_0x4b45d3=_0x2d9e4e[_0x632b('0x4c')];if(!_0x593d73[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x47aec7[_0x632b('0x25')]=qs['limit'](_0x593d73[_0x632b('0x49')]['limit']);_0x47aec7[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x593d73[_0x632b('0x49')]['offset']);}return _0x3fb00f[_0x632b('0x13c')](_0x47aec7);}})[_0x632b('0x14')](function(_0x305d90){if(_0x305d90){return _0x305d90?{'count':_0x4b45d3,'rows':_0x305d90}:null;}})['then'](respondWithResult(_0x378f05,null))[_0x632b('0x1d')](handleError(_0x378f05,null));};exports[_0x632b('0x13d')]=function(_0x492292,_0x3cc190){var _0xb96f16={};var _0x214285={};var _0x3b1ff0;var _0x15f24e;return db['User'][_0x632b('0xc8')]({'where':{'id':_0x492292['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x3cc190,null))[_0x632b('0x14')](function(_0x4ac8e9){if(_0x4ac8e9){_0x3b1ff0=_0x4ac8e9;_0x214285[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x13e')]['rawAttributes']);_0x214285['query']=_[_0x632b('0x57')](_0x492292[_0x632b('0x49')]);_0x214285[_0x632b('0x58')]=_['intersection'](_0x214285[_0x632b('0x55')],_0x214285[_0x632b('0x49')]);_0xb96f16[_0x632b('0x45')]=_[_0x632b('0x59')](_0x214285[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x492292['query'][_0x632b('0x5a')]));_0xb96f16['attributes']=_0xb96f16['attributes'][_0x632b('0x4c')]?_0xb96f16[_0x632b('0x45')]:_0x214285['model'];_0xb96f16[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x492292['query'][_0x632b('0xcb')]);_0xb96f16[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x492292[_0x632b('0x49')],_0x214285[_0x632b('0x58')]));if(_0x492292[_0x632b('0x49')]['filter']){_0xb96f16[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0xb96f16['where'],{'$or':_[_0x632b('0x34')](_0xb96f16[_0x632b('0x45')],function(_0x334d4a){var _0x36c366={};_0x36c366[_0x334d4a]={'$like':'%'+_0x492292[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x36c366;})});}_0xb96f16=_[_0x632b('0x5b')]({},_0xb96f16,_0x492292[_0x632b('0xd8')]);return _0x3b1ff0['getFaxAccounts'](_0xb96f16);}})['then'](function(_0x5665f8){if(_0x5665f8){_0x15f24e=_0x5665f8[_0x632b('0x4c')];if(!_0x492292[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0xb96f16[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x492292['query'][_0x632b('0x25')]);_0xb96f16['offset']=qs[_0x632b('0x22')](_0x492292[_0x632b('0x49')][_0x632b('0x22')]);}return _0x3b1ff0[_0x632b('0x13d')](_0xb96f16);}})['then'](function(_0x5430b1){if(_0x5430b1){return _0x5430b1?{'count':_0x15f24e,'rows':_0x5430b1}:null;}})[_0x632b('0x14')](respondWithResult(_0x3cc190,null))[_0x632b('0x1d')](handleError(_0x3cc190,null));};exports[_0x632b('0x13f')]=function(_0x3ad2af,_0x15b6a9){return db[_0x632b('0x3a')]['find']({'where':{'id':_0x3ad2af[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x15b6a9,null))[_0x632b('0x14')](function(_0x55c66b){if(_0x55c66b){return _0x55c66b[_0x632b('0x13f')](_0x3ad2af['body'][_0x632b('0x5f')],_[_0x632b('0x129')](_0x3ad2af['body'],['ids','id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x15b6a9,null))['catch'](handleError(_0x15b6a9,null));};exports['removeFaxAccounts']=function(_0x52b9b8,_0x208ed2){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x52b9b8['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x208ed2,null))[_0x632b('0x14')](function(_0x238610){if(_0x238610){return _0x238610['removeFaxAccounts'](_0x52b9b8[_0x632b('0x49')]['ids']);}})[_0x632b('0x14')](respondWithStatusCode(_0x208ed2,null))[_0x632b('0x1d')](handleError(_0x208ed2,null));};exports[_0x632b('0x140')]=function(_0x2d2b24,_0x371da1){var _0x4341b7={};var _0x1315ee={};var _0x48a356;var _0x32f5fd;return db['User'][_0x632b('0xc8')]({'where':{'id':_0x2d2b24['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x371da1,null))[_0x632b('0x14')](function(_0x33c439){if(_0x33c439){_0x48a356=_0x33c439;_0x1315ee[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x141')][_0x632b('0x3b')]);_0x1315ee['query']=_[_0x632b('0x57')](_0x2d2b24[_0x632b('0x49')]);_0x1315ee[_0x632b('0x58')]=_[_0x632b('0x59')](_0x1315ee[_0x632b('0x55')],_0x1315ee[_0x632b('0x49')]);_0x4341b7[_0x632b('0x45')]=_[_0x632b('0x59')](_0x1315ee[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x2d2b24[_0x632b('0x49')][_0x632b('0x5a')]));_0x4341b7[_0x632b('0x45')]=_0x4341b7[_0x632b('0x45')]['length']?_0x4341b7[_0x632b('0x45')]:_0x1315ee['model'];_0x4341b7['order']=qs[_0x632b('0xcb')](_0x2d2b24[_0x632b('0x49')]['sort']);_0x4341b7[_0x632b('0xcc')]=qs[_0x632b('0x58')](_['pick'](_0x2d2b24[_0x632b('0x49')],_0x1315ee[_0x632b('0x58')]));if(_0x2d2b24[_0x632b('0x49')]['filter']){_0x4341b7[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x4341b7[_0x632b('0xcc')],{'$or':_['map'](_0x4341b7[_0x632b('0x45')],function(_0x312d63){var _0x38c066={};_0x38c066[_0x312d63]={'$like':'%'+_0x2d2b24[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x38c066;})});}_0x4341b7=_[_0x632b('0x5b')]({},_0x4341b7,_0x2d2b24['options']);return _0x48a356[_0x632b('0x140')](_0x4341b7);}})['then'](function(_0x535922){if(_0x535922){_0x32f5fd=_0x535922[_0x632b('0x4c')];if(!_0x2d2b24[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x4341b7['limit']=qs[_0x632b('0x25')](_0x2d2b24[_0x632b('0x49')][_0x632b('0x25')]);_0x4341b7[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x2d2b24[_0x632b('0x49')][_0x632b('0x22')]);}return _0x48a356[_0x632b('0x140')](_0x4341b7);}})[_0x632b('0x14')](function(_0x50797f){if(_0x50797f){return _0x50797f?{'count':_0x32f5fd,'rows':_0x50797f}:null;}})[_0x632b('0x14')](respondWithResult(_0x371da1,null))['catch'](handleError(_0x371da1,null));};exports['addMailAccounts']=function(_0x194a8f,_0x107480){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x194a8f['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x107480,null))[_0x632b('0x14')](function(_0x438f3d){if(_0x438f3d){return _0x438f3d[_0x632b('0x142')](_0x194a8f[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x194a8f[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x107480,null))[_0x632b('0x1d')](handleError(_0x107480,null));};exports[_0x632b('0x143')]=function(_0x4d5bb9,_0xf73b9e){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x4d5bb9[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0xf73b9e,null))['then'](function(_0x505e91){if(_0x505e91){return _0x505e91[_0x632b('0x143')](_0x4d5bb9[_0x632b('0x49')][_0x632b('0x5f')]);}})[_0x632b('0x14')](respondWithStatusCode(_0xf73b9e,null))[_0x632b('0x1d')](handleError(_0xf73b9e,null));};exports[_0x632b('0x144')]=function(_0x4b2a6e,_0x45eaef){var _0x510c8a={};var _0x94c211={};var _0x2bd847;var _0x2d218f;return db[_0x632b('0x3a')]['findOne']({'where':{'id':_0x4b2a6e[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x45eaef,null))[_0x632b('0x14')](function(_0x10458c){if(_0x10458c){_0x2bd847=_0x10458c;_0x94c211[_0x632b('0x55')]=_[_0x632b('0x57')](db['OpenchannelAccount'][_0x632b('0x3b')]);_0x94c211['query']=_[_0x632b('0x57')](_0x4b2a6e[_0x632b('0x49')]);_0x94c211[_0x632b('0x58')]=_[_0x632b('0x59')](_0x94c211[_0x632b('0x55')],_0x94c211[_0x632b('0x49')]);_0x510c8a[_0x632b('0x45')]=_[_0x632b('0x59')](_0x94c211[_0x632b('0x55')],qs['fields'](_0x4b2a6e['query'][_0x632b('0x5a')]));_0x510c8a[_0x632b('0x45')]=_0x510c8a[_0x632b('0x45')][_0x632b('0x4c')]?_0x510c8a[_0x632b('0x45')]:_0x94c211['model'];_0x510c8a[_0x632b('0xca')]=qs['sort'](_0x4b2a6e[_0x632b('0x49')][_0x632b('0xcb')]);_0x510c8a['where']=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x4b2a6e['query'],_0x94c211[_0x632b('0x58')]));if(_0x4b2a6e['query']['filter']){_0x510c8a[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0x510c8a['where'],{'$or':_['map'](_0x510c8a['attributes'],function(_0x54a3e5){var _0x47eb3f={};_0x47eb3f[_0x54a3e5]={'$like':'%'+_0x4b2a6e[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x47eb3f;})});}_0x510c8a=_[_0x632b('0x5b')]({},_0x510c8a,_0x4b2a6e['options']);return _0x2bd847[_0x632b('0x144')](_0x510c8a);}})[_0x632b('0x14')](function(_0x5c3089){if(_0x5c3089){_0x2d218f=_0x5c3089[_0x632b('0x4c')];if(!_0x4b2a6e[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x510c8a[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x4b2a6e[_0x632b('0x49')][_0x632b('0x25')]);_0x510c8a[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x4b2a6e[_0x632b('0x49')][_0x632b('0x22')]);}return _0x2bd847[_0x632b('0x144')](_0x510c8a);}})[_0x632b('0x14')](function(_0x56587f){if(_0x56587f){return _0x56587f?{'count':_0x2d218f,'rows':_0x56587f}:null;}})[_0x632b('0x14')](respondWithResult(_0x45eaef,null))[_0x632b('0x1d')](handleError(_0x45eaef,null));};exports[_0x632b('0x145')]=function(_0x1436d8,_0x1d8e1f){return db[_0x632b('0x3a')]['find']({'where':{'id':_0x1436d8[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x1d8e1f,null))[_0x632b('0x14')](function(_0x355f97){if(_0x355f97){return _0x355f97['addOpenchannelAccounts'](_0x1436d8['body'][_0x632b('0x5f')],_[_0x632b('0x129')](_0x1436d8[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x1d8e1f,null))[_0x632b('0x1d')](handleError(_0x1d8e1f,null));};exports['removeOpenchannelAccounts']=function(_0x4fc0b9,_0x52ef9a){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x4fc0b9['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x52ef9a,null))[_0x632b('0x14')](function(_0x5068d3){if(_0x5068d3){return _0x5068d3[_0x632b('0x146')](_0x4fc0b9['query'][_0x632b('0x5f')]);}})[_0x632b('0x14')](respondWithStatusCode(_0x52ef9a,null))['catch'](handleError(_0x52ef9a,null));};exports['getSmsAccounts']=function(_0x1e1b27,_0x32c7a5){var _0x365cb6={};var _0xecb855={};var _0x542a56;var _0x422737;return db['User'][_0x632b('0xc8')]({'where':{'id':_0x1e1b27[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x32c7a5,null))[_0x632b('0x14')](function(_0x5414d9){if(_0x5414d9){_0x542a56=_0x5414d9;_0xecb855[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x147')][_0x632b('0x3b')]);_0xecb855[_0x632b('0x49')]=_['keys'](_0x1e1b27[_0x632b('0x49')]);_0xecb855[_0x632b('0x58')]=_[_0x632b('0x59')](_0xecb855[_0x632b('0x55')],_0xecb855[_0x632b('0x49')]);_0x365cb6[_0x632b('0x45')]=_['intersection'](_0xecb855[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x1e1b27[_0x632b('0x49')][_0x632b('0x5a')]));_0x365cb6[_0x632b('0x45')]=_0x365cb6[_0x632b('0x45')][_0x632b('0x4c')]?_0x365cb6[_0x632b('0x45')]:_0xecb855['model'];_0x365cb6[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x1e1b27['query'][_0x632b('0xcb')]);_0x365cb6[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x1e1b27[_0x632b('0x49')],_0xecb855[_0x632b('0x58')]));if(_0x1e1b27[_0x632b('0x49')]['filter']){_0x365cb6[_0x632b('0xcc')]=_['merge'](_0x365cb6[_0x632b('0xcc')],{'$or':_['map'](_0x365cb6[_0x632b('0x45')],function(_0x233d21){var _0x4a03fd={};_0x4a03fd[_0x233d21]={'$like':'%'+_0x1e1b27[_0x632b('0x49')]['filter']+'%'};return _0x4a03fd;})});}_0x365cb6=_['merge']({},_0x365cb6,_0x1e1b27['options']);return _0x542a56[_0x632b('0x148')](_0x365cb6);}})[_0x632b('0x14')](function(_0x219040){if(_0x219040){_0x422737=_0x219040[_0x632b('0x4c')];if(!_0x1e1b27[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x365cb6[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x1e1b27[_0x632b('0x49')]['limit']);_0x365cb6[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x1e1b27[_0x632b('0x49')][_0x632b('0x22')]);}return _0x542a56[_0x632b('0x148')](_0x365cb6);}})['then'](function(_0x2f9c06){if(_0x2f9c06){return _0x2f9c06?{'count':_0x422737,'rows':_0x2f9c06}:null;}})[_0x632b('0x14')](respondWithResult(_0x32c7a5,null))[_0x632b('0x1d')](handleError(_0x32c7a5,null));};exports['addSmsAccounts']=function(_0x31c1b8,_0x4e2045){return db[_0x632b('0x3a')]['find']({'where':{'id':_0x31c1b8['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x4e2045,null))['then'](function(_0x983c3){if(_0x983c3){return _0x983c3['addSmsAccounts'](_0x31c1b8[_0x632b('0x5c')][_0x632b('0x5f')],_['omit'](_0x31c1b8[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x4e2045,null))[_0x632b('0x1d')](handleError(_0x4e2045,null));};exports[_0x632b('0x149')]=function(_0x58e9a4,_0xc8b491){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x58e9a4[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0xc8b491,null))[_0x632b('0x14')](function(_0x3a1762){if(_0x3a1762){return _0x3a1762[_0x632b('0x149')](_0x58e9a4['query'][_0x632b('0x5f')]);}})[_0x632b('0x14')](respondWithStatusCode(_0xc8b491,null))[_0x632b('0x1d')](handleError(_0xc8b491,null));};exports['getChatWebsites']=function(_0x590088,_0x227e1c){var _0xd847b6={};var _0x59bc6b={};var _0x27d7cc;var _0x5308f2;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x590088[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x227e1c,null))[_0x632b('0x14')](function(_0x24a4c7){if(_0x24a4c7){_0x27d7cc=_0x24a4c7;_0x59bc6b[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x14a')][_0x632b('0x3b')]);_0x59bc6b['query']=_['keys'](_0x590088[_0x632b('0x49')]);_0x59bc6b[_0x632b('0x58')]=_[_0x632b('0x59')](_0x59bc6b['model'],_0x59bc6b[_0x632b('0x49')]);_0xd847b6[_0x632b('0x45')]=_[_0x632b('0x59')](_0x59bc6b['model'],qs[_0x632b('0x5a')](_0x590088['query'][_0x632b('0x5a')]));_0xd847b6[_0x632b('0x45')]=_0xd847b6[_0x632b('0x45')][_0x632b('0x4c')]?_0xd847b6[_0x632b('0x45')]:_0x59bc6b[_0x632b('0x55')];_0xd847b6['order']=qs[_0x632b('0xcb')](_0x590088[_0x632b('0x49')][_0x632b('0xcb')]);_0xd847b6[_0x632b('0xcc')]=qs[_0x632b('0x58')](_[_0x632b('0xcd')](_0x590088[_0x632b('0x49')],_0x59bc6b[_0x632b('0x58')]));if(_0x590088[_0x632b('0x49')][_0x632b('0x3f')]){_0xd847b6[_0x632b('0xcc')]=_[_0x632b('0x5b')](_0xd847b6[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0xd847b6['attributes'],function(_0x3d9808){var _0x47175b={};_0x47175b[_0x3d9808]={'$like':'%'+_0x590088['query']['filter']+'%'};return _0x47175b;})});}_0xd847b6=_[_0x632b('0x5b')]({},_0xd847b6,_0x590088['options']);return _0x27d7cc[_0x632b('0x14b')](_0xd847b6);}})[_0x632b('0x14')](function(_0x3a2e2e){if(_0x3a2e2e){_0x5308f2=_0x3a2e2e[_0x632b('0x4c')];if(!_0x590088[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0xd847b6['limit']=qs[_0x632b('0x25')](_0x590088[_0x632b('0x49')][_0x632b('0x25')]);_0xd847b6['offset']=qs['offset'](_0x590088[_0x632b('0x49')][_0x632b('0x22')]);}return _0x27d7cc[_0x632b('0x14b')](_0xd847b6);}})[_0x632b('0x14')](function(_0x15dc94){if(_0x15dc94){return _0x15dc94?{'count':_0x5308f2,'rows':_0x15dc94}:null;}})[_0x632b('0x14')](respondWithResult(_0x227e1c,null))[_0x632b('0x1d')](handleError(_0x227e1c,null));};exports[_0x632b('0x14c')]=function(_0xe93fe9,_0x25f9bd){return db['User'][_0x632b('0x36')]({'where':{'id':_0xe93fe9[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x25f9bd,null))[_0x632b('0x14')](function(_0xdac6c0){if(_0xdac6c0){return _0xdac6c0[_0x632b('0x14c')](_0xe93fe9['body'][_0x632b('0x5f')],_['omit'](_0xe93fe9[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x25f9bd,null))[_0x632b('0x1d')](handleError(_0x25f9bd,null));};exports[_0x632b('0x14d')]=function(_0x3b4ac1,_0x45ac8e){return db['User'][_0x632b('0x36')]({'where':{'id':_0x3b4ac1[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x45ac8e,null))['then'](function(_0x21b669){if(_0x21b669){return _0x21b669[_0x632b('0x14d')](_0x3b4ac1[_0x632b('0x49')]['ids']);}})[_0x632b('0x14')](respondWithStatusCode(_0x45ac8e,null))[_0x632b('0x1d')](handleError(_0x45ac8e,null));};exports[_0x632b('0x14e')]=function(_0xde4b78,_0x51a5fb){var _0x15dd78={};var _0x15729d={};var _0x102f9f;var _0x4bb7fc;return db['User'][_0x632b('0xc8')]({'where':{'id':_0xde4b78[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x51a5fb,null))[_0x632b('0x14')](function(_0x45c907){if(_0x45c907){_0x102f9f=_0x45c907;_0x15729d[_0x632b('0x55')]=_[_0x632b('0x57')](db[_0x632b('0x14f')][_0x632b('0x3b')]);_0x15729d[_0x632b('0x49')]=_['keys'](_0xde4b78['query']);_0x15729d[_0x632b('0x58')]=_[_0x632b('0x59')](_0x15729d[_0x632b('0x55')],_0x15729d['query']);_0x15dd78[_0x632b('0x45')]=_[_0x632b('0x59')](_0x15729d[_0x632b('0x55')],qs[_0x632b('0x5a')](_0xde4b78['query'][_0x632b('0x5a')]));_0x15dd78[_0x632b('0x45')]=_0x15dd78[_0x632b('0x45')][_0x632b('0x4c')]?_0x15dd78['attributes']:_0x15729d[_0x632b('0x55')];_0x15dd78[_0x632b('0xca')]=qs['sort'](_0xde4b78[_0x632b('0x49')][_0x632b('0xcb')]);_0x15dd78[_0x632b('0xcc')]=qs['filters'](_[_0x632b('0xcd')](_0xde4b78[_0x632b('0x49')],_0x15729d['filters']));if(_0xde4b78[_0x632b('0x49')][_0x632b('0x3f')]){_0x15dd78['where']=_[_0x632b('0x5b')](_0x15dd78[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x15dd78[_0x632b('0x45')],function(_0x7b30a7){var _0x1b2f7d={};_0x1b2f7d[_0x7b30a7]={'$like':'%'+_0xde4b78[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x1b2f7d;})});}_0x15dd78=_[_0x632b('0x5b')]({},_0x15dd78,_0xde4b78['options']);return _0x102f9f[_0x632b('0x14e')](_0x15dd78);}})['then'](function(_0x18ba95){if(_0x18ba95){_0x4bb7fc=_0x18ba95['length'];if(!_0xde4b78[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x15dd78[_0x632b('0x25')]=qs[_0x632b('0x25')](_0xde4b78[_0x632b('0x49')][_0x632b('0x25')]);_0x15dd78[_0x632b('0x22')]=qs[_0x632b('0x22')](_0xde4b78[_0x632b('0x49')][_0x632b('0x22')]);}return _0x102f9f[_0x632b('0x14e')](_0x15dd78);}})[_0x632b('0x14')](function(_0x5a74fb){if(_0x5a74fb){return _0x5a74fb?{'count':_0x4bb7fc,'rows':_0x5a74fb}:null;}})['then'](respondWithResult(_0x51a5fb,null))[_0x632b('0x1d')](handleError(_0x51a5fb,null));};exports[_0x632b('0x150')]=function(_0xfae708,_0x210236){return db['User'][_0x632b('0x36')]({'where':{'id':_0xfae708[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x210236,null))[_0x632b('0x14')](function(_0x157039){if(_0x157039){return _0x157039[_0x632b('0x150')](_0xfae708[_0x632b('0x5c')]['ids'],_[_0x632b('0x129')](_0xfae708[_0x632b('0x5c')],[_0x632b('0x5f'),'id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x210236,null))[_0x632b('0x1d')](handleError(_0x210236,null));};exports[_0x632b('0x151')]=function(_0x2af80a,_0x118fed){return db['User'][_0x632b('0x36')]({'where':{'id':_0x2af80a[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x118fed,null))['then'](function(_0x1036a9){if(_0x1036a9){return _0x1036a9['removeWhatsappAccounts'](_0x2af80a['query'][_0x632b('0x5f')]);}})[_0x632b('0x14')](respondWithStatusCode(_0x118fed,null))['catch'](handleError(_0x118fed,null));};exports['getSquareProjects']=function(_0x55f344,_0x357359){var _0x599d50={};var _0x367df2={};var _0x1021f3;var _0x4a819c;return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x55f344[_0x632b('0x54')]['id']}})['then'](handleEntityNotFound(_0x357359,null))['then'](function(_0x105cbf){if(_0x105cbf){_0x1021f3=_0x105cbf;_0x367df2[_0x632b('0x55')]=_['keys'](db[_0x632b('0x152')][_0x632b('0x3b')]);_0x367df2[_0x632b('0x49')]=_['keys'](_0x55f344['query']);_0x367df2['filters']=_[_0x632b('0x59')](_0x367df2[_0x632b('0x55')],_0x367df2['query']);_0x599d50['attributes']=_[_0x632b('0x59')](_0x367df2[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x55f344[_0x632b('0x49')][_0x632b('0x5a')]));_0x599d50[_0x632b('0x45')]=_0x599d50[_0x632b('0x45')][_0x632b('0x4c')]?_0x599d50[_0x632b('0x45')]:_0x367df2['model'];_0x599d50[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x55f344['query'][_0x632b('0xcb')]);_0x599d50[_0x632b('0xcc')]=qs[_0x632b('0x58')](_['pick'](_0x55f344[_0x632b('0x49')],_0x367df2[_0x632b('0x58')]));if(_0x55f344['query'][_0x632b('0x3f')]){_0x599d50['where']=_[_0x632b('0x5b')](_0x599d50[_0x632b('0xcc')],{'$or':_['map'](_0x599d50[_0x632b('0x45')],function(_0x4416a3){var _0x2e323a={};_0x2e323a[_0x4416a3]={'$like':'%'+_0x55f344['query'][_0x632b('0x3f')]+'%'};return _0x2e323a;})});}_0x599d50=_[_0x632b('0x5b')]({},_0x599d50,_0x55f344[_0x632b('0xd8')]);return _0x1021f3['getSquareProjects'](_0x599d50);}})[_0x632b('0x14')](function(_0x37bb40){if(_0x37bb40){_0x4a819c=_0x37bb40[_0x632b('0x4c')];if(!_0x55f344['query']['hasOwnProperty'](_0x632b('0xd5'))){_0x599d50['limit']=qs['limit'](_0x55f344[_0x632b('0x49')][_0x632b('0x25')]);_0x599d50['offset']=qs[_0x632b('0x22')](_0x55f344[_0x632b('0x49')]['offset']);}return _0x1021f3[_0x632b('0x153')](_0x599d50);}})['then'](function(_0x23788c){if(_0x23788c){return _0x23788c?{'count':_0x4a819c,'rows':_0x23788c}:null;}})['then'](respondWithResult(_0x357359,null))[_0x632b('0x1d')](handleError(_0x357359,null));};exports[_0x632b('0x154')]=function(_0x563a31,_0x53dc5c){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x563a31['params']['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x53dc5c,null))[_0x632b('0x14')](function(_0x458791){if(_0x458791){return _0x458791['addSquareProjects'](_0x563a31[_0x632b('0x5c')][_0x632b('0x5f')],_[_0x632b('0x129')](_0x563a31[_0x632b('0x5c')],['ids','id'])||{});}})[_0x632b('0x14')](respondWithResult(_0x53dc5c,null))[_0x632b('0x1d')](handleError(_0x53dc5c,null));};exports[_0x632b('0x155')]=function(_0x308f33,_0x172bd6){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x308f33[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x172bd6,null))[_0x632b('0x14')](function(_0x57b9e6){if(_0x57b9e6){return _0x57b9e6[_0x632b('0x155')](_0x308f33[_0x632b('0x49')]['ids']);}})[_0x632b('0x14')](respondWithStatusCode(_0x172bd6,null))[_0x632b('0x1d')](handleError(_0x172bd6,null));};exports['getScheduledCalls']=function(_0x11ba04,_0x2120f3){var _0x1be95={},_0x112563={},_0xcdae39={'count':0x0,'rows':[]};var _0x201265=db[_0x632b('0x156')][_0x632b('0x3b')];_0x112563[_0x632b('0x55')]=_[_0x632b('0x57')](_0x201265);_0x112563['query']=_[_0x632b('0x57')](_0x11ba04[_0x632b('0x49')]);_0x112563['filters']=_['intersection'](_0x112563['model'],_0x112563[_0x632b('0x49')]);_0x112563[_0x632b('0x58')]=_[_0x632b('0x101')](_0x112563['filters'],[_0x632b('0x157'),_0x632b('0x158'),_0x632b('0x159'),_0x632b('0x15a'),_0x632b('0x15b'),'$lte',_0x632b('0x15c'),_0x632b('0x15d'),'$not','$between',_0x632b('0x15e'),_0x632b('0x15f'),'$notIn',_0x632b('0x160'),_0x632b('0x161'),'$iLike',_0x632b('0x162'),_0x632b('0x160'),_0x632b('0x163'),'$contains',_0x632b('0x164'),_0x632b('0x165')]);_0x1be95['attributes']=_[_0x632b('0x59')](_0x112563[_0x632b('0x55')],qs[_0x632b('0x5a')](_0x11ba04[_0x632b('0x49')][_0x632b('0x5a')]));_0x1be95['attributes']=_0x1be95[_0x632b('0x45')][_0x632b('0x4c')]?_0x1be95[_0x632b('0x45')]:_0x112563[_0x632b('0x55')];if(!_0x11ba04[_0x632b('0x49')][_0x632b('0xce')](_0x632b('0xd5'))){_0x1be95[_0x632b('0x25')]=qs['limit'](_0x11ba04[_0x632b('0x49')][_0x632b('0x25')]);_0x1be95['offset']=qs[_0x632b('0x22')](_0x11ba04[_0x632b('0x49')]['offset']);}_0x1be95[_0x632b('0xca')]=qs[_0x632b('0xcb')](_0x11ba04['query'][_0x632b('0xcb')]);_0x1be95['where']=qs['filters'](_[_0x632b('0xcd')](_0x11ba04['query'],_0x112563['filters']));if(_0x11ba04[_0x632b('0x49')][_0x632b('0x3f')]){_0x1be95[_0x632b('0xcc')]=_['merge'](_0x1be95[_0x632b('0xcc')],{'$or':_[_0x632b('0x34')](_0x1be95[_0x632b('0x45')],function(_0x1e2612){var _0x20deaa={};_0x20deaa[_0x1e2612]={'$like':'%'+_0x11ba04[_0x632b('0x49')][_0x632b('0x3f')]+'%'};return _0x20deaa;})});}_0x1be95[_0x632b('0xcc')]={'$and':[_0x1be95['where'],{'$or':[{'UserId':_0x11ba04[_0x632b('0x54')]['id']},{'OwnerId':_0x11ba04[_0x632b('0x54')]['id']}]}]};_0x1be95=_[_0x632b('0x5b')]({},_0x1be95,_0x11ba04[_0x632b('0xd8')]);var _0x2185ab={'where':_0x1be95['where']};return db[_0x632b('0x156')]['count'](_0x2185ab)['then'](function(_0x142c4a){_0xcdae39[_0x632b('0x24')]=_0x142c4a;if(_0x11ba04['query'][_0x632b('0x43')]){_0x1be95[_0x632b('0x44')]=[{'attributes':['id','firstName','lastName',_0x632b('0x166')],'model':db['CmContact'],'as':_0x632b('0x167')},{'attributes':['id',_0x632b('0x37'),_0x632b('0x168')],'model':db['VoiceQueue'],'as':_0x632b('0xd7')}];}return db['CmHopper'][_0x632b('0x47')](_0x1be95);})[_0x632b('0x14')](function(_0x4c8877){_0xcdae39[_0x632b('0x48')]=_0x4c8877;return _0xcdae39;})[_0x632b('0x14')](respondWithFilteredResult(_0x2120f3,_0x1be95))[_0x632b('0x1d')](handleError(_0x2120f3,null));};exports['getApiKey']=function(_0x5f1272,_0x33028d){if(!_[_0x632b('0x66')](_0x5f1272['user']['id'])&&(_0x5f1272['user'][_0x632b('0x2b')]=='admin'||_0x5f1272[_0x632b('0x2e')][_0x632b('0x2b')]==_0x632b('0x2e'))){return db[_0x632b('0x3a')][_0x632b('0xc8')]({'where':{'id':_0x5f1272[_0x632b('0x54')]['id']},'raw':!![]})[_0x632b('0x14')](function(_0x364a7e){return authService[_0x632b('0x169')](_0x364a7e);})[_0x632b('0x14')](function(_0x5eecee){if(_0x5eecee){return _0x33028d[_0x632b('0x1f')](0xc8)[_0x632b('0x21')]({'api_key':_0x5eecee[_0x632b('0x16a')]});}else{return _0x33028d['status'](0xcc)['json']({'message':_0x632b('0x16b')});}})[_0x632b('0x1d')](handleError(_0x33028d,0x193));}else{return _0x33028d['status'](0x191)[_0x632b('0x21')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x632b('0x16c')]=function(_0x878fe7,_0x53dc58){if(!_[_0x632b('0x66')](_0x878fe7[_0x632b('0x2e')]['id'])&&(_0x878fe7['user']['role']==_0x632b('0x2c')||_0x878fe7[_0x632b('0x2e')]['role']==_0x632b('0x2e'))){return db['User']['find']({'where':{'id':_0x878fe7[_0x632b('0x54')]['id']}})[_0x632b('0x14')](function(_0x46a23c){return authService[_0x632b('0x16d')](_0x46a23c);})[_0x632b('0x14')](function(_0xdc9fb2){return db[_0x632b('0x3a')][_0x632b('0x28')]({'apiKeyIat':_0xdc9fb2['iat'],'apiKeyNonce':_0xdc9fb2['nonce']},{'where':{'id':_0x878fe7[_0x632b('0x54')]['id']}})[_0x632b('0x14')](function(){return _0x53dc58[_0x632b('0x1f')](0xc8)['json']({'api_key':_0xdc9fb2[_0x632b('0x16a')]});});})[_0x632b('0x1d')](handleError(_0x53dc58,0x193));}else{return _0x53dc58[_0x632b('0x1f')](0x191)[_0x632b('0x21')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['removeApiKey']=function(_0x2684ff,_0x668d1d){if(!_['isNil'](_0x2684ff[_0x632b('0x2e')]['id'])&&(_0x2684ff[_0x632b('0x2e')][_0x632b('0x2b')]==_0x632b('0x2c')||_0x2684ff[_0x632b('0x2e')][_0x632b('0x2b')]==_0x632b('0x2e'))){return db[_0x632b('0x3a')][_0x632b('0x36')]({'where':{'id':_0x2684ff[_0x632b('0x54')]['id']}})[_0x632b('0x14')](handleEntityNotFound(_0x668d1d,null))[_0x632b('0x14')](function(_0x2e8ab0){if(_0x2e8ab0&&_0x2e8ab0['apiKeyNonce']&&_0x2e8ab0[_0x632b('0x16e')])return _0x2e8ab0;else throw{'message':'API\x20key\x20not\x20available'};})[_0x632b('0x14')](function(_0x4226ce){return db[_0x632b('0x3a')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x2684ff[_0x632b('0x54')]['id']}});})[_0x632b('0x14')](respondWithStatusCode(_0x668d1d,0xc8))['catch'](handleError(_0x668d1d,0x193));}else{return _0x668d1d['status'](0x191)[_0x632b('0x21')]({'message':_0x632b('0x16f')});}};exports[_0x632b('0x170')]=function(_0x37a7c9,_0x36a82b){var _0x260a16=_0x37a7c9[_0x632b('0x2e')][_0x632b('0x2a')]({'plain':!![]});if(!_0x260a16){return _0x36a82b[_0x632b('0x1f')](0x191)[_0x632b('0x127')](_0x632b('0x171'));}else{return _0x36a82b['status'](0xc8)[_0x632b('0x21')](_0x260a16);}};exports[_0x632b('0x172')]=function(_0x324437,_0x420945){var _0x54694b={'offset':0x0},_0x78dcc9={'count':0x0,'rows':[]};Promise[_0x632b('0x103')]()[_0x632b('0x14')](function(){if(!_0x324437[_0x632b('0x49')][_0x632b('0x3f')]&&!_0x324437[_0x632b('0x49')][_0x632b('0x173')]&&!_0x324437[_0x632b('0x49')][_0x632b('0x174')])return[];return Promise[_0x632b('0x103')]()[_0x632b('0x14')](function(){var _0x5a7439=[];if(!_['isEmpty'](_0x324437[_0x632b('0x49')]['teams'])){_0x5a7439[_0x632b('0x46')](db[_0x632b('0x122')]['findAll']({'attributes':['id',_0x632b('0x37')],'where':{'id':_0x324437[_0x632b('0x49')][_0x632b('0x173')]}}));}if(!_[_0x632b('0x85')](_0x324437[_0x632b('0x49')][_0x632b('0x174')])){_0x5a7439[_0x632b('0x46')](db['VoiceQueue']['findAll']({'attributes':['id',_0x632b('0x37')],'type':'inbound','where':{'id':_0x324437[_0x632b('0x49')][_0x632b('0x174')]}}));}return Promise[_0x632b('0x53')](_0x5a7439);})[_0x632b('0x14')](function(_0x37479a){var _0x1bcf51=_[_0x632b('0x11e')](_0x37479a)[_0x632b('0x34')](function(_0x40c4c9){return _0x40c4c9[_0x632b('0x175')]({'attributes':['id',_0x632b('0x37'),_0x632b('0x60'),_0x632b('0xa4')],'raw':!![]});});return Promise[_0x632b('0x53')](_0x1bcf51);})[_0x632b('0x14')](function(_0x1eef8f){var _0x350cfd=_['flatten'](_0x1eef8f);if(!_0x324437[_0x632b('0x49')]['filter'])return _0x350cfd;if(_[_0x632b('0x85')](_0x350cfd)){return db['User'][_0x632b('0x47')]({'attributes':['id',_0x632b('0x37'),_0x632b('0x60'),_0x632b('0xa4')],'where':{'role':_0x632b('0x30'),'$or':[db[_0x632b('0x68')][_0x632b('0xcc')](db[_0x632b('0x68')]['fn']('lower',db['sequelize']['col'](_0x632b('0x37'))),{'$like':'%'+_0x324437['query'][_0x632b('0x3f')][_0x632b('0xa0')]()+'%'}),{'internal':{'$like':'%'+_0x324437[_0x632b('0x49')][_0x632b('0x3f')]+'%'}}]},'raw':!![]});}else{return _(_0x350cfd)[_0x632b('0x11e')]()['filter'](function(_0x525b5a){return _0x525b5a[_0x632b('0x37')][_0x632b('0xa0')]()[_0x632b('0x40')](_0x324437[_0x632b('0x49')]['filter']['toLowerCase']())||_0x525b5a['internal']['toString']()['includes'](_0x324437[_0x632b('0x49')][_0x632b('0x3f')]);})[_0x632b('0x35')]();}})[_0x632b('0x14')](function(_0x18c0ba){var _0x5db4f2=_0x632b('0x37');var _0x14bd95=_0x632b('0x176');if(_0x324437[_0x632b('0x49')]['sort']){var _0x14bd95=_0x324437[_0x632b('0x49')][_0x632b('0xcb')][0x0]==='-'?_0x632b('0x177'):_0x632b('0x176');var _0x5db4f2=_0x14bd95===_0x632b('0x176')?_0x324437['query']['sort']:_0x324437[_0x632b('0x49')][_0x632b('0xcb')][_0x632b('0x178')](0x1);}return _(_0x18c0ba)['uniqBy']('id')['orderBy']([function(_0x26ceef){return _0x5db4f2===_0x632b('0x37')?_0x26ceef[_0x5db4f2][_0x632b('0xa0')]():_0x26ceef[_0x5db4f2];}],[_0x14bd95])[_0x632b('0x34')](function(_0x29cc99){return _[_0x632b('0xcd')](_0x29cc99,['id','name',_0x632b('0x60'),_0x632b('0xa4')]);})[_0x632b('0x35')]();})['then'](function(_0x3153c8){return client[_0x632b('0x13')](_0x632b('0x2f'),_0x324437)[_0x632b('0x14')](function(_0x350204){if(_0x350204[_0x632b('0x19')])throw new Error(_0x632b('0x179'));var _0x2d9725=_0x350204[_0x632b('0x17a')];var _0x156ed9=jayson[_0x632b('0x17b')][_0x632b('0x12')]({'port':0x232c});return _0x156ed9[_0x632b('0x13')]('Agents',_0x324437)[_0x632b('0x14')](function(_0x133af6){if(_0x133af6[_0x632b('0x19')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x32baf3=_0x133af6[_0x632b('0x17a')];return _['merge']({},_0x32baf3,_0x2d9725);});})[_0x632b('0x14')](function(_0x20607a){return _['map'](_0x3153c8,function(_0x4bae95){var _0x55aae1=_[_0x632b('0x36')](_0x20607a[_0x632b('0x48')],['id',_0x4bae95['id']]);if(!_0x55aae1||!_0x4bae95[_0x632b('0xa4')]){_0x4bae95[_0x632b('0x1f')]=_0x632b('0x17c');}else if(_0x55aae1['voicePause']){_0x4bae95['status']=_0x632b('0x105');}else{_0x4bae95[_0x632b('0x1f')]=_[_0x632b('0x40')](['idle',_0x632b('0x17d'),_0x632b('0x17e'),_0x632b('0x17f'),null,undefined],_0x55aae1['voiceStatus'])?_0x632b('0xa4'):_0x632b('0x180');}return _0x4bae95;});});});})[_0x632b('0x14')](function(_0x447c71){if(!_0x324437['query'][_0x632b('0xce')](_0x632b('0xd5'))){_0x54694b[_0x632b('0x25')]=qs[_0x632b('0x25')](_0x324437[_0x632b('0x49')][_0x632b('0x25')]||0xa);_0x54694b['offset']=qs[_0x632b('0x22')](_0x324437[_0x632b('0x49')]['offset']);}_0x78dcc9[_0x632b('0x24')]=_0x447c71[_0x632b('0x4c')];_0x78dcc9['rows']=_0x54694b[_0x632b('0x25')]?_0x447c71[_0x632b('0x181')](_0x54694b[_0x632b('0x22')],_0x54694b[_0x632b('0x22')]+_0x54694b[_0x632b('0x25')]):_0x447c71;return _0x78dcc9;})[_0x632b('0x14')](respondWithFilteredResult(_0x420945,_0x54694b))[_0x632b('0x1d')](handleError(_0x420945,null));};function get_open_tabs(_0x29e58d,_0x497554){var _0x52d0bd=_0x29e58d[_0x632b('0x182')](0x0)[_0x632b('0x183')]()+_0x29e58d[_0x632b('0x181')](0x1);var _0x4894a9={'type':db[_0x632b('0x8a')][_0x632b('0x6a')][_0x632b('0x184')],'raw':!![]};return new BPromise(function(_0x486932,_0x4eb18b){var _0x1fd087=squel[_0x632b('0x185')]()[_0x632b('0x186')](_0x632b('0x187')+_0x52d0bd+'InteractionId','id')[_0x632b('0x186')]('ui.createdAt')['from'](_0x632b('0x188')+_0x29e58d+_0x632b('0x189'),'ui')[_0x632b('0xcc')](_0x632b('0x18a'),_0x497554['id']);return db[_0x632b('0x68')]['query'](_0x1fd087['toString'](),_0x4894a9)['then'](function(_0x450cad){_0x497554[_0x52d0bd+_0x632b('0x18b')]=_0x450cad;_0x486932(_0x450cad);})['catch'](function(_0x5e3c6f){_0x4eb18b(_0x5e3c6f);});});};
\ No newline at end of file
+var _0x0972=['user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$gt','$gte','$lt','$lte','$not','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','inbound','lower','toString','asc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','busy','slice','charAt','select','field','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','OpenTabs','bluebird','path','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','role','admin','Users','user','agent','telephone','filter','ignore','map','value','includes','find','UserProfileResource','sendStatus','name','send','index','fieldName','type','key','password','salt','where','User','query','includeAll','include','attributes','push','findAll','rows','openTabs','length','chat','sms','dataValues','mail','openchannel','whatsapp','show','params','model','keys','fields','merge','true','fax','all','update','body','describe','addContacts','omit','internal','Setting','findById','securePassword','max','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','QueryTypes','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','113','110','105','106','107','108','109','100','111','114','115','create','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Agents','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','each','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','ids','spread','QueueId','emit','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','penalty','upsert','removeQueues','channel','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','findOne','rawAttributes','filters','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','tag','nolimit','Queue','intersection','options','Unknown\x20role','getVoiceQueuesRt','getGroups','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','QueuePause','pause','DEFAULT\x20PAUSE','unpause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','Pause','getTeams','addTeams','Team','setDataValue','Voice','Chat','getWhatsappQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','removeTeams','getChatQueues','getMailQueues','Mail','getSmsQueues','Sms','Whatsapp','getFaxQueues','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray'];(function(_0x27eccf,_0x169725){var _0x53d8f8=function(_0x577393){while(--_0x577393){_0x27eccf['push'](_0x27eccf['shift']());}};_0x53d8f8(++_0x169725);}(_0x0972,0x64));var _0x2097=function(_0x2feed7,_0x147eaa){_0x2feed7=_0x2feed7-0x0;var _0x2c25a5=_0x0972[_0x2feed7];return _0x2c25a5;};'use strict';var moment=require('moment');var BPromise=require(_0x2097('0x0'));var util=require('util');var path=require(_0x2097('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2097('0x2'));var jayson=require(_0x2097('0x3'));var Redis=require('ioredis');var authService=require(_0x2097('0x4'));var qs=require(_0x2097('0x5'));var logger=require(_0x2097('0x6'))(_0x2097('0x7'));var utils=require(_0x2097('0x8'));var config=require(_0x2097('0x9'));var licenseUtil=require(_0x2097('0xa'));var db=require('../../mysqldb')['db'];var socket=require(_0x2097('0xb'))(new Redis(config[_0x2097('0xc')]));require(_0x2097('0xd'))[_0x2097('0xe')](socket);config[_0x2097('0xc')]=_['defaults'](config[_0x2097('0xc')],{'host':_0x2097('0xf'),'port':0x18eb});var client=jayson[_0x2097('0x10')][_0x2097('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x7baeb3,_0x3b5847,_0x3d5519,_0x1d1166){return new BPromise(function(_0x334f4d,_0x23a762){var _0x2cc91c=_0x1d1166||client;return _0x2cc91c[_0x2097('0x12')](_0x7baeb3,_0x3d5519)[_0x2097('0x13')](function(_0x16871b){logger[_0x2097('0x14')](_0x2097('0x15'),_0x3b5847,_0x2097('0x16'));logger[_0x2097('0x17')](_0x2097('0x18'),_0x3b5847,_0x2097('0x16'),JSON['stringify'](_0x16871b));if(_0x16871b[_0x2097('0x19')]){if(_0x16871b[_0x2097('0x19')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x3b5847,_0x16871b[_0x2097('0x19')]['message']);return _0x23a762(_0x16871b[_0x2097('0x19')][_0x2097('0x1a')]);}logger[_0x2097('0x19')](_0x2097('0x15'),_0x3b5847,_0x16871b[_0x2097('0x19')]['message']);return _0x334f4d(_0x16871b[_0x2097('0x19')][_0x2097('0x1a')]);}else{logger[_0x2097('0x14')](_0x2097('0x15'),_0x3b5847,_0x2097('0x16'));_0x334f4d(_0x16871b[_0x2097('0x1b')][_0x2097('0x1a')]);}})[_0x2097('0x1c')](function(_0x5d8b9e){logger['error'](_0x2097('0x15'),_0x3b5847,_0x5d8b9e);_0x23a762(_0x5d8b9e);});});}function respondWithStatusCode(_0x569c21,_0x227c00){_0x227c00=_0x227c00||0xcc;return function(_0x1ac5f1){if(_0x1ac5f1){return _0x569c21['sendStatus'](_0x227c00);}return _0x569c21[_0x2097('0x1d')](_0x227c00)['end']();};}function respondWithResult(_0x2e17c8,_0xf32d3f){_0xf32d3f=_0xf32d3f||0xc8;return function(_0x36189e){if(_0x36189e){return _0x2e17c8[_0x2097('0x1d')](_0xf32d3f)[_0x2097('0x1e')](_0x36189e);}};}function respondWithFilteredResult(_0x35047b,_0x56390a){return function(_0xae5f9){if(_0xae5f9){var _0x500234=typeof _0x56390a[_0x2097('0x1f')]===_0x2097('0x20')&&typeof _0x56390a[_0x2097('0x21')]===_0x2097('0x20');var _0x499988=_0xae5f9[_0x2097('0x22')];var _0x80c5ee=_0x500234?0x0:_0x56390a['offset'];var _0x1229fc=_0x500234?_0xae5f9['count']:_0x56390a[_0x2097('0x1f')]+_0x56390a['limit'];var _0xbc0339;if(_0x1229fc>=_0x499988){_0x1229fc=_0x499988;_0xbc0339=0xc8;}else{_0xbc0339=0xce;}_0x35047b[_0x2097('0x1d')](_0xbc0339);return _0x35047b[_0x2097('0x23')](_0x2097('0x24'),_0x80c5ee+'-'+_0x1229fc+'/'+_0x499988)[_0x2097('0x1e')](_0xae5f9);}return null;};}function saveUpdates(_0x36228c){return function(_0x450e0b){if(_0x450e0b){return _0x450e0b['update'](_0x36228c)[_0x2097('0x13')](function(_0x14d964){return _0x14d964;});}return null;};}function removeEntity(_0x5cce55){return function(_0x1398d0){if(_0x1398d0){return _0x1398d0[_0x2097('0x25')]()['then'](function(){var _0x4d0916=_0x1398d0[_0x2097('0x26')]({'plain':!![]});if(_0x4d0916[_0x2097('0x27')]===_0x2097('0x28'))return;var _0x3589bb=[{'name':_0x2097('0x29'),'value':_0x2097('0x2a'),'ignore':!![]},{'name':'Agents','value':_0x2097('0x2b'),'ignore':![]},{'name':'Telephones','value':_0x2097('0x2c'),'ignore':![]}];var _0x3c36d3=_(_0x3589bb)[_0x2097('0x2d')](_0x2097('0x2e'))[_0x2097('0x2f')](_0x2097('0x30'))[_0x2097('0x30')]();if(_[_0x2097('0x31')](_0x3c36d3,_0x4d0916[_0x2097('0x27')])){return;}var _0x5c89ab=_[_0x2097('0x32')](_0x3589bb,[_0x2097('0x30'),_0x4d0916[_0x2097('0x27')]])['name'];return db[_0x2097('0x33')][_0x2097('0x25')]({'where':{'type':_0x5c89ab,'resourceId':_0x4d0916['id']}})[_0x2097('0x13')](function(){return _0x1398d0;});})[_0x2097('0x13')](function(){_0x5cce55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5689f6){return function(_0x3484ff){if(!_0x3484ff){_0x5689f6[_0x2097('0x34')](0x194);}return _0x3484ff;};}function handleError(_0x4123b7,_0x133c4c){_0x133c4c=_0x133c4c||0x1f4;return function(_0x3710e0){logger[_0x2097('0x19')](_0x3710e0['stack']);if(_0x3710e0[_0x2097('0x35')]){delete _0x3710e0[_0x2097('0x35')];}_0x4123b7[_0x2097('0x1d')](_0x133c4c)[_0x2097('0x36')](_0x3710e0);};}exports[_0x2097('0x37')]=function(_0x300498,_0x52b937){var _0x3ab83b={},_0x1a8fc9={'count':0x0,'rows':[]};var _0xac1672=_(db['User']['rawAttributes'])[_0x2097('0x2f')](function(_0x372693){return{'name':_0x372693[_0x2097('0x38')],'type':_0x372693[_0x2097('0x39')][_0x2097('0x3a')]};})[_0x2097('0x2d')](function(_0x14547f){return!_[_0x2097('0x31')]([_0x2097('0x3b'),_0x2097('0x3c')],_0x14547f[_0x2097('0x35')]);})[_0x2097('0x30')]();_0x3ab83b=qs['getOptions'](_0xac1672,_0x300498);var _0x1deb80={'where':_0x3ab83b[_0x2097('0x3d')]};return db[_0x2097('0x3e')]['count'](_0x1deb80)[_0x2097('0x13')](function(_0x16eed0){_0x1a8fc9[_0x2097('0x22')]=_0x16eed0;if(_0x300498[_0x2097('0x3f')][_0x2097('0x40')]){_0x3ab83b[_0x2097('0x41')]=[{'all':!![]}];}if(!_[_0x2097('0x31')](_0x3ab83b[_0x2097('0x42')],'id')){_0x3ab83b['attributes'][_0x2097('0x43')]('id');}return db[_0x2097('0x3e')][_0x2097('0x44')](_0x3ab83b);})[_0x2097('0x13')](function(_0x12e0e2){_0x1a8fc9[_0x2097('0x45')]=_0x12e0e2;if(_0x300498[_0x2097('0x3f')][_0x2097('0x46')]==='true'){var _0x3fc3fe=[];for(var _0x5869d8=0x0;_0x5869d8<_0x1a8fc9[_0x2097('0x45')][_0x2097('0x47')];_0x5869d8++){_0x3fc3fe[_0x2097('0x43')](get_open_tabs(_0x2097('0x48'),_0x1a8fc9[_0x2097('0x45')][_0x5869d8]['dataValues']));_0x3fc3fe[_0x2097('0x43')](get_open_tabs(_0x2097('0x49'),_0x1a8fc9[_0x2097('0x45')][_0x5869d8][_0x2097('0x4a')]));_0x3fc3fe[_0x2097('0x43')](get_open_tabs('fax',_0x1a8fc9[_0x2097('0x45')][_0x5869d8][_0x2097('0x4a')]));_0x3fc3fe[_0x2097('0x43')](get_open_tabs(_0x2097('0x4b'),_0x1a8fc9[_0x2097('0x45')][_0x5869d8][_0x2097('0x4a')]));_0x3fc3fe[_0x2097('0x43')](get_open_tabs(_0x2097('0x4c'),_0x1a8fc9['rows'][_0x5869d8][_0x2097('0x4a')]));_0x3fc3fe[_0x2097('0x43')](get_open_tabs(_0x2097('0x4d'),_0x1a8fc9[_0x2097('0x45')][_0x5869d8]['dataValues']));}return BPromise['all'](_0x3fc3fe)['then'](function(_0xdf0b6e){return _0x1a8fc9;});}else{return _0x1a8fc9;}})[_0x2097('0x13')](respondWithFilteredResult(_0x52b937,_0x3ab83b))['catch'](handleError(_0x52b937,null));};exports[_0x2097('0x4e')]=function(_0x3f3798,_0x5daafd){var _0x593033={'raw':![],'where':{'id':_0x3f3798[_0x2097('0x4f')]['id']}},_0x23acf3={};_0x23acf3[_0x2097('0x50')]=_['differenceBy'](_[_0x2097('0x51')](db[_0x2097('0x3e')]['rawAttributes']),[_0x2097('0x3b'),_0x2097('0x3c')]);_0x23acf3[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3f3798[_0x2097('0x3f')]);_0x23acf3['filters']=_['intersection'](_0x23acf3[_0x2097('0x50')],_0x23acf3[_0x2097('0x3f')]);_0x593033[_0x2097('0x42')]=_['intersection'](_0x23acf3['model'],qs[_0x2097('0x52')](_0x3f3798[_0x2097('0x3f')]['fields']));_0x593033[_0x2097('0x42')]=_0x593033[_0x2097('0x42')][_0x2097('0x47')]?_0x593033[_0x2097('0x42')]:_0x23acf3[_0x2097('0x50')];if(_0x3f3798['query'][_0x2097('0x40')]){_0x593033[_0x2097('0x41')]=[{'all':!![]}];}_0x593033=_[_0x2097('0x53')]({},_0x593033,_0x3f3798['options']);if(!_[_0x2097('0x31')](_0x593033[_0x2097('0x42')],'id')){_0x593033['attributes'][_0x2097('0x43')]('id');}return db['User'][_0x2097('0x32')](_0x593033)['then'](handleEntityNotFound(_0x5daafd,null))['then'](function(_0x5d4f35){var _0x40cbe1=[];values=_0x5d4f35;if(_0x3f3798['query']['openTabs']===_0x2097('0x54')){_0x40cbe1['push'](get_open_tabs(_0x2097('0x48'),_0x5d4f35[_0x2097('0x4a')]));_0x40cbe1['push'](get_open_tabs(_0x2097('0x49'),_0x5d4f35[_0x2097('0x4a')]));_0x40cbe1[_0x2097('0x43')](get_open_tabs(_0x2097('0x4c'),_0x5d4f35[_0x2097('0x4a')]));_0x40cbe1['push'](get_open_tabs(_0x2097('0x4d'),_0x5d4f35['dataValues']));_0x40cbe1[_0x2097('0x43')](get_open_tabs(_0x2097('0x55'),_0x5d4f35[_0x2097('0x4a')]));_0x40cbe1['push'](get_open_tabs(_0x2097('0x4b'),_0x5d4f35[_0x2097('0x4a')]));return BPromise[_0x2097('0x56')](_0x40cbe1);}else{return values;}})[_0x2097('0x13')](function(_0x3a93b8){return values;})['then'](respondWithResult(_0x5daafd,null))['catch'](handleError(_0x5daafd,null));};exports[_0x2097('0x57')]=function(_0x275578,_0x4cc782){if(_0x275578['body']['id']){delete _0x275578['body']['id'];}delete _0x275578['body'][_0x2097('0x27')];return db['User'][_0x2097('0x32')]({'where':{'id':_0x275578[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4cc782,null))[_0x2097('0x13')](saveUpdates(_0x275578[_0x2097('0x58')],null))[_0x2097('0x13')](respondWithResult(_0x4cc782,null))[_0x2097('0x1c')](handleError(_0x4cc782,null));};exports[_0x2097('0x59')]=function(_0x60332a,_0x15aa91){return db[_0x2097('0x3e')][_0x2097('0x59')]()['then'](respondWithResult(_0x15aa91,null))[_0x2097('0x1c')](handleError(_0x15aa91,null));};exports[_0x2097('0x5a')]=function(_0x1546d9,_0x4705e1){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x1546d9['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x4705e1,null))[_0x2097('0x13')](function(_0xcabda7){if(_0xcabda7){return _0xcabda7[_0x2097('0x5a')](_0x1546d9[_0x2097('0x58')]['ids'],_[_0x2097('0x5b')](_0x1546d9[_0x2097('0x58')],['ids','id'])||{});}})['then'](respondWithResult(_0x4705e1,null))['catch'](handleError(_0x4705e1,null));};function validateUser(_0x8bf114){return new BPromise(function(_0x13456b,_0x319d3b){if(_0x8bf114[_0x2097('0x5c')])return _0x13456b(_0x8bf114);return db[_0x2097('0x5d')][_0x2097('0x5e')](0x1)[_0x2097('0x13')](function(_0x2ce256){if(_0x2ce256[_0x2097('0x5f')])authService['validatePasswordPattern'](_0x8bf114['password']);db[_0x2097('0x3e')][_0x2097('0x60')](_0x2097('0x5c'))[_0x2097('0x13')](function(_0x4649dc){if(_[_0x2097('0x61')](_0x4649dc)){_0x8bf114['internal']=_0x2ce256[_0x2097('0x62')]||0x1;return;}if(_[_0x2097('0x61')](_0x2ce256[_0x2097('0x62')])||_0x2ce256[_0x2097('0x62')]===_0x4649dc){_0x8bf114['internal']=_0x4649dc+0x1;return;}if(_0x2ce256['min_internal']>_0x4649dc){_0x8bf114[_0x2097('0x5c')]=_0x2ce256[_0x2097('0x62')];return;}return db['sequelize'][_0x2097('0x3f')](_0x2097('0x63'),{'type':db[_0x2097('0x64')][_0x2097('0x65')][_0x2097('0x66')]})[_0x2097('0x13')](function(_0x10f891){if(_0x10f891&&_0x10f891[_0x2097('0x47')]){for(var _0x54159e=0x0,_0x4533fd=_0x10f891[_0x2097('0x47')];_0x54159e<_0x4533fd&&_['isNil'](_0x8bf114[_0x2097('0x5c')]);_0x54159e++){if(_0x2ce256[_0x2097('0x62')]<=_0x10f891[_0x54159e][_0x2097('0x67')]){_0x8bf114[_0x2097('0x5c')]=_0x10f891[_0x54159e][_0x2097('0x67')];}else if(_0x2ce256[_0x2097('0x62')]>_0x10f891[_0x54159e][_0x2097('0x67')]&&_0x2ce256[_0x2097('0x62')]<=_0x10f891[_0x54159e]['to']){_0x8bf114[_0x2097('0x5c')]=_0x2ce256[_0x2097('0x62')];}}}if(_[_0x2097('0x61')](_0x8bf114['internal'])){_0x8bf114[_0x2097('0x5c')]=_0x4649dc+0x1;}return _0x13456b(_0x8bf114);});});})[_0x2097('0x1c')](function(_0x44b7f8){_0x319d3b(_0x44b7f8);});});}function updateUser(_0x374d9a){return new BPromise(function(_0x3c9e03,_0x4eb6f9){try{if(_0x374d9a[_0x2097('0x68')]){_0x374d9a[_0x2097('0x69')]=_0x374d9a[_0x2097('0x5c')];_0x374d9a['VoiceMail']={'mailbox':_0x374d9a[_0x2097('0x5c')],'password':_0x374d9a['password'],'fullname':_0x374d9a[_0x2097('0x6a')],'email':_0x374d9a['email']};}if(_0x374d9a[_0x2097('0x27')]==='agent'){if(!_0x374d9a[_0x2097('0x6b')])_0x374d9a['permissions']=[_0x2097('0x6c'),_0x2097('0x6d'),_0x2097('0x6e'),_0x2097('0x6f'),_0x2097('0x70'),'104',_0x2097('0x71'),_0x2097('0x72'),_0x2097('0x73'),_0x2097('0x74'),_0x2097('0x75'),_0x2097('0x76'),_0x2097('0x77'),_0x2097('0x78'),_0x2097('0x79')];}_0x3c9e03(_0x374d9a);}catch(_0x367e8f){_0x4eb6f9(_0x367e8f);}});}exports[_0x2097('0x7a')]=function(_0x32d3ca,_0x3da8b2){if(_0x32d3ca[_0x2097('0x2a')][_0x2097('0x27')]===_0x2097('0x2b'))throw new Error('Unauthorized');if(_0x32d3ca[_0x2097('0x58')]['role']==='user'&&_0x32d3ca[_0x2097('0x2a')][_0x2097('0x27')]!==_0x2097('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x32d3ca[_0x2097('0x58')][_0x2097('0x27')]===_0x2097('0x28')&&_0x32d3ca[_0x2097('0x2a')]['role']!==_0x2097('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x2097('0x7b')]([_0x32d3ca[_0x2097('0x58')]])[_0x2097('0x13')](function(){return validateUser(_0x32d3ca[_0x2097('0x58')]);})['then'](function(_0x40a1df){return updateUser(_0x40a1df)[_0x2097('0x13')](function(_0x31ec19){if(_0x31ec19['role']===_0x2097('0x28')){_0x31ec19[_0x2097('0x7c')]=_0x32d3ca[_0x2097('0x2a')]['settingsEnabled'];delete _0x31ec19[_0x2097('0x7d')];}return _0x31ec19;});})[_0x2097('0x13')](function(_0x266d21){return db[_0x2097('0x3e')][_0x2097('0x7a')](_0x266d21,{'include':[{'model':db[_0x2097('0x7e')],'as':'VoiceMail'}]});})['then'](function(_0xc7481d){if(_0x32d3ca[_0x2097('0x58')][_0x2097('0x27')]===_0x2097('0x2a'))return _0xc7481d;if(_0x32d3ca[_0x2097('0x2a')][_0x2097('0x27')]!=='user')return _0xc7481d;return db[_0x2097('0x7f')][_0x2097('0x32')]({'where':{'name':_0xc7481d[_0x2097('0x27')]===_0x2097('0x2b')?_0x2097('0x80'):_0x2097('0x81'),'userProfileId':_0x32d3ca[_0x2097('0x2a')]['userProfileId']},'raw':!![]})[_0x2097('0x13')](function(_0x1cc8f9){if(!_0x1cc8f9||_0x1cc8f9[_0x2097('0x82')]!=0x0)return _0xc7481d;return db[_0x2097('0x33')][_0x2097('0x7a')]({'name':_0xc7481d[_0x2097('0x35')],'resourceId':_0xc7481d['id'],'type':_0x1cc8f9['name'],'sectionId':_0x1cc8f9['id']},{})['then'](function(){return _0xc7481d;});})[_0x2097('0x1c')](function(_0x5063b5){logger['error'](_0x2097('0x83'),_0x5063b5);throw _0x5063b5;});})[_0x2097('0x13')](respondWithResult(_0x3da8b2,0xc9))[_0x2097('0x1c')](handleError(_0x3da8b2,null));};exports[_0x2097('0x84')]=function(_0x24dd2c,_0x21c9fc){var _0x290481=_0x24dd2c[_0x2097('0x58')];var _0x5c14a3=[];if(_0x24dd2c[_0x2097('0x2a')][_0x2097('0x27')]===_0x2097('0x2b'))throw new Error(_0x2097('0x85'));if(_[_0x2097('0x86')](_0x290481,['role',_0x2097('0x2a')])&&_0x24dd2c[_0x2097('0x2a')][_0x2097('0x27')]!==_0x2097('0x28')){throw new Error(_0x2097('0x87'));}if(_[_0x2097('0x86')](_0x290481,['role',_0x2097('0x28')])&&_0x24dd2c[_0x2097('0x2a')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x290481)[_0x2097('0x13')](function(){return validateUser(_0x290481[0x0]);})[_0x2097('0x13')](function(){for(var _0x3fe29e=0x1;_0x3fe29e<_0x290481[_0x2097('0x47')];_0x3fe29e++){var _0x1787aa=_0x290481[_0x3fe29e-0x1]['internal'];if(!_0x290481[_0x3fe29e][_0x2097('0x5c')])_0x290481[_0x3fe29e][_0x2097('0x5c')]=_0x1787aa+0x1;_0x5c14a3[_0x2097('0x43')](validateUser(_0x290481[_0x3fe29e]));}return BPromise[_0x2097('0x56')](_0x5c14a3);})[_0x2097('0x13')](function(){_0x5c14a3=[];for(var _0x20ca48=0x0;_0x20ca48<_0x290481['length'];_0x20ca48++){_0x5c14a3[_0x2097('0x43')](updateUser(_0x290481[_0x20ca48]));}return BPromise[_0x2097('0x56')](_0x5c14a3);})['then'](function(){return BPromise[_0x2097('0x88')](_0x290481,function(_0x358bc3){return db[_0x2097('0x3e')][_0x2097('0x7a')](_0x358bc3,{'include':[{'model':db[_0x2097('0x7e')],'as':'VoiceMail'}]})[_0x2097('0x13')](function(_0x35570d){_0x358bc3['id']=_0x35570d['id'];return _0x358bc3;});});})[_0x2097('0x13')](function(_0x26a3e5){if(_0x24dd2c[_0x2097('0x58')][_0x2097('0x27')]===_0x2097('0x2a'))return _0x26a3e5;if(_0x24dd2c[_0x2097('0x2a')][_0x2097('0x27')]!==_0x2097('0x2a'))return _0x26a3e5;var _0x1baedb=_[_0x2097('0x86')](_0x26a3e5,function(_0x10afa0){return _0x10afa0['role']==='agent'||_0x10afa0[_0x2097('0x27')]==='telephone';});if(!_0x1baedb)return _0x26a3e5;return db['UserProfileSection'][_0x2097('0x44')]({'where':{'name':{'$or':[_0x2097('0x80'),_0x2097('0x81')]},'userProfileId':_0x24dd2c[_0x2097('0x2a')][_0x2097('0x7d')]},'raw':!![]})['then'](function(_0x506a35){if(_[_0x2097('0x89')](_0x506a35)||!_['some'](_0x506a35,[_0x2097('0x82'),0x0]))return _0x26a3e5;_0x5c14a3=[];var _0x581ee7=_(_0x506a35)['map'](function(_0x534916){if(_0x534916['autoAssociation']===0x1)return;return _0x534916['name']===_0x2097('0x80')?_0x2097('0x2b'):_0x2097('0x2c');})[_0x2097('0x8a')]()[_0x2097('0x30')]();for(var _0xa9c5ee=0x0;_0xa9c5ee<_0x26a3e5[_0x2097('0x47')];_0xa9c5ee++){if(!_[_0x2097('0x31')](_0x581ee7,_0x26a3e5[_0xa9c5ee][_0x2097('0x27')]))return;var _0x40f569=_0x26a3e5[_0xa9c5ee][_0x2097('0x27')]===_0x2097('0x2b')?_0x2097('0x80'):_0x2097('0x81');_0x5c14a3[_0x2097('0x43')](db[_0x2097('0x33')][_0x2097('0x7a')]({'name':_0x26a3e5[_0xa9c5ee]['name'],'resourceId':_0x26a3e5[_0xa9c5ee]['id'],'type':_0x40f569,'sectionId':_[_0x2097('0x32')](_0x506a35,[_0x2097('0x35'),_0x40f569])['id']},{}));}return BPromise[_0x2097('0x56')](_0x5c14a3);});})[_0x2097('0x13')](respondWithResult(_0x21c9fc,0xc9))[_0x2097('0x1c')](handleError(_0x21c9fc,null));};exports[_0x2097('0x8b')]=function(_0xfb19f3,_0x1c5ec7){if(_0xfb19f3[_0x2097('0x58')]['id']){delete _0xfb19f3[_0x2097('0x58')]['id'];}return db[_0x2097('0x3e')]['find']({'where':{'id':_0xfb19f3[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](function(_0x1750d9){if(!_0x1750d9)return null;if(_0x1750d9['id']===_0xfb19f3[_0x2097('0x2a')]['id']){if(!_0xfb19f3[_0x2097('0x58')][_0x2097('0x8c')]||!_0xfb19f3['body']['newPassword']){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x8f'));}if(!_0x1750d9['authenticate'](_0xfb19f3[_0x2097('0x58')][_0x2097('0x8c')])){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x90'));}if(_0xfb19f3[_0x2097('0x58')][_0x2097('0x8c')]===_0xfb19f3[_0x2097('0x58')][_0x2097('0x91')]){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x92'));}}else if(_0xfb19f3[_0x2097('0x2a')][_0x2097('0x27')]===_0x2097('0x28')){if(!_0xfb19f3[_0x2097('0x58')][_0x2097('0x91')]){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x93'));}}else if(_0xfb19f3['user'][_0x2097('0x27')]===_0x2097('0x2a')){if(!_0xfb19f3[_0x2097('0x58')][_0x2097('0x91')]){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x93'));}if(_0x1750d9[_0x2097('0x27')]!==_0x2097('0x2b')){throw new db[(_0x2097('0x8d'))]['ValidationError'](_0x2097('0x85'));}}else{throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x85'));}return _0x1750d9;})[_0x2097('0x13')](handleEntityNotFound(_0x1c5ec7,null))[_0x2097('0x13')](function(_0x205965){return db[_0x2097('0x5d')]['findOne']({'attributes':['id',_0x2097('0x5f'),_0x2097('0x94'),_0x2097('0x95')]})[_0x2097('0x13')](function(_0x16f4b1){if(_0x16f4b1[_0x2097('0x5f')])authService[_0x2097('0x96')](_0xfb19f3['body'][_0x2097('0x91')]);if(!_0x16f4b1[_0x2097('0x94')]||!_0x205965['previousPasswords'])return _0x205965;authService[_0x2097('0x97')](_0xfb19f3[_0x2097('0x58')]['newPassword'],_0x205965[_0x2097('0x98')],_0x16f4b1['passwordHistoryLimit']);return _0x205965;})[_0x2097('0x13')](saveUpdates({'password':_0xfb19f3[_0x2097('0x58')]['newPassword'],'passwordResetAt':_0xfb19f3['user']['id']==_0xfb19f3[_0x2097('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x2097('0x99')](_0xfb19f3[_0x2097('0x58')][_0x2097('0x91')],_0x205965[_0x2097('0x98')])},null));})[_0x2097('0x13')](respondWithResult(_0x1c5ec7,null))[_0x2097('0x1c')](handleError(_0x1c5ec7,null));};exports[_0x2097('0x9a')]=function(_0xb53629,_0x516ed6){var _0x168772=_0xb53629[_0x2097('0x58')]['channel'];return db['User'][_0x2097('0x32')]({'where':{'id':_0xb53629[_0x2097('0x4f')]['id']},'attributes':['id',_0x2097('0x35'),_0x2097('0x27'),_0x2097('0x9b'),_0x2097('0x9c'),_0x2097('0x9d'),'interface']})[_0x2097('0x13')](handleEntityNotFound(_0x516ed6,null))[_0x2097('0x13')](function(_0x46fc92){if(_0x46fc92){if(!utils[_0x2097('0x9e')](_0x168772)){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x9f'));}return _0x46fc92[_0x2097('0xa0')+_[_0x2097('0xa1')](_0x168772[_0x2097('0xa2')]())+_0x2097('0xa3')](_0xb53629['body'][_0x2097('0xa4')],{'penalty':_0xb53629[_0x2097('0x58')]['penalty']||0x0})[_0x2097('0xa5')](function(_0x33caa6){for(var _0x48ff8d=0x0;_0x48ff8d<_0xb53629[_0x2097('0x58')][_0x2097('0xa4')]['length'];_0x48ff8d+=0x1){var _0x32c5f1={'UserId':Number(_0xb53629[_0x2097('0x4f')]['id'])};_0x32c5f1[_[_0x2097('0xa1')](_0x168772[_0x2097('0xa2')]())+_0x2097('0xa6')]=Number(_0xb53629[_0x2097('0x58')][_0x2097('0xa4')][_0x48ff8d]);socket[_0x2097('0xa7')](_0x2097('0x2a')+_[_0x2097('0xa1')](_0x168772['toLowerCase']())+_0x2097('0xa8'),_0x32c5f1);}return _0x33caa6;})[_0x2097('0x13')](function(){if(_0x168772===_0x2097('0xa9')){return db[_0x2097('0xaa')]['findAll']({'where':{'id':_0xb53629[_0x2097('0x58')]['ids']||[]},'raw':!![],'attributes':['id',_0x2097('0x35')]});}})[_0x2097('0x13')](function(_0x9bd20d){var _0x3ba8a6=_0x46fc92[_0x2097('0x26')]({'plain':!![]});var _0x184645=[];if(_0x168772===_0x2097('0xa9')&&_0x3ba8a6[_0x2097('0x27')]===_0x2097('0x2b')&&_0x3ba8a6['online']){for(var _0x22fa5d=0x0;_0x22fa5d<_0x9bd20d['length'];_0x22fa5d+=0x1){_0x184645['push']({'membername':_0x3ba8a6['name'],'UserId':_0x3ba8a6['id'],'queue_name':_0x9bd20d[_0x22fa5d]['name'],'VoiceQueueId':_0x9bd20d[_0x22fa5d]['id'],'interface':_[_0x2097('0x61')](_0x3ba8a6[_0x2097('0xab')])?util[_0x2097('0xac')](_0x2097('0xad'),_0x3ba8a6['name']):_0x3ba8a6[_0x2097('0xab')],'paused':_0x3ba8a6['voicePause']||![],'penalty':_0xb53629[_0x2097('0x58')][_0x2097('0xae')]||0x0});}return BPromise[_0x2097('0x88')](_0x184645,function(_0x3d0082){return db['UserVoiceQueueRt'][_0x2097('0xaf')](_0x3d0082);});}return _0x46fc92;});}})[_0x2097('0x13')](respondWithStatusCode(_0x516ed6,null))[_0x2097('0x1c')](handleError(_0x516ed6,null));};exports[_0x2097('0xb0')]=function(_0x39b0e5,_0xb64c76){var _0x51cad2;return db['User']['find']({'where':{'id':_0x39b0e5['params']['id']},'attributes':['id',_0x2097('0x35'),_0x2097('0x27')]})[_0x2097('0x13')](handleEntityNotFound(_0xb64c76,null))[_0x2097('0x13')](function(_0x32889a){if(_0x32889a){_0x51cad2=_0x32889a;if(!_0x39b0e5['query']['channel']||!utils[_0x2097('0x9e')](_0x39b0e5['query'][_0x2097('0xb1')])){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))]('Unknown\x20channel');}return _0x32889a[_0x2097('0xb2')+_[_0x2097('0xa1')](_0x39b0e5[_0x2097('0x3f')][_0x2097('0xb1')][_0x2097('0xa2')]())+'Queues'](_0x39b0e5[_0x2097('0x3f')][_0x2097('0xa4')]);}})[_0x2097('0x13')](function(_0x52cc2a){if(_['isArray'](_0x39b0e5[_0x2097('0x3f')][_0x2097('0xa4')])){for(var _0x15da1e=0x0;_0x15da1e<_0x39b0e5[_0x2097('0x3f')][_0x2097('0xa4')][_0x2097('0x47')];_0x15da1e+=0x1){var _0x275880={'UserId':Number(_0x39b0e5[_0x2097('0x4f')]['id'])};_0x275880[_[_0x2097('0xa1')](_0x39b0e5[_0x2097('0x3f')][_0x2097('0xb1')][_0x2097('0xa2')]())+_0x2097('0xa6')]=Number(_0x39b0e5['query'][_0x2097('0xa4')][_0x15da1e]);socket[_0x2097('0xa7')](_0x2097('0x2a')+_[_0x2097('0xa1')](_0x39b0e5[_0x2097('0x3f')][_0x2097('0xb1')][_0x2097('0xa2')]())+'Queue:remove',_0x275880);}}else{var _0x275880={'UserId':Number(_0x39b0e5['params']['id'])};_0x275880[_[_0x2097('0xa1')](_0x39b0e5[_0x2097('0x3f')]['channel']['toLowerCase']())+'QueueId']=Number(_0x39b0e5[_0x2097('0x3f')][_0x2097('0xa4')]);socket[_0x2097('0xa7')]('user'+_[_0x2097('0xa1')](_0x39b0e5[_0x2097('0x3f')]['channel']['toLowerCase']())+_0x2097('0xb3'),_0x275880);}return _0x52cc2a;})[_0x2097('0x13')](function(){if(_0x39b0e5[_0x2097('0x3f')][_0x2097('0xb1')]==='voice'){return db[_0x2097('0xb4')]['destroy']({'where':{'UserId':_0x39b0e5[_0x2097('0x4f')]['id'],'VoiceQueueId':_0x39b0e5[_0x2097('0x3f')][_0x2097('0xa4')]},'individualHooks':!![]})['then'](function(){return _0x51cad2;});}return _0x51cad2;})[_0x2097('0x13')](respondWithStatusCode(_0xb64c76,null))[_0x2097('0x1c')](handleError(_0xb64c76,null));};exports[_0x2097('0xb5')]=function(_0x274163,_0x19393f){_0x274163[_0x2097('0x58')][_0x2097('0xb6')]=_0x274163['file'][_0x2097('0xb7')];return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x274163[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x19393f,null))['then'](saveUpdates(_0x274163[_0x2097('0x58')],null))[_0x2097('0x13')](respondWithResult(_0x19393f,null))[_0x2097('0x1c')](handleError(_0x19393f,null));};exports[_0x2097('0xb8')]=function(_0x44fddc,_0x40d500){var _0x1ec4f5=path[_0x2097('0xb9')](config[_0x2097('0xba')],_0x2097('0xbb'));return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x44fddc['params']['id']},'attributes':['id',_0x2097('0xb6')],'raw':!![]})[_0x2097('0x13')](handleEntityNotFound(_0x40d500,null))[_0x2097('0x13')](function(_0x3636bb){if(_0x3636bb){if(_[_0x2097('0x61')](_0x3636bb[_0x2097('0xb6')])){return _0x40d500[_0x2097('0xbc')](_0x1ec4f5);}else{if(!fs[_0x2097('0xbd')](path[_0x2097('0xb9')](config[_0x2097('0xba')],_0x2097('0xbe'),_0x3636bb[_0x2097('0xb6')]))){return _0x40d500['download'](_0x1ec4f5);}return _0x40d500[_0x2097('0xbc')](path['join'](config[_0x2097('0xba')],_0x2097('0xbe'),_0x3636bb['userpic']));}}})['catch'](handleError(_0x40d500,null));};exports[_0x2097('0xbf')]=function(_0x4a4ae9,_0x191782){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x4a4ae9[_0x2097('0x4f')]['id']},'attributes':['id']})[_0x2097('0x13')](handleEntityNotFound(_0x191782,null))[_0x2097('0x13')](function(_0x5e79bc){var _0xace1e7=[];values=_0x5e79bc[_0x2097('0x4a')];_0xace1e7[_0x2097('0x43')](get_open_tabs(_0x2097('0x48'),_0x5e79bc['dataValues']));_0xace1e7[_0x2097('0x43')](get_open_tabs('sms',_0x5e79bc[_0x2097('0x4a')]));_0xace1e7['push'](get_open_tabs(_0x2097('0x4c'),_0x5e79bc[_0x2097('0x4a')]));_0xace1e7[_0x2097('0x43')](get_open_tabs(_0x2097('0x4d'),_0x5e79bc[_0x2097('0x4a')]));_0xace1e7['push'](get_open_tabs(_0x2097('0x55'),_0x5e79bc[_0x2097('0x4a')]));_0xace1e7['push'](get_open_tabs(_0x2097('0x4b'),_0x5e79bc[_0x2097('0x4a')]));return BPromise['all'](_0xace1e7);})['then'](function(_0x2c3d63){var _0x4dfd18=[];if(_0x2c3d63){for(var _0x4b879a=0x0;_0x4b879a<values[_0x2097('0xc0')][_0x2097('0x47')];_0x4b879a++){var _0x4bdcf1=values['ChatOpenTabs'][_0x4b879a];_0x4dfd18['push']({'channel':_0x2097('0xc1'),'id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1[_0x2097('0xc2')]});}for(var _0x4b879a=0x0;_0x4b879a<values[_0x2097('0xc3')][_0x2097('0x47')];_0x4b879a++){var _0x4bdcf1=values['FaxOpenTabs'][_0x4b879a];_0x4dfd18[_0x2097('0x43')]({'channel':_0x2097('0xc4'),'id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1['createdAt']});}for(var _0x4b879a=0x0;_0x4b879a<values['OpenchannelOpenTabs'][_0x2097('0x47')];_0x4b879a++){var _0x4bdcf1=values[_0x2097('0xc5')][_0x4b879a];_0x4dfd18['push']({'channel':_0x2097('0xc6'),'id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1['createdAt']});}for(var _0x4b879a=0x0;_0x4b879a<values[_0x2097('0xc7')][_0x2097('0x47')];_0x4b879a++){var _0x4bdcf1=values['MailOpenTabs'][_0x4b879a];_0x4dfd18[_0x2097('0x43')]({'channel':_0x2097('0xc8'),'id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1[_0x2097('0xc2')]});}for(var _0x4b879a=0x0;_0x4b879a<values[_0x2097('0xc9')]['length'];_0x4b879a++){var _0x4bdcf1=values[_0x2097('0xc9')][_0x4b879a];_0x4dfd18[_0x2097('0x43')]({'channel':_0x2097('0xca'),'id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1[_0x2097('0xc2')]});}for(var _0x4b879a=0x0;_0x4b879a<values[_0x2097('0xcb')][_0x2097('0x47')];_0x4b879a++){var _0x4bdcf1=values[_0x2097('0xcb')][_0x4b879a];_0x4dfd18['push']({'channel':'WHATSAPP','id':_0x4bdcf1['id'],'createdAt':_0x4bdcf1['createdAt']});}var _0x5764fc={'count':_0x4dfd18['length'],'rows':_0x4dfd18};return _0x5764fc;}else return null;})[_0x2097('0x13')](respondWithResult(_0x191782,null))[_0x2097('0x1c')](handleError(_0x191782,null));};exports[_0x2097('0xcc')]=function(_0x5ab628,_0x3f92e4){var _0x4210c1={};var _0x2addde={};var _0x41625e;var _0x5bb052;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x5ab628[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f92e4,null))[_0x2097('0x13')](function(_0x5c64c4){if(_0x5c64c4){_0x41625e=_0x5c64c4;_0x2addde['model']=_['keys'](db['CmContact'][_0x2097('0xce')]);_0x2addde[_0x2097('0x3f')]=_['keys'](_0x5ab628[_0x2097('0x3f')]);_0x2addde[_0x2097('0xcf')]=_['intersection'](_0x2addde[_0x2097('0x50')],_0x2addde[_0x2097('0x3f')]);_0x4210c1[_0x2097('0x42')]=_['intersection'](_0x2addde[_0x2097('0x50')],qs[_0x2097('0x52')](_0x5ab628['query']['fields']));_0x4210c1[_0x2097('0x42')]=_0x4210c1[_0x2097('0x42')][_0x2097('0x47')]?_0x4210c1['attributes']:_0x2addde['model'];_0x4210c1[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x5ab628[_0x2097('0x3f')][_0x2097('0xd1')]);_0x4210c1[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x5ab628[_0x2097('0x3f')],_0x2addde[_0x2097('0xcf')]));if(_0x5ab628['query'][_0x2097('0x2d')]){_0x4210c1[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x4210c1[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x4210c1['attributes'],function(_0x10b2ba){var _0x4ed95f={};_0x4ed95f[_0x10b2ba]={'$like':'%'+_0x5ab628[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x4ed95f;})});}_0x4210c1=_['merge']({},_0x4210c1,_0x5ab628['options']);return _0x41625e[_0x2097('0xcc')](_0x4210c1);}})[_0x2097('0x13')](function(_0x20aa02){if(_0x20aa02){_0x5bb052=_0x20aa02[_0x2097('0x47')];if(_0x5ab628[_0x2097('0x3f')][_0x2097('0xd3')]('includeAll')){_0x4210c1[_0x2097('0x41')]=[{'model':db[_0x2097('0xd4')],'as':_0x2097('0xd5'),'required':![]},{'model':db[_0x2097('0xd6')],'as':_0x2097('0xd7'),'attributes':['id',_0x2097('0x35'),'color'],'where':_0x5ab628[_0x2097('0x3f')][_0x2097('0xd8')]?{'id':_0x5ab628[_0x2097('0x3f')][_0x2097('0xd8')]}:undefined,'required':_0x5ab628[_0x2097('0x3f')]['tag']?!![]:![]}];}if(!_0x5ab628[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x4210c1[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x5ab628[_0x2097('0x3f')][_0x2097('0x21')]);_0x4210c1['offset']=qs[_0x2097('0x1f')](_0x5ab628['query'][_0x2097('0x1f')]);}return _0x41625e[_0x2097('0xcc')](_0x4210c1);}})[_0x2097('0x13')](function(_0x3afe3b){if(_0x3afe3b){return _0x3afe3b?{'count':_0x5bb052,'rows':_0x3afe3b}:null;}})[_0x2097('0x13')](respondWithResult(_0x3f92e4,null))[_0x2097('0x1c')](handleError(_0x3f92e4,null));};exports['getQueues']=function(_0x14b2ce,_0x5be1c6){var _0x368a92;var _0x197927;var _0x64a507={};var _0xf2b25b;return db['User'][_0x2097('0xcd')]({'where':{'id':_0x14b2ce[_0x2097('0x4f')]['id']},'attributes':['id',_0x2097('0x35'),_0x2097('0x27')]})[_0x2097('0x13')](handleEntityNotFound(_0x5be1c6,null))[_0x2097('0x13')](function(_0x26e7c2){if(!utils[_0x2097('0x9e')](_0x14b2ce[_0x2097('0x3f')][_0x2097('0xb1')])){throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0x9f'));}_0x368a92=_0x26e7c2;var _0x1523a2={};_0x1523a2['model']=_[_0x2097('0x51')](db[_[_0x2097('0xa1')](_0x14b2ce['query'][_0x2097('0xb1')])+_0x2097('0xda')][_0x2097('0xce')]);_0x1523a2[_0x2097('0x3f')]=_['keys'](_0x14b2ce[_0x2097('0x3f')]);_0x1523a2[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x1523a2['model'],_0x1523a2['query']);_0x64a507['attributes']=_[_0x2097('0xdb')](_0x1523a2[_0x2097('0x50')],qs[_0x2097('0x52')](_0x14b2ce[_0x2097('0x3f')][_0x2097('0x52')]));_0x64a507[_0x2097('0x42')]=_0x64a507[_0x2097('0x42')]['length']?_0x64a507['attributes']:_0x1523a2['model'];_0x64a507['order']=qs[_0x2097('0xd1')](_0x14b2ce[_0x2097('0x3f')][_0x2097('0xd1')]);_0x64a507[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_['pick'](_0x14b2ce[_0x2097('0x3f')],_0x1523a2[_0x2097('0xcf')]));if(_0x14b2ce['query'][_0x2097('0x2d')]){_0x64a507['where']=_[_0x2097('0x53')](_0x64a507[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x64a507[_0x2097('0x42')],function(_0x476938){var _0x419e0e={};_0x419e0e[_0x476938]={'$like':'%'+_0x14b2ce[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x419e0e;})});}_0x64a507=_[_0x2097('0x53')]({},_0x64a507,_0x14b2ce[_0x2097('0xdc')]);switch(_0x368a92[_0x2097('0x27')]){case _0x2097('0x28'):return db[_[_0x2097('0xa1')](_0x14b2ce[_0x2097('0x3f')][_0x2097('0xb1')])+'Queue'][_0x2097('0x44')](_0x64a507);case _0x2097('0x2a'):case _0x2097('0x2b'):return _0x368a92[_0x2097('0x26')+_[_0x2097('0xa1')](_0x14b2ce[_0x2097('0x3f')]['channel'])+_0x2097('0xa3')](_0x64a507);default:throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))](_0x2097('0xdd'));}})[_0x2097('0x13')](function(_0x53405b){_0xf2b25b=_0x53405b['length'];if(!_0x14b2ce['query'][_0x2097('0xd3')](_0x2097('0xd9'))){_0x64a507[_0x2097('0x21')]=qs['limit'](_0x14b2ce[_0x2097('0x3f')]['limit']);_0x64a507[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x14b2ce['query'][_0x2097('0x1f')]);}switch(_0x368a92[_0x2097('0x27')]){case _0x2097('0x28'):return db[_[_0x2097('0xa1')](_0x14b2ce[_0x2097('0x3f')]['channel'])+'Queue'][_0x2097('0x44')](_0x64a507);case _0x2097('0x2a'):case _0x2097('0x2b'):return _0x368a92[_0x2097('0x26')+_[_0x2097('0xa1')](_0x14b2ce[_0x2097('0x3f')][_0x2097('0xb1')])+_0x2097('0xa3')](_0x64a507);}})[_0x2097('0x13')](function(_0x20d17a){return{'count':_0xf2b25b,'rows':_0x20d17a};})['then'](respondWithResult(_0x5be1c6,null))[_0x2097('0x1c')](handleError(_0x5be1c6,null));};exports[_0x2097('0xde')]=function(_0x3829a9,_0x52b383){var _0x40f98d={};var _0x54191c={};var _0x17d71d;var _0x34c710;return db['User'][_0x2097('0xcd')]({'where':{'id':_0x3829a9['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x52b383,null))[_0x2097('0x13')](function(_0x153818){if(_0x153818){_0x17d71d=_0x153818;_0x54191c['model']=_[_0x2097('0x51')](db[_0x2097('0xb4')]['rawAttributes']);_0x54191c[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3829a9[_0x2097('0x3f')]);_0x54191c[_0x2097('0xcf')]=_['intersection'](_0x54191c[_0x2097('0x50')],_0x54191c[_0x2097('0x3f')]);_0x40f98d['attributes']=_[_0x2097('0xdb')](_0x54191c['model'],qs[_0x2097('0x52')](_0x3829a9['query'][_0x2097('0x52')]));_0x40f98d['attributes']=_0x40f98d[_0x2097('0x42')][_0x2097('0x47')]?_0x40f98d[_0x2097('0x42')]:_0x54191c[_0x2097('0x50')];_0x40f98d['order']=qs[_0x2097('0xd1')](_0x3829a9['query'][_0x2097('0xd1')]);_0x40f98d[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_['pick'](_0x3829a9[_0x2097('0x3f')],_0x54191c[_0x2097('0xcf')]));if(_0x3829a9[_0x2097('0x3f')][_0x2097('0x2d')]){_0x40f98d[_0x2097('0x3d')]=_['merge'](_0x40f98d[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x40f98d[_0x2097('0x42')],function(_0x147567){var _0x5dc274={};_0x5dc274[_0x147567]={'$like':'%'+_0x3829a9[_0x2097('0x3f')]['filter']+'%'};return _0x5dc274;})});}_0x40f98d=_[_0x2097('0x53')]({},_0x40f98d,_0x3829a9[_0x2097('0xdc')]);return _0x17d71d[_0x2097('0xde')](_0x40f98d);}})['then'](function(_0x35164c){if(_0x35164c){_0x34c710=_0x35164c['length'];if(!_0x3829a9[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x40f98d[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x3829a9[_0x2097('0x3f')][_0x2097('0x21')]);_0x40f98d[_0x2097('0x1f')]=qs['offset'](_0x3829a9['query'][_0x2097('0x1f')]);}return _0x17d71d[_0x2097('0xde')](_0x40f98d);}})[_0x2097('0x13')](function(_0x3edcac){if(_0x3edcac){return _0x3edcac?{'count':_0x34c710,'rows':_0x3edcac}:null;}})[_0x2097('0x13')](respondWithResult(_0x52b383,null))[_0x2097('0x1c')](handleError(_0x52b383,null));};exports[_0x2097('0xdf')]=function(_0x2332c1,_0x50fb55){var _0x139459={};var _0x53e036={};var _0x546256;var _0x40cfe6;return db['User'][_0x2097('0xcd')]({'where':{'id':_0x2332c1[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x50fb55,null))[_0x2097('0x13')](function(_0x5b25cd){if(_0x5b25cd){_0x546256=_0x5b25cd;_0x53e036['model']=_[_0x2097('0x51')](db['ChatGroup'][_0x2097('0xce')]);_0x53e036['query']=_[_0x2097('0x51')](_0x2332c1[_0x2097('0x3f')]);_0x53e036[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x53e036[_0x2097('0x50')],_0x53e036[_0x2097('0x3f')]);_0x139459[_0x2097('0x42')]=_['intersection'](_0x53e036[_0x2097('0x50')],qs[_0x2097('0x52')](_0x2332c1[_0x2097('0x3f')][_0x2097('0x52')]));_0x139459[_0x2097('0x42')]=_0x139459['attributes'][_0x2097('0x47')]?_0x139459[_0x2097('0x42')]:_0x53e036[_0x2097('0x50')];_0x139459[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x2332c1['query'][_0x2097('0xd1')]);_0x139459['where']=qs[_0x2097('0xcf')](_['pick'](_0x2332c1[_0x2097('0x3f')],_0x53e036['filters']));if(_0x2332c1[_0x2097('0x3f')][_0x2097('0x2d')]){_0x139459[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x139459[_0x2097('0x3d')],{'$or':_['map'](_0x139459[_0x2097('0x42')],function(_0x416e53){var _0x572ea2={};_0x572ea2[_0x416e53]={'$like':'%'+_0x2332c1['query'][_0x2097('0x2d')]+'%'};return _0x572ea2;})});}_0x139459=_['merge']({},_0x139459,_0x2332c1[_0x2097('0xdc')]);return _0x546256[_0x2097('0xdf')](_0x139459);}})['then'](function(_0x57e6fe){if(_0x57e6fe){_0x40cfe6=_0x57e6fe[_0x2097('0x47')];if(!_0x2332c1[_0x2097('0x3f')][_0x2097('0xd3')]('nolimit')){_0x139459[_0x2097('0x21')]=qs['limit'](_0x2332c1[_0x2097('0x3f')][_0x2097('0x21')]);_0x139459[_0x2097('0x1f')]=qs['offset'](_0x2332c1['query'][_0x2097('0x1f')]);}return _0x546256[_0x2097('0xdf')](_0x139459);}})[_0x2097('0x13')](function(_0x1301de){if(_0x1301de){return _0x1301de?{'count':_0x40cfe6,'rows':_0x1301de}:null;}})['then'](respondWithResult(_0x50fb55,null))[_0x2097('0x1c')](handleError(_0x50fb55,null));};exports['getRecordings']=function(_0x3e0d03,_0x1814b7){var _0x498c5f={'raw':!![],'where':{}};var _0x1ae731={};var _0x235625={'count':0x0,'rows':[]};return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x3e0d03[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x1814b7,null))[_0x2097('0x13')](function(_0x1e9728){if(_0x1e9728){_0x1ae731[_0x2097('0x50')]=_['keys'](db['VoiceRecording'][_0x2097('0xce')]);_0x1ae731[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3e0d03[_0x2097('0x3f')]);_0x1ae731[_0x2097('0xcf')]=_['intersection'](_0x1ae731[_0x2097('0x50')],_0x1ae731['query']);_0x498c5f[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x1ae731['model'],qs[_0x2097('0x52')](_0x3e0d03[_0x2097('0x3f')]['fields']));_0x498c5f[_0x2097('0x42')]=_0x498c5f[_0x2097('0x42')]['length']?_0x498c5f['attributes']:_0x1ae731[_0x2097('0x50')];if(!_0x3e0d03[_0x2097('0x3f')]['hasOwnProperty']('nolimit')){_0x498c5f[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x3e0d03[_0x2097('0x3f')][_0x2097('0x21')]);_0x498c5f[_0x2097('0x1f')]=qs['offset'](_0x3e0d03['query'][_0x2097('0x1f')]);}_0x498c5f[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x3e0d03[_0x2097('0x3f')][_0x2097('0xd1')]);_0x498c5f[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x3e0d03[_0x2097('0x3f')],_0x1ae731[_0x2097('0xcf')]));_0x498c5f[_0x2097('0x3d')][_0x2097('0xe0')]=_0x1e9728['id'];if(_0x3e0d03[_0x2097('0x3f')][_0x2097('0x2d')]){_0x498c5f[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x498c5f[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x498c5f[_0x2097('0x42')],function(_0xa0684d){var _0xd84ba2={};_0xd84ba2[_0xa0684d]={'$like':'%'+_0x3e0d03['query'][_0x2097('0x2d')]+'%'};return _0xd84ba2;})});}_0x498c5f=_['merge']({},_0x498c5f,_0x3e0d03[_0x2097('0xdc')]);return db[_0x2097('0xe1')]['count']({'where':_0x498c5f[_0x2097('0x3d')]})['then'](function(_0x3b34aa){_0x235625[_0x2097('0x22')]=_0x3b34aa;if(_0x3e0d03[_0x2097('0x3f')]['includeAll']){_0x498c5f[_0x2097('0x41')]=[{'all':!![]}];}return db[_0x2097('0xe1')]['findAll'](_0x498c5f);})[_0x2097('0x13')](function(_0x50c569){_0x235625[_0x2097('0x45')]=_0x50c569;return _0x235625;});}})[_0x2097('0x13')](respondWithFilteredResult(_0x1814b7,_0x498c5f))[_0x2097('0x1c')](handleError(_0x1814b7,null));};exports['getScreenRecordings']=function(_0x1e7eeb,_0x761bce){var _0x4eb101={'raw':!![],'where':{}};var _0x27f28e={};var _0x4e70c4={'count':0x0,'rows':[]};return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x1e7eeb['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x761bce,null))['then'](function(_0x499ce2){if(_0x499ce2){_0x27f28e[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0xe2')][_0x2097('0xce')]);_0x27f28e[_0x2097('0x3f')]=_['keys'](_0x1e7eeb[_0x2097('0x3f')]);_0x27f28e['filters']=_[_0x2097('0xdb')](_0x27f28e['model'],_0x27f28e[_0x2097('0x3f')]);_0x4eb101[_0x2097('0x42')]=_['intersection'](_0x27f28e[_0x2097('0x50')],qs['fields'](_0x1e7eeb[_0x2097('0x3f')][_0x2097('0x52')]));_0x4eb101[_0x2097('0x42')]=_0x4eb101['attributes'][_0x2097('0x47')]?_0x4eb101[_0x2097('0x42')]:_0x27f28e[_0x2097('0x50')];if(!_0x1e7eeb[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x4eb101['limit']=qs['limit'](_0x1e7eeb[_0x2097('0x3f')][_0x2097('0x21')]);_0x4eb101[_0x2097('0x1f')]=qs['offset'](_0x1e7eeb[_0x2097('0x3f')][_0x2097('0x1f')]);}_0x4eb101[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x1e7eeb[_0x2097('0x3f')][_0x2097('0xd1')]);_0x4eb101[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x1e7eeb[_0x2097('0x3f')],_0x27f28e[_0x2097('0xcf')]));_0x4eb101['where'][_0x2097('0xe0')]=_0x499ce2['id'];if(_0x1e7eeb['query']['filter']){_0x4eb101[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x4eb101[_0x2097('0x3d')],{'$or':_['map'](_0x4eb101[_0x2097('0x42')],function(_0x53b744){var _0x2a1469={};_0x2a1469[_0x53b744]={'$like':'%'+_0x1e7eeb['query'][_0x2097('0x2d')]+'%'};return _0x2a1469;})});}_0x4eb101=_[_0x2097('0x53')]({},_0x4eb101,_0x1e7eeb['options']);return db['ScreenRecording'][_0x2097('0x22')]({'where':_0x4eb101[_0x2097('0x3d')]})[_0x2097('0x13')](function(_0x45a30c){_0x4e70c4[_0x2097('0x22')]=_0x45a30c;if(_0x1e7eeb[_0x2097('0x3f')][_0x2097('0x40')]){_0x4eb101[_0x2097('0x41')]=[{'all':!![]}];}return db[_0x2097('0xe2')][_0x2097('0x44')](_0x4eb101);})['then'](function(_0x261c41){_0x4e70c4[_0x2097('0x45')]=_0x261c41;return _0x4e70c4;});}})[_0x2097('0x13')](respondWithFilteredResult(_0x761bce,_0x4eb101))[_0x2097('0x1c')](handleError(_0x761bce,null));};exports[_0x2097('0xe3')]=function(_0x2b8e09,_0x505cd1){var _0x7a6079={};var _0xcd5895={};var _0x448521;var _0x6ff458;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x2b8e09[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x505cd1,null))[_0x2097('0x13')](function(_0x33a608){if(_0x33a608){_0x448521=_0x33a608;_0xcd5895['model']=_[_0x2097('0x51')](db[_0x2097('0xe4')][_0x2097('0xce')]);_0xcd5895[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x2b8e09['query']);_0xcd5895[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0xcd5895[_0x2097('0x50')],_0xcd5895[_0x2097('0x3f')]);_0x7a6079[_0x2097('0x42')]=_[_0x2097('0xdb')](_0xcd5895[_0x2097('0x50')],qs[_0x2097('0x52')](_0x2b8e09[_0x2097('0x3f')]['fields']));_0x7a6079[_0x2097('0x42')]=_0x7a6079['attributes']['length']?_0x7a6079[_0x2097('0x42')]:_0xcd5895['model'];_0x7a6079[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x2b8e09['query'][_0x2097('0xd1')]);_0x7a6079[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x2b8e09[_0x2097('0x3f')],_0xcd5895[_0x2097('0xcf')]));if(_0x2b8e09[_0x2097('0x3f')][_0x2097('0x2d')]){_0x7a6079[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x7a6079[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x7a6079['attributes'],function(_0x2db591){var _0x1d5f1b={};_0x1d5f1b[_0x2db591]={'$like':'%'+_0x2b8e09[_0x2097('0x3f')]['filter']+'%'};return _0x1d5f1b;})});}_0x7a6079=_['merge']({},_0x7a6079,_0x2b8e09[_0x2097('0xdc')]);return _0x448521[_0x2097('0xe3')](_0x7a6079);}})['then'](function(_0x45ff18){if(_0x45ff18){_0x6ff458=_0x45ff18[_0x2097('0x47')];if(!_0x2b8e09[_0x2097('0x3f')][_0x2097('0xd3')]('nolimit')){_0x7a6079[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x2b8e09[_0x2097('0x3f')][_0x2097('0x21')]);_0x7a6079[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x2b8e09[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x448521[_0x2097('0xe3')](_0x7a6079);}})['then'](function(_0x1a5ca3){if(_0x1a5ca3){return _0x1a5ca3?{'count':_0x6ff458,'rows':_0x1a5ca3}:null;}})[_0x2097('0x13')](respondWithResult(_0x505cd1,null))[_0x2097('0x1c')](handleError(_0x505cd1,null));};exports[_0x2097('0xe5')]=function(_0x1940c6,_0x2ac819){var _0x575271={};var _0x41e5fc={};var _0x14af0f;var _0x4e6c23;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x1940c6[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x2ac819,null))[_0x2097('0x13')](function(_0x31075a){if(_0x31075a){_0x14af0f=_0x31075a;_0x41e5fc['model']=_[_0x2097('0x51')](db['OpenchannelInteraction']['rawAttributes']);_0x41e5fc['query']=_[_0x2097('0x51')](_0x1940c6[_0x2097('0x3f')]);_0x41e5fc[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x41e5fc[_0x2097('0x50')],_0x41e5fc[_0x2097('0x3f')]);_0x575271[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x41e5fc['model'],qs[_0x2097('0x52')](_0x1940c6[_0x2097('0x3f')][_0x2097('0x52')]));_0x575271[_0x2097('0x42')]=_0x575271['attributes']['length']?_0x575271[_0x2097('0x42')]:_0x41e5fc['model'];_0x575271[_0x2097('0xd0')]=qs['sort'](_0x1940c6[_0x2097('0x3f')]['sort']);_0x575271[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x1940c6['query'],_0x41e5fc[_0x2097('0xcf')]));if(_0x1940c6[_0x2097('0x3f')][_0x2097('0x2d')]){_0x575271[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x575271['where'],{'$or':_[_0x2097('0x2f')](_0x575271[_0x2097('0x42')],function(_0x24fde1){var _0x591ea3={};_0x591ea3[_0x24fde1]={'$like':'%'+_0x1940c6[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x591ea3;})});}_0x575271=_[_0x2097('0x53')]({},_0x575271,_0x1940c6[_0x2097('0xdc')]);return _0x14af0f[_0x2097('0xe5')](_0x575271);}})[_0x2097('0x13')](function(_0x417480){if(_0x417480){_0x4e6c23=_0x417480[_0x2097('0x47')];if(!_0x1940c6[_0x2097('0x3f')][_0x2097('0xd3')]('nolimit')){_0x575271[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x1940c6[_0x2097('0x3f')]['limit']);_0x575271[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x1940c6[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x14af0f['getOpenchannelInteractions'](_0x575271);}})[_0x2097('0x13')](function(_0x4606b4){if(_0x4606b4){return _0x4606b4?{'count':_0x4e6c23,'rows':_0x4606b4}:null;}})['then'](respondWithResult(_0x2ac819,null))[_0x2097('0x1c')](handleError(_0x2ac819,null));};exports['getMailInteractions']=function(_0x1faa37,_0x1521b9){var _0x2410c={'raw':!![],'where':{}};var _0x6dcfba={};var _0x35ecd4={'count':0x0,'rows':[]};return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x1faa37[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x1521b9,null))[_0x2097('0x13')](function(_0x489c92){if(_0x489c92){_0x6dcfba['model']=_['keys'](db[_0x2097('0xe6')]['rawAttributes']);_0x6dcfba[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x1faa37[_0x2097('0x3f')]);_0x6dcfba[_0x2097('0xcf')]=_['intersection'](_0x6dcfba[_0x2097('0x50')],_0x6dcfba[_0x2097('0x3f')]);_0x2410c[_0x2097('0x42')]=_['intersection'](_0x6dcfba['model'],qs[_0x2097('0x52')](_0x1faa37['query'][_0x2097('0x52')]));_0x2410c['attributes']=_0x2410c[_0x2097('0x42')]['length']?_0x2410c[_0x2097('0x42')]:_0x6dcfba[_0x2097('0x50')];if(!_0x1faa37[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x2410c[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x1faa37[_0x2097('0x3f')][_0x2097('0x21')]);_0x2410c[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x1faa37[_0x2097('0x3f')]['offset']);}_0x2410c[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x1faa37[_0x2097('0x3f')][_0x2097('0xd1')]);_0x2410c[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x1faa37[_0x2097('0x3f')],_0x6dcfba[_0x2097('0xcf')]));_0x2410c['where'][_0x2097('0xe0')]=_0x489c92['id'];if(_0x1faa37[_0x2097('0x3f')]['filter']){_0x2410c[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x2410c['where'],{'$or':_[_0x2097('0x2f')](_0x2410c[_0x2097('0x42')],function(_0x409c07){var _0x13aab8={};_0x13aab8[_0x409c07]={'$like':'%'+_0x1faa37['query']['filter']+'%'};return _0x13aab8;})});}_0x2410c=_['merge']({},_0x2410c,_0x1faa37['options']);return db['MailInteraction'][_0x2097('0x22')]({'where':_0x2410c[_0x2097('0x3d')]})[_0x2097('0x13')](function(_0x155804){_0x35ecd4[_0x2097('0x22')]=_0x155804;if(_0x1faa37[_0x2097('0x3f')][_0x2097('0x40')]){_0x2410c['include']=[{'all':!![]}];}return db[_0x2097('0xe6')][_0x2097('0x44')](_0x2410c);})[_0x2097('0x13')](function(_0x35d62f){_0x35ecd4[_0x2097('0x45')]=_0x35d62f;return _0x35ecd4;});}})[_0x2097('0x13')](respondWithFilteredResult(_0x1521b9,_0x2410c))[_0x2097('0x1c')](handleError(_0x1521b9,null));};exports[_0x2097('0xe7')]=function(_0xfb5673,_0x529c41){var _0x50729a={};var _0x4e3dd6={};var _0x42deb2;var _0x3e306a;return db['User'][_0x2097('0xcd')]({'where':{'id':_0xfb5673[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x529c41,null))['then'](function(_0x5df96c){if(_0x5df96c){_0x42deb2=_0x5df96c;_0x4e3dd6[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0xe8')][_0x2097('0xce')]);_0x4e3dd6['query']=_[_0x2097('0x51')](_0xfb5673[_0x2097('0x3f')]);_0x4e3dd6['filters']=_[_0x2097('0xdb')](_0x4e3dd6['model'],_0x4e3dd6[_0x2097('0x3f')]);_0x50729a[_0x2097('0x42')]=_['intersection'](_0x4e3dd6[_0x2097('0x50')],qs['fields'](_0xfb5673['query'][_0x2097('0x52')]));_0x50729a[_0x2097('0x42')]=_0x50729a['attributes'][_0x2097('0x47')]?_0x50729a[_0x2097('0x42')]:_0x4e3dd6[_0x2097('0x50')];_0x50729a[_0x2097('0xd0')]=qs['sort'](_0xfb5673[_0x2097('0x3f')][_0x2097('0xd1')]);_0x50729a['where']=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0xfb5673['query'],_0x4e3dd6[_0x2097('0xcf')]));if(_0xfb5673[_0x2097('0x3f')][_0x2097('0x2d')]){_0x50729a[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x50729a[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x50729a[_0x2097('0x42')],function(_0x4ad21a){var _0x7e2df3={};_0x7e2df3[_0x4ad21a]={'$like':'%'+_0xfb5673[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x7e2df3;})});}_0x50729a=_[_0x2097('0x53')]({},_0x50729a,_0xfb5673[_0x2097('0xdc')]);return _0x42deb2[_0x2097('0xe7')](_0x50729a);}})['then'](function(_0x4a73fc){if(_0x4a73fc){_0x3e306a=_0x4a73fc['length'];if(!_0xfb5673[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x50729a[_0x2097('0x21')]=qs[_0x2097('0x21')](_0xfb5673['query'][_0x2097('0x21')]);_0x50729a['offset']=qs[_0x2097('0x1f')](_0xfb5673[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x42deb2[_0x2097('0xe7')](_0x50729a);}})[_0x2097('0x13')](function(_0x40638d){if(_0x40638d){return _0x40638d?{'count':_0x3e306a,'rows':_0x40638d}:null;}})[_0x2097('0x13')](respondWithResult(_0x529c41,null))['catch'](handleError(_0x529c41,null));};exports[_0x2097('0xe9')]=function(_0x4aa9eb,_0x350e20){var _0x1d4ed5={};var _0x3f1de7={};var _0xd61bb4;var _0x340fa4;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x4aa9eb[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x350e20,null))[_0x2097('0x13')](function(_0x14515e){if(_0x14515e){_0xd61bb4=_0x14515e;_0x3f1de7[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0xea')][_0x2097('0xce')]);_0x3f1de7[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x4aa9eb[_0x2097('0x3f')]);_0x3f1de7[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x3f1de7[_0x2097('0x50')],_0x3f1de7[_0x2097('0x3f')]);_0x1d4ed5[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x3f1de7[_0x2097('0x50')],qs[_0x2097('0x52')](_0x4aa9eb[_0x2097('0x3f')][_0x2097('0x52')]));_0x1d4ed5[_0x2097('0x42')]=_0x1d4ed5['attributes']['length']?_0x1d4ed5[_0x2097('0x42')]:_0x3f1de7[_0x2097('0x50')];_0x1d4ed5[_0x2097('0xd0')]=qs['sort'](_0x4aa9eb[_0x2097('0x3f')][_0x2097('0xd1')]);_0x1d4ed5['where']=qs[_0x2097('0xcf')](_['pick'](_0x4aa9eb[_0x2097('0x3f')],_0x3f1de7['filters']));if(_0x4aa9eb[_0x2097('0x3f')]['filter']){_0x1d4ed5[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x1d4ed5['where'],{'$or':_[_0x2097('0x2f')](_0x1d4ed5[_0x2097('0x42')],function(_0x1239f1){var _0x3b8ee2={};_0x3b8ee2[_0x1239f1]={'$like':'%'+_0x4aa9eb[_0x2097('0x3f')]['filter']+'%'};return _0x3b8ee2;})});}_0x1d4ed5=_[_0x2097('0x53')]({},_0x1d4ed5,_0x4aa9eb[_0x2097('0xdc')]);return _0xd61bb4[_0x2097('0xe9')](_0x1d4ed5);}})['then'](function(_0x7f345c){if(_0x7f345c){_0x340fa4=_0x7f345c[_0x2097('0x47')];if(!_0x4aa9eb['query'][_0x2097('0xd3')](_0x2097('0xd9'))){_0x1d4ed5[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x4aa9eb['query'][_0x2097('0x21')]);_0x1d4ed5[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x4aa9eb[_0x2097('0x3f')]['offset']);}return _0xd61bb4[_0x2097('0xe9')](_0x1d4ed5);}})[_0x2097('0x13')](function(_0xb71c3b){if(_0xb71c3b){return _0xb71c3b?{'count':_0x340fa4,'rows':_0xb71c3b}:null;}})[_0x2097('0x13')](respondWithResult(_0x350e20,null))['catch'](handleError(_0x350e20,null));};exports[_0x2097('0xeb')]=function(_0x4179fb,_0x344438){var _0x5795d3={};var _0x2d1bc4={};var _0x3a403f;var _0x366ec8;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x4179fb['params']['id']}})['then'](handleEntityNotFound(_0x344438,null))[_0x2097('0x13')](function(_0x1bf026){if(_0x1bf026){_0x3a403f=_0x1bf026;_0x2d1bc4[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0xec')]['rawAttributes']);_0x2d1bc4[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x4179fb[_0x2097('0x3f')]);_0x2d1bc4[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x2d1bc4[_0x2097('0x50')],_0x2d1bc4['query']);_0x5795d3[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x2d1bc4[_0x2097('0x50')],qs[_0x2097('0x52')](_0x4179fb[_0x2097('0x3f')][_0x2097('0x52')]));_0x5795d3[_0x2097('0x42')]=_0x5795d3['attributes'][_0x2097('0x47')]?_0x5795d3[_0x2097('0x42')]:_0x2d1bc4[_0x2097('0x50')];_0x5795d3[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x4179fb[_0x2097('0x3f')]['sort']);_0x5795d3[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x4179fb['query'],_0x2d1bc4[_0x2097('0xcf')]));if(_0x4179fb[_0x2097('0x3f')][_0x2097('0x2d')]){_0x5795d3[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x5795d3['where'],{'$or':_[_0x2097('0x2f')](_0x5795d3[_0x2097('0x42')],function(_0x50b5e1){var _0x4b3c77={};_0x4b3c77[_0x50b5e1]={'$like':'%'+_0x4179fb[_0x2097('0x3f')]['filter']+'%'};return _0x4b3c77;})});}_0x5795d3=_[_0x2097('0x53')]({},_0x5795d3,_0x4179fb[_0x2097('0xdc')]);return _0x3a403f[_0x2097('0xeb')](_0x5795d3);}})[_0x2097('0x13')](function(_0x507911){if(_0x507911){_0x366ec8=_0x507911['length'];if(!_0x4179fb['query'][_0x2097('0xd3')](_0x2097('0xd9'))){_0x5795d3['limit']=qs['limit'](_0x4179fb['query']['limit']);_0x5795d3[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x4179fb[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x3a403f[_0x2097('0xeb')](_0x5795d3);}})['then'](function(_0xebd0df){if(_0xebd0df){return _0xebd0df?{'count':_0x366ec8,'rows':_0xebd0df}:null;}})['then'](respondWithResult(_0x344438,null))[_0x2097('0x1c')](handleError(_0x344438,null));};exports['login']=function(_0x2397a4,_0x1aa7ef,_0xc4ec31){var _0x4f2ce2;var _0x309f90;var _0x2243ee;var _0x1d6d50=!_[_0x2097('0x61')](_0x2397a4[_0x2097('0x4f')]['id'])?_0x2397a4[_0x2097('0x4f')]['id']:!_[_0x2097('0x61')](_0x2397a4[_0x2097('0x2a')]['id'])?_0x2397a4[_0x2097('0x2a')]['id']:null;return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x1d6d50,'role':{'$or':[_0x2097('0x28'),_0x2097('0x2a'),'agent']}},'attributes':['id',_0x2097('0x35'),_0x2097('0xed'),_0x2097('0xee'),'role','internal',_0x2097('0x9c')]})[_0x2097('0x13')](function(_0x163103){if(_0x163103){if(_0x163103[_0x2097('0x27')]==='agent'){_0x4f2ce2=_0x163103;if(_0x2397a4['body'][_0x2097('0xab')]){_0x2243ee=util[_0x2097('0xac')](_0x2097('0xef'),_0x4f2ce2[_0x2397a4[_0x2097('0x58')][_0x2097('0xab')]]);}else if(_0x2397a4['body'][_0x2097('0xf0')]){_0x2243ee=util[_0x2097('0xac')](_0x2097('0xad'),_0x2397a4[_0x2097('0x58')][_0x2097('0xf0')]);}else{_0x2243ee=util[_0x2097('0xac')](_0x2097('0xad'),_0x4f2ce2[_0x2097('0x35')]);}socket['to'](util[_0x2097('0xac')](_0x2097('0xf1'),_0x4f2ce2[_0x2097('0x35')]))[_0x2097('0xa7')]('user:forcelogout',{'user':{'id':_0x4f2ce2['id'],'name':_0x4f2ce2[_0x2097('0x35')]},'ip':_0x2397a4['headers'][_0x2097('0xf2')]||_0x2397a4[_0x2097('0xf3')][_0x2097('0xf4')]||_0x2397a4['socket']['remoteAddress']||_0x2397a4[_0x2097('0xf3')][_0x2097('0xf5')]['remoteAddress']});return db[_0x2097('0xb4')][_0x2097('0x25')]({'where':{'membername':_0x4f2ce2[_0x2097('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0x2097('0x8d'))][(_0x2097('0x8e'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x2097('0x13')](function(){if(_0x4f2ce2){return _0x4f2ce2[_0x2097('0xf6')]({'raw':!![]});}})[_0x2097('0x13')](function(_0x5fe3ca){if(_0x4f2ce2){var _0x595477=[];if(_0x5fe3ca){_0x309f90=_0x5fe3ca;if(_0x309f90[_0x2097('0x47')]){for(var _0x1e0cb6=0x0;_0x1e0cb6<_0x309f90[_0x2097('0x47')];_0x1e0cb6++){_0x595477['push']({'membername':_0x4f2ce2[_0x2097('0x35')],'UserId':_0x4f2ce2['id'],'queue_name':_0x309f90[_0x1e0cb6][_0x2097('0x35')],'VoiceQueueId':_0x309f90[_0x1e0cb6]['id'],'interface':_0x2243ee,'paused':_0x4f2ce2[_0x2097('0x9c')]||![],'penalty':_0x309f90[_0x1e0cb6][_0x2097('0xf7')]||0x0});}return BPromise['each'](_0x595477,function(_0x14c467){return db['UserVoiceQueueRt']['upsert'](_0x14c467);});}}}})[_0x2097('0x13')](function(){if(_0x4f2ce2){return db[_0x2097('0xf8')][_0x2097('0x44')]({'where':{'membername':_0x4f2ce2[_0x2097('0x35')],'exitAt':null}});}})[_0x2097('0x13')](function(_0x290225){if(_0x4f2ce2){var _0x440782=[];_0x290225[_0x2097('0xf9')](function(_0x137420){_0x440782['push'](_0x137420[_0x2097('0x57')]({'exitAt':moment()[_0x2097('0xac')](_0x2097('0xfa'))}));});return BPromise[_0x2097('0x56')](_0x440782);}})[_0x2097('0x13')](function(){if(_0x4f2ce2){var _0xdeefa3=[];var _0x532823=[];var _0x3691ac=utils[_0x2097('0xfb')]();var _0x43281c={'membername':_0x4f2ce2[_0x2097('0x35')],'interface':_0x2243ee,'enterAt':moment()['format'](_0x2097('0xfa')),'role':_0x4f2ce2['role'],'internal':_0x4f2ce2[_0x2097('0x5c')]};_0x3691ac['forEach'](function(_0x22af81){_0xdeefa3[_0x2097('0x43')](_[_0x2097('0x53')]({'channel':_0x22af81,'type':'LOGIN','data1':_0x2397a4[_0x2097('0x58')][_0x2097('0xfc')],'data2':_0x2243ee},_0x43281c));if(_0x4f2ce2[_0x2097('0x9c')]){_0x532823[_0x2097('0x43')](_[_0x2097('0x53')]({'channel':_0x22af81,'type':_0x2097('0xfd'),'data1':_0x2097('0xfe')},_0x43281c));}});return db[_0x2097('0xf8')]['bulkCreate'](_0xdeefa3[_0x2097('0xff')](_0x532823),{'individualHooks':!![]});}})[_0x2097('0x13')](function(){if(_0x4f2ce2){return _0x4f2ce2[_0x2097('0x57')]({'online':!![],'lastLoginAt':moment()[_0x2097('0xac')](_0x2097('0xfa')),'voicePause':_0x4f2ce2[_0x2097('0x9c')]||![],'mailPause':_0x4f2ce2[_0x2097('0x9c')]||![],'chatPause':_0x4f2ce2[_0x2097('0x9c')]||![],'faxPause':_0x4f2ce2['loginInPause']||![],'smsPause':_0x4f2ce2[_0x2097('0x9c')]||![],'openchannelPause':_0x4f2ce2['loginInPause']||![],'whatsappPause':_0x4f2ce2[_0x2097('0x9c')]||![],'pauseType':_0x4f2ce2[_0x2097('0x9c')]?'LOGININPAUSE':null,'interface':_0x2243ee,'lastPauseAt':moment()[_0x2097('0xac')](_0x2097('0xfa'))});}})[_0x2097('0x13')](function(_0x49c964){if(_0x2397a4[_0x2097('0x100')]){return _0xc4ec31();}else{return BPromise[_0x2097('0x101')](_0x49c964)[_0x2097('0x13')](respondWithResult(_0x1aa7ef,null));}})[_0x2097('0x1c')](handleError(_0x1aa7ef,null));};exports[_0x2097('0x102')]=function(_0x3cec81,_0x65cfca){var _0x832186;return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x3cec81[_0x2097('0x4f')]['id'],'role':_0x2097('0x2b')},'attributes':['id',_0x2097('0x35'),_0x2097('0x27')]})[_0x2097('0x13')](handleEntityNotFound(_0x65cfca,null))[_0x2097('0x13')](function(_0x402f25){if(_0x402f25){_0x832186=_0x402f25;return db[_0x2097('0xb4')][_0x2097('0x25')]({'where':{'membername':_0x832186[_0x2097('0x35')]},'individualHooks':!![]});}})[_0x2097('0x13')](function(){return db[_0x2097('0xf8')][_0x2097('0x44')]({'where':{'membername':_0x832186[_0x2097('0x35')],'exitAt':null}});})[_0x2097('0x13')](function(_0x495363){var _0x1f6bf5=[];_0x495363[_0x2097('0xf9')](function(_0x363ae6){_0x1f6bf5[_0x2097('0x43')](_0x363ae6[_0x2097('0x57')]({'exitAt':moment()['format'](_0x2097('0xfa'))}));});return BPromise[_0x2097('0x56')](_0x1f6bf5);})[_0x2097('0x13')](function(){return _0x832186['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2097('0x13')](respondWithResult(_0x65cfca,null))[_0x2097('0x1c')](handleError(_0x65cfca,null));};exports['pause']=function(_0x24ad31,_0x4155b6){var _0x2e054e;return db['UserVoiceQueueRt'][_0x2097('0x57')]({'paused':0x1},{'where':{'UserId':_0x24ad31[_0x2097('0x4f')]['id']},'individualHooks':!![]})[_0x2097('0x13')](function(){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x24ad31[_0x2097('0x4f')]['id'],'role':_0x2097('0x2b')},'attributes':['id',_0x2097('0x35'),_0x2097('0x27'),'internal',_0x2097('0xab')]});})['then'](handleEntityNotFound(_0x4155b6,null))[_0x2097('0x13')](function(_0x4f1dfc){if(_0x4f1dfc){_0x2e054e=_0x4f1dfc;return respondWithRpcPromise(_0x2097('0x103'),_0x2097('0x104'),{'id':_0x2e054e['id'],'name':_0x2e054e[_0x2097('0x35')],'pause':!![]});}})[_0x2097('0x13')](function(){if(_0x2e054e){return db[_0x2097('0xf8')][_0x2097('0x44')]({'where':{'membername':_0x2e054e[_0x2097('0x35')],'type':_0x2097('0xfd'),'exitAt':null}});}})[_0x2097('0x13')](function(_0x432023){if(_0x432023[_0x2097('0x47')]){var _0x110125=moment()[_0x2097('0xac')](_0x2097('0xfa'));for(var _0x9080f8=0x0,_0xd73129=_0x432023['length'];_0x9080f8<_0xd73129;_0x9080f8++){_0x432023[_0x9080f8]['updateAttributes']({'exitAt':_0x110125});}}})[_0x2097('0x13')](function(){var _0x45134f=[];var _0x119f7b=utils[_0x2097('0xfb')]();_0x119f7b[_0x2097('0xf9')](function(_0x5915c6){_0x45134f[_0x2097('0x43')]({'channel':_0x5915c6,'membername':_0x2e054e[_0x2097('0x35')],'interface':_[_0x2097('0x61')](_0x2e054e[_0x2097('0xab')])?util[_0x2097('0xac')](_0x2097('0xad'),_0x2e054e[_0x2097('0x35')]):_0x2e054e[_0x2097('0xab')],'type':_0x2097('0xfd'),'enterAt':moment()[_0x2097('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x24ad31[_0x2097('0x58')][_0x2097('0x39')]||_0x2097('0x105'),'role':_0x2e054e[_0x2097('0x27')],'internal':_0x2e054e[_0x2097('0x5c')]});});return db['MemberReport'][_0x2097('0x84')](_0x45134f,{'individualHooks':!![]});})[_0x2097('0x13')](function(){return _0x2e054e['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x24ad31[_0x2097('0x58')][_0x2097('0x39')]||_0x2097('0x105'),'lastPauseAt':moment()[_0x2097('0xac')](_0x2097('0xfa'))});})[_0x2097('0x13')](respondWithResult(_0x4155b6,null))[_0x2097('0x1c')](handleError(_0x4155b6,null));};exports[_0x2097('0x106')]=function(_0x509727,_0x954506){var _0xb43c4;return db[_0x2097('0x3e')]['find']({'where':{'id':_0x509727[_0x2097('0x4f')]['id']},'attributes':['id',_0x2097('0x35'),_0x2097('0x27'),_0x2097('0x9d'),'mailPause','chatPause','faxPause',_0x2097('0x107'),'smsPause',_0x2097('0x108'),_0x2097('0x109'),_0x2097('0x10a')]})[_0x2097('0x13')](handleEntityNotFound(_0x954506,null))['then'](function(_0x5775dd){if(_0x5775dd){_0xb43c4=_0x5775dd;if(_0x509727['body'][_0x2097('0xb1')]&&!utils['isValidChannel'](_0x509727[_0x2097('0x58')][_0x2097('0xb1')])){throw new db['Sequelize'][(_0x2097('0x8e'))](_0x2097('0x9f'));}switch(_0x509727[_0x2097('0x58')]['channel']){case _0x2097('0xa9'):return respondWithRpcPromise(_0x2097('0x103'),'unpause',{'id':_0xb43c4['id'],'name':_0xb43c4[_0x2097('0x35')],'pause':![]})[_0x2097('0x13')](function(){return db[_0x2097('0xb4')][_0x2097('0x57')]({'paused':0x0},{'where':{'UserId':_0xb43c4['id']},'individualHooks':!![]});})[_0x2097('0x13')](function(){return db[_0x2097('0xf8')][_0x2097('0x32')]({'where':{'channel':_0x509727[_0x2097('0x58')][_0x2097('0xb1')],'membername':_0xb43c4['name'],'type':_0x2097('0xfd'),'exitAt':null}});})[_0x2097('0x13')](function(_0x57ff9b){if(_0x57ff9b){return _0x57ff9b[_0x2097('0x57')]({'exitAt':moment()['format'](_0x2097('0xfa')),'data2':_0x2097('0x10b')},{'individualHooks':!![]});}return null;})['then'](function(){return _0xb43c4[_0x2097('0x57')]({'voicePause':![]});});case _0x2097('0x4b'):case _0x2097('0x48'):case _0x2097('0x55'):case _0x2097('0x49'):case _0x2097('0x4d'):case'openchannel':return db[_0x2097('0xf8')]['find']({'where':{'channel':_0x509727[_0x2097('0x58')][_0x2097('0xb1')],'membername':_0xb43c4['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0x1c141e){if(_0x1c141e){return _0x1c141e[_0x2097('0x57')]({'exitAt':moment()[_0x2097('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x2097('0x10b')},{'individualHooks':!![]});}return null;})[_0x2097('0x13')](function(){var _0x5e001e={};_[_0x2097('0x23')](_0x5e001e,util[_0x2097('0xac')]('%s%s',_0x509727['body']['channel'],_0x2097('0x10c')),![]);return _0xb43c4[_0x2097('0x57')](_0x5e001e);});default:return respondWithRpcPromise(_0x2097('0x103'),'unpause',{'id':_0xb43c4['id'],'name':_0xb43c4[_0x2097('0x35')],'pause':![]})[_0x2097('0x13')](function(){return db['UserVoiceQueueRt'][_0x2097('0x57')]({'paused':0x0},{'where':{'UserId':_0xb43c4['id']}});})['then'](function(){return db[_0x2097('0xf8')][_0x2097('0x44')]({'where':{'membername':_0xb43c4[_0x2097('0x35')],'type':'PAUSE','exitAt':null}});})['then'](function(_0xb56a0c){var _0x378926=[];_0xb56a0c['forEach'](function(_0x348205){_0x378926['push'](_0x348205[_0x2097('0x57')]({'exitAt':moment()[_0x2097('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x2097('0x10b')}));});return BPromise[_0x2097('0x56')](_0x378926);})[_0x2097('0x13')](function(){return _0xb43c4[_0x2097('0x57')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x2097('0x13')](respondWithResult(_0x954506,null))['catch'](handleError(_0x954506,null));};exports[_0x2097('0x10d')]=function(_0x3ddb2c,_0x53dd35){var _0x1cd735={};var _0x52ef03={};var _0x18fc05;var _0x15d938;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x3ddb2c[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x53dd35,null))['then'](function(_0x5303ab){if(_0x5303ab){_0x18fc05=_0x5303ab;_0x52ef03[_0x2097('0x50')]=_['keys'](db['Team'][_0x2097('0xce')]);_0x52ef03[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3ddb2c['query']);_0x52ef03['filters']=_[_0x2097('0xdb')](_0x52ef03[_0x2097('0x50')],_0x52ef03[_0x2097('0x3f')]);_0x1cd735[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x52ef03['model'],qs[_0x2097('0x52')](_0x3ddb2c[_0x2097('0x3f')]['fields']));_0x1cd735[_0x2097('0x42')]=_0x1cd735[_0x2097('0x42')][_0x2097('0x47')]?_0x1cd735[_0x2097('0x42')]:_0x52ef03['model'];_0x1cd735[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x3ddb2c[_0x2097('0x3f')][_0x2097('0xd1')]);_0x1cd735['where']=qs[_0x2097('0xcf')](_['pick'](_0x3ddb2c[_0x2097('0x3f')],_0x52ef03[_0x2097('0xcf')]));if(_0x3ddb2c[_0x2097('0x3f')]['filter']){_0x1cd735[_0x2097('0x3d')]=_['merge'](_0x1cd735[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x1cd735['attributes'],function(_0x40ce26){var _0x4fecbf={};_0x4fecbf[_0x40ce26]={'$like':'%'+_0x3ddb2c['query']['filter']+'%'};return _0x4fecbf;})});}_0x1cd735=_['merge']({},_0x1cd735,_0x3ddb2c[_0x2097('0xdc')]);return _0x18fc05[_0x2097('0x10d')](_0x1cd735);}})['then'](function(_0x4c8489){if(_0x4c8489){_0x15d938=_0x4c8489[_0x2097('0x47')];if(!_0x3ddb2c[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x1cd735['limit']=qs['limit'](_0x3ddb2c['query'][_0x2097('0x21')]);_0x1cd735[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x3ddb2c[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x18fc05[_0x2097('0x10d')](_0x1cd735);}})[_0x2097('0x13')](function(_0x16957e){if(_0x16957e){return _0x16957e?{'count':_0x15d938,'rows':_0x16957e}:null;}})[_0x2097('0x13')](respondWithResult(_0x53dd35,null))['catch'](handleError(_0x53dd35,null));};exports[_0x2097('0x10e')]=function(_0x38e4d6,_0xdbef79){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x38e4d6[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0xdbef79,null))['then'](function(_0x21a8a7){if(_0x21a8a7){var _0x3853bf=_0x21a8a7['get']({'plain':!![]});return _0x21a8a7['addTeams'](_0x38e4d6[_0x2097('0x58')][_0x2097('0xa4')],_['omit'](_0x38e4d6[_0x2097('0x58')],['ids','id'])||{})[_0x2097('0x13')](function(){for(var _0x20ead7=0x0;_0x20ead7<_0x38e4d6['body'][_0x2097('0xa4')][_0x2097('0x47')];_0x20ead7++){var _0x1603fe=[];db[_0x2097('0x10f')][_0x2097('0xcd')]({'where':{'id':_0x38e4d6[_0x2097('0x58')]['ids'][_0x20ead7]}})[_0x2097('0x13')](function(_0x588b4f){_0x1603fe[_0x2097('0x43')](_0x588b4f[_0x2097('0xf6')]()[_0x2097('0x13')](function(_0x560683){for(var _0x582f92=0x0;_0x582f92<_0x560683[_0x2097('0x47')];_0x582f92++){_0x560683[_0x582f92][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x111'));}return _0x560683;}));_0x1603fe['push'](_0x588b4f['getChatQueues']()[_0x2097('0x13')](function(_0x2f67d9){for(var _0x41d9fd=0x0;_0x41d9fd<_0x2f67d9[_0x2097('0x47')];_0x41d9fd++){_0x2f67d9[_0x41d9fd][_0x2097('0x110')]('channel',_0x2097('0x112'));}return _0x2f67d9;}));_0x1603fe[_0x2097('0x43')](_0x588b4f['getMailQueues']()['then'](function(_0x1fb7ba){for(var _0x464cba=0x0;_0x464cba<_0x1fb7ba[_0x2097('0x47')];_0x464cba++){_0x1fb7ba[_0x464cba][_0x2097('0x110')](_0x2097('0xb1'),'Mail');}return _0x1fb7ba;}));_0x1603fe[_0x2097('0x43')](_0x588b4f['getSmsQueues']()['then'](function(_0x2b1b93){for(var _0x34de68=0x0;_0x34de68<_0x2b1b93[_0x2097('0x47')];_0x34de68++){_0x2b1b93[_0x34de68]['setDataValue'](_0x2097('0xb1'),'Sms');}return _0x2b1b93;}));_0x1603fe[_0x2097('0x43')](_0x588b4f[_0x2097('0x113')]()[_0x2097('0x13')](function(_0x144448){for(var _0x294750=0x0;_0x294750<_0x144448[_0x2097('0x47')];_0x294750++){_0x144448[_0x294750][_0x2097('0x110')](_0x2097('0xb1'),'Whatsapp');}return _0x144448;}));_0x1603fe['push'](_0x588b4f['getFaxQueues']()['then'](function(_0x504cdf){for(var _0x3ed5dd=0x0;_0x3ed5dd<_0x504cdf[_0x2097('0x47')];_0x3ed5dd++){_0x504cdf[_0x3ed5dd]['setDataValue'](_0x2097('0xb1'),_0x2097('0x114'));}return _0x504cdf;}));_0x1603fe[_0x2097('0x43')](_0x588b4f[_0x2097('0x115')]()[_0x2097('0x13')](function(_0x467c12){for(var _0x472171=0x0;_0x472171<_0x467c12[_0x2097('0x47')];_0x472171++){_0x467c12[_0x472171][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x116'));}return _0x467c12;}));return BPromise[_0x2097('0x56')](_0x1603fe);})[_0x2097('0x13')](function(_0x2d9d1d){var _0x2fbb5a=_[_0x2097('0x117')](_0x2d9d1d);_0x1603fe=[];return db[_0x2097('0x64')][_0x2097('0x118')](function(_0x54e49b){for(var _0x598077=0x0;_0x598077<_0x2fbb5a['length'];_0x598077++){_0x1603fe['push'](_0x2fbb5a[_0x598077][_0x2097('0x119')](_0x3853bf['id']),{'transaction':_0x54e49b});}return BPromise['all'](_0x1603fe)[_0x2097('0x13')](function(){if(_0x3853bf[_0x2097('0x9b')]){return BPromise['each'](_[_0x2097('0x2d')](_0x2fbb5a,function(_0x442fbd){return _0x442fbd[_0x2097('0x11a')]('channel')===_0x2097('0x111');}),function(_0xecd041){return db[_0x2097('0xb4')][_0x2097('0xaf')]({'membername':_0x3853bf[_0x2097('0x35')],'UserId':_0x3853bf['id'],'queue_name':_0xecd041[_0x2097('0x35')],'VoiceQueueId':_0xecd041['id'],'interface':_[_0x2097('0x61')](_0x3853bf['interface'])?util['format'](_0x2097('0xad'),_0x3853bf[_0x2097('0x35')]):_0x3853bf['interface'],'paused':_0x3853bf['voicePause']||![],'penalty':_0x3853bf[_0x2097('0xae')]},{'transaction':_0x54e49b});});}else{return;}})[_0x2097('0x13')](function(){for(var _0xcc501f=0x0;_0xcc501f<_0x2fbb5a[_0x2097('0x47')];_0xcc501f++){var _0x4c3f44=_0x2fbb5a[_0xcc501f][_0x2097('0x11a')]('channel');var _0x48688b=_0x4c3f44+_0x2097('0xa6');socket[_0x2097('0xa7')](_0x2097('0x2a')+_0x4c3f44+_0x2097('0xa8'),{'UserId':_0x3853bf['id'],['queueField']:_0x2fbb5a[_0xcc501f]['id']});}});});});}});}})['then'](respondWithStatusCode(_0xdbef79,null))[_0x2097('0x1c')](handleError(_0xdbef79,null));};exports[_0x2097('0x11b')]=function(_0x29e622,_0x145b69){return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x29e622[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x145b69,null))[_0x2097('0x13')](function(_0x18f113){if(_0x18f113){var _0x219402=_0x18f113[_0x2097('0x26')]({'plain':!![]});var _0x5c62b0=_0x29e622[_0x2097('0x3f')][_0x2097('0xa4')];return _0x18f113[_0x2097('0x11b')](_0x5c62b0)[_0x2097('0x13')](function(){for(var _0x60758d=0x0;_0x60758d<_0x5c62b0[_0x2097('0x47')];_0x60758d++){var _0x5a8dca=[];db[_0x2097('0x10f')][_0x2097('0xcd')]({'where':{'id':_0x5c62b0[_0x60758d]}})['then'](function(_0x2c8fca){_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0xf6')]()[_0x2097('0x13')](function(_0x2397e8){for(var _0x493b6c=0x0;_0x493b6c<_0x2397e8['length'];_0x493b6c++){_0x2397e8[_0x493b6c][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x111'));}return _0x2397e8;}));_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0x11c')]()[_0x2097('0x13')](function(_0x56bfec){for(var _0x4da228=0x0;_0x4da228<_0x56bfec[_0x2097('0x47')];_0x4da228++){_0x56bfec[_0x4da228][_0x2097('0x110')](_0x2097('0xb1'),'Chat');}return _0x56bfec;}));_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0x11d')]()[_0x2097('0x13')](function(_0x5bfd3a){for(var _0x711e1b=0x0;_0x711e1b<_0x5bfd3a['length'];_0x711e1b++){_0x5bfd3a[_0x711e1b][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x11e'));}return _0x5bfd3a;}));_0x5a8dca['push'](_0x2c8fca[_0x2097('0x11f')]()[_0x2097('0x13')](function(_0x13fd70){for(var _0x1155d6=0x0;_0x1155d6<_0x13fd70[_0x2097('0x47')];_0x1155d6++){_0x13fd70[_0x1155d6][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x120'));}return _0x13fd70;}));_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0x113')]()['then'](function(_0x2b0b9e){for(var _0x3c9b82=0x0;_0x3c9b82<_0x2b0b9e[_0x2097('0x47')];_0x3c9b82++){_0x2b0b9e[_0x3c9b82][_0x2097('0x110')](_0x2097('0xb1'),_0x2097('0x121'));}return _0x2b0b9e;}));_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0x122')]()[_0x2097('0x13')](function(_0x594f64){for(var _0x16b2c3=0x0;_0x16b2c3<_0x594f64[_0x2097('0x47')];_0x16b2c3++){_0x594f64[_0x16b2c3]['setDataValue'](_0x2097('0xb1'),_0x2097('0x114'));}return _0x594f64;}));_0x5a8dca[_0x2097('0x43')](_0x2c8fca[_0x2097('0x115')]()[_0x2097('0x13')](function(_0x484a3e){for(var _0x580117=0x0;_0x580117<_0x484a3e[_0x2097('0x47')];_0x580117++){_0x484a3e[_0x580117]['setDataValue'](_0x2097('0xb1'),_0x2097('0x116'));}return _0x484a3e;}));return BPromise['all'](_0x5a8dca);})['then'](function(_0x50f728){var _0x2adeb8=_[_0x2097('0x117')](_0x50f728);_0x5a8dca=[];return db['sequelize']['transaction'](function(_0xfec548){for(var _0x225978=0x0;_0x225978<_0x2adeb8[_0x2097('0x47')];_0x225978++){_0x5a8dca['push'](_0x2adeb8[_0x225978][_0x2097('0x123')](_0x219402['id']),{'transaction':_0xfec548});}return BPromise[_0x2097('0x56')](_0x5a8dca)[_0x2097('0x13')](function(){if(_0x219402[_0x2097('0x9b')]){return BPromise['each'](_['filter'](_0x2adeb8,function(_0x5f0624){return _0x5f0624[_0x2097('0x11a')](_0x2097('0xb1'))===_0x2097('0x111');}),function(_0x34d3bd){return db[_0x2097('0xb4')][_0x2097('0x25')]({'where':{'VoiceQueueId':_0x34d3bd['id'],'UserId':_0x219402['id']},'transaction':_0xfec548});});}else{return;}})[_0x2097('0x13')](function(){for(var _0x18058f=0x0;_0x18058f<_0x2adeb8['length'];_0x18058f++){var _0x37d888=_0x2adeb8[_0x18058f][_0x2097('0x11a')](_0x2097('0xb1'));var _0x4bf601=_0x37d888+'QueueId';socket[_0x2097('0xa7')](_0x2097('0x2a')+_0x37d888+_0x2097('0xb3'),{'UserId':_0x219402['id'],['queueField']:_0x2adeb8[_0x18058f]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x145b69,null))[_0x2097('0x1c')](handleError(_0x145b69,null));};exports[_0x2097('0x124')]=function(_0x19c8b2,_0x238680){var _0x6ab9c2={};var _0x5caa8e={};var _0x9b3e32;var _0x5c1ccb;return db[_0x2097('0x3e')]['findOne']({'where':{'id':_0x19c8b2[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x238680,null))[_0x2097('0x13')](function(_0x50aad4){if(_0x50aad4){_0x9b3e32=_0x50aad4;_0x5caa8e['model']=_['keys'](db['CmList']['rawAttributes']);_0x5caa8e[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x19c8b2[_0x2097('0x3f')]);_0x5caa8e[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x5caa8e[_0x2097('0x50')],_0x5caa8e[_0x2097('0x3f')]);_0x6ab9c2[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x5caa8e[_0x2097('0x50')],qs[_0x2097('0x52')](_0x19c8b2['query'][_0x2097('0x52')]));_0x6ab9c2[_0x2097('0x42')]=_0x6ab9c2[_0x2097('0x42')][_0x2097('0x47')]?_0x6ab9c2[_0x2097('0x42')]:_0x5caa8e['model'];_0x6ab9c2[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x19c8b2[_0x2097('0x3f')][_0x2097('0xd1')]);_0x6ab9c2[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x19c8b2[_0x2097('0x3f')],_0x5caa8e[_0x2097('0xcf')]));if(_0x19c8b2[_0x2097('0x3f')][_0x2097('0x2d')]){_0x6ab9c2[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x6ab9c2[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x6ab9c2[_0x2097('0x42')],function(_0x3c69f4){var _0x5b8dd4={};_0x5b8dd4[_0x3c69f4]={'$like':'%'+_0x19c8b2[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x5b8dd4;})});}_0x6ab9c2=_[_0x2097('0x53')]({},_0x6ab9c2,_0x19c8b2[_0x2097('0xdc')]);return _0x9b3e32[_0x2097('0x124')](_0x6ab9c2);}})[_0x2097('0x13')](function(_0x5855f5){if(_0x5855f5){_0x5c1ccb=_0x5855f5[_0x2097('0x47')];if(!_0x19c8b2[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x6ab9c2[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x19c8b2[_0x2097('0x3f')][_0x2097('0x21')]);_0x6ab9c2[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x19c8b2[_0x2097('0x3f')]['offset']);}return _0x9b3e32['getLists'](_0x6ab9c2);}})[_0x2097('0x13')](function(_0x53b814){if(_0x53b814){return _0x53b814?{'count':_0x5c1ccb,'rows':_0x53b814}:null;}})[_0x2097('0x13')](respondWithResult(_0x238680,null))[_0x2097('0x1c')](handleError(_0x238680,null));};exports[_0x2097('0x125')]=function(_0x1845e4,_0x5d1217){var _0x52ca45={};var _0x5083eb={};var _0x56cd82;var _0x35fb0f;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x1845e4[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x5d1217,null))[_0x2097('0x13')](function(_0x37aa15){if(_0x37aa15){_0x56cd82=_0x37aa15;_0x5083eb['model']=_[_0x2097('0x51')](db[_0x2097('0x3e')][_0x2097('0xce')]);_0x5083eb[_0x2097('0x3f')]=_['keys'](_0x1845e4[_0x2097('0x3f')]);_0x5083eb[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x5083eb[_0x2097('0x50')],_0x5083eb[_0x2097('0x3f')]);_0x52ca45[_0x2097('0x42')]=_['intersection'](_0x5083eb[_0x2097('0x50')],qs[_0x2097('0x52')](_0x1845e4[_0x2097('0x3f')][_0x2097('0x52')]));_0x52ca45[_0x2097('0x42')]=_0x52ca45[_0x2097('0x42')][_0x2097('0x47')]?_0x52ca45['attributes']:_0x5083eb['model'];_0x52ca45[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x1845e4[_0x2097('0x3f')]['sort']);_0x52ca45[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x1845e4[_0x2097('0x3f')],_0x5083eb[_0x2097('0xcf')]));if(_0x1845e4[_0x2097('0x3f')][_0x2097('0x2d')]){_0x52ca45[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x52ca45[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x52ca45[_0x2097('0x42')],function(_0x5dd18e){var _0x1715df={};_0x1715df[_0x5dd18e]={'$like':'%'+_0x1845e4['query'][_0x2097('0x2d')]+'%'};return _0x1715df;})});}_0x52ca45[_0x2097('0x50')]=db['User'];_0x52ca45['as']=_0x2097('0x80');_0x52ca45=_['merge']({},_0x52ca45,_0x1845e4[_0x2097('0xdc')]);return _0x56cd82['getVoiceQueues']({'include':[_0x52ca45]});}})[_0x2097('0x13')](function(_0x5244fd){if(_0x5244fd){var _0xb3fd5c={},_0x28cb19=[],_0x88891b=0x0;for(var _0x2bcba4=0x0;_0x2bcba4<_0x5244fd[_0x2097('0x47')];_0x2bcba4+=0x1){for(var _0x4d3bba=0x0,_0x28e81e;_0x4d3bba<_0x5244fd[_0x2bcba4][_0x2097('0x80')][_0x2097('0x47')];_0x4d3bba+=0x1){_0x28e81e=_0x5244fd[_0x2bcba4]['Agents'][_0x4d3bba][_0x2097('0x26')]({'plain':!![]});_0xb3fd5c[_0x28e81e['id']]=_0x28e81e;}}_0xb3fd5c=_['values'](_0xb3fd5c);for(var _0x2e637a=qs[_0x2097('0x1f')](_0x1845e4['query'][_0x2097('0x1f')]);_0x2e637a<_0xb3fd5c[_0x2097('0x47')]&&_0x28cb19[_0x2097('0x47')]<qs[_0x2097('0x21')](_0x1845e4[_0x2097('0x3f')][_0x2097('0x21')]);_0x2e637a+=0x1){if(_0xb3fd5c[_0x2e637a]){_0x28cb19[_0x2097('0x43')](_0xb3fd5c[_0x2e637a]);}}return{'count':_0xb3fd5c[_0x2097('0x47')],'rows':_0x28cb19};}})[_0x2097('0x13')](respondWithResult(_0x5d1217,null))[_0x2097('0x1c')](handleError(_0x5d1217,null));};exports[_0x2097('0x25')]=function(_0x5b0f96,_0x2719a0){if(_0x5b0f96[_0x2097('0x2a')]['id']==_0x5b0f96[_0x2097('0x4f')]['id']){return _0x2719a0['status'](0x1f4)[_0x2097('0x36')]({'message':_0x2097('0x126')});}return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x5b0f96[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2719a0,null))['then'](removeEntity(_0x2719a0,null))[_0x2097('0x1c')](handleError(_0x2719a0,null));};exports[_0x2097('0x127')]=function(_0x5e962a,_0x339ab5){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x5e962a[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x339ab5,null))[_0x2097('0x13')](function(_0xc32e8d){if(_0xc32e8d){return _0xc32e8d[_0x2097('0x127')](_0x5e962a['body'][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x5e962a[_0x2097('0x58')],['ids','id'])||{})[_0x2097('0xa5')](function(){for(var _0x5ae1a7=0x0;_0x5ae1a7<_0x5e962a['body'][_0x2097('0xa4')][_0x2097('0x47')];_0x5ae1a7+=0x1){socket[_0x2097('0xa7')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x5e962a[_0x2097('0x58')][_0x2097('0xa4')][_0x5ae1a7]),'UserId':Number(_0x5e962a['params']['id'])});}return _0x5e962a[_0x2097('0x58')]['ids'];});}})['then'](respondWithResult(_0x339ab5,null))[_0x2097('0x1c')](handleError(_0x339ab5,null));};exports[_0x2097('0x128')]=function(_0x12d4bd,_0x48d606){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x12d4bd[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x48d606,null))[_0x2097('0x13')](function(_0x15dc21){if(_0x15dc21){return _0x15dc21[_0x2097('0x128')](_0x12d4bd[_0x2097('0x3f')][_0x2097('0xa4')])[_0x2097('0x13')](function(){if(_[_0x2097('0x129')](_0x12d4bd[_0x2097('0x3f')][_0x2097('0xa4')])){for(var _0x5711a5=0x0;_0x5711a5<_0x12d4bd[_0x2097('0x3f')][_0x2097('0xa4')][_0x2097('0x47')];_0x5711a5+=0x1){socket['emit'](_0x2097('0x12a'),{'ChatInteractionId':Number(_0x12d4bd[_0x2097('0x3f')][_0x2097('0xa4')][_0x5711a5]),'UserId':Number(_0x12d4bd[_0x2097('0x4f')]['id'])});}}else{socket[_0x2097('0xa7')](_0x2097('0x12a'),{'ChatInteractionId':Number(_0x12d4bd[_0x2097('0x3f')][_0x2097('0xa4')]),'UserId':Number(_0x12d4bd[_0x2097('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x48d606,null))[_0x2097('0x1c')](handleError(_0x48d606,null));};exports[_0x2097('0x12b')]=function(_0x3defbd,_0x2b957d){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x3defbd[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x2b957d,null))['then'](function(_0x187495){if(_0x187495){return _0x187495[_0x2097('0x12b')](_0x3defbd['body'][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x3defbd[_0x2097('0x58')],[_0x2097('0xa4'),'id'])||{})[_0x2097('0xa5')](function(){for(var _0x2c14ed=0x0;_0x2c14ed<_0x3defbd[_0x2097('0x58')][_0x2097('0xa4')]['length'];_0x2c14ed+=0x1){socket[_0x2097('0xa7')](_0x2097('0x12c'),{'MailInteractionId':Number(_0x3defbd[_0x2097('0x58')][_0x2097('0xa4')][_0x2c14ed]),'UserId':Number(_0x3defbd[_0x2097('0x4f')]['id'])});}return _0x3defbd[_0x2097('0x58')][_0x2097('0xa4')];});}})['then'](respondWithResult(_0x2b957d,null))[_0x2097('0x1c')](handleError(_0x2b957d,null));};exports[_0x2097('0x12d')]=function(_0x4534d8,_0x2cae97){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x4534d8[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x2cae97,null))[_0x2097('0x13')](function(_0x5ddcc4){if(_0x5ddcc4){return _0x5ddcc4[_0x2097('0x12d')](_0x4534d8['query'][_0x2097('0xa4')])[_0x2097('0x13')](function(){if(_['isArray'](_0x4534d8['query'][_0x2097('0xa4')])){for(var _0x13d850=0x0;_0x13d850<_0x4534d8[_0x2097('0x3f')][_0x2097('0xa4')][_0x2097('0x47')];_0x13d850+=0x1){socket[_0x2097('0xa7')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4534d8[_0x2097('0x3f')][_0x2097('0xa4')][_0x13d850]),'UserId':Number(_0x4534d8['params']['id'])});}}else{socket['emit'](_0x2097('0x12e'),{'MailInteractionId':Number(_0x4534d8['query']['ids']),'UserId':Number(_0x4534d8[_0x2097('0x4f')]['id'])});}});}})[_0x2097('0x13')](respondWithStatusCode(_0x2cae97,null))[_0x2097('0x1c')](handleError(_0x2cae97,null));};exports[_0x2097('0x12f')]=function(_0xc7907d,_0x22b3ac){return db['User'][_0x2097('0x32')]({'where':{'id':_0xc7907d[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x22b3ac,null))[_0x2097('0x13')](function(_0x5a247e){if(_0x5a247e){return _0x5a247e[_0x2097('0x12f')](_0xc7907d[_0x2097('0x58')][_0x2097('0xa4')],_[_0x2097('0x5b')](_0xc7907d['body'],[_0x2097('0xa4'),'id'])||{})['spread'](function(){for(var _0x2bc05d=0x0;_0x2bc05d<_0xc7907d[_0x2097('0x58')][_0x2097('0xa4')][_0x2097('0x47')];_0x2bc05d+=0x1){socket[_0x2097('0xa7')](_0x2097('0x130'),{'FaxInteractionId':Number(_0xc7907d[_0x2097('0x58')][_0x2097('0xa4')][_0x2bc05d]),'UserId':Number(_0xc7907d[_0x2097('0x4f')]['id'])});}return _0xc7907d[_0x2097('0x58')][_0x2097('0xa4')];});}})['then'](respondWithResult(_0x22b3ac,null))['catch'](handleError(_0x22b3ac,null));};exports[_0x2097('0x131')]=function(_0x4f74bb,_0x13b493){return db['User']['find']({'where':{'id':_0x4f74bb[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x13b493,null))['then'](function(_0x3be004){if(_0x3be004){return _0x3be004['removeFaxInteractions'](_0x4f74bb[_0x2097('0x3f')][_0x2097('0xa4')])[_0x2097('0x13')](function(){if(_[_0x2097('0x129')](_0x4f74bb[_0x2097('0x3f')]['ids'])){for(var _0xd71345=0x0;_0xd71345<_0x4f74bb['query']['ids'][_0x2097('0x47')];_0xd71345+=0x1){socket[_0x2097('0xa7')](_0x2097('0x132'),{'FaxInteractionId':Number(_0x4f74bb[_0x2097('0x3f')]['ids'][_0xd71345]),'UserId':Number(_0x4f74bb[_0x2097('0x4f')]['id'])});}}else{socket[_0x2097('0xa7')](_0x2097('0x132'),{'FaxInteractionId':Number(_0x4f74bb[_0x2097('0x3f')]['ids']),'UserId':Number(_0x4f74bb[_0x2097('0x4f')]['id'])});}});}})[_0x2097('0x13')](respondWithStatusCode(_0x13b493,null))[_0x2097('0x1c')](handleError(_0x13b493,null));};exports[_0x2097('0x133')]=function(_0x4a7cf7,_0x22efcd){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x4a7cf7[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x22efcd,null))['then'](function(_0x541b71){if(_0x541b71){return _0x541b71['addSmsInteractions'](_0x4a7cf7['body'][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x4a7cf7[_0x2097('0x58')],['ids','id'])||{})['spread'](function(){for(var _0x43a4cb=0x0;_0x43a4cb<_0x4a7cf7[_0x2097('0x58')][_0x2097('0xa4')][_0x2097('0x47')];_0x43a4cb+=0x1){socket['emit'](_0x2097('0x134'),{'SmsInteractionId':Number(_0x4a7cf7['body'][_0x2097('0xa4')][_0x43a4cb]),'UserId':Number(_0x4a7cf7[_0x2097('0x4f')]['id'])});}return _0x4a7cf7[_0x2097('0x58')][_0x2097('0xa4')];});}})['then'](respondWithResult(_0x22efcd,null))[_0x2097('0x1c')](handleError(_0x22efcd,null));};exports['removeSmsInteractions']=function(_0x63f4e0,_0x3b5b46){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x63f4e0[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x3b5b46,null))[_0x2097('0x13')](function(_0x548814){if(_0x548814){return _0x548814[_0x2097('0x135')](_0x63f4e0[_0x2097('0x3f')][_0x2097('0xa4')])[_0x2097('0x13')](function(){if(_['isArray'](_0x63f4e0['query']['ids'])){for(var _0x12962a=0x0;_0x12962a<_0x63f4e0[_0x2097('0x3f')]['ids']['length'];_0x12962a+=0x1){socket[_0x2097('0xa7')](_0x2097('0x136'),{'SmsInteractionId':Number(_0x63f4e0[_0x2097('0x3f')][_0x2097('0xa4')][_0x12962a]),'UserId':Number(_0x63f4e0[_0x2097('0x4f')]['id'])});}}else{socket[_0x2097('0xa7')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x63f4e0['query'][_0x2097('0xa4')]),'UserId':Number(_0x63f4e0[_0x2097('0x4f')]['id'])});}});}})[_0x2097('0x13')](respondWithStatusCode(_0x3b5b46,null))[_0x2097('0x1c')](handleError(_0x3b5b46,null));};exports[_0x2097('0x137')]=function(_0x3b7862,_0x1cc538){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x3b7862[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1cc538,null))[_0x2097('0x13')](function(_0x50dd91){if(_0x50dd91){return _0x50dd91[_0x2097('0x137')](_0x3b7862[_0x2097('0x58')][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x3b7862[_0x2097('0x58')],[_0x2097('0xa4'),'id'])||{})['spread'](function(){for(var _0x382044=0x0;_0x382044<_0x3b7862[_0x2097('0x58')]['ids'][_0x2097('0x47')];_0x382044+=0x1){socket[_0x2097('0xa7')](_0x2097('0x138'),{'OpenchannelInteractionId':Number(_0x3b7862[_0x2097('0x58')][_0x2097('0xa4')][_0x382044]),'UserId':Number(_0x3b7862[_0x2097('0x4f')]['id'])});}return _0x3b7862['body'][_0x2097('0xa4')];});}})['then'](respondWithResult(_0x1cc538,null))['catch'](handleError(_0x1cc538,null));};exports[_0x2097('0x139')]=function(_0x155706,_0x3105fb){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x155706[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x3105fb,null))['then'](function(_0xe563e7){if(_0xe563e7){return _0xe563e7[_0x2097('0x139')](_0x155706['query'][_0x2097('0xa4')])[_0x2097('0x13')](function(){if(_[_0x2097('0x129')](_0x155706['query'][_0x2097('0xa4')])){for(var _0x28422a=0x0;_0x28422a<_0x155706[_0x2097('0x3f')][_0x2097('0xa4')]['length'];_0x28422a+=0x1){socket[_0x2097('0xa7')](_0x2097('0x13a'),{'OpenchannelInteractionId':Number(_0x155706[_0x2097('0x3f')][_0x2097('0xa4')][_0x28422a]),'UserId':Number(_0x155706['params']['id'])});}}else{socket[_0x2097('0xa7')](_0x2097('0x13a'),{'OpenchannelInteractionId':Number(_0x155706['query'][_0x2097('0xa4')]),'UserId':Number(_0x155706[_0x2097('0x4f')]['id'])});}});}})[_0x2097('0x13')](respondWithStatusCode(_0x3105fb,null))['catch'](handleError(_0x3105fb,null));};exports['addWhatsappInteractions']=function(_0x266a37,_0x6a0f60){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x266a37['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x6a0f60,null))['then'](function(_0x580868){if(_0x580868){return _0x580868[_0x2097('0x13b')](_0x266a37[_0x2097('0x58')][_0x2097('0xa4')],_['omit'](_0x266a37[_0x2097('0x58')],[_0x2097('0xa4'),'id'])||{})[_0x2097('0xa5')](function(){for(var _0x154561=0x0;_0x154561<_0x266a37[_0x2097('0x58')][_0x2097('0xa4')][_0x2097('0x47')];_0x154561+=0x1){socket[_0x2097('0xa7')](_0x2097('0x13c'),{'WhatsappInteractionId':Number(_0x266a37[_0x2097('0x58')][_0x2097('0xa4')][_0x154561]),'UserId':Number(_0x266a37[_0x2097('0x4f')]['id'])});}return _0x266a37[_0x2097('0x58')][_0x2097('0xa4')];});}})[_0x2097('0x13')](respondWithResult(_0x6a0f60,null))[_0x2097('0x1c')](handleError(_0x6a0f60,null));};exports[_0x2097('0x13d')]=function(_0x59fc93,_0xf3c8f4){return db['User']['find']({'where':{'id':_0x59fc93['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0xf3c8f4,null))['then'](function(_0x21abb1){if(_0x21abb1){return _0x21abb1[_0x2097('0x13d')](_0x59fc93[_0x2097('0x3f')][_0x2097('0xa4')]);}})[_0x2097('0x13')](respondWithStatusCode(_0xf3c8f4,null))[_0x2097('0x1c')](handleError(_0xf3c8f4,null));};exports['getVoicePrefixes']=function(_0x2d482f,_0x2dc6bb){var _0x2b59ee={};var _0x3c8b74={};var _0x46ebab;var _0x32f351;return db[_0x2097('0x3e')]['findOne']({'where':{'id':_0x2d482f[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2dc6bb,null))[_0x2097('0x13')](function(_0x29b119){if(_0x29b119){_0x46ebab=_0x29b119;_0x3c8b74['model']=_[_0x2097('0x51')](db[_0x2097('0x13e')][_0x2097('0xce')]);_0x3c8b74['query']=_[_0x2097('0x51')](_0x2d482f[_0x2097('0x3f')]);_0x3c8b74[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x3c8b74[_0x2097('0x50')],_0x3c8b74['query']);_0x2b59ee[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x3c8b74[_0x2097('0x50')],qs[_0x2097('0x52')](_0x2d482f[_0x2097('0x3f')][_0x2097('0x52')]));_0x2b59ee[_0x2097('0x42')]=_0x2b59ee[_0x2097('0x42')]['length']?_0x2b59ee['attributes']:_0x3c8b74[_0x2097('0x50')];_0x2b59ee[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x2d482f[_0x2097('0x3f')][_0x2097('0xd1')]);_0x2b59ee[_0x2097('0x3d')]=qs['filters'](_[_0x2097('0xd2')](_0x2d482f['query'],_0x3c8b74[_0x2097('0xcf')]));if(_0x2d482f[_0x2097('0x3f')]['filter']){_0x2b59ee['where']=_[_0x2097('0x53')](_0x2b59ee[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x2b59ee[_0x2097('0x42')],function(_0x246e81){var _0x224f0d={};_0x224f0d[_0x246e81]={'$like':'%'+_0x2d482f['query']['filter']+'%'};return _0x224f0d;})});}_0x2b59ee=_[_0x2097('0x53')]({},_0x2b59ee,_0x2d482f[_0x2097('0xdc')]);return _0x46ebab[_0x2097('0x13f')](_0x2b59ee);}})[_0x2097('0x13')](function(_0x1cd58d){if(_0x1cd58d){_0x32f351=_0x1cd58d[_0x2097('0x47')];if(!_0x2d482f['query'][_0x2097('0xd3')](_0x2097('0xd9'))){_0x2b59ee[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x2d482f['query'][_0x2097('0x21')]);_0x2b59ee[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x2d482f[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x46ebab[_0x2097('0x13f')](_0x2b59ee);}})[_0x2097('0x13')](function(_0xcbcbbd){if(_0xcbcbbd){return _0xcbcbbd?{'count':_0x32f351,'rows':_0xcbcbbd}:null;}})[_0x2097('0x13')](respondWithResult(_0x2dc6bb,null))['catch'](handleError(_0x2dc6bb,null));};exports[_0x2097('0x140')]=function(_0x947ad,_0x14a2ab){var _0x2fd809={};var _0x6d1931={};var _0x599463;var _0x2cd650;return db['User'][_0x2097('0xcd')]({'where':{'id':_0x947ad['params']['id']}})['then'](handleEntityNotFound(_0x14a2ab,null))[_0x2097('0x13')](function(_0x24bdd2){if(_0x24bdd2){_0x599463=_0x24bdd2;_0x6d1931[_0x2097('0x50')]=_['keys'](db[_0x2097('0x141')][_0x2097('0xce')]);_0x6d1931['query']=_[_0x2097('0x51')](_0x947ad[_0x2097('0x3f')]);_0x6d1931[_0x2097('0xcf')]=_['intersection'](_0x6d1931[_0x2097('0x50')],_0x6d1931['query']);_0x2fd809[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x6d1931[_0x2097('0x50')],qs['fields'](_0x947ad['query'][_0x2097('0x52')]));_0x2fd809['attributes']=_0x2fd809[_0x2097('0x42')][_0x2097('0x47')]?_0x2fd809[_0x2097('0x42')]:_0x6d1931['model'];_0x2fd809[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x947ad[_0x2097('0x3f')][_0x2097('0xd1')]);_0x2fd809['where']=qs['filters'](_['pick'](_0x947ad['query'],_0x6d1931[_0x2097('0xcf')]));if(_0x947ad[_0x2097('0x3f')]['filter']){_0x2fd809[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x2fd809[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x2fd809[_0x2097('0x42')],function(_0x1784ae){var _0x4b47bc={};_0x4b47bc[_0x1784ae]={'$like':'%'+_0x947ad[_0x2097('0x3f')]['filter']+'%'};return _0x4b47bc;})});}_0x2fd809=_[_0x2097('0x53')]({},_0x2fd809,_0x947ad[_0x2097('0xdc')]);return _0x599463[_0x2097('0x140')](_0x2fd809);}})[_0x2097('0x13')](function(_0x2d6412){if(_0x2d6412){_0x2cd650=_0x2d6412[_0x2097('0x47')];if(!_0x947ad['query'][_0x2097('0xd3')]('nolimit')){_0x2fd809[_0x2097('0x21')]=qs['limit'](_0x947ad[_0x2097('0x3f')][_0x2097('0x21')]);_0x2fd809[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x947ad[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x599463['getFaxAccounts'](_0x2fd809);}})[_0x2097('0x13')](function(_0x147b79){if(_0x147b79){return _0x147b79?{'count':_0x2cd650,'rows':_0x147b79}:null;}})['then'](respondWithResult(_0x14a2ab,null))[_0x2097('0x1c')](handleError(_0x14a2ab,null));};exports['addFaxAccounts']=function(_0x4f6b32,_0x480671){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x4f6b32['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x480671,null))[_0x2097('0x13')](function(_0x1da0eb){if(_0x1da0eb){return _0x1da0eb[_0x2097('0x142')](_0x4f6b32[_0x2097('0x58')][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x4f6b32['body'],[_0x2097('0xa4'),'id'])||{});}})[_0x2097('0x13')](respondWithResult(_0x480671,null))[_0x2097('0x1c')](handleError(_0x480671,null));};exports['removeFaxAccounts']=function(_0x5bcae2,_0x27ed24){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x5bcae2[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x27ed24,null))[_0x2097('0x13')](function(_0x2420d1){if(_0x2420d1){return _0x2420d1['removeFaxAccounts'](_0x5bcae2[_0x2097('0x3f')][_0x2097('0xa4')]);}})[_0x2097('0x13')](respondWithStatusCode(_0x27ed24,null))[_0x2097('0x1c')](handleError(_0x27ed24,null));};exports[_0x2097('0x143')]=function(_0x1f2507,_0x397df4){var _0x12b98f={};var _0x1f96ff={};var _0x396162;var _0x2327d2;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x1f2507['params']['id']}})['then'](handleEntityNotFound(_0x397df4,null))['then'](function(_0xc03727){if(_0xc03727){_0x396162=_0xc03727;_0x1f96ff[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0x144')][_0x2097('0xce')]);_0x1f96ff[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x1f2507[_0x2097('0x3f')]);_0x1f96ff[_0x2097('0xcf')]=_['intersection'](_0x1f96ff['model'],_0x1f96ff[_0x2097('0x3f')]);_0x12b98f[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x1f96ff[_0x2097('0x50')],qs['fields'](_0x1f2507[_0x2097('0x3f')][_0x2097('0x52')]));_0x12b98f[_0x2097('0x42')]=_0x12b98f[_0x2097('0x42')][_0x2097('0x47')]?_0x12b98f[_0x2097('0x42')]:_0x1f96ff[_0x2097('0x50')];_0x12b98f['order']=qs[_0x2097('0xd1')](_0x1f2507[_0x2097('0x3f')]['sort']);_0x12b98f[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x1f2507[_0x2097('0x3f')],_0x1f96ff[_0x2097('0xcf')]));if(_0x1f2507[_0x2097('0x3f')][_0x2097('0x2d')]){_0x12b98f['where']=_['merge'](_0x12b98f[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x12b98f[_0x2097('0x42')],function(_0x41b990){var _0x591501={};_0x591501[_0x41b990]={'$like':'%'+_0x1f2507[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x591501;})});}_0x12b98f=_[_0x2097('0x53')]({},_0x12b98f,_0x1f2507[_0x2097('0xdc')]);return _0x396162[_0x2097('0x143')](_0x12b98f);}})[_0x2097('0x13')](function(_0x1266cc){if(_0x1266cc){_0x2327d2=_0x1266cc[_0x2097('0x47')];if(!_0x1f2507[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x12b98f[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x1f2507[_0x2097('0x3f')][_0x2097('0x21')]);_0x12b98f[_0x2097('0x1f')]=qs['offset'](_0x1f2507[_0x2097('0x3f')]['offset']);}return _0x396162['getMailAccounts'](_0x12b98f);}})[_0x2097('0x13')](function(_0x1a7f5){if(_0x1a7f5){return _0x1a7f5?{'count':_0x2327d2,'rows':_0x1a7f5}:null;}})[_0x2097('0x13')](respondWithResult(_0x397df4,null))[_0x2097('0x1c')](handleError(_0x397df4,null));};exports['addMailAccounts']=function(_0x47bf2b,_0x3fb147){return db['User']['find']({'where':{'id':_0x47bf2b[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x3fb147,null))[_0x2097('0x13')](function(_0x20eb7f){if(_0x20eb7f){return _0x20eb7f['addMailAccounts'](_0x47bf2b[_0x2097('0x58')][_0x2097('0xa4')],_['omit'](_0x47bf2b[_0x2097('0x58')],['ids','id'])||{});}})['then'](respondWithResult(_0x3fb147,null))[_0x2097('0x1c')](handleError(_0x3fb147,null));};exports[_0x2097('0x145')]=function(_0x45b1da,_0x5ebfa5){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x45b1da['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x5ebfa5,null))['then'](function(_0x2790f4){if(_0x2790f4){return _0x2790f4[_0x2097('0x145')](_0x45b1da['query'][_0x2097('0xa4')]);}})[_0x2097('0x13')](respondWithStatusCode(_0x5ebfa5,null))[_0x2097('0x1c')](handleError(_0x5ebfa5,null));};exports[_0x2097('0x146')]=function(_0x46ce4d,_0x387657){var _0x40019e={};var _0x429a7c={};var _0x258f36;var _0x4d11e2;return db['User']['findOne']({'where':{'id':_0x46ce4d[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x387657,null))[_0x2097('0x13')](function(_0xb81846){if(_0xb81846){_0x258f36=_0xb81846;_0x429a7c[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0x147')][_0x2097('0xce')]);_0x429a7c[_0x2097('0x3f')]=_['keys'](_0x46ce4d[_0x2097('0x3f')]);_0x429a7c['filters']=_[_0x2097('0xdb')](_0x429a7c[_0x2097('0x50')],_0x429a7c[_0x2097('0x3f')]);_0x40019e[_0x2097('0x42')]=_['intersection'](_0x429a7c[_0x2097('0x50')],qs[_0x2097('0x52')](_0x46ce4d[_0x2097('0x3f')][_0x2097('0x52')]));_0x40019e[_0x2097('0x42')]=_0x40019e['attributes'][_0x2097('0x47')]?_0x40019e[_0x2097('0x42')]:_0x429a7c[_0x2097('0x50')];_0x40019e['order']=qs[_0x2097('0xd1')](_0x46ce4d['query'][_0x2097('0xd1')]);_0x40019e['where']=qs['filters'](_['pick'](_0x46ce4d[_0x2097('0x3f')],_0x429a7c['filters']));if(_0x46ce4d[_0x2097('0x3f')][_0x2097('0x2d')]){_0x40019e[_0x2097('0x3d')]=_['merge'](_0x40019e['where'],{'$or':_['map'](_0x40019e['attributes'],function(_0x27123f){var _0x1f2082={};_0x1f2082[_0x27123f]={'$like':'%'+_0x46ce4d[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x1f2082;})});}_0x40019e=_[_0x2097('0x53')]({},_0x40019e,_0x46ce4d[_0x2097('0xdc')]);return _0x258f36[_0x2097('0x146')](_0x40019e);}})[_0x2097('0x13')](function(_0x229097){if(_0x229097){_0x4d11e2=_0x229097[_0x2097('0x47')];if(!_0x46ce4d[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x40019e[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x46ce4d[_0x2097('0x3f')][_0x2097('0x21')]);_0x40019e[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x46ce4d['query']['offset']);}return _0x258f36[_0x2097('0x146')](_0x40019e);}})[_0x2097('0x13')](function(_0x4afafb){if(_0x4afafb){return _0x4afafb?{'count':_0x4d11e2,'rows':_0x4afafb}:null;}})[_0x2097('0x13')](respondWithResult(_0x387657,null))[_0x2097('0x1c')](handleError(_0x387657,null));};exports[_0x2097('0x148')]=function(_0x52f2a1,_0x3a3099){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x52f2a1['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x3a3099,null))[_0x2097('0x13')](function(_0x780a2b){if(_0x780a2b){return _0x780a2b[_0x2097('0x148')](_0x52f2a1[_0x2097('0x58')]['ids'],_['omit'](_0x52f2a1[_0x2097('0x58')],[_0x2097('0xa4'),'id'])||{});}})[_0x2097('0x13')](respondWithResult(_0x3a3099,null))[_0x2097('0x1c')](handleError(_0x3a3099,null));};exports[_0x2097('0x149')]=function(_0x392ea5,_0x319e4a){return db['User']['find']({'where':{'id':_0x392ea5[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x319e4a,null))[_0x2097('0x13')](function(_0xb8a7ec){if(_0xb8a7ec){return _0xb8a7ec[_0x2097('0x149')](_0x392ea5[_0x2097('0x3f')]['ids']);}})[_0x2097('0x13')](respondWithStatusCode(_0x319e4a,null))[_0x2097('0x1c')](handleError(_0x319e4a,null));};exports[_0x2097('0x14a')]=function(_0x2ea7cf,_0x39fa7c){var _0x33197d={};var _0x3018f9={};var _0x4b14fe;var _0x1db193;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x2ea7cf['params']['id']}})['then'](handleEntityNotFound(_0x39fa7c,null))['then'](function(_0x22a972){if(_0x22a972){_0x4b14fe=_0x22a972;_0x3018f9[_0x2097('0x50')]=_['keys'](db['SmsAccount'][_0x2097('0xce')]);_0x3018f9[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x2ea7cf[_0x2097('0x3f')]);_0x3018f9[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x3018f9[_0x2097('0x50')],_0x3018f9[_0x2097('0x3f')]);_0x33197d[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x3018f9[_0x2097('0x50')],qs['fields'](_0x2ea7cf[_0x2097('0x3f')][_0x2097('0x52')]));_0x33197d[_0x2097('0x42')]=_0x33197d[_0x2097('0x42')][_0x2097('0x47')]?_0x33197d[_0x2097('0x42')]:_0x3018f9[_0x2097('0x50')];_0x33197d['order']=qs[_0x2097('0xd1')](_0x2ea7cf['query'][_0x2097('0xd1')]);_0x33197d[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x2ea7cf[_0x2097('0x3f')],_0x3018f9[_0x2097('0xcf')]));if(_0x2ea7cf[_0x2097('0x3f')][_0x2097('0x2d')]){_0x33197d[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x33197d[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x33197d[_0x2097('0x42')],function(_0x416df9){var _0x5343e5={};_0x5343e5[_0x416df9]={'$like':'%'+_0x2ea7cf[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x5343e5;})});}_0x33197d=_[_0x2097('0x53')]({},_0x33197d,_0x2ea7cf[_0x2097('0xdc')]);return _0x4b14fe[_0x2097('0x14a')](_0x33197d);}})[_0x2097('0x13')](function(_0x3850e6){if(_0x3850e6){_0x1db193=_0x3850e6[_0x2097('0x47')];if(!_0x2ea7cf[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x33197d[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x2ea7cf[_0x2097('0x3f')][_0x2097('0x21')]);_0x33197d[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x2ea7cf[_0x2097('0x3f')]['offset']);}return _0x4b14fe[_0x2097('0x14a')](_0x33197d);}})[_0x2097('0x13')](function(_0x208f4f){if(_0x208f4f){return _0x208f4f?{'count':_0x1db193,'rows':_0x208f4f}:null;}})['then'](respondWithResult(_0x39fa7c,null))[_0x2097('0x1c')](handleError(_0x39fa7c,null));};exports[_0x2097('0x14b')]=function(_0xeab0b3,_0x1e8fc1){return db['User'][_0x2097('0x32')]({'where':{'id':_0xeab0b3[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x1e8fc1,null))[_0x2097('0x13')](function(_0x5534c7){if(_0x5534c7){return _0x5534c7[_0x2097('0x14b')](_0xeab0b3[_0x2097('0x58')]['ids'],_[_0x2097('0x5b')](_0xeab0b3['body'],[_0x2097('0xa4'),'id'])||{});}})['then'](respondWithResult(_0x1e8fc1,null))['catch'](handleError(_0x1e8fc1,null));};exports[_0x2097('0x14c')]=function(_0x48cdba,_0x7bff45){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x48cdba[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x7bff45,null))['then'](function(_0x20ee2c){if(_0x20ee2c){return _0x20ee2c[_0x2097('0x14c')](_0x48cdba[_0x2097('0x3f')][_0x2097('0xa4')]);}})['then'](respondWithStatusCode(_0x7bff45,null))['catch'](handleError(_0x7bff45,null));};exports['getChatWebsites']=function(_0x3c1907,_0xab8a69){var _0x2155dc={};var _0x9f1c8b={};var _0x5a7394;var _0x169a46;return db[_0x2097('0x3e')][_0x2097('0xcd')]({'where':{'id':_0x3c1907[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0xab8a69,null))[_0x2097('0x13')](function(_0x369ab7){if(_0x369ab7){_0x5a7394=_0x369ab7;_0x9f1c8b[_0x2097('0x50')]=_[_0x2097('0x51')](db[_0x2097('0x14d')][_0x2097('0xce')]);_0x9f1c8b[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3c1907[_0x2097('0x3f')]);_0x9f1c8b[_0x2097('0xcf')]=_['intersection'](_0x9f1c8b['model'],_0x9f1c8b['query']);_0x2155dc['attributes']=_[_0x2097('0xdb')](_0x9f1c8b['model'],qs[_0x2097('0x52')](_0x3c1907[_0x2097('0x3f')][_0x2097('0x52')]));_0x2155dc[_0x2097('0x42')]=_0x2155dc[_0x2097('0x42')][_0x2097('0x47')]?_0x2155dc['attributes']:_0x9f1c8b[_0x2097('0x50')];_0x2155dc[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x3c1907['query'][_0x2097('0xd1')]);_0x2155dc['where']=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x3c1907[_0x2097('0x3f')],_0x9f1c8b['filters']));if(_0x3c1907[_0x2097('0x3f')]['filter']){_0x2155dc['where']=_[_0x2097('0x53')](_0x2155dc[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x2155dc[_0x2097('0x42')],function(_0x119620){var _0x31fb70={};_0x31fb70[_0x119620]={'$like':'%'+_0x3c1907['query'][_0x2097('0x2d')]+'%'};return _0x31fb70;})});}_0x2155dc=_[_0x2097('0x53')]({},_0x2155dc,_0x3c1907[_0x2097('0xdc')]);return _0x5a7394['getChatWebsites'](_0x2155dc);}})[_0x2097('0x13')](function(_0x498e4c){if(_0x498e4c){_0x169a46=_0x498e4c[_0x2097('0x47')];if(!_0x3c1907['query'][_0x2097('0xd3')]('nolimit')){_0x2155dc['limit']=qs[_0x2097('0x21')](_0x3c1907[_0x2097('0x3f')][_0x2097('0x21')]);_0x2155dc[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x3c1907[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x5a7394[_0x2097('0x14e')](_0x2155dc);}})[_0x2097('0x13')](function(_0x5f01f7){if(_0x5f01f7){return _0x5f01f7?{'count':_0x169a46,'rows':_0x5f01f7}:null;}})[_0x2097('0x13')](respondWithResult(_0xab8a69,null))[_0x2097('0x1c')](handleError(_0xab8a69,null));};exports['addChatWebsites']=function(_0x1dc34c,_0x4a58ae){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x1dc34c[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a58ae,null))[_0x2097('0x13')](function(_0x2b9ced){if(_0x2b9ced){return _0x2b9ced['addChatWebsites'](_0x1dc34c[_0x2097('0x58')][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x1dc34c['body'],[_0x2097('0xa4'),'id'])||{});}})[_0x2097('0x13')](respondWithResult(_0x4a58ae,null))[_0x2097('0x1c')](handleError(_0x4a58ae,null));};exports[_0x2097('0x14f')]=function(_0x4909fb,_0x5cdcf1){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x4909fb[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5cdcf1,null))[_0x2097('0x13')](function(_0x533227){if(_0x533227){return _0x533227[_0x2097('0x14f')](_0x4909fb[_0x2097('0x3f')][_0x2097('0xa4')]);}})['then'](respondWithStatusCode(_0x5cdcf1,null))[_0x2097('0x1c')](handleError(_0x5cdcf1,null));};exports[_0x2097('0x150')]=function(_0x3c7684,_0x2ae22){var _0x1adf62={};var _0x490ec5={};var _0x74de73;var _0x7037e0;return db[_0x2097('0x3e')]['findOne']({'where':{'id':_0x3c7684[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x2ae22,null))[_0x2097('0x13')](function(_0x387726){if(_0x387726){_0x74de73=_0x387726;_0x490ec5['model']=_[_0x2097('0x51')](db['WhatsappAccount'][_0x2097('0xce')]);_0x490ec5[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x3c7684[_0x2097('0x3f')]);_0x490ec5[_0x2097('0xcf')]=_[_0x2097('0xdb')](_0x490ec5[_0x2097('0x50')],_0x490ec5[_0x2097('0x3f')]);_0x1adf62[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x490ec5['model'],qs[_0x2097('0x52')](_0x3c7684[_0x2097('0x3f')][_0x2097('0x52')]));_0x1adf62['attributes']=_0x1adf62[_0x2097('0x42')]['length']?_0x1adf62[_0x2097('0x42')]:_0x490ec5[_0x2097('0x50')];_0x1adf62[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x3c7684['query']['sort']);_0x1adf62[_0x2097('0x3d')]=qs[_0x2097('0xcf')](_[_0x2097('0xd2')](_0x3c7684[_0x2097('0x3f')],_0x490ec5[_0x2097('0xcf')]));if(_0x3c7684[_0x2097('0x3f')]['filter']){_0x1adf62[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x1adf62[_0x2097('0x3d')],{'$or':_[_0x2097('0x2f')](_0x1adf62[_0x2097('0x42')],function(_0x5a9c6c){var _0x5c6ec8={};_0x5c6ec8[_0x5a9c6c]={'$like':'%'+_0x3c7684[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x5c6ec8;})});}_0x1adf62=_[_0x2097('0x53')]({},_0x1adf62,_0x3c7684[_0x2097('0xdc')]);return _0x74de73[_0x2097('0x150')](_0x1adf62);}})[_0x2097('0x13')](function(_0x19e053){if(_0x19e053){_0x7037e0=_0x19e053['length'];if(!_0x3c7684[_0x2097('0x3f')][_0x2097('0xd3')]('nolimit')){_0x1adf62[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x3c7684[_0x2097('0x3f')][_0x2097('0x21')]);_0x1adf62[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x3c7684[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x74de73[_0x2097('0x150')](_0x1adf62);}})['then'](function(_0x26b278){if(_0x26b278){return _0x26b278?{'count':_0x7037e0,'rows':_0x26b278}:null;}})['then'](respondWithResult(_0x2ae22,null))[_0x2097('0x1c')](handleError(_0x2ae22,null));};exports['addWhatsappAccounts']=function(_0x52d84c,_0x513d51){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x52d84c[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x513d51,null))[_0x2097('0x13')](function(_0xe0a5df){if(_0xe0a5df){return _0xe0a5df[_0x2097('0x151')](_0x52d84c['body'][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x52d84c[_0x2097('0x58')],['ids','id'])||{});}})[_0x2097('0x13')](respondWithResult(_0x513d51,null))[_0x2097('0x1c')](handleError(_0x513d51,null));};exports['removeWhatsappAccounts']=function(_0x590a40,_0x5c6dd2){return db[_0x2097('0x3e')]['find']({'where':{'id':_0x590a40['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x5c6dd2,null))[_0x2097('0x13')](function(_0x52c373){if(_0x52c373){return _0x52c373['removeWhatsappAccounts'](_0x590a40[_0x2097('0x3f')]['ids']);}})[_0x2097('0x13')](respondWithStatusCode(_0x5c6dd2,null))[_0x2097('0x1c')](handleError(_0x5c6dd2,null));};exports[_0x2097('0x152')]=function(_0x31a1ac,_0x4a868){var _0x2965fb={};var _0x4f2a7a={};var _0x1ff990;var _0x327198;return db['User']['findOne']({'where':{'id':_0x31a1ac['params']['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x4a868,null))[_0x2097('0x13')](function(_0x37f5d2){if(_0x37f5d2){_0x1ff990=_0x37f5d2;_0x4f2a7a['model']=_['keys'](db[_0x2097('0x153')]['rawAttributes']);_0x4f2a7a[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x31a1ac['query']);_0x4f2a7a['filters']=_[_0x2097('0xdb')](_0x4f2a7a[_0x2097('0x50')],_0x4f2a7a[_0x2097('0x3f')]);_0x2965fb[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x4f2a7a[_0x2097('0x50')],qs[_0x2097('0x52')](_0x31a1ac[_0x2097('0x3f')]['fields']));_0x2965fb['attributes']=_0x2965fb[_0x2097('0x42')][_0x2097('0x47')]?_0x2965fb[_0x2097('0x42')]:_0x4f2a7a[_0x2097('0x50')];_0x2965fb[_0x2097('0xd0')]=qs[_0x2097('0xd1')](_0x31a1ac[_0x2097('0x3f')]['sort']);_0x2965fb[_0x2097('0x3d')]=qs['filters'](_[_0x2097('0xd2')](_0x31a1ac[_0x2097('0x3f')],_0x4f2a7a['filters']));if(_0x31a1ac[_0x2097('0x3f')][_0x2097('0x2d')]){_0x2965fb[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x2965fb[_0x2097('0x3d')],{'$or':_['map'](_0x2965fb[_0x2097('0x42')],function(_0x2fe52a){var _0x2f3578={};_0x2f3578[_0x2fe52a]={'$like':'%'+_0x31a1ac[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x2f3578;})});}_0x2965fb=_[_0x2097('0x53')]({},_0x2965fb,_0x31a1ac[_0x2097('0xdc')]);return _0x1ff990[_0x2097('0x152')](_0x2965fb);}})[_0x2097('0x13')](function(_0xc9c29){if(_0xc9c29){_0x327198=_0xc9c29[_0x2097('0x47')];if(!_0x31a1ac[_0x2097('0x3f')]['hasOwnProperty'](_0x2097('0xd9'))){_0x2965fb[_0x2097('0x21')]=qs['limit'](_0x31a1ac[_0x2097('0x3f')][_0x2097('0x21')]);_0x2965fb[_0x2097('0x1f')]=qs['offset'](_0x31a1ac[_0x2097('0x3f')][_0x2097('0x1f')]);}return _0x1ff990[_0x2097('0x152')](_0x2965fb);}})[_0x2097('0x13')](function(_0x5929c1){if(_0x5929c1){return _0x5929c1?{'count':_0x327198,'rows':_0x5929c1}:null;}})[_0x2097('0x13')](respondWithResult(_0x4a868,null))[_0x2097('0x1c')](handleError(_0x4a868,null));};exports[_0x2097('0x154')]=function(_0x3b90ab,_0x7b61e6){return db['User'][_0x2097('0x32')]({'where':{'id':_0x3b90ab[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x7b61e6,null))[_0x2097('0x13')](function(_0x1a4fc5){if(_0x1a4fc5){return _0x1a4fc5[_0x2097('0x154')](_0x3b90ab[_0x2097('0x58')][_0x2097('0xa4')],_[_0x2097('0x5b')](_0x3b90ab[_0x2097('0x58')],['ids','id'])||{});}})[_0x2097('0x13')](respondWithResult(_0x7b61e6,null))['catch'](handleError(_0x7b61e6,null));};exports['removeSquareProjects']=function(_0x15271f,_0x5b803e){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x15271f[_0x2097('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b803e,null))[_0x2097('0x13')](function(_0x3f094a){if(_0x3f094a){return _0x3f094a[_0x2097('0x155')](_0x15271f[_0x2097('0x3f')][_0x2097('0xa4')]);}})[_0x2097('0x13')](respondWithStatusCode(_0x5b803e,null))['catch'](handleError(_0x5b803e,null));};exports['getScheduledCalls']=function(_0x555583,_0x788202){var _0x285bd3={},_0x13b0b4={},_0x2154a9={'count':0x0,'rows':[]};var _0x28c292=db[_0x2097('0x156')][_0x2097('0xce')];_0x13b0b4['model']=_[_0x2097('0x51')](_0x28c292);_0x13b0b4[_0x2097('0x3f')]=_[_0x2097('0x51')](_0x555583[_0x2097('0x3f')]);_0x13b0b4['filters']=_[_0x2097('0xdb')](_0x13b0b4['model'],_0x13b0b4['query']);_0x13b0b4[_0x2097('0xcf')]=_['concat'](_0x13b0b4['filters'],['$and','$or',_0x2097('0x157'),_0x2097('0x158'),_0x2097('0x159'),_0x2097('0x15a'),'$ne','$eq',_0x2097('0x15b'),'$between',_0x2097('0x15c'),_0x2097('0x15d'),_0x2097('0x15e'),'$like',_0x2097('0x15f'),_0x2097('0x160'),_0x2097('0x161'),_0x2097('0x162'),_0x2097('0x163'),_0x2097('0x164'),'$contained','$any']);_0x285bd3[_0x2097('0x42')]=_[_0x2097('0xdb')](_0x13b0b4['model'],qs['fields'](_0x555583[_0x2097('0x3f')][_0x2097('0x52')]));_0x285bd3['attributes']=_0x285bd3[_0x2097('0x42')][_0x2097('0x47')]?_0x285bd3[_0x2097('0x42')]:_0x13b0b4[_0x2097('0x50')];if(!_0x555583[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x285bd3[_0x2097('0x21')]=qs['limit'](_0x555583[_0x2097('0x3f')][_0x2097('0x21')]);_0x285bd3[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x555583[_0x2097('0x3f')][_0x2097('0x1f')]);}_0x285bd3[_0x2097('0xd0')]=qs['sort'](_0x555583['query']['sort']);_0x285bd3['where']=qs['filters'](_[_0x2097('0xd2')](_0x555583[_0x2097('0x3f')],_0x13b0b4['filters']));if(_0x555583[_0x2097('0x3f')][_0x2097('0x2d')]){_0x285bd3[_0x2097('0x3d')]=_[_0x2097('0x53')](_0x285bd3['where'],{'$or':_['map'](_0x285bd3[_0x2097('0x42')],function(_0x1d93bc){var _0x32d463={};_0x32d463[_0x1d93bc]={'$like':'%'+_0x555583[_0x2097('0x3f')][_0x2097('0x2d')]+'%'};return _0x32d463;})});}_0x285bd3[_0x2097('0x3d')]={'$and':[_0x285bd3['where'],{'$or':[{'UserId':_0x555583[_0x2097('0x4f')]['id']},{'OwnerId':_0x555583[_0x2097('0x4f')]['id']}]}]};_0x285bd3=_[_0x2097('0x53')]({},_0x285bd3,_0x555583[_0x2097('0xdc')]);var _0x4089af={'where':_0x285bd3['where']};return db[_0x2097('0x156')][_0x2097('0x22')](_0x4089af)[_0x2097('0x13')](function(_0x19f6ab){_0x2154a9[_0x2097('0x22')]=_0x19f6ab;if(_0x555583['query'][_0x2097('0x40')]){_0x285bd3['include']=[{'attributes':['id','firstName',_0x2097('0x165'),_0x2097('0xed')],'model':db[_0x2097('0x166')],'as':_0x2097('0x167')},{'attributes':['id',_0x2097('0x35'),_0x2097('0x168')],'model':db['VoiceQueue'],'as':_0x2097('0xda')}];}return db[_0x2097('0x156')]['findAll'](_0x285bd3);})[_0x2097('0x13')](function(_0x2e61fe){_0x2154a9[_0x2097('0x45')]=_0x2e61fe;return _0x2154a9;})[_0x2097('0x13')](respondWithFilteredResult(_0x788202,_0x285bd3))[_0x2097('0x1c')](handleError(_0x788202,null));};exports[_0x2097('0x169')]=function(_0x56d02d,_0x540b9d){if(!_[_0x2097('0x61')](_0x56d02d[_0x2097('0x2a')]['id'])&&(_0x56d02d[_0x2097('0x2a')][_0x2097('0x27')]==_0x2097('0x28')||_0x56d02d[_0x2097('0x2a')]['role']==_0x2097('0x2a'))){return db['User'][_0x2097('0xcd')]({'where':{'id':_0x56d02d[_0x2097('0x4f')]['id']},'raw':!![]})['then'](function(_0x433e37){return authService[_0x2097('0x16a')](_0x433e37);})['then'](function(_0x42cb3b){if(_0x42cb3b){return _0x540b9d[_0x2097('0x1d')](0xc8)[_0x2097('0x1e')]({'api_key':_0x42cb3b[_0x2097('0x16b')]});}else{return _0x540b9d[_0x2097('0x1d')](0xcc)['json']({'message':_0x2097('0x16c')});}})[_0x2097('0x1c')](handleError(_0x540b9d,0x193));}else{return _0x540b9d[_0x2097('0x1d')](0x191)[_0x2097('0x1e')]({'message':_0x2097('0x16d')});}};exports[_0x2097('0x16e')]=function(_0xea724f,_0x426a26){if(!_['isNil'](_0xea724f[_0x2097('0x2a')]['id'])&&(_0xea724f[_0x2097('0x2a')][_0x2097('0x27')]==_0x2097('0x28')||_0xea724f[_0x2097('0x2a')][_0x2097('0x27')]==_0x2097('0x2a'))){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0xea724f['params']['id']}})[_0x2097('0x13')](function(_0x414f13){return authService['generateApiKey'](_0x414f13);})[_0x2097('0x13')](function(_0x1d9162){return db[_0x2097('0x3e')][_0x2097('0x57')]({'apiKeyIat':_0x1d9162[_0x2097('0x16f')],'apiKeyNonce':_0x1d9162[_0x2097('0x170')]},{'where':{'id':_0xea724f[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](function(){return _0x426a26[_0x2097('0x1d')](0xc8)[_0x2097('0x1e')]({'api_key':_0x1d9162[_0x2097('0x16b')]});});})[_0x2097('0x1c')](handleError(_0x426a26,0x193));}else{return _0x426a26['status'](0x191)[_0x2097('0x1e')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x2097('0x171')]=function(_0x271669,_0x1604c4){if(!_[_0x2097('0x61')](_0x271669[_0x2097('0x2a')]['id'])&&(_0x271669[_0x2097('0x2a')][_0x2097('0x27')]==_0x2097('0x28')||_0x271669[_0x2097('0x2a')][_0x2097('0x27')]==_0x2097('0x2a'))){return db[_0x2097('0x3e')][_0x2097('0x32')]({'where':{'id':_0x271669[_0x2097('0x4f')]['id']}})[_0x2097('0x13')](handleEntityNotFound(_0x1604c4,null))['then'](function(_0x29c79b){if(_0x29c79b&&_0x29c79b[_0x2097('0x172')]&&_0x29c79b[_0x2097('0x173')])return _0x29c79b;else throw{'message':_0x2097('0x174')};})['then'](function(_0x80b239){return db[_0x2097('0x3e')][_0x2097('0x57')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x271669[_0x2097('0x4f')]['id']}});})['then'](respondWithStatusCode(_0x1604c4,0xc8))[_0x2097('0x1c')](handleError(_0x1604c4,0x193));}else{return _0x1604c4[_0x2097('0x1d')](0x191)[_0x2097('0x1e')]({'message':_0x2097('0x16d')});}};exports[_0x2097('0x175')]=function(_0x3582a6,_0x5c6be0){var _0x1093dc=_0x3582a6['user'][_0x2097('0x26')]({'plain':!![]});if(!_0x1093dc){return _0x5c6be0[_0x2097('0x1d')](0x191)['send'](_0x2097('0x176'));}else{return _0x5c6be0[_0x2097('0x1d')](0xc8)[_0x2097('0x1e')](_0x1093dc);}};exports['getPresence']=function(_0x58fcfc,_0x3dee2e){var _0x53db0b={'offset':0x0},_0x514be0={'count':0x0,'rows':[]};Promise[_0x2097('0x101')]()[_0x2097('0x13')](function(){if(!_0x58fcfc[_0x2097('0x3f')][_0x2097('0x2d')]&&!_0x58fcfc[_0x2097('0x3f')][_0x2097('0x177')]&&!_0x58fcfc[_0x2097('0x3f')]['queues'])return[];return Promise['resolve']()[_0x2097('0x13')](function(){var _0x4b9099=[];if(!_['isEmpty'](_0x58fcfc['query'][_0x2097('0x177')])){_0x4b9099[_0x2097('0x43')](db['Team']['findAll']({'attributes':['id','name'],'where':{'id':_0x58fcfc['query'][_0x2097('0x177')]}}));}if(!_[_0x2097('0x89')](_0x58fcfc[_0x2097('0x3f')][_0x2097('0x178')])){_0x4b9099['push'](db[_0x2097('0xaa')][_0x2097('0x44')]({'attributes':['id','name'],'type':_0x2097('0x179'),'where':{'id':_0x58fcfc['query'][_0x2097('0x178')]}}));}return Promise[_0x2097('0x56')](_0x4b9099);})[_0x2097('0x13')](function(_0x1d724d){var _0xec39da=_[_0x2097('0x117')](_0x1d724d)[_0x2097('0x2f')](function(_0x5d77ed){return _0x5d77ed[_0x2097('0x125')]({'attributes':['id',_0x2097('0x35'),_0x2097('0x5c'),_0x2097('0x9b')],'raw':!![]});});return Promise[_0x2097('0x56')](_0xec39da);})[_0x2097('0x13')](function(_0x1a8235){var _0x511eb5=_[_0x2097('0x117')](_0x1a8235);if(!_0x58fcfc[_0x2097('0x3f')][_0x2097('0x2d')])return _0x511eb5;if(_[_0x2097('0x89')](_0x511eb5)){return db['User'][_0x2097('0x44')]({'attributes':['id','name',_0x2097('0x5c'),_0x2097('0x9b')],'where':{'role':_0x2097('0x2b'),'$or':[db[_0x2097('0x64')]['where'](db[_0x2097('0x64')]['fn'](_0x2097('0x17a'),db[_0x2097('0x64')]['col']('name')),{'$like':'%'+_0x58fcfc['query'][_0x2097('0x2d')][_0x2097('0xa2')]()+'%'}),{'internal':{'$like':'%'+_0x58fcfc[_0x2097('0x3f')][_0x2097('0x2d')]+'%'}}]},'raw':!![]});}else{return _(_0x511eb5)[_0x2097('0x117')]()[_0x2097('0x2d')](function(_0xd93c3c){return _0xd93c3c[_0x2097('0x35')][_0x2097('0xa2')]()[_0x2097('0x31')](_0x58fcfc['query'][_0x2097('0x2d')][_0x2097('0xa2')]())||_0xd93c3c[_0x2097('0x5c')][_0x2097('0x17b')]()[_0x2097('0x31')](_0x58fcfc['query']['filter']);})['value']();}})[_0x2097('0x13')](function(_0x35185f){var _0x54857c=_0x2097('0x35');var _0xdf452b=_0x2097('0x17c');if(_0x58fcfc['query']['sort']){var _0xdf452b=_0x58fcfc['query']['sort'][0x0]==='-'?'desc':_0x2097('0x17c');var _0x54857c=_0xdf452b===_0x2097('0x17c')?_0x58fcfc['query']['sort']:_0x58fcfc[_0x2097('0x3f')][_0x2097('0xd1')][_0x2097('0x17d')](0x1);}return _(_0x35185f)['uniqBy']('id')[_0x2097('0x17e')]([function(_0x28e6a5){return _0x54857c===_0x2097('0x35')?_0x28e6a5[_0x54857c][_0x2097('0xa2')]():_0x28e6a5[_0x54857c];}],[_0xdf452b])[_0x2097('0x2f')](function(_0x156ec5){return _[_0x2097('0xd2')](_0x156ec5,['id',_0x2097('0x35'),'internal',_0x2097('0x9b')]);})[_0x2097('0x30')]();})[_0x2097('0x13')](function(_0x1246d2){return client[_0x2097('0x12')](_0x2097('0x80'),_0x58fcfc)[_0x2097('0x13')](function(_0x40fb63){if(_0x40fb63[_0x2097('0x19')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x4826fe=_0x40fb63[_0x2097('0x1b')];var _0x170bf6=jayson[_0x2097('0x10')][_0x2097('0x11')]({'port':0x232c});return _0x170bf6[_0x2097('0x12')](_0x2097('0x80'),_0x58fcfc)[_0x2097('0x13')](function(_0x17ae98){if(_0x17ae98[_0x2097('0x19')])throw new Error(_0x2097('0x17f'));var _0x2c7758=_0x17ae98[_0x2097('0x1b')];return _['merge']({},_0x2c7758,_0x4826fe);});})[_0x2097('0x13')](function(_0x5b3e57){return _['map'](_0x1246d2,function(_0x3ac09f){var _0x214e8c=_[_0x2097('0x32')](_0x5b3e57[_0x2097('0x45')],['id',_0x3ac09f['id']]);if(!_0x214e8c||!_0x3ac09f[_0x2097('0x9b')]){_0x3ac09f[_0x2097('0x1d')]='offline';}else if(_0x214e8c[_0x2097('0x9d')]){_0x3ac09f[_0x2097('0x1d')]=_0x2097('0x104');}else{_0x3ac09f[_0x2097('0x1d')]=_[_0x2097('0x31')]([_0x2097('0x180'),_0x2097('0x181'),_0x2097('0x182'),_0x2097('0x183'),null,undefined],_0x214e8c['voiceStatus'])?_0x2097('0x9b'):_0x2097('0x184');}return _0x3ac09f;});});});})[_0x2097('0x13')](function(_0x294f76){if(!_0x58fcfc[_0x2097('0x3f')][_0x2097('0xd3')](_0x2097('0xd9'))){_0x53db0b['limit']=qs['limit'](_0x58fcfc[_0x2097('0x3f')][_0x2097('0x21')]||0xa);_0x53db0b[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x58fcfc['query']['offset']);}_0x514be0[_0x2097('0x22')]=_0x294f76[_0x2097('0x47')];_0x514be0[_0x2097('0x45')]=_0x53db0b['limit']?_0x294f76[_0x2097('0x185')](_0x53db0b[_0x2097('0x1f')],_0x53db0b[_0x2097('0x1f')]+_0x53db0b[_0x2097('0x21')]):_0x294f76;return _0x514be0;})[_0x2097('0x13')](respondWithFilteredResult(_0x3dee2e,_0x53db0b))[_0x2097('0x1c')](handleError(_0x3dee2e,null));};function get_open_tabs(_0x5c7494,_0x229235){var _0x7e1559=_0x5c7494[_0x2097('0x186')](0x0)['toUpperCase']()+_0x5c7494[_0x2097('0x185')](0x1);var _0x5c5fc4={'type':db['Sequelize'][_0x2097('0x65')]['SELECT'],'raw':!![]};return new BPromise(function(_0x42e470,_0x3ba083){var _0x4e4ef0=squel[_0x2097('0x187')]()[_0x2097('0x188')](_0x2097('0x189')+_0x7e1559+_0x2097('0x18a'),'id')[_0x2097('0x188')]('ui.createdAt')[_0x2097('0x67')](_0x2097('0x18b')+_0x5c7494+'_interactions','ui')[_0x2097('0x3d')](_0x2097('0x18c'),_0x229235['id']);return db['sequelize'][_0x2097('0x3f')](_0x4e4ef0['toString'](),_0x5c5fc4)[_0x2097('0x13')](function(_0x2cddd3){_0x229235[_0x7e1559+_0x2097('0x18d')]=_0x2cddd3;_0x42e470(_0x2cddd3);})[_0x2097('0x1c')](function(_0x1c9f71){_0x3ba083(_0x1c9f71);});});};
\ No newline at end of file
index 16d1b46..783a548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c0=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2b1436,_0x3a0a8a){var _0x1ae47=function(_0x508df3){while(--_0x508df3){_0x2b1436['push'](_0x2b1436['shift']());}};_0x1ae47(++_0x3a0a8a);}(_0x89c0,0x1cd));var _0x089c=function(_0x1f6896,_0x31a122){_0x1f6896=_0x1f6896-0x0;var _0x348ba5=_0x89c0[_0x1f6896];return _0x348ba5;};'use strict';var EventEmitter=require(_0x089c('0x0'));var User=require(_0x089c('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x089c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x089c('0x3'),'afterDestroy':_0x089c('0x4')};function emitEvent(_0x3f1e46){return function(_0x2253ce,_0x3c33be,_0x31257f){UserEvents[_0x089c('0x5')](_0x3f1e46+':'+_0x2253ce['id'],_0x2253ce);UserEvents[_0x089c('0x5')](_0x3f1e46,_0x2253ce);_0x31257f(null);};}for(var e in events){if(events[_0x089c('0x6')](e)){var event=events[e];User[_0x089c('0x7')](e,emitEvent(event));}}module[_0x089c('0x8')]=UserEvents;
\ No newline at end of file
+var _0x7ff1=['remove','hasOwnProperty','events','../../mysqldb','save','update'];(function(_0x243ea0,_0x34e738){var _0x244951=function(_0x238f51){while(--_0x238f51){_0x243ea0['push'](_0x243ea0['shift']());}};_0x244951(++_0x34e738);}(_0x7ff1,0x152));var _0x17ff=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x7ff1[_0x4fc421];return _0x8c6d63;};'use strict';var EventEmitter=require(_0x17ff('0x0'));var User=require(_0x17ff('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17ff('0x2'),'afterUpdate':_0x17ff('0x3'),'afterDestroy':_0x17ff('0x4')};function emitEvent(_0x254bd4){return function(_0x29d2ad,_0x217928,_0x23aced){UserEvents['emit'](_0x254bd4+':'+_0x29d2ad['id'],_0x29d2ad);UserEvents['emit'](_0x254bd4,_0x29d2ad);_0x23aced(null);};}for(var e in events){if(events[_0x17ff('0x5')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
index 23c906e..511c305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf836=['md5secret',':asterisk:','bluebird','crypto','md5','./user.attributes','google','length','from-sip','system','format','%s%s','prefix','push','Set','CDR(type)=%s','chanspy','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','record','wav','gsm','context','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','defaults','internal','concat','exports','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','find','then','privacyEnabled','updateMd5Password','changed','UserProfile','password','updatePassword','catch','VoiceExtension','bulkCreate','destroy','encryptPassword','function','randomBytes','toString','salt','base64','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password'];(function(_0x1d6fa5,_0x59b77f){var _0x21a279=function(_0x33e203){while(--_0x33e203){_0x1d6fa5['push'](_0x1d6fa5['shift']());}};_0x21a279(++_0x59b77f);}(_0xf836,0x126));var _0x6f83=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf836[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x6f83('0x0'));var crypto=require(_0x6f83('0x1'));var util=require('util');var md5=require(_0x6f83('0x2'));var _=require('lodash');var attributes=require(_0x6f83('0x3'));var authTypes=[_0x6f83('0x4')];var validatePresenceOf=function(_0xfea557){return _0xfea557&&_0xfea557[_0x6f83('0x5')];};var getChanSpyApplications=function(_0x3955bc,_0x3f20d7,_0x39bcec){var _0x4d1d04={'context':_0x3955bc['context']||_0x6f83('0x6'),'type':_0x6f83('0x7'),'isApp':![],'UserId':_0x3955bc['id']};var _0x3f1c95=[];for(var _0x313b72=0x0,_0x55df23=0x1;_0x313b72<_0x39bcec[_0x6f83('0x5')];_0x313b72++,_0x55df23=0x1){var _0xfbc197={'exten':util[_0x6f83('0x8')](_0x6f83('0x9'),_0x39bcec[_0x313b72][_0x6f83('0xa')],_0x3f20d7),'ChanSpyId':_0x39bcec[_0x313b72]['id']};_0x3f1c95[_0x6f83('0xb')](_['merge']({'app':_0x6f83('0xc'),'appdata':util[_0x6f83('0x8')](_0x6f83('0xd'),_0x6f83('0xe')),'priority':_0x55df23++},_0x4d1d04,_0xfbc197));if(_0x39bcec[_0x313b72]['record']){_0x3f1c95[_0x6f83('0xb')](_[_0x6f83('0xf')]({'app':_0x6f83('0x10'),'appdata':util['format'](_0x6f83('0x11'),_0x39bcec[_0x313b72][_0x6f83('0x12')]),'priority':_0x55df23++},_0x4d1d04,_0xfbc197));}if(_0x39bcec[_0x313b72][_0x6f83('0x13')]){_0x3f1c95[_0x6f83('0xb')](_['merge']({'app':_0x6f83('0x14'),'appdata':_0x39bcec[_0x313b72]['password'],'priority':_0x55df23++},_0x4d1d04,_0xfbc197));}_0x3f1c95[_0x6f83('0xb')](_[_0x6f83('0xf')]({'app':_0x6f83('0x15'),'appdata':util['format'](_0x6f83('0x16'),_0x3955bc[_0x6f83('0x17')],_0x39bcec[_0x313b72][_0x6f83('0x18')]?_0x39bcec[_0x313b72][_0x6f83('0x18')]['join'](''):''),'priority':_0x55df23++},_0x4d1d04,_0xfbc197));if(_0x39bcec[_0x313b72][_0x6f83('0x19')]){_0x3f1c95['push'](_['merge']({'app':'StopMixMonitor','priority':_0x55df23++},_0x4d1d04,_0xfbc197));}}return _0x3f1c95;};var getUserApplications=function(_0x4b9c07,_0x30094a){var _0x5141a9=[_0x6f83('0x1a'),'WAV',_0x6f83('0x1b')];var _0x1198cc={'context':_0x4b9c07[_0x6f83('0x1c')]||_0x6f83('0x6'),'exten':_0x30094a,'type':'system','isApp':![],'UserId':_0x4b9c07['id']};var _0x350657=[{'app':_0x6f83('0xc'),'appdata':_0x6f83('0x1d')}];if(_0x4b9c07[_0x6f83('0x1e')]&&_['includes'](_0x5141a9,_0x4b9c07[_0x6f83('0x1e')])){_0x350657['push']({'app':_0x6f83('0xc'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x350657[_0x6f83('0xb')]({'app':'Set','appdata':util[_0x6f83('0x8')](_0x6f83('0x1f'),_0x4b9c07[_0x6f83('0x1e')])});_0x350657[_0x6f83('0xb')]({'app':_0x6f83('0x20'),'appdata':util[_0x6f83('0x8')](_0x6f83('0x21'),_0x4b9c07[_0x6f83('0x17')])});}else{_0x350657[_0x6f83('0xb')]({'app':_0x6f83('0x20'),'appdata':util[_0x6f83('0x8')]('SIP/%s,,tTxX',_0x4b9c07[_0x6f83('0x17')])});}_0x350657[_0x6f83('0xb')]({'app':_0x6f83('0x22')});for(var _0x21d177=0x0;_0x21d177<_0x350657[_0x6f83('0x5')];_0x21d177++){_0x350657[_0x21d177][_0x6f83('0x23')]=_0x21d177+0x1;_0x350657[_0x21d177]=_[_0x6f83('0x24')](_0x350657[_0x21d177],_0x1198cc);}return _0x350657;};var getChanSpyPromise=function(_0x30059e,_0x4e13f7){return new BPromise(function(_0x473849,_0x41f017){return _0x30059e['VoiceChanSpy']['findAll']()['then'](function(_0x3bc232){if(_0x3bc232){var _0x225ac7=getChanSpyApplications(_0x4e13f7,_0x4e13f7[_0x6f83('0x25')],_0x3bc232);if(_0x4e13f7[_0x6f83('0x25')]!=_0x4e13f7[_0x6f83('0x17')]){_0x225ac7=_0x225ac7[_0x6f83('0x26')](getChanSpyApplications(_0x4e13f7,_0x4e13f7['name'],_0x3bc232));}return _0x473849(_0x225ac7);}return _0x473849([]);})['catch'](function(_0x174071){_0x41f017(_0x174071);});});};module[_0x6f83('0x27')]=function(_0x1c0545,_0x1c89e7){var _0x10e319=_0x1c0545['models'];return _0x1c0545['define'](_0x6f83('0x28'),attributes,{'tableName':_0x6f83('0x29'),'charset':_0x6f83('0x2a'),'collate':_0x6f83('0x2b'),'hooks':{'beforeCreate':function(_0x5bdf06,_0x323591,_0x2c2824){var _0x3c4294=typeof _0x5bdf06[_0x6f83('0x2c')]===_0x6f83('0x2d')?BPromise[_0x6f83('0x2e')](null):_0x10e319['UserProfile'][_0x6f83('0x2f')]({'where':{'id':_0x5bdf06['userProfileId']}});_0x3c4294[_0x6f83('0x30')](function(_0x3392ba){if(_0x3392ba){_0x5bdf06[_0x6f83('0x31')]=_0x3392ba[_0x6f83('0x31')];}})[_0x6f83('0x30')](function(){_0x5bdf06[_0x6f83('0x32')]();_0x5bdf06['updatePassword'](_0x2c2824);})['catch'](function(_0x5294e1){_0x2c2824(_0x5294e1);});},'beforeUpdate':function(_0x41b41e,_0x566ea8,_0x8103e1){Promise['resolve']()[_0x6f83('0x30')](function(){if(_0x41b41e[_0x6f83('0x33')]('userProfileId')===![])return;return _0x10e319[_0x6f83('0x34')][_0x6f83('0x2f')]({'where':{'id':_0x41b41e['userProfileId']}})[_0x6f83('0x30')](function(_0x312cd3){if(_0x312cd3)_0x41b41e[_0x6f83('0x31')]=_0x312cd3[_0x6f83('0x31')];return;});})[_0x6f83('0x30')](function(){if(_0x41b41e[_0x6f83('0x33')](_0x6f83('0x35'))){_0x41b41e[_0x6f83('0x32')]();return _0x41b41e[_0x6f83('0x36')](_0x8103e1);}_0x8103e1();})[_0x6f83('0x37')](function(_0x14d387){_0x8103e1(_0x14d387);});},'afterCreate':function(_0xbd406c,_0x3abe90,_0x2561ac){var _0x25cf00=getUserApplications(_0xbd406c,_0xbd406c[_0x6f83('0x25')]);if(_0xbd406c[_0x6f83('0x25')]!=_0xbd406c['name']){_0x25cf00=_0x25cf00[_0x6f83('0x26')](getUserApplications(_0xbd406c,_0xbd406c['name']));}return _0x10e319[_0x6f83('0x38')][_0x6f83('0x39')](_0x25cf00)[_0x6f83('0x30')](function(){if(_0xbd406c[_0x6f83('0xe')]){return getChanSpyPromise(_0x10e319,_0xbd406c);}})['then'](function(_0x291ef8){if(_0x291ef8&&_0x291ef8['length']){return _0x10e319[_0x6f83('0x38')]['bulkCreate'](_0x291ef8);}})['then'](function(){_0x2561ac();})[_0x6f83('0x37')](function(_0x22f333){_0x2561ac(_0x22f333);});},'afterUpdate':function(_0x17b715,_0x339465,_0x2686e2){return BPromise[_0x6f83('0x2e')]()[_0x6f83('0x30')](function(){if(_0x17b715[_0x6f83('0x33')](_0x6f83('0xe'))||_0x17b715['changed']('context')){return _0x10e319[_0x6f83('0x38')][_0x6f83('0x3a')]({'where':{'UserId':_0x17b715['id'],'type':_0x6f83('0x7'),'ChanSpyId':{'$ne':null}}})[_0x6f83('0x30')](function(){if(_0x17b715['chanspy']){return getChanSpyPromise(_0x10e319,_0x17b715)[_0x6f83('0x30')](function(_0x54ceef){if(_0x54ceef&&_0x54ceef[_0x6f83('0x5')]){return _0x10e319[_0x6f83('0x38')][_0x6f83('0x39')](_0x54ceef);}});}});}})[_0x6f83('0x30')](function(){if(_0x17b715[_0x6f83('0x33')]('extensionMonitor')||_0x17b715['changed']('context')){return _0x10e319[_0x6f83('0x38')][_0x6f83('0x3a')]({'where':{'UserId':_0x17b715['id'],'type':'system','ChanSpyId':null}})[_0x6f83('0x30')](function(){var _0xc5c69f=getUserApplications(_0x17b715,_0x17b715[_0x6f83('0x25')]);if(_0x17b715[_0x6f83('0x25')]!=_0x17b715[_0x6f83('0x17')]){_0xc5c69f=_0xc5c69f[_0x6f83('0x26')](getUserApplications(_0x17b715,_0x17b715[_0x6f83('0x17')]));}return _0x10e319[_0x6f83('0x38')]['bulkCreate'](_0xc5c69f);});}})['then'](function(){_0x2686e2();})[_0x6f83('0x37')](function(_0x55d884){_0x2686e2(_0x55d884);});},'afterDestroy':function(_0xc4c95f,_0x3dc188){return _0x10e319[_0x6f83('0x38')][_0x6f83('0x3a')]({'where':{'UserId':_0xc4c95f['id'],'type':_0x6f83('0x7')}});}},'instanceMethods':{'authenticate':function(_0x58efb3,_0x4cb3e8){if(!_0x4cb3e8){return this[_0x6f83('0x35')]===this[_0x6f83('0x3b')](_0x58efb3);}var _0x4726db=this;this[_0x6f83('0x3b')](_0x58efb3,function(_0x258dbd,_0x2d2be6){if(_0x258dbd){_0x4cb3e8(_0x258dbd);}if(_0x4726db[_0x6f83('0x35')]===_0x2d2be6){_0x4cb3e8(null,!![]);}else{_0x4cb3e8(null,![]);}});},'makeSalt':function(_0x3ed1a3,_0x306388){var _0x3bddd5=0x10;if(typeof arguments[0x0]===_0x6f83('0x3c')){_0x306388=arguments[0x0];_0x3ed1a3=_0x3bddd5;}else if(typeof arguments[0x1]===_0x6f83('0x3c')){_0x306388=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x3ed1a3){_0x3ed1a3=_0x3bddd5;}return crypto[_0x6f83('0x3d')](_0x3ed1a3,function(_0x3c406f,_0x2fc0c7){if(_0x3c406f){_0x306388(_0x3c406f);}return _0x306388(null,_0x2fc0c7[_0x6f83('0x3e')]('base64'));});},'encryptPassword':function(_0x132e6a,_0x83f1ce){if(!_0x132e6a||!this[_0x6f83('0x3f')]){return _0x83f1ce?_0x83f1ce(null):null;}var _0x171aae=0x2710;var _0x49a6ad=0x40;var _0x18cb02=new Buffer(this[_0x6f83('0x3f')],_0x6f83('0x40'));if(!_0x83f1ce){return crypto[_0x6f83('0x41')](_0x132e6a,_0x18cb02,_0x171aae,_0x49a6ad,_0x6f83('0x42'))[_0x6f83('0x3e')](_0x6f83('0x40'));}return crypto[_0x6f83('0x43')](_0x132e6a,_0x18cb02,_0x171aae,_0x49a6ad,_0x6f83('0x42'),function(_0x2609ca,_0xf2178b){if(_0x2609ca){_0x83f1ce(_0x2609ca);}return _0x83f1ce(null,_0xf2178b['toString'](_0x6f83('0x40')));});},'updatePassword':function(_0x4f85f9){if(!this[_0x6f83('0x35')]){return _0x4f85f9(null);}if(!validatePresenceOf(this[_0x6f83('0x35')])&&authTypes[_0x6f83('0x44')](this[_0x6f83('0x45')])===-0x1){_0x4f85f9(new Error(_0x6f83('0x46')));}var _0x272211=this;this['makeSalt'](function(_0x35f51c,_0xa23e46){if(_0x35f51c){return _0x4f85f9(_0x35f51c);}_0x272211[_0x6f83('0x3f')]=_0xa23e46;_0x272211[_0x6f83('0x3b')](_0x272211[_0x6f83('0x35')],function(_0x538bf2,_0x49c705){if(_0x538bf2){_0x4f85f9(_0x538bf2);}_0x272211[_0x6f83('0x35')]=_0x49c705;_0x4f85f9(null);});});},'updateMd5Password':function(){this[_0x6f83('0x47')]=md5(this[_0x6f83('0x17')]+_0x6f83('0x48')+this[_0x6f83('0x35')]);return this['md5secret'];}}});};
\ No newline at end of file
+var _0x4133=['define','User','users','utf8_bin','userProfileId','undefined','resolve','UserProfile','privacyEnabled','updateMd5Password','find','changed','updatePassword','VoiceExtension','bulkCreate','destroy','function','Missing\x20Callback','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','encryptPassword','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','length','context','from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','WAV','gsm','system','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','concat','catch','models'];(function(_0x3bf94a,_0x5dfc14){var _0x59d3b9=function(_0x59ebd5){while(--_0x59ebd5){_0x3bf94a['push'](_0x3bf94a['shift']());}};_0x59d3b9(++_0x5dfc14);}(_0x4133,0x14d));var _0x3413=function(_0x93e980,_0x36bd03){_0x93e980=_0x93e980-0x0;var _0x135a01=_0x4133[_0x93e980];return _0x135a01;};'use strict';var BPromise=require(_0x3413('0x0'));var crypto=require(_0x3413('0x1'));var util=require(_0x3413('0x2'));var md5=require(_0x3413('0x3'));var _=require(_0x3413('0x4'));var attributes=require(_0x3413('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x2cf6ff){return _0x2cf6ff&&_0x2cf6ff[_0x3413('0x6')];};var getChanSpyApplications=function(_0x343ce6,_0x5d5d10,_0x428902){var _0x561303={'context':_0x343ce6[_0x3413('0x7')]||_0x3413('0x8'),'type':'system','isApp':![],'UserId':_0x343ce6['id']};var _0x7e795b=[];for(var _0x4c4c56=0x0,_0x273647=0x1;_0x4c4c56<_0x428902[_0x3413('0x6')];_0x4c4c56++,_0x273647=0x1){var _0x4e18db={'exten':util[_0x3413('0x9')](_0x3413('0xa'),_0x428902[_0x4c4c56][_0x3413('0xb')],_0x5d5d10),'ChanSpyId':_0x428902[_0x4c4c56]['id']};_0x7e795b[_0x3413('0xc')](_[_0x3413('0xd')]({'app':_0x3413('0xe'),'appdata':util[_0x3413('0x9')](_0x3413('0xf'),_0x3413('0x10')),'priority':_0x273647++},_0x561303,_0x4e18db));if(_0x428902[_0x4c4c56][_0x3413('0x11')]){_0x7e795b[_0x3413('0xc')](_[_0x3413('0xd')]({'app':_0x3413('0x12'),'appdata':util[_0x3413('0x9')](_0x3413('0x13'),_0x428902[_0x4c4c56][_0x3413('0x14')]),'priority':_0x273647++},_0x561303,_0x4e18db));}if(_0x428902[_0x4c4c56]['auth']){_0x7e795b[_0x3413('0xc')](_[_0x3413('0xd')]({'app':_0x3413('0x15'),'appdata':_0x428902[_0x4c4c56][_0x3413('0x16')],'priority':_0x273647++},_0x561303,_0x4e18db));}_0x7e795b['push'](_['merge']({'app':_0x3413('0x17'),'appdata':util[_0x3413('0x9')](_0x3413('0x18'),_0x343ce6[_0x3413('0x19')],_0x428902[_0x4c4c56][_0x3413('0x1a')]?_0x428902[_0x4c4c56]['options'][_0x3413('0x1b')](''):''),'priority':_0x273647++},_0x561303,_0x4e18db));if(_0x428902[_0x4c4c56][_0x3413('0x11')]){_0x7e795b[_0x3413('0xc')](_['merge']({'app':'StopMixMonitor','priority':_0x273647++},_0x561303,_0x4e18db));}}return _0x7e795b;};var getUserApplications=function(_0x682dad,_0x559a59){var _0x2855f9=['wav',_0x3413('0x1c'),_0x3413('0x1d')];var _0x224fd6={'context':_0x682dad[_0x3413('0x7')]||_0x3413('0x8'),'exten':_0x559a59,'type':_0x3413('0x1e'),'isApp':![],'UserId':_0x682dad['id']};var _0x3b2ebd=[{'app':_0x3413('0xe'),'appdata':_0x3413('0x1f')}];if(_0x682dad[_0x3413('0x20')]&&_[_0x3413('0x21')](_0x2855f9,_0x682dad[_0x3413('0x20')])){_0x3b2ebd[_0x3413('0xc')]({'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x3b2ebd[_0x3413('0xc')]({'app':_0x3413('0xe'),'appdata':util[_0x3413('0x9')](_0x3413('0x22'),_0x682dad['extensionMonitor'])});_0x3b2ebd[_0x3413('0xc')]({'app':_0x3413('0x23'),'appdata':util[_0x3413('0x9')](_0x3413('0x24'),_0x682dad['name'])});}else{_0x3b2ebd[_0x3413('0xc')]({'app':'Dial','appdata':util[_0x3413('0x9')](_0x3413('0x25'),_0x682dad['name'])});}_0x3b2ebd[_0x3413('0xc')]({'app':_0x3413('0x26')});for(var _0x819289=0x0;_0x819289<_0x3b2ebd[_0x3413('0x6')];_0x819289++){_0x3b2ebd[_0x819289][_0x3413('0x27')]=_0x819289+0x1;_0x3b2ebd[_0x819289]=_[_0x3413('0x28')](_0x3b2ebd[_0x819289],_0x224fd6);}return _0x3b2ebd;};var getChanSpyPromise=function(_0x24d0fe,_0x180f95){return new BPromise(function(_0x16d99c,_0x5ced8c){return _0x24d0fe[_0x3413('0x29')]['findAll']()[_0x3413('0x2a')](function(_0x12719f){if(_0x12719f){var _0x1400bb=getChanSpyApplications(_0x180f95,_0x180f95['internal'],_0x12719f);if(_0x180f95[_0x3413('0x2b')]!=_0x180f95[_0x3413('0x19')]){_0x1400bb=_0x1400bb[_0x3413('0x2c')](getChanSpyApplications(_0x180f95,_0x180f95['name'],_0x12719f));}return _0x16d99c(_0x1400bb);}return _0x16d99c([]);})[_0x3413('0x2d')](function(_0x159f3f){_0x5ced8c(_0x159f3f);});});};module['exports']=function(_0x25b819,_0x40f1c7){var _0x119eb6=_0x25b819[_0x3413('0x2e')];return _0x25b819[_0x3413('0x2f')](_0x3413('0x30'),attributes,{'tableName':_0x3413('0x31'),'charset':'utf8','collate':_0x3413('0x32'),'hooks':{'beforeCreate':function(_0x2c11bb,_0x588825,_0x3edcbc){var _0x2b3ca2=typeof _0x2c11bb[_0x3413('0x33')]===_0x3413('0x34')?BPromise[_0x3413('0x35')](null):_0x119eb6[_0x3413('0x36')]['find']({'where':{'id':_0x2c11bb[_0x3413('0x33')]}});_0x2b3ca2[_0x3413('0x2a')](function(_0x5c3155){if(_0x5c3155){_0x2c11bb[_0x3413('0x37')]=_0x5c3155[_0x3413('0x37')];}})[_0x3413('0x2a')](function(){_0x2c11bb[_0x3413('0x38')]();_0x2c11bb['updatePassword'](_0x3edcbc);})[_0x3413('0x2d')](function(_0x5ac16c){_0x3edcbc(_0x5ac16c);});},'beforeUpdate':function(_0x45a459,_0x251790,_0x28d668){Promise[_0x3413('0x35')]()[_0x3413('0x2a')](function(){if(_0x45a459['changed'](_0x3413('0x33'))===![])return;return _0x119eb6['UserProfile'][_0x3413('0x39')]({'where':{'id':_0x45a459[_0x3413('0x33')]}})[_0x3413('0x2a')](function(_0x3da044){if(_0x3da044)_0x45a459[_0x3413('0x37')]=_0x3da044[_0x3413('0x37')];return;});})['then'](function(){if(_0x45a459[_0x3413('0x3a')](_0x3413('0x16'))){_0x45a459[_0x3413('0x38')]();return _0x45a459[_0x3413('0x3b')](_0x28d668);}_0x28d668();})[_0x3413('0x2d')](function(_0x4b8786){_0x28d668(_0x4b8786);});},'afterCreate':function(_0x4993e6,_0x8f210f,_0x1293cf){var _0x52be73=getUserApplications(_0x4993e6,_0x4993e6[_0x3413('0x2b')]);if(_0x4993e6[_0x3413('0x2b')]!=_0x4993e6[_0x3413('0x19')]){_0x52be73=_0x52be73[_0x3413('0x2c')](getUserApplications(_0x4993e6,_0x4993e6[_0x3413('0x19')]));}return _0x119eb6[_0x3413('0x3c')][_0x3413('0x3d')](_0x52be73)[_0x3413('0x2a')](function(){if(_0x4993e6[_0x3413('0x10')]){return getChanSpyPromise(_0x119eb6,_0x4993e6);}})['then'](function(_0x16065d){if(_0x16065d&&_0x16065d[_0x3413('0x6')]){return _0x119eb6[_0x3413('0x3c')][_0x3413('0x3d')](_0x16065d);}})[_0x3413('0x2a')](function(){_0x1293cf();})['catch'](function(_0xff174f){_0x1293cf(_0xff174f);});},'afterUpdate':function(_0x1dd6b1,_0x5a9d7f,_0x55e606){return BPromise[_0x3413('0x35')]()['then'](function(){if(_0x1dd6b1[_0x3413('0x3a')]('chanspy')||_0x1dd6b1[_0x3413('0x3a')](_0x3413('0x7'))){return _0x119eb6[_0x3413('0x3c')][_0x3413('0x3e')]({'where':{'UserId':_0x1dd6b1['id'],'type':_0x3413('0x1e'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x1dd6b1['chanspy']){return getChanSpyPromise(_0x119eb6,_0x1dd6b1)['then'](function(_0x4d6bb5){if(_0x4d6bb5&&_0x4d6bb5[_0x3413('0x6')]){return _0x119eb6[_0x3413('0x3c')][_0x3413('0x3d')](_0x4d6bb5);}});}});}})[_0x3413('0x2a')](function(){if(_0x1dd6b1['changed'](_0x3413('0x20'))||_0x1dd6b1[_0x3413('0x3a')](_0x3413('0x7'))){return _0x119eb6['VoiceExtension']['destroy']({'where':{'UserId':_0x1dd6b1['id'],'type':_0x3413('0x1e'),'ChanSpyId':null}})[_0x3413('0x2a')](function(){var _0x3b5575=getUserApplications(_0x1dd6b1,_0x1dd6b1[_0x3413('0x2b')]);if(_0x1dd6b1[_0x3413('0x2b')]!=_0x1dd6b1['name']){_0x3b5575=_0x3b5575['concat'](getUserApplications(_0x1dd6b1,_0x1dd6b1['name']));}return _0x119eb6['VoiceExtension'][_0x3413('0x3d')](_0x3b5575);});}})['then'](function(){_0x55e606();})['catch'](function(_0x26528b){_0x55e606(_0x26528b);});},'afterDestroy':function(_0x1c9953,_0x2d2c34){return _0x119eb6[_0x3413('0x3c')][_0x3413('0x3e')]({'where':{'UserId':_0x1c9953['id'],'type':_0x3413('0x1e')}});}},'instanceMethods':{'authenticate':function(_0x2db6f7,_0x1241a2){if(!_0x1241a2){return this[_0x3413('0x16')]===this['encryptPassword'](_0x2db6f7);}var _0x37550d=this;this['encryptPassword'](_0x2db6f7,function(_0x262d20,_0x11f1f9){if(_0x262d20){_0x1241a2(_0x262d20);}if(_0x37550d['password']===_0x11f1f9){_0x1241a2(null,!![]);}else{_0x1241a2(null,![]);}});},'makeSalt':function(_0x571dc9,_0x3a1fc8){var _0x959d26=0x10;if(typeof arguments[0x0]===_0x3413('0x3f')){_0x3a1fc8=arguments[0x0];_0x571dc9=_0x959d26;}else if(typeof arguments[0x1]===_0x3413('0x3f')){_0x3a1fc8=arguments[0x1];}else{throw new Error(_0x3413('0x40'));}if(!_0x571dc9){_0x571dc9=_0x959d26;}return crypto['randomBytes'](_0x571dc9,function(_0x335f76,_0x4ee8a2){if(_0x335f76){_0x3a1fc8(_0x335f76);}return _0x3a1fc8(null,_0x4ee8a2['toString'](_0x3413('0x41')));});},'encryptPassword':function(_0x3bfe13,_0x28f790){if(!_0x3bfe13||!this[_0x3413('0x42')]){return _0x28f790?_0x28f790(null):null;}var _0x246686=0x2710;var _0x504ea5=0x40;var _0x2df180=new Buffer(this[_0x3413('0x42')],_0x3413('0x41'));if(!_0x28f790){return crypto[_0x3413('0x43')](_0x3bfe13,_0x2df180,_0x246686,_0x504ea5,_0x3413('0x44'))['toString']('base64');}return crypto[_0x3413('0x45')](_0x3bfe13,_0x2df180,_0x246686,_0x504ea5,'sha1',function(_0x1dd727,_0x5ae629){if(_0x1dd727){_0x28f790(_0x1dd727);}return _0x28f790(null,_0x5ae629['toString']('base64'));});},'updatePassword':function(_0x3b7fc7){if(!this[_0x3413('0x16')]){return _0x3b7fc7(null);}if(!validatePresenceOf(this[_0x3413('0x16')])&&authTypes[_0x3413('0x46')](this['provider'])===-0x1){_0x3b7fc7(new Error(_0x3413('0x47')));}var _0x386ba5=this;this[_0x3413('0x48')](function(_0x54e8f5,_0x54b129){if(_0x54e8f5){return _0x3b7fc7(_0x54e8f5);}_0x386ba5[_0x3413('0x42')]=_0x54b129;_0x386ba5[_0x3413('0x49')](_0x386ba5[_0x3413('0x16')],function(_0x3b1bc4,_0x4d1681){if(_0x3b1bc4){_0x3b7fc7(_0x3b1bc4);}_0x386ba5[_0x3413('0x16')]=_0x4d1681;_0x3b7fc7(null);});});},'updateMd5Password':function(){this[_0x3413('0x4a')]=md5(this[_0x3413('0x19')]+_0x3413('0x4b')+this[_0x3413('0x16')]);return this['md5secret'];}}});};
\ No newline at end of file
index c71e3ce..0ce909b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x288e=['all','LogoutUser','findOne','destroy','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','loginInPause','bulkCreate','concat','LOGININPAUSE','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./user.socket','register','request','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetUser','User','findAll','options','where','attributes','include','map','model','then','ShowUser','find','raw','PauseUser','name','role','internal','UserVoiceQueueRt','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','isNil','interface','SIP/%s','format','type','body','uniqueid','update','DEFAULT\x20PAUSE','UnpauseUser','channel','Unknown\x20channel','voice','system','chat','sms','openchannel','set','%s%s','forEach','push'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x288e,0xd1));var _0xe288=function(_0x5eec8f,_0x386e7d){_0x5eec8f=_0x5eec8f-0x0;var _0x5ac0aa=_0x288e[_0x5eec8f];return _0x5ac0aa;};'use strict';var _=require(_0xe288('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe288('0x1'));var rs=require(_0xe288('0x2'));var fs=require('fs');var Redis=require(_0xe288('0x3'));var db=require(_0xe288('0x4'))['db'];var utils=require(_0xe288('0x5'));var logger=require(_0xe288('0x6'))(_0xe288('0x7'));var config=require('../../config/environment');var jayson=require(_0xe288('0x8'));var client=jayson[_0xe288('0x9')][_0xe288('0xa')]({'port':0x232a});config[_0xe288('0xb')]=_[_0xe288('0xc')](config[_0xe288('0xb')],{'host':_0xe288('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe288('0xb')]));require(_0xe288('0xe'))[_0xe288('0xf')](socket);function respondWithRpcPromise(_0x482f8a,_0x35573a,_0xd56611){return new BPromise(function(_0x31e6e1,_0x26a3fa){return client[_0xe288('0x10')](_0x482f8a,_0xd56611)['then'](function(_0x1101fb){logger['info'](_0xe288('0x11'),_0x35573a,'request\x20sent');logger[_0xe288('0x12')](_0xe288('0x13'),_0x35573a,_0xe288('0x14'),JSON[_0xe288('0x15')](_0x1101fb));if(_0x1101fb[_0xe288('0x16')]){if(_0x1101fb[_0xe288('0x16')][_0xe288('0x17')]===0x1f4){logger['error'](_0xe288('0x11'),_0x35573a,_0x1101fb[_0xe288('0x16')][_0xe288('0x18')]);return _0x26a3fa(_0x1101fb[_0xe288('0x16')][_0xe288('0x18')]);}logger[_0xe288('0x16')](_0xe288('0x11'),_0x35573a,_0x1101fb[_0xe288('0x16')]['message']);return _0x31e6e1(_0x1101fb[_0xe288('0x16')][_0xe288('0x18')]);}else{logger[_0xe288('0x19')](_0xe288('0x11'),_0x35573a,'request\x20sent');_0x31e6e1(_0x1101fb[_0xe288('0x1a')]['message']);}})[_0xe288('0x1b')](function(_0x22b458){logger[_0xe288('0x16')]('User,\x20%s,\x20%s',_0x35573a,_0x22b458);_0x26a3fa(_0x22b458);});});}exports[_0xe288('0x1c')]=function(_0x19cf44){var _0x4e1961=this;return new Promise(function(_0x131bdd,_0x5277d1){return db[_0xe288('0x1d')][_0xe288('0x1e')]({'raw':_0x19cf44['options']?_0x19cf44[_0xe288('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19cf44['options']?_0x19cf44[_0xe288('0x1f')][_0xe288('0x20')]||null:null,'attributes':_0x19cf44[_0xe288('0x1f')]?_0x19cf44[_0xe288('0x1f')][_0xe288('0x21')]||null:null,'limit':_0x19cf44[_0xe288('0x1f')]?_0x19cf44[_0xe288('0x1f')]['limit']||null:null,'include':_0x19cf44[_0xe288('0x1f')]?_0x19cf44['options'][_0xe288('0x22')]?_[_0xe288('0x23')](_0x19cf44['options'][_0xe288('0x22')],function(_0x51e057){return{'model':db[_0x51e057['model']],'as':_0x51e057['as'],'attributes':_0x51e057[_0xe288('0x21')],'include':_0x51e057[_0xe288('0x22')]?_[_0xe288('0x23')](_0x51e057[_0xe288('0x22')],function(_0x4f7f1f){return{'model':db[_0x4f7f1f[_0xe288('0x24')]],'as':_0x4f7f1f['as'],'attributes':_0x4f7f1f[_0xe288('0x21')],'include':_0x4f7f1f[_0xe288('0x22')]?_[_0xe288('0x23')](_0x4f7f1f[_0xe288('0x22')],function(_0x4942d1){return{'model':db[_0x4942d1[_0xe288('0x24')]],'as':_0x4942d1['as'],'attributes':_0x4942d1[_0xe288('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe288('0x25')](function(_0x234b6e){logger[_0xe288('0x19')](_0xe288('0x1c'),_0x19cf44);logger[_0xe288('0x12')](_0xe288('0x1c'),_0x19cf44,JSON[_0xe288('0x15')](_0x234b6e));_0x131bdd(_0x234b6e);})['catch'](function(_0x14d94f){logger[_0xe288('0x16')]('GetUser',_0x14d94f[_0xe288('0x18')],_0x19cf44);_0x5277d1(_0x4e1961[_0xe288('0x16')](0x1f4,_0x14d94f[_0xe288('0x18')]));});});};exports[_0xe288('0x26')]=function(_0x478c19){var _0x6e1512=this;return new Promise(function(_0x47b05c,_0x3a42bb){return db[_0xe288('0x1d')][_0xe288('0x27')]({'raw':_0x478c19[_0xe288('0x1f')]?_0x478c19['options'][_0xe288('0x28')]===undefined?!![]:![]:!![],'where':_0x478c19[_0xe288('0x1f')]?_0x478c19[_0xe288('0x1f')][_0xe288('0x20')]||null:null,'attributes':_0x478c19[_0xe288('0x1f')]?_0x478c19[_0xe288('0x1f')][_0xe288('0x21')]||null:null,'include':_0x478c19[_0xe288('0x1f')]?_0x478c19[_0xe288('0x1f')][_0xe288('0x22')]?_[_0xe288('0x23')](_0x478c19[_0xe288('0x1f')][_0xe288('0x22')],function(_0x4fd93c){return{'model':db[_0x4fd93c[_0xe288('0x24')]],'as':_0x4fd93c['as'],'attributes':_0x4fd93c[_0xe288('0x21')],'include':_0x4fd93c[_0xe288('0x22')]?_['map'](_0x4fd93c[_0xe288('0x22')],function(_0x5107b0){return{'model':db[_0x5107b0[_0xe288('0x24')]],'as':_0x5107b0['as'],'attributes':_0x5107b0[_0xe288('0x21')],'include':_0x5107b0[_0xe288('0x22')]?_['map'](_0x5107b0[_0xe288('0x22')],function(_0x14b065){return{'model':db[_0x14b065['model']],'as':_0x14b065['as'],'attributes':_0x14b065[_0xe288('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe288('0x25')](function(_0x361cc6){logger[_0xe288('0x19')]('ShowUser',_0x478c19);logger[_0xe288('0x12')](_0xe288('0x26'),_0x478c19,JSON[_0xe288('0x15')](_0x361cc6));_0x47b05c(_0x361cc6);})['catch'](function(_0x287d20){logger[_0xe288('0x16')](_0xe288('0x26'),_0x287d20[_0xe288('0x18')],_0x478c19);_0x3a42bb(_0x6e1512[_0xe288('0x16')](0x1f4,_0x287d20[_0xe288('0x18')]));});});};exports[_0xe288('0x29')]=function(_0x56e9f4){var _0x3a87b2=this;return new Promise(function(_0x2eb9b6,_0x5aa3f0){var _0x471cf2;return db[_0xe288('0x1d')]['find']({'where':_0x56e9f4[_0xe288('0x1f')]['where']||{},'attributes':['id',_0xe288('0x2a'),_0xe288('0x2b'),_0xe288('0x2c'),'interface']})[_0xe288('0x25')](function(_0xd4b792){if(_0xd4b792){_0x471cf2=_0xd4b792;return db[_0xe288('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x471cf2['id']},'individualHooks':!![]});}})['then'](function(){if(_0x471cf2){return db[_0xe288('0x2e')][_0xe288('0x1e')]({'where':{'membername':_0x471cf2[_0xe288('0x2a')],'type':_0xe288('0x2f'),'exitAt':null}});}})['then'](function(_0x42dbf9){if(_0x471cf2){if(_0x42dbf9&&_0x42dbf9[_0xe288('0x30')]){var _0x3ca479=moment()['format'](_0xe288('0x31'));for(var _0x5bc586=0x0,_0x350e39=_0x42dbf9[_0xe288('0x30')];_0x5bc586<_0x350e39;_0x5bc586++){_0x42dbf9[_0x5bc586][_0xe288('0x32')]({'exitAt':_0x3ca479});}}}})['then'](function(){if(_0x471cf2){var _0x490f88=[];var _0x48a9bb=utils[_0xe288('0x33')]();_0x48a9bb['forEach'](function(_0xaf1bfa){_0x490f88['push']({'channel':_0xaf1bfa,'membername':_0x471cf2[_0xe288('0x2a')],'interface':_[_0xe288('0x34')](_0x471cf2[_0xe288('0x35')])?util['format'](_0xe288('0x36'),_0x471cf2[_0xe288('0x2a')]):_0x471cf2['interface'],'type':_0xe288('0x2f'),'enterAt':moment()[_0xe288('0x37')](_0xe288('0x31')),'data1':_0x56e9f4['body'][_0xe288('0x38')]||'DEFAULT\x20PAUSE','role':_0x471cf2[_0xe288('0x2b')],'internal':_0x471cf2[_0xe288('0x2c')],'uniqueid':_0x56e9f4[_0xe288('0x39')][_0xe288('0x3a')]||null});});return db[_0xe288('0x2e')]['bulkCreate'](_0x490f88,{'individualHooks':!![]});}})[_0xe288('0x25')](function(){if(_0x471cf2){return _0x471cf2[_0xe288('0x3b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x56e9f4[_0xe288('0x39')][_0xe288('0x38')]||_0xe288('0x3c'),'lastPauseAt':moment()[_0xe288('0x37')](_0xe288('0x31'))});}})[_0xe288('0x25')](function(_0x372024){_0x2eb9b6(_0x372024);})[_0xe288('0x1b')](function(_0x2b3ce9){_0x5aa3f0(_0x3a87b2[_0xe288('0x16')](0x1f4,_0x2b3ce9[_0xe288('0x18')]));});});};exports[_0xe288('0x3d')]=function(_0x21c892){var _0x207653=this;return new Promise(function(_0x50c5e4,_0x37fd39){var _0x240582;return db['User']['findOne']({'where':_0x21c892[_0xe288('0x1f')][_0xe288('0x20')]||{},'attributes':['id',_0xe288('0x2a')]})[_0xe288('0x25')](function(_0x36120b){if(_0x36120b){_0x240582=_0x36120b;if(_0x21c892[_0xe288('0x39')][_0xe288('0x3e')]&&!utils['isValidChannel'](_0x21c892['body'][_0xe288('0x3e')])){throw new Error(_0xe288('0x3f'));}switch(_0x21c892['body'][_0xe288('0x3e')]){case _0xe288('0x40'):return db[_0xe288('0x2d')][_0xe288('0x3b')]({'paused':0x0},{'where':{'UserId':_0x240582['id']}})[_0xe288('0x25')](function(){return db[_0xe288('0x2e')][_0xe288('0x27')]({'where':{'channel':_0x21c892[_0xe288('0x39')][_0xe288('0x3e')],'membername':_0x240582[_0xe288('0x2a')],'type':_0xe288('0x2f'),'exitAt':null}});})[_0xe288('0x25')](function(_0x3155b1){if(_0x3155b1){return _0x3155b1[_0xe288('0x3b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe288('0x41')},{'individualHooks':!![]});}return null;})[_0xe288('0x25')](function(){return _0x240582['update']({'voicePause':![]});});case'mail':case _0xe288('0x42'):case'fax':case _0xe288('0x43'):case _0xe288('0x44'):case'whatsapp':return db[_0xe288('0x2e')][_0xe288('0x27')]({'where':{'channel':_0x21c892[_0xe288('0x39')][_0xe288('0x3e')],'membername':_0x240582['name'],'type':_0xe288('0x2f'),'exitAt':null}})[_0xe288('0x25')](function(_0x3ff4dd){return _0x3ff4dd[_0xe288('0x3b')]({'exitAt':moment()[_0xe288('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe288('0x41')},{'individualHooks':!![]});})[_0xe288('0x25')](function(){var _0x478da9={};_[_0xe288('0x45')](_0x478da9,util[_0xe288('0x37')](_0xe288('0x46'),_0x21c892[_0xe288('0x39')][_0xe288('0x3e')],'Pause'),![]);return _0x240582['update'](_0x478da9);});default:return db[_0xe288('0x2d')][_0xe288('0x3b')]({'paused':0x0},{'where':{'UserId':_0x240582['id']}})['then'](function(){return db[_0xe288('0x2e')][_0xe288('0x1e')]({'where':{'membername':_0x240582[_0xe288('0x2a')],'type':_0xe288('0x2f'),'exitAt':null}});})[_0xe288('0x25')](function(_0x52d99b){var _0x2642f8=[];_0x52d99b[_0xe288('0x47')](function(_0x35590a){_0x2642f8[_0xe288('0x48')](_0x35590a[_0xe288('0x3b')]({'exitAt':moment()[_0xe288('0x37')](_0xe288('0x31')),'data2':_0xe288('0x41')}));});return BPromise[_0xe288('0x49')](_0x2642f8);})[_0xe288('0x25')](function(){return _0x240582[_0xe288('0x3b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xe288('0x25')](function(_0x20be33){_0x50c5e4(_0x20be33);})[_0xe288('0x1b')](function(_0x5e5c62){_0x37fd39(_0x207653[_0xe288('0x16')](0x1f4,_0x5e5c62[_0xe288('0x18')]));});});};exports[_0xe288('0x4a')]=function(_0x40b3e0){var _0x3f1a9e=this;return new Promise(function(_0x4ebbb7,_0x362f7c){var _0x37c6c0;return db[_0xe288('0x1d')][_0xe288('0x4b')]({'where':_0x40b3e0['options'][_0xe288('0x20')]||{},'attributes':['id','name']})[_0xe288('0x25')](function(_0x25f24b){if(_0x25f24b){_0x37c6c0=_0x25f24b;return db[_0xe288('0x2d')][_0xe288('0x4c')]({'where':{'membername':_0x37c6c0[_0xe288('0x2a')]},'individualHooks':!![]});}})[_0xe288('0x25')](function(){if(_0x37c6c0){return db[_0xe288('0x2e')][_0xe288('0x1e')]({'where':{'membername':_0x37c6c0[_0xe288('0x2a')],'exitAt':null}});}})['then'](function(_0x54e13d){if(_0x37c6c0){if(_0x54e13d&&_0x54e13d['length']){var _0xe0a2bb=[];_0x54e13d[_0xe288('0x47')](function(_0x29be43){_0xe0a2bb[_0xe288('0x48')](_0x29be43[_0xe288('0x3b')]({'exitAt':moment()[_0xe288('0x37')](_0xe288('0x31'))}));});return BPromise[_0xe288('0x49')](_0xe0a2bb);}}})[_0xe288('0x25')](function(){if(_0x37c6c0){return _0x37c6c0[_0xe288('0x3b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe288('0x25')](function(_0x23a467){_0x4ebbb7(_0x23a467);})[_0xe288('0x1b')](function(_0x27f282){_0x362f7c(_0x3f1a9e[_0xe288('0x16')](0x1f4,_0x27f282['message']));});});};exports['LoginUser']=function(_0x46235b){var _0x27c43c=this;return new Promise(function(_0x595552,_0x149eab){var _0x56301f;var _0x79420a;var _0x530be4;var _0x5dab46;return db['User']['findOne']({'where':_0x46235b[_0xe288('0x1f')][_0xe288('0x20')]||{},'attributes':['id',_0xe288('0x2a'),_0xe288('0x2b'),'mobile',_0xe288('0x4d'),'internal','loginInPause','interface']})[_0xe288('0x25')](function(_0x221164){if(_0x221164){_0x56301f=_0x221164;_0x5dab46=_0x46235b[_0xe288('0x39')][_0xe288('0x35')]?_0x46235b['body'][_0xe288('0x35')]:util[_0xe288('0x37')](_0xe288('0x36'),_0x56301f[_0xe288('0x2a')]);return db['User'][_0xe288('0x4e')]({'where':{'role':_0xe288('0x4f'),'online':!![],'id':{'$ne':_0x56301f['id']}}});}})['then'](function(_0x92f281){if(_0x92f281){_0x530be4=_0x92f281;return require(_0xe288('0x50'))[_0xe288('0x51')]();}})[_0xe288('0x25')](function(_0x48e948){if(_0x48e948&&_0x48e948[_0xe288('0x52')]&&_0x530be4>=_0x48e948['agents']){throw new Error(_0xe288('0x53'));}})[_0xe288('0x25')](function(){if(_0x56301f){return db[_0xe288('0x2d')][_0xe288('0x4c')]({'where':{'membername':_0x56301f[_0xe288('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x56301f){return _0x56301f[_0xe288('0x54')]({'raw':!![]});}})[_0xe288('0x25')](function(_0x5bb697){if(_0x56301f){if(_0x5bb697){var _0x4dfca2=[];_0x79420a=_0x5bb697;if(_0x79420a['length']){for(var _0x17fffa=0x0;_0x17fffa<_0x79420a[_0xe288('0x30')];_0x17fffa++){_0x4dfca2[_0xe288('0x48')](db['UserVoiceQueueRt'][_0xe288('0x55')]({'membername':_0x56301f[_0xe288('0x2a')],'UserId':_0x56301f['id'],'queue_name':_0x79420a[_0x17fffa][_0xe288('0x2a')],'VoiceQueueId':_0x79420a[_0x17fffa]['id'],'interface':_0x5dab46,'paused':_0x56301f['loginInPause']||![],'penalty':_0x79420a[_0x17fffa][_0xe288('0x56')]||0x0}));}return BPromise[_0xe288('0x49')](_0x4dfca2);}}}})['then'](function(){if(_0x56301f){return db[_0xe288('0x2e')]['findAll']({'where':{'membername':_0x56301f['name'],'exitAt':null}});}})['then'](function(_0x2241a6){if(_0x56301f){if(_0x2241a6&&_0x2241a6[_0xe288('0x30')]){var _0x234f1a=[];_0x2241a6[_0xe288('0x47')](function(_0x10aecd){_0x234f1a['push'](_0x10aecd[_0xe288('0x3b')]({'exitAt':moment()[_0xe288('0x37')](_0xe288('0x31'))}));});return BPromise['all'](_0x234f1a);}}})[_0xe288('0x25')](function(_0x2521fa){if(_0x56301f){var _0x3d28dd=[];var _0x446860=[];var _0x1a3bb4=utils[_0xe288('0x33')]();var _0x406769={'membername':_0x56301f[_0xe288('0x2a')],'interface':_0x5dab46,'enterAt':moment()['format'](_0xe288('0x31')),'role':_0x56301f['role'],'internal':_0x56301f['internal']};_0x1a3bb4['forEach'](function(_0x43309c){_0x3d28dd[_0xe288('0x48')](_[_0xe288('0x57')]({'channel':_0x43309c,'type':_0xe288('0x58'),'data1':_0xe288('0x59'),'data2':_0x5dab46},_0x406769));if(_0x56301f[_0xe288('0x5a')]){_0x446860[_0xe288('0x48')](_[_0xe288('0x57')]({'channel':_0x43309c,'type':'PAUSE','data1':'LOGININPAUSE'},_0x406769));}});return db[_0xe288('0x2e')][_0xe288('0x5b')](_0x3d28dd[_0xe288('0x5c')](_0x446860),{'individualHooks':!![]});}})[_0xe288('0x25')](function(){if(_0x56301f){return _0x56301f[_0xe288('0x3b')]({'online':!![],'lastLoginAt':moment()['format'](_0xe288('0x31')),'voicePause':_0x56301f[_0xe288('0x5a')]||![],'mailPause':_0x56301f[_0xe288('0x5a')]||![],'chatPause':_0x56301f[_0xe288('0x5a')]||![],'faxPause':_0x56301f[_0xe288('0x5a')]||![],'smsPause':_0x56301f['loginInPause']||![],'openchannelPause':_0x56301f[_0xe288('0x5a')]||![],'pauseType':_0x56301f[_0xe288('0x5a')]?_0xe288('0x5d'):null,'lastPauseAt':moment()['format'](_0xe288('0x31')),'interface':_0x5dab46});}})[_0xe288('0x25')](function(_0x122625){_0x595552(_0x122625);})[_0xe288('0x1b')](function(_0x4662ae){_0x149eab(_0x27c43c[_0xe288('0x16')](0x1f4,_0x4662ae[_0xe288('0x18')]));});});};
\ No newline at end of file
+var _0xb305=['then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','message','User,\x20%s,\x20%s','catch','GetUser','findAll','options','raw','where','limit','include','map','attributes','model','ShowUser','find','User','name','role','internal','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','SIP/%s','interface','body','type','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','mail','chat','sms','whatsapp','system','set','%s%s','Pause','all','LogoutUser','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','concat','LOGININPAUSE','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./user.socket','register','request'];(function(_0x1e72a5,_0x1537b3){var _0x53baab=function(_0xeb5fd5){while(--_0xeb5fd5){_0x1e72a5['push'](_0x1e72a5['shift']());}};_0x53baab(++_0x1537b3);}(_0xb305,0xab));var _0x5b30=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0xb305[_0x526786];return _0x3a512d;};'use strict';var _=require('lodash');var util=require(_0x5b30('0x0'));var moment=require(_0x5b30('0x1'));var BPromise=require(_0x5b30('0x2'));var rs=require(_0x5b30('0x3'));var fs=require('fs');var Redis=require(_0x5b30('0x4'));var db=require(_0x5b30('0x5'))['db'];var utils=require(_0x5b30('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5b30('0x7'));var jayson=require(_0x5b30('0x8'));var client=jayson[_0x5b30('0x9')][_0x5b30('0xa')]({'port':0x232a});config['redis']=_[_0x5b30('0xb')](config[_0x5b30('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b30('0xd'))(new Redis(config['redis']));require(_0x5b30('0xe'))[_0x5b30('0xf')](socket);function respondWithRpcPromise(_0x284166,_0x47f722,_0x4a0c82){return new BPromise(function(_0x105274,_0xe03cba){return client[_0x5b30('0x10')](_0x284166,_0x4a0c82)[_0x5b30('0x11')](function(_0x3b79d7){logger[_0x5b30('0x12')]('User,\x20%s,\x20%s',_0x47f722,_0x5b30('0x13'));logger[_0x5b30('0x14')](_0x5b30('0x15'),_0x47f722,_0x5b30('0x13'),JSON[_0x5b30('0x16')](_0x3b79d7));if(_0x3b79d7['error']){if(_0x3b79d7['error'][_0x5b30('0x17')]===0x1f4){logger[_0x5b30('0x18')]('User,\x20%s,\x20%s',_0x47f722,_0x3b79d7[_0x5b30('0x18')][_0x5b30('0x19')]);return _0xe03cba(_0x3b79d7[_0x5b30('0x18')]['message']);}logger[_0x5b30('0x18')](_0x5b30('0x1a'),_0x47f722,_0x3b79d7[_0x5b30('0x18')][_0x5b30('0x19')]);return _0x105274(_0x3b79d7[_0x5b30('0x18')][_0x5b30('0x19')]);}else{logger[_0x5b30('0x12')]('User,\x20%s,\x20%s',_0x47f722,_0x5b30('0x13'));_0x105274(_0x3b79d7['result'][_0x5b30('0x19')]);}})[_0x5b30('0x1b')](function(_0x3157e8){logger[_0x5b30('0x18')](_0x5b30('0x1a'),_0x47f722,_0x3157e8);_0xe03cba(_0x3157e8);});});}exports[_0x5b30('0x1c')]=function(_0x5b0bbc){var _0x248e83=this;return new Promise(function(_0x4ffb17,_0x37a4d5){return db['User'][_0x5b30('0x1d')]({'raw':_0x5b0bbc[_0x5b30('0x1e')]?_0x5b0bbc[_0x5b30('0x1e')][_0x5b30('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b0bbc[_0x5b30('0x1e')]?_0x5b0bbc[_0x5b30('0x1e')][_0x5b30('0x20')]||null:null,'attributes':_0x5b0bbc[_0x5b30('0x1e')]?_0x5b0bbc[_0x5b30('0x1e')]['attributes']||null:null,'limit':_0x5b0bbc['options']?_0x5b0bbc[_0x5b30('0x1e')][_0x5b30('0x21')]||null:null,'include':_0x5b0bbc['options']?_0x5b0bbc[_0x5b30('0x1e')][_0x5b30('0x22')]?_[_0x5b30('0x23')](_0x5b0bbc[_0x5b30('0x1e')][_0x5b30('0x22')],function(_0x4d5a70){return{'model':db[_0x4d5a70['model']],'as':_0x4d5a70['as'],'attributes':_0x4d5a70[_0x5b30('0x24')],'include':_0x4d5a70[_0x5b30('0x22')]?_['map'](_0x4d5a70[_0x5b30('0x22')],function(_0x370ad8){return{'model':db[_0x370ad8['model']],'as':_0x370ad8['as'],'attributes':_0x370ad8[_0x5b30('0x24')],'include':_0x370ad8[_0x5b30('0x22')]?_[_0x5b30('0x23')](_0x370ad8['include'],function(_0x320ee0){return{'model':db[_0x320ee0[_0x5b30('0x25')]],'as':_0x320ee0['as'],'attributes':_0x320ee0[_0x5b30('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5b30('0x11')](function(_0x536f8f){logger[_0x5b30('0x12')](_0x5b30('0x1c'),_0x5b0bbc);logger[_0x5b30('0x14')]('GetUser',_0x5b0bbc,JSON[_0x5b30('0x16')](_0x536f8f));_0x4ffb17(_0x536f8f);})[_0x5b30('0x1b')](function(_0x322169){logger[_0x5b30('0x18')](_0x5b30('0x1c'),_0x322169['message'],_0x5b0bbc);_0x37a4d5(_0x248e83['error'](0x1f4,_0x322169[_0x5b30('0x19')]));});});};exports[_0x5b30('0x26')]=function(_0x294d14){var _0x2f40ed=this;return new Promise(function(_0x262a4e,_0x275458){return db['User'][_0x5b30('0x27')]({'raw':_0x294d14[_0x5b30('0x1e')]?_0x294d14[_0x5b30('0x1e')][_0x5b30('0x1f')]===undefined?!![]:![]:!![],'where':_0x294d14[_0x5b30('0x1e')]?_0x294d14['options'][_0x5b30('0x20')]||null:null,'attributes':_0x294d14[_0x5b30('0x1e')]?_0x294d14[_0x5b30('0x1e')][_0x5b30('0x24')]||null:null,'include':_0x294d14['options']?_0x294d14[_0x5b30('0x1e')][_0x5b30('0x22')]?_['map'](_0x294d14[_0x5b30('0x1e')][_0x5b30('0x22')],function(_0x5e8115){return{'model':db[_0x5e8115[_0x5b30('0x25')]],'as':_0x5e8115['as'],'attributes':_0x5e8115[_0x5b30('0x24')],'include':_0x5e8115[_0x5b30('0x22')]?_['map'](_0x5e8115[_0x5b30('0x22')],function(_0x4f8058){return{'model':db[_0x4f8058[_0x5b30('0x25')]],'as':_0x4f8058['as'],'attributes':_0x4f8058[_0x5b30('0x24')],'include':_0x4f8058[_0x5b30('0x22')]?_['map'](_0x4f8058['include'],function(_0x364a70){return{'model':db[_0x364a70['model']],'as':_0x364a70['as'],'attributes':_0x364a70['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b30('0x11')](function(_0x38d058){logger[_0x5b30('0x12')](_0x5b30('0x26'),_0x294d14);logger[_0x5b30('0x14')](_0x5b30('0x26'),_0x294d14,JSON['stringify'](_0x38d058));_0x262a4e(_0x38d058);})[_0x5b30('0x1b')](function(_0x20ae2d){logger['error'](_0x5b30('0x26'),_0x20ae2d['message'],_0x294d14);_0x275458(_0x2f40ed['error'](0x1f4,_0x20ae2d[_0x5b30('0x19')]));});});};exports['PauseUser']=function(_0x146734){var _0x503934=this;return new Promise(function(_0x110aa0,_0x22bc16){var _0x2bcc1a;return db[_0x5b30('0x28')][_0x5b30('0x27')]({'where':_0x146734[_0x5b30('0x1e')][_0x5b30('0x20')]||{},'attributes':['id',_0x5b30('0x29'),_0x5b30('0x2a'),_0x5b30('0x2b'),'interface']})[_0x5b30('0x11')](function(_0x1ade02){if(_0x1ade02){_0x2bcc1a=_0x1ade02;return db[_0x5b30('0x2c')][_0x5b30('0x2d')]({'paused':0x1},{'where':{'UserId':_0x2bcc1a['id']},'individualHooks':!![]});}})[_0x5b30('0x11')](function(){if(_0x2bcc1a){return db[_0x5b30('0x2e')][_0x5b30('0x1d')]({'where':{'membername':_0x2bcc1a[_0x5b30('0x29')],'type':_0x5b30('0x2f'),'exitAt':null}});}})[_0x5b30('0x11')](function(_0x277eca){if(_0x2bcc1a){if(_0x277eca&&_0x277eca[_0x5b30('0x30')]){var _0xe60d86=moment()[_0x5b30('0x31')](_0x5b30('0x32'));for(var _0x47b7ea=0x0,_0xec9ed8=_0x277eca[_0x5b30('0x30')];_0x47b7ea<_0xec9ed8;_0x47b7ea++){_0x277eca[_0x47b7ea]['updateAttributes']({'exitAt':_0xe60d86});}}}})['then'](function(){if(_0x2bcc1a){var _0x2001f4=[];var _0x568025=utils[_0x5b30('0x33')]();_0x568025[_0x5b30('0x34')](function(_0x153f8d){_0x2001f4[_0x5b30('0x35')]({'channel':_0x153f8d,'membername':_0x2bcc1a[_0x5b30('0x29')],'interface':_[_0x5b30('0x36')](_0x2bcc1a['interface'])?util[_0x5b30('0x31')](_0x5b30('0x37'),_0x2bcc1a[_0x5b30('0x29')]):_0x2bcc1a[_0x5b30('0x38')],'type':_0x5b30('0x2f'),'enterAt':moment()['format'](_0x5b30('0x32')),'data1':_0x146734[_0x5b30('0x39')][_0x5b30('0x3a')]||'DEFAULT\x20PAUSE','role':_0x2bcc1a[_0x5b30('0x2a')],'internal':_0x2bcc1a[_0x5b30('0x2b')],'uniqueid':_0x146734[_0x5b30('0x39')]['uniqueid']||null});});return db[_0x5b30('0x2e')][_0x5b30('0x3b')](_0x2001f4,{'individualHooks':!![]});}})[_0x5b30('0x11')](function(){if(_0x2bcc1a){return _0x2bcc1a[_0x5b30('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x146734[_0x5b30('0x39')][_0x5b30('0x3a')]||_0x5b30('0x3c'),'lastPauseAt':moment()[_0x5b30('0x31')](_0x5b30('0x32'))});}})['then'](function(_0xd47c65){_0x110aa0(_0xd47c65);})[_0x5b30('0x1b')](function(_0x1d2317){_0x22bc16(_0x503934[_0x5b30('0x18')](0x1f4,_0x1d2317['message']));});});};exports[_0x5b30('0x3d')]=function(_0x4c0540){var _0x52cc27=this;return new Promise(function(_0x509229,_0x37da39){var _0x4fe4e1;return db[_0x5b30('0x28')][_0x5b30('0x3e')]({'where':_0x4c0540[_0x5b30('0x1e')]['where']||{},'attributes':['id',_0x5b30('0x29')]})['then'](function(_0x53edb8){if(_0x53edb8){_0x4fe4e1=_0x53edb8;if(_0x4c0540[_0x5b30('0x39')][_0x5b30('0x3f')]&&!utils[_0x5b30('0x40')](_0x4c0540['body'][_0x5b30('0x3f')])){throw new Error(_0x5b30('0x41'));}switch(_0x4c0540['body'][_0x5b30('0x3f')]){case'voice':return db[_0x5b30('0x2c')][_0x5b30('0x2d')]({'paused':0x0},{'where':{'UserId':_0x4fe4e1['id']}})['then'](function(){return db[_0x5b30('0x2e')][_0x5b30('0x27')]({'where':{'channel':_0x4c0540[_0x5b30('0x39')]['channel'],'membername':_0x4fe4e1[_0x5b30('0x29')],'type':_0x5b30('0x2f'),'exitAt':null}});})[_0x5b30('0x11')](function(_0x54e908){if(_0x54e908){return _0x54e908['update']({'exitAt':moment()['format'](_0x5b30('0x32')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x5b30('0x11')](function(){return _0x4fe4e1['update']({'voicePause':![]});});case _0x5b30('0x42'):case _0x5b30('0x43'):case'fax':case _0x5b30('0x44'):case'openchannel':case _0x5b30('0x45'):return db[_0x5b30('0x2e')][_0x5b30('0x27')]({'where':{'channel':_0x4c0540['body'][_0x5b30('0x3f')],'membername':_0x4fe4e1[_0x5b30('0x29')],'type':_0x5b30('0x2f'),'exitAt':null}})[_0x5b30('0x11')](function(_0x296211){return _0x296211[_0x5b30('0x2d')]({'exitAt':moment()['format'](_0x5b30('0x32')),'data2':_0x5b30('0x46')},{'individualHooks':!![]});})['then'](function(){var _0x533d91={};_[_0x5b30('0x47')](_0x533d91,util['format'](_0x5b30('0x48'),_0x4c0540['body'][_0x5b30('0x3f')],_0x5b30('0x49')),![]);return _0x4fe4e1[_0x5b30('0x2d')](_0x533d91);});default:return db[_0x5b30('0x2c')][_0x5b30('0x2d')]({'paused':0x0},{'where':{'UserId':_0x4fe4e1['id']}})[_0x5b30('0x11')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x4fe4e1[_0x5b30('0x29')],'type':_0x5b30('0x2f'),'exitAt':null}});})[_0x5b30('0x11')](function(_0x3a162b){var _0x5ac505=[];_0x3a162b['forEach'](function(_0x47577f){_0x5ac505[_0x5b30('0x35')](_0x47577f[_0x5b30('0x2d')]({'exitAt':moment()[_0x5b30('0x31')](_0x5b30('0x32')),'data2':_0x5b30('0x46')}));});return BPromise[_0x5b30('0x4a')](_0x5ac505);})[_0x5b30('0x11')](function(){return _0x4fe4e1[_0x5b30('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x5b30('0x11')](function(_0xc7e25f){_0x509229(_0xc7e25f);})['catch'](function(_0x1fcaf9){_0x37da39(_0x52cc27[_0x5b30('0x18')](0x1f4,_0x1fcaf9[_0x5b30('0x19')]));});});};exports[_0x5b30('0x4b')]=function(_0x4c16e5){var _0x4fc27b=this;return new Promise(function(_0x54faba,_0x4ff236){var _0x170ac7;return db['User'][_0x5b30('0x3e')]({'where':_0x4c16e5['options'][_0x5b30('0x20')]||{},'attributes':['id',_0x5b30('0x29')]})[_0x5b30('0x11')](function(_0x1f1f59){if(_0x1f1f59){_0x170ac7=_0x1f1f59;return db[_0x5b30('0x2c')]['destroy']({'where':{'membername':_0x170ac7[_0x5b30('0x29')]},'individualHooks':!![]});}})[_0x5b30('0x11')](function(){if(_0x170ac7){return db[_0x5b30('0x2e')][_0x5b30('0x1d')]({'where':{'membername':_0x170ac7[_0x5b30('0x29')],'exitAt':null}});}})[_0x5b30('0x11')](function(_0x50f98f){if(_0x170ac7){if(_0x50f98f&&_0x50f98f['length']){var _0x54f60b=[];_0x50f98f[_0x5b30('0x34')](function(_0x24b198){_0x54f60b['push'](_0x24b198['update']({'exitAt':moment()[_0x5b30('0x31')](_0x5b30('0x32'))}));});return BPromise[_0x5b30('0x4a')](_0x54f60b);}}})['then'](function(){if(_0x170ac7){return _0x170ac7['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x283518){_0x54faba(_0x283518);})[_0x5b30('0x1b')](function(_0x71e876){_0x4ff236(_0x4fc27b['error'](0x1f4,_0x71e876[_0x5b30('0x19')]));});});};exports[_0x5b30('0x4c')]=function(_0x4231c2){var _0x79632d=this;return new Promise(function(_0x3f3d7c,_0xa82335){var _0x4e9de4;var _0x1523a5;var _0x5cc5bd;var _0x48982b;return db[_0x5b30('0x28')][_0x5b30('0x3e')]({'where':_0x4231c2[_0x5b30('0x1e')][_0x5b30('0x20')]||{},'attributes':['id',_0x5b30('0x29'),_0x5b30('0x2a'),_0x5b30('0x4d'),_0x5b30('0x4e'),_0x5b30('0x2b'),_0x5b30('0x4f'),_0x5b30('0x38')]})[_0x5b30('0x11')](function(_0x17f668){if(_0x17f668){_0x4e9de4=_0x17f668;_0x48982b=_0x4231c2[_0x5b30('0x39')][_0x5b30('0x38')]?_0x4231c2['body'][_0x5b30('0x38')]:util[_0x5b30('0x31')](_0x5b30('0x37'),_0x4e9de4[_0x5b30('0x29')]);return db[_0x5b30('0x28')][_0x5b30('0x50')]({'where':{'role':_0x5b30('0x51'),'online':!![],'id':{'$ne':_0x4e9de4['id']}}});}})[_0x5b30('0x11')](function(_0x5f5873){if(_0x5f5873){_0x5cc5bd=_0x5f5873;return require(_0x5b30('0x52'))[_0x5b30('0x53')]();}})[_0x5b30('0x11')](function(_0x4e479d){if(_0x4e479d&&_0x4e479d[_0x5b30('0x54')]&&_0x5cc5bd>=_0x4e479d[_0x5b30('0x54')]){throw new Error(_0x5b30('0x55'));}})[_0x5b30('0x11')](function(){if(_0x4e9de4){return db[_0x5b30('0x2c')][_0x5b30('0x56')]({'where':{'membername':_0x4e9de4[_0x5b30('0x29')]},'individualHooks':!![]});}})[_0x5b30('0x11')](function(){if(_0x4e9de4){return _0x4e9de4[_0x5b30('0x57')]({'raw':!![]});}})[_0x5b30('0x11')](function(_0x2f2bee){if(_0x4e9de4){if(_0x2f2bee){var _0x356925=[];_0x1523a5=_0x2f2bee;if(_0x1523a5[_0x5b30('0x30')]){for(var _0x55835d=0x0;_0x55835d<_0x1523a5[_0x5b30('0x30')];_0x55835d++){_0x356925['push'](db['UserVoiceQueueRt'][_0x5b30('0x58')]({'membername':_0x4e9de4['name'],'UserId':_0x4e9de4['id'],'queue_name':_0x1523a5[_0x55835d][_0x5b30('0x29')],'VoiceQueueId':_0x1523a5[_0x55835d]['id'],'interface':_0x48982b,'paused':_0x4e9de4[_0x5b30('0x4f')]||![],'penalty':_0x1523a5[_0x55835d][_0x5b30('0x59')]||0x0}));}return BPromise['all'](_0x356925);}}}})['then'](function(){if(_0x4e9de4){return db['MemberReport'][_0x5b30('0x1d')]({'where':{'membername':_0x4e9de4[_0x5b30('0x29')],'exitAt':null}});}})[_0x5b30('0x11')](function(_0x397421){if(_0x4e9de4){if(_0x397421&&_0x397421[_0x5b30('0x30')]){var _0x274537=[];_0x397421[_0x5b30('0x34')](function(_0x284f1d){_0x274537[_0x5b30('0x35')](_0x284f1d[_0x5b30('0x2d')]({'exitAt':moment()[_0x5b30('0x31')](_0x5b30('0x32'))}));});return BPromise['all'](_0x274537);}}})[_0x5b30('0x11')](function(_0x36a4a9){if(_0x4e9de4){var _0x575996=[];var _0x411e77=[];var _0x3b3eed=utils[_0x5b30('0x33')]();var _0x4daa78={'membername':_0x4e9de4['name'],'interface':_0x48982b,'enterAt':moment()[_0x5b30('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4e9de4[_0x5b30('0x2a')],'internal':_0x4e9de4['internal']};_0x3b3eed[_0x5b30('0x34')](function(_0x3eda74){_0x575996['push'](_['merge']({'channel':_0x3eda74,'type':_0x5b30('0x5a'),'data1':_0x5b30('0x5b'),'data2':_0x48982b},_0x4daa78));if(_0x4e9de4[_0x5b30('0x4f')]){_0x411e77[_0x5b30('0x35')](_['merge']({'channel':_0x3eda74,'type':_0x5b30('0x2f'),'data1':'LOGININPAUSE'},_0x4daa78));}});return db[_0x5b30('0x2e')][_0x5b30('0x3b')](_0x575996[_0x5b30('0x5c')](_0x411e77),{'individualHooks':!![]});}})[_0x5b30('0x11')](function(){if(_0x4e9de4){return _0x4e9de4[_0x5b30('0x2d')]({'online':!![],'lastLoginAt':moment()['format'](_0x5b30('0x32')),'voicePause':_0x4e9de4[_0x5b30('0x4f')]||![],'mailPause':_0x4e9de4[_0x5b30('0x4f')]||![],'chatPause':_0x4e9de4['loginInPause']||![],'faxPause':_0x4e9de4[_0x5b30('0x4f')]||![],'smsPause':_0x4e9de4['loginInPause']||![],'openchannelPause':_0x4e9de4[_0x5b30('0x4f')]||![],'pauseType':_0x4e9de4[_0x5b30('0x4f')]?_0x5b30('0x5d'):null,'lastPauseAt':moment()[_0x5b30('0x31')](_0x5b30('0x32')),'interface':_0x48982b});}})[_0x5b30('0x11')](function(_0x21d212){_0x3f3d7c(_0x21d212);})[_0x5b30('0x1b')](function(_0x4eb435){_0xa82335(_0x79632d[_0x5b30('0x18')](0x1f4,_0x4eb435['message']));});});};
\ No newline at end of file
index f1e426c..47c6392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e11=['update','emit','removeListener','length','./user.events','save','remove'];(function(_0x1bb155,_0x2e5a1f){var _0x3ff8a8=function(_0x1d3876){while(--_0x1d3876){_0x1bb155['push'](_0x1bb155['shift']());}};_0x3ff8a8(++_0x2e5a1f);}(_0x2e11,0x18c));var _0x12e1=function(_0x2464c5,_0x536628){_0x2464c5=_0x2464c5-0x0;var _0x194744=_0x2e11[_0x2464c5];return _0x194744;};'use strict';var UserEvents=require(_0x12e1('0x0'));var events=[_0x12e1('0x1'),_0x12e1('0x2'),_0x12e1('0x3')];function createListener(_0x92af76,_0x470539){return function(_0x176853){_0x470539[_0x12e1('0x4')](_0x92af76,_0x176853);};}function removeListener(_0x540b30,_0xaf8dc1){return function(){UserEvents[_0x12e1('0x5')](_0x540b30,_0xaf8dc1);};}exports['register']=function(_0x5f057b){for(var _0x25da2c=0x0,_0x1f2a1d=events[_0x12e1('0x6')];_0x25da2c<_0x1f2a1d;_0x25da2c++){var _0x3c00ea=events[_0x25da2c];var _0x1e36e4=createListener('user:'+_0x3c00ea,_0x5f057b);UserEvents['on'](_0x3c00ea,_0x1e36e4);}};
\ No newline at end of file
+var _0xbc94=['remove','removeListener','register','./user.events'];(function(_0x98be9,_0x1e0ae2){var _0x471836=function(_0x3c244d){while(--_0x3c244d){_0x98be9['push'](_0x98be9['shift']());}};_0x471836(++_0x1e0ae2);}(_0xbc94,0x173));var _0x4bc9=function(_0x187dcb,_0x2f3d32){_0x187dcb=_0x187dcb-0x0;var _0x27f48b=_0xbc94[_0x187dcb];return _0x27f48b;};'use strict';var UserEvents=require(_0x4bc9('0x0'));var events=['save',_0x4bc9('0x1'),'update'];function createListener(_0x2dff7b,_0x149ba2){return function(_0xcfa7ab){_0x149ba2['emit'](_0x2dff7b,_0xcfa7ab);};}function removeListener(_0x42832e,_0x5c0a5d){return function(){UserEvents[_0x4bc9('0x2')](_0x42832e,_0x5c0a5d);};}exports[_0x4bc9('0x3')]=function(_0x3c34ee){for(var _0x4e8418=0x0,_0x2a2a16=events['length'];_0x4e8418<_0x2a2a16;_0x4e8418++){var _0x1d15f7=events[_0x4e8418];var _0x2bd331=createListener('user:'+_0x1d15f7,_0x3c34ee);UserEvents['on'](_0x1d15f7,_0x2bd331);}};
\ No newline at end of file
index 01ebed7..2e71283 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(_0x2cdaa9,_0x2c9421){var _0x16966f=function(_0x587add){while(--_0x587add){_0x2cdaa9['push'](_0x2cdaa9['shift']());}};_0x16966f(++_0x2c9421);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f92f5,_0xdffb56){_0x3f92f5=_0x3f92f5-0x0;var _0x54aea6=_0xedd9[_0x3f92f5];return _0x54aea6;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x42323e,_0x21ee75){var _0x502f13=function(_0x1c093c){while(--_0x1c093c){_0x42323e['push'](_0x42323e['shift']());}};_0x502f13(++_0x21ee75);}(_0x70e0,0x17b));var _0x070e=function(_0x6f6a18,_0x3ea8a9){_0x6f6a18=_0x6f6a18-0x0;var _0x2d8f7f=_0x70e0[_0x6f6a18];return _0x2d8f7f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 63bb43f..7f396fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bec=['sequelize','INTEGER'];(function(_0x5f435c,_0x11dcab){var _0x6d9d46=function(_0x15e807){while(--_0x15e807){_0x5f435c['push'](_0x5f435c['shift']());}};_0x6d9d46(++_0x11dcab);}(_0x1bec,0xf2));var _0xc1be=function(_0x53538f,_0x3b129d){_0x53538f=_0x53538f-0x0;var _0x4a5ffc=_0x1bec[_0x53538f];return _0x4a5ffc;};'use strict';var Sequelize=require(_0xc1be('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc1be('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xec07=['sequelize','exports'];(function(_0x4330ab,_0x37b8ab){var _0xc19a89=function(_0x1370e4){while(--_0x1370e4){_0x4330ab['push'](_0x4330ab['shift']());}};_0xc19a89(++_0x37b8ab);}(_0xec07,0x150));var _0x7ec0=function(_0x56f534,_0x2a71ae){_0x56f534=_0x56f534-0x0;var _0x38086e=_0xec07[_0x56f534];return _0x38086e;};'use strict';var Sequelize=require(_0x7ec0('0x0'));module[_0x7ec0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index e3a212c..db3749b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e72=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x5b9ad8,_0x50a40f){var _0x5a94bc=function(_0x4bb3fb){while(--_0x4bb3fb){_0x5b9ad8['push'](_0x5b9ad8['shift']());}};_0x5a94bc(++_0x50a40f);}(_0x8e72,0x1c8));var _0x28e7=function(_0x482fa2,_0x41f6aa){_0x482fa2=_0x482fa2-0x0;var _0x582770=_0x8e72[_0x482fa2];return _0x582770;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28e7('0x0'))(_0x28e7('0x1'));var moment=require(_0x28e7('0x2'));var BPromise=require(_0x28e7('0x3'));var rp=require(_0x28e7('0x4'));var fs=require('fs');var path=require(_0x28e7('0x5'));var rimraf=require(_0x28e7('0x6'));var config=require(_0x28e7('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x28e7('0x8')]=function(_0x37e269,_0x3995cd){return _0x37e269[_0x28e7('0x9')](_0x28e7('0xa'),attributes,{'tableName':_0x28e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd47=['define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x12dc67,_0x4f5ce9){var _0x2344c6=function(_0x1ffaf3){while(--_0x1ffaf3){_0x12dc67['push'](_0x12dc67['shift']());}};_0x2344c6(++_0x4f5ce9);}(_0xcd47,0x199));var _0x7cd4=function(_0xacc118,_0x3aa0d1){_0xacc118=_0xacc118-0x0;var _0x51c83d=_0xcd47[_0xacc118];return _0x51c83d;};'use strict';var _=require(_0x7cd4('0x0'));var util=require(_0x7cd4('0x1'));var logger=require(_0x7cd4('0x2'))(_0x7cd4('0x3'));var moment=require(_0x7cd4('0x4'));var BPromise=require(_0x7cd4('0x5'));var rp=require(_0x7cd4('0x6'));var fs=require('fs');var path=require(_0x7cd4('0x7'));var rimraf=require(_0x7cd4('0x8'));var config=require(_0x7cd4('0x9'));var attributes=require(_0x7cd4('0xa'));module['exports']=function(_0x578dcd,_0xcbd063){return _0x578dcd[_0x7cd4('0xb')](_0x7cd4('0xc'),attributes,{'tableName':_0x7cd4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20ef884..9bd0299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2f3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','util'];(function(_0xe78202,_0x200dd0){var _0xd44ff5=function(_0x33936b){while(--_0x33936b){_0xe78202['push'](_0xe78202['shift']());}};_0xd44ff5(++_0x200dd0);}(_0xc2f3,0x1cd));var _0x3c2f=function(_0xd57014,_0x20b435){_0xd57014=_0xd57014-0x0;var _0x1860ff=_0xc2f3[_0xd57014];return _0x1860ff;};'use strict';var _=require('lodash');var util=require(_0x3c2f('0x0'));var moment=require(_0x3c2f('0x1'));var BPromise=require(_0x3c2f('0x2'));var rs=require(_0x3c2f('0x3'));var fs=require('fs');var Redis=require(_0x3c2f('0x4'));var db=require(_0x3c2f('0x5'))['db'];var utils=require(_0x3c2f('0x6'));var logger=require(_0x3c2f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea3b2,_0x42a2ae,_0x3860d0){return new BPromise(function(_0x4b5973,_0x36cc95){return client[_0x3c2f('0x9')](_0x4ea3b2,_0x3860d0)[_0x3c2f('0xa')](function(_0x10c82c){logger[_0x3c2f('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x42a2ae,'request\x20sent');logger[_0x3c2f('0xc')](_0x3c2f('0xd'),_0x42a2ae,_0x3c2f('0xe'),JSON[_0x3c2f('0xf')](_0x10c82c));if(_0x10c82c[_0x3c2f('0x10')]){if(_0x10c82c['error'][_0x3c2f('0x11')]===0x1f4){logger[_0x3c2f('0x10')](_0x3c2f('0x12'),_0x42a2ae,_0x10c82c['error'][_0x3c2f('0x13')]);return _0x36cc95(_0x10c82c[_0x3c2f('0x10')]['message']);}logger[_0x3c2f('0x10')](_0x3c2f('0x12'),_0x42a2ae,_0x10c82c[_0x3c2f('0x10')][_0x3c2f('0x13')]);return _0x4b5973(_0x10c82c['error'][_0x3c2f('0x13')]);}else{logger[_0x3c2f('0xb')](_0x3c2f('0x12'),_0x42a2ae,_0x3c2f('0xe'));_0x4b5973(_0x10c82c['result'][_0x3c2f('0x13')]);}})[_0x3c2f('0x14')](function(_0x20ac84){logger[_0x3c2f('0x10')](_0x3c2f('0x12'),_0x42a2ae,_0x20ac84);_0x36cc95(_0x20ac84);});});}
\ No newline at end of file
+var _0xcc51=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x39fa21,_0x510674){var _0x294ae0=function(_0x547a08){while(--_0x547a08){_0x39fa21['push'](_0x39fa21['shift']());}};_0x294ae0(++_0x510674);}(_0xcc51,0xbe));var _0x1cc5=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcc51[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x1cc5('0x0'));var util=require(_0x1cc5('0x1'));var moment=require(_0x1cc5('0x2'));var BPromise=require(_0x1cc5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cc5('0x4'))['db'];var utils=require(_0x1cc5('0x5'));var logger=require(_0x1cc5('0x6'))(_0x1cc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x366dbd,_0xab616b,_0x4dc0bb){return new BPromise(function(_0x394d6f,_0xd1882f){return client['request'](_0x366dbd,_0x4dc0bb)[_0x1cc5('0x8')](function(_0x5b7a01){logger[_0x1cc5('0x9')](_0x1cc5('0xa'),_0xab616b,_0x1cc5('0xb'));logger[_0x1cc5('0xc')](_0x1cc5('0xd'),_0xab616b,_0x1cc5('0xb'),JSON[_0x1cc5('0xe')](_0x5b7a01));if(_0x5b7a01['error']){if(_0x5b7a01[_0x1cc5('0xf')]['code']===0x1f4){logger[_0x1cc5('0xf')](_0x1cc5('0xa'),_0xab616b,_0x5b7a01[_0x1cc5('0xf')][_0x1cc5('0x10')]);return _0xd1882f(_0x5b7a01['error']['message']);}logger[_0x1cc5('0xf')]('UserChatQueue,\x20%s,\x20%s',_0xab616b,_0x5b7a01[_0x1cc5('0xf')]['message']);return _0x394d6f(_0x5b7a01[_0x1cc5('0xf')]['message']);}else{logger[_0x1cc5('0x9')](_0x1cc5('0xa'),_0xab616b,_0x1cc5('0xb'));_0x394d6f(_0x5b7a01[_0x1cc5('0x11')]['message']);}})[_0x1cc5('0x12')](function(_0x3d5b99){logger[_0x1cc5('0xf')](_0x1cc5('0xa'),_0xab616b,_0x3d5b99);_0xd1882f(_0x3d5b99);});});}
\ No newline at end of file
index f8258be..272b6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54a41d,_0x1889c3){var _0x29dd35=function(_0xab7ce8){while(--_0xab7ce8){_0x54a41d['push'](_0x54a41d['shift']());}};_0x29dd35(++_0x1889c3);}(_0xe706,0xa3));var _0x6e70=function(_0x11fcba,_0x46ac13){_0x11fcba=_0x11fcba-0x0;var _0x2c792a=_0xe706[_0x11fcba];return _0x2c792a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5d6238,_0xe6992b){var _0x46ac6b=function(_0x5bc30c){while(--_0x5bc30c){_0x5d6238['push'](_0x5d6238['shift']());}};_0x46ac6b(++_0xe6992b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 f4e4659..b75d480 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf4a=['STRING','sequelize','INTEGER'];(function(_0x3f3187,_0x2f96eb){var _0xbeade4=function(_0x48840f){while(--_0x48840f){_0x3f3187['push'](_0x3f3187['shift']());}};_0xbeade4(++_0x2f96eb);}(_0xcf4a,0x13c));var _0xacf4=function(_0x4fc12b,_0x107dac){_0x4fc12b=_0x4fc12b-0x0;var _0x15be68=_0xcf4a[_0x4fc12b];return _0x15be68;};'use strict';var Sequelize=require(_0xacf4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xacf4('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xacf4('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xacf4('0x2')]}};
\ No newline at end of file
+var _0xfa13=['STRING','exports','INTEGER'];(function(_0x563b3f,_0x1fac7e){var _0x5a2a08=function(_0x4acf28){while(--_0x4acf28){_0x563b3f['push'](_0x563b3f['shift']());}};_0x5a2a08(++_0x1fac7e);}(_0xfa13,0x97));var _0x3fa1=function(_0x5a3dec,_0x57a0ab){_0x5a3dec=_0x5a3dec-0x0;var _0x4369f=_0xfa13[_0x5a3dec];return _0x4369f;};'use strict';var Sequelize=require('sequelize');module[_0x3fa1('0x0')]={'penalty':{'type':Sequelize[_0x3fa1('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3fa1('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3fa1('0x2')]}};
\ No newline at end of file
index 067d219..7d3d06a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7449=['util','../../config/logger','moment','bluebird','request-promise','path','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7449,0x99));var _0x9744=function(_0x4fb03e,_0x192d59){_0x4fb03e=_0x4fb03e-0x0;var _0x55a0ee=_0x7449[_0x4fb03e];return _0x55a0ee;};'use strict';var _=require(_0x9744('0x0'));var util=require(_0x9744('0x1'));var logger=require(_0x9744('0x2'))('api');var moment=require(_0x9744('0x3'));var BPromise=require(_0x9744('0x4'));var rp=require(_0x9744('0x5'));var fs=require('fs');var path=require(_0x9744('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9744('0x7'));module[_0x9744('0x8')]=function(_0x41fc6b,_0x48e6eb){return _0x41fc6b['define'](_0x9744('0x9'),attributes,{'tableName':_0x9744('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x17ed=['define','user_has_fax_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5f29f6,_0x56651c){var _0xc0f3a1=function(_0x19e976){while(--_0x19e976){_0x5f29f6['push'](_0x5f29f6['shift']());}};_0xc0f3a1(++_0x56651c);}(_0x17ed,0x192));var _0xd17e=function(_0x3f3666,_0x421ed7){_0x3f3666=_0x3f3666-0x0;var _0x55e78e=_0x17ed[_0x3f3666];return _0x55e78e;};'use strict';var _=require(_0xd17e('0x0'));var util=require(_0xd17e('0x1'));var logger=require('../../config/logger')(_0xd17e('0x2'));var moment=require(_0xd17e('0x3'));var BPromise=require(_0xd17e('0x4'));var rp=require(_0xd17e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd17e('0x6'));var config=require(_0xd17e('0x7'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x57eccc,_0x2e2e8c){return _0x57eccc[_0xd17e('0x8')]('UserFaxQueue',attributes,{'tableName':_0xd17e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e7f5f8..cea7b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93d2=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x55e641,_0x69bcfa){var _0x45e5b2=function(_0x36c132){while(--_0x36c132){_0x55e641['push'](_0x55e641['shift']());}};_0x45e5b2(++_0x69bcfa);}(_0x93d2,0x8b));var _0x293d=function(_0x5041ea,_0x58c92a){_0x5041ea=_0x5041ea-0x0;var _0x5d0856=_0x93d2[_0x5041ea];return _0x5d0856;};'use strict';var _=require(_0x293d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x293d('0x1'));var rs=require(_0x293d('0x2'));var fs=require('fs');var Redis=require(_0x293d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x293d('0x4'));var logger=require('../../config/logger')(_0x293d('0x5'));var config=require(_0x293d('0x6'));var jayson=require(_0x293d('0x7'));var client=jayson['client'][_0x293d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43ad9a,_0x10a24b,_0x264db6){return new BPromise(function(_0x14315c,_0x45dc94){return client[_0x293d('0x9')](_0x43ad9a,_0x264db6)[_0x293d('0xa')](function(_0xd18046){logger[_0x293d('0xb')](_0x293d('0xc'),_0x10a24b,_0x293d('0xd'));logger['debug'](_0x293d('0xe'),_0x10a24b,_0x293d('0xd'),JSON[_0x293d('0xf')](_0xd18046));if(_0xd18046[_0x293d('0x10')]){if(_0xd18046[_0x293d('0x10')][_0x293d('0x11')]===0x1f4){logger[_0x293d('0x10')](_0x293d('0xc'),_0x10a24b,_0xd18046[_0x293d('0x10')][_0x293d('0x12')]);return _0x45dc94(_0xd18046[_0x293d('0x10')]['message']);}logger['error'](_0x293d('0xc'),_0x10a24b,_0xd18046[_0x293d('0x10')][_0x293d('0x12')]);return _0x14315c(_0xd18046['error']['message']);}else{logger[_0x293d('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x10a24b,_0x293d('0xd'));_0x14315c(_0xd18046[_0x293d('0x13')][_0x293d('0x12')]);}})[_0x293d('0x14')](function(_0x552840){logger[_0x293d('0x10')](_0x293d('0xc'),_0x10a24b,_0x552840);_0x45dc94(_0x552840);});});}
\ No newline at end of file
+var _0x9a9d=['UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0x9a9d,0x184));var _0xd9a9=function(_0x27c961,_0xc98ff7){_0x27c961=_0x27c961-0x0;var _0x3ca577=_0x9a9d[_0x27c961];return _0x3ca577;};'use strict';var _=require(_0xd9a9('0x0'));var util=require(_0xd9a9('0x1'));var moment=require(_0xd9a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9a9('0x4'));var logger=require(_0xd9a9('0x5'))(_0xd9a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xd9a9('0x7'));var client=jayson[_0xd9a9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56a032,_0x32008c,_0x3d3915){return new BPromise(function(_0x220f2e,_0x523688){return client['request'](_0x56a032,_0x3d3915)[_0xd9a9('0x9')](function(_0x189c4d){logger[_0xd9a9('0xa')](_0xd9a9('0xb'),_0x32008c,'request\x20sent');logger[_0xd9a9('0xc')](_0xd9a9('0xd'),_0x32008c,_0xd9a9('0xe'),JSON[_0xd9a9('0xf')](_0x189c4d));if(_0x189c4d[_0xd9a9('0x10')]){if(_0x189c4d[_0xd9a9('0x10')][_0xd9a9('0x11')]===0x1f4){logger[_0xd9a9('0x10')](_0xd9a9('0xb'),_0x32008c,_0x189c4d['error'][_0xd9a9('0x12')]);return _0x523688(_0x189c4d[_0xd9a9('0x10')][_0xd9a9('0x12')]);}logger[_0xd9a9('0x10')](_0xd9a9('0xb'),_0x32008c,_0x189c4d[_0xd9a9('0x10')][_0xd9a9('0x12')]);return _0x220f2e(_0x189c4d['error']['message']);}else{logger[_0xd9a9('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x32008c,'request\x20sent');_0x220f2e(_0x189c4d[_0xd9a9('0x13')][_0xd9a9('0x12')]);}})[_0xd9a9('0x14')](function(_0x94f1dc){logger[_0xd9a9('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x32008c,_0x94f1dc);_0x523688(_0x94f1dc);});});}
\ No newline at end of file
index b4e4c51..8d99022 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(_0x3dd3bc,_0x32950b){var _0x172373=function(_0x2b0f0d){while(--_0x2b0f0d){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x172373(++_0x32950b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x70db68,_0x25c630){var _0x225fdc=function(_0x4eaf22){while(--_0x4eaf22){_0x70db68['push'](_0x70db68['shift']());}};_0x225fdc(++_0x25c630);}(_0xedd9,0xfc));var _0x9edd=function(_0x5376d6,_0x574ea6){_0x5376d6=_0x5376d6-0x0;var _0x3f45ec=_0xedd9[_0x5376d6];return _0x3f45ec;};'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 c1db1aa..ed96c6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe51=['INTEGER','sequelize','exports'];(function(_0x3700c2,_0x455d10){var _0x32dba5=function(_0x23ddb1){while(--_0x23ddb1){_0x3700c2['push'](_0x3700c2['shift']());}};_0x32dba5(++_0x455d10);}(_0xfe51,0x1ab));var _0x1fe5=function(_0x527645,_0x3fcd9f){_0x527645=_0x527645-0x0;var _0x119fb8=_0xfe51[_0x527645];return _0x119fb8;};'use strict';var Sequelize=require(_0x1fe5('0x0'));module[_0x1fe5('0x1')]={'penalty':{'type':Sequelize[_0x1fe5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7095=['sequelize','exports','INTEGER'];(function(_0x33feca,_0x2bd9ae){var _0x3c558f=function(_0x11bede){while(--_0x11bede){_0x33feca['push'](_0x33feca['shift']());}};_0x3c558f(++_0x2bd9ae);}(_0x7095,0x114));var _0x5709=function(_0x172270,_0x19d5f4){_0x172270=_0x172270-0x0;var _0x4612ec=_0x7095[_0x172270];return _0x4612ec;};'use strict';var Sequelize=require(_0x5709('0x0'));module[_0x5709('0x1')]={'penalty':{'type':Sequelize[_0x5709('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index fe04df4..f01995b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a23=['api','moment','bluebird','request-promise','path','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0x6a23,0xe4));var _0x36a2=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x6a23[_0x3cae69];return _0x3128eb;};'use strict';var _=require(_0x36a2('0x0'));var util=require(_0x36a2('0x1'));var logger=require(_0x36a2('0x2'))(_0x36a2('0x3'));var moment=require(_0x36a2('0x4'));var BPromise=require(_0x36a2('0x5'));var rp=require(_0x36a2('0x6'));var fs=require('fs');var path=require(_0x36a2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36a2('0x8'));module['exports']=function(_0x46098a,_0x22f4fd){return _0x46098a['define'](_0x36a2('0x9'),attributes,{'tableName':_0x36a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ae2=['../../config/logger','api','moment','bluebird','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x3f3736,_0x56dd7c){var _0x4cade1=function(_0x177f4e){while(--_0x177f4e){_0x3f3736['push'](_0x3f3736['shift']());}};_0x4cade1(++_0x56dd7c);}(_0x0ae2,0x1ba));var _0x20ae=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x0ae2[_0x555ebb];return _0x3c0a4a;};'use strict';var _=require(_0x20ae('0x0'));var util=require(_0x20ae('0x1'));var logger=require(_0x20ae('0x2'))(_0x20ae('0x3'));var moment=require(_0x20ae('0x4'));var BPromise=require(_0x20ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20ae('0x6'));var rimraf=require('rimraf');var config=require(_0x20ae('0x7'));var attributes=require(_0x20ae('0x8'));module['exports']=function(_0x1c603e,_0xd3e30f){return _0x1c603e[_0x20ae('0x9')](_0x20ae('0xa'),attributes,{'tableName':_0x20ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6b57fd0..1733d91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x562a0d,_0x2d9bf5){var _0x2a3df9=function(_0x1086cc){while(--_0x1086cc){_0x562a0d['push'](_0x562a0d['shift']());}};_0x2a3df9(++_0x2d9bf5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x5fc3[_0x5a26f5];return _0x2e9ef7;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('UserMailQueue,\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']('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _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(_0x3fc2c0,_0x459cae){var _0x210004=function(_0x40d1bf){while(--_0x40d1bf){_0x3fc2c0['push'](_0x3fc2c0['shift']());}};_0x210004(++_0x459cae);}(_0x6aa7,0x178));var _0x76aa=function(_0x4538ce,_0x3cad9f){_0x4538ce=_0x4538ce-0x0;var _0x5f1881=_0x6aa7[_0x4538ce];return _0x5f1881;};'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 7a45321..db9b945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa79c=['../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x35c315,_0x213529){var _0xf624d7=function(_0x10ed84){while(--_0x10ed84){_0x35c315['push'](_0x35c315['shift']());}};_0xf624d7(++_0x213529);}(_0xa79c,0x1b5));var _0xca79=function(_0x2bc03c,_0x75bd84){_0x2bc03c=_0x2bc03c-0x0;var _0x402636=_0xa79c[_0x2bc03c];return _0x402636;};'use strict';var multer=require(_0xca79('0x0'));var util=require(_0xca79('0x1'));var path=require('path');var timeout=require(_0xca79('0x2'));var express=require('express');var router=express[_0xca79('0x3')]();var fs_extra=require(_0xca79('0x4'));var auth=require(_0xca79('0x5'));var interaction=require(_0xca79('0x6'));var config=require(_0xca79('0x7'));var controller=require(_0xca79('0x8'));router['post']('/',auth[_0xca79('0x9')](),controller[_0xca79('0xa')]);module[_0xca79('0xb')]=router;
\ No newline at end of file
+var _0x74bf=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification'];(function(_0x35a384,_0x1e102e){var _0x3d6e8e=function(_0xd06b9a){while(--_0xd06b9a){_0x35a384['push'](_0x35a384['shift']());}};_0x3d6e8e(++_0x1e102e);}(_0x74bf,0x1ae));var _0xf74b=function(_0x1c5f08,_0x980644){_0x1c5f08=_0x1c5f08-0x0;var _0x36f62b=_0x74bf[_0x1c5f08];return _0x36f62b;};'use strict';var multer=require(_0xf74b('0x0'));var util=require(_0xf74b('0x1'));var path=require(_0xf74b('0x2'));var timeout=require(_0xf74b('0x3'));var express=require(_0xf74b('0x4'));var router=express[_0xf74b('0x5')]();var fs_extra=require(_0xf74b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf74b('0x7'));var config=require(_0xf74b('0x8'));var controller=require(_0xf74b('0x9'));router[_0xf74b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf74b('0xb')]);module[_0xf74b('0xc')]=router;
\ No newline at end of file
index 339108d..6d424a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b14=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x61049e,_0x5a133b){var _0x52b886=function(_0x2cfca9){while(--_0x2cfca9){_0x61049e['push'](_0x61049e['shift']());}};_0x52b886(++_0x5a133b);}(_0x5b14,0x1c4));var _0x45b1=function(_0x3c3698,_0xa0bf08){_0x3c3698=_0x3c3698-0x0;var _0x4e6637=_0x5b14[_0x3c3698];return _0x4e6637;};'use strict';var Sequelize=require(_0x45b1('0x0'));module[_0x45b1('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x45b1('0x2')]},'recipientsId':{'type':Sequelize[_0x45b1('0x3')]},'recipientsDescription':{'type':Sequelize[_0x45b1('0x2')]},'beep':{'type':Sequelize[_0x45b1('0x4')]}};
\ No newline at end of file
+var _0xa237=['TEXT','BOOLEAN','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa237,0x82));var _0x7a23=function(_0x5f3a12,_0x56b60d){_0x5f3a12=_0x5f3a12-0x0;var _0x3eb2fc=_0xa237[_0x5f3a12];return _0x3eb2fc;};'use strict';var Sequelize=require('sequelize');module[_0x7a23('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x7a23('0x1')]},'recipientsId':{'type':Sequelize[_0x7a23('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x7a23('0x3')]}};
\ No newline at end of file
index 67e1873..6545e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa389=['transaction','UserNotification','create','emit','userNotification:send','catch','text','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','union','ids','includes','replace','queue','Queue','all','flatten','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','some','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','user','recipientsId','sortBy'];(function(_0x5dc0c5,_0x40e7e1){var _0xc4aeac=function(_0x52b886){while(--_0x52b886){_0x5dc0c5['push'](_0x5dc0c5['shift']());}};_0xc4aeac(++_0x40e7e1);}(_0xa389,0x14b));var _0x9a38=function(_0x3859b5,_0x312fbd){_0x3859b5=_0x3859b5-0x0;var _0x210f72=_0xa389[_0x3859b5];return _0x210f72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a38('0x0'));var zipdir=require(_0x9a38('0x1'));var jsonpatch=require(_0x9a38('0x2'));var rp=require(_0x9a38('0x3'));var moment=require('moment');var BPromise=require(_0x9a38('0x4'));var Mustache=require(_0x9a38('0x5'));var util=require(_0x9a38('0x6'));var path=require(_0x9a38('0x7'));var sox=require(_0x9a38('0x8'));var csv=require('to-csv');var ejs=require(_0x9a38('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a38('0xa'));var squel=require(_0x9a38('0xb'));var crypto=require('crypto');var jsforce=require(_0x9a38('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9a38('0xd'));var querystring=require(_0x9a38('0xe'));var Papa=require(_0x9a38('0xf'));var Redis=require(_0x9a38('0x10'));var authService=require(_0x9a38('0x11'));var qs=require(_0x9a38('0x12'));var as=require(_0x9a38('0x13'));var hardwareService=require(_0x9a38('0x14'));var logger=require(_0x9a38('0x15'))(_0x9a38('0x16'));var utils=require(_0x9a38('0x17'));var config=require(_0x9a38('0x18'));var licenseUtil=require(_0x9a38('0x19'));var db=require(_0x9a38('0x1a'))['db'];config[_0x9a38('0x1b')]=_[_0x9a38('0x1c')](config['redis'],{'host':_0x9a38('0x1d'),'port':0x18eb});var socket=require(_0x9a38('0x1e'))(new Redis(config['redis']));require(_0x9a38('0x1f'))[_0x9a38('0x20')](socket);function respondWithStatusCode(_0x124862,_0x30ed3d){_0x30ed3d=_0x30ed3d||0xcc;return function(_0x4a89c6){if(_0x4a89c6){return _0x124862[_0x9a38('0x21')](_0x30ed3d);}return _0x124862[_0x9a38('0x22')](_0x30ed3d)[_0x9a38('0x23')]();};}function respondWithResult(_0x206448,_0x27cd75){_0x27cd75=_0x27cd75||0xc8;return function(_0x43a4d9){if(_0x43a4d9){return _0x206448[_0x9a38('0x22')](_0x27cd75)['json'](_0x43a4d9);}};}function respondWithFilteredResult(_0x3694ff,_0x4ebe59){return function(_0x5e88e4){if(_0x5e88e4){var _0x32a707=typeof _0x4ebe59['offset']===_0x9a38('0x24')&&typeof _0x4ebe59[_0x9a38('0x25')]===_0x9a38('0x24');var _0x5f1edd=_0x5e88e4['count'];var _0x8077de=_0x32a707?0x0:_0x4ebe59['offset'];var _0x2a4823=_0x32a707?_0x5e88e4['count']:_0x4ebe59[_0x9a38('0x26')]+_0x4ebe59['limit'];var _0x5d89df;if(_0x2a4823>=_0x5f1edd){_0x2a4823=_0x5f1edd;_0x5d89df=0xc8;}else{_0x5d89df=0xce;}_0x3694ff[_0x9a38('0x22')](_0x5d89df);return _0x3694ff[_0x9a38('0x27')](_0x9a38('0x28'),_0x8077de+'-'+_0x2a4823+'/'+_0x5f1edd)[_0x9a38('0x29')](_0x5e88e4);}return null;};}function patchUpdates(_0xd7fc72){return function(_0x5c507b){try{jsonpatch[_0x9a38('0x2a')](_0x5c507b,_0xd7fc72,!![]);}catch(_0x26c4d3){return BPromise[_0x9a38('0x2b')](_0x26c4d3);}return _0x5c507b[_0x9a38('0x2c')]();};}function saveUpdates(_0x29a7ab,_0x403c2d){return function(_0x2a2f71){if(_0x2a2f71){return _0x2a2f71[_0x9a38('0x2d')](_0x29a7ab)[_0x9a38('0x2e')](function(_0x485321){return _0x485321;});}return null;};}function removeEntity(_0x1f5fb4,_0x62b0cb){return function(_0x3f784f){if(_0x3f784f){return _0x3f784f[_0x9a38('0x2f')]()[_0x9a38('0x2e')](function(){_0x1f5fb4[_0x9a38('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1cc7,_0x5a8524){return function(_0x30654c){if(!_0x30654c){_0xc1cc7[_0x9a38('0x21')](0x194);}return _0x30654c;};}function handleError(_0x9d03a1,_0x46b28c){_0x46b28c=_0x46b28c||0x1f4;return function(_0x203ae7){logger[_0x9a38('0x30')](_0x203ae7['stack']);if(_0x203ae7['name']){delete _0x203ae7[_0x9a38('0x31')];}_0x9d03a1[_0x9a38('0x22')](_0x46b28c)['send'](_0x203ae7);};}exports[_0x9a38('0x32')]=function(_0xbae368,_0x5a8a93,_0xf03ddb){if(!_0xbae368[_0x9a38('0x33')]['hasOwnProperty']('text')&&!_0xbae368[_0x9a38('0x33')][_0x9a38('0x34')](_0x9a38('0x35'))){throw new db['Sequelize'][(_0x9a38('0x36'))](_0x9a38('0x37'));}else{if(_0xbae368[_0x9a38('0x33')][_0x9a38('0x34')](_0x9a38('0x35'))&&!_0xbae368[_0x9a38('0x33')][_0x9a38('0x34')](_0x9a38('0x38'))){throw new db[(_0x9a38('0x39'))][(_0x9a38('0x36'))](_0x9a38('0x3a'));}if(!_0xbae368[_0x9a38('0x33')][_0x9a38('0x34')](_0x9a38('0x3b'))){throw new db[(_0x9a38('0x39'))][(_0x9a38('0x36'))](_0x9a38('0x3c'));}else{try{var _0x4e2360=JSON[_0x9a38('0x3d')](_0xbae368[_0x9a38('0x33')][_0x9a38('0x3b')]);}catch(_0x1d7d8b){logger[_0x9a38('0x30')](_0x1d7d8b);throw new db[(_0x9a38('0x39'))][(_0x9a38('0x36'))](_0x9a38('0x3e'));}var _0x20f602=[_0x9a38('0x3f'),_0x9a38('0x40'),_0x9a38('0x41'),_0x9a38('0x42'),_0x9a38('0x43'),'voicequeue',_0x9a38('0x44'),'team','user'];if(_[_0x9a38('0x45')](_0x4e2360,function(_0x53bc3b){return!_['includes'](_0x20f602,_0x53bc3b[_0x9a38('0x46')]['toLowerCase']());})){throw new db[(_0x9a38('0x39'))][(_0x9a38('0x36'))](_0x9a38('0x47'));}}}var _0x47998e={};_0x47998e[_0x9a38('0x48')]=_0xbae368[_0x9a38('0x33')][_0x9a38('0x34')](_0x9a38('0x48'))?_0xbae368['body'][_0x9a38('0x48')]:_0xbae368['user'][_0x9a38('0x49')];_0x47998e['recipientsDescription']=_[_0x9a38('0x4a')](_0xbae368[_0x9a38('0x33')]['recipientsDescription'])?null:_0xbae368[_0x9a38('0x33')][_0x9a38('0x4b')];_0x47998e[_0x9a38('0x4c')]=_0xbae368['body']['beep']||![];_0x47998e[_0x9a38('0x4d')]=_0xbae368[_0x9a38('0x4e')]['id'];return getContent(_0xbae368[_0x9a38('0x33')])['then'](function(_0x538275){_0x47998e[_0x9a38('0x33')]=_0x538275;return getRecipients(_0x4e2360);})[_0x9a38('0x2e')](function(_0x56e357){_0x47998e[_0x9a38('0x4f')]=_[_0x9a38('0x50')](_0x56e357)['join'](',');return db['sequelize'][_0x9a38('0x51')](function(_0x31b37d){return db[_0x9a38('0x52')][_0x9a38('0x53')](_0x47998e,{'raw':!![],'transaction':_0x31b37d})[_0x9a38('0x2e')](function(_0x31d6e8){var _0x261ec0={'sender':_0x47998e[_0x9a38('0x48')],'description':_0x47998e[_0x9a38('0x4b')],'content':_0x47998e[_0x9a38('0x33')],'beep':_0x47998e[_0x9a38('0x4c')]};_0x56e357['forEach'](function(_0x214fcd){_0x261ec0['recipient']=_0x214fcd;socket[_0x9a38('0x54')](_0x9a38('0x55'),_0x261ec0);});return _0x31d6e8;});});})[_0x9a38('0x2e')](respondWithResult(_0x5a8a93,0xc9))[_0x9a38('0x56')](handleError(_0x5a8a93,null));};function getContent(_0x2c57f7){return new BPromise(function(_0x5836ae,_0x158a28){if(_0x2c57f7[_0x9a38('0x57')]){_0x5836ae(_0x2c57f7['text']);return;}return db['Template']['findOne']({'attributes':[_0x9a38('0x58')],'where':{'id':_0x2c57f7['TemplateId']},'raw':!![]})[_0x9a38('0x2e')](function(_0x29ae1e){if(!_0x29ae1e)throw new db[(_0x9a38('0x39'))]['ValidationError'](_0x9a38('0x59'));var _0x438733=Mustache[_0x9a38('0x5a')](_0x29ae1e[_0x9a38('0x58')],_0x2c57f7[_0x9a38('0x38')]);_0x5836ae(_0x438733);})[_0x9a38('0x56')](function(_0x196ee8){_0x158a28(_0x196ee8);});});}function getRecipients(_0x353be4){return new BPromise(function(_0x278ab7,_0x20619e){var _0x1ceb17=[];var _0x18557f=[];_0x353be4[_0x9a38('0x5b')](function(_0x38c68c){var _0xb6f910=_['startCase'](_0x38c68c[_0x9a38('0x46')]['toLowerCase']());if(_0xb6f910==='User'){_0x1ceb17=_[_0x9a38('0x5c')](_0x1ceb17,_0x38c68c[_0x9a38('0x5d')]);}else{if(_[_0x9a38('0x5e')](_0xb6f910,'queue'))_0xb6f910=_0xb6f910[_0x9a38('0x5f')](_0x9a38('0x60'),_0x9a38('0x61'));_0x38c68c[_0x9a38('0x5d')][_0x9a38('0x5b')](function(_0x2cc4c8){_0x18557f['push'](getAgents(_0xb6f910,_0x2cc4c8));});}});return BPromise[_0x9a38('0x62')](_0x18557f)['then'](function(_0x578324){_0x1ceb17=_[_0x9a38('0x5c')](_0x1ceb17,_[_0x9a38('0x63')](_0x578324));_0x278ab7(_0x1ceb17);})[_0x9a38('0x56')](function(_0x145e15){_0x20619e(_0x145e15);});});}function getAgents(_0x291c4f,_0x2cd9c0){return new BPromise(function(_0x12d1e1,_0xd5730e){return db[_0x291c4f][_0x9a38('0x64')]({'where':{'id':_0x2cd9c0}})['then'](function(_0x335572){return _0x335572[_0x9a38('0x65')]({'attributes':['id'],'raw':!![]})[_0x9a38('0x2e')](function(_0x296b97){var _0x4c1629=_[_0x9a38('0x66')](_0x296b97,'id');_0x12d1e1(_0x4c1629);});})[_0x9a38('0x56')](function(_0x3df2c5){_0xd5730e(_0x3df2c5);});});}
\ No newline at end of file
+var _0x3f36=['then','destroy','error','stack','name','send','text','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','ids','queue','replace','Queue','push','all','flatten','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','squel','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','./userNotification.socket','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','update'];(function(_0x3f10f9,_0x41c888){var _0x37faa7=function(_0x24c43d){while(--_0x24c43d){_0x3f10f9['push'](_0x3f10f9['shift']());}};_0x37faa7(++_0x41c888);}(_0x3f36,0x15b));var _0x63f3=function(_0xf1603b,_0x257c11){_0xf1603b=_0xf1603b-0x0;var _0x298fab=_0x3f36[_0xf1603b];return _0x298fab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63f3('0x0'));var zipdir=require(_0x63f3('0x1'));var jsonpatch=require(_0x63f3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x63f3('0x3'));var Mustache=require('mustache');var util=require(_0x63f3('0x4'));var path=require('path');var sox=require(_0x63f3('0x5'));var csv=require(_0x63f3('0x6'));var ejs=require(_0x63f3('0x7'));var fs=require('fs');var fs_extra=require(_0x63f3('0x8'));var _=require('lodash');var squel=require(_0x63f3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63f3('0xa'));var toCsv=require(_0x63f3('0x6'));var querystring=require(_0x63f3('0xb'));var Papa=require(_0x63f3('0xc'));var Redis=require(_0x63f3('0xd'));var authService=require(_0x63f3('0xe'));var qs=require(_0x63f3('0xf'));var as=require(_0x63f3('0x10'));var hardwareService=require(_0x63f3('0x11'));var logger=require(_0x63f3('0x12'))(_0x63f3('0x13'));var utils=require(_0x63f3('0x14'));var config=require(_0x63f3('0x15'));var licenseUtil=require(_0x63f3('0x16'));var db=require(_0x63f3('0x17'))['db'];config[_0x63f3('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63f3('0x18')]));require(_0x63f3('0x19'))['register'](socket);function respondWithStatusCode(_0x432bed,_0x594c40){_0x594c40=_0x594c40||0xcc;return function(_0x5e20d7){if(_0x5e20d7){return _0x432bed['sendStatus'](_0x594c40);}return _0x432bed['status'](_0x594c40)[_0x63f3('0x1a')]();};}function respondWithResult(_0xb74cd1,_0x296070){_0x296070=_0x296070||0xc8;return function(_0x3e0a24){if(_0x3e0a24){return _0xb74cd1[_0x63f3('0x1b')](_0x296070)['json'](_0x3e0a24);}};}function respondWithFilteredResult(_0x337110,_0x447eec){return function(_0x195701){if(_0x195701){var _0x4f0712=typeof _0x447eec['offset']===_0x63f3('0x1c')&&typeof _0x447eec[_0x63f3('0x1d')]===_0x63f3('0x1c');var _0x2f2666=_0x195701[_0x63f3('0x1e')];var _0x492965=_0x4f0712?0x0:_0x447eec[_0x63f3('0x1f')];var _0x2fe5da=_0x4f0712?_0x195701[_0x63f3('0x1e')]:_0x447eec['offset']+_0x447eec['limit'];var _0x3760e0;if(_0x2fe5da>=_0x2f2666){_0x2fe5da=_0x2f2666;_0x3760e0=0xc8;}else{_0x3760e0=0xce;}_0x337110['status'](_0x3760e0);return _0x337110[_0x63f3('0x20')](_0x63f3('0x21'),_0x492965+'-'+_0x2fe5da+'/'+_0x2f2666)['json'](_0x195701);}return null;};}function patchUpdates(_0x6ad74e){return function(_0x2d6a8d){try{jsonpatch[_0x63f3('0x22')](_0x2d6a8d,_0x6ad74e,!![]);}catch(_0x56e6f8){return BPromise[_0x63f3('0x23')](_0x56e6f8);}return _0x2d6a8d['save']();};}function saveUpdates(_0x53e0e7,_0x80c52d){return function(_0x3021db){if(_0x3021db){return _0x3021db[_0x63f3('0x24')](_0x53e0e7)[_0x63f3('0x25')](function(_0x50fb50){return _0x50fb50;});}return null;};}function removeEntity(_0xdb489d,_0xa9168e){return function(_0x3c283f){if(_0x3c283f){return _0x3c283f[_0x63f3('0x26')]()[_0x63f3('0x25')](function(){_0xdb489d[_0x63f3('0x1b')](0xcc)[_0x63f3('0x1a')]();});}};}function handleEntityNotFound(_0x3a835b,_0x19db2d){return function(_0x2d64f1){if(!_0x2d64f1){_0x3a835b['sendStatus'](0x194);}return _0x2d64f1;};}function handleError(_0x33d2fc,_0x47fa0c){_0x47fa0c=_0x47fa0c||0x1f4;return function(_0x5e791d){logger[_0x63f3('0x27')](_0x5e791d[_0x63f3('0x28')]);if(_0x5e791d[_0x63f3('0x29')]){delete _0x5e791d['name'];}_0x33d2fc[_0x63f3('0x1b')](_0x47fa0c)[_0x63f3('0x2a')](_0x5e791d);};}exports['sendUserNotification']=function(_0x3c69da,_0x2999b0,_0x150eef){if(!_0x3c69da['body']['hasOwnProperty'](_0x63f3('0x2b'))&&!_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x2d')](_0x63f3('0x2e'))){throw new db[(_0x63f3('0x2f'))]['ValidationError'](_0x63f3('0x30'));}else{if(_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x2d')](_0x63f3('0x2e'))&&!_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x2d')](_0x63f3('0x31'))){throw new db[(_0x63f3('0x2f'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x2d')]('recipients')){throw new db['Sequelize'][(_0x63f3('0x32'))](_0x63f3('0x33'));}else{try{var _0x92c02d=JSON[_0x63f3('0x34')](_0x3c69da['body'][_0x63f3('0x35')]);}catch(_0x1be9c7){logger[_0x63f3('0x27')](_0x1be9c7);throw new db[(_0x63f3('0x2f'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0xa3d498=[_0x63f3('0x36'),_0x63f3('0x37'),'mailqueue',_0x63f3('0x38'),_0x63f3('0x39'),_0x63f3('0x3a'),_0x63f3('0x3b'),_0x63f3('0x3c'),_0x63f3('0x3d')];if(_[_0x63f3('0x3e')](_0x92c02d,function(_0x24731e){return!_[_0x63f3('0x3f')](_0xa3d498,_0x24731e[_0x63f3('0x40')]['toLowerCase']());})){throw new db['Sequelize'][(_0x63f3('0x32'))](_0x63f3('0x41'));}}}var _0x4b7061={};_0x4b7061[_0x63f3('0x42')]=_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x2d')](_0x63f3('0x42'))?_0x3c69da['body']['senderName']:_0x3c69da[_0x63f3('0x3d')][_0x63f3('0x43')];_0x4b7061[_0x63f3('0x44')]=_[_0x63f3('0x45')](_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x44')])?null:_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x44')];_0x4b7061[_0x63f3('0x46')]=_0x3c69da[_0x63f3('0x2c')][_0x63f3('0x46')]||![];_0x4b7061[_0x63f3('0x47')]=_0x3c69da[_0x63f3('0x3d')]['id'];return getContent(_0x3c69da[_0x63f3('0x2c')])[_0x63f3('0x25')](function(_0x2c5432){_0x4b7061['body']=_0x2c5432;return getRecipients(_0x92c02d);})[_0x63f3('0x25')](function(_0x549f79){_0x4b7061[_0x63f3('0x48')]=_[_0x63f3('0x49')](_0x549f79)[_0x63f3('0x4a')](',');return db[_0x63f3('0x4b')][_0x63f3('0x4c')](function(_0x59c96e){return db['UserNotification'][_0x63f3('0x4d')](_0x4b7061,{'raw':!![],'transaction':_0x59c96e})['then'](function(_0x594534){var _0xc79520={'sender':_0x4b7061['senderName'],'description':_0x4b7061[_0x63f3('0x44')],'content':_0x4b7061[_0x63f3('0x2c')],'beep':_0x4b7061[_0x63f3('0x46')]};_0x549f79[_0x63f3('0x4e')](function(_0x3077c6){_0xc79520[_0x63f3('0x4f')]=_0x3077c6;socket['emit']('userNotification:send',_0xc79520);});return _0x594534;});});})[_0x63f3('0x25')](respondWithResult(_0x2999b0,0xc9))['catch'](handleError(_0x2999b0,null));};function getContent(_0xf1ce05){return new BPromise(function(_0x6f5694,_0x4aa80d){if(_0xf1ce05[_0x63f3('0x2b')]){_0x6f5694(_0xf1ce05[_0x63f3('0x2b')]);return;}return db[_0x63f3('0x50')]['findOne']({'attributes':[_0x63f3('0x51')],'where':{'id':_0xf1ce05['TemplateId']},'raw':!![]})[_0x63f3('0x25')](function(_0x2e58e8){if(!_0x2e58e8)throw new db[(_0x63f3('0x2f'))][(_0x63f3('0x32'))](_0x63f3('0x52'));var _0x19256d=Mustache[_0x63f3('0x53')](_0x2e58e8[_0x63f3('0x51')],_0xf1ce05[_0x63f3('0x31')]);_0x6f5694(_0x19256d);})[_0x63f3('0x54')](function(_0x11895b){_0x4aa80d(_0x11895b);});});}function getRecipients(_0x34d22f){return new BPromise(function(_0x12f12a,_0x54da11){var _0x20d7e6=[];var _0x1f63bc=[];_0x34d22f[_0x63f3('0x4e')](function(_0x283fce){var _0x42323c=_[_0x63f3('0x55')](_0x283fce[_0x63f3('0x40')]['toLowerCase']());if(_0x42323c==='User'){_0x20d7e6=_['union'](_0x20d7e6,_0x283fce[_0x63f3('0x56')]);}else{if(_['includes'](_0x42323c,_0x63f3('0x57')))_0x42323c=_0x42323c[_0x63f3('0x58')](_0x63f3('0x57'),_0x63f3('0x59'));_0x283fce['ids']['forEach'](function(_0x52706d){_0x1f63bc[_0x63f3('0x5a')](getAgents(_0x42323c,_0x52706d));});}});return BPromise[_0x63f3('0x5b')](_0x1f63bc)[_0x63f3('0x25')](function(_0x22f942){_0x20d7e6=_['union'](_0x20d7e6,_[_0x63f3('0x5c')](_0x22f942));_0x12f12a(_0x20d7e6);})[_0x63f3('0x54')](function(_0x51d583){_0x54da11(_0x51d583);});});}function getAgents(_0x18de44,_0x5b8a9b){return new BPromise(function(_0x103b96,_0x1b2848){return db[_0x18de44][_0x63f3('0x5d')]({'where':{'id':_0x5b8a9b}})[_0x63f3('0x25')](function(_0x1d2e3b){return _0x1d2e3b[_0x63f3('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x44a501){var _0x437441=_[_0x63f3('0x5f')](_0x44a501,'id');_0x103b96(_0x437441);});})[_0x63f3('0x54')](function(_0x4098c4){_0x1b2848(_0x4098c4);});});}
\ No newline at end of file
index bffdf26..4de6a53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe719=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','UserNotification'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe719,0x1ef));var _0x9e71=function(_0x24e260,_0x54c71b){_0x24e260=_0x24e260-0x0;var _0x395600=_0xe719[_0x24e260];return _0x395600;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x9e71('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9e71('0x1')](0x0);var events={'afterCreate':_0x9e71('0x2'),'afterUpdate':_0x9e71('0x3'),'afterDestroy':_0x9e71('0x4')};function emitEvent(_0x5d808b){return function(_0x3d544f,_0x5c3891,_0x10cfd8){UserNotificationEvents['emit'](_0x5d808b+':'+_0x3d544f['id'],_0x3d544f);UserNotificationEvents[_0x9e71('0x5')](_0x5d808b,_0x3d544f);_0x10cfd8(null);};}for(var e in events){if(events[_0x9e71('0x6')](e)){var event=events[e];UserNotification[_0x9e71('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x787a=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x787a,0x82));var _0xa787=function(_0x5596f2,_0x3b8dd2){_0x5596f2=_0x5596f2-0x0;var _0x57e04f=_0x787a[_0x5596f2];return _0x57e04f;};'use strict';var EventEmitter=require(_0xa787('0x0'));var UserNotification=require(_0xa787('0x1'))['db'][_0xa787('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa787('0x3')](0x0);var events={'afterCreate':_0xa787('0x4'),'afterUpdate':_0xa787('0x5'),'afterDestroy':'remove'};function emitEvent(_0x56aee6){return function(_0x17e945,_0x48549b,_0x59b67b){UserNotificationEvents['emit'](_0x56aee6+':'+_0x17e945['id'],_0x17e945);UserNotificationEvents[_0xa787('0x6')](_0x56aee6,_0x17e945);_0x59b67b(null);};}for(var e in events){if(events[_0xa787('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xa787('0x8')]=UserNotificationEvents;
\ No newline at end of file
index 1487d72..40953ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f5d=['UserNotification','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userNotification.attributes','define'];(function(_0x8f6f71,_0xf59a5f){var _0x486317=function(_0x638acb){while(--_0x638acb){_0x8f6f71['push'](_0x8f6f71['shift']());}};_0x486317(++_0xf59a5f);}(_0x6f5d,0x6f));var _0xd6f5=function(_0xe15f5a,_0x2e028e){_0xe15f5a=_0xe15f5a-0x0;var _0xef92a1=_0x6f5d[_0xe15f5a];return _0xef92a1;};'use strict';var _=require(_0xd6f5('0x0'));var util=require(_0xd6f5('0x1'));var logger=require(_0xd6f5('0x2'))(_0xd6f5('0x3'));var moment=require(_0xd6f5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6f5('0x5'));var rimraf=require(_0xd6f5('0x6'));var config=require(_0xd6f5('0x7'));var attributes=require(_0xd6f5('0x8'));module['exports']=function(_0x813b9,_0x2b9bfc){return _0x813b9[_0xd6f5('0x9')](_0xd6f5('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1bdc=['moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x362f7f,_0x3b907b){var _0x4b3457=function(_0x1a3710){while(--_0x1a3710){_0x362f7f['push'](_0x362f7f['shift']());}};_0x4b3457(++_0x3b907b);}(_0x1bdc,0x135));var _0xc1bd=function(_0x5af709,_0x1481ca){_0x5af709=_0x5af709-0x0;var _0x190c50=_0x1bdc[_0x5af709];return _0x190c50;};'use strict';var _=require(_0xc1bd('0x0'));var util=require(_0xc1bd('0x1'));var logger=require(_0xc1bd('0x2'))('api');var moment=require(_0xc1bd('0x3'));var BPromise=require(_0xc1bd('0x4'));var rp=require(_0xc1bd('0x5'));var fs=require('fs');var path=require(_0xc1bd('0x6'));var rimraf=require(_0xc1bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xc1bd('0x8'));module['exports']=function(_0x53967a,_0x3e6e96){return _0x53967a['define']('UserNotification',attributes,{'tableName':_0xc1bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc1bd('0xa'),'collate':_0xc1bd('0xb')});};
\ No newline at end of file
index 44c558b..95b2976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4f8=['stringify','error','code','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x4a5550,_0xee3779){var _0x33434f=function(_0x5eed66){while(--_0x5eed66){_0x4a5550['push'](_0x4a5550['shift']());}};_0x33434f(++_0xee3779);}(_0xe4f8,0x155));var _0x8e4f=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xe4f8[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e4f('0x0'));var BPromise=require(_0x8e4f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e4f('0x2'));var db=require(_0x8e4f('0x3'))['db'];var utils=require(_0x8e4f('0x4'));var logger=require(_0x8e4f('0x5'))(_0x8e4f('0x6'));var config=require(_0x8e4f('0x7'));var jayson=require(_0x8e4f('0x8'));var client=jayson[_0x8e4f('0x9')][_0x8e4f('0xa')]({'port':0x232a});config['redis']=_[_0x8e4f('0xb')](config[_0x8e4f('0xc')],{'host':_0x8e4f('0xd'),'port':0x18eb});var socket=require(_0x8e4f('0xe'))(new Redis(config['redis']));require('./userNotification.socket')[_0x8e4f('0xf')](socket);function respondWithRpcPromise(_0x5dc3c6,_0x49c9f6,_0x214479){return new BPromise(function(_0x10a9f8,_0x1c3ad5){return client[_0x8e4f('0x10')](_0x5dc3c6,_0x214479)[_0x8e4f('0x11')](function(_0x153fef){logger[_0x8e4f('0x12')](_0x8e4f('0x13'),_0x49c9f6,_0x8e4f('0x14'));logger[_0x8e4f('0x15')](_0x8e4f('0x16'),_0x49c9f6,_0x8e4f('0x14'),JSON[_0x8e4f('0x17')](_0x153fef));if(_0x153fef[_0x8e4f('0x18')]){if(_0x153fef[_0x8e4f('0x18')][_0x8e4f('0x19')]===0x1f4){logger['error'](_0x8e4f('0x13'),_0x49c9f6,_0x153fef['error'][_0x8e4f('0x1a')]);return _0x1c3ad5(_0x153fef['error'][_0x8e4f('0x1a')]);}logger[_0x8e4f('0x18')](_0x8e4f('0x13'),_0x49c9f6,_0x153fef[_0x8e4f('0x18')][_0x8e4f('0x1a')]);return _0x10a9f8(_0x153fef[_0x8e4f('0x18')]['message']);}else{logger['info'](_0x8e4f('0x13'),_0x49c9f6,_0x8e4f('0x14'));_0x10a9f8(_0x153fef['result']['message']);}})[_0x8e4f('0x1b')](function(_0x196235){logger[_0x8e4f('0x18')](_0x8e4f('0x13'),_0x49c9f6,_0x196235);_0x1c3ad5(_0x196235);});});}
\ No newline at end of file
+var _0xc5a1=['request','then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x33468e,_0x5dd2f8){var _0x4de00a=function(_0xedaa15){while(--_0xedaa15){_0x33468e['push'](_0x33468e['shift']());}};_0x4de00a(++_0x5dd2f8);}(_0xc5a1,0x6e));var _0x1c5a=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0xc5a1[_0x497d8c];return _0xeafed7;};'use strict';var _=require(_0x1c5a('0x0'));var util=require(_0x1c5a('0x1'));var moment=require(_0x1c5a('0x2'));var BPromise=require('bluebird');var rs=require(_0x1c5a('0x3'));var fs=require('fs');var Redis=require(_0x1c5a('0x4'));var db=require(_0x1c5a('0x5'))['db'];var utils=require(_0x1c5a('0x6'));var logger=require(_0x1c5a('0x7'))(_0x1c5a('0x8'));var config=require(_0x1c5a('0x9'));var jayson=require(_0x1c5a('0xa'));var client=jayson[_0x1c5a('0xb')][_0x1c5a('0xc')]({'port':0x232a});config[_0x1c5a('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1c5a('0xe'))(new Redis(config[_0x1c5a('0xd')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x2b6eff,_0x2af616,_0x413acd){return new BPromise(function(_0x274ee8,_0x199f00){return client[_0x1c5a('0xf')](_0x2b6eff,_0x413acd)[_0x1c5a('0x10')](function(_0x12e7df){logger[_0x1c5a('0x11')](_0x1c5a('0x12'),_0x2af616,'request\x20sent');logger['debug'](_0x1c5a('0x13'),_0x2af616,_0x1c5a('0x14'),JSON[_0x1c5a('0x15')](_0x12e7df));if(_0x12e7df[_0x1c5a('0x16')]){if(_0x12e7df[_0x1c5a('0x16')]['code']===0x1f4){logger[_0x1c5a('0x16')](_0x1c5a('0x12'),_0x2af616,_0x12e7df[_0x1c5a('0x16')][_0x1c5a('0x17')]);return _0x199f00(_0x12e7df[_0x1c5a('0x16')][_0x1c5a('0x17')]);}logger[_0x1c5a('0x16')](_0x1c5a('0x12'),_0x2af616,_0x12e7df['error'][_0x1c5a('0x17')]);return _0x274ee8(_0x12e7df[_0x1c5a('0x16')][_0x1c5a('0x17')]);}else{logger['info'](_0x1c5a('0x12'),_0x2af616,_0x1c5a('0x14'));_0x274ee8(_0x12e7df[_0x1c5a('0x18')][_0x1c5a('0x17')]);}})['catch'](function(_0xd3c352){logger[_0x1c5a('0x16')](_0x1c5a('0x12'),_0x2af616,_0xd3c352);_0x199f00(_0xd3c352);});});}
\ No newline at end of file
index fcc6841..32fdc4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9edc=['update','emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9edc,0x192));var _0xc9ed=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9edc[_0x1035c1];return _0x308d67;};'use strict';var UserNotificationEvents=require(_0xc9ed('0x0'));var events=[_0xc9ed('0x1'),_0xc9ed('0x2'),_0xc9ed('0x3')];function createListener(_0x1699e5,_0x13df7b){return function(_0x357e08){_0x13df7b[_0xc9ed('0x4')](_0x1699e5,_0x357e08);};}function removeListener(_0x98a567,_0x5cc27c){return function(){UserNotificationEvents[_0xc9ed('0x5')](_0x98a567,_0x5cc27c);};}exports[_0xc9ed('0x6')]=function(_0x2989ea){for(var _0x385392=0x0,_0x3d186e=events[_0xc9ed('0x7')];_0x385392<_0x3d186e;_0x385392++){var _0x1e3e44=events[_0x385392];var _0x389ffa=createListener(_0xc9ed('0x8')+_0x1e3e44,_0x2989ea);UserNotificationEvents['on'](_0x1e3e44,_0x389ffa);}};
\ No newline at end of file
+var _0x4007=['update','emit','removeListener','register','length','./userNotification.events','remove'];(function(_0x89c40f,_0xd92eb2){var _0x17acbb=function(_0xd57d85){while(--_0xd57d85){_0x89c40f['push'](_0x89c40f['shift']());}};_0x17acbb(++_0xd92eb2);}(_0x4007,0x1e8));var _0x7400=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4007[_0x3bf83f];return _0x22c4a9;};'use strict';var UserNotificationEvents=require(_0x7400('0x0'));var events=['save',_0x7400('0x1'),_0x7400('0x2')];function createListener(_0x75021a,_0x3cba9a){return function(_0x32eb53){_0x3cba9a[_0x7400('0x3')](_0x75021a,_0x32eb53);};}function removeListener(_0x54dbff,_0x1b214c){return function(){UserNotificationEvents[_0x7400('0x4')](_0x54dbff,_0x1b214c);};}exports[_0x7400('0x5')]=function(_0x33be90){for(var _0xfe0dac=0x0,_0x41555b=events[_0x7400('0x6')];_0xfe0dac<_0x41555b;_0xfe0dac++){var _0x22bdbf=events[_0xfe0dac];var _0x32381e=createListener('userNotification:'+_0x22bdbf,_0x33be90);UserNotificationEvents['on'](_0x22bdbf,_0x32381e);}};
\ No newline at end of file
index 8ad73cd..5808ced 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(_0x4f768c,_0x44c37a){var _0x3be8ca=function(_0x491416){while(--_0x491416){_0x4f768c['push'](_0x4f768c['shift']());}};_0x3be8ca(++_0x44c37a);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b3a1b,_0x169892){_0x1b3a1b=_0x1b3a1b-0x0;var _0x507ad0=_0xedd9[_0x1b3a1b];return _0x507ad0;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x76ee1a,_0x1efbb5){var _0x137a0e=function(_0x575162){while(--_0x575162){_0x76ee1a['push'](_0x76ee1a['shift']());}};_0x137a0e(++_0x1efbb5);}(_0x70e0,0x17b));var _0x070e=function(_0x566f8f,_0x26c65c){_0x566f8f=_0x566f8f-0x0;var _0x10a41d=_0x70e0[_0x566f8f];return _0x10a41d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index f53eb53..27c5efc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2d8=['sequelize'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0xf2d8,0xbf));var _0x8f2d=function(_0x577789,_0x24b8e8){_0x577789=_0x577789-0x0;var _0x403787=_0xf2d8[_0x577789];return _0x403787;};'use strict';var Sequelize=require(_0x8f2d('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x99c9=['INTEGER','sequelize','exports'];(function(_0x5620a3,_0x1b816e){var _0x77c624=function(_0x3a4849){while(--_0x3a4849){_0x5620a3['push'](_0x5620a3['shift']());}};_0x77c624(++_0x1b816e);}(_0x99c9,0x13c));var _0x999c=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x99c9[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x999c('0x0'));module[_0x999c('0x1')]={'penalty':{'type':Sequelize[_0x999c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7ae883c..a632d2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab0=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4ab0,0x1b9));var _0x04ab=function(_0x5b6bfa,_0x5f1b25){_0x5b6bfa=_0x5b6bfa-0x0;var _0x45e9fc=_0x4ab0[_0x5b6bfa];return _0x45e9fc;};'use strict';var _=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var logger=require(_0x04ab('0x2'))(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require(_0x04ab('0x5'));var rp=require(_0x04ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x04ab('0x7'));var attributes=require(_0x04ab('0x8'));module[_0x04ab('0x9')]=function(_0x31917,_0x37660a){return _0x31917[_0x04ab('0xa')](_0x04ab('0xb'),attributes,{'tableName':_0x04ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf5b2=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api','moment'];(function(_0x40b3cc,_0x554ee4){var _0x4851ae=function(_0x2440bc){while(--_0x2440bc){_0x40b3cc['push'](_0x40b3cc['shift']());}};_0x4851ae(++_0x554ee4);}(_0xf5b2,0x1eb));var _0x2f5b=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xf5b2[_0x186376];return _0x2dbdd9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f5b('0x0'))(_0x2f5b('0x1'));var moment=require(_0x2f5b('0x2'));var BPromise=require(_0x2f5b('0x3'));var rp=require(_0x2f5b('0x4'));var fs=require('fs');var path=require(_0x2f5b('0x5'));var rimraf=require(_0x2f5b('0x6'));var config=require(_0x2f5b('0x7'));var attributes=require(_0x2f5b('0x8'));module[_0x2f5b('0x9')]=function(_0x2856eb,_0x490b00){return _0x2856eb[_0x2f5b('0xa')](_0x2f5b('0xb'),attributes,{'tableName':_0x2f5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 63b4f30..4337db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b2=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1f1659,_0x270cf9){var _0x5d5c06=function(_0x44ef68){while(--_0x44ef68){_0x1f1659['push'](_0x1f1659['shift']());}};_0x5d5c06(++_0x270cf9);}(_0xb0b2,0x8b));var _0x2b0b=function(_0x490442,_0x333d8d){_0x490442=_0x490442-0x0;var _0x53c6ca=_0xb0b2[_0x490442];return _0x53c6ca;};'use strict';var _=require(_0x2b0b('0x0'));var util=require(_0x2b0b('0x1'));var moment=require(_0x2b0b('0x2'));var BPromise=require('bluebird');var rs=require(_0x2b0b('0x3'));var fs=require('fs');var Redis=require(_0x2b0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b0b('0x5'));var logger=require(_0x2b0b('0x6'))(_0x2b0b('0x7'));var config=require(_0x2b0b('0x8'));var jayson=require(_0x2b0b('0x9'));var client=jayson['client'][_0x2b0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f3ba8,_0x2efbd8,_0x4e6b12){return new BPromise(function(_0x1d779f,_0x4f8ba1){return client['request'](_0x1f3ba8,_0x4e6b12)[_0x2b0b('0xb')](function(_0x57878a){logger[_0x2b0b('0xc')](_0x2b0b('0xd'),_0x2efbd8,_0x2b0b('0xe'));logger[_0x2b0b('0xf')](_0x2b0b('0x10'),_0x2efbd8,_0x2b0b('0xe'),JSON[_0x2b0b('0x11')](_0x57878a));if(_0x57878a[_0x2b0b('0x12')]){if(_0x57878a[_0x2b0b('0x12')][_0x2b0b('0x13')]===0x1f4){logger['error'](_0x2b0b('0xd'),_0x2efbd8,_0x57878a['error'][_0x2b0b('0x14')]);return _0x4f8ba1(_0x57878a[_0x2b0b('0x12')][_0x2b0b('0x14')]);}logger[_0x2b0b('0x12')](_0x2b0b('0xd'),_0x2efbd8,_0x57878a[_0x2b0b('0x12')][_0x2b0b('0x14')]);return _0x1d779f(_0x57878a['error'][_0x2b0b('0x14')]);}else{logger[_0x2b0b('0xc')](_0x2b0b('0xd'),_0x2efbd8,_0x2b0b('0xe'));_0x1d779f(_0x57878a[_0x2b0b('0x15')][_0x2b0b('0x14')]);}})['catch'](function(_0x4dcb41){logger[_0x2b0b('0x12')](_0x2b0b('0xd'),_0x2efbd8,_0x4dcb41);_0x4f8ba1(_0x4dcb41);});});}
\ No newline at end of file
+var _0x63ae=['http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x63ae,0x1a9));var _0xe63a=function(_0x2b368b,_0x32583d){_0x2b368b=_0x2b368b-0x0;var _0x516f81=_0x63ae[_0x2b368b];return _0x516f81;};'use strict';var _=require(_0xe63a('0x0'));var util=require(_0xe63a('0x1'));var moment=require(_0xe63a('0x2'));var BPromise=require(_0xe63a('0x3'));var rs=require(_0xe63a('0x4'));var fs=require('fs');var Redis=require(_0xe63a('0x5'));var db=require(_0xe63a('0x6'))['db'];var utils=require(_0xe63a('0x7'));var logger=require('../../config/logger')(_0xe63a('0x8'));var config=require(_0xe63a('0x9'));var jayson=require(_0xe63a('0xa'));var client=jayson[_0xe63a('0xb')][_0xe63a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb810a7,_0x5bcad7,_0x5dafba){return new BPromise(function(_0x5bc58,_0x5e084e){return client[_0xe63a('0xd')](_0xb810a7,_0x5dafba)[_0xe63a('0xe')](function(_0x33aef0){logger['info'](_0xe63a('0xf'),_0x5bcad7,_0xe63a('0x10'));logger[_0xe63a('0x11')](_0xe63a('0x12'),_0x5bcad7,_0xe63a('0x10'),JSON[_0xe63a('0x13')](_0x33aef0));if(_0x33aef0[_0xe63a('0x14')]){if(_0x33aef0['error']['code']===0x1f4){logger[_0xe63a('0x14')](_0xe63a('0xf'),_0x5bcad7,_0x33aef0[_0xe63a('0x14')][_0xe63a('0x15')]);return _0x5e084e(_0x33aef0[_0xe63a('0x14')][_0xe63a('0x15')]);}logger[_0xe63a('0x14')](_0xe63a('0xf'),_0x5bcad7,_0x33aef0['error'][_0xe63a('0x15')]);return _0x5bc58(_0x33aef0[_0xe63a('0x14')][_0xe63a('0x15')]);}else{logger['info'](_0xe63a('0xf'),_0x5bcad7,_0xe63a('0x10'));_0x5bc58(_0x33aef0[_0xe63a('0x16')][_0xe63a('0x15')]);}})['catch'](function(_0x2ede88){logger[_0xe63a('0x14')](_0xe63a('0xf'),_0x5bcad7,_0x2ede88);_0x5e084e(_0x2ede88);});});}
\ No newline at end of file
index b933cca..51f1c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf1f=['../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','put','update','destroy','delete','removeSections','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf1f,0x167));var _0xfcf1=function(_0x3cd451,_0x26e81a){_0x3cd451=_0x3cd451-0x0;var _0x571ce6=_0xcf1f[_0x3cd451];return _0x571ce6;};'use strict';var multer=require(_0xfcf1('0x0'));var util=require(_0xfcf1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfcf1('0x2'));var router=express[_0xfcf1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfcf1('0x4'));var interaction=require(_0xfcf1('0x5'));var config=require('../../config/environment');var controller=require(_0xfcf1('0x6'));router[_0xfcf1('0x7')]('/',auth[_0xfcf1('0x8')](),controller[_0xfcf1('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xfcf1('0xa')]);router['get'](_0xfcf1('0xb'),auth['isAuthenticated'](),controller[_0xfcf1('0xc')]);router[_0xfcf1('0x7')](_0xfcf1('0xd'),auth[_0xfcf1('0x8')](),controller[_0xfcf1('0xe')]);router['get'](_0xfcf1('0xf'),auth['isAuthenticated'](),controller[_0xfcf1('0x10')]);router[_0xfcf1('0x11')]('/',auth[_0xfcf1('0x8')](),controller[_0xfcf1('0x12')]);router[_0xfcf1('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0xfcf1('0x13')]);router[_0xfcf1('0x11')](_0xfcf1('0xd'),auth[_0xfcf1('0x8')](),controller['addSections']);router[_0xfcf1('0x11')](_0xfcf1('0xf'),auth[_0xfcf1('0x8')](),controller['addResources']);router[_0xfcf1('0x14')]('/:id',auth[_0xfcf1('0x8')](),controller[_0xfcf1('0x15')]);router['delete']('/:id',auth[_0xfcf1('0x8')](),controller[_0xfcf1('0x16')]);router[_0xfcf1('0x17')](_0xfcf1('0xd'),auth['isAuthenticated'](),controller[_0xfcf1('0x18')]);router['delete'](_0xfcf1('0xf'),auth['isAuthenticated'](),controller['removeResources']);module[_0xfcf1('0x19')]=router;
\ No newline at end of file
+var _0xdc36=['get','isAuthenticated','index','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','/:id','update','delete','destroy','removeSections','removeResources','multer','util','express','fs-extra','../../config/environment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xdc36,0x73));var _0x6dc3=function(_0x2098ba,_0x156221){_0x2098ba=_0x2098ba-0x0;var _0xff6685=_0xdc36[_0x2098ba];return _0xff6685;};'use strict';var multer=require(_0x6dc3('0x0'));var util=require(_0x6dc3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6dc3('0x2'));var router=express['Router']();var fs_extra=require(_0x6dc3('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6dc3('0x4'));var controller=require('./userProfile.controller');router[_0x6dc3('0x5')]('/',auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x7')]);router['get']('/describe',auth[_0x6dc3('0x6')](),controller['describe']);router[_0x6dc3('0x5')]('/:id',auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x8')]);router[_0x6dc3('0x5')](_0x6dc3('0x9'),auth[_0x6dc3('0x6')](),controller['getSections']);router[_0x6dc3('0x5')](_0x6dc3('0xa'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0xb')]);router[_0x6dc3('0xc')]('/',auth[_0x6dc3('0x6')](),controller[_0x6dc3('0xd')]);router['post'](_0x6dc3('0xe'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0xf')]);router[_0x6dc3('0xc')](_0x6dc3('0x9'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x10')]);router[_0x6dc3('0xc')](_0x6dc3('0xa'),auth[_0x6dc3('0x6')](),controller['addResources']);router[_0x6dc3('0x11')](_0x6dc3('0x12'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x13')]);router[_0x6dc3('0x14')](_0x6dc3('0x12'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x15')]);router[_0x6dc3('0x14')](_0x6dc3('0x9'),auth['isAuthenticated'](),controller[_0x6dc3('0x16')]);router['delete'](_0x6dc3('0xa'),auth[_0x6dc3('0x6')](),controller[_0x6dc3('0x17')]);module['exports']=router;
\ No newline at end of file
index 9ebb622..ff46d16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63bb=['split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions','getDataValue'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x63bb,0x192));var _0xb63b=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x63bb[_0x500c0];return _0xdd146f;};'use strict';var Sequelize=require(_0xb63b('0x0'));module[_0xb63b('0x1')]={'name':{'type':Sequelize[_0xb63b('0x2')],'allowNull':![],'unique':_0xb63b('0x3')},'crudPermissions':{'type':Sequelize[_0xb63b('0x2')],'set':function(_0x151c89){this['setDataValue'](_0xb63b('0x4'),_0x151c89?_0x151c89['join'](''):[]);},'get':function(){return this[_0xb63b('0x5')]('crudPermissions')?this[_0xb63b('0x5')](_0xb63b('0x4'))[_0xb63b('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb63b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb63b('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x25ea=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','name','STRING'];(function(_0x10811f,_0x14101a){var _0x219c2f=function(_0x5ea12a){while(--_0x5ea12a){_0x10811f['push'](_0x10811f['shift']());}};_0x219c2f(++_0x14101a);}(_0x25ea,0x85));var _0xa25e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x25ea[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xa25e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa25e('0x1')},'crudPermissions':{'type':Sequelize[_0xa25e('0x2')],'set':function(_0x5095c9){this['setDataValue'](_0xa25e('0x3'),_0x5095c9?_0x5095c9[_0xa25e('0x4')](''):[]);},'get':function(){return this[_0xa25e('0x5')](_0xa25e('0x3'))?this['getDataValue'](_0xa25e('0x3'))[_0xa25e('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa25e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa25e('0x7')],'defaultValue':!![]}};
\ No newline at end of file
index 203e468..b60c239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd506=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','offset','undefined','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','find','create','body','clone','params','get','omit','createdAt','updatedAt','crudPermissions','transaction','each','UserProfileResource','sectionId','userProfileId','UserProfileSection','describe','addSections','sequelize','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','util','ejs','fs-extra','lodash'];(function(_0x28b245,_0x3afca1){var _0x534729=function(_0x1b8278){while(--_0x1b8278){_0x28b245['push'](_0x28b245['shift']());}};_0x534729(++_0x3afca1);}(_0xd506,0x197));var _0x6d50=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd506[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require(_0x6d50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6d50('0x1'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6d50('0x2'));var fs=require('fs');var fs_extra=require(_0x6d50('0x3'));var _=require(_0x6d50('0x4'));var squel=require('squel');var crypto=require(_0x6d50('0x5'));var jsforce=require(_0x6d50('0x6'));var deskjs=require(_0x6d50('0x7'));var toCsv=require('to-csv');var querystring=require(_0x6d50('0x8'));var Papa=require('papaparse');var Redis=require(_0x6d50('0x9'));var authService=require(_0x6d50('0xa'));var qs=require(_0x6d50('0xb'));var as=require(_0x6d50('0xc'));var hardwareService=require(_0x6d50('0xd'));var logger=require(_0x6d50('0xe'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6d50('0xf'));var db=require(_0x6d50('0x10'))['db'];config[_0x6d50('0x11')]=_[_0x6d50('0x12')](config['redis'],{'host':_0x6d50('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d50('0x11')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x4da1c4,_0x3ea2e4){_0x3ea2e4=_0x3ea2e4||0xcc;return function(_0x5875d4){if(_0x5875d4){return _0x4da1c4[_0x6d50('0x14')](_0x3ea2e4);}return _0x4da1c4[_0x6d50('0x15')](_0x3ea2e4)['end']();};}function respondWithResult(_0x599f10,_0xcb07fd){_0xcb07fd=_0xcb07fd||0xc8;return function(_0x2ee296){if(_0x2ee296){return _0x599f10[_0x6d50('0x15')](_0xcb07fd)['json'](_0x2ee296);}};}function respondWithFilteredResult(_0x2ee037,_0x1ac038){return function(_0x466d5f){if(_0x466d5f){var _0x3e7898=typeof _0x1ac038[_0x6d50('0x16')]==='undefined'&&typeof _0x1ac038['limit']===_0x6d50('0x17');var _0xb87dad=_0x466d5f['count'];var _0x463165=_0x3e7898?0x0:_0x1ac038['offset'];var _0x2c52cb=_0x3e7898?_0x466d5f[_0x6d50('0x18')]:_0x1ac038[_0x6d50('0x16')]+_0x1ac038['limit'];var _0x4fbe30;if(_0x2c52cb>=_0xb87dad){_0x2c52cb=_0xb87dad;_0x4fbe30=0xc8;}else{_0x4fbe30=0xce;}_0x2ee037['status'](_0x4fbe30);return _0x2ee037[_0x6d50('0x19')](_0x6d50('0x1a'),_0x463165+'-'+_0x2c52cb+'/'+_0xb87dad)['json'](_0x466d5f);}return null;};}function patchUpdates(_0x48d452){return function(_0x5a06d9){try{jsonpatch['apply'](_0x5a06d9,_0x48d452,!![]);}catch(_0x171fa2){return BPromise[_0x6d50('0x1b')](_0x171fa2);}return _0x5a06d9[_0x6d50('0x1c')]();};}function saveUpdates(_0x35b711,_0x34d25e){return function(_0xd8e384){if(_0xd8e384){return _0xd8e384[_0x6d50('0x1d')](_0x35b711)['then'](function(_0x1ee589){return _0x1ee589;});}return null;};}function removeEntity(_0x3d4704,_0x54d67e){return function(_0x120ac2){if(_0x120ac2){return _0x120ac2[_0x6d50('0x1e')]()['then'](function(){_0x3d4704['status'](0xcc)[_0x6d50('0x1f')]();});}};}function handleEntityNotFound(_0x221391,_0x649358){return function(_0x520b57){if(!_0x520b57){_0x221391['sendStatus'](0x194);}return _0x520b57;};}function handleError(_0x11b530,_0x12f8c5){_0x12f8c5=_0x12f8c5||0x1f4;return function(_0x315be1){logger[_0x6d50('0x20')](_0x315be1[_0x6d50('0x21')]);if(_0x315be1[_0x6d50('0x22')]){delete _0x315be1[_0x6d50('0x22')];}_0x11b530[_0x6d50('0x15')](_0x12f8c5)['send'](_0x315be1);};}exports[_0x6d50('0x23')]=function(_0x2f3de7,_0x24cb9b){var _0x5745a9={},_0x123216={},_0x2d6db1={'count':0x0,'rows':[]};var _0x1ae5c7=_[_0x6d50('0x24')](db[_0x6d50('0x25')][_0x6d50('0x26')],function(_0x675de){return{'name':_0x675de[_0x6d50('0x27')],'type':_0x675de[_0x6d50('0x28')][_0x6d50('0x29')]};});_0x123216['model']=_[_0x6d50('0x24')](_0x1ae5c7,_0x6d50('0x22'));_0x123216[_0x6d50('0x2a')]=_[_0x6d50('0x2b')](_0x2f3de7[_0x6d50('0x2a')]);_0x123216[_0x6d50('0x2c')]=_['intersection'](_0x123216[_0x6d50('0x2d')],_0x123216[_0x6d50('0x2a')]);_0x5745a9[_0x6d50('0x2e')]=_[_0x6d50('0x2f')](_0x123216[_0x6d50('0x2d')],qs['fields'](_0x2f3de7['query'][_0x6d50('0x30')]));_0x5745a9[_0x6d50('0x2e')]=_0x5745a9['attributes'][_0x6d50('0x31')]?_0x5745a9[_0x6d50('0x2e')]:_0x123216[_0x6d50('0x2d')];if(!_0x2f3de7[_0x6d50('0x2a')][_0x6d50('0x32')](_0x6d50('0x33'))){_0x5745a9['limit']=qs['limit'](_0x2f3de7[_0x6d50('0x2a')][_0x6d50('0x34')]);_0x5745a9[_0x6d50('0x16')]=qs[_0x6d50('0x16')](_0x2f3de7[_0x6d50('0x2a')]['offset']);}_0x5745a9[_0x6d50('0x35')]=qs['sort'](_0x2f3de7['query']['sort']);_0x5745a9[_0x6d50('0x36')]=qs[_0x6d50('0x2c')](_[_0x6d50('0x37')](_0x2f3de7['query'],_0x123216['filters']),_0x1ae5c7);if(_0x2f3de7[_0x6d50('0x2a')][_0x6d50('0x38')]){_0x5745a9[_0x6d50('0x36')]=_['merge'](_0x5745a9[_0x6d50('0x36')],{'$or':_[_0x6d50('0x24')](_0x1ae5c7,function(_0x478194){if(_0x478194[_0x6d50('0x28')]!==_0x6d50('0x39')){var _0x58e385={};_0x58e385[_0x478194['name']]={'$like':'%'+_0x2f3de7[_0x6d50('0x2a')][_0x6d50('0x38')]+'%'};return _0x58e385;}})});}_0x5745a9=_[_0x6d50('0x3a')]({},_0x5745a9,_0x2f3de7[_0x6d50('0x3b')]);var _0x195f2f={'where':_0x5745a9[_0x6d50('0x36')]};return db[_0x6d50('0x25')][_0x6d50('0x18')](_0x195f2f)[_0x6d50('0x3c')](function(_0x2e82c3){_0x2d6db1[_0x6d50('0x18')]=_0x2e82c3;if(_0x2f3de7['query'][_0x6d50('0x3d')]){_0x5745a9[_0x6d50('0x3e')]=[{'all':!![]}];}return db['UserProfile'][_0x6d50('0x3f')](_0x5745a9);})['then'](function(_0x51fd2a){_0x2d6db1[_0x6d50('0x40')]=_0x51fd2a;return _0x2d6db1;})['then'](respondWithFilteredResult(_0x24cb9b,_0x5745a9))[_0x6d50('0x41')](handleError(_0x24cb9b,null));};exports[_0x6d50('0x42')]=function(_0x4b0cdc,_0x5496e4){var _0x36edcf={'raw':![],'where':{'id':_0x4b0cdc['params']['id']}},_0x5345b9={};_0x5345b9['model']=_[_0x6d50('0x2b')](db[_0x6d50('0x25')][_0x6d50('0x26')]);_0x5345b9['query']=_[_0x6d50('0x2b')](_0x4b0cdc[_0x6d50('0x2a')]);_0x5345b9[_0x6d50('0x2c')]=_[_0x6d50('0x2f')](_0x5345b9[_0x6d50('0x2d')],_0x5345b9['query']);_0x36edcf[_0x6d50('0x2e')]=_[_0x6d50('0x2f')](_0x5345b9[_0x6d50('0x2d')],qs[_0x6d50('0x30')](_0x4b0cdc['query']['fields']));_0x36edcf[_0x6d50('0x2e')]=_0x36edcf[_0x6d50('0x2e')]['length']?_0x36edcf['attributes']:_0x5345b9['model'];if(_0x4b0cdc['query'][_0x6d50('0x3d')]){_0x36edcf[_0x6d50('0x3e')]=[{'all':!![]}];}_0x36edcf=_[_0x6d50('0x3a')]({},_0x36edcf,_0x4b0cdc['options']);return db[_0x6d50('0x25')][_0x6d50('0x43')](_0x36edcf)[_0x6d50('0x3c')](handleEntityNotFound(_0x5496e4,null))['then'](respondWithResult(_0x5496e4,null))[_0x6d50('0x41')](handleError(_0x5496e4,null));};exports[_0x6d50('0x44')]=function(_0xd10795,_0x4b895a){return db['UserProfile'][_0x6d50('0x44')](_0xd10795[_0x6d50('0x45')],{})[_0x6d50('0x3c')](respondWithResult(_0x4b895a,0xc9))[_0x6d50('0x41')](handleError(_0x4b895a,null));};exports[_0x6d50('0x46')]=function(_0x41921d,_0xeabb2a){var _0x36bd1c={'where':{'id':_0x41921d[_0x6d50('0x47')]['id']}},_0x7edd11={};_0x7edd11['model']=_[_0x6d50('0x2b')](db[_0x6d50('0x25')][_0x6d50('0x26')]);_0x36bd1c[_0x6d50('0x2e')]=_[_0x6d50('0x2f')](_0x7edd11[_0x6d50('0x2d')],qs['fields'](_0x41921d[_0x6d50('0x2a')][_0x6d50('0x30')]));_0x36bd1c[_0x6d50('0x2e')]=_0x36bd1c['attributes']['length']?_0x36bd1c[_0x6d50('0x2e')]:_0x7edd11[_0x6d50('0x2d')];if(_0x41921d[_0x6d50('0x2a')][_0x6d50('0x3d')]){_0x36bd1c[_0x6d50('0x3e')]=[{'all':!![]}];}_0x36bd1c=_[_0x6d50('0x3a')]({},_0x36bd1c,_0x41921d['options']);return db[_0x6d50('0x25')][_0x6d50('0x43')](_0x36bd1c)[_0x6d50('0x3c')](handleEntityNotFound(_0xeabb2a,null))[_0x6d50('0x3c')](function(_0x4da8a0){if(_0x4da8a0){var _0x17dbf9=_0x4da8a0[_0x6d50('0x48')]({'plain':!![]});_0x17dbf9=qs[_0x6d50('0x49')](_0x17dbf9,['id',_0x6d50('0x4a'),_0x6d50('0x4b'),_0x6d50('0x4c')]);_0x41921d['body']=_['omit'](_0x41921d[_0x6d50('0x45')],['id',_0x6d50('0x4a'),_0x6d50('0x4b')]);return db['sequelize'][_0x6d50('0x4d')](function(_0x124abe){return db[_0x6d50('0x25')][_0x6d50('0x44')](_['merge'](_0x17dbf9,_0x41921d[_0x6d50('0x45')]),{'include':_0x41921d['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x124abe})[_0x6d50('0x3c')](function(_0xa18425){var _0x4f5bfa=_0xa18425[_0x6d50('0x48')]({'plain':!![]});return db['UserProfileSection'][_0x6d50('0x3f')]({'where':{'userProfileId':_0x41921d['params']['id']},'raw':!![]})['then'](function(_0x2da6b0){if(_0x2da6b0){return BPromise[_0x6d50('0x4e')](_0x2da6b0,function(_0x310f41){return new BPromise(function(_0x5d3807,_0x23cc58){if(_0x310f41['autoAssociation']===null||_0x310f41['autoAssociation']===0x1)_0x5d3807(null);return db[_0x6d50('0x4f')][_0x6d50('0x3f')]({'where':{'sectionId':_0x310f41['id']},'raw':!![]})[_0x6d50('0x3c')](function(_0x2a7651){var _0x367a7c=_[_0x6d50('0x24')](_0x2a7651,function(_0x4e40a8){return qs[_0x6d50('0x49')](_0x4e40a8,['id',_0x6d50('0x4a'),_0x6d50('0x4b'),_0x6d50('0x50')]);});_0x5d3807(_0x367a7c);})[_0x6d50('0x41')](function(_0x2d89a3){_0x23cc58(_0x2d89a3);});})[_0x6d50('0x3c')](function(_0xd66b53){var _0x41cf7d=qs[_0x6d50('0x49')](_0x310f41,['id',_0x6d50('0x4a'),_0x6d50('0x4b')]);_0x41cf7d[_0x6d50('0x51')]=_0x4f5bfa['id'];if(_0xd66b53)_0x41cf7d['Resources']=_0xd66b53;return _0x41cf7d;})['then'](function(_0x12173e){return db[_0x6d50('0x52')][_0x6d50('0x44')](_0x12173e,{'include':[{'model':db[_0x6d50('0x4f')],'as':'Resources'}],'raw':!![],'transaction':_0x124abe});});})[_0x6d50('0x3c')](function(){return _0x4f5bfa;});}});});});}})[_0x6d50('0x3c')](respondWithResult(_0xeabb2a,0xc9))[_0x6d50('0x41')](handleError(_0xeabb2a,null));};exports[_0x6d50('0x1d')]=function(_0xf84883,_0x4806a4){if(_0xf84883[_0x6d50('0x45')]['id']){delete _0xf84883['body']['id'];}return db['UserProfile'][_0x6d50('0x43')]({'where':{'id':_0xf84883[_0x6d50('0x47')]['id']}})[_0x6d50('0x3c')](handleEntityNotFound(_0x4806a4,null))[_0x6d50('0x3c')](saveUpdates(_0xf84883[_0x6d50('0x45')],null))[_0x6d50('0x3c')](respondWithResult(_0x4806a4,null))[_0x6d50('0x41')](handleError(_0x4806a4,null));};exports[_0x6d50('0x1e')]=function(_0x50cebd,_0x393167){return db['UserProfile'][_0x6d50('0x43')]({'where':{'id':_0x50cebd[_0x6d50('0x47')]['id']}})[_0x6d50('0x3c')](handleEntityNotFound(_0x393167,null))[_0x6d50('0x3c')](removeEntity(_0x393167,null))[_0x6d50('0x41')](handleError(_0x393167,null));};exports['describe']=function(_0x44a336,_0x430aea){return db['UserProfile'][_0x6d50('0x53')]()[_0x6d50('0x3c')](respondWithResult(_0x430aea,null))[_0x6d50('0x41')](handleError(_0x430aea,null));};exports[_0x6d50('0x54')]=function(_0x4c65a0,_0xe205b4){var _0x4c1b8a=_0x4c65a0['body'];return db['UserProfile'][_0x6d50('0x43')]({'where':{'id':_0x4c65a0[_0x6d50('0x47')]['id']}})[_0x6d50('0x3c')](handleEntityNotFound(_0xe205b4,null))[_0x6d50('0x3c')](function(_0x34edaa){if(_0x34edaa){return db[_0x6d50('0x55')][_0x6d50('0x4d')](function(_0x3c574c){return db[_0x6d50('0x52')][_0x6d50('0x1e')]({'where':{'userProfileId':_0x4c65a0['params']['id'],'sectionId':_[_0x6d50('0x24')](_0x4c1b8a,function(_0x54a0fc){return _0x54a0fc[_0x6d50('0x50')];})},'transaction':_0x3c574c})[_0x6d50('0x3c')](function(){var _0x236bef=_['map'](_0x4c1b8a,function(_0x165866){_0x165866[_0x6d50('0x51')]=_0x4c65a0['params']['id'];return _0x165866;});var _0xf4bd5c=[];return BPromise[_0x6d50('0x4e')](_0x236bef,function(_0x43a4f7){return db[_0x6d50('0x52')]['create'](_0x43a4f7,{'include':[{'model':db[_0x6d50('0x4f')],'as':'Resources'}],'raw':!![],'transaction':_0x3c574c})['then'](function(_0x4808ef){_0xf4bd5c[_0x6d50('0x56')](_0x4808ef[_0x6d50('0x48')]({'plain':!![]}));});})[_0x6d50('0x3c')](function(){return _0xf4bd5c;});});});}})[_0x6d50('0x3c')](function(_0x481019){return _0x481019;})['then'](respondWithResult(_0xe205b4,null))[_0x6d50('0x41')](handleError(_0xe205b4,null));};exports[_0x6d50('0x57')]=function(_0x39490c,_0x29c9c9){var _0x16a979;return db[_0x6d50('0x25')][_0x6d50('0x43')]({'where':{'id':_0x39490c[_0x6d50('0x47')]['id']},'attributes':['id',_0x6d50('0x22')]})[_0x6d50('0x3c')](handleEntityNotFound(_0x29c9c9,null))[_0x6d50('0x3c')](function(_0x39351e){if(_0x39351e){_0x16a979=_0x39351e;return db[_0x6d50('0x52')][_0x6d50('0x1e')]({'where':{'userProfileId':_0x39490c['params']['id'],'sectionId':_0x39490c[_0x6d50('0x2a')][_0x6d50('0x58')]}});}})[_0x6d50('0x3c')](function(){return _0x16a979;})[_0x6d50('0x3c')](respondWithStatusCode(_0x29c9c9,null))['catch'](handleError(_0x29c9c9,null));};exports[_0x6d50('0x59')]=function(_0x56fcb7,_0x354ab8){var _0x4abac3=[];var _0x54e6a2=[];return db[_0x6d50('0x52')][_0x6d50('0x3f')]({'where':{'userProfileId':_0x56fcb7['params']['id']},'raw':!![]})[_0x6d50('0x3c')](function(_0x4a94b8){_0x4abac3=_[_0x6d50('0x38')](_0x4a94b8,function(_0x2e1dbd){return _0x2e1dbd[_0x6d50('0x5a')]===0x1||_[_0x6d50('0x5b')]([0x3eb,0x709],_0x2e1dbd[_0x6d50('0x50')]);});if(!_[_0x6d50('0x5c')](_0x4abac3)){return _[_0x6d50('0x24')](_0x4abac3,function(_0x20db72){return _0x20db72[_0x6d50('0x50')];});}else{return;}})['then'](function(_0x2dd00c){if(_0x2dd00c)_0x54e6a2=_0x2dd00c;if(_[_0x6d50('0x5b')](_0x54e6a2,0x64)){var _0xdf5ac5=_[_0x6d50('0x43')](_0x4abac3,{'sectionId':0x64});return hasDefaultDashboard(_0xdf5ac5)['then'](function(_0x92d101){return _[_0x6d50('0x24')](_0x4abac3,function(_0x763e27){if(_0x763e27[_0x6d50('0x50')]===0x64){_0x763e27[_0x6d50('0x5d')]=_0x92d101;}return _0x763e27;});});}else{return;}})[_0x6d50('0x3c')](function(_0x46d99d){if(_0x46d99d)_0x4abac3=_0x46d99d;if(_[_0x6d50('0x5b')](_0x54e6a2,0x3eb)){var _0x24faf6=_[_0x6d50('0x43')](_0x4abac3,{'sectionId':0x3eb});return getCustomDashboards(_0x24faf6)[_0x6d50('0x3c')](function(_0x3257ae){return _[_0x6d50('0x24')](_0x4abac3,function(_0x307b93){if(_0x24faf6[_0x6d50('0x5a')]){if(_0x307b93[_0x6d50('0x50')]===0x3eb){_0x307b93[_0x6d50('0x5d')]=_0x3257ae;}}else{if(_0x307b93[_0x6d50('0x50')]===0x64){_0x307b93['subsections']=_0x3257ae;}}return _0x307b93;});});}else{return;}})[_0x6d50('0x3c')](function(_0x239aba){if(_0x239aba)_0x4abac3=_0x239aba;if(_[_0x6d50('0x5b')](_0x54e6a2,0x709)){var _0x43997f=_['find'](_0x4abac3,{'sectionId':0x709});return getPlugins(_0x43997f)[_0x6d50('0x3c')](function(_0x4400e7){if(_0x43997f[_0x6d50('0x5a')]){return _[_0x6d50('0x24')](_0x4abac3,function(_0x1bb5d8){if(_0x1bb5d8[_0x6d50('0x50')]===0x709){_0x1bb5d8['subsections']=_0x4400e7;}return _0x1bb5d8;});}else{var _0x439c45={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4400e7};var _0x2f97eb=_[_0x6d50('0x24')](_0x4abac3);_0x2f97eb['push'](_0x439c45);return _0x2f97eb;}});}else{return;}})['then'](function(_0x48d201){if(_0x48d201)_0x4abac3=_0x48d201;return _[_0x6d50('0x38')](_0x4abac3,[_0x6d50('0x5a'),0x1]);})[_0x6d50('0x3c')](respondWithResult(_0x354ab8,null))[_0x6d50('0x41')](handleError(_0x354ab8,null));};function hasDefaultDashboard(_0x23e759){var _0x2225fc=[0x65];return new BPromise(function(_0x15b5ba,_0x26b49f){try{if(_0x23e759[_0x6d50('0x5e')]){_0x15b5ba(_0x2225fc);}else{return db[_0x6d50('0x4f')][_0x6d50('0x5f')]({'where':{'sectionId':_0x23e759['id']},'raw':!![]})[_0x6d50('0x3c')](function(_0x244266){_0x244266?_0x15b5ba(_0x2225fc):_0x15b5ba();});}}catch(_0x32b831){_0x26b49f(_0x32b831);}});}function getCustomDashboards(_0x1c7e5e){var _0x4736f4=[];return new BPromise(function(_0x43e738,_0xbc3452){try{if(_0x1c7e5e[_0x6d50('0x5e')]){return db[_0x6d50('0x60')][_0x6d50('0x3f')]({'raw':!![]})['then'](function(_0x2ce679){_0x2ce679[_0x6d50('0x61')](function(_0x4bef28){_0x4736f4[_0x6d50('0x56')](_0x4bef28['id']+0x1869f);});_0x43e738(_0x4736f4);});}else{return db[_0x6d50('0x4f')][_0x6d50('0x3f')]({'where':{'sectionId':_0x1c7e5e['id']},'raw':!![]})[_0x6d50('0x3c')](function(_0x560e7a){_0x560e7a[_0x6d50('0x61')](function(_0x16196e){_0x4736f4[_0x6d50('0x56')](_0x16196e[_0x6d50('0x62')]+0x1869f);});_0x43e738(_0x4736f4);});}}catch(_0x3e1aa0){_0xbc3452(_0x3e1aa0);}});}function getPlugins(_0x423c1d){var _0x249525=[];return new BPromise(function(_0x302a82,_0xd772da){try{if(_0x423c1d[_0x6d50('0x5e')]){return db[_0x6d50('0x63')][_0x6d50('0x3f')]({'raw':!![]})['then'](function(_0x30c748){_0x30c748['forEach'](function(_0x3401c8){_0x249525[_0x6d50('0x56')](_0x3401c8['id']+0x15b38);});_0x302a82(_0x249525);});}else{return db[_0x6d50('0x4f')][_0x6d50('0x3f')]({'where':{'sectionId':_0x423c1d['id']},'raw':!![]})[_0x6d50('0x3c')](function(_0x2a061e){_0x2a061e['forEach'](function(_0xb08b){_0x249525[_0x6d50('0x56')](_0xb08b[_0x6d50('0x62')]+0x15b38);});_0x302a82(_0x249525);});}}catch(_0x438c6a){_0xd772da(_0x438c6a);}});}exports['addResources']=function(_0x51af8a,_0x46bacc){return db['UserProfile'][_0x6d50('0x43')]({'where':{'id':_0x51af8a[_0x6d50('0x47')]['id']}})[_0x6d50('0x3c')](handleEntityNotFound(_0x46bacc,null))[_0x6d50('0x3c')](function(_0x4abaaa){if(_0x4abaaa){return db[_0x6d50('0x55')][_0x6d50('0x4d')](function(_0x292289){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x51af8a[_0x6d50('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x6d50('0x3c')](function(_0x14daa4){if(_0x14daa4){return db[_0x6d50('0x52')][_0x6d50('0x1e')]({'where':{'userProfileId':_0x51af8a[_0x6d50('0x47')]['id'],'id':_[_0x6d50('0x24')](_0x14daa4,function(_0x78adde){return _0x78adde['id'];})},'transaction':_0x292289});}})[_0x6d50('0x3c')](function(_0x9c9f64){var _0x416b1f=_[_0x6d50('0x24')](_0x51af8a[_0x6d50('0x45')],function(_0x112f66){_0x112f66[_0x6d50('0x51')]=_0x51af8a[_0x6d50('0x47')]['id'];return _0x112f66;});return db[_0x6d50('0x52')]['bulkCreate'](_0x416b1f,{'raw':!![],'transaction':_0x292289});})['then'](function(_0x5bafd7){var _0xf5bd3f=_[_0x6d50('0x38')](_[_0x6d50('0x24')](_0x5bafd7,function(_0x3a8057){return _0x3a8057[_0x6d50('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0xf5bd3f){return db[_0x6d50('0x52')][_0x6d50('0x3f')]({'where':{'userProfileId':_0x51af8a[_0x6d50('0x47')]['id'],'sectionId':_['map'](_0xf5bd3f,function(_0x1f7a76){return _0x1f7a76[_0x6d50('0x50')];})},'attributes':['id',_0x6d50('0x50')],'raw':!![]})['then'](function(_0x165497){var _0x1fda4c=_[_0x6d50('0x24')](_0x51af8a[_0x6d50('0x45')],function(_0x5f04c5){_0x5f04c5[_0x6d50('0x51')]=_0x51af8a['params']['id'];return _0x5f04c5;});return db[_0x6d50('0x4f')]['bulkCreate'](_0x1fda4c,{'raw':!![],'transaction':_0x292289});});}})['catch'](handleError(_0x46bacc,null));});}})[_0x6d50('0x3c')](function(_0x163207){var _0x54f173=_[_0x6d50('0x24')](_0x163207,function(_0x265da7){return _0x265da7[_0x6d50('0x48')]({'plain':!![]});});})[_0x6d50('0x3c')](respondWithResult(_0x46bacc,null))[_0x6d50('0x41')](handleError(_0x46bacc,null));};exports[_0x6d50('0x64')]=function(_0x600e5a,_0x1d9371,_0x39417f){return db[_0x6d50('0x25')]['find']({'where':{'id':_0x600e5a['params']['id']}})['then'](handleEntityNotFound(_0x1d9371,null))['then'](function(_0x3b25b5){if(_0x3b25b5){return _0x3b25b5['removeResources'](_0x600e5a[_0x6d50('0x2a')][_0x6d50('0x58')]);}})[_0x6d50('0x3c')](respondWithStatusCode(_0x1d9371,null))['catch'](handleError(_0x1d9371,null));};exports[_0x6d50('0x65')]=function(_0x450534,_0x441c7a){var _0x51a86b={};if(!_0x450534[_0x6d50('0x2a')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x450534[_0x6d50('0x2a')][_0x6d50('0x32')](_0x6d50('0x33'))){_0x51a86b[_0x6d50('0x34')]=qs[_0x6d50('0x34')](_0x450534[_0x6d50('0x2a')][_0x6d50('0x34')]);_0x51a86b['offset']=qs['offset'](_0x450534[_0x6d50('0x2a')][_0x6d50('0x16')]);}return db['UserProfile']['find']({'where':{'id':_0x450534['params']['id']}})['then'](function(_0x4eff81){if(!_0x4eff81)throw new Error(_0x6d50('0x66')+_0x450534['params']['id']);return db[_0x6d50('0x25')][_0x6d50('0x65')](_0x450534);})[_0x6d50('0x3c')](respondWithFilteredResult(_0x441c7a,_0x51a86b))[_0x6d50('0x41')](handleError(_0x441c7a,null));};
\ No newline at end of file
+var _0xa809=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','json','offset','undefined','limit','count','save','update','then','destroy','end','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','clone','get','updatedAt','omit','createdAt','sequelize','each','autoAssociation','UserProfileResource','Resources','UserProfileSection','describe','addSections','transaction','sectionId','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','removeResources','getResources','section','hasOwnProperty','rimraf','request-promise','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3420bd,_0x34703d){var _0x5c7793=function(_0x64fe96){while(--_0x64fe96){_0x3420bd['push'](_0x3420bd['shift']());}};_0x5c7793(++_0x34703d);}(_0xa809,0x1f3));var _0x9a80=function(_0x5e2e57,_0x552973){_0x5e2e57=_0x5e2e57-0x0;var _0x4c064a=_0xa809[_0x5e2e57];return _0x4c064a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a80('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a80('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9a80('0x2'));var path=require(_0x9a80('0x3'));var sox=require(_0x9a80('0x4'));var csv=require(_0x9a80('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a80('0x6'));var _=require('lodash');var squel=require(_0x9a80('0x7'));var crypto=require(_0x9a80('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9a80('0x9'));var toCsv=require(_0x9a80('0x5'));var querystring=require(_0x9a80('0xa'));var Papa=require(_0x9a80('0xb'));var Redis=require('ioredis');var authService=require(_0x9a80('0xc'));var qs=require(_0x9a80('0xd'));var as=require(_0x9a80('0xe'));var hardwareService=require(_0x9a80('0xf'));var logger=require(_0x9a80('0x10'))(_0x9a80('0x11'));var utils=require(_0x9a80('0x12'));var config=require(_0x9a80('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a80('0x14'))['db'];config[_0x9a80('0x15')]=_[_0x9a80('0x16')](config[_0x9a80('0x15')],{'host':_0x9a80('0x17'),'port':0x18eb});var socket=require(_0x9a80('0x18'))(new Redis(config[_0x9a80('0x15')]));require(_0x9a80('0x19'))['register'](socket);function respondWithStatusCode(_0x16c1b5,_0x5ce1ba){_0x5ce1ba=_0x5ce1ba||0xcc;return function(_0x384be7){if(_0x384be7){return _0x16c1b5[_0x9a80('0x1a')](_0x5ce1ba);}return _0x16c1b5[_0x9a80('0x1b')](_0x5ce1ba)['end']();};}function respondWithResult(_0x3f393c,_0x10445f){_0x10445f=_0x10445f||0xc8;return function(_0x2d48c8){if(_0x2d48c8){return _0x3f393c[_0x9a80('0x1b')](_0x10445f)[_0x9a80('0x1c')](_0x2d48c8);}};}function respondWithFilteredResult(_0x5a6efc,_0x1a6fd0){return function(_0x4bfb77){if(_0x4bfb77){var _0xbe6e6e=typeof _0x1a6fd0[_0x9a80('0x1d')]===_0x9a80('0x1e')&&typeof _0x1a6fd0[_0x9a80('0x1f')]==='undefined';var _0x47cfe4=_0x4bfb77[_0x9a80('0x20')];var _0xdacb63=_0xbe6e6e?0x0:_0x1a6fd0[_0x9a80('0x1d')];var _0x43882e=_0xbe6e6e?_0x4bfb77[_0x9a80('0x20')]:_0x1a6fd0['offset']+_0x1a6fd0[_0x9a80('0x1f')];var _0x252fd6;if(_0x43882e>=_0x47cfe4){_0x43882e=_0x47cfe4;_0x252fd6=0xc8;}else{_0x252fd6=0xce;}_0x5a6efc[_0x9a80('0x1b')](_0x252fd6);return _0x5a6efc['set']('Content-Range',_0xdacb63+'-'+_0x43882e+'/'+_0x47cfe4)[_0x9a80('0x1c')](_0x4bfb77);}return null;};}function patchUpdates(_0x5cc1b1){return function(_0x2906c2){try{jsonpatch['apply'](_0x2906c2,_0x5cc1b1,!![]);}catch(_0x125731){return BPromise['reject'](_0x125731);}return _0x2906c2[_0x9a80('0x21')]();};}function saveUpdates(_0x435b4b,_0x20a4e7){return function(_0x2ae2a2){if(_0x2ae2a2){return _0x2ae2a2[_0x9a80('0x22')](_0x435b4b)[_0x9a80('0x23')](function(_0x4546e6){return _0x4546e6;});}return null;};}function removeEntity(_0x1ac84d,_0x52ae41){return function(_0x34880c){if(_0x34880c){return _0x34880c[_0x9a80('0x24')]()['then'](function(){_0x1ac84d[_0x9a80('0x1b')](0xcc)[_0x9a80('0x25')]();});}};}function handleEntityNotFound(_0x55fabc,_0x3e6a80){return function(_0x1bed50){if(!_0x1bed50){_0x55fabc[_0x9a80('0x1a')](0x194);}return _0x1bed50;};}function handleError(_0x2ef801,_0x2597bb){_0x2597bb=_0x2597bb||0x1f4;return function(_0x341ae5){logger['error'](_0x341ae5[_0x9a80('0x26')]);if(_0x341ae5[_0x9a80('0x27')]){delete _0x341ae5[_0x9a80('0x27')];}_0x2ef801[_0x9a80('0x1b')](_0x2597bb)[_0x9a80('0x28')](_0x341ae5);};}exports['index']=function(_0x3c0975,_0x364f32){var _0x2ccd6b={},_0x31ce19={},_0x4a9786={'count':0x0,'rows':[]};var _0x37f813=_[_0x9a80('0x29')](db[_0x9a80('0x2a')][_0x9a80('0x2b')],function(_0x5baf45){return{'name':_0x5baf45[_0x9a80('0x2c')],'type':_0x5baf45[_0x9a80('0x2d')]['key']};});_0x31ce19[_0x9a80('0x2e')]=_[_0x9a80('0x29')](_0x37f813,_0x9a80('0x27'));_0x31ce19[_0x9a80('0x2f')]=_['keys'](_0x3c0975[_0x9a80('0x2f')]);_0x31ce19[_0x9a80('0x30')]=_[_0x9a80('0x31')](_0x31ce19[_0x9a80('0x2e')],_0x31ce19[_0x9a80('0x2f')]);_0x2ccd6b[_0x9a80('0x32')]=_[_0x9a80('0x31')](_0x31ce19[_0x9a80('0x2e')],qs[_0x9a80('0x33')](_0x3c0975[_0x9a80('0x2f')][_0x9a80('0x33')]));_0x2ccd6b[_0x9a80('0x32')]=_0x2ccd6b[_0x9a80('0x32')][_0x9a80('0x34')]?_0x2ccd6b[_0x9a80('0x32')]:_0x31ce19['model'];if(!_0x3c0975['query']['hasOwnProperty'](_0x9a80('0x35'))){_0x2ccd6b[_0x9a80('0x1f')]=qs[_0x9a80('0x1f')](_0x3c0975['query'][_0x9a80('0x1f')]);_0x2ccd6b[_0x9a80('0x1d')]=qs[_0x9a80('0x1d')](_0x3c0975[_0x9a80('0x2f')]['offset']);}_0x2ccd6b['order']=qs['sort'](_0x3c0975['query'][_0x9a80('0x36')]);_0x2ccd6b[_0x9a80('0x37')]=qs[_0x9a80('0x30')](_['pick'](_0x3c0975[_0x9a80('0x2f')],_0x31ce19['filters']),_0x37f813);if(_0x3c0975[_0x9a80('0x2f')][_0x9a80('0x38')]){_0x2ccd6b[_0x9a80('0x37')]=_[_0x9a80('0x39')](_0x2ccd6b['where'],{'$or':_[_0x9a80('0x29')](_0x37f813,function(_0x589eb2){if(_0x589eb2[_0x9a80('0x2d')]!==_0x9a80('0x3a')){var _0x5e036b={};_0x5e036b[_0x589eb2['name']]={'$like':'%'+_0x3c0975['query'][_0x9a80('0x38')]+'%'};return _0x5e036b;}})});}_0x2ccd6b=_['merge']({},_0x2ccd6b,_0x3c0975[_0x9a80('0x3b')]);var _0x139532={'where':_0x2ccd6b[_0x9a80('0x37')]};return db[_0x9a80('0x2a')][_0x9a80('0x20')](_0x139532)[_0x9a80('0x23')](function(_0x15c750){_0x4a9786[_0x9a80('0x20')]=_0x15c750;if(_0x3c0975['query'][_0x9a80('0x3c')]){_0x2ccd6b[_0x9a80('0x3d')]=[{'all':!![]}];}return db[_0x9a80('0x2a')][_0x9a80('0x3e')](_0x2ccd6b);})[_0x9a80('0x23')](function(_0x52094e){_0x4a9786['rows']=_0x52094e;return _0x4a9786;})[_0x9a80('0x23')](respondWithFilteredResult(_0x364f32,_0x2ccd6b))[_0x9a80('0x3f')](handleError(_0x364f32,null));};exports[_0x9a80('0x40')]=function(_0x19bc63,_0xcbb250){var _0xbc5a5e={'raw':![],'where':{'id':_0x19bc63[_0x9a80('0x41')]['id']}},_0x32db24={};_0x32db24[_0x9a80('0x2e')]=_[_0x9a80('0x42')](db['UserProfile'][_0x9a80('0x2b')]);_0x32db24['query']=_[_0x9a80('0x42')](_0x19bc63[_0x9a80('0x2f')]);_0x32db24['filters']=_[_0x9a80('0x31')](_0x32db24[_0x9a80('0x2e')],_0x32db24['query']);_0xbc5a5e['attributes']=_[_0x9a80('0x31')](_0x32db24[_0x9a80('0x2e')],qs[_0x9a80('0x33')](_0x19bc63[_0x9a80('0x2f')]['fields']));_0xbc5a5e['attributes']=_0xbc5a5e[_0x9a80('0x32')][_0x9a80('0x34')]?_0xbc5a5e[_0x9a80('0x32')]:_0x32db24['model'];if(_0x19bc63[_0x9a80('0x2f')]['includeAll']){_0xbc5a5e[_0x9a80('0x3d')]=[{'all':!![]}];}_0xbc5a5e=_[_0x9a80('0x39')]({},_0xbc5a5e,_0x19bc63['options']);return db[_0x9a80('0x2a')][_0x9a80('0x43')](_0xbc5a5e)[_0x9a80('0x23')](handleEntityNotFound(_0xcbb250,null))[_0x9a80('0x23')](respondWithResult(_0xcbb250,null))[_0x9a80('0x3f')](handleError(_0xcbb250,null));};exports['create']=function(_0x4790a7,_0x4a4fe6){return db['UserProfile'][_0x9a80('0x44')](_0x4790a7[_0x9a80('0x45')],{})[_0x9a80('0x23')](respondWithResult(_0x4a4fe6,0xc9))[_0x9a80('0x3f')](handleError(_0x4a4fe6,null));};exports[_0x9a80('0x46')]=function(_0x5f57ad,_0x346186){var _0x410b5b={'where':{'id':_0x5f57ad[_0x9a80('0x41')]['id']}},_0x39c462={};_0x39c462[_0x9a80('0x2e')]=_['keys'](db['UserProfile'][_0x9a80('0x2b')]);_0x410b5b[_0x9a80('0x32')]=_[_0x9a80('0x31')](_0x39c462[_0x9a80('0x2e')],qs[_0x9a80('0x33')](_0x5f57ad[_0x9a80('0x2f')][_0x9a80('0x33')]));_0x410b5b['attributes']=_0x410b5b['attributes'][_0x9a80('0x34')]?_0x410b5b[_0x9a80('0x32')]:_0x39c462['model'];if(_0x5f57ad['query'][_0x9a80('0x3c')]){_0x410b5b[_0x9a80('0x3d')]=[{'all':!![]}];}_0x410b5b=_['merge']({},_0x410b5b,_0x5f57ad[_0x9a80('0x3b')]);return db[_0x9a80('0x2a')][_0x9a80('0x43')](_0x410b5b)[_0x9a80('0x23')](handleEntityNotFound(_0x346186,null))['then'](function(_0x4cf6f2){if(_0x4cf6f2){var _0x3d30ee=_0x4cf6f2[_0x9a80('0x47')]({'plain':!![]});_0x3d30ee=qs['omit'](_0x3d30ee,['id','createdAt',_0x9a80('0x48'),'crudPermissions']);_0x5f57ad['body']=_[_0x9a80('0x49')](_0x5f57ad['body'],['id',_0x9a80('0x4a'),_0x9a80('0x48')]);return db[_0x9a80('0x4b')]['transaction'](function(_0x526ced){return db[_0x9a80('0x2a')]['create'](_[_0x9a80('0x39')](_0x3d30ee,_0x5f57ad[_0x9a80('0x45')]),{'include':_0x5f57ad[_0x9a80('0x2f')][_0x9a80('0x3c')]?[{'all':!![]}]:undefined,'transaction':_0x526ced})[_0x9a80('0x23')](function(_0x2a91bf){var _0x4793b7=_0x2a91bf['get']({'plain':!![]});return db['UserProfileSection'][_0x9a80('0x3e')]({'where':{'userProfileId':_0x5f57ad[_0x9a80('0x41')]['id']},'raw':!![]})['then'](function(_0x19de7a){if(_0x19de7a){return BPromise[_0x9a80('0x4c')](_0x19de7a,function(_0x5e101f){return new BPromise(function(_0x399e7f,_0x50aa11){if(_0x5e101f[_0x9a80('0x4d')]===null||_0x5e101f[_0x9a80('0x4d')]===0x1)_0x399e7f(null);return db[_0x9a80('0x4e')][_0x9a80('0x3e')]({'where':{'sectionId':_0x5e101f['id']},'raw':!![]})[_0x9a80('0x23')](function(_0x444389){var _0x46624b=_[_0x9a80('0x29')](_0x444389,function(_0x35a3f6){return qs[_0x9a80('0x49')](_0x35a3f6,['id',_0x9a80('0x4a'),'updatedAt','sectionId']);});_0x399e7f(_0x46624b);})[_0x9a80('0x3f')](function(_0x25f17a){_0x50aa11(_0x25f17a);});})['then'](function(_0x6580ff){var _0x24f438=qs[_0x9a80('0x49')](_0x5e101f,['id',_0x9a80('0x4a'),'updatedAt']);_0x24f438['userProfileId']=_0x4793b7['id'];if(_0x6580ff)_0x24f438[_0x9a80('0x4f')]=_0x6580ff;return _0x24f438;})['then'](function(_0x35d14a){return db[_0x9a80('0x50')][_0x9a80('0x44')](_0x35d14a,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x526ced});});})[_0x9a80('0x23')](function(){return _0x4793b7;});}});});});}})['then'](respondWithResult(_0x346186,0xc9))[_0x9a80('0x3f')](handleError(_0x346186,null));};exports['update']=function(_0x219c02,_0x317b35){if(_0x219c02[_0x9a80('0x45')]['id']){delete _0x219c02['body']['id'];}return db[_0x9a80('0x2a')][_0x9a80('0x43')]({'where':{'id':_0x219c02['params']['id']}})[_0x9a80('0x23')](handleEntityNotFound(_0x317b35,null))[_0x9a80('0x23')](saveUpdates(_0x219c02[_0x9a80('0x45')],null))[_0x9a80('0x23')](respondWithResult(_0x317b35,null))[_0x9a80('0x3f')](handleError(_0x317b35,null));};exports[_0x9a80('0x24')]=function(_0x49bf93,_0x14b387){return db[_0x9a80('0x2a')][_0x9a80('0x43')]({'where':{'id':_0x49bf93['params']['id']}})[_0x9a80('0x23')](handleEntityNotFound(_0x14b387,null))[_0x9a80('0x23')](removeEntity(_0x14b387,null))[_0x9a80('0x3f')](handleError(_0x14b387,null));};exports[_0x9a80('0x51')]=function(_0x2a0f2b,_0x149f2f){return db[_0x9a80('0x2a')]['describe']()[_0x9a80('0x23')](respondWithResult(_0x149f2f,null))['catch'](handleError(_0x149f2f,null));};exports[_0x9a80('0x52')]=function(_0x3e4eb8,_0x207ce0){var _0x247e3b=_0x3e4eb8[_0x9a80('0x45')];return db[_0x9a80('0x2a')][_0x9a80('0x43')]({'where':{'id':_0x3e4eb8['params']['id']}})[_0x9a80('0x23')](handleEntityNotFound(_0x207ce0,null))[_0x9a80('0x23')](function(_0x4cc316){if(_0x4cc316){return db['sequelize'][_0x9a80('0x53')](function(_0x374db4){return db[_0x9a80('0x50')][_0x9a80('0x24')]({'where':{'userProfileId':_0x3e4eb8['params']['id'],'sectionId':_[_0x9a80('0x29')](_0x247e3b,function(_0x340cf9){return _0x340cf9[_0x9a80('0x54')];})},'transaction':_0x374db4})['then'](function(){var _0x338248=_['map'](_0x247e3b,function(_0x5d4c1c){_0x5d4c1c[_0x9a80('0x55')]=_0x3e4eb8[_0x9a80('0x41')]['id'];return _0x5d4c1c;});var _0x30a4ce=[];return BPromise[_0x9a80('0x4c')](_0x338248,function(_0xfbf6e6){return db[_0x9a80('0x50')][_0x9a80('0x44')](_0xfbf6e6,{'include':[{'model':db[_0x9a80('0x4e')],'as':'Resources'}],'raw':!![],'transaction':_0x374db4})[_0x9a80('0x23')](function(_0x32256c){_0x30a4ce[_0x9a80('0x56')](_0x32256c[_0x9a80('0x47')]({'plain':!![]}));});})[_0x9a80('0x23')](function(){return _0x30a4ce;});});});}})[_0x9a80('0x23')](function(_0x518966){return _0x518966;})[_0x9a80('0x23')](respondWithResult(_0x207ce0,null))[_0x9a80('0x3f')](handleError(_0x207ce0,null));};exports[_0x9a80('0x57')]=function(_0x36ec3d,_0x47f3f7){var _0xd3c422;return db[_0x9a80('0x2a')]['find']({'where':{'id':_0x36ec3d[_0x9a80('0x41')]['id']},'attributes':['id',_0x9a80('0x27')]})['then'](handleEntityNotFound(_0x47f3f7,null))['then'](function(_0x2055b8){if(_0x2055b8){_0xd3c422=_0x2055b8;return db['UserProfileSection'][_0x9a80('0x24')]({'where':{'userProfileId':_0x36ec3d[_0x9a80('0x41')]['id'],'sectionId':_0x36ec3d[_0x9a80('0x2f')][_0x9a80('0x58')]}});}})[_0x9a80('0x23')](function(){return _0xd3c422;})[_0x9a80('0x23')](respondWithStatusCode(_0x47f3f7,null))[_0x9a80('0x3f')](handleError(_0x47f3f7,null));};exports[_0x9a80('0x59')]=function(_0x1c9d81,_0x3d22fc){var _0x310cc1=[];var _0x210f8e=[];return db[_0x9a80('0x50')][_0x9a80('0x3e')]({'where':{'userProfileId':_0x1c9d81[_0x9a80('0x41')]['id']},'raw':!![]})[_0x9a80('0x23')](function(_0x242411){_0x310cc1=_['filter'](_0x242411,function(_0x3eff46){return _0x3eff46[_0x9a80('0x5a')]===0x1||_[_0x9a80('0x5b')]([0x3eb,0x709],_0x3eff46[_0x9a80('0x54')]);});if(!_[_0x9a80('0x5c')](_0x310cc1)){return _[_0x9a80('0x29')](_0x310cc1,function(_0x4ec64e){return _0x4ec64e[_0x9a80('0x54')];});}else{return;}})[_0x9a80('0x23')](function(_0x7453d4){if(_0x7453d4)_0x210f8e=_0x7453d4;if(_[_0x9a80('0x5b')](_0x210f8e,0x64)){var _0x23f1d2=_[_0x9a80('0x43')](_0x310cc1,{'sectionId':0x64});return hasDefaultDashboard(_0x23f1d2)['then'](function(_0x3b08a1){return _[_0x9a80('0x29')](_0x310cc1,function(_0x16675d){if(_0x16675d[_0x9a80('0x54')]===0x64){_0x16675d[_0x9a80('0x5d')]=_0x3b08a1;}return _0x16675d;});});}else{return;}})[_0x9a80('0x23')](function(_0x31abc4){if(_0x31abc4)_0x310cc1=_0x31abc4;if(_[_0x9a80('0x5b')](_0x210f8e,0x3eb)){var _0x3ea560=_['find'](_0x310cc1,{'sectionId':0x3eb});return getCustomDashboards(_0x3ea560)['then'](function(_0x39f5b5){return _[_0x9a80('0x29')](_0x310cc1,function(_0x5e1406){if(_0x3ea560['enabled']){if(_0x5e1406[_0x9a80('0x54')]===0x3eb){_0x5e1406[_0x9a80('0x5d')]=_0x39f5b5;}}else{if(_0x5e1406[_0x9a80('0x54')]===0x64){_0x5e1406[_0x9a80('0x5d')]=_0x39f5b5;}}return _0x5e1406;});});}else{return;}})['then'](function(_0x486af8){if(_0x486af8)_0x310cc1=_0x486af8;if(_[_0x9a80('0x5b')](_0x210f8e,0x709)){var _0x4d79f6=_[_0x9a80('0x43')](_0x310cc1,{'sectionId':0x709});return getPlugins(_0x4d79f6)[_0x9a80('0x23')](function(_0x514f2c){if(_0x4d79f6[_0x9a80('0x5a')]){return _[_0x9a80('0x29')](_0x310cc1,function(_0x374d8c){if(_0x374d8c[_0x9a80('0x54')]===0x709){_0x374d8c['subsections']=_0x514f2c;}return _0x374d8c;});}else{var _0x103ba7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x514f2c};var _0xb66b11=_[_0x9a80('0x29')](_0x310cc1);_0xb66b11[_0x9a80('0x56')](_0x103ba7);return _0xb66b11;}});}else{return;}})[_0x9a80('0x23')](function(_0x543e34){if(_0x543e34)_0x310cc1=_0x543e34;return _['filter'](_0x310cc1,['enabled',0x1]);})[_0x9a80('0x23')](respondWithResult(_0x3d22fc,null))[_0x9a80('0x3f')](handleError(_0x3d22fc,null));};function hasDefaultDashboard(_0x4e0792){var _0x659534=[0x65];return new BPromise(function(_0x4c2bc3,_0x57a4bb){try{if(_0x4e0792[_0x9a80('0x4d')]){_0x4c2bc3(_0x659534);}else{return db['UserProfileResource'][_0x9a80('0x5e')]({'where':{'sectionId':_0x4e0792['id']},'raw':!![]})[_0x9a80('0x23')](function(_0x37f9fb){_0x37f9fb?_0x4c2bc3(_0x659534):_0x4c2bc3();});}}catch(_0x2a62f7){_0x57a4bb(_0x2a62f7);}});}function getCustomDashboards(_0x5f018e){var _0x2b3073=[];return new BPromise(function(_0x204082,_0x529ca6){try{if(_0x5f018e['autoAssociation']){return db[_0x9a80('0x5f')]['findAll']({'raw':!![]})[_0x9a80('0x23')](function(_0x1ad391){_0x1ad391['forEach'](function(_0x4d5709){_0x2b3073[_0x9a80('0x56')](_0x4d5709['id']+0x1869f);});_0x204082(_0x2b3073);});}else{return db[_0x9a80('0x4e')][_0x9a80('0x3e')]({'where':{'sectionId':_0x5f018e['id']},'raw':!![]})[_0x9a80('0x23')](function(_0x1a5656){_0x1a5656[_0x9a80('0x60')](function(_0x576d98){_0x2b3073[_0x9a80('0x56')](_0x576d98['resourceId']+0x1869f);});_0x204082(_0x2b3073);});}}catch(_0x156f16){_0x529ca6(_0x156f16);}});}function getPlugins(_0x517220){var _0xe7ff2f=[];return new BPromise(function(_0x4eee51,_0x4c242a){try{if(_0x517220[_0x9a80('0x4d')]){return db[_0x9a80('0x61')][_0x9a80('0x3e')]({'raw':!![]})['then'](function(_0x3ad063){_0x3ad063[_0x9a80('0x60')](function(_0x2141ea){_0xe7ff2f[_0x9a80('0x56')](_0x2141ea['id']+0x15b38);});_0x4eee51(_0xe7ff2f);});}else{return db[_0x9a80('0x4e')][_0x9a80('0x3e')]({'where':{'sectionId':_0x517220['id']},'raw':!![]})['then'](function(_0x51e1df){_0x51e1df[_0x9a80('0x60')](function(_0x3692be){_0xe7ff2f[_0x9a80('0x56')](_0x3692be['resourceId']+0x15b38);});_0x4eee51(_0xe7ff2f);});}}catch(_0x377c62){_0x4c242a(_0x377c62);}});}exports[_0x9a80('0x62')]=function(_0xa63414,_0x89c015){return db[_0x9a80('0x2a')]['find']({'where':{'id':_0xa63414[_0x9a80('0x41')]['id']}})[_0x9a80('0x23')](handleEntityNotFound(_0x89c015,null))[_0x9a80('0x23')](function(_0x56c5f4){if(_0x56c5f4){return db[_0x9a80('0x4b')][_0x9a80('0x53')](function(_0x429d0d){return db[_0x9a80('0x50')]['findAll']({'where':{'userProfileId':_0xa63414[_0x9a80('0x41')]['id']},'attributes':['id'],'raw':!![]})[_0x9a80('0x23')](function(_0x1913ad){if(_0x1913ad){return db['UserProfileSection'][_0x9a80('0x24')]({'where':{'userProfileId':_0xa63414[_0x9a80('0x41')]['id'],'id':_[_0x9a80('0x29')](_0x1913ad,function(_0x30265f){return _0x30265f['id'];})},'transaction':_0x429d0d});}})['then'](function(_0x5dc8b2){var _0xa369ed=_[_0x9a80('0x29')](_0xa63414['body'],function(_0x72f8a2){_0x72f8a2['userProfileId']=_0xa63414[_0x9a80('0x41')]['id'];return _0x72f8a2;});return db['UserProfileSection'][_0x9a80('0x63')](_0xa369ed,{'raw':!![],'transaction':_0x429d0d});})[_0x9a80('0x23')](function(_0x2b979b){var _0x11d134=_[_0x9a80('0x38')](_['map'](_0x2b979b,function(_0x3cf84b){return _0x3cf84b[_0x9a80('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x11d134){return db['UserProfileSection'][_0x9a80('0x3e')]({'where':{'userProfileId':_0xa63414[_0x9a80('0x41')]['id'],'sectionId':_['map'](_0x11d134,function(_0x3fa9ba){return _0x3fa9ba['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x147e1c){var _0x35a809=_['map'](_0xa63414[_0x9a80('0x45')],function(_0x158857){_0x158857[_0x9a80('0x55')]=_0xa63414[_0x9a80('0x41')]['id'];return _0x158857;});return db['UserProfileResource']['bulkCreate'](_0x35a809,{'raw':!![],'transaction':_0x429d0d});});}})[_0x9a80('0x3f')](handleError(_0x89c015,null));});}})[_0x9a80('0x23')](function(_0x3c702a){var _0x4c5e07=_['map'](_0x3c702a,function(_0x597068){return _0x597068[_0x9a80('0x47')]({'plain':!![]});});})[_0x9a80('0x23')](respondWithResult(_0x89c015,null))['catch'](handleError(_0x89c015,null));};exports[_0x9a80('0x64')]=function(_0x26eba9,_0x27f3e9,_0x2a7fea){return db[_0x9a80('0x2a')][_0x9a80('0x43')]({'where':{'id':_0x26eba9[_0x9a80('0x41')]['id']}})['then'](handleEntityNotFound(_0x27f3e9,null))[_0x9a80('0x23')](function(_0x5499b4){if(_0x5499b4){return _0x5499b4[_0x9a80('0x64')](_0x26eba9[_0x9a80('0x2f')][_0x9a80('0x58')]);}})[_0x9a80('0x23')](respondWithStatusCode(_0x27f3e9,null))[_0x9a80('0x3f')](handleError(_0x27f3e9,null));};exports[_0x9a80('0x65')]=function(_0x2956db,_0x2db823){var _0x3736fa={};if(!_0x2956db[_0x9a80('0x2f')][_0x9a80('0x66')])throw new Error('Missing\x20section\x20parameter');if(!_0x2956db[_0x9a80('0x2f')][_0x9a80('0x67')]('nolimit')){_0x3736fa[_0x9a80('0x1f')]=qs[_0x9a80('0x1f')](_0x2956db[_0x9a80('0x2f')][_0x9a80('0x1f')]);_0x3736fa[_0x9a80('0x1d')]=qs[_0x9a80('0x1d')](_0x2956db[_0x9a80('0x2f')]['offset']);}return db['UserProfile'][_0x9a80('0x43')]({'where':{'id':_0x2956db[_0x9a80('0x41')]['id']}})[_0x9a80('0x23')](function(_0x23aeff){if(!_0x23aeff)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2956db['params']['id']);return db[_0x9a80('0x2a')]['getResources'](_0x2956db);})['then'](respondWithFilteredResult(_0x2db823,_0x3736fa))['catch'](handleError(_0x2db823,null));};
\ No newline at end of file
index 06de564..8abde96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4815=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0x4815,0xff));var _0x5481=function(_0x3b3c66,_0x5a7131){_0x3b3c66=_0x3b3c66-0x0;var _0x14851e=_0x4815[_0x3b3c66];return _0x14851e;};'use strict';var EventEmitter=require(_0x5481('0x0'));var UserProfile=require(_0x5481('0x1'))['db'][_0x5481('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5481('0x3')](0x0);var events={'afterCreate':_0x5481('0x4'),'afterUpdate':_0x5481('0x5'),'afterDestroy':_0x5481('0x6')};function emitEvent(_0x4797f0){return function(_0x4a7db7,_0x2e5eec,_0x433e2a){UserProfileEvents[_0x5481('0x7')](_0x4797f0+':'+_0x4a7db7['id'],_0x4a7db7);UserProfileEvents[_0x5481('0x7')](_0x4797f0,_0x4a7db7);_0x433e2a(null);};}for(var e in events){if(events[_0x5481('0x8')](e)){var event=events[e];UserProfile[_0x5481('0x9')](e,emitEvent(event));}}module[_0x5481('0xa')]=UserProfileEvents;
\ No newline at end of file
+var _0x2581=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x2581,0xcb));var _0x1258=function(_0x440c83,_0x296e65){_0x440c83=_0x440c83-0x0;var _0x4d2db7=_0x2581[_0x440c83];return _0x4d2db7;};'use strict';var EventEmitter=require(_0x1258('0x0'));var UserProfile=require(_0x1258('0x1'))['db'][_0x1258('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1258('0x3')](0x0);var events={'afterCreate':_0x1258('0x4'),'afterUpdate':'update','afterDestroy':_0x1258('0x5')};function emitEvent(_0x1235e5){return function(_0x339891,_0xb54644,_0x3ad6b0){UserProfileEvents[_0x1258('0x6')](_0x1235e5+':'+_0x339891['id'],_0x339891);UserProfileEvents[_0x1258('0x6')](_0x1235e5,_0x339891);_0x3ad6b0(null);};}for(var e in events){if(events[_0x1258('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x1258('0x8')]=UserProfileEvents;
\ No newline at end of file
index 62e6dbb..5753064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x158d=['define','UserProfile','mergeResources','Invalid\x20section\x20\x27','isEmpty','find','params','all','ignore','union','push','autoAssociation','length','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','VIRTUAL','AnalyticExtractedReport','foreignKey','merge','options','includeAll','forEach','reportType','default','DefaultReports','custom','reportId','CustomReports','include','Tags','tag','ThroughTags','openTabs','rows','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','filter','field','findAll','associatedResources','map','catch','value','model','UserProfileResource','then','type','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','name','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','Telephones','VoiceQueues','queue','VoiceQueue','inbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','sounds','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs'];(function(_0x24ad0b,_0xfc9e66){var _0x3cc0df=function(_0x525d97){while(--_0x525d97){_0x24ad0b['push'](_0x24ad0b['shift']());}};_0x3cc0df(++_0xfc9e66);}(_0x158d,0x1a2));var _0xd158=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x158d[_0x307d86];return _0x361745;};'use strict';var _=require(_0xd158('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd158('0x1'));module[_0xd158('0x2')]=function(_0x1b1750){var _0x35a025=_0x1b1750[_0xd158('0x3')];function _0x28f337(_0x4bd9ad,_0x245564){return new Promise(function(_0x870c40,_0x5928c9){if(!_0x245564)return _0x870c40(null);var _0x4e9eec=_0x245564[_0xd158('0x4')]?{[_0x245564[_0xd158('0x4')][_0xd158('0x5')]]:_0x245564[_0xd158('0x4')]['value']}:undefined;return _0x35a025[_0x4bd9ad][_0xd158('0x6')]({'where':_0x4e9eec,'raw':!![]})['then'](function(_0x8f706d){_0x245564[_0xd158('0x7')]=_[_0xd158('0x8')](_0x8f706d,'id');_0x870c40(_0x245564);})[_0xd158('0x9')](function(_0x567157){_0x5928c9(_0x567157);});});}function _0x3eda33(_0x45bcd8,_0x389245){return new Promise(function(_0x2fae3b,_0x2fb5ce){var _0x30563c=_0x45bcd8[_0xd158('0x4')]?{[_0x45bcd8[_0xd158('0x4')][_0xd158('0x5')]]:_0x45bcd8[_0xd158('0x4')][_0xd158('0xa')]}:undefined;return _0x35a025[_0x45bcd8[_0xd158('0xb')]]['findAll']({'where':_0x30563c,'raw':!![]})['then'](function(_0x67a057){_0x389245[_0xd158('0x7')]=_[_0xd158('0x8')](_0x67a057,function(_0x418993){return _0x418993['name'];});_0x2fae3b(_0x389245);})['catch'](function(_0x3769ef){_0x2fb5ce(_0x3769ef);});});}function _0x3ee140(_0xf4d976,_0xa845de,_0x38058e){if(!_0xa845de)return resolve(null);return new Promise(function(_0x578b36,_0x28a22d){return _0x35a025[_0xd158('0xc')][_0xd158('0x6')]({'where':{'sectionId':_0xa845de['id']},'raw':!![]})[_0xd158('0xd')](function(_0x4e60b9){if(_0xf4d976[_0xd158('0x5')]&&_0xf4d976[_0xd158('0x5')]!=='id'){_0xa845de['associatedResources']=_[_0xd158('0x8')](_0x4e60b9,function(_0x318661){return _0x318661[_0xf4d976[_0xd158('0x5')]];});}else{if(_0x38058e==='AnalyticExtractedReport'){_0xa845de[_0xd158('0x7')]=_[_0xd158('0x8')](_0x4e60b9,function(_0x27993d){return{'id':_0x27993d['resourceId'],'type':_0x27993d[_0xd158('0xe')]};});}else{_0xa845de[_0xd158('0x7')]=_[_0xd158('0x8')](_0x4e60b9,function(_0x4ee55b){return _0x4ee55b[_0xd158('0xf')];});}}_0x578b36(_0xa845de);})[_0xd158('0x9')](function(_0x24599b){_0x28a22d(_0x24599b);});});}function _0x27f5ce(_0x258d3d,_0x21bd4f){var _0x29817a={'parentSections':[]};switch(_0x258d3d[_0xd158('0x10')]()){case'squareprojects':_0x29817a[_0xd158('0x11')]=_0xd158('0x12');break;case _0xd158('0x13'):_0x29817a['childModel']=_0xd158('0x14');break;case'squarerecordings':_0x29817a[_0xd158('0x11')]=_0xd158('0x15');_0x29817a['parentSections']=[{'name':_0xd158('0x16'),'field':_0xd158('0x17'),'foreignKey':_0xd158('0x18')}];break;case'projects':_0x29817a[_0xd158('0x11')]=_0xd158('0x19');break;case _0xd158('0x1a'):_0x29817a['childModel']=_0xd158('0x1b');_0x29817a[_0xd158('0x1c')]=[{'name':_0xd158('0x1d'),'field':'id','foreignKey':_0xd158('0x1e')}];break;case _0xd158('0x1f'):_0x29817a[_0xd158('0x11')]=_0xd158('0x20');break;case _0xd158('0x21'):_0x29817a['childModel']='CmCompany';break;case'globalcustomfields':_0x29817a[_0xd158('0x11')]=_0xd158('0x22');break;case _0xd158('0x23'):_0x29817a[_0xd158('0x11')]=_0xd158('0x24');break;case _0xd158('0x25'):_0x29817a[_0xd158('0x11')]=_0xd158('0x26');break;case'faxqueues':_0x29817a[_0xd158('0x11')]=_0xd158('0x27');break;case'faxaccounts':_0x29817a[_0xd158('0x11')]='FaxAccount';break;case _0xd158('0x28'):case _0xd158('0x29'):case _0xd158('0x2a'):_0x29817a['childModel']=_0xd158('0x2b');break;case _0xd158('0x2c'):_0x29817a[_0xd158('0x11')]=_0xd158('0x2d');break;case _0xd158('0x2e'):_0x29817a[_0xd158('0x11')]=_0xd158('0x2f');break;case _0xd158('0x30'):_0x29817a['childModel']='VoiceRecording';_0x29817a[_0xd158('0x1c')]=[{'name':_0xd158('0x31'),'field':'name','foreignKey':_0xd158('0x32'),'model':_0xd158('0x33'),'filter':{'field':_0xd158('0x34'),'value':['agent']}},{'name':_0xd158('0x35'),'field':_0xd158('0x17'),'foreignKey':'membername','model':'User','filter':{'field':_0xd158('0x34'),'value':['telephone']}},{'name':_0xd158('0x36'),'field':'name','foreignKey':_0xd158('0x37'),'model':_0xd158('0x38'),'filter':{'field':'type','value':[_0xd158('0x39')]}},{'name':'QueueCampaigns','field':_0xd158('0x17'),'foreignKey':_0xd158('0x37'),'model':_0xd158('0x38'),'filter':{'field':_0xd158('0xe'),'value':['outbound']}}];break;case _0xd158('0x3a'):_0x29817a[_0xd158('0x11')]='VoiceMusicOnHold';break;case _0xd158('0x3b'):_0x29817a[_0xd158('0x11')]='VoiceChanSpy';break;case _0xd158('0x3c'):_0x29817a[_0xd158('0x11')]=_0xd158('0x3d');break;case _0xd158('0x3e'):_0x29817a[_0xd158('0x11')]=_0xd158('0x3f');break;case _0xd158('0x40'):_0x29817a[_0xd158('0x11')]=_0xd158('0x41');break;case _0xd158('0x42'):_0x29817a['childModel']=_0xd158('0x43');break;case _0xd158('0x44'):_0x29817a[_0xd158('0x11')]='MailSubstatus';break;case _0xd158('0x45'):_0x29817a['childModel']=_0xd158('0x46');break;case'openchannelaccounts':_0x29817a[_0xd158('0x11')]=_0xd158('0x47');break;case _0xd158('0x48'):_0x29817a['childModel']='SmsQueue';break;case _0xd158('0x49'):_0x29817a[_0xd158('0x11')]=_0xd158('0x4a');break;case'whatsappqueues':_0x29817a[_0xd158('0x11')]='WhatsappQueue';break;case _0xd158('0x4b'):_0x29817a[_0xd158('0x11')]=_0xd158('0x4c');break;case _0xd158('0x4d'):_0x29817a['childModel']=_0xd158('0x4e');break;case _0xd158('0x4f'):case _0xd158('0x50'):_0x29817a[_0xd158('0x11')]=_0xd158('0x38');if(_0x21bd4f){_0x29817a[_0xd158('0x1c')]=[{'name':_0xd158('0x36')},{'name':_0xd158('0x51')}];}break;case _0xd158('0x52'):case _0xd158('0x53'):case _0xd158('0x54'):_0x29817a[_0xd158('0x11')]=_0xd158('0x33');if(_0x21bd4f){_0x29817a[_0xd158('0x1c')]=[{'name':_0xd158('0x55'),'filter':{'field':_0xd158('0x34'),'value':[_0xd158('0x56'),_0xd158('0x57')]},'ignore':!![]},{'name':_0xd158('0x31')},{'name':_0xd158('0x35')}];}break;case _0xd158('0x58'):_0x29817a[_0xd158('0x11')]='ZendeskAccount';break;case _0xd158('0x59'):_0x29817a[_0xd158('0x11')]=_0xd158('0x5a');break;case _0xd158('0x5b'):_0x29817a[_0xd158('0x11')]=_0xd158('0x5c');break;case'sugarcrmaccounts':_0x29817a['childModel']=_0xd158('0x5d');break;case _0xd158('0x5e'):_0x29817a[_0xd158('0x11')]=_0xd158('0x5f');break;case _0xd158('0x60'):_0x29817a[_0xd158('0x11')]='ZohoAccount';break;case _0xd158('0x61'):_0x29817a[_0xd158('0x11')]=_0xd158('0x33');break;case _0xd158('0x62'):_0x29817a[_0xd158('0x11')]=_0xd158('0x63');break;case'dispositions':_0x29817a[_0xd158('0x11')]=_0xd158('0x64');break;case _0xd158('0x65'):_0x29817a[_0xd158('0x11')]=_0xd158('0x66');break;case _0xd158('0x67'):_0x29817a[_0xd158('0x11')]=_0xd158('0x68');break;case _0xd158('0x69'):_0x29817a[_0xd158('0x11')]='Pause';break;case _0xd158('0x6a'):_0x29817a[_0xd158('0x11')]='Schedule';break;case _0xd158('0x6b'):_0x29817a[_0xd158('0x11')]='Sound';break;case'tags':_0x29817a[_0xd158('0x11')]=_0xd158('0x6c');break;case'templates':_0x29817a[_0xd158('0x11')]='Template';break;case _0xd158('0x6d'):_0x29817a[_0xd158('0x11')]=_0xd158('0x6e');break;case _0xd158('0x6f'):_0x29817a[_0xd158('0x11')]=_0xd158('0x70');break;case _0xd158('0x71'):_0x29817a[_0xd158('0x11')]=_0xd158('0x72');break;case _0xd158('0x73'):_0x29817a[_0xd158('0x11')]='Plugin';break;case _0xd158('0x74'):_0x29817a['childModel']='AnalyticExtractedReport';_0x29817a[_0xd158('0x1c')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xd158('0x75'):_0x29817a[_0xd158('0x11')]=_0xd158('0x76');break;case _0xd158('0x4b'):_0x29817a[_0xd158('0x11')]=_0xd158('0x4c');break;}return _0x29817a;}function _0x5415bf(_0x11ffda,_0x4252c3){var _0x479fa4=_0x11ffda[_0xd158('0x77')](0x0)[_0xd158('0x78')]()+_0x11ffda[_0xd158('0x79')](0x1);var _0x24abe7={'type':_0x35a025['Sequelize'][_0xd158('0x7a')][_0xd158('0x7b')],'raw':!![]};return new BPromise(function(_0x46b0b9,_0x35ef41){var _0xc5e3b7=squel['select']()['field'](_0xd158('0x7c')+_0x479fa4+_0xd158('0x7d'),'id')['field'](_0xd158('0x7e'))['from'](_0xd158('0x7f')+_0x11ffda+'_interactions','ui')[_0xd158('0x80')](_0xd158('0x81'),_0x4252c3['id']);return _0x35a025[_0xd158('0x82')][_0xd158('0x83')](_0xc5e3b7[_0xd158('0x84')](),_0x24abe7)[_0xd158('0xd')](function(_0x1e37c3){_0x4252c3[_0x479fa4+_0xd158('0x85')]=_0x1e37c3;_0x46b0b9(_0x1e37c3);})[_0xd158('0x9')](function(_0x10eb01){_0x35ef41(_0x10eb01);});});}return _0x1b1750[_0xd158('0x86')](_0xd158('0x87'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1611f4){var _0x5deb7f={'raw':![],'where':{}};var _0x108146={};var _0x2c2f4d={'count':0x0,'rows':[]};var _0x24af63=_0x1611f4[_0xd158('0x83')]['section'];var _0x4f798e=_0x1611f4[_0xd158('0x83')][_0xd158('0x88')]||![];var _0x109e45=_0x27f5ce(_0x24af63,_0x4f798e);if(!_0x109e45[_0xd158('0x11')])throw new Error(_0xd158('0x89')+_0x24af63+'\x27');var _0x3f2d74=[{'name':_0x24af63}];if(!_[_0xd158('0x8a')](_0x109e45[_0xd158('0x1c')]))_0x3f2d74=_0x109e45[_0xd158('0x1c')];var _0x3dea2a=[];for(var _0x2274dc=0x0;_0x2274dc<_0x3f2d74['length'];_0x2274dc++){_0x3dea2a['push'](_0x35a025['UserProfileSection'][_0xd158('0x8b')]({'where':{'userProfileId':_0x1611f4[_0xd158('0x8c')]['id'],'name':_0x3f2d74[_0x2274dc][_0xd158('0x17')]},'raw':!![]}));}return Promise[_0xd158('0x8d')](_0x3dea2a)[_0xd158('0xd')](function(_0x1af75c){var _0x49c416=_[_0xd158('0x4')](_0x1af75c,function(_0x6bff0b){return _0x6bff0b?_0x6bff0b:undefined;});var _0x4895b0=_['filter'](_0x3f2d74,[_0xd158('0x8e'),!![]]);var _0x31073e=_[_0xd158('0x8a')](_0x49c416)&&_[_0xd158('0x8a')](_0x4895b0)?null:_[_0xd158('0x8f')](_0x4895b0,_0x49c416);if(!_0x31073e)return null;var _0x278f92=[];for(var _0x425d04=0x0;_0x425d04<_0x31073e['length'];_0x425d04++){var _0x3429cd=_[_0xd158('0x8b')](_0x3f2d74,function(_0x480ac8){return _0x31073e[_0x425d04]?_0x480ac8[_0xd158('0x17')]===_0x31073e[_0x425d04][_0xd158('0x17')]:null;});if(_0x3429cd){if(_0x31073e[_0x425d04][_0xd158('0x8e')]){_0x278f92[_0xd158('0x90')](_0x28f337(_0x109e45[_0xd158('0x11')],_0x31073e[_0x425d04]));}else{if(!_0x31073e[_0x425d04][_0xd158('0x91')]){_0x278f92[_0xd158('0x90')](_0x3ee140(_0x3429cd,_0x31073e[_0x425d04],_0x109e45[_0xd158('0x11')]));}else{if(_0x3429cd[_0xd158('0xb')]){_0x278f92[_0xd158('0x90')](_0x3eda33(_0x3429cd,_0x31073e[_0x425d04]));}}}}}return Promise['all'](_0x278f92);})[_0xd158('0xd')](function(_0x363bc6){var _0x46e036=_0x363bc6;var _0xdd83c4=null;if(_0x46e036){_0xdd83c4=_0x46e036[_0xd158('0x92')]===0x1?_0x46e036[0x0]:null;}if(!_0xdd83c4&&!_0x46e036)return _0x2c2f4d;var _0x53d47f=_0x35a025[_0x109e45[_0xd158('0x11')]][_0xd158('0x93')];_0x108146[_0xd158('0xb')]=_[_0xd158('0x94')](_0x53d47f);_0x108146['query']=_['keys'](_0x1611f4[_0xd158('0x83')]);_0x108146[_0xd158('0x95')]=_[_0xd158('0x96')](_0x108146[_0xd158('0xb')],_0x108146[_0xd158('0x83')]);_0x5deb7f['attributes']=_[_0xd158('0x96')](_0x108146[_0xd158('0xb')],qs[_0xd158('0x97')](_0x1611f4[_0xd158('0x83')][_0xd158('0x97')]));_0x5deb7f[_0xd158('0x98')]=_0x5deb7f[_0xd158('0x98')]['length']?_0x5deb7f[_0xd158('0x98')]:_0x108146['model'];if(!_0x1611f4[_0xd158('0x83')][_0xd158('0x99')]('nolimit')){_0x5deb7f['limit']=qs[_0xd158('0x9a')](_0x1611f4[_0xd158('0x83')]['limit']);_0x5deb7f['offset']=qs['offset'](_0x1611f4['query'][_0xd158('0x9b')]);}_0x5deb7f[_0xd158('0x9c')]=qs[_0xd158('0x9d')](_0x1611f4[_0xd158('0x83')]['sort']);_0x5deb7f['where']=qs[_0xd158('0x95')](_['pick'](_0x1611f4[_0xd158('0x83')],_0x108146[_0xd158('0x95')]));if(_0x1611f4['query'][_0xd158('0x4')]){_0x5deb7f['where']=_['merge'](_0x5deb7f['where'],{'$or':_[_0xd158('0x8')](_0x53d47f,function(_0x58b270){if(_0x58b270['type']['key']!==_0xd158('0x9e')){var _0x3237aa={};_0x3237aa[_0x58b270[_0xd158('0x5')]]={'$like':'%'+_0x1611f4[_0xd158('0x83')][_0xd158('0x4')]+'%'};return _0x3237aa;}})});}var _0x564142=[];if(_0xdd83c4){var _0x21b532=_[_0xd158('0x8b')](_0x3f2d74,[_0xd158('0x17'),_0xdd83c4[_0xd158('0x17')]]);if(_0x21b532['field']){var _0xf96b7f={};if(_0x109e45[_0xd158('0x11')]===_0xd158('0x9f')){_0xf96b7f[_0x21b532[_0xd158('0xa0')]]=_['map'](_0xdd83c4[_0xd158('0x7')],'id');}else{_0xf96b7f[_0x21b532[_0xd158('0xa0')]]=_0xdd83c4['associatedResources'];}_0x564142[_0xd158('0x90')](_0xf96b7f);}else{_0x5deb7f[_0xd158('0x80')]['id']=_0xdd83c4['associatedResources'];}}else{for(var _0x1c3d96=0x0;_0x1c3d96<_0x46e036['length'];_0x1c3d96++){var _0x21b532=_[_0xd158('0x8b')](_0x3f2d74,[_0xd158('0x17'),_0x46e036[_0x1c3d96]['name']]);if(_0x21b532['field']){var _0xf96b7f={};_0xf96b7f[_0x21b532[_0xd158('0xa0')]]=_0x46e036[_0x1c3d96][_0xd158('0x7')];_0x564142[_0xd158('0x90')](_0xf96b7f);}else{if(!_0x5deb7f[_0xd158('0x80')]['id'])_0x5deb7f[_0xd158('0x80')]['id']=[];_0x46e036[_0x1c3d96][_0xd158('0x7')]['forEach'](function(_0x38c913){_0x5deb7f[_0xd158('0x80')]['id'][_0xd158('0x90')](_0x38c913);});}}}if(!_[_0xd158('0x8a')](_0x564142)){_0x5deb7f[_0xd158('0x80')]=_[_0xd158('0xa1')](_0x5deb7f[_0xd158('0x80')],{'$and':{'$or':_0x564142}});}_0x5deb7f=_[_0xd158('0xa1')]({},_0x5deb7f,_0x1611f4[_0xd158('0xa2')]);if(_0xdd83c4&&!_0xdd83c4[_0xd158('0x91')]&&_0x109e45[_0xd158('0x11')]===_0xd158('0x9f')){if(_0x1611f4[_0xd158('0x83')][_0xd158('0xa3')]){_0x5deb7f['include']=[{'all':!![]}];}return _0x35a025[_0x109e45[_0xd158('0x11')]][_0xd158('0x6')](_0x5deb7f)[_0xd158('0xd')](function(_0x3e759e){var _0x38750a=[];_0x3e759e[_0xd158('0xa4')](function(_0x17a04e){var _0x11533d;switch(_0x17a04e[_0xd158('0xa5')]){case _0xd158('0xa6'):_0x11533d=_[_0xd158('0x8b')](_0xdd83c4['associatedResources'],function(_0xae10f4){return _0xae10f4['id']===_0x17a04e['reportId']&&_0xae10f4[_0xd158('0xe')]===_0xd158('0xa7');});break;case _0xd158('0xa8'):_0x11533d=_[_0xd158('0x8b')](_0xdd83c4['associatedResources'],function(_0x22d5c5){return _0x22d5c5['id']===_0x17a04e[_0xd158('0xa9')]&&_0x22d5c5[_0xd158('0xe')]===_0xd158('0xaa');});break;}if(_0x11533d)_0x38750a[_0xd158('0x90')](_0x17a04e);});_0x2c2f4d['count']=_0x38750a[_0xd158('0x92')];_0x2c2f4d['rows']=_0x38750a;return _0x2c2f4d;});}else{return _0x35a025[_0x109e45['childModel']]['count']({'where':_0x5deb7f['where']})['then'](function(_0x5a91a5){_0x2c2f4d['count']=_0x5a91a5;if(_0x1611f4[_0xd158('0x83')][_0xd158('0xa3')]){if(_0x109e45[_0xd158('0x11')]===_0xd158('0x1b')){_0x5deb7f[_0xd158('0xab')]=[{'model':_0x35a025[_0xd158('0x6c')],'as':_0xd158('0xac'),'attributes':['id',_0xd158('0x17'),'color'],'required':_0x1611f4['query'][_0xd158('0xad')]?!![]:![]},{'model':_0x35a025[_0xd158('0x6c')],'as':_0xd158('0xae'),'attributes':['id',_0xd158('0x17'),'color'],'through':_0x1611f4['query'][_0xd158('0xad')]?{'attributes':[],'where':{'TagId':_0x1611f4[_0xd158('0x83')][_0xd158('0xad')]||undefined}}:{},'required':_0x1611f4[_0xd158('0x83')][_0xd158('0xad')]?!![]:![]}];}else{_0x5deb7f[_0xd158('0xab')]=[{'all':!![]}];}}return _0x35a025[_0x109e45[_0xd158('0x11')]]['findAll'](_0x5deb7f);})[_0xd158('0xd')](function(_0x56d167){_0x2c2f4d['rows']=_0x56d167;if(_0x24af63===_0xd158('0x31')&&_0x1611f4[_0xd158('0x83')][_0xd158('0xaf')]==='true'){var _0x3f4d4d=[];for(var _0x2bd0d3=0x0;_0x2bd0d3<_0x2c2f4d[_0xd158('0xb0')][_0xd158('0x92')];_0x2bd0d3++){_0x3f4d4d[_0xd158('0x90')](_0x5415bf(_0xd158('0xb1'),_0x2c2f4d[_0xd158('0xb0')][_0x2bd0d3][_0xd158('0xb2')]));_0x3f4d4d['push'](_0x5415bf(_0xd158('0xb3'),_0x2c2f4d['rows'][_0x2bd0d3]['dataValues']));_0x3f4d4d[_0xd158('0x90')](_0x5415bf(_0xd158('0xb4'),_0x2c2f4d[_0xd158('0xb0')][_0x2bd0d3][_0xd158('0xb2')]));_0x3f4d4d[_0xd158('0x90')](_0x5415bf(_0xd158('0xb5'),_0x2c2f4d['rows'][_0x2bd0d3][_0xd158('0xb2')]));_0x3f4d4d[_0xd158('0x90')](_0x5415bf(_0xd158('0xb6'),_0x2c2f4d[_0xd158('0xb0')][_0x2bd0d3]['dataValues']));_0x3f4d4d['push'](_0x5415bf(_0xd158('0xb7'),_0x2c2f4d[_0xd158('0xb0')][_0x2bd0d3]['dataValues']));}return Promise[_0xd158('0x8d')](_0x3f4d4d)[_0xd158('0xd')](function(){return _0x2c2f4d;});}return _0x2c2f4d;});}});}}});};
\ No newline at end of file
+var _0x6560=['VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','QueueCampaigns','agents','Users','role','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Schedule','sounds','Sound','tags','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','custom','CustomReports','rows','count','color','ThroughTags','tag','openTabs','chat','dataValues','sms','fax','mail','openchannel','lodash','../../components/parsers/qs','exports','models','filter','field','associatedResources','map','value','model','findAll','name','catch','UserProfileResource','then','AnalyticExtractedReport','toLowerCase','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','User','agent','membername','VoiceQueues','VoiceQueue','type','inbound','queue','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes'];(function(_0x303163,_0x4728c0){var _0x3e394f=function(_0x6e5699){while(--_0x6e5699){_0x303163['push'](_0x303163['shift']());}};_0x3e394f(++_0x4728c0);}(_0x6560,0x7c));var _0x0656=function(_0x5e01f9,_0x26bebb){_0x5e01f9=_0x5e01f9-0x0;var _0x2bce6f=_0x6560[_0x5e01f9];return _0x2bce6f;};'use strict';var _=require(_0x0656('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x0656('0x1'));module[_0x0656('0x2')]=function(_0x23f34a){var _0x36486c=_0x23f34a[_0x0656('0x3')];function _0x3ad5c7(_0x4239e3,_0x1dcd16){return new Promise(function(_0x1e8cac,_0x594e8b){if(!_0x1dcd16)return _0x1e8cac(null);var _0x3bc1df=_0x1dcd16[_0x0656('0x4')]?{[_0x1dcd16[_0x0656('0x4')][_0x0656('0x5')]]:_0x1dcd16[_0x0656('0x4')]['value']}:undefined;return _0x36486c[_0x4239e3]['findAll']({'where':_0x3bc1df,'raw':!![]})['then'](function(_0xd17aa8){_0x1dcd16[_0x0656('0x6')]=_[_0x0656('0x7')](_0xd17aa8,'id');_0x1e8cac(_0x1dcd16);})['catch'](function(_0x3240c2){_0x594e8b(_0x3240c2);});});}function _0x10d731(_0x3507da,_0x70681){return new Promise(function(_0x361c70,_0x38aa28){var _0xdd751a=_0x3507da[_0x0656('0x4')]?{[_0x3507da[_0x0656('0x4')][_0x0656('0x5')]]:_0x3507da[_0x0656('0x4')][_0x0656('0x8')]}:undefined;return _0x36486c[_0x3507da[_0x0656('0x9')]][_0x0656('0xa')]({'where':_0xdd751a,'raw':!![]})['then'](function(_0x4a1ad2){_0x70681[_0x0656('0x6')]=_[_0x0656('0x7')](_0x4a1ad2,function(_0x2eaea9){return _0x2eaea9[_0x0656('0xb')];});_0x361c70(_0x70681);})[_0x0656('0xc')](function(_0x180180){_0x38aa28(_0x180180);});});}function _0x53545d(_0x31f76c,_0x4fefd4,_0x31fa43){if(!_0x4fefd4)return resolve(null);return new Promise(function(_0x443003,_0x5a3dc2){return _0x36486c[_0x0656('0xd')][_0x0656('0xa')]({'where':{'sectionId':_0x4fefd4['id']},'raw':!![]})[_0x0656('0xe')](function(_0x3ed91e){if(_0x31f76c[_0x0656('0x5')]&&_0x31f76c['field']!=='id'){_0x4fefd4[_0x0656('0x6')]=_[_0x0656('0x7')](_0x3ed91e,function(_0x53f71a){return _0x53f71a[_0x31f76c[_0x0656('0x5')]];});}else{if(_0x31fa43===_0x0656('0xf')){_0x4fefd4[_0x0656('0x6')]=_[_0x0656('0x7')](_0x3ed91e,function(_0x2c742d){return{'id':_0x2c742d['resourceId'],'type':_0x2c742d['type']};});}else{_0x4fefd4[_0x0656('0x6')]=_['map'](_0x3ed91e,function(_0x5b15cb){return _0x5b15cb['resourceId'];});}}_0x443003(_0x4fefd4);})[_0x0656('0xc')](function(_0x208684){_0x5a3dc2(_0x208684);});});}function _0x37217a(_0x18e6be,_0x5ccace){var _0xeaf41={'parentSections':[]};switch(_0x18e6be[_0x0656('0x10')]()){case'squareprojects':_0xeaf41[_0x0656('0x11')]='SquareProject';break;case'odbc':_0xeaf41[_0x0656('0x11')]='SquareOdbc';break;case _0x0656('0x12'):_0xeaf41['childModel']=_0x0656('0x13');_0xeaf41[_0x0656('0x14')]=[{'name':_0x0656('0x15'),'field':_0x0656('0xb'),'foreignKey':'projectName'}];break;case _0x0656('0x16'):_0xeaf41['childModel']=_0x0656('0x17');break;case _0x0656('0x18'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x19');_0xeaf41[_0x0656('0x14')]=[{'name':_0x0656('0x1a'),'field':'id','foreignKey':_0x0656('0x1b')}];break;case _0x0656('0x1c'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x1d');break;case _0x0656('0x1e'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x1f');break;case _0x0656('0x20'):_0xeaf41[_0x0656('0x11')]='CmCustomField';break;case _0x0656('0x21'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x22');break;case'chatwebsites':_0xeaf41[_0x0656('0x11')]=_0x0656('0x23');break;case _0x0656('0x24'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x25');break;case _0x0656('0x26'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x27');break;case'inboundroutes':case _0x0656('0x28'):case _0x0656('0x29'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x2a');break;case _0x0656('0x2b'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x2c');break;case'voicemails':_0xeaf41[_0x0656('0x11')]=_0x0656('0x2d');break;case _0x0656('0x2e'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x2f');_0xeaf41[_0x0656('0x14')]=[{'name':_0x0656('0x30'),'field':_0x0656('0xb'),'foreignKey':'membername','model':_0x0656('0x31'),'filter':{'field':'role','value':[_0x0656('0x32')]}},{'name':'Telephones','field':_0x0656('0xb'),'foreignKey':_0x0656('0x33'),'model':_0x0656('0x31'),'filter':{'field':'role','value':['telephone']}},{'name':_0x0656('0x34'),'field':'name','foreignKey':'queue','model':_0x0656('0x35'),'filter':{'field':_0x0656('0x36'),'value':[_0x0656('0x37')]}},{'name':'QueueCampaigns','field':_0x0656('0xb'),'foreignKey':_0x0656('0x38'),'model':_0x0656('0x35'),'filter':{'field':_0x0656('0x36'),'value':['outbound']}}];break;case'musiconholds':_0xeaf41[_0x0656('0x11')]=_0x0656('0x39');break;case _0x0656('0x3a'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x3b');break;case _0x0656('0x3c'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x3d');break;case'ivrcampaigns':_0xeaf41['childModel']=_0x0656('0x3e');break;case'mailqueues':_0xeaf41[_0x0656('0x11')]=_0x0656('0x3f');break;case _0x0656('0x40'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x41');break;case _0x0656('0x42'):_0xeaf41[_0x0656('0x11')]='MailSubstatus';break;case _0x0656('0x43'):_0xeaf41['childModel']=_0x0656('0x44');break;case _0x0656('0x45'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x46');break;case _0x0656('0x47'):_0xeaf41['childModel']=_0x0656('0x48');break;case _0x0656('0x49'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x4a');break;case'whatsappqueues':_0xeaf41[_0x0656('0x11')]=_0x0656('0x4b');break;case _0x0656('0x4c'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x4d');break;case'teams':_0xeaf41[_0x0656('0x11')]='Team';break;case _0x0656('0x4e'):case'queuecampaigns':_0xeaf41[_0x0656('0x11')]=_0x0656('0x35');if(_0x5ccace){_0xeaf41['parentSections']=[{'name':_0x0656('0x34')},{'name':_0x0656('0x4f')}];}break;case'users':case _0x0656('0x50'):case'telephones':_0xeaf41[_0x0656('0x11')]=_0x0656('0x31');if(_0x5ccace){_0xeaf41[_0x0656('0x14')]=[{'name':_0x0656('0x51'),'filter':{'field':_0x0656('0x52'),'value':[_0x0656('0x53'),_0x0656('0x54')]},'ignore':!![]},{'name':_0x0656('0x30')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0xeaf41[_0x0656('0x11')]=_0x0656('0x55');break;case _0x0656('0x56'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x57');break;case _0x0656('0x58'):_0xeaf41['childModel']='FreshdeskAccount';break;case _0x0656('0x59'):_0xeaf41['childModel']=_0x0656('0x5a');break;case _0x0656('0x5b'):_0xeaf41['childModel']=_0x0656('0x5c');break;case _0x0656('0x5d'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x5e');break;case _0x0656('0x5f'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x31');break;case _0x0656('0x60'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x61');break;case _0x0656('0x62'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x63');break;case _0x0656('0x64'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x65');break;case _0x0656('0x66'):_0xeaf41[_0x0656('0x11')]='Interval';break;case _0x0656('0x67'):_0xeaf41[_0x0656('0x11')]='Pause';break;case'scheduler':_0xeaf41['childModel']=_0x0656('0x68');break;case _0x0656('0x69'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x6a');break;case _0x0656('0x6b'):_0xeaf41['childModel']=_0x0656('0x6c');break;case _0x0656('0x6d'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x6e');break;case'triggers':_0xeaf41[_0x0656('0x11')]=_0x0656('0x6f');break;case _0x0656('0x70'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x71');break;case _0x0656('0x72'):_0xeaf41[_0x0656('0x11')]=_0x0656('0x73');break;case'plugins':_0xeaf41['childModel']=_0x0656('0x74');break;case'extractedreports':_0xeaf41[_0x0656('0x11')]=_0x0656('0xf');_0xeaf41[_0x0656('0x14')]=[{'name':_0x0656('0x75'),'field':'id','foreignKey':_0x0656('0x76')}];break;case'metrics':_0xeaf41[_0x0656('0x11')]=_0x0656('0x77');break;case _0x0656('0x4c'):_0xeaf41[_0x0656('0x11')]='WhatsappAccount';break;}return _0xeaf41;}function _0x287dbe(_0x21450c,_0x90c14d){var _0x1d105d=_0x21450c[_0x0656('0x78')](0x0)[_0x0656('0x79')]()+_0x21450c[_0x0656('0x7a')](0x1);var _0xea1353={'type':_0x36486c[_0x0656('0x7b')][_0x0656('0x7c')][_0x0656('0x7d')],'raw':!![]};return new BPromise(function(_0xc21995,_0x1451a3){var _0x17d15b=squel[_0x0656('0x7e')]()['field'](_0x0656('0x7f')+_0x1d105d+_0x0656('0x80'),'id')[_0x0656('0x5')](_0x0656('0x81'))[_0x0656('0x82')]('user_has_'+_0x21450c+_0x0656('0x83'),'ui')[_0x0656('0x84')]('ui.UserId\x20=\x20?',_0x90c14d['id']);return _0x36486c['sequelize'][_0x0656('0x85')](_0x17d15b[_0x0656('0x86')](),_0xea1353)[_0x0656('0xe')](function(_0x2a7af9){_0x90c14d[_0x1d105d+_0x0656('0x87')]=_0x2a7af9;_0xc21995(_0x2a7af9);})['catch'](function(_0x21292c){_0x1451a3(_0x21292c);});});}return _0x23f34a['define'](_0x0656('0x88'),attributes,{'tableName':_0x0656('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5c26a7){var _0x2df574={'raw':![],'where':{}};var _0x1e7455={};var _0xa8839={'count':0x0,'rows':[]};var _0x44b8b2=_0x5c26a7['query'][_0x0656('0x8a')];var _0x5f06e9=_0x5c26a7[_0x0656('0x85')][_0x0656('0x8b')]||![];var _0x281b1f=_0x37217a(_0x44b8b2,_0x5f06e9);if(!_0x281b1f[_0x0656('0x11')])throw new Error(_0x0656('0x8c')+_0x44b8b2+'\x27');var _0x425dd3=[{'name':_0x44b8b2}];if(!_[_0x0656('0x8d')](_0x281b1f[_0x0656('0x14')]))_0x425dd3=_0x281b1f['parentSections'];var _0x4361c5=[];for(var _0x40cd7c=0x0;_0x40cd7c<_0x425dd3[_0x0656('0x8e')];_0x40cd7c++){_0x4361c5[_0x0656('0x8f')](_0x36486c[_0x0656('0x90')][_0x0656('0x91')]({'where':{'userProfileId':_0x5c26a7[_0x0656('0x92')]['id'],'name':_0x425dd3[_0x40cd7c][_0x0656('0xb')]},'raw':!![]}));}return Promise[_0x0656('0x93')](_0x4361c5)[_0x0656('0xe')](function(_0x484f73){var _0x19dee5=_[_0x0656('0x4')](_0x484f73,function(_0x1c3fa5){return _0x1c3fa5?_0x1c3fa5:undefined;});var _0xabba6f=_[_0x0656('0x4')](_0x425dd3,[_0x0656('0x94'),!![]]);var _0x1f1705=_[_0x0656('0x8d')](_0x19dee5)&&_[_0x0656('0x8d')](_0xabba6f)?null:_['union'](_0xabba6f,_0x19dee5);if(!_0x1f1705)return null;var _0x4efdbf=[];for(var _0x278fb1=0x0;_0x278fb1<_0x1f1705['length'];_0x278fb1++){var _0x5f3817=_[_0x0656('0x91')](_0x425dd3,function(_0x5c60b3){return _0x1f1705[_0x278fb1]?_0x5c60b3['name']===_0x1f1705[_0x278fb1]['name']:null;});if(_0x5f3817){if(_0x1f1705[_0x278fb1][_0x0656('0x94')]){_0x4efdbf[_0x0656('0x8f')](_0x3ad5c7(_0x281b1f[_0x0656('0x11')],_0x1f1705[_0x278fb1]));}else{if(!_0x1f1705[_0x278fb1][_0x0656('0x95')]){_0x4efdbf['push'](_0x53545d(_0x5f3817,_0x1f1705[_0x278fb1],_0x281b1f[_0x0656('0x11')]));}else{if(_0x5f3817[_0x0656('0x9')]){_0x4efdbf[_0x0656('0x8f')](_0x10d731(_0x5f3817,_0x1f1705[_0x278fb1]));}}}}}return Promise[_0x0656('0x93')](_0x4efdbf);})[_0x0656('0xe')](function(_0x53ae76){var _0x32bd38=_0x53ae76;var _0x2fcfc0=null;if(_0x32bd38){_0x2fcfc0=_0x32bd38[_0x0656('0x8e')]===0x1?_0x32bd38[0x0]:null;}if(!_0x2fcfc0&&!_0x32bd38)return _0xa8839;var _0xffe95e=_0x36486c[_0x281b1f[_0x0656('0x11')]]['rawAttributes'];_0x1e7455[_0x0656('0x9')]=_[_0x0656('0x96')](_0xffe95e);_0x1e7455[_0x0656('0x85')]=_['keys'](_0x5c26a7[_0x0656('0x85')]);_0x1e7455[_0x0656('0x97')]=_[_0x0656('0x98')](_0x1e7455[_0x0656('0x9')],_0x1e7455[_0x0656('0x85')]);_0x2df574[_0x0656('0x99')]=_[_0x0656('0x98')](_0x1e7455[_0x0656('0x9')],qs['fields'](_0x5c26a7[_0x0656('0x85')]['fields']));_0x2df574[_0x0656('0x99')]=_0x2df574[_0x0656('0x99')][_0x0656('0x8e')]?_0x2df574[_0x0656('0x99')]:_0x1e7455[_0x0656('0x9')];if(!_0x5c26a7[_0x0656('0x85')][_0x0656('0x9a')](_0x0656('0x9b'))){_0x2df574[_0x0656('0x9c')]=qs[_0x0656('0x9c')](_0x5c26a7[_0x0656('0x85')][_0x0656('0x9c')]);_0x2df574[_0x0656('0x9d')]=qs[_0x0656('0x9d')](_0x5c26a7[_0x0656('0x85')][_0x0656('0x9d')]);}_0x2df574[_0x0656('0x9e')]=qs[_0x0656('0x9f')](_0x5c26a7[_0x0656('0x85')][_0x0656('0x9f')]);_0x2df574['where']=qs[_0x0656('0x97')](_[_0x0656('0xa0')](_0x5c26a7[_0x0656('0x85')],_0x1e7455[_0x0656('0x97')]));if(_0x5c26a7[_0x0656('0x85')][_0x0656('0x4')]){_0x2df574[_0x0656('0x84')]=_['merge'](_0x2df574[_0x0656('0x84')],{'$or':_[_0x0656('0x7')](_0xffe95e,function(_0x4664d0){if(_0x4664d0['type'][_0x0656('0xa1')]!==_0x0656('0xa2')){var _0x291e5a={};_0x291e5a[_0x4664d0['field']]={'$like':'%'+_0x5c26a7[_0x0656('0x85')][_0x0656('0x4')]+'%'};return _0x291e5a;}})});}var _0x57683c=[];if(_0x2fcfc0){var _0x3ad9cf=_[_0x0656('0x91')](_0x425dd3,['name',_0x2fcfc0['name']]);if(_0x3ad9cf[_0x0656('0x5')]){var _0x452a21={};if(_0x281b1f['childModel']===_0x0656('0xf')){_0x452a21[_0x3ad9cf[_0x0656('0xa3')]]=_[_0x0656('0x7')](_0x2fcfc0['associatedResources'],'id');}else{_0x452a21[_0x3ad9cf[_0x0656('0xa3')]]=_0x2fcfc0[_0x0656('0x6')];}_0x57683c[_0x0656('0x8f')](_0x452a21);}else{_0x2df574[_0x0656('0x84')]['id']=_0x2fcfc0[_0x0656('0x6')];}}else{for(var _0x1e2b50=0x0;_0x1e2b50<_0x32bd38[_0x0656('0x8e')];_0x1e2b50++){var _0x3ad9cf=_[_0x0656('0x91')](_0x425dd3,['name',_0x32bd38[_0x1e2b50][_0x0656('0xb')]]);if(_0x3ad9cf[_0x0656('0x5')]){var _0x452a21={};_0x452a21[_0x3ad9cf[_0x0656('0xa3')]]=_0x32bd38[_0x1e2b50][_0x0656('0x6')];_0x57683c[_0x0656('0x8f')](_0x452a21);}else{if(!_0x2df574[_0x0656('0x84')]['id'])_0x2df574[_0x0656('0x84')]['id']=[];_0x32bd38[_0x1e2b50][_0x0656('0x6')][_0x0656('0xa4')](function(_0x48114b){_0x2df574['where']['id']['push'](_0x48114b);});}}}if(!_[_0x0656('0x8d')](_0x57683c)){_0x2df574[_0x0656('0x84')]=_['merge'](_0x2df574[_0x0656('0x84')],{'$and':{'$or':_0x57683c}});}_0x2df574=_[_0x0656('0xa5')]({},_0x2df574,_0x5c26a7[_0x0656('0xa6')]);if(_0x2fcfc0&&!_0x2fcfc0[_0x0656('0x95')]&&_0x281b1f[_0x0656('0x11')]===_0x0656('0xf')){if(_0x5c26a7[_0x0656('0x85')][_0x0656('0xa7')]){_0x2df574[_0x0656('0xa8')]=[{'all':!![]}];}return _0x36486c[_0x281b1f[_0x0656('0x11')]][_0x0656('0xa')](_0x2df574)[_0x0656('0xe')](function(_0x2eb9a8){var _0x37cdf4=[];_0x2eb9a8[_0x0656('0xa4')](function(_0x5d01ba){var _0x180519;switch(_0x5d01ba['reportType']){case _0x0656('0xa9'):_0x180519=_[_0x0656('0x91')](_0x2fcfc0[_0x0656('0x6')],function(_0x216a01){return _0x216a01['id']===_0x5d01ba[_0x0656('0x76')]&&_0x216a01[_0x0656('0x36')]===_0x0656('0xaa');});break;case _0x0656('0xab'):_0x180519=_[_0x0656('0x91')](_0x2fcfc0[_0x0656('0x6')],function(_0x2182f9){return _0x2182f9['id']===_0x5d01ba[_0x0656('0x76')]&&_0x2182f9[_0x0656('0x36')]===_0x0656('0xac');});break;}if(_0x180519)_0x37cdf4['push'](_0x5d01ba);});_0xa8839['count']=_0x37cdf4[_0x0656('0x8e')];_0xa8839[_0x0656('0xad')]=_0x37cdf4;return _0xa8839;});}else{return _0x36486c[_0x281b1f[_0x0656('0x11')]][_0x0656('0xae')]({'where':_0x2df574[_0x0656('0x84')]})[_0x0656('0xe')](function(_0x275bf5){_0xa8839[_0x0656('0xae')]=_0x275bf5;if(_0x5c26a7[_0x0656('0x85')][_0x0656('0xa7')]){if(_0x281b1f[_0x0656('0x11')]===_0x0656('0x19')){_0x2df574['include']=[{'model':_0x36486c[_0x0656('0x6c')],'as':'Tags','attributes':['id','name',_0x0656('0xaf')],'required':_0x5c26a7['query']['tag']?!![]:![]},{'model':_0x36486c[_0x0656('0x6c')],'as':_0x0656('0xb0'),'attributes':['id','name',_0x0656('0xaf')],'through':_0x5c26a7['query']['tag']?{'attributes':[],'where':{'TagId':_0x5c26a7['query'][_0x0656('0xb1')]||undefined}}:{},'required':_0x5c26a7[_0x0656('0x85')]['tag']?!![]:![]}];}else{_0x2df574[_0x0656('0xa8')]=[{'all':!![]}];}}return _0x36486c[_0x281b1f[_0x0656('0x11')]]['findAll'](_0x2df574);})[_0x0656('0xe')](function(_0x3bda8c){_0xa8839['rows']=_0x3bda8c;if(_0x44b8b2===_0x0656('0x30')&&_0x5c26a7[_0x0656('0x85')][_0x0656('0xb2')]==='true'){var _0x5eaed3=[];for(var _0x4e3e4d=0x0;_0x4e3e4d<_0xa8839['rows'][_0x0656('0x8e')];_0x4e3e4d++){_0x5eaed3[_0x0656('0x8f')](_0x287dbe(_0x0656('0xb3'),_0xa8839['rows'][_0x4e3e4d][_0x0656('0xb4')]));_0x5eaed3['push'](_0x287dbe(_0x0656('0xb5'),_0xa8839[_0x0656('0xad')][_0x4e3e4d]['dataValues']));_0x5eaed3[_0x0656('0x8f')](_0x287dbe(_0x0656('0xb6'),_0xa8839[_0x0656('0xad')][_0x4e3e4d]['dataValues']));_0x5eaed3['push'](_0x287dbe(_0x0656('0xb7'),_0xa8839[_0x0656('0xad')][_0x4e3e4d][_0x0656('0xb4')]));_0x5eaed3['push'](_0x287dbe(_0x0656('0xb8'),_0xa8839['rows'][_0x4e3e4d][_0x0656('0xb4')]));_0x5eaed3[_0x0656('0x8f')](_0x287dbe('whatsapp',_0xa8839[_0x0656('0xad')][_0x4e3e4d][_0x0656('0xb4')]));}return Promise[_0x0656('0x93')](_0x5eaed3)[_0x0656('0xe')](function(){return _0xa8839;});}return _0xa8839;});}});}}});};
\ No newline at end of file
index 02d117a..815405f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./userProfile.socket','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x2dbe4a,_0x21d241){var _0x66b87f=function(_0x5066ec){while(--_0x5066ec){_0x2dbe4a['push'](_0x2dbe4a['shift']());}};_0x66b87f(++_0x21d241);}(_0x1261,0x144));var _0x1126=function(_0x5aea5a,_0x346fe0){_0x5aea5a=_0x5aea5a-0x0;var _0x557a58=_0x1261[_0x5aea5a];return _0x557a58;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('UserProfile,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}
\ No newline at end of file
+var _0x044a=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x41b465,_0x547671){var _0x320b95=function(_0x32f26f){while(--_0x32f26f){_0x41b465['push'](_0x41b465['shift']());}};_0x320b95(++_0x547671);}(_0x044a,0x173));var _0xa044=function(_0x382618,_0x3ec6ac){_0x382618=_0x382618-0x0;var _0x18db89=_0x044a[_0x382618];return _0x18db89;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var moment=require(_0xa044('0x2'));var BPromise=require(_0xa044('0x3'));var rs=require(_0xa044('0x4'));var fs=require('fs');var Redis=require(_0xa044('0x5'));var db=require(_0xa044('0x6'))['db'];var utils=require(_0xa044('0x7'));var logger=require(_0xa044('0x8'))(_0xa044('0x9'));var config=require('../../config/environment');var jayson=require(_0xa044('0xa'));var client=jayson[_0xa044('0xb')][_0xa044('0xc')]({'port':0x232a});config[_0xa044('0xd')]=_['defaults'](config[_0xa044('0xd')],{'host':_0xa044('0xe'),'port':0x18eb});var socket=require(_0xa044('0xf'))(new Redis(config[_0xa044('0xd')]));require('./userProfile.socket')[_0xa044('0x10')](socket);function respondWithRpcPromise(_0x9dec14,_0x3f170b,_0x47a9dc){return new BPromise(function(_0xdf14f6,_0xa3b07f){return client[_0xa044('0x11')](_0x9dec14,_0x47a9dc)[_0xa044('0x12')](function(_0x5e203d){logger[_0xa044('0x13')]('UserProfile,\x20%s,\x20%s',_0x3f170b,'request\x20sent');logger[_0xa044('0x14')](_0xa044('0x15'),_0x3f170b,_0xa044('0x16'),JSON[_0xa044('0x17')](_0x5e203d));if(_0x5e203d[_0xa044('0x18')]){if(_0x5e203d[_0xa044('0x18')][_0xa044('0x19')]===0x1f4){logger['error'](_0xa044('0x1a'),_0x3f170b,_0x5e203d['error'][_0xa044('0x1b')]);return _0xa3b07f(_0x5e203d[_0xa044('0x18')][_0xa044('0x1b')]);}logger[_0xa044('0x18')](_0xa044('0x1a'),_0x3f170b,_0x5e203d['error']['message']);return _0xdf14f6(_0x5e203d[_0xa044('0x18')]['message']);}else{logger[_0xa044('0x13')](_0xa044('0x1a'),_0x3f170b,_0xa044('0x16'));_0xdf14f6(_0x5e203d[_0xa044('0x1c')][_0xa044('0x1b')]);}})['catch'](function(_0x567124){logger['error'](_0xa044('0x1a'),_0x3f170b,_0x567124);_0xa3b07f(_0x567124);});});}
\ No newline at end of file
index 0b0f838..745a746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['remove','update','emit','removeListener','length','userProfile:','./userProfile.events'];(function(_0x4e990a,_0x401fab){var _0x17c219=function(_0x27d3d0){while(--_0x27d3d0){_0x4e990a['push'](_0x4e990a['shift']());}};_0x17c219(++_0x401fab);}(_0x9957,0x133));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var UserProfileEvents=require(_0x7995('0x0'));var events=['save',_0x7995('0x1'),_0x7995('0x2')];function createListener(_0x2f71ac,_0x1151d0){return function(_0x722bc7){_0x1151d0[_0x7995('0x3')](_0x2f71ac,_0x722bc7);};}function removeListener(_0x577b05,_0x1e43cf){return function(){UserProfileEvents[_0x7995('0x4')](_0x577b05,_0x1e43cf);};}exports['register']=function(_0x92ece1){for(var _0x589fd3=0x0,_0x5d85d7=events[_0x7995('0x5')];_0x589fd3<_0x5d85d7;_0x589fd3++){var _0x13b58a=events[_0x589fd3];var _0x3a373a=createListener(_0x7995('0x6')+_0x13b58a,_0x92ece1);UserProfileEvents['on'](_0x13b58a,_0x3a373a);}};
\ No newline at end of file
+var _0xb7ef=['register','userProfile:','./userProfile.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7ef,0xc2));var _0xfb7e=function(_0x5820a2,_0x593c71){_0x5820a2=_0x5820a2-0x0;var _0x15c707=_0xb7ef[_0x5820a2];return _0x15c707;};'use strict';var UserProfileEvents=require(_0xfb7e('0x0'));var events=[_0xfb7e('0x1'),'remove',_0xfb7e('0x2')];function createListener(_0x1fa5d0,_0x3467a3){return function(_0x36eddd){_0x3467a3[_0xfb7e('0x3')](_0x1fa5d0,_0x36eddd);};}function removeListener(_0x3dd37b,_0xe27a48){return function(){UserProfileEvents['removeListener'](_0x3dd37b,_0xe27a48);};}exports[_0xfb7e('0x4')]=function(_0x75e4fd){for(var _0x3b41f1=0x0,_0x8553e1=events['length'];_0x3b41f1<_0x8553e1;_0x3b41f1++){var _0x198a26=events[_0x3b41f1];var _0x547479=createListener(_0xfb7e('0x5')+_0x198a26,_0x75e4fd);UserProfileEvents['on'](_0x198a26,_0x547479);}};
\ No newline at end of file
index 54b3a3a..89ca699 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03e6=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x03e6,0x10a));var _0x603e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x03e6[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x603e('0x0'));var util=require(_0x603e('0x1'));var path=require(_0x603e('0x2'));var timeout=require(_0x603e('0x3'));var express=require(_0x603e('0x4'));var router=express['Router']();var fs_extra=require(_0x603e('0x5'));var auth=require(_0x603e('0x6'));var interaction=require(_0x603e('0x7'));var config=require(_0x603e('0x8'));var controller=require(_0x603e('0x9'));router[_0x603e('0xa')]('/',auth['isAuthenticated'](),controller[_0x603e('0xb')]);router[_0x603e('0xa')](_0x603e('0xc'),auth[_0x603e('0xd')](),controller['describe']);router[_0x603e('0xa')](_0x603e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x603e('0xf')]('/',auth[_0x603e('0xd')](),controller[_0x603e('0x10')]);router[_0x603e('0x11')](_0x603e('0xe'),auth[_0x603e('0xd')](),controller[_0x603e('0x12')]);router[_0x603e('0x13')](_0x603e('0xe'),auth[_0x603e('0xd')](),controller['destroy']);module[_0x603e('0x14')]=router;
\ No newline at end of file
+var _0x9086=['/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','index','/describe','isAuthenticated','describe'];(function(_0x199b64,_0x5d1120){var _0x42b220=function(_0x26d4e6){while(--_0x26d4e6){_0x199b64['push'](_0x199b64['shift']());}};_0x42b220(++_0x5d1120);}(_0x9086,0x10b));var _0x6908=function(_0x1be7fd,_0x51ff5a){_0x1be7fd=_0x1be7fd-0x0;var _0x2f7949=_0x9086[_0x1be7fd];return _0x2f7949;};'use strict';var multer=require(_0x6908('0x0'));var util=require(_0x6908('0x1'));var path=require('path');var timeout=require(_0x6908('0x2'));var express=require(_0x6908('0x3'));var router=express[_0x6908('0x4')]();var fs_extra=require(_0x6908('0x5'));var auth=require(_0x6908('0x6'));var interaction=require(_0x6908('0x7'));var config=require('../../config/environment');var controller=require(_0x6908('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6908('0x9')]);router['get'](_0x6908('0xa'),auth[_0x6908('0xb')](),controller[_0x6908('0xc')]);router['get'](_0x6908('0xd'),auth['isAuthenticated'](),controller[_0x6908('0xe')]);router['post']('/',auth[_0x6908('0xb')](),controller[_0x6908('0xf')]);router[_0x6908('0x10')](_0x6908('0xd'),auth[_0x6908('0xb')](),controller['update']);router[_0x6908('0x11')](_0x6908('0xd'),auth[_0x6908('0xb')](),controller[_0x6908('0x12')]);module[_0x6908('0x13')]=router;
\ No newline at end of file
index 029f779..65c9081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e35=['INTEGER','sequelize','STRING'];(function(_0x4ba770,_0x439130){var _0x18dbaa=function(_0x3b67de){while(--_0x3b67de){_0x4ba770['push'](_0x4ba770['shift']());}};_0x18dbaa(++_0x439130);}(_0x5e35,0x1bd));var _0x55e3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5e35[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x55e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x55e3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x55e3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x55e3('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xf644=['exports','INTEGER','STRING','sequelize'];(function(_0x45cb89,_0x99520e){var _0x5948c1=function(_0x4c81c3){while(--_0x4c81c3){_0x45cb89['push'](_0x45cb89['shift']());}};_0x5948c1(++_0x99520e);}(_0xf644,0x123));var _0x4f64=function(_0x392b7b,_0x4d02c2){_0x392b7b=_0x392b7b-0x0;var _0x30ceca=_0xf644[_0x392b7b];return _0x30ceca;};'use strict';var Sequelize=require(_0x4f64('0x0'));module[_0x4f64('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4f64('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4f64('0x3')],'allowNull':![]}};
\ No newline at end of file
index 693eceb..d8559f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x30dba9,_0x2f0a8e){var _0x424f1a=function(_0x58c831){while(--_0x58c831){_0x30dba9['push'](_0x30dba9['shift']());}};_0x424f1a(++_0x2f0a8e);}(_0x57ca,0x108));var _0xa57c=function(_0x3eae97,_0x362ae0){_0x3eae97=_0x3eae97-0x0;var _0x34aa49=_0x57ca[_0x3eae97];return _0x34aa49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
+var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x2d39e8,_0x23d20c){var _0x1fb442=function(_0x1e6372){while(--_0x1e6372){_0x2d39e8['push'](_0x2d39e8['shift']());}};_0x1fb442(++_0x23d20c);}(_0x7a54,0x106));var _0x47a5=function(_0xb0a1a1,_0x4daae7){_0xb0a1a1=_0xb0a1a1-0x0;var _0x1a3388=_0x7a54[_0xb0a1a1];return _0x1a3388;};'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['UserProfileResource'][_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['UserProfileResource']['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['UserProfileResource']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['UserProfileResource'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));};
\ No newline at end of file
index 3f890b4..f0a89d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8af=['path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','request-promise'];(function(_0xf19782,_0x3b3072){var _0x15298c=function(_0x527d45){while(--_0x527d45){_0xf19782['push'](_0xf19782['shift']());}};_0x15298c(++_0x3b3072);}(_0xf8af,0xfa));var _0xff8a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf8af[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var logger=require(_0xff8a('0x1'))(_0xff8a('0x2'));var moment=require(_0xff8a('0x3'));var BPromise=require('bluebird');var rp=require(_0xff8a('0x4'));var fs=require('fs');var path=require(_0xff8a('0x5'));var rimraf=require('rimraf');var config=require(_0xff8a('0x6'));var attributes=require(_0xff8a('0x7'));module[_0xff8a('0x8')]=function(_0x218d0a,_0x4b58ce){return _0x218d0a[_0xff8a('0x9')](_0xff8a('0xa'),attributes,{'tableName':_0xff8a('0xb'),'paranoid':![],'indexes':[{'name':_0xff8a('0xc'),'fields':[_0xff8a('0xd'),_0xff8a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd90=['resourceId','sectionId','lodash','util','../../config/logger','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x23945f,_0x9d3e4e){var _0xa38592=function(_0x406b83){while(--_0x406b83){_0x23945f['push'](_0x23945f['shift']());}};_0xa38592(++_0x9d3e4e);}(_0xfd90,0x1f2));var _0x0fd9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfd90[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0fd9('0x0'));var util=require(_0x0fd9('0x1'));var logger=require(_0x0fd9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0fd9('0x3'));var attributes=require(_0x0fd9('0x4'));module[_0x0fd9('0x5')]=function(_0x579613,_0x33965d){return _0x579613['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0fd9('0x6'),_0x0fd9('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index c45318a..d9f14dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9652=['UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0x9652,0xaf));var _0x2965=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x9652[_0x35468d];return _0x30da52;};'use strict';var _=require(_0x2965('0x0'));var util=require(_0x2965('0x1'));var moment=require('moment');var BPromise=require(_0x2965('0x2'));var rs=require(_0x2965('0x3'));var fs=require('fs');var Redis=require(_0x2965('0x4'));var db=require(_0x2965('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2965('0x6'));var config=require(_0x2965('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x694054,_0x4a51b2,_0x31e39f){return new BPromise(function(_0x3be4b1,_0x33ce11){return client['request'](_0x694054,_0x31e39f)[_0x2965('0x8')](function(_0x13fbb9){logger[_0x2965('0x9')](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));logger['debug'](_0x2965('0xc'),_0x4a51b2,_0x2965('0xb'),JSON['stringify'](_0x13fbb9));if(_0x13fbb9[_0x2965('0xd')]){if(_0x13fbb9[_0x2965('0xd')][_0x2965('0xe')]===0x1f4){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x33ce11(_0x13fbb9['error'][_0x2965('0xf')]);}logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x3be4b1(_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);}else{logger['info'](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));_0x3be4b1(_0x13fbb9['result'][_0x2965('0xf')]);}})[_0x2965('0x10')](function(_0x3409b1){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x3409b1);_0x33ce11(_0x3409b1);});});}
\ No newline at end of file
+var _0x4b5d=['request\x20sent','debug','stringify','error','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x3e3781,_0x3234c1){var _0x5056dc=function(_0x2e805f){while(--_0x2e805f){_0x3e3781['push'](_0x3e3781['shift']());}};_0x5056dc(++_0x3234c1);}(_0x4b5d,0x1ab));var _0xd4b5=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x4b5d[_0x1ca890];return _0x3f8e01;};'use strict';var _=require('lodash');var util=require(_0xd4b5('0x0'));var moment=require(_0xd4b5('0x1'));var BPromise=require(_0xd4b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4b5('0x3'));var db=require(_0xd4b5('0x4'))['db'];var utils=require(_0xd4b5('0x5'));var logger=require(_0xd4b5('0x6'))(_0xd4b5('0x7'));var config=require(_0xd4b5('0x8'));var jayson=require(_0xd4b5('0x9'));var client=jayson[_0xd4b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa767bb,_0x459337,_0x5ac43e){return new BPromise(function(_0x2a06bd,_0x5db5cf){return client[_0xd4b5('0xb')](_0xa767bb,_0x5ac43e)[_0xd4b5('0xc')](function(_0x1e7f90){logger['info'](_0xd4b5('0xd'),_0x459337,_0xd4b5('0xe'));logger[_0xd4b5('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x459337,_0xd4b5('0xe'),JSON[_0xd4b5('0x10')](_0x1e7f90));if(_0x1e7f90[_0xd4b5('0x11')]){if(_0x1e7f90[_0xd4b5('0x11')]['code']===0x1f4){logger['error'](_0xd4b5('0xd'),_0x459337,_0x1e7f90[_0xd4b5('0x11')][_0xd4b5('0x12')]);return _0x5db5cf(_0x1e7f90[_0xd4b5('0x11')][_0xd4b5('0x12')]);}logger[_0xd4b5('0x11')](_0xd4b5('0xd'),_0x459337,_0x1e7f90[_0xd4b5('0x11')][_0xd4b5('0x12')]);return _0x2a06bd(_0x1e7f90[_0xd4b5('0x11')][_0xd4b5('0x12')]);}else{logger[_0xd4b5('0x13')](_0xd4b5('0xd'),_0x459337,_0xd4b5('0xe'));_0x2a06bd(_0x1e7f90['result'][_0xd4b5('0x12')]);}})[_0xd4b5('0x14')](function(_0x5e4965){logger[_0xd4b5('0x11')](_0xd4b5('0xd'),_0x459337,_0x5e4965);_0x5db5cf(_0x5e4965);});});}
\ No newline at end of file
index 51c7c34..63ab408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1ad=['get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0x25e2a5,_0x2d7270){var _0x429243=function(_0x16853){while(--_0x16853){_0x25e2a5['push'](_0x25e2a5['shift']());}};_0x429243(++_0x2d7270);}(_0xf1ad,0x108));var _0xdf1a=function(_0x40a9a2,_0xaacad4){_0x40a9a2=_0x40a9a2-0x0;var _0x55ae08=_0xf1ad[_0x40a9a2];return _0x55ae08;};'use strict';var multer=require(_0xdf1a('0x0'));var util=require(_0xdf1a('0x1'));var path=require(_0xdf1a('0x2'));var timeout=require(_0xdf1a('0x3'));var express=require(_0xdf1a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf1a('0x5'));var interaction=require(_0xdf1a('0x6'));var config=require(_0xdf1a('0x7'));var controller=require(_0xdf1a('0x8'));router[_0xdf1a('0x9')]('/',auth[_0xdf1a('0xa')](),controller['index']);router[_0xdf1a('0x9')](_0xdf1a('0xb'),auth[_0xdf1a('0xa')](),controller[_0xdf1a('0xc')]);router[_0xdf1a('0x9')](_0xdf1a('0xd'),auth['isAuthenticated'](),controller[_0xdf1a('0xe')]);router['post']('/',auth[_0xdf1a('0xa')](),controller[_0xdf1a('0xf')]);router[_0xdf1a('0x10')]('/:id',auth[_0xdf1a('0xa')](),controller[_0xdf1a('0x11')]);router[_0xdf1a('0x12')](_0xdf1a('0xd'),auth[_0xdf1a('0xa')](),controller[_0xdf1a('0x13')]);module[_0xdf1a('0x14')]=router;
\ No newline at end of file
+var _0xfc6f=['multer','path','connect-timeout','Router','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','destroy','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xfc6f,0x18c));var _0xffc6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xfc6f[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xffc6('0x0'));var util=require('util');var path=require(_0xffc6('0x1'));var timeout=require(_0xffc6('0x2'));var express=require('express');var router=express[_0xffc6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xffc6('0x4'));var controller=require(_0xffc6('0x5'));router['get']('/',auth[_0xffc6('0x6')](),controller[_0xffc6('0x7')]);router[_0xffc6('0x8')](_0xffc6('0x9'),auth[_0xffc6('0x6')](),controller[_0xffc6('0xa')]);router[_0xffc6('0x8')](_0xffc6('0xb'),auth[_0xffc6('0x6')](),controller['show']);router['post']('/',auth[_0xffc6('0x6')](),controller[_0xffc6('0xc')]);router[_0xffc6('0xd')](_0xffc6('0xb'),auth['isAuthenticated'](),controller[_0xffc6('0xe')]);router[_0xffc6('0xf')](_0xffc6('0xb'),auth[_0xffc6('0x6')](),controller[_0xffc6('0x10')]);module[_0xffc6('0x11')]=router;
\ No newline at end of file
index f0a92b6..03b9454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf66=['getDataValue','crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0x4b9982,_0x2eebb1){var _0x192a9b=function(_0x29d595){while(--_0x29d595){_0x4b9982['push'](_0x4b9982['shift']());}};_0x192a9b(++_0x2eebb1);}(_0xcf66,0x71));var _0x6cf6=function(_0x58cc7b,_0x471080){_0x58cc7b=_0x58cc7b-0x0;var _0x49ff75=_0xcf66[_0x58cc7b];return _0x49ff75;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'name':{'type':Sequelize[_0x6cf6('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6cf6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1c599d){this[_0x6cf6('0x5')]('crudPermissions',_0x1c599d?_0x1c599d[_0x6cf6('0x6')](''):[]);},'get':function(){return this[_0x6cf6('0x7')](_0x6cf6('0x8'))?this['getDataValue'](_0x6cf6('0x8'))[_0x6cf6('0x9')](''):[];}}};
\ No newline at end of file
+var _0x3f8c=['split','STRING','INTEGER','BOOLEAN','join','getDataValue','crudPermissions'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x3f8c,0x104));var _0xc3f8=function(_0xa52e38,_0x1a1ffd){_0xa52e38=_0xa52e38-0x0;var _0x4bd1f5=_0x3f8c[_0xa52e38];return _0x4bd1f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc3f8('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0xc3f8('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc3f8('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc3f8('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x54035a){this['setDataValue']('crudPermissions',_0x54035a?_0x54035a[_0xc3f8('0x3')](''):[]);},'get':function(){return this[_0xc3f8('0x4')](_0xc3f8('0x5'))?this[_0xc3f8('0x4')](_0xc3f8('0x5'))[_0xc3f8('0x6')](''):[];}}};
\ No newline at end of file
index b64edf8..246e505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5600=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','merge','options','UserProfileSection','includeAll','include','findAll','rows','catch','params','find','create','body','update'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x5600,0x196));var _0x0560=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x5600[_0x4c3ffe];return _0x28d3eb;};'use strict';var emlformat=require(_0x0560('0x0'));var rimraf=require(_0x0560('0x1'));var zipdir=require(_0x0560('0x2'));var jsonpatch=require(_0x0560('0x3'));var rp=require(_0x0560('0x4'));var moment=require(_0x0560('0x5'));var BPromise=require(_0x0560('0x6'));var Mustache=require(_0x0560('0x7'));var util=require(_0x0560('0x8'));var path=require(_0x0560('0x9'));var sox=require(_0x0560('0xa'));var csv=require(_0x0560('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0560('0xc'));var crypto=require(_0x0560('0xd'));var jsforce=require(_0x0560('0xe'));var deskjs=require(_0x0560('0xf'));var toCsv=require(_0x0560('0xb'));var querystring=require(_0x0560('0x10'));var Papa=require(_0x0560('0x11'));var Redis=require(_0x0560('0x12'));var authService=require(_0x0560('0x13'));var qs=require(_0x0560('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0560('0x15'));var logger=require(_0x0560('0x16'))(_0x0560('0x17'));var utils=require(_0x0560('0x18'));var config=require(_0x0560('0x19'));var licenseUtil=require(_0x0560('0x1a'));var db=require(_0x0560('0x1b'))['db'];function respondWithStatusCode(_0x4e6abb,_0x3841b7){_0x3841b7=_0x3841b7||0xcc;return function(_0xcc1fd6){if(_0xcc1fd6){return _0x4e6abb[_0x0560('0x1c')](_0x3841b7);}return _0x4e6abb[_0x0560('0x1d')](_0x3841b7)[_0x0560('0x1e')]();};}function respondWithResult(_0x2e1cd2,_0x4c15d8){_0x4c15d8=_0x4c15d8||0xc8;return function(_0x1f3025){if(_0x1f3025){return _0x2e1cd2[_0x0560('0x1d')](_0x4c15d8)['json'](_0x1f3025);}};}function respondWithFilteredResult(_0x3487cb,_0x1aa915){return function(_0x1d69d2){if(_0x1d69d2){var _0x3f97b9=typeof _0x1aa915[_0x0560('0x1f')]==='undefined'&&typeof _0x1aa915[_0x0560('0x20')]===_0x0560('0x21');var _0x2aa71b=_0x1d69d2[_0x0560('0x22')];var _0x40009f=_0x3f97b9?0x0:_0x1aa915[_0x0560('0x1f')];var _0x555dca=_0x3f97b9?_0x1d69d2[_0x0560('0x22')]:_0x1aa915[_0x0560('0x1f')]+_0x1aa915[_0x0560('0x20')];var _0x5ce45a;if(_0x555dca>=_0x2aa71b){_0x555dca=_0x2aa71b;_0x5ce45a=0xc8;}else{_0x5ce45a=0xce;}_0x3487cb[_0x0560('0x1d')](_0x5ce45a);return _0x3487cb[_0x0560('0x23')](_0x0560('0x24'),_0x40009f+'-'+_0x555dca+'/'+_0x2aa71b)[_0x0560('0x25')](_0x1d69d2);}return null;};}function patchUpdates(_0xda611b){return function(_0x211dfb){try{jsonpatch[_0x0560('0x26')](_0x211dfb,_0xda611b,!![]);}catch(_0x3156a4){return BPromise[_0x0560('0x27')](_0x3156a4);}return _0x211dfb[_0x0560('0x28')]();};}function saveUpdates(_0x4bc463,_0xbb808b){return function(_0x15169c){if(_0x15169c){return _0x15169c['update'](_0x4bc463)[_0x0560('0x29')](function(_0x799f3a){return _0x799f3a;});}return null;};}function removeEntity(_0x5d2e44,_0x12f2af){return function(_0x166b68){if(_0x166b68){return _0x166b68[_0x0560('0x2a')]()[_0x0560('0x29')](function(){_0x5d2e44[_0x0560('0x1d')](0xcc)[_0x0560('0x1e')]();});}};}function handleEntityNotFound(_0x3624a0,_0x5eaf7b){return function(_0x59a3d6){if(!_0x59a3d6){_0x3624a0['sendStatus'](0x194);}return _0x59a3d6;};}function handleError(_0x874c0d,_0x59228e){_0x59228e=_0x59228e||0x1f4;return function(_0x3df02b){logger[_0x0560('0x2b')](_0x3df02b[_0x0560('0x2c')]);if(_0x3df02b[_0x0560('0x2d')]){delete _0x3df02b['name'];}_0x874c0d[_0x0560('0x1d')](_0x59228e)[_0x0560('0x2e')](_0x3df02b);};}exports[_0x0560('0x2f')]=function(_0x525118,_0x11234a){var _0xd2d818={},_0x1ffbee={},_0x4bbb9c={'count':0x0,'rows':[]};var _0x26c16b=_[_0x0560('0x30')](db['UserProfileSection'][_0x0560('0x31')],function(_0x3400b5){return{'name':_0x3400b5[_0x0560('0x32')],'type':_0x3400b5['type'][_0x0560('0x33')]};});_0x1ffbee['model']=_['map'](_0x26c16b,_0x0560('0x2d'));_0x1ffbee[_0x0560('0x34')]=_[_0x0560('0x35')](_0x525118[_0x0560('0x34')]);_0x1ffbee[_0x0560('0x36')]=_[_0x0560('0x37')](_0x1ffbee['model'],_0x1ffbee[_0x0560('0x34')]);_0xd2d818[_0x0560('0x38')]=_[_0x0560('0x37')](_0x1ffbee[_0x0560('0x39')],qs['fields'](_0x525118[_0x0560('0x34')][_0x0560('0x3a')]));_0xd2d818[_0x0560('0x38')]=_0xd2d818[_0x0560('0x38')][_0x0560('0x3b')]?_0xd2d818['attributes']:_0x1ffbee[_0x0560('0x39')];if(!_0x525118[_0x0560('0x34')][_0x0560('0x3c')](_0x0560('0x3d'))){_0xd2d818['limit']=qs[_0x0560('0x20')](_0x525118[_0x0560('0x34')][_0x0560('0x20')]);_0xd2d818['offset']=qs[_0x0560('0x1f')](_0x525118[_0x0560('0x34')]['offset']);}_0xd2d818[_0x0560('0x3e')]=qs['sort'](_0x525118['query']['sort']);_0xd2d818[_0x0560('0x3f')]=qs[_0x0560('0x36')](_['pick'](_0x525118[_0x0560('0x34')],_0x1ffbee[_0x0560('0x36')]),_0x26c16b);if(_0x525118[_0x0560('0x34')][_0x0560('0x40')]){_0xd2d818[_0x0560('0x3f')]=_['merge'](_0xd2d818['where'],{'$or':_[_0x0560('0x30')](_0x26c16b,function(_0x568868){if(_0x568868[_0x0560('0x41')]!==_0x0560('0x42')){var _0x3c01da={};_0x3c01da[_0x568868['name']]={'$like':'%'+_0x525118[_0x0560('0x34')][_0x0560('0x40')]+'%'};return _0x3c01da;}})});}_0xd2d818=_[_0x0560('0x43')]({},_0xd2d818,_0x525118[_0x0560('0x44')]);var _0x265033={'where':_0xd2d818['where']};return db[_0x0560('0x45')][_0x0560('0x22')](_0x265033)[_0x0560('0x29')](function(_0x12dd8b){_0x4bbb9c[_0x0560('0x22')]=_0x12dd8b;if(_0x525118[_0x0560('0x34')][_0x0560('0x46')]){_0xd2d818[_0x0560('0x47')]=[{'all':!![]}];}return db[_0x0560('0x45')][_0x0560('0x48')](_0xd2d818);})['then'](function(_0x30bc96){_0x4bbb9c[_0x0560('0x49')]=_0x30bc96;return _0x4bbb9c;})[_0x0560('0x29')](respondWithFilteredResult(_0x11234a,_0xd2d818))[_0x0560('0x4a')](handleError(_0x11234a,null));};exports['show']=function(_0x55ce00,_0x47527b){var _0x5e684b={'raw':![],'where':{'id':_0x55ce00[_0x0560('0x4b')]['id']}},_0x55d09d={};_0x55d09d[_0x0560('0x39')]=_[_0x0560('0x35')](db[_0x0560('0x45')][_0x0560('0x31')]);_0x55d09d[_0x0560('0x34')]=_[_0x0560('0x35')](_0x55ce00[_0x0560('0x34')]);_0x55d09d[_0x0560('0x36')]=_['intersection'](_0x55d09d[_0x0560('0x39')],_0x55d09d[_0x0560('0x34')]);_0x5e684b['attributes']=_[_0x0560('0x37')](_0x55d09d[_0x0560('0x39')],qs[_0x0560('0x3a')](_0x55ce00['query'][_0x0560('0x3a')]));_0x5e684b[_0x0560('0x38')]=_0x5e684b['attributes'][_0x0560('0x3b')]?_0x5e684b[_0x0560('0x38')]:_0x55d09d['model'];if(_0x55ce00['query'][_0x0560('0x46')]){_0x5e684b[_0x0560('0x47')]=[{'all':!![]}];}_0x5e684b=_['merge']({},_0x5e684b,_0x55ce00[_0x0560('0x44')]);return db[_0x0560('0x45')][_0x0560('0x4c')](_0x5e684b)[_0x0560('0x29')](handleEntityNotFound(_0x47527b,null))[_0x0560('0x29')](respondWithResult(_0x47527b,null))[_0x0560('0x4a')](handleError(_0x47527b,null));};exports[_0x0560('0x4d')]=function(_0x22b9ca,_0x190137){return db[_0x0560('0x45')][_0x0560('0x4d')](_0x22b9ca[_0x0560('0x4e')],{})['then'](respondWithResult(_0x190137,0xc9))[_0x0560('0x4a')](handleError(_0x190137,null));};exports[_0x0560('0x4f')]=function(_0x5742d3,_0x1a9639){if(_0x5742d3[_0x0560('0x4e')]['id']){delete _0x5742d3['body']['id'];}return db[_0x0560('0x45')][_0x0560('0x4c')]({'where':{'id':_0x5742d3[_0x0560('0x4b')]['id']}})[_0x0560('0x29')](handleEntityNotFound(_0x1a9639,null))[_0x0560('0x29')](saveUpdates(_0x5742d3[_0x0560('0x4e')],null))[_0x0560('0x29')](respondWithResult(_0x1a9639,null))['catch'](handleError(_0x1a9639,null));};exports[_0x0560('0x2a')]=function(_0x3436c6,_0x2305fc){return db[_0x0560('0x45')][_0x0560('0x4c')]({'where':{'id':_0x3436c6['params']['id']}})[_0x0560('0x29')](handleEntityNotFound(_0x2305fc,null))[_0x0560('0x29')](removeEntity(_0x2305fc,null))['catch'](handleError(_0x2305fc,null));};exports[_0x0560('0x50')]=function(_0x58455f,_0x2c013d){return db[_0x0560('0x45')][_0x0560('0x50')]()[_0x0560('0x29')](respondWithResult(_0x2c013d,null))[_0x0560('0x4a')](handleError(_0x2c013d,null));};
\ No newline at end of file
+var _0xf3c3=['params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','index','UserProfileSection','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','merge','type','filter','options','includeAll','include','rows','catch','show'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xf3c3,0xdd));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3f3c('0x0'));var rimraf=require(_0x3f3c('0x1'));var zipdir=require(_0x3f3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f3c('0x3'));var moment=require(_0x3f3c('0x4'));var BPromise=require(_0x3f3c('0x5'));var Mustache=require(_0x3f3c('0x6'));var util=require(_0x3f3c('0x7'));var path=require(_0x3f3c('0x8'));var sox=require(_0x3f3c('0x9'));var csv=require(_0x3f3c('0xa'));var ejs=require(_0x3f3c('0xb'));var fs=require('fs');var fs_extra=require(_0x3f3c('0xc'));var _=require(_0x3f3c('0xd'));var squel=require('squel');var crypto=require(_0x3f3c('0xe'));var jsforce=require(_0x3f3c('0xf'));var deskjs=require(_0x3f3c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f3c('0x11'));var qs=require(_0x3f3c('0x12'));var as=require(_0x3f3c('0x13'));var hardwareService=require(_0x3f3c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3f3c('0x15'));var config=require(_0x3f3c('0x16'));var licenseUtil=require(_0x3f3c('0x17'));var db=require(_0x3f3c('0x18'))['db'];function respondWithStatusCode(_0x4d7010,_0x4304b7){_0x4304b7=_0x4304b7||0xcc;return function(_0x768034){if(_0x768034){return _0x4d7010['sendStatus'](_0x4304b7);}return _0x4d7010[_0x3f3c('0x19')](_0x4304b7)['end']();};}function respondWithResult(_0x3f508c,_0x59ef4a){_0x59ef4a=_0x59ef4a||0xc8;return function(_0x33ffd6){if(_0x33ffd6){return _0x3f508c[_0x3f3c('0x19')](_0x59ef4a)[_0x3f3c('0x1a')](_0x33ffd6);}};}function respondWithFilteredResult(_0x521925,_0x572290){return function(_0x3f7b7f){if(_0x3f7b7f){var _0x409d3b=typeof _0x572290[_0x3f3c('0x1b')]===_0x3f3c('0x1c')&&typeof _0x572290[_0x3f3c('0x1d')]===_0x3f3c('0x1c');var _0x20faf9=_0x3f7b7f[_0x3f3c('0x1e')];var _0x305414=_0x409d3b?0x0:_0x572290[_0x3f3c('0x1b')];var _0x4a9056=_0x409d3b?_0x3f7b7f[_0x3f3c('0x1e')]:_0x572290[_0x3f3c('0x1b')]+_0x572290[_0x3f3c('0x1d')];var _0x5c7513;if(_0x4a9056>=_0x20faf9){_0x4a9056=_0x20faf9;_0x5c7513=0xc8;}else{_0x5c7513=0xce;}_0x521925[_0x3f3c('0x19')](_0x5c7513);return _0x521925[_0x3f3c('0x1f')]('Content-Range',_0x305414+'-'+_0x4a9056+'/'+_0x20faf9)[_0x3f3c('0x1a')](_0x3f7b7f);}return null;};}function patchUpdates(_0x10ace5){return function(_0x19f621){try{jsonpatch[_0x3f3c('0x20')](_0x19f621,_0x10ace5,!![]);}catch(_0xe5d979){return BPromise[_0x3f3c('0x21')](_0xe5d979);}return _0x19f621['save']();};}function saveUpdates(_0xac6d22,_0x219828){return function(_0x477a11){if(_0x477a11){return _0x477a11[_0x3f3c('0x22')](_0xac6d22)[_0x3f3c('0x23')](function(_0x3f92d4){return _0x3f92d4;});}return null;};}function removeEntity(_0xe30f5d,_0x5f5d54){return function(_0x52070d){if(_0x52070d){return _0x52070d[_0x3f3c('0x24')]()['then'](function(){_0xe30f5d[_0x3f3c('0x19')](0xcc)[_0x3f3c('0x25')]();});}};}function handleEntityNotFound(_0x25a38b,_0x1d2f11){return function(_0x2e67af){if(!_0x2e67af){_0x25a38b['sendStatus'](0x194);}return _0x2e67af;};}function handleError(_0x472ce9,_0x31f64f){_0x31f64f=_0x31f64f||0x1f4;return function(_0xad949e){logger[_0x3f3c('0x26')](_0xad949e[_0x3f3c('0x27')]);if(_0xad949e[_0x3f3c('0x28')]){delete _0xad949e[_0x3f3c('0x28')];}_0x472ce9[_0x3f3c('0x19')](_0x31f64f)['send'](_0xad949e);};}exports[_0x3f3c('0x29')]=function(_0x2ddc0c,_0x3c6d28){var _0x2483f1={},_0x3a4d2f={},_0x3d5e50={'count':0x0,'rows':[]};var _0x507556=_['map'](db[_0x3f3c('0x2a')][_0x3f3c('0x2b')],function(_0x2a2fc8){return{'name':_0x2a2fc8['fieldName'],'type':_0x2a2fc8['type'][_0x3f3c('0x2c')]};});_0x3a4d2f['model']=_[_0x3f3c('0x2d')](_0x507556,_0x3f3c('0x28'));_0x3a4d2f[_0x3f3c('0x2e')]=_[_0x3f3c('0x2f')](_0x2ddc0c['query']);_0x3a4d2f[_0x3f3c('0x30')]=_[_0x3f3c('0x31')](_0x3a4d2f[_0x3f3c('0x32')],_0x3a4d2f[_0x3f3c('0x2e')]);_0x2483f1[_0x3f3c('0x33')]=_[_0x3f3c('0x31')](_0x3a4d2f['model'],qs[_0x3f3c('0x34')](_0x2ddc0c[_0x3f3c('0x2e')]['fields']));_0x2483f1[_0x3f3c('0x33')]=_0x2483f1[_0x3f3c('0x33')][_0x3f3c('0x35')]?_0x2483f1[_0x3f3c('0x33')]:_0x3a4d2f['model'];if(!_0x2ddc0c['query'][_0x3f3c('0x36')]('nolimit')){_0x2483f1['limit']=qs[_0x3f3c('0x1d')](_0x2ddc0c['query'][_0x3f3c('0x1d')]);_0x2483f1[_0x3f3c('0x1b')]=qs[_0x3f3c('0x1b')](_0x2ddc0c[_0x3f3c('0x2e')][_0x3f3c('0x1b')]);}_0x2483f1[_0x3f3c('0x37')]=qs['sort'](_0x2ddc0c[_0x3f3c('0x2e')]['sort']);_0x2483f1[_0x3f3c('0x38')]=qs['filters'](_[_0x3f3c('0x39')](_0x2ddc0c[_0x3f3c('0x2e')],_0x3a4d2f[_0x3f3c('0x30')]),_0x507556);if(_0x2ddc0c['query']['filter']){_0x2483f1[_0x3f3c('0x38')]=_[_0x3f3c('0x3a')](_0x2483f1[_0x3f3c('0x38')],{'$or':_[_0x3f3c('0x2d')](_0x507556,function(_0x14abe7){if(_0x14abe7[_0x3f3c('0x3b')]!=='VIRTUAL'){var _0x4f1db6={};_0x4f1db6[_0x14abe7[_0x3f3c('0x28')]]={'$like':'%'+_0x2ddc0c[_0x3f3c('0x2e')][_0x3f3c('0x3c')]+'%'};return _0x4f1db6;}})});}_0x2483f1=_[_0x3f3c('0x3a')]({},_0x2483f1,_0x2ddc0c[_0x3f3c('0x3d')]);var _0x1f85db={'where':_0x2483f1[_0x3f3c('0x38')]};return db[_0x3f3c('0x2a')][_0x3f3c('0x1e')](_0x1f85db)['then'](function(_0x368a86){_0x3d5e50['count']=_0x368a86;if(_0x2ddc0c[_0x3f3c('0x2e')][_0x3f3c('0x3e')]){_0x2483f1[_0x3f3c('0x3f')]=[{'all':!![]}];}return db[_0x3f3c('0x2a')]['findAll'](_0x2483f1);})['then'](function(_0x52976f){_0x3d5e50[_0x3f3c('0x40')]=_0x52976f;return _0x3d5e50;})[_0x3f3c('0x23')](respondWithFilteredResult(_0x3c6d28,_0x2483f1))[_0x3f3c('0x41')](handleError(_0x3c6d28,null));};exports[_0x3f3c('0x42')]=function(_0x592397,_0x4ad33f){var _0x2e84c4={'raw':![],'where':{'id':_0x592397[_0x3f3c('0x43')]['id']}},_0x8a919f={};_0x8a919f[_0x3f3c('0x32')]=_['keys'](db['UserProfileSection'][_0x3f3c('0x2b')]);_0x8a919f[_0x3f3c('0x2e')]=_['keys'](_0x592397[_0x3f3c('0x2e')]);_0x8a919f[_0x3f3c('0x30')]=_[_0x3f3c('0x31')](_0x8a919f[_0x3f3c('0x32')],_0x8a919f[_0x3f3c('0x2e')]);_0x2e84c4[_0x3f3c('0x33')]=_[_0x3f3c('0x31')](_0x8a919f[_0x3f3c('0x32')],qs[_0x3f3c('0x34')](_0x592397[_0x3f3c('0x2e')][_0x3f3c('0x34')]));_0x2e84c4[_0x3f3c('0x33')]=_0x2e84c4[_0x3f3c('0x33')][_0x3f3c('0x35')]?_0x2e84c4[_0x3f3c('0x33')]:_0x8a919f[_0x3f3c('0x32')];if(_0x592397[_0x3f3c('0x2e')][_0x3f3c('0x3e')]){_0x2e84c4[_0x3f3c('0x3f')]=[{'all':!![]}];}_0x2e84c4=_[_0x3f3c('0x3a')]({},_0x2e84c4,_0x592397['options']);return db[_0x3f3c('0x2a')]['find'](_0x2e84c4)['then'](handleEntityNotFound(_0x4ad33f,null))[_0x3f3c('0x23')](respondWithResult(_0x4ad33f,null))['catch'](handleError(_0x4ad33f,null));};exports[_0x3f3c('0x44')]=function(_0x48a2b4,_0x529538){return db['UserProfileSection'][_0x3f3c('0x44')](_0x48a2b4[_0x3f3c('0x45')],{})[_0x3f3c('0x23')](respondWithResult(_0x529538,0xc9))[_0x3f3c('0x41')](handleError(_0x529538,null));};exports[_0x3f3c('0x22')]=function(_0x16e5cb,_0x25db8e){if(_0x16e5cb['body']['id']){delete _0x16e5cb['body']['id'];}return db[_0x3f3c('0x2a')][_0x3f3c('0x46')]({'where':{'id':_0x16e5cb[_0x3f3c('0x43')]['id']}})[_0x3f3c('0x23')](handleEntityNotFound(_0x25db8e,null))[_0x3f3c('0x23')](saveUpdates(_0x16e5cb['body'],null))[_0x3f3c('0x23')](respondWithResult(_0x25db8e,null))[_0x3f3c('0x41')](handleError(_0x25db8e,null));};exports['destroy']=function(_0x12a865,_0x73cc67){return db['UserProfileSection'][_0x3f3c('0x46')]({'where':{'id':_0x12a865[_0x3f3c('0x43')]['id']}})['then'](handleEntityNotFound(_0x73cc67,null))['then'](removeEntity(_0x73cc67,null))[_0x3f3c('0x41')](handleError(_0x73cc67,null));};exports[_0x3f3c('0x47')]=function(_0x4a9116,_0x4ad2f5){return db[_0x3f3c('0x2a')][_0x3f3c('0x47')]()[_0x3f3c('0x23')](respondWithResult(_0x4ad2f5,null))['catch'](handleError(_0x4ad2f5,null));};
\ No newline at end of file
index d5d7a33..0bafe52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7d4=['request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment'];(function(_0x8b6e44,_0x4efbc3){var _0x1132c5=function(_0x38a77f){while(--_0x38a77f){_0x8b6e44['push'](_0x8b6e44['shift']());}};_0x1132c5(++_0x4efbc3);}(_0xe7d4,0x19c));var _0x4e7d=function(_0x2bcf87,_0x2f6694){_0x2bcf87=_0x2bcf87-0x0;var _0x4f69ac=_0xe7d4[_0x2bcf87];return _0x4f69ac;};'use strict';var _=require(_0x4e7d('0x0'));var util=require('util');var logger=require(_0x4e7d('0x1'))(_0x4e7d('0x2'));var moment=require(_0x4e7d('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e7d('0x4'));var fs=require('fs');var path=require(_0x4e7d('0x5'));var rimraf=require(_0x4e7d('0x6'));var config=require(_0x4e7d('0x7'));var attributes=require(_0x4e7d('0x8'));module[_0x4e7d('0x9')]=function(_0x210f86,_0xd7c243){return _0x210f86[_0x4e7d('0xa')](_0x4e7d('0xb'),attributes,{'tableName':_0x4e7d('0xc'),'paranoid':![],'indexes':[{'name':_0x4e7d('0xd'),'fields':[_0x4e7d('0xe'),_0x4e7d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a76=['rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','sectionId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5d07a7,_0x43ff2e){var _0x95d216=function(_0x5e259c){while(--_0x5e259c){_0x5d07a7['push'](_0x5d07a7['shift']());}};_0x95d216(++_0x43ff2e);}(_0x0a76,0x14c));var _0x60a7=function(_0x2499a3,_0x527e3f){_0x2499a3=_0x2499a3-0x0;var _0x3be111=_0x0a76[_0x2499a3];return _0x3be111;};'use strict';var _=require(_0x60a7('0x0'));var util=require(_0x60a7('0x1'));var logger=require('../../config/logger')(_0x60a7('0x2'));var moment=require(_0x60a7('0x3'));var BPromise=require(_0x60a7('0x4'));var rp=require(_0x60a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60a7('0x6'));var config=require(_0x60a7('0x7'));var attributes=require(_0x60a7('0x8'));module['exports']=function(_0x3fcbd7,_0x1821b8){return _0x3fcbd7[_0x60a7('0x9')](_0x60a7('0xa'),attributes,{'tableName':_0x60a7('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x60a7('0xc'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
index 42989f6..d502a33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5a0=['request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1a99af,_0x13f6f0){var _0x4caeb5=function(_0x2d80bb){while(--_0x2d80bb){_0x1a99af['push'](_0x1a99af['shift']());}};_0x4caeb5(++_0x13f6f0);}(_0xe5a0,0xcd));var _0x0e5a=function(_0x424568,_0x121dcf){_0x424568=_0x424568-0x0;var _0x44b0c0=_0xe5a0[_0x424568];return _0x44b0c0;};'use strict';var _=require(_0x0e5a('0x0'));var util=require(_0x0e5a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e5a('0x2'));var fs=require('fs');var Redis=require(_0x0e5a('0x3'));var db=require(_0x0e5a('0x4'))['db'];var utils=require(_0x0e5a('0x5'));var logger=require(_0x0e5a('0x6'))(_0x0e5a('0x7'));var config=require(_0x0e5a('0x8'));var jayson=require(_0x0e5a('0x9'));var client=jayson[_0x0e5a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ba2d6,_0x57dea5,_0x425c0e){return new BPromise(function(_0x210905,_0x57d94d){return client[_0x0e5a('0xb')](_0x2ba2d6,_0x425c0e)[_0x0e5a('0xc')](function(_0x3a23bc){logger['info'](_0x0e5a('0xd'),_0x57dea5,_0x0e5a('0xe'));logger[_0x0e5a('0xf')](_0x0e5a('0x10'),_0x57dea5,_0x0e5a('0xe'),JSON[_0x0e5a('0x11')](_0x3a23bc));if(_0x3a23bc['error']){if(_0x3a23bc[_0x0e5a('0x12')][_0x0e5a('0x13')]===0x1f4){logger[_0x0e5a('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x57dea5,_0x3a23bc[_0x0e5a('0x12')]['message']);return _0x57d94d(_0x3a23bc[_0x0e5a('0x12')]['message']);}logger[_0x0e5a('0x12')](_0x0e5a('0xd'),_0x57dea5,_0x3a23bc[_0x0e5a('0x12')][_0x0e5a('0x14')]);return _0x210905(_0x3a23bc[_0x0e5a('0x12')]['message']);}else{logger[_0x0e5a('0x15')](_0x0e5a('0xd'),_0x57dea5,_0x0e5a('0xe'));_0x210905(_0x3a23bc[_0x0e5a('0x16')][_0x0e5a('0x14')]);}})[_0x0e5a('0x17')](function(_0x48a9ad){logger[_0x0e5a('0x12')](_0x0e5a('0xd'),_0x57dea5,_0x48a9ad);_0x57d94d(_0x48a9ad);});});}
\ No newline at end of file
+var _0x6299=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','catch','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x11d5e0,_0x5206fd){var _0x1bb943=function(_0x36aeb1){while(--_0x36aeb1){_0x11d5e0['push'](_0x11d5e0['shift']());}};_0x1bb943(++_0x5206fd);}(_0x6299,0x1f0));var _0x9629=function(_0x156e0e,_0x37aba5){_0x156e0e=_0x156e0e-0x0;var _0x2d792a=_0x6299[_0x156e0e];return _0x2d792a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9629('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9629('0x1'))['db'];var utils=require(_0x9629('0x2'));var logger=require('../../config/logger')(_0x9629('0x3'));var config=require(_0x9629('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9629('0x5')][_0x9629('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x16ceb9,_0x2b2505,_0x1df6f4){return new BPromise(function(_0x50180d,_0x1c30ab){return client[_0x9629('0x7')](_0x16ceb9,_0x1df6f4)[_0x9629('0x8')](function(_0x556e6a){logger[_0x9629('0x9')](_0x9629('0xa'),_0x2b2505,_0x9629('0xb'));logger[_0x9629('0xc')](_0x9629('0xd'),_0x2b2505,_0x9629('0xb'),JSON['stringify'](_0x556e6a));if(_0x556e6a[_0x9629('0xe')]){if(_0x556e6a[_0x9629('0xe')]['code']===0x1f4){logger['error'](_0x9629('0xa'),_0x2b2505,_0x556e6a[_0x9629('0xe')][_0x9629('0xf')]);return _0x1c30ab(_0x556e6a[_0x9629('0xe')][_0x9629('0xf')]);}logger[_0x9629('0xe')](_0x9629('0xa'),_0x2b2505,_0x556e6a[_0x9629('0xe')][_0x9629('0xf')]);return _0x50180d(_0x556e6a[_0x9629('0xe')][_0x9629('0xf')]);}else{logger[_0x9629('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x2b2505,_0x9629('0xb'));_0x50180d(_0x556e6a[_0x9629('0x10')][_0x9629('0xf')]);}})[_0x9629('0x11')](function(_0x3c8675){logger[_0x9629('0xe')](_0x9629('0xa'),_0x2b2505,_0x3c8675);_0x1c30ab(_0x3c8675);});});}
\ No newline at end of file
index f7dda57..510bdef 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(_0x11fb16,_0x29a381){var _0x343de1=function(_0x4a69f7){while(--_0x4a69f7){_0x11fb16['push'](_0x11fb16['shift']());}};_0x343de1(++_0x29a381);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x8b5bb1,_0x166fe4){var _0x50f086=function(_0x1d80e9){while(--_0x1d80e9){_0x8b5bb1['push'](_0x8b5bb1['shift']());}};_0x50f086(++_0x166fe4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0xcb91[_0x594e11];return _0x5418ad;};'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 d40244e..e0cf6eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc91=['sequelize','exports'];(function(_0x438386,_0x3f49b7){var _0x18d530=function(_0x993c67){while(--_0x993c67){_0x438386['push'](_0x438386['shift']());}};_0x18d530(++_0x3f49b7);}(_0xfc91,0x72));var _0x1fc9=function(_0x4ebf1c,_0x467def){_0x4ebf1c=_0x4ebf1c-0x0;var _0x2efe7a=_0xfc91[_0x4ebf1c];return _0x2efe7a;};'use strict';var Sequelize=require(_0x1fc9('0x0'));module[_0x1fc9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xffaa=['INTEGER','exports'];(function(_0x14ec75,_0x56a3d4){var _0x40b9e9=function(_0x4d2f39){while(--_0x4d2f39){_0x14ec75['push'](_0x14ec75['shift']());}};_0x40b9e9(++_0x56a3d4);}(_0xffaa,0xe1));var _0xaffa=function(_0x80ea62,_0x152606){_0x80ea62=_0x80ea62-0x0;var _0x5764fa=_0xffaa[_0x80ea62];return _0x5764fa;};'use strict';var Sequelize=require('sequelize');module[_0xaffa('0x0')]={'penalty':{'type':Sequelize[_0xaffa('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index f6dd1fe..d41766e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue'];(function(_0x2d1b7d,_0x11bcad){var _0x87a683=function(_0x54788a){while(--_0x54788a){_0x2d1b7d['push'](_0x2d1b7d['shift']());}};_0x87a683(++_0x11bcad);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'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
+var _0xa899=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28d138,_0x21196d){var _0x4beedb=function(_0xab4abc){while(--_0xab4abc){_0x28d138['push'](_0x28d138['shift']());}};_0x4beedb(++_0x21196d);}(_0xa899,0x155));var _0x9a89=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xa899[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var logger=require(_0x9a89('0x2'))('api');var moment=require(_0x9a89('0x3'));var BPromise=require(_0x9a89('0x4'));var rp=require(_0x9a89('0x5'));var fs=require('fs');var path=require(_0x9a89('0x6'));var rimraf=require(_0x9a89('0x7'));var config=require(_0x9a89('0x8'));var attributes=require(_0x9a89('0x9'));module[_0x9a89('0xa')]=function(_0x126099,_0x413d15){return _0x126099[_0x9a89('0xb')](_0x9a89('0xc'),attributes,{'tableName':_0x9a89('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b943f70..dce0c40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26e1=['error','code','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x5cae0c,_0x768f1){var _0x1c4457=function(_0x2f427c){while(--_0x2f427c){_0x5cae0c['push'](_0x5cae0c['shift']());}};_0x1c4457(++_0x768f1);}(_0x26e1,0x157));var _0x126e=function(_0x196c26,_0xf2e93b){_0x196c26=_0x196c26-0x0;var _0x4460ab=_0x26e1[_0x196c26];return _0x4460ab;};'use strict';var _=require(_0x126e('0x0'));var util=require(_0x126e('0x1'));var moment=require(_0x126e('0x2'));var BPromise=require('bluebird');var rs=require(_0x126e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x126e('0x4'));var logger=require(_0x126e('0x5'))(_0x126e('0x6'));var config=require(_0x126e('0x7'));var jayson=require(_0x126e('0x8'));var client=jayson[_0x126e('0x9')][_0x126e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x109731,_0x41db1d,_0x330d09){return new BPromise(function(_0x574c7f,_0x55f65a){return client[_0x126e('0xb')](_0x109731,_0x330d09)[_0x126e('0xc')](function(_0x33a4d2){logger['info'](_0x126e('0xd'),_0x41db1d,'request\x20sent');logger[_0x126e('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x41db1d,_0x126e('0xf'),JSON[_0x126e('0x10')](_0x33a4d2));if(_0x33a4d2[_0x126e('0x11')]){if(_0x33a4d2[_0x126e('0x11')][_0x126e('0x12')]===0x1f4){logger[_0x126e('0x11')](_0x126e('0xd'),_0x41db1d,_0x33a4d2[_0x126e('0x11')][_0x126e('0x13')]);return _0x55f65a(_0x33a4d2[_0x126e('0x11')][_0x126e('0x13')]);}logger[_0x126e('0x11')](_0x126e('0xd'),_0x41db1d,_0x33a4d2[_0x126e('0x11')][_0x126e('0x13')]);return _0x574c7f(_0x33a4d2[_0x126e('0x11')]['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x41db1d,_0x126e('0xf'));_0x574c7f(_0x33a4d2['result'][_0x126e('0x13')]);}})['catch'](function(_0x510c61){logger[_0x126e('0x11')](_0x126e('0xd'),_0x41db1d,_0x510c61);_0x55f65a(_0x510c61);});});}
\ No newline at end of file
+var _0xa415=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0xa415,0xe5));var _0x5a41=function(_0x371bef,_0x1295e){_0x371bef=_0x371bef-0x0;var _0x39ec13=_0xa415[_0x371bef];return _0x39ec13;};'use strict';var _=require(_0x5a41('0x0'));var util=require(_0x5a41('0x1'));var moment=require(_0x5a41('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a41('0x3'));var db=require(_0x5a41('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a41('0x5'))(_0x5a41('0x6'));var config=require(_0x5a41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a41('0x8')][_0x5a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5001e8,_0x1dc537,_0x59029e){return new BPromise(function(_0xec003f,_0x386b1a){return client[_0x5a41('0xa')](_0x5001e8,_0x59029e)[_0x5a41('0xb')](function(_0x2aed6d){logger[_0x5a41('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x1dc537,_0x5a41('0xd'));logger['debug'](_0x5a41('0xe'),_0x1dc537,'request\x20sent',JSON[_0x5a41('0xf')](_0x2aed6d));if(_0x2aed6d[_0x5a41('0x10')]){if(_0x2aed6d[_0x5a41('0x10')]['code']===0x1f4){logger[_0x5a41('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x1dc537,_0x2aed6d[_0x5a41('0x10')]['message']);return _0x386b1a(_0x2aed6d[_0x5a41('0x10')][_0x5a41('0x11')]);}logger['error'](_0x5a41('0x12'),_0x1dc537,_0x2aed6d['error']['message']);return _0xec003f(_0x2aed6d[_0x5a41('0x10')][_0x5a41('0x11')]);}else{logger[_0x5a41('0xc')](_0x5a41('0x12'),_0x1dc537,_0x5a41('0xd'));_0xec003f(_0x2aed6d[_0x5a41('0x13')][_0x5a41('0x11')]);}})[_0x5a41('0x14')](function(_0x467dd7){logger['error'](_0x5a41('0x12'),_0x1dc537,_0x467dd7);_0x386b1a(_0x467dd7);});});}
\ No newline at end of file
index b7dda52..29def4f 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(_0xbd4793,_0x5684b8){var _0x432d1c=function(_0x1294d6){while(--_0x1294d6){_0xbd4793['push'](_0xbd4793['shift']());}};_0x432d1c(++_0x5684b8);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3b6e65,_0x677a52){var _0x2ede7d=function(_0x162743){while(--_0x162743){_0x3b6e65['push'](_0x3b6e65['shift']());}};_0x2ede7d(++_0x677a52);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xcb91[_0x421196];return _0x2738af;};'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 5057322..7932812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4172=['sequelize','exports'];(function(_0x5ce105,_0x34f3ce){var _0x33d030=function(_0x3e64ef){while(--_0x3e64ef){_0x5ce105['push'](_0x5ce105['shift']());}};_0x33d030(++_0x34f3ce);}(_0x4172,0xbc));var _0x2417=function(_0x2744d5,_0x2c531b){_0x2744d5=_0x2744d5-0x0;var _0x3e8a3c=_0x4172[_0x2744d5];return _0x3e8a3c;};'use strict';var Sequelize=require(_0x2417('0x0'));module[_0x2417('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe3ad=['exports','INTEGER','sequelize'];(function(_0x57d500,_0xf52c67){var _0x142c14=function(_0x4b2055){while(--_0x4b2055){_0x57d500['push'](_0x57d500['shift']());}};_0x142c14(++_0xf52c67);}(_0xe3ad,0x77));var _0xde3a=function(_0x20de4d,_0x17912a){_0x20de4d=_0x20de4d-0x0;var _0x4a07c0=_0xe3ad[_0x20de4d];return _0x4a07c0;};'use strict';var Sequelize=require(_0xde3a('0x0'));module[_0xde3a('0x1')]={'penalty':{'type':Sequelize[_0xde3a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index af36853..dd84197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c45=['moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x8c45,0x128));var _0x58c4=function(_0x3b9716,_0x19c124){_0x3b9716=_0x3b9716-0x0;var _0x3eb0ca=_0x8c45[_0x3b9716];return _0x3eb0ca;};'use strict';var _=require('lodash');var util=require(_0x58c4('0x0'));var logger=require(_0x58c4('0x1'))(_0x58c4('0x2'));var moment=require(_0x58c4('0x3'));var BPromise=require('bluebird');var rp=require(_0x58c4('0x4'));var fs=require('fs');var path=require(_0x58c4('0x5'));var rimraf=require(_0x58c4('0x6'));var config=require(_0x58c4('0x7'));var attributes=require(_0x58c4('0x8'));module[_0x58c4('0x9')]=function(_0x520b7e,_0x4b3808){return _0x520b7e[_0x58c4('0xa')](_0x58c4('0xb'),attributes,{'tableName':_0x58c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffa5=['rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e070c,_0x1276ee){var _0x320f17=function(_0x399d5a){while(--_0x399d5a){_0x1e070c['push'](_0x1e070c['shift']());}};_0x320f17(++_0x1276ee);}(_0xffa5,0x19d));var _0x5ffa=function(_0x84b29,_0x506f94){_0x84b29=_0x84b29-0x0;var _0x46b663=_0xffa5[_0x84b29];return _0x46b663;};'use strict';var _=require(_0x5ffa('0x0'));var util=require(_0x5ffa('0x1'));var logger=require(_0x5ffa('0x2'))(_0x5ffa('0x3'));var moment=require(_0x5ffa('0x4'));var BPromise=require(_0x5ffa('0x5'));var rp=require(_0x5ffa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ffa('0x7'));var config=require(_0x5ffa('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x5ffa('0x9')]=function(_0x534628,_0x149470){return _0x534628['define'](_0x5ffa('0xa'),attributes,{'tableName':_0x5ffa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e212ee6..d07cd27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b25=['result','catch','util','moment','bluebird','randomstring','rpc','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x3a20f7,_0x2a9ff2){var _0x4b7cdf=function(_0x3fe52d){while(--_0x3fe52d){_0x3a20f7['push'](_0x3a20f7['shift']());}};_0x4b7cdf(++_0x2a9ff2);}(_0x8b25,0x10c));var _0x58b2=function(_0x1b2299,_0x5b75f2){_0x1b2299=_0x1b2299-0x0;var _0x22d8e9=_0x8b25[_0x1b2299];return _0x22d8e9;};'use strict';var _=require('lodash');var util=require(_0x58b2('0x0'));var moment=require(_0x58b2('0x1'));var BPromise=require(_0x58b2('0x2'));var rs=require(_0x58b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x58b2('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x58b2('0x5')][_0x58b2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2b24e4,_0x4bdbe9,_0x208bdd){return new BPromise(function(_0xe8f81c,_0x281f82){return client[_0x58b2('0x7')](_0x2b24e4,_0x208bdd)['then'](function(_0xc43b69){logger[_0x58b2('0x8')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bdbe9,_0x58b2('0x9'));logger[_0x58b2('0xa')](_0x58b2('0xb'),_0x4bdbe9,_0x58b2('0x9'),JSON[_0x58b2('0xc')](_0xc43b69));if(_0xc43b69[_0x58b2('0xd')]){if(_0xc43b69[_0x58b2('0xd')][_0x58b2('0xe')]===0x1f4){logger[_0x58b2('0xd')](_0x58b2('0xf'),_0x4bdbe9,_0xc43b69['error'][_0x58b2('0x10')]);return _0x281f82(_0xc43b69[_0x58b2('0xd')]['message']);}logger[_0x58b2('0xd')](_0x58b2('0xf'),_0x4bdbe9,_0xc43b69[_0x58b2('0xd')][_0x58b2('0x10')]);return _0xe8f81c(_0xc43b69['error'][_0x58b2('0x10')]);}else{logger[_0x58b2('0x8')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bdbe9,_0x58b2('0x9'));_0xe8f81c(_0xc43b69[_0x58b2('0x11')][_0x58b2('0x10')]);}})[_0x58b2('0x12')](function(_0xb660c7){logger[_0x58b2('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bdbe9,_0xb660c7);_0x281f82(_0xb660c7);});});}
\ No newline at end of file
+var _0x950f=['stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x31fd5f,_0x350ebb){var _0xf7cd7a=function(_0x8da48d){while(--_0x8da48d){_0x31fd5f['push'](_0x31fd5f['shift']());}};_0xf7cd7a(++_0x350ebb);}(_0x950f,0x1a9));var _0xf950=function(_0xd3fb91,_0xfc54c0){_0xd3fb91=_0xd3fb91-0x0;var _0x33438c=_0x950f[_0xd3fb91];return _0x33438c;};'use strict';var _=require(_0xf950('0x0'));var util=require(_0xf950('0x1'));var moment=require('moment');var BPromise=require(_0xf950('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf950('0x3'))['db'];var utils=require(_0xf950('0x4'));var logger=require(_0xf950('0x5'))(_0xf950('0x6'));var config=require('../../config/environment');var jayson=require(_0xf950('0x7'));var client=jayson['client'][_0xf950('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3998ef,_0x320ed3,_0x2c9cea){return new BPromise(function(_0x452536,_0x1dc53f){return client[_0xf950('0x9')](_0x3998ef,_0x2c9cea)[_0xf950('0xa')](function(_0xbd8dad){logger[_0xf950('0xb')](_0xf950('0xc'),_0x320ed3,_0xf950('0xd'));logger[_0xf950('0xe')](_0xf950('0xf'),_0x320ed3,_0xf950('0xd'),JSON[_0xf950('0x10')](_0xbd8dad));if(_0xbd8dad['error']){if(_0xbd8dad[_0xf950('0x11')]['code']===0x1f4){logger[_0xf950('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x320ed3,_0xbd8dad['error']['message']);return _0x1dc53f(_0xbd8dad[_0xf950('0x11')][_0xf950('0x12')]);}logger['error'](_0xf950('0xc'),_0x320ed3,_0xbd8dad[_0xf950('0x11')][_0xf950('0x12')]);return _0x452536(_0xbd8dad[_0xf950('0x11')][_0xf950('0x12')]);}else{logger[_0xf950('0xb')](_0xf950('0xc'),_0x320ed3,_0xf950('0xd'));_0x452536(_0xbd8dad[_0xf950('0x13')][_0xf950('0x12')]);}})[_0xf950('0x14')](function(_0x10c159){logger['error'](_0xf950('0xc'),_0x320ed3,_0x10c159);_0x1dc53f(_0x10c159);});});}
\ No newline at end of file
index 7910c1d..959bf98 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(_0x2b35ca,_0x4943ce){var _0x68389e=function(_0x4e9d92){while(--_0x4e9d92){_0x2b35ca['push'](_0x2b35ca['shift']());}};_0x68389e(++_0x4943ce);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ac9b9,_0x1a2212){var _0x4e1ca1=function(_0x5ef15b){while(--_0x5ef15b){_0x5ac9b9['push'](_0x5ac9b9['shift']());}};_0x4e1ca1(++_0x1a2212);}(_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
index 996c6b0..14bf582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x039d=['Required\x20by\x20Asterisk','queue_interface','INTEGER','sequelize','exports','STRING'];(function(_0x41a5e3,_0x346cf9){var _0x57e6dd=function(_0x3ed0aa){while(--_0x3ed0aa){_0x41a5e3['push'](_0x41a5e3['shift']());}};_0x57e6dd(++_0x346cf9);}(_0x039d,0x87));var _0xd039=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x039d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd039('0x0'));module[_0xd039('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xd039('0x2')],'allowNull':![],'comment':_0xd039('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd039('0x4'),'comment':_0xd039('0x3')},'VoiceQueueId':{'type':Sequelize[_0xd039('0x5')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd039('0x4'),'comment':_0xd039('0x3')},'penalty':{'type':Sequelize[_0xd039('0x5')](0xb),'defaultValue':0x0,'comment':_0xd039('0x3')},'paused':{'type':Sequelize[_0xd039('0x5')](0xb),'defaultValue':0x0,'comment':_0xd039('0x3')}};
\ No newline at end of file
+var _0x1a27=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x35de68,_0x165ef8){var _0xf70815=function(_0x731b8e){while(--_0x731b8e){_0x35de68['push'](_0x35de68['shift']());}};_0xf70815(++_0x165ef8);}(_0x1a27,0xca));var _0x71a2=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x1a27[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x71a2('0x0'));module[_0x71a2('0x1')]={'uniqueid':{'type':Sequelize[_0x71a2('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x71a2('0x3')},'UserId':{'type':Sequelize[_0x71a2('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x71a2('0x4')],'allowNull':![],'unique':_0x71a2('0x5'),'comment':_0x71a2('0x3')},'VoiceQueueId':{'type':Sequelize[_0x71a2('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x71a2('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x71a2('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x71a2('0x3')},'paused':{'type':Sequelize[_0x71a2('0x2')](0xb),'defaultValue':0x0,'comment':_0x71a2('0x3')}};
\ No newline at end of file
index f4f99ec..9a15a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb24f=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb24f,0x156));var _0xfb24=function(_0x30abbb,_0x5a5d94){_0x30abbb=_0x30abbb-0x0;var _0x260880=_0xb24f[_0x30abbb];return _0x260880;};'use strict';var EventEmitter=require(_0xfb24('0x0'));var UserVoiceQueueRt=require(_0xfb24('0x1'))['db'][_0xfb24('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xfb24('0x3')](0x0);var events={'afterCreate':_0xfb24('0x4'),'afterUpdate':_0xfb24('0x5'),'afterDestroy':_0xfb24('0x6')};function emitEvent(_0x5184ab){return function(_0x4b8810,_0x4d7cfc,_0x4c43bf){UserVoiceQueueRtEvents['emit'](_0x5184ab+':'+_0x4b8810['id'],_0x4b8810);UserVoiceQueueRtEvents['emit'](_0x5184ab,_0x4b8810);_0x4c43bf(null);};}for(var e in events){if(events[_0xfb24('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xfb24('0x8')](e,emitEvent(event));}}module[_0xfb24('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xdf44=['exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xdf44,0xb5));var _0x4df4=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xdf44[_0x4d8ed9];return _0x1e2140;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4df4('0x0'))['db'][_0x4df4('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4df4('0x2')](0x0);var events={'afterCreate':_0x4df4('0x3'),'afterUpdate':_0x4df4('0x4'),'afterDestroy':_0x4df4('0x5')};function emitEvent(_0x528a77){return function(_0x199b99,_0x2ab7b3,_0x457618){UserVoiceQueueRtEvents[_0x4df4('0x6')](_0x528a77+':'+_0x199b99['id'],_0x199b99);UserVoiceQueueRtEvents[_0x4df4('0x6')](_0x528a77,_0x199b99);_0x457618(null);};}for(var e in events){if(events[_0x4df4('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4df4('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 8f2e7f9..35052c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x542f=['api','moment','request-promise','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x542f,0x13e));var _0xf542=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x542f[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0xf542('0x0'));var logger=require(_0xf542('0x1'))(_0xf542('0x2'));var moment=require(_0xf542('0x3'));var BPromise=require('bluebird');var rp=require(_0xf542('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf542('0x5'));var attributes=require(_0xf542('0x6'));module[_0xf542('0x7')]=function(_0x5c84eb,_0x23ee2c){return _0x5c84eb['define'](_0xf542('0x8'),attributes,{'tableName':_0xf542('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e39=['util','../../config/logger','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x5e5308,_0x5b6972){var _0x5db34d=function(_0x1076b6){while(--_0x1076b6){_0x5e5308['push'](_0x5e5308['shift']());}};_0x5db34d(++_0x5b6972);}(_0x4e39,0x9b));var _0x94e3=function(_0x309385,_0x3ab38f){_0x309385=_0x309385-0x0;var _0x45b0f5=_0x4e39[_0x309385];return _0x45b0f5;};'use strict';var _=require(_0x94e3('0x0'));var util=require(_0x94e3('0x1'));var logger=require(_0x94e3('0x2'))('api');var moment=require(_0x94e3('0x3'));var BPromise=require(_0x94e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94e3('0x5'));var rimraf=require('rimraf');var config=require(_0x94e3('0x6'));var attributes=require(_0x94e3('0x7'));module[_0x94e3('0x8')]=function(_0x597cb9,_0x4b5c37){return _0x597cb9[_0x94e3('0x9')](_0x94e3('0xa'),attributes,{'tableName':_0x94e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f0405f..931bd3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96a5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment'];(function(_0x46d022,_0x4547da){var _0x1daab4=function(_0x1f0708){while(--_0x1f0708){_0x46d022['push'](_0x46d022['shift']());}};_0x1daab4(++_0x4547da);}(_0x96a5,0x183));var _0x596a=function(_0x463d50,_0x330e42){_0x463d50=_0x463d50-0x0;var _0x308655=_0x96a5[_0x463d50];return _0x308655;};'use strict';var _=require(_0x596a('0x0'));var util=require(_0x596a('0x1'));var moment=require(_0x596a('0x2'));var BPromise=require(_0x596a('0x3'));var rs=require(_0x596a('0x4'));var fs=require('fs');var Redis=require(_0x596a('0x5'));var db=require(_0x596a('0x6'))['db'];var utils=require(_0x596a('0x7'));var logger=require(_0x596a('0x8'))(_0x596a('0x9'));var config=require(_0x596a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x596a('0xb')][_0x596a('0xc')]({'port':0x232a});config[_0x596a('0xd')]=_[_0x596a('0xe')](config[_0x596a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x596a('0xf'))(new Redis(config[_0x596a('0xd')]));require(_0x596a('0x10'))[_0x596a('0x11')](socket);function respondWithRpcPromise(_0x149461,_0x22d195,_0x3d5f2c){return new BPromise(function(_0x1ba84b,_0xbc0074){return client['request'](_0x149461,_0x3d5f2c)['then'](function(_0x752f62){logger[_0x596a('0x12')](_0x596a('0x13'),_0x22d195,_0x596a('0x14'));logger[_0x596a('0x15')](_0x596a('0x16'),_0x22d195,_0x596a('0x14'),JSON[_0x596a('0x17')](_0x752f62));if(_0x752f62['error']){if(_0x752f62[_0x596a('0x18')][_0x596a('0x19')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x22d195,_0x752f62[_0x596a('0x18')][_0x596a('0x1a')]);return _0xbc0074(_0x752f62[_0x596a('0x18')][_0x596a('0x1a')]);}logger['error'](_0x596a('0x13'),_0x22d195,_0x752f62[_0x596a('0x18')][_0x596a('0x1a')]);return _0x1ba84b(_0x752f62[_0x596a('0x18')][_0x596a('0x1a')]);}else{logger[_0x596a('0x12')](_0x596a('0x13'),_0x22d195,'request\x20sent');_0x1ba84b(_0x752f62['result'][_0x596a('0x1a')]);}})[_0x596a('0x1b')](function(_0x335d12){logger['error'](_0x596a('0x13'),_0x22d195,_0x335d12);_0xbc0074(_0x335d12);});});}exports['GetVoiceQueueRtPauses']=function(_0x32d1a2){var _0x534bff=this;return new Promise(function(_0x1f08be,_0x36f2bf){return db[_0x596a('0x1c')][_0x596a('0x1d')]({'raw':_0x32d1a2['options']?_0x32d1a2[_0x596a('0x1e')][_0x596a('0x1f')]===undefined?!![]:![]:!![],'where':_0x32d1a2[_0x596a('0x1e')]?_0x32d1a2['options'][_0x596a('0x20')]||null:null,'attributes':[[db[_0x596a('0x21')]['fn'](_0x596a('0x22'),db[_0x596a('0x21')]['fn']('IF',db[_0x596a('0x21')][_0x596a('0x23')](_0x596a('0x24')))),_0x596a('0x25')]]})['then'](function(_0x3ece67){logger[_0x596a('0x12')](_0x596a('0x26'),_0x32d1a2);logger[_0x596a('0x15')](_0x596a('0x26'),_0x32d1a2,JSON[_0x596a('0x17')](_0x3ece67));_0x1f08be(_0x3ece67);})['catch'](function(_0x185034){logger[_0x596a('0x18')](_0x596a('0x26'),_0x185034[_0x596a('0x1a')],_0x32d1a2);_0x36f2bf(_0x534bff[_0x596a('0x18')](0x1f4,_0x185034[_0x596a('0x1a')]));});});};
\ No newline at end of file
+var _0x2a09=['info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x503287,_0x252ead){var _0x3709ef=function(_0x39e5f5){while(--_0x39e5f5){_0x503287['push'](_0x503287['shift']());}};_0x3709ef(++_0x252ead);}(_0x2a09,0xed));var _0x92a0=function(_0x5995fd,_0x11ece1){_0x5995fd=_0x5995fd-0x0;var _0x8cda35=_0x2a09[_0x5995fd];return _0x8cda35;};'use strict';var _=require(_0x92a0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x92a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92a0('0x2'));var db=require(_0x92a0('0x3'))['db'];var utils=require(_0x92a0('0x4'));var logger=require(_0x92a0('0x5'))(_0x92a0('0x6'));var config=require(_0x92a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x92a0('0x8')][_0x92a0('0x9')]({'port':0x232a});config[_0x92a0('0xa')]=_[_0x92a0('0xb')](config[_0x92a0('0xa')],{'host':_0x92a0('0xc'),'port':0x18eb});var socket=require(_0x92a0('0xd'))(new Redis(config[_0x92a0('0xa')]));require('./userVoiceQueueRt.socket')[_0x92a0('0xe')](socket);function respondWithRpcPromise(_0x54c17b,_0xbee955,_0x10a43f){return new BPromise(function(_0x1c6435,_0x2713c0){return client['request'](_0x54c17b,_0x10a43f)['then'](function(_0x586b99){logger[_0x92a0('0xf')](_0x92a0('0x10'),_0xbee955,'request\x20sent');logger[_0x92a0('0x11')](_0x92a0('0x12'),_0xbee955,_0x92a0('0x13'),JSON[_0x92a0('0x14')](_0x586b99));if(_0x586b99[_0x92a0('0x15')]){if(_0x586b99['error'][_0x92a0('0x16')]===0x1f4){logger[_0x92a0('0x15')](_0x92a0('0x10'),_0xbee955,_0x586b99['error'][_0x92a0('0x17')]);return _0x2713c0(_0x586b99[_0x92a0('0x15')][_0x92a0('0x17')]);}logger[_0x92a0('0x15')](_0x92a0('0x10'),_0xbee955,_0x586b99[_0x92a0('0x15')][_0x92a0('0x17')]);return _0x1c6435(_0x586b99[_0x92a0('0x15')][_0x92a0('0x17')]);}else{logger[_0x92a0('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xbee955,_0x92a0('0x13'));_0x1c6435(_0x586b99['result'][_0x92a0('0x17')]);}})[_0x92a0('0x18')](function(_0x4a6e15){logger[_0x92a0('0x15')](_0x92a0('0x10'),_0xbee955,_0x4a6e15);_0x2713c0(_0x4a6e15);});});}exports[_0x92a0('0x19')]=function(_0x533c44){var _0x191405=this;return new Promise(function(_0x44a626,_0x2b1002){return db['UserVoiceQueueRt'][_0x92a0('0x1a')]({'raw':_0x533c44[_0x92a0('0x1b')]?_0x533c44[_0x92a0('0x1b')][_0x92a0('0x1c')]===undefined?!![]:![]:!![],'where':_0x533c44[_0x92a0('0x1b')]?_0x533c44[_0x92a0('0x1b')][_0x92a0('0x1d')]||null:null,'attributes':[[db[_0x92a0('0x1e')]['fn'](_0x92a0('0x1f'),db[_0x92a0('0x1e')]['fn']('IF',db['sequelize'][_0x92a0('0x20')](_0x92a0('0x21')))),_0x92a0('0x22')]]})[_0x92a0('0x23')](function(_0x521e5c){logger['info'](_0x92a0('0x19'),_0x533c44);logger[_0x92a0('0x11')](_0x92a0('0x19'),_0x533c44,JSON[_0x92a0('0x14')](_0x521e5c));_0x44a626(_0x521e5c);})[_0x92a0('0x18')](function(_0x437d50){logger[_0x92a0('0x15')](_0x92a0('0x19'),_0x437d50[_0x92a0('0x17')],_0x533c44);_0x2b1002(_0x191405[_0x92a0('0x15')](0x1f4,_0x437d50['message']));});});};
\ No newline at end of file
index 9072838..93c833a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['emit','register','./userVoiceQueueRt.events','save','remove'];(function(_0x38541b,_0x5c9ac2){var _0x2b4938=function(_0x4b4ce3){while(--_0x4b4ce3){_0x38541b['push'](_0x38541b['shift']());}};_0x2b4938(++_0x5c9ac2);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0xf2ca[_0x2f023d];return _0x4ef240;};'use strict';var UserVoiceQueueRtEvents=require(_0xaf2c('0x0'));var events=[_0xaf2c('0x1'),_0xaf2c('0x2'),'update'];function createListener(_0xbb7f52,_0x2102e2){return function(_0x1271a9){_0x2102e2[_0xaf2c('0x3')](_0xbb7f52,_0x1271a9);};}function removeListener(_0x3a724c,_0x10c910){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3a724c,_0x10c910);};}exports[_0xaf2c('0x4')]=function(_0x100d17){for(var _0x297740=0x0,_0x1f9531=events['length'];_0x297740<_0x1f9531;_0x297740++){var _0x37fedd=events[_0x297740];var _0x3c0421=createListener('userVoiceQueueRt:'+_0x37fedd,_0x100d17);UserVoiceQueueRtEvents['on'](_0x37fedd,_0x3c0421);}};
\ No newline at end of file
+var _0xe5e0=['update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x39152a,_0x1c2d25){var _0x5d94b4=function(_0x2d66c0){while(--_0x2d66c0){_0x39152a['push'](_0x39152a['shift']());}};_0x5d94b4(++_0x1c2d25);}(_0xe5e0,0x123));var _0x0e5e=function(_0x1ea180,_0x213bcf){_0x1ea180=_0x1ea180-0x0;var _0x5e0d01=_0xe5e0[_0x1ea180];return _0x5e0d01;};'use strict';var UserVoiceQueueRtEvents=require(_0x0e5e('0x0'));var events=[_0x0e5e('0x1'),_0x0e5e('0x2'),_0x0e5e('0x3')];function createListener(_0xc55c5c,_0x1487f7){return function(_0x278df1){_0x1487f7[_0x0e5e('0x4')](_0xc55c5c,_0x278df1);};}function removeListener(_0x2a6b6e,_0x43b942){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2a6b6e,_0x43b942);};}exports[_0x0e5e('0x5')]=function(_0x39c487){for(var _0x5cc97b=0x0,_0x2b6bd9=events['length'];_0x5cc97b<_0x2b6bd9;_0x5cc97b++){var _0x14e323=events[_0x5cc97b];var _0x4ca006=createListener(_0x0e5e('0x6')+_0x14e323,_0x39c487);UserVoiceQueueRtEvents['on'](_0x14e323,_0x4ca006);}};
\ No newline at end of file
index 29afdcd..2d6661c 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(_0x1690ff,_0x62743d){var _0x4b7529=function(_0x4301d9){while(--_0x4301d9){_0x1690ff['push'](_0x1690ff['shift']());}};_0x4b7529(++_0x62743d);}(_0x70e0,0x17b));var _0x070e=function(_0x279125,_0x522a4b){_0x279125=_0x279125-0x0;var _0x3d840f=_0x70e0[_0x279125];return _0x3d840f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1faae8,_0x3977df){var _0x50aab3=function(_0x1373e6){while(--_0x1373e6){_0x1faae8['push'](_0x1faae8['shift']());}};_0x50aab3(++_0x3977df);}(_0x70e0,0x17b));var _0x070e=function(_0x1377b9,_0x1669f0){_0x1377b9=_0x1377b9-0x0;var _0x3f17d0=_0x70e0[_0x1377b9];return _0x3f17d0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index c8efc84..7728d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3284=['sequelize','exports','INTEGER'];(function(_0x48ae97,_0x450240){var _0x13a62f=function(_0x139f44){while(--_0x139f44){_0x48ae97['push'](_0x48ae97['shift']());}};_0x13a62f(++_0x450240);}(_0x3284,0xfc));var _0x4328=function(_0x38f5b8,_0x3e5e08){_0x38f5b8=_0x38f5b8-0x0;var _0xc80c6c=_0x3284[_0x38f5b8];return _0xc80c6c;};'use strict';var Sequelize=require(_0x4328('0x0'));module[_0x4328('0x1')]={'penalty':{'type':Sequelize[_0x4328('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf185=['sequelize','INTEGER'];(function(_0x445d62,_0x12f3e1){var _0x5b4125=function(_0x50c536){while(--_0x50c536){_0x445d62['push'](_0x445d62['shift']());}};_0x5b4125(++_0x12f3e1);}(_0xf185,0x1be));var _0x5f18=function(_0x22fdd9,_0x5adad0){_0x22fdd9=_0x22fdd9-0x0;var _0x52df42=_0xf185[_0x22fdd9];return _0x52df42;};'use strict';var Sequelize=require(_0x5f18('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5f18('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index d2c89d9..3a89f33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e14=['util','../../config/logger','moment','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','lodash'];(function(_0x2a5a58,_0x3254a9){var _0x4f112e=function(_0x125cd1){while(--_0x125cd1){_0x2a5a58['push'](_0x2a5a58['shift']());}};_0x4f112e(++_0x3254a9);}(_0x5e14,0xe5));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x45e1('0x0'));var util=require(_0x45e1('0x1'));var logger=require(_0x45e1('0x2'))('api');var moment=require(_0x45e1('0x3'));var BPromise=require('bluebird');var rp=require(_0x45e1('0x4'));var fs=require('fs');var path=require(_0x45e1('0x5'));var rimraf=require('rimraf');var config=require(_0x45e1('0x6'));var attributes=require(_0x45e1('0x7'));module[_0x45e1('0x8')]=function(_0x39b8fb,_0x18237c){return _0x39b8fb['define'](_0x45e1('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x331c=['UserWhatsappQueue','user_has_whatsapp_queues','api','moment','bluebird','rimraf','../../config/environment','./userWhatsappQueue.attributes','define'];(function(_0xfd2974,_0x37e556){var _0x149817=function(_0x1913cb){while(--_0x1913cb){_0xfd2974['push'](_0xfd2974['shift']());}};_0x149817(++_0x37e556);}(_0x331c,0x185));var _0xc331=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x331c[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc331('0x0'));var moment=require(_0xc331('0x1'));var BPromise=require(_0xc331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc331('0x3'));var config=require(_0xc331('0x4'));var attributes=require(_0xc331('0x5'));module['exports']=function(_0xa6faa8,_0x495e3c){return _0xa6faa8[_0xc331('0x6')](_0xc331('0x7'),attributes,{'tableName':_0xc331('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f062d69..745bb76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb1=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent'];(function(_0x1944e8,_0x49df14){var _0x432388=function(_0x19ecc5){while(--_0x19ecc5){_0x1944e8['push'](_0x1944e8['shift']());}};_0x432388(++_0x49df14);}(_0xadb1,0x1a6));var _0x1adb=function(_0x422c00,_0x54be61){_0x422c00=_0x422c00-0x0;var _0x192932=_0xadb1[_0x422c00];return _0x192932;};'use strict';var _=require(_0x1adb('0x0'));var util=require(_0x1adb('0x1'));var moment=require(_0x1adb('0x2'));var BPromise=require('bluebird');var rs=require(_0x1adb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1adb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1adb('0x5'))(_0x1adb('0x6'));var config=require(_0x1adb('0x7'));var jayson=require(_0x1adb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d17ff,_0x476015,_0x23b71a){return new BPromise(function(_0x12731a,_0x47e883){return client[_0x1adb('0x9')](_0x4d17ff,_0x23b71a)['then'](function(_0x876340){logger['info'](_0x1adb('0xa'),_0x476015,'request\x20sent');logger[_0x1adb('0xb')](_0x1adb('0xc'),_0x476015,'request\x20sent',JSON['stringify'](_0x876340));if(_0x876340[_0x1adb('0xd')]){if(_0x876340[_0x1adb('0xd')][_0x1adb('0xe')]===0x1f4){logger[_0x1adb('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x476015,_0x876340[_0x1adb('0xd')][_0x1adb('0xf')]);return _0x47e883(_0x876340['error']['message']);}logger[_0x1adb('0xd')](_0x1adb('0xa'),_0x476015,_0x876340[_0x1adb('0xd')][_0x1adb('0xf')]);return _0x12731a(_0x876340[_0x1adb('0xd')][_0x1adb('0xf')]);}else{logger[_0x1adb('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x476015,_0x1adb('0x11'));_0x12731a(_0x876340[_0x1adb('0x12')][_0x1adb('0xf')]);}})[_0x1adb('0x13')](function(_0x568b94){logger['error'](_0x1adb('0xa'),_0x476015,_0x568b94);_0x47e883(_0x568b94);});});}
\ No newline at end of file
+var _0x247d=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x247d,0x133));var _0xd247=function(_0x157938,_0x5c934b){_0x157938=_0x157938-0x0;var _0x364704=_0x247d[_0x157938];return _0x364704;};'use strict';var _=require(_0xd247('0x0'));var util=require(_0xd247('0x1'));var moment=require(_0xd247('0x2'));var BPromise=require(_0xd247('0x3'));var rs=require(_0xd247('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd247('0x5'));var config=require(_0xd247('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd247('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13a8ab,_0x2ac188,_0x3ba470){return new BPromise(function(_0x6e6147,_0x34f57a){return client[_0xd247('0x8')](_0x13a8ab,_0x3ba470)[_0xd247('0x9')](function(_0x47cd77){logger[_0xd247('0xa')](_0xd247('0xb'),_0x2ac188,_0xd247('0xc'));logger[_0xd247('0xd')](_0xd247('0xe'),_0x2ac188,_0xd247('0xc'),JSON['stringify'](_0x47cd77));if(_0x47cd77['error']){if(_0x47cd77[_0xd247('0xf')][_0xd247('0x10')]===0x1f4){logger[_0xd247('0xf')](_0xd247('0xb'),_0x2ac188,_0x47cd77['error'][_0xd247('0x11')]);return _0x34f57a(_0x47cd77['error'][_0xd247('0x11')]);}logger[_0xd247('0xf')](_0xd247('0xb'),_0x2ac188,_0x47cd77['error'][_0xd247('0x11')]);return _0x6e6147(_0x47cd77[_0xd247('0xf')][_0xd247('0x11')]);}else{logger[_0xd247('0xa')](_0xd247('0xb'),_0x2ac188,_0xd247('0xc'));_0x6e6147(_0x47cd77[_0xd247('0x12')][_0xd247('0x11')]);}})[_0xd247('0x13')](function(_0x4bfc65){logger[_0xd247('0xf')](_0xd247('0xb'),_0x2ac188,_0x4bfc65);_0x34f57a(_0x4bfc65);});});}
\ No newline at end of file
index 011349b..d9e9ac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc252=['./variable.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xc252,0x118));var _0x2c25=function(_0x6b16dd,_0x5c7d73){_0x6b16dd=_0x6b16dd-0x0;var _0x5a354c=_0xc252[_0x6b16dd];return _0x5a354c;};'use strict';var multer=require(_0x2c25('0x0'));var util=require(_0x2c25('0x1'));var path=require(_0x2c25('0x2'));var timeout=require(_0x2c25('0x3'));var express=require(_0x2c25('0x4'));var router=express[_0x2c25('0x5')]();var fs_extra=require(_0x2c25('0x6'));var auth=require(_0x2c25('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2c25('0x8'));router['get']('/',auth[_0x2c25('0x9')](),controller[_0x2c25('0xa')]);router[_0x2c25('0xb')](_0x2c25('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2c25('0xd')]('/',auth[_0x2c25('0x9')](),controller[_0x2c25('0xe')]);router[_0x2c25('0xf')](_0x2c25('0xc'),auth[_0x2c25('0x9')](),controller[_0x2c25('0x10')]);router['delete'](_0x2c25('0xc'),auth['isAuthenticated'](),controller[_0x2c25('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x47d6=['update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x22f701,_0x144f19){var _0x135c4e=function(_0x1043ee){while(--_0x1043ee){_0x22f701['push'](_0x22f701['shift']());}};_0x135c4e(++_0x144f19);}(_0x47d6,0x1de));var _0x647d=function(_0x518878,_0x40e538){_0x518878=_0x518878-0x0;var _0x2ab1ef=_0x47d6[_0x518878];return _0x2ab1ef;};'use strict';var multer=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x647d('0x6'));var controller=require(_0x647d('0x7'));router[_0x647d('0x8')]('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0x8')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0xc')]);router[_0x647d('0xd')]('/',auth[_0x647d('0xb')](),controller[_0x647d('0xe')]);router[_0x647d('0xf')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x10')]);router['delete'](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x11')]);module[_0x647d('0x12')]=router;
\ No newline at end of file
index e966a99..58372d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2315=['STRING','sequelize','exports'];(function(_0x3ae482,_0x4c7fa8){var _0x3eeabe=function(_0x42b399){while(--_0x42b399){_0x3ae482['push'](_0x3ae482['shift']());}};_0x3eeabe(++_0x4c7fa8);}(_0x2315,0x88));var _0x5231=function(_0x3ca668,_0x25ae5f){_0x3ca668=_0x3ca668-0x0;var _0x151ad5=_0x2315[_0x3ca668];return _0x151ad5;};'use strict';var Sequelize=require(_0x5231('0x0'));module[_0x5231('0x1')]={'name':{'type':Sequelize[_0x5231('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5231('0x2')]}};
\ No newline at end of file
+var _0x132b=['STRING','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x132b,0x8d));var _0xb132=function(_0x329dfa,_0x205d0b){_0x329dfa=_0x329dfa-0x0;var _0x4e99ac=_0x132b[_0x329dfa];return _0x4e99ac;};'use strict';var Sequelize=require(_0xb132('0x0'));module[_0xb132('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb132('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb132('0x3')]}};
\ No newline at end of file
index 14bcd14..49d5069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8102=['map','Variable','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','type','VIRTUAL','merge','includeAll','findAll','catch','show','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','Content-Range','apply','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index'];(function(_0x224356,_0x2a3dd5){var _0x196a55=function(_0x2afc3f){while(--_0x2afc3f){_0x224356['push'](_0x224356['shift']());}};_0x196a55(++_0x2a3dd5);}(_0x8102,0x171));var _0x2810=function(_0x12b37a,_0x1b036b){_0x12b37a=_0x12b37a-0x0;var _0x56d2cb=_0x8102[_0x12b37a];return _0x56d2cb;};'use strict';var emlformat=require(_0x2810('0x0'));var rimraf=require(_0x2810('0x1'));var zipdir=require(_0x2810('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2810('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2810('0x4'));var path=require(_0x2810('0x5'));var sox=require(_0x2810('0x6'));var csv=require(_0x2810('0x7'));var ejs=require(_0x2810('0x8'));var fs=require('fs');var fs_extra=require(_0x2810('0x9'));var _=require(_0x2810('0xa'));var squel=require(_0x2810('0xb'));var crypto=require(_0x2810('0xc'));var jsforce=require(_0x2810('0xd'));var deskjs=require(_0x2810('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2810('0xf'));var Papa=require(_0x2810('0x10'));var Redis=require(_0x2810('0x11'));var authService=require(_0x2810('0x12'));var qs=require(_0x2810('0x13'));var as=require(_0x2810('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2810('0x15'))(_0x2810('0x16'));var utils=require(_0x2810('0x17'));var config=require(_0x2810('0x18'));var licenseUtil=require(_0x2810('0x19'));var db=require(_0x2810('0x1a'))['db'];function respondWithStatusCode(_0x4f1abc,_0x2de1dc){_0x2de1dc=_0x2de1dc||0xcc;return function(_0x3148ca){if(_0x3148ca){return _0x4f1abc[_0x2810('0x1b')](_0x2de1dc);}return _0x4f1abc['status'](_0x2de1dc)[_0x2810('0x1c')]();};}function respondWithResult(_0xe11e7,_0x43678f){_0x43678f=_0x43678f||0xc8;return function(_0x3fee9f){if(_0x3fee9f){return _0xe11e7['status'](_0x43678f)[_0x2810('0x1d')](_0x3fee9f);}};}function respondWithFilteredResult(_0x23cbe4,_0x15f6d5){return function(_0x103377){if(_0x103377){var _0x54f861=typeof _0x15f6d5['offset']===_0x2810('0x1e')&&typeof _0x15f6d5[_0x2810('0x1f')]==='undefined';var _0x5b63d6=_0x103377[_0x2810('0x20')];var _0x7bd5aa=_0x54f861?0x0:_0x15f6d5['offset'];var _0x338d18=_0x54f861?_0x103377['count']:_0x15f6d5['offset']+_0x15f6d5[_0x2810('0x1f')];var _0x564d72;if(_0x338d18>=_0x5b63d6){_0x338d18=_0x5b63d6;_0x564d72=0xc8;}else{_0x564d72=0xce;}_0x23cbe4['status'](_0x564d72);return _0x23cbe4['set'](_0x2810('0x21'),_0x7bd5aa+'-'+_0x338d18+'/'+_0x5b63d6)[_0x2810('0x1d')](_0x103377);}return null;};}function patchUpdates(_0x43d90e){return function(_0x40b523){try{jsonpatch[_0x2810('0x22')](_0x40b523,_0x43d90e,!![]);}catch(_0x627419){return BPromise['reject'](_0x627419);}return _0x40b523['save']();};}function saveUpdates(_0x7f4f2a,_0xf9dae4){return function(_0x33ba64){if(_0x33ba64){return _0x33ba64[_0x2810('0x23')](_0x7f4f2a)[_0x2810('0x24')](function(_0x4be80a){return _0x4be80a;});}return null;};}function removeEntity(_0x950a35,_0x8ec169){return function(_0x3d1d74){if(_0x3d1d74){return _0x3d1d74[_0x2810('0x25')]()[_0x2810('0x24')](function(){var _0x4b9fb5=_0x3d1d74[_0x2810('0x26')]({'plain':!![]});var _0x53cc66=_0x2810('0x27');return db[_0x2810('0x28')][_0x2810('0x25')]({'where':{'type':_0x53cc66,'resourceId':_0x4b9fb5['id']}})[_0x2810('0x24')](function(){return _0x3d1d74;});})[_0x2810('0x24')](function(){_0x950a35['status'](0xcc)[_0x2810('0x1c')]();});}};}function handleEntityNotFound(_0x4872f6,_0x101670){return function(_0x5a9036){if(!_0x5a9036){_0x4872f6[_0x2810('0x1b')](0x194);}return _0x5a9036;};}function handleError(_0x4230cb,_0x36a9de){_0x36a9de=_0x36a9de||0x1f4;return function(_0x61380a){logger[_0x2810('0x29')](_0x61380a[_0x2810('0x2a')]);if(_0x61380a[_0x2810('0x2b')]){delete _0x61380a[_0x2810('0x2b')];}_0x4230cb['status'](_0x36a9de)[_0x2810('0x2c')](_0x61380a);};}exports[_0x2810('0x2d')]=function(_0x2a8afb,_0x41d22c){var _0x190232={},_0x553981={},_0x562b3a={'count':0x0,'rows':[]};var _0x5e0f5f=_[_0x2810('0x2e')](db[_0x2810('0x2f')][_0x2810('0x30')],function(_0x548c37){return{'name':_0x548c37[_0x2810('0x31')],'type':_0x548c37['type'][_0x2810('0x32')]};});_0x553981[_0x2810('0x33')]=_['map'](_0x5e0f5f,_0x2810('0x2b'));_0x553981['query']=_[_0x2810('0x34')](_0x2a8afb[_0x2810('0x35')]);_0x553981[_0x2810('0x36')]=_['intersection'](_0x553981[_0x2810('0x33')],_0x553981[_0x2810('0x35')]);_0x190232[_0x2810('0x37')]=_['intersection'](_0x553981[_0x2810('0x33')],qs[_0x2810('0x38')](_0x2a8afb[_0x2810('0x35')][_0x2810('0x38')]));_0x190232[_0x2810('0x37')]=_0x190232[_0x2810('0x37')][_0x2810('0x39')]?_0x190232[_0x2810('0x37')]:_0x553981[_0x2810('0x33')];if(!_0x2a8afb[_0x2810('0x35')][_0x2810('0x3a')](_0x2810('0x3b'))){_0x190232['limit']=qs[_0x2810('0x1f')](_0x2a8afb['query'][_0x2810('0x1f')]);_0x190232[_0x2810('0x3c')]=qs[_0x2810('0x3c')](_0x2a8afb[_0x2810('0x35')][_0x2810('0x3c')]);}_0x190232[_0x2810('0x3d')]=qs['sort'](_0x2a8afb[_0x2810('0x35')][_0x2810('0x3e')]);_0x190232[_0x2810('0x3f')]=qs[_0x2810('0x36')](_['pick'](_0x2a8afb[_0x2810('0x35')],_0x553981[_0x2810('0x36')]),_0x5e0f5f);if(_0x2a8afb[_0x2810('0x35')]['filter']){_0x190232[_0x2810('0x3f')]=_['merge'](_0x190232['where'],{'$or':_[_0x2810('0x2e')](_0x5e0f5f,function(_0x161f05){if(_0x161f05[_0x2810('0x40')]!==_0x2810('0x41')){var _0x46be42={};_0x46be42[_0x161f05[_0x2810('0x2b')]]={'$like':'%'+_0x2a8afb[_0x2810('0x35')]['filter']+'%'};return _0x46be42;}})});}_0x190232=_[_0x2810('0x42')]({},_0x190232,_0x2a8afb['options']);var _0x5dddf3={'where':_0x190232[_0x2810('0x3f')]};return db[_0x2810('0x2f')][_0x2810('0x20')](_0x5dddf3)[_0x2810('0x24')](function(_0x5d4d90){_0x562b3a[_0x2810('0x20')]=_0x5d4d90;if(_0x2a8afb[_0x2810('0x35')][_0x2810('0x43')]){_0x190232['include']=[{'all':!![]}];}return db[_0x2810('0x2f')][_0x2810('0x44')](_0x190232);})[_0x2810('0x24')](function(_0x38437c){_0x562b3a['rows']=_0x38437c;return _0x562b3a;})['then'](respondWithFilteredResult(_0x41d22c,_0x190232))[_0x2810('0x45')](handleError(_0x41d22c,null));};exports[_0x2810('0x46')]=function(_0x3e82a1,_0x5b7e44){var _0x4596f9={'raw':!![],'where':{'id':_0x3e82a1['params']['id']}},_0x3e68fb={};_0x3e68fb[_0x2810('0x33')]=_[_0x2810('0x34')](db[_0x2810('0x2f')][_0x2810('0x30')]);_0x3e68fb[_0x2810('0x35')]=_[_0x2810('0x34')](_0x3e82a1[_0x2810('0x35')]);_0x3e68fb[_0x2810('0x36')]=_[_0x2810('0x47')](_0x3e68fb[_0x2810('0x33')],_0x3e68fb[_0x2810('0x35')]);_0x4596f9[_0x2810('0x37')]=_[_0x2810('0x47')](_0x3e68fb[_0x2810('0x33')],qs[_0x2810('0x38')](_0x3e82a1[_0x2810('0x35')]['fields']));_0x4596f9[_0x2810('0x37')]=_0x4596f9['attributes'][_0x2810('0x39')]?_0x4596f9[_0x2810('0x37')]:_0x3e68fb[_0x2810('0x33')];if(_0x3e82a1[_0x2810('0x35')][_0x2810('0x43')]){_0x4596f9[_0x2810('0x48')]=[{'all':!![]}];}_0x4596f9=_[_0x2810('0x42')]({},_0x4596f9,_0x3e82a1['options']);return db[_0x2810('0x2f')][_0x2810('0x49')](_0x4596f9)[_0x2810('0x24')](handleEntityNotFound(_0x5b7e44,null))[_0x2810('0x24')](respondWithResult(_0x5b7e44,null))[_0x2810('0x45')](handleError(_0x5b7e44,null));};exports[_0x2810('0x4a')]=function(_0x326102,_0x53ca0f){return db[_0x2810('0x2f')][_0x2810('0x4a')](_0x326102[_0x2810('0x4b')],{})[_0x2810('0x24')](function(_0x105cd6){var _0x4f0c03=_0x326102[_0x2810('0x4c')]['get']({'plain':!![]});if(!_0x4f0c03)throw new Error(_0x2810('0x4d'));if(_0x4f0c03['role']===_0x2810('0x4c')){var _0x14c1a3=_0x105cd6[_0x2810('0x26')]({'plain':!![]});var _0x4a1150=_0x2810('0x27');return db[_0x2810('0x4e')]['find']({'where':{'name':_0x4a1150,'userProfileId':_0x4f0c03[_0x2810('0x4f')]},'raw':!![]})[_0x2810('0x24')](function(_0x5cff44){if(_0x5cff44&&_0x5cff44[_0x2810('0x50')]===0x0){return db[_0x2810('0x28')][_0x2810('0x4a')]({'name':_0x14c1a3['name'],'resourceId':_0x14c1a3['id'],'type':_0x5cff44[_0x2810('0x2b')],'sectionId':_0x5cff44['id']},{})[_0x2810('0x24')](function(){return _0x105cd6;});}else{return _0x105cd6;}})['catch'](function(_0x2418e6){logger['error'](_0x2810('0x51'),_0x2418e6);throw _0x2418e6;});}return _0x105cd6;})['then'](respondWithResult(_0x53ca0f,0xc9))[_0x2810('0x45')](handleError(_0x53ca0f,null));};exports[_0x2810('0x23')]=function(_0xd473a3,_0x353e5b){if(_0xd473a3['body']['id']){delete _0xd473a3[_0x2810('0x4b')]['id'];}return db[_0x2810('0x2f')][_0x2810('0x49')]({'where':{'id':_0xd473a3[_0x2810('0x52')]['id']}})[_0x2810('0x24')](handleEntityNotFound(_0x353e5b,null))[_0x2810('0x24')](saveUpdates(_0xd473a3[_0x2810('0x4b')],null))[_0x2810('0x24')](respondWithResult(_0x353e5b,null))[_0x2810('0x45')](handleError(_0x353e5b,null));};exports[_0x2810('0x25')]=function(_0x257c4a,_0x469518){return db[_0x2810('0x2f')]['find']({'where':{'id':_0x257c4a[_0x2810('0x52')]['id']}})[_0x2810('0x24')](handleEntityNotFound(_0x469518,null))['then'](removeEntity(_0x469518,null))[_0x2810('0x45')](handleError(_0x469518,null));};
\ No newline at end of file
+var _0xce33=['get','Variables','UserProfileResource','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','limit','sort','where','filters','pick','filter','merge','include','findAll','catch','params','includeAll','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0xce33,0x129));var _0x3ce3=function(_0x21fe98,_0x55db4c){_0x21fe98=_0x21fe98-0x0;var _0x19dde3=_0xce33[_0x21fe98];return _0x19dde3;};'use strict';var emlformat=require(_0x3ce3('0x0'));var rimraf=require(_0x3ce3('0x1'));var zipdir=require(_0x3ce3('0x2'));var jsonpatch=require(_0x3ce3('0x3'));var rp=require(_0x3ce3('0x4'));var moment=require(_0x3ce3('0x5'));var BPromise=require(_0x3ce3('0x6'));var Mustache=require(_0x3ce3('0x7'));var util=require(_0x3ce3('0x8'));var path=require(_0x3ce3('0x9'));var sox=require(_0x3ce3('0xa'));var csv=require(_0x3ce3('0xb'));var ejs=require(_0x3ce3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ce3('0xd'));var squel=require(_0x3ce3('0xe'));var crypto=require(_0x3ce3('0xf'));var jsforce=require(_0x3ce3('0x10'));var deskjs=require(_0x3ce3('0x11'));var toCsv=require(_0x3ce3('0xb'));var querystring=require(_0x3ce3('0x12'));var Papa=require(_0x3ce3('0x13'));var Redis=require(_0x3ce3('0x14'));var authService=require(_0x3ce3('0x15'));var qs=require(_0x3ce3('0x16'));var as=require(_0x3ce3('0x17'));var hardwareService=require(_0x3ce3('0x18'));var logger=require(_0x3ce3('0x19'))(_0x3ce3('0x1a'));var utils=require(_0x3ce3('0x1b'));var config=require(_0x3ce3('0x1c'));var licenseUtil=require(_0x3ce3('0x1d'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x129412,_0x1da883){_0x1da883=_0x1da883||0xcc;return function(_0x3e240c){if(_0x3e240c){return _0x129412['sendStatus'](_0x1da883);}return _0x129412[_0x3ce3('0x1e')](_0x1da883)[_0x3ce3('0x1f')]();};}function respondWithResult(_0x346f2b,_0x346039){_0x346039=_0x346039||0xc8;return function(_0x4e2414){if(_0x4e2414){return _0x346f2b[_0x3ce3('0x1e')](_0x346039)[_0x3ce3('0x20')](_0x4e2414);}};}function respondWithFilteredResult(_0x3f20ab,_0x54f34b){return function(_0x2702b3){if(_0x2702b3){var _0x1e2053=typeof _0x54f34b[_0x3ce3('0x21')]===_0x3ce3('0x22')&&typeof _0x54f34b['limit']===_0x3ce3('0x22');var _0x286dfd=_0x2702b3[_0x3ce3('0x23')];var _0x3a87f4=_0x1e2053?0x0:_0x54f34b['offset'];var _0x4f2ae1=_0x1e2053?_0x2702b3[_0x3ce3('0x23')]:_0x54f34b[_0x3ce3('0x21')]+_0x54f34b['limit'];var _0x622166;if(_0x4f2ae1>=_0x286dfd){_0x4f2ae1=_0x286dfd;_0x622166=0xc8;}else{_0x622166=0xce;}_0x3f20ab['status'](_0x622166);return _0x3f20ab['set'](_0x3ce3('0x24'),_0x3a87f4+'-'+_0x4f2ae1+'/'+_0x286dfd)['json'](_0x2702b3);}return null;};}function patchUpdates(_0x308d1b){return function(_0x180dbd){try{jsonpatch[_0x3ce3('0x25')](_0x180dbd,_0x308d1b,!![]);}catch(_0x46b90c){return BPromise[_0x3ce3('0x26')](_0x46b90c);}return _0x180dbd[_0x3ce3('0x27')]();};}function saveUpdates(_0x1b3d2b,_0x4bc38d){return function(_0x2874f2){if(_0x2874f2){return _0x2874f2[_0x3ce3('0x28')](_0x1b3d2b)[_0x3ce3('0x29')](function(_0x31e892){return _0x31e892;});}return null;};}function removeEntity(_0x1eaef3,_0x32ac80){return function(_0x21c933){if(_0x21c933){return _0x21c933[_0x3ce3('0x2a')]()[_0x3ce3('0x29')](function(){var _0xd0a8ce=_0x21c933[_0x3ce3('0x2b')]({'plain':!![]});var _0x5c99fe=_0x3ce3('0x2c');return db[_0x3ce3('0x2d')][_0x3ce3('0x2a')]({'where':{'type':_0x5c99fe,'resourceId':_0xd0a8ce['id']}})[_0x3ce3('0x29')](function(){return _0x21c933;});})['then'](function(){_0x1eaef3['status'](0xcc)[_0x3ce3('0x1f')]();});}};}function handleEntityNotFound(_0x4d5210,_0x557f39){return function(_0x3cb525){if(!_0x3cb525){_0x4d5210[_0x3ce3('0x2e')](0x194);}return _0x3cb525;};}function handleError(_0x1e8b2d,_0xde8cef){_0xde8cef=_0xde8cef||0x1f4;return function(_0xb51e0b){logger[_0x3ce3('0x2f')](_0xb51e0b[_0x3ce3('0x30')]);if(_0xb51e0b[_0x3ce3('0x31')]){delete _0xb51e0b[_0x3ce3('0x31')];}_0x1e8b2d[_0x3ce3('0x1e')](_0xde8cef)[_0x3ce3('0x32')](_0xb51e0b);};}exports['index']=function(_0x1c6d5f,_0xe96381){var _0x302ef1={},_0x485205={},_0x13bc33={'count':0x0,'rows':[]};var _0x4e7a0e=_[_0x3ce3('0x33')](db[_0x3ce3('0x34')][_0x3ce3('0x35')],function(_0xe8ca3d){return{'name':_0xe8ca3d[_0x3ce3('0x36')],'type':_0xe8ca3d[_0x3ce3('0x37')]['key']};});_0x485205[_0x3ce3('0x38')]=_[_0x3ce3('0x33')](_0x4e7a0e,_0x3ce3('0x31'));_0x485205[_0x3ce3('0x39')]=_[_0x3ce3('0x3a')](_0x1c6d5f[_0x3ce3('0x39')]);_0x485205['filters']=_[_0x3ce3('0x3b')](_0x485205[_0x3ce3('0x38')],_0x485205[_0x3ce3('0x39')]);_0x302ef1['attributes']=_[_0x3ce3('0x3b')](_0x485205[_0x3ce3('0x38')],qs[_0x3ce3('0x3c')](_0x1c6d5f[_0x3ce3('0x39')]['fields']));_0x302ef1[_0x3ce3('0x3d')]=_0x302ef1['attributes']['length']?_0x302ef1[_0x3ce3('0x3d')]:_0x485205[_0x3ce3('0x38')];if(!_0x1c6d5f['query']['hasOwnProperty'](_0x3ce3('0x3e'))){_0x302ef1['limit']=qs[_0x3ce3('0x3f')](_0x1c6d5f[_0x3ce3('0x39')]['limit']);_0x302ef1[_0x3ce3('0x21')]=qs[_0x3ce3('0x21')](_0x1c6d5f[_0x3ce3('0x39')]['offset']);}_0x302ef1['order']=qs[_0x3ce3('0x40')](_0x1c6d5f[_0x3ce3('0x39')][_0x3ce3('0x40')]);_0x302ef1[_0x3ce3('0x41')]=qs[_0x3ce3('0x42')](_[_0x3ce3('0x43')](_0x1c6d5f['query'],_0x485205[_0x3ce3('0x42')]),_0x4e7a0e);if(_0x1c6d5f[_0x3ce3('0x39')][_0x3ce3('0x44')]){_0x302ef1['where']=_[_0x3ce3('0x45')](_0x302ef1['where'],{'$or':_[_0x3ce3('0x33')](_0x4e7a0e,function(_0xc5333b){if(_0xc5333b[_0x3ce3('0x37')]!=='VIRTUAL'){var _0x73b1d4={};_0x73b1d4[_0xc5333b[_0x3ce3('0x31')]]={'$like':'%'+_0x1c6d5f[_0x3ce3('0x39')]['filter']+'%'};return _0x73b1d4;}})});}_0x302ef1=_[_0x3ce3('0x45')]({},_0x302ef1,_0x1c6d5f['options']);var _0x31c9b7={'where':_0x302ef1['where']};return db[_0x3ce3('0x34')][_0x3ce3('0x23')](_0x31c9b7)[_0x3ce3('0x29')](function(_0x4111c9){_0x13bc33['count']=_0x4111c9;if(_0x1c6d5f[_0x3ce3('0x39')]['includeAll']){_0x302ef1[_0x3ce3('0x46')]=[{'all':!![]}];}return db[_0x3ce3('0x34')][_0x3ce3('0x47')](_0x302ef1);})[_0x3ce3('0x29')](function(_0x3bd891){_0x13bc33['rows']=_0x3bd891;return _0x13bc33;})[_0x3ce3('0x29')](respondWithFilteredResult(_0xe96381,_0x302ef1))[_0x3ce3('0x48')](handleError(_0xe96381,null));};exports['show']=function(_0x31d4f9,_0x3e4662){var _0xc98a77={'raw':!![],'where':{'id':_0x31d4f9[_0x3ce3('0x49')]['id']}},_0xa1170d={};_0xa1170d[_0x3ce3('0x38')]=_[_0x3ce3('0x3a')](db[_0x3ce3('0x34')][_0x3ce3('0x35')]);_0xa1170d[_0x3ce3('0x39')]=_[_0x3ce3('0x3a')](_0x31d4f9['query']);_0xa1170d[_0x3ce3('0x42')]=_[_0x3ce3('0x3b')](_0xa1170d[_0x3ce3('0x38')],_0xa1170d[_0x3ce3('0x39')]);_0xc98a77[_0x3ce3('0x3d')]=_[_0x3ce3('0x3b')](_0xa1170d[_0x3ce3('0x38')],qs[_0x3ce3('0x3c')](_0x31d4f9[_0x3ce3('0x39')]['fields']));_0xc98a77[_0x3ce3('0x3d')]=_0xc98a77['attributes']['length']?_0xc98a77[_0x3ce3('0x3d')]:_0xa1170d[_0x3ce3('0x38')];if(_0x31d4f9[_0x3ce3('0x39')][_0x3ce3('0x4a')]){_0xc98a77[_0x3ce3('0x46')]=[{'all':!![]}];}_0xc98a77=_['merge']({},_0xc98a77,_0x31d4f9[_0x3ce3('0x4b')]);return db['Variable'][_0x3ce3('0x4c')](_0xc98a77)[_0x3ce3('0x29')](handleEntityNotFound(_0x3e4662,null))[_0x3ce3('0x29')](respondWithResult(_0x3e4662,null))['catch'](handleError(_0x3e4662,null));};exports['create']=function(_0x4f49f7,_0x11821e){return db[_0x3ce3('0x34')]['create'](_0x4f49f7[_0x3ce3('0x4d')],{})[_0x3ce3('0x29')](function(_0x430dee){var _0xed3f34=_0x4f49f7[_0x3ce3('0x4e')][_0x3ce3('0x2b')]({'plain':!![]});if(!_0xed3f34)throw new Error(_0x3ce3('0x4f'));if(_0xed3f34[_0x3ce3('0x50')]===_0x3ce3('0x4e')){var _0x4dfbb2=_0x430dee[_0x3ce3('0x2b')]({'plain':!![]});var _0x448280='Variables';return db['UserProfileSection']['find']({'where':{'name':_0x448280,'userProfileId':_0xed3f34[_0x3ce3('0x51')]},'raw':!![]})[_0x3ce3('0x29')](function(_0x5b50b7){if(_0x5b50b7&&_0x5b50b7[_0x3ce3('0x52')]===0x0){return db[_0x3ce3('0x2d')][_0x3ce3('0x53')]({'name':_0x4dfbb2['name'],'resourceId':_0x4dfbb2['id'],'type':_0x5b50b7[_0x3ce3('0x31')],'sectionId':_0x5b50b7['id']},{})['then'](function(){return _0x430dee;});}else{return _0x430dee;}})[_0x3ce3('0x48')](function(_0x3dd12c){logger['error'](_0x3ce3('0x54'),_0x3dd12c);throw _0x3dd12c;});}return _0x430dee;})[_0x3ce3('0x29')](respondWithResult(_0x11821e,0xc9))[_0x3ce3('0x48')](handleError(_0x11821e,null));};exports[_0x3ce3('0x28')]=function(_0x2019c6,_0x558fc4){if(_0x2019c6[_0x3ce3('0x4d')]['id']){delete _0x2019c6[_0x3ce3('0x4d')]['id'];}return db[_0x3ce3('0x34')][_0x3ce3('0x4c')]({'where':{'id':_0x2019c6[_0x3ce3('0x49')]['id']}})[_0x3ce3('0x29')](handleEntityNotFound(_0x558fc4,null))['then'](saveUpdates(_0x2019c6[_0x3ce3('0x4d')],null))[_0x3ce3('0x29')](respondWithResult(_0x558fc4,null))[_0x3ce3('0x48')](handleError(_0x558fc4,null));};exports[_0x3ce3('0x2a')]=function(_0x2cfaf9,_0x20211a){return db[_0x3ce3('0x34')][_0x3ce3('0x4c')]({'where':{'id':_0x2cfaf9[_0x3ce3('0x49')]['id']}})[_0x3ce3('0x29')](handleEntityNotFound(_0x20211a,null))[_0x3ce3('0x29')](removeEntity(_0x20211a,null))[_0x3ce3('0x48')](handleError(_0x20211a,null));};
\ No newline at end of file
index ce50b40..76eda8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf679=['bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','api','moment'];(function(_0x481f7d,_0xef5e6){var _0x5f0f0b=function(_0x3a8e46){while(--_0x3a8e46){_0x481f7d['push'](_0x481f7d['shift']());}};_0x5f0f0b(++_0xef5e6);}(_0xf679,0x8c));var _0x9f67=function(_0x19040c,_0x3de731){_0x19040c=_0x19040c-0x0;var _0x12935b=_0xf679[_0x19040c];return _0x12935b;};'use strict';var _=require(_0x9f67('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9f67('0x1'));var moment=require(_0x9f67('0x2'));var BPromise=require(_0x9f67('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f67('0x4'));var rimraf=require(_0x9f67('0x5'));var config=require(_0x9f67('0x6'));var attributes=require(_0x9f67('0x7'));module[_0x9f67('0x8')]=function(_0x14bed3,_0x560264){return _0x14bed3[_0x9f67('0x9')](_0x9f67('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf5e2=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x32e2c9,_0x583b23){var _0x49d731=function(_0xaca7af){while(--_0xaca7af){_0x32e2c9['push'](_0x32e2c9['shift']());}};_0x49d731(++_0x583b23);}(_0xf5e2,0xa7));var _0x2f5e=function(_0xeb26da,_0x21aa3e){_0xeb26da=_0xeb26da-0x0;var _0x1ee149=_0xf5e2[_0xeb26da];return _0x1ee149;};'use strict';var _=require(_0x2f5e('0x0'));var util=require(_0x2f5e('0x1'));var logger=require(_0x2f5e('0x2'))(_0x2f5e('0x3'));var moment=require(_0x2f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x2f5e('0x5'));var fs=require('fs');var path=require(_0x2f5e('0x6'));var rimraf=require(_0x2f5e('0x7'));var config=require(_0x2f5e('0x8'));var attributes=require(_0x2f5e('0x9'));module[_0x2f5e('0xa')]=function(_0x43d15f,_0x3ec2de){return _0x43d15f[_0x2f5e('0xb')](_0x2f5e('0xc'),attributes,{'tableName':_0x2f5e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f06e2a..0f46909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x1570e9,_0x2065c1){var _0x27e91a=function(_0x5e7a65){while(--_0x5e7a65){_0x1570e9['push'](_0x1570e9['shift']());}};_0x27e91a(++_0x2065c1);}(_0x814b,0x1a2));var _0xb814=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x814b[_0x101802];return _0x5d61ce;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});};
\ No newline at end of file
+var _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x326f,0xd1));var _0xf326=function(_0xe4fc8d,_0x5f3626){_0xe4fc8d=_0xe4fc8d-0x0;var _0xfbe4df=_0x326f[_0xe4fc8d];return _0xfbe4df;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});};
\ No newline at end of file
index 05fcec0..6d10848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccfe=['../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router'];(function(_0x2610ed,_0x1dad13){var _0xdfe89c=function(_0x91b226){while(--_0x91b226){_0x2610ed['push'](_0x2610ed['shift']());}};_0xdfe89c(++_0x1dad13);}(_0xccfe,0x141));var _0xeccf=function(_0x2e420d,_0x5e246e){_0x2e420d=_0x2e420d-0x0;var _0x18b41b=_0xccfe[_0x2e420d];return _0x18b41b;};'use strict';var express=require(_0xeccf('0x0'));var router=express[_0xeccf('0x1')]();var auth=require(_0xeccf('0x2'));var controller=require(_0xeccf('0x3'));router[_0xeccf('0x4')]('/',controller[_0xeccf('0x5')]);router['get'](_0xeccf('0x6'),auth[_0xeccf('0x7')](),auth[_0xeccf('0x8')](),controller[_0xeccf('0x9')]);router[_0xeccf('0x4')]('/reset',auth[_0xeccf('0x7')](),auth['canUpdate'](),controller['reset']);router[_0xeccf('0x4')](_0xeccf('0xa'),auth[_0xeccf('0x7')](),auth[_0xeccf('0x8')](),controller[_0xeccf('0xb')]);router[_0xeccf('0x4')](_0xeccf('0xc'),auth['isAuthenticated'](),controller[_0xeccf('0xd')]);router[_0xeccf('0x4')](_0xeccf('0xe'),controller[_0xeccf('0xf')]);module[_0xeccf('0x10')]=router;
\ No newline at end of file
+var _0xcbfe=['/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','fetch','/reset','canUpdate','/pull','pull','/restart'];(function(_0x109bc5,_0x2a3f2a){var _0x40238b=function(_0x32233a){while(--_0x32233a){_0x109bc5['push'](_0x109bc5['shift']());}};_0x40238b(++_0x2a3f2a);}(_0xcbfe,0x16a));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xecbf('0x0'));var router=express[_0xecbf('0x1')]();var auth=require(_0xecbf('0x2'));var controller=require(_0xecbf('0x3'));router[_0xecbf('0x4')]('/',controller[_0xecbf('0x5')]);router[_0xecbf('0x4')]('/fetch',auth[_0xecbf('0x6')](),auth['canUpdate'](),controller[_0xecbf('0x7')]);router[_0xecbf('0x4')](_0xecbf('0x8'),auth['isAuthenticated'](),auth[_0xecbf('0x9')](),controller['reset']);router[_0xecbf('0x4')](_0xecbf('0xa'),auth[_0xecbf('0x6')](),auth['canUpdate'](),controller[_0xecbf('0xb')]);router[_0xecbf('0x4')](_0xecbf('0xc'),auth[_0xecbf('0x6')](),controller['restart']);router[_0xecbf('0x4')](_0xecbf('0xd'),controller[_0xecbf('0xe')]);module['exports']=router;
\ No newline at end of file
index 02867ca..548c462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b0d=['tags','latest','exports','2.0.0','status','json','master','error','git\x20fetch','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','migrations','length','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','query','fetch'];(function(_0x3f157b,_0x260ba0){var _0x2e4e60=function(_0x3ad50e){while(--_0x3ad50e){_0x3f157b['push'](_0x3f157b['shift']());}};_0x2e4e60(++_0x260ba0);}(_0x7b0d,0x8f));var _0xd7b0=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7b0d[_0x4e9628];return _0x27bc8c;};'use strict';var Umzug=require(_0xd7b0('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xd7b0('0x1'));var pkginfo=require(_0xd7b0('0x2'))(module,_0xd7b0('0x3'));var compareVersions=require(_0xd7b0('0x4'));var exec=require(_0xd7b0('0x5'))[_0xd7b0('0x6')];var db=require(_0xd7b0('0x7'))['db'];var config=require(_0xd7b0('0x8'));var pm2=require(_0xd7b0('0x9'));var logger=require(_0xd7b0('0xa'))(_0xd7b0('0xb'));var git=require(_0xd7b0('0xc'))(config[_0xd7b0('0xd')]);exports['index']=function(_0x480193,_0x3f893e){var _0x397017={'current':module['exports']['version'],'phonebar':0x2};if(_0x480193[_0xd7b0('0xe')]&&_0x480193['query']['latest']){return git[_0xd7b0('0xf')]()[_0xd7b0('0x10')](function(_0x2f677d,_0x562981){_0x397017[_0xd7b0('0x11')]=(_0x2f677d?module[_0xd7b0('0x12')][_0xd7b0('0x3')]:_0x562981[_0xd7b0('0x11')])||_0xd7b0('0x13');return _0x3f893e[_0xd7b0('0x14')](0xc8)['json'](_0x397017);});}else{return _0x3f893e[_0xd7b0('0x14')](0xc8)[_0xd7b0('0x15')](_0x397017);}};exports[_0xd7b0('0xf')]=function(_0x2495c7,_0x386d7a){return git[_0xd7b0('0xf')](['origin',_0xd7b0('0x16')],function(_0x2b2d51){if(_0x2b2d51){logger[_0xd7b0('0x17')](_0x2b2d51);return _0x386d7a[_0xd7b0('0x14')](0x1f4)[_0xd7b0('0x15')](_0x2b2d51);}logger['info'](_0xd7b0('0x18'));return _0x386d7a['status'](0xc8)[_0xd7b0('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xd7b0('0x19')]=function(_0x1d58ff,_0x14b84c){return git[_0xd7b0('0x19')](['--hard',_0xd7b0('0x1a')],function(_0x127251){if(_0x127251){logger[_0xd7b0('0x17')](_0x127251);return _0x14b84c[_0xd7b0('0x14')](0x1f4)[_0xd7b0('0x15')](_0x127251);}logger[_0xd7b0('0x1b')](_0xd7b0('0x1c'));return _0x14b84c[_0xd7b0('0x14')](0xc8)[_0xd7b0('0x15')]({'output':_0xd7b0('0x1d')});});};exports[_0xd7b0('0x1e')]=function(_0x5d878c,_0x178bf){exec(_0xd7b0('0x1f'),function(_0x1da402,_0x43e2e4,_0x237139){logger['info'](_0x43e2e4);logger[_0xd7b0('0x1b')](_0x237139);if(_0x1da402){logger[_0xd7b0('0x17')](_0x1da402);return _0x178bf[_0xd7b0('0x14')](0x1f4)[_0xd7b0('0x15')](_0x1da402);}return _0x178bf[_0xd7b0('0x14')](0xc8)[_0xd7b0('0x15')]({'output':_0x43e2e4});});};exports[_0xd7b0('0x20')]=function(_0x2806a9,_0x5812ae){return pm2[_0xd7b0('0x20')](_0xd7b0('0x21'))[_0xd7b0('0x22')](function(_0x252ae9){logger[_0xd7b0('0x1b')](_0xd7b0('0x23'),_0x252ae9);return _0x5812ae['status'](0xc8)[_0xd7b0('0x15')]({'output':_0xd7b0('0x24')});})['catch'](function(_0x9bacc){logger[_0xd7b0('0x17')](_0x9bacc);return _0x5812ae['status'](0x1f4)[_0xd7b0('0x15')](_0x9bacc);});};exports['migrations']=function(_0x4e9cc2,_0x34eabe){var _0x44fcfa=fs[_0xd7b0('0x25')](path[_0xd7b0('0x26')](config[_0xd7b0('0xd')],'server',_0xd7b0('0x27')));var _0x5a1844=[];for(var _0x366a05=0x0;_0x366a05<_0x44fcfa[_0xd7b0('0x28')];_0x366a05++){var _0x44ade2=_0x44fcfa[_0x366a05]['replace'](_0xd7b0('0x29'),'');if(compareVersions(module[_0xd7b0('0x12')][_0xd7b0('0x3')],_0x44ade2)===-0x1){_0x5a1844['push'](_0x44ade2);}}if(_0x5a1844[_0xd7b0('0x28')]){var _0x1aeaca=_0x5a1844[_0xd7b0('0x2a')](compareVersions);var _0x53ea47=new Umzug({'storage':_0xd7b0('0x2b'),'storageOptions':{'model':db[_0xd7b0('0x2c')],'modelName':'Migration','columnName':_0xd7b0('0x3')},'migrations':{'params':[db[_0xd7b0('0x2b')][_0xd7b0('0x2d')](),db[_0xd7b0('0x2b')][_0xd7b0('0x2e')],function(){throw new Error(_0xd7b0('0x2f'));}],'path':path[_0xd7b0('0x26')](config[_0xd7b0('0xd')],_0xd7b0('0x30'),_0xd7b0('0x27')),'pattern':/\.js$/}});_0x53ea47['up']({'migrations':_['map'](_0x1aeaca,function(_0x2d3308){return _0x2d3308+_0xd7b0('0x29');})})[_0xd7b0('0x22')](function(){return _0x34eabe[_0xd7b0('0x14')](0xc8)[_0xd7b0('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xd7b0('0x12')]['version']+_0xd7b0('0x31')+_[_0xd7b0('0x32')](_0x1aeaca),'migrations':_[_0xd7b0('0x26')](_0x1aeaca)});})[_0xd7b0('0x33')](function(_0x3113f4){if(_0x3113f4 instanceof db['sequelize']['UniqueConstraintError']){return _0x34eabe[_0xd7b0('0x14')](0xc8)['json']({'output':_0xd7b0('0x34')});}else{return _0x34eabe[_0xd7b0('0x14')](0x1f4)['json'](_0x3113f4);}});}else{return _0x34eabe['status'](0xc8)[_0xd7b0('0x15')]({'output':_0xd7b0('0x34')});}};
\ No newline at end of file
+var _0x56f4=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','root','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','../../config/logger','update','simple-git','exports','query','latest','tags','2.0.0','status','json','fetch','origin','error','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration'];(function(_0xbdfd91,_0x222e83){var _0x4e49e2=function(_0x3b2d79){while(--_0x3b2d79){_0xbdfd91['push'](_0xbdfd91['shift']());}};_0x4e49e2(++_0x222e83);}(_0x56f4,0x66));var _0x456f=function(_0x50eff3,_0x1577bc){_0x50eff3=_0x50eff3-0x0;var _0x26cb62=_0x56f4[_0x50eff3];return _0x26cb62;};'use strict';var Umzug=require(_0x456f('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x456f('0x1'));var pkginfo=require(_0x456f('0x2'))(module,_0x456f('0x3'));var compareVersions=require(_0x456f('0x4'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x456f('0x5'))(_0x456f('0x6'));var git=require(_0x456f('0x7'))(config['root']);exports['index']=function(_0x61c72a,_0x1b032a){var _0xd69cca={'current':module[_0x456f('0x8')][_0x456f('0x3')],'phonebar':0x2};if(_0x61c72a[_0x456f('0x9')]&&_0x61c72a['query'][_0x456f('0xa')]){return git['fetch']()[_0x456f('0xb')](function(_0x515075,_0xde31f4){_0xd69cca[_0x456f('0xa')]=(_0x515075?module[_0x456f('0x8')]['version']:_0xde31f4['latest'])||_0x456f('0xc');return _0x1b032a[_0x456f('0xd')](0xc8)[_0x456f('0xe')](_0xd69cca);});}else{return _0x1b032a['status'](0xc8)['json'](_0xd69cca);}};exports['fetch']=function(_0x291447,_0x8b3895){return git[_0x456f('0xf')]([_0x456f('0x10'),'master'],function(_0x333c89){if(_0x333c89){logger[_0x456f('0x11')](_0x333c89);return _0x8b3895[_0x456f('0xd')](0x1f4)['json'](_0x333c89);}logger[_0x456f('0x12')]('git\x20fetch');return _0x8b3895[_0x456f('0xd')](0xc8)[_0x456f('0xe')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x456f('0x13')]=function(_0x30cf40,_0x4a0b5c){return git['reset']([_0x456f('0x14'),_0x456f('0x15')],function(_0x1fffca){if(_0x1fffca){logger[_0x456f('0x11')](_0x1fffca);return _0x4a0b5c[_0x456f('0xd')](0x1f4)[_0x456f('0xe')](_0x1fffca);}logger[_0x456f('0x12')](_0x456f('0x16'));return _0x4a0b5c[_0x456f('0xd')](0xc8)[_0x456f('0xe')]({'output':'git\x20reset\x20--hard'});});};exports[_0x456f('0x17')]=function(_0x5750de,_0x561027){exec(_0x456f('0x18'),function(_0x4e315a,_0x362a6a,_0x179920){logger['info'](_0x362a6a);logger[_0x456f('0x12')](_0x179920);if(_0x4e315a){logger[_0x456f('0x11')](_0x4e315a);return _0x561027[_0x456f('0xd')](0x1f4)[_0x456f('0xe')](_0x4e315a);}return _0x561027[_0x456f('0xd')](0xc8)['json']({'output':_0x362a6a});});};exports['restart']=function(_0x1b634e,_0x156431){return pm2['restart'](_0x456f('0x19'))[_0x456f('0x1a')](function(_0xc98a87){logger[_0x456f('0x12')](_0x456f('0x1b'),_0xc98a87);return _0x156431[_0x456f('0xd')](0xc8)[_0x456f('0xe')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x456f('0x1c')](function(_0x67d4f){logger[_0x456f('0x11')](_0x67d4f);return _0x156431[_0x456f('0xd')](0x1f4)[_0x456f('0xe')](_0x67d4f);});};exports[_0x456f('0x1d')]=function(_0x9876a,_0x4a11f8){var _0x2f8658=fs[_0x456f('0x1e')](path[_0x456f('0x1f')](config['root'],_0x456f('0x20'),_0x456f('0x1d')));var _0x43a26c=[];for(var _0x53a08e=0x0;_0x53a08e<_0x2f8658[_0x456f('0x21')];_0x53a08e++){var _0x294ce6=_0x2f8658[_0x53a08e][_0x456f('0x22')](_0x456f('0x23'),'');if(compareVersions(module[_0x456f('0x8')]['version'],_0x294ce6)===-0x1){_0x43a26c[_0x456f('0x24')](_0x294ce6);}}if(_0x43a26c[_0x456f('0x21')]){var _0x1b03b4=_0x43a26c['sort'](compareVersions);var _0x47c19b=new Umzug({'storage':_0x456f('0x25'),'storageOptions':{'model':db[_0x456f('0x26')],'modelName':_0x456f('0x26'),'columnName':_0x456f('0x3')},'migrations':{'params':[db[_0x456f('0x25')]['getQueryInterface'](),db[_0x456f('0x25')][_0x456f('0x27')],function(){throw new Error(_0x456f('0x28'));}],'path':path[_0x456f('0x1f')](config[_0x456f('0x29')],'server',_0x456f('0x1d')),'pattern':/\.js$/}});_0x47c19b['up']({'migrations':_['map'](_0x1b03b4,function(_0x3737fd){return _0x3737fd+'.js';})})[_0x456f('0x1a')](function(){return _0x4a11f8[_0x456f('0xd')](0xc8)['json']({'output':_0x456f('0x2a')+module[_0x456f('0x8')][_0x456f('0x3')]+_0x456f('0x2b')+_[_0x456f('0x2c')](_0x1b03b4),'migrations':_[_0x456f('0x1f')](_0x1b03b4)});})[_0x456f('0x1c')](function(_0x3abc26){if(_0x3abc26 instanceof db['sequelize'][_0x456f('0x2d')]){return _0x4a11f8[_0x456f('0xd')](0xc8)[_0x456f('0xe')]({'output':_0x456f('0x2e')});}else{return _0x4a11f8[_0x456f('0xd')](0x1f4)['json'](_0x3abc26);}});}else{return _0x4a11f8[_0x456f('0xd')](0xc8)[_0x456f('0xe')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
index 4d42ac2..8d8891f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2942=['/describe','isAuthenticated','/:id','create','put','destroy','exports','multer','util','express','fs-extra','../../config/environment','index','get'];(function(_0x13097c,_0x4c814b){var _0x42dcd4=function(_0x4ea002){while(--_0x4ea002){_0x13097c['push'](_0x13097c['shift']());}};_0x42dcd4(++_0x4c814b);}(_0x2942,0x103));var _0x2294=function(_0x4d0df3,_0x3ea920){_0x4d0df3=_0x4d0df3-0x0;var _0x3e1561=_0x2942[_0x4d0df3];return _0x3e1561;};'use strict';var multer=require(_0x2294('0x0'));var util=require(_0x2294('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2294('0x2'));var router=express['Router']();var fs_extra=require(_0x2294('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2294('0x4'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2294('0x5')]);router[_0x2294('0x6')](_0x2294('0x7'),auth[_0x2294('0x8')](),controller['describe']);router[_0x2294('0x6')](_0x2294('0x9'),auth[_0x2294('0x8')](),controller['show']);router['post']('/',auth[_0x2294('0x8')](),controller[_0x2294('0xa')]);router[_0x2294('0xb')](_0x2294('0x9'),auth[_0x2294('0x8')](),controller['update']);router['delete'](_0x2294('0x9'),auth[_0x2294('0x8')](),controller[_0x2294('0xc')]);module[_0x2294('0xd')]=router;
\ No newline at end of file
+var _0x5bdf=['update','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put'];(function(_0x497694,_0x45a883){var _0x522d39=function(_0xbbc71a){while(--_0xbbc71a){_0x497694['push'](_0x497694['shift']());}};_0x522d39(++_0x45a883);}(_0x5bdf,0xfe));var _0xf5bd=function(_0x13783b,_0x4fb02e){_0x13783b=_0x13783b-0x0;var _0x31c412=_0x5bdf[_0x13783b];return _0x31c412;};'use strict';var multer=require(_0xf5bd('0x0'));var util=require(_0xf5bd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf5bd('0x2'));var router=express[_0xf5bd('0x3')]();var fs_extra=require(_0xf5bd('0x4'));var auth=require(_0xf5bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf5bd('0x6'));var controller=require(_0xf5bd('0x7'));router[_0xf5bd('0x8')]('/',auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xa')]);router[_0xf5bd('0x8')]('/describe',auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xb')]);router[_0xf5bd('0x8')](_0xf5bd('0xc'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xd')]);router[_0xf5bd('0xe')]('/',auth[_0xf5bd('0x9')](),controller['create']);router[_0xf5bd('0xf')](_0xf5bd('0xc'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0x10')]);router['delete'](_0xf5bd('0xc'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0x11')]);module['exports']=router;
\ No newline at end of file
index 7a10701..ab523e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x2478b8,_0x40961b){var _0x102501=function(_0x26166c){while(--_0x26166c){_0x2478b8['push'](_0x2478b8['shift']());}};_0x102501(++_0x40961b);}(_0x6132,0xf3));var _0x2613=function(_0x8dd61f,_0x29a266){_0x8dd61f=_0x8dd61f-0x0;var _0x293bab=_0x6132[_0x8dd61f];return _0x293bab;};'use strict';var Sequelize=require('sequelize');module[_0x2613('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2613('0x1')]},'calleridnum':{'type':Sequelize[_0x2613('0x1')]},'calleridname':{'type':Sequelize[_0x2613('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2613('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x2613('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x2613('0x2')]},'agentdumpAt':{'type':Sequelize[_0x2613('0x2')]},'holdtime':{'type':Sequelize[_0x2613('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2613('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2613('0x1')]},'channel':{'type':Sequelize[_0x2613('0x1')]},'channelstate':{'type':Sequelize[_0x2613('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'connectedlinename':{'type':Sequelize[_0x2613('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2613('0x1')]},'context':{'type':Sequelize[_0x2613('0x1')]},'exten':{'type':Sequelize[_0x2613('0x1')]},'priority':{'type':Sequelize[_0x2613('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2613('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2613('0x1')]},'destcalleridname':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x2613('0x1')]},'destlanguage':{'type':Sequelize[_0x2613('0x1')]},'destaccountcode':{'type':Sequelize[_0x2613('0x1')]},'destcontext':{'type':Sequelize[_0x2613('0x1')]},'destexten':{'type':Sequelize[_0x2613('0x1')]},'destpriority':{'type':Sequelize[_0x2613('0x1')]},'destuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2613('0x1')]},'transfer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2613('0x1')],'comment':_0x2613('0x5')},'transferexten':{'type':Sequelize[_0x2613('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2613('0x1')]},'agententerreason':{'type':Sequelize[_0x2613('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdf5d=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x550412,_0x51a4fc){var _0xdce24a=function(_0x333f5b){while(--_0x333f5b){_0x550412['push'](_0x550412['shift']());}};_0xdce24a(++_0x51a4fc);}(_0xdf5d,0x126));var _0xddf5=function(_0x201be6,_0xbdca42){_0x201be6=_0x201be6-0x0;var _0x4d6f61=_0xdf5d[_0x201be6];return _0x4d6f61;};'use strict';var Sequelize=require(_0xddf5('0x0'));module[_0xddf5('0x1')]={'type':{'type':Sequelize[_0xddf5('0x2')]},'uniqueid':{'type':Sequelize[_0xddf5('0x2')]},'calleridnum':{'type':Sequelize[_0xddf5('0x2')]},'calleridname':{'type':Sequelize[_0xddf5('0x2')]},'queue':{'type':Sequelize[_0xddf5('0x2')]},'interface':{'type':Sequelize[_0xddf5('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xddf5('0x3')]},'agentconnectAt':{'type':Sequelize[_0xddf5('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xddf5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xddf5('0x3')]},'agentdumpAt':{'type':Sequelize[_0xddf5('0x3')]},'holdtime':{'type':Sequelize[_0xddf5('0x4')]},'agentcomplete':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xddf5('0x4')]},'agentacw':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xddf5('0x4')]},'reason':{'type':Sequelize[_0xddf5('0x2')]},'lastevent':{'type':Sequelize[_0xddf5('0x2')]},'channel':{'type':Sequelize[_0xddf5('0x2')]},'channelstate':{'type':Sequelize[_0xddf5('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xddf5('0x2')]},'connectedlinename':{'type':Sequelize[_0xddf5('0x2')]},'language':{'type':Sequelize[_0xddf5('0x2')]},'accountcode':{'type':Sequelize[_0xddf5('0x2')]},'context':{'type':Sequelize[_0xddf5('0x2')]},'exten':{'type':Sequelize[_0xddf5('0x2')]},'priority':{'type':Sequelize[_0xddf5('0x2')]},'destchannel':{'type':Sequelize[_0xddf5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xddf5('0x2')]},'destcalleridname':{'type':Sequelize[_0xddf5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xddf5('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xddf5('0x2')]},'destlanguage':{'type':Sequelize[_0xddf5('0x2')]},'destaccountcode':{'type':Sequelize[_0xddf5('0x2')]},'destcontext':{'type':Sequelize[_0xddf5('0x2')]},'destexten':{'type':Sequelize[_0xddf5('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xddf5('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xddf5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xddf5('0x2')]},'transfer':{'type':Sequelize[_0xddf5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xddf5('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xddf5('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xddf5('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index e0c4665..491a03b 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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_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'];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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 62d849a..00f2f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88d5=['destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','define','uniqueid'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x88d5,0x76));var _0x588d=function(_0xdaa17d,_0xde8c37){_0xdaa17d=_0xdaa17d-0x0;var _0x25e332=_0x88d5[_0xdaa17d];return _0x25e332;};'use strict';var _=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var logger=require(_0x588d('0x2'))(_0x588d('0x3'));var moment=require(_0x588d('0x4'));var BPromise=require('bluebird');var rp=require(_0x588d('0x5'));var fs=require('fs');var path=require(_0x588d('0x6'));var rimraf=require('rimraf');var config=require(_0x588d('0x7'));var attributes=require(_0x588d('0x8'));module[_0x588d('0x9')]=function(_0x1b193f,_0xecfb11){return _0x1b193f[_0x588d('0xa')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x588d('0xb'),_0x588d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb194=['report_agent','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceAgentReport'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xb194,0x1b2));var _0x4b19=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0xb194[_0x451959];return _0x490269;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var logger=require(_0x4b19('0x1'))(_0x4b19('0x2'));var moment=require(_0x4b19('0x3'));var BPromise=require(_0x4b19('0x4'));var rp=require(_0x4b19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x4b19('0x8')]=function(_0x570374,_0x22033b){return _0x570374['define'](_0x4b19('0x9'),attributes,{'tableName':_0x4b19('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4b19('0xb'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 3e5893a..618cf47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f1=['attributes','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','then','debug','UpdateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x26f1,0x1d1));var _0x126f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x26f1[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x126f('0x0'));var util=require(_0x126f('0x1'));var moment=require('moment');var BPromise=require(_0x126f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x126f('0x3'))['db'];var utils=require(_0x126f('0x4'));var logger=require('../../config/logger')(_0x126f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x126f('0x6')][_0x126f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x141dd0,_0x1f6c3b,_0x5e438d){return new BPromise(function(_0x1e658d,_0x5e4b84){return client[_0x126f('0x8')](_0x141dd0,_0x5e438d)['then'](function(_0x24973a){logger[_0x126f('0x9')](_0x126f('0xa'),_0x1f6c3b,_0x126f('0xb'));logger['debug'](_0x126f('0xc'),_0x1f6c3b,'request\x20sent',JSON[_0x126f('0xd')](_0x24973a));if(_0x24973a[_0x126f('0xe')]){if(_0x24973a[_0x126f('0xe')][_0x126f('0xf')]===0x1f4){logger[_0x126f('0xe')](_0x126f('0xa'),_0x1f6c3b,_0x24973a[_0x126f('0xe')][_0x126f('0x10')]);return _0x5e4b84(_0x24973a[_0x126f('0xe')][_0x126f('0x10')]);}logger['error'](_0x126f('0xa'),_0x1f6c3b,_0x24973a[_0x126f('0xe')][_0x126f('0x10')]);return _0x1e658d(_0x24973a[_0x126f('0xe')][_0x126f('0x10')]);}else{logger[_0x126f('0x9')](_0x126f('0xa'),_0x1f6c3b,'request\x20sent');_0x1e658d(_0x24973a[_0x126f('0x11')]['message']);}})[_0x126f('0x12')](function(_0xea1870){logger[_0x126f('0xe')](_0x126f('0xa'),_0x1f6c3b,_0xea1870);_0x5e4b84(_0xea1870);});});}exports[_0x126f('0x13')]=function(_0x412c33){var _0x181882=this;return new Promise(function(_0x5603fc,_0xad78cb){return db['VoiceAgentReport'][_0x126f('0x14')](_0x412c33['body'],{'raw':_0x412c33['options']?_0x412c33['options']['raw']===undefined?!![]:![]:!![]})[_0x126f('0x15')](function(_0x4715f0){logger[_0x126f('0x9')]('CreateVoiceAgentReport',_0x412c33);logger[_0x126f('0x16')](_0x126f('0x13'),_0x412c33,JSON[_0x126f('0xd')](_0x4715f0));_0x5603fc(_0x4715f0);})[_0x126f('0x12')](function(_0x233ccd){logger[_0x126f('0xe')](_0x126f('0x13'),_0x233ccd[_0x126f('0x10')],_0x412c33);_0xad78cb(_0x181882['error'](0x1f4,_0x233ccd[_0x126f('0x10')]));});});};exports[_0x126f('0x17')]=function(_0xbd4c9f){var _0x23b949=this;return new Promise(function(_0x3dcd17,_0x31f172){return db[_0x126f('0x18')]['update'](_0xbd4c9f[_0x126f('0x19')],{'raw':_0xbd4c9f[_0x126f('0x1a')]?_0xbd4c9f[_0x126f('0x1a')][_0x126f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd4c9f['options']?_0xbd4c9f[_0x126f('0x1a')]['where']||null:null,'attributes':_0xbd4c9f[_0x126f('0x1a')]?_0xbd4c9f[_0x126f('0x1a')][_0x126f('0x1c')]||null:null,'limit':_0xbd4c9f[_0x126f('0x1a')]?_0xbd4c9f[_0x126f('0x1a')]['limit']||null:null})[_0x126f('0x15')](function(_0x738bb5){logger[_0x126f('0x9')]('UpdateVoiceAgentReport',_0xbd4c9f);logger[_0x126f('0x16')](_0x126f('0x17'),_0xbd4c9f,JSON['stringify'](_0x738bb5));_0x3dcd17(_0x738bb5);})[_0x126f('0x12')](function(_0x52ac58){logger[_0x126f('0xe')]('UpdateVoiceAgentReport',_0x52ac58['message'],_0xbd4c9f);_0x31f172(_0x23b949[_0x126f('0xe')](0x1f4,_0x52ac58['message']));});});};
\ No newline at end of file
+var _0xa4ea=['limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceAgentReport','create','body','options','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes'];(function(_0x7f677f,_0x5f2c1c){var _0x5acea1=function(_0x21e95e){while(--_0x21e95e){_0x7f677f['push'](_0x7f677f['shift']());}};_0x5acea1(++_0x5f2c1c);}(_0xa4ea,0x161));var _0xaa4e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa4ea[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xaa4e('0x0'));var util=require('util');var moment=require(_0xaa4e('0x1'));var BPromise=require(_0xaa4e('0x2'));var rs=require(_0xaa4e('0x3'));var fs=require('fs');var Redis=require(_0xaa4e('0x4'));var db=require(_0xaa4e('0x5'))['db'];var utils=require(_0xaa4e('0x6'));var logger=require(_0xaa4e('0x7'))(_0xaa4e('0x8'));var config=require('../../config/environment');var jayson=require(_0xaa4e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3828,_0x179f69,_0x1813cc){return new BPromise(function(_0xaa546,_0x3ab6a5){return client[_0xaa4e('0xa')](_0x4e3828,_0x1813cc)[_0xaa4e('0xb')](function(_0x18bd38){logger[_0xaa4e('0xc')](_0xaa4e('0xd'),_0x179f69,_0xaa4e('0xe'));logger[_0xaa4e('0xf')](_0xaa4e('0x10'),_0x179f69,_0xaa4e('0xe'),JSON[_0xaa4e('0x11')](_0x18bd38));if(_0x18bd38[_0xaa4e('0x12')]){if(_0x18bd38[_0xaa4e('0x12')][_0xaa4e('0x13')]===0x1f4){logger['error'](_0xaa4e('0xd'),_0x179f69,_0x18bd38[_0xaa4e('0x12')][_0xaa4e('0x14')]);return _0x3ab6a5(_0x18bd38[_0xaa4e('0x12')][_0xaa4e('0x14')]);}logger['error'](_0xaa4e('0xd'),_0x179f69,_0x18bd38[_0xaa4e('0x12')][_0xaa4e('0x14')]);return _0xaa546(_0x18bd38[_0xaa4e('0x12')]['message']);}else{logger[_0xaa4e('0xc')](_0xaa4e('0xd'),_0x179f69,_0xaa4e('0xe'));_0xaa546(_0x18bd38['result'][_0xaa4e('0x14')]);}})['catch'](function(_0x1bf50e){logger[_0xaa4e('0x12')](_0xaa4e('0xd'),_0x179f69,_0x1bf50e);_0x3ab6a5(_0x1bf50e);});});}exports[_0xaa4e('0x15')]=function(_0x35dd39){var _0x259aa9=this;return new Promise(function(_0x38abd7,_0x4cacbf){return db['VoiceAgentReport'][_0xaa4e('0x16')](_0x35dd39[_0xaa4e('0x17')],{'raw':_0x35dd39[_0xaa4e('0x18')]?_0x35dd39[_0xaa4e('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x281991){logger[_0xaa4e('0xc')](_0xaa4e('0x15'),_0x35dd39);logger['debug']('CreateVoiceAgentReport',_0x35dd39,JSON['stringify'](_0x281991));_0x38abd7(_0x281991);})[_0xaa4e('0x19')](function(_0x35fca5){logger[_0xaa4e('0x12')]('CreateVoiceAgentReport',_0x35fca5['message'],_0x35dd39);_0x4cacbf(_0x259aa9[_0xaa4e('0x12')](0x1f4,_0x35fca5['message']));});});};exports[_0xaa4e('0x1a')]=function(_0x36ba1b){var _0x495835=this;return new Promise(function(_0x3d018b,_0x4f52ed){return db[_0xaa4e('0x1b')][_0xaa4e('0x1c')](_0x36ba1b[_0xaa4e('0x17')],{'raw':_0x36ba1b['options']?_0x36ba1b[_0xaa4e('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36ba1b[_0xaa4e('0x18')]?_0x36ba1b['options'][_0xaa4e('0x1d')]||null:null,'attributes':_0x36ba1b[_0xaa4e('0x18')]?_0x36ba1b[_0xaa4e('0x18')][_0xaa4e('0x1e')]||null:null,'limit':_0x36ba1b['options']?_0x36ba1b[_0xaa4e('0x18')][_0xaa4e('0x1f')]||null:null})[_0xaa4e('0xb')](function(_0x351b63){logger[_0xaa4e('0xc')](_0xaa4e('0x1a'),_0x36ba1b);logger[_0xaa4e('0xf')]('UpdateVoiceAgentReport',_0x36ba1b,JSON[_0xaa4e('0x11')](_0x351b63));_0x3d018b(_0x351b63);})[_0xaa4e('0x19')](function(_0x4ebb5a){logger[_0xaa4e('0x12')](_0xaa4e('0x1a'),_0x4ebb5a['message'],_0x36ba1b);_0x4f52ed(_0x495835[_0xaa4e('0x12')](0x1f4,_0x4ebb5a['message']));});});};
\ No newline at end of file
index 083bbf4..607f4a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69d=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xf69d,0xd3));var _0xdf69=function(_0x4d1d00,_0x5ea380){_0x4d1d00=_0x4d1d00-0x0;var _0x59fc45=_0xf69d[_0x4d1d00];return _0x59fc45;};'use strict';var multer=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var path=require(_0xdf69('0x2'));var timeout=require(_0xdf69('0x3'));var express=require(_0xdf69('0x4'));var router=express['Router']();var fs_extra=require(_0xdf69('0x5'));var auth=require(_0xdf69('0x6'));var interaction=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var controller=require(_0xdf69('0x9'));router[_0xdf69('0xa')]('/',auth[_0xdf69('0xb')](),controller[_0xdf69('0xc')]);router[_0xdf69('0xa')](_0xdf69('0xd'),auth[_0xdf69('0xb')](),controller[_0xdf69('0xe')]);router[_0xdf69('0xa')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x10')]);router[_0xdf69('0x11')]('/',auth['isAuthenticated'](),controller[_0xdf69('0x12')]);router[_0xdf69('0x13')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x14')]);router[_0xdf69('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x512ee0,_0x302e4e){var _0x288be7=function(_0xedcef){while(--_0xedcef){_0x512ee0['push'](_0x512ee0['shift']());}};_0x288be7(++_0x302e4e);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router;
\ No newline at end of file
index 8abe69f..0ac11f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f2=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','STRING','ENUM','outbound'];(function(_0x219411,_0x8e667f){var _0x5dd956=function(_0x1b2d62){while(--_0x1b2d62){_0x219411['push'](_0x219411['shift']());}};_0x5dd956(++_0x8e667f);}(_0xf1f2,0x192));var _0x2f1f=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xf1f2[_0x230e39];return _0xa804e;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x2f1f('0x0')]},'type':{'type':Sequelize[_0x2f1f('0x1')]('inbound','internal',_0x2f1f('0x2'),_0x2f1f('0x3'),_0x2f1f('0x4'),_0x2f1f('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x2f1f('0x0')]},'destination':{'type':Sequelize[_0x2f1f('0x0')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2f1f('0x0')]},'channel':{'type':Sequelize[_0x2f1f('0x0')]},'destinationchannel':{'type':Sequelize[_0x2f1f('0x0')]},'lastapplication':{'type':Sequelize[_0x2f1f('0x0')]},'lastdata':{'type':Sequelize[_0x2f1f('0x6')]},'starttime':{'type':Sequelize[_0x2f1f('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x2f1f('0x7')]},'endtime':{'type':Sequelize[_0x2f1f('0x7')]},'duration':{'type':Sequelize[_0x2f1f('0x8')]},'billableseconds':{'type':Sequelize[_0x2f1f('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2f1f('0x0')]},'amaflags':{'type':Sequelize[_0x2f1f('0x0')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x2f1f('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x2f1f('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x2f1f('0x0')]},'note':{'type':Sequelize[_0x2f1f('0x0')]},'prefix':{'type':Sequelize[_0x2f1f('0x0')]},'routeid':{'type':Sequelize[_0x2f1f('0x8')]},'sipcallid':{'type':Sequelize[_0x2f1f('0x0')]}};
\ No newline at end of file
+var _0x3014=['INTEGER','sequelize','exports','ENUM','inbound','inbound-fax','outbound-fax','dialer','STRING','DATE'];(function(_0x326d0c,_0x1ffbf8){var _0x4e2a27=function(_0x3fcabd){while(--_0x3fcabd){_0x326d0c['push'](_0x326d0c['shift']());}};_0x4e2a27(++_0x1ffbf8);}(_0x3014,0x1d7));var _0x4301=function(_0x328b5f,_0x27c700){_0x328b5f=_0x328b5f-0x0;var _0x49c08c=_0x3014[_0x328b5f];return _0x49c08c;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4301('0x2')](_0x4301('0x3'),'internal','outbound',_0x4301('0x4'),_0x4301('0x5'),_0x4301('0x6'))},'tag':{'type':Sequelize[_0x4301('0x7')]},'accountcode':{'type':Sequelize[_0x4301('0x7')]},'source':{'type':Sequelize[_0x4301('0x7')]},'destination':{'type':Sequelize[_0x4301('0x7')]},'destinationcontext':{'type':Sequelize[_0x4301('0x7')]},'callerid':{'type':Sequelize[_0x4301('0x7')]},'channel':{'type':Sequelize[_0x4301('0x7')]},'destinationchannel':{'type':Sequelize[_0x4301('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x4301('0x8')]},'systemanswertime':{'type':Sequelize[_0x4301('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4301('0x8')]},'duration':{'type':Sequelize[_0x4301('0x9')]},'billableseconds':{'type':Sequelize[_0x4301('0x9')]},'mohtime':{'type':Sequelize[_0x4301('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x4301('0x7')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x4301('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x4301('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x4301('0x7')]},'note':{'type':Sequelize[_0x4301('0x7')]},'prefix':{'type':Sequelize[_0x4301('0x7')]},'routeid':{'type':Sequelize[_0x4301('0x9')]},'sipcallid':{'type':Sequelize[_0x4301('0x7')]}};
\ No newline at end of file
index e53b49d..3254633 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(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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 _0x2032=['../../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','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x3d07bc,_0xab3179){_0x3d07bc=_0x3d07bc-0x0;var _0x45c404=_0x2032[_0x3d07bc];return _0x45c404;};'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']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
index ae0014c..71dd61b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2dd=['uniqueid','util','api','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call'];(function(_0x226880,_0x16de94){var _0x36de66=function(_0x9189b5){while(--_0x9189b5){_0x226880['push'](_0x226880['shift']());}};_0x36de66(++_0x16de94);}(_0xb2dd,0xb5));var _0xdb2d=function(_0x31ca4c,_0x38802c){_0x31ca4c=_0x31ca4c-0x0;var _0x423753=_0xb2dd[_0x31ca4c];return _0x423753;};'use strict';var _=require('lodash');var util=require(_0xdb2d('0x0'));var logger=require('../../config/logger')(_0xdb2d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb2d('0x2'));var fs=require('fs');var path=require(_0xdb2d('0x3'));var rimraf=require('rimraf');var config=require(_0xdb2d('0x4'));var attributes=require(_0xdb2d('0x5'));module[_0xdb2d('0x6')]=function(_0x24926b,_0xa289e6){return _0x24926b['define'](_0xdb2d('0x7'),attributes,{'tableName':_0xdb2d('0x8'),'paranoid':![],'indexes':[{'fields':[_0xdb2d('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9aec=['path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x9aec,0xe8));var _0xc9ae=function(_0x363c6e,_0x3b1a82){_0x363c6e=_0x363c6e-0x0;var _0x3c698f=_0x9aec[_0x363c6e];return _0x3c698f;};'use strict';var _=require(_0xc9ae('0x0'));var util=require(_0xc9ae('0x1'));var logger=require(_0xc9ae('0x2'))(_0xc9ae('0x3'));var moment=require('moment');var BPromise=require(_0xc9ae('0x4'));var rp=require(_0xc9ae('0x5'));var fs=require('fs');var path=require(_0xc9ae('0x6'));var rimraf=require('rimraf');var config=require(_0xc9ae('0x7'));var attributes=require(_0xc9ae('0x8'));module[_0xc9ae('0x9')]=function(_0x150844,_0x470639){return _0x150844[_0xc9ae('0xa')](_0xc9ae('0xb'),attributes,{'tableName':_0xc9ae('0xc'),'paranoid':![],'indexes':[{'fields':[_0xc9ae('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 71801b8..8b6afff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c05=['http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','attributes','model','map','CreateVoiceCallReport','create','body','catch','update','UpdateVoiceCallReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x57f7c7,_0x40e88f){var _0x580b58=function(_0x2ad59e){while(--_0x2ad59e){_0x57f7c7['push'](_0x57f7c7['shift']());}};_0x580b58(++_0x40e88f);}(_0x2c05,0x17a));var _0x52c0=function(_0x1899c3,_0x370cb4){_0x1899c3=_0x1899c3-0x0;var _0x20ea62=_0x2c05[_0x1899c3];return _0x20ea62;};'use strict';var _=require(_0x52c0('0x0'));var util=require(_0x52c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52c0('0x2'));var db=require(_0x52c0('0x3'))['db'];var utils=require(_0x52c0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x52c0('0x5'));var jayson=require(_0x52c0('0x6'));var client=jayson['client'][_0x52c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdcad48,_0x26151c,_0x5b8e7f){return new BPromise(function(_0xa446a3,_0x49fd3d){return client[_0x52c0('0x8')](_0xdcad48,_0x5b8e7f)[_0x52c0('0x9')](function(_0x110578){logger[_0x52c0('0xa')](_0x52c0('0xb'),_0x26151c,_0x52c0('0xc'));logger[_0x52c0('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x26151c,_0x52c0('0xc'),JSON[_0x52c0('0xe')](_0x110578));if(_0x110578[_0x52c0('0xf')]){if(_0x110578[_0x52c0('0xf')][_0x52c0('0x10')]===0x1f4){logger[_0x52c0('0xf')](_0x52c0('0xb'),_0x26151c,_0x110578[_0x52c0('0xf')][_0x52c0('0x11')]);return _0x49fd3d(_0x110578[_0x52c0('0xf')]['message']);}logger[_0x52c0('0xf')](_0x52c0('0xb'),_0x26151c,_0x110578[_0x52c0('0xf')][_0x52c0('0x11')]);return _0xa446a3(_0x110578[_0x52c0('0xf')][_0x52c0('0x11')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x26151c,_0x52c0('0xc'));_0xa446a3(_0x110578[_0x52c0('0x12')]['message']);}})['catch'](function(_0x8aed21){logger[_0x52c0('0xf')](_0x52c0('0xb'),_0x26151c,_0x8aed21);_0x49fd3d(_0x8aed21);});});}exports[_0x52c0('0x13')]=function(_0x451dbf){var _0x272129=this;return new Promise(function(_0x541c2c,_0x54b4db){return db[_0x52c0('0x14')]['findAll']({'raw':_0x451dbf[_0x52c0('0x15')]?_0x451dbf['options'][_0x52c0('0x16')]===undefined?!![]:![]:!![],'where':_0x451dbf[_0x52c0('0x15')]?_0x451dbf[_0x52c0('0x15')][_0x52c0('0x17')]||null:null,'attributes':_0x451dbf[_0x52c0('0x15')]?_0x451dbf['options']['attributes']||null:null,'limit':_0x451dbf[_0x52c0('0x15')]?_0x451dbf[_0x52c0('0x15')][_0x52c0('0x18')]||null:null,'include':_0x451dbf[_0x52c0('0x15')]?_0x451dbf['options'][_0x52c0('0x19')]?_['map'](_0x451dbf[_0x52c0('0x15')]['include'],function(_0xb73bd5){return{'model':db[_0xb73bd5['model']],'as':_0xb73bd5['as'],'attributes':_0xb73bd5[_0x52c0('0x1a')],'include':_0xb73bd5[_0x52c0('0x19')]?_['map'](_0xb73bd5[_0x52c0('0x19')],function(_0x152a6e){return{'model':db[_0x152a6e[_0x52c0('0x1b')]],'as':_0x152a6e['as'],'attributes':_0x152a6e['attributes'],'include':_0x152a6e['include']?_[_0x52c0('0x1c')](_0x152a6e[_0x52c0('0x19')],function(_0x4b1616){return{'model':db[_0x4b1616[_0x52c0('0x1b')]],'as':_0x4b1616['as'],'attributes':_0x4b1616[_0x52c0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x52c0('0x9')](function(_0x31f780){logger[_0x52c0('0xa')](_0x52c0('0x13'),_0x451dbf);logger[_0x52c0('0xd')](_0x52c0('0x13'),_0x451dbf,JSON[_0x52c0('0xe')](_0x31f780));_0x541c2c(_0x31f780);})['catch'](function(_0x305c6a){logger['error']('GetVoiceCallReport',_0x305c6a[_0x52c0('0x11')],_0x451dbf);_0x54b4db(_0x272129[_0x52c0('0xf')](0x1f4,_0x305c6a[_0x52c0('0x11')]));});});};exports[_0x52c0('0x1d')]=function(_0x3c5485){var _0x44bdab=this;return new Promise(function(_0x313765,_0x5ecd40){return db['VoiceCallReport'][_0x52c0('0x1e')](_0x3c5485[_0x52c0('0x1f')],{'raw':_0x3c5485[_0x52c0('0x15')]?_0x3c5485[_0x52c0('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x52c0('0x9')](function(_0x39fd03){logger['info'](_0x52c0('0x1d'),_0x3c5485);logger[_0x52c0('0xd')](_0x52c0('0x1d'),_0x3c5485,JSON[_0x52c0('0xe')](_0x39fd03));_0x313765(_0x39fd03);})[_0x52c0('0x20')](function(_0x3aa3d1){logger[_0x52c0('0xf')](_0x52c0('0x1d'),_0x3aa3d1[_0x52c0('0x11')],_0x3c5485);_0x5ecd40(_0x44bdab[_0x52c0('0xf')](0x1f4,_0x3aa3d1[_0x52c0('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x28d353){var _0x8985e1=this;return new Promise(function(_0xc7e4b0,_0x2286a2){return db[_0x52c0('0x14')][_0x52c0('0x21')](_0x28d353['body'],{'raw':_0x28d353['options']?_0x28d353['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d353[_0x52c0('0x15')]?_0x28d353['options'][_0x52c0('0x17')]||null:null,'attributes':_0x28d353[_0x52c0('0x15')]?_0x28d353[_0x52c0('0x15')][_0x52c0('0x1a')]||null:null,'limit':_0x28d353[_0x52c0('0x15')]?_0x28d353[_0x52c0('0x15')][_0x52c0('0x18')]||null:null})[_0x52c0('0x9')](function(_0x5951a2){logger[_0x52c0('0xa')](_0x52c0('0x22'),_0x28d353);logger['debug'](_0x52c0('0x22'),_0x28d353,JSON['stringify'](_0x5951a2));_0xc7e4b0(_0x5951a2);})[_0x52c0('0x20')](function(_0xb993ec){logger['error'](_0x52c0('0x22'),_0xb993ec[_0x52c0('0x11')],_0x28d353);_0x2286a2(_0x8985e1['error'](0x1f4,_0xb993ec['message']));});});};
\ No newline at end of file
+var _0xabee=['../../config/logger','../../config/environment','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','include','map','model','then','GetVoiceCallReport','CreateVoiceCallReport','body','debug','UpdateVoiceCallReport','where','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xabee,0x11b));var _0xeabe=function(_0x52d8ff,_0x49f4dc){_0x52d8ff=_0x52d8ff-0x0;var _0xe8f9ea=_0xabee[_0x52d8ff];return _0xe8f9ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xeabe('0x0'));var rs=require(_0xeabe('0x1'));var fs=require('fs');var Redis=require(_0xeabe('0x2'));var db=require(_0xeabe('0x3'))['db'];var utils=require(_0xeabe('0x4'));var logger=require(_0xeabe('0x5'))('rpc');var config=require(_0xeabe('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x145e1c,_0x12fba5,_0x4c745a){return new BPromise(function(_0xa3876a,_0x48bc91){return client[_0xeabe('0x7')](_0x145e1c,_0x4c745a)['then'](function(_0x162e07){logger[_0xeabe('0x8')](_0xeabe('0x9'),_0x12fba5,_0xeabe('0xa'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x12fba5,'request\x20sent',JSON[_0xeabe('0xb')](_0x162e07));if(_0x162e07['error']){if(_0x162e07[_0xeabe('0xc')]['code']===0x1f4){logger['error'](_0xeabe('0x9'),_0x12fba5,_0x162e07[_0xeabe('0xc')][_0xeabe('0xd')]);return _0x48bc91(_0x162e07['error'][_0xeabe('0xd')]);}logger['error'](_0xeabe('0x9'),_0x12fba5,_0x162e07['error'][_0xeabe('0xd')]);return _0xa3876a(_0x162e07[_0xeabe('0xc')][_0xeabe('0xd')]);}else{logger[_0xeabe('0x8')]('VoiceCallReport,\x20%s,\x20%s',_0x12fba5,_0xeabe('0xa'));_0xa3876a(_0x162e07[_0xeabe('0xe')]['message']);}})[_0xeabe('0xf')](function(_0x49804a){logger[_0xeabe('0xc')](_0xeabe('0x9'),_0x12fba5,_0x49804a);_0x48bc91(_0x49804a);});});}exports['GetVoiceCallReport']=function(_0x33d675){var _0xaa1053=this;return new Promise(function(_0x3ea1a5,_0x370bb7){return db[_0xeabe('0x10')][_0xeabe('0x11')]({'raw':_0x33d675[_0xeabe('0x12')]?_0x33d675[_0xeabe('0x12')][_0xeabe('0x13')]===undefined?!![]:![]:!![],'where':_0x33d675[_0xeabe('0x12')]?_0x33d675['options']['where']||null:null,'attributes':_0x33d675[_0xeabe('0x12')]?_0x33d675[_0xeabe('0x12')][_0xeabe('0x14')]||null:null,'limit':_0x33d675[_0xeabe('0x12')]?_0x33d675[_0xeabe('0x12')]['limit']||null:null,'include':_0x33d675[_0xeabe('0x12')]?_0x33d675['options'][_0xeabe('0x15')]?_[_0xeabe('0x16')](_0x33d675[_0xeabe('0x12')][_0xeabe('0x15')],function(_0x399de0){return{'model':db[_0x399de0[_0xeabe('0x17')]],'as':_0x399de0['as'],'attributes':_0x399de0[_0xeabe('0x14')],'include':_0x399de0[_0xeabe('0x15')]?_[_0xeabe('0x16')](_0x399de0[_0xeabe('0x15')],function(_0x6c117d){return{'model':db[_0x6c117d['model']],'as':_0x6c117d['as'],'attributes':_0x6c117d[_0xeabe('0x14')],'include':_0x6c117d[_0xeabe('0x15')]?_[_0xeabe('0x16')](_0x6c117d[_0xeabe('0x15')],function(_0x293ede){return{'model':db[_0x293ede['model']],'as':_0x293ede['as'],'attributes':_0x293ede[_0xeabe('0x14')]};}):[]};}):[]};}):[]:[]})[_0xeabe('0x18')](function(_0x167c5f){logger['info'](_0xeabe('0x19'),_0x33d675);logger['debug'](_0xeabe('0x19'),_0x33d675,JSON[_0xeabe('0xb')](_0x167c5f));_0x3ea1a5(_0x167c5f);})[_0xeabe('0xf')](function(_0x33cec0){logger[_0xeabe('0xc')](_0xeabe('0x19'),_0x33cec0[_0xeabe('0xd')],_0x33d675);_0x370bb7(_0xaa1053['error'](0x1f4,_0x33cec0[_0xeabe('0xd')]));});});};exports[_0xeabe('0x1a')]=function(_0x45866c){var _0xb8310d=this;return new Promise(function(_0xb83b8d,_0x3c0a47){return db['VoiceCallReport']['create'](_0x45866c[_0xeabe('0x1b')],{'raw':_0x45866c['options']?_0x45866c[_0xeabe('0x12')][_0xeabe('0x13')]===undefined?!![]:![]:!![]})[_0xeabe('0x18')](function(_0x26cc11){logger[_0xeabe('0x8')](_0xeabe('0x1a'),_0x45866c);logger[_0xeabe('0x1c')]('CreateVoiceCallReport',_0x45866c,JSON['stringify'](_0x26cc11));_0xb83b8d(_0x26cc11);})[_0xeabe('0xf')](function(_0x2cc22f){logger[_0xeabe('0xc')]('CreateVoiceCallReport',_0x2cc22f[_0xeabe('0xd')],_0x45866c);_0x3c0a47(_0xb8310d['error'](0x1f4,_0x2cc22f[_0xeabe('0xd')]));});});};exports[_0xeabe('0x1d')]=function(_0x4ee44f){var _0x1c1391=this;return new Promise(function(_0x32f6c0,_0x3bd049){return db[_0xeabe('0x10')]['update'](_0x4ee44f[_0xeabe('0x1b')],{'raw':_0x4ee44f[_0xeabe('0x12')]?_0x4ee44f[_0xeabe('0x12')][_0xeabe('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ee44f[_0xeabe('0x12')]?_0x4ee44f['options'][_0xeabe('0x1e')]||null:null,'attributes':_0x4ee44f['options']?_0x4ee44f[_0xeabe('0x12')]['attributes']||null:null,'limit':_0x4ee44f[_0xeabe('0x12')]?_0x4ee44f[_0xeabe('0x12')][_0xeabe('0x1f')]||null:null})['then'](function(_0x373d74){logger[_0xeabe('0x8')](_0xeabe('0x1d'),_0x4ee44f);logger[_0xeabe('0x1c')](_0xeabe('0x1d'),_0x4ee44f,JSON[_0xeabe('0xb')](_0x373d74));_0x32f6c0(_0x373d74);})[_0xeabe('0xf')](function(_0x2a2a1a){logger['error']('UpdateVoiceCallReport',_0x2a2a1a['message'],_0x4ee44f);_0x3bd049(_0x1c1391['error'](0x1f4,_0x2a2a1a['message']));});});};
\ No newline at end of file
index 5d05afd..5736b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb70=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbb70,0x19e));var _0x0bb7=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xbb70[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0x0bb7('0x0'));var util=require(_0x0bb7('0x1'));var path=require(_0x0bb7('0x2'));var timeout=require(_0x0bb7('0x3'));var express=require('express');var router=express[_0x0bb7('0x4')]();var fs_extra=require(_0x0bb7('0x5'));var auth=require(_0x0bb7('0x6'));var interaction=require(_0x0bb7('0x7'));var config=require(_0x0bb7('0x8'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x0bb7('0x9')](),controller[_0x0bb7('0xa')]);router[_0x0bb7('0xb')](_0x0bb7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0bb7('0xd')]('/',auth['isAuthenticated'](),controller[_0x0bb7('0xe')]);router[_0x0bb7('0xf')](_0x0bb7('0xc'),auth[_0x0bb7('0x9')](),controller['update']);router[_0x0bb7('0x10')]('/:id',auth[_0x0bb7('0x9')](),controller[_0x0bb7('0x11')]);module[_0x0bb7('0x12')]=router;
\ No newline at end of file
+var _0x5b30=['/:id','isAuthenticated','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','index'];(function(_0x564dc8,_0x21f4b1){var _0x296232=function(_0x11794f){while(--_0x11794f){_0x564dc8['push'](_0x564dc8['shift']());}};_0x296232(++_0x21f4b1);}(_0x5b30,0x193));var _0x05b3=function(_0x2d85f9,_0x1add32){_0x2d85f9=_0x2d85f9-0x0;var _0x2e0f3f=_0x5b30[_0x2d85f9];return _0x2e0f3f;};'use strict';var multer=require(_0x05b3('0x0'));var util=require(_0x05b3('0x1'));var path=require(_0x05b3('0x2'));var timeout=require(_0x05b3('0x3'));var express=require(_0x05b3('0x4'));var router=express[_0x05b3('0x5')]();var fs_extra=require(_0x05b3('0x6'));var auth=require(_0x05b3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x05b3('0x8'));router[_0x05b3('0x9')]('/',auth['isAuthenticated'](),controller[_0x05b3('0xa')]);router[_0x05b3('0x9')](_0x05b3('0xb'),auth[_0x05b3('0xc')](),controller['show']);router['post']('/',auth[_0x05b3('0xc')](),controller[_0x05b3('0xd')]);router[_0x05b3('0xe')](_0x05b3('0xb'),auth['isAuthenticated'](),controller[_0x05b3('0xf')]);router['delete'](_0x05b3('0xb'),auth[_0x05b3('0xc')](),controller[_0x05b3('0x10')]);module[_0x05b3('0x11')]=router;
\ No newline at end of file
index b46541e..920b98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d0=['STRING','name','setDataValue','getDataValue','options','split','BOOLEAN','exports'];(function(_0x25aaec,_0x159e5b){var _0x293c2f=function(_0x3cd42a){while(--_0x3cd42a){_0x25aaec['push'](_0x25aaec['shift']());}};_0x293c2f(++_0x159e5b);}(_0x21d0,0x6f));var _0x021d=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x21d0[_0x2b63c9];return _0x5928c6;};'use strict';var Sequelize=require('sequelize');module[_0x021d('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x021d('0x1')],'unique':_0x021d('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x82b8b7){this[_0x021d('0x3')]('options',_0x82b8b7?_0x82b8b7['join'](''):[]);},'get':function(){return this[_0x021d('0x4')](_0x021d('0x5'))?this[_0x021d('0x4')](_0x021d('0x5'))[_0x021d('0x6')](''):[];}},'auth':{'type':Sequelize[_0x021d('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x021d('0x1')]},'record':{'type':Sequelize[_0x021d('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x021d('0x1')]}};
\ No newline at end of file
+var _0x6f9c=['exports','STRING','name','setDataValue','options','getDataValue','split','BOOLEAN','sequelize'];(function(_0x4ed7,_0x14f3ba){var _0x584b32=function(_0x3203f4){while(--_0x3203f4){_0x4ed7['push'](_0x4ed7['shift']());}};_0x584b32(++_0x14f3ba);}(_0x6f9c,0xb3));var _0xc6f9=function(_0x47bff2,_0x57e366){_0x47bff2=_0x47bff2-0x0;var _0x30c5a0=_0x6f9c[_0x47bff2];return _0x30c5a0;};'use strict';var Sequelize=require(_0xc6f9('0x0'));module[_0xc6f9('0x1')]={'name':{'type':Sequelize[_0xc6f9('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xc6f9('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc6f9('0x2')],'set':function(_0x2f0302){this[_0xc6f9('0x4')](_0xc6f9('0x5'),_0x2f0302?_0x2f0302['join'](''):[]);},'get':function(){return this[_0xc6f9('0x6')](_0xc6f9('0x5'))?this['getDataValue'](_0xc6f9('0x5'))[_0xc6f9('0x7')](''):[];}},'auth':{'type':Sequelize[_0xc6f9('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xc6f9('0x2')]},'record':{'type':Sequelize[_0xc6f9('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc6f9('0x2')]}};
\ No newline at end of file
index 56a9a51..a634a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f73=['util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','ChanSpies','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VoiceChanSpy','includeAll','include','rows','catch','show','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x50aca8,_0x2cfd21){var _0x28e8f6=function(_0x1157ce){while(--_0x1157ce){_0x50aca8['push'](_0x50aca8['shift']());}};_0x28e8f6(++_0x2cfd21);}(_0x0f73,0x146));var _0x30f7=function(_0x1a918b,_0x5a0da0){_0x1a918b=_0x1a918b-0x0;var _0x3c4264=_0x0f73[_0x1a918b];return _0x3c4264;};'use strict';var emlformat=require(_0x30f7('0x0'));var rimraf=require(_0x30f7('0x1'));var zipdir=require(_0x30f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var Mustache=require(_0x30f7('0x5'));var util=require(_0x30f7('0x6'));var path=require(_0x30f7('0x7'));var sox=require('sox');var csv=require(_0x30f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30f7('0x9'));var squel=require(_0x30f7('0xa'));var crypto=require(_0x30f7('0xb'));var jsforce=require(_0x30f7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x30f7('0x8'));var querystring=require(_0x30f7('0xd'));var Papa=require('papaparse');var Redis=require(_0x30f7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30f7('0xf'));var hardwareService=require(_0x30f7('0x10'));var logger=require(_0x30f7('0x11'))(_0x30f7('0x12'));var utils=require('../../config/utils');var config=require(_0x30f7('0x13'));var licenseUtil=require(_0x30f7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121af8,_0x7b4cd1){_0x7b4cd1=_0x7b4cd1||0xcc;return function(_0xb9752c){if(_0xb9752c){return _0x121af8['sendStatus'](_0x7b4cd1);}return _0x121af8[_0x30f7('0x15')](_0x7b4cd1)[_0x30f7('0x16')]();};}function respondWithResult(_0x5155bd,_0x1ad086){_0x1ad086=_0x1ad086||0xc8;return function(_0xfc31c5){if(_0xfc31c5){return _0x5155bd[_0x30f7('0x15')](_0x1ad086)[_0x30f7('0x17')](_0xfc31c5);}};}function respondWithFilteredResult(_0x2b5a47,_0x579e7a){return function(_0x49fccb){if(_0x49fccb){var _0x401f9e=typeof _0x579e7a[_0x30f7('0x18')]===_0x30f7('0x19')&&typeof _0x579e7a[_0x30f7('0x1a')]==='undefined';var _0x2681d7=_0x49fccb[_0x30f7('0x1b')];var _0x1efb71=_0x401f9e?0x0:_0x579e7a[_0x30f7('0x18')];var _0x1e7777=_0x401f9e?_0x49fccb[_0x30f7('0x1b')]:_0x579e7a[_0x30f7('0x18')]+_0x579e7a[_0x30f7('0x1a')];var _0x1d6f46;if(_0x1e7777>=_0x2681d7){_0x1e7777=_0x2681d7;_0x1d6f46=0xc8;}else{_0x1d6f46=0xce;}_0x2b5a47['status'](_0x1d6f46);return _0x2b5a47[_0x30f7('0x1c')](_0x30f7('0x1d'),_0x1efb71+'-'+_0x1e7777+'/'+_0x2681d7)[_0x30f7('0x17')](_0x49fccb);}return null;};}function patchUpdates(_0x12cdf1){return function(_0x37d7d5){try{jsonpatch[_0x30f7('0x1e')](_0x37d7d5,_0x12cdf1,!![]);}catch(_0x5745d7){return BPromise[_0x30f7('0x1f')](_0x5745d7);}return _0x37d7d5[_0x30f7('0x20')]();};}function saveUpdates(_0x571f7e,_0x570d52){return function(_0x12d3f2){if(_0x12d3f2){return _0x12d3f2['update'](_0x571f7e)['then'](function(_0x4c6009){return _0x4c6009;});}return null;};}function removeEntity(_0x1bfc45,_0x261116){return function(_0x4c686d){if(_0x4c686d){return _0x4c686d['destroy']()[_0x30f7('0x21')](function(){var _0x86b4f8=_0x4c686d['get']({'plain':!![]});var _0x393d2f=_0x30f7('0x22');return db[_0x30f7('0x23')]['destroy']({'where':{'type':_0x393d2f,'resourceId':_0x86b4f8['id']}})[_0x30f7('0x21')](function(){return _0x4c686d;});})[_0x30f7('0x21')](function(){_0x1bfc45['status'](0xcc)[_0x30f7('0x16')]();});}};}function handleEntityNotFound(_0x3a8207,_0x5de116){return function(_0x23d3ae){if(!_0x23d3ae){_0x3a8207[_0x30f7('0x24')](0x194);}return _0x23d3ae;};}function handleError(_0x4b5d75,_0x3cd23f){_0x3cd23f=_0x3cd23f||0x1f4;return function(_0x591773){logger[_0x30f7('0x25')](_0x591773[_0x30f7('0x26')]);if(_0x591773[_0x30f7('0x27')]){delete _0x591773[_0x30f7('0x27')];}_0x4b5d75[_0x30f7('0x15')](_0x3cd23f)[_0x30f7('0x28')](_0x591773);};}exports[_0x30f7('0x29')]=function(_0x29bec2,_0x28daf5){var _0x3e26f3={},_0x4f16ab={},_0x7a869a={'count':0x0,'rows':[]};var _0x4fb3bb=_[_0x30f7('0x2a')](db['VoiceChanSpy'][_0x30f7('0x2b')],function(_0x3e6db7){return{'name':_0x3e6db7[_0x30f7('0x2c')],'type':_0x3e6db7[_0x30f7('0x2d')]['key']};});_0x4f16ab['model']=_[_0x30f7('0x2a')](_0x4fb3bb,_0x30f7('0x27'));_0x4f16ab[_0x30f7('0x2e')]=_[_0x30f7('0x2f')](_0x29bec2['query']);_0x4f16ab[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x4f16ab[_0x30f7('0x32')],_0x4f16ab[_0x30f7('0x2e')]);_0x3e26f3[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x4f16ab[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x29bec2[_0x30f7('0x2e')]['fields']));_0x3e26f3[_0x30f7('0x33')]=_0x3e26f3[_0x30f7('0x33')][_0x30f7('0x35')]?_0x3e26f3[_0x30f7('0x33')]:_0x4f16ab['model'];if(!_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x36')](_0x30f7('0x37'))){_0x3e26f3['limit']=qs[_0x30f7('0x1a')](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x1a')]);_0x3e26f3[_0x30f7('0x18')]=qs[_0x30f7('0x18')](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x18')]);}_0x3e26f3[_0x30f7('0x38')]=qs['sort'](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x3e26f3['where']=qs[_0x30f7('0x30')](_[_0x30f7('0x3a')](_0x29bec2[_0x30f7('0x2e')],_0x4f16ab[_0x30f7('0x30')]),_0x4fb3bb);if(_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x3b')]){_0x3e26f3[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x3e26f3[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x4fb3bb,function(_0x1edc3b){if(_0x1edc3b[_0x30f7('0x2d')]!==_0x30f7('0x3e')){var _0xb025bc={};_0xb025bc[_0x1edc3b[_0x30f7('0x27')]]={'$like':'%'+_0x29bec2['query'][_0x30f7('0x3b')]+'%'};return _0xb025bc;}})});}_0x3e26f3=_['merge']({},_0x3e26f3,_0x29bec2['options']);var _0x57795c={'where':_0x3e26f3[_0x30f7('0x3c')]};return db[_0x30f7('0x3f')][_0x30f7('0x1b')](_0x57795c)[_0x30f7('0x21')](function(_0x46b098){_0x7a869a[_0x30f7('0x1b')]=_0x46b098;if(_0x29bec2['query'][_0x30f7('0x40')]){_0x3e26f3[_0x30f7('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3e26f3);})['then'](function(_0x5194c7){_0x7a869a[_0x30f7('0x42')]=_0x5194c7;return _0x7a869a;})['then'](respondWithFilteredResult(_0x28daf5,_0x3e26f3))[_0x30f7('0x43')](handleError(_0x28daf5,null));};exports[_0x30f7('0x44')]=function(_0xb3bcc5,_0x554a13){var _0x1afce1={'raw':![],'where':{'id':_0xb3bcc5[_0x30f7('0x45')]['id']}},_0x388484={};_0x388484[_0x30f7('0x32')]=_[_0x30f7('0x2f')](db[_0x30f7('0x3f')]['rawAttributes']);_0x388484['query']=_[_0x30f7('0x2f')](_0xb3bcc5[_0x30f7('0x2e')]);_0x388484[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x388484['model'],_0x388484[_0x30f7('0x2e')]);_0x1afce1[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x388484['model'],qs['fields'](_0xb3bcc5[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x1afce1['attributes']=_0x1afce1[_0x30f7('0x33')]['length']?_0x1afce1[_0x30f7('0x33')]:_0x388484[_0x30f7('0x32')];if(_0xb3bcc5[_0x30f7('0x2e')][_0x30f7('0x40')]){_0x1afce1[_0x30f7('0x41')]=[{'all':!![]}];}_0x1afce1=_[_0x30f7('0x3d')]({},_0x1afce1,_0xb3bcc5[_0x30f7('0x46')]);return db[_0x30f7('0x3f')][_0x30f7('0x47')](_0x1afce1)[_0x30f7('0x21')](handleEntityNotFound(_0x554a13,null))[_0x30f7('0x21')](respondWithResult(_0x554a13,null))[_0x30f7('0x43')](handleError(_0x554a13,null));};exports[_0x30f7('0x48')]=function(_0x3a18b9,_0x1c18af){return db[_0x30f7('0x3f')][_0x30f7('0x48')](_0x3a18b9[_0x30f7('0x49')],{})[_0x30f7('0x21')](function(_0x1c914f){var _0x1b99df=_0x3a18b9['user'][_0x30f7('0x4a')]({'plain':!![]});if(!_0x1b99df)throw new Error(_0x30f7('0x4b'));if(_0x1b99df[_0x30f7('0x4c')]===_0x30f7('0x4d')){var _0x1bc348=_0x1c914f[_0x30f7('0x4a')]({'plain':!![]});var _0x26377e=_0x30f7('0x22');return db[_0x30f7('0x4e')][_0x30f7('0x47')]({'where':{'name':_0x26377e,'userProfileId':_0x1b99df[_0x30f7('0x4f')]},'raw':!![]})[_0x30f7('0x21')](function(_0x5e5207){if(_0x5e5207&&_0x5e5207[_0x30f7('0x50')]===0x0){return db['UserProfileResource'][_0x30f7('0x48')]({'name':_0x1bc348[_0x30f7('0x27')],'resourceId':_0x1bc348['id'],'type':_0x5e5207[_0x30f7('0x27')],'sectionId':_0x5e5207['id']},{})['then'](function(){return _0x1c914f;});}else{return _0x1c914f;}})[_0x30f7('0x43')](function(_0x9fc9f){logger[_0x30f7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9fc9f);throw _0x9fc9f;});}return _0x1c914f;})['then'](respondWithResult(_0x1c18af,0xc9))[_0x30f7('0x43')](handleError(_0x1c18af,null));};exports[_0x30f7('0x51')]=function(_0x5d023f,_0x5c00f2){if(_0x5d023f[_0x30f7('0x49')]['id']){delete _0x5d023f[_0x30f7('0x49')]['id'];}return db['VoiceChanSpy'][_0x30f7('0x47')]({'where':{'id':_0x5d023f[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x5c00f2,null))[_0x30f7('0x21')](saveUpdates(_0x5d023f[_0x30f7('0x49')],null))[_0x30f7('0x21')](respondWithResult(_0x5c00f2,null))[_0x30f7('0x43')](handleError(_0x5c00f2,null));};exports[_0x30f7('0x52')]=function(_0x3cfcb4,_0x14ac1c){return db['VoiceChanSpy'][_0x30f7('0x47')]({'where':{'id':_0x3cfcb4['params']['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x14ac1c,null))[_0x30f7('0x21')](removeEntity(_0x14ac1c,null))[_0x30f7('0x43')](handleError(_0x14ac1c,null));};
\ No newline at end of file
+var _0xd5b6=['order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','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','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xd5b6,0x73));var _0x6d5b=function(_0x14b924,_0x52b39e){_0x14b924=_0x14b924-0x0;var _0x37bba1=_0xd5b6[_0x14b924];return _0x37bba1;};'use strict';var emlformat=require(_0x6d5b('0x0'));var rimraf=require(_0x6d5b('0x1'));var zipdir=require(_0x6d5b('0x2'));var jsonpatch=require(_0x6d5b('0x3'));var rp=require(_0x6d5b('0x4'));var moment=require(_0x6d5b('0x5'));var BPromise=require(_0x6d5b('0x6'));var Mustache=require(_0x6d5b('0x7'));var util=require('util');var path=require(_0x6d5b('0x8'));var sox=require(_0x6d5b('0x9'));var csv=require(_0x6d5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d5b('0xb'));var _=require(_0x6d5b('0xc'));var squel=require(_0x6d5b('0xd'));var crypto=require(_0x6d5b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d5b('0xa'));var querystring=require(_0x6d5b('0xf'));var Papa=require(_0x6d5b('0x10'));var Redis=require(_0x6d5b('0x11'));var authService=require(_0x6d5b('0x12'));var qs=require(_0x6d5b('0x13'));var as=require(_0x6d5b('0x14'));var hardwareService=require(_0x6d5b('0x15'));var logger=require(_0x6d5b('0x16'))(_0x6d5b('0x17'));var utils=require(_0x6d5b('0x18'));var config=require(_0x6d5b('0x19'));var licenseUtil=require(_0x6d5b('0x1a'));var db=require(_0x6d5b('0x1b'))['db'];function respondWithStatusCode(_0x267798,_0x1e3c2b){_0x1e3c2b=_0x1e3c2b||0xcc;return function(_0x3c09bb){if(_0x3c09bb){return _0x267798[_0x6d5b('0x1c')](_0x1e3c2b);}return _0x267798['status'](_0x1e3c2b)[_0x6d5b('0x1d')]();};}function respondWithResult(_0x33d3a9,_0xe6fa49){_0xe6fa49=_0xe6fa49||0xc8;return function(_0x3a4ca5){if(_0x3a4ca5){return _0x33d3a9[_0x6d5b('0x1e')](_0xe6fa49)['json'](_0x3a4ca5);}};}function respondWithFilteredResult(_0x3c8078,_0x1e6814){return function(_0x51eb25){if(_0x51eb25){var _0x2baf47=typeof _0x1e6814['offset']===_0x6d5b('0x1f')&&typeof _0x1e6814['limit']==='undefined';var _0x49def6=_0x51eb25[_0x6d5b('0x20')];var _0x1ee9a3=_0x2baf47?0x0:_0x1e6814[_0x6d5b('0x21')];var _0x5e1642=_0x2baf47?_0x51eb25[_0x6d5b('0x20')]:_0x1e6814[_0x6d5b('0x21')]+_0x1e6814[_0x6d5b('0x22')];var _0x51a8d9;if(_0x5e1642>=_0x49def6){_0x5e1642=_0x49def6;_0x51a8d9=0xc8;}else{_0x51a8d9=0xce;}_0x3c8078[_0x6d5b('0x1e')](_0x51a8d9);return _0x3c8078['set'](_0x6d5b('0x23'),_0x1ee9a3+'-'+_0x5e1642+'/'+_0x49def6)[_0x6d5b('0x24')](_0x51eb25);}return null;};}function patchUpdates(_0x26b175){return function(_0x4b67ca){try{jsonpatch[_0x6d5b('0x25')](_0x4b67ca,_0x26b175,!![]);}catch(_0x195fd6){return BPromise[_0x6d5b('0x26')](_0x195fd6);}return _0x4b67ca[_0x6d5b('0x27')]();};}function saveUpdates(_0x672e5b,_0x36d8da){return function(_0x19148d){if(_0x19148d){return _0x19148d[_0x6d5b('0x28')](_0x672e5b)[_0x6d5b('0x29')](function(_0xae55d9){return _0xae55d9;});}return null;};}function removeEntity(_0x1b5261,_0xc1087e){return function(_0x2e3192){if(_0x2e3192){return _0x2e3192[_0x6d5b('0x2a')]()['then'](function(){var _0x38efa7=_0x2e3192['get']({'plain':!![]});var _0x3402bb=_0x6d5b('0x2b');return db[_0x6d5b('0x2c')][_0x6d5b('0x2a')]({'where':{'type':_0x3402bb,'resourceId':_0x38efa7['id']}})[_0x6d5b('0x29')](function(){return _0x2e3192;});})[_0x6d5b('0x29')](function(){_0x1b5261[_0x6d5b('0x1e')](0xcc)[_0x6d5b('0x1d')]();});}};}function handleEntityNotFound(_0x1fac80,_0x2076f1){return function(_0x158584){if(!_0x158584){_0x1fac80[_0x6d5b('0x1c')](0x194);}return _0x158584;};}function handleError(_0x202ec2,_0x5dd460){_0x5dd460=_0x5dd460||0x1f4;return function(_0x597e06){logger['error'](_0x597e06[_0x6d5b('0x2d')]);if(_0x597e06[_0x6d5b('0x2e')]){delete _0x597e06[_0x6d5b('0x2e')];}_0x202ec2['status'](_0x5dd460)[_0x6d5b('0x2f')](_0x597e06);};}exports[_0x6d5b('0x30')]=function(_0x5f3616,_0x47ebfe){var _0x4fce9f={},_0x38befc={},_0x454f7f={'count':0x0,'rows':[]};var _0x2f8503=_[_0x6d5b('0x31')](db['VoiceChanSpy']['rawAttributes'],function(_0x34bc21){return{'name':_0x34bc21['fieldName'],'type':_0x34bc21[_0x6d5b('0x32')][_0x6d5b('0x33')]};});_0x38befc[_0x6d5b('0x34')]=_[_0x6d5b('0x31')](_0x2f8503,_0x6d5b('0x2e'));_0x38befc[_0x6d5b('0x35')]=_[_0x6d5b('0x36')](_0x5f3616[_0x6d5b('0x35')]);_0x38befc['filters']=_[_0x6d5b('0x37')](_0x38befc[_0x6d5b('0x34')],_0x38befc[_0x6d5b('0x35')]);_0x4fce9f[_0x6d5b('0x38')]=_[_0x6d5b('0x37')](_0x38befc[_0x6d5b('0x34')],qs[_0x6d5b('0x39')](_0x5f3616[_0x6d5b('0x35')]['fields']));_0x4fce9f[_0x6d5b('0x38')]=_0x4fce9f[_0x6d5b('0x38')][_0x6d5b('0x3a')]?_0x4fce9f[_0x6d5b('0x38')]:_0x38befc[_0x6d5b('0x34')];if(!_0x5f3616[_0x6d5b('0x35')]['hasOwnProperty']('nolimit')){_0x4fce9f[_0x6d5b('0x22')]=qs[_0x6d5b('0x22')](_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x22')]);_0x4fce9f[_0x6d5b('0x21')]=qs[_0x6d5b('0x21')](_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x21')]);}_0x4fce9f[_0x6d5b('0x3b')]=qs[_0x6d5b('0x3c')](_0x5f3616[_0x6d5b('0x35')]['sort']);_0x4fce9f['where']=qs[_0x6d5b('0x3d')](_[_0x6d5b('0x3e')](_0x5f3616[_0x6d5b('0x35')],_0x38befc[_0x6d5b('0x3d')]),_0x2f8503);if(_0x5f3616['query'][_0x6d5b('0x3f')]){_0x4fce9f[_0x6d5b('0x40')]=_[_0x6d5b('0x41')](_0x4fce9f[_0x6d5b('0x40')],{'$or':_[_0x6d5b('0x31')](_0x2f8503,function(_0x371609){if(_0x371609[_0x6d5b('0x32')]!==_0x6d5b('0x42')){var _0x40ac5c={};_0x40ac5c[_0x371609[_0x6d5b('0x2e')]]={'$like':'%'+_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x3f')]+'%'};return _0x40ac5c;}})});}_0x4fce9f=_[_0x6d5b('0x41')]({},_0x4fce9f,_0x5f3616['options']);var _0x5ae3e4={'where':_0x4fce9f[_0x6d5b('0x40')]};return db[_0x6d5b('0x43')][_0x6d5b('0x20')](_0x5ae3e4)[_0x6d5b('0x29')](function(_0x43ecaf){_0x454f7f[_0x6d5b('0x20')]=_0x43ecaf;if(_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x44')]){_0x4fce9f[_0x6d5b('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x6d5b('0x46')](_0x4fce9f);})['then'](function(_0x10fc3c){_0x454f7f['rows']=_0x10fc3c;return _0x454f7f;})[_0x6d5b('0x29')](respondWithFilteredResult(_0x47ebfe,_0x4fce9f))[_0x6d5b('0x47')](handleError(_0x47ebfe,null));};exports[_0x6d5b('0x48')]=function(_0x5b1d2c,_0x5756ca){var _0x33894c={'raw':![],'where':{'id':_0x5b1d2c[_0x6d5b('0x49')]['id']}},_0x5e8ab2={};_0x5e8ab2[_0x6d5b('0x34')]=_[_0x6d5b('0x36')](db['VoiceChanSpy'][_0x6d5b('0x4a')]);_0x5e8ab2['query']=_[_0x6d5b('0x36')](_0x5b1d2c[_0x6d5b('0x35')]);_0x5e8ab2[_0x6d5b('0x3d')]=_['intersection'](_0x5e8ab2['model'],_0x5e8ab2['query']);_0x33894c['attributes']=_['intersection'](_0x5e8ab2[_0x6d5b('0x34')],qs[_0x6d5b('0x39')](_0x5b1d2c['query'][_0x6d5b('0x39')]));_0x33894c[_0x6d5b('0x38')]=_0x33894c[_0x6d5b('0x38')][_0x6d5b('0x3a')]?_0x33894c[_0x6d5b('0x38')]:_0x5e8ab2[_0x6d5b('0x34')];if(_0x5b1d2c[_0x6d5b('0x35')][_0x6d5b('0x44')]){_0x33894c[_0x6d5b('0x45')]=[{'all':!![]}];}_0x33894c=_['merge']({},_0x33894c,_0x5b1d2c[_0x6d5b('0x4b')]);return db[_0x6d5b('0x43')][_0x6d5b('0x4c')](_0x33894c)[_0x6d5b('0x29')](handleEntityNotFound(_0x5756ca,null))[_0x6d5b('0x29')](respondWithResult(_0x5756ca,null))[_0x6d5b('0x47')](handleError(_0x5756ca,null));};exports[_0x6d5b('0x4d')]=function(_0x1b543f,_0x72479c){return db[_0x6d5b('0x43')][_0x6d5b('0x4d')](_0x1b543f['body'],{})['then'](function(_0x3dfc35){var _0x3245b8=_0x1b543f[_0x6d5b('0x4e')][_0x6d5b('0x4f')]({'plain':!![]});if(!_0x3245b8)throw new Error(_0x6d5b('0x50'));if(_0x3245b8[_0x6d5b('0x51')]===_0x6d5b('0x4e')){var _0x2b20e7=_0x3dfc35[_0x6d5b('0x4f')]({'plain':!![]});var _0x36569a=_0x6d5b('0x2b');return db[_0x6d5b('0x52')]['find']({'where':{'name':_0x36569a,'userProfileId':_0x3245b8[_0x6d5b('0x53')]},'raw':!![]})[_0x6d5b('0x29')](function(_0x5ea0d4){if(_0x5ea0d4&&_0x5ea0d4[_0x6d5b('0x54')]===0x0){return db['UserProfileResource'][_0x6d5b('0x4d')]({'name':_0x2b20e7['name'],'resourceId':_0x2b20e7['id'],'type':_0x5ea0d4[_0x6d5b('0x2e')],'sectionId':_0x5ea0d4['id']},{})[_0x6d5b('0x29')](function(){return _0x3dfc35;});}else{return _0x3dfc35;}})['catch'](function(_0x29544f){logger['error'](_0x6d5b('0x55'),_0x29544f);throw _0x29544f;});}return _0x3dfc35;})[_0x6d5b('0x29')](respondWithResult(_0x72479c,0xc9))[_0x6d5b('0x47')](handleError(_0x72479c,null));};exports[_0x6d5b('0x28')]=function(_0x1a52de,_0x489ea3){if(_0x1a52de[_0x6d5b('0x56')]['id']){delete _0x1a52de[_0x6d5b('0x56')]['id'];}return db[_0x6d5b('0x43')][_0x6d5b('0x4c')]({'where':{'id':_0x1a52de[_0x6d5b('0x49')]['id']}})[_0x6d5b('0x29')](handleEntityNotFound(_0x489ea3,null))[_0x6d5b('0x29')](saveUpdates(_0x1a52de[_0x6d5b('0x56')],null))[_0x6d5b('0x29')](respondWithResult(_0x489ea3,null))['catch'](handleError(_0x489ea3,null));};exports[_0x6d5b('0x2a')]=function(_0x33ffe2,_0x7e4027){return db['VoiceChanSpy']['find']({'where':{'id':_0x33ffe2[_0x6d5b('0x49')]['id']}})[_0x6d5b('0x29')](handleEntityNotFound(_0x7e4027,null))[_0x6d5b('0x29')](removeEntity(_0x7e4027,null))[_0x6d5b('0x47')](handleError(_0x7e4027,null));};
\ No newline at end of file
index 56fc37e..fdf2eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c70=['VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','merge','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','join','length','concat','internal','User','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x5a31ed,_0x2f2a22){var _0x890a06=function(_0x1d253b){while(--_0x1d253b){_0x5a31ed['push'](_0x5a31ed['shift']());}};_0x890a06(++_0x2f2a22);}(_0x0c70,0x123));var _0x00c7=function(_0xa3a478,_0x1fc995){_0xa3a478=_0xa3a478-0x0;var _0x155ffb=_0x0c70[_0xa3a478];return _0x155ffb;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x00c7('0x0'));var attributes=require(_0x00c7('0x1'));var getUserApplications=function(_0x131c13,_0x189167,_0x2f0ce6){var _0x1948d0=0x1;var _0x267145=[];var _0x4ae86f={'context':_0x189167[_0x00c7('0x2')]||'from-sip','exten':util[_0x00c7('0x3')](_0x00c7('0x4'),_0x131c13[_0x00c7('0x5')],_0x2f0ce6),'type':_0x00c7('0x6'),'isApp':![],'ChanSpyId':_0x131c13['id'],'UserId':_0x189167['id']};_0x267145['push'](_[_0x00c7('0x7')]({'app':'Set','appdata':util['format'](_0x00c7('0x8'),_0x00c7('0x9')),'priority':_0x1948d0++},_0x4ae86f));if(_0x131c13[_0x00c7('0xa')]){_0x267145[_0x00c7('0xb')](_['merge']({'app':_0x00c7('0xc'),'appdata':util[_0x00c7('0x3')](_0x00c7('0xd'),_0x131c13[_0x00c7('0xe')]),'priority':_0x1948d0++},_0x4ae86f));}if(_0x131c13[_0x00c7('0xf')]){_0x267145[_0x00c7('0xb')](_[_0x00c7('0x7')]({'app':_0x00c7('0x10'),'appdata':_0x131c13['password'],'priority':_0x1948d0++},_0x4ae86f));}_0x267145[_0x00c7('0xb')](_[_0x00c7('0x7')]({'app':'ChanSpy','appdata':util['format'](_0x00c7('0x11'),_0x189167[_0x00c7('0x12')],_0x131c13[_0x00c7('0x13')]?_0x131c13['options'][_0x00c7('0x14')](''):''),'priority':_0x1948d0++},_0x4ae86f));if(_0x131c13[_0x00c7('0xa')]){_0x267145[_0x00c7('0xb')](_['merge']({'app':'StopMixMonitor','priority':_0x1948d0++},_0x4ae86f));}return _0x267145;};var getChanSpyApplications=function(_0x3e76bd,_0x36cb0b){var _0x3fbda7=[];for(var _0xd218fd=0x0,_0xc40d7e=0x1;_0xd218fd<_0x36cb0b[_0x00c7('0x15')];_0xd218fd++,_0xc40d7e=0x1){_0x3fbda7=_0x3fbda7[_0x00c7('0x16')](getUserApplications(_0x3e76bd,_0x36cb0b[_0xd218fd],_0x36cb0b[_0xd218fd]['internal']));if(_0x36cb0b[_0xd218fd][_0x00c7('0x17')]!=_0x36cb0b[_0xd218fd]['name']){_0x3fbda7=_0x3fbda7['concat'](getUserApplications(_0x3e76bd,_0x36cb0b[_0xd218fd],_0x36cb0b[_0xd218fd][_0x00c7('0x12')]));}}return _0x3fbda7;};var getChanSpyPromise=function(_0x550f72,_0x658aac){return new BPromise(function(_0x450acd,_0xbf7a77){return _0x550f72[_0x00c7('0x18')]['findAll']({'attributes':['id',_0x00c7('0x12'),_0x00c7('0x17')],'where':{'role':_0x00c7('0x19'),'chanspy':!![]},'raw':!![]})[_0x00c7('0x1a')](function(_0x192fee){if(_0x192fee){return _0x450acd(getChanSpyApplications(_0x658aac,_0x192fee));}return _0x450acd([]);})[_0x00c7('0x1b')](function(_0x1f9a56){_0xbf7a77(_0x1f9a56);});});};module[_0x00c7('0x1c')]=function(_0x114547,_0xdeee72){var _0x4b7d43=_0x114547[_0x00c7('0x1d')];return _0x114547[_0x00c7('0x1e')](_0x00c7('0x1f'),attributes,{'tableName':_0x00c7('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xf546ca,_0x51cb6b,_0x2a5faf){return getChanSpyPromise(_0x4b7d43,_0xf546ca)[_0x00c7('0x1a')](function(_0xb3bb5a){if(_0xb3bb5a&&_0xb3bb5a['length']){return _0x4b7d43[_0x00c7('0x21')][_0x00c7('0x22')](_0xb3bb5a);}})[_0x00c7('0x1a')](function(){_0x2a5faf();})[_0x00c7('0x1b')](function(_0x4e15e8){_0x2a5faf(_0x4e15e8);});},'afterUpdate':function(_0x3581cc,_0xfb9b01,_0x37b82f){return _0x4b7d43[_0x00c7('0x21')][_0x00c7('0x23')]({'where':{'ChanSpyId':_0x3581cc['id']}})[_0x00c7('0x1a')](function(){return getChanSpyPromise(_0x4b7d43,_0x3581cc);})[_0x00c7('0x1a')](function(_0x33e595){if(_0x33e595&&_0x33e595[_0x00c7('0x15')]){return _0x4b7d43[_0x00c7('0x21')][_0x00c7('0x22')](_0x33e595);}})[_0x00c7('0x1a')](function(){_0x37b82f();})[_0x00c7('0x1b')](function(_0x2c0951){_0x37b82f(_0x2c0951);});},'afterDestroy':function(_0xe9378c,_0x2cabc9,_0x4618b6){return _0x4b7d43[_0x00c7('0x21')][_0x00c7('0x23')]({'where':{'ChanSpyId':_0xe9378c['id']}})[_0x00c7('0x1a')](function(){_0x4618b6();})[_0x00c7('0x1b')](function(_0x3f1a3a){_0x4618b6(_0x3f1a3a);});}}});};
\ No newline at end of file
+var _0x27d5=['destroy','lodash','util','bluebird','context','format','%s%s','system','push','merge','Set','record','auth','Authenticate','password','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','models','define','VoiceChanSpy','VoiceExtension','bulkCreate'];(function(_0x16a758,_0x1828b5){var _0x45168b=function(_0x4606df){while(--_0x4606df){_0x16a758['push'](_0x16a758['shift']());}};_0x45168b(++_0x1828b5);}(_0x27d5,0x1a1));var _0x527d=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x27d5[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0x527d('0x0'));var util=require(_0x527d('0x1'));var BPromise=require(_0x527d('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x572f20,_0x2f5f79,_0x4339c8){var _0x509860=0x1;var _0xc32dc=[];var _0x23359c={'context':_0x2f5f79[_0x527d('0x3')]||'from-sip','exten':util[_0x527d('0x4')](_0x527d('0x5'),_0x572f20['prefix'],_0x4339c8),'type':_0x527d('0x6'),'isApp':![],'ChanSpyId':_0x572f20['id'],'UserId':_0x2f5f79['id']};_0xc32dc[_0x527d('0x7')](_[_0x527d('0x8')]({'app':_0x527d('0x9'),'appdata':util[_0x527d('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x509860++},_0x23359c));if(_0x572f20[_0x527d('0xa')]){_0xc32dc[_0x527d('0x7')](_[_0x527d('0x8')]({'app':'MixMonitor','appdata':util[_0x527d('0x4')]('${UNIQUEID}.%s,a',_0x572f20['recordingFormat']),'priority':_0x509860++},_0x23359c));}if(_0x572f20[_0x527d('0xb')]){_0xc32dc[_0x527d('0x7')](_[_0x527d('0x8')]({'app':_0x527d('0xc'),'appdata':_0x572f20[_0x527d('0xd')],'priority':_0x509860++},_0x23359c));}_0xc32dc[_0x527d('0x7')](_[_0x527d('0x8')]({'app':'ChanSpy','appdata':util[_0x527d('0x4')](_0x527d('0xe'),_0x2f5f79[_0x527d('0xf')],_0x572f20[_0x527d('0x10')]?_0x572f20['options'][_0x527d('0x11')](''):''),'priority':_0x509860++},_0x23359c));if(_0x572f20[_0x527d('0xa')]){_0xc32dc[_0x527d('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x509860++},_0x23359c));}return _0xc32dc;};var getChanSpyApplications=function(_0x5f01f4,_0x73a19){var _0xa2d12e=[];for(var _0x32e58e=0x0,_0x269b07=0x1;_0x32e58e<_0x73a19[_0x527d('0x12')];_0x32e58e++,_0x269b07=0x1){_0xa2d12e=_0xa2d12e[_0x527d('0x13')](getUserApplications(_0x5f01f4,_0x73a19[_0x32e58e],_0x73a19[_0x32e58e][_0x527d('0x14')]));if(_0x73a19[_0x32e58e][_0x527d('0x14')]!=_0x73a19[_0x32e58e]['name']){_0xa2d12e=_0xa2d12e['concat'](getUserApplications(_0x5f01f4,_0x73a19[_0x32e58e],_0x73a19[_0x32e58e][_0x527d('0xf')]));}}return _0xa2d12e;};var getChanSpyPromise=function(_0xacc956,_0x543974){return new BPromise(function(_0x48f5d3,_0x444539){return _0xacc956[_0x527d('0x15')][_0x527d('0x16')]({'attributes':['id','name',_0x527d('0x14')],'where':{'role':_0x527d('0x17'),'chanspy':!![]},'raw':!![]})[_0x527d('0x18')](function(_0x2c8ab7){if(_0x2c8ab7){return _0x48f5d3(getChanSpyApplications(_0x543974,_0x2c8ab7));}return _0x48f5d3([]);})[_0x527d('0x19')](function(_0x53af91){_0x444539(_0x53af91);});});};module['exports']=function(_0x2dc11b,_0xd4b8c){var _0x23cd76=_0x2dc11b[_0x527d('0x1a')];return _0x2dc11b[_0x527d('0x1b')](_0x527d('0x1c'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48715a,_0x52062a,_0x2422f0){return getChanSpyPromise(_0x23cd76,_0x48715a)[_0x527d('0x18')](function(_0x5bc956){if(_0x5bc956&&_0x5bc956[_0x527d('0x12')]){return _0x23cd76[_0x527d('0x1d')][_0x527d('0x1e')](_0x5bc956);}})[_0x527d('0x18')](function(){_0x2422f0();})[_0x527d('0x19')](function(_0x1bcfae){_0x2422f0(_0x1bcfae);});},'afterUpdate':function(_0xd12ca1,_0x3fc206,_0x418d87){return _0x23cd76[_0x527d('0x1d')][_0x527d('0x1f')]({'where':{'ChanSpyId':_0xd12ca1['id']}})[_0x527d('0x18')](function(){return getChanSpyPromise(_0x23cd76,_0xd12ca1);})['then'](function(_0x5b0823){if(_0x5b0823&&_0x5b0823[_0x527d('0x12')]){return _0x23cd76[_0x527d('0x1d')]['bulkCreate'](_0x5b0823);}})[_0x527d('0x18')](function(){_0x418d87();})['catch'](function(_0x31b1d8){_0x418d87(_0x31b1d8);});},'afterDestroy':function(_0x409a95,_0x585a6d,_0x3c1073){return _0x23cd76[_0x527d('0x1d')][_0x527d('0x1f')]({'where':{'ChanSpyId':_0x409a95['id']}})[_0x527d('0x18')](function(){_0x3c1073();})[_0x527d('0x19')](function(_0x3bf9ba){_0x3c1073(_0x3bf9ba);});}}});};
\ No newline at end of file
index a125978..7335fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['http','request','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceChanSpy,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x127315,_0x5a1bf8){var _0x8c2e3e=function(_0x593c48){while(--_0x593c48){_0x127315['push'](_0x127315['shift']());}};_0x8c2e3e(++_0x5a1bf8);}(_0xb903,0x185));var _0x3b90=function(_0x36fc7e,_0x3399af){_0x36fc7e=_0x36fc7e-0x0;var _0x40f0ec=_0xb903[_0x36fc7e];return _0x40f0ec;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}
\ No newline at end of file
+var _0x3667=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x124179,_0x28f4e8){var _0x1569f7=function(_0x2e9b21){while(--_0x2e9b21){_0x124179['push'](_0x124179['shift']());}};_0x1569f7(++_0x28f4e8);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});}
\ No newline at end of file
index 9403d6a..16de5e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf97=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbf97,0x101));var _0x7bf9=function(_0x3f948a,_0x19e793){_0x3f948a=_0x3f948a-0x0;var _0x4a3a66=_0xbf97[_0x3f948a];return _0x4a3a66;};'use strict';var multer=require(_0x7bf9('0x0'));var util=require(_0x7bf9('0x1'));var path=require(_0x7bf9('0x2'));var timeout=require(_0x7bf9('0x3'));var express=require(_0x7bf9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7bf9('0x5'));var interaction=require(_0x7bf9('0x6'));var config=require(_0x7bf9('0x7'));var controller=require('./voiceContext.controller');router[_0x7bf9('0x8')]('/',auth[_0x7bf9('0x9')](),controller[_0x7bf9('0xa')]);router[_0x7bf9('0x8')](_0x7bf9('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7bf9('0x9')](),controller[_0x7bf9('0xc')]);router[_0x7bf9('0xd')]('/:id',auth[_0x7bf9('0x9')](),controller[_0x7bf9('0xe')]);router[_0x7bf9('0xf')](_0x7bf9('0xb'),auth[_0x7bf9('0x9')](),controller[_0x7bf9('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x689e=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','put','update','destroy','multer'];(function(_0x25710c,_0x2895ce){var _0x1a80e6=function(_0xb9aea7){while(--_0xb9aea7){_0x25710c['push'](_0x25710c['shift']());}};_0x1a80e6(++_0x2895ce);}(_0x689e,0xe9));var _0xe689=function(_0x1be8f4,_0x52aa07){_0x1be8f4=_0x1be8f4-0x0;var _0x33c64a=_0x689e[_0x1be8f4];return _0x33c64a;};'use strict';var multer=require(_0xe689('0x0'));var util=require(_0xe689('0x1'));var path=require(_0xe689('0x2'));var timeout=require('connect-timeout');var express=require(_0xe689('0x3'));var router=express[_0xe689('0x4')]();var fs_extra=require(_0xe689('0x5'));var auth=require(_0xe689('0x6'));var interaction=require(_0xe689('0x7'));var config=require(_0xe689('0x8'));var controller=require(_0xe689('0x9'));router[_0xe689('0xa')]('/',auth['isAuthenticated'](),controller[_0xe689('0xb')]);router[_0xe689('0xa')](_0xe689('0xc'),auth[_0xe689('0xd')](),controller[_0xe689('0xe')]);router['post']('/',auth[_0xe689('0xd')](),controller['create']);router[_0xe689('0xf')](_0xe689('0xc'),auth[_0xe689('0xd')](),controller[_0xe689('0x10')]);router['delete'](_0xe689('0xc'),auth[_0xe689('0xd')](),controller[_0xe689('0x11')]);module['exports']=router;
\ No newline at end of file
index fbc7347..2bc3491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['STRING','name','BOOLEAN','sequelize'];(function(_0x3e8abd,_0xc6a934){var _0x400857=function(_0x1a1526){while(--_0x1a1526){_0x3e8abd['push'](_0x3e8abd['shift']());}};_0x400857(++_0xc6a934);}(_0xaa3f,0x1f3));var _0xfaa3=function(_0xcce84a,_0x148a0a){_0xcce84a=_0xcce84a-0x0;var _0x273e9d=_0xaa3f[_0xcce84a];return _0x273e9d;};'use strict';var Sequelize=require(_0xfaa3('0x0'));module['exports']={'name':{'type':Sequelize[_0xfaa3('0x1')],'unique':_0xfaa3('0x2')},'description':{'type':Sequelize[_0xfaa3('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfaa3('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd7a9=['sequelize','exports','name','STRING'];(function(_0x370335,_0x24dde9){var _0x16e159=function(_0x3fe3ba){while(--_0x3fe3ba){_0x370335['push'](_0x370335['shift']());}};_0x16e159(++_0x24dde9);}(_0xd7a9,0x64));var _0x9d7a=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xd7a9[_0x15876a];return _0xbd900f;};'use strict';var Sequelize=require(_0x9d7a('0x0'));module[_0x9d7a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9d7a('0x2')},'description':{'type':Sequelize[_0x9d7a('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index b70ff9b..a1fe729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11b3=['index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','filters','include','find','create','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','body','readFileSync','root','chan_sip.so','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','VoiceContext,\x20%s,\x20%s','request\x20sent','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','end','stack','name','send'];(function(_0x27f154,_0x2c11d4){var _0x2b3005=function(_0x4c9fda){while(--_0x4c9fda){_0x27f154['push'](_0x27f154['shift']());}};_0x2b3005(++_0x2c11d4);}(_0x11b3,0x157));var _0x311b=function(_0x1427ab,_0x4978fb){_0x1427ab=_0x1427ab-0x0;var _0x426299=_0x11b3[_0x1427ab];return _0x426299;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x311b('0x0'));var zipdir=require(_0x311b('0x1'));var jsonpatch=require(_0x311b('0x2'));var rp=require(_0x311b('0x3'));var moment=require('moment');var BPromise=require(_0x311b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x311b('0x5'));var sox=require(_0x311b('0x6'));var csv=require(_0x311b('0x7'));var ejs=require(_0x311b('0x8'));var fs=require('fs');var fs_extra=require(_0x311b('0x9'));var _=require(_0x311b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x311b('0xb'));var deskjs=require(_0x311b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x311b('0xd'));var Papa=require(_0x311b('0xe'));var Redis=require(_0x311b('0xf'));var authService=require(_0x311b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x311b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x311b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x311b('0x13'));var licenseUtil=require(_0x311b('0x14'));var db=require(_0x311b('0x15'))['db'];var jayson=require(_0x311b('0x16'));var client=jayson['client'][_0x311b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x10dca1,_0x345df1,_0x3be7c1,_0x1d40bc){return new BPromise(function(_0xe7a904,_0x4ec884){var _0x42e281=_0x1d40bc||client;return _0x42e281[_0x311b('0x18')](_0x10dca1,_0x3be7c1)[_0x311b('0x19')](function(_0x3a828d){logger[_0x311b('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x345df1,'request\x20sent');logger[_0x311b('0x1b')](_0x311b('0x1c'),_0x345df1,'request\x20sent',JSON['stringify'](_0x3a828d));if(_0x3a828d[_0x311b('0x1d')]){if(_0x3a828d['error']['code']===0x1f4){logger[_0x311b('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x345df1,_0x3a828d[_0x311b('0x1d')][_0x311b('0x1e')]);return _0x4ec884(_0x3a828d[_0x311b('0x1d')]['message']);}logger['error'](_0x311b('0x1f'),_0x345df1,_0x3a828d[_0x311b('0x1d')][_0x311b('0x1e')]);return _0xe7a904(_0x3a828d['error'][_0x311b('0x1e')]);}else{logger[_0x311b('0x1a')](_0x311b('0x1f'),_0x345df1,_0x311b('0x20'));_0xe7a904(_0x3a828d['result'][_0x311b('0x1e')]);}})['catch'](function(_0x2365ab){logger['error']('VoiceContext,\x20%s,\x20%s',_0x345df1,_0x2365ab);_0x4ec884(_0x2365ab);});});}function respondWithStatusCode(_0x3a341b,_0x559e75){_0x559e75=_0x559e75||0xcc;return function(_0x2b84e4){if(_0x2b84e4){return _0x3a341b[_0x311b('0x21')](_0x559e75);}return _0x3a341b[_0x311b('0x22')](_0x559e75)['end']();};}function respondWithResult(_0x4f2f92,_0x3b7c48){_0x3b7c48=_0x3b7c48||0xc8;return function(_0x58d14c){if(_0x58d14c){return _0x4f2f92[_0x311b('0x22')](_0x3b7c48)[_0x311b('0x23')](_0x58d14c);}};}function respondWithFilteredResult(_0x16c4cd,_0x25eca2){return function(_0x496817){if(_0x496817){var _0x581427=typeof _0x25eca2[_0x311b('0x24')]===_0x311b('0x25')&&typeof _0x25eca2[_0x311b('0x26')]===_0x311b('0x25');var _0x5b21d0=_0x496817[_0x311b('0x27')];var _0x27829d=_0x581427?0x0:_0x25eca2[_0x311b('0x24')];var _0x30460f=_0x581427?_0x496817[_0x311b('0x27')]:_0x25eca2[_0x311b('0x24')]+_0x25eca2[_0x311b('0x26')];var _0x1faf73;if(_0x30460f>=_0x5b21d0){_0x30460f=_0x5b21d0;_0x1faf73=0xc8;}else{_0x1faf73=0xce;}_0x16c4cd['status'](_0x1faf73);return _0x16c4cd[_0x311b('0x28')](_0x311b('0x29'),_0x27829d+'-'+_0x30460f+'/'+_0x5b21d0)[_0x311b('0x23')](_0x496817);}return null;};}function patchUpdates(_0x369312){return function(_0x2c3557){try{jsonpatch[_0x311b('0x2a')](_0x2c3557,_0x369312,!![]);}catch(_0x529777){return BPromise[_0x311b('0x2b')](_0x529777);}return _0x2c3557[_0x311b('0x2c')]();};}function saveUpdates(_0x387109,_0x54dae9){return function(_0x296178){if(_0x296178){return _0x296178[_0x311b('0x2d')](_0x387109)[_0x311b('0x19')](function(_0x5543cd){return _0x5543cd;});}return null;};}function removeEntity(_0x35ad9b,_0x346238){return function(_0x29106b){if(_0x29106b){return _0x29106b[_0x311b('0x2e')]()[_0x311b('0x19')](function(){var _0x5d7454=_0x29106b[_0x311b('0x2f')]({'plain':!![]});var _0x1350ca=_0x311b('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x1350ca,'resourceId':_0x5d7454['id']}})[_0x311b('0x19')](function(){return _0x29106b;});})[_0x311b('0x19')](function(){_0x35ad9b[_0x311b('0x22')](0xcc)[_0x311b('0x31')]();});}};}function handleEntityNotFound(_0x56fe0a,_0x37e246){return function(_0x178f55){if(!_0x178f55){_0x56fe0a['sendStatus'](0x194);}return _0x178f55;};}function handleError(_0x2a1e80,_0x5a759b){_0x5a759b=_0x5a759b||0x1f4;return function(_0x1e164b){logger[_0x311b('0x1d')](_0x1e164b[_0x311b('0x32')]);if(_0x1e164b[_0x311b('0x33')]){delete _0x1e164b['name'];}_0x2a1e80[_0x311b('0x22')](_0x5a759b)[_0x311b('0x34')](_0x1e164b);};}exports[_0x311b('0x35')]=function(_0x5ee57e,_0x11da01){var _0x5ced77={},_0x3fa2df={},_0x5b3288={'count':0x0,'rows':[]};var _0x2cc680=_[_0x311b('0x36')](db[_0x311b('0x37')][_0x311b('0x38')],function(_0x22ff22){return{'name':_0x22ff22[_0x311b('0x39')],'type':_0x22ff22[_0x311b('0x3a')]['key']};});_0x3fa2df[_0x311b('0x3b')]=_[_0x311b('0x36')](_0x2cc680,_0x311b('0x33'));_0x3fa2df[_0x311b('0x3c')]=_[_0x311b('0x3d')](_0x5ee57e['query']);_0x3fa2df['filters']=_[_0x311b('0x3e')](_0x3fa2df[_0x311b('0x3b')],_0x3fa2df[_0x311b('0x3c')]);_0x5ced77[_0x311b('0x3f')]=_[_0x311b('0x3e')](_0x3fa2df[_0x311b('0x3b')],qs[_0x311b('0x40')](_0x5ee57e[_0x311b('0x3c')][_0x311b('0x40')]));_0x5ced77[_0x311b('0x3f')]=_0x5ced77[_0x311b('0x3f')][_0x311b('0x41')]?_0x5ced77[_0x311b('0x3f')]:_0x3fa2df['model'];if(!_0x5ee57e[_0x311b('0x3c')]['hasOwnProperty'](_0x311b('0x42'))){_0x5ced77[_0x311b('0x26')]=qs[_0x311b('0x26')](_0x5ee57e[_0x311b('0x3c')][_0x311b('0x26')]);_0x5ced77[_0x311b('0x24')]=qs[_0x311b('0x24')](_0x5ee57e[_0x311b('0x3c')][_0x311b('0x24')]);}_0x5ced77[_0x311b('0x43')]=qs['sort'](_0x5ee57e[_0x311b('0x3c')][_0x311b('0x44')]);_0x5ced77[_0x311b('0x45')]=qs['filters'](_['pick'](_0x5ee57e[_0x311b('0x3c')],_0x3fa2df['filters']),_0x2cc680);if(_0x5ee57e[_0x311b('0x3c')][_0x311b('0x46')]){_0x5ced77[_0x311b('0x45')]=_[_0x311b('0x47')](_0x5ced77['where'],{'$or':_[_0x311b('0x36')](_0x2cc680,function(_0x5a747c){if(_0x5a747c[_0x311b('0x3a')]!=='VIRTUAL'){var _0x279a04={};_0x279a04[_0x5a747c[_0x311b('0x33')]]={'$like':'%'+_0x5ee57e['query'][_0x311b('0x46')]+'%'};return _0x279a04;}})});}_0x5ced77=_[_0x311b('0x47')]({},_0x5ced77,_0x5ee57e[_0x311b('0x48')]);var _0x4494cc={'where':_0x5ced77['where']};return db[_0x311b('0x37')][_0x311b('0x27')](_0x4494cc)[_0x311b('0x19')](function(_0x5c4a52){_0x5b3288[_0x311b('0x27')]=_0x5c4a52;if(_0x5ee57e[_0x311b('0x3c')][_0x311b('0x49')]){_0x5ced77['include']=[{'all':!![]}];}return db[_0x311b('0x37')][_0x311b('0x4a')](_0x5ced77);})[_0x311b('0x19')](function(_0x55c21d){_0x5b3288[_0x311b('0x4b')]=_0x55c21d;return _0x5b3288;})['then'](respondWithFilteredResult(_0x11da01,_0x5ced77))[_0x311b('0x4c')](handleError(_0x11da01,null));};exports[_0x311b('0x4d')]=function(_0x1c050d,_0x20c345){var _0x525e21={'raw':![],'where':{'id':_0x1c050d[_0x311b('0x4e')]['id']}},_0x1b7885={};_0x1b7885['model']=_[_0x311b('0x3d')](db[_0x311b('0x37')]['rawAttributes']);_0x1b7885['query']=_[_0x311b('0x3d')](_0x1c050d['query']);_0x1b7885[_0x311b('0x4f')]=_['intersection'](_0x1b7885[_0x311b('0x3b')],_0x1b7885[_0x311b('0x3c')]);_0x525e21[_0x311b('0x3f')]=_[_0x311b('0x3e')](_0x1b7885['model'],qs[_0x311b('0x40')](_0x1c050d['query'][_0x311b('0x40')]));_0x525e21[_0x311b('0x3f')]=_0x525e21[_0x311b('0x3f')]['length']?_0x525e21[_0x311b('0x3f')]:_0x1b7885[_0x311b('0x3b')];if(_0x1c050d[_0x311b('0x3c')][_0x311b('0x49')]){_0x525e21[_0x311b('0x50')]=[{'all':!![]}];}_0x525e21=_[_0x311b('0x47')]({},_0x525e21,_0x1c050d[_0x311b('0x48')]);return db[_0x311b('0x37')][_0x311b('0x51')](_0x525e21)[_0x311b('0x19')](handleEntityNotFound(_0x20c345,null))['then'](respondWithResult(_0x20c345,null))[_0x311b('0x4c')](handleError(_0x20c345,null));};exports[_0x311b('0x52')]=function(_0x138463,_0x49a561,_0x12c63c){var _0x18ba73;return db[_0x311b('0x37')]['create'](_0x138463['body'],{'raw':!![]})[_0x311b('0x19')](function(_0x9e2241){_0x18ba73=_0x9e2241;return db[_0x311b('0x37')][_0x311b('0x4a')]({'raw':!![]});})[_0x311b('0x19')](function(_0x26bce0){var _0x262226=fs['readFileSync'](path[_0x311b('0x53')](config['root'],_0x311b('0x54')),_0x311b('0x55'));var _0x2474a9=ejs[_0x311b('0x56')](_0x262226,{'contexts':_0x26bce0||[]});fs[_0x311b('0x57')](_0x311b('0x58'),_0x2474a9);})[_0x311b('0x19')](function(){return respondWithRpcPromise(_0x311b('0x59'),_0x311b('0x52'),{'module':'chan_sip.so'});})[_0x311b('0x19')](function(){var _0x39f554=_0x138463[_0x311b('0x5a')][_0x311b('0x2f')]({'plain':!![]});if(!_0x39f554)throw new Error(_0x311b('0x5b'));if(_0x39f554['role']==='user'){var _0x56b323=_0x18ba73['get']({'plain':!![]});return db[_0x311b('0x5c')]['find']({'where':{'name':_0x311b('0x30'),'userProfileId':_0x39f554['userProfileId']},'raw':!![]})['then'](function(_0x2577a4){if(_0x2577a4&&_0x2577a4[_0x311b('0x5d')]===0x0){return db[_0x311b('0x5e')][_0x311b('0x52')]({'name':_0x56b323[_0x311b('0x33')],'resourceId':_0x56b323['id'],'type':_0x2577a4[_0x311b('0x33')],'sectionId':_0x2577a4['id']},{})[_0x311b('0x19')](function(){return _0x18ba73;});}else{return _0x18ba73;}})[_0x311b('0x4c')](function(_0x258fd0){logger[_0x311b('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258fd0);throw _0x258fd0;});}return _0x18ba73;})['then'](respondWithResult(_0x49a561,0xc9))[_0x311b('0x4c')](handleError(_0x49a561,null));};exports[_0x311b('0x2d')]=function(_0x4fd1e7,_0xab08f7,_0x33e5c4){var _0x261b16;return db[_0x311b('0x37')][_0x311b('0x51')]({'where':{'id':_0x4fd1e7[_0x311b('0x4e')]['id']}})['then'](handleEntityNotFound(_0xab08f7,null))[_0x311b('0x19')](saveUpdates(_0x4fd1e7[_0x311b('0x5f')],null))[_0x311b('0x19')](function(_0x2237fb){if(_0x2237fb){_0x261b16=_0x2237fb;return db[_0x311b('0x37')][_0x311b('0x4a')]({'raw':!![]});}})['then'](function(_0x443eb6){var _0x15b6e5=fs[_0x311b('0x60')](path[_0x311b('0x53')](config[_0x311b('0x61')],'server/files/templates/context.ejs'),_0x311b('0x55'));var _0x26fa26=ejs[_0x311b('0x56')](_0x15b6e5,{'contexts':_0x443eb6||[]});fs[_0x311b('0x57')](_0x311b('0x58'),_0x26fa26);})[_0x311b('0x19')](function(){return respondWithRpcPromise(_0x311b('0x59'),_0x311b('0x2d'),{'module':_0x311b('0x62')});})[_0x311b('0x19')](function(){return _0x261b16;})[_0x311b('0x19')](respondWithResult(_0xab08f7,null))[_0x311b('0x4c')](handleError(_0xab08f7,null));};exports[_0x311b('0x2e')]=function(_0xfa5e84,_0x43f0bc,_0x729bb1){var _0x37c8b6;return db[_0x311b('0x37')][_0x311b('0x51')]({'where':{'id':_0xfa5e84[_0x311b('0x4e')]['id']}})[_0x311b('0x19')](handleEntityNotFound(_0x43f0bc,null))[_0x311b('0x19')](removeEntity(_0x43f0bc,null))['then'](function(){return db[_0x311b('0x37')][_0x311b('0x4a')]({'raw':!![]});})[_0x311b('0x19')](function(_0x3dbc04){var _0x336dad=fs[_0x311b('0x60')](path[_0x311b('0x53')](config[_0x311b('0x61')],'server/files/templates/context.ejs'),_0x311b('0x55'));var _0x406696=ejs[_0x311b('0x56')](_0x336dad,{'contexts':_0x3dbc04});fs[_0x311b('0x57')](_0x311b('0x58'),_0x406696);return respondWithRpcPromise(_0x311b('0x59'),_0x311b('0x2e'),{'module':_0x311b('0x62')});})[_0x311b('0x4c')](handleError(_0x43f0bc,null));};
\ No newline at end of file
+var _0x6d78=['UserProfileResource','params','readFileSync','/etc/asterisk/extensions_xcally_contexts.conf','update','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','get','destroy','sendStatus','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','join','root','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','userProfileId','autoAssociation'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x6d78,0xc6));var _0x86d7=function(_0x5af65f,_0x1a4ce5){_0x5af65f=_0x5af65f-0x0;var _0x3c8d0d=_0x6d78[_0x5af65f];return _0x3c8d0d;};'use strict';var emlformat=require(_0x86d7('0x0'));var rimraf=require(_0x86d7('0x1'));var zipdir=require(_0x86d7('0x2'));var jsonpatch=require(_0x86d7('0x3'));var rp=require('request-promise');var moment=require(_0x86d7('0x4'));var BPromise=require(_0x86d7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x86d7('0x6'));var ejs=require(_0x86d7('0x7'));var fs=require('fs');var fs_extra=require(_0x86d7('0x8'));var _=require(_0x86d7('0x9'));var squel=require(_0x86d7('0xa'));var crypto=require(_0x86d7('0xb'));var jsforce=require(_0x86d7('0xc'));var deskjs=require(_0x86d7('0xd'));var toCsv=require(_0x86d7('0x6'));var querystring=require(_0x86d7('0xe'));var Papa=require(_0x86d7('0xf'));var Redis=require(_0x86d7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x86d7('0x11'));var hardwareService=require(_0x86d7('0x12'));var logger=require(_0x86d7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x86d7('0x14'));var licenseUtil=require(_0x86d7('0x15'));var db=require(_0x86d7('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x86d7('0x17')][_0x86d7('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3456b3,_0x22e00e,_0x12945d,_0x84314f){return new BPromise(function(_0x5493db,_0xc2c279){var _0x3fe332=_0x84314f||client;return _0x3fe332[_0x86d7('0x19')](_0x3456b3,_0x12945d)[_0x86d7('0x1a')](function(_0x2b38e7){logger[_0x86d7('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x22e00e,_0x86d7('0x1c'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x22e00e,_0x86d7('0x1c'),JSON[_0x86d7('0x1d')](_0x2b38e7));if(_0x2b38e7[_0x86d7('0x1e')]){if(_0x2b38e7['error']['code']===0x1f4){logger[_0x86d7('0x1e')](_0x86d7('0x1f'),_0x22e00e,_0x2b38e7['error'][_0x86d7('0x20')]);return _0xc2c279(_0x2b38e7[_0x86d7('0x1e')][_0x86d7('0x20')]);}logger[_0x86d7('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x22e00e,_0x2b38e7[_0x86d7('0x1e')]['message']);return _0x5493db(_0x2b38e7['error']['message']);}else{logger[_0x86d7('0x1b')](_0x86d7('0x1f'),_0x22e00e,_0x86d7('0x1c'));_0x5493db(_0x2b38e7[_0x86d7('0x21')][_0x86d7('0x20')]);}})['catch'](function(_0x4ec31a){logger[_0x86d7('0x1e')](_0x86d7('0x1f'),_0x22e00e,_0x4ec31a);_0xc2c279(_0x4ec31a);});});}function respondWithStatusCode(_0x124090,_0x49d944){_0x49d944=_0x49d944||0xcc;return function(_0x5c4390){if(_0x5c4390){return _0x124090['sendStatus'](_0x49d944);}return _0x124090[_0x86d7('0x22')](_0x49d944)['end']();};}function respondWithResult(_0xf37d49,_0x9e5945){_0x9e5945=_0x9e5945||0xc8;return function(_0x89eed8){if(_0x89eed8){return _0xf37d49[_0x86d7('0x22')](_0x9e5945)[_0x86d7('0x23')](_0x89eed8);}};}function respondWithFilteredResult(_0xa7d205,_0x2c8691){return function(_0x282ae4){if(_0x282ae4){var _0x3b34d7=typeof _0x2c8691[_0x86d7('0x24')]===_0x86d7('0x25')&&typeof _0x2c8691[_0x86d7('0x26')]===_0x86d7('0x25');var _0x3b24cd=_0x282ae4['count'];var _0x263bb5=_0x3b34d7?0x0:_0x2c8691[_0x86d7('0x24')];var _0x5f4f1f=_0x3b34d7?_0x282ae4[_0x86d7('0x27')]:_0x2c8691[_0x86d7('0x24')]+_0x2c8691[_0x86d7('0x26')];var _0x1a8df9;if(_0x5f4f1f>=_0x3b24cd){_0x5f4f1f=_0x3b24cd;_0x1a8df9=0xc8;}else{_0x1a8df9=0xce;}_0xa7d205['status'](_0x1a8df9);return _0xa7d205[_0x86d7('0x28')]('Content-Range',_0x263bb5+'-'+_0x5f4f1f+'/'+_0x3b24cd)['json'](_0x282ae4);}return null;};}function patchUpdates(_0xfd16e6){return function(_0x1f2981){try{jsonpatch['apply'](_0x1f2981,_0xfd16e6,!![]);}catch(_0x25f382){return BPromise['reject'](_0x25f382);}return _0x1f2981['save']();};}function saveUpdates(_0x47c203,_0x12539a){return function(_0x40d036){if(_0x40d036){return _0x40d036['update'](_0x47c203)['then'](function(_0x3cb4bb){return _0x3cb4bb;});}return null;};}function removeEntity(_0x3387f8,_0x3b9f9a){return function(_0x242b6d){if(_0x242b6d){return _0x242b6d['destroy']()[_0x86d7('0x1a')](function(){var _0x145a7e=_0x242b6d[_0x86d7('0x29')]({'plain':!![]});var _0x172147='Contexts';return db['UserProfileResource'][_0x86d7('0x2a')]({'where':{'type':_0x172147,'resourceId':_0x145a7e['id']}})[_0x86d7('0x1a')](function(){return _0x242b6d;});})['then'](function(){_0x3387f8[_0x86d7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11c9d7,_0x226b6f){return function(_0x547f82){if(!_0x547f82){_0x11c9d7[_0x86d7('0x2b')](0x194);}return _0x547f82;};}function handleError(_0x3c6620,_0x4ae3e2){_0x4ae3e2=_0x4ae3e2||0x1f4;return function(_0x193aed){logger[_0x86d7('0x1e')](_0x193aed[_0x86d7('0x2c')]);if(_0x193aed[_0x86d7('0x2d')]){delete _0x193aed[_0x86d7('0x2d')];}_0x3c6620[_0x86d7('0x22')](_0x4ae3e2)[_0x86d7('0x2e')](_0x193aed);};}exports['index']=function(_0x3d5e7e,_0x10f287){var _0x5076c5={},_0x4f3a1e={},_0xc460d4={'count':0x0,'rows':[]};var _0x4c8f03=_[_0x86d7('0x2f')](db[_0x86d7('0x30')][_0x86d7('0x31')],function(_0x5c2160){return{'name':_0x5c2160[_0x86d7('0x32')],'type':_0x5c2160[_0x86d7('0x33')][_0x86d7('0x34')]};});_0x4f3a1e['model']=_[_0x86d7('0x2f')](_0x4c8f03,_0x86d7('0x2d'));_0x4f3a1e[_0x86d7('0x35')]=_[_0x86d7('0x36')](_0x3d5e7e[_0x86d7('0x35')]);_0x4f3a1e[_0x86d7('0x37')]=_[_0x86d7('0x38')](_0x4f3a1e[_0x86d7('0x39')],_0x4f3a1e[_0x86d7('0x35')]);_0x5076c5['attributes']=_[_0x86d7('0x38')](_0x4f3a1e['model'],qs['fields'](_0x3d5e7e[_0x86d7('0x35')][_0x86d7('0x3a')]));_0x5076c5[_0x86d7('0x3b')]=_0x5076c5['attributes'][_0x86d7('0x3c')]?_0x5076c5[_0x86d7('0x3b')]:_0x4f3a1e[_0x86d7('0x39')];if(!_0x3d5e7e[_0x86d7('0x35')][_0x86d7('0x3d')]('nolimit')){_0x5076c5[_0x86d7('0x26')]=qs[_0x86d7('0x26')](_0x3d5e7e[_0x86d7('0x35')]['limit']);_0x5076c5[_0x86d7('0x24')]=qs['offset'](_0x3d5e7e[_0x86d7('0x35')]['offset']);}_0x5076c5[_0x86d7('0x3e')]=qs[_0x86d7('0x3f')](_0x3d5e7e[_0x86d7('0x35')][_0x86d7('0x3f')]);_0x5076c5['where']=qs['filters'](_[_0x86d7('0x40')](_0x3d5e7e['query'],_0x4f3a1e[_0x86d7('0x37')]),_0x4c8f03);if(_0x3d5e7e[_0x86d7('0x35')][_0x86d7('0x41')]){_0x5076c5[_0x86d7('0x42')]=_[_0x86d7('0x43')](_0x5076c5[_0x86d7('0x42')],{'$or':_[_0x86d7('0x2f')](_0x4c8f03,function(_0x4255ae){if(_0x4255ae[_0x86d7('0x33')]!=='VIRTUAL'){var _0x4e3dec={};_0x4e3dec[_0x4255ae[_0x86d7('0x2d')]]={'$like':'%'+_0x3d5e7e['query'][_0x86d7('0x41')]+'%'};return _0x4e3dec;}})});}_0x5076c5=_[_0x86d7('0x43')]({},_0x5076c5,_0x3d5e7e[_0x86d7('0x44')]);var _0x54fefb={'where':_0x5076c5['where']};return db[_0x86d7('0x30')][_0x86d7('0x27')](_0x54fefb)[_0x86d7('0x1a')](function(_0x1a1427){_0xc460d4['count']=_0x1a1427;if(_0x3d5e7e[_0x86d7('0x35')][_0x86d7('0x45')]){_0x5076c5['include']=[{'all':!![]}];}return db[_0x86d7('0x30')][_0x86d7('0x46')](_0x5076c5);})['then'](function(_0x3f692f){_0xc460d4[_0x86d7('0x47')]=_0x3f692f;return _0xc460d4;})[_0x86d7('0x1a')](respondWithFilteredResult(_0x10f287,_0x5076c5))[_0x86d7('0x48')](handleError(_0x10f287,null));};exports[_0x86d7('0x49')]=function(_0x23366d,_0x3ceddf){var _0x42c687={'raw':![],'where':{'id':_0x23366d['params']['id']}},_0x5863c0={};_0x5863c0[_0x86d7('0x39')]=_[_0x86d7('0x36')](db[_0x86d7('0x30')][_0x86d7('0x31')]);_0x5863c0['query']=_['keys'](_0x23366d['query']);_0x5863c0['filters']=_[_0x86d7('0x38')](_0x5863c0[_0x86d7('0x39')],_0x5863c0[_0x86d7('0x35')]);_0x42c687[_0x86d7('0x3b')]=_['intersection'](_0x5863c0[_0x86d7('0x39')],qs[_0x86d7('0x3a')](_0x23366d[_0x86d7('0x35')]['fields']));_0x42c687[_0x86d7('0x3b')]=_0x42c687[_0x86d7('0x3b')][_0x86d7('0x3c')]?_0x42c687[_0x86d7('0x3b')]:_0x5863c0[_0x86d7('0x39')];if(_0x23366d[_0x86d7('0x35')][_0x86d7('0x45')]){_0x42c687[_0x86d7('0x4a')]=[{'all':!![]}];}_0x42c687=_[_0x86d7('0x43')]({},_0x42c687,_0x23366d[_0x86d7('0x44')]);return db[_0x86d7('0x30')][_0x86d7('0x4b')](_0x42c687)['then'](handleEntityNotFound(_0x3ceddf,null))[_0x86d7('0x1a')](respondWithResult(_0x3ceddf,null))[_0x86d7('0x48')](handleError(_0x3ceddf,null));};exports['create']=function(_0x14a0d1,_0x55bd44,_0x45b430){var _0x507a2d;return db[_0x86d7('0x30')][_0x86d7('0x4c')](_0x14a0d1[_0x86d7('0x4d')],{'raw':!![]})[_0x86d7('0x1a')](function(_0x5787af){_0x507a2d=_0x5787af;return db['VoiceContext'][_0x86d7('0x46')]({'raw':!![]});})[_0x86d7('0x1a')](function(_0x4d8305){var _0x397865=fs['readFileSync'](path[_0x86d7('0x4e')](config[_0x86d7('0x4f')],'server/files/templates/context.ejs'),_0x86d7('0x50'));var _0x49dda1=ejs[_0x86d7('0x51')](_0x397865,{'contexts':_0x4d8305||[]});fs[_0x86d7('0x52')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x49dda1);})[_0x86d7('0x1a')](function(){return respondWithRpcPromise(_0x86d7('0x53'),'create',{'module':'chan_sip.so'});})[_0x86d7('0x1a')](function(){var _0x4cbb93=_0x14a0d1[_0x86d7('0x54')]['get']({'plain':!![]});if(!_0x4cbb93)throw new Error(_0x86d7('0x55'));if(_0x4cbb93['role']===_0x86d7('0x54')){var _0x329970=_0x507a2d[_0x86d7('0x29')]({'plain':!![]});return db[_0x86d7('0x56')][_0x86d7('0x4b')]({'where':{'name':_0x86d7('0x57'),'userProfileId':_0x4cbb93[_0x86d7('0x58')]},'raw':!![]})[_0x86d7('0x1a')](function(_0x4291ca){if(_0x4291ca&&_0x4291ca[_0x86d7('0x59')]===0x0){return db[_0x86d7('0x5a')]['create']({'name':_0x329970[_0x86d7('0x2d')],'resourceId':_0x329970['id'],'type':_0x4291ca[_0x86d7('0x2d')],'sectionId':_0x4291ca['id']},{})['then'](function(){return _0x507a2d;});}else{return _0x507a2d;}})['catch'](function(_0x25e80a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25e80a);throw _0x25e80a;});}return _0x507a2d;})[_0x86d7('0x1a')](respondWithResult(_0x55bd44,0xc9))[_0x86d7('0x48')](handleError(_0x55bd44,null));};exports['update']=function(_0x49c435,_0x7ea200,_0x532a12){var _0x2c3040;return db[_0x86d7('0x30')][_0x86d7('0x4b')]({'where':{'id':_0x49c435[_0x86d7('0x5b')]['id']}})[_0x86d7('0x1a')](handleEntityNotFound(_0x7ea200,null))[_0x86d7('0x1a')](saveUpdates(_0x49c435[_0x86d7('0x4d')],null))[_0x86d7('0x1a')](function(_0x5da7ca){if(_0x5da7ca){_0x2c3040=_0x5da7ca;return db[_0x86d7('0x30')][_0x86d7('0x46')]({'raw':!![]});}})['then'](function(_0xcdcc96){var _0x5d4ec1=fs[_0x86d7('0x5c')](path['join'](config[_0x86d7('0x4f')],'server/files/templates/context.ejs'),_0x86d7('0x50'));var _0x20c8da=ejs[_0x86d7('0x51')](_0x5d4ec1,{'contexts':_0xcdcc96||[]});fs[_0x86d7('0x52')](_0x86d7('0x5d'),_0x20c8da);})[_0x86d7('0x1a')](function(){return respondWithRpcPromise(_0x86d7('0x53'),_0x86d7('0x5e'),{'module':_0x86d7('0x5f')});})[_0x86d7('0x1a')](function(){return _0x2c3040;})['then'](respondWithResult(_0x7ea200,null))[_0x86d7('0x48')](handleError(_0x7ea200,null));};exports[_0x86d7('0x2a')]=function(_0xf8b0d3,_0x26e8ce,_0x5592c1){var _0x365b74;return db[_0x86d7('0x30')][_0x86d7('0x4b')]({'where':{'id':_0xf8b0d3['params']['id']}})[_0x86d7('0x1a')](handleEntityNotFound(_0x26e8ce,null))['then'](removeEntity(_0x26e8ce,null))['then'](function(){return db[_0x86d7('0x30')]['findAll']({'raw':!![]});})[_0x86d7('0x1a')](function(_0x446819){var _0x277c0d=fs[_0x86d7('0x5c')](path[_0x86d7('0x4e')](config['root'],'server/files/templates/context.ejs'),_0x86d7('0x50'));var _0x27777f=ejs[_0x86d7('0x51')](_0x277c0d,{'contexts':_0x446819});fs['writeFileSync'](_0x86d7('0x5d'),_0x27777f);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x26e8ce,null));};
\ No newline at end of file
index b9cd84d..96adf3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd448=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0x5b92e7,_0x253fa6){var _0x5b5ecc=function(_0x29ac5a){while(--_0x29ac5a){_0x5b92e7['push'](_0x5b92e7['shift']());}};_0x5b5ecc(++_0x253fa6);}(_0xd448,0x172));var _0x8d44=function(_0x2af4ca,_0x1732e4){_0x2af4ca=_0x2af4ca-0x0;var _0x4cbaec=_0xd448[_0x2af4ca];return _0x4cbaec;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var logger=require(_0x8d44('0x1'))(_0x8d44('0x2'));var moment=require(_0x8d44('0x3'));var BPromise=require(_0x8d44('0x4'));var rp=require(_0x8d44('0x5'));var fs=require('fs');var path=require(_0x8d44('0x6'));var rimraf=require(_0x8d44('0x7'));var config=require(_0x8d44('0x8'));var attributes=require(_0x8d44('0x9'));module['exports']=function(_0x41ae8e,_0x5032bc){return _0x41ae8e['define'](_0x8d44('0xa'),attributes,{'tableName':_0x8d44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8435=['define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0x8435,0x199));var _0x5843=function(_0x17b076,_0x70ee8e){_0x17b076=_0x17b076-0x0;var _0x493828=_0x8435[_0x17b076];return _0x493828;};'use strict';var _=require(_0x5843('0x0'));var util=require('util');var logger=require(_0x5843('0x1'))(_0x5843('0x2'));var moment=require(_0x5843('0x3'));var BPromise=require(_0x5843('0x4'));var rp=require(_0x5843('0x5'));var fs=require('fs');var path=require(_0x5843('0x6'));var rimraf=require(_0x5843('0x7'));var config=require(_0x5843('0x8'));var attributes=require(_0x5843('0x9'));module[_0x5843('0xa')]=function(_0x55ed79,_0xca08b){return _0x55ed79[_0x5843('0xb')](_0x5843('0xc'),attributes,{'tableName':_0x5843('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f6ac1c..7b034dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f18=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x2ab1f2,_0x43149f){var _0x1af2c6=function(_0x1e7aec){while(--_0x1e7aec){_0x2ab1f2['push'](_0x2ab1f2['shift']());}};_0x1af2c6(++_0x43149f);}(_0x6f18,0x1b4));var _0x86f1=function(_0x447842,_0x44ee56){_0x447842=_0x447842-0x0;var _0x4432b6=_0x6f18[_0x447842];return _0x4432b6;};'use strict';var _=require(_0x86f1('0x0'));var util=require('util');var moment=require(_0x86f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x86f1('0x2'));var fs=require('fs');var Redis=require(_0x86f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86f1('0x4'));var logger=require(_0x86f1('0x5'))('rpc');var config=require(_0x86f1('0x6'));var jayson=require(_0x86f1('0x7'));var client=jayson[_0x86f1('0x8')][_0x86f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x403f48,_0x4c7943,_0x5b0f45){return new BPromise(function(_0x3cc3c5,_0x3223eb){return client[_0x86f1('0xa')](_0x403f48,_0x5b0f45)[_0x86f1('0xb')](function(_0x4f1f6e){logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,_0x86f1('0xe'));logger[_0x86f1('0xf')](_0x86f1('0x10'),_0x4c7943,_0x86f1('0xe'),JSON[_0x86f1('0x11')](_0x4f1f6e));if(_0x4f1f6e[_0x86f1('0x12')]){if(_0x4f1f6e['error'][_0x86f1('0x13')]===0x1f4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3223eb(_0x4f1f6e[_0x86f1('0x12')]['message']);}logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);return _0x3cc3c5(_0x4f1f6e[_0x86f1('0x12')][_0x86f1('0x14')]);}else{logger[_0x86f1('0xc')](_0x86f1('0xd'),_0x4c7943,'request\x20sent');_0x3cc3c5(_0x4f1f6e[_0x86f1('0x15')][_0x86f1('0x14')]);}})[_0x86f1('0x16')](function(_0x4452c4){logger[_0x86f1('0x12')](_0x86f1('0xd'),_0x4c7943,_0x4452c4);_0x3223eb(_0x4452c4);});});}
\ No newline at end of file
+var _0x3611=['debug','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x5adbe5,_0x41ff5f){var _0x5380e2=function(_0x2657da){while(--_0x2657da){_0x5adbe5['push'](_0x5adbe5['shift']());}};_0x5380e2(++_0x41ff5f);}(_0x3611,0x136));var _0x1361=function(_0x43d22f,_0x310442){_0x43d22f=_0x43d22f-0x0;var _0xda9d67=_0x3611[_0x43d22f];return _0xda9d67;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1361('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1361('0x2'))['db'];var utils=require(_0x1361('0x3'));var logger=require(_0x1361('0x4'))(_0x1361('0x5'));var config=require('../../config/environment');var jayson=require(_0x1361('0x6'));var client=jayson[_0x1361('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216d22,_0x4da71d,_0x2af7c4){return new BPromise(function(_0x49cfad,_0x5cc29f){return client[_0x1361('0x8')](_0x216d22,_0x2af7c4)[_0x1361('0x9')](function(_0x146242){logger[_0x1361('0xa')](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));logger[_0x1361('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4da71d,_0x1361('0xc'),JSON['stringify'](_0x146242));if(_0x146242['error']){if(_0x146242[_0x1361('0xe')]['code']===0x1f4){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242[_0x1361('0xe')][_0x1361('0xf')]);return _0x5cc29f(_0x146242[_0x1361('0xe')][_0x1361('0xf')]);}logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242['error']['message']);return _0x49cfad(_0x146242[_0x1361('0xe')]['message']);}else{logger['info'](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));_0x49cfad(_0x146242[_0x1361('0x10')][_0x1361('0xf')]);}})['catch'](function(_0x1bb588){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x1bb588);_0x5cc29f(_0x1bb588);});});}
\ No newline at end of file
index e0bb293..56996ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc4c=['update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./voiceDialReport.controller','index','/describe','isAuthenticated','get','post','put'];(function(_0x4a90b0,_0x49e383){var _0xcd7610=function(_0x4e218a){while(--_0x4e218a){_0x4a90b0['push'](_0x4a90b0['shift']());}};_0xcd7610(++_0x49e383);}(_0xfc4c,0xca));var _0xcfc4=function(_0x1e369e,_0xea9388){_0x1e369e=_0x1e369e-0x0;var _0x2cda39=_0xfc4c[_0x1e369e];return _0x2cda39;};'use strict';var multer=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var path=require(_0xcfc4('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfc4('0x3'));var router=express[_0xcfc4('0x4')]();var fs_extra=require(_0xcfc4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcfc4('0x6'));var controller=require(_0xcfc4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcfc4('0x8')]);router['get'](_0xcfc4('0x9'),auth[_0xcfc4('0xa')](),controller['describe']);router[_0xcfc4('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcfc4('0xc')]('/',auth[_0xcfc4('0xa')](),controller['create']);router[_0xcfc4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcfc4('0xe')]);router[_0xcfc4('0xf')](_0xcfc4('0x10'),auth[_0xcfc4('0xa')](),controller[_0xcfc4('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x60c6=['show','post','create','put','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60c6,0x109));var _0x660c=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x60c6[_0x12b683];return _0xfb150b;};'use strict';var multer=require(_0x660c('0x0'));var util=require(_0x660c('0x1'));var path=require('path');var timeout=require(_0x660c('0x2'));var express=require('express');var router=express[_0x660c('0x3')]();var fs_extra=require(_0x660c('0x4'));var auth=require(_0x660c('0x5'));var interaction=require(_0x660c('0x6'));var config=require(_0x660c('0x7'));var controller=require(_0x660c('0x8'));router['get']('/',auth[_0x660c('0x9')](),controller[_0x660c('0xa')]);router['get'](_0x660c('0xb'),auth['isAuthenticated'](),controller[_0x660c('0xc')]);router[_0x660c('0xd')](_0x660c('0xe'),auth[_0x660c('0x9')](),controller[_0x660c('0xf')]);router[_0x660c('0x10')]('/',auth['isAuthenticated'](),controller[_0x660c('0x11')]);router[_0x660c('0x12')](_0x660c('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x660c('0x9')](),controller[_0x660c('0x13')]);module['exports']=router;
\ No newline at end of file
index 04bddab..9bd4258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4fb63e,_0xaee2ab){var _0x46718e=function(_0x548137){while(--_0x548137){_0x4fb63e['push'](_0x4fb63e['shift']());}};_0x46718e(++_0xaee2ab);}(_0x34e8,0x12c));var _0x834e=function(_0xe40956,_0x1bc25a){_0xe40956=_0xe40956-0x0;var _0x3fd38c=_0x34e8[_0xe40956];return _0x3fd38c;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}};
\ No newline at end of file
+var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x2986fb,_0x9482a0){var _0xb3c156=function(_0x3fbe75){while(--_0x3fbe75){_0x2986fb['push'](_0x2986fb['shift']());}};_0xb3c156(++_0x9482a0);}(_0x81bd,0x7c));var _0xd81b=function(_0x50ff1e,_0x306229){_0x50ff1e=_0x50ff1e-0x0;var _0x16c0fb=_0x81bd[_0x50ff1e];return _0x16c0fb;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}};
\ No newline at end of file
index 7b9457f..ba06042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe724=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','rows','params','keys','find','catch','create','body','destroy','describe','rimraf','zip-dir','moment','mustache','path','to-csv','crypto','jsforce'];(function(_0x35b8bd,_0x330fc2){var _0x21d8c7=function(_0x3d6d6f){while(--_0x3d6d6f){_0x35b8bd['push'](_0x35b8bd['shift']());}};_0x21d8c7(++_0x330fc2);}(_0xe724,0xcd));var _0x4e72=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xe724[_0x4e1a49];return _0x136aae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e72('0x0'));var zipdir=require(_0x4e72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e72('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4e72('0x3'));var util=require('util');var path=require(_0x4e72('0x4'));var sox=require('sox');var csv=require(_0x4e72('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e72('0x6'));var jsforce=require(_0x4e72('0x7'));var deskjs=require(_0x4e72('0x8'));var toCsv=require(_0x4e72('0x5'));var querystring=require(_0x4e72('0x9'));var Papa=require('papaparse');var Redis=require(_0x4e72('0xa'));var authService=require(_0x4e72('0xb'));var qs=require(_0x4e72('0xc'));var as=require(_0x4e72('0xd'));var hardwareService=require(_0x4e72('0xe'));var logger=require(_0x4e72('0xf'))(_0x4e72('0x10'));var utils=require(_0x4e72('0x11'));var config=require(_0x4e72('0x12'));var licenseUtil=require(_0x4e72('0x13'));var db=require(_0x4e72('0x14'))['db'];function respondWithStatusCode(_0x4af59e,_0x1c138b){_0x1c138b=_0x1c138b||0xcc;return function(_0x577730){if(_0x577730){return _0x4af59e[_0x4e72('0x15')](_0x1c138b);}return _0x4af59e[_0x4e72('0x16')](_0x1c138b)[_0x4e72('0x17')]();};}function respondWithResult(_0x4e137c,_0x1166f0){_0x1166f0=_0x1166f0||0xc8;return function(_0x135b44){if(_0x135b44){return _0x4e137c[_0x4e72('0x16')](_0x1166f0)[_0x4e72('0x18')](_0x135b44);}};}function respondWithFilteredResult(_0x4d8059,_0x558093){return function(_0x20c339){if(_0x20c339){var _0x39e044=typeof _0x558093['offset']==='undefined'&&typeof _0x558093['limit']==='undefined';var _0x1a4b14=_0x20c339[_0x4e72('0x19')];var _0x31d439=_0x39e044?0x0:_0x558093[_0x4e72('0x1a')];var _0x35877c=_0x39e044?_0x20c339[_0x4e72('0x19')]:_0x558093[_0x4e72('0x1a')]+_0x558093[_0x4e72('0x1b')];var _0x766574;if(_0x35877c>=_0x1a4b14){_0x35877c=_0x1a4b14;_0x766574=0xc8;}else{_0x766574=0xce;}_0x4d8059[_0x4e72('0x16')](_0x766574);return _0x4d8059[_0x4e72('0x1c')](_0x4e72('0x1d'),_0x31d439+'-'+_0x35877c+'/'+_0x1a4b14)['json'](_0x20c339);}return null;};}function patchUpdates(_0x2faaaa){return function(_0x385bfe){try{jsonpatch[_0x4e72('0x1e')](_0x385bfe,_0x2faaaa,!![]);}catch(_0xaf237e){return BPromise[_0x4e72('0x1f')](_0xaf237e);}return _0x385bfe[_0x4e72('0x20')]();};}function saveUpdates(_0x45b2f6,_0x138ca8){return function(_0x5c8d6f){if(_0x5c8d6f){return _0x5c8d6f[_0x4e72('0x21')](_0x45b2f6)['then'](function(_0x2e72dc){return _0x2e72dc;});}return null;};}function removeEntity(_0x427b71,_0x3970a6){return function(_0x3e7e66){if(_0x3e7e66){return _0x3e7e66['destroy']()[_0x4e72('0x22')](function(){_0x427b71['status'](0xcc)[_0x4e72('0x17')]();});}};}function handleEntityNotFound(_0x427138,_0x2802fe){return function(_0x2779f9){if(!_0x2779f9){_0x427138[_0x4e72('0x15')](0x194);}return _0x2779f9;};}function handleError(_0x28c4da,_0xd9ea7d){_0xd9ea7d=_0xd9ea7d||0x1f4;return function(_0x1f1ea2){logger['error'](_0x1f1ea2[_0x4e72('0x23')]);if(_0x1f1ea2[_0x4e72('0x24')]){delete _0x1f1ea2[_0x4e72('0x24')];}_0x28c4da[_0x4e72('0x16')](_0xd9ea7d)[_0x4e72('0x25')](_0x1f1ea2);};}exports[_0x4e72('0x26')]=function(_0x2c59f4,_0x308de3){var _0xcb5a16={},_0xc76f84={},_0x495f29={'count':0x0,'rows':[]};var _0x3d3a21=_[_0x4e72('0x27')](db[_0x4e72('0x28')][_0x4e72('0x29')],function(_0x4a993d){return{'name':_0x4a993d[_0x4e72('0x2a')],'type':_0x4a993d[_0x4e72('0x2b')][_0x4e72('0x2c')]};});_0xc76f84[_0x4e72('0x2d')]=_[_0x4e72('0x27')](_0x3d3a21,_0x4e72('0x24'));_0xc76f84[_0x4e72('0x2e')]=_['keys'](_0x2c59f4[_0x4e72('0x2e')]);_0xc76f84[_0x4e72('0x2f')]=_[_0x4e72('0x30')](_0xc76f84[_0x4e72('0x2d')],_0xc76f84[_0x4e72('0x2e')]);_0xcb5a16['attributes']=_[_0x4e72('0x30')](_0xc76f84['model'],qs[_0x4e72('0x31')](_0x2c59f4[_0x4e72('0x2e')]['fields']));_0xcb5a16[_0x4e72('0x32')]=_0xcb5a16[_0x4e72('0x32')][_0x4e72('0x33')]?_0xcb5a16[_0x4e72('0x32')]:_0xc76f84[_0x4e72('0x2d')];if(!_0x2c59f4['query'][_0x4e72('0x34')](_0x4e72('0x35'))){_0xcb5a16[_0x4e72('0x1b')]=qs['limit'](_0x2c59f4[_0x4e72('0x2e')][_0x4e72('0x1b')]);_0xcb5a16['offset']=qs[_0x4e72('0x1a')](_0x2c59f4['query'][_0x4e72('0x1a')]);}_0xcb5a16[_0x4e72('0x36')]=qs[_0x4e72('0x37')](_0x2c59f4['query'][_0x4e72('0x37')]);_0xcb5a16['where']=qs[_0x4e72('0x2f')](_[_0x4e72('0x38')](_0x2c59f4[_0x4e72('0x2e')],_0xc76f84[_0x4e72('0x2f')]),_0x3d3a21);if(_0x2c59f4[_0x4e72('0x2e')][_0x4e72('0x39')]){_0xcb5a16[_0x4e72('0x3a')]=_[_0x4e72('0x3b')](_0xcb5a16['where'],{'$or':_[_0x4e72('0x27')](_0x3d3a21,function(_0x494810){if(_0x494810[_0x4e72('0x2b')]!=='VIRTUAL'){var _0x3d1046={};_0x3d1046[_0x494810['name']]={'$like':'%'+_0x2c59f4[_0x4e72('0x2e')][_0x4e72('0x39')]+'%'};return _0x3d1046;}})});}_0xcb5a16=_[_0x4e72('0x3b')]({},_0xcb5a16,_0x2c59f4['options']);var _0x4f428a={'where':_0xcb5a16[_0x4e72('0x3a')]};return db[_0x4e72('0x28')][_0x4e72('0x19')](_0x4f428a)[_0x4e72('0x22')](function(_0x582fc0){_0x495f29[_0x4e72('0x19')]=_0x582fc0;if(_0x2c59f4[_0x4e72('0x2e')][_0x4e72('0x3c')]){_0xcb5a16['include']=[{'all':!![]}];}return db[_0x4e72('0x28')][_0x4e72('0x3d')](_0xcb5a16);})[_0x4e72('0x22')](function(_0xef1936){_0x495f29[_0x4e72('0x3e')]=_0xef1936;return _0x495f29;})[_0x4e72('0x22')](respondWithFilteredResult(_0x308de3,_0xcb5a16))['catch'](handleError(_0x308de3,null));};exports['show']=function(_0x3080be,_0x50370c){var _0x3e23b8={'raw':!![],'where':{'id':_0x3080be[_0x4e72('0x3f')]['id']}},_0xd5e94f={};_0xd5e94f[_0x4e72('0x2d')]=_[_0x4e72('0x40')](db[_0x4e72('0x28')]['rawAttributes']);_0xd5e94f[_0x4e72('0x2e')]=_[_0x4e72('0x40')](_0x3080be['query']);_0xd5e94f[_0x4e72('0x2f')]=_[_0x4e72('0x30')](_0xd5e94f[_0x4e72('0x2d')],_0xd5e94f['query']);_0x3e23b8['attributes']=_[_0x4e72('0x30')](_0xd5e94f['model'],qs[_0x4e72('0x31')](_0x3080be[_0x4e72('0x2e')][_0x4e72('0x31')]));_0x3e23b8[_0x4e72('0x32')]=_0x3e23b8[_0x4e72('0x32')][_0x4e72('0x33')]?_0x3e23b8[_0x4e72('0x32')]:_0xd5e94f[_0x4e72('0x2d')];if(_0x3080be[_0x4e72('0x2e')][_0x4e72('0x3c')]){_0x3e23b8['include']=[{'all':!![]}];}_0x3e23b8=_['merge']({},_0x3e23b8,_0x3080be['options']);return db[_0x4e72('0x28')][_0x4e72('0x41')](_0x3e23b8)[_0x4e72('0x22')](handleEntityNotFound(_0x50370c,null))['then'](respondWithResult(_0x50370c,null))[_0x4e72('0x42')](handleError(_0x50370c,null));};exports[_0x4e72('0x43')]=function(_0x3b0459,_0x3bd3e3){return db[_0x4e72('0x28')]['create'](_0x3b0459[_0x4e72('0x44')],{})['then'](respondWithResult(_0x3bd3e3,0xc9))[_0x4e72('0x42')](handleError(_0x3bd3e3,null));};exports['update']=function(_0x5515ad,_0x4525b1){if(_0x5515ad['body']['id']){delete _0x5515ad[_0x4e72('0x44')]['id'];}return db[_0x4e72('0x28')][_0x4e72('0x41')]({'where':{'id':_0x5515ad[_0x4e72('0x3f')]['id']}})[_0x4e72('0x22')](handleEntityNotFound(_0x4525b1,null))[_0x4e72('0x22')](saveUpdates(_0x5515ad[_0x4e72('0x44')],null))['then'](respondWithResult(_0x4525b1,null))[_0x4e72('0x42')](handleError(_0x4525b1,null));};exports[_0x4e72('0x45')]=function(_0x28b0d6,_0x29467e){return db[_0x4e72('0x28')][_0x4e72('0x41')]({'where':{'id':_0x28b0d6[_0x4e72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29467e,null))[_0x4e72('0x22')](removeEntity(_0x29467e,null))[_0x4e72('0x42')](handleError(_0x29467e,null));};exports[_0x4e72('0x46')]=function(_0x5da57b,_0x343a69){return db['VoiceDialReport'][_0x4e72('0x46')]()['then'](respondWithResult(_0x343a69,null))[_0x4e72('0x42')](handleError(_0x343a69,null));};
\ No newline at end of file
+var _0x0883=['params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','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','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','status','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x106976,_0x6db9ca){var _0x1ee63b=function(_0x22e8c9){while(--_0x22e8c9){_0x106976['push'](_0x106976['shift']());}};_0x1ee63b(++_0x6db9ca);}(_0x0883,0x1c9));var _0x3088=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x0883[_0x200827];return _0x120047;};'use strict';var emlformat=require(_0x3088('0x0'));var rimraf=require(_0x3088('0x1'));var zipdir=require(_0x3088('0x2'));var jsonpatch=require(_0x3088('0x3'));var rp=require(_0x3088('0x4'));var moment=require(_0x3088('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3088('0x6'));var path=require(_0x3088('0x7'));var sox=require('sox');var csv=require(_0x3088('0x8'));var ejs=require(_0x3088('0x9'));var fs=require('fs');var fs_extra=require(_0x3088('0xa'));var _=require(_0x3088('0xb'));var squel=require('squel');var crypto=require(_0x3088('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3088('0xd'));var toCsv=require(_0x3088('0x8'));var querystring=require(_0x3088('0xe'));var Papa=require(_0x3088('0xf'));var Redis=require('ioredis');var authService=require(_0x3088('0x10'));var qs=require(_0x3088('0x11'));var as=require(_0x3088('0x12'));var hardwareService=require(_0x3088('0x13'));var logger=require(_0x3088('0x14'))('api');var utils=require(_0x3088('0x15'));var config=require(_0x3088('0x16'));var licenseUtil=require(_0x3088('0x17'));var db=require(_0x3088('0x18'))['db'];function respondWithStatusCode(_0x9c0911,_0x4931cb){_0x4931cb=_0x4931cb||0xcc;return function(_0x39a7fd){if(_0x39a7fd){return _0x9c0911[_0x3088('0x19')](_0x4931cb);}return _0x9c0911['status'](_0x4931cb)[_0x3088('0x1a')]();};}function respondWithResult(_0x388e30,_0x94bf55){_0x94bf55=_0x94bf55||0xc8;return function(_0x41d3ba){if(_0x41d3ba){return _0x388e30['status'](_0x94bf55)[_0x3088('0x1b')](_0x41d3ba);}};}function respondWithFilteredResult(_0x1f599f,_0x45b866){return function(_0x516c29){if(_0x516c29){var _0x27b41e=typeof _0x45b866[_0x3088('0x1c')]==='undefined'&&typeof _0x45b866[_0x3088('0x1d')]===_0x3088('0x1e');var _0xaf0b9e=_0x516c29['count'];var _0x1e3b64=_0x27b41e?0x0:_0x45b866[_0x3088('0x1c')];var _0x23cfb5=_0x27b41e?_0x516c29[_0x3088('0x1f')]:_0x45b866[_0x3088('0x1c')]+_0x45b866[_0x3088('0x1d')];var _0x184ee1;if(_0x23cfb5>=_0xaf0b9e){_0x23cfb5=_0xaf0b9e;_0x184ee1=0xc8;}else{_0x184ee1=0xce;}_0x1f599f['status'](_0x184ee1);return _0x1f599f[_0x3088('0x20')](_0x3088('0x21'),_0x1e3b64+'-'+_0x23cfb5+'/'+_0xaf0b9e)[_0x3088('0x1b')](_0x516c29);}return null;};}function patchUpdates(_0x4a7d8d){return function(_0x562b71){try{jsonpatch[_0x3088('0x22')](_0x562b71,_0x4a7d8d,!![]);}catch(_0x4654d9){return BPromise['reject'](_0x4654d9);}return _0x562b71[_0x3088('0x23')]();};}function saveUpdates(_0x14ace3,_0x23cf3e){return function(_0x2378cd){if(_0x2378cd){return _0x2378cd[_0x3088('0x24')](_0x14ace3)['then'](function(_0x1b6cfc){return _0x1b6cfc;});}return null;};}function removeEntity(_0x379ba4,_0x530e5a){return function(_0x59d39f){if(_0x59d39f){return _0x59d39f[_0x3088('0x25')]()[_0x3088('0x26')](function(){_0x379ba4[_0x3088('0x27')](0xcc)[_0x3088('0x1a')]();});}};}function handleEntityNotFound(_0xd777c6,_0x56e3a6){return function(_0x188ba8){if(!_0x188ba8){_0xd777c6[_0x3088('0x19')](0x194);}return _0x188ba8;};}function handleError(_0xc920c0,_0x2b5570){_0x2b5570=_0x2b5570||0x1f4;return function(_0x153632){logger[_0x3088('0x28')](_0x153632[_0x3088('0x29')]);if(_0x153632[_0x3088('0x2a')]){delete _0x153632[_0x3088('0x2a')];}_0xc920c0[_0x3088('0x27')](_0x2b5570)[_0x3088('0x2b')](_0x153632);};}exports[_0x3088('0x2c')]=function(_0x5145ef,_0x58b20f){var _0x3d6c64={},_0x51394a={},_0x57073a={'count':0x0,'rows':[]};var _0x13a628=_[_0x3088('0x2d')](db[_0x3088('0x2e')][_0x3088('0x2f')],function(_0x5d7d14){return{'name':_0x5d7d14['fieldName'],'type':_0x5d7d14[_0x3088('0x30')][_0x3088('0x31')]};});_0x51394a[_0x3088('0x32')]=_[_0x3088('0x2d')](_0x13a628,_0x3088('0x2a'));_0x51394a['query']=_['keys'](_0x5145ef[_0x3088('0x33')]);_0x51394a[_0x3088('0x34')]=_[_0x3088('0x35')](_0x51394a[_0x3088('0x32')],_0x51394a[_0x3088('0x33')]);_0x3d6c64[_0x3088('0x36')]=_['intersection'](_0x51394a[_0x3088('0x32')],qs[_0x3088('0x37')](_0x5145ef[_0x3088('0x33')][_0x3088('0x37')]));_0x3d6c64['attributes']=_0x3d6c64[_0x3088('0x36')]['length']?_0x3d6c64['attributes']:_0x51394a[_0x3088('0x32')];if(!_0x5145ef['query'][_0x3088('0x38')]('nolimit')){_0x3d6c64[_0x3088('0x1d')]=qs['limit'](_0x5145ef[_0x3088('0x33')][_0x3088('0x1d')]);_0x3d6c64[_0x3088('0x1c')]=qs[_0x3088('0x1c')](_0x5145ef[_0x3088('0x33')][_0x3088('0x1c')]);}_0x3d6c64[_0x3088('0x39')]=qs['sort'](_0x5145ef[_0x3088('0x33')][_0x3088('0x3a')]);_0x3d6c64[_0x3088('0x3b')]=qs['filters'](_['pick'](_0x5145ef['query'],_0x51394a[_0x3088('0x34')]),_0x13a628);if(_0x5145ef['query'][_0x3088('0x3c')]){_0x3d6c64[_0x3088('0x3b')]=_[_0x3088('0x3d')](_0x3d6c64[_0x3088('0x3b')],{'$or':_['map'](_0x13a628,function(_0x2068bd){if(_0x2068bd[_0x3088('0x30')]!==_0x3088('0x3e')){var _0x137d55={};_0x137d55[_0x2068bd[_0x3088('0x2a')]]={'$like':'%'+_0x5145ef[_0x3088('0x33')][_0x3088('0x3c')]+'%'};return _0x137d55;}})});}_0x3d6c64=_[_0x3088('0x3d')]({},_0x3d6c64,_0x5145ef[_0x3088('0x3f')]);var _0x1f6c14={'where':_0x3d6c64[_0x3088('0x3b')]};return db['VoiceDialReport'][_0x3088('0x1f')](_0x1f6c14)[_0x3088('0x26')](function(_0x4c1f11){_0x57073a[_0x3088('0x1f')]=_0x4c1f11;if(_0x5145ef[_0x3088('0x33')][_0x3088('0x40')]){_0x3d6c64['include']=[{'all':!![]}];}return db[_0x3088('0x2e')][_0x3088('0x41')](_0x3d6c64);})[_0x3088('0x26')](function(_0x332150){_0x57073a[_0x3088('0x42')]=_0x332150;return _0x57073a;})[_0x3088('0x26')](respondWithFilteredResult(_0x58b20f,_0x3d6c64))[_0x3088('0x43')](handleError(_0x58b20f,null));};exports['show']=function(_0x5dfc58,_0x44adf1){var _0xf35c2={'raw':!![],'where':{'id':_0x5dfc58[_0x3088('0x44')]['id']}},_0x47f25e={};_0x47f25e[_0x3088('0x32')]=_[_0x3088('0x45')](db['VoiceDialReport'][_0x3088('0x2f')]);_0x47f25e['query']=_['keys'](_0x5dfc58[_0x3088('0x33')]);_0x47f25e['filters']=_[_0x3088('0x35')](_0x47f25e[_0x3088('0x32')],_0x47f25e[_0x3088('0x33')]);_0xf35c2['attributes']=_[_0x3088('0x35')](_0x47f25e[_0x3088('0x32')],qs[_0x3088('0x37')](_0x5dfc58[_0x3088('0x33')][_0x3088('0x37')]));_0xf35c2[_0x3088('0x36')]=_0xf35c2['attributes'][_0x3088('0x46')]?_0xf35c2['attributes']:_0x47f25e[_0x3088('0x32')];if(_0x5dfc58[_0x3088('0x33')][_0x3088('0x40')]){_0xf35c2['include']=[{'all':!![]}];}_0xf35c2=_[_0x3088('0x3d')]({},_0xf35c2,_0x5dfc58[_0x3088('0x3f')]);return db[_0x3088('0x2e')][_0x3088('0x47')](_0xf35c2)[_0x3088('0x26')](handleEntityNotFound(_0x44adf1,null))[_0x3088('0x26')](respondWithResult(_0x44adf1,null))[_0x3088('0x43')](handleError(_0x44adf1,null));};exports[_0x3088('0x48')]=function(_0x5dd961,_0x342f69){return db[_0x3088('0x2e')][_0x3088('0x48')](_0x5dd961[_0x3088('0x49')],{})['then'](respondWithResult(_0x342f69,0xc9))[_0x3088('0x43')](handleError(_0x342f69,null));};exports[_0x3088('0x24')]=function(_0x54fbcc,_0xd94bf1){if(_0x54fbcc['body']['id']){delete _0x54fbcc[_0x3088('0x49')]['id'];}return db[_0x3088('0x2e')]['find']({'where':{'id':_0x54fbcc[_0x3088('0x44')]['id']}})[_0x3088('0x26')](handleEntityNotFound(_0xd94bf1,null))[_0x3088('0x26')](saveUpdates(_0x54fbcc[_0x3088('0x49')],null))['then'](respondWithResult(_0xd94bf1,null))[_0x3088('0x43')](handleError(_0xd94bf1,null));};exports[_0x3088('0x25')]=function(_0x59a411,_0x9bcf54){return db['VoiceDialReport'][_0x3088('0x47')]({'where':{'id':_0x59a411[_0x3088('0x44')]['id']}})[_0x3088('0x26')](handleEntityNotFound(_0x9bcf54,null))[_0x3088('0x26')](removeEntity(_0x9bcf54,null))[_0x3088('0x43')](handleError(_0x9bcf54,null));};exports[_0x3088('0x4a')]=function(_0x15de3d,_0x2331d5){return db[_0x3088('0x2e')][_0x3088('0x4a')]()['then'](respondWithResult(_0x2331d5,null))[_0x3088('0x43')](handleError(_0x2331d5,null));};
\ No newline at end of file
index 2da4c75..838bd88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3422=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','define','report_dial','uniqueid'];(function(_0xf01a76,_0x2e242e){var _0x3ecc8c=function(_0x3d56c0){while(--_0x3d56c0){_0xf01a76['push'](_0xf01a76['shift']());}};_0x3ecc8c(++_0x2e242e);}(_0x3422,0x118));var _0x2342=function(_0x18f279,_0x2d7a35){_0x18f279=_0x18f279-0x0;var _0x2cc87f=_0x3422[_0x18f279];return _0x2cc87f;};'use strict';var _=require(_0x2342('0x0'));var util=require(_0x2342('0x1'));var logger=require(_0x2342('0x2'))('api');var moment=require(_0x2342('0x3'));var BPromise=require(_0x2342('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2342('0x5'));var rimraf=require('rimraf');var config=require(_0x2342('0x6'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x196c13,_0x2f7ebd){return _0x196c13[_0x2342('0x7')]('VoiceDialReport',attributes,{'tableName':_0x2342('0x8'),'paranoid':![],'indexes':[{'fields':[_0x2342('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xec9d=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18d8cd,_0x32ba63){var _0x200b14=function(_0x746531){while(--_0x746531){_0x18d8cd['push'](_0x18d8cd['shift']());}};_0x200b14(++_0x32ba63);}(_0xec9d,0x6f));var _0xdec9=function(_0x3f335e,_0x435858){_0x3f335e=_0x3f335e-0x0;var _0x161fb0=_0xec9d[_0x3f335e];return _0x161fb0;};'use strict';var _=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var logger=require(_0xdec9('0x2'))('api');var moment=require(_0xdec9('0x3'));var BPromise=require(_0xdec9('0x4'));var rp=require(_0xdec9('0x5'));var fs=require('fs');var path=require(_0xdec9('0x6'));var rimraf=require(_0xdec9('0x7'));var config=require(_0xdec9('0x8'));var attributes=require(_0xdec9('0x9'));module[_0xdec9('0xa')]=function(_0x8adde0,_0x4cd0bf){return _0x8adde0[_0xdec9('0xb')](_0xdec9('0xc'),attributes,{'tableName':_0xdec9('0xd'),'paranoid':![],'indexes':[{'fields':[_0xdec9('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index b00890a..e97503e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x630a=['update','where','attributes','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport'];(function(_0x39941c,_0x4ad1bb){var _0x52d9c7=function(_0x4e107e){while(--_0x4e107e){_0x39941c['push'](_0x39941c['shift']());}};_0x52d9c7(++_0x4ad1bb);}(_0x630a,0xf2));var _0xa630=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x630a[_0x34021d];return _0x16597b;};'use strict';var _=require(_0xa630('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa630('0x1'));var rs=require(_0xa630('0x2'));var fs=require('fs');var Redis=require(_0xa630('0x3'));var db=require(_0xa630('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa630('0x5'))(_0xa630('0x6'));var config=require(_0xa630('0x7'));var jayson=require(_0xa630('0x8'));var client=jayson[_0xa630('0x9')][_0xa630('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18d2e7,_0x55d149,_0x59d23a){return new BPromise(function(_0x3d09d6,_0x418689){return client[_0xa630('0xb')](_0x18d2e7,_0x59d23a)[_0xa630('0xc')](function(_0xd97364){logger[_0xa630('0xd')](_0xa630('0xe'),_0x55d149,'request\x20sent');logger[_0xa630('0xf')](_0xa630('0x10'),_0x55d149,_0xa630('0x11'),JSON[_0xa630('0x12')](_0xd97364));if(_0xd97364['error']){if(_0xd97364[_0xa630('0x13')][_0xa630('0x14')]===0x1f4){logger[_0xa630('0x13')](_0xa630('0xe'),_0x55d149,_0xd97364[_0xa630('0x13')][_0xa630('0x15')]);return _0x418689(_0xd97364['error'][_0xa630('0x15')]);}logger[_0xa630('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x55d149,_0xd97364[_0xa630('0x13')][_0xa630('0x15')]);return _0x3d09d6(_0xd97364['error']['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x55d149,_0xa630('0x11'));_0x3d09d6(_0xd97364[_0xa630('0x16')]['message']);}})['catch'](function(_0x51735b){logger[_0xa630('0x13')](_0xa630('0xe'),_0x55d149,_0x51735b);_0x418689(_0x51735b);});});}exports[_0xa630('0x17')]=function(_0x5ccf5b){var _0x387e82=this;return new Promise(function(_0x359fd7,_0x3fbc89){return db[_0xa630('0x18')][_0xa630('0x19')](_0x5ccf5b[_0xa630('0x1a')],{'raw':_0x5ccf5b[_0xa630('0x1b')]?_0x5ccf5b['options'][_0xa630('0x1c')]===undefined?!![]:![]:!![]})[_0xa630('0xc')](function(_0x4ab9bc){logger[_0xa630('0xd')](_0xa630('0x17'),_0x5ccf5b);logger[_0xa630('0xf')]('CreateVoiceDialReport',_0x5ccf5b,JSON[_0xa630('0x12')](_0x4ab9bc));_0x359fd7(_0x4ab9bc);})['catch'](function(_0x1acaea){logger['error'](_0xa630('0x17'),_0x1acaea[_0xa630('0x15')],_0x5ccf5b);_0x3fbc89(_0x387e82[_0xa630('0x13')](0x1f4,_0x1acaea[_0xa630('0x15')]));});});};exports[_0xa630('0x1d')]=function(_0x55e5ea){var _0x3f656e=this;return new Promise(function(_0x54c994,_0x9196d0){return db[_0xa630('0x18')][_0xa630('0x1e')](_0x55e5ea[_0xa630('0x1a')],{'raw':_0x55e5ea[_0xa630('0x1b')]?_0x55e5ea['options'][_0xa630('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e5ea[_0xa630('0x1b')]?_0x55e5ea['options'][_0xa630('0x1f')]||null:null,'attributes':_0x55e5ea[_0xa630('0x1b')]?_0x55e5ea[_0xa630('0x1b')][_0xa630('0x20')]||null:null,'limit':_0x55e5ea['options']?_0x55e5ea[_0xa630('0x1b')]['limit']||null:null})['then'](function(_0x4787b1){logger[_0xa630('0xd')](_0xa630('0x1d'),_0x55e5ea);logger[_0xa630('0xf')]('UpdateVoiceDialReport',_0x55e5ea,JSON['stringify'](_0x4787b1));_0x54c994(_0x4787b1);})[_0xa630('0x21')](function(_0x35a0a4){logger[_0xa630('0x13')]('UpdateVoiceDialReport',_0x35a0a4[_0xa630('0x15')],_0x55e5ea);_0x9196d0(_0x3f656e['error'](0x1f4,_0x35a0a4[_0xa630('0x15')]));});});};
\ No newline at end of file
+var _0x2774=['../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','then','UpdateVoiceDialReport','update','raw','where','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2eced1,_0x3660be){var _0x135941=function(_0x1b7b70){while(--_0x1b7b70){_0x2eced1['push'](_0x2eced1['shift']());}};_0x135941(++_0x3660be);}(_0x2774,0x103));var _0x4277=function(_0x31b62b,_0x547c8e){_0x31b62b=_0x31b62b-0x0;var _0xe99256=_0x2774[_0x31b62b];return _0xe99256;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4277('0x0'));var rs=require(_0x4277('0x1'));var fs=require('fs');var Redis=require(_0x4277('0x2'));var db=require(_0x4277('0x3'))['db'];var utils=require(_0x4277('0x4'));var logger=require(_0x4277('0x5'))('rpc');var config=require(_0x4277('0x6'));var jayson=require(_0x4277('0x7'));var client=jayson[_0x4277('0x8')][_0x4277('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33b449,_0x203321,_0x178f8f){return new BPromise(function(_0x38f7f2,_0xa97f22){return client['request'](_0x33b449,_0x178f8f)['then'](function(_0x4e1496){logger[_0x4277('0xa')](_0x4277('0xb'),_0x203321,_0x4277('0xc'));logger[_0x4277('0xd')](_0x4277('0xe'),_0x203321,_0x4277('0xc'),JSON[_0x4277('0xf')](_0x4e1496));if(_0x4e1496['error']){if(_0x4e1496[_0x4277('0x10')][_0x4277('0x11')]===0x1f4){logger[_0x4277('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x203321,_0x4e1496['error'][_0x4277('0x12')]);return _0xa97f22(_0x4e1496[_0x4277('0x10')][_0x4277('0x12')]);}logger[_0x4277('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x203321,_0x4e1496[_0x4277('0x10')][_0x4277('0x12')]);return _0x38f7f2(_0x4e1496[_0x4277('0x10')][_0x4277('0x12')]);}else{logger[_0x4277('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x203321,_0x4277('0xc'));_0x38f7f2(_0x4e1496[_0x4277('0x13')][_0x4277('0x12')]);}})[_0x4277('0x14')](function(_0x5d4d16){logger[_0x4277('0x10')](_0x4277('0xb'),_0x203321,_0x5d4d16);_0xa97f22(_0x5d4d16);});});}exports[_0x4277('0x15')]=function(_0x2c83dc){var _0x35ac3e=this;return new Promise(function(_0x63ad57,_0x51e7b8){return db[_0x4277('0x16')][_0x4277('0x17')](_0x2c83dc[_0x4277('0x18')],{'raw':_0x2c83dc[_0x4277('0x19')]?_0x2c83dc['options']['raw']===undefined?!![]:![]:!![]})[_0x4277('0x1a')](function(_0x42d6a8){logger[_0x4277('0xa')](_0x4277('0x15'),_0x2c83dc);logger['debug'](_0x4277('0x15'),_0x2c83dc,JSON[_0x4277('0xf')](_0x42d6a8));_0x63ad57(_0x42d6a8);})[_0x4277('0x14')](function(_0x205d82){logger[_0x4277('0x10')](_0x4277('0x15'),_0x205d82[_0x4277('0x12')],_0x2c83dc);_0x51e7b8(_0x35ac3e['error'](0x1f4,_0x205d82['message']));});});};exports[_0x4277('0x1b')]=function(_0x2086e9){var _0x262d24=this;return new Promise(function(_0x16178c,_0x30c133){return db[_0x4277('0x16')][_0x4277('0x1c')](_0x2086e9[_0x4277('0x18')],{'raw':_0x2086e9[_0x4277('0x19')]?_0x2086e9['options'][_0x4277('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2086e9['options']?_0x2086e9[_0x4277('0x19')][_0x4277('0x1e')]||null:null,'attributes':_0x2086e9[_0x4277('0x19')]?_0x2086e9[_0x4277('0x19')][_0x4277('0x1f')]||null:null,'limit':_0x2086e9[_0x4277('0x19')]?_0x2086e9[_0x4277('0x19')][_0x4277('0x20')]||null:null})[_0x4277('0x1a')](function(_0x2b2512){logger['info']('UpdateVoiceDialReport',_0x2086e9);logger[_0x4277('0xd')](_0x4277('0x1b'),_0x2086e9,JSON[_0x4277('0xf')](_0x2b2512));_0x16178c(_0x2b2512);})['catch'](function(_0x253cea){logger[_0x4277('0x10')](_0x4277('0x1b'),_0x253cea[_0x4277('0x12')],_0x2086e9);_0x30c133(_0x262d24[_0x4277('0x10')](0x1f4,_0x253cea[_0x4277('0x12')]));});});};
\ No newline at end of file
index ddce611..29e4706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32a4=['post','create','addApplications','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','show'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x32a4,0x1d4));var _0x432a=function(_0x4c7de1,_0x3f7bef){_0x4c7de1=_0x4c7de1-0x0;var _0x3f1864=_0x32a4[_0x4c7de1];return _0x3f1864;};'use strict';var multer=require(_0x432a('0x0'));var util=require(_0x432a('0x1'));var path=require(_0x432a('0x2'));var timeout=require(_0x432a('0x3'));var express=require(_0x432a('0x4'));var router=express[_0x432a('0x5')]();var fs_extra=require(_0x432a('0x6'));var auth=require(_0x432a('0x7'));var interaction=require(_0x432a('0x8'));var config=require(_0x432a('0x9'));var controller=require(_0x432a('0xa'));router['get']('/',auth[_0x432a('0xb')](),controller[_0x432a('0xc')]);router[_0x432a('0xd')]('/:id',auth[_0x432a('0xb')](),controller[_0x432a('0xe')]);router[_0x432a('0xf')]('/',auth[_0x432a('0xb')](),controller[_0x432a('0x10')]);router['post']('/:id/applications',auth[_0x432a('0xb')](),controller[_0x432a('0x11')]);router[_0x432a('0x12')](_0x432a('0x13'),auth[_0x432a('0xb')](),controller['update']);router[_0x432a('0x14')]('/:id',auth[_0x432a('0xb')](),controller[_0x432a('0x15')]);module[_0x432a('0x16')]=router;
\ No newline at end of file
+var _0xf44d=['post','addApplications','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x1cbc01,_0x59338f){var _0x1e3743=function(_0x5e9484){while(--_0x5e9484){_0x1cbc01['push'](_0x1cbc01['shift']());}};_0x1e3743(++_0x59338f);}(_0xf44d,0x15d));var _0xdf44=function(_0x39ab3a,_0x491cb2){_0x39ab3a=_0x39ab3a-0x0;var _0x963dfe=_0xf44d[_0x39ab3a];return _0x963dfe;};'use strict';var multer=require(_0xdf44('0x0'));var util=require('util');var path=require(_0xdf44('0x1'));var timeout=require(_0xdf44('0x2'));var express=require(_0xdf44('0x3'));var router=express[_0xdf44('0x4')]();var fs_extra=require(_0xdf44('0x5'));var auth=require(_0xdf44('0x6'));var interaction=require(_0xdf44('0x7'));var config=require(_0xdf44('0x8'));var controller=require(_0xdf44('0x9'));router[_0xdf44('0xa')]('/',auth[_0xdf44('0xb')](),controller['index']);router[_0xdf44('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdf44('0xc')]('/',auth[_0xdf44('0xb')](),controller['create']);router['post']('/:id/applications',auth[_0xdf44('0xb')](),controller[_0xdf44('0xd')]);router[_0xdf44('0xe')](_0xdf44('0xf'),auth[_0xdf44('0xb')](),controller[_0xdf44('0x10')]);router[_0xdf44('0x11')](_0xdf44('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xdf44('0x12')]=router;
\ No newline at end of file
index 9845521..88010b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed69=['inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM'];(function(_0x51046a,_0xd61b8b){var _0x5b2811=function(_0x5bc3d0){while(--_0x5bc3d0){_0x51046a['push'](_0x51046a['shift']());}};_0x5b2811(++_0xd61b8b);}(_0xed69,0xf7));var _0x9ed6=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xed69[_0x474d97];return _0x1edf25;};'use strict';var Sequelize=require(_0x9ed6('0x0'));module[_0x9ed6('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ed6('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x9ed6('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x9ed6('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x9ed6('0x4')](_0x9ed6('0x5'),'outbound',_0x9ed6('0x6'),_0x9ed6('0x7'),_0x9ed6('0x8'),_0x9ed6('0x9'),_0x9ed6('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x9ed6('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9ed6('0xb')},'IntervalId':{'type':Sequelize[_0x9ed6('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x9ed6('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x9ed6('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x9ed6('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x9ed6('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x9ed6('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x9ed6('0xf')],'get':function(_0x34adf3){return this[_0x9ed6('0x10')](_0x9ed6('0x11'));}},'alias':{'type':Sequelize[_0x9ed6('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0x9877=['VIRTUAL','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x27c4ca,_0x4f70a6){var _0x138c8c=function(_0x463ac4){while(--_0x463ac4){_0x27c4ca['push'](_0x27c4ca['shift']());}};_0x138c8c(++_0x4f70a6);}(_0x9877,0x131));var _0x7987=function(_0x36143b,_0x5991cb){_0x36143b=_0x36143b-0x0;var _0x1f6089=_0x9877[_0x36143b];return _0x1f6089;};'use strict';var Sequelize=require(_0x7987('0x0'));module['exports']={'context':{'type':Sequelize[_0x7987('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7987('0x1')],'allowNull':![],'unique':_0x7987('0x2')},'priority':{'type':Sequelize[_0x7987('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x7987('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7987('0x1')],'allowNull':![],'defaultValue':_0x7987('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7987('0x4')](_0x7987('0x5'),_0x7987('0x6'),'internal',_0x7987('0x7'),_0x7987('0x8'),_0x7987('0x9'),_0x7987('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x7987('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7987('0xb')},'IntervalId':{'type':Sequelize[_0x7987('0xc')]},'isApp':{'type':Sequelize[_0x7987('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7987('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7987('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7987('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7987('0xc')]},'recordingFormat':{'type':Sequelize[_0x7987('0x1')],'defaultValue':_0x7987('0xe')},'answer':{'type':Sequelize[_0x7987('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7987('0xf')],'get':function(_0x5dcad7){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x7987('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 26bbfdc..9180e8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63f0=['inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','VoiceExtension','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','length','includeAll','catch','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','toLowerCase','true','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','get','InboundRoutes'];(function(_0x2aad72,_0x4a860a){var _0x5201ef=function(_0x40b42a){while(--_0x40b42a){_0x2aad72['push'](_0x2aad72['shift']());}};_0x5201ef(++_0x4a860a);}(_0x63f0,0x1a9));var _0x063f=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x63f0[_0x99868f];return _0x27a71b;};'use strict';var emlformat=require(_0x063f('0x0'));var rimraf=require(_0x063f('0x1'));var zipdir=require(_0x063f('0x2'));var jsonpatch=require(_0x063f('0x3'));var rp=require(_0x063f('0x4'));var moment=require(_0x063f('0x5'));var BPromise=require(_0x063f('0x6'));var Mustache=require(_0x063f('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x063f('0x8'));var ejs=require(_0x063f('0x9'));var fs=require('fs');var fs_extra=require(_0x063f('0xa'));var _=require(_0x063f('0xb'));var squel=require('squel');var crypto=require(_0x063f('0xc'));var jsforce=require(_0x063f('0xd'));var deskjs=require(_0x063f('0xe'));var toCsv=require(_0x063f('0x8'));var querystring=require(_0x063f('0xf'));var Papa=require(_0x063f('0x10'));var Redis=require('ioredis');var authService=require(_0x063f('0x11'));var qs=require(_0x063f('0x12'));var as=require(_0x063f('0x13'));var hardwareService=require(_0x063f('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x063f('0x15'))['db'];config[_0x063f('0x16')]=_[_0x063f('0x17')](config[_0x063f('0x16')],{'host':_0x063f('0x18'),'port':0x18eb});var socket=require(_0x063f('0x19'))(new Redis(config['redis']));require(_0x063f('0x1a'))['register'](socket);function respondWithStatusCode(_0x2c4661,_0x188e14){_0x188e14=_0x188e14||0xcc;return function(_0x29efad){if(_0x29efad){return _0x2c4661[_0x063f('0x1b')](_0x188e14);}return _0x2c4661[_0x063f('0x1c')](_0x188e14)[_0x063f('0x1d')]();};}function respondWithResult(_0x515ccb,_0x115ff0){_0x115ff0=_0x115ff0||0xc8;return function(_0x16d7b0){if(_0x16d7b0){return _0x515ccb['status'](_0x115ff0)[_0x063f('0x1e')](_0x16d7b0);}};}function respondWithFilteredResult(_0x15f2c0,_0x5ba167){return function(_0x867b23){if(_0x867b23){var _0x4a246b=typeof _0x5ba167['offset']==='undefined'&&typeof _0x5ba167[_0x063f('0x1f')]===_0x063f('0x20');var _0x2831a5=_0x867b23[_0x063f('0x21')];var _0x1197c1=_0x4a246b?0x0:_0x5ba167[_0x063f('0x22')];var _0xd87512=_0x4a246b?_0x867b23['count']:_0x5ba167[_0x063f('0x22')]+_0x5ba167[_0x063f('0x1f')];var _0x403fe2;if(_0xd87512>=_0x2831a5){_0xd87512=_0x2831a5;_0x403fe2=0xc8;}else{_0x403fe2=0xce;}_0x15f2c0[_0x063f('0x1c')](_0x403fe2);return _0x15f2c0[_0x063f('0x23')](_0x063f('0x24'),_0x1197c1+'-'+_0xd87512+'/'+_0x2831a5)['json'](_0x867b23);}return null;};}function patchUpdates(_0x474018){return function(_0x330bbb){try{jsonpatch[_0x063f('0x25')](_0x330bbb,_0x474018,!![]);}catch(_0x20f80c){return BPromise[_0x063f('0x26')](_0x20f80c);}return _0x330bbb[_0x063f('0x27')]();};}function saveUpdates(_0x45a415,_0x4d01d5){return function(_0x2787e8){if(_0x2787e8){return _0x2787e8['update'](_0x45a415)[_0x063f('0x28')](function(_0x30ecf3){return _0x30ecf3;});}return null;};}function removeEntity(_0x28888d,_0x256d52){return function(_0x35ecd1){if(_0x35ecd1){return _0x35ecd1['destroy']()[_0x063f('0x28')](function(){var _0x5039b1=_0x35ecd1[_0x063f('0x29')]({'plain':!![]});var _0x44f8c7=[{'name':_0x063f('0x2a'),'value':_0x063f('0x2b'),'ignore':![]},{'name':_0x063f('0x2c'),'value':_0x063f('0x2d'),'ignore':![]},{'name':_0x063f('0x2e'),'value':_0x063f('0x2f'),'ignore':![]}];var _0x4f49b8=_(_0x44f8c7)['filter'](_0x063f('0x30'))[_0x063f('0x31')]('value')[_0x063f('0x32')]();if(_[_0x063f('0x33')](_0x4f49b8,_0x5039b1[_0x063f('0x34')])){return;}var _0xe643f3=_[_0x063f('0x35')](_0x44f8c7,[_0x063f('0x32'),_0x5039b1['type']])[_0x063f('0x36')];return db[_0x063f('0x37')][_0x063f('0x38')]({'where':{'type':_0xe643f3,'resourceId':_0x5039b1['id']}})[_0x063f('0x28')](function(){return _0x35ecd1;});})[_0x063f('0x28')](function(){_0x28888d['status'](0xcc)[_0x063f('0x1d')]();});}};}function handleEntityNotFound(_0x1bc85c,_0x3411fc){return function(_0x129554){if(!_0x129554){_0x1bc85c[_0x063f('0x1b')](0x194);}return _0x129554;};}function handleError(_0x462021,_0x156f30){_0x156f30=_0x156f30||0x1f4;return function(_0x3dcaba){logger[_0x063f('0x39')](_0x3dcaba[_0x063f('0x3a')]);if(_0x3dcaba[_0x063f('0x36')]){delete _0x3dcaba[_0x063f('0x36')];}_0x462021['status'](_0x156f30)[_0x063f('0x3b')](_0x3dcaba);};}exports[_0x063f('0x3c')]=function(_0x32a6e7,_0x39a290){var _0x3cbd64={},_0xa81ce5={},_0x1663e8={'count':0x0,'rows':[]};var _0x3c69d8=_[_0x063f('0x31')](db[_0x063f('0x3d')]['rawAttributes'],function(_0x33f1d6){return{'name':_0x33f1d6[_0x063f('0x3e')],'type':_0x33f1d6[_0x063f('0x34')][_0x063f('0x3f')]};});_0xa81ce5[_0x063f('0x40')]=_[_0x063f('0x31')](_0x3c69d8,_0x063f('0x36'));_0xa81ce5[_0x063f('0x41')]=_['keys'](_0x32a6e7[_0x063f('0x41')]);_0xa81ce5['filters']=_['intersection'](_0xa81ce5[_0x063f('0x40')],_0xa81ce5[_0x063f('0x41')]);_0x3cbd64[_0x063f('0x42')]=_[_0x063f('0x43')](_0xa81ce5[_0x063f('0x40')],qs[_0x063f('0x44')](_0x32a6e7['query']['fields']));_0x3cbd64['attributes']=_0x3cbd64[_0x063f('0x42')]['length']?_0x3cbd64[_0x063f('0x42')]:_0xa81ce5[_0x063f('0x40')];if(!_0x32a6e7[_0x063f('0x41')][_0x063f('0x45')](_0x063f('0x46'))){_0x3cbd64[_0x063f('0x1f')]=qs['limit'](_0x32a6e7[_0x063f('0x41')][_0x063f('0x1f')]);_0x3cbd64['offset']=qs[_0x063f('0x22')](_0x32a6e7[_0x063f('0x41')][_0x063f('0x22')]);}_0x3cbd64[_0x063f('0x47')]=qs['sort'](_0x32a6e7[_0x063f('0x41')][_0x063f('0x48')]);_0x3cbd64[_0x063f('0x49')]=qs[_0x063f('0x4a')](_[_0x063f('0x4b')](_0x32a6e7[_0x063f('0x41')],_0xa81ce5[_0x063f('0x4a')]),_0x3c69d8);if(_0x32a6e7['query'][_0x063f('0x4c')]){_0x3cbd64[_0x063f('0x49')]=_[_0x063f('0x4d')](_0x3cbd64[_0x063f('0x49')],{'$or':_['map'](_0x3c69d8,function(_0x48705f){if(_0x48705f[_0x063f('0x34')]!==_0x063f('0x4e')){var _0x5d98c3={};_0x5d98c3[_0x48705f[_0x063f('0x36')]]={'$like':'%'+_0x32a6e7['query']['filter']+'%'};return _0x5d98c3;}})});}_0x3cbd64=_[_0x063f('0x4d')]({},_0x3cbd64,_0x32a6e7[_0x063f('0x4f')]);var _0xabf9a0={'where':_0x3cbd64['where']};return db[_0x063f('0x3d')][_0x063f('0x21')](_0xabf9a0)[_0x063f('0x28')](function(_0x411b9f){_0x1663e8['count']=_0x411b9f;if(_0x32a6e7['query']['includeAll']){_0x3cbd64[_0x063f('0x50')]=[{'all':!![]}];}return db['VoiceExtension'][_0x063f('0x51')](_0x3cbd64);})['then'](function(_0x27dfe1){_0x1663e8[_0x063f('0x52')]=_0x27dfe1;return _0x1663e8;})[_0x063f('0x28')](respondWithFilteredResult(_0x39a290,_0x3cbd64))['catch'](handleError(_0x39a290,null));};exports[_0x063f('0x53')]=function(_0xdfcea1,_0x100975){var _0x35f182={'raw':![],'where':{'id':_0xdfcea1[_0x063f('0x54')]['id']}},_0x421e01={};_0x421e01['model']=_[_0x063f('0x55')](db[_0x063f('0x3d')][_0x063f('0x56')]);_0x421e01[_0x063f('0x41')]=_['keys'](_0xdfcea1[_0x063f('0x41')]);_0x421e01[_0x063f('0x4a')]=_[_0x063f('0x43')](_0x421e01[_0x063f('0x40')],_0x421e01[_0x063f('0x41')]);_0x35f182[_0x063f('0x42')]=_[_0x063f('0x43')](_0x421e01['model'],qs['fields'](_0xdfcea1['query'][_0x063f('0x44')]));_0x35f182['attributes']=_0x35f182['attributes'][_0x063f('0x57')]?_0x35f182[_0x063f('0x42')]:_0x421e01[_0x063f('0x40')];if(_0xdfcea1['query'][_0x063f('0x58')]){_0x35f182['include']=[{'all':!![]}];}_0x35f182=_['merge']({},_0x35f182,_0xdfcea1[_0x063f('0x4f')]);return db['VoiceExtension'][_0x063f('0x35')](_0x35f182)[_0x063f('0x28')](handleEntityNotFound(_0x100975,null))['then'](respondWithResult(_0x100975,null))[_0x063f('0x59')](handleError(_0x100975,null));};exports[_0x063f('0x38')]=function(_0x1fd3f0,_0xe3f6d0){return db[_0x063f('0x3d')][_0x063f('0x35')]({'where':{'id':_0x1fd3f0['params']['id']}})[_0x063f('0x28')](handleEntityNotFound(_0xe3f6d0,null))[_0x063f('0x28')](removeEntity(_0xe3f6d0,null))[_0x063f('0x59')](handleError(_0xe3f6d0,null));};exports[_0x063f('0x5a')]=function(_0x38f634,_0x4ecd62){if(_0x38f634['body'][_0x063f('0x34')]===_0x063f('0x2d')&&!_[_0x063f('0x5b')](_0x38f634[_0x063f('0x5c')][_0x063f('0x5d')],'_')){_0x38f634[_0x063f('0x5c')][_0x063f('0x5d')]='_'[_0x063f('0x5e')](_0x38f634['body'][_0x063f('0x5d')]);}return db[_0x063f('0x3d')]['create'](_0x38f634[_0x063f('0x5c')],{'raw':![]})[_0x063f('0x28')](function(_0x2da5e4){var _0x30830e=_0x38f634[_0x063f('0x5f')][_0x063f('0x29')]({'plain':!![]});if(!_0x30830e)throw new Error(_0x063f('0x60'));if(_0x30830e[_0x063f('0x61')]===_0x063f('0x5f')){var _0x4b9f2d=_0x2da5e4[_0x063f('0x29')]({'plain':!![]});var _0x34ec06=[{'name':_0x063f('0x2a'),'value':_0x063f('0x2b')},{'name':_0x063f('0x2c'),'value':_0x063f('0x2d')},{'name':_0x063f('0x2e'),'value':'internal'}];var _0x7cb7c0=_[_0x063f('0x35')](_0x34ec06,[_0x063f('0x32'),_0x4b9f2d[_0x063f('0x34')]])[_0x063f('0x36')];return db[_0x063f('0x62')]['find']({'where':{'name':_0x7cb7c0,'userProfileId':_0x30830e[_0x063f('0x63')]},'raw':!![]})[_0x063f('0x28')](function(_0x25b7f8){if(_0x25b7f8&&_0x25b7f8[_0x063f('0x64')]===0x0){return db[_0x063f('0x37')]['create']({'name':_0x4b9f2d[_0x063f('0x36')],'resourceId':_0x4b9f2d['id'],'type':_0x25b7f8[_0x063f('0x36')],'sectionId':_0x25b7f8['id']},{})[_0x063f('0x28')](function(){return _0x2da5e4;});}else{return _0x2da5e4;}})['catch'](function(_0x5f0def){logger[_0x063f('0x39')](_0x063f('0x65'),_0x5f0def);throw _0x5f0def;});}return _0x2da5e4;})['then'](respondWithResult(_0x4ecd62,0xc9))[_0x063f('0x59')](handleError(_0x4ecd62,null));};exports[_0x063f('0x66')]=function(_0x48cc99,_0x44836b){if(_0x48cc99[_0x063f('0x5c')]['id']){delete _0x48cc99[_0x063f('0x5c')]['id'];}return db[_0x063f('0x3d')][_0x063f('0x35')]({'where':{'id':_0x48cc99[_0x063f('0x54')]['id']}})['then'](handleEntityNotFound(_0x44836b,null))[_0x063f('0x28')](function(_0x3e6518){if(_0x3e6518){return db[_0x063f('0x3d')][_0x063f('0x66')](_['pick'](_0x48cc99['body'],[_0x063f('0x5d'),'context',_0x063f('0x67'),'recordingFormat',_0x063f('0x68'),_0x063f('0x69'),_0x063f('0x6a')]),{'where':{'context':_0x3e6518['context'],'exten':_0x3e6518[_0x063f('0x5d')]},'individualHooks':!![]})['then'](function(_0x5e63b7){return _0x5e63b7;});}return null;})['then'](respondWithStatusCode(_0x44836b,null))[_0x063f('0x59')](handleError(_0x44836b,null));};exports[_0x063f('0x6b')]=function(_0x3ff4df,_0x4ed16b){return db['VoiceExtension'][_0x063f('0x6c')]({'where':{'id':_0x3ff4df[_0x063f('0x54')]['id']}})[_0x063f('0x28')](function(_0x404f43){if(_0x404f43){return db[_0x063f('0x6d')][_0x063f('0x6e')](function(_0x497926){return db[_0x063f('0x3d')][_0x063f('0x38')]({'where':{'VoiceExtensionId':_0x3ff4df[_0x063f('0x54')]['id']},'transaction':_0x497926})[_0x063f('0x28')](function(){var _0x11bd2f=_[_0x063f('0x31')](_0x3ff4df[_0x063f('0x5c')],function(_0xb51e8a){_0xb51e8a[_0x063f('0x6f')]=_0x3ff4df[_0x063f('0x54')]['id'];_0xb51e8a['isApp']=!![];return _0xb51e8a;});var _0xef99f3=_0x3ff4df[_0x063f('0x41')][_0x063f('0x70')]&&_0x3ff4df[_0x063f('0x41')][_0x063f('0x70')][_0x063f('0x71')]()===_0x063f('0x72')?!![]:![];return _0x404f43['createRouting'](_0x11bd2f,_0xef99f3);})[_0x063f('0x28')](function(_0x28b901){return db[_0x063f('0x3d')][_0x063f('0x73')](_0x28b901,{'transaction':_0x497926});});})[_0x063f('0x28')](function(){return db[_0x063f('0x3d')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x3ff4df[_0x063f('0x54')]['id']},'order':_0x063f('0x74')});});}})[_0x063f('0x28')](respondWithResult(_0x4ed16b,null))[_0x063f('0x59')](handleError(_0x4ed16b,null));};
\ No newline at end of file
+var _0xd73e=['limit','count','offset','set','Content-Range','reject','update','then','destroy','inbound','OutboundRoutes','outbound','internal','ignore','map','value','find','type','error','stack','name','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','include','create','body','startsWith','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','InternalRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','cast(priority\x20as\x20unsigned)','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voiceExtension.socket','register','sendStatus','status','end','json','undefined'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0xd73e,0xc1));var _0xed73=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd73e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed73('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed73('0x1'));var rp=require(_0xed73('0x2'));var moment=require(_0xed73('0x3'));var BPromise=require(_0xed73('0x4'));var Mustache=require(_0xed73('0x5'));var util=require(_0xed73('0x6'));var path=require(_0xed73('0x7'));var sox=require(_0xed73('0x8'));var csv=require('to-csv');var ejs=require(_0xed73('0x9'));var fs=require('fs');var fs_extra=require(_0xed73('0xa'));var _=require(_0xed73('0xb'));var squel=require(_0xed73('0xc'));var crypto=require(_0xed73('0xd'));var jsforce=require(_0xed73('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xed73('0xf'));var querystring=require(_0xed73('0x10'));var Papa=require(_0xed73('0x11'));var Redis=require(_0xed73('0x12'));var authService=require(_0xed73('0x13'));var qs=require(_0xed73('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed73('0x15'));var logger=require(_0xed73('0x16'))(_0xed73('0x17'));var utils=require(_0xed73('0x18'));var config=require(_0xed73('0x19'));var licenseUtil=require(_0xed73('0x1a'));var db=require(_0xed73('0x1b'))['db'];config[_0xed73('0x1c')]=_[_0xed73('0x1d')](config[_0xed73('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xed73('0x1e'))[_0xed73('0x1f')](socket);function respondWithStatusCode(_0x171e65,_0x18c7f0){_0x18c7f0=_0x18c7f0||0xcc;return function(_0x5b4588){if(_0x5b4588){return _0x171e65[_0xed73('0x20')](_0x18c7f0);}return _0x171e65[_0xed73('0x21')](_0x18c7f0)[_0xed73('0x22')]();};}function respondWithResult(_0x388ac5,_0x68c78a){_0x68c78a=_0x68c78a||0xc8;return function(_0x1738d8){if(_0x1738d8){return _0x388ac5['status'](_0x68c78a)[_0xed73('0x23')](_0x1738d8);}};}function respondWithFilteredResult(_0x32c3a4,_0x6320ad){return function(_0x42bb9a){if(_0x42bb9a){var _0x1f9f36=typeof _0x6320ad['offset']===_0xed73('0x24')&&typeof _0x6320ad[_0xed73('0x25')]==='undefined';var _0x3202af=_0x42bb9a[_0xed73('0x26')];var _0x9ca437=_0x1f9f36?0x0:_0x6320ad['offset'];var _0x10f29a=_0x1f9f36?_0x42bb9a[_0xed73('0x26')]:_0x6320ad[_0xed73('0x27')]+_0x6320ad[_0xed73('0x25')];var _0x281be2;if(_0x10f29a>=_0x3202af){_0x10f29a=_0x3202af;_0x281be2=0xc8;}else{_0x281be2=0xce;}_0x32c3a4[_0xed73('0x21')](_0x281be2);return _0x32c3a4[_0xed73('0x28')](_0xed73('0x29'),_0x9ca437+'-'+_0x10f29a+'/'+_0x3202af)[_0xed73('0x23')](_0x42bb9a);}return null;};}function patchUpdates(_0x316b45){return function(_0xec99cf){try{jsonpatch['apply'](_0xec99cf,_0x316b45,!![]);}catch(_0x3bf458){return BPromise[_0xed73('0x2a')](_0x3bf458);}return _0xec99cf['save']();};}function saveUpdates(_0x13edb7,_0x446ab6){return function(_0x4f3a8f){if(_0x4f3a8f){return _0x4f3a8f[_0xed73('0x2b')](_0x13edb7)[_0xed73('0x2c')](function(_0x32d3bc){return _0x32d3bc;});}return null;};}function removeEntity(_0x4c8fff,_0x5c49a4){return function(_0x384aa3){if(_0x384aa3){return _0x384aa3[_0xed73('0x2d')]()[_0xed73('0x2c')](function(){var _0x2367cf=_0x384aa3['get']({'plain':!![]});var _0x4f191d=[{'name':'InboundRoutes','value':_0xed73('0x2e'),'ignore':![]},{'name':_0xed73('0x2f'),'value':_0xed73('0x30'),'ignore':![]},{'name':'InternalRoutes','value':_0xed73('0x31'),'ignore':![]}];var _0xe4dc55=_(_0x4f191d)['filter'](_0xed73('0x32'))[_0xed73('0x33')](_0xed73('0x34'))[_0xed73('0x34')]();if(_['includes'](_0xe4dc55,_0x2367cf['type'])){return;}var _0x321f73=_[_0xed73('0x35')](_0x4f191d,[_0xed73('0x34'),_0x2367cf[_0xed73('0x36')]])['name'];return db['UserProfileResource'][_0xed73('0x2d')]({'where':{'type':_0x321f73,'resourceId':_0x2367cf['id']}})[_0xed73('0x2c')](function(){return _0x384aa3;});})[_0xed73('0x2c')](function(){_0x4c8fff[_0xed73('0x21')](0xcc)[_0xed73('0x22')]();});}};}function handleEntityNotFound(_0x26d127,_0x5fc0ea){return function(_0x28a84b){if(!_0x28a84b){_0x26d127['sendStatus'](0x194);}return _0x28a84b;};}function handleError(_0x4dce9f,_0x5532a7){_0x5532a7=_0x5532a7||0x1f4;return function(_0x41b202){logger[_0xed73('0x37')](_0x41b202[_0xed73('0x38')]);if(_0x41b202['name']){delete _0x41b202[_0xed73('0x39')];}_0x4dce9f[_0xed73('0x21')](_0x5532a7)['send'](_0x41b202);};}exports[_0xed73('0x3a')]=function(_0x59d158,_0x4d1b44){var _0xf63df0={},_0x148f70={},_0x165406={'count':0x0,'rows':[]};var _0x581c03=_[_0xed73('0x33')](db[_0xed73('0x3b')][_0xed73('0x3c')],function(_0x1769b4){return{'name':_0x1769b4[_0xed73('0x3d')],'type':_0x1769b4[_0xed73('0x36')][_0xed73('0x3e')]};});_0x148f70[_0xed73('0x3f')]=_['map'](_0x581c03,_0xed73('0x39'));_0x148f70[_0xed73('0x40')]=_[_0xed73('0x41')](_0x59d158[_0xed73('0x40')]);_0x148f70[_0xed73('0x42')]=_[_0xed73('0x43')](_0x148f70['model'],_0x148f70[_0xed73('0x40')]);_0xf63df0[_0xed73('0x44')]=_['intersection'](_0x148f70[_0xed73('0x3f')],qs[_0xed73('0x45')](_0x59d158[_0xed73('0x40')][_0xed73('0x45')]));_0xf63df0[_0xed73('0x44')]=_0xf63df0[_0xed73('0x44')][_0xed73('0x46')]?_0xf63df0['attributes']:_0x148f70['model'];if(!_0x59d158[_0xed73('0x40')][_0xed73('0x47')](_0xed73('0x48'))){_0xf63df0['limit']=qs[_0xed73('0x25')](_0x59d158['query']['limit']);_0xf63df0[_0xed73('0x27')]=qs[_0xed73('0x27')](_0x59d158[_0xed73('0x40')][_0xed73('0x27')]);}_0xf63df0[_0xed73('0x49')]=qs['sort'](_0x59d158[_0xed73('0x40')][_0xed73('0x4a')]);_0xf63df0[_0xed73('0x4b')]=qs[_0xed73('0x42')](_[_0xed73('0x4c')](_0x59d158[_0xed73('0x40')],_0x148f70[_0xed73('0x42')]),_0x581c03);if(_0x59d158[_0xed73('0x40')][_0xed73('0x4d')]){_0xf63df0['where']=_[_0xed73('0x4e')](_0xf63df0['where'],{'$or':_['map'](_0x581c03,function(_0x664f0d){if(_0x664f0d[_0xed73('0x36')]!=='VIRTUAL'){var _0x59a1ba={};_0x59a1ba[_0x664f0d[_0xed73('0x39')]]={'$like':'%'+_0x59d158[_0xed73('0x40')][_0xed73('0x4d')]+'%'};return _0x59a1ba;}})});}_0xf63df0=_[_0xed73('0x4e')]({},_0xf63df0,_0x59d158[_0xed73('0x4f')]);var _0x2b501c={'where':_0xf63df0[_0xed73('0x4b')]};return db[_0xed73('0x3b')]['count'](_0x2b501c)[_0xed73('0x2c')](function(_0xfece0f){_0x165406[_0xed73('0x26')]=_0xfece0f;if(_0x59d158[_0xed73('0x40')][_0xed73('0x50')]){_0xf63df0['include']=[{'all':!![]}];}return db[_0xed73('0x3b')][_0xed73('0x51')](_0xf63df0);})[_0xed73('0x2c')](function(_0x1704cb){_0x165406['rows']=_0x1704cb;return _0x165406;})[_0xed73('0x2c')](respondWithFilteredResult(_0x4d1b44,_0xf63df0))[_0xed73('0x52')](handleError(_0x4d1b44,null));};exports['show']=function(_0x310140,_0x4c912c){var _0x3fa39d={'raw':![],'where':{'id':_0x310140[_0xed73('0x53')]['id']}},_0x32f00a={};_0x32f00a[_0xed73('0x3f')]=_['keys'](db[_0xed73('0x3b')][_0xed73('0x3c')]);_0x32f00a[_0xed73('0x40')]=_[_0xed73('0x41')](_0x310140[_0xed73('0x40')]);_0x32f00a[_0xed73('0x42')]=_[_0xed73('0x43')](_0x32f00a[_0xed73('0x3f')],_0x32f00a[_0xed73('0x40')]);_0x3fa39d[_0xed73('0x44')]=_[_0xed73('0x43')](_0x32f00a[_0xed73('0x3f')],qs[_0xed73('0x45')](_0x310140[_0xed73('0x40')][_0xed73('0x45')]));_0x3fa39d[_0xed73('0x44')]=_0x3fa39d['attributes'][_0xed73('0x46')]?_0x3fa39d[_0xed73('0x44')]:_0x32f00a[_0xed73('0x3f')];if(_0x310140['query'][_0xed73('0x50')]){_0x3fa39d[_0xed73('0x54')]=[{'all':!![]}];}_0x3fa39d=_[_0xed73('0x4e')]({},_0x3fa39d,_0x310140[_0xed73('0x4f')]);return db['VoiceExtension'][_0xed73('0x35')](_0x3fa39d)[_0xed73('0x2c')](handleEntityNotFound(_0x4c912c,null))[_0xed73('0x2c')](respondWithResult(_0x4c912c,null))[_0xed73('0x52')](handleError(_0x4c912c,null));};exports['destroy']=function(_0x5060d4,_0x22f13e){return db['VoiceExtension']['find']({'where':{'id':_0x5060d4[_0xed73('0x53')]['id']}})[_0xed73('0x2c')](handleEntityNotFound(_0x22f13e,null))['then'](removeEntity(_0x22f13e,null))[_0xed73('0x52')](handleError(_0x22f13e,null));};exports[_0xed73('0x55')]=function(_0x2121e6,_0xb9b8bb){if(_0x2121e6[_0xed73('0x56')][_0xed73('0x36')]===_0xed73('0x30')&&!_[_0xed73('0x57')](_0x2121e6[_0xed73('0x56')][_0xed73('0x58')],'_')){_0x2121e6[_0xed73('0x56')][_0xed73('0x58')]='_'['concat'](_0x2121e6[_0xed73('0x56')][_0xed73('0x58')]);}return db[_0xed73('0x3b')][_0xed73('0x55')](_0x2121e6[_0xed73('0x56')],{'raw':![]})[_0xed73('0x2c')](function(_0x1c60b2){var _0x1a369c=_0x2121e6[_0xed73('0x59')][_0xed73('0x5a')]({'plain':!![]});if(!_0x1a369c)throw new Error(_0xed73('0x5b'));if(_0x1a369c[_0xed73('0x5c')]===_0xed73('0x59')){var _0x1921d5=_0x1c60b2[_0xed73('0x5a')]({'plain':!![]});var _0x26d82c=[{'name':_0xed73('0x5d'),'value':_0xed73('0x2e')},{'name':_0xed73('0x2f'),'value':'outbound'},{'name':_0xed73('0x5e'),'value':_0xed73('0x31')}];var _0x4e3ce6=_[_0xed73('0x35')](_0x26d82c,[_0xed73('0x34'),_0x1921d5['type']])[_0xed73('0x39')];return db['UserProfileSection']['find']({'where':{'name':_0x4e3ce6,'userProfileId':_0x1a369c[_0xed73('0x5f')]},'raw':!![]})[_0xed73('0x2c')](function(_0x2d343f){if(_0x2d343f&&_0x2d343f[_0xed73('0x60')]===0x0){return db[_0xed73('0x61')][_0xed73('0x55')]({'name':_0x1921d5['name'],'resourceId':_0x1921d5['id'],'type':_0x2d343f[_0xed73('0x39')],'sectionId':_0x2d343f['id']},{})['then'](function(){return _0x1c60b2;});}else{return _0x1c60b2;}})[_0xed73('0x52')](function(_0x31786c){logger['error'](_0xed73('0x62'),_0x31786c);throw _0x31786c;});}return _0x1c60b2;})['then'](respondWithResult(_0xb9b8bb,0xc9))[_0xed73('0x52')](handleError(_0xb9b8bb,null));};exports['update']=function(_0x255612,_0x14814c){if(_0x255612['body']['id']){delete _0x255612[_0xed73('0x56')]['id'];}return db[_0xed73('0x3b')][_0xed73('0x35')]({'where':{'id':_0x255612[_0xed73('0x53')]['id']}})[_0xed73('0x2c')](handleEntityNotFound(_0x14814c,null))[_0xed73('0x2c')](function(_0x3ca27c){if(_0x3ca27c){return db['VoiceExtension'][_0xed73('0x2b')](_[_0xed73('0x4c')](_0x255612['body'],[_0xed73('0x58'),_0xed73('0x63'),_0xed73('0x64'),_0xed73('0x65'),_0xed73('0x66'),'mandatoryDisposition',_0xed73('0x67')]),{'where':{'context':_0x3ca27c[_0xed73('0x63')],'exten':_0x3ca27c[_0xed73('0x58')]},'individualHooks':!![]})['then'](function(_0x7f1b81){return _0x7f1b81;});}return null;})[_0xed73('0x2c')](respondWithStatusCode(_0x14814c,null))[_0xed73('0x52')](handleError(_0x14814c,null));};exports[_0xed73('0x68')]=function(_0x25f4cb,_0x684ae4){return db[_0xed73('0x3b')][_0xed73('0x69')]({'where':{'id':_0x25f4cb[_0xed73('0x53')]['id']}})[_0xed73('0x2c')](function(_0x100893){if(_0x100893){return db[_0xed73('0x6a')][_0xed73('0x6b')](function(_0x4f7c3d){return db[_0xed73('0x3b')][_0xed73('0x2d')]({'where':{'VoiceExtensionId':_0x25f4cb[_0xed73('0x53')]['id']},'transaction':_0x4f7c3d})[_0xed73('0x2c')](function(){var _0x3fdf93=_[_0xed73('0x33')](_0x25f4cb[_0xed73('0x56')],function(_0x1dc9be){_0x1dc9be[_0xed73('0x6c')]=_0x25f4cb[_0xed73('0x53')]['id'];_0x1dc9be[_0xed73('0x6d')]=!![];return _0x1dc9be;});var _0x2b1496=_0x25f4cb['query'][_0xed73('0x6e')]&&_0x25f4cb[_0xed73('0x40')][_0xed73('0x6e')][_0xed73('0x6f')]()===_0xed73('0x70')?!![]:![];return _0x100893[_0xed73('0x71')](_0x3fdf93,_0x2b1496);})[_0xed73('0x2c')](function(_0x1a534c){return db[_0xed73('0x3b')]['bulkCreate'](_0x1a534c,{'transaction':_0x4f7c3d});});})[_0xed73('0x2c')](function(){return db[_0xed73('0x3b')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x25f4cb['params']['id']},'order':_0xed73('0x72')});});}})['then'](respondWithResult(_0x684ae4,null))['catch'](handleError(_0x684ae4,null));};
\ No newline at end of file
index dbe79db..b838083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9bf=['VoiceExtension','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xd9bf,0x7c));var _0xfd9b=function(_0xb24759,_0x4b34b9){_0xb24759=_0xb24759-0x0;var _0x47cf98=_0xd9bf[_0xb24759];return _0x47cf98;};'use strict';var EventEmitter=require(_0xfd9b('0x0'));var VoiceExtension=require(_0xfd9b('0x1'))['db'][_0xfd9b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfd9b('0x3')](0x0);var events={'afterCreate':_0xfd9b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b8cff){return function(_0x45e426,_0x2f4d23,_0x45f78d){VoiceExtensionEvents[_0xfd9b('0x5')](_0x2b8cff+':'+_0x45e426['id'],_0x45e426);VoiceExtensionEvents[_0xfd9b('0x5')](_0x2b8cff,_0x45e426);_0x45f78d(null);};}for(var e in events){if(events[_0xfd9b('0x6')](e)){var event=events[e];VoiceExtension[_0xfd9b('0x7')](e,emitEvent(event));}}module[_0xfd9b('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x28a1=['save','update','emit','hook','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x28a1,0x104));var _0x128a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x28a1[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x128a('0x0'));var VoiceExtension=require(_0x128a('0x1'))['db'][_0x128a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x128a('0x3')](0x0);var events={'afterCreate':_0x128a('0x4'),'afterUpdate':_0x128a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37485d){return function(_0x2dd58e,_0x2f9e00,_0x17fe00){VoiceExtensionEvents[_0x128a('0x6')](_0x37485d+':'+_0x2dd58e['id'],_0x2dd58e);VoiceExtensionEvents[_0x128a('0x6')](_0x37485d,_0x2dd58e);_0x17fe00(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x128a('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 8afb2f3..9b97867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f02=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','then','util','./voiceExtension.attributes','Set','context','exten','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','options','split','length','name','trunk','param','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','*,*,*,*','intervals','IntervalId','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType'];(function(_0x1f142c,_0x165376){var _0x4e8b70=function(_0x1772b0){while(--_0x1772b0){_0x1f142c['push'](_0x1f142c['shift']());}};_0x4e8b70(++_0x165376);}(_0x8f02,0xa9));var _0x28f0=function(_0x13e78e,_0x47ce50){_0x13e78e=_0x13e78e-0x0;var _0x4f4442=_0x8f02[_0x13e78e];return _0x4f4442;};'use strict';var util=require(_0x28f0('0x0'));var _=require('lodash');var attributes=require(_0x28f0('0x1'));module['exports']=function(_0x4da857){var _0x21dd79=_0x4da857['models'];function _0x289287(_0x34bb1b){var _0x579a51=0x2;var _0x456498=[{'type':_0x34bb1b['type'],'app':_0x28f0('0x2'),'appdata':'CDR(type)='+_0x34bb1b['type'],'context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b[_0x28f0('0x4')],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']},{'type':_0x34bb1b[_0x28f0('0x5')],'app':_0x34bb1b[_0x28f0('0x6')]?'Set':_0x28f0('0x7'),'appdata':_0x34bb1b[_0x28f0('0x6')]?_0x28f0('0x8')+_0x34bb1b[_0x28f0('0x6')]:_0x28f0('0x9'),'context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b[_0x28f0('0x4')],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']}];if(_0x34bb1b[_0x28f0('0x5')]===_0x28f0('0xa')){_0x456498[_0x28f0('0xb')]({'type':_0x28f0('0xa'),'app':'Set','appdata':'CDR(routeid)='+_0x34bb1b['id'],'context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b['exten'],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']});}_0x456498[_0x28f0('0xb')]({'type':_0x34bb1b['type'],'app':'Set','appdata':_0x28f0('0xc'),'context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b['exten'],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']},{'type':_0x34bb1b[_0x28f0('0x5')],'app':_0x28f0('0x2'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b[_0x28f0('0x4')],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']},{'type':_0x34bb1b[_0x28f0('0x5')],'app':_0x28f0('0x2'),'appdata':_0x28f0('0xd'),'context':_0x34bb1b[_0x28f0('0x3')],'exten':_0x34bb1b[_0x28f0('0x4')],'priority':_0x579a51++,'VoiceExtensionId':_0x34bb1b['id']});return _0x456498;}function _0x3a113a(_0x44e0e6){var _0x126a45=0x2;var _0xb229a=[{'type':_0x28f0('0xe'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6['exten'],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x44e0e6[_0x28f0('0x6')]?_0x28f0('0x2'):_0x28f0('0x7'),'appdata':_0x44e0e6['alias']?_0x28f0('0x8')+_0x44e0e6[_0x28f0('0x6')]:'No\x20alias\x20set','context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6['exten'],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':_0x28f0('0xf')+(_0x44e0e6[_0x28f0('0x10')]?_0x28f0('0x11')+_0x44e0e6['cutdigits']+'}':_0x28f0('0x12')),'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':_0x28f0('0x13')+_0x44e0e6['id'],'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x126a45+0x2)+_0x28f0('0x15')+(_0x126a45+0x1)+')','context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6['exten'],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':'outbound','app':_0x28f0('0x2'),'appdata':_0x44e0e6[_0x28f0('0x10')]?_0x28f0('0x16')+_0x44e0e6[_0x28f0('0x10')]+'}':_0x28f0('0x17'),'context':_0x44e0e6['context'],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':_0x28f0('0xc'),'context':_0x44e0e6['context'],'exten':_0x44e0e6['exten'],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':'outbound','app':'Set','appdata':_0x28f0('0x18'),'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':'MONITOR_OPTIONS=ab','context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':_0x28f0('0x19')+_0x44e0e6['id'],'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']}];if(_0x44e0e6[_0x28f0('0x1a')](_0x28f0('0x1b'))&&_0x44e0e6[_0x28f0('0x1b')]!==_0x28f0('0x1c')){_0xb229a[_0x28f0('0xb')]({'type':_0x28f0('0xe'),'app':_0x28f0('0x2'),'appdata':_0x28f0('0x1d'),'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6['exten'],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x44e0e6['recordingFormat']||_0x28f0('0x1e'),'context':_0x44e0e6[_0x28f0('0x3')],'exten':_0x44e0e6[_0x28f0('0x4')],'priority':_0x126a45++,'VoiceExtensionId':_0x44e0e6['id']});}return _0xb229a;}function _0x36bdc6(_0x134aa6){var _0x4a1650=[{'name':'trunk','param':0x0},{'name':_0x28f0('0x1f'),'param':0x1},{'name':_0x28f0('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x5d6a68={};var _0x5cffff=_0x134aa6[_0x28f0('0x21')](',');var _0x1e4b79=[];for(var _0x4ecf74=0x0;_0x4ecf74<_0x4a1650[_0x28f0('0x22')];_0x4ecf74++){switch(_0x4a1650[_0x4ecf74][_0x28f0('0x23')]){case'trunk':_0x5d6a68[_0x28f0('0x24')]=_0x5cffff[_0x4a1650[_0x4ecf74]['param']]['split']('/')[0x1];_0x5d6a68['phone']=_0x5cffff[_0x4a1650[_0x4ecf74][_0x28f0('0x25')]][_0x28f0('0x21')]('/')[0x2];_0x5d6a68['prefix']=_0x5d6a68[_0x28f0('0x26')]?_0x5d6a68[_0x28f0('0x26')][_0x28f0('0x21')]('$')[0x0]:undefined;_0x5d6a68[_0x28f0('0x26')]=route[_0x28f0('0x10')]?(_0x5d6a68['prefix']||'')+_0x28f0('0x11')+route[_0x28f0('0x10')]+'}':(_0x5d6a68['prefix']||'')+'${EXTEN}';_0x1e4b79[_0x4a1650[_0x4ecf74][_0x28f0('0x25')]]=[_0x28f0('0x27'),_0x5d6a68[_0x28f0('0x24')],_0x5d6a68[_0x28f0('0x26')]][_0x28f0('0x28')]('/');break;case'options':_0x5d6a68[_0x28f0('0x20')]=_0x5cffff[_0x4a1650[_0x4ecf74][_0x28f0('0x25')]];if(route[_0x28f0('0x1b')]!=='none'){if(_0x5d6a68[_0x28f0('0x20')][_0x28f0('0x29')](_0x28f0('0x2a'))<0x0){_0x5d6a68[_0x28f0('0x20')]+=_0x28f0('0x2a');}}else{_0x5d6a68[_0x28f0('0x20')]=_0x5d6a68[_0x28f0('0x20')][_0x28f0('0x2b')]('U(xcally-mixmonitor-context)','');}_0x1e4b79[_0x4a1650[_0x4ecf74][_0x28f0('0x25')]]=_0x5d6a68[_0x28f0('0x20')];break;default:_0x1e4b79[_0x4a1650[_0x4ecf74][_0x28f0('0x25')]]=_0x5cffff[_0x4a1650[_0x4ecf74]['param']];}}return _0x1e4b79[_0x28f0('0x28')](',');}function _0x2126f9(_0x11cd66,_0xf8a0eb,_0x4ecb26,_0x2d4aab){return new Promise(function(_0x1f2eeb,_0x2b53b1){var _0x396482=[];if(_[_0x28f0('0x2c')](_0xf8a0eb))return _0x1f2eeb(_0x396482);_0x21dd79[_0x28f0('0x2d')]['findAll']({'attributes':['id',_0x28f0('0x2e'),'IntervalId'],'raw':!![]})['then'](function(_0x3c715f){for(var _0x9bb107=0x0,_0x56f972=0x0;_0x9bb107<_0xf8a0eb[_0x28f0('0x22')];_0x9bb107++,_0x56f972=0x0){var _0x293726=_0xf8a0eb[_0x9bb107];var _0x5b09a3=[];var _0x315fb5=[];if(_0x293726[_0x28f0('0x2e')]!==_0x28f0('0x2f')){_0x293726[_0x28f0('0x30')]=[_0x293726[_0x28f0('0x2e')]];}else{_0x293726['intervals']=_0x293726[_0x28f0('0x31')]?_[_0x28f0('0x32')](_['filter'](_0x3c715f,{'IntervalId':_0x293726[_0x28f0('0x31')]}),'interval'):[];}_0x293726[_0x28f0('0x3')]=_0x11cd66[_0x28f0('0x3')];_0x293726[_0x28f0('0x4')]=_0x11cd66[_0x28f0('0x4')];if(_0x293726[_0x28f0('0x5')])_0x293726['type']=_0x293726[_0x28f0('0x5')]['toLowerCase']();if(_0x11cd66['type']==='outbound'){if(_0x293726[_0x28f0('0x1a')](_0x28f0('0x33'))&&_0x293726['tag']&&_0x293726['tag']!=='--'){_0x5b09a3[_0x28f0('0xb')]({'type':_0x293726['type'][_0x28f0('0x34')](),'app':_0x28f0('0x2'),'appdata':'CDR(tag)='+_0x293726[_0x28f0('0x33')],'context':_0x11cd66['context'],'exten':_0x11cd66[_0x28f0('0x4')],'priority':_0x293726[_0x28f0('0x30')]['length']+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});}_0x5b09a3['push']({'type':_0x293726[_0x28f0('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':_0x28f0('0x35')+(_0x293726[_0x28f0('0x36')]?_0x28f0('0x37')+_0x293726[_0x28f0('0x36')]+')':_0x28f0('0x38')),'context':_0x11cd66[_0x28f0('0x3')],'exten':_0x11cd66[_0x28f0('0x4')],'priority':_0x293726[_0x28f0('0x30')][_0x28f0('0x22')]+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});}else{if(_0x293726[_0x28f0('0x1a')](_0x28f0('0x39'))){if([_0x28f0('0x3a'),_0x28f0('0x3b')]['includes'](_0x293726[_0x28f0('0x3c')][_0x28f0('0x34')]())&&_0x293726[_0x28f0('0x3d')]!=='custom'){if(_0x293726[_0x28f0('0x39')]){_0x5b09a3[_0x28f0('0xb')]({'type':_0x293726['type'][_0x28f0('0x34')](),'app':'ExecIf','appdata':_0x28f0('0x3e'),'context':_0x11cd66[_0x28f0('0x3')],'exten':_0x11cd66['exten'],'priority':_0x293726['intervals'][_0x28f0('0x22')]+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});_0x5b09a3[_0x28f0('0xb')]({'type':_0x293726['type'][_0x28f0('0x34')](),'app':_0x28f0('0x2'),'appdata':_0x28f0('0x3f'),'context':_0x11cd66['context'],'exten':_0x11cd66[_0x28f0('0x4')],'priority':_0x293726[_0x28f0('0x30')]['length']+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});}else{_0x5b09a3['push']({'type':_0x293726[_0x28f0('0x5')][_0x28f0('0x34')](),'app':_0x28f0('0x14'),'appdata':_0x28f0('0x40'),'context':_0x11cd66[_0x28f0('0x3')],'exten':_0x11cd66[_0x28f0('0x4')],'priority':_0x293726[_0x28f0('0x30')][_0x28f0('0x22')]+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});_0x5b09a3[_0x28f0('0xb')]({'type':_0x293726['type'][_0x28f0('0x34')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x11cd66[_0x28f0('0x3')],'exten':_0x11cd66['exten'],'priority':_0x293726[_0x28f0('0x30')]['length']+_0x4ecb26+_0x56f972++,'VoiceExtensionId':_0x11cd66['id']});}}}}for(var _0x4839eb=0x0;_0x4839eb<_0x293726['intervals']['length'];_0x4839eb++){var _0x6b7a10=_0x4ecb26+_0x293726[_0x28f0('0x30')][_0x28f0('0x22')];var _0x5a9736=_0x4839eb===_0x293726['intervals'][_0x28f0('0x22')]-0x1?_0x4ecb26+_0x5b09a3['length']+_0x315fb5[_0x28f0('0x22')]+0x2:_0x4ecb26+_0x4839eb+0x1;_0x5b09a3[_0x28f0('0x41')](_0x4839eb,0x0,{'type':_0x11cd66[_0x28f0('0x5')],'app':_0x28f0('0x42'),'appdata':_0x293726[_0x28f0('0x30')][_0x4839eb]+'?'+_0x11cd66[_0x28f0('0x3')]+_0x28f0('0x43')+_0x6b7a10+':'+_0x11cd66[_0x28f0('0x3')]+_0x28f0('0x43')+_0x5a9736,'exten':_0x11cd66['exten'],'context':_0x11cd66[_0x28f0('0x3')],'priority':_0x4ecb26+_0x4839eb,'VoiceExtensionId':_0x11cd66['id']});}if(_0x2d4aab&&_0x293726['appType']===_0x28f0('0x44'))_0x293726['appdata']=_0x36bdc6(_0x293726[_0x28f0('0x45')]);_0x293726[_0x28f0('0x46')]=_0x5b09a3[_0x28f0('0x22')]?_[_0x28f0('0x47')](_0x5b09a3)[_0x28f0('0x46')]+0x1:_0x4ecb26;_0x396482=_[_0x28f0('0x48')](_0x396482,_0x5b09a3,[_0x293726],_0x315fb5);_0x4ecb26=_[_0x28f0('0x47')](_0x396482)[_0x28f0('0x46')]+0x1;}return _0x1f2eeb(_0x396482);})[_0x28f0('0x49')](function(_0x114190){_0x2b53b1(_0x114190);});});}return _0x4da857[_0x28f0('0x4a')]('VoiceExtension',attributes,{'tableName':_0x28f0('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x387411,_0x52ec7a){var _0x4ebae5=this;var _0x5bff60=_0x4ebae5[_0x28f0('0x5')]===_0x28f0('0xe')?_0x3a113a(_0x4ebae5):_0x289287(_0x4ebae5);return _0x2126f9(_0x4ebae5,_0x387411,_[_0x28f0('0x47')](_0x5bff60)[_0x28f0('0x46')]+0x1,_0x52ec7a)[_0x28f0('0x4c')](function(_0x232433){var _0x2cbe9f=_[_0x28f0('0x48')](_0x5bff60,_0x232433);_0x2cbe9f[_0x28f0('0xb')]({'type':_0x4ebae5[_0x28f0('0x5')],'app':'Hangup','exten':_0x4ebae5[_0x28f0('0x4')],'context':_0x4ebae5[_0x28f0('0x3')],'priority':_['last'](_0x2cbe9f)[_0x28f0('0x46')]+0x1,'VoiceExtensionId':_0x4ebae5['id']});return _0x2cbe9f;});}}});};
\ No newline at end of file
+var _0xaeeb=['length','param','split','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','type','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url'];(function(_0x188be2,_0x353598){var _0x1d1fca=function(_0x1bcc9f){while(--_0x1bcc9f){_0x188be2['push'](_0x188be2['shift']());}};_0x1d1fca(++_0x353598);}(_0xaeeb,0xc3));var _0xbaee=function(_0x2dc5b4,_0x4c6d28){_0x2dc5b4=_0x2dc5b4-0x0;var _0x44cb27=_0xaeeb[_0x2dc5b4];return _0x44cb27;};'use strict';var util=require('util');var _=require(_0xbaee('0x0'));var attributes=require(_0xbaee('0x1'));module['exports']=function(_0x5a711a){var _0x37c66b=_0x5a711a[_0xbaee('0x2')];function _0x3fa315(_0x3f54da){var _0x1dd801=0x2;var _0x1b5fcd=[{'type':_0x3f54da[_0xbaee('0x3')],'app':'Set','appdata':'CDR(type)='+_0x3f54da[_0xbaee('0x3')],'context':_0x3f54da[_0xbaee('0x4')],'exten':_0x3f54da[_0xbaee('0x5')],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']},{'type':_0x3f54da[_0xbaee('0x3')],'app':_0x3f54da[_0xbaee('0x6')]?_0xbaee('0x7'):_0xbaee('0x8'),'appdata':_0x3f54da[_0xbaee('0x6')]?_0xbaee('0x9')+_0x3f54da[_0xbaee('0x6')]:_0xbaee('0xa'),'context':_0x3f54da['context'],'exten':_0x3f54da[_0xbaee('0x5')],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']}];if(_0x3f54da[_0xbaee('0x3')]===_0xbaee('0xb')){_0x1b5fcd[_0xbaee('0xc')]({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x3f54da['id'],'context':_0x3f54da[_0xbaee('0x4')],'exten':_0x3f54da['exten'],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']});}_0x1b5fcd[_0xbaee('0xc')]({'type':_0x3f54da[_0xbaee('0x3')],'app':_0xbaee('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3f54da[_0xbaee('0x4')],'exten':_0x3f54da[_0xbaee('0x5')],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']},{'type':_0x3f54da[_0xbaee('0x3')],'app':_0xbaee('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3f54da['context'],'exten':_0x3f54da[_0xbaee('0x5')],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']},{'type':_0x3f54da[_0xbaee('0x3')],'app':_0xbaee('0x7'),'appdata':_0xbaee('0xd'),'context':_0x3f54da['context'],'exten':_0x3f54da['exten'],'priority':_0x1dd801++,'VoiceExtensionId':_0x3f54da['id']});return _0x1b5fcd;}function _0x21f5a8(_0x5bfdfb){var _0x410c45=0x2;var _0x1de368=[{'type':_0xbaee('0xe'),'app':'Set','appdata':_0xbaee('0xf'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0x5bfdfb['alias']?'Set':_0xbaee('0x8'),'appdata':_0x5bfdfb[_0xbaee('0x6')]?_0xbaee('0x9')+_0x5bfdfb[_0xbaee('0x6')]:_0xbaee('0xa'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x7'),'appdata':'CDR(destination)='+(_0x5bfdfb[_0xbaee('0x10')]?_0xbaee('0x11')+_0x5bfdfb[_0xbaee('0x10')]+'}':'${EXTEN}'),'context':_0x5bfdfb['context'],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x7'),'appdata':_0xbaee('0x12')+_0x5bfdfb['id'],'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x13'),'appdata':_0xbaee('0x14')+(_0x410c45+0x2)+_0xbaee('0x15')+(_0x410c45+0x1)+')','context':_0x5bfdfb['context'],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x7'),'appdata':_0x5bfdfb[_0xbaee('0x10')]?_0xbaee('0x16')+_0x5bfdfb['cutdigits']+'}':_0xbaee('0x17'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':'Set','appdata':_0xbaee('0x18'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb['exten'],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x7'),'appdata':_0xbaee('0x19'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':'Set','appdata':_0xbaee('0xd'),'context':_0x5bfdfb['context'],'exten':_0x5bfdfb['exten'],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':'outbound','app':_0xbaee('0x7'),'appdata':_0xbaee('0x1a')+_0x5bfdfb['id'],'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']}];if(_0x5bfdfb['hasOwnProperty'](_0xbaee('0x1b'))&&_0x5bfdfb['recordingFormat']!==_0xbaee('0x1c')){_0x1de368[_0xbaee('0xc')]({'type':'outbound','app':_0xbaee('0x7'),'appdata':_0xbaee('0x1d'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']},{'type':_0xbaee('0xe'),'app':_0xbaee('0x7'),'appdata':_0xbaee('0x1e')+_0x5bfdfb[_0xbaee('0x1b')]||_0xbaee('0x1f'),'context':_0x5bfdfb[_0xbaee('0x4')],'exten':_0x5bfdfb[_0xbaee('0x5')],'priority':_0x410c45++,'VoiceExtensionId':_0x5bfdfb['id']});}return _0x1de368;}function _0x27be99(_0x16ebdc){var _0x19b5ba=[{'name':_0xbaee('0x20'),'param':0x0},{'name':_0xbaee('0x21'),'param':0x1},{'name':_0xbaee('0x22'),'param':0x2},{'name':_0xbaee('0x23'),'param':0x3}];var _0x200ec5={};var _0x9d1704=_0x16ebdc['split'](',');var _0x33de5b=[];for(var _0xbb1b48=0x0;_0xbb1b48<_0x19b5ba[_0xbaee('0x24')];_0xbb1b48++){switch(_0x19b5ba[_0xbb1b48]['name']){case'trunk':_0x200ec5['trunk']=_0x9d1704[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]][_0xbaee('0x26')]('/')[0x1];_0x200ec5[_0xbaee('0x27')]=_0x9d1704[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]][_0xbaee('0x26')]('/')[0x2];_0x200ec5[_0xbaee('0x28')]=_0x200ec5['phone']?_0x200ec5[_0xbaee('0x27')]['split']('$')[0x0]:undefined;_0x200ec5['phone']=route[_0xbaee('0x10')]?(_0x200ec5['prefix']||'')+_0xbaee('0x11')+route[_0xbaee('0x10')]+'}':(_0x200ec5[_0xbaee('0x28')]||'')+'${EXTEN}';_0x33de5b[_0x19b5ba[_0xbb1b48]['param']]=['SIP',_0x200ec5['trunk'],_0x200ec5['phone']][_0xbaee('0x29')]('/');break;case _0xbaee('0x22'):_0x200ec5[_0xbaee('0x22')]=_0x9d1704[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]];if(route[_0xbaee('0x1b')]!=='none'){if(_0x200ec5[_0xbaee('0x22')][_0xbaee('0x2a')](_0xbaee('0x2b'))<0x0){_0x200ec5[_0xbaee('0x22')]+=_0xbaee('0x2b');}}else{_0x200ec5[_0xbaee('0x22')]=_0x200ec5[_0xbaee('0x22')]['replace'](_0xbaee('0x2b'),'');}_0x33de5b[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]]=_0x200ec5[_0xbaee('0x22')];break;default:_0x33de5b[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]]=_0x9d1704[_0x19b5ba[_0xbb1b48][_0xbaee('0x25')]];}}return _0x33de5b[_0xbaee('0x29')](',');}function _0x3a09f1(_0x2aebe9,_0x418134,_0x354abc,_0x7577){return new Promise(function(_0x194f3f,_0x419c92){var _0x1af047=[];if(_[_0xbaee('0x2c')](_0x418134))return _0x194f3f(_0x1af047);_0x37c66b['Interval'][_0xbaee('0x2d')]({'attributes':['id',_0xbaee('0x2e'),'IntervalId'],'raw':!![]})[_0xbaee('0x2f')](function(_0x13faf7){for(var _0x1dbc82=0x0,_0x36b97f=0x0;_0x1dbc82<_0x418134[_0xbaee('0x24')];_0x1dbc82++,_0x36b97f=0x0){var _0x2db92d=_0x418134[_0x1dbc82];var _0x208b82=[];var _0x2b5725=[];if(_0x2db92d['interval']!==_0xbaee('0x30')){_0x2db92d[_0xbaee('0x31')]=[_0x2db92d['interval']];}else{_0x2db92d[_0xbaee('0x31')]=_0x2db92d[_0xbaee('0x32')]?_[_0xbaee('0x33')](_['filter'](_0x13faf7,{'IntervalId':_0x2db92d[_0xbaee('0x32')]}),'interval'):[];}_0x2db92d['context']=_0x2aebe9[_0xbaee('0x4')];_0x2db92d['exten']=_0x2aebe9[_0xbaee('0x5')];if(_0x2db92d[_0xbaee('0x3')])_0x2db92d[_0xbaee('0x3')]=_0x2db92d[_0xbaee('0x3')][_0xbaee('0x34')]();if(_0x2aebe9[_0xbaee('0x3')]===_0xbaee('0xe')){if(_0x2db92d[_0xbaee('0x35')](_0xbaee('0x36'))&&_0x2db92d['tag']&&_0x2db92d[_0xbaee('0x36')]!=='--'){_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d['type'][_0xbaee('0x34')](),'app':_0xbaee('0x7'),'appdata':_0xbaee('0x37')+_0x2db92d[_0xbaee('0x36')],'context':_0x2aebe9[_0xbaee('0x4')],'exten':_0x2aebe9[_0xbaee('0x5')],'priority':_0x2db92d['intervals'][_0xbaee('0x24')]+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});}_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d['type'][_0xbaee('0x34')](),'app':_0xbaee('0x13'),'appdata':_0xbaee('0x38')+(_0x2db92d[_0xbaee('0x39')]?_0xbaee('0x3a')+_0x2db92d[_0xbaee('0x39')]+')':_0xbaee('0x3b')),'context':_0x2aebe9[_0xbaee('0x4')],'exten':_0x2aebe9['exten'],'priority':_0x2db92d[_0xbaee('0x31')][_0xbaee('0x24')]+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});}else{if(_0x2db92d[_0xbaee('0x35')](_0xbaee('0x3c'))){if([_0xbaee('0x3d'),_0xbaee('0x3e')][_0xbaee('0x3f')](_0x2db92d['app'][_0xbaee('0x34')]())&&_0x2db92d[_0xbaee('0x40')]!=='custom'){if(_0x2db92d['answer']){_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d['type'][_0xbaee('0x34')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2aebe9['context'],'exten':_0x2aebe9['exten'],'priority':_0x2db92d[_0xbaee('0x31')][_0xbaee('0x24')]+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d['type'][_0xbaee('0x34')](),'app':_0xbaee('0x7'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2aebe9['context'],'exten':_0x2aebe9[_0xbaee('0x5')],'priority':_0x2db92d[_0xbaee('0x31')]['length']+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});}else{_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d['type'][_0xbaee('0x34')](),'app':'ExecIf','appdata':_0xbaee('0x41'),'context':_0x2aebe9[_0xbaee('0x4')],'exten':_0x2aebe9['exten'],'priority':_0x2db92d[_0xbaee('0x31')][_0xbaee('0x24')]+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});_0x208b82[_0xbaee('0xc')]({'type':_0x2db92d[_0xbaee('0x3')][_0xbaee('0x34')](),'app':_0xbaee('0x7'),'appdata':_0xbaee('0x42'),'context':_0x2aebe9['context'],'exten':_0x2aebe9['exten'],'priority':_0x2db92d[_0xbaee('0x31')]['length']+_0x354abc+_0x36b97f++,'VoiceExtensionId':_0x2aebe9['id']});}}}}for(var _0x4567f1=0x0;_0x4567f1<_0x2db92d[_0xbaee('0x31')][_0xbaee('0x24')];_0x4567f1++){var _0x1e9475=_0x354abc+_0x2db92d[_0xbaee('0x31')][_0xbaee('0x24')];var _0x379883=_0x4567f1===_0x2db92d['intervals'][_0xbaee('0x24')]-0x1?_0x354abc+_0x208b82[_0xbaee('0x24')]+_0x2b5725[_0xbaee('0x24')]+0x2:_0x354abc+_0x4567f1+0x1;_0x208b82[_0xbaee('0x43')](_0x4567f1,0x0,{'type':_0x2aebe9[_0xbaee('0x3')],'app':'GotoIfTime','appdata':_0x2db92d['intervals'][_0x4567f1]+'?'+_0x2aebe9[_0xbaee('0x4')]+_0xbaee('0x44')+_0x1e9475+':'+_0x2aebe9[_0xbaee('0x4')]+_0xbaee('0x44')+_0x379883,'exten':_0x2aebe9[_0xbaee('0x5')],'context':_0x2aebe9[_0xbaee('0x4')],'priority':_0x354abc+_0x4567f1,'VoiceExtensionId':_0x2aebe9['id']});}if(_0x7577&&_0x2db92d[_0xbaee('0x40')]==='outboundDial')_0x2db92d[_0xbaee('0x45')]=_0x27be99(_0x2db92d[_0xbaee('0x45')]);_0x2db92d[_0xbaee('0x46')]=_0x208b82['length']?_[_0xbaee('0x47')](_0x208b82)[_0xbaee('0x46')]+0x1:_0x354abc;_0x1af047=_[_0xbaee('0x48')](_0x1af047,_0x208b82,[_0x2db92d],_0x2b5725);_0x354abc=_[_0xbaee('0x47')](_0x1af047)[_0xbaee('0x46')]+0x1;}return _0x194f3f(_0x1af047);})[_0xbaee('0x49')](function(_0x1dfb94){_0x419c92(_0x1dfb94);});});}return _0x5a711a[_0xbaee('0x4a')]('VoiceExtension',attributes,{'tableName':_0xbaee('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x47981d,_0x391e06){var _0x3d1cad=this;var _0x3bdcb1=_0x3d1cad[_0xbaee('0x3')]===_0xbaee('0xe')?_0x21f5a8(_0x3d1cad):_0x3fa315(_0x3d1cad);return _0x3a09f1(_0x3d1cad,_0x47981d,_[_0xbaee('0x47')](_0x3bdcb1)[_0xbaee('0x46')]+0x1,_0x391e06)[_0xbaee('0x2f')](function(_0x96bba9){var _0x29c596=_[_0xbaee('0x48')](_0x3bdcb1,_0x96bba9);_0x29c596[_0xbaee('0xc')]({'type':_0x3d1cad['type'],'app':_0xbaee('0x4c'),'exten':_0x3d1cad[_0xbaee('0x5')],'context':_0x3d1cad[_0xbaee('0x4')],'priority':_['last'](_0x29c596)[_0xbaee('0x46')]+0x1,'VoiceExtensionId':_0x3d1cad['id']});return _0x29c596;});}}});};
\ No newline at end of file
index e15fd58..bd79b14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96aa=['redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','findAll','options','attributes','limit','map','include','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x96aa,0x67));var _0xa96a=function(_0x252e76,_0x537217){_0x252e76=_0x252e76-0x0;var _0x39b051=_0x96aa[_0x252e76];return _0x39b051;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var moment=require('moment');var BPromise=require(_0xa96a('0x2'));var rs=require(_0xa96a('0x3'));var fs=require('fs');var Redis=require(_0xa96a('0x4'));var db=require(_0xa96a('0x5'))['db'];var utils=require(_0xa96a('0x6'));var logger=require('../../config/logger')(_0xa96a('0x7'));var config=require(_0xa96a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa96a('0x9')][_0xa96a('0xa')]({'port':0x232a});config[_0xa96a('0xb')]=_[_0xa96a('0xc')](config[_0xa96a('0xb')],{'host':_0xa96a('0xd'),'port':0x18eb});var socket=require(_0xa96a('0xe'))(new Redis(config[_0xa96a('0xb')]));require(_0xa96a('0xf'))[_0xa96a('0x10')](socket);function respondWithRpcPromise(_0x13321e,_0x4825fc,_0x33b786){return new BPromise(function(_0x5532f2,_0x234d1a){return client[_0xa96a('0x11')](_0x13321e,_0x33b786)['then'](function(_0x32393a){logger[_0xa96a('0x12')](_0xa96a('0x13'),_0x4825fc,_0xa96a('0x14'));logger[_0xa96a('0x15')](_0xa96a('0x16'),_0x4825fc,_0xa96a('0x14'),JSON[_0xa96a('0x17')](_0x32393a));if(_0x32393a[_0xa96a('0x18')]){if(_0x32393a[_0xa96a('0x18')][_0xa96a('0x19')]===0x1f4){logger[_0xa96a('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x4825fc,_0x32393a['error'][_0xa96a('0x1a')]);return _0x234d1a(_0x32393a['error'][_0xa96a('0x1a')]);}logger['error'](_0xa96a('0x13'),_0x4825fc,_0x32393a[_0xa96a('0x18')][_0xa96a('0x1a')]);return _0x5532f2(_0x32393a[_0xa96a('0x18')][_0xa96a('0x1a')]);}else{logger[_0xa96a('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4825fc,_0xa96a('0x14'));_0x5532f2(_0x32393a[_0xa96a('0x1b')]['message']);}})[_0xa96a('0x1c')](function(_0x33298e){logger[_0xa96a('0x18')](_0xa96a('0x13'),_0x4825fc,_0x33298e);_0x234d1a(_0x33298e);});});}exports[_0xa96a('0x1d')]=function(_0x14c8e5){var _0x4e3f58=this;return new Promise(function(_0x190e94,_0x3f41ad){return db['VoiceExtension'][_0xa96a('0x1e')]({'raw':_0x14c8e5['options']?_0x14c8e5[_0xa96a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x14c8e5[_0xa96a('0x1f')]?_0x14c8e5[_0xa96a('0x1f')]['where']||null:null,'attributes':_0x14c8e5['options']?_0x14c8e5[_0xa96a('0x1f')][_0xa96a('0x20')]||null:null,'limit':_0x14c8e5[_0xa96a('0x1f')]?_0x14c8e5[_0xa96a('0x1f')][_0xa96a('0x21')]||null:null,'include':_0x14c8e5[_0xa96a('0x1f')]?_0x14c8e5['options']['include']?_[_0xa96a('0x22')](_0x14c8e5['options'][_0xa96a('0x23')],function(_0x44c4ee){return{'model':db[_0x44c4ee[_0xa96a('0x24')]],'as':_0x44c4ee['as'],'attributes':_0x44c4ee['attributes'],'include':_0x44c4ee[_0xa96a('0x23')]?_['map'](_0x44c4ee['include'],function(_0x4310a9){return{'model':db[_0x4310a9['model']],'as':_0x4310a9['as'],'attributes':_0x4310a9[_0xa96a('0x20')],'include':_0x4310a9[_0xa96a('0x23')]?_[_0xa96a('0x22')](_0x4310a9['include'],function(_0x1bb965){return{'model':db[_0x1bb965['model']],'as':_0x1bb965['as'],'attributes':_0x1bb965['attributes']};}):[]};}):[]};}):[]:[]})[_0xa96a('0x25')](function(_0x5576b9){logger['info'](_0xa96a('0x1d'),_0x14c8e5);logger[_0xa96a('0x15')]('GetVoiceExtension',_0x14c8e5,JSON[_0xa96a('0x17')](_0x5576b9));_0x190e94(_0x5576b9);})[_0xa96a('0x1c')](function(_0x472d59){logger[_0xa96a('0x18')](_0xa96a('0x1d'),_0x472d59['message'],_0x14c8e5);_0x3f41ad(_0x4e3f58[_0xa96a('0x18')](0x1f4,_0x472d59[_0xa96a('0x1a')]));});});};
\ No newline at end of file
+var _0x2159=['message','request\x20sent','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d8843,_0x1c5c72){var _0x5e9873=function(_0x2494b0){while(--_0x2494b0){_0x3d8843['push'](_0x3d8843['shift']());}};_0x5e9873(++_0x1c5c72);}(_0x2159,0x17f));var _0x9215=function(_0xc9b699,_0x4c41d8){_0xc9b699=_0xc9b699-0x0;var _0x387e66=_0x2159[_0xc9b699];return _0x387e66;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var moment=require(_0x9215('0x2'));var BPromise=require(_0x9215('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9215('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9215('0x5'));var logger=require(_0x9215('0x6'))(_0x9215('0x7'));var config=require(_0x9215('0x8'));var jayson=require(_0x9215('0x9'));var client=jayson[_0x9215('0xa')][_0x9215('0xb')]({'port':0x232a});config[_0x9215('0xc')]=_['defaults'](config[_0x9215('0xc')],{'host':_0x9215('0xd'),'port':0x18eb});var socket=require(_0x9215('0xe'))(new Redis(config[_0x9215('0xc')]));require(_0x9215('0xf'))['register'](socket);function respondWithRpcPromise(_0x33b7ed,_0x33be6a,_0x9d11c1){return new BPromise(function(_0xf2a925,_0x57ba44){return client[_0x9215('0x10')](_0x33b7ed,_0x9d11c1)[_0x9215('0x11')](function(_0x4960ba){logger[_0x9215('0x12')](_0x9215('0x13'),_0x33be6a,'request\x20sent');logger[_0x9215('0x14')](_0x9215('0x15'),_0x33be6a,'request\x20sent',JSON[_0x9215('0x16')](_0x4960ba));if(_0x4960ba['error']){if(_0x4960ba[_0x9215('0x17')]['code']===0x1f4){logger[_0x9215('0x17')](_0x9215('0x13'),_0x33be6a,_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);return _0x57ba44(_0x4960ba['error'][_0x9215('0x18')]);}logger[_0x9215('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x33be6a,_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);return _0xf2a925(_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);}else{logger[_0x9215('0x12')](_0x9215('0x13'),_0x33be6a,_0x9215('0x19'));_0xf2a925(_0x4960ba['result'][_0x9215('0x18')]);}})[_0x9215('0x1a')](function(_0x32b658){logger[_0x9215('0x17')](_0x9215('0x13'),_0x33be6a,_0x32b658);_0x57ba44(_0x32b658);});});}exports[_0x9215('0x1b')]=function(_0x315320){var _0x52dc87=this;return new Promise(function(_0x5b8aac,_0x5bc65b){return db[_0x9215('0x1c')][_0x9215('0x1d')]({'raw':_0x315320['options']?_0x315320[_0x9215('0x1e')][_0x9215('0x1f')]===undefined?!![]:![]:!![],'where':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')]['where']||null:null,'attributes':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x20')]||null:null,'limit':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x21')]||null:null,'include':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x22')]?_[_0x9215('0x23')](_0x315320[_0x9215('0x1e')]['include'],function(_0x34092e){return{'model':db[_0x34092e[_0x9215('0x24')]],'as':_0x34092e['as'],'attributes':_0x34092e[_0x9215('0x20')],'include':_0x34092e['include']?_[_0x9215('0x23')](_0x34092e[_0x9215('0x22')],function(_0x4159a3){return{'model':db[_0x4159a3[_0x9215('0x24')]],'as':_0x4159a3['as'],'attributes':_0x4159a3[_0x9215('0x20')],'include':_0x4159a3[_0x9215('0x22')]?_['map'](_0x4159a3[_0x9215('0x22')],function(_0x83774f){return{'model':db[_0x83774f[_0x9215('0x24')]],'as':_0x83774f['as'],'attributes':_0x83774f[_0x9215('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c38eb){logger['info'](_0x9215('0x1b'),_0x315320);logger['debug'](_0x9215('0x1b'),_0x315320,JSON['stringify'](_0x1c38eb));_0x5b8aac(_0x1c38eb);})[_0x9215('0x1a')](function(_0x4ff78a){logger['error'](_0x9215('0x1b'),_0x4ff78a[_0x9215('0x18')],_0x315320);_0x5bc65b(_0x52dc87['error'](0x1f4,_0x4ff78a['message']));});});};
\ No newline at end of file
index 9e654d5..f2be773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x55fcbb,_0x425ec5){var _0x2e76ef=function(_0x335e0c){while(--_0x335e0c){_0x55fcbb['push'](_0x55fcbb['shift']());}};_0x2e76ef(++_0x425ec5);}(_0x4975,0x86));var _0x5497=function(_0x5eb80f,_0x43c90c){_0x5eb80f=_0x5eb80f-0x0;var _0x13770f=_0x4975[_0x5eb80f];return _0x13770f;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}};
\ No newline at end of file
+var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x814b,0x1a2));var _0xb814=function(_0x5d4876,_0x11e6b0){_0x5d4876=_0x5d4876-0x0;var _0x6927ac=_0x814b[_0x5d4876];return _0x6927ac;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}};
\ No newline at end of file
index 1365ef4..55f8906 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x46f79b,_0x2c5e98){var _0x378ae8=function(_0x59f511){while(--_0x59f511){_0x46f79b['push'](_0x46f79b['shift']());}};_0x378ae8(++_0x2c5e98);}(_0x7b84,0x17c));var _0x47b8=function(_0x5391e5,_0x16dea3){_0x5391e5=_0x5391e5-0x0;var _0x58d5d7=_0x7b84[_0x5391e5];return _0x58d5d7;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);module[_0x47b8('0x17')]=router;
\ No newline at end of file
+var _0xffd6=['show','getMessages','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id'];(function(_0x1725c5,_0x55abf2){var _0x3127fd=function(_0x63abd4){while(--_0x63abd4){_0x1725c5['push'](_0x1725c5['shift']());}};_0x3127fd(++_0x55abf2);}(_0xffd6,0x97));var _0x6ffd=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0xffd6[_0x2b81be];return _0x8ed4a7;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id/messages',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['post']('/',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xd')]);router[_0x6ffd('0xe')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xf')]);router[_0x6ffd('0x10')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x11')]);module['exports']=router;
\ No newline at end of file
index 9d7917f..b57feee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a1=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x16a1,0x140));var _0x116a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x16a1[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x116a('0x0')]={'customer_id':{'type':Sequelize[_0x116a('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x116a('0x2'),'unique':_0x116a('0x3')},'mailbox':{'type':Sequelize[_0x116a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x116a('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x116a('0x1')]},'email':{'type':Sequelize[_0x116a('0x1')],'validate':{'isEmail':!![]},'set':function(_0xbbe72c){this[_0x116a('0x4')]('email',typeof _0xbbe72c==='string'&&_0xbbe72c[_0x116a('0x5')]()?_0xbbe72c[_0x116a('0x5')]():null);}},'pager':{'type':Sequelize[_0x116a('0x1')]},'tz':{'type':Sequelize[_0x116a('0x1')],'defaultValue':_0x116a('0x6')},'attach':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':_0x116a('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x116a('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x116a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x116a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x116a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x116a('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x116a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x116a('0x7')](_0x116a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x116a('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x116a('0xa')},'emailsubject':{'type':Sequelize[_0x116a('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x116a('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x116a('0xc')],'get':function(){return this['getDataValue']('fullname')+_0x116a('0xd')+this[_0x116a('0xe')](_0x116a('0xf'));}}};
\ No newline at end of file
+var _0x3422=['contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail'];(function(_0x35269d,_0x59e391){var _0x10f160=function(_0x36ee9f){while(--_0x36ee9f){_0x35269d['push'](_0x35269d['shift']());}};_0x10f160(++_0x59e391);}(_0x3422,0x1a6));var _0x2342=function(_0x5a53dd,_0x5a402f){_0x5a53dd=_0x5a53dd-0x0;var _0x42ddda=_0x3422[_0x5a53dd];return _0x42ddda;};'use strict';var Sequelize=require('sequelize');module[_0x2342('0x0')]={'customer_id':{'type':Sequelize[_0x2342('0x1')]},'context':{'type':Sequelize[_0x2342('0x1')],'defaultValue':_0x2342('0x2'),'unique':_0x2342('0x3')},'mailbox':{'type':Sequelize[_0x2342('0x1')],'defaultValue':'','allowNull':![],'unique':_0x2342('0x3')},'password':{'type':Sequelize[_0x2342('0x1')]},'fullname':{'type':Sequelize[_0x2342('0x1')]},'email':{'type':Sequelize[_0x2342('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4d1894){this[_0x2342('0x4')]('email',typeof _0x4d1894===_0x2342('0x5')&&_0x4d1894[_0x2342('0x6')]()?_0x4d1894[_0x2342('0x6')]():null);}},'pager':{'type':Sequelize[_0x2342('0x1')]},'tz':{'type':Sequelize[_0x2342('0x1')],'defaultValue':_0x2342('0x7')},'attach':{'type':Sequelize[_0x2342('0x8')]('yes','no'),'defaultValue':_0x2342('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x2342('0x1')]},'callback':{'type':Sequelize[_0x2342('0x1')]},'review':{'type':Sequelize[_0x2342('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2342('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':_0x2342('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2342('0x8')](_0x2342('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2342('0x8')]('yes','no'),'defaultValue':_0x2342('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x2342('0x1')]},'maxsecs':{'type':Sequelize[_0x2342('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2342('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2342('0xc')],'get':function(){return this[_0x2342('0xd')](_0x2342('0xe'))+_0x2342('0xf')+this[_0x2342('0xd')](_0x2342('0x10'));}}};
\ No newline at end of file
index 05d4903..692c14a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9354=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','filter','merge','options','VoiceMail','include','findAll','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','VoiceMailMessage','pick','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x4bdd14,_0xc17ef2){var _0x1207fe=function(_0x307dff){while(--_0x307dff){_0x4bdd14['push'](_0x4bdd14['shift']());}};_0x1207fe(++_0xc17ef2);}(_0x9354,0x96));var _0x4935=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x9354[_0x540dcb];return _0x49353c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){var _0x3786ff=_0x4dc1f5[_0x4935('0x24')]({'plain':!![]});var _0x344e51=_0x4935('0x25');return db[_0x4935('0x26')][_0x4935('0x23')]({'where':{'type':_0x344e51,'resourceId':_0x3786ff['id']}})[_0x4935('0x22')](function(){return _0x4dc1f5;});})[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x2c47ab,_0xbb00d6){return function(_0x359522){if(!_0x359522){_0x2c47ab['sendStatus'](0x194);}return _0x359522;};}function handleError(_0x5c3aaa,_0x5cec4d){_0x5cec4d=_0x5cec4d||0x1f4;return function(_0x1fc218){logger[_0x4935('0x27')](_0x1fc218['stack']);if(_0x1fc218[_0x4935('0x28')]){delete _0x1fc218[_0x4935('0x28')];}_0x5c3aaa[_0x4935('0x18')](_0x5cec4d)[_0x4935('0x29')](_0x1fc218);};}exports[_0x4935('0x2a')]=function(_0x24262e,_0x28afc2){var _0x2fe6da={},_0x5b3c8e={},_0xb7fe2a={'count':0x0,'rows':[]};var _0x2dcb0b=_['map'](db['VoiceMail'][_0x4935('0x2b')],function(_0x479d28){return{'name':_0x479d28[_0x4935('0x2c')],'type':_0x479d28[_0x4935('0x2d')][_0x4935('0x2e')]};});_0x5b3c8e['model']=_['map'](_0x2dcb0b,_0x4935('0x28'));_0x5b3c8e[_0x4935('0x2f')]=_['keys'](_0x24262e[_0x4935('0x2f')]);_0x5b3c8e[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5b3c8e[_0x4935('0x32')],_0x5b3c8e[_0x4935('0x2f')]);_0x2fe6da['attributes']=_['intersection'](_0x5b3c8e[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24262e['query']['fields']));_0x2fe6da[_0x4935('0x34')]=_0x2fe6da['attributes'][_0x4935('0x35')]?_0x2fe6da[_0x4935('0x34')]:_0x5b3c8e[_0x4935('0x32')];if(!_0x24262e[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x2fe6da['limit']=qs[_0x4935('0x1c')](_0x24262e['query'][_0x4935('0x1c')]);_0x2fe6da['offset']=qs[_0x4935('0x38')](_0x24262e['query'][_0x4935('0x38')]);}_0x2fe6da[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24262e[_0x4935('0x2f')][_0x4935('0x3a')]);_0x2fe6da[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x24262e['query'],_0x5b3c8e[_0x4935('0x30')]),_0x2dcb0b);if(_0x24262e['query']['filter']){_0x2fe6da[_0x4935('0x3b')]=_['merge'](_0x2fe6da[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x2dcb0b,function(_0x2d67e3){if(_0x2d67e3[_0x4935('0x2d')]!==_0x4935('0x3d')){var _0x53aac5={};_0x53aac5[_0x2d67e3['name']]={'$like':'%'+_0x24262e[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x53aac5;}})});}_0x2fe6da=_[_0x4935('0x3f')]({},_0x2fe6da,_0x24262e[_0x4935('0x40')]);var _0x4d9436={'where':_0x2fe6da[_0x4935('0x3b')]};return db[_0x4935('0x41')][_0x4935('0x1d')](_0x4d9436)['then'](function(_0x4e94f6){_0xb7fe2a[_0x4935('0x1d')]=_0x4e94f6;if(_0x24262e[_0x4935('0x2f')]['includeAll']){_0x2fe6da[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x41')][_0x4935('0x43')](_0x2fe6da);})[_0x4935('0x22')](function(_0x52ab0c){_0xb7fe2a['rows']=_0x52ab0c;return _0xb7fe2a;})[_0x4935('0x22')](respondWithFilteredResult(_0x28afc2,_0x2fe6da))[_0x4935('0x44')](handleError(_0x28afc2,null));};exports['show']=function(_0x1eaa47,_0x40f5ff){var _0x2195da={'raw':!![],'where':{'id':_0x1eaa47[_0x4935('0x45')]['id']}},_0x5135fd={};_0x5135fd[_0x4935('0x32')]=_[_0x4935('0x46')](db[_0x4935('0x41')][_0x4935('0x2b')]);_0x5135fd[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x1eaa47[_0x4935('0x2f')]);_0x5135fd[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],_0x5135fd[_0x4935('0x2f')]);_0x2195da[_0x4935('0x34')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],qs[_0x4935('0x33')](_0x1eaa47[_0x4935('0x2f')][_0x4935('0x33')]));_0x2195da['attributes']=_0x2195da[_0x4935('0x34')]['length']?_0x2195da[_0x4935('0x34')]:_0x5135fd[_0x4935('0x32')];if(_0x1eaa47[_0x4935('0x2f')][_0x4935('0x47')]){_0x2195da['include']=[{'all':!![]}];}_0x2195da=_[_0x4935('0x3f')]({},_0x2195da,_0x1eaa47[_0x4935('0x40')]);return db[_0x4935('0x41')][_0x4935('0x48')](_0x2195da)[_0x4935('0x22')](handleEntityNotFound(_0x40f5ff,null))[_0x4935('0x22')](respondWithResult(_0x40f5ff,null))[_0x4935('0x44')](handleError(_0x40f5ff,null));};exports[_0x4935('0x49')]=function(_0x29b932,_0x392cba){return db['VoiceMail'][_0x4935('0x49')](_0x29b932[_0x4935('0x4a')],{})['then'](function(_0x447a64){var _0x2636f4=_0x29b932[_0x4935('0x4b')][_0x4935('0x24')]({'plain':!![]});if(!_0x2636f4)throw new Error(_0x4935('0x4c'));if(_0x2636f4[_0x4935('0x4d')]===_0x4935('0x4b')){var _0x471fb1=_0x447a64['get']({'plain':!![]});var _0x57d0d9='Voicemails';return db['UserProfileSection'][_0x4935('0x48')]({'where':{'name':_0x57d0d9,'userProfileId':_0x2636f4[_0x4935('0x4e')]},'raw':!![]})[_0x4935('0x22')](function(_0x2072df){if(_0x2072df&&_0x2072df[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0x471fb1[_0x4935('0x28')],'resourceId':_0x471fb1['id'],'type':_0x2072df[_0x4935('0x28')],'sectionId':_0x2072df['id']},{})[_0x4935('0x22')](function(){return _0x447a64;});}else{return _0x447a64;}})[_0x4935('0x44')](function(_0x8196b4){logger[_0x4935('0x27')](_0x4935('0x50'),_0x8196b4);throw _0x8196b4;});}return _0x447a64;})[_0x4935('0x22')](respondWithResult(_0x392cba,0xc9))[_0x4935('0x44')](handleError(_0x392cba,null));};exports['update']=function(_0x24b83b,_0x4e99bb){if(_0x24b83b[_0x4935('0x4a')]['id']){delete _0x24b83b[_0x4935('0x4a')]['id'];}return db['VoiceMail'][_0x4935('0x48')]({'where':{'id':_0x24b83b['params']['id']}})['then'](handleEntityNotFound(_0x4e99bb,null))['then'](saveUpdates(_0x24b83b[_0x4935('0x4a')],null))[_0x4935('0x22')](respondWithResult(_0x4e99bb,null))[_0x4935('0x44')](handleError(_0x4e99bb,null));};exports[_0x4935('0x23')]=function(_0xd5a489,_0x56db7f){return db['VoiceMail'][_0x4935('0x48')]({'where':{'id':_0xd5a489[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x56db7f,null))['then'](removeEntity(_0x56db7f,null))[_0x4935('0x44')](handleError(_0x56db7f,null));};exports[_0x4935('0x51')]=function(_0x24141a,_0xc92288,_0x5009c9){return db[_0x4935('0x41')]['findOne']({'where':{'id':_0x24141a['params']['id']}})['then'](handleEntityNotFound(_0xc92288,null))[_0x4935('0x22')](function(_0x10cd78){var _0x47e73d;var _0x3190d2={},_0x395eba={};_0x395eba['model']=_[_0x4935('0x46')](db[_0x4935('0x52')][_0x4935('0x2b')]);_0x395eba[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x24141a[_0x4935('0x2f')]);_0x395eba[_0x4935('0x30')]=_['intersection'](_0x395eba[_0x4935('0x32')],_0x395eba['query']);_0x3190d2['attributes']=_[_0x4935('0x31')](_0x395eba[_0x4935('0x32')],qs['fields'](_0x24141a['query'][_0x4935('0x33')]));_0x3190d2[_0x4935('0x34')]=_0x3190d2[_0x4935('0x34')]['length']?_0x3190d2[_0x4935('0x34')]:_0x395eba['model'];if(!_0x24141a[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x3190d2[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x24141a['query'][_0x4935('0x1c')]);_0x3190d2[_0x4935('0x38')]=qs['offset'](_0x24141a[_0x4935('0x2f')][_0x4935('0x38')]);}_0x3190d2[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24141a[_0x4935('0x2f')][_0x4935('0x3a')]);_0x3190d2[_0x4935('0x3b')]=qs[_0x4935('0x30')](_[_0x4935('0x53')](_0x24141a[_0x4935('0x2f')],_0x395eba[_0x4935('0x30')]));if(_0x24141a['query'][_0x4935('0x3e')]){_0x3190d2[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x3190d2[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x3190d2[_0x4935('0x34')],function(_0x2c06f5){var _0x9023e={};_0x9023e[_0x2c06f5]={'$like':'%'+_0x24141a[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x9023e;})});}_0x3190d2[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x3190d2[_0x4935('0x3b')],{'mailboxuser':_0x10cd78['mailbox']});_0x3190d2=_['merge']({},_0x3190d2,_0x24141a[_0x4935('0x40')]);return db[_0x4935('0x52')]['findAndCountAll'](_0x3190d2)[_0x4935('0x22')](respondWithFilteredResult(_0xc92288,_0x3190d2));})[_0x4935('0x44')](handleError(_0xc92288,null));};
\ No newline at end of file
+var _0xbdb7=['map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','include','find','create','body','role','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','destroy','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','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','update','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName'];(function(_0x430014,_0x348dbb){var _0x185521=function(_0x3a2a61){while(--_0x3a2a61){_0x430014['push'](_0x430014['shift']());}};_0x185521(++_0x348dbb);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x6171c0,_0x127af3){_0x6171c0=_0x6171c0-0x0;var _0x227390=_0xbdb7[_0x6171c0];return _0x227390;};'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(){var _0x3c423f=_0x3a456f['get']({'plain':!![]});var _0x47abaf='Voicemails';return db[_0x7bdb('0x23')]['destroy']({'where':{'type':_0x47abaf,'resourceId':_0x3c423f['id']}})[_0x7bdb('0x24')](function(){return _0x3a456f;});})[_0x7bdb('0x24')](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)[_0x7bdb('0x17')]();});}};}function handleEntityNotFound(_0x2a494e,_0x523869){return function(_0x10e818){if(!_0x10e818){_0x2a494e[_0x7bdb('0x25')](0x194);}return _0x10e818;};}function handleError(_0x399b62,_0xe1141d){_0xe1141d=_0xe1141d||0x1f4;return function(_0x371e8a){logger[_0x7bdb('0x26')](_0x371e8a[_0x7bdb('0x27')]);if(_0x371e8a[_0x7bdb('0x28')]){delete _0x371e8a[_0x7bdb('0x28')];}_0x399b62[_0x7bdb('0x1d')](_0xe1141d)[_0x7bdb('0x29')](_0x371e8a);};}exports[_0x7bdb('0x2a')]=function(_0x5b386d,_0x388a45){var _0x23fc3a={},_0x8f7672={},_0x9f5c1={'count':0x0,'rows':[]};var _0x29eac5=_['map'](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')],function(_0x9ac56){return{'name':_0x9ac56[_0x7bdb('0x2d')],'type':_0x9ac56['type']['key']};});_0x8f7672['model']=_[_0x7bdb('0x2e')](_0x29eac5,'name');_0x8f7672[_0x7bdb('0x2f')]=_['keys'](_0x5b386d[_0x7bdb('0x2f')]);_0x8f7672[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x8f7672['model'],_0x8f7672[_0x7bdb('0x2f')]);_0x23fc3a['attributes']=_['intersection'](_0x8f7672[_0x7bdb('0x32')],qs['fields'](_0x5b386d[_0x7bdb('0x2f')]['fields']));_0x23fc3a['attributes']=_0x23fc3a[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x23fc3a[_0x7bdb('0x33')]:_0x8f7672[_0x7bdb('0x32')];if(!_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x35')]('nolimit')){_0x23fc3a[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);_0x23fc3a[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x19')]);}_0x23fc3a[_0x7bdb('0x36')]=qs['sort'](_0x5b386d['query'][_0x7bdb('0x37')]);_0x23fc3a[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x5b386d[_0x7bdb('0x2f')],_0x8f7672['filters']),_0x29eac5);if(_0x5b386d['query'][_0x7bdb('0x3a')]){_0x23fc3a['where']=_[_0x7bdb('0x3b')](_0x23fc3a['where'],{'$or':_[_0x7bdb('0x2e')](_0x29eac5,function(_0x5d1826){if(_0x5d1826['type']!==_0x7bdb('0x3c')){var _0x2d578e={};_0x2d578e[_0x5d1826[_0x7bdb('0x28')]]={'$like':'%'+_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x2d578e;}})});}_0x23fc3a=_[_0x7bdb('0x3b')]({},_0x23fc3a,_0x5b386d[_0x7bdb('0x3d')]);var _0x501aff={'where':_0x23fc3a['where']};return db[_0x7bdb('0x2b')][_0x7bdb('0x1c')](_0x501aff)[_0x7bdb('0x24')](function(_0x3509e4){_0x9f5c1[_0x7bdb('0x1c')]=_0x3509e4;if(_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x23fc3a['include']=[{'all':!![]}];}return db['VoiceMail'][_0x7bdb('0x3f')](_0x23fc3a);})[_0x7bdb('0x24')](function(_0x4636f8){_0x9f5c1[_0x7bdb('0x40')]=_0x4636f8;return _0x9f5c1;})['then'](respondWithFilteredResult(_0x388a45,_0x23fc3a))[_0x7bdb('0x41')](handleError(_0x388a45,null));};exports['show']=function(_0x37029b,_0x27de25){var _0x218361={'raw':!![],'where':{'id':_0x37029b[_0x7bdb('0x42')]['id']}},_0x264f3a={};_0x264f3a[_0x7bdb('0x32')]=_[_0x7bdb('0x43')](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')]);_0x264f3a['query']=_[_0x7bdb('0x43')](_0x37029b[_0x7bdb('0x2f')]);_0x264f3a['filters']=_[_0x7bdb('0x31')](_0x264f3a['model'],_0x264f3a[_0x7bdb('0x2f')]);_0x218361[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x264f3a[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x37029b['query'][_0x7bdb('0x44')]));_0x218361[_0x7bdb('0x33')]=_0x218361[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x218361[_0x7bdb('0x33')]:_0x264f3a['model'];if(_0x37029b[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x218361[_0x7bdb('0x45')]=[{'all':!![]}];}_0x218361=_[_0x7bdb('0x3b')]({},_0x218361,_0x37029b[_0x7bdb('0x3d')]);return db[_0x7bdb('0x2b')][_0x7bdb('0x46')](_0x218361)[_0x7bdb('0x24')](handleEntityNotFound(_0x27de25,null))[_0x7bdb('0x24')](respondWithResult(_0x27de25,null))[_0x7bdb('0x41')](handleError(_0x27de25,null));};exports['create']=function(_0x189cf8,_0x58c4bc){return db['VoiceMail'][_0x7bdb('0x47')](_0x189cf8[_0x7bdb('0x48')],{})['then'](function(_0x37780a){var _0x186809=_0x189cf8['user']['get']({'plain':!![]});if(!_0x186809)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186809[_0x7bdb('0x49')]===_0x7bdb('0x4a')){var _0x2fab74=_0x37780a[_0x7bdb('0x4b')]({'plain':!![]});var _0x33687b=_0x7bdb('0x4c');return db[_0x7bdb('0x4d')][_0x7bdb('0x46')]({'where':{'name':_0x33687b,'userProfileId':_0x186809[_0x7bdb('0x4e')]},'raw':!![]})[_0x7bdb('0x24')](function(_0x5a8d4a){if(_0x5a8d4a&&_0x5a8d4a[_0x7bdb('0x4f')]===0x0){return db['UserProfileResource'][_0x7bdb('0x47')]({'name':_0x2fab74[_0x7bdb('0x28')],'resourceId':_0x2fab74['id'],'type':_0x5a8d4a[_0x7bdb('0x28')],'sectionId':_0x5a8d4a['id']},{})[_0x7bdb('0x24')](function(){return _0x37780a;});}else{return _0x37780a;}})['catch'](function(_0x258f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258f29);throw _0x258f29;});}return _0x37780a;})[_0x7bdb('0x24')](respondWithResult(_0x58c4bc,0xc9))[_0x7bdb('0x41')](handleError(_0x58c4bc,null));};exports['update']=function(_0x4e17f3,_0x49bb3f){if(_0x4e17f3[_0x7bdb('0x48')]['id']){delete _0x4e17f3['body']['id'];}return db['VoiceMail'][_0x7bdb('0x46')]({'where':{'id':_0x4e17f3[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x49bb3f,null))[_0x7bdb('0x24')](saveUpdates(_0x4e17f3['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x49bb3f,null))['catch'](handleError(_0x49bb3f,null));};exports[_0x7bdb('0x50')]=function(_0x7f2d89,_0x82f990){return db[_0x7bdb('0x2b')][_0x7bdb('0x46')]({'where':{'id':_0x7f2d89[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x82f990,null))[_0x7bdb('0x24')](removeEntity(_0x82f990,null))[_0x7bdb('0x41')](handleError(_0x82f990,null));};exports[_0x7bdb('0x51')]=function(_0x58658e,_0x2b5493,_0x1d9927){return db['VoiceMail'][_0x7bdb('0x52')]({'where':{'id':_0x58658e['params']['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2b5493,null))[_0x7bdb('0x24')](function(_0x4f3f8c){var _0x478bbd;var _0x21a54f={},_0x2a6c5b={};_0x2a6c5b['model']=_[_0x7bdb('0x43')](db['VoiceMailMessage'][_0x7bdb('0x2c')]);_0x2a6c5b['query']=_['keys'](_0x58658e[_0x7bdb('0x2f')]);_0x2a6c5b[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],_0x2a6c5b[_0x7bdb('0x2f')]);_0x21a54f[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x44')]));_0x21a54f[_0x7bdb('0x33')]=_0x21a54f['attributes'][_0x7bdb('0x34')]?_0x21a54f[_0x7bdb('0x33')]:_0x2a6c5b['model'];if(!_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x35')](_0x7bdb('0x53'))){_0x21a54f[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x58658e['query'][_0x7bdb('0x1b')]);_0x21a54f[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x58658e['query'][_0x7bdb('0x19')]);}_0x21a54f[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x37')]);_0x21a54f[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x58658e[_0x7bdb('0x2f')],_0x2a6c5b['filters']));if(_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]){_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f[_0x7bdb('0x38')],{'$or':_[_0x7bdb('0x2e')](_0x21a54f[_0x7bdb('0x33')],function(_0x86c6ed){var _0x4565c2={};_0x4565c2[_0x86c6ed]={'$like':'%'+_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x4565c2;})});}_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f['where'],{'mailboxuser':_0x4f3f8c[_0x7bdb('0x54')]});_0x21a54f=_['merge']({},_0x21a54f,_0x58658e[_0x7bdb('0x3d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x56')](_0x21a54f)['then'](respondWithFilteredResult(_0x2b5493,_0x21a54f));})[_0x7bdb('0x41')](handleError(_0x2b5493,null));};
\ No newline at end of file
index 6b2b678..18d4000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2a=['define','VoiceMail','mailbox_context','mailbox','context','lodash','util','api','moment','request-promise','path','rimraf','exports'];(function(_0x54b777,_0x1a1d36){var _0x5630fb=function(_0x324ca1){while(--_0x324ca1){_0x54b777['push'](_0x54b777['shift']());}};_0x5630fb(++_0x1a1d36);}(_0xfa2a,0x116));var _0xafa2=function(_0x162957,_0x2cb86b){_0x162957=_0x162957-0x0;var _0x4e14f4=_0xfa2a[_0x162957];return _0x4e14f4;};'use strict';var _=require(_0xafa2('0x0'));var util=require(_0xafa2('0x1'));var logger=require('../../config/logger')(_0xafa2('0x2'));var moment=require(_0xafa2('0x3'));var BPromise=require('bluebird');var rp=require(_0xafa2('0x4'));var fs=require('fs');var path=require(_0xafa2('0x5'));var rimraf=require(_0xafa2('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0xafa2('0x7')]=function(_0x3b4dd5,_0x1af26d){return _0x3b4dd5[_0xafa2('0x8')](_0xafa2('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xafa2('0xa'),'fields':[_0xafa2('0xb'),_0xafa2('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6696=['request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x134467,_0x40bd2a){var _0x2ab317=function(_0x575401){while(--_0x575401){_0x134467['push'](_0x134467['shift']());}};_0x2ab317(++_0x40bd2a);}(_0x6696,0x172));var _0x6669=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6696[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x6669('0x0'));var util=require(_0x6669('0x1'));var logger=require(_0x6669('0x2'))(_0x6669('0x3'));var moment=require('moment');var BPromise=require(_0x6669('0x4'));var rp=require(_0x6669('0x5'));var fs=require('fs');var path=require(_0x6669('0x6'));var rimraf=require(_0x6669('0x7'));var config=require(_0x6669('0x8'));var attributes=require(_0x6669('0x9'));module[_0x6669('0xa')]=function(_0xb9cb70,_0x5dc4f2){return _0xb9cb70['define']('VoiceMail',attributes,{'tableName':_0x6669('0xb'),'paranoid':![],'indexes':[{'name':_0x6669('0xc'),'fields':[_0x6669('0xd'),_0x6669('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 35e018b..cec2015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2590=['message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b23c9,_0x376ccd){var _0x320014=function(_0xb0b66a){while(--_0xb0b66a){_0x1b23c9['push'](_0x1b23c9['shift']());}};_0x320014(++_0x376ccd);}(_0x2590,0x117));var _0x0259=function(_0x1481da,_0x2e71bb){_0x1481da=_0x1481da-0x0;var _0x3ea518=_0x2590[_0x1481da];return _0x3ea518;};'use strict';var _=require(_0x0259('0x0'));var util=require(_0x0259('0x1'));var moment=require(_0x0259('0x2'));var BPromise=require(_0x0259('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0259('0x4'));var db=require(_0x0259('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0259('0x6'))(_0x0259('0x7'));var config=require(_0x0259('0x8'));var jayson=require(_0x0259('0x9'));var client=jayson[_0x0259('0xa')][_0x0259('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46adda,_0x5b7ff4,_0x25a1bf){return new BPromise(function(_0x34fc6f,_0x3c06d3){return client[_0x0259('0xc')](_0x46adda,_0x25a1bf)['then'](function(_0x3d4279){logger[_0x0259('0xd')](_0x0259('0xe'),_0x5b7ff4,'request\x20sent');logger[_0x0259('0xf')](_0x0259('0x10'),_0x5b7ff4,'request\x20sent',JSON[_0x0259('0x11')](_0x3d4279));if(_0x3d4279[_0x0259('0x12')]){if(_0x3d4279[_0x0259('0x12')][_0x0259('0x13')]===0x1f4){logger[_0x0259('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5b7ff4,_0x3d4279['error'][_0x0259('0x14')]);return _0x3c06d3(_0x3d4279[_0x0259('0x12')]['message']);}logger[_0x0259('0x12')](_0x0259('0xe'),_0x5b7ff4,_0x3d4279[_0x0259('0x12')][_0x0259('0x14')]);return _0x34fc6f(_0x3d4279[_0x0259('0x12')][_0x0259('0x14')]);}else{logger['info'](_0x0259('0xe'),_0x5b7ff4,_0x0259('0x15'));_0x34fc6f(_0x3d4279['result']['message']);}})[_0x0259('0x16')](function(_0x17c72d){logger[_0x0259('0x12')](_0x0259('0xe'),_0x5b7ff4,_0x17c72d);_0x3c06d3(_0x17c72d);});});}
\ No newline at end of file
+var _0x2332=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x5e952c,_0x5276b1){var _0x4b7448=function(_0x3b4965){while(--_0x3b4965){_0x5e952c['push'](_0x5e952c['shift']());}};_0x4b7448(++_0x5276b1);}(_0x2332,0x1a1));var _0x2233=function(_0x309b49,_0x351de6){_0x309b49=_0x309b49-0x0;var _0x200521=_0x2332[_0x309b49];return _0x200521;};'use strict';var _=require(_0x2233('0x0'));var util=require(_0x2233('0x1'));var moment=require(_0x2233('0x2'));var BPromise=require(_0x2233('0x3'));var rs=require(_0x2233('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2233('0x5'))(_0x2233('0x6'));var config=require(_0x2233('0x7'));var jayson=require(_0x2233('0x8'));var client=jayson[_0x2233('0x9')][_0x2233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a67c9,_0x57f2e0,_0x61a452){return new BPromise(function(_0x589d6d,_0x2eb3ed){return client[_0x2233('0xb')](_0x5a67c9,_0x61a452)[_0x2233('0xc')](function(_0x9aa349){logger['info'](_0x2233('0xd'),_0x57f2e0,_0x2233('0xe'));logger['debug'](_0x2233('0xf'),_0x57f2e0,_0x2233('0xe'),JSON[_0x2233('0x10')](_0x9aa349));if(_0x9aa349[_0x2233('0x11')]){if(_0x9aa349[_0x2233('0x11')]['code']===0x1f4){logger[_0x2233('0x11')]('VoiceMail,\x20%s,\x20%s',_0x57f2e0,_0x9aa349[_0x2233('0x11')][_0x2233('0x12')]);return _0x2eb3ed(_0x9aa349[_0x2233('0x11')][_0x2233('0x12')]);}logger['error'](_0x2233('0xd'),_0x57f2e0,_0x9aa349['error'][_0x2233('0x12')]);return _0x589d6d(_0x9aa349[_0x2233('0x11')]['message']);}else{logger['info'](_0x2233('0xd'),_0x57f2e0,_0x2233('0xe'));_0x589d6d(_0x9aa349[_0x2233('0x13')][_0x2233('0x12')]);}})['catch'](function(_0x26ad87){logger[_0x2233('0x11')](_0x2233('0xd'),_0x57f2e0,_0x26ad87);_0x2eb3ed(_0x26ad87);});});}
\ No newline at end of file
index bf74552..a77b91e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9f4=['post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','show','get','/:id/download'];(function(_0x4f90e4,_0x1a46cf){var _0x1f841b=function(_0x167f60){while(--_0x167f60){_0x4f90e4['push'](_0x4f90e4['shift']());}};_0x1f841b(++_0x1a46cf);}(_0xd9f4,0x196));var _0x4d9f=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xd9f4[_0x247fa1];return _0x244f35;};'use strict';var multer=require('multer');var util=require(_0x4d9f('0x0'));var path=require(_0x4d9f('0x1'));var timeout=require(_0x4d9f('0x2'));var express=require(_0x4d9f('0x3'));var router=express[_0x4d9f('0x4')]();var fs_extra=require(_0x4d9f('0x5'));var auth=require(_0x4d9f('0x6'));var interaction=require(_0x4d9f('0x7'));var config=require('../../config/environment');var controller=require(_0x4d9f('0x8'));router['get']('/',auth[_0x4d9f('0x9')](),controller[_0x4d9f('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4d9f('0xb')]);router[_0x4d9f('0xc')](_0x4d9f('0xd'),auth[_0x4d9f('0x9')](),controller['download']);router[_0x4d9f('0xe')]('/',auth['isAuthenticated'](),controller[_0x4d9f('0xf')]);router['put']('/:id',auth[_0x4d9f('0x9')](),controller[_0x4d9f('0x10')]);router[_0x4d9f('0x11')]('/:id',auth[_0x4d9f('0x9')](),controller[_0x4d9f('0x12')]);module[_0x4d9f('0x13')]=router;
\ No newline at end of file
+var _0x78df=['../../components/interaction/service','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','put','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0xd49fef,_0x23f01e){var _0x304be8=function(_0x59698b){while(--_0x59698b){_0xd49fef['push'](_0xd49fef['shift']());}};_0x304be8(++_0x23f01e);}(_0x78df,0x109));var _0xf78d=function(_0x5f335d,_0x54729c){_0x5f335d=_0x5f335d-0x0;var _0x117ff4=_0x78df[_0x5f335d];return _0x117ff4;};'use strict';var multer=require(_0xf78d('0x0'));var util=require(_0xf78d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf78d('0x2'));var router=express[_0xf78d('0x3')]();var fs_extra=require(_0xf78d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf78d('0x5'));var config=require('../../config/environment');var controller=require(_0xf78d('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf78d('0x7')](_0xf78d('0x8'),auth[_0xf78d('0x9')](),controller[_0xf78d('0xa')]);router[_0xf78d('0x7')](_0xf78d('0xb'),auth[_0xf78d('0x9')](),controller[_0xf78d('0xc')]);router[_0xf78d('0xd')]('/',auth[_0xf78d('0x9')](),controller['create']);router[_0xf78d('0xe')](_0xf78d('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xf78d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf78d('0x10')]);module[_0xf78d('0x11')]=router;
\ No newline at end of file
index 4ce2d8a..530539f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x069f=['literal','sequelize','exports','getDataValue','INTEGER','STRING','TIMESTAMP'];(function(_0xf1ad4d,_0x6c476b){var _0x1275d4=function(_0x225a9d){while(--_0x225a9d){_0xf1ad4d['push'](_0xf1ad4d['shift']());}};_0x1275d4(++_0x6c476b);}(_0x069f,0x19e));var _0xf069=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x069f[_0xa3400];return _0x33dba2;};'use strict';var Sequelize=require(_0xf069('0x0'));module[_0xf069('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x246bef){return this[_0xf069('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf069('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf069('0x4')],'defaultValue':''},'stamp':{'type':_0xf069('0x5'),'defaultValue':Sequelize[_0xf069('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0xb2d2=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x3167d0,_0x206206){var _0x39c0ea=function(_0x195e84){while(--_0x195e84){_0x3167d0['push'](_0x3167d0['shift']());}};_0x39c0ea(++_0x206206);}(_0xb2d2,0x152));var _0x2b2d=function(_0x572b77,_0x4d16df){_0x572b77=_0x572b77-0x0;var _0x4ce3a7=_0xb2d2[_0x572b77];return _0x4ce3a7;};'use strict';var Sequelize=require(_0x2b2d('0x0'));module[_0x2b2d('0x1')]={'name':{'type':Sequelize[_0x2b2d('0x2')],'get':function(_0xb0af4){return this[_0x2b2d('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x2b2d('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x2b2d('0x6')](_0x2b2d('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x2b2d('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2b2d('0x8'),'defaultValue':Sequelize[_0x2b2d('0x9')](_0x2b2d('0xa'))}};
\ No newline at end of file
index 0a953c0..f9023ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa06c=['msg_id','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','VoiceMailMessage','fieldName','differenceBy','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','download','recording'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0xa06c,0xaa));var _0xca06=function(_0x2bb530,_0x13bf37){_0x2bb530=_0x2bb530-0x0;var _0x1cde90=_0xa06c[_0x2bb530];return _0x1cde90;};'use strict';var emlformat=require(_0xca06('0x0'));var rimraf=require(_0xca06('0x1'));var zipdir=require(_0xca06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca06('0x3'));var moment=require(_0xca06('0x4'));var BPromise=require(_0xca06('0x5'));var Mustache=require(_0xca06('0x6'));var util=require(_0xca06('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xca06('0x8'));var ejs=require(_0xca06('0x9'));var fs=require('fs');var fs_extra=require(_0xca06('0xa'));var _=require(_0xca06('0xb'));var squel=require(_0xca06('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xca06('0xd'));var toCsv=require(_0xca06('0x8'));var querystring=require(_0xca06('0xe'));var Papa=require(_0xca06('0xf'));var Redis=require(_0xca06('0x10'));var authService=require(_0xca06('0x11'));var qs=require(_0xca06('0x12'));var as=require(_0xca06('0x13'));var hardwareService=require(_0xca06('0x14'));var logger=require(_0xca06('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xca06('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca06('0x17'))['db'];function respondWithStatusCode(_0x2521bb,_0x1d7f24){_0x1d7f24=_0x1d7f24||0xcc;return function(_0x3bb79b){if(_0x3bb79b){return _0x2521bb['sendStatus'](_0x1d7f24);}return _0x2521bb['status'](_0x1d7f24)[_0xca06('0x18')]();};}function respondWithResult(_0x398d25,_0x239e11){_0x239e11=_0x239e11||0xc8;return function(_0x4bca4b){if(_0x4bca4b){return _0x398d25[_0xca06('0x19')](_0x239e11)['json'](_0x4bca4b);}};}function respondWithFilteredResult(_0x47f275,_0x4db678){return function(_0x56dc74){if(_0x56dc74){var _0x4739d6=typeof _0x4db678['offset']===_0xca06('0x1a')&&typeof _0x4db678[_0xca06('0x1b')]===_0xca06('0x1a');var _0x511524=_0x56dc74[_0xca06('0x1c')];var _0x3dfe03=_0x4739d6?0x0:_0x4db678['offset'];var _0x336336=_0x4739d6?_0x56dc74[_0xca06('0x1c')]:_0x4db678[_0xca06('0x1d')]+_0x4db678['limit'];var _0x458cde;if(_0x336336>=_0x511524){_0x336336=_0x511524;_0x458cde=0xc8;}else{_0x458cde=0xce;}_0x47f275[_0xca06('0x19')](_0x458cde);return _0x47f275[_0xca06('0x1e')](_0xca06('0x1f'),_0x3dfe03+'-'+_0x336336+'/'+_0x511524)[_0xca06('0x20')](_0x56dc74);}return null;};}function patchUpdates(_0x1b2dcd){return function(_0x4ef44e){try{jsonpatch[_0xca06('0x21')](_0x4ef44e,_0x1b2dcd,!![]);}catch(_0x58ac9a){return BPromise['reject'](_0x58ac9a);}return _0x4ef44e[_0xca06('0x22')]();};}function saveUpdates(_0x1aea47,_0x57f7ab){return function(_0x2d6908){if(_0x2d6908){return _0x2d6908[_0xca06('0x23')](_0x1aea47)[_0xca06('0x24')](function(_0x756891){return _0x756891;});}return null;};}function removeEntity(_0x1398d7,_0x45744c){return function(_0x20ba36){if(_0x20ba36){return _0x20ba36[_0xca06('0x25')]()['then'](function(){_0x1398d7[_0xca06('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8ecf,_0x36492a){return function(_0x1ba157){if(!_0x1ba157){_0x2b8ecf[_0xca06('0x26')](0x194);}return _0x1ba157;};}function handleError(_0xdc6865,_0x4d759e){_0x4d759e=_0x4d759e||0x1f4;return function(_0x2005e2){logger['error'](_0x2005e2[_0xca06('0x27')]);if(_0x2005e2['name']){delete _0x2005e2[_0xca06('0x28')];}_0xdc6865[_0xca06('0x19')](_0x4d759e)[_0xca06('0x29')](_0x2005e2);};}exports['index']=function(_0x787352,_0x238be7){var _0x3b3f3e={},_0x48cd87={},_0x12de06={'count':0x0,'rows':[]};var _0x1a4979=_['map'](db[_0xca06('0x2a')]['rawAttributes'],function(_0x1aaa72){return{'name':_0x1aaa72[_0xca06('0x2b')],'type':_0x1aaa72['type']['key']};});_0x48cd87['model']=_[_0xca06('0x2c')](_['map'](_0x1a4979,_0xca06('0x28')),[_0xca06('0x28')]);_0x48cd87[_0xca06('0x2d')]=_[_0xca06('0x2e')](_0x787352['query']);_0x48cd87['filters']=_[_0xca06('0x2f')](_0x48cd87[_0xca06('0x30')],_0x48cd87['query']);_0x3b3f3e['attributes']=_['intersection'](_0x48cd87[_0xca06('0x30')],qs[_0xca06('0x31')](_0x787352['query'][_0xca06('0x31')]));_0x3b3f3e['attributes']=_0x3b3f3e[_0xca06('0x32')][_0xca06('0x33')]?_0x3b3f3e['attributes']:_0x48cd87[_0xca06('0x30')];if(!_0x787352[_0xca06('0x2d')][_0xca06('0x34')](_0xca06('0x35'))){_0x3b3f3e[_0xca06('0x1b')]=qs[_0xca06('0x1b')](_0x787352[_0xca06('0x2d')][_0xca06('0x1b')]);_0x3b3f3e[_0xca06('0x1d')]=qs['offset'](_0x787352[_0xca06('0x2d')]['offset']);}_0x3b3f3e['order']=qs[_0xca06('0x36')](_0x787352[_0xca06('0x2d')]['sort']);_0x3b3f3e[_0xca06('0x37')]=qs[_0xca06('0x38')](_[_0xca06('0x39')](_0x787352[_0xca06('0x2d')],_0x48cd87[_0xca06('0x38')]),_0x1a4979);if(_0x787352[_0xca06('0x2d')]['filter']){_0x3b3f3e[_0xca06('0x37')]=_[_0xca06('0x3a')](_0x3b3f3e[_0xca06('0x37')],{'$or':_['map'](_0x1a4979,function(_0x347695){if(_0x347695[_0xca06('0x3b')]!==_0xca06('0x3c')){var _0x44b4b3={};_0x44b4b3[_0x347695[_0xca06('0x28')]]={'$like':'%'+_0x787352['query'][_0xca06('0x3d')]+'%'};return _0x44b4b3;}})});}_0x3b3f3e=_[_0xca06('0x3a')]({},_0x3b3f3e,_0x787352[_0xca06('0x3e')]);var _0x555f73={'where':_0x3b3f3e[_0xca06('0x37')]};return db[_0xca06('0x2a')][_0xca06('0x1c')](_0x555f73)[_0xca06('0x24')](function(_0x133733){_0x12de06[_0xca06('0x1c')]=_0x133733;if(_0x787352[_0xca06('0x2d')]['includeAll']){_0x3b3f3e[_0xca06('0x3f')]=[{'all':!![]}];}return db[_0xca06('0x2a')][_0xca06('0x40')](_0x3b3f3e);})[_0xca06('0x24')](function(_0x3c6ec0){_0x12de06[_0xca06('0x41')]=_0x3c6ec0;return _0x12de06;})[_0xca06('0x24')](respondWithFilteredResult(_0x238be7,_0x3b3f3e))[_0xca06('0x42')](handleError(_0x238be7,null));};exports[_0xca06('0x43')]=function(_0x41a73f,_0x5cd36b){var _0x36f3c6={'raw':!![],'where':{'id':_0x41a73f[_0xca06('0x44')]['id']}},_0x113567={};_0x113567[_0xca06('0x30')]=_['keys'](db['VoiceMailMessage'][_0xca06('0x45')]);_0x113567[_0xca06('0x2d')]=_[_0xca06('0x2e')](_0x41a73f[_0xca06('0x2d')]);_0x113567['filters']=_[_0xca06('0x2f')](_0x113567[_0xca06('0x30')],_0x113567[_0xca06('0x2d')]);_0x36f3c6['attributes']=_[_0xca06('0x2f')](_0x113567['model'],qs[_0xca06('0x31')](_0x41a73f['query']['fields']));_0x36f3c6[_0xca06('0x32')]=_0x36f3c6[_0xca06('0x32')][_0xca06('0x33')]?_0x36f3c6[_0xca06('0x32')]:_0x113567[_0xca06('0x30')];if(_0x41a73f['query'][_0xca06('0x46')]){_0x36f3c6[_0xca06('0x3f')]=[{'all':!![]}];}_0x36f3c6=_[_0xca06('0x3a')]({},_0x36f3c6,_0x41a73f[_0xca06('0x3e')]);return db['VoiceMailMessage'][_0xca06('0x47')](_0x36f3c6)[_0xca06('0x24')](handleEntityNotFound(_0x5cd36b,null))[_0xca06('0x24')](respondWithResult(_0x5cd36b,null))['catch'](handleError(_0x5cd36b,null));};exports[_0xca06('0x48')]=function(_0x176cfd,_0x308ff1){return db[_0xca06('0x2a')][_0xca06('0x48')](_0x176cfd['body'],{})[_0xca06('0x24')](respondWithResult(_0x308ff1,0xc9))[_0xca06('0x42')](handleError(_0x308ff1,null));};exports[_0xca06('0x23')]=function(_0x23ee14,_0x11a612){if(_0x23ee14[_0xca06('0x49')]['id']){delete _0x23ee14[_0xca06('0x49')]['id'];}return db['VoiceMailMessage'][_0xca06('0x47')]({'where':{'id':_0x23ee14[_0xca06('0x44')]['id']}})['then'](handleEntityNotFound(_0x11a612,null))[_0xca06('0x24')](saveUpdates(_0x23ee14[_0xca06('0x49')],null))[_0xca06('0x24')](respondWithResult(_0x11a612,null))['catch'](handleError(_0x11a612,null));};exports[_0xca06('0x25')]=function(_0x48b774,_0x6faec2){return db[_0xca06('0x2a')]['find']({'where':{'id':_0x48b774['params']['id']}})['then'](handleEntityNotFound(_0x6faec2,null))[_0xca06('0x24')](removeEntity(_0x6faec2,null))[_0xca06('0x42')](handleError(_0x6faec2,null));};exports[_0xca06('0x4a')]=function(_0x2150e8,_0x26bfc0,_0x5378b3){return db[_0xca06('0x2a')][_0xca06('0x47')]({'where':{'id':_0x2150e8[_0xca06('0x44')]['id']},'attributes':['id',_0xca06('0x4b'),_0xca06('0x4c')]})['then'](handleEntityNotFound(_0x26bfc0,null))[_0xca06('0x24')](function(_0x2f885d){if(_0x2f885d){if(!_0x2f885d[_0xca06('0x4b')]){throw new db['Sequelize']['ValidationError'](_0xca06('0x4d'));}var _0x1aebb0={'Content-Type':'audio/wav','Content-Disposition':_0xca06('0x4e')};if(_0x2f885d[_0xca06('0x4c')]){_0x1aebb0[_0xca06('0x4f')]=_0xca06('0x50')+_0x2f885d[_0xca06('0x4c')]+_0xca06('0x51');}_0x26bfc0[_0xca06('0x1e')](_0x1aebb0);return _0x26bfc0[_0xca06('0x29')](new Buffer(_0x2f885d['recording']));}})['catch'](handleError(_0x26bfc0,null));};
\ No newline at end of file
+var _0xf3f5=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query'];(function(_0xc80bfc,_0x175b63){var _0x136fe0=function(_0x572013){while(--_0x572013){_0xc80bfc['push'](_0xc80bfc['shift']());}};_0x136fe0(++_0x175b63);}(_0xf3f5,0x16c));var _0x5f3f=function(_0xa89203,_0x12f019){_0xa89203=_0xa89203-0x0;var _0x2a1f1f=_0xf3f5[_0xa89203];return _0x2a1f1f;};'use strict';var emlformat=require(_0x5f3f('0x0'));var rimraf=require(_0x5f3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f3f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f3f('0x3'));var util=require(_0x5f3f('0x4'));var path=require(_0x5f3f('0x5'));var sox=require(_0x5f3f('0x6'));var csv=require(_0x5f3f('0x7'));var ejs=require(_0x5f3f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f3f('0x9'));var squel=require('squel');var crypto=require(_0x5f3f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f3f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f3f('0xb'));var authService=require(_0x5f3f('0xc'));var qs=require(_0x5f3f('0xd'));var as=require(_0x5f3f('0xe'));var hardwareService=require(_0x5f3f('0xf'));var logger=require(_0x5f3f('0x10'))(_0x5f3f('0x11'));var utils=require(_0x5f3f('0x12'));var config=require(_0x5f3f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f3f('0x14'))['db'];function respondWithStatusCode(_0x53f2b1,_0x4dd8ad){_0x4dd8ad=_0x4dd8ad||0xcc;return function(_0x3bd5b0){if(_0x3bd5b0){return _0x53f2b1[_0x5f3f('0x15')](_0x4dd8ad);}return _0x53f2b1[_0x5f3f('0x16')](_0x4dd8ad)[_0x5f3f('0x17')]();};}function respondWithResult(_0x569eda,_0x47200e){_0x47200e=_0x47200e||0xc8;return function(_0x46cacd){if(_0x46cacd){return _0x569eda[_0x5f3f('0x16')](_0x47200e)[_0x5f3f('0x18')](_0x46cacd);}};}function respondWithFilteredResult(_0x548321,_0x27f494){return function(_0x5e7ee4){if(_0x5e7ee4){var _0x258ce0=typeof _0x27f494[_0x5f3f('0x19')]===_0x5f3f('0x1a')&&typeof _0x27f494[_0x5f3f('0x1b')]===_0x5f3f('0x1a');var _0x390437=_0x5e7ee4[_0x5f3f('0x1c')];var _0x31fe2d=_0x258ce0?0x0:_0x27f494[_0x5f3f('0x19')];var _0x3dd7f8=_0x258ce0?_0x5e7ee4[_0x5f3f('0x1c')]:_0x27f494[_0x5f3f('0x19')]+_0x27f494[_0x5f3f('0x1b')];var _0x22e6c4;if(_0x3dd7f8>=_0x390437){_0x3dd7f8=_0x390437;_0x22e6c4=0xc8;}else{_0x22e6c4=0xce;}_0x548321['status'](_0x22e6c4);return _0x548321[_0x5f3f('0x1d')](_0x5f3f('0x1e'),_0x31fe2d+'-'+_0x3dd7f8+'/'+_0x390437)[_0x5f3f('0x18')](_0x5e7ee4);}return null;};}function patchUpdates(_0x189721){return function(_0x2cee77){try{jsonpatch[_0x5f3f('0x1f')](_0x2cee77,_0x189721,!![]);}catch(_0x117988){return BPromise['reject'](_0x117988);}return _0x2cee77[_0x5f3f('0x20')]();};}function saveUpdates(_0x83f661,_0x4c1736){return function(_0x430c0d){if(_0x430c0d){return _0x430c0d[_0x5f3f('0x21')](_0x83f661)['then'](function(_0x1e8b9b){return _0x1e8b9b;});}return null;};}function removeEntity(_0x104521,_0x22afc9){return function(_0x428d75){if(_0x428d75){return _0x428d75[_0x5f3f('0x22')]()['then'](function(){_0x104521['status'](0xcc)[_0x5f3f('0x17')]();});}};}function handleEntityNotFound(_0x5c72bf,_0x2b4e9d){return function(_0x2068d9){if(!_0x2068d9){_0x5c72bf[_0x5f3f('0x15')](0x194);}return _0x2068d9;};}function handleError(_0x16f1e6,_0x53c2ed){_0x53c2ed=_0x53c2ed||0x1f4;return function(_0x1e19bd){logger[_0x5f3f('0x23')](_0x1e19bd[_0x5f3f('0x24')]);if(_0x1e19bd[_0x5f3f('0x25')]){delete _0x1e19bd[_0x5f3f('0x25')];}_0x16f1e6['status'](_0x53c2ed)['send'](_0x1e19bd);};}exports['index']=function(_0x5cb002,_0x5bfe16){var _0x282b98={},_0x25eb0d={},_0x554d2c={'count':0x0,'rows':[]};var _0x2058af=_[_0x5f3f('0x26')](db[_0x5f3f('0x27')][_0x5f3f('0x28')],function(_0x156eb7){return{'name':_0x156eb7['fieldName'],'type':_0x156eb7[_0x5f3f('0x29')][_0x5f3f('0x2a')]};});_0x25eb0d[_0x5f3f('0x2b')]=_[_0x5f3f('0x2c')](_[_0x5f3f('0x26')](_0x2058af,_0x5f3f('0x25')),[_0x5f3f('0x25')]);_0x25eb0d[_0x5f3f('0x2d')]=_['keys'](_0x5cb002['query']);_0x25eb0d[_0x5f3f('0x2e')]=_[_0x5f3f('0x2f')](_0x25eb0d['model'],_0x25eb0d[_0x5f3f('0x2d')]);_0x282b98['attributes']=_[_0x5f3f('0x2f')](_0x25eb0d['model'],qs[_0x5f3f('0x30')](_0x5cb002[_0x5f3f('0x2d')][_0x5f3f('0x30')]));_0x282b98[_0x5f3f('0x31')]=_0x282b98[_0x5f3f('0x31')][_0x5f3f('0x32')]?_0x282b98[_0x5f3f('0x31')]:_0x25eb0d[_0x5f3f('0x2b')];if(!_0x5cb002[_0x5f3f('0x2d')][_0x5f3f('0x33')](_0x5f3f('0x34'))){_0x282b98[_0x5f3f('0x1b')]=qs['limit'](_0x5cb002[_0x5f3f('0x2d')]['limit']);_0x282b98['offset']=qs['offset'](_0x5cb002[_0x5f3f('0x2d')][_0x5f3f('0x19')]);}_0x282b98[_0x5f3f('0x35')]=qs['sort'](_0x5cb002['query'][_0x5f3f('0x36')]);_0x282b98[_0x5f3f('0x37')]=qs[_0x5f3f('0x2e')](_[_0x5f3f('0x38')](_0x5cb002[_0x5f3f('0x2d')],_0x25eb0d[_0x5f3f('0x2e')]),_0x2058af);if(_0x5cb002['query'][_0x5f3f('0x39')]){_0x282b98[_0x5f3f('0x37')]=_['merge'](_0x282b98['where'],{'$or':_[_0x5f3f('0x26')](_0x2058af,function(_0x1e1fda){if(_0x1e1fda['type']!==_0x5f3f('0x3a')){var _0x49ac8b={};_0x49ac8b[_0x1e1fda['name']]={'$like':'%'+_0x5cb002[_0x5f3f('0x2d')][_0x5f3f('0x39')]+'%'};return _0x49ac8b;}})});}_0x282b98=_[_0x5f3f('0x3b')]({},_0x282b98,_0x5cb002['options']);var _0x3bd9aa={'where':_0x282b98[_0x5f3f('0x37')]};return db[_0x5f3f('0x27')][_0x5f3f('0x1c')](_0x3bd9aa)[_0x5f3f('0x3c')](function(_0x1e025b){_0x554d2c[_0x5f3f('0x1c')]=_0x1e025b;if(_0x5cb002[_0x5f3f('0x2d')]['includeAll']){_0x282b98[_0x5f3f('0x3d')]=[{'all':!![]}];}return db[_0x5f3f('0x27')][_0x5f3f('0x3e')](_0x282b98);})[_0x5f3f('0x3c')](function(_0x1d5945){_0x554d2c[_0x5f3f('0x3f')]=_0x1d5945;return _0x554d2c;})[_0x5f3f('0x3c')](respondWithFilteredResult(_0x5bfe16,_0x282b98))[_0x5f3f('0x40')](handleError(_0x5bfe16,null));};exports[_0x5f3f('0x41')]=function(_0x34bbdb,_0x56628c){var _0x5a016d={'raw':!![],'where':{'id':_0x34bbdb[_0x5f3f('0x42')]['id']}},_0x334b08={};_0x334b08[_0x5f3f('0x2b')]=_['keys'](db[_0x5f3f('0x27')][_0x5f3f('0x28')]);_0x334b08[_0x5f3f('0x2d')]=_[_0x5f3f('0x43')](_0x34bbdb[_0x5f3f('0x2d')]);_0x334b08[_0x5f3f('0x2e')]=_['intersection'](_0x334b08['model'],_0x334b08[_0x5f3f('0x2d')]);_0x5a016d['attributes']=_[_0x5f3f('0x2f')](_0x334b08[_0x5f3f('0x2b')],qs['fields'](_0x34bbdb[_0x5f3f('0x2d')]['fields']));_0x5a016d[_0x5f3f('0x31')]=_0x5a016d['attributes'][_0x5f3f('0x32')]?_0x5a016d[_0x5f3f('0x31')]:_0x334b08[_0x5f3f('0x2b')];if(_0x34bbdb[_0x5f3f('0x2d')][_0x5f3f('0x44')]){_0x5a016d[_0x5f3f('0x3d')]=[{'all':!![]}];}_0x5a016d=_[_0x5f3f('0x3b')]({},_0x5a016d,_0x34bbdb[_0x5f3f('0x45')]);return db[_0x5f3f('0x27')][_0x5f3f('0x46')](_0x5a016d)[_0x5f3f('0x3c')](handleEntityNotFound(_0x56628c,null))['then'](respondWithResult(_0x56628c,null))[_0x5f3f('0x40')](handleError(_0x56628c,null));};exports[_0x5f3f('0x47')]=function(_0x12e7e2,_0xb865fa){return db[_0x5f3f('0x27')][_0x5f3f('0x47')](_0x12e7e2[_0x5f3f('0x48')],{})[_0x5f3f('0x3c')](respondWithResult(_0xb865fa,0xc9))[_0x5f3f('0x40')](handleError(_0xb865fa,null));};exports[_0x5f3f('0x21')]=function(_0x2ba135,_0x50372c){if(_0x2ba135[_0x5f3f('0x48')]['id']){delete _0x2ba135[_0x5f3f('0x48')]['id'];}return db[_0x5f3f('0x27')][_0x5f3f('0x46')]({'where':{'id':_0x2ba135[_0x5f3f('0x42')]['id']}})[_0x5f3f('0x3c')](handleEntityNotFound(_0x50372c,null))['then'](saveUpdates(_0x2ba135[_0x5f3f('0x48')],null))[_0x5f3f('0x3c')](respondWithResult(_0x50372c,null))[_0x5f3f('0x40')](handleError(_0x50372c,null));};exports[_0x5f3f('0x22')]=function(_0x1ea615,_0x66e8f0){return db['VoiceMailMessage']['find']({'where':{'id':_0x1ea615[_0x5f3f('0x42')]['id']}})[_0x5f3f('0x3c')](handleEntityNotFound(_0x66e8f0,null))[_0x5f3f('0x3c')](removeEntity(_0x66e8f0,null))[_0x5f3f('0x40')](handleError(_0x66e8f0,null));};exports[_0x5f3f('0x49')]=function(_0x5f49d6,_0x117ee5,_0x444f7e){return db['VoiceMailMessage']['find']({'where':{'id':_0x5f49d6[_0x5f3f('0x42')]['id']},'attributes':['id',_0x5f3f('0x4a'),_0x5f3f('0x4b')]})[_0x5f3f('0x3c')](handleEntityNotFound(_0x117ee5,null))[_0x5f3f('0x3c')](function(_0x144de1){if(_0x144de1){if(!_0x144de1[_0x5f3f('0x4a')]){throw new db[(_0x5f3f('0x4c'))]['ValidationError'](_0x5f3f('0x4d'));}var _0x4fcbaf={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x144de1[_0x5f3f('0x4b')]){_0x4fcbaf[_0x5f3f('0x4e')]=_0x5f3f('0x4f')+_0x144de1[_0x5f3f('0x4b')]+_0x5f3f('0x50');}_0x117ee5[_0x5f3f('0x1d')](_0x4fcbaf);return _0x117ee5[_0x5f3f('0x51')](new Buffer(_0x144de1['recording']));}})[_0x5f3f('0x40')](handleError(_0x117ee5,null));};
\ No newline at end of file
index 3968df3..20db435 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5b5=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc5b5,0x1d9));var _0x5c5b=function(_0x2c9ea3,_0x515521){_0x2c9ea3=_0x2c9ea3-0x0;var _0x5c5c65=_0xc5b5[_0x2c9ea3];return _0x5c5c65;};'use strict';var _=require(_0x5c5b('0x0'));var util=require(_0x5c5b('0x1'));var logger=require(_0x5c5b('0x2'))(_0x5c5b('0x3'));var moment=require(_0x5c5b('0x4'));var BPromise=require('bluebird');var rp=require(_0x5c5b('0x5'));var fs=require('fs');var path=require(_0x5c5b('0x6'));var rimraf=require(_0x5c5b('0x7'));var config=require(_0x5c5b('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x5c5b('0x9')]=function(_0x412c00,_0x55bd73){return _0x412c00[_0x5c5b('0xa')](_0x5c5b('0xb'),attributes,{'tableName':_0x5c5b('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x5c5b('0xd')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfe65=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x581b11,_0x574d4c){var _0x43e138=function(_0x216c8e){while(--_0x216c8e){_0x581b11['push'](_0x581b11['shift']());}};_0x43e138(++_0x574d4c);}(_0xfe65,0xd2));var _0x5fe6=function(_0x1a06d0,_0x2d77e2){_0x1a06d0=_0x1a06d0-0x0;var _0x370e6d=_0xfe65[_0x1a06d0];return _0x370e6d;};'use strict';var _=require(_0x5fe6('0x0'));var util=require(_0x5fe6('0x1'));var logger=require('../../config/logger')(_0x5fe6('0x2'));var moment=require(_0x5fe6('0x3'));var BPromise=require(_0x5fe6('0x4'));var rp=require(_0x5fe6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fe6('0x6'));var config=require(_0x5fe6('0x7'));var attributes=require(_0x5fe6('0x8'));module[_0x5fe6('0x9')]=function(_0x22175d,_0x4d8270){return _0x22175d[_0x5fe6('0xa')](_0x5fe6('0xb'),attributes,{'tableName':_0x5fe6('0xc'),'paranoid':![],'indexes':[{'name':_0x5fe6('0xd'),'fields':[_0x5fe6('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index a8786e0..b11da16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8b9=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xe8b9,0x110));var _0x9e8b=function(_0x1ebae4,_0x5755d0){_0x1ebae4=_0x1ebae4-0x0;var _0x4b1101=_0xe8b9[_0x1ebae4];return _0x4b1101;};'use strict';var _=require(_0x9e8b('0x0'));var util=require(_0x9e8b('0x1'));var moment=require(_0x9e8b('0x2'));var BPromise=require(_0x9e8b('0x3'));var rs=require(_0x9e8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e8b('0x5'))['db'];var utils=require(_0x9e8b('0x6'));var logger=require(_0x9e8b('0x7'))(_0x9e8b('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e8b('0x9'));var client=jayson[_0x9e8b('0xa')][_0x9e8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x164e88,_0x513436,_0x389316){return new BPromise(function(_0x33220c,_0x1db83f){return client['request'](_0x164e88,_0x389316)[_0x9e8b('0xc')](function(_0x55e00b){logger['info'](_0x9e8b('0xd'),_0x513436,_0x9e8b('0xe'));logger[_0x9e8b('0xf')](_0x9e8b('0x10'),_0x513436,'request\x20sent',JSON[_0x9e8b('0x11')](_0x55e00b));if(_0x55e00b['error']){if(_0x55e00b['error'][_0x9e8b('0x12')]===0x1f4){logger[_0x9e8b('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x513436,_0x55e00b['error'][_0x9e8b('0x14')]);return _0x1db83f(_0x55e00b[_0x9e8b('0x13')]['message']);}logger[_0x9e8b('0x13')](_0x9e8b('0xd'),_0x513436,_0x55e00b['error'][_0x9e8b('0x14')]);return _0x33220c(_0x55e00b[_0x9e8b('0x13')][_0x9e8b('0x14')]);}else{logger[_0x9e8b('0x15')](_0x9e8b('0xd'),_0x513436,'request\x20sent');_0x33220c(_0x55e00b[_0x9e8b('0x16')][_0x9e8b('0x14')]);}})[_0x9e8b('0x17')](function(_0x3b3c8e){logger[_0x9e8b('0x13')](_0x9e8b('0xd'),_0x513436,_0x3b3c8e);_0x1db83f(_0x3b3c8e);});});}
\ No newline at end of file
+var _0x5d9b=['VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0x5d9b,0xeb));var _0xb5d9=function(_0x2dc834,_0x5ac26e){_0x2dc834=_0x2dc834-0x0;var _0x4899a8=_0x5d9b[_0x2dc834];return _0x4899a8;};'use strict';var _=require('lodash');var util=require(_0xb5d9('0x0'));var moment=require('moment');var BPromise=require(_0xb5d9('0x1'));var rs=require(_0xb5d9('0x2'));var fs=require('fs');var Redis=require(_0xb5d9('0x3'));var db=require(_0xb5d9('0x4'))['db'];var utils=require(_0xb5d9('0x5'));var logger=require(_0xb5d9('0x6'))(_0xb5d9('0x7'));var config=require(_0xb5d9('0x8'));var jayson=require(_0xb5d9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x425195,_0x1f66bf,_0x145231){return new BPromise(function(_0xce0d76,_0x2dbb01){return client[_0xb5d9('0xa')](_0x425195,_0x145231)['then'](function(_0x5c07b3){logger[_0xb5d9('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x1f66bf,_0xb5d9('0xc'));logger['debug'](_0xb5d9('0xd'),_0x1f66bf,_0xb5d9('0xc'),JSON[_0xb5d9('0xe')](_0x5c07b3));if(_0x5c07b3['error']){if(_0x5c07b3[_0xb5d9('0xf')][_0xb5d9('0x10')]===0x1f4){logger[_0xb5d9('0xf')](_0xb5d9('0x11'),_0x1f66bf,_0x5c07b3['error'][_0xb5d9('0x12')]);return _0x2dbb01(_0x5c07b3[_0xb5d9('0xf')][_0xb5d9('0x12')]);}logger[_0xb5d9('0xf')](_0xb5d9('0x11'),_0x1f66bf,_0x5c07b3[_0xb5d9('0xf')][_0xb5d9('0x12')]);return _0xce0d76(_0x5c07b3[_0xb5d9('0xf')][_0xb5d9('0x12')]);}else{logger[_0xb5d9('0xb')](_0xb5d9('0x11'),_0x1f66bf,_0xb5d9('0xc'));_0xce0d76(_0x5c07b3[_0xb5d9('0x13')][_0xb5d9('0x12')]);}})[_0xb5d9('0x14')](function(_0x37fa03){logger[_0xb5d9('0xf')](_0xb5d9('0x11'),_0x1f66bf,_0x37fa03);_0x2dbb01(_0x37fa03);});});}
\ No newline at end of file
index 07584ff..e7e710c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12d6=['update','destroy','delete','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x12d6,0x95));var _0x612d=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x12d6[_0x59162a];return _0x35e50d;};'use strict';var multer=require(_0x612d('0x0'));var util=require(_0x612d('0x1'));var path=require('path');var timeout=require(_0x612d('0x2'));var express=require(_0x612d('0x3'));var router=express[_0x612d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x612d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x612d('0x6'));var controller=require(_0x612d('0x7'));router[_0x612d('0x8')]('/',auth[_0x612d('0x9')](),controller[_0x612d('0xa')]);router[_0x612d('0x8')](_0x612d('0xb'),auth[_0x612d('0x9')](),controller[_0x612d('0xc')]);router[_0x612d('0x8')](_0x612d('0xd'),auth['isAuthenticated'](),controller[_0x612d('0xe')]);router[_0x612d('0xf')]('/',auth[_0x612d('0x9')](),controller[_0x612d('0x10')]);router['post'](_0x612d('0xd'),auth['isAuthenticated'](),controller[_0x612d('0x11')]);router[_0x612d('0x12')]('/:id',auth[_0x612d('0x9')](),controller[_0x612d('0x13')]);router['delete'](_0x612d('0xb'),auth['isAuthenticated'](),controller[_0x612d('0x14')]);router[_0x612d('0x15')](_0x612d('0x16'),auth[_0x612d('0x9')](),controller['removeSound']);module[_0x612d('0x17')]=router;
\ No newline at end of file
+var _0xdc15=['post','create','/:id/sounds','addSound','delete','/:id','destroy','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','getSounds'];(function(_0x5815c5,_0xa8702b){var _0x3f27a2=function(_0x2e058c){while(--_0x2e058c){_0x5815c5['push'](_0x5815c5['shift']());}};_0x3f27a2(++_0xa8702b);}(_0xdc15,0x1c3));var _0x5dc1=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0xdc15[_0x51d129];return _0x44c377;};'use strict';var multer=require('multer');var util=require(_0x5dc1('0x0'));var path=require(_0x5dc1('0x1'));var timeout=require(_0x5dc1('0x2'));var express=require('express');var router=express[_0x5dc1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5dc1('0x4'));var interaction=require(_0x5dc1('0x5'));var config=require(_0x5dc1('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5dc1('0x7')]);router[_0x5dc1('0x8')]('/:id',auth[_0x5dc1('0x9')](),controller['show']);router[_0x5dc1('0x8')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x5dc1('0xa')]);router[_0x5dc1('0xb')]('/',auth[_0x5dc1('0x9')](),controller[_0x5dc1('0xc')]);router[_0x5dc1('0xb')](_0x5dc1('0xd'),auth[_0x5dc1('0x9')](),controller[_0x5dc1('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5dc1('0xf')](_0x5dc1('0x10'),auth[_0x5dc1('0x9')](),controller[_0x5dc1('0x11')]);router[_0x5dc1('0xf')](_0x5dc1('0x12'),auth[_0x5dc1('0x9')](),controller[_0x5dc1('0x13')]);module[_0x5dc1('0x14')]=router;
\ No newline at end of file
index 92f5c13..7484dfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41c2=['exports','STRING','name','custom','files','quietmp3','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41c2,0x1ee));var _0x241c=function(_0x42db49,_0x43a334){_0x42db49=_0x42db49-0x0;var _0x133ed7=_0x41c2[_0x42db49];return _0x133ed7;};'use strict';var Sequelize=require(_0x241c('0x0'));module[_0x241c('0x1')]={'name':{'type':Sequelize[_0x241c('0x2')],'allowNull':![],'unique':_0x241c('0x3')},'mode':{'type':Sequelize['ENUM'](_0x241c('0x4'),_0x241c('0x5'),'mp3nb','quietmp3nb',_0x241c('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x241c('0x5')},'directory':{'type':Sequelize[_0x241c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x241c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x241c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x241c('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x241c('0x2')],'allowNull':!![]},'stamp':{'type':_0x241c('0x7')},'defaultEntry':{'type':Sequelize[_0x241c('0x8')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4a8f=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x290b5d,_0x4affc9){var _0x56802a=function(_0x12fc91){while(--_0x12fc91){_0x290b5d['push'](_0x290b5d['shift']());}};_0x56802a(++_0x4affc9);}(_0x4a8f,0xeb));var _0xf4a8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x4a8f[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require(_0xf4a8('0x0'));module[_0xf4a8('0x1')]={'name':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':![],'unique':_0xf4a8('0x3')},'mode':{'type':Sequelize[_0xf4a8('0x4')](_0xf4a8('0x5'),_0xf4a8('0x6'),_0xf4a8('0x7'),'quietmp3nb',_0xf4a8('0x8'),_0xf4a8('0x9')),'allowNull':!![],'defaultValue':_0xf4a8('0x6')},'directory':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':!![],'defaultValue':_0xf4a8('0xa')},'format':{'type':Sequelize[_0xf4a8('0x2')],'allowNull':!![]},'stamp':{'type':_0xf4a8('0xb')},'defaultEntry':{'type':Sequelize[_0xf4a8('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index b3bbf3d..ce2545e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa95d=['body','params','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','readdirSync','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','symlinkSync','Sequelize','removeSound','id2','getSounds','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','destroy','then','MusicOnHolds','UserProfileResource','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','map','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','keys','find'];(function(_0x2a4173,_0x5c7642){var _0x1467d5=function(_0xf3f3fd){while(--_0xf3f3fd){_0x2a4173['push'](_0x2a4173['shift']());}};_0x1467d5(++_0x5c7642);}(_0xa95d,0x91));var _0xda95=function(_0x4851c7,_0x1cb4a0){_0x4851c7=_0x4851c7-0x0;var _0x56a7d4=_0xa95d[_0x4851c7];return _0x56a7d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda95('0x0'));var zipdir=require(_0xda95('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda95('0x2'));var moment=require('moment');var BPromise=require(_0xda95('0x3'));var Mustache=require(_0xda95('0x4'));var util=require('util');var path=require(_0xda95('0x5'));var sox=require(_0xda95('0x6'));var csv=require(_0xda95('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda95('0x8'));var squel=require(_0xda95('0x9'));var crypto=require('crypto');var jsforce=require(_0xda95('0xa'));var deskjs=require(_0xda95('0xb'));var toCsv=require('to-csv');var querystring=require(_0xda95('0xc'));var Papa=require(_0xda95('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xda95('0xe'));var as=require(_0xda95('0xf'));var hardwareService=require(_0xda95('0x10'));var logger=require(_0xda95('0x11'))(_0xda95('0x12'));var utils=require(_0xda95('0x13'));var config=require(_0xda95('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2de233,_0x3ccfff){_0x3ccfff=_0x3ccfff||0xcc;return function(_0x29519e){if(_0x29519e){return _0x2de233[_0xda95('0x15')](_0x3ccfff);}return _0x2de233[_0xda95('0x16')](_0x3ccfff)[_0xda95('0x17')]();};}function respondWithResult(_0x2f8e19,_0x5e86d1){_0x5e86d1=_0x5e86d1||0xc8;return function(_0x5a167b){if(_0x5a167b){return _0x2f8e19[_0xda95('0x16')](_0x5e86d1)['json'](_0x5a167b);}};}function respondWithFilteredResult(_0x39ef91,_0x1a0dbe){return function(_0x17b924){if(_0x17b924){var _0x58a6fe=typeof _0x1a0dbe[_0xda95('0x18')]===_0xda95('0x19')&&typeof _0x1a0dbe[_0xda95('0x1a')]===_0xda95('0x19');var _0x282934=_0x17b924['count'];var _0x3d9b1a=_0x58a6fe?0x0:_0x1a0dbe['offset'];var _0x3cba7f=_0x58a6fe?_0x17b924[_0xda95('0x1b')]:_0x1a0dbe['offset']+_0x1a0dbe[_0xda95('0x1a')];var _0x4365a8;if(_0x3cba7f>=_0x282934){_0x3cba7f=_0x282934;_0x4365a8=0xc8;}else{_0x4365a8=0xce;}_0x39ef91[_0xda95('0x16')](_0x4365a8);return _0x39ef91[_0xda95('0x1c')]('Content-Range',_0x3d9b1a+'-'+_0x3cba7f+'/'+_0x282934)[_0xda95('0x1d')](_0x17b924);}return null;};}function patchUpdates(_0x3d91ab){return function(_0x9e3bb5){try{jsonpatch['apply'](_0x9e3bb5,_0x3d91ab,!![]);}catch(_0x4e137e){return BPromise[_0xda95('0x1e')](_0x4e137e);}return _0x9e3bb5[_0xda95('0x1f')]();};}function saveUpdates(_0x2d1baa,_0x293d66){return function(_0x1b7919){if(_0x1b7919){return _0x1b7919['update'](_0x2d1baa)['then'](function(_0x79ecae){return _0x79ecae;});}return null;};}function removeEntity(_0x18d9b7,_0x263b4f){return function(_0x5d31c2){if(_0x5d31c2){return _0x5d31c2[_0xda95('0x20')]()[_0xda95('0x21')](function(){var _0x36aece=_0x5d31c2['get']({'plain':!![]});var _0x26aea0=_0xda95('0x22');return db[_0xda95('0x23')]['destroy']({'where':{'type':_0x26aea0,'resourceId':_0x36aece['id']}})[_0xda95('0x21')](function(){return _0x5d31c2;});})[_0xda95('0x21')](function(){_0x18d9b7[_0xda95('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x60faac,_0x1f9716){return function(_0x4dce77){if(!_0x4dce77){_0x60faac[_0xda95('0x15')](0x194);}return _0x4dce77;};}function handleError(_0x243ddf,_0x2b1ab4){_0x2b1ab4=_0x2b1ab4||0x1f4;return function(_0x2bef86){logger[_0xda95('0x24')](_0x2bef86[_0xda95('0x25')]);if(_0x2bef86[_0xda95('0x26')]){delete _0x2bef86[_0xda95('0x26')];}_0x243ddf[_0xda95('0x16')](_0x2b1ab4)['send'](_0x2bef86);};}exports[_0xda95('0x27')]=function(_0x2f2618,_0x2612f9){var _0x5aa0dc={},_0x488aa7={},_0x4681c4={'count':0x0,'rows':[]};var _0x2a27cb=_['map'](db[_0xda95('0x28')][_0xda95('0x29')],function(_0x2ccaf7){return{'name':_0x2ccaf7[_0xda95('0x2a')],'type':_0x2ccaf7[_0xda95('0x2b')][_0xda95('0x2c')]};});_0x488aa7['model']=_[_0xda95('0x2d')](_0x2a27cb,_0xda95('0x26'));_0x488aa7[_0xda95('0x2e')]=_['keys'](_0x2f2618[_0xda95('0x2e')]);_0x488aa7[_0xda95('0x2f')]=_['intersection'](_0x488aa7[_0xda95('0x30')],_0x488aa7['query']);_0x5aa0dc['attributes']=_[_0xda95('0x31')](_0x488aa7[_0xda95('0x30')],qs[_0xda95('0x32')](_0x2f2618['query'][_0xda95('0x32')]));_0x5aa0dc[_0xda95('0x33')]=_0x5aa0dc['attributes'][_0xda95('0x34')]?_0x5aa0dc[_0xda95('0x33')]:_0x488aa7[_0xda95('0x30')];if(!_0x2f2618['query'][_0xda95('0x35')](_0xda95('0x36'))){_0x5aa0dc[_0xda95('0x1a')]=qs['limit'](_0x2f2618[_0xda95('0x2e')][_0xda95('0x1a')]);_0x5aa0dc['offset']=qs[_0xda95('0x18')](_0x2f2618[_0xda95('0x2e')][_0xda95('0x18')]);}_0x5aa0dc[_0xda95('0x37')]=qs[_0xda95('0x38')](_0x2f2618[_0xda95('0x2e')][_0xda95('0x38')]);delete _0x2f2618[_0xda95('0x2e')]['sort'];_0x5aa0dc[_0xda95('0x39')]=qs['filters'](_[_0xda95('0x3a')](_0x2f2618[_0xda95('0x2e')],_0x488aa7[_0xda95('0x2f')]),_0x2a27cb);if(_0x2f2618[_0xda95('0x2e')]['filter']){_0x5aa0dc['where']=_['merge'](_0x5aa0dc[_0xda95('0x39')],{'$or':_[_0xda95('0x2d')](_0x2a27cb,function(_0x50e166){if(_0x50e166['type']!==_0xda95('0x3b')){var _0x21cee4={};_0x21cee4[_0x50e166[_0xda95('0x26')]]={'$like':'%'+_0x2f2618[_0xda95('0x2e')][_0xda95('0x3c')]+'%'};return _0x21cee4;}})});}_0x5aa0dc=_[_0xda95('0x3d')]({},_0x5aa0dc,_0x2f2618[_0xda95('0x3e')]);var _0x1b374d={'where':_0x5aa0dc['where']};return db['VoiceMusicOnHold'][_0xda95('0x1b')](_0x1b374d)[_0xda95('0x21')](function(_0x60b4ec){_0x4681c4[_0xda95('0x1b')]=_0x60b4ec;if(_0x2f2618[_0xda95('0x2e')][_0xda95('0x3f')]){_0x5aa0dc[_0xda95('0x40')]=[{'all':!![]}];}return db[_0xda95('0x28')][_0xda95('0x41')](_0x5aa0dc);})[_0xda95('0x21')](function(_0x387333){_0x4681c4['rows']=_0x387333;return _0x4681c4;})[_0xda95('0x21')](respondWithFilteredResult(_0x2612f9,_0x5aa0dc))[_0xda95('0x42')](handleError(_0x2612f9,null));};exports['show']=function(_0x1f8d36,_0x259e6d){var _0x50406a={'raw':![],'where':{'id':_0x1f8d36['params']['id']}},_0x2e3993={};_0x2e3993[_0xda95('0x30')]=_[_0xda95('0x43')](db[_0xda95('0x28')]['rawAttributes']);_0x2e3993[_0xda95('0x2e')]=_[_0xda95('0x43')](_0x1f8d36[_0xda95('0x2e')]);_0x2e3993[_0xda95('0x2f')]=_[_0xda95('0x31')](_0x2e3993['model'],_0x2e3993['query']);_0x50406a[_0xda95('0x33')]=_[_0xda95('0x31')](_0x2e3993[_0xda95('0x30')],qs[_0xda95('0x32')](_0x1f8d36['query'][_0xda95('0x32')]));_0x50406a[_0xda95('0x33')]=_0x50406a[_0xda95('0x33')][_0xda95('0x34')]?_0x50406a['attributes']:_0x2e3993[_0xda95('0x30')];if(_0x1f8d36['query']['includeAll']){_0x50406a[_0xda95('0x40')]=[{'all':!![]}];}_0x50406a=_['merge']({},_0x50406a,_0x1f8d36['options']);return db[_0xda95('0x28')][_0xda95('0x44')](_0x50406a)[_0xda95('0x21')](handleEntityNotFound(_0x259e6d,null))['then'](respondWithResult(_0x259e6d,null))[_0xda95('0x42')](handleError(_0x259e6d,null));};exports['update']=function(_0x4e7571,_0x3f0453){if(_0x4e7571['body']['id']){delete _0x4e7571[_0xda95('0x45')]['id'];}return db['VoiceMusicOnHold'][_0xda95('0x44')]({'where':{'id':_0x4e7571[_0xda95('0x46')]['id']}})[_0xda95('0x21')](handleEntityNotFound(_0x3f0453,null))[_0xda95('0x21')](saveUpdates(_0x4e7571[_0xda95('0x45')],null))[_0xda95('0x21')](respondWithResult(_0x3f0453,null))[_0xda95('0x42')](handleError(_0x3f0453,null));};exports[_0xda95('0x47')]=function(_0xf9b84c,_0x1cac2b,_0x2a90d3){return db[_0xda95('0x48')][_0xda95('0x49')](function(_0x499eb9){if(_0xf9b84c[_0xda95('0x45')][_0xda95('0x4a')]===_0xda95('0x4b')){_0xf9b84c['body']['directory']=path[_0xda95('0x4c')](config[_0xda95('0x4d')],_0xda95('0x4e'),_0xf9b84c['body']['name']);}return db[_0xda95('0x28')][_0xda95('0x47')](_0xf9b84c[_0xda95('0x45')],{'transaction':_0x499eb9})[_0xda95('0x21')](function(_0x29a25e){if(_0xf9b84c[_0xda95('0x45')][_0xda95('0x4a')]===_0xda95('0x4b')){fs[_0xda95('0x4f')](_0x29a25e[_0xda95('0x50')],parseInt(_0xda95('0x51'),0x8));}var _0x54162=_0xf9b84c[_0xda95('0x52')][_0xda95('0x53')]({'plain':!![]});if(!_0x54162)throw new Error(_0xda95('0x54'));if(_0x54162[_0xda95('0x55')]===_0xda95('0x52')){var _0x21db18=_0x29a25e['get']({'plain':!![]});return db[_0xda95('0x56')]['find']({'where':{'name':_0xda95('0x22'),'userProfileId':_0x54162['userProfileId']},'raw':!![]})['then'](function(_0x2aec72){if(_0x2aec72&&_0x2aec72[_0xda95('0x57')]===0x0){return db['UserProfileResource'][_0xda95('0x47')]({'name':_0x21db18['name'],'resourceId':_0x21db18['id'],'type':_0x2aec72[_0xda95('0x26')],'sectionId':_0x2aec72['id']},{})[_0xda95('0x21')](function(){return _0x29a25e;});}else{return _0x29a25e;}})[_0xda95('0x42')](function(_0x4531c7){logger[_0xda95('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4531c7);});}return _0x29a25e;});})[_0xda95('0x21')](respondWithResult(_0x1cac2b,0xc9))[_0xda95('0x42')](handleError(_0x1cac2b,null));};exports['destroy']=function(_0x49b9f4,_0x5ba60b,_0x5cffd5){var _0x2c03ce;return db[_0xda95('0x28')][_0xda95('0x44')]({'where':{'id':_0x49b9f4[_0xda95('0x46')]['id']}})[_0xda95('0x21')](function(_0x5ab1a6){if(_0x5ab1a6){return db[_0xda95('0x48')][_0xda95('0x49')](function(_0x522b86){return _0x5ab1a6['destroy']({'transaction':_0x522b86,'raw':!![]})[_0xda95('0x21')](function(_0x381315){if(_0x381315[_0xda95('0x50')]){fs[_0xda95('0x58')](_0x381315[_0xda95('0x50')])['forEach'](function(_0x5a8112){fs[_0xda95('0x59')](path[_0xda95('0x4c')](_0x381315[_0xda95('0x50')],_0x5a8112));});fs[_0xda95('0x5a')](_0x381315['directory']);}return _0x381315;});})['catch'](function(_0x57a986){throw new db['Sequelize'][(_0xda95('0x5b'))](_0x57a986[_0xda95('0x5c')]);});}})['then'](handleEntityNotFound(_0x5ba60b,null))['then'](removeEntity(_0x5ba60b,null))[_0xda95('0x42')](handleError(_0x5ba60b,null));};exports[_0xda95('0x5d')]=function(_0x7af74,_0x29b902,_0xb601dd){return db[_0xda95('0x48')][_0xda95('0x49')](function(_0x586e89){var _0x146ac1;return db[_0xda95('0x28')][_0xda95('0x44')]({'where':{'id':_0x7af74[_0xda95('0x46')]['id']}})[_0xda95('0x21')](function(_0x4cd833){if(_0x4cd833){_0x146ac1=_0x4cd833;return _0x4cd833['addSound'](_0x7af74[_0xda95('0x45')]['id'],{'transaction':_0x586e89});}})[_0xda95('0x21')](function(_0x5f3c33){if(_0x5f3c33){return db[_0xda95('0x5e')][_0xda95('0x5f')]({'where':{'id':_0x7af74[_0xda95('0x45')]['id']},'attributes':['id',_0xda95('0x26'),_0xda95('0x60'),_0xda95('0x61'),_0xda95('0x62')],'raw':!![]});}})[_0xda95('0x21')](function(_0xe26a2e){if(_0xe26a2e){var _0x2c7215=path[_0xda95('0x4c')](config[_0xda95('0x4d')],'server/files/sounds/converted',util[_0xda95('0x63')](_0xda95('0x64'),path[_0xda95('0x65')](_0xe26a2e[_0xda95('0x60')],path['extname'](_0xe26a2e[_0xda95('0x60')])),_0xe26a2e[_0xda95('0x61')]));var _0x301a9d=path[_0xda95('0x4c')](config[_0xda95('0x4d')],_0xda95('0x4e'),_0x146ac1[_0xda95('0x26')],util[_0xda95('0x63')](_0xda95('0x64'),_0xe26a2e[_0xda95('0x26')],_0xe26a2e[_0xda95('0x61')]));fs[_0xda95('0x66')](_0x2c7215,_0x301a9d);return _0xe26a2e;}})['catch'](function(_0x22724b){throw new db[(_0xda95('0x67'))]['ValidationError'](_0x22724b[_0xda95('0x5c')]);});})[_0xda95('0x21')](handleEntityNotFound(_0x29b902,null))[_0xda95('0x21')](respondWithResult(_0x29b902,0xc9))['catch'](handleError(_0x29b902,null));};exports[_0xda95('0x68')]=function(_0x3f835f,_0x57fd76,_0x45bf81){return db[_0xda95('0x48')][_0xda95('0x49')](function(_0x3a95ea){var _0x391aa9;return db[_0xda95('0x28')]['findOne']({'where':{'id':_0x3f835f['params']['id']}})[_0xda95('0x21')](handleEntityNotFound(_0x57fd76,null))[_0xda95('0x21')](function(_0x129231){if(_0x129231){_0x391aa9=_0x129231;return _0x129231['removeSound'](_0x3f835f[_0xda95('0x46')][_0xda95('0x69')]);}})['then'](function(_0x110f94){if(_0x110f94){return db['Sound'][_0xda95('0x5f')]({'where':{'id':_0x3f835f['params'][_0xda95('0x69')]},'attributes':['id',_0xda95('0x26'),_0xda95('0x60'),_0xda95('0x61'),_0xda95('0x62')],'raw':!![]});}})[_0xda95('0x21')](function(_0x1ab33f){if(_0x1ab33f){fs[_0xda95('0x59')](path[_0xda95('0x4c')](_0x391aa9['directory'],util['format'](_0xda95('0x64'),_0x1ab33f['name'],_0x1ab33f[_0xda95('0x61')])));return _0x1ab33f;}})[_0xda95('0x42')](function(_0x2795cb){throw new db['Sequelize']['ValidationError'](_0x2795cb[_0xda95('0x5c')]);});})[_0xda95('0x21')](handleEntityNotFound(_0x57fd76,null))[_0xda95('0x21')](respondWithStatusCode(_0x57fd76,0xcc))[_0xda95('0x42')](handleError(_0x57fd76,null));};exports[_0xda95('0x6a')]=function(_0x3f6b04,_0x44b71b,_0x327e39){var _0x3f935a={};var _0x1dfb08={};var _0x3c43e1;var _0x142227;return db[_0xda95('0x28')][_0xda95('0x5f')]({'where':{'id':_0x3f6b04['params']['id']}})['then'](handleEntityNotFound(_0x44b71b,null))[_0xda95('0x21')](function(_0x4b25c6){if(_0x4b25c6){_0x3c43e1=_0x4b25c6;_0x1dfb08[_0xda95('0x30')]=_[_0xda95('0x43')](db[_0xda95('0x5e')][_0xda95('0x29')]);_0x1dfb08['query']=_[_0xda95('0x43')](_0x3f6b04[_0xda95('0x2e')]);_0x1dfb08['filters']=_[_0xda95('0x31')](_0x1dfb08['model'],_0x1dfb08[_0xda95('0x2e')]);_0x3f935a[_0xda95('0x33')]=_[_0xda95('0x31')](_0x1dfb08[_0xda95('0x30')],qs[_0xda95('0x32')](_0x3f6b04['query'][_0xda95('0x32')]));_0x3f935a[_0xda95('0x33')]=_0x3f935a[_0xda95('0x33')]['length']?_0x3f935a[_0xda95('0x33')]:_0x1dfb08['model'];_0x3f935a[_0xda95('0x37')]=qs['sort'](_0x3f6b04[_0xda95('0x2e')]['sort']);_0x3f935a[_0xda95('0x39')]=qs[_0xda95('0x2f')](_[_0xda95('0x3a')](_0x3f6b04['query'],_0x1dfb08[_0xda95('0x2f')]));if(_0x3f6b04[_0xda95('0x2e')]['filter']){_0x3f935a[_0xda95('0x39')]=_[_0xda95('0x3d')](_0x3f935a['where'],{'$or':_[_0xda95('0x2d')](_0x3f935a[_0xda95('0x33')],function(_0x7dec45){var _0x22d08f={};_0x22d08f[_0x7dec45]={'$like':'%'+_0x3f6b04['query'][_0xda95('0x3c')]+'%'};return _0x22d08f;})});}_0x3f935a=_[_0xda95('0x3d')]({},_0x3f935a,_0x3f6b04[_0xda95('0x3e')]);return _0x3c43e1[_0xda95('0x6a')](_0x3f935a);}})['then'](function(_0x2361e6){if(_0x2361e6){_0x142227=_0x2361e6[_0xda95('0x34')];if(!_0x3f6b04[_0xda95('0x2e')][_0xda95('0x35')]('nolimit')){_0x3f935a[_0xda95('0x1a')]=qs[_0xda95('0x1a')](_0x3f6b04['query'][_0xda95('0x1a')]);_0x3f935a[_0xda95('0x18')]=qs[_0xda95('0x18')](_0x3f6b04[_0xda95('0x2e')]['offset']);}return _0x3c43e1[_0xda95('0x6a')](_0x3f935a);}})['then'](function(_0x250c72){if(_0x250c72){return _0x250c72?{'count':_0x142227,'rows':_0x250c72}:null;}})['then'](respondWithResult(_0x44b71b,null))[_0xda95('0x42')](handleError(_0x44b71b,null));};
\ No newline at end of file
+var _0xa8b5=['index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','VoiceMusicOnHold','count','includeAll','findAll','rows','catch','show','params','keys','find','update','body','sequelize','transaction','files','directory','join','server/files/moh','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','extname','%s.%s','symlinkSync','removeSound','id2','Sequelize','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','status','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa8b5,0x1a6));var _0x5a8b=function(_0x4c6a4b,_0x4d8908){_0x4c6a4b=_0x4c6a4b-0x0;var _0x2c0b99=_0xa8b5[_0x4c6a4b];return _0x2c0b99;};'use strict';var emlformat=require(_0x5a8b('0x0'));var rimraf=require(_0x5a8b('0x1'));var zipdir=require(_0x5a8b('0x2'));var jsonpatch=require(_0x5a8b('0x3'));var rp=require(_0x5a8b('0x4'));var moment=require(_0x5a8b('0x5'));var BPromise=require(_0x5a8b('0x6'));var Mustache=require(_0x5a8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5a8b('0x8'));var csv=require(_0x5a8b('0x9'));var ejs=require(_0x5a8b('0xa'));var fs=require('fs');var fs_extra=require(_0x5a8b('0xb'));var _=require(_0x5a8b('0xc'));var squel=require(_0x5a8b('0xd'));var crypto=require(_0x5a8b('0xe'));var jsforce=require(_0x5a8b('0xf'));var deskjs=require(_0x5a8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5a8b('0x11'));var Papa=require('papaparse');var Redis=require(_0x5a8b('0x12'));var authService=require(_0x5a8b('0x13'));var qs=require(_0x5a8b('0x14'));var as=require(_0x5a8b('0x15'));var hardwareService=require(_0x5a8b('0x16'));var logger=require(_0x5a8b('0x17'))(_0x5a8b('0x18'));var utils=require(_0x5a8b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5a8b('0x1a'));var db=require(_0x5a8b('0x1b'))['db'];function respondWithStatusCode(_0x5c4ef5,_0x426712){_0x426712=_0x426712||0xcc;return function(_0x4b45b7){if(_0x4b45b7){return _0x5c4ef5[_0x5a8b('0x1c')](_0x426712);}return _0x5c4ef5['status'](_0x426712)['end']();};}function respondWithResult(_0x37510b,_0x2bdeed){_0x2bdeed=_0x2bdeed||0xc8;return function(_0x5ce7e3){if(_0x5ce7e3){return _0x37510b['status'](_0x2bdeed)[_0x5a8b('0x1d')](_0x5ce7e3);}};}function respondWithFilteredResult(_0x4d8a70,_0x55b4c5){return function(_0x4dfd23){if(_0x4dfd23){var _0xbb1d59=typeof _0x55b4c5[_0x5a8b('0x1e')]==='undefined'&&typeof _0x55b4c5[_0x5a8b('0x1f')]===_0x5a8b('0x20');var _0x29204e=_0x4dfd23['count'];var _0x4961a2=_0xbb1d59?0x0:_0x55b4c5['offset'];var _0x2ccdb8=_0xbb1d59?_0x4dfd23['count']:_0x55b4c5[_0x5a8b('0x1e')]+_0x55b4c5[_0x5a8b('0x1f')];var _0x3e50bf;if(_0x2ccdb8>=_0x29204e){_0x2ccdb8=_0x29204e;_0x3e50bf=0xc8;}else{_0x3e50bf=0xce;}_0x4d8a70[_0x5a8b('0x21')](_0x3e50bf);return _0x4d8a70['set'](_0x5a8b('0x22'),_0x4961a2+'-'+_0x2ccdb8+'/'+_0x29204e)[_0x5a8b('0x1d')](_0x4dfd23);}return null;};}function patchUpdates(_0x1832cd){return function(_0x30dd3d){try{jsonpatch[_0x5a8b('0x23')](_0x30dd3d,_0x1832cd,!![]);}catch(_0x17e267){return BPromise[_0x5a8b('0x24')](_0x17e267);}return _0x30dd3d['save']();};}function saveUpdates(_0x2d2386,_0x4e5b01){return function(_0x2c460c){if(_0x2c460c){return _0x2c460c['update'](_0x2d2386)[_0x5a8b('0x25')](function(_0x15152f){return _0x15152f;});}return null;};}function removeEntity(_0x135465,_0x17799e){return function(_0x155ff8){if(_0x155ff8){return _0x155ff8[_0x5a8b('0x26')]()['then'](function(){var _0x34da1e=_0x155ff8[_0x5a8b('0x27')]({'plain':!![]});var _0x49e0a7=_0x5a8b('0x28');return db[_0x5a8b('0x29')][_0x5a8b('0x26')]({'where':{'type':_0x49e0a7,'resourceId':_0x34da1e['id']}})[_0x5a8b('0x25')](function(){return _0x155ff8;});})['then'](function(){_0x135465['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5a98,_0x45f968){return function(_0x4cb446){if(!_0x4cb446){_0x4d5a98['sendStatus'](0x194);}return _0x4cb446;};}function handleError(_0x3daeea,_0x264760){_0x264760=_0x264760||0x1f4;return function(_0x496a46){logger[_0x5a8b('0x2a')](_0x496a46[_0x5a8b('0x2b')]);if(_0x496a46[_0x5a8b('0x2c')]){delete _0x496a46['name'];}_0x3daeea[_0x5a8b('0x21')](_0x264760)[_0x5a8b('0x2d')](_0x496a46);};}exports[_0x5a8b('0x2e')]=function(_0x2784b2,_0x3a8dde){var _0x3c80c2={},_0x389a9d={},_0x428128={'count':0x0,'rows':[]};var _0x48f06d=_['map'](db['VoiceMusicOnHold'][_0x5a8b('0x2f')],function(_0x622a04){return{'name':_0x622a04[_0x5a8b('0x30')],'type':_0x622a04['type'][_0x5a8b('0x31')]};});_0x389a9d[_0x5a8b('0x32')]=_['map'](_0x48f06d,'name');_0x389a9d[_0x5a8b('0x33')]=_['keys'](_0x2784b2[_0x5a8b('0x33')]);_0x389a9d[_0x5a8b('0x34')]=_[_0x5a8b('0x35')](_0x389a9d[_0x5a8b('0x32')],_0x389a9d[_0x5a8b('0x33')]);_0x3c80c2[_0x5a8b('0x36')]=_['intersection'](_0x389a9d[_0x5a8b('0x32')],qs['fields'](_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x37')]));_0x3c80c2['attributes']=_0x3c80c2[_0x5a8b('0x36')][_0x5a8b('0x38')]?_0x3c80c2[_0x5a8b('0x36')]:_0x389a9d[_0x5a8b('0x32')];if(!_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x39')](_0x5a8b('0x3a'))){_0x3c80c2[_0x5a8b('0x1f')]=qs[_0x5a8b('0x1f')](_0x2784b2[_0x5a8b('0x33')]['limit']);_0x3c80c2['offset']=qs['offset'](_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x1e')]);}_0x3c80c2[_0x5a8b('0x3b')]=qs[_0x5a8b('0x3c')](_0x2784b2['query']['sort']);delete _0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x3c')];_0x3c80c2[_0x5a8b('0x3d')]=qs['filters'](_[_0x5a8b('0x3e')](_0x2784b2[_0x5a8b('0x33')],_0x389a9d[_0x5a8b('0x34')]),_0x48f06d);if(_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x3f')]){_0x3c80c2[_0x5a8b('0x3d')]=_[_0x5a8b('0x40')](_0x3c80c2[_0x5a8b('0x3d')],{'$or':_[_0x5a8b('0x41')](_0x48f06d,function(_0x250d02){if(_0x250d02[_0x5a8b('0x42')]!=='VIRTUAL'){var _0xbfba72={};_0xbfba72[_0x250d02[_0x5a8b('0x2c')]]={'$like':'%'+_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x3f')]+'%'};return _0xbfba72;}})});}_0x3c80c2=_[_0x5a8b('0x40')]({},_0x3c80c2,_0x2784b2[_0x5a8b('0x43')]);var _0x4e3ae9={'where':_0x3c80c2[_0x5a8b('0x3d')]};return db[_0x5a8b('0x44')][_0x5a8b('0x45')](_0x4e3ae9)[_0x5a8b('0x25')](function(_0x10f851){_0x428128[_0x5a8b('0x45')]=_0x10f851;if(_0x2784b2[_0x5a8b('0x33')][_0x5a8b('0x46')]){_0x3c80c2['include']=[{'all':!![]}];}return db[_0x5a8b('0x44')][_0x5a8b('0x47')](_0x3c80c2);})[_0x5a8b('0x25')](function(_0x167e6c){_0x428128[_0x5a8b('0x48')]=_0x167e6c;return _0x428128;})[_0x5a8b('0x25')](respondWithFilteredResult(_0x3a8dde,_0x3c80c2))[_0x5a8b('0x49')](handleError(_0x3a8dde,null));};exports[_0x5a8b('0x4a')]=function(_0x10d44e,_0x3c06a5){var _0x29d856={'raw':![],'where':{'id':_0x10d44e[_0x5a8b('0x4b')]['id']}},_0x4d5c7f={};_0x4d5c7f[_0x5a8b('0x32')]=_[_0x5a8b('0x4c')](db[_0x5a8b('0x44')][_0x5a8b('0x2f')]);_0x4d5c7f[_0x5a8b('0x33')]=_[_0x5a8b('0x4c')](_0x10d44e[_0x5a8b('0x33')]);_0x4d5c7f['filters']=_['intersection'](_0x4d5c7f['model'],_0x4d5c7f[_0x5a8b('0x33')]);_0x29d856[_0x5a8b('0x36')]=_['intersection'](_0x4d5c7f[_0x5a8b('0x32')],qs[_0x5a8b('0x37')](_0x10d44e[_0x5a8b('0x33')]['fields']));_0x29d856[_0x5a8b('0x36')]=_0x29d856[_0x5a8b('0x36')][_0x5a8b('0x38')]?_0x29d856['attributes']:_0x4d5c7f[_0x5a8b('0x32')];if(_0x10d44e['query'][_0x5a8b('0x46')]){_0x29d856['include']=[{'all':!![]}];}_0x29d856=_['merge']({},_0x29d856,_0x10d44e[_0x5a8b('0x43')]);return db[_0x5a8b('0x44')][_0x5a8b('0x4d')](_0x29d856)[_0x5a8b('0x25')](handleEntityNotFound(_0x3c06a5,null))[_0x5a8b('0x25')](respondWithResult(_0x3c06a5,null))[_0x5a8b('0x49')](handleError(_0x3c06a5,null));};exports[_0x5a8b('0x4e')]=function(_0x34649c,_0x128286){if(_0x34649c[_0x5a8b('0x4f')]['id']){delete _0x34649c[_0x5a8b('0x4f')]['id'];}return db[_0x5a8b('0x44')]['find']({'where':{'id':_0x34649c[_0x5a8b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x128286,null))['then'](saveUpdates(_0x34649c[_0x5a8b('0x4f')],null))['then'](respondWithResult(_0x128286,null))[_0x5a8b('0x49')](handleError(_0x128286,null));};exports['create']=function(_0x1c4926,_0x2e34f1,_0x243db7){return db[_0x5a8b('0x50')][_0x5a8b('0x51')](function(_0x3669d3){if(_0x1c4926[_0x5a8b('0x4f')]['mode']===_0x5a8b('0x52')){_0x1c4926[_0x5a8b('0x4f')][_0x5a8b('0x53')]=path[_0x5a8b('0x54')](config['root'],_0x5a8b('0x55'),_0x1c4926[_0x5a8b('0x4f')][_0x5a8b('0x2c')]);}return db[_0x5a8b('0x44')]['create'](_0x1c4926['body'],{'transaction':_0x3669d3})['then'](function(_0xdfec02){if(_0x1c4926['body'][_0x5a8b('0x56')]==='files'){fs[_0x5a8b('0x57')](_0xdfec02[_0x5a8b('0x53')],parseInt(_0x5a8b('0x58'),0x8));}var _0x4fead9=_0x1c4926[_0x5a8b('0x59')][_0x5a8b('0x27')]({'plain':!![]});if(!_0x4fead9)throw new Error(_0x5a8b('0x5a'));if(_0x4fead9[_0x5a8b('0x5b')]===_0x5a8b('0x59')){var _0x38afaa=_0xdfec02[_0x5a8b('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x5a8b('0x4d')]({'where':{'name':_0x5a8b('0x28'),'userProfileId':_0x4fead9[_0x5a8b('0x5c')]},'raw':!![]})[_0x5a8b('0x25')](function(_0x376302){if(_0x376302&&_0x376302[_0x5a8b('0x5d')]===0x0){return db[_0x5a8b('0x29')][_0x5a8b('0x5e')]({'name':_0x38afaa[_0x5a8b('0x2c')],'resourceId':_0x38afaa['id'],'type':_0x376302[_0x5a8b('0x2c')],'sectionId':_0x376302['id']},{})[_0x5a8b('0x25')](function(){return _0xdfec02;});}else{return _0xdfec02;}})[_0x5a8b('0x49')](function(_0x5c211a){logger['error'](_0x5a8b('0x5f'),_0x5c211a);});}return _0xdfec02;});})[_0x5a8b('0x25')](respondWithResult(_0x2e34f1,0xc9))[_0x5a8b('0x49')](handleError(_0x2e34f1,null));};exports['destroy']=function(_0x365581,_0x4b4946,_0x4428fd){var _0x2859b8;return db[_0x5a8b('0x44')][_0x5a8b('0x4d')]({'where':{'id':_0x365581[_0x5a8b('0x4b')]['id']}})[_0x5a8b('0x25')](function(_0x52b298){if(_0x52b298){return db[_0x5a8b('0x50')][_0x5a8b('0x51')](function(_0x429e99){return _0x52b298[_0x5a8b('0x26')]({'transaction':_0x429e99,'raw':!![]})[_0x5a8b('0x25')](function(_0x500540){if(_0x500540[_0x5a8b('0x53')]){fs[_0x5a8b('0x60')](_0x500540[_0x5a8b('0x53')])['forEach'](function(_0x2232bd){fs[_0x5a8b('0x61')](path['join'](_0x500540['directory'],_0x2232bd));});fs[_0x5a8b('0x62')](_0x500540['directory']);}return _0x500540;});})[_0x5a8b('0x49')](function(_0x1a7b2f){throw new db['Sequelize'][(_0x5a8b('0x63'))](_0x1a7b2f[_0x5a8b('0x64')]);});}})[_0x5a8b('0x25')](handleEntityNotFound(_0x4b4946,null))['then'](removeEntity(_0x4b4946,null))[_0x5a8b('0x49')](handleError(_0x4b4946,null));};exports[_0x5a8b('0x65')]=function(_0x2a1fab,_0x1126e3,_0x262893){return db[_0x5a8b('0x50')][_0x5a8b('0x51')](function(_0x598500){var _0x2f1913;return db[_0x5a8b('0x44')]['find']({'where':{'id':_0x2a1fab[_0x5a8b('0x4b')]['id']}})['then'](function(_0x23b6ce){if(_0x23b6ce){_0x2f1913=_0x23b6ce;return _0x23b6ce['addSound'](_0x2a1fab[_0x5a8b('0x4f')]['id'],{'transaction':_0x598500});}})[_0x5a8b('0x25')](function(_0x2c8371){if(_0x2c8371){return db[_0x5a8b('0x66')][_0x5a8b('0x67')]({'where':{'id':_0x2a1fab[_0x5a8b('0x4f')]['id']},'attributes':['id',_0x5a8b('0x2c'),_0x5a8b('0x68'),_0x5a8b('0x69'),_0x5a8b('0x6a')],'raw':!![]});}})[_0x5a8b('0x25')](function(_0x3200d0){if(_0x3200d0){var _0x13d411=path[_0x5a8b('0x54')](config[_0x5a8b('0x6b')],_0x5a8b('0x6c'),util[_0x5a8b('0x6d')]('%s.%s',path['basename'](_0x3200d0[_0x5a8b('0x68')],path[_0x5a8b('0x6e')](_0x3200d0['save_name'])),_0x3200d0['converted_format']));var _0x4b02eb=path[_0x5a8b('0x54')](config[_0x5a8b('0x6b')],'server/files/moh',_0x2f1913[_0x5a8b('0x2c')],util[_0x5a8b('0x6d')](_0x5a8b('0x6f'),_0x3200d0[_0x5a8b('0x2c')],_0x3200d0['converted_format']));fs[_0x5a8b('0x70')](_0x13d411,_0x4b02eb);return _0x3200d0;}})['catch'](function(_0x5308c5){throw new db['Sequelize'][(_0x5a8b('0x63'))](_0x5308c5[_0x5a8b('0x64')]);});})[_0x5a8b('0x25')](handleEntityNotFound(_0x1126e3,null))['then'](respondWithResult(_0x1126e3,0xc9))[_0x5a8b('0x49')](handleError(_0x1126e3,null));};exports['removeSound']=function(_0x14e071,_0x378db7,_0x1da26d){return db['sequelize'][_0x5a8b('0x51')](function(_0x4eff23){var _0x11b473;return db[_0x5a8b('0x44')][_0x5a8b('0x67')]({'where':{'id':_0x14e071[_0x5a8b('0x4b')]['id']}})[_0x5a8b('0x25')](handleEntityNotFound(_0x378db7,null))[_0x5a8b('0x25')](function(_0x2d27c3){if(_0x2d27c3){_0x11b473=_0x2d27c3;return _0x2d27c3[_0x5a8b('0x71')](_0x14e071[_0x5a8b('0x4b')][_0x5a8b('0x72')]);}})[_0x5a8b('0x25')](function(_0x5bd144){if(_0x5bd144){return db[_0x5a8b('0x66')][_0x5a8b('0x67')]({'where':{'id':_0x14e071[_0x5a8b('0x4b')]['id2']},'attributes':['id',_0x5a8b('0x2c'),_0x5a8b('0x68'),_0x5a8b('0x69'),_0x5a8b('0x6a')],'raw':!![]});}})['then'](function(_0x483941){if(_0x483941){fs[_0x5a8b('0x61')](path['join'](_0x11b473[_0x5a8b('0x53')],util[_0x5a8b('0x6d')]('%s.%s',_0x483941[_0x5a8b('0x2c')],_0x483941[_0x5a8b('0x69')])));return _0x483941;}})[_0x5a8b('0x49')](function(_0x46cf7e){throw new db[(_0x5a8b('0x73'))][(_0x5a8b('0x63'))](_0x46cf7e[_0x5a8b('0x64')]);});})[_0x5a8b('0x25')](handleEntityNotFound(_0x378db7,null))[_0x5a8b('0x25')](respondWithStatusCode(_0x378db7,0xcc))[_0x5a8b('0x49')](handleError(_0x378db7,null));};exports[_0x5a8b('0x74')]=function(_0x336d33,_0x3821ab,_0x130e65){var _0x443c7d={};var _0x4d7aff={};var _0x4ce773;var _0x17a86e;return db['VoiceMusicOnHold'][_0x5a8b('0x67')]({'where':{'id':_0x336d33[_0x5a8b('0x4b')]['id']}})[_0x5a8b('0x25')](handleEntityNotFound(_0x3821ab,null))[_0x5a8b('0x25')](function(_0x5a7e81){if(_0x5a7e81){_0x4ce773=_0x5a7e81;_0x4d7aff[_0x5a8b('0x32')]=_['keys'](db[_0x5a8b('0x66')][_0x5a8b('0x2f')]);_0x4d7aff[_0x5a8b('0x33')]=_[_0x5a8b('0x4c')](_0x336d33[_0x5a8b('0x33')]);_0x4d7aff['filters']=_[_0x5a8b('0x35')](_0x4d7aff[_0x5a8b('0x32')],_0x4d7aff[_0x5a8b('0x33')]);_0x443c7d[_0x5a8b('0x36')]=_[_0x5a8b('0x35')](_0x4d7aff[_0x5a8b('0x32')],qs[_0x5a8b('0x37')](_0x336d33[_0x5a8b('0x33')][_0x5a8b('0x37')]));_0x443c7d[_0x5a8b('0x36')]=_0x443c7d[_0x5a8b('0x36')][_0x5a8b('0x38')]?_0x443c7d[_0x5a8b('0x36')]:_0x4d7aff['model'];_0x443c7d[_0x5a8b('0x3b')]=qs[_0x5a8b('0x3c')](_0x336d33[_0x5a8b('0x33')]['sort']);_0x443c7d[_0x5a8b('0x3d')]=qs[_0x5a8b('0x34')](_[_0x5a8b('0x3e')](_0x336d33[_0x5a8b('0x33')],_0x4d7aff[_0x5a8b('0x34')]));if(_0x336d33[_0x5a8b('0x33')][_0x5a8b('0x3f')]){_0x443c7d[_0x5a8b('0x3d')]=_[_0x5a8b('0x40')](_0x443c7d['where'],{'$or':_[_0x5a8b('0x41')](_0x443c7d[_0x5a8b('0x36')],function(_0x51ebe0){var _0x5d1ac6={};_0x5d1ac6[_0x51ebe0]={'$like':'%'+_0x336d33[_0x5a8b('0x33')]['filter']+'%'};return _0x5d1ac6;})});}_0x443c7d=_[_0x5a8b('0x40')]({},_0x443c7d,_0x336d33[_0x5a8b('0x43')]);return _0x4ce773['getSounds'](_0x443c7d);}})[_0x5a8b('0x25')](function(_0x5c7f1d){if(_0x5c7f1d){_0x17a86e=_0x5c7f1d[_0x5a8b('0x38')];if(!_0x336d33[_0x5a8b('0x33')]['hasOwnProperty'](_0x5a8b('0x3a'))){_0x443c7d['limit']=qs[_0x5a8b('0x1f')](_0x336d33[_0x5a8b('0x33')][_0x5a8b('0x1f')]);_0x443c7d['offset']=qs['offset'](_0x336d33[_0x5a8b('0x33')]['offset']);}return _0x4ce773[_0x5a8b('0x74')](_0x443c7d);}})[_0x5a8b('0x25')](function(_0x504f80){if(_0x504f80){return _0x504f80?{'count':_0x17a86e,'rows':_0x504f80}:null;}})[_0x5a8b('0x25')](respondWithResult(_0x3821ab,null))[_0x5a8b('0x49')](handleError(_0x3821ab,null));};
\ No newline at end of file
index 861d680..31e9172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb14=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xbb14,0x1b5));var _0x4bb1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xbb14[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x4bb1('0x0'));var util=require(_0x4bb1('0x1'));var logger=require(_0x4bb1('0x2'))(_0x4bb1('0x3'));var moment=require(_0x4bb1('0x4'));var BPromise=require(_0x4bb1('0x5'));var rp=require(_0x4bb1('0x6'));var fs=require('fs');var path=require(_0x4bb1('0x7'));var rimraf=require(_0x4bb1('0x8'));var config=require(_0x4bb1('0x9'));var attributes=require(_0x4bb1('0xa'));module[_0x4bb1('0xb')]=function(_0x514b4e,_0x42bb6f){return _0x514b4e[_0x4bb1('0xc')](_0x4bb1('0xd'),attributes,{'tableName':_0x4bb1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3893=['api','moment','bluebird','request-promise','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3893,0x1a1));var _0x3389=function(_0x2b76c9,_0x46eaee){_0x2b76c9=_0x2b76c9-0x0;var _0x230b98=_0x3893[_0x2b76c9];return _0x230b98;};'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('path');var rimraf=require('rimraf');var config=require(_0x3389('0x5'));var attributes=require(_0x3389('0x6'));module[_0x3389('0x7')]=function(_0x546865,_0x5e963b){return _0x546865[_0x3389('0x8')](_0x3389('0x9'),attributes,{'tableName':_0x3389('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c1c921c..91200b6 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(_0x4338f5,_0x1d6b3e){var _0x2176e0=function(_0x328691){while(--_0x328691){_0x4338f5['push'](_0x4338f5['shift']());}};_0x2176e0(++_0x1d6b3e);}(_0x34e8,0x12c));var _0x834e=function(_0x43dc7e,_0xfa0631){_0x43dc7e=_0x43dc7e-0x0;var _0x4089f9=_0x34e8[_0x43dc7e];return _0x4089f9;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x43d13d,_0x201c5b){var _0x6e32ef=function(_0x530510){while(--_0x530510){_0x43d13d['push'](_0x43d13d['shift']());}};_0x6e32ef(++_0x201c5b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0xcb91[_0x47df54];return _0x261b87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
index 7c6d0ec..37166cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c8=['show','/:id/users','getAgents','post','create','addAgents','put','/:id','delete','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc1c8,0xec));var _0x8c1c=function(_0x51c4e0,_0x5a1947){_0x51c4e0=_0x51c4e0-0x0;var _0x5aa2f7=_0xc1c8[_0x51c4e0];return _0x5aa2f7;};'use strict';var multer=require('multer');var util=require(_0x8c1c('0x0'));var path=require(_0x8c1c('0x1'));var timeout=require(_0x8c1c('0x2'));var express=require('express');var router=express[_0x8c1c('0x3')]();var fs_extra=require(_0x8c1c('0x4'));var auth=require(_0x8c1c('0x5'));var interaction=require(_0x8c1c('0x6'));var config=require(_0x8c1c('0x7'));var controller=require(_0x8c1c('0x8'));router[_0x8c1c('0x9')]('/',auth[_0x8c1c('0xa')](),controller[_0x8c1c('0xb')]);router[_0x8c1c('0x9')](_0x8c1c('0xc'),auth[_0x8c1c('0xa')](),controller[_0x8c1c('0xd')]);router['get']('/:id',auth[_0x8c1c('0xa')](),controller[_0x8c1c('0xe')]);router[_0x8c1c('0x9')](_0x8c1c('0xf'),auth['isAuthenticated'](),controller[_0x8c1c('0x10')]);router[_0x8c1c('0x11')]('/',auth[_0x8c1c('0xa')](),controller[_0x8c1c('0x12')]);router[_0x8c1c('0x11')](_0x8c1c('0xf'),auth['isAuthenticated'](),controller[_0x8c1c('0x13')]);router[_0x8c1c('0x14')](_0x8c1c('0x15'),auth[_0x8c1c('0xa')](),controller['update']);router[_0x8c1c('0x16')](_0x8c1c('0x15'),auth[_0x8c1c('0xa')](),controller['destroy']);router[_0x8c1c('0x16')](_0x8c1c('0xf'),auth['isAuthenticated'](),controller[_0x8c1c('0x17')]);module[_0x8c1c('0x18')]=router;
\ No newline at end of file
+var _0x6a37=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','post','addAgents'];(function(_0x161164,_0xff666f){var _0x2b81a4=function(_0xc6e819){while(--_0xc6e819){_0x161164['push'](_0x161164['shift']());}};_0x2b81a4(++_0xff666f);}(_0x6a37,0xac));var _0x76a3=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x6a37[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x76a3('0x0'));var util=require(_0x76a3('0x1'));var path=require('path');var timeout=require(_0x76a3('0x2'));var express=require(_0x76a3('0x3'));var router=express[_0x76a3('0x4')]();var fs_extra=require(_0x76a3('0x5'));var auth=require(_0x76a3('0x6'));var interaction=require(_0x76a3('0x7'));var config=require(_0x76a3('0x8'));var controller=require('./voicePrefix.controller');router[_0x76a3('0x9')]('/',auth[_0x76a3('0xa')](),controller[_0x76a3('0xb')]);router[_0x76a3('0x9')](_0x76a3('0xc'),auth[_0x76a3('0xa')](),controller[_0x76a3('0xd')]);router[_0x76a3('0x9')](_0x76a3('0xe'),auth['isAuthenticated'](),controller[_0x76a3('0xf')]);router[_0x76a3('0x9')](_0x76a3('0x10'),auth[_0x76a3('0xa')](),controller[_0x76a3('0x11')]);router[_0x76a3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x76a3('0x10'),auth['isAuthenticated'](),controller[_0x76a3('0x13')]);router[_0x76a3('0x14')](_0x76a3('0xe'),auth[_0x76a3('0xa')](),controller[_0x76a3('0x15')]);router[_0x76a3('0x16')](_0x76a3('0xe'),auth[_0x76a3('0xa')](),controller[_0x76a3('0x17')]);router[_0x76a3('0x16')](_0x76a3('0x10'),auth[_0x76a3('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 9ba1cbf..55fb720 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32b=['STRING','name','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa32b,0xd7));var _0xba32=function(_0x962de1,_0x361057){_0x962de1=_0x962de1-0x0;var _0x14085a=_0xa32b[_0x962de1];return _0x14085a;};'use strict';var Sequelize=require(_0xba32('0x0'));module[_0xba32('0x1')]={'name':{'type':Sequelize[_0xba32('0x2')],'allowNull':![],'unique':_0xba32('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2c8ced){return _0xba32('0x4')+this[_0xba32('0x5')](_0xba32('0x3'))+'-';}},'description':{'type':Sequelize[_0xba32('0x2')]},'callerIdAll':{'type':Sequelize[_0xba32('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xba32('0x6')]}};
\ No newline at end of file
+var _0x6f3f=['name','VIRTUAL','getDataValue','sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6f3f,0xcf));var _0xf6f3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6f3f[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xf6f3('0x0'));module[_0xf6f3('0x1')]={'name':{'type':Sequelize[_0xf6f3('0x2')],'allowNull':![],'unique':_0xf6f3('0x3')},'prefix':{'type':Sequelize[_0xf6f3('0x4')],'get':function(_0x208d9f){return'system-'+this[_0xf6f3('0x5')](_0xf6f3('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf6f3('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index feefd6c..174fe11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d70=['mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','VoicePrefix','findAll','catch','params','include','find','describe','sequelize','create','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','findOne','User','getAgents','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5039ca,_0x5816d4){var _0x557012=function(_0x227d67){while(--_0x227d67){_0x5039ca['push'](_0x5039ca['shift']());}};_0x557012(++_0x5816d4);}(_0x3d70,0xf6));var _0x03d7=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x3d70[_0x1ee9a1];return _0x21270f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03d7('0x0'));var zipdir=require(_0x03d7('0x1'));var jsonpatch=require(_0x03d7('0x2'));var rp=require('request-promise');var moment=require(_0x03d7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x03d7('0x4'));var util=require(_0x03d7('0x5'));var path=require('path');var sox=require(_0x03d7('0x6'));var csv=require('to-csv');var ejs=require(_0x03d7('0x7'));var fs=require('fs');var fs_extra=require(_0x03d7('0x8'));var _=require(_0x03d7('0x9'));var squel=require(_0x03d7('0xa'));var crypto=require('crypto');var jsforce=require(_0x03d7('0xb'));var deskjs=require(_0x03d7('0xc'));var toCsv=require(_0x03d7('0xd'));var querystring=require('querystring');var Papa=require(_0x03d7('0xe'));var Redis=require(_0x03d7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03d7('0x10'));var as=require(_0x03d7('0x11'));var hardwareService=require(_0x03d7('0x12'));var logger=require(_0x03d7('0x13'))(_0x03d7('0x14'));var utils=require(_0x03d7('0x15'));var config=require(_0x03d7('0x16'));var licenseUtil=require(_0x03d7('0x17'));var db=require(_0x03d7('0x18'))['db'];config['redis']=_['defaults'](config[_0x03d7('0x19')],{'host':_0x03d7('0x1a'),'port':0x18eb});var socket=require(_0x03d7('0x1b'))(new Redis(config[_0x03d7('0x19')]));require(_0x03d7('0x1c'))[_0x03d7('0x1d')](socket);function respondWithStatusCode(_0xff21b0,_0x397fac){_0x397fac=_0x397fac||0xcc;return function(_0x2caed3){if(_0x2caed3){return _0xff21b0[_0x03d7('0x1e')](_0x397fac);}return _0xff21b0['status'](_0x397fac)['end']();};}function respondWithResult(_0x11c74b,_0x337e0b){_0x337e0b=_0x337e0b||0xc8;return function(_0x241339){if(_0x241339){return _0x11c74b[_0x03d7('0x1f')](_0x337e0b)[_0x03d7('0x20')](_0x241339);}};}function respondWithFilteredResult(_0x5fb5b2,_0x2139b9){return function(_0x4e809f){if(_0x4e809f){var _0x54f029=typeof _0x2139b9['offset']===_0x03d7('0x21')&&typeof _0x2139b9[_0x03d7('0x22')]===_0x03d7('0x21');var _0x6aab4=_0x4e809f[_0x03d7('0x23')];var _0x1fa6d9=_0x54f029?0x0:_0x2139b9['offset'];var _0x539beb=_0x54f029?_0x4e809f[_0x03d7('0x23')]:_0x2139b9[_0x03d7('0x24')]+_0x2139b9['limit'];var _0x1e629a;if(_0x539beb>=_0x6aab4){_0x539beb=_0x6aab4;_0x1e629a=0xc8;}else{_0x1e629a=0xce;}_0x5fb5b2[_0x03d7('0x1f')](_0x1e629a);return _0x5fb5b2[_0x03d7('0x25')](_0x03d7('0x26'),_0x1fa6d9+'-'+_0x539beb+'/'+_0x6aab4)[_0x03d7('0x20')](_0x4e809f);}return null;};}function patchUpdates(_0x298baf){return function(_0x2e6799){try{jsonpatch[_0x03d7('0x27')](_0x2e6799,_0x298baf,!![]);}catch(_0xd9f81d){return BPromise[_0x03d7('0x28')](_0xd9f81d);}return _0x2e6799[_0x03d7('0x29')]();};}function saveUpdates(_0x60dddb,_0x2b600c){return function(_0x479bf8){if(_0x479bf8){return _0x479bf8[_0x03d7('0x2a')](_0x60dddb)[_0x03d7('0x2b')](function(_0x30496c){return _0x30496c;});}return null;};}function removeEntity(_0x2db8a6,_0x1cdd49){return function(_0x1858aa){if(_0x1858aa){return _0x1858aa[_0x03d7('0x2c')]()[_0x03d7('0x2b')](function(){var _0x2050cd=_0x1858aa['get']({'plain':!![]});var _0x58d170=_0x03d7('0x2d');return db[_0x03d7('0x2e')][_0x03d7('0x2c')]({'where':{'type':_0x58d170,'resourceId':_0x2050cd['id']}})[_0x03d7('0x2b')](function(){return _0x1858aa;});})[_0x03d7('0x2b')](function(){_0x2db8a6[_0x03d7('0x1f')](0xcc)[_0x03d7('0x2f')]();});}};}function handleEntityNotFound(_0x59d48b,_0x11a3cf){return function(_0xfc727f){if(!_0xfc727f){_0x59d48b['sendStatus'](0x194);}return _0xfc727f;};}function handleError(_0x1108d0,_0x21ab40){_0x21ab40=_0x21ab40||0x1f4;return function(_0x4fc76d){logger[_0x03d7('0x30')](_0x4fc76d[_0x03d7('0x31')]);if(_0x4fc76d[_0x03d7('0x32')]){delete _0x4fc76d['name'];}_0x1108d0[_0x03d7('0x1f')](_0x21ab40)[_0x03d7('0x33')](_0x4fc76d);};}exports['index']=function(_0x4c1121,_0x3a8ac3){var _0x1f2c24={},_0x24f749={},_0x2655a0={'count':0x0,'rows':[]};var _0x1d8b6c=_[_0x03d7('0x34')](db['VoicePrefix'][_0x03d7('0x35')],function(_0x4a6532){return{'name':_0x4a6532[_0x03d7('0x36')],'type':_0x4a6532[_0x03d7('0x37')][_0x03d7('0x38')]};});_0x24f749[_0x03d7('0x39')]=_[_0x03d7('0x34')](_0x1d8b6c,'name');_0x24f749[_0x03d7('0x3a')]=_[_0x03d7('0x3b')](_0x4c1121['query']);_0x24f749[_0x03d7('0x3c')]=_[_0x03d7('0x3d')](_0x24f749[_0x03d7('0x39')],_0x24f749[_0x03d7('0x3a')]);_0x1f2c24['attributes']=_[_0x03d7('0x3d')](_0x24f749[_0x03d7('0x39')],qs[_0x03d7('0x3e')](_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x3e')]));_0x1f2c24[_0x03d7('0x3f')]=_0x1f2c24[_0x03d7('0x3f')][_0x03d7('0x40')]?_0x1f2c24[_0x03d7('0x3f')]:_0x24f749['model'];if(!_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x41')](_0x03d7('0x42'))){_0x1f2c24['limit']=qs['limit'](_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x22')]);_0x1f2c24[_0x03d7('0x24')]=qs[_0x03d7('0x24')](_0x4c1121['query'][_0x03d7('0x24')]);}_0x1f2c24[_0x03d7('0x43')]=qs[_0x03d7('0x44')](_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x44')]);_0x1f2c24[_0x03d7('0x45')]=qs[_0x03d7('0x3c')](_[_0x03d7('0x46')](_0x4c1121[_0x03d7('0x3a')],_0x24f749[_0x03d7('0x3c')]),_0x1d8b6c);if(_0x4c1121[_0x03d7('0x3a')]['filter']){_0x1f2c24['where']=_[_0x03d7('0x47')](_0x1f2c24[_0x03d7('0x45')],{'$or':_[_0x03d7('0x34')](_0x1d8b6c,function(_0x14c277){if(_0x14c277[_0x03d7('0x37')]!=='VIRTUAL'){var _0x46c78c={};_0x46c78c[_0x14c277[_0x03d7('0x32')]]={'$like':'%'+_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x48')]+'%'};return _0x46c78c;}})});}_0x1f2c24=_[_0x03d7('0x47')]({},_0x1f2c24,_0x4c1121[_0x03d7('0x49')]);var _0x2ca178={'where':_0x1f2c24[_0x03d7('0x45')]};return db['VoicePrefix']['count'](_0x2ca178)[_0x03d7('0x2b')](function(_0x1ae251){_0x2655a0['count']=_0x1ae251;if(_0x4c1121[_0x03d7('0x3a')][_0x03d7('0x4a')]){_0x1f2c24['include']=[{'all':!![]}];}return db[_0x03d7('0x4b')][_0x03d7('0x4c')](_0x1f2c24);})[_0x03d7('0x2b')](function(_0x2dd8c1){_0x2655a0['rows']=_0x2dd8c1;return _0x2655a0;})['then'](respondWithFilteredResult(_0x3a8ac3,_0x1f2c24))[_0x03d7('0x4d')](handleError(_0x3a8ac3,null));};exports['show']=function(_0xd22966,_0x244561){var _0x38f27e={'raw':![],'where':{'id':_0xd22966[_0x03d7('0x4e')]['id']}},_0x245562={};_0x245562['model']=_[_0x03d7('0x3b')](db[_0x03d7('0x4b')][_0x03d7('0x35')]);_0x245562['query']=_[_0x03d7('0x3b')](_0xd22966[_0x03d7('0x3a')]);_0x245562[_0x03d7('0x3c')]=_[_0x03d7('0x3d')](_0x245562[_0x03d7('0x39')],_0x245562[_0x03d7('0x3a')]);_0x38f27e['attributes']=_['intersection'](_0x245562[_0x03d7('0x39')],qs[_0x03d7('0x3e')](_0xd22966['query'][_0x03d7('0x3e')]));_0x38f27e[_0x03d7('0x3f')]=_0x38f27e[_0x03d7('0x3f')][_0x03d7('0x40')]?_0x38f27e[_0x03d7('0x3f')]:_0x245562['model'];if(_0xd22966['query']['includeAll']){_0x38f27e[_0x03d7('0x4f')]=[{'all':!![]}];}_0x38f27e=_[_0x03d7('0x47')]({},_0x38f27e,_0xd22966[_0x03d7('0x49')]);return db['VoicePrefix'][_0x03d7('0x50')](_0x38f27e)[_0x03d7('0x2b')](handleEntityNotFound(_0x244561,null))[_0x03d7('0x2b')](respondWithResult(_0x244561,null))[_0x03d7('0x4d')](handleError(_0x244561,null));};exports[_0x03d7('0x2c')]=function(_0x4cb526,_0x3bd655){return db[_0x03d7('0x4b')][_0x03d7('0x50')]({'where':{'id':_0x4cb526['params']['id']}})[_0x03d7('0x2b')](handleEntityNotFound(_0x3bd655,null))[_0x03d7('0x2b')](removeEntity(_0x3bd655,null))[_0x03d7('0x4d')](handleError(_0x3bd655,null));};exports['describe']=function(_0x574e4e,_0x594559){return db[_0x03d7('0x4b')][_0x03d7('0x51')]()[_0x03d7('0x2b')](respondWithResult(_0x594559,null))[_0x03d7('0x4d')](handleError(_0x594559,null));};exports['create']=function(_0x186b01,_0x323e4b){var _0x73ef79;return db[_0x03d7('0x52')]['transaction'](function(_0x244f80){return db['VoicePrefix'][_0x03d7('0x53')](_0x186b01[_0x03d7('0x54')],{'transaction':_0x244f80})[_0x03d7('0x2b')](function(_0x5cc4c1){_0x73ef79=_0x5cc4c1[_0x03d7('0x55')]({'plain':!![]});return db[_0x03d7('0x56')]['find']({'where':{'id':_0x73ef79[_0x03d7('0x57')]},'raw':!![]})[_0x03d7('0x2b')](function(_0x7801e9){return createVoicePrefixExtensions(_0x73ef79,_0x7801e9,_0x244f80);});});})[_0x03d7('0x2b')](function(){var _0x1c000f=_0x186b01[_0x03d7('0x58')][_0x03d7('0x55')]({'plain':!![]});if(!_0x1c000f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c000f[_0x03d7('0x59')]==='user'){var _0x2c064d=_0x73ef79;return db[_0x03d7('0x5a')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x1c000f[_0x03d7('0x5b')]},'raw':!![]})[_0x03d7('0x2b')](function(_0x21df78){if(_0x21df78&&_0x21df78['autoAssociation']===0x0){return db[_0x03d7('0x2e')][_0x03d7('0x53')]({'name':_0x2c064d[_0x03d7('0x32')],'resourceId':_0x2c064d['id'],'type':_0x21df78['name'],'sectionId':_0x21df78['id']},{})['then'](function(){return _0x73ef79;});}else{return _0x73ef79;}})['catch'](function(_0x22986f){logger[_0x03d7('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22986f);throw _0x22986f;});}return _0x73ef79;})[_0x03d7('0x2b')](respondWithResult(_0x323e4b,null))[_0x03d7('0x4d')](handleError(_0x323e4b,null));};function Extension(_0x49c56e,_0x4cb2fb,_0x46a56e,_0x1b5cfb){this['context']=_0x03d7('0x5c');this[_0x03d7('0x5d')]=_0x49c56e;this[_0x03d7('0x5e')]=_0x46a56e;this[_0x03d7('0x37')]=_0x03d7('0x5f');this[_0x03d7('0x60')]=_0x03d7('0x61');this[_0x03d7('0x62')]=_0x4cb2fb;this['appdata']=_0x1b5cfb;}function createVoicePrefixExtensions(_0x461a77,_0x54b3fe,_0x5aef36){return new BPromise(function(_0x1a2376,_0x107da4){var _0x36b1bd=new Extension(formatPrefixName(_0x461a77[_0x03d7('0x63')]),0x1,_0x03d7('0x64'),_0x03d7('0x65'));_0x36b1bd['VoicePrefixId']=_0x461a77['id'];return db[_0x03d7('0x56')][_0x03d7('0x53')](_0x36b1bd,{'transaction':_0x5aef36})[_0x03d7('0x2b')](function(_0x12c6c3){var _0x3a6097=_0x12c6c3[_0x03d7('0x55')]({'plain':!![]});var _0x568c02=_[_0x03d7('0x34')](addVoicePrefixExtensions(_0x461a77,_0x54b3fe),function(_0x44f629){_0x44f629[_0x03d7('0x57')]=_0x3a6097['id'];_0x44f629['VoicePrefixId']=_0x461a77['id'];return _0x44f629;});return db[_0x03d7('0x56')][_0x03d7('0x66')](_0x568c02,{'transaction':_0x5aef36})[_0x03d7('0x2b')](function(_0x35154b){if(!_0x35154b){return _0x107da4('Extensions\x20creation\x20failed');}else{return _0x1a2376(_0x35154b);}})[_0x03d7('0x4d')](function(_0x21539b){return _0x107da4(_0x21539b);});});;});};function addVoicePrefixExtensions(_0x4d1c08,_0x98c427){var _0x15b8c7=[];var _0x52b187=formatPrefixName(_0x4d1c08['prefix']);_0x15b8c7[_0x03d7('0x67')](new Extension(_0x52b187,0x2,_0x03d7('0x68'),_0x03d7('0x69')+_0x4d1c08[_0x03d7('0x32')]));if(_0x4d1c08[_0x03d7('0x6a')]){_0x15b8c7['push'](new Extension(_0x52b187,0x3,'Set','PREFIX-CALLERIDALL='+_0x4d1c08[_0x03d7('0x6a')]));}else{_0x15b8c7[_0x03d7('0x67')](new Extension(_0x52b187,0x3,_0x03d7('0x64'),_0x03d7('0x6b')));}_0x15b8c7['push'](new Extension(_0x52b187,0x4,'goto',_0x98c427[_0x03d7('0x6c')]+','+_0x03d7('0x6d')+(0x8+_0x4d1c08['name'][_0x03d7('0x40')])+'}'+','+0x1));return _0x15b8c7;}function formatPrefixName(_0xd206d2){var _0x1ce3df='_';for(var _0x53872d=0x0;_0x53872d<_0xd206d2['length'];_0x53872d++){if(_0xd206d2[_0x03d7('0x6e')](_0x53872d)=='-'){_0x1ce3df+=_0xd206d2['charAt'](_0x53872d);}else{_0x1ce3df+='['+_0xd206d2[_0x03d7('0x6e')](_0x53872d)+']';}}_0x1ce3df+='.';return _0x1ce3df;}exports[_0x03d7('0x2a')]=function(_0x53b1a7,_0x225248,_0x4c67c3){var _0x420b62=_0x53b1a7[_0x03d7('0x54')];_0x420b62[_0x03d7('0x63')]=_0x03d7('0x6f')+_0x420b62['name']+'-';return db[_0x03d7('0x52')][_0x03d7('0x70')](function(_0x12f004){return db[_0x03d7('0x4b')][_0x03d7('0x2a')](_0x420b62,{'where':{'id':_0x420b62['id']},'transaction':_0x12f004})[_0x03d7('0x2b')](function(){return db[_0x03d7('0x56')][_0x03d7('0x2c')]({'where':{'VoicePrefixId':_0x420b62['id']},'transaction':_0x12f004})['then'](function(){return db[_0x03d7('0x56')][_0x03d7('0x50')]({'where':{'id':_0x420b62[_0x03d7('0x57')]},'raw':!![]})[_0x03d7('0x2b')](function(_0x54e79d){return createVoicePrefixExtensions(_0x420b62,_0x54e79d,_0x12f004);});});});})[_0x03d7('0x2b')](function(){return db['VoicePrefix'][_0x03d7('0x71')](_0x420b62['id']);})[_0x03d7('0x2b')](respondWithResult(_0x225248,null))[_0x03d7('0x4d')](handleError(_0x225248,null));};exports[_0x03d7('0x72')]=function(_0x440253,_0x5e52bb,_0x11d6fd){return db['VoicePrefix'][_0x03d7('0x50')]({'where':{'id':_0x440253[_0x03d7('0x4e')]['id']}})[_0x03d7('0x2b')](handleEntityNotFound(_0x5e52bb,null))[_0x03d7('0x2b')](function(_0x3a6d52){if(_0x3a6d52){return _0x3a6d52[_0x03d7('0x72')](_0x440253[_0x03d7('0x54')][_0x03d7('0x73')],_[_0x03d7('0x74')](_0x440253[_0x03d7('0x54')],[_0x03d7('0x73'),'id'])||{})['spread'](function(_0x30fd19){for(var _0x401e9a=0x0;_0x401e9a<_0x440253[_0x03d7('0x54')]['ids'][_0x03d7('0x40')];_0x401e9a+=0x1){socket['emit'](_0x03d7('0x75'),{'UserId':Number(_0x440253[_0x03d7('0x54')]['ids'][_0x401e9a]),'VoicePrefixId':Number(_0x440253[_0x03d7('0x4e')]['id'])});}return _0x30fd19;});}})['then'](respondWithResult(_0x5e52bb,null))[_0x03d7('0x4d')](handleError(_0x5e52bb,null));};exports['removeAgents']=function(_0x382048,_0x505c48,_0x299a04){return db['VoicePrefix'][_0x03d7('0x50')]({'where':{'id':_0x382048[_0x03d7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x505c48,null))['then'](function(_0x57fec0){if(_0x57fec0){return _0x57fec0[_0x03d7('0x76')](_0x382048[_0x03d7('0x3a')]['ids'])['then'](function(){if(_[_0x03d7('0x77')](_0x382048['query'][_0x03d7('0x73')])){for(var _0x5e3a75=0x0;_0x5e3a75<_0x382048[_0x03d7('0x3a')][_0x03d7('0x73')][_0x03d7('0x40')];_0x5e3a75+=0x1){socket['emit'](_0x03d7('0x78'),{'UserId':Number(_0x382048[_0x03d7('0x3a')][_0x03d7('0x73')][_0x5e3a75]),'VoicePrefixId':Number(_0x382048['params']['id'])});}}else{socket[_0x03d7('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x382048[_0x03d7('0x3a')][_0x03d7('0x73')]),'VoicePrefixId':Number(_0x382048['params']['id'])});}});}})[_0x03d7('0x2b')](respondWithStatusCode(_0x505c48,null))[_0x03d7('0x4d')](handleError(_0x505c48,null));};exports['getAgents']=function(_0x24178e,_0x35456f,_0x4e0fef){var _0x183339={};var _0x569729={};var _0x4b104a;var _0x449343;return db[_0x03d7('0x4b')][_0x03d7('0x7a')]({'where':{'id':_0x24178e[_0x03d7('0x4e')]['id']}})[_0x03d7('0x2b')](handleEntityNotFound(_0x35456f,null))['then'](function(_0x383012){if(_0x383012){_0x4b104a=_0x383012;_0x569729[_0x03d7('0x39')]=_[_0x03d7('0x3b')](db[_0x03d7('0x7b')]['rawAttributes']);_0x569729['query']=_[_0x03d7('0x3b')](_0x24178e[_0x03d7('0x3a')]);_0x569729[_0x03d7('0x3c')]=_[_0x03d7('0x3d')](_0x569729[_0x03d7('0x39')],_0x569729[_0x03d7('0x3a')]);_0x183339[_0x03d7('0x3f')]=_[_0x03d7('0x3d')](_0x569729[_0x03d7('0x39')],qs[_0x03d7('0x3e')](_0x24178e[_0x03d7('0x3a')]['fields']));_0x183339['attributes']=_0x183339[_0x03d7('0x3f')][_0x03d7('0x40')]?_0x183339[_0x03d7('0x3f')]:_0x569729[_0x03d7('0x39')];_0x183339[_0x03d7('0x43')]=qs[_0x03d7('0x44')](_0x24178e[_0x03d7('0x3a')][_0x03d7('0x44')]);_0x183339[_0x03d7('0x45')]=qs['filters'](_[_0x03d7('0x46')](_0x24178e[_0x03d7('0x3a')],_0x569729['filters']));if(_0x24178e[_0x03d7('0x3a')]['filter']){_0x183339[_0x03d7('0x45')]=_['merge'](_0x183339[_0x03d7('0x45')],{'$or':_['map'](_0x183339[_0x03d7('0x3f')],function(_0x1a213b){var _0x403dff={};_0x403dff[_0x1a213b]={'$like':'%'+_0x24178e[_0x03d7('0x3a')][_0x03d7('0x48')]+'%'};return _0x403dff;})});}_0x183339=_['merge']({},_0x183339,_0x24178e[_0x03d7('0x49')]);return _0x4b104a['getAgents'](_0x183339);}})['then'](function(_0x2b22f1){if(_0x2b22f1){_0x449343=_0x2b22f1[_0x03d7('0x40')];if(!_0x24178e['query']['hasOwnProperty'](_0x03d7('0x42'))){_0x183339['limit']=qs[_0x03d7('0x22')](_0x24178e['query']['limit']);_0x183339['offset']=qs[_0x03d7('0x24')](_0x24178e[_0x03d7('0x3a')][_0x03d7('0x24')]);}return _0x4b104a[_0x03d7('0x7c')](_0x183339);}})['then'](function(_0x2f4977){if(_0x2f4977){return _0x2f4977?{'count':_0x449343,'rows':_0x2f4977}:null;}})['then'](respondWithResult(_0x35456f,null))[_0x03d7('0x4d')](handleError(_0x35456f,null));};
\ No newline at end of file
+var _0x85cf=['moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','status','json','offset','limit','undefined','count','set','apply','reject','update','then','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','sequelize','transaction','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','Voice\x20Prefix\x20Extension','priority','appdata','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','length','charAt','system-','destroy','findById','addAgents','ids','spread','body','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','nolimit','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x43e461,_0x5584a9){var _0x31d0bb=function(_0xb3ff76){while(--_0xb3ff76){_0x43e461['push'](_0x43e461['shift']());}};_0x31d0bb(++_0x5584a9);}(_0x85cf,0x76));var _0xf85c=function(_0x166214,_0x15ad43){_0x166214=_0x166214-0x0;var _0xfa0fd4=_0x85cf[_0x166214];return _0xfa0fd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf85c('0x0'));var zipdir=require(_0xf85c('0x1'));var jsonpatch=require(_0xf85c('0x2'));var rp=require(_0xf85c('0x3'));var moment=require(_0xf85c('0x4'));var BPromise=require(_0xf85c('0x5'));var Mustache=require(_0xf85c('0x6'));var util=require(_0xf85c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf85c('0x8'));var ejs=require(_0xf85c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf85c('0xa'));var squel=require(_0xf85c('0xb'));var crypto=require(_0xf85c('0xc'));var jsforce=require(_0xf85c('0xd'));var deskjs=require(_0xf85c('0xe'));var toCsv=require(_0xf85c('0x8'));var querystring=require('querystring');var Papa=require(_0xf85c('0xf'));var Redis=require(_0xf85c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf85c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf85c('0x12'))(_0xf85c('0x13'));var utils=require(_0xf85c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf85c('0x15'));var db=require(_0xf85c('0x16'))['db'];config[_0xf85c('0x17')]=_[_0xf85c('0x18')](config['redis'],{'host':_0xf85c('0x19'),'port':0x18eb});var socket=require(_0xf85c('0x1a'))(new Redis(config[_0xf85c('0x17')]));require(_0xf85c('0x1b'))['register'](socket);function respondWithStatusCode(_0x37b021,_0x4ab6d9){_0x4ab6d9=_0x4ab6d9||0xcc;return function(_0x43dc08){if(_0x43dc08){return _0x37b021['sendStatus'](_0x4ab6d9);}return _0x37b021[_0xf85c('0x1c')](_0x4ab6d9)['end']();};}function respondWithResult(_0x2740dd,_0x4f7351){_0x4f7351=_0x4f7351||0xc8;return function(_0x46ad44){if(_0x46ad44){return _0x2740dd[_0xf85c('0x1c')](_0x4f7351)[_0xf85c('0x1d')](_0x46ad44);}};}function respondWithFilteredResult(_0x256c36,_0x174928){return function(_0x5260c5){if(_0x5260c5){var _0x495854=typeof _0x174928[_0xf85c('0x1e')]==='undefined'&&typeof _0x174928[_0xf85c('0x1f')]===_0xf85c('0x20');var _0x4cd4b7=_0x5260c5[_0xf85c('0x21')];var _0x40d917=_0x495854?0x0:_0x174928[_0xf85c('0x1e')];var _0x146990=_0x495854?_0x5260c5[_0xf85c('0x21')]:_0x174928['offset']+_0x174928[_0xf85c('0x1f')];var _0x4b77c8;if(_0x146990>=_0x4cd4b7){_0x146990=_0x4cd4b7;_0x4b77c8=0xc8;}else{_0x4b77c8=0xce;}_0x256c36[_0xf85c('0x1c')](_0x4b77c8);return _0x256c36[_0xf85c('0x22')]('Content-Range',_0x40d917+'-'+_0x146990+'/'+_0x4cd4b7)['json'](_0x5260c5);}return null;};}function patchUpdates(_0x4473ec){return function(_0x4502ad){try{jsonpatch[_0xf85c('0x23')](_0x4502ad,_0x4473ec,!![]);}catch(_0x3f524b){return BPromise[_0xf85c('0x24')](_0x3f524b);}return _0x4502ad['save']();};}function saveUpdates(_0x903fe6,_0xae5462){return function(_0x550cf3){if(_0x550cf3){return _0x550cf3[_0xf85c('0x25')](_0x903fe6)[_0xf85c('0x26')](function(_0x3a4b82){return _0x3a4b82;});}return null;};}function removeEntity(_0x276683,_0x4aac18){return function(_0x2e771e){if(_0x2e771e){return _0x2e771e['destroy']()['then'](function(){var _0x1ceab9=_0x2e771e[_0xf85c('0x27')]({'plain':!![]});var _0x5cdf5b=_0xf85c('0x28');return db[_0xf85c('0x29')]['destroy']({'where':{'type':_0x5cdf5b,'resourceId':_0x1ceab9['id']}})[_0xf85c('0x26')](function(){return _0x2e771e;});})['then'](function(){_0x276683[_0xf85c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aef45,_0x96efe4){return function(_0x10e6ee){if(!_0x10e6ee){_0x2aef45['sendStatus'](0x194);}return _0x10e6ee;};}function handleError(_0x440878,_0x1e6fa1){_0x1e6fa1=_0x1e6fa1||0x1f4;return function(_0x4cd913){logger[_0xf85c('0x2a')](_0x4cd913[_0xf85c('0x2b')]);if(_0x4cd913[_0xf85c('0x2c')]){delete _0x4cd913[_0xf85c('0x2c')];}_0x440878[_0xf85c('0x1c')](_0x1e6fa1)[_0xf85c('0x2d')](_0x4cd913);};}exports[_0xf85c('0x2e')]=function(_0x4596b6,_0x4dc2c4){var _0x320b5f={},_0x48729b={},_0x47706b={'count':0x0,'rows':[]};var _0x29d31d=_[_0xf85c('0x2f')](db[_0xf85c('0x30')][_0xf85c('0x31')],function(_0x2888cb){return{'name':_0x2888cb[_0xf85c('0x32')],'type':_0x2888cb['type'][_0xf85c('0x33')]};});_0x48729b[_0xf85c('0x34')]=_[_0xf85c('0x2f')](_0x29d31d,_0xf85c('0x2c'));_0x48729b[_0xf85c('0x35')]=_[_0xf85c('0x36')](_0x4596b6[_0xf85c('0x35')]);_0x48729b[_0xf85c('0x37')]=_['intersection'](_0x48729b['model'],_0x48729b[_0xf85c('0x35')]);_0x320b5f['attributes']=_[_0xf85c('0x38')](_0x48729b[_0xf85c('0x34')],qs[_0xf85c('0x39')](_0x4596b6['query'][_0xf85c('0x39')]));_0x320b5f[_0xf85c('0x3a')]=_0x320b5f['attributes']['length']?_0x320b5f['attributes']:_0x48729b['model'];if(!_0x4596b6[_0xf85c('0x35')][_0xf85c('0x3b')]('nolimit')){_0x320b5f[_0xf85c('0x1f')]=qs[_0xf85c('0x1f')](_0x4596b6[_0xf85c('0x35')][_0xf85c('0x1f')]);_0x320b5f[_0xf85c('0x1e')]=qs['offset'](_0x4596b6[_0xf85c('0x35')][_0xf85c('0x1e')]);}_0x320b5f[_0xf85c('0x3c')]=qs[_0xf85c('0x3d')](_0x4596b6[_0xf85c('0x35')][_0xf85c('0x3d')]);_0x320b5f[_0xf85c('0x3e')]=qs['filters'](_[_0xf85c('0x3f')](_0x4596b6[_0xf85c('0x35')],_0x48729b[_0xf85c('0x37')]),_0x29d31d);if(_0x4596b6['query']['filter']){_0x320b5f[_0xf85c('0x3e')]=_[_0xf85c('0x40')](_0x320b5f[_0xf85c('0x3e')],{'$or':_[_0xf85c('0x2f')](_0x29d31d,function(_0x73060d){if(_0x73060d[_0xf85c('0x41')]!==_0xf85c('0x42')){var _0x519c6b={};_0x519c6b[_0x73060d[_0xf85c('0x2c')]]={'$like':'%'+_0x4596b6[_0xf85c('0x35')][_0xf85c('0x43')]+'%'};return _0x519c6b;}})});}_0x320b5f=_[_0xf85c('0x40')]({},_0x320b5f,_0x4596b6[_0xf85c('0x44')]);var _0x1d8c53={'where':_0x320b5f[_0xf85c('0x3e')]};return db[_0xf85c('0x30')][_0xf85c('0x21')](_0x1d8c53)[_0xf85c('0x26')](function(_0x1d8cdd){_0x47706b[_0xf85c('0x21')]=_0x1d8cdd;if(_0x4596b6[_0xf85c('0x35')]['includeAll']){_0x320b5f[_0xf85c('0x45')]=[{'all':!![]}];}return db[_0xf85c('0x30')][_0xf85c('0x46')](_0x320b5f);})[_0xf85c('0x26')](function(_0x160083){_0x47706b[_0xf85c('0x47')]=_0x160083;return _0x47706b;})[_0xf85c('0x26')](respondWithFilteredResult(_0x4dc2c4,_0x320b5f))[_0xf85c('0x48')](handleError(_0x4dc2c4,null));};exports[_0xf85c('0x49')]=function(_0x3c0947,_0x1baaef){var _0x10d25a={'raw':![],'where':{'id':_0x3c0947[_0xf85c('0x4a')]['id']}},_0x5ce342={};_0x5ce342[_0xf85c('0x34')]=_[_0xf85c('0x36')](db[_0xf85c('0x30')][_0xf85c('0x31')]);_0x5ce342['query']=_['keys'](_0x3c0947[_0xf85c('0x35')]);_0x5ce342['filters']=_[_0xf85c('0x38')](_0x5ce342['model'],_0x5ce342[_0xf85c('0x35')]);_0x10d25a['attributes']=_[_0xf85c('0x38')](_0x5ce342[_0xf85c('0x34')],qs['fields'](_0x3c0947['query'][_0xf85c('0x39')]));_0x10d25a[_0xf85c('0x3a')]=_0x10d25a[_0xf85c('0x3a')]['length']?_0x10d25a[_0xf85c('0x3a')]:_0x5ce342[_0xf85c('0x34')];if(_0x3c0947[_0xf85c('0x35')]['includeAll']){_0x10d25a['include']=[{'all':!![]}];}_0x10d25a=_['merge']({},_0x10d25a,_0x3c0947['options']);return db['VoicePrefix'][_0xf85c('0x4b')](_0x10d25a)[_0xf85c('0x26')](handleEntityNotFound(_0x1baaef,null))[_0xf85c('0x26')](respondWithResult(_0x1baaef,null))['catch'](handleError(_0x1baaef,null));};exports['destroy']=function(_0x2885f3,_0x1ca437){return db['VoicePrefix'][_0xf85c('0x4b')]({'where':{'id':_0x2885f3[_0xf85c('0x4a')]['id']}})[_0xf85c('0x26')](handleEntityNotFound(_0x1ca437,null))[_0xf85c('0x26')](removeEntity(_0x1ca437,null))[_0xf85c('0x48')](handleError(_0x1ca437,null));};exports['describe']=function(_0x4e21a8,_0x52f9ed){return db[_0xf85c('0x30')]['describe']()[_0xf85c('0x26')](respondWithResult(_0x52f9ed,null))[_0xf85c('0x48')](handleError(_0x52f9ed,null));};exports[_0xf85c('0x4c')]=function(_0x5cb50d,_0xa48d0a){var _0x27b393;return db[_0xf85c('0x4d')][_0xf85c('0x4e')](function(_0x1e72ec){return db[_0xf85c('0x30')][_0xf85c('0x4c')](_0x5cb50d['body'],{'transaction':_0x1e72ec})[_0xf85c('0x26')](function(_0x246554){_0x27b393=_0x246554[_0xf85c('0x27')]({'plain':!![]});return db['VoiceExtension'][_0xf85c('0x4b')]({'where':{'id':_0x27b393[_0xf85c('0x4f')]},'raw':!![]})[_0xf85c('0x26')](function(_0x27b996){return createVoicePrefixExtensions(_0x27b393,_0x27b996,_0x1e72ec);});});})['then'](function(){var _0x39ea8f=_0x5cb50d['user']['get']({'plain':!![]});if(!_0x39ea8f)throw new Error(_0xf85c('0x50'));if(_0x39ea8f[_0xf85c('0x51')]===_0xf85c('0x52')){var _0x1fc073=_0x27b393;return db['UserProfileSection']['find']({'where':{'name':_0xf85c('0x28'),'userProfileId':_0x39ea8f[_0xf85c('0x53')]},'raw':!![]})['then'](function(_0x54dfa7){if(_0x54dfa7&&_0x54dfa7['autoAssociation']===0x0){return db[_0xf85c('0x29')]['create']({'name':_0x1fc073['name'],'resourceId':_0x1fc073['id'],'type':_0x54dfa7[_0xf85c('0x2c')],'sectionId':_0x54dfa7['id']},{})['then'](function(){return _0x27b393;});}else{return _0x27b393;}})['catch'](function(_0x248db2){logger[_0xf85c('0x2a')](_0xf85c('0x54'),_0x248db2);throw _0x248db2;});}return _0x27b393;})[_0xf85c('0x26')](respondWithResult(_0xa48d0a,null))[_0xf85c('0x48')](handleError(_0xa48d0a,null));};function Extension(_0x163a4d,_0x206011,_0x2cb254,_0x5b08d3){this[_0xf85c('0x55')]='from-sip';this['exten']=_0x163a4d;this[_0xf85c('0x56')]=_0x2cb254;this[_0xf85c('0x41')]=_0xf85c('0x57');this['description']=_0xf85c('0x58');this[_0xf85c('0x59')]=_0x206011;this[_0xf85c('0x5a')]=_0x5b08d3;}function createVoicePrefixExtensions(_0x234d06,_0x49ebff,_0x1b635c){return new BPromise(function(_0x6c2f21,_0x439c0e){var _0x3191a7=new Extension(formatPrefixName(_0x234d06['prefix']),0x1,'NoOp',_0xf85c('0x5b'));_0x3191a7[_0xf85c('0x5c')]=_0x234d06['id'];return db[_0xf85c('0x5d')][_0xf85c('0x4c')](_0x3191a7,{'transaction':_0x1b635c})[_0xf85c('0x26')](function(_0x9ecb15){var _0x5d5a04=_0x9ecb15[_0xf85c('0x27')]({'plain':!![]});var _0x70835d=_[_0xf85c('0x2f')](addVoicePrefixExtensions(_0x234d06,_0x49ebff),function(_0x52cc7b){_0x52cc7b['VoiceExtensionId']=_0x5d5a04['id'];_0x52cc7b['VoicePrefixId']=_0x234d06['id'];return _0x52cc7b;});return db[_0xf85c('0x5d')][_0xf85c('0x5e')](_0x70835d,{'transaction':_0x1b635c})['then'](function(_0x46dbab){if(!_0x46dbab){return _0x439c0e(_0xf85c('0x5f'));}else{return _0x6c2f21(_0x46dbab);}})[_0xf85c('0x48')](function(_0x3e013e){return _0x439c0e(_0x3e013e);});});;});};function addVoicePrefixExtensions(_0x436810,_0x288d67){var _0x5cbd07=[];var _0x2bc24f=formatPrefixName(_0x436810[_0xf85c('0x60')]);_0x5cbd07[_0xf85c('0x61')](new Extension(_0x2bc24f,0x2,'Set',_0xf85c('0x62')+_0x436810[_0xf85c('0x2c')]));if(_0x436810['callerIdAll']){_0x5cbd07[_0xf85c('0x61')](new Extension(_0x2bc24f,0x3,_0xf85c('0x63'),_0xf85c('0x64')+_0x436810[_0xf85c('0x65')]));}else{_0x5cbd07[_0xf85c('0x61')](new Extension(_0x2bc24f,0x3,_0xf85c('0x66'),_0xf85c('0x67')));}_0x5cbd07[_0xf85c('0x61')](new Extension(_0x2bc24f,0x4,_0xf85c('0x68'),_0x288d67[_0xf85c('0x55')]+','+'${EXTEN:'+(0x8+_0x436810[_0xf85c('0x2c')][_0xf85c('0x69')])+'}'+','+0x1));return _0x5cbd07;}function formatPrefixName(_0x12127d){var _0x29fa8c='_';for(var _0x50081b=0x0;_0x50081b<_0x12127d[_0xf85c('0x69')];_0x50081b++){if(_0x12127d[_0xf85c('0x6a')](_0x50081b)=='-'){_0x29fa8c+=_0x12127d[_0xf85c('0x6a')](_0x50081b);}else{_0x29fa8c+='['+_0x12127d[_0xf85c('0x6a')](_0x50081b)+']';}}_0x29fa8c+='.';return _0x29fa8c;}exports['update']=function(_0x352d9b,_0xa65945,_0x5a566d){var _0xd607d1=_0x352d9b['body'];_0xd607d1['prefix']=_0xf85c('0x6b')+_0xd607d1[_0xf85c('0x2c')]+'-';return db[_0xf85c('0x4d')][_0xf85c('0x4e')](function(_0x3e4eb8){return db[_0xf85c('0x30')][_0xf85c('0x25')](_0xd607d1,{'where':{'id':_0xd607d1['id']},'transaction':_0x3e4eb8})[_0xf85c('0x26')](function(){return db[_0xf85c('0x5d')][_0xf85c('0x6c')]({'where':{'VoicePrefixId':_0xd607d1['id']},'transaction':_0x3e4eb8})[_0xf85c('0x26')](function(){return db[_0xf85c('0x5d')][_0xf85c('0x4b')]({'where':{'id':_0xd607d1[_0xf85c('0x4f')]},'raw':!![]})[_0xf85c('0x26')](function(_0x22d81a){return createVoicePrefixExtensions(_0xd607d1,_0x22d81a,_0x3e4eb8);});});});})[_0xf85c('0x26')](function(){return db[_0xf85c('0x30')][_0xf85c('0x6d')](_0xd607d1['id']);})[_0xf85c('0x26')](respondWithResult(_0xa65945,null))[_0xf85c('0x48')](handleError(_0xa65945,null));};exports[_0xf85c('0x6e')]=function(_0x5970d0,_0x171c6a,_0x215b0c){return db['VoicePrefix'][_0xf85c('0x4b')]({'where':{'id':_0x5970d0['params']['id']}})[_0xf85c('0x26')](handleEntityNotFound(_0x171c6a,null))[_0xf85c('0x26')](function(_0x592ab4){if(_0x592ab4){return _0x592ab4[_0xf85c('0x6e')](_0x5970d0['body'][_0xf85c('0x6f')],_['omit'](_0x5970d0['body'],['ids','id'])||{})[_0xf85c('0x70')](function(_0x167fb6){for(var _0x5094c0=0x0;_0x5094c0<_0x5970d0[_0xf85c('0x71')][_0xf85c('0x6f')][_0xf85c('0x69')];_0x5094c0+=0x1){socket[_0xf85c('0x72')]('userVoicePrefix:save',{'UserId':Number(_0x5970d0['body']['ids'][_0x5094c0]),'VoicePrefixId':Number(_0x5970d0[_0xf85c('0x4a')]['id'])});}return _0x167fb6;});}})['then'](respondWithResult(_0x171c6a,null))['catch'](handleError(_0x171c6a,null));};exports[_0xf85c('0x73')]=function(_0x4f37c4,_0x1be4c6,_0x306563){return db[_0xf85c('0x30')][_0xf85c('0x4b')]({'where':{'id':_0x4f37c4[_0xf85c('0x4a')]['id']}})[_0xf85c('0x26')](handleEntityNotFound(_0x1be4c6,null))[_0xf85c('0x26')](function(_0x39cbdc){if(_0x39cbdc){return _0x39cbdc['removeAgents'](_0x4f37c4[_0xf85c('0x35')][_0xf85c('0x6f')])['then'](function(){if(_[_0xf85c('0x74')](_0x4f37c4['query']['ids'])){for(var _0x413d56=0x0;_0x413d56<_0x4f37c4[_0xf85c('0x35')][_0xf85c('0x6f')]['length'];_0x413d56+=0x1){socket[_0xf85c('0x72')](_0xf85c('0x75'),{'UserId':Number(_0x4f37c4[_0xf85c('0x35')][_0xf85c('0x6f')][_0x413d56]),'VoicePrefixId':Number(_0x4f37c4[_0xf85c('0x4a')]['id'])});}}else{socket[_0xf85c('0x72')](_0xf85c('0x75'),{'UserId':Number(_0x4f37c4['query'][_0xf85c('0x6f')]),'VoicePrefixId':Number(_0x4f37c4[_0xf85c('0x4a')]['id'])});}});}})[_0xf85c('0x26')](respondWithStatusCode(_0x1be4c6,null))['catch'](handleError(_0x1be4c6,null));};exports[_0xf85c('0x76')]=function(_0x4d832c,_0xa4335,_0xdfa3c3){var _0x3cbeb={};var _0x12ffa3={};var _0x58fe54;var _0x1edf1b;return db['VoicePrefix'][_0xf85c('0x77')]({'where':{'id':_0x4d832c[_0xf85c('0x4a')]['id']}})[_0xf85c('0x26')](handleEntityNotFound(_0xa4335,null))[_0xf85c('0x26')](function(_0x259c58){if(_0x259c58){_0x58fe54=_0x259c58;_0x12ffa3[_0xf85c('0x34')]=_[_0xf85c('0x36')](db[_0xf85c('0x78')][_0xf85c('0x31')]);_0x12ffa3[_0xf85c('0x35')]=_['keys'](_0x4d832c[_0xf85c('0x35')]);_0x12ffa3[_0xf85c('0x37')]=_[_0xf85c('0x38')](_0x12ffa3['model'],_0x12ffa3[_0xf85c('0x35')]);_0x3cbeb[_0xf85c('0x3a')]=_[_0xf85c('0x38')](_0x12ffa3[_0xf85c('0x34')],qs[_0xf85c('0x39')](_0x4d832c[_0xf85c('0x35')][_0xf85c('0x39')]));_0x3cbeb[_0xf85c('0x3a')]=_0x3cbeb[_0xf85c('0x3a')][_0xf85c('0x69')]?_0x3cbeb[_0xf85c('0x3a')]:_0x12ffa3[_0xf85c('0x34')];_0x3cbeb[_0xf85c('0x3c')]=qs[_0xf85c('0x3d')](_0x4d832c[_0xf85c('0x35')][_0xf85c('0x3d')]);_0x3cbeb[_0xf85c('0x3e')]=qs[_0xf85c('0x37')](_[_0xf85c('0x3f')](_0x4d832c[_0xf85c('0x35')],_0x12ffa3['filters']));if(_0x4d832c['query'][_0xf85c('0x43')]){_0x3cbeb[_0xf85c('0x3e')]=_[_0xf85c('0x40')](_0x3cbeb[_0xf85c('0x3e')],{'$or':_[_0xf85c('0x2f')](_0x3cbeb[_0xf85c('0x3a')],function(_0x1f506d){var _0x5c39a2={};_0x5c39a2[_0x1f506d]={'$like':'%'+_0x4d832c[_0xf85c('0x35')][_0xf85c('0x43')]+'%'};return _0x5c39a2;})});}_0x3cbeb=_[_0xf85c('0x40')]({},_0x3cbeb,_0x4d832c['options']);return _0x58fe54[_0xf85c('0x76')](_0x3cbeb);}})[_0xf85c('0x26')](function(_0x53ac0a){if(_0x53ac0a){_0x1edf1b=_0x53ac0a['length'];if(!_0x4d832c[_0xf85c('0x35')][_0xf85c('0x3b')](_0xf85c('0x79'))){_0x3cbeb[_0xf85c('0x1f')]=qs[_0xf85c('0x1f')](_0x4d832c['query'][_0xf85c('0x1f')]);_0x3cbeb[_0xf85c('0x1e')]=qs[_0xf85c('0x1e')](_0x4d832c[_0xf85c('0x35')][_0xf85c('0x1e')]);}return _0x58fe54[_0xf85c('0x76')](_0x3cbeb);}})[_0xf85c('0x26')](function(_0x5d2211){if(_0x5d2211){return _0x5d2211?{'count':_0x1edf1b,'rows':_0x5d2211}:null;}})['then'](respondWithResult(_0xa4335,null))['catch'](handleError(_0xa4335,null));};
\ No newline at end of file
index 47e1dee..7731bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97d5=['emit','hook','exports','events','setMaxListeners','save','remove'];(function(_0x236b83,_0x5e1af2){var _0x55c2b9=function(_0x3a3465){while(--_0x3a3465){_0x236b83['push'](_0x236b83['shift']());}};_0x55c2b9(++_0x5e1af2);}(_0x97d5,0xc0));var _0x597d=function(_0x1a00ac,_0x5f1f26){_0x1a00ac=_0x1a00ac-0x0;var _0x32668e=_0x97d5[_0x1a00ac];return _0x32668e;};'use strict';var EventEmitter=require(_0x597d('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x597d('0x1')](0x0);var events={'afterCreate':_0x597d('0x2'),'afterUpdate':'update','afterDestroy':_0x597d('0x3')};function emitEvent(_0x3392e8){return function(_0x4a1312,_0x18dbd6,_0x4467a8){VoicePrefixEvents[_0x597d('0x4')](_0x3392e8+':'+_0x4a1312['id'],_0x4a1312);VoicePrefixEvents[_0x597d('0x4')](_0x3392e8,_0x4a1312);_0x4467a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x597d('0x5')](e,emitEvent(event));}}module[_0x597d('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x6a78=['hook','events','../../mysqldb','save','remove'];(function(_0x11893b,_0x180508){var _0x5c1568=function(_0x273bda){while(--_0x273bda){_0x11893b['push'](_0x11893b['shift']());}};_0x5c1568(++_0x180508);}(_0x6a78,0x196));var _0x86a7=function(_0x198c07,_0x290791){_0x198c07=_0x198c07-0x0;var _0x22f257=_0x6a78[_0x198c07];return _0x22f257;};'use strict';var EventEmitter=require(_0x86a7('0x0'));var VoicePrefix=require(_0x86a7('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x86a7('0x2'),'afterUpdate':'update','afterDestroy':_0x86a7('0x3')};function emitEvent(_0x814f5f){return function(_0x219f2b,_0x12e9e9,_0x404282){VoicePrefixEvents['emit'](_0x814f5f+':'+_0x219f2b['id'],_0x219f2b);VoicePrefixEvents['emit'](_0x814f5f,_0x219f2b);_0x404282(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x86a7('0x4')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index ab28a8f..4b7e069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3fa=['moment','bluebird','path','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x4d3f91,_0x44fb55){var _0x570da8=function(_0x108426){while(--_0x108426){_0x4d3f91['push'](_0x4d3f91['shift']());}};_0x570da8(++_0x44fb55);}(_0xf3fa,0x19f));var _0xaf3f=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xf3fa[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require('lodash');var util=require(_0xaf3f('0x0'));var logger=require(_0xaf3f('0x1'))(_0xaf3f('0x2'));var moment=require(_0xaf3f('0x3'));var BPromise=require(_0xaf3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf3f('0x5'));var rimraf=require('rimraf');var config=require(_0xaf3f('0x6'));var attributes=require(_0xaf3f('0x7'));module[_0xaf3f('0x8')]=function(_0x17c107,_0x49ea80){return _0x17c107['define'](_0xaf3f('0x9'),attributes,{'tableName':_0xaf3f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3624=['request-promise','path','rimraf','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment'];(function(_0x2bd978,_0x249e72){var _0x2a108a=function(_0x198c9b){while(--_0x198c9b){_0x2bd978['push'](_0x2bd978['shift']());}};_0x2a108a(++_0x249e72);}(_0x3624,0x13b));var _0x4362=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x3624[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require(_0x4362('0x0'));var logger=require(_0x4362('0x1'))(_0x4362('0x2'));var moment=require(_0x4362('0x3'));var BPromise=require('bluebird');var rp=require(_0x4362('0x4'));var fs=require('fs');var path=require(_0x4362('0x5'));var rimraf=require(_0x4362('0x6'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x4362('0x7')]=function(_0x335044,_0x5ea217){return _0x335044[_0x4362('0x8')](_0x4362('0x9'),attributes,{'tableName':_0x4362('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36fbdd7..98ab7a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde1a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d2f7f,_0x449505){var _0x2b6831=function(_0x5f374f){while(--_0x5f374f){_0x1d2f7f['push'](_0x1d2f7f['shift']());}};_0x2b6831(++_0x449505);}(_0xde1a,0xfd));var _0xade1=function(_0x9e6ec4,_0x371197){_0x9e6ec4=_0x9e6ec4-0x0;var _0x24bea2=_0xde1a[_0x9e6ec4];return _0x24bea2;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var moment=require(_0xade1('0x1'));var BPromise=require(_0xade1('0x2'));var rs=require(_0xade1('0x3'));var fs=require('fs');var Redis=require(_0xade1('0x4'));var db=require(_0xade1('0x5'))['db'];var utils=require(_0xade1('0x6'));var logger=require(_0xade1('0x7'))('rpc');var config=require(_0xade1('0x8'));var jayson=require(_0xade1('0x9'));var client=jayson[_0xade1('0xa')][_0xade1('0xb')]({'port':0x232a});config[_0xade1('0xc')]=_[_0xade1('0xd')](config['redis'],{'host':_0xade1('0xe'),'port':0x18eb});var socket=require(_0xade1('0xf'))(new Redis(config[_0xade1('0xc')]));require(_0xade1('0x10'))[_0xade1('0x11')](socket);function respondWithRpcPromise(_0x2b3854,_0x3ebc61,_0x12eb7f){return new BPromise(function(_0x5add3c,_0x5c44fa){return client[_0xade1('0x12')](_0x2b3854,_0x12eb7f)['then'](function(_0x1d71a8){logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,'request\x20sent');logger[_0xade1('0x15')](_0xade1('0x16'),_0x3ebc61,_0xade1('0x17'),JSON[_0xade1('0x18')](_0x1d71a8));if(_0x1d71a8[_0xade1('0x19')]){if(_0x1d71a8[_0xade1('0x19')]['code']===0x1f4){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5c44fa(_0x1d71a8[_0xade1('0x19')]['message']);}logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5add3c(_0x1d71a8[_0xade1('0x19')]['message']);}else{logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,_0xade1('0x17'));_0x5add3c(_0x1d71a8[_0xade1('0x1b')][_0xade1('0x1a')]);}})[_0xade1('0x1c')](function(_0x39a360){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x39a360);_0x5c44fa(_0x39a360);});});}
\ No newline at end of file
+var _0xbff5=['register','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x541608,_0x14171c){var _0x2fbda1=function(_0x6df827){while(--_0x6df827){_0x541608['push'](_0x541608['shift']());}};_0x2fbda1(++_0x14171c);}(_0xbff5,0x1bc));var _0x5bff=function(_0x40f0e6,_0x479a89){_0x40f0e6=_0x40f0e6-0x0;var _0x41fcb7=_0xbff5[_0x40f0e6];return _0x41fcb7;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});config[_0x5bff('0xb')]=_[_0x5bff('0xc')](config[_0x5bff('0xb')],{'host':_0x5bff('0xd'),'port':0x18eb});var socket=require(_0x5bff('0xe'))(new Redis(config[_0x5bff('0xb')]));require('./voicePrefix.socket')[_0x5bff('0xf')](socket);function respondWithRpcPromise(_0x5e7d10,_0x1d8197,_0x40b806){return new BPromise(function(_0x4fc146,_0x3e72e9){return client['request'](_0x5e7d10,_0x40b806)[_0x5bff('0x10')](function(_0x4ff164){logger[_0x5bff('0x11')](_0x5bff('0x12'),_0x1d8197,'request\x20sent');logger[_0x5bff('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'),JSON[_0x5bff('0x15')](_0x4ff164));if(_0x4ff164['error']){if(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x17')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);return _0x3e72e9(_0x4ff164[_0x5bff('0x16')]['message']);}logger[_0x5bff('0x16')](_0x5bff('0x12'),_0x1d8197,_0x4ff164[_0x5bff('0x16')]['message']);return _0x4fc146(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);}else{logger[_0x5bff('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'));_0x4fc146(_0x4ff164[_0x5bff('0x19')][_0x5bff('0x18')]);}})[_0x5bff('0x1a')](function(_0x5216dc){logger[_0x5bff('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x1d8197,_0x5216dc);_0x3e72e9(_0x5216dc);});});}
\ No newline at end of file
index d7f50bd..272e4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ec8=['removeListener','register','./voicePrefix.events','save','remove','update'];(function(_0x11824c,_0x2a27b7){var _0x3b9344=function(_0x12b042){while(--_0x12b042){_0x11824c['push'](_0x11824c['shift']());}};_0x3b9344(++_0x2a27b7);}(_0x2ec8,0x188));var _0x82ec=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x2ec8[_0x618414];return _0x21c19a;};'use strict';var VoicePrefixEvents=require(_0x82ec('0x0'));var events=[_0x82ec('0x1'),_0x82ec('0x2'),_0x82ec('0x3')];function createListener(_0x5d41ea,_0x21a9db){return function(_0x491d7d){_0x21a9db['emit'](_0x5d41ea,_0x491d7d);};}function removeListener(_0x1b21cd,_0x51192a){return function(){VoicePrefixEvents[_0x82ec('0x4')](_0x1b21cd,_0x51192a);};}exports[_0x82ec('0x5')]=function(_0x528e26){for(var _0x4c9400=0x0,_0x5c786a=events['length'];_0x4c9400<_0x5c786a;_0x4c9400++){var _0x3af0cf=events[_0x4c9400];var _0x3ceabc=createListener('voicePrefix:'+_0x3af0cf,_0x528e26);VoicePrefixEvents['on'](_0x3af0cf,_0x3ceabc);}};
\ No newline at end of file
+var _0xffda=['emit','register','length','./voicePrefix.events','save','remove','update'];(function(_0x4757d9,_0x1def80){var _0x575560=function(_0x356a41){while(--_0x356a41){_0x4757d9['push'](_0x4757d9['shift']());}};_0x575560(++_0x1def80);}(_0xffda,0x73));var _0xaffd=function(_0x2d4f00,_0x3eee9e){_0x2d4f00=_0x2d4f00-0x0;var _0xb419ad=_0xffda[_0x2d4f00];return _0xb419ad;};'use strict';var VoicePrefixEvents=require(_0xaffd('0x0'));var events=[_0xaffd('0x1'),_0xaffd('0x2'),_0xaffd('0x3')];function createListener(_0x594ab8,_0x18e6bf){return function(_0x197651){_0x18e6bf[_0xaffd('0x4')](_0x594ab8,_0x197651);};}function removeListener(_0x4b6295,_0x242061){return function(){VoicePrefixEvents['removeListener'](_0x4b6295,_0x242061);};}exports[_0xaffd('0x5')]=function(_0x400bb8){for(var _0x5747e0=0x0,_0x4ca99e=events[_0xaffd('0x6')];_0x5747e0<_0x4ca99e;_0x5747e0++){var _0x12865c=events[_0x5747e0];var _0x3647e1=createListener('voicePrefix:'+_0x12865c,_0x400bb8);VoicePrefixEvents['on'](_0x12865c,_0x3647e1);}};
\ No newline at end of file
index fea35dc..9fc0efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e7=['/:id/users','getAgents','getMembers','/:id/lists','getLists','post','/:id/clone','clone','addTeams','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeAgents','removeLists','removeBlackLists','exports','multer','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams'];(function(_0x58d90a,_0x1a2ea6){var _0x3938a9=function(_0x4f324c){while(--_0x4f324c){_0x58d90a['push'](_0x58d90a['shift']());}};_0x3938a9(++_0x1a2ea6);}(_0x13e7,0x133));var _0x713e=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x13e7[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x713e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x713e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x713e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x713e('0x3'));var controller=require(_0x713e('0x4'));router[_0x713e('0x5')]('/',auth[_0x713e('0x6')](),controller[_0x713e('0x7')]);router['get'](_0x713e('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x713e('0x5')](_0x713e('0x9'),auth[_0x713e('0x6')](),controller[_0x713e('0xa')]);router[_0x713e('0x5')](_0x713e('0xb'),auth[_0x713e('0x6')](),controller[_0x713e('0xc')]);router[_0x713e('0x5')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x713e('0x5')](_0x713e('0xd'),auth['isAuthenticated'](),controller[_0x713e('0xe')]);router['get'](_0x713e('0xf'),auth[_0x713e('0x6')](),controller[_0x713e('0x10')]);router[_0x713e('0x5')](_0x713e('0x11'),auth[_0x713e('0x6')](),controller[_0x713e('0x12')]);router[_0x713e('0x5')]('/:id/members',auth['isAuthenticated'](),controller[_0x713e('0x13')]);router[_0x713e('0x5')](_0x713e('0x14'),auth[_0x713e('0x6')](),controller[_0x713e('0x15')]);router[_0x713e('0x5')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x713e('0x6')](),controller['create']);router[_0x713e('0x16')](_0x713e('0x17'),auth['isAuthenticated'](),controller[_0x713e('0x18')]);router[_0x713e('0x16')](_0x713e('0xf'),auth[_0x713e('0x6')](),controller[_0x713e('0x19')]);router[_0x713e('0x16')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x713e('0x14'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x713e('0x1a'),auth[_0x713e('0x6')](),controller[_0x713e('0x1b')]);router[_0x713e('0x1c')]('/:id',auth[_0x713e('0x6')](),controller[_0x713e('0x1d')]);router[_0x713e('0x1e')](_0x713e('0x8'),auth[_0x713e('0x6')](),controller[_0x713e('0x1f')]);router[_0x713e('0x1e')]('/:id/teams',auth[_0x713e('0x6')](),controller['removeTeams']);router[_0x713e('0x1e')](_0x713e('0x11'),auth[_0x713e('0x6')](),controller[_0x713e('0x20')]);router[_0x713e('0x1e')](_0x713e('0x14'),auth[_0x713e('0x6')](),controller[_0x713e('0x21')]);router[_0x713e('0x1e')](_0x713e('0x1a'),auth[_0x713e('0x6')](),controller[_0x713e('0x22')]);module[_0x713e('0x23')]=router;
\ No newline at end of file
+var _0xe574=['/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','post','create','/:id/clone','addTeams','addBlackLists','put','update','destroy','removeTeams','delete','removeLists','removeBlackLists','exports','path','express','fs-extra','../../components/auth/service','./voiceQueue.controller','isAuthenticated','index'];(function(_0xb80525,_0x22d075){var _0x3da5a8=function(_0x39b184){while(--_0x39b184){_0xb80525['push'](_0xb80525['shift']());}};_0x3da5a8(++_0x22d075);}(_0xe574,0x68));var _0x4e57=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe574[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4e57('0x0'));var timeout=require('connect-timeout');var express=require(_0x4e57('0x1'));var router=express['Router']();var fs_extra=require(_0x4e57('0x2'));var auth=require(_0x4e57('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e57('0x4'));router['get']('/',auth[_0x4e57('0x5')](),controller[_0x4e57('0x6')]);router['get'](_0x4e57('0x7'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x8')]);router[_0x4e57('0x9')]('/:id/hoppers',auth[_0x4e57('0x5')](),controller[_0x4e57('0xa')]);router[_0x4e57('0x9')](_0x4e57('0xb'),auth[_0x4e57('0x5')](),controller[_0x4e57('0xc')]);router[_0x4e57('0x9')]('/:id/hopper_finals',auth[_0x4e57('0x5')](),controller[_0x4e57('0xd')]);router['get'](_0x4e57('0xe'),auth[_0x4e57('0x5')](),controller[_0x4e57('0xf')]);router[_0x4e57('0x9')](_0x4e57('0x10'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x11')]);router[_0x4e57('0x9')](_0x4e57('0x12'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x13')]);router[_0x4e57('0x9')](_0x4e57('0x14'),auth['isAuthenticated'](),controller[_0x4e57('0x15')]);router['get'](_0x4e57('0x16'),auth[_0x4e57('0x5')](),controller['getLists']);router[_0x4e57('0x9')](_0x4e57('0x17'),auth[_0x4e57('0x5')](),controller['getBlackLists']);router[_0x4e57('0x18')]('/',auth['isAuthenticated'](),controller[_0x4e57('0x19')]);router['post'](_0x4e57('0x1a'),auth[_0x4e57('0x5')](),controller['clone']);router[_0x4e57('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4e57('0x1b')]);router['post'](_0x4e57('0x12'),auth[_0x4e57('0x5')](),controller['addAgents']);router['post'](_0x4e57('0x16'),auth[_0x4e57('0x5')](),controller['addLists']);router[_0x4e57('0x18')](_0x4e57('0x17'),auth['isAuthenticated'](),controller[_0x4e57('0x1c')]);router[_0x4e57('0x1d')](_0x4e57('0x7'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x1e')]);router['delete'](_0x4e57('0x7'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x1f')]);router['delete'](_0x4e57('0x10'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x20')]);router[_0x4e57('0x21')](_0x4e57('0x12'),auth[_0x4e57('0x5')](),controller['removeAgents']);router[_0x4e57('0x21')](_0x4e57('0x16'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x22')]);router[_0x4e57('0x21')](_0x4e57('0x17'),auth[_0x4e57('0x5')](),controller[_0x4e57('0x23')]);module[_0x4e57('0x24')]=router;
\ No newline at end of file
index daa2a0d..c22101b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f1d=['Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','fewestcalls','rrmemory','linear','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','TEXT','setDataValue','periodic_announce','split','joinempty','join','leavewhenempty','wrapuptime','BOOLEAN'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x4f1d,0x81));var _0xd4f1=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0x4f1d[_0x4cb272];return _0x57b4aa;};'use strict';var Sequelize=require(_0xd4f1('0x0'));module[_0xd4f1('0x1')]={'name':{'type':Sequelize[_0xd4f1('0x2')],'allowNull':![],'unique':_0xd4f1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd4f1('0x4')]('inbound',_0xd4f1('0x5')),'allowNull':![],'defaultValue':_0xd4f1('0x6')},'musiconhold':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':_0xd4f1('0x7')},'announce':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd4f1('0x4')]('rr',_0xd4f1('0x8'),'leastrecent',_0xd4f1('0x9'),'random',_0xd4f1('0xa'),_0xd4f1('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0xd4f1('0x8'),'set':function(_0x11268a){this['setDataValue'](_0xd4f1('0xc'),_0x11268a?_0x11268a:_0xd4f1('0xa'));},'get':function(){var _0x113057=this[_0xd4f1('0xd')]('type');var _0x31b8c0=this[_0xd4f1('0xd')](_0xd4f1('0xe'));var _0x4e09bb=this['getDataValue'](_0xd4f1('0xc'));if(_0x113057===_0xd4f1('0x6')){return _0x4e09bb;}if(_0x31b8c0===_0xd4f1('0xf')&&_0x4e09bb==='rrmemory'||_0x31b8c0===_0xd4f1('0xf')&&_0x4e09bb===_0xd4f1('0x10')){return _0x4e09bb;}if(_0x31b8c0===_0xd4f1('0x11')||_0x31b8c0===_0xd4f1('0x12')||_0x31b8c0===_0xd4f1('0x13')){return _0x4e09bb;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd4f1('0x14')](0xb)},'timeout':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xd4f1('0x2')]},'weight':{'type':Sequelize[_0xd4f1('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xd4f1('0x15'),'no'),'defaultValue':_0xd4f1('0x15')},'autopause':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd4f1('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xd4f1('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd4f1('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd4f1('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd4f1('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no'),'defaultValue':_0xd4f1('0x15')},'announce_holdtime':{'type':Sequelize[_0xd4f1('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xd4f1('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd4f1('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd4f1('0x2')]},'queue_youarenext':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd4f1('0x2')]},'queue_quantity1':{'type':Sequelize[_0xd4f1('0x2')]},'queue_quantity2':{'type':Sequelize[_0xd4f1('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xd4f1('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xd4f1('0x16')],'set':function(_0xb973ce){this[_0xd4f1('0x17')](_0xd4f1('0x18'),_0xb973ce?_0xb973ce['join'](','):[]);},'get':function(){return this[_0xd4f1('0xd')](_0xd4f1('0x18'))?this[_0xd4f1('0xd')](_0xd4f1('0x18'))[_0xd4f1('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':_0xd4f1('0x15'),'set':function(_0x31fcf8){this[_0xd4f1('0x17')](_0xd4f1('0x1a'),_0x31fcf8?_0x31fcf8[_0xd4f1('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xd4f1('0x1a'))?this[_0xd4f1('0xd')]('joinempty')[_0xd4f1('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':'no','set':function(_0x59aa41){this[_0xd4f1('0x17')](_0xd4f1('0x1c'),_0x59aa41?_0x59aa41['join'](','):undefined);},'get':function(){return this[_0xd4f1('0xd')](_0xd4f1('0x1c'))?this[_0xd4f1('0xd')](_0xd4f1('0x1c'))[_0xd4f1('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd4f1('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd4f1('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x16e0a1){this[_0xd4f1('0x17')]('acw',_0x16e0a1);if(_0x16e0a1){if(this[_0xd4f1('0xd')]('wrapuptime')<0x2){this[_0xd4f1('0x17')](_0xd4f1('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd4f1('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd4f1('0x1e')],'defaultValue':0x0,'comment':_0xd4f1('0x1f')},'dialMethod':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x20'),_0xd4f1('0x11'),_0xd4f1('0x13'),_0xd4f1('0x12'),_0xd4f1('0xf')),'defaultValue':_0xd4f1('0x11'),'comment':_0xd4f1('0x21')},'dialLimitChannel':{'type':Sequelize[_0xd4f1('0x14')](0x4)[_0xd4f1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd4f1('0x23')},'dialLimitQueue':{'type':Sequelize[_0xd4f1('0x14')](0x4)[_0xd4f1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd4f1('0x24')},'dialPowerLevel':{'type':Sequelize[_0xd4f1('0x25')](0x2)[_0xd4f1('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd4f1('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x27'),_0xd4f1('0x28')),'defaultValue':'dropRate','comment':_0xd4f1('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd4f1('0x25')](0x2)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd4f1('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd4f1('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd4f1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd4f1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':'tTxX','comment':_0xd4f1('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x2e')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xd4f1('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'comment':_0xd4f1('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':_0xd4f1('0x35')},'dialPrefix':{'type':Sequelize[_0xd4f1('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x36'),'never',_0xd4f1('0x37')),'defaultValue':_0xd4f1('0x36')},'dialAMDActive':{'type':Sequelize[_0xd4f1('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd4f1('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd4f1('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd4f1('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd4f1('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd4f1('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd4f1('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd4f1('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd4f1('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd4f1('0x14')](0x9)[_0xd4f1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd4f1('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd4f1('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xd4f1('0x1e')],'defaultValue':0x0,'comment':_0xd4f1('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd4f1('0x4')](_0xd4f1('0x41'),'ASC'),'defaultValue':_0xd4f1('0x41')},'dialQueueProject2':{'type':Sequelize[_0xd4f1('0x2')],'comment':_0xd4f1('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xd4f1('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd4f1('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd4f1('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd4f1('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd4f1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd4f1('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd4f1('0x14')](0x5)[_0xd4f1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd4f1('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd4f1('0x14')],'allowNull':!![],'comment':_0xd4f1('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xd4f1('0x1e')],'defaultValue':![],'comment':_0xd4f1('0x4d'),'set':function(_0x2e6b2e){if(!_0x2e6b2e)this[_0xd4f1('0x17')](_0xd4f1('0x4e'),null);this[_0xd4f1('0x17')](_0xd4f1('0x4f'),_0x2e6b2e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd4f1('0x14')](0x3)[_0xd4f1('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xd4f1('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xd4f1('0x22')],'defaultValue':0x4}};
\ No newline at end of file
+var _0x7ae4=['joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','inbound','ENUM','ringall','leastrecent','fewestcalls','random','linear','rrordered','strategy','type','getDataValue','dialMethod','booked','progressive','predictive','STRING','INTEGER','yes','all','TEXT','setDataValue','periodic_announce','join','split'];(function(_0xaa9204,_0x163a47){var _0x1e39f8=function(_0x4737eb){while(--_0x4737eb){_0xaa9204['push'](_0xaa9204['shift']());}};_0x1e39f8(++_0x163a47);}(_0x7ae4,0x11d));var _0x47ae=function(_0x19ea8b,_0x10a8b9){_0x19ea8b=_0x19ea8b-0x0;var _0x568c29=_0x7ae4[_0x19ea8b];return _0x568c29;};'use strict';var Sequelize=require(_0x47ae('0x0'));module[_0x47ae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x47ae('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x47ae('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x47ae('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x47ae('0x4')]('rr',_0x47ae('0x5'),_0x47ae('0x6'),_0x47ae('0x7'),_0x47ae('0x8'),'rrmemory',_0x47ae('0x9'),'wrandom',_0x47ae('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3f98b8){this['setDataValue'](_0x47ae('0xb'),_0x3f98b8?_0x3f98b8:'rrmemory');},'get':function(){var _0x52e582=this['getDataValue'](_0x47ae('0xc'));var _0x28632d=this[_0x47ae('0xd')](_0x47ae('0xe'));var _0x5ef3e4=this['getDataValue']('strategy');if(_0x52e582===_0x47ae('0x3')){return _0x5ef3e4;}if(_0x28632d===_0x47ae('0xf')&&_0x5ef3e4==='rrmemory'||_0x28632d===_0x47ae('0xf')&&_0x5ef3e4==='roundrobin'){return _0x5ef3e4;}if(_0x28632d===_0x47ae('0x10')||_0x28632d===_0x47ae('0x11')||_0x28632d==='power'){return _0x5ef3e4;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x47ae('0x13')](0xb)},'timeout':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x47ae('0x12')]},'weight':{'type':Sequelize[_0x47ae('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x47ae('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no',_0x47ae('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x47ae('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x47ae('0x12')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x47ae('0x12')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x47ae('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x47ae('0x14'),'no'),'defaultValue':_0x47ae('0x14')},'announce_holdtime':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x47ae('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x47ae('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x47ae('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x47ae('0x12')]},'queue_youarenext':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x47ae('0x12')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x47ae('0x12')]},'queue_quantity1':{'type':Sequelize[_0x47ae('0x12')]},'queue_quantity2':{'type':Sequelize[_0x47ae('0x12')]},'queue_periodic_announce':{'type':Sequelize[_0x47ae('0x12')]},'queue_less_than':{'type':Sequelize[_0x47ae('0x12')]},'periodic_announce':{'type':Sequelize[_0x47ae('0x16')],'set':function(_0x1b574b){this[_0x47ae('0x17')](_0x47ae('0x18'),_0x1b574b?_0x1b574b[_0x47ae('0x19')](','):[]);},'get':function(){return this[_0x47ae('0xd')](_0x47ae('0x18'))?this[_0x47ae('0xd')](_0x47ae('0x18'))[_0x47ae('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x47ae('0x14'),'set':function(_0x2d8c26){this[_0x47ae('0x17')](_0x47ae('0x1b'),_0x2d8c26?_0x2d8c26[_0x47ae('0x19')](','):undefined);},'get':function(){return this[_0x47ae('0xd')](_0x47ae('0x1b'))?this[_0x47ae('0xd')](_0x47ae('0x1b'))[_0x47ae('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':'no','set':function(_0x34ceaf){this[_0x47ae('0x17')](_0x47ae('0x1c'),_0x34ceaf?_0x34ceaf[_0x47ae('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x47ae('0x1c'))?this[_0x47ae('0xd')](_0x47ae('0x1c'))[_0x47ae('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x47ae('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x47ae('0x12')]},'description':{'type':Sequelize[_0x47ae('0x12')]},'acw':{'type':Sequelize[_0x47ae('0x1d')],'defaultValue':0x0,'set':function(_0x369b69){this[_0x47ae('0x17')](_0x47ae('0x1e'),_0x369b69);if(_0x369b69){if(this[_0x47ae('0xd')](_0x47ae('0x1f'))<0x2){this[_0x47ae('0x17')](_0x47ae('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x47ae('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x47ae('0x1d')],'defaultValue':0x0,'comment':_0x47ae('0x20')},'dialMethod':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x21'),_0x47ae('0x10'),_0x47ae('0x22'),_0x47ae('0x11'),_0x47ae('0xf')),'defaultValue':_0x47ae('0x10'),'comment':_0x47ae('0x23')},'dialLimitChannel':{'type':Sequelize[_0x47ae('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x47ae('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x47ae('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x47ae('0x26')},'dialPowerLevel':{'type':Sequelize[_0x47ae('0x27')](0x2)[_0x47ae('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x47ae('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x29'),_0x47ae('0x2a')),'defaultValue':_0x47ae('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x47ae('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x47ae('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x47ae('0x12')]},'dialOriginateTimeout':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x2d')},'dialQueueProject':{'type':Sequelize[_0x47ae('0x12')],'comment':_0x47ae('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'comment':_0x47ae('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x47ae('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x47ae('0x12')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x36'),'never',_0x47ae('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47ae('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x47ae('0x13')](0x9)[_0x47ae('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x47ae('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x47ae('0x13')](0x9)[_0x47ae('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x47ae('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x47ae('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x47ae('0x13')](0x9)[_0x47ae('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47ae('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x47ae('0x13')](0x9)[_0x47ae('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x47ae('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x47ae('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x47ae('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x47ae('0x13')](0x9)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x47ae('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x47ae('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x47ae('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47ae('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x47ae('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x47ae('0x4')](_0x47ae('0x41'),_0x47ae('0x42')),'defaultValue':_0x47ae('0x41')},'dialQueueProject2':{'type':Sequelize[_0x47ae('0x12')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x47ae('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x47ae('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47ae('0x43')},'dialCutDigit':{'type':Sequelize[_0x47ae('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x47ae('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47ae('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x47ae('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x47ae('0x13')](0x5)[_0x47ae('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47ae('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x47ae('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x47ae('0x4c'),'set':function(_0x10b474){if(!_0x10b474)this['setDataValue'](_0x47ae('0x4d'),null);this[_0x47ae('0x17')]('mandatoryDisposition',_0x10b474);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x47ae('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x47ae('0x13')](0x3)[_0x47ae('0x25')],'defaultValue':0x4}};
\ No newline at end of file
index 44b001d..4071e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['index','map','VoiceQueue','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','options','include','findAll','params','keys','includeAll','find','catch','body','user','outbound','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','getHoppers','hasOwnProperty','pick','VoiceQueueId','CmHopper','rows','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','removeAgents','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','inbound','filter','value','includes','type','name','sendStatus','error','stack','send'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4975,0x86));var _0x5497=function(_0x373b10,_0x97b0f9){_0x373b10=_0x373b10-0x0;var _0x401e83=_0x4975[_0x373b10];return _0x401e83;};'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'];config[_0x5497('0x18')]=_[_0x5497('0x19')](config[_0x5497('0x18')],{'host':_0x5497('0x1a'),'port':0x18eb});var socket=require(_0x5497('0x1b'))(new Redis(config[_0x5497('0x18')]));require(_0x5497('0x1c'))[_0x5497('0x1d')](socket);function respondWithStatusCode(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xcc;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['sendStatus'](_0x55f590);}return _0x1a4c74[_0x5497('0x1e')](_0x55f590)[_0x5497('0x1f')]();};}function respondWithResult(_0x19e5f3,_0x3ce50b){_0x3ce50b=_0x3ce50b||0xc8;return function(_0x37c18e){if(_0x37c18e){return _0x19e5f3[_0x5497('0x1e')](_0x3ce50b)[_0x5497('0x20')](_0x37c18e);}};}function respondWithFilteredResult(_0x575f6b,_0x56a788){return function(_0x3f4d20){if(_0x3f4d20){var _0x1bf442=typeof _0x56a788[_0x5497('0x21')]==='undefined'&&typeof _0x56a788[_0x5497('0x22')]===_0x5497('0x23');var _0x18e8a8=_0x3f4d20[_0x5497('0x24')];var _0x1b1b43=_0x1bf442?0x0:_0x56a788[_0x5497('0x21')];var _0x16d378=_0x1bf442?_0x3f4d20[_0x5497('0x24')]:_0x56a788[_0x5497('0x21')]+_0x56a788[_0x5497('0x22')];var _0x186065;if(_0x16d378>=_0x18e8a8){_0x16d378=_0x18e8a8;_0x186065=0xc8;}else{_0x186065=0xce;}_0x575f6b['status'](_0x186065);return _0x575f6b[_0x5497('0x25')]('Content-Range',_0x1b1b43+'-'+_0x16d378+'/'+_0x18e8a8)[_0x5497('0x20')](_0x3f4d20);}return null;};}function patchUpdates(_0xd0868d){return function(_0x44265c){try{jsonpatch[_0x5497('0x26')](_0x44265c,_0xd0868d,!![]);}catch(_0x35ecd9){return BPromise[_0x5497('0x27')](_0x35ecd9);}return _0x44265c['save']();};}function saveUpdates(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x28')](_0x54043a)[_0x5497('0x29')](function(_0x5223b5){return _0x5223b5;});}return null;};}function removeEntity(_0x13b7a4,_0x57268c){return function(_0x1f3198){if(_0x1f3198){return _0x1f3198[_0x5497('0x2a')]()[_0x5497('0x29')](function(){var _0x34a1a5=_0x1f3198[_0x5497('0x2b')]({'plain':!![]});var _0x31cd01=[{'name':'VoiceQueues','value':_0x5497('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x498f15=_(_0x31cd01)[_0x5497('0x2d')]('ignore')['map'](_0x5497('0x2e'))[_0x5497('0x2e')]();if(_[_0x5497('0x2f')](_0x498f15,_0x34a1a5['type'])){return;}var _0x59380f=_['find'](_0x31cd01,[_0x5497('0x2e'),_0x34a1a5[_0x5497('0x30')]])[_0x5497('0x31')];return db['UserProfileResource']['destroy']({'where':{'type':_0x59380f,'resourceId':_0x34a1a5['id']}})['then'](function(){return _0x1f3198;});})[_0x5497('0x29')](function(){_0x13b7a4['status'](0xcc)[_0x5497('0x1f')]();});}};}function handleEntityNotFound(_0x258c2d,_0x77c575){return function(_0x4d05c4){if(!_0x4d05c4){_0x258c2d[_0x5497('0x32')](0x194);}return _0x4d05c4;};}function handleError(_0x32aba1,_0x592c00){_0x592c00=_0x592c00||0x1f4;return function(_0xce7cb2){logger[_0x5497('0x33')](_0xce7cb2[_0x5497('0x34')]);if(_0xce7cb2['name']){delete _0xce7cb2[_0x5497('0x31')];}_0x32aba1[_0x5497('0x1e')](_0x592c00)[_0x5497('0x35')](_0xce7cb2);};}exports[_0x5497('0x36')]=function(_0x412f5b,_0x4a6459){var _0x386845={},_0x31ae43={},_0x558a70={'count':0x0,'rows':[]};var _0x1ffc9b=_[_0x5497('0x37')](db[_0x5497('0x38')][_0x5497('0x39')],function(_0x1656c7){return{'name':_0x1656c7[_0x5497('0x3a')],'type':_0x1656c7['type'][_0x5497('0x3b')]};});_0x31ae43['model']=_[_0x5497('0x37')](_0x1ffc9b,_0x5497('0x31'));_0x31ae43[_0x5497('0x3c')]=_['keys'](_0x412f5b['query']);_0x31ae43[_0x5497('0x3d')]=_[_0x5497('0x3e')](_0x31ae43[_0x5497('0x3f')],_0x31ae43[_0x5497('0x3c')]);_0x386845[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x31ae43['model'],qs[_0x5497('0x41')](_0x412f5b[_0x5497('0x3c')][_0x5497('0x41')]));_0x386845[_0x5497('0x40')]=_0x386845[_0x5497('0x40')][_0x5497('0x42')]?_0x386845[_0x5497('0x40')]:_0x31ae43[_0x5497('0x3f')];if(!_0x412f5b[_0x5497('0x3c')]['hasOwnProperty'](_0x5497('0x43'))){_0x386845[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x412f5b[_0x5497('0x3c')][_0x5497('0x22')]);_0x386845[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x412f5b['query'][_0x5497('0x21')]);}_0x386845[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x412f5b[_0x5497('0x3c')][_0x5497('0x45')]);_0x386845[_0x5497('0x46')]=qs[_0x5497('0x3d')](_['pick'](_0x412f5b[_0x5497('0x3c')],_0x31ae43[_0x5497('0x3d')]),_0x1ffc9b);if(_0x412f5b[_0x5497('0x3c')][_0x5497('0x2d')]){_0x386845[_0x5497('0x46')]=_[_0x5497('0x47')](_0x386845[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0x1ffc9b,function(_0x2021ae){if(_0x2021ae[_0x5497('0x30')]!=='VIRTUAL'){var _0x2464a4={};_0x2464a4[_0x2021ae['name']]={'$like':'%'+_0x412f5b[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x2464a4;}})});}_0x386845=_[_0x5497('0x47')]({},_0x386845,_0x412f5b[_0x5497('0x48')]);var _0x133746={'where':_0x386845['where']};return db[_0x5497('0x38')][_0x5497('0x24')](_0x133746)['then'](function(_0x4d9a8d){_0x558a70['count']=_0x4d9a8d;if(_0x412f5b[_0x5497('0x3c')]['includeAll']){_0x386845[_0x5497('0x49')]=[{'all':!![]}];}return db[_0x5497('0x38')][_0x5497('0x4a')](_0x386845);})[_0x5497('0x29')](function(_0xbf2f0){_0x558a70['rows']=_0xbf2f0;return _0x558a70;})['then'](respondWithFilteredResult(_0x4a6459,_0x386845))['catch'](handleError(_0x4a6459,null));};exports['show']=function(_0x3cbe4b,_0x43c430){var _0x417f31={'raw':![],'where':{'id':_0x3cbe4b[_0x5497('0x4b')]['id']}},_0x185512={};_0x185512[_0x5497('0x3f')]=_[_0x5497('0x4c')](db[_0x5497('0x38')][_0x5497('0x39')]);_0x185512['query']=_[_0x5497('0x4c')](_0x3cbe4b[_0x5497('0x3c')]);_0x185512[_0x5497('0x3d')]=_['intersection'](_0x185512[_0x5497('0x3f')],_0x185512['query']);_0x417f31[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x185512[_0x5497('0x3f')],qs['fields'](_0x3cbe4b[_0x5497('0x3c')][_0x5497('0x41')]));_0x417f31['attributes']=_0x417f31[_0x5497('0x40')]['length']?_0x417f31[_0x5497('0x40')]:_0x185512['model'];if(_0x3cbe4b[_0x5497('0x3c')][_0x5497('0x4d')]){_0x417f31[_0x5497('0x49')]=[{'all':!![]}];}_0x417f31=_[_0x5497('0x47')]({},_0x417f31,_0x3cbe4b[_0x5497('0x48')]);return db[_0x5497('0x38')][_0x5497('0x4e')](_0x417f31)[_0x5497('0x29')](handleEntityNotFound(_0x43c430,null))['then'](respondWithResult(_0x43c430,null))[_0x5497('0x4f')](handleError(_0x43c430,null));};exports['create']=function(_0x4c516b,_0x33a882){return db[_0x5497('0x38')]['create'](_0x4c516b[_0x5497('0x50')],{})[_0x5497('0x29')](function(_0x436a83){var _0x3094c7=_0x4c516b['user'][_0x5497('0x2b')]({'plain':!![]});if(!_0x3094c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3094c7['role']===_0x5497('0x51')){var _0x33dd07=_0x436a83[_0x5497('0x2b')]({'plain':!![]});var _0x49c85a=[{'name':'VoiceQueues','value':_0x5497('0x2c')},{'name':'QueueCampaigns','value':_0x5497('0x52')}];var _0x530431=_[_0x5497('0x4e')](_0x49c85a,['value',_0x33dd07[_0x5497('0x30')]])[_0x5497('0x31')];return db['UserProfileSection'][_0x5497('0x4e')]({'where':{'name':_0x530431,'userProfileId':_0x3094c7['userProfileId']},'raw':!![]})['then'](function(_0x284f6d){if(_0x284f6d&&_0x284f6d[_0x5497('0x53')]===0x0){return db['UserProfileResource'][_0x5497('0x54')]({'name':_0x33dd07[_0x5497('0x31')],'resourceId':_0x33dd07['id'],'type':_0x284f6d[_0x5497('0x31')],'sectionId':_0x284f6d['id']},{})[_0x5497('0x29')](function(){return _0x436a83;});}else{return _0x436a83;}})[_0x5497('0x4f')](function(_0x25c75e){logger['error'](_0x5497('0x55'),_0x25c75e);throw _0x25c75e;});}return _0x436a83;})['then'](respondWithResult(_0x33a882,0xc9))['catch'](handleError(_0x33a882,null));};exports['clone']=function(_0x1f3965,_0x37e0b9){var _0x23fd59={'where':{'id':_0x1f3965[_0x5497('0x4b')]['id']}},_0x544085={};_0x544085['model']=_['keys'](db[_0x5497('0x38')][_0x5497('0x39')]);_0x23fd59[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x544085[_0x5497('0x3f')],qs[_0x5497('0x41')](_0x1f3965['query'][_0x5497('0x41')]));_0x23fd59[_0x5497('0x40')]=_0x23fd59[_0x5497('0x40')][_0x5497('0x42')]?_0x23fd59['attributes']:_0x544085[_0x5497('0x3f')];if(_0x1f3965[_0x5497('0x3c')][_0x5497('0x4d')]){_0x23fd59[_0x5497('0x49')]=[{'all':!![]}];}_0x23fd59=_['merge']({},_0x23fd59,_0x1f3965[_0x5497('0x48')]);return db[_0x5497('0x38')][_0x5497('0x4e')](_0x23fd59)['then'](handleEntityNotFound(_0x37e0b9,null))[_0x5497('0x29')](function(_0x50a144){if(_0x50a144){var _0x5b4e84=_0x50a144['get']({'plain':!![]});_0x5b4e84=qs[_0x5497('0x56')](_0x5b4e84,['id',_0x5497('0x57'),_0x5497('0x58')]);_0x1f3965['body']=_[_0x5497('0x56')](_0x1f3965[_0x5497('0x50')],['id',_0x5497('0x57'),_0x5497('0x58')]);return db['VoiceQueue'][_0x5497('0x54')](_[_0x5497('0x47')](_0x5b4e84,_0x1f3965[_0x5497('0x50')]),{'include':_0x1f3965['query'][_0x5497('0x4d')]?[{'all':!![]}]:undefined})[_0x5497('0x29')](function(_0xb3eec2){var _0x4368e3=_0x1f3965[_0x5497('0x51')][_0x5497('0x2b')]({'plain':!![]});if(!_0x4368e3)throw new Error(_0x5497('0x59'));if(_0x4368e3['role']===_0x5497('0x51')){var _0x17186e=_0xb3eec2[_0x5497('0x2b')]({'plain':!![]});var _0x20efea=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':_0x5497('0x52')}];var _0x1d1405=_[_0x5497('0x4e')](_0x20efea,['value',_0x17186e[_0x5497('0x30')]])[_0x5497('0x31')];return db[_0x5497('0x5a')][_0x5497('0x4e')]({'where':{'name':_0x1d1405,'userProfileId':_0x4368e3[_0x5497('0x5b')]},'raw':!![]})[_0x5497('0x29')](function(_0x3f38bf){if(_0x3f38bf&&_0x3f38bf[_0x5497('0x53')]===0x0){return db[_0x5497('0x5c')][_0x5497('0x54')]({'name':_0x17186e[_0x5497('0x31')],'resourceId':_0x17186e['id'],'type':_0x3f38bf['name'],'sectionId':_0x3f38bf['id']},{})[_0x5497('0x29')](function(){return _0xb3eec2;});}else{return _0xb3eec2;}})[_0x5497('0x4f')](function(_0x238d68){logger['error'](_0x5497('0x55'),_0x238d68);throw _0x238d68;});}return _0xb3eec2;});}})['then'](respondWithResult(_0x37e0b9,0xc9))[_0x5497('0x4f')](handleError(_0x37e0b9,null));};exports[_0x5497('0x28')]=function(_0x4ca2d2,_0x2c67d7){if(_0x4ca2d2[_0x5497('0x50')]['id']){delete _0x4ca2d2[_0x5497('0x50')]['id'];}return db[_0x5497('0x38')]['find']({'where':{'id':_0x4ca2d2[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x2c67d7,null))[_0x5497('0x29')](saveUpdates(_0x4ca2d2['body'],null))[_0x5497('0x29')](respondWithResult(_0x2c67d7,null))[_0x5497('0x4f')](handleError(_0x2c67d7,null));};exports['destroy']=function(_0x105298,_0xebe694){return db[_0x5497('0x38')]['find']({'where':{'id':_0x105298['params']['id']}})[_0x5497('0x29')](handleEntityNotFound(_0xebe694,null))[_0x5497('0x29')](removeEntity(_0xebe694,null))[_0x5497('0x4f')](handleError(_0xebe694,null));};exports[_0x5497('0x5d')]=function(_0xad9c91,_0x819588,_0x13f1b7){var _0x4e4d70={'raw':![],'where':{}};var _0x48a571={};var _0x166daa={'count':0x0,'rows':[]};return db[_0x5497('0x38')]['findOne']({'where':{'id':_0xad9c91[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x819588,null))[_0x5497('0x29')](function(_0x510078){if(_0x510078){_0x48a571[_0x5497('0x3f')]=_[_0x5497('0x4c')](db['CmHopper'][_0x5497('0x39')]);_0x48a571[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0xad9c91[_0x5497('0x3c')]);_0x48a571[_0x5497('0x3d')]=_['intersection'](_0x48a571[_0x5497('0x3f')],_0x48a571[_0x5497('0x3c')]);_0x4e4d70[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x48a571[_0x5497('0x3f')],qs['fields'](_0xad9c91[_0x5497('0x3c')][_0x5497('0x41')]));_0x4e4d70[_0x5497('0x40')]=_0x4e4d70[_0x5497('0x40')]['length']?_0x4e4d70[_0x5497('0x40')]:_0x48a571[_0x5497('0x3f')];if(!_0xad9c91['query'][_0x5497('0x5e')](_0x5497('0x43'))){_0x4e4d70[_0x5497('0x22')]=qs[_0x5497('0x22')](_0xad9c91['query']['limit']);_0x4e4d70['offset']=qs['offset'](_0xad9c91['query'][_0x5497('0x21')]);}_0x4e4d70[_0x5497('0x44')]=qs[_0x5497('0x45')](_0xad9c91[_0x5497('0x3c')][_0x5497('0x45')]);_0x4e4d70['where']=qs['filters'](_[_0x5497('0x5f')](_0xad9c91[_0x5497('0x3c')],_0x48a571[_0x5497('0x3d')]));_0x4e4d70[_0x5497('0x46')][_0x5497('0x60')]=_0x510078['id'];if(_0xad9c91[_0x5497('0x3c')][_0x5497('0x2d')]){_0x4e4d70[_0x5497('0x46')]=_[_0x5497('0x47')](_0x4e4d70[_0x5497('0x46')],{'$or':_['map'](_0x4e4d70[_0x5497('0x40')],function(_0x4118ec){var _0x2868b1={};_0x2868b1[_0x4118ec]={'$like':'%'+_0xad9c91[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x2868b1;})});}_0x4e4d70=_[_0x5497('0x47')]({},_0x4e4d70,_0xad9c91['options']);return db[_0x5497('0x61')]['count']({'where':_0x4e4d70[_0x5497('0x46')]})[_0x5497('0x29')](function(_0x2207b9){_0x166daa['count']=_0x2207b9;if(_0xad9c91['query'][_0x5497('0x4d')]){_0x4e4d70[_0x5497('0x49')]=[{'all':!![]}];}return db[_0x5497('0x61')][_0x5497('0x4a')](_0x4e4d70);})[_0x5497('0x29')](function(_0x1876d2){_0x166daa[_0x5497('0x62')]=_0x1876d2;return _0x166daa;});}})[_0x5497('0x29')](respondWithFilteredResult(_0x819588,_0x4e4d70))['catch'](handleError(_0x819588,null));};exports['getHopperHistories']=function(_0x492372,_0x1f47e6,_0x1dfe31){var _0x160b4b={'raw':!![],'where':{}};var _0xc81d7d={};var _0x4c442f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5497('0x63')]({'where':{'id':_0x492372[_0x5497('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1f47e6,null))[_0x5497('0x29')](function(_0x2fc11a){if(_0x2fc11a){_0xc81d7d[_0x5497('0x3f')]=_[_0x5497('0x4c')](db['CmHopperHistory']['rawAttributes']);_0xc81d7d['query']=_['keys'](_0x492372['query']);_0xc81d7d[_0x5497('0x3d')]=_['intersection'](_0xc81d7d[_0x5497('0x3f')],_0xc81d7d['query']);_0x160b4b[_0x5497('0x40')]=_[_0x5497('0x3e')](_0xc81d7d[_0x5497('0x3f')],qs[_0x5497('0x41')](_0x492372[_0x5497('0x3c')][_0x5497('0x41')]));_0x160b4b['attributes']=_0x160b4b[_0x5497('0x40')]['length']?_0x160b4b[_0x5497('0x40')]:_0xc81d7d[_0x5497('0x3f')];if(!_0x492372[_0x5497('0x3c')][_0x5497('0x5e')](_0x5497('0x43'))){_0x160b4b[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x492372[_0x5497('0x3c')][_0x5497('0x22')]);_0x160b4b[_0x5497('0x21')]=qs['offset'](_0x492372[_0x5497('0x3c')]['offset']);}_0x160b4b[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x492372['query'][_0x5497('0x45')]);_0x160b4b[_0x5497('0x46')]=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x492372[_0x5497('0x3c')],_0xc81d7d[_0x5497('0x3d')]));_0x160b4b[_0x5497('0x46')][_0x5497('0x60')]=_0x2fc11a['id'];if(_0x492372[_0x5497('0x3c')][_0x5497('0x2d')]){_0x160b4b[_0x5497('0x46')]=_[_0x5497('0x47')](_0x160b4b[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0x160b4b['attributes'],function(_0x37c17e){var _0x163b5b={};_0x163b5b[_0x37c17e]={'$like':'%'+_0x492372[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x163b5b;})});}_0x160b4b=_[_0x5497('0x47')]({},_0x160b4b,_0x492372['options']);return db[_0x5497('0x64')][_0x5497('0x24')]({'where':_0x160b4b['where']})['then'](function(_0x3a5872){_0x4c442f[_0x5497('0x24')]=_0x3a5872;if(_0x492372[_0x5497('0x3c')][_0x5497('0x4d')]){_0x160b4b[_0x5497('0x49')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x160b4b);})[_0x5497('0x29')](function(_0x593b38){_0x4c442f[_0x5497('0x62')]=_0x593b38;return _0x4c442f;});}})[_0x5497('0x29')](respondWithFilteredResult(_0x1f47e6,_0x160b4b))[_0x5497('0x4f')](handleError(_0x1f47e6,null));};exports[_0x5497('0x65')]=function(_0x2bdedb,_0x13350b,_0x53acd4){var _0x49df29={'raw':!![],'where':{}};var _0x85a1fa={};var _0x40fce7={'count':0x0,'rows':[]};return db[_0x5497('0x38')]['findOne']({'where':{'id':_0x2bdedb[_0x5497('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13350b,null))[_0x5497('0x29')](function(_0x5ec87d){if(_0x5ec87d){_0x85a1fa['model']=_[_0x5497('0x4c')](db[_0x5497('0x66')]['rawAttributes']);_0x85a1fa[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x2bdedb[_0x5497('0x3c')]);_0x85a1fa[_0x5497('0x3d')]=_['intersection'](_0x85a1fa[_0x5497('0x3f')],_0x85a1fa[_0x5497('0x3c')]);_0x49df29[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x85a1fa[_0x5497('0x3f')],qs['fields'](_0x2bdedb[_0x5497('0x3c')]['fields']));_0x49df29[_0x5497('0x40')]=_0x49df29[_0x5497('0x40')][_0x5497('0x42')]?_0x49df29[_0x5497('0x40')]:_0x85a1fa[_0x5497('0x3f')];if(!_0x2bdedb[_0x5497('0x3c')][_0x5497('0x5e')](_0x5497('0x43'))){_0x49df29[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x2bdedb[_0x5497('0x3c')]['limit']);_0x49df29[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x2bdedb[_0x5497('0x3c')][_0x5497('0x21')]);}_0x49df29[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x2bdedb[_0x5497('0x3c')][_0x5497('0x45')]);_0x49df29[_0x5497('0x46')]=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x2bdedb['query'],_0x85a1fa[_0x5497('0x3d')]));_0x49df29[_0x5497('0x46')][_0x5497('0x60')]=_0x5ec87d['id'];if(_0x2bdedb[_0x5497('0x3c')][_0x5497('0x2d')]){_0x49df29[_0x5497('0x46')]=_[_0x5497('0x47')](_0x49df29[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0x49df29[_0x5497('0x40')],function(_0x9db313){var _0x917a6b={};_0x917a6b[_0x9db313]={'$like':'%'+_0x2bdedb[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x917a6b;})});}_0x49df29=_['merge']({},_0x49df29,_0x2bdedb['options']);return db[_0x5497('0x66')][_0x5497('0x24')]({'where':_0x49df29[_0x5497('0x46')]})['then'](function(_0x349a89){_0x40fce7[_0x5497('0x24')]=_0x349a89;if(_0x2bdedb[_0x5497('0x3c')][_0x5497('0x4d')]){_0x49df29[_0x5497('0x49')]=[{'all':!![]}];}return db[_0x5497('0x66')][_0x5497('0x4a')](_0x49df29);})[_0x5497('0x29')](function(_0x491789){_0x40fce7['rows']=_0x491789;return _0x40fce7;});}})['then'](respondWithFilteredResult(_0x13350b,_0x49df29))[_0x5497('0x4f')](handleError(_0x13350b,null));};exports[_0x5497('0x67')]=function(_0x4dab6a,_0x649ca7,_0x27f42b){var _0x1bef85={'raw':!![],'where':{}};var _0x5a0f98={};var _0x4423ee={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5497('0x63')]({'where':{'id':_0x4dab6a[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x649ca7,null))['then'](function(_0x1c3dad){if(_0x1c3dad){_0x5a0f98[_0x5497('0x3f')]=_['keys'](db[_0x5497('0x68')][_0x5497('0x39')]);_0x5a0f98[_0x5497('0x3c')]=_['keys'](_0x4dab6a[_0x5497('0x3c')]);_0x5a0f98[_0x5497('0x3d')]=_[_0x5497('0x3e')](_0x5a0f98[_0x5497('0x3f')],_0x5a0f98[_0x5497('0x3c')]);_0x1bef85[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x5a0f98[_0x5497('0x3f')],qs[_0x5497('0x41')](_0x4dab6a[_0x5497('0x3c')][_0x5497('0x41')]));_0x1bef85[_0x5497('0x40')]=_0x1bef85[_0x5497('0x40')][_0x5497('0x42')]?_0x1bef85[_0x5497('0x40')]:_0x5a0f98['model'];if(!_0x4dab6a[_0x5497('0x3c')]['hasOwnProperty'](_0x5497('0x43'))){_0x1bef85[_0x5497('0x22')]=qs['limit'](_0x4dab6a['query'][_0x5497('0x22')]);_0x1bef85[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x4dab6a[_0x5497('0x3c')]['offset']);}_0x1bef85[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x4dab6a['query']['sort']);_0x1bef85[_0x5497('0x46')]=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x4dab6a[_0x5497('0x3c')],_0x5a0f98[_0x5497('0x3d')]));_0x1bef85['where']['VoiceQueueId']=_0x1c3dad['id'];if(_0x4dab6a[_0x5497('0x3c')][_0x5497('0x2d')]){_0x1bef85['where']=_[_0x5497('0x47')](_0x1bef85[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0x1bef85[_0x5497('0x40')],function(_0x358ec5){var _0x5cddbc={};_0x5cddbc[_0x358ec5]={'$like':'%'+_0x4dab6a[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x5cddbc;})});}_0x1bef85=_[_0x5497('0x47')]({},_0x1bef85,_0x4dab6a['options']);return db['CmHopperBlack'][_0x5497('0x24')]({'where':_0x1bef85[_0x5497('0x46')]})[_0x5497('0x29')](function(_0x5e07b0){_0x4423ee[_0x5497('0x24')]=_0x5e07b0;if(_0x4dab6a[_0x5497('0x3c')][_0x5497('0x4d')]){_0x1bef85['include']=[{'all':!![]}];}return db[_0x5497('0x68')][_0x5497('0x4a')](_0x1bef85);})['then'](function(_0x5264a8){_0x4423ee[_0x5497('0x62')]=_0x5264a8;return _0x4423ee;});}})[_0x5497('0x29')](respondWithFilteredResult(_0x649ca7,_0x1bef85))['catch'](handleError(_0x649ca7,null));};exports[_0x5497('0x69')]=function(_0x5001d5,_0x22c8ad,_0x2c58e6){var _0x300f3e={};var _0x30e3f0={};var _0x31d47d;var _0x113336;return db[_0x5497('0x38')]['findOne']({'where':{'id':_0x5001d5['params']['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x22c8ad,null))[_0x5497('0x29')](function(_0x4ec65c){if(_0x4ec65c){_0x31d47d=_0x4ec65c;_0x30e3f0['model']=_[_0x5497('0x4c')](db[_0x5497('0x6a')][_0x5497('0x39')]);_0x30e3f0[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x5001d5[_0x5497('0x3c')]);_0x30e3f0['filters']=_[_0x5497('0x3e')](_0x30e3f0[_0x5497('0x3f')],_0x30e3f0[_0x5497('0x3c')]);_0x300f3e[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x30e3f0[_0x5497('0x3f')],qs['fields'](_0x5001d5[_0x5497('0x3c')]['fields']));_0x300f3e[_0x5497('0x40')]=_0x300f3e[_0x5497('0x40')][_0x5497('0x42')]?_0x300f3e['attributes']:_0x30e3f0[_0x5497('0x3f')];_0x300f3e['order']=qs['sort'](_0x5001d5[_0x5497('0x3c')][_0x5497('0x45')]);_0x300f3e['where']=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x5001d5[_0x5497('0x3c')],_0x30e3f0[_0x5497('0x3d')]));if(_0x5001d5[_0x5497('0x3c')][_0x5497('0x2d')]){_0x300f3e[_0x5497('0x46')]=_[_0x5497('0x47')](_0x300f3e[_0x5497('0x46')],{'$or':_['map'](_0x300f3e[_0x5497('0x40')],function(_0xad0a6){var _0xa3246f={};_0xa3246f[_0xad0a6]={'$like':'%'+_0x5001d5[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0xa3246f;})});}_0x300f3e=_[_0x5497('0x47')]({},_0x300f3e,_0x5001d5[_0x5497('0x48')]);return _0x31d47d[_0x5497('0x69')](_0x300f3e);}})[_0x5497('0x29')](function(_0x2c5720){if(_0x2c5720){_0x113336=_0x2c5720[_0x5497('0x42')];if(!_0x5001d5[_0x5497('0x3c')][_0x5497('0x5e')](_0x5497('0x43'))){_0x300f3e[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x5001d5[_0x5497('0x3c')][_0x5497('0x22')]);_0x300f3e[_0x5497('0x21')]=qs['offset'](_0x5001d5[_0x5497('0x3c')][_0x5497('0x21')]);}return _0x31d47d['getTeams'](_0x300f3e);}})['then'](function(_0x3fa976){if(_0x3fa976){return _0x3fa976?{'count':_0x113336,'rows':_0x3fa976}:null;}})['then'](respondWithResult(_0x22c8ad,null))[_0x5497('0x4f')](handleError(_0x22c8ad,null));};exports[_0x5497('0x6b')]=function(_0x8755ed,_0x2d185e,_0x25233f){var _0x2fc2b5=_0x8755ed[_0x5497('0x50')][_0x5497('0x6c')];var _0xd469af=_[_0x5497('0x37')](_0x2fc2b5,'id');return db[_0x5497('0x6a')]['findAll']({'where':{'id':_0xd469af},'attributes':['id'],'include':[{'model':db[_0x5497('0x6d')],'as':'Agents','attributes':['id',_0x5497('0x31'),_0x5497('0x6e'),_0x5497('0x6f'),_0x5497('0x70')],'raw':!![]}]})[_0x5497('0x29')](function(_0x296e58){if(_0x296e58){var _0xc34204=_[_0x5497('0x71')](_0x296e58,function(_0x5b7011){var _0x47cffa=_0x5b7011[_0x5497('0x2b')]({'plain':!![]});_0x47cffa[_0x5497('0x72')][_0x5497('0x73')](function(_0x2e9b06){_0x2e9b06[_0x5497('0x74')]=_['find'](_0x2fc2b5,{'id':_0x47cffa['id']})[_0x5497('0x74')];});return _0x47cffa['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x8755ed['params']['id']}})[_0x5497('0x29')](function(_0x49d555){return db['sequelize'][_0x5497('0x75')](function(_0x1c8be2){return _0x49d555[_0x5497('0x6b')](_0xd469af,{'transaction':_0x1c8be2})[_0x5497('0x29')](function(){return BPromise['each'](_0x2fc2b5,function(_0x2e62ae){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x2e62ae['id'],'VoiceQueueId':_0x8755ed[_0x5497('0x4b')]['id'],'penalty':_0x2e62ae['penalty']},{'transaction':_0x1c8be2});});})[_0x5497('0x29')](function(){return BPromise[_0x5497('0x76')](_0xc34204,function(_0xd0d16a){return db['UserVoiceQueue'][_0x5497('0x77')]({'where':{'UserId':_0xd0d16a['id'],'VoiceQueueId':_0x8755ed['params']['id']},'defaults':{'penalty':_0xd0d16a[_0x5497('0x74')]},'transaction':_0x1c8be2});});})[_0x5497('0x29')](function(){return BPromise[_0x5497('0x76')](_[_0x5497('0x2d')](_0xc34204,{'online':!![]}),function(_0x3537a3){return db[_0x5497('0x78')][_0x5497('0x79')]({'membername':_0x3537a3[_0x5497('0x31')],'UserId':_0x3537a3['id'],'queue_name':_0x49d555[_0x5497('0x31')],'VoiceQueueId':_0x49d555['id'],'interface':_['isNil'](_0x3537a3[_0x5497('0x70')])?util[_0x5497('0x7a')](_0x5497('0x7b'),_0x3537a3['name']):_0x3537a3[_0x5497('0x70')],'paused':_0x3537a3[_0x5497('0x6f')]||![],'penalty':_0x3537a3[_0x5497('0x74')]},{'transaction':_0x1c8be2});});})[_0x5497('0x29')](function(){_0xc34204[_0x5497('0x73')](function(_0x4a1a70){socket[_0x5497('0x7c')](_0x5497('0x7d'),{'UserId':_0x4a1a70['id'],'VoiceQueueId':_0x49d555['id']});});});});});}})[_0x5497('0x29')](respondWithStatusCode(_0x2d185e,null))[_0x5497('0x4f')](handleError(_0x2d185e,null));};exports['removeTeams']=function(_0x23646a,_0x2603b5,_0x8298f2){return db[_0x5497('0x6a')][_0x5497('0x4a')]({'where':{'id':_0x23646a[_0x5497('0x3c')][_0x5497('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5497('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2603b5,null))[_0x5497('0x29')](function(_0x183142){var _0x55fe87=_['map'](_0x183142,'id');var _0x5cfdea=[];var _0x3dd293=[];var _0x18f72b=squel[_0x5497('0x7f')]();_0x18f72b[_0x5497('0x80')]('tq.TeamId')[_0x5497('0x81')](_0x5497('0x82'),'tq')[_0x5497('0x83')](_0x5497('0x84'),'ut',_0x5497('0x85'))['where'](_0x5497('0x86'),_0x23646a['params']['id']);for(var _0x1e56a4=0x0;_0x1e56a4<_0x183142[_0x5497('0x42')];_0x1e56a4+=0x1){let _0x464c97=_0x183142[_0x1e56a4];for(var _0x267861=0x0;_0x267861<_0x464c97['Agents']['length'];_0x267861+=0x1){let _0x3cad8a=_0x464c97['Agents'][_0x267861];var _0x2e00e6=_0x18f72b['clone']();_0x2e00e6[_0x5497('0x46')]('ut.UserId\x20=\x20?',_0x3cad8a['id']);_0x3dd293[_0x5497('0x87')](db[_0x5497('0x88')]['query'](_0x2e00e6[_0x5497('0x89')](),{'type':db[_0x5497('0x88')][_0x5497('0x8a')][_0x5497('0x8b')]})['then'](function(_0x33184c){if(_0x33184c[_0x5497('0x42')]===0x1){return _0x3cad8a['id'];}else{var _0x2e5e88=_[_0x5497('0x8c')](_[_0x5497('0x37')](_0x33184c,_0x5497('0x8d')),function(_0x41b271){return _[_0x5497('0x2f')](_0x55fe87,_0x41b271);});if(_0x2e5e88){return _0x3cad8a['id'];}}}));}}return BPromise[_0x5497('0x8e')](_0x3dd293)[_0x5497('0x29')](function(_0x29a9e5){_0x5cfdea=_(_0x5cfdea)[_0x5497('0x8f')](_0x29a9e5)[_0x5497('0x90')]()[_0x5497('0x2e')]();return db[_0x5497('0x38')][_0x5497('0x4e')]({'where':{'id':_0x23646a[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](function(_0x33c0d9){return db[_0x5497('0x88')][_0x5497('0x75')](function(_0x311484){return _0x33c0d9[_0x5497('0x91')](_0x23646a[_0x5497('0x3c')]['ids'],{'transaction':_0x311484})[_0x5497('0x29')](function(){if(!_['isEmpty'](_0x5cfdea)){return _0x33c0d9[_0x5497('0x92')](_0x5cfdea,{'transaction':_0x311484})['then'](function(){return db[_0x5497('0x78')]['destroy']({'where':{'VoiceQueueId':_0x23646a['params']['id'],'UserId':_0x5cfdea},'transaction':_0x311484});});}})[_0x5497('0x29')](function(){_0x5cfdea['forEach'](function(_0x4c6d77){socket[_0x5497('0x7c')]('userVoiceQueue:remove',{'UserId':_0x4c6d77,'VoiceQueueId':_0x33c0d9['id']});});});});});});})[_0x5497('0x29')](respondWithStatusCode(_0x2603b5,null))['catch'](handleError(_0x2603b5,null));};exports['addAgents']=function(_0x118c30,_0x3cab30,_0x171b7e){var _0x4963c2,_0x1674b4;return db[_0x5497('0x38')][_0x5497('0x4e')]({'where':{'id':_0x118c30[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x3cab30,null))['then'](function(_0xc43157){if(_0xc43157){_0x1674b4=_0xc43157;return _0xc43157['addAgents'](_0x118c30['body'][_0x5497('0x7e')],_[_0x5497('0x56')](_0x118c30['body'],[_0x5497('0x7e'),'id'])||{})['spread'](function(_0x49da94){for(var _0x2a1994=0x0;_0x2a1994<_0x118c30[_0x5497('0x50')][_0x5497('0x7e')][_0x5497('0x42')];_0x2a1994+=0x1){socket['emit'](_0x5497('0x7d'),{'UserId':Number(_0x118c30[_0x5497('0x50')][_0x5497('0x7e')][_0x2a1994]),'VoiceQueueId':Number(_0x118c30[_0x5497('0x4b')]['id'])});}return _0x49da94;});}})[_0x5497('0x29')](function(_0x51f848){_0x4963c2=_0x51f848||[];if(_0x1674b4){return db['User'][_0x5497('0x4a')]({'where':{'id':_0x118c30[_0x5497('0x50')][_0x5497('0x7e')]},'attributes':['id',_0x5497('0x31'),_0x5497('0x6e'),'voicePause',_0x5497('0x70')],'raw':!![]});}})[_0x5497('0x29')](function(_0x5e3b48){if(!_['isEmpty'](_0x5e3b48)){var _0x4d045e=[];for(var _0x2cfb5b=0x0;_0x2cfb5b<_0x5e3b48[_0x5497('0x42')];_0x2cfb5b++){if(_0x5e3b48[_0x2cfb5b][_0x5497('0x6e')]){_0x4d045e[_0x5497('0x87')](db[_0x5497('0x78')][_0x5497('0x79')]({'membername':_0x5e3b48[_0x2cfb5b][_0x5497('0x31')],'UserId':_0x5e3b48[_0x2cfb5b]['id'],'queue_name':_0x1674b4['name'],'VoiceQueueId':_0x1674b4['id'],'interface':_[_0x5497('0x93')](_0x5e3b48[_0x2cfb5b][_0x5497('0x70')])?util['format']('SIP/%s',_0x5e3b48[_0x2cfb5b][_0x5497('0x31')]):_0x5e3b48[_0x2cfb5b]['interface'],'paused':_0x5e3b48[_0x2cfb5b][_0x5497('0x6f')]||![],'penalty':_0x118c30[_0x5497('0x50')][_0x5497('0x74')]||0x0}));}}return BPromise[_0x5497('0x8e')](_0x4d045e);}})['then'](function(){return _0x4963c2;})[_0x5497('0x29')](respondWithResult(_0x3cab30,null))[_0x5497('0x4f')](handleError(_0x3cab30,null));};exports[_0x5497('0x92')]=function(_0x438c46,_0x25acb2,_0x590265){return db[_0x5497('0x38')][_0x5497('0x4e')]({'where':{'id':_0x438c46[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x25acb2,null))[_0x5497('0x29')](function(_0x14fa45){if(_0x14fa45){return _0x14fa45[_0x5497('0x92')](_0x438c46['query']['ids'])[_0x5497('0x29')](function(){if(_[_0x5497('0x94')](_0x438c46['query'][_0x5497('0x7e')])){for(var _0x43fc44=0x0;_0x43fc44<_0x438c46['query']['ids'][_0x5497('0x42')];_0x43fc44+=0x1){socket[_0x5497('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x438c46['query']['ids'][_0x43fc44]),'VoiceQueueId':Number(_0x438c46[_0x5497('0x4b')]['id'])});}}else{socket[_0x5497('0x7c')](_0x5497('0x95'),{'UserId':Number(_0x438c46['query'][_0x5497('0x7e')]),'VoiceQueueId':Number(_0x438c46['params']['id'])});}});}})[_0x5497('0x29')](function(_0x58bd84){return db[_0x5497('0x78')]['destroy']({'where':{'VoiceQueueId':_0x438c46[_0x5497('0x4b')]['id'],'UserId':_0x438c46[_0x5497('0x3c')][_0x5497('0x7e')]}})[_0x5497('0x29')](function(){return _0x58bd84;});})[_0x5497('0x29')](respondWithStatusCode(_0x25acb2,null))[_0x5497('0x4f')](handleError(_0x25acb2,null));};exports[_0x5497('0x96')]=function(_0x342a97,_0x32cf68,_0x15969b){var _0x1c4ca6={};var _0x2c4b4c={};var _0x482a20;var _0x817179;return db[_0x5497('0x38')]['findOne']({'where':{'id':_0x342a97[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x32cf68,null))[_0x5497('0x29')](function(_0xedbcba){if(_0xedbcba){_0x482a20=_0xedbcba;_0x2c4b4c['model']=_[_0x5497('0x4c')](db[_0x5497('0x6d')][_0x5497('0x39')]);_0x2c4b4c[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x342a97[_0x5497('0x3c')]);_0x2c4b4c['filters']=_[_0x5497('0x3e')](_0x2c4b4c['model'],_0x2c4b4c[_0x5497('0x3c')]);_0x1c4ca6[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x2c4b4c[_0x5497('0x3f')],qs[_0x5497('0x41')](_0x342a97['query'][_0x5497('0x41')]));_0x1c4ca6[_0x5497('0x40')]=_0x1c4ca6[_0x5497('0x40')][_0x5497('0x42')]?_0x1c4ca6[_0x5497('0x40')]:_0x2c4b4c[_0x5497('0x3f')];_0x1c4ca6[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x342a97[_0x5497('0x3c')][_0x5497('0x45')]);_0x1c4ca6['where']=qs[_0x5497('0x3d')](_['pick'](_0x342a97[_0x5497('0x3c')],_0x2c4b4c[_0x5497('0x3d')]));if(_0x342a97['query'][_0x5497('0x2d')]){_0x1c4ca6[_0x5497('0x46')]=_[_0x5497('0x47')](_0x1c4ca6[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0x1c4ca6[_0x5497('0x40')],function(_0x4835bb){var _0x299a38={};_0x299a38[_0x4835bb]={'$like':'%'+_0x342a97[_0x5497('0x3c')]['filter']+'%'};return _0x299a38;})});}_0x1c4ca6=_['merge']({},_0x1c4ca6,_0x342a97['options']);return _0x482a20[_0x5497('0x96')](_0x1c4ca6);}})['then'](function(_0x331368){if(_0x331368){_0x817179=_0x331368[_0x5497('0x42')];if(!_0x342a97[_0x5497('0x3c')]['hasOwnProperty'](_0x5497('0x43'))){_0x1c4ca6['limit']=qs[_0x5497('0x22')](_0x342a97[_0x5497('0x3c')][_0x5497('0x22')]);_0x1c4ca6[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x342a97[_0x5497('0x3c')]['offset']);}return _0x482a20['getAgents'](_0x1c4ca6);}})['then'](function(_0x387181){if(_0x387181){return _0x387181?{'count':_0x817179,'rows':_0x387181}:null;}})[_0x5497('0x29')](respondWithResult(_0x32cf68,null))[_0x5497('0x4f')](handleError(_0x32cf68,null));};exports[_0x5497('0x97')]=function(_0x639a6a,_0xa965d1,_0x102049){var _0xc84025={};var _0x267bfa={};var _0x8fbf4e;var _0x5b54ff;return db[_0x5497('0x38')][_0x5497('0x63')]({'where':{'id':_0x639a6a['params']['id']}})[_0x5497('0x29')](handleEntityNotFound(_0xa965d1,null))[_0x5497('0x29')](function(_0x9de85e){if(_0x9de85e){_0x8fbf4e=_0x9de85e;_0x267bfa[_0x5497('0x3f')]=_['keys'](db[_0x5497('0x78')]['rawAttributes']);_0x267bfa[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x639a6a[_0x5497('0x3c')]);_0x267bfa['filters']=_[_0x5497('0x3e')](_0x267bfa['model'],_0x267bfa[_0x5497('0x3c')]);_0xc84025[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x267bfa[_0x5497('0x3f')],qs[_0x5497('0x41')](_0x639a6a[_0x5497('0x3c')][_0x5497('0x41')]));_0xc84025[_0x5497('0x40')]=_0xc84025['attributes'][_0x5497('0x42')]?_0xc84025['attributes']:_0x267bfa['model'];_0xc84025[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x639a6a[_0x5497('0x3c')][_0x5497('0x45')]);_0xc84025[_0x5497('0x46')]=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x639a6a[_0x5497('0x3c')],_0x267bfa[_0x5497('0x3d')]));if(_0x639a6a['query'][_0x5497('0x2d')]){_0xc84025['where']=_['merge'](_0xc84025[_0x5497('0x46')],{'$or':_[_0x5497('0x37')](_0xc84025['attributes'],function(_0x14fb29){var _0x5e709c={};_0x5e709c[_0x14fb29]={'$like':'%'+_0x639a6a[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x5e709c;})});}_0xc84025=_[_0x5497('0x47')]({},_0xc84025,_0x639a6a[_0x5497('0x48')]);return _0x8fbf4e[_0x5497('0x97')](_0xc84025);}})[_0x5497('0x29')](function(_0x3dce6a){if(_0x3dce6a){_0x5b54ff=_0x3dce6a['length'];if(!_0x639a6a[_0x5497('0x3c')]['hasOwnProperty']('nolimit')){_0xc84025['limit']=qs[_0x5497('0x22')](_0x639a6a[_0x5497('0x3c')][_0x5497('0x22')]);_0xc84025[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x639a6a[_0x5497('0x3c')]['offset']);}return _0x8fbf4e[_0x5497('0x97')](_0xc84025);}})['then'](function(_0x3f9b91){return _0x3f9b91?{'count':_0x5b54ff,'rows':_0x3f9b91}:null;})[_0x5497('0x29')](respondWithResult(_0xa965d1,null))['catch'](handleError(_0xa965d1,null));};exports[_0x5497('0x98')]=function(_0x4a3144,_0x266240,_0x159ef2){var _0x7b8cb2={};var _0x5b10d3={};var _0x5e2697;var _0x1a7fcc;return db[_0x5497('0x38')][_0x5497('0x63')]({'where':{'id':_0x4a3144[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x266240,null))[_0x5497('0x29')](function(_0x11b9ca){if(_0x11b9ca){_0x5e2697=_0x11b9ca;_0x5b10d3[_0x5497('0x3f')]=_['keys'](db[_0x5497('0x99')]['rawAttributes']);_0x5b10d3[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x4a3144[_0x5497('0x3c')]);_0x5b10d3['filters']=_[_0x5497('0x3e')](_0x5b10d3[_0x5497('0x3f')],_0x5b10d3[_0x5497('0x3c')]);_0x7b8cb2[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x5b10d3[_0x5497('0x3f')],qs['fields'](_0x4a3144[_0x5497('0x3c')][_0x5497('0x41')]));_0x7b8cb2[_0x5497('0x40')]=_0x7b8cb2[_0x5497('0x40')][_0x5497('0x42')]?_0x7b8cb2[_0x5497('0x40')]:_0x5b10d3[_0x5497('0x3f')];_0x7b8cb2['order']=qs[_0x5497('0x45')](_0x4a3144['query'][_0x5497('0x45')]);_0x7b8cb2[_0x5497('0x46')]=qs[_0x5497('0x3d')](_[_0x5497('0x5f')](_0x4a3144[_0x5497('0x3c')],_0x5b10d3[_0x5497('0x3d')]));if(_0x4a3144[_0x5497('0x3c')][_0x5497('0x2d')]){_0x7b8cb2[_0x5497('0x46')]=_[_0x5497('0x47')](_0x7b8cb2['where'],{'$or':_[_0x5497('0x37')](_0x7b8cb2[_0x5497('0x40')],function(_0x14cc22){var _0xec3037={};_0xec3037[_0x14cc22]={'$like':'%'+_0x4a3144[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0xec3037;})});}_0x7b8cb2=_['merge']({},_0x7b8cb2,_0x4a3144[_0x5497('0x48')]);return _0x5e2697[_0x5497('0x98')](_0x7b8cb2);}})[_0x5497('0x29')](function(_0x3c25b6){if(_0x3c25b6){_0x1a7fcc=_0x3c25b6['length'];if(!_0x4a3144[_0x5497('0x3c')][_0x5497('0x5e')](_0x5497('0x43'))){_0x7b8cb2[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x4a3144[_0x5497('0x3c')][_0x5497('0x22')]);_0x7b8cb2[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x4a3144[_0x5497('0x3c')]['offset']);}return _0x5e2697[_0x5497('0x98')](_0x7b8cb2);}})[_0x5497('0x29')](function(_0x2c4db5){if(_0x2c4db5){return _0x2c4db5?{'count':_0x1a7fcc,'rows':_0x2c4db5}:null;}})[_0x5497('0x29')](respondWithResult(_0x266240,null))[_0x5497('0x4f')](handleError(_0x266240,null));};exports[_0x5497('0x9a')]=function(_0x34477e,_0x50d866,_0x5b34f8){var _0x9a27e5=moment()[_0x5497('0x7a')](_0x5497('0x9b'));var _0x32bdf1,_0x2304cc;return db['VoiceQueue'][_0x5497('0x4e')]({'where':{'id':_0x34477e[_0x5497('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50d866,null))[_0x5497('0x29')](function(_0x5c9c14){if(_0x5c9c14){_0x2304cc=_0x5c9c14;return _0x5c9c14[_0x5497('0x9a')](_0x34477e[_0x5497('0x50')][_0x5497('0x7e')],_[_0x5497('0x56')](_0x34477e[_0x5497('0x50')],[_0x5497('0x7e'),'id'])||{});}return null;})[_0x5497('0x9c')](function(_0x24e23b){var _0x2cc264;_0x32bdf1=_0x24e23b||[];var _0x55e20d=[];if(_0x24e23b){for(var _0x1a07d2=0x0;_0x1a07d2<_0x24e23b[_0x5497('0x42')];_0x1a07d2+=0x1){var _0x221f31=_0x24e23b[_0x1a07d2][_0x5497('0x2b')]({'plain':!![]});_0x2304cc[_0x5497('0x9d')]=_0x34477e[_0x5497('0x50')][_0x5497('0x9d')]?_0x34477e[_0x5497('0x50')][_0x5497('0x9d')]:_0x2304cc[_0x5497('0x9d')];switch(_0x2304cc[_0x5497('0x9d')]){case'always':_0x2cc264=squel[_0x5497('0x9e')]()[_0x5497('0x9f')](_0x5497('0xa0'))[_0x5497('0xa1')]([_0x5497('0xa2'),_0x5497('0xa3'),_0x5497('0xa4'),'ListId',_0x5497('0x60'),'createdAt',_0x5497('0x58')],squel[_0x5497('0x7f')]()[_0x5497('0x80')](_0x5497('0xa2'),_0x5497('0xa2'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27','scheduledAt')['field']('id',_0x5497('0xa4'))['field'](_0x221f31['CmListId'][_0x5497('0x89')](),_0x5497('0xa5'))[_0x5497('0x80')](_0x34477e[_0x5497('0x4b')]['id'][_0x5497('0x89')](),_0x5497('0x60'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27',_0x5497('0x57'))['field']('\x27'+_0x9a27e5+'\x27',_0x5497('0x58'))[_0x5497('0x81')]('cm_contacts')['where'](_0x5497('0xa6'))['where'](_0x5497('0xa7'),_0x221f31[_0x5497('0xa8')][_0x5497('0x89')]())[_0x5497('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x5497('0x46')](_0x5497('0xa9'),squel[_0x5497('0x7f')]()[_0x5497('0x80')]('COALESCE(calleridnum,\x27\x27)')[_0x5497('0x81')]('cm_hopper_final')[_0x5497('0x46')](_0x5497('0x86'),_0x34477e[_0x5497('0x4b')]['id'][_0x5497('0x89')]()))[_0x5497('0x46')](_0x5497('0xa9'),squel[_0x5497('0x7f')]()[_0x5497('0x80')](_0x5497('0xaa'))['from'](_0x5497('0xa0'))[_0x5497('0x46')](_0x5497('0x86'),_0x34477e[_0x5497('0x4b')]['id'][_0x5497('0x89')]())))[_0x5497('0x89')]();break;case _0x5497('0xab'):_0x2cc264=squel[_0x5497('0x9e')]()[_0x5497('0x9f')](_0x5497('0xa0'))[_0x5497('0xa1')](['phone',_0x5497('0xa3'),_0x5497('0xa4'),'ListId','VoiceQueueId','createdAt',_0x5497('0x58')],squel['select']()[_0x5497('0x80')](_0x5497('0xa2'),_0x5497('0xa2'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27','scheduledAt')[_0x5497('0x80')]('id',_0x5497('0xa4'))[_0x5497('0x80')](_0x221f31['CmListId'][_0x5497('0x89')](),'ListId')[_0x5497('0x80')](_0x34477e[_0x5497('0x4b')]['id'][_0x5497('0x89')](),'VoiceQueueId')['field']('\x27'+_0x9a27e5+'\x27',_0x5497('0x57'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27','updatedAt')['from']('cm_contacts')[_0x5497('0x46')](_0x5497('0xa6'))[_0x5497('0x46')](_0x5497('0xa7'),_0x221f31[_0x5497('0xa8')][_0x5497('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x5497('0x46')](_0x5497('0xa9'),squel['select']()[_0x5497('0x80')](_0x5497('0xaa'))[_0x5497('0x81')](_0x5497('0xa0'))[_0x5497('0x46')](_0x5497('0x86'),_0x34477e[_0x5497('0x4b')]['id'][_0x5497('0x89')]())))[_0x5497('0x89')]();break;default:_0x2cc264=squel[_0x5497('0x9e')]()[_0x5497('0x9f')](_0x5497('0xa0'))[_0x5497('0xa1')](['phone',_0x5497('0xa3'),_0x5497('0xa4'),_0x5497('0xa5'),_0x5497('0x60'),_0x5497('0x57'),_0x5497('0x58')],squel[_0x5497('0x7f')]()[_0x5497('0x80')]('phone','phone')['field']('\x27'+_0x9a27e5+'\x27',_0x5497('0xa3'))['field']('id','ContactId')[_0x5497('0x80')](_0x221f31[_0x5497('0xa8')][_0x5497('0x89')](),_0x5497('0xa5'))['field'](_0x34477e['params']['id'][_0x5497('0x89')](),_0x5497('0x60'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27',_0x5497('0x57'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27',_0x5497('0x58'))[_0x5497('0x81')](_0x5497('0xac'))['where'](_0x5497('0xa6'))[_0x5497('0x46')](_0x5497('0xa7'),_0x221f31[_0x5497('0xa8')][_0x5497('0x89')]())[_0x5497('0x46')](_0x5497('0xad')))[_0x5497('0x89')]();}_0x55e20d[_0x5497('0x87')](db[_0x5497('0x88')][_0x5497('0x3c')](_0x2cc264));}return BPromise[_0x5497('0x8e')](_0x55e20d);}})[_0x5497('0x29')](function(){var _0x47fff0=[];var _0x1d7bbe=squel['insert']()[_0x5497('0x9f')]('cm_hopper_additional_phones')[_0x5497('0xa1')]([_0x5497('0xae'),_0x5497('0xa2'),_0x5497('0xaf'),'createdAt',_0x5497('0x58')],squel[_0x5497('0x7f')]()[_0x5497('0x80')](_0x5497('0xb0'))[_0x5497('0x80')](_0x5497('0xb1'))[_0x5497('0x80')](_0x5497('0xb2'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27',_0x5497('0x57'))[_0x5497('0x80')]('\x27'+_0x9a27e5+'\x27','updatedAt')[_0x5497('0x81')](_0x5497('0xb3'),'ci')[_0x5497('0x83')](_0x5497('0xa0'),'h',_0x5497('0xb4'))[_0x5497('0x46')](_0x5497('0xb5'),_0x9a27e5)[_0x5497('0x46')](_0x5497('0xb6'),'PHONE'))[_0x5497('0x89')]();_0x47fff0[_0x5497('0x87')](db[_0x5497('0x88')][_0x5497('0x3c')](_0x1d7bbe));return BPromise[_0x5497('0x8e')](_0x47fff0);})[_0x5497('0x29')](function(){return _0x32bdf1;})['then'](respondWithResult(_0x50d866,null))[_0x5497('0x4f')](handleError(_0x50d866,null));};exports[_0x5497('0xb7')]=function(_0x52e20f,_0x2b6c18,_0x1abf52){return db[_0x5497('0x38')][_0x5497('0x4e')]({'where':{'id':_0x52e20f[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x2b6c18,null))[_0x5497('0x29')](function(_0x23f3c3){if(_0x23f3c3){return _0x23f3c3[_0x5497('0xb7')](_0x52e20f[_0x5497('0x3c')][_0x5497('0x7e')]);}})[_0x5497('0x29')](function(_0x43d177){if(_0x43d177){return db[_0x5497('0x61')][_0x5497('0x2a')]({'where':{'ListId':_0x52e20f[_0x5497('0x3c')][_0x5497('0x7e')],'VoiceQueueId':_0x52e20f[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](function(){return _0x43d177;});}})['then'](respondWithStatusCode(_0x2b6c18,null))[_0x5497('0x4f')](handleError(_0x2b6c18,null));};exports[_0x5497('0xb8')]=function(_0x6d4dce,_0x4e9070,_0x59b5e9){var _0x25f8da={};var _0x4bdd3c={};var _0x39ecf7;var _0x41eb15;return db['VoiceQueue'][_0x5497('0x63')]({'where':{'id':_0x6d4dce['params']['id']}})['then'](handleEntityNotFound(_0x4e9070,null))[_0x5497('0x29')](function(_0x40f785){if(_0x40f785){_0x39ecf7=_0x40f785;_0x4bdd3c[_0x5497('0x3f')]=_['keys'](db[_0x5497('0x99')][_0x5497('0x39')]);_0x4bdd3c[_0x5497('0x3c')]=_[_0x5497('0x4c')](_0x6d4dce[_0x5497('0x3c')]);_0x4bdd3c['filters']=_[_0x5497('0x3e')](_0x4bdd3c[_0x5497('0x3f')],_0x4bdd3c[_0x5497('0x3c')]);_0x25f8da[_0x5497('0x40')]=_[_0x5497('0x3e')](_0x4bdd3c['model'],qs[_0x5497('0x41')](_0x6d4dce[_0x5497('0x3c')][_0x5497('0x41')]));_0x25f8da[_0x5497('0x40')]=_0x25f8da[_0x5497('0x40')][_0x5497('0x42')]?_0x25f8da[_0x5497('0x40')]:_0x4bdd3c[_0x5497('0x3f')];_0x25f8da[_0x5497('0x44')]=qs[_0x5497('0x45')](_0x6d4dce[_0x5497('0x3c')][_0x5497('0x45')]);_0x25f8da[_0x5497('0x46')]=qs['filters'](_[_0x5497('0x5f')](_0x6d4dce[_0x5497('0x3c')],_0x4bdd3c[_0x5497('0x3d')]));if(_0x6d4dce[_0x5497('0x3c')]['filter']){_0x25f8da['where']=_[_0x5497('0x47')](_0x25f8da[_0x5497('0x46')],{'$or':_['map'](_0x25f8da[_0x5497('0x40')],function(_0x3aa687){var _0x33db5b={};_0x33db5b[_0x3aa687]={'$like':'%'+_0x6d4dce[_0x5497('0x3c')][_0x5497('0x2d')]+'%'};return _0x33db5b;})});}_0x25f8da=_[_0x5497('0x47')]({},_0x25f8da,_0x6d4dce[_0x5497('0x48')]);return _0x39ecf7[_0x5497('0xb8')](_0x25f8da);}})['then'](function(_0x3bd65d){if(_0x3bd65d){_0x41eb15=_0x3bd65d[_0x5497('0x42')];if(!_0x6d4dce[_0x5497('0x3c')][_0x5497('0x5e')]('nolimit')){_0x25f8da[_0x5497('0x22')]=qs[_0x5497('0x22')](_0x6d4dce['query']['limit']);_0x25f8da[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x6d4dce[_0x5497('0x3c')][_0x5497('0x21')]);}return _0x39ecf7[_0x5497('0xb8')](_0x25f8da);}})[_0x5497('0x29')](function(_0x53454a){if(_0x53454a){return _0x53454a?{'count':_0x41eb15,'rows':_0x53454a}:null;}})[_0x5497('0x29')](respondWithResult(_0x4e9070,null))[_0x5497('0x4f')](handleError(_0x4e9070,null));};exports[_0x5497('0xb9')]=function(_0x3c8b98,_0x410e61,_0x2293e2){var _0xae08ab,_0x154445;return db[_0x5497('0x38')][_0x5497('0x4e')]({'where':{'id':_0x3c8b98['params']['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x410e61,null))[_0x5497('0x29')](function(_0x55a872){if(_0x55a872){_0x154445=_0x55a872;return _0x55a872[_0x5497('0xb9')](_0x3c8b98[_0x5497('0x50')][_0x5497('0x7e')],_[_0x5497('0x56')](_0x3c8b98[_0x5497('0x50')],[_0x5497('0x7e'),'id'])||{});}return null;})['spread'](function(_0x29fce9){var _0x29aa6c;_0xae08ab=_0x29fce9||[];var _0x348139=[];if(_0x29fce9){for(var _0x1d9a73=0x0;_0x1d9a73<_0x29fce9[_0x5497('0x42')];_0x1d9a73+=0x1){var _0xa0d2b4=_0x29fce9[_0x1d9a73]['get']({'plain':!![]});_0x29aa6c=squel[_0x5497('0x9e')]()[_0x5497('0x9f')]('cm_hopper_black')[_0x5497('0xa1')]([_0x5497('0xa2'),'ContactId',_0x5497('0xa5'),_0x5497('0x60'),_0x5497('0x57'),_0x5497('0x58')],squel['select']()[_0x5497('0x80')](_0x5497('0xa2'),_0x5497('0xa2'))['field']('id',_0x5497('0xa4'))[_0x5497('0x80')](_0xa0d2b4['CmListId'][_0x5497('0x89')](),_0x5497('0xa5'))[_0x5497('0x80')](_0x3c8b98[_0x5497('0x4b')]['id'][_0x5497('0x89')](),_0x5497('0x60'))[_0x5497('0x80')](_0x5497('0xba'),_0x5497('0x57'))[_0x5497('0x80')]('NOW()','updatedAt')[_0x5497('0x81')](_0x5497('0xac'))['where'](_0x5497('0xa6'))[_0x5497('0x46')](_0x5497('0xa7'),_0xa0d2b4['CmListId'][_0x5497('0x89')]())[_0x5497('0x46')](_0x5497('0xad')))[_0x5497('0x89')]();_0x348139[_0x5497('0x87')](db[_0x5497('0x88')][_0x5497('0x3c')](_0x29aa6c));}return BPromise[_0x5497('0x8e')](_0x348139);}})[_0x5497('0x29')](function(){return _0xae08ab;})[_0x5497('0x29')](respondWithResult(_0x410e61,null))[_0x5497('0x4f')](handleError(_0x410e61,null));};exports['removeBlackLists']=function(_0x1821e6,_0x4902ff,_0x5c7a8a){return db['VoiceQueue'][_0x5497('0x4e')]({'where':{'id':_0x1821e6[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](handleEntityNotFound(_0x4902ff,null))[_0x5497('0x29')](function(_0x39ecdf){if(_0x39ecdf){return _0x39ecdf[_0x5497('0xbb')](_0x1821e6[_0x5497('0x3c')][_0x5497('0x7e')]);}})[_0x5497('0x29')](function(_0x1eddcc){if(_0x1eddcc){return db[_0x5497('0x68')][_0x5497('0x2a')]({'where':{'ListId':_0x1821e6[_0x5497('0x3c')][_0x5497('0x7e')],'VoiceQueueId':_0x1821e6[_0x5497('0x4b')]['id']}})[_0x5497('0x29')](function(){return _0x1eddcc;});}})['then'](respondWithStatusCode(_0x4902ff,null))[_0x5497('0x4f')](handleError(_0x4902ff,null));};
\ No newline at end of file
+var _0x326f=['VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','destroy','then','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','VoiceQueue','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','clone','options','omit','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','isNil','all','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x5fcf03,_0x127ac4){var _0x9399=function(_0xef7ac0){while(--_0xef7ac0){_0x5fcf03['push'](_0x5fcf03['shift']());}};_0x9399(++_0x127ac4);}(_0x326f,0xd1));var _0xf326=function(_0x28e8bc,_0x5b222f){_0x28e8bc=_0x28e8bc-0x0;var _0x9fe7f8=_0x326f[_0x28e8bc];return _0x9fe7f8;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);function respondWithStatusCode(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xcc;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1c')](_0x5204ee);}return _0x45c1b6[_0xf326('0x1d')](_0x5204ee)[_0xf326('0x1e')]();};}function respondWithResult(_0xa63d1a,_0x292f4b){_0x292f4b=_0x292f4b||0xc8;return function(_0x287a2a){if(_0x287a2a){return _0xa63d1a[_0xf326('0x1d')](_0x292f4b)[_0xf326('0x1f')](_0x287a2a);}};}function respondWithFilteredResult(_0x5a682a,_0x3ad7da){return function(_0x453100){if(_0x453100){var _0x18bee3=typeof _0x3ad7da[_0xf326('0x20')]===_0xf326('0x21')&&typeof _0x3ad7da[_0xf326('0x22')]==='undefined';var _0x4a5b6c=_0x453100['count'];var _0x16e605=_0x18bee3?0x0:_0x3ad7da[_0xf326('0x20')];var _0x484cbe=_0x18bee3?_0x453100['count']:_0x3ad7da[_0xf326('0x20')]+_0x3ad7da['limit'];var _0x5b6d3c;if(_0x484cbe>=_0x4a5b6c){_0x484cbe=_0x4a5b6c;_0x5b6d3c=0xc8;}else{_0x5b6d3c=0xce;}_0x5a682a[_0xf326('0x1d')](_0x5b6d3c);return _0x5a682a[_0xf326('0x23')]('Content-Range',_0x16e605+'-'+_0x484cbe+'/'+_0x4a5b6c)['json'](_0x453100);}return null;};}function patchUpdates(_0x19b8ba){return function(_0xb1efcf){try{jsonpatch['apply'](_0xb1efcf,_0x19b8ba,!![]);}catch(_0x337ed5){return BPromise[_0xf326('0x24')](_0x337ed5);}return _0xb1efcf[_0xf326('0x25')]();};}function saveUpdates(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['update'](_0x295752)['then'](function(_0x4f31f6){return _0x4f31f6;});}return null;};}function removeEntity(_0x520d85,_0x1a2c4e){return function(_0x2cd45a){if(_0x2cd45a){return _0x2cd45a[_0xf326('0x26')]()[_0xf326('0x27')](function(){var _0x410237=_0x2cd45a['get']({'plain':!![]});var _0x201d28=[{'name':_0xf326('0x28'),'value':_0xf326('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf326('0x2a'),'ignore':![]}];var _0x55ad0f=_(_0x201d28)['filter'](_0xf326('0x2b'))[_0xf326('0x2c')](_0xf326('0x2d'))['value']();if(_[_0xf326('0x2e')](_0x55ad0f,_0x410237[_0xf326('0x2f')])){return;}var _0x55790d=_[_0xf326('0x30')](_0x201d28,[_0xf326('0x2d'),_0x410237[_0xf326('0x2f')]])[_0xf326('0x31')];return db[_0xf326('0x32')][_0xf326('0x26')]({'where':{'type':_0x55790d,'resourceId':_0x410237['id']}})[_0xf326('0x27')](function(){return _0x2cd45a;});})[_0xf326('0x27')](function(){_0x520d85[_0xf326('0x1d')](0xcc)[_0xf326('0x1e')]();});}};}function handleEntityNotFound(_0x4b52f2,_0x1035ed){return function(_0x424104){if(!_0x424104){_0x4b52f2[_0xf326('0x1c')](0x194);}return _0x424104;};}function handleError(_0x4792d2,_0x2c0cac){_0x2c0cac=_0x2c0cac||0x1f4;return function(_0x1721fd){logger[_0xf326('0x33')](_0x1721fd['stack']);if(_0x1721fd['name']){delete _0x1721fd[_0xf326('0x31')];}_0x4792d2[_0xf326('0x1d')](_0x2c0cac)[_0xf326('0x34')](_0x1721fd);};}exports[_0xf326('0x35')]=function(_0x30694f,_0x2e8a64){var _0x62585a={},_0x2d5f20={},_0x580374={'count':0x0,'rows':[]};var _0x461e93=_[_0xf326('0x2c')](db['VoiceQueue'][_0xf326('0x36')],function(_0x4e5d7c){return{'name':_0x4e5d7c[_0xf326('0x37')],'type':_0x4e5d7c['type']['key']};});_0x2d5f20[_0xf326('0x38')]=_['map'](_0x461e93,_0xf326('0x31'));_0x2d5f20['query']=_[_0xf326('0x39')](_0x30694f[_0xf326('0x3a')]);_0x2d5f20[_0xf326('0x3b')]=_['intersection'](_0x2d5f20[_0xf326('0x38')],_0x2d5f20[_0xf326('0x3a')]);_0x62585a['attributes']=_[_0xf326('0x3c')](_0x2d5f20[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x30694f[_0xf326('0x3a')]['fields']));_0x62585a[_0xf326('0x3e')]=_0x62585a[_0xf326('0x3e')][_0xf326('0x3f')]?_0x62585a[_0xf326('0x3e')]:_0x2d5f20[_0xf326('0x38')];if(!_0x30694f['query'][_0xf326('0x40')](_0xf326('0x41'))){_0x62585a['limit']=qs['limit'](_0x30694f[_0xf326('0x3a')]['limit']);_0x62585a['offset']=qs[_0xf326('0x20')](_0x30694f['query'][_0xf326('0x20')]);}_0x62585a[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x30694f[_0xf326('0x3a')]['sort']);_0x62585a[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x30694f[_0xf326('0x3a')],_0x2d5f20[_0xf326('0x3b')]),_0x461e93);if(_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]){_0x62585a[_0xf326('0x44')]=_[_0xf326('0x47')](_0x62585a[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x461e93,function(_0x2bab13){if(_0x2bab13['type']!==_0xf326('0x48')){var _0x1637dc={};_0x1637dc[_0x2bab13[_0xf326('0x31')]]={'$like':'%'+_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1637dc;}})});}_0x62585a=_[_0xf326('0x47')]({},_0x62585a,_0x30694f['options']);var _0x28e2d3={'where':_0x62585a[_0xf326('0x44')]};return db['VoiceQueue'][_0xf326('0x49')](_0x28e2d3)[_0xf326('0x27')](function(_0x130c56){_0x580374[_0xf326('0x49')]=_0x130c56;if(_0x30694f[_0xf326('0x3a')]['includeAll']){_0x62585a['include']=[{'all':!![]}];}return db[_0xf326('0x4a')][_0xf326('0x4b')](_0x62585a);})['then'](function(_0x4bd865){_0x580374[_0xf326('0x4c')]=_0x4bd865;return _0x580374;})[_0xf326('0x27')](respondWithFilteredResult(_0x2e8a64,_0x62585a))[_0xf326('0x4d')](handleError(_0x2e8a64,null));};exports['show']=function(_0x301e65,_0xe96e1e){var _0x2180d6={'raw':![],'where':{'id':_0x301e65[_0xf326('0x4e')]['id']}},_0xc43507={};_0xc43507[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xc43507[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x301e65[_0xf326('0x3a')]);_0xc43507[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],_0xc43507['query']);_0x2180d6[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x301e65['query'][_0xf326('0x3d')]));_0x2180d6[_0xf326('0x3e')]=_0x2180d6[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2180d6['attributes']:_0xc43507[_0xf326('0x38')];if(_0x301e65[_0xf326('0x3a')][_0xf326('0x4f')]){_0x2180d6[_0xf326('0x50')]=[{'all':!![]}];}_0x2180d6=_[_0xf326('0x47')]({},_0x2180d6,_0x301e65['options']);return db['VoiceQueue'][_0xf326('0x30')](_0x2180d6)[_0xf326('0x27')](handleEntityNotFound(_0xe96e1e,null))[_0xf326('0x27')](respondWithResult(_0xe96e1e,null))['catch'](handleError(_0xe96e1e,null));};exports[_0xf326('0x51')]=function(_0x4650db,_0x44eab7){return db['VoiceQueue']['create'](_0x4650db[_0xf326('0x52')],{})['then'](function(_0x1cf58f){var _0x554277=_0x4650db[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x554277)throw new Error(_0xf326('0x55'));if(_0x554277[_0xf326('0x56')]===_0xf326('0x53')){var _0x35d3c8=_0x1cf58f[_0xf326('0x54')]({'plain':!![]});var _0x495a16=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':'outbound'}];var _0x208ba4=_[_0xf326('0x30')](_0x495a16,[_0xf326('0x2d'),_0x35d3c8[_0xf326('0x2f')]])[_0xf326('0x31')];return db['UserProfileSection'][_0xf326('0x30')]({'where':{'name':_0x208ba4,'userProfileId':_0x554277[_0xf326('0x58')]},'raw':!![]})[_0xf326('0x27')](function(_0x46a21f){if(_0x46a21f&&_0x46a21f['autoAssociation']===0x0){return db[_0xf326('0x32')][_0xf326('0x51')]({'name':_0x35d3c8[_0xf326('0x31')],'resourceId':_0x35d3c8['id'],'type':_0x46a21f[_0xf326('0x31')],'sectionId':_0x46a21f['id']},{})['then'](function(){return _0x1cf58f;});}else{return _0x1cf58f;}})['catch'](function(_0x18b46e){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18b46e);throw _0x18b46e;});}return _0x1cf58f;})[_0xf326('0x27')](respondWithResult(_0x44eab7,0xc9))[_0xf326('0x4d')](handleError(_0x44eab7,null));};exports[_0xf326('0x59')]=function(_0x1258d1,_0x5765b0){var _0xb1c18c={'where':{'id':_0x1258d1['params']['id']}},_0x5657b7={};_0x5657b7[_0xf326('0x38')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xb1c18c[_0xf326('0x3e')]=_['intersection'](_0x5657b7['model'],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x3a')][_0xf326('0x3d')]));_0xb1c18c['attributes']=_0xb1c18c[_0xf326('0x3e')]['length']?_0xb1c18c[_0xf326('0x3e')]:_0x5657b7[_0xf326('0x38')];if(_0x1258d1[_0xf326('0x3a')][_0xf326('0x4f')]){_0xb1c18c[_0xf326('0x50')]=[{'all':!![]}];}_0xb1c18c=_[_0xf326('0x47')]({},_0xb1c18c,_0x1258d1[_0xf326('0x5a')]);return db[_0xf326('0x4a')][_0xf326('0x30')](_0xb1c18c)[_0xf326('0x27')](handleEntityNotFound(_0x5765b0,null))[_0xf326('0x27')](function(_0x1e56fb){if(_0x1e56fb){var _0x40f7cb=_0x1e56fb['get']({'plain':!![]});_0x40f7cb=qs[_0xf326('0x5b')](_0x40f7cb,['id','createdAt',_0xf326('0x5c')]);_0x1258d1[_0xf326('0x52')]=_['omit'](_0x1258d1[_0xf326('0x52')],['id','createdAt',_0xf326('0x5c')]);return db[_0xf326('0x4a')][_0xf326('0x51')](_[_0xf326('0x47')](_0x40f7cb,_0x1258d1[_0xf326('0x52')]),{'include':_0x1258d1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf326('0x27')](function(_0x32fe3a){var _0x15a538=_0x1258d1[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x15a538)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a538[_0xf326('0x56')]===_0xf326('0x53')){var _0x4aadc9=_0x32fe3a['get']({'plain':!![]});var _0x5b25ca=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':_0xf326('0x2a')}];var _0x240ce5=_[_0xf326('0x30')](_0x5b25ca,[_0xf326('0x2d'),_0x4aadc9['type']])[_0xf326('0x31')];return db[_0xf326('0x5d')][_0xf326('0x30')]({'where':{'name':_0x240ce5,'userProfileId':_0x15a538[_0xf326('0x58')]},'raw':!![]})['then'](function(_0x3717fe){if(_0x3717fe&&_0x3717fe['autoAssociation']===0x0){return db['UserProfileResource'][_0xf326('0x51')]({'name':_0x4aadc9['name'],'resourceId':_0x4aadc9['id'],'type':_0x3717fe[_0xf326('0x31')],'sectionId':_0x3717fe['id']},{})[_0xf326('0x27')](function(){return _0x32fe3a;});}else{return _0x32fe3a;}})[_0xf326('0x4d')](function(_0x2ea5a2){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea5a2);throw _0x2ea5a2;});}return _0x32fe3a;});}})['then'](respondWithResult(_0x5765b0,0xc9))['catch'](handleError(_0x5765b0,null));};exports[_0xf326('0x5e')]=function(_0x307441,_0x229a34){if(_0x307441[_0xf326('0x52')]['id']){delete _0x307441[_0xf326('0x52')]['id'];}return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x307441[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x229a34,null))['then'](saveUpdates(_0x307441['body'],null))[_0xf326('0x27')](respondWithResult(_0x229a34,null))[_0xf326('0x4d')](handleError(_0x229a34,null));};exports['destroy']=function(_0x4bf1bf,_0x2497fd){return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x4bf1bf['params']['id']}})['then'](handleEntityNotFound(_0x2497fd,null))['then'](removeEntity(_0x2497fd,null))[_0xf326('0x4d')](handleError(_0x2497fd,null));};exports[_0xf326('0x5f')]=function(_0xd44071,_0x4838d5,_0x1cf9a8){var _0xdeceb9={'raw':![],'where':{}};var _0x35e34d={};var _0x457f3d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0xd44071[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4838d5,null))[_0xf326('0x27')](function(_0x5290da){if(_0x5290da){_0x35e34d[_0xf326('0x38')]=_['keys'](db[_0xf326('0x61')][_0xf326('0x36')]);_0x35e34d[_0xf326('0x3a')]=_['keys'](_0xd44071[_0xf326('0x3a')]);_0x35e34d[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x35e34d['model'],_0x35e34d[_0xf326('0x3a')]);_0xdeceb9[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x35e34d[_0xf326('0x38')],qs['fields'](_0xd44071[_0xf326('0x3a')]['fields']));_0xdeceb9['attributes']=_0xdeceb9[_0xf326('0x3e')][_0xf326('0x3f')]?_0xdeceb9['attributes']:_0x35e34d['model'];if(!_0xd44071['query'][_0xf326('0x40')]('nolimit')){_0xdeceb9[_0xf326('0x22')]=qs[_0xf326('0x22')](_0xd44071[_0xf326('0x3a')][_0xf326('0x22')]);_0xdeceb9[_0xf326('0x20')]=qs[_0xf326('0x20')](_0xd44071['query'][_0xf326('0x20')]);}_0xdeceb9[_0xf326('0x42')]=qs['sort'](_0xd44071['query'][_0xf326('0x43')]);_0xdeceb9['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0xd44071[_0xf326('0x3a')],_0x35e34d[_0xf326('0x3b')]));_0xdeceb9[_0xf326('0x44')][_0xf326('0x62')]=_0x5290da['id'];if(_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]){_0xdeceb9[_0xf326('0x44')]=_['merge'](_0xdeceb9[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xdeceb9['attributes'],function(_0x3c82cf){var _0x5b0f2d={};_0x5b0f2d[_0x3c82cf]={'$like':'%'+_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5b0f2d;})});}_0xdeceb9=_[_0xf326('0x47')]({},_0xdeceb9,_0xd44071['options']);return db[_0xf326('0x61')][_0xf326('0x49')]({'where':_0xdeceb9[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x30e096){_0x457f3d[_0xf326('0x49')]=_0x30e096;if(_0xd44071[_0xf326('0x3a')][_0xf326('0x4f')]){_0xdeceb9[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x61')][_0xf326('0x4b')](_0xdeceb9);})[_0xf326('0x27')](function(_0x452e28){_0x457f3d[_0xf326('0x4c')]=_0x452e28;return _0x457f3d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4838d5,_0xdeceb9))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x63')]=function(_0x24aaca,_0x4829ae,_0x438daa){var _0x424be4={'raw':!![],'where':{}};var _0x5c1686={};var _0x80fce5={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x24aaca[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4829ae,null))[_0xf326('0x27')](function(_0x1bb7cc){if(_0x1bb7cc){_0x5c1686['model']=_[_0xf326('0x39')](db[_0xf326('0x64')][_0xf326('0x36')]);_0x5c1686[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x24aaca[_0xf326('0x3a')]);_0x5c1686[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5c1686['model'],_0x5c1686[_0xf326('0x3a')]);_0x424be4[_0xf326('0x3e')]=_['intersection'](_0x5c1686[_0xf326('0x38')],qs['fields'](_0x24aaca[_0xf326('0x3a')][_0xf326('0x3d')]));_0x424be4[_0xf326('0x3e')]=_0x424be4[_0xf326('0x3e')][_0xf326('0x3f')]?_0x424be4[_0xf326('0x3e')]:_0x5c1686[_0xf326('0x38')];if(!_0x24aaca[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x424be4[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x22')]);_0x424be4['offset']=qs[_0xf326('0x20')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x20')]);}_0x424be4[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x24aaca['query'][_0xf326('0x43')]);_0x424be4[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x24aaca[_0xf326('0x3a')],_0x5c1686['filters']));_0x424be4['where'][_0xf326('0x62')]=_0x1bb7cc['id'];if(_0x24aaca['query'][_0xf326('0x46')]){_0x424be4[_0xf326('0x44')]=_[_0xf326('0x47')](_0x424be4['where'],{'$or':_['map'](_0x424be4[_0xf326('0x3e')],function(_0x2d92e4){var _0x167ac9={};_0x167ac9[_0x2d92e4]={'$like':'%'+_0x24aaca[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x167ac9;})});}_0x424be4=_['merge']({},_0x424be4,_0x24aaca[_0xf326('0x5a')]);return db[_0xf326('0x64')][_0xf326('0x49')]({'where':_0x424be4['where']})['then'](function(_0x47a35b){_0x80fce5[_0xf326('0x49')]=_0x47a35b;if(_0x24aaca[_0xf326('0x3a')][_0xf326('0x4f')]){_0x424be4[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x64')][_0xf326('0x4b')](_0x424be4);})[_0xf326('0x27')](function(_0x598a93){_0x80fce5['rows']=_0x598a93;return _0x80fce5;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4829ae,_0x424be4))[_0xf326('0x4d')](handleError(_0x4829ae,null));};exports[_0xf326('0x65')]=function(_0x571b8c,_0xd85b34,_0x39bdde){var _0x1746af={'raw':!![],'where':{}};var _0x597005={};var _0x39d16d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x571b8c[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd85b34,null))['then'](function(_0x5a7af3){if(_0x5a7af3){_0x597005[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x66')]['rawAttributes']);_0x597005[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x571b8c[_0xf326('0x3a')]);_0x597005['filters']=_[_0xf326('0x3c')](_0x597005[_0xf326('0x38')],_0x597005[_0xf326('0x3a')]);_0x1746af[_0xf326('0x3e')]=_['intersection'](_0x597005[_0xf326('0x38')],qs['fields'](_0x571b8c[_0xf326('0x3a')][_0xf326('0x3d')]));_0x1746af[_0xf326('0x3e')]=_0x1746af[_0xf326('0x3e')]['length']?_0x1746af[_0xf326('0x3e')]:_0x597005['model'];if(!_0x571b8c[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x1746af[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x571b8c['query']['limit']);_0x1746af[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x571b8c[_0xf326('0x3a')][_0xf326('0x20')]);}_0x1746af['order']=qs[_0xf326('0x43')](_0x571b8c['query'][_0xf326('0x43')]);_0x1746af[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x571b8c[_0xf326('0x3a')],_0x597005[_0xf326('0x3b')]));_0x1746af[_0xf326('0x44')][_0xf326('0x62')]=_0x5a7af3['id'];if(_0x571b8c[_0xf326('0x3a')]['filter']){_0x1746af[_0xf326('0x44')]=_[_0xf326('0x47')](_0x1746af['where'],{'$or':_[_0xf326('0x2c')](_0x1746af[_0xf326('0x3e')],function(_0x306fc9){var _0x6dad26={};_0x6dad26[_0x306fc9]={'$like':'%'+_0x571b8c['query']['filter']+'%'};return _0x6dad26;})});}_0x1746af=_[_0xf326('0x47')]({},_0x1746af,_0x571b8c[_0xf326('0x5a')]);return db['CmHopperFinal'][_0xf326('0x49')]({'where':_0x1746af['where']})['then'](function(_0x4cad0){_0x39d16d[_0xf326('0x49')]=_0x4cad0;if(_0x571b8c[_0xf326('0x3a')][_0xf326('0x4f')]){_0x1746af[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x66')][_0xf326('0x4b')](_0x1746af);})[_0xf326('0x27')](function(_0xc9dead){_0x39d16d['rows']=_0xc9dead;return _0x39d16d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0xd85b34,_0x1746af))[_0xf326('0x4d')](handleError(_0xd85b34,null));};exports[_0xf326('0x67')]=function(_0x1c7f81,_0x59d894,_0x3e6a5d){var _0x20020c={'raw':!![],'where':{}};var _0xc94723={};var _0x750d55={'count':0x0,'rows':[]};return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1c7f81[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59d894,null))[_0xf326('0x27')](function(_0x14d255){if(_0x14d255){_0xc94723[_0xf326('0x38')]=_[_0xf326('0x39')](db['CmHopperBlack'][_0xf326('0x36')]);_0xc94723[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x1c7f81['query']);_0xc94723[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],_0xc94723[_0xf326('0x3a')]);_0x20020c['attributes']=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1c7f81[_0xf326('0x3a')]['fields']));_0x20020c[_0xf326('0x3e')]=_0x20020c[_0xf326('0x3e')][_0xf326('0x3f')]?_0x20020c['attributes']:_0xc94723[_0xf326('0x38')];if(!_0x1c7f81[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x41'))){_0x20020c[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x22')]);_0x20020c[_0xf326('0x20')]=qs['offset'](_0x1c7f81['query'][_0xf326('0x20')]);}_0x20020c[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x43')]);_0x20020c[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1c7f81[_0xf326('0x3a')],_0xc94723[_0xf326('0x3b')]));_0x20020c[_0xf326('0x44')][_0xf326('0x62')]=_0x14d255['id'];if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x46')]){_0x20020c[_0xf326('0x44')]=_[_0xf326('0x47')](_0x20020c['where'],{'$or':_[_0xf326('0x2c')](_0x20020c['attributes'],function(_0x590dc0){var _0x32fc6e={};_0x32fc6e[_0x590dc0]={'$like':'%'+_0x1c7f81['query'][_0xf326('0x46')]+'%'};return _0x32fc6e;})});}_0x20020c=_[_0xf326('0x47')]({},_0x20020c,_0x1c7f81[_0xf326('0x5a')]);return db[_0xf326('0x68')][_0xf326('0x49')]({'where':_0x20020c[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x18b3cc){_0x750d55[_0xf326('0x49')]=_0x18b3cc;if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x4f')]){_0x20020c[_0xf326('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf326('0x4b')](_0x20020c);})[_0xf326('0x27')](function(_0x5657){_0x750d55[_0xf326('0x4c')]=_0x5657;return _0x750d55;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x59d894,_0x20020c))[_0xf326('0x4d')](handleError(_0x59d894,null));};exports[_0xf326('0x69')]=function(_0x5429a2,_0x448d10,_0x15f799){var _0x320ab3={};var _0x316877={};var _0x79faa1;var _0x14259b;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x5429a2[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x448d10,null))[_0xf326('0x27')](function(_0x9a0455){if(_0x9a0455){_0x79faa1=_0x9a0455;_0x316877[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x6a')][_0xf326('0x36')]);_0x316877[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x5429a2[_0xf326('0x3a')]);_0x316877[_0xf326('0x3b')]=_['intersection'](_0x316877[_0xf326('0x38')],_0x316877[_0xf326('0x3a')]);_0x320ab3[_0xf326('0x3e')]=_['intersection'](_0x316877['model'],qs[_0xf326('0x3d')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x3d')]));_0x320ab3[_0xf326('0x3e')]=_0x320ab3['attributes'][_0xf326('0x3f')]?_0x320ab3[_0xf326('0x3e')]:_0x316877[_0xf326('0x38')];_0x320ab3['order']=qs['sort'](_0x5429a2['query'][_0xf326('0x43')]);_0x320ab3[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x5429a2[_0xf326('0x3a')],_0x316877['filters']));if(_0x5429a2[_0xf326('0x3a')]['filter']){_0x320ab3[_0xf326('0x44')]=_[_0xf326('0x47')](_0x320ab3[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x320ab3[_0xf326('0x3e')],function(_0x3dcaf9){var _0x1f05a2={};_0x1f05a2[_0x3dcaf9]={'$like':'%'+_0x5429a2[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1f05a2;})});}_0x320ab3=_[_0xf326('0x47')]({},_0x320ab3,_0x5429a2[_0xf326('0x5a')]);return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})[_0xf326('0x27')](function(_0x3dc3c5){if(_0x3dc3c5){_0x14259b=_0x3dc3c5['length'];if(!_0x5429a2[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x320ab3['limit']=qs['limit'](_0x5429a2['query'][_0xf326('0x22')]);_0x320ab3[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})['then'](function(_0x1aeaf9){if(_0x1aeaf9){return _0x1aeaf9?{'count':_0x14259b,'rows':_0x1aeaf9}:null;}})[_0xf326('0x27')](respondWithResult(_0x448d10,null))[_0xf326('0x4d')](handleError(_0x448d10,null));};exports[_0xf326('0x6b')]=function(_0x71e344,_0x5cac48,_0x10f5cb){var _0x44c4bb=_0x71e344[_0xf326('0x52')][_0xf326('0x6c')];var _0x350d76=_['map'](_0x44c4bb,'id');return db['Team'][_0xf326('0x4b')]({'where':{'id':_0x350d76},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf326('0x31'),_0xf326('0x6d'),_0xf326('0x6e'),_0xf326('0x6f')],'raw':!![]}]})[_0xf326('0x27')](function(_0x5aa1ca){if(_0x5aa1ca){var _0x51bfee=_[_0xf326('0x70')](_0x5aa1ca,function(_0x2eaf15){var _0x182080=_0x2eaf15['get']({'plain':!![]});_0x182080[_0xf326('0x71')]['forEach'](function(_0x4df691){_0x4df691['penalty']=_[_0xf326('0x30')](_0x44c4bb,{'id':_0x182080['id']})[_0xf326('0x72')];});return _0x182080[_0xf326('0x71')];});return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x71e344[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](function(_0x3833f9){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0xb4b180){return _0x3833f9['addTeams'](_0x350d76,{'transaction':_0xb4b180})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x44c4bb,function(_0x2a17bf){return db[_0xf326('0x76')][_0xf326('0x77')]({'TeamId':_0x2a17bf['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id'],'penalty':_0x2a17bf[_0xf326('0x72')]},{'transaction':_0xb4b180});});})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x51bfee,function(_0x4d5f64){return db[_0xf326('0x78')][_0xf326('0x79')]({'where':{'UserId':_0x4d5f64['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id']},'defaults':{'penalty':_0x4d5f64['penalty']},'transaction':_0xb4b180});});})['then'](function(){return BPromise[_0xf326('0x75')](_[_0xf326('0x46')](_0x51bfee,{'online':!![]}),function(_0x5efac6){return db['UserVoiceQueueRt'][_0xf326('0x77')]({'membername':_0x5efac6['name'],'UserId':_0x5efac6['id'],'queue_name':_0x3833f9[_0xf326('0x31')],'VoiceQueueId':_0x3833f9['id'],'interface':_['isNil'](_0x5efac6[_0xf326('0x6f')])?util[_0xf326('0x7a')](_0xf326('0x7b'),_0x5efac6[_0xf326('0x31')]):_0x5efac6[_0xf326('0x6f')],'paused':_0x5efac6['voicePause']||![],'penalty':_0x5efac6[_0xf326('0x72')]},{'transaction':_0xb4b180});});})['then'](function(){_0x51bfee[_0xf326('0x7c')](function(_0x3fe546){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':_0x3fe546['id'],'VoiceQueueId':_0x3833f9['id']});});});});});}})[_0xf326('0x27')](respondWithStatusCode(_0x5cac48,null))['catch'](handleError(_0x5cac48,null));};exports['removeTeams']=function(_0x1ad0df,_0x5c913c,_0x53421f){return db['Team']['findAll']({'where':{'id':_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xf326('0x80')],'as':_0xf326('0x71'),'attributes':['id'],'raw':!![]}]})[_0xf326('0x27')](handleEntityNotFound(_0x5c913c,null))[_0xf326('0x27')](function(_0xc5d45e){var _0x4feb3e=_[_0xf326('0x2c')](_0xc5d45e,'id');var _0x3e0bf4=[];var _0x72c3ed=[];var _0x4abe8a=squel[_0xf326('0x81')]();_0x4abe8a[_0xf326('0x82')](_0xf326('0x83'))[_0xf326('0x84')](_0xf326('0x85'),'tq')[_0xf326('0x86')](_0xf326('0x87'),'ut',_0xf326('0x88'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1ad0df[_0xf326('0x4e')]['id']);for(var _0x5e9650=0x0;_0x5e9650<_0xc5d45e[_0xf326('0x3f')];_0x5e9650+=0x1){let _0x500780=_0xc5d45e[_0x5e9650];for(var _0x4b537a=0x0;_0x4b537a<_0x500780[_0xf326('0x71')]['length'];_0x4b537a+=0x1){let _0x3edec1=_0x500780[_0xf326('0x71')][_0x4b537a];var _0x3dfa46=_0x4abe8a[_0xf326('0x59')]();_0x3dfa46['where'](_0xf326('0x89'),_0x3edec1['id']);_0x72c3ed[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x3dfa46['toString'](),{'type':db['sequelize'][_0xf326('0x8b')][_0xf326('0x8c')]})[_0xf326('0x27')](function(_0x160086){if(_0x160086[_0xf326('0x3f')]===0x1){return _0x3edec1['id'];}else{var _0x1acd3b=_[_0xf326('0x8d')](_[_0xf326('0x2c')](_0x160086,_0xf326('0x8e')),function(_0xa5963a){return _[_0xf326('0x2e')](_0x4feb3e,_0xa5963a);});if(_0x1acd3b){return _0x3edec1['id'];}}}));}}return BPromise['all'](_0x72c3ed)[_0xf326('0x27')](function(_0x303b42){_0x3e0bf4=_(_0x3e0bf4)[_0xf326('0x8f')](_0x303b42)['compact']()[_0xf326('0x2d')]();return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x1ad0df[_0xf326('0x4e')]['id']}})['then'](function(_0x1b6d24){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0x2d861a){return _0x1b6d24['removeTeams'](_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')],{'transaction':_0x2d861a})[_0xf326('0x27')](function(){if(!_[_0xf326('0x90')](_0x3e0bf4)){return _0x1b6d24[_0xf326('0x91')](_0x3e0bf4,{'transaction':_0x2d861a})['then'](function(){return db['UserVoiceQueueRt'][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x1ad0df[_0xf326('0x4e')]['id'],'UserId':_0x3e0bf4},'transaction':_0x2d861a});});}})[_0xf326('0x27')](function(){_0x3e0bf4[_0xf326('0x7c')](function(_0x42c8de){socket[_0xf326('0x7d')](_0xf326('0x92'),{'UserId':_0x42c8de,'VoiceQueueId':_0x1b6d24['id']});});});});});});})[_0xf326('0x27')](respondWithStatusCode(_0x5c913c,null))[_0xf326('0x4d')](handleError(_0x5c913c,null));};exports[_0xf326('0x93')]=function(_0x55d67f,_0x550bda,_0x4f14ff){var _0x8fccef,_0x190d3c;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x55d67f[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x550bda,null))[_0xf326('0x27')](function(_0xc94f1e){if(_0xc94f1e){_0x190d3c=_0xc94f1e;return _0xc94f1e[_0xf326('0x93')](_0x55d67f[_0xf326('0x52')]['ids'],_[_0xf326('0x5b')](_0x55d67f['body'],['ids','id'])||{})[_0xf326('0x94')](function(_0x2a9fd1){for(var _0x4086fa=0x0;_0x4086fa<_0x55d67f[_0xf326('0x52')][_0xf326('0x7f')]['length'];_0x4086fa+=0x1){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':Number(_0x55d67f[_0xf326('0x52')]['ids'][_0x4086fa]),'VoiceQueueId':Number(_0x55d67f[_0xf326('0x4e')]['id'])});}return _0x2a9fd1;});}})[_0xf326('0x27')](function(_0x38dbf3){_0x8fccef=_0x38dbf3||[];if(_0x190d3c){return db[_0xf326('0x80')]['findAll']({'where':{'id':_0x55d67f[_0xf326('0x52')]['ids']},'attributes':['id','name',_0xf326('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0xf326('0x27')](function(_0xbd7671){if(!_[_0xf326('0x90')](_0xbd7671)){var _0x1d2611=[];for(var _0x497d2e=0x0;_0x497d2e<_0xbd7671['length'];_0x497d2e++){if(_0xbd7671[_0x497d2e][_0xf326('0x6d')]){_0x1d2611[_0xf326('0x8a')](db[_0xf326('0x95')][_0xf326('0x77')]({'membername':_0xbd7671[_0x497d2e][_0xf326('0x31')],'UserId':_0xbd7671[_0x497d2e]['id'],'queue_name':_0x190d3c[_0xf326('0x31')],'VoiceQueueId':_0x190d3c['id'],'interface':_[_0xf326('0x96')](_0xbd7671[_0x497d2e][_0xf326('0x6f')])?util[_0xf326('0x7a')]('SIP/%s',_0xbd7671[_0x497d2e][_0xf326('0x31')]):_0xbd7671[_0x497d2e][_0xf326('0x6f')],'paused':_0xbd7671[_0x497d2e][_0xf326('0x6e')]||![],'penalty':_0x55d67f['body']['penalty']||0x0}));}}return BPromise[_0xf326('0x97')](_0x1d2611);}})[_0xf326('0x27')](function(){return _0x8fccef;})[_0xf326('0x27')](respondWithResult(_0x550bda,null))[_0xf326('0x4d')](handleError(_0x550bda,null));};exports['removeAgents']=function(_0x4f96aa,_0x5ea5d4,_0x45aae6){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x4f96aa['params']['id']}})['then'](handleEntityNotFound(_0x5ea5d4,null))[_0xf326('0x27')](function(_0x15c66f){if(_0x15c66f){return _0x15c66f[_0xf326('0x91')](_0x4f96aa['query']['ids'])['then'](function(){if(_[_0xf326('0x98')](_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')])){for(var _0x1791dd=0x0;_0x1791dd<_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')][_0xf326('0x3f')];_0x1791dd+=0x1){socket[_0xf326('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x4f96aa['query'][_0xf326('0x7f')][_0x1791dd]),'VoiceQueueId':Number(_0x4f96aa['params']['id'])});}}else{socket['emit'](_0xf326('0x92'),{'UserId':Number(_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]),'VoiceQueueId':Number(_0x4f96aa[_0xf326('0x4e')]['id'])});}});}})[_0xf326('0x27')](function(_0x1307a4){return db[_0xf326('0x95')][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x4f96aa[_0xf326('0x4e')]['id'],'UserId':_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]}})[_0xf326('0x27')](function(){return _0x1307a4;});})['then'](respondWithStatusCode(_0x5ea5d4,null))[_0xf326('0x4d')](handleError(_0x5ea5d4,null));};exports[_0xf326('0x99')]=function(_0x2b6585,_0x3d77af,_0x55e867){var _0x15e405={};var _0x27074a={};var _0x173ea9;var _0x130cbb;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x2b6585[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x3d77af,null))[_0xf326('0x27')](function(_0x28d251){if(_0x28d251){_0x173ea9=_0x28d251;_0x27074a[_0xf326('0x38')]=_['keys'](db['User'][_0xf326('0x36')]);_0x27074a[_0xf326('0x3a')]=_['keys'](_0x2b6585[_0xf326('0x3a')]);_0x27074a[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x27074a[_0xf326('0x38')],_0x27074a['query']);_0x15e405[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x27074a['model'],qs[_0xf326('0x3d')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x3d')]));_0x15e405[_0xf326('0x3e')]=_0x15e405[_0xf326('0x3e')][_0xf326('0x3f')]?_0x15e405[_0xf326('0x3e')]:_0x27074a[_0xf326('0x38')];_0x15e405[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x2b6585[_0xf326('0x3a')]['sort']);_0x15e405[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x2b6585[_0xf326('0x3a')],_0x27074a[_0xf326('0x3b')]));if(_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]){_0x15e405[_0xf326('0x44')]=_['merge'](_0x15e405[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x15e405[_0xf326('0x3e')],function(_0x12cc1d){var _0x5ae8c7={};_0x5ae8c7[_0x12cc1d]={'$like':'%'+_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5ae8c7;})});}_0x15e405=_[_0xf326('0x47')]({},_0x15e405,_0x2b6585['options']);return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x5a0c11){if(_0x5a0c11){_0x130cbb=_0x5a0c11['length'];if(!_0x2b6585[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x15e405[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x22')]);_0x15e405[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x4a0a44){if(_0x4a0a44){return _0x4a0a44?{'count':_0x130cbb,'rows':_0x4a0a44}:null;}})['then'](respondWithResult(_0x3d77af,null))[_0xf326('0x4d')](handleError(_0x3d77af,null));};exports['getMembers']=function(_0x4ab9c0,_0x531d31,_0x878991){var _0xc4aa47={};var _0x4fa6f9={};var _0x17f967;var _0x1639f2;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x4ab9c0[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x531d31,null))['then'](function(_0x38ff4d){if(_0x38ff4d){_0x17f967=_0x38ff4d;_0x4fa6f9[_0xf326('0x38')]=_['keys'](db[_0xf326('0x95')][_0xf326('0x36')]);_0x4fa6f9[_0xf326('0x3a')]=_['keys'](_0x4ab9c0[_0xf326('0x3a')]);_0x4fa6f9[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],_0x4fa6f9[_0xf326('0x3a')]);_0xc4aa47['attributes']=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],qs['fields'](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x3d')]));_0xc4aa47[_0xf326('0x3e')]=_0xc4aa47['attributes']['length']?_0xc4aa47[_0xf326('0x3e')]:_0x4fa6f9[_0xf326('0x38')];_0xc4aa47['order']=qs[_0xf326('0x43')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x43')]);_0xc4aa47[_0xf326('0x44')]=qs['filters'](_['pick'](_0x4ab9c0[_0xf326('0x3a')],_0x4fa6f9[_0xf326('0x3b')]));if(_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]){_0xc4aa47[_0xf326('0x44')]=_[_0xf326('0x47')](_0xc4aa47[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xc4aa47['attributes'],function(_0x511e66){var _0x5d719a={};_0x5d719a[_0x511e66]={'$like':'%'+_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5d719a;})});}_0xc4aa47=_[_0xf326('0x47')]({},_0xc4aa47,_0x4ab9c0['options']);return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})[_0xf326('0x27')](function(_0x30247a){if(_0x30247a){_0x1639f2=_0x30247a[_0xf326('0x3f')];if(!_0x4ab9c0['query']['hasOwnProperty'](_0xf326('0x41'))){_0xc4aa47[_0xf326('0x22')]=qs['limit'](_0x4ab9c0['query'][_0xf326('0x22')]);_0xc4aa47[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})['then'](function(_0xb17fae){return _0xb17fae?{'count':_0x1639f2,'rows':_0xb17fae}:null;})[_0xf326('0x27')](respondWithResult(_0x531d31,null))['catch'](handleError(_0x531d31,null));};exports['getLists']=function(_0x371e52,_0x6a202f,_0x250682){var _0x4069bb={};var _0x1ea2be={};var _0x663019;var _0x2549ab;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x371e52[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x6a202f,null))[_0xf326('0x27')](function(_0x58fdca){if(_0x58fdca){_0x663019=_0x58fdca;_0x1ea2be[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x9b')][_0xf326('0x36')]);_0x1ea2be['query']=_['keys'](_0x371e52[_0xf326('0x3a')]);_0x1ea2be['filters']=_[_0xf326('0x3c')](_0x1ea2be[_0xf326('0x38')],_0x1ea2be[_0xf326('0x3a')]);_0x4069bb['attributes']=_[_0xf326('0x3c')](_0x1ea2be['model'],qs['fields'](_0x371e52['query'][_0xf326('0x3d')]));_0x4069bb['attributes']=_0x4069bb[_0xf326('0x3e')][_0xf326('0x3f')]?_0x4069bb[_0xf326('0x3e')]:_0x1ea2be[_0xf326('0x38')];_0x4069bb[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x371e52[_0xf326('0x3a')]['sort']);_0x4069bb['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x371e52[_0xf326('0x3a')],_0x1ea2be[_0xf326('0x3b')]));if(_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]){_0x4069bb['where']=_[_0xf326('0x47')](_0x4069bb['where'],{'$or':_[_0xf326('0x2c')](_0x4069bb[_0xf326('0x3e')],function(_0x5ba7ef){var _0x2671d5={};_0x2671d5[_0x5ba7ef]={'$like':'%'+_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x2671d5;})});}_0x4069bb=_[_0xf326('0x47')]({},_0x4069bb,_0x371e52[_0xf326('0x5a')]);return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x55d9bd){if(_0x55d9bd){_0x2549ab=_0x55d9bd['length'];if(!_0x371e52[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x4069bb[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x371e52[_0xf326('0x3a')][_0xf326('0x22')]);_0x4069bb[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x371e52[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x4c88c2){if(_0x4c88c2){return _0x4c88c2?{'count':_0x2549ab,'rows':_0x4c88c2}:null;}})['then'](respondWithResult(_0x6a202f,null))['catch'](handleError(_0x6a202f,null));};exports[_0xf326('0x9d')]=function(_0x1af709,_0x3fdfc5,_0xf7df13){var _0x45afd7=moment()['format'](_0xf326('0x9e'));var _0x233857,_0xbc39f5;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x1af709[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0xf326('0x27')](function(_0xfa7c63){if(_0xfa7c63){_0xbc39f5=_0xfa7c63;return _0xfa7c63['addLists'](_0x1af709[_0xf326('0x52')][_0xf326('0x7f')],_['omit'](_0x1af709[_0xf326('0x52')],['ids','id'])||{});}return null;})[_0xf326('0x94')](function(_0x24dd16){var _0x4515c1;_0x233857=_0x24dd16||[];var _0x5100ec=[];if(_0x24dd16){for(var _0x293c16=0x0;_0x293c16<_0x24dd16[_0xf326('0x3f')];_0x293c16+=0x1){var _0x28ba7c=_0x24dd16[_0x293c16][_0xf326('0x54')]({'plain':!![]});_0xbc39f5['dialCheckDuplicateType']=_0x1af709[_0xf326('0x52')][_0xf326('0x9f')]?_0x1af709['body'][_0xf326('0x9f')]:_0xbc39f5['dialCheckDuplicateType'];switch(_0xbc39f5['dialCheckDuplicateType']){case _0xf326('0xa0'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),'phone')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c['CmListId'][_0xf326('0xa8')](),_0xf326('0xa9'))['field'](_0x1af709['params']['id'][_0xf326('0xa8')](),_0xf326('0x62'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','updatedAt')[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')]('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xf326('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf326('0x82')](_0xf326('0xad'))[_0xf326('0x84')](_0xf326('0xae'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709['params']['id'][_0xf326('0xa8')]()))[_0xf326('0x44')](_0xf326('0xb0'),squel[_0xf326('0x81')]()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;case _0xf326('0xb2'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c[_0xf326('0xac')]['toString'](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),_0xf326('0x62'))['field']('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))['where'](_0xf326('0xab'))['where']('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3'))[_0xf326('0x44')](_0xf326('0xb0'),squel['select']()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1af709['params']['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;default:_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb1'))[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')]('phone',_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0xa5'))[_0xf326('0x82')]('id',_0xf326('0xa6'))['field'](_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))['where'](_0xf326('0xb4'),_0x28ba7c[_0xf326('0xac')]['toString']())[_0xf326('0x44')](_0xf326('0xb3')))[_0xf326('0xa8')]();}_0x5100ec[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4515c1));}return BPromise[_0xf326('0x97')](_0x5100ec);}})[_0xf326('0x27')](function(){var _0x122dfe=[];var _0x39a5f8=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb5'))[_0xf326('0xa3')](['CmHopperId',_0xf326('0xa4'),'OrderBy',_0xf326('0xa7'),'updatedAt'],squel[_0xf326('0x81')]()['field'](_0xf326('0xb6'))['field'](_0xf326('0xb7'))['field']('ci.OrderBy')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xb8'),'ci')[_0xf326('0x86')](_0xf326('0xb1'),'h',_0xf326('0xb9'))['where']('h.scheduledat=?',_0x45afd7)[_0xf326('0x44')]('ci.ItemClass=?','PHONE'))['toString']();_0x122dfe[_0xf326('0x8a')](db['sequelize']['query'](_0x39a5f8));return BPromise[_0xf326('0x97')](_0x122dfe);})[_0xf326('0x27')](function(){return _0x233857;})['then'](respondWithResult(_0x3fdfc5,null))[_0xf326('0x4d')](handleError(_0x3fdfc5,null));};exports[_0xf326('0xba')]=function(_0x38ee2f,_0x1ea221,_0x4136f9){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ea221,null))[_0xf326('0x27')](function(_0x424360){if(_0x424360){return _0x424360[_0xf326('0xba')](_0x38ee2f[_0xf326('0x3a')][_0xf326('0x7f')]);}})[_0xf326('0x27')](function(_0x35ff4d){if(_0x35ff4d){return db['CmHopper']['destroy']({'where':{'ListId':_0x38ee2f['query'][_0xf326('0x7f')],'VoiceQueueId':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](function(){return _0x35ff4d;});}})['then'](respondWithStatusCode(_0x1ea221,null))['catch'](handleError(_0x1ea221,null));};exports[_0xf326('0xbb')]=function(_0x1d05b3,_0x36d7c2,_0x1afa71){var _0x2a7789={};var _0x5b1d58={};var _0x5785c9;var _0x4ff3b8;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1d05b3['params']['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x36d7c2,null))[_0xf326('0x27')](function(_0x55e8e6){if(_0x55e8e6){_0x5785c9=_0x55e8e6;_0x5b1d58[_0xf326('0x38')]=_['keys'](db[_0xf326('0x9b')]['rawAttributes']);_0x5b1d58[_0xf326('0x3a')]=_['keys'](_0x1d05b3['query']);_0x5b1d58[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5b1d58['model'],_0x5b1d58[_0xf326('0x3a')]);_0x2a7789[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x5b1d58[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x3d')]));_0x2a7789[_0xf326('0x3e')]=_0x2a7789[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2a7789['attributes']:_0x5b1d58[_0xf326('0x38')];_0x2a7789['order']=qs[_0xf326('0x43')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x43')]);_0x2a7789[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1d05b3[_0xf326('0x3a')],_0x5b1d58[_0xf326('0x3b')]));if(_0x1d05b3[_0xf326('0x3a')][_0xf326('0x46')]){_0x2a7789['where']=_['merge'](_0x2a7789['where'],{'$or':_[_0xf326('0x2c')](_0x2a7789['attributes'],function(_0x173bea){var _0x94eaa1={};_0x94eaa1[_0x173bea]={'$like':'%'+_0x1d05b3[_0xf326('0x3a')]['filter']+'%'};return _0x94eaa1;})});}_0x2a7789=_[_0xf326('0x47')]({},_0x2a7789,_0x1d05b3[_0xf326('0x5a')]);return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})['then'](function(_0x5387af){if(_0x5387af){_0x4ff3b8=_0x5387af[_0xf326('0x3f')];if(!_0x1d05b3[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x2a7789['limit']=qs[_0xf326('0x22')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x22')]);_0x2a7789[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})[_0xf326('0x27')](function(_0x595e28){if(_0x595e28){return _0x595e28?{'count':_0x4ff3b8,'rows':_0x595e28}:null;}})['then'](respondWithResult(_0x36d7c2,null))[_0xf326('0x4d')](handleError(_0x36d7c2,null));};exports['addBlackLists']=function(_0x130b92,_0x1e7099,_0x47b04b){var _0x470e90,_0x5d9653;return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x130b92[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x1e7099,null))[_0xf326('0x27')](function(_0x13ba1a){if(_0x13ba1a){_0x5d9653=_0x13ba1a;return _0x13ba1a[_0xf326('0xbc')](_0x130b92['body'][_0xf326('0x7f')],_['omit'](_0x130b92['body'],['ids','id'])||{});}return null;})['spread'](function(_0xb6e17c){var _0x4d19ed;_0x470e90=_0xb6e17c||[];var _0x7c6644=[];if(_0xb6e17c){for(var _0x4eb5d3=0x0;_0x4eb5d3<_0xb6e17c[_0xf326('0x3f')];_0x4eb5d3+=0x1){var _0x4e2160=_0xb6e17c[_0x4eb5d3]['get']({'plain':!![]});_0x4d19ed=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xbd'))[_0xf326('0xa3')](['phone',_0xf326('0xa6'),_0xf326('0xa9'),_0xf326('0x62'),_0xf326('0xa7'),'updatedAt'],squel['select']()['field']('phone',_0xf326('0xa4'))['field']('id','ContactId')[_0xf326('0x82')](_0x4e2160['CmListId']['toString'](),'ListId')[_0xf326('0x82')](_0x130b92['params']['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('NOW()',_0xf326('0xa7'))[_0xf326('0x82')](_0xf326('0xbe'),_0xf326('0x5c'))['from'](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')](_0xf326('0xb4'),_0x4e2160[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3')))['toString']();_0x7c6644['push'](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4d19ed));}return BPromise[_0xf326('0x97')](_0x7c6644);}})[_0xf326('0x27')](function(){return _0x470e90;})[_0xf326('0x27')](respondWithResult(_0x1e7099,null))['catch'](handleError(_0x1e7099,null));};exports[_0xf326('0xbf')]=function(_0x3e715a,_0x5d2dfa,_0x4fa725){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x3e715a[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x5d2dfa,null))[_0xf326('0x27')](function(_0x4c3be5){if(_0x4c3be5){return _0x4c3be5['removeBlackLists'](_0x3e715a[_0xf326('0x3a')][_0xf326('0x7f')]);}})['then'](function(_0x53beb9){if(_0x53beb9){return db[_0xf326('0x68')]['destroy']({'where':{'ListId':_0x3e715a[_0xf326('0x3a')]['ids'],'VoiceQueueId':_0x3e715a[_0xf326('0x4e')]['id']}})['then'](function(){return _0x53beb9;});}})[_0xf326('0x27')](respondWithStatusCode(_0x5d2dfa,null))[_0xf326('0x4d')](handleError(_0x5d2dfa,null));};
\ No newline at end of file
index 8084d10..4b05c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa662=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xa662,0x1db));var _0x2a66=function(_0x42d755,_0x15cb95){_0x42d755=_0x42d755-0x0;var _0x406ffc=_0xa662[_0x42d755];return _0x406ffc;};'use strict';var EventEmitter=require(_0x2a66('0x0'));var VoiceQueue=require(_0x2a66('0x1'))['db'][_0x2a66('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2a66('0x3')](0x0);var events={'afterCreate':_0x2a66('0x4'),'afterUpdate':_0x2a66('0x5'),'afterDestroy':_0x2a66('0x6')};function emitEvent(_0x192dc7){return function(_0x859495,_0x5073e7,_0x405de0){VoiceQueueEvents[_0x2a66('0x7')](_0x192dc7+':'+_0x859495['id'],_0x859495);VoiceQueueEvents[_0x2a66('0x7')](_0x192dc7,_0x859495);_0x405de0(null);};}for(var e in events){if(events[_0x2a66('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2a66('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xf2ac=['hasOwnProperty','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xf2ac,0xc5));var _0xcf2a=function(_0x32fbef,_0x54a182){_0x32fbef=_0x32fbef-0x0;var _0x494572=_0xf2ac[_0x32fbef];return _0x494572;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xcf2a('0x0'))['db'][_0xcf2a('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcf2a('0x2')](0x0);var events={'afterCreate':_0xcf2a('0x3'),'afterUpdate':'update','afterDestroy':_0xcf2a('0x4')};function emitEvent(_0x4904d8){return function(_0x18f029,_0x544af1,_0x4e4d41){VoiceQueueEvents[_0xcf2a('0x5')](_0x4904d8+':'+_0x18f029['id'],_0x18f029);VoiceQueueEvents[_0xcf2a('0x5')](_0x4904d8,_0x18f029);_0x4e4d41(null);};}for(var e in events){if(events[_0xcf2a('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index 86a8dff..3c5e5ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x272c47,_0x18ce00){var _0x2d9c4d=function(_0x4e20fd){while(--_0x4e20fd){_0x272c47['push'](_0x272c47['shift']());}};_0x2d9c4d(++_0x18ce00);}(_0x70e0,0x17b));var _0x070e=function(_0x1bd8b3,_0x21bc9e){_0x1bd8b3=_0x1bd8b3-0x0;var _0x26eb4d=_0x70e0[_0x1bd8b3];return _0x26eb4d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x55ca,0x126));var _0xa55c=function(_0x5e1855,_0x17161e){_0x5e1855=_0x5e1855-0x0;var _0x4faf68=_0x55ca[_0x5e1855];return _0x4faf68;};'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
index d0bd00c..950a034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03f2=['map','model','then','ShowVoiceQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include'];(function(_0x367204,_0x297e88){var _0x692f1e=function(_0x22705c){while(--_0x22705c){_0x367204['push'](_0x367204['shift']());}};_0x692f1e(++_0x297e88);}(_0x03f2,0x1be));var _0x203f=function(_0x2859fa,_0x58b877){_0x2859fa=_0x2859fa-0x0;var _0x5a513b=_0x03f2[_0x2859fa];return _0x5a513b;};'use strict';var _=require(_0x203f('0x0'));var util=require('util');var moment=require(_0x203f('0x1'));var BPromise=require(_0x203f('0x2'));var rs=require(_0x203f('0x3'));var fs=require('fs');var Redis=require(_0x203f('0x4'));var db=require(_0x203f('0x5'))['db'];var utils=require(_0x203f('0x6'));var logger=require('../../config/logger')(_0x203f('0x7'));var config=require(_0x203f('0x8'));var jayson=require(_0x203f('0x9'));var client=jayson[_0x203f('0xa')][_0x203f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x203f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x203f('0xd'))['register'](socket);function respondWithRpcPromise(_0x335648,_0xfdb032,_0xd2362b){return new BPromise(function(_0x4a53b7,_0x1d8c7b){return client[_0x203f('0xe')](_0x335648,_0xd2362b)['then'](function(_0x38914c){logger[_0x203f('0xf')](_0x203f('0x10'),_0xfdb032,_0x203f('0x11'));logger[_0x203f('0x12')](_0x203f('0x13'),_0xfdb032,_0x203f('0x11'),JSON[_0x203f('0x14')](_0x38914c));if(_0x38914c[_0x203f('0x15')]){if(_0x38914c[_0x203f('0x15')][_0x203f('0x16')]===0x1f4){logger[_0x203f('0x15')](_0x203f('0x10'),_0xfdb032,_0x38914c[_0x203f('0x15')]['message']);return _0x1d8c7b(_0x38914c[_0x203f('0x15')][_0x203f('0x17')]);}logger[_0x203f('0x15')](_0x203f('0x10'),_0xfdb032,_0x38914c['error'][_0x203f('0x17')]);return _0x4a53b7(_0x38914c[_0x203f('0x15')][_0x203f('0x17')]);}else{logger[_0x203f('0xf')](_0x203f('0x10'),_0xfdb032,_0x203f('0x11'));_0x4a53b7(_0x38914c[_0x203f('0x18')][_0x203f('0x17')]);}})[_0x203f('0x19')](function(_0xdd5a8){logger[_0x203f('0x15')](_0x203f('0x10'),_0xfdb032,_0xdd5a8);_0x1d8c7b(_0xdd5a8);});});}exports[_0x203f('0x1a')]=function(_0x5d6557){var _0x492274=this;return new Promise(function(_0x4800f1,_0x2fe507){return db[_0x203f('0x1b')][_0x203f('0x1c')]({'raw':_0x5d6557[_0x203f('0x1d')]?_0x5d6557[_0x203f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5d6557[_0x203f('0x1d')]?_0x5d6557[_0x203f('0x1d')][_0x203f('0x1e')]||null:null,'attributes':_0x5d6557[_0x203f('0x1d')]?_0x5d6557[_0x203f('0x1d')][_0x203f('0x1f')]||null:null,'limit':_0x5d6557[_0x203f('0x1d')]?_0x5d6557[_0x203f('0x1d')][_0x203f('0x20')]||null:null,'include':_0x5d6557[_0x203f('0x1d')]?_0x5d6557[_0x203f('0x1d')][_0x203f('0x21')]?_[_0x203f('0x22')](_0x5d6557[_0x203f('0x1d')][_0x203f('0x21')],function(_0x5bd68e){return{'model':db[_0x5bd68e[_0x203f('0x23')]],'as':_0x5bd68e['as'],'attributes':_0x5bd68e[_0x203f('0x1f')],'include':_0x5bd68e[_0x203f('0x21')]?_[_0x203f('0x22')](_0x5bd68e['include'],function(_0x581a01){return{'model':db[_0x581a01[_0x203f('0x23')]],'as':_0x581a01['as'],'attributes':_0x581a01[_0x203f('0x1f')],'include':_0x581a01[_0x203f('0x21')]?_['map'](_0x581a01[_0x203f('0x21')],function(_0x55c0a1){return{'model':db[_0x55c0a1[_0x203f('0x23')]],'as':_0x55c0a1['as'],'attributes':_0x55c0a1[_0x203f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x203f('0x24')](function(_0x36a8f7){logger[_0x203f('0xf')](_0x203f('0x1a'),_0x5d6557);logger[_0x203f('0x12')](_0x203f('0x1a'),_0x5d6557,JSON[_0x203f('0x14')](_0x36a8f7));_0x4800f1(_0x36a8f7);})[_0x203f('0x19')](function(_0x3189f7){logger[_0x203f('0x15')](_0x203f('0x1a'),_0x3189f7[_0x203f('0x17')],_0x5d6557);_0x2fe507(_0x492274['error'](0x1f4,_0x3189f7[_0x203f('0x17')]));});});};exports[_0x203f('0x25')]=function(_0x4a12ba){var _0x85677=this;return new Promise(function(_0x496e1c,_0x44ee28){return db['VoiceQueue'][_0x203f('0x26')]({'raw':_0x4a12ba[_0x203f('0x1d')]?_0x4a12ba[_0x203f('0x1d')][_0x203f('0x27')]===undefined?!![]:![]:!![],'where':_0x4a12ba[_0x203f('0x1d')]?_0x4a12ba[_0x203f('0x1d')][_0x203f('0x1e')]||null:null,'attributes':_0x4a12ba[_0x203f('0x1d')]?_0x4a12ba[_0x203f('0x1d')][_0x203f('0x1f')]||null:null,'include':_0x4a12ba[_0x203f('0x1d')]?_0x4a12ba[_0x203f('0x1d')][_0x203f('0x21')]?_[_0x203f('0x22')](_0x4a12ba[_0x203f('0x1d')][_0x203f('0x21')],function(_0x583b67){return{'model':db[_0x583b67[_0x203f('0x23')]],'as':_0x583b67['as'],'attributes':_0x583b67['attributes'],'include':_0x583b67[_0x203f('0x21')]?_['map'](_0x583b67['include'],function(_0x299f94){return{'model':db[_0x299f94[_0x203f('0x23')]],'as':_0x299f94['as'],'attributes':_0x299f94['attributes'],'include':_0x299f94['include']?_[_0x203f('0x22')](_0x299f94['include'],function(_0xb20937){return{'model':db[_0xb20937[_0x203f('0x23')]],'as':_0xb20937['as'],'attributes':_0xb20937[_0x203f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c6b83){logger['info']('ShowVoiceQueue',_0x4a12ba);logger[_0x203f('0x12')]('ShowVoiceQueue',_0x4a12ba,JSON[_0x203f('0x14')](_0x5c6b83));_0x496e1c(_0x5c6b83);})[_0x203f('0x19')](function(_0x115bc9){logger['error'](_0x203f('0x25'),_0x115bc9[_0x203f('0x17')],_0x4a12ba);_0x44ee28(_0x85677[_0x203f('0x15')](0x1f4,_0x115bc9[_0x203f('0x17')]));});});};
\ No newline at end of file
+var _0xf68b=['../../config/environment','client','http','redis','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceQueue','findAll','options','raw','where','attributes','include','map','model','VoiceQueue','find','ShowVoiceQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf68b,0x103));var _0xbf68=function(_0x16c2bb,_0x19f21c){_0x16c2bb=_0x16c2bb-0x0;var _0x1fb795=_0xf68b[_0x16c2bb];return _0x1fb795;};'use strict';var _=require(_0xbf68('0x0'));var util=require('util');var moment=require(_0xbf68('0x1'));var BPromise=require(_0xbf68('0x2'));var rs=require(_0xbf68('0x3'));var fs=require('fs');var Redis=require(_0xbf68('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf68('0x5'));var logger=require(_0xbf68('0x6'))('rpc');var config=require(_0xbf68('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbf68('0x8')][_0xbf68('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbf68('0xa')],{'host':_0xbf68('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbf68('0xc'))[_0xbf68('0xd')](socket);function respondWithRpcPromise(_0x2a2b53,_0x2fcd36,_0x3943a2){return new BPromise(function(_0x39e404,_0x5addbf){return client[_0xbf68('0xe')](_0x2a2b53,_0x3943a2)[_0xbf68('0xf')](function(_0x3cee38){logger['info'](_0xbf68('0x10'),_0x2fcd36,_0xbf68('0x11'));logger[_0xbf68('0x12')](_0xbf68('0x13'),_0x2fcd36,'request\x20sent',JSON[_0xbf68('0x14')](_0x3cee38));if(_0x3cee38[_0xbf68('0x15')]){if(_0x3cee38['error'][_0xbf68('0x16')]===0x1f4){logger[_0xbf68('0x15')](_0xbf68('0x10'),_0x2fcd36,_0x3cee38[_0xbf68('0x15')][_0xbf68('0x17')]);return _0x5addbf(_0x3cee38[_0xbf68('0x15')][_0xbf68('0x17')]);}logger[_0xbf68('0x15')](_0xbf68('0x10'),_0x2fcd36,_0x3cee38[_0xbf68('0x15')]['message']);return _0x39e404(_0x3cee38[_0xbf68('0x15')][_0xbf68('0x17')]);}else{logger[_0xbf68('0x18')](_0xbf68('0x10'),_0x2fcd36,_0xbf68('0x11'));_0x39e404(_0x3cee38['result'][_0xbf68('0x17')]);}})[_0xbf68('0x19')](function(_0x6eb294){logger[_0xbf68('0x15')](_0xbf68('0x10'),_0x2fcd36,_0x6eb294);_0x5addbf(_0x6eb294);});});}exports[_0xbf68('0x1a')]=function(_0x547887){var _0x418b18=this;return new Promise(function(_0x1a647d,_0x4e2fa1){return db['VoiceQueue'][_0xbf68('0x1b')]({'raw':_0x547887['options']?_0x547887[_0xbf68('0x1c')][_0xbf68('0x1d')]===undefined?!![]:![]:!![],'where':_0x547887[_0xbf68('0x1c')]?_0x547887[_0xbf68('0x1c')][_0xbf68('0x1e')]||null:null,'attributes':_0x547887[_0xbf68('0x1c')]?_0x547887[_0xbf68('0x1c')][_0xbf68('0x1f')]||null:null,'limit':_0x547887[_0xbf68('0x1c')]?_0x547887[_0xbf68('0x1c')]['limit']||null:null,'include':_0x547887[_0xbf68('0x1c')]?_0x547887['options'][_0xbf68('0x20')]?_[_0xbf68('0x21')](_0x547887['options'][_0xbf68('0x20')],function(_0x36275c){return{'model':db[_0x36275c['model']],'as':_0x36275c['as'],'attributes':_0x36275c['attributes'],'include':_0x36275c[_0xbf68('0x20')]?_[_0xbf68('0x21')](_0x36275c[_0xbf68('0x20')],function(_0xf48836){return{'model':db[_0xf48836[_0xbf68('0x22')]],'as':_0xf48836['as'],'attributes':_0xf48836[_0xbf68('0x1f')],'include':_0xf48836[_0xbf68('0x20')]?_['map'](_0xf48836['include'],function(_0xb3b3bf){return{'model':db[_0xb3b3bf[_0xbf68('0x22')]],'as':_0xb3b3bf['as'],'attributes':_0xb3b3bf[_0xbf68('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf68('0xf')](function(_0x1eb1a6){logger['info'](_0xbf68('0x1a'),_0x547887);logger['debug']('GetVoiceQueue',_0x547887,JSON[_0xbf68('0x14')](_0x1eb1a6));_0x1a647d(_0x1eb1a6);})[_0xbf68('0x19')](function(_0x217558){logger[_0xbf68('0x15')](_0xbf68('0x1a'),_0x217558['message'],_0x547887);_0x4e2fa1(_0x418b18['error'](0x1f4,_0x217558[_0xbf68('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x4506ef){var _0x154678=this;return new Promise(function(_0x267d73,_0x3c9ea1){return db[_0xbf68('0x23')][_0xbf68('0x24')]({'raw':_0x4506ef['options']?_0x4506ef[_0xbf68('0x1c')][_0xbf68('0x1d')]===undefined?!![]:![]:!![],'where':_0x4506ef[_0xbf68('0x1c')]?_0x4506ef[_0xbf68('0x1c')][_0xbf68('0x1e')]||null:null,'attributes':_0x4506ef['options']?_0x4506ef['options']['attributes']||null:null,'include':_0x4506ef['options']?_0x4506ef[_0xbf68('0x1c')][_0xbf68('0x20')]?_[_0xbf68('0x21')](_0x4506ef[_0xbf68('0x1c')]['include'],function(_0x45757d){return{'model':db[_0x45757d[_0xbf68('0x22')]],'as':_0x45757d['as'],'attributes':_0x45757d[_0xbf68('0x1f')],'include':_0x45757d[_0xbf68('0x20')]?_[_0xbf68('0x21')](_0x45757d[_0xbf68('0x20')],function(_0x2a88a9){return{'model':db[_0x2a88a9[_0xbf68('0x22')]],'as':_0x2a88a9['as'],'attributes':_0x2a88a9[_0xbf68('0x1f')],'include':_0x2a88a9[_0xbf68('0x20')]?_[_0xbf68('0x21')](_0x2a88a9['include'],function(_0x1e50db){return{'model':db[_0x1e50db[_0xbf68('0x22')]],'as':_0x1e50db['as'],'attributes':_0x1e50db[_0xbf68('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf68('0xf')](function(_0x2e0828){logger['info'](_0xbf68('0x25'),_0x4506ef);logger[_0xbf68('0x12')]('ShowVoiceQueue',_0x4506ef,JSON[_0xbf68('0x14')](_0x2e0828));_0x267d73(_0x2e0828);})[_0xbf68('0x19')](function(_0x33c9ca){logger['error']('ShowVoiceQueue',_0x33c9ca[_0xbf68('0x17')],_0x4506ef);_0x3c9ea1(_0x154678[_0xbf68('0x15')](0x1f4,_0x33c9ca[_0xbf68('0x17')]));});});};
\ No newline at end of file
index 71b3160..c8ea8d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9189=['update','emit','register','length','./voiceQueue.events','remove'];(function(_0x1212a6,_0x2f97e7){var _0x21fbdc=function(_0x92100d){while(--_0x92100d){_0x1212a6['push'](_0x1212a6['shift']());}};_0x21fbdc(++_0x2f97e7);}(_0x9189,0x94));var _0x9918=function(_0x46d365,_0x31837e){_0x46d365=_0x46d365-0x0;var _0x14b513=_0x9189[_0x46d365];return _0x14b513;};'use strict';var VoiceQueueEvents=require(_0x9918('0x0'));var events=['save',_0x9918('0x1'),_0x9918('0x2')];function createListener(_0x23d865,_0x59161f){return function(_0x37fdf3){_0x59161f[_0x9918('0x3')](_0x23d865,_0x37fdf3);};}function removeListener(_0x58a4b6,_0x2a076d){return function(){VoiceQueueEvents['removeListener'](_0x58a4b6,_0x2a076d);};}exports[_0x9918('0x4')]=function(_0x3f284b){for(var _0x24f0b2=0x0,_0x1bf186=events[_0x9918('0x5')];_0x24f0b2<_0x1bf186;_0x24f0b2++){var _0x18aafa=events[_0x24f0b2];var _0x15a3f6=createListener('voiceQueue:'+_0x18aafa,_0x3f284b);VoiceQueueEvents['on'](_0x18aafa,_0x15a3f6);}};
\ No newline at end of file
+var _0x0205=['register','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x4b9b97,_0x9afee0){var _0x14bdac=function(_0x13fbdf){while(--_0x13fbdf){_0x4b9b97['push'](_0x4b9b97['shift']());}};_0x14bdac(++_0x9afee0);}(_0x0205,0x15a));var _0x5020=function(_0xb213f5,_0x5b02d9){_0xb213f5=_0xb213f5-0x0;var _0x16047f=_0x0205[_0xb213f5];return _0x16047f;};'use strict';var VoiceQueueEvents=require(_0x5020('0x0'));var events=[_0x5020('0x1'),_0x5020('0x2'),_0x5020('0x3')];function createListener(_0x498c61,_0xd2d8fa){return function(_0x31d2d7){_0xd2d8fa[_0x5020('0x4')](_0x498c61,_0x31d2d7);};}function removeListener(_0x55d221,_0x5ad8ec){return function(){VoiceQueueEvents[_0x5020('0x5')](_0x55d221,_0x5ad8ec);};}exports[_0x5020('0x6')]=function(_0x2f3142){for(var _0x546c96=0x0,_0x327759=events['length'];_0x546c96<_0x327759;_0x546c96++){var _0x54e83f=events[_0x546c96];var _0x5eeb12=createListener(_0x5020('0x7')+_0x54e83f,_0x2f3142);VoiceQueueEvents['on'](_0x54e83f,_0x5eeb12);}};
\ No newline at end of file
index 9dcffe6..3550f1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','/describe','describe','get','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x27eba1,_0x142c10){var _0x2276c7=function(_0x6ba7d0){while(--_0x6ba7d0){_0x27eba1['push'](_0x27eba1['shift']());}};_0x2276c7(++_0x142c10);}(_0x98f7,0x172));var _0x798f=function(_0x2f50bc,_0x66745){_0x2f50bc=_0x2f50bc-0x0;var _0x555f39=_0x98f7[_0x2f50bc];return _0x555f39;};'use strict';var multer=require(_0x798f('0x0'));var util=require(_0x798f('0x1'));var path=require('path');var timeout=require(_0x798f('0x2'));var express=require(_0x798f('0x3'));var router=express[_0x798f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x798f('0x5'));var interaction=require(_0x798f('0x6'));var config=require(_0x798f('0x7'));var controller=require(_0x798f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x798f('0x9')]);router['get'](_0x798f('0xa'),auth['isAuthenticated'](),controller[_0x798f('0xb')]);router[_0x798f('0xc')](_0x798f('0xd'),auth[_0x798f('0xe')](),controller[_0x798f('0xf')]);router['get'](_0x798f('0x10'),auth[_0x798f('0xe')](),controller[_0x798f('0x11')]);router[_0x798f('0x12')]('/',auth[_0x798f('0xe')](),controller[_0x798f('0x13')]);router[_0x798f('0x14')](_0x798f('0x10'),auth[_0x798f('0xe')](),controller[_0x798f('0x15')]);router[_0x798f('0x16')](_0x798f('0x10'),auth['isAuthenticated'](),controller[_0x798f('0x17')]);module[_0x798f('0x18')]=router;
\ No newline at end of file
+var _0x0583=['/index','getVoiceQueuesReport','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0583,0x1a1));var _0x3058=function(_0x267dec,_0x4567c0){_0x267dec=_0x267dec-0x0;var _0xb3355=_0x0583[_0x267dec];return _0xb3355;};'use strict';var multer=require(_0x3058('0x0'));var util=require(_0x3058('0x1'));var path=require(_0x3058('0x2'));var timeout=require(_0x3058('0x3'));var express=require('express');var router=express[_0x3058('0x4')]();var fs_extra=require(_0x3058('0x5'));var auth=require(_0x3058('0x6'));var interaction=require(_0x3058('0x7'));var config=require(_0x3058('0x8'));var controller=require(_0x3058('0x9'));router[_0x3058('0xa')]('/',auth[_0x3058('0xb')](),controller[_0x3058('0xc')]);router[_0x3058('0xa')](_0x3058('0xd'),auth['isAuthenticated'](),controller[_0x3058('0xe')]);router['get'](_0x3058('0xf'),auth[_0x3058('0xb')](),controller[_0x3058('0x10')]);router[_0x3058('0xa')]('/:id',auth[_0x3058('0xb')](),controller['show']);router[_0x3058('0x11')]('/',auth['isAuthenticated'](),controller[_0x3058('0x12')]);router[_0x3058('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3058('0x14')]);router[_0x3058('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3058('0x16')]);module[_0x3058('0x17')]=router;
\ No newline at end of file
index 195071a..89b13d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c6e=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','diff','seconds'];(function(_0xb1ac47,_0x643ac1){var _0x2d964d=function(_0x1b6188){while(--_0x1b6188){_0xb1ac47['push'](_0xb1ac47['shift']());}};_0x2d964d(++_0x643ac1);}(_0x0c6e,0x111));var _0xe0c6=function(_0x2bbfa5,_0x14f33b){_0x2bbfa5=_0x2bbfa5-0x0;var _0x14a11f=_0x0c6e[_0x2bbfa5];return _0x14a11f;};'use strict';var Sequelize=require(_0xe0c6('0x0'));var moment=require('moment');module[_0xe0c6('0x1')]={'type':{'type':Sequelize[_0xe0c6('0x2')]},'uniqueid':{'type':Sequelize[_0xe0c6('0x2')]},'calleridnum':{'type':Sequelize[_0xe0c6('0x2')]},'calleridname':{'type':Sequelize[_0xe0c6('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xe0c6('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xe0c6('0x3')],'set':function(_0x403915){var _0x20864a=moment(_0x403915);var _0x54c125=moment(this[_0xe0c6('0x4')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x34647b=_0x20864a[_0xe0c6('0x5')](_0x54c125,_0xe0c6('0x6'));this[_0xe0c6('0x7')](_0xe0c6('0x8'),_0x403915);this[_0xe0c6('0x7')](_0xe0c6('0x9'),_0x34647b||null);}},'position':{'type':Sequelize[_0xe0c6('0xa')]},'count':{'type':Sequelize[_0xe0c6('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xe0c6('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe0c6('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xe0c6('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe0c6('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe0c6('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xe0c6('0x2')],'comment':_0xe0c6('0xc')},'originalposition':{'type':Sequelize[_0xe0c6('0xa')]},'channel':{'type':Sequelize[_0xe0c6('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe0c6('0x2')]},'connectedlinename':{'type':Sequelize[_0xe0c6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe0c6('0x2')]},'priority':{'type':Sequelize[_0xe0c6('0x2')]},'holdtime':{'type':Sequelize[_0xe0c6('0xa')]},'mohtime':{'type':Sequelize[_0xe0c6('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe0c6('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe0c6('0x2')]},'transfer':{'type':Sequelize[_0xe0c6('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe0c6('0x2')],'comment':_0xe0c6('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xe0c6('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe0c6('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe0c6('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xe0c6('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbae9=['DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x31bbc8,_0x16b246){var _0x443032=function(_0x5f4581){while(--_0x5f4581){_0x31bbc8['push'](_0x31bbc8['shift']());}};_0x443032(++_0x16b246);}(_0xbae9,0xeb));var _0x9bae=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0xbae9[_0x2b81be];return _0x8ed4a7;};'use strict';var Sequelize=require(_0x9bae('0x0'));var moment=require('moment');module[_0x9bae('0x1')]={'type':{'type':Sequelize[_0x9bae('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9bae('0x2')]},'calleridname':{'type':Sequelize[_0x9bae('0x2')]},'queue':{'type':Sequelize[_0x9bae('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x9bae('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x9bae('0x3')],'set':function(_0x241c20){var _0x3c3320=moment(_0x241c20);var _0xe5de07=moment(this['getDataValue'](_0x9bae('0x4')))[_0x9bae('0x5')](_0x9bae('0x6'));var _0x15e3ea=_0x3c3320['diff'](_0xe5de07,_0x9bae('0x7'));this[_0x9bae('0x8')](_0x9bae('0x9'),_0x241c20);this[_0x9bae('0x8')](_0x9bae('0xa'),_0x15e3ea||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x9bae('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x9bae('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9bae('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x9bae('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9bae('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9bae('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x9bae('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9bae('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9bae('0x2')]},'accountcode':{'type':Sequelize[_0x9bae('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x9bae('0xb')]},'mohtime':{'type':Sequelize[_0x9bae('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9bae('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9bae('0xd')},'transferexten':{'type':Sequelize[_0x9bae('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9bae('0x2')]},'disposition':{'type':Sequelize[_0x9bae('0x2')]},'secondDisposition':{'type':Sequelize[_0x9bae('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9bae('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index aa75481..5c5bfa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7de5=['findAll','rows','catch','show','rawAttributes','find','create','body','update','describe','hasOwnProperty','order','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','then','error','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','include'];(function(_0x1690f6,_0x1a85df){var _0x589afc=function(_0x3c79db){while(--_0x3c79db){_0x1690f6['push'](_0x1690f6['shift']());}};_0x589afc(++_0x1a85df);}(_0x7de5,0xf7));var _0x57de=function(_0xc65834,_0x5df6fb){_0xc65834=_0xc65834-0x0;var _0x5da298=_0x7de5[_0xc65834];return _0x5da298;};'use strict';var emlformat=require(_0x57de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57de('0x1'));var jsonpatch=require(_0x57de('0x2'));var rp=require(_0x57de('0x3'));var moment=require(_0x57de('0x4'));var BPromise=require(_0x57de('0x5'));var Mustache=require('mustache');var util=require(_0x57de('0x6'));var path=require('path');var sox=require(_0x57de('0x7'));var csv=require(_0x57de('0x8'));var ejs=require(_0x57de('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57de('0xa'));var squel=require(_0x57de('0xb'));var crypto=require(_0x57de('0xc'));var jsforce=require(_0x57de('0xd'));var deskjs=require(_0x57de('0xe'));var toCsv=require(_0x57de('0x8'));var querystring=require('querystring');var Papa=require(_0x57de('0xf'));var Redis=require(_0x57de('0x10'));var authService=require(_0x57de('0x11'));var qs=require(_0x57de('0x12'));var as=require(_0x57de('0x13'));var hardwareService=require(_0x57de('0x14'));var logger=require(_0x57de('0x15'))(_0x57de('0x16'));var utils=require('../../config/utils');var config=require(_0x57de('0x17'));var licenseUtil=require(_0x57de('0x18'));var db=require('../../mysqldb')['db'];config[_0x57de('0x19')]=_['defaults'](config[_0x57de('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x57de('0x1a'))(new Redis(config[_0x57de('0x19')]));require('./voiceQueueReport.socket')[_0x57de('0x1b')](socket);function respondWithStatusCode(_0x371bb8,_0x117220){_0x117220=_0x117220||0xcc;return function(_0x515136){if(_0x515136){return _0x371bb8[_0x57de('0x1c')](_0x117220);}return _0x371bb8[_0x57de('0x1d')](_0x117220)[_0x57de('0x1e')]();};}function respondWithResult(_0x48196d,_0x1a16e9){_0x1a16e9=_0x1a16e9||0xc8;return function(_0x50b739){if(_0x50b739){return _0x48196d[_0x57de('0x1d')](_0x1a16e9)[_0x57de('0x1f')](_0x50b739);}};}function respondWithFilteredResult(_0x5b999e,_0x432733){return function(_0x1bc3e2){if(_0x1bc3e2){var _0x141c3f=typeof _0x432733[_0x57de('0x20')]==='undefined'&&typeof _0x432733['limit']===_0x57de('0x21');var _0x411bac=_0x1bc3e2[_0x57de('0x22')];var _0x65fda7=_0x141c3f?0x0:_0x432733[_0x57de('0x20')];var _0x273fd4=_0x141c3f?_0x1bc3e2[_0x57de('0x22')]:_0x432733[_0x57de('0x20')]+_0x432733[_0x57de('0x23')];var _0xef5870;if(_0x273fd4>=_0x411bac){_0x273fd4=_0x411bac;_0xef5870=0xc8;}else{_0xef5870=0xce;}_0x5b999e[_0x57de('0x1d')](_0xef5870);return _0x5b999e[_0x57de('0x24')](_0x57de('0x25'),_0x65fda7+'-'+_0x273fd4+'/'+_0x411bac)[_0x57de('0x1f')](_0x1bc3e2);}return null;};}function patchUpdates(_0x2ce271){return function(_0x13ac00){try{jsonpatch['apply'](_0x13ac00,_0x2ce271,!![]);}catch(_0x17a87a){return BPromise['reject'](_0x17a87a);}return _0x13ac00['save']();};}function saveUpdates(_0x36056a,_0x133c00){return function(_0x383872){if(_0x383872){return _0x383872['update'](_0x36056a)['then'](function(_0x2b2c3a){return _0x2b2c3a;});}return null;};}function removeEntity(_0x54f741,_0x43bcc6){return function(_0x4dcb4d){if(_0x4dcb4d){return _0x4dcb4d[_0x57de('0x26')]()[_0x57de('0x27')](function(){_0x54f741[_0x57de('0x1d')](0xcc)[_0x57de('0x1e')]();});}};}function handleEntityNotFound(_0x3d335b,_0x50d844){return function(_0x4b365f){if(!_0x4b365f){_0x3d335b[_0x57de('0x1c')](0x194);}return _0x4b365f;};}function handleError(_0x127577,_0x179fc6){_0x179fc6=_0x179fc6||0x1f4;return function(_0x465a70){logger[_0x57de('0x28')](_0x465a70[_0x57de('0x29')]);if(_0x465a70[_0x57de('0x2a')]){delete _0x465a70[_0x57de('0x2a')];}_0x127577[_0x57de('0x1d')](_0x179fc6)['send'](_0x465a70);};}exports['index']=function(_0x13c090,_0x365022){var _0x58598f={},_0x32588b={},_0x138de7={'count':0x0,'rows':[]};var _0x4af93f=_[_0x57de('0x2b')](db['VoiceQueueReport']['rawAttributes'],function(_0x3417a2){return{'name':_0x3417a2[_0x57de('0x2c')],'type':_0x3417a2[_0x57de('0x2d')][_0x57de('0x2e')]};});_0x32588b[_0x57de('0x2f')]=_['map'](_0x4af93f,'name');_0x32588b[_0x57de('0x30')]=_[_0x57de('0x31')](_0x13c090[_0x57de('0x30')]);_0x32588b[_0x57de('0x32')]=_[_0x57de('0x33')](_0x32588b[_0x57de('0x2f')],_0x32588b['query']);_0x58598f[_0x57de('0x34')]=_[_0x57de('0x33')](_0x32588b[_0x57de('0x2f')],qs['fields'](_0x13c090[_0x57de('0x30')][_0x57de('0x35')]));_0x58598f[_0x57de('0x34')]=_0x58598f['attributes'][_0x57de('0x36')]?_0x58598f[_0x57de('0x34')]:_0x32588b['model'];if(!_0x13c090[_0x57de('0x30')]['hasOwnProperty'](_0x57de('0x37'))){_0x58598f[_0x57de('0x23')]=qs['limit'](_0x13c090['query']['limit']);_0x58598f['offset']=qs['offset'](_0x13c090[_0x57de('0x30')]['offset']);}_0x58598f['order']=qs[_0x57de('0x38')](_0x13c090[_0x57de('0x30')][_0x57de('0x38')]);_0x58598f[_0x57de('0x39')]=qs[_0x57de('0x32')](_[_0x57de('0x3a')](_0x13c090[_0x57de('0x30')],_0x32588b[_0x57de('0x32')]),_0x4af93f);if(_0x13c090[_0x57de('0x30')][_0x57de('0x3b')]){_0x58598f[_0x57de('0x39')]=_[_0x57de('0x3c')](_0x58598f[_0x57de('0x39')],{'$or':_[_0x57de('0x2b')](_0x4af93f,function(_0x431388){if(_0x431388[_0x57de('0x2d')]!=='VIRTUAL'){var _0x507b26={};_0x507b26[_0x431388[_0x57de('0x2a')]]={'$like':'%'+_0x13c090[_0x57de('0x30')]['filter']+'%'};return _0x507b26;}})});}_0x58598f=_[_0x57de('0x3c')]({},_0x58598f,_0x13c090[_0x57de('0x3d')]);var _0x224448={'where':_0x58598f[_0x57de('0x39')]};return db[_0x57de('0x3e')]['count'](_0x224448)[_0x57de('0x27')](function(_0x11dc67){_0x138de7[_0x57de('0x22')]=_0x11dc67;if(_0x13c090[_0x57de('0x30')][_0x57de('0x3f')]){_0x58598f[_0x57de('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x57de('0x41')](_0x58598f);})[_0x57de('0x27')](function(_0x2dcf30){_0x138de7[_0x57de('0x42')]=_0x2dcf30;return _0x138de7;})[_0x57de('0x27')](respondWithFilteredResult(_0x365022,_0x58598f))[_0x57de('0x43')](handleError(_0x365022,null));};exports[_0x57de('0x44')]=function(_0x4ed5e1,_0x5c080f){var _0x2a4800={'raw':![],'where':{'id':_0x4ed5e1['params']['id']}},_0x53bd8d={};_0x53bd8d[_0x57de('0x2f')]=_[_0x57de('0x31')](db[_0x57de('0x3e')][_0x57de('0x45')]);_0x53bd8d[_0x57de('0x30')]=_[_0x57de('0x31')](_0x4ed5e1[_0x57de('0x30')]);_0x53bd8d[_0x57de('0x32')]=_[_0x57de('0x33')](_0x53bd8d[_0x57de('0x2f')],_0x53bd8d[_0x57de('0x30')]);_0x2a4800['attributes']=_[_0x57de('0x33')](_0x53bd8d['model'],qs['fields'](_0x4ed5e1[_0x57de('0x30')][_0x57de('0x35')]));_0x2a4800[_0x57de('0x34')]=_0x2a4800[_0x57de('0x34')]['length']?_0x2a4800['attributes']:_0x53bd8d['model'];if(_0x4ed5e1[_0x57de('0x30')][_0x57de('0x3f')]){_0x2a4800[_0x57de('0x40')]=[{'all':!![]}];}_0x2a4800=_[_0x57de('0x3c')]({},_0x2a4800,_0x4ed5e1[_0x57de('0x3d')]);return db['VoiceQueueReport'][_0x57de('0x46')](_0x2a4800)[_0x57de('0x27')](handleEntityNotFound(_0x5c080f,null))[_0x57de('0x27')](respondWithResult(_0x5c080f,null))[_0x57de('0x43')](handleError(_0x5c080f,null));};exports[_0x57de('0x47')]=function(_0x408fd8,_0x477384){return db[_0x57de('0x3e')]['create'](_0x408fd8[_0x57de('0x48')],{})[_0x57de('0x27')](respondWithResult(_0x477384,0xc9))['catch'](handleError(_0x477384,null));};exports[_0x57de('0x49')]=function(_0x5cd48b,_0x11fb1f){if(_0x5cd48b[_0x57de('0x48')]['id']){delete _0x5cd48b[_0x57de('0x48')]['id'];}return db[_0x57de('0x3e')][_0x57de('0x46')]({'where':{'id':_0x5cd48b['params']['id']}})[_0x57de('0x27')](handleEntityNotFound(_0x11fb1f,null))[_0x57de('0x27')](saveUpdates(_0x5cd48b[_0x57de('0x48')],null))[_0x57de('0x27')](respondWithResult(_0x11fb1f,null))[_0x57de('0x43')](handleError(_0x11fb1f,null));};exports[_0x57de('0x26')]=function(_0x2af940,_0xf4968){return db['VoiceQueueReport'][_0x57de('0x46')]({'where':{'id':_0x2af940['params']['id']}})[_0x57de('0x27')](handleEntityNotFound(_0xf4968,null))[_0x57de('0x27')](removeEntity(_0xf4968,null))[_0x57de('0x43')](handleError(_0xf4968,null));};exports[_0x57de('0x4a')]=function(_0x13a35e,_0x598786){return db[_0x57de('0x3e')][_0x57de('0x4a')]()[_0x57de('0x27')](respondWithResult(_0x598786,null))[_0x57de('0x43')](handleError(_0x598786,null));};exports['getVoiceQueuesReport']=function(_0x4cf7c7,_0x3cbe22){var _0x5211b0={},_0x20b989={},_0x2cfca5={'count':0x0,'rows':[]};_0x20b989[_0x57de('0x2f')]=_['keys'](db[_0x57de('0x3e')][_0x57de('0x45')]);_0x20b989[_0x57de('0x30')]=_['keys'](_0x4cf7c7[_0x57de('0x30')]);_0x20b989[_0x57de('0x32')]=_[_0x57de('0x33')](_0x20b989[_0x57de('0x2f')],_0x20b989['query']);_0x5211b0[_0x57de('0x34')]=_[_0x57de('0x33')](_0x20b989[_0x57de('0x2f')],qs[_0x57de('0x35')](_0x4cf7c7[_0x57de('0x30')]['fields']));_0x5211b0[_0x57de('0x34')]=_0x5211b0[_0x57de('0x34')][_0x57de('0x36')]?_0x5211b0[_0x57de('0x34')]:_0x20b989[_0x57de('0x2f')];if(!_0x4cf7c7[_0x57de('0x30')][_0x57de('0x4b')](_0x57de('0x37'))){_0x5211b0[_0x57de('0x23')]=qs[_0x57de('0x23')](_0x4cf7c7[_0x57de('0x30')][_0x57de('0x23')]);_0x5211b0[_0x57de('0x20')]=qs['offset'](_0x4cf7c7[_0x57de('0x30')]['offset']);}_0x5211b0[_0x57de('0x4c')]=qs[_0x57de('0x38')](_0x4cf7c7['query']['sort']);_0x5211b0[_0x57de('0x39')]=qs[_0x57de('0x32')](_[_0x57de('0x3a')](_0x4cf7c7[_0x57de('0x30')],_0x20b989[_0x57de('0x32')]));if(_0x4cf7c7[_0x57de('0x30')][_0x57de('0x3b')]){_0x5211b0[_0x57de('0x39')]=_[_0x57de('0x3c')](_0x5211b0[_0x57de('0x39')],{'$or':_[_0x57de('0x2b')](_0x5211b0[_0x57de('0x34')],function(_0x30eac6){var _0x5a8bb0={};_0x5a8bb0[_0x30eac6]={'$like':'%'+_0x4cf7c7[_0x57de('0x30')][_0x57de('0x3b')]+'%'};return _0x5a8bb0;})});}_0x5211b0=_[_0x57de('0x3c')]({},_0x5211b0,_0x4cf7c7[_0x57de('0x3d')]);var _0x3b1c9d={'where':_0x5211b0[_0x57de('0x39')]};return db['VoiceQueueReport'][_0x57de('0x22')](_0x3b1c9d)['then'](function(_0x5bb430){_0x2cfca5[_0x57de('0x22')]=_0x5bb430;if(_0x4cf7c7['query'][_0x57de('0x3f')]){_0x5211b0['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x57de('0x41')](_0x5211b0);})['then'](function(_0x2d9f6c){_0x2cfca5[_0x57de('0x42')]=_0x2d9f6c;return _0x2cfca5;})[_0x57de('0x27')](respondWithFilteredResult(_0x3cbe22,_0x5211b0,_0x57de('0x4d')))[_0x57de('0x43')](handleError(_0x3cbe22,null,'getVoiceQueuesReport'));};
\ No newline at end of file
+var _0x67f4=['keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','update','describe','getVoiceQueuesReport','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x5d1d00,_0x3861d3){var _0x368b73=function(_0x1b78dd){while(--_0x1b78dd){_0x5d1d00['push'](_0x5d1d00['shift']());}};_0x368b73(++_0x3861d3);}(_0x67f4,0x6e));var _0x467f=function(_0x262e75,_0x18021e){_0x262e75=_0x262e75-0x0;var _0x145cec=_0x67f4[_0x262e75];return _0x145cec;};'use strict';var emlformat=require(_0x467f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x467f('0x1'));var rp=require(_0x467f('0x2'));var moment=require(_0x467f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x467f('0x4'));var util=require(_0x467f('0x5'));var path=require('path');var sox=require(_0x467f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x467f('0x7'));var _=require(_0x467f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x467f('0x9'));var deskjs=require(_0x467f('0xa'));var toCsv=require(_0x467f('0xb'));var querystring=require(_0x467f('0xc'));var Papa=require(_0x467f('0xd'));var Redis=require(_0x467f('0xe'));var authService=require(_0x467f('0xf'));var qs=require(_0x467f('0x10'));var as=require(_0x467f('0x11'));var hardwareService=require(_0x467f('0x12'));var logger=require(_0x467f('0x13'))(_0x467f('0x14'));var utils=require(_0x467f('0x15'));var config=require(_0x467f('0x16'));var licenseUtil=require(_0x467f('0x17'));var db=require(_0x467f('0x18'))['db'];config[_0x467f('0x19')]=_['defaults'](config[_0x467f('0x19')],{'host':_0x467f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x467f('0x19')]));require(_0x467f('0x1b'))[_0x467f('0x1c')](socket);function respondWithStatusCode(_0x1d4e6c,_0x5d3746){_0x5d3746=_0x5d3746||0xcc;return function(_0x1f4962){if(_0x1f4962){return _0x1d4e6c[_0x467f('0x1d')](_0x5d3746);}return _0x1d4e6c[_0x467f('0x1e')](_0x5d3746)[_0x467f('0x1f')]();};}function respondWithResult(_0x1ba867,_0x350234){_0x350234=_0x350234||0xc8;return function(_0x34f0b0){if(_0x34f0b0){return _0x1ba867[_0x467f('0x1e')](_0x350234)[_0x467f('0x20')](_0x34f0b0);}};}function respondWithFilteredResult(_0x2b58c9,_0x4744bf){return function(_0x1b8941){if(_0x1b8941){var _0x286ba6=typeof _0x4744bf[_0x467f('0x21')]==='undefined'&&typeof _0x4744bf[_0x467f('0x22')]===_0x467f('0x23');var _0x596a46=_0x1b8941[_0x467f('0x24')];var _0x4ffaf7=_0x286ba6?0x0:_0x4744bf[_0x467f('0x21')];var _0x367e56=_0x286ba6?_0x1b8941[_0x467f('0x24')]:_0x4744bf[_0x467f('0x21')]+_0x4744bf['limit'];var _0x5d2aa2;if(_0x367e56>=_0x596a46){_0x367e56=_0x596a46;_0x5d2aa2=0xc8;}else{_0x5d2aa2=0xce;}_0x2b58c9[_0x467f('0x1e')](_0x5d2aa2);return _0x2b58c9[_0x467f('0x25')](_0x467f('0x26'),_0x4ffaf7+'-'+_0x367e56+'/'+_0x596a46)[_0x467f('0x20')](_0x1b8941);}return null;};}function patchUpdates(_0x2d4486){return function(_0x2d15f4){try{jsonpatch[_0x467f('0x27')](_0x2d15f4,_0x2d4486,!![]);}catch(_0x48207c){return BPromise[_0x467f('0x28')](_0x48207c);}return _0x2d15f4['save']();};}function saveUpdates(_0x1667a6,_0x5731f4){return function(_0x17e64e){if(_0x17e64e){return _0x17e64e['update'](_0x1667a6)[_0x467f('0x29')](function(_0x562132){return _0x562132;});}return null;};}function removeEntity(_0x220fcd,_0x57bc17){return function(_0x96a4ff){if(_0x96a4ff){return _0x96a4ff[_0x467f('0x2a')]()[_0x467f('0x29')](function(){_0x220fcd[_0x467f('0x1e')](0xcc)[_0x467f('0x1f')]();});}};}function handleEntityNotFound(_0x1bdc1a,_0x30dd45){return function(_0xfda014){if(!_0xfda014){_0x1bdc1a['sendStatus'](0x194);}return _0xfda014;};}function handleError(_0x25a344,_0x155fec){_0x155fec=_0x155fec||0x1f4;return function(_0x33e99f){logger['error'](_0x33e99f[_0x467f('0x2b')]);if(_0x33e99f['name']){delete _0x33e99f[_0x467f('0x2c')];}_0x25a344[_0x467f('0x1e')](_0x155fec)['send'](_0x33e99f);};}exports[_0x467f('0x2d')]=function(_0x4a9789,_0x217db9){var _0x2d1cc4={},_0x201a22={},_0x19a656={'count':0x0,'rows':[]};var _0x4773f1=_[_0x467f('0x2e')](db[_0x467f('0x2f')][_0x467f('0x30')],function(_0x5d0f7d){return{'name':_0x5d0f7d[_0x467f('0x31')],'type':_0x5d0f7d[_0x467f('0x32')][_0x467f('0x33')]};});_0x201a22[_0x467f('0x34')]=_[_0x467f('0x2e')](_0x4773f1,_0x467f('0x2c'));_0x201a22[_0x467f('0x35')]=_[_0x467f('0x36')](_0x4a9789[_0x467f('0x35')]);_0x201a22['filters']=_[_0x467f('0x37')](_0x201a22[_0x467f('0x34')],_0x201a22[_0x467f('0x35')]);_0x2d1cc4['attributes']=_[_0x467f('0x37')](_0x201a22[_0x467f('0x34')],qs[_0x467f('0x38')](_0x4a9789[_0x467f('0x35')][_0x467f('0x38')]));_0x2d1cc4['attributes']=_0x2d1cc4[_0x467f('0x39')][_0x467f('0x3a')]?_0x2d1cc4[_0x467f('0x39')]:_0x201a22[_0x467f('0x34')];if(!_0x4a9789[_0x467f('0x35')][_0x467f('0x3b')](_0x467f('0x3c'))){_0x2d1cc4['limit']=qs[_0x467f('0x22')](_0x4a9789[_0x467f('0x35')]['limit']);_0x2d1cc4[_0x467f('0x21')]=qs['offset'](_0x4a9789[_0x467f('0x35')][_0x467f('0x21')]);}_0x2d1cc4[_0x467f('0x3d')]=qs['sort'](_0x4a9789[_0x467f('0x35')][_0x467f('0x3e')]);_0x2d1cc4[_0x467f('0x3f')]=qs[_0x467f('0x40')](_[_0x467f('0x41')](_0x4a9789[_0x467f('0x35')],_0x201a22['filters']),_0x4773f1);if(_0x4a9789[_0x467f('0x35')][_0x467f('0x42')]){_0x2d1cc4[_0x467f('0x3f')]=_['merge'](_0x2d1cc4[_0x467f('0x3f')],{'$or':_[_0x467f('0x2e')](_0x4773f1,function(_0x1cfe9d){if(_0x1cfe9d[_0x467f('0x32')]!==_0x467f('0x43')){var _0x485a5d={};_0x485a5d[_0x1cfe9d[_0x467f('0x2c')]]={'$like':'%'+_0x4a9789[_0x467f('0x35')][_0x467f('0x42')]+'%'};return _0x485a5d;}})});}_0x2d1cc4=_[_0x467f('0x44')]({},_0x2d1cc4,_0x4a9789[_0x467f('0x45')]);var _0x124e8d={'where':_0x2d1cc4[_0x467f('0x3f')]};return db[_0x467f('0x2f')][_0x467f('0x24')](_0x124e8d)['then'](function(_0x145251){_0x19a656['count']=_0x145251;if(_0x4a9789[_0x467f('0x35')][_0x467f('0x46')]){_0x2d1cc4[_0x467f('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x467f('0x48')](_0x2d1cc4);})['then'](function(_0x2700aa){_0x19a656[_0x467f('0x49')]=_0x2700aa;return _0x19a656;})[_0x467f('0x29')](respondWithFilteredResult(_0x217db9,_0x2d1cc4))['catch'](handleError(_0x217db9,null));};exports['show']=function(_0x22249c,_0xb0d095){var _0xf32e4b={'raw':![],'where':{'id':_0x22249c[_0x467f('0x4a')]['id']}},_0x2ee3f6={};_0x2ee3f6[_0x467f('0x34')]=_['keys'](db[_0x467f('0x2f')][_0x467f('0x30')]);_0x2ee3f6[_0x467f('0x35')]=_[_0x467f('0x36')](_0x22249c[_0x467f('0x35')]);_0x2ee3f6[_0x467f('0x40')]=_['intersection'](_0x2ee3f6['model'],_0x2ee3f6[_0x467f('0x35')]);_0xf32e4b[_0x467f('0x39')]=_[_0x467f('0x37')](_0x2ee3f6[_0x467f('0x34')],qs[_0x467f('0x38')](_0x22249c[_0x467f('0x35')][_0x467f('0x38')]));_0xf32e4b[_0x467f('0x39')]=_0xf32e4b[_0x467f('0x39')][_0x467f('0x3a')]?_0xf32e4b[_0x467f('0x39')]:_0x2ee3f6[_0x467f('0x34')];if(_0x22249c[_0x467f('0x35')][_0x467f('0x46')]){_0xf32e4b[_0x467f('0x47')]=[{'all':!![]}];}_0xf32e4b=_[_0x467f('0x44')]({},_0xf32e4b,_0x22249c[_0x467f('0x45')]);return db[_0x467f('0x2f')][_0x467f('0x4b')](_0xf32e4b)['then'](handleEntityNotFound(_0xb0d095,null))[_0x467f('0x29')](respondWithResult(_0xb0d095,null))[_0x467f('0x4c')](handleError(_0xb0d095,null));};exports[_0x467f('0x4d')]=function(_0x5721cd,_0x49a337){return db[_0x467f('0x2f')][_0x467f('0x4d')](_0x5721cd[_0x467f('0x4e')],{})[_0x467f('0x29')](respondWithResult(_0x49a337,0xc9))['catch'](handleError(_0x49a337,null));};exports[_0x467f('0x4f')]=function(_0x4e4dc2,_0x4a8548){if(_0x4e4dc2[_0x467f('0x4e')]['id']){delete _0x4e4dc2['body']['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x4e4dc2[_0x467f('0x4a')]['id']}})[_0x467f('0x29')](handleEntityNotFound(_0x4a8548,null))['then'](saveUpdates(_0x4e4dc2[_0x467f('0x4e')],null))[_0x467f('0x29')](respondWithResult(_0x4a8548,null))[_0x467f('0x4c')](handleError(_0x4a8548,null));};exports[_0x467f('0x2a')]=function(_0x2835ec,_0x25e1d9){return db[_0x467f('0x2f')][_0x467f('0x4b')]({'where':{'id':_0x2835ec[_0x467f('0x4a')]['id']}})[_0x467f('0x29')](handleEntityNotFound(_0x25e1d9,null))[_0x467f('0x29')](removeEntity(_0x25e1d9,null))[_0x467f('0x4c')](handleError(_0x25e1d9,null));};exports[_0x467f('0x50')]=function(_0x213093,_0x378670){return db[_0x467f('0x2f')][_0x467f('0x50')]()['then'](respondWithResult(_0x378670,null))['catch'](handleError(_0x378670,null));};exports[_0x467f('0x51')]=function(_0x21c33a,_0xe5ca9d){var _0x120786={},_0x22b64c={},_0x22e630={'count':0x0,'rows':[]};_0x22b64c[_0x467f('0x34')]=_[_0x467f('0x36')](db[_0x467f('0x2f')][_0x467f('0x30')]);_0x22b64c[_0x467f('0x35')]=_[_0x467f('0x36')](_0x21c33a['query']);_0x22b64c['filters']=_[_0x467f('0x37')](_0x22b64c[_0x467f('0x34')],_0x22b64c[_0x467f('0x35')]);_0x120786['attributes']=_['intersection'](_0x22b64c[_0x467f('0x34')],qs[_0x467f('0x38')](_0x21c33a[_0x467f('0x35')]['fields']));_0x120786[_0x467f('0x39')]=_0x120786[_0x467f('0x39')][_0x467f('0x3a')]?_0x120786[_0x467f('0x39')]:_0x22b64c['model'];if(!_0x21c33a[_0x467f('0x35')]['hasOwnProperty'](_0x467f('0x3c'))){_0x120786[_0x467f('0x22')]=qs[_0x467f('0x22')](_0x21c33a[_0x467f('0x35')][_0x467f('0x22')]);_0x120786[_0x467f('0x21')]=qs[_0x467f('0x21')](_0x21c33a[_0x467f('0x35')][_0x467f('0x21')]);}_0x120786[_0x467f('0x3d')]=qs[_0x467f('0x3e')](_0x21c33a['query'][_0x467f('0x3e')]);_0x120786['where']=qs[_0x467f('0x40')](_['pick'](_0x21c33a['query'],_0x22b64c[_0x467f('0x40')]));if(_0x21c33a[_0x467f('0x35')][_0x467f('0x42')]){_0x120786[_0x467f('0x3f')]=_[_0x467f('0x44')](_0x120786[_0x467f('0x3f')],{'$or':_['map'](_0x120786[_0x467f('0x39')],function(_0x3daa22){var _0x1d5071={};_0x1d5071[_0x3daa22]={'$like':'%'+_0x21c33a[_0x467f('0x35')][_0x467f('0x42')]+'%'};return _0x1d5071;})});}_0x120786=_[_0x467f('0x44')]({},_0x120786,_0x21c33a['options']);var _0x28ff3c={'where':_0x120786[_0x467f('0x3f')]};return db[_0x467f('0x2f')][_0x467f('0x24')](_0x28ff3c)['then'](function(_0xac60dc){_0x22e630[_0x467f('0x24')]=_0xac60dc;if(_0x21c33a['query']['includeAll']){_0x120786[_0x467f('0x47')]=[{'all':!![]}];}return db[_0x467f('0x2f')][_0x467f('0x48')](_0x120786);})[_0x467f('0x29')](function(_0x2a10f6){_0x22e630[_0x467f('0x49')]=_0x2a10f6;return _0x22e630;})[_0x467f('0x29')](respondWithFilteredResult(_0xe5ca9d,_0x120786,_0x467f('0x51')))['catch'](handleError(_0xe5ca9d,null,_0x467f('0x51')));};
\ No newline at end of file
index 3179bc4..bc7952c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x001b=['events','../../mysqldb','VoiceQueueReport','update','remove','emit','hasOwnProperty'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x001b,0x150));var _0xb001=function(_0xcccd64,_0x5c4150){_0xcccd64=_0xcccd64-0x0;var _0x3ceca9=_0x001b[_0xcccd64];return _0x3ceca9;};'use strict';var EventEmitter=require(_0xb001('0x0'));var VoiceQueueReport=require(_0xb001('0x1'))['db'][_0xb001('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb001('0x3'),'afterDestroy':_0xb001('0x4')};function emitEvent(_0x53fe35){return function(_0x2d808b,_0x149556,_0x44d246){VoiceQueueReportEvents[_0xb001('0x5')](_0x53fe35+':'+_0x2d808b['id'],_0x2d808b);VoiceQueueReportEvents[_0xb001('0x5')](_0x53fe35,_0x2d808b);_0x44d246(null);};}for(var e in events){if(events[_0xb001('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x177d=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport'];(function(_0x16eb66,_0x4996cc){var _0x2383f5=function(_0x2018f7){while(--_0x2018f7){_0x16eb66['push'](_0x16eb66['shift']());}};_0x2383f5(++_0x4996cc);}(_0x177d,0x166));var _0xd177=function(_0x3169e5,_0x5a448a){_0x3169e5=_0x3169e5-0x0;var _0x9e5d82=_0x177d[_0x3169e5];return _0x9e5d82;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xd177('0x0'))['db'][_0xd177('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd177('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd177('0x3')};function emitEvent(_0xa333d4){return function(_0x1ad2fd,_0x492221,_0x488fc0){VoiceQueueReportEvents[_0xd177('0x4')](_0xa333d4+':'+_0x1ad2fd['id'],_0x1ad2fd);VoiceQueueReportEvents[_0xd177('0x4')](_0xa333d4,_0x1ad2fd);_0x488fc0(null);};}for(var e in events){if(events[_0xd177('0x5')](e)){var event=events[e];VoiceQueueReport[_0xd177('0x6')](e,emitEvent(event));}}module[_0xd177('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 8ec06be..f022b36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc412=['bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x28a1a5,_0x1131f1){var _0x2cceb6=function(_0x339a52){while(--_0x339a52){_0x28a1a5['push'](_0x28a1a5['shift']());}};_0x2cceb6(++_0x1131f1);}(_0xc412,0x1b7));var _0x2c41=function(_0x749c28,_0x1ca300){_0x749c28=_0x749c28-0x0;var _0x15fa15=_0xc412[_0x749c28];return _0x15fa15;};'use strict';var _=require(_0x2c41('0x0'));var util=require(_0x2c41('0x1'));var logger=require(_0x2c41('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c41('0x3'));var rp=require(_0x2c41('0x4'));var fs=require('fs');var path=require(_0x2c41('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c41('0x6'));module[_0x2c41('0x7')]=function(_0x3fbb2e,_0x205ebf){return _0x3fbb2e[_0x2c41('0x8')](_0x2c41('0x9'),attributes,{'tableName':_0x2c41('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2c41('0xb')]},{'fields':[_0x2c41('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x745b=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x25b022,_0x14b25b){var _0x5b53a8=function(_0x201c33){while(--_0x201c33){_0x25b022['push'](_0x25b022['shift']());}};_0x5b53a8(++_0x14b25b);}(_0x745b,0x87));var _0xb745=function(_0x207426,_0xe2b720){_0x207426=_0x207426-0x0;var _0x18715d=_0x745b[_0x207426];return _0x18715d;};'use strict';var _=require(_0xb745('0x0'));var util=require(_0xb745('0x1'));var logger=require(_0xb745('0x2'))(_0xb745('0x3'));var moment=require(_0xb745('0x4'));var BPromise=require(_0xb745('0x5'));var rp=require(_0xb745('0x6'));var fs=require('fs');var path=require(_0xb745('0x7'));var rimraf=require(_0xb745('0x8'));var config=require(_0xb745('0x9'));var attributes=require(_0xb745('0xa'));module['exports']=function(_0xa906cc,_0x5773c3){return _0xa906cc['define'](_0xb745('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xb745('0xc')]},{'fields':[_0xb745('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a4e639d..7e7bbdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e3=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','map','include','model','stringify','catch','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x21e3,0x136));var _0x321e=function(_0xe90e3f,_0x41d4f5){_0xe90e3f=_0xe90e3f-0x0;var _0x51b714=_0x21e3[_0xe90e3f];return _0x51b714;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x321e('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x321e('0x1'))['db'];var utils=require(_0x321e('0x2'));var logger=require(_0x321e('0x3'))(_0x321e('0x4'));var config=require(_0x321e('0x5'));var jayson=require(_0x321e('0x6'));var client=jayson[_0x321e('0x7')][_0x321e('0x8')]({'port':0x232a});config[_0x321e('0x9')]=_[_0x321e('0xa')](config[_0x321e('0x9')],{'host':_0x321e('0xb'),'port':0x18eb});var socket=require(_0x321e('0xc'))(new Redis(config['redis']));require(_0x321e('0xd'))[_0x321e('0xe')](socket);function respondWithRpcPromise(_0x1c1eae,_0x1d9548,_0x469388){return new BPromise(function(_0x4c03bb,_0x3f3e38){return client[_0x321e('0xf')](_0x1c1eae,_0x469388)[_0x321e('0x10')](function(_0x8eb482){logger[_0x321e('0x11')](_0x321e('0x12'),_0x1d9548,_0x321e('0x13'));logger[_0x321e('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1d9548,_0x321e('0x13'),JSON['stringify'](_0x8eb482));if(_0x8eb482[_0x321e('0x15')]){if(_0x8eb482[_0x321e('0x15')]['code']===0x1f4){logger[_0x321e('0x15')](_0x321e('0x12'),_0x1d9548,_0x8eb482[_0x321e('0x15')]['message']);return _0x3f3e38(_0x8eb482[_0x321e('0x15')][_0x321e('0x16')]);}logger['error'](_0x321e('0x12'),_0x1d9548,_0x8eb482[_0x321e('0x15')][_0x321e('0x16')]);return _0x4c03bb(_0x8eb482[_0x321e('0x15')]['message']);}else{logger[_0x321e('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d9548,_0x321e('0x13'));_0x4c03bb(_0x8eb482['result']['message']);}})['catch'](function(_0x533092){logger[_0x321e('0x15')](_0x321e('0x12'),_0x1d9548,_0x533092);_0x3f3e38(_0x533092);});});}exports[_0x321e('0x17')]=function(_0x9824e4){var _0x19aeb4=this;return new Promise(function(_0x328d65,_0x133848){return db[_0x321e('0x18')][_0x321e('0x19')]({'raw':_0x9824e4[_0x321e('0x1a')]?_0x9824e4[_0x321e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x9824e4['options']?_0x9824e4[_0x321e('0x1a')][_0x321e('0x1b')]||null:null,'attributes':_0x9824e4['options']?_0x9824e4[_0x321e('0x1a')][_0x321e('0x1c')]||null:null,'limit':_0x9824e4[_0x321e('0x1a')]?_0x9824e4[_0x321e('0x1a')][_0x321e('0x1d')]||null:null,'include':_0x9824e4[_0x321e('0x1a')]?_0x9824e4[_0x321e('0x1a')]['include']?_[_0x321e('0x1e')](_0x9824e4[_0x321e('0x1a')][_0x321e('0x1f')],function(_0x29a0ed){return{'model':db[_0x29a0ed[_0x321e('0x20')]],'as':_0x29a0ed['as'],'attributes':_0x29a0ed['attributes'],'include':_0x29a0ed[_0x321e('0x1f')]?_[_0x321e('0x1e')](_0x29a0ed[_0x321e('0x1f')],function(_0x1502aa){return{'model':db[_0x1502aa[_0x321e('0x20')]],'as':_0x1502aa['as'],'attributes':_0x1502aa[_0x321e('0x1c')],'include':_0x1502aa[_0x321e('0x1f')]?_[_0x321e('0x1e')](_0x1502aa[_0x321e('0x1f')],function(_0x30d7c3){return{'model':db[_0x30d7c3[_0x321e('0x20')]],'as':_0x30d7c3['as'],'attributes':_0x30d7c3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56c3ff){logger[_0x321e('0x11')](_0x321e('0x17'),_0x9824e4);logger[_0x321e('0x14')](_0x321e('0x17'),_0x9824e4,JSON[_0x321e('0x21')](_0x56c3ff));_0x328d65(_0x56c3ff);})[_0x321e('0x22')](function(_0x592e4d){logger[_0x321e('0x15')](_0x321e('0x17'),_0x592e4d[_0x321e('0x16')],_0x9824e4);_0x133848(_0x19aeb4[_0x321e('0x15')](0x1f4,_0x592e4d['message']));});});};exports[_0x321e('0x23')]=function(_0x5b4c0d){var _0x29341d=this;return new Promise(function(_0x101f2,_0x130b47){return db[_0x321e('0x18')][_0x321e('0x24')](_0x5b4c0d[_0x321e('0x25')],{'raw':_0x5b4c0d[_0x321e('0x1a')]?_0x5b4c0d[_0x321e('0x1a')][_0x321e('0x26')]===undefined?!![]:![]:!![]})[_0x321e('0x10')](function(_0x5f4fd8){logger[_0x321e('0x11')](_0x321e('0x23'),_0x5b4c0d);logger[_0x321e('0x14')]('CreateVoiceQueueReport',_0x5b4c0d,JSON['stringify'](_0x5f4fd8));_0x101f2(_0x5f4fd8);})[_0x321e('0x22')](function(_0x243de0){logger[_0x321e('0x15')](_0x321e('0x23'),_0x243de0[_0x321e('0x16')],_0x5b4c0d);_0x130b47(_0x29341d[_0x321e('0x15')](0x1f4,_0x243de0['message']));});});};exports[_0x321e('0x27')]=function(_0x55fdb6){var _0x251845=this;return new Promise(function(_0x40903c,_0x28ad58){return db[_0x321e('0x18')][_0x321e('0x28')](_0x55fdb6['body'],{'raw':_0x55fdb6['options']?_0x55fdb6[_0x321e('0x1a')][_0x321e('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55fdb6[_0x321e('0x1a')]?_0x55fdb6[_0x321e('0x1a')][_0x321e('0x1b')]||null:null,'attributes':_0x55fdb6[_0x321e('0x1a')]?_0x55fdb6[_0x321e('0x1a')][_0x321e('0x1c')]||null:null,'limit':_0x55fdb6[_0x321e('0x1a')]?_0x55fdb6[_0x321e('0x1a')][_0x321e('0x1d')]||null:null})['then'](function(_0x34d102){logger[_0x321e('0x11')]('UpdateVoiceQueueReport',_0x55fdb6);logger[_0x321e('0x14')]('UpdateVoiceQueueReport',_0x55fdb6,JSON[_0x321e('0x21')](_0x34d102));_0x40903c(_0x34d102);})[_0x321e('0x22')](function(_0x516fe4){logger[_0x321e('0x15')](_0x321e('0x27'),_0x516fe4[_0x321e('0x16')],_0x55fdb6);_0x28ad58(_0x251845[_0x321e('0x15')](0x1f4,_0x516fe4[_0x321e('0x16')]));});});};
\ No newline at end of file
+var _0xffa2=['CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','then','debug'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xffa2,0x16b));var _0x2ffa=function(_0xb791a8,_0x6ff12b){_0xb791a8=_0xb791a8-0x0;var _0x31657f=_0xffa2[_0xb791a8];return _0x31657f;};'use strict';var _=require(_0x2ffa('0x0'));var util=require(_0x2ffa('0x1'));var moment=require(_0x2ffa('0x2'));var BPromise=require(_0x2ffa('0x3'));var rs=require(_0x2ffa('0x4'));var fs=require('fs');var Redis=require(_0x2ffa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ffa('0x6'));var logger=require(_0x2ffa('0x7'))(_0x2ffa('0x8'));var config=require(_0x2ffa('0x9'));var jayson=require(_0x2ffa('0xa'));var client=jayson[_0x2ffa('0xb')][_0x2ffa('0xc')]({'port':0x232a});config[_0x2ffa('0xd')]=_[_0x2ffa('0xe')](config[_0x2ffa('0xd')],{'host':_0x2ffa('0xf'),'port':0x18eb});var socket=require(_0x2ffa('0x10'))(new Redis(config[_0x2ffa('0xd')]));require(_0x2ffa('0x11'))[_0x2ffa('0x12')](socket);function respondWithRpcPromise(_0x12767a,_0x1a8a0a,_0x5e070e){return new BPromise(function(_0x1a2954,_0xf9fdc3){return client[_0x2ffa('0x13')](_0x12767a,_0x5e070e)['then'](function(_0x388b14){logger[_0x2ffa('0x14')](_0x2ffa('0x15'),_0x1a8a0a,_0x2ffa('0x16'));logger['debug'](_0x2ffa('0x17'),_0x1a8a0a,_0x2ffa('0x16'),JSON[_0x2ffa('0x18')](_0x388b14));if(_0x388b14[_0x2ffa('0x19')]){if(_0x388b14['error'][_0x2ffa('0x1a')]===0x1f4){logger['error'](_0x2ffa('0x15'),_0x1a8a0a,_0x388b14[_0x2ffa('0x19')][_0x2ffa('0x1b')]);return _0xf9fdc3(_0x388b14[_0x2ffa('0x19')][_0x2ffa('0x1b')]);}logger[_0x2ffa('0x19')](_0x2ffa('0x15'),_0x1a8a0a,_0x388b14[_0x2ffa('0x19')][_0x2ffa('0x1b')]);return _0x1a2954(_0x388b14['error'][_0x2ffa('0x1b')]);}else{logger[_0x2ffa('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1a8a0a,_0x2ffa('0x16'));_0x1a2954(_0x388b14[_0x2ffa('0x1c')][_0x2ffa('0x1b')]);}})[_0x2ffa('0x1d')](function(_0x384ea1){logger['error'](_0x2ffa('0x15'),_0x1a8a0a,_0x384ea1);_0xf9fdc3(_0x384ea1);});});}exports[_0x2ffa('0x1e')]=function(_0x2fbe8e){var _0x5c7914=this;return new Promise(function(_0x59e455,_0x911db7){return db[_0x2ffa('0x1f')]['findAll']({'raw':_0x2fbe8e[_0x2ffa('0x20')]?_0x2fbe8e[_0x2ffa('0x20')][_0x2ffa('0x21')]===undefined?!![]:![]:!![],'where':_0x2fbe8e[_0x2ffa('0x20')]?_0x2fbe8e['options'][_0x2ffa('0x22')]||null:null,'attributes':_0x2fbe8e[_0x2ffa('0x20')]?_0x2fbe8e[_0x2ffa('0x20')][_0x2ffa('0x23')]||null:null,'limit':_0x2fbe8e[_0x2ffa('0x20')]?_0x2fbe8e['options'][_0x2ffa('0x24')]||null:null,'include':_0x2fbe8e[_0x2ffa('0x20')]?_0x2fbe8e['options'][_0x2ffa('0x25')]?_[_0x2ffa('0x26')](_0x2fbe8e['options'][_0x2ffa('0x25')],function(_0x245574){return{'model':db[_0x245574['model']],'as':_0x245574['as'],'attributes':_0x245574['attributes'],'include':_0x245574[_0x2ffa('0x25')]?_[_0x2ffa('0x26')](_0x245574['include'],function(_0x37135f){return{'model':db[_0x37135f[_0x2ffa('0x27')]],'as':_0x37135f['as'],'attributes':_0x37135f[_0x2ffa('0x23')],'include':_0x37135f['include']?_[_0x2ffa('0x26')](_0x37135f[_0x2ffa('0x25')],function(_0xb98e3f){return{'model':db[_0xb98e3f['model']],'as':_0xb98e3f['as'],'attributes':_0xb98e3f[_0x2ffa('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2ffa('0x28')](function(_0x21dbee){logger[_0x2ffa('0x14')]('GetVoiceQueueReport',_0x2fbe8e);logger[_0x2ffa('0x29')](_0x2ffa('0x1e'),_0x2fbe8e,JSON[_0x2ffa('0x18')](_0x21dbee));_0x59e455(_0x21dbee);})[_0x2ffa('0x1d')](function(_0x5d05b7){logger[_0x2ffa('0x19')](_0x2ffa('0x1e'),_0x5d05b7['message'],_0x2fbe8e);_0x911db7(_0x5c7914['error'](0x1f4,_0x5d05b7[_0x2ffa('0x1b')]));});});};exports[_0x2ffa('0x2a')]=function(_0x19f4ac){var _0x34b7ad=this;return new Promise(function(_0x1bbd23,_0x42cb60){return db[_0x2ffa('0x1f')]['create'](_0x19f4ac[_0x2ffa('0x2b')],{'raw':_0x19f4ac[_0x2ffa('0x20')]?_0x19f4ac[_0x2ffa('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x2ffa('0x28')](function(_0x2091b1){logger[_0x2ffa('0x14')](_0x2ffa('0x2a'),_0x19f4ac);logger[_0x2ffa('0x29')](_0x2ffa('0x2a'),_0x19f4ac,JSON[_0x2ffa('0x18')](_0x2091b1));_0x1bbd23(_0x2091b1);})[_0x2ffa('0x1d')](function(_0x9c3844){logger[_0x2ffa('0x19')]('CreateVoiceQueueReport',_0x9c3844[_0x2ffa('0x1b')],_0x19f4ac);_0x42cb60(_0x34b7ad['error'](0x1f4,_0x9c3844[_0x2ffa('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4405b2){var _0x4d29ea=this;return new Promise(function(_0x2c6989,_0x3e053a){return db[_0x2ffa('0x1f')]['update'](_0x4405b2['body'],{'raw':_0x4405b2['options']?_0x4405b2[_0x2ffa('0x20')][_0x2ffa('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4405b2[_0x2ffa('0x20')]?_0x4405b2['options'][_0x2ffa('0x22')]||null:null,'attributes':_0x4405b2[_0x2ffa('0x20')]?_0x4405b2['options']['attributes']||null:null,'limit':_0x4405b2[_0x2ffa('0x20')]?_0x4405b2[_0x2ffa('0x20')][_0x2ffa('0x24')]||null:null})[_0x2ffa('0x28')](function(_0x38ab0c){logger[_0x2ffa('0x14')](_0x2ffa('0x2c'),_0x4405b2);logger[_0x2ffa('0x29')]('UpdateVoiceQueueReport',_0x4405b2,JSON[_0x2ffa('0x18')](_0x38ab0c));_0x2c6989(_0x38ab0c);})['catch'](function(_0x664be){logger['error'](_0x2ffa('0x2c'),_0x664be['message'],_0x4405b2);_0x3e053a(_0x4d29ea[_0x2ffa('0x19')](0x1f4,_0x664be[_0x2ffa('0x1b')]));});});};
\ No newline at end of file
index f725c9a..2cc38cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4873=['removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','emit'];(function(_0x199a02,_0x36bd70){var _0x9b4371=function(_0x2c379a){while(--_0x2c379a){_0x199a02['push'](_0x199a02['shift']());}};_0x9b4371(++_0x36bd70);}(_0x4873,0x1df));var _0x3487=function(_0x418b6e,_0x497554){_0x418b6e=_0x418b6e-0x0;var _0x10820d=_0x4873[_0x418b6e];return _0x10820d;};'use strict';var VoiceQueueReportEvents=require(_0x3487('0x0'));var events=[_0x3487('0x1'),_0x3487('0x2'),'update'];function createListener(_0x10ebd5,_0x4876b8){return function(_0x565778){_0x4876b8[_0x3487('0x3')](_0x10ebd5,_0x565778);};}function removeListener(_0xbc64e7,_0x54ff70){return function(){VoiceQueueReportEvents[_0x3487('0x4')](_0xbc64e7,_0x54ff70);};}exports[_0x3487('0x5')]=function(_0xbe12a4){for(var _0x2611dc=0x0,_0x193589=events['length'];_0x2611dc<_0x193589;_0x2611dc++){var _0x1d4cae=events[_0x2611dc];var _0x3df081=createListener(_0x3487('0x6')+_0x1d4cae,_0xbe12a4);VoiceQueueReportEvents['on'](_0x1d4cae,_0x3df081);}};
\ No newline at end of file
+var _0x54a1=['register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0x3d98bc,_0x2c23c9){var _0x50fa26=function(_0x3835b5){while(--_0x3835b5){_0x3d98bc['push'](_0x3d98bc['shift']());}};_0x50fa26(++_0x2c23c9);}(_0x54a1,0xf1));var _0x154a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x54a1[_0x87b0ff];return _0x3bc0b2;};'use strict';var VoiceQueueReportEvents=require(_0x154a('0x0'));var events=['save',_0x154a('0x1'),_0x154a('0x2')];function createListener(_0x50c956,_0x4de882){return function(_0x57f29b){_0x4de882[_0x154a('0x3')](_0x50c956,_0x57f29b);};}function removeListener(_0x5de25e,_0xa8980){return function(){VoiceQueueReportEvents['removeListener'](_0x5de25e,_0xa8980);};}exports[_0x154a('0x4')]=function(_0x1ba328){for(var _0x49bfc8=0x0,_0x311183=events[_0x154a('0x5')];_0x49bfc8<_0x311183;_0x49bfc8++){var _0x139865=events[_0x49bfc8];var _0x5a7747=createListener(_0x154a('0x6')+_0x139865,_0x1ba328);VoiceQueueReportEvents['on'](_0x139865,_0x5a7747);}};
\ No newline at end of file
index 1025da9..127694b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c8=['delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/:id','post','isAuthenticated','create','update'];(function(_0x198184,_0x1ab0c8){var _0x1ded9f=function(_0x41c11d){while(--_0x41c11d){_0x198184['push'](_0x198184['shift']());}};_0x1ded9f(++_0x1ab0c8);}(_0x24c8,0x196));var _0x824c=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x24c8[_0x205e5a];return _0x10da58;};'use strict';var multer=require(_0x824c('0x0'));var util=require('util');var path=require(_0x824c('0x1'));var timeout=require(_0x824c('0x2'));var express=require(_0x824c('0x3'));var router=express[_0x824c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x824c('0x5'));var interaction=require(_0x824c('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x824c('0x7')]);router[_0x824c('0x8')](_0x824c('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x824c('0xa')]('/',auth[_0x824c('0xb')](),controller[_0x824c('0xc')]);router['put'](_0x824c('0x9'),auth['isAuthenticated'](),controller[_0x824c('0xd')]);router[_0x824c('0xe')]('/:id',auth[_0x824c('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8eeb=['index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2cedc7,_0x3f7352){var _0x4006b2=function(_0x3698ee){while(--_0x3698ee){_0x2cedc7['push'](_0x2cedc7['shift']());}};_0x4006b2(++_0x3f7352);}(_0x8eeb,0x183));var _0xb8ee=function(_0x1c3652,_0x582081){_0x1c3652=_0x1c3652-0x0;var _0x276393=_0x8eeb[_0x1c3652];return _0x276393;};'use strict';var multer=require(_0xb8ee('0x0'));var util=require('util');var path=require(_0xb8ee('0x1'));var timeout=require(_0xb8ee('0x2'));var express=require('express');var router=express[_0xb8ee('0x3')]();var fs_extra=require(_0xb8ee('0x4'));var auth=require(_0xb8ee('0x5'));var interaction=require(_0xb8ee('0x6'));var config=require(_0xb8ee('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xb8ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xb8ee('0x9')]);router[_0xb8ee('0x8')](_0xb8ee('0xa'),auth[_0xb8ee('0xb')](),controller['show']);router[_0xb8ee('0xc')]('/',auth[_0xb8ee('0xb')](),controller[_0xb8ee('0xd')]);router['put'](_0xb8ee('0xa'),auth['isAuthenticated'](),controller[_0xb8ee('0xe')]);router[_0xb8ee('0xf')](_0xb8ee('0xa'),auth[_0xb8ee('0xb')](),controller[_0xb8ee('0x10')]);module[_0xb8ee('0x11')]=router;
\ No newline at end of file
index 29f08cd..94dc7c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7fe=['sequelize','moment','exports','STRING','DATE','format'];(function(_0x4440d7,_0x49cd29){var _0x5b5953=function(_0x133bea){while(--_0x133bea){_0x4440d7['push'](_0x4440d7['shift']());}};_0x5b5953(++_0x49cd29);}(_0xf7fe,0x192));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xef7f('0x0'));var moment=require(_0xef7f('0x1'));module[_0xef7f('0x2')]={'time':{'type':Sequelize[_0xef7f('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xef7f('0x4')],'allowNull':![],'defaultValue':moment()[_0xef7f('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0x8f18=['exports','STRING','DATE','format','sequelize','moment'];(function(_0x450255,_0x1fabe3){var _0x576166=function(_0x20ca5a){while(--_0x20ca5a){_0x450255['push'](_0x450255['shift']());}};_0x576166(++_0x1fabe3);}(_0x8f18,0x1ea));var _0x88f1=function(_0x1a4331,_0x8eff70){_0x1a4331=_0x1a4331-0x0;var _0x581f11=_0x8f18[_0x1a4331];return _0x581f11;};'use strict';var Sequelize=require(_0x88f1('0x0'));var moment=require(_0x88f1('0x1'));module[_0x88f1('0x2')]={'time':{'type':Sequelize[_0x88f1('0x3')]},'callid':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x88f1('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x88f1('0x4')],'allowNull':![],'defaultValue':moment()[_0x88f1('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index 71ed20f..ace5a65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1d9=['where','VIRTUAL','options','VoiceQueuesLog','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge'];(function(_0x4f9538,_0x2d22ea){var _0x11cf25=function(_0x5bbf99){while(--_0x5bbf99){_0x4f9538['push'](_0x4f9538['shift']());}};_0x11cf25(++_0x2d22ea);}(_0xf1d9,0x1c5));var _0x9f1d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f1d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9f1d('0x1'));var rp=require(_0x9f1d('0x2'));var moment=require(_0x9f1d('0x3'));var BPromise=require(_0x9f1d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9f1d('0x5'));var sox=require(_0x9f1d('0x6'));var csv=require(_0x9f1d('0x7'));var ejs=require(_0x9f1d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f1d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f1d('0x7'));var querystring=require(_0x9f1d('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f1d('0xb'));var qs=require(_0x9f1d('0xc'));var as=require(_0x9f1d('0xd'));var hardwareService=require(_0x9f1d('0xe'));var logger=require(_0x9f1d('0xf'))(_0x9f1d('0x10'));var utils=require(_0x9f1d('0x11'));var config=require(_0x9f1d('0x12'));var licenseUtil=require(_0x9f1d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x404928,_0x54d605){_0x54d605=_0x54d605||0xcc;return function(_0x166c95){if(_0x166c95){return _0x404928['sendStatus'](_0x54d605);}return _0x404928['status'](_0x54d605)[_0x9f1d('0x14')]();};}function respondWithResult(_0x4c6e40,_0x2e9bb5){_0x2e9bb5=_0x2e9bb5||0xc8;return function(_0x1a6831){if(_0x1a6831){return _0x4c6e40[_0x9f1d('0x15')](_0x2e9bb5)[_0x9f1d('0x16')](_0x1a6831);}};}function respondWithFilteredResult(_0x18bad4,_0x3a472c){return function(_0x3c5d0d){if(_0x3c5d0d){var _0x360fb5=typeof _0x3a472c[_0x9f1d('0x17')]===_0x9f1d('0x18')&&typeof _0x3a472c[_0x9f1d('0x19')]===_0x9f1d('0x18');var _0x23a6bb=_0x3c5d0d['count'];var _0x38bb14=_0x360fb5?0x0:_0x3a472c['offset'];var _0x3c106c=_0x360fb5?_0x3c5d0d[_0x9f1d('0x1a')]:_0x3a472c[_0x9f1d('0x17')]+_0x3a472c[_0x9f1d('0x19')];var _0x1d8e59;if(_0x3c106c>=_0x23a6bb){_0x3c106c=_0x23a6bb;_0x1d8e59=0xc8;}else{_0x1d8e59=0xce;}_0x18bad4[_0x9f1d('0x15')](_0x1d8e59);return _0x18bad4[_0x9f1d('0x1b')](_0x9f1d('0x1c'),_0x38bb14+'-'+_0x3c106c+'/'+_0x23a6bb)[_0x9f1d('0x16')](_0x3c5d0d);}return null;};}function patchUpdates(_0x1339e7){return function(_0x2f098a){try{jsonpatch[_0x9f1d('0x1d')](_0x2f098a,_0x1339e7,!![]);}catch(_0x53f86b){return BPromise[_0x9f1d('0x1e')](_0x53f86b);}return _0x2f098a[_0x9f1d('0x1f')]();};}function saveUpdates(_0x2ba4f7,_0x49484f){return function(_0x18d120){if(_0x18d120){return _0x18d120[_0x9f1d('0x20')](_0x2ba4f7)[_0x9f1d('0x21')](function(_0x5d86c1){return _0x5d86c1;});}return null;};}function removeEntity(_0x1ceafe,_0x123f32){return function(_0x3056cd){if(_0x3056cd){return _0x3056cd[_0x9f1d('0x22')]()['then'](function(){_0x1ceafe[_0x9f1d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49e760,_0x21721c){return function(_0xf1fef4){if(!_0xf1fef4){_0x49e760['sendStatus'](0x194);}return _0xf1fef4;};}function handleError(_0x33792d,_0x1d2046){_0x1d2046=_0x1d2046||0x1f4;return function(_0x261ee3){logger[_0x9f1d('0x23')](_0x261ee3[_0x9f1d('0x24')]);if(_0x261ee3[_0x9f1d('0x25')]){delete _0x261ee3[_0x9f1d('0x25')];}_0x33792d[_0x9f1d('0x15')](_0x1d2046)[_0x9f1d('0x26')](_0x261ee3);};}exports[_0x9f1d('0x27')]=function(_0x16937c,_0x258651){var _0x4b396e={},_0x5eb56c={},_0x59cb94={'count':0x0,'rows':[]};var _0x3b3357=_[_0x9f1d('0x28')](db['VoiceQueuesLog'][_0x9f1d('0x29')],function(_0xad5cc1){return{'name':_0xad5cc1[_0x9f1d('0x2a')],'type':_0xad5cc1[_0x9f1d('0x2b')][_0x9f1d('0x2c')]};});_0x5eb56c[_0x9f1d('0x2d')]=_[_0x9f1d('0x28')](_0x3b3357,'name');_0x5eb56c[_0x9f1d('0x2e')]=_['keys'](_0x16937c[_0x9f1d('0x2e')]);_0x5eb56c['filters']=_[_0x9f1d('0x2f')](_0x5eb56c['model'],_0x5eb56c[_0x9f1d('0x2e')]);_0x4b396e['attributes']=_[_0x9f1d('0x2f')](_0x5eb56c['model'],qs['fields'](_0x16937c[_0x9f1d('0x2e')][_0x9f1d('0x30')]));_0x4b396e[_0x9f1d('0x31')]=_0x4b396e[_0x9f1d('0x31')][_0x9f1d('0x32')]?_0x4b396e['attributes']:_0x5eb56c[_0x9f1d('0x2d')];if(!_0x16937c['query'][_0x9f1d('0x33')]('nolimit')){_0x4b396e[_0x9f1d('0x19')]=qs[_0x9f1d('0x19')](_0x16937c[_0x9f1d('0x2e')][_0x9f1d('0x19')]);_0x4b396e['offset']=qs[_0x9f1d('0x17')](_0x16937c[_0x9f1d('0x2e')][_0x9f1d('0x17')]);}_0x4b396e[_0x9f1d('0x34')]=qs[_0x9f1d('0x35')](_0x16937c['query'][_0x9f1d('0x35')]);_0x4b396e['where']=qs[_0x9f1d('0x36')](_[_0x9f1d('0x37')](_0x16937c['query'],_0x5eb56c[_0x9f1d('0x36')]),_0x3b3357);if(_0x16937c[_0x9f1d('0x2e')][_0x9f1d('0x38')]){_0x4b396e['where']=_[_0x9f1d('0x39')](_0x4b396e[_0x9f1d('0x3a')],{'$or':_[_0x9f1d('0x28')](_0x3b3357,function(_0x18bb12){if(_0x18bb12['type']!==_0x9f1d('0x3b')){var _0x9976f={};_0x9976f[_0x18bb12[_0x9f1d('0x25')]]={'$like':'%'+_0x16937c[_0x9f1d('0x2e')][_0x9f1d('0x38')]+'%'};return _0x9976f;}})});}_0x4b396e=_[_0x9f1d('0x39')]({},_0x4b396e,_0x16937c[_0x9f1d('0x3c')]);var _0x228325={'where':_0x4b396e['where']};return db[_0x9f1d('0x3d')][_0x9f1d('0x1a')](_0x228325)[_0x9f1d('0x21')](function(_0x5ab258){_0x59cb94[_0x9f1d('0x1a')]=_0x5ab258;if(_0x16937c[_0x9f1d('0x2e')]['includeAll']){_0x4b396e[_0x9f1d('0x3e')]=[{'all':!![]}];}return db[_0x9f1d('0x3d')][_0x9f1d('0x3f')](_0x4b396e);})['then'](function(_0x5e371b){_0x59cb94[_0x9f1d('0x40')]=_0x5e371b;return _0x59cb94;})['then'](respondWithFilteredResult(_0x258651,_0x4b396e))[_0x9f1d('0x41')](handleError(_0x258651,null));};exports[_0x9f1d('0x42')]=function(_0x379776,_0x34cd91){var _0x1fae66={'raw':!![],'where':{'id':_0x379776[_0x9f1d('0x43')]['id']}},_0x4e5c88={};_0x4e5c88[_0x9f1d('0x2d')]=_[_0x9f1d('0x44')](db[_0x9f1d('0x3d')][_0x9f1d('0x29')]);_0x4e5c88[_0x9f1d('0x2e')]=_[_0x9f1d('0x44')](_0x379776[_0x9f1d('0x2e')]);_0x4e5c88[_0x9f1d('0x36')]=_[_0x9f1d('0x2f')](_0x4e5c88[_0x9f1d('0x2d')],_0x4e5c88['query']);_0x1fae66[_0x9f1d('0x31')]=_[_0x9f1d('0x2f')](_0x4e5c88[_0x9f1d('0x2d')],qs[_0x9f1d('0x30')](_0x379776['query'][_0x9f1d('0x30')]));_0x1fae66['attributes']=_0x1fae66[_0x9f1d('0x31')]['length']?_0x1fae66[_0x9f1d('0x31')]:_0x4e5c88[_0x9f1d('0x2d')];if(_0x379776[_0x9f1d('0x2e')][_0x9f1d('0x45')]){_0x1fae66[_0x9f1d('0x3e')]=[{'all':!![]}];}_0x1fae66=_[_0x9f1d('0x39')]({},_0x1fae66,_0x379776['options']);return db[_0x9f1d('0x3d')]['find'](_0x1fae66)[_0x9f1d('0x21')](handleEntityNotFound(_0x34cd91,null))[_0x9f1d('0x21')](respondWithResult(_0x34cd91,null))[_0x9f1d('0x41')](handleError(_0x34cd91,null));};exports[_0x9f1d('0x46')]=function(_0x532541,_0x49d973){return db[_0x9f1d('0x3d')][_0x9f1d('0x46')](_0x532541[_0x9f1d('0x47')],{})['then'](respondWithResult(_0x49d973,0xc9))['catch'](handleError(_0x49d973,null));};exports[_0x9f1d('0x20')]=function(_0x557508,_0x3f62ff){if(_0x557508[_0x9f1d('0x47')]['id']){delete _0x557508[_0x9f1d('0x47')]['id'];}return db['VoiceQueuesLog'][_0x9f1d('0x48')]({'where':{'id':_0x557508[_0x9f1d('0x43')]['id']}})[_0x9f1d('0x21')](handleEntityNotFound(_0x3f62ff,null))[_0x9f1d('0x21')](saveUpdates(_0x557508['body'],null))[_0x9f1d('0x21')](respondWithResult(_0x3f62ff,null))[_0x9f1d('0x41')](handleError(_0x3f62ff,null));};exports['destroy']=function(_0x153d34,_0x19f121){return db[_0x9f1d('0x3d')][_0x9f1d('0x48')]({'where':{'id':_0x153d34['params']['id']}})[_0x9f1d('0x21')](handleEntityNotFound(_0x19f121,null))['then'](removeEntity(_0x19f121,null))[_0x9f1d('0x41')](handleError(_0x19f121,null));};
\ No newline at end of file
+var _0x07e1=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','VoiceQueuesLog','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x07e1,0x10e));var _0x107e=function(_0x2695f0,_0x36af33){_0x2695f0=_0x2695f0-0x0;var _0x13cca0=_0x07e1[_0x2695f0];return _0x13cca0;};'use strict';var emlformat=require(_0x107e('0x0'));var rimraf=require(_0x107e('0x1'));var zipdir=require(_0x107e('0x2'));var jsonpatch=require(_0x107e('0x3'));var rp=require('request-promise');var moment=require(_0x107e('0x4'));var BPromise=require(_0x107e('0x5'));var Mustache=require(_0x107e('0x6'));var util=require(_0x107e('0x7'));var path=require('path');var sox=require(_0x107e('0x8'));var csv=require(_0x107e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x107e('0xa'));var squel=require(_0x107e('0xb'));var crypto=require(_0x107e('0xc'));var jsforce=require(_0x107e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x107e('0x9'));var querystring=require(_0x107e('0xe'));var Papa=require('papaparse');var Redis=require(_0x107e('0xf'));var authService=require(_0x107e('0x10'));var qs=require(_0x107e('0x11'));var as=require(_0x107e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x107e('0x13'));var utils=require(_0x107e('0x14'));var config=require(_0x107e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x107e('0x16'))['db'];function respondWithStatusCode(_0x79aeee,_0x51d3c9){_0x51d3c9=_0x51d3c9||0xcc;return function(_0x543713){if(_0x543713){return _0x79aeee[_0x107e('0x17')](_0x51d3c9);}return _0x79aeee[_0x107e('0x18')](_0x51d3c9)[_0x107e('0x19')]();};}function respondWithResult(_0x596764,_0x5996ad){_0x5996ad=_0x5996ad||0xc8;return function(_0x22cef4){if(_0x22cef4){return _0x596764[_0x107e('0x18')](_0x5996ad)['json'](_0x22cef4);}};}function respondWithFilteredResult(_0x3948e0,_0x221fb9){return function(_0x387e85){if(_0x387e85){var _0x466671=typeof _0x221fb9[_0x107e('0x1a')]===_0x107e('0x1b')&&typeof _0x221fb9[_0x107e('0x1c')]===_0x107e('0x1b');var _0x8c2bdc=_0x387e85[_0x107e('0x1d')];var _0x4933c1=_0x466671?0x0:_0x221fb9['offset'];var _0x97a9d8=_0x466671?_0x387e85[_0x107e('0x1d')]:_0x221fb9['offset']+_0x221fb9['limit'];var _0x564374;if(_0x97a9d8>=_0x8c2bdc){_0x97a9d8=_0x8c2bdc;_0x564374=0xc8;}else{_0x564374=0xce;}_0x3948e0[_0x107e('0x18')](_0x564374);return _0x3948e0[_0x107e('0x1e')](_0x107e('0x1f'),_0x4933c1+'-'+_0x97a9d8+'/'+_0x8c2bdc)[_0x107e('0x20')](_0x387e85);}return null;};}function patchUpdates(_0x5c8a80){return function(_0x42f515){try{jsonpatch[_0x107e('0x21')](_0x42f515,_0x5c8a80,!![]);}catch(_0x4880d5){return BPromise['reject'](_0x4880d5);}return _0x42f515['save']();};}function saveUpdates(_0x938519,_0x515052){return function(_0x177262){if(_0x177262){return _0x177262[_0x107e('0x22')](_0x938519)['then'](function(_0x993d41){return _0x993d41;});}return null;};}function removeEntity(_0xeae455,_0x3cd8cb){return function(_0x303114){if(_0x303114){return _0x303114[_0x107e('0x23')]()['then'](function(){_0xeae455['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x161c3b,_0x34987b){return function(_0x1074a5){if(!_0x1074a5){_0x161c3b[_0x107e('0x17')](0x194);}return _0x1074a5;};}function handleError(_0x1d7f50,_0xc227ad){_0xc227ad=_0xc227ad||0x1f4;return function(_0x133187){logger[_0x107e('0x24')](_0x133187[_0x107e('0x25')]);if(_0x133187[_0x107e('0x26')]){delete _0x133187['name'];}_0x1d7f50['status'](_0xc227ad)['send'](_0x133187);};}exports[_0x107e('0x27')]=function(_0x5a3e6d,_0x16347f){var _0xf5fb64={},_0x3d61f3={},_0x1ecc03={'count':0x0,'rows':[]};var _0x31aa96=_[_0x107e('0x28')](db['VoiceQueuesLog'][_0x107e('0x29')],function(_0x52ecdc){return{'name':_0x52ecdc['fieldName'],'type':_0x52ecdc[_0x107e('0x2a')][_0x107e('0x2b')]};});_0x3d61f3[_0x107e('0x2c')]=_[_0x107e('0x28')](_0x31aa96,_0x107e('0x26'));_0x3d61f3[_0x107e('0x2d')]=_[_0x107e('0x2e')](_0x5a3e6d['query']);_0x3d61f3[_0x107e('0x2f')]=_[_0x107e('0x30')](_0x3d61f3[_0x107e('0x2c')],_0x3d61f3[_0x107e('0x2d')]);_0xf5fb64[_0x107e('0x31')]=_[_0x107e('0x30')](_0x3d61f3[_0x107e('0x2c')],qs[_0x107e('0x32')](_0x5a3e6d[_0x107e('0x2d')]['fields']));_0xf5fb64['attributes']=_0xf5fb64[_0x107e('0x31')][_0x107e('0x33')]?_0xf5fb64[_0x107e('0x31')]:_0x3d61f3[_0x107e('0x2c')];if(!_0x5a3e6d[_0x107e('0x2d')][_0x107e('0x34')](_0x107e('0x35'))){_0xf5fb64['limit']=qs['limit'](_0x5a3e6d[_0x107e('0x2d')][_0x107e('0x1c')]);_0xf5fb64['offset']=qs[_0x107e('0x1a')](_0x5a3e6d[_0x107e('0x2d')][_0x107e('0x1a')]);}_0xf5fb64[_0x107e('0x36')]=qs['sort'](_0x5a3e6d['query'][_0x107e('0x37')]);_0xf5fb64[_0x107e('0x38')]=qs[_0x107e('0x2f')](_['pick'](_0x5a3e6d['query'],_0x3d61f3[_0x107e('0x2f')]),_0x31aa96);if(_0x5a3e6d[_0x107e('0x2d')]['filter']){_0xf5fb64['where']=_[_0x107e('0x39')](_0xf5fb64[_0x107e('0x38')],{'$or':_['map'](_0x31aa96,function(_0x570fb9){if(_0x570fb9[_0x107e('0x2a')]!==_0x107e('0x3a')){var _0x10c8b6={};_0x10c8b6[_0x570fb9[_0x107e('0x26')]]={'$like':'%'+_0x5a3e6d[_0x107e('0x2d')][_0x107e('0x3b')]+'%'};return _0x10c8b6;}})});}_0xf5fb64=_[_0x107e('0x39')]({},_0xf5fb64,_0x5a3e6d['options']);var _0x358a3c={'where':_0xf5fb64['where']};return db[_0x107e('0x3c')]['count'](_0x358a3c)[_0x107e('0x3d')](function(_0x2f5436){_0x1ecc03[_0x107e('0x1d')]=_0x2f5436;if(_0x5a3e6d[_0x107e('0x2d')][_0x107e('0x3e')]){_0xf5fb64[_0x107e('0x3f')]=[{'all':!![]}];}return db[_0x107e('0x3c')][_0x107e('0x40')](_0xf5fb64);})[_0x107e('0x3d')](function(_0x493502){_0x1ecc03[_0x107e('0x41')]=_0x493502;return _0x1ecc03;})[_0x107e('0x3d')](respondWithFilteredResult(_0x16347f,_0xf5fb64))[_0x107e('0x42')](handleError(_0x16347f,null));};exports[_0x107e('0x43')]=function(_0x112116,_0x24a8b8){var _0x43e3b4={'raw':!![],'where':{'id':_0x112116[_0x107e('0x44')]['id']}},_0x388205={};_0x388205[_0x107e('0x2c')]=_['keys'](db['VoiceQueuesLog'][_0x107e('0x29')]);_0x388205['query']=_[_0x107e('0x2e')](_0x112116['query']);_0x388205[_0x107e('0x2f')]=_[_0x107e('0x30')](_0x388205[_0x107e('0x2c')],_0x388205['query']);_0x43e3b4[_0x107e('0x31')]=_[_0x107e('0x30')](_0x388205[_0x107e('0x2c')],qs[_0x107e('0x32')](_0x112116[_0x107e('0x2d')][_0x107e('0x32')]));_0x43e3b4['attributes']=_0x43e3b4[_0x107e('0x31')][_0x107e('0x33')]?_0x43e3b4[_0x107e('0x31')]:_0x388205[_0x107e('0x2c')];if(_0x112116[_0x107e('0x2d')][_0x107e('0x3e')]){_0x43e3b4[_0x107e('0x3f')]=[{'all':!![]}];}_0x43e3b4=_[_0x107e('0x39')]({},_0x43e3b4,_0x112116[_0x107e('0x45')]);return db[_0x107e('0x3c')][_0x107e('0x46')](_0x43e3b4)['then'](handleEntityNotFound(_0x24a8b8,null))[_0x107e('0x3d')](respondWithResult(_0x24a8b8,null))[_0x107e('0x42')](handleError(_0x24a8b8,null));};exports[_0x107e('0x47')]=function(_0x2fe15f,_0x28ac3d){return db[_0x107e('0x3c')][_0x107e('0x47')](_0x2fe15f[_0x107e('0x48')],{})[_0x107e('0x3d')](respondWithResult(_0x28ac3d,0xc9))[_0x107e('0x42')](handleError(_0x28ac3d,null));};exports[_0x107e('0x22')]=function(_0x162eaa,_0x26146f){if(_0x162eaa[_0x107e('0x48')]['id']){delete _0x162eaa['body']['id'];}return db[_0x107e('0x3c')][_0x107e('0x46')]({'where':{'id':_0x162eaa[_0x107e('0x44')]['id']}})[_0x107e('0x3d')](handleEntityNotFound(_0x26146f,null))['then'](saveUpdates(_0x162eaa[_0x107e('0x48')],null))[_0x107e('0x3d')](respondWithResult(_0x26146f,null))[_0x107e('0x42')](handleError(_0x26146f,null));};exports[_0x107e('0x23')]=function(_0x1a75d7,_0x1fd5da){return db[_0x107e('0x3c')][_0x107e('0x46')]({'where':{'id':_0x1a75d7[_0x107e('0x44')]['id']}})[_0x107e('0x3d')](handleEntityNotFound(_0x1fd5da,null))[_0x107e('0x3d')](removeEntity(_0x1fd5da,null))[_0x107e('0x42')](handleError(_0x1fd5da,null));};
\ No newline at end of file
index 0732efe..70755c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9f5=['dtm','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x46d4a2,_0x5c9a68){var _0x3df479=function(_0x4b9cd6){while(--_0x4b9cd6){_0x46d4a2['push'](_0x46d4a2['shift']());}};_0x3df479(++_0x5c9a68);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xc9f5[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var logger=require(_0x5c9f('0x1'))('api');var moment=require(_0x5c9f('0x2'));var BPromise=require(_0x5c9f('0x3'));var rp=require(_0x5c9f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c9f('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x5c9f('0x6')]=function(_0x563d0c,_0x3100cf){return _0x563d0c[_0x5c9f('0x7')](_0x5c9f('0x8'),attributes,{'tableName':_0x5c9f('0x9'),'paranoid':![],'indexes':[{'name':_0x5c9f('0xa'),'fields':[_0x5c9f('0xb'),_0x5c9f('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x79a5=['voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog'];(function(_0x2c34ff,_0x1e8bee){var _0x476508=function(_0x3e50db){while(--_0x3e50db){_0x2c34ff['push'](_0x2c34ff['shift']());}};_0x476508(++_0x1e8bee);}(_0x79a5,0x17a));var _0x579a=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x79a5[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x579a('0x0'));var util=require(_0x579a('0x1'));var logger=require(_0x579a('0x2'))(_0x579a('0x3'));var moment=require('moment');var BPromise=require(_0x579a('0x4'));var rp=require(_0x579a('0x5'));var fs=require('fs');var path=require(_0x579a('0x6'));var rimraf=require(_0x579a('0x7'));var config=require(_0x579a('0x8'));var attributes=require(_0x579a('0x9'));module[_0x579a('0xa')]=function(_0x3d345d,_0x53cc9b){return _0x3d345d['define'](_0x579a('0xb'),attributes,{'tableName':_0x579a('0xc'),'paranoid':![],'indexes':[{'name':_0x579a('0xd'),'fields':['event',_0x579a('0xe')]}],'timestamps':![]});};
\ No newline at end of file
index ca1f789..bb02678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba33=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','lodash'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xba33,0xf1));var _0x3ba3=function(_0x7d08fa,_0x11bb50){_0x7d08fa=_0x7d08fa-0x0;var _0x303742=_0xba33[_0x7d08fa];return _0x303742;};'use strict';var _=require(_0x3ba3('0x0'));var util=require(_0x3ba3('0x1'));var moment=require(_0x3ba3('0x2'));var BPromise=require(_0x3ba3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ba3('0x4'));var db=require(_0x3ba3('0x5'))['db'];var utils=require(_0x3ba3('0x6'));var logger=require(_0x3ba3('0x7'))(_0x3ba3('0x8'));var config=require(_0x3ba3('0x9'));var jayson=require(_0x3ba3('0xa'));var client=jayson[_0x3ba3('0xb')][_0x3ba3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfbfa81,_0x15082b,_0x55f171){return new BPromise(function(_0x17a6d3,_0x329be8){return client[_0x3ba3('0xd')](_0xfbfa81,_0x55f171)[_0x3ba3('0xe')](function(_0x44d92c){logger['info'](_0x3ba3('0xf'),_0x15082b,_0x3ba3('0x10'));logger[_0x3ba3('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x15082b,'request\x20sent',JSON['stringify'](_0x44d92c));if(_0x44d92c[_0x3ba3('0x12')]){if(_0x44d92c[_0x3ba3('0x12')][_0x3ba3('0x13')]===0x1f4){logger['error'](_0x3ba3('0xf'),_0x15082b,_0x44d92c[_0x3ba3('0x12')]['message']);return _0x329be8(_0x44d92c[_0x3ba3('0x12')][_0x3ba3('0x14')]);}logger[_0x3ba3('0x12')](_0x3ba3('0xf'),_0x15082b,_0x44d92c[_0x3ba3('0x12')][_0x3ba3('0x14')]);return _0x17a6d3(_0x44d92c[_0x3ba3('0x12')][_0x3ba3('0x14')]);}else{logger[_0x3ba3('0x15')](_0x3ba3('0xf'),_0x15082b,_0x3ba3('0x10'));_0x17a6d3(_0x44d92c['result']['message']);}})['catch'](function(_0x1812d6){logger['error'](_0x3ba3('0xf'),_0x15082b,_0x1812d6);_0x329be8(_0x1812d6);});});}
\ No newline at end of file
+var _0x4bd1=['VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xecff8c,_0x4d1f38){var _0x491769=function(_0x370ab9){while(--_0x370ab9){_0xecff8c['push'](_0xecff8c['shift']());}};_0x491769(++_0x4d1f38);}(_0x4bd1,0x90));var _0x14bd=function(_0x1e9d62,_0x25bb8e){_0x1e9d62=_0x1e9d62-0x0;var _0x56c490=_0x4bd1[_0x1e9d62];return _0x56c490;};'use strict';var _=require('lodash');var util=require(_0x14bd('0x0'));var moment=require('moment');var BPromise=require(_0x14bd('0x1'));var rs=require(_0x14bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14bd('0x3'))['db'];var utils=require(_0x14bd('0x4'));var logger=require('../../config/logger')(_0x14bd('0x5'));var config=require(_0x14bd('0x6'));var jayson=require(_0x14bd('0x7'));var client=jayson[_0x14bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35806e,_0x2cec06,_0xb06dbf){return new BPromise(function(_0x2e9a2f,_0x302ffa){return client[_0x14bd('0x9')](_0x35806e,_0xb06dbf)[_0x14bd('0xa')](function(_0x4193ff){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x2cec06,'request\x20sent');logger[_0x14bd('0xb')](_0x14bd('0xc'),_0x2cec06,_0x14bd('0xd'),JSON['stringify'](_0x4193ff));if(_0x4193ff[_0x14bd('0xe')]){if(_0x4193ff[_0x14bd('0xe')][_0x14bd('0xf')]===0x1f4){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);return _0x302ffa(_0x4193ff[_0x14bd('0xe')]['message']);}logger[_0x14bd('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2cec06,_0x4193ff[_0x14bd('0xe')]['message']);return _0x2e9a2f(_0x4193ff[_0x14bd('0xe')][_0x14bd('0x11')]);}else{logger['info'](_0x14bd('0x10'),_0x2cec06,'request\x20sent');_0x2e9a2f(_0x4193ff[_0x14bd('0x12')][_0x14bd('0x11')]);}})[_0x14bd('0x13')](function(_0x1853ba){logger[_0x14bd('0xe')](_0x14bd('0x10'),_0x2cec06,_0x1853ba);_0x302ffa(_0x1853ba);});});}
\ No newline at end of file
index 1771943..c131d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeade=['/describe','/:id','show','get','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xeade,0xbe));var _0xeead=function(_0x2143ff,_0x6eb356){_0x2143ff=_0x2143ff-0x0;var _0x13eee6=_0xeade[_0x2143ff];return _0x13eee6;};'use strict';var multer=require(_0xeead('0x0'));var util=require(_0xeead('0x1'));var path=require(_0xeead('0x2'));var timeout=require(_0xeead('0x3'));var express=require(_0xeead('0x4'));var router=express['Router']();var fs_extra=require(_0xeead('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeead('0x6'));var config=require(_0xeead('0x7'));var controller=require(_0xeead('0x8'));router['get']('/',auth[_0xeead('0x9')](),controller['index']);router['get'](_0xeead('0xa'),auth[_0xeead('0x9')](),controller['describe']);router['get'](_0xeead('0xb'),auth[_0xeead('0x9')](),controller[_0xeead('0xc')]);router[_0xeead('0xd')](_0xeead('0xe'),auth['isAuthenticated'](),controller[_0xeead('0xf')]);router[_0xeead('0xd')]('/:id/downloads',controller[_0xeead('0x10')]);router[_0xeead('0xd')](_0xeead('0x11'),auth[_0xeead('0x9')](),controller[_0xeead('0x12')]);router[_0xeead('0x13')]('/',auth['isAuthenticated'](),controller[_0xeead('0x14')]);router[_0xeead('0x13')](_0xeead('0x11'),auth['isAuthenticated'](),controller[_0xeead('0x15')]);router['put']('/:id',auth[_0xeead('0x9')](),controller[_0xeead('0x16')]);router[_0xeead('0x17')](_0xeead('0xb'),auth[_0xeead('0x9')](),controller[_0xeead('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xf696=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','multer'];(function(_0x471265,_0x304488){var _0x3aea70=function(_0x12ef9f){while(--_0x12ef9f){_0x471265['push'](_0x471265['shift']());}};_0x3aea70(++_0x304488);}(_0xf696,0xfb));var _0x6f69=function(_0x2d9574,_0x35f066){_0x2d9574=_0x2d9574-0x0;var _0x3fc637=_0xf696[_0x2d9574];return _0x3fc637;};'use strict';var multer=require(_0x6f69('0x0'));var util=require(_0x6f69('0x1'));var path=require('path');var timeout=require(_0x6f69('0x2'));var express=require(_0x6f69('0x3'));var router=express['Router']();var fs_extra=require(_0x6f69('0x4'));var auth=require(_0x6f69('0x5'));var interaction=require(_0x6f69('0x6'));var config=require(_0x6f69('0x7'));var controller=require(_0x6f69('0x8'));router[_0x6f69('0x9')]('/',auth[_0x6f69('0xa')](),controller[_0x6f69('0xb')]);router[_0x6f69('0x9')](_0x6f69('0xc'),auth[_0x6f69('0xa')](),controller[_0x6f69('0xd')]);router[_0x6f69('0x9')](_0x6f69('0xe'),auth[_0x6f69('0xa')](),controller['show']);router[_0x6f69('0x9')](_0x6f69('0xf'),auth[_0x6f69('0xa')](),controller[_0x6f69('0x10')]);router[_0x6f69('0x9')](_0x6f69('0x11'),controller[_0x6f69('0x12')]);router[_0x6f69('0x9')](_0x6f69('0x13'),auth[_0x6f69('0xa')](),controller[_0x6f69('0x14')]);router[_0x6f69('0x15')]('/',auth['isAuthenticated'](),controller[_0x6f69('0x16')]);router['post'](_0x6f69('0x13'),auth[_0x6f69('0xa')](),controller[_0x6f69('0x17')]);router[_0x6f69('0x18')](_0x6f69('0xe'),auth[_0x6f69('0xa')](),controller[_0x6f69('0x19')]);router['delete'](_0x6f69('0xe'),auth['isAuthenticated'](),controller[_0x6f69('0x1a')]);module[_0x6f69('0x1b')]=router;
\ No newline at end of file
index c755646..c235cf7 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(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 6a719e0..86963e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd702=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','ValidationError','download','filename','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','../../components/encryptor','sequelize','MD5','col','$and','push','decryptFile','recording','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service'];(function(_0x5ced50,_0x3f8d27){var _0x50a749=function(_0x4e81f8){while(--_0x4e81f8){_0x5ced50['push'](_0x5ced50['shift']());}};_0x50a749(++_0x3f8d27);}(_0xd702,0x7e));var _0x2d70=function(_0x5b99fa,_0x5de2d2){_0x5b99fa=_0x5b99fa-0x0;var _0x3d9518=_0xd702[_0x5b99fa];return _0x3d9518;};'use strict';var emlformat=require(_0x2d70('0x0'));var rimraf=require(_0x2d70('0x1'));var zipdir=require(_0x2d70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d70('0x3'));var moment=require('moment');var BPromise=require(_0x2d70('0x4'));var Mustache=require('mustache');var util=require(_0x2d70('0x5'));var path=require(_0x2d70('0x6'));var sox=require(_0x2d70('0x7'));var csv=require(_0x2d70('0x8'));var ejs=require(_0x2d70('0x9'));var fs=require('fs');var fs_extra=require(_0x2d70('0xa'));var _=require(_0x2d70('0xb'));var squel=require(_0x2d70('0xc'));var crypto=require(_0x2d70('0xd'));var jsforce=require(_0x2d70('0xe'));var deskjs=require(_0x2d70('0xf'));var toCsv=require(_0x2d70('0x8'));var querystring=require(_0x2d70('0x10'));var Papa=require(_0x2d70('0x11'));var AWS=require(_0x2d70('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x2d70('0x13'));var qs=require(_0x2d70('0x14'));var as=require(_0x2d70('0x15'));var hardwareService=require(_0x2d70('0x16'));var logger=require('../../config/logger')(_0x2d70('0x17'));var utils=require(_0x2d70('0x18'));var config=require(_0x2d70('0x19'));var licenseUtil=require(_0x2d70('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x173d63,_0x52b8d0){_0x52b8d0=_0x52b8d0||0xcc;return function(_0x102527){if(_0x102527){return _0x173d63[_0x2d70('0x1b')](_0x52b8d0);}return _0x173d63[_0x2d70('0x1c')](_0x52b8d0)[_0x2d70('0x1d')]();};}function respondWithResult(_0x1ee77d,_0x3ff2de){_0x3ff2de=_0x3ff2de||0xc8;return function(_0x101431){if(_0x101431){return _0x1ee77d[_0x2d70('0x1c')](_0x3ff2de)[_0x2d70('0x1e')](_0x101431);}};}function respondWithFilteredResult(_0x4ed199,_0x1900c0){return function(_0x4c2508){if(_0x4c2508){var _0xc879c3=typeof _0x1900c0[_0x2d70('0x1f')]===_0x2d70('0x20')&&typeof _0x1900c0[_0x2d70('0x21')]===_0x2d70('0x20');var _0x188404=_0x4c2508[_0x2d70('0x22')];var _0x3f9b83=_0xc879c3?0x0:_0x1900c0[_0x2d70('0x1f')];var _0xf41420=_0xc879c3?_0x4c2508['count']:_0x1900c0[_0x2d70('0x1f')]+_0x1900c0['limit'];var _0x13b044;if(_0xf41420>=_0x188404){_0xf41420=_0x188404;_0x13b044=0xc8;}else{_0x13b044=0xce;}_0x4ed199[_0x2d70('0x1c')](_0x13b044);return _0x4ed199[_0x2d70('0x23')](_0x2d70('0x24'),_0x3f9b83+'-'+_0xf41420+'/'+_0x188404)[_0x2d70('0x1e')](_0x4c2508);}return null;};}function patchUpdates(_0x1e964e){return function(_0x46ebf2){try{jsonpatch[_0x2d70('0x25')](_0x46ebf2,_0x1e964e,!![]);}catch(_0x15bb40){return BPromise[_0x2d70('0x26')](_0x15bb40);}return _0x46ebf2[_0x2d70('0x27')]();};}function saveUpdates(_0x48f616,_0x3cf630){return function(_0x2370a9){if(_0x2370a9){return _0x2370a9[_0x2d70('0x28')](_0x48f616)[_0x2d70('0x29')](function(_0x114297){return _0x114297;});}return null;};}function removeEntity(_0x1e729c,_0x2be78b){return function(_0x208b7d){if(_0x208b7d){return _0x208b7d[_0x2d70('0x2a')]()['then'](function(){_0x1e729c[_0x2d70('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbb14b,_0xcff516){return function(_0x1a42e6){if(!_0x1a42e6){_0xdbb14b[_0x2d70('0x1b')](0x194);}return _0x1a42e6;};}function handleError(_0x4cf5fc,_0x30beda){_0x30beda=_0x30beda||0x1f4;return function(_0xa8fa7d){logger[_0x2d70('0x2b')](_0xa8fa7d[_0x2d70('0x2c')]);if(_0xa8fa7d[_0x2d70('0x2d')]){delete _0xa8fa7d[_0x2d70('0x2d')];}_0x4cf5fc[_0x2d70('0x1c')](_0x30beda)['send'](_0xa8fa7d);};}exports['index']=function(_0x595f4c,_0x210a7c){var _0x4e974f={},_0x23de08={},_0x5904b0={'count':0x0,'rows':[]};var _0x269649=_['map'](db[_0x2d70('0x2e')][_0x2d70('0x2f')],function(_0x5dcf05){return{'name':_0x5dcf05[_0x2d70('0x30')],'type':_0x5dcf05[_0x2d70('0x31')][_0x2d70('0x32')]};});_0x23de08[_0x2d70('0x33')]=_[_0x2d70('0x34')](_[_0x2d70('0x35')](_0x269649,'name'),[_0x2d70('0x36')]);_0x23de08[_0x2d70('0x37')]=_['keys'](_0x595f4c['query']);_0x23de08[_0x2d70('0x38')]=_[_0x2d70('0x39')](_0x23de08[_0x2d70('0x33')],_0x23de08['query']);_0x4e974f[_0x2d70('0x3a')]=_[_0x2d70('0x39')](_0x23de08[_0x2d70('0x33')],qs[_0x2d70('0x3b')](_0x595f4c[_0x2d70('0x37')][_0x2d70('0x3b')]));_0x4e974f[_0x2d70('0x3a')]=_0x4e974f[_0x2d70('0x3a')]['length']?_0x4e974f[_0x2d70('0x3a')]:_0x23de08[_0x2d70('0x33')];if(!_0x595f4c[_0x2d70('0x37')][_0x2d70('0x3c')]('nolimit')){_0x4e974f[_0x2d70('0x21')]=qs[_0x2d70('0x21')](_0x595f4c['query'][_0x2d70('0x21')]);_0x4e974f['offset']=qs['offset'](_0x595f4c[_0x2d70('0x37')][_0x2d70('0x1f')]);}_0x4e974f[_0x2d70('0x3d')]=qs[_0x2d70('0x3e')](_0x595f4c[_0x2d70('0x37')][_0x2d70('0x3e')]);_0x4e974f[_0x2d70('0x3f')]=qs[_0x2d70('0x38')](_[_0x2d70('0x40')](_0x595f4c[_0x2d70('0x37')],_0x23de08[_0x2d70('0x38')]),_0x269649);if(_0x595f4c[_0x2d70('0x37')]['filter']){_0x4e974f[_0x2d70('0x3f')]=_[_0x2d70('0x41')](_0x4e974f[_0x2d70('0x3f')],{'$or':_['map'](_0x269649,function(_0x1b2ade){if(_0x1b2ade[_0x2d70('0x31')]!==_0x2d70('0x42')){var _0x5c1524={};_0x5c1524[_0x1b2ade[_0x2d70('0x2d')]]={'$like':'%'+_0x595f4c[_0x2d70('0x37')][_0x2d70('0x43')]+'%'};return _0x5c1524;}})});}_0x4e974f=_[_0x2d70('0x41')]({},_0x4e974f,_0x595f4c[_0x2d70('0x44')]);var _0x4fa0f3={'where':_0x4e974f[_0x2d70('0x3f')]};return db[_0x2d70('0x2e')]['count'](_0x4fa0f3)['then'](function(_0x4df63d){_0x5904b0[_0x2d70('0x22')]=_0x4df63d;if(_0x595f4c[_0x2d70('0x37')][_0x2d70('0x45')]){_0x4e974f[_0x2d70('0x46')]=[{'all':!![]}];}return db[_0x2d70('0x2e')][_0x2d70('0x47')](_0x4e974f);})[_0x2d70('0x29')](function(_0x1f03d1){_0x5904b0[_0x2d70('0x48')]=_0x1f03d1;return _0x5904b0;})[_0x2d70('0x29')](respondWithFilteredResult(_0x210a7c,_0x4e974f))[_0x2d70('0x49')](handleError(_0x210a7c,null));};exports[_0x2d70('0x4a')]=function(_0x1e7ffa,_0xe93707){var _0x3b5219={'raw':![],'where':{'id':_0x1e7ffa[_0x2d70('0x4b')]['id']}},_0x215bd1={};_0x215bd1['model']=_[_0x2d70('0x4c')](db[_0x2d70('0x2e')][_0x2d70('0x2f')]);_0x215bd1['query']=_['keys'](_0x1e7ffa[_0x2d70('0x37')]);_0x215bd1[_0x2d70('0x38')]=_[_0x2d70('0x39')](_0x215bd1[_0x2d70('0x33')],_0x215bd1['query']);_0x3b5219[_0x2d70('0x3a')]=_[_0x2d70('0x39')](_0x215bd1[_0x2d70('0x33')],qs[_0x2d70('0x3b')](_0x1e7ffa[_0x2d70('0x37')][_0x2d70('0x3b')]));_0x3b5219[_0x2d70('0x3a')]=_0x3b5219[_0x2d70('0x3a')]['length']?_0x3b5219['attributes']:_0x215bd1['model'];if(_0x1e7ffa[_0x2d70('0x37')][_0x2d70('0x45')]){_0x3b5219[_0x2d70('0x46')]=[{'all':!![]}];}_0x3b5219=_[_0x2d70('0x41')]({},_0x3b5219,_0x1e7ffa[_0x2d70('0x44')]);return db[_0x2d70('0x2e')][_0x2d70('0x4d')](_0x3b5219)[_0x2d70('0x29')](handleEntityNotFound(_0xe93707,null))['then'](respondWithResult(_0xe93707,null))[_0x2d70('0x49')](handleError(_0xe93707,null));};exports[_0x2d70('0x4e')]=function(_0x56cecd,_0x1451e2){return db[_0x2d70('0x2e')][_0x2d70('0x4e')](_0x56cecd[_0x2d70('0x4f')],{})['then'](respondWithResult(_0x1451e2,0xc9))['catch'](handleError(_0x1451e2,null));};exports['update']=function(_0x2b0e94,_0x29fc9a){if(_0x2b0e94[_0x2d70('0x4f')]['id']){delete _0x2b0e94[_0x2d70('0x4f')]['id'];}return db[_0x2d70('0x2e')][_0x2d70('0x4d')]({'where':{'id':_0x2b0e94[_0x2d70('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29fc9a,null))['then'](saveUpdates(_0x2b0e94['body'],null))[_0x2d70('0x29')](respondWithResult(_0x29fc9a,null))[_0x2d70('0x49')](handleError(_0x29fc9a,null));};exports[_0x2d70('0x50')]=function(_0x59ba57,_0x17a265){return db[_0x2d70('0x2e')][_0x2d70('0x50')]()[_0x2d70('0x29')](respondWithResult(_0x17a265,null))['catch'](handleError(_0x17a265,null));};exports['download']=function(_0x4a2c48,_0x4aeee7,_0x1d46c5){var _0x28f586=require('../../components/encryptor');var _0x3b814b=![];var _0x853f0a={};if(_0x4a2c48[_0x2d70('0x37')][_0x2d70('0x31')]&&_0x4a2c48[_0x2d70('0x37')][_0x2d70('0x31')]==='uniqueid'){_0x853f0a[_0x2d70('0x51')]=_0x4a2c48[_0x2d70('0x4b')]['id'];}else{_0x853f0a['id']=_0x4a2c48[_0x2d70('0x4b')]['id'];}return db[_0x2d70('0x2e')]['find']({'where':_0x853f0a,'attributes':['id',_0x2d70('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x4aeee7,null))[_0x2d70('0x29')](function(_0x180853){if(_0x180853){var _0x3c1be6=_0x180853[_0x2d70('0x52')];var _0x53e3fa=util['format'](_0x2d70('0x53'),_0x3c1be6);if(fs[_0x2d70('0x54')](_0x53e3fa)){_0x3b814b=!![];return _0x28f586['decryptFile'](_0x53e3fa,_0x3c1be6,config[_0x2d70('0x55')]['recording'])[_0x2d70('0x29')](function(){return _0x180853;});}return _0x180853;}})['then'](function(_0x35a483){if(_0x35a483){var _0x564739=_0x35a483[_0x2d70('0x52')];if(!fs[_0x2d70('0x54')](_0x564739)){throw new db[(_0x2d70('0x56'))][(_0x2d70('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x35a483['filename']){return _0x4aeee7[_0x2d70('0x58')](_0x564739,_0x35a483[_0x2d70('0x59')]+path['extname'](_0x564739),function(){if(_0x3b814b){fs[_0x2d70('0x5a')](_0x564739);}});}else{return _0x4aeee7['download'](_0x564739,function(_0x32a05f){if(_0x3b814b){fs['unlink'](_0x564739);}});}}})[_0x2d70('0x49')](function(_0x3e0127){if(_0x3e0127[_0x2d70('0x5b')]===_0x2d70('0x5c')){_0x4aeee7[_0x2d70('0x1c')](0x194)[_0x2d70('0x5d')](_0x2d70('0x5e'));}else{return handleError(_0x4aeee7,null);}});};exports['downloads']=function(_0x219a2c,_0x37d10e,_0x1ce61f){var _0x251a60=require(_0x2d70('0x5f'));var _0x52acaa=![];var _0x353f03={'$and':[db['sequelize'][_0x2d70('0x3f')](db[_0x2d70('0x60')]['fn'](_0x2d70('0x61'),db[_0x2d70('0x60')][_0x2d70('0x62')](_0x2d70('0x51'))),_0x219a2c[_0x2d70('0x37')]['token'])]};if(_0x219a2c[_0x2d70('0x37')][_0x2d70('0x31')]&&_0x219a2c[_0x2d70('0x37')][_0x2d70('0x31')]===_0x2d70('0x51')){_0x353f03[_0x2d70('0x63')][_0x2d70('0x64')]({'uniqueid':_0x219a2c['params']['id']});}else{_0x353f03['$and'][_0x2d70('0x64')]({'id':_0x219a2c[_0x2d70('0x4b')]['id']});}return db[_0x2d70('0x2e')][_0x2d70('0x4d')]({'where':_0x353f03,'attributes':['id',_0x2d70('0x52')],'raw':!![]})[_0x2d70('0x29')](handleEntityNotFound(_0x37d10e,null))[_0x2d70('0x29')](function(_0x3c1389){if(_0x3c1389){var _0x2b7397=util['format'](_0x2d70('0x53'),_0x3c1389[_0x2d70('0x52')]);if(fs[_0x2d70('0x54')](_0x2b7397)){_0x52acaa=!![];return _0x251a60[_0x2d70('0x65')](_0x2b7397,_0x3c1389[_0x2d70('0x52')],config[_0x2d70('0x55')][_0x2d70('0x66')])[_0x2d70('0x29')](function(){return _0x3c1389;});}return _0x3c1389;}})[_0x2d70('0x29')](function(_0x5932ea){if(_0x5932ea){if(!fs[_0x2d70('0x54')](_0x5932ea[_0x2d70('0x52')])){throw new db[(_0x2d70('0x56'))]['ValidationError'](_0x2d70('0x5c'));}if(_0x5932ea['filename']){return _0x37d10e[_0x2d70('0x58')](_0x5932ea['value'],_0x5932ea[_0x2d70('0x59')]+path[_0x2d70('0x67')](_0x5932ea[_0x2d70('0x52')]),function(){if(_0x52acaa){fs[_0x2d70('0x5a')](_0x5932ea[_0x2d70('0x52')]);}});}else{return _0x37d10e['download'](_0x5932ea[_0x2d70('0x52')],function(_0x3121d4){if(_0x52acaa){fs[_0x2d70('0x5a')](_0x5932ea[_0x2d70('0x52')]);}});}}})[_0x2d70('0x49')](handleError(_0x37d10e,null));};exports[_0x2d70('0x2a')]=function(_0x5e5235,_0x2ac8b5){return db[_0x2d70('0x2e')]['find']({'where':{'id':_0x5e5235[_0x2d70('0x4b')]['id']}})['then'](function(_0x52b3e8){if(_[_0x2d70('0x68')](_0x52b3e8)){throw new ReferenceError(_0x2d70('0x69'));}return _0x52b3e8;})[_0x2d70('0x29')](function(_0x8f37b6){var _0x483ea4=_0x8f37b6[_0x2d70('0x52')];logger[_0x2d70('0x6a')]('cancellazione\x20fisica\x20documento\x20%s',_0x483ea4);if(!_[_0x2d70('0x68')](_0x8f37b6[_0x2d70('0x52')])&&fs[_0x2d70('0x54')](_0x483ea4)){logger[_0x2d70('0x6a')](_0x2d70('0x6b')+_0x483ea4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x483ea4);}_0x483ea4=_0x483ea4+_0x2d70('0x6c');if(!_[_0x2d70('0x68')](_0x8f37b6[_0x2d70('0x52')])&&fs[_0x2d70('0x54')](_0x483ea4)){logger[_0x2d70('0x6a')](_0x2d70('0x6b')+_0x483ea4+_0x2d70('0x6d'));fs['unlinkSync'](_0x483ea4);}return _0x8f37b6;})[_0x2d70('0x29')](function(_0x2d9b34){if(!_0x2d9b34)throw new InternalError();return _0x2d9b34[_0x2d70('0x2a')]();})[_0x2d70('0x29')](function(){_0x2ac8b5[_0x2d70('0x1c')](0xcc)['end']();})['catch'](handleError(_0x2ac8b5,null));};function getBucketslist(_0x3b62b2,_0x5e9a29,_0x5f5812){return new Promise(function(_0xd6c2dd,_0x26bfc3){var _0x405ac7=new AWS['S3']({'accessKeyId':_0x5e9a29,'secretAccessKey':_0x3b62b2,'region':_0x5f5812});_0x405ac7[_0x2d70('0x6e')]({},function(_0xd89183,_0x52e03c){if(_0xd89183){return _0x26bfc3(_0xd89183);}else{return _0xd6c2dd(_0x52e03c);}});});}function createBucket(_0x2520ff,_0x293975,_0x2a5599,_0x2868fc){return new Promise(function(_0x36f83c,_0x2ee962){var _0x529acd=new AWS['S3']({'accessKeyId':_0x293975,'secretAccessKey':_0x2520ff,'region':_0x2a5599});_0x529acd['createBucket']({'Bucket':_0x2868fc},function(_0x3547d4,_0xbf9556){if(_0x3547d4){return _0x2ee962(_0x3547d4);}else{return _0x36f83c(_0xbf9556);}});});}function uploadFile(_0x47383c,_0x2cf68e,_0x1d5397,_0x4f0767,_0x2104f6,_0x1e999e){return new Promise(function(_0x1499cb,_0x491539){var _0x238e74=new AWS['S3']({'accessKeyId':_0x2cf68e,'secretAccessKey':_0x47383c,'region':_0x1d5397});_0x238e74['upload']({'Bucket':_0x4f0767,'Key':_0x2104f6,'Body':_0x1e999e},function(_0x4d66de,_0x3ed665){if(_0x4d66de){return _0x491539(_0x4d66de);}else{return _0x1499cb(_0x3ed665);}});});}function startTranscribe(_0x4d5367,_0x4d47c9,_0x5d3afc,_0x23bbbc,_0x4c1933,_0x489c66){return new Promise(function(_0x43212a,_0x5240dd){var _0x12c43c=new AWS['TranscribeService']({'accessKeyId':_0x4d47c9,'secretAccessKey':_0x4d5367,'region':_0x5d3afc});_0x12c43c['startTranscriptionJob']({'TranscriptionJobName':_0x23bbbc,'LanguageCode':_0x4c1933,'Media':{'MediaFileUri':_0x489c66}},function(_0x4bbeb6,_0x590ac4){if(_0x4bbeb6){return _0x5240dd(_0x4bbeb6);}else{return _0x43212a(_0x590ac4);}});});}function transcribe(_0x359cb8,_0xc6bb7f,_0x5dd949,_0x464868,_0xbc0010,_0x498a4a,_0x4b1ac7){return new Promise(function(_0x3b1754,_0x3963cc){var _0x2cfacb={};logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x6f'),_0x359cb8,_0xbc0010));return uploadFile(_0xc6bb7f,_0x5dd949,_0x464868,_0xbc0010,path['basename'](_0x498a4a),fs['readFileSync'](_0x498a4a))[_0x2d70('0x29')](function(_0x4105dc){logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x70'),_0x359cb8,_0xbc0010,_0x4105dc['Location']));_0x2cfacb['bucket']=_0x4105dc['Bucket'];_0x2cfacb[_0x2d70('0x71')]=_0x4105dc[_0x2d70('0x72')];logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x73'),_0x359cb8));return startTranscribe(_0xc6bb7f,_0x5dd949,_0x464868,uuidv4(),_0x4b1ac7,_0x4105dc[_0x2d70('0x72')]);})[_0x2d70('0x29')](function(_0x5052d5){logger[_0x2d70('0x6a')](util[_0x2d70('0x36')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x359cb8,_0x5052d5['TranscriptionJob'][_0x2d70('0x74')]));_0x2cfacb[_0x2d70('0x75')]=_0x5052d5['TranscriptionJob'][_0x2d70('0x74')];_0x2cfacb[_0x2d70('0x76')]=_0x5052d5['TranscriptionJob'][_0x2d70('0x77')];return _0x3b1754(_0x2cfacb);})['catch'](function(_0xa5ad6b){return _0x3963cc(_0xa5ad6b);});});}exports['runTranscribe']=function(_0x23c4b8,_0x5b5843,_0x39f781){var _0x20ee71;var _0xf71408;var _0x21837b;var _0x33d391=require(_0x2d70('0x5f'));return db[_0x2d70('0x2e')][_0x2d70('0x78')]({'where':{'id':_0x23c4b8[_0x2d70('0x4b')]['id']}})[_0x2d70('0x29')](function(_0x359e30){if(_0x359e30){var _0x4766c6=util[_0x2d70('0x36')](_0x2d70('0x53'),_0x359e30['value']);if(fs[_0x2d70('0x54')](_0x4766c6)){cypher=!![];return _0x33d391['decryptFile'](_0x4766c6,_0x359e30[_0x2d70('0x52')],config[_0x2d70('0x55')][_0x2d70('0x66')])[_0x2d70('0x29')](function(){return _0x359e30;});}return _0x359e30;}})['then'](function(_0x4cecca){if(!_0x4cecca){throw new db[(_0x2d70('0x56'))][(_0x2d70('0x57'))](_0x2d70('0x79'));}_0xf71408=_0x4cecca;return db['Setting'][_0x2d70('0x78')]({'where':{'id':0x1}});})[_0x2d70('0x29')](handleEntityNotFound(_0x5b5843,null))[_0x2d70('0x29')](function(_0x2c942b){if(_0x2c942b){_0x20ee71=_0x2c942b;if(!_0x20ee71['transcribe']||!_0x20ee71[_0x2d70('0x7a')]||!_0x20ee71['transcribeRegion']||!_0x20ee71['language']||!_0x20ee71[_0x2d70('0x7b')]){throw new db[(_0x2d70('0x56'))][(_0x2d70('0x57'))](_0x2d70('0x7c'));}if(_0x23c4b8[_0x2d70('0x4f')][_0x2d70('0x7d')]&&(!_0x20ee71['sentiment']||!_0x20ee71['sentimentAccountId']||!_0x20ee71[_0x2d70('0x7e')]||!_0x20ee71[_0x2d70('0x7f')]||!_0x20ee71[_0x2d70('0x7b')])){throw new db[(_0x2d70('0x56'))][(_0x2d70('0x57'))](_0x2d70('0x80'));}return db[_0x2d70('0x81')][_0x2d70('0x78')]({'where':{'id':_0x20ee71[_0x2d70('0x7a')]}});}})[_0x2d70('0x29')](function(_0xa909b5){if(!_0xa909b5){throw new db['Sequelize'][(_0x2d70('0x57'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xa909b5[_0x2d70('0x82')]||!_0xa909b5[_0x2d70('0x83')]){throw new db[(_0x2d70('0x56'))]['ValidationError'](_0x2d70('0x84'));}_0x21837b=_0xa909b5;return getBucketslist(_0x21837b[_0x2d70('0x82')],_0x21837b[_0x2d70('0x83')],_0x20ee71[_0x2d70('0x85')]);})[_0x2d70('0x29')](function(_0x55ac43){if(_0x55ac43&&_0x55ac43['Buckets']){var _0x476127=_[_0x2d70('0x4d')](_0x55ac43['Buckets'],function(_0x3b619e){return _0x3b619e[_0x2d70('0x86')]===_0x20ee71['bucket'];});if(!_0x476127){logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x87'),_0x23c4b8[_0x2d70('0x4b')]['id'],_0x20ee71[_0x2d70('0x7b')]));return createBucket(_0x21837b['data1'],_0x21837b[_0x2d70('0x83')],_0x20ee71['transcribeRegion'],_0x20ee71[_0x2d70('0x7b')]);}logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x88'),_0x23c4b8[_0x2d70('0x4b')]['id'],_0x20ee71['bucket']));return;}})[_0x2d70('0x29')](function(_0x51abf3){if(_0xf71408[_0x2d70('0x76')]==='NEW'){return transcribe(_0x23c4b8[_0x2d70('0x4b')]['id'],_0x21837b[_0x2d70('0x82')],_0x21837b['data2'],_0x20ee71[_0x2d70('0x85')],_0x20ee71[_0x2d70('0x7b')],_0xf71408['value'],_0x20ee71[_0x2d70('0x7f')]);}else{logger[_0x2d70('0x6a')](util[_0x2d70('0x36')](_0x2d70('0x89'),_0x23c4b8['params']['id']));return{'transcribeStatus':_0x2d70('0x8a')};}})[_0x2d70('0x29')](function(_0x202969){if(_0x202969){_0x202969['tempSentiment']=_0x23c4b8['body']['runSentiment'];return _0xf71408[_0x2d70('0x8b')](_0x202969);}})[_0x2d70('0x29')](respondWithResult(_0x5b5843,null))['catch'](handleError(_0x5b5843,null));};function writeFile(_0x3d06a3,_0x40b645){return new Promise(function(_0x1e29f4,_0x2b8af7){fs[_0x2d70('0x8c')](_0x40b645,_0x3d06a3,function(_0x5c4db1,_0x5eb56c){if(_0x5c4db1){return _0x2b8af7(_0x5c4db1);}else{return _0x1e29f4(_0x5eb56c);}});});}exports[_0x2d70('0x8d')]=function(_0x1a9c03,_0x9451f5,_0x2484c1){return db[_0x2d70('0x2e')][_0x2d70('0x78')]({'where':{'id':_0x1a9c03['params']['id']}})[_0x2d70('0x29')](handleEntityNotFound(_0x9451f5))[_0x2d70('0x29')](function(_0x52e434){if(_0x52e434&&_0x52e434[_0x2d70('0x8e')]){var _0x49f445=_0x52e434[_0x2d70('0x8e')];var _0xe0d32=config[_0x2d70('0x8f')]+'/server/files/transcribes/transcribe_'+_0x52e434['id']+_0x2d70('0x90');if(fs[_0x2d70('0x54')](_0xe0d32)){return _0xe0d32;}return writeFile(_0x49f445,_0xe0d32)[_0x2d70('0x29')](function(){return _0xe0d32;});}else{throw new db['Sequelize'][(_0x2d70('0x57'))](_0x2d70('0x91'));}})[_0x2d70('0x29')](function(_0x117053){return _0x9451f5[_0x2d70('0x58')](_0x117053);})[_0x2d70('0x49')](handleError(_0x9451f5));};
\ No newline at end of file
+var _0x6776=['sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','include','catch','show','params','keys','length','includeAll','options','find','create','body','describe','download','../../components/encryptor','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','downloads','MD5','sequelize','col','token','uniqueid','$and','push','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','runSentiment','sentiment'];(function(_0x5e8874,_0x134292){var _0x4bf1de=function(_0x941a8e){while(--_0x941a8e){_0x5e8874['push'](_0x5e8874['shift']());}};_0x4bf1de(++_0x134292);}(_0x6776,0x1d5));var _0x6677=function(_0x2e0826,_0x373ce4){_0x2e0826=_0x2e0826-0x0;var _0x3174a6=_0x6776[_0x2e0826];return _0x3174a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6677('0x0'));var zipdir=require(_0x6677('0x1'));var jsonpatch=require(_0x6677('0x2'));var rp=require(_0x6677('0x3'));var moment=require(_0x6677('0x4'));var BPromise=require(_0x6677('0x5'));var Mustache=require(_0x6677('0x6'));var util=require(_0x6677('0x7'));var path=require('path');var sox=require(_0x6677('0x8'));var csv=require(_0x6677('0x9'));var ejs=require(_0x6677('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6677('0xb'));var squel=require(_0x6677('0xc'));var crypto=require(_0x6677('0xd'));var jsforce=require(_0x6677('0xe'));var deskjs=require(_0x6677('0xf'));var toCsv=require(_0x6677('0x9'));var querystring=require(_0x6677('0x10'));var Papa=require(_0x6677('0x11'));var AWS=require(_0x6677('0x12'));var uuidv4=require(_0x6677('0x13'));var Redis=require('ioredis');var authService=require(_0x6677('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6677('0x15'));var hardwareService=require(_0x6677('0x16'));var logger=require(_0x6677('0x17'))(_0x6677('0x18'));var utils=require(_0x6677('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6677('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2630df,_0x1bd319){_0x1bd319=_0x1bd319||0xcc;return function(_0x56b34c){if(_0x56b34c){return _0x2630df[_0x6677('0x1b')](_0x1bd319);}return _0x2630df[_0x6677('0x1c')](_0x1bd319)['end']();};}function respondWithResult(_0x10ed7a,_0x20ab92){_0x20ab92=_0x20ab92||0xc8;return function(_0x540ba5){if(_0x540ba5){return _0x10ed7a[_0x6677('0x1c')](_0x20ab92)['json'](_0x540ba5);}};}function respondWithFilteredResult(_0x79d4e7,_0x31ad48){return function(_0x54a835){if(_0x54a835){var _0x4f80bd=typeof _0x31ad48['offset']===_0x6677('0x1d')&&typeof _0x31ad48[_0x6677('0x1e')]===_0x6677('0x1d');var _0x33ab49=_0x54a835[_0x6677('0x1f')];var _0x5416c6=_0x4f80bd?0x0:_0x31ad48[_0x6677('0x20')];var _0x38762d=_0x4f80bd?_0x54a835[_0x6677('0x1f')]:_0x31ad48[_0x6677('0x20')]+_0x31ad48[_0x6677('0x1e')];var _0x4a25a2;if(_0x38762d>=_0x33ab49){_0x38762d=_0x33ab49;_0x4a25a2=0xc8;}else{_0x4a25a2=0xce;}_0x79d4e7[_0x6677('0x1c')](_0x4a25a2);return _0x79d4e7[_0x6677('0x21')](_0x6677('0x22'),_0x5416c6+'-'+_0x38762d+'/'+_0x33ab49)[_0x6677('0x23')](_0x54a835);}return null;};}function patchUpdates(_0x20caa0){return function(_0x1dd449){try{jsonpatch[_0x6677('0x24')](_0x1dd449,_0x20caa0,!![]);}catch(_0x29aba0){return BPromise[_0x6677('0x25')](_0x29aba0);}return _0x1dd449[_0x6677('0x26')]();};}function saveUpdates(_0x2f1884,_0x280ead){return function(_0x40d0b1){if(_0x40d0b1){return _0x40d0b1[_0x6677('0x27')](_0x2f1884)[_0x6677('0x28')](function(_0x2c38f2){return _0x2c38f2;});}return null;};}function removeEntity(_0x189dbf,_0x7e4f57){return function(_0x29ae1d){if(_0x29ae1d){return _0x29ae1d[_0x6677('0x29')]()[_0x6677('0x28')](function(){_0x189dbf[_0x6677('0x1c')](0xcc)[_0x6677('0x2a')]();});}};}function handleEntityNotFound(_0x7cbaca,_0x3fdbb3){return function(_0x28a2a3){if(!_0x28a2a3){_0x7cbaca[_0x6677('0x1b')](0x194);}return _0x28a2a3;};}function handleError(_0x288320,_0x8bf9dd){_0x8bf9dd=_0x8bf9dd||0x1f4;return function(_0xb742dd){logger[_0x6677('0x2b')](_0xb742dd[_0x6677('0x2c')]);if(_0xb742dd['name']){delete _0xb742dd[_0x6677('0x2d')];}_0x288320[_0x6677('0x1c')](_0x8bf9dd)['send'](_0xb742dd);};}exports[_0x6677('0x2e')]=function(_0x32a8e5,_0xe46a3){var _0x2d5e02={},_0xf8b069={},_0x1c5c4a={'count':0x0,'rows':[]};var _0x511dff=_[_0x6677('0x2f')](db[_0x6677('0x30')][_0x6677('0x31')],function(_0x3ebf56){return{'name':_0x3ebf56[_0x6677('0x32')],'type':_0x3ebf56[_0x6677('0x33')]['key']};});_0xf8b069[_0x6677('0x34')]=_[_0x6677('0x35')](_[_0x6677('0x2f')](_0x511dff,'name'),[_0x6677('0x36')]);_0xf8b069[_0x6677('0x37')]=_['keys'](_0x32a8e5[_0x6677('0x37')]);_0xf8b069[_0x6677('0x38')]=_['intersection'](_0xf8b069['model'],_0xf8b069[_0x6677('0x37')]);_0x2d5e02[_0x6677('0x39')]=_[_0x6677('0x3a')](_0xf8b069[_0x6677('0x34')],qs[_0x6677('0x3b')](_0x32a8e5[_0x6677('0x37')][_0x6677('0x3b')]));_0x2d5e02['attributes']=_0x2d5e02['attributes']['length']?_0x2d5e02[_0x6677('0x39')]:_0xf8b069['model'];if(!_0x32a8e5['query']['hasOwnProperty'](_0x6677('0x3c'))){_0x2d5e02[_0x6677('0x1e')]=qs[_0x6677('0x1e')](_0x32a8e5[_0x6677('0x37')]['limit']);_0x2d5e02[_0x6677('0x20')]=qs['offset'](_0x32a8e5[_0x6677('0x37')][_0x6677('0x20')]);}_0x2d5e02[_0x6677('0x3d')]=qs[_0x6677('0x3e')](_0x32a8e5[_0x6677('0x37')][_0x6677('0x3e')]);_0x2d5e02['where']=qs['filters'](_[_0x6677('0x3f')](_0x32a8e5[_0x6677('0x37')],_0xf8b069['filters']),_0x511dff);if(_0x32a8e5['query'][_0x6677('0x40')]){_0x2d5e02['where']=_['merge'](_0x2d5e02['where'],{'$or':_['map'](_0x511dff,function(_0x3ae36a){if(_0x3ae36a[_0x6677('0x33')]!=='VIRTUAL'){var _0xa9a8da={};_0xa9a8da[_0x3ae36a[_0x6677('0x2d')]]={'$like':'%'+_0x32a8e5[_0x6677('0x37')]['filter']+'%'};return _0xa9a8da;}})});}_0x2d5e02=_['merge']({},_0x2d5e02,_0x32a8e5['options']);var _0x4a8727={'where':_0x2d5e02[_0x6677('0x41')]};return db[_0x6677('0x30')][_0x6677('0x1f')](_0x4a8727)[_0x6677('0x28')](function(_0x319a3f){_0x1c5c4a[_0x6677('0x1f')]=_0x319a3f;if(_0x32a8e5[_0x6677('0x37')]['includeAll']){_0x2d5e02[_0x6677('0x42')]=[{'all':!![]}];}return db[_0x6677('0x30')]['findAll'](_0x2d5e02);})[_0x6677('0x28')](function(_0x373d02){_0x1c5c4a['rows']=_0x373d02;return _0x1c5c4a;})[_0x6677('0x28')](respondWithFilteredResult(_0xe46a3,_0x2d5e02))[_0x6677('0x43')](handleError(_0xe46a3,null));};exports[_0x6677('0x44')]=function(_0x383a1f,_0x4e1e41){var _0x399df3={'raw':![],'where':{'id':_0x383a1f[_0x6677('0x45')]['id']}},_0x5e0bcc={};_0x5e0bcc[_0x6677('0x34')]=_[_0x6677('0x46')](db[_0x6677('0x30')][_0x6677('0x31')]);_0x5e0bcc[_0x6677('0x37')]=_[_0x6677('0x46')](_0x383a1f[_0x6677('0x37')]);_0x5e0bcc['filters']=_[_0x6677('0x3a')](_0x5e0bcc[_0x6677('0x34')],_0x5e0bcc[_0x6677('0x37')]);_0x399df3[_0x6677('0x39')]=_[_0x6677('0x3a')](_0x5e0bcc[_0x6677('0x34')],qs[_0x6677('0x3b')](_0x383a1f[_0x6677('0x37')]['fields']));_0x399df3[_0x6677('0x39')]=_0x399df3['attributes'][_0x6677('0x47')]?_0x399df3['attributes']:_0x5e0bcc[_0x6677('0x34')];if(_0x383a1f['query'][_0x6677('0x48')]){_0x399df3[_0x6677('0x42')]=[{'all':!![]}];}_0x399df3=_['merge']({},_0x399df3,_0x383a1f[_0x6677('0x49')]);return db[_0x6677('0x30')][_0x6677('0x4a')](_0x399df3)[_0x6677('0x28')](handleEntityNotFound(_0x4e1e41,null))[_0x6677('0x28')](respondWithResult(_0x4e1e41,null))[_0x6677('0x43')](handleError(_0x4e1e41,null));};exports[_0x6677('0x4b')]=function(_0x315a50,_0x1ee7cc){return db['VoiceRecording'][_0x6677('0x4b')](_0x315a50['body'],{})[_0x6677('0x28')](respondWithResult(_0x1ee7cc,0xc9))['catch'](handleError(_0x1ee7cc,null));};exports['update']=function(_0x1244cc,_0x37b2c3){if(_0x1244cc['body']['id']){delete _0x1244cc['body']['id'];}return db['VoiceRecording'][_0x6677('0x4a')]({'where':{'id':_0x1244cc['params']['id']}})['then'](handleEntityNotFound(_0x37b2c3,null))['then'](saveUpdates(_0x1244cc[_0x6677('0x4c')],null))[_0x6677('0x28')](respondWithResult(_0x37b2c3,null))['catch'](handleError(_0x37b2c3,null));};exports[_0x6677('0x4d')]=function(_0x3fea1f,_0x9c8250){return db[_0x6677('0x30')]['describe']()['then'](respondWithResult(_0x9c8250,null))[_0x6677('0x43')](handleError(_0x9c8250,null));};exports[_0x6677('0x4e')]=function(_0x11e99e,_0x5371d9,_0x2ac450){var _0x366f46=require(_0x6677('0x4f'));var _0x54743f=![];var _0x2824d9={};if(_0x11e99e[_0x6677('0x37')][_0x6677('0x33')]&&_0x11e99e[_0x6677('0x37')][_0x6677('0x33')]==='uniqueid'){_0x2824d9['uniqueid']=_0x11e99e[_0x6677('0x45')]['id'];}else{_0x2824d9['id']=_0x11e99e[_0x6677('0x45')]['id'];}return db[_0x6677('0x30')][_0x6677('0x4a')]({'where':_0x2824d9,'attributes':['id',_0x6677('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5371d9,null))['then'](function(_0x1537ba){if(_0x1537ba){var _0x1885f1=_0x1537ba[_0x6677('0x50')];var _0x217d68=util[_0x6677('0x36')](_0x6677('0x51'),_0x1885f1);if(fs[_0x6677('0x52')](_0x217d68)){_0x54743f=!![];return _0x366f46[_0x6677('0x53')](_0x217d68,_0x1885f1,config[_0x6677('0x54')]['recording'])['then'](function(){return _0x1537ba;});}return _0x1537ba;}})[_0x6677('0x28')](function(_0x150eb6){if(_0x150eb6){var _0x4237b0=_0x150eb6['value'];if(!fs[_0x6677('0x52')](_0x4237b0)){throw new db[(_0x6677('0x55'))][(_0x6677('0x56'))](_0x6677('0x57'));}if(_0x150eb6[_0x6677('0x58')]){return _0x5371d9[_0x6677('0x4e')](_0x4237b0,_0x150eb6['filename']+path[_0x6677('0x59')](_0x4237b0),function(){if(_0x54743f){fs[_0x6677('0x5a')](_0x4237b0);}});}else{return _0x5371d9[_0x6677('0x4e')](_0x4237b0,function(_0x5d12a9){if(_0x54743f){fs[_0x6677('0x5a')](_0x4237b0);}});}}})[_0x6677('0x43')](function(_0xce72ec){if(_0xce72ec[_0x6677('0x5b')]===_0x6677('0x57')){_0x5371d9[_0x6677('0x1c')](0x194)[_0x6677('0x5c')]('Not\x20found');}else{return handleError(_0x5371d9,null);}});};exports[_0x6677('0x5d')]=function(_0xfa9c82,_0x50143d,_0x1f9019){var _0x3c2936=require(_0x6677('0x4f'));var _0x29ae7e=![];var _0x14abbb={'$and':[db['sequelize'][_0x6677('0x41')](db['sequelize']['fn'](_0x6677('0x5e'),db[_0x6677('0x5f')][_0x6677('0x60')]('uniqueid')),_0xfa9c82['query'][_0x6677('0x61')])]};if(_0xfa9c82[_0x6677('0x37')][_0x6677('0x33')]&&_0xfa9c82[_0x6677('0x37')][_0x6677('0x33')]===_0x6677('0x62')){_0x14abbb[_0x6677('0x63')][_0x6677('0x64')]({'uniqueid':_0xfa9c82[_0x6677('0x45')]['id']});}else{_0x14abbb[_0x6677('0x63')][_0x6677('0x64')]({'id':_0xfa9c82[_0x6677('0x45')]['id']});}return db[_0x6677('0x30')][_0x6677('0x4a')]({'where':_0x14abbb,'attributes':['id',_0x6677('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x50143d,null))[_0x6677('0x28')](function(_0xe78af4){if(_0xe78af4){var _0x34fb7e=util[_0x6677('0x36')](_0x6677('0x51'),_0xe78af4[_0x6677('0x50')]);if(fs['existsSync'](_0x34fb7e)){_0x29ae7e=!![];return _0x3c2936[_0x6677('0x53')](_0x34fb7e,_0xe78af4[_0x6677('0x50')],config['secrets']['recording'])[_0x6677('0x28')](function(){return _0xe78af4;});}return _0xe78af4;}})[_0x6677('0x28')](function(_0x167b9e){if(_0x167b9e){if(!fs['existsSync'](_0x167b9e[_0x6677('0x50')])){throw new db[(_0x6677('0x55'))]['ValidationError'](_0x6677('0x57'));}if(_0x167b9e[_0x6677('0x58')]){return _0x50143d[_0x6677('0x4e')](_0x167b9e[_0x6677('0x50')],_0x167b9e[_0x6677('0x58')]+path['extname'](_0x167b9e[_0x6677('0x50')]),function(){if(_0x29ae7e){fs[_0x6677('0x5a')](_0x167b9e[_0x6677('0x50')]);}});}else{return _0x50143d[_0x6677('0x4e')](_0x167b9e[_0x6677('0x50')],function(_0x4d84e2){if(_0x29ae7e){fs[_0x6677('0x5a')](_0x167b9e[_0x6677('0x50')]);}});}}})[_0x6677('0x43')](handleError(_0x50143d,null));};exports['destroy']=function(_0x2706d6,_0x262c82){return db[_0x6677('0x30')]['find']({'where':{'id':_0x2706d6[_0x6677('0x45')]['id']}})['then'](function(_0x1346bc){if(_['isNil'](_0x1346bc)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1346bc;})[_0x6677('0x28')](function(_0x271cd1){var _0x31fde3=_0x271cd1[_0x6677('0x50')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x31fde3);if(!_[_0x6677('0x65')](_0x271cd1[_0x6677('0x50')])&&fs[_0x6677('0x52')](_0x31fde3)){logger[_0x6677('0x66')]('File:\x20\x22'+_0x31fde3+_0x6677('0x67'));fs[_0x6677('0x68')](_0x31fde3);}_0x31fde3=_0x31fde3+_0x6677('0x69');if(!_[_0x6677('0x65')](_0x271cd1[_0x6677('0x50')])&&fs[_0x6677('0x52')](_0x31fde3)){logger[_0x6677('0x66')](_0x6677('0x6a')+_0x31fde3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6677('0x68')](_0x31fde3);}return _0x271cd1;})[_0x6677('0x28')](function(_0x2a788e){if(!_0x2a788e)throw new InternalError();return _0x2a788e['destroy']();})[_0x6677('0x28')](function(){_0x262c82[_0x6677('0x1c')](0xcc)[_0x6677('0x2a')]();})[_0x6677('0x43')](handleError(_0x262c82,null));};function getBucketslist(_0x16f078,_0x3cbdca,_0xa12149){return new Promise(function(_0x56bfb4,_0x5c8806){var _0x30be49=new AWS['S3']({'accessKeyId':_0x3cbdca,'secretAccessKey':_0x16f078,'region':_0xa12149});_0x30be49[_0x6677('0x6b')]({},function(_0x208a33,_0x42160c){if(_0x208a33){return _0x5c8806(_0x208a33);}else{return _0x56bfb4(_0x42160c);}});});}function createBucket(_0x56602c,_0x7999ce,_0x398de5,_0x2e1712){return new Promise(function(_0x3b0b3b,_0xee9016){var _0x10b2f6=new AWS['S3']({'accessKeyId':_0x7999ce,'secretAccessKey':_0x56602c,'region':_0x398de5});_0x10b2f6[_0x6677('0x6c')]({'Bucket':_0x2e1712},function(_0x5dc9da,_0x50720a){if(_0x5dc9da){return _0xee9016(_0x5dc9da);}else{return _0x3b0b3b(_0x50720a);}});});}function uploadFile(_0x469a6f,_0x5dffdd,_0x539533,_0x33dc59,_0x252acf,_0x512f2c){return new Promise(function(_0x2b5190,_0x2c405c){var _0x202c06=new AWS['S3']({'accessKeyId':_0x5dffdd,'secretAccessKey':_0x469a6f,'region':_0x539533});_0x202c06[_0x6677('0x6d')]({'Bucket':_0x33dc59,'Key':_0x252acf,'Body':_0x512f2c},function(_0x3de7e3,_0x45903e){if(_0x3de7e3){return _0x2c405c(_0x3de7e3);}else{return _0x2b5190(_0x45903e);}});});}function startTranscribe(_0x191025,_0x207248,_0x1471d6,_0x85dc1e,_0x47913a,_0x423a5d){return new Promise(function(_0x536bee,_0x2fc667){var _0x3ff763=new AWS['TranscribeService']({'accessKeyId':_0x207248,'secretAccessKey':_0x191025,'region':_0x1471d6});_0x3ff763[_0x6677('0x6e')]({'TranscriptionJobName':_0x85dc1e,'LanguageCode':_0x47913a,'Media':{'MediaFileUri':_0x423a5d}},function(_0x595af2,_0x184ed0){if(_0x595af2){return _0x2fc667(_0x595af2);}else{return _0x536bee(_0x184ed0);}});});}function transcribe(_0x3b01e7,_0x2b3193,_0x1b2b31,_0x2c8b6d,_0xc2f1e,_0x5001fa,_0x25f751){return new Promise(function(_0x3ec9cf,_0x2ccd32){var _0x4f607a={};logger['info'](util['format'](_0x6677('0x6f'),_0x3b01e7,_0xc2f1e));return uploadFile(_0x2b3193,_0x1b2b31,_0x2c8b6d,_0xc2f1e,path[_0x6677('0x70')](_0x5001fa),fs[_0x6677('0x71')](_0x5001fa))[_0x6677('0x28')](function(_0x38c073){logger['info'](util[_0x6677('0x36')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3b01e7,_0xc2f1e,_0x38c073[_0x6677('0x72')]));_0x4f607a[_0x6677('0x73')]=_0x38c073[_0x6677('0x74')];_0x4f607a['location']=_0x38c073[_0x6677('0x72')];logger['info'](util['format'](_0x6677('0x75'),_0x3b01e7));return startTranscribe(_0x2b3193,_0x1b2b31,_0x2c8b6d,uuidv4(),_0x25f751,_0x38c073[_0x6677('0x72')]);})['then'](function(_0xaf6130){logger[_0x6677('0x66')](util['format'](_0x6677('0x76'),_0x3b01e7,_0xaf6130[_0x6677('0x77')]['TranscriptionJobName']));_0x4f607a[_0x6677('0x78')]=_0xaf6130['TranscriptionJob']['TranscriptionJobName'];_0x4f607a[_0x6677('0x79')]=_0xaf6130[_0x6677('0x77')]['TranscriptionJobStatus'];return _0x3ec9cf(_0x4f607a);})[_0x6677('0x43')](function(_0x435acb){return _0x2ccd32(_0x435acb);});});}exports['runTranscribe']=function(_0x31129d,_0x3c212c,_0x1efc23){var _0x31af42;var _0x2d1fce;var _0x48072e;var _0x2d335b=require(_0x6677('0x4f'));return db[_0x6677('0x30')][_0x6677('0x7a')]({'where':{'id':_0x31129d['params']['id']}})['then'](function(_0x259a38){if(_0x259a38){var _0x34ac84=util[_0x6677('0x36')](_0x6677('0x51'),_0x259a38[_0x6677('0x50')]);if(fs[_0x6677('0x52')](_0x34ac84)){cypher=!![];return _0x2d335b['decryptFile'](_0x34ac84,_0x259a38[_0x6677('0x50')],config[_0x6677('0x54')]['recording'])[_0x6677('0x28')](function(){return _0x259a38;});}return _0x259a38;}})[_0x6677('0x28')](function(_0x1495bd){if(!_0x1495bd){throw new db[(_0x6677('0x55'))]['ValidationError'](_0x6677('0x7b'));}_0x2d1fce=_0x1495bd;return db['Setting'][_0x6677('0x7a')]({'where':{'id':0x1}});})[_0x6677('0x28')](handleEntityNotFound(_0x3c212c,null))[_0x6677('0x28')](function(_0xdb064a){if(_0xdb064a){_0x31af42=_0xdb064a;if(!_0x31af42['transcribe']||!_0x31af42[_0x6677('0x7c')]||!_0x31af42['transcribeRegion']||!_0x31af42['language']||!_0x31af42[_0x6677('0x73')]){throw new db[(_0x6677('0x55'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x31129d[_0x6677('0x4c')][_0x6677('0x7d')]&&(!_0x31af42[_0x6677('0x7e')]||!_0x31af42[_0x6677('0x7f')]||!_0x31af42['sentimentRegion']||!_0x31af42['language']||!_0x31af42[_0x6677('0x73')])){throw new db[(_0x6677('0x55'))][(_0x6677('0x56'))](_0x6677('0x80'));}return db[_0x6677('0x81')]['findOne']({'where':{'id':_0x31af42[_0x6677('0x7c')]}});}})[_0x6677('0x28')](function(_0x537caf){if(!_0x537caf){throw new db[(_0x6677('0x55'))][(_0x6677('0x56'))](_0x6677('0x82'));}if(!_0x537caf[_0x6677('0x83')]||!_0x537caf[_0x6677('0x84')]){throw new db[(_0x6677('0x55'))][(_0x6677('0x56'))]('Cloud\x20Provider\x20not\x20configured');}_0x48072e=_0x537caf;return getBucketslist(_0x48072e[_0x6677('0x83')],_0x48072e['data2'],_0x31af42[_0x6677('0x85')]);})[_0x6677('0x28')](function(_0x469de0){if(_0x469de0&&_0x469de0[_0x6677('0x86')]){var _0x5ae1e2=_[_0x6677('0x4a')](_0x469de0[_0x6677('0x86')],function(_0x2532cd){return _0x2532cd[_0x6677('0x87')]===_0x31af42['bucket'];});if(!_0x5ae1e2){logger[_0x6677('0x66')](util['format'](_0x6677('0x88'),_0x31129d['params']['id'],_0x31af42[_0x6677('0x73')]));return createBucket(_0x48072e['data1'],_0x48072e[_0x6677('0x84')],_0x31af42[_0x6677('0x85')],_0x31af42[_0x6677('0x73')]);}logger[_0x6677('0x66')](util['format'](_0x6677('0x89'),_0x31129d[_0x6677('0x45')]['id'],_0x31af42[_0x6677('0x73')]));return;}})[_0x6677('0x28')](function(_0x3166af){if(_0x2d1fce[_0x6677('0x79')]===_0x6677('0x8a')){return transcribe(_0x31129d[_0x6677('0x45')]['id'],_0x48072e[_0x6677('0x83')],_0x48072e['data2'],_0x31af42['transcribeRegion'],_0x31af42[_0x6677('0x73')],_0x2d1fce[_0x6677('0x50')],_0x31af42['language']);}else{logger[_0x6677('0x66')](util[_0x6677('0x36')](_0x6677('0x8b'),_0x31129d[_0x6677('0x45')]['id']));return{'transcribeStatus':_0x6677('0x8c')};}})[_0x6677('0x28')](function(_0x148ed4){if(_0x148ed4){_0x148ed4[_0x6677('0x8d')]=_0x31129d['body'][_0x6677('0x7d')];return _0x2d1fce[_0x6677('0x8e')](_0x148ed4);}})[_0x6677('0x28')](respondWithResult(_0x3c212c,null))[_0x6677('0x43')](handleError(_0x3c212c,null));};function writeFile(_0x51b9e7,_0xcb5609){return new Promise(function(_0xe14dc0,_0x3c2d99){fs['writeFile'](_0xcb5609,_0x51b9e7,function(_0x5107b4,_0x2fa5a2){if(_0x5107b4){return _0x3c2d99(_0x5107b4);}else{return _0xe14dc0(_0x2fa5a2);}});});}exports[_0x6677('0x8f')]=function(_0x578de0,_0x30d81f,_0x36024e){return db[_0x6677('0x30')][_0x6677('0x7a')]({'where':{'id':_0x578de0[_0x6677('0x45')]['id']}})[_0x6677('0x28')](handleEntityNotFound(_0x30d81f))[_0x6677('0x28')](function(_0x5240f0){if(_0x5240f0&&_0x5240f0[_0x6677('0x90')]){var _0x3d883c=_0x5240f0[_0x6677('0x90')];var _0x15365b=config[_0x6677('0x91')]+_0x6677('0x92')+_0x5240f0['id']+_0x6677('0x93');if(fs[_0x6677('0x52')](_0x15365b)){return _0x15365b;}return writeFile(_0x3d883c,_0x15365b)['then'](function(){return _0x15365b;});}else{throw new db['Sequelize'][(_0x6677('0x56'))](_0x6677('0x94'));}})['then'](function(_0x54bb65){return _0x30d81f[_0x6677('0x4e')](_0x54bb65);})['catch'](handleError(_0x30d81f));};
\ No newline at end of file
index 1cf1f1c..4261b76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bca=['./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ce932,_0x2bab0b){var _0x464253=function(_0x46bd75){while(--_0x46bd75){_0x1ce932['push'](_0x1ce932['shift']());}};_0x464253(++_0x2bab0b);}(_0x8bca,0x12b));var _0xa8bc=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8bca[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xa8bc('0x0'));var util=require(_0xa8bc('0x1'));var logger=require(_0xa8bc('0x2'))('api');var moment=require(_0xa8bc('0x3'));var BPromise=require(_0xa8bc('0x4'));var rp=require(_0xa8bc('0x5'));var fs=require('fs');var path=require(_0xa8bc('0x6'));var rimraf=require(_0xa8bc('0x7'));var config=require(_0xa8bc('0x8'));var attributes=require(_0xa8bc('0x9'));module[_0xa8bc('0xa')]=function(_0x13329d,_0xe0e75c){return _0x13329d[_0xa8bc('0xb')]('VoiceRecording',attributes,{'tableName':_0xa8bc('0xc'),'paranoid':![],'indexes':[{'name':_0xa8bc('0xd'),'fields':[_0xa8bc('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bf1=['moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8bf1,0x65));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18bf('0x0'));var util=require('util');var logger=require(_0x18bf('0x1'))(_0x18bf('0x2'));var moment=require(_0x18bf('0x3'));var BPromise=require(_0x18bf('0x4'));var rp=require(_0x18bf('0x5'));var fs=require('fs');var path=require(_0x18bf('0x6'));var rimraf=require(_0x18bf('0x7'));var config=require('../../config/environment');var attributes=require(_0x18bf('0x8'));module[_0x18bf('0x9')]=function(_0x231646,_0x807291){return _0x231646['define'](_0x18bf('0xa'),attributes,{'tableName':_0x18bf('0xb'),'paranoid':![],'indexes':[{'name':_0x18bf('0xc'),'fields':[_0x18bf('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 9cdc5a5..0ac73c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit','debug','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0xc80721,_0x264448){var _0x17650c=function(_0x37021e){while(--_0x37021e){_0xc80721['push'](_0xc80721['shift']());}};_0x17650c(++_0x264448);}(_0x955f,0x1eb));var _0xf955=function(_0x3e531f,_0x5f26bc){_0x3e531f=_0x3e531f-0x0;var _0x391f48=_0x955f[_0x3e531f];return _0x391f48;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['UpdateVoiceRecording']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['VoiceRecording'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x19')]||null:null,'attributes':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb['options'][_0xf955('0x1a')]||null:null,'limit':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x1b')]||null:null})[_0xf955('0xb')](function(_0xa4ebb4){logger[_0xf955('0xc')]('UpdateVoiceRecording',_0x5ac6cb);logger[_0xf955('0x1c')](_0xf955('0x1d'),_0x5ac6cb,JSON[_0xf955('0x10')](_0xa4ebb4));_0xe6de5c(_0xa4ebb4);})[_0xf955('0x14')](function(_0x17dec2){logger[_0xf955('0x11')](_0xf955('0x1d'),_0x17dec2['message'],_0x5ac6cb);_0x3c49c0(_0x1e20d1[_0xf955('0x11')](0x1f4,_0x17dec2[_0xf955('0x12')]));});});};exports[_0xf955('0x1e')]=function(_0x406632){var _0x2dcd55=this;return new Promise(function(_0x13a86d,_0x3796f7){var _0x51f3ab=require(_0xf955('0x1f'));var _0x145098;return db[_0xf955('0x20')][_0xf955('0x21')]({'attributes':['id',_0xf955('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf955('0xb')](function(_0x4d4af0){_0x145098=_0x4d4af0;return db[_0xf955('0x23')][_0xf955('0x24')](_0x406632['body']);})[_0xf955('0xb')](function(_0x2c8df1){if(_0x145098[_0xf955('0x22')]&&fs[_0xf955('0x25')](_0x2c8df1['value'])){var _0x3a951c=util['format'](_0xf955('0x26'),_0x2c8df1[_0xf955('0x27')]);return _0x51f3ab[_0xf955('0x28')](_0x2c8df1[_0xf955('0x27')],_0x3a951c,config[_0xf955('0x29')][_0xf955('0x2a')])[_0xf955('0xb')](function(){fs[_0xf955('0x2b')](_0x2c8df1['value']);logger[_0xf955('0xc')](_0xf955('0x2c'));return _0x2c8df1;});}return _0x2c8df1;})[_0xf955('0xb')](function(_0x2046c8){logger['info'](_0xf955('0x1e'),_0x406632);logger[_0xf955('0x1c')](_0xf955('0x1e'),_0x406632,JSON[_0xf955('0x10')](_0x2046c8));_0x13a86d(_0x2046c8);})[_0xf955('0x14')](function(_0x4eb2c3){logger['error']('CreateVoiceRecording',_0x4eb2c3[_0xf955('0x12')],_0x406632);_0x3796f7(_0x2dcd55[_0xf955('0x11')](0x1f4,_0x4eb2c3[_0xf955('0x12')]));});});};
\ No newline at end of file
+var _0x32b6=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x32b6,0x1d1));var _0x632b=function(_0x1722f4,_0x44f4d7){_0x1722f4=_0x1722f4-0x0;var _0x59a9ce=_0x32b6[_0x1722f4];return _0x59a9ce;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['where']||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['attributes']||null:null,'limit':_0x3bb27f[_0x632b('0x19')]?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1b')]||null:null})['then'](function(_0x10fc32){logger[_0x632b('0x14')]('UpdateVoiceRecording',_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON[_0x632b('0xf')](_0x10fc32));_0x51c894(_0x10fc32);})[_0x632b('0x1c')](function(_0x45d017){logger[_0x632b('0x10')]('UpdateVoiceRecording',_0x45d017['message'],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x45d017['message']));});});};exports[_0x632b('0x1d')]=function(_0x954fa0){var _0x5d6855=this;return new Promise(function(_0x273e89,_0x3f4eab){var _0x29d9aa=require(_0x632b('0x1e'));var _0x4728a8;return db[_0x632b('0x1f')][_0x632b('0x20')]({'attributes':['id',_0x632b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x632b('0xc')](function(_0x4f8410){_0x4728a8=_0x4f8410;return db[_0x632b('0x16')][_0x632b('0x22')](_0x954fa0[_0x632b('0x18')]);})[_0x632b('0xc')](function(_0x17a5ba){if(_0x4728a8[_0x632b('0x21')]&&fs[_0x632b('0x23')](_0x17a5ba[_0x632b('0x24')])){var _0x1ace1b=util[_0x632b('0x25')](_0x632b('0x26'),_0x17a5ba[_0x632b('0x24')]);return _0x29d9aa[_0x632b('0x27')](_0x17a5ba[_0x632b('0x24')],_0x1ace1b,config[_0x632b('0x28')][_0x632b('0x29')])[_0x632b('0xc')](function(){fs[_0x632b('0x2a')](_0x17a5ba[_0x632b('0x24')]);logger[_0x632b('0x14')]('CreateVoiceRecording\x20file\x20encrypted');return _0x17a5ba;});}return _0x17a5ba;})[_0x632b('0xc')](function(_0x4401dc){logger[_0x632b('0x14')](_0x632b('0x1d'),_0x954fa0);logger['debug'](_0x632b('0x1d'),_0x954fa0,JSON['stringify'](_0x4401dc));_0x273e89(_0x4401dc);})[_0x632b('0x1c')](function(_0x15b22d){logger['error'](_0x632b('0x1d'),_0x15b22d[_0x632b('0x13')],_0x954fa0);_0x3f4eab(_0x5d6855[_0x632b('0x10')](0x1f4,_0x15b22d[_0x632b('0x13')]));});});};
\ No newline at end of file
index 03e7f67..2dfd051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ec=['update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x44ec,0x159));var _0xc44e=function(_0x1889e8,_0x30b3df){_0x1889e8=_0x1889e8-0x0;var _0x3a8bac=_0x44ec[_0x1889e8];return _0x3a8bac;};'use strict';var multer=require('multer');var util=require(_0xc44e('0x0'));var path=require(_0xc44e('0x1'));var timeout=require(_0xc44e('0x2'));var express=require(_0xc44e('0x3'));var router=express['Router']();var fs_extra=require(_0xc44e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc44e('0x5'));var config=require(_0xc44e('0x6'));var controller=require(_0xc44e('0x7'));router[_0xc44e('0x8')]('/',auth[_0xc44e('0x9')](),controller['index']);router['get'](_0xc44e('0xa'),auth[_0xc44e('0x9')](),controller[_0xc44e('0xb')]);router['get']('/:id',auth[_0xc44e('0x9')](),controller[_0xc44e('0xc')]);router[_0xc44e('0xd')]('/',auth['isAuthenticated'](),controller[_0xc44e('0xe')]);router['put']('/:id',auth[_0xc44e('0x9')](),controller[_0xc44e('0xf')]);router['delete']('/:id',auth[_0xc44e('0x9')](),controller[_0xc44e('0x10')]);module[_0xc44e('0x11')]=router;
\ No newline at end of file
+var _0xfbf7=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x487212,_0x3a07ce){var _0x26f6d3=function(_0x2da634){while(--_0x2da634){_0x487212['push'](_0x487212['shift']());}};_0x26f6d3(++_0x3a07ce);}(_0xfbf7,0x78));var _0x7fbf=function(_0x538110,_0x174feb){_0x538110=_0x538110-0x0;var _0x2768f1=_0xfbf7[_0x538110];return _0x2768f1;};'use strict';var multer=require(_0x7fbf('0x0'));var util=require(_0x7fbf('0x1'));var path=require('path');var timeout=require(_0x7fbf('0x2'));var express=require('express');var router=express[_0x7fbf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7fbf('0x4'));var interaction=require(_0x7fbf('0x5'));var config=require(_0x7fbf('0x6'));var controller=require(_0x7fbf('0x7'));router[_0x7fbf('0x8')]('/',auth[_0x7fbf('0x9')](),controller[_0x7fbf('0xa')]);router[_0x7fbf('0x8')]('/describe',auth[_0x7fbf('0x9')](),controller[_0x7fbf('0xb')]);router['get'](_0x7fbf('0xc'),auth[_0x7fbf('0x9')](),controller['show']);router[_0x7fbf('0xd')]('/',auth['isAuthenticated'](),controller[_0x7fbf('0xe')]);router[_0x7fbf('0xf')](_0x7fbf('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7fbf('0xc'),auth['isAuthenticated'](),controller[_0x7fbf('0x10')]);module[_0x7fbf('0x11')]=router;
\ No newline at end of file
index 959af76..512b027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46dc=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x4e00f3,_0x4e7ccc){var _0x2e3471=function(_0x485126){while(--_0x485126){_0x4e00f3['push'](_0x4e00f3['shift']());}};_0x2e3471(++_0x4e7ccc);}(_0x46dc,0xdc));var _0xc46d=function(_0x2efd23,_0x816c4b){_0x2efd23=_0x2efd23-0x0;var _0x3c25bf=_0x46dc[_0x2efd23];return _0x3c25bf;};'use strict';var Sequelize=require(_0xc46d('0x0'));var moment=require(_0xc46d('0x1'));module[_0xc46d('0x2')]={'type':{'type':Sequelize[_0xc46d('0x3')](_0xc46d('0x4'),_0xc46d('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xc46d('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc46d('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xc46d('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xc46d('0x6')]},'transferercontext':{'type':Sequelize[_0xc46d('0x6')]},'transfererexten':{'type':Sequelize[_0xc46d('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xc46d('0x6')]},'transfereechannel':{'type':Sequelize[_0xc46d('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xc46d('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc46d('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xc46d('0x6')]},'transfereecontext':{'type':Sequelize[_0xc46d('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xc46d('0x6')]},'isexternal':{'type':Sequelize[_0xc46d('0x3')](_0xc46d('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc46d('0x6')]}};
\ No newline at end of file
+var _0x42c7=['sequelize','moment','exports','ENUM','attended','STRING'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x42c7,0x14a));var _0x742c=function(_0x2578db,_0x5b8477){_0x2578db=_0x2578db-0x0;var _0x2c11e3=_0x42c7[_0x2578db];return _0x2c11e3;};'use strict';var Sequelize=require(_0x742c('0x0'));var moment=require(_0x742c('0x1'));module[_0x742c('0x2')]={'type':{'type':Sequelize[_0x742c('0x3')]('blind',_0x742c('0x4'))},'result':{'type':Sequelize[_0x742c('0x5')]},'transfererchannel':{'type':Sequelize[_0x742c('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x742c('0x5')]},'transferercalleridname':{'type':Sequelize[_0x742c('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x742c('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x742c('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x742c('0x5')]},'transferercontext':{'type':Sequelize[_0x742c('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x742c('0x5')]},'transfereechannel':{'type':Sequelize[_0x742c('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x742c('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x742c('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x742c('0x5')]},'transfereecontext':{'type':Sequelize[_0x742c('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x742c('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x742c('0x5')]},'extension':{'type':Sequelize[_0x742c('0x5')]}};
\ No newline at end of file
index 5146e7a..f873503 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd74b=['sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','params','length','includeAll','find','catch','create','body','describe','eml-format','rimraf','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','update','then','destroy','sendStatus','error','stack','name','map','VoiceTransferReport','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0xa86d5,_0xc9993e){var _0x17ef37=function(_0x7a9a41){while(--_0x7a9a41){_0xa86d5['push'](_0xa86d5['shift']());}};_0x17ef37(++_0xc9993e);}(_0xd74b,0x19d));var _0xbd74=function(_0x15efc5,_0x56a10d){_0x15efc5=_0x15efc5-0x0;var _0x444c95=_0xd74b[_0x15efc5];return _0x444c95;};'use strict';var emlformat=require(_0xbd74('0x0'));var rimraf=require(_0xbd74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd74('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd74('0x3'));var path=require(_0xbd74('0x4'));var sox=require(_0xbd74('0x5'));var csv=require(_0xbd74('0x6'));var ejs=require(_0xbd74('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd74('0x8'));var squel=require(_0xbd74('0x9'));var crypto=require(_0xbd74('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbd74('0x6'));var querystring=require(_0xbd74('0xb'));var Papa=require(_0xbd74('0xc'));var Redis=require('ioredis');var authService=require(_0xbd74('0xd'));var qs=require(_0xbd74('0xe'));var as=require(_0xbd74('0xf'));var hardwareService=require(_0xbd74('0x10'));var logger=require(_0xbd74('0x11'))(_0xbd74('0x12'));var utils=require(_0xbd74('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbd74('0x14'));var db=require(_0xbd74('0x15'))['db'];function respondWithStatusCode(_0x53695b,_0x39655c){_0x39655c=_0x39655c||0xcc;return function(_0x3a3764){if(_0x3a3764){return _0x53695b['sendStatus'](_0x39655c);}return _0x53695b[_0xbd74('0x16')](_0x39655c)[_0xbd74('0x17')]();};}function respondWithResult(_0x4ff4d9,_0x3d6e9c){_0x3d6e9c=_0x3d6e9c||0xc8;return function(_0x6baccd){if(_0x6baccd){return _0x4ff4d9[_0xbd74('0x16')](_0x3d6e9c)['json'](_0x6baccd);}};}function respondWithFilteredResult(_0x341c54,_0x21a07e){return function(_0x3fa5d6){if(_0x3fa5d6){var _0x196049=typeof _0x21a07e[_0xbd74('0x18')]===_0xbd74('0x19')&&typeof _0x21a07e[_0xbd74('0x1a')]==='undefined';var _0x2bc3dd=_0x3fa5d6[_0xbd74('0x1b')];var _0x52d80d=_0x196049?0x0:_0x21a07e['offset'];var _0x29ea67=_0x196049?_0x3fa5d6['count']:_0x21a07e[_0xbd74('0x18')]+_0x21a07e[_0xbd74('0x1a')];var _0x1a2cb0;if(_0x29ea67>=_0x2bc3dd){_0x29ea67=_0x2bc3dd;_0x1a2cb0=0xc8;}else{_0x1a2cb0=0xce;}_0x341c54[_0xbd74('0x16')](_0x1a2cb0);return _0x341c54[_0xbd74('0x1c')]('Content-Range',_0x52d80d+'-'+_0x29ea67+'/'+_0x2bc3dd)[_0xbd74('0x1d')](_0x3fa5d6);}return null;};}function patchUpdates(_0x25026e){return function(_0x37c541){try{jsonpatch['apply'](_0x37c541,_0x25026e,!![]);}catch(_0x29c809){return BPromise['reject'](_0x29c809);}return _0x37c541['save']();};}function saveUpdates(_0x30e3ef,_0x1eed3a){return function(_0x25641d){if(_0x25641d){return _0x25641d[_0xbd74('0x1e')](_0x30e3ef)[_0xbd74('0x1f')](function(_0xde1cfb){return _0xde1cfb;});}return null;};}function removeEntity(_0x4e6c87,_0x40e586){return function(_0x3dc515){if(_0x3dc515){return _0x3dc515[_0xbd74('0x20')]()['then'](function(){_0x4e6c87['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fcd83,_0x25d958){return function(_0x2adb7b){if(!_0x2adb7b){_0x1fcd83[_0xbd74('0x21')](0x194);}return _0x2adb7b;};}function handleError(_0x58bd65,_0x2b9661){_0x2b9661=_0x2b9661||0x1f4;return function(_0x55bc76){logger[_0xbd74('0x22')](_0x55bc76[_0xbd74('0x23')]);if(_0x55bc76[_0xbd74('0x24')]){delete _0x55bc76[_0xbd74('0x24')];}_0x58bd65[_0xbd74('0x16')](_0x2b9661)['send'](_0x55bc76);};}exports['index']=function(_0x350603,_0x10c573){var _0x5270b8={},_0x11d63b={},_0x303ea6={'count':0x0,'rows':[]};var _0x1004a4=_[_0xbd74('0x25')](db[_0xbd74('0x26')][_0xbd74('0x27')],function(_0x246245){return{'name':_0x246245['fieldName'],'type':_0x246245['type']['key']};});_0x11d63b[_0xbd74('0x28')]=_[_0xbd74('0x25')](_0x1004a4,_0xbd74('0x24'));_0x11d63b[_0xbd74('0x29')]=_[_0xbd74('0x2a')](_0x350603[_0xbd74('0x29')]);_0x11d63b['filters']=_[_0xbd74('0x2b')](_0x11d63b[_0xbd74('0x28')],_0x11d63b['query']);_0x5270b8[_0xbd74('0x2c')]=_[_0xbd74('0x2b')](_0x11d63b[_0xbd74('0x28')],qs[_0xbd74('0x2d')](_0x350603[_0xbd74('0x29')][_0xbd74('0x2d')]));_0x5270b8[_0xbd74('0x2c')]=_0x5270b8[_0xbd74('0x2c')]['length']?_0x5270b8[_0xbd74('0x2c')]:_0x11d63b[_0xbd74('0x28')];if(!_0x350603[_0xbd74('0x29')][_0xbd74('0x2e')](_0xbd74('0x2f'))){_0x5270b8[_0xbd74('0x1a')]=qs[_0xbd74('0x1a')](_0x350603['query'][_0xbd74('0x1a')]);_0x5270b8[_0xbd74('0x18')]=qs['offset'](_0x350603[_0xbd74('0x29')]['offset']);}_0x5270b8[_0xbd74('0x30')]=qs[_0xbd74('0x31')](_0x350603[_0xbd74('0x29')][_0xbd74('0x31')]);_0x5270b8[_0xbd74('0x32')]=qs[_0xbd74('0x33')](_[_0xbd74('0x34')](_0x350603[_0xbd74('0x29')],_0x11d63b[_0xbd74('0x33')]),_0x1004a4);if(_0x350603[_0xbd74('0x29')][_0xbd74('0x35')]){_0x5270b8[_0xbd74('0x32')]=_[_0xbd74('0x36')](_0x5270b8['where'],{'$or':_['map'](_0x1004a4,function(_0x5437f9){if(_0x5437f9['type']!==_0xbd74('0x37')){var _0x4e026a={};_0x4e026a[_0x5437f9['name']]={'$like':'%'+_0x350603[_0xbd74('0x29')][_0xbd74('0x35')]+'%'};return _0x4e026a;}})});}_0x5270b8=_[_0xbd74('0x36')]({},_0x5270b8,_0x350603[_0xbd74('0x38')]);var _0x3ca621={'where':_0x5270b8[_0xbd74('0x32')]};return db[_0xbd74('0x26')][_0xbd74('0x1b')](_0x3ca621)['then'](function(_0x3eaefb){_0x303ea6['count']=_0x3eaefb;if(_0x350603['query']['includeAll']){_0x5270b8['include']=[{'all':!![]}];}return db[_0xbd74('0x26')]['findAll'](_0x5270b8);})[_0xbd74('0x1f')](function(_0x5a4264){_0x303ea6[_0xbd74('0x39')]=_0x5a4264;return _0x303ea6;})[_0xbd74('0x1f')](respondWithFilteredResult(_0x10c573,_0x5270b8))['catch'](handleError(_0x10c573,null));};exports['show']=function(_0x472667,_0x4f9a5f){var _0x5e54d2={'raw':!![],'where':{'id':_0x472667[_0xbd74('0x3a')]['id']}},_0x22a1a7={};_0x22a1a7[_0xbd74('0x28')]=_['keys'](db[_0xbd74('0x26')]['rawAttributes']);_0x22a1a7[_0xbd74('0x29')]=_[_0xbd74('0x2a')](_0x472667['query']);_0x22a1a7['filters']=_[_0xbd74('0x2b')](_0x22a1a7[_0xbd74('0x28')],_0x22a1a7[_0xbd74('0x29')]);_0x5e54d2[_0xbd74('0x2c')]=_[_0xbd74('0x2b')](_0x22a1a7['model'],qs[_0xbd74('0x2d')](_0x472667[_0xbd74('0x29')][_0xbd74('0x2d')]));_0x5e54d2[_0xbd74('0x2c')]=_0x5e54d2[_0xbd74('0x2c')][_0xbd74('0x3b')]?_0x5e54d2[_0xbd74('0x2c')]:_0x22a1a7[_0xbd74('0x28')];if(_0x472667[_0xbd74('0x29')][_0xbd74('0x3c')]){_0x5e54d2['include']=[{'all':!![]}];}_0x5e54d2=_[_0xbd74('0x36')]({},_0x5e54d2,_0x472667[_0xbd74('0x38')]);return db[_0xbd74('0x26')][_0xbd74('0x3d')](_0x5e54d2)['then'](handleEntityNotFound(_0x4f9a5f,null))['then'](respondWithResult(_0x4f9a5f,null))[_0xbd74('0x3e')](handleError(_0x4f9a5f,null));};exports['create']=function(_0x23bd38,_0x4d44e5){return db[_0xbd74('0x26')][_0xbd74('0x3f')](_0x23bd38[_0xbd74('0x40')],{})[_0xbd74('0x1f')](respondWithResult(_0x4d44e5,0xc9))[_0xbd74('0x3e')](handleError(_0x4d44e5,null));};exports[_0xbd74('0x1e')]=function(_0x4037cf,_0x5b706b){if(_0x4037cf[_0xbd74('0x40')]['id']){delete _0x4037cf[_0xbd74('0x40')]['id'];}return db[_0xbd74('0x26')][_0xbd74('0x3d')]({'where':{'id':_0x4037cf['params']['id']}})[_0xbd74('0x1f')](handleEntityNotFound(_0x5b706b,null))[_0xbd74('0x1f')](saveUpdates(_0x4037cf[_0xbd74('0x40')],null))[_0xbd74('0x1f')](respondWithResult(_0x5b706b,null))[_0xbd74('0x3e')](handleError(_0x5b706b,null));};exports[_0xbd74('0x20')]=function(_0x28a0b6,_0x374dc4){return db[_0xbd74('0x26')][_0xbd74('0x3d')]({'where':{'id':_0x28a0b6[_0xbd74('0x3a')]['id']}})[_0xbd74('0x1f')](handleEntityNotFound(_0x374dc4,null))[_0xbd74('0x1f')](removeEntity(_0x374dc4,null))[_0xbd74('0x3e')](handleError(_0x374dc4,null));};exports[_0xbd74('0x41')]=function(_0x37cf74,_0xd7724b){return db[_0xbd74('0x26')]['describe']()[_0xbd74('0x1f')](respondWithResult(_0xd7724b,null))[_0xbd74('0x3e')](handleError(_0xd7724b,null));};
\ No newline at end of file
+var _0xacc4=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','index','map','VoiceTransferReport','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x12c3d1,_0x3c6ae7){var _0x282840=function(_0x4ae0d2){while(--_0x4ae0d2){_0x12c3d1['push'](_0x12c3d1['shift']());}};_0x282840(++_0x3c6ae7);}(_0xacc4,0x85));var _0x4acc=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xacc4[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0x4acc('0x0'));var rimraf=require(_0x4acc('0x1'));var zipdir=require(_0x4acc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4acc('0x3'));var moment=require(_0x4acc('0x4'));var BPromise=require(_0x4acc('0x5'));var Mustache=require(_0x4acc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4acc('0x7'));var csv=require(_0x4acc('0x8'));var ejs=require(_0x4acc('0x9'));var fs=require('fs');var fs_extra=require(_0x4acc('0xa'));var _=require(_0x4acc('0xb'));var squel=require('squel');var crypto=require(_0x4acc('0xc'));var jsforce=require(_0x4acc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acc('0xe'));var Papa=require(_0x4acc('0xf'));var Redis=require(_0x4acc('0x10'));var authService=require(_0x4acc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4acc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4acc('0x13'))('api');var utils=require(_0x4acc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4acc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6bcb6,_0x40596c){_0x40596c=_0x40596c||0xcc;return function(_0x493be){if(_0x493be){return _0xe6bcb6[_0x4acc('0x16')](_0x40596c);}return _0xe6bcb6['status'](_0x40596c)['end']();};}function respondWithResult(_0x5f2b6e,_0x56e58c){_0x56e58c=_0x56e58c||0xc8;return function(_0x4714d5){if(_0x4714d5){return _0x5f2b6e[_0x4acc('0x17')](_0x56e58c)[_0x4acc('0x18')](_0x4714d5);}};}function respondWithFilteredResult(_0x497738,_0x571106){return function(_0x1b9b47){if(_0x1b9b47){var _0x5cf528=typeof _0x571106[_0x4acc('0x19')]===_0x4acc('0x1a')&&typeof _0x571106[_0x4acc('0x1b')]===_0x4acc('0x1a');var _0x280d77=_0x1b9b47[_0x4acc('0x1c')];var _0x9bcfd0=_0x5cf528?0x0:_0x571106['offset'];var _0x3a5f82=_0x5cf528?_0x1b9b47[_0x4acc('0x1c')]:_0x571106['offset']+_0x571106[_0x4acc('0x1b')];var _0x55ed3f;if(_0x3a5f82>=_0x280d77){_0x3a5f82=_0x280d77;_0x55ed3f=0xc8;}else{_0x55ed3f=0xce;}_0x497738[_0x4acc('0x17')](_0x55ed3f);return _0x497738[_0x4acc('0x1d')]('Content-Range',_0x9bcfd0+'-'+_0x3a5f82+'/'+_0x280d77)['json'](_0x1b9b47);}return null;};}function patchUpdates(_0xee0dd0){return function(_0xec7acb){try{jsonpatch[_0x4acc('0x1e')](_0xec7acb,_0xee0dd0,!![]);}catch(_0xfb80ad){return BPromise[_0x4acc('0x1f')](_0xfb80ad);}return _0xec7acb[_0x4acc('0x20')]();};}function saveUpdates(_0x5652c2,_0x5a13a2){return function(_0xfd631e){if(_0xfd631e){return _0xfd631e['update'](_0x5652c2)[_0x4acc('0x21')](function(_0x410e4e){return _0x410e4e;});}return null;};}function removeEntity(_0x2f79bf,_0x49a858){return function(_0x5aa811){if(_0x5aa811){return _0x5aa811[_0x4acc('0x22')]()[_0x4acc('0x21')](function(){_0x2f79bf[_0x4acc('0x17')](0xcc)[_0x4acc('0x23')]();});}};}function handleEntityNotFound(_0x3aa06d,_0x54f3b2){return function(_0x52c399){if(!_0x52c399){_0x3aa06d[_0x4acc('0x16')](0x194);}return _0x52c399;};}function handleError(_0x59549b,_0x3fa62c){_0x3fa62c=_0x3fa62c||0x1f4;return function(_0x1cd51a){logger[_0x4acc('0x24')](_0x1cd51a[_0x4acc('0x25')]);if(_0x1cd51a[_0x4acc('0x26')]){delete _0x1cd51a[_0x4acc('0x26')];}_0x59549b['status'](_0x3fa62c)['send'](_0x1cd51a);};}exports[_0x4acc('0x27')]=function(_0xb721ab,_0x9b846d){var _0x26d927={},_0x14d6c4={},_0x2479c8={'count':0x0,'rows':[]};var _0x270e5a=_[_0x4acc('0x28')](db[_0x4acc('0x29')]['rawAttributes'],function(_0x4896e8){return{'name':_0x4896e8['fieldName'],'type':_0x4896e8['type'][_0x4acc('0x2a')]};});_0x14d6c4[_0x4acc('0x2b')]=_['map'](_0x270e5a,_0x4acc('0x26'));_0x14d6c4[_0x4acc('0x2c')]=_['keys'](_0xb721ab[_0x4acc('0x2c')]);_0x14d6c4[_0x4acc('0x2d')]=_[_0x4acc('0x2e')](_0x14d6c4['model'],_0x14d6c4[_0x4acc('0x2c')]);_0x26d927['attributes']=_[_0x4acc('0x2e')](_0x14d6c4['model'],qs[_0x4acc('0x2f')](_0xb721ab['query'][_0x4acc('0x2f')]));_0x26d927[_0x4acc('0x30')]=_0x26d927[_0x4acc('0x30')][_0x4acc('0x31')]?_0x26d927[_0x4acc('0x30')]:_0x14d6c4[_0x4acc('0x2b')];if(!_0xb721ab[_0x4acc('0x2c')]['hasOwnProperty'](_0x4acc('0x32'))){_0x26d927[_0x4acc('0x1b')]=qs[_0x4acc('0x1b')](_0xb721ab[_0x4acc('0x2c')][_0x4acc('0x1b')]);_0x26d927[_0x4acc('0x19')]=qs[_0x4acc('0x19')](_0xb721ab[_0x4acc('0x2c')]['offset']);}_0x26d927[_0x4acc('0x33')]=qs[_0x4acc('0x34')](_0xb721ab[_0x4acc('0x2c')][_0x4acc('0x34')]);_0x26d927[_0x4acc('0x35')]=qs[_0x4acc('0x2d')](_[_0x4acc('0x36')](_0xb721ab[_0x4acc('0x2c')],_0x14d6c4[_0x4acc('0x2d')]),_0x270e5a);if(_0xb721ab[_0x4acc('0x2c')]['filter']){_0x26d927[_0x4acc('0x35')]=_[_0x4acc('0x37')](_0x26d927['where'],{'$or':_[_0x4acc('0x28')](_0x270e5a,function(_0x53ed32){if(_0x53ed32[_0x4acc('0x38')]!==_0x4acc('0x39')){var _0x52e4d1={};_0x52e4d1[_0x53ed32[_0x4acc('0x26')]]={'$like':'%'+_0xb721ab[_0x4acc('0x2c')][_0x4acc('0x3a')]+'%'};return _0x52e4d1;}})});}_0x26d927=_[_0x4acc('0x37')]({},_0x26d927,_0xb721ab['options']);var _0x379d88={'where':_0x26d927[_0x4acc('0x35')]};return db[_0x4acc('0x29')][_0x4acc('0x1c')](_0x379d88)[_0x4acc('0x21')](function(_0x248f5e){_0x2479c8[_0x4acc('0x1c')]=_0x248f5e;if(_0xb721ab['query'][_0x4acc('0x3b')]){_0x26d927[_0x4acc('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x4acc('0x3d')](_0x26d927);})[_0x4acc('0x21')](function(_0x36e556){_0x2479c8[_0x4acc('0x3e')]=_0x36e556;return _0x2479c8;})[_0x4acc('0x21')](respondWithFilteredResult(_0x9b846d,_0x26d927))[_0x4acc('0x3f')](handleError(_0x9b846d,null));};exports[_0x4acc('0x40')]=function(_0x1717a2,_0xc3f1a4){var _0x20bdd1={'raw':!![],'where':{'id':_0x1717a2[_0x4acc('0x41')]['id']}},_0x525940={};_0x525940[_0x4acc('0x2b')]=_[_0x4acc('0x42')](db['VoiceTransferReport'][_0x4acc('0x43')]);_0x525940[_0x4acc('0x2c')]=_[_0x4acc('0x42')](_0x1717a2[_0x4acc('0x2c')]);_0x525940['filters']=_['intersection'](_0x525940[_0x4acc('0x2b')],_0x525940[_0x4acc('0x2c')]);_0x20bdd1['attributes']=_[_0x4acc('0x2e')](_0x525940[_0x4acc('0x2b')],qs[_0x4acc('0x2f')](_0x1717a2[_0x4acc('0x2c')][_0x4acc('0x2f')]));_0x20bdd1[_0x4acc('0x30')]=_0x20bdd1[_0x4acc('0x30')][_0x4acc('0x31')]?_0x20bdd1['attributes']:_0x525940[_0x4acc('0x2b')];if(_0x1717a2[_0x4acc('0x2c')][_0x4acc('0x3b')]){_0x20bdd1[_0x4acc('0x3c')]=[{'all':!![]}];}_0x20bdd1=_[_0x4acc('0x37')]({},_0x20bdd1,_0x1717a2[_0x4acc('0x44')]);return db['VoiceTransferReport'][_0x4acc('0x45')](_0x20bdd1)[_0x4acc('0x21')](handleEntityNotFound(_0xc3f1a4,null))['then'](respondWithResult(_0xc3f1a4,null))['catch'](handleError(_0xc3f1a4,null));};exports[_0x4acc('0x46')]=function(_0x541f1d,_0xeb7fb1){return db[_0x4acc('0x29')][_0x4acc('0x46')](_0x541f1d[_0x4acc('0x47')],{})[_0x4acc('0x21')](respondWithResult(_0xeb7fb1,0xc9))[_0x4acc('0x3f')](handleError(_0xeb7fb1,null));};exports[_0x4acc('0x48')]=function(_0x5a57d3,_0x306e86){if(_0x5a57d3['body']['id']){delete _0x5a57d3[_0x4acc('0x47')]['id'];}return db[_0x4acc('0x29')][_0x4acc('0x45')]({'where':{'id':_0x5a57d3[_0x4acc('0x41')]['id']}})[_0x4acc('0x21')](handleEntityNotFound(_0x306e86,null))[_0x4acc('0x21')](saveUpdates(_0x5a57d3[_0x4acc('0x47')],null))[_0x4acc('0x21')](respondWithResult(_0x306e86,null))[_0x4acc('0x3f')](handleError(_0x306e86,null));};exports['destroy']=function(_0x1b66eb,_0x1f8c77){return db[_0x4acc('0x29')][_0x4acc('0x45')]({'where':{'id':_0x1b66eb[_0x4acc('0x41')]['id']}})[_0x4acc('0x21')](handleEntityNotFound(_0x1f8c77,null))[_0x4acc('0x21')](removeEntity(_0x1f8c77,null))['catch'](handleError(_0x1f8c77,null));};exports['describe']=function(_0x47822c,_0x30bc26){return db[_0x4acc('0x29')][_0x4acc('0x49')]()[_0x4acc('0x21')](respondWithResult(_0x30bc26,null))[_0x4acc('0x3f')](handleError(_0x30bc26,null));};
\ No newline at end of file
index d4c120b..0273b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9001=['moment','request-promise','path','rimraf','../../config/environment','exports','define','util','api'];(function(_0x2712fc,_0xb1f71e){var _0x481642=function(_0x11b647){while(--_0x11b647){_0x2712fc['push'](_0x2712fc['shift']());}};_0x481642(++_0xb1f71e);}(_0x9001,0x103));var _0x1900=function(_0x336626,_0x58daec){_0x336626=_0x336626-0x0;var _0x492fa7=_0x9001[_0x336626];return _0x492fa7;};'use strict';var _=require('lodash');var util=require(_0x1900('0x0'));var logger=require('../../config/logger')(_0x1900('0x1'));var moment=require(_0x1900('0x2'));var BPromise=require('bluebird');var rp=require(_0x1900('0x3'));var fs=require('fs');var path=require(_0x1900('0x4'));var rimraf=require(_0x1900('0x5'));var config=require(_0x1900('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x1900('0x7')]=function(_0x2fbf8d,_0x441bfa){return _0x2fbf8d[_0x1900('0x8')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb75f=['path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','bluebird','request-promise'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xb75f,0x19f));var _0xfb75=function(_0xce1284,_0x4ed591){_0xce1284=_0xce1284-0x0;var _0x5d177c=_0xb75f[_0xce1284];return _0x5d177c;};'use strict';var _=require(_0xfb75('0x0'));var util=require(_0xfb75('0x1'));var logger=require('../../config/logger')(_0xfb75('0x2'));var moment=require('moment');var BPromise=require(_0xfb75('0x3'));var rp=require(_0xfb75('0x4'));var fs=require('fs');var path=require(_0xfb75('0x5'));var rimraf=require(_0xfb75('0x6'));var config=require(_0xfb75('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xfb75('0x8')]=function(_0x340960,_0x97faca){return _0x340960[_0xfb75('0x9')](_0xfb75('0xa'),attributes,{'tableName':_0xfb75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb289a7..4b8a41a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f64=['client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4f64,0x1b6));var _0x44f6=function(_0x58b30e,_0x97ce98){_0x58b30e=_0x58b30e-0x0;var _0x1a9af9=_0x4f64[_0x58b30e];return _0x1a9af9;};'use strict';var _=require(_0x44f6('0x0'));var util=require(_0x44f6('0x1'));var moment=require(_0x44f6('0x2'));var BPromise=require(_0x44f6('0x3'));var rs=require(_0x44f6('0x4'));var fs=require('fs');var Redis=require(_0x44f6('0x5'));var db=require(_0x44f6('0x6'))['db'];var utils=require(_0x44f6('0x7'));var logger=require(_0x44f6('0x8'))(_0x44f6('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x44f6('0xa')][_0x44f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198696,_0x294f2f,_0x5f1d47){return new BPromise(function(_0x49269c,_0x3b7ecb){return client[_0x44f6('0xc')](_0x198696,_0x5f1d47)[_0x44f6('0xd')](function(_0x41f6fe){logger['info'](_0x44f6('0xe'),_0x294f2f,'request\x20sent');logger[_0x44f6('0xf')](_0x44f6('0x10'),_0x294f2f,'request\x20sent',JSON[_0x44f6('0x11')](_0x41f6fe));if(_0x41f6fe[_0x44f6('0x12')]){if(_0x41f6fe[_0x44f6('0x12')]['code']===0x1f4){logger[_0x44f6('0x12')](_0x44f6('0xe'),_0x294f2f,_0x41f6fe[_0x44f6('0x12')][_0x44f6('0x13')]);return _0x3b7ecb(_0x41f6fe[_0x44f6('0x12')][_0x44f6('0x13')]);}logger[_0x44f6('0x12')](_0x44f6('0xe'),_0x294f2f,_0x41f6fe[_0x44f6('0x12')][_0x44f6('0x13')]);return _0x49269c(_0x41f6fe['error'][_0x44f6('0x13')]);}else{logger[_0x44f6('0x14')](_0x44f6('0xe'),_0x294f2f,_0x44f6('0x15'));_0x49269c(_0x41f6fe[_0x44f6('0x16')][_0x44f6('0x13')]);}})[_0x44f6('0x17')](function(_0x4ba338){logger['error'](_0x44f6('0xe'),_0x294f2f,_0x4ba338);_0x3b7ecb(_0x4ba338);});});}exports[_0x44f6('0x18')]=function(_0x23a326){var _0x1bff71=this;return new Promise(function(_0x41b9c3,_0x93534e){return db[_0x44f6('0x19')]['create'](_0x23a326['body'],{'raw':_0x23a326[_0x44f6('0x1a')]?_0x23a326[_0x44f6('0x1a')][_0x44f6('0x1b')]===undefined?!![]:![]:!![]})[_0x44f6('0xd')](function(_0x451aec){logger['info']('CreateVoiceTransferReport',_0x23a326);logger[_0x44f6('0xf')](_0x44f6('0x18'),_0x23a326,JSON[_0x44f6('0x11')](_0x451aec));_0x41b9c3(_0x451aec);})[_0x44f6('0x17')](function(_0x3ab22c){logger[_0x44f6('0x12')](_0x44f6('0x18'),_0x3ab22c[_0x44f6('0x13')],_0x23a326);_0x93534e(_0x1bff71['error'](0x1f4,_0x3ab22c[_0x44f6('0x13')]));});});};
\ No newline at end of file
+var _0x72ac=['code','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x72ac,0x1ba));var _0xc72a=function(_0xc8edfc,_0x33668d){_0xc8edfc=_0xc8edfc-0x0;var _0x46be69=_0x72ac[_0xc8edfc];return _0x46be69;};'use strict';var _=require(_0xc72a('0x0'));var util=require(_0xc72a('0x1'));var moment=require(_0xc72a('0x2'));var BPromise=require(_0xc72a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc72a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc72a('0x5'));var logger=require(_0xc72a('0x6'))(_0xc72a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc72a('0x8')][_0xc72a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a1d30,_0x465f96,_0x261f34){return new BPromise(function(_0x297ee0,_0x857059){return client[_0xc72a('0xa')](_0x2a1d30,_0x261f34)['then'](function(_0x84c8db){logger[_0xc72a('0xb')](_0xc72a('0xc'),_0x465f96,'request\x20sent');logger[_0xc72a('0xd')](_0xc72a('0xe'),_0x465f96,'request\x20sent',JSON[_0xc72a('0xf')](_0x84c8db));if(_0x84c8db[_0xc72a('0x10')]){if(_0x84c8db[_0xc72a('0x10')][_0xc72a('0x11')]===0x1f4){logger[_0xc72a('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x465f96,_0x84c8db[_0xc72a('0x10')][_0xc72a('0x12')]);return _0x857059(_0x84c8db[_0xc72a('0x10')][_0xc72a('0x12')]);}logger[_0xc72a('0x10')](_0xc72a('0xc'),_0x465f96,_0x84c8db[_0xc72a('0x10')][_0xc72a('0x12')]);return _0x297ee0(_0x84c8db[_0xc72a('0x10')]['message']);}else{logger[_0xc72a('0xb')](_0xc72a('0xc'),_0x465f96,'request\x20sent');_0x297ee0(_0x84c8db[_0xc72a('0x13')][_0xc72a('0x12')]);}})[_0xc72a('0x14')](function(_0x3dd399){logger[_0xc72a('0x10')](_0xc72a('0xc'),_0x465f96,_0x3dd399);_0x857059(_0x3dd399);});});}exports[_0xc72a('0x15')]=function(_0x484557){var _0x42697e=this;return new Promise(function(_0x5b7e09,_0xe6c159){return db['VoiceTransferReport'][_0xc72a('0x16')](_0x484557[_0xc72a('0x17')],{'raw':_0x484557[_0xc72a('0x18')]?_0x484557[_0xc72a('0x18')][_0xc72a('0x19')]===undefined?!![]:![]:!![]})[_0xc72a('0x1a')](function(_0xbd5656){logger['info']('CreateVoiceTransferReport',_0x484557);logger['debug']('CreateVoiceTransferReport',_0x484557,JSON[_0xc72a('0xf')](_0xbd5656));_0x5b7e09(_0xbd5656);})['catch'](function(_0x32326b){logger[_0xc72a('0x10')]('CreateVoiceTransferReport',_0x32326b[_0xc72a('0x12')],_0x484557);_0xe6c159(_0x42697e[_0xc72a('0x10')](0x1f4,_0x32326b[_0xc72a('0x12')]));});});};
\ No newline at end of file
index b304820..02c84fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d28=['transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','/calls','calls','/transfer'];(function(_0x564b1b,_0x4a2ae3){var _0x5d53d8=function(_0x48ef13){while(--_0x48ef13){_0x564b1b['push'](_0x564b1b['shift']());}};_0x5d53d8(++_0x4a2ae3);}(_0x5d28,0x72));var _0x85d2=function(_0xb35c44,_0x10e249){_0xb35c44=_0xb35c44-0x0;var _0xbf3748=_0x5d28[_0xb35c44];return _0xbf3748;};'use strict';var express=require(_0x85d2('0x0'));var router=express[_0x85d2('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x85d2('0x2'));router[_0x85d2('0x3')](_0x85d2('0x4'),auth[_0x85d2('0x5')](),auth['canUpdate'](),controller[_0x85d2('0x6')]);router['post'](_0x85d2('0x7'),auth[_0x85d2('0x5')](),auth[_0x85d2('0x8')](),controller[_0x85d2('0x9')]);router[_0x85d2('0x3')](_0x85d2('0xa'),auth[_0x85d2('0x5')](),auth[_0x85d2('0x8')](),controller['answer']);router[_0x85d2('0x3')]('/hold',auth[_0x85d2('0x5')](),auth[_0x85d2('0x8')](),controller['hold']);router[_0x85d2('0x3')]('/unhold',auth[_0x85d2('0x5')](),auth[_0x85d2('0x8')](),controller['unhold']);router[_0x85d2('0x3')](_0x85d2('0xb'),auth[_0x85d2('0x5')](),auth[_0x85d2('0x8')](),controller[_0x85d2('0xc')]);router['post'](_0x85d2('0xd'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x85d2('0xe')]);module[_0x85d2('0xf')]=router;
\ No newline at end of file
+var _0x47b9=['exports','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','answer','hold','/unhold','calls','/transfer'];(function(_0x1ffd67,_0x1c18ba){var _0xce170f=function(_0x16cdb2){while(--_0x16cdb2){_0x1ffd67['push'](_0x1ffd67['shift']());}};_0xce170f(++_0x1c18ba);}(_0x47b9,0x78));var _0x947b=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x47b9[_0x29ae80];return _0x5d6d71;};'use strict';var express=require(_0x947b('0x0'));var router=express[_0x947b('0x1')]();var auth=require(_0x947b('0x2'));var controller=require(_0x947b('0x3'));router[_0x947b('0x4')]('/originate',auth[_0x947b('0x5')](),auth['canUpdate'](),controller[_0x947b('0x6')]);router[_0x947b('0x4')](_0x947b('0x7'),auth[_0x947b('0x5')](),auth[_0x947b('0x8')](),controller[_0x947b('0x9')]);router[_0x947b('0x4')](_0x947b('0xa'),auth[_0x947b('0x5')](),auth[_0x947b('0x8')](),controller[_0x947b('0xb')]);router[_0x947b('0x4')]('/hold',auth[_0x947b('0x5')](),auth[_0x947b('0x8')](),controller[_0x947b('0xc')]);router[_0x947b('0x4')](_0x947b('0xd'),auth[_0x947b('0x5')](),auth[_0x947b('0x8')](),controller['unhold']);router[_0x947b('0x4')]('/calls',auth[_0x947b('0x5')](),auth['canUpdate'](),controller[_0x947b('0xe')]);router[_0x947b('0x4')](_0x947b('0xf'),auth[_0x947b('0x5')](),auth[_0x947b('0x8')](),controller['transfer']);module[_0x947b('0x10')]=router;
\ No newline at end of file
index e41ed00..21d33fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ba7=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','code','message','result','findOne','agent','then','VoiceChannels','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','hangup\x20executed!','catch','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird'];(function(_0x3ccac1,_0x5cc7ea){var _0x10b20b=function(_0x4ed4f5){while(--_0x4ed4f5){_0x3ccac1['push'](_0x3ccac1['shift']());}};_0x10b20b(++_0x5cc7ea);}(_0x0ba7,0x16d));var _0x70ba=function(_0x504ec1,_0x4340c8){_0x504ec1=_0x504ec1-0x0;var _0x3ae563=_0x0ba7[_0x504ec1];return _0x3ae563;};'use strict';var path=require(_0x70ba('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x70ba('0x1'))['db'];var config=require(_0x70ba('0x2'));var util=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x70ba('0x5')][_0x70ba('0x6')]({'port':0x232a});var logger=require(_0x70ba('0x7'))(_0x70ba('0x8'));var Redis=require(_0x70ba('0x9'));config[_0x70ba('0xa')]=_[_0x70ba('0xb')](config[_0x70ba('0xa')],{'host':_0x70ba('0xc'),'port':0x18eb});var io=require(_0x70ba('0xd'))(new Redis(config[_0x70ba('0xa')]));var Schema=require(_0x70ba('0xe'));var originateValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'callNumber':{'type':_0x70ba('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x70ba('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x70ba('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x70ba('0x11'),'required':[!![],_0x70ba('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x70ba('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});function emit(_0x164521,_0x18334a,_0x3e27e8){logger[_0x70ba('0x13')](_0x164521,_0x18334a,JSON[_0x70ba('0x14')](_0x3e27e8));io['to'](_0x164521)[_0x70ba('0x15')](_0x18334a,_0x3e27e8);}function handleError(_0xb6d69a){return function(_0x5ed907){console['log']('handleError:',_0x5ed907,_0x5ed907 instanceof RangeError);logger[_0x70ba('0x16')](_0x5ed907[_0x70ba('0x17')]);if(_0x5ed907 instanceof RangeError){if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x194)[_0x70ba('0x1a')](_0x5ed907);}else{if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x1f4)[_0x70ba('0x1a')](_0x5ed907);}};}function checkError(){return function(_0x26c039){if(!_0x26c039){throw new RangeError(_0x70ba('0x1b'));}return _0x26c039;};}function respondWithRpcPromise(_0x2a1328,_0x4570b0){return new BPromise(function(_0x273ce4,_0x5ebe9d){var _0x3b31ef=amiClient;return _0x3b31ef[_0x70ba('0x1c')](_0x2a1328,_0x4570b0)['then'](function(_0x123b0c){if(_0x123b0c['error']){if(_0x123b0c['error'][_0x70ba('0x1d')]===0x1f4){return _0x5ebe9d(_0x123b0c['error'][_0x70ba('0x1e')]);}return _0x273ce4(_0x123b0c[_0x70ba('0x16')]['message']);}else{_0x273ce4(_0x123b0c[_0x70ba('0x1f')]);}})['catch'](function(_0x5ad828){_0x5ebe9d(_0x5ad828);});});}function getAgent(_0x39482c){return db['User'][_0x70ba('0x20')]({'where':{'id':_0x39482c,'role':_0x70ba('0x21')}})[_0x70ba('0x22')](checkError());}function getAgentCheckSession(_0x33e218,_0x2c6d18){return new BPromise(function(_0x265423,_0x5a8558){var _0x2d840e=respondWithRpcPromise(_0x70ba('0x23'));var _0x797467=getAgent(_0x33e218);Promise['all']([_0x2d840e,_0x797467])[_0x70ba('0x22')](function(_0x51b5cb){var _0x5955dc=_0x51b5cb[0x0];var _0x505f98=_0x51b5cb[0x1];var _0x77e564=_[_0x70ba('0x24')](_0x5955dc['rows'],function(_0x51b3e3){return _0x51b3e3[_0x70ba('0x25')]==_0x505f98['id']&&_0x51b3e3['sessionId']==_0x2c6d18;});if(_0x77e564[_0x70ba('0x26')]==0x1){_0x265423(_0x505f98);}else{_0x5a8558(new RangeError(_0x70ba('0x27')+_0x2c6d18+_0x70ba('0x28')));}});});}exports[_0x70ba('0x29')]=function(_0x1db0c4,_0x269943){logger[_0x70ba('0x13')](_0x70ba('0x2a'),_0x1db0c4[_0x70ba('0x2b')]);var _0x6055d3=originateValidation[_0x70ba('0xe')](_0x1db0c4['body']);if(_0x6055d3['length']>0x0){return _0x269943[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x6055d3);}var _0x943e49=_0x1db0c4['body']['userId'];var _0x507f00=_0x1db0c4[_0x70ba('0x2b')][_0x70ba('0x2d')];var _0x2200d3=_0x1db0c4['body'][_0x70ba('0x2e')];var _0x5bc56f=_0x1db0c4['body'][_0x70ba('0x2f')];return getAgent(_0x943e49)['then'](function(_0x15774e){logger[_0x70ba('0x13')]('entityFound:',_0x15774e[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x15774e['name']),_0x70ba('0x32'),{'callNumber':_0x507f00,'callerId':_0x2200d3,'callbackUrl':_0x5bc56f});return _0x269943[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x33')});})['catch'](handleError(_0x269943));};exports[_0x70ba('0x34')]=function(_0x569ae3,_0x17707a){logger[_0x70ba('0x13')](_0x70ba('0x35'),_0x569ae3[_0x70ba('0x2b')]);var _0x16ce39=hangupValidation[_0x70ba('0xe')](_0x569ae3[_0x70ba('0x2b')]);if(_0x16ce39['length']>0x0){return _0x17707a[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x16ce39);}var _0x31e713=_0x569ae3[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x473489=_0x569ae3['body'][_0x70ba('0x37')];return getAgent(_0x31e713)[_0x70ba('0x22')](function(_0x1861ed){logger['info']('entityFound:',_0x1861ed['name']);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x1861ed[_0x70ba('0x18')]),'webbar:hangup',{'sessionId':_0x473489});return _0x17707a[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x38')});})[_0x70ba('0x39')](handleError(_0x17707a));};exports[_0x70ba('0x3a')]=function(_0x54e732,_0x5ee74c){logger[_0x70ba('0x13')](_0x70ba('0x3b'),_0x54e732[_0x70ba('0x2b')]);var _0x5a1edb=answerValidation['validate'](_0x54e732[_0x70ba('0x2b')]);if(_0x5a1edb['length']>0x0){return _0x5ee74c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x5a1edb);}var _0x705ca4=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x51f4df=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x705ca4)[_0x70ba('0x22')](function(_0x3dc2f7){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x3dc2f7[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x3dc2f7[_0x70ba('0x18')]),_0x70ba('0x3d'),{'sessionId':_0x51f4df});return _0x5ee74c[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x3e')});})[_0x70ba('0x39')](handleError(_0x5ee74c));};exports['hold']=function(_0xd7638f,_0x3121f6){logger['info'](_0x70ba('0x3f'),_0xd7638f[_0x70ba('0x2b')]);var _0x3de825=holdValidation[_0x70ba('0xe')](_0xd7638f[_0x70ba('0x2b')]);if(_0x3de825[_0x70ba('0x26')]>0x0){return _0x3121f6[_0x70ba('0x19')](0x190)['json'](_0x3de825);}var _0x2e2613=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x3d1f89=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x2e2613)[_0x70ba('0x22')](function(_0x400c37){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x400c37[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x400c37[_0x70ba('0x18')]),_0x70ba('0x40'),{'sessionId':_0x3d1f89});return _0x3121f6[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x3121f6));};exports[_0x70ba('0x41')]=function(_0x2dc3c5,_0x19c99c){logger['info']('unhold\x20fired:',_0x2dc3c5['body']);var _0x471d19=unholdValidation[_0x70ba('0xe')](_0x2dc3c5['body']);if(_0x471d19['length']>0x0){return _0x19c99c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x471d19);}var _0x3e3779=_0x2dc3c5[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4e2397=_0x2dc3c5[_0x70ba('0x2b')]['sessionId'];return getAgent(_0x3e3779)['then'](function(_0x361699){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x361699[_0x70ba('0x18')]);emit(util['format'](_0x70ba('0x31'),_0x361699[_0x70ba('0x18')]),'webbar:unhold',{'sessionId':_0x4e2397});return _0x19c99c['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x19c99c));};exports[_0x70ba('0x42')]=function(_0x1cb9c7,_0x4cc5b1){logger[_0x70ba('0x13')](_0x70ba('0x43'),_0x4cc5b1[_0x70ba('0x2b')]);var _0x5214eb=callsValidation[_0x70ba('0xe')](_0x1cb9c7[_0x70ba('0x2b')]);if(_0x5214eb['length']>0x0){return _0x4cc5b1['status'](0x190)[_0x70ba('0x2c')](_0x5214eb);}var _0x15b3ab=_0x1cb9c7[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x10e824=respondWithRpcPromise(_0x70ba('0x23'));var _0x44cb31=getAgent(_0x15b3ab);return Promise['all']([_0x10e824,_0x44cb31])[_0x70ba('0x22')](function(_0x27d101){var _0x4de412=_0x27d101[0x0];var _0x508da6=_0x27d101[0x1];var _0x137b7d=_[_0x70ba('0x24')](_0x4de412['rows'],function(_0x4ea26b){return _0x4ea26b[_0x70ba('0x25')]==_0x508da6['id'];});return _0x4cc5b1['status'](0xc8)['json']({'count':_0x137b7d[_0x70ba('0x26')],'rows':_0x137b7d});})[_0x70ba('0x39')](handleError(_0x4cc5b1));};exports[_0x70ba('0x44')]=function(_0xb03649,_0x10bb90){logger[_0x70ba('0x13')](_0x70ba('0x45'),_0xb03649['body']);var _0x46a8a6=conferenceValidation[_0x70ba('0xe')](_0xb03649[_0x70ba('0x2b')]);if(_0x46a8a6[_0x70ba('0x26')]>0x0){return _0x10bb90[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x46a8a6);}var _0x5d58a1=_0xb03649[_0x70ba('0x2b')]['userId'];return getAgent(_0x5d58a1)[_0x70ba('0x22')](function(_0x4b385b){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x4b385b[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x4b385b[_0x70ba('0x18')]),'webbar:conference');return _0x10bb90[_0x70ba('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x70ba('0x39')](handleError(_0x10bb90));};exports[_0x70ba('0x46')]=function(_0x5b1824,_0x208333){logger['info'](_0x70ba('0x47'),_0x5b1824[_0x70ba('0x2b')]);var _0x378893=transferValidation['validate'](_0x5b1824[_0x70ba('0x2b')]);if(_0x378893['length']>0x0){return _0x208333[_0x70ba('0x19')](0x190)['json'](_0x378893);}var _0x2ee3d0=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4ebc09=_0x5b1824['body'][_0x70ba('0x37')];var _0x530324=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x48')];return getAgent(_0x2ee3d0)[_0x70ba('0x22')](function(_0x32a246){logger['info'](_0x70ba('0x3c'),_0x32a246[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x32a246[_0x70ba('0x18')]),_0x70ba('0x49'),{'sessionId':_0x4ebc09,'transferNumber':_0x530324});return _0x208333[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x70ba('0x39')](handleError(_0x208333));};
\ No newline at end of file
+var _0xa37e=['unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','../../mysqldb','../../config/environment','util','bluebird','client','../../config/logger','webbarapi','ioredis','redis','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','request','then','error','code','message','catch','User','findOne','agent','VoiceChannels','all','rows','sessionId','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!'];(function(_0xb4ce16,_0x2bd30c){var _0x14055c=function(_0x16909e){while(--_0x16909e){_0xb4ce16['push'](_0xb4ce16['shift']());}};_0x14055c(++_0x2bd30c);}(_0xa37e,0x97));var _0xea37=function(_0x156534,_0x433656){_0x156534=_0x156534-0x0;var _0x369ebc=_0xa37e[_0x156534];return _0x369ebc;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xea37('0x0'))['db'];var config=require(_0xea37('0x1'));var util=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xea37('0x4')]['http']({'port':0x232a});var logger=require(_0xea37('0x5'))(_0xea37('0x6'));var Redis=require(_0xea37('0x7'));config['redis']=_['defaults'](config[_0xea37('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea37('0x8')]));var Schema=require(_0xea37('0x9'));var originateValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'callNumber':{'type':'string','required':[!![],_0xea37('0xc')]},'callerId':{'type':_0xea37('0xd')},'callbackUrl':{'type':_0xea37('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xea37('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]},'sessionId':{'type':_0xea37('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xea37('0xd'),'required':[!![],_0xea37('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xea37('0xb')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xea37('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],_0xea37('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0xea37('0xa'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x18e4b8,_0x58f979,_0x49604a){logger[_0xea37('0xf')](_0x18e4b8,_0x58f979,JSON['stringify'](_0x49604a));io['to'](_0x18e4b8)[_0xea37('0x10')](_0x58f979,_0x49604a);}function handleError(_0x421f7d){return function(_0x4ef3c9){console[_0xea37('0x11')](_0xea37('0x12'),_0x4ef3c9,_0x4ef3c9 instanceof RangeError);logger['error'](_0x4ef3c9[_0xea37('0x13')]);if(_0x4ef3c9 instanceof RangeError){if(_0x4ef3c9[_0xea37('0x14')]){delete _0x4ef3c9[_0xea37('0x14')];}_0x421f7d[_0xea37('0x15')](0x194)[_0xea37('0x16')](_0x4ef3c9);}else{if(_0x4ef3c9[_0xea37('0x14')]){delete _0x4ef3c9[_0xea37('0x14')];}_0x421f7d[_0xea37('0x15')](0x1f4)[_0xea37('0x16')](_0x4ef3c9);}};}function checkError(){return function(_0x3e00cb){if(!_0x3e00cb){throw new RangeError('NotFound');}return _0x3e00cb;};}function respondWithRpcPromise(_0x23bb57,_0x2a81f5){return new BPromise(function(_0x356f04,_0x536eff){var _0x4aa2ae=amiClient;return _0x4aa2ae[_0xea37('0x17')](_0x23bb57,_0x2a81f5)[_0xea37('0x18')](function(_0x98c6de){if(_0x98c6de[_0xea37('0x19')]){if(_0x98c6de['error'][_0xea37('0x1a')]===0x1f4){return _0x536eff(_0x98c6de['error']['message']);}return _0x356f04(_0x98c6de['error'][_0xea37('0x1b')]);}else{_0x356f04(_0x98c6de['result']);}})[_0xea37('0x1c')](function(_0x11dfbb){_0x536eff(_0x11dfbb);});});}function getAgent(_0x15a0f5){return db[_0xea37('0x1d')][_0xea37('0x1e')]({'where':{'id':_0x15a0f5,'role':_0xea37('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x57a7cc,_0x55880c){return new BPromise(function(_0x477e25,_0x3e272e){var _0x4ffcf1=respondWithRpcPromise(_0xea37('0x20'));var _0x10d556=getAgent(_0x57a7cc);Promise[_0xea37('0x21')]([_0x4ffcf1,_0x10d556])['then'](function(_0xe5b07a){var _0x366acb=_0xe5b07a[0x0];var _0xc07758=_0xe5b07a[0x1];var _0x2e745c=_['filter'](_0x366acb[_0xea37('0x22')],function(_0x55388b){return _0x55388b['UserId']==_0xc07758['id']&&_0x55388b[_0xea37('0x23')]==_0x55880c;});if(_0x2e745c['length']==0x1){_0x477e25(_0xc07758);}else{_0x3e272e(new RangeError('sessionId\x20'+_0x55880c+'\x20not\x20found!'));}});});}exports[_0xea37('0x24')]=function(_0x1e4bc0,_0x3ec6af){logger[_0xea37('0xf')](_0xea37('0x25'),_0x1e4bc0[_0xea37('0x26')]);var _0x5e2526=originateValidation[_0xea37('0x9')](_0x1e4bc0[_0xea37('0x26')]);if(_0x5e2526[_0xea37('0x27')]>0x0){return _0x3ec6af[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x5e2526);}var _0x33717c=_0x1e4bc0['body'][_0xea37('0x29')];var _0x4c75d7=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2a')];var _0x1cca3e=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2b')];var _0x321200=_0x1e4bc0[_0xea37('0x26')][_0xea37('0x2c')];return getAgent(_0x33717c)['then'](function(_0x405c44){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x405c44[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x405c44['name']),'webbar:originate',{'callNumber':_0x4c75d7,'callerId':_0x1cca3e,'callbackUrl':_0x321200});return _0x3ec6af['status'](0xc8)[_0xea37('0x28')]({'error':![],'message':'originate\x20executed!'});})[_0xea37('0x1c')](handleError(_0x3ec6af));};exports['hangup']=function(_0x5e91ef,_0x5652a4){logger['info'](_0xea37('0x30'),_0x5e91ef[_0xea37('0x26')]);var _0x46114b=hangupValidation[_0xea37('0x9')](_0x5e91ef[_0xea37('0x26')]);if(_0x46114b[_0xea37('0x27')]>0x0){return _0x5652a4[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x46114b);}var _0x267456=_0x5e91ef['body'][_0xea37('0x29')];var _0x565c66=_0x5e91ef[_0xea37('0x26')][_0xea37('0x23')];return getAgent(_0x267456)[_0xea37('0x18')](function(_0x537f75){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x537f75[_0xea37('0x14')]);emit(util[_0xea37('0x2e')]('user:%s',_0x537f75[_0xea37('0x14')]),'webbar:hangup',{'sessionId':_0x565c66});return _0x5652a4[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':_0xea37('0x31')});})[_0xea37('0x1c')](handleError(_0x5652a4));};exports[_0xea37('0x32')]=function(_0x435300,_0x57c88d){logger[_0xea37('0xf')](_0xea37('0x33'),_0x435300['body']);var _0x15de2c=answerValidation[_0xea37('0x9')](_0x435300[_0xea37('0x26')]);if(_0x15de2c[_0xea37('0x27')]>0x0){return _0x57c88d[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x15de2c);}var _0x2281d9=_0x435300[_0xea37('0x26')][_0xea37('0x29')];var _0x71760a=_0x435300[_0xea37('0x26')][_0xea37('0x23')];return getAgent(_0x2281d9)[_0xea37('0x18')](function(_0x36d053){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x36d053[_0xea37('0x14')]);emit(util['format'](_0xea37('0x2f'),_0x36d053[_0xea37('0x14')]),_0xea37('0x34'),{'sessionId':_0x71760a});return _0x57c88d[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':'answer\x20executed!'});})[_0xea37('0x1c')](handleError(_0x57c88d));};exports[_0xea37('0x35')]=function(_0x9a5dd,_0x10fcd5){logger[_0xea37('0xf')](_0xea37('0x36'),_0x9a5dd['body']);var _0x422d24=holdValidation[_0xea37('0x9')](_0x9a5dd[_0xea37('0x26')]);if(_0x422d24[_0xea37('0x27')]>0x0){return _0x10fcd5[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x422d24);}var _0x2cd612=_0x9a5dd[_0xea37('0x26')]['userId'];var _0x34f2f9=_0x9a5dd[_0xea37('0x26')]['sessionId'];return getAgent(_0x2cd612)[_0xea37('0x18')](function(_0x2ff803){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x2ff803[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x2ff803[_0xea37('0x14')]),'webbar:hold',{'sessionId':_0x34f2f9});return _0x10fcd5[_0xea37('0x15')](0xc8)['json']({'error':![],'message':_0xea37('0x37')});})['catch'](handleError(_0x10fcd5));};exports[_0xea37('0x38')]=function(_0x14c119,_0x43e269){logger[_0xea37('0xf')](_0xea37('0x39'),_0x14c119[_0xea37('0x26')]);var _0x3628cd=unholdValidation[_0xea37('0x9')](_0x14c119['body']);if(_0x3628cd['length']>0x0){return _0x43e269[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x3628cd);}var _0x19223c=_0x14c119['body'][_0xea37('0x29')];var _0x1c1cf9=_0x14c119['body'][_0xea37('0x23')];return getAgent(_0x19223c)[_0xea37('0x18')](function(_0x32d36d){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x32d36d[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x32d36d[_0xea37('0x14')]),_0xea37('0x3a'),{'sessionId':_0x1c1cf9});return _0x43e269[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'error':![],'message':_0xea37('0x3b')});})[_0xea37('0x1c')](handleError(_0x43e269));};exports[_0xea37('0x3c')]=function(_0x57811b,_0x6727d5){logger[_0xea37('0xf')](_0xea37('0x3d'),_0x6727d5[_0xea37('0x26')]);var _0x40d747=callsValidation[_0xea37('0x9')](_0x57811b['body']);if(_0x40d747[_0xea37('0x27')]>0x0){return _0x6727d5[_0xea37('0x15')](0x190)[_0xea37('0x28')](_0x40d747);}var _0x150a87=_0x57811b[_0xea37('0x26')]['userId'];var _0x2d9e5e=respondWithRpcPromise(_0xea37('0x20'));var _0x57430c=getAgent(_0x150a87);return Promise['all']([_0x2d9e5e,_0x57430c])['then'](function(_0x41d730){var _0x39c8c6=_0x41d730[0x0];var _0x356e6c=_0x41d730[0x1];var _0x1d882d=_[_0xea37('0x3e')](_0x39c8c6['rows'],function(_0x2dc886){return _0x2dc886[_0xea37('0x3f')]==_0x356e6c['id'];});return _0x6727d5[_0xea37('0x15')](0xc8)[_0xea37('0x28')]({'count':_0x1d882d[_0xea37('0x27')],'rows':_0x1d882d});})[_0xea37('0x1c')](handleError(_0x6727d5));};exports[_0xea37('0x40')]=function(_0x440267,_0xb60e2f){logger[_0xea37('0xf')](_0xea37('0x41'),_0x440267[_0xea37('0x26')]);var _0x21a35e=conferenceValidation[_0xea37('0x9')](_0x440267[_0xea37('0x26')]);if(_0x21a35e[_0xea37('0x27')]>0x0){return _0xb60e2f[_0xea37('0x15')](0x190)['json'](_0x21a35e);}var _0x37c2c4=_0x440267['body'][_0xea37('0x29')];return getAgent(_0x37c2c4)[_0xea37('0x18')](function(_0x409fba){logger[_0xea37('0xf')](_0xea37('0x2d'),_0x409fba[_0xea37('0x14')]);emit(util[_0xea37('0x2e')]('user:%s',_0x409fba['name']),'webbar:conference');return _0xb60e2f[_0xea37('0x15')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0xea37('0x1c')](handleError(_0xb60e2f));};exports[_0xea37('0x42')]=function(_0x1a037f,_0x50229d){logger[_0xea37('0xf')](_0xea37('0x43'),_0x1a037f[_0xea37('0x26')]);var _0x4ffecd=transferValidation['validate'](_0x1a037f[_0xea37('0x26')]);if(_0x4ffecd[_0xea37('0x27')]>0x0){return _0x50229d[_0xea37('0x15')](0x190)['json'](_0x4ffecd);}var _0x21b3da=_0x1a037f[_0xea37('0x26')][_0xea37('0x29')];var _0xde6af6=_0x1a037f[_0xea37('0x26')]['sessionId'];var _0x29c0ed=_0x1a037f[_0xea37('0x26')][_0xea37('0x44')];return getAgent(_0x21b3da)[_0xea37('0x18')](function(_0x54eeff){logger[_0xea37('0xf')]('entityFound:',_0x54eeff[_0xea37('0x14')]);emit(util[_0xea37('0x2e')](_0xea37('0x2f'),_0x54eeff[_0xea37('0x14')]),'webbar:transfer',{'sessionId':_0xde6af6,'transferNumber':_0x29c0ed});return _0x50229d[_0xea37('0x15')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0xea37('0x1c')](handleError(_0x50229d));};
\ No newline at end of file
index 04bd6ad..319be70 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(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_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 _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0xd6df5e,_0x4a4e46){var _0x155b12=function(_0x368fb6){while(--_0x368fb6){_0xd6df5e['push'](_0xd6df5e['shift']());}};_0x155b12(++_0x4a4e46);}(_0x430c,0x1a1));var _0xc430=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x430c[_0x174a72];return _0x32cecd;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router;
\ No newline at end of file
index c54af2b..1711e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c8d=['setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2a52eb,_0x423bd9){var _0x498ee1=function(_0x4bdcbd){while(--_0x4bdcbd){_0x2a52eb['push'](_0x2a52eb['shift']());}};_0x498ee1(++_0x423bd9);}(_0x8c8d,0x65));var _0xd8c8=function(_0x452d3c,_0x325d0f){_0x452d3c=_0x452d3c-0x0;var _0x463923=_0x8c8d[_0x452d3c];return _0x463923;};'use strict';var Sequelize=require(_0xd8c8('0x0'));var rs=require('randomstring');module[_0xd8c8('0x1')]={'name':{'type':Sequelize[_0xd8c8('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd8c8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd8c8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd8c8('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd8c8('0x2')]},'type':{'type':Sequelize[_0xd8c8('0x3')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd8c8('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd8c8('0x4')],'defaultValue':function(){return _0xd8c8('0x5');}},'notificationSound':{'type':Sequelize[_0xd8c8('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd8c8('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd8c8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd8c8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd8c8('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd8c8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8c8('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd8c8('0x6')],'defaultValue':![],'comment':_0xd8c8('0x8'),'set':function(_0x670bc5){if(!_0x670bc5){this[_0xd8c8('0x9')](_0xd8c8('0xa'),null);}this[_0xd8c8('0x9')]('mandatoryDisposition',_0x670bc5);}},'description':{'type':Sequelize[_0xd8c8('0x2')]}};
\ No newline at end of file
+var _0x08b8=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x08b8,0x138));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x808b('0x0'));var rs=require(_0x808b('0x1'));module[_0x808b('0x2')]={'name':{'type':Sequelize[_0x808b('0x3')],'unique':_0x808b('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x808b('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x808b('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x808b('0x5')]();}},'phone':{'type':Sequelize[_0x808b('0x3')]},'type':{'type':Sequelize[_0x808b('0x6')]('twilio')},'accountSid':{'type':Sequelize[_0x808b('0x3')]},'authToken':{'type':Sequelize[_0x808b('0x3')]},'notificationTemplate':{'type':Sequelize[_0x808b('0x7')],'defaultValue':function(){return _0x808b('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x808b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x808b('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x808b('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x808b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x808b('0x9')],'comment':_0x808b('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x808b('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3de9e2){if(!_0x3de9e2){this[_0x808b('0xc')]('mandatoryDispositionPauseId',null);}this[_0x808b('0xc')](_0x808b('0xd'),_0x3de9e2);}},'description':{'type':Sequelize[_0x808b('0x3')]}};
\ No newline at end of file
index bc0d784..4c71eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb729=['http','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','length','options','removeDispositions','ids','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','asc','account','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','isNil','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','List','out','WhatsappMessage','dataValues','Messages','push','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client'];(function(_0x42a9cc,_0x353d37){var _0x58192d=function(_0x5f0059){while(--_0x5f0059){_0x42a9cc['push'](_0x42a9cc['shift']());}};_0x58192d(++_0x353d37);}(_0xb729,0x150));var _0x9b72=function(_0x4f7bad,_0x1f3e15){_0x4f7bad=_0x4f7bad-0x0;var _0x469926=_0xb729[_0x4f7bad];return _0x469926;};'use strict';var emlformat=require(_0x9b72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b72('0x1'));var moment=require(_0x9b72('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9b72('0x3'));var util=require(_0x9b72('0x4'));var path=require(_0x9b72('0x5'));var sox=require('sox');var csv=require(_0x9b72('0x6'));var ejs=require(_0x9b72('0x7'));var fs=require('fs');var fs_extra=require(_0x9b72('0x8'));var _=require(_0x9b72('0x9'));var squel=require('squel');var crypto=require(_0x9b72('0xa'));var jsforce=require(_0x9b72('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b72('0xc'));var Redis=require('ioredis');var authService=require(_0x9b72('0xd'));var qs=require(_0x9b72('0xe'));var as=require(_0x9b72('0xf'));var hardwareService=require(_0x9b72('0x10'));var logger=require('../../config/logger')(_0x9b72('0x11'));var utils=require(_0x9b72('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b72('0x13'))['db'];config[_0x9b72('0x14')]=_[_0x9b72('0x15')](config[_0x9b72('0x14')],{'host':_0x9b72('0x16'),'port':0x18eb});var socket=require(_0x9b72('0x17'))(new Redis(config['redis']));require(_0x9b72('0x18'))[_0x9b72('0x19')](socket);var jayson=require(_0x9b72('0x1a'));var client=jayson[_0x9b72('0x1b')][_0x9b72('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x24f01b,_0x5e94ec,_0x39df5a,_0x230927){return new BPromise(function(_0xfbaae4,_0x2350f0){var _0x48aaef=_0x230927||client;return _0x48aaef['request'](_0x24f01b,_0x39df5a)['then'](function(_0x2bfb9c){logger['info'](_0x9b72('0x1d'),_0x5e94ec,_0x9b72('0x1e'));logger[_0x9b72('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5e94ec,_0x9b72('0x1e'),JSON[_0x9b72('0x20')](_0x2bfb9c));if(_0x2bfb9c['error']){if(_0x2bfb9c[_0x9b72('0x21')][_0x9b72('0x22')]===0x1f4){logger[_0x9b72('0x21')](_0x9b72('0x1d'),_0x5e94ec,_0x2bfb9c['error'][_0x9b72('0x23')]);return _0x2350f0(_0x2bfb9c[_0x9b72('0x21')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5e94ec,_0x2bfb9c['error'][_0x9b72('0x23')]);return _0xfbaae4(_0x2bfb9c[_0x9b72('0x21')][_0x9b72('0x23')]);}else{logger[_0x9b72('0x24')](_0x9b72('0x1d'),_0x5e94ec,_0x9b72('0x1e'));_0xfbaae4(_0x2bfb9c[_0x9b72('0x25')][_0x9b72('0x23')]);}})[_0x9b72('0x26')](function(_0x53ab74){logger['error'](_0x9b72('0x1d'),_0x5e94ec,_0x53ab74);_0x2350f0(_0x53ab74);});});}function respondWithStatusCode(_0x8f0e02,_0x5b317a){_0x5b317a=_0x5b317a||0xcc;return function(_0x37e16c){if(_0x37e16c){return _0x8f0e02['sendStatus'](_0x5b317a);}return _0x8f0e02[_0x9b72('0x27')](_0x5b317a)[_0x9b72('0x28')]();};}function respondWithResult(_0x2f767c,_0x304052){_0x304052=_0x304052||0xc8;return function(_0x181033){if(_0x181033){return _0x2f767c[_0x9b72('0x27')](_0x304052)['json'](_0x181033);}};}function respondWithFilteredResult(_0xa73a3a,_0x200db7){return function(_0x3aa8eb){if(_0x3aa8eb){var _0x516b19=typeof _0x200db7['offset']==='undefined'&&typeof _0x200db7[_0x9b72('0x29')]===_0x9b72('0x2a');var _0x5c3967=_0x3aa8eb[_0x9b72('0x2b')];var _0x2c43cb=_0x516b19?0x0:_0x200db7[_0x9b72('0x2c')];var _0x197704=_0x516b19?_0x3aa8eb[_0x9b72('0x2b')]:_0x200db7[_0x9b72('0x2c')]+_0x200db7['limit'];var _0x495035;if(_0x197704>=_0x5c3967){_0x197704=_0x5c3967;_0x495035=0xc8;}else{_0x495035=0xce;}_0xa73a3a[_0x9b72('0x27')](_0x495035);return _0xa73a3a[_0x9b72('0x2d')](_0x9b72('0x2e'),_0x2c43cb+'-'+_0x197704+'/'+_0x5c3967)[_0x9b72('0x2f')](_0x3aa8eb);}return null;};}function patchUpdates(_0x4ce078){return function(_0x474764){try{jsonpatch[_0x9b72('0x30')](_0x474764,_0x4ce078,!![]);}catch(_0x3c4731){return BPromise[_0x9b72('0x31')](_0x3c4731);}return _0x474764['save']();};}function saveUpdates(_0x323886,_0x572baf){return function(_0x393695){if(_0x393695){return _0x393695[_0x9b72('0x32')](_0x323886)[_0x9b72('0x33')](function(_0x5a1663){return _0x5a1663;});}return null;};}function removeEntity(_0x341fec,_0x316eba){return function(_0x1b5615){if(_0x1b5615){return _0x1b5615[_0x9b72('0x34')]()[_0x9b72('0x33')](function(){var _0x2f45c4=_0x1b5615[_0x9b72('0x35')]({'plain':!![]});var _0xb574db=_0x9b72('0x36');return db[_0x9b72('0x37')][_0x9b72('0x34')]({'where':{'type':_0xb574db,'resourceId':_0x2f45c4['id']}})[_0x9b72('0x33')](function(){return _0x1b5615;});})[_0x9b72('0x33')](function(){_0x341fec[_0x9b72('0x27')](0xcc)[_0x9b72('0x28')]();});}};}function handleEntityNotFound(_0x4f9000,_0x293a9){return function(_0x12d1bc){if(!_0x12d1bc){_0x4f9000[_0x9b72('0x38')](0x194);}return _0x12d1bc;};}function handleError(_0xb84788,_0x4fff93){_0x4fff93=_0x4fff93||0x1f4;return function(_0x3e3bb4){logger[_0x9b72('0x21')](_0x3e3bb4[_0x9b72('0x39')]);if(_0x3e3bb4[_0x9b72('0x3a')]){delete _0x3e3bb4[_0x9b72('0x3a')];}_0xb84788[_0x9b72('0x27')](_0x4fff93)['send'](_0x3e3bb4);};}exports[_0x9b72('0x3b')]=function(_0x434bf5,_0x531873){var _0x503d95={'include':[{'model':db[_0x9b72('0x3c')],'as':_0x9b72('0x3d')}]},_0x43e320={},_0x4ec654={'count':0x0,'rows':[]};var _0x305e23=_[_0x9b72('0x3e')](db[_0x9b72('0x3f')]['rawAttributes'],function(_0x5e163e){return{'name':_0x5e163e['fieldName'],'type':_0x5e163e[_0x9b72('0x40')]['key']};});_0x43e320[_0x9b72('0x41')]=_[_0x9b72('0x3e')](_0x305e23,_0x9b72('0x3a'));_0x43e320[_0x9b72('0x42')]=_[_0x9b72('0x43')](_0x434bf5[_0x9b72('0x42')]);_0x43e320[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x43e320[_0x9b72('0x41')],_0x43e320[_0x9b72('0x42')]);_0x503d95['attributes']=_['intersection'](_0x43e320[_0x9b72('0x41')],qs[_0x9b72('0x46')](_0x434bf5[_0x9b72('0x42')]['fields']));_0x503d95[_0x9b72('0x47')]=_0x503d95[_0x9b72('0x47')]['length']?_0x503d95[_0x9b72('0x47')]:_0x43e320['model'];if(!_0x434bf5[_0x9b72('0x42')][_0x9b72('0x48')](_0x9b72('0x49'))){_0x503d95[_0x9b72('0x29')]=qs['limit'](_0x434bf5[_0x9b72('0x42')][_0x9b72('0x29')]);_0x503d95[_0x9b72('0x2c')]=qs[_0x9b72('0x2c')](_0x434bf5[_0x9b72('0x42')][_0x9b72('0x2c')]);}_0x503d95[_0x9b72('0x4a')]=qs['sort'](_0x434bf5['query'][_0x9b72('0x4b')]);_0x503d95[_0x9b72('0x4c')]=qs[_0x9b72('0x44')](_[_0x9b72('0x4d')](_0x434bf5[_0x9b72('0x42')],_0x43e320[_0x9b72('0x44')]),_0x305e23);if(_0x434bf5[_0x9b72('0x42')][_0x9b72('0x4e')]){_0x503d95[_0x9b72('0x4c')]=_[_0x9b72('0x4f')](_0x503d95[_0x9b72('0x4c')],{'$or':_[_0x9b72('0x3e')](_0x305e23,function(_0x24b7e4){if(_0x24b7e4[_0x9b72('0x40')]!==_0x9b72('0x50')){var _0x1de3b9={};_0x1de3b9[_0x24b7e4['name']]={'$like':'%'+_0x434bf5[_0x9b72('0x42')]['filter']+'%'};return _0x1de3b9;}})});}_0x503d95=_['merge']({},_0x503d95,_0x434bf5['options']);var _0x4b034f={'where':_0x503d95[_0x9b72('0x4c')]};return db[_0x9b72('0x3f')][_0x9b72('0x2b')](_0x4b034f)['then'](function(_0x2de9dc){_0x4ec654[_0x9b72('0x2b')]=_0x2de9dc;if(_0x434bf5[_0x9b72('0x42')]['includeAll']){_0x503d95[_0x9b72('0x51')]=[{'all':!![]}];}return db[_0x9b72('0x3f')][_0x9b72('0x52')](_0x503d95);})[_0x9b72('0x33')](function(_0x2bf702){_0x4ec654[_0x9b72('0x53')]=_0x2bf702;return _0x4ec654;})[_0x9b72('0x33')](respondWithFilteredResult(_0x531873,_0x503d95))[_0x9b72('0x26')](handleError(_0x531873,null));};exports[_0x9b72('0x54')]=function(_0x14a09c,_0x91e2b5){var _0x1b9047={'raw':![],'where':{'id':_0x14a09c[_0x9b72('0x55')]['id']},'include':[{'model':db[_0x9b72('0x3c')],'as':_0x9b72('0x3d')}]},_0x253948={};_0x253948[_0x9b72('0x41')]=_['keys'](db[_0x9b72('0x3f')]['rawAttributes']);_0x253948['query']=_[_0x9b72('0x43')](_0x14a09c[_0x9b72('0x42')]);_0x253948[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x253948[_0x9b72('0x41')],_0x253948[_0x9b72('0x42')]);_0x1b9047[_0x9b72('0x47')]=_[_0x9b72('0x45')](_0x253948[_0x9b72('0x41')],qs['fields'](_0x14a09c[_0x9b72('0x42')][_0x9b72('0x46')]));_0x1b9047[_0x9b72('0x47')]=_0x1b9047[_0x9b72('0x47')]['length']?_0x1b9047[_0x9b72('0x47')]:_0x253948[_0x9b72('0x41')];if(_0x14a09c['query']['includeAll']){_0x1b9047['include']=[{'all':!![]}];}_0x1b9047=_[_0x9b72('0x4f')]({},_0x1b9047,_0x14a09c['options']);return db['WhatsappAccount'][_0x9b72('0x56')](_0x1b9047)[_0x9b72('0x33')](handleEntityNotFound(_0x91e2b5,null))[_0x9b72('0x33')](respondWithResult(_0x91e2b5,null))['catch'](handleError(_0x91e2b5,null));};exports[_0x9b72('0x57')]=function(_0x1c0b33,_0x409de9){return db[_0x9b72('0x3f')][_0x9b72('0x57')](_0x1c0b33[_0x9b72('0x58')],{})[_0x9b72('0x33')](function(_0x181ec8){var _0x3e254b=_0x1c0b33[_0x9b72('0x59')][_0x9b72('0x35')]({'plain':!![]});if(!_0x3e254b)throw new Error(_0x9b72('0x5a'));if(_0x3e254b['role']===_0x9b72('0x59')){var _0x4782be=_0x181ec8['get']({'plain':!![]});var _0x31ccf8=_0x9b72('0x36');return db[_0x9b72('0x5b')][_0x9b72('0x56')]({'where':{'name':_0x31ccf8,'userProfileId':_0x3e254b[_0x9b72('0x5c')]},'raw':!![]})['then'](function(_0x41d6e5){if(_0x41d6e5&&_0x41d6e5['autoAssociation']===0x0){return db['UserProfileResource'][_0x9b72('0x57')]({'name':_0x4782be[_0x9b72('0x3a')],'resourceId':_0x4782be['id'],'type':_0x41d6e5[_0x9b72('0x3a')],'sectionId':_0x41d6e5['id']},{})[_0x9b72('0x33')](function(){return _0x181ec8;});}else{return _0x181ec8;}})['catch'](function(_0x43adcf){logger[_0x9b72('0x21')](_0x9b72('0x5d'),_0x43adcf);throw _0x43adcf;});}return _0x181ec8;})[_0x9b72('0x33')](respondWithResult(_0x409de9,0xc9))[_0x9b72('0x26')](handleError(_0x409de9,null));};exports['update']=function(_0xa06a68,_0x1a98ec){if(_0xa06a68[_0x9b72('0x58')]['id']){delete _0xa06a68[_0x9b72('0x58')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xa06a68[_0x9b72('0x55')]['id']},'include':[{'model':db[_0x9b72('0x3c')],'as':_0x9b72('0x3d')}]})[_0x9b72('0x33')](handleEntityNotFound(_0x1a98ec,null))[_0x9b72('0x33')](saveUpdates(_0xa06a68['body'],null))[_0x9b72('0x33')](respondWithResult(_0x1a98ec,null))['catch'](handleError(_0x1a98ec,null));};exports['destroy']=function(_0xa2a26b,_0x586a51){return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0xa2a26b[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x586a51,null))[_0x9b72('0x33')](removeEntity(_0x586a51,null))[_0x9b72('0x26')](handleError(_0x586a51,null));};exports[_0x9b72('0x5e')]=function(_0x4bcfeb,_0x405a8d){return db[_0x9b72('0x3f')]['describe']()['then'](respondWithResult(_0x405a8d,null))['catch'](handleError(_0x405a8d,null));};exports[_0x9b72('0x5f')]=function(_0x2b6069,_0x989b03,_0x369b1a){if(_0x2b6069[_0x9b72('0x58')]['id']){delete _0x2b6069[_0x9b72('0x58')]['id'];}return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0x2b6069[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x989b03,null))['then'](function(_0x127d28){if(_0x127d28){_0x2b6069[_0x9b72('0x58')][_0x9b72('0x60')]=_0x127d28['id'];return db[_0x9b72('0x61')][_0x9b72('0x57')](_0x2b6069[_0x9b72('0x58')]);}})[_0x9b72('0x33')](respondWithResult(_0x989b03,null))[_0x9b72('0x26')](handleError(_0x989b03,null));};exports[_0x9b72('0x62')]=function(_0x5161fa,_0x2fbcfc,_0x1c05db){var _0xe235e2={'raw':![],'where':{}};var _0x46b600={};var _0x4721e7={'count':0x0,'rows':[]};return db[_0x9b72('0x3f')][_0x9b72('0x63')]({'where':{'id':_0x5161fa[_0x9b72('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fbcfc,null))['then'](function(_0x18e5b2){if(_0x18e5b2){_0x46b600[_0x9b72('0x41')]=_[_0x9b72('0x43')](db[_0x9b72('0x61')]['rawAttributes']);_0x46b600[_0x9b72('0x42')]=_['keys'](_0x5161fa['query']);_0x46b600[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x46b600[_0x9b72('0x41')],_0x46b600[_0x9b72('0x42')]);_0xe235e2[_0x9b72('0x47')]=_['intersection'](_0x46b600[_0x9b72('0x41')],qs[_0x9b72('0x46')](_0x5161fa[_0x9b72('0x42')][_0x9b72('0x46')]));_0xe235e2[_0x9b72('0x47')]=_0xe235e2[_0x9b72('0x47')][_0x9b72('0x64')]?_0xe235e2[_0x9b72('0x47')]:_0x46b600['model'];if(!_0x5161fa[_0x9b72('0x42')][_0x9b72('0x48')](_0x9b72('0x49'))){_0xe235e2[_0x9b72('0x29')]=qs[_0x9b72('0x29')](_0x5161fa['query'][_0x9b72('0x29')]);_0xe235e2[_0x9b72('0x2c')]=qs['offset'](_0x5161fa['query']['offset']);}_0xe235e2[_0x9b72('0x4a')]=qs[_0x9b72('0x4b')](_0x5161fa[_0x9b72('0x42')][_0x9b72('0x4b')]);_0xe235e2['where']=qs[_0x9b72('0x44')](_[_0x9b72('0x4d')](_0x5161fa['query'],_0x46b600['filters']));_0xe235e2[_0x9b72('0x4c')][_0x9b72('0x60')]=_0x18e5b2['id'];if(_0x5161fa['query'][_0x9b72('0x4e')]){_0xe235e2[_0x9b72('0x4c')]=_[_0x9b72('0x4f')](_0xe235e2['where'],{'$or':_[_0x9b72('0x3e')](_0xe235e2[_0x9b72('0x47')],function(_0x299f2e){var _0x474f0a={};_0x474f0a[_0x299f2e]={'$like':'%'+_0x5161fa[_0x9b72('0x42')][_0x9b72('0x4e')]+'%'};return _0x474f0a;})});}_0xe235e2=_[_0x9b72('0x4f')]({},_0xe235e2,_0x5161fa[_0x9b72('0x65')]);return db[_0x9b72('0x61')][_0x9b72('0x2b')]({'where':_0xe235e2[_0x9b72('0x4c')]})[_0x9b72('0x33')](function(_0x3f78d5){_0x4721e7[_0x9b72('0x2b')]=_0x3f78d5;if(_0x5161fa[_0x9b72('0x42')]['includeAll']){_0xe235e2[_0x9b72('0x51')]=[{'all':!![]}];}return db[_0x9b72('0x61')]['findAll'](_0xe235e2);})[_0x9b72('0x33')](function(_0x116823){_0x4721e7['rows']=_0x116823;return _0x4721e7;});}})['then'](respondWithFilteredResult(_0x2fbcfc,_0xe235e2))[_0x9b72('0x26')](handleError(_0x2fbcfc,null));};exports[_0x9b72('0x66')]=function(_0x87d6ef,_0x5d11df,_0x1eb5b3){return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0x87d6ef['params']['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x5d11df,null))['then'](function(_0x575236){if(_0x575236){return _0x575236['removeDispositions'](_0x87d6ef['query'][_0x9b72('0x67')]);}})['then'](respondWithStatusCode(_0x5d11df,null))['catch'](handleError(_0x5d11df,null));};exports['addAnswer']=function(_0x3e445b,_0x460085,_0x4f346f){if(_0x3e445b['body']['id']){delete _0x3e445b['body']['id'];}return db['WhatsappAccount'][_0x9b72('0x56')]({'where':{'id':_0x3e445b[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x460085,null))[_0x9b72('0x33')](function(_0x2dd60d){if(_0x2dd60d){_0x3e445b['body'][_0x9b72('0x60')]=_0x2dd60d['id'];return db[_0x9b72('0x68')][_0x9b72('0x57')](_0x3e445b[_0x9b72('0x58')]);}})[_0x9b72('0x33')](respondWithResult(_0x460085,null))[_0x9b72('0x26')](handleError(_0x460085,null));};exports[_0x9b72('0x69')]=function(_0x5372ad,_0x490a8a,_0x197c31){var _0xd43cdb={'raw':![],'where':{}};var _0x37f1b8={};var _0x830c15={'count':0x0,'rows':[]};return db[_0x9b72('0x3f')][_0x9b72('0x63')]({'where':{'id':_0x5372ad['params']['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x490a8a,null))[_0x9b72('0x33')](function(_0x230e4b){if(_0x230e4b){_0x37f1b8['model']=_[_0x9b72('0x43')](db[_0x9b72('0x68')][_0x9b72('0x6a')]);_0x37f1b8[_0x9b72('0x42')]=_['keys'](_0x5372ad[_0x9b72('0x42')]);_0x37f1b8[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x37f1b8[_0x9b72('0x41')],_0x37f1b8[_0x9b72('0x42')]);_0xd43cdb[_0x9b72('0x47')]=_[_0x9b72('0x45')](_0x37f1b8['model'],qs['fields'](_0x5372ad['query'][_0x9b72('0x46')]));_0xd43cdb['attributes']=_0xd43cdb[_0x9b72('0x47')]['length']?_0xd43cdb[_0x9b72('0x47')]:_0x37f1b8[_0x9b72('0x41')];if(!_0x5372ad['query'][_0x9b72('0x48')](_0x9b72('0x49'))){_0xd43cdb['limit']=qs[_0x9b72('0x29')](_0x5372ad['query'][_0x9b72('0x29')]);_0xd43cdb[_0x9b72('0x2c')]=qs[_0x9b72('0x2c')](_0x5372ad[_0x9b72('0x42')]['offset']);}_0xd43cdb['order']=qs[_0x9b72('0x4b')](_0x5372ad[_0x9b72('0x42')][_0x9b72('0x4b')]);_0xd43cdb['where']=qs[_0x9b72('0x44')](_[_0x9b72('0x4d')](_0x5372ad['query'],_0x37f1b8['filters']));_0xd43cdb['where']['WhatsappAccountId']=_0x230e4b['id'];if(_0x5372ad['query']['filter']){_0xd43cdb['where']=_[_0x9b72('0x4f')](_0xd43cdb['where'],{'$or':_[_0x9b72('0x3e')](_0xd43cdb[_0x9b72('0x47')],function(_0x2d578f){var _0x4f8b09={};_0x4f8b09[_0x2d578f]={'$like':'%'+_0x5372ad[_0x9b72('0x42')][_0x9b72('0x4e')]+'%'};return _0x4f8b09;})});}_0xd43cdb=_[_0x9b72('0x4f')]({},_0xd43cdb,_0x5372ad[_0x9b72('0x65')]);return db['CannedAnswer'][_0x9b72('0x2b')]({'where':_0xd43cdb['where']})[_0x9b72('0x33')](function(_0xddb423){_0x830c15['count']=_0xddb423;if(_0x5372ad[_0x9b72('0x42')]['includeAll']){_0xd43cdb['include']=[{'all':!![]}];}return db[_0x9b72('0x68')][_0x9b72('0x52')](_0xd43cdb);})[_0x9b72('0x33')](function(_0x2ea209){_0x830c15[_0x9b72('0x53')]=_0x2ea209;return _0x830c15;});}})[_0x9b72('0x33')](respondWithFilteredResult(_0x490a8a,_0xd43cdb))[_0x9b72('0x26')](handleError(_0x490a8a,null));};exports[_0x9b72('0x6b')]=function(_0x135844,_0x286623,_0x196f99){return db['WhatsappAccount']['find']({'where':{'id':_0x135844[_0x9b72('0x55')]['id']}})['then'](handleEntityNotFound(_0x286623,null))[_0x9b72('0x33')](function(_0x1f593a){if(_0x1f593a){return _0x1f593a['removeAnswers'](_0x135844[_0x9b72('0x42')][_0x9b72('0x67')]);}})['then'](respondWithStatusCode(_0x286623,null))['catch'](handleError(_0x286623,null));};exports[_0x9b72('0x6c')]=function(_0x51dfef,_0x436c5e,_0x1046a5){return db[_0x9b72('0x3f')]['find']({'where':{'id':_0x51dfef[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x436c5e,null))[_0x9b72('0x33')](function(_0x11f417){if(_0x11f417){return _0x11f417[_0x9b72('0x6c')](_0x51dfef[_0x9b72('0x58')]['ids'],_[_0x9b72('0x6d')](_0x51dfef[_0x9b72('0x58')],['ids','id'])||{})[_0x9b72('0x6e')](function(_0x56a32a){for(var _0x2d413f=0x0;_0x2d413f<_0x51dfef[_0x9b72('0x58')][_0x9b72('0x67')]['length'];_0x2d413f+=0x1){socket[_0x9b72('0x6f')](_0x9b72('0x70'),{'UserId':Number(_0x51dfef['body'][_0x9b72('0x67')][_0x2d413f]),'WhatsappAccountId':Number(_0x51dfef['params']['id'])});}return _0x56a32a;});}})[_0x9b72('0x33')](respondWithResult(_0x436c5e,null))[_0x9b72('0x26')](handleError(_0x436c5e,null));};exports[_0x9b72('0x71')]=function(_0x4a04d4,_0x35d77c,_0xea5c29){return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0x4a04d4['params']['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x35d77c,null))[_0x9b72('0x33')](function(_0xe7f3e0){if(_0xe7f3e0){return _0xe7f3e0[_0x9b72('0x71')](_0x4a04d4[_0x9b72('0x42')]['ids'])[_0x9b72('0x33')](function(){if(_['isArray'](_0x4a04d4['query'][_0x9b72('0x67')])){for(var _0x1fe6a9=0x0;_0x1fe6a9<_0x4a04d4[_0x9b72('0x42')][_0x9b72('0x67')][_0x9b72('0x64')];_0x1fe6a9+=0x1){socket[_0x9b72('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x4a04d4[_0x9b72('0x42')][_0x9b72('0x67')][_0x1fe6a9]),'WhatsappAccountId':Number(_0x4a04d4[_0x9b72('0x55')]['id'])});}}else{socket[_0x9b72('0x6f')](_0x9b72('0x72'),{'UserId':Number(_0x4a04d4[_0x9b72('0x42')][_0x9b72('0x67')]),'WhatsappAccountId':Number(_0x4a04d4['params']['id'])});}});}})[_0x9b72('0x33')](respondWithStatusCode(_0x35d77c,null))[_0x9b72('0x26')](handleError(_0x35d77c,null));};exports[_0x9b72('0x73')]=function(_0x37dd31,_0x3b5d1b,_0x36f987){var _0x383e1c={};var _0x5c5a93={};var _0x44d774;var _0xe605b6;return db['WhatsappAccount'][_0x9b72('0x63')]({'where':{'id':_0x37dd31[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x3b5d1b,null))[_0x9b72('0x33')](function(_0x1e6dc7){if(_0x1e6dc7){_0x44d774=_0x1e6dc7;_0x5c5a93['model']=_['keys'](db['User'][_0x9b72('0x6a')]);_0x5c5a93['query']=_[_0x9b72('0x43')](_0x37dd31[_0x9b72('0x42')]);_0x5c5a93[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x5c5a93[_0x9b72('0x41')],_0x5c5a93['query']);_0x383e1c[_0x9b72('0x47')]=_[_0x9b72('0x45')](_0x5c5a93['model'],qs['fields'](_0x37dd31['query'][_0x9b72('0x46')]));_0x383e1c[_0x9b72('0x47')]=_0x383e1c[_0x9b72('0x47')][_0x9b72('0x64')]?_0x383e1c[_0x9b72('0x47')]:_0x5c5a93['model'];_0x383e1c['order']=qs[_0x9b72('0x4b')](_0x37dd31[_0x9b72('0x42')][_0x9b72('0x4b')]);_0x383e1c[_0x9b72('0x4c')]=qs[_0x9b72('0x44')](_[_0x9b72('0x4d')](_0x37dd31[_0x9b72('0x42')],_0x5c5a93[_0x9b72('0x44')]));if(_0x37dd31['query'][_0x9b72('0x4e')]){_0x383e1c['where']=_[_0x9b72('0x4f')](_0x383e1c[_0x9b72('0x4c')],{'$or':_[_0x9b72('0x3e')](_0x383e1c['attributes'],function(_0x494ad7){var _0x3f6169={};_0x3f6169[_0x494ad7]={'$like':'%'+_0x37dd31[_0x9b72('0x42')][_0x9b72('0x4e')]+'%'};return _0x3f6169;})});}_0x383e1c=_[_0x9b72('0x4f')]({},_0x383e1c,_0x37dd31[_0x9b72('0x65')]);return _0x44d774[_0x9b72('0x73')](_0x383e1c);}})[_0x9b72('0x33')](function(_0x41e8b0){if(_0x41e8b0){_0xe605b6=_0x41e8b0[_0x9b72('0x64')];if(!_0x37dd31[_0x9b72('0x42')][_0x9b72('0x48')](_0x9b72('0x49'))){_0x383e1c[_0x9b72('0x29')]=qs[_0x9b72('0x29')](_0x37dd31[_0x9b72('0x42')][_0x9b72('0x29')]);_0x383e1c['offset']=qs[_0x9b72('0x2c')](_0x37dd31[_0x9b72('0x42')][_0x9b72('0x2c')]);}return _0x44d774[_0x9b72('0x73')](_0x383e1c);}})['then'](function(_0x4f7a65){if(_0x4f7a65){return _0x4f7a65?{'count':_0xe605b6,'rows':_0x4f7a65}:null;}})[_0x9b72('0x33')](respondWithResult(_0x3b5d1b,null))[_0x9b72('0x26')](handleError(_0x3b5d1b,null));};exports[_0x9b72('0x74')]=function(_0x4dd708,_0x4b3b72,_0x2778c5){return db['WhatsappAccount'][_0x9b72('0x63')]({'where':{'id':_0x4dd708[_0x9b72('0x55')]['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x4b3b72,null))[_0x9b72('0x33')](function(_0x39fc2f){if(_0x39fc2f){return db[_0x9b72('0x75')][_0x9b72('0x76')](function(_0x363a48){return db[_0x9b72('0x77')][_0x9b72('0x34')]({'where':{'WhatsappAccountId':_0x4dd708[_0x9b72('0x55')]['id']},'transaction':_0x363a48})[_0x9b72('0x33')](function(_0x56ec74){var _0x5f901a=_[_0x9b72('0x3e')](_0x4dd708[_0x9b72('0x58')],function(_0x86cf14){_0x86cf14['WhatsappAccountId']=_0x4dd708[_0x9b72('0x55')]['id'];return _0x86cf14;});return db['WhatsappApplication'][_0x9b72('0x78')](_0x5f901a,{'transaction':_0x363a48});});})[_0x9b72('0x33')](function(){return db['WhatsappApplication'][_0x9b72('0x79')]({'where':{'WhatsappAccountId':_0x4dd708[_0x9b72('0x55')]['id']},'order':_0x9b72('0x7a')});});}})[_0x9b72('0x33')](respondWithResult(_0x4b3b72,null))[_0x9b72('0x26')](handleError(_0x4b3b72,null));};exports['getApplications']=function(_0x208aaa,_0x30ea8d,_0x3909c9){var _0x3282a5={};var _0x28dde0={};var _0x137f79;var _0x3f1747;return db['WhatsappAccount'][_0x9b72('0x63')]({'where':{'id':_0x208aaa['params']['id']}})[_0x9b72('0x33')](handleEntityNotFound(_0x30ea8d,null))[_0x9b72('0x33')](function(_0x25b909){if(_0x25b909){_0x137f79=_0x25b909;_0x28dde0[_0x9b72('0x41')]=_[_0x9b72('0x43')](db[_0x9b72('0x77')]['rawAttributes']);_0x28dde0[_0x9b72('0x42')]=_['keys'](_0x208aaa[_0x9b72('0x42')]);_0x28dde0[_0x9b72('0x44')]=_[_0x9b72('0x45')](_0x28dde0[_0x9b72('0x41')],_0x28dde0[_0x9b72('0x42')]);_0x3282a5[_0x9b72('0x47')]=_[_0x9b72('0x45')](_0x28dde0[_0x9b72('0x41')],qs[_0x9b72('0x46')](_0x208aaa[_0x9b72('0x42')][_0x9b72('0x46')]));_0x3282a5[_0x9b72('0x47')]=_0x3282a5[_0x9b72('0x47')][_0x9b72('0x64')]?_0x3282a5['attributes']:_0x28dde0[_0x9b72('0x41')];_0x3282a5[_0x9b72('0x4a')]=qs['sort'](_0x208aaa['query'][_0x9b72('0x4b')]);_0x3282a5['where']=qs[_0x9b72('0x44')](_['pick'](_0x208aaa['query'],_0x28dde0[_0x9b72('0x44')]));if(_0x208aaa['query']['filter']){_0x3282a5[_0x9b72('0x4c')]=_[_0x9b72('0x4f')](_0x3282a5[_0x9b72('0x4c')],{'$or':_['map'](_0x3282a5[_0x9b72('0x47')],function(_0x5c2ce6){var _0x5b2555={};_0x5b2555[_0x5c2ce6]={'$like':'%'+_0x208aaa['query'][_0x9b72('0x4e')]+'%'};return _0x5b2555;})});}_0x3282a5=_['merge']({},_0x3282a5,_0x208aaa[_0x9b72('0x65')]);return _0x137f79[_0x9b72('0x7b')](_0x3282a5);}})[_0x9b72('0x33')](function(_0x30c141){if(_0x30c141){_0x3f1747=_0x30c141[_0x9b72('0x64')];if(!_0x208aaa[_0x9b72('0x42')][_0x9b72('0x48')](_0x9b72('0x49'))){_0x3282a5[_0x9b72('0x29')]=qs[_0x9b72('0x29')](_0x208aaa[_0x9b72('0x42')]['limit']);_0x3282a5[_0x9b72('0x2c')]=qs[_0x9b72('0x2c')](_0x208aaa[_0x9b72('0x42')]['offset']);}return _0x137f79[_0x9b72('0x7b')](_0x3282a5);}})[_0x9b72('0x33')](function(_0x2c2114){if(_0x2c2114){return _0x2c2114?{'count':_0x3f1747,'rows':_0x2c2114}:null;}})['then'](respondWithResult(_0x30ea8d,null))[_0x9b72('0x26')](handleError(_0x30ea8d,null));};exports[_0x9b72('0x7c')]=function(_0x357c5e,_0x50510a,_0x8bf518){var _0x550fa2={'channel':_0x9b72('0x7d')};var _0x533909=[];var _0x5bacaa=[];var _0x5f3711={};return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0x357c5e['params']['id']},'include':[{'model':db[_0x9b72('0x77')],'as':_0x9b72('0x7e')}]})[_0x9b72('0x33')](handleEntityNotFound(_0x50510a,null))[_0x9b72('0x33')](function(_0x116b9a){_0x550fa2['account']=_0x116b9a;_0x550fa2[_0x9b72('0x7f')]=_[_0x9b72('0x80')](_0x116b9a[_0x9b72('0x7e')],['priority'],[_0x9b72('0x81')]);if(_0x550fa2[_0x9b72('0x82')]['Applications']){delete _0x550fa2[_0x9b72('0x82')][_0x9b72('0x7e')];}return db[_0x9b72('0x83')][_0x9b72('0x5e')]();})[_0x9b72('0x33')](function(_0x2e676f){if(!_0x2e676f){throw new db['Sequelize']['ValidationError'](_0x9b72('0x84'));}_0x533909=_['difference'](_[_0x9b72('0x43')](_0x2e676f),[_0x9b72('0x85'),_0x9b72('0x86')]);_0x5bacaa=_[_0x9b72('0x87')](_['keys'](_0x2e676f),['createdAt','updatedAt','CompanyId',_0x9b72('0x88')]);_0x550fa2['body']={'mapKey':_0x9b72('0x89')};if(_0x550fa2[_0x9b72('0x82')]['type']&&_0x550fa2[_0x9b72('0x82')]['type']===_0x9b72('0x8a')){_0x550fa2[_0x9b72('0x58')][_0x9b72('0x8b')]=_0x357c5e[_0x9b72('0x58')]['From'][_0x9b72('0x8c')](_0x9b72('0x8d'),'');_0x550fa2[_0x9b72('0x58')]['body']=_0x357c5e[_0x9b72('0x58')][_0x9b72('0x8e')];_0x550fa2[_0x9b72('0x58')][_0x9b72('0x8f')]=_0x357c5e['body']['MessageSid'];}if(_0x550fa2[_0x9b72('0x58')]['id']){delete _0x550fa2[_0x9b72('0x58')]['id'];}if(_[_0x9b72('0x90')](_0x550fa2['body']['from'])){throw new db[(_0x9b72('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x550fa2[_0x9b72('0x58')][_0x9b72('0x58')])||_0x550fa2[_0x9b72('0x58')][_0x9b72('0x58')]===''){throw new db[(_0x9b72('0x91'))][(_0x9b72('0x92'))](_0x9b72('0x93'));}if(_[_0x9b72('0x90')](_0x550fa2[_0x9b72('0x58')][_0x9b72('0x94')])){throw new db[(_0x9b72('0x91'))][(_0x9b72('0x92'))](_0x9b72('0x95')+_0x5bacaa);}if(!_[_0x9b72('0x96')](_0x5bacaa,_0x550fa2[_0x9b72('0x58')]['mapKey'])){throw new db[(_0x9b72('0x91'))][(_0x9b72('0x92'))](_0x9b72('0x97')+_0x5bacaa);}_0x5f3711[_0x550fa2[_0x9b72('0x58')][_0x9b72('0x94')]]=_0x550fa2[_0x9b72('0x58')][_0x9b72('0x8b')];return db[_0x9b72('0x98')]['find']({'where':{'id':_0x550fa2[_0x9b72('0x82')][_0x9b72('0x88')]},'include':[{'model':db[_0x9b72('0x83')],'as':'Contacts','where':_0x5f3711,'limit':0x1,'order':[[_0x9b72('0x86'),_0x9b72('0x99')]]}]});})[_0x9b72('0x33')](handleEntityNotFound(_0x50510a,null))[_0x9b72('0x33')](function(_0x49840f){if(_0x49840f){_0x550fa2[_0x9b72('0x9a')]=_['omit'](_0x49840f,['Contacts']);if(_0x49840f[_0x9b72('0x9b')][_0x9b72('0x64')]){return _0x49840f[_0x9b72('0x9b')][0x0];}var _0x331fcc=_[_0x9b72('0x15')](_0x550fa2['body'],{'firstName':_0x550fa2['body']['from'],'ListId':_0x49840f['id']});_0x331fcc[_0x550fa2[_0x9b72('0x58')][_0x9b72('0x94')]]=_0x550fa2[_0x9b72('0x58')][_0x9b72('0x8b')];return db[_0x9b72('0x83')][_0x9b72('0x57')](_0x331fcc,{'fields':_0x533909,'raw':!![]});}})[_0x9b72('0x33')](handleEntityNotFound(_0x50510a,null))[_0x9b72('0x33')](function(_0x3eed50){if(_0x3eed50){_0x550fa2[_0x9b72('0x9c')]=_0x3eed50;var _0x53c02a={'ContactId':_0x3eed50['id'],'phone':_0x550fa2['body'][_0x9b72('0x8b')],'WhatsappAccountId':_0x357c5e[_0x9b72('0x55')]['id']};var _0x290756={'ContactId':_0x3eed50['id'],'WhatsappAccountId':_0x357c5e[_0x9b72('0x55')]['id'],'closed':![]};return db[_0x9b72('0x9d')][_0x9b72('0x56')]({'where':_0x290756})[_0x9b72('0x33')](function(_0xed6a3d){if(_0xed6a3d){return[_0xed6a3d,![]];}return db['WhatsappInteraction'][_0x9b72('0x57')](_0x53c02a)['then'](function(_0x38184d){return[_0x38184d,!![]];});});}})[_0x9b72('0x6e')](function(_0x3e0d42,_0x5d03e7){_0x550fa2[_0x9b72('0x9e')]=_0x3e0d42[_0x9b72('0x35')]({'plain':!![]});_0x550fa2[_0x9b72('0x9e')][_0x9b72('0x9f')]=![];if(_0x5d03e7){if(_0x550fa2[_0x9b72('0x82')]['autoclose']){_0x550fa2[_0x9b72('0x7f')]['push']({'id':0x0,'priority':_0x550fa2[_0x9b72('0x7f')]['length']+0x1,'app':_0x9b72('0xa0'),'appdata':_0x9b72('0xa1'),'interval':_0x9b72('0xa2')});}_0x550fa2[_0x9b72('0x9e')][_0x9b72('0x9f')]=!![];}return db['WhatsappMessage'][_0x9b72('0x57')]({'phone':_0x550fa2['body']['from'],'messageId':_0x550fa2[_0x9b72('0x58')]['messageId'],'body':_0x550fa2[_0x9b72('0x58')][_0x9b72('0x58')],'WhatsappAccountId':_0x357c5e[_0x9b72('0x55')]['id'],'WhatsappInteractionId':_0x3e0d42['id'],'direction':'in','ContactId':_0x3e0d42[_0x9b72('0xa3')],'AttachmentId':_0x550fa2['body']['AttachmentId']});})[_0x9b72('0x33')](function(_0x467138){_0x550fa2['message']=_0x467138;if(_0x550fa2['interaction'][_0x9b72('0xa4')]){return db['User'][_0x9b72('0x56')]({'attributes':['id',_0x9b72('0x3a')],'where':{'id':_0x550fa2[_0x9b72('0x9e')][_0x9b72('0xa4')]}})[_0x9b72('0x33')](function(_0x230a39){if(_0x230a39){_0x550fa2[_0x9b72('0x7f')][_0x9b72('0xa5')]({'id':0x0,'priority':0x0,'app':_0x9b72('0xa6'),'appdata':_0x230a39['name']+','+(_0x550fa2['account'][_0x9b72('0xa7')]||0xa),'interval':_0x9b72('0xa2')});}return respondWithRpcPromise(_0x9b72('0xa8'),_0x9b72('0xa9'),_0x550fa2);});}return respondWithRpcPromise(_0x9b72('0xa8'),'startRouting',_0x550fa2);})[_0x9b72('0x33')](function(_0x43bf69){if(_0x43bf69){var _0x1825c7=0xc8;var _0x5ef3a6=_0x9b72('0xaa');logger['info'](_0x9b72('0xab'),_0x5ef3a6,_0x1825c7,'entity\x20found');logger[_0x9b72('0x1f')](_0x9b72('0xac'),_0x5ef3a6,_0x1825c7,'entity\x20found',JSON[_0x9b72('0x20')](_0x43bf69));if(_0x550fa2['account'][_0x9b72('0x40')]==='twilio'){return _0x50510a[_0x9b72('0x27')](_0x1825c7)['set'](_0x9b72('0xad'),_0x9b72('0xae'))[_0x9b72('0xaf')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x50510a[_0x9b72('0x27')](_0x1825c7)[_0x9b72('0x2f')](_0x43bf69);}}})[_0x9b72('0x26')](handleError(_0x50510a,null));};exports[_0x9b72('0xaf')]=function(_0x126b61,_0x1b58d1,_0x481fd3){var _0x312d2d,_0xc977aa,_0x3a31de;if(_['isNil'](_0x126b61[_0x9b72('0x58')][_0x9b72('0x58')])||_0x126b61['body'][_0x9b72('0x58')]===''){throw new db[(_0x9b72('0x91'))]['ValidationError'](_0x9b72('0x93'));}if(_[_0x9b72('0x90')](_0x126b61[_0x9b72('0x58')]['to'])){throw new db[(_0x9b72('0x91'))]['ValidationError']('to\x20is\x20mandatory');}_0x312d2d=_0x126b61[_0x9b72('0x58')]['to'];return db[_0x9b72('0x3f')][_0x9b72('0x56')]({'where':{'id':_0x126b61[_0x9b72('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x9b72('0xb0'),'include':[{'model':db['CmContact'],'as':_0x9b72('0x9b'),'where':{'mobile':_0x312d2d},'limit':0x1,'order':[[_0x9b72('0x86'),_0x9b72('0x99')]]}]}]})[_0x9b72('0x33')](handleEntityNotFound(_0x1b58d1,null))[_0x9b72('0x33')](function(_0x23d21b){if(_0x23d21b&&_0x23d21b[_0x9b72('0xb0')]){_0xc977aa=_0x23d21b[_0x9b72('0x35')]({'plain':!![]});if(_0xc977aa[_0x9b72('0xb0')]&&_0xc977aa[_0x9b72('0xb0')][_0x9b72('0x9b')]['length']){return _0xc977aa[_0x9b72('0xb0')][_0x9b72('0x9b')][0x0];}return db['CmContact'][_0x9b72('0x57')](_[_0x9b72('0x15')](_0x126b61[_0x9b72('0x58')],{'firstName':_0x312d2d,'mobile':_0x312d2d,'phone':_0x312d2d,'ListId':_0xc977aa['ListId']}));}})[_0x9b72('0x33')](handleEntityNotFound(_0x1b58d1,null))[_0x9b72('0x33')](function(_0x127a50){if(_0x127a50){_0x3a31de=_0x127a50;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x3a31de['id'],'closed':![],'WhatsappAccountId':_0xc977aa['id']}})[_0x9b72('0x33')](function(_0x480f44){if(_0x480f44){return[_0x480f44,![]];}return db[_0x9b72('0x9d')][_0x9b72('0x57')]({'UserId':_0x126b61[_0x9b72('0x59')]['id'],'ContactId':_0x3a31de['id'],'WhatsappAccountId':_0xc977aa['id'],'phone':_0x312d2d,'firstMsgDirection':_0x9b72('0xb1'),'Messages':[_[_0x9b72('0x4f')](_0x126b61['body'],{'read':![],'body':_0x126b61['body'][_0x9b72('0x58')],'phone':_0x312d2d,'WhatsappAccountId':_0xc977aa['id'],'UserId':_0x126b61[_0x9b72('0x59')]['id'],'ContactId':_0x3a31de['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x47f94c){return[_0x47f94c,!![]];});});}})[_0x9b72('0x6e')](function(_0x16dbd0,_0x3a3f7d){if(_0x3a3f7d){return _0x16dbd0;}return db[_0x9b72('0xb2')]['create'](_[_0x9b72('0x4f')](_0x126b61[_0x9b72('0x58')],{'read':![],'body':_0x126b61[_0x9b72('0x58')]['body'],'phone':_0x312d2d,'WhatsappAccountId':_0xc977aa['id'],'WhatsappInteractionId':_0x16dbd0['id'],'UserId':_0x126b61[_0x9b72('0x59')]['id'],'ContactId':_0x3a31de['id']}))[_0x9b72('0x33')](function(_0x40a5bf){_0x16dbd0[_0x9b72('0xb3')][_0x9b72('0xb4')]=[];_0x16dbd0['dataValues'][_0x9b72('0xb4')][_0x9b72('0xb5')](_0x40a5bf[_0x9b72('0xb3')]);return _0x16dbd0;});})['then'](respondWithResult(_0x1b58d1,null))[_0x9b72('0x26')](handleError(_0x1b58d1,null));};
\ No newline at end of file
+var _0x8e88=['json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','WhatsappAccounts','UserProfileResource','status','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','Disposition','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','ids','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','notify','applications','orderBy','asc','account','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','whatsapp:','Body','messageId','MessageSid','from','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','entity\x20found','debug','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','List','out','Messages','dataValues','push','eml-format','rimraf','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','end'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e88,0x8e));var _0x88e8=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x8e88[_0x99868f];return _0x27a71b;};'use strict';var emlformat=require(_0x88e8('0x0'));var rimraf=require(_0x88e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x88e8('0x2'));var BPromise=require(_0x88e8('0x3'));var Mustache=require(_0x88e8('0x4'));var util=require(_0x88e8('0x5'));var path=require(_0x88e8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88e8('0x7'));var _=require(_0x88e8('0x8'));var squel=require(_0x88e8('0x9'));var crypto=require(_0x88e8('0xa'));var jsforce=require(_0x88e8('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88e8('0xc'));var Redis=require('ioredis');var authService=require(_0x88e8('0xd'));var qs=require(_0x88e8('0xe'));var as=require(_0x88e8('0xf'));var hardwareService=require(_0x88e8('0x10'));var logger=require('../../config/logger')(_0x88e8('0x11'));var utils=require(_0x88e8('0x12'));var config=require(_0x88e8('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x88e8('0x14')]=_['defaults'](config[_0x88e8('0x14')],{'host':_0x88e8('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88e8('0x14')]));require(_0x88e8('0x16'))[_0x88e8('0x17')](socket);var jayson=require(_0x88e8('0x18'));var client=jayson['client'][_0x88e8('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x5d76c,_0x2af486,_0x3daa73,_0xac0aaf){return new BPromise(function(_0xa60268,_0x4c2545){var _0x143b01=_0xac0aaf||client;return _0x143b01[_0x88e8('0x1a')](_0x5d76c,_0x3daa73)[_0x88e8('0x1b')](function(_0x41a57f){logger[_0x88e8('0x1c')]('WhatsappAccount,\x20%s,\x20%s',_0x2af486,_0x88e8('0x1d'));logger['debug'](_0x88e8('0x1e'),_0x2af486,'request\x20sent',JSON['stringify'](_0x41a57f));if(_0x41a57f[_0x88e8('0x1f')]){if(_0x41a57f[_0x88e8('0x1f')][_0x88e8('0x20')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2af486,_0x41a57f[_0x88e8('0x1f')]['message']);return _0x4c2545(_0x41a57f[_0x88e8('0x1f')][_0x88e8('0x21')]);}logger[_0x88e8('0x1f')](_0x88e8('0x22'),_0x2af486,_0x41a57f[_0x88e8('0x1f')]['message']);return _0xa60268(_0x41a57f[_0x88e8('0x1f')][_0x88e8('0x21')]);}else{logger['info'](_0x88e8('0x22'),_0x2af486,_0x88e8('0x1d'));_0xa60268(_0x41a57f[_0x88e8('0x23')][_0x88e8('0x21')]);}})[_0x88e8('0x24')](function(_0x3033fe){logger[_0x88e8('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x2af486,_0x3033fe);_0x4c2545(_0x3033fe);});});}function respondWithStatusCode(_0x378db5,_0x5c8906){_0x5c8906=_0x5c8906||0xcc;return function(_0x30feae){if(_0x30feae){return _0x378db5['sendStatus'](_0x5c8906);}return _0x378db5['status'](_0x5c8906)[_0x88e8('0x25')]();};}function respondWithResult(_0x5e493b,_0x4b107a){_0x4b107a=_0x4b107a||0xc8;return function(_0x51ebd2){if(_0x51ebd2){return _0x5e493b['status'](_0x4b107a)[_0x88e8('0x26')](_0x51ebd2);}};}function respondWithFilteredResult(_0x4d47ab,_0x3757d6){return function(_0x29b153){if(_0x29b153){var _0x5c236f=typeof _0x3757d6[_0x88e8('0x27')]===_0x88e8('0x28')&&typeof _0x3757d6[_0x88e8('0x29')]==='undefined';var _0x409232=_0x29b153['count'];var _0x3d2ce6=_0x5c236f?0x0:_0x3757d6[_0x88e8('0x27')];var _0x3e23ed=_0x5c236f?_0x29b153[_0x88e8('0x2a')]:_0x3757d6[_0x88e8('0x27')]+_0x3757d6[_0x88e8('0x29')];var _0xf3154d;if(_0x3e23ed>=_0x409232){_0x3e23ed=_0x409232;_0xf3154d=0xc8;}else{_0xf3154d=0xce;}_0x4d47ab['status'](_0xf3154d);return _0x4d47ab[_0x88e8('0x2b')](_0x88e8('0x2c'),_0x3d2ce6+'-'+_0x3e23ed+'/'+_0x409232)[_0x88e8('0x26')](_0x29b153);}return null;};}function patchUpdates(_0x5b5a05){return function(_0x2e7403){try{jsonpatch['apply'](_0x2e7403,_0x5b5a05,!![]);}catch(_0x1e832d){return BPromise['reject'](_0x1e832d);}return _0x2e7403['save']();};}function saveUpdates(_0x215981,_0x595589){return function(_0x1c4fb4){if(_0x1c4fb4){return _0x1c4fb4[_0x88e8('0x2d')](_0x215981)[_0x88e8('0x1b')](function(_0x5bf7fe){return _0x5bf7fe;});}return null;};}function removeEntity(_0x46646a,_0xc33ec1){return function(_0x498fe5){if(_0x498fe5){return _0x498fe5[_0x88e8('0x2e')]()[_0x88e8('0x1b')](function(){var _0xfd746=_0x498fe5[_0x88e8('0x2f')]({'plain':!![]});var _0x38623d=_0x88e8('0x30');return db[_0x88e8('0x31')]['destroy']({'where':{'type':_0x38623d,'resourceId':_0xfd746['id']}})[_0x88e8('0x1b')](function(){return _0x498fe5;});})[_0x88e8('0x1b')](function(){_0x46646a[_0x88e8('0x32')](0xcc)[_0x88e8('0x25')]();});}};}function handleEntityNotFound(_0x4af57a,_0x4edffb){return function(_0x204ac6){if(!_0x204ac6){_0x4af57a[_0x88e8('0x33')](0x194);}return _0x204ac6;};}function handleError(_0x4ab0ff,_0x1d0d31){_0x1d0d31=_0x1d0d31||0x1f4;return function(_0x3b3223){logger['error'](_0x3b3223[_0x88e8('0x34')]);if(_0x3b3223[_0x88e8('0x35')]){delete _0x3b3223[_0x88e8('0x35')];}_0x4ab0ff[_0x88e8('0x32')](_0x1d0d31)[_0x88e8('0x36')](_0x3b3223);};}exports[_0x88e8('0x37')]=function(_0x5f2f16,_0x474c09){var _0x580d3c={'include':[{'model':db[_0x88e8('0x38')],'as':_0x88e8('0x39')}]},_0x1e00b8={},_0x58a565={'count':0x0,'rows':[]};var _0x163e6e=_[_0x88e8('0x3a')](db[_0x88e8('0x3b')]['rawAttributes'],function(_0x1c3e07){return{'name':_0x1c3e07['fieldName'],'type':_0x1c3e07[_0x88e8('0x3c')][_0x88e8('0x3d')]};});_0x1e00b8[_0x88e8('0x3e')]=_['map'](_0x163e6e,'name');_0x1e00b8[_0x88e8('0x3f')]=_[_0x88e8('0x40')](_0x5f2f16['query']);_0x1e00b8[_0x88e8('0x41')]=_[_0x88e8('0x42')](_0x1e00b8[_0x88e8('0x3e')],_0x1e00b8['query']);_0x580d3c[_0x88e8('0x43')]=_['intersection'](_0x1e00b8[_0x88e8('0x3e')],qs[_0x88e8('0x44')](_0x5f2f16[_0x88e8('0x3f')]['fields']));_0x580d3c['attributes']=_0x580d3c[_0x88e8('0x43')][_0x88e8('0x45')]?_0x580d3c[_0x88e8('0x43')]:_0x1e00b8['model'];if(!_0x5f2f16[_0x88e8('0x3f')][_0x88e8('0x46')](_0x88e8('0x47'))){_0x580d3c['limit']=qs['limit'](_0x5f2f16[_0x88e8('0x3f')][_0x88e8('0x29')]);_0x580d3c[_0x88e8('0x27')]=qs[_0x88e8('0x27')](_0x5f2f16['query']['offset']);}_0x580d3c['order']=qs[_0x88e8('0x48')](_0x5f2f16['query'][_0x88e8('0x48')]);_0x580d3c['where']=qs['filters'](_[_0x88e8('0x49')](_0x5f2f16[_0x88e8('0x3f')],_0x1e00b8[_0x88e8('0x41')]),_0x163e6e);if(_0x5f2f16[_0x88e8('0x3f')]['filter']){_0x580d3c[_0x88e8('0x4a')]=_[_0x88e8('0x4b')](_0x580d3c[_0x88e8('0x4a')],{'$or':_[_0x88e8('0x3a')](_0x163e6e,function(_0x590347){if(_0x590347[_0x88e8('0x3c')]!==_0x88e8('0x4c')){var _0x225ca1={};_0x225ca1[_0x590347['name']]={'$like':'%'+_0x5f2f16[_0x88e8('0x3f')][_0x88e8('0x4d')]+'%'};return _0x225ca1;}})});}_0x580d3c=_[_0x88e8('0x4b')]({},_0x580d3c,_0x5f2f16[_0x88e8('0x4e')]);var _0x11463d={'where':_0x580d3c[_0x88e8('0x4a')]};return db[_0x88e8('0x3b')][_0x88e8('0x2a')](_0x11463d)['then'](function(_0x3f4afb){_0x58a565[_0x88e8('0x2a')]=_0x3f4afb;if(_0x5f2f16[_0x88e8('0x3f')][_0x88e8('0x4f')]){_0x580d3c[_0x88e8('0x50')]=[{'all':!![]}];}return db[_0x88e8('0x3b')]['findAll'](_0x580d3c);})[_0x88e8('0x1b')](function(_0x4c7331){_0x58a565['rows']=_0x4c7331;return _0x58a565;})[_0x88e8('0x1b')](respondWithFilteredResult(_0x474c09,_0x580d3c))[_0x88e8('0x24')](handleError(_0x474c09,null));};exports['show']=function(_0x3f1f10,_0x100755){var _0x5d6189={'raw':![],'where':{'id':_0x3f1f10[_0x88e8('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x88e8('0x39')}]},_0xab936f={};_0xab936f[_0x88e8('0x3e')]=_[_0x88e8('0x40')](db[_0x88e8('0x3b')][_0x88e8('0x52')]);_0xab936f['query']=_['keys'](_0x3f1f10[_0x88e8('0x3f')]);_0xab936f[_0x88e8('0x41')]=_[_0x88e8('0x42')](_0xab936f[_0x88e8('0x3e')],_0xab936f['query']);_0x5d6189[_0x88e8('0x43')]=_[_0x88e8('0x42')](_0xab936f['model'],qs['fields'](_0x3f1f10[_0x88e8('0x3f')][_0x88e8('0x44')]));_0x5d6189[_0x88e8('0x43')]=_0x5d6189[_0x88e8('0x43')][_0x88e8('0x45')]?_0x5d6189[_0x88e8('0x43')]:_0xab936f['model'];if(_0x3f1f10[_0x88e8('0x3f')][_0x88e8('0x4f')]){_0x5d6189['include']=[{'all':!![]}];}_0x5d6189=_['merge']({},_0x5d6189,_0x3f1f10['options']);return db['WhatsappAccount'][_0x88e8('0x53')](_0x5d6189)[_0x88e8('0x1b')](handleEntityNotFound(_0x100755,null))['then'](respondWithResult(_0x100755,null))['catch'](handleError(_0x100755,null));};exports[_0x88e8('0x54')]=function(_0x55577e,_0x321be3){return db[_0x88e8('0x3b')][_0x88e8('0x54')](_0x55577e[_0x88e8('0x55')],{})[_0x88e8('0x1b')](function(_0x347a10){var _0x416993=_0x55577e[_0x88e8('0x56')]['get']({'plain':!![]});if(!_0x416993)throw new Error(_0x88e8('0x57'));if(_0x416993[_0x88e8('0x58')]===_0x88e8('0x56')){var _0x5ab6f1=_0x347a10[_0x88e8('0x2f')]({'plain':!![]});var _0x172bbb=_0x88e8('0x30');return db['UserProfileSection'][_0x88e8('0x53')]({'where':{'name':_0x172bbb,'userProfileId':_0x416993[_0x88e8('0x59')]},'raw':!![]})[_0x88e8('0x1b')](function(_0x354401){if(_0x354401&&_0x354401[_0x88e8('0x5a')]===0x0){return db[_0x88e8('0x31')][_0x88e8('0x54')]({'name':_0x5ab6f1['name'],'resourceId':_0x5ab6f1['id'],'type':_0x354401['name'],'sectionId':_0x354401['id']},{})[_0x88e8('0x1b')](function(){return _0x347a10;});}else{return _0x347a10;}})['catch'](function(_0x718b8a){logger[_0x88e8('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x718b8a);throw _0x718b8a;});}return _0x347a10;})[_0x88e8('0x1b')](respondWithResult(_0x321be3,0xc9))[_0x88e8('0x24')](handleError(_0x321be3,null));};exports['update']=function(_0x156080,_0x3296a0){if(_0x156080[_0x88e8('0x55')]['id']){delete _0x156080[_0x88e8('0x55')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x156080['params']['id']},'include':[{'model':db['Pause'],'as':_0x88e8('0x39')}]})[_0x88e8('0x1b')](handleEntityNotFound(_0x3296a0,null))[_0x88e8('0x1b')](saveUpdates(_0x156080[_0x88e8('0x55')],null))[_0x88e8('0x1b')](respondWithResult(_0x3296a0,null))[_0x88e8('0x24')](handleError(_0x3296a0,null));};exports[_0x88e8('0x2e')]=function(_0x4e7c7b,_0x102d62){return db['WhatsappAccount'][_0x88e8('0x53')]({'where':{'id':_0x4e7c7b[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x102d62,null))[_0x88e8('0x1b')](removeEntity(_0x102d62,null))[_0x88e8('0x24')](handleError(_0x102d62,null));};exports['describe']=function(_0x26af8e,_0x8ee1ab){return db[_0x88e8('0x3b')][_0x88e8('0x5b')]()[_0x88e8('0x1b')](respondWithResult(_0x8ee1ab,null))['catch'](handleError(_0x8ee1ab,null));};exports[_0x88e8('0x5c')]=function(_0xfcb95b,_0x42696f,_0x4e8709){if(_0xfcb95b[_0x88e8('0x55')]['id']){delete _0xfcb95b['body']['id'];}return db['WhatsappAccount'][_0x88e8('0x53')]({'where':{'id':_0xfcb95b[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x42696f,null))['then'](function(_0xf2978){if(_0xf2978){_0xfcb95b[_0x88e8('0x55')][_0x88e8('0x5d')]=_0xf2978['id'];return db['Disposition'][_0x88e8('0x54')](_0xfcb95b[_0x88e8('0x55')]);}})['then'](respondWithResult(_0x42696f,null))['catch'](handleError(_0x42696f,null));};exports['getDispositions']=function(_0x5c61e3,_0x1e35a5,_0x3340c7){var _0x59b859={'raw':![],'where':{}};var _0x4acd56={};var _0x53d761={'count':0x0,'rows':[]};return db[_0x88e8('0x3b')]['findOne']({'where':{'id':_0x5c61e3[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x1e35a5,null))[_0x88e8('0x1b')](function(_0x1d11e9){if(_0x1d11e9){_0x4acd56['model']=_['keys'](db['Disposition'][_0x88e8('0x52')]);_0x4acd56[_0x88e8('0x3f')]=_[_0x88e8('0x40')](_0x5c61e3[_0x88e8('0x3f')]);_0x4acd56[_0x88e8('0x41')]=_[_0x88e8('0x42')](_0x4acd56[_0x88e8('0x3e')],_0x4acd56[_0x88e8('0x3f')]);_0x59b859['attributes']=_[_0x88e8('0x42')](_0x4acd56[_0x88e8('0x3e')],qs['fields'](_0x5c61e3['query'][_0x88e8('0x44')]));_0x59b859[_0x88e8('0x43')]=_0x59b859[_0x88e8('0x43')][_0x88e8('0x45')]?_0x59b859[_0x88e8('0x43')]:_0x4acd56[_0x88e8('0x3e')];if(!_0x5c61e3['query']['hasOwnProperty'](_0x88e8('0x47'))){_0x59b859[_0x88e8('0x29')]=qs[_0x88e8('0x29')](_0x5c61e3['query'][_0x88e8('0x29')]);_0x59b859[_0x88e8('0x27')]=qs[_0x88e8('0x27')](_0x5c61e3[_0x88e8('0x3f')][_0x88e8('0x27')]);}_0x59b859['order']=qs[_0x88e8('0x48')](_0x5c61e3[_0x88e8('0x3f')][_0x88e8('0x48')]);_0x59b859[_0x88e8('0x4a')]=qs[_0x88e8('0x41')](_['pick'](_0x5c61e3[_0x88e8('0x3f')],_0x4acd56[_0x88e8('0x41')]));_0x59b859[_0x88e8('0x4a')][_0x88e8('0x5d')]=_0x1d11e9['id'];if(_0x5c61e3['query'][_0x88e8('0x4d')]){_0x59b859[_0x88e8('0x4a')]=_[_0x88e8('0x4b')](_0x59b859['where'],{'$or':_[_0x88e8('0x3a')](_0x59b859[_0x88e8('0x43')],function(_0x429f60){var _0xd93731={};_0xd93731[_0x429f60]={'$like':'%'+_0x5c61e3[_0x88e8('0x3f')]['filter']+'%'};return _0xd93731;})});}_0x59b859=_[_0x88e8('0x4b')]({},_0x59b859,_0x5c61e3['options']);return db[_0x88e8('0x5e')]['count']({'where':_0x59b859[_0x88e8('0x4a')]})[_0x88e8('0x1b')](function(_0x5d500c){_0x53d761['count']=_0x5d500c;if(_0x5c61e3[_0x88e8('0x3f')][_0x88e8('0x4f')]){_0x59b859['include']=[{'all':!![]}];}return db[_0x88e8('0x5e')][_0x88e8('0x5f')](_0x59b859);})['then'](function(_0x27d3c9){_0x53d761[_0x88e8('0x60')]=_0x27d3c9;return _0x53d761;});}})['then'](respondWithFilteredResult(_0x1e35a5,_0x59b859))[_0x88e8('0x24')](handleError(_0x1e35a5,null));};exports[_0x88e8('0x61')]=function(_0x44d83e,_0x3bcd93,_0x5245ec){return db['WhatsappAccount'][_0x88e8('0x53')]({'where':{'id':_0x44d83e['params']['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x3bcd93,null))['then'](function(_0x46c2e3){if(_0x46c2e3){return _0x46c2e3[_0x88e8('0x61')](_0x44d83e[_0x88e8('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x3bcd93,null))[_0x88e8('0x24')](handleError(_0x3bcd93,null));};exports[_0x88e8('0x62')]=function(_0x2a3a62,_0x1baa86,_0x4a47be){if(_0x2a3a62[_0x88e8('0x55')]['id']){delete _0x2a3a62['body']['id'];}return db['WhatsappAccount'][_0x88e8('0x53')]({'where':{'id':_0x2a3a62[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x1baa86,null))[_0x88e8('0x1b')](function(_0x3b14da){if(_0x3b14da){_0x2a3a62[_0x88e8('0x55')][_0x88e8('0x5d')]=_0x3b14da['id'];return db[_0x88e8('0x63')][_0x88e8('0x54')](_0x2a3a62['body']);}})[_0x88e8('0x1b')](respondWithResult(_0x1baa86,null))[_0x88e8('0x24')](handleError(_0x1baa86,null));};exports[_0x88e8('0x64')]=function(_0x349c38,_0x1e85e0,_0x4d7070){var _0x8d97bd={'raw':![],'where':{}};var _0x1c19ca={};var _0x298e83={'count':0x0,'rows':[]};return db[_0x88e8('0x3b')][_0x88e8('0x65')]({'where':{'id':_0x349c38[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x1e85e0,null))[_0x88e8('0x1b')](function(_0x284e21){if(_0x284e21){_0x1c19ca[_0x88e8('0x3e')]=_[_0x88e8('0x40')](db[_0x88e8('0x63')][_0x88e8('0x52')]);_0x1c19ca[_0x88e8('0x3f')]=_[_0x88e8('0x40')](_0x349c38['query']);_0x1c19ca[_0x88e8('0x41')]=_[_0x88e8('0x42')](_0x1c19ca[_0x88e8('0x3e')],_0x1c19ca[_0x88e8('0x3f')]);_0x8d97bd['attributes']=_[_0x88e8('0x42')](_0x1c19ca[_0x88e8('0x3e')],qs['fields'](_0x349c38['query'][_0x88e8('0x44')]));_0x8d97bd['attributes']=_0x8d97bd[_0x88e8('0x43')][_0x88e8('0x45')]?_0x8d97bd[_0x88e8('0x43')]:_0x1c19ca['model'];if(!_0x349c38[_0x88e8('0x3f')][_0x88e8('0x46')](_0x88e8('0x47'))){_0x8d97bd['limit']=qs[_0x88e8('0x29')](_0x349c38[_0x88e8('0x3f')][_0x88e8('0x29')]);_0x8d97bd[_0x88e8('0x27')]=qs[_0x88e8('0x27')](_0x349c38[_0x88e8('0x3f')][_0x88e8('0x27')]);}_0x8d97bd['order']=qs['sort'](_0x349c38['query'][_0x88e8('0x48')]);_0x8d97bd[_0x88e8('0x4a')]=qs[_0x88e8('0x41')](_[_0x88e8('0x49')](_0x349c38[_0x88e8('0x3f')],_0x1c19ca['filters']));_0x8d97bd['where'][_0x88e8('0x5d')]=_0x284e21['id'];if(_0x349c38['query'][_0x88e8('0x4d')]){_0x8d97bd[_0x88e8('0x4a')]=_[_0x88e8('0x4b')](_0x8d97bd[_0x88e8('0x4a')],{'$or':_['map'](_0x8d97bd[_0x88e8('0x43')],function(_0x5ef0d2){var _0x8ab2de={};_0x8ab2de[_0x5ef0d2]={'$like':'%'+_0x349c38[_0x88e8('0x3f')][_0x88e8('0x4d')]+'%'};return _0x8ab2de;})});}_0x8d97bd=_[_0x88e8('0x4b')]({},_0x8d97bd,_0x349c38[_0x88e8('0x4e')]);return db[_0x88e8('0x63')][_0x88e8('0x2a')]({'where':_0x8d97bd[_0x88e8('0x4a')]})[_0x88e8('0x1b')](function(_0x3c15f7){_0x298e83[_0x88e8('0x2a')]=_0x3c15f7;if(_0x349c38[_0x88e8('0x3f')]['includeAll']){_0x8d97bd[_0x88e8('0x50')]=[{'all':!![]}];}return db[_0x88e8('0x63')][_0x88e8('0x5f')](_0x8d97bd);})['then'](function(_0x81bd38){_0x298e83[_0x88e8('0x60')]=_0x81bd38;return _0x298e83;});}})['then'](respondWithFilteredResult(_0x1e85e0,_0x8d97bd))[_0x88e8('0x24')](handleError(_0x1e85e0,null));};exports['removeAnswers']=function(_0x1a62ef,_0x19fe5d,_0x2c80f0){return db[_0x88e8('0x3b')]['find']({'where':{'id':_0x1a62ef['params']['id']}})['then'](handleEntityNotFound(_0x19fe5d,null))['then'](function(_0x3473ef){if(_0x3473ef){return _0x3473ef[_0x88e8('0x66')](_0x1a62ef['query']['ids']);}})[_0x88e8('0x1b')](respondWithStatusCode(_0x19fe5d,null))[_0x88e8('0x24')](handleError(_0x19fe5d,null));};exports[_0x88e8('0x67')]=function(_0x4ca7b7,_0x330b87,_0x82c500){return db['WhatsappAccount'][_0x88e8('0x53')]({'where':{'id':_0x4ca7b7[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x330b87,null))[_0x88e8('0x1b')](function(_0x182f8f){if(_0x182f8f){return _0x182f8f['addAgents'](_0x4ca7b7[_0x88e8('0x55')][_0x88e8('0x68')],_[_0x88e8('0x69')](_0x4ca7b7['body'],[_0x88e8('0x68'),'id'])||{})[_0x88e8('0x6a')](function(_0x35f03d){for(var _0x2d56a0=0x0;_0x2d56a0<_0x4ca7b7[_0x88e8('0x55')]['ids'][_0x88e8('0x45')];_0x2d56a0+=0x1){socket[_0x88e8('0x6b')]('userWhatsappAccount:save',{'UserId':Number(_0x4ca7b7[_0x88e8('0x55')][_0x88e8('0x68')][_0x2d56a0]),'WhatsappAccountId':Number(_0x4ca7b7[_0x88e8('0x51')]['id'])});}return _0x35f03d;});}})['then'](respondWithResult(_0x330b87,null))[_0x88e8('0x24')](handleError(_0x330b87,null));};exports[_0x88e8('0x6c')]=function(_0x30ba07,_0x527c00,_0x261795){return db[_0x88e8('0x3b')][_0x88e8('0x53')]({'where':{'id':_0x30ba07['params']['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x527c00,null))['then'](function(_0x20f8c8){if(_0x20f8c8){return _0x20f8c8['removeAgents'](_0x30ba07[_0x88e8('0x3f')][_0x88e8('0x68')])[_0x88e8('0x1b')](function(){if(_[_0x88e8('0x6d')](_0x30ba07[_0x88e8('0x3f')][_0x88e8('0x68')])){for(var _0x400845=0x0;_0x400845<_0x30ba07[_0x88e8('0x3f')][_0x88e8('0x68')][_0x88e8('0x45')];_0x400845+=0x1){socket[_0x88e8('0x6b')](_0x88e8('0x6e'),{'UserId':Number(_0x30ba07[_0x88e8('0x3f')][_0x88e8('0x68')][_0x400845]),'WhatsappAccountId':Number(_0x30ba07[_0x88e8('0x51')]['id'])});}}else{socket[_0x88e8('0x6b')](_0x88e8('0x6e'),{'UserId':Number(_0x30ba07[_0x88e8('0x3f')]['ids']),'WhatsappAccountId':Number(_0x30ba07[_0x88e8('0x51')]['id'])});}});}})[_0x88e8('0x1b')](respondWithStatusCode(_0x527c00,null))[_0x88e8('0x24')](handleError(_0x527c00,null));};exports[_0x88e8('0x6f')]=function(_0x12464e,_0x4cf60f,_0x439870){var _0x4ecaf8={};var _0x53af42={};var _0x54bf53;var _0x41c534;return db['WhatsappAccount'][_0x88e8('0x65')]({'where':{'id':_0x12464e[_0x88e8('0x51')]['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x4cf60f,null))[_0x88e8('0x1b')](function(_0x8f863e){if(_0x8f863e){_0x54bf53=_0x8f863e;_0x53af42[_0x88e8('0x3e')]=_[_0x88e8('0x40')](db[_0x88e8('0x70')][_0x88e8('0x52')]);_0x53af42[_0x88e8('0x3f')]=_['keys'](_0x12464e[_0x88e8('0x3f')]);_0x53af42['filters']=_['intersection'](_0x53af42[_0x88e8('0x3e')],_0x53af42[_0x88e8('0x3f')]);_0x4ecaf8[_0x88e8('0x43')]=_[_0x88e8('0x42')](_0x53af42['model'],qs[_0x88e8('0x44')](_0x12464e[_0x88e8('0x3f')][_0x88e8('0x44')]));_0x4ecaf8[_0x88e8('0x43')]=_0x4ecaf8['attributes'][_0x88e8('0x45')]?_0x4ecaf8['attributes']:_0x53af42[_0x88e8('0x3e')];_0x4ecaf8['order']=qs[_0x88e8('0x48')](_0x12464e[_0x88e8('0x3f')][_0x88e8('0x48')]);_0x4ecaf8[_0x88e8('0x4a')]=qs[_0x88e8('0x41')](_[_0x88e8('0x49')](_0x12464e['query'],_0x53af42[_0x88e8('0x41')]));if(_0x12464e[_0x88e8('0x3f')][_0x88e8('0x4d')]){_0x4ecaf8['where']=_[_0x88e8('0x4b')](_0x4ecaf8[_0x88e8('0x4a')],{'$or':_[_0x88e8('0x3a')](_0x4ecaf8[_0x88e8('0x43')],function(_0x28e699){var _0xa79f5e={};_0xa79f5e[_0x28e699]={'$like':'%'+_0x12464e[_0x88e8('0x3f')][_0x88e8('0x4d')]+'%'};return _0xa79f5e;})});}_0x4ecaf8=_[_0x88e8('0x4b')]({},_0x4ecaf8,_0x12464e[_0x88e8('0x4e')]);return _0x54bf53[_0x88e8('0x6f')](_0x4ecaf8);}})['then'](function(_0x3d4448){if(_0x3d4448){_0x41c534=_0x3d4448[_0x88e8('0x45')];if(!_0x12464e['query'][_0x88e8('0x46')](_0x88e8('0x47'))){_0x4ecaf8[_0x88e8('0x29')]=qs[_0x88e8('0x29')](_0x12464e[_0x88e8('0x3f')][_0x88e8('0x29')]);_0x4ecaf8[_0x88e8('0x27')]=qs['offset'](_0x12464e[_0x88e8('0x3f')]['offset']);}return _0x54bf53[_0x88e8('0x6f')](_0x4ecaf8);}})['then'](function(_0x5a849c){if(_0x5a849c){return _0x5a849c?{'count':_0x41c534,'rows':_0x5a849c}:null;}})[_0x88e8('0x1b')](respondWithResult(_0x4cf60f,null))[_0x88e8('0x24')](handleError(_0x4cf60f,null));};exports[_0x88e8('0x71')]=function(_0x5151ca,_0x16f3dc,_0x588913){return db[_0x88e8('0x3b')][_0x88e8('0x65')]({'where':{'id':_0x5151ca['params']['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x16f3dc,null))[_0x88e8('0x1b')](function(_0x4fa313){if(_0x4fa313){return db[_0x88e8('0x72')][_0x88e8('0x73')](function(_0x71d5f){return db[_0x88e8('0x74')]['destroy']({'where':{'WhatsappAccountId':_0x5151ca[_0x88e8('0x51')]['id']},'transaction':_0x71d5f})['then'](function(_0x9030ad){var _0x3839ae=_[_0x88e8('0x3a')](_0x5151ca[_0x88e8('0x55')],function(_0x17b605){_0x17b605[_0x88e8('0x5d')]=_0x5151ca[_0x88e8('0x51')]['id'];return _0x17b605;});return db[_0x88e8('0x74')][_0x88e8('0x75')](_0x3839ae,{'transaction':_0x71d5f});});})[_0x88e8('0x1b')](function(){return db[_0x88e8('0x74')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x5151ca[_0x88e8('0x51')]['id']},'order':_0x88e8('0x76')});});}})[_0x88e8('0x1b')](respondWithResult(_0x16f3dc,null))[_0x88e8('0x24')](handleError(_0x16f3dc,null));};exports['getApplications']=function(_0x47dec5,_0x47e80a,_0x4f9a82){var _0x2a5a2a={};var _0x86de1={};var _0x33e32b;var _0x59b0e5;return db[_0x88e8('0x3b')][_0x88e8('0x65')]({'where':{'id':_0x47dec5['params']['id']}})[_0x88e8('0x1b')](handleEntityNotFound(_0x47e80a,null))['then'](function(_0x37a88c){if(_0x37a88c){_0x33e32b=_0x37a88c;_0x86de1[_0x88e8('0x3e')]=_[_0x88e8('0x40')](db['WhatsappApplication'][_0x88e8('0x52')]);_0x86de1['query']=_[_0x88e8('0x40')](_0x47dec5[_0x88e8('0x3f')]);_0x86de1[_0x88e8('0x41')]=_[_0x88e8('0x42')](_0x86de1[_0x88e8('0x3e')],_0x86de1[_0x88e8('0x3f')]);_0x2a5a2a[_0x88e8('0x43')]=_[_0x88e8('0x42')](_0x86de1[_0x88e8('0x3e')],qs[_0x88e8('0x44')](_0x47dec5['query'][_0x88e8('0x44')]));_0x2a5a2a[_0x88e8('0x43')]=_0x2a5a2a['attributes'][_0x88e8('0x45')]?_0x2a5a2a[_0x88e8('0x43')]:_0x86de1[_0x88e8('0x3e')];_0x2a5a2a['order']=qs[_0x88e8('0x48')](_0x47dec5['query']['sort']);_0x2a5a2a['where']=qs['filters'](_[_0x88e8('0x49')](_0x47dec5[_0x88e8('0x3f')],_0x86de1[_0x88e8('0x41')]));if(_0x47dec5['query'][_0x88e8('0x4d')]){_0x2a5a2a[_0x88e8('0x4a')]=_['merge'](_0x2a5a2a[_0x88e8('0x4a')],{'$or':_['map'](_0x2a5a2a[_0x88e8('0x43')],function(_0x1d63a2){var _0x2f4a9c={};_0x2f4a9c[_0x1d63a2]={'$like':'%'+_0x47dec5[_0x88e8('0x3f')][_0x88e8('0x4d')]+'%'};return _0x2f4a9c;})});}_0x2a5a2a=_[_0x88e8('0x4b')]({},_0x2a5a2a,_0x47dec5[_0x88e8('0x4e')]);return _0x33e32b[_0x88e8('0x77')](_0x2a5a2a);}})[_0x88e8('0x1b')](function(_0x21f85b){if(_0x21f85b){_0x59b0e5=_0x21f85b[_0x88e8('0x45')];if(!_0x47dec5[_0x88e8('0x3f')][_0x88e8('0x46')](_0x88e8('0x47'))){_0x2a5a2a[_0x88e8('0x29')]=qs[_0x88e8('0x29')](_0x47dec5[_0x88e8('0x3f')]['limit']);_0x2a5a2a['offset']=qs[_0x88e8('0x27')](_0x47dec5[_0x88e8('0x3f')][_0x88e8('0x27')]);}return _0x33e32b['getApplications'](_0x2a5a2a);}})[_0x88e8('0x1b')](function(_0x5c8891){if(_0x5c8891){return _0x5c8891?{'count':_0x59b0e5,'rows':_0x5c8891}:null;}})['then'](respondWithResult(_0x47e80a,null))['catch'](handleError(_0x47e80a,null));};exports[_0x88e8('0x78')]=function(_0x23adbb,_0x42415d,_0x496902){var _0x22d6ca={'channel':'whatsapp'};var _0x501aac=[];var _0x78b0de=[];var _0xe45478={};return db[_0x88e8('0x3b')]['find']({'where':{'id':_0x23adbb[_0x88e8('0x51')]['id']},'include':[{'model':db[_0x88e8('0x74')],'as':'Applications'}]})[_0x88e8('0x1b')](handleEntityNotFound(_0x42415d,null))['then'](function(_0x3378a2){_0x22d6ca['account']=_0x3378a2;_0x22d6ca[_0x88e8('0x79')]=_[_0x88e8('0x7a')](_0x3378a2['Applications'],[_0x88e8('0x76')],[_0x88e8('0x7b')]);if(_0x22d6ca[_0x88e8('0x7c')][_0x88e8('0x7d')]){delete _0x22d6ca[_0x88e8('0x7c')][_0x88e8('0x7d')];}return db[_0x88e8('0x7e')][_0x88e8('0x5b')]();})[_0x88e8('0x1b')](function(_0x1900fd){if(!_0x1900fd){throw new db[(_0x88e8('0x7f'))]['ValidationError'](_0x88e8('0x80'));}_0x501aac=_[_0x88e8('0x81')](_[_0x88e8('0x40')](_0x1900fd),[_0x88e8('0x82'),'updatedAt']);_0x78b0de=_[_0x88e8('0x81')](_[_0x88e8('0x40')](_0x1900fd),[_0x88e8('0x82'),_0x88e8('0x83'),_0x88e8('0x84'),_0x88e8('0x85')]);_0x22d6ca['body']={'mapKey':_0x88e8('0x86')};if(_0x22d6ca[_0x88e8('0x7c')][_0x88e8('0x3c')]&&_0x22d6ca['account'][_0x88e8('0x3c')]===_0x88e8('0x87')){_0x22d6ca[_0x88e8('0x55')]['from']=_0x23adbb[_0x88e8('0x55')][_0x88e8('0x88')]['replace'](_0x88e8('0x89'),'');_0x22d6ca['body'][_0x88e8('0x55')]=_0x23adbb['body'][_0x88e8('0x8a')];_0x22d6ca['body'][_0x88e8('0x8b')]=_0x23adbb[_0x88e8('0x55')][_0x88e8('0x8c')];}if(_0x22d6ca['body']['id']){delete _0x22d6ca[_0x88e8('0x55')]['id'];}if(_['isNil'](_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x8d')])){throw new db['Sequelize']['ValidationError'](_0x88e8('0x8e'));}if(_[_0x88e8('0x8f')](_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x55')])||_0x22d6ca['body'][_0x88e8('0x55')]===''){throw new db[(_0x88e8('0x7f'))][(_0x88e8('0x90'))](_0x88e8('0x91'));}if(_['isNil'](_0x22d6ca['body'][_0x88e8('0x92')])){throw new db[(_0x88e8('0x7f'))][(_0x88e8('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x78b0de);}if(!_[_0x88e8('0x93')](_0x78b0de,_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x92')])){throw new db['Sequelize']['ValidationError'](_0x88e8('0x94')+_0x78b0de);}_0xe45478[_0x22d6ca['body'][_0x88e8('0x92')]]=_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x8d')];return db[_0x88e8('0x95')][_0x88e8('0x53')]({'where':{'id':_0x22d6ca['account']['ListId']},'include':[{'model':db[_0x88e8('0x7e')],'as':_0x88e8('0x96'),'where':_0xe45478,'limit':0x1,'order':[[_0x88e8('0x83'),_0x88e8('0x97')]]}]});})[_0x88e8('0x1b')](handleEntityNotFound(_0x42415d,null))['then'](function(_0x39a9dd){if(_0x39a9dd){_0x22d6ca[_0x88e8('0x98')]=_['omit'](_0x39a9dd,[_0x88e8('0x96')]);if(_0x39a9dd[_0x88e8('0x96')][_0x88e8('0x45')]){return _0x39a9dd['Contacts'][0x0];}var _0x4ce766=_['defaults'](_0x22d6ca['body'],{'firstName':_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x8d')],'ListId':_0x39a9dd['id']});_0x4ce766[_0x22d6ca['body'][_0x88e8('0x92')]]=_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x8d')];return db[_0x88e8('0x7e')][_0x88e8('0x54')](_0x4ce766,{'fields':_0x501aac,'raw':!![]});}})[_0x88e8('0x1b')](handleEntityNotFound(_0x42415d,null))[_0x88e8('0x1b')](function(_0x36be15){if(_0x36be15){_0x22d6ca[_0x88e8('0x99')]=_0x36be15;var _0x5340e4={'ContactId':_0x36be15['id'],'phone':_0x22d6ca['body'][_0x88e8('0x8d')],'WhatsappAccountId':_0x23adbb[_0x88e8('0x51')]['id']};var _0x3da905={'ContactId':_0x36be15['id'],'WhatsappAccountId':_0x23adbb[_0x88e8('0x51')]['id'],'closed':![]};return db[_0x88e8('0x9a')][_0x88e8('0x53')]({'where':_0x3da905})[_0x88e8('0x1b')](function(_0x1e210f){if(_0x1e210f){return[_0x1e210f,![]];}return db[_0x88e8('0x9a')][_0x88e8('0x54')](_0x5340e4)[_0x88e8('0x1b')](function(_0x2b4fe5){return[_0x2b4fe5,!![]];});});}})[_0x88e8('0x6a')](function(_0x3e368d,_0x5282bb){_0x22d6ca[_0x88e8('0x9b')]=_0x3e368d[_0x88e8('0x2f')]({'plain':!![]});_0x22d6ca[_0x88e8('0x9b')]['created']=![];if(_0x5282bb){if(_0x22d6ca[_0x88e8('0x7c')][_0x88e8('0x9c')]){_0x22d6ca[_0x88e8('0x79')]['push']({'id':0x0,'priority':_0x22d6ca['applications'][_0x88e8('0x45')]+0x1,'app':_0x88e8('0x9d'),'appdata':_0x88e8('0x9e'),'interval':_0x88e8('0x9f')});}_0x22d6ca['interaction']['created']=!![];}return db[_0x88e8('0xa0')][_0x88e8('0x54')]({'phone':_0x22d6ca['body'][_0x88e8('0x8d')],'messageId':_0x22d6ca[_0x88e8('0x55')][_0x88e8('0x8b')],'body':_0x22d6ca[_0x88e8('0x55')]['body'],'WhatsappAccountId':_0x23adbb['params']['id'],'WhatsappInteractionId':_0x3e368d['id'],'direction':'in','ContactId':_0x3e368d[_0x88e8('0xa1')],'AttachmentId':_0x22d6ca[_0x88e8('0x55')][_0x88e8('0xa2')]});})[_0x88e8('0x1b')](function(_0x323930){_0x22d6ca['message']=_0x323930;if(_0x22d6ca['interaction'][_0x88e8('0xa3')]){return db[_0x88e8('0x70')]['find']({'attributes':['id',_0x88e8('0x35')],'where':{'id':_0x22d6ca['interaction']['UserId']}})[_0x88e8('0x1b')](function(_0x558134){if(_0x558134){_0x22d6ca[_0x88e8('0x79')][_0x88e8('0xa4')]({'id':0x0,'priority':0x0,'app':_0x88e8('0xa5'),'appdata':_0x558134[_0x88e8('0x35')]+','+(_0x22d6ca[_0x88e8('0x7c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x88e8('0xa6'),'startRouting',_0x22d6ca);});}return respondWithRpcPromise(_0x88e8('0xa6'),_0x88e8('0xa7'),_0x22d6ca);})[_0x88e8('0x1b')](function(_0x292c7e){if(_0x292c7e){var _0xea2d31=0xc8;var _0x43cbcf='receiveMessage';logger['info'](_0x88e8('0x1e'),_0x43cbcf,_0xea2d31,_0x88e8('0xa8'));logger[_0x88e8('0xa9')](_0x88e8('0xaa'),_0x43cbcf,_0xea2d31,_0x88e8('0xa8'),JSON['stringify'](_0x292c7e));if(_0x22d6ca['account'][_0x88e8('0x3c')]==='twilio'){return _0x42415d[_0x88e8('0x32')](_0xea2d31)[_0x88e8('0x2b')](_0x88e8('0xab'),_0x88e8('0xac'))[_0x88e8('0x36')](_0x88e8('0xad'));}else{return _0x42415d['status'](_0xea2d31)['json'](_0x292c7e);}}})[_0x88e8('0x24')](handleError(_0x42415d,null));};exports[_0x88e8('0x36')]=function(_0xe10fc2,_0x3ea889,_0x2d797b){var _0x55fe50,_0x5773f7,_0xd27511;if(_[_0x88e8('0x8f')](_0xe10fc2[_0x88e8('0x55')][_0x88e8('0x55')])||_0xe10fc2[_0x88e8('0x55')][_0x88e8('0x55')]===''){throw new db[(_0x88e8('0x7f'))][(_0x88e8('0x90'))](_0x88e8('0x91'));}if(_[_0x88e8('0x8f')](_0xe10fc2[_0x88e8('0x55')]['to'])){throw new db['Sequelize'][(_0x88e8('0x90'))](_0x88e8('0xae'));}_0x55fe50=_0xe10fc2[_0x88e8('0x55')]['to'];return db[_0x88e8('0x3b')][_0x88e8('0x53')]({'where':{'id':_0xe10fc2[_0x88e8('0x51')]['id']},'include':[{'model':db[_0x88e8('0x95')],'as':'List','include':[{'model':db[_0x88e8('0x7e')],'as':_0x88e8('0x96'),'where':{'mobile':_0x55fe50},'limit':0x1,'order':[[_0x88e8('0x83'),_0x88e8('0x97')]]}]}]})[_0x88e8('0x1b')](handleEntityNotFound(_0x3ea889,null))['then'](function(_0x21ce9d){if(_0x21ce9d&&_0x21ce9d['List']){_0x5773f7=_0x21ce9d['get']({'plain':!![]});if(_0x5773f7['List']&&_0x5773f7['List'][_0x88e8('0x96')][_0x88e8('0x45')]){return _0x5773f7[_0x88e8('0xaf')][_0x88e8('0x96')][0x0];}return db[_0x88e8('0x7e')][_0x88e8('0x54')](_['defaults'](_0xe10fc2[_0x88e8('0x55')],{'firstName':_0x55fe50,'mobile':_0x55fe50,'phone':_0x55fe50,'ListId':_0x5773f7[_0x88e8('0x85')]}));}})['then'](handleEntityNotFound(_0x3ea889,null))[_0x88e8('0x1b')](function(_0x115c44){if(_0x115c44){_0xd27511=_0x115c44;return db[_0x88e8('0x9a')][_0x88e8('0x53')]({'where':{'ContactId':_0xd27511['id'],'closed':![],'WhatsappAccountId':_0x5773f7['id']}})[_0x88e8('0x1b')](function(_0x366741){if(_0x366741){return[_0x366741,![]];}return db[_0x88e8('0x9a')][_0x88e8('0x54')]({'UserId':_0xe10fc2[_0x88e8('0x56')]['id'],'ContactId':_0xd27511['id'],'WhatsappAccountId':_0x5773f7['id'],'phone':_0x55fe50,'firstMsgDirection':_0x88e8('0xb0'),'Messages':[_['merge'](_0xe10fc2[_0x88e8('0x55')],{'read':![],'body':_0xe10fc2[_0x88e8('0x55')]['body'],'phone':_0x55fe50,'WhatsappAccountId':_0x5773f7['id'],'UserId':_0xe10fc2[_0x88e8('0x56')]['id'],'ContactId':_0xd27511['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x88e8('0xb1')}]})[_0x88e8('0x1b')](function(_0x454f1a){return[_0x454f1a,!![]];});});}})[_0x88e8('0x6a')](function(_0x3a9eef,_0x1ba163){if(_0x1ba163){return _0x3a9eef;}return db[_0x88e8('0xa0')][_0x88e8('0x54')](_[_0x88e8('0x4b')](_0xe10fc2[_0x88e8('0x55')],{'read':![],'body':_0xe10fc2[_0x88e8('0x55')][_0x88e8('0x55')],'phone':_0x55fe50,'WhatsappAccountId':_0x5773f7['id'],'WhatsappInteractionId':_0x3a9eef['id'],'UserId':_0xe10fc2[_0x88e8('0x56')]['id'],'ContactId':_0xd27511['id']}))[_0x88e8('0x1b')](function(_0x39d4c0){_0x3a9eef['dataValues'][_0x88e8('0xb1')]=[];_0x3a9eef[_0x88e8('0xb2')][_0x88e8('0xb1')][_0x88e8('0xb3')](_0x39d4c0['dataValues']);return _0x3a9eef;});})[_0x88e8('0x1b')](respondWithResult(_0x3ea889,null))['catch'](handleError(_0x3ea889,null));};
\ No newline at end of file
index 124b008..8137038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26d=['emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x45afc1,_0x52a029){var _0x182539=function(_0x547e72){while(--_0x547e72){_0x45afc1['push'](_0x45afc1['shift']());}};_0x182539(++_0x52a029);}(_0xd26d,0x108));var _0xdd26=function(_0x309cbc,_0x543e8f){_0x309cbc=_0x309cbc-0x0;var _0x2ac832=_0xd26d[_0x309cbc];return _0x2ac832;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xdd26('0x0'))['db'][_0xdd26('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xdd26('0x2')](0x0);var events={'afterCreate':_0xdd26('0x3'),'afterUpdate':_0xdd26('0x4'),'afterDestroy':_0xdd26('0x5')};function emitEvent(_0xfeccbf){return function(_0xffa247,_0x5d7819,_0x36066f){WhatsappAccountEvents[_0xdd26('0x6')](_0xfeccbf+':'+_0xffa247['id'],_0xffa247);WhatsappAccountEvents[_0xdd26('0x6')](_0xfeccbf,_0xffa247);_0x36066f(null);};}for(var e in events){if(events[_0xdd26('0x7')](e)){var event=events[e];WhatsappAccount[_0xdd26('0x8')](e,emitEvent(event));}}module[_0xdd26('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x7949=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x35196e,_0x2f9366){var _0x14535f=function(_0x269b6d){while(--_0x269b6d){_0x35196e['push'](_0x35196e['shift']());}};_0x14535f(++_0x2f9366);}(_0x7949,0x124));var _0x9794=function(_0x3392e5,_0x2f7c7d){_0x3392e5=_0x3392e5-0x0;var _0x3506e8=_0x7949[_0x3392e5];return _0x3506e8;};'use strict';var EventEmitter=require(_0x9794('0x0'));var WhatsappAccount=require(_0x9794('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9794('0x2')](0x0);var events={'afterCreate':_0x9794('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44502e){return function(_0x176645,_0x53971a,_0x67a39a){WhatsappAccountEvents[_0x9794('0x4')](_0x44502e+':'+_0x176645['id'],_0x176645);WhatsappAccountEvents[_0x9794('0x4')](_0x44502e,_0x176645);_0x67a39a(null);};}for(var e in events){if(events[_0x9794('0x5')](e)){var event=events[e];WhatsappAccount[_0x9794('0x6')](e,emitEvent(event));}}module[_0x9794('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index b7fba8e..597b7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7199=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes'];(function(_0x413f7d,_0x2c5f5c){var _0x1d3a25=function(_0x4f3179){while(--_0x4f3179){_0x413f7d['push'](_0x413f7d['shift']());}};_0x1d3a25(++_0x2c5f5c);}(_0x7199,0xf8));var _0x9719=function(_0x23834c,_0x5a42db){_0x23834c=_0x23834c-0x0;var _0x4a5ff4=_0x7199[_0x23834c];return _0x4a5ff4;};'use strict';var _=require('lodash');var util=require(_0x9719('0x0'));var logger=require('../../config/logger')(_0x9719('0x1'));var moment=require(_0x9719('0x2'));var BPromise=require(_0x9719('0x3'));var rp=require(_0x9719('0x4'));var fs=require('fs');var path=require(_0x9719('0x5'));var rimraf=require(_0x9719('0x6'));var config=require('../../config/environment');var attributes=require(_0x9719('0x7'));module['exports']=function(_0x1a38f7,_0x42e58a){return _0x1a38f7['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76d3=['api','moment','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger'];(function(_0x220013,_0x2f41eb){var _0x4558d6=function(_0x2a2c60){while(--_0x2a2c60){_0x220013['push'](_0x220013['shift']());}};_0x4558d6(++_0x2f41eb);}(_0x76d3,0x6a));var _0x376d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x76d3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x376d('0x0'));var logger=require(_0x376d('0x1'))(_0x376d('0x2'));var moment=require(_0x376d('0x3'));var BPromise=require('bluebird');var rp=require(_0x376d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x376d('0x5'));var config=require(_0x376d('0x6'));var attributes=require(_0x376d('0x7'));module[_0x376d('0x8')]=function(_0x19b073,_0xb42634){return _0x19b073[_0x376d('0x9')](_0x376d('0xa'),attributes,{'tableName':_0x376d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac86d3d..19d860f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe154=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','WhatsappAccount','find','options','raw','where','attributes','include','model','map','then','ShowWhatsappAccount','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xe154,0x6b));var _0x4e15=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xe154[_0x2891d1];return _0x486948;};'use strict';var _=require(_0x4e15('0x0'));var util=require('util');var moment=require(_0x4e15('0x1'));var BPromise=require(_0x4e15('0x2'));var rs=require(_0x4e15('0x3'));var fs=require('fs');var Redis=require(_0x4e15('0x4'));var db=require(_0x4e15('0x5'))['db'];var utils=require(_0x4e15('0x6'));var logger=require(_0x4e15('0x7'))(_0x4e15('0x8'));var config=require(_0x4e15('0x9'));var jayson=require(_0x4e15('0xa'));var client=jayson[_0x4e15('0xb')]['http']({'port':0x232a});config[_0x4e15('0xc')]=_[_0x4e15('0xd')](config['redis'],{'host':_0x4e15('0xe'),'port':0x18eb});var socket=require(_0x4e15('0xf'))(new Redis(config['redis']));require(_0x4e15('0x10'))['register'](socket);function respondWithRpcPromise(_0x408ac9,_0x27c4db,_0x289aac){return new BPromise(function(_0xf1e141,_0x46c487){return client['request'](_0x408ac9,_0x289aac)['then'](function(_0x2ba239){logger[_0x4e15('0x11')](_0x4e15('0x12'),_0x27c4db,_0x4e15('0x13'));logger[_0x4e15('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x27c4db,'request\x20sent',JSON['stringify'](_0x2ba239));if(_0x2ba239[_0x4e15('0x15')]){if(_0x2ba239[_0x4e15('0x15')][_0x4e15('0x16')]===0x1f4){logger[_0x4e15('0x15')](_0x4e15('0x12'),_0x27c4db,_0x2ba239[_0x4e15('0x15')][_0x4e15('0x17')]);return _0x46c487(_0x2ba239[_0x4e15('0x15')][_0x4e15('0x17')]);}logger[_0x4e15('0x15')](_0x4e15('0x12'),_0x27c4db,_0x2ba239[_0x4e15('0x15')][_0x4e15('0x17')]);return _0xf1e141(_0x2ba239[_0x4e15('0x15')]['message']);}else{logger[_0x4e15('0x11')](_0x4e15('0x12'),_0x27c4db,'request\x20sent');_0xf1e141(_0x2ba239[_0x4e15('0x18')]['message']);}})['catch'](function(_0x414ccf){logger['error'](_0x4e15('0x12'),_0x27c4db,_0x414ccf);_0x46c487(_0x414ccf);});});}exports['ShowWhatsappAccount']=function(_0x5d79da){var _0x11fd67=this;return new Promise(function(_0x26f4df,_0x28fc99){return db[_0x4e15('0x19')][_0x4e15('0x1a')]({'raw':_0x5d79da['options']?_0x5d79da[_0x4e15('0x1b')][_0x4e15('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d79da[_0x4e15('0x1b')]?_0x5d79da[_0x4e15('0x1b')][_0x4e15('0x1d')]||null:null,'attributes':_0x5d79da[_0x4e15('0x1b')]?_0x5d79da[_0x4e15('0x1b')][_0x4e15('0x1e')]||null:null,'include':_0x5d79da[_0x4e15('0x1b')]?_0x5d79da[_0x4e15('0x1b')][_0x4e15('0x1f')]?_['map'](_0x5d79da['options'][_0x4e15('0x1f')],function(_0x8d8d0){return{'model':db[_0x8d8d0[_0x4e15('0x20')]],'as':_0x8d8d0['as'],'attributes':_0x8d8d0['attributes'],'include':_0x8d8d0[_0x4e15('0x1f')]?_['map'](_0x8d8d0[_0x4e15('0x1f')],function(_0xe8d1b9){return{'model':db[_0xe8d1b9['model']],'as':_0xe8d1b9['as'],'attributes':_0xe8d1b9[_0x4e15('0x1e')],'include':_0xe8d1b9[_0x4e15('0x1f')]?_[_0x4e15('0x21')](_0xe8d1b9['include'],function(_0x35f26d){return{'model':db[_0x35f26d['model']],'as':_0x35f26d['as'],'attributes':_0x35f26d[_0x4e15('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4e15('0x22')](function(_0xe9197d){logger[_0x4e15('0x11')](_0x4e15('0x23'),_0x5d79da);logger[_0x4e15('0x14')](_0x4e15('0x23'),_0x5d79da,JSON[_0x4e15('0x24')](_0xe9197d));_0x26f4df(_0xe9197d);})[_0x4e15('0x25')](function(_0x4b5387){logger[_0x4e15('0x15')](_0x4e15('0x23'),_0x4b5387[_0x4e15('0x17')],_0x5d79da);_0x28fc99(_0x11fd67['error'](0x1f4,_0x4b5387[_0x4e15('0x17')]));});});};
\ No newline at end of file
+var _0x9b16=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','model','include','map','lodash','moment','bluebird','randomstring'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0x9b16,0x16e));var _0x69b1=function(_0x185bc4,_0x2c98c7){_0x185bc4=_0x185bc4-0x0;var _0x3843c1=_0x9b16[_0x185bc4];return _0x3843c1;};'use strict';var _=require(_0x69b1('0x0'));var util=require('util');var moment=require(_0x69b1('0x1'));var BPromise=require(_0x69b1('0x2'));var rs=require(_0x69b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69b1('0x4'))['db'];var utils=require(_0x69b1('0x5'));var logger=require(_0x69b1('0x6'))(_0x69b1('0x7'));var config=require(_0x69b1('0x8'));var jayson=require(_0x69b1('0x9'));var client=jayson[_0x69b1('0xa')]['http']({'port':0x232a});config[_0x69b1('0xb')]=_[_0x69b1('0xc')](config[_0x69b1('0xb')],{'host':_0x69b1('0xd'),'port':0x18eb});var socket=require(_0x69b1('0xe'))(new Redis(config[_0x69b1('0xb')]));require(_0x69b1('0xf'))[_0x69b1('0x10')](socket);function respondWithRpcPromise(_0x2a4211,_0x3196a2,_0x40db97){return new BPromise(function(_0x32a62b,_0x3297ea){return client['request'](_0x2a4211,_0x40db97)[_0x69b1('0x11')](function(_0x1db935){logger[_0x69b1('0x12')](_0x69b1('0x13'),_0x3196a2,'request\x20sent');logger[_0x69b1('0x14')](_0x69b1('0x15'),_0x3196a2,'request\x20sent',JSON[_0x69b1('0x16')](_0x1db935));if(_0x1db935[_0x69b1('0x17')]){if(_0x1db935[_0x69b1('0x17')][_0x69b1('0x18')]===0x1f4){logger[_0x69b1('0x17')](_0x69b1('0x13'),_0x3196a2,_0x1db935[_0x69b1('0x17')][_0x69b1('0x19')]);return _0x3297ea(_0x1db935[_0x69b1('0x17')]['message']);}logger[_0x69b1('0x17')](_0x69b1('0x13'),_0x3196a2,_0x1db935['error'][_0x69b1('0x19')]);return _0x32a62b(_0x1db935['error'][_0x69b1('0x19')]);}else{logger[_0x69b1('0x12')](_0x69b1('0x13'),_0x3196a2,'request\x20sent');_0x32a62b(_0x1db935[_0x69b1('0x1a')][_0x69b1('0x19')]);}})[_0x69b1('0x1b')](function(_0x32119e){logger[_0x69b1('0x17')](_0x69b1('0x13'),_0x3196a2,_0x32119e);_0x3297ea(_0x32119e);});});}exports[_0x69b1('0x1c')]=function(_0x296716){var _0x5aaee1=this;return new Promise(function(_0x35309c,_0x560fe0){return db[_0x69b1('0x1d')]['find']({'raw':_0x296716[_0x69b1('0x1e')]?_0x296716[_0x69b1('0x1e')][_0x69b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x296716[_0x69b1('0x1e')]?_0x296716[_0x69b1('0x1e')][_0x69b1('0x20')]||null:null,'attributes':_0x296716[_0x69b1('0x1e')]?_0x296716['options'][_0x69b1('0x21')]||null:null,'include':_0x296716[_0x69b1('0x1e')]?_0x296716['options']['include']?_['map'](_0x296716[_0x69b1('0x1e')]['include'],function(_0x1e4c21){return{'model':db[_0x1e4c21[_0x69b1('0x22')]],'as':_0x1e4c21['as'],'attributes':_0x1e4c21[_0x69b1('0x21')],'include':_0x1e4c21['include']?_['map'](_0x1e4c21[_0x69b1('0x23')],function(_0x25580a){return{'model':db[_0x25580a['model']],'as':_0x25580a['as'],'attributes':_0x25580a['attributes'],'include':_0x25580a[_0x69b1('0x23')]?_[_0x69b1('0x24')](_0x25580a[_0x69b1('0x23')],function(_0x3b8bff){return{'model':db[_0x3b8bff[_0x69b1('0x22')]],'as':_0x3b8bff['as'],'attributes':_0x3b8bff[_0x69b1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x69b1('0x11')](function(_0x1791f6){logger[_0x69b1('0x12')](_0x69b1('0x1c'),_0x296716);logger['debug']('ShowWhatsappAccount',_0x296716,JSON['stringify'](_0x1791f6));_0x35309c(_0x1791f6);})[_0x69b1('0x1b')](function(_0x1147b6){logger[_0x69b1('0x17')](_0x69b1('0x1c'),_0x1147b6[_0x69b1('0x19')],_0x296716);_0x560fe0(_0x5aaee1[_0x69b1('0x17')](0x1f4,_0x1147b6['message']));});});};
\ No newline at end of file
index 17e4645..69c13a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa06a=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x2db313,_0x2a305f){var _0x451f6b=function(_0x5d24ef){while(--_0x5d24ef){_0x2db313['push'](_0x2db313['shift']());}};_0x451f6b(++_0x2a305f);}(_0xa06a,0x1e7));var _0xaa06=function(_0x3e4757,_0x2aa478){_0x3e4757=_0x3e4757-0x0;var _0x295dc4=_0xa06a[_0x3e4757];return _0x295dc4;};'use strict';var WhatsappAccountEvents=require(_0xaa06('0x0'));var events=['save',_0xaa06('0x1'),_0xaa06('0x2')];function createListener(_0x4bfcef,_0x364dc9){return function(_0x429156){_0x364dc9[_0xaa06('0x3')](_0x4bfcef,_0x429156);};}function removeListener(_0x25d69c,_0x3d8ddd){return function(){WhatsappAccountEvents[_0xaa06('0x4')](_0x25d69c,_0x3d8ddd);};}exports[_0xaa06('0x5')]=function(_0x4c4264){for(var _0x17c281=0x0,_0x35576e=events[_0xaa06('0x6')];_0x17c281<_0x35576e;_0x17c281++){var _0x14c33d=events[_0x17c281];var _0x2f6a05=createListener(_0xaa06('0x7')+_0x14c33d,_0x4c4264);WhatsappAccountEvents['on'](_0x14c33d,_0x2f6a05);}};
\ No newline at end of file
+var _0x40c5=['save','emit','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x2682e5,_0x4966ed){var _0x58e944=function(_0x4346c8){while(--_0x4346c8){_0x2682e5['push'](_0x2682e5['shift']());}};_0x58e944(++_0x4966ed);}(_0x40c5,0x68));var _0x540c=function(_0x559f1c,_0x341ff2){_0x559f1c=_0x559f1c-0x0;var _0x3e240d=_0x40c5[_0x559f1c];return _0x3e240d;};'use strict';var WhatsappAccountEvents=require(_0x540c('0x0'));var events=[_0x540c('0x1'),'remove','update'];function createListener(_0x241ab1,_0x221f68){return function(_0x379de7){_0x221f68[_0x540c('0x2')](_0x241ab1,_0x379de7);};}function removeListener(_0x5d057c,_0x1ed877){return function(){WhatsappAccountEvents['removeListener'](_0x5d057c,_0x1ed877);};}exports[_0x540c('0x3')]=function(_0x52b29b){for(var _0x2dfe91=0x0,_0x580b95=events['length'];_0x2dfe91<_0x580b95;_0x2dfe91++){var _0x424bd1=events[_0x2dfe91];var _0x49a712=createListener(_0x540c('0x4')+_0x424bd1,_0x52b29b);WhatsappAccountEvents['on'](_0x424bd1,_0x49a712);}};
\ No newline at end of file
index c89c5f0..085e68e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24fb=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x36ca5e,_0x532649){var _0x185857=function(_0x678640){while(--_0x678640){_0x36ca5e['push'](_0x36ca5e['shift']());}};_0x185857(++_0x532649);}(_0x24fb,0x14c));var _0xb24f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24fb[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb24f('0x0'));var util=require(_0xb24f('0x1'));var path=require(_0xb24f('0x2'));var timeout=require(_0xb24f('0x3'));var express=require(_0xb24f('0x4'));var router=express[_0xb24f('0x5')]();var fs_extra=require(_0xb24f('0x6'));var auth=require(_0xb24f('0x7'));var interaction=require(_0xb24f('0x8'));var config=require(_0xb24f('0x9'));var controller=require(_0xb24f('0xa'));router['get']('/',auth[_0xb24f('0xb')](),controller[_0xb24f('0xc')]);router['get'](_0xb24f('0xd'),auth[_0xb24f('0xb')](),controller[_0xb24f('0xe')]);router[_0xb24f('0xf')]('/',auth[_0xb24f('0xb')](),controller[_0xb24f('0x10')]);router[_0xb24f('0x11')]('/:id',auth[_0xb24f('0xb')](),controller[_0xb24f('0x12')]);router[_0xb24f('0x13')]('/:id',auth[_0xb24f('0xb')](),controller[_0xb24f('0x14')]);module[_0xb24f('0x15')]=router;
\ No newline at end of file
+var _0xf935=['get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller'];(function(_0x2d50be,_0x4e2d7c){var _0x2d3545=function(_0x51a02c){while(--_0x51a02c){_0x2d50be['push'](_0x2d50be['shift']());}};_0x2d3545(++_0x4e2d7c);}(_0xf935,0x81));var _0x5f93=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf935[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f93('0x0'));var timeout=require(_0x5f93('0x1'));var express=require(_0x5f93('0x2'));var router=express[_0x5f93('0x3')]();var fs_extra=require(_0x5f93('0x4'));var auth=require(_0x5f93('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f93('0x6'));router[_0x5f93('0x7')]('/',auth[_0x5f93('0x8')](),controller[_0x5f93('0x9')]);router[_0x5f93('0x7')](_0x5f93('0xa'),auth[_0x5f93('0x8')](),controller['show']);router[_0x5f93('0xb')]('/',auth[_0x5f93('0x8')](),controller[_0x5f93('0xc')]);router['put'](_0x5f93('0xa'),auth[_0x5f93('0x8')](),controller[_0x5f93('0xd')]);router[_0x5f93('0xe')](_0x5f93('0xa'),auth['isAuthenticated'](),controller[_0x5f93('0xf')]);module[_0x5f93('0x10')]=router;
\ No newline at end of file
index 6e2d6b8..8ca0134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddc4=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x1eaf33,_0x28e6c7){var _0x2c04e3=function(_0x31a122){while(--_0x31a122){_0x1eaf33['push'](_0x1eaf33['shift']());}};_0x2c04e3(++_0x28e6c7);}(_0xddc4,0x6e));var _0x4ddc=function(_0x21eb04,_0x44cb7f){_0x21eb04=_0x21eb04-0x0;var _0x11b38a=_0xddc4[_0x21eb04];return _0x11b38a;};'use strict';var Sequelize=require('sequelize');module[_0x4ddc('0x0')]={'priority':{'type':Sequelize[_0x4ddc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4ddc('0x2')],'allowNull':![],'defaultValue':_0x4ddc('0x3')},'appdata':{'type':Sequelize[_0x4ddc('0x4')]()},'description':{'type':Sequelize[_0x4ddc('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4ddc('0x5')}};
\ No newline at end of file
+var _0x0dd7=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x0dd7,0x1eb));var _0x70dd=function(_0x3987a1,_0x447793){_0x3987a1=_0x3987a1-0x0;var _0xe2596e=_0x0dd7[_0x3987a1];return _0xe2596e;};'use strict';var Sequelize=require('sequelize');module[_0x70dd('0x0')]={'priority':{'type':Sequelize[_0x70dd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x70dd('0x2')],'allowNull':![],'defaultValue':_0x70dd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x70dd('0x4')}};
\ No newline at end of file
index 6f068b7..8057036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d91=['count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','WhatsappApplication','includeAll','include','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0xa26fff,_0x852e4e){var _0x44abf1=function(_0x3864ee){while(--_0x3864ee){_0xa26fff['push'](_0xa26fff['shift']());}};_0x44abf1(++_0x852e4e);}(_0x0d91,0x76));var _0x10d9=function(_0x4222e4,_0x25096f){_0x4222e4=_0x4222e4-0x0;var _0x4bfa29=_0x0d91[_0x4222e4];return _0x4bfa29;};'use strict';var emlformat=require(_0x10d9('0x0'));var rimraf=require(_0x10d9('0x1'));var zipdir=require(_0x10d9('0x2'));var jsonpatch=require(_0x10d9('0x3'));var rp=require('request-promise');var moment=require(_0x10d9('0x4'));var BPromise=require(_0x10d9('0x5'));var Mustache=require(_0x10d9('0x6'));var util=require('util');var path=require(_0x10d9('0x7'));var sox=require(_0x10d9('0x8'));var csv=require(_0x10d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10d9('0xa'));var _=require(_0x10d9('0xb'));var squel=require(_0x10d9('0xc'));var crypto=require(_0x10d9('0xd'));var jsforce=require(_0x10d9('0xe'));var deskjs=require(_0x10d9('0xf'));var toCsv=require(_0x10d9('0x9'));var querystring=require(_0x10d9('0x10'));var Papa=require(_0x10d9('0x11'));var Redis=require(_0x10d9('0x12'));var authService=require(_0x10d9('0x13'));var qs=require(_0x10d9('0x14'));var as=require(_0x10d9('0x15'));var hardwareService=require(_0x10d9('0x16'));var logger=require(_0x10d9('0x17'))(_0x10d9('0x18'));var utils=require(_0x10d9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x10d9('0x1a'));var db=require(_0x10d9('0x1b'))['db'];function respondWithStatusCode(_0x12a2b4,_0x2910ab){_0x2910ab=_0x2910ab||0xcc;return function(_0x316417){if(_0x316417){return _0x12a2b4['sendStatus'](_0x2910ab);}return _0x12a2b4[_0x10d9('0x1c')](_0x2910ab)['end']();};}function respondWithResult(_0x436773,_0x1035b1){_0x1035b1=_0x1035b1||0xc8;return function(_0x1b3cf5){if(_0x1b3cf5){return _0x436773[_0x10d9('0x1c')](_0x1035b1)[_0x10d9('0x1d')](_0x1b3cf5);}};}function respondWithFilteredResult(_0x198778,_0x211df6){return function(_0x2a6587){if(_0x2a6587){var _0x453d22=typeof _0x211df6[_0x10d9('0x1e')]==='undefined'&&typeof _0x211df6['limit']===_0x10d9('0x1f');var _0x21b1ac=_0x2a6587[_0x10d9('0x20')];var _0x1e9db9=_0x453d22?0x0:_0x211df6['offset'];var _0x3f5819=_0x453d22?_0x2a6587[_0x10d9('0x20')]:_0x211df6[_0x10d9('0x1e')]+_0x211df6[_0x10d9('0x21')];var _0x5c7014;if(_0x3f5819>=_0x21b1ac){_0x3f5819=_0x21b1ac;_0x5c7014=0xc8;}else{_0x5c7014=0xce;}_0x198778[_0x10d9('0x1c')](_0x5c7014);return _0x198778[_0x10d9('0x22')]('Content-Range',_0x1e9db9+'-'+_0x3f5819+'/'+_0x21b1ac)['json'](_0x2a6587);}return null;};}function patchUpdates(_0x25f950){return function(_0x48940c){try{jsonpatch[_0x10d9('0x23')](_0x48940c,_0x25f950,!![]);}catch(_0x1e84ba){return BPromise['reject'](_0x1e84ba);}return _0x48940c[_0x10d9('0x24')]();};}function saveUpdates(_0x2c1346,_0x3e7a25){return function(_0x1bf9fa){if(_0x1bf9fa){return _0x1bf9fa[_0x10d9('0x25')](_0x2c1346)[_0x10d9('0x26')](function(_0x26ff84){return _0x26ff84;});}return null;};}function removeEntity(_0x3a2e97,_0x13a3e0){return function(_0x11514e){if(_0x11514e){return _0x11514e[_0x10d9('0x27')]()[_0x10d9('0x26')](function(){_0x3a2e97[_0x10d9('0x1c')](0xcc)[_0x10d9('0x28')]();});}};}function handleEntityNotFound(_0x76e43d,_0x4ff086){return function(_0x14c4ec){if(!_0x14c4ec){_0x76e43d[_0x10d9('0x29')](0x194);}return _0x14c4ec;};}function handleError(_0xce87ca,_0x96a5c){_0x96a5c=_0x96a5c||0x1f4;return function(_0x4b2619){logger[_0x10d9('0x2a')](_0x4b2619[_0x10d9('0x2b')]);if(_0x4b2619[_0x10d9('0x2c')]){delete _0x4b2619[_0x10d9('0x2c')];}_0xce87ca[_0x10d9('0x1c')](_0x96a5c)[_0x10d9('0x2d')](_0x4b2619);};}exports['index']=function(_0x3bc593,_0x4cfc1c){var _0x26850c={},_0x3ec714={},_0x1e2c7e={'count':0x0,'rows':[]};var _0x8066b2=_[_0x10d9('0x2e')](db['WhatsappApplication']['rawAttributes'],function(_0x1108f5){return{'name':_0x1108f5[_0x10d9('0x2f')],'type':_0x1108f5['type']['key']};});_0x3ec714[_0x10d9('0x30')]=_[_0x10d9('0x2e')](_0x8066b2,_0x10d9('0x2c'));_0x3ec714['query']=_[_0x10d9('0x31')](_0x3bc593['query']);_0x3ec714[_0x10d9('0x32')]=_[_0x10d9('0x33')](_0x3ec714['model'],_0x3ec714['query']);_0x26850c[_0x10d9('0x34')]=_[_0x10d9('0x33')](_0x3ec714['model'],qs[_0x10d9('0x35')](_0x3bc593[_0x10d9('0x36')]['fields']));_0x26850c[_0x10d9('0x34')]=_0x26850c[_0x10d9('0x34')][_0x10d9('0x37')]?_0x26850c['attributes']:_0x3ec714[_0x10d9('0x30')];if(!_0x3bc593[_0x10d9('0x36')][_0x10d9('0x38')]('nolimit')){_0x26850c[_0x10d9('0x21')]=qs[_0x10d9('0x21')](_0x3bc593['query'][_0x10d9('0x21')]);_0x26850c[_0x10d9('0x1e')]=qs[_0x10d9('0x1e')](_0x3bc593[_0x10d9('0x36')][_0x10d9('0x1e')]);}_0x26850c[_0x10d9('0x39')]=qs['sort'](_0x3bc593['query']['sort']);_0x26850c[_0x10d9('0x3a')]=qs[_0x10d9('0x32')](_[_0x10d9('0x3b')](_0x3bc593[_0x10d9('0x36')],_0x3ec714[_0x10d9('0x32')]),_0x8066b2);if(_0x3bc593['query'][_0x10d9('0x3c')]){_0x26850c[_0x10d9('0x3a')]=_[_0x10d9('0x3d')](_0x26850c[_0x10d9('0x3a')],{'$or':_['map'](_0x8066b2,function(_0x366678){if(_0x366678[_0x10d9('0x3e')]!==_0x10d9('0x3f')){var _0x36a13f={};_0x36a13f[_0x366678[_0x10d9('0x2c')]]={'$like':'%'+_0x3bc593[_0x10d9('0x36')]['filter']+'%'};return _0x36a13f;}})});}_0x26850c=_[_0x10d9('0x3d')]({},_0x26850c,_0x3bc593[_0x10d9('0x40')]);var _0x2c69dc={'where':_0x26850c[_0x10d9('0x3a')]};return db[_0x10d9('0x41')][_0x10d9('0x20')](_0x2c69dc)[_0x10d9('0x26')](function(_0x3dfc2f){_0x1e2c7e[_0x10d9('0x20')]=_0x3dfc2f;if(_0x3bc593['query'][_0x10d9('0x42')]){_0x26850c[_0x10d9('0x43')]=[{'all':!![]}];}return db[_0x10d9('0x41')]['findAll'](_0x26850c);})[_0x10d9('0x26')](function(_0x87e05a){_0x1e2c7e['rows']=_0x87e05a;return _0x1e2c7e;})[_0x10d9('0x26')](respondWithFilteredResult(_0x4cfc1c,_0x26850c))[_0x10d9('0x44')](handleError(_0x4cfc1c,null));};exports[_0x10d9('0x45')]=function(_0x634e36,_0x285981){var _0x16b4c4={'raw':!![],'where':{'id':_0x634e36[_0x10d9('0x46')]['id']}},_0x2d36d9={};_0x2d36d9[_0x10d9('0x30')]=_[_0x10d9('0x31')](db['WhatsappApplication'][_0x10d9('0x47')]);_0x2d36d9[_0x10d9('0x36')]=_[_0x10d9('0x31')](_0x634e36[_0x10d9('0x36')]);_0x2d36d9[_0x10d9('0x32')]=_[_0x10d9('0x33')](_0x2d36d9[_0x10d9('0x30')],_0x2d36d9[_0x10d9('0x36')]);_0x16b4c4[_0x10d9('0x34')]=_[_0x10d9('0x33')](_0x2d36d9[_0x10d9('0x30')],qs[_0x10d9('0x35')](_0x634e36[_0x10d9('0x36')]['fields']));_0x16b4c4['attributes']=_0x16b4c4[_0x10d9('0x34')][_0x10d9('0x37')]?_0x16b4c4[_0x10d9('0x34')]:_0x2d36d9[_0x10d9('0x30')];if(_0x634e36[_0x10d9('0x36')][_0x10d9('0x42')]){_0x16b4c4['include']=[{'all':!![]}];}_0x16b4c4=_['merge']({},_0x16b4c4,_0x634e36[_0x10d9('0x40')]);return db[_0x10d9('0x41')]['find'](_0x16b4c4)[_0x10d9('0x26')](handleEntityNotFound(_0x285981,null))[_0x10d9('0x26')](respondWithResult(_0x285981,null))[_0x10d9('0x44')](handleError(_0x285981,null));};exports[_0x10d9('0x48')]=function(_0x41dc86,_0x4fc6b4){return db[_0x10d9('0x41')][_0x10d9('0x48')](_0x41dc86[_0x10d9('0x49')],{})[_0x10d9('0x26')](respondWithResult(_0x4fc6b4,0xc9))[_0x10d9('0x44')](handleError(_0x4fc6b4,null));};exports['update']=function(_0x2ac008,_0x30d8e2){if(_0x2ac008[_0x10d9('0x49')]['id']){delete _0x2ac008['body']['id'];}return db['WhatsappApplication'][_0x10d9('0x4a')]({'where':{'id':_0x2ac008[_0x10d9('0x46')]['id']}})[_0x10d9('0x26')](handleEntityNotFound(_0x30d8e2,null))[_0x10d9('0x26')](saveUpdates(_0x2ac008[_0x10d9('0x49')],null))[_0x10d9('0x26')](respondWithResult(_0x30d8e2,null))[_0x10d9('0x44')](handleError(_0x30d8e2,null));};exports[_0x10d9('0x27')]=function(_0x3b8108,_0x50826f){return db[_0x10d9('0x41')][_0x10d9('0x4a')]({'where':{'id':_0x3b8108[_0x10d9('0x46')]['id']}})[_0x10d9('0x26')](handleEntityNotFound(_0x50826f,null))[_0x10d9('0x26')](removeEntity(_0x50826f,null))[_0x10d9('0x44')](handleError(_0x50826f,null));};
\ No newline at end of file
+var _0x6209=['sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','findAll','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x2fece9,_0x1e00e6){var _0x3ea16e=function(_0x3ca2eb){while(--_0x3ca2eb){_0x2fece9['push'](_0x2fece9['shift']());}};_0x3ea16e(++_0x1e00e6);}(_0x6209,0x1e8));var _0x9620=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6209[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x9620('0x0'));var rimraf=require(_0x9620('0x1'));var zipdir=require(_0x9620('0x2'));var jsonpatch=require(_0x9620('0x3'));var rp=require(_0x9620('0x4'));var moment=require(_0x9620('0x5'));var BPromise=require(_0x9620('0x6'));var Mustache=require('mustache');var util=require(_0x9620('0x7'));var path=require(_0x9620('0x8'));var sox=require(_0x9620('0x9'));var csv=require('to-csv');var ejs=require(_0x9620('0xa'));var fs=require('fs');var fs_extra=require(_0x9620('0xb'));var _=require(_0x9620('0xc'));var squel=require(_0x9620('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9620('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9620('0xf'));var Papa=require(_0x9620('0x10'));var Redis=require(_0x9620('0x11'));var authService=require(_0x9620('0x12'));var qs=require(_0x9620('0x13'));var as=require(_0x9620('0x14'));var hardwareService=require(_0x9620('0x15'));var logger=require('../../config/logger')(_0x9620('0x16'));var utils=require('../../config/utils');var config=require(_0x9620('0x17'));var licenseUtil=require(_0x9620('0x18'));var db=require(_0x9620('0x19'))['db'];function respondWithStatusCode(_0x321ea1,_0x1ad30e){_0x1ad30e=_0x1ad30e||0xcc;return function(_0x20f7d0){if(_0x20f7d0){return _0x321ea1[_0x9620('0x1a')](_0x1ad30e);}return _0x321ea1[_0x9620('0x1b')](_0x1ad30e)[_0x9620('0x1c')]();};}function respondWithResult(_0x2f1f34,_0x499cee){_0x499cee=_0x499cee||0xc8;return function(_0x5aba4e){if(_0x5aba4e){return _0x2f1f34[_0x9620('0x1b')](_0x499cee)[_0x9620('0x1d')](_0x5aba4e);}};}function respondWithFilteredResult(_0x51f0a7,_0x6d97fa){return function(_0x309b4c){if(_0x309b4c){var _0x34168b=typeof _0x6d97fa[_0x9620('0x1e')]==='undefined'&&typeof _0x6d97fa[_0x9620('0x1f')]===_0x9620('0x20');var _0x5a9b98=_0x309b4c[_0x9620('0x21')];var _0x4b81ea=_0x34168b?0x0:_0x6d97fa[_0x9620('0x1e')];var _0x16514e=_0x34168b?_0x309b4c[_0x9620('0x21')]:_0x6d97fa[_0x9620('0x1e')]+_0x6d97fa[_0x9620('0x1f')];var _0x4ab9c2;if(_0x16514e>=_0x5a9b98){_0x16514e=_0x5a9b98;_0x4ab9c2=0xc8;}else{_0x4ab9c2=0xce;}_0x51f0a7[_0x9620('0x1b')](_0x4ab9c2);return _0x51f0a7['set']('Content-Range',_0x4b81ea+'-'+_0x16514e+'/'+_0x5a9b98)['json'](_0x309b4c);}return null;};}function patchUpdates(_0x5ca9ab){return function(_0x5c44df){try{jsonpatch[_0x9620('0x22')](_0x5c44df,_0x5ca9ab,!![]);}catch(_0x5b62f5){return BPromise[_0x9620('0x23')](_0x5b62f5);}return _0x5c44df[_0x9620('0x24')]();};}function saveUpdates(_0xe60a48,_0x2c43fa){return function(_0x23f937){if(_0x23f937){return _0x23f937[_0x9620('0x25')](_0xe60a48)[_0x9620('0x26')](function(_0x4b1957){return _0x4b1957;});}return null;};}function removeEntity(_0x54bbbf,_0x1d8665){return function(_0x2bd6af){if(_0x2bd6af){return _0x2bd6af['destroy']()[_0x9620('0x26')](function(){_0x54bbbf[_0x9620('0x1b')](0xcc)[_0x9620('0x1c')]();});}};}function handleEntityNotFound(_0x156298,_0x38a6c3){return function(_0x42520d){if(!_0x42520d){_0x156298[_0x9620('0x1a')](0x194);}return _0x42520d;};}function handleError(_0x1527bd,_0x255cac){_0x255cac=_0x255cac||0x1f4;return function(_0x30c0cf){logger[_0x9620('0x27')](_0x30c0cf['stack']);if(_0x30c0cf[_0x9620('0x28')]){delete _0x30c0cf[_0x9620('0x28')];}_0x1527bd[_0x9620('0x1b')](_0x255cac)[_0x9620('0x29')](_0x30c0cf);};}exports['index']=function(_0x4a9e41,_0x1282dc){var _0x581fc3={},_0xf2cb11={},_0x527d48={'count':0x0,'rows':[]};var _0x5d079d=_[_0x9620('0x2a')](db[_0x9620('0x2b')][_0x9620('0x2c')],function(_0x57977f){return{'name':_0x57977f[_0x9620('0x2d')],'type':_0x57977f[_0x9620('0x2e')][_0x9620('0x2f')]};});_0xf2cb11['model']=_[_0x9620('0x2a')](_0x5d079d,'name');_0xf2cb11[_0x9620('0x30')]=_[_0x9620('0x31')](_0x4a9e41['query']);_0xf2cb11[_0x9620('0x32')]=_[_0x9620('0x33')](_0xf2cb11[_0x9620('0x34')],_0xf2cb11[_0x9620('0x30')]);_0x581fc3['attributes']=_['intersection'](_0xf2cb11['model'],qs['fields'](_0x4a9e41[_0x9620('0x30')][_0x9620('0x35')]));_0x581fc3['attributes']=_0x581fc3[_0x9620('0x36')][_0x9620('0x37')]?_0x581fc3['attributes']:_0xf2cb11[_0x9620('0x34')];if(!_0x4a9e41[_0x9620('0x30')]['hasOwnProperty'](_0x9620('0x38'))){_0x581fc3[_0x9620('0x1f')]=qs[_0x9620('0x1f')](_0x4a9e41[_0x9620('0x30')]['limit']);_0x581fc3[_0x9620('0x1e')]=qs['offset'](_0x4a9e41[_0x9620('0x30')][_0x9620('0x1e')]);}_0x581fc3['order']=qs['sort'](_0x4a9e41[_0x9620('0x30')][_0x9620('0x39')]);_0x581fc3[_0x9620('0x3a')]=qs[_0x9620('0x32')](_[_0x9620('0x3b')](_0x4a9e41['query'],_0xf2cb11[_0x9620('0x32')]),_0x5d079d);if(_0x4a9e41[_0x9620('0x30')][_0x9620('0x3c')]){_0x581fc3[_0x9620('0x3a')]=_[_0x9620('0x3d')](_0x581fc3['where'],{'$or':_[_0x9620('0x2a')](_0x5d079d,function(_0x312752){if(_0x312752[_0x9620('0x2e')]!=='VIRTUAL'){var _0x243486={};_0x243486[_0x312752[_0x9620('0x28')]]={'$like':'%'+_0x4a9e41['query'][_0x9620('0x3c')]+'%'};return _0x243486;}})});}_0x581fc3=_['merge']({},_0x581fc3,_0x4a9e41[_0x9620('0x3e')]);var _0x32fd19={'where':_0x581fc3[_0x9620('0x3a')]};return db['WhatsappApplication'][_0x9620('0x21')](_0x32fd19)[_0x9620('0x26')](function(_0x36253a){_0x527d48['count']=_0x36253a;if(_0x4a9e41[_0x9620('0x30')]['includeAll']){_0x581fc3['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x9620('0x3f')](_0x581fc3);})['then'](function(_0x34701f){_0x527d48['rows']=_0x34701f;return _0x527d48;})['then'](respondWithFilteredResult(_0x1282dc,_0x581fc3))[_0x9620('0x40')](handleError(_0x1282dc,null));};exports[_0x9620('0x41')]=function(_0x25693b,_0x4a91c4){var _0x3e5b60={'raw':!![],'where':{'id':_0x25693b[_0x9620('0x42')]['id']}},_0x1b2ab0={};_0x1b2ab0[_0x9620('0x34')]=_[_0x9620('0x31')](db[_0x9620('0x2b')][_0x9620('0x2c')]);_0x1b2ab0[_0x9620('0x30')]=_[_0x9620('0x31')](_0x25693b[_0x9620('0x30')]);_0x1b2ab0['filters']=_[_0x9620('0x33')](_0x1b2ab0[_0x9620('0x34')],_0x1b2ab0[_0x9620('0x30')]);_0x3e5b60[_0x9620('0x36')]=_[_0x9620('0x33')](_0x1b2ab0[_0x9620('0x34')],qs[_0x9620('0x35')](_0x25693b['query'][_0x9620('0x35')]));_0x3e5b60['attributes']=_0x3e5b60[_0x9620('0x36')][_0x9620('0x37')]?_0x3e5b60[_0x9620('0x36')]:_0x1b2ab0[_0x9620('0x34')];if(_0x25693b['query']['includeAll']){_0x3e5b60['include']=[{'all':!![]}];}_0x3e5b60=_[_0x9620('0x3d')]({},_0x3e5b60,_0x25693b[_0x9620('0x3e')]);return db['WhatsappApplication'][_0x9620('0x43')](_0x3e5b60)[_0x9620('0x26')](handleEntityNotFound(_0x4a91c4,null))['then'](respondWithResult(_0x4a91c4,null))[_0x9620('0x40')](handleError(_0x4a91c4,null));};exports[_0x9620('0x44')]=function(_0x5b417d,_0x327911){return db[_0x9620('0x2b')]['create'](_0x5b417d[_0x9620('0x45')],{})['then'](respondWithResult(_0x327911,0xc9))[_0x9620('0x40')](handleError(_0x327911,null));};exports['update']=function(_0x1b0678,_0x56433e){if(_0x1b0678[_0x9620('0x45')]['id']){delete _0x1b0678[_0x9620('0x45')]['id'];}return db[_0x9620('0x2b')]['find']({'where':{'id':_0x1b0678[_0x9620('0x42')]['id']}})[_0x9620('0x26')](handleEntityNotFound(_0x56433e,null))[_0x9620('0x26')](saveUpdates(_0x1b0678[_0x9620('0x45')],null))[_0x9620('0x26')](respondWithResult(_0x56433e,null))[_0x9620('0x40')](handleError(_0x56433e,null));};exports[_0x9620('0x46')]=function(_0x296775,_0x46c5aa){return db[_0x9620('0x2b')][_0x9620('0x43')]({'where':{'id':_0x296775[_0x9620('0x42')]['id']}})[_0x9620('0x26')](handleEntityNotFound(_0x46c5aa,null))['then'](removeEntity(_0x46c5aa,null))[_0x9620('0x40')](handleError(_0x46c5aa,null));};
\ No newline at end of file
index 2d7eadc..6461a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','lodash','util','bluebird'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x55ca,0x126));var _0xa55c=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0x55ca[_0x14ec75];return _0x40b9e9;};'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')]('WhatsappApplication',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa55c('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xde50=['path','../../config/environment','define','WhatsappApplication','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x515e72,_0x224638){var _0x21d3bf=function(_0x46dfbe){while(--_0x46dfbe){_0x515e72['push'](_0x515e72['shift']());}};_0x21d3bf(++_0x224638);}(_0xde50,0x140));var _0x0de5=function(_0x162ada,_0x139c54){_0x162ada=_0x162ada-0x0;var _0x12dee7=_0xde50[_0x162ada];return _0x12dee7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0de5('0x0'))(_0x0de5('0x1'));var moment=require(_0x0de5('0x2'));var BPromise=require(_0x0de5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0de5('0x4'));var rimraf=require('rimraf');var config=require(_0x0de5('0x5'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x5f05a1,_0x444955){return _0x5f05a1[_0x0de5('0x6')](_0x0de5('0x7'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0de5('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index b66abcc..44a41dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5de7e2,_0x3a09ea){var _0x359100=function(_0x1cd27e){while(--_0x1cd27e){_0x5de7e2['push'](_0x5de7e2['shift']());}};_0x359100(++_0x3a09ea);}(_0x84ab,0x12f));var _0xb84a=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x84ab[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc496,_0xd445b5,_0x4fac4d){return new BPromise(function(_0x3e9086,_0x8d9dbe){return client['request'](_0x4dc496,_0x4fac4d)[_0xb84a('0xa')](function(_0x525cb7){logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,_0xb84a('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xd445b5,'request\x20sent',JSON[_0xb84a('0xe')](_0x525cb7));if(_0x525cb7[_0xb84a('0xf')]){if(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x10')]===0x1f4){logger[_0xb84a('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x8d9dbe(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x3e9086(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}else{logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,'request\x20sent');_0x3e9086(_0x525cb7[_0xb84a('0x12')][_0xb84a('0x11')]);}})[_0xb84a('0x13')](function(_0x3c0b54){logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x3c0b54);_0x8d9dbe(_0x3c0b54);});});}
\ No newline at end of file
+var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5636,0x102));var _0x6563=function(_0x79a76c,_0xd618ee){_0x79a76c=_0x79a76c-0x0;var _0x33fb82=_0x5636[_0x79a76c];return _0x33fb82;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});}
\ No newline at end of file
index 4075388..09f6c9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0618=['update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0x0618,0x1c6));var _0x8061=function(_0x5dddb2,_0x14dd53){_0x5dddb2=_0x5dddb2-0x0;var _0x247d14=_0x0618[_0x5dddb2];return _0x247d14;};'use strict';var multer=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var path=require('path');var timeout=require(_0x8061('0x2'));var express=require(_0x8061('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8061('0x4'));var interaction=require(_0x8061('0x5'));var config=require(_0x8061('0x6'));var controller=require(_0x8061('0x7'));router[_0x8061('0x8')]('/',auth[_0x8061('0x9')](),controller[_0x8061('0xa')]);router[_0x8061('0x8')](_0x8061('0xb'),auth[_0x8061('0x9')](),controller[_0x8061('0xc')]);router['get'](_0x8061('0xd'),auth['isAuthenticated'](),controller[_0x8061('0xe')]);router[_0x8061('0x8')](_0x8061('0xf'),auth[_0x8061('0x9')](),controller[_0x8061('0x10')]);router['get']('/:id/download',auth[_0x8061('0x9')](),controller[_0x8061('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8061('0x12')]);router[_0x8061('0x13')](_0x8061('0xf'),auth[_0x8061('0x9')](),controller[_0x8061('0x14')]);router[_0x8061('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x17')),controller[_0x8061('0x18')]);router['put']('/:id',auth[_0x8061('0x9')](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x19')),controller[_0x8061('0x1a')]);router[_0x8061('0x1b')](_0x8061('0xd'),auth[_0x8061('0x9')](),interaction[_0x8061('0x15')](_0x8061('0x16'),_0x8061('0x1c')),controller[_0x8061('0x1d')]);router[_0x8061('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8061('0x1e')]);module[_0x8061('0x1f')]=router;
\ No newline at end of file
+var _0x90b1=['index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c9ebd,_0x593269){var _0x3ae331=function(_0x5ced6f){while(--_0x5ced6f){_0x3c9ebd['push'](_0x3c9ebd['shift']());}};_0x3ae331(++_0x593269);}(_0x90b1,0x1bb));var _0x190b=function(_0xa83955,_0x842b87){_0xa83955=_0xa83955-0x0;var _0x39d283=_0x90b1[_0xa83955];return _0x39d283;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0x8')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x8')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller['download']);router[_0x190b('0x11')]('/',auth[_0x190b('0xa')](),controller['create']);router[_0x190b('0x11')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0x12')]);router[_0x190b('0x11')](_0x190b('0x13'),auth[_0x190b('0xa')](),interaction[_0x190b('0x14')](_0x190b('0x15'),_0x190b('0x16')),controller[_0x190b('0x17')]);router[_0x190b('0x18')](_0x190b('0xc'),auth[_0x190b('0xa')](),interaction[_0x190b('0x14')](_0x190b('0x15'),_0x190b('0x19')),controller['update']);router[_0x190b('0x1a')]('/:id',auth[_0x190b('0xa')](),interaction[_0x190b('0x14')](_0x190b('0x15'),_0x190b('0x1b')),controller['destroy']);router[_0x190b('0x1a')](_0x190b('0x13'),auth[_0x190b('0xa')](),controller[_0x190b('0x1c')]);module[_0x190b('0x1d')]=router;
\ No newline at end of file
index 9af68db..c994ac3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd7=['STRING','DATE','ENUM','out','moment','exports','BOOLEAN'];(function(_0x24c3c0,_0x3b4274){var _0x282480=function(_0x4c16d5){while(--_0x4c16d5){_0x24c3c0['push'](_0x24c3c0['shift']());}};_0x282480(++_0x3b4274);}(_0x5bd7,0x12a));var _0x75bd=function(_0x571c00,_0x3ae028){_0x571c00=_0x571c00-0x0;var _0x2887df=_0x5bd7[_0x571c00];return _0x2887df;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x75bd('0x0'));module[_0x75bd('0x1')]={'closed':{'type':Sequelize[_0x75bd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x75bd('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x75bd('0x3')]},'note':{'type':Sequelize[_0x75bd('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x75bd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x75bd('0x5')]('in',_0x75bd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x75bd('0x5')]('in',_0x75bd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x75bd('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4873=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x13d2e7,_0x49bb9b){var _0x3bbe59=function(_0xca1186){while(--_0xca1186){_0x13d2e7['push'](_0x13d2e7['shift']());}};_0x3bbe59(++_0x49bb9b);}(_0x4873,0x1df));var _0x3487=function(_0xafc44e,_0x3b8a37){_0xafc44e=_0xafc44e-0x0;var _0x5d024b=_0x4873[_0xafc44e];return _0x5d024b;};'use strict';var Sequelize=require(_0x3487('0x0'));var moment=require(_0x3487('0x1'));module[_0x3487('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3487('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3487('0x4')]},'note':{'type':Sequelize[_0x3487('0x4')]},'phone':{'type':Sequelize[_0x3487('0x4')]},'read1stAt':{'type':Sequelize[_0x3487('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3487('0x5')]('in',_0x3487('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3487('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3487('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3487('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 3c697a6..ae2d19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fda=['u.fullname','ui.WhatsappInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','WhatsappInteractionId','push','rows','params','includeAll','include','options','create','update','describe','addMessage','ids','omit','getMessages','WhatsappMessage','hasOwnProperty','findAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','unix','root','server','files','join','attachments','format','transcript-%d-%s.zip','CmContact','lastName','Attachment','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','disposition','Messages','basename','existsSync','pipe','YYYY-MM-DD\x20HH:mm:ss','out','System','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','catch','rawAttributes','type','keys','filters','intersection','model','attributes','query','fields','length','nolimit','order','sort','select','field','tools_tags','u.id'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2fda,0x186));var _0xa2fd=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x2fda[_0x5e3b04];return _0x1fc44d;};'use strict';var emlformat=require(_0xa2fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2fd('0x1'));var rp=require(_0xa2fd('0x2'));var moment=require(_0xa2fd('0x3'));var BPromise=require(_0xa2fd('0x4'));var Mustache=require(_0xa2fd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa2fd('0x6'));var ejs=require(_0xa2fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2fd('0x8'));var squel=require(_0xa2fd('0x9'));var crypto=require(_0xa2fd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2fd('0xb'));var toCsv=require(_0xa2fd('0x6'));var querystring=require(_0xa2fd('0xc'));var Papa=require(_0xa2fd('0xd'));var Redis=require(_0xa2fd('0xe'));var authService=require(_0xa2fd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa2fd('0x10'));var logger=require('../../config/logger')(_0xa2fd('0x11'));var utils=require(_0xa2fd('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa2fd('0x13'))['db'];config[_0xa2fd('0x14')]=_[_0xa2fd('0x15')](config[_0xa2fd('0x14')],{'host':_0xa2fd('0x16'),'port':0x18eb});var socket=require(_0xa2fd('0x17'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xa2fd('0x18')](socket);function respondWithStatusCode(_0x4c75e5,_0x133db2){_0x133db2=_0x133db2||0xcc;return function(_0x5ada12){if(_0x5ada12){return _0x4c75e5[_0xa2fd('0x19')](_0x133db2);}return _0x4c75e5[_0xa2fd('0x1a')](_0x133db2)[_0xa2fd('0x1b')]();};}function respondWithResult(_0x31c996,_0x5b3ffa){_0x5b3ffa=_0x5b3ffa||0xc8;return function(_0x1a64a4){if(_0x1a64a4){return _0x31c996[_0xa2fd('0x1a')](_0x5b3ffa)[_0xa2fd('0x1c')](_0x1a64a4);}};}function respondWithFilteredResult(_0x195d32,_0x39f7b2){return function(_0x5c0697){if(_0x5c0697){var _0x466df1=typeof _0x39f7b2[_0xa2fd('0x1d')]===_0xa2fd('0x1e')&&typeof _0x39f7b2[_0xa2fd('0x1f')]===_0xa2fd('0x1e');var _0x10b8d5=_0x5c0697[_0xa2fd('0x20')];var _0x2ca371=_0x466df1?0x0:_0x39f7b2[_0xa2fd('0x1d')];var _0xbc2a7b=_0x466df1?_0x5c0697[_0xa2fd('0x20')]:_0x39f7b2['offset']+_0x39f7b2[_0xa2fd('0x1f')];var _0x1f2ec7;if(_0xbc2a7b>=_0x10b8d5){_0xbc2a7b=_0x10b8d5;_0x1f2ec7=0xc8;}else{_0x1f2ec7=0xce;}_0x195d32[_0xa2fd('0x1a')](_0x1f2ec7);return _0x195d32[_0xa2fd('0x21')](_0xa2fd('0x22'),_0x2ca371+'-'+_0xbc2a7b+'/'+_0x10b8d5)['json'](_0x5c0697);}return null;};}function patchUpdates(_0x40e0f8){return function(_0x12d3ed){try{jsonpatch[_0xa2fd('0x23')](_0x12d3ed,_0x40e0f8,!![]);}catch(_0x2f9744){return BPromise[_0xa2fd('0x24')](_0x2f9744);}return _0x12d3ed[_0xa2fd('0x25')]();};}function saveUpdates(_0x2bd046,_0x1cf9e3){return function(_0x35f472){if(_0x35f472){return _0x35f472['update'](_0x2bd046)[_0xa2fd('0x26')](function(_0x44b155){return _0x44b155;});}return null;};}function removeEntity(_0x457434,_0x584339){return function(_0x4e44ff){if(_0x4e44ff){return _0x4e44ff[_0xa2fd('0x27')]()[_0xa2fd('0x26')](function(){_0x457434[_0xa2fd('0x1a')](0xcc)[_0xa2fd('0x1b')]();});}};}function handleEntityNotFound(_0x5da046,_0x4b700b){return function(_0xcead1a){if(!_0xcead1a){_0x5da046[_0xa2fd('0x19')](0x194);}return _0xcead1a;};}function handleError(_0x359250,_0x800876){_0x800876=_0x800876||0x1f4;return function(_0x42a1d3){logger[_0xa2fd('0x28')](_0x42a1d3['stack']);if(_0x42a1d3[_0xa2fd('0x29')]){delete _0x42a1d3[_0xa2fd('0x29')];}_0x359250[_0xa2fd('0x1a')](_0x800876)[_0xa2fd('0x2a')](_0x42a1d3);};}function getInteractionUsers(_0x3288e2,_0x3cfb76){return new BPromise(function(_0x4938af,_0x346bfd){try{if(_0x3cfb76[_0x3288e2['id']]){_0x3288e2[_0xa2fd('0x2b')]=_[_0xa2fd('0x2c')](_0x3cfb76[_0x3288e2['id']],function(_0x2ad79d){return{'id':_0x2ad79d['id'],'fullname':_0x2ad79d[_0xa2fd('0x2d')]};});}}catch(_0x1b4662){_0x346bfd(_0x1b4662);}_0x4938af(_0x3288e2);});}function getInteractionTags(_0x357f09,_0x408f73){return new BPromise(function(_0x578cb6,_0xc57d82){try{if(_0x357f09[_0xa2fd('0x2e')]){_0x357f09[_0xa2fd('0x2f')]=[];_0x357f09[_0xa2fd('0x2e')]['split'](',')['forEach'](function(_0x54bcba){_0x357f09[_0xa2fd('0x2f')]['push'](_0x408f73[_0x54bcba]);});}delete _0x357f09['TagIds'];}catch(_0x207d06){_0xc57d82(_0x207d06);}_0x578cb6(_0x357f09);});}function updateWhatsappInteraction(_0x38016f,_0x4df62a,_0xfff008){return new BPromise(function(_0x3f4417,_0x2600c1){return getInteractionUsers(_0x38016f,_0xfff008)['then'](function(_0x395713){return getInteractionTags(_0x395713,_0x4df62a);})[_0xa2fd('0x26')](function(_0x1722ef){_0x3f4417(_0x1722ef);})[_0xa2fd('0x30')](function(_0x32d203){_0x2600c1(_0x32d203);});});}exports['index']=function(_0xed54e8,_0x98a5c3){var _0x96e2e4={},_0x2a0bd1={},_0x2fae82={'count':0x0,'rows':[]};var _0x578577=_[_0xa2fd('0x2c')](db['WhatsappInteraction'][_0xa2fd('0x31')],function(_0x38289f){return{'name':_0x38289f['fieldName'],'type':_0x38289f[_0xa2fd('0x32')]['key']};});_0x2a0bd1['model']=_[_0xa2fd('0x2c')](_0x578577,_0xa2fd('0x29'));_0x2a0bd1['query']=_[_0xa2fd('0x33')](_0xed54e8['query']);_0x2a0bd1[_0xa2fd('0x34')]=_[_0xa2fd('0x35')](_0x2a0bd1[_0xa2fd('0x36')],_0x2a0bd1['query']);_0x96e2e4[_0xa2fd('0x37')]=_[_0xa2fd('0x35')](_0x2a0bd1[_0xa2fd('0x36')],qs['fields'](_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x39')]));_0x96e2e4['attributes']=_0x96e2e4[_0xa2fd('0x37')][_0xa2fd('0x3a')]?_0x96e2e4[_0xa2fd('0x37')]:_0x2a0bd1[_0xa2fd('0x36')];if(!_0xed54e8[_0xa2fd('0x38')]['hasOwnProperty'](_0xa2fd('0x3b'))){_0x96e2e4[_0xa2fd('0x1f')]=qs[_0xa2fd('0x1f')](_0xed54e8[_0xa2fd('0x38')]['limit']);_0x96e2e4[_0xa2fd('0x1d')]=qs[_0xa2fd('0x1d')](_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x1d')]);}_0x96e2e4[_0xa2fd('0x3c')]=qs[_0xa2fd('0x3d')](_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x3d')]);_0x96e2e4['where']=qs[_0xa2fd('0x34')](_['pick'](_0xed54e8['query'],_0x2a0bd1['filters']),_0x578577);var _0x30848c=[];var _0x4f7316=squel[_0xa2fd('0x3e')]()['field']('id')['field'](_0xa2fd('0x29'))[_0xa2fd('0x3f')]('color')['from'](_0xa2fd('0x40'));var _0x46e216=squel['select']()['field'](_0xa2fd('0x41'))[_0xa2fd('0x3f')](_0xa2fd('0x42'))[_0xa2fd('0x3f')](_0xa2fd('0x43'))[_0xa2fd('0x44')]('user_has_whatsapp_interactions','ui')[_0xa2fd('0x45')](_0xa2fd('0x46'),'u',_0xa2fd('0x47'));var _0x3166d8=squel[_0xa2fd('0x3e')]()[_0xa2fd('0x44')](_0xa2fd('0x48'),'i')[_0xa2fd('0x45')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa2fd('0x45')](_0xa2fd('0x46'),'o',_0xa2fd('0x49'))[_0xa2fd('0x45')]('whatsapp_accounts','a',_0xa2fd('0x4a'))[_0xa2fd('0x45')](_0xa2fd('0x4b'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa2fd('0x45')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xa2fd('0x45')](_0xa2fd('0x40'),'t',_0xa2fd('0x4c'));var _0x48a33c=squel[_0xa2fd('0x4d')]();var _0x3b7f2e=[];var _0x33b32b=squel[_0xa2fd('0x4d')]();var _0x2bf113;if(_0xed54e8['query']['search']){_0x2bf113=as[_0xa2fd('0x4e')](_0xed54e8[_0xa2fd('0x38')]['search']);var _0x332db9=_0x2bf113[_0xa2fd('0x4f')];for(var _0xd45623=0x0;_0xd45623<_0x2bf113[_0xa2fd('0x50')][_0xa2fd('0x3a')];_0xd45623++){var _0x4f9f12=_0x2bf113['conditions'][_0xd45623];var _0x3369a3='i';var _0x41ee7b=_[_0xa2fd('0x51')](_0x578577,[_0xa2fd('0x29'),_0x4f9f12[_0xa2fd('0x3f')]]);if(!_0x41ee7b){switch(_0x4f9f12['field']){case'unreadMessages':if(_0x4f9f12[_0xa2fd('0x52')]==0x1){_0x3166d8[_0xa2fd('0x53')]('`'+_0x4f9f12[_0xa2fd('0x3f')]+_0xa2fd('0x54'));}else{_0x3166d8[_0xa2fd('0x53')]('`'+_0x4f9f12[_0xa2fd('0x3f')]+_0xa2fd('0x55'));}break;case _0xa2fd('0x56'):if(_0x4f9f12[_0xa2fd('0x57')]===_0xa2fd('0x58')){if(_0x4f9f12[_0xa2fd('0x52')][_0xa2fd('0x59')]('\x20')[_0xa2fd('0x3a')]>0x1){_0x48a33c[_0x332db9](_0xa2fd('0x5a'),qs['getFullTextValue'](_0x4f9f12[_0xa2fd('0x52')]),null);}else{var _0x1ee688='%'+_0x4f9f12[_0xa2fd('0x52')]+'%';_0x48a33c[_0x332db9](_0xa2fd('0x5b'),_0x1ee688,_0x1ee688,_0x1ee688);}}else{_0x41ee7b=_[_0xa2fd('0x51')](_0x578577,[_0xa2fd('0x29'),_0xa2fd('0x5c')]);_0x4f9f12[_0xa2fd('0x3f')]=_0xa2fd('0x5c');_0x2a5440=as[_0xa2fd('0x5d')](_0x3369a3,_0x41ee7b[_0xa2fd('0x32')],_0x4f9f12);_0x48a33c[_0x332db9](_0x2a5440[_0xa2fd('0x5e')],_0x2a5440[_0xa2fd('0x52')]['start'],_0x2a5440[_0xa2fd('0x52')]['end']);}break;case _0xa2fd('0x5f'):var _0x53d0c9=_0x4f9f12[_0xa2fd('0x52')][_0xa2fd('0x59')](',')[_0xa2fd('0x2c')](function(_0x35b400){return Number(_0x35b400);});_0x53d0c9[_0xa2fd('0x60')](function(_0x4d81ad){_0x33b32b['or'](_0xa2fd('0x61'),'%,'+_0x4d81ad+',%');});_0x3b7f2e=_['union'](_0x3b7f2e,_0x53d0c9);break;case _0xa2fd('0x62'):if(_0x4f9f12['operator']===_0xa2fd('0x58')){_0x48a33c[_0x332db9](_0xa2fd('0x63'),'%'+_0x4f9f12[_0xa2fd('0x52')]+'%',null);}else{_0x41ee7b=_['find'](_0x578577,[_0xa2fd('0x29'),_0xa2fd('0x64')]);_0x4f9f12[_0xa2fd('0x3f')]=_0xa2fd('0x64');_0x2a5440=as[_0xa2fd('0x5d')](_0x3369a3,_0x41ee7b['type'],_0x4f9f12);_0x48a33c[_0x332db9](_0x2a5440['text'],_0x2a5440[_0xa2fd('0x52')][_0xa2fd('0x65')],_0x2a5440['value']['end']);}break;case _0xa2fd('0x66'):_0x2a5440=as[_0xa2fd('0x5d')]('me',null,_0x4f9f12);_0x48a33c[_0x332db9](_0x2a5440[_0xa2fd('0x5e')],_0x2a5440[_0xa2fd('0x52')][_0xa2fd('0x65')],_0x2a5440[_0xa2fd('0x52')]['end']);break;}}else{var _0x2a5440=as[_0xa2fd('0x5d')](_0x3369a3,_0x41ee7b[_0xa2fd('0x32')],_0x4f9f12);_0x48a33c[_0x332db9](_0x2a5440[_0xa2fd('0x5e')],_0x2a5440[_0xa2fd('0x52')][_0xa2fd('0x65')],_0x2a5440[_0xa2fd('0x52')][_0xa2fd('0x1b')]);}}}else{var _0x3845e8=_(_0xed54e8[_0xa2fd('0x38')])[_0xa2fd('0x33')]()[_0xa2fd('0x2c')](function(_0x55eb11){return _[_0xa2fd('0x67')](_0x578577,[_0xa2fd('0x29'),_0x55eb11])?_0x55eb11:undefined;})[_0xa2fd('0x68')]()['value']();if(!_[_0xa2fd('0x69')](_0x3845e8)){_0x3845e8[_0xa2fd('0x60')](function(_0x5e20e2){if(_0x5e20e2===_0xa2fd('0x6a')){_0x3166d8[_0xa2fd('0x6b')](_0xa2fd('0x6c'),[][_0xa2fd('0x6d')](_0xed54e8[_0xa2fd('0x38')][_0x5e20e2]));}else if(_0x5e20e2===_0xa2fd('0x6e')){var _0x6f56b5=JSON[_0xa2fd('0x6f')](_0xed54e8['query'][_0x5e20e2])[_0xa2fd('0x70')];var _0x18b1d5=JSON[_0xa2fd('0x6f')](_0xed54e8[_0xa2fd('0x38')][_0x5e20e2])['$lte'];_0x3166d8['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x6f56b5,_0x18b1d5);}else{if(_0xed54e8[_0xa2fd('0x38')][_0x5e20e2]===_0xa2fd('0x71')){_0x3166d8[_0xa2fd('0x6b')]('i.'+_0x5e20e2+'\x20IS\x20NULL');}else{_0x3166d8[_0xa2fd('0x6b')]('i.'+_0x5e20e2+_0xa2fd('0x72'),_0xed54e8['query'][_0x5e20e2]);}}});}if(_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x73')]){if(_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x73')]==0x1){_0x3166d8['having'](_0xa2fd('0x74'));}else{_0x3166d8[_0xa2fd('0x53')](_0xa2fd('0x75'));}}if(_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x76')]){_0x3b7f2e=_[_0xa2fd('0x77')](_0xed54e8['query'][_0xa2fd('0x76')])?_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x76')]:new Array(_0xed54e8['query']['tag']);_0x3b7f2e[_0xa2fd('0x60')](function(_0x191b9b){_0x33b32b['or'](_0xa2fd('0x61'),'%,'+_0x191b9b+',%');});}if(_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x78')]){var _0x5bbef8=_0xed54e8['query'][_0xa2fd('0x78')]['replace']('\x5c','\x5c\x5c')[_0xa2fd('0x79')](/'/g,'\x27\x27');if(qs[_0xa2fd('0x7a')](_0x5bbef8)){_0x48a33c['or'](_0xa2fd('0x7b'),_0x5bbef8+'%')['or'](_0xa2fd('0x7c'),_0x5bbef8+'%');}else{_0x48a33c['or'](_0xa2fd('0x7d'),qs['getFullTextValue'](_0x5bbef8))['or'](_0xa2fd('0x7e'),_0x5bbef8+'%');}}}_0x3166d8[_0xa2fd('0x6b')](_0x48a33c);_0x3166d8[_0xa2fd('0x7f')](_0xa2fd('0x80'));var _0x484188={'type':db[_0xa2fd('0x81')][_0xa2fd('0x82')][_0xa2fd('0x83')],'raw':!![]};var _0xae9735=_0x3166d8[_0xa2fd('0x84')]();_0xae9735['field'](_0xa2fd('0x80'));_0xae9735[_0xa2fd('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa2fd('0x85'));if(_0x96e2e4[_0xa2fd('0x3c')]){_0x96e2e4[_0xa2fd('0x3c')][_0xa2fd('0x60')](function(_0x4366c5){var _0x295acf=_0x4366c5[0x0]===_0xa2fd('0x86')?_0x4366c5[0x0]:'i.'+_0x4366c5[0x0];_0x3166d8['order'](_0x295acf,_0x4366c5[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3b7f2e)){_0x3166d8[_0xa2fd('0x53')](_0x33b32b);_0xae9735[_0xa2fd('0x6b')](_0xa2fd('0x87'),_0x3b7f2e);}BPromise[_0xa2fd('0x88')]()[_0xa2fd('0x26')](function(){if(!_0x2bf113){if(_0xed54e8[_0xa2fd('0x38')][_0xa2fd('0x6a')])return;_0xae9735[_0xa2fd('0x6b')](_0xa2fd('0x89'));_0x3166d8[_0xa2fd('0x6b')](_0xa2fd('0x89'));return;}if(_0xed54e8[_0xa2fd('0x8a')][_0xa2fd('0x8b')]!==_0xa2fd('0x8c'))return;return _0xed54e8['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xa2fd('0x26')](function(_0x3c77e0){if(_['isEmpty'](_0x3c77e0)){_0xae9735['where'](_0xa2fd('0x8d'));_0x3166d8['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0xae9735[_0xa2fd('0x6b')](_0xa2fd('0x6c'),_['map'](_0x3c77e0,'id'));_0x3166d8[_0xa2fd('0x6b')](_0xa2fd('0x6c'),_[_0xa2fd('0x2c')](_0x3c77e0,'id'));}});})[_0xa2fd('0x26')](function(){if(_0xed54e8[_0xa2fd('0x8a')][_0xa2fd('0x8b')]===_0xa2fd('0x8c')&&!_0x2bf113&&!_0xed54e8[_0xa2fd('0x38')]['WhatsappAccountId'])return[];return db[_0xa2fd('0x8e')][_0xa2fd('0x38')](_0xae9735['toString'](),_0x484188);})[_0xa2fd('0x26')](function(_0x503ab8){_0x2fae82[_0xa2fd('0x20')]=_0x503ab8['length'];if(_0x2fae82[_0xa2fd('0x20')]===0x0)return[];return db[_0xa2fd('0x8e')][_0xa2fd('0x38')](_0x4f7316['toString'](),_0x484188)[_0xa2fd('0x26')](function(_0x59ef40){_0x30848c=_[_0xa2fd('0x8f')](_0x59ef40,'id');_0x484188=_[_0xa2fd('0x90')](_0x484188,{'model':db[_0xa2fd('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xed54e8[_0xa2fd('0x38')]['fields']){_0x96e2e4[_0xa2fd('0x37')][_0xa2fd('0x60')](function(_0x4584f7){_0x3166d8[_0xa2fd('0x3f')]('i.'+_0x4584f7);});}else{_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x92'),_0xa2fd('0x85'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x93'),_0xa2fd('0x94'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x95'),_0xa2fd('0x96'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x97'),'contactName');_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x98'));_0x3166d8['field'](_0xa2fd('0x99'),'Contact.firstName');_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x9a'),_0xa2fd('0x9b'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x9c'),'Contact.email');_0x3166d8[_0xa2fd('0x3f')]('c.phone',_0xa2fd('0x9d'));_0x3166d8[_0xa2fd('0x3f')]('c.mobile',_0xa2fd('0x9e'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0x9f'),_0xa2fd('0xa0'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0xa1'),'Owner.fullname');_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0xa2'),_0xa2fd('0xa3'));_0x3166d8[_0xa2fd('0x3f')](_0xa2fd('0xa4'),_0xa2fd('0x2e'));}if(_0x96e2e4[_0xa2fd('0x1f')])_0x3166d8['limit'](_0x96e2e4[_0xa2fd('0x1f')]);if(_0x96e2e4[_0xa2fd('0x1d')])_0x3166d8[_0xa2fd('0x1d')](_0x96e2e4[_0xa2fd('0x1d')]);return db['sequelize'][_0xa2fd('0x38')](_0x3166d8[_0xa2fd('0xa5')](),_0x484188);})[_0xa2fd('0x26')](function(_0x3860fe){if(_0x3860fe[_0xa2fd('0x3a')]>0x0)_0x46e216[_0xa2fd('0x6b')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xa2fd('0x2c')](_0x3860fe,'id'));return db['sequelize']['query'](_0x46e216[_0xa2fd('0xa5')](),_0x484188)[_0xa2fd('0x26')](function(_0x44bbf3){var _0xa41fed=_[_0xa2fd('0xa6')](_0x44bbf3,_0xa2fd('0xa7'));var _0x10b84c=[];_0x3860fe[_0xa2fd('0x60')](function(_0x4fc4f7){_0x10b84c[_0xa2fd('0xa8')](updateWhatsappInteraction(_0x4fc4f7,_0x30848c,_0xa41fed));});return BPromise['all'](_0x10b84c);});});})[_0xa2fd('0x26')](function(_0xc0ac55){_0x2fae82[_0xa2fd('0xa9')]=_0xc0ac55;return _0x2fae82;})[_0xa2fd('0x26')](respondWithFilteredResult(_0x98a5c3,_0x96e2e4))['catch'](handleError(_0x98a5c3,null));};exports['show']=function(_0x1022c4,_0x2029d3){var _0x3005ba={'raw':![],'where':{'id':_0x1022c4[_0xa2fd('0xaa')]['id']}},_0x283741={};_0x283741[_0xa2fd('0x36')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x283741['query']=_[_0xa2fd('0x33')](_0x1022c4[_0xa2fd('0x38')]);_0x283741[_0xa2fd('0x34')]=_['intersection'](_0x283741[_0xa2fd('0x36')],_0x283741[_0xa2fd('0x38')]);_0x3005ba[_0xa2fd('0x37')]=_[_0xa2fd('0x35')](_0x283741[_0xa2fd('0x36')],qs['fields'](_0x1022c4[_0xa2fd('0x38')][_0xa2fd('0x39')]));_0x3005ba[_0xa2fd('0x37')]=_0x3005ba['attributes'][_0xa2fd('0x3a')]?_0x3005ba[_0xa2fd('0x37')]:_0x283741[_0xa2fd('0x36')];if(_0x1022c4[_0xa2fd('0x38')][_0xa2fd('0xab')]){_0x3005ba[_0xa2fd('0xac')]=[{'all':!![]}];}_0x3005ba=_[_0xa2fd('0x90')]({},_0x3005ba,_0x1022c4[_0xa2fd('0xad')]);return db['WhatsappInteraction']['find'](_0x3005ba)[_0xa2fd('0x26')](handleEntityNotFound(_0x2029d3,null))['then'](respondWithResult(_0x2029d3,null))[_0xa2fd('0x30')](handleError(_0x2029d3,null));};exports[_0xa2fd('0xae')]=function(_0x335e57,_0x459794){return db[_0xa2fd('0x91')][_0xa2fd('0xae')](_0x335e57[_0xa2fd('0x66')],{})[_0xa2fd('0x26')](respondWithResult(_0x459794,0xc9))[_0xa2fd('0x30')](handleError(_0x459794,null));};exports[_0xa2fd('0xaf')]=function(_0x2eee59,_0x314739){if(_0x2eee59[_0xa2fd('0x66')]['id']){delete _0x2eee59[_0xa2fd('0x66')]['id'];}return db[_0xa2fd('0x91')]['find']({'where':{'id':_0x2eee59[_0xa2fd('0xaa')]['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0x314739,null))['then'](saveUpdates(_0x2eee59[_0xa2fd('0x66')],null))['then'](respondWithResult(_0x314739,null))[_0xa2fd('0x30')](handleError(_0x314739,null));};exports[_0xa2fd('0x27')]=function(_0x872b24,_0x34a92f){return db[_0xa2fd('0x91')][_0xa2fd('0x51')]({'where':{'id':_0x872b24['params']['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0x34a92f,null))['then'](removeEntity(_0x34a92f,null))[_0xa2fd('0x30')](handleError(_0x34a92f,null));};exports[_0xa2fd('0xb0')]=function(_0x2f66ce,_0x687a32){return db[_0xa2fd('0x91')]['describe']()[_0xa2fd('0x26')](respondWithResult(_0x687a32,null))['catch'](handleError(_0x687a32,null));};exports[_0xa2fd('0xb1')]=function(_0x319ccb,_0x2776e8,_0x45348d){return db['WhatsappMessage'][_0xa2fd('0x51')]({'where':{'id':_0x319ccb[_0xa2fd('0xaa')]['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0x2776e8,null))[_0xa2fd('0x26')](function(_0x54b90d){if(_0x54b90d){return _0x54b90d[_0xa2fd('0xb1')](_0x319ccb[_0xa2fd('0x66')][_0xa2fd('0xb2')],_[_0xa2fd('0xb3')](_0x319ccb[_0xa2fd('0x66')],[_0xa2fd('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x2776e8,null))[_0xa2fd('0x30')](handleError(_0x2776e8,null));};exports[_0xa2fd('0xb4')]=function(_0xa57980,_0x390e41,_0xf81bf8){var _0x1b5a1f={'raw':![],'where':{}};var _0xf76c20={};var _0x434b27={'count':0x0,'rows':[]};return db[_0xa2fd('0x91')]['findOne']({'where':{'id':_0xa57980['params']['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0x390e41,null))[_0xa2fd('0x26')](function(_0x5296f6){if(_0x5296f6){_0xf76c20[_0xa2fd('0x36')]=_[_0xa2fd('0x33')](db[_0xa2fd('0xb5')]['rawAttributes']);_0xf76c20[_0xa2fd('0x38')]=_['keys'](_0xa57980[_0xa2fd('0x38')]);_0xf76c20[_0xa2fd('0x34')]=_[_0xa2fd('0x35')](_0xf76c20[_0xa2fd('0x36')],_0xf76c20[_0xa2fd('0x38')]);_0x1b5a1f['attributes']=_[_0xa2fd('0x35')](_0xf76c20[_0xa2fd('0x36')],qs[_0xa2fd('0x39')](_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x39')]));_0x1b5a1f[_0xa2fd('0x37')]=_0x1b5a1f[_0xa2fd('0x37')]['length']?_0x1b5a1f[_0xa2fd('0x37')]:_0xf76c20[_0xa2fd('0x36')];if(!_0xa57980[_0xa2fd('0x38')][_0xa2fd('0xb6')](_0xa2fd('0x3b'))){_0x1b5a1f[_0xa2fd('0x1f')]=qs[_0xa2fd('0x1f')](_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x1f')]);_0x1b5a1f['offset']=qs[_0xa2fd('0x1d')](_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x1d')]);}_0x1b5a1f[_0xa2fd('0x3c')]=qs[_0xa2fd('0x3d')](_0xa57980[_0xa2fd('0x38')]['sort']);_0x1b5a1f[_0xa2fd('0x6b')]=qs[_0xa2fd('0x34')](_['pick'](_0xa57980['query'],_0xf76c20[_0xa2fd('0x34')]));_0x1b5a1f[_0xa2fd('0x6b')][_0xa2fd('0xa7')]=_0x5296f6['id'];if(_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x78')]){_0x1b5a1f[_0xa2fd('0x6b')]=_[_0xa2fd('0x90')](_0x1b5a1f[_0xa2fd('0x6b')],{'$or':_[_0xa2fd('0x2c')](_0x1b5a1f[_0xa2fd('0x37')],function(_0x5d6482){var _0x310fbe={};_0x310fbe[_0x5d6482]={'$like':'%'+_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x78')]+'%'};return _0x310fbe;})});}if(_0xa57980[_0xa2fd('0x38')][_0xa2fd('0x70')]){var _0x1f5468=_0xa57980[_0xa2fd('0x38')]['$gte'][_0xa2fd('0x59')](',');var _0x53da09={};_0x53da09[_0x1f5468[0x0]]={'$gte':moment(_0x1f5468[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1b5a1f[_0xa2fd('0x6b')]=_[_0xa2fd('0x90')](_0x1b5a1f[_0xa2fd('0x6b')],_0x53da09);}_0x1b5a1f=_[_0xa2fd('0x90')]({},_0x1b5a1f,_0xa57980[_0xa2fd('0xad')]);return db[_0xa2fd('0xb5')][_0xa2fd('0x20')]({'where':_0x1b5a1f[_0xa2fd('0x6b')]})['then'](function(_0x5c8cc3){_0x434b27[_0xa2fd('0x20')]=_0x5c8cc3;if(_0xa57980[_0xa2fd('0x38')][_0xa2fd('0xab')]){_0x1b5a1f['include']=[{'all':!![]}];}return db[_0xa2fd('0xb5')][_0xa2fd('0xb7')](_0x1b5a1f);})['then'](function(_0x18d04f){_0x434b27['rows']=_0x18d04f;return _0x434b27;});}})['then'](respondWithFilteredResult(_0x390e41,_0x1b5a1f))[_0xa2fd('0x30')](handleError(_0x390e41,null));};exports[_0xa2fd('0xb8')]=function(_0x23da2d,_0x3d3a93,_0x57aacd){return db['WhatsappInteraction'][_0xa2fd('0x51')]({'where':{'id':_0x23da2d[_0xa2fd('0xaa')]['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0x3d3a93,null))['then'](function(_0x5b0cee){if(_0x5b0cee){return _0x5b0cee[_0xa2fd('0xb9')](_0x23da2d['body']['ids'],_['omit'](_0x23da2d['body'],['ids','id'])||{})[_0xa2fd('0xba')](function(){return db[_0xa2fd('0x5f')][_0xa2fd('0xb7')]({'attributes':['id',_0xa2fd('0x29'),_0xa2fd('0xbb')],'where':{'id':_0x23da2d['body'][_0xa2fd('0xb2')]}});})[_0xa2fd('0x26')](function(_0x42a167){socket[_0xa2fd('0xbc')](_0xa2fd('0xbd'),{'id':Number(_0x23da2d['params']['id']),'tags':_0x42a167||[]});return{'id':Number(_0x23da2d[_0xa2fd('0xaa')]['id']),'tags':_0x42a167||[]};});}})[_0xa2fd('0x26')](respondWithResult(_0x3d3a93,null))[_0xa2fd('0x30')](handleError(_0x3d3a93,null));};exports[_0xa2fd('0xbe')]=function(_0x504149,_0xaed8ff,_0x3c2366){return db['WhatsappInteraction'][_0xa2fd('0x51')]({'where':{'id':_0x504149['params']['id']}})[_0xa2fd('0x26')](handleEntityNotFound(_0xaed8ff,null))[_0xa2fd('0x26')](function(_0xeafdc4){if(_0xeafdc4){return _0xeafdc4[_0xa2fd('0xbe')](_0x504149[_0xa2fd('0x38')][_0xa2fd('0xb2')]);}})['then'](respondWithStatusCode(_0xaed8ff,null))[_0xa2fd('0x30')](handleError(_0xaed8ff,null));};exports['download']=function(_0x573f04,_0x2933fe){var _0x565f64=moment()[_0xa2fd('0xbf')]()[_0xa2fd('0xa5')]();var _0x13e35b=path['join'](config[_0xa2fd('0xc0')],_0xa2fd('0xc1'),_0xa2fd('0xc2'),'tmp');var _0x20a9dc=path[_0xa2fd('0xc3')](config[_0xa2fd('0xc0')],_0xa2fd('0xc1'),_0xa2fd('0xc2'),_0xa2fd('0xc4'));var _0x39f808=path[_0xa2fd('0xc3')](_0x13e35b,_0x565f64);var _0xb85660=util[_0xa2fd('0xc5')](_0xa2fd('0xc6'),_0x573f04[_0xa2fd('0xaa')]['id'],_0x565f64);var _0x155a87=path[_0xa2fd('0xc3')](_0x13e35b,_0xb85660);var _0x3851c1=[];_0x3851c1['push']({'model':db[_0xa2fd('0x62')],'as':_0xa2fd('0x62'),'attributes':['id',_0xa2fd('0x2d')],'raw':!![]});_0x3851c1[_0xa2fd('0xa8')]({'model':db[_0xa2fd('0xc7')],'as':_0xa2fd('0x56'),'attributes':['id','firstName',_0xa2fd('0xc8')],'raw':!![]});if(_0x573f04[_0xa2fd('0x38')][_0xa2fd('0xc4')]){_0x3851c1[_0xa2fd('0xa8')]({'model':db[_0xa2fd('0xc9')],'as':_0xa2fd('0xc9'),'raw':!![]});}var _0x1c90c1=[{'model':db[_0xa2fd('0xb5')],'as':'Messages','attributes':['id',_0xa2fd('0x66'),_0xa2fd('0x6e'),_0xa2fd('0xca'),_0xa2fd('0xcb'),_0xa2fd('0x73')],'include':_0x3851c1}];_0x1c90c1[_0xa2fd('0xa8')]({'model':db[_0xa2fd('0xcc')],'as':_0xa2fd('0xcd'),'attributes':['id','name']});_0x1c90c1[_0xa2fd('0xa8')]({'model':db[_0xa2fd('0x62')],'as':'Owner','attributes':['id',_0xa2fd('0x2d')]});return db[_0xa2fd('0x91')][_0xa2fd('0x51')]({'where':{'id':_0x573f04[_0xa2fd('0xaa')]['id']},'include':_0x1c90c1})[_0xa2fd('0x26')](handleEntityNotFound(_0x2933fe,null))[_0xa2fd('0x26')](function(_0x3c5779){if(_0x3c5779){var _0x511fa5=_0x3c5779[_0xa2fd('0xce')]({'plain':!![]});fs[_0xa2fd('0xcf')](_0x39f808);var _0x96c736={'channel':_0xa2fd('0xd0'),'account':_0x511fa5[_0xa2fd('0xcd')][_0xa2fd('0x29')],'agent':_0x511fa5[_0xa2fd('0xd1')]?_0x511fa5[_0xa2fd('0xd1')]['fullname']:_0xa2fd('0xd2'),'createdAt':moment(_0x511fa5['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa2fd('0xa5')](),'closedAt':_0x511fa5['closed']?moment(_0x511fa5['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa2fd('0xa5')]():'','disposition':_0x511fa5[_0xa2fd('0xd3')],'messages':_(_0x511fa5[_0xa2fd('0xd4')])['filter']({'secret':![]})[_0xa2fd('0x2c')](function(_0x5916ae){if(_0x5916ae[_0xa2fd('0xc9')]){var _0x1b6b6f=path['join'](_0x20a9dc,_0x5916ae[_0xa2fd('0xc9')][_0xa2fd('0xd5')]);if(fs[_0xa2fd('0xd6')](_0x1b6b6f)){fs['createReadStream'](_0x1b6b6f)[_0xa2fd('0xd7')](fs['createWriteStream'](path[_0xa2fd('0xc3')](_0x39f808,_0x5916ae[_0xa2fd('0xc9')][_0xa2fd('0xd5')])));}}return{'date':moment(_0x5916ae[_0xa2fd('0x6e')])['format'](_0xa2fd('0xd8'))['toString'](),'sender':_0x5916ae[_0xa2fd('0xca')]===_0xa2fd('0xd9')?_0x5916ae[_0xa2fd('0x62')]?_0x5916ae[_0xa2fd('0x62')][_0xa2fd('0x2d')]:_0xa2fd('0xda'):_0x5916ae['Contact']['firstName']+(_0x5916ae[_0xa2fd('0x56')][_0xa2fd('0xc8')]?'\x20'+_0x5916ae[_0xa2fd('0x56')][_0xa2fd('0xc8')]:''),'body':_0x5916ae['Attachment']?_0x5916ae[_0xa2fd('0xc9')][_0xa2fd('0xd5')]:_0x5916ae[_0xa2fd('0x66')],'direction':_0x5916ae[_0xa2fd('0xca')]===_0xa2fd('0xd9')?'A':'C','secret':_0x5916ae['secret'],'read':_0x5916ae[_0xa2fd('0x73')],'attachment':_0x5916ae['Attachment']};})['value']()};return ejs['renderFile'](path[_0xa2fd('0xc3')](config[_0xa2fd('0xc0')],_0xa2fd('0xc1'),_0xa2fd('0xdb'),_0xa2fd('0xdc')),{'interaction':_0x96c736})[_0xa2fd('0x26')](function(_0x297e90){var _0x3a5594=path[_0xa2fd('0xc3')](_0x39f808,_0xa2fd('0xdd')+_0x511fa5['id']+'-'+_0x565f64+_0xa2fd('0xde'));var _0xede496={'path':_0x3a5594,'channel':_0xa2fd('0xd0'),'interactionId':_0x511fa5['id']};return pdf[_0xa2fd('0xdf')](_0x297e90,_0xede496);})[_0xa2fd('0x26')](function(){return new BPromise(function(_0x2bc502,_0x291984){zipdir(_0x39f808,{'saveTo':_0x155a87},function(_0x789e26,_0x1d6ccc){if(_0x789e26)return _0x291984(_0x789e26);return _0x2bc502(_0x1d6ccc);});})[_0xa2fd('0x26')](function(){return new BPromise(function(_0x5b8572,_0x5de7a3){rimraf(_0x39f808,function(_0x445c41){if(_0x445c41)_0x5de7a3(_0x445c41);return _0x5b8572();});});})[_0xa2fd('0x26')](function(){return _0x2933fe[_0xa2fd('0xe0')](_0x155a87,_0xb85660,function(_0x201325){if(_0x201325){console[_0xa2fd('0xe1')](_0xa2fd('0xe2'),_0x201325);}else{fs[_0xa2fd('0xe3')](_0x155a87);}});});});}else{return _0x2933fe[_0xa2fd('0x19')](0xc8);}})[_0xa2fd('0x30')](handleError(_0x2933fe,null));};
\ No newline at end of file
+var _0x0a12=['intersection','attributes','fields','length','nolimit','sort','where','field','color','tools_tags','select','u.id','ui.WhatsappInteractionId','from','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','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','Tag','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','text','body','keys','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','catch','params','filters','includeAll','include','options','create','update','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','pick','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','basename','existsSync','createReadStream','direction','System','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','mustache','util','path','sox','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','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','name','send','Users','map','fullname','TagIds','Tags','forEach','push','index','WhatsappInteraction','rawAttributes','fieldName','key','model','query'];(function(_0x272b4d,_0x226f6c){var _0x47a721=function(_0x561a4a){while(--_0x561a4a){_0x272b4d['push'](_0x272b4d['shift']());}};_0x47a721(++_0x226f6c);}(_0x0a12,0xb8));var _0x20a1=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x0a12[_0x166d93];return _0xba708;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20a1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x20a1('0x2'));var util=require(_0x20a1('0x3'));var path=require(_0x20a1('0x4'));var sox=require(_0x20a1('0x5'));var csv=require(_0x20a1('0x6'));var ejs=require(_0x20a1('0x7'));var fs=require('fs');var fs_extra=require(_0x20a1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20a1('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20a1('0x6'));var querystring=require(_0x20a1('0xa'));var Papa=require(_0x20a1('0xb'));var Redis=require(_0x20a1('0xc'));var authService=require(_0x20a1('0xd'));var qs=require(_0x20a1('0xe'));var as=require(_0x20a1('0xf'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x20a1('0x10'));var logger=require(_0x20a1('0x11'))(_0x20a1('0x12'));var utils=require(_0x20a1('0x13'));var config=require(_0x20a1('0x14'));var licenseUtil=require(_0x20a1('0x15'));var db=require('../../mysqldb')['db'];config[_0x20a1('0x16')]=_[_0x20a1('0x17')](config[_0x20a1('0x16')],{'host':_0x20a1('0x18'),'port':0x18eb});var socket=require(_0x20a1('0x19'))(new Redis(config[_0x20a1('0x16')]));require(_0x20a1('0x1a'))[_0x20a1('0x1b')](socket);function respondWithStatusCode(_0x3c7bef,_0x1aee6f){_0x1aee6f=_0x1aee6f||0xcc;return function(_0xb736e9){if(_0xb736e9){return _0x3c7bef[_0x20a1('0x1c')](_0x1aee6f);}return _0x3c7bef[_0x20a1('0x1d')](_0x1aee6f)[_0x20a1('0x1e')]();};}function respondWithResult(_0x559a97,_0x50d618){_0x50d618=_0x50d618||0xc8;return function(_0x5b26af){if(_0x5b26af){return _0x559a97['status'](_0x50d618)['json'](_0x5b26af);}};}function respondWithFilteredResult(_0x478974,_0x5c00a6){return function(_0x55fe14){if(_0x55fe14){var _0x4a68c5=typeof _0x5c00a6[_0x20a1('0x1f')]===_0x20a1('0x20')&&typeof _0x5c00a6[_0x20a1('0x21')]===_0x20a1('0x20');var _0x2ec8d6=_0x55fe14[_0x20a1('0x22')];var _0x5d252d=_0x4a68c5?0x0:_0x5c00a6['offset'];var _0x463968=_0x4a68c5?_0x55fe14[_0x20a1('0x22')]:_0x5c00a6[_0x20a1('0x1f')]+_0x5c00a6['limit'];var _0x5dfb97;if(_0x463968>=_0x2ec8d6){_0x463968=_0x2ec8d6;_0x5dfb97=0xc8;}else{_0x5dfb97=0xce;}_0x478974[_0x20a1('0x1d')](_0x5dfb97);return _0x478974[_0x20a1('0x23')](_0x20a1('0x24'),_0x5d252d+'-'+_0x463968+'/'+_0x2ec8d6)[_0x20a1('0x25')](_0x55fe14);}return null;};}function patchUpdates(_0x56745a){return function(_0x512dbd){try{jsonpatch['apply'](_0x512dbd,_0x56745a,!![]);}catch(_0x48eb5d){return BPromise[_0x20a1('0x26')](_0x48eb5d);}return _0x512dbd[_0x20a1('0x27')]();};}function saveUpdates(_0x253a57,_0x4e9f0e){return function(_0x10a600){if(_0x10a600){return _0x10a600['update'](_0x253a57)[_0x20a1('0x28')](function(_0x5b2f87){return _0x5b2f87;});}return null;};}function removeEntity(_0x4bed2d,_0x47dcab){return function(_0x52a35c){if(_0x52a35c){return _0x52a35c['destroy']()[_0x20a1('0x28')](function(){_0x4bed2d[_0x20a1('0x1d')](0xcc)[_0x20a1('0x1e')]();});}};}function handleEntityNotFound(_0xee9dd8,_0x3927b2){return function(_0x26bd09){if(!_0x26bd09){_0xee9dd8['sendStatus'](0x194);}return _0x26bd09;};}function handleError(_0x3697f8,_0x47877f){_0x47877f=_0x47877f||0x1f4;return function(_0x2f8c8e){logger[_0x20a1('0x29')](_0x2f8c8e['stack']);if(_0x2f8c8e[_0x20a1('0x2a')]){delete _0x2f8c8e['name'];}_0x3697f8[_0x20a1('0x1d')](_0x47877f)[_0x20a1('0x2b')](_0x2f8c8e);};}function getInteractionUsers(_0x184a3d,_0x1cdc2c){return new BPromise(function(_0xe8e6d1,_0x22627a){try{if(_0x1cdc2c[_0x184a3d['id']]){_0x184a3d[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x1cdc2c[_0x184a3d['id']],function(_0x24593c){return{'id':_0x24593c['id'],'fullname':_0x24593c[_0x20a1('0x2e')]};});}}catch(_0x49e141){_0x22627a(_0x49e141);}_0xe8e6d1(_0x184a3d);});}function getInteractionTags(_0x1e6b14,_0x50194b){return new BPromise(function(_0x5d2d7c,_0x19d21c){try{if(_0x1e6b14[_0x20a1('0x2f')]){_0x1e6b14[_0x20a1('0x30')]=[];_0x1e6b14[_0x20a1('0x2f')]['split'](',')[_0x20a1('0x31')](function(_0x1c9f6e){_0x1e6b14[_0x20a1('0x30')][_0x20a1('0x32')](_0x50194b[_0x1c9f6e]);});}delete _0x1e6b14['TagIds'];}catch(_0x4296be){_0x19d21c(_0x4296be);}_0x5d2d7c(_0x1e6b14);});}function updateWhatsappInteraction(_0x511dcd,_0x5a7ade,_0x2a65c4){return new BPromise(function(_0x7e9cd7,_0x3e3d8f){return getInteractionUsers(_0x511dcd,_0x2a65c4)[_0x20a1('0x28')](function(_0x5375f1){return getInteractionTags(_0x5375f1,_0x5a7ade);})[_0x20a1('0x28')](function(_0x16f100){_0x7e9cd7(_0x16f100);})['catch'](function(_0x2c6b45){_0x3e3d8f(_0x2c6b45);});});}exports[_0x20a1('0x33')]=function(_0x15ce87,_0x4d04be){var _0x544ee5={},_0x267f8b={},_0x15881e={'count':0x0,'rows':[]};var _0x68bd2f=_[_0x20a1('0x2d')](db[_0x20a1('0x34')][_0x20a1('0x35')],function(_0xfa296d){return{'name':_0xfa296d[_0x20a1('0x36')],'type':_0xfa296d['type'][_0x20a1('0x37')]};});_0x267f8b[_0x20a1('0x38')]=_[_0x20a1('0x2d')](_0x68bd2f,_0x20a1('0x2a'));_0x267f8b[_0x20a1('0x39')]=_['keys'](_0x15ce87[_0x20a1('0x39')]);_0x267f8b['filters']=_[_0x20a1('0x3a')](_0x267f8b[_0x20a1('0x38')],_0x267f8b['query']);_0x544ee5[_0x20a1('0x3b')]=_['intersection'](_0x267f8b[_0x20a1('0x38')],qs['fields'](_0x15ce87['query'][_0x20a1('0x3c')]));_0x544ee5[_0x20a1('0x3b')]=_0x544ee5[_0x20a1('0x3b')][_0x20a1('0x3d')]?_0x544ee5['attributes']:_0x267f8b[_0x20a1('0x38')];if(!_0x15ce87[_0x20a1('0x39')]['hasOwnProperty'](_0x20a1('0x3e'))){_0x544ee5[_0x20a1('0x21')]=qs[_0x20a1('0x21')](_0x15ce87[_0x20a1('0x39')][_0x20a1('0x21')]);_0x544ee5['offset']=qs[_0x20a1('0x1f')](_0x15ce87[_0x20a1('0x39')][_0x20a1('0x1f')]);}_0x544ee5['order']=qs[_0x20a1('0x3f')](_0x15ce87[_0x20a1('0x39')]['sort']);_0x544ee5[_0x20a1('0x40')]=qs['filters'](_['pick'](_0x15ce87['query'],_0x267f8b['filters']),_0x68bd2f);var _0x26c023=[];var _0x29968a=squel['select']()['field']('id')['field'](_0x20a1('0x2a'))[_0x20a1('0x41')](_0x20a1('0x42'))['from'](_0x20a1('0x43'));var _0x352c19=squel[_0x20a1('0x44')]()[_0x20a1('0x41')](_0x20a1('0x45'))['field']('u.fullname')['field'](_0x20a1('0x46'))[_0x20a1('0x47')]('user_has_whatsapp_interactions','ui')[_0x20a1('0x48')](_0x20a1('0x49'),'u',_0x20a1('0x4a'));var _0x49a6fe=squel[_0x20a1('0x44')]()['from'](_0x20a1('0x4b'),'i')[_0x20a1('0x48')]('cm_contacts','c',_0x20a1('0x4c'))[_0x20a1('0x48')]('users','o',_0x20a1('0x4d'))[_0x20a1('0x48')]('whatsapp_accounts','a',_0x20a1('0x4e'))[_0x20a1('0x48')](_0x20a1('0x4f'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x20a1('0x48')](_0x20a1('0x50'),'it',_0x20a1('0x51'))['left_join'](_0x20a1('0x43'),'t','t.id\x20=\x20it.TagId');var _0x467ff8=squel[_0x20a1('0x52')]();var _0x139e17=[];var _0x1e3e54=squel[_0x20a1('0x52')]();var _0x2c2363;if(_0x15ce87[_0x20a1('0x39')]['search']){_0x2c2363=as[_0x20a1('0x53')](_0x15ce87[_0x20a1('0x39')]['search']);var _0x1c15be=_0x2c2363['sqlOperator'];for(var _0x455ccd=0x0;_0x455ccd<_0x2c2363[_0x20a1('0x54')]['length'];_0x455ccd++){var _0xd01088=_0x2c2363[_0x20a1('0x54')][_0x455ccd];var _0x1f988c='i';var _0x357046=_[_0x20a1('0x55')](_0x68bd2f,[_0x20a1('0x2a'),_0xd01088[_0x20a1('0x41')]]);if(!_0x357046){switch(_0xd01088[_0x20a1('0x41')]){case _0x20a1('0x56'):if(_0xd01088['value']==0x1){_0x49a6fe[_0x20a1('0x57')]('`'+_0xd01088[_0x20a1('0x41')]+_0x20a1('0x58'));}else{_0x49a6fe[_0x20a1('0x57')]('`'+_0xd01088['field']+_0x20a1('0x59'));}break;case _0x20a1('0x5a'):if(_0xd01088['operator']===_0x20a1('0x5b')){if(_0xd01088['value'][_0x20a1('0x5c')]('\x20')[_0x20a1('0x3d')]>0x1){_0x467ff8[_0x1c15be](_0x20a1('0x5d'),qs[_0x20a1('0x5e')](_0xd01088[_0x20a1('0x5f')]),null);}else{var _0xf0a0c5='%'+_0xd01088[_0x20a1('0x5f')]+'%';_0x467ff8[_0x1c15be](_0x20a1('0x60'),_0xf0a0c5,_0xf0a0c5,_0xf0a0c5);}}else{_0x357046=_[_0x20a1('0x55')](_0x68bd2f,[_0x20a1('0x2a'),_0x20a1('0x61')]);_0xd01088['field']=_0x20a1('0x61');_0xe1669e=as['buildExpression'](_0x1f988c,_0x357046[_0x20a1('0x62')],_0xd01088);_0x467ff8[_0x1c15be](_0xe1669e['text'],_0xe1669e[_0x20a1('0x5f')][_0x20a1('0x63')],_0xe1669e[_0x20a1('0x5f')][_0x20a1('0x1e')]);}break;case _0x20a1('0x64'):var _0x442410=_0xd01088[_0x20a1('0x5f')]['split'](',')[_0x20a1('0x2d')](function(_0x3d6b42){return Number(_0x3d6b42);});_0x442410['forEach'](function(_0xbd13b7){_0x1e3e54['or'](_0x20a1('0x65'),'%,'+_0xbd13b7+',%');});_0x139e17=_[_0x20a1('0x66')](_0x139e17,_0x442410);break;case _0x20a1('0x67'):if(_0xd01088[_0x20a1('0x68')]===_0x20a1('0x5b')){_0x467ff8[_0x1c15be](_0x20a1('0x69'),'%'+_0xd01088[_0x20a1('0x5f')]+'%',null);}else{_0x357046=_[_0x20a1('0x55')](_0x68bd2f,['name',_0x20a1('0x6a')]);_0xd01088['field']=_0x20a1('0x6a');_0xe1669e=as[_0x20a1('0x6b')](_0x1f988c,_0x357046[_0x20a1('0x62')],_0xd01088);_0x467ff8[_0x1c15be](_0xe1669e[_0x20a1('0x6c')],_0xe1669e['value'][_0x20a1('0x63')],_0xe1669e[_0x20a1('0x5f')][_0x20a1('0x1e')]);}break;case _0x20a1('0x6d'):_0xe1669e=as[_0x20a1('0x6b')]('me',null,_0xd01088);_0x467ff8[_0x1c15be](_0xe1669e[_0x20a1('0x6c')],_0xe1669e[_0x20a1('0x5f')][_0x20a1('0x63')],_0xe1669e[_0x20a1('0x5f')]['end']);break;}}else{var _0xe1669e=as[_0x20a1('0x6b')](_0x1f988c,_0x357046[_0x20a1('0x62')],_0xd01088);_0x467ff8[_0x1c15be](_0xe1669e[_0x20a1('0x6c')],_0xe1669e['value']['start'],_0xe1669e[_0x20a1('0x5f')][_0x20a1('0x1e')]);}}}else{var _0x4941bb=_(_0x15ce87[_0x20a1('0x39')])[_0x20a1('0x6e')]()[_0x20a1('0x2d')](function(_0x19650e){return _[_0x20a1('0x6f')](_0x68bd2f,['name',_0x19650e])?_0x19650e:undefined;})['compact']()[_0x20a1('0x5f')]();if(!_[_0x20a1('0x70')](_0x4941bb)){_0x4941bb[_0x20a1('0x31')](function(_0x4cc007){if(_0x4cc007===_0x20a1('0x71')){_0x49a6fe[_0x20a1('0x40')](_0x20a1('0x72'),[][_0x20a1('0x73')](_0x15ce87[_0x20a1('0x39')][_0x4cc007]));}else if(_0x4cc007==='createdAt'){var _0x1fb621=JSON['parse'](_0x15ce87['query'][_0x4cc007])[_0x20a1('0x74')];var _0xef48c3=JSON['parse'](_0x15ce87[_0x20a1('0x39')][_0x4cc007])[_0x20a1('0x75')];_0x49a6fe[_0x20a1('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1fb621,_0xef48c3);}else{if(_0x15ce87['query'][_0x4cc007]===_0x20a1('0x76')){_0x49a6fe['where']('i.'+_0x4cc007+_0x20a1('0x77'));}else{_0x49a6fe[_0x20a1('0x40')]('i.'+_0x4cc007+_0x20a1('0x78'),_0x15ce87[_0x20a1('0x39')][_0x4cc007]);}}});}if(_0x15ce87[_0x20a1('0x39')]['read']){if(_0x15ce87[_0x20a1('0x39')]['read']==0x1){_0x49a6fe[_0x20a1('0x57')](_0x20a1('0x79'));}else{_0x49a6fe['having'](_0x20a1('0x7a'));}}if(_0x15ce87[_0x20a1('0x39')]['tag']){_0x139e17=_[_0x20a1('0x7b')](_0x15ce87[_0x20a1('0x39')][_0x20a1('0x7c')])?_0x15ce87['query'][_0x20a1('0x7c')]:new Array(_0x15ce87[_0x20a1('0x39')]['tag']);_0x139e17[_0x20a1('0x31')](function(_0x2779d9){_0x1e3e54['or'](_0x20a1('0x65'),'%,'+_0x2779d9+',%');});}if(_0x15ce87['query'][_0x20a1('0x7d')]){var _0x4fa573=_0x15ce87[_0x20a1('0x39')][_0x20a1('0x7d')][_0x20a1('0x7e')]('\x5c','\x5c\x5c')[_0x20a1('0x7e')](/'/g,'\x27\x27');if(qs[_0x20a1('0x7f')](_0x4fa573)){_0x467ff8['or'](_0x20a1('0x80'),_0x4fa573+'%')['or'](_0x20a1('0x81'),_0x4fa573+'%');}else{_0x467ff8['or'](_0x20a1('0x82'),qs[_0x20a1('0x5e')](_0x4fa573))['or'](_0x20a1('0x83'),_0x4fa573+'%');}}}_0x49a6fe[_0x20a1('0x40')](_0x467ff8);_0x49a6fe[_0x20a1('0x84')](_0x20a1('0x85'));var _0x2a43d3={'type':db[_0x20a1('0x86')][_0x20a1('0x87')][_0x20a1('0x88')],'raw':!![]};var _0x247d85=_0x49a6fe['clone']();_0x247d85[_0x20a1('0x41')](_0x20a1('0x85'));_0x247d85['field'](_0x20a1('0x89'),_0x20a1('0x56'));if(_0x544ee5['order']){_0x544ee5[_0x20a1('0x8a')]['forEach'](function(_0x240875){var _0x39fe27=_0x240875[0x0]===_0x20a1('0x8b')?_0x240875[0x0]:'i.'+_0x240875[0x0];_0x49a6fe[_0x20a1('0x8a')](_0x39fe27,_0x240875[0x1]===_0x20a1('0x8c')?![]:!![]);});}if(!_[_0x20a1('0x70')](_0x139e17)){_0x49a6fe[_0x20a1('0x57')](_0x1e3e54);_0x247d85[_0x20a1('0x40')](_0x20a1('0x8d'),_0x139e17);}BPromise[_0x20a1('0x8e')]()[_0x20a1('0x28')](function(){if(!_0x2c2363){if(_0x15ce87[_0x20a1('0x39')][_0x20a1('0x71')])return;_0x247d85[_0x20a1('0x40')](_0x20a1('0x8f'));_0x49a6fe[_0x20a1('0x40')](_0x20a1('0x8f'));return;}if(_0x15ce87[_0x20a1('0x90')]['role']!=='agent')return;return _0x15ce87[_0x20a1('0x90')][_0x20a1('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12966d){if(_['isEmpty'](_0x12966d)){_0x247d85[_0x20a1('0x40')](_0x20a1('0x92'));_0x49a6fe[_0x20a1('0x40')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x247d85['where'](_0x20a1('0x72'),_[_0x20a1('0x2d')](_0x12966d,'id'));_0x49a6fe[_0x20a1('0x40')](_0x20a1('0x72'),_[_0x20a1('0x2d')](_0x12966d,'id'));}});})['then'](function(){if(_0x15ce87['user'][_0x20a1('0x93')]===_0x20a1('0x94')&&!_0x2c2363&&!_0x15ce87[_0x20a1('0x39')][_0x20a1('0x71')])return[];return db[_0x20a1('0x95')][_0x20a1('0x39')](_0x247d85[_0x20a1('0x96')](),_0x2a43d3);})[_0x20a1('0x28')](function(_0x396bba){_0x15881e['count']=_0x396bba['length'];if(_0x15881e[_0x20a1('0x22')]===0x0)return[];return db[_0x20a1('0x95')]['query'](_0x29968a[_0x20a1('0x96')](),_0x2a43d3)[_0x20a1('0x28')](function(_0x6ffdfc){_0x26c023=_[_0x20a1('0x97')](_0x6ffdfc,'id');_0x2a43d3=_[_0x20a1('0x98')](_0x2a43d3,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15ce87[_0x20a1('0x39')][_0x20a1('0x3c')]){_0x544ee5[_0x20a1('0x3b')][_0x20a1('0x31')](function(_0x58fb3b){_0x49a6fe[_0x20a1('0x41')]('i.'+_0x58fb3b);});}else{_0x49a6fe[_0x20a1('0x41')](_0x20a1('0x89'),_0x20a1('0x56'));_0x49a6fe[_0x20a1('0x41')](_0x20a1('0x99'),_0x20a1('0x9a'));_0x49a6fe[_0x20a1('0x41')](_0x20a1('0x9b'),_0x20a1('0x9c'));_0x49a6fe[_0x20a1('0x41')](_0x20a1('0x9d'),'contactName');_0x49a6fe['field'](_0x20a1('0x9e'));_0x49a6fe['field'](_0x20a1('0x9f'),'Contact.firstName');_0x49a6fe['field'](_0x20a1('0xa0'),'Contact.lastName');_0x49a6fe[_0x20a1('0x41')](_0x20a1('0xa1'),_0x20a1('0xa2'));_0x49a6fe[_0x20a1('0x41')](_0x20a1('0xa3'),'Contact.phone');_0x49a6fe[_0x20a1('0x41')](_0x20a1('0xa4'),_0x20a1('0xa5'));_0x49a6fe[_0x20a1('0x41')](_0x20a1('0xa6'),_0x20a1('0xa7'));_0x49a6fe['field'](_0x20a1('0xa8'),_0x20a1('0xa9'));_0x49a6fe['field'](_0x20a1('0xaa'),'Owner.internal');_0x49a6fe[_0x20a1('0x41')](_0x20a1('0xab'),'TagIds');}if(_0x544ee5['limit'])_0x49a6fe[_0x20a1('0x21')](_0x544ee5[_0x20a1('0x21')]);if(_0x544ee5['offset'])_0x49a6fe[_0x20a1('0x1f')](_0x544ee5[_0x20a1('0x1f')]);return db[_0x20a1('0x95')][_0x20a1('0x39')](_0x49a6fe[_0x20a1('0x96')](),_0x2a43d3);})[_0x20a1('0x28')](function(_0x598186){if(_0x598186['length']>0x0)_0x352c19[_0x20a1('0x40')](_0x20a1('0xac'),_[_0x20a1('0x2d')](_0x598186,'id'));return db['sequelize'][_0x20a1('0x39')](_0x352c19['toString'](),_0x2a43d3)[_0x20a1('0x28')](function(_0x54a761){var _0x46bd16=_[_0x20a1('0xad')](_0x54a761,'WhatsappInteractionId');var _0x1074be=[];_0x598186['forEach'](function(_0x1f1239){_0x1074be['push'](updateWhatsappInteraction(_0x1f1239,_0x26c023,_0x46bd16));});return BPromise[_0x20a1('0xae')](_0x1074be);});});})[_0x20a1('0x28')](function(_0x5c2fae){_0x15881e[_0x20a1('0xaf')]=_0x5c2fae;return _0x15881e;})['then'](respondWithFilteredResult(_0x4d04be,_0x544ee5))[_0x20a1('0xb0')](handleError(_0x4d04be,null));};exports['show']=function(_0x4651c9,_0x44da55){var _0x798ede={'raw':![],'where':{'id':_0x4651c9[_0x20a1('0xb1')]['id']}},_0x1cd7ec={};_0x1cd7ec[_0x20a1('0x38')]=_['keys'](db['WhatsappInteraction'][_0x20a1('0x35')]);_0x1cd7ec[_0x20a1('0x39')]=_[_0x20a1('0x6e')](_0x4651c9[_0x20a1('0x39')]);_0x1cd7ec[_0x20a1('0xb2')]=_[_0x20a1('0x3a')](_0x1cd7ec[_0x20a1('0x38')],_0x1cd7ec[_0x20a1('0x39')]);_0x798ede[_0x20a1('0x3b')]=_[_0x20a1('0x3a')](_0x1cd7ec[_0x20a1('0x38')],qs[_0x20a1('0x3c')](_0x4651c9[_0x20a1('0x39')][_0x20a1('0x3c')]));_0x798ede[_0x20a1('0x3b')]=_0x798ede['attributes']['length']?_0x798ede['attributes']:_0x1cd7ec['model'];if(_0x4651c9['query'][_0x20a1('0xb3')]){_0x798ede[_0x20a1('0xb4')]=[{'all':!![]}];}_0x798ede=_[_0x20a1('0x98')]({},_0x798ede,_0x4651c9[_0x20a1('0xb5')]);return db['WhatsappInteraction'][_0x20a1('0x55')](_0x798ede)[_0x20a1('0x28')](handleEntityNotFound(_0x44da55,null))[_0x20a1('0x28')](respondWithResult(_0x44da55,null))[_0x20a1('0xb0')](handleError(_0x44da55,null));};exports[_0x20a1('0xb6')]=function(_0xc7b5d7,_0x3b5fff){return db[_0x20a1('0x34')]['create'](_0xc7b5d7[_0x20a1('0x6d')],{})[_0x20a1('0x28')](respondWithResult(_0x3b5fff,0xc9))[_0x20a1('0xb0')](handleError(_0x3b5fff,null));};exports[_0x20a1('0xb7')]=function(_0xcea91c,_0x171078){if(_0xcea91c[_0x20a1('0x6d')]['id']){delete _0xcea91c[_0x20a1('0x6d')]['id'];}return db[_0x20a1('0x34')][_0x20a1('0x55')]({'where':{'id':_0xcea91c['params']['id']}})[_0x20a1('0x28')](handleEntityNotFound(_0x171078,null))[_0x20a1('0x28')](saveUpdates(_0xcea91c[_0x20a1('0x6d')],null))[_0x20a1('0x28')](respondWithResult(_0x171078,null))['catch'](handleError(_0x171078,null));};exports[_0x20a1('0xb8')]=function(_0xd186a2,_0x54e0c5){return db[_0x20a1('0x34')][_0x20a1('0x55')]({'where':{'id':_0xd186a2[_0x20a1('0xb1')]['id']}})['then'](handleEntityNotFound(_0x54e0c5,null))[_0x20a1('0x28')](removeEntity(_0x54e0c5,null))['catch'](handleError(_0x54e0c5,null));};exports[_0x20a1('0xb9')]=function(_0x2d7df0,_0x126273){return db[_0x20a1('0x34')]['describe']()[_0x20a1('0x28')](respondWithResult(_0x126273,null))[_0x20a1('0xb0')](handleError(_0x126273,null));};exports[_0x20a1('0xba')]=function(_0x5d86cd,_0x1a4d7b,_0x50a4bd){return db[_0x20a1('0xbb')][_0x20a1('0x55')]({'where':{'id':_0x5d86cd[_0x20a1('0xb1')]['id']}})[_0x20a1('0x28')](handleEntityNotFound(_0x1a4d7b,null))['then'](function(_0x23e302){if(_0x23e302){return _0x23e302[_0x20a1('0xba')](_0x5d86cd[_0x20a1('0x6d')]['ids'],_['omit'](_0x5d86cd[_0x20a1('0x6d')],[_0x20a1('0xbc'),'id'])||{});}})[_0x20a1('0x28')](respondWithResult(_0x1a4d7b,null))[_0x20a1('0xb0')](handleError(_0x1a4d7b,null));};exports[_0x20a1('0xbd')]=function(_0x2612c7,_0x429837,_0x3dff34){var _0x6b96fe={'raw':![],'where':{}};var _0x38d861={};var _0x186f2b={'count':0x0,'rows':[]};return db[_0x20a1('0x34')][_0x20a1('0xbe')]({'where':{'id':_0x2612c7['params']['id']}})['then'](handleEntityNotFound(_0x429837,null))[_0x20a1('0x28')](function(_0x2f92c8){if(_0x2f92c8){_0x38d861['model']=_['keys'](db['WhatsappMessage'][_0x20a1('0x35')]);_0x38d861['query']=_[_0x20a1('0x6e')](_0x2612c7[_0x20a1('0x39')]);_0x38d861[_0x20a1('0xb2')]=_[_0x20a1('0x3a')](_0x38d861[_0x20a1('0x38')],_0x38d861[_0x20a1('0x39')]);_0x6b96fe[_0x20a1('0x3b')]=_[_0x20a1('0x3a')](_0x38d861[_0x20a1('0x38')],qs['fields'](_0x2612c7[_0x20a1('0x39')][_0x20a1('0x3c')]));_0x6b96fe['attributes']=_0x6b96fe[_0x20a1('0x3b')][_0x20a1('0x3d')]?_0x6b96fe[_0x20a1('0x3b')]:_0x38d861[_0x20a1('0x38')];if(!_0x2612c7['query'][_0x20a1('0xbf')](_0x20a1('0x3e'))){_0x6b96fe[_0x20a1('0x21')]=qs[_0x20a1('0x21')](_0x2612c7[_0x20a1('0x39')]['limit']);_0x6b96fe[_0x20a1('0x1f')]=qs[_0x20a1('0x1f')](_0x2612c7[_0x20a1('0x39')][_0x20a1('0x1f')]);}_0x6b96fe['order']=qs['sort'](_0x2612c7[_0x20a1('0x39')][_0x20a1('0x3f')]);_0x6b96fe[_0x20a1('0x40')]=qs[_0x20a1('0xb2')](_[_0x20a1('0xc0')](_0x2612c7['query'],_0x38d861[_0x20a1('0xb2')]));_0x6b96fe[_0x20a1('0x40')][_0x20a1('0xc1')]=_0x2f92c8['id'];if(_0x2612c7[_0x20a1('0x39')]['filter']){_0x6b96fe[_0x20a1('0x40')]=_[_0x20a1('0x98')](_0x6b96fe['where'],{'$or':_[_0x20a1('0x2d')](_0x6b96fe[_0x20a1('0x3b')],function(_0x43f4ca){var _0x45ccdd={};_0x45ccdd[_0x43f4ca]={'$like':'%'+_0x2612c7[_0x20a1('0x39')]['filter']+'%'};return _0x45ccdd;})});}if(_0x2612c7[_0x20a1('0x39')][_0x20a1('0x74')]){var _0x5ad85c=_0x2612c7[_0x20a1('0x39')][_0x20a1('0x74')][_0x20a1('0x5c')](',');var _0x1d15a1={};_0x1d15a1[_0x5ad85c[0x0]]={'$gte':moment(_0x5ad85c[0x1])[_0x20a1('0xc2')](_0x20a1('0xc3'))};_0x6b96fe[_0x20a1('0x40')]=_['merge'](_0x6b96fe[_0x20a1('0x40')],_0x1d15a1);}_0x6b96fe=_[_0x20a1('0x98')]({},_0x6b96fe,_0x2612c7[_0x20a1('0xb5')]);return db[_0x20a1('0xbb')]['count']({'where':_0x6b96fe['where']})[_0x20a1('0x28')](function(_0x400e73){_0x186f2b[_0x20a1('0x22')]=_0x400e73;if(_0x2612c7[_0x20a1('0x39')][_0x20a1('0xb3')]){_0x6b96fe[_0x20a1('0xb4')]=[{'all':!![]}];}return db[_0x20a1('0xbb')][_0x20a1('0xc4')](_0x6b96fe);})[_0x20a1('0x28')](function(_0x511671){_0x186f2b[_0x20a1('0xaf')]=_0x511671;return _0x186f2b;});}})[_0x20a1('0x28')](respondWithFilteredResult(_0x429837,_0x6b96fe))[_0x20a1('0xb0')](handleError(_0x429837,null));};exports[_0x20a1('0xc5')]=function(_0x906492,_0x4ed89a,_0xdbb7e6){return db[_0x20a1('0x34')][_0x20a1('0x55')]({'where':{'id':_0x906492[_0x20a1('0xb1')]['id']}})[_0x20a1('0x28')](handleEntityNotFound(_0x4ed89a,null))['then'](function(_0x60196f){if(_0x60196f){return _0x60196f[_0x20a1('0xc6')](_0x906492[_0x20a1('0x6d')][_0x20a1('0xbc')],_['omit'](_0x906492['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x20a1('0xc4')]({'attributes':['id',_0x20a1('0x2a'),'color'],'where':{'id':_0x906492['body'][_0x20a1('0xbc')]}});})[_0x20a1('0x28')](function(_0xe398fd){socket[_0x20a1('0xc7')](_0x20a1('0xc8'),{'id':Number(_0x906492[_0x20a1('0xb1')]['id']),'tags':_0xe398fd||[]});return{'id':Number(_0x906492[_0x20a1('0xb1')]['id']),'tags':_0xe398fd||[]};});}})[_0x20a1('0x28')](respondWithResult(_0x4ed89a,null))[_0x20a1('0xb0')](handleError(_0x4ed89a,null));};exports[_0x20a1('0xc9')]=function(_0x36a5f0,_0x2aa248,_0x5911d3){return db[_0x20a1('0x34')][_0x20a1('0x55')]({'where':{'id':_0x36a5f0['params']['id']}})[_0x20a1('0x28')](handleEntityNotFound(_0x2aa248,null))['then'](function(_0x33699b){if(_0x33699b){return _0x33699b[_0x20a1('0xc9')](_0x36a5f0[_0x20a1('0x39')][_0x20a1('0xbc')]);}})[_0x20a1('0x28')](respondWithStatusCode(_0x2aa248,null))['catch'](handleError(_0x2aa248,null));};exports[_0x20a1('0xca')]=function(_0x509338,_0x164924){var _0x56e3a3=moment()[_0x20a1('0xcb')]()[_0x20a1('0x96')]();var _0x1fffd1=path[_0x20a1('0xcc')](config[_0x20a1('0xcd')],_0x20a1('0xce'),_0x20a1('0xcf'),_0x20a1('0xd0'));var _0x28de4a=path[_0x20a1('0xcc')](config[_0x20a1('0xcd')],_0x20a1('0xce'),_0x20a1('0xcf'),'attachments');var _0x316c92=path[_0x20a1('0xcc')](_0x1fffd1,_0x56e3a3);var _0xda7c94=util[_0x20a1('0xc2')](_0x20a1('0xd1'),_0x509338['params']['id'],_0x56e3a3);var _0x12c42a=path['join'](_0x1fffd1,_0xda7c94);var _0x2597be=[];_0x2597be[_0x20a1('0x32')]({'model':db[_0x20a1('0x67')],'as':'User','attributes':['id',_0x20a1('0x2e')],'raw':!![]});_0x2597be[_0x20a1('0x32')]({'model':db[_0x20a1('0xd2')],'as':_0x20a1('0x5a'),'attributes':['id',_0x20a1('0xd3'),_0x20a1('0xd4')],'raw':!![]});if(_0x509338[_0x20a1('0x39')][_0x20a1('0xd5')]){_0x2597be[_0x20a1('0x32')]({'model':db['Attachment'],'as':_0x20a1('0xd6'),'raw':!![]});}var _0x4fdc56=[{'model':db[_0x20a1('0xbb')],'as':_0x20a1('0xd7'),'attributes':['id',_0x20a1('0x6d'),_0x20a1('0xd8'),'direction',_0x20a1('0xd9'),_0x20a1('0xda')],'include':_0x2597be}];_0x4fdc56[_0x20a1('0x32')]({'model':db[_0x20a1('0xdb')],'as':'Account','attributes':['id',_0x20a1('0x2a')]});_0x4fdc56[_0x20a1('0x32')]({'model':db[_0x20a1('0x67')],'as':_0x20a1('0xdc'),'attributes':['id',_0x20a1('0x2e')]});return db[_0x20a1('0x34')][_0x20a1('0x55')]({'where':{'id':_0x509338['params']['id']},'include':_0x4fdc56})[_0x20a1('0x28')](handleEntityNotFound(_0x164924,null))[_0x20a1('0x28')](function(_0xba0060){if(_0xba0060){var _0x70096e=_0xba0060[_0x20a1('0xdd')]({'plain':!![]});fs[_0x20a1('0xde')](_0x316c92);var _0x2844d2={'channel':_0x20a1('0xdf'),'account':_0x70096e[_0x20a1('0xe0')][_0x20a1('0x2a')],'agent':_0x70096e['Owner']?_0x70096e[_0x20a1('0xdc')][_0x20a1('0x2e')]:_0x20a1('0xe1'),'createdAt':moment(_0x70096e['createdAt'])[_0x20a1('0xc2')](_0x20a1('0xc3'))[_0x20a1('0x96')](),'closedAt':_0x70096e[_0x20a1('0xe2')]?moment(_0x70096e[_0x20a1('0xe3')])[_0x20a1('0xc2')](_0x20a1('0xc3'))[_0x20a1('0x96')]():'','disposition':_0x70096e['disposition'],'messages':_(_0x70096e['Messages'])[_0x20a1('0x7d')]({'secret':![]})[_0x20a1('0x2d')](function(_0x17e412){if(_0x17e412[_0x20a1('0xd6')]){var _0x40c4f6=path[_0x20a1('0xcc')](_0x28de4a,_0x17e412[_0x20a1('0xd6')][_0x20a1('0xe4')]);if(fs[_0x20a1('0xe5')](_0x40c4f6)){fs[_0x20a1('0xe6')](_0x40c4f6)['pipe'](fs['createWriteStream'](path[_0x20a1('0xcc')](_0x316c92,_0x17e412[_0x20a1('0xd6')][_0x20a1('0xe4')])));}}return{'date':moment(_0x17e412[_0x20a1('0xd8')])[_0x20a1('0xc2')](_0x20a1('0xc3'))['toString'](),'sender':_0x17e412[_0x20a1('0xe7')]==='out'?_0x17e412[_0x20a1('0x67')]?_0x17e412[_0x20a1('0x67')][_0x20a1('0x2e')]:_0x20a1('0xe8'):_0x17e412['Contact'][_0x20a1('0xd3')]+(_0x17e412['Contact']['lastName']?'\x20'+_0x17e412[_0x20a1('0x5a')][_0x20a1('0xd4')]:''),'body':_0x17e412['Attachment']?_0x17e412[_0x20a1('0xd6')][_0x20a1('0xe4')]:_0x17e412[_0x20a1('0x6d')],'direction':_0x17e412[_0x20a1('0xe7')]===_0x20a1('0xe9')?'A':'C','secret':_0x17e412['secret'],'read':_0x17e412[_0x20a1('0xda')],'attachment':_0x17e412[_0x20a1('0xd6')]};})[_0x20a1('0x5f')]()};return ejs[_0x20a1('0xea')](path[_0x20a1('0xcc')](config[_0x20a1('0xcd')],_0x20a1('0xce'),_0x20a1('0xeb'),_0x20a1('0xec')),{'interaction':_0x2844d2})[_0x20a1('0x28')](function(_0x5f0380){var _0x12070f=path[_0x20a1('0xcc')](_0x316c92,_0x20a1('0xed')+_0x70096e['id']+'-'+_0x56e3a3+'.pdf');var _0x245056={'path':_0x12070f,'channel':'Whatsapp','interactionId':_0x70096e['id']};return pdf[_0x20a1('0xee')](_0x5f0380,_0x245056);})[_0x20a1('0x28')](function(){return new BPromise(function(_0x50393f,_0xfb34ad){zipdir(_0x316c92,{'saveTo':_0x12c42a},function(_0x5adb8a,_0x56c02d){if(_0x5adb8a)return _0xfb34ad(_0x5adb8a);return _0x50393f(_0x56c02d);});})['then'](function(){return new BPromise(function(_0x3a18d5,_0x4a292d){rimraf(_0x316c92,function(_0x3e30d3){if(_0x3e30d3)_0x4a292d(_0x3e30d3);return _0x3a18d5();});});})[_0x20a1('0x28')](function(){return _0x164924['download'](_0x12c42a,_0xda7c94,function(_0x3e63d8){if(_0x3e63d8){console[_0x20a1('0xef')](_0x20a1('0xf0'),_0x3e63d8);}else{fs[_0x20a1('0xf1')](_0x12c42a);}});});});}else{return _0x164924[_0x20a1('0x1c')](0xc8);}})[_0x20a1('0xb0')](handleError(_0x164924,null));};
\ No newline at end of file
index a5fb3bb..6789a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8721=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','then','setDataValue','map'];(function(_0x293fd4,_0x4aba92){var _0x1f9ec3=function(_0x31804f){while(--_0x31804f){_0x293fd4['push'](_0x293fd4['shift']());}};_0x1f9ec3(++_0x4aba92);}(_0x8721,0xd9));var _0x1872=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x8721[_0x96f74c];return _0x379222;};'use strict';var EventEmitter=require(_0x1872('0x0'));var WhatsappInteraction=require(_0x1872('0x1'))['db'][_0x1872('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1872('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x40690e){return function(_0x1cd36f,_0x3678b3,_0x47ca3a){_0x1cd36f['getUsers']({'attributes':['id'],'raw':!![]})[_0x1872('0x4')](function(_0x3b80c8){_0x1cd36f[_0x1872('0x5')]('Users',_0x3b80c8[_0x1872('0x6')](function(_0x2c2f41){return{'id':_0x2c2f41['id']};}));return WhatsappMessage[_0x1872('0x7')]({'where':{'WhatsappInteractionId':_0x1cd36f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1872('0x4')](function(_0x1f43c6){_0x1cd36f[_0x1872('0x5')](_0x1872('0x8'),_0x1f43c6[_0x1872('0x9')]);WhatsappInteractionEvents[_0x1872('0xa')](_0x40690e+':'+_0x1cd36f['id'],_0x1cd36f);WhatsappInteractionEvents[_0x1872('0xa')](_0x40690e,_0x1cd36f);_0x47ca3a(null);})[_0x1872('0xb')](_0x47ca3a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x1872('0xc')](e,emitEvent(event));}}module[_0x1872('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xb63f=['catch','hasOwnProperty','hook','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0xb63f,0xa3));var _0xfb63=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0xb63f[_0x48c2ae];return _0x8f7531;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xfb63('0x0')];var WhatsappMessage=require(_0xfb63('0x1'))['db'][_0xfb63('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfb63('0x3')](0x0);var events={'afterCreate':_0xfb63('0x4'),'afterUpdate':_0xfb63('0x5'),'afterDestroy':_0xfb63('0x6')};function emitEvent(_0x3fe487){return function(_0x99ddbb,_0x5b4439,_0x39cc2c){_0x99ddbb['getUsers']({'attributes':['id'],'raw':!![]})[_0xfb63('0x7')](function(_0xcf49af){_0x99ddbb['setDataValue']('Users',_0xcf49af['map'](function(_0x2b1a0f){return{'id':_0x2b1a0f['id']};}));return WhatsappMessage[_0xfb63('0x8')]({'where':{'WhatsappInteractionId':_0x99ddbb['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfb63('0x7')](function(_0x55c21b){_0x99ddbb[_0xfb63('0x9')](_0xfb63('0xa'),_0x55c21b[_0xfb63('0xb')]);WhatsappInteractionEvents[_0xfb63('0xc')](_0x3fe487+':'+_0x99ddbb['id'],_0x99ddbb);WhatsappInteractionEvents[_0xfb63('0xc')](_0x3fe487,_0x99ddbb);_0x39cc2c(null);})[_0xfb63('0xd')](_0x39cc2c(null));};}for(var e in events){if(events[_0xfb63('0xe')](e)){var event=events[e];WhatsappInteraction[_0xfb63('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
index a7fcbfe..c3c8b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee49=['./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closedAt','format','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x5498b8,_0x3fd10c){var _0x13c31c=function(_0x1ecf6f){while(--_0x1ecf6f){_0x5498b8['push'](_0x5498b8['shift']());}};_0x13c31c(++_0x3fd10c);}(_0xee49,0x15b));var _0x9ee4=function(_0x19903c,_0x5192e4){_0x19903c=_0x19903c-0x0;var _0x222a6c=_0xee49[_0x19903c];return _0x222a6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ee4('0x0'))(_0x9ee4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ee4('0x2'));var fs=require('fs');var path=require(_0x9ee4('0x3'));var rimraf=require('rimraf');var config=require(_0x9ee4('0x4'));var attributes=require(_0x9ee4('0x5'));module[_0x9ee4('0x6')]=function(_0x4117be,_0x5c7090){return _0x4117be['define'](_0x9ee4('0x7'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d4c8d,_0x291bb6,_0x44b5ed){if(_0x4d4c8d[_0x9ee4('0x8')]('closed')){_0x4d4c8d[_0x9ee4('0x9')]=moment()[_0x9ee4('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x44b5ed(null,_0x4d4c8d);}}});};
\ No newline at end of file
+var _0x9c1e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x2ea7f3,_0x3fe17d){var _0x54546e=function(_0x2bb575){while(--_0x2bb575){_0x2ea7f3['push'](_0x2ea7f3['shift']());}};_0x54546e(++_0x3fe17d);}(_0x9c1e,0x66));var _0xe9c1=function(_0x27672b,_0x49447d){_0x27672b=_0x27672b-0x0;var _0x1aa1a6=_0x9c1e[_0x27672b];return _0x1aa1a6;};'use strict';var _=require(_0xe9c1('0x0'));var util=require('util');var logger=require(_0xe9c1('0x1'))(_0xe9c1('0x2'));var moment=require(_0xe9c1('0x3'));var BPromise=require(_0xe9c1('0x4'));var rp=require(_0xe9c1('0x5'));var fs=require('fs');var path=require(_0xe9c1('0x6'));var rimraf=require(_0xe9c1('0x7'));var config=require(_0xe9c1('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xe9c1('0x9')]=function(_0x5aa1ba,_0x39aa51){return _0x5aa1ba[_0xe9c1('0xa')](_0xe9c1('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f9247,_0x39fc14,_0x13bb75){if(_0x2f9247[_0xe9c1('0xc')]('closed')){_0x2f9247[_0xe9c1('0xd')]=moment()['format'](_0xe9c1('0xe'));}_0x13bb75(null,_0x2f9247);}}});};
\ No newline at end of file
index edcdfda..f52515d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee39=['raw','where','limit','then','stringify','find','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','WhatsappInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options'];(function(_0x4a3393,_0x1a58fa){var _0x2a8c95=function(_0x4781ea){while(--_0x4781ea){_0x4a3393['push'](_0x4a3393['shift']());}};_0x2a8c95(++_0x1a58fa);}(_0xee39,0x142));var _0x9ee3=function(_0x240355,_0x1df189){_0x240355=_0x240355-0x0;var _0xa47902=_0xee39[_0x240355];return _0xa47902;};'use strict';var _=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var moment=require(_0x9ee3('0x2'));var BPromise=require(_0x9ee3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ee3('0x4'));var db=require(_0x9ee3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ee3('0x6'))(_0x9ee3('0x7'));var config=require('../../config/environment');var jayson=require(_0x9ee3('0x8'));var client=jayson['client'][_0x9ee3('0x9')]({'port':0x232a});config[_0x9ee3('0xa')]=_[_0x9ee3('0xb')](config[_0x9ee3('0xa')],{'host':_0x9ee3('0xc'),'port':0x18eb});var socket=require(_0x9ee3('0xd'))(new Redis(config[_0x9ee3('0xa')]));require('./whatsappInteraction.socket')[_0x9ee3('0xe')](socket);function respondWithRpcPromise(_0x29619e,_0x559c67,_0x51c5ae){return new BPromise(function(_0x171e22,_0xf89e80){return client['request'](_0x29619e,_0x51c5ae)['then'](function(_0x24ac51){logger[_0x9ee3('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x559c67,'request\x20sent');logger[_0x9ee3('0x10')](_0x9ee3('0x11'),_0x559c67,'request\x20sent',JSON['stringify'](_0x24ac51));if(_0x24ac51['error']){if(_0x24ac51[_0x9ee3('0x12')][_0x9ee3('0x13')]===0x1f4){logger[_0x9ee3('0x12')](_0x9ee3('0x14'),_0x559c67,_0x24ac51[_0x9ee3('0x12')][_0x9ee3('0x15')]);return _0xf89e80(_0x24ac51[_0x9ee3('0x12')][_0x9ee3('0x15')]);}logger[_0x9ee3('0x12')](_0x9ee3('0x14'),_0x559c67,_0x24ac51['error']['message']);return _0x171e22(_0x24ac51['error'][_0x9ee3('0x15')]);}else{logger[_0x9ee3('0xf')](_0x9ee3('0x14'),_0x559c67,_0x9ee3('0x16'));_0x171e22(_0x24ac51[_0x9ee3('0x17')][_0x9ee3('0x15')]);}})[_0x9ee3('0x18')](function(_0x1a341a){logger['error'](_0x9ee3('0x14'),_0x559c67,_0x1a341a);_0xf89e80(_0x1a341a);});});}exports[_0x9ee3('0x19')]=function(_0x5d1e47){var _0x4f935f=this;return new Promise(function(_0x5cf3a8,_0xadac8f){return db[_0x9ee3('0x1a')]['update'](_0x5d1e47[_0x9ee3('0x1b')],{'raw':_0x5d1e47[_0x9ee3('0x1c')]?_0x5d1e47[_0x9ee3('0x1c')][_0x9ee3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d1e47[_0x9ee3('0x1c')]?_0x5d1e47[_0x9ee3('0x1c')][_0x9ee3('0x1e')]||null:null,'attributes':_0x5d1e47[_0x9ee3('0x1c')]?_0x5d1e47[_0x9ee3('0x1c')]['attributes']||null:null,'limit':_0x5d1e47[_0x9ee3('0x1c')]?_0x5d1e47[_0x9ee3('0x1c')][_0x9ee3('0x1f')]||null:null})[_0x9ee3('0x20')](function(_0x122f57){logger['info']('UpdateWhatsappInteraction',_0x5d1e47);logger['debug'](_0x9ee3('0x19'),_0x5d1e47,JSON[_0x9ee3('0x21')](_0x122f57));_0x5cf3a8(_0x122f57);})[_0x9ee3('0x18')](function(_0x1f0eb4){logger['error'](_0x9ee3('0x19'),_0x1f0eb4['message'],_0x5d1e47);_0xadac8f(_0x4f935f[_0x9ee3('0x12')](0x1f4,_0x1f0eb4['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x133b0a){return new Promise(function(_0x1f059a,_0x2acd3){return db['WhatsappInteraction'][_0x9ee3('0x22')]({'where':_0x133b0a['options']?_0x133b0a[_0x9ee3('0x1c')]['where']||null:null})['then'](function(_0x1900fe){if(_0x1900fe){return _0x1900fe[_0x9ee3('0x23')](_0x133b0a[_0x9ee3('0x1b')]['ids'],_[_0x9ee3('0x24')](_0x133b0a[_0x9ee3('0x1b')],['ids','id'])||{});}})[_0x9ee3('0x25')](function(_0x1c367b){logger[_0x9ee3('0xf')](_0x9ee3('0x26'),_0x133b0a);logger[_0x9ee3('0x10')]('AddTags',_0x133b0a,JSON[_0x9ee3('0x21')](_0x1c367b));_0x1f059a(_0x1c367b);})['catch'](function(_0x11da68){logger[_0x9ee3('0x12')](_0x9ee3('0x26'),_0x11da68['message'],_0x133b0a);_0x2acd3(_this[_0x9ee3('0x12')](0x1f4,_0x11da68['message']));});});};
\ No newline at end of file
+var _0xbd33=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','limit','debug','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis'];(function(_0x2a487f,_0x4b0c0d){var _0x17a7cc=function(_0x28804c){while(--_0x28804c){_0x2a487f['push'](_0x2a487f['shift']());}};_0x17a7cc(++_0x4b0c0d);}(_0xbd33,0x15b));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3bd3('0x0'));var util=require(_0x3bd3('0x1'));var moment=require(_0x3bd3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3bd3('0x4'))(_0x3bd3('0x5'));var config=require(_0x3bd3('0x6'));var jayson=require(_0x3bd3('0x7'));var client=jayson[_0x3bd3('0x8')][_0x3bd3('0x9')]({'port':0x232a});config[_0x3bd3('0xa')]=_[_0x3bd3('0xb')](config[_0x3bd3('0xa')],{'host':_0x3bd3('0xc'),'port':0x18eb});var socket=require(_0x3bd3('0xd'))(new Redis(config['redis']));require(_0x3bd3('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f8621,_0x5da0df,_0x3b7da5){return new BPromise(function(_0x56d8f3,_0x18c929){return client[_0x3bd3('0xf')](_0x3f8621,_0x3b7da5)[_0x3bd3('0x10')](function(_0x4759ac){logger[_0x3bd3('0x11')](_0x3bd3('0x12'),_0x5da0df,_0x3bd3('0x13'));logger['debug'](_0x3bd3('0x14'),_0x5da0df,_0x3bd3('0x13'),JSON[_0x3bd3('0x15')](_0x4759ac));if(_0x4759ac[_0x3bd3('0x16')]){if(_0x4759ac[_0x3bd3('0x16')][_0x3bd3('0x17')]===0x1f4){logger[_0x3bd3('0x16')](_0x3bd3('0x12'),_0x5da0df,_0x4759ac[_0x3bd3('0x16')][_0x3bd3('0x18')]);return _0x18c929(_0x4759ac[_0x3bd3('0x16')]['message']);}logger['error'](_0x3bd3('0x12'),_0x5da0df,_0x4759ac[_0x3bd3('0x16')][_0x3bd3('0x18')]);return _0x56d8f3(_0x4759ac[_0x3bd3('0x16')]['message']);}else{logger[_0x3bd3('0x11')](_0x3bd3('0x12'),_0x5da0df,_0x3bd3('0x13'));_0x56d8f3(_0x4759ac['result']['message']);}})[_0x3bd3('0x19')](function(_0x141f56){logger[_0x3bd3('0x16')](_0x3bd3('0x12'),_0x5da0df,_0x141f56);_0x18c929(_0x141f56);});});}exports[_0x3bd3('0x1a')]=function(_0x1ec01e){var _0x5836de=this;return new Promise(function(_0x5116d8,_0x3a1914){return db[_0x3bd3('0x1b')][_0x3bd3('0x1c')](_0x1ec01e[_0x3bd3('0x1d')],{'raw':_0x1ec01e[_0x3bd3('0x1e')]?_0x1ec01e[_0x3bd3('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec01e[_0x3bd3('0x1e')]?_0x1ec01e['options'][_0x3bd3('0x1f')]||null:null,'attributes':_0x1ec01e[_0x3bd3('0x1e')]?_0x1ec01e[_0x3bd3('0x1e')]['attributes']||null:null,'limit':_0x1ec01e[_0x3bd3('0x1e')]?_0x1ec01e[_0x3bd3('0x1e')][_0x3bd3('0x20')]||null:null})[_0x3bd3('0x10')](function(_0x53ca29){logger[_0x3bd3('0x11')]('UpdateWhatsappInteraction',_0x1ec01e);logger[_0x3bd3('0x21')]('UpdateWhatsappInteraction',_0x1ec01e,JSON['stringify'](_0x53ca29));_0x5116d8(_0x53ca29);})[_0x3bd3('0x19')](function(_0x362fd0){logger[_0x3bd3('0x16')]('UpdateWhatsappInteraction',_0x362fd0[_0x3bd3('0x18')],_0x1ec01e);_0x3a1914(_0x5836de['error'](0x1f4,_0x362fd0[_0x3bd3('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x310af7){return new Promise(function(_0x256a94,_0x408881){return db['WhatsappInteraction']['find']({'where':_0x310af7[_0x3bd3('0x1e')]?_0x310af7[_0x3bd3('0x1e')][_0x3bd3('0x1f')]||null:null})[_0x3bd3('0x10')](function(_0xba81c2){if(_0xba81c2){return _0xba81c2[_0x3bd3('0x22')](_0x310af7['body'][_0x3bd3('0x23')],_[_0x3bd3('0x24')](_0x310af7[_0x3bd3('0x1d')],[_0x3bd3('0x23'),'id'])||{});}})[_0x3bd3('0x25')](function(_0x4c6a8f){logger[_0x3bd3('0x11')](_0x3bd3('0x26'),_0x310af7);logger[_0x3bd3('0x21')]('AddTags',_0x310af7,JSON[_0x3bd3('0x15')](_0x4c6a8f));_0x256a94(_0x4c6a8f);})['catch'](function(_0x4e8c24){logger[_0x3bd3('0x16')](_0x3bd3('0x26'),_0x4e8c24[_0x3bd3('0x18')],_0x310af7);_0x408881(_this['error'](0x1f4,_0x4e8c24[_0x3bd3('0x18')]));});});};
\ No newline at end of file
index 2c69661..19da0ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x754f=['register','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x754f,0xb1));var _0xf754=function(_0x6ad633,_0x201bc9){_0x6ad633=_0x6ad633-0x0;var _0x300b5e=_0x754f[_0x6ad633];return _0x300b5e;};'use strict';var WhatsappInteractionEvents=require(_0xf754('0x0'));var events=['save',_0xf754('0x1'),_0xf754('0x2')];function createListener(_0x1daee2,_0x319465){return function(_0x2e2d6e){_0x319465[_0xf754('0x3')](_0x1daee2,_0x2e2d6e);};}function removeListener(_0x19566e,_0x5b7bfb){return function(){WhatsappInteractionEvents[_0xf754('0x4')](_0x19566e,_0x5b7bfb);};}exports[_0xf754('0x5')]=function(_0x4e6e26){for(var _0x1843e4=0x0,_0x1426d0=events['length'];_0x1843e4<_0x1426d0;_0x1843e4++){var _0x9e0f1c=events[_0x1843e4];var _0xcc8288=createListener(_0xf754('0x6')+_0x9e0f1c,_0x4e6e26);WhatsappInteractionEvents['on'](_0x9e0f1c,_0xcc8288);}};
\ No newline at end of file
+var _0x8b67=['update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x8b67,0x8d));var _0x78b6=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x8b67[_0x4baae2];return _0x1a2285;};'use strict';var WhatsappInteractionEvents=require(_0x78b6('0x0'));var events=[_0x78b6('0x1'),_0x78b6('0x2'),_0x78b6('0x3')];function createListener(_0xed4ddf,_0x461b7d){return function(_0x4de994){_0x461b7d[_0x78b6('0x4')](_0xed4ddf,_0x4de994);};}function removeListener(_0x30cf92,_0x2dcf29){return function(){WhatsappInteractionEvents[_0x78b6('0x5')](_0x30cf92,_0x2dcf29);};}exports[_0x78b6('0x6')]=function(_0x2479de){for(var _0x1c4f93=0x0,_0x4477fe=events['length'];_0x1c4f93<_0x4477fe;_0x1c4f93++){var _0x2477b4=events[_0x1c4f93];var _0x27b082=createListener(_0x78b6('0x7')+_0x2477b4,_0x2479de);WhatsappInteractionEvents['on'](_0x2477b4,_0x27b082);}};
\ No newline at end of file
index 58119e2..588607a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ca7=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','tracked','whatsapp','/:id/status','status','/:id','update','put','/:id/accept','/:id/reject','delete'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x7ca7,0x12d));var _0x77ca=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x7ca7[_0xfb42e6];return _0x27265b;};'use strict';var multer=require(_0x77ca('0x0'));var util=require(_0x77ca('0x1'));var path=require(_0x77ca('0x2'));var timeout=require(_0x77ca('0x3'));var express=require('express');var router=express[_0x77ca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77ca('0x5'));var interaction=require(_0x77ca('0x6'));var config=require(_0x77ca('0x7'));var controller=require('./whatsappMessage.controller');router[_0x77ca('0x8')]('/',auth[_0x77ca('0x9')](),controller[_0x77ca('0xa')]);router[_0x77ca('0x8')](_0x77ca('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x77ca('0x8')]('/:id',auth[_0x77ca('0x9')](),controller[_0x77ca('0xc')]);router[_0x77ca('0xd')]('/',auth[_0x77ca('0x9')](),interaction[_0x77ca('0xe')](_0x77ca('0xf'),'whatsappmessage:create'),controller['create']);router[_0x77ca('0xd')](_0x77ca('0x10'),controller[_0x77ca('0x11')]);router['put'](_0x77ca('0x12'),auth[_0x77ca('0x9')](),controller[_0x77ca('0x13')]);router[_0x77ca('0x14')](_0x77ca('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x77ca('0x14')](_0x77ca('0x16'),auth[_0x77ca('0x9')](),controller['reject']);router[_0x77ca('0x17')](_0x77ca('0x12'),auth['isAuthenticated'](),controller[_0x77ca('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xf58f=['whatsappmessage:create','create','/:id/status','put','update','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked'];(function(_0x10886a,_0x2edaf0){var _0x1f53af=function(_0x3bff6a){while(--_0x3bff6a){_0x10886a['push'](_0x10886a['shift']());}};_0x1f53af(++_0x2edaf0);}(_0xf58f,0xce));var _0xff58=function(_0x321a0d,_0x370859){_0x321a0d=_0x321a0d-0x0;var _0x53d8d9=_0xf58f[_0x321a0d];return _0x53d8d9;};'use strict';var multer=require(_0xff58('0x0'));var util=require(_0xff58('0x1'));var path=require(_0xff58('0x2'));var timeout=require('connect-timeout');var express=require(_0xff58('0x3'));var router=express['Router']();var fs_extra=require(_0xff58('0x4'));var auth=require(_0xff58('0x5'));var interaction=require(_0xff58('0x6'));var config=require(_0xff58('0x7'));var controller=require(_0xff58('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xff58('0x9')]);router[_0xff58('0xa')](_0xff58('0xb'),auth[_0xff58('0xc')](),controller[_0xff58('0xd')]);router[_0xff58('0xa')](_0xff58('0xe'),auth['isAuthenticated'](),controller[_0xff58('0xf')]);router[_0xff58('0x10')]('/',auth[_0xff58('0xc')](),interaction[_0xff58('0x11')]('whatsapp',_0xff58('0x12')),controller[_0xff58('0x13')]);router['post'](_0xff58('0x14'),controller['status']);router[_0xff58('0x15')]('/:id',auth[_0xff58('0xc')](),controller[_0xff58('0x16')]);router['put']('/:id/accept',auth[_0xff58('0xc')](),controller['accept']);router[_0xff58('0x15')](_0xff58('0x17'),auth[_0xff58('0xc')](),controller[_0xff58('0x18')]);router[_0xff58('0x19')](_0xff58('0xe'),auth[_0xff58('0xc')](),controller[_0xff58('0x1a')]);module[_0xff58('0x1b')]=router;
\ No newline at end of file
index b758bf4..751acdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d19=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x6d19,0x160));var _0x96d1=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x6d19[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x96d1('0x0'));module[_0x96d1('0x1')]={'body':{'type':Sequelize[_0x96d1('0x2')](_0x96d1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96d1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96d1('0x5')]('in',_0x96d1('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x96d1('0x7')](0xbe)},'phone':{'type':Sequelize[_0x96d1('0x7')]},'readAt':{'type':Sequelize[_0x96d1('0x8')]},'secret':{'type':Sequelize[_0x96d1('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x96d1('0x2')]}};
\ No newline at end of file
+var _0x4b99=['ENUM','out','STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x4b99,0x107));var _0x94b9=function(_0x5430fb,_0x282e25){_0x5430fb=_0x5430fb-0x0;var _0x4ae333=_0x4b99[_0x5430fb];return _0x4ae333;};'use strict';var Sequelize=require(_0x94b9('0x0'));module[_0x94b9('0x1')]={'body':{'type':Sequelize[_0x94b9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x94b9('0x3')]('in',_0x94b9('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x94b9('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x94b9('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x94b9('0x5')]},'providerResponse':{'type':Sequelize[_0x94b9('0x2')]}};
\ No newline at end of file
index 01d4caa..debb804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4af3=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','stack','name','index','rawAttributes','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','WhatsappMessage','includeAll','include','show','params','intersection','options','create','body','find','../../config/logger','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','update','isNil','read1stAt','interaction','[WHATSAPPMESSAGE: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','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir'];(function(_0x511b3c,_0x260c8c){var _0x318874=function(_0x2225bf){while(--_0x2225bf){_0x511b3c['push'](_0x511b3c['shift']());}};_0x318874(++_0x260c8c);}(_0x4af3,0x118));var _0x34af=function(_0x2adb04,_0x4d4356){_0x2adb04=_0x2adb04-0x0;var _0x3c1bca=_0x4af3[_0x2adb04];return _0x3c1bca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34af('0x0'));var zipdir=require(_0x34af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34af('0x2'));var Mustache=require(_0x34af('0x3'));var util=require(_0x34af('0x4'));var path=require(_0x34af('0x5'));var sox=require(_0x34af('0x6'));var csv=require(_0x34af('0x7'));var ejs=require(_0x34af('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34af('0x9'));var squel=require(_0x34af('0xa'));var crypto=require(_0x34af('0xb'));var jsforce=require(_0x34af('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x34af('0x7'));var querystring=require(_0x34af('0xd'));var Papa=require(_0x34af('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x34af('0xf'));var as=require(_0x34af('0x10'));var hardwareService=require(_0x34af('0x11'));var logger=require('../../config/logger')(_0x34af('0x12'));var utils=require(_0x34af('0x13'));var config=require(_0x34af('0x14'));var licenseUtil=require(_0x34af('0x15'));var db=require(_0x34af('0x16'))['db'];config[_0x34af('0x17')]=_[_0x34af('0x18')](config['redis'],{'host':_0x34af('0x19'),'port':0x18eb});var socket=require(_0x34af('0x1a'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x34af('0x1b')](socket);var jayson=require(_0x34af('0x1c'));var client=jayson[_0x34af('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x34af('0x1d')][_0x34af('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x120d66,_0x2cb71c,_0x59e900,_0x2f480f){return new BPromise(function(_0x30b6bf,_0x56b65d){var _0xd7a431=_0x2f480f||client;return _0xd7a431['request'](_0x120d66,_0x59e900)[_0x34af('0x1f')](function(_0x7f6f93){logger['info'](_0x34af('0x20'),_0x2cb71c,_0x34af('0x21'));logger[_0x34af('0x22')](_0x34af('0x23'),_0x2cb71c,_0x34af('0x21'),JSON[_0x34af('0x24')](_0x7f6f93));if(_0x7f6f93[_0x34af('0x25')]){if(_0x7f6f93[_0x34af('0x25')][_0x34af('0x26')]===0x1f4){logger[_0x34af('0x25')](_0x34af('0x20'),_0x2cb71c,_0x7f6f93[_0x34af('0x25')][_0x34af('0x27')]);return _0x56b65d(_0x7f6f93[_0x34af('0x25')]['message']);}logger[_0x34af('0x25')](_0x34af('0x20'),_0x2cb71c,_0x7f6f93[_0x34af('0x25')]['message']);return _0x30b6bf(_0x7f6f93[_0x34af('0x25')][_0x34af('0x27')]);}else{logger[_0x34af('0x28')](_0x34af('0x20'),_0x2cb71c,_0x34af('0x21'));_0x30b6bf(_0x7f6f93[_0x34af('0x29')][_0x34af('0x27')]);}})[_0x34af('0x2a')](function(_0x33a6aa){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2cb71c,_0x33a6aa);_0x56b65d(_0x33a6aa);});});}function respondWithStatusCode(_0x55d10b,_0x57ed40){_0x57ed40=_0x57ed40||0xcc;return function(_0x8b2a6){if(_0x8b2a6){return _0x55d10b[_0x34af('0x2b')](_0x57ed40);}return _0x55d10b[_0x34af('0x2c')](_0x57ed40)[_0x34af('0x2d')]();};}function respondWithResult(_0x590557,_0x460ab5){_0x460ab5=_0x460ab5||0xc8;return function(_0x14504c){if(_0x14504c){return _0x590557['status'](_0x460ab5)[_0x34af('0x2e')](_0x14504c);}};}function respondWithFilteredResult(_0x53bbe1,_0x55c70e){return function(_0x50b991){if(_0x50b991){var _0x2ab6f8=typeof _0x55c70e[_0x34af('0x2f')]===_0x34af('0x30')&&typeof _0x55c70e[_0x34af('0x31')]===_0x34af('0x30');var _0x55a542=_0x50b991['count'];var _0x5d4d47=_0x2ab6f8?0x0:_0x55c70e[_0x34af('0x2f')];var _0x2cf6db=_0x2ab6f8?_0x50b991[_0x34af('0x32')]:_0x55c70e[_0x34af('0x2f')]+_0x55c70e[_0x34af('0x31')];var _0x40b5cf;if(_0x2cf6db>=_0x55a542){_0x2cf6db=_0x55a542;_0x40b5cf=0xc8;}else{_0x40b5cf=0xce;}_0x53bbe1['status'](_0x40b5cf);return _0x53bbe1['set'](_0x34af('0x33'),_0x5d4d47+'-'+_0x2cf6db+'/'+_0x55a542)['json'](_0x50b991);}return null;};}function patchUpdates(_0x5cf800){return function(_0x1f6469){try{jsonpatch[_0x34af('0x34')](_0x1f6469,_0x5cf800,!![]);}catch(_0x2f6ff7){return BPromise[_0x34af('0x35')](_0x2f6ff7);}return _0x1f6469[_0x34af('0x36')]();};}function saveUpdates(_0x2f2e28,_0x4d1d09){return function(_0x23104b){if(_0x23104b){return _0x23104b['update'](_0x2f2e28)[_0x34af('0x1f')](function(_0x28a307){return _0x28a307;});}return null;};}function removeEntity(_0x234e0b,_0x5b4efa){return function(_0x13e1af){if(_0x13e1af){return _0x13e1af[_0x34af('0x37')]()['then'](function(){_0x234e0b['status'](0xcc)[_0x34af('0x2d')]();});}};}function handleEntityNotFound(_0x43b264,_0x30d4c8){return function(_0xcbc73a){if(!_0xcbc73a){_0x43b264['sendStatus'](0x194);}return _0xcbc73a;};}function handleError(_0x43214f,_0x55ee51){_0x55ee51=_0x55ee51||0x1f4;return function(_0x4cc9a2){logger[_0x34af('0x25')](_0x4cc9a2[_0x34af('0x38')]);if(_0x4cc9a2[_0x34af('0x39')]){delete _0x4cc9a2[_0x34af('0x39')];}_0x43214f['status'](_0x55ee51)['send'](_0x4cc9a2);};}exports[_0x34af('0x3a')]=function(_0x5ab8ce,_0x5d0670){var _0x25604e={},_0x1aeb6e={},_0x5176d7={'count':0x0,'rows':[]};var _0x3e087f=_['map'](db['WhatsappMessage'][_0x34af('0x3b')],function(_0xdbcaee){return{'name':_0xdbcaee['fieldName'],'type':_0xdbcaee[_0x34af('0x3c')][_0x34af('0x3d')]};});_0x1aeb6e['model']=_[_0x34af('0x3e')](_0x3e087f,_0x34af('0x39'));_0x1aeb6e[_0x34af('0x3f')]=_[_0x34af('0x40')](_0x5ab8ce[_0x34af('0x3f')]);_0x1aeb6e[_0x34af('0x41')]=_['intersection'](_0x1aeb6e[_0x34af('0x42')],_0x1aeb6e[_0x34af('0x3f')]);_0x25604e[_0x34af('0x43')]=_['intersection'](_0x1aeb6e[_0x34af('0x42')],qs[_0x34af('0x44')](_0x5ab8ce[_0x34af('0x3f')][_0x34af('0x44')]));_0x25604e[_0x34af('0x43')]=_0x25604e[_0x34af('0x43')][_0x34af('0x45')]?_0x25604e['attributes']:_0x1aeb6e['model'];if(!_0x5ab8ce['query'][_0x34af('0x46')](_0x34af('0x47'))){_0x25604e[_0x34af('0x31')]=qs[_0x34af('0x31')](_0x5ab8ce[_0x34af('0x3f')][_0x34af('0x31')]);_0x25604e[_0x34af('0x2f')]=qs['offset'](_0x5ab8ce[_0x34af('0x3f')][_0x34af('0x2f')]);}_0x25604e[_0x34af('0x48')]=qs[_0x34af('0x49')](_0x5ab8ce[_0x34af('0x3f')]['sort']);_0x25604e['where']=qs['filters'](_[_0x34af('0x4a')](_0x5ab8ce['query'],_0x1aeb6e[_0x34af('0x41')]),_0x3e087f);if(_0x5ab8ce[_0x34af('0x3f')]['filter']){_0x25604e[_0x34af('0x4b')]=_[_0x34af('0x4c')](_0x25604e['where'],{'$or':_['map'](_0x3e087f,function(_0x84cfd){if(_0x84cfd['type']!==_0x34af('0x4d')){var _0xcf2c91={};_0xcf2c91[_0x84cfd[_0x34af('0x39')]]={'$like':'%'+_0x5ab8ce[_0x34af('0x3f')][_0x34af('0x4e')]+'%'};return _0xcf2c91;}})});}_0x25604e=_[_0x34af('0x4c')]({},_0x25604e,_0x5ab8ce['options']);var _0xb3f83a={'where':_0x25604e['where']};return db[_0x34af('0x4f')]['count'](_0xb3f83a)[_0x34af('0x1f')](function(_0x20888a){_0x5176d7[_0x34af('0x32')]=_0x20888a;if(_0x5ab8ce['query'][_0x34af('0x50')]){_0x25604e[_0x34af('0x51')]=[{'all':!![]}];}return db[_0x34af('0x4f')]['findAll'](_0x25604e);})[_0x34af('0x1f')](function(_0x1767f2){_0x5176d7['rows']=_0x1767f2;return _0x5176d7;})[_0x34af('0x1f')](respondWithFilteredResult(_0x5d0670,_0x25604e))[_0x34af('0x2a')](handleError(_0x5d0670,null));};exports[_0x34af('0x52')]=function(_0x540f56,_0x10f3bf){var _0x3d24b7={'raw':!![],'where':{'id':_0x540f56[_0x34af('0x53')]['id']}},_0x24ed1c={};_0x24ed1c[_0x34af('0x42')]=_[_0x34af('0x40')](db[_0x34af('0x4f')][_0x34af('0x3b')]);_0x24ed1c[_0x34af('0x3f')]=_[_0x34af('0x40')](_0x540f56[_0x34af('0x3f')]);_0x24ed1c[_0x34af('0x41')]=_[_0x34af('0x54')](_0x24ed1c[_0x34af('0x42')],_0x24ed1c[_0x34af('0x3f')]);_0x3d24b7[_0x34af('0x43')]=_[_0x34af('0x54')](_0x24ed1c['model'],qs['fields'](_0x540f56[_0x34af('0x3f')]['fields']));_0x3d24b7[_0x34af('0x43')]=_0x3d24b7[_0x34af('0x43')][_0x34af('0x45')]?_0x3d24b7[_0x34af('0x43')]:_0x24ed1c[_0x34af('0x42')];if(_0x540f56[_0x34af('0x3f')][_0x34af('0x50')]){_0x3d24b7[_0x34af('0x51')]=[{'all':!![]}];}_0x3d24b7=_[_0x34af('0x4c')]({},_0x3d24b7,_0x540f56[_0x34af('0x55')]);return db['WhatsappMessage']['find'](_0x3d24b7)[_0x34af('0x1f')](handleEntityNotFound(_0x10f3bf,null))['then'](respondWithResult(_0x10f3bf,null))[_0x34af('0x2a')](handleError(_0x10f3bf,null));};exports[_0x34af('0x56')]=function(_0x50f386,_0x5b0ed1){return db[_0x34af('0x4f')][_0x34af('0x56')](_0x50f386[_0x34af('0x57')],{})['then'](respondWithResult(_0x5b0ed1,0xc9))[_0x34af('0x2a')](handleError(_0x5b0ed1,null));};exports['update']=function(_0x3f92af,_0x4a7048){if(_0x3f92af['body']['id']){delete _0x3f92af['body']['id'];}return db[_0x34af('0x4f')][_0x34af('0x58')]({'where':{'id':_0x3f92af[_0x34af('0x53')]['id']}})[_0x34af('0x1f')](handleEntityNotFound(_0x4a7048,null))['then'](saveUpdates(_0x3f92af['body'],null))['then'](respondWithResult(_0x4a7048,null))[_0x34af('0x2a')](handleError(_0x4a7048,null));};exports[_0x34af('0x37')]=function(_0x41a958,_0x360491){return db['WhatsappMessage'][_0x34af('0x58')]({'where':{'id':_0x41a958[_0x34af('0x53')]['id']}})[_0x34af('0x1f')](handleEntityNotFound(_0x360491,null))[_0x34af('0x1f')](removeEntity(_0x360491,null))['catch'](handleError(_0x360491,null));};exports['describe']=function(_0x5a9488,_0x399665){return db[_0x34af('0x4f')]['describe']()[_0x34af('0x1f')](respondWithResult(_0x399665,null))['catch'](handleError(_0x399665,null));};var interaction_log=require(_0x34af('0x59'))(_0x34af('0x5a'));exports[_0x34af('0x5b')]=function(_0xac700f,_0x56570d,_0x2c2af8){var _0x2e8787={'agent':{},'channel':_0x34af('0x5c')};if(_0xac700f[_0x34af('0x57')]['id']){delete _0xac700f[_0x34af('0x57')]['id'];}_0xac700f[_0x34af('0x57')][_0x34af('0x5d')]=!![];_0xac700f[_0x34af('0x57')]['readAt']=moment()[_0x34af('0x5e')](_0x34af('0x5f'));_0xac700f[_0x34af('0x57')][_0x34af('0x60')]=_0xac700f[_0x34af('0x57')]['UserId']||_0xac700f['user']['id'];_0x2e8787[_0x34af('0x61')]['id']=_0xac700f['body'][_0x34af('0x60')];return db[_0x34af('0x4f')][_0x34af('0x58')]({'where':{'id':_0xac700f[_0x34af('0x53')]['id'],'UserId':null}})[_0x34af('0x1f')](handleEntityNotFound(_0x56570d,null))[_0x34af('0x1f')](saveUpdates(_0xac700f[_0x34af('0x57')],null))[_0x34af('0x1f')](function(_0x5d7641){if(_0x5d7641){_0x2e8787[_0x34af('0x27')]=_0x5d7641[_0x34af('0x62')]({'plain':!![]});return db[_0x34af('0x63')][_0x34af('0x58')]({'where':{'id':_0x5d7641['WhatsappInteractionId']}});}return null;})[_0x34af('0x1f')](handleEntityNotFound(_0x56570d,null))['then'](function(_0x1285ca){if(_0x1285ca){return _0x1285ca[_0x34af('0x64')]({'UserId':_0xac700f[_0x34af('0x57')][_0x34af('0x60')],'read1stAt':_[_0x34af('0x65')](_0x1285ca[_0x34af('0x66')])?moment()[_0x34af('0x5e')](_0x34af('0x5f')):undefined});}return null;})['then'](function(_0x5c2029){if(_0x5c2029){_0x2e8787[_0x34af('0x67')]=_0x5c2029[_0x34af('0x62')]({'plain':!![]});interaction_log['info'](_0x34af('0x68'),_0xac700f[_0x34af('0x69')]['id'],_0xac700f['user'][_0x34af('0x39')],_0xac700f[_0x34af('0x69')][_0x34af('0x6a')],_0x2e8787[_0x34af('0x67')]['id'],_0xac700f[_0x34af('0x57')]?JSON[_0x34af('0x24')](_0xac700f[_0x34af('0x57')]):_0x34af('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x34af('0x6c'),_0x2e8787);}return null;})[_0x34af('0x1f')](function(_0x29663b){var _0x2d306e=_0x34af('0x6d')+_0x29663b['message'][_0x34af('0x6e')];return db[_0x34af('0x6f')][_0x34af('0x3f')](_0x2d306e,{'type':db[_0x34af('0x70')][_0x34af('0x71')][_0x34af('0x72')],'raw':!![]})[_0x34af('0x1f')](function(_0x8104f1){return _0x8104f1;});})[_0x34af('0x1f')](function(_0x144334){if(_0x144334){_0x2e8787['message']['contact']=_0x144334[0x0];if(!_0xac700f[_0x34af('0x57')][_0x34af('0x60')])return;return db['User']['find']({'where':{'id':_0xac700f[_0x34af('0x57')][_0x34af('0x60')],'role':_0x34af('0x61')},'attributes':['id',_0x34af('0x39'),_0x34af('0x73'),_0x34af('0x74'),_0x34af('0x75')],'raw':!![]});}return null;})[_0x34af('0x1f')](function(_0x4314fb){if(!_0x4314fb)return null;_0x2e8787[_0x34af('0x27')]['agent']=_0x4314fb;return _0x2e8787;})[_0x34af('0x1f')](function(_0xb6e14){if(_0xb6e14){if(_0xac700f[_0x34af('0x57')][_0x34af('0x76')]){_0x2e8787['message'][_0x34af('0x77')]=util['format'](_0x34af('0x78'),_0xac700f['user'][_0x34af('0x39')]);_0x2e8787[_0x34af('0x27')][_0x34af('0x79')]=_0x2e8787[_0x34af('0x79')];_0x2e8787[_0x34af('0x27')][_0x34af('0x7a')]='accept';return respondWithRpcPromise(_0x34af('0x7b'),_0x34af('0x7b'),{'event':_0x34af('0x7c'),'message':_0x2e8787[_0x34af('0x27')]},client9002)[_0x34af('0x1f')](function(){return _0x2e8787;});}return _0x2e8787;}return null;})[_0x34af('0x1f')](respondWithResult(_0x56570d,null))[_0x34af('0x2a')](handleError(_0x56570d,null));};var interaction_log=require(_0x34af('0x59'))(_0x34af('0x5a'));exports[_0x34af('0x35')]=function(_0x5158fd,_0x275b03,_0xbfcd8a){var _0x30df5b={'agent':{},'channel':_0x34af('0x5c')};if(_0x5158fd[_0x34af('0x57')]['id']){delete _0x5158fd[_0x34af('0x57')]['id'];}_0x5158fd['body']['UserId']=_0x5158fd[_0x34af('0x57')]['UserId']||_0x5158fd[_0x34af('0x69')]['id'];_0x30df5b[_0x34af('0x61')]['id']=_0x5158fd[_0x34af('0x57')]['UserId'];return db[_0x34af('0x4f')][_0x34af('0x58')]({'where':{'id':_0x5158fd[_0x34af('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x275b03,null))['then'](function(_0xc71a01){if(_0xc71a01){_0x30df5b[_0x34af('0x27')]=_0xc71a01[_0x34af('0x62')]({'plain':!![]});return db[_0x34af('0x63')][_0x34af('0x58')]({'where':{'id':_0xc71a01[_0x34af('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x275b03,null))['then'](function(_0x57507d){if(_0x57507d){_0x30df5b[_0x34af('0x67')]=_0x57507d[_0x34af('0x62')]({'plain':!![]});interaction_log[_0x34af('0x28')](_0x34af('0x7e'),_0x5158fd['user']['id'],_0x5158fd['user'][_0x34af('0x39')],_0x5158fd['user'][_0x34af('0x6a')],_0x30df5b[_0x34af('0x67')]['id'],_0x5158fd[_0x34af('0x57')]?JSON[_0x34af('0x24')](_0x5158fd[_0x34af('0x57')]):_0x34af('0x6b'));return respondWithRpcPromise(_0x34af('0x7f'),_0x34af('0x80'),_0x30df5b);}return null;})[_0x34af('0x1f')](function(_0x715527){var _0x22855b=_0x34af('0x6d')+_0x715527['message'][_0x34af('0x6e')];return db[_0x34af('0x6f')][_0x34af('0x3f')](_0x22855b,{'type':db[_0x34af('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x34af('0x1f')](function(_0x2e7ad4){return _0x2e7ad4;});})[_0x34af('0x1f')](function(_0x4bed8c){if(_0x4bed8c){_0x30df5b[_0x34af('0x27')][_0x34af('0x81')]=_0x4bed8c[0x0];if(!_0x5158fd[_0x34af('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x5158fd[_0x34af('0x57')][_0x34af('0x60')],'role':'agent'},'attributes':['id',_0x34af('0x39'),_0x34af('0x73'),_0x34af('0x74'),'internal'],'raw':!![]});}return null;})[_0x34af('0x1f')](function(_0x51831e){if(!_0x51831e)return null;_0x30df5b[_0x34af('0x27')]['agent']=_0x51831e;return _0x30df5b;})[_0x34af('0x1f')](function(_0x64cf8d){if(_0x64cf8d){_0x64cf8d[_0x34af('0x27')][_0x34af('0x77')]=util[_0x34af('0x5e')](_0x34af('0x78'),_0x5158fd['user']['name']);_0x64cf8d[_0x34af('0x27')][_0x34af('0x79')]=_0x30df5b[_0x34af('0x79')];_0x64cf8d[_0x34af('0x27')]['event']='reject';respondWithRpcPromise(_0x34af('0x7b'),_0x34af('0x7b'),{'event':_0x34af('0x82'),'message':_0x64cf8d['message']},client9002);return _0x30df5b;}return null;})[_0x34af('0x1f')](respondWithResult(_0x275b03,null))[_0x34af('0x2a')](handleError(_0x275b03,null));};exports['status']=function(_0x3231b2,_0x374bad,_0x3c749f){if(_0x3231b2[_0x34af('0x57')]['id']){delete _0x3231b2[_0x34af('0x57')]['id'];}var _0x28f93b;return db[_0x34af('0x4f')][_0x34af('0x58')]({'where':{'id':_0x3231b2[_0x34af('0x53')]['id']}})['then'](handleEntityNotFound(_0x374bad,null))[_0x34af('0x1f')](function(_0x364858){if(_0x364858){_0x28f93b=_0x364858;return db[_0x34af('0x83')][_0x34af('0x58')]({'where':{'id':_0x364858[_0x34af('0x84')]}});}})[_0x34af('0x1f')](handleEntityNotFound(_0x374bad,null))[_0x34af('0x1f')](function(_0x5e8ac5){if(_0x5e8ac5){logger[_0x34af('0x22')](_0x34af('0x85'),_0x34af('0x2c'),_0x34af('0x86'),_0x5e8ac5[_0x34af('0x3c')],util[_0x34af('0x87')](_0x3231b2[_0x34af('0x57')],{'showHidden':![],'depth':null}));switch(_0x5e8ac5['type']){case _0x34af('0x88'):if(_0x3231b2[_0x34af('0x57')][_0x34af('0x89')]&&_0x3231b2['body'][_0x34af('0x89')]===_0x28f93b[_0x34af('0x8a')]&&_0x3231b2[_0x34af('0x57')]['MessageStatus']&&_0x3231b2[_0x34af('0x57')][_0x34af('0x8b')]===_0x34af('0x5d')){return _0x28f93b[_0x34af('0x64')]({'read':!![]});}else{logger[_0x34af('0x25')](_0x34af('0x8c'),_0x34af('0x2c'),_0x34af('0x88'),util[_0x34af('0x87')](_0x3231b2[_0x34af('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x28f93b;}})[_0x34af('0x1f')](respondWithResult(_0x374bad,null))[_0x34af('0x2a')](handleError(_0x374bad,null));};
\ No newline at end of file
+var _0x788c=['http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','WhatsappMessage','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','event','accept','acceptmessage','null','RejectMessage','rejectMessage','ContactId','Sequelize','contact','fullname','EventManager','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client'];(function(_0x3fd656,_0x1f1a98){var _0x2b3fb0=function(_0x565be7){while(--_0x565be7){_0x3fd656['push'](_0x3fd656['shift']());}};_0x2b3fb0(++_0x1f1a98);}(_0x788c,0xf6));var _0xc788=function(_0x27ae2e,_0x146499){_0x27ae2e=_0x27ae2e-0x0;var _0x4546e8=_0x788c[_0x27ae2e];return _0x4546e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc788('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc788('0x1'));var rp=require('request-promise');var moment=require(_0xc788('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc788('0x3'));var path=require(_0xc788('0x4'));var sox=require(_0xc788('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc788('0x6'));var _=require(_0xc788('0x7'));var squel=require(_0xc788('0x8'));var crypto=require(_0xc788('0x9'));var jsforce=require(_0xc788('0xa'));var deskjs=require(_0xc788('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc788('0xc'));var Papa=require('papaparse');var Redis=require(_0xc788('0xd'));var authService=require(_0xc788('0xe'));var qs=require(_0xc788('0xf'));var as=require(_0xc788('0x10'));var hardwareService=require(_0xc788('0x11'));var logger=require(_0xc788('0x12'))(_0xc788('0x13'));var utils=require('../../config/utils');var config=require(_0xc788('0x14'));var licenseUtil=require(_0xc788('0x15'));var db=require(_0xc788('0x16'))['db'];config[_0xc788('0x17')]=_['defaults'](config['redis'],{'host':_0xc788('0x18'),'port':0x18eb});var socket=require(_0xc788('0x19'))(new Redis(config['redis']));require(_0xc788('0x1a'))[_0xc788('0x1b')](socket);var jayson=require(_0xc788('0x1c'));var client=jayson[_0xc788('0x1d')][_0xc788('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xc788('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x21bf4b,_0xc365b2,_0x37ca5d,_0x13252f){return new BPromise(function(_0x44f23f,_0x267c96){var _0x41c7dd=_0x13252f||client;return _0x41c7dd[_0xc788('0x1f')](_0x21bf4b,_0x37ca5d)[_0xc788('0x20')](function(_0x4a06ff){logger[_0xc788('0x21')](_0xc788('0x22'),_0xc365b2,'request\x20sent');logger[_0xc788('0x23')](_0xc788('0x24'),_0xc365b2,_0xc788('0x25'),JSON[_0xc788('0x26')](_0x4a06ff));if(_0x4a06ff[_0xc788('0x27')]){if(_0x4a06ff[_0xc788('0x27')]['code']===0x1f4){logger[_0xc788('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0xc365b2,_0x4a06ff[_0xc788('0x27')][_0xc788('0x28')]);return _0x267c96(_0x4a06ff['error']['message']);}logger['error'](_0xc788('0x22'),_0xc365b2,_0x4a06ff[_0xc788('0x27')][_0xc788('0x28')]);return _0x44f23f(_0x4a06ff['error'][_0xc788('0x28')]);}else{logger[_0xc788('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0xc365b2,_0xc788('0x25'));_0x44f23f(_0x4a06ff[_0xc788('0x29')][_0xc788('0x28')]);}})[_0xc788('0x2a')](function(_0x185295){logger[_0xc788('0x27')](_0xc788('0x22'),_0xc365b2,_0x185295);_0x267c96(_0x185295);});});}function respondWithStatusCode(_0xa3076d,_0x495797){_0x495797=_0x495797||0xcc;return function(_0x5287ef){if(_0x5287ef){return _0xa3076d[_0xc788('0x2b')](_0x495797);}return _0xa3076d[_0xc788('0x2c')](_0x495797)[_0xc788('0x2d')]();};}function respondWithResult(_0xdcfcdf,_0x4d308b){_0x4d308b=_0x4d308b||0xc8;return function(_0x226bdf){if(_0x226bdf){return _0xdcfcdf[_0xc788('0x2c')](_0x4d308b)['json'](_0x226bdf);}};}function respondWithFilteredResult(_0x16e276,_0x2f697c){return function(_0x11f77b){if(_0x11f77b){var _0x15fdd6=typeof _0x2f697c[_0xc788('0x2e')]===_0xc788('0x2f')&&typeof _0x2f697c[_0xc788('0x30')]===_0xc788('0x2f');var _0x3274dd=_0x11f77b[_0xc788('0x31')];var _0x9c9de4=_0x15fdd6?0x0:_0x2f697c[_0xc788('0x2e')];var _0x3a9068=_0x15fdd6?_0x11f77b[_0xc788('0x31')]:_0x2f697c[_0xc788('0x2e')]+_0x2f697c[_0xc788('0x30')];var _0x246684;if(_0x3a9068>=_0x3274dd){_0x3a9068=_0x3274dd;_0x246684=0xc8;}else{_0x246684=0xce;}_0x16e276[_0xc788('0x2c')](_0x246684);return _0x16e276['set'](_0xc788('0x32'),_0x9c9de4+'-'+_0x3a9068+'/'+_0x3274dd)[_0xc788('0x33')](_0x11f77b);}return null;};}function patchUpdates(_0x19322f){return function(_0x2b34a1){try{jsonpatch[_0xc788('0x34')](_0x2b34a1,_0x19322f,!![]);}catch(_0x149691){return BPromise[_0xc788('0x35')](_0x149691);}return _0x2b34a1[_0xc788('0x36')]();};}function saveUpdates(_0x2dcb59,_0x5b40f2){return function(_0x4fefd9){if(_0x4fefd9){return _0x4fefd9[_0xc788('0x37')](_0x2dcb59)['then'](function(_0x4dd774){return _0x4dd774;});}return null;};}function removeEntity(_0x50aea6,_0x33b7fb){return function(_0x19067b){if(_0x19067b){return _0x19067b['destroy']()[_0xc788('0x20')](function(){_0x50aea6[_0xc788('0x2c')](0xcc)[_0xc788('0x2d')]();});}};}function handleEntityNotFound(_0x55b4bd,_0x361562){return function(_0x2f0d89){if(!_0x2f0d89){_0x55b4bd[_0xc788('0x2b')](0x194);}return _0x2f0d89;};}function handleError(_0x31fb71,_0x175d82){_0x175d82=_0x175d82||0x1f4;return function(_0x295210){logger[_0xc788('0x27')](_0x295210[_0xc788('0x38')]);if(_0x295210['name']){delete _0x295210[_0xc788('0x39')];}_0x31fb71['status'](_0x175d82)[_0xc788('0x3a')](_0x295210);};}exports[_0xc788('0x3b')]=function(_0x5a551f,_0x33dd31){var _0x1afe69={},_0x488f12={},_0x1df825={'count':0x0,'rows':[]};var _0xb31395=_[_0xc788('0x3c')](db['WhatsappMessage']['rawAttributes'],function(_0x5716a4){return{'name':_0x5716a4[_0xc788('0x3d')],'type':_0x5716a4['type'][_0xc788('0x3e')]};});_0x488f12[_0xc788('0x3f')]=_[_0xc788('0x3c')](_0xb31395,_0xc788('0x39'));_0x488f12[_0xc788('0x40')]=_[_0xc788('0x41')](_0x5a551f[_0xc788('0x40')]);_0x488f12['filters']=_[_0xc788('0x42')](_0x488f12[_0xc788('0x3f')],_0x488f12[_0xc788('0x40')]);_0x1afe69[_0xc788('0x43')]=_[_0xc788('0x42')](_0x488f12[_0xc788('0x3f')],qs[_0xc788('0x44')](_0x5a551f[_0xc788('0x40')][_0xc788('0x44')]));_0x1afe69[_0xc788('0x43')]=_0x1afe69[_0xc788('0x43')][_0xc788('0x45')]?_0x1afe69[_0xc788('0x43')]:_0x488f12[_0xc788('0x3f')];if(!_0x5a551f[_0xc788('0x40')]['hasOwnProperty'](_0xc788('0x46'))){_0x1afe69[_0xc788('0x30')]=qs[_0xc788('0x30')](_0x5a551f[_0xc788('0x40')][_0xc788('0x30')]);_0x1afe69[_0xc788('0x2e')]=qs[_0xc788('0x2e')](_0x5a551f[_0xc788('0x40')][_0xc788('0x2e')]);}_0x1afe69[_0xc788('0x47')]=qs['sort'](_0x5a551f[_0xc788('0x40')][_0xc788('0x48')]);_0x1afe69[_0xc788('0x49')]=qs[_0xc788('0x4a')](_[_0xc788('0x4b')](_0x5a551f[_0xc788('0x40')],_0x488f12[_0xc788('0x4a')]),_0xb31395);if(_0x5a551f[_0xc788('0x40')][_0xc788('0x4c')]){_0x1afe69[_0xc788('0x49')]=_[_0xc788('0x4d')](_0x1afe69[_0xc788('0x49')],{'$or':_['map'](_0xb31395,function(_0xdc15c4){if(_0xdc15c4['type']!=='VIRTUAL'){var _0x230010={};_0x230010[_0xdc15c4[_0xc788('0x39')]]={'$like':'%'+_0x5a551f[_0xc788('0x40')][_0xc788('0x4c')]+'%'};return _0x230010;}})});}_0x1afe69=_[_0xc788('0x4d')]({},_0x1afe69,_0x5a551f[_0xc788('0x4e')]);var _0x404c9a={'where':_0x1afe69[_0xc788('0x49')]};return db[_0xc788('0x4f')][_0xc788('0x31')](_0x404c9a)[_0xc788('0x20')](function(_0x10c838){_0x1df825[_0xc788('0x31')]=_0x10c838;if(_0x5a551f['query']['includeAll']){_0x1afe69[_0xc788('0x50')]=[{'all':!![]}];}return db[_0xc788('0x4f')][_0xc788('0x51')](_0x1afe69);})[_0xc788('0x20')](function(_0x5c397b){_0x1df825[_0xc788('0x52')]=_0x5c397b;return _0x1df825;})[_0xc788('0x20')](respondWithFilteredResult(_0x33dd31,_0x1afe69))[_0xc788('0x2a')](handleError(_0x33dd31,null));};exports[_0xc788('0x53')]=function(_0x4e1ac2,_0xb249a4){var _0x3601dc={'raw':!![],'where':{'id':_0x4e1ac2[_0xc788('0x54')]['id']}},_0x47543c={};_0x47543c['model']=_[_0xc788('0x41')](db[_0xc788('0x4f')][_0xc788('0x55')]);_0x47543c[_0xc788('0x40')]=_['keys'](_0x4e1ac2['query']);_0x47543c[_0xc788('0x4a')]=_['intersection'](_0x47543c[_0xc788('0x3f')],_0x47543c[_0xc788('0x40')]);_0x3601dc['attributes']=_['intersection'](_0x47543c[_0xc788('0x3f')],qs[_0xc788('0x44')](_0x4e1ac2[_0xc788('0x40')]['fields']));_0x3601dc[_0xc788('0x43')]=_0x3601dc[_0xc788('0x43')][_0xc788('0x45')]?_0x3601dc[_0xc788('0x43')]:_0x47543c['model'];if(_0x4e1ac2[_0xc788('0x40')][_0xc788('0x56')]){_0x3601dc['include']=[{'all':!![]}];}_0x3601dc=_[_0xc788('0x4d')]({},_0x3601dc,_0x4e1ac2[_0xc788('0x4e')]);return db[_0xc788('0x4f')][_0xc788('0x57')](_0x3601dc)[_0xc788('0x20')](handleEntityNotFound(_0xb249a4,null))[_0xc788('0x20')](respondWithResult(_0xb249a4,null))[_0xc788('0x2a')](handleError(_0xb249a4,null));};exports['create']=function(_0x46543d,_0x37b15d){return db['WhatsappMessage'][_0xc788('0x58')](_0x46543d[_0xc788('0x59')],{})[_0xc788('0x20')](respondWithResult(_0x37b15d,0xc9))[_0xc788('0x2a')](handleError(_0x37b15d,null));};exports[_0xc788('0x37')]=function(_0x175308,_0x100760){if(_0x175308[_0xc788('0x59')]['id']){delete _0x175308[_0xc788('0x59')]['id'];}return db['WhatsappMessage'][_0xc788('0x57')]({'where':{'id':_0x175308[_0xc788('0x54')]['id']}})[_0xc788('0x20')](handleEntityNotFound(_0x100760,null))[_0xc788('0x20')](saveUpdates(_0x175308[_0xc788('0x59')],null))[_0xc788('0x20')](respondWithResult(_0x100760,null))[_0xc788('0x2a')](handleError(_0x100760,null));};exports[_0xc788('0x5a')]=function(_0x389a2b,_0x49d54d){return db[_0xc788('0x4f')][_0xc788('0x57')]({'where':{'id':_0x389a2b[_0xc788('0x54')]['id']}})[_0xc788('0x20')](handleEntityNotFound(_0x49d54d,null))[_0xc788('0x20')](removeEntity(_0x49d54d,null))['catch'](handleError(_0x49d54d,null));};exports['describe']=function(_0x4b76bc,_0x5eaf79){return db[_0xc788('0x4f')][_0xc788('0x5b')]()[_0xc788('0x20')](respondWithResult(_0x5eaf79,null))[_0xc788('0x2a')](handleError(_0x5eaf79,null));};var interaction_log=require(_0xc788('0x12'))('whatsapp-interactions');exports['accept']=function(_0x36f817,_0x242e6c,_0x538574){var _0x37f3ad={'agent':{},'channel':_0xc788('0x5c')};if(_0x36f817['body']['id']){delete _0x36f817['body']['id'];}_0x36f817[_0xc788('0x59')]['read']=!![];_0x36f817[_0xc788('0x59')][_0xc788('0x5d')]=moment()[_0xc788('0x5e')](_0xc788('0x5f'));_0x36f817[_0xc788('0x59')][_0xc788('0x60')]=_0x36f817['body'][_0xc788('0x60')]||_0x36f817[_0xc788('0x61')]['id'];_0x37f3ad[_0xc788('0x62')]['id']=_0x36f817['body'][_0xc788('0x60')];return db[_0xc788('0x4f')]['find']({'where':{'id':_0x36f817[_0xc788('0x54')]['id'],'UserId':null}})[_0xc788('0x20')](handleEntityNotFound(_0x242e6c,null))[_0xc788('0x20')](saveUpdates(_0x36f817[_0xc788('0x59')],null))[_0xc788('0x20')](function(_0x3ed7cb){if(_0x3ed7cb){_0x37f3ad[_0xc788('0x28')]=_0x3ed7cb[_0xc788('0x63')]({'plain':!![]});return db[_0xc788('0x64')][_0xc788('0x57')]({'where':{'id':_0x3ed7cb[_0xc788('0x65')]}});}return null;})[_0xc788('0x20')](handleEntityNotFound(_0x242e6c,null))[_0xc788('0x20')](function(_0x402b5a){if(_0x402b5a){return _0x402b5a[_0xc788('0x37')]({'UserId':_0x36f817[_0xc788('0x59')][_0xc788('0x60')],'read1stAt':_[_0xc788('0x66')](_0x402b5a[_0xc788('0x67')])?moment()[_0xc788('0x5e')](_0xc788('0x5f')):undefined});}return null;})[_0xc788('0x20')](function(_0xa42852){if(_0xa42852){_0x37f3ad['interaction']=_0xa42852[_0xc788('0x63')]({'plain':!![]});interaction_log[_0xc788('0x21')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x36f817[_0xc788('0x61')]['id'],_0x36f817[_0xc788('0x61')][_0xc788('0x39')],_0x36f817[_0xc788('0x61')][_0xc788('0x68')],_0x37f3ad[_0xc788('0x69')]['id'],_0x36f817['body']?JSON[_0xc788('0x26')](_0x36f817['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xc788('0x6a'),_0x37f3ad);}return null;})['then'](function(_0x35e0e9){var _0x167e08=_0xc788('0x6b')+_0x35e0e9[_0xc788('0x28')]['ContactId'];return db['sequelize'][_0xc788('0x40')](_0x167e08,{'type':db['Sequelize'][_0xc788('0x6c')][_0xc788('0x6d')],'raw':!![]})[_0xc788('0x20')](function(_0x4ff8dd){return _0x4ff8dd;});})['then'](function(_0x2212c7){if(_0x2212c7){_0x37f3ad[_0xc788('0x28')]['contact']=_0x2212c7[0x0];if(!_0x36f817['body']['UserId'])return;return db[_0xc788('0x6e')][_0xc788('0x57')]({'where':{'id':_0x36f817[_0xc788('0x59')][_0xc788('0x60')],'role':'agent'},'attributes':['id','name','fullname',_0xc788('0x6f'),_0xc788('0x70')],'raw':!![]});}return null;})['then'](function(_0x47dabc){if(!_0x47dabc)return null;_0x37f3ad[_0xc788('0x28')]['agent']=_0x47dabc;return _0x37f3ad;})[_0xc788('0x20')](function(_0x3f4b76){if(_0x3f4b76){if(_0x36f817[_0xc788('0x59')][_0xc788('0x71')]){_0x37f3ad[_0xc788('0x28')][_0xc788('0x72')]=util[_0xc788('0x5e')](_0xc788('0x73'),_0x36f817[_0xc788('0x61')]['name']);_0x37f3ad[_0xc788('0x28')][_0xc788('0x74')]=_0x37f3ad[_0xc788('0x74')];_0x37f3ad['message'][_0xc788('0x75')]=_0xc788('0x76');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc788('0x77'),'message':_0x37f3ad[_0xc788('0x28')]},client9002)[_0xc788('0x20')](function(){return _0x37f3ad;});}return _0x37f3ad;}return null;})['then'](respondWithResult(_0x242e6c,null))['catch'](handleError(_0x242e6c,null));};var interaction_log=require(_0xc788('0x12'))('whatsapp-interactions');exports['reject']=function(_0x3d3a8f,_0xb41a3f,_0x5a5b31){var _0x29f227={'agent':{},'channel':'whatsapp'};if(_0x3d3a8f['body']['id']){delete _0x3d3a8f[_0xc788('0x59')]['id'];}_0x3d3a8f[_0xc788('0x59')]['UserId']=_0x3d3a8f[_0xc788('0x59')][_0xc788('0x60')]||_0x3d3a8f[_0xc788('0x61')]['id'];_0x29f227[_0xc788('0x62')]['id']=_0x3d3a8f[_0xc788('0x59')][_0xc788('0x60')];return db[_0xc788('0x4f')][_0xc788('0x57')]({'where':{'id':_0x3d3a8f[_0xc788('0x54')]['id'],'UserId':null}})[_0xc788('0x20')](handleEntityNotFound(_0xb41a3f,null))['then'](function(_0x2fcfae){if(_0x2fcfae){_0x29f227[_0xc788('0x28')]=_0x2fcfae[_0xc788('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0xc788('0x57')]({'where':{'id':_0x2fcfae['WhatsappInteractionId']}});}return null;})[_0xc788('0x20')](handleEntityNotFound(_0xb41a3f,null))['then'](function(_0x59eabb){if(_0x59eabb){_0x29f227[_0xc788('0x69')]=_0x59eabb[_0xc788('0x63')]({'plain':!![]});interaction_log[_0xc788('0x21')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d3a8f[_0xc788('0x61')]['id'],_0x3d3a8f[_0xc788('0x61')][_0xc788('0x39')],_0x3d3a8f[_0xc788('0x61')]['role'],_0x29f227[_0xc788('0x69')]['id'],_0x3d3a8f[_0xc788('0x59')]?JSON[_0xc788('0x26')](_0x3d3a8f[_0xc788('0x59')]):_0xc788('0x78'));return respondWithRpcPromise(_0xc788('0x79'),_0xc788('0x7a'),_0x29f227);}return null;})[_0xc788('0x20')](function(_0x5a2405){var _0x4754b0=_0xc788('0x6b')+_0x5a2405[_0xc788('0x28')][_0xc788('0x7b')];return db['sequelize'][_0xc788('0x40')](_0x4754b0,{'type':db[_0xc788('0x7c')][_0xc788('0x6c')][_0xc788('0x6d')],'raw':!![]})['then'](function(_0x5ec3d9){return _0x5ec3d9;});})[_0xc788('0x20')](function(_0x4ed47c){if(_0x4ed47c){_0x29f227[_0xc788('0x28')][_0xc788('0x7d')]=_0x4ed47c[0x0];if(!_0x3d3a8f[_0xc788('0x59')][_0xc788('0x60')])return;return db[_0xc788('0x6e')]['find']({'where':{'id':_0x3d3a8f[_0xc788('0x59')][_0xc788('0x60')],'role':_0xc788('0x62')},'attributes':['id','name',_0xc788('0x7e'),_0xc788('0x6f'),_0xc788('0x70')],'raw':!![]});}return null;})[_0xc788('0x20')](function(_0x51665b){if(!_0x51665b)return null;_0x29f227['message'][_0xc788('0x62')]=_0x51665b;return _0x29f227;})[_0xc788('0x20')](function(_0x12f85e){if(_0x12f85e){_0x12f85e[_0xc788('0x28')][_0xc788('0x72')]=util[_0xc788('0x5e')](_0xc788('0x73'),_0x3d3a8f[_0xc788('0x61')][_0xc788('0x39')]);_0x12f85e[_0xc788('0x28')][_0xc788('0x74')]=_0x29f227[_0xc788('0x74')];_0x12f85e[_0xc788('0x28')][_0xc788('0x75')]=_0xc788('0x35');respondWithRpcPromise(_0xc788('0x7f'),_0xc788('0x7f'),{'event':_0xc788('0x80'),'message':_0x12f85e[_0xc788('0x28')]},client9002);return _0x29f227;}return null;})['then'](respondWithResult(_0xb41a3f,null))[_0xc788('0x2a')](handleError(_0xb41a3f,null));};exports[_0xc788('0x2c')]=function(_0x442ceb,_0x12fee3,_0x35e0fd){if(_0x442ceb[_0xc788('0x59')]['id']){delete _0x442ceb[_0xc788('0x59')]['id'];}var _0x5122f1;return db[_0xc788('0x4f')][_0xc788('0x57')]({'where':{'id':_0x442ceb[_0xc788('0x54')]['id']}})['then'](handleEntityNotFound(_0x12fee3,null))[_0xc788('0x20')](function(_0x7e473){if(_0x7e473){_0x5122f1=_0x7e473;return db['WhatsappAccount'][_0xc788('0x57')]({'where':{'id':_0x7e473[_0xc788('0x81')]}});}})[_0xc788('0x20')](handleEntityNotFound(_0x12fee3,null))[_0xc788('0x20')](function(_0x24b3ca){if(_0x24b3ca){logger['debug'](_0xc788('0x82'),'status',_0xc788('0x83'),_0x24b3ca[_0xc788('0x84')],util[_0xc788('0x85')](_0x442ceb[_0xc788('0x59')],{'showHidden':![],'depth':null}));switch(_0x24b3ca['type']){case _0xc788('0x86'):if(_0x442ceb['body']['MessageSid']&&_0x442ceb[_0xc788('0x59')][_0xc788('0x87')]===_0x5122f1['messageId']&&_0x442ceb['body']['MessageStatus']&&_0x442ceb[_0xc788('0x59')][_0xc788('0x88')]==='read'){return _0x5122f1['update']({'read':!![]});}else{logger[_0xc788('0x27')](_0xc788('0x89'),_0xc788('0x2c'),_0xc788('0x86'),util[_0xc788('0x85')](_0x442ceb[_0xc788('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5122f1;}})[_0xc788('0x20')](respondWithResult(_0x12fee3,null))[_0xc788('0x2a')](handleError(_0x12fee3,null));};
\ No newline at end of file
index e1f3644..040952d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x57abf7,_0x11bb02){var _0x1c7779=function(_0x387b0a){while(--_0x387b0a){_0x57abf7['push'](_0x57abf7['shift']());}};_0x1c7779(++_0x11bb02);}(_0x6b20,0xd1));var _0x06b2=function(_0x5f096b,_0x37bd5b){_0x5f096b=_0x5f096b-0x0;var _0x71f56e=_0x6b20[_0x5f096b];return _0x71f56e;};'use strict';var EventEmitter=require(_0x06b2('0x0'));var WhatsappMessage=require(_0x06b2('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x06b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x06b2('0x3'),'afterDestroy':_0x06b2('0x4')};function emitEvent(_0x353f6a){return function(_0x5ba392,_0x311643,_0x3ea357){WhatsappMessageEvents[_0x06b2('0x5')](_0x353f6a+':'+_0x5ba392['id'],_0x5ba392);WhatsappMessageEvents[_0x06b2('0x5')](_0x353f6a,_0x5ba392);_0x3ea357(null);};}for(var e in events){if(events[_0x06b2('0x6')](e)){var event=events[e];WhatsappMessage[_0x06b2('0x7')](e,emitEvent(event));}}module[_0x06b2('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x3495=['WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4f3dee,_0x46bb90){var _0x291aad=function(_0x3ca8f5){while(--_0x3ca8f5){_0x4f3dee['push'](_0x4f3dee['shift']());}};_0x291aad(++_0x46bb90);}(_0x3495,0x1de));var _0x5349=function(_0x2c35ef,_0x579694){_0x2c35ef=_0x2c35ef-0x0;var _0x53c496=_0x3495[_0x2c35ef];return _0x53c496;};'use strict';var EventEmitter=require(_0x5349('0x0'));var WhatsappMessage=require(_0x5349('0x1'))['db'][_0x5349('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5349('0x3')](0x0);var events={'afterCreate':_0x5349('0x4'),'afterUpdate':_0x5349('0x5'),'afterDestroy':_0x5349('0x6')};function emitEvent(_0x2bb6d7){return function(_0xedbd32,_0x5912ac,_0x4034ba){WhatsappMessageEvents[_0x5349('0x7')](_0x2bb6d7+':'+_0xedbd32['id'],_0xedbd32);WhatsappMessageEvents['emit'](_0x2bb6d7,_0xedbd32);_0x4034ba(null);};}for(var e in events){if(events[_0x5349('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x5349('0x9')]=WhatsappMessageEvents;
\ No newline at end of file
index 5ef7d3d..bdc730b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14b7=['type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','find'];(function(_0x3e61ce,_0x4cab72){var _0x4abc5c=function(_0x49bb3f){while(--_0x49bb3f){_0x3e61ce['push'](_0x3e61ce['shift']());}};_0x4abc5c(++_0x4cab72);}(_0x14b7,0x144));var _0x714b=function(_0x1235a8,_0x2db48e){_0x1235a8=_0x1235a8-0x0;var _0x41a2cf=_0x14b7[_0x1235a8];return _0x41a2cf;};'use strict';var _=require(_0x714b('0x0'));var util=require(_0x714b('0x1'));var logger=require(_0x714b('0x2'))(_0x714b('0x3'));var moment=require('moment');var BPromise=require(_0x714b('0x4'));var rp=require(_0x714b('0x5'));var fs=require('fs');var path=require(_0x714b('0x6'));var rimraf=require(_0x714b('0x7'));var config=require(_0x714b('0x8'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x45c9ae,_0x966048){return _0x45c9ae[_0x714b('0x9')]('WhatsappMessage',attributes,{'tableName':_0x714b('0xa'),'paranoid':![],'indexes':[{'name':_0x714b('0xb'),'fields':[_0x714b('0xb')]},{'name':_0x714b('0xc'),'fields':[_0x714b('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3169f2,_0x376867,_0x18d257){var _0x526019=_0x45c9ae[_0x714b('0xe')];var _0x591bea=_0x3169f2['get']({'plain':!![]});if(_0x591bea[_0x714b('0xf')][_0x714b('0x10')]()==='in'||_0x591bea['direction'][_0x714b('0x10')]()===_0x714b('0x11')&&!_0x591bea[_0x714b('0x12')]&&!_[_0x714b('0x13')](_0x591bea['UserId'])){_0x526019[_0x714b('0x14')]['findOne']({'where':{'id':_0x591bea[_0x714b('0x15')]}})[_0x714b('0x16')](function(_0x5b2770){if(_0x5b2770){_0x5b2770[_0x714b('0x17')]({'lastMsgAt':_0x591bea[_0x714b('0x18')],'lastMsgDirection':_0x591bea[_0x714b('0xf')][_0x714b('0x10')]()});}})[_0x714b('0x19')](function(_0x3e430d){console[_0x714b('0x1a')](_0x3e430d);});}if(_0x591bea[_0x714b('0xf')]===_0x714b('0x11')&&!_0x591bea['secret']){var _0xad2df2;_0x526019['WhatsappAccount'][_0x714b('0x1b')]({'where':{'id':_0x591bea['WhatsappAccountId']},'raw':!![]})[_0x714b('0x16')](function(_0x3302ec){_0xad2df2=_0x3302ec;if(_0xad2df2&&_0xad2df2[_0x714b('0x1c')]){switch(_0xad2df2[_0x714b('0x1c')]){case _0x714b('0x1d'):var _0x2d93e0=require(_0x714b('0x1d'));if(_0xad2df2[_0x714b('0x1e')]&&_0xad2df2[_0x714b('0x1f')]&&_0xad2df2[_0x714b('0x20')]){var _0x1b263b=new _0x2d93e0(_0xad2df2[_0x714b('0x1e')],_0xad2df2[_0x714b('0x1f')]);_0x1b263b[_0x714b('0x21')][_0x714b('0x22')]({'body':_0x591bea['body'],'to':_0x714b('0x23')+_0x591bea[_0x714b('0x20')],'from':_0x714b('0x23')+_0xad2df2[_0x714b('0x20')],'statusCallback':_0xad2df2['remote']+'/api/whatsapp/messages/'+_0x591bea['id']+_0x714b('0x24')+_0xad2df2[_0x714b('0x25')]})[_0x714b('0x16')](function(_0x8d9480){if(_0x8d9480[_0x714b('0x26')]){return _0x3169f2[_0x714b('0x17')]({'messageId':_0x8d9480[_0x714b('0x26')]});}})['catch'](function(_0x2045c1){logger[_0x714b('0x1a')](_0x714b('0x27'),'afterCreate','twilio',util['inspect'](_0x2045c1,{'showHidden':![],'depth':null}));});}else{logger[_0x714b('0x1a')](_0x714b('0x27'),'afterCreate',_0x714b('0x1d'),_0x714b('0x28'));}break;}}})[_0x714b('0x29')](function(){_0x18d257();});}else{_0x18d257();}}},'charset':_0x714b('0x2a'),'collate':_0x714b('0x2b')});};
\ No newline at end of file
+var _0x85b5=['whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','toLowerCase','catch','WhatsappAccount','find','type','twilio','accountSid','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','rimraf','./whatsappMessage.attributes','exports','define'];(function(_0x1c2a84,_0x5dc9f2){var _0x2f84a4=function(_0x247f57){while(--_0x247f57){_0x1c2a84['push'](_0x1c2a84['shift']());}};_0x2f84a4(++_0x5dc9f2);}(_0x85b5,0x7f));var _0x585b=function(_0x353cc7,_0x23cebe){_0x353cc7=_0x353cc7-0x0;var _0x37934c=_0x85b5[_0x353cc7];return _0x37934c;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var logger=require('../../config/logger')(_0x585b('0x2'));var moment=require('moment');var BPromise=require(_0x585b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x585b('0x4'));var config=require('../../config/environment');var attributes=require(_0x585b('0x5'));module[_0x585b('0x6')]=function(_0x9ccfca,_0x5b9e48){return _0x9ccfca[_0x585b('0x7')]('WhatsappMessage',attributes,{'tableName':_0x585b('0x8'),'paranoid':![],'indexes':[{'name':_0x585b('0x9'),'fields':[_0x585b('0x9')]},{'name':_0x585b('0xa'),'fields':['body'],'type':_0x585b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7974e6,_0x430c16,_0x4d86cc){var _0x26cc9c=_0x9ccfca[_0x585b('0xc')];var _0x2fbe30=_0x7974e6['get']({'plain':!![]});if(_0x2fbe30[_0x585b('0xd')]['toLowerCase']()==='in'||_0x2fbe30[_0x585b('0xd')]['toLowerCase']()===_0x585b('0xe')&&!_0x2fbe30[_0x585b('0xf')]&&!_[_0x585b('0x10')](_0x2fbe30['UserId'])){_0x26cc9c[_0x585b('0x11')][_0x585b('0x12')]({'where':{'id':_0x2fbe30[_0x585b('0x13')]}})[_0x585b('0x14')](function(_0x3dcc28){if(_0x3dcc28){_0x3dcc28[_0x585b('0x15')]({'lastMsgAt':_0x2fbe30[_0x585b('0x16')],'lastMsgDirection':_0x2fbe30['direction'][_0x585b('0x17')]()});}})[_0x585b('0x18')](function(_0x4c094e){console['error'](_0x4c094e);});}if(_0x2fbe30[_0x585b('0xd')]==='out'&&!_0x2fbe30['secret']){var _0x2f840e;_0x26cc9c[_0x585b('0x19')][_0x585b('0x1a')]({'where':{'id':_0x2fbe30['WhatsappAccountId']},'raw':!![]})[_0x585b('0x14')](function(_0x14648f){_0x2f840e=_0x14648f;if(_0x2f840e&&_0x2f840e[_0x585b('0x1b')]){switch(_0x2f840e[_0x585b('0x1b')]){case'twilio':var _0xec725d=require(_0x585b('0x1c'));if(_0x2f840e[_0x585b('0x1d')]&&_0x2f840e['authToken']&&_0x2f840e['phone']){var _0x6bea29=new _0xec725d(_0x2f840e['accountSid'],_0x2f840e['authToken']);_0x6bea29[_0x585b('0x1e')][_0x585b('0x1f')]({'body':_0x2fbe30['body'],'to':_0x585b('0x20')+_0x2fbe30[_0x585b('0x21')],'from':'whatsapp:'+_0x2f840e[_0x585b('0x21')],'statusCallback':_0x2f840e[_0x585b('0x22')]+_0x585b('0x23')+_0x2fbe30['id']+'/status?token='+_0x2f840e[_0x585b('0x24')]})['then'](function(_0x3c861c){if(_0x3c861c[_0x585b('0x25')]){return _0x7974e6[_0x585b('0x15')]({'messageId':_0x3c861c[_0x585b('0x25')]});}})[_0x585b('0x18')](function(_0x1b1241){logger[_0x585b('0x26')](_0x585b('0x27'),_0x585b('0x28'),_0x585b('0x1c'),util[_0x585b('0x29')](_0x1b1241,{'showHidden':![],'depth':null}));});}else{logger[_0x585b('0x26')](_0x585b('0x27'),_0x585b('0x28'),_0x585b('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x585b('0x2a')](function(){_0x4d86cc();});}else{_0x4d86cc();}}},'charset':_0x585b('0x2b'),'collate':_0x585b('0x2c')});};
\ No newline at end of file
index dc13efb..a4238ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ab=['info','result','CreateWhatsappMessage','WhatsappMessage','create','body','debug','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x48dfa4,_0x5bbfa6){var _0x3aba3c=function(_0x4974f3){while(--_0x4974f3){_0x48dfa4['push'](_0x48dfa4['shift']());}};_0x3aba3c(++_0x5bbfa6);}(_0x90ab,0xa8));var _0xb90a=function(_0x1f1794,_0x52cfdb){_0x1f1794=_0x1f1794-0x0;var _0x5a23d3=_0x90ab[_0x1f1794];return _0x5a23d3;};'use strict';var _=require('lodash');var util=require(_0xb90a('0x0'));var moment=require(_0xb90a('0x1'));var BPromise=require(_0xb90a('0x2'));var rs=require(_0xb90a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb90a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb90a('0x5'))(_0xb90a('0x6'));var config=require(_0xb90a('0x7'));var jayson=require(_0xb90a('0x8'));var client=jayson[_0xb90a('0x9')][_0xb90a('0xa')]({'port':0x232a});config[_0xb90a('0xb')]=_[_0xb90a('0xc')](config[_0xb90a('0xb')],{'host':_0xb90a('0xd'),'port':0x18eb});var socket=require(_0xb90a('0xe'))(new Redis(config[_0xb90a('0xb')]));require(_0xb90a('0xf'))['register'](socket);function respondWithRpcPromise(_0xf08974,_0x435a7f,_0x462cc3){return new BPromise(function(_0x1373bf,_0x54a14d){return client[_0xb90a('0x10')](_0xf08974,_0x462cc3)[_0xb90a('0x11')](function(_0x430231){logger['info'](_0xb90a('0x12'),_0x435a7f,_0xb90a('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x435a7f,_0xb90a('0x13'),JSON[_0xb90a('0x14')](_0x430231));if(_0x430231[_0xb90a('0x15')]){if(_0x430231[_0xb90a('0x15')][_0xb90a('0x16')]===0x1f4){logger[_0xb90a('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x435a7f,_0x430231[_0xb90a('0x15')][_0xb90a('0x17')]);return _0x54a14d(_0x430231['error'][_0xb90a('0x17')]);}logger[_0xb90a('0x15')](_0xb90a('0x12'),_0x435a7f,_0x430231[_0xb90a('0x15')][_0xb90a('0x17')]);return _0x1373bf(_0x430231[_0xb90a('0x15')][_0xb90a('0x17')]);}else{logger[_0xb90a('0x18')](_0xb90a('0x12'),_0x435a7f,_0xb90a('0x13'));_0x1373bf(_0x430231[_0xb90a('0x19')][_0xb90a('0x17')]);}})['catch'](function(_0x2b06ab){logger['error'](_0xb90a('0x12'),_0x435a7f,_0x2b06ab);_0x54a14d(_0x2b06ab);});});}exports[_0xb90a('0x1a')]=function(_0x3bd723){var _0x22df05=this;return new Promise(function(_0x7338fa,_0xaae490){return db[_0xb90a('0x1b')][_0xb90a('0x1c')](_0x3bd723[_0xb90a('0x1d')],{'raw':_0x3bd723['options']?_0x3bd723['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x404262){logger[_0xb90a('0x18')](_0xb90a('0x1a'),_0x3bd723);logger[_0xb90a('0x1e')]('CreateWhatsappMessage',_0x3bd723,JSON[_0xb90a('0x14')](_0x404262));_0x7338fa(_0x404262);})[_0xb90a('0x1f')](function(_0x44eae1){logger[_0xb90a('0x15')](_0xb90a('0x1a'),_0x44eae1['message'],_0x3bd723);_0xaae490(_0x22df05['error'](0x1f4,_0x44eae1[_0xb90a('0x17')]));});});};
\ No newline at end of file
+var _0x7d55=['body','options','then','CreateWhatsappMessage','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappMessage','create'];(function(_0x24c62b,_0x3c21c2){var _0x3c32dd=function(_0x1e09d1){while(--_0x1e09d1){_0x24c62b['push'](_0x24c62b['shift']());}};_0x3c32dd(++_0x3c21c2);}(_0x7d55,0x145));var _0x57d5=function(_0x592f01,_0x12d206){_0x592f01=_0x592f01-0x0;var _0x11ee13=_0x7d55[_0x592f01];return _0x11ee13;};'use strict';var _=require('lodash');var util=require(_0x57d5('0x0'));var moment=require(_0x57d5('0x1'));var BPromise=require(_0x57d5('0x2'));var rs=require(_0x57d5('0x3'));var fs=require('fs');var Redis=require(_0x57d5('0x4'));var db=require(_0x57d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x57d5('0x6'))(_0x57d5('0x7'));var config=require('../../config/environment');var jayson=require(_0x57d5('0x8'));var client=jayson[_0x57d5('0x9')][_0x57d5('0xa')]({'port':0x232a});config[_0x57d5('0xb')]=_[_0x57d5('0xc')](config[_0x57d5('0xb')],{'host':_0x57d5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d5('0xb')]));require(_0x57d5('0xe'))[_0x57d5('0xf')](socket);function respondWithRpcPromise(_0x4cbeb3,_0x27545f,_0x28c178){return new BPromise(function(_0x2a7809,_0x55ac4f){return client['request'](_0x4cbeb3,_0x28c178)['then'](function(_0x1255b7){logger[_0x57d5('0x10')](_0x57d5('0x11'),_0x27545f,_0x57d5('0x12'));logger['debug'](_0x57d5('0x13'),_0x27545f,_0x57d5('0x12'),JSON[_0x57d5('0x14')](_0x1255b7));if(_0x1255b7['error']){if(_0x1255b7[_0x57d5('0x15')][_0x57d5('0x16')]===0x1f4){logger['error'](_0x57d5('0x11'),_0x27545f,_0x1255b7[_0x57d5('0x15')][_0x57d5('0x17')]);return _0x55ac4f(_0x1255b7[_0x57d5('0x15')]['message']);}logger[_0x57d5('0x15')](_0x57d5('0x11'),_0x27545f,_0x1255b7['error'][_0x57d5('0x17')]);return _0x2a7809(_0x1255b7[_0x57d5('0x15')][_0x57d5('0x17')]);}else{logger[_0x57d5('0x10')](_0x57d5('0x11'),_0x27545f,_0x57d5('0x12'));_0x2a7809(_0x1255b7['result'][_0x57d5('0x17')]);}})[_0x57d5('0x18')](function(_0x495576){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x27545f,_0x495576);_0x55ac4f(_0x495576);});});}exports['CreateWhatsappMessage']=function(_0x2c2d37){var _0x20d7a5=this;return new Promise(function(_0x5730d1,_0xc53f6){return db[_0x57d5('0x19')][_0x57d5('0x1a')](_0x2c2d37[_0x57d5('0x1b')],{'raw':_0x2c2d37[_0x57d5('0x1c')]?_0x2c2d37[_0x57d5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x57d5('0x1d')](function(_0x5bf6a0){logger[_0x57d5('0x10')](_0x57d5('0x1e'),_0x2c2d37);logger[_0x57d5('0x1f')]('CreateWhatsappMessage',_0x2c2d37,JSON[_0x57d5('0x14')](_0x5bf6a0));_0x5730d1(_0x5bf6a0);})[_0x57d5('0x18')](function(_0x1671a6){logger[_0x57d5('0x15')](_0x57d5('0x1e'),_0x1671a6[_0x57d5('0x17')],_0x2c2d37);_0xc53f6(_0x20d7a5['error'](0x1f4,_0x1671a6[_0x57d5('0x17')]));});});};
\ No newline at end of file
index 6fd8e10..864408d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb3=['update','emit','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x5da00f,_0xc7f6bd){var _0x4c4d64=function(_0x3615cd){while(--_0x3615cd){_0x5da00f['push'](_0x5da00f['shift']());}};_0x4c4d64(++_0xc7f6bd);}(_0x6eb3,0x135));var _0x36eb=function(_0x2060db,_0x4dbe54){_0x2060db=_0x2060db-0x0;var _0x26853f=_0x6eb3[_0x2060db];return _0x26853f;};'use strict';var WhatsappMessageEvents=require(_0x36eb('0x0'));var events=[_0x36eb('0x1'),_0x36eb('0x2'),_0x36eb('0x3')];function createListener(_0x2552bb,_0x43ab96){return function(_0x5d0890){_0x43ab96[_0x36eb('0x4')](_0x2552bb,_0x5d0890);};}function removeListener(_0x1b8be1,_0x1df191){return function(){WhatsappMessageEvents['removeListener'](_0x1b8be1,_0x1df191);};}exports['register']=function(_0x5aaaac){for(var _0x5add3c=0x0,_0x2177e1=events['length'];_0x5add3c<_0x2177e1;_0x5add3c++){var _0xd5e081=events[_0x5add3c];var _0x51fb07=createListener(_0x36eb('0x5')+_0xd5e081,_0x5aaaac);WhatsappMessageEvents['on'](_0xd5e081,_0x51fb07);}};
\ No newline at end of file
+var _0x4626=['update','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4626,0x1dd));var _0x6462=function(_0x2c5ef3,_0x3f914e){_0x2c5ef3=_0x2c5ef3-0x0;var _0x6f62f5=_0x4626[_0x2c5ef3];return _0x6f62f5;};'use strict';var WhatsappMessageEvents=require(_0x6462('0x0'));var events=[_0x6462('0x1'),_0x6462('0x2'),_0x6462('0x3')];function createListener(_0x3e761b,_0x432cad){return function(_0x12b3ca){_0x432cad[_0x6462('0x4')](_0x3e761b,_0x12b3ca);};}function removeListener(_0x133c76,_0x428552){return function(){WhatsappMessageEvents[_0x6462('0x5')](_0x133c76,_0x428552);};}exports['register']=function(_0x667156){for(var _0xb2e39e=0x0,_0x631f38=events[_0x6462('0x6')];_0xb2e39e<_0x631f38;_0xb2e39e++){var _0x594bf2=events[_0xb2e39e];var _0x26533c=createListener(_0x6462('0x7')+_0x594bf2,_0x667156);WhatsappMessageEvents['on'](_0x594bf2,_0x26533c);}};
\ No newline at end of file
index 2ca9031..f2ac346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c33=['destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put'];(function(_0x2f047a,_0x34e5d4){var _0x1d0a31=function(_0x22b47b){while(--_0x22b47b){_0x2f047a['push'](_0x2f047a['shift']());}};_0x1d0a31(++_0x34e5d4);}(_0x4c33,0x1c5));var _0x34c3=function(_0x3cac98,_0x5141af){_0x3cac98=_0x3cac98-0x0;var _0x453df7=_0x4c33[_0x3cac98];return _0x453df7;};'use strict';var multer=require(_0x34c3('0x0'));var util=require(_0x34c3('0x1'));var path=require(_0x34c3('0x2'));var timeout=require(_0x34c3('0x3'));var express=require(_0x34c3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34c3('0x5'));var config=require('../../config/environment');var controller=require(_0x34c3('0x6'));router['get']('/',auth[_0x34c3('0x7')](),controller[_0x34c3('0x8')]);router[_0x34c3('0x9')](_0x34c3('0xa'),auth['isAuthenticated'](),controller[_0x34c3('0xb')]);router[_0x34c3('0x9')](_0x34c3('0xc'),auth[_0x34c3('0x7')](),controller['show']);router[_0x34c3('0x9')](_0x34c3('0xd'),auth[_0x34c3('0x7')](),controller['getMembers']);router[_0x34c3('0x9')](_0x34c3('0xe'),auth[_0x34c3('0x7')](),controller[_0x34c3('0xf')]);router['get'](_0x34c3('0x10'),auth['isAuthenticated'](),controller[_0x34c3('0x11')]);router[_0x34c3('0x12')]('/',auth[_0x34c3('0x7')](),controller[_0x34c3('0x13')]);router['post'](_0x34c3('0xe'),auth['isAuthenticated'](),controller[_0x34c3('0x14')]);router['post']('/:id/users',auth[_0x34c3('0x7')](),controller[_0x34c3('0x15')]);router[_0x34c3('0x16')](_0x34c3('0xc'),auth[_0x34c3('0x7')](),controller['update']);router['delete'](_0x34c3('0xc'),auth['isAuthenticated'](),controller[_0x34c3('0x17')]);router[_0x34c3('0x18')](_0x34c3('0xe'),auth[_0x34c3('0x7')](),controller[_0x34c3('0x19')]);router[_0x34c3('0x18')](_0x34c3('0x10'),auth['isAuthenticated'](),controller[_0x34c3('0x1a')]);module[_0x34c3('0x1b')]=router;
\ No newline at end of file
+var _0x3d1a=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x42bfab,_0x4b6189){var _0x570f5f=function(_0x29da1f){while(--_0x29da1f){_0x42bfab['push'](_0x42bfab['shift']());}};_0x570f5f(++_0x4b6189);}(_0x3d1a,0x1b7));var _0xa3d1=function(_0x3dd739,_0x5c24dd){_0x3dd739=_0x3dd739-0x0;var _0x13596a=_0x3d1a[_0x3dd739];return _0x13596a;};'use strict';var multer=require('multer');var util=require(_0xa3d1('0x0'));var path=require(_0xa3d1('0x1'));var timeout=require(_0xa3d1('0x2'));var express=require(_0xa3d1('0x3'));var router=express['Router']();var fs_extra=require(_0xa3d1('0x4'));var auth=require(_0xa3d1('0x5'));var interaction=require(_0xa3d1('0x6'));var config=require(_0xa3d1('0x7'));var controller=require(_0xa3d1('0x8'));router['get']('/',auth[_0xa3d1('0x9')](),controller[_0xa3d1('0xa')]);router['get'](_0xa3d1('0xb'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0xc')]);router[_0xa3d1('0xd')](_0xa3d1('0xe'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0xf')]);router['get'](_0xa3d1('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0xa3d1('0xd')](_0xa3d1('0x11'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0x12')]);router[_0xa3d1('0xd')](_0xa3d1('0x13'),auth[_0xa3d1('0x9')](),controller['getAgents']);router[_0xa3d1('0x14')]('/',auth[_0xa3d1('0x9')](),controller[_0xa3d1('0x15')]);router['post'](_0xa3d1('0x11'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0x16')]);router[_0xa3d1('0x14')]('/:id/users',auth[_0xa3d1('0x9')](),controller['addAgents']);router[_0xa3d1('0x17')](_0xa3d1('0xe'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0x18')]);router[_0xa3d1('0x19')](_0xa3d1('0xe'),auth[_0xa3d1('0x9')](),controller[_0xa3d1('0x1a')]);router['delete']('/:id/teams',auth[_0xa3d1('0x9')](),controller['removeTeams']);router[_0xa3d1('0x19')](_0xa3d1('0x13'),auth[_0xa3d1('0x9')](),controller['removeAgents']);module[_0xa3d1('0x1b')]=router;
\ No newline at end of file
index a342b4d..c09cad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f49=['sequelize','exports','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x12e4fc,_0xf01a75){var _0x197c91=function(_0x3922bb){while(--_0x3922bb){_0x12e4fc['push'](_0x12e4fc['shift']());}};_0x197c91(++_0xf01a75);}(_0x3f49,0x11f));var _0x93f4=function(_0x2d2339,_0x48ff83){_0x2d2339=_0x2d2339-0x0;var _0x55c03f=_0x3f49[_0x2d2339];return _0x55c03f;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x93f4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x93f4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x93f4('0x4')]('rrmemory',_0x93f4('0x5'),_0x93f4('0x6'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdb76=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1db872,_0x5dbe78){var _0x5a8ceb=function(_0x59ed19){while(--_0x59ed19){_0x1db872['push'](_0x1db872['shift']());}};_0x5a8ceb(++_0x5dbe78);}(_0xdb76,0x1be));var _0x6db7=function(_0x2bba98,_0x344416){_0x2bba98=_0x2bba98-0x0;var _0x23cf3f=_0xdb76[_0x2bba98];return _0x23cf3f;};'use strict';var Sequelize=require(_0x6db7('0x0'));module[_0x6db7('0x1')]={'name':{'type':Sequelize[_0x6db7('0x2')],'unique':_0x6db7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x6db7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6db7('0x5'),_0x6db7('0x6'),_0x6db7('0x7'))},'description':{'type':Sequelize[_0x6db7('0x2')]}};
\ No newline at end of file
index 9d72fa3..35a0c05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfefe=['length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','findOne','UserWhatsappQueue','User','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappQueue','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2f2bed,_0x154b8d){var _0x1bceb9=function(_0x53f53e){while(--_0x53f53e){_0x2f2bed['push'](_0x2f2bed['shift']());}};_0x1bceb9(++_0x154b8d);}(_0xfefe,0xc1));var _0xefef=function(_0x2d35ef,_0x1f512b){_0x2d35ef=_0x2d35ef-0x0;var _0x10ec83=_0xfefe[_0x2d35ef];return _0x10ec83;};'use strict';var emlformat=require(_0xefef('0x0'));var rimraf=require(_0xefef('0x1'));var zipdir=require(_0xefef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefef('0x3'));var moment=require(_0xefef('0x4'));var BPromise=require(_0xefef('0x5'));var Mustache=require(_0xefef('0x6'));var util=require(_0xefef('0x7'));var path=require('path');var sox=require(_0xefef('0x8'));var csv=require(_0xefef('0x9'));var ejs=require(_0xefef('0xa'));var fs=require('fs');var fs_extra=require(_0xefef('0xb'));var _=require(_0xefef('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xefef('0xd'));var toCsv=require(_0xefef('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xefef('0xe'));var authService=require(_0xefef('0xf'));var qs=require(_0xefef('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xefef('0x11'));var utils=require(_0xefef('0x12'));var config=require(_0xefef('0x13'));var licenseUtil=require(_0xefef('0x14'));var db=require('../../mysqldb')['db'];config[_0xefef('0x15')]=_[_0xefef('0x16')](config[_0xefef('0x15')],{'host':_0xefef('0x17'),'port':0x18eb});var socket=require(_0xefef('0x18'))(new Redis(config[_0xefef('0x15')]));require('./whatsappQueue.socket')[_0xefef('0x19')](socket);function respondWithStatusCode(_0x19af55,_0x1180ee){_0x1180ee=_0x1180ee||0xcc;return function(_0x5526ff){if(_0x5526ff){return _0x19af55[_0xefef('0x1a')](_0x1180ee);}return _0x19af55[_0xefef('0x1b')](_0x1180ee)[_0xefef('0x1c')]();};}function respondWithResult(_0x51b630,_0x4eba20){_0x4eba20=_0x4eba20||0xc8;return function(_0x142aa5){if(_0x142aa5){return _0x51b630[_0xefef('0x1b')](_0x4eba20)[_0xefef('0x1d')](_0x142aa5);}};}function respondWithFilteredResult(_0x2d18e0,_0x269f06){return function(_0x30993f){if(_0x30993f){var _0x3090ec=typeof _0x269f06['offset']===_0xefef('0x1e')&&typeof _0x269f06[_0xefef('0x1f')]===_0xefef('0x1e');var _0x21b287=_0x30993f[_0xefef('0x20')];var _0xc30c9=_0x3090ec?0x0:_0x269f06[_0xefef('0x21')];var _0x5b2c8c=_0x3090ec?_0x30993f[_0xefef('0x20')]:_0x269f06[_0xefef('0x21')]+_0x269f06[_0xefef('0x1f')];var _0x105859;if(_0x5b2c8c>=_0x21b287){_0x5b2c8c=_0x21b287;_0x105859=0xc8;}else{_0x105859=0xce;}_0x2d18e0[_0xefef('0x1b')](_0x105859);return _0x2d18e0[_0xefef('0x22')]('Content-Range',_0xc30c9+'-'+_0x5b2c8c+'/'+_0x21b287)[_0xefef('0x1d')](_0x30993f);}return null;};}function patchUpdates(_0x540399){return function(_0x476c90){try{jsonpatch[_0xefef('0x23')](_0x476c90,_0x540399,!![]);}catch(_0x198192){return BPromise[_0xefef('0x24')](_0x198192);}return _0x476c90['save']();};}function saveUpdates(_0x51114f,_0x4eacf4){return function(_0x59bf9b){if(_0x59bf9b){return _0x59bf9b['update'](_0x51114f)[_0xefef('0x25')](function(_0x2746ed){return _0x2746ed;});}return null;};}function removeEntity(_0x3c1aa7,_0x2961f7){return function(_0x4e17b2){if(_0x4e17b2){return _0x4e17b2[_0xefef('0x26')]()[_0xefef('0x25')](function(){var _0x1e3353=_0x4e17b2[_0xefef('0x27')]({'plain':!![]});var _0x2bc42b=_0xefef('0x28');return db[_0xefef('0x29')][_0xefef('0x26')]({'where':{'type':_0x2bc42b,'resourceId':_0x1e3353['id']}})[_0xefef('0x25')](function(){return _0x4e17b2;});})[_0xefef('0x25')](function(){_0x3c1aa7[_0xefef('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x147b37,_0x5d4a18){return function(_0x4a5fd2){if(!_0x4a5fd2){_0x147b37[_0xefef('0x1a')](0x194);}return _0x4a5fd2;};}function handleError(_0x21b787,_0x2fb827){_0x2fb827=_0x2fb827||0x1f4;return function(_0xf92377){logger[_0xefef('0x2a')](_0xf92377[_0xefef('0x2b')]);if(_0xf92377[_0xefef('0x2c')]){delete _0xf92377[_0xefef('0x2c')];}_0x21b787[_0xefef('0x1b')](_0x2fb827)[_0xefef('0x2d')](_0xf92377);};}exports[_0xefef('0x2e')]=function(_0x6b467,_0x1cbee4){var _0x45f884={},_0x258f2a={},_0x1afe6e={'count':0x0,'rows':[]};var _0x25c21c=_['map'](db['WhatsappQueue'][_0xefef('0x2f')],function(_0x29cbad){return{'name':_0x29cbad[_0xefef('0x30')],'type':_0x29cbad[_0xefef('0x31')][_0xefef('0x32')]};});_0x258f2a[_0xefef('0x33')]=_[_0xefef('0x34')](_0x25c21c,'name');_0x258f2a[_0xefef('0x35')]=_[_0xefef('0x36')](_0x6b467[_0xefef('0x35')]);_0x258f2a[_0xefef('0x37')]=_[_0xefef('0x38')](_0x258f2a[_0xefef('0x33')],_0x258f2a['query']);_0x45f884[_0xefef('0x39')]=_[_0xefef('0x38')](_0x258f2a['model'],qs[_0xefef('0x3a')](_0x6b467['query']['fields']));_0x45f884[_0xefef('0x39')]=_0x45f884[_0xefef('0x39')]['length']?_0x45f884[_0xefef('0x39')]:_0x258f2a['model'];if(!_0x6b467[_0xefef('0x35')][_0xefef('0x3b')](_0xefef('0x3c'))){_0x45f884['limit']=qs[_0xefef('0x1f')](_0x6b467['query'][_0xefef('0x1f')]);_0x45f884['offset']=qs['offset'](_0x6b467[_0xefef('0x35')][_0xefef('0x21')]);}_0x45f884[_0xefef('0x3d')]=qs[_0xefef('0x3e')](_0x6b467['query']['sort']);_0x45f884[_0xefef('0x3f')]=qs[_0xefef('0x37')](_[_0xefef('0x40')](_0x6b467['query'],_0x258f2a['filters']),_0x25c21c);if(_0x6b467['query'][_0xefef('0x41')]){_0x45f884['where']=_[_0xefef('0x42')](_0x45f884['where'],{'$or':_[_0xefef('0x34')](_0x25c21c,function(_0x31efe7){if(_0x31efe7[_0xefef('0x31')]!==_0xefef('0x43')){var _0x153d84={};_0x153d84[_0x31efe7[_0xefef('0x2c')]]={'$like':'%'+_0x6b467['query'][_0xefef('0x41')]+'%'};return _0x153d84;}})});}_0x45f884=_['merge']({},_0x45f884,_0x6b467[_0xefef('0x44')]);var _0xc7de10={'where':_0x45f884[_0xefef('0x3f')]};return db[_0xefef('0x45')][_0xefef('0x20')](_0xc7de10)[_0xefef('0x25')](function(_0x2ff587){_0x1afe6e[_0xefef('0x20')]=_0x2ff587;if(_0x6b467['query'][_0xefef('0x46')]){_0x45f884[_0xefef('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xefef('0x48')](_0x45f884);})[_0xefef('0x25')](function(_0x3a19d8){_0x1afe6e[_0xefef('0x49')]=_0x3a19d8;return _0x1afe6e;})[_0xefef('0x25')](respondWithFilteredResult(_0x1cbee4,_0x45f884))[_0xefef('0x4a')](handleError(_0x1cbee4,null));};exports[_0xefef('0x4b')]=function(_0x532082,_0x5e90a4){var _0x22d0c2={'raw':!![],'where':{'id':_0x532082[_0xefef('0x4c')]['id']}},_0x1cbb1f={};_0x1cbb1f[_0xefef('0x33')]=_[_0xefef('0x36')](db['WhatsappQueue'][_0xefef('0x2f')]);_0x1cbb1f[_0xefef('0x35')]=_['keys'](_0x532082[_0xefef('0x35')]);_0x1cbb1f['filters']=_[_0xefef('0x38')](_0x1cbb1f['model'],_0x1cbb1f[_0xefef('0x35')]);_0x22d0c2[_0xefef('0x39')]=_['intersection'](_0x1cbb1f[_0xefef('0x33')],qs['fields'](_0x532082['query'][_0xefef('0x3a')]));_0x22d0c2[_0xefef('0x39')]=_0x22d0c2[_0xefef('0x39')][_0xefef('0x4d')]?_0x22d0c2[_0xefef('0x39')]:_0x1cbb1f[_0xefef('0x33')];if(_0x532082[_0xefef('0x35')][_0xefef('0x46')]){_0x22d0c2[_0xefef('0x47')]=[{'all':!![]}];}_0x22d0c2=_[_0xefef('0x42')]({},_0x22d0c2,_0x532082[_0xefef('0x44')]);return db['WhatsappQueue'][_0xefef('0x4e')](_0x22d0c2)[_0xefef('0x25')](handleEntityNotFound(_0x5e90a4,null))['then'](respondWithResult(_0x5e90a4,null))[_0xefef('0x4a')](handleError(_0x5e90a4,null));};exports[_0xefef('0x4f')]=function(_0x4c294d,_0x12d48f){return db['WhatsappQueue'][_0xefef('0x4f')](_0x4c294d['body'],{})[_0xefef('0x25')](function(_0x206131){var _0x22b71e=_0x4c294d[_0xefef('0x50')]['get']({'plain':!![]});if(!_0x22b71e)throw new Error(_0xefef('0x51'));if(_0x22b71e[_0xefef('0x52')]===_0xefef('0x50')){var _0x3ebf25=_0x206131[_0xefef('0x27')]({'plain':!![]});var _0x56f682=_0xefef('0x28');return db[_0xefef('0x53')]['find']({'where':{'name':_0x56f682,'userProfileId':_0x22b71e[_0xefef('0x54')]},'raw':!![]})['then'](function(_0x4455c0){if(_0x4455c0&&_0x4455c0[_0xefef('0x55')]===0x0){return db[_0xefef('0x29')][_0xefef('0x4f')]({'name':_0x3ebf25['name'],'resourceId':_0x3ebf25['id'],'type':_0x4455c0[_0xefef('0x2c')],'sectionId':_0x4455c0['id']},{})['then'](function(){return _0x206131;});}else{return _0x206131;}})[_0xefef('0x4a')](function(_0x56180c){logger[_0xefef('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56180c);throw _0x56180c;});}return _0x206131;})[_0xefef('0x25')](respondWithResult(_0x12d48f,0xc9))['catch'](handleError(_0x12d48f,null));};exports['update']=function(_0x16bef9,_0x23aa6f){if(_0x16bef9[_0xefef('0x56')]['id']){delete _0x16bef9[_0xefef('0x56')]['id'];}return db[_0xefef('0x45')][_0xefef('0x4e')]({'where':{'id':_0x16bef9[_0xefef('0x4c')]['id']}})[_0xefef('0x25')](handleEntityNotFound(_0x23aa6f,null))[_0xefef('0x25')](saveUpdates(_0x16bef9[_0xefef('0x56')],null))[_0xefef('0x25')](respondWithResult(_0x23aa6f,null))['catch'](handleError(_0x23aa6f,null));};exports[_0xefef('0x26')]=function(_0xd00382,_0x291e7a){return db[_0xefef('0x45')]['find']({'where':{'id':_0xd00382['params']['id']}})[_0xefef('0x25')](handleEntityNotFound(_0x291e7a,null))[_0xefef('0x25')](removeEntity(_0x291e7a,null))[_0xefef('0x4a')](handleError(_0x291e7a,null));};exports[_0xefef('0x57')]=function(_0xc658e9,_0x49482d){return db['WhatsappQueue'][_0xefef('0x57')]()['then'](respondWithResult(_0x49482d,null))['catch'](handleError(_0x49482d,null));};exports['getMembers']=function(_0x4d5acc,_0x42a92b,_0x8df484){var _0x5a33e4={'raw':!![],'where':{}},_0x1da33c={},_0x52f79d;return db[_0xefef('0x45')][_0xefef('0x58')]({'where':{'id':_0x4d5acc[_0xefef('0x4c')]['id']}})[_0xefef('0x25')](handleEntityNotFound(_0x42a92b,null))[_0xefef('0x25')](function(_0x4e72aa){if(_0x4e72aa){_0x52f79d=_0x4e72aa[_0xefef('0x27')]({'plain':!![]});_0x1da33c[_0xefef('0x33')]=_['keys'](db[_0xefef('0x59')]['rawAttributes']);_0x1da33c['query']=_['keys'](_0x4d5acc[_0xefef('0x35')]);_0x1da33c[_0xefef('0x37')]=_['intersection'](_0x1da33c[_0xefef('0x33')],_0x1da33c[_0xefef('0x35')]);_0x5a33e4[_0xefef('0x39')]=_['intersection'](_0x1da33c[_0xefef('0x33')],qs[_0xefef('0x3a')](_0x4d5acc[_0xefef('0x35')]['fields']));_0x5a33e4[_0xefef('0x39')]=_0x5a33e4[_0xefef('0x39')][_0xefef('0x4d')]?_0x5a33e4[_0xefef('0x39')]:_0x1da33c[_0xefef('0x33')];if(!_0x4d5acc[_0xefef('0x35')]['hasOwnProperty'](_0xefef('0x3c'))){_0x5a33e4[_0xefef('0x1f')]=qs[_0xefef('0x1f')](_0x4d5acc[_0xefef('0x35')]['limit']);_0x5a33e4[_0xefef('0x21')]=qs[_0xefef('0x21')](_0x4d5acc[_0xefef('0x35')]['offset']);}_0x5a33e4[_0xefef('0x3d')]=qs[_0xefef('0x3e')](_0x4d5acc['query']['sort']);_0x5a33e4[_0xefef('0x3f')]=qs[_0xefef('0x37')](_['pick'](_0x4d5acc[_0xefef('0x35')],_0x1da33c[_0xefef('0x37')]));_0x5a33e4['where']['WhatsappQueueId']=_0x4e72aa['id'];if(_0x4d5acc[_0xefef('0x35')][_0xefef('0x41')]){_0x5a33e4[_0xefef('0x3f')]=_[_0xefef('0x42')](_0x5a33e4[_0xefef('0x3f')],{'$or':_[_0xefef('0x34')](_0x5a33e4[_0xefef('0x39')],function(_0x3382ed){var _0x4ec01d={};_0x4ec01d[_0x3382ed]={'$like':'%'+_0x4d5acc['query']['filter']+'%'};return _0x4ec01d;})});}_0x5a33e4=_['merge']({},_0x5a33e4,_0x4d5acc[_0xefef('0x44')]);return db[_0xefef('0x59')][_0xefef('0x48')](_0x5a33e4);}})[_0xefef('0x25')](function(_0x10c2b4){if(_0x10c2b4){return db[_0xefef('0x5a')][_0xefef('0x5b')]({'where':{'id':_[_0xefef('0x34')](_0x10c2b4,_0xefef('0x5c')),'role':'agent'},'attributes':['id','name','whatsappPause',_0xefef('0x5d'),_0xefef('0x5e')]});}})[_0xefef('0x25')](function(_0x24ff38){if(_0x24ff38){return{'count':_0x24ff38['count'],'rows':_[_0xefef('0x34')](_0x24ff38[_0xefef('0x49')],function(_0x450a9a){return{'membername':_0x450a9a[_0xefef('0x2c')],'UserId':_0x450a9a['id'],'queue_name':_0x52f79d[_0xefef('0x2c')],'WhatsappQueueId':_0x52f79d['id'],'interface':util[_0xefef('0x5f')]('%s/%s',_0xefef('0x60'),_0x450a9a[_0xefef('0x2c')]),'penalty':0x0,'paused':_0x450a9a['whatsappPause'],'createdAt':_0x450a9a[_0xefef('0x5e')],'updatedAt':_0x450a9a[_0xefef('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xefef('0x25')](respondWithFilteredResult(_0x42a92b,_0x5a33e4))[_0xefef('0x4a')](handleError(_0x42a92b,null));};exports['getTeams']=function(_0x18c9c6,_0x3e92b4,_0x4fd505){var _0x1e26d5={};var _0x17cdc2={};var _0x250121;var _0x4868a9;return db[_0xefef('0x45')][_0xefef('0x58')]({'where':{'id':_0x18c9c6[_0xefef('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e92b4,null))[_0xefef('0x25')](function(_0x255e8f){if(_0x255e8f){_0x250121=_0x255e8f;_0x17cdc2[_0xefef('0x33')]=_['keys'](db[_0xefef('0x61')]['rawAttributes']);_0x17cdc2[_0xefef('0x35')]=_[_0xefef('0x36')](_0x18c9c6['query']);_0x17cdc2[_0xefef('0x37')]=_[_0xefef('0x38')](_0x17cdc2['model'],_0x17cdc2[_0xefef('0x35')]);_0x1e26d5[_0xefef('0x39')]=_['intersection'](_0x17cdc2['model'],qs[_0xefef('0x3a')](_0x18c9c6['query'][_0xefef('0x3a')]));_0x1e26d5[_0xefef('0x39')]=_0x1e26d5['attributes']['length']?_0x1e26d5[_0xefef('0x39')]:_0x17cdc2['model'];_0x1e26d5[_0xefef('0x3d')]=qs[_0xefef('0x3e')](_0x18c9c6[_0xefef('0x35')]['sort']);_0x1e26d5['where']=qs[_0xefef('0x37')](_[_0xefef('0x40')](_0x18c9c6[_0xefef('0x35')],_0x17cdc2[_0xefef('0x37')]));if(_0x18c9c6['query'][_0xefef('0x41')]){_0x1e26d5['where']=_[_0xefef('0x42')](_0x1e26d5[_0xefef('0x3f')],{'$or':_[_0xefef('0x34')](_0x1e26d5[_0xefef('0x39')],function(_0x4f46cb){var _0x3249ce={};_0x3249ce[_0x4f46cb]={'$like':'%'+_0x18c9c6[_0xefef('0x35')]['filter']+'%'};return _0x3249ce;})});}_0x1e26d5=_[_0xefef('0x42')]({},_0x1e26d5,_0x18c9c6[_0xefef('0x44')]);return _0x250121[_0xefef('0x62')](_0x1e26d5);}})[_0xefef('0x25')](function(_0x49ddf1){if(_0x49ddf1){_0x4868a9=_0x49ddf1[_0xefef('0x4d')];if(!_0x18c9c6['query'][_0xefef('0x3b')](_0xefef('0x3c'))){_0x1e26d5[_0xefef('0x1f')]=qs[_0xefef('0x1f')](_0x18c9c6['query'][_0xefef('0x1f')]);_0x1e26d5['offset']=qs['offset'](_0x18c9c6['query'][_0xefef('0x21')]);}return _0x250121[_0xefef('0x62')](_0x1e26d5);}})[_0xefef('0x25')](function(_0x3c5ce1){if(_0x3c5ce1){return _0x3c5ce1?{'count':_0x4868a9,'rows':_0x3c5ce1}:null;}})['then'](respondWithResult(_0x3e92b4,null))[_0xefef('0x4a')](handleError(_0x3e92b4,null));};exports[_0xefef('0x63')]=function(_0x4f5089,_0x1a6079,_0x3cd840){var _0x3fa1f4=_0x4f5089[_0xefef('0x56')][_0xefef('0x64')];return db[_0xefef('0x61')][_0xefef('0x48')]({'where':{'id':_0x3fa1f4},'attributes':['id'],'include':[{'model':db[_0xefef('0x5a')],'as':'Agents','attributes':['id',_0xefef('0x2c'),'online','voicePause','interface'],'raw':!![]}]})[_0xefef('0x25')](function(_0x207482){if(_0x207482){var _0x3654c5=_[_0xefef('0x65')](_0x207482,function(_0x23fc60){var _0x217ccd=_0x23fc60[_0xefef('0x27')]({'plain':!![]});return _0x217ccd[_0xefef('0x66')];});return db['WhatsappQueue'][_0xefef('0x4e')]({'where':{'id':_0x4f5089[_0xefef('0x4c')]['id']}})[_0xefef('0x25')](function(_0x1cb63e){return db[_0xefef('0x67')][_0xefef('0x68')](function(_0x40f2b5){return _0x1cb63e['addTeams'](_0x3fa1f4,{'transaction':_0x40f2b5})[_0xefef('0x25')](function(){return BPromise[_0xefef('0x69')](_0x3654c5,function(_0x430380){return db[_0xefef('0x59')][_0xefef('0x6a')]({'where':{'UserId':_0x430380['id'],'WhatsappQueueId':_0x4f5089['params']['id']},'transaction':_0x40f2b5});});})[_0xefef('0x25')](function(){_0x3654c5[_0xefef('0x6b')](function(_0x54d092){socket['emit'](_0xefef('0x6c'),{'UserId':_0x54d092['id'],'WhatsappQueueId':_0x1cb63e['id']});});});});});}})['then'](respondWithStatusCode(_0x1a6079,null))[_0xefef('0x4a')](handleError(_0x1a6079,null));};exports[_0xefef('0x6d')]=function(_0x445fda,_0x153d60,_0x362e52){return db[_0xefef('0x61')][_0xefef('0x48')]({'where':{'id':_0x445fda[_0xefef('0x35')][_0xefef('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xefef('0x66'),'attributes':['id'],'raw':!![]}]})[_0xefef('0x25')](handleEntityNotFound(_0x153d60,null))[_0xefef('0x25')](function(_0x10d6a0){var _0xdd2612=_[_0xefef('0x34')](_0x10d6a0,'id');var _0x42887a=[];var _0x58d415=[];var _0x12bf13=squel[_0xefef('0x6e')]();_0x12bf13[_0xefef('0x6f')](_0xefef('0x70'))['from'](_0xefef('0x71'),'tq')['join'](_0xefef('0x72'),'ut',_0xefef('0x73'))[_0xefef('0x3f')](_0xefef('0x74'),_0x445fda[_0xefef('0x4c')]['id']);for(var _0x111f3d=0x0;_0x111f3d<_0x10d6a0['length'];_0x111f3d+=0x1){let _0x33d358=_0x10d6a0[_0x111f3d];for(var _0x27172b=0x0;_0x27172b<_0x33d358[_0xefef('0x66')][_0xefef('0x4d')];_0x27172b+=0x1){let _0x37c531=_0x33d358[_0xefef('0x66')][_0x27172b];var _0x1729b5=_0x12bf13[_0xefef('0x75')]();_0x1729b5[_0xefef('0x3f')](_0xefef('0x76'),_0x37c531['id']);_0x58d415[_0xefef('0x77')](db[_0xefef('0x67')]['query'](_0x1729b5['toString'](),{'type':db[_0xefef('0x67')]['QueryTypes'][_0xefef('0x78')]})['then'](function(_0x4eba72){if(_0x4eba72[_0xefef('0x4d')]===0x1){return _0x37c531['id'];}else{var _0x3df0b3=_[_0xefef('0x79')](_[_0xefef('0x34')](_0x4eba72,_0xefef('0x7a')),function(_0x4c717a){return _['includes'](_0xdd2612,_0x4c717a);});if(_0x3df0b3){return _0x37c531['id'];}}}));}}return BPromise[_0xefef('0x7b')](_0x58d415)[_0xefef('0x25')](function(_0x2ed7f8){_0x42887a=_(_0x42887a)[_0xefef('0x7c')](_0x2ed7f8)[_0xefef('0x7d')]()[_0xefef('0x7e')]();return db['WhatsappQueue'][_0xefef('0x4e')]({'where':{'id':_0x445fda[_0xefef('0x4c')]['id']}})[_0xefef('0x25')](function(_0x2fecb4){return db['sequelize'][_0xefef('0x68')](function(_0x590ce8){return _0x2fecb4[_0xefef('0x6d')](_0x445fda[_0xefef('0x35')][_0xefef('0x64')],{'transaction':_0x590ce8})['then'](function(){if(!_[_0xefef('0x7f')](_0x42887a)){return _0x2fecb4[_0xefef('0x80')](_0x42887a,{'transaction':_0x590ce8});}})[_0xefef('0x25')](function(){_0x42887a['forEach'](function(_0x2773c9){socket[_0xefef('0x81')](_0xefef('0x82'),{'UserId':_0x2773c9,'WhatsappQueueId':_0x2fecb4['id']});});});});});});})[_0xefef('0x25')](respondWithStatusCode(_0x153d60,null))[_0xefef('0x4a')](handleError(_0x153d60,null));};exports[_0xefef('0x83')]=function(_0x4ffad0,_0x125fc3,_0x25ff64){return db[_0xefef('0x45')][_0xefef('0x4e')]({'where':{'id':_0x4ffad0[_0xefef('0x4c')]['id']}})['then'](handleEntityNotFound(_0x125fc3,null))[_0xefef('0x25')](function(_0xc8531a){if(_0xc8531a){return _0xc8531a['addAgents'](_0x4ffad0[_0xefef('0x56')]['ids'],_['omit'](_0x4ffad0[_0xefef('0x56')],[_0xefef('0x64'),'id'])||{})[_0xefef('0x84')](function(_0x41fe2e){for(var _0x32eb7d=0x0;_0x32eb7d<_0x4ffad0['body'][_0xefef('0x64')][_0xefef('0x4d')];_0x32eb7d+=0x1){socket[_0xefef('0x81')](_0xefef('0x6c'),{'UserId':Number(_0x4ffad0[_0xefef('0x56')][_0xefef('0x64')][_0x32eb7d]),'WhatsappQueueId':Number(_0x4ffad0['params']['id'])});}return _0x41fe2e;});}})[_0xefef('0x25')](respondWithResult(_0x125fc3,null))[_0xefef('0x4a')](handleError(_0x125fc3,null));};exports[_0xefef('0x80')]=function(_0x34717c,_0x5245b1,_0x3e0b12){return db['WhatsappQueue'][_0xefef('0x4e')]({'where':{'id':_0x34717c[_0xefef('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5245b1,null))['then'](function(_0x2c95f9){if(_0x2c95f9){return _0x2c95f9['removeAgents'](_0x34717c[_0xefef('0x35')][_0xefef('0x64')])[_0xefef('0x25')](function(){if(_[_0xefef('0x85')](_0x34717c['query']['ids'])){for(var _0x692f24=0x0;_0x692f24<_0x34717c[_0xefef('0x35')][_0xefef('0x64')][_0xefef('0x4d')];_0x692f24+=0x1){socket[_0xefef('0x81')](_0xefef('0x82'),{'UserId':Number(_0x34717c[_0xefef('0x35')]['ids'][_0x692f24]),'WhatsappQueueId':Number(_0x34717c[_0xefef('0x4c')]['id'])});}}else{socket[_0xefef('0x81')](_0xefef('0x82'),{'UserId':Number(_0x34717c[_0xefef('0x35')][_0xefef('0x64')]),'WhatsappQueueId':Number(_0x34717c[_0xefef('0x4c')]['id'])});}});}})[_0xefef('0x25')](respondWithStatusCode(_0x5245b1,null))[_0xefef('0x4a')](handleError(_0x5245b1,null));};exports[_0xefef('0x86')]=function(_0x86c52f,_0x542e5c,_0x5637e2){var _0x57a7e0={};var _0x209c99={};var _0x4a5353;var _0x26684f;return db['WhatsappQueue'][_0xefef('0x58')]({'where':{'id':_0x86c52f[_0xefef('0x4c')]['id']}})[_0xefef('0x25')](handleEntityNotFound(_0x542e5c,null))[_0xefef('0x25')](function(_0x5d8e31){if(_0x5d8e31){_0x4a5353=_0x5d8e31;_0x209c99['model']=_[_0xefef('0x36')](db[_0xefef('0x5a')]['rawAttributes']);_0x209c99[_0xefef('0x35')]=_[_0xefef('0x36')](_0x86c52f['query']);_0x209c99[_0xefef('0x37')]=_['intersection'](_0x209c99[_0xefef('0x33')],_0x209c99['query']);_0x57a7e0[_0xefef('0x39')]=_['intersection'](_0x209c99['model'],qs[_0xefef('0x3a')](_0x86c52f[_0xefef('0x35')][_0xefef('0x3a')]));_0x57a7e0[_0xefef('0x39')]=_0x57a7e0[_0xefef('0x39')][_0xefef('0x4d')]?_0x57a7e0[_0xefef('0x39')]:_0x209c99[_0xefef('0x33')];_0x57a7e0['order']=qs[_0xefef('0x3e')](_0x86c52f[_0xefef('0x35')][_0xefef('0x3e')]);_0x57a7e0['where']=qs[_0xefef('0x37')](_[_0xefef('0x40')](_0x86c52f[_0xefef('0x35')],_0x209c99[_0xefef('0x37')]));if(_0x86c52f[_0xefef('0x35')][_0xefef('0x41')]){_0x57a7e0[_0xefef('0x3f')]=_[_0xefef('0x42')](_0x57a7e0[_0xefef('0x3f')],{'$or':_[_0xefef('0x34')](_0x57a7e0[_0xefef('0x39')],function(_0xcd4016){var _0x22ff34={};_0x22ff34[_0xcd4016]={'$like':'%'+_0x86c52f['query'][_0xefef('0x41')]+'%'};return _0x22ff34;})});}_0x57a7e0=_[_0xefef('0x42')]({},_0x57a7e0,_0x86c52f[_0xefef('0x44')]);return _0x4a5353[_0xefef('0x86')](_0x57a7e0);}})['then'](function(_0x401e1f){if(_0x401e1f){_0x26684f=_0x401e1f[_0xefef('0x4d')];if(!_0x86c52f[_0xefef('0x35')][_0xefef('0x3b')]('nolimit')){_0x57a7e0[_0xefef('0x1f')]=qs[_0xefef('0x1f')](_0x86c52f['query'][_0xefef('0x1f')]);_0x57a7e0[_0xefef('0x21')]=qs[_0xefef('0x21')](_0x86c52f[_0xefef('0x35')][_0xefef('0x21')]);}return _0x4a5353['getAgents'](_0x57a7e0);}})[_0xefef('0x25')](function(_0x39b2c8){if(_0x39b2c8){return _0x39b2c8?{'count':_0x26684f,'rows':_0x39b2c8}:null;}})[_0xefef('0x25')](respondWithResult(_0x542e5c,null))[_0xefef('0x4a')](handleError(_0x542e5c,null));};
\ No newline at end of file
+var _0xdf90=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','nolimit','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','whatsappPause','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','WhatsappQueue','rawAttributes','type','key'];(function(_0x5749db,_0xdd2afb){var _0x5f346a=function(_0x11fe32){while(--_0x11fe32){_0x5749db['push'](_0x5749db['shift']());}};_0x5f346a(++_0xdd2afb);}(_0xdf90,0x16f));var _0x0df9=function(_0xe7d561,_0x146cef){_0xe7d561=_0xe7d561-0x0;var _0x4c27f0=_0xdf90[_0xe7d561];return _0x4c27f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0df9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0df9('0x1'));var rp=require(_0x0df9('0x2'));var moment=require(_0x0df9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0df9('0x4'));var util=require(_0x0df9('0x5'));var path=require('path');var sox=require(_0x0df9('0x6'));var csv=require(_0x0df9('0x7'));var ejs=require(_0x0df9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0df9('0x9'));var squel=require('squel');var crypto=require(_0x0df9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0df9('0xb'));var toCsv=require(_0x0df9('0x7'));var querystring=require(_0x0df9('0xc'));var Papa=require('papaparse');var Redis=require(_0x0df9('0xd'));var authService=require(_0x0df9('0xe'));var qs=require(_0x0df9('0xf'));var as=require(_0x0df9('0x10'));var hardwareService=require(_0x0df9('0x11'));var logger=require(_0x0df9('0x12'))(_0x0df9('0x13'));var utils=require(_0x0df9('0x14'));var config=require(_0x0df9('0x15'));var licenseUtil=require(_0x0df9('0x16'));var db=require(_0x0df9('0x17'))['db'];config[_0x0df9('0x18')]=_[_0x0df9('0x19')](config[_0x0df9('0x18')],{'host':_0x0df9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0df9('0x1b'))[_0x0df9('0x1c')](socket);function respondWithStatusCode(_0x4f8b31,_0x249e98){_0x249e98=_0x249e98||0xcc;return function(_0x224220){if(_0x224220){return _0x4f8b31[_0x0df9('0x1d')](_0x249e98);}return _0x4f8b31[_0x0df9('0x1e')](_0x249e98)[_0x0df9('0x1f')]();};}function respondWithResult(_0x54218e,_0x1c899c){_0x1c899c=_0x1c899c||0xc8;return function(_0x29023e){if(_0x29023e){return _0x54218e[_0x0df9('0x1e')](_0x1c899c)['json'](_0x29023e);}};}function respondWithFilteredResult(_0x13c3f5,_0x101668){return function(_0x3e2016){if(_0x3e2016){var _0x4fb1b2=typeof _0x101668[_0x0df9('0x20')]===_0x0df9('0x21')&&typeof _0x101668['limit']===_0x0df9('0x21');var _0x41855e=_0x3e2016[_0x0df9('0x22')];var _0x36cf40=_0x4fb1b2?0x0:_0x101668['offset'];var _0x108a84=_0x4fb1b2?_0x3e2016['count']:_0x101668[_0x0df9('0x20')]+_0x101668[_0x0df9('0x23')];var _0x2b5dde;if(_0x108a84>=_0x41855e){_0x108a84=_0x41855e;_0x2b5dde=0xc8;}else{_0x2b5dde=0xce;}_0x13c3f5['status'](_0x2b5dde);return _0x13c3f5[_0x0df9('0x24')](_0x0df9('0x25'),_0x36cf40+'-'+_0x108a84+'/'+_0x41855e)[_0x0df9('0x26')](_0x3e2016);}return null;};}function patchUpdates(_0x570ca1){return function(_0x2e17fc){try{jsonpatch[_0x0df9('0x27')](_0x2e17fc,_0x570ca1,!![]);}catch(_0x3eb77d){return BPromise[_0x0df9('0x28')](_0x3eb77d);}return _0x2e17fc[_0x0df9('0x29')]();};}function saveUpdates(_0x5f15d8,_0x480f12){return function(_0x4e6475){if(_0x4e6475){return _0x4e6475[_0x0df9('0x2a')](_0x5f15d8)[_0x0df9('0x2b')](function(_0x228b44){return _0x228b44;});}return null;};}function removeEntity(_0x1379a7,_0x4b7f8e){return function(_0x4cc339){if(_0x4cc339){return _0x4cc339[_0x0df9('0x2c')]()['then'](function(){var _0x492a7c=_0x4cc339[_0x0df9('0x2d')]({'plain':!![]});var _0x317b5c=_0x0df9('0x2e');return db[_0x0df9('0x2f')][_0x0df9('0x2c')]({'where':{'type':_0x317b5c,'resourceId':_0x492a7c['id']}})[_0x0df9('0x2b')](function(){return _0x4cc339;});})[_0x0df9('0x2b')](function(){_0x1379a7[_0x0df9('0x1e')](0xcc)[_0x0df9('0x1f')]();});}};}function handleEntityNotFound(_0x318801,_0xafbe0c){return function(_0x271815){if(!_0x271815){_0x318801[_0x0df9('0x1d')](0x194);}return _0x271815;};}function handleError(_0x400389,_0x252805){_0x252805=_0x252805||0x1f4;return function(_0xcd8b10){logger[_0x0df9('0x30')](_0xcd8b10[_0x0df9('0x31')]);if(_0xcd8b10[_0x0df9('0x32')]){delete _0xcd8b10['name'];}_0x400389[_0x0df9('0x1e')](_0x252805)['send'](_0xcd8b10);};}exports[_0x0df9('0x33')]=function(_0x53cd65,_0x38afe8){var _0x7860d4={},_0x24d326={},_0x2befe6={'count':0x0,'rows':[]};var _0x32300a=_['map'](db[_0x0df9('0x34')][_0x0df9('0x35')],function(_0x53f9a6){return{'name':_0x53f9a6['fieldName'],'type':_0x53f9a6[_0x0df9('0x36')][_0x0df9('0x37')]};});_0x24d326[_0x0df9('0x38')]=_[_0x0df9('0x39')](_0x32300a,_0x0df9('0x32'));_0x24d326[_0x0df9('0x3a')]=_['keys'](_0x53cd65[_0x0df9('0x3a')]);_0x24d326[_0x0df9('0x3b')]=_[_0x0df9('0x3c')](_0x24d326[_0x0df9('0x38')],_0x24d326['query']);_0x7860d4[_0x0df9('0x3d')]=_[_0x0df9('0x3c')](_0x24d326[_0x0df9('0x38')],qs[_0x0df9('0x3e')](_0x53cd65['query'][_0x0df9('0x3e')]));_0x7860d4['attributes']=_0x7860d4[_0x0df9('0x3d')][_0x0df9('0x3f')]?_0x7860d4[_0x0df9('0x3d')]:_0x24d326['model'];if(!_0x53cd65['query'][_0x0df9('0x40')]('nolimit')){_0x7860d4[_0x0df9('0x23')]=qs[_0x0df9('0x23')](_0x53cd65[_0x0df9('0x3a')][_0x0df9('0x23')]);_0x7860d4['offset']=qs[_0x0df9('0x20')](_0x53cd65[_0x0df9('0x3a')][_0x0df9('0x20')]);}_0x7860d4[_0x0df9('0x41')]=qs[_0x0df9('0x42')](_0x53cd65[_0x0df9('0x3a')][_0x0df9('0x42')]);_0x7860d4[_0x0df9('0x43')]=qs[_0x0df9('0x3b')](_[_0x0df9('0x44')](_0x53cd65[_0x0df9('0x3a')],_0x24d326[_0x0df9('0x3b')]),_0x32300a);if(_0x53cd65[_0x0df9('0x3a')][_0x0df9('0x45')]){_0x7860d4[_0x0df9('0x43')]=_[_0x0df9('0x46')](_0x7860d4[_0x0df9('0x43')],{'$or':_[_0x0df9('0x39')](_0x32300a,function(_0x3eb134){if(_0x3eb134[_0x0df9('0x36')]!==_0x0df9('0x47')){var _0x1b8b0e={};_0x1b8b0e[_0x3eb134[_0x0df9('0x32')]]={'$like':'%'+_0x53cd65[_0x0df9('0x3a')]['filter']+'%'};return _0x1b8b0e;}})});}_0x7860d4=_[_0x0df9('0x46')]({},_0x7860d4,_0x53cd65[_0x0df9('0x48')]);var _0x328942={'where':_0x7860d4[_0x0df9('0x43')]};return db[_0x0df9('0x34')][_0x0df9('0x22')](_0x328942)['then'](function(_0x44a097){_0x2befe6[_0x0df9('0x22')]=_0x44a097;if(_0x53cd65[_0x0df9('0x3a')][_0x0df9('0x49')]){_0x7860d4[_0x0df9('0x4a')]=[{'all':!![]}];}return db[_0x0df9('0x34')][_0x0df9('0x4b')](_0x7860d4);})[_0x0df9('0x2b')](function(_0xbaa2a4){_0x2befe6['rows']=_0xbaa2a4;return _0x2befe6;})[_0x0df9('0x2b')](respondWithFilteredResult(_0x38afe8,_0x7860d4))[_0x0df9('0x4c')](handleError(_0x38afe8,null));};exports[_0x0df9('0x4d')]=function(_0x587559,_0x12a3b5){var _0x2e5202={'raw':!![],'where':{'id':_0x587559[_0x0df9('0x4e')]['id']}},_0x42d9da={};_0x42d9da['model']=_[_0x0df9('0x4f')](db[_0x0df9('0x34')][_0x0df9('0x35')]);_0x42d9da[_0x0df9('0x3a')]=_[_0x0df9('0x4f')](_0x587559[_0x0df9('0x3a')]);_0x42d9da[_0x0df9('0x3b')]=_['intersection'](_0x42d9da[_0x0df9('0x38')],_0x42d9da[_0x0df9('0x3a')]);_0x2e5202[_0x0df9('0x3d')]=_[_0x0df9('0x3c')](_0x42d9da['model'],qs[_0x0df9('0x3e')](_0x587559['query'][_0x0df9('0x3e')]));_0x2e5202[_0x0df9('0x3d')]=_0x2e5202[_0x0df9('0x3d')]['length']?_0x2e5202['attributes']:_0x42d9da[_0x0df9('0x38')];if(_0x587559[_0x0df9('0x3a')][_0x0df9('0x49')]){_0x2e5202[_0x0df9('0x4a')]=[{'all':!![]}];}_0x2e5202=_['merge']({},_0x2e5202,_0x587559[_0x0df9('0x48')]);return db[_0x0df9('0x34')][_0x0df9('0x50')](_0x2e5202)[_0x0df9('0x2b')](handleEntityNotFound(_0x12a3b5,null))[_0x0df9('0x2b')](respondWithResult(_0x12a3b5,null))[_0x0df9('0x4c')](handleError(_0x12a3b5,null));};exports[_0x0df9('0x51')]=function(_0x137b53,_0x3e4431){return db['WhatsappQueue'][_0x0df9('0x51')](_0x137b53[_0x0df9('0x52')],{})[_0x0df9('0x2b')](function(_0x5a6282){var _0x1c6197=_0x137b53[_0x0df9('0x53')][_0x0df9('0x2d')]({'plain':!![]});if(!_0x1c6197)throw new Error(_0x0df9('0x54'));if(_0x1c6197[_0x0df9('0x55')]===_0x0df9('0x53')){var _0x4d0afe=_0x5a6282[_0x0df9('0x2d')]({'plain':!![]});var _0x425228=_0x0df9('0x2e');return db[_0x0df9('0x56')][_0x0df9('0x50')]({'where':{'name':_0x425228,'userProfileId':_0x1c6197[_0x0df9('0x57')]},'raw':!![]})[_0x0df9('0x2b')](function(_0x3301e6){if(_0x3301e6&&_0x3301e6[_0x0df9('0x58')]===0x0){return db[_0x0df9('0x2f')][_0x0df9('0x51')]({'name':_0x4d0afe[_0x0df9('0x32')],'resourceId':_0x4d0afe['id'],'type':_0x3301e6[_0x0df9('0x32')],'sectionId':_0x3301e6['id']},{})[_0x0df9('0x2b')](function(){return _0x5a6282;});}else{return _0x5a6282;}})[_0x0df9('0x4c')](function(_0x2cfbb8){logger['error'](_0x0df9('0x59'),_0x2cfbb8);throw _0x2cfbb8;});}return _0x5a6282;})[_0x0df9('0x2b')](respondWithResult(_0x3e4431,0xc9))[_0x0df9('0x4c')](handleError(_0x3e4431,null));};exports[_0x0df9('0x2a')]=function(_0x2efc19,_0x5056cf){if(_0x2efc19[_0x0df9('0x52')]['id']){delete _0x2efc19[_0x0df9('0x52')]['id'];}return db[_0x0df9('0x34')][_0x0df9('0x50')]({'where':{'id':_0x2efc19['params']['id']}})[_0x0df9('0x2b')](handleEntityNotFound(_0x5056cf,null))[_0x0df9('0x2b')](saveUpdates(_0x2efc19['body'],null))[_0x0df9('0x2b')](respondWithResult(_0x5056cf,null))[_0x0df9('0x4c')](handleError(_0x5056cf,null));};exports['destroy']=function(_0x45fdbb,_0xeeded9){return db[_0x0df9('0x34')][_0x0df9('0x50')]({'where':{'id':_0x45fdbb['params']['id']}})['then'](handleEntityNotFound(_0xeeded9,null))[_0x0df9('0x2b')](removeEntity(_0xeeded9,null))[_0x0df9('0x4c')](handleError(_0xeeded9,null));};exports[_0x0df9('0x5a')]=function(_0x4881a8,_0x3d9e16){return db['WhatsappQueue'][_0x0df9('0x5a')]()[_0x0df9('0x2b')](respondWithResult(_0x3d9e16,null))[_0x0df9('0x4c')](handleError(_0x3d9e16,null));};exports['getMembers']=function(_0x54be24,_0x3e8b6c,_0x3894b2){var _0x42ee0e={'raw':!![],'where':{}},_0x1a8870={},_0x4dc142;return db['WhatsappQueue'][_0x0df9('0x5b')]({'where':{'id':_0x54be24[_0x0df9('0x4e')]['id']}})[_0x0df9('0x2b')](handleEntityNotFound(_0x3e8b6c,null))[_0x0df9('0x2b')](function(_0x6d7b7b){if(_0x6d7b7b){_0x4dc142=_0x6d7b7b['get']({'plain':!![]});_0x1a8870[_0x0df9('0x38')]=_[_0x0df9('0x4f')](db['UserWhatsappQueue'][_0x0df9('0x35')]);_0x1a8870[_0x0df9('0x3a')]=_[_0x0df9('0x4f')](_0x54be24['query']);_0x1a8870['filters']=_[_0x0df9('0x3c')](_0x1a8870['model'],_0x1a8870['query']);_0x42ee0e['attributes']=_['intersection'](_0x1a8870[_0x0df9('0x38')],qs['fields'](_0x54be24[_0x0df9('0x3a')][_0x0df9('0x3e')]));_0x42ee0e['attributes']=_0x42ee0e['attributes'][_0x0df9('0x3f')]?_0x42ee0e['attributes']:_0x1a8870[_0x0df9('0x38')];if(!_0x54be24['query']['hasOwnProperty'](_0x0df9('0x5c'))){_0x42ee0e[_0x0df9('0x23')]=qs['limit'](_0x54be24[_0x0df9('0x3a')]['limit']);_0x42ee0e['offset']=qs[_0x0df9('0x20')](_0x54be24[_0x0df9('0x3a')][_0x0df9('0x20')]);}_0x42ee0e[_0x0df9('0x41')]=qs['sort'](_0x54be24['query'][_0x0df9('0x42')]);_0x42ee0e[_0x0df9('0x43')]=qs[_0x0df9('0x3b')](_['pick'](_0x54be24[_0x0df9('0x3a')],_0x1a8870[_0x0df9('0x3b')]));_0x42ee0e['where'][_0x0df9('0x5d')]=_0x6d7b7b['id'];if(_0x54be24[_0x0df9('0x3a')]['filter']){_0x42ee0e[_0x0df9('0x43')]=_[_0x0df9('0x46')](_0x42ee0e['where'],{'$or':_[_0x0df9('0x39')](_0x42ee0e['attributes'],function(_0x1dbfa9){var _0x4d0707={};_0x4d0707[_0x1dbfa9]={'$like':'%'+_0x54be24['query'][_0x0df9('0x45')]+'%'};return _0x4d0707;})});}_0x42ee0e=_[_0x0df9('0x46')]({},_0x42ee0e,_0x54be24[_0x0df9('0x48')]);return db[_0x0df9('0x5e')][_0x0df9('0x4b')](_0x42ee0e);}})[_0x0df9('0x2b')](function(_0x221cca){if(_0x221cca){return db[_0x0df9('0x5f')][_0x0df9('0x60')]({'where':{'id':_['map'](_0x221cca,'UserId'),'role':_0x0df9('0x61')},'attributes':['id',_0x0df9('0x32'),'whatsappPause',_0x0df9('0x62'),'createdAt']});}})[_0x0df9('0x2b')](function(_0x456f1a){if(_0x456f1a){return{'count':_0x456f1a[_0x0df9('0x22')],'rows':_[_0x0df9('0x39')](_0x456f1a['rows'],function(_0x12ea18){return{'membername':_0x12ea18[_0x0df9('0x32')],'UserId':_0x12ea18['id'],'queue_name':_0x4dc142['name'],'WhatsappQueueId':_0x4dc142['id'],'interface':util[_0x0df9('0x63')](_0x0df9('0x64'),_0x0df9('0x65'),_0x12ea18['name']),'penalty':0x0,'paused':_0x12ea18[_0x0df9('0x66')],'createdAt':_0x12ea18[_0x0df9('0x67')],'updatedAt':_0x12ea18[_0x0df9('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0df9('0x2b')](respondWithFilteredResult(_0x3e8b6c,_0x42ee0e))[_0x0df9('0x4c')](handleError(_0x3e8b6c,null));};exports[_0x0df9('0x68')]=function(_0x34782a,_0x42e872,_0x3c970c){var _0x578842={};var _0x48653c={};var _0x43b91d;var _0x5c1841;return db[_0x0df9('0x34')][_0x0df9('0x5b')]({'where':{'id':_0x34782a[_0x0df9('0x4e')]['id']}})[_0x0df9('0x2b')](handleEntityNotFound(_0x42e872,null))[_0x0df9('0x2b')](function(_0x3dc715){if(_0x3dc715){_0x43b91d=_0x3dc715;_0x48653c[_0x0df9('0x38')]=_[_0x0df9('0x4f')](db[_0x0df9('0x69')][_0x0df9('0x35')]);_0x48653c[_0x0df9('0x3a')]=_[_0x0df9('0x4f')](_0x34782a[_0x0df9('0x3a')]);_0x48653c['filters']=_[_0x0df9('0x3c')](_0x48653c[_0x0df9('0x38')],_0x48653c[_0x0df9('0x3a')]);_0x578842['attributes']=_[_0x0df9('0x3c')](_0x48653c[_0x0df9('0x38')],qs['fields'](_0x34782a[_0x0df9('0x3a')][_0x0df9('0x3e')]));_0x578842[_0x0df9('0x3d')]=_0x578842[_0x0df9('0x3d')][_0x0df9('0x3f')]?_0x578842[_0x0df9('0x3d')]:_0x48653c[_0x0df9('0x38')];_0x578842[_0x0df9('0x41')]=qs[_0x0df9('0x42')](_0x34782a[_0x0df9('0x3a')][_0x0df9('0x42')]);_0x578842['where']=qs[_0x0df9('0x3b')](_[_0x0df9('0x44')](_0x34782a[_0x0df9('0x3a')],_0x48653c[_0x0df9('0x3b')]));if(_0x34782a[_0x0df9('0x3a')][_0x0df9('0x45')]){_0x578842[_0x0df9('0x43')]=_[_0x0df9('0x46')](_0x578842['where'],{'$or':_[_0x0df9('0x39')](_0x578842[_0x0df9('0x3d')],function(_0x1c38d1){var _0x8905a3={};_0x8905a3[_0x1c38d1]={'$like':'%'+_0x34782a[_0x0df9('0x3a')]['filter']+'%'};return _0x8905a3;})});}_0x578842=_[_0x0df9('0x46')]({},_0x578842,_0x34782a['options']);return _0x43b91d[_0x0df9('0x68')](_0x578842);}})[_0x0df9('0x2b')](function(_0x528fba){if(_0x528fba){_0x5c1841=_0x528fba['length'];if(!_0x34782a[_0x0df9('0x3a')][_0x0df9('0x40')](_0x0df9('0x5c'))){_0x578842[_0x0df9('0x23')]=qs[_0x0df9('0x23')](_0x34782a[_0x0df9('0x3a')][_0x0df9('0x23')]);_0x578842['offset']=qs['offset'](_0x34782a[_0x0df9('0x3a')][_0x0df9('0x20')]);}return _0x43b91d['getTeams'](_0x578842);}})['then'](function(_0x34679a){if(_0x34679a){return _0x34679a?{'count':_0x5c1841,'rows':_0x34679a}:null;}})[_0x0df9('0x2b')](respondWithResult(_0x42e872,null))['catch'](handleError(_0x42e872,null));};exports['addTeams']=function(_0x352451,_0x22a0ad,_0x49eccb){var _0x2408c9=_0x352451['body'][_0x0df9('0x6a')];return db[_0x0df9('0x69')][_0x0df9('0x4b')]({'where':{'id':_0x2408c9},'attributes':['id'],'include':[{'model':db[_0x0df9('0x5f')],'as':_0x0df9('0x6b'),'attributes':['id',_0x0df9('0x32'),_0x0df9('0x6c'),_0x0df9('0x6d'),_0x0df9('0x6e')],'raw':!![]}]})[_0x0df9('0x2b')](function(_0x580515){if(_0x580515){var _0x99b7f2=_['flatMap'](_0x580515,function(_0x374eb1){var _0x31aadd=_0x374eb1[_0x0df9('0x2d')]({'plain':!![]});return _0x31aadd[_0x0df9('0x6b')];});return db[_0x0df9('0x34')][_0x0df9('0x50')]({'where':{'id':_0x352451['params']['id']}})['then'](function(_0x129fe1){return db[_0x0df9('0x6f')][_0x0df9('0x70')](function(_0x5bb787){return _0x129fe1[_0x0df9('0x71')](_0x2408c9,{'transaction':_0x5bb787})[_0x0df9('0x2b')](function(){return BPromise[_0x0df9('0x72')](_0x99b7f2,function(_0x33c298){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x33c298['id'],'WhatsappQueueId':_0x352451[_0x0df9('0x4e')]['id']},'transaction':_0x5bb787});});})[_0x0df9('0x2b')](function(){_0x99b7f2[_0x0df9('0x73')](function(_0x1e4a15){socket[_0x0df9('0x74')](_0x0df9('0x75'),{'UserId':_0x1e4a15['id'],'WhatsappQueueId':_0x129fe1['id']});});});});});}})[_0x0df9('0x2b')](respondWithStatusCode(_0x22a0ad,null))[_0x0df9('0x4c')](handleError(_0x22a0ad,null));};exports[_0x0df9('0x76')]=function(_0x308c47,_0x5e7f7d,_0x2e0962){return db[_0x0df9('0x69')][_0x0df9('0x4b')]({'where':{'id':_0x308c47[_0x0df9('0x3a')][_0x0df9('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0df9('0x2b')](handleEntityNotFound(_0x5e7f7d,null))[_0x0df9('0x2b')](function(_0xef1b48){var _0x59fdd3=_['map'](_0xef1b48,'id');var _0x3e1069=[];var _0x524378=[];var _0x4f2596=squel[_0x0df9('0x77')]();_0x4f2596[_0x0df9('0x78')]('tq.TeamId')['from'](_0x0df9('0x79'),'tq')[_0x0df9('0x7a')](_0x0df9('0x7b'),'ut',_0x0df9('0x7c'))['where'](_0x0df9('0x7d'),_0x308c47['params']['id']);for(var _0x3f66ff=0x0;_0x3f66ff<_0xef1b48['length'];_0x3f66ff+=0x1){let _0x5d870e=_0xef1b48[_0x3f66ff];for(var _0x59d54f=0x0;_0x59d54f<_0x5d870e[_0x0df9('0x6b')][_0x0df9('0x3f')];_0x59d54f+=0x1){let _0x241471=_0x5d870e[_0x0df9('0x6b')][_0x59d54f];var _0x2e578e=_0x4f2596['clone']();_0x2e578e[_0x0df9('0x43')](_0x0df9('0x7e'),_0x241471['id']);_0x524378[_0x0df9('0x7f')](db[_0x0df9('0x6f')][_0x0df9('0x3a')](_0x2e578e['toString'](),{'type':db[_0x0df9('0x6f')][_0x0df9('0x80')]['SELECT']})[_0x0df9('0x2b')](function(_0x3f6f57){if(_0x3f6f57[_0x0df9('0x3f')]===0x1){return _0x241471['id'];}else{var _0x129274=_['every'](_[_0x0df9('0x39')](_0x3f6f57,_0x0df9('0x81')),function(_0x536e83){return _[_0x0df9('0x82')](_0x59fdd3,_0x536e83);});if(_0x129274){return _0x241471['id'];}}}));}}return BPromise[_0x0df9('0x83')](_0x524378)[_0x0df9('0x2b')](function(_0xa823ca){_0x3e1069=_(_0x3e1069)[_0x0df9('0x84')](_0xa823ca)['compact']()[_0x0df9('0x85')]();return db['WhatsappQueue'][_0x0df9('0x50')]({'where':{'id':_0x308c47[_0x0df9('0x4e')]['id']}})['then'](function(_0x3b81b8){return db[_0x0df9('0x6f')][_0x0df9('0x70')](function(_0x5a8065){return _0x3b81b8['removeTeams'](_0x308c47[_0x0df9('0x3a')][_0x0df9('0x6a')],{'transaction':_0x5a8065})[_0x0df9('0x2b')](function(){if(!_[_0x0df9('0x86')](_0x3e1069)){return _0x3b81b8[_0x0df9('0x87')](_0x3e1069,{'transaction':_0x5a8065});}})[_0x0df9('0x2b')](function(){_0x3e1069[_0x0df9('0x73')](function(_0x3c0af6){socket['emit'](_0x0df9('0x88'),{'UserId':_0x3c0af6,'WhatsappQueueId':_0x3b81b8['id']});});});});});});})[_0x0df9('0x2b')](respondWithStatusCode(_0x5e7f7d,null))[_0x0df9('0x4c')](handleError(_0x5e7f7d,null));};exports[_0x0df9('0x89')]=function(_0x185c1d,_0xa049b8,_0x4aa177){return db[_0x0df9('0x34')][_0x0df9('0x50')]({'where':{'id':_0x185c1d[_0x0df9('0x4e')]['id']}})[_0x0df9('0x2b')](handleEntityNotFound(_0xa049b8,null))['then'](function(_0x178d29){if(_0x178d29){return _0x178d29[_0x0df9('0x89')](_0x185c1d['body'][_0x0df9('0x6a')],_['omit'](_0x185c1d[_0x0df9('0x52')],[_0x0df9('0x6a'),'id'])||{})[_0x0df9('0x8a')](function(_0x421e8a){for(var _0x50f9ea=0x0;_0x50f9ea<_0x185c1d[_0x0df9('0x52')]['ids']['length'];_0x50f9ea+=0x1){socket[_0x0df9('0x74')](_0x0df9('0x75'),{'UserId':Number(_0x185c1d[_0x0df9('0x52')]['ids'][_0x50f9ea]),'WhatsappQueueId':Number(_0x185c1d[_0x0df9('0x4e')]['id'])});}return _0x421e8a;});}})[_0x0df9('0x2b')](respondWithResult(_0xa049b8,null))[_0x0df9('0x4c')](handleError(_0xa049b8,null));};exports['removeAgents']=function(_0x3ba3f0,_0x1dc38c,_0x8f122){return db[_0x0df9('0x34')]['find']({'where':{'id':_0x3ba3f0['params']['id']}})['then'](handleEntityNotFound(_0x1dc38c,null))[_0x0df9('0x2b')](function(_0x7e2560){if(_0x7e2560){return _0x7e2560[_0x0df9('0x87')](_0x3ba3f0[_0x0df9('0x3a')][_0x0df9('0x6a')])['then'](function(){if(_[_0x0df9('0x8b')](_0x3ba3f0[_0x0df9('0x3a')]['ids'])){for(var _0x25c688=0x0;_0x25c688<_0x3ba3f0['query'][_0x0df9('0x6a')]['length'];_0x25c688+=0x1){socket[_0x0df9('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x3ba3f0[_0x0df9('0x3a')]['ids'][_0x25c688]),'WhatsappQueueId':Number(_0x3ba3f0[_0x0df9('0x4e')]['id'])});}}else{socket['emit'](_0x0df9('0x88'),{'UserId':Number(_0x3ba3f0[_0x0df9('0x3a')][_0x0df9('0x6a')]),'WhatsappQueueId':Number(_0x3ba3f0['params']['id'])});}});}})[_0x0df9('0x2b')](respondWithStatusCode(_0x1dc38c,null))[_0x0df9('0x4c')](handleError(_0x1dc38c,null));};exports[_0x0df9('0x8c')]=function(_0x362c77,_0x33425b,_0x4ca5f2){var _0x52acc5={};var _0x5e46e8={};var _0xedc7a6;var _0x3cb253;return db['WhatsappQueue']['findOne']({'where':{'id':_0x362c77[_0x0df9('0x4e')]['id']}})[_0x0df9('0x2b')](handleEntityNotFound(_0x33425b,null))['then'](function(_0x49d405){if(_0x49d405){_0xedc7a6=_0x49d405;_0x5e46e8['model']=_[_0x0df9('0x4f')](db['User'][_0x0df9('0x35')]);_0x5e46e8[_0x0df9('0x3a')]=_[_0x0df9('0x4f')](_0x362c77[_0x0df9('0x3a')]);_0x5e46e8[_0x0df9('0x3b')]=_[_0x0df9('0x3c')](_0x5e46e8[_0x0df9('0x38')],_0x5e46e8[_0x0df9('0x3a')]);_0x52acc5[_0x0df9('0x3d')]=_['intersection'](_0x5e46e8[_0x0df9('0x38')],qs[_0x0df9('0x3e')](_0x362c77[_0x0df9('0x3a')][_0x0df9('0x3e')]));_0x52acc5[_0x0df9('0x3d')]=_0x52acc5[_0x0df9('0x3d')][_0x0df9('0x3f')]?_0x52acc5[_0x0df9('0x3d')]:_0x5e46e8[_0x0df9('0x38')];_0x52acc5[_0x0df9('0x41')]=qs[_0x0df9('0x42')](_0x362c77['query'][_0x0df9('0x42')]);_0x52acc5[_0x0df9('0x43')]=qs[_0x0df9('0x3b')](_[_0x0df9('0x44')](_0x362c77[_0x0df9('0x3a')],_0x5e46e8[_0x0df9('0x3b')]));if(_0x362c77[_0x0df9('0x3a')]['filter']){_0x52acc5[_0x0df9('0x43')]=_[_0x0df9('0x46')](_0x52acc5['where'],{'$or':_[_0x0df9('0x39')](_0x52acc5['attributes'],function(_0x5680fb){var _0x3a09f9={};_0x3a09f9[_0x5680fb]={'$like':'%'+_0x362c77['query'][_0x0df9('0x45')]+'%'};return _0x3a09f9;})});}_0x52acc5=_[_0x0df9('0x46')]({},_0x52acc5,_0x362c77['options']);return _0xedc7a6[_0x0df9('0x8c')](_0x52acc5);}})[_0x0df9('0x2b')](function(_0x119ca9){if(_0x119ca9){_0x3cb253=_0x119ca9[_0x0df9('0x3f')];if(!_0x362c77[_0x0df9('0x3a')][_0x0df9('0x40')](_0x0df9('0x5c'))){_0x52acc5['limit']=qs[_0x0df9('0x23')](_0x362c77[_0x0df9('0x3a')][_0x0df9('0x23')]);_0x52acc5['offset']=qs[_0x0df9('0x20')](_0x362c77[_0x0df9('0x3a')][_0x0df9('0x20')]);}return _0xedc7a6[_0x0df9('0x8c')](_0x52acc5);}})[_0x0df9('0x2b')](function(_0x28f08b){if(_0x28f08b){return _0x28f08b?{'count':_0x3cb253,'rows':_0x28f08b}:null;}})[_0x0df9('0x2b')](respondWithResult(_0x33425b,null))[_0x0df9('0x4c')](handleError(_0x33425b,null));};
\ No newline at end of file
index 8b0df3b..955114e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f6=['WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0xe7f6,0x14b));var _0x6e7f=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0xe7f6[_0x4b0290];return _0x4bd9f4;};'use strict';var EventEmitter=require(_0x6e7f('0x0'));var WhatsappQueue=require(_0x6e7f('0x1'))['db'][_0x6e7f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6e7f('0x3')](0x0);var events={'afterCreate':_0x6e7f('0x4'),'afterUpdate':_0x6e7f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x333e90){return function(_0x1cc4df,_0xa5a5e,_0x2c1980){WhatsappQueueEvents[_0x6e7f('0x6')](_0x333e90+':'+_0x1cc4df['id'],_0x1cc4df);WhatsappQueueEvents[_0x6e7f('0x6')](_0x333e90,_0x1cc4df);_0x2c1980(null);};}for(var e in events){if(events[_0x6e7f('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x6e7f('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x4b5c=['events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2a1b49,_0x5abef2){var _0x280196=function(_0xe4d9bb){while(--_0xe4d9bb){_0x2a1b49['push'](_0x2a1b49['shift']());}};_0x280196(++_0x5abef2);}(_0x4b5c,0x108));var _0xc4b5=function(_0x1c0aad,_0x391c2a){_0x1c0aad=_0x1c0aad-0x0;var _0x5e660e=_0x4b5c[_0x1c0aad];return _0x5e660e;};'use strict';var EventEmitter=require(_0xc4b5('0x0'));var WhatsappQueue=require(_0xc4b5('0x1'))['db'][_0xc4b5('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc4b5('0x3')](0x0);var events={'afterCreate':_0xc4b5('0x4'),'afterUpdate':_0xc4b5('0x5'),'afterDestroy':_0xc4b5('0x6')};function emitEvent(_0x30494f){return function(_0x235b55,_0x171858,_0x1c5a06){WhatsappQueueEvents['emit'](_0x30494f+':'+_0x235b55['id'],_0x235b55);WhatsappQueueEvents[_0xc4b5('0x7')](_0x30494f,_0x235b55);_0x1c5a06(null);};}for(var e in events){if(events[_0xc4b5('0x8')](e)){var event=events[e];WhatsappQueue[_0xc4b5('0x9')](e,emitEvent(event));}}module[_0xc4b5('0xa')]=WhatsappQueueEvents;
\ No newline at end of file
index d18c6bb..2cfab5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aeb=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2aeb,0x1af));var _0xb2ae=function(_0x4b8938,_0x1e8d85){_0x4b8938=_0x4b8938-0x0;var _0x196951=_0x2aeb[_0x4b8938];return _0x196951;};'use strict';var _=require(_0xb2ae('0x0'));var util=require('util');var logger=require(_0xb2ae('0x1'))(_0xb2ae('0x2'));var moment=require(_0xb2ae('0x3'));var BPromise=require(_0xb2ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ae('0x5'));var rimraf=require(_0xb2ae('0x6'));var config=require(_0xb2ae('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xb2ae('0x8')]=function(_0xf98265,_0x31a01b){return _0xf98265[_0xb2ae('0x9')](_0xb2ae('0xa'),attributes,{'tableName':_0xb2ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf926=['exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','request-promise','path','./whatsappQueue.attributes'];(function(_0x1ba868,_0x2c3dac){var _0x454122=function(_0x312e28){while(--_0x312e28){_0x1ba868['push'](_0x1ba868['shift']());}};_0x454122(++_0x2c3dac);}(_0xf926,0x9e));var _0x6f92=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xf926[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6f92('0x0'));var util=require('util');var logger=require(_0x6f92('0x1'))(_0x6f92('0x2'));var moment=require(_0x6f92('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f92('0x4'));var fs=require('fs');var path=require(_0x6f92('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f92('0x6'));module[_0x6f92('0x7')]=function(_0x4b016e,_0x5b31ee){return _0x4b016e[_0x6f92('0x8')](_0x6f92('0x9'),attributes,{'tableName':_0x6f92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 725d16a..5484c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf369=['jayson/promise','client','http','defaults','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','map','include','model','debug','ShowWhatsappQueue','find','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x25b5e6,_0x5ca8b5){var _0x144c70=function(_0x5b1aa7){while(--_0x5b1aa7){_0x25b5e6['push'](_0x25b5e6['shift']());}};_0x144c70(++_0x5ca8b5);}(_0xf369,0x160));var _0x9f36=function(_0x1a1a9b,_0x3ecd10){_0x1a1a9b=_0x1a1a9b-0x0;var _0x3a69b5=_0xf369[_0x1a1a9b];return _0x3a69b5;};'use strict';var _=require('lodash');var util=require(_0x9f36('0x0'));var moment=require(_0x9f36('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f36('0x2'));var fs=require('fs');var Redis=require(_0x9f36('0x3'));var db=require(_0x9f36('0x4'))['db'];var utils=require(_0x9f36('0x5'));var logger=require('../../config/logger')(_0x9f36('0x6'));var config=require(_0x9f36('0x7'));var jayson=require(_0x9f36('0x8'));var client=jayson[_0x9f36('0x9')][_0x9f36('0xa')]({'port':0x232a});config['redis']=_[_0x9f36('0xb')](config[_0x9f36('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9f36('0xd'))[_0x9f36('0xe')](socket);function respondWithRpcPromise(_0x11404c,_0x118f3d,_0x1e98b9){return new BPromise(function(_0x1eee1c,_0x4bacf0){return client[_0x9f36('0xf')](_0x11404c,_0x1e98b9)[_0x9f36('0x10')](function(_0x2b5086){logger[_0x9f36('0x11')](_0x9f36('0x12'),_0x118f3d,_0x9f36('0x13'));logger['debug'](_0x9f36('0x14'),_0x118f3d,_0x9f36('0x13'),JSON[_0x9f36('0x15')](_0x2b5086));if(_0x2b5086[_0x9f36('0x16')]){if(_0x2b5086['error'][_0x9f36('0x17')]===0x1f4){logger['error'](_0x9f36('0x12'),_0x118f3d,_0x2b5086['error']['message']);return _0x4bacf0(_0x2b5086['error']['message']);}logger[_0x9f36('0x16')](_0x9f36('0x12'),_0x118f3d,_0x2b5086[_0x9f36('0x16')][_0x9f36('0x18')]);return _0x1eee1c(_0x2b5086[_0x9f36('0x16')][_0x9f36('0x18')]);}else{logger[_0x9f36('0x11')](_0x9f36('0x12'),_0x118f3d,'request\x20sent');_0x1eee1c(_0x2b5086['result'][_0x9f36('0x18')]);}})['catch'](function(_0x418425){logger[_0x9f36('0x16')](_0x9f36('0x12'),_0x118f3d,_0x418425);_0x4bacf0(_0x418425);});});}exports[_0x9f36('0x19')]=function(_0x53b06a){var _0x4531ed=this;return new Promise(function(_0xa4c2ef,_0x3e6af7){return db[_0x9f36('0x1a')][_0x9f36('0x1b')]({'raw':_0x53b06a[_0x9f36('0x1c')]?_0x53b06a['options']['raw']===undefined?!![]:![]:!![],'where':_0x53b06a['options']?_0x53b06a['options'][_0x9f36('0x1d')]||null:null,'attributes':_0x53b06a[_0x9f36('0x1c')]?_0x53b06a['options'][_0x9f36('0x1e')]||null:null,'limit':_0x53b06a[_0x9f36('0x1c')]?_0x53b06a[_0x9f36('0x1c')][_0x9f36('0x1f')]||null:null,'include':_0x53b06a['options']?_0x53b06a[_0x9f36('0x1c')]['include']?_[_0x9f36('0x20')](_0x53b06a[_0x9f36('0x1c')][_0x9f36('0x21')],function(_0x5a5620){return{'model':db[_0x5a5620[_0x9f36('0x22')]],'as':_0x5a5620['as'],'attributes':_0x5a5620[_0x9f36('0x1e')],'include':_0x5a5620[_0x9f36('0x21')]?_['map'](_0x5a5620[_0x9f36('0x21')],function(_0x575e03){return{'model':db[_0x575e03[_0x9f36('0x22')]],'as':_0x575e03['as'],'attributes':_0x575e03[_0x9f36('0x1e')],'include':_0x575e03[_0x9f36('0x21')]?_[_0x9f36('0x20')](_0x575e03['include'],function(_0x4b1a89){return{'model':db[_0x4b1a89['model']],'as':_0x4b1a89['as'],'attributes':_0x4b1a89[_0x9f36('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9f36('0x10')](function(_0x31e19f){logger['info'](_0x9f36('0x19'),_0x53b06a);logger[_0x9f36('0x23')](_0x9f36('0x19'),_0x53b06a,JSON[_0x9f36('0x15')](_0x31e19f));_0xa4c2ef(_0x31e19f);})['catch'](function(_0x570436){logger['error'](_0x9f36('0x19'),_0x570436['message'],_0x53b06a);_0x3e6af7(_0x4531ed['error'](0x1f4,_0x570436[_0x9f36('0x18')]));});});};exports[_0x9f36('0x24')]=function(_0x139902){var _0x444bf1=this;return new Promise(function(_0x142baa,_0x5c31fc){return db[_0x9f36('0x1a')][_0x9f36('0x25')]({'raw':_0x139902[_0x9f36('0x1c')]?_0x139902['options'][_0x9f36('0x26')]===undefined?!![]:![]:!![],'where':_0x139902['options']?_0x139902[_0x9f36('0x1c')][_0x9f36('0x1d')]||null:null,'attributes':_0x139902[_0x9f36('0x1c')]?_0x139902[_0x9f36('0x1c')]['attributes']||null:null,'include':_0x139902['options']?_0x139902[_0x9f36('0x1c')][_0x9f36('0x21')]?_[_0x9f36('0x20')](_0x139902['options']['include'],function(_0x412be2){return{'model':db[_0x412be2[_0x9f36('0x22')]],'as':_0x412be2['as'],'attributes':_0x412be2[_0x9f36('0x1e')],'include':_0x412be2[_0x9f36('0x21')]?_['map'](_0x412be2[_0x9f36('0x21')],function(_0x4a176f){return{'model':db[_0x4a176f[_0x9f36('0x22')]],'as':_0x4a176f['as'],'attributes':_0x4a176f[_0x9f36('0x1e')],'include':_0x4a176f[_0x9f36('0x21')]?_['map'](_0x4a176f['include'],function(_0x148f34){return{'model':db[_0x148f34[_0x9f36('0x22')]],'as':_0x148f34['as'],'attributes':_0x148f34[_0x9f36('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9f36('0x10')](function(_0x38aabc){logger['info']('ShowWhatsappQueue',_0x139902);logger[_0x9f36('0x23')](_0x9f36('0x24'),_0x139902,JSON['stringify'](_0x38aabc));_0x142baa(_0x38aabc);})[_0x9f36('0x27')](function(_0x456d1){logger['error'](_0x9f36('0x24'),_0x456d1['message'],_0x139902);_0x5c31fc(_0x444bf1['error'](0x1f4,_0x456d1[_0x9f36('0x18')]));});});};
\ No newline at end of file
+var _0x9c4b=['localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x15c4d2,_0x315d4c){var _0x448e91=function(_0x2dc327){while(--_0x2dc327){_0x15c4d2['push'](_0x15c4d2['shift']());}};_0x448e91(++_0x315d4c);}(_0x9c4b,0x18e));var _0xb9c4=function(_0xb9b594,_0x30617b){_0xb9b594=_0xb9b594-0x0;var _0x3609ba=_0x9c4b[_0xb9b594];return _0x3609ba;};'use strict';var _=require(_0xb9c4('0x0'));var util=require('util');var moment=require(_0xb9c4('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9c4('0x2'));var fs=require('fs');var Redis=require(_0xb9c4('0x3'));var db=require(_0xb9c4('0x4'))['db'];var utils=require(_0xb9c4('0x5'));var logger=require(_0xb9c4('0x6'))('rpc');var config=require(_0xb9c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9c4('0x8')][_0xb9c4('0x9')]({'port':0x232a});config[_0xb9c4('0xa')]=_[_0xb9c4('0xb')](config[_0xb9c4('0xa')],{'host':_0xb9c4('0xc'),'port':0x18eb});var socket=require(_0xb9c4('0xd'))(new Redis(config[_0xb9c4('0xa')]));require(_0xb9c4('0xe'))['register'](socket);function respondWithRpcPromise(_0x454d7a,_0x38e0de,_0x250e25){return new BPromise(function(_0x5d22b3,_0x3359b9){return client[_0xb9c4('0xf')](_0x454d7a,_0x250e25)[_0xb9c4('0x10')](function(_0x9f42db){logger[_0xb9c4('0x11')](_0xb9c4('0x12'),_0x38e0de,_0xb9c4('0x13'));logger[_0xb9c4('0x14')](_0xb9c4('0x15'),_0x38e0de,_0xb9c4('0x13'),JSON['stringify'](_0x9f42db));if(_0x9f42db['error']){if(_0x9f42db[_0xb9c4('0x16')][_0xb9c4('0x17')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x38e0de,_0x9f42db[_0xb9c4('0x16')][_0xb9c4('0x18')]);return _0x3359b9(_0x9f42db[_0xb9c4('0x16')]['message']);}logger[_0xb9c4('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x38e0de,_0x9f42db[_0xb9c4('0x16')][_0xb9c4('0x18')]);return _0x5d22b3(_0x9f42db[_0xb9c4('0x16')][_0xb9c4('0x18')]);}else{logger[_0xb9c4('0x11')](_0xb9c4('0x12'),_0x38e0de,_0xb9c4('0x13'));_0x5d22b3(_0x9f42db[_0xb9c4('0x19')][_0xb9c4('0x18')]);}})[_0xb9c4('0x1a')](function(_0x117e9b){logger[_0xb9c4('0x16')](_0xb9c4('0x12'),_0x38e0de,_0x117e9b);_0x3359b9(_0x117e9b);});});}exports['GetWhatsappQueue']=function(_0x274266){var _0x5c443f=this;return new Promise(function(_0x397b63,_0x58bae1){return db[_0xb9c4('0x1b')][_0xb9c4('0x1c')]({'raw':_0x274266[_0xb9c4('0x1d')]?_0x274266[_0xb9c4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x274266[_0xb9c4('0x1d')]?_0x274266[_0xb9c4('0x1d')][_0xb9c4('0x1e')]||null:null,'attributes':_0x274266[_0xb9c4('0x1d')]?_0x274266[_0xb9c4('0x1d')]['attributes']||null:null,'limit':_0x274266[_0xb9c4('0x1d')]?_0x274266['options'][_0xb9c4('0x1f')]||null:null,'include':_0x274266['options']?_0x274266[_0xb9c4('0x1d')][_0xb9c4('0x20')]?_[_0xb9c4('0x21')](_0x274266[_0xb9c4('0x1d')][_0xb9c4('0x20')],function(_0x5e33a8){return{'model':db[_0x5e33a8[_0xb9c4('0x22')]],'as':_0x5e33a8['as'],'attributes':_0x5e33a8['attributes'],'include':_0x5e33a8[_0xb9c4('0x20')]?_[_0xb9c4('0x21')](_0x5e33a8[_0xb9c4('0x20')],function(_0x1a3f3f){return{'model':db[_0x1a3f3f[_0xb9c4('0x22')]],'as':_0x1a3f3f['as'],'attributes':_0x1a3f3f[_0xb9c4('0x23')],'include':_0x1a3f3f[_0xb9c4('0x20')]?_[_0xb9c4('0x21')](_0x1a3f3f[_0xb9c4('0x20')],function(_0x24f2b8){return{'model':db[_0x24f2b8[_0xb9c4('0x22')]],'as':_0x24f2b8['as'],'attributes':_0x24f2b8[_0xb9c4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb9c4('0x10')](function(_0x102966){logger[_0xb9c4('0x11')]('GetWhatsappQueue',_0x274266);logger[_0xb9c4('0x14')](_0xb9c4('0x24'),_0x274266,JSON[_0xb9c4('0x25')](_0x102966));_0x397b63(_0x102966);})[_0xb9c4('0x1a')](function(_0x393068){logger[_0xb9c4('0x16')](_0xb9c4('0x24'),_0x393068[_0xb9c4('0x18')],_0x274266);_0x58bae1(_0x5c443f[_0xb9c4('0x16')](0x1f4,_0x393068[_0xb9c4('0x18')]));});});};exports[_0xb9c4('0x26')]=function(_0x5dda38){var _0x32d477=this;return new Promise(function(_0x229723,_0x5e218b){return db[_0xb9c4('0x1b')][_0xb9c4('0x27')]({'raw':_0x5dda38['options']?_0x5dda38['options'][_0xb9c4('0x28')]===undefined?!![]:![]:!![],'where':_0x5dda38['options']?_0x5dda38[_0xb9c4('0x1d')]['where']||null:null,'attributes':_0x5dda38[_0xb9c4('0x1d')]?_0x5dda38[_0xb9c4('0x1d')][_0xb9c4('0x23')]||null:null,'include':_0x5dda38[_0xb9c4('0x1d')]?_0x5dda38[_0xb9c4('0x1d')][_0xb9c4('0x20')]?_['map'](_0x5dda38[_0xb9c4('0x1d')]['include'],function(_0x1064ef){return{'model':db[_0x1064ef['model']],'as':_0x1064ef['as'],'attributes':_0x1064ef[_0xb9c4('0x23')],'include':_0x1064ef['include']?_[_0xb9c4('0x21')](_0x1064ef[_0xb9c4('0x20')],function(_0x5db70a){return{'model':db[_0x5db70a[_0xb9c4('0x22')]],'as':_0x5db70a['as'],'attributes':_0x5db70a['attributes'],'include':_0x5db70a['include']?_[_0xb9c4('0x21')](_0x5db70a['include'],function(_0x34ab28){return{'model':db[_0x34ab28['model']],'as':_0x34ab28['as'],'attributes':_0x34ab28[_0xb9c4('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a9b20){logger[_0xb9c4('0x11')]('ShowWhatsappQueue',_0x5dda38);logger[_0xb9c4('0x14')](_0xb9c4('0x26'),_0x5dda38,JSON[_0xb9c4('0x25')](_0x3a9b20));_0x229723(_0x3a9b20);})[_0xb9c4('0x1a')](function(_0x430efa){logger[_0xb9c4('0x16')](_0xb9c4('0x26'),_0x430efa[_0xb9c4('0x18')],_0x5dda38);_0x5e218b(_0x32d477['error'](0x1f4,_0x430efa['message']));});});};
\ No newline at end of file
index 11847b3..4578c82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc328=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x206a09,_0x498105){var _0x2cf821=function(_0x1ccee6){while(--_0x1ccee6){_0x206a09['push'](_0x206a09['shift']());}};_0x2cf821(++_0x498105);}(_0xc328,0xb7));var _0x8c32=function(_0x35ec63,_0x15595d){_0x35ec63=_0x35ec63-0x0;var _0x39e39c=_0xc328[_0x35ec63];return _0x39e39c;};'use strict';var WhatsappQueueEvents=require(_0x8c32('0x0'));var events=[_0x8c32('0x1'),_0x8c32('0x2'),_0x8c32('0x3')];function createListener(_0x1f80e4,_0xe3dca9){return function(_0x13677a){_0xe3dca9[_0x8c32('0x4')](_0x1f80e4,_0x13677a);};}function removeListener(_0x4978bd,_0x3b69be){return function(){WhatsappQueueEvents[_0x8c32('0x5')](_0x4978bd,_0x3b69be);};}exports[_0x8c32('0x6')]=function(_0x4ceea4){for(var _0x14b39a=0x0,_0x35b517=events[_0x8c32('0x7')];_0x14b39a<_0x35b517;_0x14b39a++){var _0x3f9fab=events[_0x14b39a];var _0x5a8587=createListener(_0x8c32('0x8')+_0x3f9fab,_0x4ceea4);WhatsappQueueEvents['on'](_0x3f9fab,_0x5a8587);}};
\ No newline at end of file
+var _0x1f05=['./whatsappQueue.events','update','removeListener','register','length','whatsappQueue:'];(function(_0x573a0e,_0x5caf8b){var _0x36c2f5=function(_0x39ae6a){while(--_0x39ae6a){_0x573a0e['push'](_0x573a0e['shift']());}};_0x36c2f5(++_0x5caf8b);}(_0x1f05,0x66));var _0x51f0=function(_0x56acc7,_0x55e5ab){_0x56acc7=_0x56acc7-0x0;var _0xc115ff=_0x1f05[_0x56acc7];return _0xc115ff;};'use strict';var WhatsappQueueEvents=require(_0x51f0('0x0'));var events=['save','remove',_0x51f0('0x1')];function createListener(_0x5d9681,_0x4889f0){return function(_0xc50d68){_0x4889f0['emit'](_0x5d9681,_0xc50d68);};}function removeListener(_0x1f8f1c,_0x4f397e){return function(){WhatsappQueueEvents[_0x51f0('0x2')](_0x1f8f1c,_0x4f397e);};}exports[_0x51f0('0x3')]=function(_0x30c160){for(var _0x3932fe=0x0,_0x70b9da=events[_0x51f0('0x4')];_0x3932fe<_0x70b9da;_0x3932fe++){var _0x3e11db=events[_0x3932fe];var _0x12b807=createListener(_0x51f0('0x5')+_0x3e11db,_0x30c160);WhatsappQueueEvents['on'](_0x3e11db,_0x12b807);}};
\ No newline at end of file
index 49f0521..217e976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff9=['path','express','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','get','describe','/:id','isAuthenticated','show','post','put','destroy','exports','multer','util'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x8ff9,0xa8));var _0x98ff=function(_0x4238cc,_0x40c728){_0x4238cc=_0x4238cc-0x0;var _0x2fa255=_0x8ff9[_0x4238cc];return _0x2fa255;};'use strict';var multer=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var path=require(_0x98ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ff('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x98ff('0x4'));var config=require(_0x98ff('0x5'));var controller=require(_0x98ff('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x98ff('0x7')]);router[_0x98ff('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x98ff('0x9')]);router['get'](_0x98ff('0xa'),auth[_0x98ff('0xb')](),controller[_0x98ff('0xc')]);router[_0x98ff('0xd')]('/',auth[_0x98ff('0xb')](),controller['create']);router[_0x98ff('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x98ff('0xa'),auth[_0x98ff('0xb')](),controller[_0x98ff('0xf')]);module[_0x98ff('0x10')]=router;
\ No newline at end of file
+var _0xde14=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','multer','connect-timeout','express'];(function(_0x18bf87,_0xfb8c49){var _0x4ac7c6=function(_0xdb5700){while(--_0xdb5700){_0x18bf87['push'](_0x18bf87['shift']());}};_0x4ac7c6(++_0xfb8c49);}(_0xde14,0x11e));var _0x4de1=function(_0x5a9f9d,_0x3ea577){_0x5a9f9d=_0x5a9f9d-0x0;var _0x2ef34f=_0xde14[_0x5a9f9d];return _0x2ef34f;};'use strict';var multer=require(_0x4de1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4de1('0x1'));var express=require(_0x4de1('0x2'));var router=express['Router']();var fs_extra=require(_0x4de1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4de1('0x4'));var config=require(_0x4de1('0x5'));var controller=require(_0x4de1('0x6'));router[_0x4de1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4de1('0x8'),auth[_0x4de1('0x9')](),controller[_0x4de1('0xa')]);router[_0x4de1('0x7')]('/:id',auth[_0x4de1('0x9')](),controller[_0x4de1('0xb')]);router[_0x4de1('0xc')]('/',auth[_0x4de1('0x9')](),controller[_0x4de1('0xd')]);router[_0x4de1('0xe')](_0x4de1('0xf'),auth[_0x4de1('0x9')](),controller[_0x4de1('0x10')]);router['delete'](_0x4de1('0xf'),auth[_0x4de1('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9c1ba5a..9b29b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x522a9a,_0x245eda){var _0x4230d3=function(_0x2c56d0){while(--_0x2c56d0){_0x522a9a['push'](_0x522a9a['shift']());}};_0x4230d3(++_0x245eda);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1909c3,_0x2ec3fe){var _0x6f2224=function(_0x153808){while(--_0x153808){_0x1909c3['push'](_0x1909c3['shift']());}};_0x6f2224(++_0x2ec3fe);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index 584d70e..1cb3397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['length','include','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','WhatsappQueueReport','includeAll','findAll','catch','params'];(function(_0x51f5c8,_0x2aa90d){var _0x30789e=function(_0x3c5640){while(--_0x3c5640){_0x51f5c8['push'](_0x51f5c8['shift']());}};_0x30789e(++_0x2aa90d);}(_0xfff0,0x139));var _0x0fff=function(_0x223584,_0x571d2c){_0x223584=_0x223584-0x0;var _0x577b25=_0xfff0[_0x223584];return _0x577b25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];function respondWithStatusCode(_0x13f768,_0x5abecd){_0x5abecd=_0x5abecd||0xcc;return function(_0x1fb243){if(_0x1fb243){return _0x13f768['sendStatus'](_0x5abecd);}return _0x13f768[_0x0fff('0x19')](_0x5abecd)[_0x0fff('0x1a')]();};}function respondWithResult(_0x38fc82,_0x2c0322){_0x2c0322=_0x2c0322||0xc8;return function(_0x55e5fa){if(_0x55e5fa){return _0x38fc82['status'](_0x2c0322)[_0x0fff('0x1b')](_0x55e5fa);}};}function respondWithFilteredResult(_0x50a9e4,_0x5636fd){return function(_0x51ceea){if(_0x51ceea){var _0x1fb430=typeof _0x5636fd[_0x0fff('0x1c')]==='undefined'&&typeof _0x5636fd[_0x0fff('0x1d')]===_0x0fff('0x1e');var _0x540a67=_0x51ceea['count'];var _0x48f36d=_0x1fb430?0x0:_0x5636fd[_0x0fff('0x1c')];var _0x606792=_0x1fb430?_0x51ceea[_0x0fff('0x1f')]:_0x5636fd[_0x0fff('0x1c')]+_0x5636fd[_0x0fff('0x1d')];var _0xe89b4a;if(_0x606792>=_0x540a67){_0x606792=_0x540a67;_0xe89b4a=0xc8;}else{_0xe89b4a=0xce;}_0x50a9e4['status'](_0xe89b4a);return _0x50a9e4[_0x0fff('0x20')](_0x0fff('0x21'),_0x48f36d+'-'+_0x606792+'/'+_0x540a67)[_0x0fff('0x1b')](_0x51ceea);}return null;};}function patchUpdates(_0x49d211){return function(_0x5e27df){try{jsonpatch[_0x0fff('0x22')](_0x5e27df,_0x49d211,!![]);}catch(_0x330e29){return BPromise[_0x0fff('0x23')](_0x330e29);}return _0x5e27df[_0x0fff('0x24')]();};}function saveUpdates(_0x502393,_0x155132){return function(_0x2f8665){if(_0x2f8665){return _0x2f8665[_0x0fff('0x25')](_0x502393)[_0x0fff('0x26')](function(_0x16e7f4){return _0x16e7f4;});}return null;};}function removeEntity(_0x17fba6,_0x580b8e){return function(_0x6a116c){if(_0x6a116c){return _0x6a116c[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){_0x17fba6[_0x0fff('0x19')](0xcc)[_0x0fff('0x1a')]();});}};}function handleEntityNotFound(_0x23d9f8,_0x482e1e){return function(_0x2c9725){if(!_0x2c9725){_0x23d9f8[_0x0fff('0x28')](0x194);}return _0x2c9725;};}function handleError(_0x2d1610,_0x440f56){_0x440f56=_0x440f56||0x1f4;return function(_0x36d268){logger[_0x0fff('0x29')](_0x36d268[_0x0fff('0x2a')]);if(_0x36d268[_0x0fff('0x2b')]){delete _0x36d268[_0x0fff('0x2b')];}_0x2d1610[_0x0fff('0x19')](_0x440f56)[_0x0fff('0x2c')](_0x36d268);};}exports[_0x0fff('0x2d')]=function(_0x495734,_0x7046a3){var _0x2d1800={},_0x17ab6f={},_0x42441e={'count':0x0,'rows':[]};var _0x1f643d=_[_0x0fff('0x2e')](db['WhatsappQueueReport'][_0x0fff('0x2f')],function(_0xa16c29){return{'name':_0xa16c29[_0x0fff('0x30')],'type':_0xa16c29['type'][_0x0fff('0x31')]};});_0x17ab6f[_0x0fff('0x32')]=_['map'](_0x1f643d,_0x0fff('0x2b'));_0x17ab6f[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0x495734[_0x0fff('0x33')]);_0x17ab6f[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x17ab6f[_0x0fff('0x32')],_0x17ab6f[_0x0fff('0x33')]);_0x2d1800[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x17ab6f['model'],qs[_0x0fff('0x38')](_0x495734[_0x0fff('0x33')][_0x0fff('0x38')]));_0x2d1800[_0x0fff('0x37')]=_0x2d1800[_0x0fff('0x37')]['length']?_0x2d1800['attributes']:_0x17ab6f[_0x0fff('0x32')];if(!_0x495734[_0x0fff('0x33')][_0x0fff('0x39')](_0x0fff('0x3a'))){_0x2d1800['limit']=qs[_0x0fff('0x1d')](_0x495734[_0x0fff('0x33')][_0x0fff('0x1d')]);_0x2d1800[_0x0fff('0x1c')]=qs['offset'](_0x495734[_0x0fff('0x33')][_0x0fff('0x1c')]);}_0x2d1800[_0x0fff('0x3b')]=qs[_0x0fff('0x3c')](_0x495734[_0x0fff('0x33')][_0x0fff('0x3c')]);_0x2d1800[_0x0fff('0x3d')]=qs[_0x0fff('0x35')](_[_0x0fff('0x3e')](_0x495734[_0x0fff('0x33')],_0x17ab6f[_0x0fff('0x35')]),_0x1f643d);if(_0x495734[_0x0fff('0x33')]['filter']){_0x2d1800[_0x0fff('0x3d')]=_[_0x0fff('0x3f')](_0x2d1800[_0x0fff('0x3d')],{'$or':_[_0x0fff('0x2e')](_0x1f643d,function(_0xd65638){if(_0xd65638[_0x0fff('0x40')]!=='VIRTUAL'){var _0x10ff9d={};_0x10ff9d[_0xd65638[_0x0fff('0x2b')]]={'$like':'%'+_0x495734[_0x0fff('0x33')][_0x0fff('0x41')]+'%'};return _0x10ff9d;}})});}_0x2d1800=_[_0x0fff('0x3f')]({},_0x2d1800,_0x495734[_0x0fff('0x42')]);var _0x3dc0b8={'where':_0x2d1800[_0x0fff('0x3d')]};return db[_0x0fff('0x43')]['count'](_0x3dc0b8)[_0x0fff('0x26')](function(_0x4d89c0){_0x42441e[_0x0fff('0x1f')]=_0x4d89c0;if(_0x495734[_0x0fff('0x33')][_0x0fff('0x44')]){_0x2d1800['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x0fff('0x45')](_0x2d1800);})[_0x0fff('0x26')](function(_0x311348){_0x42441e['rows']=_0x311348;return _0x42441e;})['then'](respondWithFilteredResult(_0x7046a3,_0x2d1800))[_0x0fff('0x46')](handleError(_0x7046a3,null));};exports['show']=function(_0xd6ebeb,_0x957265){var _0x8352c1={'raw':!![],'where':{'id':_0xd6ebeb[_0x0fff('0x47')]['id']}},_0x309d75={};_0x309d75[_0x0fff('0x32')]=_['keys'](db[_0x0fff('0x43')][_0x0fff('0x2f')]);_0x309d75[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0xd6ebeb[_0x0fff('0x33')]);_0x309d75[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x309d75['model'],_0x309d75[_0x0fff('0x33')]);_0x8352c1[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x309d75['model'],qs[_0x0fff('0x38')](_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x38')]));_0x8352c1[_0x0fff('0x37')]=_0x8352c1[_0x0fff('0x37')][_0x0fff('0x48')]?_0x8352c1[_0x0fff('0x37')]:_0x309d75[_0x0fff('0x32')];if(_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x44')]){_0x8352c1[_0x0fff('0x49')]=[{'all':!![]}];}_0x8352c1=_['merge']({},_0x8352c1,_0xd6ebeb[_0x0fff('0x42')]);return db[_0x0fff('0x43')]['find'](_0x8352c1)[_0x0fff('0x26')](handleEntityNotFound(_0x957265,null))[_0x0fff('0x26')](respondWithResult(_0x957265,null))[_0x0fff('0x46')](handleError(_0x957265,null));};exports['create']=function(_0x502037,_0x2a0b10){return db['WhatsappQueueReport']['create'](_0x502037[_0x0fff('0x4a')],{})[_0x0fff('0x26')](respondWithResult(_0x2a0b10,0xc9))[_0x0fff('0x46')](handleError(_0x2a0b10,null));};exports[_0x0fff('0x25')]=function(_0x3b4b8e,_0x1a7677){if(_0x3b4b8e['body']['id']){delete _0x3b4b8e[_0x0fff('0x4a')]['id'];}return db[_0x0fff('0x43')][_0x0fff('0x4b')]({'where':{'id':_0x3b4b8e[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x1a7677,null))[_0x0fff('0x26')](saveUpdates(_0x3b4b8e['body'],null))[_0x0fff('0x26')](respondWithResult(_0x1a7677,null))[_0x0fff('0x46')](handleError(_0x1a7677,null));};exports['destroy']=function(_0x1fc872,_0x4bae35){return db['WhatsappQueueReport']['find']({'where':{'id':_0x1fc872[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x4bae35,null))[_0x0fff('0x26')](removeEntity(_0x4bae35,null))[_0x0fff('0x46')](handleError(_0x4bae35,null));};exports[_0x0fff('0x4c')]=function(_0x4bf98d,_0x2524ad){return db[_0x0fff('0x43')][_0x0fff('0x4c')]()[_0x0fff('0x26')](respondWithResult(_0x2524ad,null))[_0x0fff('0x46')](handleError(_0x2524ad,null));};
\ No newline at end of file
+var _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));};
\ No newline at end of file
index 5b1e7cd..c813a26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd473=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x17d349,_0xb5c25f){var _0x4f1cda=function(_0x288972){while(--_0x288972){_0x17d349['push'](_0x17d349['shift']());}};_0x4f1cda(++_0xb5c25f);}(_0xd473,0xef));var _0x3d47=function(_0x16a4a9,_0x13d79d){_0x16a4a9=_0x16a4a9-0x0;var _0x5f18eb=_0xd473[_0x16a4a9];return _0x5f18eb;};'use strict';var _=require(_0x3d47('0x0'));var util=require(_0x3d47('0x1'));var logger=require(_0x3d47('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3d47('0x3'));var rp=require(_0x3d47('0x4'));var fs=require('fs');var path=require(_0x3d47('0x5'));var rimraf=require('rimraf');var config=require(_0x3d47('0x6'));var attributes=require(_0x3d47('0x7'));module[_0x3d47('0x8')]=function(_0x5dab58,_0x240e3d){return _0x5dab58['define'](_0x3d47('0x9'),attributes,{'tableName':_0x3d47('0xa'),'paranoid':![],'indexes':[{'name':_0x3d47('0xb'),'fields':[_0x3d47('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa415=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xa415,0xc1));var _0x5a41=function(_0xcb3757,_0x218eda){_0xcb3757=_0xcb3757-0x0;var _0x24580c=_0xa415[_0xcb3757];return _0x24580c;};'use strict';var _=require(_0x5a41('0x0'));var util=require('util');var logger=require(_0x5a41('0x1'))(_0x5a41('0x2'));var moment=require(_0x5a41('0x3'));var BPromise=require(_0x5a41('0x4'));var rp=require(_0x5a41('0x5'));var fs=require('fs');var path=require(_0x5a41('0x6'));var rimraf=require(_0x5a41('0x7'));var config=require(_0x5a41('0x8'));var attributes=require(_0x5a41('0x9'));module['exports']=function(_0x3d951e,_0x23c716){return _0x3d951e['define'](_0x5a41('0xa'),attributes,{'tableName':_0x5a41('0xb'),'paranoid':![],'indexes':[{'name':_0x5a41('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 4f6061e..38ca1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e0a=['jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','debug','update','attributes','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x557604,_0x5f510f){var _0x4a203f=function(_0x411d61){while(--_0x411d61){_0x557604['push'](_0x557604['shift']());}};_0x4a203f(++_0x5f510f);}(_0x8e0a,0x1d7));var _0xa8e0=function(_0x2e0b95,_0x4ad56a){_0x2e0b95=_0x2e0b95-0x0;var _0x7bfca6=_0x8e0a[_0x2e0b95];return _0x7bfca6;};'use strict';var _=require(_0xa8e0('0x0'));var util=require('util');var moment=require(_0xa8e0('0x1'));var BPromise=require(_0xa8e0('0x2'));var rs=require(_0xa8e0('0x3'));var fs=require('fs');var Redis=require(_0xa8e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8e0('0x5'));var logger=require(_0xa8e0('0x6'))(_0xa8e0('0x7'));var config=require(_0xa8e0('0x8'));var jayson=require(_0xa8e0('0x9'));var client=jayson[_0xa8e0('0xa')][_0xa8e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3479de,_0x20a901,_0x4394fa){return new BPromise(function(_0x1ff8f1,_0x13ff27){return client['request'](_0x3479de,_0x4394fa)[_0xa8e0('0xc')](function(_0x51b5ce){logger[_0xa8e0('0xd')](_0xa8e0('0xe'),_0x20a901,_0xa8e0('0xf'));logger['debug'](_0xa8e0('0x10'),_0x20a901,_0xa8e0('0xf'),JSON[_0xa8e0('0x11')](_0x51b5ce));if(_0x51b5ce[_0xa8e0('0x12')]){if(_0x51b5ce[_0xa8e0('0x12')][_0xa8e0('0x13')]===0x1f4){logger[_0xa8e0('0x12')](_0xa8e0('0xe'),_0x20a901,_0x51b5ce['error'][_0xa8e0('0x14')]);return _0x13ff27(_0x51b5ce['error']['message']);}logger[_0xa8e0('0x12')](_0xa8e0('0xe'),_0x20a901,_0x51b5ce['error']['message']);return _0x1ff8f1(_0x51b5ce[_0xa8e0('0x12')]['message']);}else{logger[_0xa8e0('0xd')](_0xa8e0('0xe'),_0x20a901,_0xa8e0('0xf'));_0x1ff8f1(_0x51b5ce[_0xa8e0('0x15')][_0xa8e0('0x14')]);}})[_0xa8e0('0x16')](function(_0x27aa6){logger['error'](_0xa8e0('0xe'),_0x20a901,_0x27aa6);_0x13ff27(_0x27aa6);});});}exports[_0xa8e0('0x17')]=function(_0x46651c){var _0x213fce=this;return new Promise(function(_0x20bf41,_0xafcdff){return db[_0xa8e0('0x18')]['create'](_0x46651c[_0xa8e0('0x19')],{'raw':_0x46651c[_0xa8e0('0x1a')]?_0x46651c[_0xa8e0('0x1a')][_0xa8e0('0x1b')]===undefined?!![]:![]:!![]})[_0xa8e0('0xc')](function(_0x281565){logger[_0xa8e0('0xd')]('CreateWhatsappQueueReport',_0x46651c);logger[_0xa8e0('0x1c')](_0xa8e0('0x17'),_0x46651c,JSON[_0xa8e0('0x11')](_0x281565));_0x20bf41(_0x281565);})[_0xa8e0('0x16')](function(_0x510c55){logger[_0xa8e0('0x12')](_0xa8e0('0x17'),_0x510c55[_0xa8e0('0x14')],_0x46651c);_0xafcdff(_0x213fce['error'](0x1f4,_0x510c55[_0xa8e0('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x55b2df){var _0x111639=this;return new Promise(function(_0x3b247f,_0x5a0e74){return db[_0xa8e0('0x18')][_0xa8e0('0x1d')](_0x55b2df[_0xa8e0('0x19')],{'raw':_0x55b2df[_0xa8e0('0x1a')]?_0x55b2df[_0xa8e0('0x1a')][_0xa8e0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55b2df['options']?_0x55b2df['options']['where']||null:null,'attributes':_0x55b2df[_0xa8e0('0x1a')]?_0x55b2df[_0xa8e0('0x1a')][_0xa8e0('0x1e')]||null:null,'limit':_0x55b2df[_0xa8e0('0x1a')]?_0x55b2df['options']['limit']||null:null})[_0xa8e0('0xc')](function(_0x380df6){logger[_0xa8e0('0xd')](_0xa8e0('0x1f'),_0x55b2df);logger[_0xa8e0('0x1c')](_0xa8e0('0x1f'),_0x55b2df,JSON[_0xa8e0('0x11')](_0x380df6));_0x3b247f(_0x380df6);})[_0xa8e0('0x16')](function(_0x7d3b50){logger['error'](_0xa8e0('0x1f'),_0x7d3b50[_0xa8e0('0x14')],_0x55b2df);_0x5a0e74(_0x111639[_0xa8e0('0x12')](0x1f4,_0x7d3b50[_0xa8e0('0x14')]));});});};
\ No newline at end of file
+var _0xfc39=['client','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappQueueReport','body','options','raw','then','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0xfb48e9,_0x3a7f94){var _0x464d11=function(_0x1e7103){while(--_0x1e7103){_0xfb48e9['push'](_0xfb48e9['shift']());}};_0x464d11(++_0x3a7f94);}(_0xfc39,0x177));var _0x9fc3=function(_0x595d42,_0x27d9ce){_0x595d42=_0x595d42-0x0;var _0x2412f1=_0xfc39[_0x595d42];return _0x2412f1;};'use strict';var _=require(_0x9fc3('0x0'));var util=require(_0x9fc3('0x1'));var moment=require(_0x9fc3('0x2'));var BPromise=require(_0x9fc3('0x3'));var rs=require(_0x9fc3('0x4'));var fs=require('fs');var Redis=require(_0x9fc3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9fc3('0x6'));var logger=require('../../config/logger')(_0x9fc3('0x7'));var config=require(_0x9fc3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9fc3('0x9')][_0x9fc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a38a6,_0x4970d4,_0x8f621e){return new BPromise(function(_0x408c02,_0x2e81c3){return client['request'](_0x2a38a6,_0x8f621e)['then'](function(_0x246352){logger[_0x9fc3('0xb')](_0x9fc3('0xc'),_0x4970d4,_0x9fc3('0xd'));logger[_0x9fc3('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4970d4,_0x9fc3('0xd'),JSON[_0x9fc3('0xf')](_0x246352));if(_0x246352[_0x9fc3('0x10')]){if(_0x246352[_0x9fc3('0x10')][_0x9fc3('0x11')]===0x1f4){logger['error'](_0x9fc3('0xc'),_0x4970d4,_0x246352['error']['message']);return _0x2e81c3(_0x246352[_0x9fc3('0x10')]['message']);}logger['error'](_0x9fc3('0xc'),_0x4970d4,_0x246352[_0x9fc3('0x10')][_0x9fc3('0x12')]);return _0x408c02(_0x246352[_0x9fc3('0x10')]['message']);}else{logger[_0x9fc3('0xb')](_0x9fc3('0xc'),_0x4970d4,'request\x20sent');_0x408c02(_0x246352[_0x9fc3('0x13')]['message']);}})['catch'](function(_0x39b965){logger[_0x9fc3('0x10')](_0x9fc3('0xc'),_0x4970d4,_0x39b965);_0x2e81c3(_0x39b965);});});}exports[_0x9fc3('0x14')]=function(_0x315a74){var _0x1257b3=this;return new Promise(function(_0x258c00,_0x18c58e){return db['WhatsappQueueReport']['create'](_0x315a74[_0x9fc3('0x15')],{'raw':_0x315a74[_0x9fc3('0x16')]?_0x315a74[_0x9fc3('0x16')][_0x9fc3('0x17')]===undefined?!![]:![]:!![]})[_0x9fc3('0x18')](function(_0x4de998){logger[_0x9fc3('0xb')](_0x9fc3('0x14'),_0x315a74);logger[_0x9fc3('0xe')](_0x9fc3('0x14'),_0x315a74,JSON[_0x9fc3('0xf')](_0x4de998));_0x258c00(_0x4de998);})['catch'](function(_0x443f18){logger[_0x9fc3('0x10')](_0x9fc3('0x14'),_0x443f18[_0x9fc3('0x12')],_0x315a74);_0x18c58e(_0x1257b3[_0x9fc3('0x10')](0x1f4,_0x443f18['message']));});});};exports[_0x9fc3('0x19')]=function(_0x2f9157){var _0x57a2f9=this;return new Promise(function(_0x1a9562,_0x4c18b9){return db[_0x9fc3('0x1a')][_0x9fc3('0x1b')](_0x2f9157[_0x9fc3('0x15')],{'raw':_0x2f9157[_0x9fc3('0x16')]?_0x2f9157[_0x9fc3('0x16')][_0x9fc3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f9157[_0x9fc3('0x16')]?_0x2f9157[_0x9fc3('0x16')][_0x9fc3('0x1c')]||null:null,'attributes':_0x2f9157[_0x9fc3('0x16')]?_0x2f9157[_0x9fc3('0x16')][_0x9fc3('0x1d')]||null:null,'limit':_0x2f9157[_0x9fc3('0x16')]?_0x2f9157[_0x9fc3('0x16')][_0x9fc3('0x1e')]||null:null})[_0x9fc3('0x18')](function(_0x28b62f){logger['info']('UpdateWhatsappQueueReport',_0x2f9157);logger[_0x9fc3('0xe')](_0x9fc3('0x19'),_0x2f9157,JSON[_0x9fc3('0xf')](_0x28b62f));_0x1a9562(_0x28b62f);})[_0x9fc3('0x1f')](function(_0xea501b){logger[_0x9fc3('0x10')](_0x9fc3('0x19'),_0xea501b['message'],_0x2f9157);_0x4c18b9(_0x57a2f9[_0x9fc3('0x10')](0x1f4,_0xea501b['message']));});});};
\ No newline at end of file
index 02aaf11..61a5bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f46=['put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0x0f46,0xd4));var _0x60f4=function(_0x2ffab4,_0x26bea2){_0x2ffab4=_0x2ffab4-0x0;var _0x46cef3=_0x0f46[_0x2ffab4];return _0x46cef3;};'use strict';var multer=require(_0x60f4('0x0'));var util=require('util');var path=require(_0x60f4('0x1'));var timeout=require(_0x60f4('0x2'));var express=require(_0x60f4('0x3'));var router=express[_0x60f4('0x4')]();var fs_extra=require(_0x60f4('0x5'));var auth=require(_0x60f4('0x6'));var interaction=require(_0x60f4('0x7'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x60f4('0x8')]('/',auth[_0x60f4('0x9')](),controller['index']);router[_0x60f4('0x8')](_0x60f4('0xa'),auth[_0x60f4('0x9')](),controller[_0x60f4('0xb')]);router['get'](_0x60f4('0xc'),auth[_0x60f4('0x9')](),controller[_0x60f4('0xd')]);router[_0x60f4('0xe')]('/',auth[_0x60f4('0x9')](),controller[_0x60f4('0xf')]);router[_0x60f4('0x10')]('/:id',auth[_0x60f4('0x9')](),controller['update']);router[_0x60f4('0x11')]('/:id',auth[_0x60f4('0x9')](),controller[_0x60f4('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x18ae=['/describe','describe','isAuthenticated','show','post','create','put','/:id','delete','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index'];(function(_0x2b2373,_0x4f611d){var _0xfc626f=function(_0x3a7215){while(--_0x3a7215){_0x2b2373['push'](_0x2b2373['shift']());}};_0xfc626f(++_0x4f611d);}(_0x18ae,0x172));var _0xe18a=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x18ae[_0x2298f0];return _0x39b136;};'use strict';var multer=require(_0xe18a('0x0'));var util=require('util');var path=require(_0xe18a('0x1'));var timeout=require(_0xe18a('0x2'));var express=require('express');var router=express[_0xe18a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe18a('0x4'));var interaction=require(_0xe18a('0x5'));var config=require(_0xe18a('0x6'));var controller=require(_0xe18a('0x7'));router[_0xe18a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe18a('0x9')]);router[_0xe18a('0x8')](_0xe18a('0xa'),auth['isAuthenticated'](),controller[_0xe18a('0xb')]);router['get']('/:id',auth[_0xe18a('0xc')](),controller[_0xe18a('0xd')]);router[_0xe18a('0xe')]('/',auth[_0xe18a('0xc')](),controller[_0xe18a('0xf')]);router[_0xe18a('0x10')](_0xe18a('0x11'),auth[_0xe18a('0xc')](),controller['update']);router[_0xe18a('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a235544..4f5fd1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e16=['DATE','sequelize','account','agent','queue'];(function(_0x4d1a45,_0x151bc1){var _0x4d9c31=function(_0x48eafd){while(--_0x48eafd){_0x4d1a45['push'](_0x4d1a45['shift']());}};_0x4d9c31(++_0x151bc1);}(_0x2e16,0x8d));var _0x62e1=function(_0x4f82af,_0x205c0f){_0x4f82af=_0x4f82af-0x0;var _0x4df73e=_0x2e16[_0x4f82af];return _0x4df73e;};'use strict';var Sequelize=require(_0x62e1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x62e1('0x1'),_0x62e1('0x2'),_0x62e1('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x62e1('0x4')]}};
\ No newline at end of file
+var _0x19cb=['account','queue','exports','STRING'];(function(_0x6e30b0,_0x13c270){var _0x495488=function(_0x3786c9){while(--_0x3786c9){_0x6e30b0['push'](_0x6e30b0['shift']());}};_0x495488(++_0x13c270);}(_0x19cb,0x146));var _0xb19c=function(_0x449132,_0x1432fc){_0x449132=_0x449132-0x0;var _0x1b92b7=_0x19cb[_0x449132];return _0x1b92b7;};'use strict';var Sequelize=require('sequelize');module[_0xb19c('0x0')]={'uniqueid':{'type':Sequelize[_0xb19c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb19c('0x2'),'agent',_0xb19c('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index c971c9a..dbfb466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe21d=['name','send','index','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','count','includeAll','include','findAll','show','WhatsappTransferReport','length','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','offset','limit','set','Content-Range','json','apply','reject','destroy','then','sendStatus','stack'];(function(_0x17440a,_0x459b33){var _0x4d3e40=function(_0x4f1056){while(--_0x4f1056){_0x17440a['push'](_0x17440a['shift']());}};_0x4d3e40(++_0x459b33);}(_0xe21d,0x149));var _0xde21=function(_0x5d29d9,_0x59fc78){_0x5d29d9=_0x5d29d9-0x0;var _0x39ac61=_0xe21d[_0x5d29d9];return _0x39ac61;};'use strict';var emlformat=require(_0xde21('0x0'));var rimraf=require(_0xde21('0x1'));var zipdir=require(_0xde21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde21('0x3'));var moment=require(_0xde21('0x4'));var BPromise=require(_0xde21('0x5'));var Mustache=require(_0xde21('0x6'));var util=require(_0xde21('0x7'));var path=require(_0xde21('0x8'));var sox=require('sox');var csv=require(_0xde21('0x9'));var ejs=require(_0xde21('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde21('0xb'));var squel=require(_0xde21('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xde21('0xd'));var toCsv=require(_0xde21('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde21('0xe'));var authService=require(_0xde21('0xf'));var qs=require(_0xde21('0x10'));var as=require(_0xde21('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde21('0x12'));var utils=require(_0xde21('0x13'));var config=require(_0xde21('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xde21('0x15'))['db'];function respondWithStatusCode(_0x22c623,_0x4cfa8c){_0x4cfa8c=_0x4cfa8c||0xcc;return function(_0x3c441d){if(_0x3c441d){return _0x22c623['sendStatus'](_0x4cfa8c);}return _0x22c623['status'](_0x4cfa8c)[_0xde21('0x16')]();};}function respondWithResult(_0x463a7a,_0xe5cf4b){_0xe5cf4b=_0xe5cf4b||0xc8;return function(_0x2b1d8c){if(_0x2b1d8c){return _0x463a7a[_0xde21('0x17')](_0xe5cf4b)['json'](_0x2b1d8c);}};}function respondWithFilteredResult(_0x1d5cde,_0x33f423){return function(_0x4ff2e5){if(_0x4ff2e5){var _0x1660ce=typeof _0x33f423['offset']===_0xde21('0x18')&&typeof _0x33f423['limit']===_0xde21('0x18');var _0x3390c0=_0x4ff2e5['count'];var _0x1c4ad2=_0x1660ce?0x0:_0x33f423[_0xde21('0x19')];var _0x40e07f=_0x1660ce?_0x4ff2e5['count']:_0x33f423[_0xde21('0x19')]+_0x33f423[_0xde21('0x1a')];var _0x86eac8;if(_0x40e07f>=_0x3390c0){_0x40e07f=_0x3390c0;_0x86eac8=0xc8;}else{_0x86eac8=0xce;}_0x1d5cde['status'](_0x86eac8);return _0x1d5cde[_0xde21('0x1b')](_0xde21('0x1c'),_0x1c4ad2+'-'+_0x40e07f+'/'+_0x3390c0)[_0xde21('0x1d')](_0x4ff2e5);}return null;};}function patchUpdates(_0xdc0017){return function(_0x27533d){try{jsonpatch[_0xde21('0x1e')](_0x27533d,_0xdc0017,!![]);}catch(_0x190b3d){return BPromise[_0xde21('0x1f')](_0x190b3d);}return _0x27533d['save']();};}function saveUpdates(_0x3db211,_0x47a4a5){return function(_0x34d3b8){if(_0x34d3b8){return _0x34d3b8['update'](_0x3db211)['then'](function(_0x3f7112){return _0x3f7112;});}return null;};}function removeEntity(_0x2194fd,_0xc52611){return function(_0xf3a5e9){if(_0xf3a5e9){return _0xf3a5e9[_0xde21('0x20')]()[_0xde21('0x21')](function(){_0x2194fd[_0xde21('0x17')](0xcc)[_0xde21('0x16')]();});}};}function handleEntityNotFound(_0x1ea6c0,_0x240e54){return function(_0x56b7c4){if(!_0x56b7c4){_0x1ea6c0[_0xde21('0x22')](0x194);}return _0x56b7c4;};}function handleError(_0x47a7ef,_0x760405){_0x760405=_0x760405||0x1f4;return function(_0xa70126){logger['error'](_0xa70126[_0xde21('0x23')]);if(_0xa70126[_0xde21('0x24')]){delete _0xa70126[_0xde21('0x24')];}_0x47a7ef[_0xde21('0x17')](_0x760405)[_0xde21('0x25')](_0xa70126);};}exports[_0xde21('0x26')]=function(_0x574e20,_0x166c0b){var _0x266838={},_0x3a6553={},_0x322434={'count':0x0,'rows':[]};var _0xbdf481=_['map'](db['WhatsappTransferReport'][_0xde21('0x27')],function(_0x4bb296){return{'name':_0x4bb296['fieldName'],'type':_0x4bb296[_0xde21('0x28')][_0xde21('0x29')]};});_0x3a6553[_0xde21('0x2a')]=_['map'](_0xbdf481,_0xde21('0x24'));_0x3a6553['query']=_[_0xde21('0x2b')](_0x574e20['query']);_0x3a6553[_0xde21('0x2c')]=_[_0xde21('0x2d')](_0x3a6553['model'],_0x3a6553[_0xde21('0x2e')]);_0x266838['attributes']=_[_0xde21('0x2d')](_0x3a6553[_0xde21('0x2a')],qs[_0xde21('0x2f')](_0x574e20['query'][_0xde21('0x2f')]));_0x266838['attributes']=_0x266838[_0xde21('0x30')]['length']?_0x266838[_0xde21('0x30')]:_0x3a6553[_0xde21('0x2a')];if(!_0x574e20[_0xde21('0x2e')][_0xde21('0x31')](_0xde21('0x32'))){_0x266838[_0xde21('0x1a')]=qs[_0xde21('0x1a')](_0x574e20[_0xde21('0x2e')][_0xde21('0x1a')]);_0x266838[_0xde21('0x19')]=qs[_0xde21('0x19')](_0x574e20[_0xde21('0x2e')][_0xde21('0x19')]);}_0x266838[_0xde21('0x33')]=qs[_0xde21('0x34')](_0x574e20[_0xde21('0x2e')][_0xde21('0x34')]);_0x266838[_0xde21('0x35')]=qs[_0xde21('0x2c')](_[_0xde21('0x36')](_0x574e20['query'],_0x3a6553[_0xde21('0x2c')]),_0xbdf481);if(_0x574e20['query']['filter']){_0x266838[_0xde21('0x35')]=_[_0xde21('0x37')](_0x266838[_0xde21('0x35')],{'$or':_[_0xde21('0x38')](_0xbdf481,function(_0x5d28ea){if(_0x5d28ea[_0xde21('0x28')]!==_0xde21('0x39')){var _0x1b5a82={};_0x1b5a82[_0x5d28ea[_0xde21('0x24')]]={'$like':'%'+_0x574e20[_0xde21('0x2e')][_0xde21('0x3a')]+'%'};return _0x1b5a82;}})});}_0x266838=_[_0xde21('0x37')]({},_0x266838,_0x574e20['options']);var _0x5d0874={'where':_0x266838['where']};return db['WhatsappTransferReport'][_0xde21('0x3b')](_0x5d0874)[_0xde21('0x21')](function(_0x221c02){_0x322434['count']=_0x221c02;if(_0x574e20[_0xde21('0x2e')][_0xde21('0x3c')]){_0x266838[_0xde21('0x3d')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xde21('0x3e')](_0x266838);})[_0xde21('0x21')](function(_0x4b70ef){_0x322434['rows']=_0x4b70ef;return _0x322434;})['then'](respondWithFilteredResult(_0x166c0b,_0x266838))['catch'](handleError(_0x166c0b,null));};exports[_0xde21('0x3f')]=function(_0x323ead,_0x2783bc){var _0x407be6={'raw':!![],'where':{'id':_0x323ead['params']['id']}},_0x450ea0={};_0x450ea0[_0xde21('0x2a')]=_[_0xde21('0x2b')](db[_0xde21('0x40')][_0xde21('0x27')]);_0x450ea0[_0xde21('0x2e')]=_[_0xde21('0x2b')](_0x323ead[_0xde21('0x2e')]);_0x450ea0[_0xde21('0x2c')]=_['intersection'](_0x450ea0[_0xde21('0x2a')],_0x450ea0[_0xde21('0x2e')]);_0x407be6[_0xde21('0x30')]=_['intersection'](_0x450ea0[_0xde21('0x2a')],qs[_0xde21('0x2f')](_0x323ead['query'][_0xde21('0x2f')]));_0x407be6[_0xde21('0x30')]=_0x407be6[_0xde21('0x30')][_0xde21('0x41')]?_0x407be6[_0xde21('0x30')]:_0x450ea0[_0xde21('0x2a')];if(_0x323ead[_0xde21('0x2e')]['includeAll']){_0x407be6[_0xde21('0x3d')]=[{'all':!![]}];}_0x407be6=_['merge']({},_0x407be6,_0x323ead[_0xde21('0x42')]);return db['WhatsappTransferReport'][_0xde21('0x43')](_0x407be6)['then'](handleEntityNotFound(_0x2783bc,null))['then'](respondWithResult(_0x2783bc,null))[_0xde21('0x44')](handleError(_0x2783bc,null));};exports[_0xde21('0x45')]=function(_0x3012e9,_0x26628e){return db[_0xde21('0x40')][_0xde21('0x45')](_0x3012e9['body'],{})[_0xde21('0x21')](respondWithResult(_0x26628e,0xc9))[_0xde21('0x44')](handleError(_0x26628e,null));};exports['update']=function(_0x28e356,_0x46c2a9){if(_0x28e356[_0xde21('0x46')]['id']){delete _0x28e356[_0xde21('0x46')]['id'];}return db[_0xde21('0x40')][_0xde21('0x43')]({'where':{'id':_0x28e356[_0xde21('0x47')]['id']}})['then'](handleEntityNotFound(_0x46c2a9,null))[_0xde21('0x21')](saveUpdates(_0x28e356[_0xde21('0x46')],null))['then'](respondWithResult(_0x46c2a9,null))['catch'](handleError(_0x46c2a9,null));};exports['destroy']=function(_0x458e3d,_0x1e6ba9){return db['WhatsappTransferReport'][_0xde21('0x43')]({'where':{'id':_0x458e3d['params']['id']}})[_0xde21('0x21')](handleEntityNotFound(_0x1e6ba9,null))[_0xde21('0x21')](removeEntity(_0x1e6ba9,null))['catch'](handleError(_0x1e6ba9,null));};exports[_0xde21('0x48')]=function(_0x5375ac,_0xe3d898){return db[_0xde21('0x40')]['describe']()[_0xde21('0x21')](respondWithResult(_0xe3d898,null))[_0xde21('0x44')](handleError(_0xe3d898,null));};
\ No newline at end of file
+var _0x3c26=['apply','reject','save','update','destroy','then','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x3c26,0x122));var _0x63c2=function(_0x4a8727,_0x20905f){_0x4a8727=_0x4a8727-0x0;var _0x1b238b=_0x3c26[_0x4a8727];return _0x1b238b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63c2('0x0'));var zipdir=require(_0x63c2('0x1'));var jsonpatch=require(_0x63c2('0x2'));var rp=require('request-promise');var moment=require(_0x63c2('0x3'));var BPromise=require(_0x63c2('0x4'));var Mustache=require(_0x63c2('0x5'));var util=require(_0x63c2('0x6'));var path=require(_0x63c2('0x7'));var sox=require(_0x63c2('0x8'));var csv=require(_0x63c2('0x9'));var ejs=require(_0x63c2('0xa'));var fs=require('fs');var fs_extra=require(_0x63c2('0xb'));var _=require(_0x63c2('0xc'));var squel=require(_0x63c2('0xd'));var crypto=require(_0x63c2('0xe'));var jsforce=require(_0x63c2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x63c2('0x10'));var Papa=require(_0x63c2('0x11'));var Redis=require('ioredis');var authService=require(_0x63c2('0x12'));var qs=require(_0x63c2('0x13'));var as=require(_0x63c2('0x14'));var hardwareService=require(_0x63c2('0x15'));var logger=require(_0x63c2('0x16'))(_0x63c2('0x17'));var utils=require(_0x63c2('0x18'));var config=require(_0x63c2('0x19'));var licenseUtil=require(_0x63c2('0x1a'));var db=require(_0x63c2('0x1b'))['db'];function respondWithStatusCode(_0x442b60,_0x2006d3){_0x2006d3=_0x2006d3||0xcc;return function(_0x101042){if(_0x101042){return _0x442b60[_0x63c2('0x1c')](_0x2006d3);}return _0x442b60['status'](_0x2006d3)[_0x63c2('0x1d')]();};}function respondWithResult(_0x26bbe4,_0x3a8287){_0x3a8287=_0x3a8287||0xc8;return function(_0x4d97a5){if(_0x4d97a5){return _0x26bbe4[_0x63c2('0x1e')](_0x3a8287)[_0x63c2('0x1f')](_0x4d97a5);}};}function respondWithFilteredResult(_0x109588,_0x2823bb){return function(_0x4d088b){if(_0x4d088b){var _0x26eeac=typeof _0x2823bb[_0x63c2('0x20')]===_0x63c2('0x21')&&typeof _0x2823bb[_0x63c2('0x22')]==='undefined';var _0x2e8bcd=_0x4d088b['count'];var _0x5a3279=_0x26eeac?0x0:_0x2823bb[_0x63c2('0x20')];var _0x1030ab=_0x26eeac?_0x4d088b[_0x63c2('0x23')]:_0x2823bb[_0x63c2('0x20')]+_0x2823bb[_0x63c2('0x22')];var _0x57dc69;if(_0x1030ab>=_0x2e8bcd){_0x1030ab=_0x2e8bcd;_0x57dc69=0xc8;}else{_0x57dc69=0xce;}_0x109588[_0x63c2('0x1e')](_0x57dc69);return _0x109588[_0x63c2('0x24')](_0x63c2('0x25'),_0x5a3279+'-'+_0x1030ab+'/'+_0x2e8bcd)[_0x63c2('0x1f')](_0x4d088b);}return null;};}function patchUpdates(_0x4d7ec1){return function(_0x4d3643){try{jsonpatch[_0x63c2('0x26')](_0x4d3643,_0x4d7ec1,!![]);}catch(_0x1b9ab0){return BPromise[_0x63c2('0x27')](_0x1b9ab0);}return _0x4d3643[_0x63c2('0x28')]();};}function saveUpdates(_0x2700a9,_0x28bb8e){return function(_0x11de86){if(_0x11de86){return _0x11de86[_0x63c2('0x29')](_0x2700a9)['then'](function(_0x296dfb){return _0x296dfb;});}return null;};}function removeEntity(_0x4bdaf9,_0x440809){return function(_0x16180a){if(_0x16180a){return _0x16180a[_0x63c2('0x2a')]()[_0x63c2('0x2b')](function(){_0x4bdaf9[_0x63c2('0x1e')](0xcc)[_0x63c2('0x1d')]();});}};}function handleEntityNotFound(_0x26041d,_0x2402e8){return function(_0x18097c){if(!_0x18097c){_0x26041d[_0x63c2('0x1c')](0x194);}return _0x18097c;};}function handleError(_0x109723,_0x8fb7f){_0x8fb7f=_0x8fb7f||0x1f4;return function(_0x3d5d33){logger['error'](_0x3d5d33[_0x63c2('0x2c')]);if(_0x3d5d33[_0x63c2('0x2d')]){delete _0x3d5d33[_0x63c2('0x2d')];}_0x109723[_0x63c2('0x1e')](_0x8fb7f)[_0x63c2('0x2e')](_0x3d5d33);};}exports[_0x63c2('0x2f')]=function(_0x354b72,_0x769256){var _0x2ca5b2={},_0x580182={},_0x28847f={'count':0x0,'rows':[]};var _0x5986ad=_[_0x63c2('0x30')](db[_0x63c2('0x31')]['rawAttributes'],function(_0x477725){return{'name':_0x477725[_0x63c2('0x32')],'type':_0x477725[_0x63c2('0x33')][_0x63c2('0x34')]};});_0x580182[_0x63c2('0x35')]=_[_0x63c2('0x30')](_0x5986ad,_0x63c2('0x2d'));_0x580182[_0x63c2('0x36')]=_[_0x63c2('0x37')](_0x354b72[_0x63c2('0x36')]);_0x580182[_0x63c2('0x38')]=_['intersection'](_0x580182[_0x63c2('0x35')],_0x580182[_0x63c2('0x36')]);_0x2ca5b2[_0x63c2('0x39')]=_[_0x63c2('0x3a')](_0x580182[_0x63c2('0x35')],qs[_0x63c2('0x3b')](_0x354b72[_0x63c2('0x36')][_0x63c2('0x3b')]));_0x2ca5b2['attributes']=_0x2ca5b2[_0x63c2('0x39')][_0x63c2('0x3c')]?_0x2ca5b2[_0x63c2('0x39')]:_0x580182[_0x63c2('0x35')];if(!_0x354b72[_0x63c2('0x36')][_0x63c2('0x3d')](_0x63c2('0x3e'))){_0x2ca5b2[_0x63c2('0x22')]=qs[_0x63c2('0x22')](_0x354b72[_0x63c2('0x36')][_0x63c2('0x22')]);_0x2ca5b2[_0x63c2('0x20')]=qs[_0x63c2('0x20')](_0x354b72['query'][_0x63c2('0x20')]);}_0x2ca5b2[_0x63c2('0x3f')]=qs['sort'](_0x354b72['query'][_0x63c2('0x40')]);_0x2ca5b2[_0x63c2('0x41')]=qs[_0x63c2('0x38')](_[_0x63c2('0x42')](_0x354b72[_0x63c2('0x36')],_0x580182[_0x63c2('0x38')]),_0x5986ad);if(_0x354b72[_0x63c2('0x36')][_0x63c2('0x43')]){_0x2ca5b2['where']=_[_0x63c2('0x44')](_0x2ca5b2[_0x63c2('0x41')],{'$or':_[_0x63c2('0x30')](_0x5986ad,function(_0x567bf1){if(_0x567bf1[_0x63c2('0x33')]!=='VIRTUAL'){var _0x51c21a={};_0x51c21a[_0x567bf1[_0x63c2('0x2d')]]={'$like':'%'+_0x354b72[_0x63c2('0x36')]['filter']+'%'};return _0x51c21a;}})});}_0x2ca5b2=_[_0x63c2('0x44')]({},_0x2ca5b2,_0x354b72[_0x63c2('0x45')]);var _0x174201={'where':_0x2ca5b2[_0x63c2('0x41')]};return db[_0x63c2('0x31')][_0x63c2('0x23')](_0x174201)[_0x63c2('0x2b')](function(_0x5c12f4){_0x28847f['count']=_0x5c12f4;if(_0x354b72[_0x63c2('0x36')]['includeAll']){_0x2ca5b2[_0x63c2('0x46')]=[{'all':!![]}];}return db[_0x63c2('0x31')][_0x63c2('0x47')](_0x2ca5b2);})['then'](function(_0x57e159){_0x28847f[_0x63c2('0x48')]=_0x57e159;return _0x28847f;})[_0x63c2('0x2b')](respondWithFilteredResult(_0x769256,_0x2ca5b2))['catch'](handleError(_0x769256,null));};exports[_0x63c2('0x49')]=function(_0x2cb1c9,_0x42c99e){var _0x43f44b={'raw':!![],'where':{'id':_0x2cb1c9[_0x63c2('0x4a')]['id']}},_0x48490c={};_0x48490c[_0x63c2('0x35')]=_['keys'](db[_0x63c2('0x31')][_0x63c2('0x4b')]);_0x48490c['query']=_[_0x63c2('0x37')](_0x2cb1c9['query']);_0x48490c['filters']=_[_0x63c2('0x3a')](_0x48490c[_0x63c2('0x35')],_0x48490c[_0x63c2('0x36')]);_0x43f44b[_0x63c2('0x39')]=_[_0x63c2('0x3a')](_0x48490c['model'],qs[_0x63c2('0x3b')](_0x2cb1c9[_0x63c2('0x36')][_0x63c2('0x3b')]));_0x43f44b['attributes']=_0x43f44b[_0x63c2('0x39')]['length']?_0x43f44b[_0x63c2('0x39')]:_0x48490c[_0x63c2('0x35')];if(_0x2cb1c9[_0x63c2('0x36')][_0x63c2('0x4c')]){_0x43f44b[_0x63c2('0x46')]=[{'all':!![]}];}_0x43f44b=_[_0x63c2('0x44')]({},_0x43f44b,_0x2cb1c9[_0x63c2('0x45')]);return db[_0x63c2('0x31')][_0x63c2('0x4d')](_0x43f44b)[_0x63c2('0x2b')](handleEntityNotFound(_0x42c99e,null))['then'](respondWithResult(_0x42c99e,null))[_0x63c2('0x4e')](handleError(_0x42c99e,null));};exports[_0x63c2('0x4f')]=function(_0x3e2c66,_0xcb4616){return db['WhatsappTransferReport']['create'](_0x3e2c66[_0x63c2('0x50')],{})[_0x63c2('0x2b')](respondWithResult(_0xcb4616,0xc9))[_0x63c2('0x4e')](handleError(_0xcb4616,null));};exports['update']=function(_0x50c883,_0x2714c2){if(_0x50c883[_0x63c2('0x50')]['id']){delete _0x50c883[_0x63c2('0x50')]['id'];}return db[_0x63c2('0x31')][_0x63c2('0x4d')]({'where':{'id':_0x50c883[_0x63c2('0x4a')]['id']}})[_0x63c2('0x2b')](handleEntityNotFound(_0x2714c2,null))[_0x63c2('0x2b')](saveUpdates(_0x50c883[_0x63c2('0x50')],null))[_0x63c2('0x2b')](respondWithResult(_0x2714c2,null))['catch'](handleError(_0x2714c2,null));};exports[_0x63c2('0x2a')]=function(_0x29f8f5,_0x4e52a2){return db['WhatsappTransferReport'][_0x63c2('0x4d')]({'where':{'id':_0x29f8f5[_0x63c2('0x4a')]['id']}})[_0x63c2('0x2b')](handleEntityNotFound(_0x4e52a2,null))[_0x63c2('0x2b')](removeEntity(_0x4e52a2,null))['catch'](handleError(_0x4e52a2,null));};exports[_0x63c2('0x51')]=function(_0x5c24ce,_0x4fabe7){return db[_0x63c2('0x31')][_0x63c2('0x51')]()[_0x63c2('0x2b')](respondWithResult(_0x4fabe7,null))[_0x63c2('0x4e')](handleError(_0x4fabe7,null));};
\ No newline at end of file
index 7a931e9..5dbeab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x025d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x2ba6a9,_0x93adbf){var _0x8c07d5=function(_0x3e5585){while(--_0x3e5585){_0x2ba6a9['push'](_0x2ba6a9['shift']());}};_0x8c07d5(++_0x93adbf);}(_0x025d,0xdb));var _0xd025=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x025d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd025('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd025('0x1'));var BPromise=require(_0xd025('0x2'));var rp=require(_0xd025('0x3'));var fs=require('fs');var path=require(_0xd025('0x4'));var rimraf=require(_0xd025('0x5'));var config=require(_0xd025('0x6'));var attributes=require(_0xd025('0x7'));module['exports']=function(_0x46ecf2,_0xf13d3){return _0x46ecf2[_0xd025('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0xd025('0x9'),'paranoid':![],'indexes':[{'name':_0xd025('0xa'),'fields':[_0xd025('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a7a=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1a7a,0x172));var _0xa1a7=function(_0x5a2cca,_0x287e30){_0x5a2cca=_0x5a2cca-0x0;var _0x1619a8=_0x1a7a[_0x5a2cca];return _0x1619a8;};'use strict';var _=require('lodash');var util=require(_0xa1a7('0x0'));var logger=require(_0xa1a7('0x1'))(_0xa1a7('0x2'));var moment=require('moment');var BPromise=require(_0xa1a7('0x3'));var rp=require(_0xa1a7('0x4'));var fs=require('fs');var path=require(_0xa1a7('0x5'));var rimraf=require(_0xa1a7('0x6'));var config=require(_0xa1a7('0x7'));var attributes=require(_0xa1a7('0x8'));module[_0xa1a7('0x9')]=function(_0x235853,_0x281d2d){return _0x235853[_0xa1a7('0xa')](_0xa1a7('0xb'),attributes,{'tableName':_0xa1a7('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa1a7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index fbec189..e76bdcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0xf9b457,_0x18479d){var _0x2456cc=function(_0x1b6d1a){while(--_0x1b6d1a){_0xf9b457['push'](_0xf9b457['shift']());}};_0x2456cc(++_0x18479d);}(_0x8d0e,0x137));var _0xe8d0=function(_0x2294c4,_0x7c0263){_0x2294c4=_0x2294c4-0x0;var _0x18ba7b=_0x8d0e[_0x2294c4];return _0x18ba7b;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8d0('0x4'));var db=require(_0xe8d0('0x5'))['db'];var utils=require(_0xe8d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe8d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2693e7,_0x228925,_0x166360){return new BPromise(function(_0x2584c4,_0x526986){return client[_0xe8d0('0x9')](_0x2693e7,_0x166360)[_0xe8d0('0xa')](function(_0x1d1edb){logger[_0xe8d0('0xb')](_0xe8d0('0xc'),_0x228925,'request\x20sent');logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x228925,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x1d1edb));if(_0x1d1edb['error']){if(_0x1d1edb[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')](_0xe8d0('0xc'),_0x228925,_0x1d1edb['error'][_0xe8d0('0x13')]);return _0x526986(_0x1d1edb[_0xe8d0('0x11')][_0xe8d0('0x13')]);}logger[_0xe8d0('0x11')](_0xe8d0('0xc'),_0x228925,_0x1d1edb[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2584c4(_0x1d1edb[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xb')](_0xe8d0('0xc'),_0x228925,_0xe8d0('0xf'));_0x2584c4(_0x1d1edb[_0xe8d0('0x14')][_0xe8d0('0x13')]);}})['catch'](function(_0x37a2f7){logger[_0xe8d0('0x11')](_0xe8d0('0xc'),_0x228925,_0x37a2f7);_0x526986(_0x37a2f7);});});}
\ No newline at end of file
+var _0x80de=['stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5e2595,_0x20dfc5){var _0x56870c=function(_0x483814){while(--_0x483814){_0x5e2595['push'](_0x5e2595['shift']());}};_0x56870c(++_0x20dfc5);}(_0x80de,0x185));var _0xe80d=function(_0x2d537b,_0x428480){_0x2d537b=_0x2d537b-0x0;var _0x440b1f=_0x80de[_0x2d537b];return _0x440b1f;};'use strict';var _=require(_0xe80d('0x0'));var util=require(_0xe80d('0x1'));var moment=require(_0xe80d('0x2'));var BPromise=require(_0xe80d('0x3'));var rs=require(_0xe80d('0x4'));var fs=require('fs');var Redis=require(_0xe80d('0x5'));var db=require(_0xe80d('0x6'))['db'];var utils=require(_0xe80d('0x7'));var logger=require(_0xe80d('0x8'))(_0xe80d('0x9'));var config=require('../../config/environment');var jayson=require(_0xe80d('0xa'));var client=jayson[_0xe80d('0xb')][_0xe80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45c42c,_0x2b09ad,_0x39079f){return new BPromise(function(_0x2abe04,_0x33a5d9){return client[_0xe80d('0xd')](_0x45c42c,_0x39079f)[_0xe80d('0xe')](function(_0x436658){logger['info'](_0xe80d('0xf'),_0x2b09ad,_0xe80d('0x10'));logger[_0xe80d('0x11')](_0xe80d('0x12'),_0x2b09ad,'request\x20sent',JSON[_0xe80d('0x13')](_0x436658));if(_0x436658[_0xe80d('0x14')]){if(_0x436658[_0xe80d('0x14')]['code']===0x1f4){logger[_0xe80d('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b09ad,_0x436658['error']['message']);return _0x33a5d9(_0x436658['error']['message']);}logger[_0xe80d('0x14')](_0xe80d('0xf'),_0x2b09ad,_0x436658[_0xe80d('0x14')][_0xe80d('0x15')]);return _0x2abe04(_0x436658[_0xe80d('0x14')][_0xe80d('0x15')]);}else{logger[_0xe80d('0x16')](_0xe80d('0xf'),_0x2b09ad,_0xe80d('0x10'));_0x2abe04(_0x436658[_0xe80d('0x17')][_0xe80d('0x15')]);}})['catch'](function(_0x206b51){logger[_0xe80d('0x14')](_0xe80d('0xf'),_0x2b09ad,_0x206b51);_0x33a5d9(_0x206b51);});});}
\ No newline at end of file
index 149eef5..675b0e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1c6=['info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','sequelize','sync','then','listen'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb1c6,0x1a8));var _0x6b1c=function(_0x55611d,_0x4646f0){_0x55611d=_0x55611d-0x0;var _0x2d968a=_0xb1c6[_0x55611d];return _0x2d968a;};'use strict';var _=require(_0x6b1c('0x0'));var mysqldb=require(_0x6b1c('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x6b1c('0x2'))('app');var pm2=require(_0x6b1c('0x3'));var pm2Config=require(_0x6b1c('0x4'));var schedule=require(_0x6b1c('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x6b1c('0x6'));function main(){return mysqldb['db'][_0x6b1c('0x7')][_0x6b1c('0x8')]()[_0x6b1c('0x9')](function(){return rpc[_0x6b1c('0xa')]();})[_0x6b1c('0x9')](function(_0x564228){logger[_0x6b1c('0xb')](_0x564228);return chat[_0x6b1c('0xc')]();})[_0x6b1c('0x9')](function(){return whatsapp[_0x6b1c('0xc')]();})[_0x6b1c('0x9')](function(){return schedule[_0x6b1c('0xc')]();})[_0x6b1c('0x9')](function(){return transcribe[_0x6b1c('0xc')]();})[_0x6b1c('0x9')](function(_0x20d16d){logger['info'](_0x20d16d);return pm2['start'](pm2Config);})[_0x6b1c('0x9')](function(_0xc59aa0){logger[_0x6b1c('0xb')](_0x6b1c('0xd'),_[_0x6b1c('0xe')](_[_0x6b1c('0xf')](_0xc59aa0,{'status':_0x6b1c('0x10')}),_0x6b1c('0x11'))[_0x6b1c('0x12')]());logger[_0x6b1c('0xb')](_0x6b1c('0x13'),_[_0x6b1c('0xe')](_[_0x6b1c('0xf')](_0xc59aa0,function(_0x444c61){return _0x444c61[_0x6b1c('0x14')]!==_0x6b1c('0x10');}),_0x6b1c('0x11'))['join']()||_0x6b1c('0x15'));config[_0x6b1c('0x16')]&&require(_0x6b1c('0x17'))[_0x6b1c('0x18')]();require(_0x6b1c('0x19'))[_0x6b1c('0x18')]();})[_0x6b1c('0x1a')](function(_0xa4021a){logger[_0x6b1c('0x1b')](_0x6b1c('0x1c'),_0xa4021a);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xdd69=['filter','online','name','Offline\x20apps:','status','None','seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','app','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sync','then','info','start','Online\x20apps:'];(function(_0x38e994,_0x3e0d64){var _0x5aa75d=function(_0x3cea01){while(--_0x3cea01){_0x38e994['push'](_0x38e994['shift']());}};_0x5aa75d(++_0x3e0d64);}(_0xdd69,0xa4));var _0x9dd6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdd69[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9dd6('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x9dd6('0x1'));var config=require(_0x9dd6('0x2'));var logger=require('./config/logger')(_0x9dd6('0x3'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x9dd6('0x4'));var chat=require(_0x9dd6('0x5'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x9dd6('0x6'));function main(){return mysqldb['db']['sequelize'][_0x9dd6('0x7')]()[_0x9dd6('0x8')](function(){return rpc['listen']();})[_0x9dd6('0x8')](function(_0x7839a1){logger[_0x9dd6('0x9')](_0x7839a1);return chat[_0x9dd6('0xa')]();})[_0x9dd6('0x8')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x9dd6('0xa')]();})['then'](function(){return transcribe[_0x9dd6('0xa')]();})[_0x9dd6('0x8')](function(_0x154f30){logger['info'](_0x154f30);return pm2[_0x9dd6('0xa')](pm2Config);})['then'](function(_0x33d205){logger[_0x9dd6('0x9')](_0x9dd6('0xb'),_['map'](_[_0x9dd6('0xc')](_0x33d205,{'status':_0x9dd6('0xd')}),_0x9dd6('0xe'))['join']());logger[_0x9dd6('0x9')](_0x9dd6('0xf'),_['map'](_[_0x9dd6('0xc')](_0x33d205,function(_0x40affc){return _0x40affc[_0x9dd6('0x10')]!==_0x9dd6('0xd');}),_0x9dd6('0xe'))['join']()||_0x9dd6('0x11'));config[_0x9dd6('0x12')]&&require('./config/seedDB')[_0x9dd6('0x13')]();require('./config/license')[_0x9dd6('0x13')]();})[_0x9dd6('0x14')](function(_0x4795dd){logger['error'](_0x9dd6('0x15'),_0x4795dd);process['exit'](0x1);});}main();
\ No newline at end of file
index c188eb4..3d2e893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcffa=['isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','unshift','encryptString','join','promisify','sign','secret','secrets','session','payload','options','randomBytes','toString','hex','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','crypto','util','moment','role','fullname','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','disposition','then','closed','unmanaged','json','Forbidden.','catch','use','headers','authorization','startsWith','User','name','authenticate','Wrong\x20credentials.','status','Unknown\x20authorization\x20format','query','apikey','find','sub','Setting','allowedLoginAttempts','blockDuration'];(function(_0x1b3335,_0x2b2f52){var _0x300d95=function(_0x2c2a38){while(--_0x2c2a38){_0x1b3335['push'](_0x1b3335['shift']());}};_0x300d95(++_0x2b2f52);}(_0xcffa,0x196));var _0xacff=function(_0x2e74cc,_0x59e12f){_0x2e74cc=_0x2e74cc-0x0;var _0xa0e738=_0xcffa[_0x2e74cc];return _0xa0e738;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0xacff('0x0'));var licenseUtil=require(_0xacff('0x1'));var encryptor=require(_0xacff('0x2'));var _=require('lodash');var jwt=require(_0xacff('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xacff('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0xacff('0x5'));var BPromise=require('bluebird');var util=require(_0xacff('0x6'));var moment=require(_0xacff('0x7'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xacff('0x8'),_0xacff('0x9'),'name','internal','email',_0xacff('0xa'),_0xacff('0xb'),_0xacff('0xc'),_0xacff('0xd'),_0xacff('0xe'),_0xacff('0xf'),_0xacff('0x10'),_0xacff('0x11'),_0xacff('0x12'),'pauseType',_0xacff('0x13'),_0xacff('0x14'),'lastPauseAt','crudPermissions',_0xacff('0x15'),_0xacff('0x16'),_0xacff('0x17'),_0xacff('0x18'),'phoneBarAutoAnswerDelay',_0xacff('0x19'),_0xacff('0x1a'),_0xacff('0x1b'),'phoneBarEnableSettings',_0xacff('0x1c'),_0xacff('0x1d'),_0xacff('0x1e'),_0xacff('0x1f'),'hotdesk',_0xacff('0x20'),'userProfileId',_0xacff('0x21'),_0xacff('0x22'),'wssPort',_0xacff('0x23'),'downloadOmnichannelInteractions',_0xacff('0x24')];exports[_0xacff('0x25')]=function(){return this[_0xacff('0x26')](!![])['use'](function(_0x3753eb,_0x165b7d,_0x283b71){if(_0x3753eb[_0xacff('0x27')]){_0x283b71();}else{return db[_0xacff('0x28')][_0xacff('0x29')]({'where':{'id':_0x3753eb['params']['id']},'attributes':['id','closed',_0xacff('0x2a')],'raw':!![]})[_0xacff('0x2b')](function(_0x23a8de){if(_0x23a8de&&_0x23a8de[_0xacff('0x2c')]){return _0x165b7d['status'](_0x23a8de['disposition']===_0xacff('0x2d')?0x195:0x193)[_0xacff('0x2e')]({'message':_0x23a8de[_0xacff('0x2a')]==='unmanaged'?'Unmanaged.':_0xacff('0x2f')});}else{_0x283b71();}})[_0xacff('0x30')](function(_0x175e25){_0x283b71(_0x175e25);});}});};exports[_0xacff('0x26')]=function isAuthenticated(_0x2fc236){return compose()[_0xacff('0x31')](function(_0x1fe150,_0x277e94,_0x1d3e52){var _0x4284f5;if(_0x1fe150[_0xacff('0x32')][_0xacff('0x33')]){if(_[_0xacff('0x34')](_0x1fe150[_0xacff('0x32')][_0xacff('0x33')],'Basic')){var _0x2b31cd=basicAuth(_0x1fe150);db[_0xacff('0x35')]['find']({'where':{'name':_0x2b31cd[_0xacff('0x36')]}})[_0xacff('0x2b')](function(_0xf86c90){if(!_0xf86c90||!_0xf86c90[_0xacff('0x37')](_0x2b31cd['pass'])){return _0x277e94['status'](0x191)[_0xacff('0x2e')]({'message':_0xacff('0x38')});}_0x1fe150[_0xacff('0x27')]={'id':_0xf86c90['id']};_0x1d3e52();})['catch'](function(_0x525c34){_0x1d3e52(_0x525c34);});}else if(_[_0xacff('0x34')](_0x1fe150[_0xacff('0x32')][_0xacff('0x33')],'Bearer')){validateJwt(_0x1fe150,_0x277e94,_0x1d3e52);}else{if(_0x2fc236){_0x1d3e52();}else{return _0x277e94[_0xacff('0x39')](0x193)[_0xacff('0x2e')]({'message':_0xacff('0x3a')});}}}else if(_0x1fe150[_0xacff('0x3b')][_0xacff('0x3c')]){try{var _0x1b35da={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1fe150[_0xacff('0x3b')][_0xacff('0x3c')],_0x1b35da)[_0xacff('0x2b')](function(_0x17afe2){return db[_0xacff('0x35')][_0xacff('0x3d')]({'where':{'id':_0x17afe2[_0xacff('0x3e')]}})[_0xacff('0x2b')](function(_0x3bf0aa){_0x4284f5=_0x3bf0aa;return db[_0xacff('0x3f')][_0xacff('0x29')]({'where':{'id':0x1},'attributes':[_0xacff('0x40'),_0xacff('0x41')],'raw':!![]});})[_0xacff('0x2b')](function(_0x2c106e){if(!_0x4284f5||!_[_0xacff('0x42')](_0x4284f5[_0xacff('0x43')],_0x17afe2[_0xacff('0x44')])){return _0x277e94[_0xacff('0x39')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4284f5[_0xacff('0x45')]){return _0x277e94['status'](0x191)[_0xacff('0x2e')]({'message':_0xacff('0x46')});}if(_0x4284f5[_0xacff('0x47')]){if(_0x2c106e[_0xacff('0x41')]>0x0){if(moment(_0x4284f5[_0xacff('0x48')])[_0xacff('0x49')](_0x2c106e[_0xacff('0x41')],'minutes')>moment()){return _0x277e94[_0xacff('0x39')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x277e94[_0xacff('0x39')](0x191)[_0xacff('0x2e')]({'message':_0xacff('0x46')});}}_0x1fe150[_0xacff('0x27')]={'id':_0x4284f5['id']};_0x1d3e52();});})['catch'](function(){return _0x277e94[_0xacff('0x39')](0x191)[_0xacff('0x2e')]({'message':_0xacff('0x46')});});}catch(_0x1a8c6b){_0x1d3e52(_0x1a8c6b);}}else if(_0x2fc236){_0x1d3e52();}else{return _0x277e94['status'](0x193)[_0xacff('0x2e')]({'message':_0xacff('0x3a')});}})[_0xacff('0x31')](function(_0x54afc5,_0x3eb64b,_0x1be625){if(_0x54afc5[_0xacff('0x27')]){db[_0xacff('0x35')]['find']({'where':{'id':_0x54afc5[_0xacff('0x27')]['id']},'attributes':userAttributes})[_0xacff('0x2b')](function(_0x105b2e){if(!_0x105b2e){return _0x3eb64b['status'](0x194)[_0xacff('0x2e')]({'message':_0xacff('0x4a')});}_0x54afc5['user']=_0x105b2e;_0x1be625();})[_0xacff('0x30')](function(_0x605368){_0x1be625(_0x605368);});}else if(_0x2fc236){_0x1be625();}else{return _0x3eb64b[_0xacff('0x39')](0x194)[_0xacff('0x2e')]({'message':_0xacff('0x4b')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x2cec58,_0x2b0e4f,_0xa23eba){return licenseUtil[_0xacff('0x4c')]()['then'](function(_0x40f748){if(_0x40f748[_0xacff('0x4d')]){_0xa23eba();}else{return _0x2b0e4f['status'](0x193)['json']({'message':_0xacff('0x4e')});}})['catch'](function(_0x3730b7){_0xa23eba(_0x3730b7);});});};exports['isMiddleware']=function(_0x37d97f,_0x1a744a,_0x9e2a2d){_0x37d97f[_0xacff('0x4f')]=!![];return _0x9e2a2d();};exports[_0xacff('0x50')]=function signToken(_0x3813f6){return signJwt(_0x3813f6);};exports['setTokenCookie']=function(_0x4d31bf,_0x16ca11){if(!_0x4d31bf['user']){return _0x16ca11[_0xacff('0x39')](0x194)[_0xacff('0x2e')]({'message':_0xacff('0x51')});}var _0x2c82c5={'payload':{'id':_0x4d31bf[_0xacff('0x27')]['id'],'role':_0x4d31bf[_0xacff('0x27')][_0xacff('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2c82c5)[_0xacff('0x2b')](function(_0x360183){_0x16ca11[_0xacff('0x52')]('motion.token',_0x360183);_0x16ca11[_0xacff('0x53')](_0xacff('0x54'));})[_0xacff('0x30')](function(_0x2a863a){return _0x16ca11[_0xacff('0x39')](0x1f4)[_0xacff('0x55')](_0x2a863a);});};exports[_0xacff('0x56')]=function(_0x561030){if(_['isNil'](_0x561030[_0xacff('0x43')])||_[_0xacff('0x57')](_0x561030[_0xacff('0x58')])){return null;}else{return createJwt(_0x561030);}};exports[_0xacff('0x59')]=function(_0x72bdec){_0x72bdec[_0xacff('0x43')]=generateNonce();_0x72bdec[_0xacff('0x58')]=generateIssuedAt();return createJwt(_0x72bdec);};exports[_0xacff('0x5a')]=function(_0x221f8b,_0x28b3c0){var _0x252018=_0x221f8b[_0xacff('0x3b')]['apikey'];if(_0x252018){var _0x4d5b1f={'nonce':_0x28b3c0[_0xacff('0x43')],'iat':_0x28b3c0[_0xacff('0x58')],'audience':hardwareConf[_0xacff('0x5b')](),'issuer':hardwareConf[_0xacff('0x5b')]()};return verifyJwt(_0x252018,_0x4d5b1f)[_0xacff('0x2b')](function(){return generateApiKey(_0x28b3c0);});}else{throw{'message':_0xacff('0x5c')};}};exports['validatePasswordPattern']=function(_0xd97fc6){var _0x47264b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x47264b['test'](_0xd97fc6))throw new db[(_0xacff('0x5d'))]['ValidationError'](_0xacff('0x5e'));return;};exports[_0xacff('0x5f')]=function(_0x4bba10,_0x13ae92,_0x3d9892){var _0x1af56a=encryptor[_0xacff('0x60')](_0x13ae92)['split'](',');for(var _0x483d74=0x0;_0x483d74<_0x3d9892;_0x483d74++){if(!_0x1af56a[_0x483d74])break;if(_0x4bba10[_0xacff('0x61')]()===_0x1af56a[_0x483d74][_0xacff('0x61')]()){var _0x159942=util[_0xacff('0x62')](_0xacff('0x63'),_0x3d9892);if(_0x3d9892===0x1){_0x159942='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xacff('0x5d'))]['ValidationError'](_0x159942);}}return;};exports[_0xacff('0x64')]=function(_0x199add,_0x19eb55){var _0xe11736=_0x19eb55?encryptor[_0xacff('0x60')](_0x19eb55)[_0xacff('0x65')](','):[];if(_0xe11736[_0xacff('0x66')]===0x5){_0xe11736['splice'](-0x1,0x1);}_0xe11736[_0xacff('0x67')](_0x199add);return encryptor[_0xacff('0x68')](_0xe11736[_0xacff('0x69')](','));};function signJwt(_0x1b09cb){var _0x16449c=BPromise[_0xacff('0x6a')](jwt[_0xacff('0x6b')],{'context':jwt});var _0x7afb27=_0x1b09cb[_0xacff('0x6c')]||config[_0xacff('0x6d')][_0xacff('0x6e')];return new BPromise(function(_0x48ba1c,_0xfb37cb){_0x16449c(_0x1b09cb[_0xacff('0x6f')],_0x7afb27,_0x1b09cb[_0xacff('0x70')])[_0xacff('0x2b')](function(_0x1d932f){_0x48ba1c(_0x1d932f);})[_0xacff('0x30')](function(_0x11c259){_0xfb37cb(_0x11c259);});});}function verifyJwt(_0x2d7062,_0xaa2e59,_0x568170){var _0xe1aae5=BPromise[_0xacff('0x6a')](jwt['verify'],{'context':jwt});var _0xbfc569=_0x568170||config[_0xacff('0x6d')][_0xacff('0x6e')];return new BPromise(function(_0x308784,_0x1a6893){_0xe1aae5(_0x2d7062,_0xbfc569,_0xaa2e59)[_0xacff('0x2b')](function(_0x11fff0){_0x308784(_0x11fff0);})['catch'](function(_0x324f1d){_0x1a6893(_0x324f1d);});});}function generateNonce(){return crypto[_0xacff('0x71')](0x10)[_0xacff('0x72')](_0xacff('0x73'));}function generateIssuedAt(){return Math['floor'](Date[_0xacff('0x74')]()/0x3e8)['toString']();}function createJwt(_0x47984c){var _0x11f8df={'payload':{'iat':_0x47984c[_0xacff('0x58')],'nonce':_0x47984c[_0xacff('0x43')]},'options':{'algorithm':_0xacff('0x75'),'subject':_0x47984c['id'][_0xacff('0x72')](),'issuer':hardwareConf[_0xacff('0x5b')](),'audience':hardwareConf[_0xacff('0x5b')]()}};return signJwt(_0x11f8df)[_0xacff('0x2b')](function(_0x41c9ff){return{'iat':_0x47984c['apiKeyIat'],'nonce':_0x47984c['apiKeyNonce'],'token':_0x41c9ff};});}
\ No newline at end of file
+var _0x0251=['authenticate','pass','Wrong\x20credentials.','catch','startsWith','Bearer','apikey','getUuid','query','then','User','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','validatePasswordPattern','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','sign','payload','options','verify','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','role','fullname','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','closed','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','headers','authorization','find','name'];(function(_0x526621,_0x317acf){var _0x5b6c49=function(_0x24216c){while(--_0x24216c){_0x526621['push'](_0x526621['shift']());}};_0x5b6c49(++_0x317acf);}(_0x0251,0x1c0));var _0x1025=function(_0x4475e0,_0x1c54c1){_0x4475e0=_0x4475e0-0x0;var _0x44d629=_0x0251[_0x4475e0];return _0x44d629;};'use strict';var db=require(_0x1025('0x0'))['db'];var config=require(_0x1025('0x1'));var hardwareConf=require(_0x1025('0x2'));var licenseUtil=require(_0x1025('0x3'));var encryptor=require(_0x1025('0x4'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x1025('0x5'));var compose=require(_0x1025('0x6'));var basicAuth=require(_0x1025('0x7'));var crypto=require(_0x1025('0x8'));var BPromise=require(_0x1025('0x9'));var util=require('util');var moment=require(_0x1025('0xa'));var validateJwt=expressJwt({'secret':config[_0x1025('0xb')]['session']});var userAttributes=['id',_0x1025('0xc'),_0x1025('0xd'),'name','internal',_0x1025('0xe'),'userpic',_0x1025('0xf'),_0x1025('0x10'),_0x1025('0x11'),_0x1025('0x12'),_0x1025('0x13'),_0x1025('0x14'),_0x1025('0x15'),_0x1025('0x16'),'pauseType',_0x1025('0x17'),'lastLoginAt',_0x1025('0x18'),_0x1025('0x19'),_0x1025('0x1a'),_0x1025('0x1b'),_0x1025('0x1c'),_0x1025('0x1d'),_0x1025('0x1e'),'phoneBarDnd',_0x1025('0x1f'),_0x1025('0x20'),_0x1025('0x21'),_0x1025('0x22'),'phoneBarPrefixRequired',_0x1025('0x23'),'phoneBarRemoteControlPort',_0x1025('0x24'),_0x1025('0x25'),'userProfileId',_0x1025('0x26'),_0x1025('0x27'),_0x1025('0x28'),'downloadVoiceRecordings',_0x1025('0x29'),_0x1025('0x2a')];exports[_0x1025('0x2b')]=function(){return this[_0x1025('0x2c')](!![])[_0x1025('0x2d')](function(_0x2e8cd1,_0x3a1fd4,_0x2d4a07){if(_0x2e8cd1[_0x1025('0x2e')]){_0x2d4a07();}else{return db[_0x1025('0x2f')]['findOne']({'where':{'id':_0x2e8cd1[_0x1025('0x30')]['id']},'attributes':['id',_0x1025('0x31'),'disposition'],'raw':!![]})['then'](function(_0xbb059c){if(_0xbb059c&&_0xbb059c[_0x1025('0x31')]){return _0x3a1fd4[_0x1025('0x32')](_0xbb059c['disposition']===_0x1025('0x33')?0x195:0x193)[_0x1025('0x34')]({'message':_0xbb059c[_0x1025('0x35')]===_0x1025('0x33')?_0x1025('0x36'):_0x1025('0x37')});}else{_0x2d4a07();}})['catch'](function(_0x43b7d7){_0x2d4a07(_0x43b7d7);});}});};exports[_0x1025('0x2c')]=function isAuthenticated(_0x37fddd){return compose()[_0x1025('0x2d')](function(_0x237cd5,_0x54f7e1,_0x218946){var _0x446bfc;if(_0x237cd5[_0x1025('0x38')]['authorization']){if(_['startsWith'](_0x237cd5[_0x1025('0x38')][_0x1025('0x39')],'Basic')){var _0x5af6e5=basicAuth(_0x237cd5);db['User'][_0x1025('0x3a')]({'where':{'name':_0x5af6e5[_0x1025('0x3b')]}})['then'](function(_0x56a166){if(!_0x56a166||!_0x56a166[_0x1025('0x3c')](_0x5af6e5[_0x1025('0x3d')])){return _0x54f7e1[_0x1025('0x32')](0x191)[_0x1025('0x34')]({'message':_0x1025('0x3e')});}_0x237cd5[_0x1025('0x2e')]={'id':_0x56a166['id']};_0x218946();})[_0x1025('0x3f')](function(_0x58950e){_0x218946(_0x58950e);});}else if(_[_0x1025('0x40')](_0x237cd5[_0x1025('0x38')]['authorization'],_0x1025('0x41'))){validateJwt(_0x237cd5,_0x54f7e1,_0x218946);}else{if(_0x37fddd){_0x218946();}else{return _0x54f7e1[_0x1025('0x32')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x237cd5['query'][_0x1025('0x42')]){try{var _0x3c4e5c={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x1025('0x43')]()};verifyJwt(_0x237cd5[_0x1025('0x44')]['apikey'],_0x3c4e5c)[_0x1025('0x45')](function(_0x21d399){return db[_0x1025('0x46')][_0x1025('0x3a')]({'where':{'id':_0x21d399[_0x1025('0x47')]}})[_0x1025('0x45')](function(_0x58f3e2){_0x446bfc=_0x58f3e2;return db[_0x1025('0x48')][_0x1025('0x49')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1025('0x4a')],'raw':!![]});})[_0x1025('0x45')](function(_0xa74bcd){if(!_0x446bfc||!_[_0x1025('0x4b')](_0x446bfc[_0x1025('0x4c')],_0x21d399[_0x1025('0x4d')])){return _0x54f7e1[_0x1025('0x32')](0x191)[_0x1025('0x34')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x446bfc[_0x1025('0x4e')]){return _0x54f7e1[_0x1025('0x32')](0x191)[_0x1025('0x34')]({'message':_0x1025('0x4f')});}if(_0x446bfc[_0x1025('0x50')]){if(_0xa74bcd['blockDuration']>0x0){if(moment(_0x446bfc[_0x1025('0x51')])[_0x1025('0x52')](_0xa74bcd[_0x1025('0x4a')],_0x1025('0x53'))>moment()){return _0x54f7e1['status'](0x191)[_0x1025('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x54f7e1[_0x1025('0x32')](0x191)[_0x1025('0x34')]({'message':_0x1025('0x4f')});}}_0x237cd5[_0x1025('0x2e')]={'id':_0x446bfc['id']};_0x218946();});})[_0x1025('0x3f')](function(){return _0x54f7e1[_0x1025('0x32')](0x191)[_0x1025('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x3a9c2d){_0x218946(_0x3a9c2d);}}else if(_0x37fddd){_0x218946();}else{return _0x54f7e1['status'](0x193)[_0x1025('0x34')]({'message':_0x1025('0x54')});}})['use'](function(_0x1c78db,_0x55878a,_0x542e18){if(_0x1c78db[_0x1025('0x2e')]){db[_0x1025('0x46')][_0x1025('0x3a')]({'where':{'id':_0x1c78db['user']['id']},'attributes':userAttributes})[_0x1025('0x45')](function(_0x358195){if(!_0x358195){return _0x55878a['status'](0x194)[_0x1025('0x34')]({'message':_0x1025('0x55')});}_0x1c78db[_0x1025('0x2e')]=_0x358195;_0x542e18();})[_0x1025('0x3f')](function(_0x409eb9){_0x542e18(_0x409eb9);});}else if(_0x37fddd){_0x542e18();}else{return _0x55878a[_0x1025('0x32')](0x194)[_0x1025('0x34')]({'message':_0x1025('0x56')});}});};exports[_0x1025('0x57')]=function canUpdate(){return compose()[_0x1025('0x2d')](function(_0x335c65,_0x1446bc,_0x5350cf){return licenseUtil[_0x1025('0x58')]()['then'](function(_0x28ac10){if(_0x28ac10[_0x1025('0x59')]){_0x5350cf();}else{return _0x1446bc[_0x1025('0x32')](0x193)['json']({'message':_0x1025('0x5a')});}})[_0x1025('0x3f')](function(_0x49bba8){_0x5350cf(_0x49bba8);});});};exports['isMiddleware']=function(_0x291caf,_0x292fc5,_0x40b767){_0x291caf[_0x1025('0x5b')]=!![];return _0x40b767();};exports[_0x1025('0x5c')]=function signToken(_0x2212cd){return signJwt(_0x2212cd);};exports[_0x1025('0x5d')]=function(_0x27b193,_0x27da49){if(!_0x27b193['user']){return _0x27da49[_0x1025('0x32')](0x194)[_0x1025('0x34')]({'message':_0x1025('0x5e')});}var _0x577487={'payload':{'id':_0x27b193[_0x1025('0x2e')]['id'],'role':_0x27b193[_0x1025('0x2e')][_0x1025('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x577487)[_0x1025('0x45')](function(_0x4ce76e){_0x27da49[_0x1025('0x5f')](_0x1025('0x60'),_0x4ce76e);_0x27da49[_0x1025('0x61')](_0x1025('0x62'));})[_0x1025('0x3f')](function(_0x2b3269){return _0x27da49[_0x1025('0x32')](0x1f4)['send'](_0x2b3269);});};exports[_0x1025('0x63')]=function(_0x21b386){if(_[_0x1025('0x64')](_0x21b386[_0x1025('0x4c')])||_[_0x1025('0x64')](_0x21b386['apiKeyIat'])){return null;}else{return createJwt(_0x21b386);}};exports['generateApiKey']=function(_0x3244ab){_0x3244ab[_0x1025('0x4c')]=generateNonce();_0x3244ab['apiKeyIat']=generateIssuedAt();return createJwt(_0x3244ab);};exports['regenerateApiKey']=function(_0x478f37,_0x10872e){var _0x30eae4=_0x478f37['query'][_0x1025('0x42')];if(_0x30eae4){var _0xd47f3a={'nonce':_0x10872e[_0x1025('0x4c')],'iat':_0x10872e[_0x1025('0x65')],'audience':hardwareConf[_0x1025('0x43')](),'issuer':hardwareConf[_0x1025('0x43')]()};return verifyJwt(_0x30eae4,_0xd47f3a)[_0x1025('0x45')](function(){return generateApiKey(_0x10872e);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x1025('0x66')]=function(_0x4a8f3a){var _0x5ddb61=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ddb61['test'](_0x4a8f3a))throw new db[(_0x1025('0x67'))][(_0x1025('0x68'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x1025('0x69')]=function(_0x2726f5,_0x326f99,_0x506b14){var _0x2625ac=encryptor[_0x1025('0x6a')](_0x326f99)[_0x1025('0x6b')](',');for(var _0x4aebf1=0x0;_0x4aebf1<_0x506b14;_0x4aebf1++){if(!_0x2625ac[_0x4aebf1])break;if(_0x2726f5[_0x1025('0x6c')]()===_0x2625ac[_0x4aebf1][_0x1025('0x6c')]()){var _0x2e2cbe=util['format'](_0x1025('0x6d'),_0x506b14);if(_0x506b14===0x1){_0x2e2cbe='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x1025('0x67'))]['ValidationError'](_0x2e2cbe);}}return;};exports[_0x1025('0x6e')]=function(_0x4cba16,_0x4a3ca5){var _0x429646=_0x4a3ca5?encryptor['decryptString'](_0x4a3ca5)[_0x1025('0x6b')](','):[];if(_0x429646[_0x1025('0x6f')]===0x5){_0x429646[_0x1025('0x70')](-0x1,0x1);}_0x429646[_0x1025('0x71')](_0x4cba16);return encryptor[_0x1025('0x72')](_0x429646['join'](','));};function signJwt(_0x424689){var _0x4f9335=BPromise[_0x1025('0x73')](jwt[_0x1025('0x74')],{'context':jwt});var _0x513dc1=_0x424689['secret']||config[_0x1025('0xb')]['session'];return new BPromise(function(_0x25519b,_0x3db1f3){_0x4f9335(_0x424689[_0x1025('0x75')],_0x513dc1,_0x424689[_0x1025('0x76')])[_0x1025('0x45')](function(_0x292a02){_0x25519b(_0x292a02);})[_0x1025('0x3f')](function(_0x1cf678){_0x3db1f3(_0x1cf678);});});}function verifyJwt(_0x27d461,_0x4ee892,_0x5a65dc){var _0x2752c4=BPromise['promisify'](jwt[_0x1025('0x77')],{'context':jwt});var _0x42db6d=_0x5a65dc||config[_0x1025('0xb')][_0x1025('0x78')];return new BPromise(function(_0x4dd04a,_0x51194d){_0x2752c4(_0x27d461,_0x42db6d,_0x4ee892)['then'](function(_0x3908c1){_0x4dd04a(_0x3908c1);})['catch'](function(_0x5021a1){_0x51194d(_0x5021a1);});});}function generateNonce(){return crypto[_0x1025('0x79')](0x10)[_0x1025('0x7a')](_0x1025('0x7b'));}function generateIssuedAt(){return Math[_0x1025('0x7c')](Date[_0x1025('0x7d')]()/0x3e8)['toString']();}function createJwt(_0x2643bb){var _0x35a37a={'payload':{'iat':_0x2643bb['apiKeyIat'],'nonce':_0x2643bb['apiKeyNonce']},'options':{'algorithm':_0x1025('0x7e'),'subject':_0x2643bb['id'][_0x1025('0x7a')](),'issuer':hardwareConf[_0x1025('0x43')](),'audience':hardwareConf[_0x1025('0x43')]()}};return signJwt(_0x35a37a)[_0x1025('0x45')](function(_0x11017e){return{'iat':_0x2643bb[_0x1025('0x65')],'nonce':_0x2643bb[_0x1025('0x4c')],'token':_0x11017e};});}
\ No newline at end of file
index 8d2eb8f..54b5d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3806=['bluebird','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','data','secret','utf8','base64','decryptString','crypto'];(function(_0x3160e1,_0x2bc5cd){var _0xa1268e=function(_0x3cdd35){while(--_0x3cdd35){_0x3160e1['push'](_0x3160e1['shift']());}};_0xa1268e(++_0x2bc5cd);}(_0x3806,0xa9));var _0x6380=function(_0x25f20e,_0x3fba04){_0x25f20e=_0x25f20e-0x0;var _0x43c5b3=_0x3806[_0x25f20e];return _0x43c5b3;};'use strict';var crypto=require(_0x6380('0x0'));var fs=require('fs');var BPromise=require(_0x6380('0x1'));var _=require('lodash');var config=require(_0x6380('0x2'));var logger=require(_0x6380('0x3'))(_0x6380('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x6380('0x5')],'algorithm':_0x6380('0x6')};const fileOptions={'algorithm':_0x6380('0x7')};if(config[_0x6380('0x8')]&&config[_0x6380('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x6380('0x8')]['algorithm']);if(isSupported){fileOptions[_0x6380('0x9')]=config[_0x6380('0x8')][_0x6380('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6380('0xa')](',\x20');logger[_0x6380('0xb')](config['encrypt']['algorithm'],_0x6380('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x11337a){return AES_SUPPORTED_RX[_0x6380('0xd')](_0x11337a);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x6380('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x28b958){return getSupportedCiphers()[_0x6380('0xf')](_0x28b958)>-0x1;}function combineOptions(_0x2fab50){var _0xaaf6a0={};for(var _0x26ac7b in fileOptions){if(fileOptions[_0x6380('0x10')](_0x26ac7b)){_0xaaf6a0[_0x26ac7b]=fileOptions[_0x26ac7b];}}if(_0x2fab50){for(var _0x38d3c4 in _0x2fab50){if(_0x2fab50[_0x6380('0x10')](_0x38d3c4)){_0xaaf6a0[_0x38d3c4]=_0x2fab50[_0x38d3c4];}}}return _0xaaf6a0;}exports['encryptFile']=function(_0x29226b,_0x2394b7,_0x1457fd,_0xf87fdc){return new BPromise(function(_0x34ff22,_0x305044){_0xf87fdc=combineOptions(_0xf87fdc);var _0x1a803c=new Buffer(_0x1457fd);var _0x381488=fs[_0x6380('0x11')](_0x29226b);var _0x20d995=fs[_0x6380('0x12')](_0x2394b7);var _0x575e7a=crypto[_0x6380('0x13')](_0xf87fdc[_0x6380('0x9')],_0x1a803c);_0x381488['on']('data',function(_0x32e945){var _0x736e4f=new Buffer(_0x575e7a[_0x6380('0x14')](_0x32e945),_0x6380('0x15'));_0x20d995[_0x6380('0x16')](_0x736e4f);});_0x381488['on'](_0x6380('0x17'),function(){try{var _0xe0f004=new Buffer(_0x575e7a[_0x6380('0x18')]('binary'),'binary');_0x20d995[_0x6380('0x16')](_0xe0f004);_0x20d995[_0x6380('0x17')]();_0x20d995['on'](_0x6380('0x19'),function(){return _0x34ff22(_0x2394b7);});}catch(_0x378282){fs[_0x6380('0x1a')](_0x2394b7);return _0x305044(_0x378282);}});});};exports[_0x6380('0x1b')]=function(_0x3fa0c9,_0x18e658,_0x1969e8,_0x580b9d){return new BPromise(function(_0x4bcf20,_0x51cc84){_0x580b9d=combineOptions(_0x580b9d);var _0xeb6ce1=new Buffer(_0x1969e8);var _0x270f51=fs['createReadStream'](_0x3fa0c9);var _0x102714=fs[_0x6380('0x12')](_0x18e658);var _0x2aa4e0=crypto[_0x6380('0x1c')](_0x580b9d[_0x6380('0x9')],_0xeb6ce1);_0x270f51['on'](_0x6380('0x1d'),function(_0x3f98e6){var _0x258e9e=new Buffer(_0x2aa4e0['update'](_0x3f98e6),_0x6380('0x15'));_0x102714[_0x6380('0x16')](_0x258e9e);});_0x270f51['on']('end',function(){try{var _0x583585=new Buffer(_0x2aa4e0[_0x6380('0x18')](_0x6380('0x15')),_0x6380('0x15'));_0x102714['write'](_0x583585);_0x102714['end']();_0x102714['on'](_0x6380('0x19'),function(){return _0x4bcf20(_0x18e658);});}catch(_0x3924c8){fs['unlink'](_0x18e658);return _0x51cc84(_0x3924c8);}});});};exports['encryptString']=function(_0x482dd5,_0x184e0a,_0x326c5d){var _0x2c61ec=_0x326c5d||stringOptions[_0x6380('0x9')];var _0x4c0def=_0x184e0a||stringOptions[_0x6380('0x1e')];var _0xbe5ad0=crypto[_0x6380('0x13')](_0x2c61ec,_0x4c0def);var _0x28aa56=_0xbe5ad0[_0x6380('0x14')](_0x482dd5,_0x6380('0x1f'),'base64');_0x28aa56+=_0xbe5ad0[_0x6380('0x18')](_0x6380('0x20'));return _0x28aa56;};exports[_0x6380('0x21')]=function(_0x1307cb,_0x3e0b69,_0x17c1d7){var _0x431eef=_0x17c1d7||stringOptions[_0x6380('0x9')];var _0xd7e6e3=_0x3e0b69||stringOptions['secret'];var _0x29a69c=crypto[_0x6380('0x1c')](_0x431eef,_0xd7e6e3);var _0x593710=_0x29a69c[_0x6380('0x14')](_0x1307cb,_0x6380('0x20'),_0x6380('0x1f'));_0x593710+=_0x29a69c[_0x6380('0x18')](_0x6380('0x1f'));return _0x593710;};
\ No newline at end of file
+var _0x8b38=['encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','data','encryptString','secret','base64','decryptString','utf8','bluebird','lodash','secrets','session','aes-256-ctr','aes192'];(function(_0x2d1cf6,_0x3864fe){var _0x3d4d16=function(_0x4ab393){while(--_0x4ab393){_0x2d1cf6['push'](_0x2d1cf6['shift']());}};_0x3d4d16(++_0x3864fe);}(_0x8b38,0xf2));var _0x88b3=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x8b38[_0x56f7e2];return _0x36240b;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x88b3('0x0'));var _=require(_0x88b3('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x88b3('0x2')][_0x88b3('0x3')],'algorithm':_0x88b3('0x4')};const fileOptions={'algorithm':_0x88b3('0x5')};if(config[_0x88b3('0x6')]&&config[_0x88b3('0x6')][_0x88b3('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x88b3('0x7')]);if(isSupported){fileOptions[_0x88b3('0x7')]=config[_0x88b3('0x6')][_0x88b3('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x88b3('0x8')](config[_0x88b3('0x6')]['algorithm'],_0x88b3('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x282740){return AES_SUPPORTED_RX['test'](_0x282740);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x88b3('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x3c1302){return getSupportedCiphers()[_0x88b3('0xb')](_0x3c1302)>-0x1;}function combineOptions(_0x5e95c7){var _0x525792={};for(var _0x32a2f0 in fileOptions){if(fileOptions[_0x88b3('0xc')](_0x32a2f0)){_0x525792[_0x32a2f0]=fileOptions[_0x32a2f0];}}if(_0x5e95c7){for(var _0x4e3164 in _0x5e95c7){if(_0x5e95c7[_0x88b3('0xc')](_0x4e3164)){_0x525792[_0x4e3164]=_0x5e95c7[_0x4e3164];}}}return _0x525792;}exports[_0x88b3('0xd')]=function(_0x9f6485,_0x21baa6,_0x57fe6f,_0x2a086a){return new BPromise(function(_0x525356,_0x57078d){_0x2a086a=combineOptions(_0x2a086a);var _0x5ae02a=new Buffer(_0x57fe6f);var _0x4ead34=fs[_0x88b3('0xe')](_0x9f6485);var _0x52208c=fs[_0x88b3('0xf')](_0x21baa6);var _0xe594f2=crypto['createCipher'](_0x2a086a[_0x88b3('0x7')],_0x5ae02a);_0x4ead34['on']('data',function(_0x516102){var _0x50fc4e=new Buffer(_0xe594f2[_0x88b3('0x10')](_0x516102),_0x88b3('0x11'));_0x52208c[_0x88b3('0x12')](_0x50fc4e);});_0x4ead34['on'](_0x88b3('0x13'),function(){try{var _0xf09af2=new Buffer(_0xe594f2[_0x88b3('0x14')](_0x88b3('0x11')),'binary');_0x52208c[_0x88b3('0x12')](_0xf09af2);_0x52208c['end']();_0x52208c['on'](_0x88b3('0x15'),function(){return _0x525356(_0x21baa6);});}catch(_0x43b71a){fs[_0x88b3('0x16')](_0x21baa6);return _0x57078d(_0x43b71a);}});});};exports[_0x88b3('0x17')]=function(_0x16154d,_0x398cf3,_0x419afc,_0x335f4b){return new BPromise(function(_0x53a8c9,_0x3c55a1){_0x335f4b=combineOptions(_0x335f4b);var _0x4ed9c9=new Buffer(_0x419afc);var _0x117728=fs[_0x88b3('0xe')](_0x16154d);var _0x440fd6=fs['createWriteStream'](_0x398cf3);var _0x4b9a5c=crypto[_0x88b3('0x18')](_0x335f4b[_0x88b3('0x7')],_0x4ed9c9);_0x117728['on'](_0x88b3('0x19'),function(_0x2bcd63){var _0x354952=new Buffer(_0x4b9a5c[_0x88b3('0x10')](_0x2bcd63),_0x88b3('0x11'));_0x440fd6[_0x88b3('0x12')](_0x354952);});_0x117728['on'](_0x88b3('0x13'),function(){try{var _0xd3c9f2=new Buffer(_0x4b9a5c[_0x88b3('0x14')](_0x88b3('0x11')),_0x88b3('0x11'));_0x440fd6['write'](_0xd3c9f2);_0x440fd6['end']();_0x440fd6['on'](_0x88b3('0x15'),function(){return _0x53a8c9(_0x398cf3);});}catch(_0x69282b){fs[_0x88b3('0x16')](_0x398cf3);return _0x3c55a1(_0x69282b);}});});};exports[_0x88b3('0x1a')]=function(_0x2d5232,_0x13c685,_0x4787f3){var _0x5593d3=_0x4787f3||stringOptions[_0x88b3('0x7')];var _0x3df710=_0x13c685||stringOptions[_0x88b3('0x1b')];var _0x4debb0=crypto['createCipher'](_0x5593d3,_0x3df710);var _0x2df814=_0x4debb0[_0x88b3('0x10')](_0x2d5232,'utf8',_0x88b3('0x1c'));_0x2df814+=_0x4debb0[_0x88b3('0x14')](_0x88b3('0x1c'));return _0x2df814;};exports[_0x88b3('0x1d')]=function(_0x50aa1f,_0x1b60e0,_0x2acdd0){var _0x5b340d=_0x2acdd0||stringOptions['algorithm'];var _0x575e77=_0x1b60e0||stringOptions['secret'];var _0x3bf588=crypto[_0x88b3('0x18')](_0x5b340d,_0x575e77);var _0x455ec1=_0x3bf588['update'](_0x50aa1f,_0x88b3('0x1c'),_0x88b3('0x1e'));_0x455ec1+=_0x3bf588['final']('utf8');return _0x455ec1;};
\ No newline at end of file
index 17faf1f..252a21c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7980=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update'];(function(_0x179e2b,_0x4b681e){var _0x170e17=function(_0x3f25f4){while(--_0x3f25f4){_0x179e2b['push'](_0x179e2b['shift']());}};_0x170e17(++_0x4b681e);}(_0x7980,0xab));var _0x0798=function(_0xacd8ea,_0x3c04e9){_0xacd8ea=_0xacd8ea-0x0;var _0x149cc7=_0x7980[_0xacd8ea];return _0x149cc7;};'use strict';var util=require(_0x0798('0x0'));var path=require(_0x0798('0x1'));var _=require(_0x0798('0x2'));var csv=require(_0x0798('0x3'));var fs=require('fs');var BPromise=require(_0x0798('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x0798('0x5'));var db=require(_0x0798('0x6'))['db'];var dbH=require(_0x0798('0x6'))[_0x0798('0x7')];var logger=require(_0x0798('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0798('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x0798('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x34f808,_0x467859){var _0x54da10={'status':_0x34f808};var _0x5151b3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x467859){_0x54da10[_0x0798('0xa')]=_0x467859;}return db[_0x0798('0xb')][_0x0798('0xc')](_0x54da10,_0x5151b3);}function main(){var _0x1601f2=0x1388;var _0x53e9a1;logger[_0x0798('0xd')](util[_0x0798('0xe')](_0x0798('0xf'),EXTRACTED_REPORT_ID,_0x0798('0x10')));return db[_0x0798('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0798('0x12'),_0x0798('0x13')]})['then'](function(_0x5323e5){if(_0x5323e5){_0x53e9a1=_0x5323e5;_0x1601f2=_0x53e9a1[_0x0798('0x13')]||0x1388;}})[_0x0798('0x14')](function(){return dbH[_0x0798('0x15')][_0x0798('0x16')](util[_0x0798('0xe')](_0x0798('0x17'),QUERY),{'type':dbH[_0x0798('0x15')]['QueryTypes']['SELECT']});})[_0x0798('0x14')](function(_0x112362){if(!_0x112362[0x0]['num']){return analyticExtractedReport('Empty');}var _0x21c30b=[];var _0x45cae6=0x0;var _0x258081=!![];if(_0x112362&&_0x112362['length']){var _0x58cd05=_0x112362[0x0][_0x0798('0x18')]%(_0x45cae6+_0x1601f2);if(_0x53e9a1['split']){for(;_0x258081;_0x45cae6+=_0x1601f2,_0x58cd05=_0x112362[0x0][_0x0798('0x18')]%(_0x45cae6+_0x1601f2)){if(_0x58cd05==0x0||_0x58cd05==_0x112362[0x0][_0x0798('0x18')]){_0x258081=![];}_0x21c30b[_0x0798('0x19')](dbH[_0x0798('0x15')]['query'](util[_0x0798('0xe')](_0x0798('0x1a'),QUERY,_0x1601f2,_0x45cae6),{'type':dbH['sequelize'][_0x0798('0x1b')][_0x0798('0x1c')]}));}}else{_0x21c30b[_0x0798('0x19')](dbH[_0x0798('0x15')][_0x0798('0x16')](QUERY,{'type':dbH[_0x0798('0x15')][_0x0798('0x1b')][_0x0798('0x1c')]}));}}var _0x23b37d=path['dirname'](PATH);var _0x2aaabf=path[_0x0798('0x1d')](PATH,_0x0798('0x1e'));var _0x114df1=_0x53e9a1[_0x0798('0x12')]&&_0x21c30b[_0x0798('0x1f')]>0x1;var _0x52037c=[];if(!fs[_0x0798('0x20')](path[_0x0798('0x21')](_0x23b37d,_0x2aaabf))&&_0x114df1){fs[_0x0798('0x22')](path[_0x0798('0x21')](_0x23b37d,_0x2aaabf));}return BPromise[_0x0798('0x23')](_0x21c30b,function(_0x23d59c){_0x52037c['push'](_0x23d59c);})[_0x0798('0x14')](function(){for(var _0x14f828=0x0;_0x14f828<_0x52037c[_0x0798('0x1f')];_0x14f828+=0x1){var _0x4d4e0a;var _0x4bc3f3=_0x52037c[_0x14f828];if(_0x114df1){_0x4d4e0a=path['join'](_0x23b37d,_0x2aaabf,util['format'](_0x0798('0x24'),_0x2aaabf,_0x14f828,_0x0798('0x25')));}else{_0x4d4e0a=path[_0x0798('0x21')](_0x23b37d,util[_0x0798('0xe')](_0x0798('0x26'),_0x2aaabf,_0x0798('0x25')));}fs[_0x0798('0x27')](_0x4d4e0a,csv(_0x4bc3f3));}})[_0x0798('0x14')](function(){if(_0x114df1){zipdir(path['join'](_0x23b37d,_0x2aaabf),{'saveTo':path[_0x0798('0x21')](_0x23b37d,util['format']('%s.%s',_0x2aaabf,_0x0798('0x28')))},function(_0x4a7eeb,_0x1dabd5){});rimraf(path['join'](_0x23b37d,_0x2aaabf),function(){});}})[_0x0798('0x14')](function(){logger[_0x0798('0xd')](util[_0x0798('0xe')](_0x0798('0x29'),EXTRACTED_REPORT_ID,_0x0798('0x10')));return analyticExtractedReport(_0x0798('0x2a'),_0x114df1?util[_0x0798('0xe')](_0x0798('0x26'),_0x2aaabf,_0x114df1?_0x0798('0x28'):_0x0798('0x25')):null);});})[_0x0798('0x2b')](function(_0x21de23){logger['info'](util[_0x0798('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x0798('0x2c')](_0x21de23,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0798('0x2d'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x4ded=['Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','split','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','inspect'];(function(_0x358618,_0x344efa){var _0x54fd56=function(_0x4a3731){while(--_0x4a3731){_0x358618['push'](_0x358618['shift']());}};_0x54fd56(++_0x344efa);}(_0x4ded,0x116));var _0xd4de=function(_0x5cb0df,_0x5118a9){_0x5cb0df=_0x5cb0df-0x0;var _0x3e5f16=_0x4ded[_0x5cb0df];return _0x3e5f16;};'use strict';var util=require(_0xd4de('0x0'));var path=require(_0xd4de('0x1'));var _=require(_0xd4de('0x2'));var csv=require(_0xd4de('0x3'));var fs=require('fs');var BPromise=require(_0xd4de('0x4'));var zipdir=require(_0xd4de('0x5'));var rimraf=require(_0xd4de('0x6'));var db=require(_0xd4de('0x7'))['db'];var dbH=require(_0xd4de('0x7'))[_0xd4de('0x8')];var logger=require(_0xd4de('0x9'))(_0xd4de('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd4de('0xb')][0x3];var PATH=process[_0xd4de('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x15eb91,_0x2c56d5){var _0x4453c2={'status':_0x15eb91};var _0x1e8c35={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c56d5){_0x4453c2['savename']=_0x2c56d5;}return db[_0xd4de('0xc')]['update'](_0x4453c2,_0x1e8c35);}function main(){var _0x4ab822=0x1388;var _0x4b0876;logger[_0xd4de('0xd')](util[_0xd4de('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xd4de('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd4de('0x10')]})[_0xd4de('0x11')](function(_0x104dad){if(_0x104dad){_0x4b0876=_0x104dad;_0x4ab822=_0x4b0876[_0xd4de('0x10')]||0x1388;}})[_0xd4de('0x11')](function(){return dbH[_0xd4de('0x12')][_0xd4de('0x13')](util[_0xd4de('0xe')](_0xd4de('0x14'),QUERY),{'type':dbH[_0xd4de('0x12')][_0xd4de('0x15')][_0xd4de('0x16')]});})[_0xd4de('0x11')](function(_0xbb4f7e){if(!_0xbb4f7e[0x0][_0xd4de('0x17')]){return analyticExtractedReport(_0xd4de('0x18'));}var _0x325fba=[];var _0x4b0a95=0x0;var _0x5d0aeb=!![];if(_0xbb4f7e&&_0xbb4f7e[_0xd4de('0x19')]){var _0x23c61b=_0xbb4f7e[0x0][_0xd4de('0x17')]%(_0x4b0a95+_0x4ab822);if(_0x4b0876[_0xd4de('0x1a')]){for(;_0x5d0aeb;_0x4b0a95+=_0x4ab822,_0x23c61b=_0xbb4f7e[0x0]['num']%(_0x4b0a95+_0x4ab822)){if(_0x23c61b==0x0||_0x23c61b==_0xbb4f7e[0x0]['num']){_0x5d0aeb=![];}_0x325fba[_0xd4de('0x1b')](dbH['sequelize'][_0xd4de('0x13')](util[_0xd4de('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4ab822,_0x4b0a95),{'type':dbH[_0xd4de('0x12')]['QueryTypes'][_0xd4de('0x16')]}));}}else{_0x325fba[_0xd4de('0x1b')](dbH[_0xd4de('0x12')][_0xd4de('0x13')](QUERY,{'type':dbH['sequelize'][_0xd4de('0x15')][_0xd4de('0x16')]}));}}var _0x360e3d=path[_0xd4de('0x1c')](PATH);var _0x1c631a=path[_0xd4de('0x1d')](PATH,_0xd4de('0x1e'));var _0x23754d=_0x4b0876[_0xd4de('0x1a')]&&_0x325fba[_0xd4de('0x19')]>0x1;var _0x534b37=[];if(!fs[_0xd4de('0x1f')](path[_0xd4de('0x20')](_0x360e3d,_0x1c631a))&&_0x23754d){fs[_0xd4de('0x21')](path[_0xd4de('0x20')](_0x360e3d,_0x1c631a));}return BPromise[_0xd4de('0x22')](_0x325fba,function(_0x984904){_0x534b37[_0xd4de('0x1b')](_0x984904);})[_0xd4de('0x11')](function(){for(var _0x2aa82a=0x0;_0x2aa82a<_0x534b37[_0xd4de('0x19')];_0x2aa82a+=0x1){var _0x2ea712;var _0xb2d8a1=_0x534b37[_0x2aa82a];if(_0x23754d){_0x2ea712=path['join'](_0x360e3d,_0x1c631a,util[_0xd4de('0xe')](_0xd4de('0x23'),_0x1c631a,_0x2aa82a,'csv'));}else{_0x2ea712=path[_0xd4de('0x20')](_0x360e3d,util['format'](_0xd4de('0x24'),_0x1c631a,_0xd4de('0x25')));}fs[_0xd4de('0x26')](_0x2ea712,csv(_0xb2d8a1));}})['then'](function(){if(_0x23754d){zipdir(path[_0xd4de('0x20')](_0x360e3d,_0x1c631a),{'saveTo':path[_0xd4de('0x20')](_0x360e3d,util[_0xd4de('0xe')]('%s.%s',_0x1c631a,_0xd4de('0x27')))},function(_0x1804c7,_0x55f9f9){});rimraf(path['join'](_0x360e3d,_0x1c631a),function(){});}})['then'](function(){logger[_0xd4de('0xd')](util['format'](_0xd4de('0x28'),EXTRACTED_REPORT_ID,_0xd4de('0x29')));return analyticExtractedReport(_0xd4de('0x2a'),_0x23754d?util[_0xd4de('0xe')]('%s.%s',_0x1c631a,_0x23754d?_0xd4de('0x27'):_0xd4de('0x25')):null);});})['catch'](function(_0x133a43){logger[_0xd4de('0xd')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd4de('0x29')),util[_0xd4de('0x2b')](_0x133a43,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd4de('0x2c'));})[_0xd4de('0x2d')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 9dcff57..b0c3727 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2803=['keys','forEach','format','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','dirname','basename','.pdf','join','%s.%s','find','split','splitSizePdf','then','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','push','body','concat'];(function(_0x2fd6ce,_0x5d47a8){var _0x50c911=function(_0x43e41c){while(--_0x43e41c){_0x2fd6ce['push'](_0x2fd6ce['shift']());}};_0x50c911(++_0x5d47a8);}(_0x2803,0x94));var _0x3280=function(_0x220dc2,_0x26a056){_0x220dc2=_0x220dc2-0x0;var _0x48b383=_0x2803[_0x220dc2];return _0x48b383;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x3280('0x0'));var path=require(_0x3280('0x1'));var moment=require(_0x3280('0x2'));var htmlToPdfmake=require(_0x3280('0x3'));var PdfPrinter=require(_0x3280('0x4'));var zipdir=require(_0x3280('0x5'));var rimraf=require(_0x3280('0x6'));var JSDOM=require(_0x3280('0x7'))[_0x3280('0x8')];var window=new JSDOM('')[_0x3280('0x9')];var db=require(_0x3280('0xa'))['db'];var dbH=require(_0x3280('0xa'))[_0x3280('0xb')];var logger=require(_0x3280('0xc'))(_0x3280('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x3280('0xe')][0x2]);var QUERY=process[_0x3280('0xe')][0x3];var PATH=process[_0x3280('0xe')][0x4];var NAME=process[_0x3280('0xe')][0x5];var FORMAT=_0x3280('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x20406f,_0xd7c853){var _0x21c7b5={'status':_0x20406f};var _0x29cb0b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd7c853){_0x21c7b5['savename']=_0xd7c853;}return db[_0x3280('0x10')][_0x3280('0x11')](_0x21c7b5,_0x29cb0b);}function getHeaders(_0x43f577){return _[_0x3280('0x12')](_0x43f577,function(_0x85bb69){return{'text':_0x85bb69,'style':_0x3280('0x13')};});}function getRows(_0x578016,_0x10ca77){return _[_0x3280('0x12')](_0x10ca77,function(_0x465dae){return _(_0x465dae)[_0x3280('0x14')](_0x578016)['map'](function(_0x3e3f62){return _0x3e3f62?_[_0x3280('0x15')](_0x3e3f62):'';})[_0x3280('0x16')]();});}function createTable(_0x1a6c38,_0x2886d9){var _0x5b3208={'widths':_[_0x3280('0x17')](Array(_0x1a6c38[_0x3280('0x18')]),0x91),'heights':function(_0xc17bbd){return _0xc17bbd===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1a4dc7=getHeaders(_0x1a6c38);_0x5b3208['body'][_0x3280('0x19')](_0x1a4dc7);var _0x35cf84=getRows(_0x1a6c38,_0x2886d9);_0x5b3208['body']=_0x5b3208[_0x3280('0x1a')][_0x3280('0x1b')](_0x35cf84);return _0x5b3208;}function createTables(_0x4789ec){var _0x3ce605=[];var _0x16520f=_['chunk'](Object[_0x3280('0x1c')](_0x4789ec[0x0]),0x5);_0x16520f[_0x3280('0x1d')](function(_0x58f630){_0x3ce605[_0x3280('0x19')](createTable(_0x58f630,_0x4789ec));});return _0x3ce605;}function getPDFDocDefinition(_0x375580){var _0x32bf02=util[_0x3280('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x3280('0x1e')](FORMAT));var _0x354de9=[];for(var _0x5810ae=0x0;_0x5810ae<_0x375580[_0x3280('0x18')];_0x5810ae++){var _0x45fa15=[];if(_0x5810ae===0x0){_0x45fa15[_0x3280('0x19')]({'text':_0x32bf02,'style':_0x3280('0x1f')});}var _0xabb5ec={'table':_0x375580[_0x5810ae]};if(_0x5810ae>0x0){_0xabb5ec[_0x3280('0x20')]=_0x3280('0x21');_0xabb5ec[_0x3280('0x22')]=[0x0,0x46,0x0,0x0];}_0x45fa15['push'](_0xabb5ec);_0x354de9[_0x3280('0x19')](_0x45fa15);}return{'pageSize':'A4','pageOrientation':_0x3280('0x23'),'content':_0x354de9,'footer':function(_0x4ff61b,_0x3806d8){return{'text':_0x4ff61b[_0x3280('0x15')]()+_0x3280('0x24')+_0x3806d8,'style':_0x3280('0x25')};},'defaultStyle':{'font':_0x3280('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3280('0x27')},'footer':{'alignment':_0x3280('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43cead){var _0x439ccf=0x1388;var _0x6cf045;if(!_0x43cead[0x0][_0x3280('0x29')]){return analyticExtractedReport(_0x3280('0x2a'));}var _0x4ba4d2=[];var _0x49ec63=0x0;var _0x3c6ecc=!![];var _0x17f28d=path[_0x3280('0x2b')](PATH);var _0x53315d=path[_0x3280('0x2c')](PATH,_0x3280('0x2d'));var _0x160609=path[_0x3280('0x2e')](_0x17f28d,util[_0x3280('0x1e')](_0x3280('0x2f'),_0x53315d,'pdf'));var _0x53eeeb=![];return db['Setting'][_0x3280('0x30')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3280('0x31'),'splitSizePdf']})['then'](function(_0x3efa44){if(_0x3efa44){_0x6cf045=_0x3efa44;_0x439ccf=_0x6cf045[_0x3280('0x32')]||0x3e8;}})[_0x3280('0x33')](function(){if(_0x43cead&&_0x43cead[_0x3280('0x18')]){var _0x2d2ba5=_0x43cead[0x0][_0x3280('0x29')]%(_0x49ec63+_0x439ccf);if(_0x6cf045[_0x3280('0x31')]){for(;_0x3c6ecc;_0x49ec63+=_0x439ccf,_0x2d2ba5=_0x43cead[0x0]['num']%(_0x49ec63+_0x439ccf)){if(_0x2d2ba5==0x0||_0x2d2ba5==_0x43cead[0x0][_0x3280('0x29')]){_0x3c6ecc=![];}_0x4ba4d2[_0x3280('0x19')](dbH['sequelize'][_0x3280('0x34')](util['format'](_0x3280('0x35'),QUERY,_0x439ccf,_0x49ec63),{'type':dbH[_0x3280('0x36')][_0x3280('0x37')][_0x3280('0x38')]}));}}else{_0x4ba4d2[_0x3280('0x19')](dbH['sequelize'][_0x3280('0x34')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x3280('0x38')]}));}}_0x53eeeb=_0x6cf045[_0x3280('0x31')]&&_0x4ba4d2[_0x3280('0x18')]>0x1;if(!fs['existsSync'](path['join'](_0x17f28d,_0x53315d))&&_0x53eeeb){fs[_0x3280('0x39')](path['join'](_0x17f28d,_0x53315d));}return Promise['all'](_0x4ba4d2);})[_0x3280('0x33')](function(_0x2d85b9){return createTables(_[_0x3280('0x3a')](_0x2d85b9));})[_0x3280('0x33')](function(_0x584a1d){var _0x44fc79=getPDFDocDefinition(_0x584a1d);var _0x2c69bb=getPDFPrinter();var _0x5c6591=_0x2c69bb[_0x3280('0x3b')](_0x44fc79);if(_0x53eeeb)_0x160609=path[_0x3280('0x2e')](_0x17f28d,_0x53315d,util['format'](_0x3280('0x3c'),_0x53315d,index,_0x3280('0x3d')));return writePDFDocument(_0x5c6591,_0x160609);})[_0x3280('0x33')](function(){if(!_0x53eeeb)return;zipdir(path[_0x3280('0x2e')](_0x17f28d,_0x53315d),{'saveTo':path['join'](_0x17f28d,util[_0x3280('0x1e')](_0x3280('0x2f'),_0x53315d,_0x3280('0x3e')))},function(_0x532ab1){if(_0x532ab1)throw _0x532ab1;return;});})[_0x3280('0x33')](function(){if(!_0x53eeeb)return;rimraf(path[_0x3280('0x2e')](_0x17f28d,_0x53315d),function(){});})[_0x3280('0x33')](function(){logger[_0x3280('0x3f')](util[_0x3280('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3280('0x40')));return analyticExtractedReport(_0x3280('0x41'),_0x53eeeb?util[_0x3280('0x1e')](_0x3280('0x2f'),_0x53315d,_0x53eeeb?'zip':_0x3280('0x3d')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x3280('0x1e')](_0x3280('0x42'),EXTRACTED_REPORT_ID,_0x3280('0x43')));return db[_0x3280('0x10')][_0x3280('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3280('0x33')](function(_0x26e555){EXTRACTED_REPORT=_0x26e555;return dbH[_0x3280('0x36')][_0x3280('0x34')](util[_0x3280('0x1e')](_0x3280('0x45'),QUERY),{'type':dbH[_0x3280('0x36')][_0x3280('0x37')][_0x3280('0x38')]});})[_0x3280('0x33')](extractReport)[_0x3280('0x46')](function(_0x378908){logger['info'](util[_0x3280('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3280('0x43')),util[_0x3280('0x47')](_0x378908,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3280('0x48'));})[_0x3280('0x49')](function(){process[_0x3280('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x319fab=new PdfPrinter({'Arial':{'normal':__dirname+_0x3280('0x4b'),'bold':__dirname+_0x3280('0x4c'),'italics':__dirname+_0x3280('0x4d'),'bolditalics':__dirname+_0x3280('0x4e')}});return _0x319fab;}function getPDFDocDefinitionFromHTML(_0x330e12,_0x4573bf){var _0xf1b69e=util[_0x3280('0x1e')](_0x3280('0x4f'),_0x4573bf[_0x3280('0x50')],_0x4573bf[_0x3280('0x51')]);var _0x5e78e4=moment()[_0x3280('0x1e')]('YYYY-MM-DD')[_0x3280('0x15')]();var _0x307f2a=htmlToPdfmake(_0x330e12,{'window':window,'tableAutoSize':!![]});return{'content':[_0x307f2a],'defaultStyle':{'font':_0x3280('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3280('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3280('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x569e95,_0x2e2289){return[{'text':util['format'](_0x3280('0x53'),_0xf1b69e,_0x569e95,_0x2e2289,_0x5e78e4),'style':_0x3280('0x25')}];}};}function writePDFDocument(_0x5a2e92,_0x3ff795){return new Promise(function(_0x3d0837,_0x4fe155){var _0x83871c=_0x5a2e92[_0x3280('0x54')](fs['createWriteStream'](_0x3ff795));_0x83871c['on'](_0x3280('0x55'),function(){_0x3d0837(_0x3280('0x55'));});_0x83871c['on'](_0x3280('0x56'),function(_0x368335){_0x4fe155(_0x368335);});_0x5a2e92[_0x3280('0x57')]();});}exports['createPdfFromHTML']=function(_0x2fc749,_0x24742b){var _0x5d79ca=getPDFPrinter();var _0x37ff22=getPDFDocDefinitionFromHTML(_0x2fc749,_0x24742b);var _0x3001d1=_0x5d79ca[_0x3280('0x3b')](_0x37ff22);return writePDFDocument(_0x3001d1,_0x24742b[_0x3280('0x1')])[_0x3280('0x46')](function(_0x574582){throw _0x574582;});};
\ No newline at end of file
+var _0xd251=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','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','path','html-to-pdfmake','pdfmake/src/printer','rimraf','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','push','header','pageBreak','landscape','\x20/\x20','footer','Arial','black','right','num','basename','.pdf','join','%s.%s','pdf','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','mkdirSync','flatten','createPdfKitDocument','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd251,0x163));var _0x1d25=function(_0x2baf8f,_0x731c93){_0x2baf8f=_0x2baf8f-0x0;var _0x5af9b2=_0xd251[_0x2baf8f];return _0x5af9b2;};'use strict';var _=require(_0x1d25('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x1d25('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x1d25('0x2'));var PdfPrinter=require(_0x1d25('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x1d25('0x4'));var JSDOM=require('jsdom')[_0x1d25('0x5')];var window=new JSDOM('')[_0x1d25('0x6')];var db=require(_0x1d25('0x7'))['db'];var dbH=require('../../mysqldb')[_0x1d25('0x8')];var logger=require(_0x1d25('0x9'))(_0x1d25('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x1d25('0xb')][0x2]);var QUERY=process[_0x1d25('0xb')][0x3];var PATH=process[_0x1d25('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x30f550,_0x385697){var _0x3d5580={'status':_0x30f550};var _0x4756c6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x385697){_0x3d5580['savename']=_0x385697;}return db[_0x1d25('0xc')][_0x1d25('0xd')](_0x3d5580,_0x4756c6);}function getHeaders(_0x39bd3d){return _[_0x1d25('0xe')](_0x39bd3d,function(_0x1b3d72){return{'text':_0x1b3d72,'style':_0x1d25('0xf')};});}function getRows(_0x2a721e,_0x102699){return _[_0x1d25('0xe')](_0x102699,function(_0x612072){return _(_0x612072)['pick'](_0x2a721e)['map'](function(_0x471792){return _0x471792?_[_0x1d25('0x10')](_0x471792):'';})[_0x1d25('0x11')]();});}function createTable(_0x1be56c,_0xef2bb9){var _0x4f1b66={'widths':_[_0x1d25('0x12')](Array(_0x1be56c[_0x1d25('0x13')]),0x91),'heights':function(_0x3d0c13){return _0x3d0c13===0x0?_0x1d25('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2883c2=getHeaders(_0x1be56c);_0x4f1b66[_0x1d25('0x15')]['push'](_0x2883c2);var _0x2017a3=getRows(_0x1be56c,_0xef2bb9);_0x4f1b66[_0x1d25('0x15')]=_0x4f1b66[_0x1d25('0x15')]['concat'](_0x2017a3);return _0x4f1b66;}function createTables(_0x5b3b1b){var _0x1d8a04=[];var _0xd3350e=_[_0x1d25('0x16')](Object[_0x1d25('0x17')](_0x5b3b1b[0x0]),0x5);_0xd3350e['forEach'](function(_0x31263d){_0x1d8a04['push'](createTable(_0x31263d,_0x5b3b1b));});return _0x1d8a04;}function getPDFDocDefinition(_0x2ef981){var _0x146115=util[_0x1d25('0x18')](_0x1d25('0x19'),NAME,EXTRACTED_REPORT[_0x1d25('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x1d25('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x1d25('0x1b')])['format'](FORMAT));var _0x1f90d9=[];for(var _0x4f8638=0x0;_0x4f8638<_0x2ef981['length'];_0x4f8638++){var _0x27a084=[];if(_0x4f8638===0x0){_0x27a084[_0x1d25('0x1c')]({'text':_0x146115,'style':_0x1d25('0x1d')});}var _0x3e0adb={'table':_0x2ef981[_0x4f8638]};if(_0x4f8638>0x0){_0x3e0adb[_0x1d25('0x1e')]='before';_0x3e0adb['margin']=[0x0,0x46,0x0,0x0];}_0x27a084[_0x1d25('0x1c')](_0x3e0adb);_0x1f90d9[_0x1d25('0x1c')](_0x27a084);}return{'pageSize':'A4','pageOrientation':_0x1d25('0x1f'),'content':_0x1f90d9,'footer':function(_0x198e32,_0x3a1ad2){return{'text':_0x198e32[_0x1d25('0x10')]()+_0x1d25('0x20')+_0x3a1ad2,'style':_0x1d25('0x21')};},'defaultStyle':{'font':_0x1d25('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x1d25('0x23')},'footer':{'alignment':_0x1d25('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3aa69b){var _0x1a9cf7=0x1388;var _0x317f54;if(!_0x3aa69b[0x0][_0x1d25('0x25')]){return analyticExtractedReport('Empty');}var _0xeb2980=[];var _0x157188=0x0;var _0x21b598=!![];var _0x41856a=path['dirname'](PATH);var _0x5e8256=path[_0x1d25('0x26')](PATH,_0x1d25('0x27'));var _0x45202a=path[_0x1d25('0x28')](_0x41856a,util[_0x1d25('0x18')](_0x1d25('0x29'),_0x5e8256,_0x1d25('0x2a')));var _0x4262b5=![];return db[_0x1d25('0x2b')][_0x1d25('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1d25('0x2d')]})[_0x1d25('0x2e')](function(_0x26b1cc){if(_0x26b1cc){_0x317f54=_0x26b1cc;_0x1a9cf7=_0x317f54[_0x1d25('0x2d')]||0x3e8;}})[_0x1d25('0x2e')](function(){if(_0x3aa69b&&_0x3aa69b['length']){var _0x4c5b79=_0x3aa69b[0x0][_0x1d25('0x25')]%(_0x157188+_0x1a9cf7);if(_0x317f54[_0x1d25('0x2f')]){for(;_0x21b598;_0x157188+=_0x1a9cf7,_0x4c5b79=_0x3aa69b[0x0]['num']%(_0x157188+_0x1a9cf7)){if(_0x4c5b79==0x0||_0x4c5b79==_0x3aa69b[0x0][_0x1d25('0x25')]){_0x21b598=![];}_0xeb2980[_0x1d25('0x1c')](dbH[_0x1d25('0x30')][_0x1d25('0x31')](util[_0x1d25('0x18')](_0x1d25('0x32'),QUERY,_0x1a9cf7,_0x157188),{'type':dbH[_0x1d25('0x30')][_0x1d25('0x33')][_0x1d25('0x34')]}));}}else{_0xeb2980[_0x1d25('0x1c')](dbH[_0x1d25('0x30')]['query'](QUERY,{'type':dbH[_0x1d25('0x30')][_0x1d25('0x33')][_0x1d25('0x34')]}));}}_0x4262b5=_0x317f54[_0x1d25('0x2f')]&&_0xeb2980['length']>0x1;if(!fs[_0x1d25('0x35')](path[_0x1d25('0x28')](_0x41856a,_0x5e8256))&&_0x4262b5){fs[_0x1d25('0x36')](path[_0x1d25('0x28')](_0x41856a,_0x5e8256));}return Promise['all'](_0xeb2980);})[_0x1d25('0x2e')](function(_0x369a41){return createTables(_[_0x1d25('0x37')](_0x369a41));})[_0x1d25('0x2e')](function(_0x2adebe){var _0x57e6e2=getPDFDocDefinition(_0x2adebe);var _0x554058=getPDFPrinter();var _0xd10092=_0x554058[_0x1d25('0x38')](_0x57e6e2);if(_0x4262b5)_0x45202a=path[_0x1d25('0x28')](_0x41856a,_0x5e8256,util[_0x1d25('0x18')]('%s%d.%s',_0x5e8256,index,_0x1d25('0x2a')));return writePDFDocument(_0xd10092,_0x45202a);})['then'](function(){if(!_0x4262b5)return;zipdir(path[_0x1d25('0x28')](_0x41856a,_0x5e8256),{'saveTo':path[_0x1d25('0x28')](_0x41856a,util['format']('%s.%s',_0x5e8256,'zip'))},function(_0x196c48){if(_0x196c48)throw _0x196c48;return;});})[_0x1d25('0x2e')](function(){if(!_0x4262b5)return;rimraf(path[_0x1d25('0x28')](_0x41856a,_0x5e8256),function(){});})[_0x1d25('0x2e')](function(){logger['info'](util[_0x1d25('0x18')](_0x1d25('0x39'),EXTRACTED_REPORT_ID,_0x1d25('0x3a')));return analyticExtractedReport(_0x1d25('0x3b'),_0x4262b5?util[_0x1d25('0x18')](_0x1d25('0x29'),_0x5e8256,_0x4262b5?_0x1d25('0x3c'):_0x1d25('0x2a')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1d25('0x3d')](util[_0x1d25('0x18')](_0x1d25('0x3e'),EXTRACTED_REPORT_ID,_0x1d25('0x3f')));return db[_0x1d25('0xc')][_0x1d25('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1d25('0x2e')](function(_0x4172d7){EXTRACTED_REPORT=_0x4172d7;return dbH[_0x1d25('0x30')][_0x1d25('0x31')](util[_0x1d25('0x18')](_0x1d25('0x41'),QUERY),{'type':dbH[_0x1d25('0x30')][_0x1d25('0x33')]['SELECT']});})[_0x1d25('0x2e')](extractReport)['catch'](function(_0x2c88ab){logger[_0x1d25('0x3d')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1d25('0x3f')),util[_0x1d25('0x42')](_0x2c88ab,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1d25('0x43'));})['finally'](function(){process[_0x1d25('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3b2536=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x1d25('0x45'),'italics':__dirname+_0x1d25('0x46'),'bolditalics':__dirname+_0x1d25('0x47')}});return _0x3b2536;}function getPDFDocDefinitionFromHTML(_0x3f45ad,_0x15d555){var _0x2744d0=util[_0x1d25('0x18')](_0x1d25('0x48'),_0x15d555['channel'],_0x15d555[_0x1d25('0x49')]);var _0x236ebf=moment()['format'](_0x1d25('0x4a'))[_0x1d25('0x10')]();var _0x96b897=htmlToPdfmake(_0x3f45ad,{'window':window,'tableAutoSize':!![]});return{'content':[_0x96b897],'defaultStyle':{'font':_0x1d25('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1d25('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1d25('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x1d25('0x4c'),'style':'header'}];},'footer':function(_0x170d2d,_0x362947){return[{'text':util['format'](_0x1d25('0x4d'),_0x2744d0,_0x170d2d,_0x362947,_0x236ebf),'style':_0x1d25('0x21')}];}};}function writePDFDocument(_0x2a4178,_0x2ce568){return new Promise(function(_0xf031b6,_0x3b4c4a){var _0x557cd5=_0x2a4178[_0x1d25('0x4e')](fs[_0x1d25('0x4f')](_0x2ce568));_0x557cd5['on'](_0x1d25('0x50'),function(){_0xf031b6(_0x1d25('0x50'));});_0x557cd5['on'](_0x1d25('0x51'),function(_0xe5716e){_0x3b4c4a(_0xe5716e);});_0x2a4178[_0x1d25('0x52')]();});}exports[_0x1d25('0x53')]=function(_0x2bac66,_0x2f7474){var _0x51ff04=getPDFPrinter();var _0x128b33=getPDFDocDefinitionFromHTML(_0x2bac66,_0x2f7474);var _0x54dd22=_0x51ff04['createPdfKitDocument'](_0x128b33);return writePDFDocument(_0x54dd22,_0x2f7474[_0x1d25('0x1')])['catch'](function(_0x4a3d5e){throw _0x4a3d5e;});};
\ No newline at end of file
index 87def6f..5342cef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe237=['dbH','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','Empty','split','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','zip','XLSX','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x331ba6,_0x5c37a1){var _0x45de38=function(_0x1965e0){while(--_0x1965e0){_0x331ba6['push'](_0x331ba6['shift']());}};_0x45de38(++_0x5c37a1);}(_0xe237,0xe9));var _0x7e23=function(_0x1919c2,_0x4d04af){_0x1919c2=_0x1919c2-0x0;var _0x5e1451=_0xe237[_0x1919c2];return _0x5e1451;};'use strict';var util=require(_0x7e23('0x0'));var path=require('path');var _=require(_0x7e23('0x1'));var fs=require('fs');var json2xls=require(_0x7e23('0x2'));var BPromise=require(_0x7e23('0x3'));var zipdir=require(_0x7e23('0x4'));var rimraf=require(_0x7e23('0x5'));var db=require(_0x7e23('0x6'))['db'];var dbH=require(_0x7e23('0x6'))[_0x7e23('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7e23('0x8')][0x2]);var QUERY=process[_0x7e23('0x8')][0x3];var PATH=process[_0x7e23('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x45762b,_0x5ef57e){var _0xb7d452={'status':_0x45762b};var _0x1d239b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5ef57e){_0xb7d452[_0x7e23('0x9')]=_0x5ef57e;}return db[_0x7e23('0xa')][_0x7e23('0xb')](_0xb7d452,_0x1d239b);}function main(){var _0x501939=0x1388;var _0x113b0d;logger[_0x7e23('0xc')](util[_0x7e23('0xd')](_0x7e23('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x7e23('0xf')][_0x7e23('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7e23('0x11')]})[_0x7e23('0x12')](function(_0x4f3b1c){if(_0x4f3b1c){_0x113b0d=_0x4f3b1c;_0x501939=_0x113b0d[_0x7e23('0x11')]||0x1388;}})[_0x7e23('0x12')](function(){return dbH['sequelize'][_0x7e23('0x13')](util[_0x7e23('0xd')](_0x7e23('0x14'),QUERY),{'type':dbH[_0x7e23('0x15')][_0x7e23('0x16')]['SELECT']});})['then'](function(_0x1d2607){if(!_0x1d2607[0x0]['num']){return analyticExtractedReport(_0x7e23('0x17'));}var _0x86f2f2=[];var _0x1a16f9=0x0;var _0x37789a=!![];if(_0x113b0d[_0x7e23('0x18')]){if(_0x1d2607&&_0x1d2607[_0x7e23('0x19')]){var _0x37d760=_0x1d2607[0x0][_0x7e23('0x1a')]%(_0x1a16f9+_0x501939);for(;_0x37789a;_0x1a16f9+=_0x501939,_0x37d760=_0x1d2607[0x0][_0x7e23('0x1a')]%(_0x1a16f9+_0x501939)){if(_0x37d760==0x0||_0x37d760==_0x1d2607[0x0][_0x7e23('0x1a')]){_0x37789a=![];}_0x86f2f2[_0x7e23('0x1b')](dbH[_0x7e23('0x15')]['query'](util[_0x7e23('0xd')](_0x7e23('0x1c'),QUERY,_0x501939,_0x1a16f9),{'type':dbH['sequelize'][_0x7e23('0x16')][_0x7e23('0x1d')]}));}}}else{_0x86f2f2[_0x7e23('0x1b')](dbH[_0x7e23('0x15')]['query'](QUERY,{'type':dbH[_0x7e23('0x15')][_0x7e23('0x16')][_0x7e23('0x1d')]}));}var _0x4460f5=path[_0x7e23('0x1e')](PATH);var _0x576b92=path['basename'](PATH,_0x7e23('0x1f'));var _0x4e9c46=_0x113b0d[_0x7e23('0x18')]&&_0x86f2f2[_0x7e23('0x19')]>0x1;var _0x7c9c01=[];if(!fs[_0x7e23('0x20')](path[_0x7e23('0x21')](_0x4460f5,_0x576b92))&&_0x4e9c46){fs[_0x7e23('0x22')](path[_0x7e23('0x21')](_0x4460f5,_0x576b92));}return BPromise['each'](_0x86f2f2,function(_0x554941){_0x7c9c01['push'](_0x554941);})[_0x7e23('0x12')](function(){for(var _0x7dd6bf=0x0;_0x7dd6bf<_0x7c9c01[_0x7e23('0x19')];_0x7dd6bf+=0x1){var _0x365d51;var _0x450f9d=_0x7c9c01[_0x7dd6bf];if(_0x4e9c46){_0x365d51=path[_0x7e23('0x21')](_0x4460f5,_0x576b92,util['format'](_0x7e23('0x23'),_0x576b92,_0x7dd6bf,_0x7e23('0x24')));}else{_0x365d51=path[_0x7e23('0x21')](_0x4460f5,util[_0x7e23('0xd')]('%s.%s',_0x576b92,'xlsx'));}fs[_0x7e23('0x25')](_0x365d51,json2xls(_0x450f9d),_0x7e23('0x26'));}})[_0x7e23('0x12')](function(){if(_0x4e9c46){zipdir(path[_0x7e23('0x21')](_0x4460f5,_0x576b92),{'saveTo':path[_0x7e23('0x21')](_0x4460f5,util['format']('%s.%s',_0x576b92,_0x7e23('0x27')))},function(_0xc560f4,_0x2b9961){});rimraf(path['join'](_0x4460f5,_0x576b92),function(){});}})[_0x7e23('0x12')](function(){logger['info'](util[_0x7e23('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7e23('0x28')));return analyticExtractedReport(_0x7e23('0x29'),_0x4e9c46?util['format'](_0x7e23('0x2a'),_0x576b92,_0x4e9c46?_0x7e23('0x27'):_0x7e23('0x24')):null);});})[_0x7e23('0x2b')](function(_0x1fe750){logger['info'](util[_0x7e23('0xd')](_0x7e23('0x2c'),EXTRACTED_REPORT_ID,_0x7e23('0x28')),util[_0x7e23('0x2d')](_0x1fe750,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7e23('0x2e'));})[_0x7e23('0x2f')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x87fa=['sequelize','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','format','xlsx','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','path','lodash','json2xls','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','update','info','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x4ccdbf,_0x2361ec){var _0x20d142=function(_0x34815d){while(--_0x34815d){_0x4ccdbf['push'](_0x4ccdbf['shift']());}};_0x20d142(++_0x2361ec);}(_0x87fa,0x6d));var _0xa87f=function(_0x4f8327,_0x495af0){_0x4f8327=_0x4f8327-0x0;var _0x18caff=_0x87fa[_0x4f8327];return _0x18caff;};'use strict';var util=require('util');var path=require(_0xa87f('0x0'));var _=require(_0xa87f('0x1'));var fs=require('fs');var json2xls=require(_0xa87f('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xa87f('0x3'));var db=require(_0xa87f('0x4'))['db'];var dbH=require(_0xa87f('0x4'))['dbH'];var logger=require(_0xa87f('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa87f('0x6')][0x2]);var QUERY=process[_0xa87f('0x6')][0x3];var PATH=process[_0xa87f('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4adc8b,_0x2ac0b7){var _0x2b005b={'status':_0x4adc8b};var _0xfcba1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ac0b7){_0x2b005b['savename']=_0x2ac0b7;}return db[_0xa87f('0x7')][_0xa87f('0x8')](_0x2b005b,_0xfcba1);}function main(){var _0x2b9c69=0x1388;var _0x262467;logger[_0xa87f('0x9')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xa87f('0xa')][_0xa87f('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa87f('0xc'),_0xa87f('0xd')]})['then'](function(_0x2742aa){if(_0x2742aa){_0x262467=_0x2742aa;_0x2b9c69=_0x262467['splitSizeXlsx']||0x1388;}})[_0xa87f('0xe')](function(){return dbH['sequelize'][_0xa87f('0xf')](util['format'](_0xa87f('0x10'),QUERY),{'type':dbH[_0xa87f('0x11')]['QueryTypes'][_0xa87f('0x12')]});})[_0xa87f('0xe')](function(_0x9f070c){if(!_0x9f070c[0x0][_0xa87f('0x13')]){return analyticExtractedReport(_0xa87f('0x14'));}var _0x4cad89=[];var _0x326390=0x0;var _0xb5f75e=!![];if(_0x262467['split']){if(_0x9f070c&&_0x9f070c['length']){var _0x33c965=_0x9f070c[0x0][_0xa87f('0x13')]%(_0x326390+_0x2b9c69);for(;_0xb5f75e;_0x326390+=_0x2b9c69,_0x33c965=_0x9f070c[0x0][_0xa87f('0x13')]%(_0x326390+_0x2b9c69)){if(_0x33c965==0x0||_0x33c965==_0x9f070c[0x0]['num']){_0xb5f75e=![];}_0x4cad89[_0xa87f('0x15')](dbH[_0xa87f('0x11')]['query'](util['format'](_0xa87f('0x16'),QUERY,_0x2b9c69,_0x326390),{'type':dbH['sequelize'][_0xa87f('0x17')][_0xa87f('0x12')]}));}}}else{_0x4cad89[_0xa87f('0x15')](dbH[_0xa87f('0x11')][_0xa87f('0xf')](QUERY,{'type':dbH[_0xa87f('0x11')][_0xa87f('0x17')][_0xa87f('0x12')]}));}var _0x31dab8=path[_0xa87f('0x18')](PATH);var _0x3f56bb=path[_0xa87f('0x19')](PATH,_0xa87f('0x1a'));var _0x413971=_0x262467['split']&&_0x4cad89[_0xa87f('0x1b')]>0x1;var _0x59fee8=[];if(!fs[_0xa87f('0x1c')](path[_0xa87f('0x1d')](_0x31dab8,_0x3f56bb))&&_0x413971){fs[_0xa87f('0x1e')](path[_0xa87f('0x1d')](_0x31dab8,_0x3f56bb));}return BPromise['each'](_0x4cad89,function(_0x398d24){_0x59fee8['push'](_0x398d24);})['then'](function(){for(var _0x5cde2a=0x0;_0x5cde2a<_0x59fee8[_0xa87f('0x1b')];_0x5cde2a+=0x1){var _0x431193;var _0x1ccc6e=_0x59fee8[_0x5cde2a];if(_0x413971){_0x431193=path[_0xa87f('0x1d')](_0x31dab8,_0x3f56bb,util[_0xa87f('0x1f')]('%s%d.%s',_0x3f56bb,_0x5cde2a,_0xa87f('0x20')));}else{_0x431193=path[_0xa87f('0x1d')](_0x31dab8,util[_0xa87f('0x1f')]('%s.%s',_0x3f56bb,_0xa87f('0x20')));}fs[_0xa87f('0x21')](_0x431193,json2xls(_0x1ccc6e),'binary');}})[_0xa87f('0xe')](function(){if(_0x413971){zipdir(path['join'](_0x31dab8,_0x3f56bb),{'saveTo':path['join'](_0x31dab8,util[_0xa87f('0x1f')](_0xa87f('0x22'),_0x3f56bb,_0xa87f('0x23')))},function(_0x5eb8b4,_0x361f4d){});rimraf(path[_0xa87f('0x1d')](_0x31dab8,_0x3f56bb),function(){});}})[_0xa87f('0xe')](function(){logger[_0xa87f('0x9')](util[_0xa87f('0x1f')](_0xa87f('0x24'),EXTRACTED_REPORT_ID,_0xa87f('0x25')));return analyticExtractedReport(_0xa87f('0x26'),_0x413971?util['format']('%s.%s',_0x3f56bb,_0x413971?_0xa87f('0x23'):_0xa87f('0x20')):null);});})['catch'](function(_0x47da46){logger[_0xa87f('0x9')](util[_0xa87f('0x1f')](_0xa87f('0x27'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x47da46,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa87f('0x28'));})['finally'](function(){process[_0xa87f('0x29')](EXIT_CODE);});}main();
\ No newline at end of file
index b715394..20f0e73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3117=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','priority','find','exten','extensions','push','Set','format','context','type','inbound','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','*,*,*,*','interval','filter','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1'];(function(_0x186d8a,_0x1a3ac0){var _0x31c082=function(_0x78644d){while(--_0x78644d){_0x186d8a['push'](_0x186d8a['shift']());}};_0x31c082(++_0x1a3ac0);}(_0x3117,0x165));var _0x7311=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x3117[_0x2261ce];return _0x524640;};'use strict';var _=require(_0x7311('0x0'));var util=require(_0x7311('0x1'));function rewrite(_0x3ec0e1,_0x10117e){var _0x5e3f72=this;return _0x3ec0e1[_0x7311('0x2')][_0x7311('0x3')][_0x7311('0x4')]({'raw':!![]})[_0x7311('0x5')](function(_0x14e555){_0x5e3f72[_0x7311('0x6')]=_0x14e555;return _0x3ec0e1[_0x7311('0x2')][_0x7311('0x7')][_0x7311('0x4')]({'where':{'IntervalId':_0x10117e[_0x7311('0x8')]},'raw':!![]});})[_0x7311('0x5')](function(_0x4f01e4){return _0x3ec0e1[_0x7311('0x2')][_0x7311('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x7311('0x9')](_[_0x7311('0xa')](_0x4f01e4,'exten'))}},'order':[{'raw':_0x7311('0xb')}],'raw':!![]});})[_0x7311('0x5')](function(_0x57aa61){var _0x292da6=_['filter'](_0x57aa61,{'priority':'1'});var _0xf445a9=_['filter'](_0x57aa61,{'isApp':0x1});var _0x2ac5aa=_[_0x7311('0xc')](_0xf445a9,'exten');var _0x48cce6=[_0x7311('0xd'),'playback'];var _0x15840b=[];var _0x37322d=[];for(var _0x47963 in _0x2ac5aa){if(_0x2ac5aa['hasOwnProperty'](_0x47963)){_0x5e3f72[_0x7311('0xe')]=0x2;_0x5e3f72['extensions']=[];_0x5e3f72['extension']=_[_0x7311('0xf')](_0x292da6,{'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')]});_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0]['type'],'app':_0x7311('0x13'),'appdata':util[_0x7311('0x14')]('CDR(type)=%s',_0x2ac5aa[_0x47963][0x0]['type']),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'priority':_0x5e3f72['priority']++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0]['VoiceExtensionId']});if(_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')]===_0x7311('0x17')){_0x5e3f72[_0x7311('0x11')]['push']({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':'Set','appdata':_0x7311('0x18')+_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')],'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});}else if(_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')]===_0x7311('0x1a')){if(_0x5e3f72[_0x7311('0x1b')]){_0x5e3f72[_0x7311('0x11')]['push']({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x7311('0x1c')+(_0x5e3f72[_0x7311('0x1b')]['cutdigits']?_0x7311('0x1d')+_0x5e3f72[_0x7311('0x1b')]['cutdigits']+'}':_0x7311('0x1e')),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});}_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':'Set','appdata':_0x7311('0x18')+_0x2ac5aa[_0x47963][0x0]['VoiceExtensionId'],'context':_0x2ac5aa[_0x47963][0x0]['context'],'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});var _0x41a761=_0x5e3f72[_0x7311('0xe')]++;_0x5e3f72[_0x7311('0x11')]['push']({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x41a761+0x2)+_0x7311('0x20')+(_0x41a761+0x1)+')','context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x41a761,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});if(_0x5e3f72[_0x7311('0x1b')]){_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x5e3f72[_0x7311('0x1b')][_0x7311('0x21')]?_0x7311('0x22')+_0x5e3f72[_0x7311('0x1b')][_0x7311('0x21')]+'}':_0x7311('0x23'),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});}_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0]['type'],'app':_0x7311('0x13'),'appdata':'outboundrouteid='+_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')],'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});if(_0x5e3f72[_0x7311('0x1b')]&&_0x5e3f72[_0x7311('0x1b')][_0x7311('0x24')](_0x7311('0x25'))&&_0x5e3f72[_0x7311('0x1b')]['recordingFormat']!=='none'){_0x5e3f72['extensions'][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0]['type'],'app':_0x7311('0x13'),'appdata':_0x7311('0x26')+_0x5e3f72[_0x7311('0x1b')]['recordingFormat']||'wav','context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});}}_0x5e3f72['extensions']['push']({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x7311('0x27'),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x7311('0x28'),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});_0x5e3f72[_0x7311('0x11')][_0x7311('0x12')]({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':'Set','appdata':_0x7311('0x29'),'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'exten':_0x2ac5aa[_0x47963][0x0]['exten'],'priority':_0x5e3f72[_0x7311('0xe')]++,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});for(var _0x46ef19=0x0,_0x2dce09=0x0;_0x46ef19<_0x2ac5aa[_0x47963][_0x7311('0x2a')];_0x46ef19+=0x1,_0x2dce09=0x0){var _0x23623e=_0x2ac5aa[_0x47963][_0x46ef19];if(_0x23623e[_0x7311('0x16')]){_0x23623e[_0x7311('0x16')]=_0x23623e[_0x7311('0x16')][_0x7311('0x2b')]();}var _0x31fc44=[];var _0x122639=[];delete _0x23623e['id'];delete _0x23623e['createdAt'];delete _0x23623e[_0x7311('0x2c')];var _0x38d995=_0x23623e['interval']!==_0x7311('0x2d')?[_0x23623e[_0x7311('0x2e')]]:_0x23623e['IntervalId']?_[_0x7311('0xa')](_[_0x7311('0x2f')](_0x5e3f72[_0x7311('0x6')],{'IntervalId':_0x23623e[_0x7311('0x8')]}),_0x7311('0x2e')):[];if(_0x23623e[_0x7311('0x24')]('tag')){if(_0x23623e[_0x7311('0x30')]&&_0x23623e[_0x7311('0x30')]!=='--'){_0x31fc44[_0x7311('0x12')]({'type':_0x23623e[_0x7311('0x16')],'app':'Set','appdata':'CDR(tag)='+_0x23623e['tag'],'context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995['length']+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});}}if(_0x23623e['type']==='outbound'&&_0x23623e[_0x7311('0x24')](_0x7311('0x31'))){if(_0x23623e[_0x7311('0x31')]){_0x31fc44[_0x7311('0x12')]({'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x1f'),'appdata':_0x7311('0x32')+_0x23623e[_0x7311('0x31')]+')','context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});}else{_0x31fc44[_0x7311('0x12')]({'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x1f'),'appdata':_0x7311('0x33'),'context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});}}if(_0x23623e[_0x7311('0x24')]('answer')){if(_0x48cce6['indexOf'](_0x23623e[_0x7311('0x34')][_0x7311('0x2b')]())>=0x0&&_0x23623e[_0x7311('0x35')]!==_0x7311('0x36')){if(_0x23623e[_0x7311('0x37')]){_0x31fc44[_0x7311('0x12')]({'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});_0x31fc44[_0x7311('0x12')]({'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x7311('0x38'),'context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});}else{_0x31fc44[_0x7311('0x12')]({'type':_0x23623e['type'],'app':_0x7311('0x1f'),'appdata':_0x7311('0x39'),'context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e[_0x7311('0x10')],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});_0x31fc44['push']({'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x13'),'appdata':_0x7311('0x3a'),'context':_0x23623e[_0x7311('0x15')],'exten':_0x23623e['exten'],'priority':_0x38d995[_0x7311('0x2a')]+_0x5e3f72[_0x7311('0xe')]+_0x2dce09++,'VoiceExtensionId':_0x23623e[_0x7311('0x19')]});}}}for(var _0x25848f=0x0;_0x25848f<_0x38d995['length'];_0x25848f+=0x1){var _0x29b425=_0x5e3f72[_0x7311('0xe')]+_0x38d995[_0x7311('0x2a')];var _0x38f845=_0x25848f===_0x38d995['length']-0x1?_0x5e3f72[_0x7311('0xe')]+_0x31fc44[_0x7311('0x2a')]+_0x122639[_0x7311('0x2a')]+0x2:_0x5e3f72['priority']+_0x25848f+0x1;_0x31fc44[_0x7311('0x3b')](_0x25848f,0x0,{'type':_0x23623e[_0x7311('0x16')],'app':_0x7311('0x3c'),'appdata':_0x38d995[_0x25848f]+'?'+_0x23623e[_0x7311('0x15')]+_0x7311('0x3d')+_0x29b425+':'+_0x23623e[_0x7311('0x15')]+_0x7311('0x3d')+_0x38f845,'exten':_0x23623e[_0x7311('0x10')],'context':_0x23623e[_0x7311('0x15')],'priority':_0x5e3f72[_0x7311('0xe')]+_0x25848f,'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0][_0x7311('0x19')]});}_0x23623e[_0x7311('0xe')]=_0x31fc44[_0x7311('0x2a')]?_[_0x7311('0x3e')](_0x31fc44)[_0x7311('0xe')]+0x1:_0x5e3f72[_0x7311('0xe')];_0x5e3f72[_0x7311('0xe')]=(_0x122639[_0x7311('0x2a')]?_[_0x7311('0x3e')](_0x122639)[_0x7311('0xe')]:_0x23623e[_0x7311('0xe')])+0x1;_0x5e3f72[_0x7311('0x11')]=_['concat'](_0x5e3f72[_0x7311('0x11')],_0x31fc44,[_0x23623e],_0x122639);}_0x5e3f72[_0x7311('0x11')]['push']({'type':_0x2ac5aa[_0x47963][0x0][_0x7311('0x16')],'app':_0x7311('0x3f'),'exten':_0x2ac5aa[_0x47963][0x0][_0x7311('0x10')],'context':_0x2ac5aa[_0x47963][0x0][_0x7311('0x15')],'priority':_0x5e3f72[_0x7311('0xe')],'VoiceExtensionId':_0x2ac5aa[_0x47963][0x0]['VoiceExtensionId']});_0x15840b[_0x7311('0x12')](_0x2ac5aa[_0x47963][0x0]['VoiceExtensionId']);_0x37322d=_[_0x7311('0x40')](_0x37322d,_0x5e3f72[_0x7311('0x11')]);}}return _0x3ec0e1[_0x7311('0x41')](function(_0x14e2b3){return _0x3ec0e1[_0x7311('0x2')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x15840b}},'transaction':_0x14e2b3})[_0x7311('0x5')](function(_0x26a44f){return _0x3ec0e1[_0x7311('0x2')][_0x7311('0x7')][_0x7311('0x42')](_[_0x7311('0x43')](_0x37322d,_0x7311('0xe')),{'transaction':_0x14e2b3});});});})['catch'](function(_0x21aa74){console[_0x7311('0x44')](_0x21aa74);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0xccb9=['rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extension','extensions','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','priority','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xccb9,0x173));var _0x9ccb=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xccb9[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x9ccb('0x0'));var util=require(_0x9ccb('0x1'));function rewrite(_0x757d40,_0x390fa4){var _0x16872a=this;return _0x757d40[_0x9ccb('0x2')][_0x9ccb('0x3')][_0x9ccb('0x4')]({'raw':!![]})[_0x9ccb('0x5')](function(_0x4a6d56){_0x16872a[_0x9ccb('0x6')]=_0x4a6d56;return _0x757d40['models'][_0x9ccb('0x7')][_0x9ccb('0x4')]({'where':{'IntervalId':_0x390fa4[_0x9ccb('0x8')]},'raw':!![]});})[_0x9ccb('0x5')](function(_0x5ba945){return _0x757d40['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x9ccb('0x9')](_0x5ba945,_0x9ccb('0xa')))}},'order':[{'raw':_0x9ccb('0xb')}],'raw':!![]});})[_0x9ccb('0x5')](function(_0x30e0d2){var _0x493331=_[_0x9ccb('0xc')](_0x30e0d2,{'priority':'1'});var _0xeca501=_[_0x9ccb('0xc')](_0x30e0d2,{'isApp':0x1});var _0x5880e4=_[_0x9ccb('0xd')](_0xeca501,'exten');var _0x317bad=[_0x9ccb('0xe'),_0x9ccb('0xf')];var _0x57e89e=[];var _0x1d0a73=[];for(var _0xf27d7b in _0x5880e4){if(_0x5880e4['hasOwnProperty'](_0xf27d7b)){_0x16872a['priority']=0x2;_0x16872a['extensions']=[];_0x16872a[_0x9ccb('0x10')]=_['find'](_0x493331,{'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')]});_0x16872a[_0x9ccb('0x11')]['push']({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x12'),'appdata':util[_0x9ccb('0x13')](_0x9ccb('0x14'),_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')]),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0]['exten'],'priority':_0x16872a['priority']++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});if(_0x5880e4[_0xf27d7b][0x0]['type']===_0x9ccb('0x18')){_0x16872a[_0x9ccb('0x11')]['push']({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x12'),'appdata':'CDR(routeid)='+_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')],'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a['priority']++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});}else if(_0x5880e4[_0xf27d7b][0x0]['type']==='outbound'){if(_0x16872a[_0x9ccb('0x10')]){_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x1a')+(_0x16872a[_0x9ccb('0x10')][_0x9ccb('0x1b')]?'${EXTEN:'+_0x16872a[_0x9ccb('0x10')][_0x9ccb('0x1b')]+'}':_0x9ccb('0x1c')),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a['priority']++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0]['VoiceExtensionId']});}_0x16872a['extensions'][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x1d')+_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')],'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});var _0x325e10=_0x16872a[_0x9ccb('0x1e')]++;_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x325e10+0x2)+'):Goto('+(_0x325e10+0x1)+')','context':_0x5880e4[_0xf27d7b][0x0]['context'],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x325e10,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});if(_0x16872a[_0x9ccb('0x10')]){_0x16872a['extensions'][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x16872a['extension'][_0x9ccb('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x16872a[_0x9ccb('0x10')][_0x9ccb('0x1b')]+'}':_0x9ccb('0x1f'),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});}_0x16872a['extensions'][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x20')+_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')],'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});if(_0x16872a[_0x9ccb('0x10')]&&_0x16872a[_0x9ccb('0x10')][_0x9ccb('0x21')](_0x9ccb('0x22'))&&_0x16872a['extension'][_0x9ccb('0x22')]!=='none'){_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x23'),'context':_0x5880e4[_0xf27d7b][0x0]['context'],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});_0x16872a[_0x9ccb('0x11')]['push']({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x24')+_0x16872a[_0x9ccb('0x10')][_0x9ccb('0x22')]||_0x9ccb('0x25'),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0]['exten'],'priority':_0x16872a['priority']++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0]['VoiceExtensionId']});}}_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x26'),'context':_0x5880e4[_0xf27d7b][0x0]['context'],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});_0x16872a[_0x9ccb('0x11')]['push']({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x27'),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x28'),'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'exten':_0x5880e4[_0xf27d7b][0x0]['exten'],'priority':_0x16872a[_0x9ccb('0x1e')]++,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});for(var _0x42dc00=0x0,_0x2a2745=0x0;_0x42dc00<_0x5880e4[_0xf27d7b][_0x9ccb('0x29')];_0x42dc00+=0x1,_0x2a2745=0x0){var _0x67ebc8=_0x5880e4[_0xf27d7b][_0x42dc00];if(_0x67ebc8[_0x9ccb('0x15')]){_0x67ebc8[_0x9ccb('0x15')]=_0x67ebc8[_0x9ccb('0x15')][_0x9ccb('0x2a')]();}var _0x33580e=[];var _0x4ce1d8=[];delete _0x67ebc8['id'];delete _0x67ebc8[_0x9ccb('0x2b')];delete _0x67ebc8[_0x9ccb('0x2c')];var _0x316f2b=_0x67ebc8[_0x9ccb('0x2d')]!==_0x9ccb('0x2e')?[_0x67ebc8['interval']]:_0x67ebc8[_0x9ccb('0x8')]?_[_0x9ccb('0x9')](_[_0x9ccb('0xc')](_0x16872a[_0x9ccb('0x6')],{'IntervalId':_0x67ebc8['IntervalId']}),'interval'):[];if(_0x67ebc8[_0x9ccb('0x21')]('tag')){if(_0x67ebc8[_0x9ccb('0x2f')]&&_0x67ebc8[_0x9ccb('0x2f')]!=='--'){_0x33580e['push']({'type':_0x67ebc8[_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':'CDR(tag)='+_0x67ebc8[_0x9ccb('0x2f')],'context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b[_0x9ccb('0x29')]+_0x16872a[_0x9ccb('0x1e')]+_0x2a2745++,'VoiceExtensionId':_0x67ebc8[_0x9ccb('0x17')]});}}if(_0x67ebc8[_0x9ccb('0x15')]===_0x9ccb('0x30')&&_0x67ebc8['hasOwnProperty'](_0x9ccb('0x31'))){if(_0x67ebc8[_0x9ccb('0x31')]){_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8['type'],'app':'ExecIf','appdata':_0x9ccb('0x32')+_0x67ebc8[_0x9ccb('0x31')]+')','context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b[_0x9ccb('0x29')]+_0x16872a[_0x9ccb('0x1e')]+_0x2a2745++,'VoiceExtensionId':_0x67ebc8[_0x9ccb('0x17')]});}else{_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8[_0x9ccb('0x15')],'app':_0x9ccb('0x33'),'appdata':_0x9ccb('0x34'),'context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b['length']+_0x16872a['priority']+_0x2a2745++,'VoiceExtensionId':_0x67ebc8['VoiceExtensionId']});}}if(_0x67ebc8[_0x9ccb('0x21')](_0x9ccb('0x35'))){if(_0x317bad[_0x9ccb('0x36')](_0x67ebc8[_0x9ccb('0x37')]['toLowerCase']())>=0x0&&_0x67ebc8[_0x9ccb('0x38')]!==_0x9ccb('0x39')){if(_0x67ebc8[_0x9ccb('0x35')]){_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8[_0x9ccb('0x15')],'app':_0x9ccb('0x33'),'appdata':_0x9ccb('0x3a'),'context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b['length']+_0x16872a[_0x9ccb('0x1e')]+_0x2a2745++,'VoiceExtensionId':_0x67ebc8['VoiceExtensionId']});_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8[_0x9ccb('0x15')],'app':_0x9ccb('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b[_0x9ccb('0x29')]+_0x16872a['priority']+_0x2a2745++,'VoiceExtensionId':_0x67ebc8[_0x9ccb('0x17')]});}else{_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8[_0x9ccb('0x15')],'app':'ExecIf','appdata':_0x9ccb('0x3b'),'context':_0x67ebc8[_0x9ccb('0x16')],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b[_0x9ccb('0x29')]+_0x16872a[_0x9ccb('0x1e')]+_0x2a2745++,'VoiceExtensionId':_0x67ebc8[_0x9ccb('0x17')]});_0x33580e[_0x9ccb('0x19')]({'type':_0x67ebc8['type'],'app':_0x9ccb('0x12'),'appdata':_0x9ccb('0x3c'),'context':_0x67ebc8['context'],'exten':_0x67ebc8[_0x9ccb('0xa')],'priority':_0x316f2b[_0x9ccb('0x29')]+_0x16872a[_0x9ccb('0x1e')]+_0x2a2745++,'VoiceExtensionId':_0x67ebc8[_0x9ccb('0x17')]});}}}for(var _0x3cc779=0x0;_0x3cc779<_0x316f2b[_0x9ccb('0x29')];_0x3cc779+=0x1){var _0x11cbf2=_0x16872a['priority']+_0x316f2b['length'];var _0xc8211f=_0x3cc779===_0x316f2b[_0x9ccb('0x29')]-0x1?_0x16872a['priority']+_0x33580e[_0x9ccb('0x29')]+_0x4ce1d8[_0x9ccb('0x29')]+0x2:_0x16872a[_0x9ccb('0x1e')]+_0x3cc779+0x1;_0x33580e[_0x9ccb('0x3d')](_0x3cc779,0x0,{'type':_0x67ebc8[_0x9ccb('0x15')],'app':_0x9ccb('0x3e'),'appdata':_0x316f2b[_0x3cc779]+'?'+_0x67ebc8['context']+',${EXTEN},'+_0x11cbf2+':'+_0x67ebc8[_0x9ccb('0x16')]+_0x9ccb('0x3f')+_0xc8211f,'exten':_0x67ebc8[_0x9ccb('0xa')],'context':_0x67ebc8[_0x9ccb('0x16')],'priority':_0x16872a[_0x9ccb('0x1e')]+_0x3cc779,'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x17')]});}_0x67ebc8[_0x9ccb('0x1e')]=_0x33580e['length']?_[_0x9ccb('0x40')](_0x33580e)[_0x9ccb('0x1e')]+0x1:_0x16872a[_0x9ccb('0x1e')];_0x16872a[_0x9ccb('0x1e')]=(_0x4ce1d8[_0x9ccb('0x29')]?_[_0x9ccb('0x40')](_0x4ce1d8)[_0x9ccb('0x1e')]:_0x67ebc8[_0x9ccb('0x1e')])+0x1;_0x16872a[_0x9ccb('0x11')]=_[_0x9ccb('0x41')](_0x16872a[_0x9ccb('0x11')],_0x33580e,[_0x67ebc8],_0x4ce1d8);}_0x16872a[_0x9ccb('0x11')][_0x9ccb('0x19')]({'type':_0x5880e4[_0xf27d7b][0x0]['type'],'app':_0x9ccb('0x42'),'exten':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0xa')],'context':_0x5880e4[_0xf27d7b][0x0][_0x9ccb('0x16')],'priority':_0x16872a['priority'],'VoiceExtensionId':_0x5880e4[_0xf27d7b][0x0]['VoiceExtensionId']});_0x57e89e[_0x9ccb('0x19')](_0x5880e4[_0xf27d7b][0x0]['VoiceExtensionId']);_0x1d0a73=_[_0x9ccb('0x41')](_0x1d0a73,_0x16872a[_0x9ccb('0x11')]);}}return _0x757d40[_0x9ccb('0x43')](function(_0x4762db){return _0x757d40['models'][_0x9ccb('0x7')][_0x9ccb('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x57e89e}},'transaction':_0x4762db})[_0x9ccb('0x5')](function(_0x43a751){return _0x757d40[_0x9ccb('0x2')][_0x9ccb('0x7')][_0x9ccb('0x45')](_[_0x9ccb('0x46')](_0x1d0a73,_0x9ccb('0x1e')),{'transaction':_0x4762db});});});})[_0x9ccb('0x47')](function(_0x236c9f){console[_0x9ccb('0x48')](_0x236c9f);});}exports[_0x9ccb('0x49')]=rewrite;
\ No newline at end of file
index 0ae38ca..caa6ded 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd450=['firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','Error\x20while\x20creating\x20contact:\x20','insert','cm_hopper','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','query','sequelize','catch','VoiceQueueId','all','CmList','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','stringify','CSV\x20import\x20process\x20stopped!','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','papaparse','../../../config/logger','api','defaults','redis','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','test','isNil','errors','map','message','join','hasOwnProperty','data','firstName'];(function(_0xb7d36a,_0x3fd7b1){var _0x545ed8=function(_0x3f8e18){while(--_0x3f8e18){_0xb7d36a['push'](_0xb7d36a['shift']());}};_0x545ed8(++_0x3fd7b1);}(_0xd450,0x1e8));var _0x0d45=function(_0x318153,_0x395f45){_0x318153=_0x318153-0x0;var _0x32ff76=_0xd450[_0x318153];return _0x32ff76;};'use strict';var BPromise=require(_0x0d45('0x0'));var util=require('util');var _=require(_0x0d45('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x0d45('0x2'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x0d45('0x3'))(_0x0d45('0x4'));config['redis']=_[_0x0d45('0x5')](config[_0x0d45('0x6')],{'host':_0x0d45('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d45('0x8'))['register'](socket);try{if(!process[_0x0d45('0x9')][0x2]||process[_0x0d45('0x9')][0x2]===_0x0d45('0xa')||process[_0x0d45('0x9')][0x2]===_0x0d45('0xb')){throw new Error(_0x0d45('0xc'));}var FILEPATH=process[_0x0d45('0x9')][0x2];if(!process[_0x0d45('0x9')][0x3]||process[_0x0d45('0x9')][0x3]===_0x0d45('0xa')||process[_0x0d45('0x9')][0x3]===_0x0d45('0xb')||!process[_0x0d45('0x9')][0x4]||process[_0x0d45('0x9')][0x4]===_0x0d45('0xa')||process[_0x0d45('0x9')][0x4]===_0x0d45('0xb')){throw new Error(_0x0d45('0xd'));}var FIELDS=_[_0x0d45('0xe')](process[_0x0d45('0x9')][0x3][_0x0d45('0xf')](','),process[_0x0d45('0x9')][0x4]['split'](','));if(!process[_0x0d45('0x9')][0x5]||process[_0x0d45('0x9')][0x5]===_0x0d45('0xa')||process['argv'][0x5]==='null'){throw new Error(_0x0d45('0x10'));}var LISTID=process[_0x0d45('0x9')][0x5];var COMPANYID=process[_0x0d45('0x9')][0x6]&&process[_0x0d45('0x9')][0x6]!=='undefined'&&process[_0x0d45('0x9')][0x6]!==_0x0d45('0xb')?process[_0x0d45('0x9')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x0d45('0x9')][0x7]!==_0x0d45('0xb')?process[_0x0d45('0x9')][0x7]:null;if(!process[_0x0d45('0x9')][0x8]||process[_0x0d45('0x9')][0x8]===_0x0d45('0xa')||process[_0x0d45('0x9')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x0d45('0x9')][0x8];}catch(_0x35fcfd){logger[_0x0d45('0x11')](_0x35fcfd);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(_0x1bf741,_0x1ef5c6,_0x5d1849,_0xd8ad93){var _0x4a30da={'message':_0x1ef5c6};_0x4a30da[_0x1bf741]=!![];if(_0x5d1849){_0x4a30da['contact']=_0x5d1849;}if(_0xd8ad93){_0x4a30da['index']=_0xd8ad93;}return _0x4a30da;}function isEmail(_0x4ce321){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))*$/[_0x0d45('0x12')](_0x4ce321);}function checkRow(_0x38ccd0,_0x55afd8,_0x1c4dce){return new BPromise(function(_0x37530c,_0x31cd28){if(_[_0x0d45('0x13')](_0x38ccd0)){return _0x31cd28(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1c4dce));}if(_0x38ccd0['errors']&&_0x38ccd0[_0x0d45('0x14')]['length']){var _0x20efef=_[_0x0d45('0x15')](_0x38ccd0[_0x0d45('0x14')],_0x0d45('0x16'))[_0x0d45('0x17')](';');return _0x31cd28(handleCheckRowError(_0x0d45('0x11'),_0x20efef,null,_0x1c4dce));}var _0x58aaf0={};for(var _0x12f2b2 in FIELDS){if(FIELDS[_0x0d45('0x18')](_0x12f2b2)&&FIELDS[_0x12f2b2]){_0x58aaf0[_0x12f2b2]=_0x38ccd0[_0x0d45('0x19')][0x0][FIELDS[_0x12f2b2]]||_0x38ccd0[_0x0d45('0x19')][0x0]['\ufeff'+FIELDS[_0x12f2b2]];}}if(!_0x58aaf0[_0x0d45('0x1a')]){return _0x31cd28(handleCheckRowError(_0x0d45('0x11'),_0x0d45('0x1b'),null,_0x1c4dce));}if(!_0x58aaf0[_0x0d45('0x1c')]){return _0x31cd28(handleCheckRowError(_0x0d45('0x11'),_0x0d45('0x1d'),null,_0x1c4dce));}if(_0x58aaf0[_0x0d45('0x1e')]){var _0x2008d7=moment(_0x58aaf0[_0x0d45('0x1e')],_0x0d45('0x1f'));if(!_0x2008d7[_0x0d45('0x20')]()){return _0x31cd28(handleCheckRowError(_0x0d45('0x11'),_0x0d45('0x21'),null,_0x1c4dce));}}if(_0x58aaf0['email']){if(!isEmail(_0x58aaf0[_0x0d45('0x22')])){return _0x31cd28(handleCheckRowError('error',_0x0d45('0x23'),null,_0x1c4dce));}}_0x58aaf0[_0x0d45('0x24')]=LISTID;_0x58aaf0[_0x0d45('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d45('0x26')]&&_0x55afd8){var _0x3f3484={};for(var _0x375647=0x0,_0x472908=DUPLICATES[_0x0d45('0x26')];_0x375647<_0x472908;_0x375647+=0x1){_0x3f3484[DUPLICATES[_0x375647]]=_0x58aaf0[DUPLICATES[_0x375647]];}var _0x5cd459=_[_0x0d45('0x27')](_0x55afd8,_0x3f3484);if(_0x5cd459){return _0x31cd28(handleCheckRowError(_0x0d45('0x28'),_0x0d45('0x29'),_0x5cd459,_0x1c4dce));}}return db[_0x0d45('0x2a')][_0x0d45('0x2b')](_0x58aaf0,{'raw':!![],'hooks':![],'fields':_['keys'](_0x58aaf0)})[_0x0d45('0x2c')](function(_0x3611e4){if(DUPLICATES&&DUPLICATES[_0x0d45('0x26')]&&_0x55afd8){_0x55afd8[_0x0d45('0x2d')](_['pick'](_0x58aaf0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3611e4['id'];return _0x37530c();})['catch'](function(_0x1ed00b){return _0x31cd28(handleCheckRowError(_0x0d45('0x11'),_0x0d45('0x2e')+(_0x1ed00b[_0x0d45('0x16')]||JSON['stringify'](_0x1ed00b)),null,_0x1c4dce));});});}function checkHopper(){function _0x4cd7a6(){return function(_0x23b614){logger['error']('cmContact','checkHopper',util['inspect'](_0x23b614,{'showHidden':![],'depth':null}));};}var _0x2569df=function(_0x4775a5,_0xff700d){var _0x39d02d=squel[_0x0d45('0x2f')]()['into'](_0x0d45('0x30'))['fromQuery'](['phone',_0x0d45('0x31'),_0x0d45('0x32'),_0x0d45('0x24'),_0xff700d,'createdAt',_0x0d45('0x33')],squel[_0x0d45('0x34')]()[_0x0d45('0x35')](_0x0d45('0x1c'),_0x0d45('0x1c'))[_0x0d45('0x35')](_0x0d45('0x36'),_0x0d45('0x31'))[_0x0d45('0x35')]('id','ContactId')[_0x0d45('0x35')](LISTID[_0x0d45('0x37')](),_0x0d45('0x24'))[_0x0d45('0x35')](_0x4775a5['id'][_0x0d45('0x37')](),_0xff700d)[_0x0d45('0x35')](_0x0d45('0x36'),_0x0d45('0x38'))['field'](_0x0d45('0x36'),_0x0d45('0x33'))[_0x0d45('0x39')](_0x0d45('0x3a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x0d45('0x3b'),LISTID[_0x0d45('0x37')]())[_0x0d45('0x3c')](_0x0d45('0x3d'))[_0x0d45('0x3c')](_0x0d45('0x3e'),squel[_0x0d45('0x34')]()[_0x0d45('0x35')](_0x0d45('0x1c'))[_0x0d45('0x39')]('cm_hopper')[_0x0d45('0x3c')](_0xff700d+'\x20=\x20?',_0x4775a5['id'][_0x0d45('0x37')]())))[_0x0d45('0x37')]();return _0x39d02d;};var _0x609ab5=function(_0x8f95a1,_0x3e76aa){var _0x3729c9=squel['insert']()[_0x0d45('0x3f')](_0x0d45('0x30'))['fromQuery']([_0x0d45('0x1c'),_0x0d45('0x31'),'ContactId',_0x0d45('0x24'),_0x3e76aa,_0x0d45('0x38'),'updatedAt'],squel['select']()[_0x0d45('0x35')](_0x0d45('0x1c'),_0x0d45('0x1c'))[_0x0d45('0x35')](_0x0d45('0x36'),_0x0d45('0x31'))['field']('id',_0x0d45('0x32'))[_0x0d45('0x35')](LISTID['toString'](),_0x0d45('0x24'))[_0x0d45('0x35')](_0x8f95a1['id']['toString'](),_0x3e76aa)[_0x0d45('0x35')](_0x0d45('0x36'),'createdAt')[_0x0d45('0x35')]('NOW()',_0x0d45('0x33'))['from']('cm_contacts')[_0x0d45('0x3c')]('deletedAt\x20IS\x20NULL')[_0x0d45('0x3c')](_0x0d45('0x3b'),LISTID[_0x0d45('0x37')]())[_0x0d45('0x3c')](_0x0d45('0x40'),squel[_0x0d45('0x41')](hopperContacts))[_0x0d45('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x0d45('0x3c')](_0x0d45('0x3e'),squel[_0x0d45('0x34')]()[_0x0d45('0x35')](_0x0d45('0x42'))[_0x0d45('0x39')](_0x0d45('0x43'))[_0x0d45('0x3c')](_0x3e76aa+_0x0d45('0x44'),_0x8f95a1['id']['toString']()))[_0x0d45('0x3c')](_0x0d45('0x3e'),squel[_0x0d45('0x34')]()[_0x0d45('0x35')](_0x0d45('0x1c'))['from'](_0x0d45('0x30'))['where'](_0x3e76aa+_0x0d45('0x44'),_0x8f95a1['id'][_0x0d45('0x37')]())))[_0x0d45('0x37')]();return _0x3729c9;};function _0x889e72(_0x57c355,_0x422d7b){var _0x55d503=squel[_0x0d45('0x2f')]()[_0x0d45('0x3f')]('cm_hopper')['fromQuery']([_0x0d45('0x1c'),'scheduledAt',_0x0d45('0x32'),_0x0d45('0x24'),_0x422d7b,_0x0d45('0x38'),_0x0d45('0x33')],squel[_0x0d45('0x34')]()[_0x0d45('0x35')](_0x0d45('0x1c'),_0x0d45('0x1c'))[_0x0d45('0x35')](_0x0d45('0x36'),'scheduledAt')[_0x0d45('0x35')]('id',_0x0d45('0x32'))['field'](LISTID['toString'](),'ListId')['field'](_0x57c355['id'][_0x0d45('0x37')](),_0x422d7b)[_0x0d45('0x35')](_0x0d45('0x36'),_0x0d45('0x38'))['field']('NOW()','updatedAt')['from'](_0x0d45('0x3a'))[_0x0d45('0x3c')](_0x0d45('0x45'))[_0x0d45('0x3c')](_0x0d45('0x3b'),LISTID[_0x0d45('0x37')]())[_0x0d45('0x3c')](_0x0d45('0x40'),squel[_0x0d45('0x41')](hopperContacts))[_0x0d45('0x3c')](_0x0d45('0x3d')))[_0x0d45('0x37')]();return _0x55d503;}function _0x3de884(_0x39234a,_0x3b2e38){var _0x498e7e=squel[_0x0d45('0x2f')]()[_0x0d45('0x3f')](_0x0d45('0x46'))['fromQuery']([_0x0d45('0x1c'),_0x0d45('0x32'),'ListId',_0x3b2e38,_0x0d45('0x38'),_0x0d45('0x33')],squel[_0x0d45('0x34')]()['field']('phone','phone')[_0x0d45('0x35')]('id',_0x0d45('0x32'))[_0x0d45('0x35')](LISTID[_0x0d45('0x37')](),_0x0d45('0x24'))[_0x0d45('0x35')](_0x39234a['id'][_0x0d45('0x37')](),_0x3b2e38)[_0x0d45('0x35')](_0x0d45('0x36'),'createdAt')[_0x0d45('0x35')](_0x0d45('0x36'),_0x0d45('0x33'))['from'](_0x0d45('0x3a'))['where'](_0x0d45('0x45'))[_0x0d45('0x3c')](_0x0d45('0x3b'),LISTID[_0x0d45('0x37')]())[_0x0d45('0x3c')](_0x0d45('0x40'),squel[_0x0d45('0x41')](hopperContacts))[_0x0d45('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x0d45('0x37')]();return _0x498e7e;}return db[_0x0d45('0x47')][_0x0d45('0x48')]({'where':{'type':_0x0d45('0x49')},'attributes':['id',_0x0d45('0x4a')],'include':[{'model':db['CmList'],'as':_0x0d45('0x4b'),'where':{'id':LISTID}}]})[_0x0d45('0x2c')](function(_0x25b75b){var _0x6338a0=[];if(_0x25b75b){var _0xac83c2;for(var _0x4d5336=0x0,_0x414a7a;_0x4d5336<_0x25b75b[_0x0d45('0x26')];_0x4d5336+=0x1){_0x414a7a=_0x25b75b[_0x4d5336][_0x0d45('0x4c')]({'plain':!![]});switch(_0x414a7a[_0x0d45('0x4a')]){case'always':_0x6338a0[_0x0d45('0x2d')](db['sequelize'][_0x0d45('0x4d')](_0x609ab5(_0x414a7a,'VoiceQueueId'))[_0x0d45('0x2c')](function(){})['catch'](_0x4cd7a6()));break;case'onlyIfOpen':_0x6338a0[_0x0d45('0x2d')](db[_0x0d45('0x4e')][_0x0d45('0x4d')](_0x2569df(_0x414a7a,'VoiceQueueId'))['then'](function(){})[_0x0d45('0x4f')](_0x4cd7a6()));break;default:_0x6338a0[_0x0d45('0x2d')](db['sequelize'][_0x0d45('0x4d')](_0x889e72(_0x414a7a,_0x0d45('0x50')))[_0x0d45('0x2c')](function(){})['catch'](_0x4cd7a6()));}}}return _0x6338a0;})[_0x0d45('0x51')]()[_0x0d45('0x2c')](function(){return db[_0x0d45('0x47')]['findAll']({'where':{'type':_0x0d45('0x49')},'attributes':['id'],'include':[{'model':db[_0x0d45('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d45('0x2c')](function(_0x1d68f0){var _0x49c516=[];if(_0x1d68f0){var _0x3417a3;for(var _0x3d618c=0x0,_0x32215d;_0x3d618c<_0x1d68f0[_0x0d45('0x26')];_0x3d618c+=0x1){_0x32215d=_0x1d68f0[_0x3d618c][_0x0d45('0x4c')]({'plain':!![]});_0x49c516[_0x0d45('0x2d')](db['sequelize'][_0x0d45('0x4d')](_0x3de884(_0x32215d,'VoiceQueueId'))[_0x0d45('0x2c')](function(){})[_0x0d45('0x4f')](_0x4cd7a6()));}}return _0x49c516;})['all']();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0d45('0x52')],'as':_0x0d45('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x822d3d){var _0x3c1210=[];if(_0x822d3d){for(var _0x59a5e7=0x0,_0x313ab6;_0x59a5e7<_0x822d3d['length'];_0x59a5e7+=0x1){_0x313ab6=_0x822d3d[_0x59a5e7][_0x0d45('0x4c')]({'plain':!![]});switch(_0x313ab6[_0x0d45('0x4a')]){case'always':_0x3c1210[_0x0d45('0x2d')](db['sequelize'][_0x0d45('0x4d')](_0x609ab5(_0x313ab6,_0x0d45('0x53')))['then'](function(){})['catch'](_0x4cd7a6()));break;case _0x0d45('0x54'):_0x3c1210[_0x0d45('0x2d')](db['sequelize'][_0x0d45('0x4d')](_0x2569df(_0x313ab6,_0x0d45('0x53')))['then'](function(){})[_0x0d45('0x4f')](_0x4cd7a6()));break;default:_0x3c1210[_0x0d45('0x2d')](db['sequelize']['query'](_0x889e72(_0x313ab6,_0x0d45('0x53')))[_0x0d45('0x2c')](function(){})['catch'](_0x4cd7a6()));}}}return _0x3c1210;})[_0x0d45('0x51')]();})[_0x0d45('0x2c')](function(){return db[_0x0d45('0x55')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x0d45('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d45('0x2c')](function(_0xc8d66){var _0x241ffd=[];if(_0xc8d66){for(var _0x3103fa=0x0,_0xec660c;_0x3103fa<_0xc8d66[_0x0d45('0x26')];_0x3103fa+=0x1){_0xec660c=_0xc8d66[_0x3103fa][_0x0d45('0x4c')]({'plain':!![]});_0x241ffd[_0x0d45('0x2d')](db[_0x0d45('0x4e')][_0x0d45('0x4d')](_0x3de884(_0xec660c,_0x0d45('0x53')))[_0x0d45('0x2c')](function(){})[_0x0d45('0x4f')](_0x4cd7a6()));}}return _0x241ffd;})['all']();})[_0x0d45('0x4f')](function(_0x415ce1){logger[_0x0d45('0x11')](_0x0d45('0x56'),_0x0d45('0x57'),_0x415ce1[_0x0d45('0x16')]);});}var processPromises=function(_0x28e45b){return BPromise[_0x0d45('0x51')](promises)[_0x0d45('0x2c')](function(_0x44ac63){})[_0x0d45('0x4f')](function(_0x3cb81c){logger[_0x0d45('0x11')](_0x0d45('0x58'),JSON['stringify'](_0x3cb81c));})[_0x0d45('0x59')](function(){socket[_0x0d45('0x5a')](_0x0d45('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x28e45b){return _0x28e45b[_0x0d45('0x5c')]();}});};var endCsv=function(){return BPromise[_0x0d45('0x5d')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x49ea22){logger[_0x0d45('0x11')](_0x0d45('0x5e'),JSON[_0x0d45('0x5f')](_0x49ea22));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x0d45('0x60'));endCsv();});function main(){return BPromise[_0x0d45('0x5d')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x0d45('0x2a')][_0x0d45('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d45('0x2c')](function(_0x5dce62){var _0x1ffdfa=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d45('0x61')](_0x1ffdfa,{'header':!![],'skipEmptyLines':!![],'step':function(_0x223e66,_0x498425){total+=0x1;var _0x3fd905=total;promises['push'](checkRow(_0x223e66,_0x5dce62,_0x3fd905)[_0x0d45('0x2c')](function(){success+=0x1;})[_0x0d45('0x4f')](function(_0x81f444){if(_0x81f444[_0x0d45('0x11')]){errors+=0x1;delete _0x81f444['error'];}else if(_0x81f444['duplicate']){duplicates+=0x1;delete _0x81f444[_0x0d45('0x28')];}rows[_0x0d45('0x2d')](_0x81f444);}));if(total%0xc8===0x0){_0x498425[_0x0d45('0x62')]();return processPromises(_0x498425);}},'complete':function(){return processPromises()[_0x0d45('0x2c')](function(){logger[_0x0d45('0x63')](_0x0d45('0x64'));endCsv();});},'error':function(_0x1a05c7,_0x1b003d){logger[_0x0d45('0x63')](_0x0d45('0x65'),JSON[_0x0d45('0x5f')](_0x1a05c7));endCsv();}});})['catch'](function(_0x30f65b){logger[_0x0d45('0x11')](_0x0d45('0x66'),JSON['stringify'](_0x30f65b));});}main();
\ No newline at end of file
+var _0x3450=['catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','phone','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','into','createdAt','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','get','sequelize','onlyIfOpen','query','VoiceQueueId','all','VoiceQueue','BlackLists','Campaign','Lists','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','CmContact','create','then','push','pick'];(function(_0x2e32a8,_0x51b076){var _0x4e256c=function(_0x14ac57){while(--_0x14ac57){_0x2e32a8['push'](_0x2e32a8['shift']());}};_0x4e256c(++_0x51b076);}(_0x3450,0x117));var _0x0345=function(_0x108f25,_0x7783e2){_0x108f25=_0x108f25-0x0;var _0x329412=_0x3450[_0x108f25];return _0x329412;};'use strict';var BPromise=require(_0x0345('0x0'));var util=require('util');var _=require(_0x0345('0x1'));var fs=require('fs');var squel=require(_0x0345('0x2'));var Papa=require(_0x0345('0x3'));var Redis=require('ioredis');var db=require(_0x0345('0x4'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0345('0x5'));config[_0x0345('0x6')]=_[_0x0345('0x7')](config[_0x0345('0x6')],{'host':_0x0345('0x8'),'port':0x18eb});var socket=require(_0x0345('0x9'))(new Redis(config[_0x0345('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x0345('0xa')](socket);try{if(!process[_0x0345('0xb')][0x2]||process[_0x0345('0xb')][0x2]===_0x0345('0xc')||process[_0x0345('0xb')][0x2]===_0x0345('0xd')){throw new Error(_0x0345('0xe'));}var FILEPATH=process[_0x0345('0xb')][0x2];if(!process[_0x0345('0xb')][0x3]||process[_0x0345('0xb')][0x3]==='undefined'||process['argv'][0x3]===_0x0345('0xd')||!process['argv'][0x4]||process[_0x0345('0xb')][0x4]===_0x0345('0xc')||process[_0x0345('0xb')][0x4]===_0x0345('0xd')){throw new Error(_0x0345('0xf'));}var FIELDS=_['zipObject'](process[_0x0345('0xb')][0x3][_0x0345('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x0345('0xb')][0x5]||process[_0x0345('0xb')][0x5]==='undefined'||process[_0x0345('0xb')][0x5]===_0x0345('0xd')){throw new Error(_0x0345('0x11'));}var LISTID=process[_0x0345('0xb')][0x5];var COMPANYID=process[_0x0345('0xb')][0x6]&&process['argv'][0x6]!==_0x0345('0xc')&&process[_0x0345('0xb')][0x6]!==_0x0345('0xd')?process[_0x0345('0xb')][0x6]:null;var DUPLICATES=process[_0x0345('0xb')][0x7]&&process['argv'][0x7]!==_0x0345('0xc')&&process[_0x0345('0xb')][0x7]!==_0x0345('0xd')?process[_0x0345('0xb')][0x7]:null;if(!process[_0x0345('0xb')][0x8]||process[_0x0345('0xb')][0x8]===_0x0345('0xc')||process[_0x0345('0xb')][0x8]===_0x0345('0xd')){throw new Error(_0x0345('0x12'));}var SOCKET_TIMESTAMP=process[_0x0345('0xb')][0x8];}catch(_0xbd9614){logger[_0x0345('0x13')](_0xbd9614);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(_0x5b78a9,_0x5cddc5,_0x278001,_0x44ec8e){var _0xe55356={'message':_0x5cddc5};_0xe55356[_0x5b78a9]=!![];if(_0x278001){_0xe55356[_0x0345('0x14')]=_0x278001;}if(_0x44ec8e){_0xe55356[_0x0345('0x15')]=_0x44ec8e;}return _0xe55356;}function isEmail(_0x19aecf){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'](_0x19aecf);}function checkRow(_0x10e22f,_0x407881,_0x2ef9ab){return new BPromise(function(_0x2bbac2,_0x13f7d2){if(_[_0x0345('0x16')](_0x10e22f)){return _0x13f7d2(handleCheckRowError('error',_0x0345('0x17'),null,_0x2ef9ab));}if(_0x10e22f['errors']&&_0x10e22f['errors'][_0x0345('0x18')]){var _0x4153dd=_[_0x0345('0x19')](_0x10e22f[_0x0345('0x1a')],_0x0345('0x1b'))[_0x0345('0x1c')](';');return _0x13f7d2(handleCheckRowError(_0x0345('0x13'),_0x4153dd,null,_0x2ef9ab));}var _0x176967={};for(var _0x1412e2 in FIELDS){if(FIELDS[_0x0345('0x1d')](_0x1412e2)&&FIELDS[_0x1412e2]){_0x176967[_0x1412e2]=_0x10e22f[_0x0345('0x1e')][0x0][FIELDS[_0x1412e2]]||_0x10e22f[_0x0345('0x1e')][0x0]['\ufeff'+FIELDS[_0x1412e2]];}}if(!_0x176967[_0x0345('0x1f')]){return _0x13f7d2(handleCheckRowError('error',_0x0345('0x20'),null,_0x2ef9ab));}if(!_0x176967['phone']){return _0x13f7d2(handleCheckRowError(_0x0345('0x13'),_0x0345('0x21'),null,_0x2ef9ab));}if(_0x176967[_0x0345('0x22')]){var _0x39c83a=moment(_0x176967[_0x0345('0x22')],_0x0345('0x23'));if(!_0x39c83a[_0x0345('0x24')]()){return _0x13f7d2(handleCheckRowError('error',_0x0345('0x25'),null,_0x2ef9ab));}}if(_0x176967['email']){if(!isEmail(_0x176967[_0x0345('0x26')])){return _0x13f7d2(handleCheckRowError('error',_0x0345('0x27'),null,_0x2ef9ab));}}_0x176967[_0x0345('0x28')]=LISTID;_0x176967[_0x0345('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0345('0x18')]&&_0x407881){var _0xeb3bd4={};for(var _0x105eca=0x0,_0x1e634a=DUPLICATES[_0x0345('0x18')];_0x105eca<_0x1e634a;_0x105eca+=0x1){_0xeb3bd4[DUPLICATES[_0x105eca]]=_0x176967[DUPLICATES[_0x105eca]];}var _0x4245c9=_[_0x0345('0x2a')](_0x407881,_0xeb3bd4);if(_0x4245c9){return _0x13f7d2(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x4245c9,_0x2ef9ab));}}return db[_0x0345('0x2b')][_0x0345('0x2c')](_0x176967,{'raw':!![],'hooks':![],'fields':_['keys'](_0x176967)})[_0x0345('0x2d')](function(_0x11c9c5){if(DUPLICATES&&DUPLICATES['length']&&_0x407881){_0x407881[_0x0345('0x2e')](_[_0x0345('0x2f')](_0x176967,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x11c9c5['id'];return _0x2bbac2();})[_0x0345('0x30')](function(_0x39a96a){return _0x13f7d2(handleCheckRowError(_0x0345('0x13'),_0x0345('0x31')+(_0x39a96a[_0x0345('0x1b')]||JSON[_0x0345('0x32')](_0x39a96a)),null,_0x2ef9ab));});});}function checkHopper(){function _0x4bc26f(){return function(_0x5a4a4e){logger['error'](_0x0345('0x33'),_0x0345('0x34'),util['inspect'](_0x5a4a4e,{'showHidden':![],'depth':null}));};}var _0x1b5e42=function(_0x13c2f8,_0x495fac){var _0x3c7cbd=squel[_0x0345('0x35')]()['into'](_0x0345('0x36'))[_0x0345('0x37')](['phone',_0x0345('0x38'),_0x0345('0x39'),_0x0345('0x28'),_0x495fac,'createdAt',_0x0345('0x3a')],squel[_0x0345('0x3b')]()['field'](_0x0345('0x3c'),_0x0345('0x3c'))[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x38'))['field']('id',_0x0345('0x39'))[_0x0345('0x3d')](LISTID[_0x0345('0x3f')](),'ListId')[_0x0345('0x3d')](_0x13c2f8['id'][_0x0345('0x3f')](),_0x495fac)[_0x0345('0x3d')](_0x0345('0x3e'),'createdAt')[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x3a'))[_0x0345('0x40')](_0x0345('0x41'))[_0x0345('0x42')](_0x0345('0x43'))[_0x0345('0x42')](_0x0345('0x44'),LISTID[_0x0345('0x3f')]())['where'](_0x0345('0x45'))[_0x0345('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0345('0x3b')]()['field']('phone')[_0x0345('0x40')](_0x0345('0x36'))[_0x0345('0x42')](_0x495fac+'\x20=\x20?',_0x13c2f8['id']['toString']())))[_0x0345('0x3f')]();return _0x3c7cbd;};var _0x211301=function(_0x1519b4,_0x148b86){var _0x3117f6=squel[_0x0345('0x35')]()[_0x0345('0x46')](_0x0345('0x36'))[_0x0345('0x37')]([_0x0345('0x3c'),_0x0345('0x38'),_0x0345('0x39'),_0x0345('0x28'),_0x148b86,_0x0345('0x47'),'updatedAt'],squel[_0x0345('0x3b')]()[_0x0345('0x3d')](_0x0345('0x3c'),_0x0345('0x3c'))[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x38'))[_0x0345('0x3d')]('id',_0x0345('0x39'))[_0x0345('0x3d')](LISTID['toString'](),'ListId')[_0x0345('0x3d')](_0x1519b4['id']['toString'](),_0x148b86)[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x47'))[_0x0345('0x3d')](_0x0345('0x3e'),'updatedAt')[_0x0345('0x40')](_0x0345('0x41'))[_0x0345('0x42')](_0x0345('0x43'))[_0x0345('0x42')](_0x0345('0x44'),LISTID['toString']())[_0x0345('0x42')](_0x0345('0x48'),squel[_0x0345('0x49')](hopperContacts))['where'](_0x0345('0x45'))[_0x0345('0x42')](_0x0345('0x4a'),squel['select']()[_0x0345('0x3d')]('calleridnum')[_0x0345('0x40')]('cm_hopper_final')[_0x0345('0x42')](_0x148b86+_0x0345('0x4b'),_0x1519b4['id'][_0x0345('0x3f')]()))[_0x0345('0x42')](_0x0345('0x4a'),squel[_0x0345('0x3b')]()[_0x0345('0x3d')](_0x0345('0x3c'))['from'](_0x0345('0x36'))[_0x0345('0x42')](_0x148b86+_0x0345('0x4b'),_0x1519b4['id']['toString']())))[_0x0345('0x3f')]();return _0x3117f6;};function _0x5554ad(_0xbb42ae,_0x4efcf2){var _0x56e59e=squel['insert']()[_0x0345('0x46')]('cm_hopper')[_0x0345('0x37')]([_0x0345('0x3c'),_0x0345('0x38'),_0x0345('0x39'),_0x0345('0x28'),_0x4efcf2,'createdAt',_0x0345('0x3a')],squel[_0x0345('0x3b')]()[_0x0345('0x3d')]('phone',_0x0345('0x3c'))[_0x0345('0x3d')]('NOW()',_0x0345('0x38'))[_0x0345('0x3d')]('id',_0x0345('0x39'))[_0x0345('0x3d')](LISTID[_0x0345('0x3f')](),_0x0345('0x28'))[_0x0345('0x3d')](_0xbb42ae['id'][_0x0345('0x3f')](),_0x4efcf2)[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x47'))[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x3a'))[_0x0345('0x40')]('cm_contacts')[_0x0345('0x42')](_0x0345('0x43'))['where'](_0x0345('0x44'),LISTID[_0x0345('0x3f')]())[_0x0345('0x42')](_0x0345('0x48'),squel[_0x0345('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0345('0x3f')]();return _0x56e59e;}function _0x3b34bd(_0x23915a,_0x2b2c4f){var _0x364fdd=squel[_0x0345('0x35')]()['into'](_0x0345('0x4c'))[_0x0345('0x37')]([_0x0345('0x3c'),'ContactId',_0x0345('0x28'),_0x2b2c4f,_0x0345('0x47'),_0x0345('0x3a')],squel[_0x0345('0x3b')]()[_0x0345('0x3d')](_0x0345('0x3c'),_0x0345('0x3c'))[_0x0345('0x3d')]('id',_0x0345('0x39'))[_0x0345('0x3d')](LISTID[_0x0345('0x3f')](),_0x0345('0x28'))[_0x0345('0x3d')](_0x23915a['id'][_0x0345('0x3f')](),_0x2b2c4f)[_0x0345('0x3d')](_0x0345('0x3e'),_0x0345('0x47'))[_0x0345('0x3d')](_0x0345('0x3e'),'updatedAt')[_0x0345('0x40')]('cm_contacts')[_0x0345('0x42')]('deletedAt\x20IS\x20NULL')[_0x0345('0x42')](_0x0345('0x44'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x0345('0x49')](hopperContacts))[_0x0345('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x0345('0x3f')]();return _0x364fdd;}return db['VoiceQueue'][_0x0345('0x4d')]({'where':{'type':_0x0345('0x4e')},'attributes':['id',_0x0345('0x4f')],'include':[{'model':db[_0x0345('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0x0345('0x2d')](function(_0x378bd0){var _0x1a8534=[];if(_0x378bd0){var _0x5065da;for(var _0x3fd4f1=0x0,_0x3146d4;_0x3fd4f1<_0x378bd0['length'];_0x3fd4f1+=0x1){_0x3146d4=_0x378bd0[_0x3fd4f1][_0x0345('0x51')]({'plain':!![]});switch(_0x3146d4[_0x0345('0x4f')]){case'always':_0x1a8534['push'](db[_0x0345('0x52')]['query'](_0x211301(_0x3146d4,'VoiceQueueId'))[_0x0345('0x2d')](function(){})[_0x0345('0x30')](_0x4bc26f()));break;case _0x0345('0x53'):_0x1a8534[_0x0345('0x2e')](db[_0x0345('0x52')]['query'](_0x1b5e42(_0x3146d4,'VoiceQueueId'))[_0x0345('0x2d')](function(){})['catch'](_0x4bc26f()));break;default:_0x1a8534[_0x0345('0x2e')](db[_0x0345('0x52')][_0x0345('0x54')](_0x5554ad(_0x3146d4,_0x0345('0x55')))['then'](function(){})['catch'](_0x4bc26f()));}}}return _0x1a8534;})[_0x0345('0x56')]()[_0x0345('0x2d')](function(){return db[_0x0345('0x57')][_0x0345('0x4d')]({'where':{'type':_0x0345('0x4e')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0345('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x21c9b7){var _0x4c5b33=[];if(_0x21c9b7){var _0xc59ed6;for(var _0x5ccf68=0x0,_0x5cc05b;_0x5ccf68<_0x21c9b7[_0x0345('0x18')];_0x5ccf68+=0x1){_0x5cc05b=_0x21c9b7[_0x5ccf68][_0x0345('0x51')]({'plain':!![]});_0x4c5b33['push'](db['sequelize'][_0x0345('0x54')](_0x3b34bd(_0x5cc05b,_0x0345('0x55')))[_0x0345('0x2d')](function(){})['catch'](_0x4bc26f()));}}return _0x4c5b33;})[_0x0345('0x56')]();})[_0x0345('0x2d')](function(){return db[_0x0345('0x59')][_0x0345('0x4d')]({'attributes':['id',_0x0345('0x4f')],'include':[{'model':db['CmList'],'as':_0x0345('0x5a'),'where':{'id':LISTID}}]})[_0x0345('0x2d')](function(_0x4ce47d){var _0x440dce=[];if(_0x4ce47d){for(var _0x23c62d=0x0,_0x4ec369;_0x23c62d<_0x4ce47d[_0x0345('0x18')];_0x23c62d+=0x1){_0x4ec369=_0x4ce47d[_0x23c62d]['get']({'plain':!![]});switch(_0x4ec369[_0x0345('0x4f')]){case _0x0345('0x5b'):_0x440dce[_0x0345('0x2e')](db[_0x0345('0x52')][_0x0345('0x54')](_0x211301(_0x4ec369,_0x0345('0x5c')))[_0x0345('0x2d')](function(){})[_0x0345('0x30')](_0x4bc26f()));break;case _0x0345('0x53'):_0x440dce['push'](db[_0x0345('0x52')][_0x0345('0x54')](_0x1b5e42(_0x4ec369,_0x0345('0x5c')))[_0x0345('0x2d')](function(){})['catch'](_0x4bc26f()));break;default:_0x440dce[_0x0345('0x2e')](db['sequelize'][_0x0345('0x54')](_0x5554ad(_0x4ec369,_0x0345('0x5c')))[_0x0345('0x2d')](function(){})['catch'](_0x4bc26f()));}}}return _0x440dce;})[_0x0345('0x56')]();})[_0x0345('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x0345('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0345('0x2d')](function(_0x29753c){var _0xe83cd1=[];if(_0x29753c){for(var _0x2cd4c0=0x0,_0x26f613;_0x2cd4c0<_0x29753c[_0x0345('0x18')];_0x2cd4c0+=0x1){_0x26f613=_0x29753c[_0x2cd4c0][_0x0345('0x51')]({'plain':!![]});_0xe83cd1[_0x0345('0x2e')](db[_0x0345('0x52')][_0x0345('0x54')](_0x3b34bd(_0x26f613,_0x0345('0x5c')))['then'](function(){})['catch'](_0x4bc26f()));}}return _0xe83cd1;})[_0x0345('0x56')]();})[_0x0345('0x30')](function(_0x498960){logger[_0x0345('0x13')](_0x0345('0x5d'),_0x0345('0x5e'),_0x498960[_0x0345('0x1b')]);});}var processPromises=function(_0x3ceddf){return BPromise['all'](promises)[_0x0345('0x2d')](function(_0x37e113){})[_0x0345('0x30')](function(_0x5f61aa){logger[_0x0345('0x13')](_0x0345('0x5f'),JSON['stringify'](_0x5f61aa));})['finally'](function(){socket[_0x0345('0x60')](_0x0345('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3ceddf){return _0x3ceddf[_0x0345('0x62')]();}});};var endCsv=function(){return BPromise[_0x0345('0x63')]()[_0x0345('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x0345('0x2d')](function(){socket['emit'](_0x0345('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0345('0x64')](FILEPATH);}catch(_0x3ca990){logger[_0x0345('0x13')](_0x0345('0x65'),JSON['stringify'](_0x3ca990));}finally{process[_0x0345('0x66')](0x0);}});};process['on'](_0x0345('0x67'),function(){logger[_0x0345('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0345('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0345('0x10')](',');return db['CmContact'][_0x0345('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0345('0x2d')](function(_0x21f027){var _0x1cfebe=fs[_0x0345('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0345('0x6a')](_0x1cfebe,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f560e,_0x3fb89e){total+=0x1;var _0xcccfe2=total;promises['push'](checkRow(_0x1f560e,_0x21f027,_0xcccfe2)['then'](function(){success+=0x1;})[_0x0345('0x30')](function(_0x24e61c){if(_0x24e61c[_0x0345('0x13')]){errors+=0x1;delete _0x24e61c[_0x0345('0x13')];}else if(_0x24e61c['duplicate']){duplicates+=0x1;delete _0x24e61c[_0x0345('0x6b')];}rows[_0x0345('0x2e')](_0x24e61c);}));if(total%0xc8===0x0){_0x3fb89e['pause']();return processPromises(_0x3fb89e);}},'complete':function(){return processPromises()[_0x0345('0x2d')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2c1939,_0x57d4c0){logger[_0x0345('0x68')](_0x0345('0x6c'),JSON[_0x0345('0x32')](_0x2c1939));endCsv();}});})[_0x0345('0x30')](function(_0x4f5e4f){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0345('0x32')](_0x4f5e4f));});}main();
\ No newline at end of file
index ca54300..eb157da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','trim','description','replace','contact:import:','abort','SystemError','step','duplicates','cm_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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','all','then','split','filter','CmContactHasItem','update','updated','create','PHONE','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','ContactId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','query','spread','catch','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','name','writeFileSync','createReadStream','data','rows','find','_description','isNil','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth'];(function(_0x13ab99,_0x187bfd){var _0x1936cc=function(_0x1c3ce3){while(--_0x1c3ce3){_0x13ab99['push'](_0x13ab99['shift']());}};_0x1936cc(++_0x187bfd);}(_0x4819,0xcd));var _0x9481=function(_0x4d5672,_0x4517e7){_0x4d5672=_0x4d5672-0x0;var _0x4a7aec=_0x4819[_0x4d5672];return _0x4a7aec;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x9481('0x0'));var Papa=require(_0x9481('0x1'));var util=require(_0x9481('0x2'));var BPromise=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var squel=require(_0x9481('0x5'));var Redis=require(_0x9481('0x6'));var db=require(_0x9481('0x7'))['db'];var config=require(_0x9481('0x8'));var logger=require(_0x9481('0x9'))('import');config[_0x9481('0xa')]=_['defaults'](config['redis'],{'host':_0x9481('0xb'),'port':0x18eb});var socket=require(_0x9481('0xc'))(new Redis(config[_0x9481('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9481('0xd')](_0x9481('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4c7d9c){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))*$/[_0x9481('0xf')](_0x4c7d9c);}function selectNotIn(_0x521d18,_0x2fabf1,_0x564d5b,_0x411d24,_0x2d5d0f){return squel[_0x9481('0x10')]()[_0x9481('0x11')](_0x9481('0x12'))[_0x9481('0x13')](_0x411d24)[_0x9481('0x14')](_0x2fabf1,null,_0x2fabf1+_0x9481('0x15')+_0x411d24+'.'+_0x564d5b)[_0x9481('0x16')](_0x411d24+'.'+_0x564d5b+'\x20=\x20'+_0x521d18+'.'+_0x564d5b)['where'](_0x2fabf1+_0x9481('0x17')+_0x2d5d0f[_0x9481('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2f0032,_0x28fcb6){promisesAdditionalPhones=[];return db[_0x9481('0x18')][_0x9481('0x19')]({'raw':!![],'attributes':['id',_0x9481('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4220f1){if(_0x4220f1!==null){var _0x7a7ee=[];for(var _0x5b1fe6=0x0;_0x5b1fe6<_0x4220f1[_0x9481('0x1b')];_0x5b1fe6++){var _0x518150=_0x4220f1[_0x5b1fe6];_0x7a7ee[_0x9481('0x1c')](insertAdditionalPhones(_0x518150));}}Promise[_0x9481('0x1d')](_0x7a7ee)[_0x9481('0x1e')](function(){_0x2f0032({'val':0x1});});});});}function insertAdditionalPhones(_0x2bb2a4){return new Promise(function(_0x546fce,_0x5eda66){var _0x20473d=_0x2bb2a4['AdditionalPhones'];var _0x4d0da7=_0x20473d[_0x9481('0x1f')](';');var _0x33e32b=[];orderBy=0x0;for(var _0x18c6f5=0x0;_0x18c6f5<_0x4d0da7[_0x9481('0x1b')];_0x18c6f5++){_0x33e32b[_0x9481('0x1c')](splitAdditionalPhone(_0x2bb2a4['id'],_0x4d0da7[_0x18c6f5]));}Promise[_0x9481('0x1d')](_0x33e32b)['then'](function(){_0x546fce({'val':_0x4d0da7[_0x9481('0x1b')]});});});}function splitAdditionalPhone(_0x272a84,_0x45f9df){return new Promise(function(_0x615e02,_0xb5cd2c){var _0x56da97=_0x45f9df[_0x9481('0x1f')](':');var _0x294908=_0x56da97[0x0];var _0x572599=_0x56da97[0x1];if(_0x572599!==''){var _0x2bcf37=_0x572599[_0x9481('0x1f')]('|');var _0x352b3a=[];for(var _0x1809d2=0x0;_0x1809d2<_0x2bcf37[_0x9481('0x1b')];_0x1809d2++){if(_0x2bcf37[_0x1809d2]!==''){var _0x49ecfa=_[_0x9481('0x20')](promisesAdditionalPhones,{'contactId':_0x272a84,'phone':_0x2bcf37[_0x1809d2]});if(_0x49ecfa[_0x9481('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x272a84,'contactTypeId':_0x294908,'phone':_0x2bcf37[_0x1809d2],'orderBy':orderBy});}}}_0x615e02({'ok':0x1});}else _0x615e02({'res':0x0});});}function createAdditionalPhone(_0x5eb4f5,_0x12b0c3,_0x299e28,_0x550fce){var _0x1e6f28='';var _0x20ff9a='';var _0xeff0a5=_0x299e28[_0x9481('0x1f')]('§');_0x1e6f28=_0xeff0a5[0x0];if(_0xeff0a5['length']==0x2)_0x20ff9a=_0xeff0a5[0x1];return new Promise(function(_0x14f03e,_0x3ca064){return db[_0x9481('0x21')]['findOne']({'where':{'CmContactId':_0x5eb4f5,'item':_0x1e6f28}})[_0x9481('0x1e')](function(_0x56e944){if(_0x56e944){return db[_0x9481('0x21')][_0x9481('0x22')]({'ItemTypeId':_0x12b0c3,'description':_0x20ff9a,'OrderBy':_0x550fce},{'where':{'CmContactId':_0x5eb4f5,'item':_0x1e6f28}})[_0x9481('0x1e')](function(_0x13ef93){_0x14f03e({'res':_0x9481('0x23')});});}else{return db['CmContactHasItem'][_0x9481('0x24')]({'CmContactId':_0x5eb4f5,'item':_0x1e6f28,'description':_0x20ff9a,'ItemTypeId':_0x12b0c3,'OrderBy':_0x550fce,'ItemClass':_0x9481('0x25')})[_0x9481('0x1e')](function(_0x4895a0){_0x14f03e({'res':'inserted'});});}});});}function insertCmHopper(_0x1addc8,_0x427c25,_0x42df68,_0x2b33f8,_0x5d9926){var _0x5163e3=['cm_contacts.phone',_0x9481('0x26'),'cm_contacts.id',_0x9481('0x27'),_0x427c25+'.'+_0x2b33f8,'cm_contacts.createdAt',_0x9481('0x28'),_0x9481('0x29'),_0x9481('0x2a'),'\x22'+_0x5d9926+'\x22'];return squel[_0x9481('0x2b')]()[_0x9481('0x2c')]('cm_hopper')[_0x9481('0x2d')]([_0x9481('0x12'),_0x9481('0x2e'),'ContactId',_0x9481('0x2f'),_0x2b33f8,_0x9481('0x30'),_0x9481('0x31'),_0x9481('0x32'),_0x9481('0x33'),_0x9481('0x34')],squel['select']()[_0x9481('0x35')](_0x5163e3)['from'](_0x427c25)[_0x9481('0x14')](_0x9481('0x36'),null,_0x9481('0x37')+_0x427c25+_0x9481('0x38'))[_0x9481('0x14')](_0x42df68,null,_0x42df68+_0x9481('0x15')+_0x427c25+'.'+_0x2b33f8)['where'](_0x427c25+_0x9481('0x39'),_0x1addc8)[_0x9481('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x9481('0x3a'),selectNotIn(_0x427c25,_0x42df68,_0x2b33f8,'cm_hopper',[_0x9481('0x3b'),_0x9481('0x3c')]))[_0x9481('0x16')](_0x9481('0x3a'),selectNotIn(_0x427c25,_0x42df68,_0x2b33f8,'cm_hopper',[_0x9481('0x3b')])))['toString']();}function insertCmHopperBlack(_0x62b05b,_0x56f151,_0x2ce972,_0x4d6a13){var _0x315fb9=[_0x9481('0x3d'),_0x9481('0x3e'),_0x9481('0x27'),_0x56f151+'.'+_0x4d6a13,_0x9481('0x3f'),_0x9481('0x28')];return squel[_0x9481('0x2b')]()['into'](_0x9481('0x40'))[_0x9481('0x2d')]([_0x9481('0x12'),_0x9481('0x41'),_0x9481('0x2f'),_0x4d6a13,_0x9481('0x30'),_0x9481('0x31')],squel['select']()[_0x9481('0x35')](_0x315fb9)[_0x9481('0x13')](_0x56f151)['join'](_0x9481('0x36'),null,_0x9481('0x37')+_0x56f151+_0x9481('0x38'))[_0x9481('0x14')](_0x2ce972,null,_0x2ce972+_0x9481('0x15')+_0x56f151+'.'+_0x4d6a13)['where'](_0x56f151+_0x9481('0x39'),_0x62b05b)['where'](_0x9481('0x42'),NOW)[_0x9481('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9481('0x11')](_0x9481('0x12'))[_0x9481('0x13')]('cm_hopper_black')[_0x9481('0x16')](_0x9481('0x43'),_0x62b05b)['where'](_0x4d6a13+'\x20=\x20?',_0x56f151+'.'+_0x4d6a13)))[_0x9481('0x44')]();}function insertCmHopperAdditionalPhones(_0x5f063a){var _0x1203e8=[_0x9481('0x45'),_0x9481('0x46'),_0x9481('0x47'),_0x9481('0x48'),'cm_contact_has_items.updatedAt'];return squel[_0x9481('0x2b')]()[_0x9481('0x2c')]('cm_hopper_additional_phones')[_0x9481('0x2d')]([_0x9481('0x49'),_0x9481('0x12'),_0x9481('0x4a'),_0x9481('0x30'),_0x9481('0x31')],squel[_0x9481('0x10')]()[_0x9481('0x35')](_0x1203e8)[_0x9481('0x13')]('cm_hopper')[_0x9481('0x14')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x9481('0x14')]('cm_contact_has_items',null,_0x9481('0x4b'))[_0x9481('0x16')]('cm_hopper.ListId\x20=\x20?',_0x5f063a)[_0x9481('0x16')](_0x9481('0x42'),NOW))[_0x9481('0x44')]();}function insertCmContact(_0x13b674,_0x190e5a,_0x4257df,_0x4c5e54){var _0x5a2893=_[_0x9481('0x4c')](_[_0x9481('0x4d')](_0x4c5e54),[_0x9481('0x2f'),_0x9481('0x4e'),_0x9481('0x30'),_0x9481('0x31')]);return squel[_0x9481('0x2b')]()[_0x9481('0x2c')]('cm_contacts')[_0x9481('0x2d')](_0x5a2893,squel[_0x9481('0x10')]()[_0x9481('0x35')](_0x5a2893)[_0x9481('0x13')](_0x190e5a)[_0x9481('0x16')]('('+_0x4257df['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x9481('0x10')]()[_0x9481('0x35')](_0x4257df)[_0x9481('0x13')]('cm_contacts')['where']('ListId\x20=\x20?',_0x13b674)['where']('deletedAt\x20IS\x20NULL'))['where']('id\x20IN\x20?',squel[_0x9481('0x10')]()[_0x9481('0x11')]('MIN(id)',_0x9481('0x4f'))['from'](_0x190e5a)[_0x9481('0x50')](_0x4257df[_0x9481('0x14')](','))))[_0x9481('0x44')]();}function handleStop(){logger[_0x9481('0x51')](_0x9481('0x52'));stopped=!![];}function handleUncaughtException(_0x7e6ea0){logger[_0x9481('0x53')](_0x7e6ea0['message']);process[_0x9481('0x54')](0x1);}function handleError(_0x1b51b7,_0x4dc5cc){stats[_0x9481('0x55')][_0x9481('0x1c')]({'name':_0x4dc5cc[_0x9481('0x56')],'message':_0x4dc5cc[_0x9481('0x57')],'row':_0x1b51b7});}function handleQuery(_0x2739c4){logger['info'](_0x2739c4);return db[_0x9481('0x58')][_0x9481('0x59')](_0x2739c4)[_0x9481('0x5a')](function(_0x3fc0f9){results[_0x9481('0x1c')](_0x3fc0f9);})[_0x9481('0x5b')](function(_0x2927f5){logger[_0x9481('0x53')](_0x2927f5[_0x9481('0x57')]);});}function main(_0x4e3379,_0x5b9e49,_0x5b4234,_0x3240df){logger[_0x9481('0x51')]('main',_0x4e3379,JSON[_0x9481('0x5c')](_0x5b9e49));process[_0x9481('0x5d')](_0x9481('0x5e'));var _0x189294=_0x5b9e49[_0x9481('0x5f')];var _0x34dd08=_['clone'](_0x189294);var _0x580aa7=_0x5b9e49[_0x9481('0x60')];var _0x3cbab5=path[_0x9481('0x14')](config[_0x9481('0x61')],_0x9481('0x62'),_0x580aa7+_0x9481('0x63'));logger['info']('body',_0x5b9e49);db[_0x9481('0x64')]['findAll']({'raw':!![],'attributes':['id',_0x9481('0x65')]})['then'](function(_0x9af916){for(var _0x28485c=0x0;_0x28485c<_0x9af916[_0x9481('0x1b')];_0x28485c++){if(_0x9af916[_0x28485c]['name']in _0x189294){contactItemTypes[_0x9481('0x1c')](_0x9af916[_0x28485c]);delete _0x34dd08[_0x9af916[_0x28485c][_0x9481('0x65')]];hasAdditionalPhones=!![];}for(var _0x512bba in _0x189294){if(_0x9af916[_0x28485c]['name']+'_description'===_0x512bba){phoneDescriptions['push']({'itemTypeId':_0x9af916[_0x28485c]['id'],'description':_0x512bba});delete _0x34dd08[_0x512bba];}}}if(hasAdditionalPhones)_0x34dd08[_0x9481('0x1a')]='';var _0x55276b=_[_0x9481('0x4d')](_0x34dd08)[_0x9481('0x14')]();logger[_0x9481('0x51')]('header',_0x55276b);fs[_0x9481('0x66')](_0x3cbab5,_0x55276b+'\x0a');Papa['parse'](fs[_0x9481('0x67')](_0x4e3379),{'header':!![],'skipEmptyLines':!![],'step':function(_0xdf1bd9,_0x3c267b){try{for(var _0x4f157d=0x0,_0x2f20b4=[];_0x4f157d<_0xdf1bd9[_0x9481('0x68')]['length'];_0x4f157d++){stats[_0x9481('0x69')]+=0x1;if(_0xdf1bd9[_0x9481('0x55')][_0x4f157d]){handleError(_0xdf1bd9[_0x9481('0x68')][_0x4f157d],_0xdf1bd9[_0x9481('0x55')][_0x4f157d]);}else{var _0x4363f4=[];var _0xa4ee8d=[];var _0x821899={};for(var _0x32ebde in _0x189294){let _0x51d395=contactItemTypes[_0x9481('0x6a')](_0x237d9b=>_0x237d9b[_0x9481('0x65')]===_0x32ebde);let _0x3daaff=contactItemTypes[_0x9481('0x6a')](_0x418597=>_0x418597[_0x9481('0x65')]+_0x9481('0x6b')===_0x32ebde);if(_['isNil'](_0x51d395)&&_[_0x9481('0x6c')](_0x3daaff)){if(_0x189294['hasOwnProperty'](_0x32ebde)){if(_0xdf1bd9['data'][_0x4f157d][_0x189294[_0x32ebde]]){var _0x5d3694=_['trim'](_0xdf1bd9['data'][_0x4f157d][_0x189294[_0x32ebde]]['replace'](/"/g,'\x27'));switch(_0x32ebde){case _0x9481('0x2e'):var _0x1b8f9f=moment(_0x5d3694,_0x9481('0xe'),!![]);if(_0x1b8f9f[_0x9481('0x6d')]()){_0x2f20b4['push']('\x22'+_0x5d3694+'\x22');}else{_0x4363f4[_0x9481('0x1c')](_0x9481('0x6e'));}break;case _0x9481('0x32'):var _0x2a4517=parseInt(_0x5d3694);_0x5d3694=_['isNaN'](_0x2a4517)||_0x2a4517<0x0||_0x2a4517>0x4?_0x3240df?0x3:0x2:_0x2a4517;_0x2f20b4['push']('\x22'+_0x5d3694+'\x22');break;case _0x9481('0x33'):var _0x264c4e=parseInt(_0x5d3694);if(_[_0x9481('0x6f')](_0x264c4e)&&_[_0x9481('0x70')](_0x5b4234,_0x264c4e)){_0x2f20b4[_0x9481('0x1c')]('\x22'+_0x264c4e+'\x22');}else{_0x4363f4['push'](_0x9481('0x71'));}break;case _0x9481('0x72'):if(isEmail(_0x5d3694)){_0x2f20b4[_0x9481('0x1c')]('\x22'+_0x5d3694+'\x22');}else{_0x4363f4[_0x9481('0x1c')](_0x9481('0x73'));}break;case _0x9481('0x74'):var _0x178d7b=moment(_0x5d3694,_0x9481('0x75'),!![]);if(_0x178d7b[_0x9481('0x6d')]()){_0x2f20b4[_0x9481('0x1c')]('\x22'+_0x5d3694+'\x22');}else{_0x4363f4[_0x9481('0x1c')](_0x9481('0x76'));}break;default:_0x2f20b4[_0x9481('0x1c')]('\x22'+_0x5d3694+'\x22');}}else{switch(_0x32ebde){case _0x9481('0x77'):case _0x9481('0x12'):_0x4363f4['push'](_0x32ebde+_0x9481('0x78'));break;default:_0x2f20b4[_0x9481('0x1c')]('\x22\x22');}}}}else{var _0x3f51c5='';if(!_[_0x9481('0x6c')](_0x51d395)){if(!_0x821899[_0x9481('0x79')](_0x51d395['id'])){if(!_[_0x9481('0x6c')](_0xdf1bd9[_0x9481('0x68')][_0x4f157d][_0x189294[_0x32ebde]])){var _0x5d3694=_[_0x9481('0x7a')](_0xdf1bd9[_0x9481('0x68')][_0x4f157d][_0x189294[_0x32ebde]]['replace'](/"/g,'\x27'));var _0x4ed94a=phoneDescriptions[_0x9481('0x6a')](_0x4e7bad=>_0x4e7bad['itemTypeId']===_0x51d395['id']);if(!_[_0x9481('0x6c')](_0x4ed94a)){var _0x5310dd=_[_0x9481('0x7a')](_0xdf1bd9[_0x9481('0x68')][_0x4f157d][_0x189294[_0x4ed94a[_0x9481('0x7b')]]][_0x9481('0x7c')](/"/g,'\x27'));if(!_['isNil'](_0x5310dd))_0x5d3694=_0x5d3694+'§'+_0x5310dd;}if(_0x3f51c5=='')_0x3f51c5=_0x5d3694;else _0x3f51c5+='|'+_0x5d3694;}_0xa4ee8d[_0x9481('0x1c')](_0x51d395['id']+':'+_0x3f51c5);_0x821899[_0x51d395['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2f20b4['push']('\x22'+_0xa4ee8d[_0x9481('0x14')](';')+'\x22');}if(_0x4363f4[_0x9481('0x1b')]){handleError(_0xdf1bd9[_0x9481('0x68')][_0x4f157d],{'code':'SystemRow','message':_0x4363f4['join']()});}else{fs['appendFileSync'](_0x3cbab5,_0x2f20b4[_0x9481('0x14')]()+'\x0a');}_0x2f20b4=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x9481('0x7d')+_0x580aa7,stats);stats[_0x9481('0x55')]=[];}}if(stopped){logger[_0x9481('0x51')]('Abort\x20parser');_0x3c267b[_0x9481('0x7e')]();}}catch(_0x3e2184){handleError(_0xdf1bd9['data'][_0x4f157d],{'code':_0x9481('0x7f'),'message':_0x3e2184[_0x9481('0x57')]});logger[_0x9481('0x53')](_0x9481('0x80'),_0x3e2184['message']);}},'complete':function(){try{var _0x2e585d=[];var _0x4962f0=_0x9481('0x36');if(_0x5b9e49[_0x9481('0x81')]&&_0x5b9e49['duplicates'][_0x9481('0x1b')]){_0x4962f0=_0x9481('0x82')+_0x580aa7;_0x2e585d[_0x9481('0x1c')]('CREATE\x20TABLE\x20'+_0x4962f0+'\x20LIKE\x20cm_contacts;');}var _0xcc7bd9=util['format'](_0x9481('0x83'),_0x3cbab5,_0x4962f0,_0x55276b,_0x5b9e49[_0x9481('0x2f')],_0x5b9e49[_0x9481('0x4e')]||null,NOW,NOW);if(_['isNil'](_0x189294[_0x9481('0x2e')])){_0xcc7bd9+=_0x9481('0x84');}_0x2e585d[_0x9481('0x1c')](_0xcc7bd9);if(_0x5b9e49['duplicates']&&_0x5b9e49[_0x9481('0x81')][_0x9481('0x1b')]){_0x2e585d[_0x9481('0x1c')](insertCmContact(_0x5b9e49[_0x9481('0x2f')],_0x4962f0,_0x5b9e49[_0x9481('0x81')],_0x189294));_0x2e585d[_0x9481('0x1c')](_0x9481('0x85')+_0x4962f0+';');}BPromise[_0x9481('0x86')](_0x2e585d,handleQuery)[_0x9481('0x1e')](function(_0x31b70b){BPromise['all']([handleAdditionalPhones()])[_0x9481('0x1e')](function(){_0x2e585d=[];for(var _0x5c430e=0x0;_0x5c430e<promisesAdditionalPhones['length'];_0x5c430e++){if(promisesAdditionalPhones[_0x5c430e]['phone']!='§'){_0x2e585d[_0x9481('0x1c')](createAdditionalPhone(promisesAdditionalPhones[_0x5c430e][_0x9481('0x87')],promisesAdditionalPhones[_0x5c430e][_0x9481('0x88')],promisesAdditionalPhones[_0x5c430e][_0x9481('0x12')],promisesAdditionalPhones[_0x5c430e][_0x9481('0x89')]));}}BPromise['all'](_0x2e585d)[_0x9481('0x1e')](function(){_0x2e585d=[];_0x2e585d[_0x9481('0x1c')](insertCmHopper(_0x5b9e49[_0x9481('0x2f')],_0x9481('0x8a'),_0x9481('0x8b'),_0x9481('0x8c'),_0x3240df));_0x2e585d[_0x9481('0x1c')](insertCmHopperBlack(_0x5b9e49[_0x9481('0x2f')],_0x9481('0x8d'),_0x9481('0x8b'),'VoiceQueueId'));_0x2e585d[_0x9481('0x1c')](insertCmHopper(_0x5b9e49[_0x9481('0x2f')],_0x9481('0x8e'),_0x9481('0x8f'),_0x9481('0x90'),_0x3240df));_0x2e585d[_0x9481('0x1c')](insertCmHopperBlack(_0x5b9e49[_0x9481('0x2f')],_0x9481('0x91'),_0x9481('0x8f'),_0x9481('0x90')));_0x2e585d['push'](insertCmHopperAdditionalPhones(_0x5b9e49[_0x9481('0x2f')]));BPromise[_0x9481('0x86')](_0x2e585d,handleQuery)[_0x9481('0x1e')](function(_0x1f10c8){stats[_0x9481('0x92')]=!![];stats[_0x9481('0x93')]=_0x5b9e49[_0x9481('0x81')]&&_0x5b9e49[_0x9481('0x81')][_0x9481('0x1b')]?results[0x2]['affectedRows']:results[0x0][_0x9481('0x93')];socket['emit']('contact:import:'+_0x580aa7,stats);fs[_0x9481('0x94')](_0x4e3379);fs[_0x9481('0x94')](_0x3cbab5);process[_0x9481('0x54')](0x0);})[_0x9481('0x5b')](function(_0x2c4a99){logger[_0x9481('0x53')](_0x2c4a99['message']);process[_0x9481('0x54')](0x1);});});});})['catch'](function(_0x4bc7ea){logger[_0x9481('0x53')](_0x4bc7ea[_0x9481('0x57')]);process['exit'](0x1);});}catch(_0x5453b5){logger[_0x9481('0x53')](_0x9481('0x95'),_0x5453b5[_0x9481('0x57')]);process[_0x9481('0x54')](0x1);}},'error':function(_0x6a730c,_0x457c32,_0x17c099,_0x2c8d0d){throw new Error(_0x2c8d0d);}});});}function validate(){if(process[_0x9481('0x96')]&&process['argv'][_0x9481('0x1b')]<0x4){throw new Error(_0x9481('0x97'));}var _0x4e84b6=path[_0x9481('0x14')](config['root'],_0x9481('0x62'),process[_0x9481('0x96')][0x2]);if(!fs['existsSync'](_0x4e84b6)){throw new Error(_0x9481('0x98'));}var _0x15e194={};try{_0x15e194=JSON[_0x9481('0x99')](process['argv'][0x3]);if(!_0x15e194[_0x9481('0x5f')]){throw new Error(_0x9481('0x9a'));}if(!_0x15e194['binding'][_0x9481('0x12')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x15e194[_0x9481('0x5f')][_0x9481('0x77')]){throw new Error(_0x9481('0x9b'));}var _0x4fea1a=0x0;if(_0x15e194['binding'][_0x9481('0x33')]){_0x4fea1a=0x1;}if(!_0x15e194[_0x9481('0x2f')]){throw new Error(_0x9481('0x9c'));}}catch(_0x338403){throw new Error(_0x9481('0x9d'));}var _0x4181b5=[];try{_0x4181b5=_['map'](JSON[_0x9481('0x99')](process[_0x9481('0x96')][0x4]),'id');}catch(_0x232b8c){logger[_0x9481('0x51')](_0x9481('0x9e'));}main(_0x4e84b6,_0x15e194,_0x4181b5,_0x4fea1a);}validate();process['on'](_0x9481('0x9f'),handleStop);process['on'](_0x9481('0xa0'),handleUncaughtException);
\ No newline at end of file
+var _0xe3da=['phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','test','field','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','length','all','split','push','filter','CmContactHasItem','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','ListId','updatedAt','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','ContactId','createdAt','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','fromQuery','OrderBy','cm_contacts','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','message','errors','info','sequelize','query','spread','catch','start','clone','root','server/files/tmp','.csv','body','ContactItemType','name','AdditionalPhones','header','writeFileSync','parse','createReadStream','data','find','_description','isNil','hasOwnProperty','trim','replace','scheduledat','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','UserId','email\x20wrong\x20format','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','rows','emit','Abort\x20parser','SystemError','duplicates','cm_contacts_','\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',',\x20scheduledAt\x20=\x20NOW()','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','campaigns','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','binding','binding\x20doesn\x27t\x20exists'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var fs=require('fs');var path=require(_0xae3d('0x0'));var _=require(_0xae3d('0x1'));var Papa=require(_0xae3d('0x2'));var util=require(_0xae3d('0x3'));var BPromise=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var squel=require(_0xae3d('0x6'));var Redis=require(_0xae3d('0x7'));var db=require(_0xae3d('0x8'))['db'];var config=require(_0xae3d('0x9'));var logger=require(_0xae3d('0xa'))(_0xae3d('0xb'));config[_0xae3d('0xc')]=_[_0xae3d('0xd')](config[_0xae3d('0xc')],{'host':_0xae3d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae3d('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xae3d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x577070){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))*$/[_0xae3d('0x10')](_0x577070);}function selectNotIn(_0x157a3e,_0x420e28,_0x124833,_0x2705b8,_0x15d6da){return squel['select']()[_0xae3d('0x11')]('phone')[_0xae3d('0x12')](_0x2705b8)[_0xae3d('0x13')](_0x420e28,null,_0x420e28+_0xae3d('0x14')+_0x2705b8+'.'+_0x124833)[_0xae3d('0x15')](_0x2705b8+'.'+_0x124833+'\x20=\x20'+_0x157a3e+'.'+_0x124833)[_0xae3d('0x15')](_0x420e28+_0xae3d('0x16')+_0x15d6da[_0xae3d('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1605ac,_0x2afdd3){promisesAdditionalPhones=[];return db[_0xae3d('0x17')][_0xae3d('0x18')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xae3d('0x19')](function(_0x42f4b4){if(_0x42f4b4!==null){var _0x46295b=[];for(var _0x230afb=0x0;_0x230afb<_0x42f4b4[_0xae3d('0x1a')];_0x230afb++){var _0x2da957=_0x42f4b4[_0x230afb];_0x46295b['push'](insertAdditionalPhones(_0x2da957));}}Promise[_0xae3d('0x1b')](_0x46295b)[_0xae3d('0x19')](function(){_0x1605ac({'val':0x1});});});});}function insertAdditionalPhones(_0x2e31f1){return new Promise(function(_0x5303c2,_0x3f8cf9){var _0x4cbe4e=_0x2e31f1['AdditionalPhones'];var _0x4d931d=_0x4cbe4e[_0xae3d('0x1c')](';');var _0x46a6d7=[];orderBy=0x0;for(var _0x19c44d=0x0;_0x19c44d<_0x4d931d[_0xae3d('0x1a')];_0x19c44d++){_0x46a6d7[_0xae3d('0x1d')](splitAdditionalPhone(_0x2e31f1['id'],_0x4d931d[_0x19c44d]));}Promise['all'](_0x46a6d7)[_0xae3d('0x19')](function(){_0x5303c2({'val':_0x4d931d['length']});});});}function splitAdditionalPhone(_0x4a09c2,_0x2d138f){return new Promise(function(_0x1415e8,_0x263b0e){var _0x1facc1=_0x2d138f[_0xae3d('0x1c')](':');var _0x26c419=_0x1facc1[0x0];var _0x155099=_0x1facc1[0x1];if(_0x155099!==''){var _0x3224ff=_0x155099[_0xae3d('0x1c')]('|');var _0x300be8=[];for(var _0x9bf34a=0x0;_0x9bf34a<_0x3224ff[_0xae3d('0x1a')];_0x9bf34a++){if(_0x3224ff[_0x9bf34a]!==''){var _0x1b2acb=_[_0xae3d('0x1e')](promisesAdditionalPhones,{'contactId':_0x4a09c2,'phone':_0x3224ff[_0x9bf34a]});if(_0x1b2acb[_0xae3d('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xae3d('0x1d')]({'contactId':_0x4a09c2,'contactTypeId':_0x26c419,'phone':_0x3224ff[_0x9bf34a],'orderBy':orderBy});}}}_0x1415e8({'ok':0x1});}else _0x1415e8({'res':0x0});});}function createAdditionalPhone(_0x21b608,_0x2131e9,_0x1b1217,_0x5d45db){var _0x16c014='';var _0x185e71='';var _0xb5940=_0x1b1217[_0xae3d('0x1c')]('§');_0x16c014=_0xb5940[0x0];if(_0xb5940[_0xae3d('0x1a')]==0x2)_0x185e71=_0xb5940[0x1];return new Promise(function(_0x4391db,_0x8de288){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x21b608,'item':_0x16c014}})[_0xae3d('0x19')](function(_0x1281aa){if(_0x1281aa){return db[_0xae3d('0x1f')][_0xae3d('0x20')]({'ItemTypeId':_0x2131e9,'description':_0x185e71,'OrderBy':_0x5d45db},{'where':{'CmContactId':_0x21b608,'item':_0x16c014}})[_0xae3d('0x19')](function(_0x561371){_0x4391db({'res':_0xae3d('0x21')});});}else{return db[_0xae3d('0x1f')]['create']({'CmContactId':_0x21b608,'item':_0x16c014,'description':_0x185e71,'ItemTypeId':_0x2131e9,'OrderBy':_0x5d45db,'ItemClass':_0xae3d('0x22')})[_0xae3d('0x19')](function(_0x2cf750){_0x4391db({'res':_0xae3d('0x23')});});}});});}function insertCmHopper(_0x432c04,_0x6ef13c,_0x5356d4,_0x49125f,_0x5bd5bb){var _0x5cfdae=[_0xae3d('0x24'),_0xae3d('0x25'),_0xae3d('0x26'),'cm_contacts.ListId',_0x6ef13c+'.'+_0x49125f,_0xae3d('0x27'),_0xae3d('0x28'),_0xae3d('0x29'),_0xae3d('0x2a'),'\x22'+_0x5bd5bb+'\x22'];return squel[_0xae3d('0x2b')]()[_0xae3d('0x2c')](_0xae3d('0x2d'))['fromQuery']([_0xae3d('0x2e'),'scheduledat','ContactId',_0xae3d('0x2f'),_0x49125f,'createdAt',_0xae3d('0x30'),'priority','UserId',_0xae3d('0x31')],squel[_0xae3d('0x32')]()[_0xae3d('0x33')](_0x5cfdae)['from'](_0x6ef13c)[_0xae3d('0x13')]('cm_contacts',null,_0xae3d('0x34')+_0x6ef13c+_0xae3d('0x35'))[_0xae3d('0x13')](_0x5356d4,null,_0x5356d4+_0xae3d('0x14')+_0x6ef13c+'.'+_0x49125f)[_0xae3d('0x15')](_0x6ef13c+_0xae3d('0x36'),_0x432c04)[_0xae3d('0x15')](_0xae3d('0x37'),NOW)[_0xae3d('0x15')](_0xae3d('0x38'),selectNotIn(_0x6ef13c,_0x5356d4,_0x49125f,_0xae3d('0x2d'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xae3d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x6ef13c,_0x5356d4,_0x49125f,_0xae3d('0x2d'),[_0xae3d('0x39')])))[_0xae3d('0x3a')]();}function insertCmHopperBlack(_0x1581b2,_0x2c2892,_0x35db44,_0x238e65){var _0x15350d=[_0xae3d('0x24'),_0xae3d('0x26'),_0xae3d('0x3b'),_0x2c2892+'.'+_0x238e65,'cm_contacts.createdAt',_0xae3d('0x28')];return squel[_0xae3d('0x2b')]()[_0xae3d('0x2c')]('cm_hopper_black')['fromQuery']([_0xae3d('0x2e'),_0xae3d('0x3c'),'ListId',_0x238e65,_0xae3d('0x3d'),_0xae3d('0x30')],squel[_0xae3d('0x32')]()[_0xae3d('0x33')](_0x15350d)[_0xae3d('0x12')](_0x2c2892)[_0xae3d('0x13')]('cm_contacts',null,_0xae3d('0x34')+_0x2c2892+_0xae3d('0x35'))[_0xae3d('0x13')](_0x35db44,null,_0x35db44+_0xae3d('0x14')+_0x2c2892+'.'+_0x238e65)[_0xae3d('0x15')](_0x2c2892+'.CmListId\x20=\x20?',_0x1581b2)[_0xae3d('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xae3d('0x15')](_0xae3d('0x38'),squel[_0xae3d('0x32')]()[_0xae3d('0x11')]('phone')['from']('cm_hopper_black')[_0xae3d('0x15')](_0xae3d('0x3e'),_0x1581b2)['where'](_0x238e65+'\x20=\x20?',_0x2c2892+'.'+_0x238e65)))['toString']();}function insertCmHopperAdditionalPhones(_0xa279ea){var _0x2fdc6e=[_0xae3d('0x3f'),_0xae3d('0x40'),_0xae3d('0x41'),_0xae3d('0x42'),_0xae3d('0x43')];return squel['insert']()['into']('cm_hopper_additional_phones')[_0xae3d('0x44')](['CmHopperId',_0xae3d('0x2e'),_0xae3d('0x45'),_0xae3d('0x3d'),_0xae3d('0x30')],squel[_0xae3d('0x32')]()[_0xae3d('0x33')](_0x2fdc6e)[_0xae3d('0x12')](_0xae3d('0x2d'))[_0xae3d('0x13')](_0xae3d('0x46'),null,_0xae3d('0x47'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xae3d('0x15')](_0xae3d('0x48'),_0xa279ea)[_0xae3d('0x15')](_0xae3d('0x37'),NOW))['toString']();}function insertCmContact(_0x5bacb2,_0x2b0e90,_0x2930a6,_0x3a7610){var _0x247a37=_['concat'](_[_0xae3d('0x49')](_0x3a7610),[_0xae3d('0x2f'),_0xae3d('0x4a'),_0xae3d('0x3d'),_0xae3d('0x30')]);return squel[_0xae3d('0x2b')]()[_0xae3d('0x2c')](_0xae3d('0x46'))[_0xae3d('0x44')](_0x247a37,squel[_0xae3d('0x32')]()[_0xae3d('0x33')](_0x247a37)[_0xae3d('0x12')](_0x2b0e90)['where']('('+_0x2930a6['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xae3d('0x32')]()[_0xae3d('0x33')](_0x2930a6)['from'](_0xae3d('0x46'))['where']('ListId\x20=\x20?',_0x5bacb2)[_0xae3d('0x15')](_0xae3d('0x4b')))[_0xae3d('0x15')](_0xae3d('0x4c'),squel[_0xae3d('0x32')]()[_0xae3d('0x11')](_0xae3d('0x4d'),'min_id')[_0xae3d('0x12')](_0x2b0e90)[_0xae3d('0x4e')](_0x2930a6[_0xae3d('0x13')](','))))[_0xae3d('0x3a')]();}function handleStop(){logger['info'](_0xae3d('0x4f'));stopped=!![];}function handleUncaughtException(_0x155c3a){logger[_0xae3d('0x50')](_0x155c3a[_0xae3d('0x51')]);process['exit'](0x1);}function handleError(_0x5279a0,_0x495979){stats[_0xae3d('0x52')]['push']({'name':_0x495979['code'],'message':_0x495979[_0xae3d('0x51')],'row':_0x5279a0});}function handleQuery(_0x1e8f2f){logger[_0xae3d('0x53')](_0x1e8f2f);return db[_0xae3d('0x54')][_0xae3d('0x55')](_0x1e8f2f)[_0xae3d('0x56')](function(_0x4bcf41){results[_0xae3d('0x1d')](_0x4bcf41);})[_0xae3d('0x57')](function(_0x1f9367){logger[_0xae3d('0x50')](_0x1f9367[_0xae3d('0x51')]);});}function main(_0x91ba60,_0x4a2913,_0x3cb7bd,_0x2c1e5e){logger[_0xae3d('0x53')]('main',_0x91ba60,JSON['stringify'](_0x4a2913));process['send'](_0xae3d('0x58'));var _0x44e369=_0x4a2913['binding'];var _0x209364=_[_0xae3d('0x59')](_0x44e369);var _0x363595=_0x4a2913['socket_timestamp'];var _0x3a39ed=path[_0xae3d('0x13')](config[_0xae3d('0x5a')],_0xae3d('0x5b'),_0x363595+_0xae3d('0x5c'));logger[_0xae3d('0x53')](_0xae3d('0x5d'),_0x4a2913);db[_0xae3d('0x5e')]['findAll']({'raw':!![],'attributes':['id','name']})[_0xae3d('0x19')](function(_0x8b9eac){for(var _0x3d0a1a=0x0;_0x3d0a1a<_0x8b9eac['length'];_0x3d0a1a++){if(_0x8b9eac[_0x3d0a1a]['name']in _0x44e369){contactItemTypes[_0xae3d('0x1d')](_0x8b9eac[_0x3d0a1a]);delete _0x209364[_0x8b9eac[_0x3d0a1a][_0xae3d('0x5f')]];hasAdditionalPhones=!![];}for(var _0xa766eb in _0x44e369){if(_0x8b9eac[_0x3d0a1a][_0xae3d('0x5f')]+'_description'===_0xa766eb){phoneDescriptions[_0xae3d('0x1d')]({'itemTypeId':_0x8b9eac[_0x3d0a1a]['id'],'description':_0xa766eb});delete _0x209364[_0xa766eb];}}}if(hasAdditionalPhones)_0x209364[_0xae3d('0x60')]='';var _0x51d7e6=_[_0xae3d('0x49')](_0x209364)[_0xae3d('0x13')]();logger[_0xae3d('0x53')](_0xae3d('0x61'),_0x51d7e6);fs[_0xae3d('0x62')](_0x3a39ed,_0x51d7e6+'\x0a');Papa[_0xae3d('0x63')](fs[_0xae3d('0x64')](_0x91ba60),{'header':!![],'skipEmptyLines':!![],'step':function(_0x551269,_0xe340c1){try{for(var _0x12f04a=0x0,_0x22828c=[];_0x12f04a<_0x551269[_0xae3d('0x65')][_0xae3d('0x1a')];_0x12f04a++){stats['rows']+=0x1;if(_0x551269[_0xae3d('0x52')][_0x12f04a]){handleError(_0x551269[_0xae3d('0x65')][_0x12f04a],_0x551269[_0xae3d('0x52')][_0x12f04a]);}else{var _0x664cdc=[];var _0x1864b6=[];var _0x1f47bb={};for(var _0x53f91b in _0x44e369){let _0x12be23=contactItemTypes[_0xae3d('0x66')](_0x51a078=>_0x51a078[_0xae3d('0x5f')]===_0x53f91b);let _0x343584=contactItemTypes[_0xae3d('0x66')](_0x506992=>_0x506992['name']+_0xae3d('0x67')===_0x53f91b);if(_[_0xae3d('0x68')](_0x12be23)&&_[_0xae3d('0x68')](_0x343584)){if(_0x44e369[_0xae3d('0x69')](_0x53f91b)){if(_0x551269[_0xae3d('0x65')][_0x12f04a][_0x44e369[_0x53f91b]]){var _0x199993=_[_0xae3d('0x6a')](_0x551269['data'][_0x12f04a][_0x44e369[_0x53f91b]][_0xae3d('0x6b')](/"/g,'\x27'));switch(_0x53f91b){case _0xae3d('0x6c'):var _0x4e3161=moment(_0x199993,_0xae3d('0x6d'),!![]);if(_0x4e3161['isValid']()){_0x22828c[_0xae3d('0x1d')]('\x22'+_0x199993+'\x22');}else{_0x664cdc[_0xae3d('0x1d')](_0xae3d('0x6e'));}break;case _0xae3d('0x6f'):var _0x21923a=parseInt(_0x199993);_0x199993=_['isNaN'](_0x21923a)||_0x21923a<0x0||_0x21923a>0x4?_0x2c1e5e?0x3:0x2:_0x21923a;_0x22828c[_0xae3d('0x1d')]('\x22'+_0x199993+'\x22');break;case _0xae3d('0x70'):var _0x2adb34=parseInt(_0x199993);if(_['isNumber'](_0x2adb34)&&_['includes'](_0x3cb7bd,_0x2adb34)){_0x22828c[_0xae3d('0x1d')]('\x22'+_0x2adb34+'\x22');}else{_0x664cdc[_0xae3d('0x1d')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x199993)){_0x22828c[_0xae3d('0x1d')]('\x22'+_0x199993+'\x22');}else{_0x664cdc['push'](_0xae3d('0x71'));}break;case'dateOfBirth':var _0x5d1c4f=moment(_0x199993,'YYYY-MM-DD',!![]);if(_0x5d1c4f['isValid']()){_0x22828c[_0xae3d('0x1d')]('\x22'+_0x199993+'\x22');}else{_0x664cdc[_0xae3d('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x22828c['push']('\x22'+_0x199993+'\x22');}}else{switch(_0x53f91b){case _0xae3d('0x72'):case _0xae3d('0x2e'):_0x664cdc[_0xae3d('0x1d')](_0x53f91b+_0xae3d('0x73'));break;default:_0x22828c[_0xae3d('0x1d')]('\x22\x22');}}}}else{var _0x170cfc='';if(!_[_0xae3d('0x68')](_0x12be23)){if(!_0x1f47bb['hasOwnProperty'](_0x12be23['id'])){if(!_[_0xae3d('0x68')](_0x551269[_0xae3d('0x65')][_0x12f04a][_0x44e369[_0x53f91b]])){var _0x199993=_[_0xae3d('0x6a')](_0x551269[_0xae3d('0x65')][_0x12f04a][_0x44e369[_0x53f91b]][_0xae3d('0x6b')](/"/g,'\x27'));var _0x51e248=phoneDescriptions[_0xae3d('0x66')](_0x1e172e=>_0x1e172e['itemTypeId']===_0x12be23['id']);if(!_['isNil'](_0x51e248)){var _0x172b69=_[_0xae3d('0x6a')](_0x551269['data'][_0x12f04a][_0x44e369[_0x51e248[_0xae3d('0x74')]]][_0xae3d('0x6b')](/"/g,'\x27'));if(!_[_0xae3d('0x68')](_0x172b69))_0x199993=_0x199993+'§'+_0x172b69;}if(_0x170cfc=='')_0x170cfc=_0x199993;else _0x170cfc+='|'+_0x199993;}_0x1864b6['push'](_0x12be23['id']+':'+_0x170cfc);_0x1f47bb[_0x12be23['id']]=0x1;}}}}if(hasAdditionalPhones){_0x22828c[_0xae3d('0x1d')]('\x22'+_0x1864b6[_0xae3d('0x13')](';')+'\x22');}if(_0x664cdc['length']){handleError(_0x551269['data'][_0x12f04a],{'code':_0xae3d('0x75'),'message':_0x664cdc[_0xae3d('0x13')]()});}else{fs[_0xae3d('0x76')](_0x3a39ed,_0x22828c['join']()+'\x0a');}_0x22828c=[];}if(!(stats[_0xae3d('0x77')]%0xc8)){socket[_0xae3d('0x78')]('contact:import:'+_0x363595,stats);stats[_0xae3d('0x52')]=[];}}if(stopped){logger[_0xae3d('0x53')](_0xae3d('0x79'));_0xe340c1['abort']();}}catch(_0x46ea6a){handleError(_0x551269[_0xae3d('0x65')][_0x12f04a],{'code':_0xae3d('0x7a'),'message':_0x46ea6a['message']});logger[_0xae3d('0x50')]('step',_0x46ea6a[_0xae3d('0x51')]);}},'complete':function(){try{var _0x48ef2a=[];var _0x56f7d2=_0xae3d('0x46');if(_0x4a2913['duplicates']&&_0x4a2913[_0xae3d('0x7b')][_0xae3d('0x1a')]){_0x56f7d2=_0xae3d('0x7c')+_0x363595;_0x48ef2a[_0xae3d('0x1d')]('CREATE\x20TABLE\x20'+_0x56f7d2+_0xae3d('0x7d'));}var _0xa3a5a2=util[_0xae3d('0xf')](_0xae3d('0x7e'),_0x3a39ed,_0x56f7d2,_0x51d7e6,_0x4a2913[_0xae3d('0x2f')],_0x4a2913[_0xae3d('0x4a')]||null,NOW,NOW);if(_[_0xae3d('0x68')](_0x44e369[_0xae3d('0x6c')])){_0xa3a5a2+=_0xae3d('0x7f');}_0x48ef2a[_0xae3d('0x1d')](_0xa3a5a2);if(_0x4a2913[_0xae3d('0x7b')]&&_0x4a2913[_0xae3d('0x7b')][_0xae3d('0x1a')]){_0x48ef2a[_0xae3d('0x1d')](insertCmContact(_0x4a2913[_0xae3d('0x2f')],_0x56f7d2,_0x4a2913[_0xae3d('0x7b')],_0x44e369));_0x48ef2a[_0xae3d('0x1d')]('DROP\x20TABLE\x20'+_0x56f7d2+';');}BPromise[_0xae3d('0x80')](_0x48ef2a,handleQuery)[_0xae3d('0x19')](function(_0x27f65b){BPromise[_0xae3d('0x1b')]([handleAdditionalPhones()])[_0xae3d('0x19')](function(){_0x48ef2a=[];for(var _0x5abda7=0x0;_0x5abda7<promisesAdditionalPhones[_0xae3d('0x1a')];_0x5abda7++){if(promisesAdditionalPhones[_0x5abda7][_0xae3d('0x2e')]!='§'){_0x48ef2a[_0xae3d('0x1d')](createAdditionalPhone(promisesAdditionalPhones[_0x5abda7][_0xae3d('0x81')],promisesAdditionalPhones[_0x5abda7][_0xae3d('0x82')],promisesAdditionalPhones[_0x5abda7][_0xae3d('0x2e')],promisesAdditionalPhones[_0x5abda7][_0xae3d('0x83')]));}}BPromise[_0xae3d('0x1b')](_0x48ef2a)['then'](function(){_0x48ef2a=[];_0x48ef2a[_0xae3d('0x1d')](insertCmHopper(_0x4a2913[_0xae3d('0x2f')],_0xae3d('0x84'),'voice_queues',_0xae3d('0x85'),_0x2c1e5e));_0x48ef2a[_0xae3d('0x1d')](insertCmHopperBlack(_0x4a2913[_0xae3d('0x2f')],'voice_queues_has_cm_blacklists',_0xae3d('0x86'),_0xae3d('0x85')));_0x48ef2a['push'](insertCmHopper(_0x4a2913[_0xae3d('0x2f')],'campaigns_has_cm_lists',_0xae3d('0x87'),'CampaignId',_0x2c1e5e));_0x48ef2a[_0xae3d('0x1d')](insertCmHopperBlack(_0x4a2913[_0xae3d('0x2f')],_0xae3d('0x88'),_0xae3d('0x87'),_0xae3d('0x89')));_0x48ef2a['push'](insertCmHopperAdditionalPhones(_0x4a2913[_0xae3d('0x2f')]));BPromise[_0xae3d('0x80')](_0x48ef2a,handleQuery)['then'](function(_0x546185){stats[_0xae3d('0x8a')]=!![];stats[_0xae3d('0x8b')]=_0x4a2913[_0xae3d('0x7b')]&&_0x4a2913[_0xae3d('0x7b')]['length']?results[0x2][_0xae3d('0x8b')]:results[0x0][_0xae3d('0x8b')];socket[_0xae3d('0x78')]('contact:import:'+_0x363595,stats);fs['unlink'](_0x91ba60);fs[_0xae3d('0x8c')](_0x3a39ed);process['exit'](0x0);})[_0xae3d('0x57')](function(_0x591894){logger[_0xae3d('0x50')](_0x591894[_0xae3d('0x51')]);process[_0xae3d('0x8d')](0x1);});});});})[_0xae3d('0x57')](function(_0x5b1d20){logger[_0xae3d('0x50')](_0x5b1d20[_0xae3d('0x51')]);process[_0xae3d('0x8d')](0x1);});}catch(_0x51988f){logger[_0xae3d('0x50')]('complete',_0x51988f[_0xae3d('0x51')]);process[_0xae3d('0x8d')](0x1);}},'error':function(_0x584679,_0x5e5b14,_0x27205c,_0x4d5fba){throw new Error(_0x4d5fba);}});});}function validate(){if(process['argv']&&process[_0xae3d('0x8e')]['length']<0x4){throw new Error(_0xae3d('0x8f'));}var _0x5c005e=path[_0xae3d('0x13')](config['root'],_0xae3d('0x5b'),process['argv'][0x2]);if(!fs[_0xae3d('0x90')](_0x5c005e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x13b282={};try{_0x13b282=JSON[_0xae3d('0x63')](process[_0xae3d('0x8e')][0x3]);if(!_0x13b282[_0xae3d('0x91')]){throw new Error(_0xae3d('0x92'));}if(!_0x13b282[_0xae3d('0x91')][_0xae3d('0x2e')]){throw new Error(_0xae3d('0x93'));}if(!_0x13b282[_0xae3d('0x91')]['firstName']){throw new Error(_0xae3d('0x94'));}var _0x1e9282=0x0;if(_0x13b282[_0xae3d('0x91')][_0xae3d('0x70')]){_0x1e9282=0x1;}if(!_0x13b282[_0xae3d('0x2f')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2e90c8){throw new Error(_0xae3d('0x95'));}var _0x32dec5=[];try{_0x32dec5=_['map'](JSON[_0xae3d('0x63')](process['argv'][0x4]),'id');}catch(_0x52e98e){logger[_0xae3d('0x53')]('No\x20agent\x20available');}main(_0x5c005e,_0x13b282,_0x32dec5,_0x1e9282);}validate();process['on'](_0xae3d('0x96'),handleStop);process['on'](_0xae3d('0x97'),handleUncaughtException);
\ No newline at end of file
index d003bcf..f849b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82df=['rows','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)','firstName','hasOwnProperty','itemTypeId','appendFileSync','contact:import:','errors','Abort\x20parser','step','\x20LIKE\x20cm_contacts;','CIS\x20len','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','contactId','contactTypeId','orderBy','affectedRows','unlink','complete','argv','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','test','select','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','split','all','filter','CmContactHasItem','updated','create','PHONE','inserted','CmContact','CmHopper','update','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','exit','code','main','stringify','send','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','data'];(function(_0x42f2ac,_0xdbb4e6){var _0x57f7ad=function(_0x893420){while(--_0x893420){_0x42f2ac['push'](_0x42f2ac['shift']());}};_0x57f7ad(++_0xdbb4e6);}(_0x82df,0x164));var _0xf82d=function(_0x23173a,_0x3a9e78){_0x23173a=_0x23173a-0x0;var _0x164fe1=_0x82df[_0x23173a];return _0x164fe1;};'use strict';var fs=require('fs');var path=require(_0xf82d('0x0'));var _=require(_0xf82d('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xf82d('0x2'));var moment=require(_0xf82d('0x3'));var squel=require(_0xf82d('0x4'));var Redis=require(_0xf82d('0x5'));var db=require(_0xf82d('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xf82d('0x7'))(_0xf82d('0x8'));config[_0xf82d('0x9')]=_[_0xf82d('0xa')](config['redis'],{'host':_0xf82d('0xb'),'port':0x18eb});var socket=require(_0xf82d('0xc'))(new Redis(config[_0xf82d('0x9')]));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'](_0xf82d('0xd'));var tempTableName=_0xf82d('0xe')+moment()[_0xf82d('0xf')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x45cdf0){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))*$/[_0xf82d('0x10')](_0x45cdf0);}function selectNotIn(_0x13325d,_0x15a058,_0x5da188,_0x5166a3,_0x1cc374){return squel[_0xf82d('0x11')]()['field'](_0xf82d('0x12'))[_0xf82d('0x13')](_0x5166a3)['join'](_0x15a058,null,_0x15a058+'.id\x20=\x20'+_0x5166a3+'.'+_0x5da188)[_0xf82d('0x14')](_0x5166a3+'.'+_0x5da188+_0xf82d('0x15')+_0x13325d+'.'+_0x5da188)['where'](_0x15a058+_0xf82d('0x16')+_0x1cc374[_0xf82d('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x162f04,_0x45baed){promisesAdditionalPhones=[];promisesContact=[];return db[_0xf82d('0x18')][_0xf82d('0x19')](_0xf82d('0x1a')+tempTableName)[_0xf82d('0x1b')](function(_0x3854f7){if(_0x3854f7!==null){var _0x99a7b4=[];for(var _0x11fe9d=0x0;_0x11fe9d<_0x3854f7[_0xf82d('0x1c')];_0x11fe9d++){var _0x3f4efd=_0x3854f7[_0x11fe9d];if(!_[_0xf82d('0x1d')](_0x3f4efd['phone'])){if(!_[_0xf82d('0x1d')](_0x3f4efd[_0xf82d('0x1e')]))_0x99a7b4['push'](insertAdditionalPhones(_0x3f4efd));promisesContact[_0xf82d('0x1f')]({'contact':_0x3f4efd});}}}Promise['all'](_0x99a7b4)[_0xf82d('0x20')](function(){_0x162f04({'val':0x1});});})[_0xf82d('0x21')](function(_0x1653fb){logger[_0xf82d('0x22')](_0x1653fb[_0xf82d('0x23')]);});});}function insertAdditionalPhones(_0x206699){return new Promise(function(_0x405335,_0x57d137){var _0x1d3b7e=_0x206699[_0xf82d('0x1e')];if(_['isNil'](_0x1d3b7e))_0x57d137({'val':0x0});else{var _0x330764=_0x1d3b7e[_0xf82d('0x24')](';');var _0x3375c2=[];orderBy=0x0;for(var _0x3847d9=0x0;_0x3847d9<_0x330764[_0xf82d('0x1c')];_0x3847d9++){_0x3375c2['push'](splitAdditionalPhone(_0x206699['id'],_0x330764[_0x3847d9]));}Promise[_0xf82d('0x25')](_0x3375c2)[_0xf82d('0x20')](function(){_0x405335({'val':_0x330764['length']});});}});}function splitAdditionalPhone(_0x2712e1,_0x5869f7){return new Promise(function(_0x1ecb15,_0xea0d20){var _0x49b3b5=_0x5869f7[_0xf82d('0x24')](':');var _0x241d1d=_0x49b3b5[0x0];var _0x553d72=_0x49b3b5[0x1];if(_0x553d72!==''){var _0x786b8e=_0x553d72[_0xf82d('0x24')]('|');var _0x1e0b85=[];for(var _0x187ad9=0x0;_0x187ad9<_0x786b8e[_0xf82d('0x1c')];_0x187ad9++){if(_0x786b8e[_0x187ad9]!==''){var _0x4437c9=_[_0xf82d('0x26')](promisesAdditionalPhones,{'contactId':_0x2712e1,'phone':_0x786b8e[_0x187ad9]});if(_0x4437c9[_0xf82d('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0xf82d('0x1f')]({'contactId':_0x2712e1,'contactTypeId':_0x241d1d,'phone':_0x786b8e[_0x187ad9],'orderBy':orderBy});}}}_0x1ecb15({'ok':0x1});}else _0x1ecb15({'res':0x0});});}function createAdditionalPhone(_0x15deb2,_0xa5dee5,_0x47f87f,_0x33596d){var _0x42ce5f='';var _0x12bd7d='';var _0x324044=_0x47f87f[_0xf82d('0x24')]('§');_0x42ce5f=_0x324044[0x0];if(_0x324044[_0xf82d('0x1c')]==0x2)_0x12bd7d=_0x324044[0x1];return new Promise(function(_0x42c79d,_0x5d581d){return db[_0xf82d('0x27')]['findOne']({'where':{'CmContactId':_0x15deb2,'item':_0x42ce5f}})[_0xf82d('0x20')](function(_0x46c75b){if(_0x46c75b){return db[_0xf82d('0x27')]['update']({'ItemTypeId':_0xa5dee5,'description':_0x12bd7d,'OrderBy':_0x33596d},{'where':{'CmContactId':_0x15deb2,'item':_0x42ce5f}})[_0xf82d('0x20')](function(_0x51af08){_0x42c79d({'res':_0xf82d('0x28')});});}else{return db['CmContactHasItem'][_0xf82d('0x29')]({'CmContactId':_0x15deb2,'item':_0x42ce5f,'ItemTypeId':_0xa5dee5,'description':_0x12bd7d,'OrderBy':_0x33596d,'ItemClass':_0xf82d('0x2a')})[_0xf82d('0x20')](function(_0x148780){_0x42c79d({'res':_0xf82d('0x2b')});});}});});}function updateContact(_0x32cff7){return new Promise(function(_0x1867f2,_0x3bddc2){var _0xca80dc=_0x32cff7['id'];delete _0x32cff7['id'];return db[_0xf82d('0x2c')]['update'](_0x32cff7,{'where':{'id':_0xca80dc}})['then'](function(_0x308d9d){updatedRows+=0x1;return db[_0xf82d('0x2d')][_0xf82d('0x2e')]({'phone':_0x32cff7[_0xf82d('0x12')]},{'where':{'ContactId':_0xca80dc}})[_0xf82d('0x20')](function(_0x30b2ce){_0x1867f2({'ret':'OK'});});});});}function insertCmHopper(_0x16362f,_0x559343,_0x442faa,_0x40474d,_0x3f30ba){var _0x2751db=['cm_contacts.phone',_0xf82d('0x2f'),_0xf82d('0x30'),_0xf82d('0x31'),_0x559343+'.'+_0x40474d,_0xf82d('0x32'),_0xf82d('0x33'),_0xf82d('0x34'),'cm_contacts.UserId','\x22'+_0x3f30ba+'\x22'];return squel[_0xf82d('0x35')]()[_0xf82d('0x36')](_0xf82d('0x37'))[_0xf82d('0x38')](['phone',_0xf82d('0x39'),_0xf82d('0x3a'),_0xf82d('0x3b'),_0x40474d,_0xf82d('0x3c'),_0xf82d('0x3d'),_0xf82d('0x3e'),'UserId',_0xf82d('0x3f')],squel[_0xf82d('0x11')]()[_0xf82d('0x40')](_0x2751db)[_0xf82d('0x13')](_0x559343)[_0xf82d('0x17')](_0xf82d('0x41'),null,_0xf82d('0x42')+_0x559343+'.CmListId')['join'](_0x442faa,null,_0x442faa+_0xf82d('0x43')+_0x559343+'.'+_0x40474d)[_0xf82d('0x14')](_0x559343+_0xf82d('0x44'),_0x16362f)[_0xf82d('0x14')](_0xf82d('0x45'),NOW)[_0xf82d('0x14')](_0xf82d('0x46'),selectNotIn(_0x559343,_0x442faa,_0x40474d,_0xf82d('0x37'),[_0xf82d('0x47'),'\x22onlyIfOpen\x22']))[_0xf82d('0x14')](_0xf82d('0x46'),selectNotIn(_0x559343,_0x442faa,_0x40474d,'cm_hopper',[_0xf82d('0x47')])))[_0xf82d('0x48')]();}function insertCmHopperBlack(_0x1567ad,_0xf483c8,_0x552be2,_0x1e0eed){var _0x594e99=[_0xf82d('0x49'),_0xf82d('0x30'),'cm_contacts.ListId',_0xf483c8+'.'+_0x1e0eed,_0xf82d('0x32'),'cm_contacts.updatedAt'];return squel[_0xf82d('0x35')]()[_0xf82d('0x36')](_0xf82d('0x4a'))[_0xf82d('0x38')]([_0xf82d('0x12'),'ContactId',_0xf82d('0x3b'),_0x1e0eed,_0xf82d('0x3c'),_0xf82d('0x3d')],squel[_0xf82d('0x11')]()[_0xf82d('0x40')](_0x594e99)[_0xf82d('0x13')](_0xf483c8)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0xf483c8+_0xf82d('0x4b'))[_0xf82d('0x17')](_0x552be2,null,_0x552be2+_0xf82d('0x43')+_0xf483c8+'.'+_0x1e0eed)[_0xf82d('0x14')](_0xf483c8+_0xf82d('0x44'),_0x1567ad)['where'](_0xf82d('0x45'),NOW)[_0xf82d('0x14')](_0xf82d('0x46'),squel['select']()[_0xf82d('0x4c')](_0xf82d('0x12'))[_0xf82d('0x13')](_0xf82d('0x4a'))['where'](_0xf82d('0x4d'),_0x1567ad)['where'](_0x1e0eed+_0xf82d('0x4e'),_0xf483c8+'.'+_0x1e0eed)))['toString']();}function insertCmHopperAdditionalPhones(_0x283826){var _0x257f77=[_0xf82d('0x4f'),_0xf82d('0x50'),_0xf82d('0x51'),_0xf82d('0x52'),_0xf82d('0x53')];return squel['insert']()['into'](_0xf82d('0x54'))[_0xf82d('0x38')](['CmHopperId',_0xf82d('0x12'),'OrderBy',_0xf82d('0x3c'),'updatedAt'],squel['select']()['fields'](_0x257f77)[_0xf82d('0x13')](_0xf82d('0x37'))[_0xf82d('0x17')](_0xf82d('0x41'),null,_0xf82d('0x55'))[_0xf82d('0x17')](_0xf82d('0x56'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xf82d('0x14')](_0xf82d('0x57'),_0x283826)[_0xf82d('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xf82d('0x48')]();}function insertCmContact(_0x4e8b34,_0x5c537d,_0x595a9b,_0x32989f){var _0x772825=_[_0xf82d('0x58')](_[_0xf82d('0x59')](_0x32989f),[_0xf82d('0x3b'),_0xf82d('0x5a'),_0xf82d('0x3c'),_0xf82d('0x3d')]);return squel[_0xf82d('0x35')]()[_0xf82d('0x36')](_0xf82d('0x41'))[_0xf82d('0x38')](_0x772825,squel[_0xf82d('0x11')]()[_0xf82d('0x40')](_0x772825)[_0xf82d('0x13')](_0x5c537d)[_0xf82d('0x14')]('('+_0x595a9b[_0xf82d('0x17')](',')+_0xf82d('0x5b'),squel[_0xf82d('0x11')]()['fields'](_0x595a9b)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0x4e8b34))['where'](_0xf82d('0x5c'),squel[_0xf82d('0x11')]()[_0xf82d('0x4c')](_0xf82d('0x5d'),'min_id')[_0xf82d('0x13')](_0x5c537d)[_0xf82d('0x5e')](_0x595a9b[_0xf82d('0x17')](','))))['toString']();}function handleStop(){logger[_0xf82d('0x5f')](_0xf82d('0x60'));stopped=!![];}function handleUncaughtException(_0x1e4253){logger['error'](_0x1e4253[_0xf82d('0x23')]);process[_0xf82d('0x61')](0x1);}function handleError(_0x5518ed,_0x225477){stats['errors'][_0xf82d('0x1f')]({'name':_0x225477[_0xf82d('0x62')],'message':_0x225477['message'],'row':_0x5518ed});}function handleQuery(_0x2ba4fd){logger['info'](_0x2ba4fd);return db['sequelize'][_0xf82d('0x19')](_0x2ba4fd)[_0xf82d('0x1b')](function(_0x5efcda){results[_0xf82d('0x1f')](_0x5efcda);})[_0xf82d('0x21')](function(_0x1d7a97){logger[_0xf82d('0x22')](_0x1d7a97[_0xf82d('0x23')]);});}function main(_0x129e06,_0x1338bb,_0x4c41df,_0x7ca0bc){logger[_0xf82d('0x5f')](_0xf82d('0x63'),_0x129e06,JSON[_0xf82d('0x64')](_0x1338bb));process[_0xf82d('0x65')]('start');var _0x1c3e8f=_0x1338bb[_0xf82d('0x66')];var _0x34e7ba=_[_0xf82d('0x67')](_0x1c3e8f);var _0x498b47=_0x1338bb[_0xf82d('0x68')];var _0x272ee1=path[_0xf82d('0x17')](config[_0xf82d('0x69')],_0xf82d('0x6a'),_0x498b47+_0xf82d('0x6b'));logger['info'](_0xf82d('0x6c'),_0x1338bb);db[_0xf82d('0x6d')][_0xf82d('0x6e')]({'raw':!![],'attributes':['id',_0xf82d('0x6f')]})[_0xf82d('0x20')](function(_0xf48d89){for(var _0x497487=0x0;_0x497487<_0xf48d89['length'];_0x497487++){if(_0xf48d89[_0x497487][_0xf82d('0x6f')]in _0x1c3e8f){contactItemTypes['push'](_0xf48d89[_0x497487]);delete _0x34e7ba[_0xf48d89[_0x497487]['name']];hasAdditionalPhones=!![];}for(var _0x1a7978 in _0x1c3e8f){if(_0xf48d89[_0x497487][_0xf82d('0x6f')]+_0xf82d('0x70')===_0x1a7978){phoneDescriptions[_0xf82d('0x1f')]({'itemTypeId':_0xf48d89[_0x497487]['id'],'description':_0x1a7978});delete _0x34e7ba[_0x1a7978];}}}if(hasAdditionalPhones)_0x34e7ba[_0xf82d('0x1e')]='';var _0x2acc03=_[_0xf82d('0x59')](_0x34e7ba)[_0xf82d('0x17')]();logger[_0xf82d('0x5f')](_0xf82d('0x71'),_0x2acc03);fs[_0xf82d('0x72')](_0x272ee1,_0x2acc03+'\x0a');Papa[_0xf82d('0x73')](fs[_0xf82d('0x74')](_0x129e06),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5b8353,_0x43503d){try{for(var _0xa30d0d=0x0,_0x289f29=[];_0xa30d0d<_0x5b8353[_0xf82d('0x75')][_0xf82d('0x1c')];_0xa30d0d++){stats[_0xf82d('0x76')]+=0x1;if(_0x5b8353['errors'][_0xa30d0d]){handleError(_0x5b8353['data'][_0xa30d0d],_0x5b8353['errors'][_0xa30d0d]);}else{var _0x35f30d=[];var _0x118aa0=[];var _0x21ca0d={};for(var _0x5bcc12 in _0x1c3e8f){let _0x5a493a=contactItemTypes['find'](_0x182722=>_0x182722[_0xf82d('0x6f')]===_0x5bcc12);let _0x54be6f=contactItemTypes['find'](_0x2adf1e=>_0x2adf1e['name']+_0xf82d('0x70')===_0x5bcc12);if(_[_0xf82d('0x1d')](_0x5a493a)&&_[_0xf82d('0x1d')](_0x54be6f)){if(_0x1c3e8f['hasOwnProperty'](_0x5bcc12)){if(_0x5b8353[_0xf82d('0x75')][_0xa30d0d][_0x1c3e8f[_0x5bcc12]]){var _0x2bf550=_[_0xf82d('0x77')](_0x5b8353[_0xf82d('0x75')][_0xa30d0d][_0x1c3e8f[_0x5bcc12]][_0xf82d('0x78')](/"/g,'\x27'));switch(_0x5bcc12){case _0xf82d('0x39'):var _0x2df167=moment(_0x2bf550,_0xf82d('0xd'),!![]);if(_0x2df167[_0xf82d('0x79')]()){_0x289f29['push']('\x22'+_0x2bf550+'\x22');}else{_0x35f30d['push'](_0xf82d('0x7a'));}break;case _0xf82d('0x3e'):var _0x48793a=parseInt(_0x2bf550);_0x2bf550=_[_0xf82d('0x7b')](_0x48793a)||_0x48793a<0x0||_0x48793a>0x4?_0x7ca0bc?0x3:0x2:_0x48793a;_0x289f29[_0xf82d('0x1f')]('\x22'+_0x2bf550+'\x22');break;case _0xf82d('0x7c'):var _0x421759=parseInt(_0x2bf550);if(_[_0xf82d('0x7d')](_0x421759)&&_['includes'](_0x4c41df,_0x421759)){_0x289f29[_0xf82d('0x1f')]('\x22'+_0x421759+'\x22');}else{_0x35f30d[_0xf82d('0x1f')](_0xf82d('0x7e'));}break;case _0xf82d('0x7f'):if(isEmail(_0x2bf550)){_0x289f29['push']('\x22'+_0x2bf550+'\x22');}else{_0x35f30d[_0xf82d('0x1f')](_0xf82d('0x80'));}break;case _0xf82d('0x81'):var _0x46e52b=moment(_0x2bf550,_0xf82d('0x82'),!![]);if(_0x46e52b[_0xf82d('0x79')]()){_0x289f29[_0xf82d('0x1f')]('\x22'+_0x2bf550+'\x22');}else{_0x35f30d[_0xf82d('0x1f')](_0xf82d('0x83'));}break;default:_0x289f29['push']('\x22'+_0x2bf550+'\x22');}}else{switch(_0x5bcc12){case _0xf82d('0x84'):case _0xf82d('0x12'):_0x35f30d[_0xf82d('0x1f')](_0x5bcc12+'\x20not\x20specified');break;default:_0x289f29[_0xf82d('0x1f')]('\x22\x22');}}}}else{var _0x29f34f='';if(!_[_0xf82d('0x1d')](_0x5a493a)){if(!_0x21ca0d[_0xf82d('0x85')](_0x5a493a['id'])){for(var _0xb44266=0x0;_0xb44266<_0x1c3e8f[_0x5bcc12][_0xf82d('0x1c')];_0xb44266++){var _0x2bf550=_[_0xf82d('0x77')](_0x5b8353[_0xf82d('0x75')][_0xa30d0d][_0x1c3e8f[_0x5bcc12][_0xb44266]]['replace'](/"/g,'\x27'));var _0x1a0251=phoneDescriptions['find'](_0xbd3cc7=>_0xbd3cc7[_0xf82d('0x86')]===_0x5a493a['id']);if(!_[_0xf82d('0x1d')](_0x1a0251)){var _0x5befc6=_[_0xf82d('0x77')](_0x5b8353[_0xf82d('0x75')][_0xa30d0d][_0x1c3e8f[_0x1a0251['description']][0x0]][_0xf82d('0x78')](/"/g,'\x27'));if(!_[_0xf82d('0x1d')](_0x5befc6))_0x2bf550=_0x2bf550+'§'+_0x5befc6;}if(_0x29f34f=='')_0x29f34f=_0x2bf550;else _0x29f34f+='|'+_0x2bf550;}_0x118aa0[_0xf82d('0x1f')](_0x5a493a['id']+':'+_0x29f34f);_0x21ca0d[_0x5a493a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x289f29[_0xf82d('0x1f')]('\x22'+_0x118aa0[_0xf82d('0x17')](';')+'\x22');}if(_0x35f30d['length']){handleError(_0x5b8353['data'][_0xa30d0d],{'code':'SystemRow','message':_0x35f30d[_0xf82d('0x17')]()});}else{fs[_0xf82d('0x87')](_0x272ee1,_0x289f29[_0xf82d('0x17')]()+'\x0a');}_0x289f29=[];}if(!(stats[_0xf82d('0x76')]%0xc8)){socket['emit'](_0xf82d('0x88')+_0x498b47,stats);stats[_0xf82d('0x89')]=[];}}if(stopped){logger['info'](_0xf82d('0x8a'));_0x43503d['abort']();}}catch(_0x420bcf){handleError(_0x5b8353[_0xf82d('0x75')][_0xa30d0d],{'code':'SystemError','message':_0x420bcf['message']});logger[_0xf82d('0x22')](_0xf82d('0x8b'),_0x420bcf['message']);}},'complete':function(){try{var _0x3440da=[];var _0xfe8f6a=tempTableName;_0x3440da[_0xf82d('0x1f')]('CREATE\x20TABLE\x20'+_0xfe8f6a+_0xf82d('0x8c'));logger[_0xf82d('0x5f')](_0xf82d('0x8d'),contactItemTypes[_0xf82d('0x1c')]);var _0x187494=util['format'](_0xf82d('0x8e'),_0x272ee1,_0xfe8f6a,_0x2acc03,_0x1338bb[_0xf82d('0x3b')],_0x1338bb[_0xf82d('0x5a')]||null,NOW,NOW);if(_[_0xf82d('0x1d')](_0x1c3e8f[_0xf82d('0x39')])){_0x187494+=_0xf82d('0x8f');}_0x3440da[_0xf82d('0x1f')](_0x187494);BPromise[_0xf82d('0x90')](_0x3440da,handleQuery)[_0xf82d('0x20')](function(_0x507563){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x3440da=[];for(var _0x41e22f=0x0;_0x41e22f<promisesContact[_0xf82d('0x1c')];_0x41e22f++){_0x3440da[_0xf82d('0x1f')](updateContact(promisesContact[_0x41e22f][_0xf82d('0x91')]));}BPromise['all'](_0x3440da)[_0xf82d('0x20')](function(){_0x3440da=[];for(var _0x77a58f=0x0;_0x77a58f<promisesAdditionalPhones[_0xf82d('0x1c')];_0x77a58f++){_0x3440da[_0xf82d('0x1f')](createAdditionalPhone(promisesAdditionalPhones[_0x77a58f][_0xf82d('0x92')],promisesAdditionalPhones[_0x77a58f][_0xf82d('0x93')],promisesAdditionalPhones[_0x77a58f][_0xf82d('0x12')],promisesAdditionalPhones[_0x77a58f][_0xf82d('0x94')]));}BPromise[_0xf82d('0x25')](_0x3440da)[_0xf82d('0x20')](function(){_0x3440da=[];_0x3440da[_0xf82d('0x1f')](insertCmHopperAdditionalPhones(_0x1338bb[_0xf82d('0x3b')]));_0x3440da[_0xf82d('0x1f')]('DROP\x20TABLE\x20'+_0xfe8f6a+';');BPromise['each'](_0x3440da,handleQuery)[_0xf82d('0x20')](function(_0x3e21ea){stats['finish']=!![];stats[_0xf82d('0x95')]=updatedRows;socket['emit'](_0xf82d('0x88')+_0x498b47,stats);fs['unlink'](_0x129e06);fs[_0xf82d('0x96')](_0x272ee1);process[_0xf82d('0x61')](0x0);})['catch'](function(_0xac8b19){logger[_0xf82d('0x22')](_0xac8b19['message']);process['exit'](0x1);});});});});})['catch'](function(_0xc55ecf){logger[_0xf82d('0x22')](_0xc55ecf['message']);process[_0xf82d('0x61')](0x1);});}catch(_0x485746){logger[_0xf82d('0x22')](_0xf82d('0x97'),_0x485746[_0xf82d('0x23')]);process[_0xf82d('0x61')](0x1);}},'error':function(_0x5f22a2,_0x9dc73a,_0x4d5b4c,_0x366205){throw new Error(_0x366205);}});});}function validate(){if(process['argv']&&process['argv'][_0xf82d('0x1c')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x3e8882=path['join'](config[_0xf82d('0x69')],_0xf82d('0x6a'),process['argv'][0x2]);if(!fs['existsSync'](_0x3e8882)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x22c4ab={};try{_0x22c4ab=JSON[_0xf82d('0x73')](process[_0xf82d('0x98')][0x3]);if(!_0x22c4ab[_0xf82d('0x66')]){throw new Error(_0xf82d('0x99'));}var _0x252b7b=0x0;if(_0x22c4ab[_0xf82d('0x66')][_0xf82d('0x7c')]){_0x252b7b=0x1;}if(!_0x22c4ab[_0xf82d('0x3b')]){throw new Error(_0xf82d('0x9a'));}}catch(_0x588215){throw new Error('body\x20id\x20mandatory');}var _0x1ec938=[];try{_0x1ec938=_[_0xf82d('0x9b')](JSON[_0xf82d('0x73')](process['argv'][0x4]),'id');}catch(_0x56ea25){logger[_0xf82d('0x5f')](_0xf82d('0x9c'));}main(_0x3e8882,_0x22c4ab,_0x1ec938,_0x252b7b);}validate();process['on']('SIGINT',handleStop);process['on'](_0xf82d('0x9d'),handleUncaughtException);
\ No newline at end of file
+var _0xcabe=['argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','filter','CmContactHasItem','update','updated','create','PHONE','CmContact','CmHopper','phone','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','ContactId','ListId','createdAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','toString','updatedAt','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','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','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','MIN(id)','group','info','Received\x20SIGINT','message','exit','code','main','stringify','send','start','binding','socket_timestamp','.csv','body','name','_description','header','writeFileSync','createReadStream','data','errors','find','hasOwnProperty','trim','replace','scheduledat','isValid','priority','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete'];(function(_0x5dca1c,_0x4d4281){var _0x5ce01c=function(_0x100860){while(--_0x100860){_0x5dca1c['push'](_0x5dca1c['shift']());}};_0x5ce01c(++_0x4d4281);}(_0xcabe,0x1ef));var _0xecab=function(_0x407b2c,_0x508363){_0x407b2c=_0x407b2c-0x0;var _0x5ab61f=_0xcabe[_0x407b2c];return _0x5ab61f;};'use strict';var fs=require('fs');var path=require(_0xecab('0x0'));var _=require('lodash');var Papa=require(_0xecab('0x1'));var util=require(_0xecab('0x2'));var BPromise=require('bluebird');var moment=require(_0xecab('0x3'));var squel=require(_0xecab('0x4'));var Redis=require('ioredis');var db=require(_0xecab('0x5'))['db'];var config=require(_0xecab('0x6'));var logger=require(_0xecab('0x7'))('import');config[_0xecab('0x8')]=_[_0xecab('0x9')](config[_0xecab('0x8')],{'host':_0xecab('0xa'),'port':0x18eb});var socket=require(_0xecab('0xb'))(new Redis(config[_0xecab('0x8')]));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()[_0xecab('0xc')](_0xecab('0xd'));var tempTableName=_0xecab('0xe')+moment()['format']('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x270fdd){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))*$/[_0xecab('0xf')](_0x270fdd);}function selectNotIn(_0x52f26a,_0x445617,_0x3e9db8,_0xe81394,_0xb7d084){return squel[_0xecab('0x10')]()[_0xecab('0x11')]('phone')[_0xecab('0x12')](_0xe81394)[_0xecab('0x13')](_0x445617,null,_0x445617+_0xecab('0x14')+_0xe81394+'.'+_0x3e9db8)[_0xecab('0x15')](_0xe81394+'.'+_0x3e9db8+_0xecab('0x16')+_0x52f26a+'.'+_0x3e9db8)[_0xecab('0x15')](_0x445617+'.dialCheckDuplicateType\x20IN\x20('+_0xb7d084[_0xecab('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x56a614,_0x4bfc49){promisesAdditionalPhones=[];promisesContact=[];return db[_0xecab('0x17')][_0xecab('0x18')](_0xecab('0x19')+tempTableName)[_0xecab('0x1a')](function(_0x5bdb81){if(_0x5bdb81!==null){var _0x35feb8=[];for(var _0x1c5871=0x0;_0x1c5871<_0x5bdb81[_0xecab('0x1b')];_0x1c5871++){var _0x46e838=_0x5bdb81[_0x1c5871];if(!_[_0xecab('0x1c')](_0x46e838['phone'])){if(!_[_0xecab('0x1c')](_0x46e838[_0xecab('0x1d')]))_0x35feb8['push'](insertAdditionalPhones(_0x46e838));promisesContact[_0xecab('0x1e')]({'contact':_0x46e838});}}}Promise[_0xecab('0x1f')](_0x35feb8)[_0xecab('0x20')](function(){_0x56a614({'val':0x1});});})[_0xecab('0x21')](function(_0x1f71eb){logger[_0xecab('0x22')](_0x1f71eb['message']);});});}function insertAdditionalPhones(_0x1cfa2f){return new Promise(function(_0x2ec6fb,_0x1fdd1d){var _0x50eb82=_0x1cfa2f[_0xecab('0x1d')];if(_['isNil'](_0x50eb82))_0x1fdd1d({'val':0x0});else{var _0x187620=_0x50eb82['split'](';');var _0x184dbc=[];orderBy=0x0;for(var _0x94d9c2=0x0;_0x94d9c2<_0x187620[_0xecab('0x1b')];_0x94d9c2++){_0x184dbc[_0xecab('0x1e')](splitAdditionalPhone(_0x1cfa2f['id'],_0x187620[_0x94d9c2]));}Promise[_0xecab('0x1f')](_0x184dbc)[_0xecab('0x20')](function(){_0x2ec6fb({'val':_0x187620[_0xecab('0x1b')]});});}});}function splitAdditionalPhone(_0x2991a3,_0x3c701e){return new Promise(function(_0x365592,_0x30191f){var _0x270946=_0x3c701e['split'](':');var _0x1fcc46=_0x270946[0x0];var _0x4a6240=_0x270946[0x1];if(_0x4a6240!==''){var _0x248aba=_0x4a6240[_0xecab('0x23')]('|');var _0x4ba76d=[];for(var _0xb05d4e=0x0;_0xb05d4e<_0x248aba['length'];_0xb05d4e++){if(_0x248aba[_0xb05d4e]!==''){var _0x56c98e=_[_0xecab('0x24')](promisesAdditionalPhones,{'contactId':_0x2991a3,'phone':_0x248aba[_0xb05d4e]});if(_0x56c98e[_0xecab('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xecab('0x1e')]({'contactId':_0x2991a3,'contactTypeId':_0x1fcc46,'phone':_0x248aba[_0xb05d4e],'orderBy':orderBy});}}}_0x365592({'ok':0x1});}else _0x365592({'res':0x0});});}function createAdditionalPhone(_0x3f1666,_0x34ded8,_0x30ca35,_0x36c1c1){var _0x4ac6e1='';var _0x59b07b='';var _0x41df38=_0x30ca35[_0xecab('0x23')]('§');_0x4ac6e1=_0x41df38[0x0];if(_0x41df38[_0xecab('0x1b')]==0x2)_0x59b07b=_0x41df38[0x1];return new Promise(function(_0x25d9fd,_0x1ef5fe){return db[_0xecab('0x25')]['findOne']({'where':{'CmContactId':_0x3f1666,'item':_0x4ac6e1}})['then'](function(_0x26e545){if(_0x26e545){return db[_0xecab('0x25')][_0xecab('0x26')]({'ItemTypeId':_0x34ded8,'description':_0x59b07b,'OrderBy':_0x36c1c1},{'where':{'CmContactId':_0x3f1666,'item':_0x4ac6e1}})[_0xecab('0x20')](function(_0x2e59d1){_0x25d9fd({'res':_0xecab('0x27')});});}else{return db[_0xecab('0x25')][_0xecab('0x28')]({'CmContactId':_0x3f1666,'item':_0x4ac6e1,'ItemTypeId':_0x34ded8,'description':_0x59b07b,'OrderBy':_0x36c1c1,'ItemClass':_0xecab('0x29')})['then'](function(_0x59289a){_0x25d9fd({'res':'inserted'});});}});});}function updateContact(_0x4ae05a){return new Promise(function(_0x5a49f6,_0x32d4bb){var _0xdf64=_0x4ae05a['id'];delete _0x4ae05a['id'];return db[_0xecab('0x2a')][_0xecab('0x26')](_0x4ae05a,{'where':{'id':_0xdf64}})[_0xecab('0x20')](function(_0x35b061){updatedRows+=0x1;return db[_0xecab('0x2b')][_0xecab('0x26')]({'phone':_0x4ae05a[_0xecab('0x2c')]},{'where':{'ContactId':_0xdf64}})[_0xecab('0x20')](function(_0x560f93){_0x5a49f6({'ret':'OK'});});});});}function insertCmHopper(_0x35b944,_0x52cadd,_0x543ea8,_0x43d651,_0x5a719d){var _0x17af6f=[_0xecab('0x2d'),'cm_contacts.scheduledat',_0xecab('0x2e'),_0xecab('0x2f'),_0x52cadd+'.'+_0x43d651,_0xecab('0x30'),_0xecab('0x31'),'cm_contacts.priority',_0xecab('0x32'),'\x22'+_0x5a719d+'\x22'];return squel[_0xecab('0x33')]()[_0xecab('0x34')]('cm_hopper')[_0xecab('0x35')]([_0xecab('0x2c'),'scheduledat',_0xecab('0x36'),_0xecab('0x37'),_0x43d651,_0xecab('0x38'),'updatedAt','priority','UserId',_0xecab('0x39')],squel[_0xecab('0x10')]()[_0xecab('0x3a')](_0x17af6f)[_0xecab('0x12')](_0x52cadd)[_0xecab('0x13')](_0xecab('0x3b'),null,_0xecab('0x3c')+_0x52cadd+_0xecab('0x3d'))['join'](_0x543ea8,null,_0x543ea8+_0xecab('0x14')+_0x52cadd+'.'+_0x43d651)['where'](_0x52cadd+'.CmListId\x20=\x20?',_0x35b944)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xecab('0x15')](_0xecab('0x3e'),selectNotIn(_0x52cadd,_0x543ea8,_0x43d651,'cm_hopper',[_0xecab('0x3f'),_0xecab('0x40')]))[_0xecab('0x15')](_0xecab('0x3e'),selectNotIn(_0x52cadd,_0x543ea8,_0x43d651,_0xecab('0x41'),[_0xecab('0x3f')])))[_0xecab('0x42')]();}function insertCmHopperBlack(_0x167638,_0x54cfcf,_0x3008a5,_0x3d0f5b){var _0x2665b6=[_0xecab('0x2d'),_0xecab('0x2e'),_0xecab('0x2f'),_0x54cfcf+'.'+_0x3d0f5b,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xecab('0x33')]()[_0xecab('0x34')]('cm_hopper_black')['fromQuery']([_0xecab('0x2c'),_0xecab('0x36'),_0xecab('0x37'),_0x3d0f5b,'createdAt',_0xecab('0x43')],squel[_0xecab('0x10')]()[_0xecab('0x3a')](_0x2665b6)['from'](_0x54cfcf)[_0xecab('0x13')](_0xecab('0x3b'),null,_0xecab('0x3c')+_0x54cfcf+'.CmListId')[_0xecab('0x13')](_0x3008a5,null,_0x3008a5+_0xecab('0x14')+_0x54cfcf+'.'+_0x3d0f5b)[_0xecab('0x15')](_0x54cfcf+_0xecab('0x44'),_0x167638)[_0xecab('0x15')](_0xecab('0x45'),NOW)[_0xecab('0x15')](_0xecab('0x3e'),squel['select']()[_0xecab('0x11')](_0xecab('0x2c'))[_0xecab('0x12')](_0xecab('0x46'))['where']('ListId\x20=\x20?',_0x167638)['where'](_0x3d0f5b+_0xecab('0x47'),_0x54cfcf+'.'+_0x3d0f5b)))[_0xecab('0x42')]();}function insertCmHopperAdditionalPhones(_0x106af8){var _0x1fbc0f=[_0xecab('0x48'),_0xecab('0x49'),'cm_contact_has_items.OrderBy',_0xecab('0x4a'),_0xecab('0x4b')];return squel[_0xecab('0x33')]()[_0xecab('0x34')](_0xecab('0x4c'))[_0xecab('0x35')]([_0xecab('0x4d'),_0xecab('0x2c'),'OrderBy',_0xecab('0x38'),_0xecab('0x43')],squel[_0xecab('0x10')]()[_0xecab('0x3a')](_0x1fbc0f)['from'](_0xecab('0x41'))[_0xecab('0x13')](_0xecab('0x3b'),null,_0xecab('0x4e'))['join'](_0xecab('0x4f'),null,_0xecab('0x50'))[_0xecab('0x15')](_0xecab('0x51'),_0x106af8)['where'](_0xecab('0x45'),NOW))[_0xecab('0x42')]();}function insertCmContact(_0xe8ac1b,_0x4f103f,_0x4b7fd2,_0x27b81f){var _0x5e7d6f=_['concat'](_[_0xecab('0x52')](_0x27b81f),[_0xecab('0x37'),_0xecab('0x53'),_0xecab('0x38'),_0xecab('0x43')]);return squel[_0xecab('0x33')]()[_0xecab('0x34')]('cm_contacts')[_0xecab('0x35')](_0x5e7d6f,squel[_0xecab('0x10')]()[_0xecab('0x3a')](_0x5e7d6f)['from'](_0x4f103f)[_0xecab('0x15')]('('+_0x4b7fd2[_0xecab('0x13')](',')+_0xecab('0x54'),squel[_0xecab('0x10')]()[_0xecab('0x3a')](_0x4b7fd2)[_0xecab('0x12')](_0xecab('0x3b'))[_0xecab('0x15')](_0xecab('0x55'),_0xe8ac1b))[_0xecab('0x15')]('id\x20IN\x20?',squel[_0xecab('0x10')]()[_0xecab('0x11')](_0xecab('0x56'),'min_id')[_0xecab('0x12')](_0x4f103f)[_0xecab('0x57')](_0x4b7fd2[_0xecab('0x13')](','))))[_0xecab('0x42')]();}function handleStop(){logger[_0xecab('0x58')](_0xecab('0x59'));stopped=!![];}function handleUncaughtException(_0x43c0e4){logger[_0xecab('0x22')](_0x43c0e4[_0xecab('0x5a')]);process[_0xecab('0x5b')](0x1);}function handleError(_0x5a489e,_0x3a905e){stats['errors'][_0xecab('0x1e')]({'name':_0x3a905e[_0xecab('0x5c')],'message':_0x3a905e[_0xecab('0x5a')],'row':_0x5a489e});}function handleQuery(_0x4e1b32){logger[_0xecab('0x58')](_0x4e1b32);return db['sequelize'][_0xecab('0x18')](_0x4e1b32)[_0xecab('0x1a')](function(_0x101828){results[_0xecab('0x1e')](_0x101828);})[_0xecab('0x21')](function(_0x2ae0dd){logger[_0xecab('0x22')](_0x2ae0dd[_0xecab('0x5a')]);});}function main(_0x1d4d05,_0x41b0d0,_0x17f659,_0x339736){logger[_0xecab('0x58')](_0xecab('0x5d'),_0x1d4d05,JSON[_0xecab('0x5e')](_0x41b0d0));process[_0xecab('0x5f')](_0xecab('0x60'));var _0x2b908d=_0x41b0d0[_0xecab('0x61')];var _0x5870a1=_['clone'](_0x2b908d);var _0x3324c3=_0x41b0d0[_0xecab('0x62')];var _0x3e7541=path[_0xecab('0x13')](config['root'],'server/files/tmp',_0x3324c3+_0xecab('0x63'));logger[_0xecab('0x58')](_0xecab('0x64'),_0x41b0d0);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0xecab('0x65')]})[_0xecab('0x20')](function(_0x43ff98){for(var _0x486c31=0x0;_0x486c31<_0x43ff98[_0xecab('0x1b')];_0x486c31++){if(_0x43ff98[_0x486c31][_0xecab('0x65')]in _0x2b908d){contactItemTypes[_0xecab('0x1e')](_0x43ff98[_0x486c31]);delete _0x5870a1[_0x43ff98[_0x486c31][_0xecab('0x65')]];hasAdditionalPhones=!![];}for(var _0x2241e5 in _0x2b908d){if(_0x43ff98[_0x486c31]['name']+_0xecab('0x66')===_0x2241e5){phoneDescriptions[_0xecab('0x1e')]({'itemTypeId':_0x43ff98[_0x486c31]['id'],'description':_0x2241e5});delete _0x5870a1[_0x2241e5];}}}if(hasAdditionalPhones)_0x5870a1[_0xecab('0x1d')]='';var _0x4dcd04=_['keys'](_0x5870a1)[_0xecab('0x13')]();logger['info'](_0xecab('0x67'),_0x4dcd04);fs[_0xecab('0x68')](_0x3e7541,_0x4dcd04+'\x0a');Papa['parse'](fs[_0xecab('0x69')](_0x1d4d05),{'header':!![],'skipEmptyLines':!![],'step':function(_0x220ebf,_0x47c115){try{for(var _0x186e37=0x0,_0x138fd0=[];_0x186e37<_0x220ebf[_0xecab('0x6a')][_0xecab('0x1b')];_0x186e37++){stats['rows']+=0x1;if(_0x220ebf[_0xecab('0x6b')][_0x186e37]){handleError(_0x220ebf[_0xecab('0x6a')][_0x186e37],_0x220ebf[_0xecab('0x6b')][_0x186e37]);}else{var _0x49ff64=[];var _0x45b409=[];var _0x356c35={};for(var _0x2de141 in _0x2b908d){let _0x1948b4=contactItemTypes[_0xecab('0x6c')](_0x43225d=>_0x43225d[_0xecab('0x65')]===_0x2de141);let _0x283c42=contactItemTypes[_0xecab('0x6c')](_0x34408b=>_0x34408b[_0xecab('0x65')]+_0xecab('0x66')===_0x2de141);if(_[_0xecab('0x1c')](_0x1948b4)&&_[_0xecab('0x1c')](_0x283c42)){if(_0x2b908d[_0xecab('0x6d')](_0x2de141)){if(_0x220ebf[_0xecab('0x6a')][_0x186e37][_0x2b908d[_0x2de141]]){var _0x52909d=_[_0xecab('0x6e')](_0x220ebf[_0xecab('0x6a')][_0x186e37][_0x2b908d[_0x2de141]][_0xecab('0x6f')](/"/g,'\x27'));switch(_0x2de141){case _0xecab('0x70'):var _0x3055ff=moment(_0x52909d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3055ff[_0xecab('0x71')]()){_0x138fd0[_0xecab('0x1e')]('\x22'+_0x52909d+'\x22');}else{_0x49ff64[_0xecab('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xecab('0x72'):var _0x58282c=parseInt(_0x52909d);_0x52909d=_[_0xecab('0x73')](_0x58282c)||_0x58282c<0x0||_0x58282c>0x4?_0x339736?0x3:0x2:_0x58282c;_0x138fd0['push']('\x22'+_0x52909d+'\x22');break;case _0xecab('0x74'):var _0xfdc405=parseInt(_0x52909d);if(_[_0xecab('0x75')](_0xfdc405)&&_[_0xecab('0x76')](_0x17f659,_0xfdc405)){_0x138fd0[_0xecab('0x1e')]('\x22'+_0xfdc405+'\x22');}else{_0x49ff64[_0xecab('0x1e')](_0xecab('0x77'));}break;case _0xecab('0x78'):if(isEmail(_0x52909d)){_0x138fd0[_0xecab('0x1e')]('\x22'+_0x52909d+'\x22');}else{_0x49ff64[_0xecab('0x1e')](_0xecab('0x79'));}break;case _0xecab('0x7a'):var _0x5eb35c=moment(_0x52909d,'YYYY-MM-DD',!![]);if(_0x5eb35c[_0xecab('0x71')]()){_0x138fd0[_0xecab('0x1e')]('\x22'+_0x52909d+'\x22');}else{_0x49ff64[_0xecab('0x1e')](_0xecab('0x7b'));}break;default:_0x138fd0[_0xecab('0x1e')]('\x22'+_0x52909d+'\x22');}}else{switch(_0x2de141){case _0xecab('0x7c'):case _0xecab('0x2c'):_0x49ff64[_0xecab('0x1e')](_0x2de141+'\x20not\x20specified');break;default:_0x138fd0[_0xecab('0x1e')]('\x22\x22');}}}}else{var _0x1b8e6f='';if(!_[_0xecab('0x1c')](_0x1948b4)){if(!_0x356c35[_0xecab('0x6d')](_0x1948b4['id'])){for(var _0x219f33=0x0;_0x219f33<_0x2b908d[_0x2de141][_0xecab('0x1b')];_0x219f33++){var _0x52909d=_[_0xecab('0x6e')](_0x220ebf['data'][_0x186e37][_0x2b908d[_0x2de141][_0x219f33]][_0xecab('0x6f')](/"/g,'\x27'));var _0x272e5f=phoneDescriptions[_0xecab('0x6c')](_0x3a9668=>_0x3a9668[_0xecab('0x7d')]===_0x1948b4['id']);if(!_[_0xecab('0x1c')](_0x272e5f)){var _0x57eab2=_['trim'](_0x220ebf[_0xecab('0x6a')][_0x186e37][_0x2b908d[_0x272e5f[_0xecab('0x7e')]][0x0]][_0xecab('0x6f')](/"/g,'\x27'));if(!_[_0xecab('0x1c')](_0x57eab2))_0x52909d=_0x52909d+'§'+_0x57eab2;}if(_0x1b8e6f=='')_0x1b8e6f=_0x52909d;else _0x1b8e6f+='|'+_0x52909d;}_0x45b409[_0xecab('0x1e')](_0x1948b4['id']+':'+_0x1b8e6f);_0x356c35[_0x1948b4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x138fd0[_0xecab('0x1e')]('\x22'+_0x45b409[_0xecab('0x13')](';')+'\x22');}if(_0x49ff64['length']){handleError(_0x220ebf[_0xecab('0x6a')][_0x186e37],{'code':_0xecab('0x7f'),'message':_0x49ff64[_0xecab('0x13')]()});}else{fs[_0xecab('0x80')](_0x3e7541,_0x138fd0[_0xecab('0x13')]()+'\x0a');}_0x138fd0=[];}if(!(stats['rows']%0xc8)){socket[_0xecab('0x81')](_0xecab('0x82')+_0x3324c3,stats);stats[_0xecab('0x6b')]=[];}}if(stopped){logger[_0xecab('0x58')]('Abort\x20parser');_0x47c115[_0xecab('0x83')]();}}catch(_0x46bc8d){handleError(_0x220ebf['data'][_0x186e37],{'code':_0xecab('0x84'),'message':_0x46bc8d[_0xecab('0x5a')]});logger[_0xecab('0x22')](_0xecab('0x85'),_0x46bc8d[_0xecab('0x5a')]);}},'complete':function(){try{var _0x245216=[];var _0x4d074b=tempTableName;_0x245216[_0xecab('0x1e')](_0xecab('0x86')+_0x4d074b+_0xecab('0x87'));logger[_0xecab('0x58')](_0xecab('0x88'),contactItemTypes[_0xecab('0x1b')]);var _0x49aed6=util[_0xecab('0xc')](_0xecab('0x89'),_0x3e7541,_0x4d074b,_0x4dcd04,_0x41b0d0[_0xecab('0x37')],_0x41b0d0[_0xecab('0x53')]||null,NOW,NOW);if(_[_0xecab('0x1c')](_0x2b908d[_0xecab('0x70')])){_0x49aed6+=_0xecab('0x8a');}_0x245216[_0xecab('0x1e')](_0x49aed6);BPromise[_0xecab('0x8b')](_0x245216,handleQuery)['then'](function(_0x3b0ceb){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x245216=[];for(var _0x1959ef=0x0;_0x1959ef<promisesContact[_0xecab('0x1b')];_0x1959ef++){_0x245216['push'](updateContact(promisesContact[_0x1959ef][_0xecab('0x8c')]));}BPromise['all'](_0x245216)[_0xecab('0x20')](function(){_0x245216=[];for(var _0x4e5e9c=0x0;_0x4e5e9c<promisesAdditionalPhones[_0xecab('0x1b')];_0x4e5e9c++){_0x245216[_0xecab('0x1e')](createAdditionalPhone(promisesAdditionalPhones[_0x4e5e9c][_0xecab('0x8d')],promisesAdditionalPhones[_0x4e5e9c][_0xecab('0x8e')],promisesAdditionalPhones[_0x4e5e9c]['phone'],promisesAdditionalPhones[_0x4e5e9c][_0xecab('0x8f')]));}BPromise['all'](_0x245216)[_0xecab('0x20')](function(){_0x245216=[];_0x245216[_0xecab('0x1e')](insertCmHopperAdditionalPhones(_0x41b0d0[_0xecab('0x37')]));_0x245216[_0xecab('0x1e')](_0xecab('0x90')+_0x4d074b+';');BPromise[_0xecab('0x8b')](_0x245216,handleQuery)[_0xecab('0x20')](function(_0x1eb7f1){stats[_0xecab('0x91')]=!![];stats[_0xecab('0x92')]=updatedRows;socket['emit']('contact:import:'+_0x3324c3,stats);fs[_0xecab('0x93')](_0x1d4d05);fs['unlink'](_0x3e7541);process[_0xecab('0x5b')](0x0);})[_0xecab('0x21')](function(_0x4bb9d4){logger['error'](_0x4bb9d4[_0xecab('0x5a')]);process[_0xecab('0x5b')](0x1);});});});});})[_0xecab('0x21')](function(_0xb6abe6){logger[_0xecab('0x22')](_0xb6abe6['message']);process[_0xecab('0x5b')](0x1);});}catch(_0x1c1a82){logger[_0xecab('0x22')](_0xecab('0x94'),_0x1c1a82['message']);process[_0xecab('0x5b')](0x1);}},'error':function(_0x45c83b,_0x3c87f6,_0x49793d,_0x395d14){throw new Error(_0x395d14);}});});}function validate(){if(process['argv']&&process[_0xecab('0x95')]['length']<0x4){throw new Error(_0xecab('0x96'));}var _0xa9787b=path[_0xecab('0x13')](config[_0xecab('0x97')],_0xecab('0x98'),process['argv'][0x2]);if(!fs[_0xecab('0x99')](_0xa9787b)){throw new Error(_0xecab('0x9a'));}var _0x534052={};try{_0x534052=JSON[_0xecab('0x9b')](process[_0xecab('0x95')][0x3]);if(!_0x534052['binding']){throw new Error(_0xecab('0x9c'));}var _0x531676=0x0;if(_0x534052[_0xecab('0x61')][_0xecab('0x74')]){_0x531676=0x1;}if(!_0x534052['ListId']){throw new Error(_0xecab('0x9d'));}}catch(_0x2cd7a9){throw new Error(_0xecab('0x9e'));}var _0x3ab78b=[];try{_0x3ab78b=_['map'](JSON['parse'](process[_0xecab('0x95')][0x4]),'id');}catch(_0x3848ea){logger[_0xecab('0x58')](_0xecab('0x9f'));}main(_0xa9787b,_0x534052,_0x3ab78b,_0x531676);}validate();process['on'](_0xecab('0xa0'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 8c9b5b1..218a9e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ed=['string','toLowerCase','voice','push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects'];(function(_0x2f267f,_0x3ccc8e){var _0x44e309=function(_0x53e395){while(--_0x53e395){_0x2f267f['push'](_0x2f267f['shift']());}};_0x44e309(++_0x3ccc8e);}(_0x91ed,0xc7));var _0xd91e=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x91ed[_0x29d915];return _0x160f86;};'use strict';exports[_0xd91e('0x0')]=function(_0x3b29e5,_0x3bd874){var _0x450a16=[{'type':_0xd91e('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x3b29e5[_0xd91e('0x2')]()){case _0xd91e('0x3'):switch(_0x3bd874['toLowerCase']()){case'inbound':_0x450a16[_0xd91e('0x4')]({'type':_0xd91e('0x5'),'content':'','variableName':_0xd91e('0x6')});_0x450a16[_0xd91e('0x4')]({'type':'variable','content':'','variableName':_0xd91e('0x7')});break;case _0xd91e('0x8'):_0x450a16[_0xd91e('0x4')]({'type':_0xd91e('0x1'),'content':'Outbound\x20Call','variableName':null});_0x450a16['push']({'type':_0xd91e('0x5'),'content':'','variableName':_0xd91e('0x9')});break;}}return _0x450a16;};exports[_0xd91e('0xa')]=function(_0x4d67e2,_0x381f57){var _0x1834da=[];switch(_0x4d67e2[_0xd91e('0x2')]()){case _0xd91e('0x3'):switch(_0x381f57[_0xd91e('0x2')]()){case _0xd91e('0xb'):_0x1834da=[{'type':_0xd91e('0x1'),'content':_0xd91e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xd91e('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xd91e('0x7')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0xe'),'keyType':_0xd91e('0x5'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xd91e('0xf'),'keyType':'variable','variableName':'destexten'},{'type':_0xd91e('0xd'),'content':'','key':'Queue','keyType':_0xd91e('0x5'),'variableName':_0xd91e('0x6')},{'type':'keyValue','content':'','key':_0xd91e('0x10'),'keyType':_0xd91e('0x5'),'variableName':_0xd91e('0x11')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x12'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'string','content':_0xd91e('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0xd91e('0xd'),'content':'','key':'Agent\x20Name','keyType':_0xd91e('0x5'),'variableName':_0xd91e('0x14')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x15'),'keyType':_0xd91e('0x5'),'variableName':_0xd91e('0x9')},{'type':'string','content':_0xd91e('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd91e('0x17'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x18'),'keyType':'variable','variableName':_0xd91e('0x19')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x1a'),'keyType':_0xd91e('0x5'),'variableName':_0xd91e('0x1b')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x1c'),'keyType':'variable','variableName':'holdtime'},{'type':_0xd91e('0xd'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xd91e('0x1d')}];break;case _0xd91e('0x8'):_0x1834da=[{'type':_0xd91e('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x1e'),'keyType':'variable','keyContent':'','variableName':_0xd91e('0x9')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x1f')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x10'),'keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x11')},{'type':_0xd91e('0xd'),'content':'','key':'Date','keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x20')},{'type':_0xd91e('0x1'),'content':_0xd91e('0x16')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x21'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x22'),'keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x23')},{'type':_0xd91e('0xd'),'content':'','key':_0xd91e('0x24'),'keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x25')},{'type':'keyValue','content':'','key':_0xd91e('0x26'),'keyType':_0xd91e('0x5'),'keyContent':'','variableName':_0xd91e('0x27')}];break;}}return _0x1834da;};
\ No newline at end of file
+var _0xe89c=['toLowerCase','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','voice','***\x20Call\x20Info\x20***','keyValue','calleridname','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Answer\x20Time','answertime','Duration','duration','billableseconds','string'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xe89c,0x77));var _0xce89=function(_0xf3cefe,_0x5408ff){_0xf3cefe=_0xf3cefe-0x0;var _0xc53ac2=_0xe89c[_0xf3cefe];return _0xc53ac2;};'use strict';exports['getSubjects']=function(_0x74c6b5,_0x589826){var _0x11ec01=[{'type':_0xce89('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x74c6b5[_0xce89('0x1')]()){case'voice':switch(_0x589826[_0xce89('0x1')]()){case _0xce89('0x2'):_0x11ec01[_0xce89('0x3')]({'type':'variable','content':'','variableName':_0xce89('0x4')});_0x11ec01['push']({'type':_0xce89('0x5'),'content':'','variableName':_0xce89('0x6')});break;case _0xce89('0x7'):_0x11ec01['push']({'type':_0xce89('0x0'),'content':_0xce89('0x8'),'variableName':null});_0x11ec01['push']({'type':_0xce89('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x11ec01;};exports['getDescriptions']=function(_0x5273d9,_0x360c66){var _0x293db1=[];switch(_0x5273d9[_0xce89('0x1')]()){case _0xce89('0x9'):switch(_0x360c66[_0xce89('0x1')]()){case _0xce89('0x2'):_0x293db1=[{'type':_0xce89('0x0'),'content':_0xce89('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0xce89('0x5'),'variableName':_0xce89('0x6')},{'type':_0xce89('0xb'),'content':'','key':'Caller\x20Name','keyType':_0xce89('0x5'),'variableName':_0xce89('0xc')},{'type':_0xce89('0xb'),'content':'','key':'Call\x20To','keyType':_0xce89('0x5'),'variableName':'destexten'},{'type':'keyValue','content':'','key':'Queue','keyType':_0xce89('0x5'),'variableName':_0xce89('0x4')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0xd'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0xe')},{'type':'keyValue','content':'','key':_0xce89('0xf'),'keyType':'variable','variableName':_0xce89('0x10')},{'type':_0xce89('0x0'),'content':_0xce89('0x11'),'key':null,'keyType':null,'variableName':null},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x12'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0x13')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x14'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0x15')},{'type':_0xce89('0x0'),'content':_0xce89('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x17'),'keyType':'variable','variableName':_0xce89('0x10')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x18'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0x19')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x1a'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0x1b')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x1c'),'keyType':_0xce89('0x5'),'variableName':_0xce89('0x1d')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x1e'),'keyType':'variable','variableName':_0xce89('0x1f')}];break;case _0xce89('0x7'):_0x293db1=[{'type':_0xce89('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x20'),'keyType':_0xce89('0x5'),'keyContent':'','variableName':_0xce89('0x15')},{'type':'keyValue','content':'','key':_0xce89('0x21'),'keyType':_0xce89('0x5'),'keyContent':'','variableName':_0xce89('0x22')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0xd'),'keyType':_0xce89('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0xf'),'keyType':_0xce89('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0xce89('0x0'),'content':_0xce89('0x16')},{'type':_0xce89('0xb'),'content':'','key':_0xce89('0x23'),'keyType':_0xce89('0x5'),'keyContent':'','variableName':_0xce89('0x24')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xce89('0x5'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0xce89('0x25'),'keyType':'variable','keyContent':'','variableName':_0xce89('0x26')},{'type':_0xce89('0xb'),'content':'','key':'Billable\x20Time','keyType':_0xce89('0x5'),'keyContent':'','variableName':_0xce89('0x27')}];break;}}return _0x293db1;};
\ No newline at end of file
index 0620a19..95f21f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c1b=['upperFirst','InteractionId','unknown','name','null','Interaction','findOne','then','update','info','catch','error','tracked','query','clone','body','omit','html','phone','mobile','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions'];(function(_0x3c48cc,_0x38f6d2){var _0x23dd6c=function(_0x1821d3){while(--_0x1821d3){_0x3c48cc['push'](_0x3c48cc['shift']());}};_0x23dd6c(++_0x38f6d2);}(_0x3c1b,0x127));var _0xb3c1=function(_0x2646d3,_0x43e41e){_0x2646d3=_0x2646d3-0x0;var _0x18c48c=_0x3c1b[_0x2646d3];return _0x18c48c;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xb3c1('0x0'))(_0xb3c1('0x1')),'mail':require(_0xb3c1('0x0'))(_0xb3c1('0x2')),'fax':require('../../config/logger')(_0xb3c1('0x3')),'sms':require(_0xb3c1('0x0'))(_0xb3c1('0x4')),'chat':require(_0xb3c1('0x0'))('chat-interactions'),'whatsapp':require(_0xb3c1('0x0'))('whatsapp-interactions')};function getInteractionId(_0x4f01e7,_0x515786,_0x4d6b68){if(_0x4f01e7&&_0x4f01e7[_['upperFirst'](_0x4d6b68)+'InteractionId']){return _0x4f01e7[_[_0xb3c1('0x5')](_0x4d6b68)+_0xb3c1('0x6')];}else if(_0x4f01e7&&_0x4f01e7['id']){return _0x4f01e7['id'];}else if(_0x515786&&_0x515786['id']){return _0x515786['id'];}else{return _0xb3c1('0x7');}}function log(_0x1db8c4,_0x226aad,_0x23e16a,_0xd62101,_0x49312f,_0x421c10){loggers[_0x49312f['toLowerCase']()][_0x1db8c4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x421c10['toUpperCase'](),_0x226aad?_0x226aad['id']:null,_0x226aad?_0x226aad[_0xb3c1('0x8')]:null,_0x226aad?_0x226aad['role']:null,getInteractionId(_0x23e16a,_0xd62101,_0x49312f),_0x23e16a?JSON['stringify'](_0x23e16a):_0xb3c1('0x9'));}function updateUser(_0x560faa,_0x3aacb0,_0x5a5bb3,_0x285c96,_0xf80043){db[_[_0xb3c1('0x5')](_0x285c96)+_0xb3c1('0xa')][_0xb3c1('0xb')]({'where':{'id':getInteractionId(_0x3aacb0,_0x5a5bb3,_0x285c96)}})[_0xb3c1('0xc')](function(_0x1c92a0){if(_0x1c92a0){return _0x1c92a0[_0xb3c1('0xd')]({'UserId':_0x560faa?_0x560faa['id']:null});}})[_0xb3c1('0xc')](function(_0x5f4b44){if(_0x5f4b44){log(_0xb3c1('0xe'),_0x560faa,_0x3aacb0,_0x5a5bb3,_0x285c96,_0xf80043);}})[_0xb3c1('0xf')](function(){log(_0xb3c1('0x10'),_0x560faa,_0x3aacb0,_0x5a5bb3,_0x285c96,_0xf80043);});}exports[_0xb3c1('0x11')]=function(_0x412bc2,_0x4fe52c){return function(_0x5f55fd,_0x294c35,_0x25c757){var _0x413ada=_0x5f55fd['user'];var _0x548aa8={};var _0x249cf5=_0x5f55fd[_0xb3c1('0x12')];if(_0x548aa8){_0x548aa8=_[_0xb3c1('0x13')](_0x5f55fd[_0xb3c1('0x14')]);_0x548aa8=_[_0xb3c1('0x15')](_0x548aa8,[_0xb3c1('0x14'),_0xb3c1('0x16'),_0xb3c1('0x17'),'fax',_0xb3c1('0x18')]);}updateUser(_0x413ada,_0x548aa8,_0x249cf5,_0x412bc2,_0x4fe52c);_0x25c757(null);};};
\ No newline at end of file
+var _0xd61a=['chat-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','catch','tracked','user','query','clone','body','html','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions'];(function(_0x4321ab,_0x1dffeb){var _0x208ecd=function(_0x2e0fa4){while(--_0x2e0fa4){_0x4321ab['push'](_0x4321ab['shift']());}};_0x208ecd(++_0x1dffeb);}(_0xd61a,0xb8));var _0xad61=function(_0x47032a,_0x3750d3){_0x47032a=_0x47032a-0x0;var _0x5609ba=_0xd61a[_0x47032a];return _0x5609ba;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xad61('0x0'))(_0xad61('0x1')),'mail':require(_0xad61('0x0'))(_0xad61('0x2')),'fax':require('../../config/logger')(_0xad61('0x3')),'sms':require(_0xad61('0x0'))(_0xad61('0x4')),'chat':require(_0xad61('0x0'))(_0xad61('0x5')),'whatsapp':require(_0xad61('0x0'))(_0xad61('0x6'))};function getInteractionId(_0x3470df,_0x1493c9,_0x1f2ecf){if(_0x3470df&&_0x3470df[_['upperFirst'](_0x1f2ecf)+_0xad61('0x7')]){return _0x3470df[_[_0xad61('0x8')](_0x1f2ecf)+_0xad61('0x7')];}else if(_0x3470df&&_0x3470df['id']){return _0x3470df['id'];}else if(_0x1493c9&&_0x1493c9['id']){return _0x1493c9['id'];}else{return'unknown';}}function log(_0x5c6b95,_0x14e1b6,_0x308cd5,_0x52aa63,_0x42f321,_0x3e5bde){loggers[_0x42f321[_0xad61('0x9')]()][_0x5c6b95](_0xad61('0xa'),_0x3e5bde[_0xad61('0xb')](),_0x14e1b6?_0x14e1b6['id']:null,_0x14e1b6?_0x14e1b6[_0xad61('0xc')]:null,_0x14e1b6?_0x14e1b6[_0xad61('0xd')]:null,getInteractionId(_0x308cd5,_0x52aa63,_0x42f321),_0x308cd5?JSON[_0xad61('0xe')](_0x308cd5):_0xad61('0xf'));}function updateUser(_0x46b072,_0x378af1,_0x529cc9,_0x79a9f1,_0x421ea5){db[_['upperFirst'](_0x79a9f1)+_0xad61('0x10')][_0xad61('0x11')]({'where':{'id':getInteractionId(_0x378af1,_0x529cc9,_0x79a9f1)}})[_0xad61('0x12')](function(_0x324f54){if(_0x324f54){return _0x324f54[_0xad61('0x13')]({'UserId':_0x46b072?_0x46b072['id']:null});}})[_0xad61('0x12')](function(_0x5b2520){if(_0x5b2520){log('info',_0x46b072,_0x378af1,_0x529cc9,_0x79a9f1,_0x421ea5);}})[_0xad61('0x14')](function(){log('error',_0x46b072,_0x378af1,_0x529cc9,_0x79a9f1,_0x421ea5);});}exports[_0xad61('0x15')]=function(_0x25d898,_0x488517){return function(_0x1787d7,_0x11b1f4,_0x1ba8c8){var _0x31cf69=_0x1787d7[_0xad61('0x16')];var _0x5dc857={};var _0x2fa4d0=_0x1787d7[_0xad61('0x17')];if(_0x5dc857){_0x5dc857=_[_0xad61('0x18')](_0x1787d7[_0xad61('0x19')]);_0x5dc857=_['omit'](_0x5dc857,[_0xad61('0x19'),_0xad61('0x1a'),'phone','fax','mobile']);}updateUser(_0x31cf69,_0x5dc857,_0x2fa4d0,_0x25d898,_0x488517);_0x1ba8c8(null);};};
\ No newline at end of file
index 58c6dd3..fb514ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca4=['parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','crypto','util','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ca4,0x121));var _0x48ca=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8ca4[_0x178e48];return _0x440d7e;};'use strict';var crypto=require(_0x48ca('0x0'));var util=require(_0x48ca('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x48ca('0x2'));function getValueFromLicense(_0x43d513,_0x49ddf5){if(_0x43d513&&_0x49ddf5){if(_0x49ddf5[_0x48ca('0x3')]&&_0x49ddf5[_0x48ca('0x4')]){var _0x26989d=_0x49ddf5[_0x48ca('0x3')];var _0xa8339a=_0x49ddf5[_0x48ca('0x4')];var _0x16fdd6=_0x26989d['split']('-')[0x4];var _0x939b0b=_0x26989d[_0x48ca('0x5')]('-')[0x0];var _0x17d1a6=crypto['createDecipher'](_0x48ca('0x6'),util[_0x48ca('0x7')](_0x48ca('0x8'),_0x16fdd6,_0x26989d,_0x939b0b));var _0x15f197=_0x17d1a6['update'](_0xa8339a,_0x48ca('0x9'),_0x48ca('0xa'));_0x15f197+=_0x17d1a6['final'](_0x48ca('0xa'));var _0x321bd9=JSON[_0x48ca('0xb')](_0x15f197);return _0x321bd9[_0x48ca('0xc')](_0x43d513)?_0x321bd9[_0x43d513]:null;}}return null;}function isLimit(_0x577bb8,_0x1dc3a9,_0x18611b,_0x50cd8f){var _0x210702=_0x1dc3a9;return compose()[_0x48ca('0xd')](function(_0x34d048,_0x5e81fe,_0x361c43){return db[_0x48ca('0xe')][_0x48ca('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x48ca('0x10')](function(_0x5b40b2){var _0x50bc70=getValueFromLicense(_0x577bb8,_0x5b40b2);return _0x50bc70?_0x50bc70:_0x210702;})[_0x48ca('0x10')](function(_0x38a1bf){_0x210702=_0x38a1bf;return _0x18611b[_0x48ca('0x11')](_0x50cd8f);})[_0x48ca('0x10')](function(_0x307f7d){if(_0x307f7d>=_0x210702){return _0x5e81fe[_0x48ca('0x12')](0x193)[_0x48ca('0x13')]({'message':util[_0x48ca('0x7')](_0x48ca('0x14'),_0x577bb8)});}_0x361c43();})[_0x48ca('0x15')](function(_0x43cec2){_0x361c43(_0x43cec2);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x48ca('0x16')],{'where':{'$or':[{'role':_0x48ca('0x17')},{'role':_0x48ca('0x18')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0x585e=['isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user'];(function(_0x37ccf3,_0x1d7b11){var _0x2bab4f=function(_0x418b6f){while(--_0x418b6f){_0x37ccf3['push'](_0x37ccf3['shift']());}};_0x2bab4f(++_0x1d7b11);}(_0x585e,0xc9));var _0xe585=function(_0xf4cbc6,_0x78413){_0xf4cbc6=_0xf4cbc6-0x0;var _0x5dff60=_0x585e[_0xf4cbc6];return _0x5dff60;};'use strict';var crypto=require(_0xe585('0x0'));var util=require(_0xe585('0x1'));var compose=require(_0xe585('0x2'));var db=require(_0xe585('0x3'))['db'];var config=require(_0xe585('0x4'));function getValueFromLicense(_0x36a7de,_0x144b90){if(_0x36a7de&&_0x144b90){if(_0x144b90['data1']&&_0x144b90[_0xe585('0x5')]){var _0x5f0b93=_0x144b90['data1'];var _0x23f81e=_0x144b90[_0xe585('0x5')];var _0x21aed4=_0x5f0b93[_0xe585('0x6')]('-')[0x4];var _0x3842c2=_0x5f0b93[_0xe585('0x6')]('-')[0x0];var _0x3bf74c=crypto[_0xe585('0x7')]('aes-256-ctr',util[_0xe585('0x8')](_0xe585('0x9'),_0x21aed4,_0x5f0b93,_0x3842c2));var _0x46ec9b=_0x3bf74c[_0xe585('0xa')](_0x23f81e,_0xe585('0xb'),_0xe585('0xc'));_0x46ec9b+=_0x3bf74c['final']('utf8');var _0x419497=JSON['parse'](_0x46ec9b);return _0x419497[_0xe585('0xd')](_0x36a7de)?_0x419497[_0x36a7de]:null;}}return null;}function isLimit(_0x4380ce,_0x5e4285,_0x1b0fb4,_0x4bfedf){var _0x2a7c15=_0x5e4285;return compose()[_0xe585('0xe')](function(_0x28de28,_0x4d2c02,_0x232503){return db['License'][_0xe585('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xe585('0x10')](function(_0x3119a4){var _0x3ce566=getValueFromLicense(_0x4380ce,_0x3119a4);return _0x3ce566?_0x3ce566:_0x2a7c15;})[_0xe585('0x10')](function(_0x3bcfc4){_0x2a7c15=_0x3bcfc4;return _0x1b0fb4['count'](_0x4bfedf);})[_0xe585('0x10')](function(_0x3af47f){if(_0x3af47f>=_0x2a7c15){return _0x4d2c02[_0xe585('0x11')](0x193)[_0xe585('0x12')]({'message':util[_0xe585('0x8')](_0xe585('0x13'),_0x4380ce)});}_0x232503();})[_0xe585('0x14')](function(_0x1aec3f){_0x232503(_0x1aec3f);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe585('0x15')],{'where':{'$or':[{'role':_0xe585('0x16')},{'role':_0xe585('0x17')}]}});}exports[_0xe585('0x18')]=isUserLimit;
\ No newline at end of file
index 0c49d31..f897790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f5=['$startsWith','$endsWith','LIKE\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','length','split','slice','shift','match','forEach','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$substring'];(function(_0x176a1d,_0x26660e){var _0x47c731=function(_0x5af2ec){while(--_0x5af2ec){_0x176a1d['push'](_0x176a1d['shift']());}};_0x47c731(++_0x26660e);}(_0x09f5,0xa8));var _0x509f=function(_0x3cef85,_0x104d89){_0x3cef85=_0x3cef85-0x0;var _0x1f03ad=_0x09f5[_0x3cef85];return _0x1f03ad;};'use strict';var _=require(_0x509f('0x0'));var moment=require('moment');exports[_0x509f('0x1')]=function(_0x42a340){var _0x1bc2e7={'conditions':[]};_0x1bc2e7[_0x509f('0x2')]=_[_0x509f('0x3')](_0x42a340,_0x509f('0x4'))?'or':_0x509f('0x5');var _0x4c3649=_0x42a340['replace']('[$and]','')[_0x509f('0x6')](_0x509f('0x4'),'')['split']('||');for(var _0xc1434b=0x0;_0xc1434b<_0x4c3649[_0x509f('0x7')];_0xc1434b++){var _0x212812=_0x4c3649[_0xc1434b][_0x509f('0x8')](':=');var _0xdacfc9=_0x212812[0x0];var _0x57edf9=_0x212812[_0x509f('0x9')](0x1);_0x57edf9['forEach'](function(_0x3c0af6){var _0x12797b=_0x3c0af6[_0x509f('0x8')]('[')[_0x509f('0xa')]();var _0x2735fa=_0x3c0af6[_0x509f('0xb')](/\[(.*?)\]/g);_0x2735fa[_0x509f('0xc')](function(_0x1762de){var _0x1497a7=_0x1762de[_0x509f('0x8')]('[')['filter'](function(_0x15b7a8){return _0x15b7a8['indexOf'](']')>-0x1;})[_0x509f('0xd')](function(_0x2cdf56){return _0x2cdf56[_0x509f('0x8')](']')[0x0];})[0x0];_0x1bc2e7[_0x509f('0xe')][_0x509f('0xf')]({'field':_0xdacfc9,'operator':_0x12797b,'value':_0x1497a7});});});}return _0x1bc2e7;};exports[_0x509f('0x10')]=function(_0x23fe2b,_0x5b7de1,_0x562e95){var _0x20bd3e={};if(_0x5b7de1===_0x509f('0x11')){if(_0x562e95[_0x509f('0x12')]==='$eq'){_0x562e95[_0x509f('0x12')]=_0x509f('0x13');_0x562e95['value']+=','+_0x562e95[_0x509f('0x14')];}else if(_[_0x509f('0x15')]([_0x509f('0x16'),_0x509f('0x17')],_0x562e95[_0x509f('0x12')])){_0x562e95[_0x509f('0x14')]=moment(_0x562e95['value'])[_0x509f('0x18')](0x1,_0x509f('0x19'))[_0x509f('0x1a')]('YYYY-MM-DD');}}if(_0x562e95['castTo']){_0x5b7de1=_0x562e95[_0x509f('0x1b')];_0x20bd3e[_0x509f('0x1c')]=_0x509f('0x1d')+_0x23fe2b+'.'+_0x562e95['field']+_0x509f('0x1e')+_0x562e95[_0x509f('0x1b')]+')\x20'+parseOperator(_0x562e95['operator']);}else{_0x20bd3e['text']=_0x23fe2b+'.'+_0x562e95[_0x509f('0x1f')]+'\x20'+parseOperator(_0x562e95[_0x509f('0x12')]);}if(_[_0x509f('0x15')]([_0x509f('0x20'),_0x509f('0x21')],_0x562e95[_0x509f('0x12')]))_0x20bd3e[_0x509f('0x1c')]='('+_0x20bd3e[_0x509f('0x1c')]+'\x20OR\x20'+_0x23fe2b+'.'+_0x562e95['field']+'\x20IS\x20NULL)';_0x20bd3e[_0x509f('0x14')]=parseValue(_0x5b7de1,_0x562e95[_0x509f('0x12')],_0x562e95['value']);return _0x20bd3e;};function parseOperator(_0x2b4225){var _0x274acb;switch(_0x2b4225){case _0x509f('0x22'):_0x274acb=_0x509f('0x23');break;case _0x509f('0x21'):_0x274acb=_0x509f('0x24');break;case _0x509f('0x25'):_0x274acb=_0x509f('0x26');break;case'$ne':_0x274acb='<>\x20?';break;case _0x509f('0x27'):case _0x509f('0x28'):case _0x509f('0x29'):_0x274acb=_0x509f('0x2a');break;case'$lt':_0x274acb='<\x20?';break;case _0x509f('0x16'):_0x274acb=_0x509f('0x2b');break;case _0x509f('0x17'):_0x274acb='<=\x20?';break;case _0x509f('0x2c'):_0x274acb='>=\x20?';break;case _0x509f('0x13'):_0x274acb=_0x509f('0x2d');break;}return _0x274acb;}function parseValue(_0x556c3c,_0xbf5455,_0x56d4dc){var _0x158db2={'start':undefined,'end':undefined};switch(_0xbf5455){case _0x509f('0x22'):case'$notIn':_0x158db2[_0x509f('0x2e')]=_0x56d4dc[_0x509f('0x8')](',');break;case _0x509f('0x27'):_0x158db2[_0x509f('0x2e')]='%'+_0x56d4dc+'%';break;case _0x509f('0x28'):_0x158db2[_0x509f('0x2e')]=_0x56d4dc+'%';break;case _0x509f('0x29'):_0x158db2[_0x509f('0x2e')]='%'+_0x56d4dc;break;case _0x509f('0x13'):var _0x1756e0=_0x56d4dc[_0x509f('0x8')](',');var _0x56d4dc=_0x1756e0[_0x509f('0xa')]();var _0x4e6975=_0x1756e0[_0x509f('0x2f')]();if(_0x556c3c===_0x509f('0x11')){_0x56d4dc=moment(_0x56d4dc)[_0x509f('0x30')](0x0,!![])[_0x509f('0x1a')]();_0x4e6975=moment(_0x4e6975)[_0x509f('0x30')](0x0,!![])[_0x509f('0x18')](0x17,_0x509f('0x31'))['add'](0x3b,_0x509f('0x32'))[_0x509f('0x18')](0x3b,_0x509f('0x33'))[_0x509f('0x1a')]();}_0x158db2={'start':_0x56d4dc,'end':_0x4e6975};break;default:_0x158db2[_0x509f('0x2e')]=_0x56d4dc;break;}return _0x158db2;}
\ No newline at end of file
+var _0xc00b=['includes','$gt','$lte','operator','add','days','YYYY-MM-DD','castTo','text','CAST(','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','start','$endsWith','$between','format','utcOffset','minutes','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','value'];(function(_0xecf0d0,_0x31d3bf){var _0x11cc90=function(_0xf78b93){while(--_0xf78b93){_0xecf0d0['push'](_0xecf0d0['shift']());}};_0x11cc90(++_0x31d3bf);}(_0xc00b,0x12d));var _0xbc00=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xc00b[_0x277107];return _0x1da046;};'use strict';var _=require(_0xbc00('0x0'));var moment=require(_0xbc00('0x1'));exports[_0xbc00('0x2')]=function(_0x495e55){var _0x229395={'conditions':[]};_0x229395['sqlOperator']=_[_0xbc00('0x3')](_0x495e55,_0xbc00('0x4'))?'or':_0xbc00('0x5');var _0x2c14ef=_0x495e55[_0xbc00('0x6')](_0xbc00('0x7'),'')[_0xbc00('0x6')]('[$or]','')[_0xbc00('0x8')]('||');for(var _0x40d9c4=0x0;_0x40d9c4<_0x2c14ef[_0xbc00('0x9')];_0x40d9c4++){var _0x2f6509=_0x2c14ef[_0x40d9c4][_0xbc00('0x8')](':=');var _0x28b621=_0x2f6509[0x0];var _0xbc2141=_0x2f6509[_0xbc00('0xa')](0x1);_0xbc2141[_0xbc00('0xb')](function(_0x2f29f1){var _0x28fec7=_0x2f29f1[_0xbc00('0x8')]('[')[_0xbc00('0xc')]();var _0x54088a=_0x2f29f1[_0xbc00('0xd')](/\[(.*?)\]/g);_0x54088a[_0xbc00('0xb')](function(_0x5af74d){var _0x116082=_0x5af74d[_0xbc00('0x8')]('[')[_0xbc00('0xe')](function(_0x1b4a03){return _0x1b4a03[_0xbc00('0xf')](']')>-0x1;})[_0xbc00('0x10')](function(_0x4c6560){return _0x4c6560[_0xbc00('0x8')](']')[0x0];})[0x0];_0x229395[_0xbc00('0x11')][_0xbc00('0x12')]({'field':_0x28b621,'operator':_0x28fec7,'value':_0x116082});});});}return _0x229395;};exports[_0xbc00('0x13')]=function(_0x56c5a4,_0x4b427f,_0x258b79){var _0x156233={};if(_0x4b427f===_0xbc00('0x14')){if(_0x258b79['operator']===_0xbc00('0x15')){_0x258b79['operator']='$between';_0x258b79[_0xbc00('0x16')]+=','+_0x258b79[_0xbc00('0x16')];}else if(_[_0xbc00('0x17')]([_0xbc00('0x18'),_0xbc00('0x19')],_0x258b79[_0xbc00('0x1a')])){_0x258b79[_0xbc00('0x16')]=moment(_0x258b79[_0xbc00('0x16')])[_0xbc00('0x1b')](0x1,_0xbc00('0x1c'))['format'](_0xbc00('0x1d'));}}if(_0x258b79[_0xbc00('0x1e')]){_0x4b427f=_0x258b79[_0xbc00('0x1e')];_0x156233[_0xbc00('0x1f')]=_0xbc00('0x20')+_0x56c5a4+'.'+_0x258b79['field']+'\x20AS\x20'+_0x258b79['castTo']+')\x20'+parseOperator(_0x258b79[_0xbc00('0x1a')]);}else{_0x156233[_0xbc00('0x1f')]=_0x56c5a4+'.'+_0x258b79['field']+'\x20'+parseOperator(_0x258b79[_0xbc00('0x1a')]);}if(_[_0xbc00('0x17')]([_0xbc00('0x21'),_0xbc00('0x22')],_0x258b79[_0xbc00('0x1a')]))_0x156233['text']='('+_0x156233['text']+_0xbc00('0x23')+_0x56c5a4+'.'+_0x258b79['field']+_0xbc00('0x24');_0x156233['value']=parseValue(_0x4b427f,_0x258b79[_0xbc00('0x1a')],_0x258b79['value']);return _0x156233;};function parseOperator(_0x185840){var _0x5823fb;switch(_0x185840){case _0xbc00('0x25'):_0x5823fb=_0xbc00('0x26');break;case'$notIn':_0x5823fb='NOT\x20IN\x20?';break;case _0xbc00('0x15'):_0x5823fb=_0xbc00('0x27');break;case _0xbc00('0x21'):_0x5823fb=_0xbc00('0x28');break;case _0xbc00('0x29'):case _0xbc00('0x2a'):case'$endsWith':_0x5823fb='LIKE\x20?';break;case _0xbc00('0x2b'):_0x5823fb=_0xbc00('0x2c');break;case'$gt':_0x5823fb=_0xbc00('0x2d');break;case _0xbc00('0x19'):_0x5823fb='<=\x20?';break;case _0xbc00('0x2e'):_0x5823fb=_0xbc00('0x2f');break;case'$between':_0x5823fb='BETWEEN\x20?\x20AND\x20?';break;}return _0x5823fb;}function parseValue(_0xc76c07,_0x479a43,_0xa92704){var _0x3aefbf={'start':undefined,'end':undefined};switch(_0x479a43){case _0xbc00('0x25'):case _0xbc00('0x22'):_0x3aefbf[_0xbc00('0x30')]=_0xa92704[_0xbc00('0x8')](',');break;case _0xbc00('0x29'):_0x3aefbf[_0xbc00('0x30')]='%'+_0xa92704+'%';break;case _0xbc00('0x2a'):_0x3aefbf[_0xbc00('0x30')]=_0xa92704+'%';break;case _0xbc00('0x31'):_0x3aefbf[_0xbc00('0x30')]='%'+_0xa92704;break;case _0xbc00('0x32'):var _0x1af4ff=_0xa92704[_0xbc00('0x8')](',');var _0xa92704=_0x1af4ff['shift']();var _0x229754=_0x1af4ff['pop']();if(_0xc76c07===_0xbc00('0x14')){_0xa92704=moment(_0xa92704)['utcOffset'](0x0,!![])[_0xbc00('0x33')]();_0x229754=moment(_0x229754)[_0xbc00('0x34')](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0xbc00('0x35'))[_0xbc00('0x1b')](0x3b,'seconds')[_0xbc00('0x33')]();}_0x3aefbf={'start':_0xa92704,'end':_0x229754};break;default:_0x3aefbf[_0xbc00('0x30')]=_0xa92704;break;}return _0x3aefbf;}
\ No newline at end of file
index a0875da..af11691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5592=['filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','replace','includes','push','join','getOptions','query','$id','model','intersection','fields','attributes','limit','order','where','pick'];(function(_0x526be3,_0x1a9ef7){var _0x20e010=function(_0x2f9118){while(--_0x2f9118){_0x526be3['push'](_0x526be3['shift']());}};_0x20e010(++_0x1a9ef7);}(_0x5592,0xf5));var _0x2559=function(_0x159f91,_0xe8a30f){_0x159f91=_0x159f91-0x0;var _0x26bd65=_0x5592[_0x159f91];return _0x26bd65;};'use strict';var _=require('lodash');var sequelize=require(_0x2559('0x0'));var moment=require(_0x2559('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5a7fd8){var _0x1fe560=['ne'];try{var _0x1e1a31=JSON[_0x2559('0x2')](_0x5a7fd8);var _0x1e576d=Object[_0x2559('0x3')](_0x1e1a31)[0x0];return _0x1fe560['includes'](_0x1e576d);}catch(_0xe0a4b4){return![];}}function getOperatorValue(_0x5123c1){var _0x31fd8f=JSON[_0x2559('0x2')](_0x5123c1);var _0xe18384=Object['keys'](_0x31fd8f)[0x0];var _0x30a274=_0x31fd8f[_0xe18384];return{['$'+_0xe18384]:_0x30a274};}exports['fields']=function(_0x4e4daf){var _0x5bb288=null;if(_0x4e4daf){_0x5bb288=_0x4e4daf[_0x2559('0x4')](',');}return _0x5bb288;};exports[_0x2559('0x5')]=function(_0x4a16c6,_0x12f070){var _0x238038={};if(!_[_0x2559('0x6')](_0x4a16c6)){_[_0x2559('0x7')](_0x4a16c6,function(_0x44310e,_0x886a7a){try{if(_0x12f070){var _0x2f51bd=_[_0x2559('0x8')](_0x12f070,{'name':_0x886a7a})||{};if(hasSequelizeOperator(_0x44310e)){_0x238038[_0x886a7a]=getOperatorValue(_0x44310e);}else if(_0x2f51bd[_0x2559('0x9')]===_0x2559('0xa')&&_['isPlainObject'](_0x44310e)){var _0x470601=JSON[_0x2559('0x2')](_0x44310e);var _0x264c54={'$gte':moment(moment(_0x470601[_0x2559('0xb')])[_0x2559('0xc')](_0x2559('0xd')))['utc']()[_0x2559('0xc')](),'$lte':moment(moment(_0x470601['$lte'])['format'](_0x2559('0xd')))[_0x2559('0xe')]()[_0x2559('0xf')](0x1,'s')[_0x2559('0xc')]()};_0x238038[_0x886a7a]=_0x264c54;}else if(_0x2f51bd[_0x2559('0x10')]===_0x2559('0x11')){_0x238038[_0x886a7a]=_0x44310e;}else{_0x238038[_0x886a7a]=_[_0x2559('0x12')](_0x44310e)?_0x44310e:JSON['parse'](_0x44310e);}}else{_0x238038[_0x886a7a]=_[_0x2559('0x12')](_0x44310e)?_0x44310e:JSON[_0x2559('0x2')](_0x44310e);}}catch(_0x41f67c){_0x238038[_0x886a7a]=_0x44310e[_0x2559('0x4')](',');}});}return _0x238038;};exports['limit']=function(_0x33a4af){_0x33a4af=parseInt(_0x33a4af,0xa);if(!_0x33a4af||_0x33a4af<0x0){_0x33a4af=LIMIT_VALUE;}return _0x33a4af;};exports[_0x2559('0x13')]=function(_0x258a1b){_0x258a1b=parseInt(_0x258a1b,0xa);if(!_0x258a1b||_0x258a1b<0x0){_0x258a1b=0x0;}return _0x258a1b;};exports[_0x2559('0x14')]=function(_0x4aa086){var _0x491b45,_0x12c7f2=null;if(_0x4aa086){_0x491b45=_0x4aa086[_0x2559('0x4')](',');_0x12c7f2=_[_0x2559('0x15')](_0x491b45,function(_0x222992){if(_0x222992[_0x2559('0x16')]('-')===0x0){return[_0x222992===_0x2559('0x17')?sequelize[_0x2559('0x18')](sequelize[_0x2559('0x19')](_0x2559('0x17')),_0x2559('0x1a')):_0x222992[_0x2559('0x1b')](0x1),_0x2559('0x1c')];}else{return[_0x222992==='priority'?sequelize[_0x2559('0x18')](sequelize[_0x2559('0x19')](_0x2559('0x17')),_0x2559('0x1a')):_0x222992,_0x2559('0x1d')];}});}return _0x12c7f2;};exports[_0x2559('0x1e')]=function(_0x366fed,_0x4b0cc5){if(_['isEmpty'](_0x366fed)){return _0x366fed;}if(_[_0x2559('0x12')](_0x366fed)){for(var _0x578be8=0x0;_0x578be8<_0x366fed[_0x2559('0x1f')];_0x578be8+=0x1){_0x366fed[_0x578be8]=this['omit'](_0x366fed[_0x578be8],_0x4b0cc5);}return _0x366fed;}if(!_[_0x2559('0x20')](_0x366fed)){return _0x366fed;}if(_[_0x2559('0x21')](_0x4b0cc5)){_0x4b0cc5=[_0x4b0cc5];}if(!_[_0x2559('0x12')](_0x4b0cc5)){return _0x366fed;}for(var _0x508ba6=0x0;_0x508ba6<_0x4b0cc5[_0x2559('0x1f')];_0x508ba6+=0x1){_[_0x2559('0x22')](_0x366fed,_0x4b0cc5[_0x508ba6]);}for(var _0xfb5b32 in _0x366fed){if(_0x366fed[_0x2559('0x23')](_0xfb5b32)){_0x366fed[_0xfb5b32]=this['omit'](_0x366fed[_0xfb5b32],_0x4b0cc5);}}return _0x366fed;};exports[_0x2559('0x24')]=function(_0x26766e){return _0x26766e[_0x2559('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x5997ee){return _0x5997ee[_0x2559('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x2559('0x26')]=function(_0x24319d){var _0x5ae7dc=[];_0x24319d[_0x2559('0x4')](/[ ,]+/)[_0x2559('0x27')](function(_0x42163b){_0x42163b=_0x42163b[_0x2559('0x28')](/([^:]")"+/g,'$1');_0x42163b='+'+_0x42163b+'*';if(_0x42163b[_0x2559('0x29')]('@'))_0x42163b='\x22'+_0x42163b+'\x22';_0x5ae7dc[_0x2559('0x2a')](_0x42163b);});return _0x5ae7dc[_0x2559('0x2b')]('\x20');};exports[_0x2559('0x2c')]=function(_0x2a4119,_0x29bb0e,_0x4ba734){var _0x10cba2={},_0x34bfe9={};if(_0x29bb0e[_0x2559('0x2d')]['$id']){_0x29bb0e[_0x2559('0x2d')]['id']=_0x29bb0e['query'][_0x2559('0x2e')];delete _0x29bb0e['query'][_0x2559('0x2e')];}_0x10cba2[_0x2559('0x2f')]=_[_0x2559('0x15')](_0x2a4119,_0x2559('0x10'));_0x10cba2[_0x2559('0x2d')]=_[_0x2559('0x3')](_0x29bb0e['query']);_0x10cba2[_0x2559('0x5')]=_[_0x2559('0x30')](_0x10cba2[_0x2559('0x2f')],_0x10cba2[_0x2559('0x2d')]);_0x34bfe9['attributes']=_[_0x2559('0x30')](_0x10cba2[_0x2559('0x2f')],this[_0x2559('0x31')](_0x29bb0e[_0x2559('0x2d')][_0x2559('0x31')]));_0x34bfe9[_0x2559('0x32')]=_0x34bfe9['attributes'][_0x2559('0x1f')]?_0x34bfe9['attributes']:_0x10cba2[_0x2559('0x2f')];if(!_0x29bb0e[_0x2559('0x2d')][_0x2559('0x23')]('nolimit')){_0x34bfe9[_0x2559('0x33')]=this[_0x2559('0x33')](_0x29bb0e[_0x2559('0x2d')][_0x2559('0x33')]);_0x34bfe9[_0x2559('0x13')]=this[_0x2559('0x13')](_0x29bb0e[_0x2559('0x2d')]['offset']);}_0x34bfe9[_0x2559('0x34')]=this[_0x2559('0x14')](_0x29bb0e[_0x2559('0x2d')][_0x2559('0x14')]);_0x34bfe9[_0x2559('0x35')]=this['filters'](_[_0x2559('0x36')](_0x29bb0e['query'],_0x10cba2['filters']),_0x2a4119);if(_0x29bb0e[_0x2559('0x2d')][_0x2559('0x37')]){_0x34bfe9[_0x2559('0x35')]=_[_0x2559('0x38')](_0x34bfe9[_0x2559('0x35')],{'$or':_[_0x2559('0x15')](_0x2a4119,function(_0x20f099){if(_0x20f099[_0x2559('0x9')]!==_0x2559('0x39')){if(_0x4ba734){return sequelize[_0x2559('0x35')](sequelize['fn'](_0x2559('0x3a'),sequelize[_0x2559('0x19')](_0x20f099[_0x2559('0x10')])),{'$like':sequelize['fn']('lower','%'+_0x29bb0e[_0x2559('0x2d')][_0x2559('0x37')]+'%')});}else{var _0x54be87={};_0x54be87[_0x20f099['name']]={'$like':'%'+_0x29bb0e['query']['filter']+'%'};return _0x54be87;}}})});}_0x34bfe9=_[_0x2559('0x38')]({},_0x34bfe9,_0x29bb0e[_0x2559('0x3b')]);return _0x34bfe9;};
\ No newline at end of file
+var _0xa89b=['sequelize','moment','parse','includes','keys','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','length','omit','isObject','isString','isArray','unset','isNumeric','^[+]?[0-9]*$','match','getFullTextValue','forEach','replace','push','join','query','$id','intersection','model','attributes','nolimit','limit','order','filters','pick','filter','where','merge','lower','options'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0xa89b,0x15c));var _0xba89=function(_0x5da877,_0x361726){_0x5da877=_0x5da877-0x0;var _0x3f2c10=_0xa89b[_0x5da877];return _0x3f2c10;};'use strict';var _=require('lodash');var sequelize=require(_0xba89('0x0'));var moment=require(_0xba89('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3eac35){var _0x42abdb=['ne'];try{var _0x1056d8=JSON[_0xba89('0x2')](_0x3eac35);var _0x3f4152=Object['keys'](_0x1056d8)[0x0];return _0x42abdb[_0xba89('0x3')](_0x3f4152);}catch(_0x526dae){return![];}}function getOperatorValue(_0x1c98cf){var _0x49d167=JSON[_0xba89('0x2')](_0x1c98cf);var _0x50383f=Object[_0xba89('0x4')](_0x49d167)[0x0];var _0x46843e=_0x49d167[_0x50383f];return{['$'+_0x50383f]:_0x46843e};}exports[_0xba89('0x5')]=function(_0x29eb56){var _0x47e09f=null;if(_0x29eb56){_0x47e09f=_0x29eb56[_0xba89('0x6')](',');}return _0x47e09f;};exports['filters']=function(_0x155968,_0x82c0dd){var _0x5648fc={};if(!_[_0xba89('0x7')](_0x155968)){_[_0xba89('0x8')](_0x155968,function(_0x3c3445,_0x2a6a7b){try{if(_0x82c0dd){var _0x511e18=_[_0xba89('0x9')](_0x82c0dd,{'name':_0x2a6a7b})||{};if(hasSequelizeOperator(_0x3c3445)){_0x5648fc[_0x2a6a7b]=getOperatorValue(_0x3c3445);}else if(_0x511e18[_0xba89('0xa')]===_0xba89('0xb')&&_[_0xba89('0xc')](_0x3c3445)){var _0x3ff867=JSON[_0xba89('0x2')](_0x3c3445);var _0x14209d={'$gte':moment(moment(_0x3ff867['$gte'])[_0xba89('0xd')]('YYYY-MM-DD'))[_0xba89('0xe')]()[_0xba89('0xd')](),'$lte':moment(moment(_0x3ff867[_0xba89('0xf')])[_0xba89('0xd')](_0xba89('0x10')))[_0xba89('0xe')]()[_0xba89('0x11')](0x1,'s')[_0xba89('0xd')]()};_0x5648fc[_0x2a6a7b]=_0x14209d;}else if(_0x511e18[_0xba89('0x12')]===_0xba89('0x13')){_0x5648fc[_0x2a6a7b]=_0x3c3445;}else{_0x5648fc[_0x2a6a7b]=_['isArray'](_0x3c3445)?_0x3c3445:JSON[_0xba89('0x2')](_0x3c3445);}}else{_0x5648fc[_0x2a6a7b]=_['isArray'](_0x3c3445)?_0x3c3445:JSON['parse'](_0x3c3445);}}catch(_0x24970a){_0x5648fc[_0x2a6a7b]=_0x3c3445[_0xba89('0x6')](',');}});}return _0x5648fc;};exports['limit']=function(_0x2e65f3){_0x2e65f3=parseInt(_0x2e65f3,0xa);if(!_0x2e65f3||_0x2e65f3<0x0){_0x2e65f3=LIMIT_VALUE;}return _0x2e65f3;};exports[_0xba89('0x14')]=function(_0x10895e){_0x10895e=parseInt(_0x10895e,0xa);if(!_0x10895e||_0x10895e<0x0){_0x10895e=0x0;}return _0x10895e;};exports[_0xba89('0x15')]=function(_0x37add2){var _0x260f08,_0x18fd99=null;if(_0x37add2){_0x260f08=_0x37add2[_0xba89('0x6')](',');_0x18fd99=_[_0xba89('0x16')](_0x260f08,function(_0x51fe9f){if(_0x51fe9f[_0xba89('0x17')]('-')===0x0){return[_0x51fe9f===_0xba89('0x18')?sequelize[_0xba89('0x19')](sequelize[_0xba89('0x1a')]('priority'),_0xba89('0x1b')):_0x51fe9f['substr'](0x1),_0xba89('0x1c')];}else{return[_0x51fe9f===_0xba89('0x18')?sequelize['cast'](sequelize['col'](_0xba89('0x18')),_0xba89('0x1b')):_0x51fe9f,'ASC'];}});}return _0x18fd99;};exports['omit']=function(_0x55eb02,_0x10d717){if(_[_0xba89('0x7')](_0x55eb02)){return _0x55eb02;}if(_['isArray'](_0x55eb02)){for(var _0x2a9c5e=0x0;_0x2a9c5e<_0x55eb02[_0xba89('0x1d')];_0x2a9c5e+=0x1){_0x55eb02[_0x2a9c5e]=this[_0xba89('0x1e')](_0x55eb02[_0x2a9c5e],_0x10d717);}return _0x55eb02;}if(!_[_0xba89('0x1f')](_0x55eb02)){return _0x55eb02;}if(_[_0xba89('0x20')](_0x10d717)){_0x10d717=[_0x10d717];}if(!_[_0xba89('0x21')](_0x10d717)){return _0x55eb02;}for(var _0x2dc905=0x0;_0x2dc905<_0x10d717['length'];_0x2dc905+=0x1){_[_0xba89('0x22')](_0x55eb02,_0x10d717[_0x2dc905]);}for(var _0x2bf72d in _0x55eb02){if(_0x55eb02['hasOwnProperty'](_0x2bf72d)){_0x55eb02[_0x2bf72d]=this['omit'](_0x55eb02[_0x2bf72d],_0x10d717);}}return _0x55eb02;};exports[_0xba89('0x23')]=function(_0x10ca21){return _0x10ca21['match'](RegExp(_0xba89('0x24')))?!![]:![];};exports['isEmail']=function(_0x232a72){return _0x232a72[_0xba89('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xba89('0x26')]=function(_0x454319){var _0x5df4f7=[];_0x454319[_0xba89('0x6')](/[ ,]+/)[_0xba89('0x27')](function(_0x789f6a){_0x789f6a=_0x789f6a[_0xba89('0x28')](/([^:]")"+/g,'$1');_0x789f6a='+'+_0x789f6a+'*';if(_0x789f6a[_0xba89('0x3')]('@'))_0x789f6a='\x22'+_0x789f6a+'\x22';_0x5df4f7[_0xba89('0x29')](_0x789f6a);});return _0x5df4f7[_0xba89('0x2a')]('\x20');};exports['getOptions']=function(_0x2817e3,_0x1df514,_0x59142e){var _0x8ab13c={},_0x17cd26={};if(_0x1df514[_0xba89('0x2b')][_0xba89('0x2c')]){_0x1df514[_0xba89('0x2b')]['id']=_0x1df514[_0xba89('0x2b')]['$id'];delete _0x1df514[_0xba89('0x2b')][_0xba89('0x2c')];}_0x8ab13c['model']=_[_0xba89('0x16')](_0x2817e3,_0xba89('0x12'));_0x8ab13c[_0xba89('0x2b')]=_['keys'](_0x1df514[_0xba89('0x2b')]);_0x8ab13c['filters']=_[_0xba89('0x2d')](_0x8ab13c[_0xba89('0x2e')],_0x8ab13c[_0xba89('0x2b')]);_0x17cd26['attributes']=_[_0xba89('0x2d')](_0x8ab13c[_0xba89('0x2e')],this['fields'](_0x1df514[_0xba89('0x2b')]['fields']));_0x17cd26[_0xba89('0x2f')]=_0x17cd26[_0xba89('0x2f')][_0xba89('0x1d')]?_0x17cd26['attributes']:_0x8ab13c[_0xba89('0x2e')];if(!_0x1df514[_0xba89('0x2b')]['hasOwnProperty'](_0xba89('0x30'))){_0x17cd26[_0xba89('0x31')]=this[_0xba89('0x31')](_0x1df514[_0xba89('0x2b')][_0xba89('0x31')]);_0x17cd26[_0xba89('0x14')]=this['offset'](_0x1df514[_0xba89('0x2b')][_0xba89('0x14')]);}_0x17cd26[_0xba89('0x32')]=this['sort'](_0x1df514['query']['sort']);_0x17cd26['where']=this[_0xba89('0x33')](_[_0xba89('0x34')](_0x1df514[_0xba89('0x2b')],_0x8ab13c[_0xba89('0x33')]),_0x2817e3);if(_0x1df514['query'][_0xba89('0x35')]){_0x17cd26[_0xba89('0x36')]=_[_0xba89('0x37')](_0x17cd26[_0xba89('0x36')],{'$or':_[_0xba89('0x16')](_0x2817e3,function(_0x2d47b3){if(_0x2d47b3[_0xba89('0xa')]!=='VIRTUAL'){if(_0x59142e){return sequelize[_0xba89('0x36')](sequelize['fn'](_0xba89('0x38'),sequelize['col'](_0x2d47b3[_0xba89('0x12')])),{'$like':sequelize['fn'](_0xba89('0x38'),'%'+_0x1df514[_0xba89('0x2b')][_0xba89('0x35')]+'%')});}else{var _0x3ac54c={};_0x3ac54c[_0x2d47b3['name']]={'$like':'%'+_0x1df514[_0xba89('0x2b')][_0xba89('0x35')]+'%'};return _0x3ac54c;}}})});}_0x17cd26=_[_0xba89('0x37')]({},_0x17cd26,_0x1df514[_0xba89('0x39')]);return _0x17cd26;};
\ No newline at end of file
index cf460a6..9c649dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4143=['view\x20engine','html','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','get','env','production','set','root','public','development','test','appPath','join','use','json\x20replacer','toISOString','split','views','/server/views','engine','ejs','renderFile'];(function(_0x2b4bae,_0xf2ad5d){var _0x4b73c9=function(_0x294f34){while(--_0x294f34){_0x2b4bae['push'](_0x2b4bae['shift']());}};_0x4b73c9(++_0xf2ad5d);}(_0x4143,0xd2));var _0x3414=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x4143[_0x18a79d];return _0x4f8848;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3414('0x0'));var methodOverride=require(_0x3414('0x1'));var cookieParser=require(_0x3414('0x2'));var errorHandler=require(_0x3414('0x3'));var path=require(_0x3414('0x4'));var passport=require(_0x3414('0x5'));var cors=require(_0x3414('0x6'));var moment=require(_0x3414('0x7'));var config=require('./environment');var db=require(_0x3414('0x8'))['db'];exports['default']=function(_0x24ffa8){var _0x110dd8=_0x24ffa8[_0x3414('0x9')](_0x3414('0xa'));if(_0x110dd8===_0x3414('0xb')){_0x24ffa8[_0x3414('0xc')]('appPath',path['join'](config[_0x3414('0xd')],_0x3414('0xe')));}if(_0x110dd8===_0x3414('0xf')||_0x110dd8===_0x3414('0x10')){_0x24ffa8[_0x3414('0xc')](_0x3414('0x11'),path[_0x3414('0x12')](config['root'],'client'));_0x24ffa8[_0x3414('0x13')](errorHandler());}_0x24ffa8['set'](_0x3414('0x14'),function(_0x1d01ff,_0x11e2cd){if(this[_0x1d01ff]instanceof Date){_0x11e2cd=this[_0x1d01ff][_0x3414('0x15')]()[_0x3414('0x16')]('.')[0x0]+'Z';}return _0x11e2cd;});_0x24ffa8[_0x3414('0x13')](express['static'](_0x24ffa8['get']('appPath')));_0x24ffa8[_0x3414('0xc')](_0x3414('0x17'),config[_0x3414('0xd')]+_0x3414('0x18'));_0x24ffa8[_0x3414('0x19')]('html',require(_0x3414('0x1a'))[_0x3414('0x1b')]);_0x24ffa8[_0x3414('0xc')](_0x3414('0x1c'),_0x3414('0x1d'));_0x24ffa8[_0x3414('0x13')](bodyParser[_0x3414('0x1e')]({'limit':_0x3414('0x1f'),'extended':!![]}));_0x24ffa8[_0x3414('0x13')](bodyParser[_0x3414('0x20')]({'limit':'50mb'}));_0x24ffa8[_0x3414('0x13')](cors());_0x24ffa8[_0x3414('0x13')](methodOverride());_0x24ffa8['use'](cookieParser());_0x24ffa8['use'](passport[_0x3414('0x21')]());};
\ No newline at end of file
+var _0x384b=['views','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','body-parser','method-override','cookie-parser','path','moment','../mysqldb','default','get','env','production','join','root','public','development','set','appPath','json\x20replacer','toISOString','split','use','static'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x384b,0x1ea));var _0xb384=function(_0x3d49ae,_0x1ffedc){_0x3d49ae=_0x3d49ae-0x0;var _0x4f281b=_0x384b[_0x3d49ae];return _0x4f281b;};'use strict';var express=require(_0xb384('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xb384('0x1'));var methodOverride=require(_0xb384('0x2'));var cookieParser=require(_0xb384('0x3'));var errorHandler=require('errorhandler');var path=require(_0xb384('0x4'));var passport=require('passport');var cors=require('cors');var moment=require(_0xb384('0x5'));var config=require('./environment');var db=require(_0xb384('0x6'))['db'];exports[_0xb384('0x7')]=function(_0x48cf84){var _0x1253c6=_0x48cf84[_0xb384('0x8')](_0xb384('0x9'));if(_0x1253c6===_0xb384('0xa')){_0x48cf84['set']('appPath',path[_0xb384('0xb')](config[_0xb384('0xc')],_0xb384('0xd')));}if(_0x1253c6===_0xb384('0xe')||_0x1253c6==='test'){_0x48cf84[_0xb384('0xf')](_0xb384('0x10'),path[_0xb384('0xb')](config[_0xb384('0xc')],'client'));_0x48cf84['use'](errorHandler());}_0x48cf84['set'](_0xb384('0x11'),function(_0x216b5a,_0x4d08f0){if(this[_0x216b5a]instanceof Date){_0x4d08f0=this[_0x216b5a][_0xb384('0x12')]()[_0xb384('0x13')]('.')[0x0]+'Z';}return _0x4d08f0;});_0x48cf84[_0xb384('0x14')](express[_0xb384('0x15')](_0x48cf84[_0xb384('0x8')](_0xb384('0x10'))));_0x48cf84[_0xb384('0xf')](_0xb384('0x16'),config[_0xb384('0xc')]+_0xb384('0x17'));_0x48cf84['engine'](_0xb384('0x18'),require(_0xb384('0x19'))[_0xb384('0x1a')]);_0x48cf84[_0xb384('0xf')](_0xb384('0x1b'),'html');_0x48cf84[_0xb384('0x14')](bodyParser[_0xb384('0x1c')]({'limit':_0xb384('0x1d'),'extended':!![]}));_0x48cf84[_0xb384('0x14')](bodyParser[_0xb384('0x1e')]({'limit':_0xb384('0x1d')}));_0x48cf84['use'](cors());_0x48cf84[_0xb384('0x14')](methodOverride());_0x48cf84[_0xb384('0x14')](cookieParser());_0x48cf84['use'](passport[_0xb384('0x1f')]());};
\ No newline at end of file
index 189cc36..e30299f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1039=['macAddress','ipAddress','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','keys','filter','family','internal','concat','mac','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x36d11c,_0x6dffa7){var _0xd95b50=function(_0x5ed180){while(--_0x5ed180){_0x36d11c['push'](_0x36d11c['shift']());}};_0xd95b50(++_0x6dffa7);}(_0x1039,0x19c));var _0x9103=function(_0x32f550,_0x5c6ba5){_0x32f550=_0x32f550-0x0;var _0x4c1213=_0x1039[_0x32f550];return _0x4c1213;};'use strict';var _=require(_0x9103('0x0'));var os=require('os');var crypto=require(_0x9103('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x9103('0x2'))[_0x9103('0x3')];var config=require(_0x9103('0x4'));function getInterfaces(){var _0x22593a=[];var _0x23105a=os[_0x9103('0x5')]();var _0x4ad97a=_['orderBy'](_[_0x9103('0x6')](_0x23105a));for(var _0xf89b4a=0x0;_0xf89b4a<_0x4ad97a['length'];_0xf89b4a++){var _0x4cbe10=_0x23105a[_0x4ad97a[_0xf89b4a]][_0x9103('0x7')](function(_0x1b7440){return _0x1b7440[_0x9103('0x8')]==='IPv4'&&_0x1b7440[_0x9103('0x9')]===![];});_0x22593a=_0x22593a[_0x9103('0xa')](_0x4cbe10);}return _0x22593a;}function getFirstInterface(){var _0x50a6f1=_['head'](getInterfaces());return{'macAddress':_0x50a6f1&&_0x50a6f1[_0x9103('0xb')]?_0x50a6f1[_0x9103('0xb')]:'00:00:00:00:00:00','ipAddress':_0x50a6f1&&_0x50a6f1['address']?_0x50a6f1[_0x9103('0xc')]:_0x9103('0xd')};}exports[_0x9103('0xe')]=getFirstInterface;function getCPUhash(){var _0x1ea462=_[_0x9103('0xf')](os[_0x9103('0x10')]()[_0x9103('0x11')](function(_0x297d2d){return _0x297d2d[_0x9103('0x12')];}))[_0x9103('0x13')](':');return crypto[_0x9103('0x14')](_0x9103('0x15'))[_0x9103('0x16')](_0x1ea462)['digest']('hex');}exports[_0x9103('0x17')]=function(){var _0x3830d1=os[_0x9103('0x18')]();var _0x287c6b=/[0-9a-f-]{36}/;if(config[_0x9103('0x19')]&&_0x287c6b['test'](config['licenseToken'])){return config[_0x9103('0x19')];}else if(_0x3830d1===_0x9103('0x1a')){return exec(_0x9103('0x1b'),{'encoding':_0x9103('0x1c')})[_0x9103('0x1d')]('\x0d\x0a','');}else{var _0x46871f=getFirstInterface();var _0x1b19d6=getCPUhash();var _0x5a9d17=_0x1b19d6+'|'+os['hostname']()+'|'+_0x46871f[_0x9103('0x1e')]+'|'+_0x46871f[_0x9103('0x1f')];var _0x38c383=crypto[_0x9103('0x14')](_0x9103('0x15'))[_0x9103('0x16')](_0x5a9d17)['digest'](_0x9103('0x20'));return _0x38c383[_0x9103('0x21')](0x0,0x8)+'-'+_0x38c383['substring'](0x8,0xc)+'-'+_0x38c383[_0x9103('0x21')](0xc,0x10)+'-'+_0x38c383[_0x9103('0x21')](0x10,0x14)+'-'+_0x38c383[_0x9103('0x21')](0x14);}};
\ No newline at end of file
+var _0xde50=['substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','keys','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','md5','update','digest','hex','getUuid','platform','licenseToken','replace','hostname','macAddress','ipAddress','createHash'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xde50,0xbb));var _0x0de5=function(_0x267d24,_0x1b9420){_0x267d24=_0x267d24-0x0;var _0x2ac13b=_0xde50[_0x267d24];return _0x2ac13b;};'use strict';var _=require(_0x0de5('0x0'));var os=require('os');var crypto=require(_0x0de5('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x0de5('0x2'))['execSync'];var config=require(_0x0de5('0x3'));function getInterfaces(){var _0x271341=[];var _0x344770=os[_0x0de5('0x4')]();var _0x24862d=_[_0x0de5('0x5')](_[_0x0de5('0x6')](_0x344770));for(var _0x507088=0x0;_0x507088<_0x24862d['length'];_0x507088++){var _0x2d8c69=_0x344770[_0x24862d[_0x507088]]['filter'](function(_0x39b975){return _0x39b975[_0x0de5('0x7')]===_0x0de5('0x8')&&_0x39b975['internal']===![];});_0x271341=_0x271341[_0x0de5('0x9')](_0x2d8c69);}return _0x271341;}function getFirstInterface(){var _0x3222db=_[_0x0de5('0xa')](getInterfaces());return{'macAddress':_0x3222db&&_0x3222db[_0x0de5('0xb')]?_0x3222db[_0x0de5('0xb')]:_0x0de5('0xc'),'ipAddress':_0x3222db&&_0x3222db['address']?_0x3222db[_0x0de5('0xd')]:_0x0de5('0xe')};}exports[_0x0de5('0xf')]=getFirstInterface;function getCPUhash(){var _0x5dcf3e=_[_0x0de5('0x5')](os['cpus']()[_0x0de5('0x10')](function(_0x51c371){return _0x51c371['model'];}))[_0x0de5('0x11')](':');return crypto['createHash'](_0x0de5('0x12'))[_0x0de5('0x13')](_0x5dcf3e)[_0x0de5('0x14')](_0x0de5('0x15'));}exports[_0x0de5('0x16')]=function(){var _0x36cfba=os[_0x0de5('0x17')]();var _0x4ee69c=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4ee69c['test'](config[_0x0de5('0x18')])){return config['licenseToken'];}else if(_0x36cfba==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x0de5('0x19')]('\x0d\x0a','');}else{var _0x29990f=getFirstInterface();var _0x4297ec=getCPUhash();var _0x4698d8=_0x4297ec+'|'+os[_0x0de5('0x1a')]()+'|'+_0x29990f[_0x0de5('0x1b')]+'|'+_0x29990f[_0x0de5('0x1c')];var _0x53771b=crypto[_0x0de5('0x1d')](_0x0de5('0x12'))[_0x0de5('0x13')](_0x4698d8)[_0x0de5('0x14')](_0x0de5('0x15'));return _0x53771b[_0x0de5('0x1e')](0x0,0x8)+'-'+_0x53771b[_0x0de5('0x1e')](0x8,0xc)+'-'+_0x53771b[_0x0de5('0x1e')](0xc,0x10)+'-'+_0x53771b[_0x0de5('0x1e')](0x10,0x14)+'-'+_0x53771b[_0x0de5('0x1e')](0x14);}};
\ No newline at end of file
index 2669ab8..bb6921a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d29=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format','YYYY-MM-DD\x20HH:mm','diff','days','error','message','finally','License','findOrCreate','spread','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x495d8c,_0x15994f){var _0x2a7130=function(_0xc68a8d){while(--_0xc68a8d){_0x495d8c['push'](_0x495d8c['shift']());}};_0x2a7130(++_0x15994f);}(_0x5d29,0x16e));var _0x95d2=function(_0x18e5df,_0x3946f5){_0x18e5df=_0x18e5df-0x0;var _0x2779cd=_0x5d29[_0x18e5df];return _0x2779cd;};'use strict';var util=require(_0x95d2('0x0'));var moment=require(_0x95d2('0x1'));var rp=require(_0x95d2('0x2'));var BPromise=require(_0x95d2('0x3'));var pkginfo=require(_0x95d2('0x4'))(module,_0x95d2('0x5'));var db=require(_0x95d2('0x6'))['db'];var encryptor=require(_0x95d2('0x7'));var hardware=require(_0x95d2('0x8'));var logger=require(_0x95d2('0x9'))(_0x95d2('0xa'));var HOST=_0x95d2('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3457e2){return new BPromise(function(_0x5748a0,_0x251302){var _0x4686cf=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x3457e2,module[_0x95d2('0xc')]['version']);if(oldToken){_0x4686cf=util['format'](_0x95d2('0xd'),HOST,_0x3457e2,module[_0x95d2('0xc')]['version'],oldToken);}var _0x5225f5={'uri':_0x4686cf,'method':_0x95d2('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x5225f5)[_0x95d2('0xf')](function(_0x3d976f){_0x5748a0(_0x3d976f);})[_0x95d2('0x10')](function(_0xd22d4d){_0x251302(_0xd22d4d);});});}function manageLicense(_0x282462,_0x40e49e){var _0x9f516=_0x40e49e['get']({'plain':!![]});if(!isOldTokenSent&&_0x9f516[_0x95d2('0x11')]!==_0x282462&&!_0x9f516[_0x95d2('0x12')]){oldToken=_0x9f516[_0x95d2('0x11')];}httpRequest(_0x282462)[_0x95d2('0xf')](function(_0x2f6f8e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2f6f8e[_0x95d2('0x13')]){isOldTokenSent=![];if(!_0x9f516[_0x95d2('0xa')]&&_0x9f516['license']!=_0x2f6f8e[_0x95d2('0xa')]||_0x9f516[_0x95d2('0xa')]&&_0x9f516[_0x95d2('0x12')]){logger[_0x95d2('0x14')](_0x95d2('0x15'));}if(_0x9f516[_0x95d2('0xa')]&&!_0x9f516['data2']&&_0x9f516[_0x95d2('0xa')]!=_0x2f6f8e['license']){logger['info'](_0x95d2('0x16'));}if(_0x9f516[_0x95d2('0xa')]&&!_0x9f516[_0x95d2('0x12')]&&_0x9f516[_0x95d2('0xa')]==_0x2f6f8e[_0x95d2('0xa')]){return _0x40e49e;}return _0x40e49e[_0x95d2('0x17')]({'data1':_0x282462,'data2':null,'license':_0x2f6f8e['license']});}else{if(_0x2f6f8e[_0x95d2('0xa')]||_0x9f516[_0x95d2('0xa')]){if(!_0x9f516[_0x95d2('0x12')]){if(_0x9f516[_0x95d2('0x11')]==_0x282462){GRAY_PERIOD_REASON='Disabled';logger[_0x95d2('0x14')](_0x95d2('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x95d2('0x19'),_0x9f516[_0x95d2('0x11')],_0x282462);}logger[_0x95d2('0x14')](_0x95d2('0x1a'),GRAY_PERIOD_REASON[_0x95d2('0x1b')](),moment()[_0x95d2('0x1c')](_0x95d2('0x1d')));return _0x40e49e['update']({'data2':encryptor['encryptString'](moment()[_0x95d2('0x1c')](_0x95d2('0x1d')))});}else{if(moment()[_0x95d2('0x1e')](encryptor['decryptString'](_0x9f516['data2']),_0x95d2('0x1f'))>DAYS){logger[_0x95d2('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x95d2('0x1c')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x40e49e[_0x95d2('0x17')]({'data1':_0x282462,'data2':null,'license':null});}}}else{if(_0x9f516[_0x95d2('0x11')]!=_0x282462){logger[_0x95d2('0x14')](_0x95d2('0x19'),_0x9f516['data1'],_0x282462);return _0x40e49e['update']({'data1':_0x282462,'data2':null,'license':null});}}}return _0x40e49e;})[_0x95d2('0xf')](function(_0x3f356a){_0x40e49e=_0x3f356a;})[_0x95d2('0x10')](function(_0x214c4c){logger[_0x95d2('0x20')](_0x214c4c[_0x95d2('0x21')]);})[_0x95d2('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x40e49e);},TIME);});}function defaultLicense(){var _0x5e0909=hardware['getUuid']();if(_0x5e0909){return db[_0x95d2('0x23')][_0x95d2('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5e0909}})[_0x95d2('0x25')](function(_0x418d4f,_0x2da0ab){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x5e0909);manageLicense(_0x5e0909,_0x418d4f);})[_0x95d2('0x10')](function(_0x595480){logger[_0x95d2('0x20')](_0x595480[_0x95d2('0x21')]);});}}exports[_0x95d2('0x26')]=defaultLicense;
\ No newline at end of file
+var _0x8eb4=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','pkginfo','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','license','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid'];(function(_0x52df1c,_0x1add2f){var _0x56ae60=function(_0x11c74c){while(--_0x11c74c){_0x52df1c['push'](_0x52df1c['shift']());}};_0x56ae60(++_0x1add2f);}(_0x8eb4,0x106));var _0x48eb=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x8eb4[_0x2aefb6];return _0x202772;};'use strict';var util=require(_0x48eb('0x0'));var moment=require(_0x48eb('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x48eb('0x2'))(module,_0x48eb('0x3'));var db=require(_0x48eb('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x48eb('0x5'));var logger=require(_0x48eb('0x6'))('license');var HOST=_0x48eb('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x9a5889){return new BPromise(function(_0xc98dba,_0xa96ad4){var _0x3d3e37=util[_0x48eb('0x8')](_0x48eb('0x9'),HOST,_0x9a5889,module['exports'][_0x48eb('0x3')]);if(oldToken){_0x3d3e37=util['format'](_0x48eb('0xa'),HOST,_0x9a5889,module['exports'][_0x48eb('0x3')],oldToken);}var _0x389001={'uri':_0x3d3e37,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x389001)[_0x48eb('0xb')](function(_0x1cff0a){_0xc98dba(_0x1cff0a);})[_0x48eb('0xc')](function(_0x518a7f){_0xa96ad4(_0x518a7f);});});}function manageLicense(_0x147e56,_0x15a393){var _0x256645=_0x15a393[_0x48eb('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x256645[_0x48eb('0xe')]!==_0x147e56&&!_0x256645[_0x48eb('0xf')]){oldToken=_0x256645[_0x48eb('0xe')];}httpRequest(_0x147e56)[_0x48eb('0xb')](function(_0x5b629){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5b629[_0x48eb('0x10')]){isOldTokenSent=![];if(!_0x256645[_0x48eb('0x11')]&&_0x256645[_0x48eb('0x11')]!=_0x5b629[_0x48eb('0x11')]||_0x256645[_0x48eb('0x11')]&&_0x256645[_0x48eb('0xf')]){logger[_0x48eb('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x256645[_0x48eb('0x11')]&&!_0x256645[_0x48eb('0xf')]&&_0x256645[_0x48eb('0x11')]!=_0x5b629['license']){logger[_0x48eb('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x256645[_0x48eb('0x11')]&&!_0x256645['data2']&&_0x256645[_0x48eb('0x11')]==_0x5b629[_0x48eb('0x11')]){return _0x15a393;}return _0x15a393[_0x48eb('0x13')]({'data1':_0x147e56,'data2':null,'license':_0x5b629[_0x48eb('0x11')]});}else{if(_0x5b629[_0x48eb('0x11')]||_0x256645[_0x48eb('0x11')]){if(!_0x256645[_0x48eb('0xf')]){if(_0x256645[_0x48eb('0xe')]==_0x147e56){GRAY_PERIOD_REASON=_0x48eb('0x14');logger[_0x48eb('0x12')](_0x48eb('0x15'));}else{GRAY_PERIOD_REASON=_0x48eb('0x16');logger[_0x48eb('0x12')](_0x48eb('0x17'),_0x256645['data1'],_0x147e56);}logger[_0x48eb('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x48eb('0x18')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x15a393[_0x48eb('0x13')]({'data2':encryptor['encryptString'](moment()[_0x48eb('0x8')](_0x48eb('0x19')))});}else{if(moment()[_0x48eb('0x1a')](encryptor[_0x48eb('0x1b')](_0x256645[_0x48eb('0xf')]),_0x48eb('0x1c'))>DAYS){logger[_0x48eb('0x12')](_0x48eb('0x1d'),moment()[_0x48eb('0x8')](_0x48eb('0x19')));isOldTokenSent=![];return _0x15a393[_0x48eb('0x13')]({'data1':_0x147e56,'data2':null,'license':null});}}}else{if(_0x256645[_0x48eb('0xe')]!=_0x147e56){logger[_0x48eb('0x12')](_0x48eb('0x17'),_0x256645[_0x48eb('0xe')],_0x147e56);return _0x15a393[_0x48eb('0x13')]({'data1':_0x147e56,'data2':null,'license':null});}}}return _0x15a393;})[_0x48eb('0xb')](function(_0x573aee){_0x15a393=_0x573aee;})[_0x48eb('0xc')](function(_0x22c2ed){logger[_0x48eb('0x1e')](_0x22c2ed[_0x48eb('0x1f')]);})[_0x48eb('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x48eb('0x21')](),_0x15a393);},TIME);});}function defaultLicense(){var _0x5b3b6e=hardware[_0x48eb('0x21')]();if(_0x5b3b6e){return db['License'][_0x48eb('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x5b3b6e}})['spread'](function(_0x12a3ff,_0x55b2ac){logger[_0x48eb('0x12')](_0x48eb('0x23'),_0x5b3b6e);manageLicense(_0x5b3b6e,_0x12a3ff);})[_0x48eb('0xc')](function(_0x4136f9){logger[_0x48eb('0x1e')](_0x4136f9[_0x48eb('0x1f')]);});}}exports[_0x48eb('0x24')]=defaultLicense;
\ No newline at end of file
index 3c6647b..aed4b38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x382b=['license','License\x20key\x20value\x20not\x20found','data1','data2','split','format','%s:%s:%s','machineUuid','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','lodash','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','catch','uuid'];(function(_0xe9009d,_0x589ebf){var _0x760ddb=function(_0x2662ae){while(--_0x2662ae){_0xe9009d['push'](_0xe9009d['shift']());}};_0x760ddb(++_0x589ebf);}(_0x382b,0x1ab));var _0xb382=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x382b[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0xb382('0x0'));var moment=require('moment');var BPromise=require(_0xb382('0x1'));var hardware=require(_0xb382('0x2'));var encryptor=require(_0xb382('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb382('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb382('0x5'),'machineUuid':hardware[_0xb382('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb382('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb382('0x7'),'machineUuid':hardware[_0xb382('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x38bfa2){return new BPromise(function(_0x4784c8,_0x5f0223){return db[_0xb382('0x8')][_0xb382('0x9')](_['defaults'](_0x38bfa2,{'raw':!![],'where':{'id':0x1}}))[_0xb382('0xa')](function(_0x31ad31){return checkLicense(_0x31ad31,null);})[_0xb382('0xa')](function(_0x43db7f){_0x4784c8(_0x43db7f);return;})[_0xb382('0xb')](function(_0x62297f){_0x5f0223(_0x62297f);});});}function checkLicense(_0x22845f,_0x767096){if(!_0x22845f){demoLicense[_0xb382('0xc')]=_0x22845f['data1'];return demoLicense;}try{var _0x9a03d3=_0x767096||_0x22845f[_0xb382('0xd')];if(_['isEmpty'](_0x9a03d3)){throw new Error(_0xb382('0xe'));}var _0x2eac63=_0x22845f[_0xb382('0xf')];var _0x163898=_0x22845f[_0xb382('0x10')];var _0x5022f7=_0x2eac63[_0xb382('0x11')]('-')[0x4];var _0x48e14d=_0x2eac63[_0xb382('0x11')]('-')[0x0];var _0x1be04a=encryptor['decryptString'](_0x9a03d3,util[_0xb382('0x12')](_0xb382('0x13'),_0x5022f7,_0x2eac63,_0x48e14d));var _0x2df4b0=JSON['parse'](_0x1be04a);_0x2df4b0['demo']=![];_0x2df4b0[_0xb382('0xc')]=_0x2eac63;_0x2df4b0[_0xb382('0x14')]=hardware[_0xb382('0x6')]();if(_0x163898){var _0x41997c=encryptor['decryptString'](_0x163898);_0x2df4b0[_0xb382('0x15')]=_0x41997c;_0x2df4b0[_0xb382('0x16')]=moment(_0x41997c)[_0xb382('0x17')](0x7,'days')[_0xb382('0x12')]();_0x2df4b0[_0xb382('0x18')]=_0x2df4b0[_0xb382('0xc')]!=_0x2df4b0[_0xb382('0x14')]?_0xb382('0x19'):_0xb382('0x1a');}return _0x2df4b0;}catch(_0x20dc8e){breakingLicense[_0xb382('0xc')]=_0x22845f[_0xb382('0xf')];breakingLicense[_0xb382('0x1b')]=_0x20dc8e[_0xb382('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x32fb5b,_0x3b216e){getLicense()[_0xb382('0xa')](function(_0x429743){return db[_0xb382('0x1c')][_0xb382('0x1d')]({'attributes':[_0xb382('0x1e'),[db[_0xb382('0x1f')]['fn'](_0xb382('0x20'),db[_0xb382('0x1f')][_0xb382('0x21')](_0xb382('0x1e'))),_0xb382('0x22')]],'group':_0xb382('0x1e'),'where':{'role':{'$or':[_0xb382('0x23'),_0xb382('0x24'),_0xb382('0x25')]}},'raw':!![]})['then'](function(_0x271934){var _0x4ef24a={'user':_0x429743['users']||0x0,'telephone':_0x429743[_0xb382('0x26')]||0x0};_0x271934[_0xb382('0x27')](function(_0x16b8da){var _0x4e5749=_0x16b8da['role']===_0xb382('0x23')?_0xb382('0x24'):_0x16b8da[_0xb382('0x1e')];_0x4ef24a[_0x4e5749]-=_0x16b8da[_0xb382('0x22')];if(_0x4ef24a[_0x4e5749]<0x0)_0x4ef24a[_0x4e5749]=0x0;});_0x32fb5b(_0x4ef24a);return;});})[_0xb382('0xb')](function(_0x442fed){_0x3b216e(_0x442fed);});});}function checkUserLimits(_0xc138df){return new BPromise(function(_0x4edd92,_0x1cbdc2){getLimits()[_0xb382('0xa')](function(_0x262ee6){var _0x3dd901=_[_0xb382('0x28')](_[_0xb382('0x29')](_0xc138df,'role'),[_0xb382('0x23'),_0xb382('0x24'),'telephone']);var _0x58f4a5=(_0x3dd901[_0xb382('0x23')]||0x0)+(_0x3dd901['user']||0x0);var _0x51f5ce=_0x3dd901[_0xb382('0x25')]||0x0;if(_0x58f4a5>_0x262ee6[_0xb382('0x24')])return _0x1cbdc2(_0xb382('0x2a'));if(_0x51f5ce>_0x262ee6[_0xb382('0x25')])return _0x1cbdc2(_0xb382('0x2b'));return _0x4edd92();})[_0xb382('0xb')](function(_0x2c603b){_0x1cbdc2(_0x2c603b);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x5684=['changed','disabled','message','findAll','role','COUNT','count','admin','users','telephones','forEach','pick','user','telephone','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','machineUuid','deadline','add','days','format','grayReason'];(function(_0x430e20,_0x808752){var _0xa7a36e=function(_0x3ce9b0){while(--_0x3ce9b0){_0x430e20['push'](_0x430e20['shift']());}};_0xa7a36e(++_0x808752);}(_0x5684,0xbf));var _0x4568=function(_0x2513a1,_0x1ffb95){_0x2513a1=_0x2513a1-0x0;var _0x36e5e7=_0x5684[_0x2513a1];return _0x36e5e7;};'use strict';var util=require('util');var _=require(_0x4568('0x0'));var moment=require(_0x4568('0x1'));var BPromise=require(_0x4568('0x2'));var hardware=require(_0x4568('0x3'));var encryptor=require(_0x4568('0x4'));var db=require(_0x4568('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4568('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4568('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4568('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x4568('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x12b52e){return new BPromise(function(_0x14c941,_0x2e028e){return db['License'][_0x4568('0x9')](_[_0x4568('0xa')](_0x12b52e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x35a6bd){return checkLicense(_0x35a6bd,null);})[_0x4568('0xb')](function(_0x4f12d8){_0x14c941(_0x4f12d8);return;})[_0x4568('0xc')](function(_0x445393){_0x2e028e(_0x445393);});});}function checkLicense(_0x1ed5e5,_0xe865cd){if(!_0x1ed5e5){demoLicense[_0x4568('0xd')]=_0x1ed5e5[_0x4568('0xe')];return demoLicense;}try{var _0x5f9a93=_0xe865cd||_0x1ed5e5[_0x4568('0xf')];if(_[_0x4568('0x10')](_0x5f9a93)){throw new Error(_0x4568('0x11'));}var _0x240a31=_0x1ed5e5[_0x4568('0xe')];var _0x5a914e=_0x1ed5e5[_0x4568('0x12')];var _0x3fdf9b=_0x240a31[_0x4568('0x13')]('-')[0x4];var _0x39335f=_0x240a31['split']('-')[0x0];var _0x574443=encryptor[_0x4568('0x14')](_0x5f9a93,util['format'](_0x4568('0x15'),_0x3fdf9b,_0x240a31,_0x39335f));var _0x2e8f08=JSON[_0x4568('0x16')](_0x574443);_0x2e8f08['demo']=![];_0x2e8f08[_0x4568('0xd')]=_0x240a31;_0x2e8f08[_0x4568('0x17')]=hardware[_0x4568('0x8')]();if(_0x5a914e){var _0x4024af=encryptor[_0x4568('0x14')](_0x5a914e);_0x2e8f08['gray']=_0x4024af;_0x2e8f08[_0x4568('0x18')]=moment(_0x4024af)[_0x4568('0x19')](0x7,_0x4568('0x1a'))[_0x4568('0x1b')]();_0x2e8f08[_0x4568('0x1c')]=_0x2e8f08[_0x4568('0xd')]!=_0x2e8f08[_0x4568('0x17')]?_0x4568('0x1d'):_0x4568('0x1e');}return _0x2e8f08;}catch(_0x2f8778){breakingLicense[_0x4568('0xd')]=_0x1ed5e5[_0x4568('0xe')];breakingLicense[_0x4568('0x1f')]=_0x2f8778[_0x4568('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2b40e1,_0x16d4e7){getLicense()[_0x4568('0xb')](function(_0x193a00){return db['User'][_0x4568('0x20')]({'attributes':[_0x4568('0x21'),[db['sequelize']['fn'](_0x4568('0x22'),db['sequelize']['col']('role')),_0x4568('0x23')]],'group':_0x4568('0x21'),'where':{'role':{'$or':[_0x4568('0x24'),'user','telephone']}},'raw':!![]})[_0x4568('0xb')](function(_0x3b9603){var _0x14d008={'user':_0x193a00[_0x4568('0x25')]||0x0,'telephone':_0x193a00[_0x4568('0x26')]||0x0};_0x3b9603[_0x4568('0x27')](function(_0x430fbf){var _0x44de72=_0x430fbf[_0x4568('0x21')]===_0x4568('0x24')?'user':_0x430fbf[_0x4568('0x21')];_0x14d008[_0x44de72]-=_0x430fbf[_0x4568('0x23')];if(_0x14d008[_0x44de72]<0x0)_0x14d008[_0x44de72]=0x0;});_0x2b40e1(_0x14d008);return;});})[_0x4568('0xc')](function(_0x8d8c27){_0x16d4e7(_0x8d8c27);});});}function checkUserLimits(_0x52ad1a){return new BPromise(function(_0x22d3b0,_0x5dccdc){getLimits()[_0x4568('0xb')](function(_0x1e9b4e){var _0x4b0f5b=_[_0x4568('0x28')](_['countBy'](_0x52ad1a,_0x4568('0x21')),['admin',_0x4568('0x29'),_0x4568('0x2a')]);var _0x589c1b=(_0x4b0f5b[_0x4568('0x24')]||0x0)+(_0x4b0f5b['user']||0x0);var _0x3b32c5=_0x4b0f5b[_0x4568('0x2a')]||0x0;if(_0x589c1b>_0x1e9b4e[_0x4568('0x29')])return _0x5dccdc('License\x20limit\x20reached\x20for\x20users');if(_0x3b32c5>_0x1e9b4e['telephone'])return _0x5dccdc('License\x20limit\x20reached\x20for\x20telephones');return _0x22d3b0();})[_0x4568('0xc')](function(_0x56341c){_0x5dccdc(_0x56341c);});});}module[_0x4568('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 876579b..a386e5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x2b0b4c,_0x484bfd){var _0x1b0c83=function(_0x3cc3ac){while(--_0x3cc3ac){_0x2b0b4c['push'](_0x2b0b4c['shift']());}};_0x1b0c83(++_0x484bfd);}(_0xea28,0x13a));var _0x8ea2=function(_0x2a5523,_0x285356){_0x2a5523=_0x2a5523-0x0;var _0x328289=_0xea28[_0x2a5523];return _0x328289;};'use strict';module[_0x8ea2('0x0')]={'DOMAIN':_0x8ea2('0x1'),'SESSION_SECRET':_0x8ea2('0x2'),'GOOGLE_ID':_0x8ea2('0x3'),'GOOGLE_SECRET':_0x8ea2('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x160f=['http://localhost:9000','myappanuglar-secret','app-id','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';module[_0xf160('0x0')]={'DOMAIN':_0xf160('0x1'),'SESSION_SECRET':_0xf160('0x2'),'GOOGLE_ID':_0xf160('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 34db1f7..06496a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de7=['error','transports','info','env','debugLevel','moment','winston','util','path','INFO','/var','log','xcally','%s-%s.log','message','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','exports','Logger','File','%s-%s'];(function(_0x168cd5,_0xd16851){var _0x4aacab=function(_0x3f293a){while(--_0x3f293a){_0x168cd5['push'](_0x168cd5['shift']());}};_0x4aacab(++_0xd16851);}(_0x1de7,0x147));var _0x71de=function(_0x33a775,_0x280435){_0x33a775=_0x33a775-0x0;var _0x219b82=_0x1de7[_0x33a775];return _0x219b82;};'use strict';var moment=require(_0x71de('0x0'));var winston=require(_0x71de('0x1'));var util=require(_0x71de('0x2'));var path=require(_0x71de('0x3'));var debugLevel=_0x71de('0x4');function filename(_0x4fa5f3,_0x4a2f69){return path['join'](_0x71de('0x5'),_0x71de('0x6'),_0x71de('0x7'),util['format'](_0x71de('0x8'),_0x4fa5f3,_0x4a2f69));}function formatter(_0x4225c2,_0x4dd8f0){_0x4dd8f0[_0x71de('0x9')]=_0x4dd8f0['message'][_0x71de('0xa')](/@@{/g,_0x71de('0xb'))[_0x71de('0xa')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x71de('0xc')](_0x71de('0xd'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x4dd8f0['level']['toUpperCase'](),_0x4225c2,_0x4dd8f0[_0x71de('0x9')]);}module[_0x71de('0xe')]=function(_0x44d055){return new winston[(_0x71de('0xf'))]({'transports':[new winston['transports'][(_0x71de('0x10'))]({'name':util['format'](_0x71de('0x11'),_0x44d055,_0x71de('0x12')),'filename':filename(_0x44d055,'error'),'level':_0x71de('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x219076){return formatter(_0x44d055,_0x219076);}}),new winston[(_0x71de('0x13'))][(_0x71de('0x10'))]({'name':util[_0x71de('0xc')](_0x71de('0x11'),_0x44d055,_0x71de('0x14')),'filename':filename(_0x44d055,_0x71de('0x14')),'level':_0x71de('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3372ab){return formatter(_0x44d055,_0x3372ab);}}),new winston[(_0x71de('0x13'))]['Console']({'level':process[_0x71de('0x15')][_0x71de('0x16')]||debugLevel,'json':![],'formatter':function(_0x4321cc){return formatter(_0x44d055,_0x4321cc);}})]});};
\ No newline at end of file
+var _0x2205=['winston','util','path','INFO','/var','log','xcally','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2205,0xbf));var _0x5220=function(_0x598264,_0x23083f){_0x598264=_0x598264-0x0;var _0x28790c=_0x2205[_0x598264];return _0x28790c;};'use strict';var moment=require(_0x5220('0x0'));var winston=require(_0x5220('0x1'));var util=require(_0x5220('0x2'));var path=require(_0x5220('0x3'));var debugLevel=_0x5220('0x4');function filename(_0x538d80,_0x3b7f33){return path['join'](_0x5220('0x5'),_0x5220('0x6'),_0x5220('0x7'),util[_0x5220('0x8')](_0x5220('0x9'),_0x538d80,_0x3b7f33));}function formatter(_0x198d46,_0x3d6f13){_0x3d6f13['message']=_0x3d6f13[_0x5220('0xa')][_0x5220('0xb')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0x5220('0xb')](/@{/g,'{{')[_0x5220('0xb')](/}@/g,'}}');return util[_0x5220('0x8')](_0x5220('0xc'),moment()[_0x5220('0x8')](_0x5220('0xd')),_0x3d6f13[_0x5220('0xe')]['toUpperCase'](),_0x198d46,_0x3d6f13['message']);}module[_0x5220('0xf')]=function(_0x16dc39){return new winston['Logger']({'transports':[new winston[(_0x5220('0x10'))][(_0x5220('0x11'))]({'name':util[_0x5220('0x8')](_0x5220('0x12'),_0x16dc39,'error'),'filename':filename(_0x16dc39,_0x5220('0x13')),'level':_0x5220('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d1f80){return formatter(_0x16dc39,_0x4d1f80);}}),new winston[(_0x5220('0x10'))][(_0x5220('0x11'))]({'name':util['format']('%s-%s',_0x16dc39,_0x5220('0x14')),'filename':filename(_0x16dc39,_0x5220('0x14')),'level':_0x5220('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e035a){return formatter(_0x16dc39,_0x2e035a);}}),new winston[(_0x5220('0x10'))][(_0x5220('0x15'))]({'level':process[_0x5220('0x16')][_0x5220('0x17')]||debugLevel,'json':![],'formatter':function(_0x1f4f43){return formatter(_0x16dc39,_0x1f4f43);}})]});};
\ No newline at end of file
index 55f3fa3..24298eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dcf=['agi','../../services/agi/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','path','express','join','../../services/express/index.js'];(function(_0x4092f7,_0xeeac3c){var _0x1e3948=function(_0x2c8fcb){while(--_0x2c8fcb){_0x4092f7['push'](_0x4092f7['shift']());}};_0x1e3948(++_0xeeac3c);}(_0x5dcf,0x1f4));var _0xf5dc=function(_0x2bd838,_0xe1155e){_0x2bd838=_0x2bd838-0x0;var _0x59d362=_0x5dcf[_0x2bd838];return _0x59d362;};'use strict';var path=require(_0xf5dc('0x0'));var os=require('os');var config={'apps':[{'name':_0xf5dc('0x1'),'script':path[_0xf5dc('0x2')](__dirname,_0xf5dc('0x3'))},{'name':'ami','script':path[_0xf5dc('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xf5dc('0x4'),'script':path[_0xf5dc('0x2')](__dirname,_0xf5dc('0x5'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xf5dc('0x6'),'script':path[_0xf5dc('0x2')](__dirname,_0xf5dc('0x7'))},{'name':'xdr','script':path[_0xf5dc('0x2')](__dirname,_0xf5dc('0x8'))}]};module['exports']=config;
\ No newline at end of file
+var _0x3e32=['agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x3e32,0x14b));var _0x23e3=function(_0x34229a,_0x127148){_0x34229a=_0x34229a-0x0;var _0x41a4c0=_0x3e32[_0x34229a];return _0x41a4c0;};'use strict';var path=require(_0x23e3('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x23e3('0x1')](__dirname,_0x23e3('0x2'))},{'name':_0x23e3('0x3'),'script':path[_0x23e3('0x1')](__dirname,_0x23e3('0x4'))},{'name':_0x23e3('0x5'),'script':path[_0x23e3('0x1')](__dirname,_0x23e3('0x6'))},{'name':_0x23e3('0x7'),'script':path['join'](__dirname,_0x23e3('0x8'))},{'name':_0x23e3('0x9'),'script':path[_0x23e3('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0x23e3('0xa'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x23e3('0xb')]=config;
\ No newline at end of file
index 2b1d65c..d4f17fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e6=['pm2','bluebird','./config','connect','connected','start','disconnect','stop','then','restart','list','describe','delete','dump'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0x99e6,0x150));var _0x699e=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x99e6[_0x555ebb];return _0x3c0a4a;};'use strict';var pm2=require(_0x699e('0x0'));var BPromise=require(_0x699e('0x1'));var config=require(_0x699e('0x2'));function connect(){return new BPromise(function(_0x35490d,_0x15ae96){return pm2[_0x699e('0x3')](function(_0x2ffecc){if(_0x2ffecc){return _0x15ae96(_0x2ffecc);}return _0x35490d(_0x699e('0x4'));});});};exports[_0x699e('0x5')]=function(_0x5953b4){return connect()['then'](function(){return new BPromise(function(_0x434260,_0x231458){return pm2[_0x699e('0x5')](_0x5953b4,function(_0x100af5,_0x38f15e){if(_0x100af5){return _0x231458(_0x100af5);}pm2[_0x699e('0x6')]();return _0x434260(_0x38f15e);});});});};exports[_0x699e('0x7')]=function(_0x8ad62d){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x3f7cd0,_0x8302ae){return pm2[_0x699e('0x7')](_0x8ad62d,function(_0x486042,_0x121846){if(_0x486042){return _0x8302ae(_0x486042);}pm2[_0x699e('0x6')]();return _0x3f7cd0(_0x121846);});});});};exports[_0x699e('0x9')]=function(_0x2273be){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x5a0182,_0x14d161){return pm2[_0x699e('0x9')](_0x2273be,function(_0x32d484,_0x5b653d){if(_0x32d484){return _0x14d161(_0x32d484);}pm2[_0x699e('0x6')]();return _0x5a0182(_0x5b653d);});});});};exports[_0x699e('0xa')]=function(){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x509070,_0x5130da){return pm2[_0x699e('0xa')](function(_0x1a7fdd,_0xd1a6b5){if(_0x1a7fdd){return _0x5130da(_0x1a7fdd);}pm2[_0x699e('0x6')]();return _0x509070(_0xd1a6b5);});});});};exports[_0x699e('0xb')]=function(_0x4052c4){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x530155,_0x12455b){return pm2[_0x699e('0xb')](_0x4052c4,function(_0x4dc3e1,_0x53b05f){if(_0x4dc3e1){return _0x12455b(_0x4dc3e1);}pm2[_0x699e('0x6')]();return _0x530155(_0x53b05f);});});});};exports[_0x699e('0xc')]=function(_0x35cced){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x332898,_0x883eda){return pm2[_0x699e('0xc')](_0x35cced,function(_0x56cb12,_0x58e5fa){if(_0x56cb12){return _0x883eda(_0x56cb12);}pm2[_0x699e('0x6')]();return _0x332898(_0x58e5fa);});});});};exports[_0x699e('0xd')]=function(){return connect()[_0x699e('0x8')](function(){return new BPromise(function(_0x595ecf,_0x45c2fd){return pm2[_0x699e('0xd')](function(_0x45d7ab){if(_0x45d7ab){return _0x45c2fd(_0x45d7ab);}return _0x595ecf('saved');});});});};
\ No newline at end of file
+var _0xe2ac=['connect','start','then','disconnect','stop','restart','list','delete','dump','saved','pm2','bluebird','./config'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xe2ac,0x7f));var _0xce2a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xe2ac[_0x381589];return _0x2a075d;};'use strict';var pm2=require(_0xce2a('0x0'));var BPromise=require(_0xce2a('0x1'));var config=require(_0xce2a('0x2'));function connect(){return new BPromise(function(_0x2eb335,_0x29b660){return pm2[_0xce2a('0x3')](function(_0x32d224){if(_0x32d224){return _0x29b660(_0x32d224);}return _0x2eb335('connected');});});};exports[_0xce2a('0x4')]=function(_0x39682f){return connect()[_0xce2a('0x5')](function(){return new BPromise(function(_0x15591c,_0x26dcb6){return pm2[_0xce2a('0x4')](_0x39682f,function(_0x1590bc,_0x191700){if(_0x1590bc){return _0x26dcb6(_0x1590bc);}pm2[_0xce2a('0x6')]();return _0x15591c(_0x191700);});});});};exports[_0xce2a('0x7')]=function(_0x422cb1){return connect()[_0xce2a('0x5')](function(){return new BPromise(function(_0x4ef643,_0x4bbf2b){return pm2[_0xce2a('0x7')](_0x422cb1,function(_0xeefbc6,_0x28f34b){if(_0xeefbc6){return _0x4bbf2b(_0xeefbc6);}pm2[_0xce2a('0x6')]();return _0x4ef643(_0x28f34b);});});});};exports['restart']=function(_0x20791b){return connect()[_0xce2a('0x5')](function(){return new BPromise(function(_0x448148,_0x2b9ca2){return pm2[_0xce2a('0x8')](_0x20791b,function(_0x3ecdc3,_0x3900c6){if(_0x3ecdc3){return _0x2b9ca2(_0x3ecdc3);}pm2[_0xce2a('0x6')]();return _0x448148(_0x3900c6);});});});};exports[_0xce2a('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0xfd037c,_0x17e473){return pm2['list'](function(_0x3a04f1,_0x211914){if(_0x3a04f1){return _0x17e473(_0x3a04f1);}pm2[_0xce2a('0x6')]();return _0xfd037c(_0x211914);});});});};exports['describe']=function(_0x45da5a){return connect()[_0xce2a('0x5')](function(){return new BPromise(function(_0x54df3f,_0x4c4318){return pm2['describe'](_0x45da5a,function(_0x4d1cac,_0x46ed8d){if(_0x4d1cac){return _0x4c4318(_0x4d1cac);}pm2[_0xce2a('0x6')]();return _0x54df3f(_0x46ed8d);});});});};exports[_0xce2a('0xa')]=function(_0x1f890b){return connect()['then'](function(){return new BPromise(function(_0x262a21,_0x2de3ff){return pm2[_0xce2a('0xa')](_0x1f890b,function(_0x6532b2,_0x1cd96d){if(_0x6532b2){return _0x2de3ff(_0x6532b2);}pm2['disconnect']();return _0x262a21(_0x1cd96d);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x2cc7f4,_0x4fd11b){return pm2[_0xce2a('0xb')](function(_0x4e646c){if(_0x4e646c){return _0x4fd11b(_0x4e646c);}return _0x2cc7f4(_0xce2a('0xc'));});});});};
\ No newline at end of file
index b37aef0..d31bbe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb223=['defaults','socket.io-emitter','chatTimeout','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','emit','chatInteraction:update','catch','error','inspect','moment','ioredis','util','../logger','redis'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb223,0xee));var _0x3b22=function(_0x40c814,_0x308d8b){_0x40c814=_0x40c814-0x0;var _0x555d37=_0xb223[_0x40c814];return _0x555d37;};'use strict';var _=require('lodash');var moment=require(_0x3b22('0x0'));var Redis=require(_0x3b22('0x1'));var util=require(_0x3b22('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x3b22('0x3'))('schedule');config[_0x3b22('0x4')]=_[_0x3b22('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3b22('0x6'))(new Redis(config[_0x3b22('0x4')]));function closeInteractions(){var _0x1e1139=0x0;var _0x245b8b=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x3b22('0x7')],'where':{'id':0x1}})['then'](function(_0x23d6a9){_0x1e1139=_0x23d6a9[_0x3b22('0x7')];if(_0x1e1139){return db[_0x3b22('0x8')][_0x3b22('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3b22('0xa')](_0x23d6a9[_0x3b22('0x7')],_0x3b22('0xb'))}}});}else{return[];}})['then'](function(_0x48a8ad){if(_0x48a8ad&&_0x48a8ad[_0x3b22('0xc')]){_0x245b8b=_[_0x3b22('0xd')](_0x48a8ad||[],'id');logger[_0x3b22('0xe')](_0x3b22('0xf'),_0x245b8b[_0x3b22('0x10')]());return db[_0x3b22('0x8')]['update']({'closeReason':_0x3b22('0x11'),'disposition':_0x3b22('0x12'),'closed':!![],'closedAt':moment()[_0x3b22('0x13')](_0x3b22('0x14'))},{'where':{'id':_0x245b8b}});}})[_0x3b22('0x15')](function(){if(_0x245b8b&&_0x245b8b['length']){logger[_0x3b22('0xe')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x245b8b[_0x3b22('0x10')]());for(var _0x569273=0x0;_0x569273<_0x245b8b[_0x3b22('0xc')];_0x569273++){io[_0x3b22('0x16')](_0x3b22('0x17'),{'id':_0x245b8b[_0x569273],'closed':!![]});}}})[_0x3b22('0x18')](function(_0x2b3d95){logger[_0x3b22('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2b3d95?util[_0x3b22('0x1a')](_0x2b3d95,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x0480=['util','../logger','schedule','redis','defaults','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis'];(function(_0x2f249a,_0x4de4d7){var _0x32caa2=function(_0x5032a7){while(--_0x5032a7){_0x2f249a['push'](_0x2f249a['shift']());}};_0x32caa2(++_0x4de4d7);}(_0x0480,0xdd));var _0x0048=function(_0x5dbffd,_0x275df3){_0x5dbffd=_0x5dbffd-0x0;var _0x5b73b3=_0x0480[_0x5dbffd];return _0x5b73b3;};'use strict';var _=require(_0x0048('0x0'));var moment=require(_0x0048('0x1'));var Redis=require(_0x0048('0x2'));var util=require(_0x0048('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x0048('0x4'))(_0x0048('0x5'));config[_0x0048('0x6')]=_[_0x0048('0x7')](config[_0x0048('0x6')],{'host':_0x0048('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x3af77c=0x0;var _0x413926=[];return db[_0x0048('0x9')]['find']({'raw':!![],'attributes':['id',_0x0048('0xa')],'where':{'id':0x1}})[_0x0048('0xb')](function(_0x50f6f2){_0x3af77c=_0x50f6f2['chatTimeout'];if(_0x3af77c){return db[_0x0048('0xc')][_0x0048('0xd')]({'raw':!![],'attributes':['id',_0x0048('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0048('0xf')](_0x50f6f2['chatTimeout'],'minutes')}}});}else{return[];}})['then'](function(_0x467ce3){if(_0x467ce3&&_0x467ce3[_0x0048('0x10')]){_0x413926=_[_0x0048('0x11')](_0x467ce3||[],'id');logger[_0x0048('0x12')](_0x0048('0x13'),_0x413926[_0x0048('0x14')]());return db[_0x0048('0xc')][_0x0048('0x15')]({'closeReason':_0x0048('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x413926}});}})['then'](function(){if(_0x413926&&_0x413926['length']){logger['info'](_0x0048('0x17'),_0x413926[_0x0048('0x14')]());for(var _0x5a0e8e=0x0;_0x5a0e8e<_0x413926[_0x0048('0x10')];_0x5a0e8e++){io[_0x0048('0x18')]('chatInteraction:update',{'id':_0x413926[_0x5a0e8e],'closed':!![]});}}})['catch'](function(_0x51f471){logger['error'](_0x0048('0x19'),_0x51f471?util[_0x0048('0x1a')](_0x51f471,{'showHidden':![],'depth':null}):'');});}exports[_0x0048('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index a3b92a8..5878689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79b1=['exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','keys','jobs','map','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','toString','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','then','CustomReportId'];(function(_0x141e3e,_0x11f93e){var _0x14bc9f=function(_0x300252){while(--_0x300252){_0x141e3e['push'](_0x141e3e['shift']());}};_0x14bc9f(++_0x11f93e);}(_0x79b1,0x1f0));var _0x179b=function(_0x47c337,_0x1ac3b3){_0x47c337=_0x47c337-0x0;var _0x2e73e8=_0x79b1[_0x47c337];return _0x2e73e8;};'use strict';var fs=require('fs');var util=require(_0x179b('0x0'));var path=require(_0x179b('0x1'));var _=require(_0x179b('0x2'));var moment=require(_0x179b('0x3'));var CronJobManager=require(_0x179b('0x4'));var jayson=require(_0x179b('0x5'));var BPromise=require(_0x179b('0x6'));var logger=require('../logger')('schedule');var db=require(_0x179b('0x7'))['db'];var analyticCustomReportController=require(_0x179b('0x8'));var analyticDefaultReportController=require(_0x179b('0x9'));var client=jayson['client'][_0x179b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x52197f,_0x137669){return function(){logger[_0x179b('0xb')](_0x179b('0xc'),_0x52197f[_0x179b('0xd')]);var _0x17ff34=!![];var _0x3ca902={'tls':{'rejectUnauthorized':![]}};if(_0x52197f[_0x179b('0xe')][_0x179b('0xf')][_0x179b('0x10')]){_0x3ca902['service']=_0x52197f['MailAccount'][_0x179b('0xf')][_0x179b('0x10')];}else{_0x3ca902[_0x179b('0x11')]=_0x52197f[_0x179b('0xe')][_0x179b('0xf')]['host'];_0x3ca902[_0x179b('0x12')]=_0x52197f['MailAccount'][_0x179b('0xf')]['port'];_0x3ca902['secure']=_0x52197f[_0x179b('0xe')]['Smtp'][_0x179b('0x13')];}if(_0x52197f[_0x179b('0xe')]['Smtp']['authentication']){_0x3ca902[_0x179b('0x14')]={'user':_0x52197f[_0x179b('0xe')]['Smtp'][_0x179b('0x15')],'pass':_0x52197f[_0x179b('0xe')][_0x179b('0xf')]['pass']};}var _0x1a1b26={'account':_0x3ca902,'message':{'from':util[_0x179b('0x16')]('\x22%s\x22\x20<%s>',_0x52197f['MailAccount'][_0x179b('0x17')],_0x52197f[_0x179b('0xe')]['email']||_0x52197f[_0x179b('0xe')]['Smtp'][_0x179b('0x15')]),'to':_0x52197f[_0x179b('0xd')],'cc':_0x52197f['cc'],'bcc':_0x52197f[_0x179b('0x18')],'subject':util[_0x179b('0x16')](_0x179b('0x19'),_0x137669[_0x179b('0x17')],_0x52197f[_0x179b('0x1a')],_0x52197f[_0x179b('0x1b')])}};var _0x2f03b3=path[_0x179b('0x1c')](__dirname,_0x179b('0x1d'));var _0x155cb4=_0x137669[_0x179b('0x1e')];var _0x569a1c=util[_0x179b('0x16')](_0x179b('0x1f'),path[_0x179b('0x20')](_0x137669[_0x179b('0x1e')],path['extname'](_0x137669['savename'])),_0x179b('0x21'));var _0xeca828=path['join'](_0x2f03b3,_0x155cb4);var _0x1ba397=path[_0x179b('0x1c')](_0x2f03b3,_0x569a1c);if(fs[_0x179b('0x22')](_0xeca828)){_0x137669[_0x179b('0x23')]=_0x179b('0x24');_0x1a1b26[_0x179b('0x25')]['attachments']=[{'filename':_0x155cb4,'path':_0xeca828}];_0x1a1b26['message'][_0x179b('0x26')]=util[_0x179b('0x16')](_0x179b('0x27'),JSON[_0x179b('0x28')](_0x137669,null,0x2));}else if(fs[_0x179b('0x22')](_0x1ba397)){_0x137669[_0x179b('0x23')]='Sent';_0x1a1b26['message'][_0x179b('0x29')]=[{'filename':_0x569a1c,'path':_0x1ba397}];}else{_0x1a1b26[_0x179b('0x25')]['text']=_0x179b('0x2a');if(!_0x52197f[_0x179b('0x2b')]){_0x17ff34=![];logger[_0x179b('0xb')](_0x179b('0x2c'));}}if(_0x17ff34){return client[_0x179b('0x2d')]('SendMail',_0x1a1b26)['then'](function(_0x2f6d4f){if(_0x2f6d4f['error']){return logger[_0x179b('0x2e')]('error\x20mail',JSON['stringify'](_0x2f6d4f));}return logger[_0x179b('0xb')](_0x179b('0x2f'));})[_0x179b('0x30')](function(_0x37dbc5){return logger[_0x179b('0x2e')](_0x179b('0x31'),JSON[_0x179b('0x28')](_0x37dbc5));});}};}function handleError(){return function(_0x3a91f1){return logger[_0x179b('0x2e')](JSON[_0x179b('0x28')](_0x3a91f1));};}function handleResult(_0x1b8738){return function(_0x93d1e5){logger[_0x179b('0xb')](_0x179b('0x32'),JSON[_0x179b('0x28')](_0x93d1e5));if(_0x1b8738[_0x179b('0xe')]&&_0x1b8738['MailAccount'][_0x179b('0xf')]&&!_[_0x179b('0x33')](_0x1b8738['email'])){setTimeout(handleSendEmail(_0x1b8738,_0x93d1e5),0x3c*0x3e8);}};}function handleJob(_0x3b705a){return function(){try{if(_[_0x179b('0x33')](_0x3b705a[_0x179b('0x1a')])){return logger[_0x179b('0xb')](_0x179b('0x34'));}if(_['isNil'](_0x3b705a[_0x179b('0x1b')])){return logger[_0x179b('0xb')](_0x179b('0x35'));}var _0x169753={'startDate':moment()[_0x179b('0x36')](_0x3b705a[_0x179b('0x1a')],_0x3b705a['subtractUnit'])[_0x179b('0x16')](_0x179b('0x37')),'endDate':moment()[_0x179b('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x179b('0x38'),'output':_0x3b705a[_0x179b('0x39')],'name':_0x3b705a['name']};if(!_['isNil'](_0x3b705a['DefaultReportId'])){logger['info'](_0x179b('0x3a'),_0x3b705a[_0x179b('0x3b')]);return analyticDefaultReportController['runReport']({'id':_0x3b705a[_0x179b('0x3b')]},_0x169753)[_0x179b('0x3c')](handleResult(_0x3b705a))[_0x179b('0x30')](handleError());}if(!_[_0x179b('0x33')](_0x3b705a[_0x179b('0x3d')])){logger[_0x179b('0xb')](_0x179b('0x3e'),_0x3b705a[_0x179b('0x3d')]);return analyticCustomReportController['runReport']({'id':_0x3b705a[_0x179b('0x3d')]},_0x169753)[_0x179b('0x3c')](handleResult(_0x3b705a))[_0x179b('0x30')](handleError());}}catch(_0x37f81c){logger['error'](JSON[_0x179b('0x28')](_0x37f81c));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x1b12da){var _0x39c6ab={};if(_0x1b12da){_0x39c6ab['id']=_0x1b12da;}return db['Schedule'][_0x179b('0x3f')]({'where':_0x39c6ab,'include':[{'model':db[_0x179b('0xe')],'attributes':['id',_0x179b('0x17'),_0x179b('0xd')],'include':[{'model':db[_0x179b('0x40')],'as':'Smtp'}]}]})[_0x179b('0x3c')](function(_0x3fc825){var _0x5bd2a7=_[_0x179b('0x41')](manager[_0x179b('0x42')]);var _0xff5e66=_[_0x179b('0x43')](_0x3fc825,function(_0x3458ce){return _0x3458ce['id']['toString']();});var _0xa4641=_[_0x179b('0x44')](_0x3fc825,function(_0x32437f){return _0x32437f['id']['toString']();});var _0x55a68e=_0x1b12da?_0xff5e66:_[_0x179b('0x45')](_0xff5e66,_0x5bd2a7);var _0x20d80d=_[_0x179b('0x46')](_0xff5e66,_0x5bd2a7);var _0x2fc7e8=_[_0x179b('0x45')](_0x5bd2a7,_0xff5e66);var _0x2c68ae;var _0x4df7f9;for(_0x2c68ae=0x0;_0x2c68ae<_0x2fc7e8[_0x179b('0x47')]&&!_0x1b12da;_0x2c68ae+=0x1){_0x4df7f9=_0x2fc7e8[_0x2c68ae]['toString']();if(manager[_0x179b('0x48')](_0x4df7f9)){manager[_0x179b('0x49')](_0x4df7f9);manager[_0x179b('0x4a')](_0x4df7f9);logger[_0x179b('0xb')](_0x179b('0x4b'),_0x4df7f9);}}logger['info'](_0x179b('0x4c'),JSON['stringify'](_0x55a68e));for(_0x2c68ae=0x0;_0x2c68ae<_0x55a68e[_0x179b('0x47')];_0x2c68ae+=0x1){_0x4df7f9=_0x55a68e[_0x2c68ae][_0x179b('0x4d')]();logger[_0x179b('0xb')](_0x179b('0x4e'),_0x4df7f9);if(_0x1b12da){logger['info'](_0x179b('0x4f'),_0x1b12da);logger[_0x179b('0xb')](JSON[_0x179b('0x28')](_0xa4641[_0x4df7f9]));BPromise[_0x179b('0x50')]()[_0x179b('0x3c')](handleJob(_0xa4641[_0x4df7f9]));logger[_0x179b('0xb')](_0x179b('0x51'),_0xa4641[_0x4df7f9][_0x179b('0x17')],_0xa4641[_0x4df7f9][_0x179b('0x52')]);}else if(_0xa4641[_0x4df7f9]['cron']&&_0xa4641[_0x4df7f9][_0x179b('0x53')]&&moment()[_0x179b('0x54')](_0xa4641[_0x4df7f9][_0x179b('0x55')],_0xa4641[_0x4df7f9][_0x179b('0x56')])){manager['add'](_0x4df7f9,_0xa4641[_0x4df7f9][_0x179b('0x52')],handleJob(_0xa4641[_0x4df7f9]));manager[_0x179b('0x57')](_0x4df7f9);logger[_0x179b('0xb')](_0x179b('0x58'),_0xa4641[_0x4df7f9][_0x179b('0x17')],_0xa4641[_0x4df7f9]['cron']);}else if(manager[_0x179b('0x48')](_0x4df7f9)){manager[_0x179b('0x49')](_0x4df7f9);manager[_0x179b('0x4a')](_0x4df7f9);logger[_0x179b('0xb')](_0x179b('0x59'),_0xa4641[_0x4df7f9][_0x179b('0x17')],_0xa4641[_0x4df7f9][_0x179b('0x52')]);}}for(_0x2c68ae=0x0,_0x4df7f9;_0x2c68ae<_0x20d80d['length']&&!_0x1b12da;_0x2c68ae+=0x1){_0x4df7f9=_0x20d80d[_0x2c68ae][_0x179b('0x4d')]();if(manager['exists'](_0x4df7f9)){if(_0xa4641[_0x4df7f9][_0x179b('0x52')]&&_0xa4641[_0x4df7f9]['active']&&moment()['isBetween'](_0xa4641[_0x4df7f9]['startAt'],_0xa4641[_0x4df7f9][_0x179b('0x56')])){manager[_0x179b('0x5a')](_0x4df7f9,_0xa4641[_0x4df7f9][_0x179b('0x52')],handleJob(_0xa4641[_0x4df7f9]));logger[_0x179b('0xb')](_0x179b('0x5b'),_0xa4641[_0x4df7f9][_0x179b('0x17')],_0xa4641[_0x4df7f9][_0x179b('0x52')]);}else{manager[_0x179b('0x49')](_0x4df7f9);manager[_0x179b('0x4a')](_0x4df7f9);logger[_0x179b('0xb')](_0x179b('0x59'),_0xa4641[_0x4df7f9]['name'],_0xa4641[_0x4df7f9][_0x179b('0x52')]);}}}})[_0x179b('0x30')](function(_0x1110a4){logger[_0x179b('0x2e')](JSON[_0x179b('0x28')](_0x1110a4));});}exports[_0x179b('0x5c')]=function(_0x1fe285){return getJobs(_0x1fe285);};exports[_0x179b('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x5b35=['update\x20cron','deleteJob','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','auth','user','pass','\x22%s\x22\x20<%s>','email','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','savename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','request','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','name','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','length','exists','stop','delete\x20cron','index','cron','active','startAt','add','start','add\x20cron','stop\x20cron','isBetween','update'];(function(_0x185af9,_0x2af3ed){var _0x4a91db=function(_0x19d9f5){while(--_0x19d9f5){_0x185af9['push'](_0x185af9['shift']());}};_0x4a91db(++_0x2af3ed);}(_0x5b35,0xff));var _0x55b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b35[_0x4a9fb1];return _0x348672;};'use strict';var fs=require('fs');var util=require(_0x55b3('0x0'));var path=require(_0x55b3('0x1'));var _=require(_0x55b3('0x2'));var moment=require(_0x55b3('0x3'));var CronJobManager=require(_0x55b3('0x4'));var jayson=require(_0x55b3('0x5'));var BPromise=require('bluebird');var logger=require('../logger')('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x55b3('0x6'));var analyticDefaultReportController=require(_0x55b3('0x7'));var client=jayson[_0x55b3('0x8')][_0x55b3('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x146c43,_0xcc2898){return function(){logger[_0x55b3('0xa')](_0x55b3('0xb'),_0x146c43['email']);var _0x5a4547=!![];var _0x2ee048={'tls':{'rejectUnauthorized':![]}};if(_0x146c43[_0x55b3('0xc')][_0x55b3('0xd')][_0x55b3('0xe')]){_0x2ee048[_0x55b3('0xe')]=_0x146c43[_0x55b3('0xc')][_0x55b3('0xd')][_0x55b3('0xe')];}else{_0x2ee048[_0x55b3('0xf')]=_0x146c43[_0x55b3('0xc')]['Smtp']['host'];_0x2ee048[_0x55b3('0x10')]=_0x146c43['MailAccount'][_0x55b3('0xd')]['port'];_0x2ee048[_0x55b3('0x11')]=_0x146c43[_0x55b3('0xc')]['Smtp'][_0x55b3('0x11')];}if(_0x146c43[_0x55b3('0xc')][_0x55b3('0xd')]['authentication']){_0x2ee048[_0x55b3('0x12')]={'user':_0x146c43[_0x55b3('0xc')]['Smtp'][_0x55b3('0x13')],'pass':_0x146c43[_0x55b3('0xc')][_0x55b3('0xd')][_0x55b3('0x14')]};}var _0x19651b={'account':_0x2ee048,'message':{'from':util['format'](_0x55b3('0x15'),_0x146c43[_0x55b3('0xc')]['name'],_0x146c43['MailAccount']['email']||_0x146c43[_0x55b3('0xc')][_0x55b3('0xd')][_0x55b3('0x13')]),'to':_0x146c43[_0x55b3('0x16')],'cc':_0x146c43['cc'],'bcc':_0x146c43[_0x55b3('0x17')],'subject':util[_0x55b3('0x18')](_0x55b3('0x19'),_0xcc2898['name'],_0x146c43[_0x55b3('0x1a')],_0x146c43[_0x55b3('0x1b')])}};var _0x53c073=path[_0x55b3('0x1c')](__dirname,_0x55b3('0x1d'));var _0x42008a=_0xcc2898['savename'];var _0xe588ca=util[_0x55b3('0x18')](_0x55b3('0x1e'),path['basename'](_0xcc2898[_0x55b3('0x1f')],path['extname'](_0xcc2898['savename'])),_0x55b3('0x20'));var _0x302650=path['join'](_0x53c073,_0x42008a);var _0x40d16f=path[_0x55b3('0x1c')](_0x53c073,_0xe588ca);if(fs[_0x55b3('0x21')](_0x302650)){_0xcc2898[_0x55b3('0x22')]=_0x55b3('0x23');_0x19651b[_0x55b3('0x24')][_0x55b3('0x25')]=[{'filename':_0x42008a,'path':_0x302650}];_0x19651b[_0x55b3('0x24')][_0x55b3('0x26')]=util[_0x55b3('0x18')](_0x55b3('0x27'),JSON[_0x55b3('0x28')](_0xcc2898,null,0x2));}else if(fs[_0x55b3('0x21')](_0x40d16f)){_0xcc2898['status']=_0x55b3('0x23');_0x19651b[_0x55b3('0x24')][_0x55b3('0x25')]=[{'filename':_0xe588ca,'path':_0x40d16f}];}else{_0x19651b['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x146c43[_0x55b3('0x29')]){_0x5a4547=![];logger[_0x55b3('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5a4547){return client[_0x55b3('0x2a')]('SendMail',_0x19651b)[_0x55b3('0x2b')](function(_0x3e3642){if(_0x3e3642[_0x55b3('0x2c')]){return logger[_0x55b3('0x2c')](_0x55b3('0x2d'),JSON['stringify'](_0x3e3642));}return logger['info']('email\x20sent');})['catch'](function(_0x39f5d8){return logger[_0x55b3('0x2c')](_0x55b3('0x2d'),JSON[_0x55b3('0x28')](_0x39f5d8));});}};}function handleError(){return function(_0x593a53){return logger[_0x55b3('0x2c')](JSON[_0x55b3('0x28')](_0x593a53));};}function handleResult(_0x1c200a){return function(_0x14ac5f){logger[_0x55b3('0xa')](_0x55b3('0x2e'),JSON[_0x55b3('0x28')](_0x14ac5f));if(_0x1c200a[_0x55b3('0xc')]&&_0x1c200a[_0x55b3('0xc')][_0x55b3('0xd')]&&!_['isNil'](_0x1c200a[_0x55b3('0x16')])){setTimeout(handleSendEmail(_0x1c200a,_0x14ac5f),0x3c*0x3e8);}};}function handleJob(_0x287d58){return function(){try{if(_[_0x55b3('0x2f')](_0x287d58[_0x55b3('0x1a')])){return logger[_0x55b3('0xa')](_0x55b3('0x30'));}if(_[_0x55b3('0x2f')](_0x287d58[_0x55b3('0x1b')])){return logger[_0x55b3('0xa')](_0x55b3('0x31'));}var _0xe6fc08={'startDate':moment()['subtract'](_0x287d58['subtractNumber'],_0x287d58['subtractUnit'])[_0x55b3('0x18')](_0x55b3('0x32')),'endDate':moment()['format'](_0x55b3('0x32')),'type':_0x55b3('0x33'),'output':_0x287d58['output'],'name':_0x287d58[_0x55b3('0x34')]};if(!_[_0x55b3('0x2f')](_0x287d58[_0x55b3('0x35')])){logger[_0x55b3('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x287d58[_0x55b3('0x35')]);return analyticDefaultReportController[_0x55b3('0x36')]({'id':_0x287d58['DefaultReportId']},_0xe6fc08)[_0x55b3('0x2b')](handleResult(_0x287d58))[_0x55b3('0x37')](handleError());}if(!_[_0x55b3('0x2f')](_0x287d58['CustomReportId'])){logger[_0x55b3('0xa')](_0x55b3('0x38'),_0x287d58[_0x55b3('0x39')]);return analyticCustomReportController['runReport']({'id':_0x287d58[_0x55b3('0x39')]},_0xe6fc08)['then'](handleResult(_0x287d58))[_0x55b3('0x37')](handleError());}}catch(_0x434262){logger[_0x55b3('0x2c')](JSON[_0x55b3('0x28')](_0x434262));}return logger['info'](_0x55b3('0x3a'));};}function getJobs(_0xa2bf41){var _0x305270={};if(_0xa2bf41){_0x305270['id']=_0xa2bf41;}return db[_0x55b3('0x3b')][_0x55b3('0x3c')]({'where':_0x305270,'include':[{'model':db[_0x55b3('0xc')],'attributes':['id',_0x55b3('0x34'),_0x55b3('0x16')],'include':[{'model':db[_0x55b3('0x3d')],'as':'Smtp'}]}]})['then'](function(_0x411ad6){var _0x3d1499=_['keys'](manager[_0x55b3('0x3e')]);var _0x5464fe=_[_0x55b3('0x3f')](_0x411ad6,function(_0x4a4240){return _0x4a4240['id'][_0x55b3('0x40')]();});var _0xe328ec=_[_0x55b3('0x41')](_0x411ad6,function(_0x1546b8){return _0x1546b8['id'][_0x55b3('0x40')]();});var _0x130a0=_0xa2bf41?_0x5464fe:_['difference'](_0x5464fe,_0x3d1499);var _0x8351fb=_['intersection'](_0x5464fe,_0x3d1499);var _0x226f25=_[_0x55b3('0x42')](_0x3d1499,_0x5464fe);var _0x13e0fd;var _0x2c1d3b;for(_0x13e0fd=0x0;_0x13e0fd<_0x226f25[_0x55b3('0x43')]&&!_0xa2bf41;_0x13e0fd+=0x1){_0x2c1d3b=_0x226f25[_0x13e0fd][_0x55b3('0x40')]();if(manager[_0x55b3('0x44')](_0x2c1d3b)){manager[_0x55b3('0x45')](_0x2c1d3b);manager['deleteJob'](_0x2c1d3b);logger[_0x55b3('0xa')](_0x55b3('0x46'),_0x2c1d3b);}}logger[_0x55b3('0xa')]('toRun',JSON[_0x55b3('0x28')](_0x130a0));for(_0x13e0fd=0x0;_0x13e0fd<_0x130a0[_0x55b3('0x43')];_0x13e0fd+=0x1){_0x2c1d3b=_0x130a0[_0x13e0fd][_0x55b3('0x40')]();logger[_0x55b3('0xa')](_0x55b3('0x47'),_0x2c1d3b);if(_0xa2bf41){logger['info']('my\x20id',_0xa2bf41);logger[_0x55b3('0xa')](JSON[_0x55b3('0x28')](_0xe328ec[_0x2c1d3b]));BPromise['resolve']()[_0x55b3('0x2b')](handleJob(_0xe328ec[_0x2c1d3b]));logger['info']('run\x20job',_0xe328ec[_0x2c1d3b][_0x55b3('0x34')],_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]);}else if(_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]&&_0xe328ec[_0x2c1d3b][_0x55b3('0x49')]&&moment()['isBetween'](_0xe328ec[_0x2c1d3b][_0x55b3('0x4a')],_0xe328ec[_0x2c1d3b]['endAt'])){manager[_0x55b3('0x4b')](_0x2c1d3b,_0xe328ec[_0x2c1d3b][_0x55b3('0x48')],handleJob(_0xe328ec[_0x2c1d3b]));manager[_0x55b3('0x4c')](_0x2c1d3b);logger[_0x55b3('0xa')](_0x55b3('0x4d'),_0xe328ec[_0x2c1d3b][_0x55b3('0x34')],_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]);}else if(manager['exists'](_0x2c1d3b)){manager[_0x55b3('0x45')](_0x2c1d3b);manager['deleteJob'](_0x2c1d3b);logger['info'](_0x55b3('0x4e'),_0xe328ec[_0x2c1d3b][_0x55b3('0x34')],_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]);}}for(_0x13e0fd=0x0,_0x2c1d3b;_0x13e0fd<_0x8351fb[_0x55b3('0x43')]&&!_0xa2bf41;_0x13e0fd+=0x1){_0x2c1d3b=_0x8351fb[_0x13e0fd][_0x55b3('0x40')]();if(manager['exists'](_0x2c1d3b)){if(_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]&&_0xe328ec[_0x2c1d3b][_0x55b3('0x49')]&&moment()[_0x55b3('0x4f')](_0xe328ec[_0x2c1d3b][_0x55b3('0x4a')],_0xe328ec[_0x2c1d3b]['endAt'])){manager[_0x55b3('0x50')](_0x2c1d3b,_0xe328ec[_0x2c1d3b][_0x55b3('0x48')],handleJob(_0xe328ec[_0x2c1d3b]));logger['info'](_0x55b3('0x51'),_0xe328ec[_0x2c1d3b][_0x55b3('0x34')],_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]);}else{manager[_0x55b3('0x45')](_0x2c1d3b);manager[_0x55b3('0x52')](_0x2c1d3b);logger['info'](_0x55b3('0x4e'),_0xe328ec[_0x2c1d3b]['name'],_0xe328ec[_0x2c1d3b][_0x55b3('0x48')]);}}}})[_0x55b3('0x37')](function(_0x49ed9f){logger[_0x55b3('0x2c')](JSON[_0x55b3('0x28')](_0x49ed9f));});}exports[_0x55b3('0x53')]=function(_0x32660a){return getJobs(_0x32660a);};exports[_0x55b3('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 19d28da..0085e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbde2=['TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','Negative','SentimentScore','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Neutral','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','push','all','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','TranscriptionJob'];(function(_0x366ce0,_0x4c3fad){var _0x5ae1c0=function(_0x6a4ad6){while(--_0x6a4ad6){_0x366ce0['push'](_0x366ce0['shift']());}};_0x5ae1c0(++_0x4c3fad);}(_0xbde2,0x7a));var _0x2bde=function(_0x1ea7da,_0x522fc1){_0x1ea7da=_0x1ea7da-0x0;var _0x23f343=_0xbde2[_0x1ea7da];return _0x23f343;};var _=require('lodash');var AWS=require(_0x2bde('0x0'));var rp=require(_0x2bde('0x1'));var util=require(_0x2bde('0x2'));var BPromise=require('bluebird');var db=require(_0x2bde('0x3'))['db'];var logger=require(_0x2bde('0x4'))(_0x2bde('0x5'));function getTranscriptionJob(_0x530c9f,_0x3622bb,_0x211d7c,_0x2a8d2e){return new Promise(function(_0x3b3039,_0x50c1a1){var _0x30d926=new AWS[(_0x2bde('0x6'))]({'accessKeyId':_0x3622bb,'secretAccessKey':_0x530c9f,'region':_0x211d7c});_0x30d926[_0x2bde('0x7')]({'TranscriptionJobName':_0x2a8d2e},function(_0x3ddbc4,_0x343cba){if(_0x3ddbc4){return _0x50c1a1(_0x3ddbc4);}else{return _0x3b3039(_0x343cba);}});});}function sentiment(_0x27eda4,_0x53935d,_0x5cc171,_0x4a4bf0,_0x3ae001){return new Promise(function(_0x2b9c2f,_0xbbdbc9){var _0x57c636=new AWS[(_0x2bde('0x8'))]({'accessKeyId':_0x53935d,'secretAccessKey':_0x27eda4,'region':_0x5cc171});_0x57c636[_0x2bde('0x9')]({'Text':_0x4a4bf0,'LanguageCode':_0x3ae001[_0x2bde('0xa')](0x0,0x2)},function(_0x1abbe2,_0x404121){if(_0x1abbe2){return _0xbbdbc9(_0x1abbe2);}else{return _0x2b9c2f(_0x404121);}});});}function checkTranscribeJob(_0x44fd88,_0x5c98f3,_0x62de8f){var _0x5ba816;return new BPromise(function(_0x2a8b29,_0x254fa1){logger[_0x2bde('0xb')](util[_0x2bde('0xc')](_0x2bde('0xd'),_0x44fd88['id'],_0x44fd88[_0x2bde('0xe')]));return getTranscriptionJob(_0x62de8f[_0x2bde('0xf')],_0x62de8f[_0x2bde('0x10')],_0x5c98f3[_0x2bde('0x11')],_0x44fd88[_0x2bde('0xe')])[_0x2bde('0x12')](function(_0x1b2958){logger[_0x2bde('0xb')](util[_0x2bde('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x44fd88['id'],_0x44fd88['transcribeName'],_0x1b2958[_0x2bde('0x13')][_0x2bde('0x14')]));if(!_0x44fd88[_0x2bde('0x15')]){switch(_0x1b2958[_0x2bde('0x13')]['TranscriptionJobStatus']){case _0x2bde('0x16'):var _0x1679ed={'transcribeStatus':_0x1b2958[_0x2bde('0x13')][_0x2bde('0x14')],'fileUri':_0x1b2958[_0x2bde('0x13')][_0x2bde('0x17')][_0x2bde('0x18')]};logger[_0x2bde('0xb')](util['format'](_0x2bde('0x19'),_0x44fd88['id']));return rp({'uri':_0x1b2958['TranscriptionJob']['Transcript'][_0x2bde('0x18')],'json':!![]})[_0x2bde('0x12')](function(_0x27b6e1){logger['info'](util[_0x2bde('0xc')](_0x2bde('0x1a'),_0x44fd88['id']));if(_0x27b6e1&&_0x27b6e1[_0x2bde('0x1b')]&&_0x27b6e1['results'][_0x2bde('0x1c')]&&_0x27b6e1[_0x2bde('0x1b')][_0x2bde('0x1c')]['length']){_0x1679ed['fileText']='';for(var _0x591aea=0x0;_0x591aea<_0x27b6e1['results'][_0x2bde('0x1c')]['length'];_0x591aea++){_0x1679ed[_0x2bde('0x15')]+=_0x27b6e1[_0x2bde('0x1b')][_0x2bde('0x1c')][_0x591aea][_0x2bde('0x1d')]+'';}}return _0x44fd88['update'](_0x1679ed);})[_0x2bde('0x12')](function(){logger[_0x2bde('0xb')](util[_0x2bde('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x44fd88['id']));if(!_0x44fd88[_0x2bde('0x1e')]){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x21'));}if(!_0x5c98f3[_0x2bde('0x22')]||!_0x5c98f3[_0x2bde('0x23')]||!_0x5c98f3[_0x2bde('0x24')]||!_0x5c98f3['language']||!_0x5c98f3[_0x2bde('0x25')]){throw new db['Sequelize'][(_0x2bde('0x20'))](_0x2bde('0x26'));}if(!_0x1679ed[_0x2bde('0x15')]){throw new Error(_0x2bde('0x27'));}if(_0x5c98f3[_0x2bde('0x23')]===_0x62de8f['id']){return _0x62de8f;}else{return db[_0x2bde('0x28')][_0x2bde('0x29')]({'where':{'id':_settings[_0x2bde('0x23')]}});}})['then'](function(_0x4a55e0){if(!_0x4a55e0){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x2a'));}if(!_0x4a55e0[_0x2bde('0xf')]||!_0x4a55e0[_0x2bde('0x10')]){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x5ba816=_0x4a55e0;logger['info'](util[_0x2bde('0xc')](_0x2bde('0x2b'),_0x44fd88['id']));return sentiment(_0x5ba816['data1'],_0x5ba816[_0x2bde('0x10')],_0x5c98f3[_0x2bde('0x24')],_0x1679ed[_0x2bde('0x15')],_0x5c98f3[_0x2bde('0x2c')]);})['then'](function(_0x59f24b){logger[_0x2bde('0xb')](util[_0x2bde('0xc')](_0x2bde('0x2d'),_0x44fd88['id']));return _0x44fd88[_0x2bde('0x2e')]({'sentiment':_0x59f24b[_0x2bde('0x2f')],'sPositive':_0x59f24b['SentimentScore'][_0x2bde('0x30')],'sNegative':_0x59f24b['SentimentScore'][_0x2bde('0x31')],'sMixed':_0x59f24b[_0x2bde('0x32')][_0x2bde('0x33')],'sNeutral':_0x59f24b[_0x2bde('0x32')]['Neutral']});})[_0x2bde('0x12')](function(){logger['info'](util[_0x2bde('0xc')](_0x2bde('0x34'),_0x44fd88['id']));_0x2a8b29();});case _0x2bde('0x35'):return _0x44fd88['update']({'transcribeStatus':'FAILED','failureReason':_0x1b2958[_0x2bde('0x13')][_0x2bde('0x36')]})['then'](function(){logger[_0x2bde('0xb')](util['format'](_0x2bde('0x34'),_0x44fd88['id']));_0x2a8b29();});default:logger['info'](util[_0x2bde('0xc')](_0x2bde('0x37'),_0x44fd88['id']));break;}}else{return BPromise[_0x2bde('0x38')]()['then'](function(){if(!_0x44fd88[_0x2bde('0x1e')]){throw new db['Sequelize']['ValidationError'](_0x2bde('0x21'));}if(!_0x5c98f3[_0x2bde('0x22')]||!_0x5c98f3[_0x2bde('0x23')]||!_0x5c98f3[_0x2bde('0x24')]||!_0x5c98f3[_0x2bde('0x2c')]||!_0x5c98f3[_0x2bde('0x25')]){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x26'));}if(!_0x44fd88[_0x2bde('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x5c98f3[_0x2bde('0x23')]===_0x62de8f['id']){return _0x62de8f;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x2bde('0x23')]}});}})['then'](function(_0x35af6a){if(!_0x35af6a){throw new db['Sequelize'][(_0x2bde('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x35af6a[_0x2bde('0xf')]||!_0x35af6a[_0x2bde('0x10')]){throw new db['Sequelize'][(_0x2bde('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x5ba816=_0x35af6a;logger['info'](util[_0x2bde('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x44fd88['id']));return sentiment(_0x5ba816[_0x2bde('0xf')],_0x5ba816[_0x2bde('0x10')],_0x5c98f3['sentimentRegion'],_0x44fd88['fileText'],_0x5c98f3[_0x2bde('0x2c')]);})[_0x2bde('0x12')](function(_0xaa326f){logger[_0x2bde('0xb')](util[_0x2bde('0xc')](_0x2bde('0x2d'),_0x44fd88['id']));return _0x44fd88['update']({'sentiment':_0xaa326f[_0x2bde('0x2f')],'sPositive':_0xaa326f[_0x2bde('0x32')][_0x2bde('0x30')],'sNegative':_0xaa326f[_0x2bde('0x32')]['Negative'],'sMixed':_0xaa326f[_0x2bde('0x32')][_0x2bde('0x33')],'sNeutral':_0xaa326f[_0x2bde('0x32')][_0x2bde('0x39')],'transcribeStatus':_0x2bde('0x16')});})[_0x2bde('0x12')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x44fd88['id']));_0x2a8b29();});}})[_0x2bde('0x3a')](function(_0x2ab97c){if(_0x2ab97c){if(!_0x2ab97c['name']||_0x2ab97c[_0x2bde('0x3b')]!=='SequelizeValidationError'){logger[_0x2bde('0x3c')](util[_0x2bde('0xc')](_0x2bde('0x3d'),_0x44fd88['id']),util[_0x2bde('0x3e')](_0x2ab97c,{'showHidden':![],'depth':null}));}}_0x2a8b29();});});}function checkTranscribe(){var _0x5747d3;var _0x20c515;var _0x39cf8e;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x2bde('0x3f')}})['then'](function(_0x50906f){if(!_0x50906f||!_0x50906f['length']){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x40'));}_0x5747d3=_0x50906f;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x2bde('0x12')](function(_0x490038){if(!_0x490038){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x41'));}_0x20c515=_0x490038;if(!_0x20c515[_0x2bde('0x5')]||!_0x20c515[_0x2bde('0x42')]||!_0x20c515['transcribeRegion']||!_0x20c515[_0x2bde('0x2c')]||!_0x20c515[_0x2bde('0x25')]){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x2bde('0x29')]({'where':{'id':_0x20c515[_0x2bde('0x42')]}});})['then'](function(_0xe6afd4){if(!_0xe6afd4){throw new db['Sequelize'][(_0x2bde('0x20'))](_0x2bde('0x2a'));}if(!_0xe6afd4[_0x2bde('0xf')]||!_0xe6afd4['data2']){throw new db[(_0x2bde('0x1f'))][(_0x2bde('0x20'))](_0x2bde('0x43'));}_0x39cf8e=_0xe6afd4;var _0x30c745=[];_0x5747d3['forEach'](function(_0x28d512){_0x30c745[_0x2bde('0x44')](checkTranscribeJob(_0x28d512,_0x20c515,_0x39cf8e));});return BPromise[_0x2bde('0x45')](_0x30c745);})['catch'](function(_0x4cbc43){if(_0x4cbc43){if(!_0x4cbc43[_0x2bde('0x3b')]||_0x4cbc43['name']!=='SequelizeValidationError'){logger[_0x2bde('0x3c')](util[_0x2bde('0x3e')](_0x4cbc43,{'showHidden':![],'depth':null}));}}});}exports[_0x2bde('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xb2af=['Comprehend','detectSentiment','substring','format','data1','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','data2','catch','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach','push','all','name','SequelizeValidationError','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob'];(function(_0x158074,_0x5ecc82){var _0x9fe5d6=function(_0xb2b2d6){while(--_0xb2b2d6){_0x158074['push'](_0x158074['shift']());}};_0x9fe5d6(++_0x5ecc82);}(_0xb2af,0xd2));var _0xfb2a=function(_0x4f994a,_0x4a85db){_0x4f994a=_0x4f994a-0x0;var _0x49dfb9=_0xb2af[_0x4f994a];return _0x49dfb9;};var _=require(_0xfb2a('0x0'));var AWS=require(_0xfb2a('0x1'));var rp=require(_0xfb2a('0x2'));var util=require(_0xfb2a('0x3'));var BPromise=require('bluebird');var db=require(_0xfb2a('0x4'))['db'];var logger=require(_0xfb2a('0x5'))(_0xfb2a('0x6'));function getTranscriptionJob(_0x856b1,_0xd63d49,_0x5b7553,_0xad7ba6){return new Promise(function(_0x1f4f1b,_0xb1be3f){var _0x55cf25=new AWS[(_0xfb2a('0x7'))]({'accessKeyId':_0xd63d49,'secretAccessKey':_0x856b1,'region':_0x5b7553});_0x55cf25[_0xfb2a('0x8')]({'TranscriptionJobName':_0xad7ba6},function(_0x1f3315,_0x55bb4e){if(_0x1f3315){return _0xb1be3f(_0x1f3315);}else{return _0x1f4f1b(_0x55bb4e);}});});}function sentiment(_0x2c529e,_0x33b17a,_0x3d3333,_0x9a7bf1,_0x46f390){return new Promise(function(_0x45bdff,_0x2f4f0e){var _0x3cf887=new AWS[(_0xfb2a('0x9'))]({'accessKeyId':_0x33b17a,'secretAccessKey':_0x2c529e,'region':_0x3d3333});_0x3cf887[_0xfb2a('0xa')]({'Text':_0x9a7bf1,'LanguageCode':_0x46f390[_0xfb2a('0xb')](0x0,0x2)},function(_0x383645,_0x5bbc63){if(_0x383645){return _0x2f4f0e(_0x383645);}else{return _0x45bdff(_0x5bbc63);}});});}function checkTranscribeJob(_0x4dad44,_0x49a66c,_0x26057f){var _0x37e000;return new BPromise(function(_0x422f6f,_0x10e1a0){logger['info'](util[_0xfb2a('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4dad44['id'],_0x4dad44['transcribeName']));return getTranscriptionJob(_0x26057f[_0xfb2a('0xd')],_0x26057f['data2'],_0x49a66c['transcribeRegion'],_0x4dad44[_0xfb2a('0xe')])[_0xfb2a('0xf')](function(_0x49ecbd){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x11'),_0x4dad44['id'],_0x4dad44[_0xfb2a('0xe')],_0x49ecbd[_0xfb2a('0x12')][_0xfb2a('0x13')]));if(!_0x4dad44['fileText']){switch(_0x49ecbd[_0xfb2a('0x12')][_0xfb2a('0x13')]){case _0xfb2a('0x14'):var _0x2b072a={'transcribeStatus':_0x49ecbd['TranscriptionJob'][_0xfb2a('0x13')],'fileUri':_0x49ecbd['TranscriptionJob'][_0xfb2a('0x15')][_0xfb2a('0x16')]};logger[_0xfb2a('0x10')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x4dad44['id']));return rp({'uri':_0x49ecbd['TranscriptionJob']['Transcript'][_0xfb2a('0x16')],'json':!![]})[_0xfb2a('0xf')](function(_0x434ca5){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x17'),_0x4dad44['id']));if(_0x434ca5&&_0x434ca5[_0xfb2a('0x18')]&&_0x434ca5[_0xfb2a('0x18')][_0xfb2a('0x19')]&&_0x434ca5[_0xfb2a('0x18')]['transcripts'][_0xfb2a('0x1a')]){_0x2b072a['fileText']='';for(var _0x37cc1f=0x0;_0x37cc1f<_0x434ca5[_0xfb2a('0x18')]['transcripts'][_0xfb2a('0x1a')];_0x37cc1f++){_0x2b072a[_0xfb2a('0x1b')]+=_0x434ca5['results'][_0xfb2a('0x19')][_0x37cc1f][_0xfb2a('0x1c')]+'';}}return _0x4dad44['update'](_0x2b072a);})[_0xfb2a('0xf')](function(){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x1d'),_0x4dad44['id']));if(!_0x4dad44[_0xfb2a('0x1e')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x21'));}if(!_0x49a66c[_0xfb2a('0x22')]||!_0x49a66c[_0xfb2a('0x23')]||!_0x49a66c['sentimentRegion']||!_0x49a66c[_0xfb2a('0x24')]||!_0x49a66c[_0xfb2a('0x25')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x26'));}if(!_0x2b072a[_0xfb2a('0x1b')]){throw new Error(_0xfb2a('0x27'));}if(_0x49a66c[_0xfb2a('0x23')]===_0x26057f['id']){return _0x26057f;}else{return db['CloudProvider'][_0xfb2a('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1c3551){if(!_0x1c3551){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1c3551[_0xfb2a('0xd')]||!_0x1c3551['data2']){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x29'));}_0x37e000=_0x1c3551;logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x2a'),_0x4dad44['id']));return sentiment(_0x37e000['data1'],_0x37e000['data2'],_0x49a66c[_0xfb2a('0x2b')],_0x2b072a[_0xfb2a('0x1b')],_0x49a66c['language']);})['then'](function(_0x149df0){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x2c'),_0x4dad44['id']));return _0x4dad44[_0xfb2a('0x2d')]({'sentiment':_0x149df0[_0xfb2a('0x2e')],'sPositive':_0x149df0['SentimentScore'][_0xfb2a('0x2f')],'sNegative':_0x149df0[_0xfb2a('0x30')][_0xfb2a('0x31')],'sMixed':_0x149df0[_0xfb2a('0x30')][_0xfb2a('0x32')],'sNeutral':_0x149df0[_0xfb2a('0x30')][_0xfb2a('0x33')]});})[_0xfb2a('0xf')](function(){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x1d'),_0x4dad44['id']));_0x422f6f();});case _0xfb2a('0x34'):return _0x4dad44[_0xfb2a('0x2d')]({'transcribeStatus':_0xfb2a('0x34'),'failureReason':_0x49ecbd[_0xfb2a('0x12')][_0xfb2a('0x35')]})[_0xfb2a('0xf')](function(){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x1d'),_0x4dad44['id']));_0x422f6f();});default:logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x36'),_0x4dad44['id']));break;}}else{return BPromise[_0xfb2a('0x37')]()[_0xfb2a('0xf')](function(){if(!_0x4dad44[_0xfb2a('0x1e')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x21'));}if(!_0x49a66c['sentiment']||!_0x49a66c[_0xfb2a('0x23')]||!_0x49a66c[_0xfb2a('0x2b')]||!_0x49a66c[_0xfb2a('0x24')]||!_0x49a66c[_0xfb2a('0x25')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4dad44[_0xfb2a('0x1b')]){throw new Error(_0xfb2a('0x27'));}if(_0x49a66c[_0xfb2a('0x23')]===_0x26057f['id']){return _0x26057f;}else{return db['CloudProvider'][_0xfb2a('0x28')]({'where':{'id':_settings[_0xfb2a('0x23')]}});}})[_0xfb2a('0xf')](function(_0xb84832){if(!_0xb84832){throw new db['Sequelize'][(_0xfb2a('0x20'))](_0xfb2a('0x38'));}if(!_0xb84832[_0xfb2a('0xd')]||!_0xb84832[_0xfb2a('0x39')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x29'));}_0x37e000=_0xb84832;logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4dad44['id']));return sentiment(_0x37e000['data1'],_0x37e000['data2'],_0x49a66c[_0xfb2a('0x2b')],_0x4dad44[_0xfb2a('0x1b')],_0x49a66c['language']);})['then'](function(_0x513e12){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x2c'),_0x4dad44['id']));return _0x4dad44[_0xfb2a('0x2d')]({'sentiment':_0x513e12['Sentiment'],'sPositive':_0x513e12[_0xfb2a('0x30')][_0xfb2a('0x2f')],'sNegative':_0x513e12[_0xfb2a('0x30')]['Negative'],'sMixed':_0x513e12['SentimentScore']['Mixed'],'sNeutral':_0x513e12[_0xfb2a('0x30')][_0xfb2a('0x33')],'transcribeStatus':_0xfb2a('0x14')});})[_0xfb2a('0xf')](function(){logger[_0xfb2a('0x10')](util[_0xfb2a('0xc')](_0xfb2a('0x1d'),_0x4dad44['id']));_0x422f6f();});}})[_0xfb2a('0x3a')](function(_0x13673f){if(_0x13673f){if(!_0x13673f['name']||_0x13673f['name']!=='SequelizeValidationError'){logger[_0xfb2a('0x3b')](util['format'](_0xfb2a('0x3c'),_0x4dad44['id']),util['inspect'](_0x13673f,{'showHidden':![],'depth':null}));}}_0x422f6f();});});}function checkTranscribe(){var _0x523414;var _0x253c3e;var _0xef975f;return db['VoiceRecording'][_0xfb2a('0x3d')]({'where':{'transcribeStatus':_0xfb2a('0x3e')}})[_0xfb2a('0xf')](function(_0x5c8789){if(!_0x5c8789||!_0x5c8789[_0xfb2a('0x1a')]){throw new db[(_0xfb2a('0x1f'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x523414=_0x5c8789;return db[_0xfb2a('0x3f')][_0xfb2a('0x28')]({'where':{'id':0x1}});})[_0xfb2a('0xf')](function(_0x4f62af){if(!_0x4f62af){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x40'));}_0x253c3e=_0x4f62af;if(!_0x253c3e['transcribe']||!_0x253c3e[_0xfb2a('0x41')]||!_0x253c3e['transcribeRegion']||!_0x253c3e['language']||!_0x253c3e[_0xfb2a('0x25')]){throw new db[(_0xfb2a('0x1f'))]['ValidationError'](_0xfb2a('0x42'));}return db[_0xfb2a('0x43')][_0xfb2a('0x28')]({'where':{'id':_0x253c3e[_0xfb2a('0x41')]}});})[_0xfb2a('0xf')](function(_0x320741){if(!_0x320741){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))](_0xfb2a('0x38'));}if(!_0x320741[_0xfb2a('0xd')]||!_0x320741[_0xfb2a('0x39')]){throw new db[(_0xfb2a('0x1f'))][(_0xfb2a('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0xef975f=_0x320741;var _0x18ca20=[];_0x523414[_0xfb2a('0x44')](function(_0x215d54){_0x18ca20[_0xfb2a('0x45')](checkTranscribeJob(_0x215d54,_0x253c3e,_0xef975f));});return BPromise[_0xfb2a('0x46')](_0x18ca20);})[_0xfb2a('0x3a')](function(_0x4fa6e6){if(_0x4fa6e6){if(!_0x4fa6e6[_0xfb2a('0x47')]||_0x4fa6e6[_0xfb2a('0x47')]!==_0xfb2a('0x48')){logger[_0xfb2a('0x3b')](util['inspect'](_0x4fa6e6,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index f1a32e4..4b36d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292e=['length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then'];(function(_0x129e21,_0xe1d40){var _0xa11438=function(_0xd68bba){while(--_0xd68bba){_0x129e21['push'](_0x129e21['shift']());}};_0xa11438(++_0xe1d40);}(_0x292e,0x1e0));var _0xe292=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x292e[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xe292('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require(_0xe292('0x1'));var db=require(_0xe292('0x2'))['db'];var logger=require('../logger')('schedule');config[_0xe292('0x3')]=_[_0xe292('0x4')](config[_0xe292('0x3')],{'host':_0xe292('0x5'),'port':0x18eb});var io=require(_0xe292('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0x12b303=[];return db[_0xe292('0x7')][_0xe292('0x8')]({'raw':!![],'attributes':['id',_0xe292('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe292('0xa')](0x18,_0xe292('0xb'))}}})[_0xe292('0xc')](function(_0x3fa2fe){if(_0x3fa2fe&&_0x3fa2fe[_0xe292('0xd')]){_0x12b303=_[_0xe292('0xe')](_0x3fa2fe||[],'id');logger[_0xe292('0xf')](_0xe292('0x10'),_0x12b303['join']());return db[_0xe292('0x7')][_0xe292('0x11')]({'closeReason':_0xe292('0x12'),'disposition':_0xe292('0x13'),'closed':!![],'closedAt':moment()[_0xe292('0x14')](_0xe292('0x15'))},{'where':{'id':_0x12b303}});}})[_0xe292('0xc')](function(){if(_0x12b303&&_0x12b303[_0xe292('0xd')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x12b303[_0xe292('0x16')]());for(var _0x572684=0x0;_0x572684<_0x12b303['length'];_0x572684++){io[_0xe292('0x17')](_0xe292('0x18'),{'id':_0x12b303[_0x572684],'closed':!![]});}}})[_0xe292('0x19')](function(_0x3038ea){logger[_0xe292('0x1a')](_0xe292('0x1b'),_0x3038ea?util['inspect'](_0x3038ea,{'showHidden':![],'depth':null}):'');});}exports[_0xe292('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x555d=['info','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','localhost','findAll','lastMsgAt','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3726f5,_0x338189){var _0x2918c5=function(_0x196d15){while(--_0x196d15){_0x3726f5['push'](_0x3726f5['shift']());}};_0x2918c5(++_0x338189);}(_0x555d,0x103));var _0xd555=function(_0x2d549a,_0x3f9945){_0x2d549a=_0x2d549a-0x0;var _0x5f5938=_0x555d[_0x2d549a];return _0x5f5938;};'use strict';var _=require(_0xd555('0x0'));var moment=require('moment');var Redis=require(_0xd555('0x1'));var util=require(_0xd555('0x2'));var config=require(_0xd555('0x3'));var db=require(_0xd555('0x4'))['db'];var logger=require('../logger')('schedule');config[_0xd555('0x5')]=_[_0xd555('0x6')](config[_0xd555('0x5')],{'host':_0xd555('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x254b72=[];return db['WhatsappInteraction'][_0xd555('0x8')]({'raw':!![],'attributes':['id',_0xd555('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xd555('0xa'))}}})[_0xd555('0xb')](function(_0x2e454f){if(_0x2e454f&&_0x2e454f[_0xd555('0xc')]){_0x254b72=_[_0xd555('0xd')](_0x2e454f||[],'id');logger['info'](_0xd555('0xe'),_0x254b72[_0xd555('0xf')]());return db[_0xd555('0x10')][_0xd555('0x11')]({'closeReason':_0xd555('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xd555('0x13')](_0xd555('0x14'))},{'where':{'id':_0x254b72}});}})[_0xd555('0xb')](function(){if(_0x254b72&&_0x254b72[_0xd555('0xc')]){logger[_0xd555('0x15')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x254b72[_0xd555('0xf')]());for(var _0x4d328d=0x0;_0x4d328d<_0x254b72['length'];_0x4d328d++){io[_0xd555('0x16')](_0xd555('0x17'),{'id':_0x254b72[_0x4d328d],'closed':!![]});}}})['catch'](function(_0x551c4c){logger[_0xd555('0x18')](_0xd555('0x19'),_0x551c4c?util[_0xd555('0x1a')](_0x551c4c,{'showHidden':![],'depth':null}):'');});}exports[_0xd555('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 8e897d1..95fef9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x698f=['@xcally.com','now','CmContact','bulkCreate','then','log','destroy','CmHopper','finished\x20populating','contacts2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x698f,0x8b));var _0xf698=function(_0x855b1c,_0x131bc8){_0x855b1c=_0x855b1c-0x0;var _0x5b4c9e=_0x698f[_0x855b1c];return _0x5b4c9e;};'use strict';var util=require(_0xf698('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf698('0x1')]({'id':i,'firstName':_0xf698('0x2')+i,'lastName':_0xf698('0x3')+i,'phone':0xf879fb460+i,'email':_0xf698('0x4')+i+_0xf698('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf698('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf698('0x6')](),'updatedAt':Date[_0xf698('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf698('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf698('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xf698('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf698('0x6')]()});}db[_0xf698('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xf698('0x7')][_0xf698('0x8')](contacts);})[_0xf698('0x9')](function(){console[_0xf698('0xa')]('finished\x20populating','contacts1');return db['CmHopper'][_0xf698('0xb')]({'where':{}});})[_0xf698('0x9')](function(){return db[_0xf698('0xc')][_0xf698('0x8')](hopper);})[_0xf698('0x9')](function(){console[_0xf698('0xa')](_0xf698('0xd'),'hopper1');return db[_0xf698('0x7')][_0xf698('0x8')](contacts2);})[_0xf698('0x9')](function(){console[_0xf698('0xa')]('finished\x20populating',_0xf698('0xe'));return db['CmHopper'][_0xf698('0x8')](hopper2);})[_0xf698('0x9')](function(){console[_0xf698('0xa')](_0xf698('0xd'),'hopper2');})[_0xf698('0xf')](function(_0x42522e){console[_0xf698('0xa')](_0x42522e);});
\ No newline at end of file
+var _0x1f20=['@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','now','Innocenzo'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x1f20,0x176));var _0x01f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f20[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0x01f2('0x0'));var db=require(_0x01f2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x01f2('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x01f2('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x01f2('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x01f2('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x01f2('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x01f2('0x5')+i,'lastName':_0x01f2('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x01f2('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x01f2('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x01f2('0x4')](),'updatedAt':Date[_0x01f2('0x4')]()});}db[_0x01f2('0x7')][_0x01f2('0x8')]({'where':{}})[_0x01f2('0x9')](function(){return db['CmContact'][_0x01f2('0xa')](contacts);})[_0x01f2('0x9')](function(){console[_0x01f2('0xb')](_0x01f2('0xc'),_0x01f2('0xd'));return db[_0x01f2('0xe')]['destroy']({'where':{}});})[_0x01f2('0x9')](function(){return db['CmHopper'][_0x01f2('0xa')](hopper);})[_0x01f2('0x9')](function(){console[_0x01f2('0xb')](_0x01f2('0xc'),_0x01f2('0xf'));return db[_0x01f2('0x7')][_0x01f2('0xa')](contacts2);})[_0x01f2('0x9')](function(){console[_0x01f2('0xb')](_0x01f2('0xc'),_0x01f2('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})[_0x01f2('0x9')](function(){console['log']('finished\x20populating',_0x01f2('0x11'));})[_0x01f2('0x12')](function(_0x3e9844){console[_0x01f2('0xb')](_0x3e9844);});
\ No newline at end of file
index 98ef981..b762752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97f6=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x2f3860,_0x2a86ed){var _0x2d5398=function(_0x2ef09b){while(--_0x2ef09b){_0x2f3860['push'](_0x2f3860['shift']());}};_0x2d5398(++_0x2a86ed);}(_0x97f6,0x9b));var _0x697f=function(_0x5b951b,_0x5838e3){_0x5b951b=_0x5b951b-0x0;var _0x37d083=_0x97f6[_0x5b951b];return _0x37d083;};'use strict';var util=require(_0x697f('0x0'));var db=require(_0x697f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x697f('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0x697f('0x3')](_0x697f('0x4'),_0x697f('0x5'),i),'email':util[_0x697f('0x3')](_0x697f('0x6'),_0x697f('0x5'),i),'role':_0x697f('0x5'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x697f('0x7'),'ws',_0x697f('0x8')],'disallow':[_0x697f('0x9')],'allow':[_0x697f('0xa')],'defaultuser':util[_0x697f('0x3')](_0x697f('0x4'),'agent',i),'encryption':_0x697f('0xb'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x697f('0xb'),'dtlsverify':'no','dtlscertfile':_0x697f('0xc'),'dtlsprivatekey':_0x697f('0xd'),'dtlssetup':_0x697f('0xe'),'callerid':util[_0x697f('0x3')]('\x22%s\x22\x20<%s>',util[_0x697f('0x3')](_0x697f('0x4'),'agent',i),0xfa0+i)});}db['User'][_0x697f('0xf')](users)[_0x697f('0x10')](function(){console[_0x697f('0x11')]('add\x20user');})['catch'](function(_0xdd2438){console['log'](_0xdd2438);});
\ No newline at end of file
+var _0x2585=['push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x2585,0x82));var _0x5258=function(_0x352645,_0x15b5d1){_0x352645=_0x352645-0x0;var _0xb2dbff=_0x2585[_0x352645];return _0xb2dbff;};'use strict';var util=require(_0x5258('0x0'));var db=require(_0x5258('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5258('0x2')]({'name':util[_0x5258('0x3')](_0x5258('0x4'),_0x5258('0x5'),i),'fullname':util[_0x5258('0x3')]('%s%s','agent',i),'email':util[_0x5258('0x3')](_0x5258('0x6'),_0x5258('0x5'),i),'role':_0x5258('0x5'),'password':_0x5258('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x5258('0x8'),'ws',_0x5258('0x9')],'disallow':['all'],'allow':[_0x5258('0xa')],'defaultuser':util['format'](_0x5258('0x4'),_0x5258('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':_0x5258('0xb'),'icesupport':_0x5258('0xb'),'dtlsenable':_0x5258('0xb'),'dtlsverify':'no','dtlscertfile':_0x5258('0xc'),'dtlsprivatekey':_0x5258('0xd'),'dtlssetup':_0x5258('0xe'),'callerid':util[_0x5258('0x3')](_0x5258('0xf'),util['format'](_0x5258('0x4'),'agent',i),0xfa0+i)});}db[_0x5258('0x10')][_0x5258('0x11')](users)[_0x5258('0x12')](function(){console[_0x5258('0x13')](_0x5258('0x14'));})[_0x5258('0x15')](function(_0x34892f){console['log'](_0x34892f);});
\ No newline at end of file
index 26beaf4..61baafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cfd=['address','connection','remoteAddress','request','remotePort','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','name','Agents','agent','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','map','User','where','telephone','type','ivr','format','%s:queue:%s','handshake','query','find','userProfileId','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','role','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','SmsQueue','MailQueue','OpenchannelQueues','Trunks','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','chat','fax','sms','whatsapp','campaign:%s:%s','leave','removeChatInteractions','length','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','setMaxListeners'];(function(_0x810c47,_0x583a77){var _0x4339c5=function(_0x2d0a9e){while(--_0x2d0a9e){_0x810c47['push'](_0x810c47['shift']());}};_0x4339c5(++_0x583a77);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd2cf('0x0'));var BPromise=require(_0xd2cf('0x1'));var db=require(_0xd2cf('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xd2cf('0x3')],'include':[{'as':_0xd2cf('0x4'),'model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xd2cf('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd2cf('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xd2cf('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xd2cf('0x3')],'where':{'role':_0xd2cf('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd2cf('0x3'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x1eddfc,_0x34c7fc,_0x5ac2d6){return db['UserProfileSection'][_0xd2cf('0x6')]({'where':{'name':_0x1eddfc,'userProfileId':_0x34c7fc},'raw':!![]})[_0xd2cf('0x7')](function(_0x4226b2){if(_0x4226b2){if(_0x4226b2['autoAssociation']){switch(_0x1eddfc){case _0xd2cf('0x8'):case _0xd2cf('0x9'):case _0xd2cf('0xa'):case _0xd2cf('0xb'):case _0xd2cf('0xc'):case'OpenchannelQueues':case _0xd2cf('0xd'):return db[_0x5ac2d6][_0xd2cf('0xe')](queryQueues);case _0xd2cf('0xf'):return db[_0x5ac2d6][_0xd2cf('0xe')](queryTelephones);case'Trunks':return db[_0x5ac2d6][_0xd2cf('0xe')](queryTrunks);case'IvrCampaigns':return db[_0x5ac2d6][_0xd2cf('0xe')](queryCampaigns);}}else{return db[_0xd2cf('0x10')]['findAll']({'attributes':[_0xd2cf('0x11')],'where':{'sectionId':_0x4226b2['id']},'raw':!![]})['then'](function(_0x462003){if(_0x462003){var _0x858651={'where':{'id':_[_0xd2cf('0x12')](_0x462003,_0xd2cf('0x11'))},'raw':!![]};switch(_0x5ac2d6){case _0xd2cf('0x13'):_0x858651[_0xd2cf('0x14')]['role']=_0xd2cf('0x15');break;case'Campaign':_0x858651[_0xd2cf('0x14')][_0xd2cf('0x16')]=_0xd2cf('0x17');break;}return db[_0x5ac2d6][_0xd2cf('0xe')](_0x858651);}else{return[];}});}}else{return[];}})[_0xd2cf('0x7')](function(_0x360454){return _0x360454;});}function joinOrLeaveQueues(_0x474e86,_0x128ac0,_0x3fea37,_0x13797a){_0x474e86[_0x128ac0](util[_0xd2cf('0x18')](_0xd2cf('0x19'),_0x3fea37,_0x13797a[_0xd2cf('0x3')]));if(_0x13797a[_0xd2cf('0x4')]){for(var _0x253df2=0x0;_0x253df2<_0x13797a['Agents']['length'];_0x253df2+=0x1){_0x474e86[_0x128ac0](util[_0xd2cf('0x18')]('user:%s',_0x13797a[_0xd2cf('0x4')][_0x253df2]['name']));}}}function joinOrLeave(_0x2e27f1,_0x13dde4,_0x4b44ee){var _0x476749;if(_0x2e27f1[_0xd2cf('0x1a')][_0xd2cf('0x1b')]['id']){db[_0xd2cf('0x13')][_0xd2cf('0x1c')]({'attributes':['id',_0xd2cf('0x3'),'role',_0xd2cf('0x1d')],'where':{'id':_0x2e27f1[_0xd2cf('0x1a')][_0xd2cf('0x1b')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xd2cf('0x1e'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd2cf('0x1f')],'as':_0xd2cf('0x20'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xd2cf('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xd2cf('0x22')],'as':_0xd2cf('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xd2cf('0x24')],'as':_0xd2cf('0x25'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x228158){if(_0x228158){_0x476749=_0x228158;_0x2e27f1[_0x13dde4](util[_0xd2cf('0x18')](_0xd2cf('0x26'),_0x228158['name']));var _0x25a7c1=[];switch(_0x228158[_0xd2cf('0x27')]){case'admin':_0x2e27f1[_0x13dde4](_0xd2cf('0x28'));_0x2e27f1[_0x13dde4](_0xd2cf('0x29'));if(queryQueues['hasOwnProperty'](_0xd2cf('0x2a'))){delete queryQueues[_0xd2cf('0x2a')];}_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x2c')][_0xd2cf('0xe')](queryQueues));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x2d')][_0xd2cf('0xe')](queryQueues));_0x25a7c1['push'](db['FaxQueue'][_0xd2cf('0xe')](queryQueues));_0x25a7c1[_0xd2cf('0x2b')](db['SmsQueue'][_0xd2cf('0xe')](queryQueues));_0x25a7c1['push'](db['MailQueue']['findAll'](queryQueues));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x2e')][_0xd2cf('0xe')](queryQueues));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x2f')][_0xd2cf('0xe')](queryQueues));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x13')]['findAll'](queryTelephones));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x30')][_0xd2cf('0xe')](queryTrunks));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x31')][_0xd2cf('0xe')](queryCampaigns));_0x25a7c1['push'](db[_0xd2cf('0x13')][_0xd2cf('0xe')](queryAgents));break;case _0xd2cf('0x32'):_0x2e27f1[_0x13dde4](_0xd2cf('0x28'));_0x2e27f1[_0x13dde4](_0xd2cf('0x29'));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0x8'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x2c')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0x9'),_0x228158['userProfileId'],_0xd2cf('0x2d')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources('FaxQueues',_0x228158[_0xd2cf('0x1d')],'FaxQueue'));_0x25a7c1['push'](getAssociatedResources(_0xd2cf('0xb'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x33')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0xc'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x34')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0x35'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x2e')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0xd'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x2f')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0xf'),_0x228158[_0xd2cf('0x1d')],_0xd2cf('0x13')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0x36'),_0x228158['userProfileId'],_0xd2cf('0x30')));_0x25a7c1[_0xd2cf('0x2b')](getAssociatedResources(_0xd2cf('0x37'),_0x228158['userProfileId'],_0xd2cf('0x31')));_0x25a7c1[_0xd2cf('0x2b')](db[_0xd2cf('0x13')][_0xd2cf('0xe')](queryAgents));break;case'agent':_0x2e27f1[_0x13dde4](_0xd2cf('0x28'));_0x2e27f1[_0x13dde4](_0xd2cf('0x29'));_0x25a7c1['push'](_0x228158[_0xd2cf('0x38')]({'attributes':['id',_0xd2cf('0x3')]}));_0x25a7c1[_0xd2cf('0x2b')](_0x228158['getChatQueues']({'attributes':['id','name']}));_0x25a7c1[_0xd2cf('0x2b')](_0x228158[_0xd2cf('0x39')]({'attributes':['id',_0xd2cf('0x3')]}));_0x25a7c1['push'](_0x228158[_0xd2cf('0x3a')]({'attributes':['id',_0xd2cf('0x3')]}));_0x25a7c1[_0xd2cf('0x2b')](_0x228158[_0xd2cf('0x3b')]({'attributes':['id',_0xd2cf('0x3')]}));_0x25a7c1[_0xd2cf('0x2b')](_0x228158['getOpenchannelQueues']({'attributes':['id','name']}));_0x25a7c1[_0xd2cf('0x2b')](_0x228158[_0xd2cf('0x3c')]({'attributes':['id',_0xd2cf('0x3')]}));break;}return BPromise['all'](_0x25a7c1);}})[_0xd2cf('0x7')](function(_0x47fcd7){if(_0x47fcd7&&_0x47fcd7['length']){for(var _0x57635d=0x0;_0x57635d<_0x47fcd7['length'];_0x57635d+=0x1){for(var _0x46bc4b=0x0;_0x46bc4b<_0x47fcd7[_0x57635d]['length'];_0x46bc4b+=0x1){switch(_0x57635d){case 0x0:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,'voice',_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x1:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,_0xd2cf('0x3d'),_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x2:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,_0xd2cf('0x3e'),_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x3:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,_0xd2cf('0x3f'),_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x4:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,'mail',_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x5:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,'openchannel',_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x6:joinOrLeaveQueues(_0x2e27f1,_0x13dde4,_0xd2cf('0x40'),_0x47fcd7[_0x57635d][_0x46bc4b]);break;case 0x7:if(_0x476749[_0xd2cf('0x27')]!==_0xd2cf('0x5'))_0x2e27f1[_0x13dde4](util[_0xd2cf('0x18')]('telephone:%s',_0x47fcd7[_0x57635d][_0x46bc4b]['name']));break;case 0x8:if(_0x476749[_0xd2cf('0x27')]!==_0xd2cf('0x5'))_0x2e27f1[_0x13dde4](util[_0xd2cf('0x18')]('trunk:%s',_0x47fcd7[_0x57635d][_0x46bc4b][_0xd2cf('0x3')]));break;case 0x9:if(_0x476749[_0xd2cf('0x27')]!=='agent')_0x2e27f1[_0x13dde4](util['format'](_0xd2cf('0x41'),_0x47fcd7[_0x57635d][_0x46bc4b]['type'],_0x47fcd7[_0x57635d][_0x46bc4b][_0xd2cf('0x3')]));break;case 0xa:_0x2e27f1[_0x13dde4](util['format'](_0xd2cf('0x26'),_0x47fcd7[_0x57635d][_0x46bc4b][_0xd2cf('0x3')]));break;}}}}})['then'](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x1a6ff9=_['map'](_0x476749[_0xd2cf('0x1e')],'id');return _0x476749[_0xd2cf('0x43')](_0x1a6ff9)['then'](function(){for(var _0x420c05=0x0;_0x420c05<_0x1a6ff9[_0xd2cf('0x44')];_0x420c05+=0x1){_0x4b44ee[_0xd2cf('0x45')](_0xd2cf('0x46'),{'ChatInteractionId':Number(_0x1a6ff9[_0x420c05]),'UserId':Number(_0x476749['id'])});}});}})[_0xd2cf('0x7')](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x2efcce=_[_0xd2cf('0x12')](_0x476749[_0xd2cf('0x47')],'id');return _0x476749['removeMailInteractions'](_0x2efcce)['then'](function(){for(var _0x1d97e1=0x0;_0x1d97e1<_0x2efcce[_0xd2cf('0x44')];_0x1d97e1+=0x1){_0x4b44ee[_0xd2cf('0x45')](_0xd2cf('0x48'),{'MailInteractionId':Number(_0x2efcce[_0x1d97e1]),'UserId':Number(_0x476749['id'])});}});}})['then'](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x488996=_['map'](_0x476749[_0xd2cf('0x20')],'id');return _0x476749['removeFaxInteractions'](_0x488996)[_0xd2cf('0x7')](function(){for(var _0x671706=0x0;_0x671706<_0x488996[_0xd2cf('0x44')];_0x671706+=0x1){_0x4b44ee[_0xd2cf('0x45')](_0xd2cf('0x49'),{'FaxInteractionId':Number(_0x488996[_0x671706]),'UserId':Number(_0x476749['id'])});}});}})[_0xd2cf('0x7')](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x4c7305=_[_0xd2cf('0x12')](_0x476749['SmsInteractions'],'id');return _0x476749[_0xd2cf('0x4a')](_0x4c7305)['then'](function(){for(var _0x196070=0x0;_0x196070<_0x4c7305['length'];_0x196070+=0x1){_0x4b44ee[_0xd2cf('0x45')](_0xd2cf('0x4b'),{'SmsInteractionId':Number(_0x4c7305[_0x196070]),'UserId':Number(_0x476749['id'])});}});}})[_0xd2cf('0x7')](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x17171a=_[_0xd2cf('0x12')](_0x476749['OpenchannelInteractions'],'id');return _0x476749['removeOpenchannelInteractions'](_0x17171a)['then'](function(){for(var _0x5a48ca=0x0;_0x5a48ca<_0x17171a['length'];_0x5a48ca+=0x1){_0x4b44ee[_0xd2cf('0x45')](_0xd2cf('0x4c'),{'OpenchannelInteractionId':Number(_0x17171a[_0x5a48ca]),'UserId':Number(_0x476749['id'])});}});}})['then'](function(){if(_0x13dde4===_0xd2cf('0x42')){var _0x1b7d3b=_[_0xd2cf('0x12')](_0x476749['WhatsappInteractions'],'id');return _0x476749[_0xd2cf('0x4d')](_0x1b7d3b)[_0xd2cf('0x7')](function(){for(var _0x5d470a=0x0;_0x5d470a<_0x1b7d3b[_0xd2cf('0x44')];_0x5d470a+=0x1){_0x4b44ee['emit'](_0xd2cf('0x4e'),{'WhatsappInteractionId':Number(_0x1b7d3b[_0x5d470a]),'UserId':Number(_0x476749['id'])});}});}})[_0xd2cf('0x4f')](function(_0x479071){_0x2e27f1[_0xd2cf('0x50')](_0x479071);});}}function onDisconnect(_0x1f20cb,_0x55465e){joinOrLeave(_0x1f20cb,_0xd2cf('0x42'),_0x55465e);}function onConnect(_0x1dd91d){joinOrLeave(_0x1dd91d,'join');}exports[_0xd2cf('0x51')]=function(_0x2867b2){_0x2867b2['on']('connection',function(_0x53af61){_0x53af61[_0xd2cf('0x52')](0x0);_0x53af61[_0xd2cf('0x53')]=_0x53af61['request'][_0xd2cf('0x54')][_0xd2cf('0x55')]+':'+_0x53af61[_0xd2cf('0x56')]['connection'][_0xd2cf('0x57')];_0x53af61['connectedAt']=new Date();_0x53af61[_0xd2cf('0x50')]=function(_0x2705cb){console[_0xd2cf('0x50')]('SocketIO\x20'+_0x53af61[_0xd2cf('0x58')][_0xd2cf('0x3')]+'['+_0x53af61[_0xd2cf('0x53')]+']',_0x2705cb);};_0x53af61['on'](_0xd2cf('0x59'),function(){onDisconnect(_0x53af61,_0x2867b2);_0x53af61[_0xd2cf('0x50')](_0xd2cf('0x5a'));});onConnect(_0x53af61);_0x53af61['log'](_0xd2cf('0x5b'));});};
\ No newline at end of file
+var _0x289e=['getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','Agents','User','role','agent','name','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','user','SmsQueues','SmsQueue','OpenchannelQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues'];(function(_0x5b9e83,_0x53f77c){var _0x5c1cba=function(_0x48de96){while(--_0x48de96){_0x5b9e83['push'](_0x5b9e83['shift']());}};_0x5c1cba(++_0x53f77c);}(_0x289e,0xea));var _0xe289=function(_0x1e3069,_0x4e064d){_0x1e3069=_0x1e3069-0x0;var _0x45c282=_0x289e[_0x1e3069];return _0x45c282;};'use strict';var _=require(_0xe289('0x0'));var util=require(_0xe289('0x1'));var BPromise=require('bluebird');var db=require(_0xe289('0x2'))['db'];var config=require(_0xe289('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xe289('0x4'),'model':db[_0xe289('0x5')],'attributes':['id','name',_0xe289('0x6')],'raw':!![],'where':{'role':_0xe289('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xe289('0x8')],'where':{'role':_0xe289('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xe289('0x8')]};var queryAgents={'raw':!![],'attributes':['id',_0xe289('0x8')],'where':{'role':_0xe289('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe289('0x8'),_0xe289('0xa')],'where':{'type':_0xe289('0xb')}};function getAssociatedResources(_0x4ee069,_0x1c3ed5,_0x64a0da){return db[_0xe289('0xc')]['findOne']({'where':{'name':_0x4ee069,'userProfileId':_0x1c3ed5},'raw':!![]})[_0xe289('0xd')](function(_0x529e25){if(_0x529e25){if(_0x529e25[_0xe289('0xe')]){switch(_0x4ee069){case _0xe289('0xf'):case'ChatQueues':case'FaxQueues':case'SmsQueues':case _0xe289('0x10'):case _0xe289('0x11'):case _0xe289('0x12'):return db[_0x64a0da][_0xe289('0x13')](queryQueues);case'Telephones':return db[_0x64a0da][_0xe289('0x13')](queryTelephones);case _0xe289('0x14'):return db[_0x64a0da][_0xe289('0x13')](queryTrunks);case _0xe289('0x15'):return db[_0x64a0da]['findAll'](queryCampaigns);}}else{return db[_0xe289('0x16')]['findAll']({'attributes':[_0xe289('0x17')],'where':{'sectionId':_0x529e25['id']},'raw':!![]})['then'](function(_0x3e283c){if(_0x3e283c){var _0x4b61b8={'where':{'id':_[_0xe289('0x18')](_0x3e283c,_0xe289('0x17'))},'raw':!![]};switch(_0x64a0da){case _0xe289('0x5'):_0x4b61b8[_0xe289('0x19')][_0xe289('0x6')]=_0xe289('0x9');break;case _0xe289('0x1a'):_0x4b61b8['where'][_0xe289('0xa')]=_0xe289('0xb');break;}return db[_0x64a0da][_0xe289('0x13')](_0x4b61b8);}else{return[];}});}}else{return[];}})[_0xe289('0xd')](function(_0x19fde1){return _0x19fde1;});}function joinOrLeaveQueues(_0xdd2497,_0x4367f3,_0x4720f3,_0x22d125){_0xdd2497[_0x4367f3](util[_0xe289('0x1b')](_0xe289('0x1c'),_0x4720f3,_0x22d125['name']));if(_0x22d125[_0xe289('0x4')]){for(var _0x5162d6=0x0;_0x5162d6<_0x22d125['Agents'][_0xe289('0x1d')];_0x5162d6+=0x1){_0xdd2497[_0x4367f3](util[_0xe289('0x1b')](_0xe289('0x1e'),_0x22d125[_0xe289('0x4')][_0x5162d6][_0xe289('0x8')]));}}}function joinOrLeave(_0x344870,_0x40b4fd,_0x40bc26){var _0x21e2c8;if(_0x344870[_0xe289('0x1f')]['query']['id']){db[_0xe289('0x5')][_0xe289('0x20')]({'attributes':['id',_0xe289('0x8'),_0xe289('0x6'),_0xe289('0x21')],'where':{'id':_0x344870[_0xe289('0x1f')][_0xe289('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe289('0x23')],'as':_0xe289('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xe289('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe289('0x26')],'as':_0xe289('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xe289('0x28')],'as':_0xe289('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xe289('0x2a')],'as':_0xe289('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xc4c7c6){if(_0xc4c7c6){_0x21e2c8=_0xc4c7c6;_0x344870[_0x40b4fd](util[_0xe289('0x1b')](_0xe289('0x1e'),_0xc4c7c6[_0xe289('0x8')]));var _0x12eb23=[];switch(_0xc4c7c6[_0xe289('0x6')]){case'admin':_0x344870[_0x40b4fd]('voice:inbound');_0x344870[_0x40b4fd](_0xe289('0x2c'));if(queryQueues[_0xe289('0x2d')](_0xe289('0x2e'))){delete queryQueues[_0xe289('0x2e')];}_0x12eb23[_0xe289('0x2f')](db[_0xe289('0x30')][_0xe289('0x13')](queryQueues));_0x12eb23['push'](db[_0xe289('0x31')][_0xe289('0x13')](queryQueues));_0x12eb23['push'](db[_0xe289('0x32')][_0xe289('0x13')](queryQueues));_0x12eb23[_0xe289('0x2f')](db['SmsQueue']['findAll'](queryQueues));_0x12eb23[_0xe289('0x2f')](db[_0xe289('0x33')][_0xe289('0x13')](queryQueues));_0x12eb23[_0xe289('0x2f')](db['OpenchannelQueue'][_0xe289('0x13')](queryQueues));_0x12eb23[_0xe289('0x2f')](db[_0xe289('0x34')][_0xe289('0x13')](queryQueues));_0x12eb23['push'](db[_0xe289('0x5')][_0xe289('0x13')](queryTelephones));_0x12eb23['push'](db['Trunk'][_0xe289('0x13')](queryTrunks));_0x12eb23[_0xe289('0x2f')](db[_0xe289('0x1a')]['findAll'](queryCampaigns));_0x12eb23[_0xe289('0x2f')](db['User'][_0xe289('0x13')](queryAgents));break;case _0xe289('0x35'):_0x344870[_0x40b4fd]('voice:inbound');_0x344870[_0x40b4fd](_0xe289('0x2c'));_0x12eb23['push'](getAssociatedResources(_0xe289('0xf'),_0xc4c7c6[_0xe289('0x21')],_0xe289('0x30')));_0x12eb23['push'](getAssociatedResources('ChatQueues',_0xc4c7c6[_0xe289('0x21')],_0xe289('0x31')));_0x12eb23['push'](getAssociatedResources('FaxQueues',_0xc4c7c6['userProfileId'],_0xe289('0x32')));_0x12eb23['push'](getAssociatedResources(_0xe289('0x36'),_0xc4c7c6[_0xe289('0x21')],_0xe289('0x37')));_0x12eb23[_0xe289('0x2f')](getAssociatedResources(_0xe289('0x10'),_0xc4c7c6[_0xe289('0x21')],_0xe289('0x33')));_0x12eb23[_0xe289('0x2f')](getAssociatedResources('OpenchannelQueues',_0xc4c7c6[_0xe289('0x21')],_0xe289('0x38')));_0x12eb23[_0xe289('0x2f')](getAssociatedResources(_0xe289('0x12'),_0xc4c7c6['userProfileId'],_0xe289('0x34')));_0x12eb23['push'](getAssociatedResources('Telephones',_0xc4c7c6[_0xe289('0x21')],_0xe289('0x5')));_0x12eb23['push'](getAssociatedResources(_0xe289('0x14'),_0xc4c7c6['userProfileId'],_0xe289('0x39')));_0x12eb23[_0xe289('0x2f')](getAssociatedResources(_0xe289('0x15'),_0xc4c7c6[_0xe289('0x21')],_0xe289('0x1a')));_0x12eb23['push'](db['User'][_0xe289('0x13')](queryAgents));break;case _0xe289('0x7'):_0x344870[_0x40b4fd](_0xe289('0x3a'));_0x344870[_0x40b4fd]('voice:outbound');_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x3b')]({'attributes':['id',_0xe289('0x8')]}));_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x3c')]({'attributes':['id',_0xe289('0x8')]}));_0x12eb23['push'](_0xc4c7c6[_0xe289('0x3d')]({'attributes':['id',_0xe289('0x8')]}));_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x3e')]({'attributes':['id','name']}));_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x3f')]({'attributes':['id',_0xe289('0x8')]}));_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x40')]({'attributes':['id',_0xe289('0x8')]}));_0x12eb23[_0xe289('0x2f')](_0xc4c7c6[_0xe289('0x41')]({'attributes':['id',_0xe289('0x8')]}));break;}return BPromise[_0xe289('0x42')](_0x12eb23);}})['then'](function(_0x1e2c8a){if(_0x1e2c8a&&_0x1e2c8a[_0xe289('0x1d')]){for(var _0x3aabbd=0x0;_0x3aabbd<_0x1e2c8a[_0xe289('0x1d')];_0x3aabbd+=0x1){for(var _0x26d7ea=0x0;_0x26d7ea<_0x1e2c8a[_0x3aabbd][_0xe289('0x1d')];_0x26d7ea+=0x1){switch(_0x3aabbd){case 0x0:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x43'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x1:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x44'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x2:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x45'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x3:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x46'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x4:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x47'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x5:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x48'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x6:joinOrLeaveQueues(_0x344870,_0x40b4fd,_0xe289('0x49'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]);break;case 0x7:if(_0x21e2c8[_0xe289('0x6')]!==_0xe289('0x7'))_0x344870[_0x40b4fd](util[_0xe289('0x1b')](_0xe289('0x4a'),_0x1e2c8a[_0x3aabbd][_0x26d7ea][_0xe289('0x8')]));break;case 0x8:if(_0x21e2c8[_0xe289('0x6')]!==_0xe289('0x7'))_0x344870[_0x40b4fd](util[_0xe289('0x1b')](_0xe289('0x4b'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]['name']));break;case 0x9:if(_0x21e2c8[_0xe289('0x6')]!==_0xe289('0x7'))_0x344870[_0x40b4fd](util[_0xe289('0x1b')]('campaign:%s:%s',_0x1e2c8a[_0x3aabbd][_0x26d7ea][_0xe289('0xa')],_0x1e2c8a[_0x3aabbd][_0x26d7ea]['name']));break;case 0xa:_0x344870[_0x40b4fd](util['format'](_0xe289('0x1e'),_0x1e2c8a[_0x3aabbd][_0x26d7ea]['name']));break;}}}}})[_0xe289('0xd')](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x3e6400=_[_0xe289('0x18')](_0x21e2c8[_0xe289('0x4d')],'id');return _0x21e2c8[_0xe289('0x4e')](_0x3e6400)[_0xe289('0xd')](function(){for(var _0x153029=0x0;_0x153029<_0x3e6400[_0xe289('0x1d')];_0x153029+=0x1){_0x40bc26[_0xe289('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3e6400[_0x153029]),'UserId':Number(_0x21e2c8['id'])});}});}})['then'](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x3e4a37=_[_0xe289('0x18')](_0x21e2c8[_0xe289('0x24')],'id');return _0x21e2c8[_0xe289('0x50')](_0x3e4a37)[_0xe289('0xd')](function(){for(var _0x4f8138=0x0;_0x4f8138<_0x3e4a37[_0xe289('0x1d')];_0x4f8138+=0x1){_0x40bc26['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3e4a37[_0x4f8138]),'UserId':Number(_0x21e2c8['id'])});}});}})['then'](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x4bec85=_['map'](_0x21e2c8['FaxInteractions'],'id');return _0x21e2c8[_0xe289('0x51')](_0x4bec85)[_0xe289('0xd')](function(){for(var _0x5b26c9=0x0;_0x5b26c9<_0x4bec85[_0xe289('0x1d')];_0x5b26c9+=0x1){_0x40bc26[_0xe289('0x4f')](_0xe289('0x52'),{'FaxInteractionId':Number(_0x4bec85[_0x5b26c9]),'UserId':Number(_0x21e2c8['id'])});}});}})[_0xe289('0xd')](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x347ac3=_['map'](_0x21e2c8[_0xe289('0x27')],'id');return _0x21e2c8[_0xe289('0x53')](_0x347ac3)[_0xe289('0xd')](function(){for(var _0x3e19be=0x0;_0x3e19be<_0x347ac3[_0xe289('0x1d')];_0x3e19be+=0x1){_0x40bc26[_0xe289('0x4f')](_0xe289('0x54'),{'SmsInteractionId':Number(_0x347ac3[_0x3e19be]),'UserId':Number(_0x21e2c8['id'])});}});}})['then'](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x40e59e=_[_0xe289('0x18')](_0x21e2c8[_0xe289('0x29')],'id');return _0x21e2c8[_0xe289('0x55')](_0x40e59e)[_0xe289('0xd')](function(){for(var _0x31739d=0x0;_0x31739d<_0x40e59e[_0xe289('0x1d')];_0x31739d+=0x1){_0x40bc26[_0xe289('0x4f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x40e59e[_0x31739d]),'UserId':Number(_0x21e2c8['id'])});}});}})[_0xe289('0xd')](function(){if(_0x40b4fd===_0xe289('0x4c')){var _0x59540f=_[_0xe289('0x18')](_0x21e2c8['WhatsappInteractions'],'id');return _0x21e2c8[_0xe289('0x56')](_0x59540f)[_0xe289('0xd')](function(){for(var _0x5809f6=0x0;_0x5809f6<_0x59540f[_0xe289('0x1d')];_0x5809f6+=0x1){_0x40bc26[_0xe289('0x4f')](_0xe289('0x57'),{'WhatsappInteractionId':Number(_0x59540f[_0x5809f6]),'UserId':Number(_0x21e2c8['id'])});}});}})[_0xe289('0x58')](function(_0x57d268){_0x344870[_0xe289('0x59')](_0x57d268);});}}function onDisconnect(_0xea159f,_0x5f5a3c){joinOrLeave(_0xea159f,_0xe289('0x4c'),_0x5f5a3c);}function onConnect(_0x4f0a6c){joinOrLeave(_0x4f0a6c,'join');}exports['default']=function(_0x526c6f){_0x526c6f['on'](_0xe289('0x5a'),function(_0x5a45f4){_0x5a45f4['setMaxListeners'](0x0);_0x5a45f4[_0xe289('0x5b')]=_0x5a45f4[_0xe289('0x5c')][_0xe289('0x5a')]['remoteAddress']+':'+_0x5a45f4[_0xe289('0x5c')][_0xe289('0x5a')][_0xe289('0x5d')];_0x5a45f4[_0xe289('0x5e')]=new Date();_0x5a45f4[_0xe289('0x59')]=function(_0x267f3c){console['log'](_0xe289('0x5f')+_0x5a45f4[_0xe289('0x60')][_0xe289('0x8')]+'['+_0x5a45f4[_0xe289('0x5b')]+']',_0x267f3c);};_0x5a45f4['on'](_0xe289('0x61'),function(){onDisconnect(_0x5a45f4,_0x526c6f);_0x5a45f4[_0xe289('0x59')]('DISCONNECTED');});onConnect(_0x5a45f4);_0x5a45f4[_0xe289('0x59')](_0xe289('0x62'));});};
\ No newline at end of file
index 600cb52..73eb30a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd21=['contact','closed','User','email','agent','model','hook','toLowerCase','condition','util','../../mysqldb','triggers','lodash','client','ChatInteraction','afterCreate','newinteraction','Chat','closedinteraction','ChatMessage','Sms','SmsInteraction','afterUpdate','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','get','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','then','find','UserId','name','internal','format','SIP/%s','channel','incomingmessage','catch','outgoingmessage','opened'];(function(_0x21fafa,_0x3940a1){var _0x50edb5=function(_0x41ba42){while(--_0x41ba42){_0x21fafa['push'](_0x21fafa['shift']());}};_0x50edb5(++_0x3940a1);}(_0xdd21,0x89));var _0x1dd2=function(_0x552e94,_0x110f92){_0x552e94=_0x552e94-0x0;var _0x12587b=_0xdd21[_0x552e94];return _0x12587b;};'use strict';var util=require(_0x1dd2('0x0'));var db=require(_0x1dd2('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x1dd2('0x2'));var _=require(_0x1dd2('0x3'));var client=jayson[_0x1dd2('0x4')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x1dd2('0x5'),'event':_0x1dd2('0x6'),'condition':_0x1dd2('0x7'),'callback':afterCreate},{'channel':_0x1dd2('0x8'),'model':'ChatInteraction','event':'afterUpdate','condition':_0x1dd2('0x9'),'callback':afterUpdate},{'channel':_0x1dd2('0x8'),'model':_0x1dd2('0xa'),'event':_0x1dd2('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x1dd2('0xb'),'model':_0x1dd2('0xc'),'event':_0x1dd2('0xd'),'condition':_0x1dd2('0x9'),'callback':afterUpdate},{'channel':_0x1dd2('0xb'),'model':_0x1dd2('0xe'),'event':_0x1dd2('0x6'),'condition':_0x1dd2('0xf'),'callback':afterCreateMessage},{'channel':_0x1dd2('0x10'),'model':_0x1dd2('0x11'),'event':_0x1dd2('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x1dd2('0x11'),'event':_0x1dd2('0xd'),'condition':_0x1dd2('0x9'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x1dd2('0x12'),'event':'afterCreate','condition':_0x1dd2('0xf'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x1dd2('0x13'),'event':_0x1dd2('0x6'),'condition':_0x1dd2('0x7'),'callback':afterCreate},{'channel':_0x1dd2('0x14'),'model':'FaxInteraction','event':_0x1dd2('0xd'),'condition':_0x1dd2('0x9'),'callback':afterUpdate},{'channel':_0x1dd2('0x14'),'model':_0x1dd2('0x15'),'event':_0x1dd2('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1dd2('0x16'),'model':_0x1dd2('0x17'),'event':'afterCreate','condition':_0x1dd2('0x7'),'callback':afterCreate},{'channel':_0x1dd2('0x16'),'model':_0x1dd2('0x17'),'event':_0x1dd2('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1dd2('0x16'),'model':_0x1dd2('0x18'),'event':'afterCreate','condition':_0x1dd2('0xf'),'callback':afterCreateMessage},{'channel':_0x1dd2('0x19'),'model':_0x1dd2('0x1a'),'event':_0x1dd2('0x6'),'condition':_0x1dd2('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x1dd2('0x1a'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1dd2('0x19'),'model':_0x1dd2('0x1b'),'event':_0x1dd2('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x45f890){return client[_0x1dd2('0x1c')](_0x1dd2('0x1d'),_0x45f890)['then'](function(_0x564bac){logger[_0x1dd2('0x1e')](_0x1dd2('0x1f'),_0x1dd2('0x1d'),_0x564bac);if(_0x564bac[_0x1dd2('0x20')]){if(_0x564bac[_0x1dd2('0x20')]['code']===0x1f4){logger[_0x1dd2('0x20')]('Trigger,\x20%s',_0x1dd2('0x1d'),_0x564bac[_0x1dd2('0x20')]);}}})['catch'](function(_0x122985){logger[_0x1dd2('0x20')](_0x1dd2('0x1f'),_0x1dd2('0x1d'),_0x122985);});}function afterCreateMessage(_0x20511b,_0x298637){return function(_0x124eee,_0x3e4572){_0x124eee=_0x124eee[_0x1dd2('0x21')]({'plain':!![]});_0x124eee['channel']=_0x20511b;_0x124eee[_0x1dd2('0x22')]=_0x124eee[_0x1dd2('0x23')];var _0x3ff0ca=_0x1dd2('0x24')+_0x124eee[_0x1dd2('0x25')];return db[_0x1dd2('0x26')][_0x1dd2('0x27')](_0x3ff0ca,{'type':db[_0x1dd2('0x28')][_0x1dd2('0x29')][_0x1dd2('0x2a')],'raw':!![]})['then'](function(_0x3de3b0){return _0x3de3b0;})[_0x1dd2('0x2b')](function(_0x5a03ca){if(_0x5a03ca){_0x124eee['contact']=_0x5a03ca[0x0];}if(_0x124eee['UserId']){return db['User'][_0x1dd2('0x2c')]({'where':{'id':_0x124eee[_0x1dd2('0x2d')]},'attributes':['id',_0x1dd2('0x2e'),'fullname','email',_0x1dd2('0x2f')],'raw':!![]})[_0x1dd2('0x2b')](function(_0x44a8e5){_0x124eee['interface']=util[_0x1dd2('0x30')](_0x1dd2('0x31'),_0x44a8e5[_0x1dd2('0x2e')]);_0x124eee[_0x1dd2('0x32')]=_0x20511b;_0x124eee['agent']=_0x44a8e5;return request({'event':_0x1dd2('0x33'),'message':_0x124eee});})[_0x1dd2('0x34')](function(_0x243614){console[_0x1dd2('0x20')](_0x243614);});}else{return request({'event':_0x1dd2('0x35'),'message':_0x124eee});}});};}function afterCreate(_0x37a82c,_0x1bca78){return function(_0x1ba2f0,_0x5cd205){_0x1ba2f0=_0x1ba2f0[_0x1dd2('0x21')]({'plain':!![]});_0x1ba2f0[_0x1dd2('0x32')]=_0x37a82c;_0x1ba2f0[_0x1dd2('0x22')]=_0x1dd2('0x36');var _0x3c85c1=_0x1dd2('0x24')+_0x1ba2f0['ContactId'];return db[_0x1dd2('0x26')][_0x1dd2('0x27')](_0x3c85c1,{'type':db[_0x1dd2('0x28')][_0x1dd2('0x29')][_0x1dd2('0x2a')],'raw':!![]})[_0x1dd2('0x2b')](function(_0x9c29cd){return _0x9c29cd;})[_0x1dd2('0x2b')](function(_0x535dfb){if(_0x535dfb){_0x1ba2f0[_0x1dd2('0x37')]=_0x535dfb[0x0];}return request({'event':_0x1bca78,'message':_0x1ba2f0});});};}function afterUpdate(_0x13068a,_0x41ec1b){return function(_0x1d650c,_0x1ea08d){if(_0x1d650c['changed'](_0x1dd2('0x38'))&&_0x1d650c[_0x1dd2('0x38')]){_0x1d650c=_0x1d650c[_0x1dd2('0x21')]({'plain':!![]});_0x1d650c[_0x1dd2('0x32')]=_0x13068a;_0x1d650c[_0x1dd2('0x22')]='closed';var _0x1432c1=_0x1dd2('0x24')+_0x1d650c['ContactId'];return db[_0x1dd2('0x26')]['query'](_0x1432c1,{'type':db[_0x1dd2('0x28')][_0x1dd2('0x29')]['SELECT'],'raw':!![]})[_0x1dd2('0x2b')](function(_0x225e0a){return _0x225e0a;})[_0x1dd2('0x2b')](function(_0x6b3f97){if(_0x6b3f97){_0x1d650c['contact']=_0x6b3f97[0x0];}if(_0x1d650c['UserId']){return db[_0x1dd2('0x39')][_0x1dd2('0x2c')]({'where':{'id':_0x1d650c['UserId']},'attributes':['id',_0x1dd2('0x2e'),'fullname',_0x1dd2('0x3a'),'internal'],'raw':!![]})[_0x1dd2('0x2b')](function(_0x8800e){_0x1d650c['interface']=util[_0x1dd2('0x30')](_0x1dd2('0x31'),_0x8800e[_0x1dd2('0x2e')]);_0x1d650c[_0x1dd2('0x3b')]=_0x8800e;return request({'event':_0x41ec1b,'message':_0x1d650c});})[_0x1dd2('0x34')](function(_0x54a852){console[_0x1dd2('0x20')](_0x54a852);});}else{return request({'event':_0x41ec1b,'message':_0x1d650c});}});}};}exports['default']=function(){for(var _0x3d63d6=0x0;_0x3d63d6<triggers['length'];_0x3d63d6+=0x1){if(db['hasOwnProperty'](triggers[_0x3d63d6][_0x1dd2('0x3c')])){db[triggers[_0x3d63d6]['model']][_0x1dd2('0x3d')](triggers[_0x3d63d6][_0x1dd2('0x22')],triggers[_0x3d63d6]['callback'](triggers[_0x3d63d6][_0x1dd2('0x32')][_0x1dd2('0x3e')](),triggers[_0x3d63d6][_0x1dd2('0x3f')]));}}};
\ No newline at end of file
+var _0x7521=['newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','request','EventManager','then','error','code','Trigger,\x20%s','catch','get','channel','event','ContactId','sequelize','Sequelize','SELECT','contact','UserId','User','find','name','fullname','email','internal','interface','agent','incomingmessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','QueryTypes','changed','closed','format','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x7521,0x18f));var _0x1752=function(_0x219c98,_0x2b9ff5){_0x219c98=_0x219c98-0x0;var _0x2862bd=_0x7521[_0x219c98];return _0x2862bd;};'use strict';var util=require(_0x1752('0x0'));var db=require(_0x1752('0x1'))['db'];var jayson=require(_0x1752('0x2'));var logger=require(_0x1752('0x3'))(_0x1752('0x4'));var _=require(_0x1752('0x5'));var client=jayson[_0x1752('0x6')][_0x1752('0x7')]({'port':0x232a});var triggers=[{'channel':_0x1752('0x8'),'model':_0x1752('0x9'),'event':_0x1752('0xa'),'condition':_0x1752('0xb'),'callback':afterCreate},{'channel':_0x1752('0x8'),'model':_0x1752('0x9'),'event':_0x1752('0xc'),'condition':_0x1752('0xd'),'callback':afterUpdate},{'channel':_0x1752('0x8'),'model':_0x1752('0xe'),'event':_0x1752('0xa'),'condition':_0x1752('0xf'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x1752('0x10'),'event':_0x1752('0xa'),'condition':_0x1752('0xb'),'callback':afterCreate},{'channel':_0x1752('0x11'),'model':_0x1752('0x10'),'event':_0x1752('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1752('0x11'),'model':_0x1752('0x12'),'event':_0x1752('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1752('0x13'),'model':_0x1752('0x14'),'event':_0x1752('0xa'),'condition':_0x1752('0xb'),'callback':afterCreate},{'channel':_0x1752('0x13'),'model':_0x1752('0x14'),'event':'afterUpdate','condition':_0x1752('0xd'),'callback':afterUpdate},{'channel':_0x1752('0x13'),'model':_0x1752('0x15'),'event':_0x1752('0xa'),'condition':_0x1752('0xf'),'callback':afterCreateMessage},{'channel':_0x1752('0x16'),'model':_0x1752('0x17'),'event':_0x1752('0xa'),'condition':_0x1752('0xb'),'callback':afterCreate},{'channel':_0x1752('0x16'),'model':_0x1752('0x17'),'event':_0x1752('0xc'),'condition':_0x1752('0xd'),'callback':afterUpdate},{'channel':_0x1752('0x16'),'model':_0x1752('0x18'),'event':_0x1752('0xa'),'condition':_0x1752('0xf'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x1752('0x19'),'event':_0x1752('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x1752('0x1a'),'model':_0x1752('0x19'),'event':'afterUpdate','condition':_0x1752('0xd'),'callback':afterUpdate},{'channel':_0x1752('0x1a'),'model':_0x1752('0x1b'),'event':_0x1752('0xa'),'condition':_0x1752('0xf'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x1752('0x1c'),'event':'afterCreate','condition':_0x1752('0xb'),'callback':afterCreate},{'channel':_0x1752('0x1d'),'model':'OpenchannelInteraction','event':_0x1752('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1752('0x1d'),'model':'OpenchannelMessage','event':_0x1752('0xa'),'condition':_0x1752('0xf'),'callback':afterCreateMessage}];function request(_0x5150b2){return client[_0x1752('0x1e')](_0x1752('0x1f'),_0x5150b2)[_0x1752('0x20')](function(_0x581f64){logger['info']('Trigger,\x20%s',_0x1752('0x1f'),_0x581f64);if(_0x581f64[_0x1752('0x21')]){if(_0x581f64['error'][_0x1752('0x22')]===0x1f4){logger[_0x1752('0x21')](_0x1752('0x23'),_0x1752('0x1f'),_0x581f64[_0x1752('0x21')]);}}})[_0x1752('0x24')](function(_0x2602bb){logger['error'](_0x1752('0x23'),_0x1752('0x1f'),_0x2602bb);});}function afterCreateMessage(_0x72151b,_0x5e326d){return function(_0x5b28f7,_0x20b0a9){_0x5b28f7=_0x5b28f7[_0x1752('0x25')]({'plain':!![]});_0x5b28f7[_0x1752('0x26')]=_0x72151b;_0x5b28f7[_0x1752('0x27')]=_0x5b28f7['direction'];var _0x5564d0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b28f7[_0x1752('0x28')];return db[_0x1752('0x29')]['query'](_0x5564d0,{'type':db[_0x1752('0x2a')]['QueryTypes'][_0x1752('0x2b')],'raw':!![]})['then'](function(_0xd0b64f){return _0xd0b64f;})[_0x1752('0x20')](function(_0x533eff){if(_0x533eff){_0x5b28f7[_0x1752('0x2c')]=_0x533eff[0x0];}if(_0x5b28f7[_0x1752('0x2d')]){return db[_0x1752('0x2e')][_0x1752('0x2f')]({'where':{'id':_0x5b28f7[_0x1752('0x2d')]},'attributes':['id',_0x1752('0x30'),_0x1752('0x31'),_0x1752('0x32'),_0x1752('0x33')],'raw':!![]})[_0x1752('0x20')](function(_0x41a0b8){_0x5b28f7[_0x1752('0x34')]=util['format']('SIP/%s',_0x41a0b8[_0x1752('0x30')]);_0x5b28f7[_0x1752('0x26')]=_0x72151b;_0x5b28f7[_0x1752('0x35')]=_0x41a0b8;return request({'event':_0x1752('0x36'),'message':_0x5b28f7});})[_0x1752('0x24')](function(_0x1e96f5){console[_0x1752('0x21')](_0x1e96f5);});}else{return request({'event':_0x1752('0x37'),'message':_0x5b28f7});}});};}function afterCreate(_0x2ab7f3,_0x2c7e03){return function(_0x3118d8,_0x455ac8){_0x3118d8=_0x3118d8['get']({'plain':!![]});_0x3118d8['channel']=_0x2ab7f3;_0x3118d8['event']=_0x1752('0x38');var _0x25ecc8=_0x1752('0x39')+_0x3118d8['ContactId'];return db[_0x1752('0x29')][_0x1752('0x3a')](_0x25ecc8,{'type':db[_0x1752('0x2a')][_0x1752('0x3b')][_0x1752('0x2b')],'raw':!![]})['then'](function(_0x243108){return _0x243108;})[_0x1752('0x20')](function(_0x5608bf){if(_0x5608bf){_0x3118d8[_0x1752('0x2c')]=_0x5608bf[0x0];}return request({'event':_0x2c7e03,'message':_0x3118d8});});};}function afterUpdate(_0xc396f4,_0x3b5c92){return function(_0x3646cb,_0x1d48a7){if(_0x3646cb[_0x1752('0x3c')](_0x1752('0x3d'))&&_0x3646cb[_0x1752('0x3d')]){_0x3646cb=_0x3646cb[_0x1752('0x25')]({'plain':!![]});_0x3646cb[_0x1752('0x26')]=_0xc396f4;_0x3646cb[_0x1752('0x27')]=_0x1752('0x3d');var _0xa38465=_0x1752('0x39')+_0x3646cb[_0x1752('0x28')];return db[_0x1752('0x29')][_0x1752('0x3a')](_0xa38465,{'type':db['Sequelize'][_0x1752('0x3b')][_0x1752('0x2b')],'raw':!![]})[_0x1752('0x20')](function(_0x3ecc1d){return _0x3ecc1d;})[_0x1752('0x20')](function(_0x144f69){if(_0x144f69){_0x3646cb['contact']=_0x144f69[0x0];}if(_0x3646cb[_0x1752('0x2d')]){return db[_0x1752('0x2e')][_0x1752('0x2f')]({'where':{'id':_0x3646cb[_0x1752('0x2d')]},'attributes':['id',_0x1752('0x30'),_0x1752('0x31'),_0x1752('0x32'),_0x1752('0x33')],'raw':!![]})[_0x1752('0x20')](function(_0x5733cd){_0x3646cb[_0x1752('0x34')]=util[_0x1752('0x3e')]('SIP/%s',_0x5733cd[_0x1752('0x30')]);_0x3646cb[_0x1752('0x35')]=_0x5733cd;return request({'event':_0x3b5c92,'message':_0x3646cb});})[_0x1752('0x24')](function(_0x1b5ba8){console[_0x1752('0x21')](_0x1b5ba8);});}else{return request({'event':_0x3b5c92,'message':_0x3646cb});}});}};}exports['default']=function(){for(var _0x44df4d=0x0;_0x44df4d<triggers[_0x1752('0x3f')];_0x44df4d+=0x1){if(db['hasOwnProperty'](triggers[_0x44df4d][_0x1752('0x40')])){db[triggers[_0x44df4d][_0x1752('0x40')]][_0x1752('0x41')](triggers[_0x44df4d][_0x1752('0x27')],triggers[_0x44df4d][_0x1752('0x42')](triggers[_0x44df4d][_0x1752('0x26')][_0x1752('0x43')](),triggers[_0x44df4d][_0x1752('0x44')]));}}};
\ No newline at end of file
index 02b430d..4d55c72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x672b=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','openchannel','getChannels','isValidChannel'];(function(_0x3fcee9,_0x10ae0c){var _0x4eadda=function(_0x2b668d){while(--_0x2b668d){_0x3fcee9['push'](_0x3fcee9['shift']());}};_0x4eadda(++_0x10ae0c);}(_0x672b,0x15d));var _0xb672=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x672b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb672('0x0'));var BPromise=require(_0xb672('0x1'));var db=require(_0xb672('0x2'))['db'];var util=require(_0xb672('0x3'));var channels=['voice',_0xb672('0x4'),_0xb672('0x5'),_0xb672('0x6'),_0xb672('0x7'),'whatsapp',_0xb672('0x8')];exports[_0xb672('0x9')]=function(){return channels;};exports[_0xb672('0xa')]=function(_0x2caf38){_0x2caf38=_0x2caf38['toLowerCase']();return _[_0xb672('0xb')](channels,_0x2caf38);};exports[_0xb672('0xc')]=function(_0x1d9cea,_0x14c9db,_0x4473fd,_0x5f1019){var _0x3a161e={'loginAttempts':_0x14c9db,'blocked':_0x4473fd};if(!_[_0xb672('0xd')](_0x5f1019)){_0x3a161e[_0xb672('0xe')]=_0x5f1019;}return _0x1d9cea[_0xb672('0xf')](_0x3a161e);};exports['getLicense']=function(_0x1e6ef1){return new BPromise(function(_0x56f812,_0xaee384){var _0x3aa348=0x0;if(_0x1e6ef1['role']!==_0xb672('0x10')){_0x56f812(_0x1e6ef1);}db[_0xb672('0x11')][_0xb672('0x12')]({'where':{'role':_0xb672('0x10'),'online':!![],'id':{'$ne':_0x1e6ef1['id']}}})[_0xb672('0x13')](function(_0x1d77fc){_0x3aa348=_0x1d77fc;return util[_0xb672('0x14')]();})[_0xb672('0x13')](function(_0x5acbd1){if(_0x5acbd1&&_0x5acbd1[_0xb672('0x15')]&&_0x3aa348>=_0x5acbd1[_0xb672('0x15')]){throw Error(_0xb672('0x16'));}_0x56f812(_0x1e6ef1);})[_0xb672('0x17')](function(_0xd33eb7){_0xaee384(_0xd33eb7);});});};
\ No newline at end of file
+var _0x4d7e=['getLicense','agent','User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','getChannels','toLowerCase','clearBlockUser','isUndefined','blockedAt'];(function(_0x19ca78,_0x54fed4){var _0x24c6fc=function(_0x39ed1e){while(--_0x39ed1e){_0x19ca78['push'](_0x19ca78['shift']());}};_0x24c6fc(++_0x54fed4);}(_0x4d7e,0x1d5));var _0xe4d7=function(_0xa0d291,_0x1f91a0){_0xa0d291=_0xa0d291-0x0;var _0x2eb9f2=_0x4d7e[_0xa0d291];return _0x2eb9f2;};'use strict';var _=require(_0xe4d7('0x0'));var BPromise=require(_0xe4d7('0x1'));var db=require(_0xe4d7('0x2'))['db'];var util=require(_0xe4d7('0x3'));var channels=[_0xe4d7('0x4'),_0xe4d7('0x5'),_0xe4d7('0x6'),_0xe4d7('0x7'),_0xe4d7('0x8'),'whatsapp','openchannel'];exports[_0xe4d7('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x4aecd7){_0x4aecd7=_0x4aecd7[_0xe4d7('0xa')]();return _['includes'](channels,_0x4aecd7);};exports[_0xe4d7('0xb')]=function(_0x43fadd,_0x38f0c7,_0x464e9a,_0x658133){var _0x354c60={'loginAttempts':_0x38f0c7,'blocked':_0x464e9a};if(!_[_0xe4d7('0xc')](_0x658133)){_0x354c60[_0xe4d7('0xd')]=_0x658133;}return _0x43fadd['updateAttributes'](_0x354c60);};exports[_0xe4d7('0xe')]=function(_0x11c748){return new BPromise(function(_0x2e3293,_0x4aaa19){var _0x3a859c=0x0;if(_0x11c748['role']!==_0xe4d7('0xf')){_0x2e3293(_0x11c748);}db[_0xe4d7('0x10')][_0xe4d7('0x11')]({'where':{'role':_0xe4d7('0xf'),'online':!![],'id':{'$ne':_0x11c748['id']}}})['then'](function(_0x1ac7f2){_0x3a859c=_0x1ac7f2;return util['getLicense']();})[_0xe4d7('0x12')](function(_0x565090){if(_0x565090&&_0x565090['agents']&&_0x3a859c>=_0x565090[_0xe4d7('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2e3293(_0x11c748);})[_0xe4d7('0x14')](function(_0x42f7db){_0x4aaa19(_0x42f7db);});});};
\ No newline at end of file
index 5e0572c..35bb4dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59d5=['send','exports','404','status','render','json'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x59d5,0x67));var _0x559d=function(_0x3f22bd,_0x2793f2){_0x3f22bd=_0x3f22bd-0x0;var _0x45dbf5=_0x59d5[_0x3f22bd];return _0x45dbf5;};'use strict';module[_0x559d('0x0')][0x194]=function pageNotFound(_0x369ae0,_0x4ebcc9){var _0x2c2700=_0x559d('0x1');var _0x5c19cd=0x194;var _0x5602cd={'status':_0x5c19cd};_0x4ebcc9[_0x559d('0x2')](_0x5602cd[_0x559d('0x2')]);_0x4ebcc9[_0x559d('0x3')](_0x2c2700,{},function(_0x4159c2,_0x3d37fe){if(_0x4159c2){return _0x4ebcc9[_0x559d('0x2')](_0x5602cd[_0x559d('0x2')])[_0x559d('0x4')](_0x5602cd);}_0x4ebcc9[_0x559d('0x5')](_0x3d37fe);});};
\ No newline at end of file
+var _0x5f89=['send','exports','status','render'];(function(_0x2491b9,_0x2b5a9c){var _0x4017b8=function(_0x4c3e1b){while(--_0x4c3e1b){_0x2491b9['push'](_0x2491b9['shift']());}};_0x4017b8(++_0x2b5a9c);}(_0x5f89,0xc5));var _0x95f8=function(_0x3a1cc8,_0x514e33){_0x3a1cc8=_0x3a1cc8-0x0;var _0x21cb98=_0x5f89[_0x3a1cc8];return _0x21cb98;};'use strict';module[_0x95f8('0x0')][0x194]=function pageNotFound(_0x52730e,_0x17a10e){var _0x51880d='404';var _0x59815a=0x194;var _0x314206={'status':_0x59815a};_0x17a10e['status'](_0x314206[_0x95f8('0x1')]);_0x17a10e[_0x95f8('0x2')](_0x51880d,{},function(_0x544f02,_0x27ba70){if(_0x544f02){return _0x17a10e[_0x95f8('0x1')](_0x314206['status'])['json'](_0x314206);}_0x17a10e[_0x95f8('0x3')](_0x27ba70);});};
\ No newline at end of file
index 32e9555..153410e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb71a=['../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','CloudProvider','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteraction','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','FaxInteraction','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','ListId','team_has_mail_queues','Teams','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','List','FaxAccountId','FaxApplication','Exntensions','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Users','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','TagId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','UserOpenchannelQueue','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','Automation','All','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','FaxApplications','Schedule','DefaultReportId','Mohs','moh_has_sounds','openchannel_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Trigger','Fields','CustomReportId','SalesforceConfiguration','Configurations','Subjects','SubjectId','SalesforceField','Descriptions','DescriptionId','AccountId','Subject','Field','FieldId','DeskConfiguration','Description','VariableId','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','Dynamics365Configuration','ChatInternalMessage','FromId','ToId','JscriptyAnswerReport','SmsQueueReport','JscriptyProject','ProjectId','team_has_sms_queues','team_has_whatsapp_queues','WhatsappQueues','HopperHistories','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FaxTransferReport','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','CustomFields','HopperHistory','Queues','user_has_voice_prefixes','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','sequelizeHistory','motion2','mysql','utf8_general_ci','username','options','database','password','../api/user/user.model','VoiceChanSpy','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../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','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../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','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix'];(function(_0x454a49,_0xcb35d4){var _0x5e0271=function(_0x2143c9){while(--_0x2143c9){_0x454a49['push'](_0x454a49['shift']());}};_0x5e0271(++_0xcb35d4);}(_0xb71a,0x102));var _0xab71=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xb71a[_0x2df507];return _0x1f7167;};'use strict';var path=require('path');var config=require(_0xab71('0x0'));var Sequelize=require(_0xab71('0x1'));var _=require(_0xab71('0x2'));var jstz=require(_0xab71('0x3'));var timezone=jstz[_0xab71('0x4')]();config[_0xab71('0x1')]=_[_0xab71('0x5')](config[_0xab71('0x1')],{'database':'motion2','username':_0xab71('0x6'),'password':_0xab71('0x7'),'options':{'host':_0xab71('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xab71('0x9')},'logging':![],'timezone':timezone[_0xab71('0xa')](),'define':{'charset':_0xab71('0xb'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xab71('0x5')](config[_0xab71('0xc')],{'database':_0xab71('0xd'),'username':_0xab71('0x6'),'password':_0xab71('0x7'),'options':{'host':_0xab71('0x8'),'port':0xcea,'dialect':_0xab71('0xe'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xab71('0xb'),'collate':_0xab71('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0xab71('0x1')][_0xab71('0x10')],config[_0xab71('0x1')]['password'],config[_0xab71('0x1')][_0xab71('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xab71('0xc')][_0xab71('0x12')],config[_0xab71('0xc')]['username'],config[_0xab71('0xc')][_0xab71('0x13')],config[_0xab71('0xc')][_0xab71('0x11')])};db['User']=db[_0xab71('0x1')]['import'](_0xab71('0x14'));db[_0xab71('0x15')]=db[_0xab71('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0xab71('0x16')]=db['sequelize'][_0xab71('0x17')](_0xab71('0x18'));db[_0xab71('0x19')]=db[_0xab71('0x1')]['import'](_0xab71('0x1a'));db[_0xab71('0x1b')]=db[_0xab71('0x1')]['import'](_0xab71('0x1c'));db[_0xab71('0x1d')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x1e'));db['VoiceRecording']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x1f'));db[_0xab71('0x20')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x21'));db[_0xab71('0x22')]=db['sequelize'][_0xab71('0x17')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xab71('0x23')]=db['sequelize']['import'](_0xab71('0x24'));db[_0xab71('0x25')]=db['sequelize']['import'](_0xab71('0x26'));db['VoiceAgentReport']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x27'));db[_0xab71('0x28')]=db[_0xab71('0x1')]['import'](_0xab71('0x29'));db[_0xab71('0x2a')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/memberReport/memberReport.model');db[_0xab71('0x2b')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x2c'));db[_0xab71('0x2d')]=db[_0xab71('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xab71('0x2e')]=db['sequelize']['import'](_0xab71('0x2f'));db['UserChatQueue']=db[_0xab71('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0xab71('0x30')]=db['sequelize']['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x31'));db[_0xab71('0x32')]=db['sequelize'][_0xab71('0x17')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xab71('0x1')]['import'](_0xab71('0x33'));db['UserWhatsappQueue']=db['sequelize'][_0xab71('0x17')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xab71('0x34')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x35'));db[_0xab71('0x36')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x37'));db[_0xab71('0x38')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x39'));db['MailQueue']=db['sequelize'][_0xab71('0x17')](_0xab71('0x3a'));db['MailSubstatus']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x3b'));db[_0xab71('0x3c')]=db['sequelize']['import'](_0xab71('0x3d'));db[_0xab71('0x3e')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x3f'));db[_0xab71('0x40')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x41'));db[_0xab71('0x42')]=db[_0xab71('0x1')]['import'](_0xab71('0x43'));db[_0xab71('0x44')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x45'));db[_0xab71('0x46')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x47'));db[_0xab71('0x48')]=db['sequelize']['import'](_0xab71('0x49'));db['FaxApplication']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x4a'));db['FaxInteraction']=db['sequelize'][_0xab71('0x17')]('../api/faxInteraction/faxInteraction.model');db[_0xab71('0x4b')]=db[_0xab71('0x1')]['import'](_0xab71('0x4c'));db[_0xab71('0x4d')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x4e'));db['FaxQueueReport']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x4f'));db[_0xab71('0x50')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x51'));db['SmsApplication']=db['sequelize'][_0xab71('0x17')](_0xab71('0x52'));db[_0xab71('0x53')]=db['sequelize']['import'](_0xab71('0x54'));db[_0xab71('0x55')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x56'));db[_0xab71('0x57')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x58'));db['OpenchannelAccount']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x59'));db[_0xab71('0x5a')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0xab71('0x17')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xab71('0x5b')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x5c'));db[_0xab71('0x5d')]=db['sequelize'][_0xab71('0x17')](_0xab71('0x5e'));db[_0xab71('0x5f')]=db[_0xab71('0x1')]['import'](_0xab71('0x60'));db[_0xab71('0x61')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x62'));db[_0xab71('0x63')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x64'));db['ChatInteraction']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x65'));db[_0xab71('0x66')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x67'));db[_0xab71('0x68')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x69'));db[_0xab71('0x6a')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x6b'));db[_0xab71('0x6c')]=db['sequelize']['import'](_0xab71('0x6d'));db['ChatProactiveAction']=db[_0xab71('0x1')]['import'](_0xab71('0x6e'));db[_0xab71('0x6f')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x70'));db[_0xab71('0x71')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x72'));db[_0xab71('0x73')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x74'));db['CmHopperBlack']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xab71('0x75')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x76'));db[_0xab71('0x77')]=db['sequelize'][_0xab71('0x17')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xab71('0x1')]['import'](_0xab71('0x78'));db[_0xab71('0x79')]=db['sequelize'][_0xab71('0x17')]('../api/cmCustomField/cmCustomField.model');db[_0xab71('0x7a')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/action/action.model');db['Automation']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x7b'));db[_0xab71('0x7c')]=db['sequelize']['import'](_0xab71('0x7d'));db[_0xab71('0x7e')]=db[_0xab71('0x1')]['import'](_0xab71('0x7f'));db[_0xab71('0x80')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x81'));db[_0xab71('0x82')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x83'));db[_0xab71('0x84')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x85'));db[_0xab71('0x86')]=db[_0xab71('0x1')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x87'));db['Schedule']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x88'));db[_0xab71('0x89')]=db['sequelize']['import'](_0xab71('0x8a'));db[_0xab71('0x8b')]=db['sequelize'][_0xab71('0x17')](_0xab71('0x8c'));db['ContactItemType']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x8d'));db[_0xab71('0x8e')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x8f'));db[_0xab71('0x90')]=db[_0xab71('0x1')]['import']('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xab71('0x91')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x92'));db['Trigger']=db[_0xab71('0x1')]['import'](_0xab71('0x93'));db[_0xab71('0x94')]=db['sequelize'][_0xab71('0x17')](_0xab71('0x95'));db[_0xab71('0x96')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x97'));db[_0xab71('0x98')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x99'));db[_0xab71('0x9a')]=db['sequelize'][_0xab71('0x17')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xab71('0x9b')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x9c'));db[_0xab71('0x9d')]=db['sequelize'][_0xab71('0x17')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xab71('0x9e')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x9f'));db[_0xab71('0xa0')]=db['sequelize'][_0xab71('0x17')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0xab71('0x17')](_0xab71('0xa1'));db[_0xab71('0xa2')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xab71('0x1')]['import'](_0xab71('0xa3'));db['SalesforceField']=db[_0xab71('0x1')]['import'](_0xab71('0xa4'));db[_0xab71('0xa5')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xab71('0xa6')]=db[_0xab71('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xab71('0xa7')]=db['sequelize'][_0xab71('0x17')](_0xab71('0xa8'));db[_0xab71('0xa9')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xaa'));db['DeskConfiguration']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xab71('0xab')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xac'));db[_0xab71('0xad')]=db['sequelize']['import'](_0xab71('0xae'));db[_0xab71('0xaf')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xb0'));db[_0xab71('0xb1')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xb2'));db[_0xab71('0xb3')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xb4'));db[_0xab71('0xb5')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xb6'));db[_0xab71('0xb7')]=db[_0xab71('0x1')]['import'](_0xab71('0xb8'));db[_0xab71('0xb9')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xba'));db[_0xab71('0xbb')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xbc'));db[_0xab71('0xbd')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xbe'));db[_0xab71('0xbf')]=db['sequelize']['import'](_0xab71('0xc0'));db['VtigerField']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xc1'));db['ServicenowAccount']=db['sequelize'][_0xab71('0x17')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xab71('0xc2')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xc3'));db[_0xab71('0xc4')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xc5'));db[_0xab71('0xc6')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xc7'));db[_0xab71('0xc8')]=db['sequelize'][_0xab71('0x17')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xab71('0xc9')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xca'));db[_0xab71('0xcb')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xcc'));db[_0xab71('0xcd')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xce'));db['Integration']=db[_0xab71('0x1')]['import'](_0xab71('0x97'));db[_0xab71('0xcf')]=db[_0xab71('0x1')]['import']('../api/network/network.model');db[_0xab71('0xd0')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xd1'));db['ChatInternalMessage']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xd2'));db['JscriptyAnswerReport']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xd3'));db[_0xab71('0xd4')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xd5'));db[_0xab71('0xd6')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize'][_0xab71('0x17')](_0xab71('0xd7'));db[_0xab71('0xd8')]=db['sequelize'][_0xab71('0x17')](_0xab71('0xd9'));db['SquareDetailsReport']=db['sequelize'][_0xab71('0x17')](_0xab71('0xda'));db['JscriptyProject']=db['sequelize'][_0xab71('0x17')](_0xab71('0xdb'));db['Setting']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xab71('0x1')]['import'](_0xab71('0xdc'));db[_0xab71('0xdd')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xde'));db[_0xab71('0xdf')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xe0'));db[_0xab71('0xe1')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/squareMessage/squareMessage.model');db[_0xab71('0xe2')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xe3'));db[_0xab71('0xe4')]=db['sequelize'][_0xab71('0x17')](_0xab71('0xe5'));db['Campaign']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xe6'));db[_0xab71('0xe7')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xe8'));db['Attachment']=db[_0xab71('0x1')]['import'](_0xab71('0xe9'));db[_0xab71('0xea')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xeb'));db[_0xab71('0xec')]=db[_0xab71('0x1')]['import'](_0xab71('0xed'));db[_0xab71('0xee')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xef'));db['FaxTransferReport']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xf0'));db[_0xab71('0xf1')]=db[_0xab71('0x1')]['import'](_0xab71('0xf2'));db[_0xab71('0xf3')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xf4'));db[_0xab71('0xf5')]=db[_0xab71('0x1')]['import'](_0xab71('0xf6'));db[_0xab71('0xf7')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xf8'));db[_0xab71('0xf9')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0xab71('0xfa')]=db['sequelize'][_0xab71('0x17')](_0xab71('0xfb'));db['UserProfileResource']=db['sequelize']['import'](_0xab71('0xfc'));db[_0xab71('0xfd')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0xfe'));db[_0xab71('0xff')]=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x100'));db[_0xab71('0x101')]=db['sequelize'][_0xab71('0x17')](_0xab71('0x102'));db[_0xab71('0x103')]=db[_0xab71('0x1')]['import'](_0xab71('0x104'));db['WhatsappQueueReport']=db[_0xab71('0x1')][_0xab71('0x17')](_0xab71('0x105'));db[_0xab71('0x106')]=db['sequelize'][_0xab71('0x17')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/whatsappQueue/whatsappQueue.model');db[_0xab71('0x107')]=db[_0xab71('0x1')][_0xab71('0x17')]('../api/cloudProvider/cloudProvider.model');db['Realtime']=db[_0xab71('0x1')][_0xab71('0x17')]('../api/realtime/realtime.model');db['TeamVoiceQueue']=db['sequelize'][_0xab71('0x17')](_0xab71('0x108'));db[_0xab71('0x109')][_0xab71('0x10a')](db['VoiceMail'],{'as':_0xab71('0x20'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db['VoiceRecording'],{'as':_0xab71('0x10e'),'foreignKey':'UserId'});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0x10f')],{'as':_0xab71('0x110'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0x19')],{'as':_0xab71('0x111'),'onDelete':_0xab71('0x10b'),'hooks':!![]});db[_0xab71('0x109')]['hasMany'](db[_0xab71('0x75')],{'as':_0xab71('0x112'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')]['hasMany'](db[_0xab71('0x77')],{'as':'HopperHistory','foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0x113')],{'as':_0xab71('0x113'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0x114')],{'as':'OpenchannelInteractions','foreignKey':_0xab71('0x10c')});db['User']['hasMany'](db['ChatInteraction'],{'as':_0xab71('0x115'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db['SmsInteraction'],{'as':_0xab71('0x116'),'foreignKey':'UserId'});db[_0xab71('0x109')][_0xab71('0x10d')](db['FaxInteraction'],{'as':_0xab71('0x117'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0x3c')],{'as':'MailInteractions','foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db['WhatsappInteraction'],{'as':_0xab71('0x118'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x109')][_0xab71('0x10d')](db[_0xab71('0xfd')],{'as':_0xab71('0x119'),'foreignKey':_0xab71('0x11a')});db[_0xab71('0x109')]['belongsTo'](db[_0xab71('0xf9')],{'as':_0xab71('0xf9'),'foreignKey':'userProfileId'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x6c')],{'as':_0xab71('0x11c'),'through':'chat_group_has_users'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x71')],{'as':_0xab71('0x11d'),'through':_0xab71('0x11e')});db[_0xab71('0x109')]['belongsToMany'](db[_0xab71('0xf5')],{'as':_0xab71('0x11f'),'through':_0xab71('0x120')});db['User'][_0xab71('0x11b')](db[_0xab71('0xe2')],{'through':'user_has_teams'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x3c')],{'as':_0xab71('0x121'),'through':_0xab71('0x122')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x123')],{'as':'ChatInteractions','through':_0xab71('0x124')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x125')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xab71('0x109')]['belongsToMany'](db['SmsInteraction'],{'as':_0xab71('0x116'),'through':_0xab71('0x126')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x114')],{'as':_0xab71('0x127'),'through':_0xab71('0x128')});db[_0xab71('0x109')]['belongsToMany'](db['WhatsappInteraction'],{'as':_0xab71('0x118'),'through':_0xab71('0x129')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x1d')],{'as':_0xab71('0x12a'),'through':_0xab71('0x2e'),'required':![]});db['User'][_0xab71('0x11b')](db[_0xab71('0x12b')],{'as':_0xab71('0x12c'),'through':'UserMailQueue','required':![]});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x6a')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xab71('0x109')]['belongsToMany'](db[_0xab71('0x4d')],{'as':'FaxQueues','through':_0xab71('0x12d'),'required':![]});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x57')],{'as':_0xab71('0x12e'),'through':'UserSmsQueue','required':![]});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x5d')],{'as':_0xab71('0x12f'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xab71('0x11b')](db[_0xab71('0x130')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0xab71('0x109')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0xf7')],{'as':_0xab71('0x131'),'through':'user_has_voice_prefixes','required':![]});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x5f')],{'as':_0xab71('0x132'),'through':_0xab71('0x133')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x48')],{'as':_0xab71('0x134'),'through':'user_has_fax_accounts'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x38')],{'as':_0xab71('0x135'),'through':_0xab71('0x136')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x137')],{'as':_0xab71('0x138'),'through':'user_has_openchannel_accounts'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x50')],{'as':_0xab71('0x139'),'through':'user_has_sms_accounts'});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0x13a')],{'as':_0xab71('0x13b'),'through':_0xab71('0x13c')});db[_0xab71('0x109')][_0xab71('0x11b')](db[_0xab71('0xdd')],{'as':_0xab71('0x13d'),'through':_0xab71('0x13e')});db[_0xab71('0x15')][_0xab71('0x10d')](db[_0xab71('0x19')],{'as':_0xab71('0x13f'),'onDelete':'cascade','foreignKey':_0xab71('0x140')});db[_0xab71('0x16')][_0xab71('0x10d')](db[_0xab71('0x19')],{'onDelete':_0xab71('0x10b')});db[_0xab71('0x19')][_0xab71('0x10d')](db[_0xab71('0x19')],{'as':_0xab71('0x141'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x1b')][_0xab71('0x11b')](db[_0xab71('0x89')],{'as':_0xab71('0x142'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db[_0xab71('0x10f')],{'as':_0xab71('0x143'),'foreignKey':_0xab71('0x144')});db['VoiceQueue'][_0xab71('0x10d')](db[_0xab71('0x73')],{'as':_0xab71('0x145'),'foreignKey':_0xab71('0x144')});db[_0xab71('0x1d')][_0xab71('0x10d')](db[_0xab71('0x75')],{'as':_0xab71('0x112'),'foreignKey':_0xab71('0x144')});db[_0xab71('0x1d')][_0xab71('0x10d')](db[_0xab71('0x77')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0xab71('0x1d')][_0xab71('0x10d')](db[_0xab71('0x113')],{'as':_0xab71('0x113'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xab71('0x10d')](db[_0xab71('0x146')],{'as':_0xab71('0x147'),'foreignKey':_0xab71('0x144')});db[_0xab71('0x1d')][_0xab71('0x10d')](db['JscriptySessionReport'],{'as':_0xab71('0x148'),'foreignKey':'VoiceQueueId'});db[_0xab71('0x1d')][_0xab71('0x149')](db['Trunk'],{'as':_0xab71('0x2b'),'foreignKey':_0xab71('0x14a')});db['VoiceQueue'][_0xab71('0x149')](db[_0xab71('0x2b')],{'as':'TrunkBackup','foreignKey':_0xab71('0x14b')});db[_0xab71('0x1d')]['belongsTo'](db[_0xab71('0x82')],{'as':'Interval','foreignKey':_0xab71('0x14c')});db[_0xab71('0x1d')][_0xab71('0x149')](db[_0xab71('0x84')],{'as':_0xab71('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xab71('0x1d')][_0xab71('0x11b')](db[_0xab71('0xf5')],{'as':_0xab71('0x11f'),'through':_0xab71('0x14e')});db['VoiceQueue'][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x2e')});db[_0xab71('0x1d')][_0xab71('0x11b')](db[_0xab71('0xe2')],{'as':'Teams','through':_0xab71('0x150')});db[_0xab71('0x1d')][_0xab71('0x11b')](db[_0xab71('0xf5')],{'as':_0xab71('0x151'),'through':_0xab71('0x152')});db[_0xab71('0x153')][_0xab71('0x149')](db[_0xab71('0x109')],{'as':_0xab71('0x109'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x154')]['belongsTo'](db[_0xab71('0x109')],{'as':'User','foreignKey':_0xab71('0x10c')});db['VoiceMail'][_0xab71('0x10d')](db[_0xab71('0x22')],{'as':_0xab71('0x155'),'onDelete':'cascade','foreignKey':_0xab71('0x156'),'sourceKey':_0xab71('0x157')});db[_0xab71('0x22')]['belongsTo'](db[_0xab71('0x20')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xab71('0x23')][_0xab71('0x10d')](db[_0xab71('0x28')],{'as':_0xab71('0x158'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xab71('0x159')],{'as':_0xab71('0x15a'),'foreignKey':'uniqueid','constraints':![]});db[_0xab71('0x23')]['belongsTo'](db[_0xab71('0x109')],{'as':'User','foreignKey':_0xab71('0x10c')});db[_0xab71('0x23')][_0xab71('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0xab71('0x15b')});db[_0xab71('0x34')]['belongsTo'](db[_0xab71('0x38')],{'as':_0xab71('0x38'),'foreignKey':'MailAccountId'});db[_0xab71('0x36')][_0xab71('0x149')](db[_0xab71('0x38')],{'as':_0xab71('0x38'),'foreignKey':_0xab71('0x15c')});db[_0xab71('0x38')][_0xab71('0x10a')](db[_0xab71('0x34')],{'as':_0xab71('0x15d'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x38')][_0xab71('0x10a')](db[_0xab71('0x36')],{'as':_0xab71('0x15e'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x38')]['hasMany'](db[_0xab71('0x7e')],{'as':_0xab71('0x15f'),'foreignKey':'MailAccountId','onDelete':_0xab71('0x10b')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0xab71('0x160'),'foreignKey':'MailAccountId'});db[_0xab71('0x38')][_0xab71('0x10d')](db[_0xab71('0x3e')],{'as':_0xab71('0x155'),'foreignKey':_0xab71('0x15c')});db[_0xab71('0x38')][_0xab71('0x10d')](db['MailInteraction'],{'as':_0xab71('0x161')});db[_0xab71('0x38')][_0xab71('0x10d')](db['MailApplication'],{'as':_0xab71('0x141')});db[_0xab71('0x38')]['belongsTo'](db[_0xab71('0xf5')],{'as':'List','foreignKey':_0xab71('0x162')});db[_0xab71('0x38')][_0xab71('0x149')](db[_0xab71('0x91')],{'as':_0xab71('0x91'),'foreignKey':'TemplateId'});db[_0xab71('0x38')][_0xab71('0x149')](db[_0xab71('0x84')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xab71('0x38')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':'Agents','through':_0xab71('0x136')});db[_0xab71('0x12b')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x30')});db[_0xab71('0x12b')][_0xab71('0x11b')](db[_0xab71('0xe2')],{'through':_0xab71('0x163'),'as':_0xab71('0x164')});db[_0xab71('0x3c')][_0xab71('0x10d')](db[_0xab71('0x3e')],{'as':_0xab71('0x155'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x165')});db[_0xab71('0x3c')][_0xab71('0x149')](db[_0xab71('0x38')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x15c')});db[_0xab71('0x3c')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':'ContactId'});db[_0xab71('0x3c')][_0xab71('0x149')](db[_0xab71('0x109')],{'as':_0xab71('0x168'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x3c')]['belongsToMany'](db[_0xab71('0x8b')],{'through':_0xab71('0x169'),'as':_0xab71('0x16a')});db['MailInteraction'][_0xab71('0x11b')](db['Tag'],{'through':_0xab71('0x169'),'as':_0xab71('0x16b')});db['MailInteraction'][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':'Users','through':_0xab71('0x122'),'foreignKey':_0xab71('0x165')});db[_0xab71('0x3e')][_0xab71('0x10d')](db[_0xab71('0x16c')],{'as':_0xab71('0x16d'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x3e')][_0xab71('0x149')](db[_0xab71('0x109')],{'as':'User'});db['MailMessage'][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':_0xab71('0x10b'),'as':'Contact'});db[_0xab71('0x3e')][_0xab71('0x149')](db[_0xab71('0x3c')],{'as':_0xab71('0x16e'),'foreignKey':'MailInteractionId'});db[_0xab71('0x3e')]['belongsTo'](db[_0xab71('0x38')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x15c')});db['MailMessage'][_0xab71('0x149')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0xab71('0x16f')});db[_0xab71('0x3e')][_0xab71('0x149')](db[_0xab71('0x68')],{'as':'ChatOfflineMessage','foreignKey':_0xab71('0x170')});db['MailApplication']['belongsTo'](db[_0xab71('0x109')],{'onDelete':_0xab71('0x171')});db[_0xab71('0x40')][_0xab71('0x149')](db[_0xab71('0x12b')],{'onDelete':_0xab71('0x171')});db[_0xab71('0x40')][_0xab71('0x149')](db['MailAccount'],{'onDelete':_0xab71('0x171')});db[_0xab71('0x40')][_0xab71('0x149')](db['Interval'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x14c')});db[_0xab71('0x40')][_0xab71('0x149')](db[_0xab71('0x8b')],{'onDelete':_0xab71('0x171'),'foreignKey':'TagId'});db[_0xab71('0x42')][_0xab71('0x149')](db['MailAccount'],{});db['MailQueueReport'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0x42')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x42')][_0xab71('0x149')](db[_0xab71('0x3c')],{});db[_0xab71('0x42')]['belongsTo'](db[_0xab71('0x3e')],{});db[_0xab71('0x42')]['belongsTo'](db[_0xab71('0x109')],{});db['MailQueueReport']['belongsTo'](db['MailQueue'],{});db[_0xab71('0x44')][_0xab71('0x10d')](db[_0xab71('0x46')],{'as':'Items','onDelete':_0xab71('0x10b')});db['FaxAccount'][_0xab71('0x10d')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xab71('0x10b')});db[_0xab71('0x48')][_0xab71('0x10d')](db[_0xab71('0x7c')],{'as':_0xab71('0x160'),'foreignKey':_0xab71('0x173')});db['FaxAccount'][_0xab71('0x10d')](db['FaxInteraction'],{'as':_0xab71('0x161')});db['FaxAccount'][_0xab71('0x10d')](db[_0xab71('0x174')],{'as':_0xab71('0x141')});db[_0xab71('0x48')][_0xab71('0x10d')](db[_0xab71('0x19')],{'as':_0xab71('0x175'),'onDelete':_0xab71('0x10b')});db['FaxAccount'][_0xab71('0x10d')](db[_0xab71('0x4b')],{'as':_0xab71('0x155')});db['FaxAccount'][_0xab71('0x149')](db[_0xab71('0x2b')],{'as':_0xab71('0x2b')});db['FaxAccount'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0x48')][_0xab71('0x149')](db[_0xab71('0x84')],{'as':_0xab71('0x14d'),'foreignKey':_0xab71('0x176')});db['FaxAccount']['belongsToMany'](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x177')});db[_0xab71('0x174')][_0xab71('0x149')](db['User'],{'onDelete':_0xab71('0x171')});db['FaxApplication'][_0xab71('0x149')](db[_0xab71('0x4d')],{'onDelete':'restrict'});db[_0xab71('0x174')]['belongsTo'](db[_0xab71('0x48')],{'onDelete':_0xab71('0x171')});db['FaxApplication'][_0xab71('0x149')](db[_0xab71('0x8b')],{'onDelete':'restrict','foreignKey':'TagId'});db['FaxInteraction'][_0xab71('0x10d')](db[_0xab71('0x4b')],{'as':_0xab71('0x155'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x178')});db['FaxInteraction'][_0xab71('0x149')](db[_0xab71('0x48')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x173')});db[_0xab71('0x125')]['belongsTo'](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db['FaxInteraction'][_0xab71('0x149')](db['User'],{'as':_0xab71('0x168'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x125')][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x179'),'as':'Tags'});db[_0xab71('0x125')][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x179'),'as':_0xab71('0x16b')});db[_0xab71('0x125')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x17a'),'through':_0xab71('0x17b'),'foreignKey':_0xab71('0x178')});db['FaxMessage']['belongsTo'](db[_0xab71('0x109')],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x109')});db[_0xab71('0x4b')]['belongsTo'](db[_0xab71('0x125')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0xab71('0x4b')][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':_0xab71('0x10b'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xab71('0x16c')],{'as':'Attachment','foreignKey':_0xab71('0x17c')});db['FaxMessage'][_0xab71('0x149')](db['FaxAccount'],{'as':_0xab71('0x166'),'foreignKey':'FaxAccountId'});db[_0xab71('0x4d')][_0xab71('0x11b')](db['User'],{'as':_0xab71('0x14f'),'through':'UserFaxQueue'});db[_0xab71('0x4d')][_0xab71('0x11b')](db[_0xab71('0xe2')],{'through':_0xab71('0x17d'),'as':'Teams'});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0x48')],{});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':'ListId'});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':'ContactId'});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0x125')],{});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0x4b')],{});db[_0xab71('0x17e')][_0xab71('0x149')](db[_0xab71('0x109')],{});db[_0xab71('0x17e')]['belongsTo'](db[_0xab71('0x4d')],{});db[_0xab71('0x50')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xab71('0x17f'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x50')]['hasMany'](db[_0xab71('0x7c')],{'as':'Answers','foreignKey':_0xab71('0x17f')});db[_0xab71('0x50')][_0xab71('0x10d')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xab71('0x50')][_0xab71('0x10d')](db['SmsInteraction'],{'as':_0xab71('0x161')});db[_0xab71('0x50')][_0xab71('0x10d')](db['SmsApplication'],{'as':_0xab71('0x141')});db['SmsAccount'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0x50')][_0xab71('0x149')](db[_0xab71('0x84')],{'as':_0xab71('0x14d'),'foreignKey':_0xab71('0x176')});db[_0xab71('0x50')]['belongsToMany'](db[_0xab71('0x109')],{'as':'Agents','through':'user_has_sms_accounts'});db['SmsApplication'][_0xab71('0x149')](db[_0xab71('0x109')],{'onDelete':'restrict'});db['SmsApplication'][_0xab71('0x149')](db[_0xab71('0x57')],{'onDelete':_0xab71('0x171')});db[_0xab71('0x180')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db[_0xab71('0x180')][_0xab71('0x149')](db[_0xab71('0x82')],{'onDelete':'restrict','foreignKey':_0xab71('0x14c')});db[_0xab71('0x180')][_0xab71('0x149')](db['Tag'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x181')});db[_0xab71('0x53')][_0xab71('0x10d')](db[_0xab71('0x55')],{'as':_0xab71('0x155'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0xab71('0x149')](db[_0xab71('0x50')],{'as':'Account','foreignKey':_0xab71('0x17f')});db[_0xab71('0x53')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':'ContactId'});db[_0xab71('0x53')][_0xab71('0x149')](db['User'],{'as':_0xab71('0x168'),'foreignKey':_0xab71('0x10c')});db['SmsInteraction'][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x182'),'as':_0xab71('0x16a')});db[_0xab71('0x53')]['belongsToMany'](db[_0xab71('0x8b')],{'through':_0xab71('0x182'),'as':_0xab71('0x16b')});db['SmsInteraction']['belongsToMany'](db['User'],{'as':_0xab71('0x17a'),'through':_0xab71('0x126'),'foreignKey':'SmsInteractionId'});db[_0xab71('0x55')][_0xab71('0x149')](db[_0xab71('0x109')],{'as':_0xab71('0x109')});db['SmsMessage'][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':'cascade','as':_0xab71('0x167')});db[_0xab71('0x55')][_0xab71('0x149')](db['SmsInteraction'],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x16e'),'foreignKey':_0xab71('0x183')});db[_0xab71('0x55')][_0xab71('0x149')](db[_0xab71('0x50')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x17f')});db[_0xab71('0x57')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x32'),'foreignKey':_0xab71('0x184')});db[_0xab71('0x57')]['belongsToMany'](db[_0xab71('0xe2')],{'through':'team_has_sms_queues','as':_0xab71('0x164')});db['OpenchannelAccount'][_0xab71('0x10d')](db[_0xab71('0x7e')],{'as':_0xab71('0x15f'),'foreignKey':_0xab71('0x185'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x137')][_0xab71('0x10d')](db[_0xab71('0x7c')],{'as':_0xab71('0x160'),'foreignKey':_0xab71('0x185')});db[_0xab71('0x137')][_0xab71('0x10d')](db[_0xab71('0x114')],{'as':'Interactions','foreignKey':_0xab71('0x185')});db[_0xab71('0x137')]['hasMany'](db[_0xab71('0x5b')],{'as':_0xab71('0x155'),'foreignKey':_0xab71('0x185')});db[_0xab71('0x137')][_0xab71('0x10d')](db[_0xab71('0x5a')],{'as':_0xab71('0x141'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0x137')][_0xab71('0x149')](db['Pause'],{'as':_0xab71('0x14d'),'foreignKey':_0xab71('0x176')});db[_0xab71('0x137')][_0xab71('0x11b')](db['User'],{'as':'Agents','through':_0xab71('0x186')});db[_0xab71('0x5a')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0xab71('0x5a')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x187')});db[_0xab71('0x5a')][_0xab71('0x149')](db[_0xab71('0x137')],{'onDelete':'restrict','foreignKey':_0xab71('0x185')});db[_0xab71('0x5a')][_0xab71('0x149')](db['Interval'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x14c')});db[_0xab71('0x5a')][_0xab71('0x149')](db['Tag'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x181')});db[_0xab71('0x114')][_0xab71('0x10d')](db[_0xab71('0x5b')],{'as':_0xab71('0x155'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xab71('0x114')][_0xab71('0x149')](db['OpenchannelAccount'],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x185')});db[_0xab71('0x114')]['belongsTo'](db[_0xab71('0x71')],{'as':'Contact','foreignKey':_0xab71('0x15b')});db['OpenchannelInteraction']['belongsTo'](db[_0xab71('0x109')],{'as':'Owner','foreignKey':'UserId'});db[_0xab71('0x114')]['belongsToMany'](db[_0xab71('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0xab71('0x16a')});db[_0xab71('0x114')][_0xab71('0x11b')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xab71('0x16b')});db[_0xab71('0x114')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x17a'),'through':_0xab71('0x128'),'foreignKey':_0xab71('0x188')});db[_0xab71('0x5b')][_0xab71('0x149')](db[_0xab71('0x109')],{'onDelete':_0xab71('0x10b'),'as':'User'});db[_0xab71('0x5b')][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x167')});db[_0xab71('0x5b')]['belongsTo'](db[_0xab71('0x114')],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x16e'),'foreignKey':'OpenchannelInteractionId'});db[_0xab71('0x5b')][_0xab71('0x149')](db[_0xab71('0x16c')],{'as':_0xab71('0x16c'),'foreignKey':'AttachmentId'});db['OpenchannelMessage']['belongsTo'](db[_0xab71('0x137')],{'as':_0xab71('0x166'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x189'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xab71('0x11b')](db[_0xab71('0xe2')],{'through':_0xab71('0x18a'),'as':_0xab71('0x164')});db[_0xab71('0x5f')][_0xab71('0x10d')](db[_0xab71('0x7e')],{'as':'Dispositions','foreignKey':_0xab71('0x16f'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x5f')][_0xab71('0x10d')](db[_0xab71('0x7c')],{'as':_0xab71('0x160'),'foreignKey':_0xab71('0x16f')});db[_0xab71('0x5f')][_0xab71('0x10d')](db[_0xab71('0x18b')],{'as':_0xab71('0x18c')});db[_0xab71('0x5f')][_0xab71('0x10d')](db[_0xab71('0x123')],{'as':'Interactions'});db[_0xab71('0x5f')][_0xab71('0x10d')](db['ChatApplication'],{'as':_0xab71('0x141')});db['ChatWebsite'][_0xab71('0x10d')](db[_0xab71('0x66')],{'as':'Messages'});db['ChatWebsite'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0x5f')]['belongsTo'](db['Interval'],{'as':_0xab71('0x82'),'foreignKey':_0xab71('0x14c')});db['ChatWebsite'][_0xab71('0x149')](db[_0xab71('0x38')],{'as':_0xab71('0x38'),'foreignKey':_0xab71('0x15c')});db['ChatWebsite'][_0xab71('0x149')](db[_0xab71('0x84')],{'as':_0xab71('0x14d'),'foreignKey':_0xab71('0x176')});db[_0xab71('0x5f')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':_0xab71('0x133')});db[_0xab71('0x61')][_0xab71('0x149')](db[_0xab71('0x137')],{});db['OpenchannelQueueReport'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0xab71('0x61')][_0xab71('0x149')](db['CmContact'],{'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x61')][_0xab71('0x149')](db[_0xab71('0x114')],{});db[_0xab71('0x61')][_0xab71('0x149')](db[_0xab71('0x5b')],{});db[_0xab71('0x61')][_0xab71('0x149')](db[_0xab71('0x109')],{});db[_0xab71('0x61')][_0xab71('0x149')](db[_0xab71('0x5d')],{});db['ChatApplication'][_0xab71('0x149')](db[_0xab71('0x109')],{'as':_0xab71('0x18d'),'foreignKey':_0xab71('0x10c'),'onDelete':'restrict'});db[_0xab71('0x63')][_0xab71('0x149')](db[_0xab71('0x6a')],{'as':_0xab71('0x18e'),'foreignKey':'ChatQueueId','onDelete':_0xab71('0x171')});db[_0xab71('0x63')][_0xab71('0x149')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xab71('0x16f'),'onDelete':'restrict'});db[_0xab71('0x63')]['belongsTo'](db['Tag'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x181')});db[_0xab71('0x123')][_0xab71('0x10d')](db[_0xab71('0x66')],{'as':'Messages','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x18f')});db[_0xab71('0x123')][_0xab71('0x149')](db[_0xab71('0x5f')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x16f')});db[_0xab71('0x123')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':'ContactId'});db[_0xab71('0x123')][_0xab71('0x149')](db['User'],{'as':_0xab71('0x168'),'foreignKey':'UserId'});db[_0xab71('0x123')][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':'chat_interaction_has_tags','as':_0xab71('0x16a')});db[_0xab71('0x123')][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x190'),'as':_0xab71('0x16b')});db[_0xab71('0x123')]['belongsToMany'](db['User'],{'as':'Users','through':_0xab71('0x124'),'foreignKey':_0xab71('0x18f')});db[_0xab71('0x66')][_0xab71('0x149')](db['User'],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x109')});db['ChatMessage'][_0xab71('0x149')](db['CmContact'],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db['ChatMessage'][_0xab71('0x149')](db[_0xab71('0x123')],{'onDelete':_0xab71('0x10b'),'as':'Interaction','foreignKey':_0xab71('0x18f')});db[_0xab71('0x66')][_0xab71('0x149')](db['Attachment'],{'as':_0xab71('0x16c'),'foreignKey':_0xab71('0x17c')});db[_0xab71('0x66')]['belongsTo'](db[_0xab71('0x5f')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x16f')});db[_0xab71('0x68')][_0xab71('0x10d')](db[_0xab71('0x16c')],{'as':_0xab71('0x16d'),'foreignKey':_0xab71('0x170'),'onDelete':'cascade','hooks':!![]});db[_0xab71('0x68')][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x68')][_0xab71('0x149')](db[_0xab71('0x5f')],{'as':_0xab71('0x166'),'foreignKey':'ChatWebsiteId'});db[_0xab71('0x6a')]['belongsToMany'](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xab71('0x11b')](db['Team'],{'through':_0xab71('0x191'),'as':_0xab71('0x164')});db[_0xab71('0x6c')]['hasMany'](db['ChatInternalMessage'],{'as':_0xab71('0x155'),'foreignKey':_0xab71('0x192'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x6c')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x143'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0xab71('0x149')](db[_0xab71('0x5f')],{'as':_0xab71('0x193'),'foreignKey':_0xab71('0x16f')});db[_0xab71('0x6f')][_0xab71('0x10d')](db[_0xab71('0x71')],{'as':_0xab71('0x11d'),'foreignKey':_0xab71('0x194')});db[_0xab71('0x71')][_0xab71('0x10d')](db[_0xab71('0x8e')],{'as':'Phones','foreignKey':_0xab71('0x195')});db['CmContact']['hasMany'](db[_0xab71('0x73')],{'as':_0xab71('0x145'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x71')]['hasMany'](db[_0xab71('0x75')],{'as':_0xab71('0x112'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x71')][_0xab71('0x10d')](db[_0xab71('0x77')],{'as':'HopperHistories','foreignKey':_0xab71('0x15b')});db[_0xab71('0x71')][_0xab71('0x10d')](db[_0xab71('0x113')],{'as':_0xab71('0x113'),'foreignKey':'ContactId'});db[_0xab71('0x71')][_0xab71('0x10d')](db[_0xab71('0xd6')],{'as':_0xab71('0x148'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x71')][_0xab71('0x10d')](db[_0xab71('0x114')],{'as':_0xab71('0x127'),'foreignKey':'ContactId','onDelete':_0xab71('0x171')});db[_0xab71('0x71')]['hasMany'](db[_0xab71('0x123')],{'as':_0xab71('0x115'),'foreignKey':_0xab71('0x15b'),'onDelete':'restrict'});db[_0xab71('0x71')][_0xab71('0x10d')](db['SmsInteraction'],{'as':_0xab71('0x116'),'foreignKey':_0xab71('0x15b'),'onDelete':_0xab71('0x171')});db[_0xab71('0x71')]['hasMany'](db[_0xab71('0x125')],{'as':_0xab71('0x117'),'foreignKey':'ContactId','onDelete':_0xab71('0x171')});db[_0xab71('0x71')]['hasMany'](db['MailInteraction'],{'as':_0xab71('0x121'),'foreignKey':_0xab71('0x15b'),'onDelete':'restrict'});db[_0xab71('0x71')][_0xab71('0x149')](db[_0xab71('0x6f')],{'as':_0xab71('0x196'),'foreignKey':'CompanyId'});db['CmContact'][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x71')]['belongsToMany'](db[_0xab71('0x109')],{'as':_0xab71('0x17a'),'through':_0xab71('0x11e')});db[_0xab71('0x71')][_0xab71('0x11b')](db['Tag'],{'as':_0xab71('0x16a'),'through':_0xab71('0x197')});db['CmContact'][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x197'),'as':_0xab71('0x16b')});db[_0xab71('0x73')]['hasMany'](db[_0xab71('0x90')],{'as':_0xab71('0x198'),'foreignKey':_0xab71('0x199')});db[_0xab71('0x73')][_0xab71('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0xab71('0x15b'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x73')][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162'),'onDelete':_0xab71('0x10b')});db['CmHopper'][_0xab71('0x149')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0xab71('0x73')][_0xab71('0x149')](db[_0xab71('0x1d')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0xab71('0x149')](db[_0xab71('0x19a')],{'as':_0xab71('0x19a'),'foreignKey':_0xab71('0x19b'),'onDelete':_0xab71('0x10b')});db['CmHopper'][_0xab71('0x149')](db['User'],{'as':_0xab71('0x168'),'foreignKey':'OwnerId'});db[_0xab71('0x146')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':'Contact','foreignKey':_0xab71('0x15b'),'onDelete':_0xab71('0x10b')});db['CmHopperBlack'][_0xab71('0x149')](db['CmList'],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x146')][_0xab71('0x149')](db[_0xab71('0x1d')],{'as':_0xab71('0x18e'),'foreignKey':_0xab71('0x144'),'onDelete':_0xab71('0x10b')});db['CmHopperBlack'][_0xab71('0x149')](db[_0xab71('0x19a')],{'as':'Campaign','foreignKey':_0xab71('0x19b'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x19c')]['hasMany'](db[_0xab71('0x80')],{'as':{'plural':_0xab71('0x19d'),'singular':'OneAll'},'foreignKey':_0xab71('0x19e'),'onDelete':_0xab71('0x10b'),'hooks':!![]});db['Automation'][_0xab71('0x10d')](db[_0xab71('0x80')],{'as':{'plural':_0xab71('0x19f'),'singular':'OneAny'},'foreignKey':_0xab71('0x1a0'),'onDelete':_0xab71('0x10b'),'hooks':!![]});db[_0xab71('0x19c')][_0xab71('0x10d')](db[_0xab71('0x7a')],{'as':_0xab71('0x1a1'),'foreignKey':_0xab71('0x1a2'),'onDelete':'cascade','hooks':!![]});db[_0xab71('0x7e')][_0xab71('0x10d')](db[_0xab71('0x7e')],{'as':_0xab71('0x15f'),'foreignKey':_0xab71('0x1a3'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x82')][_0xab71('0x10d')](db[_0xab71('0x82')],{'as':_0xab71('0x1a4'),'foreignKey':_0xab71('0x14c'),'onDelete':_0xab71('0x10b'),'hooks':!![],'required':![]});db[_0xab71('0x82')][_0xab71('0x10d')](db['VoiceExtension'],{'as':_0xab71('0x111'),'foreignKey':_0xab71('0x14c'),'onDelete':_0xab71('0x171')});db[_0xab71('0x82')][_0xab71('0x10d')](db[_0xab71('0x40')],{'as':'MailApplications','foreignKey':_0xab71('0x14c')});db[_0xab71('0x82')][_0xab71('0x10d')](db[_0xab71('0x63')],{'as':'ChatApplications','foreignKey':_0xab71('0x14c')});db[_0xab71('0x82')]['hasMany'](db['FaxApplication'],{'as':_0xab71('0x1a5'),'foreignKey':_0xab71('0x14c')});db[_0xab71('0x82')][_0xab71('0x10d')](db[_0xab71('0x180')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0xab71('0x1a6')][_0xab71('0x149')](db[_0xab71('0x38')],{});db[_0xab71('0x1a6')][_0xab71('0x149')](db[_0xab71('0x9b')],{'foreignKey':_0xab71('0x1a7')});db['Schedule']['belongsTo'](db[_0xab71('0x9a')],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0xab71('0x1b')],{'as':_0xab71('0x1a8'),'through':_0xab71('0x1a9'),'onDelete':_0xab71('0x171')});db['Tag'][_0xab71('0x11b')](db['CmContact'],{'through':_0xab71('0x197')});db['Tag'][_0xab71('0x11b')](db[_0xab71('0x123')],{'through':_0xab71('0x190')});db[_0xab71('0x8b')][_0xab71('0x11b')](db[_0xab71('0x3c')],{'through':_0xab71('0x169')});db[_0xab71('0x8b')][_0xab71('0x11b')](db[_0xab71('0x53')],{'through':_0xab71('0x182')});db['Tag'][_0xab71('0x11b')](db[_0xab71('0x125')],{'through':_0xab71('0x179')});db[_0xab71('0x8b')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xab71('0x1aa')});db[_0xab71('0x8b')][_0xab71('0x11b')](db[_0xab71('0x101')],{'through':'whatsapp_interaction_has_tags'});db[_0xab71('0x8e')][_0xab71('0x149')](db[_0xab71('0x1ab')],{'as':_0xab71('0x1ac'),'foreignKey':_0xab71('0x1ad')});db[_0xab71('0x90')][_0xab71('0x149')](db[_0xab71('0x73')],{'as':_0xab71('0x1ae'),'foreignKey':_0xab71('0x199')});db['Trigger'][_0xab71('0x10d')](db[_0xab71('0x80')],{'as':{'plural':_0xab71('0x1af'),'singular':_0xab71('0x1b0')},'foreignKey':'TriggerAllId','onDelete':_0xab71('0x10b'),'hooks':!![]});db['Trigger'][_0xab71('0x10d')](db[_0xab71('0x80')],{'as':{'plural':_0xab71('0x1b1'),'singular':_0xab71('0x1b2')},'foreignKey':_0xab71('0x1b3'),'onDelete':'cascade','hooks':!![]});db[_0xab71('0x1b4')][_0xab71('0x10d')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xab71('0x10b'),'hooks':!![]});db[_0xab71('0x9a')][_0xab71('0x10d')](db[_0xab71('0xa0')],{'as':_0xab71('0x1b5'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1b6'),'hooks':!![]});db[_0xab71('0x9b')][_0xab71('0x10d')](db['AnalyticFieldReport'],{'as':_0xab71('0x1b5'),'onDelete':'cascade','foreignKey':_0xab71('0x1a7')});db[_0xab71('0x9e')][_0xab71('0x10d')](db[_0xab71('0xa0')],{'as':'Fields','onDelete':_0xab71('0x10b'),'foreignKey':'MetricId'});db[_0xab71('0xa0')]['belongsTo'](db[_0xab71('0x9e')],{'foreignKey':'MetricId'});db[_0xab71('0xa2')][_0xab71('0x10d')](db[_0xab71('0x1b7')],{'as':_0xab71('0x1b8'),'onDelete':_0xab71('0x10b'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xab71('0x10d')](db['SalesforceField'],{'as':_0xab71('0x1b9'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1ba')});db['SalesforceConfiguration'][_0xab71('0x10d')](db[_0xab71('0x1bb')],{'as':_0xab71('0x1bc'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db['SalesforceConfiguration'][_0xab71('0x10d')](db[_0xab71('0x1bb')],{'as':_0xab71('0x1b5'),'onDelete':_0xab71('0x10b'),'foreignKey':'FieldId'});db[_0xab71('0x1b7')][_0xab71('0x149')](db[_0xab71('0xa2')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0x1bb')]['hasMany'](db['SalesforceField'],{'as':_0xab71('0x1bf'),'foreignKey':'SubjectId'});db[_0xab71('0x1bb')][_0xab71('0x10d')](db[_0xab71('0x1bb')],{'as':'Description','foreignKey':_0xab71('0x1bd')});db[_0xab71('0x1bb')]['hasMany'](db[_0xab71('0x1bb')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0x1bb')][_0xab71('0x149')](db['Variable'],{'as':_0xab71('0x94'),'foreignKey':'VariableId'});db[_0xab71('0xa5')][_0xab71('0x10d')](db[_0xab71('0xa6')],{'as':'Configurations','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1be')});db['SugarcrmConfiguration']['hasMany'](db[_0xab71('0xa7')],{'as':_0xab71('0x1b9'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0xa6')][_0xab71('0x10d')](db[_0xab71('0xa7')],{'as':_0xab71('0x1bc'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xa6')][_0xab71('0x10d')](db[_0xab71('0xa7')],{'as':_0xab71('0x1b5'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1c1')});db['SugarcrmConfiguration']['belongsTo'](db['SugarcrmAccount'],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0xa7')][_0xab71('0x10d')](db[_0xab71('0xa7')],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0xa7')][_0xab71('0x10d')](db[_0xab71('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xab71('0xa7')]['hasMany'](db[_0xab71('0xa7')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xa7')]['belongsTo'](db[_0xab71('0x94')],{'as':_0xab71('0x94'),'foreignKey':'VariableId'});db[_0xab71('0xa9')][_0xab71('0x10d')](db['DeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xab71('0x1be')});db[_0xab71('0x1c2')][_0xab71('0x10d')](db[_0xab71('0xab')],{'as':_0xab71('0x1b9'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1ba')});db['DeskConfiguration'][_0xab71('0x10d')](db[_0xab71('0xab')],{'as':'Descriptions','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0x1c2')][_0xab71('0x10d')](db['DeskField'],{'as':'Fields','onDelete':_0xab71('0x10b'),'foreignKey':'FieldId'});db['DeskConfiguration']['belongsTo'](db[_0xab71('0xa9')],{'as':'Account','foreignKey':_0xab71('0x1be')});db['DeskConfiguration'][_0xab71('0x11b')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xab71('0xab')][_0xab71('0x10d')](db['DeskField'],{'as':_0xab71('0x1bf'),'foreignKey':'SubjectId'});db['DeskField'][_0xab71('0x10d')](db[_0xab71('0xab')],{'as':_0xab71('0x1c3'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xab')][_0xab71('0x10d')](db[_0xab71('0xab')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xab')][_0xab71('0x149')](db[_0xab71('0x94')],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db[_0xab71('0xad')][_0xab71('0x10d')](db['ZohoConfiguration'],{'as':_0xab71('0x1b8'),'onDelete':_0xab71('0x10b'),'foreignKey':'AccountId'});db[_0xab71('0xaf')][_0xab71('0x10d')](db[_0xab71('0x1c5')],{'as':_0xab71('0x1b9'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1ba')});db['ZohoConfiguration'][_0xab71('0x10d')](db[_0xab71('0x1c5')],{'as':'Descriptions','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xaf')]['hasMany'](db[_0xab71('0x1c5')],{'as':_0xab71('0x1b5'),'onDelete':'cascade','foreignKey':_0xab71('0x1c1')});db[_0xab71('0xaf')][_0xab71('0x149')](db[_0xab71('0xad')],{'as':'Account','foreignKey':_0xab71('0x1be')});db[_0xab71('0x1c5')][_0xab71('0x10d')](db['ZohoField'],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0x1c5')][_0xab71('0x10d')](db[_0xab71('0x1c5')],{'as':_0xab71('0x1c3'),'foreignKey':'DescriptionId'});db[_0xab71('0x1c5')][_0xab71('0x10d')](db[_0xab71('0x1c5')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db['ZohoField'][_0xab71('0x149')](db['Variable'],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db['ZendeskAccount']['hasMany'](db[_0xab71('0xb3')],{'as':_0xab71('0x1b8'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1be')});db['ZendeskConfiguration'][_0xab71('0x10d')](db[_0xab71('0xb5')],{'as':_0xab71('0x1b9'),'foreignKey':_0xab71('0x1ba')});db['ZendeskConfiguration']['hasMany'](db[_0xab71('0xb5')],{'as':_0xab71('0x1bc'),'foreignKey':_0xab71('0x1bd')});db['ZendeskConfiguration'][_0xab71('0x10d')](db['ZendeskField'],{'as':_0xab71('0x1b5'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xb3')][_0xab71('0x149')](db[_0xab71('0xb1')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0xb3')]['belongsToMany'](db[_0xab71('0x8b')],{'through':_0xab71('0x1c6')});db['ZendeskField']['hasMany'](db[_0xab71('0xb5')],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0xb5')][_0xab71('0x10d')](db[_0xab71('0xb5')],{'as':_0xab71('0x1c3'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xb5')][_0xab71('0x10d')](db[_0xab71('0xb5')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xb5')][_0xab71('0x149')](db['Variable'],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db[_0xab71('0xb7')][_0xab71('0x10d')](db[_0xab71('0xb9')],{'as':'Configurations','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0xb9')][_0xab71('0x10d')](db[_0xab71('0xbb')],{'as':_0xab71('0x1b9'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0xb9')][_0xab71('0x10d')](db[_0xab71('0xbb')],{'as':_0xab71('0x1bc'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xb9')]['hasMany'](db[_0xab71('0xbb')],{'as':_0xab71('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xab71('0xb9')][_0xab71('0x149')](db[_0xab71('0xb7')],{'as':'Account','foreignKey':_0xab71('0x1be')});db['FreshdeskConfiguration'][_0xab71('0x11b')](db['Tag'],{'through':_0xab71('0x1c7')});db[_0xab71('0xbb')][_0xab71('0x10d')](db['FreshdeskField'],{'as':_0xab71('0x1bf'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xab71('0x10d')](db[_0xab71('0xbb')],{'as':_0xab71('0x1c3'),'foreignKey':_0xab71('0x1bd')});db['FreshdeskField'][_0xab71('0x10d')](db[_0xab71('0xbb')],{'as':'Field','foreignKey':_0xab71('0x1c1')});db[_0xab71('0xbb')]['belongsTo'](db['Variable'],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db[_0xab71('0xbd')][_0xab71('0x10d')](db[_0xab71('0xbf')],{'as':_0xab71('0x1b8'),'onDelete':'cascade','foreignKey':_0xab71('0x1be')});db[_0xab71('0xbf')][_0xab71('0x10d')](db[_0xab71('0x1c8')],{'as':'Subjects','foreignKey':_0xab71('0x1ba')});db[_0xab71('0xbf')][_0xab71('0x10d')](db[_0xab71('0x1c8')],{'as':_0xab71('0x1bc'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xbf')][_0xab71('0x10d')](db['VtigerField'],{'as':_0xab71('0x1b5'),'foreignKey':'FieldId'});db[_0xab71('0xbf')][_0xab71('0x149')](db[_0xab71('0xbd')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0x1c8')][_0xab71('0x10d')](db['VtigerField'],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db['VtigerField'][_0xab71('0x10d')](db['VtigerField'],{'as':_0xab71('0x1c3'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0x1c8')][_0xab71('0x10d')](db[_0xab71('0x1c8')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0x1c8')][_0xab71('0x149')](db[_0xab71('0x94')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0xab71('0x10d')](db['ServicenowConfiguration'],{'as':_0xab71('0x1b8'),'onDelete':_0xab71('0x10b'),'foreignKey':'AccountId'});db[_0xab71('0xc2')][_0xab71('0x10d')](db[_0xab71('0xc4')],{'as':_0xab71('0x1b9'),'foreignKey':'SubjectId'});db[_0xab71('0xc2')]['hasMany'](db[_0xab71('0xc4')],{'as':_0xab71('0x1bc'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0xc2')]['hasMany'](db[_0xab71('0xc4')],{'as':_0xab71('0x1b5'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xc2')][_0xab71('0x149')](db[_0xab71('0x1c9')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0xc4')][_0xab71('0x10d')](db[_0xab71('0xc4')],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db['ServicenowField'][_0xab71('0x10d')](db[_0xab71('0xc4')],{'as':_0xab71('0x1c3'),'foreignKey':'DescriptionId'});db[_0xab71('0xc4')][_0xab71('0x10d')](db[_0xab71('0xc4')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xc4')]['belongsTo'](db['Variable'],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db[_0xab71('0xc6')][_0xab71('0x10d')](db[_0xab71('0x1ca')],{'as':_0xab71('0x1b8'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0x1ca')]['hasMany'](db[_0xab71('0xc8')],{'as':_0xab71('0x1b9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xab71('0x1ca')][_0xab71('0x10d')](db[_0xab71('0xc8')],{'as':'Descriptions','onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1bd')});db[_0xab71('0x1ca')][_0xab71('0x10d')](db[_0xab71('0xc8')],{'as':_0xab71('0x1b5'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1c1')});db['Dynamics365Configuration'][_0xab71('0x149')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xab71('0x1be')});db[_0xab71('0xc8')][_0xab71('0x10d')](db[_0xab71('0xc8')],{'as':_0xab71('0x1bf'),'foreignKey':_0xab71('0x1ba')});db[_0xab71('0xc8')][_0xab71('0x10d')](db[_0xab71('0xc8')],{'as':_0xab71('0x1c3'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xab71('0x10d')](db[_0xab71('0xc8')],{'as':_0xab71('0x1c0'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xc8')]['belongsTo'](db[_0xab71('0x94')],{'as':_0xab71('0x94'),'foreignKey':_0xab71('0x1c4')});db[_0xab71('0xc9')]['hasMany'](db[_0xab71('0xcb')],{'as':_0xab71('0x1b8'),'onDelete':'cascade','foreignKey':_0xab71('0x1be')});db[_0xab71('0xcb')][_0xab71('0x10d')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xab71('0x1ba')});db[_0xab71('0xcb')][_0xab71('0x10d')](db[_0xab71('0xcd')],{'as':_0xab71('0x1bc'),'foreignKey':'DescriptionId'});db[_0xab71('0xcb')][_0xab71('0x10d')](db[_0xab71('0xcd')],{'as':_0xab71('0x1b5'),'foreignKey':_0xab71('0x1c1')});db[_0xab71('0xcb')][_0xab71('0x149')](db[_0xab71('0xc9')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1be')});db[_0xab71('0xcd')][_0xab71('0x10d')](db[_0xab71('0xcd')],{'as':_0xab71('0x1bf'),'foreignKey':'SubjectId'});db[_0xab71('0xcd')]['hasMany'](db[_0xab71('0xcd')],{'as':_0xab71('0x1c3'),'foreignKey':'DescriptionId'});db[_0xab71('0xcd')][_0xab71('0x10d')](db['FreshsalesField'],{'as':'Field','foreignKey':'FieldId'});db['FreshsalesField'][_0xab71('0x149')](db[_0xab71('0x94')],{'as':_0xab71('0x94'),'foreignKey':'VariableId'});db[_0xab71('0xd0')]['belongsTo'](db[_0xab71('0x5f')],{});db[_0xab71('0xd0')][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':_0xab71('0x172'),'foreignKey':_0xab71('0x162')});db[_0xab71('0xd0')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':'Contact','foreignKey':_0xab71('0x15b')});db[_0xab71('0xd0')][_0xab71('0x149')](db[_0xab71('0x123')],{});db[_0xab71('0xd0')]['belongsTo'](db[_0xab71('0x66')],{});db[_0xab71('0xd0')][_0xab71('0x149')](db[_0xab71('0x109')],{});db['ChatQueueReport'][_0xab71('0x149')](db['ChatQueue'],{});db[_0xab71('0x1cb')][_0xab71('0x149')](db[_0xab71('0x109')],{'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1cc')});db[_0xab71('0x1cb')]['belongsTo'](db[_0xab71('0x109')],{'onDelete':'cascade','foreignKey':_0xab71('0x1cd')});db['JscriptySessionReport'][_0xab71('0x10d')](db[_0xab71('0xd4')],{'foreignKey':'SessionId','onDelete':_0xab71('0x10b')});db['JscriptySessionReport']['hasMany'](db[_0xab71('0x1ce')],{'foreignKey':'SessionId','onDelete':_0xab71('0x10b')});db['SmsQueueReport'][_0xab71('0x149')](db[_0xab71('0x50')],{});db[_0xab71('0x1cf')][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':'List','foreignKey':_0xab71('0x162')});db['SmsQueueReport'][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x1cf')]['belongsTo'](db[_0xab71('0x53')],{});db[_0xab71('0x1cf')][_0xab71('0x149')](db[_0xab71('0x55')],{});db[_0xab71('0x1cf')][_0xab71('0x149')](db[_0xab71('0x109')],{});db[_0xab71('0x1cf')][_0xab71('0x149')](db[_0xab71('0x57')],{});db[_0xab71('0x1d0')][_0xab71('0x10d')](db[_0xab71('0xd6')],{'foreignKey':'ProjectId'});db[_0xab71('0x1d0')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xab71('0x1d1')});db[_0xab71('0x1d0')]['hasMany'](db[_0xab71('0x1ce')],{'foreignKey':_0xab71('0x1d1')});db[_0xab71('0xdd')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x17a'),'through':'user_has_square_projects'});db[_0xab71('0xe2')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':'user_has_teams'});db[_0xab71('0xe2')][_0xab71('0x11b')](db['VoiceQueue'],{'through':_0xab71('0x150'),'as':'VoiceQueues'});db[_0xab71('0xe2')]['belongsToMany'](db[_0xab71('0x12b')],{'through':_0xab71('0x163'),'as':_0xab71('0x12c')});db[_0xab71('0xe2')][_0xab71('0x11b')](db[_0xab71('0x6a')],{'through':_0xab71('0x191'),'as':'ChatQueues'});db['Team'][_0xab71('0x11b')](db[_0xab71('0x4d')],{'through':_0xab71('0x17d'),'as':'FaxQueues'});db[_0xab71('0xe2')][_0xab71('0x11b')](db[_0xab71('0x57')],{'through':_0xab71('0x1d2'),'as':'SmsQueues'});db['Team'][_0xab71('0x11b')](db[_0xab71('0x5d')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xab71('0xe2')][_0xab71('0x11b')](db[_0xab71('0x130')],{'through':_0xab71('0x1d3'),'as':_0xab71('0x1d4')});db['Campaign'][_0xab71('0x10d')](db[_0xab71('0x73')],{'as':_0xab71('0x145'),'foreignKey':_0xab71('0x19b')});db['Campaign'][_0xab71('0x10d')](db[_0xab71('0x75')],{'as':_0xab71('0x112'),'foreignKey':'CampaignId'});db['Campaign'][_0xab71('0x10d')](db[_0xab71('0x77')],{'as':_0xab71('0x1d5'),'foreignKey':_0xab71('0x19b')});db[_0xab71('0x19a')][_0xab71('0x10d')](db[_0xab71('0x146')],{'as':_0xab71('0x147'),'foreignKey':'CampaignId'});db[_0xab71('0x19a')]['belongsTo'](db[_0xab71('0x2b')],{'as':_0xab71('0x2b'),'foreignKey':'TrunkId'});db[_0xab71('0x19a')][_0xab71('0x149')](db[_0xab71('0x2b')],{'as':_0xab71('0x1d6'),'foreignKey':_0xab71('0x14b')});db['Campaign'][_0xab71('0x149')](db[_0xab71('0x82')],{'as':_0xab71('0x82'),'foreignKey':_0xab71('0x14c')});db[_0xab71('0x19a')]['belongsTo'](db[_0xab71('0xdd')],{'as':'SquareProject','foreignKey':_0xab71('0x1d7')});db[_0xab71('0x19a')][_0xab71('0x11b')](db[_0xab71('0xf5')],{'as':'Lists','through':_0xab71('0x1d8')});db[_0xab71('0x19a')][_0xab71('0x11b')](db['CmList'],{'as':_0xab71('0x151'),'through':_0xab71('0x1d9')});db[_0xab71('0x16c')][_0xab71('0x149')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xab71('0x170')});db[_0xab71('0xec')][_0xab71('0x149')](db['MailMessage'],{});db[_0xab71('0xec')]['belongsTo'](db[_0xab71('0x3c')],{});db[_0xab71('0xec')][_0xab71('0x149')](db[_0xab71('0x38')],{'foreignKey':_0xab71('0x1da'),'as':_0xab71('0x1db')});db[_0xab71('0xec')]['belongsTo'](db[_0xab71('0x109')],{'foreignKey':_0xab71('0x1dc'),'as':_0xab71('0x1dd')});db[_0xab71('0xec')]['belongsTo'](db[_0xab71('0x109')],{'foreignKey':_0xab71('0x1de'),'as':'ToAgent'});db['MailTransferReport'][_0xab71('0x149')](db[_0xab71('0x12b')],{'foreignKey':_0xab71('0x1df'),'as':_0xab71('0x1e0')});db[_0xab71('0xec')][_0xab71('0x149')](db[_0xab71('0x38')],{'foreignKey':_0xab71('0x1e1'),'as':_0xab71('0x1e2')});db[_0xab71('0xee')][_0xab71('0x149')](db[_0xab71('0x66')],{});db['ChatTransferReport']['belongsTo'](db[_0xab71('0x123')],{});db[_0xab71('0xee')][_0xab71('0x149')](db[_0xab71('0x5f')],{'foreignKey':_0xab71('0x1e3'),'as':_0xab71('0x1db')});db[_0xab71('0xee')][_0xab71('0x149')](db['User'],{'foreignKey':_0xab71('0x1dc'),'as':_0xab71('0x1dd')});db[_0xab71('0xee')][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':_0xab71('0x1de'),'as':'ToAgent'});db[_0xab71('0xee')][_0xab71('0x149')](db[_0xab71('0x6a')],{'foreignKey':_0xab71('0x1e4'),'as':'ToQueue'});db[_0xab71('0xee')][_0xab71('0x149')](db[_0xab71('0x5f')],{'foreignKey':'ToChatWebsiteId','as':_0xab71('0x1e2')});db[_0xab71('0x1e5')]['belongsTo'](db[_0xab71('0x4b')],{});db[_0xab71('0x1e5')][_0xab71('0x149')](db[_0xab71('0x125')],{});db[_0xab71('0x1e5')][_0xab71('0x149')](db[_0xab71('0x48')],{'foreignKey':_0xab71('0x1e6'),'as':'FromAccount'});db[_0xab71('0x1e5')][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':'FromUserId','as':_0xab71('0x1dd')});db['FaxTransferReport'][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':_0xab71('0x1de'),'as':_0xab71('0x1e7')});db[_0xab71('0x1e5')][_0xab71('0x149')](db[_0xab71('0x4d')],{'foreignKey':_0xab71('0x1e8'),'as':_0xab71('0x1e0')});db['FaxTransferReport'][_0xab71('0x149')](db[_0xab71('0x48')],{'foreignKey':_0xab71('0x1e9'),'as':_0xab71('0x1e2')});db[_0xab71('0xf1')][_0xab71('0x149')](db[_0xab71('0x5b')],{});db[_0xab71('0xf1')][_0xab71('0x149')](db[_0xab71('0x114')],{});db[_0xab71('0xf1')][_0xab71('0x149')](db[_0xab71('0x137')],{'foreignKey':'FromOpenchannelAccountId','as':_0xab71('0x1db')});db['OpenchannelTransferReport'][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':'FromUserId','as':_0xab71('0x1dd')});db['OpenchannelTransferReport'][_0xab71('0x149')](db['User'],{'foreignKey':_0xab71('0x1de'),'as':'ToAgent'});db[_0xab71('0xf1')][_0xab71('0x149')](db[_0xab71('0x5d')],{'foreignKey':'ToOpenchannelQueueId','as':_0xab71('0x1e0')});db[_0xab71('0xf1')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xab71('0x1ea'),'as':_0xab71('0x1e2')});db[_0xab71('0xf3')]['belongsTo'](db['SmsMessage'],{});db[_0xab71('0xf3')][_0xab71('0x149')](db[_0xab71('0x53')],{});db[_0xab71('0xf3')]['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0xab71('0xf3')][_0xab71('0x149')](db['User'],{'foreignKey':_0xab71('0x1dc'),'as':_0xab71('0x1dd')});db['SmsTransferReport'][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':_0xab71('0x1de'),'as':'ToAgent'});db['SmsTransferReport'][_0xab71('0x149')](db[_0xab71('0x57')],{'foreignKey':'ToSmsQueueId','as':_0xab71('0x1e0')});db[_0xab71('0xf3')][_0xab71('0x149')](db[_0xab71('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0xab71('0x10d')](db['Disposition'],{'as':_0xab71('0x15f'),'foreignKey':'ListId','onDelete':_0xab71('0x10b')});db[_0xab71('0xf5')][_0xab71('0x10d')](db['CmCustomField'],{'as':_0xab71('0x1eb'),'foreignKey':_0xab71('0x162')});db['CmList'][_0xab71('0x10d')](db[_0xab71('0x71')],{'as':_0xab71('0x11d'),'onDelete':'cascade','foreignKey':_0xab71('0x162')});db['CmList'][_0xab71('0x10d')](db[_0xab71('0x75')],{'as':_0xab71('0x112'),'foreignKey':_0xab71('0x162')});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0xab71('0x1ec'),'foreignKey':_0xab71('0x162')});db['CmList'][_0xab71('0x10d')](db['ReportAgentPreview'],{'as':_0xab71('0x113'),'foreignKey':'ListId'});db[_0xab71('0xf5')][_0xab71('0x11b')](db[_0xab71('0x1d')],{'as':_0xab71('0x1ed'),'through':_0xab71('0x14e')});db[_0xab71('0xf5')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':'Agents','through':_0xab71('0x120')});db[_0xab71('0xf7')]['hasMany'](db['VoiceExtension'],{'as':_0xab71('0x111'),'onDelete':_0xab71('0x10b')});db['VoicePrefix'][_0xab71('0x11b')](db['User'],{'as':_0xab71('0x14f'),'through':_0xab71('0x1ee')});db['UserProfile']['hasMany'](db[_0xab71('0x109')],{'as':_0xab71('0x17a'),'foreignKey':_0xab71('0x1ef')});db[_0xab71('0xf9')]['hasMany'](db[_0xab71('0xfa')],{'as':'UserProfileSections','foreignKey':_0xab71('0x1ef'),'onDelete':'cascade'});db[_0xab71('0xfa')][_0xab71('0x10d')](db['UserProfileResource'],{'as':_0xab71('0x1f0'),'foreignKey':_0xab71('0x1f1'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x13a')][_0xab71('0x10d')](db[_0xab71('0x7e')],{'as':_0xab71('0x15f'),'foreignKey':_0xab71('0x1f2'),'onDelete':_0xab71('0x10b')});db[_0xab71('0x13a')]['hasMany'](db[_0xab71('0x7c')],{'as':_0xab71('0x160'),'foreignKey':_0xab71('0x1f2')});db[_0xab71('0x13a')][_0xab71('0x10d')](db[_0xab71('0x103')],{'as':_0xab71('0x155'),'foreignKey':_0xab71('0x1f2')});db[_0xab71('0x13a')][_0xab71('0x10d')](db[_0xab71('0x101')],{'as':'Interactions'});db[_0xab71('0x13a')][_0xab71('0x10d')](db['WhatsappApplication'],{'as':_0xab71('0x141')});db[_0xab71('0x13a')][_0xab71('0x149')](db[_0xab71('0xf5')],{'as':'List','foreignKey':_0xab71('0x162')});db[_0xab71('0x13a')][_0xab71('0x149')](db[_0xab71('0x84')],{'as':_0xab71('0x14d'),'foreignKey':_0xab71('0x176')});db['WhatsappAccount'][_0xab71('0x11b')](db['User'],{'as':_0xab71('0x14f'),'through':_0xab71('0x13c')});db[_0xab71('0xff')]['belongsTo'](db[_0xab71('0x109')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0xab71('0x130')],{'onDelete':_0xab71('0x171')});db[_0xab71('0xff')][_0xab71('0x149')](db[_0xab71('0x13a')],{'onDelete':_0xab71('0x171')});db[_0xab71('0xff')][_0xab71('0x149')](db['Interval'],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x14c')});db[_0xab71('0xff')][_0xab71('0x149')](db[_0xab71('0x8b')],{'onDelete':_0xab71('0x171'),'foreignKey':_0xab71('0x181')});db[_0xab71('0x101')][_0xab71('0x10d')](db[_0xab71('0x103')],{'as':_0xab71('0x155'),'onDelete':_0xab71('0x10b'),'foreignKey':_0xab71('0x1f3')});db[_0xab71('0x101')][_0xab71('0x149')](db[_0xab71('0x13a')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1f2')});db[_0xab71('0x101')][_0xab71('0x149')](db[_0xab71('0x71')],{'as':_0xab71('0x167'),'foreignKey':_0xab71('0x15b')});db[_0xab71('0x101')][_0xab71('0x149')](db[_0xab71('0x109')],{'as':_0xab71('0x168'),'foreignKey':_0xab71('0x10c')});db[_0xab71('0x101')][_0xab71('0x11b')](db[_0xab71('0x8b')],{'through':_0xab71('0x1f4'),'as':_0xab71('0x16a')});db[_0xab71('0x101')]['belongsToMany'](db[_0xab71('0x8b')],{'through':'whatsapp_interaction_has_tags','as':_0xab71('0x16b')});db['WhatsappInteraction']['belongsToMany'](db[_0xab71('0x109')],{'as':'Users','through':_0xab71('0x129'),'foreignKey':_0xab71('0x1f3')});db[_0xab71('0x103')][_0xab71('0x149')](db['User'],{'as':_0xab71('0x109')});db[_0xab71('0x103')][_0xab71('0x149')](db[_0xab71('0x71')],{'onDelete':_0xab71('0x10b'),'as':_0xab71('0x167')});db[_0xab71('0x103')][_0xab71('0x149')](db[_0xab71('0x101')],{'onDelete':_0xab71('0x10b'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xab71('0x149')](db[_0xab71('0x13a')],{'as':_0xab71('0x166'),'foreignKey':_0xab71('0x1f2')});db[_0xab71('0x1f5')][_0xab71('0x149')](db[_0xab71('0x13a')],{});db[_0xab71('0x1f5')][_0xab71('0x149')](db['CmList'],{'as':_0xab71('0x172'),'foreignKey':'ListId'});db[_0xab71('0x1f5')][_0xab71('0x149')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xab71('0x149')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0xab71('0x149')](db[_0xab71('0x130')],{});db[_0xab71('0x1f5')][_0xab71('0x149')](db[_0xab71('0x103')],{});db[_0xab71('0x1f5')][_0xab71('0x149')](db[_0xab71('0x109')],{});db['WhatsappTransferReport'][_0xab71('0x149')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0xab71('0x106')][_0xab71('0x149')](db[_0xab71('0x13a')],{'foreignKey':_0xab71('0x1f6'),'as':_0xab71('0x1db')});db[_0xab71('0x106')][_0xab71('0x149')](db[_0xab71('0x13a')],{'foreignKey':_0xab71('0x1f7'),'as':_0xab71('0x1e2')});db[_0xab71('0x106')][_0xab71('0x149')](db[_0xab71('0x130')],{'foreignKey':'ToQueueId','as':_0xab71('0x1e0')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xab71('0x1dc'),'as':_0xab71('0x1dd')});db['WhatsappTransferReport'][_0xab71('0x149')](db[_0xab71('0x109')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xab71('0x130')][_0xab71('0x11b')](db[_0xab71('0x109')],{'as':_0xab71('0x14f'),'through':'UserWhatsappQueue','foreignKey':_0xab71('0x1f8')});db[_0xab71('0x130')][_0xab71('0x11b')](db[_0xab71('0xe2')],{'through':'team_has_whatsapp_queues','as':_0xab71('0x164')});module[_0xab71('0x1f9')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x4386=['TeamVoiceQueue','hasOne','cascade','UserId','Recordings','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','MailQueue','MailQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','UserOpenchannelQueue','cm_user_has_lists','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','ListId','Account','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','Exntensions','FaxInteractionId','ContactId','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','CmContactId','Company','cm_contact_has_tags','CmHopperId','Agent','All','OneAll','Any','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','Schedule','DefaultReportId','CustomReportId','Sound','Mohs','mail_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','Condition','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','SalesforceAccount','AccountId','Subjects','SubjectId','Descriptions','Description','Field','FieldId','DescriptionId','VariableId','Configurations','int_desk_configuration_has_tags','Subject','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','FreshsalesField','FreshsalesAccount','FromId','ToId','SessionId','JscriptyProject','ProjectId','user_has_square_projects','user_has_teams','VoiceQueues','team_has_mail_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','WhatsappQueueId','path','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8','utf8_general_ci','sequelizeHistory','mysql','utf8mb4','database','username','password','options','User','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/schedule/schedule.model','../api/sound/sound.model','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','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','Realtime'];(function(_0x4d334e,_0x5a0114){var _0xc542e4=function(_0x116e2c){while(--_0x116e2c){_0x4d334e['push'](_0x4d334e['shift']());}};_0xc542e4(++_0x5a0114);}(_0x4386,0xe9));var _0x6438=function(_0x3ee8d1,_0x54afbd){_0x3ee8d1=_0x3ee8d1-0x0;var _0x5e6660=_0x4386[_0x3ee8d1];return _0x5e6660;};'use strict';var path=require(_0x6438('0x0'));var config=require(_0x6438('0x1'));var Sequelize=require('sequelize');var _=require(_0x6438('0x2'));var jstz=require(_0x6438('0x3'));var timezone=jstz[_0x6438('0x4')]();config[_0x6438('0x5')]=_[_0x6438('0x6')](config['sequelize'],{'database':_0x6438('0x7'),'username':_0x6438('0x8'),'password':_0x6438('0x9'),'options':{'host':_0x6438('0xa'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x6438('0xb')](),'define':{'charset':_0x6438('0xc'),'collate':_0x6438('0xd')}}});config[_0x6438('0xe')]=_[_0x6438('0x6')](config[_0x6438('0xe')],{'database':_0x6438('0x7'),'username':_0x6438('0x8'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x6438('0xf'),'dialectOptions':{'charset':_0x6438('0x10')},'logging':![],'timezone':timezone[_0x6438('0xb')](),'define':{'charset':_0x6438('0xc'),'collate':_0x6438('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6438('0x5')][_0x6438('0x11')],config['sequelize'][_0x6438('0x12')],config['sequelize'][_0x6438('0x13')],config[_0x6438('0x5')][_0x6438('0x14')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x6438('0x11')],config[_0x6438('0xe')][_0x6438('0x12')],config['sequelizeHistory'][_0x6438('0x13')],config['sequelizeHistory'][_0x6438('0x14')])};db[_0x6438('0x15')]=db['sequelize'][_0x6438('0x16')]('../api/user/user.model');db[_0x6438('0x17')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x6438('0x18')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x19'));db[_0x6438('0x1a')]=db[_0x6438('0x5')]['import'](_0x6438('0x1b'));db[_0x6438('0x1c')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x1d'));db['VoiceQueue']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x1e'));db[_0x6438('0x1f')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/voiceRecording/voiceRecording.model');db[_0x6438('0x20')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x21'));db[_0x6438('0x22')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x23'));db['VoiceMailMessage']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x24'));db[_0x6438('0x25')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x26'));db[_0x6438('0x27')]=db[_0x6438('0x5')]['import'](_0x6438('0x28'));db[_0x6438('0x29')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x2a'));db['VoiceQueueReport']=db['sequelize'][_0x6438('0x16')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x6438('0x2b')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x2c'));db['Trunk']=db['sequelize']['import'](_0x6438('0x2d'));db[_0x6438('0x2e')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x2f'));db['UserVoiceQueueRt']=db['sequelize'][_0x6438('0x16')](_0x6438('0x30'));db[_0x6438('0x31')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x32'));db[_0x6438('0x33')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x34'));db[_0x6438('0x35')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x36'));db[_0x6438('0x37')]=db[_0x6438('0x5')]['import'](_0x6438('0x38'));db['UserSmsQueue']=db[_0x6438('0x5')]['import'](_0x6438('0x39'));db['UserOpenchannelQueue']=db['sequelize'][_0x6438('0x16')](_0x6438('0x3a'));db[_0x6438('0x3b')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x3c'));db[_0x6438('0x3d')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/mailServerIn/mailServerIn.model');db[_0x6438('0x3e')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x3f'));db[_0x6438('0x40')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x41'));db['MailQueue']=db[_0x6438('0x5')]['import'](_0x6438('0x42'));db[_0x6438('0x43')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x44'));db[_0x6438('0x45')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x46'));db[_0x6438('0x47')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x48'));db[_0x6438('0x49')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x4a'));db[_0x6438('0x4b')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x4c'));db[_0x6438('0x4d')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x4e'));db[_0x6438('0x4f')]=db['sequelize'][_0x6438('0x16')]('../api/dashboardItem/dashboardItem.model');db[_0x6438('0x50')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x51'));db[_0x6438('0x52')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x53'));db[_0x6438('0x54')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x55'));db[_0x6438('0x56')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x57'));db[_0x6438('0x58')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/faxQueue/faxQueue.model');db[_0x6438('0x59')]=db[_0x6438('0x5')]['import']('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x6438('0x5')]['import'](_0x6438('0x5a'));db[_0x6438('0x5b')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/smsApplication/smsApplication.model');db[_0x6438('0x5c')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/smsInteraction/smsInteraction.model');db[_0x6438('0x5d')]=db['sequelize']['import'](_0x6438('0x5e'));db[_0x6438('0x5f')]=db[_0x6438('0x5')]['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x6438('0x5')]['import'](_0x6438('0x60'));db[_0x6438('0x61')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x62'));db[_0x6438('0x63')]=db[_0x6438('0x5')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x6438('0x64')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x65'));db[_0x6438('0x66')]=db[_0x6438('0x5')]['import'](_0x6438('0x67'));db[_0x6438('0x68')]=db['sequelize'][_0x6438('0x16')]('../api/chatWebsite/chatWebsite.model');db[_0x6438('0x69')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x6438('0x6a')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x6b'));db[_0x6438('0x6c')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x6d'));db[_0x6438('0x6e')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x6f'));db[_0x6438('0x70')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x71'));db[_0x6438('0x72')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x73'));db[_0x6438('0x74')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x75'));db[_0x6438('0x76')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x77'));db[_0x6438('0x78')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/cmCompany/cmCompany.model');db[_0x6438('0x79')]=db[_0x6438('0x5')]['import'](_0x6438('0x7a'));db[_0x6438('0x7b')]=db[_0x6438('0x5')]['import']('../api/cmHopper/cmHopper.model');db[_0x6438('0x7c')]=db[_0x6438('0x5')]['import'](_0x6438('0x7d'));db[_0x6438('0x7e')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x7f'));db[_0x6438('0x80')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x81'));db['ReportAgentPreview']=db['sequelize'][_0x6438('0x16')](_0x6438('0x82'));db['CmCustomField']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x83'));db[_0x6438('0x84')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x85'));db[_0x6438('0x86')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x87'));db[_0x6438('0x88')]=db[_0x6438('0x5')]['import'](_0x6438('0x89'));db[_0x6438('0x8a')]=db[_0x6438('0x5')]['import'](_0x6438('0x8b'));db['Condition']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x8c'));db['Interval']=db[_0x6438('0x5')][_0x6438('0x16')]('../api/interval/interval.model');db[_0x6438('0x8d')]=db[_0x6438('0x5')]['import'](_0x6438('0x8e'));db[_0x6438('0x8f')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/cdr/cdr.model');db[_0x6438('0x90')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x91'));db['Sound']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x92'));db[_0x6438('0x93')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x94'));db[_0x6438('0x95')]=db['sequelize']['import'](_0x6438('0x96'));db[_0x6438('0x97')]=db[_0x6438('0x5')]['import'](_0x6438('0x98'));db[_0x6438('0x99')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x9a'));db[_0x6438('0x9b')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x9c'));db[_0x6438('0x9d')]=db[_0x6438('0x5')]['import'](_0x6438('0x9e'));db[_0x6438('0x9f')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xa0'));db['Integration']=db[_0x6438('0x5')][_0x6438('0x16')]('../api/integration/integration.model');db[_0x6438('0xa1')]=db['sequelize'][_0x6438('0x16')]('../api/integrationReport/integrationReport.model');db[_0x6438('0xa2')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xa3'));db[_0x6438('0xa4')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x6438('0xa5')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x6438('0xa6')]=db[_0x6438('0x5')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x6438('0xa7')]=db[_0x6438('0x5')]['import'](_0x6438('0xa8'));db[_0x6438('0xa9')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xaa'));db['SalesforceAccount']=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xab'));db[_0x6438('0xac')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xad'));db[_0x6438('0xae')]=db['sequelize']['import'](_0x6438('0xaf'));db[_0x6438('0xb0')]=db['sequelize']['import'](_0x6438('0xb1'));db[_0x6438('0xb2')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xb3'));db[_0x6438('0xb4')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xb5'));db[_0x6438('0xb6')]=db[_0x6438('0x5')]['import'](_0x6438('0xb7'));db[_0x6438('0xb8')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x6438('0xb9')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intDeskField/intDeskField.model');db[_0x6438('0xba')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xbb'));db[_0x6438('0xbc')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x6438('0xbd')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xbe'));db[_0x6438('0xbf')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xc0'));db[_0x6438('0xc1')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x6438('0x5')]['import'](_0x6438('0xc2'));db[_0x6438('0xc3')]=db[_0x6438('0x5')]['import'](_0x6438('0xc4'));db[_0x6438('0xc5')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xc6'));db[_0x6438('0xc7')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xc8'));db['VtigerAccount']=db['sequelize'][_0x6438('0x16')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x6438('0xc9')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x6438('0xca')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xcb'));db[_0x6438('0xcc')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xcd'));db['ServicenowConfiguration']=db['sequelize']['import'](_0x6438('0xce'));db[_0x6438('0xcf')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xd0'));db[_0x6438('0xd1')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xd2'));db['Dynamics365Configuration']=db[_0x6438('0x5')]['import'](_0x6438('0xd3'));db[_0x6438('0xd4')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xd5'));db['FreshsalesAccount']=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x6438('0xd6')]=db['sequelize']['import'](_0x6438('0xd7'));db['FreshsalesField']=db[_0x6438('0x5')][_0x6438('0x16')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x6438('0xd8')]=db[_0x6438('0x5')]['import'](_0x6438('0xd9'));db[_0x6438('0xda')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xdb'));db[_0x6438('0xdc')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/chatQueueReport/chatQueueReport.model');db[_0x6438('0xdd')]=db[_0x6438('0x5')]['import'](_0x6438('0xde'));db[_0x6438('0xdf')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xe0'));db[_0x6438('0xe1')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xe2'));db[_0x6438('0xe3')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xe4'));db[_0x6438('0xe5')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xe6'));db[_0x6438('0xe7')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/squareReport/squareReport.model');db[_0x6438('0xe8')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x6438('0x5')]['import'](_0x6438('0xe9'));db['Setting']=db[_0x6438('0x5')][_0x6438('0x16')]('../api/setting/setting.model');db[_0x6438('0xea')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xeb'));db['SquareProject']=db['sequelize']['import'](_0x6438('0xec'));db[_0x6438('0xed')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xee'));db[_0x6438('0xef')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0x6438('0x16')]('../api/team/team.model');db[_0x6438('0xf0')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xf1'));db[_0x6438('0xf2')]=db['sequelize'][_0x6438('0x16')](_0x6438('0xf3'));db[_0x6438('0xf4')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/migration/migration.model');db[_0x6438('0xf5')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xf6'));db[_0x6438('0xf7')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xf8'));db[_0x6438('0xf9')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xfa'));db[_0x6438('0xfb')]=db[_0x6438('0x5')]['import'](_0x6438('0xfc'));db[_0x6438('0xfd')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0xfe'));db[_0x6438('0xff')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x6438('0x100')]=db['sequelize'][_0x6438('0x16')](_0x6438('0x101'));db[_0x6438('0x102')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x103'));db['VoicePrefix']=db[_0x6438('0x5')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x6438('0x104')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/userProfile/userProfile.model');db[_0x6438('0x105')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/userProfileSection/userProfileSection.model');db[_0x6438('0x106')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x107'));db[_0x6438('0x108')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x109'));db['WhatsappAccount']=db['sequelize'][_0x6438('0x16')](_0x6438('0x10a'));db[_0x6438('0x10b')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0x6438('0x5')]['import'](_0x6438('0x10c'));db[_0x6438('0x10d')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/whatsappMessage/whatsappMessage.model');db[_0x6438('0x10e')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x10f'));db['WhatsappTransferReport']=db[_0x6438('0x5')]['import'](_0x6438('0x110'));db[_0x6438('0x111')]=db[_0x6438('0x5')][_0x6438('0x16')](_0x6438('0x112'));db[_0x6438('0x113')]=db[_0x6438('0x5')][_0x6438('0x16')]('../api/cloudProvider/cloudProvider.model');db[_0x6438('0x114')]=db['sequelize']['import']('../api/realtime/realtime.model');db[_0x6438('0x115')]=db['sequelize'][_0x6438('0x16')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x6438('0x15')][_0x6438('0x116')](db[_0x6438('0x22')],{'as':_0x6438('0x22'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')]['hasMany'](db[_0x6438('0x1f')],{'as':_0x6438('0x119'),'foreignKey':'UserId'});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x11b')],{'as':_0x6438('0x11c'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')][_0x6438('0x11a')](db['VoiceExtension'],{'as':_0x6438('0x11d'),'onDelete':_0x6438('0x117'),'hooks':!![]});db['User'][_0x6438('0x11a')](db[_0x6438('0x7e')],{'as':_0x6438('0x11e'),'foreignKey':_0x6438('0x118')});db['User'][_0x6438('0x11a')](db[_0x6438('0x80')],{'as':_0x6438('0x11f'),'foreignKey':'UserId'});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x120')],{'as':_0x6438('0x120'),'foreignKey':'UserId'});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x63')],{'as':_0x6438('0x121'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x6c')],{'as':_0x6438('0x122'),'foreignKey':'UserId'});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x5c')],{'as':_0x6438('0x123'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x54')],{'as':_0x6438('0x124'),'foreignKey':_0x6438('0x118')});db['User'][_0x6438('0x11a')](db['MailInteraction'],{'as':_0x6438('0x125'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')][_0x6438('0x11a')](db[_0x6438('0x126')],{'as':_0x6438('0x127'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x15')][_0x6438('0x11a')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0x6438('0x128')});db[_0x6438('0x15')][_0x6438('0x129')](db[_0x6438('0x104')],{'as':_0x6438('0x104'),'foreignKey':_0x6438('0x12a')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x74')],{'as':'Groups','through':'chat_group_has_users'});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x79')],{'as':_0x6438('0x12c'),'through':_0x6438('0x12d')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x102')],{'as':'Lists','through':'cm_user_has_lists'});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x12e')],{'through':'user_has_teams'});db['User'][_0x6438('0x12b')](db['MailInteraction'],{'as':_0x6438('0x125'),'through':_0x6438('0x12f')});db[_0x6438('0x15')][_0x6438('0x12b')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x6438('0x130')});db[_0x6438('0x15')]['belongsToMany'](db[_0x6438('0x54')],{'as':_0x6438('0x124'),'through':_0x6438('0x131')});db['User'][_0x6438('0x12b')](db['SmsInteraction'],{'as':_0x6438('0x123'),'through':_0x6438('0x132')});db['User'][_0x6438('0x12b')](db[_0x6438('0x63')],{'as':_0x6438('0x121'),'through':_0x6438('0x133')});db[_0x6438('0x15')]['belongsToMany'](db[_0x6438('0x126')],{'as':_0x6438('0x127'),'through':_0x6438('0x134')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x135')],{'as':'VoiceQueues','through':_0x6438('0x31'),'required':![]});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x136')],{'as':_0x6438('0x137'),'through':_0x6438('0x35'),'required':![]});db['User'][_0x6438('0x12b')](db[_0x6438('0x72')],{'as':'ChatQueues','through':_0x6438('0x33'),'required':![],'hooks':!![]});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x58')],{'as':_0x6438('0x138'),'through':_0x6438('0x37'),'required':![]});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x5f')],{'as':_0x6438('0x139'),'through':_0x6438('0x13a'),'required':![]});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x66')],{'as':_0x6438('0x13b'),'through':_0x6438('0x13c'),'required':![]});db[_0x6438('0x15')]['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User'][_0x6438('0x12b')](db[_0x6438('0x102')],{'through':_0x6438('0x13d')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x13e')],{'as':_0x6438('0x13f'),'through':_0x6438('0x140'),'required':![]});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x68')],{'as':'ChatWebsites','through':_0x6438('0x141')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x50')],{'as':_0x6438('0x142'),'through':_0x6438('0x143')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x40')],{'as':_0x6438('0x144'),'through':_0x6438('0x145')});db[_0x6438('0x15')]['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x6438('0x146')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x147')],{'as':'SmsAccounts','through':_0x6438('0x148')});db[_0x6438('0x15')][_0x6438('0x12b')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x6438('0x149')});db[_0x6438('0x15')][_0x6438('0x12b')](db[_0x6438('0x14a')],{'as':_0x6438('0x14b'),'through':'user_has_square_projects'});db[_0x6438('0x17')][_0x6438('0x11a')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x6438('0x14c')});db['VoiceContext']['hasMany'](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x6438('0x1a')][_0x6438('0x11a')](db[_0x6438('0x1a')],{'as':_0x6438('0x14d'),'onDelete':_0x6438('0x117')});db[_0x6438('0x1c')][_0x6438('0x12b')](db['Sound'],{'as':_0x6438('0x14e'),'through':_0x6438('0x14f')});db[_0x6438('0x135')][_0x6438('0x11a')](db[_0x6438('0x11b')],{'as':_0x6438('0x150'),'foreignKey':_0x6438('0x151')});db[_0x6438('0x135')][_0x6438('0x11a')](db[_0x6438('0x7b')],{'as':_0x6438('0x152'),'foreignKey':'VoiceQueueId'});db[_0x6438('0x135')][_0x6438('0x11a')](db[_0x6438('0x7e')],{'as':_0x6438('0x11e'),'foreignKey':_0x6438('0x151')});db[_0x6438('0x135')][_0x6438('0x11a')](db[_0x6438('0x80')],{'as':_0x6438('0x153'),'foreignKey':_0x6438('0x151')});db[_0x6438('0x135')][_0x6438('0x11a')](db['ReportAgentPreview'],{'as':_0x6438('0x120'),'foreignKey':'VoiceQueueId'});db[_0x6438('0x135')]['hasMany'](db[_0x6438('0x7c')],{'as':_0x6438('0x154'),'foreignKey':_0x6438('0x151')});db[_0x6438('0x135')][_0x6438('0x11a')](db[_0x6438('0xe3')],{'as':_0x6438('0x155'),'foreignKey':_0x6438('0x151')});db[_0x6438('0x135')][_0x6438('0x129')](db[_0x6438('0x156')],{'as':'Trunk','foreignKey':_0x6438('0x157')});db[_0x6438('0x135')][_0x6438('0x129')](db['Trunk'],{'as':_0x6438('0x158'),'foreignKey':_0x6438('0x159')});db[_0x6438('0x135')]['belongsTo'](db[_0x6438('0x15a')],{'as':_0x6438('0x15a'),'foreignKey':_0x6438('0x15b')});db['VoiceQueue'][_0x6438('0x129')](db['Pause'],{'as':_0x6438('0x15c'),'foreignKey':_0x6438('0x15d')});db[_0x6438('0x135')][_0x6438('0x12b')](db[_0x6438('0x102')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x6438('0x135')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x31')});db[_0x6438('0x135')]['belongsToMany'](db[_0x6438('0x12e')],{'as':_0x6438('0x15f'),'through':_0x6438('0x115')});db['VoiceQueue']['belongsToMany'](db[_0x6438('0x102')],{'as':_0x6438('0x160'),'through':'voice_queues_has_cm_blacklists'});db[_0x6438('0x1f')][_0x6438('0x129')](db['User'],{'as':_0x6438('0x15'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x20')]['belongsTo'](db[_0x6438('0x15')],{'as':_0x6438('0x15'),'foreignKey':'UserId'});db[_0x6438('0x22')][_0x6438('0x11a')](db[_0x6438('0x161')],{'as':_0x6438('0x162'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x163'),'sourceKey':_0x6438('0x164')});db[_0x6438('0x161')][_0x6438('0x129')](db[_0x6438('0x22')],{'foreignKey':_0x6438('0x163'),'targetKey':_0x6438('0x164')});db[_0x6438('0x25')][_0x6438('0x11a')](db[_0x6438('0x165')],{'as':'QueueCalls','foreignKey':_0x6438('0x166'),'constraints':![]});db['VoiceCallReport'][_0x6438('0x11a')](db[_0x6438('0x29')],{'as':_0x6438('0x167'),'foreignKey':_0x6438('0x166'),'constraints':![]});db[_0x6438('0x25')][_0x6438('0x129')](db[_0x6438('0x15')],{'as':_0x6438('0x15'),'foreignKey':_0x6438('0x118')});db['VoiceCallReport'][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':'ContactId'});db[_0x6438('0x3d')][_0x6438('0x129')](db['MailAccount'],{'as':_0x6438('0x40'),'foreignKey':_0x6438('0x169')});db[_0x6438('0x3e')][_0x6438('0x129')](db['MailAccount'],{'as':_0x6438('0x40'),'foreignKey':_0x6438('0x169')});db[_0x6438('0x40')][_0x6438('0x116')](db['MailServerIn'],{'as':_0x6438('0x16a'),'onDelete':_0x6438('0x117')});db[_0x6438('0x40')][_0x6438('0x116')](db[_0x6438('0x3e')],{'as':_0x6438('0x16b'),'onDelete':_0x6438('0x117')});db[_0x6438('0x40')]['hasMany'](db[_0x6438('0x8a')],{'as':_0x6438('0x16c'),'foreignKey':'MailAccountId','onDelete':_0x6438('0x117')});db[_0x6438('0x40')][_0x6438('0x11a')](db[_0x6438('0x88')],{'as':_0x6438('0x16d'),'foreignKey':_0x6438('0x169')});db['MailAccount']['hasMany'](db[_0x6438('0x47')],{'as':_0x6438('0x162'),'foreignKey':'MailAccountId'});db[_0x6438('0x40')][_0x6438('0x11a')](db['MailInteraction'],{'as':_0x6438('0x16e')});db['MailAccount']['hasMany'](db['MailApplication'],{'as':_0x6438('0x14d')});db[_0x6438('0x40')][_0x6438('0x129')](db['CmList'],{'as':'List','foreignKey':_0x6438('0x16f')});db[_0x6438('0x40')][_0x6438('0x129')](db[_0x6438('0x9b')],{'as':_0x6438('0x9b'),'foreignKey':'TemplateId'});db['MailAccount']['belongsTo'](db[_0x6438('0x8d')],{'as':_0x6438('0x15c'),'foreignKey':_0x6438('0x15d')});db[_0x6438('0x40')][_0x6438('0x12b')](db['User'],{'as':'Agents','through':_0x6438('0x145')});db[_0x6438('0x136')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':'Agents','through':_0x6438('0x35')});db[_0x6438('0x136')][_0x6438('0x12b')](db[_0x6438('0x12e')],{'through':'team_has_mail_queues','as':_0x6438('0x15f')});db[_0x6438('0x45')][_0x6438('0x11a')](db[_0x6438('0x47')],{'as':_0x6438('0x162'),'onDelete':_0x6438('0x117'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x6438('0x129')](db['MailAccount'],{'as':_0x6438('0x170'),'foreignKey':'MailAccountId'});db[_0x6438('0x45')][_0x6438('0x129')](db[_0x6438('0x79')],{'as':'Contact','foreignKey':'ContactId'});db[_0x6438('0x45')]['belongsTo'](db[_0x6438('0x15')],{'as':'Owner','foreignKey':_0x6438('0x118')});db[_0x6438('0x45')][_0x6438('0x12b')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x6438('0x171')});db[_0x6438('0x45')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':'mail_interaction_has_tags','as':_0x6438('0x172')});db[_0x6438('0x45')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'through':_0x6438('0x12f'),'foreignKey':_0x6438('0x174')});db[_0x6438('0x47')][_0x6438('0x11a')](db['Attachment'],{'as':_0x6438('0x175'),'onDelete':_0x6438('0x117')});db[_0x6438('0x47')][_0x6438('0x129')](db['User'],{'as':'User'});db[_0x6438('0x47')][_0x6438('0x129')](db['CmContact'],{'onDelete':'cascade','as':_0x6438('0x168')});db[_0x6438('0x47')][_0x6438('0x129')](db[_0x6438('0x45')],{'as':_0x6438('0x176'),'foreignKey':'MailInteractionId'});db[_0x6438('0x47')][_0x6438('0x129')](db[_0x6438('0x40')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x169')});db[_0x6438('0x47')][_0x6438('0x129')](db[_0x6438('0x68')],{'as':_0x6438('0x68'),'foreignKey':_0x6438('0x177')});db['MailMessage'][_0x6438('0x129')](db[_0x6438('0x70')],{'as':_0x6438('0x70'),'foreignKey':_0x6438('0x178')});db[_0x6438('0x49')][_0x6438('0x129')](db['User'],{'onDelete':_0x6438('0x179')});db[_0x6438('0x49')][_0x6438('0x129')](db['MailQueue'],{'onDelete':_0x6438('0x179')});db['MailApplication'][_0x6438('0x129')](db['MailAccount'],{'onDelete':_0x6438('0x179')});db[_0x6438('0x49')]['belongsTo'](db['Interval'],{'onDelete':_0x6438('0x179'),'foreignKey':'IntervalId'});db['MailApplication'][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x17a')});db[_0x6438('0x4b')][_0x6438('0x129')](db[_0x6438('0x40')],{});db[_0x6438('0x4b')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':'ListId'});db[_0x6438('0x4b')]['belongsTo'](db['CmContact'],{'as':_0x6438('0x168'),'foreignKey':'ContactId'});db[_0x6438('0x4b')][_0x6438('0x129')](db[_0x6438('0x45')],{});db['MailQueueReport']['belongsTo'](db[_0x6438('0x47')],{});db[_0x6438('0x4b')][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0x4b')][_0x6438('0x129')](db[_0x6438('0x136')],{});db[_0x6438('0x4d')][_0x6438('0x11a')](db[_0x6438('0x4f')],{'as':_0x6438('0x17c'),'onDelete':_0x6438('0x117')});db['FaxAccount'][_0x6438('0x11a')](db[_0x6438('0x8a')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':'cascade'});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x6438('0x16d'),'foreignKey':_0x6438('0x17d')});db[_0x6438('0x50')]['hasMany'](db[_0x6438('0x54')],{'as':_0x6438('0x16e')});db['FaxAccount'][_0x6438('0x11a')](db[_0x6438('0x52')],{'as':_0x6438('0x14d')});db[_0x6438('0x50')][_0x6438('0x11a')](db[_0x6438('0x1a')],{'as':_0x6438('0x17e'),'onDelete':_0x6438('0x117')});db[_0x6438('0x50')][_0x6438('0x11a')](db[_0x6438('0x56')],{'as':'Messages'});db['FaxAccount'][_0x6438('0x129')](db[_0x6438('0x156')],{'as':_0x6438('0x156')});db[_0x6438('0x50')][_0x6438('0x129')](db['CmList'],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0x50')]['belongsTo'](db[_0x6438('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x6438('0x15d')});db[_0x6438('0x50')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x143')});db['FaxApplication'][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x52')]['belongsTo'](db[_0x6438('0x58')],{'onDelete':_0x6438('0x179')});db['FaxApplication'][_0x6438('0x129')](db[_0x6438('0x50')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x52')][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x17a')});db[_0x6438('0x54')][_0x6438('0x11a')](db['FaxMessage'],{'as':_0x6438('0x162'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x17f')});db['FaxInteraction'][_0x6438('0x129')](db[_0x6438('0x50')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x17d')});db['FaxInteraction'][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x54')]['belongsTo'](db[_0x6438('0x15')],{'as':_0x6438('0x181'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x54')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':_0x6438('0x182'),'as':'Tags'});db[_0x6438('0x54')]['belongsToMany'](db['Tag'],{'through':_0x6438('0x182'),'as':_0x6438('0x172')});db[_0x6438('0x54')]['belongsToMany'](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'through':'user_has_fax_interactions','foreignKey':_0x6438('0x17f')});db[_0x6438('0x56')][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x117'),'as':'User'});db[_0x6438('0x56')][_0x6438('0x129')](db[_0x6438('0x54')],{'as':'Interaction','foreignKey':_0x6438('0x17f')});db[_0x6438('0x56')][_0x6438('0x129')](db[_0x6438('0x79')],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x168')});db[_0x6438('0x56')][_0x6438('0x129')](db[_0x6438('0xf5')],{'as':_0x6438('0xf5'),'foreignKey':_0x6438('0x183')});db[_0x6438('0x56')][_0x6438('0x129')](db[_0x6438('0x50')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x17d')});db[_0x6438('0x58')]['belongsToMany'](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x37')});db['FaxQueue'][_0x6438('0x12b')](db[_0x6438('0x12e')],{'through':_0x6438('0x184'),'as':'Teams'});db['FaxQueueReport'][_0x6438('0x129')](db[_0x6438('0x50')],{});db[_0x6438('0x59')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0x59')][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x59')][_0x6438('0x129')](db[_0x6438('0x54')],{});db[_0x6438('0x59')][_0x6438('0x129')](db[_0x6438('0x56')],{});db['FaxQueueReport'][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0x59')][_0x6438('0x129')](db[_0x6438('0x58')],{});db[_0x6438('0x147')][_0x6438('0x11a')](db[_0x6438('0x8a')],{'as':_0x6438('0x16c'),'foreignKey':_0x6438('0x185'),'onDelete':_0x6438('0x117')});db['SmsAccount'][_0x6438('0x11a')](db[_0x6438('0x88')],{'as':'Answers','foreignKey':_0x6438('0x185')});db[_0x6438('0x147')]['hasMany'](db[_0x6438('0x5d')],{'as':_0x6438('0x162'),'foreignKey':_0x6438('0x185')});db[_0x6438('0x147')]['hasMany'](db[_0x6438('0x5c')],{'as':_0x6438('0x16e')});db[_0x6438('0x147')][_0x6438('0x11a')](db[_0x6438('0x5b')],{'as':_0x6438('0x14d')});db[_0x6438('0x147')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':'ListId'});db[_0x6438('0x147')][_0x6438('0x129')](db[_0x6438('0x8d')],{'as':_0x6438('0x15c'),'foreignKey':_0x6438('0x15d')});db[_0x6438('0x147')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x148')});db[_0x6438('0x5b')][_0x6438('0x129')](db['User'],{'onDelete':_0x6438('0x179')});db[_0x6438('0x5b')]['belongsTo'](db[_0x6438('0x5f')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x5b')][_0x6438('0x129')](db[_0x6438('0x147')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x5b')][_0x6438('0x129')](db[_0x6438('0x15a')],{'onDelete':'restrict','foreignKey':_0x6438('0x15b')});db[_0x6438('0x5b')][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':_0x6438('0x179'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db['SmsMessage'],{'as':_0x6438('0x162'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x186')});db[_0x6438('0x5c')][_0x6438('0x129')](db[_0x6438('0x147')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x185')});db[_0x6438('0x5c')][_0x6438('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0x6438('0x180')});db[_0x6438('0x5c')][_0x6438('0x129')](db[_0x6438('0x15')],{'as':_0x6438('0x181'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x5c')]['belongsToMany'](db[_0x6438('0x93')],{'through':_0x6438('0x187'),'as':_0x6438('0x171')});db[_0x6438('0x5c')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':_0x6438('0x187'),'as':_0x6438('0x172')});db[_0x6438('0x5c')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'through':_0x6438('0x132'),'foreignKey':'SmsInteractionId'});db[_0x6438('0x5d')][_0x6438('0x129')](db['User'],{'as':'User'});db[_0x6438('0x5d')][_0x6438('0x129')](db['CmContact'],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x168')});db[_0x6438('0x5d')][_0x6438('0x129')](db[_0x6438('0x5c')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x6438('0x186')});db[_0x6438('0x5d')][_0x6438('0x129')](db[_0x6438('0x147')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x185')});db['SmsQueue']['belongsToMany'](db[_0x6438('0x15')],{'as':'Agents','through':_0x6438('0x13a'),'foreignKey':_0x6438('0x188')});db['SmsQueue'][_0x6438('0x12b')](db[_0x6438('0x12e')],{'through':_0x6438('0x189'),'as':_0x6438('0x15f')});db[_0x6438('0x18a')]['hasMany'](db[_0x6438('0x8a')],{'as':_0x6438('0x16c'),'foreignKey':_0x6438('0x18b'),'onDelete':_0x6438('0x117')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0x6438('0x16d'),'foreignKey':_0x6438('0x18b')});db[_0x6438('0x18a')][_0x6438('0x11a')](db[_0x6438('0x63')],{'as':_0x6438('0x16e'),'foreignKey':_0x6438('0x18b')});db[_0x6438('0x18a')][_0x6438('0x11a')](db[_0x6438('0x64')],{'as':_0x6438('0x162'),'foreignKey':_0x6438('0x18b')});db[_0x6438('0x18a')][_0x6438('0x11a')](db[_0x6438('0x61')],{'as':_0x6438('0x14d'),'foreignKey':_0x6438('0x18b')});db[_0x6438('0x18a')]['belongsTo'](db[_0x6438('0x102')],{'as':'List','foreignKey':_0x6438('0x16f')});db[_0x6438('0x18a')][_0x6438('0x129')](db[_0x6438('0x8d')],{'as':_0x6438('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':'user_has_openchannel_accounts'});db[_0x6438('0x61')][_0x6438('0x129')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x6438('0x129')](db[_0x6438('0x66')],{'onDelete':'restrict','foreignKey':_0x6438('0x18c')});db['OpenchannelApplication']['belongsTo'](db[_0x6438('0x18a')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x18b')});db[_0x6438('0x61')][_0x6438('0x129')](db[_0x6438('0x15a')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x15b')});db['OpenchannelApplication'][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':'restrict','foreignKey':'TagId'});db['OpenchannelInteraction'][_0x6438('0x11a')](db['OpenchannelMessage'],{'as':_0x6438('0x162'),'onDelete':_0x6438('0x117'),'foreignKey':'OpenchannelInteractionId'});db[_0x6438('0x63')][_0x6438('0x129')](db['OpenchannelAccount'],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x18b')});db['OpenchannelInteraction']['belongsTo'](db['CmContact'],{'as':_0x6438('0x168'),'foreignKey':'ContactId'});db[_0x6438('0x63')]['belongsTo'](db[_0x6438('0x15')],{'as':'Owner','foreignKey':_0x6438('0x118')});db[_0x6438('0x63')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':'openchannel_interaction_has_tags','as':_0x6438('0x171')});db[_0x6438('0x63')][_0x6438('0x12b')](db['Tag'],{'through':_0x6438('0x18d'),'as':_0x6438('0x172')});db[_0x6438('0x63')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':'Users','through':_0x6438('0x133'),'foreignKey':_0x6438('0x18e')});db[_0x6438('0x64')][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x15')});db[_0x6438('0x64')][_0x6438('0x129')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x6438('0x64')][_0x6438('0x129')](db[_0x6438('0x63')],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x176'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x6438('0x129')](db[_0x6438('0xf5')],{'as':_0x6438('0xf5'),'foreignKey':_0x6438('0x183')});db['OpenchannelMessage'][_0x6438('0x129')](db[_0x6438('0x18a')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x18b')});db['OpenchannelQueue'][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x6438('0x66')]['belongsToMany'](db['Team'],{'through':_0x6438('0x18f'),'as':_0x6438('0x15f')});db[_0x6438('0x68')][_0x6438('0x11a')](db[_0x6438('0x8a')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db['ChatWebsite'][_0x6438('0x11a')](db[_0x6438('0x88')],{'as':_0x6438('0x16d'),'foreignKey':_0x6438('0x177')});db['ChatWebsite']['hasMany'](db[_0x6438('0x76')],{'as':_0x6438('0x190')});db[_0x6438('0x68')][_0x6438('0x11a')](db[_0x6438('0x6c')],{'as':_0x6438('0x16e')});db[_0x6438('0x68')][_0x6438('0x11a')](db[_0x6438('0x6a')],{'as':'Applications'});db[_0x6438('0x68')][_0x6438('0x11a')](db[_0x6438('0x6e')],{'as':_0x6438('0x162')});db[_0x6438('0x68')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':'ListId'});db[_0x6438('0x68')][_0x6438('0x129')](db[_0x6438('0x15a')],{'as':_0x6438('0x15a'),'foreignKey':_0x6438('0x15b')});db[_0x6438('0x68')][_0x6438('0x129')](db[_0x6438('0x40')],{'as':_0x6438('0x40'),'foreignKey':'MailAccountId'});db[_0x6438('0x68')][_0x6438('0x129')](db['Pause'],{'as':_0x6438('0x15c'),'foreignKey':_0x6438('0x15d')});db[_0x6438('0x68')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x141')});db[_0x6438('0x69')][_0x6438('0x129')](db[_0x6438('0x18a')],{});db[_0x6438('0x69')]['belongsTo'](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x69')][_0x6438('0x129')](db[_0x6438('0x63')],{});db[_0x6438('0x69')]['belongsTo'](db[_0x6438('0x64')],{});db[_0x6438('0x69')][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0x69')][_0x6438('0x129')](db[_0x6438('0x66')],{});db[_0x6438('0x6a')][_0x6438('0x129')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':_0x6438('0x179')});db['ChatApplication'][_0x6438('0x129')](db['ChatQueue'],{'as':_0x6438('0x191'),'foreignKey':_0x6438('0x192'),'onDelete':'restrict'});db[_0x6438('0x6a')][_0x6438('0x129')](db[_0x6438('0x68')],{'as':_0x6438('0x193'),'foreignKey':_0x6438('0x177'),'onDelete':_0x6438('0x179')});db[_0x6438('0x6a')][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x17a')});db[_0x6438('0x6c')]['hasMany'](db[_0x6438('0x6e')],{'as':_0x6438('0x162'),'onDelete':'cascade','foreignKey':_0x6438('0x194')});db[_0x6438('0x6c')][_0x6438('0x129')](db[_0x6438('0x68')],{'as':'Account','foreignKey':_0x6438('0x177')});db[_0x6438('0x6c')][_0x6438('0x129')](db[_0x6438('0x79')],{'as':'Contact','foreignKey':_0x6438('0x180')});db[_0x6438('0x6c')]['belongsTo'](db[_0x6438('0x15')],{'as':_0x6438('0x181'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x6c')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':_0x6438('0x195'),'as':_0x6438('0x171')});db[_0x6438('0x6c')][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':_0x6438('0x195'),'as':_0x6438('0x172')});db['ChatInteraction'][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'through':_0x6438('0x130'),'foreignKey':_0x6438('0x194')});db['ChatMessage'][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x15')});db['ChatMessage'][_0x6438('0x129')](db[_0x6438('0x79')],{'onDelete':_0x6438('0x117'),'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db['ChatMessage'][_0x6438('0x129')](db[_0x6438('0x6c')],{'onDelete':_0x6438('0x117'),'as':'Interaction','foreignKey':_0x6438('0x194')});db[_0x6438('0x6e')][_0x6438('0x129')](db[_0x6438('0xf5')],{'as':_0x6438('0xf5'),'foreignKey':_0x6438('0x183')});db['ChatMessage'][_0x6438('0x129')](db[_0x6438('0x68')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x177')});db[_0x6438('0x70')][_0x6438('0x11a')](db[_0x6438('0xf5')],{'as':_0x6438('0x175'),'foreignKey':_0x6438('0x178'),'onDelete':_0x6438('0x117'),'hooks':!![]});db[_0x6438('0x70')]['belongsTo'](db[_0x6438('0x79')],{'onDelete':'cascade','as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db['ChatOfflineMessage'][_0x6438('0x129')](db[_0x6438('0x68')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x6438('0x72')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':'UserChatQueue','hooks':!![]});db[_0x6438('0x72')][_0x6438('0x12b')](db[_0x6438('0x12e')],{'through':_0x6438('0x196'),'as':_0x6438('0x15f')});db[_0x6438('0x74')][_0x6438('0x11a')](db[_0x6438('0xdd')],{'as':_0x6438('0x162'),'foreignKey':_0x6438('0x197'),'onDelete':'cascade'});db[_0x6438('0x74')][_0x6438('0x12b')](db['User'],{'as':_0x6438('0x150'),'through':_0x6438('0x198')});db['ChatProactiveAction'][_0x6438('0x129')](db[_0x6438('0x68')],{'as':_0x6438('0x193'),'foreignKey':_0x6438('0x177')});db[_0x6438('0x78')]['hasMany'](db[_0x6438('0x79')],{'as':_0x6438('0x12c'),'foreignKey':'CompanyId'});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0x97')],{'as':'Phones','foreignKey':_0x6438('0x199')});db['CmContact'][_0x6438('0x11a')](db[_0x6438('0x7b')],{'as':'Hoppers','foreignKey':_0x6438('0x180')});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0x7e')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0x80')],{'as':'HopperHistories','foreignKey':_0x6438('0x180')});db['CmContact'][_0x6438('0x11a')](db[_0x6438('0x120')],{'as':_0x6438('0x120'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0xe3')],{'as':_0x6438('0x155'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x79')]['hasMany'](db[_0x6438('0x63')],{'as':_0x6438('0x121'),'foreignKey':_0x6438('0x180'),'onDelete':_0x6438('0x179')});db[_0x6438('0x79')]['hasMany'](db[_0x6438('0x6c')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x6438('0x179')});db[_0x6438('0x79')][_0x6438('0x11a')](db['SmsInteraction'],{'as':_0x6438('0x123'),'foreignKey':_0x6438('0x180'),'onDelete':_0x6438('0x179')});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0x54')],{'as':'FaxInteractions','foreignKey':_0x6438('0x180'),'onDelete':'restrict'});db[_0x6438('0x79')][_0x6438('0x11a')](db[_0x6438('0x45')],{'as':_0x6438('0x125'),'foreignKey':_0x6438('0x180'),'onDelete':_0x6438('0x179')});db[_0x6438('0x79')][_0x6438('0x129')](db[_0x6438('0x78')],{'as':_0x6438('0x19a'),'foreignKey':'CompanyId'});db['CmContact'][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f'),'onDelete':_0x6438('0x117')});db[_0x6438('0x79')]['belongsToMany'](db[_0x6438('0x15')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x6438('0x79')]['belongsToMany'](db[_0x6438('0x93')],{'as':'Tags','through':_0x6438('0x19b')});db[_0x6438('0x79')]['belongsToMany'](db[_0x6438('0x93')],{'through':_0x6438('0x19b'),'as':_0x6438('0x172')});db['CmHopper'][_0x6438('0x11a')](db[_0x6438('0x99')],{'as':'AdditionalPhones','foreignKey':_0x6438('0x19c')});db['CmHopper'][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180'),'onDelete':_0x6438('0x117')});db[_0x6438('0x7b')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f'),'onDelete':'cascade'});db[_0x6438('0x7b')]['belongsTo'](db['User'],{'as':_0x6438('0x19d'),'foreignKey':_0x6438('0x118')});db[_0x6438('0x7b')]['belongsTo'](db[_0x6438('0x135')],{'as':_0x6438('0x191'),'foreignKey':_0x6438('0x151'),'onDelete':_0x6438('0x117')});db[_0x6438('0x7b')][_0x6438('0x129')](db[_0x6438('0xf2')],{'as':_0x6438('0xf2'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x6438('0x7b')]['belongsTo'](db[_0x6438('0x15')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x6438('0x7c')][_0x6438('0x129')](db['CmContact'],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180'),'onDelete':'cascade'});db[_0x6438('0x7c')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':'ListId','onDelete':_0x6438('0x117')});db[_0x6438('0x7c')]['belongsTo'](db[_0x6438('0x135')],{'as':_0x6438('0x191'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x6438('0x7c')]['belongsTo'](db[_0x6438('0xf2')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x6438('0x117')});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0x6438('0x19e'),'singular':_0x6438('0x19f')},'foreignKey':'AutomationAllId','onDelete':_0x6438('0x117'),'hooks':!![]});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0x6438('0x1a0'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x6438('0x117'),'hooks':!![]});db[_0x6438('0x86')][_0x6438('0x11a')](db[_0x6438('0x84')],{'as':_0x6438('0x1a1'),'foreignKey':_0x6438('0x1a2'),'onDelete':_0x6438('0x117'),'hooks':!![]});db[_0x6438('0x8a')][_0x6438('0x11a')](db['Disposition'],{'as':_0x6438('0x16c'),'foreignKey':_0x6438('0x1a3'),'onDelete':_0x6438('0x117')});db[_0x6438('0x15a')][_0x6438('0x11a')](db[_0x6438('0x15a')],{'as':_0x6438('0x1a4'),'foreignKey':_0x6438('0x15b'),'onDelete':_0x6438('0x117'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x6438('0x1a')],{'as':_0x6438('0x11d'),'foreignKey':_0x6438('0x15b'),'onDelete':'restrict'});db[_0x6438('0x15a')]['hasMany'](db[_0x6438('0x49')],{'as':_0x6438('0x1a5'),'foreignKey':_0x6438('0x15b')});db[_0x6438('0x15a')][_0x6438('0x11a')](db[_0x6438('0x6a')],{'as':_0x6438('0x1a6'),'foreignKey':_0x6438('0x15b')});db['Interval'][_0x6438('0x11a')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x6438('0x15b')});db[_0x6438('0x15a')]['hasMany'](db[_0x6438('0x5b')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x6438('0x1a7')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0x6438('0x129')](db['AnalyticDefaultReport'],{'foreignKey':_0x6438('0x1a8')});db[_0x6438('0x1a7')][_0x6438('0x129')](db[_0x6438('0xa2')],{'foreignKey':_0x6438('0x1a9')});db[_0x6438('0x1aa')][_0x6438('0x12b')](db[_0x6438('0x1c')],{'as':_0x6438('0x1ab'),'through':'moh_has_sounds','onDelete':_0x6438('0x179')});db[_0x6438('0x93')][_0x6438('0x12b')](db['CmContact'],{'through':_0x6438('0x19b')});db[_0x6438('0x93')][_0x6438('0x12b')](db[_0x6438('0x6c')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x6438('0x12b')](db['MailInteraction'],{'through':_0x6438('0x1ac')});db[_0x6438('0x93')][_0x6438('0x12b')](db[_0x6438('0x5c')],{'through':_0x6438('0x187')});db['Tag'][_0x6438('0x12b')](db[_0x6438('0x54')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x6438('0x12b')](db[_0x6438('0x63')],{'through':_0x6438('0x18d')});db['Tag'][_0x6438('0x12b')](db[_0x6438('0x126')],{'through':_0x6438('0x1ad')});db[_0x6438('0x97')][_0x6438('0x129')](db[_0x6438('0x95')],{'as':_0x6438('0x1ae'),'foreignKey':_0x6438('0x1af')});db[_0x6438('0x99')][_0x6438('0x129')](db[_0x6438('0x7b')],{'as':_0x6438('0x1b0'),'foreignKey':'CmHopperId'});db[_0x6438('0x9d')][_0x6438('0x11a')](db['Condition'],{'as':{'plural':_0x6438('0x1b1'),'singular':_0x6438('0x1b2')},'foreignKey':_0x6438('0x1b3'),'onDelete':_0x6438('0x117'),'hooks':!![]});db[_0x6438('0x9d')]['hasMany'](db[_0x6438('0x1b4')],{'as':{'plural':_0x6438('0x1b5'),'singular':_0x6438('0x1b6')},'foreignKey':_0x6438('0x1b7'),'onDelete':_0x6438('0x117'),'hooks':!![]});db[_0x6438('0x9d')][_0x6438('0x11a')](db[_0x6438('0x84')],{'as':'Actions','foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x6438('0x11a')](db[_0x6438('0xa7')],{'as':'Fields','onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1a9'),'hooks':!![]});db[_0x6438('0xa4')]['hasMany'](db[_0x6438('0xa7')],{'as':_0x6438('0x1b8'),'onDelete':_0x6438('0x117'),'foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x6438('0x11a')](db[_0x6438('0xa7')],{'as':_0x6438('0x1b8'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1b9')});db[_0x6438('0xa7')]['belongsTo'](db[_0x6438('0xa6')],{'foreignKey':_0x6438('0x1b9')});db[_0x6438('0x1ba')][_0x6438('0x11a')](db[_0x6438('0xac')],{'as':'Configurations','onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db['SalesforceConfiguration']['hasMany'](db[_0x6438('0xae')],{'as':_0x6438('0x1bc'),'onDelete':'cascade','foreignKey':_0x6438('0x1bd')});db['SalesforceConfiguration'][_0x6438('0x11a')](db[_0x6438('0xae')],{'as':_0x6438('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x6438('0x11a')](db['SalesforceField'],{'as':_0x6438('0x1b8'),'onDelete':_0x6438('0x117'),'foreignKey':'FieldId'});db[_0x6438('0xac')][_0x6438('0x129')](db[_0x6438('0x1ba')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xae')]['hasMany'](db[_0x6438('0xae')],{'as':'Subject','foreignKey':_0x6438('0x1bd')});db['SalesforceField'][_0x6438('0x11a')](db[_0x6438('0xae')],{'as':_0x6438('0x1bf'),'foreignKey':'DescriptionId'});db[_0x6438('0xae')][_0x6438('0x11a')](db[_0x6438('0xae')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xae')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':'VariableId'});db[_0x6438('0xb0')][_0x6438('0x11a')](db[_0x6438('0xb2')],{'as':'Configurations','onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xb2')]['hasMany'](db[_0x6438('0xb4')],{'as':_0x6438('0x1bc'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xb2')]['hasMany'](db['SugarcrmField'],{'as':_0x6438('0x1be'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xb2')][_0x6438('0x11a')](db[_0x6438('0xb4')],{'as':_0x6438('0x1b8'),'onDelete':'cascade','foreignKey':_0x6438('0x1c1')});db['SugarcrmConfiguration'][_0x6438('0x129')](db[_0x6438('0xb0')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1bb')});db['SugarcrmField']['hasMany'](db[_0x6438('0xb4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x6438('0xb4')][_0x6438('0x11a')](db[_0x6438('0xb4')],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xb4')][_0x6438('0x11a')](db[_0x6438('0xb4')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xb4')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db['DeskAccount'][_0x6438('0x11a')](db['DeskConfiguration'],{'as':_0x6438('0x1c4'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xb8')]['hasMany'](db[_0x6438('0xb9')],{'as':_0x6438('0x1bc'),'onDelete':_0x6438('0x117'),'foreignKey':'SubjectId'});db[_0x6438('0xb8')][_0x6438('0x11a')](db['DeskField'],{'as':_0x6438('0x1be'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xb8')][_0x6438('0x11a')](db[_0x6438('0xb9')],{'as':_0x6438('0x1b8'),'onDelete':'cascade','foreignKey':_0x6438('0x1c1')});db[_0x6438('0xb8')][_0x6438('0x129')](db[_0x6438('0xb6')],{'as':'Account','foreignKey':_0x6438('0x1bb')});db[_0x6438('0xb8')][_0x6438('0x12b')](db['Tag'],{'through':_0x6438('0x1c5')});db[_0x6438('0xb9')]['hasMany'](db[_0x6438('0xb9')],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db['DeskField'][_0x6438('0x11a')](db[_0x6438('0xb9')],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xb9')][_0x6438('0x11a')](db[_0x6438('0xb9')],{'as':'Field','foreignKey':'FieldId'});db[_0x6438('0xb9')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x6438('0x1c3')});db[_0x6438('0xba')]['hasMany'](db['ZohoConfiguration'],{'as':_0x6438('0x1c4'),'onDelete':'cascade','foreignKey':_0x6438('0x1bb')});db[_0x6438('0xbc')][_0x6438('0x11a')](db[_0x6438('0xbd')],{'as':_0x6438('0x1bc'),'onDelete':'cascade','foreignKey':_0x6438('0x1bd')});db[_0x6438('0xbc')][_0x6438('0x11a')](db[_0x6438('0xbd')],{'as':_0x6438('0x1be'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xbc')][_0x6438('0x11a')](db[_0x6438('0xbd')],{'as':_0x6438('0x1b8'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xbc')][_0x6438('0x129')](db[_0x6438('0xba')],{'as':_0x6438('0x170'),'foreignKey':'AccountId'});db['ZohoField'][_0x6438('0x11a')](db[_0x6438('0xbd')],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xbd')][_0x6438('0x11a')](db['ZohoField'],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xbd')][_0x6438('0x11a')](db[_0x6438('0xbd')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xbd')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db[_0x6438('0xbf')][_0x6438('0x11a')](db[_0x6438('0xc1')],{'as':_0x6438('0x1c4'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xc1')][_0x6438('0x11a')](db[_0x6438('0x1c7')],{'as':_0x6438('0x1bc'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xc1')]['hasMany'](db[_0x6438('0x1c7')],{'as':_0x6438('0x1be'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xc1')][_0x6438('0x11a')](db[_0x6438('0x1c7')],{'as':'Fields','foreignKey':'FieldId'});db[_0x6438('0xc1')][_0x6438('0x129')](db[_0x6438('0xbf')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xc1')][_0x6438('0x12b')](db['Tag'],{'through':_0x6438('0x1c8')});db['ZendeskField'][_0x6438('0x11a')](db['ZendeskField'],{'as':_0x6438('0x1c6'),'foreignKey':'SubjectId'});db['ZendeskField'][_0x6438('0x11a')](db['ZendeskField'],{'as':_0x6438('0x1bf'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0x6438('0x1c7')],{'as':'Field','foreignKey':_0x6438('0x1c1')});db['ZendeskField']['belongsTo'](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db[_0x6438('0xc3')]['hasMany'](db[_0x6438('0xc5')],{'as':_0x6438('0x1c4'),'onDelete':'cascade','foreignKey':_0x6438('0x1bb')});db[_0x6438('0xc5')][_0x6438('0x11a')](db[_0x6438('0xc7')],{'as':_0x6438('0x1bc'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xc5')][_0x6438('0x11a')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xc5')][_0x6438('0x11a')](db[_0x6438('0xc7')],{'as':_0x6438('0x1b8'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xc5')][_0x6438('0x129')](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x6438('0xc5')][_0x6438('0x12b')](db['Tag'],{'through':_0x6438('0x1c9')});db[_0x6438('0xc7')][_0x6438('0x11a')](db['FreshdeskField'],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xc7')]['hasMany'](db['FreshdeskField'],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xc7')][_0x6438('0x11a')](db[_0x6438('0xc7')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db['FreshdeskField']['belongsTo'](db[_0x6438('0x9f')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db[_0x6438('0xc9')],{'as':_0x6438('0x1c4'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0xc9')][_0x6438('0x11a')](db[_0x6438('0xca')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x6438('0xc9')]['hasMany'](db[_0x6438('0xca')],{'as':_0x6438('0x1be'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0xc9')][_0x6438('0x11a')](db[_0x6438('0xca')],{'as':_0x6438('0x1b8'),'foreignKey':_0x6438('0x1c1')});db['VtigerConfiguration'][_0x6438('0x129')](db['VtigerAccount'],{'as':_0x6438('0x170'),'foreignKey':'AccountId'});db['VtigerField']['hasMany'](db[_0x6438('0xca')],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0xca')][_0x6438('0x11a')](db[_0x6438('0xca')],{'as':'Description','foreignKey':_0x6438('0x1c2')});db[_0x6438('0xca')][_0x6438('0x11a')](db[_0x6438('0xca')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xca')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db[_0x6438('0xcc')][_0x6438('0x11a')](db[_0x6438('0x1ca')],{'as':_0x6438('0x1c4'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0x1ca')][_0x6438('0x11a')](db[_0x6438('0xcf')],{'as':'Subjects','foreignKey':_0x6438('0x1bd')});db[_0x6438('0x1ca')]['hasMany'](db[_0x6438('0xcf')],{'as':_0x6438('0x1be'),'foreignKey':_0x6438('0x1c2')});db[_0x6438('0x1ca')][_0x6438('0x11a')](db['ServicenowField'],{'as':_0x6438('0x1b8'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0x1ca')][_0x6438('0x129')](db[_0x6438('0xcc')],{'as':'Account','foreignKey':_0x6438('0x1bb')});db[_0x6438('0xcf')][_0x6438('0x11a')](db[_0x6438('0xcf')],{'as':'Subject','foreignKey':_0x6438('0x1bd')});db['ServicenowField']['hasMany'](db[_0x6438('0xcf')],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db['ServicenowField'][_0x6438('0x11a')](db[_0x6438('0xcf')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xcf')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db[_0x6438('0xd1')][_0x6438('0x11a')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x6438('0x117'),'foreignKey':'AccountId'});db[_0x6438('0x1cb')][_0x6438('0x11a')](db[_0x6438('0xd4')],{'as':_0x6438('0x1bc'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bd')});db[_0x6438('0x1cb')][_0x6438('0x11a')](db[_0x6438('0xd4')],{'as':_0x6438('0x1be'),'onDelete':_0x6438('0x117'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x6438('0x11a')](db[_0x6438('0xd4')],{'as':'Fields','onDelete':_0x6438('0x117'),'foreignKey':'FieldId'});db[_0x6438('0x1cb')]['belongsTo'](db[_0x6438('0xd1')],{'as':'Account','foreignKey':_0x6438('0x1bb')});db[_0x6438('0xd4')]['hasMany'](db[_0x6438('0xd4')],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db['Dynamics365Field'][_0x6438('0x11a')](db[_0x6438('0xd4')],{'as':_0x6438('0x1bf'),'foreignKey':_0x6438('0x1c2')});db['Dynamics365Field'][_0x6438('0x11a')](db[_0x6438('0xd4')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xd4')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db['FreshsalesAccount'][_0x6438('0x11a')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1bb')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x6438('0x1bc'),'foreignKey':_0x6438('0x1bd')});db['FreshsalesConfiguration'][_0x6438('0x11a')](db[_0x6438('0x1cc')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x6438('0xd6')][_0x6438('0x11a')](db['FreshsalesField'],{'as':_0x6438('0x1b8'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0xd6')][_0x6438('0x129')](db[_0x6438('0x1cd')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1bb')});db[_0x6438('0x1cc')][_0x6438('0x11a')](db['FreshsalesField'],{'as':_0x6438('0x1c6'),'foreignKey':_0x6438('0x1bd')});db['FreshsalesField'][_0x6438('0x11a')](db[_0x6438('0x1cc')],{'as':'Description','foreignKey':_0x6438('0x1c2')});db[_0x6438('0x1cc')]['hasMany'](db[_0x6438('0x1cc')],{'as':_0x6438('0x1c0'),'foreignKey':_0x6438('0x1c1')});db[_0x6438('0x1cc')][_0x6438('0x129')](db[_0x6438('0x9f')],{'as':_0x6438('0x9f'),'foreignKey':_0x6438('0x1c3')});db[_0x6438('0xdc')][_0x6438('0x129')](db[_0x6438('0x68')],{});db['ChatQueueReport']['belongsTo'](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f')});db['ChatQueueReport'][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0xdc')][_0x6438('0x129')](db[_0x6438('0x6c')],{});db[_0x6438('0xdc')][_0x6438('0x129')](db[_0x6438('0x6e')],{});db[_0x6438('0xdc')][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0xdc')]['belongsTo'](db[_0x6438('0x72')],{});db['ChatInternalMessage'][_0x6438('0x129')](db['User'],{'onDelete':'cascade','foreignKey':_0x6438('0x1ce')});db[_0x6438('0xdd')][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x1cf')});db[_0x6438('0xe3')][_0x6438('0x11a')](db[_0x6438('0xe1')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x6438('0xe3')][_0x6438('0x11a')](db[_0x6438('0xdf')],{'foreignKey':_0x6438('0x1d0'),'onDelete':_0x6438('0x117')});db[_0x6438('0xe5')]['belongsTo'](db[_0x6438('0x147')],{});db[_0x6438('0xe5')][_0x6438('0x129')](db[_0x6438('0x102')],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0xe5')]['belongsTo'](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0xe5')][_0x6438('0x129')](db[_0x6438('0x5c')],{});db[_0x6438('0xe5')][_0x6438('0x129')](db['SmsMessage'],{});db['SmsQueueReport'][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0xe5')][_0x6438('0x129')](db[_0x6438('0x5f')],{});db[_0x6438('0x1d1')][_0x6438('0x11a')](db[_0x6438('0xe3')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x6438('0x11a')](db[_0x6438('0xe1')],{'foreignKey':'ProjectId'});db[_0x6438('0x1d1')]['hasMany'](db[_0x6438('0xdf')],{'foreignKey':_0x6438('0x1d2')});db[_0x6438('0x14a')][_0x6438('0x12b')](db['User'],{'as':'Users','through':_0x6438('0x1d3')});db[_0x6438('0x12e')][_0x6438('0x12b')](db['User'],{'as':_0x6438('0x15e'),'through':_0x6438('0x1d4')});db[_0x6438('0x12e')][_0x6438('0x12b')](db[_0x6438('0x135')],{'through':_0x6438('0x115'),'as':_0x6438('0x1d5')});db[_0x6438('0x12e')][_0x6438('0x12b')](db[_0x6438('0x136')],{'through':_0x6438('0x1d6'),'as':_0x6438('0x137')});db[_0x6438('0x12e')][_0x6438('0x12b')](db[_0x6438('0x72')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x6438('0x12e')]['belongsToMany'](db[_0x6438('0x58')],{'through':'team_has_fax_queues','as':_0x6438('0x138')});db[_0x6438('0x12e')]['belongsToMany'](db[_0x6438('0x5f')],{'through':_0x6438('0x189'),'as':_0x6438('0x139')});db[_0x6438('0x12e')][_0x6438('0x12b')](db['OpenchannelQueue'],{'through':_0x6438('0x18f'),'as':_0x6438('0x13b')});db[_0x6438('0x12e')]['belongsToMany'](db[_0x6438('0x111')],{'through':_0x6438('0x1d7'),'as':'WhatsappQueues'});db[_0x6438('0xf2')][_0x6438('0x11a')](db[_0x6438('0x7b')],{'as':_0x6438('0x152'),'foreignKey':_0x6438('0x1d8')});db[_0x6438('0xf2')][_0x6438('0x11a')](db[_0x6438('0x7e')],{'as':_0x6438('0x11e'),'foreignKey':_0x6438('0x1d8')});db[_0x6438('0xf2')][_0x6438('0x11a')](db[_0x6438('0x80')],{'as':_0x6438('0x153'),'foreignKey':_0x6438('0x1d8')});db[_0x6438('0xf2')][_0x6438('0x11a')](db['CmHopperBlack'],{'as':_0x6438('0x154'),'foreignKey':_0x6438('0x1d8')});db[_0x6438('0xf2')]['belongsTo'](db[_0x6438('0x156')],{'as':'Trunk','foreignKey':_0x6438('0x157')});db['Campaign'][_0x6438('0x129')](db[_0x6438('0x156')],{'as':_0x6438('0x158'),'foreignKey':_0x6438('0x159')});db[_0x6438('0xf2')]['belongsTo'](db['Interval'],{'as':_0x6438('0x15a'),'foreignKey':_0x6438('0x15b')});db[_0x6438('0xf2')][_0x6438('0x129')](db[_0x6438('0x14a')],{'as':_0x6438('0x14a'),'foreignKey':_0x6438('0x1d9')});db[_0x6438('0xf2')][_0x6438('0x12b')](db[_0x6438('0x102')],{'as':'Lists','through':_0x6438('0x1da')});db[_0x6438('0xf2')][_0x6438('0x12b')](db[_0x6438('0x102')],{'as':'BlackLists','through':_0x6438('0x1db')});db[_0x6438('0xf5')][_0x6438('0x129')](db['ChatOfflineMessage'],{'as':_0x6438('0x70'),'foreignKey':_0x6438('0x178')});db['MailTransferReport'][_0x6438('0x129')](db[_0x6438('0x47')],{});db[_0x6438('0xf9')]['belongsTo'](db[_0x6438('0x45')],{});db['MailTransferReport'][_0x6438('0x129')](db[_0x6438('0x40')],{'foreignKey':_0x6438('0x1dc'),'as':_0x6438('0x1dd')});db[_0x6438('0xf9')]['belongsTo'](db[_0x6438('0x15')],{'foreignKey':_0x6438('0x1de'),'as':_0x6438('0x1df')});db[_0x6438('0xf9')]['belongsTo'](db[_0x6438('0x15')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x6438('0xf9')][_0x6438('0x129')](db[_0x6438('0x136')],{'foreignKey':_0x6438('0x1e0'),'as':_0x6438('0x1e1')});db[_0x6438('0xf9')]['belongsTo'](db[_0x6438('0x40')],{'foreignKey':_0x6438('0x1e2'),'as':_0x6438('0x1e3')});db[_0x6438('0xfb')][_0x6438('0x129')](db[_0x6438('0x6e')],{});db['ChatTransferReport'][_0x6438('0x129')](db[_0x6438('0x6c')],{});db[_0x6438('0xfb')][_0x6438('0x129')](db[_0x6438('0x68')],{'foreignKey':_0x6438('0x1e4'),'as':'FromAccount'});db[_0x6438('0xfb')]['belongsTo'](db['User'],{'foreignKey':_0x6438('0x1de'),'as':_0x6438('0x1df')});db[_0x6438('0xfb')][_0x6438('0x129')](db[_0x6438('0x15')],{'foreignKey':_0x6438('0x1e5'),'as':_0x6438('0x1e6')});db[_0x6438('0xfb')][_0x6438('0x129')](db[_0x6438('0x72')],{'foreignKey':_0x6438('0x1e7'),'as':'ToQueue'});db[_0x6438('0xfb')]['belongsTo'](db[_0x6438('0x68')],{'foreignKey':_0x6438('0x1e8'),'as':_0x6438('0x1e3')});db[_0x6438('0xfd')][_0x6438('0x129')](db['FaxMessage'],{});db[_0x6438('0xfd')][_0x6438('0x129')](db[_0x6438('0x54')],{});db['FaxTransferReport'][_0x6438('0x129')](db[_0x6438('0x50')],{'foreignKey':_0x6438('0x1e9'),'as':_0x6438('0x1dd')});db[_0x6438('0xfd')][_0x6438('0x129')](db['User'],{'foreignKey':_0x6438('0x1de'),'as':_0x6438('0x1df')});db['FaxTransferReport'][_0x6438('0x129')](db['User'],{'foreignKey':'ToUserId','as':_0x6438('0x1e6')});db['FaxTransferReport'][_0x6438('0x129')](db[_0x6438('0x58')],{'foreignKey':_0x6438('0x1ea'),'as':'ToQueue'});db[_0x6438('0xfd')][_0x6438('0x129')](db[_0x6438('0x50')],{'foreignKey':_0x6438('0x1eb'),'as':_0x6438('0x1e3')});db['OpenchannelTransferReport'][_0x6438('0x129')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x6438('0x129')](db[_0x6438('0x63')],{});db[_0x6438('0xff')][_0x6438('0x129')](db[_0x6438('0x18a')],{'foreignKey':_0x6438('0x1ec'),'as':_0x6438('0x1dd')});db['OpenchannelTransferReport'][_0x6438('0x129')](db['User'],{'foreignKey':_0x6438('0x1de'),'as':_0x6438('0x1df')});db[_0x6438('0xff')]['belongsTo'](db[_0x6438('0x15')],{'foreignKey':'ToUserId','as':_0x6438('0x1e6')});db[_0x6438('0xff')][_0x6438('0x129')](db[_0x6438('0x66')],{'foreignKey':_0x6438('0x1ed'),'as':'ToQueue'});db[_0x6438('0xff')][_0x6438('0x129')](db[_0x6438('0x18a')],{'foreignKey':_0x6438('0x1ee'),'as':'ToAccount'});db[_0x6438('0x100')][_0x6438('0x129')](db[_0x6438('0x5d')],{});db[_0x6438('0x100')]['belongsTo'](db['SmsInteraction'],{});db['SmsTransferReport']['belongsTo'](db[_0x6438('0x147')],{'foreignKey':_0x6438('0x1ef'),'as':'FromAccount'});db[_0x6438('0x100')][_0x6438('0x129')](db[_0x6438('0x15')],{'foreignKey':_0x6438('0x1de'),'as':_0x6438('0x1df')});db[_0x6438('0x100')][_0x6438('0x129')](db[_0x6438('0x15')],{'foreignKey':_0x6438('0x1e5'),'as':_0x6438('0x1e6')});db[_0x6438('0x100')][_0x6438('0x129')](db[_0x6438('0x5f')],{'foreignKey':_0x6438('0x1f0'),'as':_0x6438('0x1e1')});db[_0x6438('0x100')][_0x6438('0x129')](db[_0x6438('0x147')],{'foreignKey':_0x6438('0x1f1'),'as':'ToAccount'});db[_0x6438('0x102')][_0x6438('0x11a')](db[_0x6438('0x8a')],{'as':'Dispositions','foreignKey':_0x6438('0x16f'),'onDelete':_0x6438('0x117')});db[_0x6438('0x102')][_0x6438('0x11a')](db['CmCustomField'],{'as':_0x6438('0x1f2'),'foreignKey':_0x6438('0x16f')});db['CmList'][_0x6438('0x11a')](db['CmContact'],{'as':_0x6438('0x12c'),'onDelete':_0x6438('0x117'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0x102')][_0x6438('0x11a')](db[_0x6438('0x7e')],{'as':_0x6438('0x11e'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0x102')][_0x6438('0x11a')](db[_0x6438('0x80')],{'as':_0x6438('0x11f'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x6438('0x120')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x6438('0x102')]['belongsToMany'](db[_0x6438('0x135')],{'as':_0x6438('0x1f3'),'through':_0x6438('0x1f4')});db[_0x6438('0x102')]['belongsToMany'](db[_0x6438('0x15')],{'as':'Agents','through':_0x6438('0x13d')});db[_0x6438('0x13e')][_0x6438('0x11a')](db[_0x6438('0x1a')],{'as':_0x6438('0x11d'),'onDelete':'cascade'});db[_0x6438('0x13e')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x140')});db[_0x6438('0x104')][_0x6438('0x11a')](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'foreignKey':_0x6438('0x12a')});db[_0x6438('0x104')][_0x6438('0x11a')](db[_0x6438('0x105')],{'as':_0x6438('0x1f5'),'foreignKey':'userProfileId','onDelete':_0x6438('0x117')});db[_0x6438('0x105')][_0x6438('0x11a')](db[_0x6438('0x106')],{'as':_0x6438('0x1f6'),'foreignKey':_0x6438('0x1f7'),'onDelete':_0x6438('0x117')});db[_0x6438('0x1f8')][_0x6438('0x11a')](db[_0x6438('0x8a')],{'as':_0x6438('0x16c'),'foreignKey':_0x6438('0x1f9'),'onDelete':_0x6438('0x117')});db[_0x6438('0x1f8')][_0x6438('0x11a')](db[_0x6438('0x88')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x6438('0x1f8')][_0x6438('0x11a')](db['WhatsappMessage'],{'as':_0x6438('0x162'),'foreignKey':_0x6438('0x1f9')});db['WhatsappAccount'][_0x6438('0x11a')](db[_0x6438('0x126')],{'as':_0x6438('0x16e')});db[_0x6438('0x1f8')][_0x6438('0x11a')](db[_0x6438('0x10b')],{'as':'Applications'});db[_0x6438('0x1f8')][_0x6438('0x129')](db['CmList'],{'as':_0x6438('0x17b'),'foreignKey':_0x6438('0x16f')});db[_0x6438('0x1f8')][_0x6438('0x129')](db[_0x6438('0x8d')],{'as':_0x6438('0x15c'),'foreignKey':_0x6438('0x15d')});db[_0x6438('0x1f8')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x149')});db[_0x6438('0x10b')][_0x6438('0x129')](db[_0x6438('0x15')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x10b')][_0x6438('0x129')](db['WhatsappQueue'],{'onDelete':_0x6438('0x179')});db[_0x6438('0x10b')][_0x6438('0x129')](db[_0x6438('0x1f8')],{'onDelete':_0x6438('0x179')});db[_0x6438('0x10b')]['belongsTo'](db[_0x6438('0x15a')],{'onDelete':_0x6438('0x179'),'foreignKey':_0x6438('0x15b')});db[_0x6438('0x10b')][_0x6438('0x129')](db[_0x6438('0x93')],{'onDelete':_0x6438('0x179'),'foreignKey':'TagId'});db[_0x6438('0x126')][_0x6438('0x11a')](db[_0x6438('0x10d')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x6438('0x1fa')});db[_0x6438('0x126')]['belongsTo'](db[_0x6438('0x1f8')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1f9')});db[_0x6438('0x126')][_0x6438('0x129')](db[_0x6438('0x79')],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x126')]['belongsTo'](db[_0x6438('0x15')],{'as':'Owner','foreignKey':_0x6438('0x118')});db[_0x6438('0x126')][_0x6438('0x12b')](db['Tag'],{'through':_0x6438('0x1ad'),'as':_0x6438('0x171')});db['WhatsappInteraction'][_0x6438('0x12b')](db[_0x6438('0x93')],{'through':'whatsapp_interaction_has_tags','as':_0x6438('0x172')});db[_0x6438('0x126')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x173'),'through':_0x6438('0x134'),'foreignKey':_0x6438('0x1fa')});db['WhatsappMessage']['belongsTo'](db[_0x6438('0x15')],{'as':_0x6438('0x15')});db[_0x6438('0x10d')][_0x6438('0x129')](db[_0x6438('0x79')],{'onDelete':_0x6438('0x117'),'as':'Contact'});db[_0x6438('0x10d')][_0x6438('0x129')](db[_0x6438('0x126')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x6438('0x1fa')});db[_0x6438('0x10d')]['belongsTo'](db[_0x6438('0x1f8')],{'as':_0x6438('0x170'),'foreignKey':_0x6438('0x1f9')});db[_0x6438('0x10e')][_0x6438('0x129')](db[_0x6438('0x1f8')],{});db[_0x6438('0x10e')][_0x6438('0x129')](db['CmList'],{'as':_0x6438('0x17b'),'foreignKey':'ListId'});db[_0x6438('0x10e')][_0x6438('0x129')](db['CmContact'],{'as':_0x6438('0x168'),'foreignKey':_0x6438('0x180')});db[_0x6438('0x10e')][_0x6438('0x129')](db[_0x6438('0x126')],{});db[_0x6438('0x10e')][_0x6438('0x129')](db[_0x6438('0x111')],{});db[_0x6438('0x10e')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x6438('0x129')](db[_0x6438('0x15')],{});db[_0x6438('0x1fb')][_0x6438('0x129')](db['WhatsappMessage'],{});db[_0x6438('0x1fb')][_0x6438('0x129')](db[_0x6438('0x126')],{});db['WhatsappTransferReport'][_0x6438('0x129')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0x6438('0x129')](db[_0x6438('0x1f8')],{'foreignKey':_0x6438('0x1fc'),'as':'ToAccount'});db[_0x6438('0x1fb')][_0x6438('0x129')](db[_0x6438('0x111')],{'foreignKey':'ToQueueId','as':_0x6438('0x1e1')});db[_0x6438('0x1fb')][_0x6438('0x129')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x6438('0x1fb')][_0x6438('0x129')](db[_0x6438('0x15')],{'foreignKey':'ToUserId','as':_0x6438('0x1e6')});db[_0x6438('0x111')][_0x6438('0x12b')](db[_0x6438('0x15')],{'as':_0x6438('0x15e'),'through':_0x6438('0x3b'),'foreignKey':_0x6438('0x1fd')});db['WhatsappQueue']['belongsToMany'](db[_0x6438('0x12e')],{'through':_0x6438('0x1d7'),'as':_0x6438('0x15f')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index d65d7f7..d3fd0ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea2a=['./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','username','password','apiKey','lastName','street','phone','mobile','fax','clientSecret','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','x-forwarded-for','url','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','connection','remoteAddress','statusCode','other','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject'];(function(_0x3fc807,_0x46196e){var _0x2c8fd9=function(_0x371e67){while(--_0x371e67){_0x3fc807['push'](_0x3fc807['shift']());}};_0x2c8fd9(++_0x46196e);}(_0xea2a,0x1c8));var _0xaea2=function(_0x4b0a5a,_0x49f7ab){_0x4b0a5a=_0x4b0a5a-0x0;var _0x12d259=_0xea2a[_0x4b0a5a];return _0x12d259;};'use strict';var _=require(_0xaea2('0x0'));var path=require(_0xaea2('0x1'));var express=require(_0xaea2('0x2'));var ewinston=require(_0xaea2('0x3'));var util=require('util');var errors=require(_0xaea2('0x4'));var config=require(_0xaea2('0x5'));var logger=require(_0xaea2('0x6'))(_0xaea2('0x7'));var authLogger=require('./config/logger')(_0xaea2('0x8'));exports[_0xaea2('0x9')]=function(_0x3ffde2){_0x3ffde2['use'](ewinston[_0xaea2('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1d8416,_0x49cfeb){var _0x117a6d=_0xaea2('0xb');if(!_[_0xaea2('0xc')](_0x1d8416['body'])){_0x117a6d+='\x20body=%s';var _0xb16fe1=_0x1d8416[_0xaea2('0xd')];maskSensitiveData(_0xb16fe1);}return util['format'](_0x117a6d,_0x1d8416[_0xaea2('0xe')],_0x1d8416[_0xaea2('0xf')][_0xaea2('0x10')]?_0x1d8416['headers'][_0xaea2('0x10')]:_0x1d8416['connection']['remoteAddress']||_0x1d8416['ip'],_0x1d8416[_0xaea2('0x11')],_0x49cfeb['statusCode'],_0x49cfeb[_0xaea2('0x12')],_0x1d8416[_0xaea2('0x13')]?_0x1d8416['user']['id']:null,_0x1d8416[_0xaea2('0x13')]?_0x1d8416[_0xaea2('0x13')][_0xaea2('0x14')]:null,_0x1d8416[_0xaea2('0x13')]?_0x1d8416[_0xaea2('0x13')]['role']:null,_0xb16fe1?util[_0xaea2('0x15')](_0xb16fe1,![],null):'');}}));_0x3ffde2['use'](ewinston[_0xaea2('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x11c17d,_0x16e91c){var _0x181500=_0xaea2('0x16');if(_0x11c17d['body']&&_0x11c17d[_0xaea2('0xd')][_0xaea2('0x17')]&&_0x11c17d['body'][_0xaea2('0x18')]){_0x181500=_0xaea2('0x19');}return util[_0xaea2('0x1a')](_0x181500,_0x11c17d['method'],_0x11c17d[_0xaea2('0xf')][_0xaea2('0x10')]?_0x11c17d['headers'][_0xaea2('0x10')]:_0x11c17d[_0xaea2('0x1b')][_0xaea2('0x1c')]||_0x11c17d['ip'],_0x11c17d[_0xaea2('0x11')],_0x16e91c[_0xaea2('0x1d')],_0x16e91c[_0xaea2('0x12')],_0x11c17d[_0xaea2('0x13')]?_0x11c17d['user']['id']:null,_0x11c17d[_0xaea2('0x13')]?_0x11c17d[_0xaea2('0x13')][_0xaea2('0x14')]:null,_0x11c17d['user']?_0x11c17d[_0xaea2('0x13')]['role']:null,_0x11c17d['body']&&_0x11c17d[_0xaea2('0xd')][_0xaea2('0x17')]?_0x11c17d[_0xaea2('0xd')]['device']:_0xaea2('0x1e'),_0x11c17d[_0xaea2('0xd')]&&_0x11c17d[_0xaea2('0xd')]['agent_id']?_0x11c17d[_0xaea2('0xd')][_0xaea2('0x18')]:'',_0x11c17d[_0xaea2('0xd')]&&_0x11c17d['body']['agent_name']?_0x11c17d[_0xaea2('0xd')]['agent_name']:'');},'ignoreRoute':function(_0x468021){var _0x89a9c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x89a9c['test'](_0x468021[_0xaea2('0x11')]);}}));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x20'),require('./api/user'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x21'),require(_0xaea2('0x22')));_0x3ffde2[_0xaea2('0x1f')]('/api/voice/contexts',require(_0xaea2('0x23')));_0x3ffde2['use'](_0xaea2('0x24'),require('./api/voiceExtension'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x25'),require('./api/voiceMusicOnHold'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x26'),require('./api/voiceQueue'));_0x3ffde2[_0xaea2('0x1f')]('/api/voice/recordings',require(_0xaea2('0x27')));_0x3ffde2['use'](_0xaea2('0x28'),require(_0xaea2('0x29')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x2a'),require('./api/voiceMail'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x2b'),require('./api/voiceMailMessage'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x2c'),require(_0xaea2('0x2d')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x2e'),require(_0xaea2('0x2f')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x30'),require(_0xaea2('0x31')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x32'),require(_0xaea2('0x33')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x34'),require(_0xaea2('0x35')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x36'),require('./api/trunk'));_0x3ffde2[_0xaea2('0x1f')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x3ffde2['use'](_0xaea2('0x37'),require(_0xaea2('0x38')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x39'),require('./api/mailAccount'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x3a'),require(_0xaea2('0x3b')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x3c'),require(_0xaea2('0x3d')));_0x3ffde2['use'](_0xaea2('0x3e'),require('./api/mailInteraction'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x3f'),require(_0xaea2('0x40')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x41'),require(_0xaea2('0x42')));_0x3ffde2[_0xaea2('0x1f')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x43'),require(_0xaea2('0x44')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x45'),require(_0xaea2('0x46')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x47'),require('./api/faxAccount'));_0x3ffde2[_0xaea2('0x1f')]('/api/fax/applications',require(_0xaea2('0x48')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x49'),require(_0xaea2('0x4a')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x4b'),require(_0xaea2('0x4c')));_0x3ffde2['use']('/api/fax/queues',require(_0xaea2('0x4d')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x4e'),require(_0xaea2('0x4f')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x50'),require('./api/smsAccount'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x51'),require(_0xaea2('0x52')));_0x3ffde2[_0xaea2('0x1f')]('/api/sms/interactions',require('./api/smsInteraction'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x53'),require(_0xaea2('0x54')));_0x3ffde2[_0xaea2('0x1f')]('/api/sms/queues',require(_0xaea2('0x55')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x56'),require(_0xaea2('0x57')));_0x3ffde2[_0xaea2('0x1f')]('/api/openchannel/applications',require(_0xaea2('0x58')));_0x3ffde2['use'](_0xaea2('0x59'),require(_0xaea2('0x5a')));_0x3ffde2[_0xaea2('0x1f')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x3ffde2['use'](_0xaea2('0x5b'),require(_0xaea2('0x5c')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x5d'),require(_0xaea2('0x5e')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x5f'),require(_0xaea2('0x60')));_0x3ffde2['use'](_0xaea2('0x61'),require('./api/chatApplication'));_0x3ffde2['use'](_0xaea2('0x62'),require(_0xaea2('0x63')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x64'),require(_0xaea2('0x65')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x66'),require(_0xaea2('0x67')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x68'),require(_0xaea2('0x69')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x6a'),require(_0xaea2('0x6b')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x6c'),require(_0xaea2('0x6d')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x6e'),require(_0xaea2('0x6f')));_0x3ffde2[_0xaea2('0x1f')]('/api/cm/contacts',require(_0xaea2('0x70')));_0x3ffde2[_0xaea2('0x1f')]('/api/cm/hopper',require(_0xaea2('0x71')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x72'),require(_0xaea2('0x73')));_0x3ffde2['use'](_0xaea2('0x74'),require(_0xaea2('0x75')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x76'),require(_0xaea2('0x77')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x78'),require(_0xaea2('0x79')));_0x3ffde2['use'](_0xaea2('0x7a'),require('./api/action'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x7b'),require(_0xaea2('0x7c')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x7d'),require('./api/cannedAnswer'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x7e'),require(_0xaea2('0x7f')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x80'),require('./api/condition'));_0x3ffde2[_0xaea2('0x1f')]('/api/intervals',require(_0xaea2('0x81')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x82'),require(_0xaea2('0x83')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x84'),require(_0xaea2('0x85')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x86'),require(_0xaea2('0x87')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x88'),require(_0xaea2('0x89')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x8a'),require(_0xaea2('0x8b')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x8c'),require('./api/tag'));_0x3ffde2['use'](_0xaea2('0x8d'),require(_0xaea2('0x8e')));_0x3ffde2['use'](_0xaea2('0x8f'),require(_0xaea2('0x90')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x91'),require(_0xaea2('0x92')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x93'),require(_0xaea2('0x94')));_0x3ffde2['use']('/api/triggers',require(_0xaea2('0x95')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x96'),require(_0xaea2('0x97')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations',require(_0xaea2('0x98')));_0x3ffde2['use'](_0xaea2('0x99'),require(_0xaea2('0x9a')));_0x3ffde2[_0xaea2('0x1f')]('/api/analytics/custom_reports',require(_0xaea2('0x9b')));_0x3ffde2['use']('/api/analytics/default_reports',require(_0xaea2('0x9c')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x9d'),require(_0xaea2('0x9e')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x9f'),require(_0xaea2('0xa0')));_0x3ffde2['use'](_0xaea2('0xa1'),require('./api/analyticFieldReport'));_0x3ffde2[_0xaea2('0x1f')]('/api/analytics/tree_reports',require(_0xaea2('0xa2')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xa3'),require(_0xaea2('0xa4')));_0x3ffde2['use']('/api/integrations/salesforce/configurations',require(_0xaea2('0xa5')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xa6'),require(_0xaea2('0xa7')));_0x3ffde2['use']('/api/integrations/sugarcrm/accounts',require(_0xaea2('0xa8')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/sugarcrm/configurations',require(_0xaea2('0xa9')));_0x3ffde2['use'](_0xaea2('0xaa'),require(_0xaea2('0xab')));_0x3ffde2['use'](_0xaea2('0xac'),require(_0xaea2('0xad')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xae'),require(_0xaea2('0xaf')));_0x3ffde2['use'](_0xaea2('0xb0'),require('./api/intDeskField'));_0x3ffde2['use'](_0xaea2('0xb1'),require(_0xaea2('0xb2')));_0x3ffde2['use'](_0xaea2('0xb3'),require(_0xaea2('0xb4')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xb5'),require(_0xaea2('0xb6')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xb7'),require(_0xaea2('0xb8')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/zendesk/configurations',require(_0xaea2('0xb9')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xba'),require(_0xaea2('0xbb')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xbc'),require(_0xaea2('0xbd')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xbe'),require(_0xaea2('0xbf')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc0'),require(_0xaea2('0xc1')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc2'),require(_0xaea2('0xc3')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/vtiger/configurations',require(_0xaea2('0xc4')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc5'),require('./api/intVtigerField'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc6'),require('./api/intServicenowAccount'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc7'),require('./api/intServicenowConfiguration'));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/servicenow/fields',require(_0xaea2('0xc8')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xc9'),require(_0xaea2('0xca')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xcb'),require(_0xaea2('0xcc')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xcd'),require(_0xaea2('0xce')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/freshsales/accounts',require(_0xaea2('0xcf')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/freshsales/configurations',require(_0xaea2('0xd0')));_0x3ffde2[_0xaea2('0x1f')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xd1'),require(_0xaea2('0xd2')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xd3'),require(_0xaea2('0xd4')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xd5'),require(_0xaea2('0xd6')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xd7'),require(_0xaea2('0xd8')));_0x3ffde2[_0xaea2('0x1f')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x3ffde2['use']('/api/jscripty/sessions/reports',require(_0xaea2('0xd9')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xda'),require('./api/smsQueueReport'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xdb'),require(_0xaea2('0xdc')));_0x3ffde2[_0xaea2('0x1f')]('/api/square/details/reports',require(_0xaea2('0xdd')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xde'),require(_0xaea2('0xdf')));_0x3ffde2['use']('/api/settings',require(_0xaea2('0xe0')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xe1'),require(_0xaea2('0xe2')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xe3'),require(_0xaea2('0xe4')));_0x3ffde2['use'](_0xaea2('0xe5'),require(_0xaea2('0xe6')));_0x3ffde2['use'](_0xaea2('0xe7'),require(_0xaea2('0xe8')));_0x3ffde2['use'](_0xaea2('0xe9'),require(_0xaea2('0xea')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xeb'),require('./api/license'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xec'),require('./api/campaign'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xed'),require(_0xaea2('0xee')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xef'),require(_0xaea2('0xf0')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xf1'),require('./api/plugin'));_0x3ffde2['use']('/api/mail/reports/transfer',require(_0xaea2('0xf2')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xf3'),require(_0xaea2('0xf4')));_0x3ffde2[_0xaea2('0x1f')]('/api/fax/reports/transfer',require(_0xaea2('0xf5')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xf6'),require(_0xaea2('0xf7')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xf8'),require(_0xaea2('0xf9')));_0x3ffde2['use']('/api/cm/lists',require(_0xaea2('0xfa')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xfb'),require('./api/voicePrefix'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xfc'),require(_0xaea2('0xfd')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0xfe'),require(_0xaea2('0xff')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x100'),require('./api/userProfileResource'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x101'),require(_0xaea2('0x102')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x103'),require(_0xaea2('0x104')));_0x3ffde2[_0xaea2('0x1f')]('/api/whatsapp/applications',require(_0xaea2('0x105')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x106'),require('./api/whatsappInteraction'));_0x3ffde2[_0xaea2('0x1f')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x107'),require(_0xaea2('0x108')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x109'),require('./api/whatsappTransferReport'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x10a'),require(_0xaea2('0x10b')));_0x3ffde2['use'](_0xaea2('0x10c'),require(_0xaea2('0x10d')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x10e'),require(_0xaea2('0x10f')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x110'),require(_0xaea2('0x111')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x112'),require(_0xaea2('0x113')));_0x3ffde2['use'](_0xaea2('0x114'),require(_0xaea2('0x115')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x116'),require('./api/rpc'));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x117'),require(_0xaea2('0x118')));_0x3ffde2[_0xaea2('0x1f')]('/api/system',require(_0xaea2('0x119')));_0x3ffde2[_0xaea2('0x1f')]('/api/pm2',require(_0xaea2('0x11a')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x11b'),require(_0xaea2('0x11c')));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x11d'),express['static'](path[_0xaea2('0x11e')](config[_0xaea2('0x11f')],_0xaea2('0x11d'))));_0x3ffde2[_0xaea2('0x1f')](_0xaea2('0x120'),express[_0xaea2('0x121')](path['join'](config[_0xaea2('0x11f')],_0xaea2('0x120'))));_0x3ffde2[_0xaea2('0x1f')]('/demo',express[_0xaea2('0x121')](path['join'](config[_0xaea2('0x11f')],_0xaea2('0x122'))));_0x3ffde2['use'](_0xaea2('0x123'),express[_0xaea2('0x121')](path['join'](config['root'],_0xaea2('0x124'),'3.0.0')));_0x3ffde2['use'](_0xaea2('0x125'),express[_0xaea2('0x121')](path[_0xaea2('0x11e')](config[_0xaea2('0x11f')],_0xaea2('0x126'))));_0x3ffde2['route'](_0xaea2('0x127'))[_0xaea2('0x128')](errors[0x194]);_0x3ffde2[_0xaea2('0x129')]('/*')['get'](function(_0x1a21ca,_0x21c5b8){_0x21c5b8[_0xaea2('0x12a')](path[_0xaea2('0x12b')](_0x3ffde2[_0xaea2('0x128')](_0xaea2('0x12c'))+'/index.html'));});};var sensitiveFields=[_0xaea2('0x12d'),_0xaea2('0x12e'),'newPassword',_0xaea2('0x12f'),'firstName',_0xaea2('0x130'),_0xaea2('0x131'),_0xaea2('0x132'),_0xaea2('0x133'),_0xaea2('0x134'),'email','clientId',_0xaea2('0x135'),'securityToken',_0xaea2('0x136'),_0xaea2('0x137'),_0xaea2('0x138'),'token',_0xaea2('0x139'),_0xaea2('0x13a'),_0xaea2('0x13b'),_0xaea2('0x13c'),_0xaea2('0x13d'),_0xaea2('0x13e'),'membername',_0xaea2('0x13f'),_0xaea2('0x140'),_0xaea2('0x141'),_0xaea2('0x142'),_0xaea2('0x143'),_0xaea2('0x144'),_0xaea2('0x145'),_0xaea2('0x146'),'key',_0xaea2('0x13'),_0xaea2('0x147'),_0xaea2('0x148'),_0xaea2('0x149'),_0xaea2('0x14a'),_0xaea2('0x14b'),_0xaea2('0x14c'),'oldPassword'];function maskSensitiveData(_0x9d7fb9){var _0x26979f=/(?!^)[\s\S](?!$)/g;if(!_[_0xaea2('0x14d')](_0x9d7fb9))return;for(var _0x5d417f in _0x9d7fb9){if(_[_0xaea2('0x14e')](_0x9d7fb9[_0x5d417f])){for(var _0x5d6697=0x0;_0x5d6697<_0x9d7fb9[_0x5d417f][_0xaea2('0x14f')];_0x5d6697++){maskSensitiveData(_0x9d7fb9[_0x5d417f][_0x5d6697]);}}else if(_[_0xaea2('0x14d')](_0x9d7fb9[_0x5d417f])){maskSensitiveData(_0x9d7fb9[_0x5d417f]);}else if(_[_0xaea2('0x150')](_0x9d7fb9[_0x5d417f])){_0x9d7fb9[_0x5d417f]=_0x9d7fb9[_0x5d417f][_0xaea2('0x151')](/{{{/g,_0xaea2('0x152'))['replace'](/}}}/g,_0xaea2('0x153'))[_0xaea2('0x151')](/{{/g,'@{')[_0xaea2('0x151')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5d417f)){_0x9d7fb9[_0x5d417f]=_0x9d7fb9[_0x5d417f][_0xaea2('0x151')](_0x26979f,'*');}}}}
\ No newline at end of file
+var _0xcfd1=['./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./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/whatsapp/accounts','./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/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','./api/pm2','./api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','mobile','email','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','authToken','consumerSecret','calleridname','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','dsn','secret','registry','isArray','isPlainObject','@@{','}@@','includes','path','express','util','./errors','./config/environment','./config/logger','api','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','url','statusCode','responseTime','user','name','role','device','agent_id','connection','remoteAddress','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/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/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/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/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments'];(function(_0x376d8d,_0xe6b2ef){var _0xc9c89d=function(_0x1d8459){while(--_0x1d8459){_0x376d8d['push'](_0x376d8d['shift']());}};_0xc9c89d(++_0xe6b2ef);}(_0xcfd1,0x66));var _0x1cfd=function(_0x4a9359,_0x1f04f1){_0x4a9359=_0x4a9359-0x0;var _0x4288cc=_0xcfd1[_0x4a9359];return _0x4288cc;};'use strict';var _=require('lodash');var path=require(_0x1cfd('0x0'));var express=require(_0x1cfd('0x1'));var ewinston=require('express-winston');var util=require(_0x1cfd('0x2'));var errors=require(_0x1cfd('0x3'));var config=require(_0x1cfd('0x4'));var logger=require(_0x1cfd('0x5'))(_0x1cfd('0x6'));var authLogger=require(_0x1cfd('0x5'))('auth');exports[_0x1cfd('0x7')]=function(_0x173ef9){_0x173ef9[_0x1cfd('0x8')](ewinston[_0x1cfd('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3dba96,_0xe860ba){var _0x23d556=_0x1cfd('0xa');if(!_[_0x1cfd('0xb')](_0x3dba96[_0x1cfd('0xc')])){_0x23d556+=_0x1cfd('0xd');var _0x1a8c47=_0x3dba96[_0x1cfd('0xc')];maskSensitiveData(_0x1a8c47);}return util[_0x1cfd('0xe')](_0x23d556,_0x3dba96[_0x1cfd('0xf')],_0x3dba96[_0x1cfd('0x10')]['x-forwarded-for']?_0x3dba96[_0x1cfd('0x10')][_0x1cfd('0x11')]:_0x3dba96['connection']['remoteAddress']||_0x3dba96['ip'],_0x3dba96[_0x1cfd('0x12')],_0xe860ba[_0x1cfd('0x13')],_0xe860ba[_0x1cfd('0x14')],_0x3dba96[_0x1cfd('0x15')]?_0x3dba96['user']['id']:null,_0x3dba96[_0x1cfd('0x15')]?_0x3dba96['user'][_0x1cfd('0x16')]:null,_0x3dba96[_0x1cfd('0x15')]?_0x3dba96['user'][_0x1cfd('0x17')]:null,_0x1a8c47?util['inspect'](_0x1a8c47,![],null):'');}}));_0x173ef9[_0x1cfd('0x8')](ewinston[_0x1cfd('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5aba39,_0x2a23d2){var _0x4e582c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5aba39[_0x1cfd('0xc')]&&_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x18')]&&_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x19')]){_0x4e582c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x4e582c,_0x5aba39[_0x1cfd('0xf')],_0x5aba39[_0x1cfd('0x10')][_0x1cfd('0x11')]?_0x5aba39['headers'][_0x1cfd('0x11')]:_0x5aba39[_0x1cfd('0x1a')][_0x1cfd('0x1b')]||_0x5aba39['ip'],_0x5aba39[_0x1cfd('0x12')],_0x2a23d2['statusCode'],_0x2a23d2[_0x1cfd('0x14')],_0x5aba39[_0x1cfd('0x15')]?_0x5aba39[_0x1cfd('0x15')]['id']:null,_0x5aba39[_0x1cfd('0x15')]?_0x5aba39[_0x1cfd('0x15')][_0x1cfd('0x16')]:null,_0x5aba39[_0x1cfd('0x15')]?_0x5aba39[_0x1cfd('0x15')][_0x1cfd('0x17')]:null,_0x5aba39[_0x1cfd('0xc')]&&_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x18')]?_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x18')]:_0x1cfd('0x1c'),_0x5aba39[_0x1cfd('0xc')]&&_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x19')]?_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x19')]:'',_0x5aba39[_0x1cfd('0xc')]&&_0x5aba39[_0x1cfd('0xc')]['agent_name']?_0x5aba39[_0x1cfd('0xc')][_0x1cfd('0x1d')]:'');},'ignoreRoute':function(_0x3e6049){var _0x5c161e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5c161e[_0x1cfd('0x1e')](_0x3e6049['url']);}}));_0x173ef9[_0x1cfd('0x8')]('/api/users',require(_0x1cfd('0x1f')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x20'),require('./api/voiceChanSpy'));_0x173ef9[_0x1cfd('0x8')]('/api/voice/contexts',require(_0x1cfd('0x21')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x22'),require(_0x1cfd('0x23')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x24'),require(_0x1cfd('0x25')));_0x173ef9['use']('/api/voice/queues',require('./api/voiceQueue'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x26'),require(_0x1cfd('0x27')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x28'),require(_0x1cfd('0x29')));_0x173ef9['use'](_0x1cfd('0x2a'),require(_0x1cfd('0x2b')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x2c'),require(_0x1cfd('0x2d')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x2e'),require('./api/voiceCallReport'));_0x173ef9[_0x1cfd('0x8')]('/api/voice/dials/reports',require(_0x1cfd('0x2f')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x30'),require(_0x1cfd('0x31')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x32'),require(_0x1cfd('0x33')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x34'),require('./api/memberReport'));_0x173ef9[_0x1cfd('0x8')]('/api/trunks',require(_0x1cfd('0x35')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x36'),require(_0x1cfd('0x37')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x38'),require('./api/mailServerOut'));_0x173ef9['use'](_0x1cfd('0x39'),require('./api/mailAccount'));_0x173ef9['use']('/api/mail/queues',require('./api/mailQueue'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x3a'),require(_0x1cfd('0x3b')));_0x173ef9[_0x1cfd('0x8')]('/api/mail/interactions',require(_0x1cfd('0x3c')));_0x173ef9[_0x1cfd('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x3d'),require(_0x1cfd('0x3e')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x3f'),require(_0x1cfd('0x40')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x41'),require('./api/dashboard'));_0x173ef9['use'](_0x1cfd('0x42'),require(_0x1cfd('0x43')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x44'),require(_0x1cfd('0x45')));_0x173ef9['use'](_0x1cfd('0x46'),require('./api/faxApplication'));_0x173ef9[_0x1cfd('0x8')]('/api/fax/interactions',require(_0x1cfd('0x47')));_0x173ef9[_0x1cfd('0x8')]('/api/fax/messages',require(_0x1cfd('0x48')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x49'),require(_0x1cfd('0x4a')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x4b'),require('./api/faxQueueReport'));_0x173ef9['use'](_0x1cfd('0x4c'),require(_0x1cfd('0x4d')));_0x173ef9[_0x1cfd('0x8')]('/api/sms/applications',require(_0x1cfd('0x4e')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x4f'),require('./api/smsInteraction'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x50'),require(_0x1cfd('0x51')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x52'),require(_0x1cfd('0x53')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x54'),require(_0x1cfd('0x55')));_0x173ef9[_0x1cfd('0x8')]('/api/openchannel/applications',require(_0x1cfd('0x56')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x57'),require(_0x1cfd('0x58')));_0x173ef9['use'](_0x1cfd('0x59'),require(_0x1cfd('0x5a')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x5b'),require(_0x1cfd('0x5c')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x5d'),require(_0x1cfd('0x5e')));_0x173ef9['use'](_0x1cfd('0x5f'),require(_0x1cfd('0x60')));_0x173ef9[_0x1cfd('0x8')]('/api/chat/applications',require(_0x1cfd('0x61')));_0x173ef9[_0x1cfd('0x8')]('/api/chat/interactions',require(_0x1cfd('0x62')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x63'),require('./api/chatMessage'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x64'),require(_0x1cfd('0x65')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x66'),require('./api/chatQueue'));_0x173ef9['use'](_0x1cfd('0x67'),require(_0x1cfd('0x68')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x69'),require(_0x1cfd('0x6a')));_0x173ef9['use'](_0x1cfd('0x6b'),require(_0x1cfd('0x6c')));_0x173ef9['use'](_0x1cfd('0x6d'),require(_0x1cfd('0x6e')));_0x173ef9[_0x1cfd('0x8')]('/api/cm/hopper',require(_0x1cfd('0x6f')));_0x173ef9['use'](_0x1cfd('0x70'),require(_0x1cfd('0x71')));_0x173ef9['use'](_0x1cfd('0x72'),require(_0x1cfd('0x73')));_0x173ef9[_0x1cfd('0x8')]('/api/cm/hopper_history',require(_0x1cfd('0x74')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x75'),require(_0x1cfd('0x76')));_0x173ef9[_0x1cfd('0x8')]('/api/actions',require(_0x1cfd('0x77')));_0x173ef9[_0x1cfd('0x8')]('/api/automations',require(_0x1cfd('0x78')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x79'),require(_0x1cfd('0x7a')));_0x173ef9[_0x1cfd('0x8')]('/api/dispositions',require('./api/disposition'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x7b'),require(_0x1cfd('0x7c')));_0x173ef9['use'](_0x1cfd('0x7d'),require(_0x1cfd('0x7e')));_0x173ef9['use'](_0x1cfd('0x7f'),require(_0x1cfd('0x80')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x81'),require('./api/cdr'));_0x173ef9['use']('/api/voiceQueuesLog',require(_0x1cfd('0x82')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x83'),require(_0x1cfd('0x84')));_0x173ef9[_0x1cfd('0x8')]('/api/sounds',require(_0x1cfd('0x85')));_0x173ef9[_0x1cfd('0x8')]('/api/tags',require(_0x1cfd('0x86')));_0x173ef9[_0x1cfd('0x8')]('/api/contact_item_types',require(_0x1cfd('0x87')));_0x173ef9['use']('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x88'),require(_0x1cfd('0x89')));_0x173ef9['use'](_0x1cfd('0x8a'),require('./api/template'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x8b'),require('./api/trigger'));_0x173ef9[_0x1cfd('0x8')]('/api/variables',require('./api/variable'));_0x173ef9[_0x1cfd('0x8')]('/api/integrations',require(_0x1cfd('0x8c')));_0x173ef9['use']('/api/integrations/reports',require(_0x1cfd('0x8d')));_0x173ef9[_0x1cfd('0x8')]('/api/analytics/custom_reports',require(_0x1cfd('0x8e')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x8f'),require(_0x1cfd('0x90')));_0x173ef9[_0x1cfd('0x8')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x91'),require('./api/analyticMetric'));_0x173ef9[_0x1cfd('0x8')]('/api/analytics/field_reports',require(_0x1cfd('0x92')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x93'),require('./api/analyticTreeReport'));_0x173ef9['use'](_0x1cfd('0x94'),require(_0x1cfd('0x95')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x96'),require(_0x1cfd('0x97')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x98'),require(_0x1cfd('0x99')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x9a'),require(_0x1cfd('0x9b')));_0x173ef9[_0x1cfd('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x1cfd('0x9c')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x9d'),require(_0x1cfd('0x9e')));_0x173ef9['use'](_0x1cfd('0x9f'),require(_0x1cfd('0xa0')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xa1'),require(_0x1cfd('0xa2')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xa3'),require(_0x1cfd('0xa4')));_0x173ef9['use'](_0x1cfd('0xa5'),require(_0x1cfd('0xa6')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xa7'),require(_0x1cfd('0xa8')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xa9'),require('./api/intZohoField'));_0x173ef9['use'](_0x1cfd('0xaa'),require(_0x1cfd('0xab')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xac'),require('./api/intZendeskConfiguration'));_0x173ef9['use']('/api/integrations/zendesk/fields',require(_0x1cfd('0xad')));_0x173ef9[_0x1cfd('0x8')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x173ef9['use'](_0x1cfd('0xae'),require('./api/intFreshdeskConfiguration'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xaf'),require('./api/intFreshdeskField'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xb0'),require('./api/intVtigerAccount'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xb1'),require(_0x1cfd('0xb2')));_0x173ef9['use'](_0x1cfd('0xb3'),require(_0x1cfd('0xb4')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xb5'),require(_0x1cfd('0xb6')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xb7'),require(_0x1cfd('0xb8')));_0x173ef9['use'](_0x1cfd('0xb9'),require('./api/intServicenowField'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xba'),require('./api/intDynamics365Account'));_0x173ef9['use']('/api/integrations/dynamics365/configurations',require(_0x1cfd('0xbb')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xbc'),require(_0x1cfd('0xbd')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xbe'),require(_0x1cfd('0xbf')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xc0'),require('./api/intFreshsalesConfiguration'));_0x173ef9[_0x1cfd('0x8')]('/api/integrations/freshsales/fields',require(_0x1cfd('0xc1')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xc2'),require(_0x1cfd('0xc3')));_0x173ef9['use']('/api/chat/reports/queue',require(_0x1cfd('0xc4')));_0x173ef9[_0x1cfd('0x8')]('/api/chat/internal/messages',require(_0x1cfd('0xc5')));_0x173ef9[_0x1cfd('0x8')]('/api/jscripty/answers/reports',require(_0x1cfd('0xc6')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xc7'),require(_0x1cfd('0xc8')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xc9'),require(_0x1cfd('0xca')));_0x173ef9['use'](_0x1cfd('0xcb'),require(_0x1cfd('0xcc')));_0x173ef9[_0x1cfd('0x8')]('/api/square/reports',require(_0x1cfd('0xcd')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xce'),require(_0x1cfd('0xcf')));_0x173ef9[_0x1cfd('0x8')]('/api/jscripty/projects',require(_0x1cfd('0xd0')));_0x173ef9[_0x1cfd('0x8')]('/api/settings',require('./api/setting'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xd1'),require(_0x1cfd('0xd2')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xd3'),require(_0x1cfd('0xd4')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xd5'),require(_0x1cfd('0xd6')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xd7'),require(_0x1cfd('0xd8')));_0x173ef9[_0x1cfd('0x8')]('/api/teams',require(_0x1cfd('0xd9')));_0x173ef9['use'](_0x1cfd('0xda'),require(_0x1cfd('0xdb')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xdc'),require(_0x1cfd('0xdd')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xde'),require(_0x1cfd('0xdf')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xe0'),require(_0x1cfd('0xe1')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xe2'),require(_0x1cfd('0xe3')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xe4'),require(_0x1cfd('0xe5')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xe6'),require(_0x1cfd('0xe7')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xe8'),require(_0x1cfd('0xe9')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xea'),require('./api/openchannelTransferReport'));_0x173ef9['use'](_0x1cfd('0xeb'),require(_0x1cfd('0xec')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xed'),require(_0x1cfd('0xee')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xef'),require(_0x1cfd('0xf0')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xf1'),require(_0x1cfd('0xf2')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xf3'),require(_0x1cfd('0xf4')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xf5'),require(_0x1cfd('0xf6')));_0x173ef9['use'](_0x1cfd('0xf7'),require('./api/userNotification'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xf8'),require(_0x1cfd('0xf9')));_0x173ef9['use'](_0x1cfd('0xfa'),require(_0x1cfd('0xfb')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0xfc'),require(_0x1cfd('0xfd')));_0x173ef9['use'](_0x1cfd('0xfe'),require(_0x1cfd('0xff')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x100'),require(_0x1cfd('0x101')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x102'),require(_0x1cfd('0x103')));_0x173ef9[_0x1cfd('0x8')]('/api/whatsapp/queues',require(_0x1cfd('0x104')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x105'),require(_0x1cfd('0x106')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x107'),require(_0x1cfd('0x108')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x109'),require(_0x1cfd('0x10a')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x10b'),require('./api/authGoogle'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x10c'),require(_0x1cfd('0x10d')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x10e'),require(_0x1cfd('0x10f')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x110'),require('./api/version'));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x111'),require(_0x1cfd('0x112')));_0x173ef9[_0x1cfd('0x8')]('/api/pm2',require(_0x1cfd('0x113')));_0x173ef9[_0x1cfd('0x8')]('/api/webbar',require(_0x1cfd('0x114')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x115'),express[_0x1cfd('0x116')](path[_0x1cfd('0x117')](config[_0x1cfd('0x118')],_0x1cfd('0x115'))));_0x173ef9[_0x1cfd('0x8')]('/www',express[_0x1cfd('0x116')](path[_0x1cfd('0x117')](config[_0x1cfd('0x118')],'/www')));_0x173ef9[_0x1cfd('0x8')](_0x1cfd('0x119'),express[_0x1cfd('0x116')](path[_0x1cfd('0x117')](config['root'],_0x1cfd('0x119'))));_0x173ef9['use'](_0x1cfd('0x11a'),express[_0x1cfd('0x116')](path[_0x1cfd('0x117')](config[_0x1cfd('0x118')],_0x1cfd('0x11b'),_0x1cfd('0x11c'))));_0x173ef9['use'](_0x1cfd('0x11d'),express['static'](path[_0x1cfd('0x117')](config['root'],'/server/files/plugins')));_0x173ef9['route'](_0x1cfd('0x11e'))['get'](errors[0x194]);_0x173ef9[_0x1cfd('0x11f')]('/*')[_0x1cfd('0x120')](function(_0x13e032,_0x58cca3){_0x58cca3[_0x1cfd('0x121')](path[_0x1cfd('0x122')](_0x173ef9['get'](_0x1cfd('0x123'))+_0x1cfd('0x124')));});};var sensitiveFields=[_0x1cfd('0x125'),_0x1cfd('0x126'),_0x1cfd('0x127'),_0x1cfd('0x128'),_0x1cfd('0x129'),_0x1cfd('0x12a'),_0x1cfd('0x12b'),'phone',_0x1cfd('0x12c'),'fax',_0x1cfd('0x12d'),'clientId',_0x1cfd('0x12e'),_0x1cfd('0x12f'),_0x1cfd('0x130'),_0x1cfd('0x131'),'tenantId',_0x1cfd('0x132'),_0x1cfd('0x133'),_0x1cfd('0x134'),'accessTokenSecret',_0x1cfd('0x135'),'consumerKey',_0x1cfd('0x136'),'membername',_0x1cfd('0x137'),'calleridnum',_0x1cfd('0x138'),_0x1cfd('0x139'),_0x1cfd('0x13a'),_0x1cfd('0x13b'),'accesskeyid',_0x1cfd('0x13c'),_0x1cfd('0x13d'),_0x1cfd('0x15'),_0x1cfd('0x13e'),'accountSid','localstationid',_0x1cfd('0x13f'),_0x1cfd('0x140'),_0x1cfd('0x141'),'oldPassword'];function maskSensitiveData(_0x7605a8){var _0xcf78d4=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x7605a8))return;for(var _0x2165ea in _0x7605a8){if(_[_0x1cfd('0x142')](_0x7605a8[_0x2165ea])){for(var _0x33b066=0x0;_0x33b066<_0x7605a8[_0x2165ea]['length'];_0x33b066++){maskSensitiveData(_0x7605a8[_0x2165ea][_0x33b066]);}}else if(_[_0x1cfd('0x143')](_0x7605a8[_0x2165ea])){maskSensitiveData(_0x7605a8[_0x2165ea]);}else if(_['isString'](_0x7605a8[_0x2165ea])){_0x7605a8[_0x2165ea]=_0x7605a8[_0x2165ea]['replace'](/{{{/g,_0x1cfd('0x144'))['replace'](/}}}/g,_0x1cfd('0x145'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x1cfd('0x146')](sensitiveFields,_0x2165ea)){_0x7605a8[_0x2165ea]=_0x7605a8[_0x2165ea]['replace'](_0xcf78d4,'*');}}}}
\ No newline at end of file
index 6e95b12..4f102a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3c=['../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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x7d3c,0x1af));var _0xc7d3=function(_0x1427ab,_0x4978fb){_0x1427ab=_0x1427ab-0x0;var _0x426299=_0x7d3c[_0x1427ab];return _0x426299;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0xc7d3('0x0'));var config=require(_0xc7d3('0x1'));exports[_0xc7d3('0x2')]=function(){return new BPromise(function(_0x3b4428,_0x36ef7f){var _0x4485f1={};_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/user/user.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/voiceExtension/voiceExtension.rpc'));_0x4485f1=_['merge'](_0x4485f1,require('../api/voiceQueue/voiceQueue.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x4')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x5')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x6')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x7')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x8')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x9')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xa')));_0x4485f1=_['merge'](_0x4485f1,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/mailServerIn/mailServerIn.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/mailAccount/mailAccount.rpc'));_0x4485f1=_['merge'](_0x4485f1,require('../api/mailQueue/mailQueue.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/mailInteraction/mailInteraction.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xb')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xc')));_0x4485f1=_['merge'](_0x4485f1,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xd')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/faxApplication/faxApplication.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xe')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0xf')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x10')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x11')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x12')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x13')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x14')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x15')));_0x4485f1=_['merge'](_0x4485f1,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x16')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x17')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x18')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x19')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x1a')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x1b')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x1c')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x1d')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x1e')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x1f')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x20')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x21')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x22')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x23')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x24')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x25')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x26')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x27')));_0x4485f1=_['merge'](_0x4485f1,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x28')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x29')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x2a')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x2b')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x2c')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x2d')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x2e')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x2f')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require('../api/setting/setting.rpc'));_0x4485f1=_['merge'](_0x4485f1,require('../api/squareOdbc/squareOdbc.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x30')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x31')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x32')));_0x4485f1=_['merge'](_0x4485f1,require('../api/campaign/campaign.rpc'));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x33')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x34')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x35')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x36')));_0x4485f1=_[_0xc7d3('0x3')](_0x4485f1,require(_0xc7d3('0x37')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x38')));_0x4485f1=_['merge'](_0x4485f1,require(_0xc7d3('0x39')));var _0x33d0bf=jayson['server'](_0x4485f1)['http']();var _0x3e3b5c=config[_0xc7d3('0x3a')][_0xc7d3('0x3b')]||config[_0xc7d3('0x3b')]+0x1;var _0x6471a4=config[_0xc7d3('0x3a')]['ip']||_0xc7d3('0x3c');_0x33d0bf['on'](_0xc7d3('0x3d'),function(_0x438aa3){return _0x36ef7f(_0x438aa3);});_0x33d0bf['listen'](_0x3e3b5c,_0x6471a4,function(){console[_0xc7d3('0x3e')](_0xc7d3('0x3f'),_0x6471a4,_0x3e3b5c);require(_0xc7d3('0x40'))['default']();return _0x3b4428(_0xc7d3('0x41')+_0x6471a4+':'+_0x3e3b5c);});});};
\ No newline at end of file
+var _0xd76e=['../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd76e,0x1bc));var _0xed76=function(_0x108efd,_0x19c94c){_0x108efd=_0x108efd-0x0;var _0x5976fc=_0xd76e[_0x108efd];return _0x5976fc;};'use strict';var jayson=require(_0xed76('0x0'));var BPromise=require('bluebird');var _=require(_0xed76('0x1'));var config=require(_0xed76('0x2'));exports[_0xed76('0x3')]=function(){return new BPromise(function(_0x5d0fcc,_0x175cf6){var _0x32279a={};_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x5')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x6')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x7')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x8')));_0x32279a=_['merge'](_0x32279a,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x9')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0xa')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0xb')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0xc')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/trunk/trunk.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0xd')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/mailServerIn/mailServerIn.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/mailAccount/mailAccount.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0xe')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0xf')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/mailMessage/mailMessage.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x10')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x11')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x12')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/faxApplication/faxApplication.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x13')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/faxMessage/faxMessage.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x14')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x15')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x16')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x17')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/smsMessage/smsMessage.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x18')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x19')));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x1a')));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x1b')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x1c')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x32279a=_['merge'](_0x32279a,require('../api/chatInteraction/chatInteraction.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x1d')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/chatQueue/chatQueue.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/cmContact/cmContact.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x1e')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x1f')));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x20')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x21')));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x22')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x23')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x24')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x25')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x26')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x27')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/trigger/trigger.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/variable/variable.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x28')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x29')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x2a')));_0x32279a=_['merge'](_0x32279a,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x2b')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x2c')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x2d')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x2e')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x2f')));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x30')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x32279a=_['merge'](_0x32279a,require(_0xed76('0x31')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x32')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/setting/setting.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x33')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/squareProject/squareProject.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/squareRecording/squareRecording.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require('../api/squareMessage/squareMessage.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x34')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x35')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x36')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x37')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x38')));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x39')));_0x32279a=_['merge'](_0x32279a,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x32279a=_[_0xed76('0x4')](_0x32279a,require(_0xed76('0x3a')));var _0x469862=jayson[_0xed76('0x3b')](_0x32279a)[_0xed76('0x3c')]();var _0x1301f4=config[_0xed76('0x3d')][_0xed76('0x3e')]||config[_0xed76('0x3e')]+0x1;var _0x572469=config[_0xed76('0x3d')]['ip']||_0xed76('0x3f');_0x469862['on'](_0xed76('0x40'),function(_0x6b0371){return _0x175cf6(_0x6b0371);});_0x469862['listen'](_0x1301f4,_0x572469,function(){console[_0xed76('0x41')](_0xed76('0x42'),_0x572469,_0x1301f4);require(_0xed76('0x43'))['default']();return _0x5d0fcc(_0xed76('0x44')+_0x572469+':'+_0x1301f4);});});};
\ No newline at end of file
index 5fb72c7..e2c1e44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b6=['destroy','pipe','command','function','write','close','inherits','prototype','sendRequest','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','setEncoding','setTimeout','utf8','headers','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','length','match','error','E_AGI_SOCKET_ERROR','code','timeout'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x02b6,0xfe));var _0x602b=function(_0x39fa17,_0x204c62){_0x39fa17=_0x39fa17-0x0;var _0x7961aa=_0x02b6[_0x39fa17];return _0x7961aa;};'use strict';var util=require(_0x602b('0x0'));var _=require('lodash');var EventEmitter=require(_0x602b('0x1'))[_0x602b('0x2')];var AGIReply=require(_0x602b('0x3'));var AGIError=require('./error');function AGIChannel(_0x57c7b5){var _0x8291f=this,_0x31f4a4=new AGIReply(),_0x33cc82=![],_0x2eec97={};EventEmitter['call'](_0x8291f);_0x57c7b5[_0x602b('0x4')]('utf8');_0x57c7b5[_0x602b('0x5')](0x8*0x3c*0x3c*0x3e8);_0x31f4a4[_0x602b('0x4')](_0x602b('0x6'));_0x31f4a4['on'](_0x602b('0x7'),function(_0x51f151){for(var _0x16ba0d in _0x51f151){_0x8291f[_0x16ba0d]=_0x51f151[_0x16ba0d];}_0x8291f[_0x602b('0x8')](_0x602b('0x9'));});_0x31f4a4['on'](_0x602b('0xa'),function(_0x1687ca){if(_0x1687ca['toLowerCase']()==_0x602b('0xb')){_0x8291f['emit']('hangup');return;}if(_0x1687ca[_0x602b('0xc')](0x0,0xb)=='520-Invalid'){_0x33cc82=!![];}if(_0x33cc82){_0x2eec97['rx']+=_0x1687ca+'\x0a';if(_0x1687ca[_0x602b('0xd')](_0x602b('0xe'))!=-0x1){_0x33cc82=![];}}else{_0x2eec97['rx']=_0x1687ca;}if(_0x33cc82){return;}if(typeof _0x2eec97['cb']=='function'){var _0x1e7882=_0x2eec97['rx']['substring'](0x0,0x3),_0x41cd15=null,_0x135847=null;_0x1e7882=parseInt(_0x1e7882);if(isNaN(_0x1e7882)){_0x2eec97['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x602b('0xf')});return;}if(_0x1e7882!=0xc8){_0x2eec97['cb'](null,{'code':_0x1e7882,'result':-0x1,'extra':'KO'});return;}_0x41cd15=_0x2eec97['rx'][_0x602b('0xc')](0x4)[_0x602b('0x10')](_0x602b('0x11'),'');if(_0x41cd15[_0x602b('0x12')]('\x20')!=-0x1){_0x41cd15=_0x41cd15[_0x602b('0x13')](0x0,_0x41cd15[_0x602b('0x12')]('\x20'));}if(_['startsWith'](_0x41cd15,'-1')){_0x41cd15=parseInt(_0x41cd15);}_0x135847=_0x2eec97['rx']['split']('\x20');if(_0x135847[_0x602b('0x14')]==0x3){_0x135847=_0x135847[0x2][_0x602b('0xc')](0x1,_0x135847[0x2][_0x602b('0x14')]-0x1);}else if(_0x135847[_0x602b('0x14')]>0x3){var _0x2aed6b=/\((.+)\)/;var _0x3f540c=_0x2eec97['rx'][_0x602b('0x15')](_0x2aed6b);if(_0x3f540c){_0x135847=_0x3f540c[0x1];}else{_0x135847=null;}}else{_0x135847=null;}_0x2eec97['cb'](null,{'code':_0x1e7882,'result':_0x41cd15,'extra':_0x135847});}});_0x57c7b5['on'](_0x602b('0x16'),function(_0x46758d){_0x8291f['emit'](_0x602b('0x16'),new AGIError(_0x602b('0x17'),_0x46758d[_0x602b('0x18')]));});_0x57c7b5['on']('close',function(){_0x8291f[_0x602b('0x8')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x57c7b5['on'](_0x602b('0x19'),function(){_0x8291f['emit'](_0x602b('0x19'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x57c7b5[_0x602b('0x1a')]();});_0x57c7b5[_0x602b('0x1b')](_0x31f4a4);this[_0x602b('0x1c')]=function(_0x5c1893,_0x258e11){var _0x5c1893=_0x5c1893||'',_0x258e11=typeof _0x258e11==_0x602b('0x1d')?_0x258e11:new Function();_0x2eec97={'tx':_0x5c1893,'rx':'','cb':_0x258e11};_0x57c7b5[_0x602b('0x1e')](_0x5c1893+'\x0a');},this[_0x602b('0x1f')]=function(){_0x57c7b5[_0x602b('0x1a')]();};}util[_0x602b('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x602b('0x21')][_0x602b('0x22')]=function(_0x3409ed){return this[_0x602b('0x1c')]['sync'](this,_0x3409ed);};AGIChannel[_0x602b('0x21')][_0x602b('0x23')]=function(){return this['sendRequest'](_0x602b('0x24'));};AGIChannel[_0x602b('0x21')]['getData']=function(_0x11dfd5,_0x428ccb,_0x22cd69){_0x11dfd5=_0x11dfd5===undefined?_0x602b('0x25'):_0x11dfd5;_0x428ccb=_0x428ccb===undefined?'5':_0x428ccb;_0x22cd69=_0x22cd69===undefined?'1':_0x22cd69;return this[_0x602b('0x22')](util[_0x602b('0x26')](_0x602b('0x27'),_0x11dfd5,_0x428ccb*0x3e8,_0x22cd69));};AGIChannel[_0x602b('0x21')][_0x602b('0x28')]=function(_0x1fc94f){_0x1fc94f=_0x1fc94f||_0x602b('0x29');return this['sendRequest'](util[_0x602b('0x26')]('VERBOSE\x20\x22%s\x22',_0x1fc94f));};AGIChannel[_0x602b('0x21')][_0x602b('0x2a')]=function(_0x40b828,_0x3b951b){if(_[_0x602b('0x2b')](_0x3b951b)){return this[_0x602b('0x22')](util[_0x602b('0x26')](_0x602b('0x2c'),_0x40b828,_0x3b951b[_0x602b('0x2d')](',')));}return this[_0x602b('0x22')](util[_0x602b('0x26')]('EXEC\x20%s\x20%s',_0x40b828,_0x3b951b));};AGIChannel['prototype'][_0x602b('0x2e')]=function(_0x2720ba){return this[_0x602b('0x22')](util[_0x602b('0x26')]('SET\x20CONTEXT\x20%s',_0x2720ba));};AGIChannel[_0x602b('0x21')][_0x602b('0x2f')]=function(_0x3562b4){return this['sendRequest'](util[_0x602b('0x26')](_0x602b('0x30'),_0x3562b4));};AGIChannel[_0x602b('0x21')][_0x602b('0x31')]=function(_0x5be386){return this[_0x602b('0x22')](util['format'](_0x602b('0x32'),_0x5be386));};AGIChannel[_0x602b('0x21')][_0x602b('0xb')]=function(){return this[_0x602b('0x22')](_0x602b('0x33'));};AGIChannel[_0x602b('0x21')]['setVariable']=function(_0x1af3d0,_0x22a179){var _0x9f9357=_['isBoolean'](_0x22a179)||_[_0x602b('0x34')](_0x22a179)?_0x22a179['toString']():_0x22a179;return this[_0x602b('0x22')](util[_0x602b('0x26')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1af3d0,_0x9f9357?_0x9f9357['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x602b('0x21')][_0x602b('0x35')]=function(_0x11c15e,_0xbf35fd){return this[_0x602b('0x22')](util[_0x602b('0x26')](_0x602b('0x36'),_0x11c15e,_0xbf35fd));};AGIChannel[_0x602b('0x21')][_0x602b('0x37')]=function(_0x5babe9,_0x31bb71){return this[_0x602b('0x22')](util[_0x602b('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x5babe9,_0x31bb71));};AGIChannel[_0x602b('0x21')][_0x602b('0x38')]=function(_0x10529a,_0x4afaab){return this[_0x602b('0x22')](util[_0x602b('0x26')](_0x602b('0x39'),_0x10529a,_0x4afaab));};AGIChannel[_0x602b('0x21')][_0x602b('0x3a')]=function(_0x553373,_0x227350,_0x23a07a){_0x227350=_0x227350||this['extension'];_0x23a07a=_0x23a07a||0x1;this[_0x602b('0x2e')](_0x553373);this[_0x602b('0x2f')](_0x227350);this[_0x602b('0x31')](_0x23a07a);return this[_0x602b('0x28')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x553373,_0x227350,_0x23a07a));};AGIChannel[_0x602b('0x21')]['getVariable']=function(_0x4a68d4){return this[_0x602b('0x22')](util['format'](_0x602b('0x3b'),_0x4a68d4));};AGIChannel[_0x602b('0x21')][_0x602b('0x3c')]=function(_0x4abc9f,_0x3244fe,_0x4da73c,_0x5493cd,_0x29bc32,_0x1c0c62){_0x3244fe=_0x3244fe||_0x602b('0x3d');_0x4da73c=_0x4da73c||'';_0x5493cd=_0x5493cd===undefined?-0x1:_0x5493cd==='-1'?-0x1:_0x5493cd*0x3e8;_0x29bc32=_0x29bc32===undefined?'':'s='+_0x29bc32;_0x1c0c62=_0x1c0c62?_0x602b('0x3e'):'';return this[_0x602b('0x22')](util[_0x602b('0x26')](_0x602b('0x3f'),_0x4abc9f,_0x3244fe,_0x4da73c,_0x5493cd,_0x1c0c62,_0x29bc32));};AGIChannel[_0x602b('0x21')][_0x602b('0x40')]=function(_0x3456e4,_0x1aef28){_0x1aef28=_0x1aef28||'';return this['sendRequest'](util[_0x602b('0x26')](_0x602b('0x41'),_0x3456e4,_0x1aef28));};AGIChannel[_0x602b('0x21')]['agi']=function(_0x19d3bc){return this[_0x602b('0x2a')]('AGI',_0x19d3bc);};AGIChannel[_0x602b('0x21')]['wait']=function(_0xc9245){return this[_0x602b('0x2a')](_0x602b('0x42'),_0xc9245);};AGIChannel[_0x602b('0x21')][_0x602b('0x16')]=function(_0x440efb,_0xec0931){this[_0x602b('0x28')](util[_0x602b('0x26')](_0x602b('0x43'),_0x440efb['id'],_0x440efb[_0x602b('0x44')],_0xec0931));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x602b('0x45')]=AGIChannel;
\ No newline at end of file
+var _0xc16d=['write','prototype','sendRequest','command','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','result=','indexOf','substr','startsWith','length','match','error','close','E_AGI_SOCKET_TIMEOUT','destroy','pipe'];(function(_0x506caf,_0x36b437){var _0x3d74e7=function(_0x885ea7){while(--_0x885ea7){_0x506caf['push'](_0x506caf['shift']());}};_0x3d74e7(++_0x36b437);}(_0xc16d,0x145));var _0xdc16=function(_0x11c690,_0x32ea6b){_0x11c690=_0x11c690-0x0;var _0x19468e=_0xc16d[_0x11c690];return _0x19468e;};'use strict';var util=require(_0xdc16('0x0'));var _=require(_0xdc16('0x1'));var EventEmitter=require(_0xdc16('0x2'))[_0xdc16('0x3')];var AGIReply=require(_0xdc16('0x4'));var AGIError=require(_0xdc16('0x5'));function AGIChannel(_0x3a546a){var _0x5d9149=this,_0x5806fe=new AGIReply(),_0x1beaa1=![],_0x1da17e={};EventEmitter[_0xdc16('0x6')](_0x5d9149);_0x3a546a[_0xdc16('0x7')](_0xdc16('0x8'));_0x3a546a[_0xdc16('0x9')](0x8*0x3c*0x3c*0x3e8);_0x5806fe[_0xdc16('0x7')](_0xdc16('0x8'));_0x5806fe['on'](_0xdc16('0xa'),function(_0x25bde7){for(var _0xfc2bb3 in _0x25bde7){_0x5d9149[_0xfc2bb3]=_0x25bde7[_0xfc2bb3];}_0x5d9149[_0xdc16('0xb')](_0xdc16('0xc'));});_0x5806fe['on'](_0xdc16('0xd'),function(_0x430bdc){if(_0x430bdc['toLowerCase']()==_0xdc16('0xe')){_0x5d9149[_0xdc16('0xb')](_0xdc16('0xe'));return;}if(_0x430bdc[_0xdc16('0xf')](0x0,0xb)=='520-Invalid'){_0x1beaa1=!![];}if(_0x1beaa1){_0x1da17e['rx']+=_0x430bdc+'\x0a';if(_0x430bdc[_0xdc16('0x10')](_0xdc16('0x11'))!=-0x1){_0x1beaa1=![];}}else{_0x1da17e['rx']=_0x430bdc;}if(_0x1beaa1){return;}if(typeof _0x1da17e['cb']==_0xdc16('0x12')){var _0x1224c6=_0x1da17e['rx']['substring'](0x0,0x3),_0x5137db=null,_0x42ce38=null;_0x1224c6=parseInt(_0x1224c6);if(isNaN(_0x1224c6)){_0x1da17e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1224c6!=0xc8){_0x1da17e['cb'](null,{'code':_0x1224c6,'result':-0x1,'extra':'KO'});return;}_0x5137db=_0x1da17e['rx'][_0xdc16('0xf')](0x4)['replace'](_0xdc16('0x13'),'');if(_0x5137db[_0xdc16('0x14')]('\x20')!=-0x1){_0x5137db=_0x5137db[_0xdc16('0x15')](0x0,_0x5137db['indexOf']('\x20'));}if(_[_0xdc16('0x16')](_0x5137db,'-1')){_0x5137db=parseInt(_0x5137db);}_0x42ce38=_0x1da17e['rx']['split']('\x20');if(_0x42ce38[_0xdc16('0x17')]==0x3){_0x42ce38=_0x42ce38[0x2][_0xdc16('0xf')](0x1,_0x42ce38[0x2][_0xdc16('0x17')]-0x1);}else if(_0x42ce38[_0xdc16('0x17')]>0x3){var _0x4d6ec2=/\((.+)\)/;var _0x3742db=_0x1da17e['rx'][_0xdc16('0x18')](_0x4d6ec2);if(_0x3742db){_0x42ce38=_0x3742db[0x1];}else{_0x42ce38=null;}}else{_0x42ce38=null;}_0x1da17e['cb'](null,{'code':_0x1224c6,'result':_0x5137db,'extra':_0x42ce38});}});_0x3a546a['on']('error',function(_0x37b627){_0x5d9149[_0xdc16('0xb')](_0xdc16('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x37b627['code']));});_0x3a546a['on'](_0xdc16('0x1a'),function(){_0x5d9149[_0xdc16('0xb')](_0xdc16('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3a546a['on']('timeout',function(){_0x5d9149['emit']('timeout',new AGIError(_0xdc16('0x1b')));_0x3a546a[_0xdc16('0x1c')]();});_0x3a546a[_0xdc16('0x1d')](_0x5806fe);this['command']=function(_0x5a4141,_0x504c04){var _0x5a4141=_0x5a4141||'',_0x504c04=typeof _0x504c04==_0xdc16('0x12')?_0x504c04:new Function();_0x1da17e={'tx':_0x5a4141,'rx':'','cb':_0x504c04};_0x3a546a[_0xdc16('0x1e')](_0x5a4141+'\x0a');},this[_0xdc16('0x1a')]=function(){_0x3a546a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xdc16('0x1f')][_0xdc16('0x20')]=function(_0x44946c){return this[_0xdc16('0x21')]['sync'](this,_0x44946c);};AGIChannel['prototype']['answer']=function(){return this[_0xdc16('0x20')](_0xdc16('0x22'));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x23')]=function(_0x235f78,_0x38ab82,_0x19d40c){_0x235f78=_0x235f78===undefined?_0xdc16('0x24'):_0x235f78;_0x38ab82=_0x38ab82===undefined?'5':_0x38ab82;_0x19d40c=_0x19d40c===undefined?'1':_0x19d40c;return this['sendRequest'](util['format'](_0xdc16('0x25'),_0x235f78,_0x38ab82*0x3e8,_0x19d40c));};AGIChannel[_0xdc16('0x1f')]['noop']=function(_0x44f7b3){_0x44f7b3=_0x44f7b3||'NO\x20MESSAGE';return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x27'),_0x44f7b3));};AGIChannel['prototype'][_0xdc16('0x28')]=function(_0x50da0f,_0x224965){if(_['isArray'](_0x224965)){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x29'),_0x50da0f,_0x224965['join'](',')));}return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x29'),_0x50da0f,_0x224965));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x2a')]=function(_0x525615){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x2b'),_0x525615));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x2c')]=function(_0x536430){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x2d'),_0x536430));};AGIChannel['prototype'][_0xdc16('0x2e')]=function(_0x25498e){return this[_0xdc16('0x20')](util['format'](_0xdc16('0x2f'),_0x25498e));};AGIChannel['prototype'][_0xdc16('0xe')]=function(){return this[_0xdc16('0x20')](_0xdc16('0x30'));};AGIChannel['prototype']['setVariable']=function(_0x55cfb2,_0x4c258d){var _0x2ddfe7=_[_0xdc16('0x31')](_0x4c258d)||_[_0xdc16('0x32')](_0x4c258d)?_0x4c258d[_0xdc16('0x33')]():_0x4c258d;return this['sendRequest'](util[_0xdc16('0x26')](_0xdc16('0x34'),_0x55cfb2,_0x2ddfe7?_0x2ddfe7[_0xdc16('0x33')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xdc16('0x35')]=function(_0x568608,_0x974a74){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x36'),_0x568608,_0x974a74));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x37')]=function(_0x144f05,_0x599c2c){return this[_0xdc16('0x20')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x144f05,_0x599c2c));};AGIChannel[_0xdc16('0x1f')]['sayPhonetic']=function(_0x4f5e8a,_0x3135d1){return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x38'),_0x4f5e8a,_0x3135d1));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x39')]=function(_0xd26370,_0x550f7b,_0x27a901){_0x550f7b=_0x550f7b||this['extension'];_0x27a901=_0x27a901||0x1;this[_0xdc16('0x2a')](_0xd26370);this['setExtension'](_0x550f7b);this['setPriority'](_0x27a901);return this[_0xdc16('0x3a')](util[_0xdc16('0x26')](_0xdc16('0x3b'),_0xd26370,_0x550f7b,_0x27a901));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x3c')]=function(_0x2e8964){return this[_0xdc16('0x20')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2e8964));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x3d')]=function(_0x59326d,_0x44a063,_0x14f724,_0x36d7d8,_0xcf6818,_0x3c1b59){_0x44a063=_0x44a063||_0xdc16('0x3e');_0x14f724=_0x14f724||'';_0x36d7d8=_0x36d7d8===undefined?-0x1:_0x36d7d8==='-1'?-0x1:_0x36d7d8*0x3e8;_0xcf6818=_0xcf6818===undefined?'':'s='+_0xcf6818;_0x3c1b59=_0x3c1b59?_0xdc16('0x3f'):'';return this[_0xdc16('0x20')](util[_0xdc16('0x26')](_0xdc16('0x40'),_0x59326d,_0x44a063,_0x14f724,_0x36d7d8,_0x3c1b59,_0xcf6818));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x41')]=function(_0xa5e6c8,_0x4aa2dd){_0x4aa2dd=_0x4aa2dd||'';return this[_0xdc16('0x20')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xa5e6c8,_0x4aa2dd));};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x42')]=function(_0x16ca3d){return this[_0xdc16('0x28')](_0xdc16('0x43'),_0x16ca3d);};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x44')]=function(_0x3be11b){return this[_0xdc16('0x28')]('WAIT',_0x3be11b);};AGIChannel[_0xdc16('0x1f')][_0xdc16('0x19')]=function(_0x1e998d,_0x33f50e){this[_0xdc16('0x3a')](util[_0xdc16('0x26')](_0xdc16('0x45'),_0x1e998d['id'],_0x1e998d['label'],_0x33f50e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdc16('0x46')]=AGIChannel;
\ No newline at end of file
index 64096d5..41c422c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f5=['exports','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','push','format','apply','message','name'];(function(_0x58e6cf,_0x40ad7b){var _0x306170=function(_0x5d352){while(--_0x5d352){_0x58e6cf['push'](_0x58e6cf['shift']());}};_0x306170(++_0x40ad7b);}(_0xd4f5,0x181));var _0x5d4f=function(_0x3da3c4,_0x2b874d){_0x3da3c4=_0x3da3c4-0x0;var _0x36a3af=_0xd4f5[_0x3da3c4];return _0x36a3af;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5d4f('0x0'),'E_AGI_SERVER_MAXCONNECTION':_0x5d4f('0x1'),'E_AGI_SERVER_VOICE_DISABLED':_0x5d4f('0x2'),'E_AGI_SOCKET_ERROR':_0x5d4f('0x3'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x5d4f('0x4'),'E_AGI_COMMAND_EMPTY':_0x5d4f('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x472ef4){var _0x472ef4=_0x472ef4||null,_0x1b2f33=_0x1b2f33||[],_0x39a6ed=0x1,_0x144214='';if(!error[_0x472ef4]){_0x472ef4='E_AGI_UNDEFINED';}_0x1b2f33[_0x5d4f('0x6')](error[_0x472ef4]);while(arguments[_0x39a6ed]){_0x1b2f33['push'](arguments[_0x39a6ed]);_0x39a6ed++;}_0x144214=util[_0x5d4f('0x7')][_0x5d4f('0x8')](util,_0x1b2f33);this[_0x5d4f('0x9')]=_0x144214;this[_0x5d4f('0xa')]=_0x472ef4;}module[_0x5d4f('0xb')]=AGIError;
\ No newline at end of file
+var _0x4dbe=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.'];(function(_0x3d47d1,_0x15b566){var _0x30fa7c=function(_0x1fa970){while(--_0x1fa970){_0x3d47d1['push'](_0x3d47d1['shift']());}};_0x30fa7c(++_0x15b566);}(_0x4dbe,0x129));var _0xe4db=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4dbe[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xe4db('0x0'));var error={'E_AGI_UNDEFINED':_0xe4db('0x1'),'E_AGI_ARGUMENT_PORT':_0xe4db('0x2'),'E_AGI_SERVER_ERROR':_0xe4db('0x3'),'E_AGI_SERVER_CLOSE':_0xe4db('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xe4db('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xe4db('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xe4db('0x7'),'E_AGI_COMMAND_EMPTY':_0xe4db('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe4db('0x9'),'E_AGI_IVR_ENTRY':_0xe4db('0xa')};function AGIError(_0x318c92){var _0x318c92=_0x318c92||null,_0x18a744=_0x18a744||[],_0x4f9812=0x1,_0x3cf2d5='';if(!error[_0x318c92]){_0x318c92='E_AGI_UNDEFINED';}_0x18a744[_0xe4db('0xb')](error[_0x318c92]);while(arguments[_0x4f9812]){_0x18a744[_0xe4db('0xb')](arguments[_0x4f9812]);_0x4f9812++;}_0x3cf2d5=util[_0xe4db('0xc')]['apply'](util,_0x18a744);this[_0xe4db('0xd')]=_0x3cf2d5;this[_0xe4db('0xe')]=_0x318c92;}module[_0xe4db('0xf')]=AGIError;
\ No newline at end of file
index 60093ab..513f0b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6563=['size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','default','target','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex'];(function(_0x203d4c,_0x3b6a8b){var _0x34200e=function(_0x227662){while(--_0x227662){_0x203d4c['push'](_0x203d4c['shift']());}};_0x34200e(++_0x3b6a8b);}(_0x6563,0x12c));var _0x3656=function(_0x1d2ef2,_0x1a7599){_0x1d2ef2=_0x1d2ef2-0x0;var _0x345183=_0x6563[_0x1d2ef2];return _0x345183;};'use strict';var _=require('lodash');var logger=require(_0x3656('0x0'))('agi');var verticesWithRetry=['menu',_0x3656('0x1'),_0x3656('0x2')];var Graph=function(){this[_0x3656('0x3')]={};this[_0x3656('0x4')]={};this[_0x3656('0x5')]=0x0;};Graph[_0x3656('0x6')][_0x3656('0x7')]=function(_0x694279){this[_0x3656('0x3')][_0x694279['id']]=_0x694279;this[_0x3656('0x4')][_0x694279['id']]=[];};Graph[_0x3656('0x6')]['addEdge']=function(_0x46aaf5,_0x11ff11,_0x534fe4){this[_0x3656('0x4')][_0x46aaf5]['push']({'target':_0x11ff11,'condition':_0x534fe4});this[_0x3656('0x5')]+=0x1;};Graph[_0x3656('0x6')][_0x3656('0x8')]=function(){return _[_0x3656('0x8')](this[_0x3656('0x3')]);};Graph[_0x3656('0x6')][_0x3656('0x9')]=function(){return this[_0x3656('0x5')];};Graph['prototype']['getVertex']=function(_0x12a325){return this[_0x3656('0x3')][_0x12a325];};Graph[_0x3656('0x6')][_0x3656('0xa')]=function(_0x50491b,_0x11d772){if(!this['vertices'][_0x50491b]){return logger['info'](_0x3656('0xb'));}var _0xb456ac=_0x11d772(this[_0x3656('0x3')][_0x50491b]);if(!_0xb456ac){return logger[_0x3656('0xc')](_0x3656('0xd'));}if(this[_0x3656('0x4')][_0x50491b][_0x3656('0xe')]===0x0){return logger[_0x3656('0xc')](_0x3656('0xf'));}for(var _0x10be58=0x0,_0x20ed4b=[],_0x16edfd=![];_0x10be58<this['edges'][_0x50491b][_0x3656('0xe')];_0x10be58+=0x1){if(this[_0x3656('0x4')][_0x50491b][_0x10be58][_0x3656('0x10')]){_0x20ed4b=this[_0x3656('0x4')][_0x50491b][_0x10be58]['condition']['split'](',');for(var _0x50c4c8=0x0;_0x50c4c8<_0x20ed4b[_0x3656('0xe')];_0x50c4c8+=0x1){if(this[_0x3656('0x3')][_0x50491b][_0x3656('0x11')]===_0x3656('0x12')&&_0x20ed4b[_0x50c4c8]==='-'){_0x16edfd=this[_0x3656('0x4')][_0x50491b][_0x10be58]['target'];logger[_0x3656('0xc')](_0x3656('0x13'),_0x20ed4b[_0x50c4c8],this[_0x3656('0x4')][_0x50491b][_0x10be58][_0x3656('0x14')]);}else if(this[_0x3656('0x3')][_0x50491b][_0x3656('0x11')]===_0x3656('0x15')&&_0x20ed4b[_0x50c4c8]==='i'){_0x16edfd=this[_0x3656('0x4')][_0x50491b][_0x10be58][_0x3656('0x14')];logger[_0x3656('0xc')](_0x3656('0x16'),_0x20ed4b[_0x50c4c8],this[_0x3656('0x4')][_0x50491b][_0x10be58]['target']);}if(_0x20ed4b[_0x50c4c8]===_0xb456ac){return this[_0x3656('0xa')](this[_0x3656('0x4')][_0x50491b][_0x10be58][_0x3656('0x14')],_0x11d772);}}}else{return this['traverseBFS'](this['edges'][_0x50491b][_0x10be58]['target'],_0x11d772);}}if(_0x20ed4b[_0x3656('0xe')]){if(this[_0x3656('0x3')][_0x50491b][_0x3656('0x11')]===_0x3656('0x12')){if(_0x16edfd){return this['traverseBFS'](_0x16edfd,_0x11d772);}return logger[_0x3656('0xc')](_0x3656('0x17'));}else if(_[_0x3656('0x18')](verticesWithRetry,this[_0x3656('0x3')][_0x50491b][_0x3656('0x11')])){if(_0xb456ac==='-'){return logger[_0x3656('0xc')](_0x3656('0x19'));}if(_0x16edfd&&_0xb456ac!=='t'){return this[_0x3656('0xa')](_0x16edfd,_0x11d772);}return this[_0x3656('0xa')](_0x50491b,_0x11d772);}return logger[_0x3656('0xc')](_0x3656('0x1a'));}};module[_0x3656('0x1b')]=Graph;
\ No newline at end of file
+var _0xa7aa=['../../../config/logger','agi','menu','getdigits','vertices','prototype','edges','numberOfEdges','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','agicommand','condition\x20not\x20found'];(function(_0x3afec4,_0x4c1343){var _0x5a31d1=function(_0x2f7e39){while(--_0x2f7e39){_0x3afec4['push'](_0x3afec4['shift']());}};_0x5a31d1(++_0x4c1343);}(_0xa7aa,0x113));var _0xaa7a=function(_0x4ce533,_0x2d402e){_0x4ce533=_0x4ce533-0x0;var _0xb36f31=_0xa7aa[_0x4ce533];return _0xb36f31;};'use strict';var _=require('lodash');var logger=require(_0xaa7a('0x0'))(_0xaa7a('0x1'));var verticesWithRetry=[_0xaa7a('0x2'),_0xaa7a('0x3'),'getsecretdigits'];var Graph=function(){this[_0xaa7a('0x4')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0xaa7a('0x5')]['addVertex']=function(_0x393a7a){this[_0xaa7a('0x4')][_0x393a7a['id']]=_0x393a7a;this[_0xaa7a('0x6')][_0x393a7a['id']]=[];};Graph['prototype']['addEdge']=function(_0x1f54d4,_0x1f51e0,_0x279bda){this[_0xaa7a('0x6')][_0x1f54d4]['push']({'target':_0x1f51e0,'condition':_0x279bda});this[_0xaa7a('0x7')]+=0x1;};Graph[_0xaa7a('0x5')][_0xaa7a('0x8')]=function(){return _[_0xaa7a('0x8')](this[_0xaa7a('0x4')]);};Graph[_0xaa7a('0x5')][_0xaa7a('0x9')]=function(){return this[_0xaa7a('0x7')];};Graph[_0xaa7a('0x5')][_0xaa7a('0xa')]=function(_0x1be0d1){return this[_0xaa7a('0x4')][_0x1be0d1];};Graph[_0xaa7a('0x5')][_0xaa7a('0xb')]=function(_0x21eae4,_0x24c1f3){if(!this[_0xaa7a('0x4')][_0x21eae4]){return logger[_0xaa7a('0xc')]('no\x20vertex\x20found');}var _0xca8d57=_0x24c1f3(this[_0xaa7a('0x4')][_0x21eae4]);if(!_0xca8d57){return logger[_0xaa7a('0xc')](_0xaa7a('0xd'));}if(this[_0xaa7a('0x6')][_0x21eae4][_0xaa7a('0xe')]===0x0){return logger[_0xaa7a('0xc')](_0xaa7a('0xf'));}for(var _0x4283be=0x0,_0x92efb2=[],_0x4d26d9=![];_0x4283be<this['edges'][_0x21eae4][_0xaa7a('0xe')];_0x4283be+=0x1){if(this[_0xaa7a('0x6')][_0x21eae4][_0x4283be][_0xaa7a('0x10')]){_0x92efb2=this[_0xaa7a('0x6')][_0x21eae4][_0x4283be][_0xaa7a('0x10')][_0xaa7a('0x11')](',');for(var _0x5757f4=0x0;_0x5757f4<_0x92efb2['length'];_0x5757f4+=0x1){if(this[_0xaa7a('0x4')][_0x21eae4]['agicommand']===_0xaa7a('0x12')&&_0x92efb2[_0x5757f4]==='-'){_0x4d26d9=this['edges'][_0x21eae4][_0x4283be][_0xaa7a('0x13')];logger[_0xaa7a('0xc')](_0xaa7a('0x14'),_0x92efb2[_0x5757f4],this[_0xaa7a('0x6')][_0x21eae4][_0x4283be][_0xaa7a('0x13')]);}else if(this['vertices'][_0x21eae4]['agicommand']===_0xaa7a('0x2')&&_0x92efb2[_0x5757f4]==='i'){_0x4d26d9=this['edges'][_0x21eae4][_0x4283be]['target'];logger['info'](_0xaa7a('0x15'),_0x92efb2[_0x5757f4],this['edges'][_0x21eae4][_0x4283be][_0xaa7a('0x13')]);}if(_0x92efb2[_0x5757f4]===_0xca8d57){return this[_0xaa7a('0xb')](this[_0xaa7a('0x6')][_0x21eae4][_0x4283be][_0xaa7a('0x13')],_0x24c1f3);}}}else{return this[_0xaa7a('0xb')](this[_0xaa7a('0x6')][_0x21eae4][_0x4283be]['target'],_0x24c1f3);}}if(_0x92efb2[_0xaa7a('0xe')]){if(this['vertices'][_0x21eae4]['agicommand']===_0xaa7a('0x12')){if(_0x4d26d9){return this[_0xaa7a('0xb')](_0x4d26d9,_0x24c1f3);}return logger['info'](_0xaa7a('0x16'));}else if(_['includes'](verticesWithRetry,this[_0xaa7a('0x4')][_0x21eae4][_0xaa7a('0x17')])){if(_0xca8d57==='-'){return logger[_0xaa7a('0xc')]('max\x20retry\x20reach');}if(_0x4d26d9&&_0xca8d57!=='t'){return this[_0xaa7a('0xb')](_0x4d26d9,_0x24c1f3);}return this[_0xaa7a('0xb')](_0x21eae4,_0x24c1f3);}return logger[_0xaa7a('0xc')](_0xaa7a('0x18'));}};module['exports']=Graph;
\ No newline at end of file
index fc9900d..d5b800a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b28=['stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','value','then','catch','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','defaults','127.0.0.1','nextTick','error'];(function(_0x1cd440,_0x899dc1){var _0x4ff506=function(_0x1b2f29){while(--_0x1b2f29){_0x1cd440['push'](_0x1cd440['shift']());}};_0x4ff506(++_0x899dc1);}(_0x3b28,0x1be));var _0x83b2=function(_0x3513df,_0x29ddb7){_0x3513df=_0x3513df-0x0;var _0x3c3c7e=_0x3b28[_0x3513df];return _0x3c3c7e;};'use strict';var parser=require(_0x83b2('0x0'));var _=require(_0x83b2('0x1'));var syncho=require('syncho');var util=require(_0x83b2('0x2'));var moment=require(_0x83b2('0x3'));var config=require(_0x83b2('0x4'));var logger=require(_0x83b2('0x5'))(_0x83b2('0x6'));var utilLicense=require(_0x83b2('0x7'));var rpc=require(_0x83b2('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x83b2('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x83b2('0x6')]=_[_0x83b2('0xa')](config['agi'],{'ip':_0x83b2('0xb'),'port':0x11dd});function connectionHandler(_0x1775a7){process[_0x83b2('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1775a7);agiHandler(_0x1775a7);}catch(_0x5c76ca){logger[_0x83b2('0xd')](_0x5c76ca[_0x83b2('0xe')]);}});});}function listeningHandler(){console[_0x83b2('0xf')](_0x83b2('0x10'),config[_0x83b2('0x6')][_0x83b2('0x11')]);logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x14'),config[_0x83b2('0x6')]['ip'],config['agi'][_0x83b2('0x11')]));}function errorHandler(_0x55dfb1){if(_0x55dfb1&&_0x55dfb1[_0x83b2('0x15')]&&_0x55dfb1['message']){logger[_0x83b2('0xd')](util[_0x83b2('0x13')](_0x83b2('0x16'),_0x55dfb1['name'],_0x55dfb1[_0x83b2('0x17')]));}else{logger['error'](util[_0x83b2('0x13')](_0x83b2('0x18'),_0x55dfb1[_0x83b2('0xe')]));}}function closeHandler(){logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x19'),this[_0x83b2('0x1a')],this[_0x83b2('0x1b')],this[_0x83b2('0x1c')],this['dnid'],this[_0x83b2('0x1d')]));try{createSquareReport(this);}catch(_0x2726de){logger[_0x83b2('0xd')](_0x2726de['stack']);}}function timeoutHandler(){logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x1e'),this['arg_1'],this['calleridname'],this['callerid'],this[_0x83b2('0x1f')],this[_0x83b2('0x1d')]));}function hangupHandler(){logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x20'),this[_0x83b2('0x1a')],this[_0x83b2('0x1b')],this[_0x83b2('0x1c')],this[_0x83b2('0x1f')],this[_0x83b2('0x1d')]));this[_0x83b2('0x21')]=!![];}function getRoot(_0x56130c){return parser['toJson'](_0x56130c,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x5e8c83,_0x1fb78f,_0x442797){_0x1fb78f[_0x83b2('0x22')]=_0x442797;if(_0x1fb78f[_0x83b2('0x23')](_0x83b2('0x24'))){_0x1fb78f[_0x83b2('0x25')]=parseInt(_0x1fb78f['retry'],0xa);}_0x5e8c83[_0x83b2('0x26')](_[_0x83b2('0x27')](_0x1fb78f,_0x83b2('0x28')));}function initGraph(_0x4b7ff2,_0x546e1e){var _0x2a4fd0=new Graph();for(var _0x25c866 in _0x4b7ff2){if(_0x4b7ff2['hasOwnProperty'](_0x25c866)){if(_[_0x83b2('0x29')](_0x4b7ff2[_0x25c866])){for(var _0x33a559=0x0;_0x33a559<_0x4b7ff2[_0x25c866][_0x83b2('0x2a')];_0x33a559+=0x1){addVertex(_0x2a4fd0,_0x4b7ff2[_0x25c866][_0x33a559],_0x25c866);}}else{addVertex(_0x2a4fd0,_0x4b7ff2[_0x25c866],_0x25c866);}}}for(var _0x508ce0=0x0;_0x508ce0<_0x546e1e[_0x83b2('0x2a')];_0x508ce0+=0x1){if(_0x546e1e[_0x508ce0][_0x83b2('0x2b')]&&_0x546e1e[_0x508ce0]['target']){_0x2a4fd0['addEdge'](_0x546e1e[_0x508ce0][_0x83b2('0x2b')],_0x546e1e[_0x508ce0][_0x83b2('0x2c')],_0x546e1e[_0x508ce0][_0x83b2('0x2d')]);}}return _0x2a4fd0;}function getSquareProject(_0x12843a,_0x49cd13){rpc['getSquareProject'](_0x12843a)[_0x83b2('0x2e')](function(_0x39e01d){_0x49cd13(null,_0x39e01d);})['catch'](function(_0x4252d3){_0x49cd13(null,_0x4252d3);});}function createSquareReport(_0x2d7a35,_0x327624){rpc['createSquareReport'](_0x2d7a35)[_0x83b2('0x2e')](function(_0x85af1c){if(_0x327624){_0x327624(null,_0x85af1c);}})[_0x83b2('0x2f')](function(_0x1ff8ee){if(_0x327624){_0x327624(null,_0x1ff8ee);}});}function setChannelVariables(_0x283db5){for(var _0xa16403 in _0x283db5){if(_0x283db5[_0x83b2('0x23')](_0xa16403)){if(_0xa16403[_0x83b2('0x30')](_0x83b2('0x31'))===0x0){_0x283db5[_0xa16403[_0x83b2('0x32')](0x4)]=_0x283db5[_0xa16403];delete _0x283db5[_0xa16403];}}}}function getLogFromObject(_0x45a6bd){return util['inspect'](_0x45a6bd,{'showHidden':![],'depth':null});}function agiHandler(_0x4b6dde){var _0x5f1dcd,_0x5fc5b7,_0x112919,_0x386fe2,_0xbb4028;logger[_0x83b2('0x33')]('variables',JSON[_0x83b2('0x34')](_0x4b6dde,null,0x2));logger['info'](util[_0x83b2('0x13')](_0x83b2('0x35'),_0x4b6dde[_0x83b2('0x1a')],_0x4b6dde[_0x83b2('0x1b')],_0x4b6dde[_0x83b2('0x1c')],_0x4b6dde[_0x83b2('0x1f')],_0x4b6dde[_0x83b2('0x1d')]));_0x4b6dde['on'](_0x83b2('0xd'),errorHandler);_0x4b6dde['on'](_0x83b2('0x36'),closeHandler);_0x4b6dde['on']('timeout',timeoutHandler);_0x4b6dde[_0x83b2('0x21')]=![];_0x4b6dde['on'](_0x83b2('0x37'),hangupHandler);var _0x43aaca=getSquareProject[_0x83b2('0x38')](null,_0x4b6dde[_0x83b2('0x1a')]);if(_0x43aaca){if(_0x43aaca[_0x83b2('0x39')]){_0x5f1dcd=getRoot(_0x43aaca[_0x83b2('0x39')]);if(_0x5f1dcd&&_0x5f1dcd[_0x83b2('0x3a')]){logger['debug']('root',JSON['stringify'](_0x5f1dcd,null,0x2));_0x4b6dde[_0x83b2('0x3b')]=moment()[_0x83b2('0x13')](_0x83b2('0x3c'));_0x5fc5b7=initGraph(_[_0x83b2('0x27')](_0x5f1dcd,_0x83b2('0x28')),_0x5f1dcd[_0x83b2('0x28')]);_0x112919=new Vertices(_0x4b6dde,rpc,mailRpc);logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x3d'),_0x4b6dde['arg_1'],_0x4b6dde[_0x83b2('0x1b')],_0x4b6dde[_0x83b2('0x1c')],_0x4b6dde['dnid'],_0x4b6dde[_0x83b2('0x1d')]));_0x5fc5b7[_0x83b2('0x3e')](_0x5f1dcd[_0x83b2('0x3a')]['id'],function(_0x3d7ce3){try{_0x3d7ce3=_0x112919[_0x83b2('0x3f')](_0x3d7ce3);logger[_0x83b2('0x33')](_0x83b2('0x40'),JSON[_0x83b2('0x34')](_0x3d7ce3,null,0x2));if(_0x3d7ce3[_0x83b2('0x22')]===_0x83b2('0x41')){logger[_0x83b2('0x12')](_0x83b2('0x42'));_0x4b6dde[_0x83b2('0x43')]=_0x3d7ce3[_0x83b2('0x43')]||_0x4b6dde[_0x83b2('0x43')];_0x4b6dde[_0x83b2('0x44')]=_0x3d7ce3[_0x83b2('0x44')];_0x4b6dde['priority']=_0x3d7ce3[_0x83b2('0x45')]?_0x3d7ce3[_0x83b2('0x45')]-0x1:0x1;return null;}else if(_0x3d7ce3&&_0x112919[_0x3d7ce3[_0x83b2('0x22')]]){_0xbb4028=_0x112919[_0x3d7ce3['agicommand']](_0x3d7ce3);logger['info'](_0x83b2('0x46'),JSON[_0x83b2('0x34')](_0xbb4028,null,0x2));if(_0xbb4028&&_0xbb4028[_0x83b2('0x47')]===AGI_CODE_SUCCESS&&_0xbb4028[_0x83b2('0x48')]!==AGI_RESULT_ERROR&&!_0x4b6dde[_0x83b2('0x21')]){logger[_0x83b2('0x33')](_0x83b2('0x46'),getLogFromObject(_0xbb4028));return _[_0x83b2('0x49')](_0xbb4028[_0x83b2('0x48')])?null:_0xbb4028['result'][_0x83b2('0x4a')]();}else{logger[_0x83b2('0xd')]('response',getLogFromObject(_0xbb4028));return null;}}else{logger[_0x83b2('0xd')](_0x83b2('0x4b'));return null;}}catch(_0xa6cbf6){logger[_0x83b2('0xd')](_0xa6cbf6[_0x83b2('0xe')]);return null;}});if(_0x5f1dcd[_0x83b2('0x4c')]){logger['info'](util[_0x83b2('0x13')](_0x83b2('0x4d'),_0x4b6dde['arg_1'],_0x4b6dde[_0x83b2('0x1b')],_0x4b6dde[_0x83b2('0x1c')],_0x4b6dde[_0x83b2('0x1f')],_0x4b6dde[_0x83b2('0x1d')]));_0x5fc5b7[_0x83b2('0x3e')](_0x5f1dcd['finally']['id'],function(_0x57eb21){try{_0x57eb21=_0x112919[_0x83b2('0x3f')](_0x57eb21);logger[_0x83b2('0x33')](_0x83b2('0x40'),JSON[_0x83b2('0x34')](_0x57eb21,null,0x2));if(_0x57eb21&&_0x112919[_0x57eb21[_0x83b2('0x22')]]){_0xbb4028=_0x112919[_0x57eb21[_0x83b2('0x22')]](_0x57eb21);if(_0xbb4028){logger[_0x83b2('0x33')]('response',getLogFromObject(_0xbb4028));return _[_0x83b2('0x49')](_0xbb4028['result'])?null:_0xbb4028[_0x83b2('0x48')][_0x83b2('0x4a')]();}else{logger[_0x83b2('0xd')](_0x83b2('0x46'),getLogFromObject(_0xbb4028));return null;}}else{logger[_0x83b2('0xd')](_0x83b2('0x4b'));return null;}}catch(_0x15fa3b){logger[_0x83b2('0xd')](_0x15fa3b[_0x83b2('0xe')]);return null;}});}logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x4e'),_0x4b6dde[_0x83b2('0x1a')],_0x4b6dde['calleridname'],_0x4b6dde[_0x83b2('0x1c')],_0x4b6dde['dnid'],_0x4b6dde[_0x83b2('0x1d')]));logger[_0x83b2('0x12')](util[_0x83b2('0x13')](_0x83b2('0x4f'),_0x4b6dde[_0x83b2('0x43')],_0x4b6dde[_0x83b2('0x44')],parseInt(_0x4b6dde[_0x83b2('0x45')],0xa)+0x1));_0x4b6dde[_0x83b2('0x50')](_0x4b6dde[_0x83b2('0x43')],_0x4b6dde['extension'],parseInt(_0x4b6dde[_0x83b2('0x45')],0xa)+0x1);_0x4b6dde[_0x83b2('0x36')]();}}else{logger[_0x83b2('0xd')](util['format'](_0x83b2('0x51'),_0x4b6dde[_0x83b2('0x1a')]));_0x4b6dde[_0x83b2('0x50')](_0x4b6dde['context'],_0x4b6dde[_0x83b2('0x44')],parseInt(_0x4b6dde[_0x83b2('0x45')],0xa)+0x1);_0x4b6dde['close']();}}else{logger[_0x83b2('0xd')](util['format'](_0x83b2('0x52'),_0x4b6dde[_0x83b2('0x1a')]));_0x4b6dde['continueAt'](_0x4b6dde[_0x83b2('0x43')],_0x4b6dde['extension'],parseInt(_0x4b6dde['priority'],0xa)+0x1);_0x4b6dde[_0x83b2('0x36')]();}}function main(){var _0x4b2376;return utilLicense[_0x83b2('0x53')]()['then'](function(_0x30f57f){if(_0x30f57f){if(_0x30f57f[_0x83b2('0x54')]){if(_0x30f57f['callysquare']&&_0x30f57f[_0x83b2('0x55')]>0x0){logger[_0x83b2('0x12')](util['format'](_0x83b2('0x56'),_0x30f57f[_0x83b2('0x55')]));_0x4b2376=_0x30f57f[_0x83b2('0x55')];}else{logger['info'](_0x83b2('0x57'));}}else{logger[_0x83b2('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4b2376=-0x1;}}})[_0x83b2('0x2f')](function(_0x3e2e63){logger[_0x83b2('0xd')](_0x83b2('0x58'),_0x3e2e63[_0x83b2('0xe')]);})[_0x83b2('0x4c')](function(){var _0x1e2f9d=require(_0x83b2('0x59'))(config[_0x83b2('0x6')][_0x83b2('0x11')],config[_0x83b2('0x6')]['ip'],_0x4b2376);_0x1e2f9d['on']('error',errorHandler);_0x1e2f9d['on'](_0x83b2('0x5a'),listeningHandler);_0x1e2f9d['on'](_0x83b2('0x5b'),connectionHandler);_0x1e2f9d['on'](_0x83b2('0x36'),closeHandler);});}main();
\ No newline at end of file
+var _0xe5c7=['catch','createSquareReport','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','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','./server','listening','connection','xml2json','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then'];(function(_0x4a1542,_0x32bf77){var _0x432dfd=function(_0x40f323){while(--_0x40f323){_0x4a1542['push'](_0x4a1542['shift']());}};_0x432dfd(++_0x32bf77);}(_0xe5c7,0xec));var _0x7e5c=function(_0x5c1823,_0x5aed00){_0x5c1823=_0x5c1823-0x0;var _0x349687=_0xe5c7[_0x5c1823];return _0x349687;};'use strict';var parser=require(_0x7e5c('0x0'));var _=require('lodash');var syncho=require(_0x7e5c('0x1'));var util=require(_0x7e5c('0x2'));var moment=require(_0x7e5c('0x3'));var config=require('../../config/environment');var logger=require(_0x7e5c('0x4'))(_0x7e5c('0x5'));var utilLicense=require(_0x7e5c('0x6'));var rpc=require(_0x7e5c('0x7'));var mailRpc=require(_0x7e5c('0x8'));var Graph=require(_0x7e5c('0x9'));var Vertices=require(_0x7e5c('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x7e5c('0x5')],{'ip':_0x7e5c('0xb'),'port':0x11dd});function connectionHandler(_0xfbd846){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xfbd846);agiHandler(_0xfbd846);}catch(_0x27858c){logger[_0x7e5c('0xc')](_0x27858c[_0x7e5c('0xd')]);}});});}function listeningHandler(){console[_0x7e5c('0xe')](_0x7e5c('0xf'),config[_0x7e5c('0x5')]['port']);logger[_0x7e5c('0x10')](util[_0x7e5c('0x11')](_0x7e5c('0x12'),config['agi']['ip'],config[_0x7e5c('0x5')][_0x7e5c('0x13')]));}function errorHandler(_0x109a53){if(_0x109a53&&_0x109a53[_0x7e5c('0x14')]&&_0x109a53[_0x7e5c('0x15')]){logger[_0x7e5c('0xc')](util[_0x7e5c('0x11')](_0x7e5c('0x16'),_0x109a53[_0x7e5c('0x14')],_0x109a53['message']));}else{logger[_0x7e5c('0xc')](util[_0x7e5c('0x11')](_0x7e5c('0x17'),_0x109a53[_0x7e5c('0xd')]));}}function closeHandler(){logger[_0x7e5c('0x10')](util[_0x7e5c('0x11')](_0x7e5c('0x18'),this[_0x7e5c('0x19')],this[_0x7e5c('0x1a')],this['callerid'],this['dnid'],this[_0x7e5c('0x1b')]));try{createSquareReport(this);}catch(_0x1da121){logger[_0x7e5c('0xc')](_0x1da121['stack']);}}function timeoutHandler(){logger[_0x7e5c('0x10')](util['format'](_0x7e5c('0x1c'),this['arg_1'],this[_0x7e5c('0x1a')],this[_0x7e5c('0x1d')],this['dnid'],this[_0x7e5c('0x1b')]));}function hangupHandler(){logger[_0x7e5c('0x10')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7e5c('0x19')],this['calleridname'],this['callerid'],this['dnid'],this['uniqueid']));this[_0x7e5c('0x1e')]=!![];}function getRoot(_0x56bf4d){return parser[_0x7e5c('0x1f')](_0x56bf4d,{'object':!![]})[_0x7e5c('0x20')][_0x7e5c('0x21')];}function addVertex(_0x3a668f,_0x26f3ae,_0x347673){_0x26f3ae[_0x7e5c('0x22')]=_0x347673;if(_0x26f3ae[_0x7e5c('0x23')](_0x7e5c('0x24'))){_0x26f3ae[_0x7e5c('0x25')]=parseInt(_0x26f3ae[_0x7e5c('0x24')],0xa);}_0x3a668f[_0x7e5c('0x26')](_[_0x7e5c('0x27')](_0x26f3ae,_0x7e5c('0x28')));}function initGraph(_0x5eab1d,_0x20d33b){var _0x4e8a4e=new Graph();for(var _0x41b13b in _0x5eab1d){if(_0x5eab1d[_0x7e5c('0x23')](_0x41b13b)){if(_[_0x7e5c('0x29')](_0x5eab1d[_0x41b13b])){for(var _0x37b71b=0x0;_0x37b71b<_0x5eab1d[_0x41b13b][_0x7e5c('0x2a')];_0x37b71b+=0x1){addVertex(_0x4e8a4e,_0x5eab1d[_0x41b13b][_0x37b71b],_0x41b13b);}}else{addVertex(_0x4e8a4e,_0x5eab1d[_0x41b13b],_0x41b13b);}}}for(var _0x2a153e=0x0;_0x2a153e<_0x20d33b['length'];_0x2a153e+=0x1){if(_0x20d33b[_0x2a153e]['source']&&_0x20d33b[_0x2a153e][_0x7e5c('0x2b')]){_0x4e8a4e[_0x7e5c('0x2c')](_0x20d33b[_0x2a153e][_0x7e5c('0x2d')],_0x20d33b[_0x2a153e][_0x7e5c('0x2b')],_0x20d33b[_0x2a153e][_0x7e5c('0x2e')]);}}return _0x4e8a4e;}function getSquareProject(_0x2f3589,_0x9fb127){rpc[_0x7e5c('0x2f')](_0x2f3589)[_0x7e5c('0x30')](function(_0x9d79aa){_0x9fb127(null,_0x9d79aa);})[_0x7e5c('0x31')](function(_0x407124){_0x9fb127(null,_0x407124);});}function createSquareReport(_0x1ef7d9,_0x32792e){rpc[_0x7e5c('0x32')](_0x1ef7d9)[_0x7e5c('0x30')](function(_0x2df56d){if(_0x32792e){_0x32792e(null,_0x2df56d);}})[_0x7e5c('0x31')](function(_0x50b86d){if(_0x32792e){_0x32792e(null,_0x50b86d);}});}function setChannelVariables(_0xc500e8){for(var _0x18e3d3 in _0xc500e8){if(_0xc500e8['hasOwnProperty'](_0x18e3d3)){if(_0x18e3d3['indexOf'](_0x7e5c('0x33'))===0x0){_0xc500e8[_0x18e3d3['substring'](0x4)]=_0xc500e8[_0x18e3d3];delete _0xc500e8[_0x18e3d3];}}}}function getLogFromObject(_0x4f214e){return util[_0x7e5c('0x34')](_0x4f214e,{'showHidden':![],'depth':null});}function agiHandler(_0x136026){var _0x1810f5,_0x45f01c,_0x13d2db,_0x47bd29,_0x6eeec;logger[_0x7e5c('0x35')](_0x7e5c('0x36'),JSON[_0x7e5c('0x37')](_0x136026,null,0x2));logger[_0x7e5c('0x10')](util[_0x7e5c('0x11')](_0x7e5c('0x38'),_0x136026[_0x7e5c('0x19')],_0x136026[_0x7e5c('0x1a')],_0x136026[_0x7e5c('0x1d')],_0x136026['dnid'],_0x136026[_0x7e5c('0x1b')]));_0x136026['on']('error',errorHandler);_0x136026['on'](_0x7e5c('0x39'),closeHandler);_0x136026['on'](_0x7e5c('0x3a'),timeoutHandler);_0x136026[_0x7e5c('0x1e')]=![];_0x136026['on']('hangup',hangupHandler);var _0x39f1a5=getSquareProject[_0x7e5c('0x3b')](null,_0x136026[_0x7e5c('0x19')]);if(_0x39f1a5){if(_0x39f1a5['production']){_0x1810f5=getRoot(_0x39f1a5[_0x7e5c('0x3c')]);if(_0x1810f5&&_0x1810f5[_0x7e5c('0x3d')]){logger[_0x7e5c('0x35')](_0x7e5c('0x21'),JSON[_0x7e5c('0x37')](_0x1810f5,null,0x2));_0x136026[_0x7e5c('0x3e')]=moment()[_0x7e5c('0x11')](_0x7e5c('0x3f'));_0x45f01c=initGraph(_[_0x7e5c('0x27')](_0x1810f5,_0x7e5c('0x28')),_0x1810f5[_0x7e5c('0x28')]);_0x13d2db=new Vertices(_0x136026,rpc,mailRpc);logger[_0x7e5c('0x10')](util[_0x7e5c('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x136026['arg_1'],_0x136026[_0x7e5c('0x1a')],_0x136026[_0x7e5c('0x1d')],_0x136026['dnid'],_0x136026['uniqueid']));_0x45f01c[_0x7e5c('0x40')](_0x1810f5[_0x7e5c('0x3d')]['id'],function(_0x4e6911){try{_0x4e6911=_0x13d2db[_0x7e5c('0x41')](_0x4e6911);logger[_0x7e5c('0x35')](_0x7e5c('0x42'),JSON[_0x7e5c('0x37')](_0x4e6911,null,0x2));if(_0x4e6911[_0x7e5c('0x22')]===_0x7e5c('0x43')){logger[_0x7e5c('0x10')](_0x7e5c('0x44'));_0x136026[_0x7e5c('0x45')]=_0x4e6911[_0x7e5c('0x45')]||_0x136026[_0x7e5c('0x45')];_0x136026['extension']=_0x4e6911['extension'];_0x136026[_0x7e5c('0x46')]=_0x4e6911[_0x7e5c('0x46')]?_0x4e6911[_0x7e5c('0x46')]-0x1:0x1;return null;}else if(_0x4e6911&&_0x13d2db[_0x4e6911[_0x7e5c('0x22')]]){_0x6eeec=_0x13d2db[_0x4e6911[_0x7e5c('0x22')]](_0x4e6911);logger[_0x7e5c('0x10')](_0x7e5c('0x47'),JSON['stringify'](_0x6eeec,null,0x2));if(_0x6eeec&&_0x6eeec[_0x7e5c('0x48')]===AGI_CODE_SUCCESS&&_0x6eeec[_0x7e5c('0x49')]!==AGI_RESULT_ERROR&&!_0x136026[_0x7e5c('0x1e')]){logger['debug']('response',getLogFromObject(_0x6eeec));return _[_0x7e5c('0x4a')](_0x6eeec['result'])?null:_0x6eeec[_0x7e5c('0x49')][_0x7e5c('0x4b')]();}else{logger[_0x7e5c('0xc')]('response',getLogFromObject(_0x6eeec));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x2a4b3e){logger[_0x7e5c('0xc')](_0x2a4b3e[_0x7e5c('0xd')]);return null;}});if(_0x1810f5[_0x7e5c('0x4c')]){logger[_0x7e5c('0x10')](util['format'](_0x7e5c('0x4d'),_0x136026[_0x7e5c('0x19')],_0x136026[_0x7e5c('0x1a')],_0x136026[_0x7e5c('0x1d')],_0x136026[_0x7e5c('0x4e')],_0x136026[_0x7e5c('0x1b')]));_0x45f01c[_0x7e5c('0x40')](_0x1810f5[_0x7e5c('0x4c')]['id'],function(_0xed7145){try{_0xed7145=_0x13d2db[_0x7e5c('0x41')](_0xed7145);logger[_0x7e5c('0x35')](_0x7e5c('0x42'),JSON[_0x7e5c('0x37')](_0xed7145,null,0x2));if(_0xed7145&&_0x13d2db[_0xed7145[_0x7e5c('0x22')]]){_0x6eeec=_0x13d2db[_0xed7145[_0x7e5c('0x22')]](_0xed7145);if(_0x6eeec){logger[_0x7e5c('0x35')](_0x7e5c('0x47'),getLogFromObject(_0x6eeec));return _[_0x7e5c('0x4a')](_0x6eeec[_0x7e5c('0x49')])?null:_0x6eeec[_0x7e5c('0x49')]['toString']();}else{logger[_0x7e5c('0xc')]('response',getLogFromObject(_0x6eeec));return null;}}else{logger[_0x7e5c('0xc')](_0x7e5c('0x4f'));return null;}}catch(_0x4193b2){logger[_0x7e5c('0xc')](_0x4193b2['stack']);return null;}});}logger['info'](util[_0x7e5c('0x11')](_0x7e5c('0x50'),_0x136026['arg_1'],_0x136026[_0x7e5c('0x1a')],_0x136026[_0x7e5c('0x1d')],_0x136026[_0x7e5c('0x4e')],_0x136026['uniqueid']));logger['info'](util['format'](_0x7e5c('0x51'),_0x136026['context'],_0x136026[_0x7e5c('0x52')],parseInt(_0x136026[_0x7e5c('0x46')],0xa)+0x1));_0x136026[_0x7e5c('0x53')](_0x136026[_0x7e5c('0x45')],_0x136026[_0x7e5c('0x52')],parseInt(_0x136026[_0x7e5c('0x46')],0xa)+0x1);_0x136026[_0x7e5c('0x39')]();}}else{logger[_0x7e5c('0xc')](util[_0x7e5c('0x11')](_0x7e5c('0x54'),_0x136026[_0x7e5c('0x19')]));_0x136026[_0x7e5c('0x53')](_0x136026[_0x7e5c('0x45')],_0x136026[_0x7e5c('0x52')],parseInt(_0x136026[_0x7e5c('0x46')],0xa)+0x1);_0x136026[_0x7e5c('0x39')]();}}else{logger[_0x7e5c('0xc')](util[_0x7e5c('0x11')](_0x7e5c('0x55'),_0x136026[_0x7e5c('0x19')]));_0x136026[_0x7e5c('0x53')](_0x136026['context'],_0x136026[_0x7e5c('0x52')],parseInt(_0x136026[_0x7e5c('0x46')],0xa)+0x1);_0x136026[_0x7e5c('0x39')]();}}function main(){var _0x3c1548;return utilLicense[_0x7e5c('0x56')]()[_0x7e5c('0x30')](function(_0x1bd098){if(_0x1bd098){if(_0x1bd098[_0x7e5c('0x57')]){if(_0x1bd098[_0x7e5c('0x58')]&&_0x1bd098['callysquare']>0x0){logger[_0x7e5c('0x10')](util[_0x7e5c('0x11')](_0x7e5c('0x59'),_0x1bd098['callysquare']));_0x3c1548=_0x1bd098['callysquare'];}else{logger[_0x7e5c('0x10')](_0x7e5c('0x5a'));}}else{logger['info'](_0x7e5c('0x5b'));_0x3c1548=-0x1;}}})[_0x7e5c('0x31')](function(_0x26edde){logger[_0x7e5c('0xc')]('[LICENSE]',_0x26edde[_0x7e5c('0xd')]);})[_0x7e5c('0x4c')](function(){var _0x1b217e=require(_0x7e5c('0x5c'))(config[_0x7e5c('0x5')][_0x7e5c('0x13')],config[_0x7e5c('0x5')]['ip'],_0x3c1548);_0x1b217e['on'](_0x7e5c('0xc'),errorHandler);_0x1b217e['on'](_0x7e5c('0x5d'),listeningHandler);_0x1b217e['on'](_0x7e5c('0x5e'),connectionHandler);_0x1b217e['on'](_0x7e5c('0x39'),closeHandler);});}main();
\ No newline at end of file
index cf02322..cd1d37a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc584=['sendMailMessage','jayson/promise','http','error','catch'];(function(_0x44d0fc,_0x1dacfc){var _0x190fa8=function(_0x4a0891){while(--_0x4a0891){_0x44d0fc['push'](_0x44d0fc['shift']());}};_0x190fa8(++_0x1dacfc);}(_0xc584,0xb5));var _0x4c58=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0xc584[_0x3f477c];return _0x4c36b3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x4c58('0x0'));var client=jayson['client'][_0x4c58('0x1')]({'port':0x232b});function request(_0x56f3fa,_0x5c0405){return new BPromise(function(_0x1a4f81,_0x454ca4){return client['request'](_0x56f3fa,_0x5c0405)['then'](function(_0x260c48){if(_0x260c48[_0x4c58('0x2')]){return _0x454ca4(_0x260c48[_0x4c58('0x2')]['message']);}else{return _0x1a4f81(_0x260c48['result']);}})[_0x4c58('0x3')](function(_0x2de1ca){return _0x454ca4(_0x2de1ca);});});}exports[_0x4c58('0x4')]=function(_0x16da19,_0x4c5452){return request('SendMail',{'account':_0x16da19,'message':_0x4c5452});};
\ No newline at end of file
+var _0xa177=['then','error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client'];(function(_0x5ec57b,_0x51072b){var _0xe3051f=function(_0x3b1497){while(--_0x3b1497){_0x5ec57b['push'](_0x5ec57b['shift']());}};_0xe3051f(++_0x51072b);}(_0xa177,0x192));var _0x7a17=function(_0x5f3bac,_0x3a2131){_0x5f3bac=_0x5f3bac-0x0;var _0x1876c7=_0xa177[_0x5f3bac];return _0x1876c7;};'use strict';var BPromise=require(_0x7a17('0x0'));var jayson=require(_0x7a17('0x1'));var client=jayson[_0x7a17('0x2')]['http']({'port':0x232b});function request(_0x27c98d,_0x34f87f){return new BPromise(function(_0x4d8689,_0xd9aaf){return client['request'](_0x27c98d,_0x34f87f)[_0x7a17('0x3')](function(_0x435b8b){if(_0x435b8b[_0x7a17('0x4')]){return _0xd9aaf(_0x435b8b['error'][_0x7a17('0x5')]);}else{return _0x4d8689(_0x435b8b[_0x7a17('0x6')]);}})[_0x7a17('0x7')](function(_0x4b3da6){return _0xd9aaf(_0x4b3da6);});});}exports[_0x7a17('0x8')]=function(_0x1c70f9,_0x284648){return request('SendMail',{'account':_0x1c70f9,'message':_0x284648});};
\ No newline at end of file
index 8763267..fc62d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b48=['util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','headers','line','exports'];(function(_0x18c3ec,_0x4ed589){var _0x373ac9=function(_0xbd9935){while(--_0xbd9935){_0x18c3ec['push'](_0x18c3ec['shift']());}};_0x373ac9(++_0x4ed589);}(_0x4b48,0x190));var _0x84b4=function(_0x4df3f0,_0x49c85f){_0x4df3f0=_0x4df3f0-0x0;var _0x12ad2d=_0x4b48[_0x4df3f0];return _0x12ad2d;};'use strict';var util=require(_0x84b4('0x0'));var Transform=require(_0x84b4('0x1'))[_0x84b4('0x2')];function AGIReply(_0x2e4e98){Transform[_0x84b4('0x3')](this,_0x2e4e98);this[_0x84b4('0x4')]='';this[_0x84b4('0x5')]=![];}util[_0x84b4('0x6')](AGIReply,Transform);AGIReply[_0x84b4('0x7')][_0x84b4('0x8')]=function(_0x52391f,_0x1620c4,_0x39c5d5){var _0x1ae2b3='\x0a',_0x18f9fb=['\x0a\x0a',_0x84b4('0x9')],_0x2ae3e1=-0x1,_0x1da3a2=-0x1,_0x55027e='',_0x4b2fca=0x0,_0x574c11='',_0x50e5c4='';this['_localBuffer']+=_0x52391f[_0x84b4('0xa')]();_0x574c11=this[_0x84b4('0x4')];if(!this['_inBody']){_0x4b2fca=0x0;while(_0x18f9fb[_0x4b2fca]){while((_0x1da3a2=_0x574c11[_0x84b4('0xb')](_0x18f9fb[_0x4b2fca]))!=-0x1){_0x55027e=_0x18f9fb[_0x4b2fca];_0x50e5c4=_0x574c11[_0x84b4('0xc')](0x0,_0x1da3a2);_0x574c11=_0x574c11[_0x84b4('0xc')](_0x1da3a2+_0x55027e[_0x84b4('0xd')]);var _0x4ea347=_0x50e5c4['split'](_0x1ae2b3),_0x3bbc53=0x0,_0x4ae38c={},_0x3658b4='',_0x566bb7='',_0x111b15=-0x1;while(_0x4ea347[_0x3bbc53]){_0x111b15=_0x4ea347[_0x3bbc53][_0x84b4('0xb')](':');if(_0x111b15!=-0x1){_0x3658b4=_0x4ea347[_0x3bbc53][_0x84b4('0xe')](0x0,_0x111b15)['trim']();_0x566bb7=_0x4ea347[_0x3bbc53][_0x84b4('0xe')](_0x111b15+0x1)[_0x84b4('0xf')]();if(_0x3658b4[_0x84b4('0xd')]>0x0){_0x4ae38c[_0x3658b4]=_0x566bb7;}}else{}_0x3bbc53++;}this[_0x84b4('0x10')](_0x84b4('0x11'),_0x4ae38c);this[_0x84b4('0x5')]=!![];}_0x4b2fca++;}this[_0x84b4('0x4')]=_0x574c11;}else{while((_0x2ae3e1=_0x574c11[_0x84b4('0xb')](_0x1ae2b3))!=-0x1){_0x50e5c4=_0x574c11[_0x84b4('0xc')](0x0,_0x2ae3e1);this[_0x84b4('0x10')](_0x84b4('0x12'),_0x50e5c4);_0x574c11=_0x574c11[_0x84b4('0xc')](_0x2ae3e1+_0x1ae2b3[_0x84b4('0xd')]);}this[_0x84b4('0x4')]=_0x574c11;}_0x39c5d5();};module[_0x84b4('0x13')]=AGIReply;
\ No newline at end of file
+var _0x7211=['emit','headers','line','stream','Transform','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','split','trim','length'];(function(_0x592eea,_0x5be2ea){var _0x345017=function(_0x13fbca){while(--_0x13fbca){_0x592eea['push'](_0x592eea['shift']());}};_0x345017(++_0x5be2ea);}(_0x7211,0x123));var _0x1721=function(_0x1e5d1a,_0x23216f){_0x1e5d1a=_0x1e5d1a-0x0;var _0x1a164f=_0x7211[_0x1e5d1a];return _0x1a164f;};'use strict';var util=require('util');var Transform=require(_0x1721('0x0'))[_0x1721('0x1')];function AGIReply(_0x4f79ca){Transform['call'](this,_0x4f79ca);this['_localBuffer']='';this[_0x1721('0x2')]=![];}util[_0x1721('0x3')](AGIReply,Transform);AGIReply[_0x1721('0x4')][_0x1721('0x5')]=function(_0x1bc314,_0x24199f,_0x5555e1){var _0x25d5d9='\x0a',_0x2a2d36=['\x0a\x0a',_0x1721('0x6')],_0x4d46a9=-0x1,_0x35007f=-0x1,_0x334de9='',_0x2ab633=0x0,_0x49e6d8='',_0x3493d0='';this[_0x1721('0x7')]+=_0x1bc314['toString']();_0x49e6d8=this[_0x1721('0x7')];if(!this[_0x1721('0x2')]){_0x2ab633=0x0;while(_0x2a2d36[_0x2ab633]){while((_0x35007f=_0x49e6d8[_0x1721('0x8')](_0x2a2d36[_0x2ab633]))!=-0x1){_0x334de9=_0x2a2d36[_0x2ab633];_0x3493d0=_0x49e6d8[_0x1721('0x9')](0x0,_0x35007f);_0x49e6d8=_0x49e6d8[_0x1721('0x9')](_0x35007f+_0x334de9['length']);var _0x5d444b=_0x3493d0[_0x1721('0xa')](_0x25d5d9),_0x11c027=0x0,_0xd24d6e={},_0x1a75e2='',_0x1b23cb='',_0x1b3ca9=-0x1;while(_0x5d444b[_0x11c027]){_0x1b3ca9=_0x5d444b[_0x11c027][_0x1721('0x8')](':');if(_0x1b3ca9!=-0x1){_0x1a75e2=_0x5d444b[_0x11c027]['slice'](0x0,_0x1b3ca9)[_0x1721('0xb')]();_0x1b23cb=_0x5d444b[_0x11c027]['slice'](_0x1b3ca9+0x1)[_0x1721('0xb')]();if(_0x1a75e2[_0x1721('0xc')]>0x0){_0xd24d6e[_0x1a75e2]=_0x1b23cb;}}else{}_0x11c027++;}this[_0x1721('0xd')](_0x1721('0xe'),_0xd24d6e);this[_0x1721('0x2')]=!![];}_0x2ab633++;}this['_localBuffer']=_0x49e6d8;}else{while((_0x4d46a9=_0x49e6d8[_0x1721('0x8')](_0x25d5d9))!=-0x1){_0x3493d0=_0x49e6d8[_0x1721('0x9')](0x0,_0x4d46a9);this['emit'](_0x1721('0xf'),_0x3493d0);_0x49e6d8=_0x49e6d8[_0x1721('0x9')](_0x4d46a9+_0x25d5d9['length']);}this[_0x1721('0x7')]=_0x49e6d8;}_0x5555e1();};module['exports']=AGIReply;
\ No newline at end of file
index 02f14d4..0c6827c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6e=['ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','request','error','message','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','email','getSquareProjectById','name','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById'];(function(_0x3b0250,_0xd6df8f){var _0x3fbc7f=function(_0x389cdb){while(--_0x389cdb){_0x3b0250['push'](_0x3b0250['shift']());}};_0x3fbc7f(++_0xd6df8f);}(_0xdb6e,0x104));var _0xedb6=function(_0x20ee12,_0x3a4e68){_0x20ee12=_0x20ee12-0x0;var _0x2de947=_0xdb6e[_0x20ee12];return _0x2de947;};'use strict';var BPromise=require(_0xedb6('0x0'));var moment=require(_0xedb6('0x1'));var _=require(_0xedb6('0x2'));var util=require(_0xedb6('0x3'));var jayson=require(_0xedb6('0x4'));var client=jayson['client'][_0xedb6('0x5')]({'port':0x2329});function request(_0x52c6f6,_0x412e5f){return new BPromise(function(_0x1dbcd1,_0x45aa6b){return client[_0xedb6('0x6')](_0x52c6f6,_0x412e5f)['then'](function(_0x1110e5){if(_0x1110e5[_0xedb6('0x7')]){return _0x45aa6b(_0x1110e5[_0xedb6('0x7')][_0xedb6('0x8')]);}else{return _0x1dbcd1(_0x1110e5['result']);}})[_0xedb6('0x9')](function(_0x2294fd){return _0x45aa6b(_0x2294fd);});});}exports['getSquareProject']=function(_0xc93d37){return request(_0xedb6('0xa'),{'options':{'raw':![],'where':{'name':_0xc93d37},'attributes':[_0xedb6('0xb')]}});};exports[_0xedb6('0xc')]=function(_0x1c8423){return request(_0xedb6('0xd'),{'options':{'raw':![],'where':{'id':_0x1c8423},'include':[{'model':_0xedb6('0xe'),'as':'Smtp'}],'attributes':['id','name',_0xedb6('0xf')]}});};exports[_0xedb6('0x10')]=function(_0x4de1dd){return request(_0xedb6('0xa'),{'options':{'where':{'id':_0x4de1dd},'attributes':[_0xedb6('0x11')]}});};exports['getVoiceQueueById']=function(_0x4edc07){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4edc07},'attributes':[_0xedb6('0x11')]}});};exports[_0xedb6('0x12')]=function(_0x5b40df){return request('ShowVariable',{'options':{'where':{'id':_0x5b40df},'attributes':[_0xedb6('0x11')]}});};exports[_0xedb6('0x13')]=function(_0x3e69ec){return request(_0xedb6('0x14'),{'options':{'where':{'id':_0x3e69ec},'attributes':['dsn']}});};exports[_0xedb6('0x15')]=function(_0xeeaa52){return request(_0xedb6('0x16'),{'options':{'where':{'id':_0xeeaa52},'attributes':[_0xedb6('0x11')]}});};exports['getTrunkById']=function(_0x588fce){return request(_0xedb6('0x17'),{'options':{'where':{'id':_0x588fce},'attributes':[_0xedb6('0x11')]}});};exports[_0xedb6('0x18')]=function(_0x4f5453){return request(_0xedb6('0x19'),{'options':{'where':{'id':_0x4f5453},'attributes':['save_name']}});};exports[_0xedb6('0x1a')]=function(_0x1492b2){return request(_0xedb6('0x1b'),{'options':{'raw':![],'where':{'id':_0x1492b2},'include':[{'model':'Interval','as':_0xedb6('0x1c')}]}});};exports[_0xedb6('0x1d')]=function(_0x4cdae4){return request(_0xedb6('0x1e'),{'options':{'where':{'id':_0x4cdae4},'attributes':['id',_0xedb6('0x11')]}});};exports[_0xedb6('0x1f')]=function(_0x3ffa2f){return request('CreateSmsMessage',{'body':_0x3ffa2f});};exports[_0xedb6('0x20')]=function(_0x1bd077){return request(_0xedb6('0x21'),{'body':_0x1bd077});};exports[_0xedb6('0x22')]=function(_0x1518ad){return request(_0xedb6('0x23'),{'body':_['merge'](_0x1518ad,{'project_name':_0x1518ad[_0xedb6('0x24')],'prev_project_name':_0x1518ad[_0xedb6('0x25')]||'','is_subproject':_0x1518ad['arg_2']?!![]:![],'leaveAt':moment()[_0xedb6('0x26')](_0xedb6('0x27'))})});};exports['createSquareRecording']=function(_0x77d711){return request(_0xedb6('0x28'),{'body':_0x77d711});};exports[_0xedb6('0x29')]=function(_0x5b494b){return request(_0xedb6('0x2a'),{'body':_0x5b494b});};exports[_0xedb6('0x2b')]=function(_0x1f7dfc){return request(_0xedb6('0x2c'),{'options':{'raw':![],'where':{'phone':_0x1f7dfc[_0xedb6('0x2d')],'ListId':_0x1f7dfc[_0xedb6('0x2e')]}}})[_0xedb6('0x2f')](function(_0x4de78c){if(_0x4de78c){return _0x4de78c;}return request(_0xedb6('0x30'),{'body':_0x1f7dfc});});};exports[_0xedb6('0x31')]=function(_0x48b7e0){return request(_0xedb6('0x32'),{'options':{'where':{'id':_0x48b7e0},'attributes':[_0xedb6('0x11')]}});};exports[_0xedb6('0x33')]=function(_0x328f19,_0x8b6ab5){return request(_0xedb6('0x34'),{'body':{'interface':_0x8b6ab5},'options':{'where':_0x328f19}});};exports['agentPause']=function(_0x3467d1,_0x44b131,_0x5d2e37){return request(_0xedb6('0x35'),{'body':{'type':_0x44b131,'uniqueid':_0x5d2e37},'options':{'where':_0x3467d1}});};exports[_0xedb6('0x36')]=function(_0x79541c){return request(_0xedb6('0x37'),{'body':{},'options':{'where':_0x79541c}});};exports[_0xedb6('0x38')]=function(_0x2c939f){return request(_0xedb6('0x39'),{'body':{},'options':{'where':_0x2c939f}});};
\ No newline at end of file
+var _0xdb2e=['getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','util','jayson/promise','client','request','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb2e,0x14e));var _0xedb2=function(_0x514867,_0xbc5f43){_0x514867=_0x514867-0x0;var _0x3a1b64=_0xdb2e[_0x514867];return _0x3a1b64;};'use strict';var BPromise=require(_0xedb2('0x0'));var moment=require(_0xedb2('0x1'));var _=require('lodash');var util=require(_0xedb2('0x2'));var jayson=require(_0xedb2('0x3'));var client=jayson[_0xedb2('0x4')]['http']({'port':0x2329});function request(_0x28fff3,_0x447227){return new BPromise(function(_0x22668a,_0x5d935f){return client[_0xedb2('0x5')](_0x28fff3,_0x447227)['then'](function(_0x55f4f0){if(_0x55f4f0['error']){return _0x5d935f(_0x55f4f0[_0xedb2('0x6')][_0xedb2('0x7')]);}else{return _0x22668a(_0x55f4f0['result']);}})[_0xedb2('0x8')](function(_0x21d8d8){return _0x5d935f(_0x21d8d8);});});}exports[_0xedb2('0x9')]=function(_0x229bf4){return request(_0xedb2('0xa'),{'options':{'raw':![],'where':{'name':_0x229bf4},'attributes':[_0xedb2('0xb')]}});};exports[_0xedb2('0xc')]=function(_0x127d73){return request(_0xedb2('0xd'),{'options':{'raw':![],'where':{'id':_0x127d73},'include':[{'model':_0xedb2('0xe'),'as':_0xedb2('0xf')}],'attributes':['id',_0xedb2('0x10'),_0xedb2('0x11')]}});};exports['getSquareProjectById']=function(_0x38b373){return request(_0xedb2('0xa'),{'options':{'where':{'id':_0x38b373},'attributes':[_0xedb2('0x10')]}});};exports[_0xedb2('0x12')]=function(_0x545084){return request(_0xedb2('0x13'),{'options':{'where':{'id':_0x545084},'attributes':[_0xedb2('0x10')]}});};exports[_0xedb2('0x14')]=function(_0x49cb07){return request(_0xedb2('0x15'),{'options':{'where':{'id':_0x49cb07},'attributes':[_0xedb2('0x10')]}});};exports[_0xedb2('0x16')]=function(_0x1361c6){return request(_0xedb2('0x17'),{'options':{'where':{'id':_0x1361c6},'attributes':[_0xedb2('0x18')]}});};exports[_0xedb2('0x19')]=function(_0x4bb843){return request(_0xedb2('0x1a'),{'options':{'where':{'id':_0x4bb843},'attributes':[_0xedb2('0x10')]}});};exports[_0xedb2('0x1b')]=function(_0x1f5550){return request(_0xedb2('0x1c'),{'options':{'where':{'id':_0x1f5550},'attributes':['name']}});};exports[_0xedb2('0x1d')]=function(_0x1a7d37){return request('ShowSound',{'options':{'where':{'id':_0x1a7d37},'attributes':['save_name']}});};exports[_0xedb2('0x1e')]=function(_0x4a2563){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4a2563},'include':[{'model':_0xedb2('0x1f'),'as':_0xedb2('0x20')}]}});};exports[_0xedb2('0x21')]=function(_0x4da688){return request(_0xedb2('0x22'),{'options':{'where':{'id':_0x4da688},'attributes':['id',_0xedb2('0x10')]}});};exports[_0xedb2('0x23')]=function(_0x5641d9){return request('CreateSmsMessage',{'body':_0x5641d9});};exports[_0xedb2('0x24')]=function(_0x51bdda){return request(_0xedb2('0x25'),{'body':_0x51bdda});};exports['createSquareReport']=function(_0x4b920f){return request(_0xedb2('0x26'),{'body':_[_0xedb2('0x27')](_0x4b920f,{'project_name':_0x4b920f[_0xedb2('0x28')],'prev_project_name':_0x4b920f['arg_2']||'','is_subproject':_0x4b920f[_0xedb2('0x29')]?!![]:![],'leaveAt':moment()['format'](_0xedb2('0x2a'))})});};exports[_0xedb2('0x2b')]=function(_0x324638){return request(_0xedb2('0x2c'),{'body':_0x324638});};exports[_0xedb2('0x2d')]=function(_0x5871d0){return request(_0xedb2('0x2e'),{'body':_0x5871d0});};exports['createCmContact']=function(_0x492d3a){return request(_0xedb2('0x2f'),{'options':{'raw':![],'where':{'phone':_0x492d3a[_0xedb2('0x30')],'ListId':_0x492d3a[_0xedb2('0x31')]}}})[_0xedb2('0x32')](function(_0xfc4434){if(_0xfc4434){return _0xfc4434;}return request(_0xedb2('0x33'),{'body':_0x492d3a});});};exports[_0xedb2('0x34')]=function(_0x567395){return request(_0xedb2('0x35'),{'options':{'where':{'id':_0x567395},'attributes':[_0xedb2('0x10')]}});};exports[_0xedb2('0x36')]=function(_0x4830e8,_0x36e3cc){return request('LoginUser',{'body':{'interface':_0x36e3cc},'options':{'where':_0x4830e8}});};exports[_0xedb2('0x37')]=function(_0x4f02d1,_0x400d05,_0x475771){return request(_0xedb2('0x38'),{'body':{'type':_0x400d05,'uniqueid':_0x475771},'options':{'where':_0x4f02d1}});};exports[_0xedb2('0x39')]=function(_0x379822){return request('UnpauseUser',{'body':{},'options':{'where':_0x379822}});};exports[_0xedb2('0x3a')]=function(_0x5d570f){return request('LogoutUser',{'body':{},'options':{'where':_0x5d570f}});};
\ No newline at end of file
index b86c3fd..112c53c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfc=['exports','./lex'];(function(_0x2b8347,_0x14e3f2){var _0x15e93e=function(_0x2b046b){while(--_0x2b046b){_0x2b8347['push'](_0x2b8347['shift']());}};_0x15e93e(++_0x14e3f2);}(_0x6bfc,0x159));var _0xc6bf=function(_0x837202,_0x29fe2c){_0x837202=_0x837202-0x0;var _0x59cfb8=_0x6bfc[_0x837202];return _0x59cfb8;};var polly=require('./polly');var lex=require(_0xc6bf('0x0'));module[_0xc6bf('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x8458=['exports','./polly'];(function(_0xabbe89,_0x4dae9b){var _0x797c1a=function(_0x4a9f81){while(--_0x4a9f81){_0xabbe89['push'](_0xabbe89['shift']());}};_0x797c1a(++_0x4dae9b);}(_0x8458,0x1a5));var _0x8845=function(_0x362db4,_0x4c8c57){_0x362db4=_0x362db4-0x0;var _0x530dc3=_0x8458[_0x362db4];return _0x530dc3;};var polly=require(_0x8845('0x0'));var lex=require('./lex');module[_0x8845('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index e75ec60..a589c3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702d=['exports','./lib/api'];(function(_0x193f61,_0x229df6){var _0x5cb638=function(_0x3005ea){while(--_0x3005ea){_0x193f61['push'](_0x193f61['shift']());}};_0x5cb638(++_0x229df6);}(_0x702d,0x147));var _0xd702=function(_0x11f513,_0x2a79e9){_0x11f513=_0x11f513-0x0;var _0x4f1b8c=_0x702d[_0x11f513];return _0x4f1b8c;};'use strict';var lex=require(_0xd702('0x0'));module[_0xd702('0x1')]=function(_0x37c2c5,_0x33e7c5,_0x37ed5c,_0x5c2b9e,_0x20c11a,_0xebbd7c){return lex(_0x37c2c5,_0x33e7c5,_0x37ed5c,_0x5c2b9e,_0x20c11a,_0xebbd7c);};
\ No newline at end of file
+var _0x3c81=['./lib/api','exports'];(function(_0x1c2bdd,_0x25290a){var _0x2bcfdc=function(_0x4808c7){while(--_0x4808c7){_0x1c2bdd['push'](_0x1c2bdd['shift']());}};_0x2bcfdc(++_0x25290a);}(_0x3c81,0x102));var _0x13c8=function(_0x515d0d,_0x488679){_0x515d0d=_0x515d0d-0x0;var _0x2bff55=_0x3c81[_0x515d0d];return _0x2bff55;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);};
\ No newline at end of file
index 7a5b8b6..2859121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5c912a,_0x1d3ec8){var _0x170795=function(_0x4306b8){while(--_0x4306b8){_0x5c912a['push'](_0x5c912a['shift']());}};_0x170795(++_0x1d3ec8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x4bf1f9,_0x20ac48){var _0x88b50c=function(_0x3b8a7b){while(--_0x3b8a7b){_0x4bf1f9['push'](_0x4bf1f9['shift']());}};_0x88b50c(++_0x20ac48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 c62e36d..ead6a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecc1=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xecc1,0x12b));var _0x1ecc=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xecc1[_0x4327fe];return _0x138651;};'use strict';var polly=require('./lib/api');module[_0x1ecc('0x0')]=function(_0x2ebbf4,_0x127158,_0x2c302e,_0x552131,_0x31b068,_0x3b9429,_0x6622b8){return polly(_0x2ebbf4,_0x127158,_0x2c302e,_0x552131,_0x31b068,_0x3b9429,_0x6622b8);};
\ No newline at end of file
+var _0x67fe=['./lib/api','exports'];(function(_0x10aed5,_0x3b5e31){var _0x18c20d=function(_0x2dfb57){while(--_0x2dfb57){_0x10aed5['push'](_0x10aed5['shift']());}};_0x18c20d(++_0x3b5e31);}(_0x67fe,0xd2));var _0xe67f=function(_0x164da7,_0x448602){_0x164da7=_0x164da7-0x0;var _0x339a8b=_0x67fe[_0x164da7];return _0x339a8b;};'use strict';var polly=require(_0xe67f('0x0'));module[_0xe67f('0x1')]=function(_0x520183,_0x45a286,_0x797847,_0x4c3d97,_0x44a7e1,_0x36f3a0,_0x662234){return polly(_0x520183,_0x45a286,_0x797847,_0x4c3d97,_0x44a7e1,_0x36f3a0,_0x662234);};
\ No newline at end of file
index 5097430..f0fec5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd95f=['text','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x1c1716,_0x40a6fe){var _0x46653d=function(_0x5cb078){while(--_0x5cb078){_0x1c1716['push'](_0x1c1716['shift']());}};_0x46653d(++_0x40a6fe);}(_0xd95f,0x1d7));var _0xfd95=function(_0x4160fc,_0x585d2b){_0x4160fc=_0x4160fc-0x0;var _0x198b6a=_0xd95f[_0x4160fc];return _0x198b6a;};'use strict';var fs=require('fs');var path=require(_0xfd95('0x0'));var BPromise=require('bluebird');var rs=require(_0xfd95('0x1'));var AWS=require(_0xfd95('0x2'));function pollyResult(_0x1a6802,_0x97873f,_0xe4f8ce){return new BPromise(function(_0x19fa21,_0xa9a133){_0x1a6802[_0xfd95('0x3')](_0x97873f,function(_0x1af687,_0x31372e){if(_0x1af687){_0xa9a133(_0x1af687);}else if(_0x31372e){if(_0x31372e[_0xfd95('0x4')]instanceof Buffer){fs[_0xfd95('0x5')](_0xe4f8ce,_0x31372e[_0xfd95('0x4')],function(_0x32f1d0){if(_0x32f1d0){_0xa9a133(_0x32f1d0);}else{_0x19fa21();}});}else{_0xa9a133(new Error(_0xfd95('0x6')));}}else{_0xa9a133(new Error(_0xfd95('0x7')));}});});}module[_0xfd95('0x8')]=function(_0x4e4a7d,_0x6c09f0,_0x39ea14,_0x4dea75,_0x2f108c,_0x2a4833,_0x6327dc){var _0x22b33c=new AWS['Polly']({'accessKeyId':_0x4e4a7d,'secretAccessKey':_0x6c09f0,'region':_0x39ea14});var _0x1c3ef2={'Text':_0x2f108c,'TextType':_0x2a4833||_0xfd95('0x9'),'OutputFormat':'mp3','VoiceId':_0x4dea75};return pollyResult(_0x22b33c,_0x1c3ef2,_0x6327dc);};
\ No newline at end of file
+var _0x2780=['Polly','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x1152e5,_0x5a8eaf){var _0xd1fcdb=function(_0xabaa2b){while(--_0xabaa2b){_0x1152e5['push'](_0x1152e5['shift']());}};_0xd1fcdb(++_0x5a8eaf);}(_0x2780,0xc0));var _0x0278=function(_0x301868,_0x2dc8c9){_0x301868=_0x301868-0x0;var _0x228e30=_0x2780[_0x301868];return _0x228e30;};'use strict';var fs=require('fs');var path=require(_0x0278('0x0'));var BPromise=require(_0x0278('0x1'));var rs=require(_0x0278('0x2'));var AWS=require(_0x0278('0x3'));function pollyResult(_0x58c108,_0x443733,_0x1a5752){return new BPromise(function(_0x33126d,_0x296f8e){_0x58c108['synthesizeSpeech'](_0x443733,function(_0x49b478,_0x5ca743){if(_0x49b478){_0x296f8e(_0x49b478);}else if(_0x5ca743){if(_0x5ca743[_0x0278('0x4')]instanceof Buffer){fs[_0x0278('0x5')](_0x1a5752,_0x5ca743[_0x0278('0x4')],function(_0x5411b4){if(_0x5411b4){_0x296f8e(_0x5411b4);}else{_0x33126d();}});}else{_0x296f8e(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x296f8e(new Error(_0x0278('0x6')));}});});}module[_0x0278('0x7')]=function(_0x2463e7,_0x4b2bd6,_0x1354ab,_0x2fa818,_0x756e77,_0x2f4989,_0x71538d){var _0x131c76=new AWS[(_0x0278('0x8'))]({'accessKeyId':_0x2463e7,'secretAccessKey':_0x4b2bd6,'region':_0x1354ab});var _0x467cdd={'Text':_0x756e77,'TextType':_0x2f4989||'text','OutputFormat':_0x0278('0x9'),'VoiceId':_0x2fa818};return pollyResult(_0x131c76,_0x467cdd,_0x71538d);};
\ No newline at end of file
index c930a09..c2089ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa394=['exports','./lib/api'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0xa394,0x12b));var _0x4a39=function(_0x1fc0f9,_0xe9aaf){_0x1fc0f9=_0x1fc0f9-0x0;var _0x34caed=_0xa394[_0x1fc0f9];return _0x34caed;};'use strict';var asr=require(_0x4a39('0x0'));module[_0x4a39('0x1')]=function(_0x3ad166,_0x28f34d,_0x21049a,_0x1645d7){return asr(_0x3ad166,_0x28f34d,_0x21049a);};
\ No newline at end of file
+var _0x5705=['./lib/api','exports'];(function(_0x4b0907,_0x110b7c){var _0x212c12=function(_0xe8e96e){while(--_0xe8e96e){_0x4b0907['push'](_0x4b0907['shift']());}};_0x212c12(++_0x110b7c);}(_0x5705,0xfc));var _0x5570=function(_0x12c676,_0x4e075b){_0x12c676=_0x12c676-0x0;var _0x1d2c8d=_0x5705[_0x12c676];return _0x1d2c8d;};'use strict';var asr=require(_0x5570('0x0'));module[_0x5570('0x1')]=function(_0xc3f789,_0x5de0ea,_0x1867de,_0x34cf9b){return asr(_0xc3f789,_0x5de0ea,_0x1867de);};
\ No newline at end of file
index 7c92358..59d2f32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a9=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','https://speech.googleapis.com','exports','string'];(function(_0x3ebd7f,_0x1567e3){var _0x428414=function(_0x39fef3){while(--_0x39fef3){_0x3ebd7f['push'](_0x3ebd7f['shift']());}};_0x428414(++_0x1567e3);}(_0x18a9,0x15b));var _0x918a=function(_0x58370c,_0x396db6){_0x58370c=_0x58370c-0x0;var _0x1f086a=_0x18a9[_0x58370c];return _0x1f086a;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x918a('0x0');module[_0x918a('0x1')]=function(_0x218509,_0x2bd3b8,_0x256789){return new BPromise(function(_0x229e90,_0x3b9fbf){var _0x2a91aa;if(typeof _0x218509!==_0x918a('0x2')||_0x218509[_0x918a('0x3')]===0x0){return _0x3b9fbf(_0x918a('0x4'));}if(typeof _0x2bd3b8!==_0x918a('0x2')||_0x2bd3b8['length']===0x0){return _0x3b9fbf(_0x918a('0x5'));}if(typeof _0x256789!==_0x918a('0x6')&&(typeof _0x256789!=='string'||_0x256789[_0x918a('0x3')]===0x0)){return _0x3b9fbf(_0x918a('0x7'));}try{_0x2a91aa=fs[_0x918a('0x8')](_0x218509)[_0x918a('0x9')](_0x918a('0xa'));}catch(_0x465152){return _0x3b9fbf(_0x465152);}return _0x229e90({'method':_0x918a('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x2bd3b8,'body':{'config':{'encoding':_0x918a('0xc'),'sampleRateHertz':_0x918a('0xd'),'languageCode':_0x256789},'audio':{'content':_0x2a91aa}},'json':!![]});});};
\ No newline at end of file
+var _0x402f=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string'];(function(_0x30853f,_0x22f692){var _0xbd7f2=function(_0x51cb7e){while(--_0x51cb7e){_0x30853f['push'](_0x30853f['shift']());}};_0xbd7f2(++_0x22f692);}(_0x402f,0x6f));var _0xf402=function(_0x43e5de,_0x6f11ac){_0x43e5de=_0x43e5de-0x0;var _0x8e2414=_0x402f[_0x43e5de];return _0x8e2414;};'use strict';var url=require(_0xf402('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xf402('0x1');module['exports']=function(_0x588b83,_0x3ccbce,_0xe1847c){return new BPromise(function(_0x86f726,_0x4a52b8){var _0x246c5f;if(typeof _0x588b83!=='string'||_0x588b83[_0xf402('0x2')]===0x0){return _0x4a52b8(_0xf402('0x3'));}if(typeof _0x3ccbce!==_0xf402('0x4')||_0x3ccbce[_0xf402('0x2')]===0x0){return _0x4a52b8(_0xf402('0x5'));}if(typeof _0xe1847c!=='undefined'&&(typeof _0xe1847c!=='string'||_0xe1847c[_0xf402('0x2')]===0x0)){return _0x4a52b8(_0xf402('0x6'));}try{_0x246c5f=fs[_0xf402('0x7')](_0x588b83)[_0xf402('0x8')](_0xf402('0x9'));}catch(_0x298e44){return _0x4a52b8(_0x298e44);}return _0x86f726({'method':_0xf402('0xa'),'uri':host+_0xf402('0xb')+_0x3ccbce,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xf402('0xc'),'languageCode':_0xe1847c},'audio':{'content':_0x246c5f}},'json':!![]});});};
\ No newline at end of file
index af955cf..c60d1b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf41=['exports','./asr'];(function(_0x122ca8,_0x49391a){var _0x59ecd3=function(_0x327ac2){while(--_0x327ac2){_0x122ca8['push'](_0x122ca8['shift']());}};_0x59ecd3(++_0x49391a);}(_0xdf41,0x6d));var _0x1df4=function(_0xcfed91,_0x29b51b){_0xcfed91=_0xcfed91-0x0;var _0x42e245=_0xdf41[_0xcfed91];return _0x42e245;};var asr=require(_0x1df4('0x0'));module[_0x1df4('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xfb25=['exports','./asr'];(function(_0x2a0bf0,_0x247ffd){var _0x104fd6=function(_0x555e9b){while(--_0x555e9b){_0x2a0bf0['push'](_0x2a0bf0['shift']());}};_0x104fd6(++_0x247ffd);}(_0xfb25,0xc5));var _0x5fb2=function(_0x695769,_0x549ca4){_0x695769=_0x695769-0x0;var _0xd6b8f2=_0xfb25[_0x695769];return _0xd6b8f2;};var asr=require(_0x5fb2('0x0'));module[_0x5fb2('0x1')]={'asr':asr};
\ No newline at end of file
index ebac809..e224b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa680=['fulfillment','speech','score','endConversation','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','diagnosticInfo','queryResult','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','querystring','randomstring','url','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','finish','info','finish\x20download\x20file','unlink','pipe','end','host','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','text:synthesize','POST','.mp3','from','audioContent','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','result','source','resolvedQuery','action'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa680,0x1ac));var _0x0a68=function(_0x12fb95,_0xaa455c){_0x12fb95=_0x12fb95-0x0;var _0x4e9e78=_0xa680[_0x12fb95];return _0x4e9e78;};'use strict';var apiai=require(_0x0a68('0x0'));var BPromise=require(_0x0a68('0x1'));var dialogflow=require(_0x0a68('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x0a68('0x3'));var md5=require('md5');var path=require('path');var querystring=require(_0x0a68('0x4'));var rp=require('request-promise');var rs=require(_0x0a68('0x5'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x0a68('0x6'))['parse'];var util=require(_0x0a68('0x7'));var aws=require(_0x0a68('0x8'));var google=require(_0x0a68('0x9'));var sestek=require('./sestek');var tilde=require(_0x0a68('0xa'));var logger=require('../../../config/logger')(_0x0a68('0xb'));var ISPEECH_API=_0x0a68('0xc');function downloadFile(_0x95d50b,_0x41eb40){return new BPromise(function(_0x81e9f0,_0x1e24ac){var _0x5b90d7=urlParse(_0x95d50b);var _0x16eabb=_0x5b90d7[_0x0a68('0xd')]==='https:'?https:http;var _0x5f9845={'host':_0x5b90d7['host'],'path':_0x5b90d7[_0x0a68('0xe')],'headers':{'user-agent':_0x0a68('0xf')}};_0x16eabb[_0x0a68('0x10')](_0x5f9845,function(_0x49222a){if(_0x49222a[_0x0a68('0x11')]!==0xc8){logger[_0x0a68('0x12')](_0x0a68('0x13')+_0x95d50b+'\x20failed,\x20status\x20code\x20=\x20'+_0x49222a['statusCode']+'\x20('+_0x49222a['statusMessage']+')');_0x1e24ac(new Error(_0x0a68('0x13')+_0x95d50b+'\x20failed,\x20status\x20code\x20=\x20'+_0x49222a[_0x0a68('0x11')]+'\x20('+_0x49222a[_0x0a68('0x14')]+')'));return;}var _0x4c0a6d=fs['createWriteStream'](_0x41eb40);_0x4c0a6d['on'](_0x0a68('0x15'),function(){logger[_0x0a68('0x16')](_0x0a68('0x17'));_0x4c0a6d['close'](_0x81e9f0);});_0x4c0a6d['on'](_0x0a68('0x12'),function(_0x1642e5){fs[_0x0a68('0x18')](_0x41eb40);logger[_0x0a68('0x12')]('download\x20error',_0x1642e5);_0x1e24ac(_0x1642e5);});_0x49222a[_0x0a68('0x19')](_0x4c0a6d);})['on'](_0x0a68('0x12'),function(_0x410082){logger[_0x0a68('0x12')](_0x410082);_0x1e24ac(_0x410082);})[_0x0a68('0x1a')]();});}function uploadFile(_0x35ac08){return new BPromise(function(_0x31667d,_0x1bb178){var _0xe9eab=urlParse(_0x35ac08);var _0x1bbf12=_0xe9eab[_0x0a68('0xd')]==='https:'?https:http;var _0x3ed001={'host':_0xe9eab[_0x0a68('0x1b')],'path':_0xe9eab[_0x0a68('0xe')],'headers':{'user-agent':_0x0a68('0xf')}};_0x1bbf12[_0x0a68('0x10')](_0x3ed001,function(_0x2fd19e){if(_0x2fd19e[_0x0a68('0x11')]!==0xc8){_0x1bb178(new Error(_0x0a68('0x13')+_0x35ac08+'\x20failed,\x20status\x20code\x20=\x20'+_0x2fd19e[_0x0a68('0x11')]+'\x20('+_0x2fd19e[_0x0a68('0x14')]+')'));return;}var _0x4238f8='';_0x2fd19e['on'](_0x0a68('0x1c'),function(_0x12515e){_0x4238f8+=_0x12515e;});_0x2fd19e['on'](_0x0a68('0x1a'),function(){_0x31667d(_0x4238f8);});})['on']('error',function(_0x33ab99){_0x1bb178(_0x33ab99);})['end']();});}function convertFile(_0x4d5965,_0x145119){return new BPromise(function(_0x124963,_0x299cd9){var _0x34bd73=sox[_0x0a68('0x1d')](_0x4d5965,_0x145119,{'sampleRate':0x1f40,'format':_0x0a68('0x1e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34bd73['on'](_0x0a68('0x12'),function(_0x19c10b){logger['error'](_0x0a68('0x1f'),_0x19c10b);_0x299cd9(_0x19c10b);});_0x34bd73['on']('end',function(){logger[_0x0a68('0x16')](_0x0a68('0x20'));_0x124963();});_0x34bd73['start']();});}function base64Decode(_0x39c1d4,_0x140370){var _0x59f357=path[_0x0a68('0x21')](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+'.wav');fs[_0x0a68('0x24')](_0x59f357,_0x39c1d4,_0x0a68('0x25'));return convertFile(_0x59f357,_0x140370)[_0x0a68('0x26')](function(){try{fs[_0x0a68('0x18')](_0x59f357);fs[_0x0a68('0x27')](_0x140370,_0x0a68('0x28'));}catch(_0x6edf66){logger['error'](_0x6edf66);}return _0x140370['split']('.')[0x0];});}function base64Encode(_0x1b0e99){var _0x40cb1a=fs['readFileSync'](_0x1b0e99);return new Buffer(_0x40cb1a)[_0x0a68('0x29')](_0x0a68('0x25'));}exports[_0x0a68('0x2a')]=function(_0x367a48,_0x5a5287,_0x5411b3,_0x43dc3e,_0x2029e0,_0x5e3258){var _0x348e5d,_0x3f1a46;var _0x40229f=_0x0a68('0x2b');var _0x35a772=_0x0a68('0x2c')+_0x367a48;var _0x3bfb49={};if(_0x5a5287===_0x0a68('0x2d')){_0x3bfb49[_0x0a68('0x2e')]={'ssml':_0x5411b3};}else{_0x3bfb49[_0x0a68('0x2e')]={'text':_0x5411b3};};_0x3bfb49['voice']={'languageCode':_0x43dc3e,'ssmlGender':_0x2029e0};_0x3bfb49['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x842f79={'url':_0x40229f+_0x0a68('0x2f')+_0x35a772,'method':_0x0a68('0x30'),'json':!![],'body':_0x3bfb49};return rp(_0x842f79)[_0x0a68('0x26')](function(_0x187eba){return new BPromise(function(_0x539280,_0x4897de){_0x348e5d=path['resolve'](__dirname,_0x0a68('0x22'),rs['generate'](0x4)+_0x0a68('0x31'));var _0x5760e6=Buffer[_0x0a68('0x32')](_0x187eba[_0x0a68('0x33')],_0x0a68('0x25'));return fs['writeFile'](_0x348e5d,_0x5760e6,function(_0x1cb4f2){_0x4897de(_0x1cb4f2);},function(_0x568143){fs['chmodSync'](_0x348e5d,'777');_0x539280(_0x568143);});});})['then'](function(_0x4de391){_0x3f1a46=path[_0x0a68('0x21')](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+'.wav');return convertFile(_0x348e5d,_0x3f1a46);})[_0x0a68('0x26')](function(){try{fs[_0x0a68('0x18')](_0x348e5d);fs[_0x0a68('0x27')](_0x3f1a46,'777');}catch(_0x446f21){logger[_0x0a68('0x12')](_0x446f21);}logger[_0x0a68('0x16')]('googleCloudTTS\x20path',_0x3f1a46['split']('.')[0x0]);return _0x3f1a46[_0x0a68('0x34')]('.')[0x0];});};exports[_0x0a68('0x35')]=function(_0x3bdd91,_0x40e810){var _0x291ba0=_0x0a68('0x36');var _0x3e0089,_0x583b86;var _0x414b30;var _0x2f0a0f={'encoding':_0x0a68('0x37'),'method':_0x0a68('0x30'),'timeout':0x2710,'url':_0x291ba0,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x0a68('0x38')+encodeURIComponent(JSON[_0x0a68('0x39')]([[['jQ1olc',JSON[_0x0a68('0x39')]([_0x3bdd91,_0x40e810||'en',![],_0x0a68('0x3a')]),null,_0x0a68('0x3b')]]]))};return rp(_0x2f0a0f)[_0x0a68('0x26')](function(_0x236290){try{_0x414b30=eval(_0x236290[_0x0a68('0x3c')](0x5))[0x0][0x2];}catch(_0x151c2d){throw new Error(_0x0a68('0x3d')+_0x236290[_0x0a68('0x1c')]);}if(!_0x414b30){if(_0x3bdd91[_0x0a68('0x3e')]>0xc8){throw new Error(_0x0a68('0x3f'));}else{throw new Error('lang\x20\x22'+_0x40e810+_0x0a68('0x40'));}}try{_0x414b30=eval(_0x414b30)[0x0];}catch(_0x23091f){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x1391c8=_0x414b30;_0x3e0089=path['resolve'](__dirname,_0x0a68('0x22'),rs['generate'](0x4)+_0x0a68('0x31'));fs[_0x0a68('0x24')](_0x3e0089,_0x414b30,{'encoding':'base64'});_0x583b86=path['resolve'](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+_0x0a68('0x41'));return convertFile(_0x3e0089,_0x583b86);})[_0x0a68('0x26')](function(){try{fs[_0x0a68('0x18')](_0x3e0089);fs[_0x0a68('0x27')](_0x583b86,'777');}catch(_0x4ac130){logger[_0x0a68('0x12')](_0x4ac130);}logger[_0x0a68('0x16')](_0x0a68('0x42'),_0x583b86[_0x0a68('0x34')]('.')[0x0]);return _0x583b86[_0x0a68('0x34')]('.')[0x0];});};exports[_0x0a68('0x43')]=function(_0x5a96a5,_0x1b7c1c,_0x4ec507){return google[_0x0a68('0x44')](_0x5a96a5,_0x1b7c1c,_0x4ec507)[_0x0a68('0x26')](function(_0x128332){logger[_0x0a68('0x16')](_0x128332[_0x0a68('0x45')]);return rp(_0x128332);})[_0x0a68('0x26')](function(_0x7e764b){var _0x333f61='';var _0x499f9d=0x0;try{fs[_0x0a68('0x18')](_0x5a96a5);}catch(_0x158bd4){logger[_0x0a68('0x12')](_0x158bd4);}if(_0x7e764b&&_0x7e764b['results']){_0x333f61=_0x7e764b[_0x0a68('0x46')][_0x0a68('0x47')](function(_0xdc4cfc){return _0xdc4cfc&&_0xdc4cfc['alternatives'][0x0]&&_0xdc4cfc[_0x0a68('0x48')][0x0][_0x0a68('0x49')]?_0xdc4cfc[_0x0a68('0x48')][0x0][_0x0a68('0x49')]:'';})[_0x0a68('0x4a')]('\x0a');_0x499f9d=_0x7e764b['results'][_0x0a68('0x47')](function(_0x1c1bd2){return _0x1c1bd2&&_0x1c1bd2[_0x0a68('0x48')][0x0]&&_0x1c1bd2[_0x0a68('0x48')][0x0]['confidence']?_0x1c1bd2[_0x0a68('0x48')][0x0][_0x0a68('0x4b')]:0x0;})[_0x0a68('0x4a')]('\x0a');}logger[_0x0a68('0x16')](_0x0a68('0x4c'),_0x333f61);logger[_0x0a68('0x16')](_0x0a68('0x4d'),_0x499f9d);return{'transcript':_0x333f61,'confidence':_0x499f9d};})[_0x0a68('0x4e')](function(_0x355048){logger[_0x0a68('0x12')]('[%s]\x20%s:%s',_0x355048[_0x0a68('0x11')],_0x355048['name'],_0x355048[_0x0a68('0x4f')]);});};exports['googleDialogflow']=function(_0x5cc732,_0x52e799,_0x36a18a,_0x41cae3){var _0x1342ec=apiai(_0x52e799,{'language':_0x41cae3||'en'});return _0x1342ec['textRequest'](_0x36a18a,{'sessionId':md5(_0x5cc732)})[_0x0a68('0x26')](function(_0x34de64){logger[_0x0a68('0x16')](JSON[_0x0a68('0x39')](_0x34de64));return{'source':_0x34de64[_0x0a68('0x50')][_0x0a68('0x51')],'resolvedQuery':_0x34de64['result'][_0x0a68('0x52')],'action':_0x34de64[_0x0a68('0x50')][_0x0a68('0x53')],'actionIncomplete':_0x34de64[_0x0a68('0x50')]['actionIncomplete'],'speech':_0x34de64[_0x0a68('0x50')][_0x0a68('0x54')][_0x0a68('0x55')],'score':_0x34de64[_0x0a68('0x50')][_0x0a68('0x56')],'statusCode':_0x34de64['status']['code'],'endConversation':_0x34de64[_0x0a68('0x50')]['metadata'][_0x0a68('0x57')]||![],'isFallbackIntent':_0x34de64[_0x0a68('0x50')][_0x0a68('0x58')][_0x0a68('0x59')]};});};exports[_0x0a68('0x5a')]=function(_0x3f5e2d,_0x3b1ce3,_0x3e2c6e,_0x388cbb,_0x82c259,_0x2008f7){var _0x365bb7=_0x388cbb['replace'](/\\n/g,'\x0a');var _0x1f1a51={'credentials':{'private_key':_0x365bb7,'client_email':_0x3e2c6e}};var _0x1ca5c5=new dialogflow[(_0x0a68('0x5b'))](_0x1f1a51);var _0x35cf5d=_0x1ca5c5[_0x0a68('0x5c')](_0x3b1ce3,md5(_0x3f5e2d));var _0x261f08={'session':_0x35cf5d,'queryInput':{'text':{'text':_0x82c259,'languageCode':_0x2008f7}}};return _0x1ca5c5[_0x0a68('0x5d')](_0x261f08)[_0x0a68('0x26')](function(_0x1cb5b0){if(_0x1cb5b0&&_0x1cb5b0[_0x0a68('0x3e')]){logger['info'](_0x0a68('0x5e'),JSON[_0x0a68('0x39')](_0x1cb5b0));var _0x15ef3e=_0x1cb5b0[0x0];if(_0x15ef3e){var _0x563d5c={'action':_0x15ef3e['queryResult']['action'],'allRequiredParamsPresent':_0x15ef3e['queryResult'][_0x0a68('0x5f')],'endConversation':_0x15ef3e['queryResult'][_0x0a68('0x60')]&&_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x60')][_0x0a68('0x62')]?_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x60')][_0x0a68('0x62')][_0x0a68('0x63')][_0x0a68('0x64')]:![],'fulfillmentText':_0x15ef3e['queryResult'][_0x0a68('0x65')],'intentName':_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x66')]['name'],'intentDisplayName':_0x15ef3e[_0x0a68('0x61')]['intent'][_0x0a68('0x67')],'isFallbackIntent':_0x15ef3e[_0x0a68('0x61')]['intent'][_0x0a68('0x68')],'languageCode':_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x69')],'queryText':_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x6a')],'responseId':_0x15ef3e[_0x0a68('0x6b')],'score':_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x6c')],'speech':_0x15ef3e[_0x0a68('0x61')][_0x0a68('0x65')],'providerResponse':JSON[_0x0a68('0x39')](_0x1cb5b0)};return _0x563d5c;}}});};exports['tildeASR']=function(_0x4617f2,_0x21ba2d,_0x4dffc7,_0x51975e){return tilde[_0x0a68('0x44')](_0x4617f2,_0x21ba2d,_0x4dffc7,_0x51975e)[_0x0a68('0x26')](function(_0x446e7f){try{fs[_0x0a68('0x18')](_0x4617f2);}catch(_0x5a5b25){logger[_0x0a68('0x12')](_0x5a5b25);}logger[_0x0a68('0x16')](_0x0a68('0x6d'),_0x446e7f[_0x0a68('0x49')]);logger[_0x0a68('0x16')](_0x0a68('0x6e'),_0x446e7f['confidence']);return _0x446e7f;});};exports['awsPolly']=function(_0x4c9590,_0x20907d,_0x4881d7,_0x390041,_0x54ae9f,_0xd83a44){var _0x1e5d59=path[_0x0a68('0x21')](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+_0x0a68('0x31'));var _0x588107;return aws[_0x0a68('0x6f')](_0x4c9590,_0x20907d,_0x4881d7,_0x390041,_0x54ae9f,_0xd83a44,_0x1e5d59)[_0x0a68('0x26')](function(){_0x588107=path[_0x0a68('0x21')](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+_0x0a68('0x41'));return convertFile(_0x1e5d59,_0x588107);})[_0x0a68('0x26')](function(){try{fs[_0x0a68('0x18')](_0x1e5d59);fs['chmodSync'](_0x588107,_0x0a68('0x28'));}catch(_0x573ebd){logger['error'](_0x573ebd);}return _0x588107[_0x0a68('0x34')]('.')[0x0];});};exports[_0x0a68('0x70')]=function(_0x33d78d,_0x106684,_0x4f70c1,_0x141e9f,_0x558c2d,_0x2fbf44){return aws[_0x0a68('0x71')](_0x33d78d,_0x106684,_0x4f70c1,_0x141e9f,_0x558c2d,_0x2fbf44)[_0x0a68('0x26')](function(_0xbde701){logger['info'](JSON[_0x0a68('0x39')](_0xbde701));return _0xbde701;});};exports['ispeechTTS']=function(_0x34f73e,_0x5c8b8f,_0x1bd42f,_0x5c9dbf){var _0x133087=util[_0x0a68('0x72')](_0x0a68('0x73'),ISPEECH_API,_0x34f73e,encodeURIComponent(_0x5c8b8f),_0x1bd42f,_0x5c9dbf);var _0x145043=path['resolve'](__dirname,_0x0a68('0x22'),rs[_0x0a68('0x23')](0x4)+_0x0a68('0x31'));var _0x37dd45;return downloadFile(_0x133087,_0x145043)[_0x0a68('0x26')](function(){_0x37dd45=path[_0x0a68('0x21')](__dirname,'tmp',rs[_0x0a68('0x23')](0x4)+_0x0a68('0x41'));return convertFile(_0x145043,_0x37dd45);})['then'](function(){try{fs[_0x0a68('0x18')](_0x145043);fs[_0x0a68('0x27')](_0x37dd45,_0x0a68('0x28'));}catch(_0x429e0b){logger[_0x0a68('0x12')](_0x429e0b);}return _0x37dd45[_0x0a68('0x34')]('.')[0x0];});};exports[_0x0a68('0x74')]=function(_0x139a10,_0xe34f5b,_0x1dddc0,_0x4f840c){var _0x42e1b1=util[_0x0a68('0x72')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xe34f5b,_0x1dddc0,base64Encode(_0x139a10),_0x4f840c?util[_0x0a68('0x72')](_0x0a68('0x75'),encodeURIComponent(_0x4f840c)):_0x0a68('0x76'));return uploadFile(_0x42e1b1)['then'](function(_0x3b397d){return querystring['parse'](_0x3b397d);});};exports[_0x0a68('0x77')]=function(_0x3a3edb,_0x332fa1){return sestek[_0x0a68('0x78')](_0x3a3edb,_0x332fa1)[_0x0a68('0x26')](function(_0x312be5){logger[_0x0a68('0x16')](JSON[_0x0a68('0x39')](_0x312be5));var _0x1a78eb={'speech':_0x312be5[_0x0a68('0x79')],'action':_0x312be5[_0x0a68('0x7a')]?_0x312be5[_0x0a68('0x7a')][_0x0a68('0x7b')]:undefined,'actiondata':_0x312be5[_0x0a68('0x7a')]?_0x312be5[_0x0a68('0x7a')][_0x0a68('0x7c')]:undefined};if(_0x312be5[_0x0a68('0x7a')]&&_0x312be5[_0x0a68('0x7a')]['AudioFromTts']){return base64Decode(_0x312be5[_0x0a68('0x7a')][_0x0a68('0x7d')]['Data'],path['resolve'](__dirname,'tmp',rs[_0x0a68('0x23')](0x4)+_0x0a68('0x41')))[_0x0a68('0x26')](function(_0x174ef7){_0x1a78eb[_0x0a68('0x7e')]=_0x174ef7;return _0x1a78eb;});}return _0x1a78eb;});};exports[_0x0a68('0x7f')]=function(){return __dirname;};
\ No newline at end of file
+var _0x3e36=['unlink','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','tmp','writeFileSync','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','pipe','end','get','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile'];(function(_0x4b0846,_0x3d5e42){var _0xc99334=function(_0x843f5a){while(--_0x843f5a){_0x4b0846['push'](_0x4b0846['shift']());}};_0xc99334(++_0x3d5e42);}(_0x3e36,0x17a));var _0x63e3=function(_0x4c5c5a,_0x59abd6){_0x4c5c5a=_0x4c5c5a-0x0;var _0xb97667=_0x3e36[_0x4c5c5a];return _0xb97667;};'use strict';var apiai=require(_0x63e3('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x63e3('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x63e3('0x2'));var md5=require(_0x63e3('0x3'));var path=require(_0x63e3('0x4'));var querystring=require('querystring');var rp=require(_0x63e3('0x5'));var rs=require(_0x63e3('0x6'));var sox=require(_0x63e3('0x7'));var tts=require(_0x63e3('0x8'));var urlParse=require(_0x63e3('0x9'))[_0x63e3('0xa')];var util=require(_0x63e3('0xb'));var aws=require('./aws');var google=require(_0x63e3('0xc'));var sestek=require('./sestek');var tilde=require(_0x63e3('0xd'));var logger=require(_0x63e3('0xe'))(_0x63e3('0xf'));var ISPEECH_API=_0x63e3('0x10');function downloadFile(_0x419c10,_0x40d36c){return new BPromise(function(_0x1f81d0,_0x24d678){var _0x387e02=urlParse(_0x419c10);var _0x5a13fa=_0x387e02[_0x63e3('0x11')]===_0x63e3('0x12')?https:http;var _0x356025={'host':_0x387e02[_0x63e3('0x13')],'path':_0x387e02['path'],'headers':{'user-agent':_0x63e3('0x14')}};_0x5a13fa['get'](_0x356025,function(_0xde84df){if(_0xde84df[_0x63e3('0x15')]!==0xc8){logger[_0x63e3('0x16')](_0x63e3('0x17')+_0x419c10+_0x63e3('0x18')+_0xde84df[_0x63e3('0x15')]+'\x20('+_0xde84df[_0x63e3('0x19')]+')');_0x24d678(new Error(_0x63e3('0x17')+_0x419c10+'\x20failed,\x20status\x20code\x20=\x20'+_0xde84df[_0x63e3('0x15')]+'\x20('+_0xde84df[_0x63e3('0x19')]+')'));return;}var _0x10b8c6=fs[_0x63e3('0x1a')](_0x40d36c);_0x10b8c6['on'](_0x63e3('0x1b'),function(){logger[_0x63e3('0x1c')](_0x63e3('0x1d'));_0x10b8c6['close'](_0x1f81d0);});_0x10b8c6['on'](_0x63e3('0x16'),function(_0x43df2d){fs['unlink'](_0x40d36c);logger[_0x63e3('0x16')]('download\x20error',_0x43df2d);_0x24d678(_0x43df2d);});_0xde84df[_0x63e3('0x1e')](_0x10b8c6);})['on']('error',function(_0x10ad31){logger['error'](_0x10ad31);_0x24d678(_0x10ad31);})[_0x63e3('0x1f')]();});}function uploadFile(_0x24c817){return new BPromise(function(_0x5dd5c8,_0x330f4e){var _0x5b842e=urlParse(_0x24c817);var _0x4b1d31=_0x5b842e[_0x63e3('0x11')]===_0x63e3('0x12')?https:http;var _0x4692cf={'host':_0x5b842e['host'],'path':_0x5b842e[_0x63e3('0x4')],'headers':{'user-agent':_0x63e3('0x14')}};_0x4b1d31[_0x63e3('0x20')](_0x4692cf,function(_0x21ea48){if(_0x21ea48[_0x63e3('0x15')]!==0xc8){_0x330f4e(new Error('request\x20to\x20'+_0x24c817+'\x20failed,\x20status\x20code\x20=\x20'+_0x21ea48[_0x63e3('0x15')]+'\x20('+_0x21ea48[_0x63e3('0x19')]+')'));return;}var _0x5812d1='';_0x21ea48['on']('data',function(_0x517527){_0x5812d1+=_0x517527;});_0x21ea48['on'](_0x63e3('0x1f'),function(){_0x5dd5c8(_0x5812d1);});})['on'](_0x63e3('0x16'),function(_0x28db68){_0x330f4e(_0x28db68);})['end']();});}function convertFile(_0x54c294,_0x54f4ac){return new BPromise(function(_0x376542,_0x1b97b1){var _0x5ac712=sox[_0x63e3('0x21')](_0x54c294,_0x54f4ac,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5ac712['on']('error',function(_0x19d879){logger[_0x63e3('0x16')](_0x63e3('0x22'),_0x19d879);_0x1b97b1(_0x19d879);});_0x5ac712['on'](_0x63e3('0x1f'),function(){logger[_0x63e3('0x1c')](_0x63e3('0x23'));_0x376542();});_0x5ac712[_0x63e3('0x24')]();});}function base64Decode(_0x2f08ce,_0x5abef8){var _0x346bf3=path[_0x63e3('0x25')](__dirname,'tmp',rs[_0x63e3('0x26')](0x4)+_0x63e3('0x27'));fs['writeFileSync'](_0x346bf3,_0x2f08ce,'base64');return convertFile(_0x346bf3,_0x5abef8)['then'](function(){try{fs['unlink'](_0x346bf3);fs[_0x63e3('0x28')](_0x5abef8,_0x63e3('0x29'));}catch(_0x227be6){logger['error'](_0x227be6);}return _0x5abef8['split']('.')[0x0];});}function base64Encode(_0x1fd0c0){var _0x1d24b9=fs[_0x63e3('0x2a')](_0x1fd0c0);return new Buffer(_0x1d24b9)[_0x63e3('0x2b')](_0x63e3('0x2c'));}exports[_0x63e3('0x2d')]=function(_0x40ba50,_0x5c3d31,_0x3692af,_0x313daf,_0x4620b7,_0x1aef9b){var _0x286f33,_0x1ad609;var _0x44fb79=_0x63e3('0x2e');var _0x3dc526=_0x63e3('0x2f')+_0x40ba50;var _0x5e158b={};if(_0x5c3d31===_0x63e3('0x30')){_0x5e158b[_0x63e3('0x31')]={'ssml':_0x3692af};}else{_0x5e158b[_0x63e3('0x31')]={'text':_0x3692af};};_0x5e158b[_0x63e3('0x32')]={'languageCode':_0x313daf,'ssmlGender':_0x4620b7};_0x5e158b[_0x63e3('0x33')]={'audioEncoding':_0x63e3('0x34'),'sampleRateHertz':0x1f40};var _0x197e48={'url':_0x44fb79+_0x63e3('0x35')+_0x3dc526,'method':_0x63e3('0x36'),'json':!![],'body':_0x5e158b};return rp(_0x197e48)[_0x63e3('0x37')](function(_0x4cca2d){return new BPromise(function(_0x4aaf5a,_0x31e3d4){_0x286f33=path[_0x63e3('0x25')](__dirname,'tmp',rs[_0x63e3('0x26')](0x4)+_0x63e3('0x38'));var _0x2a7d41=Buffer[_0x63e3('0x39')](_0x4cca2d[_0x63e3('0x3a')],'base64');return fs[_0x63e3('0x3b')](_0x286f33,_0x2a7d41,function(_0x222670){_0x31e3d4(_0x222670);},function(_0x430c95){fs[_0x63e3('0x28')](_0x286f33,_0x63e3('0x29'));_0x4aaf5a(_0x430c95);});});})['then'](function(_0x34afb0){_0x1ad609=path[_0x63e3('0x25')](__dirname,'tmp',rs[_0x63e3('0x26')](0x4)+'.wav');return convertFile(_0x286f33,_0x1ad609);})['then'](function(){try{fs[_0x63e3('0x3c')](_0x286f33);fs[_0x63e3('0x28')](_0x1ad609,'777');}catch(_0x4f8623){logger['error'](_0x4f8623);}logger[_0x63e3('0x1c')](_0x63e3('0x3d'),_0x1ad609[_0x63e3('0x3e')]('.')[0x0]);return _0x1ad609[_0x63e3('0x3e')]('.')[0x0];});};exports[_0x63e3('0x3f')]=function(_0x59007c,_0x2e7224){var _0x138bbd=_0x63e3('0x40');var _0x262f25,_0x19dda5;var _0x542e7a;var _0x456d62={'encoding':'utf8','method':_0x63e3('0x36'),'timeout':0x2710,'url':_0x138bbd,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x63e3('0x41')+encodeURIComponent(JSON[_0x63e3('0x42')]([[[_0x63e3('0x43'),JSON['stringify']([_0x59007c,_0x2e7224||'en',![],_0x63e3('0x44')]),null,_0x63e3('0x45')]]]))};return rp(_0x456d62)[_0x63e3('0x37')](function(_0x3aa69b){try{_0x542e7a=eval(_0x3aa69b[_0x63e3('0x46')](0x5))[0x0][0x2];}catch(_0x38ec69){throw new Error(_0x63e3('0x47')+_0x3aa69b[_0x63e3('0x48')]);}if(!_0x542e7a){if(_0x59007c['length']>0xc8){throw new Error(_0x63e3('0x49'));}else{throw new Error(_0x63e3('0x4a')+_0x2e7224+_0x63e3('0x4b'));}}try{_0x542e7a=eval(_0x542e7a)[0x0];}catch(_0x507630){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x63e3('0x48')]);}const _0x464832=_0x542e7a;_0x262f25=path[_0x63e3('0x25')](__dirname,_0x63e3('0x4c'),rs['generate'](0x4)+_0x63e3('0x38'));fs[_0x63e3('0x4d')](_0x262f25,_0x542e7a,{'encoding':_0x63e3('0x2c')});_0x19dda5=path['resolve'](__dirname,_0x63e3('0x4c'),rs[_0x63e3('0x26')](0x4)+'.wav');return convertFile(_0x262f25,_0x19dda5);})['then'](function(){try{fs['unlink'](_0x262f25);fs['chmodSync'](_0x19dda5,_0x63e3('0x29'));}catch(_0x1f2791){logger[_0x63e3('0x16')](_0x1f2791);}logger[_0x63e3('0x1c')]('goggleTTS\x20path',_0x19dda5[_0x63e3('0x3e')]('.')[0x0]);return _0x19dda5['split']('.')[0x0];});};exports[_0x63e3('0x4e')]=function(_0x949fd3,_0x1a9898,_0x39459b){return google[_0x63e3('0x4f')](_0x949fd3,_0x1a9898,_0x39459b)['then'](function(_0x44cc08){logger[_0x63e3('0x1c')](_0x44cc08[_0x63e3('0x50')]);return rp(_0x44cc08);})[_0x63e3('0x37')](function(_0x407298){var _0x2dd9db='';var _0x51ef65=0x0;try{fs[_0x63e3('0x3c')](_0x949fd3);}catch(_0x2fc759){logger[_0x63e3('0x16')](_0x2fc759);}if(_0x407298&&_0x407298['results']){_0x2dd9db=_0x407298[_0x63e3('0x51')][_0x63e3('0x52')](function(_0x2a8cc1){return _0x2a8cc1&&_0x2a8cc1[_0x63e3('0x53')][0x0]&&_0x2a8cc1[_0x63e3('0x53')][0x0][_0x63e3('0x54')]?_0x2a8cc1[_0x63e3('0x53')][0x0]['transcript']:'';})['join']('\x0a');_0x51ef65=_0x407298[_0x63e3('0x51')][_0x63e3('0x52')](function(_0x72ea5){return _0x72ea5&&_0x72ea5['alternatives'][0x0]&&_0x72ea5[_0x63e3('0x53')][0x0][_0x63e3('0x55')]?_0x72ea5[_0x63e3('0x53')][0x0][_0x63e3('0x55')]:0x0;})[_0x63e3('0x56')]('\x0a');}logger[_0x63e3('0x1c')](_0x63e3('0x57'),_0x2dd9db);logger['info'](_0x63e3('0x58'),_0x51ef65);return{'transcript':_0x2dd9db,'confidence':_0x51ef65};})[_0x63e3('0x59')](function(_0x42376a){logger[_0x63e3('0x16')](_0x63e3('0x5a'),_0x42376a[_0x63e3('0x15')],_0x42376a[_0x63e3('0x5b')],_0x42376a['message']);});};exports[_0x63e3('0x5c')]=function(_0x4e3203,_0x12386f,_0x370092,_0x4edd31){var _0x530b9c=apiai(_0x12386f,{'language':_0x4edd31||'en'});return _0x530b9c[_0x63e3('0x5d')](_0x370092,{'sessionId':md5(_0x4e3203)})[_0x63e3('0x37')](function(_0x1cb8f1){logger[_0x63e3('0x1c')](JSON['stringify'](_0x1cb8f1));return{'source':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x5f')],'resolvedQuery':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x60')],'action':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x61')],'actionIncomplete':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x62')],'speech':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x63')][_0x63e3('0x64')],'score':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x65')],'statusCode':_0x1cb8f1[_0x63e3('0x66')][_0x63e3('0x67')],'endConversation':_0x1cb8f1[_0x63e3('0x5e')][_0x63e3('0x68')][_0x63e3('0x69')]||![],'isFallbackIntent':_0x1cb8f1['result'][_0x63e3('0x68')][_0x63e3('0x6a')]};});};exports['googleDialogflowV2']=function(_0xdd5ede,_0x24b221,_0x5b2a31,_0x2987a6,_0x51dbc4,_0x4dce47){var _0x502447=_0x2987a6['replace'](/\\n/g,'\x0a');var _0x322607={'credentials':{'private_key':_0x502447,'client_email':_0x5b2a31}};var _0x3f4c1f=new dialogflow[(_0x63e3('0x6b'))](_0x322607);var _0x10784c=_0x3f4c1f[_0x63e3('0x6c')](_0x24b221,md5(_0xdd5ede));var _0x299047={'session':_0x10784c,'queryInput':{'text':{'text':_0x51dbc4,'languageCode':_0x4dce47}}};return _0x3f4c1f['detectIntent'](_0x299047)['then'](function(_0x14e81c){if(_0x14e81c&&_0x14e81c['length']){logger[_0x63e3('0x1c')](_0x63e3('0x6d'),JSON['stringify'](_0x14e81c));var _0x2d3a83=_0x14e81c[0x0];if(_0x2d3a83){var _0x22f577={'action':_0x2d3a83[_0x63e3('0x6e')]['action'],'allRequiredParamsPresent':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x6f')],'endConversation':_0x2d3a83['queryResult']['diagnosticInfo']&&_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x70')][_0x63e3('0x71')]?_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x70')][_0x63e3('0x71')]['end_conversation'][_0x63e3('0x72')]:![],'fulfillmentText':_0x2d3a83['queryResult'][_0x63e3('0x73')],'intentName':_0x2d3a83['queryResult'][_0x63e3('0x74')][_0x63e3('0x5b')],'intentDisplayName':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x74')][_0x63e3('0x75')],'isFallbackIntent':_0x2d3a83['queryResult'][_0x63e3('0x74')][_0x63e3('0x76')],'languageCode':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x77')],'queryText':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x78')],'responseId':_0x2d3a83[_0x63e3('0x79')],'score':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x7a')],'speech':_0x2d3a83[_0x63e3('0x6e')][_0x63e3('0x73')],'providerResponse':JSON[_0x63e3('0x42')](_0x14e81c)};return _0x22f577;}}});};exports[_0x63e3('0x7b')]=function(_0x43047a,_0x2751dd,_0x84870c,_0x28a8ae){return tilde[_0x63e3('0x4f')](_0x43047a,_0x2751dd,_0x84870c,_0x28a8ae)[_0x63e3('0x37')](function(_0x3eb217){try{fs['unlink'](_0x43047a);}catch(_0x185567){logger['error'](_0x185567);}logger[_0x63e3('0x1c')](_0x63e3('0x7c'),_0x3eb217[_0x63e3('0x54')]);logger['info'](_0x63e3('0x7d'),_0x3eb217['confidence']);return _0x3eb217;});};exports[_0x63e3('0x7e')]=function(_0x16c6b3,_0x4022d2,_0x1be788,_0x21969c,_0x93ad75,_0x1a76c6){var _0x1b1170=path[_0x63e3('0x25')](__dirname,_0x63e3('0x4c'),rs['generate'](0x4)+_0x63e3('0x38'));var _0xbb4f6;return aws[_0x63e3('0x7f')](_0x16c6b3,_0x4022d2,_0x1be788,_0x21969c,_0x93ad75,_0x1a76c6,_0x1b1170)['then'](function(){_0xbb4f6=path[_0x63e3('0x25')](__dirname,_0x63e3('0x4c'),rs[_0x63e3('0x26')](0x4)+_0x63e3('0x27'));return convertFile(_0x1b1170,_0xbb4f6);})['then'](function(){try{fs[_0x63e3('0x3c')](_0x1b1170);fs[_0x63e3('0x28')](_0xbb4f6,_0x63e3('0x29'));}catch(_0x27eb7f){logger[_0x63e3('0x16')](_0x27eb7f);}return _0xbb4f6[_0x63e3('0x3e')]('.')[0x0];});};exports[_0x63e3('0x80')]=function(_0x523686,_0x3c249e,_0x2b37b9,_0x1f42f9,_0x3130a1,_0x525e9e){return aws[_0x63e3('0x81')](_0x523686,_0x3c249e,_0x2b37b9,_0x1f42f9,_0x3130a1,_0x525e9e)[_0x63e3('0x37')](function(_0x36b93a){logger[_0x63e3('0x1c')](JSON[_0x63e3('0x42')](_0x36b93a));return _0x36b93a;});};exports[_0x63e3('0x82')]=function(_0x165eef,_0x1f4397,_0x500154,_0x5bfd67){var _0x29fd54=util[_0x63e3('0x83')](_0x63e3('0x84'),ISPEECH_API,_0x165eef,encodeURIComponent(_0x1f4397),_0x500154,_0x5bfd67);var _0x392201=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x4fb2d4;return downloadFile(_0x29fd54,_0x392201)['then'](function(){_0x4fb2d4=path[_0x63e3('0x25')](__dirname,_0x63e3('0x4c'),rs[_0x63e3('0x26')](0x4)+_0x63e3('0x27'));return convertFile(_0x392201,_0x4fb2d4);})['then'](function(){try{fs['unlink'](_0x392201);fs[_0x63e3('0x28')](_0x4fb2d4,_0x63e3('0x29'));}catch(_0x2afc0d){logger[_0x63e3('0x16')](_0x2afc0d);}return _0x4fb2d4[_0x63e3('0x3e')]('.')[0x0];});};exports[_0x63e3('0x85')]=function(_0x5df34c,_0x33cde4,_0x55a595,_0x3e9d47){var _0x4b916c=util[_0x63e3('0x83')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x33cde4,_0x55a595,base64Encode(_0x5df34c),_0x3e9d47?util[_0x63e3('0x83')](_0x63e3('0x86'),encodeURIComponent(_0x3e9d47)):_0x63e3('0x87'));return uploadFile(_0x4b916c)[_0x63e3('0x37')](function(_0xa0d512){return querystring[_0x63e3('0xa')](_0xa0d512);});};exports[_0x63e3('0x88')]=function(_0x22ae60,_0x3a1ff8){return sestek[_0x63e3('0x89')](_0x22ae60,_0x3a1ff8)[_0x63e3('0x37')](function(_0xf4d39f){logger['info'](JSON[_0x63e3('0x42')](_0xf4d39f));var _0x1de40e={'speech':_0xf4d39f[_0x63e3('0x8a')],'action':_0xf4d39f['channelData']?_0xf4d39f[_0x63e3('0x8b')][_0x63e3('0x8c')]:undefined,'actiondata':_0xf4d39f['channelData']?_0xf4d39f[_0x63e3('0x8b')][_0x63e3('0x8d')]:undefined};if(_0xf4d39f['channelData']&&_0xf4d39f[_0x63e3('0x8b')][_0x63e3('0x8e')]){return base64Decode(_0xf4d39f[_0x63e3('0x8b')]['AudioFromTts'][_0x63e3('0x8f')],path[_0x63e3('0x25')](__dirname,_0x63e3('0x4c'),rs[_0x63e3('0x26')](0x4)+_0x63e3('0x27')))[_0x63e3('0x37')](function(_0x3ece6d){_0x1de40e[_0x63e3('0x90')]=_0x3ece6d;return _0x1de40e;});}return _0x1de40e;});};exports[_0x63e3('0x91')]=function(){return __dirname;};
\ No newline at end of file
index 9d4899b..377592a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb2e=['exports'];(function(_0xcc5a70,_0x136772){var _0x37bd44=function(_0x3f926){while(--_0x3f926){_0xcc5a70['push'](_0xcc5a70['shift']());}};_0x37bd44(++_0x136772);}(_0xcb2e,0x10a));var _0xecb2=function(_0x26403a,_0x4cae8f){_0x26403a=_0x26403a-0x0;var _0x1846f4=_0xcb2e[_0x26403a];return _0x1846f4;};var nda=require('./nda');module[_0xecb2('0x0')]={'nda':nda};
\ No newline at end of file
+var _0x9a15=['./nda','exports'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x9a15,0x144));var _0x59a1=function(_0x1fb794,_0x297464){_0x1fb794=_0x1fb794-0x0;var _0x5d2095=_0x9a15[_0x1fb794];return _0x5d2095;};var nda=require(_0x59a1('0x0'));module[_0x59a1('0x1')]={'nda':nda};
\ No newline at end of file
index 38a2e11..365b5f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e65=['ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','CustomActionData','info','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','text','access_token','project','channelData'];(function(_0x10eebb,_0x43ddea){var _0x39b51f=function(_0xc1cf7a){while(--_0xc1cf7a){_0x10eebb['push'](_0x10eebb['shift']());}};_0x39b51f(++_0x43ddea);}(_0x4e65,0xc4));var _0x54e6=function(_0xed4481,_0x34d2b0){_0xed4481=_0xed4481-0x0;var _0x43f032=_0x4e65[_0xed4481];return _0x43f032;};'use strict';var rp=require('request-promise');var url=require(_0x54e6('0x0'));var logger=require(_0x54e6('0x1'))(_0x54e6('0x2'));module[_0x54e6('0x3')]=function(_0x336ebf,_0x4f3288){var _0x5ed7d6={'method':_0x54e6('0x4'),'uri':url[_0x54e6('0x5')](_0x4f3288[_0x54e6('0x6')],_0x54e6('0x7')),'form':{'grant_type':_0x54e6('0x8'),'username':_0x4f3288['username'],'password':_0x4f3288[_0x54e6('0x8')]},'json':!![]};return rp(_0x5ed7d6)['then'](function(_0x256560){var _0x1a2191={'method':_0x54e6('0x4'),'uri':url[_0x54e6('0x5')](_0x4f3288['ndassistant_url'],_0x54e6('0x9')),'body':{'type':_0x4f3288[_0x54e6('0xa')]||_0x54e6('0xb'),'channelId':_0x54e6('0xc'),'conversation':{'id':_0x336ebf[_0x54e6('0xd')]},'from':{'id':_0x336ebf[_0x54e6('0xe')],'name':_0x336ebf['calleridname']},'recipient':{'id':_0x336ebf[_0x54e6('0xf')],'name':_0x336ebf['extension']},'text':_0x4f3288[_0x54e6('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x256560[_0x54e6('0x11')]},'json':!![]};if(_0x4f3288[_0x54e6('0x12')]){_0x1a2191['body'][_0x54e6('0x13')]['ProjectName']=_0x4f3288[_0x54e6('0x12')];}if(_0x4f3288[_0x54e6('0x14')]=='1'){_0x1a2191[_0x54e6('0x15')][_0x54e6('0x13')][_0x54e6('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x54e6('0x17')};}if(_0x4f3288['custom_action']){_0x1a2191[_0x54e6('0x15')][_0x54e6('0x13')][_0x54e6('0x18')]=_0x4f3288['custom_action'];if(_0x4f3288['custom_action_data']){_0x1a2191['body'][_0x54e6('0x13')][_0x54e6('0x19')]=_0x4f3288['custom_action_data'];}}logger[_0x54e6('0x1a')](JSON['stringify'](_0x1a2191));return rp(_0x1a2191);});};
\ No newline at end of file
+var _0x6c76=['access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','request-promise','url','../../../../../config/logger','exports','POST','resolve','/token','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20'];(function(_0x4940f4,_0x3f7a96){var _0x57b8e9=function(_0x5c753f){while(--_0x5c753f){_0x4940f4['push'](_0x4940f4['shift']());}};_0x57b8e9(++_0x3f7a96);}(_0x6c76,0x184));var _0x66c7=function(_0x5479f4,_0x32c81b){_0x5479f4=_0x5479f4-0x0;var _0x5b3ad3=_0x6c76[_0x5479f4];return _0x5b3ad3;};'use strict';var rp=require(_0x66c7('0x0'));var url=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('agi');module[_0x66c7('0x3')]=function(_0xd49f21,_0x519756){var _0x572a2b={'method':_0x66c7('0x4'),'uri':url[_0x66c7('0x5')](_0x519756['ndauth_url'],_0x66c7('0x6')),'form':{'grant_type':_0x66c7('0x7'),'username':_0x519756['username'],'password':_0x519756[_0x66c7('0x7')]},'json':!![]};return rp(_0x572a2b)['then'](function(_0x4fa6ce){var _0x208d06={'method':_0x66c7('0x4'),'uri':url[_0x66c7('0x5')](_0x519756['ndassistant_url'],_0x66c7('0x8')),'body':{'type':_0x519756[_0x66c7('0x9')]||_0x66c7('0xa'),'channelId':_0x66c7('0xb'),'conversation':{'id':_0xd49f21['uniqueid']},'from':{'id':_0xd49f21[_0x66c7('0xc')],'name':_0xd49f21[_0x66c7('0xd')]},'recipient':{'id':_0xd49f21[_0x66c7('0xe')],'name':_0xd49f21[_0x66c7('0xf')]},'text':_0x519756[_0x66c7('0x10')],'channelData':{}},'headers':{'Authorization':_0x66c7('0x11')+_0x4fa6ce[_0x66c7('0x12')]},'json':!![]};if(_0x519756['project']){_0x208d06[_0x66c7('0x13')][_0x66c7('0x14')][_0x66c7('0x15')]=_0x519756[_0x66c7('0x16')];}if(_0x519756[_0x66c7('0x17')]=='1'){_0x208d06[_0x66c7('0x13')][_0x66c7('0x14')][_0x66c7('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x66c7('0x19')};}if(_0x519756['custom_action']){_0x208d06[_0x66c7('0x13')]['channelData'][_0x66c7('0x1a')]=_0x519756[_0x66c7('0x1b')];if(_0x519756[_0x66c7('0x1c')]){_0x208d06[_0x66c7('0x13')][_0x66c7('0x14')]['CustomActionData']=_0x519756['custom_action_data'];}}logger['info'](JSON['stringify'](_0x208d06));return rp(_0x208d06);});};
\ No newline at end of file
index f9b074c..b93b614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x305692,_0x1eb2f1,_0x2e016c,_0x4efa37){return asr(_0x305692,_0x1eb2f1,_0x2e016c,_0x4efa37);};
\ No newline at end of file
+var _0xeb39=['exports','./lib/api'];(function(_0x4e917e,_0x1719c4){var _0x530d1c=function(_0x2ff881){while(--_0x2ff881){_0x4e917e['push'](_0x4e917e['shift']());}};_0x530d1c(++_0x1719c4);}(_0xeb39,0xc5));var _0x9eb3=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xeb39[_0x296897];return _0x2b44ab;};'use strict';var asr=require(_0x9eb3('0x0'));module[_0x9eb3('0x1')]=function(_0x41efe2,_0x18a6d5,_0xbdc5f1,_0x53365d){return asr(_0x41efe2,_0x18a6d5,_0xbdc5f1,_0x53365d);};
\ No newline at end of file
index c98b382..9c7a476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87e6=['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','isNil','isObject','message','lodash','moment','crypto','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.'];(function(_0x5a72a6,_0x50fa9a){var _0x4f478f=function(_0x374fad){while(--_0x374fad){_0x5a72a6['push'](_0x5a72a6['shift']());}};_0x4f478f(++_0x50fa9a);}(_0x87e6,0x84));var _0x687e=function(_0x2f4478,_0x21a7dd){_0x2f4478=_0x2f4478-0x0;var _0x5dbbe5=_0x87e6[_0x2f4478];return _0x5dbbe5;};'use strict';var BPromise=require('bluebird');var _=require(_0x687e('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x687e('0x1'));var crypto=require(_0x687e('0x2'));var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x59b614,_0x2e306f,_0x1d3989,_0x5db8a8){return new BPromise(function(_0x5dacb9,_0xacaa50){logger['info'](_0x687e('0x3'),_0x5db8a8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x70d8a8=new WebSocket(_0x5db8a8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1c007a='';var _0x457c67='0';var _0x557de1='1';var _0x2c503a=_0x687e('0x4');function _0x2826ff(_0x474999){var _0x1e3a22=crypto[_0x687e('0x5')]('sha1');_0x1e3a22['update'](_0x474999);return _0x1e3a22['digest']('hex');}function _0x11eb84(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x116547=moment()[_0x687e('0x6')]();var _0x1f2fa0=_0x2826ff(_0x116547+_0x2e306f+_0x1d3989);_0x70d8a8['send'](JSON[_0x687e('0x7')]({'appID':_0x2e306f,'timestamp':_0x116547,'appKey':_0x1f2fa0}));var _0x4422b9=fs[_0x687e('0x8')](_0x59b614);_0x4422b9['on'](_0x687e('0x9'),function(_0x44e9d6){_0x70d8a8[_0x687e('0xa')](_0x44e9d6);});_0x4422b9['on'](_0x687e('0xb'),function(){_0x70d8a8[_0x687e('0xa')](_0x687e('0xc'));});}catch(_0x18bc4c){logger[_0x687e('0xd')](_0x687e('0xe'),JSON[_0x687e('0x7')](_0x18bc4c));_0x70d8a8[_0x687e('0xf')]();}}function _0xaba937(_0x12adff){try{if(_0x12adff){var _0x308cc1=JSON['parse'](_0x12adff);switch(_0x308cc1[_0x687e('0x10')]){case 0x0:if(_0x308cc1['result']){if(_0x308cc1[_0x687e('0x11')]['final']){logger[_0x687e('0x12')](_0x687e('0x13'),JSON['stringify'](_0x308cc1['result'][_0x687e('0x14')]));_0x1c007a=_0x308cc1[_0x687e('0x11')]['hypotheses'][0x0][_0x687e('0x15')];_0x457c67=_0x308cc1['result'][_0x687e('0x14')][0x0]['likelihood'];_0x557de1='0';_0x2c503a=_0x687e('0x16');_0x70d8a8[_0x687e('0xf')]();}}break;case 0x1:logger['info'](_0x687e('0x4'));_0x557de1='1';_0x2c503a=_0x687e('0x4');break;case 0x2:logger[_0x687e('0x12')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x557de1='2';_0x2c503a=_0x687e('0x17');break;case 0x9:logger[_0x687e('0x12')](_0x687e('0x18'));_0x557de1='9';_0x2c503a=_0x687e('0x18');break;case 0xa:logger['info'](_0x687e('0x19'));_0x557de1='10';_0x2c503a=_0x687e('0x19');break;case 0xb:logger[_0x687e('0x12')](_0x687e('0x1a'));_0x557de1='11';_0x2c503a=_0x687e('0x1a');}}}catch(_0x536154){logger[_0x687e('0xd')](_0x687e('0x1b'),JSON[_0x687e('0x7')](_0x536154));_0x70d8a8[_0x687e('0xf')]();}}function _0x33dd03(){logger[_0x687e('0x12')]('Close\x20Tilde\x20ASR\x20socket');_0x5dacb9({'transcript':_0x1c007a,'confidence':_0x457c67,'status':_0x557de1,'status_message':_0x2c503a});}function _0x5c0729(_0x286a4e){logger[_0x687e('0xd')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x687e('0x1c')](_0x286a4e)){logger['error'](_[_0x687e('0x1d')](_0x286a4e)?JSON[_0x687e('0x7')](_0x286a4e):_0x286a4e);}}_0x70d8a8['on']('open',_0x11eb84);_0x70d8a8['on'](_0x687e('0x1e'),_0xaba937);_0x70d8a8['on'](_0x687e('0xb'),_0x33dd03);_0x70d8a8['on'](_0x687e('0xd'),_0x5c0729);});};
\ No newline at end of file
+var _0xe14e=['likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x5ed21b,_0x551190){var _0x5d3bba=function(_0x279ed1){while(--_0x279ed1){_0x5ed21b['push'](_0x5ed21b['shift']());}};_0x5d3bba(++_0x551190);}(_0xe14e,0x16b));var _0xee14=function(_0x19f689,_0x171fed){_0x19f689=_0x19f689-0x0;var _0xd1b870=_0xe14e[_0x19f689];return _0xd1b870;};'use strict';var BPromise=require(_0xee14('0x0'));var _=require(_0xee14('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xee14('0x2'));var crypto=require('crypto');var logger=require(_0xee14('0x3'))('agi');module[_0xee14('0x4')]=function(_0x1e21f1,_0x488b50,_0x36eafe,_0x3cbcd8){return new BPromise(function(_0x3df95c,_0x1ca75c){logger[_0xee14('0x5')](_0xee14('0x6'),_0x3cbcd8||_0xee14('0x7'));var _0x25a7a0=new WebSocket(_0x3cbcd8||_0xee14('0x7'),{'perMessageDeflate':![]});var _0x1706e6='';var _0x45f008='0';var _0x652717='1';var _0x3a2f90=_0xee14('0x8');function _0xe84918(_0x502fe1){var _0x333723=crypto[_0xee14('0x9')](_0xee14('0xa'));_0x333723[_0xee14('0xb')](_0x502fe1);return _0x333723['digest'](_0xee14('0xc'));}function _0x224250(){try{logger[_0xee14('0x5')](_0xee14('0xd'));var _0x1905d6=moment()[_0xee14('0xe')]();var _0x3e818d=_0xe84918(_0x1905d6+_0x488b50+_0x36eafe);_0x25a7a0[_0xee14('0xf')](JSON[_0xee14('0x10')]({'appID':_0x488b50,'timestamp':_0x1905d6,'appKey':_0x3e818d}));var _0x1084d5=fs[_0xee14('0x11')](_0x1e21f1);_0x1084d5['on']('data',function(_0x2a69ab){_0x25a7a0[_0xee14('0xf')](_0x2a69ab);});_0x1084d5['on'](_0xee14('0x12'),function(){_0x25a7a0['send'](_0xee14('0x13'));});}catch(_0x1d951f){logger[_0xee14('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0xee14('0x10')](_0x1d951f));_0x25a7a0['terminate']();}}function _0x4b6d5a(_0x591926){try{if(_0x591926){var _0x4494f4=JSON[_0xee14('0x15')](_0x591926);switch(_0x4494f4[_0xee14('0x16')]){case 0x0:if(_0x4494f4[_0xee14('0x17')]){if(_0x4494f4[_0xee14('0x17')]['final']){logger['info'](_0xee14('0x18'),JSON['stringify'](_0x4494f4[_0xee14('0x17')][_0xee14('0x19')]));_0x1706e6=_0x4494f4['result'][_0xee14('0x19')][0x0][_0xee14('0x1a')];_0x45f008=_0x4494f4['result'][_0xee14('0x19')][0x0][_0xee14('0x1b')];_0x652717='0';_0x3a2f90=_0xee14('0x1c');_0x25a7a0[_0xee14('0x1d')]();}}break;case 0x1:logger[_0xee14('0x5')](_0xee14('0x8'));_0x652717='1';_0x3a2f90='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xee14('0x5')](_0xee14('0x1e'));_0x652717='2';_0x3a2f90=_0xee14('0x1e');break;case 0x9:logger[_0xee14('0x5')](_0xee14('0x1f'));_0x652717='9';_0x3a2f90=_0xee14('0x1f');break;case 0xa:logger[_0xee14('0x5')]('Authentication\x20failed.');_0x652717='10';_0x3a2f90=_0xee14('0x20');break;case 0xb:logger[_0xee14('0x5')](_0xee14('0x21'));_0x652717='11';_0x3a2f90=_0xee14('0x21');}}}catch(_0x1a9477){logger[_0xee14('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x1a9477));_0x25a7a0[_0xee14('0x1d')]();}}function _0x1f8366(){logger[_0xee14('0x5')](_0xee14('0x22'));_0x3df95c({'transcript':_0x1706e6,'confidence':_0x45f008,'status':_0x652717,'status_message':_0x3a2f90});}function _0x44a60d(_0x1ad2af){logger[_0xee14('0x14')](_0xee14('0x23'));if(!_[_0xee14('0x24')](_0x1ad2af)){logger[_0xee14('0x14')](_[_0xee14('0x25')](_0x1ad2af)?JSON['stringify'](_0x1ad2af):_0x1ad2af);}}_0x25a7a0['on']('open',_0x224250);_0x25a7a0['on'](_0xee14('0x26'),_0x4b6d5a);_0x25a7a0['on']('close',_0x1f8366);_0x25a7a0['on'](_0xee14('0x14'),_0x44a60d);});};
\ No newline at end of file
index 7242af7..c85f7a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb312=['exports'];(function(_0x40e76b,_0x9f1a5){var _0x8b2a31=function(_0x22a9d3){while(--_0x22a9d3){_0x40e76b['push'](_0x40e76b['shift']());}};_0x8b2a31(++_0x9f1a5);}(_0xb312,0xd3));var _0x2b31=function(_0x505f79,_0x133321){_0x505f79=_0x505f79-0x0;var _0x497e69=_0xb312[_0x505f79];return _0x497e69;};var asr=require('./asr');module[_0x2b31('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x8270=['./asr'];(function(_0x5daa44,_0x1578fc){var _0x525ab0=function(_0x2ae694){while(--_0x2ae694){_0x5daa44['push'](_0x5daa44['shift']());}};_0x525ab0(++_0x1578fc);}(_0x8270,0x6f));var _0x0827=function(_0x177781,_0x136cc1){_0x177781=_0x177781-0x0;var _0x128fa2=_0x8270[_0x177781];return _0x128fa2;};var asr=require(_0x0827('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index d02a1dc..74b537d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe87b=['nextTick','inherits','exports','util','net','EventEmitter','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE'];(function(_0x301cfe,_0xae9e99){var _0x1cf983=function(_0x2cad18){while(--_0x2cad18){_0x301cfe['push'](_0x301cfe['shift']());}};_0x1cf983(++_0xae9e99);}(_0xe87b,0xbb));var _0xbe87=function(_0x1cadd9,_0x4e73e9){_0x1cadd9=_0x1cadd9-0x0;var _0x3778e0=_0xe87b[_0x1cadd9];return _0x3778e0;};'use strict';var util=require(_0xbe87('0x0'));var net=require(_0xbe87('0x1'));var EventEmitter=require('events')[_0xbe87('0x2')];var AGIError=require('./error');var AGIChannel=require(_0xbe87('0x3'));var AGIServer=function(_0xd6bf1,_0x321975,_0x591008){var _0x1658a1=this,_0xd6bf1=_0xd6bf1||0x11dd,_0x321975=_0x321975||_0xbe87('0x4'),_0x4f21a0=null,_0x4f064a=0x0;EventEmitter[_0xbe87('0x5')](_0x1658a1);function _0xab9a30(){if(!_0xd6bf1){_0x1658a1['emit'](_0xbe87('0x6'),new AGIError(_0xbe87('0x7')));return![];}_0x4f21a0=net[_0xbe87('0x8')]();_0x4f21a0[_0xbe87('0x9')](_0xd6bf1,_0x321975);_0x4f21a0['on'](_0xbe87('0xa'),function(){_0x1658a1[_0xbe87('0xb')](_0xbe87('0xa'));});_0x4f21a0['on'](_0xbe87('0xc'),function(_0x4a8865){_0x4f21a0[_0xbe87('0xd')](function(_0x39355d,_0x39b4a2){if(_0x39355d){_0x1658a1[_0xbe87('0xb')](_0xbe87('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x39355d));}else if(_0x591008&&_0x591008<0x0){_0x1658a1[_0xbe87('0xb')](_0xbe87('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4a8865[_0xbe87('0xe')]();}else if(_0x591008&&_0x591008>0x0&&_0x591008<_0x39b4a2){_0x4f064a+=0x1;_0x1658a1[_0xbe87('0xb')](_0xbe87('0x6'),new AGIError(_0xbe87('0xf'),_0x4f064a));_0x4a8865['destroy']();}else{var _0x26e802=new AGIChannel(_0x4a8865);_0x26e802['on'](_0xbe87('0x10'),function(){_0x1658a1[_0xbe87('0xb')](_0xbe87('0xc'),_0x26e802);});}});});_0x4f21a0['on']('error',function(_0x41f2eb){_0x1658a1['emit'](_0xbe87('0x6'),new AGIError(_0xbe87('0x11'),_0x41f2eb['code']));});_0x4f21a0['on']('close',function(){_0x1658a1['emit'](_0xbe87('0x12'),new AGIError(_0xbe87('0x13')));});}process[_0xbe87('0x14')](function(){_0xab9a30();});};util[_0xbe87('0x15')](AGIServer,EventEmitter);module[_0xbe87('0x16')]=function(_0x3d99b8,_0x29b812,_0x17f774){return new AGIServer(_0x3d99b8,_0x29b812,_0x17f774);};
\ No newline at end of file
+var _0x6cc1=['code','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x4ba857,_0x58988a){var _0x3a73e3=function(_0x2d1781){while(--_0x2d1781){_0x4ba857['push'](_0x4ba857['shift']());}};_0x3a73e3(++_0x58988a);}(_0x6cc1,0x158));var _0x16cc=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0x6cc1[_0x134827];return _0x366671;};'use strict';var util=require(_0x16cc('0x0'));var net=require(_0x16cc('0x1'));var EventEmitter=require(_0x16cc('0x2'))[_0x16cc('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x16cc('0x4'));var AGIServer=function(_0x46c747,_0xdb3f70,_0x511201){var _0x2f88ca=this,_0x46c747=_0x46c747||0x11dd,_0xdb3f70=_0xdb3f70||_0x16cc('0x5'),_0x2929cd=null,_0x4c58b9=0x0;EventEmitter[_0x16cc('0x6')](_0x2f88ca);function _0x54872b(){if(!_0x46c747){_0x2f88ca[_0x16cc('0x7')](_0x16cc('0x8'),new AGIError(_0x16cc('0x9')));return![];}_0x2929cd=net[_0x16cc('0xa')]();_0x2929cd['listen'](_0x46c747,_0xdb3f70);_0x2929cd['on'](_0x16cc('0xb'),function(){_0x2f88ca[_0x16cc('0x7')](_0x16cc('0xb'));});_0x2929cd['on'](_0x16cc('0xc'),function(_0x1a1631){_0x2929cd['getConnections'](function(_0x102b6c,_0x51779a){if(_0x102b6c){_0x2f88ca[_0x16cc('0x7')](_0x16cc('0x8'),new AGIError(_0x16cc('0xd'),_0x102b6c));}else if(_0x511201&&_0x511201<0x0){_0x2f88ca['emit']('error',new AGIError(_0x16cc('0xe')));_0x1a1631[_0x16cc('0xf')]();}else if(_0x511201&&_0x511201>0x0&&_0x511201<_0x51779a){_0x4c58b9+=0x1;_0x2f88ca[_0x16cc('0x7')](_0x16cc('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4c58b9));_0x1a1631['destroy']();}else{var _0x55e2b6=new AGIChannel(_0x1a1631);_0x55e2b6['on']('ready',function(){_0x2f88ca['emit'](_0x16cc('0xc'),_0x55e2b6);});}});});_0x2929cd['on'](_0x16cc('0x8'),function(_0x294c24){_0x2f88ca[_0x16cc('0x7')]('error',new AGIError(_0x16cc('0xd'),_0x294c24[_0x16cc('0x10')]));});_0x2929cd['on']('close',function(){_0x2f88ca[_0x16cc('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x16cc('0x11')](function(){_0x54872b();});};util[_0x16cc('0x12')](AGIServer,EventEmitter);module[_0x16cc('0x13')]=function(_0xc8af64,_0x97e05f,_0x3200ba){return new AGIServer(_0xc8af64,_0x97e05f,_0x3200ba);};
\ No newline at end of file
index b385689..af000d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0e3=['getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','stringify','parse','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','includes','clone','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','replaceObjectAllVariables','split','replaceAll','extra','toString','getAndSetVariable','result','maxRetry','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','callback_priority','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','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','wav','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','sms_text','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','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\x20no\x20stored','no\x20apiKey\x20configured','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','VOICEMAIL','mailbox','vswitch','join','exports','path','lodash','shelljs','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','getVariableById','catch','rpc','getVoiceQueueById','then','getSquareProject','name','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount'];(function(_0x12bf55,_0x414dc9){var _0x4460dc=function(_0x5e95c4){while(--_0x5e95c4){_0x12bf55['push'](_0x12bf55['shift']());}};_0x4460dc(++_0x414dc9);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x9f27a3,_0x3716d9){_0x9f27a3=_0x9f27a3-0x0;var _0x1e712e=_0xc0e3[_0x9f27a3];return _0x1e712e;};'use strict';var fs=require('fs');var path=require(_0x3c0e('0x0'));var util=require('util');var _=require(_0x3c0e('0x1'));var sh=require(_0x3c0e('0x2'));var odbc=require('odbc')();var rs=require(_0x3c0e('0x3'));var moment=require(_0x3c0e('0x4'));var Mustache=require(_0x3c0e('0x5'));var rp=require('request-promise');var logger=require(_0x3c0e('0x6'))(_0x3c0e('0x7'));var config=require(_0x3c0e('0x8'));var scripts=require(_0x3c0e('0x9'));var FILES_PATH=_0x3c0e('0xa');var recursiveMapAttributes=[_0x3c0e('0xb'),'rawBody'];var verticesWithRetry=[_0x3c0e('0xc'),_0x3c0e('0xd'),_0x3c0e('0xe')];var AGIVertices=function(_0x319ee1,_0x3294e3,_0x2ffe92){this[_0x3c0e('0xf')]=_0x319ee1;this['rpc']=_0x3294e3;this[_0x3c0e('0x10')]=_0x2ffe92;};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x12')]=function(_0x4f6744,_0x221dc2){this['rpc'][_0x3c0e('0x13')](_0x4f6744)['then'](function(_0x32a0c6){_0x221dc2(null,_0x32a0c6?_0x32a0c6['name']:![]);})[_0x3c0e('0x14')](function(_0x3c24ce){_0x221dc2(_0x3c24ce);});};AGIVertices[_0x3c0e('0x11')]['getVoiceQueue']=function(_0x41c2b0,_0x10d96d){this[_0x3c0e('0x15')][_0x3c0e('0x16')](_0x41c2b0)[_0x3c0e('0x17')](function(_0x2dca7f){_0x10d96d(null,_0x2dca7f?_0x2dca7f['name']:![]);})[_0x3c0e('0x14')](function(_0x25848c){_0x10d96d(_0x25848c);});};AGIVertices['prototype'][_0x3c0e('0x18')]=function(_0x1b1f76,_0x501fb3){this[_0x3c0e('0x15')]['getSquareProjectById'](_0x1b1f76)['then'](function(_0x4f7577){_0x501fb3(null,_0x4f7577?_0x4f7577[_0x3c0e('0x19')]:![]);})[_0x3c0e('0x14')](function(_0x47d004){_0x501fb3(_0x47d004);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1a')]=function(_0x2ecd88,_0x2a9916){this[_0x3c0e('0x15')][_0x3c0e('0x1b')](_0x2ecd88)[_0x3c0e('0x17')](function(_0x22c0a9){_0x2a9916(null,_0x22c0a9?_0x22c0a9['dsn']:![]);})[_0x3c0e('0x14')](function(_0x35381f){_0x2a9916(_0x35381f);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1c')]=function(_0x49e6b7,_0x57a83d){this['rpc'][_0x3c0e('0x1d')](_0x49e6b7)[_0x3c0e('0x17')](function(_0x541390){_0x57a83d(null,_0x541390?_0x541390[_0x3c0e('0x19')]:![]);})[_0x3c0e('0x14')](function(_0x2dea1c){_0x57a83d(_0x2dea1c);});};AGIVertices[_0x3c0e('0x11')]['getTrunk']=function(_0x1893ca,_0x39b3a5){this[_0x3c0e('0x15')][_0x3c0e('0x1e')](_0x1893ca)[_0x3c0e('0x17')](function(_0x406b57){_0x39b3a5(null,_0x406b57?_0x406b57[_0x3c0e('0x19')]:![]);})[_0x3c0e('0x14')](function(_0x1c4a07){_0x39b3a5(_0x1c4a07);});};AGIVertices[_0x3c0e('0x11')]['getSound']=function(_0x20b201,_0x48e87a){var _0x252ffe=this;this[_0x3c0e('0x15')][_0x3c0e('0x1f')](_0x20b201)[_0x3c0e('0x17')](function(_0x3b3833){_0x48e87a(null,_0x3b3833?_0x252ffe[_0x3c0e('0x20')](_0x3b3833[_0x3c0e('0x21')]):![]);})[_0x3c0e('0x14')](function(_0x59353e){_0x48e87a(_0x59353e);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x22')]=function(_0x366c3e,_0x38bbe8){this[_0x3c0e('0x15')][_0x3c0e('0x23')](_0x366c3e)[_0x3c0e('0x17')](function(_0x241968){_0x38bbe8(null,_0x241968?_0x241968:![]);})[_0x3c0e('0x14')](function(_0x27931c){_0x38bbe8(_0x27931c);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x24')]=function(_0x1b40e,_0x3f77ad,_0x1f6c6d){this[_0x3c0e('0x10')][_0x3c0e('0x24')](_0x1b40e,_0x3f77ad)['then'](function(){_0x1f6c6d(null);})['catch'](function(_0x464be3){_0x1f6c6d(_0x464be3);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x25')]=function(_0x97ce90,_0x5f3906){this[_0x3c0e('0x15')][_0x3c0e('0x26')](_0x97ce90)[_0x3c0e('0x17')](function(_0x5cc015){if(_0x5cc015){if(_0x5cc015[_0x3c0e('0x27')]){_0x5f3906(null,[_0x5cc015[_0x3c0e('0x28')]]);}else{_0x5f3906(null,_[_0x3c0e('0x29')](_0x5cc015[_0x3c0e('0x2a')],_0x3c0e('0x28')));}}else{_0x5f3906(null,![]);}})[_0x3c0e('0x14')](function(_0x2f87ea){_0x5f3906(_0x2f87ea);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x20')]=function(_0x276e9f){return util[_0x3c0e('0x2b')](_0x3c0e('0x2c'),FILES_PATH,_0x276e9f);};AGIVertices['prototype'][_0x3c0e('0x2d')]=function(_0xb21367,_0x3ca82f,_0x14227d){odbc[_0x3c0e('0x2e')](_0xb21367,function(_0xd420ac){if(_0xd420ac){logger[_0x3c0e('0x2f')](_0x3c0e('0x30'),_0xd420ac);_0x14227d(_0xd420ac);}else{logger[_0x3c0e('0x31')](_0x3c0e('0x32'));odbc[_0x3c0e('0x33')](_0x3ca82f,function(_0x4e254c,_0x128342){if(_0x4e254c){logger[_0x3c0e('0x31')](_0x3c0e('0x34'),_0x3ca82f);_0x14227d(_0x4e254c);}else{logger[_0x3c0e('0x31')](_0x3c0e('0x35'),_0x3ca82f);odbc[_0x3c0e('0x36')](function(_0xefacbe){if(_0xefacbe){logger[_0x3c0e('0x2f')](_0x3c0e('0x37'),_0xefacbe);}_0x14227d(null,_0x128342);});}});}});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x38')]=function(_0x43ef00,_0x452304){this['rpc'][_0x3c0e('0x39')](_0x43ef00)['then'](function(_0x19fdc9){_0x452304(null,_0x19fdc9?_0x19fdc9:![]);})[_0x3c0e('0x14')](function(_0x5c8238){_0x452304(_0x5c8238);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x3a')]=function(_0x42ce1d,_0x39d903){this[_0x3c0e('0x15')][_0x3c0e('0x3a')](_0x42ce1d)[_0x3c0e('0x17')](function(_0x5384c9){_0x39d903(null,_0x5384c9);})[_0x3c0e('0x14')](function(_0x6f4587){_0x39d903(_0x6f4587);});};AGIVertices['prototype'][_0x3c0e('0x3b')]=function(_0x4aebb7,_0x3e1d00,_0x3da782){this[_0x3c0e('0x15')][_0x3c0e('0x3b')]({'uniqueid':this[_0x3c0e('0xf')][_0x3c0e('0x3c')],'node':_0x4aebb7[_0x3c0e('0x3d')],'application':_0x4aebb7[_0x3c0e('0x3e')],'data':_0x3e1d00||null,'project_name':this[_0x3c0e('0xf')]['arg_1'],'callerid':this[_0x3c0e('0xf')][_0x3c0e('0x3f')]})[_0x3c0e('0x17')](function(_0x3a3966){if(_0x3da782){_0x3da782(null,_0x3a3966);}})['catch'](function(_0x24a9ed){if(_0x3da782){_0x3da782(_0x24a9ed);}});};AGIVertices[_0x3c0e('0x11')]['createSquareRecording']=function(_0x517134,_0x4f2636,_0x32d502,_0x4aa3d2){this[_0x3c0e('0x15')][_0x3c0e('0x40')]({'uniqueid':this[_0x3c0e('0xf')]['uniqueid'],'callerid':this['channel'][_0x3c0e('0x3f')],'calleridname':this[_0x3c0e('0xf')]['calleridname'],'context':this[_0x3c0e('0xf')][_0x3c0e('0x41')],'extension':this[_0x3c0e('0xf')][_0x3c0e('0x42')],'priority':this['channel'][_0x3c0e('0x43')],'accountcode':this[_0x3c0e('0xf')][_0x3c0e('0x44')],'dnid':this[_0x3c0e('0xf')][_0x3c0e('0x45')],'projectName':this[_0x3c0e('0xf')][_0x3c0e('0x46')],'saveName':_0x4f2636,'filename':_0x517134[_0x3c0e('0x47')]||_0x4f2636,'savePath':_0x32d502})['then'](function(_0x90606e){_0x4aa3d2(null,_0x90606e);})[_0x3c0e('0x14')](function(_0x13fe2c){_0x4aa3d2(_0x13fe2c);});};AGIVertices['prototype']['createSquareMessage']=function(_0x5709d1,_0x4c5cc7,_0xb2e2b0,_0x80dc85,_0x5bfbf5){this[_0x3c0e('0x15')][_0x3c0e('0x48')]({'uniqueid':this[_0x3c0e('0xf')][_0x3c0e('0x3c')],'body':_0x5709d1,'direction':_0x4c5cc7,'providerName':_0xb2e2b0,'providerResponse':_0x80dc85})[_0x3c0e('0x17')](function(_0x7ed96f){if(_0x5bfbf5){_0x5bfbf5(null,_0x7ed96f);}})[_0x3c0e('0x14')](function(_0x1dae3b){if(_0x5bfbf5){_0x5bfbf5(_0x1dae3b);}});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x49')]=function(_0x3844c2,_0x5094c9){this[_0x3c0e('0x15')][_0x3c0e('0x49')]({'firstName':_[_0x3c0e('0x4a')](_0x3844c2[_0x3c0e('0x19')])||_[_0x3c0e('0x4b')](_0x3844c2[_0x3c0e('0x19')])?_0x3c0e('0x4c')+Math[_0x3c0e('0x4d')]():_0x3844c2[_0x3c0e('0x19')],'lastName':_[_0x3c0e('0x4a')](_0x3844c2[_0x3c0e('0x4e')])||_[_0x3c0e('0x4b')](_0x3844c2[_0x3c0e('0x4e')])?null:_0x3844c2['lastName'],'phone':_0x3844c2['phone'],'ListId':_0x3844c2['list_id'],'scheduledat':_0x3844c2[_0x3c0e('0x4f')],'callbackUniqueid':this[_0x3c0e('0xf')][_0x3c0e('0x3c')],'tags':'callback','description':_0x3c0e('0x50')+_0x3844c2[_0x3c0e('0x4f')]['toString'](),'priority':_0x3844c2['callback_priority']})['then'](function(_0x1870bd){_0x5094c9(null,_0x1870bd);})[_0x3c0e('0x14')](function(_0x391bb4){_0x5094c9(_0x391bb4);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x51')]=function(_0x2e8af9,_0x45c02c){this[_0x3c0e('0x15')][_0x3c0e('0x52')](_0x2e8af9)['then'](function(_0x51d9b3){_0x45c02c(null,_0x51d9b3?_0x51d9b3[_0x3c0e('0x19')]:![]);})[_0x3c0e('0x14')](function(_0x60544f){_0x45c02c(_0x60544f);});};AGIVertices[_0x3c0e('0x11')]['agentPause']=function(_0x442f53,_0x4a3ce2,_0x3d43b0){var _0x1eec24={'role':_0x3c0e('0x53')};_0x1eec24[_0x442f53]=this[_0x3c0e('0xf')]['callerid'];this[_0x3c0e('0x15')][_0x3c0e('0x54')](_0x1eec24,_0x4a3ce2,this[_0x3c0e('0xf')][_0x3c0e('0x3c')])[_0x3c0e('0x17')](function(_0x190b24){_0x3d43b0(null,_[_0x3c0e('0x4b')](_0x190b24)?![]:!![]);})[_0x3c0e('0x14')](function(_0x505553){logger[_0x3c0e('0x2f')](_0x505553);_0x3d43b0(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x44744b,_0x45158a){var _0x1e4cce={'role':_0x3c0e('0x53')};_0x1e4cce[_0x44744b]=this[_0x3c0e('0xf')][_0x3c0e('0x3f')];this[_0x3c0e('0x15')][_0x3c0e('0x55')](_0x1e4cce)[_0x3c0e('0x17')](function(_0x48d2cd){_0x45158a(null,_['isNil'](_0x48d2cd)?![]:!![]);})[_0x3c0e('0x14')](function(_0x5eacac){logger['error'](_0x5eacac);_0x45158a(null,![]);});};AGIVertices[_0x3c0e('0x11')]['agentLogout']=function(_0xcd815a,_0x923b11){var _0x5df572={'role':_0x3c0e('0x53')};_0x5df572[_0xcd815a]=this[_0x3c0e('0xf')][_0x3c0e('0x3f')];this[_0x3c0e('0x15')][_0x3c0e('0x56')](_0x5df572)[_0x3c0e('0x17')](function(_0x4f18cf){_0x923b11(null,_['isNil'](_0x4f18cf)?![]:!![]);})['catch'](function(_0x1df23b){logger[_0x3c0e('0x2f')](_0x1df23b);_0x923b11(null,![]);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x57')]=function(_0x2a78df,_0x59dfae){var _0x253261={'role':'agent'};_0x253261[_0x2a78df]=this['channel'][_0x3c0e('0x3f')];var _0x3d33da=_0x2a78df!=_0x3c0e('0x58')?util[_0x3c0e('0x2b')]('%s/%s@from-sip/n',_0x3c0e('0x59'),this['channel'][_0x3c0e('0x3f')]):undefined;this[_0x3c0e('0x15')]['agentLogin'](_0x253261,_0x3d33da)[_0x3c0e('0x17')](function(_0x4fa208){_0x59dfae(null,_[_0x3c0e('0x4b')](_0x4fa208)?![]:!![]);})['catch'](function(_0x17b964){logger['error'](_0x17b964);_0x59dfae(null,![]);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x5a')]=function(_0x257806,_0xa326f){sh[_0x3c0e('0x5b')](_['trim'](_0x257806),function(_0x485917,_0x219fc8){var _0x31dedb=_0x219fc8[_0x3c0e('0x5c')](/(\r\n|\n|\r)/gm,'');_0xa326f(null,_0x31dedb);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x5d')]=function(_0x5ac3e5,_0x173eb3){scripts[_0x3c0e('0x5d')](_0x5ac3e5[_0x3c0e('0x5e')],_0x5ac3e5[_0x3c0e('0x5f')]||_0x3c0e('0x60'),_0x5ac3e5[_0x3c0e('0x60')],_0x5ac3e5[_0x3c0e('0x61')]||_0x3c0e('0x62'),_0x5ac3e5[_0x3c0e('0x63')]||_0x3c0e('0x64'),_0x5ac3e5[_0x3c0e('0x65')]||_0x3c0e('0x66'))[_0x3c0e('0x17')](function(_0x42ccf7){_0x173eb3(null,_0x42ccf7);})['catch'](function(_0x3b1858){_0x173eb3(_0x3b1858);});};AGIVertices['prototype'][_0x3c0e('0x67')]=function(_0x27158c,_0x23c058){scripts[_0x3c0e('0x67')](_0x27158c[_0x3c0e('0x60')],_0x27158c[_0x3c0e('0x68')]||'en',0x1)[_0x3c0e('0x17')](function(_0x7f44cf){_0x23c058(null,_0x7f44cf);})['catch'](function(_0x5e5714){_0x23c058(_0x5e5714);});};AGIVertices['prototype'][_0x3c0e('0x69')]=function(_0x489d2d,_0x348a0a){var _0x5df385={'uri':_0x489d2d[_0x3c0e('0x6a')],'method':_0x489d2d[_0x3c0e('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x489d2d[_0x3c0e('0x6c')])==='number'&&parseInt(_0x489d2d[_0x3c0e('0x6c')])>=0x1?parseInt(_0x489d2d[_0x3c0e('0x6c')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x3c0e('0x6d'),_0x3c0e('0x6e')],_0x5df385[_0x3c0e('0x6b')][_0x3c0e('0x6f')]())){try{_0x5df385[_0x3c0e('0x70')]=_0x489d2d[_0x3c0e('0x71')]?JSON['parse'](_0x489d2d[_0x3c0e('0x71')]):{};}catch(_0x3783af){logger[_0x3c0e('0x2f')](_0x3c0e('0x72'),_0x3783af);}}try{_0x5df385[_0x3c0e('0x73')]=_0x489d2d[_0x3c0e('0xb')]?JSON['parse'](_0x489d2d[_0x3c0e('0xb')]):{};}catch(_0x3f775b){logger[_0x3c0e('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3f775b);}if(_0x489d2d[_0x3c0e('0x74')]){try{var _0x2dd3e7=require(_0x489d2d['computedVariables'])[_0x3c0e('0x75')](this,_0x5df385);_0x5df385[_0x3c0e('0x76')]=Mustache['render'](_0x489d2d[_0x3c0e('0x6a')],_0x2dd3e7,{},['$$','$$']);if(_0x5df385['headers']){_0x5df385[_0x3c0e('0x73')]=JSON['parse'](Mustache['render'](JSON[_0x3c0e('0x77')](_0x5df385[_0x3c0e('0x73')]),_0x2dd3e7,{},['$$','$$']));}if(_0x5df385[_0x3c0e('0x70')]){_0x5df385['body']=JSON[_0x3c0e('0x78')](Mustache[_0x3c0e('0x79')](JSON[_0x3c0e('0x77')](_0x5df385[_0x3c0e('0x70')]),_0x2dd3e7,{},['$$','$$']));}}catch(_0x389d86){logger['error'](_0x3c0e('0x7a'),_0x389d86);}}rp(_0x5df385)[_0x3c0e('0x17')](function(_0x3b14f0){var _0x5150c1={'statusCode':_0x3b14f0[_0x3c0e('0x7b')]||0xc8,'statusMessage':_0x3b14f0[_0x3c0e('0x7c')]||'OK','headers':_0x3b14f0[_0x3c0e('0x73')]||{},'body':_0x3b14f0[_0x3c0e('0x70')]||{}};_0x348a0a(null,_0x5150c1);})[_0x3c0e('0x14')](function(_0xf1709c){var _0x5c0eef={'statusCode':_0xf1709c[_0x3c0e('0x7b')]||0x1f4,'statusMessage':_0xf1709c['message']||_0x3c0e('0x7d'),'headers':_0xf1709c['options']['headers']||{},'body':_0xf1709c[_0x3c0e('0x7e')][_0x3c0e('0x70')]||{}};_0x348a0a(null,_0x5c0eef);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x7f')]=function(_0x5bd936,_0x1ebba5){scripts['googleDialogflow'](this[_0x3c0e('0xf')][_0x3c0e('0x3c')],_0x5bd936[_0x3c0e('0x80')],_0x5bd936[_0x3c0e('0x60')],_0x5bd936[_0x3c0e('0x81')]||'en')[_0x3c0e('0x17')](function(_0x5b41f8){_0x1ebba5(null,_0x5b41f8);})[_0x3c0e('0x14')](function(_0x3c7467){_0x1ebba5(_0x3c7467);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x82')]=function(_0x1a2e52,_0x36a1f9){scripts['googleDialogflowV2'](this['channel'][_0x3c0e('0x3c')],_0x1a2e52['dialogflowV2_project_id'],_0x1a2e52['client_email'],_0x1a2e52[_0x3c0e('0x83')],_0x1a2e52[_0x3c0e('0x60')],_0x1a2e52[_0x3c0e('0x84')]||'en')[_0x3c0e('0x17')](function(_0x3edea9){_0x36a1f9(null,_0x3edea9);})['catch'](function(_0x1ef1df){_0x36a1f9(_0x1ef1df);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x85')]=function(_0x376cf8,_0x3171a6){scripts['sestekNDA'](this['channel'],_0x376cf8)[_0x3c0e('0x17')](function(_0x819d7b){_0x3171a6(null,_0x819d7b);})['catch'](function(_0x40d37b){_0x3171a6(_0x40d37b);});};AGIVertices['prototype']['ispeechTTS']=function(_0x1695bc,_0x5a9b99){scripts['ispeechTTS'](_0x1695bc[_0x3c0e('0x80')],_0x1695bc['text'],_0x1695bc[_0x3c0e('0x86')]||_0x3c0e('0x62'),_0x1695bc[_0x3c0e('0x87')])[_0x3c0e('0x17')](function(_0x1c49b5){_0x5a9b99(null,_0x1c49b5);})[_0x3c0e('0x14')](function(_0xde018b){_0x5a9b99(_0xde018b);});};AGIVertices[_0x3c0e('0x11')]['ispeechASR']=function(_0x57b4aa,_0xf24182,_0x110a84){scripts[_0x3c0e('0x88')](_0xf24182,_0x57b4aa[_0x3c0e('0x80')],_0x57b4aa[_0x3c0e('0x89')]||'en-US',this[_0x3c0e('0x8a')](_0x57b4aa['model'])?_0x57b4aa['model']:undefined)[_0x3c0e('0x17')](function(_0x56a584){_0x110a84(null,_0x56a584);})[_0x3c0e('0x14')](function(_0x3fbec4){_0x110a84(_0x3fbec4);});};AGIVertices['prototype'][_0x3c0e('0x8b')]=function(_0x146ba6,_0x435574){scripts['awsPolly'](_0x146ba6[_0x3c0e('0x8c')],_0x146ba6[_0x3c0e('0x8d')],_0x146ba6[_0x3c0e('0x8e')],_0x146ba6[_0x3c0e('0x8f')]||'Amy',_0x146ba6['text'],_0x146ba6['aws_text_type']||'text')[_0x3c0e('0x17')](function(_0x36380a){_0x435574(null,_0x36380a);})[_0x3c0e('0x14')](function(_0x226331){_0x435574(_0x226331);});};AGIVertices[_0x3c0e('0x11')]['awsLex']=function(_0x43f1b2,_0x481050){scripts[_0x3c0e('0x90')](this[_0x3c0e('0xf')]['uniqueid'],_0x43f1b2[_0x3c0e('0x8c')],_0x43f1b2[_0x3c0e('0x8d')],_0x43f1b2[_0x3c0e('0x91')],_0x43f1b2['text'],_0x43f1b2[_0x3c0e('0x92')])['then'](function(_0x143393){_0x481050(null,_0x143393);})[_0x3c0e('0x14')](function(_0x2e8d7c){_0x481050(_0x2e8d7c);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x93')]=function(_0x27cd26,_0x4ba9b4,_0x53ed7a){scripts['googleASR'](_0x4ba9b4,_0x27cd26[_0x3c0e('0x80')],_0x27cd26[_0x3c0e('0x94')]||_0x3c0e('0x62'))[_0x3c0e('0x17')](function(_0x2e4687){_0x53ed7a(null,_0x2e4687);})[_0x3c0e('0x14')](function(_0x568b27){_0x53ed7a(_0x568b27);});};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x95')]=function(_0x59fb51,_0x323152,_0x920c07){scripts[_0x3c0e('0x95')](_0x323152,_0x59fb51[_0x3c0e('0x96')],_0x59fb51['appsecret'],_0x59fb51['uri'])[_0x3c0e('0x17')](function(_0x41411d){_0x920c07(null,_0x41411d);})[_0x3c0e('0x14')](function(_0x2e6de7){_0x920c07(_0x2e6de7);});};AGIVertices['prototype']['clear']=function(_0x346aaf){var _0x121c2e=_[_0x3c0e('0x97')](verticesWithRetry,_0x346aaf[_0x3c0e('0x3e')])?_0x346aaf:_[_0x3c0e('0x98')](_0x346aaf);for(var _0x1ba317 in _0x121c2e){if(_0x121c2e['hasOwnProperty'](_0x1ba317)){if(_0x121c2e[_0x1ba317]&&_['isString'](_0x121c2e[_0x1ba317])){if(_[_0x3c0e('0x97')](recursiveMapAttributes,_0x1ba317)){_0x121c2e[_0x1ba317]=this['replaceObjectAllVariables'](_0x121c2e[_0x1ba317]);}else{_0x121c2e[_0x1ba317]=this[_0x3c0e('0x99')](_0x121c2e[_0x1ba317]);}}}}return _0x121c2e;};AGIVertices['prototype'][_0x3c0e('0x9a')]=function(_0x5b3bca){for(var _0x23bfbd in _0x5b3bca){if(_0x5b3bca[_0x3c0e('0x9b')](_0x23bfbd)){if(_[_0x3c0e('0x9c')](_0x5b3bca[_0x23bfbd])){this[_0x3c0e('0x9a')](_0x5b3bca[_0x23bfbd]);}else if(_['isArray'](_0x5b3bca[_0x23bfbd])){for(var _0x22a9d5=0x0;_0x22a9d5<_0x5b3bca[_0x23bfbd][_0x3c0e('0x9d')];_0x22a9d5++){this[_0x3c0e('0x9a')](_0x5b3bca[_0x23bfbd][_0x22a9d5]);}}else if(_['isString'](_0x5b3bca[_0x23bfbd])){_0x5b3bca[_0x23bfbd]=this[_0x3c0e('0x99')](_0x5b3bca[_0x23bfbd]);}}}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x9e')]=function(_0x50cbf2,_0x1574b9){for(var _0x199fe3 in _0x50cbf2){if(_0x50cbf2[_0x3c0e('0x9b')](_0x199fe3)){if(_[_0x3c0e('0x9c')](_0x50cbf2[_0x199fe3])){if(!_[_0x3c0e('0x4a')](_0x50cbf2[_0x199fe3])){this['saveRestApiResult'](_0x50cbf2[_0x199fe3],util[_0x3c0e('0x2b')](_0x3c0e('0x9f'),_0x1574b9,_0x199fe3));}}else if(_[_0x3c0e('0xa0')](_0x50cbf2[_0x199fe3])){for(var _0x154447=0x0;_0x154447<_0x50cbf2[_0x199fe3][_0x3c0e('0x9d')];_0x154447++){this[_0x3c0e('0x9e')](_0x50cbf2[_0x199fe3][_0x154447],util[_0x3c0e('0x2b')](_0x3c0e('0x9f'),_0x1574b9,_0x199fe3+'['+_0x154447+']'));}}else{if(!_['isNil'](_0x50cbf2[_0x199fe3])){this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0x9f'),_0x1574b9,_0x199fe3),_0x50cbf2[_0x199fe3]);}}}}};AGIVertices['prototype'][_0x3c0e('0xa2')]=function(_0x23d8f5){try{var _0x424c9d=JSON[_0x3c0e('0x78')](_0x23d8f5);this['recursiveNodeIndex'](_0x424c9d);return JSON['stringify'](_0x424c9d);}catch(_0x357db7){return this['replaceAllVariables'](_0x23d8f5);}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x99')]=function(_0x1167f2){var _0x574a73=_0x1167f2[_0x3c0e('0xa3')]('{');for(var _0x4cf668=0x1;_0x4cf668<_0x574a73[_0x3c0e('0x9d')];_0x4cf668+=0x1){var _0x3f60e7=_0x574a73[_0x4cf668][_0x3c0e('0xa3')]('}');if(_0x3f60e7[_0x3c0e('0x9d')]>0x1){_0x1167f2=_0x1167f2[_0x3c0e('0xa4')]('{'+_0x3f60e7[0x0]+'}',this[_0x3c0e('0xf')]['getVariable'](_0x3f60e7[0x0])[_0x3c0e('0xa5')]||_0x3f60e7[0x0]);}}if(_0x574a73[_0x3c0e('0x9d')]===0x1){return _0x1167f2[_0x3c0e('0xa6')]();}return this[_0x3c0e('0x99')](_0x1167f2);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xa7')]=function(_0x4908ed,_0x1f6a4c){var _0x4b8e7f=this['channel'][_0x3c0e('0x12')](_0x4908ed);if(_0x4b8e7f[_0x3c0e('0xa8')]===-0x1){return _0x4b8e7f;}logger[_0x3c0e('0x31')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1f6a4c,_0x4b8e7f[_0x3c0e('0xa5')]));return this['channel'][_0x3c0e('0xa1')](_0x1f6a4c,_0x4b8e7f[_0x3c0e('0xa5')]);};AGIVertices[_0x3c0e('0x11')]['isConfigured']=function(_0x3d91e1){return _0x3d91e1&&_0x3d91e1!=='0'&&_0x3d91e1!=='-1'&&_0x3d91e1!=='';};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xa9')]=function(_0x486840){this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x486840,'-');_0x486840[_0x3c0e('0xaa')]=_0x486840[_0x3c0e('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xab')]=function(_0x2abd83){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2abd83[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x2abd83[_0x3c0e('0x60')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0xac'));}var _0x51e862='\x22'+_0x2abd83['text']+'\x22';if(this[_0x3c0e('0x8a')](_0x2abd83[_0x3c0e('0x7e')])){_0x51e862+=','+_0x2abd83[_0x3c0e('0x7e')];}var _0xeb5a7f=this[_0x3c0e('0xf')][_0x3c0e('0x5b')](_0x3c0e('0xad'),_0x51e862);if(_0xeb5a7f[_0x3c0e('0xa8')]===-0x1){return _0xeb5a7f;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0xaf'),_0x51e862));};AGIVertices['prototype'][_0x3c0e('0xb0')]=function(_0x272a63){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xb1'),_0x272a63[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x272a63[_0x3c0e('0xb2')])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0xb3'));}var _0x5d512a=_0x272a63['grammar'];if(this['isConfigured'](_0x272a63[_0x3c0e('0x7e')])){_0x5d512a+=','+_0x272a63['options'];}var _0x24637a=this['channel']['exec'](_0x3c0e('0xb4'),_0x5d512a);if(_0x24637a[_0x3c0e('0xa8')]===-0x1){return _0x24637a;}var _0x5580c5=this['getAndSetVariable'](_0x3c0e('0xb5'),_0x3c0e('0xb6'));if(_0x5580c5[_0x3c0e('0xa8')]===-0x1){return _0x5580c5;}var _0x549729=this[_0x3c0e('0xa7')]('RECOG_INPUT()',_0x3c0e('0xb7'));if(_0x549729[_0x3c0e('0xa8')]===-0x1){return _0x549729;}var _0x4b811c=this[_0x3c0e('0xa7')](_0x3c0e('0xb8'),_0x3c0e('0xb9'));if(_0x4b811c[_0x3c0e('0xa8')]===-0x1){return _0x4b811c;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xba'),_0x5d512a));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x7')]=function(_0x4c9bda){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xbb'),_0x4c9bda['label']));return this[_0x3c0e('0xf')][_0x3c0e('0x7')]([_0x4c9bda[_0x3c0e('0xbc')],_0x4c9bda[_0x3c0e('0xbd')]]);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xbe')]=function(_0x5a3655){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5a3655[_0x3c0e('0x3d')]));if(this[_0x3c0e('0x8a')](_0x5a3655[_0x3c0e('0x6c')])){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x5a3655[_0x3c0e('0x6c')]));var _0x3bb1bd=this[_0x3c0e('0xf')][_0x3c0e('0xbf')](_0x5a3655[_0x3c0e('0x6c')]);if(_0x3bb1bd['result']===-0x1){return _0x3bb1bd;}}return this[_0x3c0e('0xf')][_0x3c0e('0xbe')]();};AGIVertices[_0x3c0e('0x11')]['callback']=function(_0x4bee28){logger['info'](util[_0x3c0e('0x2b')](_0x3c0e('0xc0'),_0x4bee28['label']));if(!this['isConfigured'](_0x4bee28[_0x3c0e('0xc1')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x4bee28,_0x3c0e('0xc2'));}_0x4bee28['scheduledAt']=moment();if(this['isConfigured'](_0x4bee28['delay'])){_0x4bee28[_0x3c0e('0x4f')]=moment()[_0x3c0e('0xc3')](_0x4bee28[_0x3c0e('0xc4')],_0x3c0e('0xc5'));}if(!this[_0x3c0e('0x8a')](_0x4bee28[_0x3c0e('0xc6')])){_0x4bee28[_0x3c0e('0xc6')]=0x2;}this['createCmContact'][_0x3c0e('0x75')](this,_0x4bee28);return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4bee28[_0x3c0e('0xc7')],_0x4bee28['list_id'],_0x4bee28[_0x3c0e('0x4f')]));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xc8')]=function(_0x286c82){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xc9'),_0x286c82[_0x3c0e('0x3d')]));var _0x2ad122=this[_0x3c0e('0xf')][_0x3c0e('0x5b')](_0x286c82['application'],_0x286c82['options']);if(_0x2ad122[_0x3c0e('0xa8')]===-0x1){return _0x2ad122;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format']('Executed\x20command\x20%s\x20%s',_0x286c82['application'],_0x286c82[_0x3c0e('0x7e')]));};AGIVertices['prototype'][_0x3c0e('0xca')]=function(_0x5c82fc){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0xcb'),_0x5c82fc[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x5c82fc[_0x3c0e('0x60')])){return this['channel'][_0x3c0e('0xae')]('no\x20text\x20configured');}var _0x3fa41c='\x22'+_0x5c82fc['text']+'\x22';if(this[_0x3c0e('0x8a')](_0x5c82fc[_0x3c0e('0x7e')])){_0x3fa41c+=','+_0x5c82fc[_0x3c0e('0x7e')];}var _0x156343=this[_0x3c0e('0xf')][_0x3c0e('0x5b')]('MRCPSynth',_0x3fa41c);if(_0x156343['result']===-0x1){return _0x156343;}return this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xaf'),_0x3fa41c));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xcc')]=function(_0x4f2f11){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4f2f11[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x4f2f11[_0x3c0e('0x60')])){return this['channel']['noop'](_0x3c0e('0xac'));}var _0x5428d3='\x22'+_0x4f2f11[_0x3c0e('0x60')]+'\x22';if(this[_0x3c0e('0x8a')](_0x4f2f11[_0x3c0e('0x7e')])){_0x5428d3+=','+_0x4f2f11['options'];}var _0x22a68e=this['channel']['exec'](_0x3c0e('0xad'),_0x5428d3);if(_0x22a68e[_0x3c0e('0xa8')]===-0x1){return _0x22a68e;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5428d3));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xcd')]=function(_0x313d23){logger['info'](util['format'](_0x3c0e('0xce'),_0x313d23[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x313d23[_0x3c0e('0xb2')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xb3'));}var _0x5beb0e=_0x313d23[_0x3c0e('0xb2')];if(this[_0x3c0e('0x8a')](_0x313d23[_0x3c0e('0x7e')])){_0x5beb0e+=','+_0x313d23[_0x3c0e('0x7e')];}var _0x508ab1=this[_0x3c0e('0xf')]['exec']('MRCPRecog',_0x5beb0e);if(_0x508ab1[_0x3c0e('0xa8')]===-0x1){return _0x508ab1;}var _0x3020ca=this[_0x3c0e('0xa7')](_0x3c0e('0xb5'),_0x3c0e('0xcf'));if(_0x3020ca[_0x3c0e('0xa8')]===-0x1){return _0x3020ca;}var _0x875f33=this[_0x3c0e('0xa7')](_0x3c0e('0xd0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x875f33['result']===-0x1){return _0x875f33;}var _0x375c22=this[_0x3c0e('0xa7')](_0x3c0e('0xb8'),'LUMENVOX_ASR_INSTANCE');if(_0x375c22[_0x3c0e('0xa8')]===-0x1){return _0x375c22;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0xba'),_0x5beb0e));};AGIVertices['prototype']['sestekasr']=function(_0x9d7ce3){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x9d7ce3[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x9d7ce3[_0x3c0e('0xb2')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('no\x20grammar\x20configured');}var _0x201b2d=_0x9d7ce3[_0x3c0e('0xb2')];if(this[_0x3c0e('0x8a')](_0x9d7ce3[_0x3c0e('0x7e')])){_0x201b2d+=','+_0x9d7ce3['options'];}var _0x559ae6=this[_0x3c0e('0xf')][_0x3c0e('0x5b')](_0x3c0e('0xb4'),_0x201b2d);if(_0x559ae6[_0x3c0e('0xa8')]===-0x1){return _0x559ae6;}var _0x3b87b6=this[_0x3c0e('0xa7')](_0x3c0e('0xb5'),_0x3c0e('0xd1'));if(_0x3b87b6['result']===-0x1){return _0x3b87b6;}var _0x1ba96e=this[_0x3c0e('0xa7')](_0x3c0e('0xd0'),_0x3c0e('0xd2'));if(_0x1ba96e[_0x3c0e('0xa8')]===-0x1){return _0x1ba96e;}var _0x37a72a=this[_0x3c0e('0xa7')](_0x3c0e('0xb8'),_0x3c0e('0xd3'));if(_0x37a72a[_0x3c0e('0xa8')]===-0x1){return _0x37a72a;}return this[_0x3c0e('0xf')]['noop'](util[_0x3c0e('0x2b')](_0x3c0e('0xba'),_0x201b2d));};AGIVertices[_0x3c0e('0x11')]['database']=function(_0x2f6185){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xd4'),_0x2f6185[_0x3c0e('0x3d')]));if(!this['isConfigured'](_0x2f6185[_0x3c0e('0xd5')])){return this['channel'][_0x3c0e('0x2f')](_0x2f6185,_0x3c0e('0xd6'));}var _0x1f403a=this['getSquareOdbc']['sync'](this,_0x2f6185[_0x3c0e('0xd5')]);if(!_0x1f403a){return this['channel'][_0x3c0e('0x2f')](_0x2f6185,_0x3c0e('0xd7'));}if(!this[_0x3c0e('0x8a')](_0x2f6185[_0x3c0e('0x33')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x2f6185,_0x3c0e('0xd8'));}var _0x1085f9=_0x2f6185['query'][_0x3c0e('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3c0e('0xf')]['noop'](util[_0x3c0e('0x2b')](_0x3c0e('0xd9'),_0x1085f9));var _0x242338=this['getQueryOdbc'][_0x3c0e('0x75')](this,_0x1f403a,_0x1085f9);this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x2f6185,_0x1085f9);if(!this[_0x3c0e('0x8a')](_0x2f6185[_0x3c0e('0xda')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xdb'));}var _0x342eda=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x2f6185[_0x3c0e('0xda')]);if(!_0x342eda){return this['channel'][_0x3c0e('0x2f')](_0x2f6185,_0x3c0e('0xdc'));}var _0x34439d=this;_0x242338[_0x3c0e('0xdd')](function(_0x3c030e,_0x4af0d8){Object['keys'](_0x3c030e)[_0x3c0e('0xdd')](function(_0x33d54a){_0x34439d[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')]('%s[%s][%s]',_0x342eda,_0x4af0d8,_0x33d54a),_0x3c030e[_0x33d54a]);});});this[_0x3c0e('0xf')]['setVariable'](util[_0x3c0e('0x2b')](_0x3c0e('0xde'),_0x342eda),_0x242338[_0x3c0e('0x9d')]);return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0xdf'),_0x342eda));};AGIVertices['prototype'][_0x3c0e('0xe0')]=function(_0x59fc31){logger['debug'](util[_0x3c0e('0x2b')](_0x3c0e('0xe1'),_0x59fc31['label']));if(!this[_0x3c0e('0x8a')](_0x59fc31[_0x3c0e('0xe2')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x59fc31,_0x3c0e('0xe3'));}var _0x50d5ac=this[_0x3c0e('0x1c')][_0x3c0e('0x75')](this,_0x59fc31[_0x3c0e('0xe2')]);if(!_0x50d5ac){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x59fc31,_0x3c0e('0xe4'));}var _0x3783e2=this['channel']['exec'](_0x3c0e('0xe5'),[util[_0x3c0e('0x2b')](_0x3c0e('0xe6'),_0x50d5ac),_0x59fc31[_0x3c0e('0x6c')],_0x59fc31['opts'],_0x59fc31[_0x3c0e('0x6a')]]);if(_0x3783e2[_0x3c0e('0xa8')]===-0x1){return _0x3783e2;}return this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xe7'),_0x3c0e('0xe5')));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xe8')]=function(_0x144e4c){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xe9'),_0x144e4c['label']));if(!this[_0x3c0e('0x8a')](_0x144e4c[_0x3c0e('0x80')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xea'));}if(!this[_0x3c0e('0x8a')](_0x144e4c[_0x3c0e('0x60')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xac'));}this['channel'][_0x3c0e('0xeb')]=!![];this[_0x3c0e('0x3b')](_0x144e4c);this['createSquareMessage'](_0x144e4c['text'],'in','','');this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xec'),_0x144e4c['text']));var _0x358f75=this[_0x3c0e('0x7f')][_0x3c0e('0x75')](this,_0x144e4c);if(_0x358f75){for(var _0x448091 in _0x358f75){if(_0x358f75[_0x3c0e('0x9b')](_0x448091)){this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0xed'),_0x448091[_0x3c0e('0x6f')]()),_0x358f75[_0x448091]);}}this[_0x3c0e('0x48')](_0x358f75[_0x3c0e('0xee')],'out','dialogflow','');return this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xef'),_0x358f75['speech']));}return this['channel'][_0x3c0e('0x2f')](_0x144e4c,_0x3c0e('0xf0'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xf1')]=function(_0x44105a){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0xf2'),_0x44105a[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x44105a[_0x3c0e('0xf3')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x44105a['client_email'])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x44105a[_0x3c0e('0x83')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xf4'));}if(!this[_0x3c0e('0x8a')](_0x44105a[_0x3c0e('0x84')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xf5'));}if(!this[_0x3c0e('0x8a')](_0x44105a[_0x3c0e('0x60')])){return this['channel'][_0x3c0e('0xae')]('no\x20text\x20configured');}this[_0x3c0e('0xf')][_0x3c0e('0xeb')]=!![];this[_0x3c0e('0x3b')](_0x44105a);this[_0x3c0e('0x48')](_0x44105a[_0x3c0e('0x60')],'in','','');this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('Trying\x20DialogflowV2:\x20%s',_0x44105a[_0x3c0e('0x60')]));var _0x47f20a=this[_0x3c0e('0x82')][_0x3c0e('0x75')](this,_0x44105a);if(_0x47f20a){for(var _0x5cc9db in _0x47f20a){if(_0x47f20a[_0x3c0e('0x9b')](_0x5cc9db)){if(_0x5cc9db!==_0x3c0e('0xf6')){this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0xed'),_0x5cc9db[_0x3c0e('0x6f')]()),_0x47f20a[_0x5cc9db]);}}}this[_0x3c0e('0x48')](_0x47f20a[_0x3c0e('0xee')],_0x3c0e('0xf7'),_0x3c0e('0xf1'),_0x47f20a['providerResponse']);return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xf8'),_0x47f20a[_0x3c0e('0xee')]));}return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x44105a,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x3c0e('0x11')]['sesteknda']=function(_0x29786c){logger['info'](util[_0x3c0e('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x29786c[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x29786c[_0x3c0e('0xf9')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xfa'));}if(!this['isConfigured'](_0x29786c[_0x3c0e('0xfb')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xfc'));}if(!this[_0x3c0e('0x8a')](_0x29786c[_0x3c0e('0xfd')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xfe'));}if(!this['isConfigured'](_0x29786c[_0x3c0e('0xff')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xac'));}this['channel'][_0x3c0e('0xeb')]=!![];this['createSquareDetailsReport'](_0x29786c);this[_0x3c0e('0x48')](_0x29786c[_0x3c0e('0x60')],'in','','');this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x100'),_0x29786c[_0x3c0e('0x60')]));var _0x111dc4=this['sestekNDA'][_0x3c0e('0x75')](this,_0x29786c);if(_0x111dc4){for(var _0x16defc in _0x111dc4){if(_0x111dc4['hasOwnProperty'](_0x16defc)){this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util['format'](_0x3c0e('0x101'),_0x16defc[_0x3c0e('0x6f')]()),_0x111dc4[_0x16defc]);}}this[_0x3c0e('0x48')](_0x111dc4['speech'],_0x3c0e('0xf7'),_0x3c0e('0x102'),'');if(_0x111dc4[_0x3c0e('0x103')]){this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x104'),_0x111dc4[_0x3c0e('0x103')]));var _0x454608=this[_0x3c0e('0xf')][_0x3c0e('0x105')](_0x111dc4['audiofile']);try{fs['unlink'](_0x111dc4[_0x3c0e('0x103')]+_0x3c0e('0x106'));}catch(_0x5ee01d){logger[_0x3c0e('0x2f')](_0x5ee01d);}return _0x454608;}else{return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x107'),_0x111dc4[_0x3c0e('0xee')]));}}return this['channel'][_0x3c0e('0x2f')](_0x29786c,_0x3c0e('0x108'));};AGIVertices['prototype'][_0x3c0e('0x109')]=function(_0x4f34ec){logger[_0x3c0e('0x31')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x4f34ec[_0x3c0e('0x3d')]));return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x109'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x10a')]=function(_0x519e65){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x10b'),_0x519e65[_0x3c0e('0x3d')]));var _0x1b3b50='';if(_0x519e65['trunk_id']){if(!this[_0x3c0e('0x8a')](_0x519e65[_0x3c0e('0x10c')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x519e65,'no\x20trunk\x20selected');}else{var _0x485789=parseInt(_0x519e65[_0x3c0e('0x10c')],0xa);if(isNaN(_0x485789)){_0x1b3b50=_0x519e65[_0x3c0e('0x10c')];}else{_0x1b3b50=this[_0x3c0e('0x10d')][_0x3c0e('0x75')](this,_0x519e65[_0x3c0e('0x10c')]);if(!_0x1b3b50){return this['channel'][_0x3c0e('0x2f')](_0x519e65,_0x3c0e('0x10e'));}}}}else if(_0x519e65['trunk_name']){_0x1b3b50=_0x519e65[_0x3c0e('0x10f')];}else{return this['channel'][_0x3c0e('0x2f')](_0x519e65,_0x3c0e('0x110'));}var _0x3c111b=this[_0x3c0e('0xf')][_0x3c0e('0x5b')]('DIAL',[util['format'](_0x3c0e('0x111'),_0x1b3b50,_0x519e65[_0x3c0e('0xc7')]),_0x519e65['timeout'],_0x519e65[_0x3c0e('0x112')],_0x519e65[_0x3c0e('0x6a')]]);if(_0x3c111b[_0x3c0e('0xa8')]===-0x1){return _0x3c111b;}return this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xe7'),_0x3c0e('0xe5')));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x113')]=function(_0x1bb5e2){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x114'),_0x1bb5e2['label']));return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x113'));};AGIVertices['prototype'][_0x3c0e('0xd')]=function(_0x1702b8){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x115'),_0x1702b8[_0x3c0e('0x3d')]));if(_0x1702b8[_0x3c0e('0xaa')]===0x0){return this['maxRetry'](_0x1702b8);}_0x1702b8[_0x3c0e('0xaa')]-=0x1;if(!this[_0x3c0e('0x8a')](_0x1702b8[_0x3c0e('0x116')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x1702b8,_0x3c0e('0x117'));}var _0x370c6e=this[_0x3c0e('0x118')][_0x3c0e('0x75')](this,_0x1702b8['file_id']);if(!_0x370c6e){return this['channel'][_0x3c0e('0x2f')](_0x1702b8,_0x3c0e('0x119'));}if(!this['isConfigured'](_0x1702b8[_0x3c0e('0xda')])){return this['channel'][_0x3c0e('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x47e50f=this[_0x3c0e('0xf')]['getData'](_0x370c6e,_0x1702b8[_0x3c0e('0x11a')],_0x1702b8['maxdigit']);var _0x3c30c0=_0x47e50f[_0x3c0e('0xa8')]?_0x47e50f[_0x3c0e('0xa8')]['toString']():'';logger['info'](_0x3c0e('0x11b'),JSON['stringify'](_0x47e50f));if(_0x47e50f['result']===-0x1){this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x1702b8,_0x3c30c0);return _0x47e50f;}else if(_0x47e50f['extra']===_0x3c0e('0x6c')){_0x47e50f[_0x3c0e('0xa8')]=_0x3c30c0[_0x3c0e('0x9d')]>=parseInt(_0x1702b8[_0x3c0e('0x11c')])?'x':'i';}else{_0x47e50f[_0x3c0e('0xa8')]=_0x3c30c0[_0x3c0e('0x9d')]>=parseInt(_0x1702b8['mindigit'])&&_0x3c30c0[_0x3c0e('0x9d')]<=parseInt(_0x1702b8['maxdigit'])?'x':'i';}var _0x394248=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x1702b8[_0x3c0e('0xda')]);if(!_0x394248){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x1702b8,_0x3c0e('0xdc'));}this[_0x3c0e('0xf')][_0x3c0e('0xa1')](_0x394248,_0x3c30c0);if(this[_0x3c0e('0x8a')](_0x1702b8[_0x3c0e('0x11d')])){var _0x2bd0fb=parseInt(_0x1702b8['hiddendigitsnum'],0xa);var _0x3bc563=rs[_0x3c0e('0x11e')]({'charset':'*','length':_0x2bd0fb});var _0x2006c8=_0x3c30c0['length'];if(_0x2006c8>0x0){if(_0x2006c8>_0x2bd0fb){this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x1702b8,_0x1702b8[_0x3c0e('0x11f')]===_0x3c0e('0x120')?_0x3bc563+_0x3c30c0[_0x3c0e('0x121')](_0x2bd0fb):_0x3c30c0[_0x3c0e('0x121')](0x0,_0x2006c8-_0x2bd0fb)+_0x3bc563);}else{this['createSquareDetailsReport'][_0x3c0e('0x75')](this,_0x1702b8,rs[_0x3c0e('0x11e')]({'charset':'*','length':_0x2006c8}));}}else{this['createSquareDetailsReport'][_0x3c0e('0x75')](this,_0x1702b8,'');}}else{this[_0x3c0e('0x3b')]['sync'](this,_0x1702b8,_0x3c30c0);}return _0x47e50f;};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xe')]=function(_0x23b475){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x23b475[_0x3c0e('0x3d')]));return this[_0x3c0e('0xd')](_0x23b475);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x122')]=function(_0x143cbb){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x123'),_0x143cbb[_0x3c0e('0x3d')]));this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x143cbb,_0x143cbb[_0x3c0e('0x124')]);return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('GOAL\x20%s',_0x143cbb[_0x3c0e('0x124')]));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x125')]=function(_0x1eca28){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x126'),_0x1eca28[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x1eca28[_0x3c0e('0x8c')])||!this[_0x3c0e('0x8a')](_0x1eca28[_0x3c0e('0x8d')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x127'));}if(!this[_0x3c0e('0x8a')](_0x1eca28[_0x3c0e('0x60')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xac'));}this['channel'][_0x3c0e('0xae')](util['format'](_0x3c0e('0x128'),_0x1eca28[_0x3c0e('0x60')]));var _0x2b3303=this[_0x3c0e('0x8b')]['sync'](this,_0x1eca28);if(_0x2b3303){this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x129'),_0x2b3303));var _0x3d1af2=this[_0x3c0e('0xf')][_0x3c0e('0x105')](_0x2b3303);try{fs[_0x3c0e('0x12a')](_0x2b3303+_0x3c0e('0x106'));}catch(_0x43a515){logger[_0x3c0e('0x2f')](_0x43a515);}return _0x3d1af2;}return this['channel'][_0x3c0e('0x2f')](_0x1eca28,_0x3c0e('0x12b'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x12c')]=function(_0x47be32){logger['info'](util[_0x3c0e('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x47be32['label']));if(!this[_0x3c0e('0x8a')](_0x47be32[_0x3c0e('0x8c')])||!this[_0x3c0e('0x8a')](_0x47be32['aws_secret_access_key'])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x3c0e('0x8a')](_0x47be32[_0x3c0e('0x92')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0x12d'));}if(!this[_0x3c0e('0x8a')](_0x47be32['text'])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xac'));}this[_0x3c0e('0xf')]['bot']=!![];this[_0x3c0e('0x3b')](_0x47be32);this['createSquareMessage'](_0x47be32[_0x3c0e('0x60')],'in','','');this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x12e'),_0x47be32[_0x3c0e('0x60')]));var _0x1a6ba1=this[_0x3c0e('0x90')][_0x3c0e('0x75')](this,_0x47be32);if(_0x1a6ba1){for(var _0x2e88ec in _0x1a6ba1){if(_0x1a6ba1[_0x3c0e('0x9b')](_0x2e88ec)&&_[_0x3c0e('0x12f')](_0x1a6ba1[_0x2e88ec])){this['channel']['setVariable'](util[_0x3c0e('0x2b')](_0x3c0e('0x130'),_0x2e88ec[_0x3c0e('0x6f')]()),_0x1a6ba1[_0x2e88ec]);}}if(_[_0x3c0e('0x4b')](_0x1a6ba1[_0x3c0e('0x131')])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0x132'));}else{this[_0x3c0e('0x48')](_0x1a6ba1[_0x3c0e('0x131')],_0x3c0e('0xf7'),_0x3c0e('0x133'),'');return this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x134'),_0x1a6ba1[_0x3c0e('0x131')]));}}return this['channel']['error'](_0x47be32,_0x3c0e('0x135'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x136')]=function(_0x45f0d3){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x137'),_0x45f0d3[_0x3c0e('0x3d')],_0x45f0d3['timeout']));if(!this[_0x3c0e('0x8a')](_0x45f0d3[_0x3c0e('0x80')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0xea'));}var _0x2d06ff='wav';var _0x5e21ac=util[_0x3c0e('0x2b')](_0x3c0e('0x138'),FILES_PATH,rs[_0x3c0e('0x11e')](0x4));var _0x4c77a7=util[_0x3c0e('0x2b')](_0x3c0e('0x9f'),_0x5e21ac,_0x2d06ff);var _0x4f386b=!![];if(_0x45f0d3['beep']===_0x3c0e('0x139')){_0x4f386b=![];}var _0x46b356=this[_0x3c0e('0xf')][_0x3c0e('0x13a')](_0x5e21ac,_0x2d06ff,_0x45f0d3[_0x3c0e('0x13b')],_0x45f0d3[_0x3c0e('0x6c')],undefined,_0x4f386b);if(_0x46b356[_0x3c0e('0xa8')]!==-0x1){this[_0x3c0e('0xf')]['noop'](util['format'](_0x3c0e('0x13c'),_0x4c77a7));var _0x460480=this[_0x3c0e('0x93')][_0x3c0e('0x75')](this,_0x45f0d3,_0x4c77a7);if(_0x460480){for(var _0x2571b1 in _0x460480){if(_0x460480[_0x3c0e('0x9b')](_0x2571b1)){this['channel'][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0x13d'),_0x2571b1['toUpperCase']()),_0x460480[_0x2571b1]);}}return this[_0x3c0e('0xf')]['noop'](util['format'](_0x3c0e('0x13e'),JSON[_0x3c0e('0x77')](_0x460480)));}}return _0x46b356;};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x13f')]=function(_0x3d1757){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x140'),_0x3d1757[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x3d1757['appid'])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0x141'));}if(!this[_0x3c0e('0x8a')](_0x3d1757[_0x3c0e('0x142')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0x143'));}var _0x27be42='wav';var _0x1f935a=util[_0x3c0e('0x2b')](_0x3c0e('0x138'),FILES_PATH,rs[_0x3c0e('0x11e')](0x4));var _0x26e1e7=util[_0x3c0e('0x2b')]('%s.%s',_0x1f935a,_0x27be42);var _0x15acd7=!![];if(_0x3d1757['beep']===_0x3c0e('0x139')){_0x15acd7=![];}var _0x33a59a=this[_0x3c0e('0xf')][_0x3c0e('0x13a')](_0x1f935a,_0x27be42,_0x3d1757[_0x3c0e('0x13b')],_0x3d1757[_0x3c0e('0x6c')],undefined,_0x15acd7);if(_0x33a59a[_0x3c0e('0xa8')]!==-0x1){this['channel'][_0x3c0e('0xae')](util['format'](_0x3c0e('0x144'),_0x26e1e7));var _0x45d41c=this['tildeASR']['sync'](this,_0x3d1757,_0x26e1e7);if(_0x45d41c){for(var _0x9e6868 in _0x45d41c){if(_0x45d41c['hasOwnProperty'](_0x9e6868)){this['channel'][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')]('TILDE_ASR_%s',_0x9e6868[_0x3c0e('0x6f')]()),_0x45d41c[_0x9e6868]);}}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x145'),JSON[_0x3c0e('0x77')](_0x45d41c)));}}return _0x33a59a;};AGIVertices['prototype'][_0x3c0e('0x146')]=function(_0xc41c10){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0xc41c10[_0x3c0e('0x3d')]));return this[_0x3c0e('0xf')]['continueAt'](_0xc41c10['context'],_0xc41c10[_0x3c0e('0x42')],_0xc41c10[_0x3c0e('0x43')]);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x147')]=function(_0x2f1cb0){logger['info'](util[_0x3c0e('0x2b')](_0x3c0e('0x148'),_0x2f1cb0[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x2f1cb0['condition'])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x2f1cb0,_0x3c0e('0x149'));}try{var _0x32119b=eval(_0x2f1cb0[_0x3c0e('0x14a')])?'true':_0x3c0e('0x14b');this['channel']['noop'](util[_0x3c0e('0x2b')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2f1cb0[_0x3c0e('0x14a')],_0x32119b));return{'code':0xc8,'result':_0x32119b};}catch(_0x443f97){return{'code':0xc8,'result':_0x3c0e('0x14b')};}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x14c')]=function(_0x5e05a5){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x14d'),_0x5e05a5[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x5e05a5[_0x3c0e('0x14e')])){return this['channel']['error'](_0x5e05a5,'no\x20interval\x20configured');}var _0x1c7207=this[_0x3c0e('0x25')][_0x3c0e('0x75')](this,_0x5e05a5[_0x3c0e('0x14e')]);if(!_0x1c7207){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x5e05a5,_0x3c0e('0x14f'));}for(var _0xc6f735=0x0;_0xc6f735<_0x1c7207['length'];_0xc6f735+=0x1){var _0x257569=this[_0x3c0e('0xf')][_0x3c0e('0x12')](util[_0x3c0e('0x2b')](_0x3c0e('0x150'),_0x1c7207[_0xc6f735]));if(_0x257569[_0x3c0e('0xa8')]===-0x1){return _0x257569;}logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x151'),_0x1c7207[_0xc6f735],_0x257569['extra']));if(_0x257569[_0x3c0e('0xa5')]===_0x3c0e('0x152')){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x151'),_0x1c7207[_0xc6f735],'true'));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('IFTIME\x20%s\x20%s',_0x1c7207[_0xc6f735],_0x3c0e('0x152')));return{'code':0xc8,'result':_0x3c0e('0x152')};}else{logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x151'),_0x1c7207[_0xc6f735],_0x3c0e('0x14b')));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x151'),_0x1c7207[_0xc6f735],_0x3c0e('0x14b')));}}return{'code':0xc8,'result':_0x3c0e('0x14b')};};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x153')]=function(_0x250d71){logger['info'](util[_0x3c0e('0x2b')](_0x3c0e('0x154'),_0x250d71[_0x3c0e('0x3d')]));return this['channel']['hangup']();};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x155')]=function(_0x470b92){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x156'),_0x470b92[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x470b92[_0x3c0e('0x80')])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0xea'));}var _0x3a760d=_0x3c0e('0x157');var _0x1fcddc=util['format'](_0x3c0e('0x138'),FILES_PATH,rs[_0x3c0e('0x11e')](0x4));var _0x464b4b=util[_0x3c0e('0x2b')](_0x3c0e('0x9f'),_0x1fcddc,_0x3a760d);var _0x1b64b7=!![];if(_0x470b92[_0x3c0e('0x158')]===_0x3c0e('0x139')){_0x1b64b7=![];}var _0x385599=this['channel']['recordFile'](_0x1fcddc,_0x3a760d,_0x470b92['intKey'],_0x470b92[_0x3c0e('0x6c')],undefined,_0x1b64b7);if(_0x385599[_0x3c0e('0xa8')]!==-0x1){this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x159'),_0x464b4b));var _0x1cd301=this[_0x3c0e('0x88')][_0x3c0e('0x75')](this,_0x470b92,_0x464b4b);if(_0x1cd301){for(var _0x1a6b39 in _0x1cd301){if(_0x1cd301[_0x3c0e('0x9b')](_0x1a6b39)){this[_0x3c0e('0xf')]['setVariable'](util['format'](_0x3c0e('0x15a'),_0x1a6b39[_0x3c0e('0x6f')]()),_0x1cd301[_0x1a6b39]);}}return this['channel']['noop'](util[_0x3c0e('0x2b')](_0x3c0e('0x15b'),JSON['stringify'](_0x1cd301)));}}return _0x385599;};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x15c')]=function(_0x5f0e2e){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x15d'),_0x5f0e2e[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x5f0e2e['key'])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0xea'));}if(!this[_0x3c0e('0x8a')](_0x5f0e2e[_0x3c0e('0x60')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0xac'));}this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x5f0e2e['text']));var _0x1ce530=this[_0x3c0e('0x15e')][_0x3c0e('0x75')](this,_0x5f0e2e);if(_0x1ce530){this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('ispeech\x20%s\x20file\x20created',_0x1ce530));var _0x59a3e6=this['channel'][_0x3c0e('0x105')](_0x1ce530,_0x5f0e2e[_0x3c0e('0x13b')]);try{fs[_0x3c0e('0x12a')](_0x1ce530+_0x3c0e('0x106'));}catch(_0x559748){logger[_0x3c0e('0x2f')](_0x559748);}return _0x59a3e6;}return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x5f0e2e,_0x3c0e('0x15f'));};AGIVertices['prototype'][_0x3c0e('0x160')]=function(_0x236033){logger['info'](util['format'](_0x3c0e('0x161'),_0x236033[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x236033[_0x3c0e('0x162')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x236033,'no\x20find\x20by\x20configured');}logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x163'),this[_0x3c0e('0xf')]['callerid'],_0x236033[_0x3c0e('0x162')]));var _0x2ebf6a=this['agentLogin'][_0x3c0e('0x75')](this,_0x236033[_0x3c0e('0x162')]);if(_0x2ebf6a){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x164'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x236033[_0x3c0e('0x162')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x3c0e('0x3f')],_0x236033['findBy']));return{'code':0xc8,'result':_0x3c0e('0x165')};}else{logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x166'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x236033[_0x3c0e('0x162')]));this[_0x3c0e('0xf')]['noop'](util[_0x3c0e('0x2b')](_0x3c0e('0x166'),this[_0x3c0e('0xf')]['callerid'],_0x236033[_0x3c0e('0x162')]));return{'code':0xc8,'result':_0x3c0e('0x167')};}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x168')]=function(_0x89deff){logger['info'](util['format'](_0x3c0e('0x169'),_0x89deff[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x89deff[_0x3c0e('0x162')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x89deff,_0x3c0e('0x16a'));}logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x89deff[_0x3c0e('0x162')]));var _0x3d0bf8=this[_0x3c0e('0x56')]['sync'](this,_0x89deff[_0x3c0e('0x162')]);if(_0x3d0bf8){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x164'),this['channel'][_0x3c0e('0x3f')],_0x89deff[_0x3c0e('0x162')]));this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x89deff[_0x3c0e('0x162')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x166'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x89deff[_0x3c0e('0x162')]));this['channel'][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x166'),this[_0x3c0e('0xf')]['callerid'],_0x89deff['findBy']));return{'code':0xc8,'result':_0x3c0e('0x167')};}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x16b')]=function(_0x17160d){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x16c'),_0x17160d[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x17160d[_0x3c0e('0x16d')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x17160d,_0x3c0e('0x16e'));}this['channel'][_0x3c0e('0xae')](util['format'](_0x3c0e('0x16f'),_0x17160d[_0x3c0e('0x16d')]));var _0x367739=eval(_0x17160d[_0x3c0e('0x16d')]);if(!this[_0x3c0e('0x8a')](_0x17160d[_0x3c0e('0xda')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2642d0=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x17160d[_0x3c0e('0xda')]);if(!_0x2642d0){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x17160d,_0x3c0e('0xdc'));}if(_[_0x3c0e('0xa0')](_0x367739)){var _0x5069ac=this;_0x367739[_0x3c0e('0xdd')](function(_0x7c0675,_0x2af968){_0x5069ac[_0x3c0e('0xf')]['setVariable'](util[_0x3c0e('0x2b')](_0x3c0e('0x170'),_0x2642d0,_0x2af968),_0x7c0675);});return this['channel'][_0x3c0e('0xae')](util['format'](_0x3c0e('0x171'),_0x2642d0));}else{return this[_0x3c0e('0xf')]['setVariable'](_0x2642d0,_0x367739);}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xc')]=function(_0x3afbf4){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x172'),_0x3afbf4[_0x3c0e('0x3d')]));if(_0x3afbf4[_0x3c0e('0xaa')]===0x0){return this[_0x3c0e('0xa9')](_0x3afbf4);}_0x3afbf4['retry']-=0x1;if(!this['isConfigured'](_0x3afbf4[_0x3c0e('0x116')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x3afbf4,_0x3c0e('0x117'));}var _0x31a9fe=this[_0x3c0e('0x118')][_0x3c0e('0x75')](this,_0x3afbf4['file_id']);if(!_0x31a9fe){return this['channel'][_0x3c0e('0x2f')](_0x3afbf4,_0x3c0e('0x119'));}var _0x3af021=this[_0x3c0e('0xf')][_0x3c0e('0x173')](_0x31a9fe,_0x3afbf4['response'],_0x3afbf4[_0x3c0e('0x174')]);var _0x51bb12=_0x3af021[_0x3c0e('0xa8')];if(_0x3af021['result']===-0x1){this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x3afbf4,'-1');return _0x3af021;}else if(_0x3af021[_0x3c0e('0xa5')]==='timeout'){_0x3af021[_0x3c0e('0xa8')]=_0x3af021[_0x3c0e('0xa8')][_0x3c0e('0x9d')]>0x0?_0x3af021[_0x3c0e('0xa8')]:'t';}else if(_['isEmpty'](_0x3af021[_0x3c0e('0xa8')])){_0x3af021[_0x3c0e('0xa8')]='#';_0x51bb12='#';}if(!this[_0x3c0e('0x8a')](_0x3afbf4['variable_id'])){this[_0x3c0e('0xf')]['noop'](_0x3c0e('0xdb'));}else{var _0x1dfc85=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x3afbf4[_0x3c0e('0xda')]);if(!_0x1dfc85){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x3afbf4,_0x3c0e('0xdc'));}this[_0x3c0e('0xf')][_0x3c0e('0xa1')](_0x1dfc85,_0x51bb12);}this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x3afbf4,_0x51bb12);return _0x3af021;};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0xae')]=function(_0x262f28){logger['info'](util[_0x3c0e('0x2b')](_0x3c0e('0x175'),_0x262f28['label']));return this['channel'][_0x3c0e('0xae')](_0x262f28['output']||_0x262f28['label']);};AGIVertices[_0x3c0e('0x11')]['pause']=function(_0x561861){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x176'),_0x561861['label']));if(!this[_0x3c0e('0x8a')](_0x561861[_0x3c0e('0x162')])){return this[_0x3c0e('0xf')]['error'](_0x561861,'no\x20find\x20by\x20configured');}logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x163'),this[_0x3c0e('0xf')]['callerid'],_0x561861[_0x3c0e('0x162')]));var _0x20e8b1=this['getPause'][_0x3c0e('0x75')](this,_0x561861[_0x3c0e('0x177')]);var _0x4013c7=this[_0x3c0e('0x54')]['sync'](this,_0x561861['findBy'],_0x20e8b1);if(_0x4013c7){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x164'),this[_0x3c0e('0xf')]['callerid'],_0x561861[_0x3c0e('0x162')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0x164'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x561861[_0x3c0e('0x162')]));return{'code':0xc8,'result':_0x3c0e('0x165')};}else{logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x561861[_0x3c0e('0x162')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x164'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x561861[_0x3c0e('0x162')]));return{'code':0xc8,'result':_0x3c0e('0x167')};}};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x178')]=function(_0x45abea){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x179'),_0x45abea[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x45abea[_0x3c0e('0x116')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x45abea,_0x3c0e('0x117'));}var _0x409cfc=this[_0x3c0e('0x118')][_0x3c0e('0x75')](this,_0x45abea[_0x3c0e('0x116')]);if(!_0x409cfc){return this['channel'][_0x3c0e('0x2f')](_0x45abea,_0x3c0e('0x119'));}var _0x5c8aec=this[_0x3c0e('0xf')]['exec']('PLAYBACK',[_0x409cfc,_0x45abea[_0x3c0e('0x112')]]);if(_0x5c8aec['result']===-0x1){return _0x5c8aec;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0x17a'),_0x3c0e('0x17b'),_0x409cfc));};AGIVertices['prototype']['queue']=function(_0x147db1){logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x17c'),_0x147db1['label']));if(!this[_0x3c0e('0x8a')](_0x147db1['queue_id'])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x147db1,_0x3c0e('0x17d'));}var _0x26a8c9='';var _0x4fb49f=parseInt(_0x147db1[_0x3c0e('0x17e')],0xa);if(isNaN(_0x4fb49f)){_0x26a8c9=_0x147db1['queue_id'];}else{_0x26a8c9=this[_0x3c0e('0x17f')][_0x3c0e('0x75')](this,_0x147db1[_0x3c0e('0x17e')]);if(!_0x26a8c9){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x147db1,_0x3c0e('0x180'));}}var _0x4fbd99='';if(this[_0x3c0e('0x8a')](_0x147db1[_0x3c0e('0x116')])){var _0x3968ef=this[_0x3c0e('0x118')]['sync'](this,_0x147db1['file_id']);if(_0x3968ef){_0x4fbd99=_0x3968ef;}}this['createSquareDetailsReport']['sync'](this,_0x147db1,_0x26a8c9);if(_0x147db1[_0x3c0e('0x112')][_0x3c0e('0x181')]('x')<0x0){_0x147db1[_0x3c0e('0x112')]+='x';}if(_0x147db1[_0x3c0e('0x112')][_0x3c0e('0x181')]('X')<0x0){_0x147db1[_0x3c0e('0x112')]+='X';}this[_0x3c0e('0xf')]['setVariable'](_0x3c0e('0x182'),_0x26a8c9?_0x26a8c9[_0x3c0e('0x183')]():'');var _0xf5e8d=this[_0x3c0e('0xf')][_0x3c0e('0x5b')](_0x3c0e('0x184'),[_0x26a8c9,_0x147db1['opts'],_0x147db1['url'],_0x4fbd99,_0x147db1['timeout'],_0x147db1[_0x3c0e('0x7')],_0x147db1[_0x3c0e('0x185')],_0x147db1[_0x3c0e('0x186')],'',_0x147db1[_0x3c0e('0x187')]]);if(_0xf5e8d[_0x3c0e('0xa8')]===-0x1){return _0xf5e8d;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('Executed\x20command\x20%s\x20%s',_0x3c0e('0x184'),_0x26a8c9));};AGIVertices['prototype'][_0x3c0e('0x188')]=function(_0x1341a1){logger[_0x3c0e('0x31')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1341a1['label']));var _0x212785=_0x1341a1['recordingFormat']||'wav';var _0x2b4d4d=util[_0x3c0e('0x2b')](_0x3c0e('0x189'),this[_0x3c0e('0xf')][_0x3c0e('0x3c')],rs[_0x3c0e('0x11e')](0x5));var _0x5aeb19=util[_0x3c0e('0x2b')](_0x3c0e('0x18a'),FILES_PATH,_0x2b4d4d,_0x212785);var _0x10b758=util[_0x3c0e('0x2b')](_0x3c0e('0x138'),FILES_PATH,_0x2b4d4d);this[_0x3c0e('0x40')]['sync'](this,_0x1341a1,_0x2b4d4d,_0x5aeb19);this[_0x3c0e('0xf')][_0x3c0e('0xa1')](_0x3c0e('0x18b'),_0x2b4d4d);logger['info'](_0x3c0e('0x18c'),_0x10b758,_0x212785,_0x1341a1[_0x3c0e('0x18d')],_0x1341a1[_0x3c0e('0x6c')]);return this[_0x3c0e('0xf')][_0x3c0e('0x13a')](_0x10b758,_0x212785,_0x1341a1['escape_digits'],_0x1341a1[_0x3c0e('0x6c')],undefined,!![]);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x18e')]=function(_0x43f1e0){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x43f1e0[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x43f1e0['url'])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0x18f'));}var _0x4a2e0a=this[_0x3c0e('0x69')][_0x3c0e('0x75')](this,_0x43f1e0);logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x190'),util[_0x3c0e('0x191')](_0x4a2e0a,{'showHidden':![],'depth':null})));if(!this[_0x3c0e('0x8a')](_0x43f1e0[_0x3c0e('0xda')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0x192'));}var _0x2ee957=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x43f1e0['variable_id']);if(!_0x2ee957){return this['channel'][_0x3c0e('0x2f')](_0x43f1e0,_0x3c0e('0xdc'));}this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0x193'),_0x2ee957),_0x4a2e0a[_0x3c0e('0x7b')]?_0x4a2e0a['statusCode']:_0x3c0e('0x194'));this[_0x3c0e('0xf')][_0x3c0e('0xa1')](util[_0x3c0e('0x2b')](_0x3c0e('0x195'),_0x2ee957),_0x4a2e0a[_0x3c0e('0x7c')]?_0x4a2e0a['statusMessage']:'OK');if(_0x4a2e0a[_0x3c0e('0x70')]){try{this[_0x3c0e('0x9e')](_0x4a2e0a[_0x3c0e('0x70')],_0x2ee957);}catch(_0x226090){logger['error'](util[_0x3c0e('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2ee957));}}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0xdf'),_0x2ee957));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x196')]=function(_0x4c6bfb){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x197'),_0x4c6bfb['label']));return this['channel'][_0x3c0e('0x198')](_0x4c6bfb[_0x3c0e('0x199')][_0x3c0e('0x5c')](/\s+/g,''),_0x4c6bfb['escape_digits']);};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x19a')]=function(_0x102ca3){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x102ca3[_0x3c0e('0x3d')]));return this['channel'][_0x3c0e('0x19b')](_0x102ca3[_0x3c0e('0x19c')]['replace'](/\s+/g,''),_0x102ca3[_0x3c0e('0x18d')]);};AGIVertices['prototype'][_0x3c0e('0x19d')]=function(_0x592318){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x19e'),_0x592318['label']));return this[_0x3c0e('0xf')]['sayPhonetic'](_0x592318['text'],_0x592318[_0x3c0e('0x18d')]);};AGIVertices[_0x3c0e('0x11')]['sendMail']=function(_0x260668){logger['info'](util[_0x3c0e('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x260668['label']));if(!this['isConfigured'](_0x260668[_0x3c0e('0x19f')])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0x1a0'));}var _0x3d9eb2=this[_0x3c0e('0x22')]['sync'](this,_0x260668['account_id']);if(!_0x3d9eb2||!_0x3d9eb2['Smtp']){return this[_0x3c0e('0xf')]['error'](_0x260668,_0x3c0e('0x1a1'));}var _0x14bdb9={'from':util['format'](_0x3c0e('0x1a2'),_0x3d9eb2[_0x3c0e('0x19')],_0x3d9eb2[_0x3c0e('0x1a3')]||_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1a5')]),'to':_0x260668['to']||'','cc':_0x260668['cc']||'','bcc':_0x260668[_0x3c0e('0x1a6')]||'','subject':_0x260668[_0x3c0e('0x1a7')],'html':_0x260668[_0x3c0e('0x60')],'text':_0x260668[_0x3c0e('0x60')]};var _0x166b8f={'tls':{'rejectUnauthorized':![]}};if(_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1a8')]){_0x166b8f[_0x3c0e('0x1a8')]=_0x3d9eb2[_0x3c0e('0x1a4')]['service'];}else{_0x166b8f[_0x3c0e('0x1a9')]=_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1a9')];_0x166b8f[_0x3c0e('0x1aa')]=_0x3d9eb2['Smtp'][_0x3c0e('0x1aa')];_0x166b8f['secure']=_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1ab')];}if(_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1ac')]){_0x166b8f[_0x3c0e('0x1ad')]={'user':_0x3d9eb2[_0x3c0e('0x1a4')][_0x3c0e('0x1a5')],'pass':_0x3d9eb2['Smtp'][_0x3c0e('0x1ae')]};}if(this['isConfigured'](_0x260668[_0x3c0e('0x1af')])){}logger['debug'](_0x3c0e('0x1b0'),JSON['stringify'](_0x14bdb9));this['createSquareDetailsReport'][_0x3c0e('0x75')](this,_0x260668,_0x260668[_0x3c0e('0x19f')]);this['channel'][_0x3c0e('0xae')](util['format'](_0x3c0e('0x1b1'),_0x3d9eb2['name']));this['sendMailMessage'][_0x3c0e('0x75')](this,_0x166b8f,_0x14bdb9);return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x1b2'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1b3')]=function(_0x1d28f6){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1b4'),_0x1d28f6[_0x3c0e('0x3d')]));return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x1b5'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1b6')]=function(_0x454e4e){logger[_0x3c0e('0x31')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x454e4e[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x454e4e[_0x3c0e('0x1b7')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('no\x20sms\x20account\x20configured');}var _0x24cd21=this[_0x3c0e('0x38')]['sync'](this,_0x454e4e['sms_account_id']);if(!_0x24cd21){return this['channel'][_0x3c0e('0x2f')](_0x454e4e,'no\x20sms\x20account\x20found');}var _0x1a5870={'body':_0x454e4e[_0x3c0e('0x1b8')],'phone':_0x454e4e['to']||'','SmsAccountId':_0x24cd21['id']};logger[_0x3c0e('0x1b9')](_0x3c0e('0x1ba'),JSON[_0x3c0e('0x77')](_0x1a5870));this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x454e4e,_0x454e4e[_0x3c0e('0x1b7')]);this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x1bb'),_0x24cd21[_0x3c0e('0x19')]));this[_0x3c0e('0x3a')][_0x3c0e('0x75')](this,_0x1a5870);return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1bc')]=function(_0x299447){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1bd'),_0x299447[_0x3c0e('0x3d')]));if(!this[_0x3c0e('0x8a')](_0x299447['variable_id'])){return this['channel']['error'](_0x299447,_0x3c0e('0x1be'));}var _0x587f6c=this[_0x3c0e('0x12')]['sync'](this,_0x299447['variable_id']);if(!_0x587f6c){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x299447,_0x3c0e('0xdc'));}return this[_0x3c0e('0xf')]['setVariable'](_0x587f6c,_0x299447['variable_value']);};AGIVertices['prototype'][_0x3c0e('0x1bf')]=function(_0x7c9ba9){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1c0'),_0x7c9ba9[_0x3c0e('0x3d')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x1c1'));if(_0x7c9ba9[_0x3c0e('0xbe')]==='yes'){this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x1c2'));return this['channel']['answer']();}return this[_0x3c0e('0xf')][_0x3c0e('0xae')]('Skipped\x20Answer');};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1c3')]=function(_0x6cb15f){logger['info'](util[_0x3c0e('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x6cb15f[_0x3c0e('0x3d')]));if(!this['isConfigured'](_0x6cb15f['project_id'])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x6cb15f,_0x3c0e('0x1c4'));}var _0x416a81=this[_0x3c0e('0x18')][_0x3c0e('0x75')](this,_0x6cb15f['project_id']);if(!this[_0x3c0e('0x8a')](_0x416a81)){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x6cb15f,util[_0x3c0e('0x2b')](_0x3c0e('0x1c5'),_0x6cb15f[_0x3c0e('0x1c6')]));}if(_0x416a81===this[_0x3c0e('0xf')][_0x3c0e('0x46')]){return this[_0x3c0e('0xf')]['error'](_0x6cb15f,_0x3c0e('0x1c7'));}this[_0x3c0e('0x3b')][_0x3c0e('0x75')](this,_0x6cb15f,_0x416a81);var _0x4846bc=this[_0x3c0e('0xf')][_0x3c0e('0x5b')](_0x3c0e('0x1c8'),util['format'](_0x3c0e('0x1c9'),config[_0x3c0e('0x7')]['host']||_0x3c0e('0x1ca'),_0x416a81,this[_0x3c0e('0xf')][_0x3c0e('0x46')]));if(_0x4846bc['result']===-0x1){return _0x4846bc;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x17a'),'AGI',_0x416a81));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1cb')]=function(_0x445443){logger['info'](util['format'](_0x3c0e('0x1cc'),_0x445443['label']));var _0x2b913b=this[_0x3c0e('0x5a')][_0x3c0e('0x75')](this,_0x445443['command']);this['createSquareDetailsReport'][_0x3c0e('0x75')](this,_0x445443,_0x445443['command']);if(this[_0x3c0e('0x8a')](_0x445443[_0x3c0e('0xda')])){var _0x27f1c8=this['getVariable']['sync'](this,_0x445443[_0x3c0e('0xda')]);if(_0x27f1c8){this[_0x3c0e('0xf')][_0x3c0e('0xa1')](_0x27f1c8,_0x2b913b);return this['channel'][_0x3c0e('0xae')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x445443[_0x3c0e('0xbc')],_0x27f1c8));}}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x1cd'),_0x445443[_0x3c0e('0xbc')]));};AGIVertices[_0x3c0e('0x11')]['google_cloud_tts']=function(_0x22a234){logger['info'](util[_0x3c0e('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x22a234[_0x3c0e('0x3d')]));_0x22a234[_0x3c0e('0x60')]=_0x22a234['text'][_0x3c0e('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x22a234[_0x3c0e('0x5e')])){return this[_0x3c0e('0xf')][_0x3c0e('0xae')](_0x3c0e('0x1ce'));}if(!this[_0x3c0e('0x8a')](_0x22a234[_0x3c0e('0x60')])){return this[_0x3c0e('0xf')]['noop'](_0x3c0e('0xac'));}this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x1cf'),_0x22a234['text']));var _0x162577=this[_0x3c0e('0x5d')]['sync'](this,_0x22a234);if(_0x162577){this[_0x3c0e('0xf')]['noop'](util[_0x3c0e('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x162577));var _0x28ab3d=this[_0x3c0e('0xf')]['streamFile'](_0x162577);try{fs[_0x3c0e('0x12a')](_0x162577+_0x3c0e('0x106'));}catch(_0x26129a){logger[_0x3c0e('0x2f')](_0x26129a);}return _0x28ab3d;}return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x22a234,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1d0')]=function(_0xd39501){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1d1'),_0xd39501[_0x3c0e('0x3d')]));_0xd39501[_0x3c0e('0x60')]=_0xd39501[_0x3c0e('0x60')][_0x3c0e('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3c0e('0x8a')](_0xd39501[_0x3c0e('0x60')])){return this['channel'][_0x3c0e('0xae')](_0x3c0e('0xac'));}this['channel']['noop'](util[_0x3c0e('0x2b')](_0x3c0e('0x1d2'),_0xd39501['text']));var _0x4d8e8e=this[_0x3c0e('0x67')][_0x3c0e('0x75')](this,_0xd39501);if(_0x4d8e8e){this[_0x3c0e('0xf')][_0x3c0e('0xae')](util['format'](_0x3c0e('0x1d3'),_0x4d8e8e));var _0x6ae488=this['channel'][_0x3c0e('0x105')](_0x4d8e8e);try{fs[_0x3c0e('0x12a')](_0x4d8e8e+_0x3c0e('0x106'));}catch(_0x3c378b){logger[_0x3c0e('0x2f')](_0x3c378b);}return _0x6ae488;}return this[_0x3c0e('0xf')]['error'](_0xd39501,_0x3c0e('0x1d4'));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1d5')]=function(_0x253408){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1d6'),_0x253408['label']));if(!this[_0x3c0e('0x8a')](_0x253408[_0x3c0e('0x162')])){return this[_0x3c0e('0xf')]['error'](_0x253408,'no\x20find\x20by\x20configured');}logger[_0x3c0e('0x31')](util['format'](_0x3c0e('0x163'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x253408[_0x3c0e('0x162')]));var _0x523a87=this[_0x3c0e('0x55')][_0x3c0e('0x75')](this,_0x253408[_0x3c0e('0x162')]);if(_0x523a87){logger['info'](util[_0x3c0e('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x253408[_0x3c0e('0x162')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x164'),this['channel']['callerid'],_0x253408[_0x3c0e('0x162')]));return{'code':0xc8,'result':_0x3c0e('0x165')};}else{logger['info'](util[_0x3c0e('0x2b')](_0x3c0e('0x166'),this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x253408[_0x3c0e('0x162')]));this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c0e('0xf')][_0x3c0e('0x3f')],_0x253408[_0x3c0e('0x162')]));return{'code':0xc8,'result':_0x3c0e('0x167')};}};AGIVertices['prototype'][_0x3c0e('0x1d7')]=function(_0x1297fd){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')](_0x3c0e('0x1d8'),_0x1297fd[_0x3c0e('0x3d')]));var _0x3c6332=this[_0x3c0e('0xf')]['exec'](_0x3c0e('0x1d9'),[_0x1297fd[_0x3c0e('0x1da')],_0x1297fd['options']]);if(_0x3c6332[_0x3c0e('0xa8')]===-0x1){return _0x3c6332;}return this[_0x3c0e('0xf')][_0x3c0e('0xae')](util[_0x3c0e('0x2b')](_0x3c0e('0x17a'),_0x3c0e('0x1d9'),_0x1297fd['mailbox']));};AGIVertices[_0x3c0e('0x11')][_0x3c0e('0x1db')]=function(_0x27ddc2){logger[_0x3c0e('0x31')](util[_0x3c0e('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x27ddc2[_0x3c0e('0x3d')]));if(!this['isConfigured'](_0x27ddc2[_0x3c0e('0xda')])){return this[_0x3c0e('0xf')][_0x3c0e('0x2f')](_0x27ddc2,'no\x20variable\x20selected');}var _0x490e6e=this[_0x3c0e('0x12')][_0x3c0e('0x75')](this,_0x27ddc2[_0x3c0e('0xda')]);if(!_0x490e6e){return this[_0x3c0e('0xf')]['error'](_0x27ddc2,'no\x20variable\x20found');}var _0x3ea41a=this[_0x3c0e('0xf')][_0x3c0e('0x12')](_0x490e6e);return{'code':0xc8,'result':_0x3ea41a[_0x3c0e('0xa5')]?_0x3ea41a[_0x3c0e('0xa5')]:'-'};};String['prototype']['replaceAll']=function(_0x77addd,_0x3ea534){return this['split'](_0x77addd)[_0x3c0e('0x1dc')](_0x3ea534);};module[_0x3c0e('0x1dd')]=AGIVertices;
\ No newline at end of file
+var _0x9815=['agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','uri','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','replaceAllVariables','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','isConfigured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','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','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','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','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','email','user','bcc','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','shelljs','randomstring','moment','mustache','../../config/logger'];(function(_0xb476e8,_0x213e41){var _0x2db72c=function(_0x46692e){while(--_0x46692e){_0xb476e8['push'](_0xb476e8['shift']());}};_0x2db72c(++_0x213e41);}(_0x9815,0x1cb));var _0x5981=function(_0x36c295,_0x598cca){_0x36c295=_0x36c295-0x0;var _0x411196=_0x9815[_0x36c295];return _0x411196;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x5981('0x0'));var _=require(_0x5981('0x1'));var sh=require(_0x5981('0x2'));var odbc=require('odbc')();var rs=require(_0x5981('0x3'));var moment=require(_0x5981('0x4'));var Mustache=require(_0x5981('0x5'));var rp=require('request-promise');var logger=require(_0x5981('0x6'))(_0x5981('0x7'));var config=require(_0x5981('0x8'));var scripts=require(_0x5981('0x9'));var FILES_PATH=_0x5981('0xa');var recursiveMapAttributes=['rawHeaders',_0x5981('0xb')];var verticesWithRetry=[_0x5981('0xc'),'getdigits',_0x5981('0xd')];var AGIVertices=function(_0x3a69be,_0x305c4f,_0x35bf2f){this['channel']=_0x3a69be;this[_0x5981('0xe')]=_0x305c4f;this[_0x5981('0xf')]=_0x35bf2f;};AGIVertices[_0x5981('0x10')][_0x5981('0x11')]=function(_0x442f96,_0x58229f){this[_0x5981('0xe')]['getVariableById'](_0x442f96)[_0x5981('0x12')](function(_0x428f7f){_0x58229f(null,_0x428f7f?_0x428f7f[_0x5981('0x13')]:![]);})[_0x5981('0x14')](function(_0x1ea305){_0x58229f(_0x1ea305);});};AGIVertices[_0x5981('0x10')][_0x5981('0x15')]=function(_0x50003a,_0x543a2f){this[_0x5981('0xe')][_0x5981('0x16')](_0x50003a)[_0x5981('0x12')](function(_0x49eed4){_0x543a2f(null,_0x49eed4?_0x49eed4[_0x5981('0x13')]:![]);})[_0x5981('0x14')](function(_0x2bc531){_0x543a2f(_0x2bc531);});};AGIVertices[_0x5981('0x10')][_0x5981('0x17')]=function(_0x412524,_0x3ad3ad){this[_0x5981('0xe')]['getSquareProjectById'](_0x412524)[_0x5981('0x12')](function(_0x186325){_0x3ad3ad(null,_0x186325?_0x186325[_0x5981('0x13')]:![]);})['catch'](function(_0x33560b){_0x3ad3ad(_0x33560b);});};AGIVertices[_0x5981('0x10')][_0x5981('0x18')]=function(_0x3c4f0b,_0x1c487f){this[_0x5981('0xe')][_0x5981('0x19')](_0x3c4f0b)[_0x5981('0x12')](function(_0x2225f3){_0x1c487f(null,_0x2225f3?_0x2225f3['dsn']:![]);})[_0x5981('0x14')](function(_0x23d2c3){_0x1c487f(_0x23d2c3);});};AGIVertices['prototype'][_0x5981('0x1a')]=function(_0x2a26a8,_0x592d3f){this[_0x5981('0xe')][_0x5981('0x1b')](_0x2a26a8)[_0x5981('0x12')](function(_0x4b2dc1){_0x592d3f(null,_0x4b2dc1?_0x4b2dc1[_0x5981('0x13')]:![]);})[_0x5981('0x14')](function(_0xa7bbf6){_0x592d3f(_0xa7bbf6);});};AGIVertices[_0x5981('0x10')][_0x5981('0x1c')]=function(_0x4804cd,_0x2aed6f){this[_0x5981('0xe')][_0x5981('0x1d')](_0x4804cd)[_0x5981('0x12')](function(_0x31bd3a){_0x2aed6f(null,_0x31bd3a?_0x31bd3a[_0x5981('0x13')]:![]);})[_0x5981('0x14')](function(_0x1bb987){_0x2aed6f(_0x1bb987);});};AGIVertices['prototype'][_0x5981('0x1e')]=function(_0x22f551,_0x3bf37f){var _0x2648ec=this;this[_0x5981('0xe')]['getSoundById'](_0x22f551)[_0x5981('0x12')](function(_0x11e8e8){_0x3bf37f(null,_0x11e8e8?_0x2648ec[_0x5981('0x1f')](_0x11e8e8[_0x5981('0x20')]):![]);})[_0x5981('0x14')](function(_0x498ca4){_0x3bf37f(_0x498ca4);});};AGIVertices[_0x5981('0x10')][_0x5981('0x21')]=function(_0x5dd49d,_0x561826){this[_0x5981('0xe')]['getMailAccountById'](_0x5dd49d)[_0x5981('0x12')](function(_0x44e86f){_0x561826(null,_0x44e86f?_0x44e86f:![]);})[_0x5981('0x14')](function(_0x5d7cf0){_0x561826(_0x5d7cf0);});};AGIVertices[_0x5981('0x10')][_0x5981('0x22')]=function(_0x51be6b,_0x235e9d,_0xaba0a7){this[_0x5981('0xf')][_0x5981('0x22')](_0x51be6b,_0x235e9d)['then'](function(){_0xaba0a7(null);})[_0x5981('0x14')](function(_0xc687b){_0xaba0a7(_0xc687b);});};AGIVertices['prototype'][_0x5981('0x23')]=function(_0x5c6320,_0x4cb16d){this[_0x5981('0xe')]['getIntervalById'](_0x5c6320)[_0x5981('0x12')](function(_0x455f2e){if(_0x455f2e){if(_0x455f2e[_0x5981('0x24')]){_0x4cb16d(null,[_0x455f2e[_0x5981('0x25')]]);}else{_0x4cb16d(null,_[_0x5981('0x26')](_0x455f2e['Intervals'],_0x5981('0x25')));}}else{_0x4cb16d(null,![]);}})[_0x5981('0x14')](function(_0xe39d78){_0x4cb16d(_0xe39d78);});};AGIVertices[_0x5981('0x10')][_0x5981('0x1f')]=function(_0x45efec){return util['format'](_0x5981('0x27'),FILES_PATH,_0x45efec);};AGIVertices['prototype'][_0x5981('0x28')]=function(_0x2f29ff,_0x3e9f84,_0x42aff9){odbc[_0x5981('0x29')](_0x2f29ff,function(_0x32b2df){if(_0x32b2df){logger[_0x5981('0x2a')](_0x5981('0x2b'),_0x32b2df);_0x42aff9(_0x32b2df);}else{logger['info'](_0x5981('0x2c'));odbc[_0x5981('0x2d')](_0x3e9f84,function(_0x53cca3,_0x198e8c){if(_0x53cca3){logger['info'](_0x5981('0x2e'),_0x3e9f84);_0x42aff9(_0x53cca3);}else{logger[_0x5981('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x3e9f84);odbc['close'](function(_0x10de06){if(_0x10de06){logger['error'](_0x5981('0x30'),_0x10de06);}_0x42aff9(null,_0x198e8c);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x209097,_0x1ab8b8){this[_0x5981('0xe')]['getSmsAccountById'](_0x209097)[_0x5981('0x12')](function(_0x11341e){_0x1ab8b8(null,_0x11341e?_0x11341e:![]);})[_0x5981('0x14')](function(_0x3a9aa9){_0x1ab8b8(_0x3a9aa9);});};AGIVertices[_0x5981('0x10')][_0x5981('0x31')]=function(_0x161b70,_0x2dc06c){this[_0x5981('0xe')][_0x5981('0x31')](_0x161b70)[_0x5981('0x12')](function(_0x16be7b){_0x2dc06c(null,_0x16be7b);})[_0x5981('0x14')](function(_0x6b0426){_0x2dc06c(_0x6b0426);});};AGIVertices[_0x5981('0x10')][_0x5981('0x32')]=function(_0x3a6503,_0x485e28,_0x2999af){this[_0x5981('0xe')][_0x5981('0x32')]({'uniqueid':this[_0x5981('0x33')][_0x5981('0x34')],'node':_0x3a6503[_0x5981('0x35')],'application':_0x3a6503[_0x5981('0x36')],'data':_0x485e28||null,'project_name':this[_0x5981('0x33')][_0x5981('0x37')],'callerid':this[_0x5981('0x33')]['callerid']})[_0x5981('0x12')](function(_0x5b9f1c){if(_0x2999af){_0x2999af(null,_0x5b9f1c);}})[_0x5981('0x14')](function(_0x23e40e){if(_0x2999af){_0x2999af(_0x23e40e);}});};AGIVertices[_0x5981('0x10')][_0x5981('0x38')]=function(_0x29a007,_0x536c85,_0x201612,_0x5d1974){this[_0x5981('0xe')][_0x5981('0x38')]({'uniqueid':this[_0x5981('0x33')][_0x5981('0x34')],'callerid':this[_0x5981('0x33')][_0x5981('0x39')],'calleridname':this[_0x5981('0x33')][_0x5981('0x3a')],'context':this['channel'][_0x5981('0x3b')],'extension':this['channel'][_0x5981('0x3c')],'priority':this[_0x5981('0x33')][_0x5981('0x3d')],'accountcode':this[_0x5981('0x33')][_0x5981('0x3e')],'dnid':this[_0x5981('0x33')][_0x5981('0x3f')],'projectName':this[_0x5981('0x33')][_0x5981('0x37')],'saveName':_0x536c85,'filename':_0x29a007[_0x5981('0x40')]||_0x536c85,'savePath':_0x201612})[_0x5981('0x12')](function(_0x4633b4){_0x5d1974(null,_0x4633b4);})[_0x5981('0x14')](function(_0x2234af){_0x5d1974(_0x2234af);});};AGIVertices[_0x5981('0x10')][_0x5981('0x41')]=function(_0x510822,_0x5459ab,_0x15e57e,_0x502050,_0x38c199){this[_0x5981('0xe')][_0x5981('0x41')]({'uniqueid':this[_0x5981('0x33')]['uniqueid'],'body':_0x510822,'direction':_0x5459ab,'providerName':_0x15e57e,'providerResponse':_0x502050})[_0x5981('0x12')](function(_0x819047){if(_0x38c199){_0x38c199(null,_0x819047);}})[_0x5981('0x14')](function(_0x4ea895){if(_0x38c199){_0x38c199(_0x4ea895);}});};AGIVertices[_0x5981('0x10')][_0x5981('0x42')]=function(_0x5b6b9b,_0x20a9a9){this[_0x5981('0xe')][_0x5981('0x42')]({'firstName':_[_0x5981('0x43')](_0x5b6b9b[_0x5981('0x13')])||_[_0x5981('0x44')](_0x5b6b9b[_0x5981('0x13')])?'callback_'+Math[_0x5981('0x45')]():_0x5b6b9b['name'],'lastName':_['isEmpty'](_0x5b6b9b[_0x5981('0x46')])||_[_0x5981('0x44')](_0x5b6b9b[_0x5981('0x46')])?null:_0x5b6b9b[_0x5981('0x46')],'phone':_0x5b6b9b[_0x5981('0x47')],'ListId':_0x5b6b9b[_0x5981('0x48')],'scheduledat':_0x5b6b9b[_0x5981('0x49')],'callbackUniqueid':this[_0x5981('0x33')][_0x5981('0x34')],'tags':_0x5981('0x4a'),'description':_0x5981('0x4b')+_0x5b6b9b['scheduledAt'][_0x5981('0x4c')](),'priority':_0x5b6b9b[_0x5981('0x4d')]})[_0x5981('0x12')](function(_0x5f16f8){_0x20a9a9(null,_0x5f16f8);})[_0x5981('0x14')](function(_0x52b677){_0x20a9a9(_0x52b677);});};AGIVertices[_0x5981('0x10')][_0x5981('0x4e')]=function(_0x2b1c10,_0x2d248e){this['rpc'][_0x5981('0x4f')](_0x2b1c10)['then'](function(_0x7b9d12){_0x2d248e(null,_0x7b9d12?_0x7b9d12[_0x5981('0x13')]:![]);})[_0x5981('0x14')](function(_0x552575){_0x2d248e(_0x552575);});};AGIVertices[_0x5981('0x10')][_0x5981('0x50')]=function(_0x274003,_0x52ff29,_0x2e0367){var _0x5cb1dd={'role':_0x5981('0x51')};_0x5cb1dd[_0x274003]=this[_0x5981('0x33')]['callerid'];this[_0x5981('0xe')][_0x5981('0x50')](_0x5cb1dd,_0x52ff29,this[_0x5981('0x33')]['uniqueid'])['then'](function(_0xd5dfe8){_0x2e0367(null,_[_0x5981('0x44')](_0xd5dfe8)?![]:!![]);})[_0x5981('0x14')](function(_0x2e2d7c){logger['error'](_0x2e2d7c);_0x2e0367(null,![]);});};AGIVertices[_0x5981('0x10')]['agentUnpause']=function(_0x24f2f6,_0x338039){var _0x238f33={'role':_0x5981('0x51')};_0x238f33[_0x24f2f6]=this[_0x5981('0x33')]['callerid'];this['rpc'][_0x5981('0x52')](_0x238f33)[_0x5981('0x12')](function(_0x1e16e7){_0x338039(null,_[_0x5981('0x44')](_0x1e16e7)?![]:!![]);})[_0x5981('0x14')](function(_0x562744){logger[_0x5981('0x2a')](_0x562744);_0x338039(null,![]);});};AGIVertices['prototype'][_0x5981('0x53')]=function(_0x21e785,_0xc19e11){var _0x77145={'role':_0x5981('0x51')};_0x77145[_0x21e785]=this['channel'][_0x5981('0x39')];this[_0x5981('0xe')][_0x5981('0x53')](_0x77145)[_0x5981('0x12')](function(_0x5ec8ea){_0xc19e11(null,_[_0x5981('0x44')](_0x5ec8ea)?![]:!![]);})[_0x5981('0x14')](function(_0x9f45e2){logger['error'](_0x9f45e2);_0xc19e11(null,![]);});};AGIVertices[_0x5981('0x10')][_0x5981('0x54')]=function(_0x4983a2,_0x3ae055){var _0x3bafdc={'role':_0x5981('0x51')};_0x3bafdc[_0x4983a2]=this[_0x5981('0x33')]['callerid'];var _0x3ba560=_0x4983a2!=_0x5981('0x55')?util[_0x5981('0x56')](_0x5981('0x57'),_0x5981('0x58'),this[_0x5981('0x33')]['callerid']):undefined;this[_0x5981('0xe')][_0x5981('0x54')](_0x3bafdc,_0x3ba560)[_0x5981('0x12')](function(_0x7a5063){_0x3ae055(null,_['isNil'](_0x7a5063)?![]:!![]);})[_0x5981('0x14')](function(_0x4640b0){logger[_0x5981('0x2a')](_0x4640b0);_0x3ae055(null,![]);});};AGIVertices[_0x5981('0x10')][_0x5981('0x59')]=function(_0x56cadd,_0x7ea4e6){sh[_0x5981('0x5a')](_[_0x5981('0x5b')](_0x56cadd),function(_0x756169,_0x33b90b){var _0x310a32=_0x33b90b[_0x5981('0x5c')](/(\r\n|\n|\r)/gm,'');_0x7ea4e6(null,_0x310a32);});};AGIVertices[_0x5981('0x10')][_0x5981('0x5d')]=function(_0x15e03f,_0x4d3b24){scripts[_0x5981('0x5d')](_0x15e03f['apiKey'],_0x15e03f[_0x5981('0x5e')]||_0x5981('0x5f'),_0x15e03f['text'],_0x15e03f[_0x5981('0x60')]||'en-US',_0x15e03f[_0x5981('0x61')]||_0x5981('0x62'),_0x15e03f[_0x5981('0x63')]||_0x5981('0x64'))[_0x5981('0x12')](function(_0x52bb1d){_0x4d3b24(null,_0x52bb1d);})[_0x5981('0x14')](function(_0x4db41c){_0x4d3b24(_0x4db41c);});};AGIVertices[_0x5981('0x10')][_0x5981('0x65')]=function(_0x493972,_0x3d5b52){scripts[_0x5981('0x65')](_0x493972['text'],_0x493972[_0x5981('0x66')]||'en',0x1)[_0x5981('0x12')](function(_0x33dc2f){_0x3d5b52(null,_0x33dc2f);})[_0x5981('0x14')](function(_0x1d7cd2){_0x3d5b52(_0x1d7cd2);});};AGIVertices[_0x5981('0x10')]['restAPI']=function(_0x33d1f4,_0x7d0e79){var _0x1d92bc={'uri':_0x33d1f4[_0x5981('0x67')],'method':_0x33d1f4[_0x5981('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x33d1f4[_0x5981('0x69')])===_0x5981('0x6a')&&parseInt(_0x33d1f4['timeout'])>=0x1?parseInt(_0x33d1f4[_0x5981('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x5981('0x6b')]([_0x5981('0x6c'),_0x5981('0x6d')],_0x1d92bc[_0x5981('0x68')]['toUpperCase']())){try{_0x1d92bc[_0x5981('0x6e')]=_0x33d1f4['rawBody']?JSON[_0x5981('0x6f')](_0x33d1f4[_0x5981('0xb')]):{};}catch(_0x62ec3b){logger[_0x5981('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x62ec3b);}}try{_0x1d92bc[_0x5981('0x70')]=_0x33d1f4[_0x5981('0x71')]?JSON[_0x5981('0x6f')](_0x33d1f4[_0x5981('0x71')]):{};}catch(_0x35ff70){logger[_0x5981('0x2a')](_0x5981('0x72'),_0x35ff70);}if(_0x33d1f4[_0x5981('0x73')]){try{var _0x3fe3da=require(_0x33d1f4[_0x5981('0x73')])[_0x5981('0x74')](this,_0x1d92bc);_0x1d92bc['uri']=Mustache[_0x5981('0x75')](_0x33d1f4[_0x5981('0x67')],_0x3fe3da,{},['$$','$$']);if(_0x1d92bc[_0x5981('0x70')]){_0x1d92bc['headers']=JSON[_0x5981('0x6f')](Mustache[_0x5981('0x75')](JSON[_0x5981('0x76')](_0x1d92bc[_0x5981('0x70')]),_0x3fe3da,{},['$$','$$']));}if(_0x1d92bc[_0x5981('0x6e')]){_0x1d92bc[_0x5981('0x6e')]=JSON['parse'](Mustache['render'](JSON['stringify'](_0x1d92bc['body']),_0x3fe3da,{},['$$','$$']));}}catch(_0x4531b1){logger[_0x5981('0x2a')](_0x5981('0x77'),_0x4531b1);}}rp(_0x1d92bc)[_0x5981('0x12')](function(_0x48eee9){var _0x309729={'statusCode':_0x48eee9[_0x5981('0x78')]||0xc8,'statusMessage':_0x48eee9[_0x5981('0x79')]||'OK','headers':_0x48eee9[_0x5981('0x70')]||{},'body':_0x48eee9[_0x5981('0x6e')]||{}};_0x7d0e79(null,_0x309729);})['catch'](function(_0x128697){var _0x4120b2={'statusCode':_0x128697[_0x5981('0x78')]||0x1f4,'statusMessage':_0x128697[_0x5981('0x7a')]||_0x5981('0x7b'),'headers':_0x128697[_0x5981('0x7c')]['headers']||{},'body':_0x128697['options'][_0x5981('0x6e')]||{}};_0x7d0e79(null,_0x4120b2);});};AGIVertices['prototype'][_0x5981('0x7d')]=function(_0x4409d6,_0x40bfdd){scripts['googleDialogflow'](this[_0x5981('0x33')][_0x5981('0x34')],_0x4409d6[_0x5981('0x7e')],_0x4409d6['text'],_0x4409d6[_0x5981('0x7f')]||'en')['then'](function(_0x5956c1){_0x40bfdd(null,_0x5956c1);})[_0x5981('0x14')](function(_0x1e6abd){_0x40bfdd(_0x1e6abd);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x16b6e3,_0x5c2c19){scripts[_0x5981('0x80')](this['channel'][_0x5981('0x34')],_0x16b6e3[_0x5981('0x81')],_0x16b6e3[_0x5981('0x82')],_0x16b6e3[_0x5981('0x83')],_0x16b6e3[_0x5981('0x5f')],_0x16b6e3[_0x5981('0x84')]||'en')[_0x5981('0x12')](function(_0x1a90e1){_0x5c2c19(null,_0x1a90e1);})['catch'](function(_0x1bd3d){_0x5c2c19(_0x1bd3d);});};AGIVertices[_0x5981('0x10')][_0x5981('0x85')]=function(_0x3b92db,_0x589de3){scripts[_0x5981('0x85')](this[_0x5981('0x33')],_0x3b92db)[_0x5981('0x12')](function(_0x2f963b){_0x589de3(null,_0x2f963b);})[_0x5981('0x14')](function(_0x2e4ded){_0x589de3(_0x2e4ded);});};AGIVertices['prototype'][_0x5981('0x86')]=function(_0x3aba15,_0x27fa1a){scripts[_0x5981('0x86')](_0x3aba15['key'],_0x3aba15[_0x5981('0x5f')],_0x3aba15['ispeech_tts_language']||_0x5981('0x87'),_0x3aba15[_0x5981('0x88')])[_0x5981('0x12')](function(_0x431cb5){_0x27fa1a(null,_0x431cb5);})['catch'](function(_0x3faf28){_0x27fa1a(_0x3faf28);});};AGIVertices[_0x5981('0x10')][_0x5981('0x89')]=function(_0x115682,_0x4ab64e,_0x276b7c){scripts[_0x5981('0x89')](_0x4ab64e,_0x115682[_0x5981('0x7e')],_0x115682['ispeech_asr_language']||_0x5981('0x87'),this['isConfigured'](_0x115682[_0x5981('0x8a')])?_0x115682[_0x5981('0x8a')]:undefined)[_0x5981('0x12')](function(_0x3a7ff1){_0x276b7c(null,_0x3a7ff1);})[_0x5981('0x14')](function(_0xee9ef9){_0x276b7c(_0xee9ef9);});};AGIVertices[_0x5981('0x10')][_0x5981('0x8b')]=function(_0x494916,_0x36ff04){scripts[_0x5981('0x8b')](_0x494916[_0x5981('0x8c')],_0x494916[_0x5981('0x8d')],_0x494916['aws_polly_region'],_0x494916[_0x5981('0x8e')]||_0x5981('0x8f'),_0x494916[_0x5981('0x5f')],_0x494916[_0x5981('0x90')]||_0x5981('0x5f'))[_0x5981('0x12')](function(_0x519c4b){_0x36ff04(null,_0x519c4b);})['catch'](function(_0x543df0){_0x36ff04(_0x543df0);});};AGIVertices[_0x5981('0x10')][_0x5981('0x91')]=function(_0x512f80,_0x2ae81b){scripts[_0x5981('0x91')](this[_0x5981('0x33')][_0x5981('0x34')],_0x512f80[_0x5981('0x8c')],_0x512f80[_0x5981('0x8d')],_0x512f80[_0x5981('0x92')],_0x512f80['text'],_0x512f80[_0x5981('0x93')])['then'](function(_0x2b8715){_0x2ae81b(null,_0x2b8715);})['catch'](function(_0x96186f){_0x2ae81b(_0x96186f);});};AGIVertices[_0x5981('0x10')]['googleASR']=function(_0x6596bd,_0x425e24,_0x528f9e){scripts[_0x5981('0x94')](_0x425e24,_0x6596bd[_0x5981('0x7e')],_0x6596bd['google_asr_language']||_0x5981('0x87'))[_0x5981('0x12')](function(_0x2a1543){_0x528f9e(null,_0x2a1543);})['catch'](function(_0x24aba7){_0x528f9e(_0x24aba7);});};AGIVertices[_0x5981('0x10')][_0x5981('0x95')]=function(_0x204b16,_0x3951d1,_0x5e277c){scripts[_0x5981('0x95')](_0x3951d1,_0x204b16[_0x5981('0x96')],_0x204b16['appsecret'],_0x204b16[_0x5981('0x97')])['then'](function(_0x38735d){_0x5e277c(null,_0x38735d);})[_0x5981('0x14')](function(_0x150b83){_0x5e277c(_0x150b83);});};AGIVertices['prototype']['clear']=function(_0x5b1754){var _0x146933=_[_0x5981('0x6b')](verticesWithRetry,_0x5b1754[_0x5981('0x36')])?_0x5b1754:_[_0x5981('0x98')](_0x5b1754);for(var _0x265193 in _0x146933){if(_0x146933['hasOwnProperty'](_0x265193)){if(_0x146933[_0x265193]&&_[_0x5981('0x99')](_0x146933[_0x265193])){if(_[_0x5981('0x6b')](recursiveMapAttributes,_0x265193)){_0x146933[_0x265193]=this[_0x5981('0x9a')](_0x146933[_0x265193]);}else{_0x146933[_0x265193]=this['replaceAllVariables'](_0x146933[_0x265193]);}}}}return _0x146933;};AGIVertices[_0x5981('0x10')][_0x5981('0x9b')]=function(_0x2fd270){for(var _0x9c59df in _0x2fd270){if(_0x2fd270['hasOwnProperty'](_0x9c59df)){if(_[_0x5981('0x9c')](_0x2fd270[_0x9c59df])){this[_0x5981('0x9b')](_0x2fd270[_0x9c59df]);}else if(_[_0x5981('0x9d')](_0x2fd270[_0x9c59df])){for(var _0x4b3103=0x0;_0x4b3103<_0x2fd270[_0x9c59df][_0x5981('0x9e')];_0x4b3103++){this['recursiveNodeIndex'](_0x2fd270[_0x9c59df][_0x4b3103]);}}else if(_['isString'](_0x2fd270[_0x9c59df])){_0x2fd270[_0x9c59df]=this['replaceAllVariables'](_0x2fd270[_0x9c59df]);}}}};AGIVertices[_0x5981('0x10')]['saveRestApiResult']=function(_0x1d9923,_0x47ef7d){for(var _0x3a776f in _0x1d9923){if(_0x1d9923['hasOwnProperty'](_0x3a776f)){if(_[_0x5981('0x9c')](_0x1d9923[_0x3a776f])){if(!_[_0x5981('0x43')](_0x1d9923[_0x3a776f])){this['saveRestApiResult'](_0x1d9923[_0x3a776f],util[_0x5981('0x56')](_0x5981('0x9f'),_0x47ef7d,_0x3a776f));}}else if(_['isArray'](_0x1d9923[_0x3a776f])){for(var _0x56e1f8=0x0;_0x56e1f8<_0x1d9923[_0x3a776f]['length'];_0x56e1f8++){this[_0x5981('0xa0')](_0x1d9923[_0x3a776f][_0x56e1f8],util[_0x5981('0x56')](_0x5981('0x9f'),_0x47ef7d,_0x3a776f+'['+_0x56e1f8+']'));}}else{if(!_['isNil'](_0x1d9923[_0x3a776f])){this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')]('%s.%s',_0x47ef7d,_0x3a776f),_0x1d9923[_0x3a776f]);}}}}};AGIVertices[_0x5981('0x10')][_0x5981('0x9a')]=function(_0x36b6f3){try{var _0x23143f=JSON[_0x5981('0x6f')](_0x36b6f3);this[_0x5981('0x9b')](_0x23143f);return JSON[_0x5981('0x76')](_0x23143f);}catch(_0x221e8c){return this[_0x5981('0xa2')](_0x36b6f3);}};AGIVertices[_0x5981('0x10')][_0x5981('0xa2')]=function(_0x23f7cd){var _0x5f3cbc=_0x23f7cd[_0x5981('0xa3')]('{');for(var _0x3b585b=0x1;_0x3b585b<_0x5f3cbc[_0x5981('0x9e')];_0x3b585b+=0x1){var _0x363bba=_0x5f3cbc[_0x3b585b][_0x5981('0xa3')]('}');if(_0x363bba[_0x5981('0x9e')]>0x1){_0x23f7cd=_0x23f7cd['replaceAll']('{'+_0x363bba[0x0]+'}',this[_0x5981('0x33')][_0x5981('0x11')](_0x363bba[0x0])[_0x5981('0xa4')]||_0x363bba[0x0]);}}if(_0x5f3cbc[_0x5981('0x9e')]===0x1){return _0x23f7cd[_0x5981('0x4c')]();}return this[_0x5981('0xa2')](_0x23f7cd);};AGIVertices[_0x5981('0x10')][_0x5981('0xa5')]=function(_0x109286,_0x1dc3bb){var _0xdd82f=this[_0x5981('0x33')][_0x5981('0x11')](_0x109286);if(_0xdd82f[_0x5981('0xa6')]===-0x1){return _0xdd82f;}logger['info'](util['format'](_0x5981('0xa7'),_0x1dc3bb,_0xdd82f[_0x5981('0xa4')]));return this[_0x5981('0x33')]['setVariable'](_0x1dc3bb,_0xdd82f[_0x5981('0xa4')]);};AGIVertices[_0x5981('0x10')]['isConfigured']=function(_0x4c8943){return _0x4c8943&&_0x4c8943!=='0'&&_0x4c8943!=='-1'&&_0x4c8943!=='';};AGIVertices['prototype'][_0x5981('0xa8')]=function(_0x1b04bb){this[_0x5981('0x32')]['sync'](this,_0x1b04bb,'-');_0x1b04bb['retry']=_0x1b04bb[_0x5981('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x5981('0xa9')]=function(_0x50d8ff){logger[_0x5981('0x2f')](util['format'](_0x5981('0xaa'),_0x50d8ff[_0x5981('0x35')]));if(!this['isConfigured'](_0x50d8ff[_0x5981('0x5f')])){return this[_0x5981('0x33')]['noop'](_0x5981('0xab'));}var _0x2c24a4='\x22'+_0x50d8ff[_0x5981('0x5f')]+'\x22';if(this[_0x5981('0xac')](_0x50d8ff['options'])){_0x2c24a4+=','+_0x50d8ff[_0x5981('0x7c')];}var _0xc9c47e=this['channel']['exec']('MRCPSynth',_0x2c24a4);if(_0xc9c47e['result']===-0x1){return _0xc9c47e;}return this['channel'][_0x5981('0xad')](util['format'](_0x5981('0xae'),_0x2c24a4));};AGIVertices[_0x5981('0x10')][_0x5981('0xaf')]=function(_0x5468bd){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xb0'),_0x5468bd[_0x5981('0x35')]));if(!this['isConfigured'](_0x5468bd[_0x5981('0xb1')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xb2'));}var _0xe62949=_0x5468bd[_0x5981('0xb1')];if(this[_0x5981('0xac')](_0x5468bd[_0x5981('0x7c')])){_0xe62949+=','+_0x5468bd[_0x5981('0x7c')];}var _0x4ba069=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0xb3'),_0xe62949);if(_0x4ba069['result']===-0x1){return _0x4ba069;}var _0x14e3a2=this['getAndSetVariable'](_0x5981('0xb4'),_0x5981('0xb5'));if(_0x14e3a2[_0x5981('0xa6')]===-0x1){return _0x14e3a2;}var _0xb82202=this[_0x5981('0xa5')](_0x5981('0xb6'),'MRCP_RECOG_TRANSCRIPT');if(_0xb82202['result']===-0x1){return _0xb82202;}var _0x38cf9c=this['getAndSetVariable'](_0x5981('0xb7'),_0x5981('0xb8'));if(_0x38cf9c[_0x5981('0xa6')]===-0x1){return _0x38cf9c;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xb9'),_0xe62949));};AGIVertices[_0x5981('0x10')]['agi']=function(_0x5ed565){logger[_0x5981('0x2f')](util['format'](_0x5981('0xba'),_0x5ed565['label']));return this['channel']['agi']([_0x5ed565[_0x5981('0xbb')],_0x5ed565[_0x5981('0xbc')]]);};AGIVertices[_0x5981('0x10')][_0x5981('0xbd')]=function(_0x36c672){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xbe'),_0x36c672['label']));if(this[_0x5981('0xac')](_0x36c672[_0x5981('0x69')])){logger[_0x5981('0x2f')](util['format'](_0x5981('0xbf'),_0x36c672['timeout']));var _0x3f3e76=this[_0x5981('0x33')][_0x5981('0xc0')](_0x36c672[_0x5981('0x69')]);if(_0x3f3e76[_0x5981('0xa6')]===-0x1){return _0x3f3e76;}}return this[_0x5981('0x33')]['answer']();};AGIVertices[_0x5981('0x10')]['callback']=function(_0x2a3a09){logger[_0x5981('0x2f')](util[_0x5981('0x56')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2a3a09['label']));if(!this[_0x5981('0xac')](_0x2a3a09['list_id'])){return this[_0x5981('0x33')]['error'](_0x2a3a09,_0x5981('0xc1'));}_0x2a3a09['scheduledAt']=moment();if(this['isConfigured'](_0x2a3a09['delay'])){_0x2a3a09[_0x5981('0x49')]=moment()[_0x5981('0xc2')](_0x2a3a09[_0x5981('0xc3')],_0x5981('0xc4'));}if(!this['isConfigured'](_0x2a3a09[_0x5981('0x4d')])){_0x2a3a09['callback_priority']=0x2;}this[_0x5981('0x42')][_0x5981('0x74')](this,_0x2a3a09);return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xc5'),_0x2a3a09[_0x5981('0x47')],_0x2a3a09[_0x5981('0x48')],_0x2a3a09[_0x5981('0x49')]));};AGIVertices[_0x5981('0x10')]['custom_app']=function(_0x4f285b){logger[_0x5981('0x2f')](util['format'](_0x5981('0xc6'),_0x4f285b[_0x5981('0x35')]));var _0x52e7d6=this['channel'][_0x5981('0x5a')](_0x4f285b[_0x5981('0xc7')],_0x4f285b[_0x5981('0x7c')]);if(_0x52e7d6[_0x5981('0xa6')]===-0x1){return _0x52e7d6;}return this['channel'][_0x5981('0xad')](util[_0x5981('0x56')]('Executed\x20command\x20%s\x20%s',_0x4f285b[_0x5981('0xc7')],_0x4f285b[_0x5981('0x7c')]));};AGIVertices[_0x5981('0x10')][_0x5981('0xc8')]=function(_0x4164aa){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xc9'),_0x4164aa['label']));if(!this['isConfigured'](_0x4164aa[_0x5981('0x5f')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xab'));}var _0x14c5af='\x22'+_0x4164aa[_0x5981('0x5f')]+'\x22';if(this['isConfigured'](_0x4164aa[_0x5981('0x7c')])){_0x14c5af+=','+_0x4164aa[_0x5981('0x7c')];}var _0x44ecc2=this['channel'][_0x5981('0x5a')](_0x5981('0xca'),_0x14c5af);if(_0x44ecc2[_0x5981('0xa6')]===-0x1){return _0x44ecc2;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xae'),_0x14c5af));};AGIVertices[_0x5981('0x10')][_0x5981('0xcb')]=function(_0x3fa10e){logger[_0x5981('0x2f')](util['format'](_0x5981('0xcc'),_0x3fa10e[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x3fa10e[_0x5981('0x5f')])){return this['channel'][_0x5981('0xad')](_0x5981('0xab'));}var _0x20bd0b='\x22'+_0x3fa10e['text']+'\x22';if(this[_0x5981('0xac')](_0x3fa10e[_0x5981('0x7c')])){_0x20bd0b+=','+_0x3fa10e['options'];}var _0x35dd51=this['channel']['exec']('MRCPSynth',_0x20bd0b);if(_0x35dd51['result']===-0x1){return _0x35dd51;}return this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0xae'),_0x20bd0b));};AGIVertices[_0x5981('0x10')][_0x5981('0xcd')]=function(_0x3e9ed2){logger[_0x5981('0x2f')](util[_0x5981('0x56')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3e9ed2[_0x5981('0x35')]));if(!this['isConfigured'](_0x3e9ed2[_0x5981('0xb1')])){return this['channel'][_0x5981('0xad')](_0x5981('0xb2'));}var _0x441d40=_0x3e9ed2[_0x5981('0xb1')];if(this[_0x5981('0xac')](_0x3e9ed2[_0x5981('0x7c')])){_0x441d40+=','+_0x3e9ed2[_0x5981('0x7c')];}var _0x3032cb=this[_0x5981('0x33')][_0x5981('0x5a')]('MRCPRecog',_0x441d40);if(_0x3032cb['result']===-0x1){return _0x3032cb;}var _0x20831e=this[_0x5981('0xa5')](_0x5981('0xb4'),_0x5981('0xce'));if(_0x20831e[_0x5981('0xa6')]===-0x1){return _0x20831e;}var _0x74197d=this[_0x5981('0xa5')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x74197d['result']===-0x1){return _0x74197d;}var _0x49ed1e=this[_0x5981('0xa5')]('RECOG_INSTANCE()',_0x5981('0xcf'));if(_0x49ed1e[_0x5981('0xa6')]===-0x1){return _0x49ed1e;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xb9'),_0x441d40));};AGIVertices[_0x5981('0x10')][_0x5981('0xd0')]=function(_0x34c5d6){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xd1'),_0x34c5d6['label']));if(!this[_0x5981('0xac')](_0x34c5d6[_0x5981('0xb1')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xb2'));}var _0x21493f=_0x34c5d6[_0x5981('0xb1')];if(this['isConfigured'](_0x34c5d6['options'])){_0x21493f+=','+_0x34c5d6['options'];}var _0x40c208=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0xb3'),_0x21493f);if(_0x40c208[_0x5981('0xa6')]===-0x1){return _0x40c208;}var _0x573838=this['getAndSetVariable'](_0x5981('0xb4'),'SESTEK_ASR_CONFIDENCE');if(_0x573838[_0x5981('0xa6')]===-0x1){return _0x573838;}var _0x546dc9=this[_0x5981('0xa5')](_0x5981('0xb6'),_0x5981('0xd2'));if(_0x546dc9[_0x5981('0xa6')]===-0x1){return _0x546dc9;}var _0x562a9f=this[_0x5981('0xa5')](_0x5981('0xb7'),_0x5981('0xd3'));if(_0x562a9f[_0x5981('0xa6')]===-0x1){return _0x562a9f;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xb9'),_0x21493f));};AGIVertices[_0x5981('0x10')][_0x5981('0xd4')]=function(_0x289461){logger[_0x5981('0x2f')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x289461[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x289461[_0x5981('0xd5')])){return this[_0x5981('0x33')]['error'](_0x289461,_0x5981('0xd6'));}var _0x3bb3fb=this[_0x5981('0x18')][_0x5981('0x74')](this,_0x289461[_0x5981('0xd5')]);if(!_0x3bb3fb){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x289461,_0x5981('0xd7'));}if(!this['isConfigured'](_0x289461[_0x5981('0x2d')])){return this['channel'][_0x5981('0x2a')](_0x289461,_0x5981('0xd8'));}var _0x20f2dc=_0x289461[_0x5981('0x2d')][_0x5981('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x5981('0xad')](util[_0x5981('0x56')]('query:\x20%s',_0x20f2dc));var _0x4b5ad0=this[_0x5981('0x28')]['sync'](this,_0x3bb3fb,_0x20f2dc);this[_0x5981('0x32')][_0x5981('0x74')](this,_0x289461,_0x20f2dc);if(!this[_0x5981('0xac')](_0x289461['variable_id'])){return this['channel'][_0x5981('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x49a50b=this[_0x5981('0x11')][_0x5981('0x74')](this,_0x289461[_0x5981('0xd9')]);if(!_0x49a50b){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x289461,_0x5981('0xda'));}var _0x26203d=this;_0x4b5ad0[_0x5981('0xdb')](function(_0x21be53,_0xef97d){Object[_0x5981('0xdc')](_0x21be53)[_0x5981('0xdb')](function(_0x28f894){_0x26203d[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')]('%s[%s][%s]',_0x49a50b,_0xef97d,_0x28f894),_0x21be53[_0x28f894]);});});this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')](_0x5981('0xdd'),_0x49a50b),_0x4b5ad0[_0x5981('0x9e')]);return this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')](_0x5981('0xde'),_0x49a50b));};AGIVertices[_0x5981('0x10')][_0x5981('0xdf')]=function(_0x2bdee2){logger[_0x5981('0xe0')](util[_0x5981('0x56')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2bdee2[_0x5981('0x35')]));if(!this['isConfigured'](_0x2bdee2[_0x5981('0xe1')])){return this['channel'][_0x5981('0x2a')](_0x2bdee2,'no\x20user\x20selected');}var _0x352a83=this[_0x5981('0x1a')][_0x5981('0x74')](this,_0x2bdee2['sip_id']);if(!_0x352a83){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x2bdee2,'no\x20user\x20found');}var _0x513523=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0xe2'),[util[_0x5981('0x56')](_0x5981('0xe3'),_0x352a83),_0x2bdee2['timeout'],_0x2bdee2['opts'],_0x2bdee2['url']]);if(_0x513523[_0x5981('0xa6')]===-0x1){return _0x513523;}return this['channel'][_0x5981('0xad')](util['format'](_0x5981('0xe4'),_0x5981('0xe2')));};AGIVertices[_0x5981('0x10')][_0x5981('0xe5')]=function(_0x4e055a){logger['info'](util[_0x5981('0x56')](_0x5981('0xe6'),_0x4e055a[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x4e055a[_0x5981('0x7e')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xe7'));}if(!this['isConfigured'](_0x4e055a[_0x5981('0x5f')])){return this[_0x5981('0x33')]['noop'](_0x5981('0xab'));}this[_0x5981('0x33')]['bot']=!![];this[_0x5981('0x32')](_0x4e055a);this[_0x5981('0x41')](_0x4e055a[_0x5981('0x5f')],'in','','');this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0xe8'),_0x4e055a[_0x5981('0x5f')]));var _0xbe83c0=this[_0x5981('0x7d')][_0x5981('0x74')](this,_0x4e055a);if(_0xbe83c0){for(var _0x5c19e1 in _0xbe83c0){if(_0xbe83c0[_0x5981('0xe9')](_0x5c19e1)){this['channel'][_0x5981('0xa1')](util[_0x5981('0x56')](_0x5981('0xea'),_0x5c19e1[_0x5981('0xeb')]()),_0xbe83c0[_0x5c19e1]);}}this[_0x5981('0x41')](_0xbe83c0[_0x5981('0xec')],_0x5981('0xed'),_0x5981('0xe5'),'');return this[_0x5981('0x33')][_0x5981('0xad')](util['format']('Dialogflow\x20Result\x20%s',_0xbe83c0[_0x5981('0xec')]));}return this[_0x5981('0x33')]['error'](_0x4e055a,_0x5981('0xee'));};AGIVertices[_0x5981('0x10')][_0x5981('0xef')]=function(_0x2fc747){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xf0'),_0x2fc747['label']));if(!this['isConfigured'](_0x2fc747['dialogflowV2_project_id'])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xf1'));}if(!this[_0x5981('0xac')](_0x2fc747['client_email'])){return this[_0x5981('0x33')]['noop'](_0x5981('0xf2'));}if(!this[_0x5981('0xac')](_0x2fc747[_0x5981('0x83')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xf3'));}if(!this[_0x5981('0xac')](_0x2fc747['dialogflowV2_language'])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xf4'));}if(!this[_0x5981('0xac')](_0x2fc747[_0x5981('0x5f')])){return this[_0x5981('0x33')]['noop'](_0x5981('0xab'));}this[_0x5981('0x33')][_0x5981('0xf5')]=!![];this[_0x5981('0x32')](_0x2fc747);this[_0x5981('0x41')](_0x2fc747[_0x5981('0x5f')],'in','','');this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xf6'),_0x2fc747[_0x5981('0x5f')]));var _0x1cddf6=this[_0x5981('0x80')][_0x5981('0x74')](this,_0x2fc747);if(_0x1cddf6){for(var _0x395d65 in _0x1cddf6){if(_0x1cddf6['hasOwnProperty'](_0x395d65)){if(_0x395d65!==_0x5981('0xf7')){this[_0x5981('0x33')][_0x5981('0xa1')](util['format'](_0x5981('0xea'),_0x395d65[_0x5981('0xeb')]()),_0x1cddf6[_0x395d65]);}}}this['createSquareMessage'](_0x1cddf6['speech'],_0x5981('0xed'),_0x5981('0xef'),_0x1cddf6[_0x5981('0xf7')]);return this[_0x5981('0x33')]['noop'](util['format'](_0x5981('0xf8'),_0x1cddf6[_0x5981('0xec')]));}return this[_0x5981('0x33')][_0x5981('0x2a')](_0x2fc747,_0x5981('0xf9'));};AGIVertices[_0x5981('0x10')]['sesteknda']=function(_0x58c270){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0xfa'),_0x58c270['label']));if(!this[_0x5981('0xac')](_0x58c270['ndauth_url'])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xfb'));}if(!this[_0x5981('0xac')](_0x58c270[_0x5981('0xfc')])){return this[_0x5981('0x33')]['noop']('no\x20username\x20configured');}if(!this[_0x5981('0xac')](_0x58c270['password'])){return this[_0x5981('0x33')][_0x5981('0xad')]('no\x20password\x20configured');}if(!this[_0x5981('0xac')](_0x58c270[_0x5981('0xfd')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xab'));}this[_0x5981('0x33')][_0x5981('0xf5')]=!![];this['createSquareDetailsReport'](_0x58c270);this[_0x5981('0x41')](_0x58c270[_0x5981('0x5f')],'in','','');this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xfe'),_0x58c270[_0x5981('0x5f')]));var _0x4593f1=this[_0x5981('0x85')][_0x5981('0x74')](this,_0x58c270);if(_0x4593f1){for(var _0x4ddd59 in _0x4593f1){if(_0x4593f1[_0x5981('0xe9')](_0x4ddd59)){this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')](_0x5981('0xff'),_0x4ddd59['toUpperCase']()),_0x4593f1[_0x4ddd59]);}}this['createSquareMessage'](_0x4593f1[_0x5981('0xec')],_0x5981('0xed'),_0x5981('0x100'),'');if(_0x4593f1[_0x5981('0x101')]){this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x102'),_0x4593f1['audiofile']));var _0x11c07a=this[_0x5981('0x33')][_0x5981('0x103')](_0x4593f1[_0x5981('0x101')]);try{fs[_0x5981('0x104')](_0x4593f1['audiofile']+'.wav');}catch(_0x42d8cc){logger[_0x5981('0x2a')](_0x42d8cc);}return _0x11c07a;}else{return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x105'),_0x4593f1[_0x5981('0xec')]));}}return this[_0x5981('0x33')][_0x5981('0x2a')](_0x58c270,_0x5981('0x106'));};AGIVertices[_0x5981('0x10')][_0x5981('0x107')]=function(_0x19f3b4){logger['info'](util[_0x5981('0x56')](_0x5981('0x108'),_0x19f3b4['label']));return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x107'));};AGIVertices['prototype']['ext_dial']=function(_0x39aa6b){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x109'),_0x39aa6b[_0x5981('0x35')]));var _0x32fa9e='';if(_0x39aa6b[_0x5981('0x10a')]){if(!this[_0x5981('0xac')](_0x39aa6b['trunk_id'])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x39aa6b,_0x5981('0x10b'));}else{var _0x34f513=parseInt(_0x39aa6b['trunk_id'],0xa);if(isNaN(_0x34f513)){_0x32fa9e=_0x39aa6b[_0x5981('0x10a')];}else{_0x32fa9e=this['getTrunk'][_0x5981('0x74')](this,_0x39aa6b[_0x5981('0x10a')]);if(!_0x32fa9e){return this['channel'][_0x5981('0x2a')](_0x39aa6b,'no\x20trunk\x20found');}}}}else if(_0x39aa6b[_0x5981('0x10c')]){_0x32fa9e=_0x39aa6b[_0x5981('0x10c')];}else{return this[_0x5981('0x33')][_0x5981('0x2a')](_0x39aa6b,'no\x20trunk\x20selected');}var _0x1e8203=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0xe2'),[util[_0x5981('0x56')](_0x5981('0x10d'),_0x32fa9e,_0x39aa6b[_0x5981('0x47')]),_0x39aa6b['timeout'],_0x39aa6b[_0x5981('0x10e')],_0x39aa6b[_0x5981('0x67')]]);if(_0x1e8203[_0x5981('0xa6')]===-0x1){return _0x1e8203;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0xe4'),'DIAL'));};AGIVertices[_0x5981('0x10')][_0x5981('0x10f')]=function(_0x54f65a){logger[_0x5981('0x2f')](util['format'](_0x5981('0x110'),_0x54f65a[_0x5981('0x35')]));return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x10f'));};AGIVertices[_0x5981('0x10')][_0x5981('0x111')]=function(_0x19ec78){logger['info'](util['format'](_0x5981('0x112'),_0x19ec78[_0x5981('0x35')]));if(_0x19ec78[_0x5981('0x113')]===0x0){return this[_0x5981('0xa8')](_0x19ec78);}_0x19ec78[_0x5981('0x113')]-=0x1;if(!this['isConfigured'](_0x19ec78[_0x5981('0x114')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x19ec78,_0x5981('0x115'));}var _0xe94318=this[_0x5981('0x1e')][_0x5981('0x74')](this,_0x19ec78[_0x5981('0x114')]);if(!_0xe94318){return this['channel'][_0x5981('0x2a')](_0x19ec78,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x19ec78[_0x5981('0xd9')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x5981('0x116'));}var _0x3dbf41=this[_0x5981('0x33')][_0x5981('0x117')](_0xe94318,_0x19ec78[_0x5981('0x118')],_0x19ec78[_0x5981('0x119')]);var _0x2a4246=_0x3dbf41[_0x5981('0xa6')]?_0x3dbf41[_0x5981('0xa6')]['toString']():'';logger[_0x5981('0x2f')](_0x5981('0x11a'),JSON[_0x5981('0x76')](_0x3dbf41));if(_0x3dbf41[_0x5981('0xa6')]===-0x1){this[_0x5981('0x32')]['sync'](this,_0x19ec78,_0x2a4246);return _0x3dbf41;}else if(_0x3dbf41[_0x5981('0xa4')]===_0x5981('0x69')){_0x3dbf41[_0x5981('0xa6')]=_0x2a4246[_0x5981('0x9e')]>=parseInt(_0x19ec78[_0x5981('0x11b')])?'x':'i';}else{_0x3dbf41[_0x5981('0xa6')]=_0x2a4246[_0x5981('0x9e')]>=parseInt(_0x19ec78['mindigit'])&&_0x2a4246[_0x5981('0x9e')]<=parseInt(_0x19ec78[_0x5981('0x119')])?'x':'i';}var _0x3c39c7=this['getVariable'][_0x5981('0x74')](this,_0x19ec78[_0x5981('0xd9')]);if(!_0x3c39c7){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x19ec78,_0x5981('0xda'));}this[_0x5981('0x33')][_0x5981('0xa1')](_0x3c39c7,_0x2a4246);if(this['isConfigured'](_0x19ec78[_0x5981('0x11c')])){var _0x22e488=parseInt(_0x19ec78[_0x5981('0x11c')],0xa);var _0x259939=rs[_0x5981('0x11d')]({'charset':'*','length':_0x22e488});var _0x86c18b=_0x2a4246[_0x5981('0x9e')];if(_0x86c18b>0x0){if(_0x86c18b>_0x22e488){this[_0x5981('0x32')][_0x5981('0x74')](this,_0x19ec78,_0x19ec78[_0x5981('0x11e')]==='first'?_0x259939+_0x2a4246[_0x5981('0x11f')](_0x22e488):_0x2a4246[_0x5981('0x11f')](0x0,_0x86c18b-_0x22e488)+_0x259939);}else{this[_0x5981('0x32')][_0x5981('0x74')](this,_0x19ec78,rs[_0x5981('0x11d')]({'charset':'*','length':_0x86c18b}));}}else{this['createSquareDetailsReport'][_0x5981('0x74')](this,_0x19ec78,'');}}else{this[_0x5981('0x32')][_0x5981('0x74')](this,_0x19ec78,_0x2a4246);}return _0x3dbf41;};AGIVertices[_0x5981('0x10')][_0x5981('0xd')]=function(_0x257a21){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x120'),_0x257a21[_0x5981('0x35')]));return this[_0x5981('0x111')](_0x257a21);};AGIVertices[_0x5981('0x10')][_0x5981('0x121')]=function(_0x6b5ae){logger[_0x5981('0x2f')](util['format'](_0x5981('0x122'),_0x6b5ae['label']));this[_0x5981('0x32')]['sync'](this,_0x6b5ae,_0x6b5ae[_0x5981('0x123')]);return this['channel']['noop'](util['format'](_0x5981('0x124'),_0x6b5ae[_0x5981('0x123')]));};AGIVertices[_0x5981('0x10')]['awspolly']=function(_0x446226){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x125'),_0x446226[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x446226['aws_access_key_id'])||!this[_0x5981('0xac')](_0x446226['aws_secret_access_key'])){return this[_0x5981('0x33')][_0x5981('0xad')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x5981('0xac')](_0x446226[_0x5981('0x5f')])){return this['channel']['noop'](_0x5981('0xab'));}this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x126'),_0x446226['text']));var _0x518da5=this['awsPolly'][_0x5981('0x74')](this,_0x446226);if(_0x518da5){this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x127'),_0x518da5));var _0x58efef=this[_0x5981('0x33')][_0x5981('0x103')](_0x518da5);try{fs[_0x5981('0x104')](_0x518da5+_0x5981('0x128'));}catch(_0x16a21c){logger[_0x5981('0x2a')](_0x16a21c);}return _0x58efef;}return this[_0x5981('0x33')][_0x5981('0x2a')](_0x446226,_0x5981('0x129'));};AGIVertices['prototype']['awslex']=function(_0x562474){logger['info'](util['format'](_0x5981('0x12a'),_0x562474[_0x5981('0x35')]));if(!this['isConfigured'](_0x562474[_0x5981('0x8c')])||!this[_0x5981('0xac')](_0x562474[_0x5981('0x8d')])){return this[_0x5981('0x33')]['noop'](_0x5981('0x12b'));}if(!this['isConfigured'](_0x562474[_0x5981('0x93')])){return this['channel'][_0x5981('0xad')](_0x5981('0x12c'));}if(!this[_0x5981('0xac')](_0x562474['text'])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xab'));}this['channel']['bot']=!![];this[_0x5981('0x32')](_0x562474);this['createSquareMessage'](_0x562474[_0x5981('0x5f')],'in','','');this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')]('Trying\x20Amazon\x20Lex:\x20%s',_0x562474[_0x5981('0x5f')]));var _0x1dc357=this['awsLex'][_0x5981('0x74')](this,_0x562474);if(_0x1dc357){for(var _0x4198e0 in _0x1dc357){if(_0x1dc357['hasOwnProperty'](_0x4198e0)&&_[_0x5981('0x99')](_0x1dc357[_0x4198e0])){this[_0x5981('0x33')]['setVariable'](util[_0x5981('0x56')]('AWS_LEX_%s',_0x4198e0['toUpperCase']()),_0x1dc357[_0x4198e0]);}}if(_[_0x5981('0x44')](_0x1dc357['message'])){return this['channel'][_0x5981('0xad')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x5981('0x41')](_0x1dc357[_0x5981('0x7a')],_0x5981('0xed'),_0x5981('0x12d'),'');return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x12e'),_0x1dc357[_0x5981('0x7a')]));}}return this['channel'][_0x5981('0x2a')](_0x562474,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x5981('0x10')][_0x5981('0x12f')]=function(_0x185b51){logger['info'](util['format'](_0x5981('0x130'),_0x185b51[_0x5981('0x35')],_0x185b51['timeout']));if(!this[_0x5981('0xac')](_0x185b51[_0x5981('0x7e')])){return this[_0x5981('0x33')]['noop']('no\x20key\x20configured');}var _0x268023=_0x5981('0x131');var _0x182ae0=util[_0x5981('0x56')]('%s/recordings/%s',FILES_PATH,rs[_0x5981('0x11d')](0x4));var _0xf87b1a=util[_0x5981('0x56')](_0x5981('0x9f'),_0x182ae0,_0x268023);var _0x226c33=!![];if(_0x185b51[_0x5981('0x132')]===_0x5981('0x133')){_0x226c33=![];}var _0x29f878=this[_0x5981('0x33')]['recordFile'](_0x182ae0,_0x268023,_0x185b51[_0x5981('0x134')],_0x185b51[_0x5981('0x69')],undefined,_0x226c33);if(_0x29f878['result']!==-0x1){this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')]('google\x20%s\x20file\x20created',_0xf87b1a));var _0x2d2de4=this['googleASR'][_0x5981('0x74')](this,_0x185b51,_0xf87b1a);if(_0x2d2de4){for(var _0x4db133 in _0x2d2de4){if(_0x2d2de4[_0x5981('0xe9')](_0x4db133)){this[_0x5981('0x33')][_0x5981('0xa1')](util['format'](_0x5981('0x135'),_0x4db133[_0x5981('0xeb')]()),_0x2d2de4[_0x4db133]);}}return this[_0x5981('0x33')][_0x5981('0xad')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x5981('0x76')](_0x2d2de4)));}}return _0x29f878;};AGIVertices[_0x5981('0x10')][_0x5981('0x136')]=function(_0x69316c){logger['info'](util[_0x5981('0x56')](_0x5981('0x137'),_0x69316c[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x69316c['appid'])){return this[_0x5981('0x33')][_0x5981('0xad')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x69316c['appsecret'])){return this[_0x5981('0x33')]['noop'](_0x5981('0x138'));}var _0x7ef32='wav';var _0x5b1a2c=util[_0x5981('0x56')](_0x5981('0x139'),FILES_PATH,rs[_0x5981('0x11d')](0x4));var _0x5366b9=util[_0x5981('0x56')](_0x5981('0x9f'),_0x5b1a2c,_0x7ef32);var _0x503289=!![];if(_0x69316c['beep']===_0x5981('0x133')){_0x503289=![];}var _0x298ff=this[_0x5981('0x33')][_0x5981('0x13a')](_0x5b1a2c,_0x7ef32,_0x69316c['intKey'],_0x69316c[_0x5981('0x69')],undefined,_0x503289);if(_0x298ff[_0x5981('0xa6')]!==-0x1){this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x13b'),_0x5366b9));var _0x8d6028=this[_0x5981('0x95')][_0x5981('0x74')](this,_0x69316c,_0x5366b9);if(_0x8d6028){for(var _0x272a2e in _0x8d6028){if(_0x8d6028[_0x5981('0xe9')](_0x272a2e)){this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')](_0x5981('0x13c'),_0x272a2e['toUpperCase']()),_0x8d6028[_0x272a2e]);}}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x13d'),JSON[_0x5981('0x76')](_0x8d6028)));}}return _0x298ff;};AGIVertices[_0x5981('0x10')]['gotoc']=function(_0x5331f9){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x13e'),_0x5331f9['label']));return this[_0x5981('0x33')][_0x5981('0x13f')](_0x5331f9[_0x5981('0x3b')],_0x5331f9[_0x5981('0x3c')],_0x5331f9[_0x5981('0x3d')]);};AGIVertices[_0x5981('0x10')][_0x5981('0x140')]=function(_0x5dec5c){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x141'),_0x5dec5c[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x5dec5c[_0x5981('0x142')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x5dec5c,_0x5981('0x143'));}try{var _0x1297f3=eval(_0x5dec5c[_0x5981('0x142')])?_0x5981('0x144'):_0x5981('0x145');this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')](_0x5981('0x146'),_0x5dec5c[_0x5981('0x142')],_0x1297f3));return{'code':0xc8,'result':_0x1297f3};}catch(_0x19edc7){return{'code':0xc8,'result':_0x5981('0x145')};}};AGIVertices[_0x5981('0x10')][_0x5981('0x147')]=function(_0x240257){logger['info'](util[_0x5981('0x56')](_0x5981('0x148'),_0x240257[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x240257[_0x5981('0x149')])){return this[_0x5981('0x33')]['error'](_0x240257,_0x5981('0x14a'));}var _0x2e4817=this[_0x5981('0x23')][_0x5981('0x74')](this,_0x240257[_0x5981('0x149')]);if(!_0x2e4817){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x240257,_0x5981('0x14b'));}for(var _0x260120=0x0;_0x260120<_0x2e4817[_0x5981('0x9e')];_0x260120+=0x1){var _0x266a25=this[_0x5981('0x33')][_0x5981('0x11')](util['format'](_0x5981('0x14c'),_0x2e4817[_0x260120]));if(_0x266a25[_0x5981('0xa6')]===-0x1){return _0x266a25;}logger[_0x5981('0x2f')](util['format'](_0x5981('0x14d'),_0x2e4817[_0x260120],_0x266a25[_0x5981('0xa4')]));if(_0x266a25[_0x5981('0xa4')]==='true'){logger[_0x5981('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x2e4817[_0x260120],_0x5981('0x144')));this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x14d'),_0x2e4817[_0x260120],_0x5981('0x144')));return{'code':0xc8,'result':'true'};}else{logger[_0x5981('0x2f')](util[_0x5981('0x56')]('IFTIME\x20%s\x20%s',_0x2e4817[_0x260120],'false'));this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x14d'),_0x2e4817[_0x260120],'false'));}}return{'code':0xc8,'result':_0x5981('0x145')};};AGIVertices[_0x5981('0x10')][_0x5981('0x14e')]=function(_0xfd7674){logger[_0x5981('0x2f')](util['format'](_0x5981('0x14f'),_0xfd7674['label']));return this['channel']['hangup']();};AGIVertices[_0x5981('0x10')][_0x5981('0x150')]=function(_0x15f0d0){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x151'),_0x15f0d0[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x15f0d0['key'])){return this[_0x5981('0x33')]['noop'](_0x5981('0xe7'));}var _0x18432a='wav';var _0x372ce7=util['format'](_0x5981('0x139'),FILES_PATH,rs[_0x5981('0x11d')](0x4));var _0x810fbd=util[_0x5981('0x56')](_0x5981('0x9f'),_0x372ce7,_0x18432a);var _0x3495c1=!![];if(_0x15f0d0['beep']==='NOBEEP'){_0x3495c1=![];}var _0x462a63=this['channel'][_0x5981('0x13a')](_0x372ce7,_0x18432a,_0x15f0d0['intKey'],_0x15f0d0[_0x5981('0x69')],undefined,_0x3495c1);if(_0x462a63[_0x5981('0xa6')]!==-0x1){this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x152'),_0x810fbd));var _0x142e09=this[_0x5981('0x89')]['sync'](this,_0x15f0d0,_0x810fbd);if(_0x142e09){for(var _0x2d576a in _0x142e09){if(_0x142e09[_0x5981('0xe9')](_0x2d576a)){this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')](_0x5981('0x153'),_0x2d576a[_0x5981('0xeb')]()),_0x142e09[_0x2d576a]);}}return this['channel']['noop'](util['format'](_0x5981('0x154'),JSON[_0x5981('0x76')](_0x142e09)));}}return _0x462a63;};AGIVertices['prototype'][_0x5981('0x155')]=function(_0xd31bcc){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x156'),_0xd31bcc['label']));if(!this[_0x5981('0xac')](_0xd31bcc[_0x5981('0x7e')])){return this[_0x5981('0x33')]['noop']('no\x20key\x20configured');}if(!this[_0x5981('0xac')](_0xd31bcc[_0x5981('0x5f')])){return this[_0x5981('0x33')]['noop']('no\x20text\x20configured');}this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x157'),_0xd31bcc[_0x5981('0x5f')]));var _0x1e6447=this[_0x5981('0x86')][_0x5981('0x74')](this,_0xd31bcc);if(_0x1e6447){this[_0x5981('0x33')][_0x5981('0xad')](util['format']('ispeech\x20%s\x20file\x20created',_0x1e6447));var _0xda335c=this[_0x5981('0x33')][_0x5981('0x103')](_0x1e6447,_0xd31bcc['intKey']);try{fs[_0x5981('0x104')](_0x1e6447+_0x5981('0x128'));}catch(_0x2607ec){logger[_0x5981('0x2a')](_0x2607ec);}return _0xda335c;}return this[_0x5981('0x33')]['error'](_0xd31bcc,_0x5981('0x158'));};AGIVertices[_0x5981('0x10')][_0x5981('0x159')]=function(_0x10b72f){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x15a'),_0x10b72f[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x10b72f[_0x5981('0x15b')])){return this['channel']['error'](_0x10b72f,_0x5981('0x15c'));}logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x15d'),this[_0x5981('0x33')][_0x5981('0x39')],_0x10b72f['findBy']));var _0x5c2dbe=this[_0x5981('0x54')]['sync'](this,_0x10b72f[_0x5981('0x15b')]);if(_0x5c2dbe){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x10b72f[_0x5981('0x15b')]));this['channel'][_0x5981('0xad')](util[_0x5981('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5981('0x33')]['callerid'],_0x10b72f[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x15f')};}else{logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x160'),this[_0x5981('0x33')]['callerid'],_0x10b72f[_0x5981('0x15b')]));this['channel'][_0x5981('0xad')](util[_0x5981('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x10b72f[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x161')};}};AGIVertices[_0x5981('0x10')][_0x5981('0x162')]=function(_0x2a04e6){logger[_0x5981('0x2f')](util[_0x5981('0x56')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2a04e6[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x2a04e6[_0x5981('0x15b')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x2a04e6,_0x5981('0x15c'));}logger[_0x5981('0x2f')](util['format'](_0x5981('0x15d'),this[_0x5981('0x33')][_0x5981('0x39')],_0x2a04e6[_0x5981('0x15b')]));var _0xce197a=this[_0x5981('0x53')]['sync'](this,_0x2a04e6['findBy']);if(_0xce197a){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')]['callerid'],_0x2a04e6[_0x5981('0x15b')]));this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x2a04e6[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x15f')};}else{logger['info'](util[_0x5981('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5981('0x33')][_0x5981('0x39')],_0x2a04e6[_0x5981('0x15b')]));this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x5981('0x39')],_0x2a04e6[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x161')};}};AGIVertices[_0x5981('0x10')][_0x5981('0x163')]=function(_0x194283){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x164'),_0x194283[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x194283[_0x5981('0x165')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x194283,_0x5981('0x166'));}this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x167'),_0x194283[_0x5981('0x165')]));var _0x1d2245=eval(_0x194283[_0x5981('0x165')]);if(!this[_0x5981('0xac')](_0x194283[_0x5981('0xd9')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x116'));}var _0x5900d6=this[_0x5981('0x11')][_0x5981('0x74')](this,_0x194283['variable_id']);if(!_0x5900d6){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x194283,'no\x20variable\x20found');}if(_[_0x5981('0x9d')](_0x1d2245)){var _0x4e5f0d=this;_0x1d2245['forEach'](function(_0x29c73d,_0x565250){_0x4e5f0d['channel'][_0x5981('0xa1')](util['format']('%s[%s]',_0x5900d6,_0x565250),_0x29c73d);});return this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x168'),_0x5900d6));}else{return this['channel'][_0x5981('0xa1')](_0x5900d6,_0x1d2245);}};AGIVertices['prototype'][_0x5981('0xc')]=function(_0x29fcd1){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x169'),_0x29fcd1[_0x5981('0x35')]));if(_0x29fcd1[_0x5981('0x113')]===0x0){return this['maxRetry'](_0x29fcd1);}_0x29fcd1['retry']-=0x1;if(!this[_0x5981('0xac')](_0x29fcd1[_0x5981('0x114')])){return this[_0x5981('0x33')]['error'](_0x29fcd1,_0x5981('0x115'));}var _0x38fb8e=this[_0x5981('0x1e')]['sync'](this,_0x29fcd1['file_id']);if(!_0x38fb8e){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x29fcd1,_0x5981('0x16a'));}var _0x360fb9=this[_0x5981('0x33')]['getData'](_0x38fb8e,_0x29fcd1[_0x5981('0x118')],_0x29fcd1[_0x5981('0x16b')]);var _0x553e4f=_0x360fb9[_0x5981('0xa6')];if(_0x360fb9[_0x5981('0xa6')]===-0x1){this[_0x5981('0x32')][_0x5981('0x74')](this,_0x29fcd1,'-1');return _0x360fb9;}else if(_0x360fb9[_0x5981('0xa4')]==='timeout'){_0x360fb9[_0x5981('0xa6')]=_0x360fb9['result'][_0x5981('0x9e')]>0x0?_0x360fb9[_0x5981('0xa6')]:'t';}else if(_['isEmpty'](_0x360fb9['result'])){_0x360fb9[_0x5981('0xa6')]='#';_0x553e4f='#';}if(!this['isConfigured'](_0x29fcd1[_0x5981('0xd9')])){this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x116'));}else{var _0x27659e=this['getVariable']['sync'](this,_0x29fcd1[_0x5981('0xd9')]);if(!_0x27659e){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x29fcd1,_0x5981('0xda'));}this[_0x5981('0x33')][_0x5981('0xa1')](_0x27659e,_0x553e4f);}this[_0x5981('0x32')][_0x5981('0x74')](this,_0x29fcd1,_0x553e4f);return _0x360fb9;};AGIVertices['prototype'][_0x5981('0xad')]=function(_0x4418f0){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x16c'),_0x4418f0[_0x5981('0x35')]));return this[_0x5981('0x33')][_0x5981('0xad')](_0x4418f0[_0x5981('0x16d')]||_0x4418f0[_0x5981('0x35')]);};AGIVertices[_0x5981('0x10')][_0x5981('0x16e')]=function(_0x5cae31){logger[_0x5981('0x2f')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5cae31[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x5cae31[_0x5981('0x15b')])){return this['channel']['error'](_0x5cae31,_0x5981('0x15c'));}logger[_0x5981('0x2f')](util[_0x5981('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5981('0x33')][_0x5981('0x39')],_0x5cae31[_0x5981('0x15b')]));var _0x3cbee1=this[_0x5981('0x4e')]['sync'](this,_0x5cae31[_0x5981('0x16f')]);var _0xf8bb71=this[_0x5981('0x50')]['sync'](this,_0x5cae31[_0x5981('0x15b')],_0x3cbee1);if(_0xf8bb71){logger[_0x5981('0x2f')](util['format'](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x5cae31[_0x5981('0x15b')]));this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x5cae31[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x15f')};}else{logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x160'),this[_0x5981('0x33')][_0x5981('0x39')],_0x5cae31[_0x5981('0x15b')]));this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x15e'),this['channel']['callerid'],_0x5cae31[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x161')};}};AGIVertices[_0x5981('0x10')][_0x5981('0x170')]=function(_0x35bed2){logger[_0x5981('0x2f')](util['format'](_0x5981('0x171'),_0x35bed2[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x35bed2[_0x5981('0x114')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x35bed2,'no\x20file\x20audio\x20selected');}var _0x3964d1=this[_0x5981('0x1e')][_0x5981('0x74')](this,_0x35bed2[_0x5981('0x114')]);if(!_0x3964d1){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x35bed2,_0x5981('0x16a'));}var _0x3ea5fe=this[_0x5981('0x33')]['exec'](_0x5981('0x172'),[_0x3964d1,_0x35bed2['opts']]);if(_0x3ea5fe[_0x5981('0xa6')]===-0x1){return _0x3ea5fe;}return this[_0x5981('0x33')][_0x5981('0xad')](util['format'](_0x5981('0x173'),_0x5981('0x172'),_0x3964d1));};AGIVertices[_0x5981('0x10')][_0x5981('0x174')]=function(_0x3e37af){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x175'),_0x3e37af[_0x5981('0x35')]));if(!this['isConfigured'](_0x3e37af[_0x5981('0x176')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x3e37af,_0x5981('0x177'));}var _0x4f96ad='';var _0x5dbd89=parseInt(_0x3e37af[_0x5981('0x176')],0xa);if(isNaN(_0x5dbd89)){_0x4f96ad=_0x3e37af[_0x5981('0x176')];}else{_0x4f96ad=this['getVoiceQueue'][_0x5981('0x74')](this,_0x3e37af[_0x5981('0x176')]);if(!_0x4f96ad){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x3e37af,_0x5981('0x178'));}}var _0x2ad73b='';if(this[_0x5981('0xac')](_0x3e37af[_0x5981('0x114')])){var _0x56c17c=this[_0x5981('0x1e')][_0x5981('0x74')](this,_0x3e37af[_0x5981('0x114')]);if(_0x56c17c){_0x2ad73b=_0x56c17c;}}this['createSquareDetailsReport']['sync'](this,_0x3e37af,_0x4f96ad);if(_0x3e37af['opts'][_0x5981('0x179')]('x')<0x0){_0x3e37af[_0x5981('0x10e')]+='x';}if(_0x3e37af['opts'][_0x5981('0x179')]('X')<0x0){_0x3e37af[_0x5981('0x10e')]+='X';}this[_0x5981('0x33')][_0x5981('0xa1')](_0x5981('0x17a'),_0x4f96ad?_0x4f96ad['toLowerCase']():'');var _0x240c90=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0x17b'),[_0x4f96ad,_0x3e37af[_0x5981('0x10e')],_0x3e37af['url'],_0x2ad73b,_0x3e37af[_0x5981('0x69')],_0x3e37af[_0x5981('0x7')],_0x3e37af[_0x5981('0x17c')],_0x3e37af[_0x5981('0x17d')],'',_0x3e37af['position']]);if(_0x240c90[_0x5981('0xa6')]===-0x1){return _0x240c90;}return this['channel'][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x173'),_0x5981('0x17b'),_0x4f96ad));};AGIVertices[_0x5981('0x10')][_0x5981('0x17e')]=function(_0x19df71){logger['info'](util['format'](_0x5981('0x17f'),_0x19df71[_0x5981('0x35')]));var _0x139f18=_0x19df71[_0x5981('0x180')]||_0x5981('0x131');var _0x514495=util['format']('%s_%s',this[_0x5981('0x33')][_0x5981('0x34')],rs[_0x5981('0x11d')](0x5));var _0x278fd9=util[_0x5981('0x56')](_0x5981('0x181'),FILES_PATH,_0x514495,_0x139f18);var _0x2527a6=util[_0x5981('0x56')](_0x5981('0x139'),FILES_PATH,_0x514495);this[_0x5981('0x38')]['sync'](this,_0x19df71,_0x514495,_0x278fd9);this[_0x5981('0x33')][_0x5981('0xa1')](_0x5981('0x182'),_0x514495);logger[_0x5981('0x2f')](_0x5981('0x183'),_0x2527a6,_0x139f18,_0x19df71['escape_digits'],_0x19df71[_0x5981('0x69')]);return this[_0x5981('0x33')][_0x5981('0x13a')](_0x2527a6,_0x139f18,_0x19df71['escape_digits'],_0x19df71[_0x5981('0x69')],undefined,!![]);};AGIVertices[_0x5981('0x10')][_0x5981('0x184')]=function(_0x3ee2d2){logger[_0x5981('0x2f')](util['format'](_0x5981('0x185'),_0x3ee2d2[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x3ee2d2[_0x5981('0x67')])){return this[_0x5981('0x33')]['noop']('no\x20url\x20configured');}var _0x5a4d53=this[_0x5981('0x186')][_0x5981('0x74')](this,_0x3ee2d2);logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x187'),util[_0x5981('0x188')](_0x5a4d53,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3ee2d2['variable_id'])){return this[_0x5981('0x33')]['noop'](_0x5981('0x189'));}var _0x4bb319=this['getVariable'][_0x5981('0x74')](this,_0x3ee2d2[_0x5981('0xd9')]);if(!_0x4bb319){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x3ee2d2,_0x5981('0xda'));}this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')]('%s_STATUS_CODE',_0x4bb319),_0x5a4d53[_0x5981('0x78')]?_0x5a4d53[_0x5981('0x78')]:_0x5981('0x18a'));this[_0x5981('0x33')][_0x5981('0xa1')](util[_0x5981('0x56')]('%s_STATUS_MESSAGE',_0x4bb319),_0x5a4d53['statusMessage']?_0x5a4d53[_0x5981('0x79')]:'OK');if(_0x5a4d53[_0x5981('0x6e')]){try{this[_0x5981('0xa0')](_0x5a4d53[_0x5981('0x6e')],_0x4bb319);}catch(_0x19574f){logger[_0x5981('0x2a')](util[_0x5981('0x56')](_0x5981('0x18b'),_0x4bb319));}}return this['channel']['noop'](util[_0x5981('0x56')]('variable\x20%s\x20set',_0x4bb319));};AGIVertices[_0x5981('0x10')][_0x5981('0x18c')]=function(_0x202d80){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x18d'),_0x202d80[_0x5981('0x35')]));return this[_0x5981('0x33')][_0x5981('0x18e')](_0x202d80[_0x5981('0x18f')][_0x5981('0x5c')](/\s+/g,''),_0x202d80[_0x5981('0x190')]);};AGIVertices['prototype']['saynumber']=function(_0x499304){logger['info'](util[_0x5981('0x56')](_0x5981('0x191'),_0x499304[_0x5981('0x35')]));return this[_0x5981('0x33')][_0x5981('0x192')](_0x499304[_0x5981('0x6a')][_0x5981('0x5c')](/\s+/g,''),_0x499304[_0x5981('0x190')]);};AGIVertices['prototype']['sayphonetic']=function(_0x79287e){logger['info'](util[_0x5981('0x56')](_0x5981('0x193'),_0x79287e[_0x5981('0x35')]));return this[_0x5981('0x33')][_0x5981('0x194')](_0x79287e['text'],_0x79287e['escape_digits']);};AGIVertices['prototype'][_0x5981('0x195')]=function(_0x361fc2){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x196'),_0x361fc2[_0x5981('0x35')]));if(!this['isConfigured'](_0x361fc2[_0x5981('0x197')])){return this[_0x5981('0x33')]['noop'](_0x5981('0x198'));}var _0x43e0f4=this['getMailAccount']['sync'](this,_0x361fc2['account_id']);if(!_0x43e0f4||!_0x43e0f4[_0x5981('0x199')]){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x361fc2,_0x5981('0x19a'));}var _0xca7025={'from':util['format']('\x22%s\x22\x20<%s>',_0x43e0f4[_0x5981('0x13')],_0x43e0f4[_0x5981('0x19b')]||_0x43e0f4[_0x5981('0x199')][_0x5981('0x19c')]),'to':_0x361fc2['to']||'','cc':_0x361fc2['cc']||'','bcc':_0x361fc2[_0x5981('0x19d')]||'','subject':_0x361fc2['subject'],'html':_0x361fc2[_0x5981('0x5f')],'text':_0x361fc2[_0x5981('0x5f')]};var _0x1e8e5d={'tls':{'rejectUnauthorized':![]}};if(_0x43e0f4[_0x5981('0x199')][_0x5981('0x19e')]){_0x1e8e5d[_0x5981('0x19e')]=_0x43e0f4[_0x5981('0x199')][_0x5981('0x19e')];}else{_0x1e8e5d[_0x5981('0x19f')]=_0x43e0f4[_0x5981('0x199')][_0x5981('0x19f')];_0x1e8e5d[_0x5981('0x1a0')]=_0x43e0f4['Smtp'][_0x5981('0x1a0')];_0x1e8e5d['secure']=_0x43e0f4[_0x5981('0x199')][_0x5981('0x1a1')];}if(_0x43e0f4['Smtp'][_0x5981('0x1a2')]){_0x1e8e5d['auth']={'user':_0x43e0f4[_0x5981('0x199')]['user'],'pass':_0x43e0f4[_0x5981('0x199')][_0x5981('0x1a3')]};}if(this[_0x5981('0xac')](_0x361fc2[_0x5981('0x1a4')])){}logger[_0x5981('0xe0')](_0x5981('0x1a5'),JSON['stringify'](_0xca7025));this['createSquareDetailsReport'][_0x5981('0x74')](this,_0x361fc2,_0x361fc2[_0x5981('0x197')]);this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x1a6'),_0x43e0f4[_0x5981('0x13')]));this[_0x5981('0x22')][_0x5981('0x74')](this,_0x1e8e5d,_0xca7025);return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x1a7'));};AGIVertices[_0x5981('0x10')][_0x5981('0x1a8')]=function(_0x2119db){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1a9'),_0x2119db[_0x5981('0x35')]));return this['channel']['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x5981('0x1aa')]=function(_0x41490c){logger[_0x5981('0x2f')](util[_0x5981('0x56')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x41490c[_0x5981('0x35')]));if(!this['isConfigured'](_0x41490c[_0x5981('0x1ab')])){return this[_0x5981('0x33')]['noop']('no\x20sms\x20account\x20configured');}var _0x1aa1df=this['getSmsAccount'][_0x5981('0x74')](this,_0x41490c['sms_account_id']);if(!_0x1aa1df){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x41490c,_0x5981('0x1ac'));}var _0x11d1d4={'body':_0x41490c[_0x5981('0x1ad')],'phone':_0x41490c['to']||'','SmsAccountId':_0x1aa1df['id']};logger[_0x5981('0xe0')](_0x5981('0x1ae'),JSON[_0x5981('0x76')](_0x11d1d4));this[_0x5981('0x32')][_0x5981('0x74')](this,_0x41490c,_0x41490c[_0x5981('0x1ab')]);this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x1af'),_0x1aa1df[_0x5981('0x13')]));this[_0x5981('0x31')][_0x5981('0x74')](this,_0x11d1d4);return this['channel']['noop'](_0x5981('0x1b0'));};AGIVertices['prototype']['set']=function(_0x3c0d15){logger['info'](util[_0x5981('0x56')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3c0d15['label']));if(!this[_0x5981('0xac')](_0x3c0d15['variable_id'])){return this['channel'][_0x5981('0x2a')](_0x3c0d15,'no\x20variable\x20selected');}var _0x308884=this[_0x5981('0x11')][_0x5981('0x74')](this,_0x3c0d15[_0x5981('0xd9')]);if(!_0x308884){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x3c0d15,_0x5981('0xda'));}return this['channel'][_0x5981('0xa1')](_0x308884,_0x3c0d15[_0x5981('0x1b1')]);};AGIVertices['prototype'][_0x5981('0x1b2')]=function(_0x1d5381){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1b3'),_0x1d5381[_0x5981('0x35')]));this[_0x5981('0x33')]['noop']('START\x20CALLY\x20SQUARE');if(_0x1d5381[_0x5981('0xbd')]===_0x5981('0x1b4')){this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0x1b5'));return this[_0x5981('0x33')][_0x5981('0xbd')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices[_0x5981('0x10')][_0x5981('0x1b6')]=function(_0x7d831a){logger['info'](util[_0x5981('0x56')](_0x5981('0x1b7'),_0x7d831a[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x7d831a[_0x5981('0x1b8')])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x7d831a,'no\x20subproject\x20selected');}var _0x1e298f=this[_0x5981('0x17')][_0x5981('0x74')](this,_0x7d831a[_0x5981('0x1b8')]);if(!this[_0x5981('0xac')](_0x1e298f)){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x7d831a,util[_0x5981('0x56')](_0x5981('0x1b9'),_0x7d831a[_0x5981('0x1b8')]));}if(_0x1e298f===this[_0x5981('0x33')]['arg_1']){return this['channel'][_0x5981('0x2a')](_0x7d831a,_0x5981('0x1ba'));}this[_0x5981('0x32')][_0x5981('0x74')](this,_0x7d831a,_0x1e298f);var _0x2b8aee=this[_0x5981('0x33')]['exec']('AGI',util[_0x5981('0x56')](_0x5981('0x1bb'),config['agi']['host']||'127.0.0.1',_0x1e298f,this[_0x5981('0x33')][_0x5981('0x37')]));if(_0x2b8aee['result']===-0x1){return _0x2b8aee;}return this[_0x5981('0x33')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5981('0x1bc'),_0x1e298f));};AGIVertices[_0x5981('0x10')][_0x5981('0x1bd')]=function(_0x55762f){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1be'),_0x55762f[_0x5981('0x35')]));var _0x5f55f7=this[_0x5981('0x59')][_0x5981('0x74')](this,_0x55762f[_0x5981('0xbb')]);this[_0x5981('0x32')][_0x5981('0x74')](this,_0x55762f,_0x55762f[_0x5981('0xbb')]);if(this['isConfigured'](_0x55762f[_0x5981('0xd9')])){var _0x49db58=this[_0x5981('0x11')]['sync'](this,_0x55762f[_0x5981('0xd9')]);if(_0x49db58){this['channel'][_0x5981('0xa1')](_0x49db58,_0x5f55f7);return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x55762f['command'],_0x49db58));}}return this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')](_0x5981('0x1bf'),_0x55762f[_0x5981('0xbb')]));};AGIVertices['prototype'][_0x5981('0x1c0')]=function(_0x4998ef){logger['info'](util['format'](_0x5981('0x1c1'),_0x4998ef[_0x5981('0x35')]));_0x4998ef[_0x5981('0x5f')]=_0x4998ef['text'][_0x5981('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5981('0xac')](_0x4998ef[_0x5981('0x1c2')])){return this[_0x5981('0x33')]['noop'](_0x5981('0x1c3'));}if(!this['isConfigured'](_0x4998ef[_0x5981('0x5f')])){return this['channel']['noop'](_0x5981('0xab'));}this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')](_0x5981('0x1c4'),_0x4998ef[_0x5981('0x5f')]));var _0x4ef4f9=this[_0x5981('0x5d')]['sync'](this,_0x4998ef);if(_0x4ef4f9){this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x1c5'),_0x4ef4f9));var _0x36c4ed=this['channel'][_0x5981('0x103')](_0x4ef4f9);try{fs[_0x5981('0x104')](_0x4ef4f9+'.wav');}catch(_0x5c084b){logger['error'](_0x5c084b);}return _0x36c4ed;}return this[_0x5981('0x33')][_0x5981('0x2a')](_0x4998ef,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5981('0x10')]['tts']=function(_0x2b49f9){logger['info'](util[_0x5981('0x56')](_0x5981('0x1c6'),_0x2b49f9[_0x5981('0x35')]));_0x2b49f9[_0x5981('0x5f')]=_0x2b49f9[_0x5981('0x5f')][_0x5981('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5981('0xac')](_0x2b49f9[_0x5981('0x5f')])){return this[_0x5981('0x33')][_0x5981('0xad')](_0x5981('0xab'));}this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')]('Trying\x20Google\x20TTS\x20%s',_0x2b49f9[_0x5981('0x5f')]));var _0x2c9222=this[_0x5981('0x65')][_0x5981('0x74')](this,_0x2b49f9);if(_0x2c9222){this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')]('Google\x20TTS\x20%s\x20file\x20created',_0x2c9222));var _0x5bd3ab=this['channel'][_0x5981('0x103')](_0x2c9222);try{fs[_0x5981('0x104')](_0x2c9222+_0x5981('0x128'));}catch(_0xcdc01d){logger[_0x5981('0x2a')](_0xcdc01d);}return _0x5bd3ab;}return this[_0x5981('0x33')]['error'](_0x2b49f9,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5981('0x10')][_0x5981('0x1c7')]=function(_0x2b3756){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1c8'),_0x2b3756[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x2b3756[_0x5981('0x15b')])){return this['channel']['error'](_0x2b3756,'no\x20find\x20by\x20configured');}logger['info'](util[_0x5981('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x2b3756[_0x5981('0x15b')]));var _0xf2b680=this[_0x5981('0x52')][_0x5981('0x74')](this,_0x2b3756[_0x5981('0x15b')]);if(_0xf2b680){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x2b3756[_0x5981('0x15b')]));this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x15e'),this[_0x5981('0x33')][_0x5981('0x39')],_0x2b3756[_0x5981('0x15b')]));return{'code':0xc8,'result':_0x5981('0x15f')};}else{logger[_0x5981('0x2f')](util['format'](_0x5981('0x160'),this['channel'][_0x5981('0x39')],_0x2b3756[_0x5981('0x15b')]));this[_0x5981('0x33')]['noop'](util[_0x5981('0x56')](_0x5981('0x160'),this[_0x5981('0x33')][_0x5981('0x39')],_0x2b3756['findBy']));return{'code':0xc8,'result':_0x5981('0x161')};}};AGIVertices[_0x5981('0x10')][_0x5981('0x1c9')]=function(_0x2743c9){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1ca'),_0x2743c9['label']));var _0x278eee=this[_0x5981('0x33')][_0x5981('0x5a')](_0x5981('0x1cb'),[_0x2743c9[_0x5981('0x1cc')],_0x2743c9[_0x5981('0x7c')]]);if(_0x278eee[_0x5981('0xa6')]===-0x1){return _0x278eee;}return this[_0x5981('0x33')][_0x5981('0xad')](util[_0x5981('0x56')](_0x5981('0x173'),_0x5981('0x1cb'),_0x2743c9[_0x5981('0x1cc')]));};AGIVertices['prototype'][_0x5981('0x1cd')]=function(_0x54d37d){logger[_0x5981('0x2f')](util[_0x5981('0x56')](_0x5981('0x1ce'),_0x54d37d[_0x5981('0x35')]));if(!this[_0x5981('0xac')](_0x54d37d['variable_id'])){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x54d37d,_0x5981('0x1cf'));}var _0x1a5c32=this[_0x5981('0x11')][_0x5981('0x74')](this,_0x54d37d[_0x5981('0xd9')]);if(!_0x1a5c32){return this[_0x5981('0x33')][_0x5981('0x2a')](_0x54d37d,_0x5981('0xda'));}var _0x1e9366=this[_0x5981('0x33')][_0x5981('0x11')](_0x1a5c32);return{'code':0xc8,'result':_0x1e9366[_0x5981('0xa4')]?_0x1e9366[_0x5981('0xa4')]:'-'};};String[_0x5981('0x10')]['replaceAll']=function(_0x874376,_0x47913c){return this[_0x5981('0xa3')](_0x874376)[_0x5981('0x1d0')](_0x47913c);};module[_0x5981('0x1d1')]=AGIVertices;
\ No newline at end of file
index 7f9efc5..d0ef655 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8575=['syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','destlinkedid','savePause','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x44d26e,_0x11bdb2){var _0x361b3c=function(_0x52fae7){while(--_0x52fae7){_0x44d26e['push'](_0x44d26e['shift']());}};_0x361b3c(++_0x11bdb2);}(_0x8575,0xf8));var _0x5857=function(_0x312abe,_0x10511d){_0x312abe=_0x312abe-0x0;var _0x949d32=_0x8575[_0x312abe];return _0x949d32;};'use strict';var util=require('util');var _=require(_0x5857('0x0'));var moment=require(_0x5857('0x1'));var ami=require(_0x5857('0x2'));var logger=require(_0x5857('0x3'))(_0x5857('0x4'));var RpcUser=require(_0x5857('0x5'));var RpcVoiceAgentReport=require(_0x5857('0x6'));function Acw(_0x41514e){this[_0x5857('0x7')]=_0x41514e[_0x5857('0x7')];this[_0x5857('0x8')]=_0x41514e['agents'];this['timers']=_0x41514e[_0x5857('0x9')];this['channels']={};ami['on']('agentconnect',this[_0x5857('0xa')][_0x5857('0xb')](this));ami['on'](_0x5857('0xc'),this[_0x5857('0xd')][_0x5857('0xb')](this));ami['on'](_0x5857('0xe'),this[_0x5857('0xf')][_0x5857('0xb')](this));ami['on'](_0x5857('0x10'),this[_0x5857('0x11')]['bind'](this));ami['on'](_0x5857('0x12'),this[_0x5857('0x13')]['bind'](this));ami['on'](_0x5857('0x14'),this[_0x5857('0x15')]['bind'](this));ami['on'](_0x5857('0x16'),this['syncAgentConnectPreview'][_0x5857('0xb')](this));}function getDiff(_0x79b3ce){var _0x1957cc=moment()['milliseconds'](0x0);var _0x12d34c=moment(_0x79b3ce)[_0x5857('0x17')](0x0);return _0x1957cc[_0x5857('0x18')](_0x12d34c,_0x5857('0x19'));}Acw[_0x5857('0x1a')][_0x5857('0x1b')]=function(_0xde0cb9){try{var _0x538cc4=this;var _0x363438=this[_0x5857('0x1c')][_0xde0cb9][_0x5857('0x1d')];var _0x232fc1=this[_0x5857('0x1c')][_0xde0cb9][_0x5857('0x1e')];var _0x5ee8c0=this[_0x5857('0x7')][_0x232fc1];var _0x2ef9ce=![];var _0x244202=_0x5857('0x1f');if(_0x5ee8c0[_0x5857('0x20')]){if(_0x5ee8c0[_0x5857('0x21')][_0x5857('0x22')]){_0x2ef9ce=!![];_0x244202=_0x5ee8c0['mandatoryDispositionPause']['name'];}}ami[_0x5857('0x23')]({'action':_0x5857('0x24'),'interface':_0x363438,'paused':!![],'reason':_0x244202})[_0x5857('0x25')](function(_0xc890f4){if(_0x538cc4[_0x5857('0x8')][_0x363438]){return RpcUser[_0x5857('0x26')](_0x538cc4[_0x5857('0x8')][_0x363438]['id'])[_0x5857('0x25')](function(_0x321f62){if(_0x321f62&&!_0x321f62[_0x5857('0x27')]){logger[_0x5857('0x28')]('[%s][START][AGENT:%s][QUEUE:%s]',_0xde0cb9,_0x363438,_0x232fc1);var _0x1f7e10=_0x538cc4[_0x5857('0x1c')][_0xde0cb9]['attended']&&_0x538cc4[_0x5857('0x1c')][_0xde0cb9][_0x5857('0x29')]?_0x538cc4[_0x5857('0x1c')][_0xde0cb9][_0x5857('0x29')]:_0xde0cb9;return RpcUser[_0x5857('0x2a')](_0x538cc4['agents'][_0x363438],_0x244202,_0x1f7e10)['then'](function(_0x5dc749){if(!_0x2ef9ce){_0x538cc4[_0x5857('0x9')][_0x363438]={};logger[_0x5857('0x28')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xde0cb9,_0x538cc4[_0x5857('0x7')][_0x232fc1][_0x5857('0x2b')],_0x363438,_0x232fc1);_0x538cc4[_0x5857('0x9')][_0x363438]['timer']=setTimeout(_0x538cc4[_0x5857('0x2c')][_0x5857('0xb')](_0x538cc4,_0x363438),_0x538cc4['voiceQueues'][_0x232fc1][_0x5857('0x2b')]*0x3e8);_0x538cc4['timers'][_0x363438]['lastPauseAt']=moment()[_0x5857('0x2d')](_0x5857('0x2e'));_0x538cc4[_0x5857('0x9')][_0x363438][_0x5857('0x2f')]=_0xde0cb9;_0x538cc4[_0x5857('0x9')][_0x363438][_0x5857('0x1e')]=_0x232fc1;_0x538cc4['timers'][_0x363438][_0x5857('0x30')]=function(){var _0xc1b13=getDiff(_0x538cc4['timers'][_0x363438]['lastPauseAt']);clearTimeout(_0x538cc4[_0x5857('0x9')][_0x363438][_0x5857('0x31')]);_0x538cc4[_0x5857('0x9')][_0x363438][_0x5857('0x31')]=![];RpcVoiceAgentReport[_0x5857('0x32')]({'acwtime':_0xc1b13},_0x538cc4[_0x5857('0x9')][_0x363438][_0x5857('0x2f')],_0x363438)['then'](function(_0x13806f){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0xde0cb9,_0xc1b13,_0x13806f);})[_0x5857('0x33')](function(_0x395cc9){logger['error'](_0x5857('0x34'),_0xde0cb9,_0x395cc9);});delete _0x538cc4[_0x5857('0x9')][_0x363438];};}});}else{logger['info'](_0x5857('0x35'),_0xde0cb9,_0x363438,_0x232fc1);}});}})[_0x5857('0x33')](function(_0x2ec713){logger[_0x5857('0x36')](_0x5857('0x37'),_0xde0cb9,_0x538cc4[_0x5857('0x7')][_0x232fc1][_0x5857('0x2b')],_0x363438,_0x232fc1);})[_0x5857('0x38')](function(){delete _0x538cc4[_0x5857('0x1c')][_0xde0cb9];});}catch(_0x113697){logger[_0x5857('0x36')]('[ACW][START]\x20%s',_0x113697[_0x5857('0x39')]);}};Acw[_0x5857('0x1a')]['stopAcw']=function(_0x3358e3){try{var _0x42fb59=this;if(_0x42fb59[_0x5857('0x9')][_0x3358e3]){_0x42fb59[_0x5857('0x9')][_0x3358e3]['timer']=![];var _0x34a89c=_0x42fb59['timers'][_0x3358e3][_0x5857('0x2f')];var _0x4cb482=_0x42fb59[_0x5857('0x9')][_0x3358e3][_0x5857('0x1e')];var _0xfebe90=_0x42fb59[_0x5857('0x7')][_0x4cb482][_0x5857('0x2b')];logger['info'](_0x5857('0x3a'),_0x34a89c,_0x3358e3);RpcUser[_0x5857('0x3b')](this[_0x5857('0x8')][_0x3358e3]);RpcVoiceAgentReport['update']({'acwtime':_0xfebe90,'agentacw':!![]},_0x34a89c,_0x3358e3)[_0x5857('0x25')](function(_0x44b5d2){logger[_0x5857('0x28')](_0x5857('0x3c'),_0x34a89c,_0xfebe90,_0x44b5d2);})['catch'](function(_0x2c7997){logger[_0x5857('0x36')](_0x5857('0x34'),_0x34a89c,_0x2c7997);});}else{logger['error'](_0x5857('0x3d'),_0x3358e3);if(_0x42fb59[_0x5857('0x9')]){logger[_0x5857('0x28')](_0x5857('0x3e'),JSON[_0x5857('0x3f')](_0x42fb59[_0x5857('0x9')]));}}}catch(_0x376856){logger['error'](_0x5857('0x40'),_0x376856['message']);}};Acw[_0x5857('0x1a')][_0x5857('0xa')]=function(_0x3752d6){try{if(this[_0x5857('0x7')][_0x3752d6[_0x5857('0x1e')]]&&(this[_0x5857('0x7')][_0x3752d6[_0x5857('0x1e')]][_0x5857('0x4')]||this[_0x5857('0x7')][_0x3752d6[_0x5857('0x1e')]]['mandatoryDisposition'])){if(this['agents'][_0x3752d6[_0x5857('0x1d')]]){this['channels'][_0x3752d6[_0x5857('0x2f')]]={'queue':_0x3752d6['queue'],'interface':_0x3752d6[_0x5857('0x1d')],'destlinkedid':_0x3752d6[_0x5857('0x29')]};}}}catch(_0x19a409){logger[_0x5857('0x36')]('[ACW][syncAgentConnect]\x20%s',_0x19a409[_0x5857('0x39')]);}};Acw[_0x5857('0x1a')][_0x5857('0x41')]=function(_0x3a2586){try{if(this[_0x5857('0x7')][_0x3a2586[_0x5857('0x1e')]]&&(this['voiceQueues'][_0x3a2586[_0x5857('0x1e')]]['acw']||this[_0x5857('0x7')][_0x3a2586['queue']][_0x5857('0x20')])){if(this['agents'][_0x3a2586[_0x5857('0x1d')]]){this['channels'][_0x3a2586['uniqueid']]={'queue':_0x3a2586[_0x5857('0x1e')],'interface':_0x3a2586[_0x5857('0x1d')]};}}}catch(_0x100044){logger[_0x5857('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x100044[_0x5857('0x39')]);}};Acw['prototype']['syncHangupRequest']=function(_0x2e4d32){try{if(this[_0x5857('0x1c')][_0x2e4d32[_0x5857('0x2f')]]&&_['isUndefined'](this[_0x5857('0x1c')][_0x2e4d32[_0x5857('0x2f')]][_0x5857('0x42')])){logger[_0x5857('0x28')](_0x5857('0x43'),_0x2e4d32[_0x5857('0x2f')]);this['startAcw'](_0x2e4d32[_0x5857('0x2f')]);}else if(this[_0x5857('0x1c')][_0x2e4d32[_0x5857('0x44')]]&&_['isUndefined'](this[_0x5857('0x1c')][_0x2e4d32[_0x5857('0x44')]][_0x5857('0x42')])){logger[_0x5857('0x28')](_0x5857('0x45'),_0x2e4d32[_0x5857('0x44')]);this[_0x5857('0x1b')](_0x2e4d32[_0x5857('0x44')]);}}catch(_0x5d66f2){logger[_0x5857('0x36')]('[ACW][syncHangupRequest]\x20%s',_0x5d66f2['message']);}};Acw[_0x5857('0x1a')]['syncHangup']=function(_0x2a1267){try{if(this[_0x5857('0x1c')][_0x2a1267[_0x5857('0x2f')]]&&this['channels'][_0x2a1267['uniqueid']][_0x5857('0x42')]){logger[_0x5857('0x28')](_0x5857('0x46'),_0x2a1267['uniqueid']);this[_0x5857('0x1b')](_0x2a1267['uniqueid']);}else if(this[_0x5857('0x1c')][_0x2a1267[_0x5857('0x44')]]&&this['channels'][_0x2a1267[_0x5857('0x44')]][_0x5857('0x42')]){logger[_0x5857('0x28')](_0x5857('0x47'),_0x2a1267['linkedid']);this[_0x5857('0x1b')](_0x2a1267[_0x5857('0x44')]);}}catch(_0xafd768){logger['error'](_0x5857('0x48'),_0xafd768[_0x5857('0x39')]);}};Acw[_0x5857('0x1a')][_0x5857('0x13')]=function(_0x1f99ef){try{if(!_[_0x5857('0x49')](this[_0x5857('0x1c')][_0x1f99ef[_0x5857('0x4a')]])){this[_0x5857('0x1b')](_0x1f99ef[_0x5857('0x4a')]);if(this[_0x5857('0x1c')][_0x1f99ef['secondtransfereruniqueid']]){this['channels'][_0x1f99ef[_0x5857('0x4b')]][_0x5857('0x42')]=!![];this[_0x5857('0x1c')][_0x1f99ef[_0x5857('0x4c')]]=this[_0x5857('0x1c')][_0x1f99ef[_0x5857('0x4b')]];delete this['channels'][_0x1f99ef[_0x5857('0x4b')]];}}else if(!_['isNil'](this['channels'][_0x1f99ef['transfertargetuniqueid']])){this['startAcw'](_0x1f99ef['transfertargetuniqueid']);if(this[_0x5857('0x1c')][_0x1f99ef['origtransfereruniqueid']]){this[_0x5857('0x1c')][_0x1f99ef[_0x5857('0x4d')]]['attended']=!![];this[_0x5857('0x1c')][_0x1f99ef[_0x5857('0x4a')]]=this[_0x5857('0x1c')][_0x1f99ef['origtransfereruniqueid']];delete this[_0x5857('0x1c')][_0x1f99ef['origtransfereruniqueid']];}}}catch(_0x185ba6){logger['error'](_0x5857('0x4e'),_0x185ba6[_0x5857('0x39')]);}};Acw['prototype'][_0x5857('0x15')]=function(_0x5a179c){try{if(this[_0x5857('0x1c')][_0x5a179c[_0x5857('0x4f')]]){logger[_0x5857('0x28')](_0x5857('0x50'),JSON[_0x5857('0x3f')](_0x5a179c[_0x5857('0x4f')]));this[_0x5857('0x1b')](_0x5a179c[_0x5857('0x4f')]);}else if(this[_0x5857('0x1c')][_0x5a179c[_0x5857('0x51')]]){logger[_0x5857('0x28')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x5857('0x3f')](_0x5a179c['transfererlinkedid']));this['startAcw'](_0x5a179c[_0x5857('0x51')]);}}catch(_0x13ed2a){logger[_0x5857('0x36')](_0x5857('0x52'),_0x13ed2a['message']);}};Acw['prototype'][_0x5857('0x11')]=function(_0x10d5f5){try{if(this[_0x5857('0x7')][_0x10d5f5[_0x5857('0x1e')]]&&this[_0x5857('0x7')][_0x10d5f5[_0x5857('0x1e')]][_0x5857('0x53')]===_0x5857('0x54')){if(this[_0x5857('0x8')][_0x10d5f5['interface']]){logger['info'](_0x5857('0x55'),_0x10d5f5[_0x5857('0x2f')],_0x10d5f5['interface'],_0x10d5f5[_0x5857('0x1e')]);return RpcUser['savePause'](this[_0x5857('0x8')][_0x10d5f5['interface']],_0x5857('0x56'),_0x10d5f5[_0x5857('0x2f')]);}}}catch(_0x1b7b6b){logger[_0x5857('0x36')](_0x5857('0x57'),_0x1b7b6b[_0x5857('0x39')]);}};module[_0x5857('0x58')]=Acw;
\ No newline at end of file
+var _0x7524=['isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','interface','ACW','name','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','stringify','[ACW][STOP]\x20%s','message','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x7524,0x155));var _0x4752=function(_0x233a46,_0x2b5d55){_0x233a46=_0x233a46-0x0;var _0x7aff02=_0x7524[_0x233a46];return _0x7aff02;};'use strict';var util=require(_0x4752('0x0'));var _=require(_0x4752('0x1'));var moment=require(_0x4752('0x2'));var ami=require(_0x4752('0x3'));var logger=require('../../../config/logger')(_0x4752('0x4'));var RpcUser=require(_0x4752('0x5'));var RpcVoiceAgentReport=require(_0x4752('0x6'));function Acw(_0x3d24e7){this[_0x4752('0x7')]=_0x3d24e7['voiceQueues'];this['agents']=_0x3d24e7[_0x4752('0x8')];this[_0x4752('0x9')]=_0x3d24e7[_0x4752('0x9')];this[_0x4752('0xa')]={};ami['on'](_0x4752('0xb'),this[_0x4752('0xc')]['bind'](this));ami['on'](_0x4752('0xd'),this[_0x4752('0xe')][_0x4752('0xf')](this));ami['on'](_0x4752('0x10'),this[_0x4752('0x11')][_0x4752('0xf')](this));ami['on'](_0x4752('0x12'),this[_0x4752('0x13')][_0x4752('0xf')](this));ami['on'](_0x4752('0x14'),this['syncAttendedTransfer'][_0x4752('0xf')](this));ami['on']('blindtransfer',this[_0x4752('0x15')][_0x4752('0xf')](this));ami['on'](_0x4752('0x16'),this[_0x4752('0x17')][_0x4752('0xf')](this));}function getDiff(_0x2574f2){var _0x338eaa=moment()['milliseconds'](0x0);var _0x133865=moment(_0x2574f2)['milliseconds'](0x0);return _0x338eaa[_0x4752('0x18')](_0x133865,_0x4752('0x19'));}Acw[_0x4752('0x1a')]['startAcw']=function(_0x2413fb){try{var _0xcb88c4=this;var _0x260c04=this[_0x4752('0xa')][_0x2413fb][_0x4752('0x1b')];var _0x27b517=this[_0x4752('0xa')][_0x2413fb]['queue'];var _0x4bb5be=this['voiceQueues'][_0x27b517];var _0x13c9a9=![];var _0x18da0c=_0x4752('0x1c');if(_0x4bb5be['mandatoryDisposition']){if(_0x4bb5be['mandatoryDispositionPause'][_0x4752('0x1d')]){_0x13c9a9=!![];_0x18da0c=_0x4bb5be[_0x4752('0x1e')][_0x4752('0x1d')];}}ami[_0x4752('0x1f')]({'action':'QueuePause','interface':_0x260c04,'paused':!![],'reason':_0x18da0c})[_0x4752('0x20')](function(_0x12105d){if(_0xcb88c4[_0x4752('0x8')][_0x260c04]){return RpcUser[_0x4752('0x21')](_0xcb88c4['agents'][_0x260c04]['id'])[_0x4752('0x20')](function(_0x4b8ce2){if(_0x4b8ce2&&!_0x4b8ce2[_0x4752('0x22')]){logger[_0x4752('0x23')](_0x4752('0x24'),_0x2413fb,_0x260c04,_0x27b517);var _0xeb79a5=_0xcb88c4[_0x4752('0xa')][_0x2413fb][_0x4752('0x25')]&&_0xcb88c4['channels'][_0x2413fb]['destlinkedid']?_0xcb88c4[_0x4752('0xa')][_0x2413fb][_0x4752('0x26')]:_0x2413fb;return RpcUser['savePause'](_0xcb88c4[_0x4752('0x8')][_0x260c04],_0x18da0c,_0xeb79a5)[_0x4752('0x20')](function(_0x5d95a9){if(!_0x13c9a9){_0xcb88c4[_0x4752('0x9')][_0x260c04]={};logger[_0x4752('0x23')](_0x4752('0x27'),_0x2413fb,_0xcb88c4[_0x4752('0x7')][_0x27b517][_0x4752('0x28')],_0x260c04,_0x27b517);_0xcb88c4[_0x4752('0x9')][_0x260c04][_0x4752('0x29')]=setTimeout(_0xcb88c4['stopAcw']['bind'](_0xcb88c4,_0x260c04),_0xcb88c4['voiceQueues'][_0x27b517][_0x4752('0x28')]*0x3e8);_0xcb88c4[_0x4752('0x9')][_0x260c04]['lastPauseAt']=moment()['format'](_0x4752('0x2a'));_0xcb88c4[_0x4752('0x9')][_0x260c04][_0x4752('0x2b')]=_0x2413fb;_0xcb88c4[_0x4752('0x9')][_0x260c04][_0x4752('0x2c')]=_0x27b517;_0xcb88c4['timers'][_0x260c04][_0x4752('0x2d')]=function(){var _0xfe66df=getDiff(_0xcb88c4[_0x4752('0x9')][_0x260c04][_0x4752('0x2e')]);clearTimeout(_0xcb88c4['timers'][_0x260c04][_0x4752('0x29')]);_0xcb88c4['timers'][_0x260c04][_0x4752('0x29')]=![];RpcVoiceAgentReport[_0x4752('0x2f')]({'acwtime':_0xfe66df},_0xcb88c4[_0x4752('0x9')][_0x260c04][_0x4752('0x2b')],_0x260c04)[_0x4752('0x20')](function(_0x486365){logger['info'](_0x4752('0x30'),_0x2413fb,_0xfe66df,_0x486365);})[_0x4752('0x31')](function(_0xcd3e9b){logger[_0x4752('0x32')](_0x4752('0x33'),_0x2413fb,_0xcd3e9b);});delete _0xcb88c4[_0x4752('0x9')][_0x260c04];};}});}else{logger['info'](_0x4752('0x34'),_0x2413fb,_0x260c04,_0x27b517);}});}})[_0x4752('0x31')](function(_0x565e2a){logger['error'](_0x4752('0x27'),_0x2413fb,_0xcb88c4[_0x4752('0x7')][_0x27b517][_0x4752('0x28')],_0x260c04,_0x27b517);})[_0x4752('0x35')](function(){delete _0xcb88c4[_0x4752('0xa')][_0x2413fb];});}catch(_0x21031c){logger[_0x4752('0x32')](_0x4752('0x36'),_0x21031c['message']);}};Acw[_0x4752('0x1a')]['stopAcw']=function(_0x317334){try{var _0x141f02=this;if(_0x141f02[_0x4752('0x9')][_0x317334]){_0x141f02['timers'][_0x317334][_0x4752('0x29')]=![];var _0x55d7d1=_0x141f02[_0x4752('0x9')][_0x317334]['uniqueid'];var _0x4e95f7=_0x141f02[_0x4752('0x9')][_0x317334]['queue'];var _0x5bb930=_0x141f02['voiceQueues'][_0x4e95f7][_0x4752('0x28')];logger[_0x4752('0x23')](_0x4752('0x37'),_0x55d7d1,_0x317334);RpcUser[_0x4752('0x38')](this['agents'][_0x317334]);RpcVoiceAgentReport[_0x4752('0x2f')]({'acwtime':_0x5bb930,'agentacw':!![]},_0x55d7d1,_0x317334)[_0x4752('0x20')](function(_0x268439){logger[_0x4752('0x23')](_0x4752('0x30'),_0x55d7d1,_0x5bb930,_0x268439);})[_0x4752('0x31')](function(_0x32b845){logger[_0x4752('0x32')](_0x4752('0x33'),_0x55d7d1,_0x32b845);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x317334);if(_0x141f02[_0x4752('0x9')]){logger['info']('[ACW][TIMERS]',JSON[_0x4752('0x39')](_0x141f02[_0x4752('0x9')]));}}}catch(_0x5641b2){logger['error'](_0x4752('0x3a'),_0x5641b2[_0x4752('0x3b')]);}};Acw[_0x4752('0x1a')][_0x4752('0xc')]=function(_0x33e34b){try{if(this[_0x4752('0x7')][_0x33e34b['queue']]&&(this[_0x4752('0x7')][_0x33e34b[_0x4752('0x2c')]][_0x4752('0x4')]||this[_0x4752('0x7')][_0x33e34b[_0x4752('0x2c')]][_0x4752('0x3c')])){if(this[_0x4752('0x8')][_0x33e34b['interface']]){this[_0x4752('0xa')][_0x33e34b[_0x4752('0x2b')]]={'queue':_0x33e34b['queue'],'interface':_0x33e34b['interface'],'destlinkedid':_0x33e34b[_0x4752('0x26')]};}}}catch(_0x54a79f){logger[_0x4752('0x32')](_0x4752('0x3d'),_0x54a79f[_0x4752('0x3b')]);}};Acw[_0x4752('0x1a')][_0x4752('0x17')]=function(_0x44c806){try{if(this[_0x4752('0x7')][_0x44c806[_0x4752('0x2c')]]&&(this[_0x4752('0x7')][_0x44c806[_0x4752('0x2c')]][_0x4752('0x4')]||this[_0x4752('0x7')][_0x44c806[_0x4752('0x2c')]][_0x4752('0x3c')])){if(this[_0x4752('0x8')][_0x44c806[_0x4752('0x1b')]]){this[_0x4752('0xa')][_0x44c806[_0x4752('0x2b')]]={'queue':_0x44c806[_0x4752('0x2c')],'interface':_0x44c806[_0x4752('0x1b')]};}}}catch(_0x3d873e){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x3d873e[_0x4752('0x3b')]);}};Acw[_0x4752('0x1a')][_0x4752('0xe')]=function(_0x3dcf4b){try{if(this[_0x4752('0xa')][_0x3dcf4b[_0x4752('0x2b')]]&&_[_0x4752('0x3e')](this[_0x4752('0xa')][_0x3dcf4b[_0x4752('0x2b')]][_0x4752('0x25')])){logger[_0x4752('0x23')]('[%s][HANGUP:UNIQUEID]',_0x3dcf4b[_0x4752('0x2b')]);this[_0x4752('0x3f')](_0x3dcf4b[_0x4752('0x2b')]);}else if(this[_0x4752('0xa')][_0x3dcf4b['linkedid']]&&_['isUndefined'](this['channels'][_0x3dcf4b[_0x4752('0x40')]][_0x4752('0x25')])){logger['info'](_0x4752('0x41'),_0x3dcf4b['linkedid']);this[_0x4752('0x3f')](_0x3dcf4b[_0x4752('0x40')]);}}catch(_0x47897b){logger[_0x4752('0x32')](_0x4752('0x42'),_0x47897b[_0x4752('0x3b')]);}};Acw['prototype'][_0x4752('0x11')]=function(_0x45a795){try{if(this[_0x4752('0xa')][_0x45a795[_0x4752('0x2b')]]&&this['channels'][_0x45a795[_0x4752('0x2b')]]['attended']){logger[_0x4752('0x23')](_0x4752('0x43'),_0x45a795[_0x4752('0x2b')]);this[_0x4752('0x3f')](_0x45a795[_0x4752('0x2b')]);}else if(this[_0x4752('0xa')][_0x45a795[_0x4752('0x40')]]&&this[_0x4752('0xa')][_0x45a795[_0x4752('0x40')]][_0x4752('0x25')]){logger[_0x4752('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x45a795[_0x4752('0x40')]);this[_0x4752('0x3f')](_0x45a795[_0x4752('0x40')]);}}catch(_0x52db45){logger[_0x4752('0x32')]('[ACW][syncHangup]\x20%s',_0x52db45['message']);}};Acw[_0x4752('0x1a')][_0x4752('0x44')]=function(_0x56884d){try{if(!_[_0x4752('0x45')](this[_0x4752('0xa')][_0x56884d[_0x4752('0x46')]])){this['startAcw'](_0x56884d[_0x4752('0x46')]);if(this[_0x4752('0xa')][_0x56884d['secondtransfereruniqueid']]){this['channels'][_0x56884d[_0x4752('0x47')]]['attended']=!![];this[_0x4752('0xa')][_0x56884d[_0x4752('0x48')]]=this[_0x4752('0xa')][_0x56884d[_0x4752('0x47')]];delete this[_0x4752('0xa')][_0x56884d[_0x4752('0x47')]];}}else if(!_[_0x4752('0x45')](this[_0x4752('0xa')][_0x56884d[_0x4752('0x48')]])){this[_0x4752('0x3f')](_0x56884d['transfertargetuniqueid']);if(this['channels'][_0x56884d[_0x4752('0x49')]]){this[_0x4752('0xa')][_0x56884d['origtransfereruniqueid']][_0x4752('0x25')]=!![];this[_0x4752('0xa')][_0x56884d[_0x4752('0x46')]]=this[_0x4752('0xa')][_0x56884d[_0x4752('0x49')]];delete this[_0x4752('0xa')][_0x56884d[_0x4752('0x49')]];}}}catch(_0x43d92b){logger[_0x4752('0x32')](_0x4752('0x4a'),_0x43d92b[_0x4752('0x3b')]);}};Acw[_0x4752('0x1a')][_0x4752('0x15')]=function(_0x2d025b){try{if(this[_0x4752('0xa')][_0x2d025b[_0x4752('0x4b')]]){logger[_0x4752('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x2d025b[_0x4752('0x4b')]));this[_0x4752('0x3f')](_0x2d025b['transfereruniqueid']);}else if(this[_0x4752('0xa')][_0x2d025b[_0x4752('0x4c')]]){logger[_0x4752('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4752('0x39')](_0x2d025b[_0x4752('0x4c')]));this[_0x4752('0x3f')](_0x2d025b['transfererlinkedid']);}}catch(_0x418a9a){logger[_0x4752('0x32')](_0x4752('0x4d'),_0x418a9a[_0x4752('0x3b')]);}};Acw[_0x4752('0x1a')][_0x4752('0x13')]=function(_0x23582c){try{if(this[_0x4752('0x7')][_0x23582c[_0x4752('0x2c')]]&&this[_0x4752('0x7')][_0x23582c[_0x4752('0x2c')]][_0x4752('0x4e')]==='all'){if(this[_0x4752('0x8')][_0x23582c[_0x4752('0x1b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x23582c['uniqueid'],_0x23582c[_0x4752('0x1b')],_0x23582c[_0x4752('0x2c')]);return RpcUser[_0x4752('0x4f')](this[_0x4752('0x8')][_0x23582c['interface']],_0x4752('0x50'),_0x23582c[_0x4752('0x2b')]);}}}catch(_0x4b47a3){logger[_0x4752('0x32')](_0x4752('0x51'),_0x4b47a3[_0x4752('0x3b')]);}};module['exports']=Acw;
\ No newline at end of file
index 0b8739e..50a2361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x137a=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','promisify','action','error','format'];(function(_0x148fdd,_0x5b7e88){var _0x3b1946=function(_0x3777a9){while(--_0x3777a9){_0x148fdd['push'](_0x148fdd['shift']());}};_0x3b1946(++_0x5b7e88);}(_0x137a,0x1be));var _0xa137=function(_0x49da24,_0x124150){_0x49da24=_0x49da24-0x0;var _0x440e19=_0x137a[_0x49da24];return _0x440e19;};'use strict';var Manager=require(_0xa137('0x0'));var BPromise=require(_0xa137('0x1'));var moment=require(_0xa137('0x2'));var util=require('util');var _=require(_0xa137('0x3'));var logger=require(_0xa137('0x4'))(_0xa137('0x5'));var config=require(_0xa137('0x6'));var ami=new Manager(config[_0xa137('0x7')][_0xa137('0x8')],config[_0xa137('0x7')]['ip'],config['asterisk'][_0xa137('0x9')],config['asterisk'][_0xa137('0xa')],!![]);ami[_0xa137('0xb')]();ami['Action']=BPromise[_0xa137('0xc')](ami[_0xa137('0xd')]);function error(_0x5725a1){logger[_0xa137('0xe')](util[_0xa137('0xf')](_0xa137('0x10'),config[_0xa137('0x7')][_0xa137('0x9')],config['asterisk']['ip'],config[_0xa137('0x7')][_0xa137('0x8')],util[_0xa137('0x11')](_0x5725a1,![],null)));}function close(){logger[_0xa137('0xe')](util['format'](_0xa137('0x12'),config[_0xa137('0x7')]['username'],config['asterisk']['ip'],config[_0xa137('0x7')][_0xa137('0x8')]));}ami[_0xa137('0x13')]=function(){return function(){return ami[_0xa137('0x14')]({'action':'sipshowregistry'});};};ami[_0xa137('0x15')]=function(){return function(){return ami[_0xa137('0x14')]({'action':_0xa137('0x16')});};};ami[_0xa137('0x17')]=function(){return function(){return ami[_0xa137('0x14')]({'action':_0xa137('0x18')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa137('0x14')]({'action':_0xa137('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xa137('0x14')]({'action':_0xa137('0x1a')});};};function connect(_0x4b43e){logger[_0xa137('0x1b')](util[_0xa137('0xf')](_0xa137('0x1c'),config[_0xa137('0x7')][_0xa137('0x9')],config['asterisk']['ip'],config[_0xa137('0x7')][_0xa137('0x8')]));ami['once']('error',error);ami[_0xa137('0x1d')](_0xa137('0x1e'),close);}ami['on'](_0xa137('0x1f'),connect);ami['on'](_0xa137('0x20'),function(_0x31b717){logger['info'](util[_0xa137('0xf')](_0xa137('0x21'),config[_0xa137('0x7')][_0xa137('0x9')],config[_0xa137('0x7')]['ip'],config[_0xa137('0x7')][_0xa137('0x8')],util[_0xa137('0x11')](_0x31b717,![],null)));});ami['on'](_0xa137('0x22'),function(_0x5053cc){logger[_0xa137('0x1b')](util['format'](_0xa137('0x23'),config['asterisk'][_0xa137('0x9')],config['asterisk']['ip'],config[_0xa137('0x7')][_0xa137('0x8')]));return BPromise[_0xa137('0x24')]()[_0xa137('0x25')](ami[_0xa137('0x13')]())[_0xa137('0x25')](ami[_0xa137('0x15')]())[_0xa137('0x25')](ami[_0xa137('0x17')]())['then'](ami[_0xa137('0x26')]())[_0xa137('0x25')](ami['actionCoreShowChannels']())[_0xa137('0x27')](function(_0x46d11b){console[_0xa137('0x28')](_0x46d11b);});});ami[_0xa137('0x1d')](_0xa137('0xe'),error);ami['once']('close',close);module[_0xa137('0x29')]=ami;
\ No newline at end of file
+var _0x2c06=['inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','format','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipPeerStatus','actionQueueSummary','catch','log','exports','asterisk-manager','bluebird','moment','util','lodash','ami','../../config/environment','asterisk','port','username','password','Action','promisify','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0xb59a68,_0x1033ea){var _0x2839bf=function(_0x1f10f5){while(--_0x1f10f5){_0xb59a68['push'](_0xb59a68['shift']());}};_0x2839bf(++_0x1033ea);}(_0x2c06,0xca));var _0x62c0=function(_0x4ca1dc,_0x2ca627){_0x4ca1dc=_0x4ca1dc-0x0;var _0x4218e3=_0x2c06[_0x4ca1dc];return _0x4218e3;};'use strict';var Manager=require(_0x62c0('0x0'));var BPromise=require(_0x62c0('0x1'));var moment=require(_0x62c0('0x2'));var util=require(_0x62c0('0x3'));var _=require(_0x62c0('0x4'));var logger=require('../../config/logger')(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var ami=new Manager(config[_0x62c0('0x7')][_0x62c0('0x8')],config[_0x62c0('0x7')]['ip'],config[_0x62c0('0x7')][_0x62c0('0x9')],config[_0x62c0('0x7')][_0x62c0('0xa')],!![]);ami['keepConnected']();ami[_0x62c0('0xb')]=BPromise[_0x62c0('0xc')](ami['action']);function error(_0x5309f9){logger['error'](util['format'](_0x62c0('0xd'),config['asterisk'][_0x62c0('0x9')],config['asterisk']['ip'],config[_0x62c0('0x7')][_0x62c0('0x8')],util[_0x62c0('0xe')](_0x5309f9,![],null)));}function close(){logger['error'](util['format'](_0x62c0('0xf'),config[_0x62c0('0x7')][_0x62c0('0x9')],config[_0x62c0('0x7')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x62c0('0x10')});};};ami[_0x62c0('0x11')]=function(){return function(){return ami[_0x62c0('0xb')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0x62c0('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x62c0('0xb')]({'action':_0x62c0('0x13')});};};ami[_0x62c0('0x14')]=function(){return function(){return ami[_0x62c0('0xb')]({'action':_0x62c0('0x15')});};};function connect(_0x5a0029){logger['info'](util[_0x62c0('0x16')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x62c0('0x7')]['username'],config['asterisk']['ip'],config[_0x62c0('0x7')][_0x62c0('0x8')]));ami[_0x62c0('0x17')]('error',error);ami['once'](_0x62c0('0x18'),close);}ami['on'](_0x62c0('0x19'),connect);ami['on'](_0x62c0('0x1a'),function(_0x1381a2){logger['info'](util['format'](_0x62c0('0x1b'),config[_0x62c0('0x7')][_0x62c0('0x9')],config[_0x62c0('0x7')]['ip'],config[_0x62c0('0x7')][_0x62c0('0x8')],util[_0x62c0('0xe')](_0x1381a2,![],null)));});ami['on'](_0x62c0('0x1c'),function(_0x42bf0){logger['info'](util['format'](_0x62c0('0x1d'),config[_0x62c0('0x7')]['username'],config[_0x62c0('0x7')]['ip'],config[_0x62c0('0x7')]['port']));return BPromise['resolve']()[_0x62c0('0x1e')](ami['actionSipShowRegistry']())[_0x62c0('0x1e')](ami[_0x62c0('0x11')]())[_0x62c0('0x1e')](ami[_0x62c0('0x1f')]())['then'](ami[_0x62c0('0x20')]())[_0x62c0('0x1e')](ami['actionCoreShowChannels']())[_0x62c0('0x21')](function(_0x3a63a2){console[_0x62c0('0x22')](_0x3a63a2);});});ami[_0x62c0('0x17')]('error',error);ami[_0x62c0('0x17')](_0x62c0('0x18'),close);module[_0x62c0('0x23')]=ami;
\ No newline at end of file
index da90e56..1b84118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xcb91[_0x20589d];return _0x422de9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client;
\ No newline at end of file
+var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0xac4a,0x13f));var _0xaac4=function(_0x308705,_0x4c27dd){_0x308705=_0x308705-0x0;var _0x1429da=_0xac4a[_0x308705];return _0x1429da;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client;
\ No newline at end of file
index e63e8d9..46c258c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a69=['moment','isNil','string','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','queue','exports','lodash'];(function(_0x7c4541,_0x48ff1c){var _0x442239=function(_0x38c424){while(--_0x38c424){_0x7c4541['push'](_0x7c4541['shift']());}};_0x442239(++_0x48ff1c);}(_0x3a69,0x1a3));var _0x93a6=function(_0x4b6178,_0x1771c6){_0x4b6178=_0x4b6178-0x0;var _0xbe3fe3=_0x3a69[_0x4b6178];return _0xbe3fe3;};'use strict';var util=require('util');var _=require(_0x93a6('0x0'));var moment=require(_0x93a6('0x1'));function checkNameSurname(_0x4d47e8,_0xf62d75,_0x502b16){var _0x23b69e='';if(!_[_0x93a6('0x2')](_0xf62d75)&&_0x93a6('0x3')===typeof _0xf62d75){_0x23b69e+=_0xf62d75;}if(!_[_0x93a6('0x2')](_0x502b16)&&_0x93a6('0x3')===typeof _0x502b16){_0x23b69e+='\x20'+_0x502b16;}if(_0x23b69e!==''){return _0x23b69e;}return _0x4d47e8;}function Action(_0x433c3a,_0x26a1a4,_0x1e1465){this['voiceQueue']=_0x433c3a;this[_0x93a6('0x4')]=_0x1e1465||undefined;this[_0x93a6('0x5')]=checkNameSurname(_0x26a1a4[_0x93a6('0x6')][_0x93a6('0x7')],_0x26a1a4['Contact'][_0x93a6('0x8')],_0x26a1a4['Contact']['lastName']);this[_0x93a6('0x9')]=_0x26a1a4[_0x93a6('0x7')];this['queue']=_0x433c3a[_0x93a6('0x5')];this[_0x93a6('0xa')]=_0x26a1a4['active']||![];this[_0x93a6('0xb')]=_0x433c3a['type'];this[_0x93a6('0xc')]=_0x433c3a['dialQueueTimeout']||0x3;this[_0x93a6('0xd')]=_0x26a1a4['scheduledat'];this[_0x93a6('0xe')]=_0x26a1a4[_0x93a6('0xe')];this[_0x93a6('0xf')]=_0x26a1a4[_0x93a6('0xf')];this['countnoanswerretry']=_0x26a1a4[_0x93a6('0x10')];this['countnosuchnumberretry']=_0x26a1a4[_0x93a6('0x11')];this[_0x93a6('0x12')]=_0x26a1a4['countdropretry'];this[_0x93a6('0x13')]=_0x26a1a4['countabandonedretry'];this[_0x93a6('0x14')]=_0x26a1a4[_0x93a6('0x14')];this['countagentrejectretry']=_0x26a1a4['countagentrejectretry'];this[_0x93a6('0x15')]=_0x26a1a4[_0x93a6('0x15')];this[_0x93a6('0x16')]=_0x26a1a4[_0x93a6('0x16')];this[_0x93a6('0x17')]=_0x26a1a4[_0x93a6('0x17')];this[_0x93a6('0x18')]=_0x26a1a4[_0x93a6('0x18')];this[_0x93a6('0x19')]=_0x26a1a4[_0x93a6('0x19')];this[_0x93a6('0x1a')]=_0x26a1a4['id'];this[_0x93a6('0x1b')]=_0x26a1a4['Contact'][_0x93a6('0x8')]||'';this[_0x93a6('0x1c')]=moment()[_0x93a6('0x1d')](_0x93a6('0x1e'));this['callback']=_0x26a1a4['callback'];this['callbackuniqueid']=_0x26a1a4[_0x93a6('0x1f')];this[_0x93a6('0x20')]=_0x26a1a4[_0x93a6('0x20')];this[_0x93a6('0x21')]=_0x26a1a4['recallme'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x93a6('0x22')][_0x93a6('0x23')]=function(){return util[_0x93a6('0x1d')](_0x93a6('0x24'),this[_0x93a6('0x5')],this[_0x93a6('0x25')]['dialCutDigit']>0x0?this[_0x93a6('0x9')]['substring'](this[_0x93a6('0x25')][_0x93a6('0x26')]):this['number']);};Action[_0x93a6('0x22')][_0x93a6('0x27')]=function(){return this[_0x93a6('0x28')];};module[_0x93a6('0x29')]=Action;
\ No newline at end of file
+var _0x06f2=['dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','exports','moment','string','voiceQueue','uniqueid','name','Contact','phone','lastName','active','type'];(function(_0xfb643a,_0x24e82f){var _0x2e0078=function(_0x35165e){while(--_0x35165e){_0xfb643a['push'](_0xfb643a['shift']());}};_0x2e0078(++_0x24e82f);}(_0x06f2,0x9e));var _0x206f=function(_0x5e1118,_0xc78599){_0x5e1118=_0x5e1118-0x0;var _0x195277=_0x06f2[_0x5e1118];return _0x195277;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x206f('0x0'));function checkNameSurname(_0x3d0245,_0x376efc,_0x3c0824){var _0x2d3336='';if(!_['isNil'](_0x376efc)&&_0x206f('0x1')===typeof _0x376efc){_0x2d3336+=_0x376efc;}if(!_['isNil'](_0x3c0824)&&'string'===typeof _0x3c0824){_0x2d3336+='\x20'+_0x3c0824;}if(_0x2d3336!==''){return _0x2d3336;}return _0x3d0245;}function Action(_0x3d7781,_0x2d3ed7,_0x2c1a2a){this[_0x206f('0x2')]=_0x3d7781;this[_0x206f('0x3')]=_0x2c1a2a||undefined;this[_0x206f('0x4')]=checkNameSurname(_0x2d3ed7[_0x206f('0x5')][_0x206f('0x6')],_0x2d3ed7[_0x206f('0x5')]['firstName'],_0x2d3ed7[_0x206f('0x5')][_0x206f('0x7')]);this['number']=_0x2d3ed7['phone'];this['queue']=_0x3d7781[_0x206f('0x4')];this['active']=_0x2d3ed7[_0x206f('0x8')]||![];this[_0x206f('0x9')]=_0x3d7781[_0x206f('0x9')];this[_0x206f('0xa')]=_0x3d7781[_0x206f('0xa')]||0x3;this['scheduledat']=_0x2d3ed7['scheduledat'];this[_0x206f('0xb')]=_0x2d3ed7[_0x206f('0xb')];this['countcongestionretry']=_0x2d3ed7[_0x206f('0xc')];this[_0x206f('0xd')]=_0x2d3ed7[_0x206f('0xd')];this[_0x206f('0xe')]=_0x2d3ed7['countnosuchnumberretry'];this[_0x206f('0xf')]=_0x2d3ed7[_0x206f('0xf')];this[_0x206f('0x10')]=_0x2d3ed7[_0x206f('0x10')];this['countmachineretry']=_0x2d3ed7['countmachineretry'];this[_0x206f('0x11')]=_0x2d3ed7[_0x206f('0x11')];this[_0x206f('0x12')]=_0x2d3ed7[_0x206f('0x12')];this[_0x206f('0x13')]=_0x2d3ed7[_0x206f('0x13')];this['UserId']=_0x2d3ed7[_0x206f('0x14')];this[_0x206f('0x15')]=_0x2d3ed7['VoiceQueueId'];this[_0x206f('0x16')]=_0x2d3ed7['CampaignId'];this[_0x206f('0x17')]=_0x2d3ed7['id'];this[_0x206f('0x18')]=_0x2d3ed7['Contact'][_0x206f('0x19')]||'';this[_0x206f('0x1a')]=moment()[_0x206f('0x1b')](_0x206f('0x1c'));this[_0x206f('0x1d')]=_0x2d3ed7[_0x206f('0x1d')];this[_0x206f('0x1e')]=_0x2d3ed7[_0x206f('0x1e')];this[_0x206f('0x1f')]=_0x2d3ed7['callbackat'];this['recallme']=_0x2d3ed7[_0x206f('0x20')];this[_0x206f('0x21')]='';this[_0x206f('0x22')]='';}Action[_0x206f('0x23')][_0x206f('0x24')]=function(){return util[_0x206f('0x1b')](_0x206f('0x25'),this[_0x206f('0x4')],this[_0x206f('0x2')][_0x206f('0x26')]>0x0?this[_0x206f('0x27')][_0x206f('0x28')](this[_0x206f('0x2')][_0x206f('0x26')]):this['number']);};Action[_0x206f('0x23')]['getQueue']=function(){return this['queue'];};module[_0x206f('0x29')]=Action;
\ No newline at end of file
index b73470c..26cb039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5914=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry'];(function(_0x595119,_0x45e35f){var _0x256a00=function(_0x25c682){while(--_0x25c682){_0x595119['push'](_0x595119['shift']());}};_0x256a00(++_0x45e35f);}(_0x5914,0x108));var _0x4591=function(_0x5cd6dc,_0x5782be){_0x5cd6dc=_0x5cd6dc-0x0;var _0x6a654f=_0x5914[_0x5cd6dc];return _0x6a654f;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x57b6e2,_0x34c04c){var _0x432592=moment(_0x57b6e2)['milliseconds'](0x0);var _0x59a79c=moment(_0x34c04c)[_0x4591('0x0')](0x0);return _0x432592[_0x4591('0x1')](_0x59a79c,_0x4591('0x2'));}function AdditionalPhone(_0x47124e){this[_0x4591('0x3')]=_0x47124e[_0x4591('0x3')];this[_0x4591('0x4')]=_0x47124e[_0x4591('0x4')]||undefined;this[_0x4591('0x5')]=_0x47124e[_0x4591('0x5')];this['campaigntype']=_0x47124e[_0x4591('0x5')]===_0x4591('0x6')?'queue':_0x47124e['type'];this[_0x4591('0x7')]=_0x47124e[_0x4591('0x7')];this[_0x4591('0x8')]=_0x47124e[_0x4591('0x8')];this[_0x4591('0x9')]=_0x47124e[_0x4591('0x9')];this[_0x4591('0xa')]=_0x47124e['countbusyretry']+_0x47124e[_0x4591('0x8')]+_0x47124e[_0x4591('0x9')]+_0x47124e['countnosuchnumberretry']+_0x47124e[_0x4591('0xb')]+_0x47124e[_0x4591('0xc')]+_0x47124e[_0x4591('0xd')]+_0x47124e['countagentrejectretry'];this['countnosuchnumberretry']=_0x47124e[_0x4591('0xe')];this[_0x4591('0xb')]=_0x47124e[_0x4591('0xb')];this[_0x4591('0xc')]=_0x47124e['countabandonedretry'];this[_0x4591('0xd')]=_0x47124e[_0x4591('0xd')];this['countagentrejectretry']=_0x47124e[_0x4591('0xf')];this[_0x4591('0x10')]=_0x47124e[_0x4591('0x10')];this[_0x4591('0x11')]=_0x47124e['name'];this[_0x4591('0x12')]=_0x47124e[_0x4591('0x13')];this[_0x4591('0x14')]=_0x47124e[_0x4591('0x14')];this[_0x4591('0x15')]=_0x47124e[_0x4591('0x15')];this[_0x4591('0x16')]=_0x47124e[_0x4591('0x15')];this[_0x4591('0x17')]=getSeconds(_0x47124e[_0x4591('0x15')],_0x47124e['starttime']);this[_0x4591('0x18')]=0x0;this['talktime']=0x0;this['callback']=_0x47124e[_0x4591('0x19')];this['callbackuniqueid']=_0x47124e[_0x4591('0x1a')];this[_0x4591('0x1b')]=_0x47124e[_0x4591('0x1b')];this['recallme']=_0x47124e['recallme'];this['ContactId']=_0x47124e[_0x4591('0x1c')];this[_0x4591('0x1d')]=_0x47124e[_0x4591('0x1d')];this['UserId']=_0x47124e['UserId'];this['VoiceQueueId']=_0x47124e[_0x4591('0x1e')];this[_0x4591('0x1f')]=_0x47124e[_0x4591('0x1f')];this['originatecalleridnum']=_0x47124e[_0x4591('0x20')]||'';this[_0x4591('0x21')]=_0x47124e[_0x4591('0x21')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xcd98=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x125425,_0x4b6bab){var _0xd04dc4=function(_0x37fc01){while(--_0x37fc01){_0x125425['push'](_0x125425['shift']());}};_0xd04dc4(++_0x4b6bab);}(_0xcd98,0xc8));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8cd9('0x0'));var _=require(_0x8cd9('0x1'));var moment=require(_0x8cd9('0x2'));function getSeconds(_0xc9e319,_0x4cbb82){var _0x3e6641=moment(_0xc9e319)[_0x8cd9('0x3')](0x0);var _0x2eda4c=moment(_0x4cbb82)[_0x8cd9('0x3')](0x0);return _0x3e6641[_0x8cd9('0x4')](_0x2eda4c,_0x8cd9('0x5'));}function AdditionalPhone(_0x367664){this[_0x8cd9('0x6')]=_0x367664[_0x8cd9('0x6')];this[_0x8cd9('0x7')]=_0x367664[_0x8cd9('0x7')]||undefined;this[_0x8cd9('0x8')]=_0x367664['type'];this[_0x8cd9('0x9')]=_0x367664[_0x8cd9('0x8')]===_0x8cd9('0xa')?_0x8cd9('0xb'):_0x367664['type'];this[_0x8cd9('0xc')]=_0x367664[_0x8cd9('0xc')];this[_0x8cd9('0xd')]=_0x367664[_0x8cd9('0xd')];this[_0x8cd9('0xe')]=_0x367664['countnoanswerretry'];this[_0x8cd9('0xf')]=_0x367664[_0x8cd9('0xc')]+_0x367664['countcongestionretry']+_0x367664[_0x8cd9('0xe')]+_0x367664['countnosuchnumberretry']+_0x367664[_0x8cd9('0x10')]+_0x367664[_0x8cd9('0x11')]+_0x367664[_0x8cd9('0x12')]+_0x367664[_0x8cd9('0x13')];this[_0x8cd9('0x14')]=_0x367664[_0x8cd9('0x14')];this[_0x8cd9('0x10')]=_0x367664[_0x8cd9('0x10')];this[_0x8cd9('0x11')]=_0x367664['countabandonedretry'];this[_0x8cd9('0x12')]=_0x367664['countmachineretry'];this[_0x8cd9('0x13')]=_0x367664[_0x8cd9('0x13')];this[_0x8cd9('0xb')]=_0x367664[_0x8cd9('0xb')];this[_0x8cd9('0x15')]=_0x367664['name'];this['calleridnum']=_0x367664[_0x8cd9('0x16')];this[_0x8cd9('0x17')]=_0x367664[_0x8cd9('0x17')];this[_0x8cd9('0x18')]=_0x367664[_0x8cd9('0x18')];this[_0x8cd9('0x19')]=_0x367664['responsetime'];this[_0x8cd9('0x1a')]=getSeconds(_0x367664[_0x8cd9('0x18')],_0x367664[_0x8cd9('0x17')]);this['holdtime']=0x0;this[_0x8cd9('0x1b')]=0x0;this[_0x8cd9('0x1c')]=_0x367664['callback'];this['callbackuniqueid']=_0x367664[_0x8cd9('0x1d')];this[_0x8cd9('0x1e')]=_0x367664[_0x8cd9('0x1e')];this['recallme']=_0x367664[_0x8cd9('0x1f')];this[_0x8cd9('0x20')]=_0x367664[_0x8cd9('0x20')];this[_0x8cd9('0x21')]=_0x367664['ListId'];this[_0x8cd9('0x22')]=_0x367664[_0x8cd9('0x22')];this[_0x8cd9('0x23')]=_0x367664[_0x8cd9('0x23')];this[_0x8cd9('0x24')]=_0x367664[_0x8cd9('0x24')];this['originatecalleridnum']=_0x367664[_0x8cd9('0x25')]||'';this['originatecalleridname']=_0x367664[_0x8cd9('0x26')]||'';}module[_0x8cd9('0x27')]=History;
\ No newline at end of file
index 6b1674d..7d826ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09e0=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x417955,_0x4ed8c8){var _0x3a94ef=function(_0xa3a38d){while(--_0xa3a38d){_0x417955['push'](_0x417955['shift']());}};_0x3a94ef(++_0x4ed8c8);}(_0x09e0,0x1ab));var _0x009e=function(_0x3c462c,_0x37c21f){_0x3c462c=_0x3c462c-0x0;var _0x6fe9a8=_0x09e0[_0x3c462c];return _0x6fe9a8;};'use strict';var util=require(_0x009e('0x0'));var _=require(_0x009e('0x1'));var moment=require(_0x009e('0x2'));function getSeconds(_0x52664d,_0x2f32bb){var _0x204063=moment(_0x52664d)['milliseconds'](0x0);var _0x1b6358=moment(_0x2f32bb)['milliseconds'](0x0);return _0x204063[_0x009e('0x3')](_0x1b6358,_0x009e('0x4'));}function AgentComplete(_0x501150,_0x1e51d7){this[_0x009e('0x5')]=0x4;this[_0x009e('0x6')]='Answer';this[_0x009e('0x7')]=_0x501150['scheduledat'];this[_0x009e('0x8')]=_0x501150[_0x009e('0x8')];this[_0x009e('0x9')]=_0x501150['type']===_0x009e('0xa')?_0x009e('0xb'):_0x501150[_0x009e('0x8')];this[_0x009e('0xc')]=_0x501150['countbusyretry'];this[_0x009e('0xd')]=_0x501150[_0x009e('0xd')];this['countnoanswerretry']=_0x501150[_0x009e('0xe')];this[_0x009e('0xf')]=_0x501150['countbusyretry']+_0x501150[_0x009e('0xd')]+_0x501150[_0x009e('0xe')]+_0x501150[_0x009e('0x10')]+_0x501150[_0x009e('0x11')]+_0x501150[_0x009e('0x12')]+_0x501150['countmachineretry']+_0x501150['countagentrejectretry'];this[_0x009e('0x10')]=_0x501150[_0x009e('0x10')];this['countdropretry']=_0x501150[_0x009e('0x11')];this['countabandonedretry']=_0x501150[_0x009e('0x12')];this['countmachineretry']=_0x501150[_0x009e('0x13')];this[_0x009e('0x14')]=_0x501150[_0x009e('0x14')];this['uniqueid']=_0x1e51d7[_0x009e('0x15')];this[_0x009e('0x16')]=_0x501150[_0x009e('0x17')];this['calleridnum']=_0x501150[_0x009e('0x18')];this[_0x009e('0x19')]=_0x501150[_0x009e('0x19')];this[_0x009e('0x1a')]=_0x501150['responsetime'];this[_0x009e('0x1b')]=_0x501150['answertime'];this[_0x009e('0x1c')]=moment()[_0x009e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x501150['responsetime'],_0x501150[_0x009e('0x19')]);this[_0x009e('0x1e')]=getSeconds(_0x501150['answertime'],_0x501150['responsetime']);this[_0x009e('0x1f')]=getSeconds(this[_0x009e('0x1c')],_0x501150[_0x009e('0x1b')]);this['queue']=_0x1e51d7['queue'];this[_0x009e('0x20')]=_0x1e51d7['membername'];this['reason']=_0x1e51d7['reason'];this[_0x009e('0x21')]=_0x501150['callback'];this[_0x009e('0x22')]=_0x501150['callbackuniqueid'];this[_0x009e('0x23')]=_0x501150['callbackat'];this[_0x009e('0x24')]=_0x501150['recallme'];this[_0x009e('0x25')]=_0x501150['ContactId'];this[_0x009e('0x26')]=_0x501150[_0x009e('0x26')];this['UserId']=_0x501150[_0x009e('0x27')];this[_0x009e('0x28')]=_0x501150[_0x009e('0x28')];this['CampaignId']=_0x501150[_0x009e('0x29')];this[_0x009e('0x2a')]=_0x501150[_0x009e('0x2a')]||'';this[_0x009e('0x2b')]=_0x501150[_0x009e('0x2b')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0xcd3b=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0xcd3b,0x19c));var _0xbcd3=function(_0x22adfc,_0x4b804b){_0x22adfc=_0x22adfc-0x0;var _0x114aa9=_0xcd3b[_0x22adfc];return _0x114aa9;};'use strict';var util=require(_0xbcd3('0x0'));var _=require('lodash');var moment=require(_0xbcd3('0x1'));function getSeconds(_0x3eb688,_0x35319d){var _0x247b3e=moment(_0x3eb688)[_0xbcd3('0x2')](0x0);var _0x4ab5fb=moment(_0x35319d)[_0xbcd3('0x2')](0x0);return _0x247b3e[_0xbcd3('0x3')](_0x4ab5fb,_0xbcd3('0x4'));}function AgentComplete(_0x317bb6,_0x31fd88){this[_0xbcd3('0x5')]=0x4;this['statedesc']=_0xbcd3('0x6');this[_0xbcd3('0x7')]=_0x317bb6[_0xbcd3('0x7')];this[_0xbcd3('0x8')]=_0x317bb6[_0xbcd3('0x8')];this[_0xbcd3('0x9')]=_0x317bb6[_0xbcd3('0x8')]===_0xbcd3('0xa')?_0xbcd3('0xb'):_0x317bb6[_0xbcd3('0x8')];this['countbusyretry']=_0x317bb6[_0xbcd3('0xc')];this[_0xbcd3('0xd')]=_0x317bb6['countcongestionretry'];this[_0xbcd3('0xe')]=_0x317bb6[_0xbcd3('0xe')];this['countglobal']=_0x317bb6[_0xbcd3('0xc')]+_0x317bb6[_0xbcd3('0xd')]+_0x317bb6[_0xbcd3('0xe')]+_0x317bb6['countnosuchnumberretry']+_0x317bb6[_0xbcd3('0xf')]+_0x317bb6[_0xbcd3('0x10')]+_0x317bb6['countmachineretry']+_0x317bb6['countagentrejectretry'];this[_0xbcd3('0x11')]=_0x317bb6[_0xbcd3('0x11')];this['countdropretry']=_0x317bb6['countdropretry'];this[_0xbcd3('0x10')]=_0x317bb6['countabandonedretry'];this[_0xbcd3('0x12')]=_0x317bb6[_0xbcd3('0x12')];this[_0xbcd3('0x13')]=_0x317bb6['countagentrejectretry'];this[_0xbcd3('0x14')]=_0x31fd88['uniqueid'];this['calleridname']=_0x317bb6[_0xbcd3('0x15')];this[_0xbcd3('0x16')]=_0x317bb6[_0xbcd3('0x17')];this[_0xbcd3('0x18')]=_0x317bb6['starttime'];this[_0xbcd3('0x19')]=_0x317bb6[_0xbcd3('0x19')];this['answertime']=_0x317bb6[_0xbcd3('0x1a')];this['endtime']=moment()['format'](_0xbcd3('0x1b'));this['ringtime']=getSeconds(_0x317bb6[_0xbcd3('0x19')],_0x317bb6['starttime']);this[_0xbcd3('0x1c')]=getSeconds(_0x317bb6[_0xbcd3('0x1a')],_0x317bb6[_0xbcd3('0x19')]);this[_0xbcd3('0x1d')]=getSeconds(this[_0xbcd3('0x1e')],_0x317bb6[_0xbcd3('0x1a')]);this[_0xbcd3('0xb')]=_0x31fd88['queue'];this[_0xbcd3('0x1f')]=_0x31fd88[_0xbcd3('0x1f')];this[_0xbcd3('0x20')]=_0x31fd88[_0xbcd3('0x20')];this[_0xbcd3('0x21')]=_0x317bb6[_0xbcd3('0x21')];this[_0xbcd3('0x22')]=_0x317bb6[_0xbcd3('0x22')];this[_0xbcd3('0x23')]=_0x317bb6[_0xbcd3('0x23')];this['recallme']=_0x317bb6[_0xbcd3('0x24')];this['ContactId']=_0x317bb6[_0xbcd3('0x25')];this[_0xbcd3('0x26')]=_0x317bb6['ListId'];this[_0xbcd3('0x27')]=_0x317bb6[_0xbcd3('0x27')];this[_0xbcd3('0x28')]=_0x317bb6[_0xbcd3('0x28')];this[_0xbcd3('0x29')]=_0x317bb6[_0xbcd3('0x29')];this[_0xbcd3('0x2a')]=_0x317bb6[_0xbcd3('0x2a')]||'';this[_0xbcd3('0x2b')]=_0x317bb6[_0xbcd3('0x2b')]||'';}module[_0xbcd3('0x2c')]=AgentComplete;
\ No newline at end of file
index 1ceaf2a..14f5504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x613951,_0x40f6ec){var _0x5555e3=function(_0x596f8d){while(--_0x596f8d){_0x613951['push'](_0x613951['shift']());}};_0x5555e3(++_0x40f6ec);}(_0x8a28,0xfd));var _0x88a2=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x8a28[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x88a2('0x0'));var _=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));function getSeconds(_0x3c2c72,_0x27b1c1){var _0x29e6d8=moment(_0x3c2c72)[_0x88a2('0x3')](0x0);var _0x3fc89d=moment(_0x27b1c1)['milliseconds'](0x0);return _0x29e6d8[_0x88a2('0x4')](_0x3fc89d,_0x88a2('0x5'));}function Final(_0x3c3392){this[_0x88a2('0x6')]=_0x3c3392[_0x88a2('0x6')];this['scheduledat']=_0x3c3392[_0x88a2('0x7')];this['type']=_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0x9')]=_0x3c3392[_0x88a2('0x8')]===_0x88a2('0xa')?_0x88a2('0xb'):_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0xc')]=_0x3c3392[_0x88a2('0xc')];this[_0x88a2('0xd')]=_0x3c3392['countcongestionretry'];this['countnoanswerretry']=_0x3c3392[_0x88a2('0xe')];this[_0x88a2('0xf')]=_0x3c3392[_0x88a2('0xc')]+_0x3c3392[_0x88a2('0xd')]+_0x3c3392[_0x88a2('0xe')]+_0x3c3392['countnosuchnumberretry']+_0x3c3392[_0x88a2('0x10')]+_0x3c3392[_0x88a2('0x11')]+_0x3c3392[_0x88a2('0x12')]+_0x3c3392[_0x88a2('0x13')];this['countnosuchnumberretry']=_0x3c3392[_0x88a2('0x14')];this[_0x88a2('0x10')]=_0x3c3392[_0x88a2('0x10')];this['countabandonedretry']=_0x3c3392[_0x88a2('0x11')];this[_0x88a2('0x12')]=_0x3c3392[_0x88a2('0x12')];this[_0x88a2('0x13')]=_0x3c3392[_0x88a2('0x13')];this[_0x88a2('0xb')]=_0x3c3392[_0x88a2('0xb')];this[_0x88a2('0x15')]=_0x3c3392[_0x88a2('0x15')];this[_0x88a2('0x16')]=_0x3c3392[_0x88a2('0x16')];this[_0x88a2('0x17')]=_0x3c3392[_0x88a2('0x17')];this[_0x88a2('0x18')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x19')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x1a')]=_0x3c3392['ringtime']||0x0;this[_0x88a2('0x1b')]=_0x3c3392[_0x88a2('0x1b')]||0x0;this['talktime']=_0x3c3392['talktime']||0x0;this[_0x88a2('0x1c')]=_0x3c3392[_0x88a2('0x1c')];this[_0x88a2('0x1d')]=_0x3c3392[_0x88a2('0x1d')];this[_0x88a2('0x1e')]=_0x3c3392['callbackat'];this[_0x88a2('0x1f')]=_0x3c3392[_0x88a2('0x1f')];this[_0x88a2('0x20')]=_0x3c3392[_0x88a2('0x20')];this['ListId']=_0x3c3392[_0x88a2('0x21')];this['UserId']=_0x3c3392['UserId'];this[_0x88a2('0x22')]=_0x3c3392[_0x88a2('0x22')];this['CampaignId']=_0x3c3392['CampaignId'];this[_0x88a2('0x23')]=_0x3c3392[_0x88a2('0x23')]||'';this['originatecalleridname']=_0x3c3392[_0x88a2('0x24')]||'';}module[_0x88a2('0x25')]=Final;
\ No newline at end of file
+var _0x0bde=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','starttime','responsetime'];(function(_0x25c6d4,_0x37d363){var _0xa3a53f=function(_0x24f820){while(--_0x24f820){_0x25c6d4['push'](_0x25c6d4['shift']());}};_0xa3a53f(++_0x37d363);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0xe0bd('0x0'));var moment=require('moment');function getSeconds(_0x3fb344,_0x3dc984){var _0x1d8922=moment(_0x3fb344)[_0xe0bd('0x1')](0x0);var _0x2da4bd=moment(_0x3dc984)['milliseconds'](0x0);return _0x1d8922[_0xe0bd('0x2')](_0x2da4bd,_0xe0bd('0x3'));}function Final(_0x2b9812){this[_0xe0bd('0x4')]=_0x2b9812[_0xe0bd('0x4')];this[_0xe0bd('0x5')]=_0x2b9812[_0xe0bd('0x5')];this['type']=_0x2b9812[_0xe0bd('0x6')];this[_0xe0bd('0x7')]=_0x2b9812[_0xe0bd('0x6')]===_0xe0bd('0x8')?_0xe0bd('0x9'):_0x2b9812[_0xe0bd('0x6')];this[_0xe0bd('0xa')]=_0x2b9812[_0xe0bd('0xa')];this['countcongestionretry']=_0x2b9812['countcongestionretry'];this['countnoanswerretry']=_0x2b9812[_0xe0bd('0xb')];this['countglobal']=_0x2b9812['countbusyretry']+_0x2b9812[_0xe0bd('0xc')]+_0x2b9812[_0xe0bd('0xb')]+_0x2b9812['countnosuchnumberretry']+_0x2b9812[_0xe0bd('0xd')]+_0x2b9812['countabandonedretry']+_0x2b9812[_0xe0bd('0xe')]+_0x2b9812[_0xe0bd('0xf')];this[_0xe0bd('0x10')]=_0x2b9812[_0xe0bd('0x10')];this[_0xe0bd('0xd')]=_0x2b9812[_0xe0bd('0xd')];this[_0xe0bd('0x11')]=_0x2b9812[_0xe0bd('0x11')];this['countmachineretry']=_0x2b9812['countmachineretry'];this['countagentrejectretry']=_0x2b9812[_0xe0bd('0xf')];this[_0xe0bd('0x9')]=_0x2b9812[_0xe0bd('0x9')];this[_0xe0bd('0x12')]=_0x2b9812[_0xe0bd('0x12')];this['calleridnum']=_0x2b9812['calleridnum'];this[_0xe0bd('0x13')]=_0x2b9812['starttime'];this[_0xe0bd('0x14')]=_0x2b9812[_0xe0bd('0x14')];this[_0xe0bd('0x15')]=_0x2b9812[_0xe0bd('0x14')];this['ringtime']=_0x2b9812[_0xe0bd('0x16')]||0x0;this[_0xe0bd('0x17')]=_0x2b9812[_0xe0bd('0x17')]||0x0;this['talktime']=_0x2b9812[_0xe0bd('0x18')]||0x0;this[_0xe0bd('0x19')]=_0x2b9812[_0xe0bd('0x19')];this['callbackuniqueid']=_0x2b9812[_0xe0bd('0x1a')];this[_0xe0bd('0x1b')]=_0x2b9812[_0xe0bd('0x1b')];this['recallme']=_0x2b9812[_0xe0bd('0x1c')];this['ContactId']=_0x2b9812[_0xe0bd('0x1d')];this[_0xe0bd('0x1e')]=_0x2b9812['ListId'];this[_0xe0bd('0x1f')]=_0x2b9812[_0xe0bd('0x1f')];this[_0xe0bd('0x20')]=_0x2b9812[_0xe0bd('0x20')];this[_0xe0bd('0x21')]=_0x2b9812[_0xe0bd('0x21')];this[_0xe0bd('0x22')]=_0x2b9812[_0xe0bd('0x22')]||'';this['originatecalleridname']=_0x2b9812['originatecalleridname']||'';}module[_0xe0bd('0x23')]=Final;
\ No newline at end of file
index 89aca4f..655af93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd7=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer'];(function(_0x40ed81,_0x4cdbdf){var _0x2d7014=function(_0x399803){while(--_0x399803){_0x40ed81['push'](_0x40ed81['shift']());}};_0x2d7014(++_0x4cdbdf);}(_0x5fd7,0x1e7));var _0x75fd=function(_0x435ba5,_0x55875f){_0x435ba5=_0x435ba5-0x0;var _0x5af51d=_0x5fd7[_0x435ba5];return _0x5af51d;};'use strict';var util=require(_0x75fd('0x0'));var _=require(_0x75fd('0x1'));var moment=require(_0x75fd('0x2'));function getSeconds(_0x83865b,_0x3c9241){var _0x333168=moment(_0x83865b)[_0x75fd('0x3')](0x0);var _0x35cff6=moment(_0x3c9241)['milliseconds'](0x0);return _0x333168[_0x75fd('0x4')](_0x35cff6,'seconds');}function Hangup(_0x21d804,_0x16616a){this[_0x75fd('0x5')]=0x4;this[_0x75fd('0x6')]=_0x75fd('0x7');this[_0x75fd('0x8')]=_0x21d804[_0x75fd('0x8')];this['type']=_0x21d804[_0x75fd('0x9')];this[_0x75fd('0xa')]=_0x21d804[_0x75fd('0x9')]===_0x75fd('0xb')?_0x75fd('0xc'):_0x21d804[_0x75fd('0x9')];this['countbusyretry']=_0x21d804[_0x75fd('0xd')];this[_0x75fd('0xe')]=_0x21d804['countcongestionretry'];this[_0x75fd('0xf')]=_0x21d804['countnoanswerretry'];this['countglobal']=_0x21d804[_0x75fd('0xd')]+_0x21d804[_0x75fd('0xe')]+_0x21d804[_0x75fd('0xf')]+_0x21d804[_0x75fd('0x10')]+_0x21d804['countdropretry']+_0x21d804['countabandonedretry']+_0x21d804['countmachineretry']+_0x21d804[_0x75fd('0x11')];this[_0x75fd('0x10')]=_0x21d804['countnosuchnumberretry'];this['countdropretry']=_0x21d804[_0x75fd('0x12')];this[_0x75fd('0x13')]=_0x21d804['countabandonedretry'];this[_0x75fd('0x14')]=_0x21d804[_0x75fd('0x14')];this[_0x75fd('0x11')]=_0x21d804[_0x75fd('0x11')];this['uniqueid']=_0x16616a[_0x75fd('0x15')];this[_0x75fd('0x16')]=_0x21d804[_0x75fd('0x17')];this['calleridnum']=_0x21d804[_0x75fd('0x18')];this[_0x75fd('0x19')]=_0x21d804['starttime'];this['responsetime']=_0x21d804['responsetime'];this['endtime']=moment()[_0x75fd('0x1a')](_0x75fd('0x1b'));this[_0x75fd('0x1c')]=getSeconds(_0x21d804['responsetime'],_0x21d804[_0x75fd('0x19')]);this[_0x75fd('0x1d')]=0x0;this[_0x75fd('0x1e')]=getSeconds(this[_0x75fd('0x1f')],_0x21d804['responsetime']);this['queue']=_0x21d804[_0x75fd('0xc')];this[_0x75fd('0x20')]=_0x75fd('0x21');this[_0x75fd('0x22')]=_0x16616a['cause-txt'];this[_0x75fd('0x23')]=_0x21d804[_0x75fd('0x23')];this['callbackuniqueid']=_0x21d804[_0x75fd('0x24')];this[_0x75fd('0x25')]=_0x21d804[_0x75fd('0x25')];this[_0x75fd('0x26')]=_0x21d804['recallme'];this[_0x75fd('0x27')]=_0x21d804[_0x75fd('0x27')];this[_0x75fd('0x28')]=_0x21d804[_0x75fd('0x28')];this[_0x75fd('0x29')]=_0x21d804[_0x75fd('0x29')];this[_0x75fd('0x2a')]=_0x21d804[_0x75fd('0x2a')];this[_0x75fd('0x2b')]=_0x21d804[_0x75fd('0x2b')];}module[_0x75fd('0x2c')]=Hangup;
\ No newline at end of file
+var _0x5c8e=['uniqueid','calleridname','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','endtime','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry'];(function(_0x41ae7a,_0xe1b004){var _0x10109f=function(_0xbdc87){while(--_0xbdc87){_0x41ae7a['push'](_0x41ae7a['shift']());}};_0x10109f(++_0xe1b004);}(_0x5c8e,0xe1));var _0xe5c8=function(_0x44e67e,_0x544f72){_0x44e67e=_0x44e67e-0x0;var _0x3273ca=_0x5c8e[_0x44e67e];return _0x3273ca;};'use strict';var util=require(_0xe5c8('0x0'));var _=require(_0xe5c8('0x1'));var moment=require(_0xe5c8('0x2'));function getSeconds(_0x296668,_0x4de3f5){var _0x4f08f2=moment(_0x296668)[_0xe5c8('0x3')](0x0);var _0x4efb96=moment(_0x4de3f5)[_0xe5c8('0x3')](0x0);return _0x4f08f2['diff'](_0x4efb96,_0xe5c8('0x4'));}function Hangup(_0xe48b19,_0x29e637){this[_0xe5c8('0x5')]=0x4;this[_0xe5c8('0x6')]=_0xe5c8('0x7');this[_0xe5c8('0x8')]=_0xe48b19[_0xe5c8('0x8')];this['type']=_0xe48b19[_0xe5c8('0x9')];this[_0xe5c8('0xa')]=_0xe48b19[_0xe5c8('0x9')]==='outbound'?_0xe5c8('0xb'):_0xe48b19[_0xe5c8('0x9')];this[_0xe5c8('0xc')]=_0xe48b19[_0xe5c8('0xc')];this[_0xe5c8('0xd')]=_0xe48b19[_0xe5c8('0xd')];this[_0xe5c8('0xe')]=_0xe48b19['countnoanswerretry'];this[_0xe5c8('0xf')]=_0xe48b19[_0xe5c8('0xc')]+_0xe48b19[_0xe5c8('0xd')]+_0xe48b19['countnoanswerretry']+_0xe48b19['countnosuchnumberretry']+_0xe48b19[_0xe5c8('0x10')]+_0xe48b19['countabandonedretry']+_0xe48b19[_0xe5c8('0x11')]+_0xe48b19[_0xe5c8('0x12')];this[_0xe5c8('0x13')]=_0xe48b19[_0xe5c8('0x13')];this['countdropretry']=_0xe48b19[_0xe5c8('0x10')];this['countabandonedretry']=_0xe48b19[_0xe5c8('0x14')];this[_0xe5c8('0x11')]=_0xe48b19[_0xe5c8('0x11')];this[_0xe5c8('0x12')]=_0xe48b19[_0xe5c8('0x12')];this[_0xe5c8('0x15')]=_0x29e637[_0xe5c8('0x15')];this[_0xe5c8('0x16')]=_0xe48b19[_0xe5c8('0x17')];this['calleridnum']=_0xe48b19[_0xe5c8('0x18')];this[_0xe5c8('0x19')]=_0xe48b19['starttime'];this[_0xe5c8('0x1a')]=_0xe48b19[_0xe5c8('0x1a')];this['endtime']=moment()[_0xe5c8('0x1b')](_0xe5c8('0x1c'));this['ringtime']=getSeconds(_0xe48b19['responsetime'],_0xe48b19['starttime']);this['holdtime']=0x0;this[_0xe5c8('0x1d')]=getSeconds(this[_0xe5c8('0x1e')],_0xe48b19['responsetime']);this[_0xe5c8('0xb')]=_0xe48b19[_0xe5c8('0xb')];this['membername']='IVR';this[_0xe5c8('0x1f')]=_0x29e637['cause-txt'];this['callback']=_0xe48b19['callback'];this[_0xe5c8('0x20')]=_0xe48b19['callbackuniqueid'];this['callbackat']=_0xe48b19[_0xe5c8('0x21')];this[_0xe5c8('0x22')]=_0xe48b19[_0xe5c8('0x22')];this['ContactId']=_0xe48b19[_0xe5c8('0x23')];this[_0xe5c8('0x24')]=_0xe48b19[_0xe5c8('0x24')];this[_0xe5c8('0x25')]=_0xe48b19[_0xe5c8('0x25')];this['VoiceQueueId']=_0xe48b19[_0xe5c8('0x26')];this[_0xe5c8('0x27')]=_0xe48b19[_0xe5c8('0x27')];}module[_0xe5c8('0x28')]=Hangup;
\ No newline at end of file
index 045d787..baabb56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d95=['milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','name','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5d95,0x166));var _0x55d9=function(_0x2bb4c6,_0x1accfe){_0x2bb4c6=_0x2bb4c6-0x0;var _0x18d5b0=_0x5d95[_0x2bb4c6];return _0x18d5b0;};'use strict';var util=require(_0x55d9('0x0'));var _=require(_0x55d9('0x1'));var moment=require('moment');function getSeconds(_0x1859cb,_0x160c5b){var _0x477487=moment(_0x1859cb)[_0x55d9('0x2')](0x0);var _0x557a2b=moment(_0x160c5b)[_0x55d9('0x2')](0x0);return _0x477487[_0x55d9('0x3')](_0x557a2b,'seconds');}function History(_0x5f35dd){this[_0x55d9('0x4')]=_0x5f35dd['uniqueid'];this[_0x55d9('0x5')]=_0x5f35dd[_0x55d9('0x5')]||undefined;this[_0x55d9('0x6')]=_0x5f35dd[_0x55d9('0x6')];this[_0x55d9('0x7')]=_0x5f35dd['type']==='outbound'?_0x55d9('0x8'):_0x5f35dd['type'];this[_0x55d9('0x9')]=_0x5f35dd['countbusyretry'];this[_0x55d9('0xa')]=_0x5f35dd['countcongestionretry'];this[_0x55d9('0xb')]=_0x5f35dd[_0x55d9('0xb')];this[_0x55d9('0xc')]=_0x5f35dd[_0x55d9('0x9')]+_0x5f35dd[_0x55d9('0xa')]+_0x5f35dd['countnoanswerretry']+_0x5f35dd['countnosuchnumberretry']+_0x5f35dd[_0x55d9('0xd')]+_0x5f35dd['countabandonedretry']+_0x5f35dd[_0x55d9('0xe')]+_0x5f35dd[_0x55d9('0xf')];this[_0x55d9('0x10')]=_0x5f35dd[_0x55d9('0x10')];this[_0x55d9('0xd')]=_0x5f35dd[_0x55d9('0xd')];this[_0x55d9('0x11')]=_0x5f35dd[_0x55d9('0x11')];this['countmachineretry']=_0x5f35dd[_0x55d9('0xe')];this[_0x55d9('0xf')]=_0x5f35dd['countagentrejectretry'];this[_0x55d9('0x8')]=_0x5f35dd['queue'];this['calleridname']=_0x5f35dd[_0x55d9('0x12')];this[_0x55d9('0x13')]=_0x5f35dd['number'];this[_0x55d9('0x14')]=_0x5f35dd[_0x55d9('0x14')];this[_0x55d9('0x15')]=_0x5f35dd[_0x55d9('0x15')];this[_0x55d9('0x16')]=_0x5f35dd[_0x55d9('0x15')];this[_0x55d9('0x17')]=getSeconds(_0x5f35dd[_0x55d9('0x15')],_0x5f35dd[_0x55d9('0x14')]);this['holdtime']=0x0;this[_0x55d9('0x18')]=0x0;this[_0x55d9('0x19')]=_0x5f35dd[_0x55d9('0x19')];this['callbackuniqueid']=_0x5f35dd['callbackuniqueid'];this[_0x55d9('0x1a')]=_0x5f35dd[_0x55d9('0x1a')];this[_0x55d9('0x1b')]=_0x5f35dd[_0x55d9('0x1b')];this[_0x55d9('0x1c')]=_0x5f35dd[_0x55d9('0x1c')];this[_0x55d9('0x1d')]=_0x5f35dd['ListId'];this[_0x55d9('0x1e')]=_0x5f35dd[_0x55d9('0x1e')];this[_0x55d9('0x1f')]=_0x5f35dd[_0x55d9('0x1f')];this[_0x55d9('0x20')]=_0x5f35dd[_0x55d9('0x20')];this[_0x55d9('0x21')]=_0x5f35dd['originatecalleridnum']||'';this[_0x55d9('0x22')]=_0x5f35dd[_0x55d9('0x22')]||'';}module[_0x55d9('0x23')]=History;
\ No newline at end of file
+var _0x887d=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x887d,0x191));var _0xd887=function(_0x5b8826,_0x592682){_0x5b8826=_0x5b8826-0x0;var _0x350821=_0x887d[_0x5b8826];return _0x350821;};'use strict';var util=require(_0xd887('0x0'));var _=require(_0xd887('0x1'));var moment=require('moment');function getSeconds(_0xdb35fc,_0x49978f){var _0x2073e1=moment(_0xdb35fc)[_0xd887('0x2')](0x0);var _0xeec257=moment(_0x49978f)[_0xd887('0x2')](0x0);return _0x2073e1['diff'](_0xeec257,_0xd887('0x3'));}function History(_0x7e555f){this[_0xd887('0x4')]=_0x7e555f[_0xd887('0x4')];this[_0xd887('0x5')]=_0x7e555f[_0xd887('0x5')]||undefined;this['type']=_0x7e555f[_0xd887('0x6')];this[_0xd887('0x7')]=_0x7e555f[_0xd887('0x6')]===_0xd887('0x8')?_0xd887('0x9'):_0x7e555f['type'];this[_0xd887('0xa')]=_0x7e555f[_0xd887('0xa')];this[_0xd887('0xb')]=_0x7e555f[_0xd887('0xb')];this['countnoanswerretry']=_0x7e555f[_0xd887('0xc')];this[_0xd887('0xd')]=_0x7e555f[_0xd887('0xa')]+_0x7e555f[_0xd887('0xb')]+_0x7e555f[_0xd887('0xc')]+_0x7e555f[_0xd887('0xe')]+_0x7e555f['countdropretry']+_0x7e555f['countabandonedretry']+_0x7e555f[_0xd887('0xf')]+_0x7e555f['countagentrejectretry'];this[_0xd887('0xe')]=_0x7e555f[_0xd887('0xe')];this[_0xd887('0x10')]=_0x7e555f[_0xd887('0x10')];this[_0xd887('0x11')]=_0x7e555f[_0xd887('0x11')];this[_0xd887('0xf')]=_0x7e555f[_0xd887('0xf')];this['countagentrejectretry']=_0x7e555f[_0xd887('0x12')];this[_0xd887('0x9')]=_0x7e555f[_0xd887('0x9')];this['calleridname']=_0x7e555f['name'];this[_0xd887('0x13')]=_0x7e555f[_0xd887('0x14')];this[_0xd887('0x15')]=_0x7e555f['starttime'];this[_0xd887('0x16')]=_0x7e555f[_0xd887('0x16')];this[_0xd887('0x17')]=_0x7e555f[_0xd887('0x16')];this[_0xd887('0x18')]=getSeconds(_0x7e555f['responsetime'],_0x7e555f[_0xd887('0x15')]);this[_0xd887('0x19')]=0x0;this[_0xd887('0x1a')]=0x0;this[_0xd887('0x1b')]=_0x7e555f['callback'];this[_0xd887('0x1c')]=_0x7e555f[_0xd887('0x1c')];this[_0xd887('0x1d')]=_0x7e555f[_0xd887('0x1d')];this[_0xd887('0x1e')]=_0x7e555f[_0xd887('0x1e')];this[_0xd887('0x1f')]=_0x7e555f[_0xd887('0x1f')];this[_0xd887('0x20')]=_0x7e555f[_0xd887('0x20')];this[_0xd887('0x21')]=_0x7e555f[_0xd887('0x21')];this[_0xd887('0x22')]=_0x7e555f[_0xd887('0x22')];this[_0xd887('0x23')]=_0x7e555f[_0xd887('0x23')];this['originatecalleridnum']=_0x7e555f[_0xd887('0x24')]||'';this[_0xd887('0x25')]=_0x7e555f[_0xd887('0x25')]||'';}module[_0xd887('0x26')]=History;
\ No newline at end of file
index e6d63e4..153435b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1101=['dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','----Agent\x20busy----','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','----call\x20swapAdditionalPhones----','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','maxNumberOriginate','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','--------\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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','available','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','log','Calling\x20swapAdditionalPhone\x20body->','Calling\x20swapAdditionalPhone\x20duration->','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','resolve','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','emit','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','uniqueid','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr]','MACHINE','countglobal','countnosuchnumberretry','countagentrejectretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','calleridname','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','calleridnum','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','preview','run','[Catch][Preview][syncQueueStatusComplete]','_rr','length','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','isArray','iftime\x20%s,%s','interval','content','indexOf','command','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','syncQueueSummary','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x1101,0x84));var _0x1110=function(_0xce3504,_0x490984){_0xce3504=_0xce3504-0x0;var _0x3044d7=_0x1101[_0xce3504];return _0x3044d7;};'use strict';var util=require(_0x1110('0x0'));var _=require('lodash');var BPromise=require(_0x1110('0x1'));var uuid=require(_0x1110('0x2'));var moment=require(_0x1110('0x3'));var rr=require('rr');var md5=require(_0x1110('0x4'));var Redis=require(_0x1110('0x5'));var ut=require('../preview/util/util');var config=require(_0x1110('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x1110('0x7'))(_0x1110('0x8'));var loggerPredictive=require(_0x1110('0x7'))(_0x1110('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x1110('0xa'));var loggerSyncQueueSummary=require(_0x1110('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x1110('0xb')]=_['defaults'](config[_0x1110('0xb')],{'host':_0x1110('0xc'),'port':0x18eb});var io=require(_0x1110('0xd'))(new Redis(config[_0x1110('0xb')]));var cmHopper=require(_0x1110('0xe'));var cmHopperHistory=require(_0x1110('0xf'));var cmHopperFinal=require(_0x1110('0x10'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x1110('0x11'));var History=require(_0x1110('0x12'));var Final=require(_0x1110('0x13'));var AgentComplete=require(_0x1110('0x14'));var QueueCallerAbandon=require(_0x1110('0x15'));var Hangup=require(_0x1110('0x16'));var ipAgi=process[_0x1110('0x17')][_0x1110('0x18')]||_0x1110('0x19');var strategy={'rrmemory':_0x1110('0x1a'),'roundrobin':_0x1110('0x1b')};var Sequence=function(){};Sequence[_0x1110('0x1c')][_0x1110('0x1d')]=function(_0x1dd6fd){this['tail']=this[_0x1110('0x1e')]?this[_0x1110('0x1e')][_0x1110('0x1f')](_0x1dd6fd):_0x1dd6fd();};function Dialer(_0x31e36f,_0x584d11){this[_0x1110('0x20')]=new Sequence();this['preview']=_0x584d11;this[_0x1110('0x21')]=_0x31e36f[_0x1110('0x21')];this[_0x1110('0x22')]=_0x31e36f[_0x1110('0x22')];this['agents']=_0x31e36f[_0x1110('0x23')];this[_0x1110('0x24')]=_0x31e36f[_0x1110('0x24')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x1110('0x25')]={};this[_0x1110('0x26')]={};this[_0x1110('0x27')]={};this[_0x1110('0x28')]={};this[_0x1110('0x29')]={};this[_0x1110('0x2a')]={};this[_0x1110('0x2b')]={};this[_0x1110('0x2c')]={};this[_0x1110('0x2d')]={};this[_0x1110('0x2e')]={};ami['on']('agentconnect',this[_0x1110('0x2f')]['bind'](this));ami['on'](_0x1110('0x30'),this[_0x1110('0x31')][_0x1110('0x32')](this));ami['on'](_0x1110('0x33'),this[_0x1110('0x34')][_0x1110('0x32')](this));ami['on'](_0x1110('0x35'),this[_0x1110('0x36')][_0x1110('0x32')](this));ami['on'](_0x1110('0x37'),this['syncQueueSummary']['bind'](this));ami['on'](_0x1110('0x38'),this[_0x1110('0x39')][_0x1110('0x32')](this));ami['on'](_0x1110('0x3a'),this[_0x1110('0x3b')][_0x1110('0x32')](this));ami['on']('varset',this[_0x1110('0x3c')]['bind'](this));ami['on'](_0x1110('0x3d'),this[_0x1110('0x3e')][_0x1110('0x32')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0x1110('0x3f')]();this[_0x1110('0x40')]();}function isNotNull(_0x4ffeb1){return _0x4ffeb1!==null&&!_[_0x1110('0x41')](_0x4ffeb1);}function checkIsLoggedIn(_0x4d586d,_0x2f68d4){return function(){if(_0x2f68d4<=0x0){_0x4d586d[_0x1110('0x42')]=_0x1110('0x43');throw _0x4d586d[_0x1110('0x44')]+_0x1110('0x45');}};}function isActive(_0x35cce6){return _0x35cce6;}function checkIsActive(_0x57f64f,_0x2504e8){return function(){if(!isActive(_0x2504e8)){_0x57f64f[_0x1110('0x42')]=_0x1110('0x46');throw _0x57f64f[_0x1110('0x44')]+_0x1110('0x47');}};}function checkInterval(_0x53a1f9){return function(){if(!isNotNull(_0x53a1f9[_0x1110('0x48')])){_0x53a1f9[_0x1110('0x42')]=_0x1110('0x49');throw _0x53a1f9[_0x1110('0x44')]+_0x1110('0x4a');}if(!isNotNull(_0x53a1f9[_0x1110('0x48')][_0x1110('0x4b')])){_0x53a1f9[_0x1110('0x42')]='INTERVAL_IS_NULL';throw _0x53a1f9[_0x1110('0x44')]+_0x1110('0x4a');}if(!isNotNull(_[_0x1110('0x4c')](_0x53a1f9['Interval'][_0x1110('0x4b')]))){_0x53a1f9['message']=_0x1110('0x49');throw _0x53a1f9[_0x1110('0x44')]+_0x1110('0x4a');}};}function msgResponse(_0x5ead2b,_0x2d1f4f,_0x57f2b1){return{'action':_0x5ead2b,'response':_0x2d1f4f,'message':_0x57f2b1,'stack':_0x57f2b1};}function myreject(_0x4eec97){return function(_0x23a7e3){return _0x4eec97(msgResponse('[ifTime][Action]',_0x1110('0x4d'),JSON[_0x1110('0x4e')](_0x23a7e3)));};}function getSeconds(_0x403f59,_0x5dccf4){var _0x2df1fe=moment(_0x403f59)[_0x1110('0x4f')](0x0);var _0x3751cc=moment(_0x5dccf4)[_0x1110('0x4f')](0x0);return _0x2df1fe[_0x1110('0x50')](_0x3751cc,_0x1110('0x51'));}function emit(_0x233d69,_0x4b0bdf,_0x283f12){io['to'](_0x233d69)['emit'](_0x4b0bdf,_0x283f12);}function emitVoiceQueueSummary(_0x3000ba){if(_0x3000ba[_0x1110('0x52')]===_0x1110('0x53')){var _0x372aa5={'id':_0x3000ba['id'],'name':_0x3000ba[_0x1110('0x44')],'strategy':_0x3000ba[_0x1110('0x54')],'answered':_0x3000ba[_0x1110('0x55')],'available':_0x3000ba['available'],'loggedIn':_0x3000ba['loggedIn'],'pTalking':_0x3000ba['pTalking'],'sumBillable':_0x3000ba[_0x1110('0x56')],'sumDuration':_0x3000ba[_0x1110('0x57')],'sumHoldTime':_0x3000ba[_0x1110('0x58')]||0x0,'talking':_0x3000ba[_0x1110('0x59')],'total':_0x3000ba['total'],'type':_0x3000ba[_0x1110('0x52')],'unmanaged':_0x3000ba[_0x1110('0x5a')],'abandoned':_0x3000ba[_0x1110('0x5b')],'waiting':_0x3000ba[_0x1110('0x5c')],'loggedInDb':_0x3000ba[_0x1110('0x5d')],'dialActive':_0x3000ba[_0x1110('0x5e')],'dialMethod':_0x3000ba[_0x1110('0x5f')],'dialOriginateCallerIdName':_0x3000ba['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3000ba[_0x1110('0x60')],'dialOriginateTimeout':_0x3000ba['dialOriginateTimeout'],'dialPrefix':_0x3000ba[_0x1110('0x61')],'outboundAnswerAgiCallsDay':_0x3000ba[_0x1110('0x62')],'outboundAnswerCallsDay':_0x3000ba[_0x1110('0x63')],'outboundBlacklistCallsDay':_0x3000ba[_0x1110('0x64')],'outboundBusyCallsDay':_0x3000ba['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3000ba[_0x1110('0x65')],'outboundDropCallsDayACS':_0x3000ba[_0x1110('0x66')],'outboundDropCallsDayCallersExit':_0x3000ba[_0x1110('0x67')],'outboundDropCallsDayTimeout':_0x3000ba['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3000ba['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3000ba[_0x1110('0x68')],'outboundOriginateFailureCallsDay':_0x3000ba[_0x1110('0x69')],'outboundReCallsDay':_0x3000ba[_0x1110('0x6a')],'outboundRejectCallsDay':_0x3000ba[_0x1110('0x6b')],'outboundUnknownCallsDay':_0x3000ba[_0x1110('0x6c')],'predictiveIntervalAnsweredCalls':_0x3000ba['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3000ba[_0x1110('0x6d')],'predictiveIntervalAvgTalktime':_0x3000ba[_0x1110('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x3000ba['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3000ba[_0x1110('0x6f')],'predictiveIntervalErlangCalls':_0x3000ba[_0x1110('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x3000ba['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3000ba[_0x1110('0x71')],'predictiveIntervalMultiplicativeFactor':_0x3000ba[_0x1110('0x72')],'predictiveIntervalPauses':_0x3000ba[_0x1110('0x73')],'predictiveIntervalAvailable':_0x3000ba[_0x1110('0x74')],'predictiveIntervalTotalCalls':_0x3000ba[_0x1110('0x75')],'message':_0x3000ba[_0x1110('0x42')],'originated':_0x3000ba[_0x1110('0x76')],'erlangCalls':_0x3000ba[_0x1110('0x77')],'erlangCallToSecond':_0x3000ba[_0x1110('0x78')],'erlangAbandonmentRate':_0x3000ba['erlangAbandonmentRate'],'erlangBusyFactor':_0x3000ba[_0x1110('0x79')],'startPredictive':_0x3000ba[_0x1110('0x2a')],'startProgressive':_0x3000ba[_0x1110('0x2b')]};if(_0x3000ba[_0x1110('0x7a')]){_0x372aa5['Trunk']={'id':_0x3000ba['Trunk']['id'],'name':_0x3000ba[_0x1110('0x7a')]['name'],'active':_0x3000ba[_0x1110('0x7a')][_0x1110('0x7b')],'callerid':_0x3000ba[_0x1110('0x7a')][_0x1110('0x7c')]};}if(_0x3000ba['Interval']){_0x372aa5[_0x1110('0x48')]={'id':_0x3000ba[_0x1110('0x48')]['id'],'name':_0x3000ba[_0x1110('0x48')][_0x1110('0x44')]};}var _0x40608f=md5(JSON[_0x1110('0x4e')](_0x372aa5));if(_0x3000ba[_0x1110('0x4')]!==_0x40608f){_0x3000ba['md5']=_0x40608f;emit(util[_0x1110('0x7d')](_0x1110('0x7e'),_0x372aa5[_0x1110('0x44')]),_0x1110('0x7f'),_0x372aa5);}}}function emitCampaignSummary(_0x4c718c){if(_0x4c718c[_0x1110('0x52')]===_0x1110('0x80')){emit(util['format'](_0x1110('0x81'),_0x4c718c[_0x1110('0x44')]),_0x1110('0x82'),_0x4c718c);}}function checkGetDataPredictive(_0x471a0c){if(isNotNull(_0x471a0c)&&!_[_0x1110('0x4c')](_0x471a0c)){loggerPredictive[_0x1110('0x83')](_0x1110('0x84'));loggerPredictive[_0x1110('0x83')](_0x1110('0x85'),_0x471a0c[_0x1110('0x75')]);loggerPredictive['info'](_0x1110('0x86'),_0x471a0c['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x1110('0x87'),_0x471a0c['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x1110('0x83')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x471a0c[_0x1110('0x88')]);loggerPredictive[_0x1110('0x83')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x471a0c[_0x1110('0x6d')]);loggerPredictive[_0x1110('0x83')](_0x1110('0x89'),_0x471a0c[_0x1110('0x6e')]);loggerPredictive['info'](_0x1110('0x8a'));if(_0x471a0c['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1110('0x41')](_0x471a0c[_0x1110('0x6e')])&&_0x471a0c[_0x1110('0x6e')]>0x0){return!![];}loggerPredictive['info'](_0x1110('0x8b'));if(!_[_0x1110('0x41')](_0x471a0c[_0x1110('0x6d')])&&_0x471a0c['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x1110('0x83')](_0x1110('0x8c'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x1110('0x83')](_0x1110('0x8d'));}return![];}function mergeDataErlangB(_0x2afdc1){return function(_0x587424){loggerPredictive[_0x1110('0x83')](_0x1110('0x8e'));loggerPredictive[_0x1110('0x83')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x587424[_0x1110('0x77')]);loggerPredictive[_0x1110('0x83')](_0x1110('0x8f'),_0x587424[_0x1110('0x78')]);loggerPredictive[_0x1110('0x83')](_0x1110('0x90'),_0x587424[_0x1110('0x91')]);loggerPredictive[_0x1110('0x83')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x587424['erlangBusyFactor']);loggerPredictive[_0x1110('0x83')](_0x1110('0x90'),_0x587424['erlangAbandonmentRate']);loggerPredictive[_0x1110('0x83')](_0x1110('0x8a'));_[_0x1110('0x92')](_0x2afdc1,_0x587424);};}function getDiff(_0x4dde7c){var _0x33c62d=moment()[_0x1110('0x4f')](0x0);var _0x8ec063=moment(_0x4dde7c)['milliseconds'](0x0);return _0x33c62d[_0x1110('0x50')](_0x8ec063,'seconds');}function ifInterval(_0xbc8d52,_0x20e351){if(_[_0x1110('0x41')](_0x20e351)){return![];}return getDiff(_0x20e351)<_0xbc8d52*0x3c;}function freeVariablesPredictive(_0x540eac){if(isNotNull(_0x540eac)){if(!_[_0x1110('0x41')](_0x540eac[_0x1110('0x2b')])){_0x540eac[_0x1110('0x2b')]=undefined;loggerPredictive[_0x1110('0x83')](_0x540eac[_0x1110('0x44')],_0x1110('0x93'));}if(!_[_0x1110('0x41')](_0x540eac[_0x1110('0x2a')])){_0x540eac[_0x1110('0x2a')]=undefined;loggerPredictive[_0x1110('0x83')](_0x540eac[_0x1110('0x44')],_0x1110('0x94'));}if(!_[_0x1110('0x41')](_0x540eac['handlePredictive'])){clearInterval(_0x540eac[_0x1110('0x95')]);_0x540eac['handlePredictive']=undefined;loggerPredictive[_0x1110('0x83')](_0x540eac[_0x1110('0x44')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4ede98,_0x37c5a3){if(_0x37c5a3===0x0){return 0x0;}var _0x283ec1=0x1;for(var _0x1eb110=0x1;_0x1eb110<=_0x37c5a3;_0x1eb110+=0x1){_0x283ec1=0x1+_0x283ec1*_0x1eb110/_0x4ede98;}return 0x1/_0x283ec1;}function isVoiceQueueOutbound(_0xc490c8){return _0xc490c8===_0x1110('0x53');}function isNotPreview(_0x55b90a){return _0x55b90a!=='preview';}function isCampaignIvr(_0x537e80){return _0x537e80===_0x1110('0x80');}function getCallerId(_0x3784ca,_0x24d994,_0x241b8d){if(!_['isUndefined'](_0x241b8d)&&typeof _0x241b8d===_0x1110('0x96')&&!_[_0x1110('0x4c')](_0x241b8d)){if(!_[_0x1110('0x41')](_0x24d994)&&typeof _0x24d994===_0x1110('0x96')&&!_[_0x1110('0x4c')](_0x24d994)){return util['format'](_0x1110('0x97'),_0x24d994,_0x241b8d);}return util[_0x1110('0x7d')]('\x22%s\x22\x20<%s>',_0x241b8d,_0x241b8d);}if(!_[_0x1110('0x41')](_0x3784ca)&&typeof _0x3784ca===_0x1110('0x96')&&!_[_0x1110('0x4c')](_0x3784ca)){return _0x3784ca;}return _0x1110('0x98');}function loggerCatchQueueSummary(_0x429ff9,_0x472183){return function(_0x168f2a){freeVariablesPredictive(_0x472183);emitVoiceQueueSummary(_0x472183);emitCampaignSummary(_0x472183);loggerSyncQueueSummary[_0x1110('0x99')](_0x429ff9,util[_0x1110('0x9a')](_0x168f2a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x9fb584,_0x52c75a){return function(_0x4a4251){loggerPredictive[_0x1110('0x99')](_0x52c75a[_0x1110('0x44')],_0x9fb584);loggerPredictive['error'](_0x4a4251[_0x1110('0x9b')]);freeVariablesPredictive(_0x52c75a);};}function loggerCatch(_0x2d887d){return function(_0x150d4d){logger[_0x1110('0x99')](_0x2d887d,util['inspect'](_0x150d4d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3dde38){return _0x3dde38&&!_[_0x1110('0x41')](_0x3dde38)&&_0x3dde38['length']>0x0;}function decremetOriginate(_0x567c8a){if(!_['isUndefined'](_0x567c8a)&&_0x567c8a!==null){if(typeof _0x567c8a[_0x1110('0x76')]!=='undefined'){if(_0x567c8a['originated']>0x0){_0x567c8a['originated']-=0x1;}else{logger[_0x1110('0x99')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1110('0x99')](_0x1110('0x9c'));}}function checkContactLowerLimitOriginate(_0x17b5df,_0x5eb307,_0x1ec2e3){if(_0x5eb307>_0x1ec2e3){for(var _0x587fad=0x0;_0x587fad<_0x5eb307-_0x1ec2e3;_0x587fad+=0x1){decremetOriginate(_0x17b5df);}}}function loggerGetContactDialer(_0x51498b,_0x562285,_0x2093cd){return function(_0x164166){checkContactLowerLimitOriginate(_0x562285,_0x2093cd,0x0);logger['error'](_0x51498b,util['inspect'](_0x164166,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x39a469){return function(_0x435b1d){if(isNotNull(_0x435b1d)&&isNotNull(_0x435b1d[0x0])){if(_0x435b1d[0x0][_0x1110('0x9d')]>0x0){_0x39a469[_0x1110('0x42')]=_0x1110('0x9e');logger['info']('[getContactDialer2][ReScheduled]'+_0x39a469[_0x1110('0x44')],_0x435b1d[0x0][_0x1110('0x9d')],_0x1110('0x9f'));}else{_0x39a469[_0x1110('0x42')]=_0x1110('0xa0');logger[_0x1110('0x83')]('[getContactDialer2][Empty]'+_0x39a469['name']);}}};}function notSendMessagesQueue(_0x42b876){if(_0x42b876[_0x1110('0xa1')]){freeVariablesPredictive(_0x42b876);if(_0x42b876[_0x1110('0x76')]===0x0&&_0x42b876['talking']===0x0&&_0x42b876[_0x1110('0x5c')]===0x0&&(_0x42b876[_0x1110('0xa2')]||0x0)===0x0){_0x42b876[_0x1110('0xa1')]=![];_0x42b876[_0x1110('0xa3')]=0x0;_0x42b876[_0x1110('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x1110('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x42b876[_0x1110('0x44')],_0x1110('0xa4'));}else{_0x42b876[_0x1110('0x42')]=_0x1110('0xa5');loggerSyncQueueSummary[_0x1110('0x99')](_0x1110('0xa6'),_0x42b876[_0x1110('0x44')],_0x1110('0xa7'));}emitVoiceQueueSummary(_0x42b876);}}function notSendMessagesCampaign(_0x5be17e){if(_0x5be17e['sendMessageOneNotActive']){if(_0x5be17e[_0x1110('0x76')]===0x0){_0x5be17e['sendMessageOneNotActive']=![];_0x5be17e[_0x1110('0x42')]=_0x1110('0x46');loggerSyncQueueSummary[_0x1110('0x99')](_0x1110('0xa8'),_0x5be17e[_0x1110('0x44')],_0x1110('0xa4'));}else{_0x5be17e['message']=_0x1110('0xa5');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5be17e['name'],_0x1110('0xa7'));}emitCampaignSummary(_0x5be17e);}}function createObjHistory(_0x5ebb69,_0x380226,_0x428df1,_0x212a65,_0x397ed6){_0x5ebb69[_0x1110('0x42')]=_0x428df1;var _0x58dfee=new Action(_0x5ebb69,_0x380226);var _0x55ca17=new History(_0x58dfee);_0x55ca17[_0x1110('0xa9')]=_0x212a65;_0x55ca17[_0x1110('0xaa')]=_0x397ed6;_0x55ca17[_0x1110('0xab')]=_0x58dfee[_0x1110('0xac')];return _0x55ca17;}Dialer[_0x1110('0x1c')][_0x1110('0x40')]=function(){var _0x15aacc=this;setInterval(function(){_0x15aacc[_0x1110('0xad')](_0x15aacc[_0x1110('0x28')],'[uniqueid]');_0x15aacc[_0x1110('0xad')](_0x15aacc[_0x1110('0x26')],_0x1110('0xae'));},0x32c8);};Dialer[_0x1110('0x1c')]['clearZombieChannels']=function(_0x3fcd7a,_0x5aa7f6){var _0xa0890f=this;for(var _0x11c6c0 in _0x3fcd7a){if(typeof _0x3fcd7a[_0x11c6c0]!=='undefined'){this[_0x1110('0x20')][_0x1110('0x1d')](function(){if(!_[_0x1110('0xaf')](_0x3fcd7a[_0x11c6c0])){return ami[_0x1110('0xb0')]({'action':_0x1110('0xb1'),'channel':_0x3fcd7a[_0x11c6c0][_0x1110('0xb2')]})[_0x1110('0xb3')](function(_0x5daf0e){if(_0x5daf0e[_0x1110('0x42')]===_0x1110('0xb4')){setTimeout(function(){if(_0x3fcd7a[_0x11c6c0]&&_0x3fcd7a[_0x11c6c0][_0x1110('0x52')]!==_0x1110('0x80')){_0xa0890f[_0x1110('0xb5')](_0xa0890f[_0x1110('0x21')][_0x3fcd7a[_0x11c6c0][_0x1110('0xb6')]]);logger[_0x1110('0x99')](_0x1110('0xb7'),_0x5aa7f6,_0x11c6c0,_0x3fcd7a[_0x11c6c0]['queue']);delete _0x3fcd7a[_0x11c6c0];}if(_0x3fcd7a[_0x11c6c0]&&_0x3fcd7a[_0x11c6c0][_0x1110('0x52')]==='ivr'){_0xa0890f['updateOriginated'](_0xa0890f['campaigns'][_0x3fcd7a[_0x11c6c0][_0x1110('0xb6')]]);logger[_0x1110('0x99')](_0x1110('0xb8'),_0x5aa7f6,_0x11c6c0,_0x3fcd7a[_0x11c6c0][_0x1110('0xb6')]);delete _0x3fcd7a[_0x11c6c0];}},0x2328);}});}});}}};Dialer[_0x1110('0x1c')][_0x1110('0xb9')]=function(_0x88e35b){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x88e35b))[_0x1110('0xb3')](loggerCatch(_0x1110('0xba')));};Dialer[_0x1110('0x1c')][_0x1110('0xbb')]=function(_0x4642d2){return BPromise['resolve']()[_0x1110('0xbc')](cmHopperBlack[_0x1110('0xbb')](_0x4642d2))[_0x1110('0xb3')](loggerCatch(_0x1110('0xbd')));};Dialer[_0x1110('0x1c')][_0x1110('0xbe')]=function(_0xd47ef3,_0x33b381,_0x15ccd9){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x1110('0xbe')](_0xd47ef3,_0x33b381,_0x15ccd9))['catch'](loggerCatch(_0x1110('0xbf')));};Dialer[_0x1110('0x1c')]['swapAdditionalPhones']=function(_0x3f9ff0,_0xca892d,_0x2ab79d){console[_0x1110('0xc0')](_0x1110('0xc1'),_0x3f9ff0);console['log'](_0x1110('0xc2'),_0xca892d);console['log']('Calling\x20swapAdditionalPhone\x20waitTime->',_0x2ab79d);return BPromise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x3f9ff0,_0xca892d,_0x2ab79d))[_0x1110('0xb3')](loggerCatch(_0x1110('0xc3')));};Dialer[_0x1110('0x1c')][_0x1110('0xc4')]=function(_0x5d25a2){return BPromise['resolve']()[_0x1110('0xbc')](cmHopperBlack[_0x1110('0xc4')](_0x5d25a2))[_0x1110('0xb3')](loggerCatch(_0x1110('0xc5')));};Dialer['prototype'][_0x1110('0xc6')]=function(_0x1c3bba){return BPromise['resolve']()[_0x1110('0xbc')](cmHopperHistory[_0x1110('0xc7')](_0x1c3bba))[_0x1110('0xb3')](loggerCatch(_0x1110('0xc8')));};Dialer[_0x1110('0x1c')][_0x1110('0xc9')]=function(_0x15bd16){return BPromise['resolve']()[_0x1110('0xbc')](cmHopper[_0x1110('0xc9')](_0x15bd16))[_0x1110('0xb3')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x1110('0x1c')][_0x1110('0xca')]=function(_0x1cd379,_0x2e1dd2,_0x2f3577){return BPromise[_0x1110('0xcb')]()[_0x1110('0xbc')](cmHopper[_0x1110('0xca')](_0x1cd379,_0x2e1dd2,_0x2f3577))[_0x1110('0xb3')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x1110('0x1c')]['getContactDialer']=function(_0xabb948,_0x2008c4,_0x149ebb,_0x1be6bb,_0x545da1){return BPromise[_0x1110('0xcb')]()[_0x1110('0xbc')](cmHopper['getContactDialer'](_0xabb948,_0x2008c4,_0x149ebb,_0x1be6bb))[_0x1110('0xb3')](function(_0x48d081){_0x545da1['temp']-=_0x149ebb;_0x545da1[_0x1110('0xcc')]=_0x545da1['temp']>0x0?_0x545da1[_0x1110('0xcc')]:0x0;loggerCatch(_0x1110('0xcd'))(_0x48d081);});};Dialer[_0x1110('0x1c')]['getContactDialerIvr']=function(_0x532383,_0x28f7c4,_0x4b5a60,_0x391755){return BPromise['resolve']()['then'](cmHopper[_0x1110('0xce')](_0x532383,_0x28f7c4,_0x4b5a60))[_0x1110('0xb3')](function(_0x3b4e56){_0x391755[_0x1110('0xcc')]-=_0x28f7c4;_0x391755[_0x1110('0xcc')]=_0x391755[_0x1110('0xcc')]>0x0?_0x391755[_0x1110('0xcc')]:0x0;loggerCatch(_0x1110('0xcf'))(_0x3b4e56);});};Dialer[_0x1110('0x1c')][_0x1110('0xd0')]=function(_0x5b143d){return BPromise['resolve']()[_0x1110('0xbc')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5b143d))[_0x1110('0xb3')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x1110('0x1c')][_0x1110('0xd1')]=function(_0x28f2c9){return BPromise[_0x1110('0xcb')]()[_0x1110('0xbc')](cmHopper[_0x1110('0xd1')](_0x28f2c9))[_0x1110('0xb3')](loggerCatch(_0x1110('0xd2')));};Dialer[_0x1110('0x1c')][_0x1110('0xd3')]=function(_0x446417){return BPromise[_0x1110('0xcb')]()[_0x1110('0xbc')](cmHopperHistory[_0x1110('0xd3')](_0x446417))[_0x1110('0xb3')](loggerCatch(_0x1110('0xd4')));};Dialer[_0x1110('0x1c')][_0x1110('0xb5')]=function(_0x45b54e){if(!_['isUndefined'](_0x45b54e)&&_0x45b54e!==null){if(typeof _0x45b54e['originated']!==_0x1110('0xd5')){if(_0x45b54e[_0x1110('0x76')]>0x0){_0x45b54e['originated']-=0x1;}else{logger[_0x1110('0x99')](_0x1110('0xd6'));}}}else{logger[_0x1110('0x99')](_0x1110('0xd7'));}};Dialer[_0x1110('0x1c')][_0x1110('0xd8')]=function(_0x30fdfc,_0xe8d14e){var _0x3b19da=this;return function(_0x21f7de){_0x3b19da[_0x1110('0xb5')](_0xe8d14e);logger[_0x1110('0x99')](_0x30fdfc,util[_0x1110('0x9a')](_0x21f7de,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x1110('0xd9')]=function(_0x3307ff,_0x1314f0,_0x504431){var _0x2815b9={'state':0x19,'statedesc':_0x1110('0xda')};this[_0x1110('0xb5')](_0x1314f0);this[_0x1110('0xdb')](_[_0x1110('0x92')](_0x2815b9,_['pick'](_0x504431,[_0x1110('0xdc'),_0x1110('0xdd'),_0x1110('0xde'),_0x1110('0xdf'),_0x1110('0xe0')])),_0x1110('0xe1'),_0x1110('0xe2'));logger['error'](_0x3307ff);};Dialer['prototype'][_0x1110('0xe3')]=function(_0x193f12){return _0x193f12==='Success';};Dialer['prototype'][_0x1110('0xe4')]=function(_0x2c1768){return!_['isUndefined'](_0x2c1768)&&_0x2c1768&&!_[_0x1110('0x41')](_0x2c1768[_0x1110('0x44')])&&!_['isUndefined'](_0x2c1768['active'])&&_0x2c1768['active']&&(this[_0x1110('0x24')][util[_0x1110('0x7d')](_0x1110('0xe5'),_0x2c1768['name'])][_0x1110('0xb1')]===_0x1110('0xe6')||this[_0x1110('0x24')][util['format'](_0x1110('0xe5'),_0x2c1768[_0x1110('0x44')])]['status']==='unmonitored');};Dialer[_0x1110('0x1c')][_0x1110('0xdb')]=function(_0x53388d,_0x98a4e,_0x1902ea){this[_0x1110('0xd3')](_0x53388d)['catch'](loggerCatch(_0x98a4e));this[_0x1110('0xd1')](_0x53388d)[_0x1110('0xb3')](loggerCatch(_0x1902ea));};Dialer[_0x1110('0x1c')][_0x1110('0x3c')]=function(_0x26cd67){var _0x757c6=this[_0x1110('0x28')][_0x26cd67['uniqueid']];var _0x30a5ea;if(!_[_0x1110('0xaf')](_0x26cd67)&&!_[_0x1110('0xaf')](_0x26cd67[_0x1110('0xe7')])&&!_['isNil'](_0x26cd67[_0x1110('0xe7')][_0x1110('0xe8')])&&_0x26cd67['exten']===_0x1110('0xe9')&&_0x757c6){if(_0x757c6[_0x1110('0x52')]!==_0x1110('0x80')&&this['voiceQueues'][_0x757c6['queue']][_0x1110('0xea')]&&_0x26cd67[_0x1110('0xeb')]===_0x1110('0xec')){delete this['uniqueId'][_0x26cd67['uniqueid']];this['updateOriginated'](this[_0x1110('0x21')][_0x757c6[_0x1110('0xb6')]]);this[_0x1110('0x21')][_0x757c6['queue']][_0x1110('0x63')]+=0x1;this['voiceQueues'][_0x757c6[_0x1110('0xb6')]][_0x1110('0x62')]+=0x1;_0x30a5ea=new Hangup(_0x757c6,_0x26cd67);_0x30a5ea[_0x1110('0xa9')]=0x12;_0x30a5ea[_0x1110('0xaa')]='HangupInAMD';_0x30a5ea[_0x1110('0xed')]=_0x1110('0xee');ami[_0x1110('0xef')](_0x1110('0xf0'),ut[_0x1110('0xf1')](_0x30a5ea,'amd'));this['saveInDb'](_0x30a5ea,_0x1110('0xf2'),_0x1110('0xf3'));}if(_0x757c6[_0x1110('0x52')]!=='ivr'&&this[_0x1110('0x21')][_0x757c6['queue']][_0x1110('0xea')]&&_0x26cd67['value']==='MACHINE'){var _0x35aa58=this;return new BPromise(function(_0x461a1a,_0x1e3b39){delete _0x35aa58[_0x1110('0x28')][_0x26cd67[_0x1110('0xf4')]];_0x35aa58['updateOriginated'](_0x35aa58[_0x1110('0x21')][_0x757c6['queue']]);_0x35aa58[_0x1110('0x21')][_0x757c6[_0x1110('0xb6')]][_0x1110('0x63')]+=0x1;_0x35aa58[_0x1110('0x21')][_0x757c6[_0x1110('0xb6')]][_0x1110('0x62')]+=0x1;var _0x324729=_0x35aa58[_0x1110('0x21')][_0x757c6[_0x1110('0xb6')]];var _0x26422f=new Hangup(_0x757c6,_0x26cd67);_0x26422f['state']=0x13;_0x26422f[_0x1110('0xaa')]=_0x1110('0xf5');_0x26422f['membername']=_0x1110('0xee');_0x26422f[_0x1110('0xf6')]+=0x1;_0x26422f['countglobal']+=0x1;_0x26422f[_0x1110('0xf7')]=!![];ami[_0x1110('0xef')](_0x1110('0xf0'),ut[_0x1110('0xf1')](_0x26422f,_0x1110('0xf7')));_0x35aa58[_0x1110('0xd3')](_0x26422f)[_0x1110('0xb3')](loggerCatch(_0x1110('0xf8')));if(_0x26422f[_0x1110('0xf9')]+_0x26422f[_0x1110('0xfa')]+_0x26422f[_0x1110('0xfb')]+_0x26422f['countnosuchnumberretry']+_0x26422f[_0x1110('0xfc')]+_0x26422f[_0x1110('0xfd')]+_0x26422f['countmachineretry']+_0x26422f['countagentrejectretry']>=_0x324729[_0x1110('0xfe')]){_0x35aa58[_0x1110('0xff')](_0x26422f,_0x461a1a,_0x1e3b39,_0x1110('0x100'));}else{if(_0x26422f[_0x1110('0xf6')]>=_0x324729['dialMachineMaxRetry']){_0x35aa58[_0x1110('0x101')](_0x26422f,_0x461a1a,_0x1e3b39,_0x1110('0x102'));}else{_0x35aa58[_0x1110('0xc9')]({'active':![],'countmachineretry':_0x26422f['countmachineretry'],'scheduledat':moment()[_0x1110('0x103')](_0x324729[_0x1110('0x104')],_0x1110('0x105'))['format'](_0x1110('0x106')),'ContactId':_0x26422f[_0x1110('0xdc')],'ListId':_0x26422f[_0x1110('0xdd')],'VoiceQueueId':_0x26422f['VoiceQueueId']||undefined,'CampaignId':_0x26422f[_0x1110('0xe0')]||undefined})['catch'](loggerCatch(_0x1110('0x107')));_0x461a1a({'reschedule':0x1});}}});}if(_0x757c6['type']===_0x1110('0x80')&&this[_0x1110('0x22')][_0x757c6[_0x1110('0xb6')]][_0x1110('0xea')]&&_0x26cd67['value']===_0x1110('0xec')){delete this[_0x1110('0x28')][_0x26cd67[_0x1110('0xf4')]];this[_0x1110('0xb5')](this['campaigns'][_0x757c6[_0x1110('0xb6')]]);_0x30a5ea=new Hangup(_0x757c6,_0x26cd67);_0x30a5ea[_0x1110('0xa9')]=0x12;_0x30a5ea[_0x1110('0xaa')]=_0x1110('0x108');_0x30a5ea[_0x1110('0xed')]=_0x1110('0xee');ami[_0x1110('0xef')]('custom:amd',ut[_0x1110('0xf1')](_0x30a5ea,_0x1110('0xf7')));this[_0x1110('0xdb')](_0x30a5ea,'[syncHangupInAMDIvr][createHistory]',_0x1110('0x109'));}if(_0x757c6[_0x1110('0x52')]===_0x1110('0x80')&&this['campaigns'][_0x757c6[_0x1110('0xb6')]][_0x1110('0xea')]&&_0x26cd67[_0x1110('0xeb')]===_0x1110('0x10a')){var _0x35aa58=this;return new BPromise(function(_0x226678,_0x1c38d4){delete _0x35aa58[_0x1110('0x28')][_0x26cd67[_0x1110('0xf4')]];_0x35aa58[_0x1110('0xb5')](_0x35aa58['campaigns'][_0x757c6['queue']]);_0x35aa58[_0x1110('0x22')][_0x757c6[_0x1110('0xb6')]][_0x1110('0x63')]+=0x1;_0x35aa58[_0x1110('0x22')][_0x757c6[_0x1110('0xb6')]][_0x1110('0x62')]+=0x1;var _0xb519ef=_0x35aa58[_0x1110('0x22')][_0x757c6[_0x1110('0xb6')]];var _0x5dbeb5=new Hangup(_0x757c6,_0x26cd67);_0x5dbeb5[_0x1110('0xa9')]=0x13;_0x5dbeb5[_0x1110('0xaa')]=_0x1110('0xf5');_0x5dbeb5[_0x1110('0xed')]=_0x1110('0xee');_0x5dbeb5['countmachineretry']+=0x1;_0x5dbeb5[_0x1110('0x10b')]+=0x1;_0x5dbeb5['amd']=!![];ami[_0x1110('0xef')](_0x1110('0xf0'),ut['buildObj'](_0x5dbeb5,_0x1110('0xf7')));_0x35aa58['createHistory'](_0x5dbeb5)['catch'](loggerCatch(_0x1110('0xf8')));if(_0x5dbeb5['countbusyretry']+_0x5dbeb5[_0x1110('0xfa')]+_0x5dbeb5[_0x1110('0xfb')]+_0x5dbeb5[_0x1110('0x10c')]+_0x5dbeb5['countdropretry']+_0x5dbeb5[_0x1110('0xfd')]+_0x5dbeb5[_0x1110('0xf6')]+_0x5dbeb5[_0x1110('0x10d')]>=_0xb519ef[_0x1110('0xfe')]){_0x35aa58['stateGlobal'](_0x5dbeb5,_0x226678,_0x1c38d4,_0x1110('0x100'));}else{if(_0x5dbeb5[_0x1110('0xf6')]>=_0xb519ef[_0x1110('0x10e')]){_0x35aa58[_0x1110('0x101')](_0x5dbeb5,_0x226678,_0x1c38d4,_0x1110('0x102'));}else{_0x35aa58[_0x1110('0xc9')]({'active':![],'countmachineretry':_0x5dbeb5[_0x1110('0xf6')],'scheduledat':moment()['add'](_0xb519ef[_0x1110('0x104')],_0x1110('0x105'))[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5dbeb5[_0x1110('0xdc')],'ListId':_0x5dbeb5['ListId'],'VoiceQueueId':_0x5dbeb5['VoiceQueueId']||undefined,'CampaignId':_0x5dbeb5[_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x107')));_0x226678({'reschedule':0x1});}}});}}};Dialer[_0x1110('0x1c')][_0x1110('0x39')]=function(_0xce5a25){var _0x1b2867=this[_0x1110('0x28')][_0xce5a25[_0x1110('0xf4')]];var _0x134564=this;var _0x2901b1;if(_0x1b2867&&_0x1b2867[_0x1110('0x52')]==='ivr'){delete this['uniqueId'][_0xce5a25['uniqueid']];this[_0x1110('0xb5')](this['campaigns'][_0x1b2867[_0x1110('0xb6')]]);this[_0x1110('0x22')][_0x1b2867['queue']][_0x1110('0x10f')]+=0x1;_0x2901b1=new Hangup(_0x1b2867,_0xce5a25);this['createHistory'](_0x2901b1)[_0x1110('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x1110('0xd1')](_0x2901b1)[_0x1110('0xb3')](loggerCatch(_0x1110('0x110')));}if(_0x1b2867&&_0x1b2867[_0x1110('0x52')]!==_0x1110('0x80')&&isNotNull(this[_0x1110('0x21')][_0x1b2867['queue']][_0x1110('0x111')])){delete this['uniqueId'][_0xce5a25[_0x1110('0xf4')]];this['updateOriginated'](this['voiceQueues'][_0x1b2867[_0x1110('0xb6')]]);this['voiceQueues'][_0x1b2867[_0x1110('0xb6')]]['outboundAnswerCallsDay']+=0x1;this[_0x1110('0x21')][_0x1b2867[_0x1110('0xb6')]][_0x1110('0x62')]+=0x1;_0x2901b1=new Hangup(_0x1b2867,_0xce5a25);_0x2901b1['state']=0x10;_0x2901b1[_0x1110('0xaa')]=_0x1110('0x112');_0x2901b1[_0x1110('0xed')]='AGI';this['createHistory'](_0x2901b1)[_0x1110('0xb3')](loggerCatch(_0x1110('0x113')));this['moveContactManagedDialer'](_0x2901b1)[_0x1110('0xb3')](loggerCatch(_0x1110('0x110')));}if(_0x1b2867&&_0x1b2867[_0x1110('0x52')]!==_0x1110('0x80')&&!isNotNull(this[_0x1110('0x21')][_0x1b2867['queue']]['dialQueueProject'])){delete this['uniqueId'][_0xce5a25['uniqueid']];this[_0x1110('0xb5')](this[_0x1110('0x21')][_0x1b2867[_0x1110('0xb6')]]);this['voiceQueues'][_0x1b2867[_0x1110('0xb6')]][_0x1110('0x6c')]+=0x1;_0x2901b1=new Hangup(_0x1b2867,_0xce5a25);_0x2901b1[_0x1110('0xa9')]=0xc;_0x2901b1[_0x1110('0xaa')]=_0xce5a25['cause-txt'];_0x2901b1[_0x1110('0xed')]=_0x1110('0x114');this[_0x1110('0xd3')](_0x2901b1)[_0x1110('0xb3')](loggerCatch(_0x1110('0x113')));this[_0x1110('0xd1')](_0x2901b1)['catch'](loggerCatch(_0x1110('0x110')));}};Dialer['prototype'][_0x1110('0x36')]=function(_0x1c24b1){var _0x4f77c5=this[_0x1110('0x28')][_0x1c24b1['uniqueid']];var _0x19b1f4=this;if(this[_0x1110('0x21')][_0x1c24b1['queue']]){if(_0x4f77c5&&_0x4f77c5[_0x1110('0x52')]!==_0x1110('0x80')){delete this[_0x1110('0x28')][_0x1c24b1[_0x1110('0xf4')]];this[_0x1110('0x21')][_0x1c24b1[_0x1110('0xb6')]][_0x1110('0x63')]+=0x1;var _0x5866dc=new AgentComplete(_0x4f77c5,_0x1c24b1);if(_0x1c24b1[_0x1110('0x115')]===_0x1110('0x116')){_0x5866dc[_0x1110('0x117')]=this[_0x1110('0x21')][_0x1c24b1[_0x1110('0xb6')]][_0x1110('0x118')]&&this[_0x1110('0x21')][_0x1c24b1['queue']]['dialAgiAfterHangupAgent']?moment()[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x1110('0xd3')](_0x5866dc)[_0x1110('0xb3')](loggerCatch(_0x1110('0x119')));this[_0x1110('0xd1')](_0x5866dc)[_0x1110('0xb3')](loggerCatch(_0x1110('0x11a')));}}};Dialer[_0x1110('0x1c')][_0x1110('0x2f')]=function(_0x5cea1b){if(this['voiceQueues'][_0x5cea1b['queue']]){if(this[_0x1110('0x28')][_0x5cea1b['uniqueid']]&&this[_0x1110('0x28')][_0x5cea1b[_0x1110('0xf4')]]['type']!==_0x1110('0x80')){this[_0x1110('0xb5')](this[_0x1110('0x21')][_0x5cea1b[_0x1110('0xb6')]]);this[_0x1110('0x28')][_0x5cea1b[_0x1110('0xf4')]][_0x1110('0x11b')]=moment()[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x1110('0x1c')][_0x1110('0x11c')]=function(_0x3e3c9b,_0xa294ec){this[_0x1110('0xd3')](_0x3e3c9b)[_0x1110('0xb3')](loggerCatch(_0x1110('0x119')));if(_0xa294ec==0x0){this[_0x1110('0xd1')](_0x3e3c9b)['catch'](loggerCatch(_0x1110('0x11d')));}};Dialer[_0x1110('0x1c')]['syncQueueCallerAbandon']=function(_0x1e37d1){var _0x3416a8=this['uniqueId'][_0x1e37d1['uniqueid']];var _0x1f6dfa=this;var _0x2f216f=![];var _0x4e338a;var _0x2bc7d9;if(this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]]){if(_0x3416a8&&_0x3416a8['type']!=='ivr'){delete this['uniqueId'][_0x1e37d1[_0x1110('0xf4')]];this[_0x1110('0xb5')](this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]]);_0x3416a8[_0x1110('0x11e')]=moment()[_0x1110('0x7d')](_0x1110('0x106'));var _0x3a2651=new QueueCallerAbandon(_0x3416a8,_0x1e37d1);if(getSeconds(_0x3416a8[_0x1110('0x11e')],_0x3416a8[_0x1110('0x11f')])>=_0x3416a8[_0x1110('0x120')]){this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x6f')]+=0x1;this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x121')]+=0x1;this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x122')]+=0x1;_0x3a2651['state']=0xa;_0x3a2651[_0x1110('0xaa')]='Drop';_0x3a2651['dropreason']=_0x1110('0x123');_0x3a2651[_0x1110('0x117')]=this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x118')]?moment()[_0x1110('0x7d')](_0x1110('0x106')):undefined;_0x3a2651[_0x1110('0xfc')]+=0x1;_0x3a2651[_0x1110('0x10b')]+=0x1;_0x4e338a=this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x124')];_0x2bc7d9=this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x125')];_0x1f6dfa[_0x1110('0xbe')](_0x3a2651,_0x3a2651[_0x1110('0xa9')],_0x3416a8[_0x1110('0x126')])['then'](function(_0x5aa794){_0x2f216f=_0x5aa794[_0x1110('0x127')]==0x1;if(_0x3a2651['countdropretry']>=_0x1f6dfa[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x128')]){_0x1f6dfa['queueCallerAbandonCreateState'](_0x3a2651,_0x5aa794[_0x1110('0x127')]);}else{_0x1f6dfa[_0x1110('0xc9')]({'active':![],'countdropretry':_0x3a2651['countdropretry'],'scheduledat':moment()[_0x1110('0x103')](_0x1f6dfa[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x124')],'minutes')[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x3416a8['ContactId'],'ListId':_0x3416a8[_0x1110('0xdd')],'VoiceQueueId':_0x3416a8[_0x1110('0xdf')]||undefined,'CampaignId':_0x3416a8['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x129')));var _0x1db4b7=new History(_0x3a2651);_0x1db4b7[_0x1110('0xa9')]=0xa;_0x1db4b7['statedesc']=_0x1110('0x12a');_0x1db4b7[_0x1110('0xac')]=moment()['format'](_0x1110('0x106'));_0x1db4b7[_0x1110('0xab')]=_0x1db4b7[_0x1110('0xac')];_0x1db4b7['calleridname']=_0x3a2651[_0x1110('0x12b')];_0x1db4b7['calleridnum']=_0x3a2651['calleridnum'];_0x1f6dfa[_0x1110('0xd3')](_0x1db4b7)[_0x1110('0xb3')](loggerCatch(_0x1110('0x12c')));}})[_0x1110('0xbc')](function(_0x16178e){if(_0x2f216f)_0x1f6dfa[_0x1110('0x12d')](_0x3a2651,_0x4e338a,_0x2bc7d9)[_0x1110('0xbc')](function(_0xe39264){return 0x1;});});}else{this[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x1e37d1[_0x1110('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3a2651[_0x1110('0xa9')]=0xb;_0x3a2651[_0x1110('0xaa')]=_0x1110('0x12e');_0x3a2651[_0x1110('0x12f')]=_0x1110('0x130');_0x3a2651['countabandonedretry']+=0x1;_0x3a2651[_0x1110('0x10b')]+=0x1;_0x4e338a=this[_0x1110('0x21')][_0x1e37d1['queue']]['dialAbandonedRetryFrequency'];_0x2bc7d9=this[_0x1110('0x21')][_0x1e37d1['queue']][_0x1110('0x125')];_0x1f6dfa['verifyAdditionalPhones'](_0x3a2651,_0x3a2651[_0x1110('0xa9')],_0x3416a8[_0x1110('0x126')])[_0x1110('0xbc')](function(_0x2ccb30){if(_0x3a2651[_0x1110('0xfd')]>=_0x1f6dfa[_0x1110('0x21')][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x131')]){_0x1f6dfa[_0x1110('0x11c')](_0x3a2651,_0x2ccb30[_0x1110('0x127')]);}else{_0x1f6dfa[_0x1110('0xc9')]({'active':![],'countabandonedretry':_0x3a2651[_0x1110('0xfd')],'scheduledat':moment()[_0x1110('0x103')](_0x1f6dfa['voiceQueues'][_0x1e37d1[_0x1110('0xb6')]][_0x1110('0x132')],_0x1110('0x105'))[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x3416a8[_0x1110('0xdc')],'ListId':_0x3416a8[_0x1110('0xdd')],'VoiceQueueId':_0x3416a8[_0x1110('0xdf')]||undefined,'CampaignId':_0x3416a8['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x392184=new History(_0x3a2651);_0x392184['state']=0xb;_0x392184['statedesc']=_0x1110('0x12e');_0x392184['starttime']=moment()[_0x1110('0x7d')](_0x1110('0x106'));_0x392184[_0x1110('0xab')]=_0x392184[_0x1110('0xac')];_0x392184[_0x1110('0x12b')]=_0x3a2651['calleridname'];_0x392184[_0x1110('0x133')]=_0x3a2651[_0x1110('0x133')];_0x1f6dfa[_0x1110('0xd3')](_0x392184)[_0x1110('0xb3')](loggerCatch(_0x1110('0x134')));}})[_0x1110('0xbc')](function(_0x3e7c44){if(_0x2f216f)_0x1f6dfa[_0x1110('0x12d')](_0x3a2651,_0x4e338a,_0x2bc7d9)['then'](function(_0x325089){return 0x1;});});}}}};Dialer[_0x1110('0x1c')][_0x1110('0x3b')]=function(_0x2b4e5e){if(this[_0x1110('0x26')][_0x2b4e5e[_0x1110('0xf4')]]){this[_0x1110('0x26')][_0x2b4e5e[_0x1110('0xf4')]][_0x1110('0xb2')]=_0x2b4e5e[_0x1110('0xb2')];}if(this[_0x1110('0x28')][_0x2b4e5e['uniqueid']]){this[_0x1110('0x28')][_0x2b4e5e['uniqueid']][_0x1110('0xb2')]=_0x2b4e5e[_0x1110('0xb2')];}};Dialer[_0x1110('0x1c')][_0x1110('0x3e')]=function(_0x3507f6){if(strategy[this[_0x1110('0x21')][this[_0x1110('0x26')][_0x3507f6['actionid']]['queue']]['strategy']]==='roundrobin'){if(this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]]&&_[_0x1110('0xaf')](this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]][_0x1110('0x136')])&&_0x3507f6[_0x1110('0xb1')]==='1'&&_0x3507f6['paused']==='0'){if(this[_0x1110('0x23')][_0x3507f6[_0x1110('0x137')]]){if(!this[_0x1110('0x23')][_0x3507f6[_0x1110('0x137')]][_0x1110('0x136')]){this[_0x1110('0x23')][_0x3507f6[_0x1110('0x137')]]['locked']=!![];this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]][_0x1110('0x136')]=!![];this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]][_0x1110('0x137')]=_0x3507f6[_0x1110('0x137')];}}}}else if((strategy[this[_0x1110('0x21')][this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]]['queue']]['strategy']]||_0x1110('0x1a'))==='rrmemory'){if(this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]]){if(this[_0x1110('0x23')][_0x3507f6[_0x1110('0x137')]]){this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]]['stateinterface']=_0x3507f6[_0x1110('0x137')];if(_[_0x1110('0xaf')](this[_0x1110('0x2d')][this[_0x1110('0x26')][_0x3507f6['actionid']][_0x1110('0xb6')]])){this[_0x1110('0x2d')][this['actions'][_0x3507f6['actionid']][_0x1110('0xb6')]]=[];}this['queueBooked'][this[_0x1110('0x26')][_0x3507f6[_0x1110('0x135')]][_0x1110('0xb6')]][_0x1110('0x138')](_[_0x1110('0x92')](_[_0x1110('0x139')](this[_0x1110('0x26')][_0x3507f6['actionid']],[_0x1110('0x13a'),_0x1110('0x137')]),{'status':_0x3507f6['status'],'paused':_0x3507f6['paused']}));}}}};function unlockQueueStatus(_0x3f316a,_0x301708){setTimeout(function(){if(_['isUndefined'](_0x3f316a[_0x1110('0x13b')])){loggerBooked[_0x1110('0x99')](_0x1110('0x13c'),_0x301708);}_0x3f316a[_0x1110('0x13b')]=!![];loggerBooked[_0x1110('0x83')](_0x1110('0x13d'),_0x301708,JSON[_0x1110('0x4e')](_[_0x1110('0x139')](_0x3f316a,[_0x1110('0x44'),_0x1110('0x13b')])));},0x1f3);}Dialer['prototype'][_0x1110('0x13e')]=function(_0x4ee45b){var _0x46d7ff=this;var _0x575a61=_0x46d7ff[_0x1110('0x21')][_0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]]['queue']];if(strategy[this[_0x1110('0x21')][this[_0x1110('0x26')][_0x4ee45b['actionid']][_0x1110('0xb6')]][_0x1110('0x54')]]==='roundrobin'){if(this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]]&&this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0x137')]){this[_0x1110('0x13f')][_0x1110('0x140')](this[_0x1110('0x26')][_0x4ee45b['actionid']][_0x1110('0x13a')],this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]]['stateinterface'])[_0x1110('0xb3')](function(_0x14faf0){logger[_0x1110('0x99')](_0x1110('0x141'),util[_0x1110('0x9a')](_0x14faf0,{'showHidden':![],'depth':null}));})[_0x1110('0x1f')](function(){_0x46d7ff['updateOriginated'](_0x46d7ff[_0x1110('0x21')][_0x46d7ff['actions'][_0x4ee45b['actionid']]['queue']]);_0x46d7ff[_0x1110('0x23')][_0x46d7ff['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0x137')]]['locked']=![];delete _0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61);});}else{this['updateOriginated'](this[_0x1110('0x21')][this['actions'][_0x4ee45b['actionid']][_0x1110('0xb6')]]);this[_0x1110('0xc9')]({'active':![],'ContactId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdc')],'ListId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdd')],'VoiceQueueId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdf')]||undefined,'CampaignId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xe0')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61);}}else if((strategy[this['voiceQueues'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]][_0x1110('0x54')]]||_0x1110('0x1a'))===_0x1110('0x1a')){var _0x5ee3d4;if(this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]]&&!_['isEmpty'](this['queueBooked'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]])){if(this['queueBookedRR'][_0x46d7ff[_0x1110('0x26')][_0x4ee45b['actionid']]['queue']]){this[_0x1110('0x2e')][_0x46d7ff['actions'][_0x4ee45b[_0x1110('0x135')]]['queue']]=this[_0x1110('0x2e')][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]?this['queueBookedRR'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]:this[_0x1110('0x2d')][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]?this[_0x1110('0x2d')][this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]['_rr']||0x0:0x0;}this[_0x1110('0x2d')][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]][_0x1110('0x142')]=this[_0x1110('0x2e')][this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]];for(var _0x5e7eef=0x0;_0x5e7eef<this['queueBooked'][this['actions'][_0x4ee45b[_0x1110('0x135')]]['queue']][_0x1110('0x143')];_0x5e7eef+=0x1){_0x5ee3d4=rr(this['queueBooked'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]);this[_0x1110('0x2e')][_0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]=this['queueBooked'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]][_0x1110('0x142')];if(_0x5ee3d4[_0x1110('0xb1')]==='1'&&_0x5ee3d4[_0x1110('0x144')]==='0'){break;}}if(!_[_0x1110('0xaf')](_0x5ee3d4)){this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]]['unlockRR']=_[_0x1110('0x41')](this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]][_0x1110('0x145')])?!![]:this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]][_0x1110('0x145')];}loggerBooked[_0x1110('0x83')](_0x1110('0x146'),_0x4ee45b['actionid'],_0x1110('0x147'),JSON[_0x1110('0x4e')](_[_0x1110('0x139')](this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]],[_0x1110('0x44'),'unlockRR'])),_0x1110('0x148'),JSON['stringify'](_0x5ee3d4[_0x1110('0x13a')]));if(!_[_0x1110('0xaf')](_0x5ee3d4)&&_0x5ee3d4['status']==='1'&&_0x5ee3d4['paused']==='0'&&this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]][_0x1110('0x145')]){this[_0x1110('0x23')][_0x5ee3d4[_0x1110('0x137')]][_0x1110('0x145')]=![];this['queueBooked'][_0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]=[];this[_0x1110('0x13f')][_0x1110('0x140')](_0x5ee3d4[_0x1110('0x13a')],_0x5ee3d4[_0x1110('0x137')])[_0x1110('0xb3')](function(_0xb42a21){logger[_0x1110('0x99')](_0x1110('0x141'),util['inspect'](_0xb42a21,{'showHidden':![],'depth':null}));})['finally'](function(){_0x46d7ff[_0x1110('0xb5')](_0x46d7ff['voiceQueues'][_0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]);setTimeout(function(){_0x46d7ff['agents'][_0x5ee3d4[_0x1110('0x137')]][_0x1110('0x145')]=!![];loggerBooked['info'](_0x1110('0x149'),_0x4ee45b[_0x1110('0x135')],'Agent:\x20',JSON[_0x1110('0x4e')](_['pick'](_0x46d7ff[_0x1110('0x23')][_0x5ee3d4['stateinterface']],[_0x1110('0x44'),'unlockRR'])),_0x1110('0x148'),JSON[_0x1110('0x4e')](_0x5ee3d4['idHopper']));},0xc7);delete _0x46d7ff[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61,_0x4ee45b[_0x1110('0x135')]);});}else{loggerBooked[_0x1110('0x83')]('[booked][unlock]');this[_0x1110('0xb5')](this[_0x1110('0x21')][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x1110('0x26')][_0x4ee45b['actionid']][_0x1110('0xdc')],'ListId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdd')],'VoiceQueueId':this[_0x1110('0x26')][_0x4ee45b['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x1110('0x26')][_0x4ee45b['actionid']][_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61);}}else{loggerBooked[_0x1110('0x83')](_0x1110('0x14a'));this[_0x1110('0xb5')](this['voiceQueues'][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]);this[_0x1110('0xc9')]({'active':![],'ContactId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdc')],'ListId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]]['ListId'],'VoiceQueueId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdf')]||undefined,'CampaignId':this[_0x1110('0x26')][_0x4ee45b['actionid']][_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x14b')));delete this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61);}}else{loggerBooked[_0x1110('0x83')](_0x1110('0x14c'));this[_0x1110('0xb5')](this[_0x1110('0x21')][this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xb6')]]);this[_0x1110('0xc9')]({'active':![],'ContactId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdc')],'ListId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdd')],'VoiceQueueId':this['actions'][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xdf')]||undefined,'CampaignId':this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]][_0x1110('0xe0')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x1110('0x26')][_0x4ee45b[_0x1110('0x135')]];unlockQueueStatus(_0x575a61);}};Dialer[_0x1110('0x1c')][_0x1110('0x3f')]=function(){var _0x36b97d=this;setInterval(function(){_0x36b97d[_0x1110('0x14d')]();},0x3e8);};Dialer[_0x1110('0x1c')]['checkIsTrunkReachable']=function(_0x23e88c){var _0x4b13dc=this;return function(){if(!_0x4b13dc[_0x1110('0xe4')](_0x23e88c[_0x1110('0x7a')])){if(!_0x4b13dc[_0x1110('0xe4')](_0x23e88c[_0x1110('0x14e')])){_0x23e88c[_0x1110('0x42')]=_0x1110('0x14f');throw _0x23e88c[_0x1110('0x44')]+_0x1110('0x150');}}};};Dialer[_0x1110('0x1c')][_0x1110('0x151')]=function(_0x22c0d0,_0x3653db,_0x36431,_0x366aca){var _0x25da78=this;return function(){var _0x5d271f=!![];return _0x25da78[_0x1110('0x152')](_0x22c0d0,_0x3653db,_0x36431,_0x366aca,_0x5d271f);};};Dialer[_0x1110('0x1c')][_0x1110('0x153')]=function(_0x3a93af,_0x2c70b1,_0x405a1a,_0x557835){var _0x55f282=this;return function(){var _0x4bd8a3=![];return _0x55f282[_0x1110('0x152')](_0x3a93af[_0x1110('0x4b')],_0x2c70b1,_0x405a1a,_0x557835,_0x4bd8a3);};};Dialer[_0x1110('0x1c')][_0x1110('0x152')]=function(_0x5a2ff0,_0x38c281,_0xc0f28e,_0x4cda12,_0x340215){var _0x37ce16=[];return new BPromise(function(_0x109df3,_0x5b377b){if(!isNotNull(_0x5a2ff0)){_0x4cda12[_0x1110('0x42')]=_0x1110('0x49');return _0x5b377b(msgResponse(_0x1110('0x152'),_0x1110('0x154'),_0xc0f28e+_0x1110('0x155')));}if(_[_0x1110('0x4c')](_0x5a2ff0)){_0x4cda12[_0x1110('0x42')]=_0x1110('0x156');return _0x5b377b(msgResponse('ifTime',_0x1110('0x154'),_0xc0f28e+_0x1110('0x157')));}if(_0x38c281&&_[_0x1110('0x41')](config[_0x1110('0x158')][_0x38c281])){_0x4cda12['message']='TIMEZONE_UNKNOW';return _0x5b377b(msgResponse('ifTime','Failure',_0xc0f28e+'\x20Timezone\x20unknow\x20'+_0x38c281));}if(_[_0x1110('0x159')](_0x5a2ff0)){for(var _0x1072b6=0x0;_0x1072b6<_0x5a2ff0['length'];_0x1072b6+=0x1){_0x37ce16[_0x1110('0x138')](ami[_0x1110('0xb0')]({'action':'command','command':util[_0x1110('0x7d')](_0x1110('0x15a'),_0x5a2ff0[_0x1072b6][_0x1110('0x15b')],!_[_0x1110('0x41')](config['timezones'][_0x38c281])?_0x38c281:'')})[_0x1110('0xbc')](function(_0x213477){return _0x213477[_0x1110('0x15c')][_0x1110('0x15d')]('true')>=0x0;})[_0x1110('0xb3')](myreject(_0x5b377b)));}}else{_0x37ce16['push'](ami['Action']({'action':_0x1110('0x15e'),'command':util['format'](_0x1110('0x15a'),_0x5a2ff0,!_[_0x1110('0x41')](config[_0x1110('0x158')][_0x38c281])?_0x38c281:'')})[_0x1110('0xbc')](function(_0x17f033){return _0x17f033['content']['indexOf'](_0x1110('0x15f'))>=0x0;})['catch'](myreject(_0x5b377b)));}BPromise[_0x1110('0x160')](_0x37ce16)['then'](function(_0x19966a){var _0x6c8ec3=_[_0x1110('0x161')](_0x19966a);if(_0x6c8ec3){return _0x109df3(_0x6c8ec3);}else{_0x4cda12['message']=_0x340215?_0x1110('0x162'):'INTERVAL_IS_OVERTIME';return _0x5b377b(msgResponse(_0x1110('0x163'),_0x1110('0x154'),'Global:\x20'+_0x340215+'\x20'+_0xc0f28e+_0x1110('0x164')+util[_0x1110('0x9a')](_0x5a2ff0,{'showHidden':![],'depth':null})+_0x1110('0x165')+_0x38c281));}})[_0x1110('0xb3')](function(_0x6f8d6f){return _0x5b377b(msgResponse('ifTime',_0x1110('0x154'),JSON[_0x1110('0x4e')](_0x6f8d6f)));});});};Dialer['prototype'][_0x1110('0x166')]=function(_0x2751d2){var _0x517cf4=this;return function(){switch(_0x2751d2[_0x1110('0x5f')]){case _0x1110('0x167'):freeVariablesPredictive(_0x2751d2);_0x517cf4[_0x1110('0x168')](_0x2751d2,0x1);break;case'power':freeVariablesPredictive(_0x2751d2);_0x517cf4[_0x1110('0x168')](_0x2751d2,_0x2751d2[_0x1110('0x169')]);break;case'predictive':_0x517cf4[_0x1110('0x9')](_0x2751d2);break;case'booked':freeVariablesPredictive(_0x2751d2);_0x517cf4[_0x1110('0x168')](_0x2751d2,0x1);break;default:freeVariablesPredictive(_0x2751d2);logger[_0x1110('0x99')](_0x1110('0x16a'),_0x2751d2['name'],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x1110('0x16b')]=function(_0x4ab2cf){var _0x353657=this;return function(){_0x353657[_0x1110('0x16c')](_0x4ab2cf);};};Dialer[_0x1110('0x1c')][_0x1110('0x16d')]=function(_0x5868b3){var _0x2bc795=this;if(isNotPreview(_0x5868b3[_0x1110('0x5f')])){if(isVoiceQueueOutbound(_0x5868b3[_0x1110('0x52')])&&isActive(_0x5868b3[_0x1110('0x5e')])){_0x5868b3[_0x1110('0xa1')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x5868b3,_0x5868b3[_0x1110('0x16e')]))['then'](checkIsActive(_0x5868b3,_0x5868b3[_0x1110('0x5e')]))[_0x1110('0xbc')](checkInterval(_0x5868b3))[_0x1110('0xbc')](_0x2bc795[_0x1110('0x16f')](_0x5868b3))[_0x1110('0xbc')](_0x2bc795[_0x1110('0x151')](_0x5868b3[_0x1110('0x170')],_0x5868b3[_0x1110('0x171')],_0x5868b3[_0x1110('0x44')],_0x5868b3))[_0x1110('0xbc')](_0x2bc795[_0x1110('0x153')](_0x5868b3[_0x1110('0x48')],_0x5868b3[_0x1110('0x171')],_0x5868b3['name'],_0x5868b3))[_0x1110('0xbc')](_0x2bc795[_0x1110('0x166')](_0x5868b3))[_0x1110('0xb3')](loggerCatchQueueSummary(_0x1110('0x172'),_0x5868b3));}else{notSendMessagesQueue(_0x5868b3);}}else{freeVariablesPredictive(_0x5868b3);}};Dialer[_0x1110('0x1c')][_0x1110('0x14d')]=function(){var _0x2bf082=this;var _0x422edc;for(var _0x3ec5fe in this['campaigns']){if(typeof this[_0x1110('0x22')][_0x3ec5fe]!=='undefined'){_0x422edc=this[_0x1110('0x22')][_0x3ec5fe];if(isCampaignIvr(_0x422edc[_0x1110('0x52')])&&isActive(_0x422edc[_0x1110('0x7b')])){_0x422edc['sendMessageOneNotActive']=!![];BPromise[_0x1110('0xcb')]()['then'](checkIsActive(_0x422edc,_0x422edc['active']))['then'](checkInterval(_0x422edc))[_0x1110('0xbc')](_0x2bf082[_0x1110('0x16f')](_0x422edc))[_0x1110('0xbc')](_0x2bf082[_0x1110('0x151')](_0x422edc['dialGlobalInterval'],_0x422edc[_0x1110('0x171')],_0x422edc[_0x1110('0x44')],_0x422edc))['then'](_0x2bf082[_0x1110('0x153')](_0x422edc[_0x1110('0x48')],_0x422edc[_0x1110('0x171')],_0x422edc['name'],_0x422edc))['then'](_0x2bf082[_0x1110('0x16b')](_0x422edc))[_0x1110('0xb3')](loggerCatchQueueSummary(_0x1110('0x173'),_0x422edc));}else{notSendMessagesCampaign(_0x422edc);}}}};function getCallerIdRandom(_0xf48d42,_0x193865){var _0x5bbff3;var _0x5f0192;var _0x2cd705;if(_0x193865<=0x0){_0x193865=0x1;}_0x5bbff3=new RegExp(_0x1110('0x174')+_0x193865+'}$');_0x5f0192=Math[_0x1110('0x175')](0xa,_0x193865-0x1);_0x2cd705=Math['pow'](0xa,_0x193865)-0x1;return util[_0x1110('0x7d')]('%s',_[_0x1110('0x176')](_0xf48d42,_0x5bbff3,_[_0x1110('0x177')](_0x5f0192,_0x2cd705)));}function extractCalleridName(_0x365c6e){var _0x538b78=_0x365c6e[_0x1110('0x178')](/"(.*?)"/);return _0x538b78?_0x538b78[0x1]:_0x365c6e;}function extractCalleridNumber(_0x2d820b){var _0x5c52ac=_0x2d820b[_0x1110('0x178')](/<(.*?)>/);return _0x5c52ac?_0x5c52ac[0x1]:_0x2d820b;}Dialer['prototype']['actionOriginate']=function(_0x1a4857,_0x5b7c3c){var _0xb24b5f=this;var _0x4588e5=uuid['v4']();this[_0x1110('0x26')][_0x4588e5]=new Action(_0x1a4857,_0x5b7c3c,_0x4588e5);return new BPromise(function(_0x1d52f0,_0x3396e0){if(_[_0x1110('0x41')](_0x1a4857)&&typeof _0x1a4857!==_0x1110('0x179')){return _0x3396e0(msgResponse(_0x1110('0x17a'),_0x1110('0x154'),_0x1110('0x17b')));}if(_['isUndefined'](_0x5b7c3c[_0x1110('0x17c')])||_0x5b7c3c[_0x1110('0x17c')]===null){return _0x3396e0(msgResponse(_0x1110('0x17a'),'Failure',_0x1110('0x17d')));}var _0x3d1de4={'XMD-CALLERID':_0xb24b5f[_0x1110('0x26')][_0x4588e5][_0x1110('0x17e')](),'XMD-AGI':_0x1a4857[_0x1110('0x111')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1a4857[_0x1110('0x111')]):_0x1110('0x17f'),'XMD-AGIAFTER':_0x1a4857[_0x1110('0x118')]?util[_0x1110('0x7d')](_0x1110('0x180'),ipAgi,_0x1a4857['dialQueueProject2']):_0x1110('0x17f'),'XMD-QUEUE':_0x1a4857[_0x1110('0x52')]==='outbound'?util[_0x1110('0x7d')](_0x1110('0x181'),_0x1a4857[_0x1110('0x44')],_0x1a4857['dialQueueOptions']||'',_0x1a4857[_0x1110('0x182')]?'c':'',_0x1a4857['dialQueueTimeout']||0x3):_0x1110('0x17f'),'XMD-CONTACTID':_0x5b7c3c[_0x1110('0xdc')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xb24b5f['actions'][_0x4588e5]['getCaller'](),'XMD-AMD':_0x1a4857[_0x1110('0xea')]?_0x1110('0x183'):_0x1110('0x17f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1a4857[_0x1110('0xea')]){_0x3d1de4[_0x1110('0x184')]=_0x1a4857[_0x1110('0x185')]||0x9c4;_0x3d1de4[_0x1110('0x186')]=_0x1a4857[_0x1110('0x187')]||0x5dc;_0x3d1de4[_0x1110('0x188')]=_0x1a4857[_0x1110('0x189')]||0x320;_0x3d1de4[_0x1110('0x18a')]=_0x1a4857[_0x1110('0x18b')]||0x1388;_0x3d1de4[_0x1110('0x18c')]=_0x1a4857[_0x1110('0x18d')]||0x64;_0x3d1de4[_0x1110('0x18e')]=_0x1a4857[_0x1110('0x18f')]||0x32;_0x3d1de4[_0x1110('0x190')]=_0x1a4857[_0x1110('0x191')]||0x3;_0x3d1de4[_0x1110('0x192')]=_0x1a4857[_0x1110('0x193')]||0x100;_0x3d1de4[_0x1110('0x194')]=_0x1a4857['dialAMDMaximumWordLength']||0x1388;}if(_0x1a4857['type']===_0x1110('0x53')){_0x3d1de4[_0x1110('0x195')]=_0x5b7c3c[_0x1110('0xdf')];}else{_0x3d1de4[_0x1110('0x196')]=_0x5b7c3c[_0x1110('0xe0')];}for(var _0x4c8e10 in _0x5b7c3c[_0x1110('0x197')]){if(typeof _0x5b7c3c[_0x1110('0x197')][_0x4c8e10]!==_0x1110('0xd5')){if(isNotNull(_0x5b7c3c['Contact'][_0x4c8e10])&&_0x4c8e10!=='id'&&_0x4c8e10!=='tags'&&_0x4c8e10!==_0x1110('0x198')&&_0x4c8e10!=='updatedAt'){_0x3d1de4[util[_0x1110('0x7d')](_0x1110('0x199'),_0x1110('0x19a'),_[_0x1110('0x19b')](_0x4c8e10))]=_0x5b7c3c[_0x1110('0x197')][_0x4c8e10];}}}var _0x5cfd68=_0xb24b5f[_0x1110('0xe4')](_0x1a4857[_0x1110('0x7a')])?getCallerId(_0x1a4857[_0x1110('0x7a')][_0x1110('0x7c')],_0x1a4857[_0x1110('0x19c')],_0x1a4857[_0x1110('0x19d')]>0x0?getCallerIdRandom(_0x1a4857[_0x1110('0x60')],_0x1a4857['dialRandomLastDigitCallerIdNumber']):_0x1a4857['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x1a4857['TrunkBackup'])?_0x1a4857[_0x1110('0x7a')][_0x1110('0x7c')]:_0x1a4857[_0x1110('0x14e')][_0x1110('0x7c')],_0x1a4857['dialOriginateCallerIdName'],_0x1a4857['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1a4857[_0x1110('0x60')],_0x1a4857[_0x1110('0x19d')]):_0x1a4857[_0x1110('0x60')]);if(_0x5cfd68){_0x3d1de4[_0x1110('0x19e')]=_0xb24b5f[_0x1110('0x26')][_0x4588e5][_0x1110('0x19f')]=extractCalleridName(_0x5cfd68);_0x3d1de4[_0x1110('0x1a0')]=_0x5b7c3c[_0x1110('0x17c')];}return ami[_0x1110('0xb0')]({'actionid':_0x4588e5,'action':_0x1110('0x17a'),'channel':_0xb24b5f[_0x1110('0xe4')](_0x1a4857[_0x1110('0x7a')])?util['format'](_0x1110('0x1a1'),_0x1a4857['Trunk'][_0x1110('0x44')],isNotNull(_0x1a4857['dialPrefix'])?_0x1a4857['dialPrefix'][_0x1110('0x1a2')]()||'':'',_0x1a4857[_0x1110('0x1a3')]>0x0?_0x5b7c3c['phone'][_0x1110('0x1a4')](_0x1a4857[_0x1110('0x1a3')]):_0x5b7c3c[_0x1110('0x17c')]):util[_0x1110('0x7d')]('SIP/%s/%s%s',_[_0x1110('0xaf')](_0x1a4857[_0x1110('0x14e')])?_0x1a4857[_0x1110('0x7a')][_0x1110('0x44')]:_0x1a4857['TrunkBackup'][_0x1110('0x44')],isNotNull(_0x1a4857[_0x1110('0x61')])?_0x1a4857[_0x1110('0x61')][_0x1110('0x1a2')]()||'':'',_0x1a4857[_0x1110('0x1a3')]>0x0?_0x5b7c3c[_0x1110('0x17c')]['substring'](_0x1a4857['dialCutDigit']):_0x5b7c3c[_0x1110('0x17c')]),'callerid':_0x5cfd68,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x3d1de4,'timeout':(_0x1a4857[_0x1110('0x1a5')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4588e5})[_0x1110('0xbc')](function(_0x5467cf){return _0x1d52f0(_0x5467cf);})[_0x1110('0xb3')](function(_0x54cae8){_0x1a4857[_0x1110('0x69')]+=0x1;var _0x268ebc=new History(_0xb24b5f[_0x1110('0x26')][_0x4588e5]);logger[_0x1110('0x99')](util['format'](_0x1110('0x1a6'),JSON[_0x1110('0x4e')](_0x54cae8)));_0x268ebc[_0x1110('0xa9')]=0xe;_0x268ebc[_0x1110('0xaa')]=_0x1110('0x1a7');_0x268ebc[_0x1110('0xac')]=moment()[_0x1110('0x7d')](_0x1110('0x106'));_0x268ebc[_0x1110('0xab')]=_0x268ebc[_0x1110('0xac')];_0xb24b5f['createHistory'](_0x268ebc)[_0x1110('0xb3')](loggerCatch('[originate][error]'));_0xb24b5f['moveContactManagedDialer'](_0x268ebc)['catch'](loggerCatch(_0x1110('0x1a8')))['finally'](function(){delete _0xb24b5f[_0x1110('0x26')][_0x4588e5];return _0x3396e0(msgResponse(_0x1110('0x17a'),_0x1110('0x4d'),_0x1110('0x1a9')));});});});};Dialer['prototype'][_0x1110('0x34')]=function(_0x31b75d){var _0x2d58ae=this[_0x1110('0x26')][_0x31b75d[_0x1110('0x135')]];if(_0x2d58ae){delete this['actions'][_0x31b75d['actionid']];_0x2d58ae[_0x1110('0x11f')]=moment()[_0x1110('0x7d')](_0x1110('0x106'));var _0x883252=_0x2d58ae[_0x1110('0x52')]==='ivr'?this[_0x1110('0x22')][_0x2d58ae[_0x1110('0xb6')]]:this[_0x1110('0x21')][_0x2d58ae[_0x1110('0x1aa')]()];if(!this[_0x1110('0xe3')](_0x31b75d['response'])){this[_0x1110('0xb5')](_0x883252);return this[_0x1110('0x1ab')](_0x2d58ae,_0x883252,_0x31b75d)[_0x1110('0xb3')](loggerCatch(_0x1110('0x1ac')));}this['uniqueId'][_0x31b75d[_0x1110('0xf4')]]=_0x2d58ae;}};Dialer[_0x1110('0x1c')][_0x1110('0x1ad')]=function(_0x4666e8,_0xf0f025,_0x121c98){var _0x381d69=new History(_0xf0f025);if(_0x381d69[_0x1110('0xf9')]+_0x381d69[_0x1110('0xfa')]+_0x381d69[_0x1110('0xfb')]+_0x381d69[_0x1110('0x10c')]+_0x381d69[_0x1110('0xfc')]+_0x381d69[_0x1110('0xfd')]+_0x381d69[_0x1110('0xf6')]+_0x381d69[_0x1110('0x10d')]>=_0x121c98[_0x1110('0xfe')]-0x1){return!![];}switch(_0x4666e8){case 0x3:if(_0x381d69[_0x1110('0xfb')]>=_0x121c98[_0x1110('0x1ae')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countnoanswerretry':_0x381d69[_0x1110('0xfb')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x1af')],'minutes')[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x381d69['ContactId'],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69[_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x1b0')));break;case 0x5:if(_0x381d69[_0x1110('0xf9')]>=_0x121c98[_0x1110('0x1b1')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countbusyretry':_0x381d69['countbusyretry']+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x1b2')],'minutes')[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x381d69[_0x1110('0xfa')]>=_0x121c98[_0x1110('0x1b3')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countcongestionretry':_0x381d69[_0x1110('0xfa')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x1b4')],_0x1110('0x105'))[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69['VoiceQueueId']||undefined,'CampaignId':_0x381d69[_0x1110('0xe0')]||undefined})['catch'](loggerCatch(_0x1110('0x1b5')));break;case 0x0:if(_0x381d69['countnosuchnumberretry']>=_0x121c98['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x381d69[_0x1110('0x10c')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x1b6')],_0x1110('0x105'))[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69[_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x1b7')));}break;case 0xa:if(_0x381d69[_0x1110('0xfc')]>=_0x121c98[_0x1110('0x128')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countdropretry':_0x381d69['countdropretry']+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x124')],_0x1110('0x105'))['format'](_0x1110('0x106')),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x129')));break;case 0xb:if(_0x381d69[_0x1110('0xfd')]>=_0x121c98[_0x1110('0x131')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countabandonedretry':_0x381d69[_0x1110('0xfd')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98['dialAbandonedRetryFrequency'],'minutes')[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x1b8')));break;case 0x13:if(_0x381d69[_0x1110('0xf6')]>=_0x121c98[_0x1110('0x10e')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countmachineretry':_0x381d69[_0x1110('0xf6')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98[_0x1110('0x104')],_0x1110('0x105'))['format'](_0x1110('0x106')),'ContactId':_0x381d69['ContactId'],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69[_0x1110('0xdf')]||undefined,'CampaignId':_0x381d69[_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x107')));break;case 0x14:if(_0x381d69['countagentrejectretry']>=_0x121c98[_0x1110('0x1b9')]-0x1){return!![];}this[_0x1110('0xc9')]({'active':![],'countagentrejectretry':_0x381d69[_0x1110('0x10d')]+=0x1,'scheduledat':moment()[_0x1110('0x103')](_0x121c98['dialAgentRejectRetryFrequency'],_0x1110('0x105'))[_0x1110('0x7d')](_0x1110('0x106')),'ContactId':_0x381d69[_0x1110('0xdc')],'ListId':_0x381d69[_0x1110('0xdd')],'VoiceQueueId':_0x381d69['VoiceQueueId']||undefined,'CampaignId':_0x381d69[_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x1ba')));break;default:return!![];}};Dialer[_0x1110('0x1c')]['callProgressDetecting']=function(_0x370fe3,_0x1370b5,_0x722768){var _0x198340=this;var _0x3eb562=new History(_0x370fe3);var _0x17ff1f=![];var _0x361a0b;var _0xdd2ab9;return new BPromise(function(_0x100041,_0x31c5b7){if(_[_0x1110('0x41')](_0x1370b5)&&typeof _0x1370b5!==_0x1110('0x179')){return _0x31c5b7(msgResponse(_0x1110('0x1bb'),_0x1110('0x154'),'entity\x20is\x20undefine'));}if(_[_0x1110('0x41')](_0x722768)&&typeof _0x722768!==_0x1110('0x179')){return _0x31c5b7(msgResponse(_0x1110('0x1bb'),_0x1110('0x154'),_0x1110('0x1bc')));}_0x198340['verifyAdditionalPhones'](_0x3eb562,_0x722768[_0x1110('0x115')],_0x1370b5)[_0x1110('0xbc')](function(_0x2a2877){if(_0x2a2877[_0x1110('0x127')]==0x1)_0x17ff1f=!![];switch(_0x722768[_0x1110('0x115')]){case'0':_0x1370b5['outboundNoSuchCallsDay']+=0x1;_0x3eb562[_0x1110('0xa9')]=0x0;_0x3eb562[_0x1110('0xaa')]=_0x1110('0x1bd');_0x3eb562[_0x1110('0x10c')]+=0x1;_0x3eb562[_0x1110('0x10b')]+=0x1;ami[_0x1110('0xef')](_0x1110('0x1be'),ut[_0x1110('0xf1')](_0x370fe3,_0x1110('0x1bf')));_0x361a0b=_0x1370b5[_0x1110('0x1b6')];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];_0x198340[_0x1110('0xd3')](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0xf8')));if(_0x198340['checkRetriveMax'](0x0,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0x10c')]>=_0x1370b5['dialNoSuchNumberMaxRetry']){_0x198340[_0x1110('0x101')](_0x3eb562,_0x100041,_0x31c5b7,'reason\x200\x20no\x20such\x20number....');}else{_0x198340[_0x1110('0xff')](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1c0'));}}break;case'3':_0x1370b5['outboundNoAnswerCallsDay']+=0x1;_0x3eb562['state']=0x3;_0x3eb562['statedesc']=_0x1110('0x1c1');_0x3eb562[_0x1110('0xfb')]+=0x1;_0x3eb562['countglobal']+=0x1;ami[_0x1110('0xef')](_0x1110('0x1c2'),ut[_0x1110('0xf1')](_0x370fe3,_0x1110('0x1c3')));_0x361a0b=_0x1370b5[_0x1110('0x1af')];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];_0x198340[_0x1110('0xd3')](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0x1c4')));if(_0x198340[_0x1110('0x1ad')](0x3,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0xfb')]>=_0x1370b5[_0x1110('0x1ae')]){_0x198340[_0x1110('0x101')](_0x3eb562,_0x100041,_0x31c5b7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x198340['stateGlobal'](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1c5'));}}break;case'5':_0x1370b5['outboundBusyCallsDay']+=0x1;_0x3eb562[_0x1110('0xa9')]=0x5;_0x3eb562['statedesc']=_0x1110('0x1c6');_0x3eb562[_0x1110('0xf9')]+=0x1;_0x3eb562[_0x1110('0x10b')]+=0x1;ami[_0x1110('0xef')](_0x1110('0x1c7'),ut['buildObj'](_0x370fe3,_0x1110('0x1c8')));console[_0x1110('0xc0')](_0x1110('0x1c9'));_0x361a0b=_0x1370b5[_0x1110('0x1b2')];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];_0x198340['createHistory'](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0x1ca')));if(_0x198340[_0x1110('0x1ad')](0x5,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0xf9')]>=_0x1370b5[_0x1110('0x1b1')]){_0x198340[_0x1110('0x101')](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1cb'));}else{_0x198340['stateGlobal'](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1cb'));}}break;case'8':_0x1370b5[_0x1110('0x65')]+=0x1;_0x3eb562[_0x1110('0xa9')]=0x8;_0x3eb562[_0x1110('0xaa')]=_0x1110('0x1cc');_0x3eb562['countcongestionretry']+=0x1;_0x3eb562[_0x1110('0x10b')]+=0x1;_0x361a0b=_0x1370b5[_0x1110('0x1b4')];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];ami[_0x1110('0xef')](_0x1110('0x1cd'),ut[_0x1110('0xf1')](_0x370fe3,_0x1110('0x1ce')));_0x198340['createHistory'](_0x3eb562)['catch'](loggerCatch(_0x1110('0x1cf')));console[_0x1110('0xc0')]('----checkRetrieveMax----');if(_0x198340[_0x1110('0x1ad')](0x8,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0xfa')]>=_0x1370b5[_0x1110('0x1b3')]){_0x198340['createStateFinal'](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1d0'));}else{_0x198340['stateGlobal'](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1d0'));}}break;case'11':_0x1370b5[_0x1110('0x1d1')]+=0x1;_0x3eb562[_0x1110('0xa9')]=0xb;_0x3eb562[_0x1110('0xaa')]=_0x1110('0x12e');_0x3eb562[_0x1110('0xfd')]+=0x1;_0x3eb562[_0x1110('0x10b')]+=0x1;_0x361a0b=_0x1370b5['dialAbandonedRetryFrequency'];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];_0x198340[_0x1110('0xd3')](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0x134')));if(_0x198340[_0x1110('0x1ad')](0xb,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0xfd')]>=_0x1370b5[_0x1110('0x131')]){_0x198340[_0x1110('0x101')](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1d2'));}else{_0x198340[_0x1110('0xff')](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1d2'));}}break;case'20':_0x1370b5[_0x1110('0x6b')]+=0x1;_0x3eb562[_0x1110('0xa9')]=0x14;_0x3eb562[_0x1110('0xaa')]='AgentReject';_0x3eb562[_0x1110('0x10d')]+=0x1;_0x3eb562[_0x1110('0x10b')]+=0x1;_0x361a0b=_0x1370b5[_0x1110('0x1d3')];_0xdd2ab9=_0x1370b5['callAdditionalPhoneAfterMin'];ami[_0x1110('0xef')](_0x1110('0x1d4'),ut['buildObj'](_0x370fe3,_0x1110('0x1d5')));_0x198340[_0x1110('0xd3')](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0x1d6')));if(_0x198340[_0x1110('0x1ad')](0x14,_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0x10d')]>=_0x1370b5['dialAgentRejectMaxRetry']){_0x198340[_0x1110('0x101')](_0x3eb562,_0x100041,_0x31c5b7,_0x1110('0x1d7'));}else{_0x198340[_0x1110('0xff')](_0x3eb562,_0x100041,_0x31c5b7,'reason\x2020\x20agentreject');}}break;default:_0x1370b5[_0x1110('0x6c')]+=0x1;_0x3eb562[_0x1110('0xa9')]=0xc;_0x3eb562[_0x1110('0xaa')]=_0x722768[_0x1110('0x115')];_0x361a0b=_0x1370b5['dialAgentRejectRetryFrequency'];_0xdd2ab9=_0x1370b5[_0x1110('0x125')];_0x198340[_0x1110('0xd3')](_0x3eb562)[_0x1110('0xb3')](loggerCatch(_0x1110('0x1d8')));if(_0x198340['checkRetriveMax'](_0x722768[_0x1110('0x115')],_0x370fe3,_0x1370b5)&&!_0x17ff1f){if(_0x3eb562[_0x1110('0xf9')]+_0x3eb562[_0x1110('0xfa')]+_0x3eb562[_0x1110('0xfb')]+_0x3eb562[_0x1110('0x10c')]+_0x3eb562[_0x1110('0xfc')]+_0x3eb562[_0x1110('0xfd')]+_0x3eb562[_0x1110('0xf6')]+_0x3eb562[_0x1110('0x10d')]>=_0x1370b5[_0x1110('0xfe')]){_0x198340[_0x1110('0xff')](_0x3eb562,_0x100041,_0x31c5b7,_0x722768[_0x1110('0x115')]);}else{_0x198340['createStateFinal'](_0x3eb562,_0x100041,_0x31c5b7,_0x722768[_0x1110('0x115')]);}}}})[_0x1110('0xbc')](function(_0x2f9e86){if(_0x17ff1f){console[_0x1110('0xc0')](_0x1110('0x1d9'),_0x3eb562);_0x198340[_0x1110('0x12d')](_0x3eb562,_0x361a0b,_0xdd2ab9)[_0x1110('0xbc')](function(_0x4657e7){return _0x100041(0x1);});}});});};Dialer[_0x1110('0x1c')]['stateGlobal']=function(_0x3fbb61,_0x5449dc,_0x47b16f,_0x3aa75f){var _0x4cf63b=new Final(_0x3fbb61);_0x4cf63b[_0x1110('0xa9')]=0xf;_0x4cf63b['statedesc']='Global';this[_0x1110('0x101')](_0x4cf63b,_0x5449dc,_0x47b16f,_0x3aa75f);};Dialer['prototype']['createStateFinal']=function(_0x2e2f06,_0x427502,_0x4211a4,_0x1e6f79){this['moveContactManagedDialer'](_0x2e2f06)[_0x1110('0xbc')](function(){return _0x427502(msgResponse(_0x1110('0x1bb'),_0x1110('0x1da'),_0x1e6f79));})[_0x1110('0xb3')](function(){return _0x4211a4(msgResponse('[moveContactManagedDialer][0]',_0x1110('0x154'),_0x1110('0x1db')));});};Dialer[_0x1110('0x1c')][_0x1110('0x9')]=function(_0x5c921c){var _0x317673=_0x5c921c[_0x1110('0x1dc')]/0x64;var _0x38dcfd=_0x5c921c[_0x1110('0x121')]/(_0x5c921c[_0x1110('0x121')]+_0x5c921c['outboundAnswerCallsDay']);var _0x5b0d24=Math[_0x1110('0x1dd')](_0x5c921c[_0x1110('0x74')]*(_0x5c921c[_0x1110('0x1de')]/0x64));var _0x529fff=Math[_0x1110('0x1dd')](_0x5c921c[_0x1110('0x74')]*(_0x5c921c['predictiveIntervalMinThreshold']/0x64));var _0x4220f3=_0x5c921c['available']+_0x5c921c['talking'];var _0x283cc5=Math['floor'](_0x5c921c['erlangCalls']*_0x5c921c[_0x1110('0x91')]*_0x5c921c[_0x1110('0x71')]*_0x5c921c[_0x1110('0x72')]);if(_['isUndefined'](_0x5c921c[_0x1110('0x2b')])){if(!_['isUndefined'](_0x5c921c[_0x1110('0x2a')])){_0x5c921c[_0x1110('0x2a')]=undefined;loggerPredictive[_0x1110('0x99')](_0x1110('0x1df'),_0x1110('0x1e0'));}if(!_['isUndefined'](_0x5c921c[_0x1110('0x95')])){loggerPredictive[_0x1110('0x99')](_0x1110('0x1df'),_0x1110('0x1e1'));clearInterval(_0x5c921c[_0x1110('0x95')]);_0x5c921c[_0x1110('0x95')]=undefined;}_0x5c921c[_0x1110('0x2b')]=moment()[_0x1110('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x1110('0x83')](_0x5c921c[_0x1110('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x5c921c['startProgressive']);this['handlePower'](_0x5c921c,0x1);}else if(ifInterval(_0x5c921c['dialPredictiveInterval'],_0x5c921c[_0x1110('0x2b')])){this[_0x1110('0x168')](_0x5c921c,0x1);loggerPredictiveCalls['info'](_0x1110('0x1e2'),_0x5c921c[_0x1110('0x2b')],_0x5c921c[_0x1110('0x44')]);_0x5c921c[_0x1110('0x77')]=0x0;_0x5c921c['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x317673<_0x38dcfd&&_0x5c921c[_0x1110('0x1e3')]==='dropRate'){freeVariablesPredictive(_0x5c921c);loggerPredictive[_0x1110('0x83')](_0x1110('0x1e4'),_0x1110('0x1e5'),_0x38dcfd,'startProgressive',_0x5c921c['name']);}else if(_0x283cc5<_0x5c921c['predictiveIntervalErlangCallsDroppedCalls']&&_0x5c921c[_0x1110('0x1e3')]===_0x1110('0x1e6')){freeVariablesPredictive(_0x5c921c);loggerPredictive[_0x1110('0x83')](_0x1110('0x1e7'),_0x1110('0x1e8'),_0x283cc5,_0x1110('0x1e9'),_0x5c921c[_0x1110('0x122')],_0x1110('0x2b'),_0x5c921c[_0x1110('0x44')]);}else if(!ifInterval(_0x5c921c[_0x1110('0x1ea')],_0x5c921c['startProgressive'])&&_[_0x1110('0x41')](_0x5c921c[_0x1110('0x2a')])&&!_[_0x1110('0x41')](_0x5c921c['startProgressive'])){_0x5c921c[_0x1110('0x2a')]=moment()[_0x1110('0x7d')](_0x1110('0x106'));loggerPredictive[_0x1110('0x83')](_0x5c921c[_0x1110('0x44')],_0x1110('0x1eb'),_0x5c921c[_0x1110('0x2a')]);this[_0x1110('0xc6')](_0x5c921c[_0x1110('0x1ea')])[_0x1110('0xbc')](this[_0x1110('0x1ec')](_0x5c921c))[_0x1110('0xbc')](mergeDataErlangB(_0x5c921c))[_0x1110('0xbc')](this[_0x1110('0x1ed')](_0x5c921c))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5c921c));}else if(!ifInterval(_0x5c921c['dialPredictiveInterval'],_0x5c921c[_0x1110('0x2a')])){_0x5c921c[_0x1110('0x122')]=0x0;_0x5c921c[_0x1110('0x2a')]=moment()[_0x1110('0x7d')](_0x1110('0x106'));loggerPredictive[_0x1110('0x83')](_0x5c921c[_0x1110('0x44')],_0x1110('0x1ee'),_0x5c921c[_0x1110('0x2a')]);clearInterval(_0x5c921c[_0x1110('0x95')]);_0x5c921c[_0x1110('0x95')]=undefined;this[_0x1110('0xc6')](_0x5c921c[_0x1110('0x1ea')])[_0x1110('0xbc')](this[_0x1110('0x1ec')](_0x5c921c))[_0x1110('0xbc')](mergeDataErlangB(_0x5c921c))['then'](this[_0x1110('0x1ed')](_0x5c921c))[_0x1110('0xb3')](loggerCatchPredictive(_0x1110('0x1ef'),_0x5c921c));}else if(_0x5c921c[_0x1110('0x74')]&&_0x4220f3<_0x5c921c[_0x1110('0x74')]-_0x529fff){freeVariablesPredictive(_0x5c921c);loggerPredictive[_0x1110('0x83')](_0x5c921c['name'],_0x1110('0x1f0'),_0x4220f3,_0x1110('0x1f1'),_0x5c921c[_0x1110('0x74')],'-',_0x529fff,'=',_0x5c921c[_0x1110('0x74')]-_0x529fff,')');}else if(_0x5c921c[_0x1110('0x74')]&&_0x4220f3>_0x5c921c['predictiveIntervalAvailable']+_0x5b0d24){freeVariablesPredictive(_0x5c921c);loggerPredictive[_0x1110('0x83')](_0x5c921c[_0x1110('0x44')],_0x1110('0x1f0'),_0x4220f3,')\x20are\x20more\x20than\x20threshold\x20(',_0x5c921c['predictiveIntervalAvailable'],'+',_0x5b0d24,'=',_0x5c921c['predictiveIntervalAvailable']+_0x5b0d24,')');}};Dialer['prototype']['getDataPredictive']=function(_0x287e08){var _0x46701f=this;return function(_0x23f028){return new BPromise(function(_0x58d3b2,_0x48e0b6){_[_0x1110('0x92')](_0x287e08,_0x23f028[0x0]);if(checkGetDataPredictive(_0x23f028[0x0])){var _0x21fef0=_0x287e08[_0x1110('0x74')]=_0x287e08[_0x1110('0x59')]+_0x287e08[_0x1110('0xa3')];var _0x5969de=_0x287e08[_0x1110('0x1ea')]*0x3c;var _0x208148=_0x23f028[0x0][_0x1110('0x6e')]+_0x23f028[0x0][_0x1110('0x6d')];var _0x5a5c6c=(_0x23f028[0x0][_0x1110('0x1f2')]+_0x23f028[0x0][_0x1110('0x6f')]+_0x23f028[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x23f028[0x0][_0x1110('0x75')];_0x287e08['predictiveIntervalHitRate']=_0x5a5c6c>0x0?_0x5a5c6c:0x1;switch(_0x287e08[_0x1110('0x1e3')]){case _0x1110('0x1e6'):var _0x547c59=_0x287e08[_0x1110('0x1dc')]/0x64;return _0x46701f['abandonmentRate'](_0x21fef0,_0x5969de,_0x208148,_0x5a5c6c,_0x547c59)['then'](function(_0x322abc){return _0x58d3b2(_0x322abc);});case _0x1110('0x1f3'):var _0x5b5b02=_0x287e08[_0x1110('0x1dc')]/0x64;return _0x46701f[_0x1110('0x1f4')](_0x21fef0,_0x5969de,_0x208148,_0x5a5c6c,_0x5b5b02)['then'](function(_0x20171f){return _0x58d3b2(_0x20171f);});default:return _0x48e0b6(msgResponse(_0x1110('0x1f5'),_0x1110('0x154'),'Unknown\x20Predictive'));}}else{return _0x48e0b6(msgResponse('[getDataPredictive]',_0x1110('0x154'),_0x1110('0x1f6')));}});};};Dialer[_0x1110('0x1c')][_0x1110('0x1f7')]=function(_0x348e34){var _0x1554ca=this;return function(_0x1445c8){return new BPromise(function(_0xad88fc,_0x40f4cf){_[_0x1110('0x92')](_0x348e34,_0x1445c8[0x0]);if(checkGetDataPredictive(_0x1445c8[0x0])){loggerPredictive[_0x1110('0x83')](JSON[_0x1110('0x4e')](_0x1445c8[0x0]));if(_0x348e34[_0x1110('0x1e3')]==='dropRate'){return _0x1554ca['getVoiceQueueRtPauses'](_0x348e34['id'])[_0x1110('0xbc')](function(_0x442629){var _0x39f47a=_0x348e34['loggedIn']-_0x442629[0x0][_0x1110('0x1f8')];var _0x26744a=_0x348e34[_0x1110('0x1ea')]*0x3c;var _0xbb5df5=_0x1445c8[0x0][_0x1110('0x6e')]+_0x1445c8[0x0][_0x1110('0x6d')];var _0x3fb4c3=(_0x1445c8[0x0]['predictiveIntervalAnsweredCalls']+_0x1445c8[0x0][_0x1110('0x6f')]+_0x1445c8[0x0][_0x1110('0x88')])/_0x1445c8[0x0][_0x1110('0x75')];var _0x49c343=_0x348e34[_0x1110('0x1dc')]/0x64;_0x348e34['predictiveIntervalPauses']=_0x442629[0x0][_0x1110('0x1f8')]||0x0;_0x348e34[_0x1110('0x71')]=_0x3fb4c3>0x0?_0x3fb4c3:0x1;return _0x1554ca[_0x1110('0x1f9')](_0x39f47a,_0x26744a,_0xbb5df5,_0x3fb4c3,_0x49c343);})['then'](function(_0x4a1b50){return _0xad88fc(_0x4a1b50);})[_0x1110('0xb3')](function(_0x334dc5){return _0x40f4cf(msgResponse(_0x1110('0x1fa'),'Failure',JSON[_0x1110('0x4e')](_0x334dc5)));});}if(_0x348e34[_0x1110('0x1e3')]===_0x1110('0x1f3')){return _0x1554ca['getVoiceQueueRtPauses'](_0x348e34['id'])[_0x1110('0xbc')](function(_0x56f46d){var _0x50e3c0=_0x348e34[_0x1110('0x16e')]-_0x56f46d[0x0]['outboundQueuePauses'];var _0xefd154=_0x348e34[_0x1110('0x1ea')]*0x3c;var _0xb3181c=_0x1445c8[0x0]['predictiveIntervalAvgTalktime']+_0x1445c8[0x0][_0x1110('0x6d')];var _0x3ae3b0=(_0x1445c8[0x0][_0x1110('0x1f2')]+_0x1445c8[0x0][_0x1110('0x6f')]+_0x1445c8[0x0][_0x1110('0x88')])/_0x1445c8[0x0][_0x1110('0x75')];var _0x469426=_0x348e34['dialPredictiveOptimizationPercentage']/0x64;_0x348e34[_0x1110('0x73')]=_0x56f46d[0x0][_0x1110('0x1f8')]||0x0;_0x348e34['predictiveIntervalHitRate']=_0x3ae3b0>0x0?_0x3ae3b0:0x1;return _0x1554ca[_0x1110('0x1f4')](_0x50e3c0,_0xefd154,_0xb3181c,_0x3ae3b0,_0x469426);})[_0x1110('0xbc')](function(_0x548bcd){return _0xad88fc(_0x548bcd);})['catch'](function(_0x2fe6d5){return _0x40f4cf(msgResponse('[CatchErlangB]',_0x1110('0x154'),JSON['stringify'](_0x2fe6d5)));});}}else{return _0x40f4cf(msgResponse(_0x1110('0x1f5'),_0x1110('0x154'),_0x1110('0x1f6')));}});};};Dialer[_0x1110('0x1c')][_0x1110('0x1ed')]=function(_0x57526c){var _0x297445=this;return function(){var _0x5a8fb7=0x0;var _0x321767=Math[_0x1110('0x1fb')](_0x57526c[_0x1110('0x78')]*0x3e8);if(_0x321767>0x0){_0x321767=_0x321767<0x64?0x64:_0x321767;loggerPredictive[_0x1110('0x83')](_0x57526c[_0x1110('0x44')],_0x1110('0x1fc'),_0x321767,'milliseconds');_0x57526c[_0x1110('0x95')]=setInterval(function(){_0x297445[_0x1110('0x95')](_0x57526c);loggerPredictiveCalls[_0x1110('0x83')](_0x1110('0x1fd'),_0x5a8fb7+=0x1);},_0x321767);}else{loggerPredictive[_0x1110('0x83')](_0x57526c[_0x1110('0x44')],_0x1110('0x1fe'));}};};Dialer[_0x1110('0x1c')][_0x1110('0x1ff')]=function(_0xb0ed7a,_0x556700){var _0x2820e8=this;return function(_0x35f1ef){if(_[_0x1110('0x4c')](_0x35f1ef)){if(_[_0x1110('0xaf')](_0x556700[_0x1110('0xde')])||!_0x556700[_0x1110('0x200')]){if(_0xb0ed7a['dialMethod']==='booked'){_0xb0ed7a[_0x1110('0x13b')]=_[_0x1110('0x41')](_0xb0ed7a['queueStatusComplete'])?!![]:_0xb0ed7a[_0x1110('0x13b')];var _0x3ecf76=uuid['v4']();_0x2820e8[_0x1110('0x26')][_0x3ecf76]=new Action(_0xb0ed7a,_0x556700,_0x3ecf76);loggerBooked['info'](_0x1110('0x201'),_0x3ecf76,_0x1110('0x202'),JSON['stringify'](_0xb0ed7a[_0x1110('0x13b')]),_0x1110('0x203'),_0xb0ed7a['name']);if(_0xb0ed7a[_0x1110('0x13b')]){_0xb0ed7a[_0x1110('0x13b')]=![];_0x2820e8[_0x1110('0x2d')][_0x2820e8[_0x1110('0x26')][_0x3ecf76][_0x1110('0xb6')]]=[];ami['Action']({'actionid':_0x3ecf76,'action':_0x1110('0x204'),'queue':_0xb0ed7a[_0x1110('0x44')]})[_0x1110('0xb3')](function(){_0x2820e8[_0x1110('0xb5')](_0xb0ed7a);_0x2820e8['rescheduleContact']({'active':![],'ContactId':_0x2820e8[_0x1110('0x26')][_0x3ecf76][_0x1110('0xdc')],'ListId':_0x2820e8['actions'][_0x3ecf76]['ListId'],'VoiceQueueId':_0x2820e8[_0x1110('0x26')][_0x3ecf76][_0x1110('0xdf')]||undefined,'CampaignId':_0x2820e8[_0x1110('0x26')][_0x3ecf76]['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x205')));delete _0x2820e8[_0x1110('0x26')][_0x3ecf76];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0xb0ed7a[_0x1110('0x13b')]),_0x1110('0x203'),_0xb0ed7a[_0x1110('0x44')]);_0x2820e8[_0x1110('0xb5')](_0xb0ed7a);_0x2820e8[_0x1110('0xc9')]({'active':![],'ContactId':_0x2820e8[_0x1110('0x26')][_0x3ecf76]['ContactId'],'ListId':_0x2820e8[_0x1110('0x26')][_0x3ecf76]['ListId'],'VoiceQueueId':_0x2820e8[_0x1110('0x26')][_0x3ecf76][_0x1110('0xdf')]||undefined,'CampaignId':_0x2820e8['actions'][_0x3ecf76][_0x1110('0xe0')]||undefined})[_0x1110('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2820e8['actions'][_0x3ecf76];}}else{return _0x2820e8[_0x1110('0x206')](_0xb0ed7a,_0x556700);}}else{if(getDiff(_0x556700[_0x1110('0x207')])<_0xb0ed7a[_0x1110('0x208')]*0x3c){if(_0x556700[_0x1110('0x209')]&&!_0x556700[_0x1110('0x209')][_0x1110('0x20a')]){_0x2820e8['preview']['run'](_0x556700['id'])[_0x1110('0x1f')](function(){_0x2820e8[_0x1110('0xb5')](_0xb0ed7a);});}else{_0x2820e8[_0x1110('0xca')]({'active':![]},_0x556700['id'],0x1)[_0x1110('0x1f')](function(){_0x2820e8[_0x1110('0xb5')](_0xb0ed7a);});}}else{_0xb0ed7a[_0x1110('0x6a')]+=0x1;_0x2820e8[_0x1110('0xb5')](_0xb0ed7a);if(_0xb0ed7a[_0x1110('0x20b')]){_0x2820e8['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x556700[_0x1110('0xdc')],'ListId':_0x556700[_0x1110('0xdd')],'VoiceQueueId':_0x556700[_0x1110('0xdf')]||undefined,'CampaignId':_0x556700['CampaignId']||undefined})[_0x1110('0xb3')](loggerCatch(_0x1110('0x20c')));_0x2820e8[_0x1110('0xd3')](createObjHistory(_0xb0ed7a,_0x556700,_0x1110('0x20d'),0x17,_0x1110('0x20e')))[_0x1110('0xb3')](loggerCatch(_0x1110('0x20f')));}else{_0x2820e8[_0x1110('0xdb')](createObjHistory(_0xb0ed7a,_0x556700,_0x1110('0x210'),0x16,_0x1110('0x211')),_0x1110('0x212'),_0x1110('0x213'));}}}}else{_0xb0ed7a[_0x1110('0x64')]+=0x1;_0x2820e8[_0x1110('0xdb')](createObjHistory(_0xb0ed7a,_0x556700,_0x1110('0x214'),0xd,_0x1110('0x215')),_0x1110('0x216'),_0x1110('0x217'));throw _0x1110('0x218');}};};Dialer[_0x1110('0x1c')][_0x1110('0x16c')]=function(_0x3fa26f){var _0x127236=this;var _0x3c479b=_0x3fa26f[_0x1110('0x219')]-_0x3fa26f[_0x1110('0x76')]-_0x3fa26f[_0x1110('0xcc')];emitCampaignSummary(_0x3fa26f);if(_0x3c479b>0x0){if(_0x3c479b>this[_0x1110('0x21a')]){_0x3c479b=this[_0x1110('0x21a')];}_0x3fa26f[_0x1110('0xcc')]+=_0x3c479b;this[_0x1110('0xce')](_0x3fa26f['id'],_0x3c479b,_0x3fa26f[_0x1110('0x21b')],_0x3fa26f)[_0x1110('0xbc')](function(_0x579638){_0x3fa26f[_0x1110('0xcc')]-=_0x3c479b;_0x3fa26f[_0x1110('0xcc')]=_0x3fa26f[_0x1110('0xcc')]>0x0?_0x3fa26f[_0x1110('0xcc')]:0x0;if(!checkContactEmpty(_0x579638)){_0x3fa26f['message']=_0x1110('0xa0');logger[_0x1110('0x83')](_0x1110('0x21c')+_0x3fa26f[_0x1110('0x44')]);}else{_0x3fa26f[_0x1110('0x76')]+=_0x579638[_0x1110('0x143')];_0x3fa26f[_0x1110('0x42')]=_0x1110('0x21d');for(var _0x4f6832=0x0;_0x4f6832<_0x579638['length'];_0x4f6832+=0x1){_0x3fa26f['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x579638[_0x4f6832])||_['isNil'](_0x579638[_0x4f6832][_0x1110('0x197')])||_[_0x1110('0xaf')](_0x579638[_0x4f6832]['phone'])){_0x127236[_0x1110('0xd9')](_0x1110('0x21e'),_0x3fa26f,_0x579638[_0x4f6832]);}else{_0x127236[_0x1110('0xc4')](_[_0x1110('0x139')](_0x579638[_0x4f6832],[_0x1110('0xe0'),_0x1110('0x21f')]))[_0x1110('0xbc')](_0x127236[_0x1110('0x1ff')](_0x3fa26f,_0x579638[_0x4f6832]))[_0x1110('0xb3')](_0x127236[_0x1110('0xd8')](_0x1110('0x220'),_0x3fa26f));}}}})[_0x1110('0xb3')](loggerGetContactDialer(_0x1110('0x221'),_0x3fa26f,_0x3c479b));}};Dialer[_0x1110('0x1c')][_0x1110('0x168')]=function(_0x408608,_0x14eb4a){var _0xfdd56a=this;var _0x2438a4=[];var _0x5afda2=_0x14eb4a>=0x1?_0x14eb4a:0x1;if(_0x408608[_0x1110('0x5f')]===_0x1110('0x8')){_0x5afda2=0x1;}var _0x40ad13=Math[_0x1110('0x1fb')](_0x408608[_0x1110('0xa3')]*_0x5afda2)-_0x408608[_0x1110('0x76')]-_0x408608[_0x1110('0xcc')];emitVoiceQueueSummary(_0x408608);if(_0x408608[_0x1110('0x222')]>0x0){var _0x569d05=_0x408608[_0x1110('0x222')]-_0x408608[_0x1110('0x76')]-_0x408608['talking']-_0x408608[_0x1110('0xcc')]-_0x408608[_0x1110('0xa2')];if(_0x40ad13>_0x569d05){_0x40ad13=_0x569d05;}}if(_0x40ad13>0x0){if(_0x408608[_0x1110('0x5f')]===_0x1110('0x8')){_0x40ad13=0x1;}if(_0x40ad13>this['maxNumberOriginate']){_0x40ad13=this['maxNumberOriginate'];}_0x408608['temp']+=_0x40ad13;for(var _0x183fa4 in this[_0x1110('0x23')]){if(typeof this[_0x1110('0x23')][_0x183fa4]!==_0x1110('0xd5')){if(this[_0x1110('0x23')][_0x183fa4]['state']===_0x1110('0x223')&&this[_0x1110('0x23')][_0x183fa4][_0x1110('0xb1')]===_0x1110('0xe6')){_0x2438a4[_0x1110('0x138')](this[_0x1110('0x23')][_0x183fa4]['id']);}}}this[_0x1110('0x224')](_0x408608['id'],_0x2438a4,_0x40ad13,_0x408608[_0x1110('0x21b')],_0x408608)['then'](function(_0x34e10c){_0x408608[_0x1110('0xcc')]-=_0x40ad13;_0x408608[_0x1110('0xcc')]=_0x408608[_0x1110('0xcc')]>0x0?_0x408608['temp']:0x0;if(!checkContactEmpty(_0x34e10c)){_0xfdd56a[_0x1110('0xb9')](_0x408608)[_0x1110('0xbc')](sendMessageReschedule(_0x408608))[_0x1110('0xb3')](loggerCatch(_0x1110('0xba')));}else{_0x408608[_0x1110('0x76')]+=_0x34e10c[_0x1110('0x143')];_0x408608[_0x1110('0x42')]=_0x408608[_0x1110('0x5f')]===_0x1110('0x8')?_0x1110('0x183'):_0x1110('0x21d');for(var _0x47498f=0x0;_0x47498f<_0x34e10c[_0x1110('0x143')];_0x47498f+=0x1){if(_['isNil'](_0x34e10c[_0x47498f])||_['isNil'](_0x34e10c[_0x47498f][_0x1110('0x197')])||_[_0x1110('0xaf')](_0x34e10c[_0x47498f][_0x1110('0x17c')])){_0xfdd56a[_0x1110('0xd9')](_0x1110('0x21e'),_0x408608,_0x34e10c[_0x47498f]);}else{_0xfdd56a['checkIsBlackList'](_[_0x1110('0x139')](_0x34e10c[_0x47498f],[_0x1110('0xdf'),_0x1110('0x21f')]))[_0x1110('0xbc')](_0xfdd56a[_0x1110('0x1ff')](_0x408608,_0x34e10c[_0x47498f]))[_0x1110('0xb3')](_0xfdd56a[_0x1110('0xd8')](_0x1110('0x21e'),_0x408608));}}}})[_0x1110('0xb3')](loggerGetContactDialer(_0x1110('0x225'),_0x408608,_0x40ad13));}};Dialer[_0x1110('0x1c')][_0x1110('0x95')]=function(_0x43438c){if(_0x43438c[_0x1110('0x222')]>0x0){var _0x292fb5=_0x43438c[_0x1110('0x222')]-_0x43438c[_0x1110('0x76')]-_0x43438c[_0x1110('0x59')];if(_0x292fb5>0x0){this[_0x1110('0x226')](_0x43438c);}else{loggerPredictiveCalls[_0x1110('0x83')](_0x1110('0x227'));}}else{this['tryOriginatePredictive'](_0x43438c);}};Dialer[_0x1110('0x1c')]['tryOriginatePredictive']=function(_0x44bd84){var _0xac82c4=this;var _0x2e8331=[];_0x44bd84[_0x1110('0x76')]+=0x1;for(var _0x5e084a in this[_0x1110('0x23')]){if(typeof this[_0x1110('0x23')][_0x5e084a]!=='undefined'){if(this[_0x1110('0x23')][_0x5e084a]['state']===_0x1110('0x223')&&this[_0x1110('0x23')][_0x5e084a][_0x1110('0xb1')]===_0x1110('0xe6')){_0x2e8331[_0x1110('0x138')](this[_0x1110('0x23')][_0x5e084a]['id']);}}}this[_0x1110('0x224')](_0x44bd84['id'],_0x2e8331,0x1,_0x44bd84[_0x1110('0x21b')],_0x44bd84)[_0x1110('0xbc')](function(_0x5c0c8b){if(!checkContactEmpty(_0x5c0c8b)){checkContactLowerLimitOriginate(_0x44bd84,0x1,0x0);_0xac82c4['countReScheduled'](_0x44bd84)['then'](sendMessageReschedule(_0x44bd84))[_0x1110('0xb3')](loggerCatch(_0x1110('0xba')));}else{_0x44bd84[_0x1110('0x42')]=_0x1110('0x21d');if(_[_0x1110('0xaf')](_0x5c0c8b[0x0])||_[_0x1110('0xaf')](_0x5c0c8b[0x0][_0x1110('0x197')])||_[_0x1110('0xaf')](_0x5c0c8b[0x0][_0x1110('0x17c')])){_0xac82c4[_0x1110('0xd9')]('[actionOriginate]\x20',_0x44bd84,_0x5c0c8b[0x0]);}else{_0xac82c4['checkIsBlackList'](_[_0x1110('0x139')](_0x5c0c8b[0x0],[_0x1110('0xdf'),_0x1110('0x21f')]))[_0x1110('0xbc')](_0xac82c4['checkContactBlack'](_0x44bd84,_0x5c0c8b[0x0]))[_0x1110('0xb3')](_0xac82c4[_0x1110('0xd8')]('[actionOriginatePredictive]\x20',_0x44bd84));}}})[_0x1110('0xb3')](loggerGetContactDialer('[getContactDialerPredictive]',_0x44bd84,0x1));emitVoiceQueueSummary(_0x44bd84);};Dialer['prototype'][_0x1110('0x1f9')]=function(_0x1395c0,_0xec8eb7,_0x4e46cd,_0xae6bbb,_0x3b8fbd,_0x29bab4){loggerPredictive[_0x1110('0x83')](_0x1110('0x228'));loggerPredictive[_0x1110('0x83')](_0x1110('0x229'),_0x1395c0);loggerPredictive[_0x1110('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xec8eb7);loggerPredictive[_0x1110('0x83')]('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',_0x4e46cd);loggerPredictive[_0x1110('0x83')]('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',_0xae6bbb);loggerPredictive[_0x1110('0x83')](_0x1110('0x22a'),_0x3b8fbd);loggerPredictive[_0x1110('0x83')](_0x1110('0x8a'));return new BPromise(function(_0x4ea4ed,_0x2950d9){if(_0x1395c0<=0x0||isNaN(_0x1395c0)){return _0x2950d9(msgResponse(_0x1110('0x22b'),_0x1110('0x4d'),_0x1110('0x22c')+_0x1395c0));}if(_0x4e46cd<=0x0||isNaN(_0x4e46cd)){return _0x2950d9(msgResponse(_0x1110('0x22b'),_0x1110('0x4d'),_0x1110('0x22d')+_0x4e46cd));}if(_0xae6bbb<=0x0||isNaN(_0xae6bbb)){return _0x2950d9(msgResponse(_0x1110('0x22b'),_0x1110('0x4d'),_0x1110('0x22e')+_0xae6bbb));}if(_0xec8eb7<=0x0||isNaN(_0xec8eb7)){return _0x2950d9(msgResponse('[abandonmentRate]',_0x1110('0x4d'),_0x1110('0x22f')+_0xec8eb7));}if(_0x3b8fbd<=0x0||isNaN(_0x3b8fbd)){return _0x2950d9(msgResponse(_0x1110('0x22b'),_0x1110('0x4d'),_0x1110('0x230')+_0x3b8fbd));}_0x29bab4=_0x29bab4||0x0;var _0x3e8026=0x1/_0x4e46cd;var _0x1a8da5=0x0;var _0x153d9a=0x0;var _0x29d350=0x0;var _0x3778c5=0x0;for(var _0xb672dc=0x0;_0x29d350<_0x3b8fbd;_0xb672dc+=0x1){_0x153d9a=_0xb672dc/_0xec8eb7;_0x1a8da5=(_0xae6bbb*_0x153d9a+_0x29bab4)/_0x3e8026;_0x29d350=erlangb(_0x1a8da5,_0x1395c0);_0x3778c5=_0x1a8da5/_0x1395c0*(0x1-erlangb(_0x1a8da5,_0x1395c0));}return _0x4ea4ed({'erlangCalls':_0xb672dc,'erlangCallToSecond':_0xec8eb7/_0xb672dc,'erlangAbandonmentRate':_0x29d350,'erlangBusyFactor':_0x3778c5});});};Dialer[_0x1110('0x1c')]['busyFactor']=function(_0x439d8e,_0x1f8a54,_0x176994,_0x5a8a0b,_0x19d513,_0x41839e){loggerPredictive[_0x1110('0x83')](_0x1110('0x231'));loggerPredictive['info'](_0x1110('0x229'),_0x439d8e);loggerPredictive['info'](_0x1110('0x232'),_0x1f8a54);loggerPredictive['info'](_0x1110('0x233'),_0x176994);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a8a0b);loggerPredictive[_0x1110('0x83')](_0x1110('0x234'),_0x19d513);loggerPredictive[_0x1110('0x83')]('---------------------------');return new BPromise(function(_0x3fdc8d,_0x2373b6){if(_0x439d8e<=0x0||isNaN(_0x439d8e)){return _0x2373b6(msgResponse('[busyFactor]',_0x1110('0x4d'),_0x1110('0x22c')+_0x439d8e));}if(_0x176994<=0x0||isNaN(_0x176994)){return _0x2373b6(msgResponse('[busyFactor]',_0x1110('0x4d'),_0x1110('0x22d')+_0x176994));}if(_0x5a8a0b<=0x0||isNaN(_0x5a8a0b)){return _0x2373b6(msgResponse('[busyFactor]',_0x1110('0x4d'),_0x1110('0x22e')+_0x5a8a0b));}if(_0x1f8a54<=0x0||isNaN(_0x1f8a54)){return _0x2373b6(msgResponse(_0x1110('0x235'),'Error',_0x1110('0x22f')+_0x1f8a54));}if(_0x19d513<=0x0||isNaN(_0x19d513)){return _0x2373b6(msgResponse('[busyFactor]',_0x1110('0x4d'),_0x1110('0x236')+_0x19d513));}_0x41839e=_0x41839e||0x0;var _0x23e746=0x1/_0x176994;var _0x3a5132=0x0;var _0x3cf083=0x0;var _0x6434b3=0x0;var _0x5d8426=0x0;for(var _0x56a1c8=0x0;_0x5d8426<_0x19d513;_0x56a1c8+=0x1){_0x3cf083=_0x56a1c8/_0x1f8a54;_0x3a5132=(_0x5a8a0b*_0x3cf083+_0x41839e)/_0x23e746;_0x6434b3=erlangb(_0x3a5132,_0x439d8e);_0x5d8426=_0x3a5132/_0x439d8e*(0x1-erlangb(_0x3a5132,_0x439d8e));}return _0x3fdc8d({'erlangCalls':_0x56a1c8,'erlangCallToSecond':_0x1f8a54/_0x56a1c8,'erlangAbandonmentRate':_0x6434b3,'erlangBusyFactor':_0x5d8426});});};module['exports']=Dialer;
\ No newline at end of file
+var _0x305f=['Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','----Agent\x20busy----','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','----checkRetrieveMax----','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','[CatchErlangB]','outboundQueuePauses','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','outboundReCallsDay','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','dialOrderByScheduledAt','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','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]','Error','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Interval','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','starttime','[uniqueid]','clearZombieChannels','[actions]','undefined','isNil','Action','status','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','log','Calling\x20swapAdditionalPhone\x20body->','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','statedesc','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','reason19\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','add','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','actions','actionid','strategy','locked','paused','stateinterface','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','interval','content','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID'];(function(_0xfbfd3a,_0x40b3c6){var _0x9bd4ee=function(_0x4ee834){while(--_0x4ee834){_0xfbfd3a['push'](_0xfbfd3a['shift']());}};_0x9bd4ee(++_0x40b3c6);}(_0x305f,0x97));var _0xf305=function(_0x1798bb,_0x3e87a9){_0x1798bb=_0x1798bb-0x0;var _0x24ac13=_0x305f[_0x1798bb];return _0x24ac13;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xf305('0x0'));var uuid=require(_0xf305('0x1'));var moment=require(_0xf305('0x2'));var rr=require('rr');var md5=require(_0xf305('0x3'));var Redis=require('ioredis');var ut=require(_0xf305('0x4'));var config=require(_0xf305('0x5'));var logger=require(_0xf305('0x6'))(_0xf305('0x7'));var loggerBooked=require(_0xf305('0x6'))(_0xf305('0x8'));var loggerPredictive=require(_0xf305('0x6'))('predictive');var loggerPredictiveCalls=require(_0xf305('0x6'))(_0xf305('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xf305('0xa'));var ami=require('../ami');config[_0xf305('0xb')]=_[_0xf305('0xc')](config[_0xf305('0xb')],{'host':_0xf305('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf305('0xb')]));var cmHopper=require(_0xf305('0xe'));var cmHopperHistory=require(_0xf305('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0xf305('0x10'));var cmHopperBlack=require(_0xf305('0x11'));var voiceQueueRt=require(_0xf305('0x12'));var Action=require('./action');var History=require(_0xf305('0x13'));var Final=require(_0xf305('0x14'));var AgentComplete=require(_0xf305('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xf305('0x16'));var ipAgi=process[_0xf305('0x17')][_0xf305('0x18')]||_0xf305('0x19');var strategy={'rrmemory':_0xf305('0x1a'),'roundrobin':_0xf305('0x1b')};var Sequence=function(){};Sequence[_0xf305('0x1c')]['enqueue']=function(_0x1793f9){this[_0xf305('0x1d')]=this['tail']?this['tail'][_0xf305('0x1e')](_0x1793f9):_0x1793f9();};function Dialer(_0xaf4d71,_0x404ac3){this[_0xf305('0x1f')]=new Sequence();this[_0xf305('0x20')]=_0x404ac3;this[_0xf305('0x21')]=_0xaf4d71[_0xf305('0x21')];this[_0xf305('0x22')]=_0xaf4d71['campaigns'];this[_0xf305('0x23')]=_0xaf4d71[_0xf305('0x23')];this[_0xf305('0x24')]=_0xaf4d71['trunks'];this['maxNumberOriginate']=config[_0xf305('0x25')]||0x2;this['channels']={};this['actions']={};this[_0xf305('0x26')]={};this[_0xf305('0x27')]={};this[_0xf305('0x28')]={};this[_0xf305('0x29')]={};this[_0xf305('0x2a')]={};this[_0xf305('0x2b')]={};this[_0xf305('0x2c')]={};this[_0xf305('0x2d')]={};ami['on'](_0xf305('0x2e'),this[_0xf305('0x2f')][_0xf305('0x30')](this));ami['on'](_0xf305('0x31'),this[_0xf305('0x32')][_0xf305('0x30')](this));ami['on'](_0xf305('0x33'),this[_0xf305('0x34')]['bind'](this));ami['on'](_0xf305('0x35'),this[_0xf305('0x36')][_0xf305('0x30')](this));ami['on'](_0xf305('0x37'),this[_0xf305('0xa')][_0xf305('0x30')](this));ami['on'](_0xf305('0x38'),this['syncHangup'][_0xf305('0x30')](this));ami['on'](_0xf305('0x39'),this[_0xf305('0x3a')][_0xf305('0x30')](this));ami['on'](_0xf305('0x3b'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0xf305('0x3c')][_0xf305('0x30')](this));ami['on']('queuestatuscomplete',this[_0xf305('0x3d')][_0xf305('0x30')](this));this[_0xf305('0x3e')]();this[_0xf305('0x3f')]();}function isNotNull(_0x25c545){return _0x25c545!==null&&!_[_0xf305('0x40')](_0x25c545);}function checkIsLoggedIn(_0x3705ac,_0x1845e8){return function(){if(_0x1845e8<=0x0){_0x3705ac[_0xf305('0x41')]=_0xf305('0x42');throw _0x3705ac[_0xf305('0x43')]+_0xf305('0x44');}};}function isActive(_0x3d4bf0){return _0x3d4bf0;}function checkIsActive(_0x37841c,_0xbb54c3){return function(){if(!isActive(_0xbb54c3)){_0x37841c[_0xf305('0x41')]=_0xf305('0x45');throw _0x37841c[_0xf305('0x43')]+_0xf305('0x46');}};}function checkInterval(_0x71b75c){return function(){if(!isNotNull(_0x71b75c['Interval'])){_0x71b75c[_0xf305('0x41')]='INTERVAL_IS_NULL';throw _0x71b75c[_0xf305('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x71b75c['Interval'][_0xf305('0x47')])){_0x71b75c[_0xf305('0x41')]=_0xf305('0x48');throw _0x71b75c[_0xf305('0x43')]+_0xf305('0x49');}if(!isNotNull(_[_0xf305('0x4a')](_0x71b75c[_0xf305('0x4b')][_0xf305('0x47')]))){_0x71b75c[_0xf305('0x41')]=_0xf305('0x48');throw _0x71b75c[_0xf305('0x43')]+_0xf305('0x49');}};}function msgResponse(_0x39ea82,_0x3f0af5,_0x495aee){return{'action':_0x39ea82,'response':_0x3f0af5,'message':_0x495aee,'stack':_0x495aee};}function myreject(_0x4dc1cb){return function(_0x3ea016){return _0x4dc1cb(msgResponse(_0xf305('0x4c'),'Error',JSON[_0xf305('0x4d')](_0x3ea016)));};}function getSeconds(_0x274287,_0xd17bf5){var _0x11d497=moment(_0x274287)[_0xf305('0x4e')](0x0);var _0x10c2ea=moment(_0xd17bf5)[_0xf305('0x4e')](0x0);return _0x11d497[_0xf305('0x4f')](_0x10c2ea,_0xf305('0x50'));}function emit(_0x333624,_0x397f31,_0x560b7a){io['to'](_0x333624)[_0xf305('0x51')](_0x397f31,_0x560b7a);}function emitVoiceQueueSummary(_0x5074ee){if(_0x5074ee[_0xf305('0x52')]===_0xf305('0x53')){var _0xef899e={'id':_0x5074ee['id'],'name':_0x5074ee[_0xf305('0x43')],'strategy':_0x5074ee['strategy'],'answered':_0x5074ee[_0xf305('0x54')],'available':_0x5074ee[_0xf305('0x55')],'loggedIn':_0x5074ee[_0xf305('0x56')],'pTalking':_0x5074ee[_0xf305('0x57')],'sumBillable':_0x5074ee[_0xf305('0x58')],'sumDuration':_0x5074ee[_0xf305('0x59')],'sumHoldTime':_0x5074ee[_0xf305('0x5a')]||0x0,'talking':_0x5074ee[_0xf305('0x5b')],'total':_0x5074ee['total'],'type':_0x5074ee[_0xf305('0x52')],'unmanaged':_0x5074ee[_0xf305('0x5c')],'abandoned':_0x5074ee[_0xf305('0x5d')],'waiting':_0x5074ee[_0xf305('0x5e')],'loggedInDb':_0x5074ee[_0xf305('0x5f')],'dialActive':_0x5074ee[_0xf305('0x60')],'dialMethod':_0x5074ee[_0xf305('0x61')],'dialOriginateCallerIdName':_0x5074ee[_0xf305('0x62')],'dialOriginateCallerIdNumber':_0x5074ee[_0xf305('0x63')],'dialOriginateTimeout':_0x5074ee[_0xf305('0x64')],'dialPrefix':_0x5074ee[_0xf305('0x65')],'outboundAnswerAgiCallsDay':_0x5074ee[_0xf305('0x66')],'outboundAnswerCallsDay':_0x5074ee[_0xf305('0x67')],'outboundBlacklistCallsDay':_0x5074ee[_0xf305('0x68')],'outboundBusyCallsDay':_0x5074ee[_0xf305('0x69')],'outboundCongestionCallsDay':_0x5074ee[_0xf305('0x6a')],'outboundDropCallsDayACS':_0x5074ee[_0xf305('0x6b')],'outboundDropCallsDayCallersExit':_0x5074ee[_0xf305('0x6c')],'outboundDropCallsDayTimeout':_0x5074ee[_0xf305('0x6d')],'outboundNoAnswerCallsDay':_0x5074ee[_0xf305('0x6e')],'outboundNoSuchCallsDay':_0x5074ee[_0xf305('0x6f')],'outboundOriginateFailureCallsDay':_0x5074ee[_0xf305('0x70')],'outboundReCallsDay':_0x5074ee['outboundReCallsDay'],'outboundRejectCallsDay':_0x5074ee['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5074ee[_0xf305('0x71')],'predictiveIntervalAnsweredCalls':_0x5074ee['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5074ee[_0xf305('0x72')],'predictiveIntervalAvgTalktime':_0x5074ee[_0xf305('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x5074ee[_0xf305('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x5074ee[_0xf305('0x75')],'predictiveIntervalErlangCalls':_0x5074ee[_0xf305('0x76')],'predictiveIntervalErlangCallsDroppedCalls':_0x5074ee[_0xf305('0x77')],'predictiveIntervalHitRate':_0x5074ee[_0xf305('0x78')],'predictiveIntervalMultiplicativeFactor':_0x5074ee[_0xf305('0x79')],'predictiveIntervalPauses':_0x5074ee[_0xf305('0x7a')],'predictiveIntervalAvailable':_0x5074ee[_0xf305('0x7b')],'predictiveIntervalTotalCalls':_0x5074ee[_0xf305('0x7c')],'message':_0x5074ee[_0xf305('0x41')],'originated':_0x5074ee['originated'],'erlangCalls':_0x5074ee[_0xf305('0x7d')],'erlangCallToSecond':_0x5074ee[_0xf305('0x7e')],'erlangAbandonmentRate':_0x5074ee[_0xf305('0x7f')],'erlangBusyFactor':_0x5074ee['erlangBusyFactor'],'startPredictive':_0x5074ee[_0xf305('0x29')],'startProgressive':_0x5074ee['startProgressive']};if(_0x5074ee[_0xf305('0x80')]){_0xef899e[_0xf305('0x80')]={'id':_0x5074ee['Trunk']['id'],'name':_0x5074ee[_0xf305('0x80')][_0xf305('0x43')],'active':_0x5074ee[_0xf305('0x80')][_0xf305('0x81')],'callerid':_0x5074ee[_0xf305('0x80')][_0xf305('0x82')]};}if(_0x5074ee[_0xf305('0x4b')]){_0xef899e[_0xf305('0x4b')]={'id':_0x5074ee['Interval']['id'],'name':_0x5074ee[_0xf305('0x4b')][_0xf305('0x43')]};}var _0x165a66=md5(JSON[_0xf305('0x4d')](_0xef899e));if(_0x5074ee[_0xf305('0x3')]!==_0x165a66){_0x5074ee[_0xf305('0x3')]=_0x165a66;emit(util[_0xf305('0x83')]('voice:queue:%s',_0xef899e[_0xf305('0x43')]),_0xf305('0x84'),_0xef899e);}}}function emitCampaignSummary(_0x17ce28){if(_0x17ce28[_0xf305('0x52')]===_0xf305('0x85')){emit(util[_0xf305('0x83')](_0xf305('0x86'),_0x17ce28[_0xf305('0x43')]),_0xf305('0x87'),_0x17ce28);}}function checkGetDataPredictive(_0x58287c){if(isNotNull(_0x58287c)&&!_[_0xf305('0x4a')](_0x58287c)){loggerPredictive[_0xf305('0x88')](_0xf305('0x89'));loggerPredictive['info'](_0xf305('0x8a'),_0x58287c['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xf305('0x8b'),_0x58287c[_0xf305('0x8c')]);loggerPredictive[_0xf305('0x88')](_0xf305('0x8d'),_0x58287c['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xf305('0x88')](_0xf305('0x8e'),_0x58287c[_0xf305('0x74')]);loggerPredictive[_0xf305('0x88')](_0xf305('0x8f'),_0x58287c[_0xf305('0x72')]);loggerPredictive[_0xf305('0x88')](_0xf305('0x90'),_0x58287c[_0xf305('0x73')]);loggerPredictive[_0xf305('0x88')]('---------------------------');if(_0x58287c[_0xf305('0x7c')]>0x0){if(!_[_0xf305('0x40')](_0x58287c[_0xf305('0x73')])&&_0x58287c[_0xf305('0x73')]>0x0){return!![];}loggerPredictive[_0xf305('0x88')](_0xf305('0x91'));if(!_['isUndefined'](_0x58287c[_0xf305('0x72')])&&_0x58287c['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xf305('0x88')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xf305('0x88')](_0xf305('0x92'));}}else{loggerPredictive[_0xf305('0x88')](_0xf305('0x93'));}return![];}function mergeDataErlangB(_0x31cf93){return function(_0xefe98a){loggerPredictive[_0xf305('0x88')](_0xf305('0x94'));loggerPredictive[_0xf305('0x88')](_0xf305('0x95'),_0xefe98a[_0xf305('0x7d')]);loggerPredictive[_0xf305('0x88')](_0xf305('0x96'),_0xefe98a['erlangCallToSecond']);loggerPredictive[_0xf305('0x88')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xefe98a[_0xf305('0x7f')]);loggerPredictive[_0xf305('0x88')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xefe98a['erlangBusyFactor']);loggerPredictive[_0xf305('0x88')](_0xf305('0x97'),_0xefe98a[_0xf305('0x7f')]);loggerPredictive[_0xf305('0x88')](_0xf305('0x98'));_[_0xf305('0x99')](_0x31cf93,_0xefe98a);};}function getDiff(_0x4d5689){var _0x2b1cab=moment()[_0xf305('0x4e')](0x0);var _0x3e3277=moment(_0x4d5689)[_0xf305('0x4e')](0x0);return _0x2b1cab[_0xf305('0x4f')](_0x3e3277,_0xf305('0x50'));}function ifInterval(_0x3b3a79,_0x4a251c){if(_[_0xf305('0x40')](_0x4a251c)){return![];}return getDiff(_0x4a251c)<_0x3b3a79*0x3c;}function freeVariablesPredictive(_0xffa946){if(isNotNull(_0xffa946)){if(!_[_0xf305('0x40')](_0xffa946[_0xf305('0x2a')])){_0xffa946[_0xf305('0x2a')]=undefined;loggerPredictive[_0xf305('0x88')](_0xffa946[_0xf305('0x43')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0xffa946[_0xf305('0x29')])){_0xffa946[_0xf305('0x29')]=undefined;loggerPredictive[_0xf305('0x88')](_0xffa946[_0xf305('0x43')],_0xf305('0x9a'));}if(!_['isUndefined'](_0xffa946[_0xf305('0x9b')])){clearInterval(_0xffa946['handlePredictive']);_0xffa946[_0xf305('0x9b')]=undefined;loggerPredictive[_0xf305('0x88')](_0xffa946[_0xf305('0x43')],_0xf305('0x9c'));}}}function erlangb(_0x1f97ab,_0x2cbc4b){if(_0x2cbc4b===0x0){return 0x0;}var _0x53dbd3=0x1;for(var _0x301e56=0x1;_0x301e56<=_0x2cbc4b;_0x301e56+=0x1){_0x53dbd3=0x1+_0x53dbd3*_0x301e56/_0x1f97ab;}return 0x1/_0x53dbd3;}function isVoiceQueueOutbound(_0x39a7b7){return _0x39a7b7==='outbound';}function isNotPreview(_0x317f8b){return _0x317f8b!==_0xf305('0x20');}function isCampaignIvr(_0x3d0e11){return _0x3d0e11===_0xf305('0x85');}function getCallerId(_0x1f8a71,_0xe5034,_0x2683ec){if(!_[_0xf305('0x40')](_0x2683ec)&&typeof _0x2683ec===_0xf305('0x9d')&&!_[_0xf305('0x4a')](_0x2683ec)){if(!_['isUndefined'](_0xe5034)&&typeof _0xe5034===_0xf305('0x9d')&&!_[_0xf305('0x4a')](_0xe5034)){return util['format'](_0xf305('0x9e'),_0xe5034,_0x2683ec);}return util[_0xf305('0x83')](_0xf305('0x9e'),_0x2683ec,_0x2683ec);}if(!_[_0xf305('0x40')](_0x1f8a71)&&typeof _0x1f8a71===_0xf305('0x9d')&&!_[_0xf305('0x4a')](_0x1f8a71)){return _0x1f8a71;}return _0xf305('0x9f');}function loggerCatchQueueSummary(_0x42488e,_0x202efa){return function(_0x58a09c){freeVariablesPredictive(_0x202efa);emitVoiceQueueSummary(_0x202efa);emitCampaignSummary(_0x202efa);loggerSyncQueueSummary['error'](_0x42488e,util[_0xf305('0xa0')](_0x58a09c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1f7710,_0x586231){return function(_0x2b0ac9){loggerPredictive[_0xf305('0xa1')](_0x586231[_0xf305('0x43')],_0x1f7710);loggerPredictive[_0xf305('0xa1')](_0x2b0ac9['stack']);freeVariablesPredictive(_0x586231);};}function loggerCatch(_0x5a244f){return function(_0x48ae18){logger[_0xf305('0xa1')](_0x5a244f,util['inspect'](_0x48ae18,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xdc3057){return _0xdc3057&&!_['isUndefined'](_0xdc3057)&&_0xdc3057[_0xf305('0xa2')]>0x0;}function decremetOriginate(_0x292cc3){if(!_['isUndefined'](_0x292cc3)&&_0x292cc3!==null){if(typeof _0x292cc3[_0xf305('0xa3')]!=='undefined'){if(_0x292cc3[_0xf305('0xa3')]>0x0){_0x292cc3[_0xf305('0xa3')]-=0x1;}else{logger[_0xf305('0xa1')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf305('0xa1')](_0xf305('0xa4'));}}function checkContactLowerLimitOriginate(_0xdfb0ad,_0x57e891,_0x59838e){if(_0x57e891>_0x59838e){for(var _0x1e084d=0x0;_0x1e084d<_0x57e891-_0x59838e;_0x1e084d+=0x1){decremetOriginate(_0xdfb0ad);}}}function loggerGetContactDialer(_0x2193fd,_0x493f4e,_0x39bd5e){return function(_0x4afe66){checkContactLowerLimitOriginate(_0x493f4e,_0x39bd5e,0x0);logger[_0xf305('0xa1')](_0x2193fd,util[_0xf305('0xa0')](_0x4afe66,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x32c657){return function(_0x3ddd47){if(isNotNull(_0x3ddd47)&&isNotNull(_0x3ddd47[0x0])){if(_0x3ddd47[0x0][_0xf305('0xa5')]>0x0){_0x32c657[_0xf305('0x41')]=_0xf305('0xa6');logger['info'](_0xf305('0xa7')+_0x32c657[_0xf305('0x43')],_0x3ddd47[0x0][_0xf305('0xa5')],'contacts');}else{_0x32c657[_0xf305('0x41')]=_0xf305('0xa8');logger[_0xf305('0x88')](_0xf305('0xa9')+_0x32c657[_0xf305('0x43')]);}}};}function notSendMessagesQueue(_0x4c7fe4){if(_0x4c7fe4['sendMessageOneNotActive']){freeVariablesPredictive(_0x4c7fe4);if(_0x4c7fe4[_0xf305('0xa3')]===0x0&&_0x4c7fe4[_0xf305('0x5b')]===0x0&&_0x4c7fe4[_0xf305('0x5e')]===0x0&&(_0x4c7fe4[_0xf305('0x57')]||0x0)===0x0){_0x4c7fe4[_0xf305('0xaa')]=![];_0x4c7fe4['available']=0x0;_0x4c7fe4[_0xf305('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf305('0xa1')](_0xf305('0xab'),_0x4c7fe4[_0xf305('0x43')],_0xf305('0xac'));}else{_0x4c7fe4['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xf305('0xa1')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4c7fe4[_0xf305('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x4c7fe4);}}function notSendMessagesCampaign(_0x427761){if(_0x427761['sendMessageOneNotActive']){if(_0x427761[_0xf305('0xa3')]===0x0){_0x427761[_0xf305('0xaa')]=![];_0x427761[_0xf305('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf305('0xa1')](_0xf305('0xad'),_0x427761[_0xf305('0x43')],_0xf305('0xac'));}else{_0x427761[_0xf305('0x41')]=_0xf305('0xae');loggerSyncQueueSummary[_0xf305('0xa1')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x427761[_0xf305('0x43')],'is\x20disactive');}emitCampaignSummary(_0x427761);}}function createObjHistory(_0x459f4b,_0x5ca031,_0x261d2d,_0x1443c2,_0xe3ec7d){_0x459f4b[_0xf305('0x41')]=_0x261d2d;var _0x61ffab=new Action(_0x459f4b,_0x5ca031);var _0x58ac0a=new History(_0x61ffab);_0x58ac0a[_0xf305('0xaf')]=_0x1443c2;_0x58ac0a['statedesc']=_0xe3ec7d;_0x58ac0a['endtime']=_0x61ffab[_0xf305('0xb0')];return _0x58ac0a;}Dialer[_0xf305('0x1c')][_0xf305('0x3f')]=function(){var _0x3a7452=this;setInterval(function(){_0x3a7452['clearZombieChannels'](_0x3a7452[_0xf305('0x27')],_0xf305('0xb1'));_0x3a7452[_0xf305('0xb2')](_0x3a7452['actions'],_0xf305('0xb3'));},0x32c8);};Dialer[_0xf305('0x1c')][_0xf305('0xb2')]=function(_0x4beeb5,_0x3adb39){var _0x40a93b=this;for(var _0x182862 in _0x4beeb5){if(typeof _0x4beeb5[_0x182862]!==_0xf305('0xb4')){this[_0xf305('0x1f')]['enqueue'](function(){if(!_[_0xf305('0xb5')](_0x4beeb5[_0x182862])){return ami[_0xf305('0xb6')]({'action':_0xf305('0xb7'),'channel':_0x4beeb5[_0x182862][_0xf305('0xb8')]})[_0xf305('0xb9')](function(_0x128844){if(_0x128844[_0xf305('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4beeb5[_0x182862]&&_0x4beeb5[_0x182862][_0xf305('0x52')]!==_0xf305('0x85')){_0x40a93b[_0xf305('0xba')](_0x40a93b['voiceQueues'][_0x4beeb5[_0x182862]['queue']]);logger[_0xf305('0xa1')](_0xf305('0xbb'),_0x3adb39,_0x182862,_0x4beeb5[_0x182862]['queue']);delete _0x4beeb5[_0x182862];}if(_0x4beeb5[_0x182862]&&_0x4beeb5[_0x182862]['type']===_0xf305('0x85')){_0x40a93b['updateOriginated'](_0x40a93b[_0xf305('0x22')][_0x4beeb5[_0x182862][_0xf305('0xbc')]]);logger[_0xf305('0xa1')](_0xf305('0xbd'),_0x3adb39,_0x182862,_0x4beeb5[_0x182862][_0xf305('0xbc')]);delete _0x4beeb5[_0x182862];}},0x2328);}});}});}}};Dialer[_0xf305('0x1c')][_0xf305('0xbe')]=function(_0x123506){return BPromise[_0xf305('0xbf')]()['then'](cmHopper[_0xf305('0xbe')](_0x123506))[_0xf305('0xb9')](loggerCatch(_0xf305('0xc0')));};Dialer[_0xf305('0x1c')][_0xf305('0xc1')]=function(_0x12f6e0){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopperBlack['checkIsBlackList'](_0x12f6e0))[_0xf305('0xb9')](loggerCatch(_0xf305('0xc3')));};Dialer[_0xf305('0x1c')][_0xf305('0xc4')]=function(_0x189513,_0x1f9432,_0x2b4d81){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopperAdditionalPhone[_0xf305('0xc4')](_0x189513,_0x1f9432,_0x2b4d81))[_0xf305('0xb9')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer['prototype'][_0xf305('0xc5')]=function(_0x2e3fdc,_0x255cce,_0x40408f){console[_0xf305('0xc6')](_0xf305('0xc7'),_0x2e3fdc);console[_0xf305('0xc6')]('Calling\x20swapAdditionalPhone\x20duration->',_0x255cce);console[_0xf305('0xc6')]('Calling\x20swapAdditionalPhone\x20waitTime->',_0x40408f);return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2e3fdc,_0x255cce,_0x40408f))[_0xf305('0xb9')](loggerCatch(_0xf305('0xc8')));};Dialer[_0xf305('0x1c')][_0xf305('0xc9')]=function(_0x769a39){return BPromise['resolve']()[_0xf305('0xc2')](cmHopperBlack[_0xf305('0xc9')](_0x769a39))['catch'](loggerCatch(_0xf305('0xca')));};Dialer[_0xf305('0x1c')][_0xf305('0xcb')]=function(_0x32d706){return BPromise[_0xf305('0xbf')]()['then'](cmHopperHistory[_0xf305('0xcc')](_0x32d706))[_0xf305('0xb9')](loggerCatch(_0xf305('0xcd')));};Dialer[_0xf305('0x1c')][_0xf305('0xce')]=function(_0x49d015){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopper[_0xf305('0xce')](_0x49d015))[_0xf305('0xb9')](loggerCatch(_0xf305('0xcf')));};Dialer['prototype'][_0xf305('0xd0')]=function(_0x159cba,_0x3a1369,_0x52b574){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopper[_0xf305('0xd0')](_0x159cba,_0x3a1369,_0x52b574))[_0xf305('0xb9')](loggerCatch(_0xf305('0xd1')));};Dialer[_0xf305('0x1c')][_0xf305('0xd2')]=function(_0x926eec,_0x523e2d,_0x5cb1de,_0x3f4863,_0xa486eb){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopper[_0xf305('0xd2')](_0x926eec,_0x523e2d,_0x5cb1de,_0x3f4863))[_0xf305('0xb9')](function(_0xa01b29){_0xa486eb[_0xf305('0xd3')]-=_0x5cb1de;_0xa486eb['temp']=_0xa486eb[_0xf305('0xd3')]>0x0?_0xa486eb[_0xf305('0xd3')]:0x0;loggerCatch(_0xf305('0xd4'))(_0xa01b29);});};Dialer[_0xf305('0x1c')][_0xf305('0xd5')]=function(_0x224402,_0x46aaea,_0x40bdda,_0x4bba7b){return BPromise['resolve']()['then'](cmHopper[_0xf305('0xd5')](_0x224402,_0x46aaea,_0x40bdda))['catch'](function(_0x162b43){_0x4bba7b[_0xf305('0xd3')]-=_0x46aaea;_0x4bba7b[_0xf305('0xd3')]=_0x4bba7b[_0xf305('0xd3')]>0x0?_0x4bba7b['temp']:0x0;loggerCatch(_0xf305('0xd6'))(_0x162b43);});};Dialer[_0xf305('0x1c')][_0xf305('0xd7')]=function(_0x38df3b){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](voiceQueueRt[_0xf305('0xd7')](_0x38df3b))[_0xf305('0xb9')](loggerCatch(_0xf305('0xd8')));};Dialer[_0xf305('0x1c')]['moveContactManagedDialer']=function(_0xd303a0){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopper[_0xf305('0xd9')](_0xd303a0))[_0xf305('0xb9')](loggerCatch(_0xf305('0xda')));};Dialer[_0xf305('0x1c')][_0xf305('0xdb')]=function(_0x4082c6){return BPromise[_0xf305('0xbf')]()[_0xf305('0xc2')](cmHopperHistory[_0xf305('0xdb')](_0x4082c6))['catch'](loggerCatch(_0xf305('0xdc')));};Dialer['prototype'][_0xf305('0xba')]=function(_0x498ecb){if(!_['isUndefined'](_0x498ecb)&&_0x498ecb!==null){if(typeof _0x498ecb[_0xf305('0xa3')]!=='undefined'){if(_0x498ecb[_0xf305('0xa3')]>0x0){_0x498ecb[_0xf305('0xa3')]-=0x1;}else{logger[_0xf305('0xa1')](_0xf305('0xdd'));}}}else{logger[_0xf305('0xa1')](_0xf305('0xde'));}};Dialer[_0xf305('0x1c')]['loggerHandler']=function(_0x513ea9,_0x21c754){var _0x18758d=this;return function(_0x47a330){_0x18758d[_0xf305('0xba')](_0x21c754);logger['error'](_0x513ea9,util[_0xf305('0xa0')](_0x47a330,{'showHidden':![],'depth':null}));};};Dialer[_0xf305('0x1c')][_0xf305('0xdf')]=function(_0x17e102,_0x500b58,_0x2595cf){var _0xf9f19f={'state':0x19,'statedesc':_0xf305('0xe0')};this[_0xf305('0xba')](_0x500b58);this[_0xf305('0xe1')](_[_0xf305('0x99')](_0xf9f19f,_['pick'](_0x2595cf,['ContactId',_0xf305('0xe2'),_0xf305('0xe3'),_0xf305('0xe4'),_0xf305('0xe5')])),_0xf305('0xe6'),_0xf305('0xe7'));logger[_0xf305('0xa1')](_0x17e102);};Dialer[_0xf305('0x1c')][_0xf305('0xe8')]=function(_0x39dde4){return _0x39dde4===_0xf305('0xe9');};Dialer['prototype']['isTrunkReachable']=function(_0x37a4f8){return!_[_0xf305('0x40')](_0x37a4f8)&&_0x37a4f8&&!_[_0xf305('0x40')](_0x37a4f8['name'])&&!_[_0xf305('0x40')](_0x37a4f8['active'])&&_0x37a4f8['active']&&(this['trunks'][util[_0xf305('0x83')]('SIP/%s',_0x37a4f8['name'])][_0xf305('0xb7')]==='reachable'||this['trunks'][util[_0xf305('0x83')](_0xf305('0xea'),_0x37a4f8[_0xf305('0x43')])][_0xf305('0xb7')]===_0xf305('0xeb'));};Dialer['prototype']['saveInDb']=function(_0x511e04,_0x53b6fb,_0x3a9edb){this[_0xf305('0xdb')](_0x511e04)[_0xf305('0xb9')](loggerCatch(_0x53b6fb));this['moveContactManagedDialer'](_0x511e04)[_0xf305('0xb9')](loggerCatch(_0x3a9edb));};Dialer[_0xf305('0x1c')][_0xf305('0xec')]=function(_0x457826){var _0x33f17e=this[_0xf305('0x27')][_0x457826[_0xf305('0xed')]];var _0x2f3466;if(!_[_0xf305('0xb5')](_0x457826)&&!_['isNil'](_0x457826[_0xf305('0xee')])&&!_[_0xf305('0xb5')](_0x457826[_0xf305('0xee')][_0xf305('0xef')])&&_0x457826[_0xf305('0xf0')]===_0xf305('0xf1')&&_0x33f17e){if(_0x33f17e['type']!==_0xf305('0x85')&&this[_0xf305('0x21')][_0x33f17e['queue']]['dialAMDActive']&&_0x457826[_0xf305('0xf2')]===_0xf305('0xf3')){delete this['uniqueId'][_0x457826[_0xf305('0xed')]];this[_0xf305('0xba')](this[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]]);this[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]][_0xf305('0x66')]+=0x1;_0x2f3466=new Hangup(_0x33f17e,_0x457826);_0x2f3466[_0xf305('0xaf')]=0x12;_0x2f3466[_0xf305('0xf4')]=_0xf305('0xf5');_0x2f3466[_0xf305('0xf6')]=_0xf305('0xf7');ami['emit'](_0xf305('0xf8'),ut['buildObj'](_0x2f3466,_0xf305('0xf9')));this[_0xf305('0xe1')](_0x2f3466,_0xf305('0xfa'),_0xf305('0xfb'));}if(_0x33f17e[_0xf305('0x52')]!==_0xf305('0x85')&&this[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]][_0xf305('0xfc')]&&_0x457826[_0xf305('0xf2')]===_0xf305('0xfd')){var _0x4f6fbc=this;return new BPromise(function(_0x1f59b8,_0x5e916d){delete _0x4f6fbc[_0xf305('0x27')][_0x457826['uniqueid']];_0x4f6fbc['updateOriginated'](_0x4f6fbc[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]]);_0x4f6fbc[_0xf305('0x21')][_0x33f17e[_0xf305('0xbc')]][_0xf305('0x67')]+=0x1;_0x4f6fbc[_0xf305('0x21')][_0x33f17e['queue']][_0xf305('0x66')]+=0x1;var _0x534a2a=_0x4f6fbc['voiceQueues'][_0x33f17e[_0xf305('0xbc')]];var _0x190438=new Hangup(_0x33f17e,_0x457826);_0x190438[_0xf305('0xaf')]=0x13;_0x190438[_0xf305('0xf4')]='Machine';_0x190438[_0xf305('0xf6')]=_0xf305('0xf7');_0x190438[_0xf305('0xfe')]+=0x1;_0x190438[_0xf305('0xff')]+=0x1;_0x190438['amd']=!![];ami['emit']('custom:amd',ut[_0xf305('0x100')](_0x190438,_0xf305('0xf9')));_0x4f6fbc[_0xf305('0xdb')](_0x190438)[_0xf305('0xb9')](loggerCatch(_0xf305('0x101')));if(_0x190438[_0xf305('0x102')]+_0x190438[_0xf305('0x103')]+_0x190438[_0xf305('0x104')]+_0x190438[_0xf305('0x105')]+_0x190438[_0xf305('0x106')]+_0x190438[_0xf305('0x107')]+_0x190438[_0xf305('0xfe')]+_0x190438[_0xf305('0x108')]>=_0x534a2a[_0xf305('0x109')]){_0x4f6fbc[_0xf305('0x10a')](_0x190438,_0x1f59b8,_0x5e916d,'reason19\x20machine....');}else{if(_0x190438[_0xf305('0xfe')]>=_0x534a2a[_0xf305('0x10b')]){_0x4f6fbc[_0xf305('0x10c')](_0x190438,_0x1f59b8,_0x5e916d,'reason\x2019\x20machine....');}else{_0x4f6fbc[_0xf305('0xce')]({'active':![],'countmachineretry':_0x190438[_0xf305('0xfe')],'scheduledat':moment()['add'](_0x534a2a[_0xf305('0x10d')],_0xf305('0x10e'))[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x190438[_0xf305('0x110')],'ListId':_0x190438[_0xf305('0xe2')],'VoiceQueueId':_0x190438[_0xf305('0xe4')]||undefined,'CampaignId':_0x190438[_0xf305('0xe5')]||undefined})['catch'](loggerCatch(_0xf305('0x111')));_0x1f59b8({'reschedule':0x1});}}});}if(_0x33f17e[_0xf305('0x52')]===_0xf305('0x85')&&this[_0xf305('0x22')][_0x33f17e['queue']][_0xf305('0xfc')]&&_0x457826[_0xf305('0xf2')]===_0xf305('0xf3')){delete this[_0xf305('0x27')][_0x457826['uniqueid']];this[_0xf305('0xba')](this[_0xf305('0x22')][_0x33f17e[_0xf305('0xbc')]]);_0x2f3466=new Hangup(_0x33f17e,_0x457826);_0x2f3466['state']=0x12;_0x2f3466[_0xf305('0xf4')]=_0xf305('0xf5');_0x2f3466[_0xf305('0xf6')]='AMD';ami[_0xf305('0x51')]('custom:amd',ut[_0xf305('0x100')](_0x2f3466,_0xf305('0xf9')));this[_0xf305('0xe1')](_0x2f3466,_0xf305('0x112'),_0xf305('0x113'));}if(_0x33f17e[_0xf305('0x52')]==='ivr'&&this[_0xf305('0x22')][_0x33f17e[_0xf305('0xbc')]]['dialAMDActive']&&_0x457826[_0xf305('0xf2')]===_0xf305('0xfd')){var _0x4f6fbc=this;return new BPromise(function(_0x2d25b2,_0x4fe435){delete _0x4f6fbc['uniqueId'][_0x457826[_0xf305('0xed')]];_0x4f6fbc[_0xf305('0xba')](_0x4f6fbc[_0xf305('0x22')][_0x33f17e[_0xf305('0xbc')]]);_0x4f6fbc['campaigns'][_0x33f17e[_0xf305('0xbc')]][_0xf305('0x67')]+=0x1;_0x4f6fbc['campaigns'][_0x33f17e[_0xf305('0xbc')]][_0xf305('0x66')]+=0x1;var _0x8ad4cd=_0x4f6fbc[_0xf305('0x22')][_0x33f17e[_0xf305('0xbc')]];var _0x433c31=new Hangup(_0x33f17e,_0x457826);_0x433c31[_0xf305('0xaf')]=0x13;_0x433c31[_0xf305('0xf4')]='Machine';_0x433c31[_0xf305('0xf6')]=_0xf305('0xf7');_0x433c31[_0xf305('0xfe')]+=0x1;_0x433c31[_0xf305('0xff')]+=0x1;_0x433c31[_0xf305('0xf9')]=!![];ami['emit'](_0xf305('0xf8'),ut[_0xf305('0x100')](_0x433c31,_0xf305('0xf9')));_0x4f6fbc[_0xf305('0xdb')](_0x433c31)[_0xf305('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x433c31[_0xf305('0x102')]+_0x433c31[_0xf305('0x103')]+_0x433c31[_0xf305('0x104')]+_0x433c31[_0xf305('0x105')]+_0x433c31[_0xf305('0x106')]+_0x433c31[_0xf305('0x107')]+_0x433c31[_0xf305('0xfe')]+_0x433c31['countagentrejectretry']>=_0x8ad4cd[_0xf305('0x109')]){_0x4f6fbc[_0xf305('0x10a')](_0x433c31,_0x2d25b2,_0x4fe435,_0xf305('0x114'));}else{if(_0x433c31[_0xf305('0xfe')]>=_0x8ad4cd[_0xf305('0x10b')]){_0x4f6fbc[_0xf305('0x10c')](_0x433c31,_0x2d25b2,_0x4fe435,'reason\x2019\x20machine....');}else{_0x4f6fbc['rescheduleContact']({'active':![],'countmachineretry':_0x433c31['countmachineretry'],'scheduledat':moment()['add'](_0x8ad4cd[_0xf305('0x10d')],_0xf305('0x10e'))[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x433c31[_0xf305('0x110')],'ListId':_0x433c31['ListId'],'VoiceQueueId':_0x433c31[_0xf305('0xe4')]||undefined,'CampaignId':_0x433c31[_0xf305('0xe5')]||undefined})['catch'](loggerCatch(_0xf305('0x111')));_0x2d25b2({'reschedule':0x1});}}});}}};Dialer[_0xf305('0x1c')][_0xf305('0x115')]=function(_0x1c7143){var _0x3f7fe2=this[_0xf305('0x27')][_0x1c7143[_0xf305('0xed')]];var _0x5dad66=this;var _0x1b3bcd;if(_0x3f7fe2&&_0x3f7fe2[_0xf305('0x52')]===_0xf305('0x85')){delete this['uniqueId'][_0x1c7143[_0xf305('0xed')]];this[_0xf305('0xba')](this['campaigns'][_0x3f7fe2['queue']]);this['campaigns'][_0x3f7fe2[_0xf305('0xbc')]][_0xf305('0x116')]+=0x1;_0x1b3bcd=new Hangup(_0x3f7fe2,_0x1c7143);this['createHistory'](_0x1b3bcd)['catch'](loggerCatch(_0xf305('0x117')));this[_0xf305('0xd9')](_0x1b3bcd)[_0xf305('0xb9')](loggerCatch(_0xf305('0x118')));}if(_0x3f7fe2&&_0x3f7fe2[_0xf305('0x52')]!==_0xf305('0x85')&&isNotNull(this[_0xf305('0x21')][_0x3f7fe2[_0xf305('0xbc')]][_0xf305('0x119')])){delete this[_0xf305('0x27')][_0x1c7143[_0xf305('0xed')]];this[_0xf305('0xba')](this[_0xf305('0x21')][_0x3f7fe2[_0xf305('0xbc')]]);this[_0xf305('0x21')][_0x3f7fe2[_0xf305('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0xf305('0x21')][_0x3f7fe2['queue']][_0xf305('0x66')]+=0x1;_0x1b3bcd=new Hangup(_0x3f7fe2,_0x1c7143);_0x1b3bcd['state']=0x10;_0x1b3bcd[_0xf305('0xf4')]=_0xf305('0x11a');_0x1b3bcd[_0xf305('0xf6')]=_0xf305('0x11b');this['createHistory'](_0x1b3bcd)[_0xf305('0xb9')](loggerCatch(_0xf305('0x117')));this[_0xf305('0xd9')](_0x1b3bcd)['catch'](loggerCatch(_0xf305('0x118')));}if(_0x3f7fe2&&_0x3f7fe2[_0xf305('0x52')]!=='ivr'&&!isNotNull(this[_0xf305('0x21')][_0x3f7fe2[_0xf305('0xbc')]][_0xf305('0x119')])){delete this[_0xf305('0x27')][_0x1c7143['uniqueid']];this[_0xf305('0xba')](this[_0xf305('0x21')][_0x3f7fe2['queue']]);this[_0xf305('0x21')][_0x3f7fe2['queue']][_0xf305('0x71')]+=0x1;_0x1b3bcd=new Hangup(_0x3f7fe2,_0x1c7143);_0x1b3bcd[_0xf305('0xaf')]=0xc;_0x1b3bcd[_0xf305('0xf4')]=_0x1c7143[_0xf305('0x11c')];_0x1b3bcd[_0xf305('0xf6')]='Unknow';this['createHistory'](_0x1b3bcd)[_0xf305('0xb9')](loggerCatch(_0xf305('0x117')));this['moveContactManagedDialer'](_0x1b3bcd)[_0xf305('0xb9')](loggerCatch(_0xf305('0x118')));}};Dialer[_0xf305('0x1c')][_0xf305('0x36')]=function(_0x3dfa42){var _0x45b35c=this[_0xf305('0x27')][_0x3dfa42['uniqueid']];var _0x3544dd=this;if(this[_0xf305('0x21')][_0x3dfa42[_0xf305('0xbc')]]){if(_0x45b35c&&_0x45b35c[_0xf305('0x52')]!==_0xf305('0x85')){delete this[_0xf305('0x27')][_0x3dfa42['uniqueid']];this[_0xf305('0x21')][_0x3dfa42['queue']][_0xf305('0x67')]+=0x1;var _0x1623e1=new AgentComplete(_0x45b35c,_0x3dfa42);if(_0x3dfa42[_0xf305('0x11d')]===_0xf305('0x11e')){_0x1623e1[_0xf305('0x11f')]=this[_0xf305('0x21')][_0x3dfa42[_0xf305('0xbc')]][_0xf305('0x120')]&&this['voiceQueues'][_0x3dfa42['queue']]['dialAgiAfterHangupAgent']?moment()[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xf305('0xdb')](_0x1623e1)[_0xf305('0xb9')](loggerCatch(_0xf305('0x121')));this['moveContactManagedDialer'](_0x1623e1)[_0xf305('0xb9')](loggerCatch(_0xf305('0x122')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x26526d){if(this[_0xf305('0x21')][_0x26526d['queue']]){if(this[_0xf305('0x27')][_0x26526d[_0xf305('0xed')]]&&this[_0xf305('0x27')][_0x26526d[_0xf305('0xed')]][_0xf305('0x52')]!=='ivr'){this[_0xf305('0xba')](this['voiceQueues'][_0x26526d[_0xf305('0xbc')]]);this[_0xf305('0x27')][_0x26526d[_0xf305('0xed')]][_0xf305('0x123')]=moment()[_0xf305('0x83')](_0xf305('0x10f'));}}};Dialer[_0xf305('0x1c')]['queueCallerAbandonCreateState']=function(_0x3a11d4,_0x5a4bbe){this['createHistory'](_0x3a11d4)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5a4bbe==0x0){this[_0xf305('0xd9')](_0x3a11d4)[_0xf305('0xb9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xf305('0x1c')][_0xf305('0x32')]=function(_0x153eaa){var _0x15dcb1=this[_0xf305('0x27')][_0x153eaa[_0xf305('0xed')]];var _0x4a13b9=this;var _0x3abe0a=![];var _0x486c2b;var _0x443cb9;if(this['voiceQueues'][_0x153eaa['queue']]){if(_0x15dcb1&&_0x15dcb1[_0xf305('0x52')]!==_0xf305('0x85')){delete this[_0xf305('0x27')][_0x153eaa[_0xf305('0xed')]];this[_0xf305('0xba')](this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]]);_0x15dcb1['droptime']=moment()[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss');var _0xbba89f=new QueueCallerAbandon(_0x15dcb1,_0x153eaa);if(getSeconds(_0x15dcb1[_0xf305('0x124')],_0x15dcb1[_0xf305('0x125')])>=_0x15dcb1[_0xf305('0x126')]){this['voiceQueues'][_0x153eaa[_0xf305('0xbc')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xf305('0x21')][_0x153eaa['queue']][_0xf305('0x77')]+=0x1;_0xbba89f['state']=0xa;_0xbba89f[_0xf305('0xf4')]=_0xf305('0x127');_0xbba89f[_0xf305('0x128')]=_0xf305('0x129');_0xbba89f[_0xf305('0x11f')]=this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x120')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xbba89f[_0xf305('0x106')]+=0x1;_0xbba89f[_0xf305('0xff')]+=0x1;_0x486c2b=this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x12a')];_0x443cb9=this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x12b')];_0x4a13b9[_0xf305('0xc4')](_0xbba89f,_0xbba89f['state'],_0x15dcb1[_0xf305('0x12c')])[_0xf305('0xc2')](function(_0x397a70){_0x3abe0a=_0x397a70['additional']==0x1;if(_0xbba89f[_0xf305('0x106')]>=_0x4a13b9['voiceQueues'][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x12d')]){_0x4a13b9[_0xf305('0x12e')](_0xbba89f,_0x397a70[_0xf305('0x12f')]);}else{_0x4a13b9[_0xf305('0xce')]({'active':![],'countdropretry':_0xbba89f[_0xf305('0x106')],'scheduledat':moment()[_0xf305('0x130')](_0x4a13b9[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x12a')],'minutes')[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x15dcb1[_0xf305('0x110')],'ListId':_0x15dcb1[_0xf305('0xe2')],'VoiceQueueId':_0x15dcb1[_0xf305('0xe4')]||undefined,'CampaignId':_0x15dcb1['CampaignId']||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x131')));var _0x173b25=new History(_0xbba89f);_0x173b25[_0xf305('0xaf')]=0xa;_0x173b25['statedesc']='Drop';_0x173b25[_0xf305('0xb0')]=moment()[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss');_0x173b25[_0xf305('0x132')]=_0x173b25['starttime'];_0x173b25[_0xf305('0x133')]=_0xbba89f[_0xf305('0x133')];_0x173b25['calleridnum']=_0xbba89f[_0xf305('0x134')];_0x4a13b9[_0xf305('0xdb')](_0x173b25)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xf305('0xc2')](function(_0x2af7ee){if(_0x3abe0a)_0x4a13b9[_0xf305('0xc5')](_0xbba89f,_0x486c2b,_0x443cb9)[_0xf305('0xc2')](function(_0xbc11b6){return 0x1;});});}else{this[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x74')]+=0x1;this[_0xf305('0x21')][_0x153eaa['queue']][_0xf305('0x6c')]+=0x1;_0xbba89f[_0xf305('0xaf')]=0xb;_0xbba89f[_0xf305('0xf4')]='Abandoned';_0xbba89f[_0xf305('0x128')]='CALLEREXIT';_0xbba89f[_0xf305('0x107')]+=0x1;_0xbba89f[_0xf305('0xff')]+=0x1;_0x486c2b=this['voiceQueues'][_0x153eaa[_0xf305('0xbc')]][_0xf305('0x135')];_0x443cb9=this['voiceQueues'][_0x153eaa['queue']]['callAdditionalPhoneAfterMin'];_0x4a13b9[_0xf305('0xc4')](_0xbba89f,_0xbba89f['state'],_0x15dcb1['voiceQueue'])[_0xf305('0xc2')](function(_0x5d3506){if(_0xbba89f['countabandonedretry']>=_0x4a13b9[_0xf305('0x21')][_0x153eaa[_0xf305('0xbc')]]['dialAbandonedMaxRetry']){_0x4a13b9[_0xf305('0x12e')](_0xbba89f,_0x5d3506[_0xf305('0x12f')]);}else{_0x4a13b9[_0xf305('0xce')]({'active':![],'countabandonedretry':_0xbba89f['countabandonedretry'],'scheduledat':moment()[_0xf305('0x130')](_0x4a13b9[_0xf305('0x21')][_0x153eaa['queue']][_0xf305('0x135')],_0xf305('0x10e'))[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x15dcb1[_0xf305('0x110')],'ListId':_0x15dcb1[_0xf305('0xe2')],'VoiceQueueId':_0x15dcb1[_0xf305('0xe4')]||undefined,'CampaignId':_0x15dcb1[_0xf305('0xe5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0xff2f8b=new History(_0xbba89f);_0xff2f8b[_0xf305('0xaf')]=0xb;_0xff2f8b[_0xf305('0xf4')]=_0xf305('0x136');_0xff2f8b[_0xf305('0xb0')]=moment()['format'](_0xf305('0x10f'));_0xff2f8b[_0xf305('0x132')]=_0xff2f8b[_0xf305('0xb0')];_0xff2f8b[_0xf305('0x133')]=_0xbba89f['calleridname'];_0xff2f8b[_0xf305('0x134')]=_0xbba89f['calleridnum'];_0x4a13b9[_0xf305('0xdb')](_0xff2f8b)[_0xf305('0xb9')](loggerCatch(_0xf305('0x137')));}})['then'](function(_0x32970f){if(_0x3abe0a)_0x4a13b9[_0xf305('0xc5')](_0xbba89f,_0x486c2b,_0x443cb9)[_0xf305('0xc2')](function(_0x3c72dc){return 0x1;});});}}}};Dialer[_0xf305('0x1c')][_0xf305('0x3a')]=function(_0x5742fd){if(this[_0xf305('0x138')][_0x5742fd[_0xf305('0xed')]]){this[_0xf305('0x138')][_0x5742fd[_0xf305('0xed')]][_0xf305('0xb8')]=_0x5742fd[_0xf305('0xb8')];}if(this[_0xf305('0x27')][_0x5742fd[_0xf305('0xed')]]){this[_0xf305('0x27')][_0x5742fd[_0xf305('0xed')]]['channel']=_0x5742fd[_0xf305('0xb8')];}};Dialer[_0xf305('0x1c')]['syncQueueMember']=function(_0x2e5f0e){if(strategy[this[_0xf305('0x21')][this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]][_0xf305('0xbc')]][_0xf305('0x13a')]]==='roundrobin'){if(this[_0xf305('0x138')][_0x2e5f0e['actionid']]&&_['isNil'](this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]][_0xf305('0x13b')])&&_0x2e5f0e[_0xf305('0xb7')]==='1'&&_0x2e5f0e[_0xf305('0x13c')]==='0'){if(this['agents'][_0x2e5f0e['stateinterface']]){if(!this['agents'][_0x2e5f0e['stateinterface']][_0xf305('0x13b')]){this[_0xf305('0x23')][_0x2e5f0e[_0xf305('0x13d')]]['locked']=!![];this['actions'][_0x2e5f0e[_0xf305('0x139')]][_0xf305('0x13b')]=!![];this['actions'][_0x2e5f0e[_0xf305('0x139')]]['stateinterface']=_0x2e5f0e[_0xf305('0x13d')];}}}}else if((strategy[this[_0xf305('0x21')][this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]]['queue']][_0xf305('0x13a')]]||'rrmemory')===_0xf305('0x1a')){if(this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]]){if(this[_0xf305('0x23')][_0x2e5f0e['stateinterface']]){this[_0xf305('0x138')][_0x2e5f0e['actionid']][_0xf305('0x13d')]=_0x2e5f0e[_0xf305('0x13d')];if(_[_0xf305('0xb5')](this['queueBooked'][this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]]['queue']])){this[_0xf305('0x2c')][this['actions'][_0x2e5f0e[_0xf305('0x139')]][_0xf305('0xbc')]]=[];}this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]][_0xf305('0xbc')]][_0xf305('0x13e')](_[_0xf305('0x99')](_[_0xf305('0x13f')](this[_0xf305('0x138')][_0x2e5f0e[_0xf305('0x139')]],['idHopper',_0xf305('0x13d')]),{'status':_0x2e5f0e[_0xf305('0xb7')],'paused':_0x2e5f0e[_0xf305('0x13c')]}));}}}};function unlockQueueStatus(_0x580f64,_0x3aab7d){setTimeout(function(){if(_[_0xf305('0x40')](_0x580f64[_0xf305('0x140')])){loggerBooked[_0xf305('0xa1')](_0xf305('0x141'),_0x3aab7d);}_0x580f64[_0xf305('0x140')]=!![];loggerBooked[_0xf305('0x88')](_0xf305('0x142'),_0x3aab7d,JSON['stringify'](_[_0xf305('0x13f')](_0x580f64,[_0xf305('0x43'),_0xf305('0x140')])));},0x1f3);}Dialer['prototype'][_0xf305('0x3d')]=function(_0x47a17a){var _0x5d8e0f=this;var _0x54008b=_0x5d8e0f[_0xf305('0x21')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xbc')]];if(strategy[this['voiceQueues'][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]][_0xf305('0x13a')]]==='roundrobin'){if(this[_0xf305('0x138')][_0x47a17a['actionid']]&&this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0x13d')]){this[_0xf305('0x20')][_0xf305('0x143')](this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0x144')],this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0x13d')])[_0xf305('0xb9')](function(_0x79dda1){logger[_0xf305('0xa1')](_0xf305('0x145'),util[_0xf305('0xa0')](_0x79dda1,{'showHidden':![],'depth':null}));})[_0xf305('0x1e')](function(){_0x5d8e0f[_0xf305('0xba')](_0x5d8e0f[_0xf305('0x21')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);_0x5d8e0f[_0xf305('0x23')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]]['stateinterface']][_0xf305('0x13b')]=![];delete _0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]];unlockQueueStatus(_0x54008b);});}else{this[_0xf305('0xba')](this[_0xf305('0x21')][this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);this[_0xf305('0xce')]({'active':![],'ContactId':this[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0x110')],'ListId':this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe2')],'VoiceQueueId':this[_0xf305('0x138')][_0x47a17a['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x146')));delete this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]];unlockQueueStatus(_0x54008b);}}else if((strategy[this[_0xf305('0x21')][this[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xbc')]]['strategy']]||_0xf305('0x1a'))===_0xf305('0x1a')){var _0x44af0a;if(this['actions'][_0x47a17a[_0xf305('0x139')]]&&!_['isEmpty'](this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]])){if(this['queueBookedRR'][_0x5d8e0f[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xbc')]]){this[_0xf305('0x2d')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]]['queue']]=this[_0xf305('0x2d')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]?this[_0xf305('0x2d')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]:this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]?this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]]['queue']][_0xf305('0x147')]||0x0:0x0;}this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]][_0xf305('0x147')]=this[_0xf305('0x2d')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]];for(var _0x159f9d=0x0;_0x159f9d<this['queueBooked'][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]['length'];_0x159f9d+=0x1){_0x44af0a=rr(this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);this[_0xf305('0x2d')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]=this[_0xf305('0x2c')][this[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xbc')]]['_rr'];if(_0x44af0a[_0xf305('0xb7')]==='1'&&_0x44af0a[_0xf305('0x13c')]==='0'){break;}}if(!_['isNil'](_0x44af0a)){this[_0xf305('0x23')][_0x44af0a[_0xf305('0x13d')]][_0xf305('0x148')]=_[_0xf305('0x40')](this['agents'][_0x44af0a[_0xf305('0x13d')]][_0xf305('0x148')])?!![]:this[_0xf305('0x23')][_0x44af0a[_0xf305('0x13d')]][_0xf305('0x148')];}loggerBooked['info'](_0xf305('0x149'),_0x47a17a[_0xf305('0x139')],_0xf305('0x14a'),JSON['stringify'](_[_0xf305('0x13f')](this[_0xf305('0x23')][_0x44af0a[_0xf305('0x13d')]],[_0xf305('0x43'),'unlockRR'])),_0xf305('0x14b'),JSON['stringify'](_0x44af0a[_0xf305('0x144')]));if(!_[_0xf305('0xb5')](_0x44af0a)&&_0x44af0a['status']==='1'&&_0x44af0a[_0xf305('0x13c')]==='0'&&this[_0xf305('0x23')][_0x44af0a['stateinterface']]['unlockRR']){this['agents'][_0x44af0a[_0xf305('0x13d')]][_0xf305('0x148')]=![];this[_0xf305('0x2c')][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]=[];this[_0xf305('0x20')][_0xf305('0x143')](_0x44af0a['idHopper'],_0x44af0a[_0xf305('0x13d')])[_0xf305('0xb9')](function(_0xdaf1ef){logger[_0xf305('0xa1')](_0xf305('0x145'),util[_0xf305('0xa0')](_0xdaf1ef,{'showHidden':![],'depth':null}));})[_0xf305('0x1e')](function(){_0x5d8e0f[_0xf305('0xba')](_0x5d8e0f['voiceQueues'][_0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);setTimeout(function(){_0x5d8e0f[_0xf305('0x23')][_0x44af0a[_0xf305('0x13d')]][_0xf305('0x148')]=!![];loggerBooked[_0xf305('0x88')](_0xf305('0x14c'),_0x47a17a[_0xf305('0x139')],_0xf305('0x14a'),JSON[_0xf305('0x4d')](_['pick'](_0x5d8e0f[_0xf305('0x23')][_0x44af0a[_0xf305('0x13d')]],[_0xf305('0x43'),_0xf305('0x148')])),_0xf305('0x14b'),JSON['stringify'](_0x44af0a[_0xf305('0x144')]));},0xc7);delete _0x5d8e0f[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]];unlockQueueStatus(_0x54008b,_0x47a17a[_0xf305('0x139')]);});}else{loggerBooked[_0xf305('0x88')](_0xf305('0x14d'));this[_0xf305('0xba')](this[_0xf305('0x21')][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);this[_0xf305('0xce')]({'active':![],'ContactId':this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0x110')],'ListId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]]['ListId'],'VoiceQueueId':this[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xe4')]||undefined,'CampaignId':this['actions'][_0x47a17a['actionid']]['CampaignId']||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x146')));delete this[_0xf305('0x138')][_0x47a17a['actionid']];unlockQueueStatus(_0x54008b);}}else{loggerBooked[_0xf305('0x88')](_0xf305('0x14e'));this[_0xf305('0xba')](this['voiceQueues'][this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xbc')]]);this[_0xf305('0xce')]({'active':![],'ContactId':this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0x110')],'ListId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe2')],'VoiceQueueId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe4')]||undefined,'CampaignId':this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x14f')));delete this[_0xf305('0x138')][_0x47a17a['actionid']];unlockQueueStatus(_0x54008b);}}else{loggerBooked[_0xf305('0x88')](_0xf305('0x150'));this[_0xf305('0xba')](this['voiceQueues'][this['actions'][_0x47a17a['actionid']]['queue']]);this[_0xf305('0xce')]({'active':![],'ContactId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]][_0xf305('0x110')],'ListId':this[_0xf305('0x138')][_0x47a17a['actionid']][_0xf305('0xe2')],'VoiceQueueId':this[_0xf305('0x138')][_0x47a17a[_0xf305('0x139')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x47a17a[_0xf305('0x139')]][_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x151')));delete this['actions'][_0x47a17a[_0xf305('0x139')]];unlockQueueStatus(_0x54008b);}};Dialer[_0xf305('0x1c')][_0xf305('0x3e')]=function(){var _0x221d0c=this;setInterval(function(){_0x221d0c[_0xf305('0x152')]();},0x3e8);};Dialer[_0xf305('0x1c')][_0xf305('0x153')]=function(_0x47e834){var _0x237b3f=this;return function(){if(!_0x237b3f[_0xf305('0x154')](_0x47e834[_0xf305('0x80')])){if(!_0x237b3f[_0xf305('0x154')](_0x47e834[_0xf305('0x155')])){_0x47e834['message']=_0xf305('0x156');throw _0x47e834[_0xf305('0x43')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xf305('0x1c')][_0xf305('0x157')]=function(_0x18cbca,_0x3ee52c,_0x47ac91,_0x13069d){var _0x3378a=this;return function(){var _0x37ea86=!![];return _0x3378a[_0xf305('0x158')](_0x18cbca,_0x3ee52c,_0x47ac91,_0x13069d,_0x37ea86);};};Dialer[_0xf305('0x1c')][_0xf305('0x159')]=function(_0x1cbefc,_0x228172,_0x16a183,_0x51f249){var _0x38e341=this;return function(){var _0x51d8f7=![];return _0x38e341[_0xf305('0x158')](_0x1cbefc[_0xf305('0x47')],_0x228172,_0x16a183,_0x51f249,_0x51d8f7);};};Dialer[_0xf305('0x1c')][_0xf305('0x158')]=function(_0xb6f7a1,_0x4e3b3c,_0xc33cc2,_0x42cc0d,_0x3db07f){var _0x27314a=[];return new BPromise(function(_0x3db7d6,_0x2594cb){if(!isNotNull(_0xb6f7a1)){_0x42cc0d[_0xf305('0x41')]='INTERVAL_IS_NULL';return _0x2594cb(msgResponse(_0xf305('0x158'),_0xf305('0x15a'),_0xc33cc2+_0xf305('0x15b')));}if(_['isEmpty'](_0xb6f7a1)){_0x42cc0d[_0xf305('0x41')]=_0xf305('0x15c');return _0x2594cb(msgResponse('ifTime',_0xf305('0x15a'),_0xc33cc2+_0xf305('0x15d')));}if(_0x4e3b3c&&_[_0xf305('0x40')](config[_0xf305('0x15e')][_0x4e3b3c])){_0x42cc0d[_0xf305('0x41')]='TIMEZONE_UNKNOW';return _0x2594cb(msgResponse(_0xf305('0x158'),'Failure',_0xc33cc2+'\x20Timezone\x20unknow\x20'+_0x4e3b3c));}if(_[_0xf305('0x15f')](_0xb6f7a1)){for(var _0x2812a1=0x0;_0x2812a1<_0xb6f7a1[_0xf305('0xa2')];_0x2812a1+=0x1){_0x27314a[_0xf305('0x13e')](ami['Action']({'action':_0xf305('0x160'),'command':util[_0xf305('0x83')]('iftime\x20%s,%s',_0xb6f7a1[_0x2812a1][_0xf305('0x161')],!_[_0xf305('0x40')](config[_0xf305('0x15e')][_0x4e3b3c])?_0x4e3b3c:'')})['then'](function(_0xd1eb){return _0xd1eb[_0xf305('0x162')]['indexOf'](_0xf305('0x163'))>=0x0;})[_0xf305('0xb9')](myreject(_0x2594cb)));}}else{_0x27314a[_0xf305('0x13e')](ami[_0xf305('0xb6')]({'action':_0xf305('0x160'),'command':util[_0xf305('0x83')]('iftime\x20%s,%s',_0xb6f7a1,!_['isUndefined'](config[_0xf305('0x15e')][_0x4e3b3c])?_0x4e3b3c:'')})[_0xf305('0xc2')](function(_0x580ec4){return _0x580ec4[_0xf305('0x162')][_0xf305('0x164')](_0xf305('0x163'))>=0x0;})[_0xf305('0xb9')](myreject(_0x2594cb)));}BPromise[_0xf305('0x165')](_0x27314a)['then'](function(_0x4f1d6c){var _0x9e662e=_[_0xf305('0x166')](_0x4f1d6c);if(_0x9e662e){return _0x3db7d6(_0x9e662e);}else{_0x42cc0d['message']=_0x3db07f?_0xf305('0x167'):_0xf305('0x168');return _0x2594cb(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x3db07f+'\x20'+_0xc33cc2+'\x20Interval\x20is\x20overtime:\x20'+util[_0xf305('0xa0')](_0xb6f7a1,{'showHidden':![],'depth':null})+_0xf305('0x169')+_0x4e3b3c));}})[_0xf305('0xb9')](function(_0x302035){return _0x2594cb(msgResponse(_0xf305('0x158'),_0xf305('0x15a'),JSON[_0xf305('0x4d')](_0x302035)));});});};Dialer[_0xf305('0x1c')][_0xf305('0x16a')]=function(_0x26f9c0){var _0xe3c0d6=this;return function(){switch(_0x26f9c0[_0xf305('0x61')]){case _0xf305('0x16b'):freeVariablesPredictive(_0x26f9c0);_0xe3c0d6[_0xf305('0x16c')](_0x26f9c0,0x1);break;case _0xf305('0x16d'):freeVariablesPredictive(_0x26f9c0);_0xe3c0d6[_0xf305('0x16c')](_0x26f9c0,_0x26f9c0[_0xf305('0x16e')]);break;case _0xf305('0x16f'):_0xe3c0d6['predictive'](_0x26f9c0);break;case _0xf305('0x8'):freeVariablesPredictive(_0x26f9c0);_0xe3c0d6['handlePower'](_0x26f9c0,0x1);break;default:freeVariablesPredictive(_0x26f9c0);logger[_0xf305('0xa1')]('Queue',_0x26f9c0[_0xf305('0x43')],_0xf305('0x170'));}};};Dialer[_0xf305('0x1c')][_0xf305('0x171')]=function(_0x3bff7){var _0x1402e2=this;return function(){_0x1402e2[_0xf305('0x172')](_0x3bff7);};};Dialer[_0xf305('0x1c')][_0xf305('0xa')]=function(_0x5afbf7){var _0x1ab570=this;if(isNotPreview(_0x5afbf7['dialMethod'])){if(isVoiceQueueOutbound(_0x5afbf7[_0xf305('0x52')])&&isActive(_0x5afbf7[_0xf305('0x60')])){_0x5afbf7['sendMessageOneNotActive']=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x5afbf7,_0x5afbf7[_0xf305('0x56')]))['then'](checkIsActive(_0x5afbf7,_0x5afbf7[_0xf305('0x60')]))[_0xf305('0xc2')](checkInterval(_0x5afbf7))[_0xf305('0xc2')](_0x1ab570[_0xf305('0x153')](_0x5afbf7))['then'](_0x1ab570[_0xf305('0x157')](_0x5afbf7[_0xf305('0x173')],_0x5afbf7[_0xf305('0x174')],_0x5afbf7['name'],_0x5afbf7))[_0xf305('0xc2')](_0x1ab570[_0xf305('0x159')](_0x5afbf7[_0xf305('0x4b')],_0x5afbf7['dialTimezone'],_0x5afbf7[_0xf305('0x43')],_0x5afbf7))[_0xf305('0xc2')](_0x1ab570['checkDialMethod'](_0x5afbf7))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x5afbf7));}else{notSendMessagesQueue(_0x5afbf7);}}else{freeVariablesPredictive(_0x5afbf7);}};Dialer[_0xf305('0x1c')][_0xf305('0x152')]=function(){var _0x253797=this;var _0x162a33;for(var _0x3e1175 in this[_0xf305('0x22')]){if(typeof this[_0xf305('0x22')][_0x3e1175]!==_0xf305('0xb4')){_0x162a33=this[_0xf305('0x22')][_0x3e1175];if(isCampaignIvr(_0x162a33[_0xf305('0x52')])&&isActive(_0x162a33[_0xf305('0x81')])){_0x162a33[_0xf305('0xaa')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x162a33,_0x162a33['active']))[_0xf305('0xc2')](checkInterval(_0x162a33))[_0xf305('0xc2')](_0x253797[_0xf305('0x153')](_0x162a33))[_0xf305('0xc2')](_0x253797[_0xf305('0x157')](_0x162a33['dialGlobalInterval'],_0x162a33[_0xf305('0x174')],_0x162a33['name'],_0x162a33))[_0xf305('0xc2')](_0x253797[_0xf305('0x159')](_0x162a33['Interval'],_0x162a33['dialTimezone'],_0x162a33[_0xf305('0x43')],_0x162a33))[_0xf305('0xc2')](_0x253797[_0xf305('0x171')](_0x162a33))['catch'](loggerCatchQueueSummary(_0xf305('0x175'),_0x162a33));}else{notSendMessagesCampaign(_0x162a33);}}}};function getCallerIdRandom(_0x1cf26e,_0x125366){var _0x18213f;var _0x34494d;var _0x45ec3c;if(_0x125366<=0x0){_0x125366=0x1;}_0x18213f=new RegExp('\x5cw{0,'+_0x125366+'}$');_0x34494d=Math[_0xf305('0x176')](0xa,_0x125366-0x1);_0x45ec3c=Math[_0xf305('0x176')](0xa,_0x125366)-0x1;return util['format']('%s',_[_0xf305('0x177')](_0x1cf26e,_0x18213f,_[_0xf305('0x178')](_0x34494d,_0x45ec3c)));}function extractCalleridName(_0x458f96){var _0x4c09cb=_0x458f96[_0xf305('0x179')](/"(.*?)"/);return _0x4c09cb?_0x4c09cb[0x1]:_0x458f96;}function extractCalleridNumber(_0x346cf1){var _0x3230b9=_0x346cf1[_0xf305('0x179')](/<(.*?)>/);return _0x3230b9?_0x3230b9[0x1]:_0x346cf1;}Dialer[_0xf305('0x1c')][_0xf305('0x17a')]=function(_0x47dca4,_0x4a3a71){var _0x4400bc=this;var _0x5d772f=uuid['v4']();this[_0xf305('0x138')][_0x5d772f]=new Action(_0x47dca4,_0x4a3a71,_0x5d772f);return new BPromise(function(_0x3a7843,_0x79f98e){if(_[_0xf305('0x40')](_0x47dca4)&&typeof _0x47dca4!==_0xf305('0x17b')){return _0x79f98e(msgResponse('originate','Failure',_0xf305('0x17c')));}if(_[_0xf305('0x40')](_0x4a3a71['phone'])||_0x4a3a71[_0xf305('0x17d')]===null){return _0x79f98e(msgResponse(_0xf305('0x17e'),'Failure','contact\x20is\x20undefine'));}var _0x2d55b6={'XMD-CALLERID':_0x4400bc[_0xf305('0x138')][_0x5d772f][_0xf305('0x17f')](),'XMD-AGI':_0x47dca4[_0xf305('0x119')]?util[_0xf305('0x83')](_0xf305('0x180'),ipAgi,_0x47dca4[_0xf305('0x119')]):_0xf305('0x181'),'XMD-AGIAFTER':_0x47dca4['dialQueueProject2']?util['format'](_0xf305('0x180'),ipAgi,_0x47dca4[_0xf305('0x120')]):_0xf305('0x181'),'XMD-QUEUE':_0x47dca4[_0xf305('0x52')]===_0xf305('0x53')?util['format']('\x22%s,%s%s,,,%s\x22',_0x47dca4['name'],_0x47dca4[_0xf305('0x182')]||'',_0x47dca4[_0xf305('0x183')]?'c':'',_0x47dca4[_0xf305('0x126')]||0x3):_0xf305('0x181'),'XMD-CONTACTID':_0x4a3a71[_0xf305('0x110')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4400bc[_0xf305('0x138')][_0x5d772f][_0xf305('0x17f')](),'XMD-AMD':_0x47dca4[_0xf305('0xfc')]?_0xf305('0x184'):_0xf305('0x181'),'XMD-DESTINATION':_0xf305('0xf1')};if(_0x47dca4['dialAMDActive']){_0x2d55b6['XMD-AMDINITIALSILENCE']=_0x47dca4['dialAMDInitialSilence']||0x9c4;_0x2d55b6[_0xf305('0x185')]=_0x47dca4['dialAMDGreeting']||0x5dc;_0x2d55b6['XMD-AMDAFTERGREETINGSILENCE']=_0x47dca4[_0xf305('0x186')]||0x320;_0x2d55b6['XMD-AMDTOTALANALYSISTIME']=_0x47dca4[_0xf305('0x187')]||0x1388;_0x2d55b6[_0xf305('0x188')]=_0x47dca4['dialAMDMinWordLength']||0x64;_0x2d55b6[_0xf305('0x189')]=_0x47dca4[_0xf305('0x18a')]||0x32;_0x2d55b6[_0xf305('0x18b')]=_0x47dca4[_0xf305('0x18c')]||0x3;_0x2d55b6[_0xf305('0x18d')]=_0x47dca4[_0xf305('0x18e')]||0x100;_0x2d55b6[_0xf305('0x18f')]=_0x47dca4['dialAMDMaximumWordLength']||0x1388;}if(_0x47dca4['type']===_0xf305('0x53')){_0x2d55b6[_0xf305('0x190')]=_0x4a3a71[_0xf305('0xe4')];}else{_0x2d55b6[_0xf305('0x191')]=_0x4a3a71[_0xf305('0xe5')];}for(var _0x64f132 in _0x4a3a71['Contact']){if(typeof _0x4a3a71['Contact'][_0x64f132]!==_0xf305('0xb4')){if(isNotNull(_0x4a3a71[_0xf305('0x192')][_0x64f132])&&_0x64f132!=='id'&&_0x64f132!==_0xf305('0x193')&&_0x64f132!==_0xf305('0x194')&&_0x64f132!==_0xf305('0x195')){_0x2d55b6[util[_0xf305('0x83')](_0xf305('0x196'),'XMD-',_[_0xf305('0x197')](_0x64f132))]=_0x4a3a71[_0xf305('0x192')][_0x64f132];}}}var _0x24b6f9=_0x4400bc[_0xf305('0x154')](_0x47dca4[_0xf305('0x80')])?getCallerId(_0x47dca4[_0xf305('0x80')]['callerid'],_0x47dca4[_0xf305('0x62')],_0x47dca4[_0xf305('0x198')]>0x0?getCallerIdRandom(_0x47dca4['dialOriginateCallerIdNumber'],_0x47dca4[_0xf305('0x198')]):_0x47dca4['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x47dca4[_0xf305('0x155')])?_0x47dca4[_0xf305('0x80')][_0xf305('0x82')]:_0x47dca4[_0xf305('0x155')]['callerid'],_0x47dca4['dialOriginateCallerIdName'],_0x47dca4[_0xf305('0x198')]>0x0?getCallerIdRandom(_0x47dca4[_0xf305('0x63')],_0x47dca4[_0xf305('0x198')]):_0x47dca4['dialOriginateCallerIdNumber']);if(_0x24b6f9){_0x2d55b6[_0xf305('0x199')]=_0x4400bc['actions'][_0x5d772f]['originatecalleridname']=extractCalleridName(_0x24b6f9);_0x2d55b6[_0xf305('0x19a')]=_0x4a3a71[_0xf305('0x17d')];}return ami[_0xf305('0xb6')]({'actionid':_0x5d772f,'action':_0xf305('0x17e'),'channel':_0x4400bc[_0xf305('0x154')](_0x47dca4['Trunk'])?util[_0xf305('0x83')](_0xf305('0x19b'),_0x47dca4[_0xf305('0x80')][_0xf305('0x43')],isNotNull(_0x47dca4[_0xf305('0x65')])?_0x47dca4['dialPrefix'][_0xf305('0x19c')]()||'':'',_0x47dca4[_0xf305('0x19d')]>0x0?_0x4a3a71[_0xf305('0x17d')][_0xf305('0x19e')](_0x47dca4[_0xf305('0x19d')]):_0x4a3a71[_0xf305('0x17d')]):util[_0xf305('0x83')]('SIP/%s/%s%s',_[_0xf305('0xb5')](_0x47dca4[_0xf305('0x155')])?_0x47dca4[_0xf305('0x80')][_0xf305('0x43')]:_0x47dca4[_0xf305('0x155')][_0xf305('0x43')],isNotNull(_0x47dca4['dialPrefix'])?_0x47dca4[_0xf305('0x65')][_0xf305('0x19c')]()||'':'',_0x47dca4['dialCutDigit']>0x0?_0x4a3a71[_0xf305('0x17d')][_0xf305('0x19e')](_0x47dca4[_0xf305('0x19d')]):_0x4a3a71[_0xf305('0x17d')]),'callerid':_0x24b6f9,'Exten':_0xf305('0xf1'),'Context':_0xf305('0x19f'),'Priority':'1','variable':_0x2d55b6,'timeout':(_0x47dca4[_0xf305('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5d772f})['then'](function(_0x109abd){return _0x3a7843(_0x109abd);})['catch'](function(_0x11d443){_0x47dca4[_0xf305('0x70')]+=0x1;var _0x22e86d=new History(_0x4400bc[_0xf305('0x138')][_0x5d772f]);logger[_0xf305('0xa1')](util[_0xf305('0x83')]('[originateError]:\x20%s',JSON[_0xf305('0x4d')](_0x11d443)));_0x22e86d[_0xf305('0xaf')]=0xe;_0x22e86d[_0xf305('0xf4')]=_0xf305('0x1a0');_0x22e86d['starttime']=moment()['format'](_0xf305('0x10f'));_0x22e86d[_0xf305('0x132')]=_0x22e86d[_0xf305('0xb0')];_0x4400bc['createHistory'](_0x22e86d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1a1')));_0x4400bc['moveContactManagedDialer'](_0x22e86d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1a1')))[_0xf305('0x1e')](function(){delete _0x4400bc['actions'][_0x5d772f];return _0x79f98e(msgResponse(_0xf305('0x17e'),'Error',_0xf305('0x1a2')));});});});};Dialer[_0xf305('0x1c')]['syncOriginateResponse']=function(_0x1e83b0){var _0x9dd960=this[_0xf305('0x138')][_0x1e83b0[_0xf305('0x139')]];if(_0x9dd960){delete this[_0xf305('0x138')][_0x1e83b0[_0xf305('0x139')]];_0x9dd960[_0xf305('0x125')]=moment()['format'](_0xf305('0x10f'));var _0x55f560=_0x9dd960[_0xf305('0x52')]===_0xf305('0x85')?this[_0xf305('0x22')][_0x9dd960[_0xf305('0xbc')]]:this[_0xf305('0x21')][_0x9dd960[_0xf305('0x1a3')]()];if(!this[_0xf305('0xe8')](_0x1e83b0[_0xf305('0x1a4')])){this[_0xf305('0xba')](_0x55f560);return this[_0xf305('0x1a5')](_0x9dd960,_0x55f560,_0x1e83b0)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1a6')));}this[_0xf305('0x27')][_0x1e83b0[_0xf305('0xed')]]=_0x9dd960;}};Dialer[_0xf305('0x1c')][_0xf305('0x1a7')]=function(_0x1cd197,_0x244e50,_0x122570){var _0x4c208e=new History(_0x244e50);if(_0x4c208e[_0xf305('0x102')]+_0x4c208e['countcongestionretry']+_0x4c208e[_0xf305('0x104')]+_0x4c208e['countnosuchnumberretry']+_0x4c208e[_0xf305('0x106')]+_0x4c208e[_0xf305('0x107')]+_0x4c208e[_0xf305('0xfe')]+_0x4c208e[_0xf305('0x108')]>=_0x122570[_0xf305('0x109')]-0x1){return!![];}switch(_0x1cd197){case 0x3:if(_0x4c208e[_0xf305('0x104')]>=_0x122570[_0xf305('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4c208e[_0xf305('0x104')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x1a9')],_0xf305('0x10e'))[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x4c208e[_0xf305('0x110')],'ListId':_0x4c208e[_0xf305('0xe2')],'VoiceQueueId':_0x4c208e['VoiceQueueId']||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})['catch'](loggerCatch(_0xf305('0x1aa')));break;case 0x5:if(_0x4c208e[_0xf305('0x102')]>=_0x122570[_0xf305('0x1ab')]-0x1){return!![];}this[_0xf305('0xce')]({'active':![],'countbusyretry':_0x4c208e[_0xf305('0x102')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x1ac')],'minutes')['format'](_0xf305('0x10f')),'ContactId':_0x4c208e['ContactId'],'ListId':_0x4c208e['ListId'],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x1ad')));break;case 0x8:if(_0x4c208e['countcongestionretry']>=_0x122570[_0xf305('0x1ae')]-0x1){return!![];}this[_0xf305('0xce')]({'active':![],'countcongestionretry':_0x4c208e[_0xf305('0x103')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x1af')],_0xf305('0x10e'))[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c208e['ContactId'],'ListId':_0x4c208e['ListId'],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e['CampaignId']||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x1b0')));break;case 0x0:if(_0x4c208e[_0xf305('0x105')]>=_0x122570[_0xf305('0x1b1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4c208e[_0xf305('0x105')]+=0x1,'scheduledat':moment()['add'](_0x122570[_0xf305('0x1b2')],_0xf305('0x10e'))[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x4c208e['ContactId'],'ListId':_0x4c208e['ListId'],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})['catch'](loggerCatch(_0xf305('0x1b3')));}break;case 0xa:if(_0x4c208e[_0xf305('0x106')]>=_0x122570[_0xf305('0x12d')]-0x1){return!![];}this[_0xf305('0xce')]({'active':![],'countdropretry':_0x4c208e[_0xf305('0x106')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x12a')],_0xf305('0x10e'))['format'](_0xf305('0x10f')),'ContactId':_0x4c208e[_0xf305('0x110')],'ListId':_0x4c208e[_0xf305('0xe2')],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e['CampaignId']||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x131')));break;case 0xb:if(_0x4c208e[_0xf305('0x107')]>=_0x122570[_0xf305('0x1b4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x4c208e[_0xf305('0x107')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x135')],'minutes')[_0xf305('0x83')](_0xf305('0x10f')),'ContactId':_0x4c208e['ContactId'],'ListId':_0x4c208e[_0xf305('0xe2')],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})['catch'](loggerCatch(_0xf305('0x1b5')));break;case 0x13:if(_0x4c208e[_0xf305('0xfe')]>=_0x122570[_0xf305('0x10b')]-0x1){return!![];}this[_0xf305('0xce')]({'active':![],'countmachineretry':_0x4c208e[_0xf305('0xfe')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x10d')],_0xf305('0x10e'))[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c208e[_0xf305('0x110')],'ListId':_0x4c208e[_0xf305('0xe2')],'VoiceQueueId':_0x4c208e[_0xf305('0xe4')]||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x111')));break;case 0x14:if(_0x4c208e[_0xf305('0x108')]>=_0x122570[_0xf305('0x1b6')]-0x1){return!![];}this[_0xf305('0xce')]({'active':![],'countagentrejectretry':_0x4c208e[_0xf305('0x108')]+=0x1,'scheduledat':moment()[_0xf305('0x130')](_0x122570[_0xf305('0x1b7')],'minutes')['format'](_0xf305('0x10f')),'ContactId':_0x4c208e[_0xf305('0x110')],'ListId':_0x4c208e[_0xf305('0xe2')],'VoiceQueueId':_0x4c208e['VoiceQueueId']||undefined,'CampaignId':_0x4c208e[_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch(_0xf305('0x1b8')));break;default:return!![];}};Dialer[_0xf305('0x1c')]['callProgressDetecting']=function(_0x2ce43b,_0x4d2f9b,_0xbf5216){var _0x4db64c=this;var _0x2f1b4d=new History(_0x2ce43b);var _0x59a561=![];var _0x5e3ddc;var _0x1daf36;return new BPromise(function(_0x4da506,_0x29d40d){if(_[_0xf305('0x40')](_0x4d2f9b)&&typeof _0x4d2f9b!=='object'){return _0x29d40d(msgResponse(_0xf305('0x1b9'),_0xf305('0x15a'),_0xf305('0x1ba')));}if(_[_0xf305('0x40')](_0xbf5216)&&typeof _0xbf5216!==_0xf305('0x17b')){return _0x29d40d(msgResponse(_0xf305('0x1b9'),_0xf305('0x15a'),'evt\x20is\x20undefine'));}_0x4db64c['verifyAdditionalPhones'](_0x2f1b4d,_0xbf5216[_0xf305('0x11d')],_0x4d2f9b)[_0xf305('0xc2')](function(_0xf4d459){if(_0xf4d459[_0xf305('0x12f')]==0x1)_0x59a561=!![];switch(_0xbf5216['reason']){case'0':_0x4d2f9b[_0xf305('0x6f')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0x0;_0x2f1b4d[_0xf305('0xf4')]=_0xf305('0x1bb');_0x2f1b4d[_0xf305('0x105')]+=0x1;_0x2f1b4d[_0xf305('0xff')]+=0x1;ami['emit'](_0xf305('0x1bc'),ut['buildObj'](_0x2ce43b,_0xf305('0x1bd')));_0x5e3ddc=_0x4d2f9b[_0xf305('0x1b2')];_0x1daf36=_0x4d2f9b[_0xf305('0x12b')];_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x101')));if(_0x4db64c[_0xf305('0x1a7')](0x0,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d[_0xf305('0x105')]>=_0x4d2f9b[_0xf305('0x1b1')]){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1be'));}else{_0x4db64c['stateGlobal'](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1be'));}}break;case'3':_0x4d2f9b['outboundNoAnswerCallsDay']+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0x3;_0x2f1b4d['statedesc']=_0xf305('0x1bf');_0x2f1b4d[_0xf305('0x104')]+=0x1;_0x2f1b4d[_0xf305('0xff')]+=0x1;ami[_0xf305('0x51')](_0xf305('0x1c0'),ut[_0xf305('0x100')](_0x2ce43b,'noanswer'));_0x5e3ddc=_0x4d2f9b[_0xf305('0x1a9')];_0x1daf36=_0x4d2f9b[_0xf305('0x12b')];_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4db64c['checkRetriveMax'](0x3,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d[_0xf305('0x104')]>=_0x4d2f9b[_0xf305('0x1a8')]){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4db64c[_0xf305('0x10a')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1c1'));}}break;case'5':_0x4d2f9b[_0xf305('0x69')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0x5;_0x2f1b4d['statedesc']=_0xf305('0x1c2');_0x2f1b4d[_0xf305('0x102')]+=0x1;_0x2f1b4d[_0xf305('0xff')]+=0x1;ami[_0xf305('0x51')](_0xf305('0x1c3'),ut[_0xf305('0x100')](_0x2ce43b,_0xf305('0x1c4')));console['log'](_0xf305('0x1c5'));_0x5e3ddc=_0x4d2f9b['dialBusyRetryFrequency'];_0x1daf36=_0x4d2f9b[_0xf305('0x12b')];_0x4db64c['createHistory'](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1c6')));if(_0x4db64c[_0xf305('0x1a7')](0x5,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d['countbusyretry']>=_0x4d2f9b['dialBusyMaxRetry']){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1c7'));}else{_0x4db64c['stateGlobal'](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1c7'));}}break;case'8':_0x4d2f9b[_0xf305('0x6a')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0x8;_0x2f1b4d[_0xf305('0xf4')]=_0xf305('0x1c8');_0x2f1b4d[_0xf305('0x103')]+=0x1;_0x2f1b4d[_0xf305('0xff')]+=0x1;_0x5e3ddc=_0x4d2f9b[_0xf305('0x1af')];_0x1daf36=_0x4d2f9b[_0xf305('0x12b')];ami['emit'](_0xf305('0x1c9'),ut[_0xf305('0x100')](_0x2ce43b,_0xf305('0x1ca')));_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));console[_0xf305('0xc6')](_0xf305('0x1cb'));if(_0x4db64c['checkRetriveMax'](0x8,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d[_0xf305('0x103')]>=_0x4d2f9b['dialCongestionMaxRetry']){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1cc'));}else{_0x4db64c[_0xf305('0x10a')](_0x2f1b4d,_0x4da506,_0x29d40d,'reason\x208\x20congestion');}}break;case'11':_0x4d2f9b[_0xf305('0x1cd')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0xb;_0x2f1b4d[_0xf305('0xf4')]=_0xf305('0x136');_0x2f1b4d[_0xf305('0x107')]+=0x1;_0x2f1b4d['countglobal']+=0x1;_0x5e3ddc=_0x4d2f9b[_0xf305('0x135')];_0x1daf36=_0x4d2f9b['callAdditionalPhoneAfterMin'];_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x137')));if(_0x4db64c['checkRetriveMax'](0xb,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d[_0xf305('0x107')]>=_0x4d2f9b[_0xf305('0x1b4')]){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1ce'));}else{_0x4db64c[_0xf305('0x10a')](_0x2f1b4d,_0x4da506,_0x29d40d,'reason\x2011\x20abandoned');}}break;case'20':_0x4d2f9b[_0xf305('0x1cf')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0x14;_0x2f1b4d['statedesc']=_0xf305('0x1d0');_0x2f1b4d[_0xf305('0x108')]+=0x1;_0x2f1b4d[_0xf305('0xff')]+=0x1;_0x5e3ddc=_0x4d2f9b['dialAgentRejectRetryFrequency'];_0x1daf36=_0x4d2f9b[_0xf305('0x12b')];ami['emit']('custom:agentreject',ut[_0xf305('0x100')](_0x2ce43b,_0xf305('0x1d1')));_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1d2')));if(_0x4db64c[_0xf305('0x1a7')](0x14,_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d['countagentrejectretry']>=_0x4d2f9b[_0xf305('0x1b6')]){_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1d3'));}else{_0x4db64c[_0xf305('0x10a')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xf305('0x1d3'));}}break;default:_0x4d2f9b[_0xf305('0x71')]+=0x1;_0x2f1b4d[_0xf305('0xaf')]=0xc;_0x2f1b4d[_0xf305('0xf4')]=_0xbf5216[_0xf305('0x11d')];_0x5e3ddc=_0x4d2f9b[_0xf305('0x1b7')];_0x1daf36=_0x4d2f9b['callAdditionalPhoneAfterMin'];_0x4db64c[_0xf305('0xdb')](_0x2f1b4d)[_0xf305('0xb9')](loggerCatch(_0xf305('0x1d4')));if(_0x4db64c[_0xf305('0x1a7')](_0xbf5216[_0xf305('0x11d')],_0x2ce43b,_0x4d2f9b)&&!_0x59a561){if(_0x2f1b4d[_0xf305('0x102')]+_0x2f1b4d[_0xf305('0x103')]+_0x2f1b4d[_0xf305('0x104')]+_0x2f1b4d[_0xf305('0x105')]+_0x2f1b4d[_0xf305('0x106')]+_0x2f1b4d[_0xf305('0x107')]+_0x2f1b4d[_0xf305('0xfe')]+_0x2f1b4d[_0xf305('0x108')]>=_0x4d2f9b['dialGlobalMaxRetry']){_0x4db64c[_0xf305('0x10a')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xbf5216[_0xf305('0x11d')]);}else{_0x4db64c[_0xf305('0x10c')](_0x2f1b4d,_0x4da506,_0x29d40d,_0xbf5216[_0xf305('0x11d')]);}}}})[_0xf305('0xc2')](function(_0x207786){if(_0x59a561){console[_0xf305('0xc6')]('----call\x20swapAdditionalPhones----',_0x2f1b4d);_0x4db64c[_0xf305('0xc5')](_0x2f1b4d,_0x5e3ddc,_0x1daf36)[_0xf305('0xc2')](function(_0x4d257a){return _0x4da506(0x1);});}});});};Dialer['prototype'][_0xf305('0x10a')]=function(_0x828908,_0x4f5090,_0x27f57f,_0x4c6e71){var _0x4c9bc3=new Final(_0x828908);_0x4c9bc3[_0xf305('0xaf')]=0xf;_0x4c9bc3[_0xf305('0xf4')]=_0xf305('0x1d5');this[_0xf305('0x10c')](_0x4c9bc3,_0x4f5090,_0x27f57f,_0x4c6e71);};Dialer[_0xf305('0x1c')][_0xf305('0x10c')]=function(_0x3ebec4,_0x9fd837,_0x200f03,_0x36eb57){this[_0xf305('0xd9')](_0x3ebec4)[_0xf305('0xc2')](function(){return _0x9fd837(msgResponse('[callProgressDetecting]',_0xf305('0xe9'),_0x36eb57));})[_0xf305('0xb9')](function(){return _0x200f03(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0xf305('0x1c')][_0xf305('0x16f')]=function(_0x4f60e6){var _0x28b52c=_0x4f60e6[_0xf305('0x1d6')]/0x64;var _0x398587=_0x4f60e6[_0xf305('0x6d')]/(_0x4f60e6[_0xf305('0x6d')]+_0x4f60e6[_0xf305('0x67')]);var _0x27a2cc=Math['round'](_0x4f60e6[_0xf305('0x7b')]*(_0x4f60e6['predictiveIntervalMaxThreshold']/0x64));var _0xda838a=Math[_0xf305('0x1d7')](_0x4f60e6[_0xf305('0x7b')]*(_0x4f60e6[_0xf305('0x1d8')]/0x64));var _0x2735c2=_0x4f60e6['available']+_0x4f60e6['talking'];var _0x46419e=Math[_0xf305('0x1d9')](_0x4f60e6[_0xf305('0x7d')]*_0x4f60e6['erlangAbandonmentRate']*_0x4f60e6['predictiveIntervalHitRate']*_0x4f60e6[_0xf305('0x79')]);if(_[_0xf305('0x40')](_0x4f60e6[_0xf305('0x2a')])){if(!_[_0xf305('0x40')](_0x4f60e6[_0xf305('0x29')])){_0x4f60e6[_0xf305('0x29')]=undefined;loggerPredictive[_0xf305('0xa1')](_0xf305('0x1da'),_0xf305('0x1db'));}if(!_['isUndefined'](_0x4f60e6['handlePredictive'])){loggerPredictive[_0xf305('0xa1')](_0xf305('0x1da'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4f60e6[_0xf305('0x9b')]);_0x4f60e6[_0xf305('0x9b')]=undefined;}_0x4f60e6[_0xf305('0x2a')]=moment()[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf305('0x88')](_0x4f60e6[_0xf305('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x4f60e6[_0xf305('0x2a')]);this[_0xf305('0x16c')](_0x4f60e6,0x1);}else if(ifInterval(_0x4f60e6['dialPredictiveInterval'],_0x4f60e6['startProgressive'])){this[_0xf305('0x16c')](_0x4f60e6,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x4f60e6[_0xf305('0x2a')],_0x4f60e6[_0xf305('0x43')]);_0x4f60e6[_0xf305('0x7d')]=0x0;_0x4f60e6['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x28b52c<_0x398587&&_0x4f60e6[_0xf305('0x1dc')]==='dropRate'){freeVariablesPredictive(_0x4f60e6);loggerPredictive[_0xf305('0x88')](_0xf305('0x1dd'),_0xf305('0x1de'),_0x398587,_0xf305('0x2a'),_0x4f60e6[_0xf305('0x43')]);}else if(_0x46419e<_0x4f60e6[_0xf305('0x77')]&&_0x4f60e6[_0xf305('0x1dc')]==='dropRate'){freeVariablesPredictive(_0x4f60e6);loggerPredictive[_0xf305('0x88')](_0xf305('0x1df'),'Max\x20Drop\x20',_0x46419e,_0xf305('0x1e0'),_0x4f60e6[_0xf305('0x77')],_0xf305('0x2a'),_0x4f60e6[_0xf305('0x43')]);}else if(!ifInterval(_0x4f60e6[_0xf305('0x1e1')],_0x4f60e6[_0xf305('0x2a')])&&_[_0xf305('0x40')](_0x4f60e6[_0xf305('0x29')])&&!_[_0xf305('0x40')](_0x4f60e6[_0xf305('0x2a')])){_0x4f60e6[_0xf305('0x29')]=moment()[_0xf305('0x83')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf305('0x88')](_0x4f60e6[_0xf305('0x43')],_0xf305('0x1e2'),_0x4f60e6[_0xf305('0x29')]);this[_0xf305('0xcb')](_0x4f60e6[_0xf305('0x1e1')])[_0xf305('0xc2')](this[_0xf305('0x1e3')](_0x4f60e6))['then'](mergeDataErlangB(_0x4f60e6))[_0xf305('0xc2')](this['startMethodPredictive'](_0x4f60e6))[_0xf305('0xb9')](loggerCatchPredictive(_0xf305('0x1e4'),_0x4f60e6));}else if(!ifInterval(_0x4f60e6[_0xf305('0x1e1')],_0x4f60e6[_0xf305('0x29')])){_0x4f60e6['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4f60e6['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf305('0x88')](_0x4f60e6['name'],'recalculate\x20predictive\x20at',_0x4f60e6[_0xf305('0x29')]);clearInterval(_0x4f60e6[_0xf305('0x9b')]);_0x4f60e6[_0xf305('0x9b')]=undefined;this['averageHandleTime'](_0x4f60e6[_0xf305('0x1e1')])[_0xf305('0xc2')](this['getDataPredictive'](_0x4f60e6))[_0xf305('0xc2')](mergeDataErlangB(_0x4f60e6))['then'](this[_0xf305('0x1e5')](_0x4f60e6))[_0xf305('0xb9')](loggerCatchPredictive(_0xf305('0x1e6'),_0x4f60e6));}else if(_0x4f60e6[_0xf305('0x7b')]&&_0x2735c2<_0x4f60e6[_0xf305('0x7b')]-_0xda838a){freeVariablesPredictive(_0x4f60e6);loggerPredictive[_0xf305('0x88')](_0x4f60e6[_0xf305('0x43')],_0xf305('0x1e7'),_0x2735c2,_0xf305('0x1e8'),_0x4f60e6[_0xf305('0x7b')],'-',_0xda838a,'=',_0x4f60e6[_0xf305('0x7b')]-_0xda838a,')');}else if(_0x4f60e6[_0xf305('0x7b')]&&_0x2735c2>_0x4f60e6[_0xf305('0x7b')]+_0x27a2cc){freeVariablesPredictive(_0x4f60e6);loggerPredictive[_0xf305('0x88')](_0x4f60e6['name'],_0xf305('0x1e7'),_0x2735c2,_0xf305('0x1e9'),_0x4f60e6[_0xf305('0x7b')],'+',_0x27a2cc,'=',_0x4f60e6[_0xf305('0x7b')]+_0x27a2cc,')');}};Dialer['prototype'][_0xf305('0x1e3')]=function(_0x2dc8a6){var _0x2476ad=this;return function(_0x599404){return new BPromise(function(_0x3f7af5,_0x3ae888){_[_0xf305('0x99')](_0x2dc8a6,_0x599404[0x0]);if(checkGetDataPredictive(_0x599404[0x0])){var _0x216202=_0x2dc8a6['predictiveIntervalAvailable']=_0x2dc8a6[_0xf305('0x5b')]+_0x2dc8a6[_0xf305('0x55')];var _0x172817=_0x2dc8a6[_0xf305('0x1e1')]*0x3c;var _0x22bf5f=_0x599404[0x0][_0xf305('0x73')]+_0x599404[0x0][_0xf305('0x72')];var _0x114662=(_0x599404[0x0][_0xf305('0x8c')]+_0x599404[0x0][_0xf305('0x75')]+_0x599404[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x599404[0x0][_0xf305('0x7c')];_0x2dc8a6['predictiveIntervalHitRate']=_0x114662>0x0?_0x114662:0x1;switch(_0x2dc8a6[_0xf305('0x1dc')]){case _0xf305('0x1ea'):var _0x4cdd48=_0x2dc8a6[_0xf305('0x1d6')]/0x64;return _0x2476ad[_0xf305('0x1eb')](_0x216202,_0x172817,_0x22bf5f,_0x114662,_0x4cdd48)[_0xf305('0xc2')](function(_0x331081){return _0x3f7af5(_0x331081);});case _0xf305('0x1ec'):var _0x309ed9=_0x2dc8a6[_0xf305('0x1d6')]/0x64;return _0x2476ad[_0xf305('0x1ed')](_0x216202,_0x172817,_0x22bf5f,_0x114662,_0x309ed9)['then'](function(_0x58b986){return _0x3f7af5(_0x58b986);});default:return _0x3ae888(msgResponse(_0xf305('0x1ee'),_0xf305('0x15a'),_0xf305('0x1ef')));}}else{return _0x3ae888(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0xf305('0x1c')][_0xf305('0x1f0')]=function(_0x12ff77){var _0x5c0427=this;return function(_0x53b52c){return new BPromise(function(_0x1aaf00,_0x548026){_[_0xf305('0x99')](_0x12ff77,_0x53b52c[0x0]);if(checkGetDataPredictive(_0x53b52c[0x0])){loggerPredictive['info'](JSON[_0xf305('0x4d')](_0x53b52c[0x0]));if(_0x12ff77['dialPredictiveOptimization']==='dropRate'){return _0x5c0427[_0xf305('0xd7')](_0x12ff77['id'])[_0xf305('0xc2')](function(_0x3db77d){var _0x3a1251=_0x12ff77['loggedIn']-_0x3db77d[0x0]['outboundQueuePauses'];var _0x11fbf7=_0x12ff77[_0xf305('0x1e1')]*0x3c;var _0x3e293e=_0x53b52c[0x0][_0xf305('0x73')]+_0x53b52c[0x0]['predictiveIntervalAvgHoldtime'];var _0x5c1762=(_0x53b52c[0x0]['predictiveIntervalAnsweredCalls']+_0x53b52c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x53b52c[0x0][_0xf305('0x74')])/_0x53b52c[0x0][_0xf305('0x7c')];var _0x3659c5=_0x12ff77['dialPredictiveOptimizationPercentage']/0x64;_0x12ff77['predictiveIntervalPauses']=_0x3db77d[0x0]['outboundQueuePauses']||0x0;_0x12ff77[_0xf305('0x78')]=_0x5c1762>0x0?_0x5c1762:0x1;return _0x5c0427[_0xf305('0x1eb')](_0x3a1251,_0x11fbf7,_0x3e293e,_0x5c1762,_0x3659c5);})[_0xf305('0xc2')](function(_0x15b57e){return _0x1aaf00(_0x15b57e);})[_0xf305('0xb9')](function(_0x5f3f31){return _0x548026(msgResponse(_0xf305('0x1f1'),_0xf305('0x15a'),JSON['stringify'](_0x5f3f31)));});}if(_0x12ff77[_0xf305('0x1dc')]===_0xf305('0x1ec')){return _0x5c0427[_0xf305('0xd7')](_0x12ff77['id'])[_0xf305('0xc2')](function(_0x5591d0){var _0x3dd071=_0x12ff77['loggedIn']-_0x5591d0[0x0][_0xf305('0x1f2')];var _0x1d794f=_0x12ff77[_0xf305('0x1e1')]*0x3c;var _0x274174=_0x53b52c[0x0]['predictiveIntervalAvgTalktime']+_0x53b52c[0x0]['predictiveIntervalAvgHoldtime'];var _0x5c3469=(_0x53b52c[0x0][_0xf305('0x8c')]+_0x53b52c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x53b52c[0x0][_0xf305('0x74')])/_0x53b52c[0x0][_0xf305('0x7c')];var _0x5123ff=_0x12ff77[_0xf305('0x1d6')]/0x64;_0x12ff77[_0xf305('0x7a')]=_0x5591d0[0x0][_0xf305('0x1f2')]||0x0;_0x12ff77[_0xf305('0x78')]=_0x5c3469>0x0?_0x5c3469:0x1;return _0x5c0427['busyFactor'](_0x3dd071,_0x1d794f,_0x274174,_0x5c3469,_0x5123ff);})[_0xf305('0xc2')](function(_0x2aa4b6){return _0x1aaf00(_0x2aa4b6);})[_0xf305('0xb9')](function(_0x31e898){return _0x548026(msgResponse(_0xf305('0x1f1'),_0xf305('0x15a'),JSON['stringify'](_0x31e898)));});}}else{return _0x548026(msgResponse(_0xf305('0x1ee'),_0xf305('0x15a'),_0xf305('0x1f3')));}});};};Dialer['prototype'][_0xf305('0x1e5')]=function(_0x24050e){var _0x167efa=this;return function(){var _0x47b79a=0x0;var _0x2eecf4=Math[_0xf305('0x1d9')](_0x24050e[_0xf305('0x7e')]*0x3e8);if(_0x2eecf4>0x0){_0x2eecf4=_0x2eecf4<0x64?0x64:_0x2eecf4;loggerPredictive[_0xf305('0x88')](_0x24050e[_0xf305('0x43')],_0xf305('0x1f4'),_0x2eecf4,'milliseconds');_0x24050e[_0xf305('0x9b')]=setInterval(function(){_0x167efa['handlePredictive'](_0x24050e);loggerPredictiveCalls[_0xf305('0x88')](_0xf305('0x1f5'),_0x47b79a+=0x1);},_0x2eecf4);}else{loggerPredictive[_0xf305('0x88')](_0x24050e[_0xf305('0x43')],_0xf305('0x1f6'));}};};Dialer['prototype'][_0xf305('0x1f7')]=function(_0x4972a8,_0x466690){var _0x285302=this;return function(_0x4ecbe6){if(_['isEmpty'](_0x4ecbe6)){if(_[_0xf305('0xb5')](_0x466690[_0xf305('0xe3')])||!_0x466690[_0xf305('0x1f8')]){if(_0x4972a8['dialMethod']===_0xf305('0x8')){_0x4972a8[_0xf305('0x140')]=_[_0xf305('0x40')](_0x4972a8[_0xf305('0x140')])?!![]:_0x4972a8[_0xf305('0x140')];var _0x3c95e5=uuid['v4']();_0x285302[_0xf305('0x138')][_0x3c95e5]=new Action(_0x4972a8,_0x466690,_0x3c95e5);loggerBooked[_0xf305('0x88')](_0xf305('0x1f9'),_0x3c95e5,_0xf305('0x1fa'),JSON[_0xf305('0x4d')](_0x4972a8[_0xf305('0x140')]),_0xf305('0x1fb'),_0x4972a8[_0xf305('0x43')]);if(_0x4972a8[_0xf305('0x140')]){_0x4972a8['queueStatusComplete']=![];_0x285302[_0xf305('0x2c')][_0x285302[_0xf305('0x138')][_0x3c95e5][_0xf305('0xbc')]]=[];ami[_0xf305('0xb6')]({'actionid':_0x3c95e5,'action':'queuestatus','queue':_0x4972a8[_0xf305('0x43')]})['catch'](function(){_0x285302[_0xf305('0xba')](_0x4972a8);_0x285302[_0xf305('0xce')]({'active':![],'ContactId':_0x285302[_0xf305('0x138')][_0x3c95e5][_0xf305('0x110')],'ListId':_0x285302['actions'][_0x3c95e5][_0xf305('0xe2')],'VoiceQueueId':_0x285302[_0xf305('0x138')][_0x3c95e5][_0xf305('0xe4')]||undefined,'CampaignId':_0x285302[_0xf305('0x138')][_0x3c95e5][_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x285302['actions'][_0x3c95e5];});}else{loggerBooked[_0xf305('0x88')](_0xf305('0x1fc'),JSON[_0xf305('0x4d')](_0x4972a8['queueStatusComplete']),_0xf305('0x1fb'),_0x4972a8['name']);_0x285302[_0xf305('0xba')](_0x4972a8);_0x285302[_0xf305('0xce')]({'active':![],'ContactId':_0x285302[_0xf305('0x138')][_0x3c95e5][_0xf305('0x110')],'ListId':_0x285302['actions'][_0x3c95e5][_0xf305('0xe2')],'VoiceQueueId':_0x285302['actions'][_0x3c95e5][_0xf305('0xe4')]||undefined,'CampaignId':_0x285302[_0xf305('0x138')][_0x3c95e5]['CampaignId']||undefined})[_0xf305('0xb9')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x285302[_0xf305('0x138')][_0x3c95e5];}}else{return _0x285302[_0xf305('0x17a')](_0x4972a8,_0x466690);}}else{if(getDiff(_0x466690[_0xf305('0x1fd')])<_0x4972a8['dialRecallMeTimeout']*0x3c){if(_0x466690[_0xf305('0x1fe')]&&!_0x466690[_0xf305('0x1fe')][_0xf305('0x1ff')]){_0x285302['preview'][_0xf305('0x143')](_0x466690['id'])[_0xf305('0x1e')](function(){_0x285302['updateOriginated'](_0x4972a8);});}else{_0x285302[_0xf305('0xd0')]({'active':![]},_0x466690['id'],0x1)[_0xf305('0x1e')](function(){_0x285302[_0xf305('0xba')](_0x4972a8);});}}else{_0x4972a8[_0xf305('0x200')]+=0x1;_0x285302[_0xf305('0xba')](_0x4972a8);if(_0x4972a8['dialRecallInQueue']){_0x285302[_0xf305('0xce')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x466690[_0xf305('0x110')],'ListId':_0x466690[_0xf305('0xe2')],'VoiceQueueId':_0x466690['VoiceQueueId']||undefined,'CampaignId':_0x466690[_0xf305('0xe5')]||undefined})[_0xf305('0xb9')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x285302[_0xf305('0xdb')](createObjHistory(_0x4972a8,_0x466690,_0xf305('0x201'),0x17,_0xf305('0x202')))['catch'](loggerCatch(_0xf305('0x203')));}else{_0x285302['saveInDb'](createObjHistory(_0x4972a8,_0x466690,_0xf305('0x204'),0x16,_0xf305('0x205')),_0xf305('0x206'),_0xf305('0x207'));}}}}else{_0x4972a8[_0xf305('0x68')]+=0x1;_0x285302[_0xf305('0xe1')](createObjHistory(_0x4972a8,_0x466690,_0xf305('0x208'),0xd,_0xf305('0x209')),_0xf305('0x20a'),'[Originate][MoveBlacklist]');throw _0xf305('0x20b');}};};Dialer['prototype'][_0xf305('0x172')]=function(_0x317aeb){var _0x1ef947=this;var _0x378f2f=_0x317aeb['limitCalls']-_0x317aeb[_0xf305('0xa3')]-_0x317aeb[_0xf305('0xd3')];emitCampaignSummary(_0x317aeb);if(_0x378f2f>0x0){if(_0x378f2f>this[_0xf305('0x25')]){_0x378f2f=this['maxNumberOriginate'];}_0x317aeb[_0xf305('0xd3')]+=_0x378f2f;this['getContactDialerIvr'](_0x317aeb['id'],_0x378f2f,_0x317aeb['dialOrderByScheduledAt'],_0x317aeb)[_0xf305('0xc2')](function(_0x72ae6c){_0x317aeb['temp']-=_0x378f2f;_0x317aeb[_0xf305('0xd3')]=_0x317aeb['temp']>0x0?_0x317aeb[_0xf305('0xd3')]:0x0;if(!checkContactEmpty(_0x72ae6c)){_0x317aeb[_0xf305('0x41')]=_0xf305('0xa8');logger['info']('[getContactCampaign2][Empty]'+_0x317aeb[_0xf305('0x43')]);}else{_0x317aeb['originated']+=_0x72ae6c[_0xf305('0xa2')];_0x317aeb[_0xf305('0x41')]=_0xf305('0x20c');for(var _0x5e30ac=0x0;_0x5e30ac<_0x72ae6c[_0xf305('0xa2')];_0x5e30ac+=0x1){_0x317aeb[_0xf305('0x20d')]+=0x1;if(_[_0xf305('0xb5')](_0x72ae6c[_0x5e30ac])||_[_0xf305('0xb5')](_0x72ae6c[_0x5e30ac][_0xf305('0x192')])||_[_0xf305('0xb5')](_0x72ae6c[_0x5e30ac][_0xf305('0x17d')])){_0x1ef947['emptyContact'](_0xf305('0x20e'),_0x317aeb,_0x72ae6c[_0x5e30ac]);}else{_0x1ef947[_0xf305('0xc9')](_[_0xf305('0x13f')](_0x72ae6c[_0x5e30ac],[_0xf305('0xe5'),_0xf305('0x20f')]))[_0xf305('0xc2')](_0x1ef947['checkContactBlack'](_0x317aeb,_0x72ae6c[_0x5e30ac]))[_0xf305('0xb9')](_0x1ef947['loggerHandler']('[actionOriginateIvr]\x20',_0x317aeb));}}}})[_0xf305('0xb9')](loggerGetContactDialer(_0xf305('0x210'),_0x317aeb,_0x378f2f));}};Dialer[_0xf305('0x1c')][_0xf305('0x16c')]=function(_0xe9bc14,_0x2a68f9){var _0x3c9679=this;var _0x266ec6=[];var _0x28890d=_0x2a68f9>=0x1?_0x2a68f9:0x1;if(_0xe9bc14[_0xf305('0x61')]===_0xf305('0x8')){_0x28890d=0x1;}var _0x139fa0=Math[_0xf305('0x1d9')](_0xe9bc14[_0xf305('0x55')]*_0x28890d)-_0xe9bc14[_0xf305('0xa3')]-_0xe9bc14[_0xf305('0xd3')];emitVoiceQueueSummary(_0xe9bc14);if(_0xe9bc14['dialLimitQueue']>0x0){var _0x5ab96b=_0xe9bc14[_0xf305('0x211')]-_0xe9bc14[_0xf305('0xa3')]-_0xe9bc14[_0xf305('0x5b')]-_0xe9bc14[_0xf305('0xd3')]-_0xe9bc14['pTalking'];if(_0x139fa0>_0x5ab96b){_0x139fa0=_0x5ab96b;}}if(_0x139fa0>0x0){if(_0xe9bc14['dialMethod']===_0xf305('0x8')){_0x139fa0=0x1;}if(_0x139fa0>this[_0xf305('0x25')]){_0x139fa0=this[_0xf305('0x25')];}_0xe9bc14[_0xf305('0xd3')]+=_0x139fa0;for(var _0x3c20e0 in this['agents']){if(typeof this[_0xf305('0x23')][_0x3c20e0]!==_0xf305('0xb4')){if(this[_0xf305('0x23')][_0x3c20e0][_0xf305('0xaf')]===_0xf305('0x212')&&this['agents'][_0x3c20e0][_0xf305('0xb7')]===_0xf305('0x213')){_0x266ec6[_0xf305('0x13e')](this[_0xf305('0x23')][_0x3c20e0]['id']);}}}this[_0xf305('0xd2')](_0xe9bc14['id'],_0x266ec6,_0x139fa0,_0xe9bc14[_0xf305('0x214')],_0xe9bc14)['then'](function(_0x4ba178){_0xe9bc14[_0xf305('0xd3')]-=_0x139fa0;_0xe9bc14[_0xf305('0xd3')]=_0xe9bc14[_0xf305('0xd3')]>0x0?_0xe9bc14[_0xf305('0xd3')]:0x0;if(!checkContactEmpty(_0x4ba178)){_0x3c9679[_0xf305('0xbe')](_0xe9bc14)['then'](sendMessageReschedule(_0xe9bc14))['catch'](loggerCatch(_0xf305('0xc0')));}else{_0xe9bc14['originated']+=_0x4ba178[_0xf305('0xa2')];_0xe9bc14['message']=_0xe9bc14[_0xf305('0x61')]===_0xf305('0x8')?_0xf305('0x184'):_0xf305('0x20c');for(var _0x19a69e=0x0;_0x19a69e<_0x4ba178[_0xf305('0xa2')];_0x19a69e+=0x1){if(_[_0xf305('0xb5')](_0x4ba178[_0x19a69e])||_[_0xf305('0xb5')](_0x4ba178[_0x19a69e][_0xf305('0x192')])||_[_0xf305('0xb5')](_0x4ba178[_0x19a69e][_0xf305('0x17d')])){_0x3c9679[_0xf305('0xdf')](_0xf305('0x20e'),_0xe9bc14,_0x4ba178[_0x19a69e]);}else{_0x3c9679['checkIsBlackList'](_[_0xf305('0x13f')](_0x4ba178[_0x19a69e],[_0xf305('0xe4'),_0xf305('0x20f')]))[_0xf305('0xc2')](_0x3c9679[_0xf305('0x1f7')](_0xe9bc14,_0x4ba178[_0x19a69e]))[_0xf305('0xb9')](_0x3c9679[_0xf305('0x215')](_0xf305('0x20e'),_0xe9bc14));}}}})[_0xf305('0xb9')](loggerGetContactDialer(_0xf305('0x216'),_0xe9bc14,_0x139fa0));}};Dialer[_0xf305('0x1c')]['handlePredictive']=function(_0xc2dc91){if(_0xc2dc91[_0xf305('0x211')]>0x0){var _0x35bb4f=_0xc2dc91[_0xf305('0x211')]-_0xc2dc91[_0xf305('0xa3')]-_0xc2dc91[_0xf305('0x5b')];if(_0x35bb4f>0x0){this[_0xf305('0x217')](_0xc2dc91);}else{loggerPredictiveCalls[_0xf305('0x88')](_0xf305('0x218'));}}else{this[_0xf305('0x217')](_0xc2dc91);}};Dialer[_0xf305('0x1c')][_0xf305('0x217')]=function(_0x1d7ed1){var _0x21b272=this;var _0x2e309a=[];_0x1d7ed1[_0xf305('0xa3')]+=0x1;for(var _0x39b8f7 in this['agents']){if(typeof this[_0xf305('0x23')][_0x39b8f7]!==_0xf305('0xb4')){if(this[_0xf305('0x23')][_0x39b8f7]['state']===_0xf305('0x212')&&this['agents'][_0x39b8f7][_0xf305('0xb7')]==='reachable'){_0x2e309a[_0xf305('0x13e')](this[_0xf305('0x23')][_0x39b8f7]['id']);}}}this['getContactDialer'](_0x1d7ed1['id'],_0x2e309a,0x1,_0x1d7ed1['dialOrderByScheduledAt'],_0x1d7ed1)[_0xf305('0xc2')](function(_0x36c892){if(!checkContactEmpty(_0x36c892)){checkContactLowerLimitOriginate(_0x1d7ed1,0x1,0x0);_0x21b272[_0xf305('0xbe')](_0x1d7ed1)[_0xf305('0xc2')](sendMessageReschedule(_0x1d7ed1))[_0xf305('0xb9')](loggerCatch(_0xf305('0xc0')));}else{_0x1d7ed1[_0xf305('0x41')]=_0xf305('0x20c');if(_[_0xf305('0xb5')](_0x36c892[0x0])||_['isNil'](_0x36c892[0x0][_0xf305('0x192')])||_['isNil'](_0x36c892[0x0][_0xf305('0x17d')])){_0x21b272[_0xf305('0xdf')](_0xf305('0x20e'),_0x1d7ed1,_0x36c892[0x0]);}else{_0x21b272[_0xf305('0xc1')](_[_0xf305('0x13f')](_0x36c892[0x0],[_0xf305('0xe4'),_0xf305('0x20f')]))['then'](_0x21b272[_0xf305('0x1f7')](_0x1d7ed1,_0x36c892[0x0]))[_0xf305('0xb9')](_0x21b272['loggerHandler']('[actionOriginatePredictive]\x20',_0x1d7ed1));}}})[_0xf305('0xb9')](loggerGetContactDialer('[getContactDialerPredictive]',_0x1d7ed1,0x1));emitVoiceQueueSummary(_0x1d7ed1);};Dialer[_0xf305('0x1c')][_0xf305('0x1eb')]=function(_0x74d3da,_0x4e3252,_0x9126c5,_0x2e6394,_0x29a89e,_0x22c670){loggerPredictive[_0xf305('0x88')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xf305('0x88')]('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',_0x74d3da);loggerPredictive[_0xf305('0x88')](_0xf305('0x219'),_0x4e3252);loggerPredictive[_0xf305('0x88')](_0xf305('0x21a'),_0x9126c5);loggerPredictive[_0xf305('0x88')](_0xf305('0x21b'),_0x2e6394);loggerPredictive[_0xf305('0x88')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29a89e);loggerPredictive[_0xf305('0x88')](_0xf305('0x98'));return new BPromise(function(_0x20998e,_0x2666ee){if(_0x74d3da<=0x0||isNaN(_0x74d3da)){return _0x2666ee(msgResponse(_0xf305('0x21c'),_0xf305('0x21d'),_0xf305('0x21e')+_0x74d3da));}if(_0x9126c5<=0x0||isNaN(_0x9126c5)){return _0x2666ee(msgResponse(_0xf305('0x21c'),_0xf305('0x21d'),_0xf305('0x21f')+_0x9126c5));}if(_0x2e6394<=0x0||isNaN(_0x2e6394)){return _0x2666ee(msgResponse(_0xf305('0x21c'),_0xf305('0x21d'),_0xf305('0x220')+_0x2e6394));}if(_0x4e3252<=0x0||isNaN(_0x4e3252)){return _0x2666ee(msgResponse(_0xf305('0x21c'),_0xf305('0x21d'),_0xf305('0x221')+_0x4e3252));}if(_0x29a89e<=0x0||isNaN(_0x29a89e)){return _0x2666ee(msgResponse(_0xf305('0x21c'),'Error',_0xf305('0x222')+_0x29a89e));}_0x22c670=_0x22c670||0x0;var _0x590b89=0x1/_0x9126c5;var _0x42cbfa=0x0;var _0x4ceeb4=0x0;var _0x2be75d=0x0;var _0x40f807=0x0;for(var _0x4d21d7=0x0;_0x2be75d<_0x29a89e;_0x4d21d7+=0x1){_0x4ceeb4=_0x4d21d7/_0x4e3252;_0x42cbfa=(_0x2e6394*_0x4ceeb4+_0x22c670)/_0x590b89;_0x2be75d=erlangb(_0x42cbfa,_0x74d3da);_0x40f807=_0x42cbfa/_0x74d3da*(0x1-erlangb(_0x42cbfa,_0x74d3da));}return _0x20998e({'erlangCalls':_0x4d21d7,'erlangCallToSecond':_0x4e3252/_0x4d21d7,'erlangAbandonmentRate':_0x2be75d,'erlangBusyFactor':_0x40f807});});};Dialer[_0xf305('0x1c')][_0xf305('0x1ed')]=function(_0x395c9d,_0x565740,_0x49ae3d,_0x237d01,_0x67bda8,_0xa0432){loggerPredictive[_0xf305('0x88')](_0xf305('0x223'));loggerPredictive['info'](_0xf305('0x224'),_0x395c9d);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x565740);loggerPredictive[_0xf305('0x88')]('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',_0x49ae3d);loggerPredictive[_0xf305('0x88')](_0xf305('0x21b'),_0x237d01);loggerPredictive['info'](_0xf305('0x225'),_0x67bda8);loggerPredictive[_0xf305('0x88')](_0xf305('0x98'));return new BPromise(function(_0x21c6d0,_0x1e1af3){if(_0x395c9d<=0x0||isNaN(_0x395c9d)){return _0x1e1af3(msgResponse(_0xf305('0x226'),_0xf305('0x21d'),_0xf305('0x21e')+_0x395c9d));}if(_0x49ae3d<=0x0||isNaN(_0x49ae3d)){return _0x1e1af3(msgResponse('[busyFactor]',_0xf305('0x21d'),_0xf305('0x21f')+_0x49ae3d));}if(_0x237d01<=0x0||isNaN(_0x237d01)){return _0x1e1af3(msgResponse(_0xf305('0x226'),'Error','p\x20=\x20'+_0x237d01));}if(_0x565740<=0x0||isNaN(_0x565740)){return _0x1e1af3(msgResponse(_0xf305('0x226'),'Error','interval\x20=\x20'+_0x565740));}if(_0x67bda8<=0x0||isNaN(_0x67bda8)){return _0x1e1af3(msgResponse(_0xf305('0x226'),'Error',_0xf305('0x227')+_0x67bda8));}_0xa0432=_0xa0432||0x0;var _0xe6bb47=0x1/_0x49ae3d;var _0x5f1b07=0x0;var _0x2526de=0x0;var _0x3121e9=0x0;var _0x218069=0x0;for(var _0x2385c8=0x0;_0x218069<_0x67bda8;_0x2385c8+=0x1){_0x2526de=_0x2385c8/_0x565740;_0x5f1b07=(_0x237d01*_0x2526de+_0xa0432)/_0xe6bb47;_0x3121e9=erlangb(_0x5f1b07,_0x395c9d);_0x218069=_0x5f1b07/_0x395c9d*(0x1-erlangb(_0x5f1b07,_0x395c9d));}return _0x21c6d0({'erlangCalls':_0x2385c8,'erlangCallToSecond':_0x565740/_0x2385c8,'erlangAbandonmentRate':_0x3121e9,'erlangBusyFactor':_0x218069});});};module[_0xf305('0x228')]=Dialer;
\ No newline at end of file
index ba22938..64aba13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x436c=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','number','starttime','droptime','endtime','ringtime','responsetime','holdtime','talktime','connectedlinename','reason'];(function(_0x476c6c,_0x434db8){var _0xbb94db=function(_0x4be12){while(--_0x4be12){_0x476c6c['push'](_0x476c6c['shift']());}};_0xbb94db(++_0x434db8);}(_0x436c,0x82));var _0xc436=function(_0x24d14c,_0x2424aa){_0x24d14c=_0x24d14c-0x0;var _0x3278cd=_0x436c[_0x24d14c];return _0x3278cd;};'use strict';var util=require('util');var _=require(_0xc436('0x0'));var moment=require(_0xc436('0x1'));function getSeconds(_0x46e083,_0x2a9621){var _0x4125f5=moment(_0x46e083)[_0xc436('0x2')](0x0);var _0x557885=moment(_0x2a9621)['milliseconds'](0x0);return _0x4125f5[_0xc436('0x3')](_0x557885,_0xc436('0x4'));}function QueueCallerAbandon(_0x4cfc7d,_0x49e1ec){this[_0xc436('0x5')]=_0x4cfc7d[_0xc436('0x5')];this[_0xc436('0x6')]=_0x4cfc7d[_0xc436('0x6')];this[_0xc436('0x7')]=_0x4cfc7d['type']===_0xc436('0x8')?_0xc436('0x9'):_0x4cfc7d[_0xc436('0x6')];this[_0xc436('0xa')]=_0x4cfc7d[_0xc436('0xa')];this['countcongestionretry']=_0x4cfc7d[_0xc436('0xb')];this[_0xc436('0xc')]=_0x4cfc7d[_0xc436('0xc')];this[_0xc436('0xd')]=_0x4cfc7d[_0xc436('0xa')]+_0x4cfc7d['countcongestionretry']+_0x4cfc7d[_0xc436('0xc')]+_0x4cfc7d['countnosuchnumberretry']+_0x4cfc7d['countdropretry']+_0x4cfc7d[_0xc436('0xe')]+_0x4cfc7d[_0xc436('0xf')]+_0x4cfc7d[_0xc436('0x10')];this[_0xc436('0x11')]=_0x4cfc7d[_0xc436('0x11')];this['countdropretry']=_0x4cfc7d['countdropretry'];this[_0xc436('0xe')]=_0x4cfc7d['countabandonedretry'];this[_0xc436('0xf')]=_0x4cfc7d[_0xc436('0xf')];this[_0xc436('0x10')]=_0x4cfc7d[_0xc436('0x10')];this[_0xc436('0x12')]=_0x49e1ec['uniqueid'];this['calleridname']=_0x4cfc7d[_0xc436('0x13')];this['calleridnum']=_0x4cfc7d[_0xc436('0x14')];this['starttime']=_0x4cfc7d[_0xc436('0x15')];this['responsetime']=_0x4cfc7d['responsetime'];this[_0xc436('0x16')]=_0x4cfc7d[_0xc436('0x16')];this[_0xc436('0x17')]=this[_0xc436('0x16')];this[_0xc436('0x18')]=getSeconds(_0x4cfc7d[_0xc436('0x19')],_0x4cfc7d[_0xc436('0x15')]);this[_0xc436('0x1a')]=getSeconds(this[_0xc436('0x16')],_0x4cfc7d[_0xc436('0x19')]);this[_0xc436('0x1b')]=0x0;this[_0xc436('0x9')]=_0x49e1ec[_0xc436('0x9')];this['membername']=_0x49e1ec[_0xc436('0x1c')];this[_0xc436('0x1d')]=_0x49e1ec[_0xc436('0x1d')];this['callback']=_0x4cfc7d['callback'];this[_0xc436('0x1e')]=_0x4cfc7d[_0xc436('0x1e')];this['callbackat']=_0x4cfc7d[_0xc436('0x1f')];this[_0xc436('0x20')]=_0x4cfc7d[_0xc436('0x20')];this[_0xc436('0x21')]=_0x4cfc7d['ContactId'];this[_0xc436('0x22')]=_0x4cfc7d[_0xc436('0x22')];this[_0xc436('0x23')]=_0x4cfc7d[_0xc436('0x23')];this[_0xc436('0x24')]=_0x4cfc7d[_0xc436('0x24')];this['CampaignId']=_0x4cfc7d[_0xc436('0x25')];this['originatecalleridnum']=_0x4cfc7d[_0xc436('0x26')]||'';this[_0xc436('0x27')]=_0x4cfc7d['originatecalleridname']||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
+var _0xcf76=['countabandonedretry','uniqueid','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x46af7e,_0x3e32c7){var _0x4c0447=function(_0x42fc16){while(--_0x42fc16){_0x46af7e['push'](_0x46af7e['shift']());}};_0x4c0447(++_0x3e32c7);}(_0xcf76,0x1df));var _0x6cf7=function(_0x111df9,_0x2b9a5b){_0x111df9=_0x111df9-0x0;var _0x1835a6=_0xcf76[_0x111df9];return _0x1835a6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6cf7('0x0'));function getSeconds(_0xf587b2,_0x50faad){var _0x150aaa=moment(_0xf587b2)[_0x6cf7('0x1')](0x0);var _0x4ad528=moment(_0x50faad)[_0x6cf7('0x1')](0x0);return _0x150aaa[_0x6cf7('0x2')](_0x4ad528,_0x6cf7('0x3'));}function QueueCallerAbandon(_0x2d2d34,_0x3bacb3){this['scheduledat']=_0x2d2d34[_0x6cf7('0x4')];this[_0x6cf7('0x5')]=_0x2d2d34[_0x6cf7('0x5')];this['campaigntype']=_0x2d2d34[_0x6cf7('0x5')]===_0x6cf7('0x6')?_0x6cf7('0x7'):_0x2d2d34['type'];this[_0x6cf7('0x8')]=_0x2d2d34[_0x6cf7('0x8')];this[_0x6cf7('0x9')]=_0x2d2d34['countcongestionretry'];this['countnoanswerretry']=_0x2d2d34[_0x6cf7('0xa')];this['countglobal']=_0x2d2d34[_0x6cf7('0x8')]+_0x2d2d34['countcongestionretry']+_0x2d2d34[_0x6cf7('0xa')]+_0x2d2d34[_0x6cf7('0xb')]+_0x2d2d34[_0x6cf7('0xc')]+_0x2d2d34['countabandonedretry']+_0x2d2d34[_0x6cf7('0xd')]+_0x2d2d34[_0x6cf7('0xe')];this[_0x6cf7('0xb')]=_0x2d2d34[_0x6cf7('0xb')];this[_0x6cf7('0xc')]=_0x2d2d34[_0x6cf7('0xc')];this[_0x6cf7('0xf')]=_0x2d2d34[_0x6cf7('0xf')];this[_0x6cf7('0xd')]=_0x2d2d34[_0x6cf7('0xd')];this[_0x6cf7('0xe')]=_0x2d2d34[_0x6cf7('0xe')];this[_0x6cf7('0x10')]=_0x3bacb3['uniqueid'];this['calleridname']=_0x2d2d34[_0x6cf7('0x11')];this[_0x6cf7('0x12')]=_0x2d2d34['number'];this[_0x6cf7('0x13')]=_0x2d2d34[_0x6cf7('0x13')];this[_0x6cf7('0x14')]=_0x2d2d34[_0x6cf7('0x14')];this['droptime']=_0x2d2d34[_0x6cf7('0x15')];this[_0x6cf7('0x16')]=this[_0x6cf7('0x15')];this[_0x6cf7('0x17')]=getSeconds(_0x2d2d34[_0x6cf7('0x14')],_0x2d2d34[_0x6cf7('0x13')]);this['holdtime']=getSeconds(this[_0x6cf7('0x15')],_0x2d2d34[_0x6cf7('0x14')]);this['talktime']=0x0;this[_0x6cf7('0x7')]=_0x3bacb3[_0x6cf7('0x7')];this[_0x6cf7('0x18')]=_0x3bacb3[_0x6cf7('0x19')];this[_0x6cf7('0x1a')]=_0x3bacb3['reason'];this['callback']=_0x2d2d34[_0x6cf7('0x1b')];this[_0x6cf7('0x1c')]=_0x2d2d34[_0x6cf7('0x1c')];this[_0x6cf7('0x1d')]=_0x2d2d34[_0x6cf7('0x1d')];this[_0x6cf7('0x1e')]=_0x2d2d34['recallme'];this[_0x6cf7('0x1f')]=_0x2d2d34['ContactId'];this[_0x6cf7('0x20')]=_0x2d2d34[_0x6cf7('0x20')];this['UserId']=_0x2d2d34[_0x6cf7('0x21')];this['VoiceQueueId']=_0x2d2d34[_0x6cf7('0x22')];this['CampaignId']=_0x2d2d34[_0x6cf7('0x23')];this[_0x6cf7('0x24')]=_0x2d2d34[_0x6cf7('0x24')]||'';this[_0x6cf7('0x25')]=_0x2d2d34[_0x6cf7('0x25')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 13bf74b..7e965ce 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(_0x3f2c58,_0x4d7e66){var _0x1300c1=function(_0x3217c5){while(--_0x3217c5){_0x3f2c58['push'](_0x3f2c58['shift']());}};_0x1300c1(++_0x4d7e66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x4257ec,_0x5550fa){var _0x41bea6=function(_0xf8e5c6){while(--_0xf8e5c6){_0x4257ec['push'](_0x4257ec['shift']());}};_0x41bea6(++_0x5550fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 6695c5d..76137b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc878=['checkTrunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','execOriginate','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','prototype','syncNewState','channelstate','channelstatedesc','syncNewExten','value','operation','status','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Updated]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend'];(function(_0x43139e,_0x762629){var _0x2bc838=function(_0x593ec3){while(--_0x593ec3){_0x43139e['push'](_0x43139e['shift']());}};_0x2bc838(++_0x762629);}(_0xc878,0x17d));var _0x8c87=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0xc878[_0x3074f3];return _0x53f112;};'use strict';var util=require(_0x8c87('0x0'));var _=require(_0x8c87('0x1'));var BPromise=require(_0x8c87('0x2'));var uuid=require(_0x8c87('0x3'));var moment=require(_0x8c87('0x4'));var path=require(_0x8c87('0x5'));var tiff2pdf=require(_0x8c87('0x6'));var gs=require(_0x8c87('0x7'));var logger=require(_0x8c87('0x8'))(_0x8c87('0x9'));var ami=require(_0x8c87('0xa'));var rpcDb=require('./rpcDb');var Channel=require(_0x8c87('0xb'));var ut=require(_0x8c87('0xc'));var Action=require(_0x8c87('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x8c87('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xdee000){this['channels']={};this[_0x8c87('0xf')]=_0xdee000['faxAccounts'];this[_0x8c87('0x10')]=_0xdee000['trunks'];this[_0x8c87('0x11')]={};ami['on'](_0x8c87('0x12'),this[_0x8c87('0x13')][_0x8c87('0x14')](this));ami['on'](_0x8c87('0x15'),this[_0x8c87('0x16')][_0x8c87('0x14')](this));ami['on'](_0x8c87('0x17'),this['syncNewState'][_0x8c87('0x14')](this));ami['on'](_0x8c87('0x18'),this['syncNewExten'][_0x8c87('0x14')](this));ami['on']('faxstatus',this[_0x8c87('0x19')][_0x8c87('0x14')](this));ami['on']('receivefax',this[_0x8c87('0x1a')][_0x8c87('0x14')](this));ami['on'](_0x8c87('0x1b'),this[_0x8c87('0x1c')]['bind'](this));ami['on'](_0x8c87('0x1d'),this[_0x8c87('0x1e')][_0x8c87('0x14')](this));}Fax['prototype'][_0x8c87('0x13')]=function(_0x1a1b38){if(_0x1a1b38[_0x8c87('0x1f')]===_0x8c87('0x20')){for(var _0x5e8e41 in this[_0x8c87('0xf')]){if(this[_0x8c87('0xf')][_0x8c87('0x21')](_0x5e8e41)){if(_0x1a1b38[_0x8c87('0x22')]===this[_0x8c87('0xf')][_0x5e8e41][_0x8c87('0x23')]){this[_0x8c87('0x24')][_0x1a1b38[_0x8c87('0x25')]]={};this['channels'][_0x1a1b38[_0x8c87('0x25')]][_0x8c87('0x26')]=_0x1a1b38[_0x8c87('0x26')];this[_0x8c87('0x24')][_0x1a1b38[_0x8c87('0x25')]]['id']=this[_0x8c87('0xf')][_0x5e8e41]['id'];this['channels'][_0x1a1b38[_0x8c87('0x25')]][_0x8c87('0x27')]=this[_0x8c87('0xf')][_0x5e8e41]['name'];logger['info'](_0x1a1b38[_0x8c87('0x25')],_0x8c87('0x28'));}}}}if(this[_0x8c87('0x11')][_0x1a1b38[_0x8c87('0x25')]]){this[_0x8c87('0x24')][_0x1a1b38['uniqueid']]={};this[_0x8c87('0x24')][_0x1a1b38[_0x8c87('0x25')]][_0x8c87('0x26')]=_0x1a1b38[_0x8c87('0x26')];logger['info'](_0x1a1b38[_0x8c87('0x25')],_0x8c87('0x28'));}};Fax['prototype'][_0x8c87('0x16')]=function(_0x3baa52){if(this[_0x8c87('0x24')][_0x3baa52[_0x8c87('0x25')]]){for(var _0x4ec98c in _0x3baa52[_0x8c87('0x29')]){if(_0x3baa52[_0x8c87('0x29')][_0x8c87('0x21')](_0x4ec98c)){this[_0x8c87('0x24')][_0x3baa52[_0x8c87('0x25')]][_0x4ec98c]=_0x3baa52['value'];}}}};Fax[_0x8c87('0x2a')][_0x8c87('0x2b')]=function(_0x324d15){if(this[_0x8c87('0x24')][_0x324d15['uniqueid']]){this[_0x8c87('0x24')][_0x324d15[_0x8c87('0x25')]][_0x8c87('0x2c')]=_0x324d15[_0x8c87('0x2c')];this[_0x8c87('0x24')][_0x324d15['uniqueid']]['channelstatedesc']=_0x324d15[_0x8c87('0x2d')];}};Fax[_0x8c87('0x2a')][_0x8c87('0x2e')]=function(_0x4b3cca){if(this[_0x8c87('0x24')][_0x4b3cca[_0x8c87('0x25')]]){for(var _0x247487 in _0x4b3cca[_0x8c87('0x29')]){if(_0x4b3cca['variable'][_0x8c87('0x21')](_0x247487)){this[_0x8c87('0x24')][_0x4b3cca['uniqueid']][_0x247487]=_0x4b3cca[_0x8c87('0x2f')];}}}};Fax['prototype'][_0x8c87('0x19')]=function(_0x422adf){if(this[_0x8c87('0x24')][_0x422adf[_0x8c87('0x25')]]){this[_0x8c87('0x24')][_0x422adf[_0x8c87('0x25')]]['operation']=_0x422adf[_0x8c87('0x30')];this[_0x8c87('0x24')][_0x422adf['uniqueid']][_0x8c87('0x31')]=_0x422adf[_0x8c87('0x31')];this[_0x8c87('0x24')][_0x422adf[_0x8c87('0x25')]][_0x8c87('0x23')]=_0x422adf[_0x8c87('0x23')];this[_0x8c87('0x24')][_0x422adf['uniqueid']][_0x8c87('0x32')]=_0x422adf[_0x8c87('0x32')];logger[_0x8c87('0x33')](_0x422adf[_0x8c87('0x25')],_0x8c87('0x34'));}};Fax['prototype']['syncReceiveFax']=function(_0x20f096){var _0x2cbce7=this;if(this[_0x8c87('0x24')][_0x20f096[_0x8c87('0x25')]]){var _0x57572d=this[_0x8c87('0x24')][_0x20f096[_0x8c87('0x25')]]['id'];this[_0x8c87('0x24')][_0x20f096['uniqueid']][_0x8c87('0x35')]=_0x20f096[_0x8c87('0x35')];this['channels'][_0x20f096[_0x8c87('0x25')]][_0x8c87('0x36')]=_0x20f096[_0x8c87('0x36')];this['channels'][_0x20f096[_0x8c87('0x25')]][_0x8c87('0x23')]=_0x20f096[_0x8c87('0x23')];this[_0x8c87('0x24')][_0x20f096[_0x8c87('0x25')]]['resolution']=_0x20f096[_0x8c87('0x37')];this[_0x8c87('0x24')][_0x20f096['uniqueid']][_0x8c87('0x38')]=_0x20f096[_0x8c87('0x38')];this[_0x8c87('0x24')][_0x20f096[_0x8c87('0x25')]][_0x8c87('0x32')]=_0x20f096[_0x8c87('0x32')];this['channels'][_0x20f096[_0x8c87('0x25')]][_0x8c87('0x39')]=_0x20f096[_0x8c87('0x39')];if(this[_0x8c87('0x24')][_0x20f096[_0x8c87('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x20f096[_0x8c87('0x32')],_0x8c87('0x3a'),function(_0x578cce){logger[_0x8c87('0x33')](_0x20f096[_0x8c87('0x25')],_0x8c87('0x3b'),_0x578cce[_0x8c87('0x3c')]);attachment[_0x8c87('0x3d')]({'name':path[_0x8c87('0x3e')](_0x20f096['filename'])['name'],'basename':path[_0x8c87('0x3e')](_0x20f096['filename'])['name']+_0x8c87('0x3f'),'type':_0x8c87('0x40')})[_0x8c87('0x41')](function(_0x21c26d){faxAccount[_0x8c87('0x42')](_0x57572d,{'from':_0x20f096[_0x8c87('0x39')],'mapKey':'fax','body':path[_0x8c87('0x3e')](_0x20f096[_0x8c87('0x32')])[_0x8c87('0x27')]+_0x8c87('0x3f'),'AttachmentId':_0x21c26d['id']})[_0x8c87('0x43')](function(_0x3b4575){logger[_0x8c87('0x44')](_0x20f096[_0x8c87('0x25')],_0x8c87('0x45'),JSON[_0x8c87('0x46')](_0x3b4575));});})[_0x8c87('0x43')](function(_0x3a7be7){logger[_0x8c87('0x44')](_0x20f096[_0x8c87('0x25')],'\x20receiveFax\x20',JSON['stringify'](_0x3a7be7));});});}logger[_0x8c87('0x33')](_0x20f096[_0x8c87('0x25')],_0x8c87('0x47'));}};Fax[_0x8c87('0x2a')][_0x8c87('0x1e')]=function(_0x27d3b1){if(this[_0x8c87('0x11')][_0x27d3b1['uniqueid']]){_[_0x8c87('0x48')](this['channels'][_0x27d3b1[_0x8c87('0x25')]],_[_0x8c87('0x49')](_0x27d3b1,['response',_0x8c87('0x4a')]));}};function updateStatus(_0x57460f){if(_0x57460f[_0x8c87('0x4b')]){faxMessage[_0x8c87('0x4c')](_0x57460f[_0x8c87('0x4b')],{'failMessage':_0x8c87('0x4d')})['then'](function(_0x212bf4){ut[_0x8c87('0x4e')](_0x8c87('0x4f'),_0x212bf4);})[_0x8c87('0x43')](function(_0x645819){ut[_0x8c87('0x4e')]('[Fax][Message][Error][NoUpdate1]',_0x645819);});}else{ut[_0x8c87('0x4e')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x8c87('0x2a')]['updateStatus']=function(_0x38df94,_0x712e18,_0x2548b0){var _0x192449=this;var _0x5a2b5b={};if(_0x712e18){_0x5a2b5b={'read':_0x712e18};}else{_0x5a2b5b={'failMessage':_0x2548b0};}if(this[_0x8c87('0x11')][_0x38df94][_0x8c87('0x4b')]){faxMessage[_0x8c87('0x4c')](this[_0x8c87('0x11')][_0x38df94]['AttachmentId'],_0x5a2b5b)[_0x8c87('0x41')](function(_0x102639){ut[_0x8c87('0x4e')](_0x8c87('0x50'),_0x102639);})[_0x8c87('0x43')](function(_0x220608){ut['logger']('[Fax][Message][NoUpdate1]',_0x220608);})['finally'](function(){delete _0x192449[_0x8c87('0x24')][_0x38df94];delete _0x192449['actions'][_0x38df94];});}else{ut[_0x8c87('0x4e')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x38df94];delete this[_0x8c87('0x11')][_0x38df94];}};Fax[_0x8c87('0x2a')][_0x8c87('0x1c')]=function(_0x10ae15){var _0x267151=this;if(this[_0x8c87('0x24')][_0x10ae15[_0x8c87('0x25')]]){if(this[_0x8c87('0x11')][_0x10ae15[_0x8c87('0x25')]]){this['channels'][_0x10ae15[_0x8c87('0x25')]]['id']=this[_0x8c87('0x11')][_0x10ae15[_0x8c87('0x25')]]['id'];this[_0x8c87('0x24')][_0x10ae15['uniqueid']][_0x8c87('0x27')]=this[_0x8c87('0x11')][_0x10ae15[_0x8c87('0x25')]][_0x8c87('0x27')];}logger[_0x8c87('0x33')](_0x10ae15[_0x8c87('0x25')],this[_0x8c87('0x11')][_0x10ae15[_0x8c87('0x25')]]?_0x8c87('0x51'):_0x8c87('0x52'),JSON['stringify'](this[_0x8c87('0x24')][_0x10ae15[_0x8c87('0x25')]]));if(this['actions'][_0x10ae15['uniqueid']]){if(this[_0x8c87('0x24')][_0x10ae15[_0x8c87('0x25')]][_0x8c87('0x53')]>0x0&&this['channels'][_0x10ae15['uniqueid']][_0x8c87('0x54')]===_0x8c87('0x55')){this[_0x8c87('0x56')](_0x10ae15[_0x8c87('0x25')],!![]);}else{this[_0x8c87('0x56')](_0x10ae15[_0x8c87('0x25')],![],this['channels'][_0x10ae15['uniqueid']][_0x8c87('0x57')]?'SENDING\x20FAILED:\x20'+this[_0x8c87('0x24')][_0x10ae15['uniqueid']][_0x8c87('0x57')]:_0x8c87('0x58'));}}}};Fax[_0x8c87('0x2a')][_0x8c87('0x59')]=function(_0x1c3085){var _0x42b21c=this;return new BPromise(function(_0x4f433b,_0x13aedd){_0x42b21c['execOriginate'](_0x1c3085,_0x42b21c['faxAccounts'][_0x1c3085[_0x8c87('0x5a')]])['then'](function(_0xa7ae24){ut['logger'](_0x8c87('0x5b'),_0xa7ae24);_0x4f433b(ut[_0x8c87('0x3c')]('Fax\x20received'));})[_0x8c87('0x43')](function(_0x5882ae){ut['logger'](_0x8c87('0x5c'),_0x5882ae);updateStatus(_0x1c3085);_0x13aedd(ut[_0x8c87('0x3c')](_0x8c87('0x5d')));});});};Fax[_0x8c87('0x2a')][_0x8c87('0x5e')]=function(_0x5663ae){var _0x2681b4=this;return new BPromise(function(_0x3f4db5,_0x338e6b){var _0x6c8ed2=_0x2681b4[_0x8c87('0x5f')](_0x2681b4[_0x8c87('0xf')][_0x5663ae[_0x8c87('0x5a')]]['Trunk'],_0x5663ae);if(_0x6c8ed2['isValid']){_0x3f4db5(ut[_0x8c87('0x3c')](_0x8c87('0x60')));}else{_0x338e6b(ut[_0x8c87('0x3c')](_0x6c8ed2[_0x8c87('0x3c')]));}});};function originate(_0x218a03,_0x3981c2,_0x1c83e1){return new BPromise(function(_0x131ef5,_0x4395ac){if(_0x1c83e1){var _0xae64bf=util[_0x8c87('0x61')](_0x8c87('0x62'),path[_0x8c87('0x3e')](_0x218a03[_0x8c87('0x5')])['name'],_0x218a03[_0x8c87('0x5')]);gs[_0x8c87('0x63')](_0xae64bf)['then'](function(){_0x218a03['path']=util[_0x8c87('0x61')](_0x8c87('0x64'),path[_0x8c87('0x3e')](_0x218a03[_0x8c87('0x5')])[_0x8c87('0x65')],path[_0x8c87('0x3e')](_0x218a03['path'])[_0x8c87('0x27')]);_0x3981c2[_0x8c87('0x66')]=_0x218a03[_0x8c87('0x5')];ut[_0x8c87('0x4e')](_0x8c87('0x67'),'');ami['Action'](ut[_0x8c87('0x68')](_0x218a03,_0x3981c2))[_0x8c87('0x41')](function(_0x22e7d1){_0x131ef5(_0x22e7d1);})['catch'](function(_0xa273c3){_0x4395ac(_0xa273c3);});})[_0x8c87('0x43')](function(_0x2d9b23){_0x4395ac(_0x2d9b23);});}else{ami['Action'](ut[_0x8c87('0x68')](_0x218a03,_0x3981c2))['then'](function(_0x2b6587){_0x131ef5(_0x2b6587);})['catch'](function(_0x2b98db){_0x4395ac(_0x2b98db);});}});}Fax[_0x8c87('0x2a')][_0x8c87('0x69')]=function(_0x23b7d6,_0x2750ea){var _0x4b4838=this;return new BPromise(function(_0x1cea9c,_0x28dffb){var _0x288bb2=uuid['v4']();var _0x4bba95=ut['addVariables'](_0x23b7d6,_0x2750ea);_0x4b4838[_0x8c87('0x11')][_0x288bb2]=new Action(_0x288bb2,_0x2750ea,_0x23b7d6);var _0x4ae4b5=_0x4b4838['actions'][_0x288bb2];if(path[_0x8c87('0x3e')](_0x23b7d6[_0x8c87('0x5')])[_0x8c87('0x6a')]===_0x8c87('0x3f')){originate(_0x4ae4b5,_0x4bba95,!![])[_0x8c87('0x41')](function(_0x19db48){_0x1cea9c(_0x19db48);})['catch'](function(_0x7e8d58){_0x28dffb(_0x7e8d58);});}else{originate(_0x4ae4b5,_0x4bba95,![])[_0x8c87('0x41')](function(_0x24fde4){_0x1cea9c(_0x24fde4);})[_0x8c87('0x43')](function(_0x58708e){_0x28dffb(_0x58708e);});}});};Fax[_0x8c87('0x2a')]['isTrunkReachable']=function(_0xe00444){return!_[_0x8c87('0x6b')](_0xe00444)&&!_[_0x8c87('0x6b')](_0xe00444[_0x8c87('0x27')])&&!_['isNil'](_0xe00444[_0x8c87('0x6c')])&&_0xe00444[_0x8c87('0x6c')]&&!_[_0x8c87('0x6b')](this[_0x8c87('0x10')][util[_0x8c87('0x61')](_0x8c87('0x6d'),_0xe00444[_0x8c87('0x27')])])&&!_[_0x8c87('0x6b')](this[_0x8c87('0x10')][util['format']('SIP/%s',_0xe00444[_0x8c87('0x27')])][_0x8c87('0x31')])&&(this[_0x8c87('0x10')][util[_0x8c87('0x61')](_0x8c87('0x6d'),_0xe00444['name'])][_0x8c87('0x31')]===_0x8c87('0x6e')||this[_0x8c87('0x10')][util['format']('SIP/%s',_0xe00444['name'])][_0x8c87('0x31')]===_0x8c87('0x6f'));};Fax[_0x8c87('0x2a')]['checkTrunk']=function(_0x46790d,_0x5eb941){if(!this[_0x8c87('0x70')](_0x46790d)){ut[_0x8c87('0x4e')](_0x8c87('0x71'),_['isNil'](_0x46790d)?'':_0x46790d[_0x8c87('0x27')]+_0x8c87('0x72'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x8c87('0x6b')](_0x5eb941['fax'])){ut['logger'](_0x8c87('0x73'),JSON[_0x8c87('0x46')](_0x5eb941));return{'isValid':![],'message':_0x8c87('0x74')};}if(_['isNil'](_0x5eb941[_0x8c87('0x5')])){ut['logger'](_0x8c87('0x75'),JSON[_0x8c87('0x46')](_0x5eb941));return{'isValid':![],'message':_0x8c87('0x76')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
+var _0x0a95=['[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename','localstationid','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','pick','response','AttachmentId','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','updateStatus','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0a95,0x9b));var _0x50a9=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x0a95[_0x20c9b2];return _0x2c6030;};'use strict';var util=require(_0x50a9('0x0'));var _=require('lodash');var BPromise=require(_0x50a9('0x1'));var uuid=require(_0x50a9('0x2'));var moment=require('moment');var path=require(_0x50a9('0x3'));var tiff2pdf=require(_0x50a9('0x4'));var gs=require(_0x50a9('0x5'));var logger=require(_0x50a9('0x6'))(_0x50a9('0x7'));var ami=require(_0x50a9('0x8'));var rpcDb=require(_0x50a9('0x9'));var Channel=require(_0x50a9('0xa'));var ut=require(_0x50a9('0xb'));var Action=require(_0x50a9('0xc'));var faxAccount=require(_0x50a9('0xd'));var attachment=require(_0x50a9('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x27fd8e){this[_0x50a9('0xf')]={};this[_0x50a9('0x10')]=_0x27fd8e['faxAccounts'];this[_0x50a9('0x11')]=_0x27fd8e[_0x50a9('0x11')];this[_0x50a9('0x12')]={};ami['on'](_0x50a9('0x13'),this['syncNewchannel'][_0x50a9('0x14')](this));ami['on'](_0x50a9('0x15'),this[_0x50a9('0x16')]['bind'](this));ami['on']('newstate',this[_0x50a9('0x17')][_0x50a9('0x14')](this));ami['on'](_0x50a9('0x18'),this[_0x50a9('0x19')]['bind'](this));ami['on'](_0x50a9('0x1a'),this[_0x50a9('0x1b')][_0x50a9('0x14')](this));ami['on'](_0x50a9('0x1c'),this[_0x50a9('0x1d')][_0x50a9('0x14')](this));ami['on'](_0x50a9('0x1e'),this[_0x50a9('0x1f')]['bind'](this));ami['on']('originateresponse',this[_0x50a9('0x20')][_0x50a9('0x14')](this));}Fax[_0x50a9('0x21')][_0x50a9('0x22')]=function(_0x2ec7a7){if(_0x2ec7a7[_0x50a9('0x23')]===_0x50a9('0x24')){for(var _0x48b231 in this[_0x50a9('0x10')]){if(this['faxAccounts']['hasOwnProperty'](_0x48b231)){if(_0x2ec7a7[_0x50a9('0x25')]===this[_0x50a9('0x10')][_0x48b231]['localstationid']){this[_0x50a9('0xf')][_0x2ec7a7[_0x50a9('0x26')]]={};this['channels'][_0x2ec7a7[_0x50a9('0x26')]][_0x50a9('0x27')]=_0x2ec7a7['channel'];this[_0x50a9('0xf')][_0x2ec7a7['uniqueid']]['id']=this[_0x50a9('0x10')][_0x48b231]['id'];this[_0x50a9('0xf')][_0x2ec7a7[_0x50a9('0x26')]][_0x50a9('0x28')]=this[_0x50a9('0x10')][_0x48b231][_0x50a9('0x28')];logger[_0x50a9('0x29')](_0x2ec7a7[_0x50a9('0x26')],_0x50a9('0x2a'));}}}}if(this[_0x50a9('0x12')][_0x2ec7a7[_0x50a9('0x26')]]){this['channels'][_0x2ec7a7[_0x50a9('0x26')]]={};this[_0x50a9('0xf')][_0x2ec7a7[_0x50a9('0x26')]][_0x50a9('0x27')]=_0x2ec7a7[_0x50a9('0x27')];logger[_0x50a9('0x29')](_0x2ec7a7[_0x50a9('0x26')],_0x50a9('0x2a'));}};Fax['prototype']['syncVarSet']=function(_0x4c95f2){if(this['channels'][_0x4c95f2[_0x50a9('0x26')]]){for(var _0x3a5dd3 in _0x4c95f2[_0x50a9('0x2b')]){if(_0x4c95f2[_0x50a9('0x2b')]['hasOwnProperty'](_0x3a5dd3)){this[_0x50a9('0xf')][_0x4c95f2[_0x50a9('0x26')]][_0x3a5dd3]=_0x4c95f2['value'];}}}};Fax[_0x50a9('0x21')][_0x50a9('0x17')]=function(_0x3b2e1d){if(this[_0x50a9('0xf')][_0x3b2e1d[_0x50a9('0x26')]]){this[_0x50a9('0xf')][_0x3b2e1d['uniqueid']]['channelstate']=_0x3b2e1d[_0x50a9('0x2c')];this['channels'][_0x3b2e1d[_0x50a9('0x26')]][_0x50a9('0x2d')]=_0x3b2e1d[_0x50a9('0x2d')];}};Fax[_0x50a9('0x21')][_0x50a9('0x19')]=function(_0x59ede1){if(this[_0x50a9('0xf')][_0x59ede1['uniqueid']]){for(var _0x570000 in _0x59ede1[_0x50a9('0x2b')]){if(_0x59ede1[_0x50a9('0x2b')]['hasOwnProperty'](_0x570000)){this[_0x50a9('0xf')][_0x59ede1[_0x50a9('0x26')]][_0x570000]=_0x59ede1[_0x50a9('0x2e')];}}}};Fax[_0x50a9('0x21')]['syncFaxStatus']=function(_0x112f27){if(this[_0x50a9('0xf')][_0x112f27['uniqueid']]){this['channels'][_0x112f27[_0x50a9('0x26')]]['operation']=_0x112f27[_0x50a9('0x2f')];this[_0x50a9('0xf')][_0x112f27[_0x50a9('0x26')]][_0x50a9('0x30')]=_0x112f27[_0x50a9('0x30')];this[_0x50a9('0xf')][_0x112f27['uniqueid']]['localstationid']=_0x112f27['localstationid'];this[_0x50a9('0xf')][_0x112f27[_0x50a9('0x26')]][_0x50a9('0x31')]=_0x112f27[_0x50a9('0x31')];logger[_0x50a9('0x29')](_0x112f27[_0x50a9('0x26')],'\x20syncFaxStatus\x20');}};Fax[_0x50a9('0x21')][_0x50a9('0x1d')]=function(_0x299c09){var _0x313ed4=this;if(this['channels'][_0x299c09[_0x50a9('0x26')]]){var _0xdbf8b5=this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]]['id'];this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]]['remotestationid']=_0x299c09['remotestationid'];this['channels'][_0x299c09[_0x50a9('0x26')]]['pagestransferred']=_0x299c09['pagestransferred'];this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]][_0x50a9('0x32')]=_0x299c09[_0x50a9('0x32')];this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]][_0x50a9('0x33')]=_0x299c09[_0x50a9('0x33')];this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]]['transferrate']=_0x299c09['transferrate'];this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]][_0x50a9('0x31')]=_0x299c09[_0x50a9('0x31')];this['channels'][_0x299c09[_0x50a9('0x26')]][_0x50a9('0x34')]=_0x299c09['calleridnum'];if(this[_0x50a9('0xf')][_0x299c09[_0x50a9('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x299c09['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3e975f){logger[_0x50a9('0x29')](_0x299c09[_0x50a9('0x26')],_0x50a9('0x35'),_0x3e975f[_0x50a9('0x36')]);attachment[_0x50a9('0x37')]({'name':path[_0x50a9('0x38')](_0x299c09[_0x50a9('0x31')])['name'],'basename':path[_0x50a9('0x38')](_0x299c09[_0x50a9('0x31')])[_0x50a9('0x28')]+_0x50a9('0x39'),'type':_0x50a9('0x3a')})[_0x50a9('0x3b')](function(_0x46b2a3){faxAccount[_0x50a9('0x3c')](_0xdbf8b5,{'from':_0x299c09[_0x50a9('0x34')],'mapKey':_0x50a9('0x7'),'body':path[_0x50a9('0x38')](_0x299c09[_0x50a9('0x31')])[_0x50a9('0x28')]+'.pdf','AttachmentId':_0x46b2a3['id']})[_0x50a9('0x3d')](function(_0x14045e){logger[_0x50a9('0x3e')](_0x299c09['uniqueid'],'\x20notify\x20',JSON[_0x50a9('0x3f')](_0x14045e));});})[_0x50a9('0x3d')](function(_0x59a85d){logger[_0x50a9('0x3e')](_0x299c09[_0x50a9('0x26')],_0x50a9('0x40'),JSON[_0x50a9('0x3f')](_0x59a85d));});});}logger['info'](_0x299c09[_0x50a9('0x26')],_0x50a9('0x40'));}};Fax[_0x50a9('0x21')][_0x50a9('0x20')]=function(_0x36bb5f){if(this[_0x50a9('0x12')][_0x36bb5f[_0x50a9('0x26')]]){_['merge'](this[_0x50a9('0xf')][_0x36bb5f[_0x50a9('0x26')]],_[_0x50a9('0x41')](_0x36bb5f,[_0x50a9('0x42'),'reason']));}};function updateStatus(_0x3934f8){if(_0x3934f8['AttachmentId']){faxMessage['update'](_0x3934f8[_0x50a9('0x43')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x43340a){ut['logger'](_0x50a9('0x44'),_0x43340a);})[_0x50a9('0x3d')](function(_0x328242){ut['logger'](_0x50a9('0x45'),_0x328242);});}else{ut[_0x50a9('0x46')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x50a9('0x21')][_0x50a9('0x47')]=function(_0x3d7c19,_0x3af40c,_0x38b536){var _0x31a45e=this;var _0x159405={};if(_0x3af40c){_0x159405={'read':_0x3af40c};}else{_0x159405={'failMessage':_0x38b536};}if(this[_0x50a9('0x12')][_0x3d7c19]['AttachmentId']){faxMessage[_0x50a9('0x48')](this['actions'][_0x3d7c19]['AttachmentId'],_0x159405)[_0x50a9('0x3b')](function(_0x4d0e91){ut[_0x50a9('0x46')](_0x50a9('0x49'),_0x4d0e91);})[_0x50a9('0x3d')](function(_0x2e8fcf){ut[_0x50a9('0x46')](_0x50a9('0x4a'),_0x2e8fcf);})[_0x50a9('0x4b')](function(){delete _0x31a45e[_0x50a9('0xf')][_0x3d7c19];delete _0x31a45e[_0x50a9('0x12')][_0x3d7c19];});}else{ut[_0x50a9('0x46')](_0x50a9('0x4c'));delete this[_0x50a9('0xf')][_0x3d7c19];delete this['actions'][_0x3d7c19];}};Fax[_0x50a9('0x21')][_0x50a9('0x1f')]=function(_0x18426c){var _0x42f2b3=this;if(this[_0x50a9('0xf')][_0x18426c[_0x50a9('0x26')]]){if(this[_0x50a9('0x12')][_0x18426c[_0x50a9('0x26')]]){this[_0x50a9('0xf')][_0x18426c[_0x50a9('0x26')]]['id']=this[_0x50a9('0x12')][_0x18426c[_0x50a9('0x26')]]['id'];this[_0x50a9('0xf')][_0x18426c[_0x50a9('0x26')]]['name']=this[_0x50a9('0x12')][_0x18426c['uniqueid']][_0x50a9('0x28')];}logger[_0x50a9('0x29')](_0x18426c[_0x50a9('0x26')],this[_0x50a9('0x12')][_0x18426c[_0x50a9('0x26')]]?_0x50a9('0x4d'):_0x50a9('0x4e'),JSON[_0x50a9('0x3f')](this[_0x50a9('0xf')][_0x18426c['uniqueid']]));if(this['actions'][_0x18426c[_0x50a9('0x26')]]){if(this[_0x50a9('0xf')][_0x18426c[_0x50a9('0x26')]][_0x50a9('0x4f')]>0x0&&this['channels'][_0x18426c['uniqueid']]['faxstatus']===_0x50a9('0x50')){this[_0x50a9('0x47')](_0x18426c['uniqueid'],!![]);}else{this[_0x50a9('0x47')](_0x18426c[_0x50a9('0x26')],![],this['channels'][_0x18426c['uniqueid']][_0x50a9('0x51')]?'SENDING\x20FAILED:\x20'+this[_0x50a9('0xf')][_0x18426c['uniqueid']][_0x50a9('0x51')]:_0x50a9('0x52'));}}}};Fax[_0x50a9('0x21')][_0x50a9('0x53')]=function(_0x3002ad){var _0x1e5935=this;return new BPromise(function(_0x3fe0af,_0x446e90){_0x1e5935['execOriginate'](_0x3002ad,_0x1e5935[_0x50a9('0x10')][_0x3002ad[_0x50a9('0x54')]])['then'](function(_0x4aa100){ut[_0x50a9('0x46')]('[Fax][execOriginate][success]',_0x4aa100);_0x3fe0af(ut['message'](_0x50a9('0x55')));})[_0x50a9('0x3d')](function(_0x1a191d){ut[_0x50a9('0x46')](_0x50a9('0x56'),_0x1a191d);updateStatus(_0x3002ad);_0x446e90(ut[_0x50a9('0x36')](_0x50a9('0x57')));});});};Fax['prototype'][_0x50a9('0x58')]=function(_0x1b13ae){var _0x3cf872=this;return new BPromise(function(_0x112a2f,_0x38c558){var _0x3dc1b9=_0x3cf872[_0x50a9('0x59')](_0x3cf872[_0x50a9('0x10')][_0x1b13ae[_0x50a9('0x54')]]['Trunk'],_0x1b13ae);if(_0x3dc1b9[_0x50a9('0x5a')]){_0x112a2f(ut[_0x50a9('0x36')](_0x50a9('0x5b')));}else{_0x38c558(ut[_0x50a9('0x36')](_0x3dc1b9['message']));}});};function originate(_0x3a87df,_0x4c2c11,_0x3df745){return new BPromise(function(_0x174f64,_0x1a4985){if(_0x3df745){var _0x4a1c91=util[_0x50a9('0x5c')]('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['parse'](_0x3a87df[_0x50a9('0x3')])['name'],_0x3a87df[_0x50a9('0x3')]);gs[_0x50a9('0x5d')](_0x4a1c91)[_0x50a9('0x3b')](function(){_0x3a87df[_0x50a9('0x3')]=util[_0x50a9('0x5c')](_0x50a9('0x5e'),path[_0x50a9('0x38')](_0x3a87df[_0x50a9('0x3')])[_0x50a9('0x5f')],path[_0x50a9('0x38')](_0x3a87df['path'])['name']);_0x4c2c11[_0x50a9('0x60')]=_0x3a87df['path'];ut[_0x50a9('0x46')](_0x50a9('0x61'),'');ami[_0x50a9('0x62')](ut[_0x50a9('0x63')](_0x3a87df,_0x4c2c11))[_0x50a9('0x3b')](function(_0x11c376){_0x174f64(_0x11c376);})['catch'](function(_0x265bf6){_0x1a4985(_0x265bf6);});})[_0x50a9('0x3d')](function(_0x93242d){_0x1a4985(_0x93242d);});}else{ami['Action'](ut[_0x50a9('0x63')](_0x3a87df,_0x4c2c11))[_0x50a9('0x3b')](function(_0x3d6670){_0x174f64(_0x3d6670);})[_0x50a9('0x3d')](function(_0x55841f){_0x1a4985(_0x55841f);});}});}Fax[_0x50a9('0x21')]['execOriginate']=function(_0x50c647,_0x190f61){var _0x523bf5=this;return new BPromise(function(_0xe7f784,_0xa8cb79){var _0x2637d5=uuid['v4']();var _0x551d06=ut['addVariables'](_0x50c647,_0x190f61);_0x523bf5[_0x50a9('0x12')][_0x2637d5]=new Action(_0x2637d5,_0x190f61,_0x50c647);var _0x10379f=_0x523bf5[_0x50a9('0x12')][_0x2637d5];if(path[_0x50a9('0x38')](_0x50c647[_0x50a9('0x3')])[_0x50a9('0x64')]===_0x50a9('0x39')){originate(_0x10379f,_0x551d06,!![])[_0x50a9('0x3b')](function(_0x30207a){_0xe7f784(_0x30207a);})[_0x50a9('0x3d')](function(_0x4428ef){_0xa8cb79(_0x4428ef);});}else{originate(_0x10379f,_0x551d06,![])[_0x50a9('0x3b')](function(_0x2c6318){_0xe7f784(_0x2c6318);})[_0x50a9('0x3d')](function(_0x48a0bf){_0xa8cb79(_0x48a0bf);});}});};Fax[_0x50a9('0x21')]['isTrunkReachable']=function(_0x1644e2){return!_[_0x50a9('0x65')](_0x1644e2)&&!_[_0x50a9('0x65')](_0x1644e2[_0x50a9('0x28')])&&!_['isNil'](_0x1644e2[_0x50a9('0x66')])&&_0x1644e2['active']&&!_[_0x50a9('0x65')](this[_0x50a9('0x11')][util['format'](_0x50a9('0x67'),_0x1644e2[_0x50a9('0x28')])])&&!_[_0x50a9('0x65')](this[_0x50a9('0x11')][util[_0x50a9('0x5c')](_0x50a9('0x67'),_0x1644e2[_0x50a9('0x28')])][_0x50a9('0x30')])&&(this[_0x50a9('0x11')][util[_0x50a9('0x5c')]('SIP/%s',_0x1644e2[_0x50a9('0x28')])][_0x50a9('0x30')]===_0x50a9('0x68')||this[_0x50a9('0x11')][util[_0x50a9('0x5c')](_0x50a9('0x67'),_0x1644e2['name'])][_0x50a9('0x30')]===_0x50a9('0x69'));};Fax[_0x50a9('0x21')][_0x50a9('0x59')]=function(_0x54a38d,_0x1a0ff4){if(!this[_0x50a9('0x6a')](_0x54a38d)){ut['logger'](_0x50a9('0x6b'),_[_0x50a9('0x65')](_0x54a38d)?'':_0x54a38d[_0x50a9('0x28')]+_0x50a9('0x6c'));return{'isValid':![],'message':_0x50a9('0x6d')};}if(_[_0x50a9('0x65')](_0x1a0ff4[_0x50a9('0x7')])){ut['logger'](_0x50a9('0x6e'),JSON[_0x50a9('0x3f')](_0x1a0ff4));return{'isValid':![],'message':_0x50a9('0x6f')};}if(_[_0x50a9('0x65')](_0x1a0ff4[_0x50a9('0x3')])){ut[_0x50a9('0x46')](_0x50a9('0x70'),JSON[_0x50a9('0x3f')](_0x1a0ff4));return{'isValid':![],'message':_0x50a9('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
index 000331e..bb903f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6148=['error','inspect','resolve','then','notify','bluebird','../../../config/logger','preview'];(function(_0xe495fe,_0x2fe4e4){var _0xf4b23c=function(_0x28a463){while(--_0x28a463){_0xe495fe['push'](_0xe495fe['shift']());}};_0xf4b23c(++_0x2fe4e4);}(_0x6148,0x85));var _0x8614=function(_0x481ab5,_0x3dcd35){_0x481ab5=_0x481ab5-0x0;var _0x213742=_0x6148[_0x481ab5];return _0x213742;};'use strict';var util=require('util');var BPromise=require(_0x8614('0x0'));var logger=require(_0x8614('0x1'))(_0x8614('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x10cea5){return function(_0x466b9d){logger[_0x8614('0x3')](_0x10cea5,util[_0x8614('0x4')](_0x466b9d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4e1c8b,_0x1627cc){return BPromise[_0x8614('0x5')]()[_0x8614('0x6')](faxAccount[_0x8614('0x7')](_0x4e1c8b,_0x1627cc))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x2587=['error','inspect','notify','resolve','then','util','bluebird','../../../config/logger','preview'];(function(_0x2d3490,_0x3f242e){var _0x23df9c=function(_0x35dab0){while(--_0x35dab0){_0x2d3490['push'](_0x2d3490['shift']());}};_0x23df9c(++_0x3f242e);}(_0x2587,0x68));var _0x7258=function(_0x3fcc96,_0x1c65d4){_0x3fcc96=_0x3fcc96-0x0;var _0x5caa7a=_0x2587[_0x3fcc96];return _0x5caa7a;};'use strict';var util=require(_0x7258('0x0'));var BPromise=require(_0x7258('0x1'));var logger=require(_0x7258('0x2'))(_0x7258('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x44cbd9){return function(_0x4c03bf){logger[_0x7258('0x4')](_0x44cbd9,util[_0x7258('0x5')](_0x4c03bf,{'showHidden':![],'depth':null}));};}exports[_0x7258('0x6')]=function(_0x3ee7fb,_0x2380b2){return BPromise[_0x7258('0x7')]()[_0x7258('0x8')](faxAccount[_0x7258('0x6')](_0x3ee7fb,_0x2380b2))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index a9f4daa..cdf0867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9638=['info','Exec\x20gs','inspect','../../../../config/logger','fax','execute'];(function(_0x1c6cf5,_0x1fae9b){var _0x2dc0bf=function(_0x52f4a2){while(--_0x52f4a2){_0x1c6cf5['push'](_0x1c6cf5['shift']());}};_0x2dc0bf(++_0x1fae9b);}(_0x9638,0x1dd));var _0x8963=function(_0x179d07,_0x29431a){_0x179d07=_0x179d07-0x0;var _0xbcbe0b=_0x9638[_0x179d07];return _0xbcbe0b;};'use strict';var util=require('util');var logger=require(_0x8963('0x0'))(_0x8963('0x1'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0x8963('0x2')]=function(_0x4c3d20){return new BPromise(function(_0x1b0795,_0x1583f9){exec(_0x4c3d20,function(_0x29cf74,_0x3e7b94,_0x6fb8a2){logger[_0x8963('0x3')](_0x8963('0x4'),_0x3e7b94);if(_0x29cf74){logger[_0x8963('0x3')](_0x8963('0x4'),'\x20Error\x20:',util[_0x8963('0x5')](_0x29cf74,{'showHidden':![],'depth':null}),_0x3e7b94,_0x6fb8a2);_0x1583f9(_0x29cf74);}_0x1b0795(_0x3e7b94);});});};
\ No newline at end of file
+var _0xf9c2=['fax','bluebird','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x32d3d2,_0x5745fb){var _0x34448d=function(_0x590ff4){while(--_0x590ff4){_0x32d3d2['push'](_0x32d3d2['shift']());}};_0x34448d(++_0x5745fb);}(_0xf9c2,0x1cd));var _0x2f9c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf9c2[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x2f9c('0x0'));var logger=require('../../../../config/logger')(_0x2f9c('0x1'));var BPromise=require(_0x2f9c('0x2'));var exec=require('child_process')['exec'];exports['execute']=function(_0x447181){return new BPromise(function(_0x31b494,_0x4b6227){exec(_0x447181,function(_0x5ad280,_0x2b8a49,_0x19b83f){logger[_0x2f9c('0x3')]('Exec\x20gs',_0x2b8a49);if(_0x5ad280){logger['info'](_0x2f9c('0x4'),_0x2f9c('0x5'),util[_0x2f9c('0x6')](_0x5ad280,{'showHidden':![],'depth':null}),_0x2b8a49,_0x19b83f);_0x4b6227(_0x5ad280);}_0x31b494(_0x2b8a49);});});};
\ No newline at end of file
index 6e7f528..8ce0ea9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aa0=['info','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger'];(function(_0x23431a,_0xa9024c){var _0x66f376=function(_0x2ddea1){while(--_0x2ddea1){_0x23431a['push'](_0x23431a['shift']());}};_0x66f376(++_0xa9024c);}(_0x8aa0,0x1a9));var _0x08aa=function(_0x52da59,_0x3c38bb){_0x52da59=_0x52da59-0x0;var _0x56f83e=_0x8aa0[_0x52da59];return _0x56f83e;};'use strict';var util=require(_0x08aa('0x0'));var _=require(_0x08aa('0x1'));var moment=require(_0x08aa('0x2'));var logger=require(_0x08aa('0x3'))(_0x08aa('0x4'));exports[_0x08aa('0x5')]=function(_0x363923){return{'message':_0x363923};};exports[_0x08aa('0x6')]=function(_0x21a7af,_0x4c3b77){logger[_0x08aa('0x7')](_0x21a7af,util[_0x08aa('0x8')](_0x4c3b77,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x12f727,_0x2f9bab){var _0xc3ee9d={'XMF-ECM':_0x2f9bab['ecm'],'XMF-HEADERINFO':_0x2f9bab[_0x08aa('0x9')],'XMF-MINRATE':_0x2f9bab[_0x08aa('0xa')],'XMF-MAXRATE':_0x2f9bab[_0x08aa('0xb')],'XMF-MODEM':util[_0x08aa('0xc')](_0x08aa('0xd'),_0x2f9bab[_0x08aa('0xe')]),'XMF-GATEWAY':_0x2f9bab['gateway'],'XMF-FAXDETECT':_0x2f9bab['faxdetect'],'XMF-T38TIMEOUT':_0x2f9bab[_0x08aa('0xf')],'XMF-LOCALSTATIONID':_0x2f9bab[_0x08aa('0x10')],'XMF-PATH':_0x12f727[_0x08aa('0x11')]};return _0xc3ee9d;};exports[_0x08aa('0x12')]=function(_0x5a7d1c,_0x147e8b){return{'actionid':_0x5a7d1c[_0x08aa('0x13')],'action':_0x08aa('0x14'),'channel':_0x5a7d1c[_0x08aa('0x15')],'Exten':_0x08aa('0x16'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x08aa('0x17'),_0x5a7d1c[_0x08aa('0x9')]?_0x5a7d1c[_0x08aa('0x9')]:'',_0x5a7d1c[_0x08aa('0x10')]),'variable':_0x147e8b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5a7d1c['uniqueid']};};
\ No newline at end of file
+var _0xc70e=['faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway'];(function(_0x2247dd,_0x8f7f12){var _0x2b56e5=function(_0x3d3d28){while(--_0x3d3d28){_0x2247dd['push'](_0x2247dd['shift']());}};_0x2b56e5(++_0x8f7f12);}(_0xc70e,0x1b3));var _0xec70=function(_0x23428f,_0x288620){_0x23428f=_0x23428f-0x0;var _0x4a1f23=_0xc70e[_0x23428f];return _0x4a1f23;};'use strict';var util=require('util');var _=require(_0xec70('0x0'));var moment=require('moment');var logger=require(_0xec70('0x1'))(_0xec70('0x2'));exports[_0xec70('0x3')]=function(_0x3b7bdb){return{'message':_0x3b7bdb};};exports[_0xec70('0x4')]=function(_0x26df8c,_0x24ec9c){logger['info'](_0x26df8c,util[_0xec70('0x5')](_0x24ec9c,{'showHidden':![],'depth':null}));};exports[_0xec70('0x6')]=function(_0x660c7a,_0x476118){var _0x214185={'XMF-ECM':_0x476118[_0xec70('0x7')],'XMF-HEADERINFO':_0x476118[_0xec70('0x8')],'XMF-MINRATE':_0x476118[_0xec70('0x9')],'XMF-MAXRATE':_0x476118[_0xec70('0xa')],'XMF-MODEM':util[_0xec70('0xb')](_0xec70('0xc'),_0x476118[_0xec70('0xd')]),'XMF-GATEWAY':_0x476118[_0xec70('0xe')],'XMF-FAXDETECT':_0x476118[_0xec70('0xf')],'XMF-T38TIMEOUT':_0x476118[_0xec70('0x10')],'XMF-LOCALSTATIONID':_0x476118[_0xec70('0x11')],'XMF-PATH':_0x660c7a[_0xec70('0x12')]};return _0x214185;};exports[_0xec70('0x13')]=function(_0x1686a1,_0x269722){return{'actionid':_0x1686a1[_0xec70('0x14')],'action':_0xec70('0x15'),'channel':_0x1686a1['channel'],'Exten':_0xec70('0x16'),'Context':_0xec70('0x17'),'Priority':'1','callerid':util[_0xec70('0xb')](_0xec70('0x18'),_0x1686a1['headerinfo']?_0x1686a1[_0xec70('0x8')]:'',_0x1686a1['localstationid']),'variable':_0x269722,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1686a1[_0xec70('0x14')]};};
\ No newline at end of file
index e3e7ed1..4b878cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbb6=['initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./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','then','getTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates'];(function(_0x347f41,_0x2f92cc){var _0xc5bf57=function(_0x10b7fe){while(--_0x10b7fe){_0x347f41['push'](_0x347f41['shift']());}};_0xc5bf57(++_0x2f92cc);}(_0xfbb6,0x134));var _0x6fbb=function(_0x404eed,_0x5390c5){_0x404eed=_0x404eed-0x0;var _0xd45887=_0xfbb6[_0x404eed];return _0xd45887;};'use strict';var BPromise=require(_0x6fbb('0x0'));var util=require(_0x6fbb('0x1'));var moment=require(_0x6fbb('0x2'));var server=require(_0x6fbb('0x3'));var Realtime=require(_0x6fbb('0x4'));var Report=require('./report');var Acw=require(_0x6fbb('0x5'));var Trigger=require(_0x6fbb('0x6'));var Dialer=require('./dialer');var Preview=require(_0x6fbb('0x7'));var Fax=require(_0x6fbb('0x8'));var user=require(_0x6fbb('0x9'));var voiceQueue=require(_0x6fbb('0xa'));var voiceQueueReport=require(_0x6fbb('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6fbb('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x6fbb('0xd'));var cmHopperHistory=require(_0x6fbb('0xe'));var campaign=require(_0x6fbb('0xf'));var voiceExtension=require(_0x6fbb('0x10'));var faxAccount=require(_0x6fbb('0x11'));var zendesk=require(_0x6fbb('0x12'));var salesforce=require(_0x6fbb('0x13'));var sugarcrm=require(_0x6fbb('0x14'));var freshdesk=require(_0x6fbb('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x6fbb('0x16'));var vtiger=require(_0x6fbb('0x17'));var freshsales=require(_0x6fbb('0x18'));var servicenow=require(_0x6fbb('0x19'));var dynamics365=require(_0x6fbb('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6fbb('0x1b')](_0x6fbb('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6fbb('0x1b')](_0x6fbb('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6fbb('0x1d')]()[_0x6fbb('0x1e')](user['getAgents']())['then'](realtime['initAgents']())[_0x6fbb('0x1e')](user[_0x6fbb('0x1f')]())['then'](realtime['initTelephones']())[_0x6fbb('0x1e')](trunk['getTrunks']())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x21')]())[_0x6fbb('0x1e')](trigger[_0x6fbb('0x22')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x23')]())['then'](template[_0x6fbb('0x24')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x25')]())[_0x6fbb('0x1e')](zendesk[_0x6fbb('0x26')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x27')]())[_0x6fbb('0x1e')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x6fbb('0x28')]())['then'](sugarcrm[_0x6fbb('0x29')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x2a')]())[_0x6fbb('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x2b')]())[_0x6fbb('0x1e')](desk[_0x6fbb('0x2c')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x2d')]())[_0x6fbb('0x1e')](zoho['getZohoAccounts']())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x2e')]())[_0x6fbb('0x1e')](vtiger[_0x6fbb('0x2f')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x30')]())[_0x6fbb('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x6fbb('0x31')]())[_0x6fbb('0x1e')](servicenow[_0x6fbb('0x32')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x33')]())[_0x6fbb('0x1e')](dynamics365[_0x6fbb('0x34')]())['then'](realtime['initDynamics365Accounts']())[_0x6fbb('0x1e')](campaign[_0x6fbb('0x35')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x36')]())[_0x6fbb('0x1e')](voiceExtension[_0x6fbb('0x37')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x38')]())[_0x6fbb('0x1e')](faxAccount[_0x6fbb('0x39')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x3a')]())[_0x6fbb('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x6fbb('0x1d')]()[_0x6fbb('0x1e')](voiceQueueReport[_0x6fbb('0x3b')]())[_0x6fbb('0x1e')](realtime['initVoiceQueueReports']())[_0x6fbb('0x1e')](cmHopperHistory[_0x6fbb('0x3c')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x3d')]())[_0x6fbb('0x1e')](cmHopperHistory[_0x6fbb('0x3e')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x3f')]())[_0x6fbb('0x1e')](voiceCallReport[_0x6fbb('0x40')]())[_0x6fbb('0x1e')](realtime[_0x6fbb('0x41')]())[_0x6fbb('0x1e')](function(_0x3cefc8){})[_0x6fbb('0x42')](function(_0x112a48){console[_0x6fbb('0x43')](_0x112a48);});}function main(){return server[_0x6fbb('0x44')](realtime,preview,fax)[_0x6fbb('0x1e')](function(_0x37ca2d){return initRealtime();})[_0x6fbb('0x1e')](function(){return initParams();})[_0x6fbb('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x6fbb('0x42')](function(_0x31e638){console[_0x6fbb('0x43')](_0x31e638);});}main();
\ No newline at end of file
+var _0x60b7=['./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','hour','get','resolve','then','initAgents','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax'];(function(_0xebb119,_0x4b75e0){var _0x4a6314=function(_0x5eb7ed){while(--_0x5eb7ed){_0xebb119['push'](_0xebb119['shift']());}};_0x4a6314(++_0x4b75e0);}(_0x60b7,0x131));var _0x760b=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0x60b7[_0x260073];return _0x4ff033;};'use strict';var BPromise=require(_0x760b('0x0'));var util=require(_0x760b('0x1'));var moment=require(_0x760b('0x2'));var server=require(_0x760b('0x3'));var Realtime=require(_0x760b('0x4'));var Report=require(_0x760b('0x5'));var Acw=require('./acw');var Trigger=require(_0x760b('0x6'));var Dialer=require(_0x760b('0x7'));var Preview=require(_0x760b('0x8'));var Fax=require(_0x760b('0x9'));var user=require('./rpc/user');var voiceQueue=require(_0x760b('0xa'));var voiceQueueReport=require(_0x760b('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x760b('0xc'));var trigger=require(_0x760b('0xd'));var template=require(_0x760b('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x760b('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x760b('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x760b('0x11'));var sugarcrm=require(_0x760b('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x760b('0x13'));var zoho=require(_0x760b('0x14'));var vtiger=require(_0x760b('0x15'));var freshsales=require(_0x760b('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x760b('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x760b('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x760b('0x19')](_0x760b('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x760b('0x1a')]()['then'](user['getAgents']())[_0x760b('0x1b')](realtime[_0x760b('0x1c')]())[_0x760b('0x1b')](user[_0x760b('0x1d')]())[_0x760b('0x1b')](realtime['initTelephones']())[_0x760b('0x1b')](trunk[_0x760b('0x1e')]())[_0x760b('0x1b')](realtime['initTrunks']())[_0x760b('0x1b')](voiceQueue[_0x760b('0x1f')]())[_0x760b('0x1b')](realtime[_0x760b('0x20')]())['then'](trigger['getTriggers']())[_0x760b('0x1b')](realtime[_0x760b('0x21')]())[_0x760b('0x1b')](template['getTemplates']())[_0x760b('0x1b')](realtime[_0x760b('0x22')]())['then'](zendesk[_0x760b('0x23')]())[_0x760b('0x1b')](realtime[_0x760b('0x24')]())[_0x760b('0x1b')](salesforce['getSalesforceAccounts']())[_0x760b('0x1b')](realtime['initSalesforceAccounts']())[_0x760b('0x1b')](sugarcrm[_0x760b('0x25')]())[_0x760b('0x1b')](realtime[_0x760b('0x26')]())[_0x760b('0x1b')](freshdesk[_0x760b('0x27')]())[_0x760b('0x1b')](realtime['initFreshdeskAccounts']())[_0x760b('0x1b')](desk[_0x760b('0x28')]())[_0x760b('0x1b')](realtime['initDeskAccounts']())[_0x760b('0x1b')](zoho[_0x760b('0x29')]())[_0x760b('0x1b')](realtime[_0x760b('0x2a')]())['then'](vtiger[_0x760b('0x2b')]())['then'](realtime[_0x760b('0x2c')]())[_0x760b('0x1b')](freshsales[_0x760b('0x2d')]())['then'](realtime[_0x760b('0x2e')]())[_0x760b('0x1b')](servicenow[_0x760b('0x2f')]())[_0x760b('0x1b')](realtime[_0x760b('0x30')]())[_0x760b('0x1b')](dynamics365['getDynamics365Accounts']())[_0x760b('0x1b')](realtime[_0x760b('0x31')]())[_0x760b('0x1b')](campaign['getCampaigns']())['then'](realtime[_0x760b('0x32')]())[_0x760b('0x1b')](voiceExtension[_0x760b('0x33')]())[_0x760b('0x1b')](realtime[_0x760b('0x34')]())[_0x760b('0x1b')](faxAccount['getFaxAccounts']())['then'](realtime[_0x760b('0x35')]())[_0x760b('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x760b('0x1a')]()[_0x760b('0x1b')](voiceQueueReport[_0x760b('0x36')]())[_0x760b('0x1b')](realtime[_0x760b('0x37')]())[_0x760b('0x1b')](cmHopperHistory[_0x760b('0x38')]())[_0x760b('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0x760b('0x1b')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x760b('0x39')]())[_0x760b('0x1b')](voiceCallReport[_0x760b('0x3a')]())[_0x760b('0x1b')](realtime[_0x760b('0x3b')]())[_0x760b('0x1b')](function(_0x112380){})[_0x760b('0x3c')](function(_0x44bc98){console[_0x760b('0x3d')](_0x44bc98);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x1cb803){return initRealtime();})[_0x760b('0x1b')](function(){return initParams();})[_0x760b('0x1b')](function(){report[_0x760b('0x3e')]();setInterval(initRealtime,0x1388);})[_0x760b('0x3c')](function(_0x24b3f6){console[_0x760b('0x3d')](_0x24b3f6);});}main();
\ No newline at end of file
index 9419487..f8cf4f1 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(_0x39c093,_0x3a3f13){var _0x35d1c1=function(_0x1f9e10){while(--_0x1f9e10){_0x39c093['push'](_0x39c093['shift']());}};_0x35d1c1(++_0x3a3f13);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
+var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x214958,_0x18e5d7){var _0x595949=function(_0x23b060){while(--_0x23b060){_0x214958['push'](_0x214958['shift']());}};_0x595949(++_0x18e5d7);}(_0xe706,0xa3));var _0x6e70=function(_0x34f756,_0x1ea7ab){_0x34f756=_0x34f756-0x0;var _0x26e745=_0xe706[_0x34f756];return _0x26e745;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent;
\ No newline at end of file
index 76e538b..572a3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe848=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x5210a2,_0x4f5288){var _0x597bd9=function(_0x3cadb0){while(--_0x3cadb0){_0x5210a2['push'](_0x5210a2['shift']());}};_0x597bd9(++_0x4f5288);}(_0xe848,0x18a));var _0x8e84=function(_0x32d2b3,_0x448341){_0x32d2b3=_0x32d2b3-0x0;var _0x55a901=_0xe848[_0x32d2b3];return _0x55a901;};'use strict';function Campaign(_0xa17b5){this['id']=_0xa17b5['id']||0x0;this['name']=_0xa17b5['name']||'';this[_0x8e84('0x0')]=_0xa17b5[_0x8e84('0x0')]||_0x8e84('0x1');this['originated']=0x0;this[_0x8e84('0x2')]=0x0;this[_0x8e84('0x3')]=0x0;this[_0x8e84('0x4')]=0x0;this[_0x8e84('0x5')]='';this[_0x8e84('0x6')]=!![];this[_0x8e84('0x7')]=_0xa17b5['active'];this[_0x8e84('0x8')]=_0xa17b5[_0x8e84('0x8')];this['dialTimezone']=_0xa17b5[_0x8e84('0x9')]||null;this[_0x8e84('0xa')]=_0xa17b5[_0x8e84('0xa')]?_0xa17b5[_0x8e84('0xa')]:null;this[_0x8e84('0xb')]=_0xa17b5['dialOriginateCallerIdName'];this[_0x8e84('0xc')]=_0xa17b5[_0x8e84('0xc')];this[_0x8e84('0xd')]=_0xa17b5['dialOriginateTimeout']||0x1e;this[_0x8e84('0xe')]=_0xa17b5['dialCongestionMaxRetry'];this[_0x8e84('0xf')]=_0xa17b5[_0x8e84('0xf')];this[_0x8e84('0x10')]=_0xa17b5[_0x8e84('0x10')];this['dialBusyRetryFrequency']=_0xa17b5[_0x8e84('0x11')];this[_0x8e84('0x12')]=_0xa17b5[_0x8e84('0x12')];this[_0x8e84('0x13')]=_0xa17b5[_0x8e84('0x13')];this[_0x8e84('0x14')]=_0xa17b5[_0x8e84('0x14')];this[_0x8e84('0x15')]=_0xa17b5[_0x8e84('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xa17b5['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8e84('0x16')]=_0xa17b5[_0x8e84('0x16')]||0x3;this[_0x8e84('0x17')]=_0xa17b5[_0x8e84('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0xa17b5[_0x8e84('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0xa17b5['dialAbandonedRetryFrequency']||0x96;this[_0x8e84('0x19')]=_0xa17b5[_0x8e84('0x19')]||0x3;this[_0x8e84('0x1a')]=_0xa17b5['dialMachineRetryFrequency']||0x96;this[_0x8e84('0x1b')]=_0xa17b5[_0x8e84('0x1b')]||0x3;this[_0x8e84('0x1c')]=_0xa17b5[_0x8e84('0x1c')]||0x96;this[_0x8e84('0x1d')]=_0xa17b5[_0x8e84('0x1d')]||_0x8e84('0x1e');this['dialPrefix']=_0xa17b5[_0x8e84('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xa17b5[_0x8e84('0x20')]||undefined;this[_0x8e84('0x21')]=_0xa17b5[_0x8e84('0x21')]||undefined;this['TrunkBackup']=_0xa17b5['TrunkBackup']?_0xa17b5[_0x8e84('0x22')]:undefined;this['Trunk']=_0xa17b5['Trunk']?_0xa17b5[_0x8e84('0x23')]:undefined;this[_0x8e84('0x24')]=_0xa17b5['Interval']?_0xa17b5[_0x8e84('0x24')]:undefined;this[_0x8e84('0x25')]=_0xa17b5['SquareProject']?_0xa17b5[_0x8e84('0x25')]:undefined;this[_0x8e84('0x26')]=_0xa17b5['SquareProject']?_0xa17b5['SquareProject'][_0x8e84('0x27')]:undefined;this[_0x8e84('0x28')]=_0xa17b5['dialAMDActive']||![];this['dialAMDInitialSilence']=_0xa17b5[_0x8e84('0x29')];this[_0x8e84('0x2a')]=_0xa17b5[_0x8e84('0x2a')];this[_0x8e84('0x2b')]=_0xa17b5[_0x8e84('0x2b')];this[_0x8e84('0x2c')]=_0xa17b5[_0x8e84('0x2c')];this[_0x8e84('0x2d')]=_0xa17b5[_0x8e84('0x2d')];this['dialAMDBetweenWordsSilence']=_0xa17b5[_0x8e84('0x2e')];this[_0x8e84('0x2f')]=_0xa17b5[_0x8e84('0x2f')];this['dialAMDSilenceThreshold']=_0xa17b5[_0x8e84('0x30')];this[_0x8e84('0x31')]=_0xa17b5[_0x8e84('0x31')];}module[_0x8e84('0x32')]=Campaign;
\ No newline at end of file
+var _0xeacf=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','message','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x260822,_0x49bbbb){var _0x158bd0=function(_0x2b0181){while(--_0x2b0181){_0x260822['push'](_0x260822['shift']());}};_0x158bd0(++_0x49bbbb);}(_0xeacf,0x1c8));var _0xfeac=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xeacf[_0x1e2321];return _0x1d346d;};'use strict';function Campaign(_0x3e1c8f){this['id']=_0x3e1c8f['id']||0x0;this[_0xfeac('0x0')]=_0x3e1c8f[_0xfeac('0x0')]||'';this['type']=_0x3e1c8f[_0xfeac('0x1')]||_0xfeac('0x2');this[_0xfeac('0x3')]=0x0;this['temp']=0x0;this[_0xfeac('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xfeac('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xfeac('0x6')]=_0x3e1c8f[_0xfeac('0x6')];this['limitCalls']=_0x3e1c8f['limitCalls'];this[_0xfeac('0x7')]=_0x3e1c8f[_0xfeac('0x7')]||null;this[_0xfeac('0x8')]=_0x3e1c8f[_0xfeac('0x8')]?_0x3e1c8f[_0xfeac('0x8')]:null;this[_0xfeac('0x9')]=_0x3e1c8f[_0xfeac('0x9')];this[_0xfeac('0xa')]=_0x3e1c8f[_0xfeac('0xa')];this[_0xfeac('0xb')]=_0x3e1c8f[_0xfeac('0xb')]||0x1e;this[_0xfeac('0xc')]=_0x3e1c8f[_0xfeac('0xc')];this[_0xfeac('0xd')]=_0x3e1c8f[_0xfeac('0xd')];this[_0xfeac('0xe')]=_0x3e1c8f[_0xfeac('0xe')];this[_0xfeac('0xf')]=_0x3e1c8f[_0xfeac('0xf')];this[_0xfeac('0x10')]=_0x3e1c8f[_0xfeac('0x10')];this[_0xfeac('0x11')]=_0x3e1c8f[_0xfeac('0x11')];this[_0xfeac('0x12')]=_0x3e1c8f['dialGlobalMaxRetry'];this[_0xfeac('0x13')]=_0x3e1c8f[_0xfeac('0x13')]||0x3;this[_0xfeac('0x14')]=_0x3e1c8f[_0xfeac('0x14')]||0x96;this[_0xfeac('0x15')]=_0x3e1c8f[_0xfeac('0x15')]||0x3;this[_0xfeac('0x16')]=_0x3e1c8f[_0xfeac('0x16')]||0x96;this[_0xfeac('0x17')]=_0x3e1c8f[_0xfeac('0x17')]||0x3;this[_0xfeac('0x18')]=_0x3e1c8f[_0xfeac('0x18')]||0x96;this[_0xfeac('0x19')]=_0x3e1c8f[_0xfeac('0x19')]||0x3;this[_0xfeac('0x1a')]=_0x3e1c8f[_0xfeac('0x1a')]||0x96;this[_0xfeac('0x1b')]=_0x3e1c8f[_0xfeac('0x1b')]||0x3;this[_0xfeac('0x1c')]=_0x3e1c8f[_0xfeac('0x1c')]||0x96;this[_0xfeac('0x1d')]=_0x3e1c8f['dialOrderByScheduledAt']||_0xfeac('0x1e');this[_0xfeac('0x1f')]=_0x3e1c8f[_0xfeac('0x1f')]||undefined;this[_0xfeac('0x20')]=_0x3e1c8f[_0xfeac('0x20')]||undefined;this[_0xfeac('0x21')]=_0x3e1c8f[_0xfeac('0x21')]||undefined;this[_0xfeac('0x22')]=_0x3e1c8f[_0xfeac('0x22')]?_0x3e1c8f[_0xfeac('0x22')]:undefined;this[_0xfeac('0x23')]=_0x3e1c8f[_0xfeac('0x23')]?_0x3e1c8f['Trunk']:undefined;this[_0xfeac('0x24')]=_0x3e1c8f[_0xfeac('0x24')]?_0x3e1c8f[_0xfeac('0x24')]:undefined;this[_0xfeac('0x25')]=_0x3e1c8f['SquareProject']?_0x3e1c8f[_0xfeac('0x25')]:undefined;this[_0xfeac('0x26')]=_0x3e1c8f['SquareProject']?_0x3e1c8f[_0xfeac('0x25')][_0xfeac('0x0')]:undefined;this[_0xfeac('0x27')]=_0x3e1c8f[_0xfeac('0x27')]||![];this[_0xfeac('0x28')]=_0x3e1c8f[_0xfeac('0x28')];this[_0xfeac('0x29')]=_0x3e1c8f[_0xfeac('0x29')];this[_0xfeac('0x2a')]=_0x3e1c8f['dialAMDAfterGreetingSilence'];this[_0xfeac('0x2b')]=_0x3e1c8f[_0xfeac('0x2b')];this[_0xfeac('0x2c')]=_0x3e1c8f[_0xfeac('0x2c')];this[_0xfeac('0x2d')]=_0x3e1c8f[_0xfeac('0x2d')];this[_0xfeac('0x2e')]=_0x3e1c8f[_0xfeac('0x2e')];this[_0xfeac('0x2f')]=_0x3e1c8f[_0xfeac('0x2f')];this[_0xfeac('0x30')]=_0x3e1c8f[_0xfeac('0x30')];}module[_0xfeac('0x31')]=Campaign;
\ No newline at end of file
index 8273da4..bf8c590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd679=['unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime'];(function(_0x32e22c,_0x4b7ac6){var _0x426aba=function(_0x166e46){while(--_0x166e46){_0x32e22c['push'](_0x32e22c['shift']());}};_0x426aba(++_0x4b7ac6);}(_0xd679,0xcc));var _0x9d67=function(_0x371b9d,_0x5ca64f){_0x371b9d=_0x371b9d-0x0;var _0x11ef67=_0xd679[_0x371b9d];return _0x11ef67;};'use strict';function Channel(){this['starttime']=null;this[_0x9d67('0x0')]='';this[_0x9d67('0x1')]='';this[_0x9d67('0x2')]=0x0;this[_0x9d67('0x3')]='';this[_0x9d67('0x4')]=undefined;this[_0x9d67('0x5')]=undefined;this[_0x9d67('0x6')]=0x0;this[_0x9d67('0x7')]='';this[_0x9d67('0x8')]=0x0;this[_0x9d67('0x9')]=0x0;this[_0x9d67('0xa')]=0x0;this['answered']=![];this[_0x9d67('0xb')]=null;this['endtime']=null;this[_0x9d67('0xc')]=![];this[_0x9d67('0xd')]=![];this[_0x9d67('0xe')]='';this['lastdata']='';this[_0x9d67('0xf')]=0x0;this[_0x9d67('0x10')]=0x0;this[_0x9d67('0x11')]=0x0;this[_0x9d67('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x9d67('0x13')]=null;this[_0x9d67('0x14')]=null;this[_0x9d67('0x15')]=[];this[_0x9d67('0x16')]=undefined;this[_0x9d67('0x17')]=undefined;this[_0x9d67('0x18')]=undefined;this[_0x9d67('0x19')]=0x0;}module[_0x9d67('0x1a')]=Channel;
\ No newline at end of file
+var _0x1131=['endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime'];(function(_0x1795d9,_0x4ce819){var _0x5dd910=function(_0x10b850){while(--_0x10b850){_0x1795d9['push'](_0x1795d9['shift']());}};_0x5dd910(++_0x4ce819);}(_0x1131,0x1c4));var _0x1113=function(_0x385d3f,_0x2573da){_0x385d3f=_0x385d3f-0x0;var _0x45d7f2=_0x1131[_0x385d3f];return _0x45d7f2;};'use strict';function Channel(){this[_0x1113('0x0')]=null;this[_0x1113('0x1')]='';this[_0x1113('0x2')]='';this[_0x1113('0x3')]=0x0;this[_0x1113('0x4')]='';this['connectedlinenum']=undefined;this[_0x1113('0x5')]=undefined;this[_0x1113('0x6')]=0x0;this[_0x1113('0x7')]='';this[_0x1113('0x8')]=0x0;this[_0x1113('0x9')]=0x0;this[_0x1113('0xa')]=0x0;this[_0x1113('0xb')]=![];this[_0x1113('0xc')]=null;this[_0x1113('0xd')]=null;this[_0x1113('0xe')]=![];this[_0x1113('0xf')]=![];this[_0x1113('0x10')]='';this[_0x1113('0x11')]='';this[_0x1113('0x12')]=0x0;this[_0x1113('0x13')]=0x0;this[_0x1113('0x14')]=0x0;this[_0x1113('0x15')]=null;this[_0x1113('0x16')]=null;this[_0x1113('0x17')]=null;this[_0x1113('0x18')]=![];this[_0x1113('0x19')]=null;this[_0x1113('0x1a')]=null;this[_0x1113('0x1b')]=[];this['transfercalleridnum']=undefined;this[_0x1113('0x1c')]=undefined;this['transferType']=undefined;this[_0x1113('0x1d')]=0x0;}module[_0x1113('0x1e')]=Channel;
\ No newline at end of file
index f120dd2..ed47e6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c1=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','Configurations','exports','name','username'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x47c1,0x11e));var _0x147c=function(_0x427b2a,_0x181905){_0x427b2a=_0x427b2a-0x0;var _0x239493=_0x47c1[_0x427b2a];return _0x239493;};'use strict';function DeskAccount(_0x5e5420){this['id']=_0x5e5420['id']||0x0;this[_0x147c('0x0')]=_0x5e5420['name']||'';this[_0x147c('0x1')]=_0x5e5420[_0x147c('0x1')]||'';this[_0x147c('0x2')]=_0x5e5420[_0x147c('0x2')]||'';this[_0x147c('0x3')]=_0x5e5420['authType']||'';this[_0x147c('0x4')]=_0x5e5420[_0x147c('0x4')]||'';this[_0x147c('0x5')]=_0x5e5420[_0x147c('0x5')]||'';this[_0x147c('0x6')]=_0x5e5420[_0x147c('0x6')]||'';this['token']=_0x5e5420[_0x147c('0x7')]||'';this[_0x147c('0x8')]=_0x5e5420['tokenSecret']||'';this[_0x147c('0x9')]=_0x5e5420[_0x147c('0x9')]||'';this['serverUrl']=_0x5e5420['serverUrl']||'';this[_0x147c('0xa')]=_0x5e5420[_0x147c('0xa')]||{};}module[_0x147c('0xb')]=DeskAccount;
\ No newline at end of file
+var _0x42e5=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','name','username','remoteUri','authType','password'];(function(_0x3ec06d,_0x50fb43){var _0x174979=function(_0x2691f8){while(--_0x2691f8){_0x3ec06d['push'](_0x3ec06d['shift']());}};_0x174979(++_0x50fb43);}(_0x42e5,0x8a));var _0x542e=function(_0x3bcb39,_0x2e1bd0){_0x3bcb39=_0x3bcb39-0x0;var _0x158bc4=_0x42e5[_0x3bcb39];return _0x158bc4;};'use strict';function DeskAccount(_0x1bf569){this['id']=_0x1bf569['id']||0x0;this[_0x542e('0x0')]=_0x1bf569['name']||'';this[_0x542e('0x1')]=_0x1bf569[_0x542e('0x1')]||'';this[_0x542e('0x2')]=_0x1bf569[_0x542e('0x2')]||'';this[_0x542e('0x3')]=_0x1bf569['authType']||'';this[_0x542e('0x4')]=_0x1bf569[_0x542e('0x4')]||'';this[_0x542e('0x5')]=_0x1bf569['consumerKey']||'';this[_0x542e('0x6')]=_0x1bf569[_0x542e('0x6')]||'';this[_0x542e('0x7')]=_0x1bf569[_0x542e('0x7')]||'';this[_0x542e('0x8')]=_0x1bf569[_0x542e('0x8')]||'';this[_0x542e('0x9')]=_0x1bf569['type']||'';this[_0x542e('0xa')]=_0x1bf569['serverUrl']||'';this['Configurations']=_0x1bf569['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 73ae04d..002e765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x34b7,0x196));var _0x734b=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0x34b7[_0x1aec02];return _0x10a837;};'use strict';function Dynamics365Account(_0x3573c4){this['id']=_0x3573c4['id']||0x0;this['name']=_0x3573c4[_0x734b('0x0')]||'';this[_0x734b('0x1')]=_0x3573c4[_0x734b('0x1')]||'';this[_0x734b('0x2')]=_0x3573c4[_0x734b('0x2')]||'';this[_0x734b('0x3')]=_0x3573c4['remoteUri']||'';this['tenantId']=_0x3573c4[_0x734b('0x4')]||'';this[_0x734b('0x5')]=_0x3573c4[_0x734b('0x5')]||'';this[_0x734b('0x6')]=_0x3573c4[_0x734b('0x6')]||{};this[_0x734b('0x7')]=_0x3573c4['serverUrl']||'';this[_0x734b('0x8')]=_0x3573c4[_0x734b('0x8')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x0713=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||'';this[_0x3071('0x2')]=_0x4bf247[_0x3071('0x2')]||'';this['remoteUri']=_0x4bf247[_0x3071('0x3')]||'';this[_0x3071('0x4')]=_0x4bf247[_0x3071('0x4')]||'';this[_0x3071('0x5')]=_0x4bf247[_0x3071('0x5')]||'';this[_0x3071('0x6')]=_0x4bf247[_0x3071('0x6')]||{};this[_0x3071('0x7')]=_0x4bf247[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x4bf247[_0x3071('0x8')]||{};}module[_0x3071('0x9')]=Dynamics365Account;
\ No newline at end of file
index abd84f2..38bdf81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5db=['SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x503106,_0x312a8b){var _0x53c70f=function(_0x44c0db){while(--_0x44c0db){_0x503106['push'](_0x503106['shift']());}};_0x53c70f(++_0x312a8b);}(_0xa5db,0x1e1));var _0xba5d=function(_0x1e64e0,_0x511639){_0x1e64e0=_0x1e64e0-0x0;var _0x4d5711=_0xa5db[_0x1e64e0];return _0x4d5711;};'use strict';function FaxAccount(_0x16b4bb){this['id']=_0x16b4bb['id']||0x0;this[_0xba5d('0x0')]=_0x16b4bb['name']||'';this['description']=_0x16b4bb['description'];this[_0xba5d('0x1')]=_0x16b4bb[_0xba5d('0x1')];this[_0xba5d('0x2')]=_0x16b4bb['headerinfo'];this[_0xba5d('0x3')]=_0x16b4bb[_0xba5d('0x3')];this[_0xba5d('0x4')]=_0x16b4bb[_0xba5d('0x4')]||0x960;this[_0xba5d('0x5')]=_0x16b4bb[_0xba5d('0x5')]||0x3840;this['modem']=_0x16b4bb[_0xba5d('0x6')]||_0xba5d('0x7');this[_0xba5d('0x8')]=_0x16b4bb['gateway']||'no';this[_0xba5d('0x9')]=_0x16b4bb['faxdetect']||'no';this[_0xba5d('0xa')]=_0x16b4bb['t38timeout']||0x1388;this[_0xba5d('0xb')]=_0x16b4bb[_0xba5d('0xb')]||_0xba5d('0xc');this[_0xba5d('0xd')]=_0x16b4bb[_0xba5d('0xd')]?_0x16b4bb['Trunk']:undefined;this[_0xba5d('0xe')]=_0x16b4bb[_0xba5d('0xe')];this[_0xba5d('0xf')]=_0x16b4bb['key'];}module[_0xba5d('0x10')]=FaxAccount;
\ No newline at end of file
+var _0x59ac=['Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x54af0f,_0x45843){var _0x4c553e=function(_0x576dc0){while(--_0x576dc0){_0x54af0f['push'](_0x54af0f['shift']());}};_0x4c553e(++_0x45843);}(_0x59ac,0x73));var _0xc59a=function(_0x27b7ac,_0x2350b9){_0x27b7ac=_0x27b7ac-0x0;var _0x5a1274=_0x59ac[_0x27b7ac];return _0x5a1274;};'use strict';function FaxAccount(_0x341ef9){this['id']=_0x341ef9['id']||0x0;this[_0xc59a('0x0')]=_0x341ef9[_0xc59a('0x0')]||'';this[_0xc59a('0x1')]=_0x341ef9[_0xc59a('0x1')];this['ecm']=_0x341ef9[_0xc59a('0x2')];this[_0xc59a('0x3')]=_0x341ef9['headerinfo'];this[_0xc59a('0x4')]=_0x341ef9[_0xc59a('0x4')];this[_0xc59a('0x5')]=_0x341ef9[_0xc59a('0x5')]||0x960;this[_0xc59a('0x6')]=_0x341ef9['maxrate']||0x3840;this[_0xc59a('0x7')]=_0x341ef9['modem']||_0xc59a('0x8');this['gateway']=_0x341ef9[_0xc59a('0x9')]||'no';this['faxdetect']=_0x341ef9[_0xc59a('0xa')]||'no';this['t38timeout']=_0x341ef9[_0xc59a('0xb')]||0x1388;this['tech']=_0x341ef9[_0xc59a('0xc')]||'SIP';this[_0xc59a('0xd')]=_0x341ef9[_0xc59a('0xd')]?_0x341ef9[_0xc59a('0xd')]:undefined;this['ListId']=_0x341ef9[_0xc59a('0xe')];this[_0xc59a('0xf')]=_0x341ef9[_0xc59a('0xf')];}module['exports']=FaxAccount;
\ No newline at end of file
index 6a9dab2..c865af2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd809=['serverUrl','exports','name','username','apiKey','remoteUri'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0xd809,0x1ca));var _0x9d80=function(_0x3e2e81,_0x29f955){_0x3e2e81=_0x3e2e81-0x0;var _0x5dc8b3=_0xd809[_0x3e2e81];return _0x5dc8b3;};'use strict';function FreshdeskAccount(_0x544682){this['id']=_0x544682['id']||0x0;this[_0x9d80('0x0')]=_0x544682[_0x9d80('0x0')]||'';this[_0x9d80('0x1')]=_0x544682[_0x9d80('0x1')]||'';this[_0x9d80('0x2')]=_0x544682['token']||'';this[_0x9d80('0x3')]=_0x544682[_0x9d80('0x3')]||'';this[_0x9d80('0x4')]=_0x544682[_0x9d80('0x4')]||'';this['Configurations']=_0x544682['Configurations']||{};}module[_0x9d80('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0x56f6=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x22b571,_0x47fbbe){var _0x452544=function(_0x293990){while(--_0x293990){_0x22b571['push'](_0x22b571['shift']());}};_0x452544(++_0x47fbbe);}(_0x56f6,0x1ae));var _0x656f=function(_0x12d293,_0x48be2c){_0x12d293=_0x12d293-0x0;var _0x24da92=_0x56f6[_0x12d293];return _0x24da92;};'use strict';function FreshdeskAccount(_0x500e3){this['id']=_0x500e3['id']||0x0;this[_0x656f('0x0')]=_0x500e3[_0x656f('0x0')]||'';this[_0x656f('0x1')]=_0x500e3[_0x656f('0x1')]||'';this[_0x656f('0x2')]=_0x500e3[_0x656f('0x3')]||'';this[_0x656f('0x4')]=_0x500e3[_0x656f('0x4')]||'';this['serverUrl']=_0x500e3[_0x656f('0x5')]||'';this['Configurations']=_0x500e3[_0x656f('0x6')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 0b97f14..8209caf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0ae=['username','apiKey','remoteUri','serverUrl','exports','name'];(function(_0x13484b,_0x16f9b5){var _0x5e0b0d=function(_0x500d6a){while(--_0x500d6a){_0x13484b['push'](_0x13484b['shift']());}};_0x5e0b0d(++_0x16f9b5);}(_0xe0ae,0xa1));var _0xee0a=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0xe0ae[_0x588011];return _0x3b3773;};'use strict';function FreshsalesAccount(_0x2a3755){this['id']=_0x2a3755['id']||0x0;this['name']=_0x2a3755[_0xee0a('0x0')]||'';this[_0xee0a('0x1')]=_0x2a3755['username']||'';this[_0xee0a('0x2')]=_0x2a3755['token']||'';this[_0xee0a('0x3')]=_0x2a3755[_0xee0a('0x3')]||'';this['serverUrl']=_0x2a3755[_0xee0a('0x4')]||'';this['Configurations']=_0x2a3755['Configurations']||{};}module[_0xee0a('0x5')]=FreshsalesAccount;
\ No newline at end of file
+var _0x6753=['name','username','apiKey','token','remoteUri','serverUrl','exports'];(function(_0x403564,_0x4e5d70){var _0x286290=function(_0x140be8){while(--_0x140be8){_0x403564['push'](_0x403564['shift']());}};_0x286290(++_0x4e5d70);}(_0x6753,0xa1));var _0x3675=function(_0x25c86c,_0x106989){_0x25c86c=_0x25c86c-0x0;var _0x2c36ff=_0x6753[_0x25c86c];return _0x2c36ff;};'use strict';function FreshsalesAccount(_0x2f30ab){this['id']=_0x2f30ab['id']||0x0;this[_0x3675('0x0')]=_0x2f30ab[_0x3675('0x0')]||'';this[_0x3675('0x1')]=_0x2f30ab['username']||'';this[_0x3675('0x2')]=_0x2f30ab[_0x3675('0x3')]||'';this['remoteUri']=_0x2f30ab[_0x3675('0x4')]||'';this[_0x3675('0x5')]=_0x2f30ab['serverUrl']||'';this['Configurations']=_0x2f30ab['Configurations']||{};}module[_0x3675('0x6')]=FreshsalesAccount;
\ No newline at end of file
index 63486a1..7f2866f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9774=['assigned','lastAssignedTo','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','priority'];(function(_0x23a13b,_0x340dc){var _0xc6735e=function(_0x1499e4){while(--_0x1499e4){_0x23a13b['push'](_0x23a13b['shift']());}};_0xc6735e(++_0x340dc);}(_0x9774,0xdd));var _0x4977=function(_0x37d8a4,_0x1c504f){_0x37d8a4=_0x37d8a4-0x0;var _0x44daea=_0x9774[_0x37d8a4];return _0x44daea;};'use strict';function QueueReport(){this['type']=_0x4977('0x0');this[_0x4977('0x1')]='';this[_0x4977('0x2')]='';this[_0x4977('0x3')]='';this[_0x4977('0x4')]='';this['queuecallerjoinAt']=null;this[_0x4977('0x5')]=null;this[_0x4977('0x6')]=0x1;this[_0x4977('0x7')]=0x1;this[_0x4977('0x8')]=![];this[_0x4977('0x9')]=null;this[_0x4977('0xa')]=![];this[_0x4977('0xb')]=null;this[_0x4977('0xc')]=![];this[_0x4977('0xd')]=null;this[_0x4977('0xe')]=0x1;this[_0x4977('0xf')]='';this[_0x4977('0x10')]='';this[_0x4977('0x11')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0x4977('0x12')]='';this['holdtime']=0x0;this[_0x4977('0x13')]=![];this[_0x4977('0x14')]='';this[_0x4977('0x15')]=0x0;this[_0x4977('0x16')]={};}module[_0x4977('0x17')]=QueueReport;
\ No newline at end of file
+var _0xd056=['context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0xd1afbb,_0x50dac0){var _0x22502a=function(_0x416ad6){while(--_0x416ad6){_0xd1afbb['push'](_0xd1afbb['shift']());}};_0x22502a(++_0x50dac0);}(_0xd056,0xa5));var _0x6d05=function(_0x4613bb,_0x3ef78b){_0x4613bb=_0x4613bb-0x0;var _0x24edab=_0xd056[_0x4613bb];return _0x24edab;};'use strict';function QueueReport(){this[_0x6d05('0x0')]=_0x6d05('0x1');this[_0x6d05('0x2')]='';this[_0x6d05('0x3')]='';this[_0x6d05('0x4')]='';this[_0x6d05('0x5')]='';this['queuecallerjoinAt']=null;this[_0x6d05('0x6')]=null;this[_0x6d05('0x7')]=0x1;this[_0x6d05('0x8')]=0x1;this[_0x6d05('0x9')]=![];this[_0x6d05('0xa')]=null;this[_0x6d05('0xb')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0x6d05('0xc')]=null;this['originalposition']=0x1;this[_0x6d05('0xd')]='';this[_0x6d05('0xe')]='';this[_0x6d05('0xf')]='';this[_0x6d05('0x10')]='';this[_0x6d05('0x11')]='';this[_0x6d05('0x12')]='';this[_0x6d05('0x13')]='';this[_0x6d05('0x14')]=0x0;this[_0x6d05('0x15')]=![];this[_0x6d05('0x16')]='';this[_0x6d05('0x17')]=0x0;this[_0x6d05('0x18')]={};}module[_0x6d05('0x19')]=QueueReport;
\ No newline at end of file
index 2a7f854..16deb8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe939=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x588dd2,_0x5c8152){var _0x4f208e=function(_0x12c652){while(--_0x12c652){_0x588dd2['push'](_0x588dd2['shift']());}};_0x4f208e(++_0x5c8152);}(_0xe939,0xda));var _0x9e93=function(_0x145837,_0x401861){_0x145837=_0x145837-0x0;var _0x40ec28=_0xe939[_0x145837];return _0x40ec28;};'use strict';function SalesforceAccount(_0x352a79){this['id']=_0x352a79['id']||0x0;this[_0x9e93('0x0')]=_0x352a79[_0x9e93('0x0')]||'';this[_0x9e93('0x1')]=_0x352a79[_0x9e93('0x1')]||'';this[_0x9e93('0x2')]=_0x352a79['remoteUri']||'';this[_0x9e93('0x3')]=_0x352a79[_0x9e93('0x3')]||'';this[_0x9e93('0x4')]=_0x352a79[_0x9e93('0x4')]||'';this[_0x9e93('0x5')]=_0x352a79[_0x9e93('0x5')]||'';this[_0x9e93('0x6')]=_0x352a79[_0x9e93('0x6')]||'';this[_0x9e93('0x7')]=_0x352a79[_0x9e93('0x7')]||'integrationTab';this[_0x9e93('0x8')]=_0x352a79['serverUrl']||'';this[_0x9e93('0x9')]=_0x352a79[_0x9e93('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0xf58a=['serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x9648c,_0x1d77c7){var _0x1a9acb=function(_0xc5145e){while(--_0xc5145e){_0x9648c['push'](_0x9648c['shift']());}};_0x1a9acb(++_0x1d77c7);}(_0xf58a,0xde));var _0xaf58=function(_0x399a1e,_0x5d7c30){_0x399a1e=_0x399a1e-0x0;var _0x1077e1=_0xf58a[_0x399a1e];return _0x1077e1;};'use strict';function SalesforceAccount(_0x2cc995){this['id']=_0x2cc995['id']||0x0;this[_0xaf58('0x0')]=_0x2cc995[_0xaf58('0x0')]||'';this['username']=_0x2cc995[_0xaf58('0x1')]||'';this[_0xaf58('0x2')]=_0x2cc995['remoteUri']||'';this[_0xaf58('0x3')]=_0x2cc995[_0xaf58('0x3')]||'';this[_0xaf58('0x4')]=_0x2cc995['clientId']||'';this[_0xaf58('0x5')]=_0x2cc995['clientSecret']||'';this[_0xaf58('0x6')]=_0x2cc995[_0xaf58('0x6')]||'';this[_0xaf58('0x7')]=_0x2cc995[_0xaf58('0x7')]||_0xaf58('0x8');this['serverUrl']=_0x2cc995[_0xaf58('0x9')]||'';this[_0xaf58('0xa')]=_0x2cc995[_0xaf58('0xa')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index a94ea07..dede2a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05c2=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x365679,_0x512bb4){var _0x51ef98=function(_0x2e740f){while(--_0x2e740f){_0x365679['push'](_0x365679['shift']());}};_0x51ef98(++_0x512bb4);}(_0x05c2,0x1ef));var _0x205c=function(_0x28c4aa,_0x2ec3d3){_0x28c4aa=_0x28c4aa-0x0;var _0x4e854d=_0x05c2[_0x28c4aa];return _0x4e854d;};'use strict';function ServicenowAccount(_0x1d1dd4){this['id']=_0x1d1dd4['id']||0x0;this[_0x205c('0x0')]=_0x1d1dd4['name']||'';this[_0x205c('0x1')]=_0x1d1dd4[_0x205c('0x1')]||'';this[_0x205c('0x2')]=_0x1d1dd4[_0x205c('0x2')]||'';this['remoteUri']=_0x1d1dd4[_0x205c('0x3')]||'';this[_0x205c('0x4')]=_0x1d1dd4[_0x205c('0x4')]||'';this['Configurations']=_0x1d1dd4[_0x205c('0x5')]||{};}module[_0x205c('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x088b=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0x088b,0x138));var _0xb088=function(_0x33a47b,_0x25022a){_0x33a47b=_0x33a47b-0x0;var _0x3164d0=_0x088b[_0x33a47b];return _0x3164d0;};'use strict';function ServicenowAccount(_0xdf4f70){this['id']=_0xdf4f70['id']||0x0;this[_0xb088('0x0')]=_0xdf4f70[_0xb088('0x0')]||'';this['username']=_0xdf4f70[_0xb088('0x1')]||'';this[_0xb088('0x2')]=_0xdf4f70[_0xb088('0x2')]||'';this[_0xb088('0x3')]=_0xdf4f70[_0xb088('0x3')]||'';this['serverUrl']=_0xdf4f70[_0xb088('0x4')]||'';this[_0xb088('0x5')]=_0xdf4f70['Configurations']||{};}module[_0xb088('0x6')]=ServicenowAccount;
\ No newline at end of file
index 5892a32..c4ed55d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89bf=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89bf,0x11d));var _0xf89b=function(_0x17988b,_0x4d99e2){_0x17988b=_0x17988b-0x0;var _0x71054c=_0x89bf[_0x17988b];return _0x71054c;};'use strict';function SugarcrmAccount(_0x3dbbf1){this['id']=_0x3dbbf1['id']||0x0;this['name']=_0x3dbbf1[_0xf89b('0x0')]||'';this['username']=_0x3dbbf1[_0xf89b('0x1')]||'';this['password']=_0x3dbbf1[_0xf89b('0x2')]||'';this[_0xf89b('0x3')]=_0x3dbbf1['remoteUri']||'';this[_0xf89b('0x4')]=_0x3dbbf1[_0xf89b('0x4')]||'';this[_0xf89b('0x5')]=_0x3dbbf1[_0xf89b('0x5')]||{};}module[_0xf89b('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x0c75=['password','remoteUri','serverUrl','Configurations','username'];(function(_0x9d9797,_0xe3ebe8){var _0x3c16ca=function(_0x3d8735){while(--_0x3d8735){_0x9d9797['push'](_0x9d9797['shift']());}};_0x3c16ca(++_0xe3ebe8);}(_0x0c75,0xf4));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';function SugarcrmAccount(_0xd64399){this['id']=_0xd64399['id']||0x0;this['name']=_0xd64399['name']||'';this[_0x50c7('0x0')]=_0xd64399[_0x50c7('0x0')]||'';this[_0x50c7('0x1')]=_0xd64399[_0x50c7('0x1')]||'';this['remoteUri']=_0xd64399[_0x50c7('0x2')]||'';this[_0x50c7('0x3')]=_0xd64399[_0x50c7('0x3')]||'';this[_0x50c7('0x4')]=_0xd64399[_0x50c7('0x4')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 8bdd021..4af8201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de9=['name','accountcode','unknown','stateTime','address'];(function(_0x2f381b,_0x4bc41c){var _0x367ffc=function(_0x282b49){while(--_0x282b49){_0x2f381b['push'](_0x2f381b['shift']());}};_0x367ffc(++_0x4bc41c);}(_0x6de9,0xe6));var _0x96de=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6de9[_0xbca1b1];return _0x4e1686;};'use strict';function Telephone(_0xc27a2b){this['id']=_0xc27a2b['id']||0x0;this[_0x96de('0x0')]=_0xc27a2b[_0x96de('0x0')]||'';this[_0x96de('0x1')]=_0xc27a2b[_0x96de('0x1')]||'';this['state']=_0x96de('0x2');this[_0x96de('0x3')]=0x0;this['status']=_0x96de('0x2');this[_0x96de('0x4')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x9b87=['unknown','exports','name','accountcode','state'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x9b87,0x7f));var _0x79b8=function(_0x42fbe3,_0x4d8784){_0x42fbe3=_0x42fbe3-0x0;var _0x4f9d7d=_0x9b87[_0x42fbe3];return _0x4f9d7d;};'use strict';function Telephone(_0x3886a2){this['id']=_0x3886a2['id']||0x0;this[_0x79b8('0x0')]=_0x3886a2['name']||'';this['accountcode']=_0x3886a2[_0x79b8('0x1')]||'';this[_0x79b8('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x79b8('0x3');this['address']='';}module[_0x79b8('0x4')]=Telephone;
\ No newline at end of file
index 18c0018..0ff8856 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x26da0b,_0x1c195c){var _0xde3ea7=function(_0x2b4fa0){while(--_0x2b4fa0){_0x26da0b['push'](_0x26da0b['shift']());}};_0xde3ea7(++_0x1c195c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x9a5c5e,_0x38d4bd){var _0x17fa52=function(_0x127356){while(--_0x127356){_0x9a5c5e['push'](_0x9a5c5e['shift']());}};_0x17fa52(++_0x38d4bd);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b8774,_0x301a46){_0x3b8774=_0x3b8774-0x0;var _0x5bcfcc=_0xb10b[_0x3b8774];return _0x5bcfcc;};'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 ec4f3c7..1355d16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x8e7f72,_0x4e1e17){var _0x3c0b5d=function(_0x2425e7){while(--_0x2425e7){_0x8e7f72['push'](_0x8e7f72['shift']());}};_0x3c0b5d(++_0x4e1e17);}(_0x757a,0xde));var _0xa757=function(_0x54bdc0,_0x3998a4){_0x54bdc0=_0x54bdc0-0x0;var _0x55e30c=_0x757a[_0x54bdc0];return _0x55e30c;};'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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0xb186c0,_0x52ac06){var _0x58f27a=function(_0x4dbb06){while(--_0x4dbb06){_0xb186c0['push'](_0xb186c0['shift']());}};_0x58f27a(++_0x52ac06);}(_0x8603,0x190));var _0x3860=function(_0x174c49,_0x23dfdc){_0x174c49=_0x174c49-0x0;var _0x3abe46=_0x8603[_0x174c49];return _0x3abe46;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger;
\ No newline at end of file
index cc253b0..00af79a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ec=['active','name','status','unknown','registry','indexOf','split','host','port','domain','domainport','address','defaultuser','exports'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xa9ec,0x188));var _0xca9e=function(_0x1d4760,_0x5a58e7){_0x1d4760=_0x1d4760-0x0;var _0x233074=_0xa9ec[_0x1d4760];return _0x233074;};'use strict';function Trunk(_0x110778){this['id']=_0x110778['id']||0x0;this[_0xca9e('0x0')]=_0x110778[_0xca9e('0x0')]||![];this[_0xca9e('0x1')]=_0x110778[_0xca9e('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xca9e('0x2')]=_0xca9e('0x3');this[_0xca9e('0x4')]=_0x110778[_0xca9e('0x4')]&&_0x110778[_0xca9e('0x4')][_0xca9e('0x5')](':')?_0x110778[_0xca9e('0x4')][_0xca9e('0x6')](':')[0x0]:'';this[_0xca9e('0x7')]='';this[_0xca9e('0x8')]='';this[_0xca9e('0x9')]='';this[_0xca9e('0xa')]='';this['refresh']='';this['stateRegistry']=_0xca9e('0x3');this['registrationtime']='';this[_0xca9e('0xb')]='';this[_0xca9e('0xc')]=_0x110778[_0xca9e('0xc')]||'';}module[_0xca9e('0xd')]=Trunk;
\ No newline at end of file
+var _0xb5d4=['stateRegistry','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb5d4,0x19c));var _0x4b5d=function(_0x468d8a,_0x373441){_0x468d8a=_0x468d8a-0x0;var _0x493672=_0xb5d4[_0x468d8a];return _0x493672;};'use strict';function Trunk(_0x59a541){this['id']=_0x59a541['id']||0x0;this[_0x4b5d('0x0')]=_0x59a541[_0x4b5d('0x0')]||![];this[_0x4b5d('0x1')]=_0x59a541[_0x4b5d('0x1')]||'';this['state']=_0x4b5d('0x2');this[_0x4b5d('0x3')]=0x0;this[_0x4b5d('0x4')]=_0x4b5d('0x2');this['registry']=_0x59a541[_0x4b5d('0x5')]&&_0x59a541[_0x4b5d('0x5')][_0x4b5d('0x6')](':')?_0x59a541[_0x4b5d('0x5')][_0x4b5d('0x7')](':')[0x0]:'';this[_0x4b5d('0x8')]='';this[_0x4b5d('0x9')]='';this[_0x4b5d('0xa')]='';this[_0x4b5d('0xb')]='';this[_0x4b5d('0xc')]='';this[_0x4b5d('0xd')]='unknown';this['registrationtime']='';this[_0x4b5d('0xe')]='';this[_0x4b5d('0xf')]=_0x59a541['defaultuser']||'';}module[_0x4b5d('0x10')]=Trunk;
\ No newline at end of file
index 53d6029..a7d2ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ab=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4014c2,_0x4e2d76){var _0x37342b=function(_0x125c28){while(--_0x125c28){_0x4014c2['push'](_0x4014c2['shift']());}};_0x37342b(++_0x4e2d76);}(_0xf7ab,0x7a));var _0xbf7a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf7ab[_0x138adb];return _0x1b27f2;};'use strict';function voiceExtension(_0x217c56){this['id']=_0x217c56['id']||0x0;this[_0xbf7a('0x0')]=_0x217c56[_0xbf7a('0x0')]||'';this[_0xbf7a('0x1')]=_0x217c56['recordingFormat']||_0xbf7a('0x2');this[_0xbf7a('0x3')]=_0x217c56[_0xbf7a('0x3')]||![];}module[_0xbf7a('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x6fa7=['exten','recordingFormat','mandatoryDisposition'];(function(_0x2e26f9,_0x36dfed){var _0x4dc035=function(_0x529e14){while(--_0x529e14){_0x2e26f9['push'](_0x2e26f9['shift']());}};_0x4dc035(++_0x36dfed);}(_0x6fa7,0x1ad));var _0x76fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fa7[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x25bf89){this['id']=_0x25bf89['id']||0x0;this[_0x76fa('0x0')]=_0x25bf89[_0x76fa('0x0')]||'';this['recordingFormat']=_0x25bf89[_0x76fa('0x1')]||'none';this['mandatoryDisposition']=_0x25bf89[_0x76fa('0x2')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index 444c44d..c1cb829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9058=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x34d823,_0x2d20b0){var _0x1eb90c=function(_0x43eda6){while(--_0x43eda6){_0x34d823['push'](_0x34d823['shift']());}};_0x1eb90c(++_0x2d20b0);}(_0x9058,0x119));var _0x8905=function(_0x28e3b7,_0x404b71){_0x28e3b7=_0x28e3b7-0x0;var _0x5d2115=_0x9058[_0x28e3b7];return _0x5d2115;};'use strict';var statusDesc=['unknown','not_inuse',_0x8905('0x0'),_0x8905('0x1'),_0x8905('0x2'),_0x8905('0x3'),_0x8905('0x4'),_0x8905('0x5'),_0x8905('0x6')];var monitorFormat={'wav':_0x8905('0x7'),'wav49':_0x8905('0x8'),'gsm':_0x8905('0x9')};var strategy={'rrmemory':_0x8905('0xa'),'roundrobin':_0x8905('0xb')};function VoiceQueue(_0x929b76){this['id']=_0x929b76['id']||0x0;this[_0x8905('0xc')]=_0x929b76[_0x8905('0xc')]||'';this[_0x8905('0xd')]=_0x929b76['monitor_format']||'';this[_0x8905('0xe')]=_0x929b76[_0x8905('0xe')]||_0x8905('0xf');this[_0x8905('0x10')]=0x0;this[_0x8905('0x11')]=0x0;this[_0x8905('0x12')]=0x0;this[_0x8905('0x13')]=0x0;this[_0x8905('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0x8905('0x15')]=0x0;this['unmanaged']=0x0;this[_0x8905('0x16')]=0x0;this[_0x8905('0x17')]=0x0;this[_0x8905('0x18')]=0x0;this[_0x8905('0x19')]=_0x929b76[_0x8905('0x19')]||![];this[_0x8905('0x1a')]=_0x929b76[_0x8905('0x1a')]||0xa;this[_0x8905('0x1b')]=_0x929b76[_0x8905('0x1b')]||'no';this['sendMessageOneNotActive']=!![];this[_0x8905('0x1c')]='';this['originated']=0x0;this[_0x8905('0x1d')]=0x0;this[_0x8905('0x1e')]=_0x929b76[_0x8905('0x1e')]||null;this[_0x8905('0x1f')]=_0x929b76[_0x8905('0x1f')]?_0x929b76[_0x8905('0x1f')]:null;this[_0x8905('0x20')]=_0x929b76[_0x8905('0x20')];this[_0x8905('0x21')]=_0x929b76[_0x8905('0x21')]||_0x8905('0x22');this[_0x8905('0x23')]=_0x929b76[_0x8905('0x23')]||0x0;this['dialLimitQueue']=_0x929b76['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x929b76['dialPowerLevel']||0x1;this[_0x8905('0x24')]=_0x929b76[_0x8905('0x24')]||_0x8905('0x25');this[_0x8905('0x26')]=_0x929b76[_0x8905('0x26')]||0.03;this['dialPredictiveInterval']=_0x929b76[_0x8905('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x929b76[_0x8905('0x28')]||_0x8905('0x29');this[_0x8905('0x2a')]=_0x929b76[_0x8905('0x2a')]||'anonymous';this[_0x8905('0x2b')]=_0x929b76[_0x8905('0x2b')]||0x1e;this['dialQueueOptions']=_0x929b76[_0x8905('0x2c')]||'tTxX';this[_0x8905('0x2d')]=_0x929b76[_0x8905('0x2d')]||0x3;this[_0x8905('0x2e')]=_0x929b76['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x929b76[_0x8905('0x2f')]||0x3;this[_0x8905('0x30')]=_0x929b76['dialCongestionRetryFrequency']||0x96;this[_0x8905('0x31')]=_0x929b76[_0x8905('0x31')]||0x3;this[_0x8905('0x32')]=_0x929b76['dialBusyRetryFrequency']||0x96;this[_0x8905('0x33')]=_0x929b76['dialNoAnswerMaxRetry']||0x3;this[_0x8905('0x34')]=_0x929b76['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x929b76[_0x8905('0x35')]||0x3;this[_0x8905('0x36')]=_0x929b76['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8905('0x37')]=_0x929b76['dialDropMaxRetry']||0x3;this[_0x8905('0x38')]=_0x929b76[_0x8905('0x38')]||0x96;this[_0x8905('0x39')]=_0x929b76[_0x8905('0x39')]||0x3;this[_0x8905('0x3a')]=_0x929b76['dialAbandonedRetryFrequency']||0x96;this[_0x8905('0x3b')]=_0x929b76[_0x8905('0x3b')]||0x3;this[_0x8905('0x3c')]=_0x929b76[_0x8905('0x3c')]||0x96;this[_0x8905('0x3d')]=_0x929b76['dialAgentRejectMaxRetry']||0x3;this[_0x8905('0x3e')]=_0x929b76['dialAgentRejectRetryFrequency']||0x96;this[_0x8905('0x3f')]=_0x929b76[_0x8905('0x3f')]||0x3;this[_0x8905('0x40')]=_0x929b76['dialGlobalMaxRetry']||0x4;this[_0x8905('0x41')]=_0x929b76['Trunk']?_0x929b76[_0x8905('0x41')]:undefined;this[_0x8905('0x42')]=_0x929b76['TrunkBackup']?_0x929b76[_0x8905('0x42')]:undefined;this[_0x8905('0x43')]=_0x929b76[_0x8905('0x43')]||undefined;this[_0x8905('0x44')]=_0x929b76[_0x8905('0x44')]?_0x929b76[_0x8905('0x44')]:undefined;this[_0x8905('0x45')]=_0x929b76[_0x8905('0x45')]||_0x8905('0x46');this[_0x8905('0x47')]=_0x929b76[_0x8905('0x47')]||undefined;this['dialCutDigit']=_0x929b76[_0x8905('0x48')]||undefined;this[_0x8905('0x49')]=strategy[_0x929b76[_0x8905('0x49')]]||_0x8905('0xa');this[_0x8905('0x4a')]=!![];this[_0x8905('0x4b')]=_0x929b76[_0x8905('0x4b')]||![];this[_0x8905('0x4c')]=_0x929b76['dialAMDInitialSilence'];this[_0x8905('0x4d')]=_0x929b76[_0x8905('0x4d')];this[_0x8905('0x4e')]=_0x929b76[_0x8905('0x4e')];this['dialAMDTotalAnalysisTime']=_0x929b76[_0x8905('0x4f')];this[_0x8905('0x50')]=_0x929b76[_0x8905('0x50')];this[_0x8905('0x51')]=_0x929b76[_0x8905('0x51')];this[_0x8905('0x52')]=_0x929b76[_0x8905('0x52')];this[_0x8905('0x53')]=_0x929b76[_0x8905('0x53')];this[_0x8905('0x54')]=_0x929b76[_0x8905('0x54')];this[_0x8905('0x55')]=0x0;this[_0x8905('0x56')]=0x0;this['timeout']=_0x929b76[_0x8905('0x57')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x8905('0x58')]=0x0;this[_0x8905('0x59')]=0x0;this[_0x8905('0x5a')]=0x0;this[_0x8905('0x5b')]=0x0;this[_0x8905('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x8905('0x5d')]=0x0;this[_0x8905('0x5e')]=0x0;this[_0x8905('0x5f')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x8905('0x60')]=0x0;this[_0x8905('0x61')]=undefined;this[_0x8905('0x62')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x8905('0x63')]=0x0;this[_0x8905('0x64')]=0x0;this[_0x8905('0x65')]=0x0;this[_0x8905('0x66')]=0x0;this[_0x8905('0x67')]=0x0;this[_0x8905('0x68')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x8905('0x69')]=0x0;this[_0x8905('0x6a')]=_0x929b76[_0x8905('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x929b76[_0x8905('0x6b')]||0xa;this[_0x8905('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x8905('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0x8905('0x6e')]=0x0;this[_0x8905('0x6f')]=0x0;this[_0x8905('0x70')]=0x0;this[_0x8905('0x71')]=_0x929b76[_0x8905('0x71')]||0x1e;this[_0x8905('0x72')]=_0x929b76[_0x8905('0x72')]||![];this[_0x8905('0x73')]=_0x929b76['dialQueueProject2']||undefined;this[_0x8905('0x74')]=_0x929b76[_0x8905('0x74')]||![];this[_0x8905('0x75')]=_0x929b76[_0x8905('0x75')]||![];this[_0x8905('0xd')]=monitorFormat[_0x929b76['monitor_format']]?monitorFormat[_0x929b76[_0x8905('0xd')]]:undefined;this[_0x8905('0x76')]=_0x929b76['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x929b76[_0x8905('0x77')]?_0x929b76[_0x8905('0x77')]:undefined;}module[_0x8905('0x78')]=VoiceQueue;
\ No newline at end of file
+var _0x3b67=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','monitor_format','type','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit'];(function(_0x23990a,_0x115e2a){var _0x4f5d33=function(_0x55cdcd){while(--_0x55cdcd){_0x23990a['push'](_0x23990a['shift']());}};_0x4f5d33(++_0x115e2a);}(_0x3b67,0x89));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';var statusDesc=[_0x73b6('0x0'),'not_inuse',_0x73b6('0x1'),_0x73b6('0x2'),'invalid',_0x73b6('0x3'),_0x73b6('0x4'),_0x73b6('0x5'),_0x73b6('0x6')];var monitorFormat={'wav':_0x73b6('0x7'),'wav49':_0x73b6('0x8'),'gsm':_0x73b6('0x9')};var strategy={'rrmemory':_0x73b6('0xa'),'roundrobin':_0x73b6('0xb')};function VoiceQueue(_0x305ce8){this['id']=_0x305ce8['id']||0x0;this['name']=_0x305ce8['name']||'';this[_0x73b6('0xc')]=_0x305ce8['monitor_format']||'';this['type']=_0x305ce8[_0x73b6('0xd')]||'inbound';this['waiting']=0x0;this[_0x73b6('0xe')]=0x0;this['total']=0x0;this[_0x73b6('0xf')]=0x0;this[_0x73b6('0x10')]=0x0;this['sumHoldTime']=0x0;this[_0x73b6('0x11')]=0x0;this[_0x73b6('0x12')]=0x0;this[_0x73b6('0x13')]=0x0;this[_0x73b6('0x14')]=0x0;this[_0x73b6('0x15')]=0x0;this[_0x73b6('0x16')]=_0x305ce8[_0x73b6('0x16')]||![];this[_0x73b6('0x17')]=_0x305ce8['acwTimeout']||0xa;this['autopause']=_0x305ce8[_0x73b6('0x18')]||'no';this[_0x73b6('0x19')]=!![];this[_0x73b6('0x1a')]='';this['originated']=0x0;this[_0x73b6('0x1b')]=0x0;this[_0x73b6('0x1c')]=_0x305ce8[_0x73b6('0x1c')]||null;this['dialGlobalInterval']=_0x305ce8[_0x73b6('0x1d')]?_0x305ce8[_0x73b6('0x1d')]:null;this[_0x73b6('0x1e')]=_0x305ce8[_0x73b6('0x1e')];this[_0x73b6('0x1f')]=_0x305ce8[_0x73b6('0x1f')]||_0x73b6('0x20');this[_0x73b6('0x21')]=_0x305ce8[_0x73b6('0x21')]||0x0;this[_0x73b6('0x22')]=_0x305ce8['dialLimitQueue']||0x0;this[_0x73b6('0x23')]=_0x305ce8[_0x73b6('0x23')]||0x1;this['dialPredictiveOptimization']=_0x305ce8[_0x73b6('0x24')]||_0x73b6('0x25');this['dialPredictiveOptimizationPercentage']=_0x305ce8[_0x73b6('0x26')]||0.03;this['dialPredictiveInterval']=_0x305ce8[_0x73b6('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x305ce8[_0x73b6('0x28')]||_0x73b6('0x29');this[_0x73b6('0x2a')]=_0x305ce8[_0x73b6('0x2a')]||_0x73b6('0x29');this['dialOriginateTimeout']=_0x305ce8['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x305ce8[_0x73b6('0x2b')]||_0x73b6('0x2c');this['dialQueueTimeout']=_0x305ce8['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x305ce8[_0x73b6('0x2d')]||undefined;this['dialCongestionMaxRetry']=_0x305ce8['dialCongestionMaxRetry']||0x3;this[_0x73b6('0x2e')]=_0x305ce8[_0x73b6('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x305ce8['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x305ce8[_0x73b6('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x305ce8[_0x73b6('0x30')]||0x3;this[_0x73b6('0x31')]=_0x305ce8[_0x73b6('0x31')]||0x96;this[_0x73b6('0x32')]=_0x305ce8[_0x73b6('0x32')]||0x3;this[_0x73b6('0x33')]=_0x305ce8[_0x73b6('0x33')]||0x96;this['dialDropMaxRetry']=_0x305ce8[_0x73b6('0x34')]||0x3;this['dialDropRetryFrequency']=_0x305ce8['dialDropRetryFrequency']||0x96;this[_0x73b6('0x35')]=_0x305ce8[_0x73b6('0x35')]||0x3;this['dialAbandonedRetryFrequency']=_0x305ce8[_0x73b6('0x36')]||0x96;this['dialMachineMaxRetry']=_0x305ce8[_0x73b6('0x37')]||0x3;this[_0x73b6('0x38')]=_0x305ce8[_0x73b6('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0x305ce8[_0x73b6('0x39')]||0x3;this[_0x73b6('0x3a')]=_0x305ce8[_0x73b6('0x3a')]||0x96;this[_0x73b6('0x3b')]=_0x305ce8[_0x73b6('0x3b')]||0x3;this[_0x73b6('0x3c')]=_0x305ce8['dialGlobalMaxRetry']||0x4;this[_0x73b6('0x3d')]=_0x305ce8[_0x73b6('0x3d')]?_0x305ce8[_0x73b6('0x3d')]:undefined;this[_0x73b6('0x3e')]=_0x305ce8['TrunkBackup']?_0x305ce8[_0x73b6('0x3e')]:undefined;this[_0x73b6('0x3f')]=_0x305ce8[_0x73b6('0x3f')]||undefined;this[_0x73b6('0x40')]=_0x305ce8['Interval']?_0x305ce8[_0x73b6('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x305ce8[_0x73b6('0x41')]||_0x73b6('0x42');this[_0x73b6('0x43')]=_0x305ce8['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x73b6('0x44')]=_0x305ce8['dialCutDigit']||undefined;this[_0x73b6('0x45')]=strategy[_0x305ce8[_0x73b6('0x45')]]||_0x73b6('0xa');this['queueStatusComplete']=!![];this[_0x73b6('0x46')]=_0x305ce8[_0x73b6('0x46')]||![];this['dialAMDInitialSilence']=_0x305ce8['dialAMDInitialSilence'];this[_0x73b6('0x47')]=_0x305ce8['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x305ce8[_0x73b6('0x48')];this[_0x73b6('0x49')]=_0x305ce8[_0x73b6('0x49')];this[_0x73b6('0x4a')]=_0x305ce8[_0x73b6('0x4a')];this[_0x73b6('0x4b')]=_0x305ce8[_0x73b6('0x4b')];this[_0x73b6('0x4c')]=_0x305ce8[_0x73b6('0x4c')];this['dialAMDSilenceThreshold']=_0x305ce8['dialAMDSilenceThreshold'];this[_0x73b6('0x4d')]=_0x305ce8[_0x73b6('0x4d')];this[_0x73b6('0x4e')]=0x0;this[_0x73b6('0x4f')]=0x0;this[_0x73b6('0x50')]=_0x305ce8['timeout'];this[_0x73b6('0x51')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x73b6('0x52')]=0x0;this[_0x73b6('0x53')]=0x0;this[_0x73b6('0x54')]=0x0;this[_0x73b6('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x73b6('0x56')]=0x0;this[_0x73b6('0x57')]=0x0;this[_0x73b6('0x58')]=0x0;this[_0x73b6('0x59')]=0x0;this[_0x73b6('0x5a')]=0x0;this[_0x73b6('0x5b')]=0x0;this[_0x73b6('0x5c')]=0x0;this[_0x73b6('0x5d')]=undefined;this[_0x73b6('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x73b6('0x5f')]=1.05;this[_0x73b6('0x60')]=0x0;this[_0x73b6('0x61')]=0x0;this[_0x73b6('0x62')]=0x0;this[_0x73b6('0x63')]=0x0;this[_0x73b6('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x73b6('0x65')]=0x0;this[_0x73b6('0x66')]=0x0;this[_0x73b6('0x67')]=_0x305ce8[_0x73b6('0x68')]||0x14;this[_0x73b6('0x69')]=_0x305ce8[_0x73b6('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x73b6('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x73b6('0x6b')]=0x0;this[_0x73b6('0x6c')]=0x0;this[_0x73b6('0x6d')]=0x0;this[_0x73b6('0x6e')]=0x0;this[_0x73b6('0x6f')]=_0x305ce8[_0x73b6('0x6f')]||0x1e;this[_0x73b6('0x70')]=_0x305ce8[_0x73b6('0x70')]||![];this[_0x73b6('0x71')]=_0x305ce8['dialQueueProject2']||undefined;this[_0x73b6('0x72')]=_0x305ce8[_0x73b6('0x72')]||![];this['dialAgiAfterHangupAgent']=_0x305ce8[_0x73b6('0x73')]||![];this[_0x73b6('0xc')]=monitorFormat[_0x305ce8[_0x73b6('0xc')]]?monitorFormat[_0x305ce8[_0x73b6('0xc')]]:undefined;this[_0x73b6('0x74')]=_0x305ce8[_0x73b6('0x74')]||![];this[_0x73b6('0x75')]=_0x305ce8[_0x73b6('0x75')]?_0x305ce8[_0x73b6('0x75')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 95cef7b..17e5986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4b=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x9a4b,0x134));var _0xb9a4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9a4b[_0x167cc1];return _0x10bc4b;};'use strict';function VtigerAccount(_0x2cd019){this['id']=_0x2cd019['id']||0x0;this[_0xb9a4('0x0')]=_0x2cd019[_0xb9a4('0x0')]||'';this[_0xb9a4('0x1')]=_0x2cd019[_0xb9a4('0x1')]||'';this[_0xb9a4('0x2')]=_0x2cd019[_0xb9a4('0x2')]||'';this[_0xb9a4('0x3')]=_0x2cd019[_0xb9a4('0x3')]||'';this[_0xb9a4('0x4')]=_0x2cd019[_0xb9a4('0x4')]||'';this[_0xb9a4('0x5')]=_0x2cd019[_0xb9a4('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0xf5fe=['exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3cd543,_0x418fa6){var _0x310fd3=function(_0x3a9e9e){while(--_0x3a9e9e){_0x3cd543['push'](_0x3cd543['shift']());}};_0x310fd3(++_0x418fa6);}(_0xf5fe,0x9d));var _0xef5f=function(_0x411e55,_0x500863){_0x411e55=_0x411e55-0x0;var _0x374330=_0xf5fe[_0x411e55];return _0x374330;};'use strict';function VtigerAccount(_0x587638){this['id']=_0x587638['id']||0x0;this[_0xef5f('0x0')]=_0x587638[_0xef5f('0x0')]||'';this[_0xef5f('0x1')]=_0x587638[_0xef5f('0x1')]||'';this['accessKey']=_0x587638[_0xef5f('0x2')]||'';this[_0xef5f('0x3')]=_0x587638[_0xef5f('0x3')]||'';this[_0xef5f('0x4')]=_0x587638[_0xef5f('0x4')]||'';this['Configurations']=_0x587638['Configurations']||{};}module[_0xef5f('0x5')]=VtigerAccount;
\ No newline at end of file
index ac6f8f9..47b0523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e42=['name','username','password','token','remoteUri','type','serverUrl','Configurations','exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2e42,0x1cb));var _0x22e4=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x2e42[_0x503306];return _0x44a99d;};'use strict';function ZendeskAccount(_0x983d7c){this['id']=_0x983d7c['id']||0x0;this[_0x22e4('0x0')]=_0x983d7c[_0x22e4('0x0')]||'';this[_0x22e4('0x1')]=_0x983d7c['username']||'';this['password']=_0x983d7c[_0x22e4('0x2')]||'';this[_0x22e4('0x3')]=_0x983d7c['token']||'';this[_0x22e4('0x4')]=_0x983d7c[_0x22e4('0x4')]||'';this['authType']=_0x983d7c['authType']||'';this[_0x22e4('0x5')]=_0x983d7c[_0x22e4('0x5')]||'integrationTab';this[_0x22e4('0x6')]=_0x983d7c['serverUrl']||'';this[_0x22e4('0x7')]=_0x983d7c[_0x22e4('0x7')]||{};}module[_0x22e4('0x8')]=ZendeskAccount;
\ No newline at end of file
+var _0xc0a1=['serverUrl','Configurations','name','username','token','authType','type','integrationTab'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xc0a1,0x72));var _0x1c0a=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xc0a1[_0x486f4a];return _0x135d99;};'use strict';function ZendeskAccount(_0x234151){this['id']=_0x234151['id']||0x0;this[_0x1c0a('0x0')]=_0x234151['name']||'';this[_0x1c0a('0x1')]=_0x234151['username']||'';this['password']=_0x234151['password']||'';this['token']=_0x234151[_0x1c0a('0x2')]||'';this['remoteUri']=_0x234151['remoteUri']||'';this[_0x1c0a('0x3')]=_0x234151[_0x1c0a('0x3')]||'';this[_0x1c0a('0x4')]=_0x234151[_0x1c0a('0x4')]||_0x1c0a('0x5');this['serverUrl']=_0x234151[_0x1c0a('0x6')]||'';this[_0x1c0a('0x7')]=_0x234151[_0x1c0a('0x7')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index 27ca4dc..b45f6f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd02f=['code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x5e9940,_0x1b61f9){var _0x4a93f2=function(_0x19f24e){while(--_0x19f24e){_0x5e9940['push'](_0x5e9940['shift']());}};_0x4a93f2(++_0x1b61f9);}(_0xd02f,0xf3));var _0xfd02=function(_0x53f1bc,_0x38e4a3){_0x53f1bc=_0x53f1bc-0x0;var _0x5507cf=_0xd02f[_0x53f1bc];return _0x5507cf;};'use strict';function ZohoAccount(_0x21453e){this['id']=_0x21453e['id']||0x0;this['name']=_0x21453e[_0xfd02('0x0')]||'';this[_0xfd02('0x1')]=_0x21453e[_0xfd02('0x1')]||'';this[_0xfd02('0x2')]=_0x21453e[_0xfd02('0x2')]||'';this['zone']=_0x21453e[_0xfd02('0x3')]||'';this[_0xfd02('0x4')]=_0x21453e[_0xfd02('0x4')]||'';this[_0xfd02('0x5')]=_0x21453e['clientSecret']||'';this[_0xfd02('0x6')]=_0x21453e['serverUrl']||'';this[_0xfd02('0x7')]=_0x21453e[_0xfd02('0x7')]||'';this[_0xfd02('0x8')]=_0x21453e[_0xfd02('0x8')]||'';this[_0xfd02('0x9')]=_0x21453e[_0xfd02('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x852b=['serverUrl','code','refreshToken','Configurations','exports','description','host','clientId','clientSecret'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x852b,0x164));var _0xb852=function(_0x35d1f9,_0x2b4b0b){_0x35d1f9=_0x35d1f9-0x0;var _0x3fe5c5=_0x852b[_0x35d1f9];return _0x3fe5c5;};'use strict';function ZohoAccount(_0x316473){this['id']=_0x316473['id']||0x0;this['name']=_0x316473['name']||'';this[_0xb852('0x0')]=_0x316473['description']||'';this['host']=_0x316473[_0xb852('0x1')]||'';this['zone']=_0x316473['zone']||'';this[_0xb852('0x2')]=_0x316473[_0xb852('0x2')]||'';this[_0xb852('0x3')]=_0x316473[_0xb852('0x3')]||'';this['serverUrl']=_0x316473[_0xb852('0x4')]||'';this[_0xb852('0x5')]=_0x316473['code']||'';this['refreshToken']=_0x316473[_0xb852('0x6')]||'';this[_0xb852('0x7')]=_0x316473[_0xb852('0x7')]||{};}module[_0xb852('0x8')]=ZohoAccount;
\ No newline at end of file
index 534a93c..6439851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['Agent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','prototype','getCaller','format','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3342('0x0'));function checkNameSurname(_0x16bdb3,_0x3477de,_0x3b763d){var _0x21bdc2='';if(!_[_0x3342('0x1')](_0x3477de)&&_0x3342('0x2')===typeof _0x3477de){_0x21bdc2+=_0x3477de;}if(!_[_0x3342('0x1')](_0x3b763d)&&_0x3342('0x2')===typeof _0x3b763d){_0x21bdc2+='\x20'+_0x3b763d;}if(_0x21bdc2!==''){return _0x21bdc2;}return _0x16bdb3;}function Action(_0x19206f,_0x467453,_0x2ccbe0,_0x29c40c,_0x420d4b){this[_0x3342('0x3')]=_0x2ccbe0||undefined;this[_0x3342('0x4')]=_0x19206f['id'];this[_0x3342('0x5')]=_0x467453[_0x3342('0x6')];this[_0x3342('0x7')]=_0x467453['type'];this['campaigntype']=_0x3342('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x19206f['Agent'])?undefined:_0x19206f[_0x3342('0x8')][_0x3342('0x6')];this['channelAgent']=this[_0x3342('0x9')]?util['format'](_0x3342('0xa'),this[_0x3342('0x9')]):_0x29c40c||undefined;this['calleridname']=checkNameSurname(_0x19206f[_0x3342('0xb')][_0x3342('0xc')],_0x19206f[_0x3342('0xb')][_0x3342('0xd')],_0x19206f[_0x3342('0xb')][_0x3342('0xe')]);this[_0x3342('0xf')]=_0x19206f['active']||![];this[_0x3342('0x10')]=_0x19206f[_0x3342('0xc')];this['scheduledat']=_0x19206f[_0x3342('0x11')];this[_0x3342('0x12')]=_0x19206f['countbusyretry']||0x0;this['countcongestionretry']=_0x19206f[_0x3342('0x13')]||0x0;this[_0x3342('0x14')]=_0x19206f[_0x3342('0x14')]||0x0;this[_0x3342('0x15')]=(_0x19206f[_0x3342('0x12')]||0x0)+(_0x19206f[_0x3342('0x13')]||0x0)+(_0x19206f[_0x3342('0x14')]||0x0)+(_0x19206f[_0x3342('0x16')]||0x0)+(_0x19206f[_0x3342('0x17')]||0x0)+(_0x19206f['countabandonedretry']||0x0)+(_0x19206f[_0x3342('0x18')]||0x0)+(_0x19206f[_0x3342('0x19')]||0x0);this[_0x3342('0x16')]=_0x19206f['countnosuchnumberretry']||0x0;this[_0x3342('0x17')]=_0x19206f[_0x3342('0x17')]||0x0;this['countabandonedretry']=_0x19206f[_0x3342('0x1a')]||0x0;this[_0x3342('0x18')]=_0x19206f['countmachineretry']||0x0;this[_0x3342('0x19')]=_0x19206f['countagentrejectretry']||0x0;this[_0x3342('0x1b')]=_0x19206f[_0x3342('0x1b')];this[_0x3342('0x1c')]=_0x19206f[_0x3342('0x1c')];this[_0x3342('0x1d')]=_0x19206f[_0x3342('0x1d')];this[_0x3342('0x1e')]=_0x19206f[_0x3342('0x1e')];this['ContactId']=_0x19206f[_0x3342('0x1f')];this['ListId']=_0x19206f['ListId'];this[_0x3342('0x20')]=_['isNil'](_0x19206f['Agent'])?_0x19206f[_0x3342('0x20')]:_0x19206f['Agent']['id'];this[_0x3342('0x21')]=_0x19206f['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3342('0x22')][_0x3342('0x23')]=function(){return util[_0x3342('0x24')]('\x22%s\x22\x20<%s>',this[_0x3342('0x25')],this[_0x3342('0x26')]);};module[_0x3342('0x27')]=Action;
\ No newline at end of file
+var _0xdb28=['name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue'];(function(_0x2859f3,_0x13672c){var _0x4008e3=function(_0x1895c7){while(--_0x1895c7){_0x2859f3['push'](_0x2859f3['shift']());}};_0x4008e3(++_0x13672c);}(_0xdb28,0x106));var _0x8db2=function(_0x51632f,_0x236c59){_0x51632f=_0x51632f-0x0;var _0x3d6604=_0xdb28[_0x51632f];return _0x3d6604;};'use strict';var util=require(_0x8db2('0x0'));var _=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));function checkNameSurname(_0xf66e59,_0x585da1,_0x1f4c45){var _0x11c26d='';if(!_[_0x8db2('0x3')](_0x585da1)&&_0x8db2('0x4')===typeof _0x585da1){_0x11c26d+=_0x585da1;}if(!_[_0x8db2('0x3')](_0x1f4c45)&&'string'===typeof _0x1f4c45){_0x11c26d+='\x20'+_0x1f4c45;}if(_0x11c26d!==''){return _0x11c26d;}return _0xf66e59;}function Action(_0x21a03e,_0x1d2dd3,_0x5f42ee,_0x494b40,_0x477f50){this[_0x8db2('0x5')]=_0x5f42ee||undefined;this[_0x8db2('0x6')]=_0x21a03e['id'];this[_0x8db2('0x7')]=_0x1d2dd3[_0x8db2('0x8')];this[_0x8db2('0x9')]=_0x1d2dd3[_0x8db2('0x9')];this['campaigntype']=_0x8db2('0x7');this[_0x8db2('0xa')]=![];this[_0x8db2('0xb')]=_['isNil'](_0x21a03e[_0x8db2('0xc')])?undefined:_0x21a03e[_0x8db2('0xc')]['name'];this[_0x8db2('0xd')]=this[_0x8db2('0xb')]?util[_0x8db2('0xe')](_0x8db2('0xf'),this[_0x8db2('0xb')]):_0x494b40||undefined;this['calleridname']=checkNameSurname(_0x21a03e['Contact'][_0x8db2('0x10')],_0x21a03e[_0x8db2('0x11')][_0x8db2('0x12')],_0x21a03e[_0x8db2('0x11')][_0x8db2('0x13')]);this[_0x8db2('0x14')]=_0x21a03e[_0x8db2('0x14')]||![];this[_0x8db2('0x15')]=_0x21a03e[_0x8db2('0x10')];this[_0x8db2('0x16')]=_0x21a03e['scheduledat'];this[_0x8db2('0x17')]=_0x21a03e[_0x8db2('0x17')]||0x0;this['countcongestionretry']=_0x21a03e[_0x8db2('0x18')]||0x0;this[_0x8db2('0x19')]=_0x21a03e[_0x8db2('0x19')]||0x0;this[_0x8db2('0x1a')]=(_0x21a03e[_0x8db2('0x17')]||0x0)+(_0x21a03e[_0x8db2('0x18')]||0x0)+(_0x21a03e['countnoanswerretry']||0x0)+(_0x21a03e['countnosuchnumberretry']||0x0)+(_0x21a03e[_0x8db2('0x1b')]||0x0)+(_0x21a03e[_0x8db2('0x1c')]||0x0)+(_0x21a03e[_0x8db2('0x1d')]||0x0)+(_0x21a03e[_0x8db2('0x1e')]||0x0);this['countnosuchnumberretry']=_0x21a03e[_0x8db2('0x1f')]||0x0;this[_0x8db2('0x1b')]=_0x21a03e[_0x8db2('0x1b')]||0x0;this[_0x8db2('0x1c')]=_0x21a03e[_0x8db2('0x1c')]||0x0;this['countmachineretry']=_0x21a03e[_0x8db2('0x1d')]||0x0;this[_0x8db2('0x1e')]=_0x21a03e[_0x8db2('0x1e')]||0x0;this[_0x8db2('0x20')]=_0x21a03e[_0x8db2('0x20')];this[_0x8db2('0x21')]=_0x21a03e[_0x8db2('0x21')];this['callbackat']=_0x21a03e[_0x8db2('0x22')];this['recallme']=_0x21a03e['recallme'];this['ContactId']=_0x21a03e['ContactId'];this[_0x8db2('0x23')]=_0x21a03e[_0x8db2('0x23')];this[_0x8db2('0x24')]=_[_0x8db2('0x3')](_0x21a03e[_0x8db2('0xc')])?_0x21a03e[_0x8db2('0x24')]:_0x21a03e['Agent']['id'];this[_0x8db2('0x25')]=_0x21a03e[_0x8db2('0x25')];this[_0x8db2('0x26')]='';this[_0x8db2('0x27')]='';}Action['prototype'][_0x8db2('0x28')]=function(){return util[_0x8db2('0xe')](_0x8db2('0x29'),this[_0x8db2('0x2a')],this[_0x8db2('0x2b')]);};module[_0x8db2('0x2c')]=Action;
\ No newline at end of file
index a36cc18..236d504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd08a=['countbusyretry','Busy','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Queue','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','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','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','starttime','variablesAction','channelAgent','calleridnum','agents','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','addVariable','variable','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','voiceQueues','trunks','clockClearZombieChannels','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','strategy','available','loggedIn','sumHoldTime','talking','total','unmanaged','abandoned','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','prototype','hasOwnProperty','dialMethod','booked','clearZombieChannels','dialActive','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','status','channel','No\x20such\x20channel','decrementTalkink','[clearZombieChannel]','loggerError','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','catch','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','BUSY'];(function(_0x13d4b5,_0x41423a){var _0x179941=function(_0x5366ae){while(--_0x5366ae){_0x13d4b5['push'](_0x13d4b5['shift']());}};_0x179941(++_0x41423a);}(_0xd08a,0xa1));var _0xad08=function(_0x5d03e6,_0x364818){_0x5d03e6=_0x5d03e6-0x0;var _0x492092=_0xd08a[_0x5d03e6];return _0x492092;};'use strict';var util=require(_0xad08('0x0'));var _=require(_0xad08('0x1'));var BPromise=require(_0xad08('0x2'));var uuid=require('uuid');var moment=require(_0xad08('0x3'));var md5=require('md5');var Redis=require(_0xad08('0x4'));var config=require('../../../config/environment');var logger=require(_0xad08('0x5'))(_0xad08('0x6'));var loggerAction=require(_0xad08('0x5'))(_0xad08('0x7'));var ami=require('../ami');var rpcDb=require(_0xad08('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xad08('0x9'));var ut=require(_0xad08('0xa'));config['redis']=_[_0xad08('0xb')](config[_0xad08('0xc')],{'host':_0xad08('0xd'),'port':0x18eb});var io=require(_0xad08('0xe'))(new Redis(config[_0xad08('0xc')]));var Sequence=function(){};Sequence['prototype'][_0xad08('0xf')]=function(_0x39e32e){this[_0xad08('0x10')]=this['tail']?this[_0xad08('0x10')][_0xad08('0x11')](_0x39e32e):_0x39e32e();};function Preview(_0x48c9be){this[_0xad08('0x12')]=new Sequence();this['campaignsPreview']=_0x48c9be[_0xad08('0x13')];this['trunks']=_0x48c9be[_0xad08('0x14')];this['actions']={};this['agents']=_0x48c9be['agents'];this[_0xad08('0x15')]=0x0;ami['on']('originateresponse',this[_0xad08('0x16')]['bind'](this));ami['on']('hangup',this[_0xad08('0x17')][_0xad08('0x18')](this));ami['on'](_0xad08('0x19'),this[_0xad08('0x1a')][_0xad08('0x18')](this));ami['on'](_0xad08('0x1b'),this[_0xad08('0x1c')][_0xad08('0x18')](this));ami['on']('newexten',this[_0xad08('0x1d')][_0xad08('0x18')](this));ami['on'](_0xad08('0x1e'),this[_0xad08('0x1f')][_0xad08('0x18')](this));ami['on'](_0xad08('0x20'),this['syncAttendedTransfer'][_0xad08('0x18')](this));ami['on']('blindtransfer',this[_0xad08('0x21')][_0xad08('0x18')](this));this[_0xad08('0x22')](this[_0xad08('0x23')]);}function emit(_0x1838c2,_0x577589,_0x39168c){io['to'](_0x1838c2)['emit'](_0x577589,_0x39168c);}function emitCampaignPreview(_0x495222){if(_0x495222[_0xad08('0x24')]===_0xad08('0x25')){var _0x59be97={'id':_0x495222['id'],'name':_0x495222[_0xad08('0x26')],'strategy':_0x495222[_0xad08('0x27')],'answered':_0x495222['answered'],'available':_0x495222[_0xad08('0x28')],'loggedIn':_0x495222[_0xad08('0x29')],'pTalking':_0x495222['pTalking'],'sumBillable':_0x495222['sumBillable'],'sumDuration':_0x495222['sumDuration'],'sumHoldTime':_0x495222[_0xad08('0x2a')]||0x0,'talking':_0x495222[_0xad08('0x2b')],'total':_0x495222[_0xad08('0x2c')],'type':_0x495222['type'],'unmanaged':_0x495222[_0xad08('0x2d')],'abandoned':_0x495222[_0xad08('0x2e')],'waiting':_0x495222['waiting'],'loggedInDb':_0x495222['loggedInDb'],'dialActive':_0x495222['dialActive'],'dialMethod':_0x495222['dialMethod'],'dialOriginateCallerIdName':_0x495222[_0xad08('0x2f')],'dialOriginateCallerIdNumber':_0x495222['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x495222['dialOriginateTimeout'],'dialPrefix':_0x495222['dialPrefix'],'outboundAnswerAgiCallsDay':_0x495222[_0xad08('0x30')],'outboundAnswerCallsDay':_0x495222[_0xad08('0x31')],'outboundBlacklistCallsDay':_0x495222['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x495222[_0xad08('0x32')],'outboundCongestionCallsDay':_0x495222[_0xad08('0x33')],'outboundDropCallsDayACS':_0x495222[_0xad08('0x34')],'outboundDropCallsDayCallersExit':_0x495222[_0xad08('0x35')],'outboundDropCallsDayTimeout':_0x495222[_0xad08('0x36')],'outboundNoAnswerCallsDay':_0x495222[_0xad08('0x37')],'outboundNoSuchCallsDay':_0x495222['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x495222[_0xad08('0x38')],'outboundReCallsDay':_0x495222[_0xad08('0x39')],'outboundRejectCallsDay':_0x495222['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x495222[_0xad08('0x3a')],'outboundAbandonedCallsDay':_0x495222[_0xad08('0x3b')],'predictiveIntervalAnsweredCalls':_0x495222[_0xad08('0x3c')],'predictiveIntervalAvgHoldtime':_0x495222[_0xad08('0x3d')],'predictiveIntervalAvgTalktime':_0x495222[_0xad08('0x3e')],'predictiveIntervalDroppedCallsCallersExit':_0x495222[_0xad08('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x495222[_0xad08('0x40')],'predictiveIntervalErlangCalls':_0x495222[_0xad08('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x495222[_0xad08('0x42')],'predictiveIntervalHitRate':_0x495222['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x495222[_0xad08('0x43')],'predictiveIntervalPauses':_0x495222[_0xad08('0x44')],'predictiveIntervalAvailable':_0x495222[_0xad08('0x45')],'predictiveIntervalTotalCalls':_0x495222[_0xad08('0x46')],'message':_0x495222[_0xad08('0x47')],'originated':_0x495222['originated'],'erlangCalls':_0x495222[_0xad08('0x48')],'erlangCallToSecond':_0x495222['erlangCallToSecond'],'erlangAbandonmentRate':_0x495222[_0xad08('0x49')],'erlangBusyFactor':_0x495222[_0xad08('0x4a')],'startPredictive':_0x495222[_0xad08('0x4b')],'startProgressive':_0x495222['startProgressive']};if(_0x495222['Trunk']){_0x59be97['Trunk']={'id':_0x495222[_0xad08('0x4c')]['id'],'name':_0x495222[_0xad08('0x4c')][_0xad08('0x26')],'active':_0x495222[_0xad08('0x4c')][_0xad08('0x4d')],'callerid':_0x495222[_0xad08('0x4c')]['callerid']};}if(_0x495222['Interval']){_0x59be97[_0xad08('0x4e')]={'id':_0x495222[_0xad08('0x4e')]['id'],'name':_0x495222[_0xad08('0x4e')][_0xad08('0x26')]};}var _0x3b2e6d=md5(JSON[_0xad08('0x4f')](_0x59be97));if(_0x495222['md5']!==_0x3b2e6d){_0x495222[_0xad08('0x50')]=_0x3b2e6d;emit(util[_0xad08('0x51')](_0xad08('0x52'),_0x59be97[_0xad08('0x26')]),'voice_queue:save',_0x59be97);}}}function emitVoiceQueueChannelRemove(_0x2b70c6){logger[_0xad08('0x53')](_0xad08('0x54'),JSON[_0xad08('0x4f')](_0x2b70c6));emit(util[_0xad08('0x51')](_0xad08('0x52'),_0x2b70c6['name']),_0xad08('0x55'),_0x2b70c6);io[_0xad08('0x56')](_0xad08('0x57'),_0x2b70c6);}function notSendMessagesQueue(_0xba837b){if(_0xba837b['sendMessageOneNotActive']){if(_0xba837b[_0xad08('0x58')]===0x0&&_0xba837b[_0xad08('0x59')]===0x0){_0xba837b[_0xad08('0x5a')]=![];_0xba837b[_0xad08('0x28')]=0x0;_0xba837b['paused']=0x0;_0xba837b['message']=_0xad08('0x5b');ut[_0xad08('0x5c')](_0xad08('0x5d'),_0xba837b['name']+_0xad08('0x5e'));}else{_0xba837b[_0xad08('0x47')]=_0xad08('0x5f');ut[_0xad08('0x5c')](_0xad08('0x5d'),_0xba837b[_0xad08('0x26')]+_0xad08('0x60'));}emitCampaignPreview(_0xba837b);}}Preview['prototype'][_0xad08('0x22')]=function(){var _0x5df002=this;setInterval(function(){_0x5df002[_0xad08('0x61')]();},0x7cf);};Preview[_0xad08('0x62')][_0xad08('0x61')]=function(){var _0x3c8838=this[_0xad08('0x23')];this[_0xad08('0x15')]+=0x1;for(var _0x10a787 in _0x3c8838){if(_0x3c8838[_0xad08('0x63')](_0x10a787)&&(_0x3c8838[_0x10a787][_0xad08('0x64')]===_0xad08('0x6')||_0x3c8838[_0x10a787][_0xad08('0x64')]===_0xad08('0x65'))&&_0x3c8838[_0x10a787][_0xad08('0x24')]===_0xad08('0x25')){if(this[_0xad08('0x15')]>0x7){this[_0xad08('0x15')]=0x0;this[_0xad08('0x66')]();}}if(_0x3c8838[_0xad08('0x63')](_0x10a787)&&_0x3c8838[_0x10a787][_0xad08('0x64')]===_0xad08('0x6')&&_0x3c8838[_0x10a787]['type']===_0xad08('0x25')){if(_0x3c8838[_0x10a787][_0xad08('0x67')]){this['setMessage'](_0x3c8838[_0x10a787]);this[_0xad08('0x68')](_0x3c8838[_0x10a787]);}else{notSendMessagesQueue(_0x3c8838[_0x10a787]);}}}};Preview[_0xad08('0x62')][_0xad08('0x69')]=function(_0x4c4a9a){var _0x577f47=this;this[_0xad08('0x12')][_0xad08('0xf')](function(){if(!_[_0xad08('0x6a')](_0x577f47[_0xad08('0x6b')][_0x4c4a9a])){loggerAction[_0xad08('0x53')](_0xad08('0x6c'),_0x4c4a9a,'Queue',_0x577f47[_0xad08('0x6b')][_0x4c4a9a]['queue'],'originated:\x20',JSON[_0xad08('0x4f')](_0x577f47[_0xad08('0x23')][_0x577f47[_0xad08('0x6b')][_0x4c4a9a]['queue']][_0xad08('0x58')]),_0xad08('0x6d'),JSON[_0xad08('0x4f')](_0x577f47[_0xad08('0x23')][_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x6e')]][_0xad08('0x59')]),JSON[_0xad08('0x4f')](_0x577f47['actions'][_0x4c4a9a][_0xad08('0x6f')]),JSON['stringify'](_[_0xad08('0x70')](_0x577f47[_0xad08('0x6b')][_0x4c4a9a],[_0xad08('0x71'),_0xad08('0x72'),_0xad08('0x73'),'ListId'])));return ami['Action']({'action':_0xad08('0x74'),'channel':_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x75')]})['catch'](function(_0x4c91a1){if(_0x4c91a1['message']===_0xad08('0x76')){setTimeout(function(){if(_0x577f47['actions'][_0x4c4a9a]){ut['updateOriginated'](_0x577f47[_0xad08('0x23')][_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x6e')]],'[clearZombieChannel]');if(_0x577f47['actions'][_0x4c4a9a][_0xad08('0x6f')]===!![]){ut[_0xad08('0x77')](_0x577f47['campaignsPreview'][_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x6e')]],_0xad08('0x78'));ut[_0xad08('0x79')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4c4a9a,_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x6e')]);}ut[_0xad08('0x79')]('[Dialer][checkChannel][Preview]'+_0x4c4a9a,_0x577f47[_0xad08('0x6b')][_0x4c4a9a][_0xad08('0x6e')]);delete _0x577f47['actions'][_0x4c4a9a];}},0x2328);}});}});};Preview[_0xad08('0x62')][_0xad08('0x66')]=function(){var _0x7163e7=this;loggerAction[_0xad08('0x53')](_0xad08('0x7a'),_[_0xad08('0x7b')](this[_0xad08('0x6b')]));for(var _0x243d3b in this['actions']){if(_0x7163e7[_0xad08('0x6b')][_0xad08('0x63')](_0x243d3b)){_0x7163e7['clearZombieChannel'](_0x243d3b);}}};Preview[_0xad08('0x62')]['recallMe']=function(_0x2c9fb0){var _0x298726=this;rpcDb[_0xad08('0x7c')](_0x2c9fb0['id'],ut[_0xad08('0x7d')](this['agents']))[_0xad08('0x7e')](function(_0x365e70){if(!_[_0xad08('0x6a')](_0x365e70)){for(var _0x1d05ad=0x0;_0x1d05ad<_0x365e70[_0xad08('0x7f')];_0x1d05ad+=0x1){if(ut[_0xad08('0x80')](_0x365e70[_0x1d05ad][_0xad08('0x81')])<_0x2c9fb0[_0xad08('0x82')]*0x3c){if(_0x365e70[_0x1d05ad][_0xad08('0x83')]&&!_0x365e70[_0x1d05ad][_0xad08('0x83')]['voicePause']){_0x298726[_0xad08('0x84')](_0x365e70[_0x1d05ad]['id'])[_0xad08('0x7e')](ut[_0xad08('0x85')](_0xad08('0x86')))[_0xad08('0x87')](ut[_0xad08('0x85')](_0xad08('0x86')));}else{rpcDb[_0xad08('0x88')](_0x365e70[_0x1d05ad]['id']);}}else{var _0x1743f1=new Action(_0x365e70[_0x1d05ad],_0x2c9fb0);_0x1743f1['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c9fb0['outboundReCallsDay']+=0x1;ut[_0xad08('0x89')](_0x1743f1,0x17,_0xad08('0x8a'));if(_0x2c9fb0[_0xad08('0x8b')]){rpcDb[_0xad08('0x8c')](ut[_0xad08('0x8d')](_0x365e70[_0x1d05ad]));rpcDb[_0xad08('0x8e')](_0x1743f1,_0xad08('0x8f'));}else{ut[_0xad08('0x89')](_0x1743f1,0x16,_0xad08('0x90'));rpcDb['createCustomerHistory'](_0x1743f1,'[HistoryRecallClose]');rpcDb[_0xad08('0x91')](_0x1743f1,'[HistoryRecallClose]');}}}}})[_0xad08('0x87')](ut[_0xad08('0x85')]('[getContactRecallMe]'));};Preview[_0xad08('0x62')][_0xad08('0x92')]=function(_0x2d0287){_0x2d0287[_0xad08('0x5a')]=!![];if(ut[_0xad08('0x93')](_0x2d0287[_0xad08('0x29')])){_0x2d0287[_0xad08('0x47')]=_0xad08('0x94');}else if(!ut[_0xad08('0x95')](_0x2d0287[_0xad08('0x67')])){_0x2d0287[_0xad08('0x47')]=_0xad08('0x5b');}else if(!this[_0xad08('0x96')](_0x2d0287[_0xad08('0x4c')])){if(!this[_0xad08('0x96')](_0x2d0287[_0xad08('0x97')])){_0x2d0287[_0xad08('0x47')]=_0xad08('0x98');}else{_0x2d0287['message']=_0xad08('0x99');}}else{_0x2d0287[_0xad08('0x47')]=_0xad08('0x99');}emitCampaignPreview(_0x2d0287);};Preview['prototype'][_0xad08('0x9a')]=function(_0x595b4d,_0x33bb8f,_0x240a8c){var _0x443ba4=this;var _0x51929e=this[_0xad08('0x6b')][_0x33bb8f];var _0x3d2112=this[_0xad08('0x23')][_0x51929e['queue']];var _0x22aa4d;var _0x10111e=![];var _0x25b511=0x2;var _0xa6bbb9=0x3;if(_0x3d2112){switch(_0x240a8c){case'1':_0x3d2112[_0xad08('0x9b')]+=0x1;_0x51929e[_0xad08('0x9c')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x0,_0xad08('0x9f'));ami[_0xad08('0x56')](_0xad08('0xa0'),ut['buildObj'](_0x51929e,_0xad08('0xa1')));rpcDb[_0xad08('0x8e')](_0x51929e,_0xad08('0xa2'));_0x443ba4[_0xad08('0xa3')](_0x51929e,'0',_0x3d2112)['then'](function(_0x2e4d6d){_0x10111e=_0x2e4d6d[_0xad08('0xa4')]==0x1;_0x25b511=_0x3d2112['dialNoSuchNumberRetryFrequency'];_0xa6bbb9=_0x3d2112['callAdditionalPhoneAfterMin'];if(!_0x10111e){if(ut['totalGlobal'](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut['cloneAction'](_0x51929e,0xf,_0xad08('0xa6'));rpcDb['createCustomerFinal'](_0x22aa4d,_0xad08('0xa7'));}else{if(_0x51929e[_0xad08('0x9c')]>=_0x3d2112[_0xad08('0xa8')]){rpcDb[_0xad08('0x91')](_0x51929e,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xad08('0xa9')](ut[_0xad08('0xaa')](_0x51929e,_0xad08('0x9c'),_0x3d2112['dialNoSuchNumberRetryFrequency']),_0x51929e[_0xad08('0xab')],_0x51929e['activeContact']);}}delete this['actions'][_0x595b4d[_0xad08('0xac')]];}else{_0x51929e['countnosuchnumberretry']++;logger[_0xad08('0x53')]('actioncountonusuch',_0x51929e[_0xad08('0x9c')]);logger[_0xad08('0x53')]('id',_0x51929e[_0xad08('0xad')]);_0x443ba4[_0xad08('0xae')]({'id':_0x51929e['idContact'],'field':{'countnosuchnumberretry':_0x51929e[_0xad08('0x9c')]}})[_0xad08('0x7e')](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});break;case _0xad08('0xb0'):var _0x50e844=moment()[_0xad08('0x51')](_0xad08('0xb1'));_0x51929e[_0xad08('0xb2')]=_0x50e844;_0x51929e['answertime']=_0x50e844;_0x51929e[_0xad08('0x6f')]=!![];_0x3d2112[_0xad08('0x59')]+=0x1;logger[_0xad08('0x53')](_0xad08('0xb3'),_0x51929e['uniqueid'],_0xad08('0xb4'),_0x3d2112[_0xad08('0x26')],'pTalking:\x20',_0x3d2112['pTalking']);ami[_0xad08('0x56')](_0xad08('0xb5'),ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xb7'),this[_0xad08('0x23')][_0x51929e['queue']]));if(_0x3d2112[_0xad08('0xb8')]){ami['emit'](_0xad08('0xb9'),ut[_0xad08('0xba')](_0x51929e));}break;case'16':ami['emit'](_0xad08('0xbb'),ut['buildObj'](_0x51929e,_0xad08('0xbc'),this[_0xad08('0x23')][_0x51929e['queue']]));emitVoiceQueueChannelRemove(ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xbc')));_0x3d2112['outboundAnswerCallsDay']+=0x1;_0x3d2112[_0xad08('0x2c')]+=0x1;_0x3d2112[_0xad08('0xbd')]+=0x1;ut[_0xad08('0x77')](_0x3d2112,_0xad08('0xbe'));_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x4,_0xad08('0xbf'));rpcDb['createCustomerHistory'](_0x51929e,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xc0'));rpcDb[_0xad08('0xc1')](_0x51929e);_0x3d2112[_0xad08('0xc2')]+=_0x51929e[_0xad08('0xc3')];_0x3d2112[_0xad08('0xc4')]+=_0x51929e['talktime'];logger[_0xad08('0x53')](_0xad08('0xc5'),_0x51929e[_0xad08('0xc6')],_0xad08('0xb4'),_0x3d2112[_0xad08('0x26')],'pTalking:\x20',_0x3d2112[_0xad08('0x59')]);delete this[_0xad08('0x6b')][_0x595b4d[_0xad08('0xac')]];break;case _0xad08('0xc7'):_0x3d2112['outboundBusyCallsDay']+=0x1;_0x51929e[_0xad08('0xc8')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut['totalGlobal'](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x5,_0xad08('0xc9'));_0x25b511=_0x3d2112['dialBusyRetryFrequency'];_0xa6bbb9=_0x3d2112[_0xad08('0xca')];ami[_0xad08('0x56')]('custom:agentbusy',ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xcb')));rpcDb['createCustomerHistory'](_0x51929e,_0xad08('0xcc'));_0x443ba4[_0xad08('0xa3')](_0x51929e,'5',_0x3d2112)[_0xad08('0x7e')](function(_0x37963e){_0x10111e=_0x37963e[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0xf,_0xad08('0xa6'));rpcDb[_0xad08('0x91')](_0x22aa4d,_0xad08('0xce'));}else{if(_0x51929e['countbusyretry']>=_0x3d2112['dialBusyMaxRetry']){rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xcc'));}else{rpcDb['rescheduleContact'](ut[_0xad08('0xaa')](_0x51929e,'countbusyretry',_0x3d2112[_0xad08('0xcf')]),_0x51929e[_0xad08('0xab')],_0x51929e[_0xad08('0xd0')]);}}}else{_0x51929e['countbusyretry']++;_0x443ba4['incrementPreviewCounters']({'id':_0x51929e[_0xad08('0xad')],'field':{'countbusyretry':_0x51929e[_0xad08('0xc8')]}})['then'](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});break;case _0xad08('0xd1'):_0x3d2112[_0xad08('0x37')]+=0x1;_0x51929e[_0xad08('0xd2')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x3,_0xad08('0xd3'));_0x25b511=_0x3d2112[_0xad08('0xd4')];_0xa6bbb9=_0x3d2112[_0xad08('0xca')];ami[_0xad08('0x56')]('custom:agentnoanswer',ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xd5')));rpcDb[_0xad08('0x8e')](_0x51929e,_0xad08('0xd6'));_0x443ba4[_0xad08('0xa3')](_0x51929e,'3',_0x3d2112)[_0xad08('0x7e')](function(_0x570e3a){_0x10111e=_0x570e3a[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112['dialGlobalMaxRetry']){_0x22aa4d=ut['cloneAction'](_0x51929e,0xf,_0xad08('0xa6'));rpcDb[_0xad08('0x91')](_0x22aa4d,_0xad08('0xd7'));}else{if(_0x51929e['countnoanswerretry']>=_0x3d2112[_0xad08('0xd8')]){rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xd6'));}else{rpcDb[_0xad08('0xa9')](ut[_0xad08('0xaa')](_0x51929e,'countnoanswerretry',_0x3d2112[_0xad08('0xd4')]),_0x51929e[_0xad08('0xab')],_0x51929e[_0xad08('0xd0')]);}}}else{_0x51929e[_0xad08('0xd2')]++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e[_0xad08('0xad')],'field':{'countnoanswerretry':_0x51929e[_0xad08('0xd2')]}})[_0xad08('0x7e')](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)['then'](function(){});});}});break;case'CONGESTION':_0x3d2112['outboundCongestionCallsDay']+=0x1;_0x51929e[_0xad08('0xd9')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut['totalGlobal'](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x8,'Congestion');_0x25b511=_0x3d2112[_0xad08('0xda')];_0xa6bbb9=_0x3d2112[_0xad08('0xca')];ami[_0xad08('0x56')](_0xad08('0xdb'),ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xdc')));rpcDb[_0xad08('0x8e')](_0x51929e,_0xad08('0xdd'));_0x443ba4['verifyAdditionalPhones'](_0x51929e,'8',_0x3d2112)[_0xad08('0x7e')](function(_0x2cc4e4){_0x10111e=_0x2cc4e4[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0xf,_0xad08('0xa6'));rpcDb[_0xad08('0x91')](_0x22aa4d,_0xad08('0xde'));}else{if(_0x51929e[_0xad08('0xd9')]>=_0x3d2112['dialCongestionMaxRetry']){rpcDb[_0xad08('0x91')](_0x51929e,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xad08('0xaa')](_0x51929e,_0xad08('0xd9'),_0x3d2112['dialBusyRetryFrequency']),_0x51929e[_0xad08('0xab')],_0x51929e[_0xad08('0xd0')]);}}}else{_0x51929e[_0xad08('0xd9')]++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e[_0xad08('0xad')],'field':{'countcongestionretry':_0x51929e[_0xad08('0xd9')]}})[_0xad08('0x7e')](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)['then'](function(){});});}});break;case _0xad08('0xdf'):_0x3d2112['outboundRejectCallsDay']+=0x1;_0x51929e[_0xad08('0xe0')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x14,_0xad08('0xe1'));_0x25b511=_0x3d2112[_0xad08('0xe2')];_0xa6bbb9=_0x3d2112[_0xad08('0xca')];ami['emit'](_0xad08('0xe3'),ut['buildObj'](_0x51929e,_0xad08('0xe4')));rpcDb[_0xad08('0x8e')](_0x51929e,_0xad08('0xe5'));_0x443ba4[_0xad08('0xa3')](_0x51929e,'20',_0x3d2112)['then'](function(_0x2d0201){_0x10111e=_0x2d0201['additional']==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0x14,_0xad08('0xe1'));rpcDb[_0xad08('0x91')](_0x22aa4d,_0xad08('0xe6'));}else{if(_0x51929e[_0xad08('0xe0')]>=_0x3d2112[_0xad08('0xe7')]){rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xe6'));}else{rpcDb[_0xad08('0xa9')](ut[_0xad08('0xaa')](_0x51929e,_0xad08('0xe0'),_0x3d2112[_0xad08('0xe2')]),_0x51929e['unlockAgent'],_0x51929e[_0xad08('0xd0')]);}}}else{_0x51929e[_0xad08('0xd2')]++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e['idContact'],'field':{'countnoanswerretry':_0x51929e[_0xad08('0xd2')]}})[_0xad08('0x7e')](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});break;case _0xad08('0xe8'):_0x3d2112[_0xad08('0x3b')]+=0x1;_0x51929e['countabandonedretry']+=0x1;_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut['logCustomer'](_0x51929e,0xb,_0xad08('0xe9'));rpcDb[_0xad08('0x8e')](_0x51929e,'[callProgressDetectingCustomer][logAbandoned]');_0x443ba4[_0xad08('0xa3')](_0x51929e,'11',_0x3d2112)['then'](function(_0x4c07d5){_0x10111e=_0x4c07d5[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0xf,_0xad08('0xa6'));rpcDb['createCustomerFinal'](_0x22aa4d,_0xad08('0xea'));}else{if(_0x51929e[_0xad08('0xeb')]>=_0x3d2112[_0xad08('0xec')]){rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xea'));}else{rpcDb[_0xad08('0xa9')](ut['scheduledAt'](_0x51929e,'countabandonedretry',_0x3d2112['dialAbandonedRetryFrequency']),_0x51929e[_0xad08('0xab')],_0x51929e[_0xad08('0xd0')]);}}}else{_0x51929e['countnoanswerretry']++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e[_0xad08('0xad')],'field':{'countnoanswerretry':_0x51929e[_0xad08('0xd2')]}})[_0xad08('0x7e')](function(){_0x443ba4['swapAdditionalPhones'](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});break;case'18':_0x3d2112[_0xad08('0x3a')]+=0x1;_0x51929e[_0xad08('0xed')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut['totalGlobal'](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x12,_0x595b4d['cause-txt']||_0x595b4d[_0xad08('0xee')]);ami[_0xad08('0x56')](_0xad08('0xef'),ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xf0')));rpcDb['createCustomerHistory'](_0x51929e,_0xad08('0xf1'));_0x443ba4[_0xad08('0xa3')](_0x51929e,'18',_0x3d2112)[_0xad08('0x7e')](function(_0x340310){_0x10111e=_0x340310[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0x12,_0xad08('0xa6'));rpcDb['createCustomerFinal'](_0x22aa4d,_0xad08('0xf1'));}else{rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xf1'));}}else{_0x51929e[_0xad08('0xd2')]++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e[_0xad08('0xad')],'field':{'countnoanswerretry':_0x51929e['countnoanswerretry']}})['then'](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});delete this[_0xad08('0x6b')][_0x595b4d['linkedid']];break;case'19':_0x3d2112[_0xad08('0x3a')]+=0x1;_0x51929e[_0xad08('0x9d')]=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0x13,_0x595b4d[_0xad08('0xf2')]||_0x595b4d[_0xad08('0xee')]);ami[_0xad08('0x56')](_0xad08('0xef'),ut[_0xad08('0xb6')](_0x51929e,_0xad08('0xf0')));rpcDb[_0xad08('0x8e')](_0x51929e,_0xad08('0xf3'));_0x443ba4['verifyAdditionalPhones'](_0x51929e,'18',_0x3d2112)[_0xad08('0x7e')](function(_0x336590){_0x10111e=_0x336590[_0xad08('0xa4')]==0x1;if(!_0x10111e){if(ut[_0xad08('0x9e')](_0x51929e)>=_0x3d2112['dialGlobalMaxRetry']){_0x22aa4d=ut[_0xad08('0xcd')](_0x51929e,0xf,_0xad08('0xa6'));rpcDb[_0xad08('0x91')](_0x22aa4d,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xf3'));}}else{_0x51929e[_0xad08('0xd2')]++;_0x443ba4[_0xad08('0xae')]({'id':_0x51929e[_0xad08('0xad')],'field':{'countnoanswerretry':_0x51929e[_0xad08('0xd2')]}})[_0xad08('0x7e')](function(){_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(){});});}});delete this[_0xad08('0x6b')][_0x595b4d['linkedid']];break;default:if(_0x51929e[_0xad08('0x6f')]){ut['decrementTalkink'](_0x3d2112,_0xad08('0xf4'));ut[_0xad08('0x79')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3d2112[_0xad08('0x26')],_0x595b4d);}_0x3d2112[_0xad08('0x3a')]+=0x1;_0x51929e['countglobal']=ut[_0xad08('0x9e')](_0x51929e);ut[_0xad08('0x89')](_0x51929e,0xc,_0x595b4d[_0xad08('0xf2')]||_0x595b4d[_0xad08('0xee')]);_0x25b511=_0x3d2112[_0xad08('0xe2')];_0xa6bbb9=_0x3d2112['callAdditionalPhoneAfterMin'];rpcDb[_0xad08('0x8e')](_0x51929e,'[callProgressDetectingCustomer][logUnknown]');_0x443ba4[_0xad08('0xa3')](_0x51929e,'20',_0x3d2112)[_0xad08('0x7e')](function(_0x42cac1){_0x10111e=_0x42cac1['additional']==0x1;if(!_0x10111e){if(ut['totalGlobal'](_0x51929e)>=_0x3d2112[_0xad08('0xa5')]){_0x22aa4d=ut['cloneAction'](_0x51929e,0xf,_0xad08('0xa6'));rpcDb[_0xad08('0x91')](_0x22aa4d,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xad08('0x91')](_0x51929e,_0xad08('0xf5'));}delete this[_0xad08('0x6b')][_0x595b4d[_0xad08('0xac')]];}else{_0x443ba4[_0xad08('0xaf')](_0x51929e,_0x25b511,_0xa6bbb9)[_0xad08('0x7e')](function(_0x492c08){});}});}if(!(_0x51929e[_0xad08('0x6f')]&&_0x240a8c==='16')){ut[_0xad08('0xf6')](_0x3d2112,_0xad08('0xf7'));logger[_0xad08('0x53')](_0xad08('0xf8'),_0x51929e[_0xad08('0xc6')],_0xad08('0xb4'),_0x3d2112[_0xad08('0x26')],_0xad08('0xf9'),_0x3d2112[_0xad08('0x58')]);}if(_0x240a8c!==_0xad08('0xb0')){delete this[_0xad08('0x6b')][_0x595b4d['linkedid']];delete this[_0xad08('0x6b')][_0x595b4d[_0xad08('0xfa')]];}}};Preview[_0xad08('0x62')]['callProgressDetectingAgent']=function(_0x22403e,_0xb994a1,_0x58d094){if(_[_0xad08('0xfb')](_0xb994a1)&&_0xad08('0xfc')!==typeof _0xb994a1){return;}if(_['isUndefined'](_0x58d094)&&_0xad08('0xfc')!==typeof _0x58d094){return;}switch(_0x58d094['reason']){case'0':ut[_0xad08('0xfd')](_0x22403e,0x0,_0xad08('0x9f'));rpcDb['createAgentHistory'](_0x22403e,_0xad08('0xfe'));break;case'3':ut[_0xad08('0xfd')](_0x22403e,0x3,_0xad08('0xd3'));rpcDb[_0xad08('0xff')](_0x22403e,_0xad08('0x100'));break;case'5':ut[_0xad08('0xfd')](_0x22403e,0x5,'Busy');rpcDb[_0xad08('0xff')](_0x22403e,_0xad08('0x101'));break;case'8':ut[_0xad08('0xfd')](_0x22403e,0x8,_0xad08('0x102'));rpcDb[_0xad08('0xff')](_0x22403e,_0xad08('0x103'));break;case'22':ut['logAgent'](_0x22403e,0x16,_0xad08('0x104'));rpcDb[_0xad08('0xff')](_0x22403e,_0xad08('0x105'));break;default:ut[_0xad08('0xfd')](_0x22403e,0xc,_0x58d094[_0xad08('0x106')]);rpcDb[_0xad08('0xff')](_0x22403e,'[callProgressDetectingAgent][logCongestion]');}ut[_0xad08('0xf6')](_0xb994a1,'[callProgressDetectingAgent]');logger[_0xad08('0x53')](_0xad08('0x107'),_0x22403e['uniqueid'],_0xad08('0xb4'),_0xb994a1[_0xad08('0x26')],_0xad08('0xf9'),_0xb994a1['originated']);delete this[_0xad08('0x6b')][_0x22403e[_0xad08('0xc6')]];};Preview[_0xad08('0x62')][_0xad08('0xa3')]=function(_0x3ef1be,_0x3eecda,_0x331e7e){return BPromise['resolve']()[_0xad08('0x7e')](cmHopperAdditionalPhone[_0xad08('0xa3')](_0x3ef1be,_0x3eecda,_0x331e7e))['catch'](logger[_0xad08('0x53')](_0xad08('0x108')));};Preview['prototype'][_0xad08('0xaf')]=function(_0x1899e6,_0x289b76,_0x93e0e3){return BPromise[_0xad08('0x109')]()[_0xad08('0x7e')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1899e6,_0x289b76,_0x93e0e3))[_0xad08('0x87')](logger[_0xad08('0x53')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xad08('0xae')]=function(_0x594522){return BPromise[_0xad08('0x109')]()['then'](cmHopperAdditionalPhone[_0xad08('0xae')](_0x594522))[_0xad08('0x87')](logger[_0xad08('0x53')](_0xad08('0x10a')));};Preview[_0xad08('0x62')][_0xad08('0x10b')]=function(_0x4073b8,_0x492c40,_0x580d06,_0x1f1651,_0x1cc47b){var _0x41b7f1=this;return new BPromise(function(_0x4aa215,_0x11e9ca){if(_['isNil'](_0x492c40)||_[_0xad08('0x6a')](_0x492c40[_0xad08('0x10c')])||_['isNil'](_0x492c40[_0xad08('0x10d')])||_[_0xad08('0x6a')](_0x492c40[_0xad08('0x73')])){_0x11e9ca(ut[_0xad08('0x47')]('Contact\x20is\x20undefined',_0x1f1651,_0x1cc47b));return;}var _0x17cf15=uuid['v4']();var _0x2fa381=_0x41b7f1[_0xad08('0x23')][_0x492c40[_0xad08('0x10e')][_0xad08('0x26')]];var _0x2bafd2=_0x580d06?_0x41b7f1['agents'][_0x580d06]['id']:undefined;_0x41b7f1['actions'][_0x17cf15]=new Action(_0x492c40,_0x2fa381,_0x17cf15,_0x580d06,_0x2bafd2);var _0x21d596=_0x41b7f1[_0xad08('0x6b')][_0x17cf15];_0x21d596['unlockAgent']=_0x1f1651;_0x21d596[_0xad08('0xd0')]=_0x1cc47b;_0x21d596['lookAgent']=_0x580d06;if(_[_0xad08('0x10f')](_0x4073b8)){_0x41b7f1[_0xad08('0x110')](_0x21d596,_0x2fa381,_0x492c40,_0x580d06)[_0xad08('0x7e')](function(_0x4da060){logger['info'](_0xad08('0x111'),_0xad08('0x112')+_0x21d596[_0xad08('0x6e')]+_0xad08('0x113')+_0x21d596[_0xad08('0xad')],JSON[_0xad08('0x4f')](_0x4da060));ami['emit'](_0xad08('0x114'),ut[_0xad08('0xb6')](_0x21d596,_0xad08('0x115'),_0x41b7f1[_0xad08('0x23')][_0x21d596[_0xad08('0x6e')]]));_0x4aa215(ut['message'](_0xad08('0x116')));})[_0xad08('0x87')](function(_0x1fffda){ut[_0xad08('0x5c')](_0xad08('0x117'),_0x1fffda);_0x11e9ca(ut[_0xad08('0x47')](_0xad08('0x118'),_0x1f1651,_0x1cc47b));});}else{_0x2fa381['outboundBlacklistCallsDay']+=0x1;ut[_0xad08('0x119')](_0x21d596);rpcDb[_0xad08('0x11a')](_0x21d596,_0xad08('0x11b'));delete _0x41b7f1[_0xad08('0x6b')][_0x17cf15];_0x11e9ca(ut[_0xad08('0x47')](_0xad08('0x11c'),_0x1f1651,_0x1cc47b));}});};Preview['prototype'][_0xad08('0x96')]=function(_0xec289f){return!_[_0xad08('0x6a')](_0xec289f)&&!_['isNil'](_0xec289f[_0xad08('0x26')])&&!_[_0xad08('0x6a')](_0xec289f[_0xad08('0x4d')])&&_0xec289f['active']&&!_[_0xad08('0x6a')](this['trunks'][util['format'](_0xad08('0x11d'),_0xec289f[_0xad08('0x26')])])&&!_[_0xad08('0x6a')](this[_0xad08('0x14')][util[_0xad08('0x51')](_0xad08('0x11d'),_0xec289f['name'])][_0xad08('0x74')])&&(this['trunks'][util[_0xad08('0x51')](_0xad08('0x11d'),_0xec289f['name'])][_0xad08('0x74')]==='reachable'||this[_0xad08('0x14')][util['format'](_0xad08('0x11d'),_0xec289f[_0xad08('0x26')])][_0xad08('0x74')]===_0xad08('0x11e'));};Preview[_0xad08('0x62')][_0xad08('0x84')]=function(_0x494a35,_0x32ed0d){var _0x28abcc=this;return new BPromise(function(_0x37b818,_0x562d2e){_0x28abcc[_0xad08('0x11f')](_0x494a35,_0x32ed0d)[_0xad08('0x7e')](function(_0x4171b8){_0x37b818(_[_0xad08('0x70')](_0x4171b8,[_0xad08('0x47')]));})['catch'](function(_0x196c7d){if(_0x196c7d[_0xad08('0x120')]){rpcDb[_0xad08('0x121')](_0x494a35);}if(_0x196c7d[_0xad08('0x4d')]){rpcDb[_0xad08('0x88')](_0x494a35);}_0x562d2e(_[_0xad08('0x70')](_0x196c7d,['message']));});});};Preview[_0xad08('0x62')][_0xad08('0x11f')]=function(_0x2cc316,_0x427220){var _0x36a042=this;return new BPromise(function(_0x57bcde,_0x38832c){var _0x2741c7,_0x59bc7c;rpcDb[_0xad08('0x122')](_0x2cc316)[_0xad08('0x7e')](function(_0x4075e4){if(!_[_0xad08('0x6a')](_0x4075e4[0x0])){_0x59bc7c=_0x4075e4[0x0]['recallme']?![]:!![];_0x2741c7=_0x4075e4[0x0][_0xad08('0x123')]?!![]:![];_0x2741c7=_0x427220?!![]:_0x2741c7;}var _0x1651ac=_0x36a042[_0xad08('0x124')](_0x4075e4);if(_0x1651ac[_0xad08('0x125')]){rpcDb[_0xad08('0x126')](_[_0xad08('0x70')](_0x4075e4[0x0],[_0xad08('0x73'),_0xad08('0x10d')]))[_0xad08('0x7e')](function(_0x33b883){_0x36a042[_0xad08('0x10b')](_0x33b883,_0x4075e4[0x0],_0x427220,_0x59bc7c,_0x2741c7)[_0xad08('0x7e')](function(_0x1d6c17){_0x57bcde(_0x1d6c17);})[_0xad08('0x87')](function(_0x3e34bf){_0x38832c(_0x3e34bf);});})['catch'](function(_0x126eb8){ut['logger']('[Preview][checkIsBlackList]',_0x126eb8);_0x38832c(ut[_0xad08('0x47')](_0xad08('0x127'),_0x59bc7c,_0x2741c7));});}else{_0x38832c(ut['message'](_0x1651ac[_0xad08('0x47')],_0x59bc7c,_0x2741c7));}})[_0xad08('0x87')](function(_0x3de6e1){ut[_0xad08('0x5c')](_0xad08('0x128'),_0x3de6e1);_0x38832c(ut[_0xad08('0x47')](_0xad08('0x127'),![],!![]));});});};Preview[_0xad08('0x62')]['validateContact']=function(_0x4abb1c){if(_[_0xad08('0x6a')](_0x4abb1c)||_[_0xad08('0x10f')](_0x4abb1c)||!_[_0xad08('0x6a')](_0x4abb1c[0x0][_0xad08('0x83')])&&_['isNil'](_0x4abb1c[0x0][_0xad08('0x83')][_0xad08('0x26')])){ut['logger'](_0xad08('0x129'),_0x4abb1c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x68f420=this[_0xad08('0x23')][_0x4abb1c[0x0][_0xad08('0x10e')]['name']];_0x68f420[_0xad08('0x47')]=_0xad08('0x99');if(_['isNil'](_0x68f420)){ut[_0xad08('0x5c')](_0xad08('0x12a'),_0x68f420);return{'isValid':![],'message':_0xad08('0x12b')};}if(!this[_0xad08('0x96')](_0x68f420[_0xad08('0x4c')])){ut['logger'](_0xad08('0x12c'),_0xad08('0x12d')+_0x68f420[_0xad08('0x26')]+_0xad08('0x12e'));if(!this[_0xad08('0x96')](_0x68f420['TrunkBackup'])){ut[_0xad08('0x5c')](_0xad08('0x12c'),_0x68f420['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xad08('0x12f')};}}if(!ut[_0xad08('0x95')](_0x68f420['dialActive'])){ut['logger'](_0xad08('0x130'),_0x68f420['name']+_0xad08('0x131'));return{'isValid':![],'message':_0xad08('0x12d')+_0x68f420[_0xad08('0x26')]+_0xad08('0x131')};}return{'isValid':!![],'message':_0xad08('0x132')};};Preview[_0xad08('0x62')][_0xad08('0x110')]=function(_0xfa6627,_0x38109c,_0x4e1e81,_0x169fdb){var _0x2bd197=this;return new BPromise(function(_0xf36972,_0x1bbebb){var _0x1020ca=_0xfa6627[_0xad08('0xc6')];var _0x1ec16f=_0x2bd197[_0xad08('0x96')](_0x38109c[_0xad08('0x4c')])?util[_0xad08('0x51')]('SIP/%s/%s%s',_0x38109c[_0xad08('0x4c')][_0xad08('0x26')],_[_0xad08('0x6a')](_0x38109c[_0xad08('0x133')])?'':_0x38109c['dialPrefix']['trim']()||'',_0x38109c[_0xad08('0x134')]>0x0?_0x4e1e81[_0xad08('0x10d')][_0xad08('0x135')](_0x38109c[_0xad08('0x134')]):_0x4e1e81['phone']):util[_0xad08('0x51')](_0xad08('0x136'),_[_0xad08('0x6a')](_0x38109c[_0xad08('0x97')])?_0x38109c['Trunk']['name']:_0x38109c['TrunkBackup'][_0xad08('0x26')],_['isNil'](_0x38109c[_0xad08('0x133')])?'':_0x38109c[_0xad08('0x133')][_0xad08('0x137')]()||'',_0x38109c[_0xad08('0x134')]>0x0?_0x4e1e81['phone'][_0xad08('0x135')](_0x38109c[_0xad08('0x134')]):_0x4e1e81['phone']);var _0x2f0f54=_0x2bd197[_0xad08('0x96')](_0x38109c[_0xad08('0x4c')])?ut[_0xad08('0x138')](_0x38109c[_0xad08('0x4c')][_0xad08('0x139')],_0x38109c['dialOriginateCallerIdName'],_0x38109c[_0xad08('0x13a')]>0x0?ut[_0xad08('0x13b')](_0x38109c[_0xad08('0x13c')],_0x38109c['dialRandomLastDigitCallerIdNumber']):_0x38109c['dialOriginateCallerIdNumber']):ut[_0xad08('0x138')](_[_0xad08('0x6a')](_0x38109c[_0xad08('0x97')])?_0x38109c['Trunk'][_0xad08('0x139')]:_0x38109c['TrunkBackup'][_0xad08('0x139')],_0x38109c['dialOriginateCallerIdName'],_0x38109c[_0xad08('0x13a')]>0x0?ut['getCallerIdRandom'](_0x38109c[_0xad08('0x13c')],_0x38109c[_0xad08('0x13a')]):_0x38109c[_0xad08('0x13c')]);if(_0x2f0f54){_0xfa6627[_0xad08('0x13d')]=ut[_0xad08('0x13e')](_0x2f0f54);_0xfa6627[_0xad08('0x13f')]=ut['extractCalleridNumber'](_0x2f0f54);}var _0x10b807=ut[_0xad08('0x140')](_0x38109c,_0x4e1e81,_0x1ec16f,_0x2f0f54,_0x1020ca,_0xfa6627);_[_0xad08('0x141')](_0xfa6627,ut['toLowerVariables'](_0x10b807));_0xfa6627[_0xad08('0x142')]=moment()[_0xad08('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xad08('0x143')](_0xfa6627,_0x38109c,_0x10b807,_0xfa6627['activeContact'],_0x169fdb))['then'](function(_0x33e02f){var _0x60cdf3=_0xfa6627[_0xad08('0x144')];if(!_[_0xad08('0x6a')](_0x60cdf3)){if(!_[_0xad08('0x6a')](_0x2bd197['agents'][_0x60cdf3])){_0x2bd197['agents'][_0x60cdf3]['destconnectedlinenum']=_0xfa6627[_0xad08('0x145')];emit(util['format']('user:%s',_0x2bd197[_0xad08('0x146')][_0x60cdf3][_0xad08('0x26')]),_0xad08('0x147'),{'destaccountcode':_0x2bd197[_0xad08('0x146')][_0x60cdf3][_0xad08('0x148')],'destconnectedlinenum':_0xfa6627['calleridnum']});}}_0x38109c[_0xad08('0x58')]+=0x1;logger[_0xad08('0x53')](_0xad08('0x149'),_0x1020ca,_0xad08('0xb4'),_0x38109c[_0xad08('0x26')],'originated:\x20',_0x38109c[_0xad08('0x58')]);_0xf36972(_0x33e02f);})[_0xad08('0x87')](function(_0x48588a){ut['logAgent'](_0xfa6627,0xe,_0xad08('0x14a'));rpcDb[_0xad08('0xff')](_0xfa6627,_0xad08('0x14b'));_0x1bbebb(_0x48588a);});});};Preview['prototype']['syncNewExten']=function(_0x5842bf){if(this[_0xad08('0x6b')][_0x5842bf[_0xad08('0xac')]]){this['actions'][_0x5842bf[_0xad08('0xac')]][_0xad08('0x75')]=_0x5842bf[_0xad08('0x75')];}};Preview[_0xad08('0x62')][_0xad08('0x16')]=function(_0x2029a6){var _0xd94078=this;var _0x3b0074=this[_0xad08('0x6b')][_0x2029a6[_0xad08('0x14c')]];if(_0x3b0074){if(_0x3b0074[_0xad08('0x14d')]&&this[_0xad08('0x146')][_0x3b0074[_0xad08('0x14d')]]){ut['logLookAgent'](_0x3b0074,this['agents'][_0x3b0074[_0xad08('0x14d')]][_0xad08('0x26')],this[_0xad08('0x146')][_0x3b0074[_0xad08('0x14d')]]['id']);}var _0x30a0c2=_[_0xad08('0x14e')](_0x3b0074);_0x30a0c2[_0xad08('0xb2')]=moment()[_0xad08('0x51')](_0xad08('0xb1'));var _0x18908a=_0xd94078['campaignsPreview'][_0x3b0074[_0xad08('0x6e')]];if(ut[_0xad08('0x14f')](_0x2029a6['response'])){if(_0x3b0074[_0xad08('0xab')]){rpcDb['unlockContact'](_0x3b0074['idContact']);}if(_0x3b0074[_0xad08('0xd0')]){rpcDb[_0xad08('0x88')](_0x3b0074[_0xad08('0xad')]);}ami[_0xad08('0x56')](_0xad08('0x150'),ut['buildObj'](_0x3b0074,_0xad08('0x151'),this[_0xad08('0x23')][_0x3b0074['queue']]));this[_0xad08('0x152')](_0x30a0c2,_0x18908a,_0x2029a6);}else{_0x3b0074[_0xad08('0x142')]=moment()['format'](_0xad08('0xb1'));ut['logAgent'](_0x30a0c2,0x4,_0xad08('0xbf'));rpcDb[_0xad08('0xff')](_0x30a0c2,_0xad08('0x153'));}}};Preview['prototype'][_0xad08('0x17')]=function(_0x291bfc){var _0x4af407=this;var _0x114e89=this[_0xad08('0x6b')][_0x291bfc[_0xad08('0xac')]];var _0x3171ab;if(_0x114e89){_0x3171ab=this[_0xad08('0x23')][_0x114e89[_0xad08('0x6e')]];logger['info'](_0xad08('0x154'),_0x291bfc[_0xad08('0xac')],_0xad08('0xb4'),_0x3171ab[_0xad08('0x26')],_0xad08('0x6d'),_0x3171ab['pTalking']);}if(this[_0xad08('0x6b')][_0x291bfc[_0xad08('0xac')]]&&_0x291bfc[_0xad08('0xac')]!==_0x291bfc[_0xad08('0xc6')]){if(_0x291bfc['cause']==='16'&&this[_0xad08('0x6b')][_0x291bfc[_0xad08('0xac')]][_0xad08('0x6f')]){this[_0xad08('0x9a')](_0x291bfc,_0x291bfc['linkedid'],_0x291bfc['cause']);}else if(this['actions'][_0x291bfc[_0xad08('0xac')]]['dialAnswer']){logger[_0xad08('0x53')](_0xad08('0x155'),_0x291bfc[_0xad08('0xac')],_0x291bfc[_0xad08('0x156')],_0xad08('0xb4'),_0x3171ab[_0xad08('0x26')],_0xad08('0x6d'),_0x3171ab[_0xad08('0x59')]);this[_0xad08('0x9a')](_0x291bfc,_0x291bfc[_0xad08('0xac')],_0x291bfc['cause']);}}else if(_0x114e89&&_[_0xad08('0x6a')](_0x114e89[_0xad08('0x157')])&&_0x3171ab[_0xad08('0x158')]&&_0x291bfc['linkedid']===_0x291bfc['uniqueid']&&_['isNil'](_0x291bfc[_0xad08('0x106')])&&_0x291bfc[_0xad08('0x156')]==='16'&&_0x291bfc[_0xad08('0x159')]==='6'&&_[_0xad08('0xfb')](_0x114e89['transfer'])){if(_0x114e89['unlockAgent']){rpcDb[_0xad08('0x121')](_0x114e89[_0xad08('0xad')]);}if(_0x114e89[_0xad08('0xd0')]){rpcDb[_0xad08('0x88')](_0x114e89[_0xad08('0xad')]);}_0x291bfc[_0xad08('0x106')]='22';this['callProgressDetectingAgent'](_0x114e89,_0x3171ab,_0x291bfc);}else if(_0x114e89&&_0x114e89[_0xad08('0x15a')]){if(_0x291bfc[_0xad08('0x156')]==='16'&&this['actions'][_0x291bfc['linkedid']][_0xad08('0x6f')]){logger[_0xad08('0x53')](_0xad08('0x15b'),_0x291bfc['linkedid'],_0x291bfc[_0xad08('0x156')],_0xad08('0xb4'),_0x3171ab[_0xad08('0x26')],_0xad08('0x6d'),_0x3171ab[_0xad08('0x59')]);this[_0xad08('0x9a')](_0x291bfc,_0x291bfc[_0xad08('0xac')],_0x291bfc['cause']);}else if(this['actions'][_0x291bfc[_0xad08('0xac')]]['dialAnswer']){logger[_0xad08('0x53')](_0xad08('0x155'),_0x291bfc['linkedid'],_0x291bfc[_0xad08('0x156')],_0xad08('0xb4'),_0x3171ab[_0xad08('0x26')],_0xad08('0x6d'),_0x3171ab['pTalking']);this[_0xad08('0x9a')](_0x291bfc,_0x291bfc[_0xad08('0xac')],_0x291bfc['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x56dae5){if(this[_0xad08('0x6b')][_0x56dae5[_0xad08('0xfa')]]&&_0x56dae5[_0xad08('0xfa')]!==_0x56dae5[_0xad08('0x15c')]){this['callProgressDetectingCustomer'](_0x56dae5,_0x56dae5[_0xad08('0xfa')],_0x56dae5['dialstatus']);}};Preview[_0xad08('0x62')][_0xad08('0x1a')]=function(_0x226a34){if(this[_0xad08('0x6b')][_0x226a34[_0xad08('0xac')]]&&_0x226a34[_0xad08('0xac')]!==_0x226a34[_0xad08('0xc6')]&&!this[_0xad08('0x6b')][_0x226a34['linkedid']][_0xad08('0x6f')]){if(_0x226a34[_0xad08('0x156')]==='1'){this[_0xad08('0x9a')](_0x226a34,_0x226a34[_0xad08('0xac')],_0x226a34[_0xad08('0x156')]);}}};Preview[_0xad08('0x62')]['addVariable']=function(_0x215b30,_0x22f5d8,_0x16f9cb){if(this[_0xad08('0x6b')][_0x215b30]){if(_[_0xad08('0x6a')](this[_0xad08('0x6b')][_0x215b30][_0xad08('0x15d')])){this[_0xad08('0x6b')][_0x215b30][_0xad08('0x15d')]={};}this[_0xad08('0x6b')][_0x215b30][_0xad08('0x15d')][_0x22f5d8]=_0x16f9cb;}};Preview[_0xad08('0x62')][_0xad08('0x1f')]=function(_0x4baa41){try{if(!_[_0xad08('0x6a')](_0x4baa41)){if(ut[_0xad08('0x15e')](_[_0xad08('0x15f')](_0x4baa41['variable'])[0x0])){this[_0xad08('0x160')](_0x4baa41[_0xad08('0xc6')],_[_0xad08('0x15f')](_0x4baa41[_0xad08('0x161')])[0x0],_0x4baa41['value']);}}}catch(_0x3ee11a){logger[_0xad08('0x162')](_0xad08('0x163'),util[_0xad08('0x164')](_0x3ee11a,{'showHidden':![],'depth':null}));}};Preview[_0xad08('0x62')][_0xad08('0x165')]=function(_0xb446e9){if(_0xb446e9){if(this[_0xad08('0x6b')][_0xb446e9['transfertargetlinkedid']]){this[_0xad08('0x6b')][_0xb446e9[_0xad08('0x166')]]['transfer']=!![];}}};Preview[_0xad08('0x62')][_0xad08('0x21')]=function(_0x2f8897){if(_0x2f8897){if(this[_0xad08('0x6b')][_0x2f8897[_0xad08('0x167')]]){this[_0xad08('0x6b')][_0x2f8897[_0xad08('0x167')]][_0xad08('0x15a')]=!![];}}};module[_0xad08('0x168')]=Preview;
\ No newline at end of file
+var _0xde4f=['uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','swapAdditionalPhones','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','pick','unlock','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','phone','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','channelAgent','user:%s','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','response','unlockContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','destlinkedid','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../rpc/cmHopperAdditionalPhone','./util/util','redis','localhost','tail','campaignsPreview','trunks','actions','clockClearZombieChannels','originateresponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','agents','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','emit','custom:agentnosuchnumber','buildObj','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','responsetime','answertime','[syncHangup][talking][increment]'];(function(_0xf6a6fc,_0x54e5fb){var _0x10a0af=function(_0x2f88b3){while(--_0x2f88b3){_0xf6a6fc['push'](_0xf6a6fc['shift']());}};_0x10a0af(++_0x54e5fb);}(_0xde4f,0xa7));var _0xfde4=function(_0x247895,_0x534a3c){_0x247895=_0x247895-0x0;var _0x3dbe4c=_0xde4f[_0x247895];return _0x3dbe4c;};'use strict';var util=require(_0xfde4('0x0'));var _=require(_0xfde4('0x1'));var BPromise=require(_0xfde4('0x2'));var uuid=require('uuid');var moment=require(_0xfde4('0x3'));var md5=require(_0xfde4('0x4'));var Redis=require(_0xfde4('0x5'));var config=require(_0xfde4('0x6'));var logger=require(_0xfde4('0x7'))(_0xfde4('0x8'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xfde4('0x9'));var Action=require('./action');var ut=require(_0xfde4('0xa'));config[_0xfde4('0xb')]=_['defaults'](config['redis'],{'host':_0xfde4('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfde4('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x23f99f){this[_0xfde4('0xd')]=this['tail']?this['tail']['finally'](_0x23f99f):_0x23f99f();};function Preview(_0x35d1f9){this['sequence']=new Sequence();this[_0xfde4('0xe')]=_0x35d1f9['voiceQueues'];this['trunks']=_0x35d1f9[_0xfde4('0xf')];this[_0xfde4('0x10')]={};this['agents']=_0x35d1f9['agents'];this[_0xfde4('0x11')]=0x0;ami['on'](_0xfde4('0x12'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xfde4('0x13'),this[_0xfde4('0x14')][_0xfde4('0x15')](this));ami['on'](_0xfde4('0x16'),this[_0xfde4('0x17')][_0xfde4('0x15')](this));ami['on']('dialend',this[_0xfde4('0x18')][_0xfde4('0x15')](this));ami['on'](_0xfde4('0x19'),this[_0xfde4('0x1a')][_0xfde4('0x15')](this));ami['on']('varset',this[_0xfde4('0x1b')][_0xfde4('0x15')](this));ami['on'](_0xfde4('0x1c'),this[_0xfde4('0x1d')][_0xfde4('0x15')](this));ami['on'](_0xfde4('0x1e'),this[_0xfde4('0x1f')]['bind'](this));this[_0xfde4('0x20')](this[_0xfde4('0xe')]);}function emit(_0xd0b838,_0x388094,_0x5b4797){io['to'](_0xd0b838)['emit'](_0x388094,_0x5b4797);}function emitCampaignPreview(_0x17a400){if(_0x17a400[_0xfde4('0x21')]===_0xfde4('0x22')){var _0x9c579d={'id':_0x17a400['id'],'name':_0x17a400[_0xfde4('0x23')],'strategy':_0x17a400[_0xfde4('0x24')],'answered':_0x17a400[_0xfde4('0x25')],'available':_0x17a400[_0xfde4('0x26')],'loggedIn':_0x17a400[_0xfde4('0x27')],'pTalking':_0x17a400['pTalking'],'sumBillable':_0x17a400[_0xfde4('0x28')],'sumDuration':_0x17a400['sumDuration'],'sumHoldTime':_0x17a400[_0xfde4('0x29')]||0x0,'talking':_0x17a400[_0xfde4('0x2a')],'total':_0x17a400['total'],'type':_0x17a400[_0xfde4('0x21')],'unmanaged':_0x17a400[_0xfde4('0x2b')],'abandoned':_0x17a400[_0xfde4('0x2c')],'waiting':_0x17a400[_0xfde4('0x2d')],'loggedInDb':_0x17a400[_0xfde4('0x2e')],'dialActive':_0x17a400[_0xfde4('0x2f')],'dialMethod':_0x17a400[_0xfde4('0x30')],'dialOriginateCallerIdName':_0x17a400[_0xfde4('0x31')],'dialOriginateCallerIdNumber':_0x17a400[_0xfde4('0x32')],'dialOriginateTimeout':_0x17a400['dialOriginateTimeout'],'dialPrefix':_0x17a400[_0xfde4('0x33')],'outboundAnswerAgiCallsDay':_0x17a400[_0xfde4('0x34')],'outboundAnswerCallsDay':_0x17a400[_0xfde4('0x35')],'outboundBlacklistCallsDay':_0x17a400['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x17a400[_0xfde4('0x36')],'outboundCongestionCallsDay':_0x17a400['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x17a400[_0xfde4('0x37')],'outboundDropCallsDayCallersExit':_0x17a400['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x17a400[_0xfde4('0x38')],'outboundNoAnswerCallsDay':_0x17a400[_0xfde4('0x39')],'outboundNoSuchCallsDay':_0x17a400[_0xfde4('0x3a')],'outboundOriginateFailureCallsDay':_0x17a400[_0xfde4('0x3b')],'outboundReCallsDay':_0x17a400[_0xfde4('0x3c')],'outboundRejectCallsDay':_0x17a400[_0xfde4('0x3d')],'outboundUnknownCallsDay':_0x17a400['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x17a400[_0xfde4('0x3e')],'predictiveIntervalAnsweredCalls':_0x17a400[_0xfde4('0x3f')],'predictiveIntervalAvgHoldtime':_0x17a400[_0xfde4('0x40')],'predictiveIntervalAvgTalktime':_0x17a400[_0xfde4('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x17a400[_0xfde4('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x17a400['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x17a400[_0xfde4('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x17a400[_0xfde4('0x44')],'predictiveIntervalHitRate':_0x17a400[_0xfde4('0x45')],'predictiveIntervalMultiplicativeFactor':_0x17a400[_0xfde4('0x46')],'predictiveIntervalPauses':_0x17a400[_0xfde4('0x47')],'predictiveIntervalAvailable':_0x17a400[_0xfde4('0x48')],'predictiveIntervalTotalCalls':_0x17a400['predictiveIntervalTotalCalls'],'message':_0x17a400[_0xfde4('0x49')],'originated':_0x17a400[_0xfde4('0x4a')],'erlangCalls':_0x17a400[_0xfde4('0x4b')],'erlangCallToSecond':_0x17a400[_0xfde4('0x4c')],'erlangAbandonmentRate':_0x17a400[_0xfde4('0x4d')],'erlangBusyFactor':_0x17a400['erlangBusyFactor'],'startPredictive':_0x17a400[_0xfde4('0x4e')],'startProgressive':_0x17a400[_0xfde4('0x4f')]};if(_0x17a400[_0xfde4('0x50')]){_0x9c579d[_0xfde4('0x50')]={'id':_0x17a400[_0xfde4('0x50')]['id'],'name':_0x17a400['Trunk'][_0xfde4('0x23')],'active':_0x17a400['Trunk'][_0xfde4('0x51')],'callerid':_0x17a400['Trunk']['callerid']};}if(_0x17a400[_0xfde4('0x52')]){_0x9c579d[_0xfde4('0x52')]={'id':_0x17a400[_0xfde4('0x52')]['id'],'name':_0x17a400[_0xfde4('0x52')][_0xfde4('0x23')]};}var _0x1656a5=md5(JSON[_0xfde4('0x53')](_0x9c579d));if(_0x17a400[_0xfde4('0x4')]!==_0x1656a5){_0x17a400[_0xfde4('0x4')]=_0x1656a5;emit(util[_0xfde4('0x54')]('voice:queue:%s',_0x9c579d[_0xfde4('0x23')]),_0xfde4('0x55'),_0x9c579d);}}}function emitVoiceQueueChannelRemove(_0x7e2f86){logger[_0xfde4('0x56')](_0xfde4('0x57'),JSON[_0xfde4('0x53')](_0x7e2f86));emit(util[_0xfde4('0x54')](_0xfde4('0x58'),_0x7e2f86['name']),_0xfde4('0x59'),_0x7e2f86);io['emit'](_0xfde4('0x5a'),_0x7e2f86);}function notSendMessagesQueue(_0x9a190){if(_0x9a190[_0xfde4('0x5b')]){if(_0x9a190[_0xfde4('0x4a')]===0x0&&_0x9a190[_0xfde4('0x5c')]===0x0){_0x9a190[_0xfde4('0x5b')]=![];_0x9a190['available']=0x0;_0x9a190[_0xfde4('0x5d')]=0x0;_0x9a190[_0xfde4('0x49')]='NOT_ACTIVE';ut[_0xfde4('0x5e')](_0xfde4('0x5f'),_0x9a190[_0xfde4('0x23')]+_0xfde4('0x60'));}else{_0x9a190[_0xfde4('0x49')]=_0xfde4('0x61');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x9a190[_0xfde4('0x23')]+_0xfde4('0x62'));}emitCampaignPreview(_0x9a190);}}Preview[_0xfde4('0x63')][_0xfde4('0x20')]=function(){var _0x2d47ce=this;setInterval(function(){_0x2d47ce[_0xfde4('0x64')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x5ab15d=this[_0xfde4('0xe')];this[_0xfde4('0x11')]+=0x1;for(var _0x41d591 in _0x5ab15d){if(_0x5ab15d['hasOwnProperty'](_0x41d591)&&(_0x5ab15d[_0x41d591]['dialMethod']===_0xfde4('0x8')||_0x5ab15d[_0x41d591][_0xfde4('0x30')]===_0xfde4('0x65'))&&_0x5ab15d[_0x41d591][_0xfde4('0x21')]==='outbound'){if(this[_0xfde4('0x11')]>0x7){this[_0xfde4('0x11')]=0x0;this[_0xfde4('0x66')]();}}if(_0x5ab15d[_0xfde4('0x67')](_0x41d591)&&_0x5ab15d[_0x41d591]['dialMethod']===_0xfde4('0x8')&&_0x5ab15d[_0x41d591][_0xfde4('0x21')]==='outbound'){if(_0x5ab15d[_0x41d591]['dialActive']){this[_0xfde4('0x68')](_0x5ab15d[_0x41d591]);this[_0xfde4('0x69')](_0x5ab15d[_0x41d591]);}else{notSendMessagesQueue(_0x5ab15d[_0x41d591]);}}}};Preview[_0xfde4('0x63')][_0xfde4('0x6a')]=function(_0x245bb7){var _0x314391=this;this[_0xfde4('0x6b')]['enqueue'](function(){if(!_[_0xfde4('0x6c')](_0x314391[_0xfde4('0x10')][_0x245bb7])){loggerAction['info'](_0xfde4('0x6d'),_0x245bb7,_0xfde4('0x6e'),_0x314391[_0xfde4('0x10')][_0x245bb7][_0xfde4('0x6f')],_0xfde4('0x70'),JSON[_0xfde4('0x53')](_0x314391['campaignsPreview'][_0x314391[_0xfde4('0x10')][_0x245bb7]['queue']][_0xfde4('0x4a')]),_0xfde4('0x71'),JSON[_0xfde4('0x53')](_0x314391[_0xfde4('0xe')][_0x314391[_0xfde4('0x10')][_0x245bb7][_0xfde4('0x6f')]][_0xfde4('0x5c')]),JSON['stringify'](_0x314391[_0xfde4('0x10')][_0x245bb7]['dialAnswer']),JSON[_0xfde4('0x53')](_['pick'](_0x314391['actions'][_0x245bb7],[_0xfde4('0x72'),_0xfde4('0x73'),_0xfde4('0x74'),_0xfde4('0x75')])));return ami[_0xfde4('0x76')]({'action':_0xfde4('0x77'),'channel':_0x314391['actions'][_0x245bb7][_0xfde4('0x78')]})[_0xfde4('0x79')](function(_0x1a0847){if(_0x1a0847[_0xfde4('0x49')]===_0xfde4('0x7a')){setTimeout(function(){if(_0x314391[_0xfde4('0x10')][_0x245bb7]){ut['updateOriginated'](_0x314391[_0xfde4('0xe')][_0x314391[_0xfde4('0x10')][_0x245bb7][_0xfde4('0x6f')]],_0xfde4('0x7b'));if(_0x314391['actions'][_0x245bb7][_0xfde4('0x7c')]===!![]){ut['decrementTalkink'](_0x314391[_0xfde4('0xe')][_0x314391[_0xfde4('0x10')][_0x245bb7][_0xfde4('0x6f')]],_0xfde4('0x7b'));ut[_0xfde4('0x7d')](_0xfde4('0x7e')+_0x245bb7,_0x314391[_0xfde4('0x10')][_0x245bb7]['queue']);}ut[_0xfde4('0x7d')](_0xfde4('0x7f')+_0x245bb7,_0x314391[_0xfde4('0x10')][_0x245bb7][_0xfde4('0x6f')]);delete _0x314391[_0xfde4('0x10')][_0x245bb7];}},0x2328);}});}});};Preview[_0xfde4('0x63')]['clearZombieChannels']=function(){var _0x3b29b2=this;loggerAction[_0xfde4('0x56')](_0xfde4('0x80'),_[_0xfde4('0x81')](this[_0xfde4('0x10')]));for(var _0x3a313f in this[_0xfde4('0x10')]){if(_0x3b29b2[_0xfde4('0x10')]['hasOwnProperty'](_0x3a313f)){_0x3b29b2[_0xfde4('0x6a')](_0x3a313f);}}};Preview[_0xfde4('0x63')]['recallMe']=function(_0x5c5bf7){var _0x41c8aa=this;rpcDb[_0xfde4('0x82')](_0x5c5bf7['id'],ut[_0xfde4('0x83')](this[_0xfde4('0x84')]))[_0xfde4('0x85')](function(_0xc0909c){if(!_[_0xfde4('0x6c')](_0xc0909c)){for(var _0x380e6f=0x0;_0x380e6f<_0xc0909c[_0xfde4('0x86')];_0x380e6f+=0x1){if(ut[_0xfde4('0x87')](_0xc0909c[_0x380e6f][_0xfde4('0x88')])<_0x5c5bf7[_0xfde4('0x89')]*0x3c){if(_0xc0909c[_0x380e6f][_0xfde4('0x8a')]&&!_0xc0909c[_0x380e6f][_0xfde4('0x8a')][_0xfde4('0x8b')]){_0x41c8aa[_0xfde4('0x8c')](_0xc0909c[_0x380e6f]['id'])[_0xfde4('0x85')](ut[_0xfde4('0x8d')](_0xfde4('0x8e')))[_0xfde4('0x79')](ut[_0xfde4('0x8d')]('[RecallMe]'));}else{rpcDb[_0xfde4('0x8f')](_0xc0909c[_0x380e6f]['id']);}}else{var _0x39c0de=new Action(_0xc0909c[_0x380e6f],_0x5c5bf7);_0x39c0de[_0xfde4('0x90')]=moment()[_0xfde4('0x54')](_0xfde4('0x91'));_0x5c5bf7[_0xfde4('0x3c')]+=0x1;ut[_0xfde4('0x92')](_0x39c0de,0x17,_0xfde4('0x93'));if(_0x5c5bf7[_0xfde4('0x94')]){rpcDb['rescheduleContactInQueue'](ut[_0xfde4('0x95')](_0xc0909c[_0x380e6f]));rpcDb['createCustomerHistory'](_0x39c0de,_0xfde4('0x96'));}else{ut[_0xfde4('0x92')](_0x39c0de,0x16,_0xfde4('0x97'));rpcDb['createCustomerHistory'](_0x39c0de,_0xfde4('0x98'));rpcDb[_0xfde4('0x99')](_0x39c0de,_0xfde4('0x98'));}}}}})[_0xfde4('0x79')](ut[_0xfde4('0x8d')]('[getContactRecallMe]'));};Preview[_0xfde4('0x63')]['setMessage']=function(_0x458f30){_0x458f30[_0xfde4('0x5b')]=!![];if(ut[_0xfde4('0x9a')](_0x458f30[_0xfde4('0x27')])){_0x458f30['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xfde4('0x9b')](_0x458f30['dialActive'])){_0x458f30[_0xfde4('0x49')]=_0xfde4('0x9c');}else if(!this[_0xfde4('0x9d')](_0x458f30[_0xfde4('0x50')])){if(!this[_0xfde4('0x9d')](_0x458f30[_0xfde4('0x9e')])){_0x458f30[_0xfde4('0x49')]=_0xfde4('0x9f');}else{_0x458f30[_0xfde4('0x49')]=_0xfde4('0xa0');}}else{_0x458f30[_0xfde4('0x49')]=_0xfde4('0xa0');}emitCampaignPreview(_0x458f30);};Preview[_0xfde4('0x63')][_0xfde4('0xa1')]=function(_0x28b2be,_0x506506,_0xb1def3){var _0x35f1f5=this;var _0x1cad5a=this[_0xfde4('0x10')][_0x506506];var _0x2a888f=this[_0xfde4('0xe')][_0x1cad5a[_0xfde4('0x6f')]];var _0x1e9da7;var _0x54a3ee=![];var _0x241cb2=0x2;var _0x9f9b88=0x3;if(_0x2a888f){switch(_0xb1def3){case'1':_0x2a888f[_0xfde4('0x3a')]+=0x1;_0x1cad5a[_0xfde4('0xa2')]+=0x1;_0x1cad5a['countglobal']=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x0,'NoSuchNumber');ami[_0xfde4('0xa4')](_0xfde4('0xa5'),ut[_0xfde4('0xa6')](_0x1cad5a,'nosuchnumber'));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xa8'));_0x35f1f5['verifyAdditionalPhones'](_0x1cad5a,'0',_0x2a888f)['then'](function(_0x461432){_0x54a3ee=_0x461432[_0xfde4('0xa9')]==0x1;_0x241cb2=_0x2a888f[_0xfde4('0xaa')];_0x9f9b88=_0x2a888f[_0xfde4('0xab')];if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut[_0xfde4('0xad')](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,_0xfde4('0xaf'));}else{if(_0x1cad5a[_0xfde4('0xa2')]>=_0x2a888f[_0xfde4('0xb0')]){rpcDb[_0xfde4('0x99')](_0x1cad5a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1cad5a,_0xfde4('0xa2'),_0x2a888f[_0xfde4('0xaa')]),_0x1cad5a[_0xfde4('0xb1')],_0x1cad5a[_0xfde4('0xb2')]);}}delete this[_0xfde4('0x10')][_0x28b2be[_0xfde4('0xb3')]];}else{_0x1cad5a[_0xfde4('0xa2')]++;logger['info'](_0xfde4('0xb4'),_0x1cad5a[_0xfde4('0xa2')]);logger['info']('id',_0x1cad5a[_0xfde4('0xb5')]);_0x35f1f5[_0xfde4('0xb6')]({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countnosuchnumberretry':_0x1cad5a['countnosuchnumberretry']}})[_0xfde4('0x85')](function(){_0x35f1f5['swapAdditionalPhones'](_0x1cad5a,_0x241cb2,_0x9f9b88)['then'](function(){});});}});break;case'ANSWER':var _0x486f04=moment()[_0xfde4('0x54')](_0xfde4('0x91'));_0x1cad5a[_0xfde4('0xb7')]=_0x486f04;_0x1cad5a[_0xfde4('0xb8')]=_0x486f04;_0x1cad5a[_0xfde4('0x7c')]=!![];_0x2a888f['pTalking']+=0x1;logger['info'](_0xfde4('0xb9'),_0x1cad5a[_0xfde4('0xba')],_0xfde4('0xbb'),_0x2a888f[_0xfde4('0x23')],_0xfde4('0x71'),_0x2a888f['pTalking']);ami[_0xfde4('0xa4')](_0xfde4('0xbc'),ut['buildObj'](_0x1cad5a,'connect',this[_0xfde4('0xe')][_0x1cad5a[_0xfde4('0x6f')]]));if(_0x2a888f[_0xfde4('0xbd')]){ami['emit'](_0xfde4('0xbe'),ut[_0xfde4('0xbf')](_0x1cad5a));}break;case'16':ami[_0xfde4('0xa4')](_0xfde4('0xc0'),ut[_0xfde4('0xa6')](_0x1cad5a,_0xfde4('0xc1'),this[_0xfde4('0xe')][_0x1cad5a[_0xfde4('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0xfde4('0xa6')](_0x1cad5a,_0xfde4('0xc1')));_0x2a888f['outboundAnswerCallsDay']+=0x1;_0x2a888f[_0xfde4('0xc2')]+=0x1;_0x2a888f[_0xfde4('0x25')]+=0x1;ut[_0xfde4('0xc3')](_0x2a888f,_0xfde4('0xc4'));_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x4,_0xfde4('0xc6'));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xc7'));rpcDb['createCustomerFinal'](_0x1cad5a,_0xfde4('0xc8'));rpcDb[_0xfde4('0xc9')](_0x1cad5a);_0x2a888f[_0xfde4('0xca')]+=_0x1cad5a[_0xfde4('0xcb')];_0x2a888f[_0xfde4('0x28')]+=_0x1cad5a[_0xfde4('0xcb')];logger[_0xfde4('0x56')](_0xfde4('0xcc'),_0x1cad5a['uniqueid'],'\x20Queue',_0x2a888f[_0xfde4('0x23')],_0xfde4('0x71'),_0x2a888f[_0xfde4('0x5c')]);delete this[_0xfde4('0x10')][_0x28b2be[_0xfde4('0xb3')]];break;case _0xfde4('0xcd'):_0x2a888f[_0xfde4('0x36')]+=0x1;_0x1cad5a[_0xfde4('0xce')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x5,_0xfde4('0xcf'));_0x241cb2=_0x2a888f[_0xfde4('0xd0')];_0x9f9b88=_0x2a888f[_0xfde4('0xab')];ami[_0xfde4('0xa4')](_0xfde4('0xd1'),ut[_0xfde4('0xa6')](_0x1cad5a,'busy'));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xd2'));_0x35f1f5[_0xfde4('0xd3')](_0x1cad5a,'5',_0x2a888f)['then'](function(_0xeaea6d){_0x54a3ee=_0xeaea6d[_0xfde4('0xa9')]==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut[_0xfde4('0xad')](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb['createCustomerFinal'](_0x1e9da7,_0xfde4('0xd4'));}else{if(_0x1cad5a[_0xfde4('0xce')]>=_0x2a888f[_0xfde4('0xd5')]){rpcDb[_0xfde4('0x99')](_0x1cad5a,_0xfde4('0xd2'));}else{rpcDb[_0xfde4('0xd6')](ut['scheduledAt'](_0x1cad5a,'countbusyretry',_0x2a888f[_0xfde4('0xd0')]),_0x1cad5a['unlockAgent'],_0x1cad5a[_0xfde4('0xb2')]);}}}else{_0x1cad5a[_0xfde4('0xce')]++;_0x35f1f5[_0xfde4('0xb6')]({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countbusyretry':_0x1cad5a[_0xfde4('0xce')]}})[_0xfde4('0x85')](function(){_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});break;case'NOANSWER':_0x2a888f['outboundNoAnswerCallsDay']+=0x1;_0x1cad5a[_0xfde4('0xd8')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut['totalGlobal'](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x3,_0xfde4('0xd9'));_0x241cb2=_0x2a888f['dialNoAnswerRetryFrequency'];_0x9f9b88=_0x2a888f[_0xfde4('0xab')];ami[_0xfde4('0xa4')](_0xfde4('0xda'),ut[_0xfde4('0xa6')](_0x1cad5a,'noanswer'));rpcDb['createCustomerHistory'](_0x1cad5a,_0xfde4('0xdb'));_0x35f1f5['verifyAdditionalPhones'](_0x1cad5a,'3',_0x2a888f)[_0xfde4('0x85')](function(_0x1248e1){_0x54a3ee=_0x1248e1[_0xfde4('0xa9')]==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut['cloneAction'](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x1cad5a[_0xfde4('0xd8')]>=_0x2a888f[_0xfde4('0xdc')]){rpcDb[_0xfde4('0x99')](_0x1cad5a,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xfde4('0xd6')](ut[_0xfde4('0xdd')](_0x1cad5a,_0xfde4('0xd8'),_0x2a888f[_0xfde4('0xde')]),_0x1cad5a[_0xfde4('0xb1')],_0x1cad5a[_0xfde4('0xb2')]);}}}else{_0x1cad5a[_0xfde4('0xd8')]++;_0x35f1f5[_0xfde4('0xb6')]({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countnoanswerretry':_0x1cad5a[_0xfde4('0xd8')]}})[_0xfde4('0x85')](function(){_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});break;case _0xfde4('0xdf'):_0x2a888f[_0xfde4('0xe0')]+=0x1;_0x1cad5a[_0xfde4('0xe1')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut['logCustomer'](_0x1cad5a,0x8,'Congestion');_0x241cb2=_0x2a888f['dialCongestionRetryFrequency'];_0x9f9b88=_0x2a888f[_0xfde4('0xab')];ami[_0xfde4('0xa4')]('custom:agentcongestion',ut['buildObj'](_0x1cad5a,'congestion'));rpcDb[_0xfde4('0xa7')](_0x1cad5a,'[callProgressDetectingCustomer][logCongestion]');_0x35f1f5[_0xfde4('0xd3')](_0x1cad5a,'8',_0x2a888f)['then'](function(_0x11ada1){_0x54a3ee=_0x11ada1[_0xfde4('0xa9')]==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f['dialGlobalMaxRetry']){_0x1e9da7=ut['cloneAction'](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb['createCustomerFinal'](_0x1e9da7,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1cad5a[_0xfde4('0xe1')]>=_0x2a888f[_0xfde4('0xe2')]){rpcDb[_0xfde4('0x99')](_0x1cad5a,_0xfde4('0xe3'));}else{rpcDb[_0xfde4('0xd6')](ut[_0xfde4('0xdd')](_0x1cad5a,_0xfde4('0xe1'),_0x2a888f['dialBusyRetryFrequency']),_0x1cad5a[_0xfde4('0xb1')],_0x1cad5a[_0xfde4('0xb2')]);}}}else{_0x1cad5a[_0xfde4('0xe1')]++;_0x35f1f5['incrementPreviewCounters']({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countcongestionretry':_0x1cad5a[_0xfde4('0xe1')]}})[_0xfde4('0x85')](function(){_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});break;case _0xfde4('0xe4'):_0x2a888f[_0xfde4('0x3d')]+=0x1;_0x1cad5a['countagentrejectretry']+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut['totalGlobal'](_0x1cad5a);ut['logCustomer'](_0x1cad5a,0x14,_0xfde4('0xe5'));_0x241cb2=_0x2a888f[_0xfde4('0xe6')];_0x9f9b88=_0x2a888f[_0xfde4('0xab')];ami['emit'](_0xfde4('0xe7'),ut['buildObj'](_0x1cad5a,_0xfde4('0xe8')));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xe9'));_0x35f1f5['verifyAdditionalPhones'](_0x1cad5a,'20',_0x2a888f)[_0xfde4('0x85')](function(_0x59f214){_0x54a3ee=_0x59f214['additional']==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f['dialGlobalMaxRetry']){_0x1e9da7=ut[_0xfde4('0xad')](_0x1cad5a,0x14,_0xfde4('0xe5'));rpcDb['createCustomerFinal'](_0x1e9da7,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1cad5a['countagentrejectretry']>=_0x2a888f[_0xfde4('0xea')]){rpcDb['createCustomerFinal'](_0x1cad5a,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xfde4('0xdd')](_0x1cad5a,_0xfde4('0xeb'),_0x2a888f[_0xfde4('0xe6')]),_0x1cad5a['unlockAgent'],_0x1cad5a[_0xfde4('0xb2')]);}}}else{_0x1cad5a['countnoanswerretry']++;_0x35f1f5['incrementPreviewCounters']({'id':_0x1cad5a['idContact'],'field':{'countnoanswerretry':_0x1cad5a[_0xfde4('0xd8')]}})[_0xfde4('0x85')](function(){_0x35f1f5['swapAdditionalPhones'](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});break;case _0xfde4('0xec'):_0x2a888f[_0xfde4('0x3e')]+=0x1;_0x1cad5a[_0xfde4('0xed')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0xb,_0xfde4('0xee'));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xef'));_0x35f1f5[_0xfde4('0xd3')](_0x1cad5a,'11',_0x2a888f)[_0xfde4('0x85')](function(_0x4e3149){_0x54a3ee=_0x4e3149[_0xfde4('0xa9')]==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut[_0xfde4('0xad')](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,_0xfde4('0xef'));}else{if(_0x1cad5a[_0xfde4('0xf0')]>=_0x2a888f[_0xfde4('0xf1')]){rpcDb[_0xfde4('0x99')](_0x1cad5a,_0xfde4('0xef'));}else{rpcDb['rescheduleContact'](ut[_0xfde4('0xdd')](_0x1cad5a,_0xfde4('0xed'),_0x2a888f[_0xfde4('0xf2')]),_0x1cad5a[_0xfde4('0xb1')],_0x1cad5a[_0xfde4('0xb2')]);}}}else{_0x1cad5a[_0xfde4('0xd8')]++;_0x35f1f5[_0xfde4('0xb6')]({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countnoanswerretry':_0x1cad5a[_0xfde4('0xd8')]}})[_0xfde4('0x85')](function(){_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});break;case'18':_0x2a888f['outboundUnknownCallsDay']+=0x1;_0x1cad5a[_0xfde4('0xf3')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x12,_0x28b2be['cause-txt']||_0x28b2be[_0xfde4('0xf4')]);ami[_0xfde4('0xa4')](_0xfde4('0xf5'),ut[_0xfde4('0xa6')](_0x1cad5a,_0xfde4('0xf6')));rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xf7'));_0x35f1f5[_0xfde4('0xd3')](_0x1cad5a,'18',_0x2a888f)[_0xfde4('0x85')](function(_0x5977f4){_0x54a3ee=_0x5977f4['additional']==0x1;if(!_0x54a3ee){if(ut['totalGlobal'](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut[_0xfde4('0xad')](_0x1cad5a,0x12,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,_0xfde4('0xf7'));}else{rpcDb[_0xfde4('0x99')](_0x1cad5a,_0xfde4('0xf7'));}}else{_0x1cad5a['countnoanswerretry']++;_0x35f1f5[_0xfde4('0xb6')]({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countnoanswerretry':_0x1cad5a[_0xfde4('0xd8')]}})[_0xfde4('0x85')](function(){_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});delete this['actions'][_0x28b2be[_0xfde4('0xb3')]];break;case'19':_0x2a888f[_0xfde4('0xf8')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0x13,_0x28b2be[_0xfde4('0xf9')]||_0x28b2be[_0xfde4('0xf4')]);ami[_0xfde4('0xa4')]('custom:amd',ut[_0xfde4('0xa6')](_0x1cad5a,_0xfde4('0xf6')));rpcDb[_0xfde4('0xa7')](_0x1cad5a,'[callProgressDetectingCustomer][machine]');_0x35f1f5[_0xfde4('0xd3')](_0x1cad5a,'18',_0x2a888f)[_0xfde4('0x85')](function(_0x3f3eb1){_0x54a3ee=_0x3f3eb1[_0xfde4('0xa9')]==0x1;if(!_0x54a3ee){if(ut[_0xfde4('0xa3')](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut['cloneAction'](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xfde4('0x99')](_0x1cad5a,_0xfde4('0xfa'));}}else{_0x1cad5a[_0xfde4('0xd8')]++;_0x35f1f5['incrementPreviewCounters']({'id':_0x1cad5a[_0xfde4('0xb5')],'field':{'countnoanswerretry':_0x1cad5a['countnoanswerretry']}})['then'](function(){_0x35f1f5['swapAdditionalPhones'](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(){});});}});delete this[_0xfde4('0x10')][_0x28b2be[_0xfde4('0xb3')]];break;default:if(_0x1cad5a[_0xfde4('0x7c')]){ut[_0xfde4('0xc3')](_0x2a888f,_0xfde4('0xfb'));ut[_0xfde4('0x7d')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x2a888f[_0xfde4('0x23')],_0x28b2be);}_0x2a888f[_0xfde4('0xf8')]+=0x1;_0x1cad5a[_0xfde4('0xc5')]=ut[_0xfde4('0xa3')](_0x1cad5a);ut[_0xfde4('0x92')](_0x1cad5a,0xc,_0x28b2be[_0xfde4('0xf9')]||_0x28b2be[_0xfde4('0xf4')]);_0x241cb2=_0x2a888f[_0xfde4('0xe6')];_0x9f9b88=_0x2a888f['callAdditionalPhoneAfterMin'];rpcDb[_0xfde4('0xa7')](_0x1cad5a,_0xfde4('0xfc'));_0x35f1f5['verifyAdditionalPhones'](_0x1cad5a,'20',_0x2a888f)[_0xfde4('0x85')](function(_0x358a53){_0x54a3ee=_0x358a53['additional']==0x1;if(!_0x54a3ee){if(ut['totalGlobal'](_0x1cad5a)>=_0x2a888f[_0xfde4('0xac')]){_0x1e9da7=ut['cloneAction'](_0x1cad5a,0xf,_0xfde4('0xae'));rpcDb[_0xfde4('0x99')](_0x1e9da7,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xfde4('0x99')](_0x1cad5a,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x28b2be[_0xfde4('0xb3')]];}else{_0x35f1f5[_0xfde4('0xd7')](_0x1cad5a,_0x241cb2,_0x9f9b88)[_0xfde4('0x85')](function(_0x1a2b68){});}});}if(!(_0x1cad5a[_0xfde4('0x7c')]&&_0xb1def3==='16')){ut['updateOriginated'](_0x2a888f,'[callProgressDetectingCustomer]');logger[_0xfde4('0x56')](_0xfde4('0xfd'),_0x1cad5a['uniqueid'],_0xfde4('0xbb'),_0x2a888f[_0xfde4('0x23')],_0xfde4('0x70'),_0x2a888f['originated']);}if(_0xb1def3!==_0xfde4('0xfe')){delete this[_0xfde4('0x10')][_0x28b2be['linkedid']];delete this[_0xfde4('0x10')][_0x28b2be['destlinkedid']];}}};Preview[_0xfde4('0x63')]['callProgressDetectingAgent']=function(_0x2be0d1,_0x5dd16c,_0x37bad5){if(_[_0xfde4('0xff')](_0x5dd16c)&&_0xfde4('0x100')!==typeof _0x5dd16c){return;}if(_[_0xfde4('0xff')](_0x37bad5)&&'object'!==typeof _0x37bad5){return;}switch(_0x37bad5['reason']){case'0':ut[_0xfde4('0x101')](_0x2be0d1,0x0,'NoSuchNumber');rpcDb[_0xfde4('0x102')](_0x2be0d1,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xfde4('0x101')](_0x2be0d1,0x3,_0xfde4('0xd9'));rpcDb[_0xfde4('0x102')](_0x2be0d1,_0xfde4('0x103'));break;case'5':ut['logAgent'](_0x2be0d1,0x5,_0xfde4('0xcf'));rpcDb[_0xfde4('0x102')](_0x2be0d1,_0xfde4('0x104'));break;case'8':ut[_0xfde4('0x101')](_0x2be0d1,0x8,_0xfde4('0x105'));rpcDb[_0xfde4('0x102')](_0x2be0d1,_0xfde4('0x106'));break;case'22':ut['logAgent'](_0x2be0d1,0x16,_0xfde4('0x107'));rpcDb[_0xfde4('0x102')](_0x2be0d1,_0xfde4('0x108'));break;default:ut[_0xfde4('0x101')](_0x2be0d1,0xc,_0x37bad5[_0xfde4('0x109')]);rpcDb[_0xfde4('0x102')](_0x2be0d1,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x5dd16c,_0xfde4('0x10a'));logger[_0xfde4('0x56')](_0xfde4('0x10b'),_0x2be0d1['uniqueid'],_0xfde4('0xbb'),_0x5dd16c[_0xfde4('0x23')],_0xfde4('0x70'),_0x5dd16c[_0xfde4('0x4a')]);delete this[_0xfde4('0x10')][_0x2be0d1[_0xfde4('0xba')]];};Preview[_0xfde4('0x63')][_0xfde4('0xd3')]=function(_0xfc124e,_0xbaae9d,_0x4c47ad){return BPromise[_0xfde4('0x10c')]()[_0xfde4('0x85')](cmHopperAdditionalPhone[_0xfde4('0xd3')](_0xfc124e,_0xbaae9d,_0x4c47ad))[_0xfde4('0x79')](logger[_0xfde4('0x56')]('[verifyAdditionalPhone]\x20'));};Preview[_0xfde4('0x63')][_0xfde4('0xd7')]=function(_0x3bddc8,_0x17d212,_0x5781c2){return BPromise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x3bddc8,_0x17d212,_0x5781c2))[_0xfde4('0x79')](logger[_0xfde4('0x56')](_0xfde4('0x10d')));};Preview[_0xfde4('0x63')][_0xfde4('0xb6')]=function(_0x5d64fb){return BPromise[_0xfde4('0x10c')]()[_0xfde4('0x85')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x5d64fb))[_0xfde4('0x79')](logger[_0xfde4('0x56')](_0xfde4('0x10e')));};Preview[_0xfde4('0x63')]['checkInBlack']=function(_0x2fa2c8,_0x4ae4d0,_0x5f40ba,_0x1b48c4,_0x597130){var _0x61ce36=this;return new BPromise(function(_0x1f2baa,_0x19ad24){if(_['isNil'](_0x4ae4d0)||_['isNil'](_0x4ae4d0[_0xfde4('0x10f')])||_[_0xfde4('0x6c')](_0x4ae4d0['phone'])||_['isNil'](_0x4ae4d0[_0xfde4('0x74')])){_0x19ad24(ut[_0xfde4('0x49')](_0xfde4('0x110'),_0x1b48c4,_0x597130));return;}var _0x454e93=uuid['v4']();var _0x24631b=_0x61ce36[_0xfde4('0xe')][_0x4ae4d0['Queue'][_0xfde4('0x23')]];var _0x19f25c=_0x5f40ba?_0x61ce36[_0xfde4('0x84')][_0x5f40ba]['id']:undefined;_0x61ce36[_0xfde4('0x10')][_0x454e93]=new Action(_0x4ae4d0,_0x24631b,_0x454e93,_0x5f40ba,_0x19f25c);var _0x213f6f=_0x61ce36[_0xfde4('0x10')][_0x454e93];_0x213f6f['unlockAgent']=_0x1b48c4;_0x213f6f[_0xfde4('0xb2')]=_0x597130;_0x213f6f[_0xfde4('0x111')]=_0x5f40ba;if(_[_0xfde4('0x112')](_0x2fa2c8)){_0x61ce36['execCall'](_0x213f6f,_0x24631b,_0x4ae4d0,_0x5f40ba)[_0xfde4('0x85')](function(_0xc8d00b){logger[_0xfde4('0x56')]('[Preview][execCall][success]',_0xfde4('0x113')+_0x213f6f['queue']+_0xfde4('0x114')+_0x213f6f['idContact'],JSON[_0xfde4('0x53')](_0xc8d00b));ami[_0xfde4('0xa4')]('custom:agentcalled',ut[_0xfde4('0xa6')](_0x213f6f,_0xfde4('0x115'),_0x61ce36[_0xfde4('0xe')][_0x213f6f[_0xfde4('0x6f')]]));_0x1f2baa(ut['message'](_0xfde4('0x116')));})[_0xfde4('0x79')](function(_0x155fa9){ut[_0xfde4('0x5e')](_0xfde4('0x117'),_0x155fa9);_0x19ad24(ut['message']('Call\x20failed',_0x1b48c4,_0x597130));});}else{_0x24631b[_0xfde4('0x118')]+=0x1;ut[_0xfde4('0x119')](_0x213f6f);rpcDb[_0xfde4('0x11a')](_0x213f6f,_0xfde4('0x11b'));delete _0x61ce36[_0xfde4('0x10')][_0x454e93];_0x19ad24(ut[_0xfde4('0x49')](_0xfde4('0x11c'),_0x1b48c4,_0x597130));}});};Preview[_0xfde4('0x63')]['isTrunkReachable']=function(_0x189707){return!_[_0xfde4('0x6c')](_0x189707)&&!_[_0xfde4('0x6c')](_0x189707[_0xfde4('0x23')])&&!_['isNil'](_0x189707[_0xfde4('0x51')])&&_0x189707['active']&&!_[_0xfde4('0x6c')](this[_0xfde4('0xf')][util[_0xfde4('0x54')](_0xfde4('0x11d'),_0x189707[_0xfde4('0x23')])])&&!_[_0xfde4('0x6c')](this['trunks'][util[_0xfde4('0x54')](_0xfde4('0x11d'),_0x189707[_0xfde4('0x23')])][_0xfde4('0x77')])&&(this[_0xfde4('0xf')][util[_0xfde4('0x54')]('SIP/%s',_0x189707['name'])][_0xfde4('0x77')]===_0xfde4('0x11e')||this[_0xfde4('0xf')][util[_0xfde4('0x54')](_0xfde4('0x11d'),_0x189707[_0xfde4('0x23')])][_0xfde4('0x77')]===_0xfde4('0x11f'));};Preview[_0xfde4('0x63')][_0xfde4('0x8c')]=function(_0x55da8d,_0x146ef7){var _0x23fb68=this;return new BPromise(function(_0x498855,_0x2a7288){_0x23fb68['execRun'](_0x55da8d,_0x146ef7)[_0xfde4('0x85')](function(_0x1a0d90){_0x498855(_[_0xfde4('0x120')](_0x1a0d90,['message']));})[_0xfde4('0x79')](function(_0x5c289b){if(_0x5c289b[_0xfde4('0x121')]){rpcDb['unlockContact'](_0x55da8d);}if(_0x5c289b[_0xfde4('0x51')]){rpcDb[_0xfde4('0x8f')](_0x55da8d);}_0x2a7288(_[_0xfde4('0x120')](_0x5c289b,[_0xfde4('0x49')]));});});};Preview['prototype']['execRun']=function(_0x19dc5d,_0x5053d8){var _0x54eb00=this;return new BPromise(function(_0x447d44,_0x3fcbbc){var _0x305810,_0x4e8337;rpcDb[_0xfde4('0x122')](_0x19dc5d)[_0xfde4('0x85')](function(_0x4768e9){if(!_[_0xfde4('0x6c')](_0x4768e9[0x0])){_0x4e8337=_0x4768e9[0x0][_0xfde4('0x123')]?![]:!![];_0x305810=_0x4768e9[0x0][_0xfde4('0x123')]?!![]:![];_0x305810=_0x5053d8?!![]:_0x305810;}var _0x596f98=_0x54eb00['validateContact'](_0x4768e9);if(_0x596f98[_0xfde4('0x124')]){rpcDb[_0xfde4('0x125')](_[_0xfde4('0x120')](_0x4768e9[0x0],[_0xfde4('0x74'),'phone']))[_0xfde4('0x85')](function(_0x394188){_0x54eb00['checkInBlack'](_0x394188,_0x4768e9[0x0],_0x5053d8,_0x4e8337,_0x305810)['then'](function(_0x4e31a3){_0x447d44(_0x4e31a3);})['catch'](function(_0x374780){_0x3fcbbc(_0x374780);});})[_0xfde4('0x79')](function(_0x59c205){ut['logger']('[Preview][checkIsBlackList]',_0x59c205);_0x3fcbbc(ut[_0xfde4('0x49')]('Call\x20unsuccessful',_0x4e8337,_0x305810));});}else{_0x3fcbbc(ut[_0xfde4('0x49')](_0x596f98['message'],_0x4e8337,_0x305810));}})[_0xfde4('0x79')](function(_0x2efc77){ut[_0xfde4('0x5e')](_0xfde4('0x126'),_0x2efc77);_0x3fcbbc(ut[_0xfde4('0x49')](_0xfde4('0x127'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x23841d){if(_[_0xfde4('0x6c')](_0x23841d)||_[_0xfde4('0x112')](_0x23841d)||!_[_0xfde4('0x6c')](_0x23841d[0x0][_0xfde4('0x8a')])&&_['isNil'](_0x23841d[0x0][_0xfde4('0x8a')]['name'])){ut[_0xfde4('0x5e')](_0xfde4('0x128'),_0x23841d);return{'isValid':![],'message':_0xfde4('0x129')};}var _0x19091a=this[_0xfde4('0xe')][_0x23841d[0x0][_0xfde4('0x6e')][_0xfde4('0x23')]];_0x19091a[_0xfde4('0x49')]=_0xfde4('0xa0');if(_[_0xfde4('0x6c')](_0x19091a)){ut[_0xfde4('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x19091a);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x19091a[_0xfde4('0x50')])){ut[_0xfde4('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xfde4('0x12a')+_0x19091a[_0xfde4('0x23')]+_0xfde4('0x12b'));if(!this[_0xfde4('0x9d')](_0x19091a['TrunkBackup'])){ut[_0xfde4('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x19091a[_0xfde4('0x23')]+_0xfde4('0x12c'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xfde4('0x9b')](_0x19091a[_0xfde4('0x2f')])){ut[_0xfde4('0x5e')](_0xfde4('0x12d'),_0x19091a[_0xfde4('0x23')]+_0xfde4('0x12e'));return{'isValid':![],'message':_0xfde4('0x12a')+_0x19091a[_0xfde4('0x23')]+_0xfde4('0x12e')};}return{'isValid':!![],'message':_0xfde4('0x12f')};};Preview[_0xfde4('0x63')][_0xfde4('0x130')]=function(_0xc82303,_0x300d9c,_0x32d604,_0x105972){var _0x355601=this;return new BPromise(function(_0x20ae45,_0x4fc6bf){var _0x21eda6=_0xc82303[_0xfde4('0xba')];var _0x3fa128=_0x355601[_0xfde4('0x9d')](_0x300d9c[_0xfde4('0x50')])?util[_0xfde4('0x54')](_0xfde4('0x131'),_0x300d9c[_0xfde4('0x50')][_0xfde4('0x23')],_['isNil'](_0x300d9c[_0xfde4('0x33')])?'':_0x300d9c['dialPrefix'][_0xfde4('0x132')]()||'',_0x300d9c['dialCutDigit']>0x0?_0x32d604[_0xfde4('0x133')]['substring'](_0x300d9c[_0xfde4('0x134')]):_0x32d604[_0xfde4('0x133')]):util['format'](_0xfde4('0x131'),_[_0xfde4('0x6c')](_0x300d9c['TrunkBackup'])?_0x300d9c[_0xfde4('0x50')][_0xfde4('0x23')]:_0x300d9c['TrunkBackup'][_0xfde4('0x23')],_[_0xfde4('0x6c')](_0x300d9c[_0xfde4('0x33')])?'':_0x300d9c[_0xfde4('0x33')][_0xfde4('0x132')]()||'',_0x300d9c[_0xfde4('0x134')]>0x0?_0x32d604[_0xfde4('0x133')][_0xfde4('0x135')](_0x300d9c[_0xfde4('0x134')]):_0x32d604[_0xfde4('0x133')]);var _0x47bb36=_0x355601[_0xfde4('0x9d')](_0x300d9c[_0xfde4('0x50')])?ut[_0xfde4('0x136')](_0x300d9c[_0xfde4('0x50')][_0xfde4('0x137')],_0x300d9c[_0xfde4('0x31')],_0x300d9c[_0xfde4('0x138')]>0x0?ut[_0xfde4('0x139')](_0x300d9c['dialOriginateCallerIdNumber'],_0x300d9c[_0xfde4('0x138')]):_0x300d9c[_0xfde4('0x32')]):ut[_0xfde4('0x136')](_[_0xfde4('0x6c')](_0x300d9c[_0xfde4('0x9e')])?_0x300d9c[_0xfde4('0x50')]['callerid']:_0x300d9c[_0xfde4('0x9e')]['callerid'],_0x300d9c[_0xfde4('0x31')],_0x300d9c[_0xfde4('0x138')]>0x0?ut[_0xfde4('0x139')](_0x300d9c[_0xfde4('0x32')],_0x300d9c[_0xfde4('0x138')]):_0x300d9c[_0xfde4('0x32')]);if(_0x47bb36){_0xc82303[_0xfde4('0x13a')]=ut[_0xfde4('0x13b')](_0x47bb36);_0xc82303[_0xfde4('0x13c')]=ut[_0xfde4('0x13d')](_0x47bb36);}var _0x4c2aaa=ut[_0xfde4('0x13e')](_0x300d9c,_0x32d604,_0x3fa128,_0x47bb36,_0x21eda6,_0xc82303);_['merge'](_0xc82303,ut[_0xfde4('0x13f')](_0x4c2aaa));_0xc82303[_0xfde4('0x90')]=moment()[_0xfde4('0x54')](_0xfde4('0x91'));ami[_0xfde4('0x76')](ut[_0xfde4('0x140')](_0xc82303,_0x300d9c,_0x4c2aaa,_0xc82303[_0xfde4('0xb2')],_0x105972))[_0xfde4('0x85')](function(_0x2f61e0){var _0x37c5c8=_0xc82303[_0xfde4('0x141')];if(!_[_0xfde4('0x6c')](_0x37c5c8)){if(!_[_0xfde4('0x6c')](_0x355601[_0xfde4('0x84')][_0x37c5c8])){_0x355601[_0xfde4('0x84')][_0x37c5c8]['destconnectedlinenum']=_0xc82303['calleridnum'];emit(util[_0xfde4('0x54')](_0xfde4('0x142'),_0x355601['agents'][_0x37c5c8][_0xfde4('0x23')]),'user:agentconnect',{'destaccountcode':_0x355601[_0xfde4('0x84')][_0x37c5c8]['accountcode'],'destconnectedlinenum':_0xc82303[_0xfde4('0x143')]});}}_0x300d9c['originated']+=0x1;logger[_0xfde4('0x56')](_0xfde4('0x144'),_0x21eda6,_0xfde4('0xbb'),_0x300d9c['name'],_0xfde4('0x70'),_0x300d9c[_0xfde4('0x4a')]);_0x20ae45(_0x2f61e0);})[_0xfde4('0x79')](function(_0x3499e0){ut[_0xfde4('0x101')](_0xc82303,0xe,_0xfde4('0x145'));rpcDb['createAgentHistory'](_0xc82303,_0xfde4('0x146'));_0x4fc6bf(_0x3499e0);});});};Preview[_0xfde4('0x63')][_0xfde4('0x1a')]=function(_0x4d21ce){if(this['actions'][_0x4d21ce[_0xfde4('0xb3')]]){this[_0xfde4('0x10')][_0x4d21ce[_0xfde4('0xb3')]][_0xfde4('0x78')]=_0x4d21ce['channel'];}};Preview[_0xfde4('0x63')][_0xfde4('0x147')]=function(_0x3da1f0){var _0x4a2dc4=this;var _0x23bfde=this[_0xfde4('0x10')][_0x3da1f0[_0xfde4('0x148')]];if(_0x23bfde){if(_0x23bfde['lookAgent']&&this[_0xfde4('0x84')][_0x23bfde[_0xfde4('0x111')]]){ut[_0xfde4('0x149')](_0x23bfde,this['agents'][_0x23bfde[_0xfde4('0x111')]][_0xfde4('0x23')],this[_0xfde4('0x84')][_0x23bfde[_0xfde4('0x111')]]['id']);}var _0x249431=_[_0xfde4('0x14a')](_0x23bfde);_0x249431[_0xfde4('0xb7')]=moment()['format'](_0xfde4('0x91'));var _0x247da2=_0x4a2dc4[_0xfde4('0xe')][_0x23bfde['queue']];if(ut['isFailure'](_0x3da1f0[_0xfde4('0x14b')])){if(_0x23bfde[_0xfde4('0xb1')]){rpcDb[_0xfde4('0x14c')](_0x23bfde[_0xfde4('0xb5')]);}if(_0x23bfde[_0xfde4('0xb2')]){rpcDb['disableContact'](_0x23bfde[_0xfde4('0xb5')]);}ami[_0xfde4('0xa4')](_0xfde4('0x14d'),ut[_0xfde4('0xa6')](_0x23bfde,_0xfde4('0x14e'),this[_0xfde4('0xe')][_0x23bfde[_0xfde4('0x6f')]]));this[_0xfde4('0x14f')](_0x249431,_0x247da2,_0x3da1f0);}else{_0x23bfde['starttime']=moment()[_0xfde4('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xfde4('0x101')](_0x249431,0x4,_0xfde4('0xc6'));rpcDb['createAgentHistory'](_0x249431,_0xfde4('0x150'));}}};Preview[_0xfde4('0x63')][_0xfde4('0x14')]=function(_0x722cbe){var _0x276524=this;var _0x5c4575=this[_0xfde4('0x10')][_0x722cbe[_0xfde4('0xb3')]];var _0x200808;if(_0x5c4575){_0x200808=this['campaignsPreview'][_0x5c4575[_0xfde4('0x6f')]];logger['info'](_0xfde4('0x151'),_0x722cbe[_0xfde4('0xb3')],_0xfde4('0xbb'),_0x200808[_0xfde4('0x23')],_0xfde4('0x71'),_0x200808[_0xfde4('0x5c')]);}if(this[_0xfde4('0x10')][_0x722cbe[_0xfde4('0xb3')]]&&_0x722cbe['linkedid']!==_0x722cbe[_0xfde4('0xba')]){if(_0x722cbe[_0xfde4('0x152')]==='16'&&this[_0xfde4('0x10')][_0x722cbe['linkedid']][_0xfde4('0x7c')]){this[_0xfde4('0xa1')](_0x722cbe,_0x722cbe[_0xfde4('0xb3')],_0x722cbe[_0xfde4('0x152')]);}else if(this[_0xfde4('0x10')][_0x722cbe[_0xfde4('0xb3')]][_0xfde4('0x7c')]){logger[_0xfde4('0x56')](_0xfde4('0x153'),_0x722cbe[_0xfde4('0xb3')],_0x722cbe[_0xfde4('0x152')],_0xfde4('0xbb'),_0x200808['name'],_0xfde4('0x71'),_0x200808[_0xfde4('0x5c')]);this['callProgressDetectingCustomer'](_0x722cbe,_0x722cbe[_0xfde4('0xb3')],_0x722cbe[_0xfde4('0x152')]);}}else if(_0x5c4575&&_[_0xfde4('0x6c')](_0x5c4575['statedesc'])&&_0x200808['dialQueueProject']&&_0x722cbe[_0xfde4('0xb3')]===_0x722cbe[_0xfde4('0xba')]&&_[_0xfde4('0x6c')](_0x722cbe[_0xfde4('0x109')])&&_0x722cbe[_0xfde4('0x152')]==='16'&&_0x722cbe[_0xfde4('0x154')]==='6'&&_[_0xfde4('0xff')](_0x5c4575[_0xfde4('0x155')])){if(_0x5c4575['unlockAgent']){rpcDb[_0xfde4('0x14c')](_0x5c4575[_0xfde4('0xb5')]);}if(_0x5c4575[_0xfde4('0xb2')]){rpcDb[_0xfde4('0x8f')](_0x5c4575[_0xfde4('0xb5')]);}_0x722cbe['reason']='22';this[_0xfde4('0x14f')](_0x5c4575,_0x200808,_0x722cbe);}else if(_0x5c4575&&_0x5c4575[_0xfde4('0x155')]){if(_0x722cbe[_0xfde4('0x152')]==='16'&&this[_0xfde4('0x10')][_0x722cbe[_0xfde4('0xb3')]][_0xfde4('0x7c')]){logger['info']('[syncHangup][talking][transfer]',_0x722cbe['linkedid'],_0x722cbe[_0xfde4('0x152')],_0xfde4('0xbb'),_0x200808['name'],'pTalking:\x20',_0x200808[_0xfde4('0x5c')]);this[_0xfde4('0xa1')](_0x722cbe,_0x722cbe['linkedid'],_0x722cbe[_0xfde4('0x152')]);}else if(this[_0xfde4('0x10')][_0x722cbe[_0xfde4('0xb3')]][_0xfde4('0x7c')]){logger[_0xfde4('0x56')](_0xfde4('0x153'),_0x722cbe['linkedid'],_0x722cbe[_0xfde4('0x152')],'\x20Queue',_0x200808[_0xfde4('0x23')],_0xfde4('0x71'),_0x200808['pTalking']);this[_0xfde4('0xa1')](_0x722cbe,_0x722cbe[_0xfde4('0xb3')],_0x722cbe[_0xfde4('0x152')]);}}};Preview[_0xfde4('0x63')][_0xfde4('0x18')]=function(_0x2f9159){if(this[_0xfde4('0x10')][_0x2f9159[_0xfde4('0x156')]]&&_0x2f9159['destlinkedid']!==_0x2f9159[_0xfde4('0x157')]){this[_0xfde4('0xa1')](_0x2f9159,_0x2f9159[_0xfde4('0x156')],_0x2f9159[_0xfde4('0xf4')]);}};Preview[_0xfde4('0x63')]['syncHangupRequest']=function(_0x11b3e7){if(this[_0xfde4('0x10')][_0x11b3e7['linkedid']]&&_0x11b3e7[_0xfde4('0xb3')]!==_0x11b3e7[_0xfde4('0xba')]&&!this[_0xfde4('0x10')][_0x11b3e7[_0xfde4('0xb3')]][_0xfde4('0x7c')]){if(_0x11b3e7[_0xfde4('0x152')]==='1'){this[_0xfde4('0xa1')](_0x11b3e7,_0x11b3e7['linkedid'],_0x11b3e7['cause']);}}};Preview[_0xfde4('0x63')][_0xfde4('0x158')]=function(_0x3b05d8,_0x4638c8,_0x3fafc9){if(this[_0xfde4('0x10')][_0x3b05d8]){if(_[_0xfde4('0x6c')](this[_0xfde4('0x10')][_0x3b05d8][_0xfde4('0x159')])){this['actions'][_0x3b05d8][_0xfde4('0x159')]={};}this[_0xfde4('0x10')][_0x3b05d8][_0xfde4('0x159')][_0x4638c8]=_0x3fafc9;}};Preview[_0xfde4('0x63')][_0xfde4('0x1b')]=function(_0x5b0523){try{if(!_[_0xfde4('0x6c')](_0x5b0523)){if(ut['filterKey'](_[_0xfde4('0x15a')](_0x5b0523['variable'])[0x0])){this[_0xfde4('0x158')](_0x5b0523['uniqueid'],_['keys'](_0x5b0523[_0xfde4('0x15b')])[0x0],_0x5b0523[_0xfde4('0x15c')]);}}}catch(_0xa59450){logger[_0xfde4('0x15d')](_0xfde4('0x15e'),util['inspect'](_0xa59450,{'showHidden':![],'depth':null}));}};Preview[_0xfde4('0x63')][_0xfde4('0x1d')]=function(_0x181bf2){if(_0x181bf2){if(this[_0xfde4('0x10')][_0x181bf2[_0xfde4('0x15f')]]){this[_0xfde4('0x10')][_0x181bf2[_0xfde4('0x15f')]][_0xfde4('0x155')]=!![];}}};Preview[_0xfde4('0x63')][_0xfde4('0x1f')]=function(_0x4b5f67){if(_0x4b5f67){if(this[_0xfde4('0x10')][_0x4b5f67[_0xfde4('0x160')]]){this[_0xfde4('0x10')][_0x4b5f67[_0xfde4('0x160')]][_0xfde4('0x155')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 31d1879..b5afd96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe059=['queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','createHistory','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','holdtime','assigned','lastAssignedTo'];(function(_0x564256,_0x56e661){var _0x4ae919=function(_0x4dc826){while(--_0x4dc826){_0x564256['push'](_0x564256['shift']());}};_0x4ae919(++_0x56e661);}(_0xe059,0x163));var _0x9e05=function(_0x38caf3,_0x107c6f){_0x38caf3=_0x38caf3-0x0;var _0x12435b=_0xe059[_0x38caf3];return _0x12435b;};'use strict';var util=require(_0x9e05('0x0'));var BPromise=require(_0x9e05('0x1'));var logger=require('../../../config/logger')(_0x9e05('0x2'));var _=require('lodash');var cmHopper=require(_0x9e05('0x3'));var cmHopperFinal=require(_0x9e05('0x4'));var cmHopperHistory=require(_0x9e05('0x5'));var cmHopperBlack=require(_0x9e05('0x6'));var voiceQueueRt=require(_0x9e05('0x7'));var agentReportPreview=require(_0x9e05('0x8'));var voiceQueueReport=require(_0x9e05('0x9'));function loggerCatch(_0x30d967){return function(_0x5e6da6){logger[_0x9e05('0xa')](_0x30d967,util[_0x9e05('0xb')](_0x5e6da6,{'showHidden':![],'depth':null}));};}function create(_0x3094c3){return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](cmHopperHistory['createHistory'](_0x3094c3))[_0x9e05('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0xd4dd04){return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](agentReportPreview[_0x9e05('0xf')](_0xd4dd04))[_0x9e05('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x214900){return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](cmHopper['moveContactManagedDialer'](_0x214900,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x9e05('0x10')]=function(_0x344aea){return BPromise[_0x9e05('0xc')]()['then'](cmHopperBlack[_0x9e05('0x10')](_0x344aea))[_0x9e05('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x9e05('0x11')]=function(_0xe4a1c4){return BPromise['resolve']()[_0x9e05('0xd')](cmHopper[_0x9e05('0x11')](_0xe4a1c4))[_0x9e05('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0x9e05('0xf')]=function(_0x18223f,_0x37ec56){create(_0x18223f)['catch'](loggerCatch(_0x37ec56));moveContact(_0x18223f)[_0x9e05('0xe')](loggerCatch(_0x37ec56));};exports[_0x9e05('0x12')]=function(_0x4db253,_0x469270){createAgent(_0x4db253)['catch'](loggerCatch(_0x469270));};exports[_0x9e05('0x13')]=function(_0x2d9395,_0xa87807){create(_0x2d9395)[_0x9e05('0xe')](loggerCatch(_0xa87807));};exports[_0x9e05('0x14')]=function(_0x4f18e8,_0xf65fa){moveContact(_0x4f18e8)[_0x9e05('0xe')](loggerCatch(_0xf65fa));};exports[_0x9e05('0x15')]=function(_0x5a9045,_0x4af403,_0x5766ea){if(_0x4af403){_0x5a9045[_0x9e05('0x16')]=null;}if(_0x5766ea){_0x5a9045['active']=![];}return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](cmHopper[_0x9e05('0x15')](_0x5a9045))['catch'](loggerCatch(_0x9e05('0x17')));};exports[_0x9e05('0x18')]=function(_0x390dad){return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](cmHopper[_0x9e05('0x18')](_0x390dad))[_0x9e05('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x9e05('0x19')]=function(_0x564032){return BPromise[_0x9e05('0xc')]()['then'](cmHopper[_0x9e05('0x19')]({'UserId':null},_0x564032,0x1))[_0x9e05('0xe')](loggerCatch(_0x9e05('0x1a')));};exports[_0x9e05('0x1b')]=function(_0x15d29d){return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](cmHopper[_0x9e05('0x19')]({'active':![]},_0x15d29d,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x9e05('0x1c')]=function(_0x30adc2){var _0x73c29e={};_0x73c29e[_0x9e05('0x1d')]=_0x30adc2['type'];_0x73c29e[_0x9e05('0x1e')]=_0x30adc2[_0x9e05('0x1e')];_0x73c29e[_0x9e05('0x1f')]=_0x30adc2[_0x9e05('0x1f')];_0x73c29e['calleridname']=_0x30adc2[_0x9e05('0x20')];_0x73c29e[_0x9e05('0x21')]=_0x30adc2[_0x9e05('0x21')];_0x73c29e[_0x9e05('0x22')]=_0x30adc2[_0x9e05('0x23')];_0x73c29e['queuecallerleaveAt']=_0x30adc2[_0x9e05('0x23')];_0x73c29e['queuecallercomplete']=0x1;_0x73c29e[_0x9e05('0x24')]=_0x30adc2[_0x9e05('0x25')];_0x73c29e[_0x9e05('0x26')]=_0x30adc2['membername'];_0x73c29e[_0x9e05('0x27')]=_0x9e05('0x28');_0x73c29e[_0x9e05('0x29')]='xcally-motion-preview';_0x73c29e[_0x9e05('0x2a')]=0x0;_0x73c29e[_0x9e05('0x2b')]=0x1;_0x73c29e[_0x9e05('0x2c')]=_0x30adc2['membername'];_0x73c29e[_0x9e05('0x2d')]=_0x9e05('0x2e');return BPromise[_0x9e05('0xc')]()[_0x9e05('0xd')](voiceQueueReport[_0x9e05('0x2f')](_0x73c29e))[_0x9e05('0xe')](loggerCatch(_0x9e05('0x30')));};exports['getContactRecallMe']=function(_0x2852c8,_0x1e2d99){return BPromise['resolve']()[_0x9e05('0xd')](cmHopper[_0x9e05('0x31')](_0x2852c8,_0x1e2d99))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x2706b1){return BPromise['resolve']()[_0x9e05('0xd')](cmHopper[_0x9e05('0x15')](_0x2706b1,!![],!![]))[_0x9e05('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0xaa65=['exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip'];(function(_0x2af033,_0x13c531){var _0x10e266=function(_0x462b64){while(--_0x462b64){_0x2af033['push'](_0x2af033['shift']());}};_0x10e266(++_0x13c531);}(_0xaa65,0x14f));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var BPromise=require(_0x5aa6('0x0'));var logger=require('../../../config/logger')(_0x5aa6('0x1'));var _=require('lodash');var cmHopper=require(_0x5aa6('0x2'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5aa6('0x3'));var cmHopperBlack=require(_0x5aa6('0x4'));var voiceQueueRt=require(_0x5aa6('0x5'));var agentReportPreview=require(_0x5aa6('0x6'));var voiceQueueReport=require(_0x5aa6('0x7'));function loggerCatch(_0x17a1ff){return function(_0x3a5c39){logger[_0x5aa6('0x8')](_0x17a1ff,util[_0x5aa6('0x9')](_0x3a5c39,{'showHidden':![],'depth':null}));};}function create(_0x9564a3){return BPromise['resolve']()[_0x5aa6('0xa')](cmHopperHistory[_0x5aa6('0xb')](_0x9564a3))[_0x5aa6('0xc')](loggerCatch(_0x5aa6('0xd')));}function createAgent(_0x401631){return BPromise[_0x5aa6('0xe')]()['then'](agentReportPreview[_0x5aa6('0xb')](_0x401631))[_0x5aa6('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4a2e30){return BPromise[_0x5aa6('0xe')]()['then'](cmHopper['moveContactManagedDialer'](_0x4a2e30,!![]))['catch'](loggerCatch(_0x5aa6('0xf')));}exports[_0x5aa6('0x10')]=function(_0x542475){return BPromise['resolve']()[_0x5aa6('0xa')](cmHopperBlack[_0x5aa6('0x10')](_0x542475))['catch'](loggerCatch(_0x5aa6('0x11')));};exports[_0x5aa6('0x12')]=function(_0x28d638){return BPromise[_0x5aa6('0xe')]()[_0x5aa6('0xa')](cmHopper[_0x5aa6('0x12')](_0x28d638))['catch'](loggerCatch(_0x5aa6('0x13')));};exports['createHistory']=function(_0x3cf717,_0x12a552){create(_0x3cf717)['catch'](loggerCatch(_0x12a552));moveContact(_0x3cf717)[_0x5aa6('0xc')](loggerCatch(_0x12a552));};exports[_0x5aa6('0x14')]=function(_0x5c45b3,_0x111d2d){createAgent(_0x5c45b3)[_0x5aa6('0xc')](loggerCatch(_0x111d2d));};exports['createCustomerHistory']=function(_0x2134f9,_0x1ab4ac){create(_0x2134f9)[_0x5aa6('0xc')](loggerCatch(_0x1ab4ac));};exports[_0x5aa6('0x15')]=function(_0x162379,_0x2954b8){moveContact(_0x162379)[_0x5aa6('0xc')](loggerCatch(_0x2954b8));};exports['rescheduleContact']=function(_0x55a8df,_0x2427dd,_0x494da0){if(_0x2427dd){_0x55a8df[_0x5aa6('0x16')]=null;}if(_0x494da0){_0x55a8df[_0x5aa6('0x17')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x5aa6('0x18')](_0x55a8df))[_0x5aa6('0xc')](loggerCatch(_0x5aa6('0x19')));};exports[_0x5aa6('0x1a')]=function(_0x1d9db0){return BPromise[_0x5aa6('0xe')]()[_0x5aa6('0xa')](cmHopper['countReScheduled'](_0x1d9db0))[_0x5aa6('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x42b477){return BPromise[_0x5aa6('0xe')]()[_0x5aa6('0xa')](cmHopper[_0x5aa6('0x1b')]({'UserId':null},_0x42b477,0x1))[_0x5aa6('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x5aa6('0x1c')]=function(_0x333d60){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x333d60,0x1))['catch'](loggerCatch(_0x5aa6('0x1d')));};exports[_0x5aa6('0x1e')]=function(_0x43f23f){var _0x262ae1={};_0x262ae1['type']=_0x43f23f[_0x5aa6('0x1f')];_0x262ae1[_0x5aa6('0x20')]=_0x43f23f[_0x5aa6('0x20')];_0x262ae1[_0x5aa6('0x21')]=_0x43f23f[_0x5aa6('0x21')];_0x262ae1['calleridname']=_0x43f23f[_0x5aa6('0x22')];_0x262ae1[_0x5aa6('0x23')]=_0x43f23f[_0x5aa6('0x23')];_0x262ae1['queuecallerjoinAt']=_0x43f23f[_0x5aa6('0x24')];_0x262ae1[_0x5aa6('0x25')]=_0x43f23f[_0x5aa6('0x24')];_0x262ae1[_0x5aa6('0x26')]=0x1;_0x262ae1[_0x5aa6('0x27')]=_0x43f23f[_0x5aa6('0x28')];_0x262ae1['connectedlinename']=_0x43f23f['membername'];_0x262ae1[_0x5aa6('0x29')]=_0x5aa6('0x2a');_0x262ae1[_0x5aa6('0x2b')]=_0x5aa6('0x2c');_0x262ae1['holdtime']=0x0;_0x262ae1[_0x5aa6('0x2d')]=0x1;_0x262ae1[_0x5aa6('0x2e')]=_0x43f23f[_0x5aa6('0x2f')];_0x262ae1[_0x5aa6('0x30')]='COMPLETED';return BPromise[_0x5aa6('0xe')]()[_0x5aa6('0xa')](voiceQueueReport[_0x5aa6('0x31')](_0x262ae1))['catch'](loggerCatch(_0x5aa6('0x32')));};exports[_0x5aa6('0x33')]=function(_0x5dedae,_0x3b5dda){return BPromise[_0x5aa6('0xe')]()['then'](cmHopper[_0x5aa6('0x33')](_0x5dedae,_0x3b5dda))[_0x5aa6('0xc')](loggerCatch(_0x5aa6('0x34')));};exports['rescheduleContactInQueue']=function(_0x32cdec){return BPromise[_0x5aa6('0xe')]()[_0x5aa6('0xa')](cmHopper[_0x5aa6('0x18')](_0x32cdec,!![],!![]))[_0x5aa6('0xc')](loggerCatch(_0x5aa6('0x35')));};
\ No newline at end of file
index 037472e..ad5d9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e65=['_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','toUpper','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','channelAgent','mandatoryDisposition','not_inuse','push','getDiff','createBody','CampaignId','filterKey','type','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','XCALLY_IP_AGI','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview'];(function(_0x4dafed,_0x2ade38){var _0x110a34=function(_0x1150b7){while(--_0x1150b7){_0x4dafed['push'](_0x4dafed['shift']());}};_0x110a34(++_0x2ade38);}(_0x5e65,0x67));var _0x55e6=function(_0x48273a,_0x1d41d5){_0x48273a=_0x48273a-0x0;var _0x2ba05d=_0x5e65[_0x48273a];return _0x2ba05d;};'use strict';var util=require(_0x55e6('0x0'));var _=require('lodash');var moment=require(_0x55e6('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process['env'][_0x55e6('0x2')]||'127.0.0.1';function getSeconds(_0x41072f,_0x392060){var _0x1a1331=moment(_0x41072f)[_0x55e6('0x3')](0x0);var _0x48a21f=moment(_0x392060)[_0x55e6('0x3')](0x0);return _0x1a1331[_0x55e6('0x4')](_0x48a21f,_0x55e6('0x5'));}exports['loggerCatch']=function(_0x5a4c05){return function(_0x23c39f){logger[_0x55e6('0x6')](_0x5a4c05,util[_0x55e6('0x7')](_0x23c39f,{'showHidden':![],'depth':null}));};};exports[_0x55e6('0x8')]=function(_0x391e38,_0x58abf1){logger[_0x55e6('0x9')](_0x391e38,util['inspect'](_0x58abf1,{'showHidden':![],'depth':null}));};exports[_0x55e6('0xa')]=function(_0x3a2e05,_0x30ec48){logger[_0x55e6('0x6')](_0x3a2e05,util['inspect'](_0x30ec48,{'showHidden':![],'depth':null}));};exports[_0x55e6('0xb')]=function(_0x223dc2){return function(_0x5d97ea){logger['info'](_0x223dc2,util[_0x55e6('0x7')](_0x5d97ea,{'showHidden':![],'depth':null}));};};exports[_0x55e6('0xc')]=function(_0x325994,_0x285fcf,_0x47739a){return{'message':_0x325994,'unlock':_0x285fcf,'active':_0x47739a};};exports[_0x55e6('0xd')]=function(_0x2ebe7d,_0x3b745f,_0x408398){if(!_[_0x55e6('0xe')](_0x408398)&&_0x55e6('0xf')===typeof _0x408398&&!_['isEmpty'](_0x408398)){if(!_[_0x55e6('0xe')](_0x3b745f)&&_0x55e6('0xf')===typeof _0x3b745f&&!_[_0x55e6('0x10')](_0x3b745f)){return util[_0x55e6('0x11')]('\x22%s\x22\x20<%s>',_0x3b745f,_0x408398);}return util[_0x55e6('0x11')]('\x22%s\x22\x20<%s>',_0x408398,_0x408398);}if(!_[_0x55e6('0xe')](_0x2ebe7d)&&_0x55e6('0xf')===typeof _0x2ebe7d&&!_[_0x55e6('0x10')](_0x2ebe7d)){return _0x2ebe7d;}return _0x55e6('0x12');};exports[_0x55e6('0x13')]=function(_0x3e7c68){if(_['isNil'](_0x3e7c68)){return![];}return _0x3e7c68;};exports[_0x55e6('0x14')]=function(_0x2ab1b5,_0x2c2b38,_0x11e69e,_0x178ff4,_0x233bc1,_0x50e5e8){var _0x3ef8fe={'XMD-QUEUE':_0x2c2b38['Queue']?_0x2c2b38[_0x55e6('0x15')][_0x55e6('0x16')]:'','XMD-CALLERID':_0x178ff4,'XMD-CALLERID-PREVIEW':_0x50e5e8?util[_0x55e6('0x11')](_0x55e6('0x17'),_0x50e5e8[_0x55e6('0x18')],_0x50e5e8[_0x55e6('0x19')]):_0x178ff4,'XMD-DIALID':_0x233bc1,'XMD-CONTACTID':_0x2c2b38[_0x55e6('0x1a')],'XMD-CDRTYPE':_0x55e6('0x1b'),'CALLERID(all)':_0x178ff4,'XMD-VOICEQUEUEID':_0x2c2b38['VoiceQueueId'],'XMD-DIALCHANNEL':_0x11e69e,'XMD-DIALTIMEOUT':_0x2ab1b5['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x55e6('0x1c'),_0x2ab1b5[_0x55e6('0x1d')]?'g':'',_[_0x55e6('0x10')](_0x2ab1b5[_0x55e6('0x1e')])?'':_0x55e6('0x1f')),'XMD-DIALURL':_0x2ab1b5['dialPreviewUrl']||'','XMD-AGI':_0x2ab1b5[_0x55e6('0x20')]?util['format'](_0x55e6('0x21'),ipAgi,_0x2ab1b5[_0x55e6('0x20')]):_0x55e6('0x22'),'XMD-AGIAFTER':_0x2ab1b5[_0x55e6('0x1d')]?util['format'](_0x55e6('0x21'),ipAgi,_0x2ab1b5[_0x55e6('0x1d')]):_0x55e6('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x50e5e8?_0x50e5e8[_0x55e6('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x50e5e8?_0x50e5e8[_0x55e6('0x24')]:'','XMD-DESTINATION':_0x55e6('0x25')};if(!_['isEmpty'](_0x2ab1b5['monitor_format'])){_0x3ef8fe[util[_0x55e6('0x11')]('%s',_0x55e6('0x26'))]=_0x2ab1b5[_0x55e6('0x1e')];_0x3ef8fe[util[_0x55e6('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x233bc1;}if(_0x2c2b38&&_0x2c2b38['Contact']){for(var _0x4992b2 in _0x2c2b38['Contact']){if(_0x2c2b38[_0x55e6('0x27')][_0x55e6('0x28')](_0x4992b2)){if(!_['isNil'](_0x2c2b38['Contact'][_0x4992b2])&&_0x4992b2!=='id'&&_0x4992b2!==_0x55e6('0x29')&&_0x4992b2!==_0x55e6('0x2a')&&_0x4992b2!==_0x55e6('0x2b')){_0x3ef8fe[util['format']('%s%s','XMD-',_[_0x55e6('0x2c')](_0x4992b2))]=_0x2c2b38['Contact'][_0x4992b2];}}}}return _0x3ef8fe;};exports[_0x55e6('0x2d')]=function(_0x2ffe35){var _0x42b972={};for(var _0x5e8e2a in _0x2ffe35){if(_0x2ffe35[_0x55e6('0x28')](_0x5e8e2a)){_0x42b972[util[_0x55e6('0x11')]('%s',_[_0x55e6('0x2e')](_0x5e8e2a))]=_0x2ffe35[_0x5e8e2a];}}return{'variables':_0x42b972};};exports[_0x55e6('0x2f')]=function(_0x4eccc5,_0x33b503){if(!_[_0x55e6('0x30')](_0x4eccc5)){if(_0x4eccc5[_0x55e6('0x28')](_0x55e6('0x31'))){if(_0x4eccc5[_0x55e6('0x31')]>0x0){_0x4eccc5[_0x55e6('0x31')]-=0x1;}else{logger[_0x55e6('0x6')](_0x55e6('0x32'),_0x33b503);}}}else{logger[_0x55e6('0x6')](_0x55e6('0x33'),_0x33b503);}};exports[_0x55e6('0x34')]=function(_0x578824){var _0x2f5ff7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x578824[_0x55e6('0x35')]=0xd;_0x578824[_0x55e6('0x36')]=_0x55e6('0x37');_0x578824[_0x55e6('0x38')]=_0x2f5ff7;_0x578824[_0x55e6('0x39')]=_0x2f5ff7;_0x578824['endtime']=_0x2f5ff7;};exports[_0x55e6('0x3a')]=function(_0x103592,_0x502313,_0x378cd2){var _0x58e42c=moment()[_0x55e6('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x103592[_0x55e6('0x35')]=_0x502313;_0x103592[_0x55e6('0x36')]=_0x378cd2;_0x103592[_0x55e6('0x39')]=_0x58e42c;_0x103592[_0x55e6('0x3b')]=getSeconds(_0x103592[_0x55e6('0x39')],_0x103592[_0x55e6('0x38')]);};exports[_0x55e6('0x3c')]=function(_0x1ac7fd,_0x34dc63,_0x582ff3){_0x1ac7fd[_0x55e6('0x3d')]=_0x34dc63;_0x1ac7fd['UserId']=_0x582ff3;};exports[_0x55e6('0x3e')]=function(_0x13f551,_0x260d5f,_0x3894bb){var _0x2a9cf8=moment()[_0x55e6('0x11')](_0x55e6('0x3f'));_0x13f551[_0x55e6('0x35')]=_0x260d5f;_0x13f551[_0x55e6('0x36')]=_0x3894bb;_0x13f551[_0x55e6('0x39')]=_0x13f551['responsetime']?_0x13f551['responsetime']:_0x2a9cf8;_0x13f551[_0x55e6('0x40')]=_0x13f551[_0x55e6('0x40')]?_0x13f551[_0x55e6('0x40')]:_0x2a9cf8;_0x13f551[_0x55e6('0x3b')]=getSeconds(_0x13f551[_0x55e6('0x39')]||0x0,_0x13f551[_0x55e6('0x38')]||0x0);_0x13f551[_0x55e6('0x41')]=_0x13f551[_0x55e6('0x42')]?getSeconds(_0x13f551['endtime'],_0x13f551[_0x55e6('0x42')]):0x0;};exports[_0x55e6('0x43')]=function(_0x569b71){return _0x569b71===_0x55e6('0x44');};exports[_0x55e6('0x45')]=function(_0x130615,_0x38386f,_0x47b454,_0x35eb52,_0x23797a){var _0x41a5be=_0x35eb52?_0x55e6('0x46'):_0x130615[_0x55e6('0x18')];_0x41a5be=_0x23797a?_0x55e6('0x47'):_0x41a5be;return{'actionid':_0x130615[_0x55e6('0x48')],'action':_0x55e6('0x49'),'channel':_0x130615['channelAgent'],'callerid':util[_0x55e6('0x11')]('\x22%s\x22\x20<%s>',_0x41a5be,_0x130615[_0x55e6('0x19')]),'Exten':'xcally-motion-preview','Context':_0x55e6('0x4a'),'Priority':'1','variable':_0x47b454,'timeout':(_0x38386f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x130615[_0x55e6('0x48')]};};exports[_0x55e6('0x4b')]=function(_0x42d5f4){return _0x42d5f4['countbusyretry']+_0x42d5f4[_0x55e6('0x4c')]+_0x42d5f4[_0x55e6('0x4d')]+_0x42d5f4[_0x55e6('0x4e')]+_0x42d5f4['countnosuchnumberretry'];};exports['cloneAction']=function(_0x126941){var _0x331ef9=_[_0x55e6('0x4f')](_0x126941);_0x331ef9['state']=0xf;_0x331ef9[_0x55e6('0x36')]='Global';return _0x331ef9;};exports['scheduledAt']=function(_0x482122,_0xb69c57,_0x21552a){var _0x872b9b={};_0x872b9b[_0xb69c57]=_0x482122[_0xb69c57];_0x872b9b[_0x55e6('0x50')]=![];_0x872b9b[_0x55e6('0x51')]=moment()[_0x55e6('0x52')](_0x21552a,_0x55e6('0x53'))[_0x55e6('0x11')](_0x55e6('0x3f'));_0x872b9b[_0x55e6('0x1a')]=_0x482122['ContactId'];_0x872b9b[_0x55e6('0x54')]=_0x482122[_0x55e6('0x54')];_0x872b9b[_0x55e6('0x55')]=_0x482122[_0x55e6('0x55')]||undefined;return _0x872b9b;};exports[_0x55e6('0x56')]=function(_0xeb812b,_0x2676e9){if(!_[_0x55e6('0x30')](_0xeb812b)){if(_0xeb812b[_0x55e6('0x57')]>0x0){_0xeb812b[_0x55e6('0x57')]-=0x1;}else{logger['error'](_0x2676e9,_0x55e6('0x58'));}}else{logger[_0x55e6('0x6')](_0x2676e9,_0x55e6('0x59'));}};exports[_0x55e6('0x5a')]=function(_0x8c7c72){if(_0x8c7c72<=0x0){return!![];}return![];};exports[_0x55e6('0x5b')]=function(_0x36102c,_0x3af468,_0x58ecae){_0x36102c['lastevent']=_0x3af468;_0x36102c[_0x55e6('0x16')]=_0x36102c[_0x55e6('0x5c')];_0x36102c[_0x55e6('0x5d')]=_0x36102c[_0x55e6('0x5e')];if(_0x58ecae){_0x36102c[_0x55e6('0x5f')]=_0x58ecae[_0x55e6('0x5f')];}return _0x36102c;};exports['buildAcw']=function(_0x15600e){var _0xe817c5={};_0xe817c5[_0x55e6('0x5c')]=_0x15600e[_0x55e6('0x5c')];_0xe817c5[_0x55e6('0x5d')]=_0x15600e[_0x55e6('0x5e')];_0xe817c5['uniqueid']=_0x15600e[_0x55e6('0x48')];return _0xe817c5;};exports['agentReadyId']=function(_0x399e51){var _0x1e4c2d=[];for(var _0x4cd407 in _0x399e51){if(_0x399e51['hasOwnProperty'](_0x4cd407)){if(!_['isNil'](_0x399e51[_0x4cd407])&&_0x399e51[_0x4cd407]['state']===_0x55e6('0x60')&&_0x399e51[_0x4cd407]['status']==='reachable'){_0x1e4c2d[_0x55e6('0x61')](_0x399e51[_0x4cd407]['id']);}}}return _0x1e4c2d;};exports[_0x55e6('0x62')]=function(_0x25b48a){var _0x35c4a8=moment()[_0x55e6('0x3')](0x0);var _0x2f0833=moment(_0x25b48a)['milliseconds'](0x0);return _0x35c4a8[_0x55e6('0x4')](_0x2f0833,_0x55e6('0x5'));};exports[_0x55e6('0x63')]=function(_0x2da458){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2da458['ContactId'],'ListId':_0x2da458[_0x55e6('0x54')],'VoiceQueueId':_0x2da458[_0x55e6('0x55')]||undefined,'CampaignId':_0x2da458[_0x55e6('0x64')]||undefined};};exports[_0x55e6('0x65')]=function(_0x8808e6){if(_0x8808e6===_0x55e6('0x48')||_0x8808e6==='idContact'||_0x8808e6===_0x55e6('0x5c')||_0x8808e6===_0x55e6('0x66')||_0x8808e6==='campaigntype'||_0x8808e6===_0x55e6('0x67')||_0x8808e6===_0x55e6('0x3d')||_0x8808e6===_0x55e6('0x5e')||_0x8808e6==='calleridname'||_0x8808e6===_0x55e6('0x50')||_0x8808e6===_0x55e6('0x19')||_0x8808e6===_0x55e6('0x51')||_0x8808e6===_0x55e6('0x68')||_0x8808e6==='countcongestionretry'||_0x8808e6===_0x55e6('0x4d')||_0x8808e6===_0x55e6('0x69')||_0x8808e6===_0x55e6('0x6a')||_0x8808e6===_0x55e6('0x6b')||_0x8808e6===_0x55e6('0x6c')||_0x8808e6===_0x55e6('0x6d')||_0x8808e6===_0x55e6('0x1a')||_0x8808e6===_0x55e6('0x54')||_0x8808e6===_0x55e6('0x6e')||_0x8808e6==='VoiceQueueId'||_0x8808e6===_0x55e6('0x6f')||_0x8808e6===_0x55e6('0x70')||_0x8808e6===_0x55e6('0x71')||_0x8808e6===_0x55e6('0x72')||_0x8808e6===_0x55e6('0x73')||_0x8808e6===_0x55e6('0x74')||_0x8808e6===_0x55e6('0x75')||_0x8808e6===_0x55e6('0x76')||_0x8808e6===_0x55e6('0x77')||_0x8808e6==='xmd-dialchannel'||_0x8808e6===_0x55e6('0x78')||_0x8808e6==='xmd-cdrtype'||_0x8808e6===_0x55e6('0x79')||_0x8808e6===_0x55e6('0x7a')||_0x8808e6===_0x55e6('0x7b')||_0x8808e6===_0x55e6('0x7c')||_0x8808e6==='rtpaudioqosbridged'||_0x8808e6===_0x55e6('0x7d')||_0x8808e6===_0x55e6('0x7e')||_0x8808e6===_0x55e6('0x7f')||_0x8808e6===_0x55e6('0x80')||_0x8808e6==='rtpaudioqosrtt'||_0x8808e6==='rtpaudioqosrttbridged'||_0x8808e6==='rtpaudioqos'||_0x8808e6===_0x55e6('0x81')||_0x8808e6==='rtpaudioqosjitter'||_0x8808e6===_0x55e6('0x7e')||_0x8808e6==='rtpaudioqosloss'||_0x8808e6==='rtpaudioqoslossbridged'||_0x8808e6==='rtpaudioqosrtt'||_0x8808e6===_0x55e6('0x82')||_0x8808e6===_0x55e6('0x83')||_0x8808e6===_0x55e6('0x84')||_0x8808e6===_0x55e6('0x35')||_0x8808e6===_0x55e6('0x36')){return![];}return!![];};exports[_0x55e6('0x85')]=function(_0x4d4cf6,_0x4ee832){var _0x348852,_0x554624,_0x2d7aff;if(_0x4ee832<=0x0){_0x4ee832=0x1;}_0x348852=new RegExp(_0x55e6('0x86')+_0x4ee832+'}$');_0x554624=Math['pow'](0xa,_0x4ee832-0x1);_0x2d7aff=Math[_0x55e6('0x87')](0xa,_0x4ee832)-0x1;return util[_0x55e6('0x11')]('%s',_[_0x55e6('0x88')](_0x4d4cf6,_0x348852,_[_0x55e6('0x89')](_0x554624,_0x2d7aff)));};exports[_0x55e6('0x8a')]=function(_0x291f71){var _0x382406=_0x291f71[_0x55e6('0x8b')](/"(.*?)"/);return _0x382406?_0x382406[0x1]:_0x291f71;};exports[_0x55e6('0x8c')]=function(_0x31aa2d){var _0x41a542=_0x31aa2d[_0x55e6('0x8b')](/<(.*?)>/);return _0x41a542?_0x41a542[0x1]:_0x31aa2d;};
\ No newline at end of file
+var _0x0438=['bridgepvtcallid','\x5cw{0,','replace','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','info','loggerError','logger2','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','%s%s','toUpper','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','endtime','state','statedesc','logLookAgent','logCustomer','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','Global','scheduledAt','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','buildAcw','queue','not_inuse','push','CampaignId','filterKey','type','campaigntype','active','calleridnum','countbusyretry','callback','callbackuniqueid','callbackat','recallme','UserId','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged'];(function(_0x21d514,_0x4bc0fc){var _0xc910fd=function(_0x35ea10){while(--_0x35ea10){_0x21d514['push'](_0x21d514['shift']());}};_0xc910fd(++_0x4bc0fc);}(_0x0438,0x100));var _0x8043=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0438[_0x32b542];return _0x554d54;};'use strict';var util=require(_0x8043('0x0'));var _=require('lodash');var moment=require(_0x8043('0x1'));var logger=require(_0x8043('0x2'))(_0x8043('0x3'));var ipAgi=process['env'][_0x8043('0x4')]||_0x8043('0x5');function getSeconds(_0x55cdc0,_0x1db065){var _0x3af471=moment(_0x55cdc0)[_0x8043('0x6')](0x0);var _0xea02b2=moment(_0x1db065)[_0x8043('0x6')](0x0);return _0x3af471[_0x8043('0x7')](_0xea02b2,_0x8043('0x8'));}exports['loggerCatch']=function(_0x44cb90){return function(_0x430f32){logger[_0x8043('0x9')](_0x44cb90,util[_0x8043('0xa')](_0x430f32,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x371188,_0x2ea791){logger[_0x8043('0xb')](_0x371188,util[_0x8043('0xa')](_0x2ea791,{'showHidden':![],'depth':null}));};exports[_0x8043('0xc')]=function(_0x4750d9,_0x4060e5){logger[_0x8043('0x9')](_0x4750d9,util[_0x8043('0xa')](_0x4060e5,{'showHidden':![],'depth':null}));};exports[_0x8043('0xd')]=function(_0x2ecae6){return function(_0x537001){logger['info'](_0x2ecae6,util[_0x8043('0xa')](_0x537001,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1c11bf,_0x553c7e,_0x1af34d){return{'message':_0x1c11bf,'unlock':_0x553c7e,'active':_0x1af34d};};exports['getCallerId']=function(_0x20102a,_0x1a71b7,_0x146a84){if(!_[_0x8043('0xe')](_0x146a84)&&'string'===typeof _0x146a84&&!_[_0x8043('0xf')](_0x146a84)){if(!_[_0x8043('0xe')](_0x1a71b7)&&_0x8043('0x10')===typeof _0x1a71b7&&!_[_0x8043('0xf')](_0x1a71b7)){return util['format'](_0x8043('0x11'),_0x1a71b7,_0x146a84);}return util[_0x8043('0x12')]('\x22%s\x22\x20<%s>',_0x146a84,_0x146a84);}if(!_['isUndefined'](_0x20102a)&&_0x8043('0x10')===typeof _0x20102a&&!_[_0x8043('0xf')](_0x20102a)){return _0x20102a;}return _0x8043('0x13');};exports[_0x8043('0x14')]=function(_0x1fe26e){if(_['isNil'](_0x1fe26e)){return![];}return _0x1fe26e;};exports[_0x8043('0x15')]=function(_0x35455c,_0x31b050,_0x479409,_0x44bdb5,_0x4f3cff,_0x2a05ec){var _0x2022e3={'XMD-QUEUE':_0x31b050[_0x8043('0x16')]?_0x31b050[_0x8043('0x16')][_0x8043('0x17')]:'','XMD-CALLERID':_0x44bdb5,'XMD-CALLERID-PREVIEW':_0x2a05ec?util['format'](_0x8043('0x11'),_0x2a05ec[_0x8043('0x18')],_0x2a05ec['calleridnum']):_0x44bdb5,'XMD-DIALID':_0x4f3cff,'XMD-CONTACTID':_0x31b050['ContactId'],'XMD-CDRTYPE':_0x8043('0x19'),'CALLERID(all)':_0x44bdb5,'XMD-VOICEQUEUEID':_0x31b050['VoiceQueueId'],'XMD-DIALCHANNEL':_0x479409,'XMD-DIALTIMEOUT':_0x35455c[_0x8043('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8043('0x12')](_0x8043('0x1b'),_0x35455c[_0x8043('0x1c')]?'g':'',_[_0x8043('0xf')](_0x35455c['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x35455c[_0x8043('0x1d')]||'','XMD-AGI':_0x35455c[_0x8043('0x1e')]?util['format'](_0x8043('0x1f'),ipAgi,_0x35455c[_0x8043('0x1e')]):_0x8043('0x20'),'XMD-AGIAFTER':_0x35455c['dialQueueProject2']?util['format'](_0x8043('0x1f'),ipAgi,_0x35455c[_0x8043('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2a05ec?_0x2a05ec[_0x8043('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x2a05ec?_0x2a05ec['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x8043('0xf')](_0x35455c['monitor_format'])){_0x2022e3[util[_0x8043('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x35455c[_0x8043('0x22')];_0x2022e3[util[_0x8043('0x12')]('%s',_0x8043('0x23'))]=_0x4f3cff;}if(_0x31b050&&_0x31b050['Contact']){for(var _0x201508 in _0x31b050[_0x8043('0x24')]){if(_0x31b050[_0x8043('0x24')]['hasOwnProperty'](_0x201508)){if(!_[_0x8043('0x25')](_0x31b050[_0x8043('0x24')][_0x201508])&&_0x201508!=='id'&&_0x201508!==_0x8043('0x26')&&_0x201508!==_0x8043('0x27')&&_0x201508!=='updatedAt'){_0x2022e3[util['format'](_0x8043('0x28'),'XMD-',_[_0x8043('0x29')](_0x201508))]=_0x31b050[_0x8043('0x24')][_0x201508];}}}}return _0x2022e3;};exports['toLowerVariables']=function(_0x1b66d7){var _0x712324={};for(var _0x1d5a4d in _0x1b66d7){if(_0x1b66d7[_0x8043('0x2a')](_0x1d5a4d)){_0x712324[util[_0x8043('0x12')]('%s',_[_0x8043('0x2b')](_0x1d5a4d))]=_0x1b66d7[_0x1d5a4d];}}return{'variables':_0x712324};};exports['updateOriginated']=function(_0x596ef0,_0x5952d2){if(!_[_0x8043('0x25')](_0x596ef0)){if(_0x596ef0[_0x8043('0x2a')](_0x8043('0x2c'))){if(_0x596ef0[_0x8043('0x2c')]>0x0){_0x596ef0[_0x8043('0x2c')]-=0x1;}else{logger[_0x8043('0x9')](_0x8043('0x2d'),_0x5952d2);}}}else{logger[_0x8043('0x9')](_0x8043('0x2e'),_0x5952d2);}};exports[_0x8043('0x2f')]=function(_0x528847){var _0xf65439=moment()[_0x8043('0x12')](_0x8043('0x30'));_0x528847['state']=0xd;_0x528847['statedesc']=_0x8043('0x31');_0x528847[_0x8043('0x32')]=_0xf65439;_0x528847[_0x8043('0x33')]=_0xf65439;_0x528847[_0x8043('0x34')]=_0xf65439;};exports['logAgent']=function(_0x204e03,_0x508ce7,_0x22c151){var _0x10f673=moment()['format'](_0x8043('0x30'));_0x204e03[_0x8043('0x35')]=_0x508ce7;_0x204e03[_0x8043('0x36')]=_0x22c151;_0x204e03[_0x8043('0x33')]=_0x10f673;_0x204e03['ringtime']=getSeconds(_0x204e03['responsetime'],_0x204e03[_0x8043('0x32')]);};exports[_0x8043('0x37')]=function(_0x282247,_0x55b869,_0x294cec){_0x282247['membername']=_0x55b869;_0x282247['UserId']=_0x294cec;};exports[_0x8043('0x38')]=function(_0x4b63cd,_0x153df9,_0x383aaf){var _0xe6b6d2=moment()[_0x8043('0x12')](_0x8043('0x30'));_0x4b63cd[_0x8043('0x35')]=_0x153df9;_0x4b63cd[_0x8043('0x36')]=_0x383aaf;_0x4b63cd[_0x8043('0x33')]=_0x4b63cd[_0x8043('0x33')]?_0x4b63cd[_0x8043('0x33')]:_0xe6b6d2;_0x4b63cd[_0x8043('0x34')]=_0x4b63cd['endtime']?_0x4b63cd['endtime']:_0xe6b6d2;_0x4b63cd['ringtime']=getSeconds(_0x4b63cd['responsetime']||0x0,_0x4b63cd[_0x8043('0x32')]||0x0);_0x4b63cd['talktime']=_0x4b63cd[_0x8043('0x39')]?getSeconds(_0x4b63cd['endtime'],_0x4b63cd[_0x8043('0x39')]):0x0;};exports[_0x8043('0x3a')]=function(_0x4a8b30){return _0x4a8b30==='Failure';};exports['variablesAction']=function(_0x2a8357,_0x33f3f1,_0x17cfc2,_0x44cb93,_0x45f8d1){var _0x292c8e=_0x44cb93?_0x8043('0x3b'):_0x2a8357[_0x8043('0x18')];_0x292c8e=_0x45f8d1?_0x8043('0x3c'):_0x292c8e;return{'actionid':_0x2a8357[_0x8043('0x3d')],'action':_0x8043('0x3e'),'channel':_0x2a8357[_0x8043('0x3f')],'callerid':util[_0x8043('0x12')](_0x8043('0x11'),_0x292c8e,_0x2a8357['calleridnum']),'Exten':_0x8043('0x40'),'Context':_0x8043('0x41'),'Priority':'1','variable':_0x17cfc2,'timeout':(_0x33f3f1['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2a8357[_0x8043('0x3d')]};};exports[_0x8043('0x42')]=function(_0x59e04d){return _0x59e04d['countbusyretry']+_0x59e04d[_0x8043('0x43')]+_0x59e04d[_0x8043('0x44')]+_0x59e04d[_0x8043('0x45')]+_0x59e04d['countnosuchnumberretry'];};exports['cloneAction']=function(_0x32c656){var _0x35456f=_[_0x8043('0x46')](_0x32c656);_0x35456f[_0x8043('0x35')]=0xf;_0x35456f['statedesc']=_0x8043('0x47');return _0x35456f;};exports[_0x8043('0x48')]=function(_0x4ff25d,_0x236e55,_0xc8c0ff){var _0x1af385={};_0x1af385[_0x236e55]=_0x4ff25d[_0x236e55];_0x1af385['active']=![];_0x1af385[_0x8043('0x49')]=moment()[_0x8043('0x4a')](_0xc8c0ff,_0x8043('0x4b'))[_0x8043('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x1af385[_0x8043('0x4c')]=_0x4ff25d[_0x8043('0x4c')];_0x1af385[_0x8043('0x4d')]=_0x4ff25d['ListId'];_0x1af385[_0x8043('0x4e')]=_0x4ff25d[_0x8043('0x4e')]||undefined;return _0x1af385;};exports['decrementTalkink']=function(_0x6f2096,_0x50f4ae){if(!_[_0x8043('0x25')](_0x6f2096)){if(_0x6f2096['pTalking']>0x0){_0x6f2096[_0x8043('0x4f')]-=0x1;}else{logger['error'](_0x50f4ae,_0x8043('0x50'));}}else{logger[_0x8043('0x9')](_0x50f4ae,_0x8043('0x51'));}};exports[_0x8043('0x52')]=function(_0x9af931){if(_0x9af931<=0x0){return!![];}return![];};exports[_0x8043('0x53')]=function(_0x59f9af,_0x36aa1d,_0x4016ea){_0x59f9af[_0x8043('0x54')]=_0x36aa1d;_0x59f9af[_0x8043('0x17')]=_0x59f9af['queue'];_0x59f9af[_0x8043('0x55')]=_0x59f9af['channelAgent'];if(_0x4016ea){_0x59f9af[_0x8043('0x56')]=_0x4016ea[_0x8043('0x56')];}return _0x59f9af;};exports[_0x8043('0x57')]=function(_0x41f7e0){var _0x1883f5={};_0x1883f5[_0x8043('0x58')]=_0x41f7e0[_0x8043('0x58')];_0x1883f5['interface']=_0x41f7e0['channelAgent'];_0x1883f5[_0x8043('0x3d')]=_0x41f7e0[_0x8043('0x3d')];return _0x1883f5;};exports['agentReadyId']=function(_0xb34677){var _0xc11bd9=[];for(var _0x536452 in _0xb34677){if(_0xb34677['hasOwnProperty'](_0x536452)){if(!_[_0x8043('0x25')](_0xb34677[_0x536452])&&_0xb34677[_0x536452][_0x8043('0x35')]===_0x8043('0x59')&&_0xb34677[_0x536452]['status']==='reachable'){_0xc11bd9[_0x8043('0x5a')](_0xb34677[_0x536452]['id']);}}}return _0xc11bd9;};exports['getDiff']=function(_0x5e9a7e){var _0x23488d=moment()[_0x8043('0x6')](0x0);var _0x5e79e6=moment(_0x5e9a7e)[_0x8043('0x6')](0x0);return _0x23488d[_0x8043('0x7')](_0x5e79e6,'seconds');};exports['createBody']=function(_0x11866c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x11866c['ContactId'],'ListId':_0x11866c[_0x8043('0x4d')],'VoiceQueueId':_0x11866c[_0x8043('0x4e')]||undefined,'CampaignId':_0x11866c[_0x8043('0x5b')]||undefined};};exports[_0x8043('0x5c')]=function(_0x457637){if(_0x457637===_0x8043('0x3d')||_0x457637==='idContact'||_0x457637===_0x8043('0x58')||_0x457637===_0x8043('0x5d')||_0x457637===_0x8043('0x5e')||_0x457637==='dialAnswer'||_0x457637==='membername'||_0x457637===_0x8043('0x3f')||_0x457637===_0x8043('0x18')||_0x457637===_0x8043('0x5f')||_0x457637===_0x8043('0x60')||_0x457637===_0x8043('0x49')||_0x457637===_0x8043('0x61')||_0x457637===_0x8043('0x43')||_0x457637===_0x8043('0x44')||_0x457637==='countglobal'||_0x457637===_0x8043('0x62')||_0x457637===_0x8043('0x63')||_0x457637===_0x8043('0x64')||_0x457637===_0x8043('0x65')||_0x457637===_0x8043('0x4c')||_0x457637===_0x8043('0x4d')||_0x457637===_0x8043('0x66')||_0x457637===_0x8043('0x4e')||_0x457637==='sipcallid'||_0x457637===_0x8043('0x67')||_0x457637===_0x8043('0x68')||_0x457637==='xmd-phone'||_0x457637===_0x8043('0x69')||_0x457637==='xmd-dialurl'||_0x457637==='xmd-dialtimeout'||_0x457637===_0x8043('0x6a')||_0x457637==='xmd-dialid'||_0x457637===_0x8043('0x6b')||_0x457637===_0x8043('0x6c')||_0x457637===_0x8043('0x6d')||_0x457637==='xmd-callerid'||_0x457637===_0x8043('0x6e')||_0x457637==='xmd-agi'||_0x457637===_0x8043('0x6f')||_0x457637===_0x8043('0x70')||_0x457637===_0x8043('0x71')||_0x457637==='rtpaudioqosjitterbridged'||_0x457637===_0x8043('0x72')||_0x457637===_0x8043('0x73')||_0x457637===_0x8043('0x74')||_0x457637===_0x8043('0x75')||_0x457637===_0x8043('0x6f')||_0x457637==='rtpaudioqosbridged'||_0x457637===_0x8043('0x71')||_0x457637===_0x8043('0x76')||_0x457637===_0x8043('0x72')||_0x457637===_0x8043('0x73')||_0x457637===_0x8043('0x74')||_0x457637===_0x8043('0x75')||_0x457637==='bridgepeer'||_0x457637===_0x8043('0x77')||_0x457637===_0x8043('0x35')||_0x457637===_0x8043('0x36')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4e810c,_0x4afc09){var _0x4400f9,_0xccbc2b,_0x4f3771;if(_0x4afc09<=0x0){_0x4afc09=0x1;}_0x4400f9=new RegExp(_0x8043('0x78')+_0x4afc09+'}$');_0xccbc2b=Math['pow'](0xa,_0x4afc09-0x1);_0x4f3771=Math['pow'](0xa,_0x4afc09)-0x1;return util[_0x8043('0x12')]('%s',_[_0x8043('0x79')](_0x4e810c,_0x4400f9,_['random'](_0xccbc2b,_0x4f3771)));};exports[_0x8043('0x7a')]=function(_0x39ba1d){var _0xa812c=_0x39ba1d[_0x8043('0x7b')](/"(.*?)"/);return _0xa812c?_0xa812c[0x1]:_0x39ba1d;};exports[_0x8043('0x7c')]=function(_0x40e391){var _0xb425dd=_0x40e391[_0x8043('0x7b')](/<(.*?)>/);return _0xb425dd?_0xb425dd[0x1]:_0x40e391;};
\ No newline at end of file
index 773ba45..5a1667e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac7c=['voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0x13188a,_0x2f635f){var _0x2f5716=function(_0x40d1b4){while(--_0x40d1b4){_0x13188a['push'](_0x13188a['shift']());}};_0x2f5716(++_0x2f635f);}(_0xac7c,0xfd));var _0xcac7=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0xac7c[_0x45161c];return _0x186581;};'use strict';exports[_0xcac7('0x0')]={'queue':{'type':_0xcac7('0x1'),'required':!![]},'interface':{'type':_0xcac7('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xcac7('0x2'),'required':![]},'paused':{'type':_0xcac7('0x3'),'required':![]}};exports[_0xcac7('0x4')]={'queue':{'type':_0xcac7('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xcac7('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xcac7('0x3')},'reason':{'type':_0xcac7('0x1'),'required':![]}};exports[_0xcac7('0x6')]={'module':{'type':_0xcac7('0x1'),'required':![]}};exports[_0xcac7('0x7')]={'uniqueid':{'type':_0xcac7('0x1'),'required':!![]}};exports[_0xcac7('0x8')]={'uniqueid':{'type':_0xcac7('0x1'),'required':!![]},'filename':{'type':_0xcac7('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xcac7('0x1'),'required':!![]}};exports[_0xcac7('0x9')]={'uniqueid':{'type':_0xcac7('0x1'),'required':!![]},'exten':{'type':_0xcac7('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x886e=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x760eee,_0x3c309b){var _0x51fa86=function(_0x590d25){while(--_0x590d25){_0x760eee['push'](_0x760eee['shift']());}};_0x51fa86(++_0x3c309b);}(_0x886e,0x166));var _0xe886=function(_0x1a47f0,_0x2975ef){_0x1a47f0=_0x1a47f0-0x0;var _0x1056ff=_0x886e[_0x1a47f0];return _0x1056ff;};'use strict';exports[_0xe886('0x0')]={'queue':{'type':_0xe886('0x1'),'required':!![]},'interface':{'type':_0xe886('0x1'),'required':!![]},'membername':{'type':_0xe886('0x1'),'required':!![]},'penalty':{'type':_0xe886('0x2'),'required':![]},'paused':{'type':_0xe886('0x3'),'required':![]}};exports[_0xe886('0x4')]={'queue':{'type':_0xe886('0x1'),'required':!![]},'interface':{'type':_0xe886('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xe886('0x1'),'required':!![]},'paused':{'type':_0xe886('0x3')},'reason':{'type':_0xe886('0x1'),'required':![]}};exports[_0xe886('0x5')]={'module':{'type':_0xe886('0x1'),'required':![]}};exports[_0xe886('0x6')]={'uniqueid':{'type':_0xe886('0x1'),'required':!![]}};exports[_0xe886('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xe886('0x1')},'format':{'type':_0xe886('0x1')},'mixmonitorid':{'type':_0xe886('0x1')}};exports[_0xe886('0x8')]={'uniqueid':{'type':_0xe886('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xe886('0x1'),'required':!![]},'exten':{'type':_0xe886('0x1'),'required':!![]},'context':{'type':_0xe886('0x1')}};
\ No newline at end of file
index a690704..6fe87c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7cf=['merge','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','SIP/%s','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject'];(function(_0x22eb12,_0x20abe2){var _0x453701=function(_0x28a59c){while(--_0x28a59c){_0x22eb12['push'](_0x22eb12['shift']());}};_0x453701(++_0x20abe2);}(_0xb7cf,0xe1));var _0xfb7c=function(_0xdea555,_0x5ce0bb){_0xdea555=_0xdea555-0x0;var _0x4bc666=_0xb7cf[_0xdea555];return _0x4bc666;};'use strict';var BPromise=require('bluebird');var util=require(_0xfb7c('0x0'));var _=require(_0xfb7c('0x1'));var moment=require(_0xfb7c('0x2'));var Agent=require(_0xfb7c('0x3'));var Telephone=require(_0xfb7c('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xfb7c('0x5'));var Trigger=require(_0xfb7c('0x6'));var Template=require(_0xfb7c('0x7'));var Campaign=require(_0xfb7c('0x8'));var VoiceExtension=require(_0xfb7c('0x9'));var ZendeskAccount=require(_0xfb7c('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xfb7c('0xb'));var SugarcrmAccount=require(_0xfb7c('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xfb7c('0xd'));var ServicenowAccount=require(_0xfb7c('0xe'));var Dynamics365Account=require(_0xfb7c('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xfb7c('0x10'));var Realtime=function(){this[_0xfb7c('0x11')]={};this[_0xfb7c('0x12')]={};this['trunks']={};this[_0xfb7c('0x13')]={};this[_0xfb7c('0x14')]={};this['campaigns']={};this['templates']={};this[_0xfb7c('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xfb7c('0x16')]={};this[_0xfb7c('0x17')]={};this[_0xfb7c('0x18')]={};this[_0xfb7c('0x19')]={};this['timers']={};this[_0xfb7c('0x1a')]={};this[_0xfb7c('0x1b')]={};this[_0xfb7c('0x1c')]={};this['sugarcrmAccounts']={};this[_0xfb7c('0x1d')]={};this[_0xfb7c('0x1e')]={};this[_0xfb7c('0x1f')]={};this[_0xfb7c('0x20')]={};this[_0xfb7c('0x21')]={};this[_0xfb7c('0x22')]={};this[_0xfb7c('0x23')]={};this[_0xfb7c('0x24')]={};};function freeIsNotKey(_0x15d681,_0xd6c260,_0xc7db40){var _0xf0d0e8=_[_0xfb7c('0x25')](_0x15d681,function(_0x2f2afa,_0x1b967c){return _0x2f2afa[_0xc7db40];});for(var _0x3a015a in _0xd6c260){if(_0xd6c260[_0xfb7c('0x26')](_0x3a015a)){if(!_0xf0d0e8[_0x3a015a]){delete _0xd6c260[_0x3a015a];}}}}function freeIsNotKeySip(_0x40ca28,_0x168fe1){var _0x3cf304=_[_0xfb7c('0x25')](_0x40ca28,function(_0x4c58b1,_0x6c33da){return util[_0xfb7c('0x27')]('SIP/%s',_0x4c58b1[_0xfb7c('0x28')]);});for(var _0x3419cb in _0x168fe1){if(_0x168fe1[_0xfb7c('0x26')](_0x3419cb)){if(!_0x3cf304[_0x3419cb]){delete _0x168fe1[_0x3419cb];}}}}function freeIsNotKeyAgent(_0x1c627e,_0x41e078){var _0x176676=_[_0xfb7c('0x25')](_0x1c627e,function(_0x3b3756,_0x48ffb5){var _0x586fe5=_[_0xfb7c('0x29')](_0x3b3756[_0xfb7c('0x2a')])?util['format']('SIP/%s',_0x3b3756[_0xfb7c('0x28')]):_0x3b3756['interface'];return _0x586fe5;});for(var _0x473535 in _0x41e078){if(_0x41e078['hasOwnProperty'](_0x473535)){if(!_0x176676[_0x473535]){delete _0x41e078[_0x473535];}}}}function clearVoiceCallReports(_0x213884){_0x213884[_0xfb7c('0x2b')]=0x0;_0x213884[_0xfb7c('0x2c')]=0x0;_0x213884[_0xfb7c('0x2d')]=0x0;_0x213884[_0xfb7c('0x2e')]=0x0;_0x213884['sumBillable']=0x0;}function clearCampaigns(_0x51d108){if(!_[_0xfb7c('0x2f')](_0x51d108)){for(var _0x1ef10a in _0x51d108){if(_0x51d108['hasOwnProperty'](_0x1ef10a)){_0x51d108[_0x1ef10a][_0xfb7c('0x30')]=0x0;_0x51d108[_0x1ef10a][_0xfb7c('0x31')]=0x0;}}}}function clearVoiceQueues(_0x2b0aa6){if(!_[_0xfb7c('0x2f')](_0x2b0aa6)){for(var _0x44bd27 in _0x2b0aa6){if(_0x2b0aa6[_0xfb7c('0x26')](_0x44bd27)){_0x2b0aa6[_0x44bd27][_0xfb7c('0x2b')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x2c')]=0x0;_0x2b0aa6[_0x44bd27]['unmanaged']=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x32')]=0x0;_0x2b0aa6[_0x44bd27]['sumHoldTime']=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x2e')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x33')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x34')]=0x0;_0x2b0aa6[_0x44bd27]['outboundNoAnswerCallsDay']=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x35')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x36')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x37')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x38')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x39')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3a')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3b')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3c')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3d')]=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3e')]=0x0;_0x2b0aa6[_0x44bd27]['outboundAnswerAgiCallsDay']=0x0;_0x2b0aa6[_0x44bd27][_0xfb7c('0x3f')]=0x0;_0x2b0aa6[_0x44bd27]['queueStatusComplete']=!![];}}}}Realtime[_0xfb7c('0x40')][_0xfb7c('0x41')]=function(_0x3d025e,_0x4976d4){for(var _0x2ed58d in _0x4976d4){if(_0x3d025e['hasOwnProperty'](_0x2ed58d)){_0x3d025e[_0x2ed58d]=_0x4976d4[_0x2ed58d];}}};Realtime[_0xfb7c('0x40')][_0xfb7c('0x42')]=function(){var _0x3f1b9a=this;return function(_0x205361){if(_0x205361){freeIsNotKeyAgent(_0x205361,_0x3f1b9a[_0xfb7c('0x11')]);for(var _0x17d873=0x0,_0x3c18d8={},_0x531fc6={};_0x17d873<_0x205361[_0xfb7c('0x43')];_0x17d873+=0x1){_0x3c18d8=_0x205361[_0x17d873];var _0x1bc55a=_[_0xfb7c('0x29')](_0x3c18d8[_0xfb7c('0x2a')])?util[_0xfb7c('0x27')]('SIP/%s',_0x3c18d8[_0xfb7c('0x28')]):_0x3c18d8['interface'];if(_[_0xfb7c('0x44')](_0x3f1b9a[_0xfb7c('0x11')][_0x1bc55a])){_0x3f1b9a[_0xfb7c('0x11')][_0x1bc55a]=new Agent(_0x3c18d8);}else{_0x3f1b9a[_0xfb7c('0x41')](_0x3f1b9a['agents'][_0x1bc55a],_0x3c18d8);}}}return _0x3f1b9a[_0xfb7c('0x11')];};};Realtime['prototype'][_0xfb7c('0x45')]=function(){var _0x7241ed=this;return function(_0x349790){if(_0x349790){freeIsNotKeySip(_0x349790,_0x7241ed['telephones']);for(var _0x334d15=0x0,_0x1c5bd0={},_0x5d29ce={};_0x334d15<_0x349790['length'];_0x334d15+=0x1){_0x1c5bd0=_0x349790[_0x334d15];if(_[_0xfb7c('0x44')](_0x7241ed['telephones'][util[_0xfb7c('0x27')]('SIP/%s',_0x1c5bd0['name'])])){_0x7241ed['telephones'][util[_0xfb7c('0x27')](_0xfb7c('0x46'),_0x1c5bd0[_0xfb7c('0x28')])]=new Telephone(_0x1c5bd0);}else{_0x7241ed['mergeFromDatabase'](_0x7241ed[_0xfb7c('0x12')][util[_0xfb7c('0x27')]('SIP/%s',_0x1c5bd0['name'])],_0x1c5bd0);}}}return _0x7241ed[_0xfb7c('0x12')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x47')]=function(){var _0x2f260c=this;return function(_0x2b0f2e){if(_0x2b0f2e){freeIsNotKeySip(_0x2b0f2e,_0x2f260c[_0xfb7c('0x48')]);for(var _0x8ece64=0x0,_0x1a4ec3={},_0x1b1f79={};_0x8ece64<_0x2b0f2e[_0xfb7c('0x43')];_0x8ece64+=0x1){_0x1a4ec3=_0x2b0f2e[_0x8ece64];if(_[_0xfb7c('0x44')](_0x2f260c[_0xfb7c('0x48')][util[_0xfb7c('0x27')](_0xfb7c('0x46'),_0x1a4ec3['name'])])){_0x2f260c['trunks'][util[_0xfb7c('0x27')]('SIP/%s',_0x1a4ec3[_0xfb7c('0x28')])]=new Trunk(_0x1a4ec3);}else{_0x2f260c[_0xfb7c('0x41')](_0x2f260c[_0xfb7c('0x48')][util[_0xfb7c('0x27')](_0xfb7c('0x46'),_0x1a4ec3[_0xfb7c('0x28')])],_0x1a4ec3);}}}return _0x2f260c['trunks'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x49')]=function(){var _0x4f04be=this;return function(_0x4ba3bd){if(_0x4ba3bd){freeIsNotKey(_0x4ba3bd,_0x4f04be['voiceQueues'],_0xfb7c('0x28'));for(var _0x408387=0x0,_0x1326c2={},_0xfb7776={};_0x408387<_0x4ba3bd[_0xfb7c('0x43')];_0x408387+=0x1){_0x1326c2=_0x4ba3bd[_0x408387];if(_[_0xfb7c('0x44')](_0x4f04be[_0xfb7c('0x13')][_0x1326c2[_0xfb7c('0x28')]])){_0x4f04be[_0xfb7c('0x13')][_0x1326c2[_0xfb7c('0x28')]]=new VoiceQueue(_0x1326c2);}else{_0x4f04be['mergeFromDatabase'](_0x4f04be[_0xfb7c('0x13')][_0x1326c2[_0xfb7c('0x28')]],_0x1326c2);}}}return _0x4f04be[_0xfb7c('0x13')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x4a')]=function(){var _0x414636=this;return function(_0x9e05a0){if(_0x9e05a0){freeIsNotKey(_0x9e05a0,_0x414636[_0xfb7c('0x14')],'id');for(var _0x31c663=0x0,_0xe26f0={},_0x415fa6={};_0x31c663<_0x9e05a0[_0xfb7c('0x43')];_0x31c663+=0x1){_0xe26f0=_0x9e05a0[_0x31c663];if(_[_0xfb7c('0x44')](_0x414636['triggers'][_0xe26f0['id']])){_0x414636[_0xfb7c('0x14')][_0xe26f0['id']]=new Trigger(_0xe26f0);}else{_0x414636['mergeFromDatabase'](_0x414636[_0xfb7c('0x14')][_0xe26f0['id']],_0xe26f0);}}}return _0x414636[_0xfb7c('0x14')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x4b')]=function(){var _0x4bc73f=this;return function(_0x1449d8){if(_0x1449d8){freeIsNotKey(_0x1449d8,_0x4bc73f[_0xfb7c('0x4c')],'id');for(var _0x3723c0=0x0,_0x3da4cb={},_0x26eb9e={};_0x3723c0<_0x1449d8['length'];_0x3723c0+=0x1){_0x3da4cb=_0x1449d8[_0x3723c0];if(_['isUndefined'](_0x4bc73f[_0xfb7c('0x4c')][_0x3da4cb['id']])){_0x4bc73f[_0xfb7c('0x4c')][_0x3da4cb['id']]=new Template(_0x3da4cb);}else{_0x4bc73f['mergeFromDatabase'](_0x4bc73f['templates'][_0x3da4cb['id']],_0x3da4cb);}}}return _0x4bc73f[_0xfb7c('0x4c')];};};Realtime['prototype'][_0xfb7c('0x4d')]=function(){var _0x1c4728=this;return function(_0x58f2e1){if(_0x58f2e1){freeIsNotKey(_0x58f2e1,_0x1c4728['zendeskAccounts'],'id');for(var _0x43890e=0x0,_0x5ec8b5={},_0x54bcb0={};_0x43890e<_0x58f2e1[_0xfb7c('0x43')];_0x43890e+=0x1){_0x5ec8b5=_0x58f2e1[_0x43890e];if(_[_0xfb7c('0x44')](_0x1c4728[_0xfb7c('0x1b')][_0x5ec8b5['id']])){_0x1c4728[_0xfb7c('0x1b')][_0x5ec8b5['id']]=new ZendeskAccount(_0x5ec8b5);}else{_0x1c4728['mergeFromDatabase'](_0x1c4728[_0xfb7c('0x1b')][_0x5ec8b5['id']],_0x5ec8b5);}}}return _0x1c4728[_0xfb7c('0x1b')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x4e')]=function(){var _0x2267f5=this;return function(_0x4852fb){if(_0x4852fb){freeIsNotKey(_0x4852fb,_0x2267f5[_0xfb7c('0x1c')],'id');for(var _0x5b1377=0x0,_0x36629e={},_0x392bf7={};_0x5b1377<_0x4852fb[_0xfb7c('0x43')];_0x5b1377+=0x1){_0x36629e=_0x4852fb[_0x5b1377];if(_['isUndefined'](_0x2267f5['salesforceAccounts'][_0x36629e['id']])){_0x2267f5[_0xfb7c('0x1c')][_0x36629e['id']]=new SalesforceAccount(_0x36629e);}else{_0x2267f5[_0xfb7c('0x41')](_0x2267f5[_0xfb7c('0x1c')][_0x36629e['id']],_0x36629e);}}}return _0x2267f5[_0xfb7c('0x1c')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x4f')]=function(){var _0x52f20d=this;return function(_0x4cb8dd){if(_0x4cb8dd){freeIsNotKey(_0x4cb8dd,_0x52f20d[_0xfb7c('0x1d')],'id');for(var _0x1297c1=0x0,_0x2e9d60={},_0x1c5599={};_0x1297c1<_0x4cb8dd[_0xfb7c('0x43')];_0x1297c1+=0x1){_0x2e9d60=_0x4cb8dd[_0x1297c1];if(_['isUndefined'](_0x52f20d[_0xfb7c('0x1d')][_0x2e9d60['id']])){_0x52f20d['freshdeskAccounts'][_0x2e9d60['id']]=new FreshdeskAccount(_0x2e9d60);}else{_0x52f20d[_0xfb7c('0x41')](_0x52f20d['freshdeskAccounts'][_0x2e9d60['id']],_0x2e9d60);}}}return _0x52f20d[_0xfb7c('0x1d')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x50')]=function(){var _0x447a11=this;return function(_0x580a10){if(_0x580a10){freeIsNotKey(_0x580a10,_0x447a11[_0xfb7c('0x1e')],'id');for(var _0x4d21bb=0x0,_0x5aea7f={},_0x287354={};_0x4d21bb<_0x580a10['length'];_0x4d21bb+=0x1){_0x5aea7f=_0x580a10[_0x4d21bb];if(_['isUndefined'](_0x447a11[_0xfb7c('0x1e')][_0x5aea7f['id']])){_0x447a11['zohoAccounts'][_0x5aea7f['id']]=new ZohoAccount(_0x5aea7f);}else{_0x447a11['mergeFromDatabase'](_0x447a11[_0xfb7c('0x1e')][_0x5aea7f['id']],_0x5aea7f);}}}return _0x447a11[_0xfb7c('0x1e')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x51')]=function(){var _0x48e773=this;return function(_0x454548){if(_0x454548){freeIsNotKey(_0x454548,_0x48e773['deskAccounts'],'id');for(var _0x299fba=0x0,_0x600308={},_0x134a9f={};_0x299fba<_0x454548['length'];_0x299fba+=0x1){_0x600308=_0x454548[_0x299fba];if(_[_0xfb7c('0x44')](_0x48e773[_0xfb7c('0x1f')][_0x600308['id']])){_0x48e773[_0xfb7c('0x1f')][_0x600308['id']]=new DeskAccount(_0x600308);}else{_0x48e773[_0xfb7c('0x41')](_0x48e773[_0xfb7c('0x1f')][_0x600308['id']],_0x600308);}}}return _0x48e773['deskAccounts'];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x30dacc=this;return function(_0x224a72){if(_0x224a72){freeIsNotKey(_0x224a72,_0x30dacc[_0xfb7c('0x52')],'id');for(var _0x116771=0x0,_0x310151={},_0x5743fc={};_0x116771<_0x224a72[_0xfb7c('0x43')];_0x116771+=0x1){_0x310151=_0x224a72[_0x116771];if(_[_0xfb7c('0x44')](_0x30dacc[_0xfb7c('0x52')][_0x310151['id']])){_0x30dacc[_0xfb7c('0x52')][_0x310151['id']]=new SugarcrmAccount(_0x310151);}else{_0x30dacc[_0xfb7c('0x41')](_0x30dacc[_0xfb7c('0x52')][_0x310151['id']],_0x310151);}}}return _0x30dacc[_0xfb7c('0x52')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x53')]=function(){var _0x5122bb=this;return function(_0x45079b){if(_0x45079b){freeIsNotKey(_0x45079b,_0x5122bb[_0xfb7c('0x20')],'id');for(var _0x397027=0x0,_0x4f9f51={},_0x31bdc7={};_0x397027<_0x45079b[_0xfb7c('0x43')];_0x397027+=0x1){_0x4f9f51=_0x45079b[_0x397027];if(_[_0xfb7c('0x44')](_0x5122bb[_0xfb7c('0x20')][_0x4f9f51['id']])){_0x5122bb[_0xfb7c('0x20')][_0x4f9f51['id']]=new VtigerAccount(_0x4f9f51);}else{_0x5122bb['mergeFromDatabase'](_0x5122bb[_0xfb7c('0x20')][_0x4f9f51['id']],_0x4f9f51);}}}return _0x5122bb['vtigerAccounts'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x54')]=function(){var _0x51036e=this;return function(_0x31b169){if(_0x31b169){freeIsNotKey(_0x31b169,_0x51036e[_0xfb7c('0x21')],'id');for(var _0x167d77=0x0,_0x336cc6={},_0x12ec8a={};_0x167d77<_0x31b169[_0xfb7c('0x43')];_0x167d77+=0x1){_0x336cc6=_0x31b169[_0x167d77];if(_[_0xfb7c('0x44')](_0x51036e[_0xfb7c('0x21')][_0x336cc6['id']])){_0x51036e[_0xfb7c('0x21')][_0x336cc6['id']]=new ServicenowAccount(_0x336cc6);}else{_0x51036e[_0xfb7c('0x41')](_0x51036e[_0xfb7c('0x21')][_0x336cc6['id']],_0x336cc6);}}}return _0x51036e['servicenowAccounts'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x55')]=function(){var _0xfaf96a=this;return function(_0x2e474b){if(_0x2e474b){freeIsNotKey(_0x2e474b,_0xfaf96a[_0xfb7c('0x22')],'id');for(var _0x2beed1=0x0,_0x29caae={},_0x3b74df={};_0x2beed1<_0x2e474b['length'];_0x2beed1+=0x1){_0x29caae=_0x2e474b[_0x2beed1];if(_[_0xfb7c('0x44')](_0xfaf96a[_0xfb7c('0x22')][_0x29caae['id']])){_0xfaf96a[_0xfb7c('0x22')][_0x29caae['id']]=new Dynamics365Account(_0x29caae);}else{_0xfaf96a[_0xfb7c('0x41')](_0xfaf96a[_0xfb7c('0x22')][_0x29caae['id']],_0x29caae);}}}return _0xfaf96a['dynamics365Accounts'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x56')]=function(){var _0x438506=this;return function(_0x20624c){if(_0x20624c){freeIsNotKey(_0x20624c,_0x438506[_0xfb7c('0x23')],'id');for(var _0x3d3e90=0x0,_0x1c5986={},_0x251c45={};_0x3d3e90<_0x20624c['length'];_0x3d3e90+=0x1){_0x1c5986=_0x20624c[_0x3d3e90];if(_['isUndefined'](_0x438506['freshsalesAccounts'][_0x1c5986['id']])){_0x438506[_0xfb7c('0x23')][_0x1c5986['id']]=new FreshsalesAccount(_0x1c5986);}else{_0x438506[_0xfb7c('0x41')](_0x438506[_0xfb7c('0x23')][_0x1c5986['id']],_0x1c5986);}}}return _0x438506['freshsalesAccounts'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x57')]=function(){var _0x266c6d=this;return function(_0xeedbf2){for(var _0x5e4f19=0x0;_0x5e4f19<_0xeedbf2[_0xfb7c('0x43')];_0x5e4f19+=0x1){_['merge'](_0x266c6d[_0xfb7c('0x13')][_0xeedbf2[_0x5e4f19]['name']],_0xeedbf2[_0x5e4f19]);}return _0x266c6d['voiceQueues'];};};Realtime['prototype'][_0xfb7c('0x58')]=function(){var _0xffedd5=this;return function(_0x2415dc){clearVoiceQueues(_0xffedd5['voiceQueues']);if(_0x2415dc){_0x2415dc=_[_0xfb7c('0x59')](_0x2415dc,'uniqueid');for(var _0x27ccef in _0x2415dc){if(_0x2415dc['hasOwnProperty'](_0x27ccef)){var _0x1b7b14={};for(var _0x4cbf92=0x0;_0x4cbf92<_0x2415dc[_0x27ccef][_0xfb7c('0x43')];_0x4cbf92+=0x1){var _0xf41625=_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x5a')];if(_0xffedd5[_0xfb7c('0x13')][_0xf41625]){if(_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x5b')]){_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x5c')]+=0x1;}if(_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x5d')]){_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x32')]+=0x1;}_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2d')]+=moment(_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x5e')])[_0xfb7c('0x5f')](moment(_0x2415dc[_0x27ccef][_0x4cbf92]['queuecallerjoinAt']),_0xfb7c('0x60'))||0x0;if(_0x4cbf92===_0x2415dc[_0x27ccef][_0xfb7c('0x43')]-0x1){_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2e')]+=moment(_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x61')]||_0x2415dc[_0x27ccef][_0x4cbf92]['queuecallerabandonAt']||_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x62')])[_0xfb7c('0x5f')](moment(_0x2415dc[_0x27ccef][_0x4cbf92]['queuecallerjoinAt']),'seconds')||0x0;_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2b')]+=0x1;if(_0x2415dc[_0x27ccef][_0x4cbf92]['queuecallercomplete']){_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2c')]+=0x1;_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x33')]+=moment(_0x2415dc[_0x27ccef][_0x4cbf92]['queuecallercompleteAt'])[_0xfb7c('0x5f')](moment(_0x2415dc[_0x27ccef][_0x4cbf92][_0xfb7c('0x5e')]),_0xfb7c('0x60'))||0x0;}}else{_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2e')]+=_0xffedd5[_0xfb7c('0x13')][_0xf41625][_0xfb7c('0x2d')]||0x0;}}}}}}return _0xffedd5['voiceQueues'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x63')]=function(){var _0x3e3d8a=this;return function(_0x3a431b){clearVoiceCallReports(_0x3e3d8a['outbound']);if(_0x3a431b){for(var _0x34d490=0x0;_0x34d490<_0x3a431b[_0xfb7c('0x43')];_0x34d490+=0x1){_0x3e3d8a['outbound'][_0xfb7c('0x2b')]+=0x1;_0x3e3d8a['outbound'][_0xfb7c('0x2e')]+=_0x3a431b[_0x34d490]['duration'];if(_0x3a431b[_0x34d490][_0xfb7c('0x64')]===_0xfb7c('0x65')){_0x3e3d8a[_0xfb7c('0x15')][_0xfb7c('0x2c')]+=0x1;_0x3e3d8a[_0xfb7c('0x15')][_0xfb7c('0x2d')]+=_0x3a431b[_0x34d490][_0xfb7c('0x66')]-_0x3a431b[_0x34d490][_0xfb7c('0x67')]||0x0;_0x3e3d8a['outbound'][_0xfb7c('0x33')]+=_0x3a431b[_0x34d490][_0xfb7c('0x67')];}}}return _0x3e3d8a['outbound'];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x68')]=function(){var _0x325e48=this;return function(_0x32358e){if(_0x32358e){freeIsNotKey(_0x32358e,_0x325e48[_0xfb7c('0x69')],'name');for(var _0x3bc015=0x0,_0x22968a={};_0x3bc015<_0x32358e[_0xfb7c('0x43')];_0x3bc015+=0x1){_0x22968a=_0x32358e[_0x3bc015];if(_[_0xfb7c('0x44')](_0x325e48['campaigns'][_0x22968a['name']])){_0x325e48[_0xfb7c('0x69')][_0x22968a[_0xfb7c('0x28')]]=new Campaign(_0x22968a);}else{_0x325e48[_0xfb7c('0x41')](_0x325e48['campaigns'][_0x22968a[_0xfb7c('0x28')]],_0x22968a);_0x325e48[_0xfb7c('0x69')][_0x22968a['name']][_0xfb7c('0x6a')]=_0x22968a[_0xfb7c('0x6b')]?_0x22968a['SquareProject'][_0xfb7c('0x28')]:undefined;}}}return _0x325e48[_0xfb7c('0x69')];};};Realtime[_0xfb7c('0x40')]['initVoiceExtensions']=function(){var _0x20dd98=this;return function(_0x2f5afe){if(_0x2f5afe){freeIsNotKey(_0x2f5afe,_0x20dd98[_0xfb7c('0x16')],'id');for(var _0x391279=0x0,_0x42e8bf={};_0x391279<_0x2f5afe[_0xfb7c('0x43')];_0x391279+=0x1){_0x42e8bf=_0x2f5afe[_0x391279];if(_[_0xfb7c('0x44')](_0x20dd98[_0xfb7c('0x16')][_0x42e8bf['id']])){_0x20dd98[_0xfb7c('0x16')][_0x42e8bf['id']]=new VoiceExtension(_0x42e8bf);}else{_0x20dd98['mergeFromDatabase'](_0x20dd98[_0xfb7c('0x16')][_0x42e8bf['id']],_0x42e8bf);}}}return _0x20dd98['voiceExtensions'];};};Realtime[_0xfb7c('0x40')]['initCampaignHopperHistory']=function(){var _0x1ffcc5=this;return function(_0xfb2d1){clearCampaigns(_0x1ffcc5[_0xfb7c('0x69')]);for(var _0x450dd6=0x0;_0x450dd6<_0xfb2d1['length'];_0x450dd6+=0x1){_[_0xfb7c('0x6c')](_0x1ffcc5['campaigns'][_0xfb2d1[_0x450dd6]['name']],_0xfb2d1[_0x450dd6]);}return _0x1ffcc5[_0xfb7c('0x69')];};};Realtime[_0xfb7c('0x40')][_0xfb7c('0x6d')]=function(){var _0x523b7e=this;return function(_0x51095b){if(_0x51095b){freeIsNotKey(_0x51095b,_0x523b7e[_0xfb7c('0x24')],'id');for(var _0x458b49=0x0,_0x1c289e={},_0x3e0099={};_0x458b49<_0x51095b[_0xfb7c('0x43')];_0x458b49+=0x1){_0x1c289e=_0x51095b[_0x458b49];if(_[_0xfb7c('0x44')](_0x523b7e[_0xfb7c('0x24')][_0x1c289e['id']])){_0x523b7e[_0xfb7c('0x24')][_0x1c289e['id']]=new FaxAccount(_0x1c289e);}else{_0x523b7e['mergeFromDatabase'](_0x523b7e[_0xfb7c('0x24')][_0x1c289e['id']],_0x1c289e);}}}return _0x523b7e[_0xfb7c('0x24')];};};module[_0xfb7c('0x6e')]=Realtime;
\ No newline at end of file
+var _0x9539=['initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','../model/agent','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','agents','telephones','trunks','triggers','outbound','voiceExtensions','channels','outboundChannels','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','isNil','format','interface','total','sumBillable','ivrTotalCallsDays','isEmpty','answered','unmanaged','abandoned','sumHoldTime','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','name','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0x9539,0xf0));var _0x9953=function(_0x586637,_0x13439b){_0x586637=_0x586637-0x0;var _0x54bea8=_0x9539[_0x586637];return _0x54bea8;};'use strict';var BPromise=require(_0x9953('0x0'));var util=require(_0x9953('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x9953('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x9953('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x9953('0x4'));var Template=require('../model/template');var Campaign=require(_0x9953('0x5'));var VoiceExtension=require(_0x9953('0x6'));var ZendeskAccount=require(_0x9953('0x7'));var SalesforceAccount=require(_0x9953('0x8'));var FreshdeskAccount=require(_0x9953('0x9'));var SugarcrmAccount=require(_0x9953('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x9953('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x9953('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x9953('0xd')]={};this[_0x9953('0xe')]={};this[_0x9953('0xf')]={};this['voiceQueues']={};this[_0x9953('0x10')]={};this['campaigns']={};this['templates']={};this[_0x9953('0x11')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9953('0x12')]={};this[_0x9953('0x13')]={};this['queueChannels']={};this[_0x9953('0x14')]={};this['timers']={};this[_0x9953('0x15')]={};this[_0x9953('0x16')]={};this['salesforceAccounts']={};this[_0x9953('0x17')]={};this[_0x9953('0x18')]={};this[_0x9953('0x19')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x9953('0x1a')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0x9953('0x1b')]={};};function freeIsNotKey(_0x460feb,_0x37a029,_0x1194cc){var _0x388812=_[_0x9953('0x1c')](_0x460feb,function(_0x36db3a,_0x52fef6){return _0x36db3a[_0x1194cc];});for(var _0x1d1887 in _0x37a029){if(_0x37a029[_0x9953('0x1d')](_0x1d1887)){if(!_0x388812[_0x1d1887]){delete _0x37a029[_0x1d1887];}}}}function freeIsNotKeySip(_0x29bee2,_0x2dbd0a){var _0x174278=_['mapKeys'](_0x29bee2,function(_0x15340c,_0x170c6d){return util['format'](_0x9953('0x1e'),_0x15340c['name']);});for(var _0x5967c2 in _0x2dbd0a){if(_0x2dbd0a[_0x9953('0x1d')](_0x5967c2)){if(!_0x174278[_0x5967c2]){delete _0x2dbd0a[_0x5967c2];}}}}function freeIsNotKeyAgent(_0x2a2b9e,_0x4f25f8){var _0x43912c=_[_0x9953('0x1c')](_0x2a2b9e,function(_0x20efda,_0x1c400d){var _0x4b0250=_[_0x9953('0x1f')](_0x20efda['interface'])?util[_0x9953('0x20')](_0x9953('0x1e'),_0x20efda['name']):_0x20efda[_0x9953('0x21')];return _0x4b0250;});for(var _0x306463 in _0x4f25f8){if(_0x4f25f8[_0x9953('0x1d')](_0x306463)){if(!_0x43912c[_0x306463]){delete _0x4f25f8[_0x306463];}}}}function clearVoiceCallReports(_0x40dfd9){_0x40dfd9[_0x9953('0x22')]=0x0;_0x40dfd9['answered']=0x0;_0x40dfd9['sumHoldTime']=0x0;_0x40dfd9['sumDuration']=0x0;_0x40dfd9[_0x9953('0x23')]=0x0;}function clearCampaigns(_0x2e4764){if(!_['isEmpty'](_0x2e4764)){for(var _0x4b1df7 in _0x2e4764){if(_0x2e4764['hasOwnProperty'](_0x4b1df7)){_0x2e4764[_0x4b1df7][_0x9953('0x24')]=0x0;_0x2e4764[_0x4b1df7]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4ac31d){if(!_[_0x9953('0x25')](_0x4ac31d)){for(var _0x4f2a38 in _0x4ac31d){if(_0x4ac31d[_0x9953('0x1d')](_0x4f2a38)){_0x4ac31d[_0x4f2a38]['total']=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x26')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x27')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x28')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x29')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2a')]=0x0;_0x4ac31d[_0x4f2a38]['sumBillable']=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2b')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2c')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2d')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2e')]=0x0;_0x4ac31d[_0x4f2a38]['outboundNoSuchCallsDay']=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2f')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x30')]=0x0;_0x4ac31d[_0x4f2a38]['outboundDropCallsDayCallersExit']=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x31')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x32')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x33')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x34')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x2b')]=0x0;_0x4ac31d[_0x4f2a38][_0x9953('0x35')]=0x0;_0x4ac31d[_0x4f2a38]['queueStatusComplete']=!![];}}}}Realtime[_0x9953('0x36')][_0x9953('0x37')]=function(_0x452713,_0x4fef4c){for(var _0x3774ee in _0x4fef4c){if(_0x452713[_0x9953('0x1d')](_0x3774ee)){_0x452713[_0x3774ee]=_0x4fef4c[_0x3774ee];}}};Realtime[_0x9953('0x36')][_0x9953('0x38')]=function(){var _0x15e401=this;return function(_0x1555b4){if(_0x1555b4){freeIsNotKeyAgent(_0x1555b4,_0x15e401[_0x9953('0xd')]);for(var _0x2c7b42=0x0,_0x5c6df3={},_0x1b7398={};_0x2c7b42<_0x1555b4['length'];_0x2c7b42+=0x1){_0x5c6df3=_0x1555b4[_0x2c7b42];var _0xa47c09=_[_0x9953('0x1f')](_0x5c6df3['interface'])?util[_0x9953('0x20')]('SIP/%s',_0x5c6df3['name']):_0x5c6df3[_0x9953('0x21')];if(_[_0x9953('0x39')](_0x15e401[_0x9953('0xd')][_0xa47c09])){_0x15e401[_0x9953('0xd')][_0xa47c09]=new Agent(_0x5c6df3);}else{_0x15e401[_0x9953('0x37')](_0x15e401[_0x9953('0xd')][_0xa47c09],_0x5c6df3);}}}return _0x15e401[_0x9953('0xd')];};};Realtime[_0x9953('0x36')][_0x9953('0x3a')]=function(){var _0x5dc832=this;return function(_0x372fb3){if(_0x372fb3){freeIsNotKeySip(_0x372fb3,_0x5dc832[_0x9953('0xe')]);for(var _0x189a21=0x0,_0x2ecda9={},_0x1c237e={};_0x189a21<_0x372fb3[_0x9953('0x3b')];_0x189a21+=0x1){_0x2ecda9=_0x372fb3[_0x189a21];if(_['isUndefined'](_0x5dc832[_0x9953('0xe')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x2ecda9[_0x9953('0x3c')])])){_0x5dc832[_0x9953('0xe')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x2ecda9[_0x9953('0x3c')])]=new Telephone(_0x2ecda9);}else{_0x5dc832['mergeFromDatabase'](_0x5dc832[_0x9953('0xe')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x2ecda9[_0x9953('0x3c')])],_0x2ecda9);}}}return _0x5dc832[_0x9953('0xe')];};};Realtime[_0x9953('0x36')][_0x9953('0x3d')]=function(){var _0x4ec02b=this;return function(_0x3f7437){if(_0x3f7437){freeIsNotKeySip(_0x3f7437,_0x4ec02b[_0x9953('0xf')]);for(var _0x2b0a03=0x0,_0x1cb7cc={},_0x1c4e6f={};_0x2b0a03<_0x3f7437['length'];_0x2b0a03+=0x1){_0x1cb7cc=_0x3f7437[_0x2b0a03];if(_[_0x9953('0x39')](_0x4ec02b[_0x9953('0xf')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x1cb7cc[_0x9953('0x3c')])])){_0x4ec02b[_0x9953('0xf')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x1cb7cc[_0x9953('0x3c')])]=new Trunk(_0x1cb7cc);}else{_0x4ec02b[_0x9953('0x37')](_0x4ec02b[_0x9953('0xf')][util[_0x9953('0x20')](_0x9953('0x1e'),_0x1cb7cc[_0x9953('0x3c')])],_0x1cb7cc);}}}return _0x4ec02b[_0x9953('0xf')];};};Realtime[_0x9953('0x36')][_0x9953('0x3e')]=function(){var _0x1d8020=this;return function(_0x34b721){if(_0x34b721){freeIsNotKey(_0x34b721,_0x1d8020[_0x9953('0x3f')],_0x9953('0x3c'));for(var _0x21bb93=0x0,_0x32f987={},_0x27d26a={};_0x21bb93<_0x34b721[_0x9953('0x3b')];_0x21bb93+=0x1){_0x32f987=_0x34b721[_0x21bb93];if(_['isUndefined'](_0x1d8020[_0x9953('0x3f')][_0x32f987['name']])){_0x1d8020[_0x9953('0x3f')][_0x32f987[_0x9953('0x3c')]]=new VoiceQueue(_0x32f987);}else{_0x1d8020[_0x9953('0x37')](_0x1d8020[_0x9953('0x3f')][_0x32f987[_0x9953('0x3c')]],_0x32f987);}}}return _0x1d8020[_0x9953('0x3f')];};};Realtime[_0x9953('0x36')][_0x9953('0x40')]=function(){var _0x2a60d5=this;return function(_0x4bc191){if(_0x4bc191){freeIsNotKey(_0x4bc191,_0x2a60d5[_0x9953('0x10')],'id');for(var _0x2c2c56=0x0,_0x17be48={},_0x505385={};_0x2c2c56<_0x4bc191['length'];_0x2c2c56+=0x1){_0x17be48=_0x4bc191[_0x2c2c56];if(_[_0x9953('0x39')](_0x2a60d5[_0x9953('0x10')][_0x17be48['id']])){_0x2a60d5[_0x9953('0x10')][_0x17be48['id']]=new Trigger(_0x17be48);}else{_0x2a60d5[_0x9953('0x37')](_0x2a60d5['triggers'][_0x17be48['id']],_0x17be48);}}}return _0x2a60d5['triggers'];};};Realtime[_0x9953('0x36')][_0x9953('0x41')]=function(){var _0x57371e=this;return function(_0x5399da){if(_0x5399da){freeIsNotKey(_0x5399da,_0x57371e[_0x9953('0x42')],'id');for(var _0x486488=0x0,_0x45fa3e={},_0x445c4b={};_0x486488<_0x5399da[_0x9953('0x3b')];_0x486488+=0x1){_0x45fa3e=_0x5399da[_0x486488];if(_[_0x9953('0x39')](_0x57371e[_0x9953('0x42')][_0x45fa3e['id']])){_0x57371e[_0x9953('0x42')][_0x45fa3e['id']]=new Template(_0x45fa3e);}else{_0x57371e[_0x9953('0x37')](_0x57371e[_0x9953('0x42')][_0x45fa3e['id']],_0x45fa3e);}}}return _0x57371e[_0x9953('0x42')];};};Realtime['prototype'][_0x9953('0x43')]=function(){var _0x57e2b6=this;return function(_0x5a1c06){if(_0x5a1c06){freeIsNotKey(_0x5a1c06,_0x57e2b6[_0x9953('0x16')],'id');for(var _0x35dfd4=0x0,_0x58e918={},_0x5a0295={};_0x35dfd4<_0x5a1c06[_0x9953('0x3b')];_0x35dfd4+=0x1){_0x58e918=_0x5a1c06[_0x35dfd4];if(_['isUndefined'](_0x57e2b6[_0x9953('0x16')][_0x58e918['id']])){_0x57e2b6[_0x9953('0x16')][_0x58e918['id']]=new ZendeskAccount(_0x58e918);}else{_0x57e2b6[_0x9953('0x37')](_0x57e2b6[_0x9953('0x16')][_0x58e918['id']],_0x58e918);}}}return _0x57e2b6[_0x9953('0x16')];};};Realtime['prototype'][_0x9953('0x44')]=function(){var _0x4c5055=this;return function(_0x3f682c){if(_0x3f682c){freeIsNotKey(_0x3f682c,_0x4c5055[_0x9953('0x45')],'id');for(var _0x3a95bf=0x0,_0xe14ed={},_0x2ccf37={};_0x3a95bf<_0x3f682c[_0x9953('0x3b')];_0x3a95bf+=0x1){_0xe14ed=_0x3f682c[_0x3a95bf];if(_[_0x9953('0x39')](_0x4c5055[_0x9953('0x45')][_0xe14ed['id']])){_0x4c5055['salesforceAccounts'][_0xe14ed['id']]=new SalesforceAccount(_0xe14ed);}else{_0x4c5055[_0x9953('0x37')](_0x4c5055[_0x9953('0x45')][_0xe14ed['id']],_0xe14ed);}}}return _0x4c5055[_0x9953('0x45')];};};Realtime[_0x9953('0x36')]['initFreshdeskAccounts']=function(){var _0x2a91c6=this;return function(_0x254866){if(_0x254866){freeIsNotKey(_0x254866,_0x2a91c6[_0x9953('0x18')],'id');for(var _0x3a9fdb=0x0,_0x393042={},_0x47faca={};_0x3a9fdb<_0x254866[_0x9953('0x3b')];_0x3a9fdb+=0x1){_0x393042=_0x254866[_0x3a9fdb];if(_[_0x9953('0x39')](_0x2a91c6['freshdeskAccounts'][_0x393042['id']])){_0x2a91c6[_0x9953('0x18')][_0x393042['id']]=new FreshdeskAccount(_0x393042);}else{_0x2a91c6[_0x9953('0x37')](_0x2a91c6[_0x9953('0x18')][_0x393042['id']],_0x393042);}}}return _0x2a91c6['freshdeskAccounts'];};};Realtime[_0x9953('0x36')][_0x9953('0x46')]=function(){var _0x955739=this;return function(_0x3d070f){if(_0x3d070f){freeIsNotKey(_0x3d070f,_0x955739['zohoAccounts'],'id');for(var _0x9370e9=0x0,_0x22b401={},_0xf0207e={};_0x9370e9<_0x3d070f[_0x9953('0x3b')];_0x9370e9+=0x1){_0x22b401=_0x3d070f[_0x9370e9];if(_[_0x9953('0x39')](_0x955739[_0x9953('0x19')][_0x22b401['id']])){_0x955739[_0x9953('0x19')][_0x22b401['id']]=new ZohoAccount(_0x22b401);}else{_0x955739[_0x9953('0x37')](_0x955739[_0x9953('0x19')][_0x22b401['id']],_0x22b401);}}}return _0x955739[_0x9953('0x19')];};};Realtime['prototype'][_0x9953('0x47')]=function(){var _0x329623=this;return function(_0x4d053e){if(_0x4d053e){freeIsNotKey(_0x4d053e,_0x329623[_0x9953('0x48')],'id');for(var _0x58497a=0x0,_0xa6d599={},_0x1b2783={};_0x58497a<_0x4d053e[_0x9953('0x3b')];_0x58497a+=0x1){_0xa6d599=_0x4d053e[_0x58497a];if(_['isUndefined'](_0x329623['deskAccounts'][_0xa6d599['id']])){_0x329623['deskAccounts'][_0xa6d599['id']]=new DeskAccount(_0xa6d599);}else{_0x329623[_0x9953('0x37')](_0x329623['deskAccounts'][_0xa6d599['id']],_0xa6d599);}}}return _0x329623['deskAccounts'];};};Realtime[_0x9953('0x36')][_0x9953('0x49')]=function(){var _0x4f85f4=this;return function(_0x3ae613){if(_0x3ae613){freeIsNotKey(_0x3ae613,_0x4f85f4[_0x9953('0x17')],'id');for(var _0x232252=0x0,_0x2c7fa4={},_0x1ce68e={};_0x232252<_0x3ae613['length'];_0x232252+=0x1){_0x2c7fa4=_0x3ae613[_0x232252];if(_[_0x9953('0x39')](_0x4f85f4[_0x9953('0x17')][_0x2c7fa4['id']])){_0x4f85f4['sugarcrmAccounts'][_0x2c7fa4['id']]=new SugarcrmAccount(_0x2c7fa4);}else{_0x4f85f4[_0x9953('0x37')](_0x4f85f4['sugarcrmAccounts'][_0x2c7fa4['id']],_0x2c7fa4);}}}return _0x4f85f4[_0x9953('0x17')];};};Realtime[_0x9953('0x36')][_0x9953('0x4a')]=function(){var _0x6339e0=this;return function(_0x36deb1){if(_0x36deb1){freeIsNotKey(_0x36deb1,_0x6339e0[_0x9953('0x4b')],'id');for(var _0x4370cf=0x0,_0x3a2788={},_0x36cab6={};_0x4370cf<_0x36deb1['length'];_0x4370cf+=0x1){_0x3a2788=_0x36deb1[_0x4370cf];if(_['isUndefined'](_0x6339e0[_0x9953('0x4b')][_0x3a2788['id']])){_0x6339e0[_0x9953('0x4b')][_0x3a2788['id']]=new VtigerAccount(_0x3a2788);}else{_0x6339e0[_0x9953('0x37')](_0x6339e0[_0x9953('0x4b')][_0x3a2788['id']],_0x3a2788);}}}return _0x6339e0['vtigerAccounts'];};};Realtime[_0x9953('0x36')][_0x9953('0x4c')]=function(){var _0x563407=this;return function(_0x36089c){if(_0x36089c){freeIsNotKey(_0x36089c,_0x563407[_0x9953('0x1a')],'id');for(var _0x4254fc=0x0,_0x49da29={},_0x130922={};_0x4254fc<_0x36089c[_0x9953('0x3b')];_0x4254fc+=0x1){_0x49da29=_0x36089c[_0x4254fc];if(_[_0x9953('0x39')](_0x563407[_0x9953('0x1a')][_0x49da29['id']])){_0x563407['servicenowAccounts'][_0x49da29['id']]=new ServicenowAccount(_0x49da29);}else{_0x563407[_0x9953('0x37')](_0x563407[_0x9953('0x1a')][_0x49da29['id']],_0x49da29);}}}return _0x563407['servicenowAccounts'];};};Realtime['prototype'][_0x9953('0x4d')]=function(){var _0x678d4f=this;return function(_0x43c733){if(_0x43c733){freeIsNotKey(_0x43c733,_0x678d4f[_0x9953('0x4e')],'id');for(var _0x1df297=0x0,_0x3b3537={},_0xad841={};_0x1df297<_0x43c733[_0x9953('0x3b')];_0x1df297+=0x1){_0x3b3537=_0x43c733[_0x1df297];if(_[_0x9953('0x39')](_0x678d4f[_0x9953('0x4e')][_0x3b3537['id']])){_0x678d4f[_0x9953('0x4e')][_0x3b3537['id']]=new Dynamics365Account(_0x3b3537);}else{_0x678d4f['mergeFromDatabase'](_0x678d4f[_0x9953('0x4e')][_0x3b3537['id']],_0x3b3537);}}}return _0x678d4f[_0x9953('0x4e')];};};Realtime[_0x9953('0x36')][_0x9953('0x4f')]=function(){var _0xc38f7b=this;return function(_0x4384be){if(_0x4384be){freeIsNotKey(_0x4384be,_0xc38f7b[_0x9953('0x50')],'id');for(var _0x4988f3=0x0,_0x1b190f={},_0x184d0f={};_0x4988f3<_0x4384be[_0x9953('0x3b')];_0x4988f3+=0x1){_0x1b190f=_0x4384be[_0x4988f3];if(_['isUndefined'](_0xc38f7b[_0x9953('0x50')][_0x1b190f['id']])){_0xc38f7b[_0x9953('0x50')][_0x1b190f['id']]=new FreshsalesAccount(_0x1b190f);}else{_0xc38f7b[_0x9953('0x37')](_0xc38f7b[_0x9953('0x50')][_0x1b190f['id']],_0x1b190f);}}}return _0xc38f7b[_0x9953('0x50')];};};Realtime[_0x9953('0x36')][_0x9953('0x51')]=function(){var _0x5caf27=this;return function(_0x4995da){for(var _0x41e9a3=0x0;_0x41e9a3<_0x4995da[_0x9953('0x3b')];_0x41e9a3+=0x1){_[_0x9953('0x52')](_0x5caf27[_0x9953('0x3f')][_0x4995da[_0x41e9a3][_0x9953('0x3c')]],_0x4995da[_0x41e9a3]);}return _0x5caf27['voiceQueues'];};};Realtime[_0x9953('0x36')][_0x9953('0x53')]=function(){var _0x32eb61=this;return function(_0x2b6ff7){clearVoiceQueues(_0x32eb61[_0x9953('0x3f')]);if(_0x2b6ff7){_0x2b6ff7=_[_0x9953('0x54')](_0x2b6ff7,_0x9953('0x55'));for(var _0xd4cfe7 in _0x2b6ff7){if(_0x2b6ff7[_0x9953('0x1d')](_0xd4cfe7)){var _0x1b55b8={};for(var _0x565c30=0x0;_0x565c30<_0x2b6ff7[_0xd4cfe7][_0x9953('0x3b')];_0x565c30+=0x1){var _0xf402a=_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x56')];if(_0x32eb61[_0x9953('0x3f')][_0xf402a]){if(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x57')]){_0x32eb61[_0x9953('0x3f')][_0xf402a][_0x9953('0x27')]+=0x1;}if(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x58')]){_0x32eb61[_0x9953('0x3f')][_0xf402a][_0x9953('0x28')]+=0x1;}_0x32eb61[_0x9953('0x3f')][_0xf402a]['sumHoldTime']+=moment(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x59')])[_0x9953('0x5a')](moment(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x5b')]),_0x9953('0x5c'))||0x0;if(_0x565c30===_0x2b6ff7[_0xd4cfe7]['length']-0x1){_0x32eb61['voiceQueues'][_0xf402a]['sumDuration']+=moment(_0x2b6ff7[_0xd4cfe7][_0x565c30]['queuecallercompleteAt']||_0x2b6ff7[_0xd4cfe7][_0x565c30]['queuecallerabandonAt']||_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x5d')])[_0x9953('0x5a')](moment(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x5b')]),_0x9953('0x5c'))||0x0;_0x32eb61[_0x9953('0x3f')][_0xf402a]['total']+=0x1;if(_0x2b6ff7[_0xd4cfe7][_0x565c30]['queuecallercomplete']){_0x32eb61['voiceQueues'][_0xf402a][_0x9953('0x26')]+=0x1;_0x32eb61['voiceQueues'][_0xf402a][_0x9953('0x23')]+=moment(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x5e')])[_0x9953('0x5a')](moment(_0x2b6ff7[_0xd4cfe7][_0x565c30][_0x9953('0x59')]),'seconds')||0x0;}}else{_0x32eb61[_0x9953('0x3f')][_0xf402a][_0x9953('0x2a')]+=_0x32eb61['voiceQueues'][_0xf402a]['sumHoldTime']||0x0;}}}}}}return _0x32eb61[_0x9953('0x3f')];};};Realtime[_0x9953('0x36')][_0x9953('0x5f')]=function(){var _0x23476d=this;return function(_0x520e8f){clearVoiceCallReports(_0x23476d[_0x9953('0x11')]);if(_0x520e8f){for(var _0x53fca7=0x0;_0x53fca7<_0x520e8f[_0x9953('0x3b')];_0x53fca7+=0x1){_0x23476d[_0x9953('0x11')][_0x9953('0x22')]+=0x1;_0x23476d[_0x9953('0x11')][_0x9953('0x2a')]+=_0x520e8f[_0x53fca7]['duration'];if(_0x520e8f[_0x53fca7][_0x9953('0x60')]===_0x9953('0x61')){_0x23476d[_0x9953('0x11')][_0x9953('0x26')]+=0x1;_0x23476d['outbound'][_0x9953('0x29')]+=_0x520e8f[_0x53fca7][_0x9953('0x62')]-_0x520e8f[_0x53fca7][_0x9953('0x63')]||0x0;_0x23476d['outbound'][_0x9953('0x23')]+=_0x520e8f[_0x53fca7]['billableseconds'];}}}return _0x23476d[_0x9953('0x11')];};};Realtime['prototype'][_0x9953('0x64')]=function(){var _0x32a978=this;return function(_0x1155a7){if(_0x1155a7){freeIsNotKey(_0x1155a7,_0x32a978['campaigns'],_0x9953('0x3c'));for(var _0x24661b=0x0,_0x31d679={};_0x24661b<_0x1155a7[_0x9953('0x3b')];_0x24661b+=0x1){_0x31d679=_0x1155a7[_0x24661b];if(_['isUndefined'](_0x32a978['campaigns'][_0x31d679[_0x9953('0x3c')]])){_0x32a978[_0x9953('0x65')][_0x31d679[_0x9953('0x3c')]]=new Campaign(_0x31d679);}else{_0x32a978[_0x9953('0x37')](_0x32a978[_0x9953('0x65')][_0x31d679[_0x9953('0x3c')]],_0x31d679);_0x32a978[_0x9953('0x65')][_0x31d679[_0x9953('0x3c')]][_0x9953('0x66')]=_0x31d679[_0x9953('0x67')]?_0x31d679[_0x9953('0x67')]['name']:undefined;}}}return _0x32a978[_0x9953('0x65')];};};Realtime[_0x9953('0x36')]['initVoiceExtensions']=function(){var _0x3cf390=this;return function(_0x2dc92e){if(_0x2dc92e){freeIsNotKey(_0x2dc92e,_0x3cf390['voiceExtensions'],'id');for(var _0x26a733=0x0,_0x4d826d={};_0x26a733<_0x2dc92e[_0x9953('0x3b')];_0x26a733+=0x1){_0x4d826d=_0x2dc92e[_0x26a733];if(_[_0x9953('0x39')](_0x3cf390[_0x9953('0x12')][_0x4d826d['id']])){_0x3cf390[_0x9953('0x12')][_0x4d826d['id']]=new VoiceExtension(_0x4d826d);}else{_0x3cf390['mergeFromDatabase'](_0x3cf390[_0x9953('0x12')][_0x4d826d['id']],_0x4d826d);}}}return _0x3cf390[_0x9953('0x12')];};};Realtime[_0x9953('0x36')][_0x9953('0x68')]=function(){var _0x326624=this;return function(_0x236314){clearCampaigns(_0x326624['campaigns']);for(var _0x319246=0x0;_0x319246<_0x236314['length'];_0x319246+=0x1){_[_0x9953('0x52')](_0x326624[_0x9953('0x65')][_0x236314[_0x319246][_0x9953('0x3c')]],_0x236314[_0x319246]);}return _0x326624[_0x9953('0x65')];};};Realtime['prototype'][_0x9953('0x69')]=function(){var _0x19d569=this;return function(_0x5ede59){if(_0x5ede59){freeIsNotKey(_0x5ede59,_0x19d569['faxAccounts'],'id');for(var _0xae4cc3=0x0,_0x2804ff={},_0x5c41ac={};_0xae4cc3<_0x5ede59['length'];_0xae4cc3+=0x1){_0x2804ff=_0x5ede59[_0xae4cc3];if(_[_0x9953('0x39')](_0x19d569[_0x9953('0x1b')][_0x2804ff['id']])){_0x19d569['faxAccounts'][_0x2804ff['id']]=new FaxAccount(_0x2804ff);}else{_0x19d569[_0x9953('0x37')](_0x19d569[_0x9953('0x1b')][_0x2804ff['id']],_0x2804ff);}}}return _0x19d569['faxAccounts'];};};module[_0x9953('0x6a')]=Realtime;
\ No newline at end of file
index ebc053d..f56cd90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98fa=['type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','destination','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','Local','indexOf','mobile','phone','lastIndexOf','voiceDialReport','attendedTransfer','exports','lodash','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','findAgent','accountcode','isNil','find','name','agents','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','exten'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x98fa,0x7e));var _0xa98f=function(_0x52c517,_0x27ae31){_0x52c517=_0x52c517-0x0;var _0x1bea8c=_0x98fa[_0x52c517];return _0x1bea8c;};'use strict';var _=require(_0xa98f('0x0'));var moment=require('moment');var util=require('util');var config=require('../../../config/environment');var ami=require(_0xa98f('0x1'));var RpcVoiceAgentReport=require(_0xa98f('0x2'));var RpcVoiceCallReport=require(_0xa98f('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xa98f('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa98f('0x5'));var RpcVoiceTransferReport=require(_0xa98f('0x6'));var VoiceQueueReport=require(_0xa98f('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa98f('0x8'));var VoiceDialReport=require(_0xa98f('0x9'));var UserReport=require(_0xa98f('0xa'));function Report(_0x53a80a){this[_0xa98f('0xb')]=_0x53a80a;this['agents']=_0x53a80a['agents'];this['telephones']=_0x53a80a[_0xa98f('0xc')];}Report[_0xa98f('0xd')][_0xa98f('0xe')]=function(_0x256456){var _0x3a83a9=new VoiceQueueReport(this[_0xa98f('0xb')]);var _0x2a8317=new VoiceAgentReport(this[_0xa98f('0xb')]);var _0x530e5b=new VoiceDialReport(this[_0xa98f('0xb')]);var _0xa2d0d5=new VoiceCallReport(this[_0xa98f('0xb')]);var _0xfc8691=new UserReport(this[_0xa98f('0xb')]);if(config[_0xa98f('0xf')]&&config[_0xa98f('0xf')][_0xa98f('0x10')]){ami['on'](_0xa98f('0x11'),this[_0xa98f('0x12')][_0xa98f('0x13')](this));ami['on'](_0xa98f('0x14'),this['voiceCallReport'][_0xa98f('0x13')](this));ami['on'](_0xa98f('0x15'),this[_0xa98f('0x16')]['bind'](this));ami['on'](_0xa98f('0x17'),this['voiceDialReport'][_0xa98f('0x13')](this));ami['on']('blindtransfer',this[_0xa98f('0x18')][_0xa98f('0x13')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0xa98f('0x13')](this));}};Report[_0xa98f('0xd')][_0xa98f('0x19')]=function(_0x308a48){var _0xe1de0a;_0xe1de0a=_['find'](this['agents'],function(_0x2a4f88){return _0x2a4f88[_0xa98f('0x1a')]==_0x308a48||_0x2a4f88['name']==_0x308a48;});if(_[_0xa98f('0x1b')](_0xe1de0a)){var _0x17ca3f=_[_0xa98f('0x1c')](this[_0xa98f('0xc')],function(_0x57164d){return _0x57164d[_0xa98f('0x1a')]==_0x308a48||_0x57164d[_0xa98f('0x1d')]==_0x308a48;});if(_0x17ca3f){_0xe1de0a=_[_0xa98f('0x1c')](this[_0xa98f('0x1e')],function(_0x5af137){return _0x5af137[_0xa98f('0x1f')]==util[_0xa98f('0x20')](_0xa98f('0x21'),_0x17ca3f['name']);});}}return _0xe1de0a;};Report[_0xa98f('0xd')]['voiceQueueReport']=function(_0x54edf7){for(var _0xae3f50=0x0;_0xae3f50<_0x54edf7[_0xa98f('0x22')];_0xae3f50+=0x1){var _0x2a628e=this[_0xa98f('0x19')](_0x54edf7[_0xae3f50][_0xa98f('0x23')]);if(_0x2a628e){_0x54edf7[_0xae3f50]['accountcode']=_0x2a628e['accountcode'];_0x54edf7[_0xae3f50][_0xa98f('0x24')]=!![];_0x54edf7[_0xae3f50]['lastAssignedTo']=_0x2a628e[_0xa98f('0x1d')];_0x54edf7[_0xae3f50]['interface']=_[_0xa98f('0x1b')](_0x2a628e[_0xa98f('0x1f')])?util['format'](_0xa98f('0x21'),_0x2a628e[_0xa98f('0x1d')]):_0x2a628e[_0xa98f('0x1f')];if(_0x54edf7[_0xae3f50][_0xa98f('0x25')]){_0x54edf7[_0xae3f50][_0xa98f('0x26')]=moment()[_0xa98f('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x54edf7[_0xae3f50][_0xa98f('0x27')]){_0x54edf7[_0xae3f50][_0xa98f('0x28')]=moment()['format'](_0xa98f('0x29'));}RpcMemberReport[_0xa98f('0x12')](_0x54edf7[_0xae3f50]);}RpcVoiceQueueReport[_0xa98f('0x2a')](_0x54edf7[_0xae3f50]);}};function extractCalleridNumber(_0x1aa831){var _0x5f4a69=_0x1aa831['match'](/<(.*?)>/);return _0x5f4a69?_0x5f4a69[0x1]:_0x1aa831;}Report['prototype']['voiceCallReport']=function(_0x49af07){_0x49af07['destination']=_0x49af07['destination']||_0x49af07[_0xa98f('0x2b')];if(_0x49af07[_0xa98f('0x2c')]==_0xa98f('0x2d')){_0x49af07[_0xa98f('0x2e')]=_0xa98f('0x2f');_0x49af07['lastdata']=_0x49af07[_0xa98f('0x2f')];if(_0x49af07[_0xa98f('0x30')]==_0xa98f('0x31')){_0x49af07[_0xa98f('0x1a')]='';_0x49af07['destination']=extractCalleridNumber(_0x49af07[_0xa98f('0x32')]);}else if(_0x49af07['context']==_0xa98f('0x33')){if(_0x49af07[_0xa98f('0x34')]==_0xa98f('0x35')){_0x49af07['destination']=extractCalleridNumber(_0x49af07[_0xa98f('0x36')]);_0x49af07[_0xa98f('0x37')]=_0x49af07['originatecalleridnum'];_0x49af07[_0xa98f('0x38')]=[_0x49af07[_0xa98f('0x39')],_0x49af07[_0xa98f('0x39')]=_0x49af07[_0xa98f('0x38')]][0x0];_0x49af07[_0xa98f('0x32')]=_0x49af07['calleridpreview'];}else{_0x49af07['destination']=_0x49af07[_0xa98f('0x37')];_0x49af07[_0xa98f('0x37')]=_0x49af07[_0xa98f('0x3a')];if(_0x49af07[_0xa98f('0x3b')]==_0xa98f('0x3c')){_0x49af07[_0xa98f('0x1a')]=_0x49af07[_0xa98f('0x23')];}else{_0x49af07[_0xa98f('0x1a')]='';}}}}else{_0x49af07[_0xa98f('0x32')]=util[_0xa98f('0x20')](_0xa98f('0x3d'),_0x49af07['calleridname'],_0x49af07['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x49af07[_0xa98f('0x3e')]]){var _0x40bee4=RpcVoiceTransferReport[_0xa98f('0x3f')][_0x49af07[_0xa98f('0x3e')]];_0x40bee4[_0xa98f('0x40')]=_0x49af07[_0xa98f('0x41')];RpcVoiceTransferReport[_0xa98f('0x18')](_0x40bee4);delete RpcVoiceTransferReport['transfers'][_0x49af07[_0xa98f('0x3e')]];}RpcVoiceCallReport[_0xa98f('0x2a')](_0x49af07);if(_0x49af07[_0xa98f('0x42')]){for(var _0x317caa=0x0;_0x317caa<_0x49af07[_0xa98f('0x43')]['length'];_0x317caa+=0x1){_0x49af07[_0xa98f('0x44')]=_0x49af07[_0xa98f('0x43')][_0x317caa][_0xa98f('0x45')];_0x49af07[_0xa98f('0x46')]=_0x49af07[_0xa98f('0x43')][_0x317caa][_0xa98f('0x46')];if(_0x49af07[_0xa98f('0x2b')]==_0xa98f('0x35')){_0x49af07[_0xa98f('0x37')]=_0x49af07['connectedlinenum'];_0x49af07[_0xa98f('0x47')]=_0x49af07[_0xa98f('0x48')];_0x49af07[_0xa98f('0x23')]=_0x49af07[_0xa98f('0x1a')];_0x49af07['connectedlinename']=_0x49af07[_0xa98f('0x49')];_0x49af07['exten']=_0x49af07[_0xa98f('0x3a')];}else if(_0x49af07[_0xa98f('0x2b')]==_0xa98f('0x4a')){_0x49af07['calleridnum']=_0x49af07[_0xa98f('0x34')];_0x49af07[_0xa98f('0x2b')]=_0x49af07[_0xa98f('0x3a')];}RpcVoiceRecording[_0xa98f('0x2a')](_0x49af07);}}};Report[_0xa98f('0xd')][_0xa98f('0x16')]=function(_0x250721){if(_[_0xa98f('0x4b')](_0x250721)){_0x250721['forEach'](function(_0x66dbb4){RpcVoiceAgentReport[_0xa98f('0x2a')](_0x66dbb4);});}else{RpcVoiceAgentReport['create'](_0x250721);}};Report[_0xa98f('0xd')]['voiceDialReport']=function(_0x2a24f6){RpcVoiceDialReport[_0xa98f('0x2a')](_0x2a24f6);var _0x28efdf;var _0x3c6acc;var _0x22edcc=_0x2a24f6[_0xa98f('0x39')];if(_[_0xa98f('0x4c')](_0x22edcc,_0xa98f('0x4d'))){_0x3c6acc=_0x22edcc['substring'](_0x22edcc[_0xa98f('0x4e')]('/')+0x1,_0x22edcc[_0xa98f('0x4e')]('@'));_0x28efdf=_[_0xa98f('0x1c')](this['agents'],function(_0x2d2288){return _0x2d2288[_0xa98f('0x4f')]==_0x3c6acc||_0x2d2288[_0xa98f('0x50')]==_0x3c6acc||_0x2d2288[_0xa98f('0x1a')]==_0x3c6acc;});}else{_0x3c6acc=_0x22edcc['substring'](_0x22edcc['indexOf']('/')+0x1,_0x22edcc[_0xa98f('0x51')]('-'));_0x28efdf=this[_0xa98f('0x19')](_0x3c6acc);}if(_0x28efdf){_0x2a24f6[_0xa98f('0x1f')]=_[_0xa98f('0x1b')](_0x28efdf[_0xa98f('0x1f')])?util[_0xa98f('0x20')](_0xa98f('0x21'),_0x28efdf[_0xa98f('0x1d')]):_0x28efdf[_0xa98f('0x1f')];_0x2a24f6[_0xa98f('0x49')]=_0x28efdf[_0xa98f('0x1d')];_0x2a24f6[_0xa98f('0x1a')]=_0x28efdf[_0xa98f('0x1a')];RpcMemberReport[_0xa98f('0x52')](_0x2a24f6);}};Report['prototype'][_0xa98f('0x18')]=function(_0x58c01f){RpcVoiceTransferReport[_0xa98f('0x3f')][_0x58c01f['transfererlinkedid']]=_0x58c01f;};Report[_0xa98f('0xd')][_0xa98f('0x53')]=function(_0x20f56b){RpcVoiceTransferReport[_0xa98f('0x53')](_0x20f56b);};module[_0xa98f('0x54')]=Report;
\ No newline at end of file
+var _0x9745=['accountcode','name','isNil','find','interface','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','voiceCallReport','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','blindTransfer','attendedtransfer'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x9745,0x140));var _0x5974=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9745[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x5974('0x0'));var moment=require('moment');var util=require(_0x5974('0x1'));var config=require(_0x5974('0x2'));var ami=require(_0x5974('0x3'));var RpcVoiceAgentReport=require(_0x5974('0x4'));var RpcVoiceCallReport=require(_0x5974('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x5974('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x5974('0x7'));var RpcVoiceTransferReport=require(_0x5974('0x8'));var VoiceQueueReport=require(_0x5974('0x9'));var VoiceCallReport=require(_0x5974('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x5974('0xb'));var UserReport=require('./userReport');function Report(_0x24f6ca){this[_0x5974('0xc')]=_0x24f6ca;this[_0x5974('0xd')]=_0x24f6ca[_0x5974('0xd')];this[_0x5974('0xe')]=_0x24f6ca[_0x5974('0xe')];}Report[_0x5974('0xf')]['sync']=function(_0x4f975d){var _0x457bc0=new VoiceQueueReport(this[_0x5974('0xc')]);var _0x4678f2=new VoiceAgentReport(this[_0x5974('0xc')]);var _0x1bb8db=new VoiceDialReport(this['realtime']);var _0x147ff7=new VoiceCallReport(this['realtime']);var _0x1939de=new UserReport(this[_0x5974('0xc')]);if(config[_0x5974('0x10')]&&config['xdr']['disabled']){ami['on']('custom:voiceQueueReport',this[_0x5974('0x11')]['bind'](this));ami['on'](_0x5974('0x12'),this['voiceCallReport'][_0x5974('0x13')](this));ami['on'](_0x5974('0x14'),this[_0x5974('0x15')][_0x5974('0x13')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x5974('0x13')](this));ami['on']('blindtransfer',this[_0x5974('0x16')][_0x5974('0x13')](this));ami['on'](_0x5974('0x17'),this['attendedTransfer'][_0x5974('0x13')](this));}};Report['prototype']['findAgent']=function(_0x49c07c){var _0x503ded;_0x503ded=_['find'](this['agents'],function(_0x1301a1){return _0x1301a1[_0x5974('0x18')]==_0x49c07c||_0x1301a1[_0x5974('0x19')]==_0x49c07c;});if(_[_0x5974('0x1a')](_0x503ded)){var _0x297765=_['find'](this[_0x5974('0xe')],function(_0x3b1cd4){return _0x3b1cd4[_0x5974('0x18')]==_0x49c07c||_0x3b1cd4['name']==_0x49c07c;});if(_0x297765){_0x503ded=_[_0x5974('0x1b')](this[_0x5974('0xd')],function(_0xef038){return _0xef038[_0x5974('0x1c')]==util[_0x5974('0x1d')](_0x5974('0x1e'),_0x297765[_0x5974('0x19')]);});}}return _0x503ded;};Report[_0x5974('0xf')]['voiceQueueReport']=function(_0x278cd1){for(var _0x242a79=0x0;_0x242a79<_0x278cd1[_0x5974('0x1f')];_0x242a79+=0x1){var _0x2972db=this[_0x5974('0x20')](_0x278cd1[_0x242a79][_0x5974('0x21')]);if(_0x2972db){_0x278cd1[_0x242a79][_0x5974('0x18')]=_0x2972db['accountcode'];_0x278cd1[_0x242a79][_0x5974('0x22')]=!![];_0x278cd1[_0x242a79][_0x5974('0x23')]=_0x2972db[_0x5974('0x19')];_0x278cd1[_0x242a79][_0x5974('0x1c')]=_[_0x5974('0x1a')](_0x2972db['interface'])?util[_0x5974('0x1d')](_0x5974('0x1e'),_0x2972db['name']):_0x2972db[_0x5974('0x1c')];if(_0x278cd1[_0x242a79]['queuecallercomplete']){_0x278cd1[_0x242a79]['queuecallercompleteAt']=moment()['format'](_0x5974('0x24'));}if(_0x278cd1[_0x242a79][_0x5974('0x25')]){_0x278cd1[_0x242a79][_0x5974('0x26')]=moment()[_0x5974('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x5974('0x11')](_0x278cd1[_0x242a79]);}RpcVoiceQueueReport['create'](_0x278cd1[_0x242a79]);}};function extractCalleridNumber(_0x2efb15){var _0x361782=_0x2efb15[_0x5974('0x27')](/<(.*?)>/);return _0x361782?_0x361782[0x1]:_0x2efb15;}Report[_0x5974('0xf')][_0x5974('0x28')]=function(_0x24371b){_0x24371b[_0x5974('0x29')]=_0x24371b[_0x5974('0x29')]||_0x24371b[_0x5974('0x2a')];if(_0x24371b['type']==_0x5974('0x2b')){_0x24371b[_0x5974('0x2c')]=_0x5974('0x2d');_0x24371b[_0x5974('0x2e')]=_0x24371b[_0x5974('0x2d')];if(_0x24371b['context']==_0x5974('0x2f')){_0x24371b[_0x5974('0x18')]='';_0x24371b[_0x5974('0x29')]=extractCalleridNumber(_0x24371b['callerid']);}else if(_0x24371b[_0x5974('0x30')]==_0x5974('0x31')){if(_0x24371b[_0x5974('0x29')]==_0x5974('0x32')){_0x24371b[_0x5974('0x29')]=extractCalleridNumber(_0x24371b[_0x5974('0x33')]);_0x24371b[_0x5974('0x34')]=_0x24371b[_0x5974('0x35')];_0x24371b[_0x5974('0x36')]=[_0x24371b['channel'],_0x24371b[_0x5974('0x37')]=_0x24371b[_0x5974('0x36')]][0x0];_0x24371b[_0x5974('0x38')]=_0x24371b[_0x5974('0x33')];}else{_0x24371b[_0x5974('0x29')]=_0x24371b[_0x5974('0x34')];_0x24371b['calleridnum']=_0x24371b[_0x5974('0x35')];if(_0x24371b[_0x5974('0x39')]==_0x5974('0x3a')){_0x24371b[_0x5974('0x18')]=_0x24371b['connectedlinenum'];}else{_0x24371b[_0x5974('0x18')]='';}}}}else{_0x24371b['callerid']=util[_0x5974('0x1d')](_0x5974('0x3b'),_0x24371b[_0x5974('0x3c')],_0x24371b[_0x5974('0x34')]);}if(RpcVoiceTransferReport[_0x5974('0x3d')][_0x24371b[_0x5974('0x3e')]]){var _0x5711eb=RpcVoiceTransferReport[_0x5974('0x3d')][_0x24371b[_0x5974('0x3e')]];_0x5711eb[_0x5974('0x3f')]=_0x24371b[_0x5974('0x40')];RpcVoiceTransferReport[_0x5974('0x16')](_0x5711eb);delete RpcVoiceTransferReport['transfers'][_0x24371b[_0x5974('0x3e')]];}RpcVoiceCallReport[_0x5974('0x41')](_0x24371b);if(_0x24371b[_0x5974('0x42')]){for(var _0x72af59=0x0;_0x72af59<_0x24371b[_0x5974('0x43')][_0x5974('0x1f')];_0x72af59+=0x1){_0x24371b[_0x5974('0x44')]=_0x24371b[_0x5974('0x43')][_0x72af59][_0x5974('0x45')];_0x24371b[_0x5974('0x46')]=_0x24371b[_0x5974('0x43')][_0x72af59]['createdAt'];if(_0x24371b[_0x5974('0x2a')]==_0x5974('0x32')){_0x24371b[_0x5974('0x34')]=_0x24371b[_0x5974('0x21')];_0x24371b[_0x5974('0x3c')]=_0x24371b[_0x5974('0x47')];_0x24371b['connectedlinenum']=_0x24371b[_0x5974('0x18')];_0x24371b['connectedlinename']=_0x24371b[_0x5974('0x48')];_0x24371b['exten']=_0x24371b[_0x5974('0x35')];}else if(_0x24371b[_0x5974('0x2a')]==_0x5974('0x49')){_0x24371b['calleridnum']=_0x24371b[_0x5974('0x29')];_0x24371b[_0x5974('0x2a')]=_0x24371b[_0x5974('0x35')];}RpcVoiceRecording[_0x5974('0x41')](_0x24371b);}}};Report[_0x5974('0xf')][_0x5974('0x15')]=function(_0x4d8413){if(_[_0x5974('0x4a')](_0x4d8413)){_0x4d8413['forEach'](function(_0x43453f){RpcVoiceAgentReport['create'](_0x43453f);});}else{RpcVoiceAgentReport[_0x5974('0x41')](_0x4d8413);}};Report['prototype'][_0x5974('0x4b')]=function(_0x5f8082){RpcVoiceDialReport['create'](_0x5f8082);var _0x57bb71;var _0x4c5bb3;var _0x5572d7=_0x5f8082[_0x5974('0x37')];if(_[_0x5974('0x4c')](_0x5572d7,_0x5974('0x4d'))){_0x4c5bb3=_0x5572d7[_0x5974('0x4e')](_0x5572d7[_0x5974('0x4f')]('/')+0x1,_0x5572d7[_0x5974('0x4f')]('@'));_0x57bb71=_[_0x5974('0x1b')](this['agents'],function(_0xba07d6){return _0xba07d6[_0x5974('0x50')]==_0x4c5bb3||_0xba07d6[_0x5974('0x51')]==_0x4c5bb3||_0xba07d6['accountcode']==_0x4c5bb3;});}else{_0x4c5bb3=_0x5572d7[_0x5974('0x4e')](_0x5572d7[_0x5974('0x4f')]('/')+0x1,_0x5572d7[_0x5974('0x52')]('-'));_0x57bb71=this['findAgent'](_0x4c5bb3);}if(_0x57bb71){_0x5f8082[_0x5974('0x1c')]=_['isNil'](_0x57bb71['interface'])?util[_0x5974('0x1d')](_0x5974('0x1e'),_0x57bb71[_0x5974('0x19')]):_0x57bb71[_0x5974('0x1c')];_0x5f8082[_0x5974('0x48')]=_0x57bb71[_0x5974('0x19')];_0x5f8082[_0x5974('0x18')]=_0x57bb71[_0x5974('0x18')];RpcMemberReport[_0x5974('0x4b')](_0x5f8082);}};Report[_0x5974('0xf')]['blindTransfer']=function(_0x2f29c1){RpcVoiceTransferReport[_0x5974('0x3d')][_0x2f29c1[_0x5974('0x53')]]=_0x2f29c1;};Report[_0x5974('0xf')][_0x5974('0x54')]=function(_0x2c779c){RpcVoiceTransferReport[_0x5974('0x54')](_0x2c779c);};module[_0x5974('0x55')]=Report;
\ No newline at end of file
index de8efbb..0840412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc991=['trunk:save','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','devicestatechange','peerstatus','syncPeerStatus','bind','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','actionDeviceStateList','catch','[userReport][devicestatelist]','inspect','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','omit','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','format','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc991,0x1c4));var _0x1c99=function(_0x72600c,_0x54ea38){_0x72600c=_0x72600c-0x0;var _0x5ffeb2=_0xc991[_0x72600c];return _0x5ffeb2;};'use strict';var _=require('lodash');var moment=require(_0x1c99('0x0'));var util=require(_0x1c99('0x1'));var Redis=require(_0x1c99('0x2'));var BPromise=require('bluebird');var config=require(_0x1c99('0x3'));var logger=require(_0x1c99('0x4'))(_0x1c99('0x5'));var ami=require(_0x1c99('0x6'));config[_0x1c99('0x7')]=_[_0x1c99('0x8')](config[_0x1c99('0x7')],{'host':_0x1c99('0x9'),'port':0x18eb});var io=require(_0x1c99('0xa'))(new Redis(config[_0x1c99('0x7')]));function UserReport(_0xa2c13f){this[_0x1c99('0xb')]=_0xa2c13f[_0x1c99('0xb')];this[_0x1c99('0xc')]=_0xa2c13f[_0x1c99('0xc')];this['telephones']=_0xa2c13f[_0x1c99('0xd')];ami['on'](_0x1c99('0xe'),this[_0x1c99('0xf')]['bind'](this));ami['on']('registry',this['syncRegistry']['bind'](this));ami['on'](_0x1c99('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0x1c99('0x11'),this[_0x1c99('0x12')][_0x1c99('0x13')](this));return this[_0x1c99('0x14')]();}function showSipRegistrations(){Promise[_0x1c99('0x15')]()[_0x1c99('0x16')](ami[_0x1c99('0x17')]())['catch'](function(_0x374fbb){logger[_0x1c99('0x18')](_0x1c99('0x19'),util['inspect'](_0x374fbb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x1c99('0x16')](ami[_0x1c99('0x1a')]())[_0x1c99('0x1b')](function(_0x4f16ca){logger['error'](_0x1c99('0x1c'),util[_0x1c99('0x1d')](_0x4f16ca,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1c99('0x15')]()[_0x1c99('0x16')](ami['actionSipPeerStatus']())['catch'](function(_0x222e0b){logger[_0x1c99('0x18')](_0x1c99('0x1e'),util[_0x1c99('0x1d')](_0x222e0b,{'showHidden':![],'depth':null}));});}UserReport[_0x1c99('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x1c99('0x15')]()[_0x1c99('0x16')](showSipRegistrations())[_0x1c99('0x16')](listDeviceStates())[_0x1c99('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x5431cf){return _0x5431cf!==null&&!_[_0x1c99('0x20')](_0x5431cf);};UserReport[_0x1c99('0x1f')][_0x1c99('0x21')]=function(_0x20a77e,_0x48e665,_0x2a146e){io['to'](_0x20a77e)[_0x1c99('0x21')](_0x48e665,_0x2a146e);};UserReport[_0x1c99('0x1f')][_0x1c99('0xf')]=function(_0x1ff649){try{if(this[_0x1c99('0x22')](_0x1ff649)){logger['info'](_0x1c99('0x23'),_0x1ff649[_0x1c99('0x24')],_0x1ff649[_0x1c99('0x25')]);logger[_0x1c99('0x26')](_0x1c99('0x27'),util['inspect'](_0x1ff649,{'showHidden':![],'depth':null}));var _0xfa745a=_[_0x1c99('0x28')](this[_0x1c99('0xb')],{'defaultuser':_0x1ff649['username']});if(_0xfa745a){_0x1ff649[_0x1c99('0x29')]=_0x1ff649[_0x1c99('0x25')];_['merge'](_0xfa745a,_[_0x1c99('0x2a')](_0x1ff649,['event','actionid','username',_0x1c99('0x25')]));logger[_0x1c99('0x26')](_0x1c99('0x2b'),util[_0x1c99('0x1d')](_0xfa745a,{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',_0xfa745a[_0x1c99('0x2c')]),'trunk:save',_0xfa745a);}}}catch(_0x5cc22e){logger[_0x1c99('0x18')]('[userReport][registry]',util[_0x1c99('0x1d')](_0x5cc22e,{'showHidden':![],'depth':null}));}};UserReport[_0x1c99('0x1f')][_0x1c99('0x2d')]=function(_0x3e9443){try{if(this[_0x1c99('0x22')](_0x3e9443)){logger[_0x1c99('0x2e')](_0x1c99('0x2f'),_0x3e9443[_0x1c99('0x30')],_0x3e9443['state']);logger[_0x1c99('0x26')](_0x1c99('0x31'),util[_0x1c99('0x1d')](_0x3e9443,{'showHidden':![],'depth':null}));if(this['agents'][_0x3e9443[_0x1c99('0x30')]]){if(!this[_0x1c99('0xc')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x32')]||_0x3e9443[_0x1c99('0x25')]['toLowerCase']()==_0x1c99('0x33')){this[_0x1c99('0xc')][_0x3e9443[_0x1c99('0x30')]]['local']=![];if(this[_0x1c99('0xc')][_0x3e9443['device']][_0x1c99('0x25')]!==_0x3e9443['state'][_0x1c99('0x34')]()){this[_0x1c99('0xc')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x35')]=_[_0x1c99('0x36')](moment()['format']('x'));}this[_0x1c99('0xc')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x25')]=_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]();this[_0x1c99('0xc')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x37')](_0x3e9443);}}else if(this[_0x1c99('0xd')][_0x3e9443[_0x1c99('0x30')]]){if(this['telephones'][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x25')]!==_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]()){this[_0x1c99('0xd')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x35')]=_[_0x1c99('0x36')](moment()['format']('x'));}this[_0x1c99('0xd')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x25')]=_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]();logger['debug'](_0x1c99('0x38'),util[_0x1c99('0x1d')](this[_0x1c99('0xd')][_0x3e9443[_0x1c99('0x30')]],{'showHidden':![],'depth':null}));this[_0x1c99('0x21')](util[_0x1c99('0x39')](_0x1c99('0x3a'),this['telephones'][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x2c')]),'telephone:save',this[_0x1c99('0xd')][_0x3e9443[_0x1c99('0x30')]]);}else if(this[_0x1c99('0xb')][_0x3e9443['device']]){if(this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x25')]!==_0x3e9443['state'][_0x1c99('0x34')]()){this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x35')]=_[_0x1c99('0x36')](moment()['format']('x'));}this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]]['state']=_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]();logger[_0x1c99('0x26')](_0x1c99('0x3b'),util[_0x1c99('0x1d')](this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]],{'showHidden':![],'depth':null}));this[_0x1c99('0x21')](util['format']('trunk:%s',this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]][_0x1c99('0x2c')]),'trunk:save',this[_0x1c99('0xb')][_0x3e9443[_0x1c99('0x30')]]);}else if(_[_0x1c99('0x3c')](_0x3e9443['device'],_0x1c99('0x3d'))){var _0x49c968=_0x3e9443[_0x1c99('0x30')];var _0x5bdbc1=_0x49c968[_0x1c99('0x3e')](_0x49c968[_0x1c99('0x3f')]('/')+0x1,_0x49c968[_0x1c99('0x3f')]('@'));var _0xe27080=_['find'](this[_0x1c99('0xc')],function(_0x364b4e){return _0x364b4e['mobile']==_0x5bdbc1||_0x364b4e['phone']==_0x5bdbc1||_0x364b4e[_0x1c99('0x40')]==_0x5bdbc1;});if(_0xe27080){if(_0xe27080[_0x1c99('0x25')]!==_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]()){_0xe27080['stateTime']=_[_0x1c99('0x36')](moment()['format']('x'));}_0xe27080[_0x1c99('0x25')]=_0x3e9443[_0x1c99('0x25')][_0x1c99('0x34')]();_0xe27080[_0x1c99('0x32')]=!![];_0xe27080['updateStatusRealtime'](_0x3e9443);}}}}catch(_0x524d73){logger[_0x1c99('0x18')](_0x1c99('0x31'),util[_0x1c99('0x1d')](_0x524d73,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1c99('0x12')]=function(_0x4cfe08){try{if(this[_0x1c99('0x22')](_0x4cfe08)&&this[_0x1c99('0x22')](_0x4cfe08['peerstatus'])){logger[_0x1c99('0x2e')](_0x1c99('0x41'),_0x4cfe08[_0x1c99('0x42')],_0x4cfe08['address'],_0x4cfe08[_0x1c99('0x11')]);logger[_0x1c99('0x26')](_0x1c99('0x43'),util['inspect'](_0x4cfe08,{'showHidden':![],'depth':null}));if(this[_0x1c99('0xc')][_0x4cfe08[_0x1c99('0x42')]]){if(!this[_0x1c99('0xc')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x32')]||_0x4cfe08[_0x1c99('0x11')][_0x1c99('0x34')]()=='registered'){this[_0x1c99('0xc')][_0x4cfe08['peer']][_0x1c99('0x32')]=![];this[_0x1c99('0xc')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x44')]=_0x4cfe08[_0x1c99('0x11')][_0x1c99('0x34')]();this[_0x1c99('0xc')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x45')]=_0x4cfe08[_0x1c99('0x45')];this[_0x1c99('0xc')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x37')](_0x4cfe08);}}else if(this[_0x1c99('0xd')][_0x4cfe08[_0x1c99('0x42')]]){this[_0x1c99('0xd')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x44')]=_0x4cfe08[_0x1c99('0x11')][_0x1c99('0x34')]();this[_0x1c99('0xd')][_0x4cfe08['peer']][_0x1c99('0x45')]=_0x4cfe08['address'];logger[_0x1c99('0x26')](_0x1c99('0x46'),util[_0x1c99('0x1d')](this[_0x1c99('0xd')][_0x4cfe08[_0x1c99('0x42')]],{'showHidden':![],'depth':null}));this[_0x1c99('0x21')](util['format']('telephone:%s',this['telephones'][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x2c')]),'telephone:save',this[_0x1c99('0xd')][_0x4cfe08[_0x1c99('0x42')]]);}else if(this[_0x1c99('0xb')][_0x4cfe08['peer']]){this[_0x1c99('0xb')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x44')]=_0x4cfe08[_0x1c99('0x11')][_0x1c99('0x34')]();this['trunks'][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x45')]=_0x4cfe08[_0x1c99('0x45')];logger[_0x1c99('0x26')](_0x1c99('0x47'),util[_0x1c99('0x1d')](this[_0x1c99('0xb')][_0x4cfe08[_0x1c99('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x1c99('0x39')](_0x1c99('0x48'),this[_0x1c99('0xb')][_0x4cfe08[_0x1c99('0x42')]][_0x1c99('0x2c')]),_0x1c99('0x49'),this[_0x1c99('0xb')][_0x4cfe08[_0x1c99('0x42')]]);}}}catch(_0x4987f7){logger['error'](_0x1c99('0x43'),util[_0x1c99('0x1d')](_0x4987f7,{'showHidden':![],'depth':null}));}};module[_0x1c99('0x4a')]=UserReport;
\ No newline at end of file
+var _0x41da=['resolve','actionDeviceStateList','error','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','format','updateStatusRealtime','stateTime','toNumber','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','mobile','phone','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x41da,0x19b));var _0xa41d=function(_0xfcfe92,_0x14ea66){_0xfcfe92=_0xfcfe92-0x0;var _0x166ba1=_0x41da[_0xfcfe92];return _0x166ba1;};'use strict';var _=require(_0xa41d('0x0'));var moment=require(_0xa41d('0x1'));var util=require(_0xa41d('0x2'));var Redis=require(_0xa41d('0x3'));var BPromise=require(_0xa41d('0x4'));var config=require(_0xa41d('0x5'));var logger=require(_0xa41d('0x6'))('ami');var ami=require('../ami');config['redis']=_[_0xa41d('0x7')](config[_0xa41d('0x8')],{'host':_0xa41d('0x9'),'port':0x18eb});var io=require(_0xa41d('0xa'))(new Redis(config[_0xa41d('0x8')]));function UserReport(_0x100558){this['trunks']=_0x100558[_0xa41d('0xb')];this['agents']=_0x100558[_0xa41d('0xc')];this['telephones']=_0x100558[_0xa41d('0xd')];ami['on']('registryentry',this[_0xa41d('0xe')][_0xa41d('0xf')](this));ami['on'](_0xa41d('0x10'),this['syncRegistry'][_0xa41d('0xf')](this));ami['on'](_0xa41d('0x11'),this[_0xa41d('0x12')][_0xa41d('0xf')](this));ami['on'](_0xa41d('0x13'),this[_0xa41d('0x14')][_0xa41d('0xf')](this));return this[_0xa41d('0x15')]();}function showSipRegistrations(){Promise['resolve']()[_0xa41d('0x16')](ami[_0xa41d('0x17')]())[_0xa41d('0x18')](function(_0x33530e){logger['error'](_0xa41d('0x19'),util[_0xa41d('0x1a')](_0x33530e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa41d('0x1b')]()[_0xa41d('0x16')](ami[_0xa41d('0x1c')]())['catch'](function(_0x181387){logger[_0xa41d('0x1d')]('[userReport][devicestatelist]',util['inspect'](_0x181387,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa41d('0x1b')]()[_0xa41d('0x16')](ami['actionSipPeerStatus']())['catch'](function(_0x4ed1cf){logger[_0xa41d('0x1d')]('[userReport][sippeerstatus]',util[_0xa41d('0x1a')](_0x4ed1cf,{'showHidden':![],'depth':null}));});}UserReport[_0xa41d('0x1e')][_0xa41d('0x15')]=function(){setInterval(function(){BPromise[_0xa41d('0x1b')]()[_0xa41d('0x16')](showSipRegistrations())['then'](listDeviceStates())[_0xa41d('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xa41d('0x1f')]=function(_0x2f3259){return _0x2f3259!==null&&!_[_0xa41d('0x20')](_0x2f3259);};UserReport[_0xa41d('0x1e')][_0xa41d('0x21')]=function(_0x408715,_0x3e2bd0,_0xced560){io['to'](_0x408715)[_0xa41d('0x21')](_0x3e2bd0,_0xced560);};UserReport[_0xa41d('0x1e')][_0xa41d('0xe')]=function(_0x17618d){try{if(this[_0xa41d('0x1f')](_0x17618d)){logger['info'](_0xa41d('0x22'),_0x17618d['username'],_0x17618d[_0xa41d('0x23')]);logger[_0xa41d('0x24')](_0xa41d('0x25'),util['inspect'](_0x17618d,{'showHidden':![],'depth':null}));var _0x424dfb=_[_0xa41d('0x26')](this[_0xa41d('0xb')],{'defaultuser':_0x17618d[_0xa41d('0x27')]});if(_0x424dfb){_0x17618d[_0xa41d('0x28')]=_0x17618d[_0xa41d('0x23')];_['merge'](_0x424dfb,_[_0xa41d('0x29')](_0x17618d,[_0xa41d('0x2a'),_0xa41d('0x2b'),'username',_0xa41d('0x23')]));logger['debug'](_0xa41d('0x2c'),util[_0xa41d('0x1a')](_0x424dfb,{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',_0x424dfb[_0xa41d('0x2d')]),_0xa41d('0x2e'),_0x424dfb);}}}catch(_0x5c0b29){logger[_0xa41d('0x1d')](_0xa41d('0x25'),util['inspect'](_0x5c0b29,{'showHidden':![],'depth':null}));}};UserReport[_0xa41d('0x1e')][_0xa41d('0x12')]=function(_0x54e306){try{if(this[_0xa41d('0x1f')](_0x54e306)){logger['info'](_0xa41d('0x2f'),_0x54e306[_0xa41d('0x30')],_0x54e306[_0xa41d('0x23')]);logger[_0xa41d('0x24')](_0xa41d('0x31'),util[_0xa41d('0x1a')](_0x54e306,{'showHidden':![],'depth':null}));if(this[_0xa41d('0xc')][_0x54e306[_0xa41d('0x30')]]){if(!this[_0xa41d('0xc')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x32')]||_0x54e306[_0xa41d('0x23')]['toLowerCase']()==_0xa41d('0x33')){this[_0xa41d('0xc')][_0x54e306['device']][_0xa41d('0x32')]=![];if(this[_0xa41d('0xc')][_0x54e306[_0xa41d('0x30')]]['state']!==_0x54e306['state'][_0xa41d('0x34')]()){this['agents'][_0x54e306[_0xa41d('0x30')]]['stateTime']=_['toNumber'](moment()[_0xa41d('0x35')]('x'));}this[_0xa41d('0xc')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x23')]=_0x54e306[_0xa41d('0x23')]['toLowerCase']();this[_0xa41d('0xc')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x36')](_0x54e306);}}else if(this[_0xa41d('0xd')][_0x54e306[_0xa41d('0x30')]]){if(this[_0xa41d('0xd')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x23')]!==_0x54e306['state'][_0xa41d('0x34')]()){this[_0xa41d('0xd')][_0x54e306['device']][_0xa41d('0x37')]=_[_0xa41d('0x38')](moment()['format']('x'));}this['telephones'][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x23')]=_0x54e306['state'][_0xa41d('0x34')]();logger[_0xa41d('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xa41d('0x1a')](this[_0xa41d('0xd')][_0x54e306[_0xa41d('0x30')]],{'showHidden':![],'depth':null}));this[_0xa41d('0x21')](util[_0xa41d('0x35')]('telephone:%s',this[_0xa41d('0xd')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x2d')]),_0xa41d('0x39'),this['telephones'][_0x54e306[_0xa41d('0x30')]]);}else if(this[_0xa41d('0xb')][_0x54e306[_0xa41d('0x30')]]){if(this[_0xa41d('0xb')][_0x54e306['device']][_0xa41d('0x23')]!==_0x54e306[_0xa41d('0x23')][_0xa41d('0x34')]()){this['trunks'][_0x54e306['device']][_0xa41d('0x37')]=_[_0xa41d('0x38')](moment()[_0xa41d('0x35')]('x'));}this[_0xa41d('0xb')][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x23')]=_0x54e306[_0xa41d('0x23')][_0xa41d('0x34')]();logger[_0xa41d('0x24')](_0xa41d('0x3a'),util[_0xa41d('0x1a')](this[_0xa41d('0xb')][_0x54e306[_0xa41d('0x30')]],{'showHidden':![],'depth':null}));this[_0xa41d('0x21')](util[_0xa41d('0x35')](_0xa41d('0x3b'),this['trunks'][_0x54e306[_0xa41d('0x30')]][_0xa41d('0x2d')]),_0xa41d('0x2e'),this[_0xa41d('0xb')][_0x54e306[_0xa41d('0x30')]]);}else if(_[_0xa41d('0x3c')](_0x54e306[_0xa41d('0x30')],_0xa41d('0x3d'))){var _0x4d0de5=_0x54e306[_0xa41d('0x30')];var _0x2c409e=_0x4d0de5[_0xa41d('0x3e')](_0x4d0de5[_0xa41d('0x3f')]('/')+0x1,_0x4d0de5['indexOf']('@'));var _0x314ac7=_['find'](this[_0xa41d('0xc')],function(_0x4d9d00){return _0x4d9d00[_0xa41d('0x40')]==_0x2c409e||_0x4d9d00[_0xa41d('0x41')]==_0x2c409e||_0x4d9d00['accountcode']==_0x2c409e;});if(_0x314ac7){if(_0x314ac7['state']!==_0x54e306['state'][_0xa41d('0x34')]()){_0x314ac7[_0xa41d('0x37')]=_[_0xa41d('0x38')](moment()[_0xa41d('0x35')]('x'));}_0x314ac7[_0xa41d('0x23')]=_0x54e306['state'][_0xa41d('0x34')]();_0x314ac7['local']=!![];_0x314ac7[_0xa41d('0x36')](_0x54e306);}}}}catch(_0x5e92e9){logger[_0xa41d('0x1d')](_0xa41d('0x31'),util['inspect'](_0x5e92e9,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa41d('0x14')]=function(_0x442245){try{if(this[_0xa41d('0x1f')](_0x442245)&&this['isNotNull'](_0x442245[_0xa41d('0x13')])){logger[_0xa41d('0x42')](_0xa41d('0x43'),_0x442245[_0xa41d('0x44')],_0x442245[_0xa41d('0x45')],_0x442245['peerstatus']);logger[_0xa41d('0x24')]('[userReport][peerstatus]',util['inspect'](_0x442245,{'showHidden':![],'depth':null}));if(this[_0xa41d('0xc')][_0x442245[_0xa41d('0x44')]]){if(!this[_0xa41d('0xc')][_0x442245['peer']][_0xa41d('0x32')]||_0x442245['peerstatus'][_0xa41d('0x34')]()==_0xa41d('0x46')){this[_0xa41d('0xc')][_0x442245[_0xa41d('0x44')]][_0xa41d('0x32')]=![];this[_0xa41d('0xc')][_0x442245[_0xa41d('0x44')]][_0xa41d('0x47')]=_0x442245[_0xa41d('0x13')][_0xa41d('0x34')]();this[_0xa41d('0xc')][_0x442245[_0xa41d('0x44')]]['address']=_0x442245[_0xa41d('0x45')];this[_0xa41d('0xc')][_0x442245[_0xa41d('0x44')]][_0xa41d('0x36')](_0x442245);}}else if(this[_0xa41d('0xd')][_0x442245[_0xa41d('0x44')]]){this['telephones'][_0x442245[_0xa41d('0x44')]][_0xa41d('0x47')]=_0x442245['peerstatus'][_0xa41d('0x34')]();this[_0xa41d('0xd')][_0x442245['peer']][_0xa41d('0x45')]=_0x442245[_0xa41d('0x45')];logger[_0xa41d('0x24')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xa41d('0x1a')](this[_0xa41d('0xd')][_0x442245['peer']],{'showHidden':![],'depth':null}));this[_0xa41d('0x21')](util[_0xa41d('0x35')]('telephone:%s',this['telephones'][_0x442245['peer']][_0xa41d('0x2d')]),_0xa41d('0x39'),this[_0xa41d('0xd')][_0x442245[_0xa41d('0x44')]]);}else if(this['trunks'][_0x442245[_0xa41d('0x44')]]){this[_0xa41d('0xb')][_0x442245['peer']][_0xa41d('0x47')]=_0x442245[_0xa41d('0x13')]['toLowerCase']();this[_0xa41d('0xb')][_0x442245['peer']][_0xa41d('0x45')]=_0x442245[_0xa41d('0x45')];logger[_0xa41d('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xa41d('0x1a')](this[_0xa41d('0xb')][_0x442245[_0xa41d('0x44')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa41d('0x3b'),this[_0xa41d('0xb')][_0x442245['peer']][_0xa41d('0x2d')]),_0xa41d('0x2e'),this['trunks'][_0x442245[_0xa41d('0x44')]]);}}}catch(_0x4e0685){logger['error'](_0xa41d('0x48'),util[_0xa41d('0x1a')](_0x4e0685,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index 3a386b0..41d6de6 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(_0x4e562d,_0x5228ce){var _0x501e94=function(_0x46c45d){while(--_0x46c45d){_0x4e562d['push'](_0x4e562d['shift']());}};_0x501e94(++_0x5228ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x1d3fd4,_0x2fb7e8){var _0x969e94=function(_0x5bb4d9){while(--_0x5bb4d9){_0x1d3fd4['push'](_0x1d3fd4['shift']());}};_0x969e94(++_0x2fb7e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 1a231d2..2d8f41a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b8a=['connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','lastapplication','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','destinationchannel','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','monitors','isNil','push','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','answertime','omit','user:agentcomplete','resolve','then','undefined','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','event','blindTransfers','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','transferconnectedlinenum','extension','BLIND','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','util','path','ioredis','../../../config/environment','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','bind','newexten','syncNewExten','syncNewChannel','syncNewState','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','emit','info','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum'];(function(_0x3d254a,_0x33e619){var _0x7d099f=function(_0x5f5b71){while(--_0x5f5b71){_0x3d254a['push'](_0x3d254a['shift']());}};_0x7d099f(++_0x33e619);}(_0x4b8a,0x7e));var _0xa4b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4b8a[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require('bluebird');var _=require(_0xa4b8('0x0'));var moment=require('moment');var util=require(_0xa4b8('0x1'));var path=require(_0xa4b8('0x2'));var Redis=require(_0xa4b8('0x3'));var config=require(_0xa4b8('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0xa4b8('0x5'));var Channel=require(_0xa4b8('0x6'));var RpcSetting=require(_0xa4b8('0x7'));var statusDesc=[_0xa4b8('0x8'),_0xa4b8('0x9'),_0xa4b8('0xa'),_0xa4b8('0xb'),'invalid',_0xa4b8('0xc'),_0xa4b8('0xd'),'ringinuse',_0xa4b8('0xe')];var applications=[_0xa4b8('0xf'),_0xa4b8('0x10'),_0xa4b8('0x11'),_0xa4b8('0x12'),_0xa4b8('0x13'),_0xa4b8('0x14')];var dispositions=[_0xa4b8('0x15'),_0xa4b8('0x16'),_0xa4b8('0x16'),'NO\x20ANSWER',_0xa4b8('0x15'),_0xa4b8('0x15'),_0xa4b8('0x17'),_0xa4b8('0x18'),_0xa4b8('0x16'),_0xa4b8('0x16'),'FAILED'];var actions={};config[_0xa4b8('0x19')]=_[_0xa4b8('0x1a')](config[_0xa4b8('0x19')],{'host':_0xa4b8('0x1b'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa4b8('0x19')]));function VoiceCallReport(_0xc08591){this[_0xa4b8('0x1c')]=_0xc08591[_0xa4b8('0x1c')];this[_0xa4b8('0x1d')]=_0xc08591[_0xa4b8('0x1d')];this['blindTransfers']={};ami['on'](_0xa4b8('0x1e'),this['syncNewExten'][_0xa4b8('0x1f')](this));ami['on'](_0xa4b8('0x20'),this[_0xa4b8('0x21')][_0xa4b8('0x1f')](this));ami['on']('newchannel',this[_0xa4b8('0x22')]['bind'](this));ami['on']('newstate',this[_0xa4b8('0x23')][_0xa4b8('0x1f')](this));ami['on']('varset',this[_0xa4b8('0x24')]['bind'](this));ami['on'](_0xa4b8('0x25'),this[_0xa4b8('0x26')]['bind'](this));ami['on']('newcallerid',this[_0xa4b8('0x27')]['bind'](this));ami['on'](_0xa4b8('0x28'),this['syncAttendedTransfer'][_0xa4b8('0x1f')](this));ami['on'](_0xa4b8('0x29'),this[_0xa4b8('0x2a')][_0xa4b8('0x1f')](this));ami['on'](_0xa4b8('0x2b'),this[_0xa4b8('0x2c')]['bind'](this));ami['on']('musiconholdstop',this[_0xa4b8('0x2d')][_0xa4b8('0x1f')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x42d22b){logger[_0xa4b8('0x2e')](_0xa4b8('0x2f'),util[_0xa4b8('0x30')](_0x42d22b,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xa4b8('0x31')]=function(_0x50d465){return _0x50d465!==null&&!_[_0xa4b8('0x32')](_0x50d465);};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0x34')]=function(_0x314d93,_0x444c49,_0x50f2cd){io['to'](_0x314d93)[_0xa4b8('0x34')](_0x444c49,_0x50f2cd);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x5ca9cc){try{if(this['isNotNull'](_0x5ca9cc)){logger[_0xa4b8('0x35')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x5ca9cc[_0xa4b8('0x36')],_0x5ca9cc[_0xa4b8('0x37')],_0x5ca9cc[_0xa4b8('0x38')]);logger[_0xa4b8('0x39')](_0xa4b8('0x3a'),_0x5ca9cc['uniqueid'],util['inspect'](_0x5ca9cc,{'showHidden':![],'depth':null}));if(_0x5ca9cc['uniqueid']===_0x5ca9cc['linkedid']){if(!_[_0xa4b8('0x32')](this['channels'][_0x5ca9cc['uniqueid']])){_[_0xa4b8('0x3b')](this['channels'][_0x5ca9cc['uniqueid']],_[_0xa4b8('0x3c')](_0x5ca9cc,_[_0xa4b8('0x3d')](this[_0xa4b8('0x1c')][_0x5ca9cc[_0xa4b8('0x36')]])));}}if(_0x5ca9cc[_0xa4b8('0x3e')]===_0xa4b8('0x3f')){if(this[_0xa4b8('0x1d')][_0x5ca9cc[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]){if(_0x5ca9cc[_0xa4b8('0x42')]==_0xa4b8('0x43')){this['agents'][_0x5ca9cc[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x44')]=_0x5ca9cc[_0xa4b8('0x45')];this[_0xa4b8('0x34')](util[_0xa4b8('0x46')](_0xa4b8('0x47'),this[_0xa4b8('0x1d')][_0x5ca9cc[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x48')]),_0xa4b8('0x49'),{'destaccountcode':this[_0xa4b8('0x1d')][_0x5ca9cc[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x4a')],'destconnectedlinenum':_0x5ca9cc[_0xa4b8('0x45')]});}}}}}catch(_0x3026f8){logger['error'](_0xa4b8('0x4b'),_0x5ca9cc[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x3026f8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x108b80){try{if(this[_0xa4b8('0x31')](_0x108b80)){logger[_0xa4b8('0x39')](_0xa4b8('0x4c'),_0x108b80[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x108b80,{'showHidden':![],'depth':null}));if(_0x108b80[_0xa4b8('0x36')]===_0x108b80[_0xa4b8('0x4d')]&&_0x108b80[_0xa4b8('0x40')]!=_0xa4b8('0x4e')){if(_[_0xa4b8('0x32')](this[_0xa4b8('0x1c')][_0x108b80[_0xa4b8('0x36')]])){logger[_0xa4b8('0x35')](_0xa4b8('0x4f'),_0x108b80[_0xa4b8('0x36')],_0x108b80[_0xa4b8('0x3e')],_0x108b80[_0xa4b8('0x42')]);this[_0xa4b8('0x1c')][_0x108b80['uniqueid']]=new Channel();this[_0xa4b8('0x1c')][_0x108b80['uniqueid']][_0xa4b8('0x50')]=moment()[_0xa4b8('0x46')](_0xa4b8('0x51'));this[_0xa4b8('0x1c')][_0x108b80[_0xa4b8('0x36')]][_0xa4b8('0x52')]=dispositions[_[_0xa4b8('0x53')](_0x108b80[_0xa4b8('0x54')])];_['merge'](this[_0xa4b8('0x1c')][_0x108b80[_0xa4b8('0x36')]],_[_0xa4b8('0x3c')](_0x108b80,_[_0xa4b8('0x3d')](this[_0xa4b8('0x1c')][_0x108b80['uniqueid']])));if(_0x108b80[_0xa4b8('0x3e')]==='from-sip'){if(this[_0xa4b8('0x1d')][_0x108b80[_0xa4b8('0x40')]['split']('-')[0x0]]){if(_['isUndefined'](this[_0xa4b8('0x1d')][_0x108b80[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x44')])){this[_0xa4b8('0x1d')][_0x108b80[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['destconnectedlinenum']=_0x108b80[_0xa4b8('0x42')];logger['debug'](_0xa4b8('0x55'),_0x108b80['uniqueid'],util[_0xa4b8('0x30')]({'destaccountcode':this[_0xa4b8('0x1d')][_0x108b80[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x108b80[_0xa4b8('0x42')]},{'showHidden':![],'depth':null}));this[_0xa4b8('0x34')](util['format'](_0xa4b8('0x47'),this[_0xa4b8('0x1d')][_0x108b80[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x48')]),_0xa4b8('0x49'),{'destaccountcode':this['agents'][_0x108b80['channel'][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x4a')],'destconnectedlinenum':_0x108b80[_0xa4b8('0x42')]});}}}}}}}catch(_0x1378ff){logger[_0xa4b8('0x2e')](_0xa4b8('0x56'),_0x108b80[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x1378ff,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')]['syncNewExten']=function(_0x37cf2d){try{if(this[_0xa4b8('0x31')](_0x37cf2d)){logger[_0xa4b8('0x39')]('[%s][voiceCallReport][newexten]\x20event:',_0x37cf2d[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x37cf2d,{'showHidden':![],'depth':null}));if(_0x37cf2d[_0xa4b8('0x36')]===_0x37cf2d[_0xa4b8('0x4d')]&&_0x37cf2d[_0xa4b8('0x42')]!='h'&&_0x37cf2d['channel']!=_0xa4b8('0x4e')){_0x37cf2d[_0xa4b8('0x57')]=_0x37cf2d[_0xa4b8('0x57')][_0xa4b8('0x58')]();_0x37cf2d[_0xa4b8('0x59')]=_0x37cf2d[_0xa4b8('0x5a')]&&_0x37cf2d['appdata']['startsWith'](_0xa4b8('0x5b'))?_0x37cf2d[_0xa4b8('0x5a')]:(_0x37cf2d[_0xa4b8('0x5a')]||_0x37cf2d[_0xa4b8('0x59')])[_0xa4b8('0x58')]();logger[_0xa4b8('0x35')](_0xa4b8('0x5c'),_0x37cf2d[_0xa4b8('0x36')],_0x37cf2d[_0xa4b8('0x57')],_0x37cf2d['applicationdata']);if(_[_0xa4b8('0x32')](this['channels'][_0x37cf2d['uniqueid']])){this[_0xa4b8('0x1c')][_0x37cf2d[_0xa4b8('0x36')]]=new Channel();this['channels'][_0x37cf2d[_0xa4b8('0x36')]][_0xa4b8('0x50')]=_0x37cf2d[_0xa4b8('0x5d')]?moment()['subtract'](moment[_0xa4b8('0x5d')](_0x37cf2d[_0xa4b8('0x5d')])['seconds'](),_0xa4b8('0x5e'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xa4b8('0x51'));this['channels'][_0x37cf2d[_0xa4b8('0x36')]][_0xa4b8('0x52')]=_0xa4b8('0x15');}_[_0xa4b8('0x3b')](this[_0xa4b8('0x1c')][_0x37cf2d[_0xa4b8('0x36')]],_[_0xa4b8('0x3c')](_0x37cf2d,_[_0xa4b8('0x3d')](this['channels'][_0x37cf2d[_0xa4b8('0x36')]])));if(_['includes'](applications,_0x37cf2d[_0xa4b8('0x57')])){this['channels'][_0x37cf2d['uniqueid']][_0xa4b8('0x5f')]=_0x37cf2d['application'];this[_0xa4b8('0x1c')][_0x37cf2d[_0xa4b8('0x36')]]['lastdata']=_0x37cf2d[_0xa4b8('0x59')];if(_0x37cf2d[_0xa4b8('0x57')]==='set'&&_[_0xa4b8('0x60')](_0x37cf2d[_0xa4b8('0x59')]['toLowerCase'](),_0xa4b8('0x61'))){var _0x8f2870=_0x37cf2d[_0xa4b8('0x59')][_0xa4b8('0x41')]('=');var _0x5b1b56=_0x8f2870[0x0][_0xa4b8('0x58')]()[_0xa4b8('0x62')](/cdr\((.*)\)/);if(_0x5b1b56){this[_0xa4b8('0x1c')][_0x37cf2d['uniqueid']][_0x5b1b56[0x1]]=_0x8f2870[0x1];}}else if(_0x37cf2d[_0xa4b8('0x57')]===_0xa4b8('0x10')){this[_0xa4b8('0x1c')][_0x37cf2d[_0xa4b8('0x36')]]['queue']=_0x37cf2d[_0xa4b8('0x59')]['split'](',')[0x0];}}}}}catch(_0x59f5f6){logger[_0xa4b8('0x2e')](_0xa4b8('0x63'),_0x37cf2d['uniqueid'],util['inspect'](_0x59f5f6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0x23')]=function(_0x5ea803){try{if(this[_0xa4b8('0x31')](_0x5ea803)){logger[_0xa4b8('0x35')](_0xa4b8('0x64'),_0x5ea803[_0xa4b8('0x36')],_0x5ea803['linkedid'],_0x5ea803[_0xa4b8('0x37')],_0x5ea803[_0xa4b8('0x38')]);logger[_0xa4b8('0x39')](_0xa4b8('0x65'),_0x5ea803['uniqueid'],util[_0xa4b8('0x30')](_0x5ea803,{'showHidden':![],'depth':null}));if(_0x5ea803[_0xa4b8('0x36')]!==_0x5ea803['linkedid']){if(this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]]){if(_0x5ea803[_0xa4b8('0x54')]==='6'){if(!this[_0xa4b8('0x1c')][_0x5ea803['linkedid']][_0xa4b8('0x66')]){var _0x43f8a6=moment();this[_0xa4b8('0x1c')][_0x5ea803['linkedid']][_0xa4b8('0x66')]=!![];this['channels'][_0x5ea803[_0xa4b8('0x4d')]]['answertime']=_0x43f8a6[_0xa4b8('0x46')](_0xa4b8('0x51'));if(this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x50')]){this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x67')]=_0x43f8a6[_0xa4b8('0x68')](this['channels'][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x50')],_0xa4b8('0x5e'));}}this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x4d')]=_0x5ea803[_0xa4b8('0x36')];if(_0x5ea803['calleridnum']!==_0xa4b8('0x43')){this[_0xa4b8('0x1c')][_0x5ea803['linkedid']]['connectedlinenum']=_0x5ea803['calleridnum'];}this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]]['connectedlinename']=_0x5ea803['calleridname'];this['channels'][_0x5ea803['linkedid']][_0xa4b8('0x69')]=_0x5ea803['channel'];this[_0xa4b8('0x1c')][_0x5ea803['linkedid']][_0xa4b8('0x52')]=dispositions[_[_0xa4b8('0x53')](_0x5ea803[_0xa4b8('0x54')])];if(this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]){this['channels'][_0x5ea803[_0xa4b8('0x4d')]]['UserId']=this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['id'];this['channels'][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x6a')]=this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x5ea803['uniqueid']]){if(_0x5ea803[_0xa4b8('0x54')]==='6'){if(this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]){this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x36')]]['UserId']=this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['id'];this['channels'][_0x5ea803['uniqueid']][_0xa4b8('0x6a')]=this['agents'][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x48')];}}}}if(_0x5ea803[_0xa4b8('0x54')]==='6'&&_0x5ea803['context']===_0xa4b8('0x3f')){if(this[_0xa4b8('0x1d')][_0x5ea803['channel'][_0xa4b8('0x41')]('-')[0x0]]){this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x44')]=_0x5ea803[_0xa4b8('0x42')];var _0x5f0cd0;if(this[_0xa4b8('0x1c')][_0x5ea803['uniqueid']])_0x5f0cd0=this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x36')]][_0xa4b8('0x6b')];else if(this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]])_0x5f0cd0=this[_0xa4b8('0x1c')][_0x5ea803[_0xa4b8('0x4d')]][_0xa4b8('0x6b')];logger[_0xa4b8('0x39')](_0xa4b8('0x6c'),_0x5ea803[_0xa4b8('0x36')],util[_0xa4b8('0x30')]({'destaccountcode':this['agents'][_0x5ea803['channel'][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x4a')],'destconnectedlinenum':_0x5ea803[_0xa4b8('0x42')],'routealias':_0x5f0cd0},{'showHidden':![],'depth':null}));this[_0xa4b8('0x34')](util[_0xa4b8('0x46')]('user:%s',this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x48')]),_0xa4b8('0x49'),{'destaccountcode':this[_0xa4b8('0x1d')][_0x5ea803[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x4a')],'destconnectedlinenum':_0x5ea803[_0xa4b8('0x42')],'routealias':_0x5f0cd0});}}}}catch(_0x4659f4){logger[_0xa4b8('0x2e')](_0xa4b8('0x6d'),_0x5ea803[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x4659f4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0x6e')]=function(_0x264351,_0x1e59b1){try{if(this['channels'][_0x264351]){logger[_0xa4b8('0x35')](_0xa4b8('0x6f'),_0x264351,_0x1e59b1);this[_0xa4b8('0x1c')][_0x264351][_0xa4b8('0x70')]=!![];if(_[_0xa4b8('0x71')](_0x1e59b1,_0xa4b8('0x72'))){_0x1e59b1=_0x1e59b1[_0xa4b8('0x73')](_0xa4b8('0x72'),'.WAV');}this['channels'][_0x264351][_0xa4b8('0x74')]=_0x1e59b1;var _0x24371e=_['find'](this[_0xa4b8('0x1c')][_0x264351][_0xa4b8('0x75')],{'filename':_0x1e59b1});if(_[_0xa4b8('0x76')](_0x24371e)){this[_0xa4b8('0x1c')][_0x264351]['monitors'][_0xa4b8('0x77')]({'filename':_0x1e59b1,'createdAt':moment()[_0xa4b8('0x46')](_0xa4b8('0x51')),'mixmonitorid':'','status':'rec'});}}}catch(_0x10fbac){logger[_0xa4b8('0x2e')]('[%s][voiceCallReport][mixMonitorFilename]',_0x264351,util[_0xa4b8('0x30')](_0x10fbac,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0x24')]=function(_0x27ef80){try{if(this[_0xa4b8('0x31')](_0x27ef80)){logger[_0xa4b8('0x39')](_0xa4b8('0x78'),_0x27ef80[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x27ef80,{'showHidden':![],'depth':null}));if(this['channels'][_0x27ef80[_0xa4b8('0x36')]]&&_0x27ef80[_0xa4b8('0x40')]!=_0xa4b8('0x4e')){if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')])){if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')]['mixmonitor_filename'])){logger[_0xa4b8('0x35')](_0xa4b8('0x7a'),_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x6e')](_0x27ef80[_0xa4b8('0x36')],_0x27ef80['value']);}else if(this[_0xa4b8('0x31')](_0x27ef80['variable'][_0xa4b8('0x7c')])){logger[_0xa4b8('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x36')]][_0xa4b8('0x38')]=_0x27ef80[_0xa4b8('0x7b')];}else if(this['isNotNull'](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x7d')])){logger[_0xa4b8('0x35')](_0xa4b8('0x7e'),_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x1c')][_0x27ef80['uniqueid']][_0xa4b8('0x7f')]=_0x27ef80[_0xa4b8('0x7b')];}else if(this['isNotNull'](_0x27ef80[_0xa4b8('0x79')]['xmd-cdrtype'])){logger[_0xa4b8('0x35')](_0xa4b8('0x80'),_0x27ef80['uniqueid'],_0x27ef80[_0xa4b8('0x7b')]);this['channels'][_0x27ef80[_0xa4b8('0x36')]][_0xa4b8('0x81')]=_0x27ef80[_0xa4b8('0x7b')];}else if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x82')])){logger[_0xa4b8('0x35')](_0xa4b8('0x83'),_0x27ef80['uniqueid'],_0x27ef80[_0xa4b8('0x7b')][_0xa4b8('0x41')](',')[0x0]);this[_0xa4b8('0x1c')][_0x27ef80['uniqueid']][_0xa4b8('0x10')]=_0x27ef80[_0xa4b8('0x7b')]['split'](',')[0x0];}else if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x84')])){logger['info'](_0xa4b8('0x85'),_0x27ef80['uniqueid'],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x36')]]['originatecalleridnum']=_0x27ef80[_0xa4b8('0x7b')];}else if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x86')])){logger[_0xa4b8('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x27ef80[_0xa4b8('0x36')],_0x27ef80['value']);this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x36')]][_0xa4b8('0x87')]=_0x27ef80[_0xa4b8('0x7b')];}else if(this['isNotNull'](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x88')])){logger[_0xa4b8('0x35')](_0xa4b8('0x89'),_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this['channels'][_0x27ef80[_0xa4b8('0x36')]]['calleridpreview']=_0x27ef80[_0xa4b8('0x7b')];}else if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')]['xmcs-queue'])){logger[_0xa4b8('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this['channels'][_0x27ef80[_0xa4b8('0x36')]][_0xa4b8('0x10')]=_0x27ef80[_0xa4b8('0x7b')];}else if(this[_0xa4b8('0x31')](_0x27ef80['variable'][_0xa4b8('0x8a')])){logger[_0xa4b8('0x35')](_0xa4b8('0x8b'),_0x27ef80[_0xa4b8('0x36')],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x36')]][_0xa4b8('0x8c')]=_0x27ef80[_0xa4b8('0x7b')];}}}else if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x8d')])){if(_0x27ef80[_0xa4b8('0x7b')]){var _0x1c9d93=path[_0xa4b8('0x8e')](_0x27ef80['value'])[_0xa4b8('0x48')];logger[_0xa4b8('0x35')](_0xa4b8('0x7a'),_0x1c9d93,_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x6e')](_0x1c9d93,_0x27ef80['value']);}}else if(this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x4d')]]){if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')])){if(this[_0xa4b8('0x31')](_0x27ef80[_0xa4b8('0x79')][_0xa4b8('0x8a')])){logger[_0xa4b8('0x35')](_0xa4b8('0x8b'),_0x27ef80[_0xa4b8('0x4d')],_0x27ef80[_0xa4b8('0x7b')]);this[_0xa4b8('0x1c')][_0x27ef80[_0xa4b8('0x4d')]]['sipcalllinkedid']=_0x27ef80['value'];}}}}}catch(_0x567cc0){logger[_0xa4b8('0x2e')]('[%s][voiceCallReport][varset]',_0x27ef80[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x567cc0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')]['syncHangup']=function(_0x55ddad){try{if(this[_0xa4b8('0x31')](_0x55ddad)){logger['debug'](_0xa4b8('0x8f'),_0x55ddad[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x55ddad,{'showHidden':![],'depth':null}));if(this['channels'][_0x55ddad[_0xa4b8('0x36')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x55ddad[_0xa4b8('0x36')],_0x55ddad[_0xa4b8('0x90')]);var _0x11dba7=moment();this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x91')]=_0x11dba7[_0xa4b8('0x46')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x5d')]=_0x11dba7[_0xa4b8('0x68')](this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x50')],_0xa4b8('0x5e'));if(this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x66')]){this['channels'][_0x55ddad['uniqueid']][_0xa4b8('0x92')]=_0x11dba7[_0xa4b8('0x68')](this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x93')],_0xa4b8('0x5e'));this['channels'][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x67')]=this['channels'][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x5d')]-this[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]][_0xa4b8('0x92')];}if(_0x55ddad['context']===_0xa4b8('0x3f')){if(this['agents'][_0x55ddad['channel'][_0xa4b8('0x41')]('-')[0x0]]){this[_0xa4b8('0x1d')][_0x55ddad[_0xa4b8('0x40')]['split']('-')[0x0]]=_[_0xa4b8('0x94')](this[_0xa4b8('0x1d')][_0x55ddad['channel'][_0xa4b8('0x41')]('-')[0x0]],[_0xa4b8('0x44')]);logger[_0xa4b8('0x39')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x55ddad[_0xa4b8('0x36')],util[_0xa4b8('0x30')]({'id':this[_0xa4b8('0x1d')][_0x55ddad[_0xa4b8('0x40')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xa4b8('0x1d')][_0x55ddad[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x4a')]},{'showHidden':![],'depth':null}));this[_0xa4b8('0x34')](util[_0xa4b8('0x46')]('user:%s',this[_0xa4b8('0x1d')][_0x55ddad[_0xa4b8('0x40')]['split']('-')[0x0]][_0xa4b8('0x48')]),_0xa4b8('0x95'),{'id':this[_0xa4b8('0x1d')][_0x55ddad[_0xa4b8('0x40')][_0xa4b8('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xa4b8('0x1d')][_0x55ddad['channel'][_0xa4b8('0x41')]('-')[0x0]][_0xa4b8('0x4a')]});}}var _0x1ccb45=this;Promise[_0xa4b8('0x96')]()[_0xa4b8('0x97')](function(){var _0x391fd9=_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]];if(typeof _0x391fd9['transferType']===_0xa4b8('0x98'))return;if(_['isEmpty'](_0x391fd9['monitors']))return;return RpcSetting['getSettings']()[_0xa4b8('0x97')](function(_0x421864){if(!_0x421864[_0xa4b8('0x99')])return;return Promise[_0xa4b8('0x96')]()['then'](function(){return ami[_0xa4b8('0x9a')]({'action':'StopMixMonitor','channel':_0x391fd9[_0xa4b8('0x40')]})[_0xa4b8('0x9b')](function(){});})[_0xa4b8('0x97')](function(){return ami[_0xa4b8('0x9a')]({'action':_0xa4b8('0x9c'),'channel':_0x391fd9[_0xa4b8('0x69')]})['catch'](function(){})[_0xa4b8('0x9d')](function(){var _0x1bf4c1=_0x1ccb45[_0xa4b8('0x1d')][_0x391fd9[_0xa4b8('0x69')][_0xa4b8('0x41')]('-')[0x0]];if(!_0x1bf4c1)return;io[_0xa4b8('0x34')](_0xa4b8('0x9e'),{'agentId':_0x1bf4c1['id'],'uniqueid':_0x391fd9[_0xa4b8('0x36')]});});});});})[_0xa4b8('0x97')](function(){if(_0x55ddad[_0xa4b8('0x9f')]==='BlindTransfer'){_0x1ccb45[_0xa4b8('0xa0')][_0x55ddad[_0xa4b8('0x36')]]=_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad['uniqueid']];}else{if(_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad['uniqueid']][_0xa4b8('0x81')]===_0xa4b8('0xa1')&&_0x1ccb45['blindTransfers'][_0x55ddad[_0xa4b8('0x36')]]){_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]]['uniqueid']=[_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad['uniqueid']][_0xa4b8('0x4d')],_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad[_0xa4b8('0x36')]]['linkedid']=_0x1ccb45[_0xa4b8('0x1c')][_0x55ddad['uniqueid']][_0xa4b8('0x36')]][0x0];delete _0x1ccb45[_0xa4b8('0xa0')][_0x55ddad[_0xa4b8('0x36')]];}}logger[_0xa4b8('0x39')](_0xa4b8('0xa2'),_0x55ddad[_0xa4b8('0x36')],util['inspect'](_0x1ccb45['channels'][_0x55ddad[_0xa4b8('0x36')]],{'showHidden':![],'depth':null}));ami[_0xa4b8('0x34')](_0xa4b8('0xa3'),_0x1ccb45['channels'][_0x55ddad[_0xa4b8('0x36')]]);delete _0x1ccb45[_0xa4b8('0x1c')][_0x55ddad['uniqueid']];});}}}catch(_0x386351){logger[_0xa4b8('0x2e')](_0xa4b8('0xa4'),_0x55ddad[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x386351,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0xa5')]=function(_0x15487d){try{if(this[_0xa4b8('0x31')](_0x15487d)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x15487d[_0xa4b8('0x36')],_0x15487d[_0xa4b8('0xa6')],_0x15487d[_0xa4b8('0xa7')]);logger['debug'](_0xa4b8('0xa8'),_0x15487d[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x15487d,{'showHidden':![],'depth':null}));if(this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xa9')]]){this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xa9')]][_0xa4b8('0xaa')]=_0x15487d[_0xa4b8('0xa6')];this['channels'][_0x15487d[_0xa4b8('0xa9')]]['transferconnectedlinenum']=_0x15487d['transfertargetcalleridnum'];if(this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xab')]]){var _0x1d2af8=this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xab')]];this[_0xa4b8('0x1c')][_0x15487d['secondtransfereruniqueid']]=this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xa9')]];this[_0xa4b8('0x1c')][_0x15487d['transfereeuniqueid']]=_0x1d2af8;}}else if(this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xac')]]){this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xac')]][_0xa4b8('0xaa')]=_0x15487d[_0xa4b8('0xa6')];this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xac')]]['transferconnectedlinenum']=_0x15487d['transfertargetcalleridnum'];if(this['channels'][_0x15487d[_0xa4b8('0xad')]]){var _0x1d2af8=this['channels'][_0x15487d['origtransfereruniqueid']];this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xad')]]=this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xac')]];this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xac')]]=_0x1d2af8;}}if((this[_0xa4b8('0x1c')][_0x15487d['origtransfereruniqueid']]||this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xae')]])&&this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xab')]]){var _0x41efb4=_['some']([this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xad')]],this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xae')]],this[_0xa4b8('0x1c')][_0x15487d['secondtransfereruniqueid']]],function(_0x5438a7){return _0x5438a7&&_0x5438a7[_0xa4b8('0x81')]===_0xa4b8('0xa1')&&_0x5438a7['routeid'];});if(_0x41efb4){if(this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xad')]])this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xad')]][_0xa4b8('0xaf')]='ATTENDED';if(this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xae')]])this[_0xa4b8('0x1c')][_0x15487d['origtransfererlinkedid']][_0xa4b8('0xaf')]=_0xa4b8('0xb0');this[_0xa4b8('0x1c')][_0x15487d[_0xa4b8('0xab')]][_0xa4b8('0xaf')]='ATTENDED';}}}}catch(_0x30db94){logger['error'](_0xa4b8('0xb1'),_0x15487d[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x30db94,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')][_0xa4b8('0x2a')]=function(_0x34af7c){try{if(this[_0xa4b8('0x31')](_0x34af7c)){logger[_0xa4b8('0x35')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x34af7c[_0xa4b8('0x36')],_0x34af7c[_0xa4b8('0xb2')],_0x34af7c['extension']);logger[_0xa4b8('0x39')](_0xa4b8('0xb3'),_0x34af7c['uniqueid'],util[_0xa4b8('0x30')](_0x34af7c,{'showHidden':![],'depth':null}));if(this[_0xa4b8('0x1c')][_0x34af7c[_0xa4b8('0xa9')]]){this[_0xa4b8('0x1c')][_0x34af7c[_0xa4b8('0xa9')]][_0xa4b8('0xaa')]=_0x34af7c['transfereecalleridnum'];this[_0xa4b8('0x1c')][_0x34af7c[_0xa4b8('0xa9')]][_0xa4b8('0xb4')]=_0x34af7c[_0xa4b8('0xb5')];this[_0xa4b8('0x1c')][_0x34af7c[_0xa4b8('0xa9')]][_0xa4b8('0xaf')]=_0xa4b8('0xb6');this[_0xa4b8('0x26')]({'event':_0xa4b8('0xb7'),'uniqueid':_0x34af7c[_0xa4b8('0xa9')],'context':_0x34af7c[_0xa4b8('0x3e')],'channel':_0x34af7c[_0xa4b8('0xb8')]});}else{this['channels'][_0x34af7c[_0xa4b8('0xb9')]][_0xa4b8('0xaf')]=_0xa4b8('0xb6');}}}catch(_0x1f24bd){logger[_0xa4b8('0x2e')](_0xa4b8('0xba'),_0x34af7c['uniqueid'],util[_0xa4b8('0x30')](_0x1f24bd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa4b8('0x33')]['syncMusicOnHoldStart']=function(_0x11147b){try{if(this[_0xa4b8('0x31')](_0x11147b)){logger[_0xa4b8('0x39')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x11147b['uniqueid'],util[_0xa4b8('0x30')](_0x11147b,{'showHidden':![],'depth':null}));if(this[_0xa4b8('0x1c')][_0x11147b[_0xa4b8('0x36')]]){if(!_[_0xa4b8('0x76')](this[_0xa4b8('0x1c')][_0x11147b[_0xa4b8('0x36')]][_0xa4b8('0x93')])){this[_0xa4b8('0x1c')][_0x11147b[_0xa4b8('0x36')]][_0xa4b8('0xbb')]=moment()[_0xa4b8('0x46')](_0xa4b8('0x51'));logger[_0xa4b8('0x35')](_0xa4b8('0xbc'),_0x11147b[_0xa4b8('0x36')],this[_0xa4b8('0x1c')][_0x11147b[_0xa4b8('0x36')]][_0xa4b8('0xbb')]);}}}}catch(_0x110ef9){logger['error'](_0xa4b8('0xbd'),_0x11147b[_0xa4b8('0x36')],util['inspect'](_0x110ef9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa4b8('0x2d')]=function(_0x4635dc){try{if(this[_0xa4b8('0x31')](_0x4635dc)){logger[_0xa4b8('0x39')](_0xa4b8('0xbe'),_0x4635dc[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x4635dc,{'showHidden':![],'depth':null}));if(this[_0xa4b8('0x1c')][_0x4635dc['uniqueid']]){if(!_[_0xa4b8('0x76')](this[_0xa4b8('0x1c')][_0x4635dc['uniqueid']]['mohstarttime'])){this[_0xa4b8('0x1c')][_0x4635dc['uniqueid']][_0xa4b8('0xbf')]+=moment()[_0xa4b8('0xc0')](0x0)[_0xa4b8('0x68')](this['channels'][_0x4635dc[_0xa4b8('0x36')]][_0xa4b8('0xbb')],_0xa4b8('0x5e'));logger[_0xa4b8('0x35')](_0xa4b8('0xc1'),_0x4635dc['uniqueid'],this['channels'][_0x4635dc['uniqueid']][_0xa4b8('0xbf')]);delete this[_0xa4b8('0x1c')][_0x4635dc[_0xa4b8('0x36')]][_0xa4b8('0xbb')];}}}}catch(_0x5c9ae7){logger[_0xa4b8('0x2e')]('[%s][voiceCallReport][musiconholdstop]',_0x4635dc[_0xa4b8('0x36')],util[_0xa4b8('0x30')](_0x5c9ae7,{'showHidden':![],'depth':null}));}};module[_0xa4b8('0xc2')]=VoiceCallReport;
\ No newline at end of file
+var _0xfd99=['xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','BlindTransfer','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','ATTENDED','[%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]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','inuse','invalid','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewState','syncVarSet','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','prototype','isUndefined','emit','syncNewCallerId','isNotNull','uniqueid','calleridnum','debug','inspect','linkedid','merge','keys','context','from-sip','channel','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','format','YYYY-MM-DD\x20HH:mm:ss','disposition','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','name','error','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','channelstate','answered','answertime','holdtime','connectedlinename','calleridname','destinationchannel','toNumber','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd99,0x10b));var _0x9fd9=function(_0xa45ef4,_0x5de58d){_0xa45ef4=_0xa45ef4-0x0;var _0x2235f7=_0xfd99[_0xa45ef4];return _0x2235f7;};'use strict';var BPromise=require(_0x9fd9('0x0'));var _=require(_0x9fd9('0x1'));var moment=require(_0x9fd9('0x2'));var util=require('util');var path=require(_0x9fd9('0x3'));var Redis=require(_0x9fd9('0x4'));var config=require(_0x9fd9('0x5'));var logger=require(_0x9fd9('0x6'))('ami');var ami=require(_0x9fd9('0x7'));var Channel=require(_0x9fd9('0x8'));var RpcSetting=require('../rpc/setting');var statusDesc=['unknown','not_inuse',_0x9fd9('0x9'),'busy',_0x9fd9('0xa'),_0x9fd9('0xb'),_0x9fd9('0xc'),'ringinuse',_0x9fd9('0xd')];var applications=[_0x9fd9('0xe'),_0x9fd9('0xf'),_0x9fd9('0x10'),_0x9fd9('0x11'),_0x9fd9('0x12'),_0x9fd9('0x13')];var dispositions=['NO\x20ANSWER',_0x9fd9('0x14'),_0x9fd9('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0x9fd9('0x15'),_0x9fd9('0x16'),_0x9fd9('0x17'),_0x9fd9('0x14'),_0x9fd9('0x14'),'FAILED'];var actions={};config[_0x9fd9('0x18')]=_[_0x9fd9('0x19')](config[_0x9fd9('0x18')],{'host':_0x9fd9('0x1a'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9fd9('0x18')]));function VoiceCallReport(_0x43d631){this[_0x9fd9('0x1b')]=_0x43d631[_0x9fd9('0x1b')];this[_0x9fd9('0x1c')]=_0x43d631[_0x9fd9('0x1c')];this[_0x9fd9('0x1d')]={};ami['on'](_0x9fd9('0x1e'),this[_0x9fd9('0x1f')][_0x9fd9('0x20')](this));ami['on'](_0x9fd9('0x21'),this[_0x9fd9('0x1f')][_0x9fd9('0x20')](this));ami['on'](_0x9fd9('0x22'),this['syncNewChannel'][_0x9fd9('0x20')](this));ami['on']('newstate',this[_0x9fd9('0x23')][_0x9fd9('0x20')](this));ami['on']('varset',this[_0x9fd9('0x24')][_0x9fd9('0x20')](this));ami['on'](_0x9fd9('0x25'),this[_0x9fd9('0x26')][_0x9fd9('0x20')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x9fd9('0x20')](this));ami['on'](_0x9fd9('0x27'),this[_0x9fd9('0x28')][_0x9fd9('0x20')](this));ami['on'](_0x9fd9('0x29'),this[_0x9fd9('0x2a')]['bind'](this));ami['on']('musiconholdstart',this[_0x9fd9('0x2b')][_0x9fd9('0x20')](this));ami['on']('musiconholdstop',this[_0x9fd9('0x2c')][_0x9fd9('0x20')](this));try{logger[_0x9fd9('0x2d')](_0x9fd9('0x2e'));ami[_0x9fd9('0x2f')]();}catch(_0x485c94){logger['error']('[voiceCallReport][coreshowchannels]',util['inspect'](_0x485c94,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9fd9('0x30')]['isNotNull']=function(_0x3fa98a){return _0x3fa98a!==null&&!_[_0x9fd9('0x31')](_0x3fa98a);};VoiceCallReport['prototype'][_0x9fd9('0x32')]=function(_0x491c2b,_0x434e1c,_0x30272f){io['to'](_0x491c2b)[_0x9fd9('0x32')](_0x434e1c,_0x30272f);};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x33')]=function(_0x499108){try{if(this[_0x9fd9('0x34')](_0x499108)){logger[_0x9fd9('0x2d')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x499108[_0x9fd9('0x35')],_0x499108['calleridname'],_0x499108[_0x9fd9('0x36')]);logger[_0x9fd9('0x37')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x499108['uniqueid'],util[_0x9fd9('0x38')](_0x499108,{'showHidden':![],'depth':null}));if(_0x499108[_0x9fd9('0x35')]===_0x499108[_0x9fd9('0x39')]){if(!_['isUndefined'](this[_0x9fd9('0x1b')][_0x499108[_0x9fd9('0x35')]])){_[_0x9fd9('0x3a')](this[_0x9fd9('0x1b')][_0x499108[_0x9fd9('0x35')]],_['pick'](_0x499108,_[_0x9fd9('0x3b')](this[_0x9fd9('0x1b')][_0x499108[_0x9fd9('0x35')]])));}}if(_0x499108[_0x9fd9('0x3c')]===_0x9fd9('0x3d')){if(this[_0x9fd9('0x1c')][_0x499108[_0x9fd9('0x3e')]['split']('-')[0x0]]){if(_0x499108['exten']==_0x9fd9('0x3f')){this[_0x9fd9('0x1c')][_0x499108['channel'][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x41')]=_0x499108[_0x9fd9('0x42')];this[_0x9fd9('0x32')](util['format']('user:%s',this[_0x9fd9('0x1c')][_0x499108['channel'][_0x9fd9('0x40')]('-')[0x0]]['name']),_0x9fd9('0x43'),{'destaccountcode':this[_0x9fd9('0x1c')][_0x499108['channel'][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')],'destconnectedlinenum':_0x499108['connectedlinenum']});}}}}}catch(_0x27a8a9){logger['error'](_0x9fd9('0x45'),_0x499108[_0x9fd9('0x35')],util['inspect'](_0x27a8a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x46')]=function(_0x59022e){try{if(this[_0x9fd9('0x34')](_0x59022e)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x59022e[_0x9fd9('0x35')],util['inspect'](_0x59022e,{'showHidden':![],'depth':null}));if(_0x59022e[_0x9fd9('0x35')]===_0x59022e[_0x9fd9('0x39')]&&_0x59022e['channel']!='OutgoingSpoolFailed'){if(_[_0x9fd9('0x31')](this[_0x9fd9('0x1b')][_0x59022e[_0x9fd9('0x35')]])){logger[_0x9fd9('0x2d')](_0x9fd9('0x47'),_0x59022e[_0x9fd9('0x35')],_0x59022e[_0x9fd9('0x3c')],_0x59022e[_0x9fd9('0x48')]);this[_0x9fd9('0x1b')][_0x59022e[_0x9fd9('0x35')]]=new Channel();this[_0x9fd9('0x1b')][_0x59022e['uniqueid']]['starttime']=moment()[_0x9fd9('0x49')](_0x9fd9('0x4a'));this[_0x9fd9('0x1b')][_0x59022e[_0x9fd9('0x35')]][_0x9fd9('0x4b')]=dispositions[_['toNumber'](_0x59022e['channelstate'])];_[_0x9fd9('0x3a')](this[_0x9fd9('0x1b')][_0x59022e['uniqueid']],_[_0x9fd9('0x4c')](_0x59022e,_[_0x9fd9('0x3b')](this[_0x9fd9('0x1b')][_0x59022e['uniqueid']])));if(_0x59022e[_0x9fd9('0x3c')]==='from-sip'){if(this['agents'][_0x59022e['channel'][_0x9fd9('0x40')]('-')[0x0]]){if(_[_0x9fd9('0x31')](this[_0x9fd9('0x1c')][_0x59022e[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x41')])){this[_0x9fd9('0x1c')][_0x59022e[_0x9fd9('0x3e')]['split']('-')[0x0]]['destconnectedlinenum']=_0x59022e[_0x9fd9('0x48')];logger[_0x9fd9('0x37')](_0x9fd9('0x4d'),_0x59022e[_0x9fd9('0x35')],util['inspect']({'destaccountcode':this[_0x9fd9('0x1c')][_0x59022e[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')],'destconnectedlinenum':_0x59022e[_0x9fd9('0x48')]},{'showHidden':![],'depth':null}));this[_0x9fd9('0x32')](util['format'](_0x9fd9('0x4e'),this[_0x9fd9('0x1c')][_0x59022e[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x4f')]),_0x9fd9('0x43'),{'destaccountcode':this['agents'][_0x59022e[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')],'destconnectedlinenum':_0x59022e[_0x9fd9('0x48')]});}}}}}}}catch(_0x3da6f0){logger[_0x9fd9('0x50')]('[%s][voiceCallReport][newchannel]',_0x59022e[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x3da6f0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x1f')]=function(_0x43b5f0){try{if(this[_0x9fd9('0x34')](_0x43b5f0)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x43b5f0[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x43b5f0,{'showHidden':![],'depth':null}));if(_0x43b5f0[_0x9fd9('0x35')]===_0x43b5f0[_0x9fd9('0x39')]&&_0x43b5f0[_0x9fd9('0x48')]!='h'&&_0x43b5f0[_0x9fd9('0x3e')]!=_0x9fd9('0x51')){_0x43b5f0[_0x9fd9('0x52')]=_0x43b5f0[_0x9fd9('0x52')][_0x9fd9('0x53')]();_0x43b5f0[_0x9fd9('0x54')]=_0x43b5f0[_0x9fd9('0x55')]&&_0x43b5f0[_0x9fd9('0x55')][_0x9fd9('0x56')]('CDR(routeAlias)')?_0x43b5f0[_0x9fd9('0x55')]:(_0x43b5f0[_0x9fd9('0x55')]||_0x43b5f0[_0x9fd9('0x54')])['toLowerCase']();logger[_0x9fd9('0x2d')](_0x9fd9('0x57'),_0x43b5f0[_0x9fd9('0x35')],_0x43b5f0[_0x9fd9('0x52')],_0x43b5f0[_0x9fd9('0x54')]);if(_[_0x9fd9('0x31')](this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]])){this['channels'][_0x43b5f0[_0x9fd9('0x35')]]=new Channel();this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]][_0x9fd9('0x58')]=_0x43b5f0[_0x9fd9('0x59')]?moment()[_0x9fd9('0x5a')](moment['duration'](_0x43b5f0[_0x9fd9('0x59')])[_0x9fd9('0x5b')](),_0x9fd9('0x5b'))[_0x9fd9('0x49')](_0x9fd9('0x4a')):moment()[_0x9fd9('0x49')](_0x9fd9('0x4a'));this['channels'][_0x43b5f0[_0x9fd9('0x35')]][_0x9fd9('0x4b')]=_0x9fd9('0x15');}_[_0x9fd9('0x3a')](this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]],_[_0x9fd9('0x4c')](_0x43b5f0,_['keys'](this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]])));if(_[_0x9fd9('0x5c')](applications,_0x43b5f0['application'])){this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]][_0x9fd9('0x5d')]=_0x43b5f0[_0x9fd9('0x52')];this[_0x9fd9('0x1b')][_0x43b5f0['uniqueid']][_0x9fd9('0x5e')]=_0x43b5f0[_0x9fd9('0x54')];if(_0x43b5f0[_0x9fd9('0x52')]===_0x9fd9('0xe')&&_[_0x9fd9('0x56')](_0x43b5f0[_0x9fd9('0x54')][_0x9fd9('0x53')](),_0x9fd9('0x5f'))){var _0x377673=_0x43b5f0['applicationdata'][_0x9fd9('0x40')]('=');var _0x1b365a=_0x377673[0x0][_0x9fd9('0x53')]()[_0x9fd9('0x60')](/cdr\((.*)\)/);if(_0x1b365a){this[_0x9fd9('0x1b')][_0x43b5f0[_0x9fd9('0x35')]][_0x1b365a[0x1]]=_0x377673[0x1];}}else if(_0x43b5f0['application']===_0x9fd9('0xf')){this['channels'][_0x43b5f0[_0x9fd9('0x35')]][_0x9fd9('0xf')]=_0x43b5f0['applicationdata'][_0x9fd9('0x40')](',')[0x0];}}}}}catch(_0x1d05d4){logger[_0x9fd9('0x50')](_0x9fd9('0x61'),_0x43b5f0[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x1d05d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x23')]=function(_0x381597){try{if(this[_0x9fd9('0x34')](_0x381597)){logger['info'](_0x9fd9('0x62'),_0x381597[_0x9fd9('0x35')],_0x381597[_0x9fd9('0x39')],_0x381597['calleridname'],_0x381597['calleridnum']);logger[_0x9fd9('0x37')]('[%s][voiceCallReport][newstate]\x20event:',_0x381597[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x381597,{'showHidden':![],'depth':null}));if(_0x381597[_0x9fd9('0x35')]!==_0x381597['linkedid']){if(this['channels'][_0x381597[_0x9fd9('0x39')]]){if(_0x381597[_0x9fd9('0x63')]==='6'){if(!this[_0x9fd9('0x1b')][_0x381597['linkedid']][_0x9fd9('0x64')]){var _0x411e66=moment();this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]]['answered']=!![];this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x65')]=_0x411e66['format'](_0x9fd9('0x4a'));if(this['channels'][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x58')]){this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x66')]=_0x411e66['diff'](this[_0x9fd9('0x1b')][_0x381597['linkedid']]['starttime'],_0x9fd9('0x5b'));}}this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]]['linkedid']=_0x381597[_0x9fd9('0x35')];if(_0x381597['calleridnum']!==_0x9fd9('0x3f')){this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]]['connectedlinenum']=_0x381597['calleridnum'];}this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x67')]=_0x381597[_0x9fd9('0x68')];this['channels'][_0x381597['linkedid']][_0x9fd9('0x69')]=_0x381597['channel'];this['channels'][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x4b')]=dispositions[_[_0x9fd9('0x6a')](_0x381597[_0x9fd9('0x63')])];if(this[_0x9fd9('0x1c')][_0x381597['channel']['split']('-')[0x0]]){this[_0x9fd9('0x1b')][_0x381597['linkedid']]['UserId']=this['agents'][_0x381597[_0x9fd9('0x3e')]['split']('-')[0x0]]['id'];this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]][_0x9fd9('0x6b')]=this[_0x9fd9('0x1c')][_0x381597['channel']['split']('-')[0x0]][_0x9fd9('0x4f')];}}}}else{if(this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x35')]]){if(_0x381597[_0x9fd9('0x63')]==='6'){if(this[_0x9fd9('0x1c')][_0x381597[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]]){this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x35')]][_0x9fd9('0x6c')]=this[_0x9fd9('0x1c')][_0x381597['channel'][_0x9fd9('0x40')]('-')[0x0]]['id'];this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x35')]][_0x9fd9('0x6b')]=this[_0x9fd9('0x1c')][_0x381597[_0x9fd9('0x3e')]['split']('-')[0x0]][_0x9fd9('0x4f')];}}}}if(_0x381597[_0x9fd9('0x63')]==='6'&&_0x381597[_0x9fd9('0x3c')]===_0x9fd9('0x3d')){if(this[_0x9fd9('0x1c')][_0x381597['channel'][_0x9fd9('0x40')]('-')[0x0]]){this[_0x9fd9('0x1c')][_0x381597[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x41')]=_0x381597['exten'];var _0x3a07bf;if(this['channels'][_0x381597[_0x9fd9('0x35')]])_0x3a07bf=this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x35')]][_0x9fd9('0x6d')];else if(this['channels'][_0x381597['linkedid']])_0x3a07bf=this[_0x9fd9('0x1b')][_0x381597[_0x9fd9('0x39')]]['routealias'];logger[_0x9fd9('0x37')](_0x9fd9('0x6e'),_0x381597[_0x9fd9('0x35')],util[_0x9fd9('0x38')]({'destaccountcode':this[_0x9fd9('0x1c')][_0x381597[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')],'destconnectedlinenum':_0x381597[_0x9fd9('0x48')],'routealias':_0x3a07bf},{'showHidden':![],'depth':null}));this['emit'](util[_0x9fd9('0x49')](_0x9fd9('0x4e'),this['agents'][_0x381597[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x4f')]),_0x9fd9('0x43'),{'destaccountcode':this[_0x9fd9('0x1c')][_0x381597[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')],'destconnectedlinenum':_0x381597['exten'],'routealias':_0x3a07bf});}}}}catch(_0x3d4473){logger[_0x9fd9('0x50')](_0x9fd9('0x6f'),_0x381597['uniqueid'],util['inspect'](_0x3d4473,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x5079eb,_0x39f962){try{if(this[_0x9fd9('0x1b')][_0x5079eb]){logger[_0x9fd9('0x2d')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5079eb,_0x39f962);this['channels'][_0x5079eb]['monitor']=!![];if(_[_0x9fd9('0x70')](_0x39f962,_0x9fd9('0x71'))){_0x39f962=_0x39f962[_0x9fd9('0x72')]('.wav49',_0x9fd9('0x73'));}this[_0x9fd9('0x1b')][_0x5079eb][_0x9fd9('0x74')]=_0x39f962;var _0x4dcc22=_[_0x9fd9('0x75')](this[_0x9fd9('0x1b')][_0x5079eb]['monitors'],{'filename':_0x39f962});if(_['isNil'](_0x4dcc22)){this['channels'][_0x5079eb][_0x9fd9('0x76')]['push']({'filename':_0x39f962,'createdAt':moment()[_0x9fd9('0x49')](_0x9fd9('0x4a')),'mixmonitorid':'','status':_0x9fd9('0x77')});}}}catch(_0x19c66a){logger[_0x9fd9('0x50')](_0x9fd9('0x78'),_0x5079eb,util[_0x9fd9('0x38')](_0x19c66a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9fd9('0x24')]=function(_0x14d00a){try{if(this[_0x9fd9('0x34')](_0x14d00a)){logger[_0x9fd9('0x37')](_0x9fd9('0x79'),_0x14d00a['uniqueid'],util[_0x9fd9('0x38')](_0x14d00a,{'showHidden':![],'depth':null}));if(this['channels'][_0x14d00a[_0x9fd9('0x35')]]&&_0x14d00a[_0x9fd9('0x3e')]!=_0x9fd9('0x51')){if(this[_0x9fd9('0x34')](_0x14d00a['variable'])){if(this['isNotNull'](_0x14d00a[_0x9fd9('0x7a')]['mixmonitor_filename'])){logger['info'](_0x9fd9('0x7b'),_0x14d00a[_0x9fd9('0x35')],_0x14d00a['value']);this[_0x9fd9('0x7c')](_0x14d00a['uniqueid'],_0x14d00a[_0x9fd9('0x7d')]);}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x7e')])){logger['info'](_0x9fd9('0x7f'),_0x14d00a[_0x9fd9('0x35')],_0x14d00a[_0x9fd9('0x7d')]);this[_0x9fd9('0x1b')][_0x14d00a['uniqueid']][_0x9fd9('0x36')]=_0x14d00a['value'];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x80')])){logger[_0x9fd9('0x2d')](_0x9fd9('0x81'),_0x14d00a['uniqueid'],_0x14d00a[_0x9fd9('0x7d')]);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]][_0x9fd9('0x82')]=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x83')])){logger['info'](_0x9fd9('0x84'),_0x14d00a[_0x9fd9('0x35')],_0x14d00a[_0x9fd9('0x7d')]);this['channels'][_0x14d00a[_0x9fd9('0x35')]]['type']=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')]['xmd-queue'])){logger[_0x9fd9('0x2d')](_0x9fd9('0x85'),_0x14d00a['uniqueid'],_0x14d00a[_0x9fd9('0x7d')]['split'](',')[0x0]);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]]['queue']=_0x14d00a[_0x9fd9('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x86')])){logger[_0x9fd9('0x2d')](_0x9fd9('0x87'),_0x14d00a[_0x9fd9('0x35')],_0x14d00a['value']);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]]['originatecalleridnum']=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x88')])){logger[_0x9fd9('0x2d')](_0x9fd9('0x89'),_0x14d00a[_0x9fd9('0x35')],_0x14d00a['value']);this['channels'][_0x14d00a[_0x9fd9('0x35')]][_0x9fd9('0x8a')]=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x8b')])){logger[_0x9fd9('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x14d00a[_0x9fd9('0x35')],_0x14d00a['value']);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]][_0x9fd9('0x8c')]=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x8d')])){logger['info'](_0x9fd9('0x8e'),_0x14d00a['uniqueid'],_0x14d00a[_0x9fd9('0x7d')]);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]][_0x9fd9('0xf')]=_0x14d00a[_0x9fd9('0x7d')];}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')]['sipcallid'])){logger[_0x9fd9('0x2d')](_0x9fd9('0x8f'),_0x14d00a['uniqueid'],_0x14d00a['value']);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x35')]][_0x9fd9('0x90')]=_0x14d00a[_0x9fd9('0x7d')];}}}else if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')][_0x9fd9('0x91')])){if(_0x14d00a[_0x9fd9('0x7d')]){var _0x42c9a3=path[_0x9fd9('0x92')](_0x14d00a[_0x9fd9('0x7d')])[_0x9fd9('0x4f')];logger[_0x9fd9('0x2d')](_0x9fd9('0x7b'),_0x42c9a3,_0x14d00a['value']);this[_0x9fd9('0x7c')](_0x42c9a3,_0x14d00a[_0x9fd9('0x7d')]);}}else if(this['channels'][_0x14d00a['linkedid']]){if(this[_0x9fd9('0x34')](_0x14d00a[_0x9fd9('0x7a')])){if(this[_0x9fd9('0x34')](_0x14d00a['variable']['sipcallid'])){logger['info'](_0x9fd9('0x8f'),_0x14d00a[_0x9fd9('0x39')],_0x14d00a[_0x9fd9('0x7d')]);this[_0x9fd9('0x1b')][_0x14d00a[_0x9fd9('0x39')]][_0x9fd9('0x93')]=_0x14d00a['value'];}}}}}catch(_0x4c5a0a){logger[_0x9fd9('0x50')](_0x9fd9('0x94'),_0x14d00a[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x4c5a0a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x26')]=function(_0x4bc4b4){try{if(this[_0x9fd9('0x34')](_0x4bc4b4)){logger[_0x9fd9('0x37')](_0x9fd9('0x95'),_0x4bc4b4[_0x9fd9('0x35')],util['inspect'](_0x4bc4b4,{'showHidden':![],'depth':null}));if(this[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]]){logger['info'](_0x9fd9('0x96'),_0x4bc4b4['uniqueid'],_0x4bc4b4[_0x9fd9('0x97')]);var _0xa6b3f9=moment();this['channels'][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x98')]=_0xa6b3f9[_0x9fd9('0x49')](_0x9fd9('0x4a'));this[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x59')]=_0xa6b3f9[_0x9fd9('0x99')](this[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]]['starttime'],_0x9fd9('0x5b'));if(this[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x64')]){this['channels'][_0x4bc4b4['uniqueid']][_0x9fd9('0x9a')]=_0xa6b3f9['diff'](this[_0x9fd9('0x1b')][_0x4bc4b4['uniqueid']]['answertime'],_0x9fd9('0x5b'));this['channels'][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x66')]=this['channels'][_0x4bc4b4['uniqueid']][_0x9fd9('0x59')]-this[_0x9fd9('0x1b')][_0x4bc4b4['uniqueid']]['billableseconds'];}if(_0x4bc4b4[_0x9fd9('0x3c')]===_0x9fd9('0x3d')){if(this['agents'][_0x4bc4b4[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]]){this[_0x9fd9('0x1c')][_0x4bc4b4[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]]=_['omit'](this[_0x9fd9('0x1c')][_0x4bc4b4[_0x9fd9('0x3e')]['split']('-')[0x0]],[_0x9fd9('0x41')]);logger[_0x9fd9('0x37')](_0x9fd9('0x9b'),_0x4bc4b4[_0x9fd9('0x35')],util[_0x9fd9('0x38')]({'id':this[_0x9fd9('0x1c')][_0x4bc4b4[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4bc4b4[_0x9fd9('0x3e')][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')]},{'showHidden':![],'depth':null}));this[_0x9fd9('0x32')](util[_0x9fd9('0x49')](_0x9fd9('0x4e'),this['agents'][_0x4bc4b4[_0x9fd9('0x3e')]['split']('-')[0x0]]['name']),_0x9fd9('0x9c'),{'id':this[_0x9fd9('0x1c')][_0x4bc4b4[_0x9fd9('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9fd9('0x1c')][_0x4bc4b4['channel'][_0x9fd9('0x40')]('-')[0x0]][_0x9fd9('0x44')]});}}var _0x2ca9ee=this;Promise[_0x9fd9('0x9d')]()[_0x9fd9('0x9e')](function(){var _0x31cad6=_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]];if(typeof _0x31cad6[_0x9fd9('0x9f')]===_0x9fd9('0xa0'))return;if(_[_0x9fd9('0xa1')](_0x31cad6[_0x9fd9('0x76')]))return;return RpcSetting['getSettings']()[_0x9fd9('0x9e')](function(_0x59eef3){if(!_0x59eef3['stopRecordingOnTransfer'])return;return Promise[_0x9fd9('0x9d')]()[_0x9fd9('0x9e')](function(){return ami['Action']({'action':_0x9fd9('0xa2'),'channel':_0x31cad6[_0x9fd9('0x3e')]})[_0x9fd9('0xa3')](function(){});})[_0x9fd9('0x9e')](function(){return ami[_0x9fd9('0xa4')]({'action':_0x9fd9('0xa2'),'channel':_0x31cad6[_0x9fd9('0x69')]})['catch'](function(){})[_0x9fd9('0xa5')](function(){var _0x3a9b37=_0x2ca9ee[_0x9fd9('0x1c')][_0x31cad6['destinationchannel'][_0x9fd9('0x40')]('-')[0x0]];if(!_0x3a9b37)return;io[_0x9fd9('0x32')](_0x9fd9('0xa6'),{'agentId':_0x3a9b37['id'],'uniqueid':_0x31cad6[_0x9fd9('0x35')]});});});});})[_0x9fd9('0x9e')](function(){if(_0x4bc4b4['event']===_0x9fd9('0xa7')){_0x2ca9ee['blindTransfers'][_0x4bc4b4[_0x9fd9('0x35')]]=_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4['uniqueid']];}else{if(_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0xa8')]===_0x9fd9('0xa9')&&_0x2ca9ee[_0x9fd9('0x1d')][_0x4bc4b4['uniqueid']]){_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4['uniqueid']]['uniqueid']=[_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x39')],_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]][_0x9fd9('0x39')]=_0x2ca9ee['channels'][_0x4bc4b4['uniqueid']][_0x9fd9('0x35')]][0x0];delete _0x2ca9ee[_0x9fd9('0x1d')][_0x4bc4b4[_0x9fd9('0x35')]];}}logger[_0x9fd9('0x37')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x4bc4b4['uniqueid'],util['inspect'](_0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]],{'showHidden':![],'depth':null}));ami[_0x9fd9('0x32')](_0x9fd9('0xaa'),_0x2ca9ee['channels'][_0x4bc4b4[_0x9fd9('0x35')]]);delete _0x2ca9ee[_0x9fd9('0x1b')][_0x4bc4b4[_0x9fd9('0x35')]];});}}}catch(_0x5174b2){logger[_0x9fd9('0x50')](_0x9fd9('0xab'),_0x4bc4b4[_0x9fd9('0x35')],util['inspect'](_0x5174b2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')]['syncAttendedTransfer']=function(_0x3281ca){try{if(this[_0x9fd9('0x34')](_0x3281ca)){logger[_0x9fd9('0x2d')](_0x9fd9('0xac'),_0x3281ca[_0x9fd9('0x35')],_0x3281ca[_0x9fd9('0xad')],_0x3281ca['transfertargetcalleridnum']);logger[_0x9fd9('0x37')](_0x9fd9('0xae'),_0x3281ca[_0x9fd9('0x35')],util['inspect'](_0x3281ca,{'showHidden':![],'depth':null}));if(this['channels'][_0x3281ca[_0x9fd9('0xaf')]]){this['channels'][_0x3281ca[_0x9fd9('0xaf')]][_0x9fd9('0xb0')]=_0x3281ca[_0x9fd9('0xad')];this[_0x9fd9('0x1b')][_0x3281ca['transfereeuniqueid']][_0x9fd9('0xb1')]=_0x3281ca[_0x9fd9('0xb2')];if(this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb3')]]){var _0x19ee75=this['channels'][_0x3281ca[_0x9fd9('0xb3')]];this['channels'][_0x3281ca[_0x9fd9('0xb3')]]=this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xaf')]];this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xaf')]]=_0x19ee75;}}else if(this[_0x9fd9('0x1b')][_0x3281ca['transfertargetuniqueid']]){this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb4')]][_0x9fd9('0xb0')]=_0x3281ca[_0x9fd9('0xad')];this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb4')]][_0x9fd9('0xb1')]=_0x3281ca[_0x9fd9('0xb2')];if(this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb5')]]){var _0x19ee75=this[_0x9fd9('0x1b')][_0x3281ca['origtransfereruniqueid']];this[_0x9fd9('0x1b')][_0x3281ca['origtransfereruniqueid']]=this['channels'][_0x3281ca[_0x9fd9('0xb4')]];this['channels'][_0x3281ca[_0x9fd9('0xb4')]]=_0x19ee75;}}if((this['channels'][_0x3281ca[_0x9fd9('0xb5')]]||this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb6')]])&&this[_0x9fd9('0x1b')][_0x3281ca['secondtransfereruniqueid']]){var _0x5583f6=_['some']([this[_0x9fd9('0x1b')][_0x3281ca['origtransfereruniqueid']],this['channels'][_0x3281ca[_0x9fd9('0xb6')]],this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb3')]]],function(_0x513992){return _0x513992&&_0x513992[_0x9fd9('0xa8')]===_0x9fd9('0xa9')&&_0x513992[_0x9fd9('0xb7')];});if(_0x5583f6){if(this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb5')]])this['channels'][_0x3281ca[_0x9fd9('0xb5')]]['transferType']=_0x9fd9('0xb8');if(this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb6')]])this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb6')]]['transferType']=_0x9fd9('0xb8');this[_0x9fd9('0x1b')][_0x3281ca[_0x9fd9('0xb3')]][_0x9fd9('0x9f')]=_0x9fd9('0xb8');}}}}catch(_0x359d4d){logger[_0x9fd9('0x50')]('[%s][voiceCallReport][attendedtransfer]',_0x3281ca[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x359d4d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')]['syncBlindTransfer']=function(_0x20018a){try{if(this['isNotNull'](_0x20018a)){logger[_0x9fd9('0x2d')](_0x9fd9('0xb9'),_0x20018a['uniqueid'],_0x20018a[_0x9fd9('0xba')],_0x20018a[_0x9fd9('0xbb')]);logger[_0x9fd9('0x37')](_0x9fd9('0xbc'),_0x20018a[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x20018a,{'showHidden':![],'depth':null}));if(this['channels'][_0x20018a['transfereeuniqueid']]){this[_0x9fd9('0x1b')][_0x20018a[_0x9fd9('0xaf')]][_0x9fd9('0xb0')]=_0x20018a[_0x9fd9('0xba')];this['channels'][_0x20018a['transfereeuniqueid']][_0x9fd9('0xb1')]=_0x20018a[_0x9fd9('0xbb')];this['channels'][_0x20018a[_0x9fd9('0xaf')]][_0x9fd9('0x9f')]=_0x9fd9('0xbd');this[_0x9fd9('0x26')]({'event':_0x9fd9('0xa7'),'uniqueid':_0x20018a[_0x9fd9('0xaf')],'context':_0x20018a[_0x9fd9('0x3c')],'channel':_0x20018a[_0x9fd9('0xbe')]});}else{this['channels'][_0x20018a[_0x9fd9('0xbf')]]['transferType']='BLIND';}}}catch(_0x1ef1be){logger[_0x9fd9('0x50')](_0x9fd9('0xc0'),_0x20018a['uniqueid'],util['inspect'](_0x1ef1be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x2b')]=function(_0x439e73){try{if(this[_0x9fd9('0x34')](_0x439e73)){logger[_0x9fd9('0x37')](_0x9fd9('0xc1'),_0x439e73[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x439e73,{'showHidden':![],'depth':null}));if(this['channels'][_0x439e73[_0x9fd9('0x35')]]){if(!_[_0x9fd9('0xc2')](this['channels'][_0x439e73[_0x9fd9('0x35')]][_0x9fd9('0x65')])){this['channels'][_0x439e73[_0x9fd9('0x35')]][_0x9fd9('0xc3')]=moment()[_0x9fd9('0x49')](_0x9fd9('0x4a'));logger[_0x9fd9('0x2d')](_0x9fd9('0xc4'),_0x439e73[_0x9fd9('0x35')],this[_0x9fd9('0x1b')][_0x439e73[_0x9fd9('0x35')]][_0x9fd9('0xc3')]);}}}}catch(_0x1cfb9d){logger[_0x9fd9('0x50')](_0x9fd9('0xc5'),_0x439e73[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x1cfb9d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9fd9('0x30')][_0x9fd9('0x2c')]=function(_0xc6a16c){try{if(this[_0x9fd9('0x34')](_0xc6a16c)){logger[_0x9fd9('0x37')](_0x9fd9('0xc6'),_0xc6a16c[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0xc6a16c,{'showHidden':![],'depth':null}));if(this['channels'][_0xc6a16c[_0x9fd9('0x35')]]){if(!_[_0x9fd9('0xc2')](this[_0x9fd9('0x1b')][_0xc6a16c[_0x9fd9('0x35')]][_0x9fd9('0xc3')])){this[_0x9fd9('0x1b')][_0xc6a16c['uniqueid']][_0x9fd9('0xc7')]+=moment()[_0x9fd9('0xc8')](0x0)['diff'](this[_0x9fd9('0x1b')][_0xc6a16c['uniqueid']]['mohstarttime'],_0x9fd9('0x5b'));logger['info'](_0x9fd9('0xc9'),_0xc6a16c[_0x9fd9('0x35')],this[_0x9fd9('0x1b')][_0xc6a16c[_0x9fd9('0x35')]][_0x9fd9('0xc7')]);delete this[_0x9fd9('0x1b')][_0xc6a16c[_0x9fd9('0x35')]][_0x9fd9('0xc3')];}}}}catch(_0x38950a){logger[_0x9fd9('0x50')]('[%s][voiceCallReport][musiconholdstop]',_0xc6a16c[_0x9fd9('0x35')],util[_0x9fd9('0x38')](_0x38950a,{'showHidden':![],'depth':null}));}};module[_0x9fd9('0xca')]=VoiceCallReport;
\ No newline at end of file
index d7a93bd..809e705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dce=['[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%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:','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','memberinterface','memberlastcall','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20event:','cause-txt','duration','endtime','diff','seconds','complete','outbound','total','holdtime','sumHoldTime','sumBillable','billableseconds','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','startsWith','cdr(','split','match','lodash','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','channels','outboundChannels','applications','variables','dialbegin','dialend','syncDialEnd','bind','varset','syncVarSet','syncNewExten','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','syncDialBegin','debug','inspect','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','uniqueid','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound'];(function(_0x2af896,_0x118a13){var _0x46a06e=function(_0x5a67bc){while(--_0x5a67bc){_0x2af896['push'](_0x2af896['shift']());}};_0x46a06e(++_0x118a13);}(_0x4dce,0xae));var _0xe4dc=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0x4dce[_0x5cf1a1];return _0x52cbcc;};'use strict';var _=require(_0xe4dc('0x0'));var moment=require(_0xe4dc('0x1'));var util=require('util');var Redis=require(_0xe4dc('0x2'));var config=require('../../../config/environment');var logger=require(_0xe4dc('0x3'))(_0xe4dc('0x4'));var ami=require(_0xe4dc('0x5'));config[_0xe4dc('0x6')]=_[_0xe4dc('0x7')](config[_0xe4dc('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe4dc('0x6')]));function VoiceDialReport(_0x5a342f){this[_0xe4dc('0x8')]=_0x5a342f[_0xe4dc('0x9')];this['outbound']=_0x5a342f['outbound'];this[_0xe4dc('0xa')]={};this[_0xe4dc('0xb')]={};ami['on'](_0xe4dc('0xc'),this['syncDialBegin']['bind'](this));ami['on'](_0xe4dc('0xd'),this[_0xe4dc('0xe')][_0xe4dc('0xf')](this));ami['on'](_0xe4dc('0x10'),this[_0xe4dc('0x11')][_0xe4dc('0xf')](this));ami['on']('newexten',this[_0xe4dc('0x12')]['bind'](this));ami['on'](_0xe4dc('0x13'),this[_0xe4dc('0x14')]['bind'](this));}VoiceDialReport['prototype'][_0xe4dc('0x15')]=function(_0x292bac){return _0x292bac!==null&&!_[_0xe4dc('0x16')](_0x292bac);};VoiceDialReport[_0xe4dc('0x17')]['emit']=function(_0x3f3451,_0x3be5f6,_0x353594){io['to'](_0x3f3451)[_0xe4dc('0x18')](_0x3be5f6,_0x353594);};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0x19')]=function(_0x4e78b9){try{if(this[_0xe4dc('0x15')](_0x4e78b9)){logger[_0xe4dc('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x4e78b9['uniqueid'],util[_0xe4dc('0x1b')](_0x4e78b9,{'showHidden':![],'depth':null}));if(this[_0xe4dc('0x8')][_0x4e78b9['uniqueid']]){_['merge'](this[_0xe4dc('0x8')][_0x4e78b9['uniqueid']],{'starttime':moment()[_0xe4dc('0x1c')](_0xe4dc('0x1d')),'lastevent':'called','interface':_0x4e78b9[_0xe4dc('0x1e')][_0xe4dc('0x1f')](0x0,_0x4e78b9[_0xe4dc('0x1e')][_0xe4dc('0x20')]('-')),'membername':_0x4e78b9[_0xe4dc('0x1e')][_0xe4dc('0x1f')](_0x4e78b9['channel'][_0xe4dc('0x20')]('/')+0x1,_0x4e78b9['channel']['lastIndexOf']('-'))},_[_0xe4dc('0x21')](_0x4e78b9,['event','privilege']));logger[_0xe4dc('0x22')](_0xe4dc('0x23'),_0x4e78b9[_0xe4dc('0x24')],this['channels'][_0x4e78b9[_0xe4dc('0x24')]]['membername'],this[_0xe4dc('0x8')][_0x4e78b9[_0xe4dc('0x24')]][_0xe4dc('0x25')]);logger[_0xe4dc('0x1a')](_0xe4dc('0x26'),_0x4e78b9[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x4e78b9[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));if(this[_0xe4dc('0xa')][_0x4e78b9[_0xe4dc('0x24')]])_['merge'](this[_0xe4dc('0x8')][_0x4e78b9[_0xe4dc('0x24')]],this['applications'][_0x4e78b9['uniqueid']]);this[_0xe4dc('0x18')](_0xe4dc('0x27'),'voice_outbound_channel:save',this[_0xe4dc('0x8')][_0x4e78b9[_0xe4dc('0x24')]]);logger[_0xe4dc('0x1a')](_0xe4dc('0x28'),_0x4e78b9[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x4e78b9[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0xe4dc('0x29'),this['channels'][_0x4e78b9[_0xe4dc('0x24')]]);}}}catch(_0x4d1bc7){logger[_0xe4dc('0x2a')](_0xe4dc('0x2b'),_0x4e78b9['uniqueid'],util[_0xe4dc('0x1b')](_0x4d1bc7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0xe')]=function(_0x2fe8b0){try{if(this[_0xe4dc('0x15')](_0x2fe8b0)){logger[_0xe4dc('0x1a')](_0xe4dc('0x2c'),_0x2fe8b0[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](_0x2fe8b0,{'showHidden':![],'depth':null}));if(this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]]){this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]][_0xe4dc('0x2d')]=_0x2fe8b0[_0xe4dc('0x2d')];if(_0x2fe8b0[_0xe4dc('0x2d')]===_0xe4dc('0x2e')){this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]]['connectedlinenum']=_0x2fe8b0[_0xe4dc('0x2f')];this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]][_0xe4dc('0x30')]=_0x2fe8b0[_0xe4dc('0x30')];this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]][_0xe4dc('0x31')]=moment()['format'](_0xe4dc('0x1d'));this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]][_0xe4dc('0x32')]=_0xe4dc('0x33');logger[_0xe4dc('0x22')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x2fe8b0['uniqueid'],_0x2fe8b0['channel']['substring'](_0x2fe8b0[_0xe4dc('0x1e')][_0xe4dc('0x20')]('/')+0x1,_0x2fe8b0[_0xe4dc('0x1e')][_0xe4dc('0x20')]('-')));logger[_0xe4dc('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x2fe8b0[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this['channels'][_0x2fe8b0[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe4dc('0x18')]('custom:dialconnect',this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]]);}logger[_0xe4dc('0x1a')](_0xe4dc('0x34'),_0x2fe8b0[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));this[_0xe4dc('0x18')]('voice:outbound',_0xe4dc('0x35'),this[_0xe4dc('0x8')][_0x2fe8b0[_0xe4dc('0x24')]]);}}}catch(_0x41d281){logger[_0xe4dc('0x2a')](_0xe4dc('0x36'),_0x2fe8b0[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](_0x41d281,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0x11')]=function(_0x461ab1){try{if(this[_0xe4dc('0x15')](_0x461ab1)){logger[_0xe4dc('0x1a')](_0xe4dc('0x37'),_0x461ab1['uniqueid'],util['inspect'](_0x461ab1,{'showHidden':![],'depth':null}));this[_0xe4dc('0x38')](_0x461ab1[_0xe4dc('0x24')],_[_0xe4dc('0x39')](_0x461ab1[_0xe4dc('0x3a')])[0x0],_0x461ab1[_0xe4dc('0x3b')]);if(this[_0xe4dc('0x15')](_0x461ab1[_0xe4dc('0x3a')])&&this[_0xe4dc('0x15')](_0x461ab1['variable'][_0xe4dc('0x3c')])){if(_[_0xe4dc('0x16')](this[_0xe4dc('0x8')][_0x461ab1[_0xe4dc('0x24')]])){this[_0xe4dc('0x8')][_0x461ab1['uniqueid']]={'routeId':_0x461ab1[_0xe4dc('0x3b')],'variables':this[_0xe4dc('0xb')][_0x461ab1[_0xe4dc('0x24')]]};logger[_0xe4dc('0x22')](_0xe4dc('0x3d'),_0x461ab1[_0xe4dc('0x24')],_0x461ab1['variable'][_0xe4dc('0x3c')],_[_0xe4dc('0x39')](_0x461ab1[_0xe4dc('0x3a')])[0x0],_0x461ab1[_0xe4dc('0x3b')]);logger[_0xe4dc('0x1a')](_0xe4dc('0x3e'),_0x461ab1[_0xe4dc('0x24')],util['inspect'](this[_0xe4dc('0x8')][_0x461ab1['uniqueid']],{'showHidden':![],'depth':null}));this[_0xe4dc('0x18')](_0xe4dc('0x27'),_0xe4dc('0x35'),this[_0xe4dc('0x8')][_0x461ab1[_0xe4dc('0x24')]]);}}}}catch(_0x478dce){logger[_0xe4dc('0x2a')](_0xe4dc('0x3f'),_0x461ab1[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](_0x478dce,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0x38')]=function(_0x3bf3d5,_0x50f7e9,_0x280bef){var _0x4e0bcc=['rtpaudioqos',_0xe4dc('0x40'),_0xe4dc('0x41'),_0xe4dc('0x42'),_0xe4dc('0x43'),'rtpaudioqoslossbridged',_0xe4dc('0x44'),'rtpaudioqosrttbridged',_0xe4dc('0x45'),_0xe4dc('0x46'),'bridgepeer','bridgepvtcallid','membercalls','memberdynamic',_0xe4dc('0x47'),_0xe4dc('0x48'),'membername',_0xe4dc('0x49'),_0xe4dc('0x4a')];if(!_['isNil'](_0x50f7e9)&&!_['includes'](_0x4e0bcc,_0x50f7e9)){if(_[_0xe4dc('0x16')](this[_0xe4dc('0xb')][_0x3bf3d5])){this[_0xe4dc('0xb')][_0x3bf3d5]={};}this[_0xe4dc('0xb')][_0x3bf3d5][_0x50f7e9]=_0x280bef;}};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0x14')]=function(_0x543a2c){try{if(this[_0xe4dc('0x15')](_0x543a2c)){logger[_0xe4dc('0x1a')](_0xe4dc('0x4b'),_0x543a2c['uniqueid'],util['inspect'](_0x543a2c,{'showHidden':![],'depth':null}));if(this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]]){logger[_0xe4dc('0x22')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x543a2c['uniqueid'],_0x543a2c[_0xe4dc('0x4c')]);this[_0xe4dc('0x8')][_0x543a2c['uniqueid']]['endtime']=moment()[_0xe4dc('0x1c')](_0xe4dc('0x1d'));this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x4d')]=moment(this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x4e')])[_0xe4dc('0x4f')](this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]]['starttime'],_0xe4dc('0x50'));this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x32')]=_0xe4dc('0x51');this[_0xe4dc('0x52')][_0xe4dc('0x53')]+=0x1;if(this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x31')]){this[_0xe4dc('0x52')]['answered']+=0x1;this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x54')]=moment(this[_0xe4dc('0x8')][_0x543a2c['uniqueid']]['answertime'])[_0xe4dc('0x4f')](this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]]['starttime'],_0xe4dc('0x50'));this['channels'][_0x543a2c[_0xe4dc('0x24')]]['billableseconds']=moment(this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x4e')])[_0xe4dc('0x4f')](this[_0xe4dc('0x8')][_0x543a2c['uniqueid']]['answertime'],'seconds');this['outbound'][_0xe4dc('0x55')]+=this['channels'][_0x543a2c['uniqueid']][_0xe4dc('0x54')]||0x0;this[_0xe4dc('0x52')][_0xe4dc('0x56')]+=this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x57')];}this['outbound']['sumDuration']+=this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]][_0xe4dc('0x4d')];logger[_0xe4dc('0x1a')](_0xe4dc('0x58'),_0x543a2c[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x543a2c['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xe4dc('0x18')](_0xe4dc('0x59'),this[_0xe4dc('0x8')][_0x543a2c['uniqueid']]);logger['debug'](_0xe4dc('0x5a'),_0x543a2c[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe4dc('0x18')]('custom:dialend',this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]]);logger['debug'](_0xe4dc('0x5b'),_0x543a2c['uniqueid'],util[_0xe4dc('0x1b')](this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));this['emit'](_0xe4dc('0x27'),_0xe4dc('0x5c'),this['outbound']);logger[_0xe4dc('0x22')](_0xe4dc('0x5d'),JSON['stringify'](this[_0xe4dc('0x8')][_0x543a2c['uniqueid']]));logger['debug'](_0xe4dc('0x5e'),_0x543a2c[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](this['channels'][_0x543a2c[_0xe4dc('0x24')]],{'showHidden':![],'depth':null}));this[_0xe4dc('0x18')]('voice:outbound',_0xe4dc('0x5f'),this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]]);delete this[_0xe4dc('0x8')][_0x543a2c[_0xe4dc('0x24')]];}else if(this[_0xe4dc('0x8')][_0x543a2c['linkedid']]){this[_0xe4dc('0x8')][_0x543a2c['linkedid']][_0xe4dc('0x24')]=this['channels'][_0x543a2c[_0xe4dc('0x60')]][_0xe4dc('0x61')];}if(this[_0xe4dc('0xb')][_0x543a2c[_0xe4dc('0x24')]]){delete this[_0xe4dc('0xb')][_0x543a2c[_0xe4dc('0x24')]];}}}catch(_0x4ed965){logger['error'](_0xe4dc('0x62'),_0x543a2c[_0xe4dc('0x24')],util['inspect'](_0x4ed965,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe4dc('0x17')][_0xe4dc('0x12')]=function(_0x374304){try{if(this[_0xe4dc('0x15')](_0x374304)){logger[_0xe4dc('0x1a')](_0xe4dc('0x63'),_0x374304[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](_0x374304,{'showHidden':![],'depth':null}));if(_0x374304[_0xe4dc('0x64')][_0xe4dc('0x65')]()==='set'){_0x374304[_0xe4dc('0x66')]=(_0x374304['appdata']||_0x374304[_0xe4dc('0x66')])[_0xe4dc('0x65')]();if(_[_0xe4dc('0x67')](_0x374304['applicationdata'],_0xe4dc('0x68'))){if(_['isUndefined'](this[_0xe4dc('0xa')][_0x374304[_0xe4dc('0x24')]]))this[_0xe4dc('0xa')][_0x374304[_0xe4dc('0x24')]]={};logger['info']('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x374304['uniqueid'],_0x374304[_0xe4dc('0x64')],_0x374304['applicationdata']);var _0x1ca578=_0x374304[_0xe4dc('0x66')][_0xe4dc('0x69')]('=');var _0x590f39=_0x1ca578[0x0][_0xe4dc('0x6a')](/cdr\((.*)\)/);if(_0x590f39)this[_0xe4dc('0xa')][_0x374304[_0xe4dc('0x24')]][_0x590f39[0x1]]=_0x1ca578[0x1];}}}}catch(_0x18e76b){logger['error']('[%s][voiceDialReport][newexten]',_0x374304[_0xe4dc('0x24')],util[_0xe4dc('0x1b')](_0x18e76b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x852c=['info','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','diff','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncVarSet','newexten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','called','substring','channel','lastIndexOf','event','privilege'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x852c,0x1bb));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc852('0x0'));var moment=require(_0xc852('0x1'));var util=require(_0xc852('0x2'));var Redis=require(_0xc852('0x3'));var config=require('../../../config/environment');var logger=require(_0xc852('0x4'))('ami');var ami=require(_0xc852('0x5'));config['redis']=_['defaults'](config[_0xc852('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc852('0x7'))(new Redis(config[_0xc852('0x6')]));function VoiceDialReport(_0x2a7063){this[_0xc852('0x8')]=_0x2a7063[_0xc852('0x9')];this['outbound']=_0x2a7063[_0xc852('0xa')];this[_0xc852('0xb')]={};this[_0xc852('0xc')]={};ami['on'](_0xc852('0xd'),this[_0xc852('0xe')][_0xc852('0xf')](this));ami['on'](_0xc852('0x10'),this['syncDialEnd']['bind'](this));ami['on']('varset',this[_0xc852('0x11')][_0xc852('0xf')](this));ami['on'](_0xc852('0x12'),this['syncNewExten']['bind'](this));ami['on'](_0xc852('0x13'),this[_0xc852('0x14')][_0xc852('0xf')](this));}VoiceDialReport[_0xc852('0x15')][_0xc852('0x16')]=function(_0x2dc690){return _0x2dc690!==null&&!_[_0xc852('0x17')](_0x2dc690);};VoiceDialReport[_0xc852('0x15')][_0xc852('0x18')]=function(_0x3d77b1,_0x5b75c2,_0x49b911){io['to'](_0x3d77b1)['emit'](_0x5b75c2,_0x49b911);};VoiceDialReport[_0xc852('0x15')][_0xc852('0xe')]=function(_0x38c763){try{if(this[_0xc852('0x16')](_0x38c763)){logger[_0xc852('0x19')](_0xc852('0x1a'),_0x38c763['uniqueid'],util[_0xc852('0x1b')](_0x38c763,{'showHidden':![],'depth':null}));if(this[_0xc852('0x8')][_0x38c763[_0xc852('0x1c')]]){_[_0xc852('0x1d')](this[_0xc852('0x8')][_0x38c763[_0xc852('0x1c')]],{'starttime':moment()[_0xc852('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xc852('0x1f'),'interface':_0x38c763['channel'][_0xc852('0x20')](0x0,_0x38c763[_0xc852('0x21')]['lastIndexOf']('-')),'membername':_0x38c763[_0xc852('0x21')][_0xc852('0x20')](_0x38c763[_0xc852('0x21')][_0xc852('0x22')]('/')+0x1,_0x38c763[_0xc852('0x21')][_0xc852('0x22')]('-'))},_['omit'](_0x38c763,[_0xc852('0x23'),_0xc852('0x24')]));logger[_0xc852('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x38c763[_0xc852('0x1c')],this['channels'][_0x38c763[_0xc852('0x1c')]][_0xc852('0x26')],this[_0xc852('0x8')][_0x38c763[_0xc852('0x1c')]][_0xc852('0x27')]);logger[_0xc852('0x19')](_0xc852('0x28'),_0x38c763['uniqueid'],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0x38c763['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0xc852('0xb')][_0x38c763[_0xc852('0x1c')]])_[_0xc852('0x1d')](this[_0xc852('0x8')][_0x38c763['uniqueid']],this[_0xc852('0xb')][_0x38c763['uniqueid']]);this[_0xc852('0x18')](_0xc852('0x29'),'voice_outbound_channel:save',this['channels'][_0x38c763['uniqueid']]);logger[_0xc852('0x19')](_0xc852('0x2a'),_0x38c763[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0x38c763[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xc852('0x2b'),this[_0xc852('0x8')][_0x38c763[_0xc852('0x1c')]]);}}}catch(_0x19614b){logger[_0xc852('0x2c')](_0xc852('0x2d'),_0x38c763[_0xc852('0x1c')],util['inspect'](_0x19614b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xc852('0x2e')]=function(_0x549ca9){try{if(this[_0xc852('0x16')](_0x549ca9)){logger[_0xc852('0x19')](_0xc852('0x2f'),_0x549ca9[_0xc852('0x1c')],util[_0xc852('0x1b')](_0x549ca9,{'showHidden':![],'depth':null}));if(this['channels'][_0x549ca9[_0xc852('0x1c')]]){this[_0xc852('0x8')][_0x549ca9['uniqueid']]['dialstatus']=_0x549ca9[_0xc852('0x30')];if(_0x549ca9[_0xc852('0x30')]===_0xc852('0x31')){this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]]['connectedlinenum']=_0x549ca9[_0xc852('0x32')];this['channels'][_0x549ca9['uniqueid']][_0xc852('0x33')]=_0x549ca9[_0xc852('0x33')];this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]][_0xc852('0x34')]=moment()[_0xc852('0x1e')](_0xc852('0x35'));this[_0xc852('0x8')][_0x549ca9['uniqueid']][_0xc852('0x36')]=_0xc852('0x37');logger[_0xc852('0x25')](_0xc852('0x38'),_0x549ca9[_0xc852('0x1c')],_0x549ca9[_0xc852('0x21')][_0xc852('0x20')](_0x549ca9[_0xc852('0x21')][_0xc852('0x22')]('/')+0x1,_0x549ca9['channel'][_0xc852('0x22')]('-')));logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x549ca9[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xc852('0x39'),this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]]);}logger[_0xc852('0x19')](_0xc852('0x3a'),_0x549ca9[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));this[_0xc852('0x18')](_0xc852('0x29'),_0xc852('0x3b'),this[_0xc852('0x8')][_0x549ca9[_0xc852('0x1c')]]);}}}catch(_0x145c42){logger[_0xc852('0x2c')](_0xc852('0x3c'),_0x549ca9[_0xc852('0x1c')],util['inspect'](_0x145c42,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc852('0x15')][_0xc852('0x11')]=function(_0xcdb3d){try{if(this[_0xc852('0x16')](_0xcdb3d)){logger[_0xc852('0x19')](_0xc852('0x3d'),_0xcdb3d[_0xc852('0x1c')],util['inspect'](_0xcdb3d,{'showHidden':![],'depth':null}));this[_0xc852('0x3e')](_0xcdb3d[_0xc852('0x1c')],_[_0xc852('0x3f')](_0xcdb3d['variable'])[0x0],_0xcdb3d['value']);if(this[_0xc852('0x16')](_0xcdb3d[_0xc852('0x40')])&&this[_0xc852('0x16')](_0xcdb3d[_0xc852('0x40')]['outboundrouteid'])){if(_[_0xc852('0x17')](this[_0xc852('0x8')][_0xcdb3d[_0xc852('0x1c')]])){this['channels'][_0xcdb3d['uniqueid']]={'routeId':_0xcdb3d[_0xc852('0x41')],'variables':this[_0xc852('0xc')][_0xcdb3d[_0xc852('0x1c')]]};logger[_0xc852('0x25')](_0xc852('0x42'),_0xcdb3d[_0xc852('0x1c')],_0xcdb3d['variable'][_0xc852('0x43')],_[_0xc852('0x3f')](_0xcdb3d['variable'])[0x0],_0xcdb3d['value']);logger[_0xc852('0x19')](_0xc852('0x44'),_0xcdb3d[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0xcdb3d['uniqueid']],{'showHidden':![],'depth':null}));this[_0xc852('0x18')](_0xc852('0x29'),_0xc852('0x3b'),this['channels'][_0xcdb3d[_0xc852('0x1c')]]);}}}}catch(_0x47212c){logger[_0xc852('0x2c')](_0xc852('0x45'),_0xcdb3d[_0xc852('0x1c')],util[_0xc852('0x1b')](_0x47212c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc852('0x15')][_0xc852('0x3e')]=function(_0x25f357,_0x10bde2,_0x4c9e67){var _0x497832=[_0xc852('0x46'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xc852('0x47'),'rtpaudioqosloss',_0xc852('0x48'),_0xc852('0x49'),_0xc852('0x4a'),_0xc852('0x4b'),_0xc852('0x4c'),_0xc852('0x4d'),_0xc852('0x4e'),'membercalls','memberdynamic',_0xc852('0x4f'),'memberlastcall',_0xc852('0x26'),_0xc852('0x50'),_0xc852('0x51')];if(!_[_0xc852('0x52')](_0x10bde2)&&!_[_0xc852('0x53')](_0x497832,_0x10bde2)){if(_[_0xc852('0x17')](this[_0xc852('0xc')][_0x25f357])){this[_0xc852('0xc')][_0x25f357]={};}this[_0xc852('0xc')][_0x25f357][_0x10bde2]=_0x4c9e67;}};VoiceDialReport[_0xc852('0x15')][_0xc852('0x14')]=function(_0xa33e2e){try{if(this[_0xc852('0x16')](_0xa33e2e)){logger['debug'](_0xc852('0x54'),_0xa33e2e['uniqueid'],util[_0xc852('0x1b')](_0xa33e2e,{'showHidden':![],'depth':null}));if(this['channels'][_0xa33e2e[_0xc852('0x1c')]]){logger[_0xc852('0x25')](_0xc852('0x55'),_0xa33e2e['uniqueid'],_0xa33e2e['cause-txt']);this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x56')]=moment()['format'](_0xc852('0x35'));this[_0xc852('0x8')][_0xa33e2e['uniqueid']][_0xc852('0x57')]=moment(this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]]['endtime'])[_0xc852('0x58')](this[_0xc852('0x8')][_0xa33e2e['uniqueid']]['starttime'],_0xc852('0x59'));this['channels'][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x36')]=_0xc852('0x5a');this['outbound'][_0xc852('0x5b')]+=0x1;if(this[_0xc852('0x8')][_0xa33e2e['uniqueid']][_0xc852('0x34')]){this['outbound']['answered']+=0x1;this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x5c')]=moment(this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x34')])[_0xc852('0x58')](this['channels'][_0xa33e2e[_0xc852('0x1c')]]['starttime'],_0xc852('0x59'));this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x5d')]=moment(this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x56')])[_0xc852('0x58')](this['channels'][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x34')],_0xc852('0x59'));this[_0xc852('0xa')][_0xc852('0x5e')]+=this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x5c')]||0x0;this[_0xc852('0xa')][_0xc852('0x5f')]+=this['channels'][_0xa33e2e[_0xc852('0x1c')]][_0xc852('0x5d')];}this[_0xc852('0xa')][_0xc852('0x60')]+=this[_0xc852('0x8')][_0xa33e2e['uniqueid']][_0xc852('0x57')];logger[_0xc852('0x19')](_0xc852('0x61'),_0xa33e2e[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xc852('0x62'),this['channels'][_0xa33e2e[_0xc852('0x1c')]]);logger[_0xc852('0x19')](_0xc852('0x63'),_0xa33e2e[_0xc852('0x1c')],util[_0xc852('0x1b')](this['channels'][_0xa33e2e[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xc852('0x18')](_0xc852('0x64'),this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]]);logger['debug'](_0xc852('0x65'),_0xa33e2e[_0xc852('0x1c')],util[_0xc852('0x1b')](this[_0xc852('0x8')][_0xa33e2e['uniqueid']],{'showHidden':![],'depth':null}));this[_0xc852('0x18')](_0xc852('0x29'),_0xc852('0x66'),this[_0xc852('0xa')]);logger[_0xc852('0x25')](_0xc852('0x67'),JSON[_0xc852('0x68')](this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]]));logger[_0xc852('0x19')](_0xc852('0x69'),_0xa33e2e[_0xc852('0x1c')],util[_0xc852('0x1b')](this['channels'][_0xa33e2e[_0xc852('0x1c')]],{'showHidden':![],'depth':null}));this[_0xc852('0x18')]('voice:outbound',_0xc852('0x6a'),this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x1c')]]);delete this[_0xc852('0x8')][_0xa33e2e['uniqueid']];}else if(this['channels'][_0xa33e2e[_0xc852('0x6b')]]){this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x6b')]][_0xc852('0x1c')]=this[_0xc852('0x8')][_0xa33e2e[_0xc852('0x6b')]]['destuniqueid'];}if(this[_0xc852('0xc')][_0xa33e2e['uniqueid']]){delete this[_0xc852('0xc')][_0xa33e2e[_0xc852('0x1c')]];}}}catch(_0x151380){logger[_0xc852('0x2c')](_0xc852('0x6c'),_0xa33e2e[_0xc852('0x1c')],util[_0xc852('0x1b')](_0x151380,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc852('0x15')]['syncNewExten']=function(_0x4238cb){try{if(this[_0xc852('0x16')](_0x4238cb)){logger['debug'](_0xc852('0x6d'),_0x4238cb[_0xc852('0x1c')],util[_0xc852('0x1b')](_0x4238cb,{'showHidden':![],'depth':null}));if(_0x4238cb['application'][_0xc852('0x6e')]()==='set'){_0x4238cb[_0xc852('0x6f')]=(_0x4238cb['appdata']||_0x4238cb[_0xc852('0x6f')])[_0xc852('0x6e')]();if(_[_0xc852('0x70')](_0x4238cb[_0xc852('0x6f')],_0xc852('0x71'))){if(_[_0xc852('0x17')](this[_0xc852('0xb')][_0x4238cb[_0xc852('0x1c')]]))this[_0xc852('0xb')][_0x4238cb['uniqueid']]={};logger['info'](_0xc852('0x72'),_0x4238cb['uniqueid'],_0x4238cb[_0xc852('0x73')],_0x4238cb[_0xc852('0x6f')]);var _0x4b1327=_0x4238cb['applicationdata'][_0xc852('0x74')]('=');var _0x35af8d=_0x4b1327[0x0][_0xc852('0x75')](/cdr\((.*)\)/);if(_0x35af8d)this[_0xc852('0xb')][_0x4238cb[_0xc852('0x1c')]][_0x35af8d[0x1]]=_0x4b1327[0x1];}}}}catch(_0x4e3144){logger[_0xc852('0x2c')](_0xc852('0x76'),_0x4238cb['uniqueid'],util[_0xc852('0x1b')](_0x4e3144,{'showHidden':![],'depth':null}));}};module[_0xc852('0x77')]=VoiceDialReport;
\ No newline at end of file
index 18b3fd8..611d015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2f=['redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','queueReports','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','syncQueueSummaryComplete','bind','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','newexten','syncNewExten','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','hasOwnProperty','isEmpty','originated','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','switch','sequence','Action','catch','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','error','syncFullyBooted','agents','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug','uniqueid','format','voice:queue:%s','voice_queue_presence:save','[%s][voiceQueueReport][','name','voice_queue_presence:remove','emitVoiceQueueSummary','type','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','loopQueueSummary','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','emitVoiceQueueChannelSave','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','toLowerCase','linkedid','queuecallerexitAt','add','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','CONTINUE','queuecallerexit','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','isNil','[%s][voiceQueueReport][hangup]','diff','seconds','length','sumDuration','milliseconds','[%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','secondtransfererexten','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','startsWith','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport'];(function(_0x37d4df,_0xc3dfb5){var _0x3ee294=function(_0x2d89c1){while(--_0x2d89c1){_0x37d4df['push'](_0x37d4df['shift']());}};_0x3ee294(++_0xc3dfb5);}(_0xfa2f,0xe8));var _0xffa2=function(_0x5e6faa,_0x185618){_0x5e6faa=_0x5e6faa-0x0;var _0x51fd89=_0xfa2f[_0x5e6faa];return _0x51fd89;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xffa2('0x0'));var md5=require('md5');var Redis=require(_0xffa2('0x1'));var config=require(_0xffa2('0x2'));var logger=require(_0xffa2('0x3'))('ami');var ami=require(_0xffa2('0x4'));var QueueReport=require(_0xffa2('0x5'));config[_0xffa2('0x6')]=_[_0xffa2('0x7')](config[_0xffa2('0x6')],{'host':_0xffa2('0x8'),'port':0x18eb});var io=require(_0xffa2('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xffa2('0xa')]=function(_0x20a710){this[_0xffa2('0xb')]=this[_0xffa2('0xb')]?this[_0xffa2('0xb')][_0xffa2('0xc')](_0x20a710):_0x20a710();};function VoiceQueueReport(_0x1fa2eb){this['sequence']=new Sequence();this[_0xffa2('0xd')]={};this['agents']=_0x1fa2eb['agents'];this[_0xffa2('0xe')]=_0x1fa2eb[_0xffa2('0xf')];this[_0xffa2('0x10')]=_0x1fa2eb[_0xffa2('0x10')];this[_0xffa2('0x11')]=!![];this['campaigns']=_0x1fa2eb[_0xffa2('0x12')];this[_0xffa2('0x13')]={};ami['on'](_0xffa2('0x14'),this[_0xffa2('0x15')]['bind'](this));ami['on']('queuesummarycomplete',this[_0xffa2('0x16')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x18'),this['syncQueueCallerJoin'][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x19'),this[_0xffa2('0x1a')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x1b'),this[_0xffa2('0x1c')][_0xffa2('0x17')](this));ami['on']('agentcomplete',this[_0xffa2('0x1d')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x1e'),this[_0xffa2('0x1f')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x20'),this[_0xffa2('0x21')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x22'),this[_0xffa2('0x23')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x24'),this['syncFullyBooted'][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x25'),this[_0xffa2('0x26')]['bind'](this));ami['on'](_0xffa2('0x27'),this['syncMusicOnHoldStart'][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x28'),this[_0xffa2('0x29')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x2a'),this[_0xffa2('0x2b')][_0xffa2('0x17')](this));ami['on'](_0xffa2('0x2c'),this[_0xffa2('0x2d')][_0xffa2('0x17')](this));this['loopQueueSummary']();this[_0xffa2('0x2e')]();}function clearChannels(_0x176b7e){if(!_['isEmpty'](_0x176b7e)){for(var _0x29605e in _0x176b7e){if(_0x176b7e[_0xffa2('0x2f')](_0x29605e)){delete _0x176b7e[_0x29605e];}}}}function clearCampaigns(_0x3f2598){if(!_[_0xffa2('0x30')](_0x3f2598)){for(var _0x2a5e5e in _0x3f2598){if(_0x3f2598[_0xffa2('0x2f')](_0x2a5e5e)){_0x3f2598[_0x2a5e5e][_0xffa2('0x31')]=0x0;}}}}function clearVoiceQueues(_0x361540){if(!_['isEmpty'](_0x361540)){for(var _0x2d4376 in _0x361540){if(_0x361540[_0xffa2('0x2f')](_0x2d4376)){_0x361540[_0x2d4376][_0xffa2('0x31')]=0x0;_0x361540[_0x2d4376]['talking']=0x0;_0x361540[_0x2d4376][_0xffa2('0x32')]=0x0;_0x361540[_0x2d4376][_0xffa2('0x33')]=0x0;_0x361540[_0x2d4376][_0xffa2('0x34')]=!![];}}}}function clearAgentBooked(_0x48e67b){if(!_[_0xffa2('0x30')](_0x48e67b)){for(var _0x406d9b in _0x48e67b){if(_0x48e67b[_0xffa2('0x2f')](_0x406d9b)){_0x48e67b[_0x406d9b][_0xffa2('0x35')]=!![];}}}}VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x37')]=function(){var _0x42568d=this;for(var _0x62170b in this[_0xffa2('0xe')]){if(this[_0xffa2('0xe')][_0xffa2('0x2f')](_0x62170b)&&!this[_0xffa2('0xe')][_0x62170b][_0xffa2('0x38')]){this[_0xffa2('0x39')][_0xffa2('0xa')](function(){if(!_['isNil'](_0x42568d[_0xffa2('0xe')][_0x62170b])){return ami[_0xffa2('0x3a')]({'action':'status','channel':_0x42568d[_0xffa2('0xe')][_0x62170b]['channel']})[_0xffa2('0x3b')](function(_0x5a7ce6){if(_0x5a7ce6['message']===_0xffa2('0x3c')){setTimeout(function(){if(_0x42568d['channels'][_0x62170b]){delete _0x42568d[_0xffa2('0xe')][_0x62170b];logger['error'](_0xffa2('0x3d'),_0x62170b,util[_0xffa2('0x3e')](_0x5a7ce6,{'showHidden':![],'depth':null}));}if(_0x42568d[_0xffa2('0xd')][_0x62170b]){delete _0x42568d[_0xffa2('0xd')][_0x62170b];logger['error'](_0xffa2('0x3f'),_0x62170b,util['inspect'](_0x5a7ce6,{'showHidden':![],'depth':null}));}if(_0x42568d[_0xffa2('0x13')][_0x62170b]){delete _0x42568d[_0xffa2('0x13')][_0x62170b];logger[_0xffa2('0x40')]('[%s][voiceQueueReport][checkVariables]',_0x62170b,util['inspect'](_0x5a7ce6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x41')]=function(){logger[_0xffa2('0x40')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xffa2('0xe')]);this['clearQueueReport'](this[_0xffa2('0xd')]);clearAgentBooked(this[_0xffa2('0x42')]);clearVoiceQueues(this[_0xffa2('0x10')]);clearCampaigns(this[_0xffa2('0x12')]);};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x43')]=function(_0x44c77d){var _0x3acf1a=this;if(!_[_0xffa2('0x30')](_0x44c77d)){for(var _0xa5cd13 in _0x44c77d){if(_0x44c77d[_0xffa2('0x2f')](_0xa5cd13)){_0x3acf1a[_0xffa2('0x44')](_0x44c77d[_0xa5cd13],'clearqueuereport');delete _0x44c77d[_0xa5cd13];}}}};VoiceQueueReport[_0xffa2('0x36')]['emit']=function(_0x61fc92,_0x2c68c0,_0x33dbe){io['to'](_0x61fc92)[_0xffa2('0x45')](_0x2c68c0,_0x33dbe);};VoiceQueueReport[_0xffa2('0x36')]['emitVoiceQueueChannelSave']=function(_0x2e2d0b,_0x4e0137){logger[_0xffa2('0x46')]('[%s][voiceQueueReport]['+_0x4e0137+']\x20sending\x20voice_queue_channel:save\x20event:',_0x2e2d0b[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x2e2d0b,{'showHidden':![],'depth':null}));this[_0xffa2('0x45')](util[_0xffa2('0x48')](_0xffa2('0x49'),_0x2e2d0b['name']),'voice_queue_channel:save',_0x2e2d0b);io[_0xffa2('0x45')](_0xffa2('0x4a'),_0x2e2d0b);};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x44')]=function(_0x4c8af3,_0x385b24){logger[_0xffa2('0x46')](_0xffa2('0x4b')+_0x385b24+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x4c8af3[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x4c8af3,{'showHidden':![],'depth':null}));this['emit'](util[_0xffa2('0x48')]('voice:queue:%s',_0x4c8af3[_0xffa2('0x4c')]),'voice_queue_channel:remove',_0x4c8af3);io['emit'](_0xffa2('0x4d'),_0x4c8af3);};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x4e')]=function(_0x3c735a,_0x55f981){if(_0x3c735a[_0xffa2('0x4f')]==='inbound'){var _0x2a445d={'id':_0x3c735a['id'],'name':_0x3c735a[_0xffa2('0x4c')],'strategy':_0x3c735a[_0xffa2('0x50')],'answered':_0x3c735a[_0xffa2('0x51')],'available':_0x3c735a['available'],'loggedIn':_0x3c735a[_0xffa2('0x52')],'pTalking':_0x3c735a['pTalking'],'sumBillable':_0x3c735a[_0xffa2('0x53')],'sumDuration':_0x3c735a['sumDuration'],'sumHoldTime':_0x3c735a[_0xffa2('0x54')]||0x0,'talking':_0x3c735a[_0xffa2('0x55')],'total':_0x3c735a[_0xffa2('0x56')],'type':_0x3c735a[_0xffa2('0x4f')],'unmanaged':_0x3c735a[_0xffa2('0x57')],'abandoned':_0x3c735a[_0xffa2('0x58')],'waiting':_0x3c735a[_0xffa2('0x33')]};if(_0x3c735a[_0xffa2('0x59')]){_0x2a445d[_0xffa2('0x59')]={'id':_0x3c735a[_0xffa2('0x59')]['id'],'name':_0x3c735a[_0xffa2('0x59')]['name'],'active':_0x3c735a[_0xffa2('0x59')][_0xffa2('0x5a')],'callerid':_0x3c735a[_0xffa2('0x59')][_0xffa2('0x5b')]};}if(_0x3c735a[_0xffa2('0x5c')]){_0x2a445d[_0xffa2('0x5c')]={'id':_0x3c735a[_0xffa2('0x5c')]['id'],'name':_0x3c735a[_0xffa2('0x5c')][_0xffa2('0x4c')]};}var _0x44b742=md5(JSON[_0xffa2('0x5d')](_0x2a445d));if(_0x3c735a['md5']!==_0x44b742){_0x3c735a['md5']=_0x44b742;logger[_0xffa2('0x46')]('[voiceQueueReport]['+_0x55f981+']\x20sending\x20voice_queue:save\x20event:',util[_0xffa2('0x3e')](_0x2a445d,{'showHidden':![],'depth':null}));this['emit'](util[_0xffa2('0x48')](_0xffa2('0x49'),_0x2a445d[_0xffa2('0x4c')]),'voice_queue:save',_0x2a445d);}}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x5e')]=function(_0x28277c){return _0x28277c!==null&&!_[_0xffa2('0x5f')](_0x28277c);};VoiceQueueReport[_0xffa2('0x36')]['loopQueueShow']=function(){var _0x3ac858=this;setInterval(function(){_0x3ac858['clearZombieChannels']();ami['Action']({'action':_0xffa2('0x60')})[_0xffa2('0x3b')](function(_0x4cb1f3){logger['error'](_0xffa2('0x61'),util[_0xffa2('0x3e')](_0x4cb1f3,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x62')]=function(){var _0x5704b6=this;setInterval(function(){if(_0x5704b6[_0xffa2('0x11')]){return ami['Action']({'action':_0xffa2('0x14')})[_0xffa2('0x63')](function(_0x3d592b){_0x5704b6[_0xffa2('0x11')]=![];})[_0xffa2('0x3b')](function(_0x1dbe3c){logger[_0xffa2('0x40')]('[voiceQueueReport][queuesummary]',util[_0xffa2('0x3e')](_0x1dbe3c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xffa2('0x15')]=function(_0xfd6e2d){try{if(this[_0xffa2('0x5e')](_0xfd6e2d)&&this[_0xffa2('0x5e')](_0xfd6e2d[_0xffa2('0x64')])){logger[_0xffa2('0x46')](_0xffa2('0x65'),util[_0xffa2('0x3e')](_0xfd6e2d,{'showHidden':![],'depth':null}));if(this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]]){logger[_0xffa2('0x66')](_0xffa2('0x67'),_0xfd6e2d[_0xffa2('0x64')]);var _0x349d1b=_[_0xffa2('0x68')](this[_0xffa2('0xe')],_0xffa2('0x64'))[_0xfd6e2d[_0xffa2('0x64')]]||0x0;var _0x19a580=_0x349d1b-_0xfd6e2d[_0xffa2('0x69')];if(this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x33')]!==_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x69')])||this['voiceQueues'][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x52')]!==_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x6b')])||this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x6c')]!==_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x6c')])||this['voiceQueues'][_0xfd6e2d[_0xffa2('0x64')]]['talking']!==_0x19a580){this[_0xffa2('0x10')][_0xfd6e2d['queue']][_0xffa2('0x33')]=_[_0xffa2('0x6a')](_0xfd6e2d['callers']);this['voiceQueues'][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x52')]=_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x6b')]);this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x6c')]=_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x6c')]);this[_0xffa2('0x10')][_0xfd6e2d['queue']][_0xffa2('0x55')]=_0x19a580>0x0?_0x19a580:0x0;this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]][_0xffa2('0x55')]=this['voiceQueues'][_0xfd6e2d[_0xffa2('0x64')]]['talking']>_[_0xffa2('0x6a')](_0xfd6e2d[_0xffa2('0x6b')])?_[_0xffa2('0x6a')](_0xfd6e2d['loggedin']):this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]]['talking'];this[_0xffa2('0x4e')](this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]],_0xffa2('0x14'));}logger['debug'](_0xffa2('0x6d'),util[_0xffa2('0x3e')](this[_0xffa2('0x10')][_0xfd6e2d[_0xffa2('0x64')]],{'showHidden':![],'depth':null}));ami[_0xffa2('0x45')](_0xffa2('0x6e'),this['voiceQueues'][_0xfd6e2d[_0xffa2('0x64')]]);}}}catch(_0x1088ca){logger['error'](_0xffa2('0x6f'),util['inspect'](_0x1088ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x16')]=function(_0x55538b){logger['debug'](_0xffa2('0x70'),util[_0xffa2('0x3e')](_0x55538b,{'showHidden':![],'depth':null}));this[_0xffa2('0x11')]=!![];};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x71')]=function(_0x4a2915){try{if(this[_0xffa2('0x5e')](_0x4a2915)){logger[_0xffa2('0x46')](_0xffa2('0x72'),_0x4a2915['uniqueid'],util[_0xffa2('0x3e')](_0x4a2915,{'showHidden':![],'depth':null}));if(_[_0xffa2('0x5f')](this[_0xffa2('0xd')][_0x4a2915[_0xffa2('0x47')]]))this[_0xffa2('0xd')][_0x4a2915[_0xffa2('0x47')]]=[];if(_[_0xffa2('0x5f')](this[_0xffa2('0xe')][_0x4a2915[_0xffa2('0x47')]]))this['channels'][_0x4a2915['uniqueid']]={};var _0x4cf954=new QueueReport();_0x4cf954[_0xffa2('0x4c')]=_0x4a2915['queue'];_0x4cf954['type']=this[_0xffa2('0x10')][_0x4cf954['name']]&&this['voiceQueues'][_0x4cf954[_0xffa2('0x4c')]][_0xffa2('0x4f')]?this[_0xffa2('0x10')][_0x4cf954[_0xffa2('0x4c')]][_0xffa2('0x4f')]||'inbound':'inbound';_0x4cf954[_0xffa2('0x64')]=_0x4a2915[_0xffa2('0x64')];_0x4cf954[_0xffa2('0x73')]=moment()[_0xffa2('0x48')](_0xffa2('0x74'));_0x4cf954[_0xffa2('0x75')]=_0x4a2915['position'];_0x4cf954[_0xffa2('0x76')]=_0x4a2915['count'];_0x4cf954['uniqueid']=_0x4a2915['uniqueid'];_0x4cf954['routealias']=this['channels'][_0x4a2915[_0xffa2('0x47')]][_0xffa2('0x77')];logger['info'](_0xffa2('0x78'),_0x4cf954['name'],_0x4cf954['type']);_[_0xffa2('0x79')](_0x4cf954,_[_0xffa2('0x7a')](_0x4a2915,_['keys'](_0x4cf954)));this['queueReports'][_0x4a2915[_0xffa2('0x47')]][_0xffa2('0x7b')](_0x4cf954);this[_0xffa2('0xe')][_0x4a2915[_0xffa2('0x47')]]=_0x4cf954;this[_0xffa2('0x7c')](_0x4cf954,_0xffa2('0x18'));}}catch(_0x54d325){logger[_0xffa2('0x40')](_0xffa2('0x72'),_0x4a2915[_0xffa2('0x47')],util['inspect'](_0x54d325,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x1a')]=function(_0x3654b6){try{if(this[_0xffa2('0x5e')](_0x3654b6)){logger[_0xffa2('0x46')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3654b6['uniqueid'],util[_0xffa2('0x3e')](_0x3654b6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3654b6[_0xffa2('0x47')]]){var _0x246e27=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x3654b6[_0xffa2('0x47')]]);_0x246e27[_0xffa2('0x7e')]=![];_0x246e27[_0xffa2('0x7f')]=null;_0x246e27[_0xffa2('0x80')]=_0x3654b6[_0xffa2('0x80')];_0x246e27[_0xffa2('0x81')]=_0x3654b6[_0xffa2('0x81')];_0x246e27[_0xffa2('0x19')]=!![];_0x246e27[_0xffa2('0x82')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x246e27[_0xffa2('0x83')]='ABANDONED';_0x246e27[_0xffa2('0x84')]=null;logger[_0xffa2('0x66')](_0xffa2('0x85'),_0x246e27['name'],_0x246e27['type']);this['channels'][_0x3654b6[_0xffa2('0x47')]]=_0x246e27;this['emitVoiceQueueChannelRemove'](_0x246e27,_0xffa2('0x19'));}}}catch(_0x1734f5){logger[_0xffa2('0x40')](_0xffa2('0x86'),_0x3654b6[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x1734f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')]['syncQueueCallerLeave']=function(_0xd83841){try{if(this[_0xffa2('0x5e')](_0xd83841)){logger[_0xffa2('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0xd83841[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0xd83841,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xd83841['uniqueid']]){var _0x5271c5=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0xd83841['uniqueid']]);_0x5271c5[_0xffa2('0x87')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5271c5[_0xffa2('0x88')]=_0xd83841[_0xffa2('0x88')];_0x5271c5[_0xffa2('0x89')]=_0xd83841[_0xffa2('0x89')];logger[_0xffa2('0x66')](_0xffa2('0x8a'),_0x5271c5[_0xffa2('0x4c')],_0x5271c5[_0xffa2('0x4f')],_0xd83841['connectedlinenum'],_0xd83841[_0xffa2('0x89')]);this[_0xffa2('0xe')][_0xd83841['uniqueid']]=_0x5271c5;this[_0xffa2('0x7c')](_0x5271c5,_0xffa2('0x1b'));}}}catch(_0x5abefe){logger[_0xffa2('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0xd83841['uniqueid'],util['inspect'](_0x5abefe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x1f')]=function(_0x50ec3d){try{if(this[_0xffa2('0x5e')](_0x50ec3d)){logger[_0xffa2('0x46')](_0xffa2('0x8b'),_0x50ec3d[_0xffa2('0x47')],util['inspect'](_0x50ec3d,{'showHidden':![],'depth':null}));if(this[_0xffa2('0xd')][_0x50ec3d[_0xffa2('0x47')]]){var _0x429477=_['last'](this[_0xffa2('0xd')][_0x50ec3d['uniqueid']]);_0x429477['queuecallercomplete']=!![];_0x429477[_0xffa2('0x83')]=_0xffa2('0x8c');logger['info'](_0xffa2('0x8d'),_0x429477['name'],_0x429477['type']);}}}catch(_0x392aef){logger[_0xffa2('0x40')]('[%s][voiceQueueReport][agentconnect]',_0x50ec3d[_0xffa2('0x47')],util['inspect'](_0x392aef,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xffa2('0x1d')]=function(_0x3f45db){try{if(this[_0xffa2('0x5e')](_0x3f45db)){logger[_0xffa2('0x46')](_0xffa2('0x8e'),_0x3f45db[_0xffa2('0x47')],util['inspect'](_0x3f45db,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3f45db['uniqueid']]){var _0x83eedf=_['last'](this[_0xffa2('0xd')][_0x3f45db['uniqueid']]);_0x83eedf['queuecallerabandon']=![];_0x83eedf[_0xffa2('0x82')]=null;_0x83eedf[_0xffa2('0x8f')]=!![];_0x83eedf[_0xffa2('0x84')]=_0x3f45db[_0xffa2('0x90')];_0x83eedf['holdtime']=_0x3f45db['holdtime'];_0x83eedf[_0xffa2('0x7e')]=!![];_0x83eedf['queuecallerexit']=![];_0x83eedf['queuecallerexitAt']=null;if(!_0x83eedf[_0xffa2('0x91')]){if(_0x3f45db['reason']==_0xffa2('0x91')){_0x83eedf[_0xffa2('0x83')]=_0xffa2('0x92');logger[_0xffa2('0x66')](_0xffa2('0x93'),_0x83eedf[_0xffa2('0x4c')],_0x83eedf[_0xffa2('0x4f')]);}else{if(_['startsWith'](_0x3f45db[_0xffa2('0x94')][_0xffa2('0x95')](),'local/')){if(this[_0xffa2('0xd')][_0x3f45db[_0xffa2('0x96')]]){var _0x2c04bc=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x3f45db[_0xffa2('0x96')]]);_0x2c04bc[_0xffa2('0x7e')]=![];_0x2c04bc['queuecallerexit']=!![];_0x2c04bc[_0xffa2('0x97')]=moment(_0x83eedf[_0xffa2('0x73')])[_0xffa2('0x98')](_0x3f45db[_0xffa2('0x80')],'seconds')[_0xffa2('0x48')](_0xffa2('0x74'));_0x2c04bc[_0xffa2('0x83')]='FORWARDTRANSFER';_0x2c04bc[_0xffa2('0x91')]=!![];_0x2c04bc[_0xffa2('0x99')]=_0xffa2('0x9a');_0x2c04bc[_0xffa2('0x9b')]=_0x3f45db[_0xffa2('0x9c')];_0x2c04bc[_0xffa2('0x9d')]=_0x3f45db[_0xffa2('0x47')];logger['info'](_0xffa2('0x9e'),_0x2c04bc[_0xffa2('0x4c')],_0x2c04bc[_0xffa2('0x4f')]);var _0x51270f=this[_0xffa2('0xd')][_0x3f45db['linkedid']];this['queueReports'][_0x3f45db[_0xffa2('0x96')]]=this[_0xffa2('0xd')][_0x3f45db[_0xffa2('0x47')]];this[_0xffa2('0xd')][_0x3f45db['uniqueid']]=_0x51270f;}}else{_0x83eedf[_0xffa2('0x83')]=_0xffa2('0x9f')+_0x3f45db[_0xffa2('0xa0')][_0xffa2('0xa1')]();logger[_0xffa2('0x66')](_0xffa2('0xa2'),_0x83eedf[_0xffa2('0x4c')],_0x83eedf['type'],_0x83eedf[_0xffa2('0x83')]);}}}this[_0xffa2('0xe')][_0x3f45db[_0xffa2('0x47')]]=_0x83eedf;this[_0xffa2('0x44')](_0x83eedf,_0xffa2('0xa3'));}}}catch(_0x515ae0){logger[_0xffa2('0x40')](_0xffa2('0x8e'),_0x3f45db[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x515ae0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x21')]=function(_0x4d6393){try{if(this[_0xffa2('0x5e')](_0x4d6393)){logger[_0xffa2('0x46')](_0xffa2('0xa4'),_0x4d6393[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x4d6393,{'showHidden':![],'depth':null}));this[_0xffa2('0xa5')](_0x4d6393[_0xffa2('0x47')],_[_0xffa2('0xa6')](_0x4d6393[_0xffa2('0xa7')])[0x0],_0x4d6393[_0xffa2('0xa8')]);if(this[_0xffa2('0xd')][_0x4d6393['uniqueid']]){var _0x48fa89=_['last'](this['queueReports'][_0x4d6393['uniqueid']]);if(_0x48fa89){if(this[_0xffa2('0x5e')](_0x4d6393[_0xffa2('0xa7')])&&this[_0xffa2('0x5e')](_0x4d6393[_0xffa2('0xa7')][_0xffa2('0xa9')])){switch(_0x4d6393[_0xffa2('0xa8')]){case _0xffa2('0xaa'):_0x48fa89[_0xffa2('0xab')]=![];_0x48fa89['queuecallerexitAt']=null;break;case'TIMEOUT':_0x48fa89[_0xffa2('0xac')]=_0xffa2('0xad');_0x48fa89[_0xffa2('0xab')]=!![];_0x48fa89[_0xffa2('0x97')]=moment()[_0xffa2('0x48')](_0xffa2('0x74'));_0x48fa89['queuecallerleaveAt']=moment()['format'](_0xffa2('0x74'));logger[_0xffa2('0x46')](_0xffa2('0xae'),_0x4d6393['uniqueid'],util['inspect'](_0x48fa89,{'showHidden':![],'depth':null}));ami['emit'](_0xffa2('0xaf'),_0x48fa89);break;default:_0x48fa89[_0xffa2('0xab')]=!![];_0x48fa89[_0xffa2('0x97')]=moment()[_0xffa2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x48fa89['queuecallerleaveAt']=moment()[_0xffa2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}_0x48fa89[_0xffa2('0x19')]=![];_0x48fa89[_0xffa2('0x82')]=null;_0x48fa89[_0xffa2('0x83')]=_0x4d6393['value'];this['channels'][_0x4d6393['uniqueid']]=_0x48fa89;this[_0xffa2('0x44')](_0x48fa89,_0xffa2('0x20'));}else if(this[_0xffa2('0x5e')](_0x4d6393[_0xffa2('0xa7')])&&this[_0xffa2('0x5e')](_0x4d6393[_0xffa2('0xa7')][_0xffa2('0xb0')])){if(!_0x48fa89['queuecallerabandon']){_0x48fa89[_0xffa2('0xab')]=!![];_0x48fa89[_0xffa2('0x97')]=moment()[_0xffa2('0x48')](_0xffa2('0x74'));_0x48fa89[_0xffa2('0x83')]=_0xffa2('0xb1');_0x48fa89[_0xffa2('0x87')]=moment()[_0xffa2('0x48')](_0xffa2('0x74'));this[_0xffa2('0xe')][_0x4d6393['uniqueid']]=_0x48fa89;}}logger['info'](_0xffa2('0xb2'),_0x4d6393['uniqueid'],_0x48fa89[_0xffa2('0x4c')],_0x48fa89[_0xffa2('0x4f')],_['keys'](_0x4d6393[_0xffa2('0xa7')])[0x0],_0x4d6393[_0xffa2('0xa8')]);_0x48fa89[_0xffa2('0x13')]=this['variables'][_0x4d6393[_0xffa2('0x47')]];}}}}catch(_0x32ea21){logger[_0xffa2('0x40')](_0xffa2('0xa4'),_0x4d6393['uniqueid'],util[_0xffa2('0x3e')](_0x32ea21,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xffa2('0xa5')]=function(_0x1f0507,_0x2625f0,_0x235359){var _0x545b36=[_0xffa2('0xb3'),_0xffa2('0xb4'),_0xffa2('0xb5'),'rtpaudioqosjitterbridged',_0xffa2('0xb6'),_0xffa2('0xb7'),_0xffa2('0xb8'),_0xffa2('0xb9'),_0xffa2('0xba'),_0xffa2('0xbb'),_0xffa2('0xbc'),_0xffa2('0xbd'),_0xffa2('0xbe'),_0xffa2('0xbf'),'memberinterface',_0xffa2('0xc0'),_0xffa2('0x90'),'memberpenalty',_0xffa2('0xc1')];if(!_[_0xffa2('0xc2')](_0x2625f0)&&!_['includes'](_0x545b36,_0x2625f0)){if(_['isUndefined'](this[_0xffa2('0x13')][_0x1f0507])){this[_0xffa2('0x13')][_0x1f0507]={};}this['variables'][_0x1f0507][_0x2625f0]=_0x235359;}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x23')]=function(_0x41c090){try{if(this['isNotNull'](_0x41c090)){logger[_0xffa2('0x46')](_0xffa2('0xc3'),_0x41c090[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x41c090,{'showHidden':![],'depth':null}));if(this[_0xffa2('0xd')][_0x41c090[_0xffa2('0x47')]]){for(var _0x3752d8=0x0,_0x42e386={};_0x3752d8<this['queueReports'][_0x41c090[_0xffa2('0x47')]]['length'];_0x3752d8+=0x1){_0x42e386=this[_0xffa2('0xd')][_0x41c090[_0xffa2('0x47')]][_0x3752d8];if(this['voiceQueues'][_0x42e386[_0xffa2('0x64')]]){if(_0x42e386['queuecallerexit']&&_0x42e386[_0xffa2('0x91')]!=!![]){this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x57')]+=0x1;}if(_0x42e386[_0xffa2('0x19')]){this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x58')]+=0x1;}this['voiceQueues'][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x54')]+=moment(_0x42e386['queuecallerleaveAt'])[_0xffa2('0xc4')](_0x42e386[_0xffa2('0x73')],_0xffa2('0xc5'))||0x0;if(_0x3752d8===this['queueReports'][_0x41c090['uniqueid']][_0xffa2('0xc6')]-0x1){this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0xc7')]+=moment()[_0xffa2('0xc8')](0x0)[_0xffa2('0xc4')](_0x42e386['queuecallerjoinAt'],_0xffa2('0xc5'));this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]]['total']+=0x1;if(_0x42e386['queuecallercomplete']){this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x51')]+=0x1;this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x53')]+=moment()[_0xffa2('0xc8')](0x0)['diff'](_0x42e386[_0xffa2('0x87')],_0xffa2('0xc5'));_0x42e386[_0xffa2('0x7f')]=moment()[_0xffa2('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x42e386['queuecallerexit']=![];_0x42e386[_0xffa2('0x97')]=null;}if(_0x42e386[_0xffa2('0xab')]&&_0x42e386[_0xffa2('0x91')]!=!![]){_0x42e386['lastevent']=_0xffa2('0x57');logger[_0xffa2('0x46')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x41c090['uniqueid'],util[_0xffa2('0x3e')](_0x42e386,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x42e386);}if(_0x42e386[_0xffa2('0x19')]){_0x42e386[_0xffa2('0xac')]=_0xffa2('0x58');logger[_0xffa2('0x46')](_0xffa2('0xc9'),_0x41c090[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x42e386,{'showHidden':![],'depth':null}));ami[_0xffa2('0x45')](_0xffa2('0xca'),_0x42e386);}}else{this['voiceQueues'][_0x42e386[_0xffa2('0x64')]]['sumDuration']+=this[_0xffa2('0x10')][_0x42e386[_0xffa2('0x64')]][_0xffa2('0x54')];}logger[_0xffa2('0x66')](_0xffa2('0xcb'),_0x41c090['uniqueid'],_0x42e386['name'],_0x42e386[_0xffa2('0x4f')],_0x41c090[_0xffa2('0xcc')]);this['channels'][_0x41c090[_0xffa2('0x47')]]=_0x42e386;this[_0xffa2('0x44')](_0x42e386,_0xffa2('0x22'));this[_0xffa2('0x4e')](this[_0xffa2('0x10')][_0x42e386['queue']],_0xffa2('0x22'));}}logger['debug'](_0xffa2('0xcd'),_0x41c090[_0xffa2('0x47')],util['inspect'](this[_0xffa2('0xd')][_0x41c090[_0xffa2('0x47')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceQueueReport',this[_0xffa2('0xd')][_0x41c090[_0xffa2('0x47')]]);delete this[_0xffa2('0xd')][_0x41c090['uniqueid']];delete this[_0xffa2('0xe')][_0x41c090[_0xffa2('0x47')]];}if(this[_0xffa2('0x13')][_0x41c090['uniqueid']]){delete this[_0xffa2('0x13')][_0x41c090['uniqueid']];}}}catch(_0x324d2f){logger[_0xffa2('0x40')](_0xffa2('0xc3'),_0x41c090[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x324d2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xffa2('0x2b')]=function(_0x5aa35b){try{if(this[_0xffa2('0x5e')](_0x5aa35b)){logger[_0xffa2('0x46')](_0xffa2('0xce'),_0x5aa35b[_0xffa2('0x47')],util['inspect'](_0x5aa35b,{'showHidden':![],'depth':null}));var _0x3d073f;if(this[_0xffa2('0xd')][_0x5aa35b['transfereeuniqueid']]){_0x3d073f=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xcf')]]);_0x3d073f[_0xffa2('0x9b')]=_0x5aa35b[_0xffa2('0xd0')];_0x3d073f[_0xffa2('0x9d')]=_0x5aa35b['secondtransfereruniqueid'];_0x3d073f[_0xffa2('0x83')]='ATTENDEDTRANSFER';_0x3d073f[_0xffa2('0x91')]=!![];_0x3d073f['transfertype']=_0xffa2('0xd1');if(this[_0xffa2('0xd')][_0x5aa35b['secondtransfereruniqueid']]){var _0x36b7d2=this['queueReports'][_0x5aa35b['secondtransfereruniqueid']];this[_0xffa2('0xd')][_0x5aa35b['secondtransfereruniqueid']]=this[_0xffa2('0xd')][_0x5aa35b['transfereeuniqueid']];this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xcf')]]=_0x36b7d2;var _0x24d999=_['last'](this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xcf')]]);_0x24d999[_0xffa2('0x38')]=!![];}logger['info'](_0xffa2('0xd2'),_0x5aa35b[_0xffa2('0x47')],_0x3d073f[_0xffa2('0x4c')],_0x3d073f[_0xffa2('0x4f')],_0x3d073f[_0xffa2('0x9b')],_0x3d073f[_0xffa2('0x9d')]);}else if(this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xd3')]]){_0x3d073f=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xd3')]]);_0x3d073f['transferexten']=_0x5aa35b['origtransfererexten'];_0x3d073f[_0xffa2('0x9d')]=_0x5aa35b[_0xffa2('0xd4')];_0x3d073f['queuecallerexitreason']=_0xffa2('0xd5');_0x3d073f['transfer']=!![];_0x3d073f['transfertype']='ATTENDED';if(this['queueReports'][_0x5aa35b[_0xffa2('0xd4')]]){var _0x36b7d2=this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xd4')]];this[_0xffa2('0xd')][_0x5aa35b['origtransfereruniqueid']]=this[_0xffa2('0xd')][_0x5aa35b['transfertargetuniqueid']];this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xd3')]]=_0x36b7d2;var _0x24d999=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x5aa35b[_0xffa2('0xd3')]]);_0x24d999[_0xffa2('0x38')]=!![];}logger[_0xffa2('0x66')](_0xffa2('0xd2'),_0x5aa35b[_0xffa2('0x47')],_0x3d073f[_0xffa2('0x4c')],_0x3d073f['type'],_0x3d073f[_0xffa2('0x9b')],_0x3d073f['transferuniqueid']);}}}catch(_0x19c14d){logger['error'](_0xffa2('0xce'),_0x5aa35b[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x19c14d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xffa2('0x2d')]=function(_0x5284b0){try{if(this[_0xffa2('0x5e')](_0x5284b0)){logger[_0xffa2('0x46')]('[%s][voiceQueueReport][blindtransfer]',_0x5284b0['uniqueid'],util[_0xffa2('0x3e')](_0x5284b0,{'showHidden':![],'depth':null}));if(this[_0xffa2('0xd')][_0x5284b0[_0xffa2('0xcf')]]){var _0x2d9fcb=_[_0xffa2('0x7d')](this[_0xffa2('0xd')][_0x5284b0[_0xffa2('0xcf')]]);_0x2d9fcb['queuecallerexitreason']=_0xffa2('0xd6');_0x2d9fcb['transfer']=!![];_0x2d9fcb[_0xffa2('0x99')]=_0xffa2('0xd7');_0x2d9fcb[_0xffa2('0x9b')]=_0x5284b0[_0xffa2('0xd8')];_0x2d9fcb['transferuniqueid']=_0x5284b0[_0xffa2('0xcf')];logger[_0xffa2('0x66')](_0xffa2('0xd9'),_0x5284b0[_0xffa2('0x47')],_0x2d9fcb[_0xffa2('0x4c')],_0x2d9fcb[_0xffa2('0x4f')],_0x2d9fcb['transferexten'],_0x2d9fcb[_0xffa2('0x9d')]);this[_0xffa2('0x23')]({'event':_0xffa2('0xda'),'uniqueid':_0x5284b0['transfereeuniqueid'],'context':_0x5284b0[_0xffa2('0xdb')],'channel':_0x5284b0[_0xffa2('0xdc')]});}}}catch(_0x42501a){logger[_0xffa2('0x40')](_0xffa2('0xdd'),_0x5284b0[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x42501a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')]['syncMusicOnHoldStart']=function(_0x504478){try{if(this[_0xffa2('0x5e')](_0x504478)){logger[_0xffa2('0x46')](_0xffa2('0xde'),_0x504478['uniqueid'],util[_0xffa2('0x3e')](_0x504478,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x504478[_0xffa2('0x47')]]){var _0x46ba4b=_['last'](this[_0xffa2('0xd')][_0x504478['uniqueid']]);if(!_[_0xffa2('0xc2')](_0x46ba4b[_0xffa2('0x87')])){_0x46ba4b[_0xffa2('0xdf')]=moment()[_0xffa2('0x48')](_0xffa2('0x74'));logger[_0xffa2('0x66')](_0xffa2('0xe0'),_0x504478[_0xffa2('0x47')],_0x46ba4b[_0xffa2('0xdf')]);}}}}catch(_0x4e072b){logger[_0xffa2('0x40')](_0xffa2('0xde'),_0x504478[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x4e072b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')][_0xffa2('0x29')]=function(_0x1067ab){try{if(this[_0xffa2('0x5e')](_0x1067ab)){logger[_0xffa2('0x46')](_0xffa2('0xe1'),_0x1067ab[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x1067ab,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1067ab[_0xffa2('0x47')]]){var _0x376746=_['last'](this['queueReports'][_0x1067ab[_0xffa2('0x47')]]);if(!_['isNil'](_0x376746[_0xffa2('0xdf')])){_0x376746[_0xffa2('0xe2')]+=moment()[_0xffa2('0xc8')](0x0)['diff'](_0x376746[_0xffa2('0xdf')],'seconds');logger['info'](_0xffa2('0xe3'),_0x1067ab[_0xffa2('0x47')],_0x376746[_0xffa2('0xe2')]);delete _0x376746[_0xffa2('0xdf')];}}}}catch(_0x59e6a3){logger['error'](_0xffa2('0xe1'),_0x1067ab[_0xffa2('0x47')],util[_0xffa2('0x3e')](_0x59e6a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xffa2('0x36')]['syncNewExten']=function(_0x1d96ee){try{if(this[_0xffa2('0x5e')](_0x1d96ee)){logger['debug'](_0xffa2('0xe4'),_0x1d96ee[_0xffa2('0x47')],util['inspect'](_0x1d96ee,{'showHidden':![],'depth':null}));if(_0x1d96ee[_0xffa2('0xe5')][_0xffa2('0x95')]()===_0xffa2('0xe6')){_0x1d96ee[_0xffa2('0xe7')]=_0x1d96ee['appdata']&&_0x1d96ee['appdata'][_0xffa2('0xe8')]('CDR(routeAlias)')?_0x1d96ee[_0xffa2('0xe9')]:(_0x1d96ee[_0xffa2('0xe9')]||_0x1d96ee['applicationdata'])['toLowerCase']();if(_[_0xffa2('0xe8')](_0x1d96ee[_0xffa2('0xe7')][_0xffa2('0x95')](),_0xffa2('0xea'))){logger[_0xffa2('0x66')](_0xffa2('0xeb'),_0x1d96ee['uniqueid'],_0x1d96ee[_0xffa2('0xe5')],_0x1d96ee['applicationdata']);if(_[_0xffa2('0x5f')](this['channels'][_0x1d96ee[_0xffa2('0x47')]]))this['channels'][_0x1d96ee[_0xffa2('0x47')]]={};var _0x141a2c=_0x1d96ee[_0xffa2('0xe7')][_0xffa2('0xec')]('=');var _0x3b9c1f=_0x141a2c[0x0][_0xffa2('0x95')]()[_0xffa2('0xed')](/cdr\((.*)\)/);if(_0x3b9c1f)this[_0xffa2('0xe')][_0x1d96ee['uniqueid']][_0x3b9c1f[0x1]]=_0x141a2c[0x1];}}}}catch(_0xbfb9b0){logger[_0xffa2('0x40')]('[%s][voiceQueueReport][newexten]',_0x1d96ee['uniqueid'],util['inspect'](_0xbfb9b0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xc678=['varset','syncVarSet','hangup','fullybooted','syncFullyBooted','newexten','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkQueueReport]','inspect','variables','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','Action','[voiceQueueReport][queues]','queuesummary','flagQueueSummary','syncQueueSummary','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','queue','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','transfer','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','linkedid','add','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','agentcomplete','[%s][voiceQueueReport][varset]','variable','value','queuestatus','queuecallerexitAt','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','diff','queuecallerjoinAt','milliseconds','seconds','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDEDTRANSFER','origtransfereruniqueid','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','application','match','[%s][voiceQueueReport][newexten]','exports','util','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentconnect','syncAgentConnect'];(function(_0x431d4a,_0x241d06){var _0x3daabe=function(_0x187bad){while(--_0x187bad){_0x431d4a['push'](_0x431d4a['shift']());}};_0x3daabe(++_0x241d06);}(_0xc678,0x1b4));var _0x8c67=function(_0x59f32e,_0x37bb3f){_0x59f32e=_0x59f32e-0x0;var _0x115cd7=_0xc678[_0x59f32e];return _0x115cd7;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x8c67('0x0'));var md5=require(_0x8c67('0x1'));var Redis=require(_0x8c67('0x2'));var config=require('../../../config/environment');var logger=require(_0x8c67('0x3'))(_0x8c67('0x4'));var ami=require(_0x8c67('0x5'));var QueueReport=require(_0x8c67('0x6'));config['redis']=_[_0x8c67('0x7')](config['redis'],{'host':_0x8c67('0x8'),'port':0x18eb});var io=require(_0x8c67('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8c67('0xa')][_0x8c67('0xb')]=function(_0x41ac88){this[_0x8c67('0xc')]=this[_0x8c67('0xc')]?this['tail'][_0x8c67('0xd')](_0x41ac88):_0x41ac88();};function VoiceQueueReport(_0x5e1b4a){this[_0x8c67('0xe')]=new Sequence();this[_0x8c67('0xf')]={};this[_0x8c67('0x10')]=_0x5e1b4a['agents'];this[_0x8c67('0x11')]=_0x5e1b4a[_0x8c67('0x12')];this[_0x8c67('0x13')]=_0x5e1b4a[_0x8c67('0x13')];this['flagQueueSummary']=!![];this[_0x8c67('0x14')]=_0x5e1b4a['campaigns'];this['variables']={};ami['on']('queuesummary',this['syncQueueSummary'][_0x8c67('0x15')](this));ami['on']('queuesummarycomplete',this[_0x8c67('0x16')]['bind'](this));ami['on'](_0x8c67('0x17'),this[_0x8c67('0x18')][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x19'),this['syncQueueCallerAbandon'][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x1a'),this[_0x8c67('0x1b')][_0x8c67('0x15')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x1c'),this[_0x8c67('0x1d')]['bind'](this));ami['on'](_0x8c67('0x1e'),this[_0x8c67('0x1f')]['bind'](this));ami['on'](_0x8c67('0x20'),this['syncHangup'][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x21'),this[_0x8c67('0x22')][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x23'),this['syncNewExten'][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x24'),this['syncMusicOnHoldStart'][_0x8c67('0x15')](this));ami['on']('musiconholdstop',this[_0x8c67('0x25')][_0x8c67('0x15')](this));ami['on'](_0x8c67('0x26'),this[_0x8c67('0x27')][_0x8c67('0x15')](this));ami['on']('blindtransfer',this[_0x8c67('0x28')][_0x8c67('0x15')](this));this[_0x8c67('0x29')]();this[_0x8c67('0x2a')]();}function clearChannels(_0x2c6337){if(!_[_0x8c67('0x2b')](_0x2c6337)){for(var _0x4892e2 in _0x2c6337){if(_0x2c6337['hasOwnProperty'](_0x4892e2)){delete _0x2c6337[_0x4892e2];}}}}function clearCampaigns(_0x3a555c){if(!_['isEmpty'](_0x3a555c)){for(var _0x4a368c in _0x3a555c){if(_0x3a555c[_0x8c67('0x2c')](_0x4a368c)){_0x3a555c[_0x4a368c][_0x8c67('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x2f72ed){if(!_['isEmpty'](_0x2f72ed)){for(var _0x3716e1 in _0x2f72ed){if(_0x2f72ed[_0x8c67('0x2c')](_0x3716e1)){_0x2f72ed[_0x3716e1][_0x8c67('0x2d')]=0x0;_0x2f72ed[_0x3716e1][_0x8c67('0x2e')]=0x0;_0x2f72ed[_0x3716e1]['pTalking']=0x0;_0x2f72ed[_0x3716e1][_0x8c67('0x2f')]=0x0;_0x2f72ed[_0x3716e1][_0x8c67('0x30')]=!![];}}}}function clearAgentBooked(_0x502d2e){if(!_[_0x8c67('0x2b')](_0x502d2e)){for(var _0x25f2dd in _0x502d2e){if(_0x502d2e[_0x8c67('0x2c')](_0x25f2dd)){_0x502d2e[_0x25f2dd][_0x8c67('0x31')]=!![];}}}}VoiceQueueReport['prototype'][_0x8c67('0x32')]=function(){var _0x33f29a=this;for(var _0x603d29 in this[_0x8c67('0x11')]){if(this[_0x8c67('0x11')]['hasOwnProperty'](_0x603d29)&&!this['channels'][_0x603d29][_0x8c67('0x33')]){this[_0x8c67('0xe')][_0x8c67('0xb')](function(){if(!_[_0x8c67('0x34')](_0x33f29a[_0x8c67('0x11')][_0x603d29])){return ami['Action']({'action':'status','channel':_0x33f29a[_0x8c67('0x11')][_0x603d29][_0x8c67('0x35')]})[_0x8c67('0x36')](function(_0x5178d1){if(_0x5178d1[_0x8c67('0x37')]===_0x8c67('0x38')){setTimeout(function(){if(_0x33f29a['channels'][_0x603d29]){delete _0x33f29a['channels'][_0x603d29];logger[_0x8c67('0x39')]('[%s][voiceQueueReport][checkChannel]',_0x603d29,util['inspect'](_0x5178d1,{'showHidden':![],'depth':null}));}if(_0x33f29a[_0x8c67('0xf')][_0x603d29]){delete _0x33f29a[_0x8c67('0xf')][_0x603d29];logger[_0x8c67('0x39')](_0x8c67('0x3a'),_0x603d29,util[_0x8c67('0x3b')](_0x5178d1,{'showHidden':![],'depth':null}));}if(_0x33f29a[_0x8c67('0x3c')][_0x603d29]){delete _0x33f29a[_0x8c67('0x3c')][_0x603d29];logger[_0x8c67('0x39')]('[%s][voiceQueueReport][checkVariables]',_0x603d29,util['inspect'](_0x5178d1,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8c67('0xa')]['syncFullyBooted']=function(){logger[_0x8c67('0x39')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x8c67('0x11')]);this[_0x8c67('0x3d')](this[_0x8c67('0xf')]);clearAgentBooked(this[_0x8c67('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x8c67('0x14')]);};VoiceQueueReport[_0x8c67('0xa')]['clearQueueReport']=function(_0x64ec58){var _0x3810fa=this;if(!_[_0x8c67('0x2b')](_0x64ec58)){for(var _0x5e3a92 in _0x64ec58){if(_0x64ec58['hasOwnProperty'](_0x5e3a92)){_0x3810fa[_0x8c67('0x3e')](_0x64ec58[_0x5e3a92],_0x8c67('0x3f'));delete _0x64ec58[_0x5e3a92];}}}};VoiceQueueReport['prototype'][_0x8c67('0x40')]=function(_0x45a843,_0x2dc173,_0x1b58bc){io['to'](_0x45a843)['emit'](_0x2dc173,_0x1b58bc);};VoiceQueueReport['prototype'][_0x8c67('0x41')]=function(_0x14afcc,_0x4b8c00){logger['debug'](_0x8c67('0x42')+_0x4b8c00+_0x8c67('0x43'),_0x14afcc[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x14afcc,{'showHidden':![],'depth':null}));this[_0x8c67('0x40')](util[_0x8c67('0x45')](_0x8c67('0x46'),_0x14afcc[_0x8c67('0x47')]),_0x8c67('0x48'),_0x14afcc);io[_0x8c67('0x40')]('voice_queue_presence:save',_0x14afcc);};VoiceQueueReport[_0x8c67('0xa')]['emitVoiceQueueChannelRemove']=function(_0x50d96d,_0x5be5c9){logger[_0x8c67('0x49')]('[%s][voiceQueueReport]['+_0x5be5c9+_0x8c67('0x4a'),_0x50d96d[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x50d96d,{'showHidden':![],'depth':null}));this[_0x8c67('0x40')](util[_0x8c67('0x45')]('voice:queue:%s',_0x50d96d[_0x8c67('0x47')]),_0x8c67('0x4b'),_0x50d96d);io[_0x8c67('0x40')](_0x8c67('0x4c'),_0x50d96d);};VoiceQueueReport['prototype'][_0x8c67('0x4d')]=function(_0x13fdd8,_0x228a2b){if(_0x13fdd8[_0x8c67('0x4e')]===_0x8c67('0x4f')){var _0x499da3={'id':_0x13fdd8['id'],'name':_0x13fdd8[_0x8c67('0x47')],'strategy':_0x13fdd8[_0x8c67('0x50')],'answered':_0x13fdd8[_0x8c67('0x51')],'available':_0x13fdd8[_0x8c67('0x52')],'loggedIn':_0x13fdd8['loggedIn'],'pTalking':_0x13fdd8[_0x8c67('0x53')],'sumBillable':_0x13fdd8[_0x8c67('0x54')],'sumDuration':_0x13fdd8[_0x8c67('0x55')],'sumHoldTime':_0x13fdd8[_0x8c67('0x56')]||0x0,'talking':_0x13fdd8[_0x8c67('0x2e')],'total':_0x13fdd8[_0x8c67('0x57')],'type':_0x13fdd8['type'],'unmanaged':_0x13fdd8[_0x8c67('0x58')],'abandoned':_0x13fdd8[_0x8c67('0x59')],'waiting':_0x13fdd8['waiting']};if(_0x13fdd8['Trunk']){_0x499da3[_0x8c67('0x5a')]={'id':_0x13fdd8['Trunk']['id'],'name':_0x13fdd8[_0x8c67('0x5a')]['name'],'active':_0x13fdd8[_0x8c67('0x5a')][_0x8c67('0x5b')],'callerid':_0x13fdd8[_0x8c67('0x5a')][_0x8c67('0x5c')]};}if(_0x13fdd8['Interval']){_0x499da3[_0x8c67('0x5d')]={'id':_0x13fdd8[_0x8c67('0x5d')]['id'],'name':_0x13fdd8[_0x8c67('0x5d')][_0x8c67('0x47')]};}var _0x383b55=md5(JSON[_0x8c67('0x5e')](_0x499da3));if(_0x13fdd8[_0x8c67('0x1')]!==_0x383b55){_0x13fdd8[_0x8c67('0x1')]=_0x383b55;logger[_0x8c67('0x49')](_0x8c67('0x5f')+_0x228a2b+_0x8c67('0x60'),util[_0x8c67('0x3b')](_0x499da3,{'showHidden':![],'depth':null}));this[_0x8c67('0x40')](util['format'](_0x8c67('0x46'),_0x499da3[_0x8c67('0x47')]),_0x8c67('0x61'),_0x499da3);}}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x62')]=function(_0x4a469b){return _0x4a469b!==null&&!_[_0x8c67('0x63')](_0x4a469b);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x27a0f1=this;setInterval(function(){_0x27a0f1[_0x8c67('0x32')]();ami[_0x8c67('0x64')]({'action':'queues'})[_0x8c67('0x36')](function(_0x4d5e84){logger['error'](_0x8c67('0x65'),util[_0x8c67('0x3b')](_0x4d5e84,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x29')]=function(){var _0x13ee04=this;setInterval(function(){if(_0x13ee04['flagQueueSummary']){return ami[_0x8c67('0x64')]({'action':_0x8c67('0x66')})['then'](function(_0x3070ad){_0x13ee04[_0x8c67('0x67')]=![];})[_0x8c67('0x36')](function(_0x288cbb){logger[_0x8c67('0x39')]('[voiceQueueReport][queuesummary]',util[_0x8c67('0x3b')](_0x288cbb,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x68')]=function(_0x5f829e){try{if(this['isNotNull'](_0x5f829e)&&this['isNotNull'](_0x5f829e['queue'])){logger[_0x8c67('0x49')](_0x8c67('0x69'),util[_0x8c67('0x3b')](_0x5f829e,{'showHidden':![],'depth':null}));if(this[_0x8c67('0x13')][_0x5f829e['queue']]){logger[_0x8c67('0x6a')](_0x8c67('0x6b'),_0x5f829e['queue']);var _0x5387cf=_[_0x8c67('0x6c')](this[_0x8c67('0x11')],'queue')[_0x5f829e[_0x8c67('0x6d')]]||0x0;var _0x5f3ff1=_0x5387cf-_0x5f829e[_0x8c67('0x6e')];if(this['voiceQueues'][_0x5f829e['queue']][_0x8c67('0x2f')]!==_[_0x8c67('0x6f')](_0x5f829e[_0x8c67('0x6e')])||this['voiceQueues'][_0x5f829e['queue']][_0x8c67('0x70')]!==_['toNumber'](_0x5f829e[_0x8c67('0x71')])||this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]]['available']!==_[_0x8c67('0x6f')](_0x5f829e['available'])||this['voiceQueues'][_0x5f829e['queue']][_0x8c67('0x2e')]!==_0x5f3ff1){this[_0x8c67('0x13')][_0x5f829e['queue']][_0x8c67('0x2f')]=_[_0x8c67('0x6f')](_0x5f829e[_0x8c67('0x6e')]);this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]][_0x8c67('0x70')]=_[_0x8c67('0x6f')](_0x5f829e[_0x8c67('0x71')]);this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]][_0x8c67('0x52')]=_[_0x8c67('0x6f')](_0x5f829e['available']);this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]][_0x8c67('0x2e')]=_0x5f3ff1>0x0?_0x5f3ff1:0x0;this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]]['talking']=this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]][_0x8c67('0x2e')]>_[_0x8c67('0x6f')](_0x5f829e[_0x8c67('0x71')])?_['toNumber'](_0x5f829e[_0x8c67('0x71')]):this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]][_0x8c67('0x2e')];this['emitVoiceQueueSummary'](this[_0x8c67('0x13')][_0x5f829e['queue']],_0x8c67('0x66'));}logger[_0x8c67('0x49')](_0x8c67('0x72'),util['inspect'](this['voiceQueues'][_0x5f829e[_0x8c67('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x8c67('0x40')](_0x8c67('0x73'),this[_0x8c67('0x13')][_0x5f829e[_0x8c67('0x6d')]]);}}}catch(_0x27f398){logger[_0x8c67('0x39')]('[voiceQueueReport][queuesummary]',util[_0x8c67('0x3b')](_0x27f398,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8c67('0x16')]=function(_0x4eec4e){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x8c67('0x3b')](_0x4eec4e,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x18')]=function(_0x4849ab){try{if(this['isNotNull'](_0x4849ab)){logger[_0x8c67('0x49')](_0x8c67('0x74'),_0x4849ab[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x4849ab,{'showHidden':![],'depth':null}));if(_[_0x8c67('0x63')](this[_0x8c67('0xf')][_0x4849ab[_0x8c67('0x44')]]))this['queueReports'][_0x4849ab['uniqueid']]=[];if(_[_0x8c67('0x63')](this[_0x8c67('0x11')][_0x4849ab[_0x8c67('0x44')]]))this[_0x8c67('0x11')][_0x4849ab[_0x8c67('0x44')]]={};var _0x214aae=new QueueReport();_0x214aae[_0x8c67('0x47')]=_0x4849ab['queue'];_0x214aae[_0x8c67('0x4e')]=this['voiceQueues'][_0x214aae[_0x8c67('0x47')]]&&this[_0x8c67('0x13')][_0x214aae[_0x8c67('0x47')]][_0x8c67('0x4e')]?this[_0x8c67('0x13')][_0x214aae[_0x8c67('0x47')]][_0x8c67('0x4e')]||_0x8c67('0x4f'):_0x8c67('0x4f');_0x214aae[_0x8c67('0x6d')]=_0x4849ab[_0x8c67('0x6d')];_0x214aae['queuecallerjoinAt']=moment()['format'](_0x8c67('0x75'));_0x214aae['position']=_0x4849ab[_0x8c67('0x76')];_0x214aae['count']=_0x4849ab['count'];_0x214aae[_0x8c67('0x44')]=_0x4849ab[_0x8c67('0x44')];_0x214aae[_0x8c67('0x77')]=this['channels'][_0x4849ab['uniqueid']][_0x8c67('0x77')];logger[_0x8c67('0x6a')](_0x8c67('0x78'),_0x214aae[_0x8c67('0x47')],_0x214aae[_0x8c67('0x4e')]);_[_0x8c67('0x79')](_0x214aae,_[_0x8c67('0x7a')](_0x4849ab,_[_0x8c67('0x7b')](_0x214aae)));this[_0x8c67('0xf')][_0x4849ab[_0x8c67('0x44')]][_0x8c67('0x7c')](_0x214aae);this[_0x8c67('0x11')][_0x4849ab[_0x8c67('0x44')]]=_0x214aae;this['emitVoiceQueueChannelSave'](_0x214aae,_0x8c67('0x17'));}}catch(_0x6dd0ca){logger[_0x8c67('0x39')](_0x8c67('0x74'),_0x4849ab['uniqueid'],util[_0x8c67('0x3b')](_0x6dd0ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')]['syncQueueCallerAbandon']=function(_0x11f87d){try{if(this[_0x8c67('0x62')](_0x11f87d)){logger['debug'](_0x8c67('0x7d'),_0x11f87d[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x11f87d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x11f87d[_0x8c67('0x44')]]){var _0x4645cb=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x11f87d[_0x8c67('0x44')]]);_0x4645cb[_0x8c67('0x7f')]=![];_0x4645cb['queuecallercompleteAt']=null;_0x4645cb['holdtime']=_0x11f87d[_0x8c67('0x80')];_0x4645cb['originalposition']=_0x11f87d['originalposition'];_0x4645cb[_0x8c67('0x19')]=!![];_0x4645cb[_0x8c67('0x81')]=moment()[_0x8c67('0x45')](_0x8c67('0x75'));_0x4645cb[_0x8c67('0x82')]=_0x8c67('0x83');_0x4645cb[_0x8c67('0x84')]=null;logger['info'](_0x8c67('0x85'),_0x4645cb[_0x8c67('0x47')],_0x4645cb[_0x8c67('0x4e')]);this[_0x8c67('0x11')][_0x11f87d[_0x8c67('0x44')]]=_0x4645cb;this[_0x8c67('0x3e')](_0x4645cb,'queuecallerabandon');}}}catch(_0x593d8c){logger[_0x8c67('0x39')](_0x8c67('0x7d'),_0x11f87d['uniqueid'],util['inspect'](_0x593d8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x1b')]=function(_0x1ad1d1){try{if(this[_0x8c67('0x62')](_0x1ad1d1)){logger[_0x8c67('0x49')](_0x8c67('0x86'),_0x1ad1d1[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x1ad1d1,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0x1ad1d1[_0x8c67('0x44')]]){var _0x3e9cb0=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x1ad1d1[_0x8c67('0x44')]]);_0x3e9cb0[_0x8c67('0x87')]=moment()[_0x8c67('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e9cb0[_0x8c67('0x88')]=_0x1ad1d1[_0x8c67('0x88')];_0x3e9cb0[_0x8c67('0x89')]=_0x1ad1d1[_0x8c67('0x89')];logger[_0x8c67('0x6a')](_0x8c67('0x8a'),_0x3e9cb0['name'],_0x3e9cb0[_0x8c67('0x4e')],_0x1ad1d1[_0x8c67('0x88')],_0x1ad1d1[_0x8c67('0x89')]);this[_0x8c67('0x11')][_0x1ad1d1[_0x8c67('0x44')]]=_0x3e9cb0;this['emitVoiceQueueChannelSave'](_0x3e9cb0,_0x8c67('0x1a'));}}}catch(_0x387ea6){logger[_0x8c67('0x39')](_0x8c67('0x86'),_0x1ad1d1[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x387ea6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x1d')]=function(_0x56035e){try{if(this[_0x8c67('0x62')](_0x56035e)){logger[_0x8c67('0x49')]('[%s][voiceQueueReport][agentconnect]',_0x56035e['uniqueid'],util[_0x8c67('0x3b')](_0x56035e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x56035e[_0x8c67('0x44')]]){var _0x21d0b1=_['last'](this['queueReports'][_0x56035e[_0x8c67('0x44')]]);_0x21d0b1[_0x8c67('0x7f')]=!![];_0x21d0b1[_0x8c67('0x82')]='COMPLETEDBYAGENT';logger['info'](_0x8c67('0x8b'),_0x21d0b1[_0x8c67('0x47')],_0x21d0b1[_0x8c67('0x4e')]);}}}catch(_0x2537d8){logger[_0x8c67('0x39')](_0x8c67('0x8c'),_0x56035e[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x2537d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8c67('0x8d')]=function(_0xf93257){try{if(this[_0x8c67('0x62')](_0xf93257)){logger[_0x8c67('0x49')](_0x8c67('0x8e'),_0xf93257['uniqueid'],util[_0x8c67('0x3b')](_0xf93257,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0xf93257['uniqueid']]){var _0x53453b=_['last'](this[_0x8c67('0xf')][_0xf93257[_0x8c67('0x44')]]);_0x53453b[_0x8c67('0x19')]=![];_0x53453b[_0x8c67('0x81')]=null;_0x53453b['assigned']=!![];_0x53453b[_0x8c67('0x84')]=_0xf93257[_0x8c67('0x8f')];_0x53453b['holdtime']=_0xf93257[_0x8c67('0x80')];_0x53453b['queuecallercomplete']=!![];_0x53453b[_0x8c67('0x90')]=![];_0x53453b['queuecallerexitAt']=null;if(!_0x53453b['transfer']){if(_0xf93257['reason']==_0x8c67('0x91')){_0x53453b[_0x8c67('0x82')]='COMPLETED';logger[_0x8c67('0x6a')](_0x8c67('0x92'),_0x53453b[_0x8c67('0x47')],_0x53453b['type']);}else{if(_['startsWith'](_0xf93257[_0x8c67('0x35')]['toLowerCase'](),_0x8c67('0x93'))){if(this[_0x8c67('0xf')][_0xf93257['linkedid']]){var _0xbcb5c8=_['last'](this[_0x8c67('0xf')][_0xf93257[_0x8c67('0x94')]]);_0xbcb5c8[_0x8c67('0x7f')]=![];_0xbcb5c8[_0x8c67('0x90')]=!![];_0xbcb5c8['queuecallerexitAt']=moment(_0x53453b['queuecallerjoinAt'])[_0x8c67('0x95')](_0xf93257[_0x8c67('0x80')],'seconds')[_0x8c67('0x45')](_0x8c67('0x75'));_0xbcb5c8['queuecallerexitreason']='FORWARDTRANSFER';_0xbcb5c8[_0x8c67('0x91')]=!![];_0xbcb5c8[_0x8c67('0x96')]=_0x8c67('0x97');_0xbcb5c8['transferexten']=_0xf93257[_0x8c67('0x98')];_0xbcb5c8[_0x8c67('0x99')]=_0xf93257[_0x8c67('0x44')];logger[_0x8c67('0x6a')](_0x8c67('0x9a'),_0xbcb5c8[_0x8c67('0x47')],_0xbcb5c8[_0x8c67('0x4e')]);var _0x1951cb=this[_0x8c67('0xf')][_0xf93257[_0x8c67('0x94')]];this[_0x8c67('0xf')][_0xf93257['linkedid']]=this[_0x8c67('0xf')][_0xf93257[_0x8c67('0x44')]];this[_0x8c67('0xf')][_0xf93257[_0x8c67('0x44')]]=_0x1951cb;}}else{_0x53453b[_0x8c67('0x82')]=_0x8c67('0x9b')+_0xf93257[_0x8c67('0x9c')][_0x8c67('0x9d')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x53453b['name'],_0x53453b[_0x8c67('0x4e')],_0x53453b['queuecallerexitreason']);}}}this[_0x8c67('0x11')][_0xf93257[_0x8c67('0x44')]]=_0x53453b;this[_0x8c67('0x3e')](_0x53453b,_0x8c67('0x9e'));}}}catch(_0x2991bc){logger[_0x8c67('0x39')](_0x8c67('0x8e'),_0xf93257[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x2991bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x1f')]=function(_0x1bf288){try{if(this[_0x8c67('0x62')](_0x1bf288)){logger[_0x8c67('0x49')](_0x8c67('0x9f'),_0x1bf288[_0x8c67('0x44')],util['inspect'](_0x1bf288,{'showHidden':![],'depth':null}));this['addVariable'](_0x1bf288[_0x8c67('0x44')],_[_0x8c67('0x7b')](_0x1bf288[_0x8c67('0xa0')])[0x0],_0x1bf288[_0x8c67('0xa1')]);if(this['queueReports'][_0x1bf288[_0x8c67('0x44')]]){var _0x5a50ee=_['last'](this[_0x8c67('0xf')][_0x1bf288[_0x8c67('0x44')]]);if(_0x5a50ee){if(this[_0x8c67('0x62')](_0x1bf288[_0x8c67('0xa0')])&&this[_0x8c67('0x62')](_0x1bf288['variable'][_0x8c67('0xa2')])){switch(_0x1bf288[_0x8c67('0xa1')]){case'CONTINUE':_0x5a50ee[_0x8c67('0x90')]=![];_0x5a50ee[_0x8c67('0xa3')]=null;break;case'TIMEOUT':_0x5a50ee[_0x8c67('0xa4')]=_0x8c67('0xa5');_0x5a50ee[_0x8c67('0x90')]=!![];_0x5a50ee[_0x8c67('0xa3')]=moment()['format'](_0x8c67('0x75'));_0x5a50ee[_0x8c67('0x87')]=moment()['format'](_0x8c67('0x75'));logger['debug'](_0x8c67('0xa6'),_0x1bf288[_0x8c67('0x44')],util['inspect'](_0x5a50ee,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x5a50ee);break;default:_0x5a50ee[_0x8c67('0x90')]=!![];_0x5a50ee['queuecallerexitAt']=moment()[_0x8c67('0x45')](_0x8c67('0x75'));_0x5a50ee[_0x8c67('0x87')]=moment()['format'](_0x8c67('0x75'));}_0x5a50ee[_0x8c67('0x19')]=![];_0x5a50ee[_0x8c67('0x81')]=null;_0x5a50ee['queuecallerexitreason']=_0x1bf288[_0x8c67('0xa1')];this[_0x8c67('0x11')][_0x1bf288[_0x8c67('0x44')]]=_0x5a50ee;this['emitVoiceQueueChannelRemove'](_0x5a50ee,'varset');}else if(this['isNotNull'](_0x1bf288[_0x8c67('0xa0')])&&this['isNotNull'](_0x1bf288['variable'][_0x8c67('0xa7')])){if(!_0x5a50ee['queuecallerabandon']){_0x5a50ee[_0x8c67('0x90')]=!![];_0x5a50ee[_0x8c67('0xa3')]=moment()[_0x8c67('0x45')](_0x8c67('0x75'));_0x5a50ee[_0x8c67('0x82')]=_0x8c67('0xa8');_0x5a50ee[_0x8c67('0x87')]=moment()[_0x8c67('0x45')](_0x8c67('0x75'));this[_0x8c67('0x11')][_0x1bf288[_0x8c67('0x44')]]=_0x5a50ee;}}logger['info'](_0x8c67('0xa9'),_0x1bf288[_0x8c67('0x44')],_0x5a50ee[_0x8c67('0x47')],_0x5a50ee['type'],_[_0x8c67('0x7b')](_0x1bf288[_0x8c67('0xa0')])[0x0],_0x1bf288['value']);_0x5a50ee['variables']=this[_0x8c67('0x3c')][_0x1bf288[_0x8c67('0x44')]];}}}}catch(_0x399cdf){logger[_0x8c67('0x39')](_0x8c67('0x9f'),_0x1bf288[_0x8c67('0x44')],util['inspect'](_0x399cdf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')]['addVariable']=function(_0x26804a,_0x22a7c5,_0x26b47f){var _0x19de42=[_0x8c67('0xaa'),_0x8c67('0xab'),_0x8c67('0xac'),_0x8c67('0xad'),_0x8c67('0xae'),_0x8c67('0xaf'),_0x8c67('0xb0'),'rtpaudioqosrttbridged',_0x8c67('0xb1'),_0x8c67('0xb2'),'bridgepeer',_0x8c67('0xb3'),_0x8c67('0xb4'),_0x8c67('0xb5'),'memberinterface',_0x8c67('0xb6'),_0x8c67('0x8f'),'memberpenalty',_0x8c67('0xb7')];if(!_[_0x8c67('0x34')](_0x22a7c5)&&!_[_0x8c67('0xb8')](_0x19de42,_0x22a7c5)){if(_['isUndefined'](this['variables'][_0x26804a])){this[_0x8c67('0x3c')][_0x26804a]={};}this[_0x8c67('0x3c')][_0x26804a][_0x22a7c5]=_0x26b47f;}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0xb9')]=function(_0x2886ce){try{if(this['isNotNull'](_0x2886ce)){logger[_0x8c67('0x49')](_0x8c67('0xba'),_0x2886ce[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x2886ce,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0x2886ce[_0x8c67('0x44')]]){for(var _0x50a882=0x0,_0x4f79da={};_0x50a882<this[_0x8c67('0xf')][_0x2886ce[_0x8c67('0x44')]][_0x8c67('0xbb')];_0x50a882+=0x1){_0x4f79da=this['queueReports'][_0x2886ce[_0x8c67('0x44')]][_0x50a882];if(this[_0x8c67('0x13')][_0x4f79da[_0x8c67('0x6d')]]){if(_0x4f79da[_0x8c67('0x90')]&&_0x4f79da['transfer']!=!![]){this['voiceQueues'][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x58')]+=0x1;}if(_0x4f79da[_0x8c67('0x19')]){this[_0x8c67('0x13')][_0x4f79da['queue']]['abandoned']+=0x1;}this[_0x8c67('0x13')][_0x4f79da['queue']]['sumHoldTime']+=moment(_0x4f79da['queuecallerleaveAt'])[_0x8c67('0xbc')](_0x4f79da[_0x8c67('0xbd')],'seconds')||0x0;if(_0x50a882===this[_0x8c67('0xf')][_0x2886ce[_0x8c67('0x44')]]['length']-0x1){this['voiceQueues'][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x55')]+=moment()[_0x8c67('0xbe')](0x0)['diff'](_0x4f79da[_0x8c67('0xbd')],_0x8c67('0xbf'));this[_0x8c67('0x13')][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x57')]+=0x1;if(_0x4f79da['queuecallercomplete']){this[_0x8c67('0x13')][_0x4f79da['queue']][_0x8c67('0x51')]+=0x1;this[_0x8c67('0x13')][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x54')]+=moment()[_0x8c67('0xbe')](0x0)[_0x8c67('0xbc')](_0x4f79da[_0x8c67('0x87')],_0x8c67('0xbf'));_0x4f79da[_0x8c67('0xc0')]=moment()[_0x8c67('0x45')](_0x8c67('0x75'));_0x4f79da['queuecallerexit']=![];_0x4f79da[_0x8c67('0xa3')]=null;}if(_0x4f79da['queuecallerexit']&&_0x4f79da[_0x8c67('0x91')]!=!![]){_0x4f79da[_0x8c67('0xa4')]=_0x8c67('0x58');logger[_0x8c67('0x49')](_0x8c67('0xc1'),_0x2886ce[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x4f79da,{'showHidden':![],'depth':null}));ami[_0x8c67('0x40')](_0x8c67('0xc2'),_0x4f79da);}if(_0x4f79da[_0x8c67('0x19')]){_0x4f79da['lastevent']=_0x8c67('0x59');logger[_0x8c67('0x49')](_0x8c67('0xc3'),_0x2886ce['uniqueid'],util['inspect'](_0x4f79da,{'showHidden':![],'depth':null}));ami[_0x8c67('0x40')](_0x8c67('0xc4'),_0x4f79da);}}else{this[_0x8c67('0x13')][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x55')]+=this['voiceQueues'][_0x4f79da[_0x8c67('0x6d')]][_0x8c67('0x56')];}logger[_0x8c67('0x6a')](_0x8c67('0xc5'),_0x2886ce['uniqueid'],_0x4f79da[_0x8c67('0x47')],_0x4f79da[_0x8c67('0x4e')],_0x2886ce['cause-txt']);this[_0x8c67('0x11')][_0x2886ce[_0x8c67('0x44')]]=_0x4f79da;this[_0x8c67('0x3e')](_0x4f79da,_0x8c67('0x20'));this[_0x8c67('0x4d')](this[_0x8c67('0x13')][_0x4f79da[_0x8c67('0x6d')]],_0x8c67('0x20'));}}logger[_0x8c67('0x49')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x2886ce['uniqueid'],util[_0x8c67('0x3b')](this[_0x8c67('0xf')][_0x2886ce[_0x8c67('0x44')]],{'showHidden':![],'depth':null}));ami[_0x8c67('0x40')](_0x8c67('0xc6'),this[_0x8c67('0xf')][_0x2886ce[_0x8c67('0x44')]]);delete this[_0x8c67('0xf')][_0x2886ce['uniqueid']];delete this[_0x8c67('0x11')][_0x2886ce[_0x8c67('0x44')]];}if(this['variables'][_0x2886ce[_0x8c67('0x44')]]){delete this[_0x8c67('0x3c')][_0x2886ce['uniqueid']];}}}catch(_0x87b6a9){logger[_0x8c67('0x39')]('[%s][voiceQueueReport][hangup]',_0x2886ce[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x87b6a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x27')]=function(_0x37e49d){try{if(this[_0x8c67('0x62')](_0x37e49d)){logger[_0x8c67('0x49')]('[%s][voiceQueueReport][attendedtransfer]',_0x37e49d['uniqueid'],util[_0x8c67('0x3b')](_0x37e49d,{'showHidden':![],'depth':null}));var _0x58642b;if(this['queueReports'][_0x37e49d['transfereeuniqueid']]){_0x58642b=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xc7')]]);_0x58642b[_0x8c67('0xc8')]=_0x37e49d[_0x8c67('0xc9')];_0x58642b[_0x8c67('0x99')]=_0x37e49d[_0x8c67('0xca')];_0x58642b['queuecallerexitreason']='ATTENDEDTRANSFER';_0x58642b[_0x8c67('0x91')]=!![];_0x58642b[_0x8c67('0x96')]=_0x8c67('0xcb');if(this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xca')]]){var _0x710971=this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xca')]];this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xca')]]=this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xc7')]];this[_0x8c67('0xf')][_0x37e49d['transfereeuniqueid']]=_0x710971;var _0x3695b1=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xc7')]]);_0x3695b1[_0x8c67('0x33')]=!![];}logger[_0x8c67('0x6a')](_0x8c67('0xcc'),_0x37e49d[_0x8c67('0x44')],_0x58642b[_0x8c67('0x47')],_0x58642b[_0x8c67('0x4e')],_0x58642b[_0x8c67('0xc8')],_0x58642b[_0x8c67('0x99')]);}else if(this[_0x8c67('0xf')][_0x37e49d['transfertargetuniqueid']]){_0x58642b=_[_0x8c67('0x7e')](this['queueReports'][_0x37e49d[_0x8c67('0xcd')]]);_0x58642b[_0x8c67('0xc8')]=_0x37e49d[_0x8c67('0xce')];_0x58642b['transferuniqueid']=_0x37e49d['origtransfereruniqueid'];_0x58642b[_0x8c67('0x82')]=_0x8c67('0xcf');_0x58642b[_0x8c67('0x91')]=!![];_0x58642b['transfertype']='ATTENDED';if(this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xd0')]]){var _0x710971=this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xd0')]];this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xd0')]]=this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xcd')]];this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xcd')]]=_0x710971;var _0x3695b1=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x37e49d[_0x8c67('0xcd')]]);_0x3695b1['switch']=!![];}logger[_0x8c67('0x6a')](_0x8c67('0xcc'),_0x37e49d['uniqueid'],_0x58642b[_0x8c67('0x47')],_0x58642b['type'],_0x58642b[_0x8c67('0xc8')],_0x58642b[_0x8c67('0x99')]);}}}catch(_0x1b1862){logger['error']('[%s][voiceQueueReport][attendedtransfer]',_0x37e49d[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x1b1862,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x28')]=function(_0x1ca8c9){try{if(this[_0x8c67('0x62')](_0x1ca8c9)){logger[_0x8c67('0x49')]('[%s][voiceQueueReport][blindtransfer]',_0x1ca8c9[_0x8c67('0x44')],util['inspect'](_0x1ca8c9,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0x1ca8c9[_0x8c67('0xc7')]]){var _0x413afc=_['last'](this[_0x8c67('0xf')][_0x1ca8c9['transfereeuniqueid']]);_0x413afc['queuecallerexitreason']=_0x8c67('0xd1');_0x413afc[_0x8c67('0x91')]=!![];_0x413afc[_0x8c67('0x96')]='BLIND';_0x413afc[_0x8c67('0xc8')]=_0x1ca8c9[_0x8c67('0xd2')];_0x413afc[_0x8c67('0x99')]=_0x1ca8c9[_0x8c67('0xc7')];logger['info'](_0x8c67('0xd3'),_0x1ca8c9[_0x8c67('0x44')],_0x413afc[_0x8c67('0x47')],_0x413afc['type'],_0x413afc[_0x8c67('0xc8')],_0x413afc['transferuniqueid']);this['syncHangup']({'event':_0x8c67('0xd4'),'uniqueid':_0x1ca8c9[_0x8c67('0xc7')],'context':_0x1ca8c9['context'],'channel':_0x1ca8c9[_0x8c67('0xd5')]});}}}catch(_0x5003d0){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x1ca8c9[_0x8c67('0x44')],util['inspect'](_0x5003d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0xd6')]=function(_0x205d5c){try{if(this['isNotNull'](_0x205d5c)){logger['debug'](_0x8c67('0xd7'),_0x205d5c[_0x8c67('0x44')],util['inspect'](_0x205d5c,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0x205d5c[_0x8c67('0x44')]]){var _0x58c4f4=_[_0x8c67('0x7e')](this[_0x8c67('0xf')][_0x205d5c[_0x8c67('0x44')]]);if(!_[_0x8c67('0x34')](_0x58c4f4[_0x8c67('0x87')])){_0x58c4f4[_0x8c67('0xd8')]=moment()[_0x8c67('0x45')](_0x8c67('0x75'));logger[_0x8c67('0x6a')](_0x8c67('0xd9'),_0x205d5c[_0x8c67('0x44')],_0x58c4f4[_0x8c67('0xd8')]);}}}}catch(_0x1b951d){logger[_0x8c67('0x39')](_0x8c67('0xd7'),_0x205d5c[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x1b951d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c67('0xa')][_0x8c67('0x25')]=function(_0x5c6f02){try{if(this['isNotNull'](_0x5c6f02)){logger['debug'](_0x8c67('0xda'),_0x5c6f02['uniqueid'],util[_0x8c67('0x3b')](_0x5c6f02,{'showHidden':![],'depth':null}));if(this[_0x8c67('0xf')][_0x5c6f02['uniqueid']]){var _0x129231=_['last'](this[_0x8c67('0xf')][_0x5c6f02[_0x8c67('0x44')]]);if(!_[_0x8c67('0x34')](_0x129231[_0x8c67('0xd8')])){_0x129231[_0x8c67('0xdb')]+=moment()['milliseconds'](0x0)[_0x8c67('0xbc')](_0x129231[_0x8c67('0xd8')],_0x8c67('0xbf'));logger[_0x8c67('0x6a')](_0x8c67('0xdc'),_0x5c6f02[_0x8c67('0x44')],_0x129231[_0x8c67('0xdb')]);delete _0x129231[_0x8c67('0xd8')];}}}}catch(_0x21c2af){logger['error'](_0x8c67('0xda'),_0x5c6f02[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x21c2af,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncNewExten']=function(_0x115c0d){try{if(this['isNotNull'](_0x115c0d)){logger[_0x8c67('0x49')](_0x8c67('0xdd'),_0x115c0d[_0x8c67('0x44')],util[_0x8c67('0x3b')](_0x115c0d,{'showHidden':![],'depth':null}));if(_0x115c0d['application'][_0x8c67('0xde')]()===_0x8c67('0xdf')){_0x115c0d[_0x8c67('0xe0')]=_0x115c0d[_0x8c67('0xe1')]&&_0x115c0d[_0x8c67('0xe1')][_0x8c67('0xe2')](_0x8c67('0xe3'))?_0x115c0d['appdata']:(_0x115c0d['appdata']||_0x115c0d[_0x8c67('0xe0')])[_0x8c67('0xde')]();if(_['startsWith'](_0x115c0d[_0x8c67('0xe0')][_0x8c67('0xde')](),_0x8c67('0xe4'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x115c0d[_0x8c67('0x44')],_0x115c0d[_0x8c67('0xe5')],_0x115c0d['applicationdata']);if(_[_0x8c67('0x63')](this['channels'][_0x115c0d[_0x8c67('0x44')]]))this['channels'][_0x115c0d[_0x8c67('0x44')]]={};var _0x3a829c=_0x115c0d[_0x8c67('0xe0')]['split']('=');var _0x497d06=_0x3a829c[0x0][_0x8c67('0xde')]()[_0x8c67('0xe6')](/cdr\((.*)\)/);if(_0x497d06)this[_0x8c67('0x11')][_0x115c0d['uniqueid']][_0x497d06[0x1]]=_0x3a829c[0x1];}}}}catch(_0x3b84f4){logger[_0x8c67('0x39')](_0x8c67('0xe7'),_0x115c0d[_0x8c67('0x44')],util['inspect'](_0x3b84f4,{'showHidden':![],'depth':null}));}};module[_0x8c67('0xe8')]=VoiceQueueReport;
\ No newline at end of file
index 05232ab..f53a608 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac3=['queue','Request','CreateReportAgentPreview','../client','createHistory','campaign'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x6ac3,0x19b));var _0x36ac=function(_0x2d887c,_0x5f1409){_0x2d887c=_0x2d887c-0x0;var _0x32b7d9=_0x6ac3[_0x2d887c];return _0x32b7d9;};'use strict';var client=require(_0x36ac('0x0'));exports[_0x36ac('0x1')]=function(_0x1aadd0){return function(){_0x1aadd0[_0x36ac('0x2')]=_0x1aadd0[_0x36ac('0x3')];return client[_0x36ac('0x4')]('CreateReportAgentPreview',{'body':_0x1aadd0,'log':_0x36ac('0x5')});};};
\ No newline at end of file
+var _0x0c55=['CreateReportAgentPreview','../client','createHistory','campaign','queue'];(function(_0x4ed962,_0x386ab9){var _0x5205ed=function(_0x4b1d17){while(--_0x4b1d17){_0x4ed962['push'](_0x4ed962['shift']());}};_0x5205ed(++_0x386ab9);}(_0x0c55,0x173));var _0x50c5=function(_0xae65c6,_0xa96c0d){_0xae65c6=_0xae65c6-0x0;var _0x3c549e=_0x0c55[_0xae65c6];return _0x3c549e;};'use strict';var client=require(_0x50c5('0x0'));exports[_0x50c5('0x1')]=function(_0x5ce770){return function(){_0x5ce770[_0x50c5('0x2')]=_0x5ce770[_0x50c5('0x3')];return client['Request'](_0x50c5('0x4'),{'body':_0x5ce770,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index 0ac8429..fd2c719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f1=['CreateAttachment','../client','Request'];(function(_0x1d2a22,_0x435dcd){var _0x3155db=function(_0x5b8f10){while(--_0x5b8f10){_0x1d2a22['push'](_0x1d2a22['shift']());}};_0x3155db(++_0x435dcd);}(_0x93f1,0x7c));var _0x193f=function(_0x29d273,_0x43764b){_0x29d273=_0x29d273-0x0;var _0x2228d5=_0x93f1[_0x29d273];return _0x2228d5;};'use strict';var client=require(_0x193f('0x0'));exports['create']=function(_0x117d4b){return client[_0x193f('0x1')](_0x193f('0x2'),{'body':_0x117d4b,'log':_0x193f('0x2')});};
\ No newline at end of file
+var _0xa45b=['create'];(function(_0x2b9260,_0xf88243){var _0x33bf34=function(_0x4697fd){while(--_0x4697fd){_0x2b9260['push'](_0x2b9260['shift']());}};_0x33bf34(++_0xf88243);}(_0xa45b,0x199));var _0xba45=function(_0x8e8f68,_0x2f8172){_0x8e8f68=_0x8e8f68-0x0;var _0x34f477=_0xa45b[_0x8e8f68];return _0x34f477;};'use strict';var client=require('../client');exports[_0xba45('0x0')]=function(_0x1abc63){return client['Request']('CreateAttachment',{'body':_0x1abc63,'log':'CreateAttachment'});};
\ No newline at end of file
index f8ea4ae..8e660cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','Trunk','callerid','TrunkBackup','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','GetCampaign','name','type','active','limitCalls'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5f2f,0x73));var _0xf5f2=function(_0xda3232,_0x23543a){_0xda3232=_0xda3232-0x0;var _0x5ec147=_0x5f2f[_0xda3232];return _0x5ec147;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'dialNoAnswerRetryFrequency',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'dialDropMaxRetry',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'dialMachineMaxRetry',_0xf5f2('0x14'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xf5f2('0x15'),_0xf5f2('0x16'),'dialAMDActive',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'dialAMDMaximumNumberOfWords',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21'),'dialCutDigit'],'include':[{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x22'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x24'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x25'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x26'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x27')]}]},{'model':'SquareProject','as':_0xf5f2('0x28'),'attributes':['id',_0xf5f2('0x4')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x2b6453,_0xbaeaf){var _0x3fa2dc=function(_0x5225a1){while(--_0x5225a1){_0x2b6453['push'](_0x2b6453['shift']());}};_0x3fa2dc(++_0xbaeaf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
index ff67a7a..3dab19b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80c0=['GetCmContact','../client','createContact','Request','getContacts'];(function(_0x4f790c,_0x130d61){var _0x425d7b=function(_0x22691d){while(--_0x22691d){_0x4f790c['push'](_0x4f790c['shift']());}};_0x425d7b(++_0x130d61);}(_0x80c0,0x1c8));var _0x080c=function(_0x21b5bb,_0x2217f2){_0x21b5bb=_0x21b5bb-0x0;var _0x56e324=_0x80c0[_0x21b5bb];return _0x56e324;};'use strict';var client=require(_0x080c('0x0'));exports[_0x080c('0x1')]=function(_0x4fb890){return function(){return client[_0x080c('0x2')]('CreateCmContact',{'body':_0x4fb890,'log':'CreateCmContact'});};};exports[_0x080c('0x3')]=function(_0x360096){return function(){return client[_0x080c('0x2')](_0x080c('0x4'),{'options':_0x360096,'log':_0x080c('0x4')});};};
\ No newline at end of file
+var _0xd562=['getContacts','GetCmContact','Request','CreateCmContact'];(function(_0x14b009,_0x25e9cb){var _0x2e606d=function(_0x37a0ad){while(--_0x37a0ad){_0x14b009['push'](_0x14b009['shift']());}};_0x2e606d(++_0x25e9cb);}(_0xd562,0x1d6));var _0x2d56=function(_0x2fb5ab,_0x41c964){_0x2fb5ab=_0x2fb5ab-0x0;var _0x591729=_0xd562[_0x2fb5ab];return _0x591729;};'use strict';var client=require('../client');exports['createContact']=function(_0x401b1f){return function(){return client[_0x2d56('0x0')](_0x2d56('0x1'),{'body':_0x401b1f,'log':_0x2d56('0x1')});};};exports[_0x2d56('0x2')]=function(_0x1cbeaf){return function(){return client['Request'](_0x2d56('0x3'),{'options':_0x1cbeaf,'log':_0x2d56('0x3')});};};
\ No newline at end of file
index b9bd155..84f7d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad4b=['voicePause','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','campaign','queue','MoveContactManagedDialer','CountReScheduled','GetCmHopperPreview','User','Agent','name','unlockContact','getContactRecallMe','GetContactRecallMe'];(function(_0x3ce13e,_0x570f78){var _0x586347=function(_0x4acbda){while(--_0x4acbda){_0x3ce13e['push'](_0x3ce13e['shift']());}};_0x586347(++_0x570f78);}(_0xad4b,0x10b));var _0xbad4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xad4b[_0x4fde08];return _0x12e725;};'use strict';var client=require(_0xbad4('0x0'));var moment=require(_0xbad4('0x1'));var _=require(_0xbad4('0x2'));exports[_0xbad4('0x3')]=function(_0x1c2b6b,_0x219672){return function(){return client[_0xbad4('0x4')](_0xbad4('0x5'),{'options':{'where':{'VoiceQueueId':_0x1c2b6b},'include':[{'model':_0xbad4('0x6'),'as':_0xbad4('0x7')}],'limit':_0x219672,'raw':![]},'log':_0xbad4('0x8')});};};exports['updateContacts']=function(_0x57d42b,_0x20ba64,_0x4f76e2){return function(){return client[_0xbad4('0x4')](_0xbad4('0x9'),{'body':_0x57d42b,'options':{'where':{'VoiceQueueId':_0x20ba64,'scheduledat':{'$lte':moment()[_0xbad4('0xa')](_0xbad4('0xb'))}},'limit':_0x4f76e2},'log':_0xbad4('0x9')});};};exports[_0xbad4('0xc')]=function(_0x3cb5e5){return function(){return client[_0xbad4('0x4')]('UpdateCmHopper',{'body':_0x3cb5e5,'options':{'where':{'ContactId':_0x3cb5e5[_0xbad4('0xd')],'ListId':_0x3cb5e5[_0xbad4('0xe')],'VoiceQueueId':_0x3cb5e5[_0xbad4('0xf')],'CampaignId':_0x3cb5e5['CampaignId']}},'log':_0xbad4('0xc')});};};exports[_0xbad4('0x10')]=function(_0x33ce81,_0x20cf0d,_0x4db643){return function(){return client['Request'](_0xbad4('0x11'),{'options':{'where':{'VoiceQueueId':_0x33ce81,'ListId':_0x20cf0d,'ContactId':_0x4db643}},'log':_0xbad4('0x11')});};};exports[_0xbad4('0x12')]=function(_0x3f3ac7,_0x1f575d,_0x500b88,_0x23cba5){return function(){return client[_0xbad4('0x4')](_0xbad4('0x13'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3f3ac7,'active':![],'scheduledat':{'$lte':moment()['format'](_0xbad4('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1f575d}}]},'order':[[_0xbad4('0x14'),_0xbad4('0x15')],[_0xbad4('0x16'),_0x23cba5],['id',_0xbad4('0x17')]],'raw':!![],'limit':_0x500b88},'log':'GetContactDialer'});};};exports[_0xbad4('0x18')]=function(_0x2fdc65,_0x500500,_0x1865bf){return function(){return client[_0xbad4('0x4')](_0xbad4('0x13'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2fdc65,'active':![],'scheduledat':{'$lte':moment()[_0xbad4('0xa')](_0xbad4('0xb'))}},'include':[{'model':_0xbad4('0x6'),'as':_0xbad4('0x7')}],'order':[['priority',_0xbad4('0x15')],[_0xbad4('0x16'),_0x1865bf],['id',_0xbad4('0x17')]],'raw':!![],'limit':_0x500500},'log':_0xbad4('0x19')});};};exports['moveContactManagedDialer']=function(_0x2bae8a,_0x4660aa){return function(){_0x2bae8a[_0xbad4('0x1a')]=_0x2bae8a[_0xbad4('0x1b')];return client['Request'](_0xbad4('0x1c'),{'body':_0x2bae8a,'options':{'where':{'ContactId':_0x2bae8a['ContactId'],'ListId':_0x2bae8a[_0xbad4('0xe')],'VoiceQueueId':_0x2bae8a[_0xbad4('0xf')],'CampaignId':_0x2bae8a['CampaignId'],'active':_0x4660aa?undefined:!![]}},'log':_0xbad4('0x1c')});};};exports['countReScheduled']=function(_0x16fce8){return function(){return client[_0xbad4('0x4')](_0xbad4('0x1d'),{'options':{'where':{'VoiceQueueId':_0x16fce8['id']?_0x16fce8['id']||null:null}},'log':'countReScheduled'});};};exports['getContactPreview']=function(_0x2842c){return function(){return client[_0xbad4('0x4')](_0xbad4('0x1e'),{'options':{'where':{'id':_0x2842c},'include':[{'model':_0xbad4('0x6'),'as':_0xbad4('0x7')},{'model':_0xbad4('0x1f'),'as':_0xbad4('0x20'),'attributes':['id','name']},{'model':'VoiceQueue','as':'Queue','attributes':['id',_0xbad4('0x21')]}],'raw':!![]},'log':_0xbad4('0x8')});};};exports[_0xbad4('0x22')]=function(_0x5ba5de,_0x51bcd0,_0x3c98cd){return function(){return client[_0xbad4('0x4')]('UpdateCmHopper',{'body':_0x5ba5de,'options':{'where':{'id':_0x51bcd0},'limit':_0x3c98cd},'log':'UpdateCmHopper'});};};exports[_0xbad4('0x23')]=function(_0x1f422c,_0x42e37e){return function(){return client['Request'](_0xbad4('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1f422c,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xbad4('0xa')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x42e37e}},'order':[[_0xbad4('0x14'),'DESC'],['scheduledat','DESC'],['id',_0xbad4('0x17')]],'include':[{'model':_0xbad4('0x6'),'as':_0xbad4('0x7')},{'model':'User','as':_0xbad4('0x20'),'attributes':['id',_0xbad4('0x21'),_0xbad4('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
+var _0x6246=['getContactPreview','GetCmHopperPreview','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','User','Agent','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','UpdateCmHopper','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','ContactId','countReScheduled','CountReScheduled'];(function(_0x12fbf2,_0x34e0e1){var _0x2062d2=function(_0x54cab6){while(--_0x54cab6){_0x12fbf2['push'](_0x12fbf2['shift']());}};_0x2062d2(++_0x34e0e1);}(_0x6246,0xb1));var _0x6624=function(_0x3f79f2,_0x3ab4b7){_0x3f79f2=_0x3f79f2-0x0;var _0x21fa23=_0x6246[_0x3f79f2];return _0x21fa23;};'use strict';var client=require(_0x6624('0x0'));var moment=require(_0x6624('0x1'));var _=require(_0x6624('0x2'));exports[_0x6624('0x3')]=function(_0x442072,_0x5b133e){return function(){return client[_0x6624('0x4')](_0x6624('0x5'),{'options':{'where':{'VoiceQueueId':_0x442072},'include':[{'model':_0x6624('0x6'),'as':_0x6624('0x7')}],'limit':_0x5b133e,'raw':![]},'log':_0x6624('0x8')});};};exports[_0x6624('0x9')]=function(_0x1c10d2,_0x238316,_0x2f0c73){return function(){return client[_0x6624('0x4')]('UpdateCmHopper',{'body':_0x1c10d2,'options':{'where':{'VoiceQueueId':_0x238316,'scheduledat':{'$lte':moment()[_0x6624('0xa')](_0x6624('0xb'))}},'limit':_0x2f0c73},'log':'UpdateCmHopper'});};};exports[_0x6624('0xc')]=function(_0x5f079f){return function(){return client['Request'](_0x6624('0xd'),{'body':_0x5f079f,'options':{'where':{'ContactId':_0x5f079f['ContactId'],'ListId':_0x5f079f[_0x6624('0xe')],'VoiceQueueId':_0x5f079f[_0x6624('0xf')],'CampaignId':_0x5f079f[_0x6624('0x10')]}},'log':_0x6624('0xc')});};};exports[_0x6624('0x11')]=function(_0x2d267b,_0x5bf706,_0x3f75a5){return function(){return client[_0x6624('0x4')](_0x6624('0x12'),{'options':{'where':{'VoiceQueueId':_0x2d267b,'ListId':_0x5bf706,'ContactId':_0x3f75a5}},'log':'DestroyCmHopper'});};};exports[_0x6624('0x13')]=function(_0x598b97,_0x16c644,_0x27144d,_0xfda5d5){return function(){return client['Request'](_0x6624('0x14'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x598b97,'active':![],'scheduledat':{'$lte':moment()['format'](_0x6624('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x16c644}}]},'order':[[_0x6624('0x15'),_0x6624('0x16')],[_0x6624('0x17'),_0xfda5d5],['id',_0x6624('0x18')]],'raw':!![],'limit':_0x27144d},'log':'GetContactDialer'});};};exports[_0x6624('0x19')]=function(_0x3a885d,_0x589e0e,_0x302c3c){return function(){return client[_0x6624('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x3a885d,'active':![],'scheduledat':{'$lte':moment()['format'](_0x6624('0xb'))}},'include':[{'model':_0x6624('0x6'),'as':_0x6624('0x7')}],'order':[[_0x6624('0x15'),_0x6624('0x16')],[_0x6624('0x17'),_0x302c3c],['id',_0x6624('0x18')]],'raw':!![],'limit':_0x589e0e},'log':_0x6624('0x1a')});};};exports[_0x6624('0x1b')]=function(_0x2afb54,_0x44eac8){return function(){_0x2afb54['campaign']=_0x2afb54[_0x6624('0x1c')];return client[_0x6624('0x4')](_0x6624('0x1d'),{'body':_0x2afb54,'options':{'where':{'ContactId':_0x2afb54[_0x6624('0x1e')],'ListId':_0x2afb54[_0x6624('0xe')],'VoiceQueueId':_0x2afb54[_0x6624('0xf')],'CampaignId':_0x2afb54['CampaignId'],'active':_0x44eac8?undefined:!![]}},'log':_0x6624('0x1d')});};};exports[_0x6624('0x1f')]=function(_0x32cf26){return function(){return client[_0x6624('0x4')](_0x6624('0x20'),{'options':{'where':{'VoiceQueueId':_0x32cf26['id']?_0x32cf26['id']||null:null}},'log':_0x6624('0x1f')});};};exports[_0x6624('0x21')]=function(_0xedc780){return function(){return client[_0x6624('0x4')](_0x6624('0x22'),{'options':{'where':{'id':_0xedc780},'include':[{'model':'CmContact','as':'Contact'},{'model':'User','as':'Agent','attributes':['id',_0x6624('0x23')]},{'model':_0x6624('0x24'),'as':'Queue','attributes':['id',_0x6624('0x23')]}],'raw':!![]},'log':_0x6624('0x8')});};};exports[_0x6624('0x25')]=function(_0x506a0a,_0x3404b8,_0x4d5d2d){return function(){return client[_0x6624('0x4')](_0x6624('0xd'),{'body':_0x506a0a,'options':{'where':{'id':_0x3404b8},'limit':_0x4d5d2d},'log':_0x6624('0xd')});};};exports[_0x6624('0x26')]=function(_0x18e816,_0x15b36c){return function(){return client[_0x6624('0x4')](_0x6624('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x18e816,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x6624('0xa')](_0x6624('0xb'))},'UserId':{'$in':_0x15b36c}},'order':[[_0x6624('0x15'),_0x6624('0x16')],['scheduledat',_0x6624('0x16')],['id',_0x6624('0x18')]],'include':[{'model':_0x6624('0x6'),'as':_0x6624('0x7')},{'model':_0x6624('0x28'),'as':_0x6624('0x29'),'attributes':['id','name','voicePause']}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x6624('0x14')});};};
\ No newline at end of file
index 7cc5e67..d9cc9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c1=['verifyAdditionalPhones','Request','VerifyAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters'];(function(_0x3f288d,_0x3c7a97){var _0x5e8468=function(_0xb0189c){while(--_0xb0189c){_0x3f288d['push'](_0x3f288d['shift']());}};_0x5e8468(++_0x3c7a97);}(_0xd7c1,0x16e));var _0x1d7c=function(_0x379c40,_0x577071){_0x379c40=_0x379c40-0x0;var _0x42346d=_0xd7c1[_0x379c40];return _0x42346d;};'use strict';var client=require('../client');var moment=require('moment');exports[_0x1d7c('0x0')]=function(_0x275fa0,_0x1da69d,_0x26cbd0){return function(){return client[_0x1d7c('0x1')](_0x1d7c('0x2'),{'body':_0x275fa0,'reason':_0x1da69d,'entity':_0x26cbd0,'log':_0x1d7c('0x2')});};};exports['swapAdditionalPhones']=function(_0x5776d8,_0x4b98c5,_0xde5c1b){return function(){return client[_0x1d7c('0x1')]('SwapAdditionalPhones',{'body':_0x5776d8,'duration':_0x4b98c5,'waitTime':_0xde5c1b,'log':_0x1d7c('0x3')});};};exports[_0x1d7c('0x4')]=function(_0x35031a){return function(){return client['Request'](_0x1d7c('0x5'),{'body':_0x35031a,'log':_0x1d7c('0x5')});};};
\ No newline at end of file
+var _0x1df2=['swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','../client','moment','verifyAdditionalPhones','Request','VerifyAdditionalPhones'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x1df2,0xdb));var _0x21df=function(_0x2344ee,_0x159a48){_0x2344ee=_0x2344ee-0x0;var _0x2fc837=_0x1df2[_0x2344ee];return _0x2fc837;};'use strict';var client=require(_0x21df('0x0'));var moment=require(_0x21df('0x1'));exports[_0x21df('0x2')]=function(_0x5b1940,_0xf6e1c4,_0x174782){return function(){return client[_0x21df('0x3')](_0x21df('0x4'),{'body':_0x5b1940,'reason':_0xf6e1c4,'entity':_0x174782,'log':_0x21df('0x4')});};};exports[_0x21df('0x5')]=function(_0x4f33a4,_0x30ead2,_0x5d73c4){return function(){return client[_0x21df('0x3')]('SwapAdditionalPhones',{'body':_0x4f33a4,'duration':_0x30ead2,'waitTime':_0x5d73c4,'log':_0x21df('0x6')});};};exports[_0x21df('0x7')]=function(_0xf7294){return function(){return client[_0x21df('0x3')]('IncrementPreviewCounters',{'body':_0xf7294,'log':'IncrementPreviewCounters'});};};
\ No newline at end of file
index d2ecc66..ea0223f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe65=['GetCmHopperBlack','VoiceQueueId','Request','GetCmHopperBlackIvr','../client','checkIsBlackList'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe65,0x1ba));var _0x5be6=function(_0x29215d,_0x39143f){_0x29215d=_0x29215d-0x0;var _0x265037=_0xbe65[_0x29215d];return _0x265037;};'use strict';var client=require(_0x5be6('0x0'));exports[_0x5be6('0x1')]=function(_0x5b290d){return function(){return client['Request'](_0x5be6('0x2'),{'options':{'where':{'VoiceQueueId':_0x5b290d[_0x5be6('0x3')],'phone':_0x5b290d['phone']},'raw':![]},'log':'GetCmHopperBlack'});};};exports['checkIsBlackListIvr']=function(_0x14cddd){return function(){return client[_0x5be6('0x4')](_0x5be6('0x2'),{'options':{'where':{'CampaignId':_0x14cddd['CampaignId'],'phone':_0x14cddd['phone']},'raw':![]},'log':_0x5be6('0x5')});};};
\ No newline at end of file
+var _0xcf74=['phone','checkIsBlackListIvr','GetCmHopperBlack','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','VoiceQueueId'];(function(_0xf467fd,_0x4aba6a){var _0x406fd8=function(_0x33289d){while(--_0x33289d){_0xf467fd['push'](_0xf467fd['shift']());}};_0x406fd8(++_0x4aba6a);}(_0xcf74,0x1f4));var _0x4cf7=function(_0x40b15d,_0x1333a1){_0x40b15d=_0x40b15d-0x0;var _0x19e817=_0xcf74[_0x40b15d];return _0x19e817;};'use strict';var client=require(_0x4cf7('0x0'));exports[_0x4cf7('0x1')]=function(_0x5ecb72){return function(){return client[_0x4cf7('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x5ecb72[_0x4cf7('0x3')],'phone':_0x5ecb72[_0x4cf7('0x4')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x4cf7('0x5')]=function(_0x2b26a0){return function(){return client[_0x4cf7('0x2')](_0x4cf7('0x6'),{'options':{'where':{'CampaignId':_0x2b26a0[_0x4cf7('0x7')],'phone':_0x2b26a0['phone']},'raw':![]},'log':_0x4cf7('0x8')});};};
\ No newline at end of file
index 4e86784..a190c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19db=['createContact','queue','Request','CreateCmHopperFinal','../client'];(function(_0x3f0d63,_0xf7c6df){var _0x4c6d00=function(_0x2a37b3){while(--_0x2a37b3){_0x3f0d63['push'](_0x3f0d63['shift']());}};_0x4c6d00(++_0xf7c6df);}(_0x19db,0x149));var _0xb19d=function(_0x30df37,_0x48ad64){_0x30df37=_0x30df37-0x0;var _0x41ab55=_0x19db[_0x30df37];return _0x41ab55;};'use strict';var client=require(_0xb19d('0x0'));exports[_0xb19d('0x1')]=function(_0x266e95){return function(){_0x266e95['campaign']=_0x266e95[_0xb19d('0x2')];return client[_0xb19d('0x3')](_0xb19d('0x4'),{'body':_0x266e95,'log':_0xb19d('0x4')});};};
\ No newline at end of file
+var _0x72c7=['../client','createContact','campaign','queue','Request','CreateCmHopperFinal'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x72c7,0x16e));var _0x772c=function(_0x183ac6,_0x116612){_0x183ac6=_0x183ac6-0x0;var _0xd88667=_0x72c7[_0x183ac6];return _0xd88667;};'use strict';var client=require(_0x772c('0x0'));exports[_0x772c('0x1')]=function(_0x5a785f){return function(){_0x5a785f[_0x772c('0x2')]=_0x5a785f[_0x772c('0x3')];return client[_0x772c('0x4')](_0x772c('0x5'),{'body':_0x5a785f,'log':_0x772c('0x5')});};};
\ No newline at end of file
index 7e88164..c5e864c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfad2=['day','endOf','GetCampaignHopperHistory','ivr','../client','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf'];(function(_0x5a15f1,_0xc6831e){var _0x32960e=function(_0x374be8){while(--_0x374be8){_0x5a15f1['push'](_0x5a15f1['shift']());}};_0x32960e(++_0xc6831e);}(_0xfad2,0x194));var _0x2fad=function(_0x4a3716,_0x195886){_0x4a3716=_0x4a3716-0x0;var _0x384341=_0xfad2[_0x4a3716];return _0x384341;};'use strict';var client=require(_0x2fad('0x0'));var moment=require('moment');exports[_0x2fad('0x1')]=function(_0x218a1d){return function(){_0x218a1d[_0x2fad('0x2')]=_0x218a1d[_0x2fad('0x3')];return client[_0x2fad('0x4')](_0x2fad('0x5'),{'body':_0x218a1d,'log':'CreateCmHopperHistory'});};};exports[_0x2fad('0x6')]=function(_0x1b20b4){return function(){return client[_0x2fad('0x4')](_0x2fad('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x2fad('0x8')](_0x1b20b4,_0x2fad('0x9'))[_0x2fad('0xa')](_0x2fad('0xb')),moment()[_0x2fad('0xa')](_0x2fad('0xb'))]}},'raw':![]},'log':_0x2fad('0xc')});};};exports[_0x2fad('0xd')]=function(_0x18f1c1){return function(){return client[_0x2fad('0x4')](_0x2fad('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x2fad('0xf')](_0x2fad('0x10'))[_0x2fad('0xa')](_0x2fad('0xb')),moment()[_0x2fad('0x11')]('day')[_0x2fad('0xa')](_0x2fad('0xb'))]},'campaigntype':_0x2fad('0x3')},'raw':![]},'log':_0x2fad('0xe')});};};exports['getCampaignHopperHistory']=function(_0x3b7a8a){return function(){return client['Request'](_0x2fad('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x2fad('0xf')](_0x2fad('0x10'))[_0x2fad('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x2fad('0x11')](_0x2fad('0x10'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x2fad('0x13')},'raw':![]},'log':_0x2fad('0x12')});};};
\ No newline at end of file
+var _0x3e40=['AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','queue','ivr','../client','moment','createHistory','campaign','Request','CreateCmHopperHistory'];(function(_0x2be057,_0x537541){var _0x19044f=function(_0x57a390){while(--_0x57a390){_0x2be057['push'](_0x2be057['shift']());}};_0x19044f(++_0x537541);}(_0x3e40,0x92));var _0x03e4=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x3e40[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x03e4('0x0'));var moment=require(_0x03e4('0x1'));exports[_0x03e4('0x2')]=function(_0x26f99e){return function(){_0x26f99e[_0x03e4('0x3')]=_0x26f99e['queue'];return client[_0x03e4('0x4')](_0x03e4('0x5'),{'body':_0x26f99e,'log':'CreateCmHopperHistory'});};};exports['avgHandleTime']=function(_0x5ae415){return function(){return client['Request'](_0x03e4('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0x03e4('0x7')](_0x5ae415,_0x03e4('0x8'))[_0x03e4('0x9')](_0x03e4('0xa')),moment()[_0x03e4('0x9')](_0x03e4('0xa'))]}},'raw':![]},'log':_0x03e4('0xb')});};};exports[_0x03e4('0xc')]=function(_0x4c2ed8){return function(){return client[_0x03e4('0x4')](_0x03e4('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x03e4('0xe')](_0x03e4('0xf'))[_0x03e4('0x9')](_0x03e4('0xa')),moment()[_0x03e4('0x10')](_0x03e4('0xf'))[_0x03e4('0x9')](_0x03e4('0xa'))]},'campaigntype':_0x03e4('0x11')},'raw':![]},'log':_0x03e4('0xd')});};};exports['getCampaignHopperHistory']=function(_0x1de7cd){return function(){return client[_0x03e4('0x4')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x03e4('0xe')](_0x03e4('0xf'))[_0x03e4('0x9')](_0x03e4('0xa')),moment()[_0x03e4('0x10')](_0x03e4('0xf'))[_0x03e4('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x03e4('0x12')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 20f90b3..74a8c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c9=['../client','getFaxAccounts','Request','GetFaxAccount','ecm','headerinfo','modem','gateway','faxdetect','t38timeout','TrunkId','key','Trunk','name','callerid','active','NotifyFaxAccount'];(function(_0x5dd7b9,_0x89fa54){var _0x47084f=function(_0x57078a){while(--_0x57078a){_0x5dd7b9['push'](_0x5dd7b9['shift']());}};_0x47084f(++_0x89fa54);}(_0xa5c9,0x143));var _0x9a5c=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xa5c9[_0x513545];return _0x18b7c5;};'use strict';var client=require(_0x9a5c('0x0'));exports[_0x9a5c('0x1')]=function(){return function(){return client[_0x9a5c('0x2')](_0x9a5c('0x3'),{'options':{'raw':![],'attributes':['id','name','description',_0x9a5c('0x4'),_0x9a5c('0x5'),'localstationid','minrate','maxrate',_0x9a5c('0x6'),_0x9a5c('0x7'),_0x9a5c('0x8'),_0x9a5c('0x9'),'tech',_0x9a5c('0xa'),'ListId',_0x9a5c('0xb')],'include':[{'model':_0x9a5c('0xc'),'as':'Trunk','attributes':['id',_0x9a5c('0xd'),_0x9a5c('0xe'),_0x9a5c('0xf')]}]},'log':'getFaxAccount'});};};exports['notify']=function(_0x2530fb,_0x7af197){return client[_0x9a5c('0x2')](_0x9a5c('0x10'),{'account':{'id':_0x2530fb},'body':_0x7af197,'log':_0x9a5c('0x10')});};
\ No newline at end of file
+var _0xb10b=['localstationid','minrate','maxrate','modem','faxdetect','t38timeout','TrunkId','ListId','key','Trunk','callerid','active','NotifyFaxAccount','../client','Request','GetFaxAccount','name','ecm','headerinfo'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xb10b,0x12a));var _0xbb10=function(_0x23f845,_0x34b4f5){_0x23f845=_0x23f845-0x0;var _0x4cd3e5=_0xb10b[_0x23f845];return _0x4cd3e5;};'use strict';var client=require(_0xbb10('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0xbb10('0x1')](_0xbb10('0x2'),{'options':{'raw':![],'attributes':['id',_0xbb10('0x3'),'description',_0xbb10('0x4'),_0xbb10('0x5'),_0xbb10('0x6'),_0xbb10('0x7'),_0xbb10('0x8'),_0xbb10('0x9'),'gateway',_0xbb10('0xa'),_0xbb10('0xb'),'tech',_0xbb10('0xc'),_0xbb10('0xd'),_0xbb10('0xe')],'include':[{'model':_0xbb10('0xf'),'as':_0xbb10('0xf'),'attributes':['id',_0xbb10('0x3'),_0xbb10('0x10'),_0xbb10('0x11')]}]},'log':'getFaxAccount'});};};exports['notify']=function(_0x20bd61,_0x118a74){return client[_0xbb10('0x1')]('NotifyFaxAccount',{'account':{'id':_0x20bd61},'body':_0x118a74,'log':_0xbb10('0x12')});};
\ No newline at end of file
index 8663618..d646715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0212=['update','UpdateFaxMessage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0212,0x19e));var _0x2021=function(_0x5b065d,_0x14a46a){_0x5b065d=_0x5b065d-0x0;var _0x439e8a=_0x0212[_0x5b065d];return _0x439e8a;};'use strict';var client=require('../client');exports[_0x2021('0x0')]=function(_0x1ae644,_0x347903){return client['Request'](_0x2021('0x1'),{'body':_0x347903,'options':{'where':{'AttachmentId':_0x1ae644}},'log':_0x2021('0x1')});};
\ No newline at end of file
+var _0x3418=['Request','UpdateFaxMessage','../client'];(function(_0x2a93d1,_0x2fc8bc){var _0x4f5a3e=function(_0x5e8bb1){while(--_0x5e8bb1){_0x2a93d1['push'](_0x2a93d1['shift']());}};_0x4f5a3e(++_0x2fc8bc);}(_0x3418,0x1e5));var _0x8341=function(_0x46d0ec,_0x276eb7){_0x46d0ec=_0x46d0ec-0x0;var _0x38204a=_0x3418[_0x46d0ec];return _0x38204a;};'use strict';var client=require(_0x8341('0x0'));exports['update']=function(_0xa8ad75,_0x13968c){return client[_0x8341('0x1')](_0x8341('0x2'),{'body':_0x13968c,'options':{'where':{'AttachmentId':_0xa8ad75}},'log':_0x8341('0x2')});};
\ No newline at end of file
index 84b3e49..babb272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0c7=['Variable','key','keyContent','nameField','customField','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','description','password','remoteUri','authType','serverUrl','DeskConfiguration','DeskField','Subjects','type','content','variableName'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0xc0c7,0xc0));var _0x7c0c=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xc0c7[_0x4bb66f];return _0xf2772f;};'use strict';var client=require(_0x7c0c('0x0'));exports[_0x7c0c('0x1')]=function(){return function(_0x4f4dd9){return client[_0x7c0c('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x7c0c('0x3'),_0x7c0c('0x4'),'username',_0x7c0c('0x5'),_0x7c0c('0x6'),_0x7c0c('0x7'),'type',_0x7c0c('0x8')],'include':[{'model':_0x7c0c('0x9'),'as':'Configurations','attributes':['id',_0x7c0c('0x3')],'include':[{'model':_0x7c0c('0xa'),'as':_0x7c0c('0xb'),'attributes':['id',_0x7c0c('0xc'),_0x7c0c('0xd'),_0x7c0c('0xe')],'include':[{'model':_0x7c0c('0xf'),'as':_0x7c0c('0xf'),'attributes':['id',_0x7c0c('0x3')]}]},{'model':_0x7c0c('0xa'),'as':'Descriptions','attributes':['id',_0x7c0c('0xc'),_0x7c0c('0xd'),_0x7c0c('0x10'),'keyType',_0x7c0c('0x11'),'variableName'],'include':[{'model':_0x7c0c('0xf'),'as':_0x7c0c('0xf'),'attributes':['id',_0x7c0c('0x3')]}]},{'model':'DeskField','as':'Fields','attributes':['id',_0x7c0c('0xc'),'content','idField',_0x7c0c('0x12'),_0x7c0c('0x13'),_0x7c0c('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x7c0c('0x3')]}]},{'model':_0x7c0c('0x14'),'as':_0x7c0c('0x15'),'attributes':['id','name']}]}]},'log':_0x7c0c('0x16')});};};
\ No newline at end of file
+var _0x7b75=['DeskField','Fields','content','idField','nameField','customField','Tag','Tags','getDeskAccounts','Request','GetDeskAccount','name','description','username','remoteUri','authType','type','serverUrl','Configurations','variableName','Variable','Descriptions','key','keyType'];(function(_0x1ba263,_0xba8863){var _0x521040=function(_0x5346dd){while(--_0x5346dd){_0x1ba263['push'](_0x1ba263['shift']());}};_0x521040(++_0xba8863);}(_0x7b75,0x158));var _0x57b7=function(_0x25acde,_0xc1ef6f){_0x25acde=_0x25acde-0x0;var _0xd949a5=_0x7b75[_0x25acde];return _0xd949a5;};'use strict';var client=require('../../client');exports[_0x57b7('0x0')]=function(){return function(_0x5d4780){return client[_0x57b7('0x1')](_0x57b7('0x2'),{'options':{'raw':![],'attributes':['id',_0x57b7('0x3'),_0x57b7('0x4'),_0x57b7('0x5'),'password',_0x57b7('0x6'),_0x57b7('0x7'),_0x57b7('0x8'),_0x57b7('0x9')],'include':[{'model':'DeskConfiguration','as':_0x57b7('0xa'),'attributes':['id','name'],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x57b7('0x8'),'content',_0x57b7('0xb')],'include':[{'model':_0x57b7('0xc'),'as':'Variable','attributes':['id',_0x57b7('0x3')]}]},{'model':'DeskField','as':_0x57b7('0xd'),'attributes':['id',_0x57b7('0x8'),'content',_0x57b7('0xe'),_0x57b7('0xf'),'keyContent',_0x57b7('0xb')],'include':[{'model':_0x57b7('0xc'),'as':_0x57b7('0xc'),'attributes':['id',_0x57b7('0x3')]}]},{'model':_0x57b7('0x10'),'as':_0x57b7('0x11'),'attributes':['id',_0x57b7('0x8'),_0x57b7('0x12'),_0x57b7('0x13'),_0x57b7('0x14'),_0x57b7('0x15'),'variableName'],'include':[{'model':_0x57b7('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':_0x57b7('0x16'),'as':_0x57b7('0x17'),'attributes':['id',_0x57b7('0x3')]}]}]},'log':_0x57b7('0x2')});};};
\ No newline at end of file
index f0f0b24..f64232c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d27=['Variable','Dynamics365Field','Descriptions','key','keyType','keyContent','variableName','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret','description','Configurations','ticketType','Subjects','type','content'];(function(_0x422e13,_0x3829ef){var _0x4e0b50=function(_0x4d8f76){while(--_0x4d8f76){_0x422e13['push'](_0x422e13['shift']());}};_0x4e0b50(++_0x3829ef);}(_0x2d27,0xf9));var _0x72d2=function(_0x3ef5bb,_0x27e3ac){_0x3ef5bb=_0x3ef5bb-0x0;var _0x59d620=_0x2d27[_0x3ef5bb];return _0x59d620;};'use strict';var client=require('../../client');exports['getDynamics365Accounts']=function(){return function(_0x3d458c){return client[_0x72d2('0x0')](_0x72d2('0x1'),{'options':{'raw':![],'attributes':['id',_0x72d2('0x2'),_0x72d2('0x3'),_0x72d2('0x4'),_0x72d2('0x5'),_0x72d2('0x6'),_0x72d2('0x7'),_0x72d2('0x8'),'serverUrl',_0x72d2('0x9')],'include':[{'model':'Dynamics365Configuration','as':_0x72d2('0xa'),'attributes':['id',_0x72d2('0x2'),_0x72d2('0xb')],'include':[{'model':'Dynamics365Field','as':_0x72d2('0xc'),'attributes':['id',_0x72d2('0xd'),_0x72d2('0xe'),'variableName'],'include':[{'model':_0x72d2('0xf'),'as':_0x72d2('0xf'),'attributes':['id',_0x72d2('0x2')]}]},{'model':_0x72d2('0x10'),'as':_0x72d2('0x11'),'attributes':['id',_0x72d2('0xd'),'content',_0x72d2('0x12'),_0x72d2('0x13'),_0x72d2('0x14'),_0x72d2('0x15')],'include':[{'model':_0x72d2('0xf'),'as':_0x72d2('0xf'),'attributes':['id',_0x72d2('0x2')]}]},{'model':'Dynamics365Field','as':'Fields','attributes':['id',_0x72d2('0xd'),'content','idField','nameField','customField',_0x72d2('0x15')],'include':[{'model':'Variable','as':_0x72d2('0xf'),'attributes':['id',_0x72d2('0x2')]}]}]}]},'log':_0x72d2('0x1')});};};
\ No newline at end of file
+var _0xe368=['customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','password','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','Dynamics365Field','Subjects','type','variableName','Variable','Descriptions','content','keyType','keyContent','idField','nameField'];(function(_0x143a91,_0x235332){var _0x1906f5=function(_0xd27eeb){while(--_0xd27eeb){_0x143a91['push'](_0x143a91['shift']());}};_0x1906f5(++_0x235332);}(_0xe368,0x191));var _0x8e36=function(_0xf82a50,_0x26d0dc){_0xf82a50=_0xf82a50-0x0;var _0x334f7f=_0xe368[_0xf82a50];return _0x334f7f;};'use strict';var client=require(_0x8e36('0x0'));exports[_0x8e36('0x1')]=function(){return function(_0x57117b){return client[_0x8e36('0x2')](_0x8e36('0x3'),{'options':{'raw':![],'attributes':['id',_0x8e36('0x4'),'username',_0x8e36('0x5'),'remoteUri',_0x8e36('0x6'),_0x8e36('0x7'),_0x8e36('0x8'),_0x8e36('0x9'),_0x8e36('0xa')],'include':[{'model':_0x8e36('0xb'),'as':_0x8e36('0xc'),'attributes':['id',_0x8e36('0x4'),'ticketType'],'include':[{'model':_0x8e36('0xd'),'as':_0x8e36('0xe'),'attributes':['id',_0x8e36('0xf'),'content',_0x8e36('0x10')],'include':[{'model':_0x8e36('0x11'),'as':_0x8e36('0x11'),'attributes':['id',_0x8e36('0x4')]}]},{'model':_0x8e36('0xd'),'as':_0x8e36('0x12'),'attributes':['id',_0x8e36('0xf'),_0x8e36('0x13'),'key',_0x8e36('0x14'),_0x8e36('0x15'),_0x8e36('0x10')],'include':[{'model':_0x8e36('0x11'),'as':_0x8e36('0x11'),'attributes':['id',_0x8e36('0x4')]}]},{'model':_0x8e36('0xd'),'as':'Fields','attributes':['id',_0x8e36('0xf'),_0x8e36('0x13'),_0x8e36('0x16'),_0x8e36('0x17'),_0x8e36('0x18'),_0x8e36('0x10')],'include':[{'model':_0x8e36('0x11'),'as':_0x8e36('0x11'),'attributes':['id',_0x8e36('0x4')]}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index 1367f5e..b4190a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa28=['FreshdeskConfiguration','FreshdeskField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','Fields','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','serverUrl'];(function(_0x3c6743,_0x544a90){var _0x1e2b85=function(_0x7a5553){while(--_0x7a5553){_0x3c6743['push'](_0x3c6743['shift']());}};_0x1e2b85(++_0x544a90);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xfa28[_0x4d8a8f];return _0xfc4adc;};'use strict';var client=require(_0x8fa2('0x0'));exports[_0x8fa2('0x1')]=function(){return function(_0x43c77b){return client[_0x8fa2('0x2')](_0x8fa2('0x3'),{'options':{'raw':![],'attributes':['id',_0x8fa2('0x4'),_0x8fa2('0x5'),_0x8fa2('0x6'),'remoteUri',_0x8fa2('0x7')],'include':[{'model':_0x8fa2('0x8'),'as':'Configurations','attributes':['id','name'],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0x8fa2('0x9'),'as':_0x8fa2('0xa'),'attributes':['id',_0x8fa2('0xb'),_0x8fa2('0xc'),'variableName'],'include':[{'model':_0x8fa2('0xd'),'as':_0x8fa2('0xd'),'attributes':['id',_0x8fa2('0x4')]}]},{'model':_0x8fa2('0x9'),'as':_0x8fa2('0xe'),'attributes':['id','type','content',_0x8fa2('0xf'),_0x8fa2('0x10'),_0x8fa2('0x11'),_0x8fa2('0x12')],'include':[{'model':_0x8fa2('0xd'),'as':_0x8fa2('0xd'),'attributes':['id','name']}]},{'model':_0x8fa2('0x9'),'as':_0x8fa2('0x13'),'attributes':['id',_0x8fa2('0xb'),_0x8fa2('0xc'),'idField',_0x8fa2('0x14'),'customField',_0x8fa2('0x12')],'include':[{'model':_0x8fa2('0xd'),'as':_0x8fa2('0xd'),'attributes':['id','name']}]}]}]},'log':_0x8fa2('0x3')});};};
\ No newline at end of file
+var _0x0bb5=['GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','FreshdeskField','Subjects','type','Variable','content','key','keyType','keyContent','variableName','Fields','nameField','customField','../../client','getFreshdeskAccounts'];(function(_0x4e1a73,_0x44bafb){var _0x3ea913=function(_0x4bd1c6){while(--_0x4bd1c6){_0x4e1a73['push'](_0x4e1a73['shift']());}};_0x3ea913(++_0x44bafb);}(_0x0bb5,0x148));var _0x50bb=function(_0x5869e4,_0x5ad51d){_0x5869e4=_0x5869e4-0x0;var _0x1bd3a2=_0x0bb5[_0x5869e4];return _0x1bd3a2;};'use strict';var client=require(_0x50bb('0x0'));exports[_0x50bb('0x1')]=function(){return function(_0x5e61cf){return client['Request'](_0x50bb('0x2'),{'options':{'raw':![],'attributes':['id',_0x50bb('0x3'),_0x50bb('0x4'),_0x50bb('0x5'),_0x50bb('0x6'),_0x50bb('0x7')],'include':[{'model':_0x50bb('0x8'),'as':_0x50bb('0x9'),'attributes':['id','name'],'include':[{'model':'Tag','attributes':['id',_0x50bb('0x3')]},{'model':_0x50bb('0xa'),'as':_0x50bb('0xb'),'attributes':['id',_0x50bb('0xc'),'content','variableName'],'include':[{'model':_0x50bb('0xd'),'as':_0x50bb('0xd'),'attributes':['id',_0x50bb('0x3')]}]},{'model':_0x50bb('0xa'),'as':'Descriptions','attributes':['id',_0x50bb('0xc'),_0x50bb('0xe'),_0x50bb('0xf'),_0x50bb('0x10'),_0x50bb('0x11'),_0x50bb('0x12')],'include':[{'model':_0x50bb('0xd'),'as':'Variable','attributes':['id',_0x50bb('0x3')]}]},{'model':'FreshdeskField','as':_0x50bb('0x13'),'attributes':['id',_0x50bb('0xc'),_0x50bb('0xe'),'idField',_0x50bb('0x14'),_0x50bb('0x15'),_0x50bb('0x12')],'include':[{'model':'Variable','as':_0x50bb('0xd'),'attributes':['id','name']}]}]}]},'log':_0x50bb('0x2')});};};
\ No newline at end of file
index 40aa235..7d0cb41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9206=['name','remoteUri','serverUrl','Subjects','type','content','variableName','FreshsalesField','Descriptions','key','keyType','keyContent','Variable','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9206,0x176));var _0x6920=function(_0x57b94a,_0x2d1e85){_0x57b94a=_0x57b94a-0x0;var _0x7e4ef8=_0x9206[_0x57b94a];return _0x7e4ef8;};'use strict';var client=require(_0x6920('0x0'));exports[_0x6920('0x1')]=function(){return function(_0x3896bc){return client[_0x6920('0x2')](_0x6920('0x3'),{'options':{'raw':![],'attributes':['id',_0x6920('0x4'),'username','apiKey',_0x6920('0x5'),_0x6920('0x6')],'include':[{'model':'FreshsalesConfiguration','as':'Configurations','attributes':['id',_0x6920('0x4')],'include':[{'model':'FreshsalesField','as':_0x6920('0x7'),'attributes':['id',_0x6920('0x8'),_0x6920('0x9'),_0x6920('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x6920('0x4')]}]},{'model':_0x6920('0xb'),'as':_0x6920('0xc'),'attributes':['id',_0x6920('0x8'),_0x6920('0x9'),_0x6920('0xd'),_0x6920('0xe'),_0x6920('0xf'),_0x6920('0xa')],'include':[{'model':_0x6920('0x10'),'as':_0x6920('0x10'),'attributes':['id',_0x6920('0x4')]}]}]}]},'log':_0x6920('0x11')});};};
\ No newline at end of file
+var _0x9fd4=['key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','Configurations','FreshsalesField','Subjects','content','variableName','Variable','Descriptions','type'];(function(_0x4dc00b,_0x229642){var _0x38a107=function(_0x231d7f){while(--_0x231d7f){_0x4dc00b['push'](_0x4dc00b['shift']());}};_0x38a107(++_0x229642);}(_0x9fd4,0x16c));var _0x49fd=function(_0x5cdf3c,_0x233f63){_0x5cdf3c=_0x5cdf3c-0x0;var _0x515b20=_0x9fd4[_0x5cdf3c];return _0x515b20;};'use strict';var client=require(_0x49fd('0x0'));exports[_0x49fd('0x1')]=function(){return function(_0x29d5af){return client[_0x49fd('0x2')](_0x49fd('0x3'),{'options':{'raw':![],'attributes':['id',_0x49fd('0x4'),_0x49fd('0x5'),_0x49fd('0x6'),_0x49fd('0x7'),'serverUrl'],'include':[{'model':'FreshsalesConfiguration','as':_0x49fd('0x8'),'attributes':['id',_0x49fd('0x4')],'include':[{'model':_0x49fd('0x9'),'as':_0x49fd('0xa'),'attributes':['id','type',_0x49fd('0xb'),_0x49fd('0xc')],'include':[{'model':_0x49fd('0xd'),'as':_0x49fd('0xd'),'attributes':['id',_0x49fd('0x4')]}]},{'model':'FreshsalesField','as':_0x49fd('0xe'),'attributes':['id',_0x49fd('0xf'),_0x49fd('0xb'),_0x49fd('0x10'),_0x49fd('0x11'),_0x49fd('0x12'),_0x49fd('0xc')],'include':[{'model':'Variable','as':_0x49fd('0xd'),'attributes':['id',_0x49fd('0x4')]}]}]}]},'log':_0x49fd('0x13')});};};
\ No newline at end of file
index ef1602f..69baaaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x641b=['Subjects','Variable','../../client','Request','GetSalesforceAccount','name','password','remoteUri','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x641b,0xca));var _0xb641=function(_0xce3cd6,_0x638ba0){_0xce3cd6=_0xce3cd6-0x0;var _0x160ea2=_0x641b[_0xce3cd6];return _0x160ea2;};'use strict';var client=require(_0xb641('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x2d9aa3){return client[_0xb641('0x1')](_0xb641('0x2'),{'options':{'raw':![],'attributes':['id',_0xb641('0x3'),'username',_0xb641('0x4'),_0xb641('0x5'),'clientId','clientSecret',_0xb641('0x6'),_0xb641('0x7'),_0xb641('0x8')],'include':[{'model':_0xb641('0x9'),'as':_0xb641('0xa'),'attributes':['id',_0xb641('0x3'),_0xb641('0xb'),_0xb641('0xc'),'ticketType',_0xb641('0xd'),_0xb641('0xe'),_0xb641('0xf'),_0xb641('0x10')],'include':[{'model':_0xb641('0x11'),'as':_0xb641('0x12'),'include':[{'model':_0xb641('0x13'),'as':_0xb641('0x13'),'attributes':['id',_0xb641('0x3')]}]},{'model':'SalesforceField','as':'Descriptions','include':[{'model':_0xb641('0x13'),'as':_0xb641('0x13'),'attributes':['id','name']}]},{'model':_0xb641('0x11'),'as':'Fields','include':[{'model':_0xb641('0x13'),'as':_0xb641('0x13'),'attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x66d4=['clientSecret','serverUrl','type','SalesforceConfiguration','Configurations','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password'];(function(_0x295849,_0x42b3eb){var _0x27d8d4=function(_0x375ae0){while(--_0x375ae0){_0x295849['push'](_0x295849['shift']());}};_0x27d8d4(++_0x42b3eb);}(_0x66d4,0x10b));var _0x466d=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x66d4[_0x378720];return _0x47920a;};'use strict';var client=require('../../client');exports[_0x466d('0x0')]=function(){return function(_0x4f9a95){return client[_0x466d('0x1')](_0x466d('0x2'),{'options':{'raw':![],'attributes':['id',_0x466d('0x3'),_0x466d('0x4'),_0x466d('0x5'),'remoteUri','clientId',_0x466d('0x6'),'securityToken',_0x466d('0x7'),_0x466d('0x8')],'include':[{'model':_0x466d('0x9'),'as':_0x466d('0xa'),'attributes':['id','name','moduleSearch',_0x466d('0xb'),_0x466d('0xc'),_0x466d('0xd'),_0x466d('0xe'),'additionalSearchContact',_0x466d('0xf')],'include':[{'model':_0x466d('0x10'),'as':_0x466d('0x11'),'include':[{'model':_0x466d('0x12'),'as':_0x466d('0x12'),'attributes':['id',_0x466d('0x3')]}]},{'model':_0x466d('0x10'),'as':_0x466d('0x13'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x466d('0x3')]}]},{'model':_0x466d('0x10'),'as':_0x466d('0x14'),'include':[{'model':_0x466d('0x12'),'as':_0x466d('0x12'),'attributes':['id',_0x466d('0x3')]}]}]}]},'log':_0x466d('0x2')});};};
\ No newline at end of file
index 486dfab..4dc70ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['variableName','GetServicenowkAccount','../../client','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','ServicenowField','Subjects','type','Variable','Descriptions','key','keyContent','content','idField','nameField'];(function(_0xc6b011,_0x5d1f19){var _0x420171=function(_0x433751){while(--_0x433751){_0xc6b011['push'](_0xc6b011['shift']());}};_0x420171(++_0x5d1f19);}(_0x326f,0xd1));var _0xf326=function(_0x149815,_0xff3b0e){_0x149815=_0x149815-0x0;var _0x4da803=_0x326f[_0x149815];return _0x4da803;};'use strict';var client=require(_0xf326('0x0'));exports['getServicenowAccounts']=function(){return function(_0x5452cc){return client[_0xf326('0x1')](_0xf326('0x2'),{'options':{'raw':![],'attributes':['id',_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9')],'include':[{'model':_0xf326('0xa'),'as':'Configurations','attributes':['id',_0xf326('0x3')],'include':[{'model':_0xf326('0xb'),'as':_0xf326('0xc'),'attributes':['id',_0xf326('0xd'),'content','variableName'],'include':[{'model':'Variable','as':_0xf326('0xe'),'attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':_0xf326('0xf'),'attributes':['id',_0xf326('0xd'),'content',_0xf326('0x10'),'keyType',_0xf326('0x11'),'variableName'],'include':[{'model':_0xf326('0xe'),'as':'Variable','attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':'Fields','attributes':['id',_0xf326('0xd'),_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x14'),'customField',_0xf326('0x15')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf326('0x3')]}]}]}]},'log':_0xf326('0x16')});};};
\ No newline at end of file
+var _0x1261=['content','variableName','Variable','ServicenowField','Descriptions','keyContent','Fields','idField','nameField','getServicenowAccounts','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','Configurations','Subjects','type'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1261,0x144));var _0x1126=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x1261[_0x1de43c];return _0x296d3e;};'use strict';var client=require('../../client');exports[_0x1126('0x0')]=function(){return function(_0x26c6a0){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),'serverUrl'],'include':[{'model':'ServicenowConfiguration','as':_0x1126('0x9'),'attributes':['id',_0x1126('0x3')],'include':[{'model':'ServicenowField','as':_0x1126('0xa'),'attributes':['id',_0x1126('0xb'),_0x1126('0xc'),_0x1126('0xd')],'include':[{'model':_0x1126('0xe'),'as':'Variable','attributes':['id',_0x1126('0x3')]}]},{'model':_0x1126('0xf'),'as':_0x1126('0x10'),'attributes':['id','type',_0x1126('0xc'),'key','keyType',_0x1126('0x11'),'variableName'],'include':[{'model':_0x1126('0xe'),'as':_0x1126('0xe'),'attributes':['id',_0x1126('0x3')]}]},{'model':_0x1126('0xf'),'as':_0x1126('0x12'),'attributes':['id',_0x1126('0xb'),_0x1126('0xc'),_0x1126('0x13'),_0x1126('0x14'),'customField','variableName'],'include':[{'model':_0x1126('0xe'),'as':_0x1126('0xe'),'attributes':['id',_0x1126('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 4f81a15..710e066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xda2d,0x102));var _0xdda2=function(_0x49e1ca,_0x4bd3d2){_0x49e1ca=_0x49e1ca-0x0;var _0x5888a9=_0xda2d[_0x49e1ca];return _0x5888a9;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0x1967=['serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','remoteUri'];(function(_0xc5fae,_0x5237ef){var _0x227438=function(_0x4c9658){while(--_0x4c9658){_0xc5fae['push'](_0xc5fae['shift']());}};_0x227438(++_0x5237ef);}(_0x1967,0x173));var _0x7196=function(_0x51c52b,_0x4e54d4){_0x51c52b=_0x51c52b-0x0;var _0x3c5970=_0x1967[_0x51c52b];return _0x3c5970;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7')],'include':[{'model':_0x7196('0x8'),'as':'Configurations','attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd')],'include':[{'model':'Variable','as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0xb'),'content','key',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0x12'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0x13'),'nameField',_0x7196('0x14'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x2')});};};
\ No newline at end of file
index 79e9a61..3ac9418 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafea=['key','keyContent','variableName','Fields','idField','customField','../../client','getVtigerAccounts','GetVtigerAccount','name','description','accessKey','serverUrl','VtigerConfiguration','Configurations','VtigerField','content','Variable','Descriptions','type'];(function(_0x15518e,_0x451b3a){var _0x894f4c=function(_0x113d6d){while(--_0x113d6d){_0x15518e['push'](_0x15518e['shift']());}};_0x894f4c(++_0x451b3a);}(_0xafea,0x6a));var _0xaafe=function(_0x3830ac,_0x5c8758){_0x3830ac=_0x3830ac-0x0;var _0x5999c9=_0xafea[_0x3830ac];return _0x5999c9;};'use strict';var client=require(_0xaafe('0x0'));exports[_0xaafe('0x1')]=function(){return function(_0x1fde91){return client['Request'](_0xaafe('0x2'),{'options':{'raw':![],'attributes':['id',_0xaafe('0x3'),_0xaafe('0x4'),'username',_0xaafe('0x5'),'remoteUri',_0xaafe('0x6')],'include':[{'model':_0xaafe('0x7'),'as':_0xaafe('0x8'),'attributes':['id',_0xaafe('0x3')],'include':[{'model':_0xaafe('0x9'),'as':'Subjects','attributes':['id','type',_0xaafe('0xa'),'variableName'],'include':[{'model':_0xaafe('0xb'),'as':_0xaafe('0xb'),'attributes':['id',_0xaafe('0x3')]}]},{'model':'VtigerField','as':_0xaafe('0xc'),'attributes':['id',_0xaafe('0xd'),_0xaafe('0xa'),_0xaafe('0xe'),'keyType',_0xaafe('0xf'),_0xaafe('0x10')],'include':[{'model':_0xaafe('0xb'),'as':_0xaafe('0xb'),'attributes':['id',_0xaafe('0x3')]}]},{'model':'VtigerField','as':_0xaafe('0x11'),'attributes':['id',_0xaafe('0xd'),_0xaafe('0xa'),_0xaafe('0x12'),'nameField',_0xaafe('0x13'),_0xaafe('0x10')],'include':[{'model':_0xaafe('0xb'),'as':_0xaafe('0xb'),'attributes':['id',_0xaafe('0x3')]}]}]}]},'log':_0xaafe('0x2')});};};
\ No newline at end of file
+var _0x21a6=['variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','GetVtigerAccount','../../client','getVtigerAccounts','Request','name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content'];(function(_0x2cf734,_0x1cfeac){var _0x2be1b5=function(_0x51bf83){while(--_0x51bf83){_0x2cf734['push'](_0x2cf734['shift']());}};_0x2be1b5(++_0x1cfeac);}(_0x21a6,0x1e9));var _0x621a=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x21a6[_0x14a0a0];return _0x56b651;};'use strict';var client=require(_0x621a('0x0'));exports[_0x621a('0x1')]=function(){return function(_0x34000f){return client[_0x621a('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x621a('0x3'),_0x621a('0x4'),_0x621a('0x5'),_0x621a('0x6'),_0x621a('0x7'),_0x621a('0x8')],'include':[{'model':_0x621a('0x9'),'as':_0x621a('0xa'),'attributes':['id',_0x621a('0x3')],'include':[{'model':_0x621a('0xb'),'as':_0x621a('0xc'),'attributes':['id',_0x621a('0xd'),_0x621a('0xe'),_0x621a('0xf')],'include':[{'model':'Variable','as':_0x621a('0x10'),'attributes':['id',_0x621a('0x3')]}]},{'model':'VtigerField','as':_0x621a('0x11'),'attributes':['id',_0x621a('0xd'),_0x621a('0xe'),_0x621a('0x12'),_0x621a('0x13'),_0x621a('0x14'),_0x621a('0xf')],'include':[{'model':_0x621a('0x10'),'as':_0x621a('0x10'),'attributes':['id',_0x621a('0x3')]}]},{'model':_0x621a('0xb'),'as':_0x621a('0x15'),'attributes':['id',_0x621a('0xd'),'content',_0x621a('0x16'),'nameField','customField','variableName'],'include':[{'model':_0x621a('0x10'),'as':'Variable','attributes':['id',_0x621a('0x3')]}]}]}]},'log':_0x621a('0x17')});};};
\ No newline at end of file
index 855b197..62d1c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd60=['Request','name','username','password','token','remoteUri','authType','serverUrl','type','Tag','content','variableName','Variable','Descriptions','key','keyType','keyContent','ZendeskField','Fields','idField','nameField','customField','GetZendeskAccount','../../client'];(function(_0x52bfa5,_0x42cf21){var _0x26f80b=function(_0x73c5b0){while(--_0x73c5b0){_0x52bfa5['push'](_0x52bfa5['shift']());}};_0x26f80b(++_0x42cf21);}(_0xcd60,0x11f));var _0x0cd6=function(_0x1818e8,_0x3bb930){_0x1818e8=_0x1818e8-0x0;var _0x4ef865=_0xcd60[_0x1818e8];return _0x4ef865;};'use strict';var client=require(_0x0cd6('0x0'));exports['getZendeskAccounts']=function(){return function(_0x34774f){return client[_0x0cd6('0x1')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x0cd6('0x2'),_0x0cd6('0x3'),_0x0cd6('0x4'),_0x0cd6('0x5'),_0x0cd6('0x6'),_0x0cd6('0x7'),_0x0cd6('0x8'),_0x0cd6('0x9')],'include':[{'model':'ZendeskConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':_0x0cd6('0xa'),'attributes':['id',_0x0cd6('0x2')]},{'model':'ZendeskField','as':'Subjects','attributes':['id',_0x0cd6('0x9'),_0x0cd6('0xb'),_0x0cd6('0xc')],'include':[{'model':_0x0cd6('0xd'),'as':_0x0cd6('0xd'),'attributes':['id',_0x0cd6('0x2')]}]},{'model':'ZendeskField','as':_0x0cd6('0xe'),'attributes':['id',_0x0cd6('0x9'),_0x0cd6('0xb'),_0x0cd6('0xf'),_0x0cd6('0x10'),_0x0cd6('0x11'),_0x0cd6('0xc')],'include':[{'model':_0x0cd6('0xd'),'as':_0x0cd6('0xd'),'attributes':['id',_0x0cd6('0x2')]}]},{'model':_0x0cd6('0x12'),'as':_0x0cd6('0x13'),'attributes':['id',_0x0cd6('0x9'),_0x0cd6('0xb'),_0x0cd6('0x14'),_0x0cd6('0x15'),_0x0cd6('0x16'),'variableName'],'include':[{'model':'Variable','as':_0x0cd6('0xd'),'attributes':['id',_0x0cd6('0x2')]}]}]}]},'log':_0x0cd6('0x17')});};};
\ No newline at end of file
+var _0x5ea6=['Tag','name','ZendeskField','content','variableName','Variable','Descriptions','key','keyType','Fields','idField','nameField','customField','GetZendeskAccount','username','password','token','remoteUri','authType','type','ZendeskConfiguration'];(function(_0x2188e8,_0x7c4913){var _0x14902a=function(_0x2f612f){while(--_0x2f612f){_0x2188e8['push'](_0x2188e8['shift']());}};_0x14902a(++_0x7c4913);}(_0x5ea6,0x1b1));var _0x65ea=function(_0x210acd,_0x5617de){_0x210acd=_0x210acd-0x0;var _0x9ae98a=_0x5ea6[_0x210acd];return _0x9ae98a;};'use strict';var client=require('../../client');exports['getZendeskAccounts']=function(){return function(_0x131140){return client['Request'](_0x65ea('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x65ea('0x1'),_0x65ea('0x2'),_0x65ea('0x3'),_0x65ea('0x4'),_0x65ea('0x5'),'serverUrl',_0x65ea('0x6')],'include':[{'model':_0x65ea('0x7'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x65ea('0x8'),'attributes':['id',_0x65ea('0x9')]},{'model':_0x65ea('0xa'),'as':'Subjects','attributes':['id','type',_0x65ea('0xb'),_0x65ea('0xc')],'include':[{'model':'Variable','as':_0x65ea('0xd'),'attributes':['id','name']}]},{'model':_0x65ea('0xa'),'as':_0x65ea('0xe'),'attributes':['id',_0x65ea('0x6'),'content',_0x65ea('0xf'),_0x65ea('0x10'),'keyContent',_0x65ea('0xc')],'include':[{'model':_0x65ea('0xd'),'as':_0x65ea('0xd'),'attributes':['id',_0x65ea('0x9')]}]},{'model':_0x65ea('0xa'),'as':_0x65ea('0x11'),'attributes':['id',_0x65ea('0x6'),_0x65ea('0xb'),_0x65ea('0x12'),_0x65ea('0x13'),_0x65ea('0x14'),_0x65ea('0xc')],'include':[{'model':_0x65ea('0xd'),'as':_0x65ea('0xd'),'attributes':['id',_0x65ea('0x9')]}]}]}]},'log':_0x65ea('0x0')});};};
\ No newline at end of file
index 3b53be2..1d36ffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0004=['variableName','Variable','Descriptions','key','keyType','content','idField','nameField','customField','GetZohoAccount','getZohoAccounts','Request','name','description','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','ZohoField','type'];(function(_0x3f88d5,_0x32bdd1){var _0x463735=function(_0x247910){while(--_0x247910){_0x3f88d5['push'](_0x3f88d5['shift']());}};_0x463735(++_0x32bdd1);}(_0x0004,0x181));var _0x4000=function(_0x3d387a,_0x81c3ff){_0x3d387a=_0x3d387a-0x0;var _0xe3eebd=_0x0004[_0x3d387a];return _0xe3eebd;};'use strict';var client=require('../../client');exports[_0x4000('0x0')]=function(){return function(_0x35d386){return client[_0x4000('0x1')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0x4000('0x2'),_0x4000('0x3'),'host',_0x4000('0x4'),_0x4000('0x5'),_0x4000('0x6'),_0x4000('0x7'),_0x4000('0x8'),_0x4000('0x9')],'include':[{'model':_0x4000('0xa'),'as':_0x4000('0xb'),'attributes':['id',_0x4000('0x2'),_0x4000('0xc'),'moduleSearch','description'],'include':[{'model':_0x4000('0xd'),'as':'Subjects','attributes':['id',_0x4000('0xe'),'content',_0x4000('0xf')],'include':[{'model':_0x4000('0x10'),'as':'Variable','attributes':['id',_0x4000('0x2')]}]},{'model':'ZohoField','as':_0x4000('0x11'),'attributes':['id','type','content',_0x4000('0x12'),_0x4000('0x13'),'keyContent','variableName'],'include':[{'model':_0x4000('0x10'),'as':_0x4000('0x10'),'attributes':['id',_0x4000('0x2')]}]},{'model':_0x4000('0xd'),'as':'Fields','attributes':['id',_0x4000('0xe'),_0x4000('0x14'),_0x4000('0x15'),_0x4000('0x16'),_0x4000('0x17'),_0x4000('0xf')],'include':[{'model':'Variable','as':_0x4000('0x10'),'attributes':['id',_0x4000('0x2')]}]}]}]},'log':_0x4000('0x18')});};};
\ No newline at end of file
+var _0x115e=['zone','clientSecret','serverUrl','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','GetZohoAccount','Request','name','description','host'];(function(_0x247583,_0x1c9c28){var _0x4af33e=function(_0x38cd0b){while(--_0x38cd0b){_0x247583['push'](_0x247583['shift']());}};_0x4af33e(++_0x1c9c28);}(_0x115e,0xf9));var _0xe115=function(_0x27036b,_0x1b8ec4){_0x27036b=_0x27036b-0x0;var _0x388eba=_0x115e[_0x27036b];return _0x388eba;};'use strict';var client=require('../../client');exports['getZohoAccounts']=function(){return function(_0x3f0b34){return client[_0xe115('0x0')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0xe115('0x1'),_0xe115('0x2'),_0xe115('0x3'),_0xe115('0x4'),'clientId',_0xe115('0x5'),_0xe115('0x6'),'code','refreshToken'],'include':[{'model':_0xe115('0x7'),'as':'Configurations','attributes':['id',_0xe115('0x1'),_0xe115('0x8'),_0xe115('0x9'),_0xe115('0x2')],'include':[{'model':_0xe115('0xa'),'as':'Subjects','attributes':['id',_0xe115('0xb'),_0xe115('0xc'),_0xe115('0xd')],'include':[{'model':_0xe115('0xe'),'as':'Variable','attributes':['id',_0xe115('0x1')]}]},{'model':_0xe115('0xa'),'as':_0xe115('0xf'),'attributes':['id','type','content',_0xe115('0x10'),'keyType',_0xe115('0x11'),_0xe115('0xd')],'include':[{'model':_0xe115('0xe'),'as':_0xe115('0xe'),'attributes':['id','name']}]},{'model':_0xe115('0xa'),'as':_0xe115('0x12'),'attributes':['id',_0xe115('0xb'),_0xe115('0xc'),_0xe115('0x13'),_0xe115('0x14'),_0xe115('0x15'),_0xe115('0xd')],'include':[{'model':_0xe115('0xe'),'as':_0xe115('0xe'),'attributes':['id','name']}]}]}]},'log':_0xe115('0x16')});};};
\ No newline at end of file
index e4d7485..ceae681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x019b=['queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','membername','endtime','starttime','dialstring','toNumber','uniqueid','moment','lodash'];(function(_0x337c61,_0x1847ff){var _0x3394a8=function(_0xd833d){while(--_0xd833d){_0x337c61['push'](_0x337c61['shift']());}};_0x3394a8(++_0x1847ff);}(_0x019b,0xa6));var _0xb019=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x019b[_0x1cd674];return _0x27928f;};'use strict';var moment=require(_0xb019('0x0'));var _=require(_0xb019('0x1'));var util=require('util');var client=require('../client');exports['voiceQueueReport']=function(_0x934296){var _0x2b19d8=_0x934296[_0xb019('0x2')]||_0x934296[_0xb019('0x3')];return client[_0xb019('0x4')](_0xb019('0x5'),{'body':{'channel':_0xb019('0x6'),'membername':_0x934296[_0xb019('0x7')],'interface':_[_0xb019('0x8')](_0x934296[_0xb019('0x9')])?util[_0xb019('0xa')](_0xb019('0xb'),_0x934296[_0xb019('0x7')]):_0x934296[_0xb019('0x9')],'type':_0xb019('0xc'),'enterAt':_0x934296[_0xb019('0xd')],'exitAt':_0x2b19d8,'duration':moment(_0x2b19d8)[_0xb019('0xe')](_0x934296[_0xb019('0xd')],_0xb019('0xf')),'data1':_0xb019('0x10'),'data2':_0x934296[_0xb019('0x11')],'data3':_0x934296[_0xb019('0x12')],'data4':null,'data5':_0x934296[_0xb019('0x13')],'role':_0xb019('0x14'),'internal':_0x934296[_0xb019('0x15')]?_['toNumber'](_0x934296[_0xb019('0x15')]):undefined,'uniqueid':_0x934296['uniqueid']},'log':_0xb019('0x5')});};exports['voiceDialReport']=function(_0x1ee369){return client[_0xb019('0x4')](_0xb019('0x5'),{'body':{'channel':_0xb019('0x6'),'membername':_0x1ee369[_0xb019('0x16')],'interface':_0x1ee369[_0xb019('0x9')],'type':_0xb019('0xc'),'enterAt':_0x1ee369['starttime'],'exitAt':_0x1ee369[_0xb019('0x17')],'duration':moment(_0x1ee369[_0xb019('0x17')])[_0xb019('0xe')](_0x1ee369[_0xb019('0x18')],_0xb019('0xf'))>=0x0?moment(_0x1ee369[_0xb019('0x17')])[_0xb019('0xe')](_0x1ee369[_0xb019('0x18')],_0xb019('0xf')):null,'data1':'outbound','data2':_0x1ee369[_0xb019('0x15')],'data3':_0x1ee369[_0xb019('0x12')],'data4':_0x1ee369[_0xb019('0x19')]||null,'role':'agent','internal':_0x1ee369[_0xb019('0x15')]?_[_0xb019('0x1a')](_0x1ee369[_0xb019('0x15')]):undefined,'uniqueid':_0x1ee369[_0xb019('0x1b')]},'log':_0xb019('0x5')});};
\ No newline at end of file
+var _0x53a3=['format','SIP/%s','queuecallerleaveAt','diff','inbound','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','TALKING','starttime','endtime','seconds','outbound','exten','dialstring','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface'];(function(_0x38d919,_0xba19ef){var _0x5751d5=function(_0x2e136b){while(--_0x2e136b){_0x38d919['push'](_0x38d919['shift']());}};_0x5751d5(++_0xba19ef);}(_0x53a3,0x116));var _0x353a=function(_0x3c7e26,_0x3cc265){_0x3c7e26=_0x3c7e26-0x0;var _0x530070=_0x53a3[_0x3c7e26];return _0x530070;};'use strict';var moment=require('moment');var _=require('lodash');var util=require('util');var client=require(_0x353a('0x0'));exports[_0x353a('0x1')]=function(_0x30ac49){var _0x3108a4=_0x30ac49['queuecallercompleteAt']||_0x30ac49[_0x353a('0x2')];return client[_0x353a('0x3')](_0x353a('0x4'),{'body':{'channel':_0x353a('0x5'),'membername':_0x30ac49[_0x353a('0x6')],'interface':_['isNil'](_0x30ac49[_0x353a('0x7')])?util[_0x353a('0x8')](_0x353a('0x9'),_0x30ac49[_0x353a('0x6')]):_0x30ac49['interface'],'type':'TALKING','enterAt':_0x30ac49[_0x353a('0xa')],'exitAt':_0x3108a4,'duration':moment(_0x3108a4)[_0x353a('0xb')](_0x30ac49[_0x353a('0xa')],'seconds'),'data1':_0x353a('0xc'),'data2':_0x30ac49['calleridnum'],'data3':_0x30ac49['exten'],'data4':null,'data5':_0x30ac49[_0x353a('0xd')],'role':_0x353a('0xe'),'internal':_0x30ac49[_0x353a('0xf')]?_[_0x353a('0x10')](_0x30ac49[_0x353a('0xf')]):undefined,'uniqueid':_0x30ac49[_0x353a('0x11')]},'log':_0x353a('0x4')});};exports[_0x353a('0x12')]=function(_0x516c1c){return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x516c1c['membername'],'interface':_0x516c1c[_0x353a('0x7')],'type':_0x353a('0x13'),'enterAt':_0x516c1c[_0x353a('0x14')],'exitAt':_0x516c1c[_0x353a('0x15')],'duration':moment(_0x516c1c[_0x353a('0x15')])[_0x353a('0xb')](_0x516c1c[_0x353a('0x14')],_0x353a('0x16'))>=0x0?moment(_0x516c1c[_0x353a('0x15')])[_0x353a('0xb')](_0x516c1c['starttime'],'seconds'):null,'data1':_0x353a('0x17'),'data2':_0x516c1c[_0x353a('0xf')],'data3':_0x516c1c[_0x353a('0x18')],'data4':_0x516c1c[_0x353a('0x19')]||null,'role':_0x353a('0xe'),'internal':_0x516c1c[_0x353a('0xf')]?_[_0x353a('0x10')](_0x516c1c[_0x353a('0xf')]):undefined,'uniqueid':_0x516c1c[_0x353a('0x11')]},'log':'CreateMemberReport'});};
\ No newline at end of file
index e87243f..d74c47b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cd2=['getSettings','Request','GetSettings','../client'];(function(_0x95cf3f,_0x25e260){var _0x305d5f=function(_0x59e82c){while(--_0x59e82c){_0x95cf3f['push'](_0x95cf3f['shift']());}};_0x305d5f(++_0x25e260);}(_0x6cd2,0x147));var _0x26cd=function(_0x3bbf6b,_0x1857f7){_0x3bbf6b=_0x3bbf6b-0x0;var _0x2813c6=_0x6cd2[_0x3bbf6b];return _0x2813c6;};'use strict';var client=require(_0x26cd('0x0'));exports[_0x26cd('0x1')]=function(){return client[_0x26cd('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x26cd('0x3')});};
\ No newline at end of file
+var _0x5bc5=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x5dd745,_0x445851){var _0x9ca0e0=function(_0x59c9e2){while(--_0x59c9e2){_0x5dd745['push'](_0x5dd745['shift']());}};_0x9ca0e0(++_0x445851);}(_0x5bc5,0xb2));var _0x55bc=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x5bc5[_0x575057];return _0x49dbc8;};'use strict';var client=require(_0x55bc('0x0'));exports[_0x55bc('0x1')]=function(){return client[_0x55bc('0x2')](_0x55bc('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x55bc('0x4')]},'log':_0x55bc('0x5')});};
\ No newline at end of file
index 8fab5a0..3120af0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeb5=['getTemplates','Request','GetTemplate','name'];(function(_0x5000e5,_0x1a2ed9){var _0x496c30=function(_0x789477){while(--_0x789477){_0x5000e5['push'](_0x5000e5['shift']());}};_0x496c30(++_0x1a2ed9);}(_0xbeb5,0x14c));var _0x5beb=function(_0x3ccc07,_0x542405){_0x3ccc07=_0x3ccc07-0x0;var _0x10f82b=_0xbeb5[_0x3ccc07];return _0x10f82b;};'use strict';var client=require('../client');exports[_0x5beb('0x0')]=function(_0x42b9d0){return function(_0x45585b){return client[_0x5beb('0x1')](_0x5beb('0x2'),{'options':{'raw':!![],'attributes':['id',_0x5beb('0x3'),'html']},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0x3c01=['html','../client','getTemplates','Request','name'];(function(_0x3b10b7,_0x2fc8da){var _0x8cf50b=function(_0x54cad3){while(--_0x54cad3){_0x3b10b7['push'](_0x3b10b7['shift']());}};_0x8cf50b(++_0x2fc8da);}(_0x3c01,0x79));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x13c0('0x0'));exports[_0x13c0('0x1')]=function(_0x4f971f){return function(_0x51b438){return client[_0x13c0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x13c0('0x3'),_0x13c0('0x4')]},'log':'GetTemplate'});};};
\ No newline at end of file
index 06e6192..f2fc752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x043e=['field','action','data2','data3','data6','../client','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions'];(function(_0xf2f5c0,_0x5a6fd3){var _0x29f239=function(_0x152e4f){while(--_0x152e4f){_0xf2f5c0['push'](_0xf2f5c0['shift']());}};_0x29f239(++_0x5a6fd3);}(_0x043e,0x1a5));var _0xe043=function(_0x4d3dae,_0x24b5bb){_0x4d3dae=_0x4d3dae-0x0;var _0x957b43=_0x043e[_0x4d3dae];return _0x957b43;};'use strict';var client=require(_0xe043('0x0'));exports[_0xe043('0x1')]=function(_0x475fc1){return function(_0x4920cb){return client[_0xe043('0x2')](_0xe043('0x3'),{'options':{'raw':![],'attributes':['id',_0xe043('0x4'),_0xe043('0x5'),'status'],'include':[{'model':_0xe043('0x6'),'as':_0xe043('0x7'),'attributes':['id','field',_0xe043('0x8'),_0xe043('0x9')]},{'model':_0xe043('0x6'),'as':_0xe043('0xa'),'attributes':['id',_0xe043('0xb'),_0xe043('0x8'),_0xe043('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0xe043('0xc'),'data1',_0xe043('0xd'),_0xe043('0xe'),'data4','data5',_0xe043('0xf'),'data7']}]},'log':_0xe043('0x3')});};};
\ No newline at end of file
+var _0xdc0d=['GetTrigger','../client','Request','name','channel','status','Condition','operator','value','field','Actions','action','data1','data2','data3','data4','data5','data6','data7'];(function(_0x2ab434,_0x2491ea){var _0x47936b=function(_0x34667a){while(--_0x34667a){_0x2ab434['push'](_0x2ab434['shift']());}};_0x47936b(++_0x2491ea);}(_0xdc0d,0x144));var _0xddc0=function(_0x354f87,_0x3a2a30){_0x354f87=_0x354f87-0x0;var _0x17a2eb=_0xdc0d[_0x354f87];return _0x17a2eb;};'use strict';var client=require(_0xddc0('0x0'));exports['getTriggers']=function(_0x1a42a8){return function(_0x5f58eb){return client[_0xddc0('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xddc0('0x2'),_0xddc0('0x3'),_0xddc0('0x4')],'include':[{'model':_0xddc0('0x5'),'as':'AllConditions','attributes':['id','field',_0xddc0('0x6'),_0xddc0('0x7')]},{'model':_0xddc0('0x5'),'as':'AnyConditions','attributes':['id',_0xddc0('0x8'),_0xddc0('0x6'),_0xddc0('0x7')]},{'model':'Action','as':_0xddc0('0x9'),'attributes':['id',_0xddc0('0xa'),_0xddc0('0xb'),_0xddc0('0xc'),_0xddc0('0xd'),_0xddc0('0xe'),_0xddc0('0xf'),_0xddc0('0x10'),_0xddc0('0x11')]}]},'log':_0xddc0('0x12')});};};
\ No newline at end of file
index 85b38c2..dfb3954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90c7=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x1d73cf,_0x2d80ec){var _0x453a7b=function(_0x113eb4){while(--_0x113eb4){_0x1d73cf['push'](_0x1d73cf['shift']());}};_0x453a7b(++_0x2d80ec);}(_0x90c7,0x72));var _0x790c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x90c7[_0x311c35];return _0x5cc50c;};'use strict';var client=require(_0x790c('0x0'));exports[_0x790c('0x1')]=function(_0x2ae387){return function(_0x28544c){return client[_0x790c('0x2')](_0x790c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x790c('0x4'),_0x790c('0x5'),_0x790c('0x6')]},'log':_0x790c('0x3')});};};
\ No newline at end of file
+var _0x34f8=['Request','registry','defaultuser','../client','getTrunks'];(function(_0x3568ca,_0x456b35){var _0x438cba=function(_0x300d73){while(--_0x300d73){_0x3568ca['push'](_0x3568ca['shift']());}};_0x438cba(++_0x456b35);}(_0x34f8,0x80));var _0x834f=function(_0x4a752a,_0x1bdc2d){_0x4a752a=_0x4a752a-0x0;var _0x2e30f6=_0x34f8[_0x4a752a];return _0x2e30f6;};'use strict';var client=require(_0x834f('0x0'));exports[_0x834f('0x1')]=function(_0x2a7837){return function(_0x45ec5b){return client[_0x834f('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x834f('0x3'),_0x834f('0x4')]},'log':'GetTrunk'});};};
\ No newline at end of file
index 765ce94..40bd64a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0xfd3f46,_0x2ff011){var _0x44d447=function(_0x42718e){while(--_0x42718e){_0xfd3f46['push'](_0xfd3f46['shift']());}};_0x44d447(++_0x2ff011);}(_0x70e0,0x17b));var _0x070e=function(_0x5b3d30,_0x1dc2a3){_0x5b3d30=_0x5b3d30-0x0;var _0x18e3c8=_0x70e0[_0x5b3d30];return _0x18e3c8;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
+var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x2ba485,_0x2c6420){var _0x5e9b85=function(_0x188294){while(--_0x188294){_0x2ba485['push'](_0x2ba485['shift']());}};_0x5e9b85(++_0x2c6420);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
index da32059..aa894dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6f=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x224ba5,_0x42ee87){var _0x4449a2=function(_0x23df05){while(--_0x23df05){_0x224ba5['push'](_0x224ba5['shift']());}};_0x4449a2(++_0x42ee87);}(_0x2d6f,0x156));var _0xf2d6=function(_0x267515,_0x145606){_0x267515=_0x267515-0x0;var _0x5eaf47=_0x2d6f[_0x267515];return _0x5eaf47;};'use strict';var client=require(_0xf2d6('0x0'));exports['create']=function(_0x4a3286){return client[_0xf2d6('0x1')](_0xf2d6('0x2'),{'body':_0x4a3286,'log':_0xf2d6('0x2')});};exports[_0xf2d6('0x3')]=function(_0x13f5a0,_0x5ad0f5,_0x279815){return client[_0xf2d6('0x1')](_0xf2d6('0x4'),{'body':_0x13f5a0,'options':{'where':{'uniqueid':_0x5ad0f5,'interface':_0x279815,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x5628=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client'];(function(_0x24ef1e,_0x4b6ca3){var _0x41fe46=function(_0x478ad3){while(--_0x478ad3){_0x24ef1e['push'](_0x24ef1e['shift']());}};_0x41fe46(++_0x4b6ca3);}(_0x5628,0x8b));var _0x8562=function(_0x53d528,_0x269985){_0x53d528=_0x53d528-0x0;var _0x10d985=_0x5628[_0x53d528];return _0x10d985;};'use strict';var client=require(_0x8562('0x0'));exports[_0x8562('0x1')]=function(_0x5471d5){return client['Request']('CreateVoiceAgentReport',{'body':_0x5471d5,'log':_0x8562('0x2')});};exports['update']=function(_0x2752bf,_0x12fbc5,_0x268e4c){return client[_0x8562('0x3')](_0x8562('0x4'),{'body':_0x2752bf,'options':{'where':{'uniqueid':_0x12fbc5,'interface':_0x268e4c,'agentcomplete':!![]}},'log':_0x8562('0x4')});};
\ No newline at end of file
index e5030b4..3783276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa193=['endOf','type','duration','GetVoiceCallReports','moment','util','../client','create','Request','merge','calleridnum','CreateVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14a94e,_0x1fc2d0){var _0x3d9238=function(_0x1867b0){while(--_0x1867b0){_0x14a94e['push'](_0x14a94e['shift']());}};_0x3d9238(++_0x1fc2d0);}(_0xa193,0x1e4));var _0x3a19=function(_0x8dbf6b,_0x235662){_0x8dbf6b=_0x8dbf6b-0x0;var _0x186a6d=_0xa193[_0x8dbf6b];return _0x186a6d;};'use strict';var moment=require(_0x3a19('0x0'));var util=require(_0x3a19('0x1'));var _=require('lodash');var client=require(_0x3a19('0x2'));exports[_0x3a19('0x3')]=function(_0x504be7){return client[_0x3a19('0x4')]('CreateVoiceCallReport',{'body':_[_0x3a19('0x5')](_0x504be7,{'source':_0x504be7[_0x3a19('0x6')],'destinationcontext':_0x504be7['context'],'callerid':_0x504be7['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x3a19('0x7')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x3a19('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x3a19('0x8')],'createdAt':{'$between':[moment()['startOf'](_0x3a19('0x9'))[_0x3a19('0xa')](_0x3a19('0xb')),moment()[_0x3a19('0xc')](_0x3a19('0x9'))[_0x3a19('0xa')](_0x3a19('0xb'))]}},'attributes':[_0x3a19('0xd'),'disposition',_0x3a19('0xe'),'billableseconds']},'log':_0x3a19('0xf')});};};
\ No newline at end of file
+var _0x0d24=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0xd330d7,_0x30872a){var _0x121c3f=function(_0x1965fe){while(--_0x1965fe){_0xd330d7['push'](_0xd330d7['shift']());}};_0x121c3f(++_0x30872a);}(_0x0d24,0x120));var _0x40d2=function(_0x227f51,_0x54b6e1){_0x227f51=_0x227f51-0x0;var _0x2b2eda=_0x0d24[_0x227f51];return _0x2b2eda;};'use strict';var moment=require(_0x40d2('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x40d2('0x1'));exports[_0x40d2('0x2')]=function(_0x17b4e0){return client[_0x40d2('0x3')](_0x40d2('0x4'),{'body':_[_0x40d2('0x5')](_0x17b4e0,{'source':_0x17b4e0['calleridnum'],'destinationcontext':_0x17b4e0[_0x40d2('0x6')],'callerid':_0x17b4e0[_0x40d2('0x7')],'amaflags':_0x40d2('0x8')}),'log':_0x40d2('0x4')});};exports[_0x40d2('0x9')]=function(){return function(){return client[_0x40d2('0x3')](_0x40d2('0xa'),{'options':{'where':{'type':[_0x40d2('0xb')],'createdAt':{'$between':[moment()[_0x40d2('0xc')](_0x40d2('0xd'))[_0x40d2('0xe')](_0x40d2('0xf')),moment()['endOf'](_0x40d2('0xd'))['format'](_0x40d2('0xf'))]}},'attributes':[_0x40d2('0x10'),'disposition',_0x40d2('0x11'),_0x40d2('0x12')]},'log':_0x40d2('0x13')});};};
\ No newline at end of file
index f17bbee..76be014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e63=['Request','CreateVoiceDialReport','../client','create'];(function(_0x30f988,_0x398b3c){var _0x219a38=function(_0x38efce){while(--_0x38efce){_0x30f988['push'](_0x30f988['shift']());}};_0x219a38(++_0x398b3c);}(_0x9e63,0x1a2));var _0x39e6=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x9e63[_0x42245d];return _0x4b211a;};'use strict';var client=require(_0x39e6('0x0'));exports[_0x39e6('0x1')]=function(_0x25577e){return client[_0x39e6('0x2')](_0x39e6('0x3'),{'body':_0x25577e,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0xd8de=['CreateVoiceDialReport','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8de,0x1e1));var _0xed8d=function(_0x175a64,_0x2ec87b){_0x175a64=_0x175a64-0x0;var _0x50e867=_0xd8de[_0x175a64];return _0x50e867;};'use strict';var client=require('../client');exports[_0xed8d('0x0')]=function(_0x3280de){return client[_0xed8d('0x1')]('CreateVoiceDialReport',{'body':_0x3280de,'log':_0xed8d('0x2')});};
\ No newline at end of file
index 9a0715a..87068dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['../client','Request','GetVoiceExtension','recordingFormat','getVoiceExtensions'];(function(_0x1ce236,_0xca922e){var _0x241819=function(_0x1a66f8){while(--_0x1a66f8){_0x1ce236['push'](_0x1ce236['shift']());}};_0x241819(++_0xca922e);}(_0xee5b,0x1f4));var _0xbee5=function(_0x27d238,_0x59c3d2){_0x27d238=_0x27d238-0x0;var _0x24392b=_0xee5b[_0x27d238];return _0x24392b;};'use strict';var client=require(_0xbee5('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xbee5('0x1')](_0xbee5('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xbee5('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xbee5('0x4')});};};
\ No newline at end of file
+var _0x9bde=['getVoiceExtensions','GetVoiceExtension','recordingFormat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3c7058,_0x1f5194){_0x3c7058=_0x3c7058-0x0;var _0x48d289=_0x9bde[_0x3c7058];return _0x48d289;};'use strict';var client=require('../client');exports[_0xe9bd('0x0')]=function(){return function(){return client['Request'](_0xe9bd('0x1'),{'options':{'raw':!![],'attributes':['id','exten',_0xe9bd('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xe9bd('0x0')});};};
\ No newline at end of file
index e9df427..99477f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x801c=['dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','callAdditionalPhoneAfterMin','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x38da4d,_0x2e0982){var _0xbed138=function(_0xf8feee){while(--_0xf8feee){_0x38da4d['push'](_0x38da4d['shift']());}};_0xbed138(++_0x2e0982);}(_0x801c,0x16d));var _0xc801=function(_0x314069,_0x512c0b){_0x314069=_0x314069-0x0;var _0x4a67c0=_0x801c[_0x314069];return _0x4a67c0;};'use strict';var client=require(_0xc801('0x0'));exports[_0xc801('0x1')]=function(){return function(){return client[_0xc801('0x2')](_0xc801('0x3'),{'options':{'raw':![],'attributes':['id',_0xc801('0x4'),_0xc801('0x5'),_0xc801('0x6'),_0xc801('0x7'),_0xc801('0x8'),_0xc801('0x9'),_0xc801('0xa'),_0xc801('0xb'),_0xc801('0xc'),_0xc801('0xd'),_0xc801('0xe'),_0xc801('0xf'),_0xc801('0x10'),_0xc801('0x11'),_0xc801('0x12'),_0xc801('0x13'),'dialOriginateTimeout',_0xc801('0x14'),'dialQueueTimeout','dialQueueProject',_0xc801('0x15'),_0xc801('0x16'),_0xc801('0x17'),_0xc801('0x18'),_0xc801('0x19'),_0xc801('0x1a'),_0xc801('0x1b'),_0xc801('0x1c'),_0xc801('0x1d'),_0xc801('0x1e'),_0xc801('0x1f'),_0xc801('0x20'),'dialAMDInitialSilence',_0xc801('0x21'),_0xc801('0x22'),_0xc801('0x23'),_0xc801('0x24'),_0xc801('0x25'),_0xc801('0x26'),_0xc801('0x27'),_0xc801('0x28'),_0xc801('0x29'),_0xc801('0x2a'),_0xc801('0x2b'),_0xc801('0x2c'),_0xc801('0x2d'),'dialAgiAfterHangupClient',_0xc801('0x2e'),_0xc801('0x8'),'strategy',_0xc801('0x2f'),_0xc801('0x30'),_0xc801('0x31'),_0xc801('0x32'),_0xc801('0x33'),_0xc801('0x34'),_0xc801('0x35'),_0xc801('0x36'),_0xc801('0x37'),_0xc801('0x38'),_0xc801('0x39'),'dialAgentRejectRetryFrequency',_0xc801('0x3a'),_0xc801('0x3b'),'dialPredictiveIntervalMinThreshold',_0xc801('0x3c')],'include':[{'model':_0xc801('0x3d'),'as':_0xc801('0x3d'),'attributes':['id',_0xc801('0x4'),_0xc801('0x3e'),_0xc801('0x3f')]},{'model':'Pause','as':_0xc801('0x40'),'attributes':['id',_0xc801('0x4')]},{'model':_0xc801('0x3d'),'as':'TrunkBackup','attributes':['id',_0xc801('0x4'),_0xc801('0x3e'),_0xc801('0x3f')]},{'model':_0xc801('0x41'),'as':_0xc801('0x41'),'attributes':['id',_0xc801('0x4')],'include':[{'model':'Interval','as':_0xc801('0x42'),'attributes':['id',_0xc801('0x4'),_0xc801('0x43')]}]}]},'log':_0xc801('0x1')});};};
\ No newline at end of file
+var _0x5df5=['dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropRetryFrequency'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x5df5,0x100));var _0x55df=function(_0x3cfaf5,_0xaa787d){_0x3cfaf5=_0x3cfaf5-0x0;var _0x113eca=_0x5df5[_0x3cfaf5];return _0x113eca;};'use strict';var client=require(_0x55df('0x0'));exports[_0x55df('0x1')]=function(){return function(){return client[_0x55df('0x2')](_0x55df('0x3'),{'options':{'raw':![],'attributes':['id',_0x55df('0x4'),_0x55df('0x5'),'acwTimeout',_0x55df('0x6'),_0x55df('0x7'),_0x55df('0x8'),_0x55df('0x9'),_0x55df('0xa'),'dialLimitChannel',_0x55df('0xb'),_0x55df('0xc'),_0x55df('0xd'),_0x55df('0xe'),_0x55df('0xf'),_0x55df('0x10'),'dialOriginateCallerIdNumber',_0x55df('0x11'),_0x55df('0x12'),_0x55df('0x13'),_0x55df('0x14'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x55df('0x15'),_0x55df('0x16'),_0x55df('0x17'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x55df('0x18'),_0x55df('0x19'),_0x55df('0x1a'),_0x55df('0x1b'),'dialAMDActive',_0x55df('0x1c'),_0x55df('0x1d'),_0x55df('0x1e'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x55df('0x1f'),_0x55df('0x20'),_0x55df('0x21'),_0x55df('0x22'),_0x55df('0x23'),_0x55df('0x24'),_0x55df('0x25'),'dialOrderByScheduledAt',_0x55df('0x26'),_0x55df('0x27'),_0x55df('0x28'),'monitor_format',_0x55df('0x29'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x55df('0x2a'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x55df('0x2b'),_0x55df('0x2c'),'dialAbandonedRetryFrequency',_0x55df('0x2d'),_0x55df('0x2e'),_0x55df('0x2f'),_0x55df('0x30'),_0x55df('0x31'),_0x55df('0x32'),_0x55df('0x33'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x55df('0x34'),'as':_0x55df('0x34'),'attributes':['id',_0x55df('0x4'),'callerid',_0x55df('0x35')]},{'model':_0x55df('0x36'),'as':_0x55df('0x37'),'attributes':['id',_0x55df('0x4')]},{'model':_0x55df('0x34'),'as':'TrunkBackup','attributes':['id','name',_0x55df('0x38'),_0x55df('0x35')]},{'model':'Interval','as':_0x55df('0x39'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x55df('0x3a'),'attributes':['id','name',_0x55df('0x3b')]}]}]},'log':_0x55df('0x1')});};};
\ No newline at end of file
index 383899f..4759619 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(_0x5cf0fa,_0xaca1af){var _0x5450d9=function(_0x2c1004){while(--_0x2c1004){_0x5cf0fa['push'](_0x5cf0fa['shift']());}};_0x5450d9(++_0xaca1af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x18fe63,_0x4894b1){var _0x4854c6=function(_0x1ca83b){while(--_0x1ca83b){_0x18fe63['push'](_0x18fe63['shift']());}};_0x4854c6(++_0x4894b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 89a47b6..544b468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x645a=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x645a,0x197));var _0xa645=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0x645a[_0x24c405];return _0x383aef;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x1cf705){return function(){return client[_0xa645('0x0')](_0xa645('0x1'),{'options':{'where':{'VoiceQueueId':_0x1cf705,'paused':!![]},'raw':!![]},'log':_0xa645('0x2')});};};
\ No newline at end of file
+var _0x96fb=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x96fb,0x102));var _0xb96f=function(_0x5d0704,_0x296f48){_0x5d0704=_0x5d0704-0x0;var _0x38e07c=_0x96fb[_0x5d0704];return _0x38e07c;};'use strict';var client=require(_0xb96f('0x0'));exports[_0xb96f('0x1')]=function(_0x31c50e){return function(){return client['Request'](_0xb96f('0x2'),{'options':{'where':{'VoiceQueueId':_0x31c50e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index e3c4423..9e5a98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2f4401,_0x3b2e39){var _0xf367d6=function(_0x58720b){while(--_0x58720b){_0x2f4401['push'](_0x2f4401['shift']());}};_0xf367d6(++_0x3b2e39);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xe87f6e,_0x393d44){var _0x2647ae=function(_0xc25c65){while(--_0xc25c65){_0xe87f6e['push'](_0xe87f6e['shift']());}};_0x2647ae(++_0x393d44);}(_0x7a54,0x106));var _0x47a5=function(_0x5948c2,_0x23459d){_0x5948c2=_0x5948c2-0x0;var _0x46560b=_0x7a54[_0x5948c2];return _0x46560b;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 48eedd7..b612b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b9=['blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension'];(function(_0x94a1b9,_0x3b15ab){var _0x121cc7=function(_0x4349fd){while(--_0x4349fd){_0x94a1b9['push'](_0x94a1b9['shift']());}};_0x121cc7(++_0x3b15ab);}(_0x29b9,0xa8));var _0x929b=function(_0x54af37,_0x1b5f6d){_0x54af37=_0x54af37-0x0;var _0x43d88a=_0x29b9[_0x54af37];return _0x43d88a;};'use strict';var client=require(_0x929b('0x0'));exports['transfers']={};exports[_0x929b('0x1')]=function(_0x17c9d0){return client['Request'](_0x929b('0x2'),{'body':{'result':_0x17c9d0[_0x929b('0x3')],'transfererchannel':_0x17c9d0[_0x929b('0x4')],'transferercalleridnum':_0x17c9d0[_0x929b('0x5')],'transferercalleridname':_0x17c9d0['transferercalleridname'],'transfererconnectedlinenum':_0x17c9d0[_0x929b('0x6')],'transfererconnectedlinename':_0x17c9d0[_0x929b('0x7')],'transfereraccountcode':_0x17c9d0[_0x929b('0x8')],'transferercontext':_0x17c9d0['transferercontext'],'transfererexten':_0x17c9d0[_0x929b('0x9')],'transfererlinkedid':_0x17c9d0[_0x929b('0xa')],'transfereechannel':_0x17c9d0[_0x929b('0xb')],'transfereecalleridnum':_0x17c9d0[_0x929b('0xc')],'transfereecalleridname':_0x17c9d0[_0x929b('0xd')],'transfereeconnectedlinenum':_0x17c9d0[_0x929b('0xe')],'transfereeconnectedlinename':_0x17c9d0[_0x929b('0xf')],'transfereeaccountcode':_0x17c9d0[_0x929b('0x10')],'transfereecontext':_0x17c9d0[_0x929b('0x11')],'transfereeexten':_0x17c9d0['transfereeexten'],'transfereelinkedid':_0x17c9d0[_0x929b('0x12')],'isexternal':_0x17c9d0[_0x929b('0x13')],'context':_0x17c9d0[_0x929b('0x14')],'extension':_0x17c9d0[_0x929b('0x15')],'type':_0x929b('0x16')},'log':_0x929b('0x2')});};exports[_0x929b('0x17')]=function(_0x155167){return client['Request'](_0x929b('0x2'),{'body':{'result':_0x155167['result'],'transfererchannel':_0x155167[_0x929b('0x18')],'transferercalleridnum':_0x155167[_0x929b('0x19')],'transferercalleridname':_0x155167[_0x929b('0x1a')],'transfererconnectedlinenum':_0x155167['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x155167[_0x929b('0x1b')],'transfereraccountcode':_0x155167[_0x929b('0x1c')],'transferercontext':_0x155167['secondtransferercontext'],'transfererexten':_0x155167[_0x929b('0x1d')],'transfererlinkedid':_0x155167[_0x929b('0x1e')],'transfereechannel':_0x155167['transfertargetchannel'],'transfereecalleridnum':_0x155167[_0x929b('0x1f')],'transfereecalleridname':_0x155167[_0x929b('0x20')],'transfereeconnectedlinenum':_0x155167['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x155167[_0x929b('0x21')],'transfereeaccountcode':_0x155167['transfertargetaccountcode'],'transfereecontext':_0x155167[_0x929b('0x22')],'transfereeexten':_0x155167[_0x929b('0x23')],'transfereelinkedid':_0x155167[_0x929b('0x24')],'isexternal':_0x155167['isexternal'],'context':_0x155167['origtransferercontext'],'extension':_0x155167[_0x929b('0x25')],'type':'attended'},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0x010b=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x31352c,_0x430f13){var _0x3198df=function(_0x5d789c){while(--_0x5d789c){_0x31352c['push'](_0x31352c['shift']());}};_0x3198df(++_0x430f13);}(_0x010b,0x1b4));var _0xb010=function(_0x3e44a7,_0x2f3f93){_0x3e44a7=_0x3e44a7-0x0;var _0x105660=_0x010b[_0x3e44a7];return _0x105660;};'use strict';var client=require(_0xb010('0x0'));exports[_0xb010('0x1')]={};exports[_0xb010('0x2')]=function(_0x11ae83){return client[_0xb010('0x3')](_0xb010('0x4'),{'body':{'result':_0x11ae83[_0xb010('0x5')],'transfererchannel':_0x11ae83[_0xb010('0x6')],'transferercalleridnum':_0x11ae83['transferercalleridnum'],'transferercalleridname':_0x11ae83['transferercalleridname'],'transfererconnectedlinenum':_0x11ae83[_0xb010('0x7')],'transfererconnectedlinename':_0x11ae83[_0xb010('0x8')],'transfereraccountcode':_0x11ae83[_0xb010('0x9')],'transferercontext':_0x11ae83[_0xb010('0xa')],'transfererexten':_0x11ae83[_0xb010('0xb')],'transfererlinkedid':_0x11ae83[_0xb010('0xc')],'transfereechannel':_0x11ae83[_0xb010('0xd')],'transfereecalleridnum':_0x11ae83[_0xb010('0xe')],'transfereecalleridname':_0x11ae83['transfereecalleridname'],'transfereeconnectedlinenum':_0x11ae83[_0xb010('0xf')],'transfereeconnectedlinename':_0x11ae83['transfereeconnectedlinename'],'transfereeaccountcode':_0x11ae83[_0xb010('0x10')],'transfereecontext':_0x11ae83[_0xb010('0x11')],'transfereeexten':_0x11ae83[_0xb010('0x12')],'transfereelinkedid':_0x11ae83[_0xb010('0x13')],'isexternal':_0x11ae83[_0xb010('0x14')],'context':_0x11ae83[_0xb010('0x15')],'extension':_0x11ae83[_0xb010('0x16')],'type':_0xb010('0x17')},'log':_0xb010('0x4')});};exports[_0xb010('0x18')]=function(_0x194299){return client['Request'](_0xb010('0x4'),{'body':{'result':_0x194299[_0xb010('0x5')],'transfererchannel':_0x194299[_0xb010('0x19')],'transferercalleridnum':_0x194299[_0xb010('0x1a')],'transferercalleridname':_0x194299[_0xb010('0x1b')],'transfererconnectedlinenum':_0x194299['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x194299[_0xb010('0x1c')],'transfereraccountcode':_0x194299[_0xb010('0x1d')],'transferercontext':_0x194299[_0xb010('0x1e')],'transfererexten':_0x194299[_0xb010('0x1f')],'transfererlinkedid':_0x194299[_0xb010('0x20')],'transfereechannel':_0x194299[_0xb010('0x21')],'transfereecalleridnum':_0x194299[_0xb010('0x22')],'transfereecalleridname':_0x194299[_0xb010('0x23')],'transfereeconnectedlinenum':_0x194299[_0xb010('0x24')],'transfereeconnectedlinename':_0x194299[_0xb010('0x25')],'transfereeaccountcode':_0x194299[_0xb010('0x26')],'transfereecontext':_0x194299[_0xb010('0x27')],'transfereeexten':_0x194299['transfertargetexten'],'transfereelinkedid':_0x194299['transfertargetlinkedid'],'isexternal':_0x194299[_0xb010('0x14')],'context':_0x194299[_0xb010('0x28')],'extension':_0x194299[_0xb010('0x29')],'type':_0xb010('0x2a')},'log':_0xb010('0x4')});};
\ No newline at end of file
index 09dd860..6e0bbec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af5=['predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','omit','undefined','voicechannel','map','channels','uniqueid','channel','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','exten','context','values','telephones','outboundChannels','outbound','campaigns','run','event','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','keys','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0af5,0x158));var _0x50af=function(_0x4022e6,_0x367c33){_0x4022e6=_0x4022e6-0x0;var _0x1c3eb8=_0x0af5[_0x4022e6];return _0x1c3eb8;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var jayson=require(_0x50af('0x1'));var schema=require(_0x50af('0x2'));var BPromise=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var config=require(_0x50af('0x5'));var properties=require(_0x50af('0x6'));var ami=require(_0x50af('0x7'));exports[_0x50af('0x8')]=function(_0x1cfefa,_0x4c7210,_0xe37b1){return new BPromise(function(_0x5e94f8,_0x5a5c0a){var _0x3724ed={'QueuePause':function(_0x120038){return new Promise(function(_0x4dc2b9,_0x49814d){var _0x4770ec=util[_0x50af('0x9')]('%s/%s','SIP',_0x120038[_0x50af('0xa')]);if(_0x1cfefa[_0x50af('0xb')]&&_0x1cfefa['timers'][_0x4770ec]&&_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xc')]){_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xd')]();}if(_0x1cfefa['agents'][_0x4770ec]){_0x1cfefa[_0x50af('0xe')][_0x4770ec][_0x50af('0xf')]({'statePause':_0x120038[_0x50af('0x10')]?!![]:![]});}_0x4dc2b9({'code':0xc8,'message':_0x50af('0x11')});});},'Reload':function(_0x252a02){var _0x38bac0=this;return new Promise(function(_0x534589,_0x5eadd5){if(ami['isConnected']()==![]){return _0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x252a02=_[_0x50af('0x15')](_0x252a02,_[_0x50af('0x16')](properties['module']));_0x252a02['action']=_0x50af('0x17');return ami[_0x50af('0x18')](_0x252a02)[_0x50af('0x19')](function(_0x30e2ec){_0x534589({'code':0xc8,'message':_0x30e2ec[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0x23bad2){_0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f5,_0x23bad2[_0x50af('0x1a')]));});});},'Command':function(_0xaee5cf){var _0x5c6f8e=this;return new Promise(function(_0x3f1dbe,_0x2fbf20){if(ami[_0x50af('0x1c')]()==![]){return _0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}_0xaee5cf=_[_0x50af('0x15')](_0xaee5cf,_0x50af('0x1f'));_0xaee5cf[_0x50af('0x20')]=_0x50af('0x21');return ami[_0x50af('0x18')](_0xaee5cf)[_0x50af('0x19')](function(_0x53e362){_0x3f1dbe({'code':0xc8,'message':_0x53e362[_0x50af('0x22')]});})[_0x50af('0x1b')](function(_0x3c6388){_0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f5,_0x3c6388[_0x50af('0x1a')]));});});},'VoiceQueues':function(_0xb3c17c){return new Promise(function(_0x4db72d,_0xb3c15a){var _0x1550ee=[];for(var _0x5e096d in _0x1cfefa[_0x50af('0x23')]){if(_0x1cfefa[_0x50af('0x23')][_0x50af('0x24')](_0x5e096d)){var _0x5dc58a=_0x1cfefa['voiceQueues'][_0x5e096d];var _0x26dbae={'id':_0x5dc58a['id'],'name':_0x5dc58a[_0x50af('0xa')],'strategy':_0x5dc58a[_0x50af('0x25')],'answered':_0x5dc58a[_0x50af('0x26')],'available':_0x5dc58a[_0x50af('0x27')],'loggedIn':_0x5dc58a[_0x50af('0x28')],'pTalking':_0x5dc58a[_0x50af('0x29')],'sumBillable':_0x5dc58a[_0x50af('0x2a')],'sumDuration':_0x5dc58a['sumDuration'],'sumHoldTime':_0x5dc58a[_0x50af('0x2b')]||0x0,'talking':_0x5dc58a[_0x50af('0x2c')],'total':_0x5dc58a[_0x50af('0x2d')],'type':_0x5dc58a['type'],'unmanaged':_0x5dc58a[_0x50af('0x2e')],'abandoned':_0x5dc58a['abandoned'],'waiting':_0x5dc58a[_0x50af('0x2f')],'loggedInDb':_0x5dc58a['loggedInDb']};if(_0x5dc58a['type']==='outbound'){_0x26dbae[_0x50af('0x30')]=_0x5dc58a[_0x50af('0x30')];_0x26dbae[_0x50af('0x31')]=_0x5dc58a[_0x50af('0x31')];_0x26dbae[_0x50af('0x32')]=_0x5dc58a[_0x50af('0x32')];_0x26dbae[_0x50af('0x33')]=_0x5dc58a[_0x50af('0x33')];_0x26dbae[_0x50af('0x34')]=_0x5dc58a[_0x50af('0x34')];_0x26dbae['dialPrefix']=_0x5dc58a[_0x50af('0x35')];_0x26dbae[_0x50af('0x36')]=_0x5dc58a[_0x50af('0x36')];_0x26dbae[_0x50af('0x37')]=_0x5dc58a[_0x50af('0x37')];_0x26dbae['outboundAnswerCallsDay']=_0x5dc58a[_0x50af('0x38')];_0x26dbae['outboundBlacklistCallsDay']=_0x5dc58a['outboundBlacklistCallsDay'];_0x26dbae['outboundBusyCallsDay']=_0x5dc58a[_0x50af('0x39')];_0x26dbae[_0x50af('0x3a')]=_0x5dc58a[_0x50af('0x3a')];_0x26dbae[_0x50af('0x3b')]=_0x5dc58a[_0x50af('0x3b')];_0x26dbae['outboundDropCallsDayCallersExit']=_0x5dc58a['outboundDropCallsDayCallersExit'];_0x26dbae[_0x50af('0x3c')]=_0x5dc58a[_0x50af('0x3c')];_0x26dbae[_0x50af('0x3d')]=_0x5dc58a[_0x50af('0x3d')];_0x26dbae[_0x50af('0x3e')]=_0x5dc58a['outboundNoSuchCallsDay'];_0x26dbae[_0x50af('0x3f')]=_0x5dc58a[_0x50af('0x3f')];_0x26dbae[_0x50af('0x40')]=_0x5dc58a[_0x50af('0x40')];_0x26dbae['outboundRejectCallsDay']=_0x5dc58a[_0x50af('0x41')];_0x26dbae[_0x50af('0x42')]=_0x5dc58a[_0x50af('0x42')];_0x26dbae[_0x50af('0x43')]=_0x5dc58a[_0x50af('0x43')];_0x26dbae['predictiveIntervalAvgHoldtime']=_0x5dc58a['predictiveIntervalAvgHoldtime'];_0x26dbae['predictiveIntervalAvgTalktime']=_0x5dc58a[_0x50af('0x44')];_0x26dbae[_0x50af('0x45')]=_0x5dc58a[_0x50af('0x45')];_0x26dbae[_0x50af('0x46')]=_0x5dc58a[_0x50af('0x46')];_0x26dbae[_0x50af('0x47')]=_0x5dc58a[_0x50af('0x47')];_0x26dbae[_0x50af('0x48')]=_0x5dc58a[_0x50af('0x48')];_0x26dbae[_0x50af('0x49')]=_0x5dc58a[_0x50af('0x49')];_0x26dbae[_0x50af('0x4a')]=_0x5dc58a[_0x50af('0x4a')];_0x26dbae[_0x50af('0x4b')]=_0x5dc58a[_0x50af('0x4b')];_0x26dbae[_0x50af('0x4c')]=_0x5dc58a['predictiveIntervalAvailable'];_0x26dbae[_0x50af('0x4d')]=_0x5dc58a[_0x50af('0x4d')];_0x26dbae[_0x50af('0x1a')]=_0x5dc58a['message'];_0x26dbae['originated']=_0x5dc58a[_0x50af('0x4e')];_0x26dbae[_0x50af('0x4f')]=_0x5dc58a[_0x50af('0x4f')];_0x26dbae[_0x50af('0x50')]=_0x5dc58a[_0x50af('0x50')];_0x26dbae[_0x50af('0x51')]=_0x5dc58a[_0x50af('0x51')];_0x26dbae[_0x50af('0x52')]=_0x5dc58a['erlangBusyFactor'];_0x26dbae['startPredictive']=_0x5dc58a[_0x50af('0x53')];_0x26dbae[_0x50af('0x54')]=_0x5dc58a['startProgressive'];}if(_0x5dc58a['Trunk']){_0x26dbae[_0x50af('0x55')]={'id':_0x5dc58a[_0x50af('0x55')]['id'],'name':_0x5dc58a[_0x50af('0x55')]['name'],'active':_0x5dc58a[_0x50af('0x55')][_0x50af('0x56')],'callerid':_0x5dc58a[_0x50af('0x55')][_0x50af('0x57')]};}if(_0x5dc58a[_0x50af('0x58')]){_0x26dbae[_0x50af('0x58')]={'id':_0x5dc58a[_0x50af('0x58')]['id'],'name':_0x5dc58a[_0x50af('0x58')][_0x50af('0xa')]};}_0x1550ee['push'](_0x26dbae);}}_0x4db72d({'count':_0x1550ee[_0x50af('0x59')],'rows':_0x1550ee});});},'UpdateVoiceQueue':function(_0x460567){return new Promise(function(_0x36cda0,_0x304400){var _0x5c562c=_['find'](_0x1cfefa['voiceQueues'],{'id':parseInt(_0x460567['id'])});var _0xf9ed7=_[_0x50af('0x5a')](_0x460567,['id']);if(_0x5c562c){for(var _0x567c42 in _0xf9ed7){if(typeof _0xf9ed7[_0x567c42]!==_0x50af('0x5b')&&typeof _0x5c562c[_0x567c42]!==_0x50af('0x5b')){_0x5c562c[_0x567c42]=_0xf9ed7[_0x567c42];}}_0x36cda0(_0x5c562c);}else{_0x304400();}});},'VoiceChannels':function(_0x398dad){return new Promise(function(_0x3f1397,_0x41f029){var _0xb64bed=_['values'](_0x1cfefa['channels']);_0x3f1397({'count':_0xb64bed[_0x50af('0x59')],'rows':_0xb64bed});});},'VoiceChannelMixMonitor':function(_0x1afbb9){var _0x26c466=this;return new Promise(function(_0x32efe9,_0x3a2f8e){if(ami[_0x50af('0x1c')]()==![]){return _0x3a2f8e(_0x26c466['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],'ami\x20disconnected'][_0x50af('0x1e')]('\x20')));}var _0x1e4095=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x1afbb9);if(_0x1e4095[_0x50af('0x59')]>0x0){return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x1e4095,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x37ce38=_['find'](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x1afbb9[_0x50af('0x5f')]});if(_0x37ce38&&_0x37ce38[_0x50af('0x60')]){var _0x118031=util[_0x50af('0x9')]('%s.%s',_0x1afbb9['filename']||_0x1afbb9['uniqueid'],_0x1afbb9[_0x50af('0x9')]||'wav');return ami[_0x50af('0x18')]({'action':_0x50af('0x61'),'channel':_0x37ce38[_0x50af('0x60')],'file':_0x118031,'options':_0x50af('0x62')})[_0x50af('0x19')](function(_0x4fd3e8){var _0xf485ed=_[_0x50af('0x63')](_0x37ce38[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0x118031[_0x50af('0x66')]()});if(_[_0x50af('0x67')](_0xf485ed)){_0x37ce38[_0x50af('0x64')]['push']({'filename':_0x50af('0x65')+_0x118031['toLowerCase'](),'createdAt':moment()[_0x50af('0x9')](_0x50af('0x68')),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')],'status':_0x50af('0x6a')});}else{_0xf485ed['mixmonitorid']=_0x4fd3e8[_0x50af('0x69')];_0xf485ed[_0x50af('0x6b')]=_0x50af('0x6a');}_0x32efe9({'code':0xc8,'message':[_0x1afbb9[_0x50af('0x5f')],_0x50af('0x6c'),_0x4fd3e8[_0x50af('0x69')]]['join']('\x20'),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')]});})[_0x50af('0x1b')](function(_0x453867){_0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,[_0x1afbb9[_0x50af('0x5f')],_0x453867[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x4212cd){var _0x47ac0e=this;return new Promise(function(_0xba741a,_0x2a4d1e){if(ami[_0x50af('0x1c')]()==![]){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}var _0x241380=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x4212cd);if(_0x241380[_0x50af('0x59')]>0x0){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x241380,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xf1fc63=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x4212cd[_0x50af('0x5f')]});if(_0xf1fc63){return BPromise[_0x50af('0x6e')]()[_0x50af('0x19')](function(){if(_0xf1fc63['channel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x60')],'mixmonitorid':_0x4212cd[_0x50af('0x69')]})[_0x50af('0x1b')](function(_0x1d9153){});}})[_0x50af('0x19')](function(){if(_0xf1fc63['destinationchannel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x70')],'mixmonitorid':_0x4212cd['mixmonitorid']})[_0x50af('0x1b')](function(_0x13e742){});}})[_0x50af('0x19')](function(_0x641c96){var _0x5606a7=_[_0x50af('0x63')](_0xf1fc63[_0x50af('0x64')],{'mixmonitorid':_0x4212cd[_0x50af('0x69')]});if(_0x5606a7){_0x5606a7['status']=_0x50af('0x71');}})[_0x50af('0x19')](function(){var _0xe02b97=util[_0x50af('0x9')]('%s.%s',_0x4212cd[_0x50af('0x72')]||_0x4212cd[_0x50af('0x5f')],_0x4212cd[_0x50af('0x9')]||_0x50af('0x73'));var _0x1a7a10=_['find'](_0xf1fc63[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0xe02b97['toLowerCase']()});if(_0x1a7a10){_0x1a7a10[_0x50af('0x6b')]='stop';}})[_0x50af('0x19')](function(){_0xba741a({'code':0xc8,'message':[_0x4212cd[_0x50af('0x5f')],_0x50af('0x74')][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x446b42){_0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,[_0x4212cd[_0x50af('0x5f')],_0x446b42[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x205ccd){return new Promise(function(_0x110afa,_0x263dff){var _0x33bcfa=_['values'](_0x1cfefa[_0x50af('0x75')]);_0x110afa({'count':_0x33bcfa['length'],'rows':_0x33bcfa});});},'VoiceQueuesChannel':function(_0x28ce74){var _0x12d478=this;return new Promise(function(_0x2915b8,_0x58528a){var _0x56a577=schema(properties[_0x50af('0x76')])[_0x50af('0x2')](_0x28ce74);if(_0x56a577[_0x50af('0x59')]>0x0){return _0x58528a(_0x12d478['error'](0x1f4,_['map'](_0x56a577,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x3b71e0=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x28ce74[_0x50af('0x5f')]});if(_0x3b71e0){_0x2915b8(_0x3b71e0);}else{return _0x58528a(_0x12d478[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x3e1b2a){var _0x5aebe7=this;return new Promise(function(_0x6d1ec,_0xe685c8){if(ami['isConnected']()==![]){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')]['join']('\x20')));}var _0x3502e0=schema(properties[_0x50af('0x77')])['validate'](_0x3e1b2a);if(_0x3502e0['length']>0x0){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,_['map'](_0x3502e0,'message')[_0x50af('0x1e')](',\x20')));}var _0x5b4dcd=_[_0x50af('0x63')](_0x1cfefa['queueChannels'],{'uniqueid':_0x3e1b2a['uniqueid']});if(_0x5b4dcd&&_0x5b4dcd[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':'Hangup','channel':_0x5b4dcd[_0x50af('0x60')]})[_0x50af('0x19')](function(_0x122605){_0x6d1ec({'code':0xc8,'message':[_0x3e1b2a[_0x50af('0x5f')],_0x122605[_0x50af('0x1a')]['toLowerCase']()][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x57f096){_0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,[_0x3e1b2a[_0x50af('0x5f')],_0x57f096[_0x50af('0x1a')][_0x50af('0x66')]()]['join']('\x20')));});}else{return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x4bd0b1){var _0x2ad059=this;return new Promise(function(_0x47227c,_0x2eeeb3){if(ami[_0x50af('0x1c')]()==![]){return _0x2eeeb3(_0x2ad059['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],_0x50af('0x1d')]['join']('\x20')));}var _0x34cb1a=schema(properties['voicequeuechannelredirect'])[_0x50af('0x2')](_0x4bd0b1);if(_0x34cb1a[_0x50af('0x59')]>0x0){return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x34cb1a,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xe9f5ed=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x4bd0b1[_0x50af('0x5f')]});if(_0xe9f5ed&&_0xe9f5ed[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':_0x50af('0x78'),'channel':_0xe9f5ed['channel'],'exten':_0x4bd0b1[_0x50af('0x79')],'context':_0x4bd0b1[_0x50af('0x7a')]||_0xe9f5ed[_0x50af('0x7a')],'priority':0x1})[_0x50af('0x19')](function(_0x2b3d4b){_0x47227c({'code':0xc8,'message':[_0x4bd0b1[_0x50af('0x5f')],_0x2b3d4b['message']['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x2851ab){_0x2eeeb3(_0x2ad059['error'](0x1f5,[_0x4bd0b1[_0x50af('0x5f')],_0x2851ab[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'Agents':function(_0x3758ba){return new Promise(function(_0x4d2c1a,_0x47eb2b){var _0x5605c8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0xe')]);_0x4d2c1a({'count':_0x5605c8['length'],'rows':_0x5605c8});});},'Telephones':function(_0x1d5b0e){return new Promise(function(_0x1cfb8e,_0x39e945){var _0x61d448=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7c')]);_0x1cfb8e({'count':_0x61d448['length'],'rows':_0x61d448});});},'Trunks':function(_0x1b02da){return new Promise(function(_0xa4459a,_0x3d86d2){var _0x265acd=_[_0x50af('0x7b')](_0x1cfefa['trunks']);_0xa4459a({'count':_0x265acd[_0x50af('0x59')],'rows':_0x265acd});});},'OutboundChannels':function(_0x4a99c1){return new Promise(function(_0x199105,_0x43591d){var _0x3928d8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7d')]);_0x199105({'count':_0x3928d8[_0x50af('0x59')],'rows':_0x3928d8});});},'Outbound':function(_0x4e06a5){return new Promise(function(_0x56a41b,_0x2d88e2){_0x56a41b(_0x1cfefa[_0x50af('0x7e')]);});},'Campaigns':function(_0x4bd935){return new Promise(function(_0x3ca112,_0x18ce7c){var _0x2ee04b=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7f')]);_0x3ca112({'count':_0x2ee04b['length'],'rows':_0x2ee04b});});},'VoiceQueuesPreview':function(_0x4b7b41){var _0x1b0660=this;return new Promise(function(_0x2d3516,_0x56c177){_0x4c7210[_0x50af('0x80')](_0x4b7b41['id'])[_0x50af('0x19')](function(_0x207bf8){_0x2d3516({'code':0xc8,'message':_0x207bf8[_0x50af('0x1a')]});})['catch'](function(_0x225ff4){_0x56c177(_0x1b0660[_0x50af('0x12')](0x1f4,_0x225ff4[_0x50af('0x1a')]));});});},'EventManager':function(_0x3a52d1){var _0xa38bfe=this;return new Promise(function(_0x5ca675,_0x121a36){if(!_0x3a52d1[_0x50af('0x81')]){return _0x121a36(_0xa38bfe[_0x50af('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x50af('0x82')](_0x50af('0x83')+_0x3a52d1[_0x50af('0x81')],_0x3a52d1[_0x50af('0x1a')]);_0x5ca675({'code':0xc8,'message':_0x3a52d1});});},'FaxAccounts':function(_0x58212a){return new Promise(function(_0x2f283a,_0x48e889){var _0x42ba29=_['values'](_0x1cfefa['faxAccounts']);_0x2f283a({'count':_0x42ba29[_0x50af('0x59')],'rows':_0x42ba29});});},'SendFax':function(_0x382037){var _0x5fa2f8=this;return new Promise(function(_0x2f7b7a,_0x4ac687){_0xe37b1[_0x50af('0x84')](_0x382037)['then'](function(_0x2e4571){_0x2f7b7a({'code':0xc8,'message':_0x2e4571[_0x50af('0x1a')]});})['catch'](function(_0x398aef){_0x4ac687(_0x5fa2f8[_0x50af('0x12')](0x1f4,_0x398aef[_0x50af('0x1a')]));});});},'CheckAfterSend':function(_0x30106e){var _0x2675e2=this;return new Promise(function(_0xea8e86,_0x2fbe8a){_0xe37b1[_0x50af('0x85')](_0x30106e)[_0x50af('0x19')](function(_0x5ac0b7){_0xea8e86({'code':0xc8,'message':_0x5ac0b7[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0xc1c462){_0x2fbe8a(_0x2675e2['error'](0x1f4,_0xc1c462[_0x50af('0x1a')]));});});}};var _0x1fcc23=jayson[_0x50af('0x86')](_0x3724ed)[_0x50af('0x87')]();_0x1fcc23['on'](_0x50af('0x12'),function(_0x3ae264){return _0x5a5c0a(_0x3ae264);});_0x1fcc23[_0x50af('0x8')](0x232a,_0x50af('0x88'),function(){console['log'](_0x50af('0x89'),0x232a);return _0x5e94f8(_0x50af('0x8a')+0x232a);});});};
\ No newline at end of file
+var _0x627e=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','push','find','omit','undefined','values','channels','isConnected','voicechannel','length','map','uniqueid','channel','format','%s.%s','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','Event\x20name\x20mandatory','custom:','event','faxAccounts','send','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','Command','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod'];(function(_0x11a299,_0x3cd35e){var _0x173db3=function(_0xb31278){while(--_0xb31278){_0x11a299['push'](_0x11a299['shift']());}};_0x173db3(++_0x3cd35e);}(_0x627e,0x14a));var _0xe627=function(_0x533ea2,_0x385192){_0x533ea2=_0x533ea2-0x0;var _0x1a4307=_0x627e[_0x533ea2];return _0x1a4307;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var jayson=require(_0xe627('0x2'));var schema=require(_0xe627('0x3'));var BPromise=require(_0xe627('0x4'));var moment=require('moment');var config=require(_0xe627('0x5'));var properties=require(_0xe627('0x6'));var ami=require(_0xe627('0x7'));exports['listen']=function(_0x52923f,_0x4efcad,_0x1a1a3d){return new BPromise(function(_0x3f2791,_0x45e49a){var _0x2d4f63={'QueuePause':function(_0xd5016e){return new Promise(function(_0xe065b,_0x4bae52){var _0x3f2948=util['format']('%s/%s',_0xe627('0x8'),_0xd5016e[_0xe627('0x9')]);if(_0x52923f['timers']&&_0x52923f['timers'][_0x3f2948]&&_0x52923f[_0xe627('0xa')][_0x3f2948][_0xe627('0xb')]){_0x52923f[_0xe627('0xa')][_0x3f2948][_0xe627('0xc')]();}if(_0x52923f[_0xe627('0xd')][_0x3f2948]){_0x52923f[_0xe627('0xd')][_0x3f2948][_0xe627('0xe')]({'statePause':_0xd5016e[_0xe627('0xf')]?!![]:![]});}_0xe065b({'code':0xc8,'message':_0xe627('0x10')});});},'Reload':function(_0x582190){var _0x419fdf=this;return new Promise(function(_0x1983f8,_0x9f7eef){if(ami['isConnected']()==![]){return _0x9f7eef(_0x419fdf[_0xe627('0x11')](0x1f4,[config[_0xe627('0x12')]['ip'],config[_0xe627('0x12')][_0xe627('0x13')],_0xe627('0x14')][_0xe627('0x15')]('\x20')));}_0x582190=_[_0xe627('0x16')](_0x582190,_['keys'](properties[_0xe627('0x17')]));_0x582190[_0xe627('0x18')]=_0xe627('0x19');return ami[_0xe627('0x1a')](_0x582190)[_0xe627('0x1b')](function(_0x30da02){_0x1983f8({'code':0xc8,'message':_0x30da02[_0xe627('0x1c')]});})[_0xe627('0x1d')](function(_0x538b22){_0x9f7eef(_0x419fdf[_0xe627('0x11')](0x1f5,_0x538b22['message']));});});},'Command':function(_0x2a4c68){var _0x565213=this;return new Promise(function(_0x4d8881,_0x3dde00){if(ami['isConnected']()==![]){return _0x3dde00(_0x565213[_0xe627('0x11')](0x1f4,[config[_0xe627('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xe627('0x15')]('\x20')));}_0x2a4c68=_[_0xe627('0x16')](_0x2a4c68,'command');_0x2a4c68[_0xe627('0x18')]=_0xe627('0x1e');return ami['Action'](_0x2a4c68)[_0xe627('0x1b')](function(_0x29221b){_0x4d8881({'code':0xc8,'message':_0x29221b['content']});})[_0xe627('0x1d')](function(_0x19adbc){_0x3dde00(_0x565213[_0xe627('0x11')](0x1f5,_0x19adbc['message']));});});},'VoiceQueues':function(_0x2093c5){return new Promise(function(_0x313b03,_0x1a5081){var _0x3ddd8d=[];for(var _0x4b9ff9 in _0x52923f[_0xe627('0x1f')]){if(_0x52923f[_0xe627('0x1f')][_0xe627('0x20')](_0x4b9ff9)){var _0x29eb8e=_0x52923f[_0xe627('0x1f')][_0x4b9ff9];var _0x40ab91={'id':_0x29eb8e['id'],'name':_0x29eb8e[_0xe627('0x9')],'strategy':_0x29eb8e[_0xe627('0x21')],'answered':_0x29eb8e[_0xe627('0x22')],'available':_0x29eb8e['available'],'loggedIn':_0x29eb8e[_0xe627('0x23')],'pTalking':_0x29eb8e['pTalking'],'sumBillable':_0x29eb8e['sumBillable'],'sumDuration':_0x29eb8e[_0xe627('0x24')],'sumHoldTime':_0x29eb8e[_0xe627('0x25')]||0x0,'talking':_0x29eb8e['talking'],'total':_0x29eb8e[_0xe627('0x26')],'type':_0x29eb8e['type'],'unmanaged':_0x29eb8e[_0xe627('0x27')],'abandoned':_0x29eb8e['abandoned'],'waiting':_0x29eb8e[_0xe627('0x28')],'loggedInDb':_0x29eb8e[_0xe627('0x29')]};if(_0x29eb8e['type']===_0xe627('0x2a')){_0x40ab91['dialActive']=_0x29eb8e[_0xe627('0x2b')];_0x40ab91[_0xe627('0x2c')]=_0x29eb8e[_0xe627('0x2c')];_0x40ab91[_0xe627('0x2d')]=_0x29eb8e[_0xe627('0x2d')];_0x40ab91[_0xe627('0x2e')]=_0x29eb8e[_0xe627('0x2e')];_0x40ab91[_0xe627('0x2f')]=_0x29eb8e[_0xe627('0x2f')];_0x40ab91[_0xe627('0x30')]=_0x29eb8e[_0xe627('0x30')];_0x40ab91['temp']=_0x29eb8e['temp'];_0x40ab91[_0xe627('0x31')]=_0x29eb8e['outboundAnswerAgiCallsDay'];_0x40ab91[_0xe627('0x32')]=_0x29eb8e['outboundAnswerCallsDay'];_0x40ab91['outboundBlacklistCallsDay']=_0x29eb8e[_0xe627('0x33')];_0x40ab91['outboundBusyCallsDay']=_0x29eb8e['outboundBusyCallsDay'];_0x40ab91[_0xe627('0x34')]=_0x29eb8e[_0xe627('0x34')];_0x40ab91[_0xe627('0x35')]=_0x29eb8e['outboundDropCallsDayACS'];_0x40ab91['outboundDropCallsDayCallersExit']=_0x29eb8e['outboundDropCallsDayCallersExit'];_0x40ab91[_0xe627('0x36')]=_0x29eb8e['outboundDropCallsDayTimeout'];_0x40ab91[_0xe627('0x37')]=_0x29eb8e[_0xe627('0x37')];_0x40ab91['outboundNoSuchCallsDay']=_0x29eb8e[_0xe627('0x38')];_0x40ab91[_0xe627('0x39')]=_0x29eb8e['outboundOriginateFailureCallsDay'];_0x40ab91[_0xe627('0x3a')]=_0x29eb8e[_0xe627('0x3a')];_0x40ab91[_0xe627('0x3b')]=_0x29eb8e[_0xe627('0x3b')];_0x40ab91[_0xe627('0x3c')]=_0x29eb8e[_0xe627('0x3c')];_0x40ab91['predictiveIntervalAnsweredCalls']=_0x29eb8e[_0xe627('0x3d')];_0x40ab91['predictiveIntervalAvgHoldtime']=_0x29eb8e[_0xe627('0x3e')];_0x40ab91['predictiveIntervalAvgTalktime']=_0x29eb8e[_0xe627('0x3f')];_0x40ab91[_0xe627('0x40')]=_0x29eb8e[_0xe627('0x40')];_0x40ab91[_0xe627('0x41')]=_0x29eb8e[_0xe627('0x41')];_0x40ab91[_0xe627('0x42')]=_0x29eb8e[_0xe627('0x42')];_0x40ab91[_0xe627('0x43')]=_0x29eb8e[_0xe627('0x43')];_0x40ab91[_0xe627('0x44')]=_0x29eb8e[_0xe627('0x44')];_0x40ab91[_0xe627('0x45')]=_0x29eb8e[_0xe627('0x45')];_0x40ab91['predictiveIntervalPauses']=_0x29eb8e['predictiveIntervalPauses'];_0x40ab91['predictiveIntervalAvailable']=_0x29eb8e['predictiveIntervalAvailable'];_0x40ab91['predictiveIntervalTotalCalls']=_0x29eb8e['predictiveIntervalTotalCalls'];_0x40ab91[_0xe627('0x1c')]=_0x29eb8e['message'];_0x40ab91[_0xe627('0x46')]=_0x29eb8e['originated'];_0x40ab91[_0xe627('0x47')]=_0x29eb8e[_0xe627('0x47')];_0x40ab91[_0xe627('0x48')]=_0x29eb8e['erlangCallToSecond'];_0x40ab91['erlangAbandonmentRate']=_0x29eb8e[_0xe627('0x49')];_0x40ab91['erlangBusyFactor']=_0x29eb8e['erlangBusyFactor'];_0x40ab91[_0xe627('0x4a')]=_0x29eb8e['startPredictive'];_0x40ab91[_0xe627('0x4b')]=_0x29eb8e['startProgressive'];}if(_0x29eb8e['Trunk']){_0x40ab91[_0xe627('0x4c')]={'id':_0x29eb8e[_0xe627('0x4c')]['id'],'name':_0x29eb8e[_0xe627('0x4c')]['name'],'active':_0x29eb8e['Trunk'][_0xe627('0x4d')],'callerid':_0x29eb8e['Trunk']['callerid']};}if(_0x29eb8e[_0xe627('0x4e')]){_0x40ab91[_0xe627('0x4e')]={'id':_0x29eb8e[_0xe627('0x4e')]['id'],'name':_0x29eb8e[_0xe627('0x4e')][_0xe627('0x9')]};}_0x3ddd8d[_0xe627('0x4f')](_0x40ab91);}}_0x313b03({'count':_0x3ddd8d['length'],'rows':_0x3ddd8d});});},'UpdateVoiceQueue':function(_0x7e0476){return new Promise(function(_0xbf5fa3,_0x4c74a1){var _0x5d08e9=_[_0xe627('0x50')](_0x52923f[_0xe627('0x1f')],{'id':parseInt(_0x7e0476['id'])});var _0x1f6ee5=_[_0xe627('0x51')](_0x7e0476,['id']);if(_0x5d08e9){for(var _0x152076 in _0x1f6ee5){if(typeof _0x1f6ee5[_0x152076]!==_0xe627('0x52')&&typeof _0x5d08e9[_0x152076]!==_0xe627('0x52')){_0x5d08e9[_0x152076]=_0x1f6ee5[_0x152076];}}_0xbf5fa3(_0x5d08e9);}else{_0x4c74a1();}});},'VoiceChannels':function(_0x4e0b50){return new Promise(function(_0x97c5bf,_0x5dbdae){var _0x648456=_[_0xe627('0x53')](_0x52923f[_0xe627('0x54')]);_0x97c5bf({'count':_0x648456['length'],'rows':_0x648456});});},'VoiceChannelMixMonitor':function(_0x3ba3ed){var _0x5da478=this;return new Promise(function(_0x28d954,_0xbacc81){if(ami[_0xe627('0x55')]()==![]){return _0xbacc81(_0x5da478[_0xe627('0x11')](0x1f4,[config[_0xe627('0x12')]['ip'],config['asterisk'][_0xe627('0x13')],_0xe627('0x14')][_0xe627('0x15')]('\x20')));}var _0x386c1d=schema(properties[_0xe627('0x56')])[_0xe627('0x3')](_0x3ba3ed);if(_0x386c1d[_0xe627('0x57')]>0x0){return _0xbacc81(_0x5da478[_0xe627('0x11')](0x1f4,_[_0xe627('0x58')](_0x386c1d,_0xe627('0x1c'))['join'](',\x20')));}var _0x33f40b=_[_0xe627('0x50')](_0x52923f['channels'],{'uniqueid':_0x3ba3ed[_0xe627('0x59')]});if(_0x33f40b&&_0x33f40b[_0xe627('0x5a')]){var _0x4fc52c=util[_0xe627('0x5b')](_0xe627('0x5c'),_0x3ba3ed['filename']||_0x3ba3ed[_0xe627('0x59')],_0x3ba3ed[_0xe627('0x5b')]||'wav');return ami[_0xe627('0x1a')]({'action':'MixMonitor','channel':_0x33f40b['channel'],'file':_0x4fc52c,'options':'ai(mixmonitorid)'})['then'](function(_0x5ce19d){var _0x256b65=_[_0xe627('0x50')](_0x33f40b[_0xe627('0x5d')],{'filename':_0xe627('0x5e')+_0x4fc52c[_0xe627('0x5f')]()});if(_[_0xe627('0x60')](_0x256b65)){_0x33f40b['monitors'][_0xe627('0x4f')]({'filename':_0xe627('0x5e')+_0x4fc52c['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5ce19d[_0xe627('0x61')],'status':_0xe627('0x62')});}else{_0x256b65[_0xe627('0x61')]=_0x5ce19d[_0xe627('0x61')];_0x256b65[_0xe627('0x63')]=_0xe627('0x62');}_0x28d954({'code':0xc8,'message':[_0x3ba3ed[_0xe627('0x59')],_0xe627('0x64'),_0x5ce19d['mixmonitorid']][_0xe627('0x15')]('\x20'),'mixmonitorid':_0x5ce19d['mixmonitorid']});})[_0xe627('0x1d')](function(_0x552bea){_0xbacc81(_0x5da478[_0xe627('0x11')](0x1f5,[_0x3ba3ed[_0xe627('0x59')],_0x552bea[_0xe627('0x1c')][_0xe627('0x5f')]()][_0xe627('0x15')]('\x20')));});}else{return _0xbacc81(_0x5da478[_0xe627('0x11')](0x1f5,_0xe627('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x36c13e){var _0x1f0d6c=this;return new Promise(function(_0x480ac3,_0xe4c06d){if(ami[_0xe627('0x55')]()==![]){return _0xe4c06d(_0x1f0d6c[_0xe627('0x11')](0x1f4,[config[_0xe627('0x12')]['ip'],config[_0xe627('0x12')]['username'],'ami\x20disconnected'][_0xe627('0x15')]('\x20')));}var _0x2e787e=schema(properties['voicechannel'])[_0xe627('0x3')](_0x36c13e);if(_0x2e787e[_0xe627('0x57')]>0x0){return _0xe4c06d(_0x1f0d6c[_0xe627('0x11')](0x1f4,_[_0xe627('0x58')](_0x2e787e,_0xe627('0x1c'))[_0xe627('0x15')](',\x20')));}var _0x351763=_[_0xe627('0x50')](_0x52923f['channels'],{'uniqueid':_0x36c13e[_0xe627('0x59')]});if(_0x351763){return BPromise['resolve']()[_0xe627('0x1b')](function(){if(_0x351763[_0xe627('0x5a')]){return ami[_0xe627('0x1a')]({'action':_0xe627('0x66'),'channel':_0x351763['channel'],'mixmonitorid':_0x36c13e['mixmonitorid']})[_0xe627('0x1d')](function(_0x266b11){});}})['then'](function(){if(_0x351763[_0xe627('0x67')]){return ami[_0xe627('0x1a')]({'action':'StopMixMonitor','channel':_0x351763[_0xe627('0x67')],'mixmonitorid':_0x36c13e[_0xe627('0x61')]})['catch'](function(_0x4ba652){});}})[_0xe627('0x1b')](function(_0x5eb04f){var _0x43e247=_[_0xe627('0x50')](_0x351763[_0xe627('0x5d')],{'mixmonitorid':_0x36c13e['mixmonitorid']});if(_0x43e247){_0x43e247[_0xe627('0x63')]=_0xe627('0x68');}})[_0xe627('0x1b')](function(){var _0x4521ab=util['format']('%s.%s',_0x36c13e[_0xe627('0x69')]||_0x36c13e[_0xe627('0x59')],_0x36c13e['format']||_0xe627('0x6a'));var _0x48236e=_['find'](_0x351763[_0xe627('0x5d')],{'filename':_0xe627('0x5e')+_0x4521ab['toLowerCase']()});if(_0x48236e){_0x48236e['status']=_0xe627('0x68');}})[_0xe627('0x1b')](function(){_0x480ac3({'code':0xc8,'message':[_0x36c13e[_0xe627('0x59')],_0xe627('0x6b')][_0xe627('0x15')]('\x20')});})[_0xe627('0x1d')](function(_0x4b4b6c){_0xe4c06d(_0x1f0d6c['error'](0x1f5,[_0x36c13e['uniqueid'],_0x4b4b6c[_0xe627('0x1c')][_0xe627('0x5f')]()]['join']('\x20')));});}else{return _0xe4c06d(_0x1f0d6c[_0xe627('0x11')](0x1f5,_0xe627('0x65')));}});},'VoiceQueuesChannels':function(_0x33b7b6){return new Promise(function(_0x281ddd,_0x51258f){var _0xf62c81=_[_0xe627('0x53')](_0x52923f[_0xe627('0x6c')]);_0x281ddd({'count':_0xf62c81[_0xe627('0x57')],'rows':_0xf62c81});});},'VoiceQueuesChannel':function(_0x574837){var _0x36b75a=this;return new Promise(function(_0x18b504,_0x1bef89){var _0x4c6099=schema(properties['voicequeuechannel'])['validate'](_0x574837);if(_0x4c6099['length']>0x0){return _0x1bef89(_0x36b75a['error'](0x1f4,_[_0xe627('0x58')](_0x4c6099,_0xe627('0x1c'))[_0xe627('0x15')](',\x20')));}var _0xb2a065=_[_0xe627('0x50')](_0x52923f[_0xe627('0x6c')],{'uniqueid':_0x574837['uniqueid']});if(_0xb2a065){_0x18b504(_0xb2a065);}else{return _0x1bef89(_0x36b75a[_0xe627('0x11')](0x1f5,_0xe627('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x438bea){var _0x1a7d79=this;return new Promise(function(_0x3394ee,_0x53670d){if(ami['isConnected']()==![]){return _0x53670d(_0x1a7d79['error'](0x1f4,[config[_0xe627('0x12')]['ip'],config[_0xe627('0x12')]['username'],_0xe627('0x14')][_0xe627('0x15')]('\x20')));}var _0x139e31=schema(properties[_0xe627('0x6d')])['validate'](_0x438bea);if(_0x139e31['length']>0x0){return _0x53670d(_0x1a7d79[_0xe627('0x11')](0x1f4,_['map'](_0x139e31,_0xe627('0x1c'))[_0xe627('0x15')](',\x20')));}var _0xc79cab=_['find'](_0x52923f['queueChannels'],{'uniqueid':_0x438bea[_0xe627('0x59')]});if(_0xc79cab&&_0xc79cab['channel']){return ami['Action']({'action':'Hangup','channel':_0xc79cab[_0xe627('0x5a')]})[_0xe627('0x1b')](function(_0x4eebb7){_0x3394ee({'code':0xc8,'message':[_0x438bea[_0xe627('0x59')],_0x4eebb7[_0xe627('0x1c')]['toLowerCase']()][_0xe627('0x15')]('\x20')});})[_0xe627('0x1d')](function(_0x1ec81a){_0x53670d(_0x1a7d79[_0xe627('0x11')](0x1f5,[_0x438bea[_0xe627('0x59')],_0x1ec81a[_0xe627('0x1c')]['toLowerCase']()][_0xe627('0x15')]('\x20')));});}else{return _0x53670d(_0x1a7d79[_0xe627('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x14459f){var _0x9d4335=this;return new Promise(function(_0x4e477e,_0x2a5757){if(ami[_0xe627('0x55')]()==![]){return _0x2a5757(_0x9d4335[_0xe627('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xe627('0x13')],_0xe627('0x14')][_0xe627('0x15')]('\x20')));}var _0x17cdc5=schema(properties[_0xe627('0x6e')])[_0xe627('0x3')](_0x14459f);if(_0x17cdc5[_0xe627('0x57')]>0x0){return _0x2a5757(_0x9d4335[_0xe627('0x11')](0x1f4,_[_0xe627('0x58')](_0x17cdc5,_0xe627('0x1c'))[_0xe627('0x15')](',\x20')));}var _0x554ac2=_[_0xe627('0x50')](_0x52923f[_0xe627('0x6c')],{'uniqueid':_0x14459f[_0xe627('0x59')]});if(_0x554ac2&&_0x554ac2[_0xe627('0x5a')]){return ami[_0xe627('0x1a')]({'action':_0xe627('0x6f'),'channel':_0x554ac2[_0xe627('0x5a')],'exten':_0x14459f['exten'],'context':_0x14459f[_0xe627('0x70')]||_0x554ac2[_0xe627('0x70')],'priority':0x1})[_0xe627('0x1b')](function(_0x54d9ed){_0x4e477e({'code':0xc8,'message':[_0x14459f[_0xe627('0x59')],_0x54d9ed['message']['toLowerCase']()][_0xe627('0x15')]('\x20')});})[_0xe627('0x1d')](function(_0x203e4e){_0x2a5757(_0x9d4335['error'](0x1f5,[_0x14459f[_0xe627('0x59')],_0x203e4e[_0xe627('0x1c')]['toLowerCase']()][_0xe627('0x15')]('\x20')));});}else{return _0x2a5757(_0x9d4335['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2b2624){return new Promise(function(_0x1df7d7,_0x3ae47b){var _0x57e9de=_[_0xe627('0x53')](_0x52923f[_0xe627('0xd')]);_0x1df7d7({'count':_0x57e9de[_0xe627('0x57')],'rows':_0x57e9de});});},'Telephones':function(_0x297c54){return new Promise(function(_0x401385,_0x55b30f){var _0x339996=_[_0xe627('0x53')](_0x52923f[_0xe627('0x71')]);_0x401385({'count':_0x339996[_0xe627('0x57')],'rows':_0x339996});});},'Trunks':function(_0x4658b4){return new Promise(function(_0x46b38b,_0xc0dfdc){var _0x155f3d=_[_0xe627('0x53')](_0x52923f[_0xe627('0x72')]);_0x46b38b({'count':_0x155f3d['length'],'rows':_0x155f3d});});},'OutboundChannels':function(_0x5ce0f8){return new Promise(function(_0x38643f,_0x29ffbf){var _0x5f33e1=_[_0xe627('0x53')](_0x52923f[_0xe627('0x73')]);_0x38643f({'count':_0x5f33e1[_0xe627('0x57')],'rows':_0x5f33e1});});},'Outbound':function(_0xecf0fa){return new Promise(function(_0x2dbd02,_0x16c60d){_0x2dbd02(_0x52923f[_0xe627('0x2a')]);});},'Campaigns':function(_0xbe1695){return new Promise(function(_0x2b1e02,_0x257d29){var _0x500513=_[_0xe627('0x53')](_0x52923f[_0xe627('0x74')]);_0x2b1e02({'count':_0x500513['length'],'rows':_0x500513});});},'VoiceQueuesPreview':function(_0x1f0710){var _0x897afc=this;return new Promise(function(_0x305b91,_0x5a269e){_0x4efcad['run'](_0x1f0710['id'])[_0xe627('0x1b')](function(_0x5aa187){_0x305b91({'code':0xc8,'message':_0x5aa187[_0xe627('0x1c')]});})[_0xe627('0x1d')](function(_0x437d33){_0x5a269e(_0x897afc['error'](0x1f4,_0x437d33[_0xe627('0x1c')]));});});},'EventManager':function(_0x510d94){var _0x476887=this;return new Promise(function(_0x476bdb,_0xdcffdd){if(!_0x510d94['event']){return _0xdcffdd(_0x476887[_0xe627('0x11')](0x1f4,_0xe627('0x75')));}ami['emit'](_0xe627('0x76')+_0x510d94[_0xe627('0x77')],_0x510d94[_0xe627('0x1c')]);_0x476bdb({'code':0xc8,'message':_0x510d94});});},'FaxAccounts':function(_0x5acb13){return new Promise(function(_0x35f767,_0x4e4ff0){var _0x5d5aaa=_[_0xe627('0x53')](_0x52923f[_0xe627('0x78')]);_0x35f767({'count':_0x5d5aaa[_0xe627('0x57')],'rows':_0x5d5aaa});});},'SendFax':function(_0x46e8d7){var _0x221bfc=this;return new Promise(function(_0x17ca45,_0x5c424a){_0x1a1a3d[_0xe627('0x79')](_0x46e8d7)[_0xe627('0x1b')](function(_0x35d676){_0x17ca45({'code':0xc8,'message':_0x35d676[_0xe627('0x1c')]});})['catch'](function(_0x33a6f){_0x5c424a(_0x221bfc[_0xe627('0x11')](0x1f4,_0x33a6f[_0xe627('0x1c')]));});});},'CheckAfterSend':function(_0x1b690f){var _0x2d23de=this;return new Promise(function(_0x171bbb,_0x142754){_0x1a1a3d['checkAfterSend'](_0x1b690f)['then'](function(_0x5f5353){_0x171bbb({'code':0xc8,'message':_0x5f5353[_0xe627('0x1c')]});})[_0xe627('0x1d')](function(_0x5ce153){_0x142754(_0x2d23de[_0xe627('0x11')](0x1f4,_0x5ce153[_0xe627('0x1c')]));});});}};var _0x5ca695=jayson['server'](_0x2d4f63)['http']();_0x5ca695['on'](_0xe627('0x11'),function(_0x182ac3){return _0x45e49a(_0x182ac3);});_0x5ca695['listen'](0x232a,_0xe627('0x7a'),function(){console['log'](_0xe627('0x7b'),0x232a);return _0x3f2791(_0xe627('0x7c')+0x232a);});});};
\ No newline at end of file
index 689992d..ba78e7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dc4=['<unknown>','Unknown','destcalleridname','then','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','length','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','resolve','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','isNil','calleridname'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x7dc4,0xe9));var _0x47dc=function(_0x39cabf,_0xa08eec){_0x39cabf=_0x39cabf-0x0;var _0x33fd1c=_0x7dc4[_0x39cabf];return _0x33fd1c;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x47dc('0x0'));var util=require(_0x47dc('0x1'));var config=require(_0x47dc('0x2'));var logger=require(_0x47dc('0x3'))(_0x47dc('0x4'));var cmContactRpc=require(_0x47dc('0x5'));config['redis']=_['defaults'](config[_0x47dc('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x47dc('0x7'))(new Redis(config['redis']));function emit(_0x2eef69,_0x415245,_0x1404a7,_0x5f1fc9,_0x21be76){logger[_0x47dc('0x8')](_0x47dc('0x9'),_0x2eef69,_0x415245['id'],_0x1404a7,_0x5f1fc9,JSON[_0x47dc('0xa')](_0x21be76));io['to'](_0x1404a7)[_0x47dc('0xb')](_0x5f1fc9,_0x21be76);}exports[_0x47dc('0xc')]=function(_0x1dff89,_0x22561d,_0x5749f6,_0x11e631){var _0x2a0c64,_0x17cdf2;var _0x2020f7={};var _0x13a111=Number(_0x5749f6[_0x47dc('0xd')]);var _0x398326=_0x5749f6[_0x47dc('0xe')]?Boolean(Number(_0x5749f6[_0x47dc('0xe')])):![];var _0xda0bb8;if(_0x11e631[_0x47dc('0xf')]){_0x2020f7['id']=_0x11e631[_0x47dc('0xf')];}if(!_0x2020f7['id']){_0x2020f7[_0x47dc('0x10')]=_0x13a111;_0xda0bb8=_0x5749f6['data3']&&_0x5749f6[_0x47dc('0x11')]!=='0'?_0x5749f6[_0x47dc('0x11')][_0x47dc('0x12')](','):[_0x47dc('0x13')];_0x2020f7[_0x47dc('0x14')]=_[_0x47dc('0x15')](_0xda0bb8,function(_0x441a96){var _0x35e9d2={};_0x35e9d2[_0x441a96]=_0x11e631[_0x47dc('0x16')]?_0x11e631[_0x47dc('0x17')]:_0x11e631['calleridnum'];return _0x35e9d2;});}var _0x3f3889=['id',_0x47dc('0x18'),_0x47dc('0x19'),_0x47dc('0x13'),_0x47dc('0x1a'),'fax',_0x47dc('0x10'),_0x47dc('0x1b'),_0x47dc('0x1c'),_0x47dc('0x1d')];var _0x223eba=_['union'](_0x3f3889,_0xda0bb8);BPromise[_0x47dc('0x1e')]()['then'](cmContactRpc[_0x47dc('0x1f')]({'attributes':_0x223eba,'where':_0x2020f7}))['then'](function(_0x24e6e5){_0x17cdf2=_0x24e6e5;if(!_[_0x47dc('0x20')](_0x17cdf2)){if(_0x17cdf2['length']===0x1){_0x2a0c64=_0x17cdf2[0x0];logger[_0x47dc('0x8')](_0x47dc('0x21'),_0x11e631[_0x47dc('0x22')],_0x22561d['id'],_0x2a0c64['id']);}else{logger[_0x47dc('0x8')](_0x47dc('0x23'),_0x11e631[_0x47dc('0x22')],_0x22561d['id'],_['map'](_0x17cdf2,'id')[_0x47dc('0x24')](','));}return;}else{logger[_0x47dc('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x11e631['uniqueid'],_0x22561d['id']);var _0x3482f9={'ListId':_0x13a111};var _0x364f22=_0x5749f6[_0x47dc('0x25')]&&_0x5749f6[_0x47dc('0x25')]!=='0'?_0x5749f6['data4']:_0x47dc('0x13');if(_0x398326){logger[_0x47dc('0x8')](_0x47dc('0x26'),_0x11e631[_0x47dc('0x22')],_0x22561d['id']);_0x3482f9[_0x364f22]=_['isNil'](_0x11e631['routeId'])?_0x11e631[_0x47dc('0x27')]:_0x11e631[_0x47dc('0x17')];if(_[_0x47dc('0x28')](_0x11e631[_0x47dc('0x16')])){_0x3482f9[_0x47dc('0x18')]=_0x11e631[_0x47dc('0x29')]&&_0x11e631['calleridname']!==_0x47dc('0x2a')?_0x11e631[_0x47dc('0x29')]:_0x47dc('0x2b');}else{_0x3482f9['firstName']=_0x11e631[_0x47dc('0x2c')]&&_0x11e631[_0x47dc('0x2c')]!==_0x47dc('0x2a')?_0x11e631[_0x47dc('0x2c')]:_0x47dc('0x2b');}return BPromise[_0x47dc('0x1e')]()[_0x47dc('0x2d')](cmContactRpc[_0x47dc('0x2e')](_0x3482f9))['then'](function(_0x19eafe){_0x2a0c64=_0x19eafe;_0x17cdf2[_0x47dc('0x2f')](_0x19eafe);if(_0x2a0c64){logger[_0x47dc('0x8')](_0x47dc('0x30'),_0x11e631[_0x47dc('0x22')],_0x22561d['id'],_0x2a0c64['id']);}return;});}else{logger['info'](_0x47dc('0x31'),_0x11e631['uniqueid'],_0x22561d['id']);_0x3482f9[_0x364f22]=_[_0x47dc('0x28')](_0x11e631[_0x47dc('0x16')])?_0x11e631[_0x47dc('0x27')]:_0x11e631['destcalleridnum'];if(_['isNil'](_0x11e631[_0x47dc('0x16')])){_0x3482f9['firstName']=_0x11e631[_0x47dc('0x29')]&&_0x11e631[_0x47dc('0x29')]!=='<unknown>'?_0x11e631['calleridname']:_0x47dc('0x2b');}else{_0x3482f9[_0x47dc('0x18')]=_0x11e631[_0x47dc('0x2c')]&&_0x11e631[_0x47dc('0x2c')]!=='<unknown>'?_0x11e631[_0x47dc('0x2c')]:'Unknown';}_0x2a0c64=_0x3482f9;_0x17cdf2[_0x47dc('0x2f')](_0x3482f9);return;}}})[_0x47dc('0x2d')](function(){if(_0x1dff89){emit(_0x11e631[_0x47dc('0x22')],_0x22561d,util[_0x47dc('0x32')]('user:%s',_0x1dff89[_0x47dc('0x33')]),util[_0x47dc('0x32')](_0x47dc('0x34'),_0x5749f6[_0x47dc('0x35')]['toLowerCase']()),{'evt':_['merge'](_0x11e631,{'autoCreate':_0x398326}),'contact':_0x2a0c64===undefined?{}:_0x2a0c64,'contacts':_0x17cdf2[_0x47dc('0x36')]===0x0?undefined:_0x17cdf2});}});};
\ No newline at end of file
+var _0xc4a5=['../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridnum','calleridname','Unknown','destcalleridname','<unknown>','createContact','[CM][%s][%s]\x20Contact\x20created:%s','push','format','name','trigger:%s','action','toLowerCase','merge','ioredis','util'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xc4a5,0x1ed));var _0x5c4a=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xc4a5[_0x485b5a];return _0xd2b34d;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x5c4a('0x0'));var util=require(_0x5c4a('0x1'));var config=require(_0x5c4a('0x2'));var logger=require(_0x5c4a('0x3'))(_0x5c4a('0x4'));var cmContactRpc=require(_0x5c4a('0x5'));config[_0x5c4a('0x6')]=_[_0x5c4a('0x7')](config[_0x5c4a('0x6')],{'host':_0x5c4a('0x8'),'port':0x18eb});var io=require(_0x5c4a('0x9'))(new Redis(config[_0x5c4a('0x6')]));function emit(_0x16d711,_0x4b8dd5,_0x23543c,_0x16f171,_0xc703c6){logger[_0x5c4a('0xa')](_0x5c4a('0xb'),_0x16d711,_0x4b8dd5['id'],_0x23543c,_0x16f171,JSON[_0x5c4a('0xc')](_0xc703c6));io['to'](_0x23543c)[_0x5c4a('0xd')](_0x16f171,_0xc703c6);}exports[_0x5c4a('0xe')]=function(_0x185c1c,_0x2b1358,_0x5eb4f6,_0x4dc660){var _0x37ab87,_0x415671;var _0x32c696={};var _0xefbb84=Number(_0x5eb4f6['data1']);var _0x3b8007=_0x5eb4f6[_0x5c4a('0xf')]?Boolean(Number(_0x5eb4f6[_0x5c4a('0xf')])):![];var _0x2d00fe;if(_0x4dc660[_0x5c4a('0x10')]){_0x32c696['id']=_0x4dc660[_0x5c4a('0x10')];}if(!_0x32c696['id']){_0x32c696[_0x5c4a('0x11')]=_0xefbb84;_0x2d00fe=_0x5eb4f6[_0x5c4a('0x12')]&&_0x5eb4f6['data3']!=='0'?_0x5eb4f6['data3']['split'](','):[_0x5c4a('0x13')];_0x32c696[_0x5c4a('0x14')]=_['map'](_0x2d00fe,function(_0x463391){var _0xa03e5c={};_0xa03e5c[_0x463391]=_0x4dc660[_0x5c4a('0x15')]?_0x4dc660[_0x5c4a('0x16')]:_0x4dc660['calleridnum'];return _0xa03e5c;});}var _0x2929fa=['id',_0x5c4a('0x17'),_0x5c4a('0x18'),_0x5c4a('0x13'),_0x5c4a('0x19'),_0x5c4a('0x1a'),_0x5c4a('0x11'),_0x5c4a('0x1b'),'scheduledAt',_0x5c4a('0x1c')];var _0x3d3541=_['union'](_0x2929fa,_0x2d00fe);BPromise[_0x5c4a('0x1d')]()[_0x5c4a('0x1e')](cmContactRpc[_0x5c4a('0x1f')]({'attributes':_0x3d3541,'where':_0x32c696}))['then'](function(_0xa5eae8){_0x415671=_0xa5eae8;if(!_[_0x5c4a('0x20')](_0x415671)){if(_0x415671[_0x5c4a('0x21')]===0x1){_0x37ab87=_0x415671[0x0];logger[_0x5c4a('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id'],_0x37ab87['id']);}else{logger['info'](_0x5c4a('0x23'),_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id'],_[_0x5c4a('0x24')](_0x415671,'id')[_0x5c4a('0x25')](','));}return;}else{logger[_0x5c4a('0xa')](_0x5c4a('0x26'),_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id']);var _0x172dd6={'ListId':_0xefbb84};var _0x14ee49=_0x5eb4f6[_0x5c4a('0x27')]&&_0x5eb4f6[_0x5c4a('0x27')]!=='0'?_0x5eb4f6[_0x5c4a('0x27')]:_0x5c4a('0x13');if(_0x3b8007){logger[_0x5c4a('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id']);_0x172dd6[_0x14ee49]=_[_0x5c4a('0x28')](_0x4dc660['routeId'])?_0x4dc660[_0x5c4a('0x29')]:_0x4dc660[_0x5c4a('0x16')];if(_[_0x5c4a('0x28')](_0x4dc660[_0x5c4a('0x15')])){_0x172dd6[_0x5c4a('0x17')]=_0x4dc660[_0x5c4a('0x2a')]&&_0x4dc660[_0x5c4a('0x2a')]!=='<unknown>'?_0x4dc660[_0x5c4a('0x2a')]:_0x5c4a('0x2b');}else{_0x172dd6[_0x5c4a('0x17')]=_0x4dc660[_0x5c4a('0x2c')]&&_0x4dc660[_0x5c4a('0x2c')]!==_0x5c4a('0x2d')?_0x4dc660[_0x5c4a('0x2c')]:'Unknown';}return BPromise[_0x5c4a('0x1d')]()[_0x5c4a('0x1e')](cmContactRpc[_0x5c4a('0x2e')](_0x172dd6))[_0x5c4a('0x1e')](function(_0x4e3816){_0x37ab87=_0x4e3816;_0x415671['push'](_0x4e3816);if(_0x37ab87){logger[_0x5c4a('0xa')](_0x5c4a('0x2f'),_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id'],_0x37ab87['id']);}return;});}else{logger[_0x5c4a('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4dc660[_0x5c4a('0x22')],_0x2b1358['id']);_0x172dd6[_0x14ee49]=_['isNil'](_0x4dc660[_0x5c4a('0x15')])?_0x4dc660[_0x5c4a('0x29')]:_0x4dc660[_0x5c4a('0x16')];if(_['isNil'](_0x4dc660[_0x5c4a('0x15')])){_0x172dd6[_0x5c4a('0x17')]=_0x4dc660[_0x5c4a('0x2a')]&&_0x4dc660['calleridname']!=='<unknown>'?_0x4dc660['calleridname']:_0x5c4a('0x2b');}else{_0x172dd6[_0x5c4a('0x17')]=_0x4dc660[_0x5c4a('0x2c')]&&_0x4dc660[_0x5c4a('0x2c')]!==_0x5c4a('0x2d')?_0x4dc660[_0x5c4a('0x2c')]:_0x5c4a('0x2b');}_0x37ab87=_0x172dd6;_0x415671[_0x5c4a('0x30')](_0x172dd6);return;}}})['then'](function(){if(_0x185c1c){emit(_0x4dc660['uniqueid'],_0x2b1358,util[_0x5c4a('0x31')]('user:%s',_0x185c1c[_0x5c4a('0x32')]),util[_0x5c4a('0x31')](_0x5c4a('0x33'),_0x5eb4f6[_0x5c4a('0x34')][_0x5c4a('0x35')]()),{'evt':_[_0x5c4a('0x36')](_0x4dc660,{'autoCreate':_0x3b8007}),'contact':_0x37ab87===undefined?{}:_0x37ab87,'contacts':_0x415671[_0x5c4a('0x21')]===0x0?undefined:_0x415671});}});};
\ No newline at end of file
index 115d6e2..f01f4c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3320=['freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','render','user:%s','name','format','jscripty','trigger:%s','action','integration','exec','queue','routeId','script','parse','query','search','AllConditions','every','checkConditions','channel','AnyConditions','some','field','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','membername','lastevent','exports','util','lodash','mustache','./urlforward','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x3320,0xd1));var _0x0332=function(_0x56bd24,_0xa17b6a){_0x56bd24=_0x56bd24-0x0;var _0x3dec39=_0x3320[_0x56bd24];return _0x3dec39;};'use strict';var util=require(_0x0332('0x0'));var _=require(_0x0332('0x1'));var url=require('url');var Mustache=require(_0x0332('0x2'));var Redis=require('ioredis');var urlforward=require(_0x0332('0x3'));var integration=require('./integration');var cmContact=require(_0x0332('0x4'));var script=require('./script');var config=require(_0x0332('0x5'));var logger=require(_0x0332('0x6'))(_0x0332('0x7'));var ami=require(_0x0332('0x8'));config['redis']=_[_0x0332('0x9')](config[_0x0332('0xa')],{'host':_0x0332('0xb'),'port':0x18eb});var io=require(_0x0332('0xc'))(new Redis(config[_0x0332('0xa')]));var operators={'equals':function(_0x1bb6d0,_0x5d92b8){return _0x1bb6d0==_0x5d92b8;},'not_equals':function(_0x5f5c25,_0x3584cb){return _0x5f5c25!=_0x3584cb;}};var barAndWebActions=[_0x0332('0xd'),_0x0332('0xe'),'winapp'];function Trigger(_0x1c4207){this['triggers']=_0x1c4207[_0x0332('0xf')];this['agents']=_0x1c4207[_0x0332('0x10')];this['voiceQueues']=_0x1c4207[_0x0332('0x11')];this['templates']=_0x1c4207[_0x0332('0x12')];this[_0x0332('0x13')]=_0x1c4207[_0x0332('0x13')];this[_0x0332('0x14')]=_0x1c4207[_0x0332('0x14')];this[_0x0332('0x15')]=_0x1c4207[_0x0332('0x15')];this[_0x0332('0x16')]=_0x1c4207[_0x0332('0x16')];this[_0x0332('0x17')]=_0x1c4207['sugarcrmAccounts'];this[_0x0332('0x18')]=_0x1c4207[_0x0332('0x18')];this['deskAccounts']=_0x1c4207[_0x0332('0x19')];this[_0x0332('0x1a')]=_0x1c4207[_0x0332('0x1a')];this[_0x0332('0x1b')]=_0x1c4207[_0x0332('0x1b')];this[_0x0332('0x1c')]=_0x1c4207[_0x0332('0x1c')];this[_0x0332('0x1d')]=_0x1c4207[_0x0332('0x1d')];this['accounts']={'zendesk':this[_0x0332('0x14')],'salesforce':this[_0x0332('0x16')],'freshdesk':this[_0x0332('0x15')],'sugarcrm':this[_0x0332('0x17')],'zoho':this[_0x0332('0x18')],'desk':this[_0x0332('0x19')],'vtiger':this[_0x0332('0x1a')],'dynamics365':this[_0x0332('0x1c')],'freshsales':this[_0x0332('0x1d')],'servicenow':this['servicenowAccounts']};ami['on'](_0x0332('0x1e'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x21'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x22'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x23'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x0332('0x25'),this['syncCustomEvent'][_0x0332('0x20')](this));ami['on']('custom:agentbusy',this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x26'),this['syncCustomEvent'][_0x0332('0x20')](this));ami['on']('custom:agentreject',this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x27'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x0332('0x1f')]['bind'](this));ami['on'](_0x0332('0x28'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x0332('0x20')](this));ami['on'](_0x0332('0x29'),this[_0x0332('0x2a')][_0x0332('0x20')](this));ami['on'](_0x0332('0x2b'),this['syncAgentDial'][_0x0332('0x20')](this));ami['on'](_0x0332('0x2c'),this['syncCustomEvent'][_0x0332('0x20')](this));ami['on']('custom:closedinteraction',this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x2d'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x0332('0x20')](this));ami['on'](_0x0332('0x2e'),this[_0x0332('0x1f')][_0x0332('0x20')](this));ami['on'](_0x0332('0x2f'),this[_0x0332('0x1f')]['bind'](this));}Trigger[_0x0332('0x30')][_0x0332('0x31')]=function(_0x2261a2,_0x455145,_0x482454){logger[_0x0332('0x32')](_0x2261a2,_0x455145,JSON[_0x0332('0x33')](_0x482454));io['to'](_0x2261a2)[_0x0332('0x31')](_0x455145,_0x482454);};Trigger['prototype'][_0x0332('0x1f')]=function(_0x4c7f69){var _0x51ca07=_[_0x0332('0x34')](_0x4c7f69);this['checkTriggers'](_0x51ca07);};Trigger[_0x0332('0x30')][_0x0332('0x2a')]=function(_0x270739){if(this[_0x0332('0x10')][_0x270739[_0x0332('0x35')]]){this[_0x0332('0x1f')](_0x270739);}};Trigger['prototype'][_0x0332('0x36')]=function(_0x566653){var _0x3908f1;for(var _0x33f27d in this[_0x0332('0xf')]){if(this[_0x0332('0xf')][_0x0332('0x37')](_0x33f27d)){if(this[_0x0332('0xf')][_0x33f27d][_0x0332('0x38')]){_0x3908f1=this[_0x0332('0x39')](this[_0x0332('0xf')][_0x33f27d],_0x566653);if(_0x3908f1){_[_0x0332('0x3a')](_0x566653,_0x566653[_0x0332('0x3b')]);for(var _0x559f7b=0x0,_0x2c27e9,_0x5a9d7e,_0x13f088;_0x559f7b<this[_0x0332('0xf')][_0x33f27d][_0x0332('0x3c')][_0x0332('0x3d')];_0x559f7b+=0x1){_0x2c27e9=this[_0x0332('0xf')][_0x33f27d]['Actions'][_0x559f7b];if(this['agents'][_0x566653['interface']]){switch(_0x2c27e9['action'][_0x0332('0x3e')]()){case _0x0332('0x3f'):break;case _0x0332('0x40'):case _0x0332('0x41'):var _0x3b23ec={};switch(barAndWebActions[_0x2c27e9[_0x0332('0x42')]]){case'popup':_0x3b23ec[_0x0332('0x43')]=_0x2c27e9[_0x0332('0x44')];_0x3b23ec[_0x0332('0x45')]=this[_0x0332('0x12')][_0x2c27e9[_0x0332('0x44')]]?Mustache['render'](this[_0x0332('0x12')][_0x2c27e9[_0x0332('0x44')]][_0x0332('0x45')],_0x566653):_0x0332('0x46');break;case _0x0332('0xe'):_0x3b23ec[_0x0332('0x47')]=this[_0x0332('0x48')](_0x2c27e9[_0x0332('0x44')],_0x566653,_[_0x0332('0x49')](_0x2c27e9[_0x0332('0x4a')])?!![]:parseInt(_0x2c27e9[_0x0332('0x4a')],0xa));if(_[_0x0332('0x49')](_0x2c27e9['data4'])){_0x3b23ec['location']='0';}else{_0x3b23ec[_0x0332('0x4b')]=_0x2c27e9[_0x0332('0x4c')];_0x3b23ec[_0x0332('0x4d')]=_[_0x0332('0x49')](_0x2c27e9[_0x0332('0x4e')])?_0x0332('0x4f'):_0x2c27e9[_0x0332('0x4e')];_0x3b23ec[_0x0332('0x50')]=_[_0x0332('0x49')](_0x2c27e9[_0x0332('0x51')])?_0x0332('0x52'):_0x2c27e9['data6'];}break;case _0x0332('0x53'):_0x3b23ec[_0x0332('0x54')]=_0x2c27e9[_0x0332('0x44')]?Mustache['render'](_0x2c27e9[_0x0332('0x44')],_0x566653):'';_0x3b23ec[_0x0332('0x55')]=_0x2c27e9[_0x0332('0x4a')]?Mustache[_0x0332('0x56')](_0x2c27e9['data3'],_0x566653):'';break;}this['emit'](util['format'](_0x0332('0x57'),this[_0x0332('0x10')][_0x566653[_0x0332('0x35')]][_0x0332('0x58')]),util[_0x0332('0x59')]('trigger:%s:%s',_0x2c27e9['action']['toLowerCase'](),barAndWebActions[_0x2c27e9['data1']]),_[_0x0332('0x3a')](_0x3b23ec,_0x566653));break;case _0x0332('0x5a'):this[_0x0332('0x31')](util[_0x0332('0x59')](_0x0332('0x57'),this[_0x0332('0x10')][_0x566653[_0x0332('0x35')]]['name']),util[_0x0332('0x59')](_0x0332('0x5b'),_0x2c27e9[_0x0332('0x5c')][_0x0332('0x3e')]()),_['merge']({'ProjectId':parseInt(_0x2c27e9[_0x0332('0x42')],0xa)},_0x566653));break;default:this['emit'](util['format'](_0x0332('0x57'),this[_0x0332('0x10')][_0x566653['interface']][_0x0332('0x58')]),util[_0x0332('0x59')](_0x0332('0x5b'),_0x2c27e9[_0x0332('0x5c')][_0x0332('0x3e')]()),_[_0x0332('0x3a')]({},_0x2c27e9,_0x566653));}}switch(_0x2c27e9[_0x0332('0x5c')][_0x0332('0x3e')]()){case _0x0332('0x3f'):cmContact['exec'](this['agents'][_0x566653[_0x0332('0x35')]],this[_0x0332('0xf')][_0x33f27d],_0x2c27e9,_0x566653);break;case _0x0332('0x5d'):integration[_0x0332('0x5e')](_0x2c27e9,_0x566653,this['accounts'],this[_0x0332('0x10')][_0x566653[_0x0332('0x35')]],this['voiceQueues'][_0x566653[_0x0332('0x5f')]],this[_0x0332('0x13')][_0x566653[_0x0332('0x60')]]);break;case'urlforward':urlforward[_0x0332('0x5e')](_0x2c27e9,_0x566653);break;case _0x0332('0x61'):script[_0x0332('0x5e')](_0x2c27e9,_0x566653);break;}}}}}}};Trigger[_0x0332('0x30')]['buildUri']=function(_0x17e43c,_0x16696d,_0x1da5d7){var _0xddc629=url[_0x0332('0x62')](Mustache[_0x0332('0x56')](_0x17e43c,_0x16696d),!![]);if(_0x1da5d7){_[_0x0332('0x3a')](_0xddc629[_0x0332('0x63')],_0x16696d);}delete _0xddc629[_0x0332('0x64')];var _0x2ed42b=url[_0x0332('0x59')](_0xddc629);_0x2ed42b=_0x2ed42b['replace'](/\/\?/g,'?');return _0x2ed42b;};Trigger[_0x0332('0x30')][_0x0332('0x39')]=function(_0x56eb67,_0x2d9172){var _0x2cbf4c=!![],_0x5930c3=!![];if(_0x56eb67[_0x0332('0x65')]['length']){_0x2cbf4c=_[_0x0332('0x66')](_0x56eb67[_0x0332('0x65')],this[_0x0332('0x67')](_0x2d9172,_0x56eb67[_0x0332('0x68')]));}if(_0x56eb67[_0x0332('0x69')][_0x0332('0x3d')]){_0x5930c3=_[_0x0332('0x6a')](_0x56eb67['AnyConditions'],this[_0x0332('0x67')](_0x2d9172,_0x56eb67[_0x0332('0x68')]));}return _0x2cbf4c&&_0x5930c3;};Trigger[_0x0332('0x30')][_0x0332('0x67')]=function(_0x47fd9d,_0x5adb0f){return function(_0x226347){switch(_0x226347[_0x0332('0x6b')]){case'account':if(_0x47fd9d[_0x0332('0x68')]===_0x5adb0f){if(_0x5adb0f==='chat'){return _0x47fd9d[_0x0332('0x6c')]?operators[_0x226347[_0x0332('0x6d')]](Number(_0x226347[_0x0332('0x6e')]),_0x47fd9d['ChatWebsiteId']):![];}else{return _0x47fd9d[_[_0x0332('0x6f')](_0x5adb0f)+_0x0332('0x70')]?operators[_0x226347['operator']](Number(_0x226347[_0x0332('0x6e')]),_0x47fd9d[_[_0x0332('0x6f')](_0x5adb0f)+'AccountId']):![];}}break;case'interaction':case _0x0332('0x71'):if(_0x47fd9d[_0x0332('0x68')]===_0x5adb0f){return _0x47fd9d[_0x0332('0x72')]?operators[_0x226347[_0x0332('0x6d')]](_0x226347[_0x0332('0x6e')],_0x47fd9d['event']):![];}break;case _0x0332('0x5f'):return _0x47fd9d[_0x0332('0x5f')]?operators[_0x226347[_0x0332('0x6d')]](_0x226347[_0x0332('0x6e')],_0x47fd9d[_0x0332('0x5f')]):![];case _0x0332('0x73'):return _0x47fd9d[_0x0332('0x74')]?operators[_0x226347[_0x0332('0x6d')]](_0x226347[_0x0332('0x6e')],_0x47fd9d['membername']):![];case _0x0332('0x75'):return _0x47fd9d[_0x0332('0x75')]?operators[_0x226347[_0x0332('0x6d')]](_0x226347[_0x0332('0x6e')],_0x47fd9d[_0x0332('0x75')]):![];case _0x0332('0x60'):return _0x47fd9d[_0x0332('0x60')]?operators[_0x226347[_0x0332('0x6d')]](_0x226347[_0x0332('0x6e')],_0x47fd9d[_0x0332('0x60')]):![];}return![];};};module[_0x0332('0x76')]=Trigger;
\ No newline at end of file
+var _0x5df3=['data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','format','user:%s','name','trigger:%s:%s','merge','jscripty','action','toLowerCase','interface','trigger:%s','integration','exec','accounts','routeId','script','query','search','replace','checkTrigger','AllConditions','checkConditions','channel','account','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','event','queue','agent','membername','lastevent','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','redis','localhost','socket.io-emitter','popup','triggers','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','vtigerAccounts','custom:agentconnect','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','variables','Actions','length','agents','contactmanager','motionbar','browser','data1'];(function(_0x4525b0,_0x22b4e1){var _0x306136=function(_0x18b17c){while(--_0x18b17c){_0x4525b0['push'](_0x4525b0['shift']());}};_0x306136(++_0x22b4e1);}(_0x5df3,0x182));var _0x35df=function(_0x32e9e9,_0x3df5aa){_0x32e9e9=_0x32e9e9-0x0;var _0x400b63=_0x5df3[_0x32e9e9];return _0x400b63;};'use strict';var util=require(_0x35df('0x0'));var _=require(_0x35df('0x1'));var url=require(_0x35df('0x2'));var Mustache=require(_0x35df('0x3'));var Redis=require(_0x35df('0x4'));var urlforward=require('./urlforward');var integration=require(_0x35df('0x5'));var cmContact=require(_0x35df('0x6'));var script=require(_0x35df('0x7'));var config=require('../../../config/environment');var logger=require(_0x35df('0x8'))(_0x35df('0x9'));var ami=require('../ami');config[_0x35df('0xa')]=_['defaults'](config[_0x35df('0xa')],{'host':_0x35df('0xb'),'port':0x18eb});var io=require(_0x35df('0xc'))(new Redis(config[_0x35df('0xa')]));var operators={'equals':function(_0x2bede1,_0x18e25c){return _0x2bede1==_0x18e25c;},'not_equals':function(_0x55b20e,_0x7f67f6){return _0x55b20e!=_0x7f67f6;}};var barAndWebActions=[_0x35df('0xd'),_0x35df('0x2'),'winapp'];function Trigger(_0x200752){this[_0x35df('0xe')]=_0x200752[_0x35df('0xe')];this['agents']=_0x200752['agents'];this['voiceQueues']=_0x200752[_0x35df('0xf')];this[_0x35df('0x10')]=_0x200752[_0x35df('0x10')];this['voiceExtensions']=_0x200752['voiceExtensions'];this[_0x35df('0x11')]=_0x200752[_0x35df('0x11')];this[_0x35df('0x12')]=_0x200752[_0x35df('0x12')];this[_0x35df('0x13')]=_0x200752[_0x35df('0x13')];this[_0x35df('0x14')]=_0x200752[_0x35df('0x14')];this[_0x35df('0x15')]=_0x200752[_0x35df('0x15')];this[_0x35df('0x16')]=_0x200752['deskAccounts'];this['vtigerAccounts']=_0x200752['vtigerAccounts'];this[_0x35df('0x17')]=_0x200752['servicenowAccounts'];this[_0x35df('0x18')]=_0x200752[_0x35df('0x18')];this['freshsalesAccounts']=_0x200752[_0x35df('0x19')];this['accounts']={'zendesk':this[_0x35df('0x11')],'salesforce':this[_0x35df('0x13')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x35df('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0x35df('0x16')],'vtiger':this[_0x35df('0x1a')],'dynamics365':this[_0x35df('0x18')],'freshsales':this[_0x35df('0x19')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this['syncCustomEvent']['bind'](this));ami['on'](_0x35df('0x1b'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x1e'),this['syncCustomEvent'][_0x35df('0x1d')](this));ami['on'](_0x35df('0x1f'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x20'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x21'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x22'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on']('custom:agentcongestion',this[_0x35df('0x1c')]['bind'](this));ami['on']('custom:agentreject',this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on']('custom:amd',this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x23'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x24'),this[_0x35df('0x1c')]['bind'](this));ami['on'](_0x35df('0x25'),this[_0x35df('0x26')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x27'),this[_0x35df('0x26')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x28'),this[_0x35df('0x26')]['bind'](this));ami['on']('custom:newinteraction',this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x29'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x2a'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x2b'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x2c'),this[_0x35df('0x1c')][_0x35df('0x1d')](this));ami['on'](_0x35df('0x2d'),this[_0x35df('0x1c')]['bind'](this));}Trigger[_0x35df('0x2e')][_0x35df('0x2f')]=function(_0x5a529d,_0x144e19,_0x405857){logger[_0x35df('0x30')](_0x5a529d,_0x144e19,JSON['stringify'](_0x405857));io['to'](_0x5a529d)[_0x35df('0x2f')](_0x144e19,_0x405857);};Trigger[_0x35df('0x2e')][_0x35df('0x1c')]=function(_0x3688c2){var _0xc16324=_[_0x35df('0x31')](_0x3688c2);this['checkTriggers'](_0xc16324);};Trigger[_0x35df('0x2e')][_0x35df('0x26')]=function(_0x12def1){if(this['agents'][_0x12def1['interface']]){this[_0x35df('0x1c')](_0x12def1);}};Trigger[_0x35df('0x2e')]['checkTriggers']=function(_0x4b4506){var _0x39f991;for(var _0x1a2fe2 in this[_0x35df('0xe')]){if(this[_0x35df('0xe')]['hasOwnProperty'](_0x1a2fe2)){if(this['triggers'][_0x1a2fe2]['status']){_0x39f991=this['checkTrigger'](this[_0x35df('0xe')][_0x1a2fe2],_0x4b4506);if(_0x39f991){_['merge'](_0x4b4506,_0x4b4506[_0x35df('0x32')]);for(var _0x51427a=0x0,_0x5644ea,_0x3d2a20,_0x1045bb;_0x51427a<this[_0x35df('0xe')][_0x1a2fe2][_0x35df('0x33')][_0x35df('0x34')];_0x51427a+=0x1){_0x5644ea=this[_0x35df('0xe')][_0x1a2fe2]['Actions'][_0x51427a];if(this[_0x35df('0x35')][_0x4b4506['interface']]){switch(_0x5644ea['action']['toLowerCase']()){case _0x35df('0x36'):break;case _0x35df('0x37'):case _0x35df('0x38'):var _0x2715db={};switch(barAndWebActions[_0x5644ea[_0x35df('0x39')]]){case _0x35df('0xd'):_0x2715db['TemplateId']=_0x5644ea[_0x35df('0x3a')];_0x2715db[_0x35df('0x3b')]=this[_0x35df('0x10')][_0x5644ea['data2']]?Mustache[_0x35df('0x3c')](this[_0x35df('0x10')][_0x5644ea[_0x35df('0x3a')]][_0x35df('0x3b')],_0x4b4506):_0x35df('0x3d');break;case _0x35df('0x2'):_0x2715db['uri']=this[_0x35df('0x3e')](_0x5644ea[_0x35df('0x3a')],_0x4b4506,_['isNil'](_0x5644ea[_0x35df('0x3f')])?!![]:parseInt(_0x5644ea[_0x35df('0x3f')],0xa));if(_[_0x35df('0x40')](_0x5644ea[_0x35df('0x41')])){_0x2715db[_0x35df('0x42')]='0';}else{_0x2715db['uriLocation']=_0x5644ea[_0x35df('0x41')];_0x2715db[_0x35df('0x43')]=_[_0x35df('0x40')](_0x5644ea[_0x35df('0x44')])?_0x35df('0x45'):_0x5644ea[_0x35df('0x44')];_0x2715db[_0x35df('0x46')]=_['isNil'](_0x5644ea[_0x35df('0x47')])?_0x35df('0x48'):_0x5644ea['data6'];}break;case _0x35df('0x49'):_0x2715db[_0x35df('0x4a')]=_0x5644ea[_0x35df('0x3a')]?Mustache[_0x35df('0x3c')](_0x5644ea['data2'],_0x4b4506):'';_0x2715db['winArguments']=_0x5644ea[_0x35df('0x3f')]?Mustache[_0x35df('0x3c')](_0x5644ea[_0x35df('0x3f')],_0x4b4506):'';break;}this[_0x35df('0x2f')](util[_0x35df('0x4b')](_0x35df('0x4c'),this[_0x35df('0x35')][_0x4b4506['interface']][_0x35df('0x4d')]),util[_0x35df('0x4b')](_0x35df('0x4e'),_0x5644ea['action']['toLowerCase'](),barAndWebActions[_0x5644ea['data1']]),_[_0x35df('0x4f')](_0x2715db,_0x4b4506));break;case _0x35df('0x50'):this[_0x35df('0x2f')](util[_0x35df('0x4b')](_0x35df('0x4c'),this['agents'][_0x4b4506['interface']]['name']),util[_0x35df('0x4b')]('trigger:%s',_0x5644ea[_0x35df('0x51')][_0x35df('0x52')]()),_[_0x35df('0x4f')]({'ProjectId':parseInt(_0x5644ea[_0x35df('0x39')],0xa)},_0x4b4506));break;default:this[_0x35df('0x2f')](util[_0x35df('0x4b')]('user:%s',this[_0x35df('0x35')][_0x4b4506[_0x35df('0x53')]][_0x35df('0x4d')]),util[_0x35df('0x4b')](_0x35df('0x54'),_0x5644ea[_0x35df('0x51')][_0x35df('0x52')]()),_['merge']({},_0x5644ea,_0x4b4506));}}switch(_0x5644ea[_0x35df('0x51')][_0x35df('0x52')]()){case _0x35df('0x36'):cmContact['exec'](this[_0x35df('0x35')][_0x4b4506['interface']],this[_0x35df('0xe')][_0x1a2fe2],_0x5644ea,_0x4b4506);break;case _0x35df('0x55'):integration[_0x35df('0x56')](_0x5644ea,_0x4b4506,this[_0x35df('0x57')],this[_0x35df('0x35')][_0x4b4506[_0x35df('0x53')]],this[_0x35df('0xf')][_0x4b4506['queue']],this['voiceExtensions'][_0x4b4506[_0x35df('0x58')]]);break;case'urlforward':urlforward[_0x35df('0x56')](_0x5644ea,_0x4b4506);break;case _0x35df('0x59'):script['exec'](_0x5644ea,_0x4b4506);break;}}}}}}};Trigger['prototype'][_0x35df('0x3e')]=function(_0x30ed7f,_0x510662,_0x2f4231){var _0x19e44e=url['parse'](Mustache[_0x35df('0x3c')](_0x30ed7f,_0x510662),!![]);if(_0x2f4231){_[_0x35df('0x4f')](_0x19e44e[_0x35df('0x5a')],_0x510662);}delete _0x19e44e[_0x35df('0x5b')];var _0x123166=url['format'](_0x19e44e);_0x123166=_0x123166[_0x35df('0x5c')](/\/\?/g,'?');return _0x123166;};Trigger['prototype'][_0x35df('0x5d')]=function(_0x4ecd8d,_0x56d4a3){var _0x27b9ae=!![],_0x2734dd=!![];if(_0x4ecd8d[_0x35df('0x5e')][_0x35df('0x34')]){_0x27b9ae=_['every'](_0x4ecd8d[_0x35df('0x5e')],this[_0x35df('0x5f')](_0x56d4a3,_0x4ecd8d[_0x35df('0x60')]));}if(_0x4ecd8d['AnyConditions'][_0x35df('0x34')]){_0x2734dd=_['some'](_0x4ecd8d['AnyConditions'],this['checkConditions'](_0x56d4a3,_0x4ecd8d[_0x35df('0x60')]));}return _0x27b9ae&&_0x2734dd;};Trigger[_0x35df('0x2e')]['checkConditions']=function(_0x57b864,_0x10f2fe){return function(_0x57539a){switch(_0x57539a['field']){case _0x35df('0x61'):if(_0x57b864[_0x35df('0x60')]===_0x10f2fe){if(_0x10f2fe===_0x35df('0x62')){return _0x57b864[_0x35df('0x63')]?operators[_0x57539a[_0x35df('0x64')]](Number(_0x57539a[_0x35df('0x65')]),_0x57b864[_0x35df('0x63')]):![];}else{return _0x57b864[_['upperFirst'](_0x10f2fe)+_0x35df('0x66')]?operators[_0x57539a['operator']](Number(_0x57539a[_0x35df('0x65')]),_0x57b864[_[_0x35df('0x67')](_0x10f2fe)+_0x35df('0x66')]):![];}}break;case _0x35df('0x68'):case _0x35df('0x69'):if(_0x57b864[_0x35df('0x60')]===_0x10f2fe){return _0x57b864[_0x35df('0x6a')]?operators[_0x57539a[_0x35df('0x64')]](_0x57539a[_0x35df('0x65')],_0x57b864['event']):![];}break;case _0x35df('0x6b'):return _0x57b864[_0x35df('0x6b')]?operators[_0x57539a[_0x35df('0x64')]](_0x57539a[_0x35df('0x65')],_0x57b864[_0x35df('0x6b')]):![];case _0x35df('0x6c'):return _0x57b864[_0x35df('0x6d')]?operators[_0x57539a['operator']](_0x57539a['value'],_0x57b864[_0x35df('0x6d')]):![];case _0x35df('0x6e'):return _0x57b864[_0x35df('0x6e')]?operators[_0x57539a['operator']](_0x57539a[_0x35df('0x65')],_0x57b864[_0x35df('0x6e')]):![];case _0x35df('0x58'):return _0x57b864[_0x35df('0x58')]?operators[_0x57539a[_0x35df('0x64')]](_0x57539a[_0x35df('0x65')],_0x57b864['routeId']):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 08ebad6..5fd883c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x590cea,_0x5b099c){var _0x497f74=function(_0x3278ae){while(--_0x3278ae){_0x590cea['push'](_0x590cea['shift']());}};_0x497f74(++_0x5b099c);}(_0x55ca,0x126));var _0xa55c=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x55ca[_0x30f87a];return _0x3a8efc;};'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
+var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x18658a,_0x55f095){var _0x107877=function(_0xa46c67){while(--_0xa46c67){_0x18658a['push'](_0x18658a['shift']());}};_0x107877(++_0x55f095);}(_0x7217,0x19e));var _0x7721=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7217[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});};
\ No newline at end of file
index 88ce6b5..cb65587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc88c=['calleridnum','contacts','/systemusers(','4.0','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','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','incidents','assign','getString','Subjects','Descriptions','/contacts(','phonecall','queue','callDirection','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','outbound','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token','error','toUpperCase','message','GET','Bearer\x20','value','email','length','isdisabled','userId','info','userEmail','username','internalemailaddress','systemuserid','catch'];(function(_0x2ea5d6,_0x2ef3e7){var _0x20dcb3=function(_0x22ed56){while(--_0x22ed56){_0x2ea5d6['push'](_0x2ea5d6['shift']());}};_0x20dcb3(++_0x2ef3e7);}(_0xc88c,0x16d));var _0xcc88=function(_0x428c8d,_0x34d16d){_0x428c8d=_0x428c8d-0x0;var _0x507651=_0xc88c[_0x428c8d];return _0x507651;};'use strict';var _=require(_0xcc88('0x0'));var BPromise=require(_0xcc88('0x1'));var rp=require('request-promise');var util=require(_0xcc88('0x2'));var intUtil=require(_0xcc88('0x3'));var md5=require(_0xcc88('0x4'));var Redis=require(_0xcc88('0x5'));var logger=require(_0xcc88('0x6'))(_0xcc88('0x7'));var config=require('../../../../config/environment');config[_0xcc88('0x8')]=_[_0xcc88('0x9')](config[_0xcc88('0x8')],{'host':_0xcc88('0xa'),'port':0x18eb});var io=require(_0xcc88('0xb'))(new Redis(config[_0xcc88('0x8')]));function getAuthToken(_0x3a0a5d,_0x484458,_0x111b14){var _0x109fd8={'method':_0xcc88('0xc'),'uri':_0x484458,'form':{'client_id':_0x3a0a5d[_0xcc88('0xd')],'resource':_0x3a0a5d[_0xcc88('0xe')],'username':_0x3a0a5d['username'],'password':_0x3a0a5d[_0xcc88('0xf')],'grant_type':_0xcc88('0xf'),'client_secret':_0x3a0a5d[_0xcc88('0x10')]},'json':!![]};return rp(_0x109fd8)[_0xcc88('0x11')](function(_0x125adb){return _0x125adb[_0xcc88('0x12')];})['catch'](function(_0x5818d7){logger[_0xcc88('0x13')]('['+[_0x111b14[_0xcc88('0x14')]()]+']\x20Wrong\x20credentials!');return _0x5818d7[_0xcc88('0x15')];});}function getUser(_0x59ca58,_0x5aba25,_0x32629c,_0xca8bdf,_0x198816,_0x7abcb2){return new BPromise(function(_0x316f3b,_0x335555){return getAuthToken(_0x5aba25,_0xca8bdf,_0x7abcb2)[_0xcc88('0x11')](function(_0x4c3ad1){var _0x44f228={'method':_0xcc88('0x16'),'uri':_0x198816+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xcc88('0x17')+_0x4c3ad1,'OData-Version':'4.0'},'json':!![]};return rp(_0x44f228);})[_0xcc88('0x11')](function(_0x2b89ea){var _0x440df8=_0x2b89ea[_0xcc88('0x18')];var _0x26a6db=![];var _0x121e12=null;if(!_['isNil'](_0x32629c)){if(intUtil['validateEmail'](_0x32629c['email'])){_0x59ca58['userEmail']=_0x32629c[_0xcc88('0x19')];for(_0x121e12=0x0;_0x121e12<_0x440df8[_0xcc88('0x1a')];_0x121e12++){if(_0x440df8[_0x121e12]['internalemailaddress']===_0x32629c[_0xcc88('0x19')]&&!_0x440df8[_0x121e12][_0xcc88('0x1b')]){_0x26a6db=!![];logger['info']('['+[_0x7abcb2[_0xcc88('0x14')]()]+']\x20Agent\x20found\x20'+_0x440df8[_0x121e12]['systemuserid']+'!');_0x59ca58[_0xcc88('0x1c')]=_0x440df8[_0x121e12]['systemuserid'];}}}}if(!_0x26a6db){logger[_0xcc88('0x1d')]('['+[_0x7abcb2['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x59ca58[_0xcc88('0x1e')]=_0x5aba25[_0xcc88('0x1f')];for(_0x121e12=0x0;_0x121e12<_0x440df8[_0xcc88('0x1a')];_0x121e12++){if(_0x440df8[_0x121e12][_0xcc88('0x20')]===_0x5aba25['username']){_0x59ca58['userId']=_0x440df8[_0x121e12][_0xcc88('0x21')];}}}_0x316f3b(_0x59ca58);})[_0xcc88('0x22')](function(_0x3ab792){_0x335555(_0x3ab792['message']);});});}function createEndUser(_0x459e15,_0x2721fc,_0x45b42a,_0x11efc6,_0x11b661,_0x43579d){return new BPromise(function(_0x26737e,_0x3bfaa5){return getAuthToken(_0x2721fc,_0x45b42a,_0x43579d)[_0xcc88('0x11')](function(_0x397593){var _0x31dc03=_0x43579d['toLowerCase']()==='outbound'?_0x11b661['destcalleridnum']:_0x11b661[_0xcc88('0x23')];var _0x3269c1={'method':_0xcc88('0xc'),'uri':_0x11efc6+_0xcc88('0x24'),'body':{'telephone1':_0x31dc03,'fullname':_0x31dc03,'firstname':_0x31dc03,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xcc88('0x25')+_0x459e15[_0xcc88('0x1c')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x397593,'OData-Version':_0xcc88('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3269c1);})[_0xcc88('0x11')](function(_0x119de5){var _0x53f352=_0x119de5['headers'][_0xcc88('0x27')];var _0x568f68=_0x53f352[_0xcc88('0x28')](_0x53f352[_0xcc88('0x29')]('(')+0x1,_0x53f352[_0xcc88('0x29')](')'));_0x459e15[_0xcc88('0x2a')]=_0x568f68;_0x26737e(_0x459e15);})['catch'](function(_0x4bdeb0){_0x3bfaa5(_0x4bdeb0[_0xcc88('0x15')]);});});}function getEndUser(_0x2b83cb,_0x11571f,_0x3705c8,_0x342492,_0x4ba940,_0x87f1de){return new BPromise(function(_0x3f72fe,_0x4d610c){var _0x212eb8=_0x87f1de[_0xcc88('0x2b')]()==='outbound'?_0x4ba940[_0xcc88('0x2c')]:_0x4ba940[_0xcc88('0x23')];return getAuthToken(_0x11571f,_0x3705c8,_0x87f1de)[_0xcc88('0x11')](function(_0x5b7868){var _0x1c2627={'method':_0xcc88('0x16'),'uri':_0x342492+_0xcc88('0x2d')+_0x212eb8[_0xcc88('0x2e')]('+',_0xcc88('0x2f'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x5b7868,'If-None-Match':null,'OData-Version':_0xcc88('0x26')},'json':!![]};return rp(_0x1c2627);})[_0xcc88('0x11')](function(_0x547922){var _0x448929=null;if(_0x547922){var _0x1819af=_0x547922['value'];var _0x253f9c=![];for(_0x448929=0x0;_0x448929<_0x1819af[_0xcc88('0x1a')];_0x448929++){if(_0x1819af[_0x448929][_0xcc88('0x30')]===_0x212eb8){_0x253f9c=!![];_0x2b83cb['enduserId']=_0x1819af[_0x448929][_0xcc88('0x31')];}}if(_0x253f9c){_0x3f72fe(_0x2b83cb);}else{return createEndUser(_0x2b83cb,_0x11571f,_0x3705c8,_0x342492,_0x4ba940,_0x87f1de)['then'](function(_0x4fc489){logger[_0xcc88('0x1d')]('['+[_0x87f1de[_0xcc88('0x14')]()]+_0xcc88('0x32'),_0x4fc489[_0xcc88('0x2a')]);_0x3f72fe(_0x4fc489);});}}else{return createEndUser(_0x2b83cb,_0x11571f,_0x3705c8,_0x342492,_0x4ba940,_0x87f1de)[_0xcc88('0x11')](function(_0x3d360a){logger[_0xcc88('0x1d')]('['+[_0x87f1de[_0xcc88('0x14')]()]+']\x20Enduser\x20Created!',_0x3d360a[_0xcc88('0x2a')]);_0x3f72fe(_0x3d360a);});}});});}function getCustomFields(_0x2587a1,_0x5275c6,_0x599981){var _0x1cf77a={};if(_0x2587a1[_0xcc88('0x1a')]>0x0){_['forEach'](_0x2587a1,function(_0x526a42){if(_[_0xcc88('0x33')]([_0xcc88('0x34'),_0xcc88('0x35')],_0x526a42[_0xcc88('0x36')])&&_0x526a42[_0xcc88('0x37')]&&!_0x526a42[_0xcc88('0x38')]){var _0x1879de=_0x526a42[_0xcc88('0x39')][_0xcc88('0x2b')]();var _0x498313=_0x1879de[_0xcc88('0x28')](0x0,_0x1879de[_0xcc88('0x3a')]('_'));var _0x2476b4=_0x1879de[_0xcc88('0x28')](_0x1879de['indexOf']('_')+0x1);if(_0x498313===_0x599981){_0x1cf77a[_0x2476b4]=_0x526a42[_0xcc88('0x3b')];}}});}return _0x1cf77a;}function getTicket(_0x10ad5a,_0x4c2ad8,_0x3c9eab,_0x2c3e5a,_0xbc1247,_0x3be2ca,_0x4c5177){return new BPromise(function(_0xefeee,_0x4004bd){var _0x309ab2;return getAuthToken(_0x4c2ad8,_0x3c9eab,_0x4c5177)[_0xcc88('0x11')](function(_0x4aafde){if(_0x3be2ca[_0xcc88('0x3c')]===_0xcc88('0x3d')){_0x309ab2={'method':_0xcc88('0xc'),'uri':_0x2c3e5a+_0xcc88('0x3e'),'body':Object[_0xcc88('0x3f')]({},{'title':intUtil[_0xcc88('0x40')](_0x3be2ca[_0xcc88('0x41')],_0xbc1247,'\x20'),'description':intUtil[_0xcc88('0x40')](_0x3be2ca[_0xcc88('0x42')],_0xbc1247,'\x0a'),'customerid_contact@odata.bind':_0xcc88('0x43')+_0x10ad5a['enduserId']+')','ownerid@odata.bind':_0xcc88('0x25')+_0x10ad5a[_0xcc88('0x1c')]+')','caseorigincode':'1'},getCustomFields(_0x3be2ca['Fields'],_0xbc1247,_0x3be2ca[_0xcc88('0x3c')])),'headers':{'Authorization':_0xcc88('0x17')+_0x4aafde,'OData-Version':_0xcc88('0x26')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3be2ca['ticketType']===_0xcc88('0x44')){_0x309ab2={'method':_0xcc88('0xc'),'uri':_0x2c3e5a+'phonecalls','body':Object[_0xcc88('0x3f')]({},{'subject':intUtil['getString'](_0x3be2ca[_0xcc88('0x41')],_0xbc1247,'\x20'),'phonenumber':String(_0xbc1247[_0xcc88('0x23')]),'description':intUtil[_0xcc88('0x40')](_0x3be2ca[_0xcc88('0x42')],_0xbc1247,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x10ad5a[_0xcc88('0x2a')]+')','ownerid@odata.bind':_0xcc88('0x25')+_0x10ad5a['userId']+')','directioncode':_0x10ad5a['callDirection']===_0xcc88('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x10ad5a['userId']+')','participationtypemask':_0x10ad5a[_0xcc88('0x46')]===_0xcc88('0x45')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x10ad5a[_0xcc88('0x2a')]+')','participationtypemask':_0x10ad5a['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x3be2ca['Fields'],_0xbc1247,_0x3be2ca[_0xcc88('0x3c')])),'headers':{'Authorization':_0xcc88('0x17')+_0x4aafde,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x309ab2);})[_0xcc88('0x11')](function(_0xbcc990){var _0x288431=_0xbcc990[_0xcc88('0x47')][_0xcc88('0x27')];var _0x529664=_0x288431[_0xcc88('0x28')](_0x288431[_0xcc88('0x29')]('(')+0x1,_0x288431['lastIndexOf'](')'));_0x10ad5a[_0xcc88('0x48')]=_0x529664;_0xefeee(_0x10ad5a);})[_0xcc88('0x22')](function(_0x4dd62e){_0x4004bd(_0x4dd62e[_0xcc88('0x15')]);});});}function emit(_0x2409f0,_0x5636ae,_0x32216b,_0x14ce6c){var _0x509eaa={'uri':util[_0xcc88('0x49')](_0xcc88('0x4a'),_0x2409f0,_0x32216b,_0x14ce6c)};io['to'](util[_0xcc88('0x49')](_0xcc88('0x4b'),_0x5636ae))[_0xcc88('0x4c')](_0xcc88('0x4d'),_0x509eaa);}exports['cs']=function(_0x541cf6,_0x20852a,_0x110d26,_0x5da0be,_0x27483a,_0x192034,_0x57a787,_0x941c2e){var _0xd06e90={};_0x192034[_0xcc88('0xe')]=intUtil[_0xcc88('0x4e')](_0x192034[_0xcc88('0xe')]);_0x192034['serverUrl']=intUtil[_0xcc88('0x4e')](_0x192034[_0xcc88('0x4f')]);_0xd06e90['callDirection']=_0x941c2e==='queue'||_0x941c2e===_0xcc88('0x50')?_0xcc88('0x45'):_0xcc88('0x51');var _0x436236=util[_0xcc88('0x49')]('%s/api/data/v9.0/',_0x192034[_0xcc88('0xe')]);var _0x1b079e=util['format'](_0xcc88('0x52'),_0x192034[_0xcc88('0x53')]);var _0xf36d81=util[_0xcc88('0x49')](_0xcc88('0x54'),_0x192034[_0xcc88('0x4f')],_0x20852a[_0xcc88('0x55')],md5(_0x20852a['uniqueid']));if(_0x27483a&&_0x27483a[_0xcc88('0x56')]){logger[_0xcc88('0x1d')](_0xcc88('0x57'),_0xcc88('0x58'));_0x20852a[_0xcc88('0x59')]=_0xf36d81;}else if(_0x57a787&&_0x57a787[_0xcc88('0x5a')]&&_0x57a787[_0xcc88('0x5a')]!==_0xcc88('0x5b')){logger[_0xcc88('0x1d')](_0xcc88('0x5c'),'Recording\x20is\x20enabled!');_0x20852a[_0xcc88('0x59')]=_0xf36d81;}else{_0x20852a[_0xcc88('0x59')]='';}return getUser(_0xd06e90,_0x192034,_0x5da0be,_0x1b079e,_0x436236,_0x941c2e)[_0xcc88('0x11')](function(_0x8cdb7d){logger[_0xcc88('0x1d')]('['+_0x941c2e[_0xcc88('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x8cdb7d[_0xcc88('0x1c')]);logger[_0xcc88('0x1d')]('['+_0x941c2e[_0xcc88('0x14')]()+_0xcc88('0x5d'),_0x8cdb7d['userEmail']);return getEndUser(_0x8cdb7d,_0x192034,_0x1b079e,_0x436236,_0x20852a,_0x941c2e);})[_0xcc88('0x11')](function(_0x4b8d6e){logger[_0xcc88('0x1d')]('['+_0x941c2e['toUpperCase']()+_0xcc88('0x5e'),_0x4b8d6e['enduserId']);logger[_0xcc88('0x1d')]('['+_0x941c2e[_0xcc88('0x14')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x20852a[_0xcc88('0x23')]);return getTicket(_0x4b8d6e,_0x192034,_0x1b079e,_0x436236,_0x20852a,_0x110d26,_0x941c2e);})[_0xcc88('0x11')](function(_0xe449a5){logger[_0xcc88('0x1d')](util['format']('['+_0x941c2e['toUpperCase']()+_0xcc88('0x5f'),_0x110d26[_0xcc88('0x3c')],_0xe449a5['ticketId']));logger[_0xcc88('0x1d')](util[_0xcc88('0x49')]('['+_0x941c2e[_0xcc88('0x14')]()+_0xcc88('0x60'),_0x941c2e));if(_0x941c2e!=='unmanaged'){logger[_0xcc88('0x1d')]('['+_0x941c2e[_0xcc88('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x192034[_0xcc88('0xe')],_0x5da0be[_0xcc88('0x61')],_0x110d26['ticketType'],_0xe449a5[_0xcc88('0x48')]);}})[_0xcc88('0x22')](function(_0x129388){logger['error']('['+_0x941c2e[_0xcc88('0x14')]()+_0xcc88('0x62'),util[_0xcc88('0x63')](_0x129388,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x47bf=['queue','substring','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','POST','remoteUri','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','length','username','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','string','picklist','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection'];(function(_0x2ebb90,_0x543777){var _0x274c46=function(_0x54d8a3){while(--_0x54d8a3){_0x2ebb90['push'](_0x2ebb90['shift']());}};_0x274c46(++_0x543777);}(_0x47bf,0x192));var _0xf47b=function(_0x53445b,_0x9452e2){_0x53445b=_0x53445b-0x0;var _0x366536=_0x47bf[_0x53445b];return _0x366536;};'use strict';var _=require(_0xf47b('0x0'));var BPromise=require(_0xf47b('0x1'));var rp=require('request-promise');var util=require(_0xf47b('0x2'));var intUtil=require(_0xf47b('0x3'));var md5=require(_0xf47b('0x4'));var Redis=require(_0xf47b('0x5'));var logger=require(_0xf47b('0x6'))(_0xf47b('0x7'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0xf47b('0x8')],{'host':_0xf47b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf47b('0x8')]));function getAuthToken(_0x4fbdd8,_0xf96a27,_0x26a176){var _0x27bedd={'method':_0xf47b('0xa'),'uri':_0xf96a27,'form':{'client_id':_0x4fbdd8['clientId'],'resource':_0x4fbdd8[_0xf47b('0xb')],'username':_0x4fbdd8['username'],'password':_0x4fbdd8[_0xf47b('0xc')],'grant_type':'password','client_secret':_0x4fbdd8[_0xf47b('0xd')]},'json':!![]};return rp(_0x27bedd)[_0xf47b('0xe')](function(_0x10a767){return _0x10a767[_0xf47b('0xf')];})['catch'](function(_0x457d25){logger[_0xf47b('0x10')]('['+[_0x26a176[_0xf47b('0x11')]()]+_0xf47b('0x12'));return _0x457d25[_0xf47b('0x13')];});}function getUser(_0x163904,_0x3761aa,_0x378d4a,_0xf5676e,_0x2bac04,_0x50d902){return new BPromise(function(_0x295d5d,_0x255bed){return getAuthToken(_0x3761aa,_0xf5676e,_0x50d902)[_0xf47b('0xe')](function(_0x540612){var _0x5ab034={'method':_0xf47b('0x14'),'uri':_0x2bac04+_0xf47b('0x15'),'headers':{'Authorization':_0xf47b('0x16')+_0x540612,'OData-Version':_0xf47b('0x17')},'json':!![]};return rp(_0x5ab034);})[_0xf47b('0xe')](function(_0x1350d5){var _0xc34c7a=_0x1350d5['value'];var _0x19d63e=![];var _0x4a4976=null;if(!_[_0xf47b('0x18')](_0x378d4a)){if(intUtil[_0xf47b('0x19')](_0x378d4a[_0xf47b('0x1a')])){_0x163904['userEmail']=_0x378d4a[_0xf47b('0x1a')];for(_0x4a4976=0x0;_0x4a4976<_0xc34c7a['length'];_0x4a4976++){if(_0xc34c7a[_0x4a4976][_0xf47b('0x1b')]===_0x378d4a[_0xf47b('0x1a')]&&!_0xc34c7a[_0x4a4976]['isdisabled']){_0x19d63e=!![];logger[_0xf47b('0x1c')]('['+[_0x50d902[_0xf47b('0x11')]()]+_0xf47b('0x1d')+_0xc34c7a[_0x4a4976][_0xf47b('0x1e')]+'!');_0x163904[_0xf47b('0x1f')]=_0xc34c7a[_0x4a4976]['systemuserid'];}}}}if(!_0x19d63e){logger['info']('['+[_0x50d902[_0xf47b('0x11')]()]+_0xf47b('0x20'));_0x163904[_0xf47b('0x21')]=_0x3761aa['username'];for(_0x4a4976=0x0;_0x4a4976<_0xc34c7a[_0xf47b('0x22')];_0x4a4976++){if(_0xc34c7a[_0x4a4976]['internalemailaddress']===_0x3761aa[_0xf47b('0x23')]){_0x163904[_0xf47b('0x1f')]=_0xc34c7a[_0x4a4976]['systemuserid'];}}}_0x295d5d(_0x163904);})[_0xf47b('0x24')](function(_0x593cfb){_0x255bed(_0x593cfb[_0xf47b('0x13')]);});});}function createEndUser(_0x567b54,_0x361c49,_0x85f039,_0x9e75b,_0x56154d,_0x5c3a3e){return new BPromise(function(_0x473820,_0x43a1af){return getAuthToken(_0x361c49,_0x85f039,_0x5c3a3e)[_0xf47b('0xe')](function(_0x2d5d47){var _0x2f3ae6=_0x5c3a3e[_0xf47b('0x25')]()===_0xf47b('0x26')?_0x56154d[_0xf47b('0x27')]:_0x56154d[_0xf47b('0x28')];var _0x1996e7={'method':_0xf47b('0xa'),'uri':_0x9e75b+_0xf47b('0x29'),'body':{'telephone1':_0x2f3ae6,'fullname':_0x2f3ae6,'firstname':_0x2f3ae6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf47b('0x2a')+_0x567b54[_0xf47b('0x1f')]+')'},'headers':{'Authorization':_0xf47b('0x16')+_0x2d5d47,'OData-Version':_0xf47b('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1996e7);})[_0xf47b('0xe')](function(_0x58ab3e){var _0x201323=_0x58ab3e[_0xf47b('0x2b')][_0xf47b('0x2c')];var _0x5e0a24=_0x201323['substring'](_0x201323[_0xf47b('0x2d')]('(')+0x1,_0x201323[_0xf47b('0x2d')](')'));_0x567b54[_0xf47b('0x2e')]=_0x5e0a24;_0x473820(_0x567b54);})[_0xf47b('0x24')](function(_0x4c6790){_0x43a1af(_0x4c6790[_0xf47b('0x13')]);});});}function getEndUser(_0x3947d3,_0x3f824d,_0x2346ac,_0x46c38d,_0x5b6a47,_0xef9dd2){return new BPromise(function(_0x2ecb8b,_0x5d1c22){var _0x3c7930=_0xef9dd2[_0xf47b('0x25')]()===_0xf47b('0x26')?_0x5b6a47['destcalleridnum']:_0x5b6a47[_0xf47b('0x28')];return getAuthToken(_0x3f824d,_0x2346ac,_0xef9dd2)['then'](function(_0x2c357e){var _0x5ae4ed={'method':_0xf47b('0x14'),'uri':_0x46c38d+_0xf47b('0x2f')+_0x3c7930[_0xf47b('0x30')]('+',_0xf47b('0x31'))+'\x27','headers':{'Authorization':_0xf47b('0x16')+_0x2c357e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ae4ed);})[_0xf47b('0xe')](function(_0x2de219){var _0x436709=null;if(_0x2de219){var _0x359bc2=_0x2de219[_0xf47b('0x32')];var _0x11caae=![];for(_0x436709=0x0;_0x436709<_0x359bc2[_0xf47b('0x22')];_0x436709++){if(_0x359bc2[_0x436709]['telephone1']===_0x3c7930){_0x11caae=!![];_0x3947d3[_0xf47b('0x2e')]=_0x359bc2[_0x436709][_0xf47b('0x33')];}}if(_0x11caae){_0x2ecb8b(_0x3947d3);}else{return createEndUser(_0x3947d3,_0x3f824d,_0x2346ac,_0x46c38d,_0x5b6a47,_0xef9dd2)[_0xf47b('0xe')](function(_0x4f182f){logger[_0xf47b('0x1c')]('['+[_0xef9dd2[_0xf47b('0x11')]()]+_0xf47b('0x34'),_0x4f182f[_0xf47b('0x2e')]);_0x2ecb8b(_0x4f182f);});}}else{return createEndUser(_0x3947d3,_0x3f824d,_0x2346ac,_0x46c38d,_0x5b6a47,_0xef9dd2)[_0xf47b('0xe')](function(_0x54d699){logger['info']('['+[_0xef9dd2['toUpperCase']()]+_0xf47b('0x35'),_0x54d699[_0xf47b('0x2e')]);_0x2ecb8b(_0x54d699);});}});});}function getCustomFields(_0x318ba2,_0x9114d2,_0x2f60c2){var _0x440153={};if(_0x318ba2[_0xf47b('0x22')]>0x0){_['forEach'](_0x318ba2,function(_0x1bdc4a){if(_['includes']([_0xf47b('0x36'),_0xf47b('0x37')],_0x1bdc4a[_0xf47b('0x38')])&&_0x1bdc4a['nameField']&&!_0x1bdc4a[_0xf47b('0x39')]){var _0xb7e2ce=_0x1bdc4a[_0xf47b('0x3a')][_0xf47b('0x25')]();var _0x585180=_0xb7e2ce['substring'](0x0,_0xb7e2ce['indexOf']('_'));var _0x5a7a79=_0xb7e2ce['substring'](_0xb7e2ce[_0xf47b('0x3b')]('_')+0x1);if(_0x585180===_0x2f60c2){_0x440153[_0x5a7a79]=_0x1bdc4a[_0xf47b('0x3c')];}}});}return _0x440153;}function getTicket(_0xcbe3d7,_0x5ec129,_0x15aad6,_0x4d4c2e,_0x250a97,_0x5c32c9,_0x288383){return new BPromise(function(_0x56fab8,_0x46e3e2){var _0x4e357c;return getAuthToken(_0x5ec129,_0x15aad6,_0x288383)[_0xf47b('0xe')](function(_0x189e8e){if(_0x5c32c9[_0xf47b('0x3d')]===_0xf47b('0x3e')){_0x4e357c={'method':_0xf47b('0xa'),'uri':_0x4d4c2e+_0xf47b('0x3f'),'body':Object[_0xf47b('0x40')]({},{'title':intUtil[_0xf47b('0x41')](_0x5c32c9[_0xf47b('0x42')],_0x250a97,'\x20'),'description':intUtil[_0xf47b('0x41')](_0x5c32c9[_0xf47b('0x43')],_0x250a97,'\x0a'),'customerid_contact@odata.bind':_0xf47b('0x44')+_0xcbe3d7['enduserId']+')','ownerid@odata.bind':_0xf47b('0x2a')+_0xcbe3d7[_0xf47b('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x5c32c9[_0xf47b('0x45')],_0x250a97,_0x5c32c9[_0xf47b('0x3d')])),'headers':{'Authorization':_0xf47b('0x16')+_0x189e8e,'OData-Version':_0xf47b('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5c32c9['ticketType']===_0xf47b('0x46')){_0x4e357c={'method':_0xf47b('0xa'),'uri':_0x4d4c2e+_0xf47b('0x47'),'body':Object[_0xf47b('0x40')]({},{'subject':intUtil['getString'](_0x5c32c9['Subjects'],_0x250a97,'\x20'),'phonenumber':String(_0x250a97['calleridnum']),'description':intUtil['getString'](_0x5c32c9[_0xf47b('0x43')],_0x250a97,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf47b('0x44')+_0xcbe3d7[_0xf47b('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0xcbe3d7['userId']+')','directioncode':_0xcbe3d7[_0xf47b('0x48')]===_0xf47b('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xf47b('0x2a')+_0xcbe3d7['userId']+')','participationtypemask':_0xcbe3d7[_0xf47b('0x48')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xcbe3d7[_0xf47b('0x2e')]+')','participationtypemask':_0xcbe3d7['callDirection']===_0xf47b('0x49')?0x1:0x2}]},getCustomFields(_0x5c32c9[_0xf47b('0x45')],_0x250a97,_0x5c32c9[_0xf47b('0x3d')])),'headers':{'Authorization':_0xf47b('0x16')+_0x189e8e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4e357c);})['then'](function(_0x5ef25f){var _0x1b6848=_0x5ef25f['headers']['odata-entityid'];var _0x5ba35f=_0x1b6848[_0xf47b('0x4a')](_0x1b6848[_0xf47b('0x2d')]('(')+0x1,_0x1b6848[_0xf47b('0x2d')](')'));_0xcbe3d7['ticketId']=_0x5ba35f;_0x56fab8(_0xcbe3d7);})[_0xf47b('0x24')](function(_0x51ffad){_0x46e3e2(_0x51ffad[_0xf47b('0x13')]);});});}function emit(_0x4c9644,_0x49f0ad,_0x1b7921,_0x229a85){var _0x28c05a={'uri':util[_0xf47b('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x4c9644,_0x1b7921,_0x229a85)};io['to'](util[_0xf47b('0x4b')]('user:%s',_0x49f0ad))[_0xf47b('0x4c')](_0xf47b('0x4d'),_0x28c05a);}exports['cs']=function(_0x4cb91a,_0x2e88f1,_0xeaf5a1,_0x3f0199,_0x4e9ac9,_0x23dd94,_0x2ab538,_0x3ef2eb){var _0x1f54b7={};_0x23dd94[_0xf47b('0xb')]=intUtil[_0xf47b('0x4e')](_0x23dd94['remoteUri']);_0x23dd94[_0xf47b('0x4f')]=intUtil[_0xf47b('0x4e')](_0x23dd94[_0xf47b('0x4f')]);_0x1f54b7[_0xf47b('0x48')]=_0x3ef2eb===_0xf47b('0x49')||_0x3ef2eb===_0xf47b('0x50')?_0xf47b('0x49'):'outbound';var _0x3d0bde=util[_0xf47b('0x4b')]('%s/api/data/v9.0/',_0x23dd94[_0xf47b('0xb')]);var _0x595861=util['format'](_0xf47b('0x51'),_0x23dd94[_0xf47b('0x52')]);var _0x59e0e5=util['format'](_0xf47b('0x53'),_0x23dd94[_0xf47b('0x4f')],_0x2e88f1[_0xf47b('0x54')],md5(_0x2e88f1[_0xf47b('0x54')]));if(_0x4e9ac9&&_0x4e9ac9['monitor_format']){logger[_0xf47b('0x1c')]('[QUEUE]',_0xf47b('0x55'));_0x2e88f1[_0xf47b('0x56')]=_0x59e0e5;}else if(_0x2ab538&&_0x2ab538[_0xf47b('0x57')]&&_0x2ab538['recordingFormat']!==_0xf47b('0x58')){logger[_0xf47b('0x1c')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2e88f1['recordingURL']=_0x59e0e5;}else{_0x2e88f1['recordingURL']='';}return getUser(_0x1f54b7,_0x23dd94,_0x3f0199,_0x595861,_0x3d0bde,_0x3ef2eb)['then'](function(_0x3cc36e){logger['info']('['+_0x3ef2eb[_0xf47b('0x11')]()+_0xf47b('0x59'),_0x3cc36e[_0xf47b('0x1f')]);logger[_0xf47b('0x1c')]('['+_0x3ef2eb[_0xf47b('0x11')]()+']\x20The\x20User\x20email\x20is:',_0x3cc36e[_0xf47b('0x21')]);return getEndUser(_0x3cc36e,_0x23dd94,_0x595861,_0x3d0bde,_0x2e88f1,_0x3ef2eb);})[_0xf47b('0xe')](function(_0x13fb48){logger[_0xf47b('0x1c')]('['+_0x3ef2eb['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x13fb48[_0xf47b('0x2e')]);logger['info']('['+_0x3ef2eb[_0xf47b('0x11')]()+_0xf47b('0x5a'),_0x2e88f1[_0xf47b('0x28')]);return getTicket(_0x13fb48,_0x23dd94,_0x595861,_0x3d0bde,_0x2e88f1,_0xeaf5a1,_0x3ef2eb);})[_0xf47b('0xe')](function(_0x5c4351){logger[_0xf47b('0x1c')](util[_0xf47b('0x4b')]('['+_0x3ef2eb[_0xf47b('0x11')]()+_0xf47b('0x5b'),_0xeaf5a1['ticketType'],_0x5c4351[_0xf47b('0x5c')]));logger[_0xf47b('0x1c')](util[_0xf47b('0x4b')]('['+_0x3ef2eb[_0xf47b('0x11')]()+']\x20Call\x20direction:\x20%s',_0x3ef2eb));if(_0x3ef2eb!=='unmanaged'){logger[_0xf47b('0x1c')]('['+_0x3ef2eb['toUpperCase']()+']',_0xf47b('0x5d'));emit(_0x23dd94[_0xf47b('0xb')],_0x3f0199['name'],_0xeaf5a1['ticketType'],_0x5c4351[_0xf47b('0x5c')]);}})[_0xf47b('0x24')](function(_0x3e0e80){logger[_0xf47b('0x10')]('['+_0x3ef2eb[_0xf47b('0x11')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xf47b('0x5e')](_0x3e0e80,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index cbb6476..ff92317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13d5=['toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','remoteUri','info','validateEmail','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','toString','base64','stringify','GET','includes','string','picklist','nameField','customField','content','idField','push','variable','variableName','type','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent'];(function(_0x3ecd0e,_0x3a7ef2){var _0x5b7d10=function(_0x43ee45){while(--_0x43ee45){_0x3ecd0e['push'](_0x3ecd0e['shift']());}};_0x5b7d10(++_0x3a7ef2);}(_0x13d5,0xb3));var _0x513d=function(_0x5a74ca,_0x545dd3){_0x5a74ca=_0x5a74ca-0x0;var _0x348a85=_0x13d5[_0x5a74ca];return _0x348a85;};'use strict';var _=require(_0x513d('0x0'));var rp=require(_0x513d('0x1'));var md5=require(_0x513d('0x2'));var util=require(_0x513d('0x3'));var Redis=require(_0x513d('0x4'));var intUtil=require(_0x513d('0x5'));var config=require(_0x513d('0x6'));var logger=require(_0x513d('0x7'))(_0x513d('0x8'));config[_0x513d('0x9')]=_[_0x513d('0xa')](config[_0x513d('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x513d('0xb'),'Accept':_0x513d('0xb')};function emit(_0x419f84,_0x20544a,_0x29b9b){io['to'](_0x419f84)[_0x513d('0xc')](_0x20544a,_0x29b9b);}function getTicket(_0x21f7ec,_0x6f169e,_0x9116ad,_0x3897af,_0x449933){logger['info']('Creating\x20new\x20ticket...');var _0x271513=_[_0x513d('0xd')]({'responder_id':_0x6f169e['id'],'requester_id':_0x9116ad['id'],'name':util[_0x513d('0xe')]('Caller\x20-\x20%s',_0x449933[_0x513d('0xf')]),'phone':_0x449933[_0x513d('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x513d('0x11')](_0x3897af[_0x513d('0x12')],_0x449933,'\x20'),'description':intUtil[_0x513d('0x11')](_0x3897af[_0x513d('0x13')],_0x449933,_0x513d('0x14')),'tags':getTags(_0x3897af[_0x513d('0x15')],'name')},getCustomFields(_0x3897af[_0x513d('0x16')],_0x449933));_0x271513[_0x513d('0x17')]=_[_0x513d('0x18')](_[_0x513d('0x19')](_0x271513['custom_fields'],'id'),'value');return request({'uri':util[_0x513d('0xe')]('%s/api/v2/tickets',_0x21f7ec[_0x513d('0x1a')]),'method':'POST','body':_0x271513})['then'](function(_0x3db2f9){logger[_0x513d('0x1b')]('Ticket\x20created!');return _0x3db2f9;});}function getUser(_0x1b3cea,_0x52764b){if(intUtil[_0x513d('0x1c')](_0x52764b)){return request({'uri':util[_0x513d('0xe')]('%s/api/v2/agents',_0x1b3cea[_0x513d('0x1a')]),'qs':{'email':_0x52764b}})['then'](function(_0x427c3d){if(_0x427c3d[_0x513d('0x1d')]){logger[_0x513d('0x1b')](_0x513d('0x1e'));return _[_0x513d('0x1f')](_0x427c3d,function(_0x4f16c9){return _0x4f16c9['contact'][_0x513d('0x20')]===_0x52764b;});}else{logger[_0x513d('0x1b')](_0x513d('0x21'));return request({'uri':util[_0x513d('0xe')]('%s/api/v2/agents/me',_0x1b3cea[_0x513d('0x1a')])})[_0x513d('0x22')](function(_0x13af38){logger[_0x513d('0x1b')](_0x513d('0x23'));return _0x13af38;});}});}else{logger['info'](_0x513d('0x24'));return request({'uri':util['format'](_0x513d('0x25'),_0x1b3cea[_0x513d('0x1a')])})['then'](function(_0x2001ce){logger['info'](_0x513d('0x23'));return _0x2001ce;});}}function getEndUser(_0x32b8f9,_0x45069f,_0x27945c){logger[_0x513d('0x1b')](_0x513d('0x26'),_0x27945c);return request({'uri':util[_0x513d('0xe')]('%s/api/v2/contacts',_0x32b8f9[_0x513d('0x1a')]),'qs':{'phone':_0x27945c}})['then'](function(_0x27ad7a){if(_0x27ad7a[_0x513d('0x1d')]){logger[_0x513d('0x1b')](_0x513d('0x27'));return _[_0x513d('0x1f')](_0x27ad7a,{'phone':_0x27945c});}else{logger[_0x513d('0x1b')](_0x513d('0x28'));return request({'uri':util[_0x513d('0xe')](_0x513d('0x29'),_0x32b8f9[_0x513d('0x1a')]),'method':'POST','body':{'name':_0x45069f,'phone':_0x27945c}})['then'](function(_0x402854){logger['info'](_0x513d('0x2a'));return _0x402854;});}});}function getAuth(_0x14f176){return util[_0x513d('0xe')]('Basic\x20%s',new Buffer(_0x14f176['apiKey']+':X')[_0x513d('0x2b')](_0x513d('0x2c')));}function request(_0x4e8ff0){logger['debug']('[HTTP]',JSON[_0x513d('0x2d')](_0x4e8ff0));return rp(_[_0x513d('0xa')](_0x4e8ff0,{'method':_0x513d('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x2844a9,_0x2d503c){var _0x56de79=[];if(_0x2844a9&&_0x2844a9[_0x513d('0x1d')]>0x0){_0x56de79=_['map'](_0x2844a9,_0x2d503c);}return _0x56de79;}function getCustomFields(_0x4758be,_0x391239){var _0x1b1cb2=[];var _0x54e491={'custom_fields':[]};if(_0x4758be[_0x513d('0x1d')]>0x0){_['forEach'](_0x4758be,function(_0x12a92c){if(_[_0x513d('0x2f')]([_0x513d('0x30'),_0x513d('0x31')],_0x12a92c['type'])&&_0x12a92c[_0x513d('0x32')]&&!_0x12a92c[_0x513d('0x33')]){_0x54e491[_0x12a92c[_0x513d('0x32')]['toLowerCase']()]=_0x12a92c[_0x513d('0x34')][_0x513d('0x2b')]();}else if(_[_0x513d('0x2f')](['string',_0x513d('0x31')],_0x12a92c['type'])&&_0x12a92c[_0x513d('0x35')]&&_0x12a92c[_0x513d('0x33')]){_0x54e491['custom_fields'][_0x513d('0x36')]({'id':_0x12a92c[_0x513d('0x35')],'value':_0x12a92c[_0x513d('0x34')][_0x513d('0x2b')]()});}else if(_0x12a92c['type']===_0x513d('0x37')&&_0x12a92c[_0x513d('0x38')]&&_0x12a92c['idField']&&_0x12a92c[_0x513d('0x33')]){_0x391239[_0x12a92c[_0x513d('0x38')]]&&_0x54e491[_0x513d('0x17')][_0x513d('0x36')]({'id':_0x12a92c[_0x513d('0x35')],'value':_0x391239[_0x12a92c[_0x513d('0x38')]][_0x513d('0x2b')]()});}else if(_0x12a92c[_0x513d('0x39')]==='customVariable'&&_0x12a92c[_0x513d('0x3a')]&&_0x12a92c['Variable'][_0x513d('0x3b')]&&_0x12a92c[_0x513d('0x35')]&&_0x12a92c['customField']){_0x391239[_0x12a92c[_0x513d('0x3a')][_0x513d('0x3b')]['toLowerCase']()]&&_0x54e491[_0x513d('0x17')][_0x513d('0x36')]({'id':_0x12a92c[_0x513d('0x35')],'value':_0x391239[_0x12a92c[_0x513d('0x3a')][_0x513d('0x3b')]['toLowerCase']()][_0x513d('0x2b')]()});}});}return _0x54e491;}exports[_0x513d('0x3c')]=function(_0x167bd5,_0x2430ef,_0xec3560,_0x4c0aec,_0x18420e,_0x4c726c){var _0x4bb3e9,_0x3e8e77;_0x4c726c[_0x513d('0x1a')]=intUtil['stripTrailingSlash'](_0x4c726c['remoteUri']);_0x4c726c[_0x513d('0x3d')]=intUtil[_0x513d('0x3e')](_0x4c726c[_0x513d('0x3d')]);if(_0x18420e&&_0x18420e[_0x513d('0x3f')]){logger[_0x513d('0x1b')]('[QUEUE]',_0x513d('0x40'));_0x2430ef['recordingURL']=util['format'](_0x513d('0x41'),_0x4c726c['serverUrl'],_0x2430ef['uniqueid'],md5(_0x2430ef[_0x513d('0x42')]));}else{_0x2430ef[_0x513d('0x43')]='';}headers[_0x513d('0x44')]=getAuth(_0x4c726c);return getUser(_0x4c726c,_0x4c0aec[_0x513d('0x20')])[_0x513d('0x22')](function(_0x1f434e){_0x4bb3e9=_0x1f434e;logger[_0x513d('0x1b')](_0x513d('0x45'),_0x4bb3e9['id']);return getEndUser(_0x4c726c,_0x2430ef[_0x513d('0xf')],_0x2430ef[_0x513d('0x10')]);})[_0x513d('0x22')](function(_0x3f0db9){_0x3e8e77=_0x3f0db9;logger[_0x513d('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x3e8e77['id']);return getTicket(_0x4c726c,_0x4bb3e9,_0x3e8e77,_0xec3560,_0x2430ef);})['then'](function(_0x525e39){if(_0x525e39&&_0x525e39['id']){logger[_0x513d('0x1b')](_0x513d('0x46'));logger[_0x513d('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x525e39['id']);logger['info'](_0x513d('0x47'),_0x513d('0x48'));emit(util[_0x513d('0xe')](_0x513d('0x49'),_0x4c0aec[_0x513d('0x3b')]),_0x513d('0x4a'),{'uri':util['format'](_0x513d('0x4b'),_0x4c726c[_0x513d('0x1a')],_0x525e39['id'])});}})[_0x513d('0x4c')](function(_0x2d5230){logger[_0x513d('0x4d')](_0x513d('0x47'),JSON[_0x513d('0x2d')](_0x2d5230));});};exports[_0x513d('0x4e')]=function(_0x1bed9c,_0xd3a464,_0x56973e,_0x2d5a10,_0x15fb55,_0x171633,_0x44621c){var _0x25a053,_0x4346a0;_0x171633[_0x513d('0x1a')]=intUtil[_0x513d('0x3e')](_0x171633[_0x513d('0x1a')]);_0x171633[_0x513d('0x3d')]=intUtil[_0x513d('0x3e')](_0x171633[_0x513d('0x3d')]);if(_0x44621c&&_0x44621c[_0x513d('0x4f')]&&_0x44621c[_0x513d('0x4f')]!==_0x513d('0x50')){logger['info'](_0x513d('0x51'),'Recording\x20is\x20enabled!');_0xd3a464[_0x513d('0x43')]=util[_0x513d('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x171633[_0x513d('0x3d')],_0xd3a464[_0x513d('0x42')],md5(_0xd3a464[_0x513d('0x42')]));}headers[_0x513d('0x44')]=getAuth(_0x171633);return getUser(_0x171633,_0x2d5a10[_0x513d('0x20')])[_0x513d('0x22')](function(_0x1c3d84){_0x25a053=_0x1c3d84;logger[_0x513d('0x1b')]('The\x20User\x20ID\x20is:',_0x25a053['id']);return getEndUser(_0x171633,_0xd3a464[_0x513d('0x52')],_0xd3a464[_0x513d('0x53')]);})['then'](function(_0x4fb765){_0x4346a0=_0x4fb765;logger[_0x513d('0x1b')](_0x513d('0x54'),_0x4346a0['id']);return getTicket(_0x171633,_0x25a053,_0x4346a0,_0x56973e,_0xd3a464);})[_0x513d('0x22')](function(_0x207fb9){if(_0x207fb9&&_0x207fb9['id']){logger[_0x513d('0x1b')](_0x513d('0x46'));logger[_0x513d('0x1b')](_0x513d('0x55'),_0x207fb9['id']);logger[_0x513d('0x1b')](_0x513d('0x51'),_0x513d('0x48'));emit(util[_0x513d('0xe')](_0x513d('0x49'),_0x2d5a10[_0x513d('0x3b')]),_0x513d('0x4a'),{'uri':util['format'](_0x513d('0x4b'),_0x171633[_0x513d('0x1a')],_0x207fb9['id'])});}})[_0x513d('0x4c')](function(_0x2681d5){logger[_0x513d('0x4d')](_0x513d('0x51'),JSON['stringify'](_0x2681d5));});};exports[_0x513d('0x56')]=function(_0x4a6715,_0x565f09,_0x46c133,_0x4e3b8d,_0x34e7a3,_0x563e32){var _0x3c1438,_0x5ae4b8;_0x563e32[_0x513d('0x1a')]=intUtil[_0x513d('0x3e')](_0x563e32['remoteUri']);_0x563e32[_0x513d('0x3d')]=intUtil[_0x513d('0x3e')](_0x563e32[_0x513d('0x3d')]);if(_0x34e7a3&&_0x34e7a3[_0x513d('0x3f')]){logger[_0x513d('0x1b')]('['+_0x565f09[_0x513d('0x57')][_0x513d('0x58')]()+']',_0x513d('0x40'));_0x565f09[_0x513d('0x43')]=util['format'](_0x513d('0x41'),_0x563e32['serverUrl'],_0x565f09['uniqueid'],md5(_0x565f09[_0x513d('0x42')]));}else{_0x565f09['recordingURL']='';}headers[_0x513d('0x44')]=getAuth(_0x563e32);return getUser(_0x563e32,'')[_0x513d('0x22')](function(_0x5e70e5){_0x3c1438=_0x5e70e5;logger[_0x513d('0x1b')](_0x513d('0x45'),_0x3c1438['id']);return getEndUser(_0x563e32,_0x565f09[_0x513d('0xf')],_0x565f09[_0x513d('0x10')]);})[_0x513d('0x22')](function(_0x51e849){_0x5ae4b8=_0x51e849;logger['info'](_0x513d('0x54'),_0x5ae4b8['id']);return getTicket(_0x563e32,_0x3c1438,_0x5ae4b8,_0x46c133,_0x565f09);})['then'](function(_0x57ce0c){if(_0x57ce0c){logger[_0x513d('0x1b')]('Ticket\x20created!');logger[_0x513d('0x1b')](_0x513d('0x55'),_0x57ce0c['id']);}})['catch'](function(_0x4f64a6){logger[_0x513d('0x4d')]('['+_0x565f09[_0x513d('0x57')][_0x513d('0x58')]()+']',JSON[_0x513d('0x2d')](_0x4f64a6));});};
\ No newline at end of file
+var _0x8ade=['then','Ticket\x20created!','validateEmail','length','Agent\x20found!','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','picklist','nameField','customField','toLowerCase','toString','includes','string','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','[QUEUE]','recordingURL','uniqueid','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','calleridnum','getString','Subjects','Descriptions','<br>','name','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST'];(function(_0x4e6eac,_0x3f4365){var _0x79f963=function(_0x36fc3c){while(--_0x36fc3c){_0x4e6eac['push'](_0x4e6eac['shift']());}};_0x79f963(++_0x3f4365);}(_0x8ade,0x1a7));var _0xe8ad=function(_0x2bbf44,_0x453c7b){_0x2bbf44=_0x2bbf44-0x0;var _0x335867=_0x8ade[_0x2bbf44];return _0x335867;};'use strict';var _=require('lodash');var rp=require(_0xe8ad('0x0'));var md5=require(_0xe8ad('0x1'));var util=require(_0xe8ad('0x2'));var Redis=require(_0xe8ad('0x3'));var intUtil=require(_0xe8ad('0x4'));var config=require('../../../../config/environment');var logger=require(_0xe8ad('0x5'))(_0xe8ad('0x6'));config[_0xe8ad('0x7')]=_['defaults'](config[_0xe8ad('0x7')],{'host':_0xe8ad('0x8'),'port':0x18eb});var io=require(_0xe8ad('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0xe8ad('0xa'),'Accept':_0xe8ad('0xa')};function emit(_0x35f3f9,_0xe0a99b,_0x3cd72f){io['to'](_0x35f3f9)[_0xe8ad('0xb')](_0xe0a99b,_0x3cd72f);}function getTicket(_0x5b90c0,_0x430c4b,_0x306419,_0x3e8cf1,_0x4dbff1){logger[_0xe8ad('0xc')](_0xe8ad('0xd'));var _0x3e3f76=_['merge']({'responder_id':_0x430c4b['id'],'requester_id':_0x306419['id'],'name':util[_0xe8ad('0xe')]('Caller\x20-\x20%s',_0x4dbff1['calleridname']),'phone':_0x4dbff1[_0xe8ad('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe8ad('0x10')](_0x3e8cf1[_0xe8ad('0x11')],_0x4dbff1,'\x20'),'description':intUtil[_0xe8ad('0x10')](_0x3e8cf1[_0xe8ad('0x12')],_0x4dbff1,_0xe8ad('0x13')),'tags':getTags(_0x3e8cf1['Tags'],_0xe8ad('0x14'))},getCustomFields(_0x3e8cf1['Fields'],_0x4dbff1));_0x3e3f76['custom_fields']=_[_0xe8ad('0x15')](_[_0xe8ad('0x16')](_0x3e3f76['custom_fields'],'id'),_0xe8ad('0x17'));return request({'uri':util[_0xe8ad('0xe')](_0xe8ad('0x18'),_0x5b90c0[_0xe8ad('0x19')]),'method':_0xe8ad('0x1a'),'body':_0x3e3f76})[_0xe8ad('0x1b')](function(_0x3f4de1){logger[_0xe8ad('0xc')](_0xe8ad('0x1c'));return _0x3f4de1;});}function getUser(_0x44c9ba,_0x26b4e9){if(intUtil[_0xe8ad('0x1d')](_0x26b4e9)){return request({'uri':util[_0xe8ad('0xe')]('%s/api/v2/agents',_0x44c9ba[_0xe8ad('0x19')]),'qs':{'email':_0x26b4e9}})[_0xe8ad('0x1b')](function(_0x4f7e3c){if(_0x4f7e3c[_0xe8ad('0x1e')]){logger[_0xe8ad('0xc')](_0xe8ad('0x1f'));return _['find'](_0x4f7e3c,function(_0x414e06){return _0x414e06['contact'][_0xe8ad('0x20')]===_0x26b4e9;});}else{logger[_0xe8ad('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe8ad('0xe')](_0xe8ad('0x21'),_0x44c9ba[_0xe8ad('0x19')])})[_0xe8ad('0x1b')](function(_0x4676c5){logger[_0xe8ad('0xc')](_0xe8ad('0x22'));return _0x4676c5;});}});}else{logger[_0xe8ad('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe8ad('0x21'),_0x44c9ba[_0xe8ad('0x19')])})[_0xe8ad('0x1b')](function(_0x20340a){logger['info'](_0xe8ad('0x22'));return _0x20340a;});}}function getEndUser(_0x266527,_0x19fbd5,_0x30db98){logger[_0xe8ad('0xc')](_0xe8ad('0x23'),_0x30db98);return request({'uri':util[_0xe8ad('0xe')](_0xe8ad('0x24'),_0x266527['remoteUri']),'qs':{'phone':_0x30db98}})[_0xe8ad('0x1b')](function(_0x354846){if(_0x354846['length']){logger['info'](_0xe8ad('0x25'));return _[_0xe8ad('0x26')](_0x354846,{'phone':_0x30db98});}else{logger[_0xe8ad('0xc')](_0xe8ad('0x27'));return request({'uri':util[_0xe8ad('0xe')]('%s/api/v2/contacts',_0x266527[_0xe8ad('0x19')]),'method':_0xe8ad('0x1a'),'body':{'name':_0x19fbd5,'phone':_0x30db98}})[_0xe8ad('0x1b')](function(_0x355a3d){logger[_0xe8ad('0xc')]('Enduser\x20created.');return _0x355a3d;});}});}function getAuth(_0x3b342e){return util[_0xe8ad('0xe')]('Basic\x20%s',new Buffer(_0x3b342e[_0xe8ad('0x28')]+':X')['toString'](_0xe8ad('0x29')));}function request(_0x2103de){logger[_0xe8ad('0x2a')](_0xe8ad('0x2b'),JSON[_0xe8ad('0x2c')](_0x2103de));return rp(_['defaults'](_0x2103de,{'method':_0xe8ad('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x18181b,_0x326b17){var _0x3cbedc=[];if(_0x18181b&&_0x18181b['length']>0x0){_0x3cbedc=_[_0xe8ad('0x2e')](_0x18181b,_0x326b17);}return _0x3cbedc;}function getCustomFields(_0x5e997d,_0xe7939b){var _0x10f89a=[];var _0x5332cd={'custom_fields':[]};if(_0x5e997d[_0xe8ad('0x1e')]>0x0){_[_0xe8ad('0x2f')](_0x5e997d,function(_0x2b15f2){if(_['includes'](['string',_0xe8ad('0x30')],_0x2b15f2['type'])&&_0x2b15f2[_0xe8ad('0x31')]&&!_0x2b15f2[_0xe8ad('0x32')]){_0x5332cd[_0x2b15f2['nameField'][_0xe8ad('0x33')]()]=_0x2b15f2['content'][_0xe8ad('0x34')]();}else if(_[_0xe8ad('0x35')]([_0xe8ad('0x36'),_0xe8ad('0x30')],_0x2b15f2[_0xe8ad('0x37')])&&_0x2b15f2[_0xe8ad('0x38')]&&_0x2b15f2[_0xe8ad('0x32')]){_0x5332cd[_0xe8ad('0x39')][_0xe8ad('0x3a')]({'id':_0x2b15f2[_0xe8ad('0x38')],'value':_0x2b15f2['content']['toString']()});}else if(_0x2b15f2[_0xe8ad('0x37')]===_0xe8ad('0x3b')&&_0x2b15f2[_0xe8ad('0x3c')]&&_0x2b15f2[_0xe8ad('0x38')]&&_0x2b15f2[_0xe8ad('0x32')]){_0xe7939b[_0x2b15f2[_0xe8ad('0x3c')]]&&_0x5332cd[_0xe8ad('0x39')]['push']({'id':_0x2b15f2[_0xe8ad('0x38')],'value':_0xe7939b[_0x2b15f2[_0xe8ad('0x3c')]][_0xe8ad('0x34')]()});}else if(_0x2b15f2['type']===_0xe8ad('0x3d')&&_0x2b15f2['Variable']&&_0x2b15f2[_0xe8ad('0x3e')][_0xe8ad('0x14')]&&_0x2b15f2[_0xe8ad('0x38')]&&_0x2b15f2['customField']){_0xe7939b[_0x2b15f2[_0xe8ad('0x3e')][_0xe8ad('0x14')][_0xe8ad('0x33')]()]&&_0x5332cd[_0xe8ad('0x39')]['push']({'id':_0x2b15f2[_0xe8ad('0x38')],'value':_0xe7939b[_0x2b15f2['Variable'][_0xe8ad('0x14')][_0xe8ad('0x33')]()][_0xe8ad('0x34')]()});}});}return _0x5332cd;}exports[_0xe8ad('0x3f')]=function(_0x3deb39,_0x51fe96,_0x555528,_0xe6f351,_0x58d823,_0x285485){var _0x472559,_0x7ddb55;_0x285485['remoteUri']=intUtil['stripTrailingSlash'](_0x285485[_0xe8ad('0x19')]);_0x285485[_0xe8ad('0x40')]=intUtil['stripTrailingSlash'](_0x285485[_0xe8ad('0x40')]);if(_0x58d823&&_0x58d823['monitor_format']){logger[_0xe8ad('0xc')](_0xe8ad('0x41'),'Recording\x20is\x20enabled!');_0x51fe96[_0xe8ad('0x42')]=util[_0xe8ad('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x285485[_0xe8ad('0x40')],_0x51fe96[_0xe8ad('0x43')],md5(_0x51fe96[_0xe8ad('0x43')]));}else{_0x51fe96[_0xe8ad('0x42')]='';}headers['Authorization']=getAuth(_0x285485);return getUser(_0x285485,_0xe6f351[_0xe8ad('0x20')])['then'](function(_0x4799df){_0x472559=_0x4799df;logger[_0xe8ad('0xc')]('The\x20User\x20ID\x20is:',_0x472559['id']);return getEndUser(_0x285485,_0x51fe96['calleridname'],_0x51fe96[_0xe8ad('0xf')]);})['then'](function(_0x41386b){_0x7ddb55=_0x41386b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x7ddb55['id']);return getTicket(_0x285485,_0x472559,_0x7ddb55,_0x555528,_0x51fe96);})[_0xe8ad('0x1b')](function(_0x4d80bb){if(_0x4d80bb&&_0x4d80bb['id']){logger[_0xe8ad('0xc')]('Ticket\x20created!');logger[_0xe8ad('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4d80bb['id']);logger[_0xe8ad('0xc')]('[QUEUE]',_0xe8ad('0x44'));emit(util['format']('user:%s',_0xe6f351['name']),_0xe8ad('0x45'),{'uri':util['format'](_0xe8ad('0x46'),_0x285485[_0xe8ad('0x19')],_0x4d80bb['id'])});}})[_0xe8ad('0x47')](function(_0x803cea){logger[_0xe8ad('0x48')]('[QUEUE]',JSON[_0xe8ad('0x2c')](_0x803cea));});};exports[_0xe8ad('0x49')]=function(_0x187da1,_0x2b78b5,_0x25d909,_0x4b5ab3,_0x3e749b,_0x4ef8f7,_0x472af0){var _0x4ba5e4,_0x101cf9;_0x4ef8f7[_0xe8ad('0x19')]=intUtil[_0xe8ad('0x4a')](_0x4ef8f7[_0xe8ad('0x19')]);_0x4ef8f7['serverUrl']=intUtil['stripTrailingSlash'](_0x4ef8f7[_0xe8ad('0x40')]);if(_0x472af0&&_0x472af0['recordingFormat']&&_0x472af0[_0xe8ad('0x4b')]!==_0xe8ad('0x4c')){logger[_0xe8ad('0xc')](_0xe8ad('0x4d'),_0xe8ad('0x4e'));_0x2b78b5[_0xe8ad('0x42')]=util[_0xe8ad('0xe')](_0xe8ad('0x4f'),_0x4ef8f7['serverUrl'],_0x2b78b5[_0xe8ad('0x43')],md5(_0x2b78b5['uniqueid']));}headers[_0xe8ad('0x50')]=getAuth(_0x4ef8f7);return getUser(_0x4ef8f7,_0x4b5ab3[_0xe8ad('0x20')])[_0xe8ad('0x1b')](function(_0x200cb5){_0x4ba5e4=_0x200cb5;logger['info'](_0xe8ad('0x51'),_0x4ba5e4['id']);return getEndUser(_0x4ef8f7,_0x2b78b5['destcalleridname'],_0x2b78b5['destcalleridnum']);})['then'](function(_0x50c8b9){_0x101cf9=_0x50c8b9;logger[_0xe8ad('0xc')](_0xe8ad('0x52'),_0x101cf9['id']);return getTicket(_0x4ef8f7,_0x4ba5e4,_0x101cf9,_0x25d909,_0x2b78b5);})[_0xe8ad('0x1b')](function(_0x51dda2){if(_0x51dda2&&_0x51dda2['id']){logger[_0xe8ad('0xc')](_0xe8ad('0x1c'));logger[_0xe8ad('0xc')]('The\x20Ticket\x20ID\x20is:',_0x51dda2['id']);logger[_0xe8ad('0xc')](_0xe8ad('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xe8ad('0x53'),_0x4b5ab3['name']),_0xe8ad('0x45'),{'uri':util['format'](_0xe8ad('0x46'),_0x4ef8f7[_0xe8ad('0x19')],_0x51dda2['id'])});}})['catch'](function(_0x3d283b){logger[_0xe8ad('0x48')](_0xe8ad('0x4d'),JSON[_0xe8ad('0x2c')](_0x3d283b));});};exports[_0xe8ad('0x54')]=function(_0x6b194b,_0x9f74a,_0x2eeeed,_0x2e628c,_0x38491c,_0x54cad1){var _0x5d1930,_0x5137e6;_0x54cad1['remoteUri']=intUtil[_0xe8ad('0x4a')](_0x54cad1[_0xe8ad('0x19')]);_0x54cad1['serverUrl']=intUtil['stripTrailingSlash'](_0x54cad1[_0xe8ad('0x40')]);if(_0x38491c&&_0x38491c[_0xe8ad('0x55')]){logger[_0xe8ad('0xc')]('['+_0x9f74a[_0xe8ad('0x56')][_0xe8ad('0x57')]()+']',_0xe8ad('0x4e'));_0x9f74a[_0xe8ad('0x42')]=util[_0xe8ad('0xe')](_0xe8ad('0x4f'),_0x54cad1[_0xe8ad('0x40')],_0x9f74a[_0xe8ad('0x43')],md5(_0x9f74a['uniqueid']));}else{_0x9f74a[_0xe8ad('0x42')]='';}headers[_0xe8ad('0x50')]=getAuth(_0x54cad1);return getUser(_0x54cad1,'')['then'](function(_0x566553){_0x5d1930=_0x566553;logger['info'](_0xe8ad('0x51'),_0x5d1930['id']);return getEndUser(_0x54cad1,_0x9f74a[_0xe8ad('0x58')],_0x9f74a['calleridnum']);})['then'](function(_0x57d8c3){_0x5137e6=_0x57d8c3;logger[_0xe8ad('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5137e6['id']);return getTicket(_0x54cad1,_0x5d1930,_0x5137e6,_0x2eeeed,_0x9f74a);})[_0xe8ad('0x1b')](function(_0x479db9){if(_0x479db9){logger[_0xe8ad('0xc')](_0xe8ad('0x1c'));logger[_0xe8ad('0xc')](_0xe8ad('0x59'),_0x479db9['id']);}})[_0xe8ad('0x47')](function(_0x1ccb6f){logger[_0xe8ad('0x48')]('['+_0x9f74a['lastevent']['toUpperCase']()+']',JSON[_0xe8ad('0x2c')](_0x1ccb6f));});};
\ No newline at end of file
index e65115c..9779e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf433=['stripTrailingSlash','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','apiKey','remoteUri','serverUrl'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0xf433,0x10b));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var rp=require('request-promise');var md5=require(_0x3f43('0x1'));var util=require(_0x3f43('0x2'));var moment=require(_0x3f43('0x3'));var Promise=require(_0x3f43('0x4'));var Redis=require(_0x3f43('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3f43('0x6'))('freshsales');config[_0x3f43('0x7')]=_[_0x3f43('0x8')](config[_0x3f43('0x7')],{'host':_0x3f43('0x9'),'port':0x18eb});var io=require(_0x3f43('0xa'))(new Redis(config[_0x3f43('0x7')]));function getAdminId(_0x469776,_0x181e4c,_0x5cc52e,_0x565f38){return new Promise(function(_0x737b14,_0x4a28b9){var _0x206ed9=![];var _0x5a32dc={'method':_0x3f43('0xb'),'uri':_0x565f38+_0x3f43('0xc'),'json':!![]};_0x5a32dc[_0x3f43('0xd')]=_0x5cc52e;logger[_0x3f43('0xe')](_0x3f43('0xf'));return rp(_0x5a32dc)[_0x3f43('0x10')](function(_0xbf8144){if(_0xbf8144){var _0x62b243=_0xbf8144[_0x3f43('0x11')];var _0x45e614=null;for(_0x45e614=0x0;_0x45e614<_0x62b243['length'];_0x45e614++){if(_0x62b243[_0x45e614][_0x3f43('0x12')]===_0x469776['adminEmail']){_0x469776[_0x3f43('0x13')]=_0x62b243[_0x45e614]['id'];_0x206ed9=!![];}}if(_0x206ed9){logger['info'](_0x3f43('0x14'),_0x469776[_0x3f43('0x13')]);_0x737b14(_0x469776);}else{_0x4a28b9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4a28b9({'statusCode':0x194,'message':_0x3f43('0x15')});}})[_0x3f43('0x16')](function(_0x4c7c20){logger[_0x3f43('0x17')]('['+[_0x181e4c['toUpperCase']()]+']',_0x4c7c20['message']);_0x4a28b9(_0x4c7c20);});});}function getUser(_0xa4a653,_0xfcaaee,_0x1eea21){return function(_0x256ab5){return new Promise(function(_0x40d0f8,_0x45dd6f){var _0x45e1cd={'method':'GET','uri':_0x1eea21+_0x3f43('0xc'),'json':!![]};_0x45e1cd[_0x3f43('0xd')]=_0xfcaaee;logger[_0x3f43('0xe')]('Getting\x20user\x20list');return rp(_0x45e1cd)[_0x3f43('0x10')](function(_0x39a727){if(_0x39a727){var _0x377645=_0x39a727[_0x3f43('0x11')];var _0x1240fa=![];var _0x471fe4=null;if(_0x256ab5[_0x3f43('0x18')]!==null){logger[_0x3f43('0xe')](_0x3f43('0x19'),_0x256ab5[_0x3f43('0x18')]);_0x256ab5[_0x3f43('0x1a')]=_0x256ab5['agentEmail'];for(_0x471fe4=0x0;_0x471fe4<_0x377645[_0x3f43('0x1b')];_0x471fe4++){if(_0x377645[_0x471fe4][_0x3f43('0x12')]===_0x256ab5[_0x3f43('0x18')]){_0x1240fa=!![];_0x256ab5[_0x3f43('0x1c')]=_0x377645[_0x471fe4]['id'];logger[_0x3f43('0xe')](_0x3f43('0x1d'),_0x256ab5[_0x3f43('0x1c')]);}}}if(!_0x1240fa){logger[_0x3f43('0xe')](_0x3f43('0x1e'));_0x256ab5['userEmail']=_0x256ab5[_0x3f43('0x1f')];_0x256ab5[_0x3f43('0x1c')]=_0x256ab5['adminId'];_0x1240fa=!![];}if(_0x1240fa){_0x40d0f8(_0x256ab5);}else{_0x45dd6f({'statusCode':0x194,'message':_0x3f43('0x15')});}}else{_0x45dd6f({'statusCode':0x194,'message':_0x3f43('0x15')});}})[_0x3f43('0x16')](function(_0x39b538){logger['error']('['+[_0xa4a653[_0x3f43('0x20')]()]+']',_0x39b538['message']);_0x45dd6f(_0x39b538);});});};}function searchContact(_0x3ab7b6,_0x4db668,_0x1a88bf,_0x264821){return new Promise(function(_0x2555eb,_0x48dcda){var _0x349861={'method':_0x3f43('0xb'),'headers':_0x4db668,'uri':_0x3ab7b6+_0x3f43('0x21')+_0x264821+'&f='+_0x1a88bf+'&entities=contact','json':!![]};rp(_0x349861)[_0x3f43('0x10')](function(_0x3ce76c){var _0x2cc0e7=_[_0x3f43('0x22')](_0x3ce76c[_0x3f43('0x23')][_0x3f43('0x23')],[_0x1a88bf,_0x264821]);_0x2555eb(_0x2cc0e7);})[_0x3f43('0x16')](function(_0x18be81){_0x48dcda(_0x18be81);});});}function getEndUser(_0x7357d5,_0x432e8a,_0x14ab73){return function(_0x56d25a){return new Promise(function(_0x5ed9ec,_0xa375f2){logger[_0x3f43('0xe')](util[_0x3f43('0x24')](_0x3f43('0x25'),_0x56d25a[_0x3f43('0x26')]));searchContact(_0x14ab73,_0x432e8a,_0x3f43('0x27'),_0x56d25a['contactNumber'])[_0x3f43('0x10')](function(_0x27894d){if(_0x27894d){_0x56d25a[_0x3f43('0x28')]=_0x27894d['id'];logger[_0x3f43('0xe')](_0x3f43('0x29'),_0x56d25a[_0x3f43('0x28')]);return _0x5ed9ec(_0x56d25a);}searchContact(_0x14ab73,_0x432e8a,_0x3f43('0x2a'),_0x56d25a[_0x3f43('0x26')])[_0x3f43('0x10')](function(_0x4b2ed2){if(_0x4b2ed2){_0x56d25a['endUserId']=_0x4b2ed2['id'];logger[_0x3f43('0xe')](_0x3f43('0x2b'),_0x56d25a['endUserId']);return _0x5ed9ec(_0x56d25a);}createEndUser(_0x56d25a,_0x7357d5,_0x432e8a,_0x14ab73)['then'](function(_0x3f2ba6){logger[_0x3f43('0xe')](_0x3f43('0x2c'),_0x3f2ba6[_0x3f43('0x28')]);return _0x5ed9ec(_0x3f2ba6);});});})[_0x3f43('0x16')](function(_0x4bd5cf){_0xa375f2(_0x4bd5cf);});});};}function createEndUser(_0x229c2e,_0x1f2dd3,_0x3d6ad9,_0x56188a){return new Promise(function(_0x495490,_0x4e8c57){var _0x4473e3=moment();var _0x555a44={'method':_0x3f43('0x2d'),'uri':_0x56188a+'/api/contacts','body':{'contact':{'last_name':_0x229c2e[_0x3f43('0x26')],'work_number':_0x229c2e[_0x3f43('0x26')],'mobile_number':_0x229c2e[_0x3f43('0x26')],'owner_id':_0x229c2e[_0x3f43('0x1c')],'created_at':_0x4473e3[_0x3f43('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x555a44['headers']=_0x3d6ad9;logger[_0x3f43('0xe')](_0x3f43('0x2e'));return rp(_0x555a44)[_0x3f43('0x10')](function(_0x17068d){_0x229c2e[_0x3f43('0x28')]=_0x17068d[_0x3f43('0x2f')]['id'];_0x495490(_0x229c2e);})[_0x3f43('0x16')](function(_0x211f0b){logger[_0x3f43('0x17')]('['+[_0x1f2dd3[_0x3f43('0x20')]()]+']',_0x211f0b[_0x3f43('0x30')]);_0x4e8c57(_0x211f0b[_0x3f43('0x30')]);});});}function getTicket(_0x1d7927,_0x54e2af,_0x1b1cdf,_0x2cd44f,_0x1f0fcd){return function(_0xaef8a7){logger[_0x3f43('0xe')](_0x3f43('0x31'));return new Promise(function(_0x5168d6,_0x319d3d){var _0x40892a=moment();var _0x41d892={'method':_0x3f43('0x2d'),'uri':_0x1b1cdf+_0x3f43('0x32'),'body':{'title':intUtil[_0x3f43('0x33')](_0x2cd44f['Subjects'],_0x1f0fcd,'\x20'),'description':intUtil[_0x3f43('0x33')](_0x2cd44f[_0x3f43('0x34')],_0x1f0fcd,'\x0a'),'owner_id':_0xaef8a7[_0x3f43('0x1c')],'creater_id':_0xaef8a7['adminId'],'targetable_id':_0xaef8a7[_0x3f43('0x28')],'targetable_type':_0x3f43('0x35'),'created_at':_0x40892a[_0x3f43('0x24')](_0x3f43('0x36')),'due_date':_0x40892a[_0x3f43('0x37')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x41d892[_0x3f43('0xd')]=_0x54e2af;return rp(_0x41d892)[_0x3f43('0x10')](function(_0x485db7){_0xaef8a7['ticketId']=_0x485db7[_0x3f43('0x38')]['id'];logger['info'](_0x3f43('0x39'),_0xaef8a7[_0x3f43('0x3a')]);_0x5168d6(_0xaef8a7);})[_0x3f43('0x16')](function(_0x5a296a){logger[_0x3f43('0x17')]('['+[_0x1d7927[_0x3f43('0x20')]()]+']',_0x5a296a[_0x3f43('0x30')]);_0x319d3d(_0x5a296a[_0x3f43('0x30')]);});});};}function emit(_0x4cbeb3,_0x102f1c,_0x395654){var _0x3c023d={'uri':_0x4cbeb3+'/contacts/'+_0x395654};io['to'](util[_0x3f43('0x24')](_0x3f43('0x3b'),_0x102f1c))[_0x3f43('0x3c')](_0x3f43('0x3d'),_0x3c023d);}exports['cs']=function(_0x76a714,_0x1a5f80,_0x2ec591,_0x390c30,_0x354428,_0x3eed43,_0x3c811d,_0x4aeedc){var _0x2de8cc={};var _0x59d0a3={'Authorization':'Token\x20token='+_0x3eed43[_0x3f43('0x3e')]};_0x3eed43['remoteUri']=intUtil['stripTrailingSlash'](_0x3eed43[_0x3f43('0x3f')]);_0x3eed43[_0x3f43('0x40')]=intUtil[_0x3f43('0x41')](_0x3eed43[_0x3f43('0x40')]);var _0x261753=_0x3eed43[_0x3f43('0x3f')];_0x2de8cc[_0x3f43('0x1f')]=_0x3eed43['username'];_0x2de8cc[_0x3f43('0x26')]=_0x4aeedc[_0x3f43('0x42')]()===_0x3f43('0x43')?_0x1a5f80[_0x3f43('0x44')]:_0x1a5f80[_0x3f43('0x45')];_0x2de8cc[_0x3f43('0x46')]=_0x4aeedc===_0x3f43('0x47')||_0x4aeedc===_0x3f43('0x48')?_0x3f43('0x47'):'outbound';if(_0x390c30){_0x2de8cc[_0x3f43('0x18')]=_0x390c30[_0x3f43('0x12')];}var _0x286833=util[_0x3f43('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eed43[_0x3f43('0x40')],_0x1a5f80[_0x3f43('0x49')],md5(_0x1a5f80['uniqueid']));if(_0x354428&&_0x354428['monitor_format']){logger['info'](_0x3f43('0x4a'),_0x3f43('0x4b'));_0x1a5f80['recordingURL']=_0x286833;}else if(_0x3c811d&&_0x3c811d[_0x3f43('0x4c')]&&_0x3c811d[_0x3f43('0x4c')]!=='none'){logger['info'](_0x3f43('0x4d'),_0x3f43('0x4b'));_0x1a5f80[_0x3f43('0x4e')]=_0x286833;}else{_0x1a5f80[_0x3f43('0x4e')]='';}return getAdminId(_0x2de8cc,_0x4aeedc,_0x59d0a3,_0x261753)[_0x3f43('0x10')](getUser(_0x4aeedc,_0x59d0a3,_0x261753))[_0x3f43('0x10')](getEndUser(_0x4aeedc,_0x59d0a3,_0x261753))[_0x3f43('0x10')](getTicket(_0x4aeedc,_0x59d0a3,_0x261753,_0x2ec591,_0x1a5f80))['then'](function(_0xe2053){logger['info'](util[_0x3f43('0x24')](_0x3f43('0x4f'),_0xe2053[_0x3f43('0x3a')]));if(_0x4aeedc!=='unmanaged'){logger['info']('['+[_0x4aeedc[_0x3f43('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x261753,_0x390c30[_0x3f43('0x50')],_0xe2053[_0x3f43('0x28')]);}})[_0x3f43('0x16')](function(_0x180e86){logger[_0x3f43('0x17')]('['+[_0x4aeedc[_0x3f43('0x20')]()]+_0x3f43('0x51'),util[_0x3f43('0x52')](_0x180e86,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x52fc=['emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','info','then','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','GET','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','error','message','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','Contact','ticketId','task','Task\x20created:','user:%s'];(function(_0x4fbaba,_0x5dc571){var _0x11a285=function(_0x3a269a){while(--_0x3a269a){_0x4fbaba['push'](_0x4fbaba['shift']());}};_0x11a285(++_0x5dc571);}(_0x52fc,0x11f));var _0xc52f=function(_0xdb713e,_0x30bffe){_0xdb713e=_0xdb713e-0x0;var _0x529db9=_0x52fc[_0xdb713e];return _0x529db9;};'use strict';var _=require(_0xc52f('0x0'));var rp=require(_0xc52f('0x1'));var md5=require(_0xc52f('0x2'));var util=require(_0xc52f('0x3'));var moment=require(_0xc52f('0x4'));var Promise=require(_0xc52f('0x5'));var Redis=require(_0xc52f('0x6'));var intUtil=require(_0xc52f('0x7'));var config=require(_0xc52f('0x8'));var logger=require(_0xc52f('0x9'))('freshsales');config[_0xc52f('0xa')]=_[_0xc52f('0xb')](config['redis'],{'host':_0xc52f('0xc'),'port':0x18eb});var io=require(_0xc52f('0xd'))(new Redis(config[_0xc52f('0xa')]));function getAdminId(_0x51c3f1,_0x2fd6d7,_0x5611d4,_0x56d845){return new Promise(function(_0x3e47b8,_0x31640f){var _0x5ed4e6=![];var _0x48ca36={'method':'GET','uri':_0x56d845+_0xc52f('0xe'),'json':!![]};_0x48ca36['headers']=_0x5611d4;logger[_0xc52f('0xf')]('Getting\x20admin\x20information');return rp(_0x48ca36)[_0xc52f('0x10')](function(_0xb676fb){if(_0xb676fb){var _0x3e63a8=_0xb676fb['users'];var _0x3161f2=null;for(_0x3161f2=0x0;_0x3161f2<_0x3e63a8['length'];_0x3161f2++){if(_0x3e63a8[_0x3161f2][_0xc52f('0x11')]===_0x51c3f1[_0xc52f('0x12')]){_0x51c3f1[_0xc52f('0x13')]=_0x3e63a8[_0x3161f2]['id'];_0x5ed4e6=!![];}}if(_0x5ed4e6){logger['info'](_0xc52f('0x14'),_0x51c3f1[_0xc52f('0x13')]);_0x3e47b8(_0x51c3f1);}else{_0x31640f({'statusCode':0x194,'message':_0xc52f('0x15')});}}else{_0x31640f({'statusCode':0x194,'message':_0xc52f('0x15')});}})[_0xc52f('0x16')](function(_0x22cd5a){logger['error']('['+[_0x2fd6d7[_0xc52f('0x17')]()]+']',_0x22cd5a['message']);_0x31640f(_0x22cd5a);});});}function getUser(_0x5b834d,_0x2036eb,_0x2c1dcc){return function(_0x64eb51){return new Promise(function(_0x21ba1d,_0x1ea62a){var _0x5be9fe={'method':'GET','uri':_0x2c1dcc+'/api/selector/owners','json':!![]};_0x5be9fe['headers']=_0x2036eb;logger[_0xc52f('0xf')](_0xc52f('0x18'));return rp(_0x5be9fe)[_0xc52f('0x10')](function(_0x108a6f){if(_0x108a6f){var _0x2405e7=_0x108a6f['users'];var _0x303752=![];var _0x4fcead=null;if(_0x64eb51[_0xc52f('0x19')]!==null){logger[_0xc52f('0xf')](_0xc52f('0x1a'),_0x64eb51[_0xc52f('0x19')]);_0x64eb51[_0xc52f('0x1b')]=_0x64eb51[_0xc52f('0x19')];for(_0x4fcead=0x0;_0x4fcead<_0x2405e7[_0xc52f('0x1c')];_0x4fcead++){if(_0x2405e7[_0x4fcead]['email']===_0x64eb51['agentEmail']){_0x303752=!![];_0x64eb51['userId']=_0x2405e7[_0x4fcead]['id'];logger['info'](_0xc52f('0x1d'),_0x64eb51[_0xc52f('0x1e')]);}}}if(!_0x303752){logger[_0xc52f('0xf')]('Admin\x20selected');_0x64eb51['userEmail']=_0x64eb51[_0xc52f('0x12')];_0x64eb51['userId']=_0x64eb51[_0xc52f('0x13')];_0x303752=!![];}if(_0x303752){_0x21ba1d(_0x64eb51);}else{_0x1ea62a({'statusCode':0x194,'message':_0xc52f('0x15')});}}else{_0x1ea62a({'statusCode':0x194,'message':_0xc52f('0x15')});}})[_0xc52f('0x16')](function(_0x4c1575){logger['error']('['+[_0x5b834d[_0xc52f('0x17')]()]+']',_0x4c1575['message']);_0x1ea62a(_0x4c1575);});});};}function searchContact(_0x1033ed,_0x255097,_0x255c4e,_0x3ecffc){return new Promise(function(_0x3a78e4,_0x25c2e1){var _0x6f9e19={'method':_0xc52f('0x1f'),'headers':_0x255097,'uri':_0x1033ed+_0xc52f('0x20')+_0x3ecffc+_0xc52f('0x21')+_0x255c4e+_0xc52f('0x22'),'json':!![]};rp(_0x6f9e19)[_0xc52f('0x10')](function(_0x5e3416){var _0x544981=_[_0xc52f('0x23')](_0x5e3416[_0xc52f('0x24')][_0xc52f('0x24')],[_0x255c4e,_0x3ecffc]);_0x3a78e4(_0x544981);})[_0xc52f('0x16')](function(_0x36566c){_0x25c2e1(_0x36566c);});});}function getEndUser(_0x6bd9df,_0x26375f,_0x1aa4b8){return function(_0xacd5b){return new Promise(function(_0x1aac4a,_0x1ba0aa){logger[_0xc52f('0xf')](util[_0xc52f('0x25')](_0xc52f('0x26'),_0xacd5b[_0xc52f('0x27')]));searchContact(_0x1aa4b8,_0x26375f,_0xc52f('0x28'),_0xacd5b[_0xc52f('0x27')])[_0xc52f('0x10')](function(_0x412b32){if(_0x412b32){_0xacd5b[_0xc52f('0x29')]=_0x412b32['id'];logger[_0xc52f('0xf')](_0xc52f('0x2a'),_0xacd5b['endUserId']);return _0x1aac4a(_0xacd5b);}searchContact(_0x1aa4b8,_0x26375f,_0xc52f('0x2b'),_0xacd5b[_0xc52f('0x27')])['then'](function(_0x5c14cf){if(_0x5c14cf){_0xacd5b[_0xc52f('0x29')]=_0x5c14cf['id'];logger[_0xc52f('0xf')](_0xc52f('0x2c'),_0xacd5b[_0xc52f('0x29')]);return _0x1aac4a(_0xacd5b);}createEndUser(_0xacd5b,_0x6bd9df,_0x26375f,_0x1aa4b8)['then'](function(_0x17f727){logger['info'](_0xc52f('0x2d'),_0x17f727['endUserId']);return _0x1aac4a(_0x17f727);});});})[_0xc52f('0x16')](function(_0x51cf48){_0x1ba0aa(_0x51cf48);});});};}function createEndUser(_0x11b805,_0x419641,_0x116fac,_0x443ded){return new Promise(function(_0x489e5e,_0x5791b9){var _0x33db9c=moment();var _0x967e53={'method':'POST','uri':_0x443ded+_0xc52f('0x2e'),'body':{'contact':{'last_name':_0x11b805[_0xc52f('0x27')],'work_number':_0x11b805['contactNumber'],'mobile_number':_0x11b805[_0xc52f('0x27')],'owner_id':_0x11b805['userId'],'created_at':_0x33db9c[_0xc52f('0x25')](_0xc52f('0x2f'))}},'json':!![]};_0x967e53[_0xc52f('0x30')]=_0x116fac;logger[_0xc52f('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x967e53)['then'](function(_0x479675){_0x11b805[_0xc52f('0x29')]=_0x479675['contact']['id'];_0x489e5e(_0x11b805);})[_0xc52f('0x16')](function(_0x480b4e){logger[_0xc52f('0x31')]('['+[_0x419641[_0xc52f('0x17')]()]+']',_0x480b4e[_0xc52f('0x32')]);_0x5791b9(_0x480b4e[_0xc52f('0x32')]);});});}function getTicket(_0x5f2321,_0x46ccb,_0x1b6f18,_0x38323b,_0x4d9f24){return function(_0x30e194){logger[_0xc52f('0xf')](_0xc52f('0x33'));return new Promise(function(_0x6af554,_0xc922a7){var _0x1be1c8=moment();var _0xca8fa={'method':_0xc52f('0x34'),'uri':_0x1b6f18+_0xc52f('0x35'),'body':{'title':intUtil[_0xc52f('0x36')](_0x38323b['Subjects'],_0x4d9f24,'\x20'),'description':intUtil[_0xc52f('0x36')](_0x38323b[_0xc52f('0x37')],_0x4d9f24,'\x0a'),'owner_id':_0x30e194[_0xc52f('0x1e')],'creater_id':_0x30e194['adminId'],'targetable_id':_0x30e194[_0xc52f('0x29')],'targetable_type':_0xc52f('0x38'),'created_at':_0x1be1c8['format'](_0xc52f('0x2f')),'due_date':_0x1be1c8['add'](0x1e,'m')['format'](_0xc52f('0x2f'))},'json':!![]};_0xca8fa['headers']=_0x46ccb;return rp(_0xca8fa)[_0xc52f('0x10')](function(_0x5078b5){_0x30e194[_0xc52f('0x39')]=_0x5078b5[_0xc52f('0x3a')]['id'];logger['info'](_0xc52f('0x3b'),_0x30e194[_0xc52f('0x39')]);_0x6af554(_0x30e194);})[_0xc52f('0x16')](function(_0x9fb1a4){logger['error']('['+[_0x5f2321[_0xc52f('0x17')]()]+']',_0x9fb1a4[_0xc52f('0x32')]);_0xc922a7(_0x9fb1a4[_0xc52f('0x32')]);});});};}function emit(_0x45e34a,_0x25990d,_0x245a67){var _0x2aa4df={'uri':_0x45e34a+'/contacts/'+_0x245a67};io['to'](util[_0xc52f('0x25')](_0xc52f('0x3c'),_0x25990d))[_0xc52f('0x3d')](_0xc52f('0x3e'),_0x2aa4df);}exports['cs']=function(_0x1a9ee0,_0x22a296,_0x2da670,_0x1a38ad,_0x4b3f51,_0x46a833,_0xa11e9b,_0x24f411){var _0x1f6454={};var _0x125c4f={'Authorization':_0xc52f('0x3f')+_0x46a833[_0xc52f('0x40')]};_0x46a833[_0xc52f('0x41')]=intUtil[_0xc52f('0x42')](_0x46a833[_0xc52f('0x41')]);_0x46a833[_0xc52f('0x43')]=intUtil['stripTrailingSlash'](_0x46a833[_0xc52f('0x43')]);var _0x3b504e=_0x46a833[_0xc52f('0x41')];_0x1f6454[_0xc52f('0x12')]=_0x46a833['username'];_0x1f6454[_0xc52f('0x27')]=_0x24f411[_0xc52f('0x44')]()===_0xc52f('0x45')?_0x22a296[_0xc52f('0x46')]:_0x22a296[_0xc52f('0x47')];_0x1f6454[_0xc52f('0x48')]=_0x24f411===_0xc52f('0x49')||_0x24f411===_0xc52f('0x4a')?_0xc52f('0x49'):_0xc52f('0x45');if(_0x1a38ad){_0x1f6454[_0xc52f('0x19')]=_0x1a38ad[_0xc52f('0x11')];}var _0x26b088=util[_0xc52f('0x25')](_0xc52f('0x4b'),_0x46a833[_0xc52f('0x43')],_0x22a296[_0xc52f('0x4c')],md5(_0x22a296[_0xc52f('0x4c')]));if(_0x4b3f51&&_0x4b3f51[_0xc52f('0x4d')]){logger[_0xc52f('0xf')](_0xc52f('0x4e'),'Recording\x20is\x20enabled!');_0x22a296[_0xc52f('0x4f')]=_0x26b088;}else if(_0xa11e9b&&_0xa11e9b[_0xc52f('0x50')]&&_0xa11e9b[_0xc52f('0x50')]!==_0xc52f('0x51')){logger[_0xc52f('0xf')]('[OUTBOUND]',_0xc52f('0x52'));_0x22a296[_0xc52f('0x4f')]=_0x26b088;}else{_0x22a296[_0xc52f('0x4f')]='';}return getAdminId(_0x1f6454,_0x24f411,_0x125c4f,_0x3b504e)[_0xc52f('0x10')](getUser(_0x24f411,_0x125c4f,_0x3b504e))[_0xc52f('0x10')](getEndUser(_0x24f411,_0x125c4f,_0x3b504e))['then'](getTicket(_0x24f411,_0x125c4f,_0x3b504e,_0x2da670,_0x22a296))[_0xc52f('0x10')](function(_0x12ef32){logger[_0xc52f('0xf')](util[_0xc52f('0x25')](_0xc52f('0x53'),_0x12ef32['ticketId']));if(_0x24f411!==_0xc52f('0x4a')){logger['info']('['+[_0x24f411[_0xc52f('0x17')]()]+']',_0xc52f('0x54'));emit(_0x3b504e,_0x1a38ad[_0xc52f('0x55')],_0x12ef32[_0xc52f('0x29')]);}})['catch'](function(_0x825ceb){logger[_0xc52f('0x31')]('['+[_0x24f411['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc52f('0x56')](_0x825ceb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 88e0593..b838099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2209=['freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','salesforce','sugarcrm'];(function(_0x5d42b9,_0x42dc78){var _0x20c9cf=function(_0x37d1ed){while(--_0x37d1ed){_0x5d42b9['push'](_0x5d42b9['shift']());}};_0x20c9cf(++_0x42dc78);}(_0x2209,0x84));var _0x9220=function(_0x596e86,_0xb3686c){_0x596e86=_0x596e86-0x0;var _0x1bcc38=_0x2209[_0x596e86];return _0x1bcc38;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var zendesk=require(_0x9220('0x2'));var salesforce=require(_0x9220('0x3'));var sugarcrm=require(_0x9220('0x4'));var freshdesk=require(_0x9220('0x5'));var zoho=require('./zoho');var desk=require(_0x9220('0x6'));var vtiger=require(_0x9220('0x7'));var servicenow=require(_0x9220('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x9220('0x9'));var integrations=['zendesk',_0x9220('0xa'),_0x9220('0xb'),_0x9220('0xc'),_0x9220('0xd'),_0x9220('0xe'),_0x9220('0xf'),_0x9220('0x10'),'freshsales',_0x9220('0x11')];exports[_0x9220('0x12')]=function(_0x2d9b91,_0x15a5a1,_0x31ea90,_0x5dd962,_0x5d960d,_0x6db005){if(_0x31ea90){if(_['includes'](integrations,_0x2d9b91[_0x9220('0x13')]['toLowerCase']())){try{var _0x5d0c4f=null;var _0x36f853='';var _0x152465=_0x31ea90[_0x2d9b91['data1'][_0x9220('0x14')]()];if(_0x152465){var _0x48e288=_0x152465[_0x2d9b91[_0x9220('0x15')]];if(_0x48e288){var _0x75a3be=_[_0x9220('0x16')](_0x48e288[_0x9220('0x17')],{'id':parseInt(_0x2d9b91[_0x9220('0x18')],0xa)});if(_0x75a3be){if(_0x5dd962){if(_0x5d960d&&_0x15a5a1[_0x9220('0x19')]){_0x36f853=_0x9220('0x19');}else if(_0x15a5a1[_0x9220('0x1a')]){_0x36f853=_0x9220('0x1b');}else{console[_0x9220('0x1c')]('EVENT\x20UNKNOWN',_0x15a5a1);}}else{_0x36f853='unmanaged';}switch(_0x2d9b91['data1']['toLowerCase']()){case'zendesk':zendesk[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xa'):salesforce[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xb'):sugarcrm[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xc'):freshdesk[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xd'):zoho[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xe'):desk[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0xf'):vtiger[_0x36f853](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005);break;case _0x9220('0x1d'):freshsales['cs'](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005,_0x36f853);break;case _0x9220('0x11'):servicenow['cs'](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005,_0x36f853);break;case _0x9220('0x10'):dynamics365['cs'](_0x2d9b91,_0x15a5a1,_0x75a3be,_0x5dd962,_0x5d960d,_0x48e288,_0x6db005,_0x36f853);break;default:console['log'](_0x9220('0x1e'));}}else{_0x5d0c4f=require(_0x9220('0x1f'))(_0x2d9b91[_0x9220('0x13')][_0x9220('0x14')]());_0x5d0c4f[_0x9220('0x20')](_0x9220('0x21'),util[_0x9220('0x22')](_0x9220('0x23'),_0x2d9b91[_0x9220('0x13')]['toLowerCase'](),_0x2d9b91[_0x9220('0x18')]));}}else{_0x5d0c4f=require('../../../../config/logger')(_0x2d9b91['data1'][_0x9220('0x14')]());_0x5d0c4f[_0x9220('0x20')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x2d9b91[_0x9220('0x13')][_0x9220('0x14')](),_0x2d9b91[_0x9220('0x15')]));}}else{}}catch(_0xeaedc0){console[_0x9220('0x20')](_0xeaedc0);}}}};
\ No newline at end of file
+var _0x2f56=['desk','dynamics365','exec','includes','data1','toLowerCase','find','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshsales','servicenow','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0x2f56,0x148));var _0x62f5=function(_0x4a67ef,_0x6f0dfb){_0x4a67ef=_0x4a67ef-0x0;var _0x41c89e=_0x2f56[_0x4a67ef];return _0x41c89e;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var zendesk=require(_0x62f5('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x62f5('0x3'));var freshdesk=require(_0x62f5('0x4'));var zoho=require(_0x62f5('0x5'));var desk=require(_0x62f5('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0x62f5('0x7'));var dynamics365=require(_0x62f5('0x8'));var freshsales=require(_0x62f5('0x9'));var integrations=[_0x62f5('0xa'),_0x62f5('0xb'),_0x62f5('0xc'),'freshdesk',_0x62f5('0xd'),_0x62f5('0xe'),'vtiger',_0x62f5('0xf'),'freshsales','servicenow'];exports[_0x62f5('0x10')]=function(_0x44f4b6,_0x5bfdfc,_0x320998,_0x36ebe7,_0x462c1a,_0x350b36){if(_0x320998){if(_[_0x62f5('0x11')](integrations,_0x44f4b6[_0x62f5('0x12')][_0x62f5('0x13')]())){try{var _0x4ce223=null;var _0x45b90f='';var _0x161ee8=_0x320998[_0x44f4b6[_0x62f5('0x12')]['toLowerCase']()];if(_0x161ee8){var _0x2e832e=_0x161ee8[_0x44f4b6['data2']];if(_0x2e832e){var _0x4a1429=_[_0x62f5('0x14')](_0x2e832e['Configurations'],{'id':parseInt(_0x44f4b6['data3'],0xa)});if(_0x4a1429){if(_0x36ebe7){if(_0x462c1a&&_0x5bfdfc[_0x62f5('0x15')]){_0x45b90f='queue';}else if(_0x5bfdfc[_0x62f5('0x16')]){_0x45b90f=_0x62f5('0x17');}else{console[_0x62f5('0x18')](_0x62f5('0x19'),_0x5bfdfc);}}else{_0x45b90f=_0x62f5('0x1a');}switch(_0x44f4b6[_0x62f5('0x12')][_0x62f5('0x13')]()){case'zendesk':zendesk[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case _0x62f5('0xb'):salesforce[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case _0x62f5('0xc'):sugarcrm[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case'freshdesk':freshdesk[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case _0x62f5('0xd'):zoho[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case _0x62f5('0xe'):desk[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case'vtiger':vtiger[_0x45b90f](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36);break;case _0x62f5('0x1b'):freshsales['cs'](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36,_0x45b90f);break;case _0x62f5('0x1c'):servicenow['cs'](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36,_0x45b90f);break;case _0x62f5('0xf'):dynamics365['cs'](_0x44f4b6,_0x5bfdfc,_0x4a1429,_0x36ebe7,_0x462c1a,_0x2e832e,_0x350b36,_0x45b90f);break;default:console['log'](_0x62f5('0x1d'));}}else{_0x4ce223=require('../../../../config/logger')(_0x44f4b6[_0x62f5('0x12')]['toLowerCase']());_0x4ce223[_0x62f5('0x1e')](_0x62f5('0x1f'),util[_0x62f5('0x20')](_0x62f5('0x21'),_0x44f4b6[_0x62f5('0x12')][_0x62f5('0x13')](),_0x44f4b6[_0x62f5('0x22')]));}}else{_0x4ce223=require(_0x62f5('0x23'))(_0x44f4b6[_0x62f5('0x12')]['toLowerCase']());_0x4ce223[_0x62f5('0x1e')](_0x62f5('0x1f'),util[_0x62f5('0x20')](_0x62f5('0x24'),_0x44f4b6['data1'][_0x62f5('0x13')](),_0x44f4b6[_0x62f5('0x25')]));}}else{}}catch(_0x42b1d7){console[_0x62f5('0x1e')](_0x42b1d7);}}}};
\ No newline at end of file
index 4332159..a7be674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf88f=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','unmanaged','lastevent','calleridname','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','sobject','create','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Contact','contact','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','upperFirst','forEach','picklist','idField','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e'];(function(_0x3ee3ac,_0x1b253b){var _0x5fdab1=function(_0x392426){while(--_0x392426){_0x3ee3ac['push'](_0x3ee3ac['shift']());}};_0x5fdab1(++_0x1b253b);}(_0xf88f,0x192));var _0xff88=function(_0x22eb53,_0x36dd89){_0x22eb53=_0x22eb53-0x0;var _0x4e17b=_0xf88f[_0x22eb53];return _0x4e17b;};'use strict';var _=require(_0xff88('0x0'));var rp=require(_0xff88('0x1'));var moment=require(_0xff88('0x2'));var BPromise=require(_0xff88('0x3'));var md5=require(_0xff88('0x4'));var jsforce=require('jsforce');var util=require(_0xff88('0x5'));var Redis=require(_0xff88('0x6'));var intUtil=require(_0xff88('0x7'));var config=require('../../../../config/environment');var logger=require(_0xff88('0x8'))(_0xff88('0x9'));config[_0xff88('0xa')]=_[_0xff88('0xb')](config[_0xff88('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xff88('0xc'))(new Redis(config[_0xff88('0xa')]));function emit(_0x84b5ed,_0x582697,_0x8e3c51){io['to'](_0x84b5ed)['emit'](_0x582697,_0x8e3c51);}function getTicket(_0x5828b5,_0x3726ac,_0x502ef3,_0x18c0f6,_0x90fffc,_0x16056b,_0x2887c6,_0x507351){var _0x36f1c8=Object[_0xff88('0xd')]({},{'OwnerId':_0x3726ac['id'],'Subject':intUtil['getString'](_0x18c0f6[_0xff88('0xe')],_0x90fffc,'\x20'),'Description':intUtil[_0xff88('0xf')](_0x18c0f6[_0xff88('0x10')],_0x90fffc,'\x0a')},getCustomFields(_0x16056b,_0x90fffc));if(_0x502ef3){if(_0x18c0f6[_0xff88('0x11')]===_0xff88('0x12')){_0x36f1c8['ActivityDate']=moment[_0xff88('0x13')]();_0x36f1c8[_0xff88('0x14')]=![];_0x36f1c8['IsRecurrence']=![];if(_0x502ef3['endUserType']==='contact'||_0x502ef3[_0xff88('0x15')]===_0xff88('0x16')){_0x36f1c8[_0xff88('0x17')]=_0x502ef3['id'];}else if(_0x502ef3[_0xff88('0x15')]===_0xff88('0x18')){_0x36f1c8[_0xff88('0x19')]=_0x502ef3['id'];}}else if(_0x18c0f6[_0xff88('0x11')]===_0xff88('0x1a')){if(_0x502ef3[_0xff88('0x15')]==='contact'){_0x36f1c8['ContactId']=_0x502ef3['id'];}else if(_0x502ef3[_0xff88('0x15')]===_0xff88('0x18')){_0x36f1c8[_0xff88('0x1b')]=_0x502ef3['id'];}else if(_0x502ef3[_0xff88('0x15')]==='lead'&&_0x18c0f6['leadId']){_0x36f1c8[_0x18c0f6[_0xff88('0x1c')]]=_0x502ef3['id'];}else{logger[_0xff88('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2887c6[_0xff88('0x1e')](_0x18c0f6[_0xff88('0x11')])[_0xff88('0x1f')](_0x36f1c8);}function getUser(_0x57dba5,_0x550ea4,_0x5bcfb7){if(!_['isNil'](_0x550ea4)&&intUtil[_0xff88('0x20')](_0x550ea4)){var _0x2685c9={'Email':_0x550ea4};var _0x4af3cf={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5bcfb7[_0xff88('0x1e')](_0xff88('0x21'))[_0xff88('0x22')](_0x2685c9,_0x4af3cf)[_0xff88('0x23')]()[_0xff88('0x24')](function(_0x449325){if(_0x449325['length']){var _0x508579=_['find'](_0x449325,function(_0x5bd04d){return _0x5bd04d[_0xff88('0x25')]===_0x550ea4;});if(_0x508579){logger[_0xff88('0x1d')](_0xff88('0x26'),_0x550ea4);return BPromise[_0xff88('0x27')]({'id':_0x508579['Id'],'name':_0x508579[_0xff88('0x28')]});}}else{logger[_0xff88('0x1d')](_0xff88('0x29'),_0x550ea4);return _0x5bcfb7[_0xff88('0x2a')]()['then'](function(_0x21d317){return BPromise['resolve']({'id':_0x21d317[_0xff88('0x2b')],'name':_0x21d317[_0xff88('0x2c')]});});}});}else{logger[_0xff88('0x1d')](_0xff88('0x29'),_0x550ea4);return _0x5bcfb7['identity']()['then'](function(_0x5cee6f){return BPromise['resolve']({'id':_0x5cee6f[_0xff88('0x2b')],'name':_0x5cee6f['display_name']});});}}function getEndUser(_0x5a5951,_0x132fc9,_0x50e6e5,_0x26a076,_0x185052){var _0x42d5a6={'$or':{'Phone':_0x26a076}};var _0x26daa3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xff88('0x27')]()[_0xff88('0x24')](function(){logger[_0xff88('0x1d')](_0xff88('0x2d'),_0x26a076,_0x132fc9['moduleSearch']);switch(_0x132fc9[_0xff88('0x2e')]){case _0xff88('0x2f'):var _0x3eedf7=_[_0xff88('0x30')](_0x42d5a6);if(_0x132fc9[_0xff88('0x31')]){var _0x2eb6f1={};_0x2eb6f1[_0x132fc9[_0xff88('0x31')]]=_0x26a076;_[_0xff88('0x32')](_0x3eedf7[_0xff88('0x33')],_0x2eb6f1);}return _0x185052[_0xff88('0x1e')]('Contact')['find'](_0x3eedf7,_0x26daa3)[_0xff88('0x23')]()[_0xff88('0x24')](function(_0x3ce68e){if(_0x3ce68e&&_0x3ce68e[_0xff88('0x34')]){return _0x3ce68e;}else{var _0x2b8817=_[_0xff88('0x30')](_0x42d5a6);if(_0x132fc9[_0xff88('0x35')]){var _0x5c1987={};_0x5c1987[_0x132fc9[_0xff88('0x35')]]=_0x26a076;_[_0xff88('0x32')](_0x2b8817[_0xff88('0x33')],_0x5c1987);}return _0x185052[_0xff88('0x1e')](_0xff88('0x36'))[_0xff88('0x22')](_0x2b8817,_0x26daa3);}});case _0xff88('0x37'):var _0xbfa4d8=_['cloneDeep'](_0x42d5a6);if(_0x132fc9[_0xff88('0x38')]){var _0x2eb6f1={};_0x2eb6f1[_0x132fc9[_0xff88('0x38')]]=_0x26a076;_['merge'](_0xbfa4d8[_0xff88('0x33')],_0x2eb6f1);}return _0x185052[_0xff88('0x1e')]('Account')[_0xff88('0x22')](_0xbfa4d8,_0x26daa3)[_0xff88('0x23')]()[_0xff88('0x24')](function(_0x2ec166){if(_0x2ec166&&_0x2ec166[_0xff88('0x34')]){return _0x2ec166;}else{var _0x3a4e90=_['cloneDeep'](_0x42d5a6);if(_0x132fc9[_0xff88('0x31')]){var _0x30a48e={};_0x30a48e[_0x132fc9[_0xff88('0x31')]]=_0x26a076;_[_0xff88('0x32')](_0x3a4e90[_0xff88('0x33')],_0x30a48e);}return _0x185052[_0xff88('0x1e')](_0xff88('0x39'))[_0xff88('0x22')](_0x3a4e90,_0x26daa3)['then'](function(_0x2a275d){if(_0x2a275d&&_0x2a275d['length']){return _0x2a275d;}else{var _0x125d6f=_[_0xff88('0x30')](_0x42d5a6);if(_0x132fc9[_0xff88('0x35')]){var _0x385c39={};_0x385c39[_0x132fc9[_0xff88('0x35')]]=_0x26a076;_[_0xff88('0x32')](_0x125d6f[_0xff88('0x33')],_0x385c39);}return _0x185052['sobject']('Lead')[_0xff88('0x22')](_0x125d6f,_0x26daa3);}});}});case _0xff88('0x3a'):var _0x3eedf7=_[_0xff88('0x30')](_0x42d5a6);if(_0x132fc9[_0xff88('0x31')]){var _0x2eb6f1={};_0x2eb6f1[_0x132fc9[_0xff88('0x31')]]=_0x26a076;_['merge'](_0x3eedf7[_0xff88('0x33')],_0x2eb6f1);}return _0x185052[_0xff88('0x1e')](_0xff88('0x39'))['find'](_0x3eedf7,_0x26daa3)['execute']();case _0xff88('0x16'):var _0x22730d=_['cloneDeep'](_0x42d5a6);if(_0x132fc9[_0xff88('0x35')]){var _0x2eb6f1={};_0x2eb6f1[_0x132fc9['additionalSearchLead']]=_0x26a076;_[_0xff88('0x32')](_0x22730d['$or'],_0x2eb6f1);}return _0x185052[_0xff88('0x1e')]('Lead')[_0xff88('0x22')](_0x22730d,_0x26daa3);case _0xff88('0x18'):var _0xbfa4d8=_[_0xff88('0x30')](_0x42d5a6);if(_0x132fc9['additionalSearchAccount']){var _0x2eb6f1={};_0x2eb6f1[_0x132fc9['additionalSearchAccount']]=_0x26a076;_[_0xff88('0x32')](_0xbfa4d8[_0xff88('0x33')],_0x2eb6f1);}return _0x185052[_0xff88('0x1e')](_0xff88('0x3b'))[_0xff88('0x22')](_0xbfa4d8,_0x26daa3);default:return null;}})[_0xff88('0x24')](function(_0x1b7c40){if(_0x1b7c40&&_0x1b7c40[_0xff88('0x34')]){var _0x4def48=_['first'](_0x1b7c40);if(_0x4def48){return BPromise['resolve']({'id':_0x4def48['Id'],'name':_0x4def48[_0xff88('0x28')],'phone':_0x4def48[_0xff88('0x3c')],'endUserType':_0x4def48[_0xff88('0x3d')][_0xff88('0x3e')][_0xff88('0x3f')]()});}}})[_0xff88('0x24')](function(_0x59836b){if(_0x59836b){logger[_0xff88('0x1d')](_0xff88('0x40'),_0x59836b[_0xff88('0x15')],_0x26a076);return BPromise[_0xff88('0x27')](_0x59836b);}else{logger[_0xff88('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x26a076);var _0x2d1197={'Phone':_0x26a076};if(_0x132fc9[_0xff88('0x41')]){if(_0x132fc9[_0xff88('0x41')]===_0xff88('0x3a')){logger['info'](_0xff88('0x42'),_0x26a076,_0x132fc9[_0xff88('0x41')]);_0x2d1197[_0xff88('0x43')]=_0x50e6e5!==_0xff88('0x44')?_0x50e6e5:util[_0xff88('0x45')](_0xff88('0x46'),_0x26a076);}else if(_0x132fc9[_0xff88('0x41')]==='lead'){logger[_0xff88('0x1d')](_0xff88('0x42'),_0x26a076,_0x132fc9['moduleCreate']);_0x2d1197['LastName']=_0x50e6e5!==_0xff88('0x44')?_0x50e6e5:util[_0xff88('0x45')]('Caller\x20-\x20%s',_0x26a076);_0x2d1197[_0xff88('0x47')]='No\x20Company';}else if(_0x132fc9['moduleCreate']===_0xff88('0x18')){logger[_0xff88('0x1d')](_0xff88('0x42'),_0x26a076,_0x132fc9[_0xff88('0x41')]);_0x2d1197['Name']=_0x50e6e5!==_0xff88('0x44')?_0x50e6e5:util[_0xff88('0x45')](_0xff88('0x46'),_0x26a076);}else{return null;}}return _0x185052[_0xff88('0x1e')](_[_0xff88('0x48')](_0x132fc9[_0xff88('0x41')]))['create'](_0x2d1197)['then'](function(_0x3cbc65){return BPromise['resolve']({'id':_0x3cbc65['id'],'endUserType':_0x132fc9[_0xff88('0x41')]});});}});}function getCustomFields(_0x109ce9,_0x342dae){var _0x8e0ed0={};if(_0x109ce9['length']>0x0){_[_0xff88('0x49')](_0x109ce9,function(_0x4e2331){if(_['includes'](['string',_0xff88('0x4a')],_0x4e2331['type'])&&_0x4e2331[_0xff88('0x4b')]){_0x8e0ed0[_0x4e2331[_0xff88('0x4b')]]=_0x4e2331['content']['toString']();}else if(_0x4e2331[_0xff88('0x3e')]==='variable'&&_0x4e2331['variableName']&&_0x4e2331[_0xff88('0x4b')]){_0x342dae[_0x4e2331[_0xff88('0x4c')]]&&(_0x8e0ed0[_0x4e2331[_0xff88('0x4b')]]=_0x342dae[_0x4e2331['variableName']][_0xff88('0x4d')]());}else if(_0x4e2331[_0xff88('0x3e')]===_0xff88('0x4e')&&_0x4e2331[_0xff88('0x4f')]&&_0x4e2331[_0xff88('0x4f')][_0xff88('0x50')]&&_0x4e2331[_0xff88('0x4b')]){_0x342dae[_0x4e2331[_0xff88('0x4f')][_0xff88('0x50')][_0xff88('0x3f')]()]&&(_0x8e0ed0[_0x4e2331[_0xff88('0x4b')]]=_0x342dae[_0x4e2331[_0xff88('0x4f')]['name'][_0xff88('0x3f')]()]['toString']());}});}return _0x8e0ed0;}function getConnection(_0x2a830e){var _0x52ffc2=_0x2a830e[_0xff88('0x51')][_0xff88('0x52')](_0x2a830e['securityToken']);var _0x59eb78=new jsforce[(_0xff88('0x53'))]({'oauth2':{'loginUrl':_0x2a830e[_0xff88('0x54')]||_0xff88('0x55'),'clientId':_0x2a830e[_0xff88('0x56')],'clientSecret':_0x2a830e[_0xff88('0x57')]}});return _0x59eb78[_0xff88('0x58')](_0x2a830e[_0xff88('0x59')],_0x52ffc2)['then'](function(){logger['info'](_0xff88('0x5a'));return _0x59eb78;});}exports[_0xff88('0x5b')]=function(_0x320ae6,_0x4767ad,_0x49f518,_0x13dfa4,_0x189b23,_0x1eaa44){var _0xb08aea,_0x5dc879,_0x2d14d8,_0x3b5d30;_0x1eaa44[_0xff88('0x5c')]=intUtil[_0xff88('0x5d')](_0x1eaa44[_0xff88('0x5c')]);_0x1eaa44[_0xff88('0x54')]=intUtil[_0xff88('0x5d')](_0x1eaa44[_0xff88('0x54')]);if(_0x189b23&&_0x189b23[_0xff88('0x5e')]){logger[_0xff88('0x1d')](_0xff88('0x5f'),_0xff88('0x60'));_0x4767ad[_0xff88('0x61')]=util[_0xff88('0x45')](_0xff88('0x62'),_0x1eaa44['serverUrl'],_0x4767ad[_0xff88('0x63')],md5(_0x4767ad[_0xff88('0x63')]));}else{_0x4767ad[_0xff88('0x61')]='';}return getConnection(_0x1eaa44)[_0xff88('0x24')](function(_0x5a0441){_0x3b5d30=_0x5a0441;return getUser(_0x1eaa44,_0x13dfa4['email'],_0x3b5d30);})['then'](function(_0x78c235){_0xb08aea=_0x78c235;return getEndUser(_0x1eaa44,_0x49f518,_0x4767ad['calleridname'],_0x4767ad[_0xff88('0x64')],_0x3b5d30);})[_0xff88('0x24')](function(_0x36a5fc){_0x5dc879=_0x36a5fc;return getTicket(_0x1eaa44,_0xb08aea,_0x5dc879,_0x49f518,_0x4767ad,_0x49f518[_0xff88('0x65')],_0x3b5d30,_0xff88('0x5b'));})['then'](function(_0x76e1b5){_0x2d14d8=_0x76e1b5;logger[_0xff88('0x1d')](_0xff88('0x66'),_0x2d14d8['id']);logger[_0xff88('0x1d')](_0xff88('0x67'),_0x2d14d8['id'],_0x13dfa4[_0xff88('0x50')],_0x1eaa44[_0xff88('0x3e')]);switch(_0x1eaa44[_0xff88('0x3e')]){case _0xff88('0x68'):emit(util[_0xff88('0x45')]('user:%s',_0x13dfa4[_0xff88('0x50')]),_0xff88('0x69'),{'recordId':_0x2d14d8['id']});break;case _0xff88('0x6a'):emit(util['format'](_0xff88('0x6b'),_0x13dfa4['name']),_0xff88('0x6c'),{'uri':util['format'](_0xff88('0x6d'),_0x3b5d30[_0xff88('0x6e')],_0x2d14d8['id'])});break;default:logger[_0xff88('0x6f')](_0xff88('0x70'));}})[_0xff88('0x71')](function(_0xaad374){logger['error'](_0xff88('0x5f'),_0xaad374);});};exports['outbound']=function(_0x5cce69,_0x8c66bc,_0x21326d,_0x351025,_0x46f925,_0x5e6fcd,_0x532c65){var _0x30e40a,_0x45c759,_0x334b0f,_0x420d72;_0x5e6fcd[_0xff88('0x5c')]=intUtil[_0xff88('0x5d')](_0x5e6fcd[_0xff88('0x5c')]);_0x5e6fcd[_0xff88('0x54')]=intUtil[_0xff88('0x5d')](_0x5e6fcd[_0xff88('0x54')]);if(_0x532c65&&_0x532c65[_0xff88('0x72')]&&_0x532c65['recordingFormat']!==_0xff88('0x73')){logger[_0xff88('0x1d')]('[OUTBOUND]',_0xff88('0x60'));_0x8c66bc[_0xff88('0x61')]=util[_0xff88('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e6fcd[_0xff88('0x5c')],_0x8c66bc[_0xff88('0x63')],md5(_0x8c66bc[_0xff88('0x63')]));}return getConnection(_0x5e6fcd)[_0xff88('0x24')](function(_0x1e81a2){_0x420d72=_0x1e81a2;return getUser(_0x5e6fcd,_0x351025[_0xff88('0x74')],_0x420d72);})[_0xff88('0x24')](function(_0x2f7d92){_0x30e40a=_0x2f7d92;return getEndUser(_0x5e6fcd,_0x21326d,_0x8c66bc[_0xff88('0x75')],_0x8c66bc[_0xff88('0x76')],_0x420d72);})[_0xff88('0x24')](function(_0x577d96){_0x45c759=_0x577d96;return getTicket(_0x5e6fcd,_0x30e40a,_0x45c759,_0x21326d,_0x8c66bc,_0x21326d['Fields'],_0x420d72,_0xff88('0x77'));})['then'](function(_0x5e06c5){_0x334b0f=_0x5e06c5;logger[_0xff88('0x1d')](_0xff88('0x78'),_0x334b0f['id']);logger[_0xff88('0x1d')](_0xff88('0x79'),_0x334b0f['id'],_0x351025[_0xff88('0x50')],_0x5e6fcd[_0xff88('0x3e')]);switch(_0x5e6fcd[_0xff88('0x3e')]){case'integrationTab':emit(util['format'](_0xff88('0x6b'),_0x351025[_0xff88('0x50')]),_0xff88('0x69'),{'recordId':_0x334b0f['id']});break;case'newTab':emit(util[_0xff88('0x45')](_0xff88('0x6b'),_0x351025['name']),_0xff88('0x6c'),{'uri':util[_0xff88('0x45')](_0xff88('0x6d'),_0x420d72[_0xff88('0x6e')],_0x334b0f['id'])});break;default:logger[_0xff88('0x6f')](_0xff88('0x7a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xff88('0x71')](function(_0x357fec){logger[_0xff88('0x6f')](_0xff88('0x7a'),_0x357fec);});};exports[_0xff88('0x7b')]=function(_0x12543b,_0x2562e0,_0x2199f1,_0x1c11f0,_0x2747a4,_0x58ade6){var _0x2f9a36,_0x4f7387,_0x221482,_0x3f3e8d;_0x58ade6[_0xff88('0x5c')]=intUtil[_0xff88('0x5d')](_0x58ade6['serverUrl']);_0x58ade6[_0xff88('0x54')]=intUtil['stripTrailingSlash'](_0x58ade6[_0xff88('0x54')]);if(_0x2747a4&&_0x2747a4[_0xff88('0x5e')]){logger[_0xff88('0x1d')]('['+_0x2562e0[_0xff88('0x7c')]['toUpperCase']()+']',_0xff88('0x60'));_0x2562e0['recordingURL']=util[_0xff88('0x45')](_0xff88('0x62'),_0x58ade6['serverUrl'],_0x2562e0[_0xff88('0x63')],md5(_0x2562e0[_0xff88('0x63')]));}else{_0x2562e0[_0xff88('0x61')]='';}return getConnection(_0x58ade6)[_0xff88('0x24')](function(_0x5e8b3d){_0x3f3e8d=_0x5e8b3d;if(!_['isNil'](_0x1c11f0)){return getUser(_0x58ade6,_0x1c11f0[_0xff88('0x50')],_0x3f3e8d);}else{return getUser(_0x58ade6,null,_0x3f3e8d);}})[_0xff88('0x24')](function(_0x157332){_0x2f9a36=_0x157332;return getEndUser(_0x58ade6,_0x2199f1,_0x2562e0[_0xff88('0x7d')],_0x2562e0[_0xff88('0x64')],_0x3f3e8d);})[_0xff88('0x24')](function(_0x2b5aca){_0x4f7387=_0x2b5aca;return getTicket(_0x58ade6,_0x2f9a36,_0x4f7387,_0x2199f1,_0x2562e0,_0x2199f1[_0xff88('0x65')],_0x3f3e8d);})[_0xff88('0x24')](function(_0x201a82){_0x221482=_0x201a82;logger['info']('['+_0x2562e0['lastevent'][_0xff88('0x7e')]()+']\x20Ticket\x20%s\x20created.',_0x221482['id']);logger['info']('['+_0x2562e0[_0xff88('0x7c')]['toUpperCase']()+_0xff88('0x7f'),_0x58ade6[_0xff88('0x3e')]);})[_0xff88('0x71')](function(_0x33b169){logger[_0xff88('0x6f')]('['+_0x2562e0[_0xff88('0x7c')]['toUpperCase']()+']',_0x33b169);});};
\ No newline at end of file
+var _0xadd8=['calleridnum','Fields','queue','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase','isNil',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','md5','jsforce','./util','../../../../config/environment','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','execute','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','<unknown>','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadd8,0x112));var _0x8add=function(_0xfb90ae,_0x226a47){_0xfb90ae=_0xfb90ae-0x0;var _0x2d41dc=_0xadd8[_0xfb90ae];return _0x2d41dc;};'use strict';var _=require(_0x8add('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8add('0x1'));var md5=require(_0x8add('0x2'));var jsforce=require(_0x8add('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x8add('0x4'));var config=require(_0x8add('0x5'));var logger=require('../../../../config/logger')(_0x8add('0x6'));config['redis']=_[_0x8add('0x7')](config[_0x8add('0x8')],{'host':_0x8add('0x9'),'port':0x18eb});var io=require(_0x8add('0xa'))(new Redis(config[_0x8add('0x8')]));function emit(_0x3eb652,_0xb56dac,_0x480ed9){io['to'](_0x3eb652)[_0x8add('0xb')](_0xb56dac,_0x480ed9);}function getTicket(_0x3b5779,_0x5f34cc,_0x489657,_0x28a53a,_0x1761a8,_0x1eebb1,_0x5aff3f,_0x43c933){var _0x434d77=Object[_0x8add('0xc')]({},{'OwnerId':_0x5f34cc['id'],'Subject':intUtil['getString'](_0x28a53a[_0x8add('0xd')],_0x1761a8,'\x20'),'Description':intUtil['getString'](_0x28a53a[_0x8add('0xe')],_0x1761a8,'\x0a')},getCustomFields(_0x1eebb1,_0x1761a8));if(_0x489657){if(_0x28a53a[_0x8add('0xf')]===_0x8add('0x10')){_0x434d77[_0x8add('0x11')]=moment['utc']();_0x434d77['IsReminderSet']=![];_0x434d77[_0x8add('0x12')]=![];if(_0x489657[_0x8add('0x13')]===_0x8add('0x14')||_0x489657[_0x8add('0x13')]===_0x8add('0x15')){_0x434d77['WhoId']=_0x489657['id'];}else if(_0x489657[_0x8add('0x13')]===_0x8add('0x16')){_0x434d77[_0x8add('0x17')]=_0x489657['id'];}}else if(_0x28a53a[_0x8add('0xf')]===_0x8add('0x18')){if(_0x489657[_0x8add('0x13')]===_0x8add('0x14')){_0x434d77['ContactId']=_0x489657['id'];}else if(_0x489657[_0x8add('0x13')]==='account'){_0x434d77[_0x8add('0x19')]=_0x489657['id'];}else if(_0x489657[_0x8add('0x13')]===_0x8add('0x15')&&_0x28a53a[_0x8add('0x1a')]){_0x434d77[_0x28a53a['leadId']]=_0x489657['id'];}else{logger[_0x8add('0x1b')](_0x8add('0x1c'));}}}return _0x5aff3f[_0x8add('0x1d')](_0x28a53a['ticketType'])[_0x8add('0x1e')](_0x434d77);}function getUser(_0x57c309,_0x5a246d,_0x1ff4db){if(!_['isNil'](_0x5a246d)&&intUtil[_0x8add('0x1f')](_0x5a246d)){var _0x5eff2b={'Email':_0x5a246d};var _0x19c449={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1ff4db[_0x8add('0x1d')]('User')[_0x8add('0x20')](_0x5eff2b,_0x19c449)['execute']()[_0x8add('0x21')](function(_0xee294b){if(_0xee294b[_0x8add('0x22')]){var _0x383022=_[_0x8add('0x20')](_0xee294b,function(_0x2e0810){return _0x2e0810[_0x8add('0x23')]===_0x5a246d;});if(_0x383022){logger[_0x8add('0x1b')](_0x8add('0x24'),_0x5a246d);return BPromise[_0x8add('0x25')]({'id':_0x383022['Id'],'name':_0x383022[_0x8add('0x26')]});}}else{logger[_0x8add('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a246d);return _0x1ff4db[_0x8add('0x27')]()[_0x8add('0x21')](function(_0x7589c){return BPromise[_0x8add('0x25')]({'id':_0x7589c[_0x8add('0x28')],'name':_0x7589c[_0x8add('0x29')]});});}});}else{logger['info'](_0x8add('0x2a'),_0x5a246d);return _0x1ff4db[_0x8add('0x27')]()[_0x8add('0x21')](function(_0x2d1092){return BPromise['resolve']({'id':_0x2d1092['user_id'],'name':_0x2d1092[_0x8add('0x29')]});});}}function getEndUser(_0x153517,_0x3a1967,_0x1f8601,_0xda85de,_0xc26769){var _0x230604={'$or':{'Phone':_0xda85de}};var _0x1a116d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8add('0x25')]()[_0x8add('0x21')](function(){logger['info'](_0x8add('0x2b'),_0xda85de,_0x3a1967[_0x8add('0x2c')]);switch(_0x3a1967['moduleSearch']){case _0x8add('0x2d'):var _0x1e84e4=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967[_0x8add('0x2f')]){var _0x386a04={};_0x386a04[_0x3a1967[_0x8add('0x2f')]]=_0xda85de;_['merge'](_0x1e84e4[_0x8add('0x30')],_0x386a04);}return _0xc26769['sobject'](_0x8add('0x31'))['find'](_0x1e84e4,_0x1a116d)[_0x8add('0x32')]()['then'](function(_0x1af240){if(_0x1af240&&_0x1af240[_0x8add('0x22')]){return _0x1af240;}else{var _0x1fedce=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967[_0x8add('0x33')]){var _0x45c74b={};_0x45c74b[_0x3a1967[_0x8add('0x33')]]=_0xda85de;_[_0x8add('0x34')](_0x1fedce[_0x8add('0x30')],_0x45c74b);}return _0xc26769[_0x8add('0x1d')](_0x8add('0x35'))[_0x8add('0x20')](_0x1fedce,_0x1a116d);}});case _0x8add('0x36'):var _0x9bb7de=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967[_0x8add('0x37')]){var _0x386a04={};_0x386a04[_0x3a1967[_0x8add('0x37')]]=_0xda85de;_[_0x8add('0x34')](_0x9bb7de[_0x8add('0x30')],_0x386a04);}return _0xc26769[_0x8add('0x1d')](_0x8add('0x38'))[_0x8add('0x20')](_0x9bb7de,_0x1a116d)[_0x8add('0x32')]()['then'](function(_0x5dfaff){if(_0x5dfaff&&_0x5dfaff[_0x8add('0x22')]){return _0x5dfaff;}else{var _0x3f9609=_['cloneDeep'](_0x230604);if(_0x3a1967['additionalSearchContact']){var _0x1cbe55={};_0x1cbe55[_0x3a1967['additionalSearchContact']]=_0xda85de;_[_0x8add('0x34')](_0x3f9609['$or'],_0x1cbe55);}return _0xc26769['sobject'](_0x8add('0x31'))[_0x8add('0x20')](_0x3f9609,_0x1a116d)[_0x8add('0x21')](function(_0x97bfc4){if(_0x97bfc4&&_0x97bfc4[_0x8add('0x22')]){return _0x97bfc4;}else{var _0x3995b0=_['cloneDeep'](_0x230604);if(_0x3a1967[_0x8add('0x33')]){var _0x4dc37a={};_0x4dc37a[_0x3a1967[_0x8add('0x33')]]=_0xda85de;_[_0x8add('0x34')](_0x3995b0[_0x8add('0x30')],_0x4dc37a);}return _0xc26769[_0x8add('0x1d')](_0x8add('0x35'))[_0x8add('0x20')](_0x3995b0,_0x1a116d);}});}});case'contact':var _0x1e84e4=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967[_0x8add('0x2f')]){var _0x386a04={};_0x386a04[_0x3a1967[_0x8add('0x2f')]]=_0xda85de;_['merge'](_0x1e84e4[_0x8add('0x30')],_0x386a04);}return _0xc26769[_0x8add('0x1d')](_0x8add('0x31'))[_0x8add('0x20')](_0x1e84e4,_0x1a116d)[_0x8add('0x32')]();case'lead':var _0x314682=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967['additionalSearchLead']){var _0x386a04={};_0x386a04[_0x3a1967[_0x8add('0x33')]]=_0xda85de;_['merge'](_0x314682['$or'],_0x386a04);}return _0xc26769[_0x8add('0x1d')]('Lead')[_0x8add('0x20')](_0x314682,_0x1a116d);case _0x8add('0x16'):var _0x9bb7de=_[_0x8add('0x2e')](_0x230604);if(_0x3a1967[_0x8add('0x37')]){var _0x386a04={};_0x386a04[_0x3a1967[_0x8add('0x37')]]=_0xda85de;_[_0x8add('0x34')](_0x9bb7de[_0x8add('0x30')],_0x386a04);}return _0xc26769[_0x8add('0x1d')](_0x8add('0x38'))[_0x8add('0x20')](_0x9bb7de,_0x1a116d);default:return null;}})[_0x8add('0x21')](function(_0x19d615){if(_0x19d615&&_0x19d615[_0x8add('0x22')]){var _0x34b87e=_[_0x8add('0x39')](_0x19d615);if(_0x34b87e){return BPromise[_0x8add('0x25')]({'id':_0x34b87e['Id'],'name':_0x34b87e['Name'],'phone':_0x34b87e[_0x8add('0x3a')],'endUserType':_0x34b87e[_0x8add('0x3b')][_0x8add('0x3c')][_0x8add('0x3d')]()});}}})[_0x8add('0x21')](function(_0x2f8a38){if(_0x2f8a38){logger[_0x8add('0x1b')](_0x8add('0x3e'),_0x2f8a38[_0x8add('0x13')],_0xda85de);return BPromise[_0x8add('0x25')](_0x2f8a38);}else{logger[_0x8add('0x1b')](_0x8add('0x3f'),_0xda85de);var _0x411258={'Phone':_0xda85de};if(_0x3a1967[_0x8add('0x40')]){if(_0x3a1967[_0x8add('0x40')]===_0x8add('0x14')){logger[_0x8add('0x1b')](_0x8add('0x41'),_0xda85de,_0x3a1967[_0x8add('0x40')]);_0x411258[_0x8add('0x42')]=_0x1f8601!=='<unknown>'?_0x1f8601:util[_0x8add('0x43')](_0x8add('0x44'),_0xda85de);}else if(_0x3a1967[_0x8add('0x40')]==='lead'){logger[_0x8add('0x1b')](_0x8add('0x41'),_0xda85de,_0x3a1967[_0x8add('0x40')]);_0x411258[_0x8add('0x42')]=_0x1f8601!==_0x8add('0x45')?_0x1f8601:util[_0x8add('0x43')](_0x8add('0x44'),_0xda85de);_0x411258['Company']=_0x8add('0x46');}else if(_0x3a1967['moduleCreate']==='account'){logger[_0x8add('0x1b')](_0x8add('0x41'),_0xda85de,_0x3a1967[_0x8add('0x40')]);_0x411258[_0x8add('0x26')]=_0x1f8601!==_0x8add('0x45')?_0x1f8601:util['format'](_0x8add('0x44'),_0xda85de);}else{return null;}}return _0xc26769['sobject'](_[_0x8add('0x47')](_0x3a1967[_0x8add('0x40')]))[_0x8add('0x1e')](_0x411258)['then'](function(_0x41d8f7){return BPromise['resolve']({'id':_0x41d8f7['id'],'endUserType':_0x3a1967[_0x8add('0x40')]});});}});}function getCustomFields(_0x4b796c,_0x3f227a){var _0x5238e7={};if(_0x4b796c[_0x8add('0x22')]>0x0){_[_0x8add('0x48')](_0x4b796c,function(_0x1d887a){if(_[_0x8add('0x49')]([_0x8add('0x4a'),_0x8add('0x4b')],_0x1d887a[_0x8add('0x3c')])&&_0x1d887a[_0x8add('0x4c')]){_0x5238e7[_0x1d887a[_0x8add('0x4c')]]=_0x1d887a[_0x8add('0x4d')][_0x8add('0x4e')]();}else if(_0x1d887a[_0x8add('0x3c')]===_0x8add('0x4f')&&_0x1d887a['variableName']&&_0x1d887a['idField']){_0x3f227a[_0x1d887a[_0x8add('0x50')]]&&(_0x5238e7[_0x1d887a['idField']]=_0x3f227a[_0x1d887a[_0x8add('0x50')]][_0x8add('0x4e')]());}else if(_0x1d887a['type']===_0x8add('0x51')&&_0x1d887a['Variable']&&_0x1d887a[_0x8add('0x52')][_0x8add('0x53')]&&_0x1d887a[_0x8add('0x4c')]){_0x3f227a[_0x1d887a['Variable']['name'][_0x8add('0x3d')]()]&&(_0x5238e7[_0x1d887a[_0x8add('0x4c')]]=_0x3f227a[_0x1d887a[_0x8add('0x52')][_0x8add('0x53')]['toLowerCase']()][_0x8add('0x4e')]());}});}return _0x5238e7;}function getConnection(_0x1f98a3){var _0x4a160e=_0x1f98a3['password']['concat'](_0x1f98a3[_0x8add('0x54')]);var _0x29198e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1f98a3[_0x8add('0x55')]||_0x8add('0x56'),'clientId':_0x1f98a3[_0x8add('0x57')],'clientSecret':_0x1f98a3[_0x8add('0x58')]}});return _0x29198e[_0x8add('0x59')](_0x1f98a3['username'],_0x4a160e)['then'](function(){logger['info'](_0x8add('0x5a'));return _0x29198e;});}exports['queue']=function(_0x1eb6da,_0x29b22c,_0x3d77b6,_0x9a6d68,_0x3b92ab,_0x5c711d){var _0x4ef4f7,_0x233f8a,_0xb6ac34,_0x16a796;_0x5c711d[_0x8add('0x5b')]=intUtil['stripTrailingSlash'](_0x5c711d['serverUrl']);_0x5c711d['remoteUri']=intUtil[_0x8add('0x5c')](_0x5c711d['remoteUri']);if(_0x3b92ab&&_0x3b92ab[_0x8add('0x5d')]){logger[_0x8add('0x1b')](_0x8add('0x5e'),_0x8add('0x5f'));_0x29b22c[_0x8add('0x60')]=util[_0x8add('0x43')](_0x8add('0x61'),_0x5c711d[_0x8add('0x5b')],_0x29b22c[_0x8add('0x62')],md5(_0x29b22c[_0x8add('0x62')]));}else{_0x29b22c[_0x8add('0x60')]='';}return getConnection(_0x5c711d)[_0x8add('0x21')](function(_0x25066d){_0x16a796=_0x25066d;return getUser(_0x5c711d,_0x9a6d68[_0x8add('0x63')],_0x16a796);})[_0x8add('0x21')](function(_0x17209b){_0x4ef4f7=_0x17209b;return getEndUser(_0x5c711d,_0x3d77b6,_0x29b22c[_0x8add('0x64')],_0x29b22c[_0x8add('0x65')],_0x16a796);})[_0x8add('0x21')](function(_0x2bf081){_0x233f8a=_0x2bf081;return getTicket(_0x5c711d,_0x4ef4f7,_0x233f8a,_0x3d77b6,_0x29b22c,_0x3d77b6[_0x8add('0x66')],_0x16a796,_0x8add('0x67'));})[_0x8add('0x21')](function(_0x1bd30e){_0xb6ac34=_0x1bd30e;logger[_0x8add('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0xb6ac34['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xb6ac34['id'],_0x9a6d68[_0x8add('0x53')],_0x5c711d[_0x8add('0x3c')]);switch(_0x5c711d[_0x8add('0x3c')]){case _0x8add('0x68'):emit(util[_0x8add('0x43')](_0x8add('0x69'),_0x9a6d68[_0x8add('0x53')]),_0x8add('0x6a'),{'recordId':_0xb6ac34['id']});break;case _0x8add('0x6b'):emit(util[_0x8add('0x43')](_0x8add('0x69'),_0x9a6d68['name']),_0x8add('0x6c'),{'uri':util[_0x8add('0x43')]('%s/%s/e',_0x16a796[_0x8add('0x6d')],_0xb6ac34['id'])});break;default:logger[_0x8add('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8add('0x6f')](function(_0x492fde){logger[_0x8add('0x6e')]('[QUEUE]',_0x492fde);});};exports[_0x8add('0x70')]=function(_0x320d41,_0x1cc840,_0x4cfc5c,_0x2e2b50,_0x172e47,_0x299ae0,_0x301e61){var _0x29a926,_0x5359a4,_0x2817cd,_0x2742bb;_0x299ae0[_0x8add('0x5b')]=intUtil[_0x8add('0x5c')](_0x299ae0[_0x8add('0x5b')]);_0x299ae0[_0x8add('0x55')]=intUtil[_0x8add('0x5c')](_0x299ae0['remoteUri']);if(_0x301e61&&_0x301e61['recordingFormat']&&_0x301e61[_0x8add('0x71')]!==_0x8add('0x72')){logger[_0x8add('0x1b')](_0x8add('0x73'),_0x8add('0x5f'));_0x1cc840[_0x8add('0x60')]=util[_0x8add('0x43')](_0x8add('0x61'),_0x299ae0[_0x8add('0x5b')],_0x1cc840[_0x8add('0x62')],md5(_0x1cc840[_0x8add('0x62')]));}return getConnection(_0x299ae0)[_0x8add('0x21')](function(_0x4d3b70){_0x2742bb=_0x4d3b70;return getUser(_0x299ae0,_0x2e2b50[_0x8add('0x63')],_0x2742bb);})[_0x8add('0x21')](function(_0x113343){_0x29a926=_0x113343;return getEndUser(_0x299ae0,_0x4cfc5c,_0x1cc840[_0x8add('0x74')],_0x1cc840[_0x8add('0x75')],_0x2742bb);})['then'](function(_0x125afc){_0x5359a4=_0x125afc;return getTicket(_0x299ae0,_0x29a926,_0x5359a4,_0x4cfc5c,_0x1cc840,_0x4cfc5c[_0x8add('0x66')],_0x2742bb,_0x8add('0x70'));})['then'](function(_0x10e7ca){_0x2817cd=_0x10e7ca;logger[_0x8add('0x1b')](_0x8add('0x76'),_0x2817cd['id']);logger['info'](_0x8add('0x77'),_0x2817cd['id'],_0x2e2b50['name'],_0x299ae0[_0x8add('0x3c')]);switch(_0x299ae0[_0x8add('0x3c')]){case'integrationTab':emit(util[_0x8add('0x43')](_0x8add('0x69'),_0x2e2b50[_0x8add('0x53')]),'trigger:salesforce:display',{'recordId':_0x2817cd['id']});break;case _0x8add('0x6b'):emit(util['format']('user:%s',_0x2e2b50[_0x8add('0x53')]),_0x8add('0x6c'),{'uri':util['format']('%s/%s/e',_0x2742bb[_0x8add('0x6d')],_0x2817cd['id'])});break;default:logger[_0x8add('0x6e')](_0x8add('0x73'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x8add('0x6f')](function(_0x3e56da){logger[_0x8add('0x6e')]('[OUTBOUND]',_0x3e56da);});};exports[_0x8add('0x78')]=function(_0x59b884,_0x24d9a6,_0x3583c0,_0x1f2594,_0x429cc7,_0x2f3b99){var _0x3de5c8,_0x47f3d1,_0x127d6c,_0x41402c;_0x2f3b99[_0x8add('0x5b')]=intUtil[_0x8add('0x5c')](_0x2f3b99[_0x8add('0x5b')]);_0x2f3b99[_0x8add('0x55')]=intUtil[_0x8add('0x5c')](_0x2f3b99[_0x8add('0x55')]);if(_0x429cc7&&_0x429cc7['monitor_format']){logger['info']('['+_0x24d9a6[_0x8add('0x79')][_0x8add('0x7a')]()+']',_0x8add('0x5f'));_0x24d9a6[_0x8add('0x60')]=util['format'](_0x8add('0x61'),_0x2f3b99['serverUrl'],_0x24d9a6[_0x8add('0x62')],md5(_0x24d9a6[_0x8add('0x62')]));}else{_0x24d9a6['recordingURL']='';}return getConnection(_0x2f3b99)[_0x8add('0x21')](function(_0xab2dcf){_0x41402c=_0xab2dcf;if(!_[_0x8add('0x7b')](_0x1f2594)){return getUser(_0x2f3b99,_0x1f2594[_0x8add('0x53')],_0x41402c);}else{return getUser(_0x2f3b99,null,_0x41402c);}})[_0x8add('0x21')](function(_0x332385){_0x3de5c8=_0x332385;return getEndUser(_0x2f3b99,_0x3583c0,_0x24d9a6[_0x8add('0x64')],_0x24d9a6[_0x8add('0x65')],_0x41402c);})['then'](function(_0x29d124){_0x47f3d1=_0x29d124;return getTicket(_0x2f3b99,_0x3de5c8,_0x47f3d1,_0x3583c0,_0x24d9a6,_0x3583c0[_0x8add('0x66')],_0x41402c);})[_0x8add('0x21')](function(_0x2c601d){_0x127d6c=_0x2c601d;logger[_0x8add('0x1b')]('['+_0x24d9a6[_0x8add('0x79')][_0x8add('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x127d6c['id']);logger[_0x8add('0x1b')]('['+_0x24d9a6['lastevent'][_0x8add('0x7a')]()+_0x8add('0x7c'),_0x2f3b99[_0x8add('0x3c')]);})[_0x8add('0x6f')](function(_0x39cea5){logger[_0x8add('0x6e')]('['+_0x24d9a6[_0x8add('0x79')][_0x8add('0x7a')]()+']',_0x39cea5);});};
\ No newline at end of file
index 18035f5..5d0abf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafeb=['serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','],\x20getUser\x20crm','adminEmail','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash'];(function(_0x46df7f,_0x2ef4f2){var _0x7118c4=function(_0x3438e0){while(--_0x3438e0){_0x46df7f['push'](_0x46df7f['shift']());}};_0x7118c4(++_0x2ef4f2);}(_0xafeb,0xf0));var _0xbafe=function(_0x4d4496,_0x28fc7c){_0x4d4496=_0x4d4496-0x0;var _0x45e83a=_0xafeb[_0x4d4496];return _0x45e83a;};'use strict';var _=require(_0xbafe('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0xbafe('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xbafe('0x2'));var logger=require(_0xbafe('0x3'))(_0xbafe('0x4'));config['redis']=_['defaults'](config[_0xbafe('0x5')],{'host':_0xbafe('0x6'),'port':0x18eb});var io=require(_0xbafe('0x7'))(new Redis(config[_0xbafe('0x5')]));function getAdminUser(_0x56844e,_0x40bf5d,_0x171cf7,_0x5706e3,_0x37a17e,_0x437897){return new Promise(function(_0x5b2e1d,_0x421155){var _0x1ef3cf={'method':'GET','uri':_0x5706e3+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x37a17e+'&'+_0x437897,'auth':_0x40bf5d,'json':!![]};return rp(_0x1ef3cf)[_0xbafe('0x8')](function(_0x388fa3){if(_0x388fa3[_0xbafe('0x9')][_0xbafe('0xa')]>0x0){_0x171cf7[_0xbafe('0xb')]=_0x388fa3[_0xbafe('0x9')][0x0][_0xbafe('0xc')];}logger[_0xbafe('0xd')]('['+[_0x56844e[_0xbafe('0xe')]()]+_0xbafe('0xf'),_0x171cf7);_0x5b2e1d(_0x171cf7);})[_0xbafe('0x10')](function(_0x2cbdc4){logger[_0xbafe('0x11')]('['+[_0x56844e['toUpperCase']()]+']',_0x2cbdc4['message']);_0x421155(_0x2cbdc4[_0xbafe('0x12')]);});});}function getUser(_0x4d9523,_0x2110f9,_0x36c526,_0x4f578c,_0x36e42c){return function(_0x13021a){logger[_0xbafe('0xd')]('['+[_0x4d9523[_0xbafe('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x13021a);return new Promise(function(_0x312ca2,_0x351880){if(intUtil[_0xbafe('0x13')](_0x13021a[_0xbafe('0x14')])){var _0x39d492={'method':_0xbafe('0x15'),'uri':_0x36c526+_0xbafe('0x16')+_0x13021a['userEmail']+'&'+_0x4f578c+'&'+_0x36e42c,'auth':_0x2110f9,'json':!![]};logger[_0xbafe('0xd')]('['+[_0x4d9523[_0xbafe('0xe')]()]+_0xbafe('0x17'),_0x39d492);return rp(_0x39d492)['then'](function(_0x4cdff7){logger[_0xbafe('0xd')]('['+[_0x4d9523['toUpperCase']()]+'],\x20getUser\x20entity',_0x4cdff7);if(_0x4cdff7['result'][_0xbafe('0xa')]>0x0&&String(_0x4cdff7[_0xbafe('0x9')][0x0][_0xbafe('0x18')])===_0xbafe('0x19')){_0x13021a['userId']=_0x4cdff7[_0xbafe('0x9')][0x0]['sys_id'];}else{_0x13021a[_0xbafe('0x1a')]=_0x13021a[_0xbafe('0xb')];_0x13021a[_0xbafe('0x14')]=_0x13021a['adminEmail'];}logger[_0xbafe('0xd')]('['+[_0x4d9523[_0xbafe('0xe')]()]+_0xbafe('0x1b'),_0x13021a);_0x312ca2(_0x13021a);})[_0xbafe('0x10')](function(_0x51cf0f){logger['error']('['+[_0x4d9523[_0xbafe('0xe')]()]+']',_0x51cf0f[_0xbafe('0x12')]);_0x351880(_0x51cf0f[_0xbafe('0x12')]);});}else{logger['info']('['+[_0x4d9523[_0xbafe('0xe')]()]+']\x20using\x20admin\x20profile');_0x13021a[_0xbafe('0x1a')]=_0x13021a[_0xbafe('0xb')];_0x13021a[_0xbafe('0x14')]=_0x13021a[_0xbafe('0x1c')];_0x312ca2(_0x13021a);}});};}function createEndUser(_0x51da84,_0x222783,_0x36ac0f,_0x580cd7,_0x55973c){logger['info']('['+[_0x51da84[_0xbafe('0xe')]()]+'],\x20createEndUser\x20input\x20crm',_0x36ac0f);return new Promise(function(_0x25cb2b,_0x1a0780){var _0x3ab4a8={'method':_0xbafe('0x1d'),'uri':_0x580cd7+_0xbafe('0x1e')+_0x55973c,'body':{'user_name':_0x36ac0f[_0xbafe('0x1f')],'roles':_0xbafe('0x20'),'first_name':_0x36ac0f['endUserNumber'],'active':_0xbafe('0x19'),'date_format':_0xbafe('0x21'),'phone':_0x36ac0f[_0xbafe('0x1f')]},'auth':_0x222783,'json':!![]};return rp(_0x3ab4a8)[_0xbafe('0x8')](function(_0x25ba40){logger[_0xbafe('0xd')]('['+[_0x51da84[_0xbafe('0xe')]()]+_0xbafe('0x22'),_0x25ba40[_0xbafe('0x9')]);_0x36ac0f[_0xbafe('0x23')]=_0x25ba40[_0xbafe('0x9')][_0xbafe('0xc')];_0x25cb2b(_0x36ac0f);})[_0xbafe('0x10')](function(_0x4ffcd7){logger[_0xbafe('0x11')]('['+[_0x51da84[_0xbafe('0xe')]()]+']',_0x4ffcd7['message']);_0x1a0780(_0x4ffcd7[_0xbafe('0x12')]);});});}function getEndUser(_0x94a395,_0x7da786,_0x311ad1,_0x1d16e1,_0x52e8c1){return function(_0x3a8722){logger['info']('['+[_0x94a395[_0xbafe('0xe')]()]+_0xbafe('0x24'),_0x3a8722);return new Promise(function(_0x22ed66,_0x5c48c6){var _0xb11749={'method':_0xbafe('0x15'),'uri':_0x311ad1+_0xbafe('0x25')+_0x3a8722[_0xbafe('0x1f')]+'&'+_0x1d16e1+'&'+_0x52e8c1,'auth':_0x7da786,'json':!![]};return rp(_0xb11749)[_0xbafe('0x8')](function(_0x172011){if(_0x172011[_0xbafe('0x9')][_0xbafe('0xa')]>0x0){_0x3a8722[_0xbafe('0x23')]=_0x172011[_0xbafe('0x9')][0x0][_0xbafe('0xc')];logger[_0xbafe('0xd')]('['+[_0x94a395[_0xbafe('0xe')]()]+'],\x20getEndUser\x20crm',_0x3a8722);_0x22ed66(_0x3a8722);}else{return createEndUser(_0x94a395,_0x7da786,_0x3a8722,_0x311ad1,_0x1d16e1)[_0xbafe('0x8')](function(_0x1f0338){logger[_0xbafe('0xd')]('['+[_0x94a395[_0xbafe('0xe')]()]+'],\x20createEndUser\x20crm',_0x1f0338);_0x22ed66(_0x1f0338);});}})[_0xbafe('0x10')](function(_0x3429e1){logger[_0xbafe('0x11')]('['+[_0x94a395[_0xbafe('0xe')]()]+']',_0x3429e1[_0xbafe('0x12')]);_0x5c48c6(_0x3429e1[_0xbafe('0x12')]);});});};}function getCustomFields(_0x3a2e6a,_0x2998b5){var _0x310718={};if(_0x3a2e6a[_0xbafe('0xa')]>0x0){_[_0xbafe('0x26')](_0x3a2e6a,function(_0x282c1a){if(_['includes']([_0xbafe('0x27'),_0xbafe('0x28')],_0x282c1a[_0xbafe('0x29')])&&_0x282c1a[_0xbafe('0x2a')]&&!_0x282c1a[_0xbafe('0x2b')]){_0x310718[_0x282c1a['nameField'][_0xbafe('0x2c')]()]=_0x282c1a[_0xbafe('0x2d')][_0xbafe('0x2e')]();}else if(_[_0xbafe('0x2f')](['string',_0xbafe('0x28')],_0x282c1a[_0xbafe('0x29')])&&_0x282c1a[_0xbafe('0x30')]&&_0x282c1a[_0xbafe('0x2b')]){_0x310718[_0x282c1a[_0xbafe('0x30')]['toLowerCase']()]=_0x282c1a[_0xbafe('0x2d')][_0xbafe('0x2e')]();}else if(_0x282c1a[_0xbafe('0x29')]===_0xbafe('0x31')&&_0x282c1a[_0xbafe('0x32')]&&_0x282c1a['idField']&&_0x282c1a['customField']){_0x310718[_0x282c1a[_0xbafe('0x30')][_0xbafe('0x2c')]()]=_0x2998b5[_0x282c1a[_0xbafe('0x32')]][_0xbafe('0x2e')]();}else if(_0x282c1a[_0xbafe('0x29')]===_0xbafe('0x33')&&_0x282c1a[_0xbafe('0x34')]&&_0x282c1a[_0xbafe('0x34')]['name']&&_0x282c1a[_0xbafe('0x30')]&&_0x282c1a['customField']){_0x310718[_0x282c1a[_0xbafe('0x30')][_0xbafe('0x2c')]()]=_0x2998b5[_0x282c1a[_0xbafe('0x34')][_0xbafe('0x35')][_0xbafe('0x2c')]()][_0xbafe('0x2e')]();}});}return _0x310718;}function getTicket(_0x3ba479,_0x5527fe,_0x23262c,_0x14a426,_0x281ecd,_0x3e9835){return function(_0x56b3db){logger['info']('['+[_0x3ba479['toUpperCase']()]+_0xbafe('0x36'),_0x56b3db);return new Promise(function(_0x50a007,_0x10b3b7){var _0x19f993=_0x3ba479[_0xbafe('0x2c')]()===_0xbafe('0x37')?_0x56b3db[_0xbafe('0x1a')]:_0x56b3db['endUserId'];var _0x5823d7={'method':_0xbafe('0x1d'),'uri':_0x23262c+_0xbafe('0x38')+'?'+_0x3e9835,'body':Object[_0xbafe('0x39')]({},{'active':'true','caller_id':_0x19f993,'assigned_to':_0x56b3db[_0xbafe('0x1a')],'short_description':intUtil[_0xbafe('0x3a')](_0x14a426[_0xbafe('0x3b')],_0x281ecd,'\x20'),'description':intUtil['getString'](_0x14a426[_0xbafe('0x3c')],_0x281ecd,'\x0a')},getCustomFields(_0x14a426[_0xbafe('0x3d')],_0x281ecd)),'auth':_0x5527fe,'json':!![]};return rp(_0x5823d7)[_0xbafe('0x8')](function(_0x3b873a){logger[_0xbafe('0xd')]('['+[_0x3ba479[_0xbafe('0xe')]()]+_0xbafe('0x3e'),_0x3b873a['result']);_0x56b3db['ticketId']=_0x3b873a[_0xbafe('0x9')][_0xbafe('0xc')];_0x56b3db[_0xbafe('0x3f')]=_0x3b873a[_0xbafe('0x9')][_0xbafe('0x40')];logger[_0xbafe('0xd')]('['+[_0x3ba479[_0xbafe('0xe')]()]+_0xbafe('0x41'),_0x56b3db);_0x50a007(_0x56b3db);})[_0xbafe('0x10')](function(_0x111be7){logger[_0xbafe('0x11')]('['+[_0x3ba479[_0xbafe('0xe')]()]+']',_0x111be7[_0xbafe('0x12')]);_0x10b3b7(_0x111be7[_0xbafe('0x12')]);});});};}function createRemoteTag(_0x3bb0bd,_0x1352dc,_0x14ca0d,_0x22f852){return new Promise(function(_0x322959,_0xda9c2f){var _0x38207d={'method':_0xbafe('0x1d'),'uri':_0x14ca0d+_0xbafe('0x42')+'?'+_0x22f852,'body':{'short_description':_0x3bb0bd,'global':!![],'active':!![],'name':_0x3bb0bd},'auth':_0x1352dc,'json':!![]};return rp(_0x38207d)['then'](function(_0x2d0c86){var _0x2cfec4=_0x2d0c86[_0xbafe('0x9')][_0xbafe('0xc')];_0x322959(_0x2cfec4);});});}function getRemoteTag(_0xf7d679,_0x884be0,_0x3e6180,_0x386b96,_0x1be51e){return new Promise(function(_0x4d6a00,_0x1efc24){var _0x3dd233={'method':_0xbafe('0x15'),'uri':_0x3e6180+_0xbafe('0x42')+'?sysparm_query=name%3D'+_0xf7d679+'&'+_0x386b96,'auth':_0x884be0,'json':!![]};return rp(_0x3dd233)['then'](function(_0x284a5a){if(_0x284a5a[_0xbafe('0x9')][_0xbafe('0xa')]>0x0){var _0x519f56=_0x284a5a['result'][0x0][_0xbafe('0xc')];_0x4d6a00(_0x519f56);}else{return createRemoteTag(_0xf7d679,_0x884be0,_0x3e6180,_0x386b96)['then'](function(_0x2a85b1){_0x4d6a00(_0x2a85b1);});}});});}function assignTagToIncident(_0x4d30a9,_0x5e3303,_0x146030,_0x44beeb,_0x3a1677){return new Promise(function(_0x27e7f6,_0x684158){var _0x1a17e6={'method':_0xbafe('0x1d'),'uri':_0x146030+_0xbafe('0x43')+'?'+_0x3a1677,'body':{'label':_0x4d30a9,'table':_0xbafe('0x38'),'id_type':_0xbafe('0x44'),'table_key':_0x44beeb[_0xbafe('0x45')],'title':_0xbafe('0x46')+_0x44beeb[_0xbafe('0x3f')],'id_display':_0x44beeb['ticketNumber']},'auth':_0x5e3303,'json':!![]};return rp(_0x1a17e6)['then'](function(_0x21057d){_0x27e7f6();})[_0xbafe('0x10')](function(){_0x27e7f6();});});}function manageTags(_0x25a08a,_0x2af165,_0x3de0c6,_0x399eea,_0x4f122f,_0x381e28,_0x75aeb6){return new Promise(function(_0x30574d,_0x465cec){var _0x3d52e8=[];_0x2af165[_0xbafe('0x26')](function(_0x12e4a8){_0x3d52e8[_0xbafe('0x47')](getRemoteTag(_0x12e4a8,_0x3de0c6,_0x399eea,_0x381e28,_0x75aeb6));});return Promise[_0xbafe('0x48')](_0x3d52e8)[_0xbafe('0x8')](function(_0x2f719f){if(_0x2f719f[_0xbafe('0xa')]){logger[_0xbafe('0xd')]('['+[_0x25a08a['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2f719f);var _0x17b57d=[];_0x2f719f['forEach'](function(_0x59d171){_0x17b57d[_0xbafe('0x47')](assignTagToIncident(_0x59d171,_0x3de0c6,_0x399eea,_0x4f122f,_0x381e28));});return Promise['all'](_0x17b57d)['then'](function(){_0x30574d();})[_0xbafe('0x10')](function(){_0x30574d();});}else{_0x30574d();}});});}function getTags(_0x313f85,_0x3d34b6,_0x1782c2,_0x11eb31,_0x353f69,_0x2f43e9){return function(_0x273267){return new Promise(function(_0x40883b,_0xc6241a){var _0x41bba1=[];var _0x520f3f=_0x11eb31[_0xbafe('0x49')];if(_0x520f3f&&_0x520f3f['length']>0x0){_0x41bba1=_['map'](_0x520f3f,'name');}if(_0x41bba1[_0xbafe('0xa')]>0x0){return manageTags(_0x313f85,_0x41bba1,_0x3d34b6,_0x1782c2,_0x273267,_0x353f69,_0x2f43e9)[_0xbafe('0x8')](function(){_0x40883b(_0x273267);});}else{_0x40883b(_0x273267);}});};}function emit(_0x14c2cb,_0x85dcae,_0x511348){var _0x47a311=_0xbafe('0x4a')+_0xbafe('0x4b')+_0xbafe('0x4c')+'%255EORDERBYDESCnumber';var _0x300eae={'uri':_0x14c2cb+_0xbafe('0x4d')+_0x511348+_0x47a311};io['to'](util[_0xbafe('0x4e')](_0xbafe('0x4f'),_0x85dcae))[_0xbafe('0x50')]('trigger:browser:url',_0x300eae);}exports['cs']=function(_0x45eed2,_0x11e09,_0x55ff70,_0x58b726,_0x5d3a24,_0x5c53fc,_0x3cf936,_0x146dc7){var _0x13765d={};var _0x22dc74={'user':_0x5c53fc[_0xbafe('0x51')],'pass':_0x5c53fc[_0xbafe('0x52')]};var _0x3f03f6=_0xbafe('0x53');var _0x1127a7=_0xbafe('0x54');_0x5c53fc[_0xbafe('0x55')]=intUtil[_0xbafe('0x56')](_0x5c53fc[_0xbafe('0x55')]);_0x5c53fc[_0xbafe('0x57')]=intUtil['stripTrailingSlash'](_0x5c53fc[_0xbafe('0x57')]);var _0x388d4c=util['format'](_0xbafe('0x58'),_0x5c53fc[_0xbafe('0x55')]);_0x13765d[_0xbafe('0x14')]=!_[_0xbafe('0x59')](_0x58b726)?_0x58b726['email']:null;_0x13765d['adminEmail']=_0x5c53fc[_0xbafe('0x5a')];_0x13765d[_0xbafe('0x1f')]=_0x146dc7['toLowerCase']()===_0xbafe('0x37')?_0x11e09[_0xbafe('0x5b')]:_0x11e09[_0xbafe('0x5c')];_0x13765d[_0xbafe('0x5d')]=_0x146dc7===_0xbafe('0x5e')||_0x146dc7==='unmanaged'?_0xbafe('0x5e'):_0xbafe('0x37');var _0x3556a9=util[_0xbafe('0x4e')](_0xbafe('0x5f'),_0x5c53fc[_0xbafe('0x57')],_0x11e09[_0xbafe('0x60')],md5(_0x11e09['uniqueid']));if(_0x5d3a24&&_0x5d3a24['monitor_format']){logger[_0xbafe('0xd')](_0xbafe('0x61'),_0xbafe('0x62'));_0x11e09['recordingURL']=_0x3556a9;}else if(_0x3cf936&&_0x3cf936[_0xbafe('0x63')]&&_0x3cf936[_0xbafe('0x63')]!==_0xbafe('0x64')){logger[_0xbafe('0xd')](_0xbafe('0x65'),_0xbafe('0x62'));_0x11e09['recordingURL']=_0x3556a9;}else{_0x11e09[_0xbafe('0x66')]='';}return getAdminUser(_0x146dc7,_0x22dc74,_0x13765d,_0x388d4c,_0x1127a7,_0x3f03f6)[_0xbafe('0x8')](getUser(_0x146dc7,_0x22dc74,_0x388d4c,_0x1127a7,_0x3f03f6))['then'](getEndUser(_0x146dc7,_0x22dc74,_0x388d4c,_0x1127a7,_0x3f03f6))[_0xbafe('0x8')](getTicket(_0x146dc7,_0x22dc74,_0x388d4c,_0x55ff70,_0x11e09,_0x1127a7))[_0xbafe('0x8')](function(_0x230060){logger[_0xbafe('0xd')](util[_0xbafe('0x4e')](_0xbafe('0x67'),_0x230060[_0xbafe('0x45')]));logger['info'](util[_0xbafe('0x4e')](_0xbafe('0x68'),_0x146dc7));if(_0x146dc7!==_0xbafe('0x69')){logger[_0xbafe('0xd')]('['+[_0x146dc7['toUpperCase']()]+']',_0xbafe('0x6a'));emit(_0x5c53fc[_0xbafe('0x55')],_0x58b726[_0xbafe('0x35')],_0x230060[_0xbafe('0x45')]);}})[_0xbafe('0x10')](function(_0x1e3717){logger['error']('['+[_0x146dc7[_0xbafe('0xe')]()]+_0xbafe('0x6b'),util[_0xbafe('0x6c')](_0x1e3717,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4618=['lodash','bluebird','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20createEndUser\x20input\x20crm','endUserNumber','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','nameField','customField','toLowerCase','toString','picklist','type','idField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration'];(function(_0x3f2e26,_0x463511){var _0x4f2fd8=function(_0x3a87ac){while(--_0x3a87ac){_0x3f2e26['push'](_0x3f2e26['shift']());}};_0x4f2fd8(++_0x463511);}(_0x4618,0x135));var _0x8461=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x4618[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x8461('0x0'));var Promise=require(_0x8461('0x1'));var rp=require(_0x8461('0x2'));var util=require(_0x8461('0x3'));var md5=require('md5');var Redis=require(_0x8461('0x4'));var intUtil=require('./util');var config=require(_0x8461('0x5'));var logger=require(_0x8461('0x6'))(_0x8461('0x7'));config[_0x8461('0x8')]=_['defaults'](config['redis'],{'host':_0x8461('0x9'),'port':0x18eb});var io=require(_0x8461('0xa'))(new Redis(config[_0x8461('0x8')]));function getAdminUser(_0x36ba22,_0x591552,_0x255abc,_0x32c904,_0x1b8944,_0x10ad58){return new Promise(function(_0x1d1f37,_0x429e21){var _0x3a17db={'method':_0x8461('0xb'),'uri':_0x32c904+_0x8461('0xc')+'&'+_0x1b8944+'&'+_0x10ad58,'auth':_0x591552,'json':!![]};return rp(_0x3a17db)[_0x8461('0xd')](function(_0x2bda37){if(_0x2bda37['result'][_0x8461('0xe')]>0x0){_0x255abc[_0x8461('0xf')]=_0x2bda37[_0x8461('0x10')][0x0][_0x8461('0x11')];}logger[_0x8461('0x12')]('['+[_0x36ba22[_0x8461('0x13')]()]+'],\x20getAdminUser\x20crm',_0x255abc);_0x1d1f37(_0x255abc);})[_0x8461('0x14')](function(_0x1c56d6){logger[_0x8461('0x15')]('['+[_0x36ba22[_0x8461('0x13')]()]+']',_0x1c56d6[_0x8461('0x16')]);_0x429e21(_0x1c56d6[_0x8461('0x16')]);});});}function getUser(_0x1fe9c2,_0x299aeb,_0x3386ca,_0x329535,_0xf6c98c){return function(_0x28d7aa){logger[_0x8461('0x12')]('['+[_0x1fe9c2['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x28d7aa);return new Promise(function(_0x1bface,_0x30347f){if(intUtil[_0x8461('0x17')](_0x28d7aa[_0x8461('0x18')])){var _0x57d57a={'method':_0x8461('0xb'),'uri':_0x3386ca+_0x8461('0x19')+_0x28d7aa[_0x8461('0x18')]+'&'+_0x329535+'&'+_0xf6c98c,'auth':_0x299aeb,'json':!![]};logger[_0x8461('0x12')]('['+[_0x1fe9c2[_0x8461('0x13')]()]+_0x8461('0x1a'),_0x57d57a);return rp(_0x57d57a)[_0x8461('0xd')](function(_0x3fa14a){logger['info']('['+[_0x1fe9c2[_0x8461('0x13')]()]+_0x8461('0x1b'),_0x3fa14a);if(_0x3fa14a[_0x8461('0x10')][_0x8461('0xe')]>0x0&&String(_0x3fa14a[_0x8461('0x10')][0x0][_0x8461('0x1c')])===_0x8461('0x1d')){_0x28d7aa[_0x8461('0x1e')]=_0x3fa14a[_0x8461('0x10')][0x0][_0x8461('0x11')];}else{_0x28d7aa['userId']=_0x28d7aa[_0x8461('0xf')];_0x28d7aa[_0x8461('0x18')]=_0x28d7aa[_0x8461('0x1f')];}logger[_0x8461('0x12')]('['+[_0x1fe9c2[_0x8461('0x13')]()]+'],\x20getUser\x20crm',_0x28d7aa);_0x1bface(_0x28d7aa);})['catch'](function(_0x5aef52){logger[_0x8461('0x15')]('['+[_0x1fe9c2['toUpperCase']()]+']',_0x5aef52[_0x8461('0x16')]);_0x30347f(_0x5aef52[_0x8461('0x16')]);});}else{logger[_0x8461('0x12')]('['+[_0x1fe9c2[_0x8461('0x13')]()]+']\x20using\x20admin\x20profile');_0x28d7aa[_0x8461('0x1e')]=_0x28d7aa[_0x8461('0xf')];_0x28d7aa[_0x8461('0x18')]=_0x28d7aa[_0x8461('0x1f')];_0x1bface(_0x28d7aa);}});};}function createEndUser(_0x7e3d95,_0x2c9beb,_0x366cd9,_0x356441,_0x56e013){logger[_0x8461('0x12')]('['+[_0x7e3d95[_0x8461('0x13')]()]+_0x8461('0x20'),_0x366cd9);return new Promise(function(_0x18d8a9,_0x5c7a4a){var _0x3e467a={'method':'POST','uri':_0x356441+'sys_user?'+_0x56e013,'body':{'user_name':_0x366cd9['endUserNumber'],'roles':'user','first_name':_0x366cd9[_0x8461('0x21')],'active':_0x8461('0x1d'),'date_format':'System','phone':_0x366cd9[_0x8461('0x21')]},'auth':_0x2c9beb,'json':!![]};return rp(_0x3e467a)[_0x8461('0xd')](function(_0xe84918){logger['info']('['+[_0x7e3d95[_0x8461('0x13')]()]+'],\x20EndUser\x20schema',_0xe84918[_0x8461('0x10')]);_0x366cd9[_0x8461('0x22')]=_0xe84918['result'][_0x8461('0x11')];_0x18d8a9(_0x366cd9);})[_0x8461('0x14')](function(_0xc24ba){logger[_0x8461('0x15')]('['+[_0x7e3d95[_0x8461('0x13')]()]+']',_0xc24ba[_0x8461('0x16')]);_0x5c7a4a(_0xc24ba[_0x8461('0x16')]);});});}function getEndUser(_0x491692,_0x4a96ac,_0x2c9a6a,_0x57a471,_0x6a69dc){return function(_0x2c9584){logger['info']('['+[_0x491692[_0x8461('0x13')]()]+_0x8461('0x23'),_0x2c9584);return new Promise(function(_0x3da82b,_0x5c5565){var _0xe07ea1={'method':_0x8461('0xb'),'uri':_0x2c9a6a+_0x8461('0x24')+_0x2c9584[_0x8461('0x21')]+'&'+_0x57a471+'&'+_0x6a69dc,'auth':_0x4a96ac,'json':!![]};return rp(_0xe07ea1)['then'](function(_0x4fbe29){if(_0x4fbe29[_0x8461('0x10')]['length']>0x0){_0x2c9584[_0x8461('0x22')]=_0x4fbe29[_0x8461('0x10')][0x0][_0x8461('0x11')];logger['info']('['+[_0x491692[_0x8461('0x13')]()]+_0x8461('0x25'),_0x2c9584);_0x3da82b(_0x2c9584);}else{return createEndUser(_0x491692,_0x4a96ac,_0x2c9584,_0x2c9a6a,_0x57a471)[_0x8461('0xd')](function(_0x489ee9){logger[_0x8461('0x12')]('['+[_0x491692['toUpperCase']()]+_0x8461('0x26'),_0x489ee9);_0x3da82b(_0x489ee9);});}})[_0x8461('0x14')](function(_0x58cf9a){logger[_0x8461('0x15')]('['+[_0x491692['toUpperCase']()]+']',_0x58cf9a['message']);_0x5c5565(_0x58cf9a[_0x8461('0x16')]);});});};}function getCustomFields(_0x2fbbc6,_0x2e90ec){var _0x4d6c98={};if(_0x2fbbc6['length']>0x0){_[_0x8461('0x27')](_0x2fbbc6,function(_0x58c6b3){if(_[_0x8461('0x28')]([_0x8461('0x29'),'picklist'],_0x58c6b3['type'])&&_0x58c6b3[_0x8461('0x2a')]&&!_0x58c6b3[_0x8461('0x2b')]){_0x4d6c98[_0x58c6b3[_0x8461('0x2a')][_0x8461('0x2c')]()]=_0x58c6b3['content'][_0x8461('0x2d')]();}else if(_['includes']([_0x8461('0x29'),_0x8461('0x2e')],_0x58c6b3[_0x8461('0x2f')])&&_0x58c6b3[_0x8461('0x30')]&&_0x58c6b3[_0x8461('0x2b')]){_0x4d6c98[_0x58c6b3[_0x8461('0x30')][_0x8461('0x2c')]()]=_0x58c6b3['content'][_0x8461('0x2d')]();}else if(_0x58c6b3[_0x8461('0x2f')]==='variable'&&_0x58c6b3[_0x8461('0x31')]&&_0x58c6b3[_0x8461('0x30')]&&_0x58c6b3[_0x8461('0x2b')]){_0x4d6c98[_0x58c6b3[_0x8461('0x30')][_0x8461('0x2c')]()]=_0x2e90ec[_0x58c6b3[_0x8461('0x31')]][_0x8461('0x2d')]();}else if(_0x58c6b3[_0x8461('0x2f')]==='customVariable'&&_0x58c6b3[_0x8461('0x32')]&&_0x58c6b3['Variable']['name']&&_0x58c6b3[_0x8461('0x30')]&&_0x58c6b3['customField']){_0x4d6c98[_0x58c6b3[_0x8461('0x30')][_0x8461('0x2c')]()]=_0x2e90ec[_0x58c6b3[_0x8461('0x32')][_0x8461('0x33')][_0x8461('0x2c')]()][_0x8461('0x2d')]();}});}return _0x4d6c98;}function getTicket(_0x5bf855,_0x432412,_0x1317bc,_0x16f840,_0x51349d,_0x5853a7){return function(_0x11d8ef){logger[_0x8461('0x12')]('['+[_0x5bf855[_0x8461('0x13')]()]+_0x8461('0x34'),_0x11d8ef);return new Promise(function(_0x2cdf44,_0x421235){var _0x6adee=_0x5bf855[_0x8461('0x2c')]()==='outbound'?_0x11d8ef[_0x8461('0x1e')]:_0x11d8ef[_0x8461('0x22')];var _0x48b353={'method':_0x8461('0x35'),'uri':_0x1317bc+_0x8461('0x36')+'?'+_0x5853a7,'body':Object[_0x8461('0x37')]({},{'active':_0x8461('0x1d'),'caller_id':_0x6adee,'assigned_to':_0x11d8ef[_0x8461('0x1e')],'short_description':intUtil['getString'](_0x16f840['Subjects'],_0x51349d,'\x20'),'description':intUtil[_0x8461('0x38')](_0x16f840[_0x8461('0x39')],_0x51349d,'\x0a')},getCustomFields(_0x16f840['Fields'],_0x51349d)),'auth':_0x432412,'json':!![]};return rp(_0x48b353)[_0x8461('0xd')](function(_0x563ff0){logger['info']('['+[_0x5bf855[_0x8461('0x13')]()]+_0x8461('0x3a'),_0x563ff0[_0x8461('0x10')]);_0x11d8ef[_0x8461('0x3b')]=_0x563ff0[_0x8461('0x10')]['sys_id'];_0x11d8ef[_0x8461('0x3c')]=_0x563ff0['result'][_0x8461('0x3d')];logger[_0x8461('0x12')]('['+[_0x5bf855['toUpperCase']()]+_0x8461('0x3e'),_0x11d8ef);_0x2cdf44(_0x11d8ef);})[_0x8461('0x14')](function(_0x5f14bd){logger[_0x8461('0x15')]('['+[_0x5bf855['toUpperCase']()]+']',_0x5f14bd[_0x8461('0x16')]);_0x421235(_0x5f14bd['message']);});});};}function createRemoteTag(_0x47a1f0,_0x34f2e5,_0x1fd82b,_0x59e119){return new Promise(function(_0x3a5ff8,_0x15686f){var _0x15f776={'method':'POST','uri':_0x1fd82b+_0x8461('0x3f')+'?'+_0x59e119,'body':{'short_description':_0x47a1f0,'global':!![],'active':!![],'name':_0x47a1f0},'auth':_0x34f2e5,'json':!![]};return rp(_0x15f776)[_0x8461('0xd')](function(_0x297fd4){var _0x3bae53=_0x297fd4['result'][_0x8461('0x11')];_0x3a5ff8(_0x3bae53);});});}function getRemoteTag(_0x3e7df2,_0x35a559,_0x15e76b,_0x58d698,_0x44828d){return new Promise(function(_0x25765b,_0x271fe1){var _0x514b53={'method':_0x8461('0xb'),'uri':_0x15e76b+_0x8461('0x3f')+_0x8461('0x40')+_0x3e7df2+'&'+_0x58d698,'auth':_0x35a559,'json':!![]};return rp(_0x514b53)[_0x8461('0xd')](function(_0x36e283){if(_0x36e283['result']['length']>0x0){var _0x37bd09=_0x36e283['result'][0x0][_0x8461('0x11')];_0x25765b(_0x37bd09);}else{return createRemoteTag(_0x3e7df2,_0x35a559,_0x15e76b,_0x58d698)['then'](function(_0x580df4){_0x25765b(_0x580df4);});}});});}function assignTagToIncident(_0x23e5f5,_0x20ac14,_0x2f8d8e,_0x119aae,_0x5219ae){return new Promise(function(_0x280906,_0x4ca967){var _0x2f4709={'method':_0x8461('0x35'),'uri':_0x2f8d8e+_0x8461('0x41')+'?'+_0x5219ae,'body':{'label':_0x23e5f5,'table':_0x8461('0x36'),'id_type':_0x8461('0x42'),'table_key':_0x119aae[_0x8461('0x3b')],'title':_0x8461('0x43')+_0x119aae[_0x8461('0x3c')],'id_display':_0x119aae['ticketNumber']},'auth':_0x20ac14,'json':!![]};return rp(_0x2f4709)[_0x8461('0xd')](function(_0x29adaa){_0x280906();})[_0x8461('0x14')](function(){_0x280906();});});}function manageTags(_0x581452,_0x8ff3b1,_0x329612,_0x1e598e,_0x4c0bc1,_0x52f849,_0x4e927b){return new Promise(function(_0x1c617a,_0x45ccbc){var _0x5d9553=[];_0x8ff3b1[_0x8461('0x27')](function(_0x4f7dae){_0x5d9553[_0x8461('0x44')](getRemoteTag(_0x4f7dae,_0x329612,_0x1e598e,_0x52f849,_0x4e927b));});return Promise[_0x8461('0x45')](_0x5d9553)[_0x8461('0xd')](function(_0x351d9c){if(_0x351d9c[_0x8461('0xe')]){logger[_0x8461('0x12')]('['+[_0x581452[_0x8461('0x13')]()]+_0x8461('0x46'),_0x351d9c);var _0xbf8f1b=[];_0x351d9c[_0x8461('0x27')](function(_0x453b05){_0xbf8f1b[_0x8461('0x44')](assignTagToIncident(_0x453b05,_0x329612,_0x1e598e,_0x4c0bc1,_0x52f849));});return Promise['all'](_0xbf8f1b)[_0x8461('0xd')](function(){_0x1c617a();})[_0x8461('0x14')](function(){_0x1c617a();});}else{_0x1c617a();}});});}function getTags(_0x23e7c5,_0x10a1a3,_0x1ab513,_0x3853fb,_0x4bbec5,_0xa0c91e){return function(_0x3a74ca){return new Promise(function(_0x569cfa,_0x4289bf){var _0x34df21=[];var _0x149e7a=_0x3853fb[_0x8461('0x47')];if(_0x149e7a&&_0x149e7a[_0x8461('0xe')]>0x0){_0x34df21=_['map'](_0x149e7a,'name');}if(_0x34df21[_0x8461('0xe')]>0x0){return manageTags(_0x23e7c5,_0x34df21,_0x10a1a3,_0x1ab513,_0x3a74ca,_0x4bbec5,_0xa0c91e)[_0x8461('0xd')](function(){_0x569cfa(_0x3a74ca);});}else{_0x569cfa(_0x3a74ca);}});};}function emit(_0x24db36,_0x5ef388,_0x18d095){var _0x48f693='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x8461('0x48');var _0x2e360c={'uri':_0x24db36+_0x8461('0x49')+_0x18d095+_0x48f693};io['to'](util[_0x8461('0x4a')](_0x8461('0x4b'),_0x5ef388))[_0x8461('0x4c')]('trigger:browser:url',_0x2e360c);}exports['cs']=function(_0x240d63,_0x46e981,_0x4e2e9c,_0x1ed87c,_0x3c5955,_0x38a73d,_0x5bb0a2,_0x1a599a){var _0x4a9b40={};var _0x43af08={'user':_0x38a73d[_0x8461('0x4d')],'pass':_0x38a73d[_0x8461('0x4e')]};var _0x3664e7=_0x8461('0x4f');var _0x48cb85='sysparm_display_value=true';_0x38a73d[_0x8461('0x50')]=intUtil[_0x8461('0x51')](_0x38a73d[_0x8461('0x50')]);_0x38a73d[_0x8461('0x52')]=intUtil['stripTrailingSlash'](_0x38a73d[_0x8461('0x52')]);var _0x32bf80=util[_0x8461('0x4a')](_0x8461('0x53'),_0x38a73d[_0x8461('0x50')]);_0x4a9b40[_0x8461('0x18')]=!_[_0x8461('0x54')](_0x1ed87c)?_0x1ed87c[_0x8461('0x55')]:null;_0x4a9b40[_0x8461('0x1f')]=_0x38a73d['email'];_0x4a9b40[_0x8461('0x21')]=_0x1a599a[_0x8461('0x2c')]()===_0x8461('0x56')?_0x46e981[_0x8461('0x57')]:_0x46e981['calleridnum'];_0x4a9b40[_0x8461('0x58')]=_0x1a599a==='queue'||_0x1a599a===_0x8461('0x59')?_0x8461('0x5a'):'outbound';var _0x56f7a2=util['format'](_0x8461('0x5b'),_0x38a73d['serverUrl'],_0x46e981[_0x8461('0x5c')],md5(_0x46e981[_0x8461('0x5c')]));if(_0x3c5955&&_0x3c5955['monitor_format']){logger[_0x8461('0x12')](_0x8461('0x5d'),_0x8461('0x5e'));_0x46e981[_0x8461('0x5f')]=_0x56f7a2;}else if(_0x5bb0a2&&_0x5bb0a2[_0x8461('0x60')]&&_0x5bb0a2[_0x8461('0x60')]!==_0x8461('0x61')){logger['info'](_0x8461('0x62'),'Recording\x20is\x20enabled!');_0x46e981[_0x8461('0x5f')]=_0x56f7a2;}else{_0x46e981['recordingURL']='';}return getAdminUser(_0x1a599a,_0x43af08,_0x4a9b40,_0x32bf80,_0x48cb85,_0x3664e7)['then'](getUser(_0x1a599a,_0x43af08,_0x32bf80,_0x48cb85,_0x3664e7))[_0x8461('0xd')](getEndUser(_0x1a599a,_0x43af08,_0x32bf80,_0x48cb85,_0x3664e7))[_0x8461('0xd')](getTicket(_0x1a599a,_0x43af08,_0x32bf80,_0x4e2e9c,_0x46e981,_0x48cb85))['then'](function(_0x341d99){logger[_0x8461('0x12')](util[_0x8461('0x4a')](_0x8461('0x63'),_0x341d99['ticketId']));logger[_0x8461('0x12')](util[_0x8461('0x4a')](_0x8461('0x64'),_0x1a599a));if(_0x1a599a!==_0x8461('0x59')){logger[_0x8461('0x12')]('['+[_0x1a599a['toUpperCase']()]+']',_0x8461('0x65'));emit(_0x38a73d[_0x8461('0x50')],_0x1ed87c[_0x8461('0x33')],_0x341d99['ticketId']);}})[_0x8461('0x14')](function(_0x38e0e4){logger[_0x8461('0x15')]('['+[_0x1a599a[_0x8461('0x13')]()]+_0x8461('0x66'),util['inspect'](_0x38e0e4,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index b677b47..cc5c9bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8de=['name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','type','nameField','toLowerCase','content','string','idField','custom_fields','variable','customVariable','Variable','customField','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','error','uri','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','info'];(function(_0x36cc1c,_0x2360c1){var _0x5c8930=function(_0x44d1c8){while(--_0x44d1c8){_0x36cc1c['push'](_0x36cc1c['shift']());}};_0x5c8930(++_0x2360c1);}(_0xa8de,0x1c9));var _0xea8d=function(_0x438bf5,_0x2312e4){_0x438bf5=_0x438bf5-0x0;var _0x16ce81=_0xa8de[_0x438bf5];return _0x16ce81;};'use strict';var _=require('lodash');var rp=require(_0xea8d('0x0'));var BPromise=require(_0xea8d('0x1'));var md5=require('md5');var util=require(_0xea8d('0x2'));var Redis=require(_0xea8d('0x3'));var intUtil=require(_0xea8d('0x4'));var config=require(_0xea8d('0x5'));var logger=require('../../../../config/logger')(_0xea8d('0x6'));config[_0xea8d('0x7')]=_[_0xea8d('0x8')](config[_0xea8d('0x7')],{'host':_0xea8d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea8d('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x5d1a13,_0x1cafe5,_0x412315){io['to'](_0x5d1a13)['emit'](_0x1cafe5,_0x412315);}function getTicket(_0x2ec134,_0x532a13,_0x860334,_0xc4a7a5,_0x1232b8,_0x2407b1,_0x102793,_0x15b3bb){logger[_0xea8d('0xa')]('Creating\x20new\x20ticket...');var _0x22893f=new Date();var _0xf3369c=[{'name':_0xea8d('0xb'),'value':intUtil[_0xea8d('0xc')](_0xc4a7a5['Subjects'],_0x1232b8,'\x20')},{'name':_0xea8d('0xd'),'value':_0x532a13['id']},{'name':_0xea8d('0xe'),'value':_0x532a13['id']},{'name':_0xea8d('0xf'),'value':intUtil['getString'](_0xc4a7a5[_0xea8d('0x10')],_0x1232b8,'\x0a')},{'name':_0xea8d('0x11'),'value':_0x22893f[_0xea8d('0x12')]()['slice'](0x0,0x13)[_0xea8d('0x13')]('T','\x20')},{'name':_0xea8d('0x14'),'value':'0'},{'name':_0xea8d('0x15'),'value':'15'},{'name':'parent_id','value':_0x860334['id']},{'name':_0xea8d('0x16'),'value':_0xea8d('0x17')},{'name':_0xea8d('0x18'),'value':_0x860334[_0xea8d('0xb')]},{'name':_0xea8d('0x19'),'value':_0x15b3bb}];if(_0x2407b1['length']){_[_0xea8d('0x1a')](_0x2407b1,function(_0x8c3656){if(_0x1232b8[_0x8c3656[_0xea8d('0x1b')]]){_0xf3369c[_0xea8d('0x1c')]({'name':_0x8c3656['idField'],'value':_0x1232b8[_0x8c3656[_0xea8d('0x1b')]]});}});}return request({'form':{'method':_0xea8d('0x1d'),'input_type':_0xea8d('0x1e'),'response_type':_0xea8d('0x1e'),'rest_data':JSON[_0xea8d('0x1f')]({'session':_0x102793['id'],'module_name':_0xea8d('0x20'),'name_value_list':_0xf3369c})}});}function getAuth(_0x5ddc08){return util[_0xea8d('0x21')](_0xea8d('0x22'),new Buffer(_0x5ddc08[_0xea8d('0x23')]+':X')[_0xea8d('0x24')]('base64'));}function getServerInfo(_0x1f9090){return request({'form':{'method':_0xea8d('0x25'),'input_type':_0xea8d('0x1e'),'response_type':_0xea8d('0x1e'),'rest_data':JSON[_0xea8d('0x1f')]({'session':_0x1f9090['id']})}});}function getUser(_0x32a728,_0x183062,_0x5ea639){if(!_['isNil'](_0x183062)){logger[_0xea8d('0xa')](_0xea8d('0x26'),_0x183062);return request({'form':{'method':'get_entry_list','input_type':_0xea8d('0x1e'),'response_type':_0xea8d('0x1e'),'rest_data':JSON[_0xea8d('0x1f')]({'session':_0x5ea639['id'],'module_name':'Employees','query':util[_0xea8d('0x21')](_0xea8d('0x27'),_0x183062),'order_by':'','offset':'0','select_fields':['id',_0xea8d('0xb'),_0xea8d('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x18edf){if(_0x18edf[_0xea8d('0x29')][_0xea8d('0x2a')]){var _0x32255e=_[_0xea8d('0x2b')](_0x18edf[_0xea8d('0x29')],function(_0x3d4f05){return _0x3d4f05[_0xea8d('0x2c')][_0xea8d('0x28')]['value']===_0x183062;});if(_0x32255e){logger[_0xea8d('0xa')]('Agent\x20found!');return BPromise[_0xea8d('0x2d')]({'id':_0x32255e[_0xea8d('0x2c')]['id']['value'],'name':_0x32255e[_0xea8d('0x2c')][_0xea8d('0xb')][_0xea8d('0x2e')]});}}logger[_0xea8d('0xa')](_0xea8d('0x2f'));return BPromise[_0xea8d('0x2d')]({'id':_0x5ea639[_0xea8d('0x2c')][_0xea8d('0x30')][_0xea8d('0x2e')],'name':_0x5ea639[_0xea8d('0x2c')][_0xea8d('0x28')][_0xea8d('0x2e')]});});}else{logger[_0xea8d('0xa')](_0xea8d('0x31'));return BPromise[_0xea8d('0x2d')]({'id':_0x5ea639[_0xea8d('0x2c')][_0xea8d('0x30')][_0xea8d('0x2e')],'name':_0x5ea639['name_value_list']['user_name'][_0xea8d('0x2e')]});}}function getEndUser(_0x4aa79c,_0x141f84,_0xffbe39,_0x52cdd8){logger[_0xea8d('0xa')](_0xea8d('0x32'),_0xffbe39);return request({'form':{'method':'get_entry_list','input_type':_0xea8d('0x1e'),'response_type':_0xea8d('0x1e'),'rest_data':JSON[_0xea8d('0x1f')]({'session':_0x52cdd8['id'],'module_name':_0xea8d('0x17'),'query':util[_0xea8d('0x21')]('contacts.phone_home\x20=\x20\x22%s\x22',_0xffbe39),'order_by':'','offset':'0','select_fields':['id','name',_0xea8d('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea8d('0x34')](function(_0x18cc84){if(_0x18cc84[_0xea8d('0x29')][_0xea8d('0x2a')]){var _0x2a66be=_['find'](_0x18cc84[_0xea8d('0x29')],function(_0x456b5d){return _0x456b5d[_0xea8d('0x2c')][_0xea8d('0x33')][_0xea8d('0x2e')]===_0xffbe39;});if(_0x2a66be){logger['info'](_0xea8d('0x35'));return BPromise[_0xea8d('0x2d')]({'id':_0x2a66be[_0xea8d('0x2c')]['id'][_0xea8d('0x2e')],'name':_0x2a66be[_0xea8d('0x2c')]['name'][_0xea8d('0x2e')],'phone':_0x2a66be[_0xea8d('0x2c')]['phone_home']['value']});}}else{logger[_0xea8d('0xa')](_0xea8d('0x36'));return request({'form':{'method':_0xea8d('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x52cdd8['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x141f84!==_0xea8d('0x37')?_0x141f84:util['format'](_0xea8d('0x38'),_0xffbe39)},{'name':_0xea8d('0x33'),'value':_0xffbe39}]})}})['then'](function(_0x5796f1){logger[_0xea8d('0xa')](_0xea8d('0x39'));return BPromise['resolve']({'id':_0x5796f1['id'],'name':_0x5796f1[_0xea8d('0x29')]['first_name'][_0xea8d('0x2e')],'phone':_0x5796f1[_0xea8d('0x29')][_0xea8d('0x33')][_0xea8d('0x2e')]});});}});}function request(_0x1f64ee){logger['debug'](_0xea8d('0x3a'),JSON['stringify'](_0x1f64ee));return rp(_[_0xea8d('0x3b')](def,_0x1f64ee));}function getTags(_0x51b824,_0x228e44){var _0x51ffbf=[];if(_0x51b824&&_0x51b824[_0xea8d('0x2a')]>0x0){_0x51ffbf=_['map'](_0x51b824,_0x228e44);}return _0x51ffbf;}function getCustomFields(_0x47ae04,_0x875332){var _0x42834e=[];var _0x403860={'custom_fields':[]};if(_0x47ae04[_0xea8d('0x2a')]>0x0){_[_0xea8d('0x1a')](_0x47ae04,function(_0x34dd19){if(_0x34dd19[_0xea8d('0x3c')]==='string'&&_0x34dd19[_0xea8d('0x3d')]&&!_0x34dd19['customField']){_0x403860[_0x34dd19[_0xea8d('0x3d')][_0xea8d('0x3e')]()]=_0x34dd19[_0xea8d('0x3f')][_0xea8d('0x24')]();}else if(_0x34dd19[_0xea8d('0x3c')]===_0xea8d('0x40')&&_0x34dd19[_0xea8d('0x41')]&&_0x34dd19['customField']){_0x403860[_0xea8d('0x42')][_0xea8d('0x1c')]({'id':_0x34dd19[_0xea8d('0x41')],'value':_0x34dd19['content']['toString']()});}else if(_0x34dd19[_0xea8d('0x3c')]===_0xea8d('0x43')&&_0x34dd19[_0xea8d('0x1b')]&&_0x34dd19[_0xea8d('0x41')]&&_0x34dd19['customField']){_0x875332[_0x34dd19['variableName']]&&_0x403860[_0xea8d('0x42')][_0xea8d('0x1c')]({'id':_0x34dd19[_0xea8d('0x41')],'value':_0x875332[_0x34dd19[_0xea8d('0x1b')]][_0xea8d('0x24')]()});}else if(_0x34dd19['type']===_0xea8d('0x44')&&_0x34dd19[_0xea8d('0x45')]&&_0x34dd19[_0xea8d('0x45')][_0xea8d('0xb')]&&_0x34dd19[_0xea8d('0x41')]&&_0x34dd19[_0xea8d('0x46')]){_0x875332[_0x34dd19[_0xea8d('0x45')][_0xea8d('0xb')]['toLowerCase']()]&&_0x403860[_0xea8d('0x42')][_0xea8d('0x1c')]({'id':_0x34dd19[_0xea8d('0x41')],'value':_0x875332[_0x34dd19[_0xea8d('0x45')][_0xea8d('0xb')][_0xea8d('0x3e')]()]['toString']()});}});}return _0x403860;}function getConnection(_0x3ec162){return request({'method':_0xea8d('0x47'),'form':{'method':_0xea8d('0x48'),'input_type':_0xea8d('0x1e'),'response_type':'JSON','rest_data':JSON[_0xea8d('0x1f')]({'user_auth':{'user_name':_0x3ec162[_0xea8d('0x49')],'password':_0x3ec162[_0xea8d('0x4a')],'encryption':'PLAIN'},'application':_0xea8d('0x4b')})}})['then'](function(_0x8d9726){var _0x44ba35=_0x8d9726;if(_0x44ba35['id']){def[_0xea8d('0x4c')]=_0x44ba35['id'];return BPromise[_0xea8d('0x2d')](_0x44ba35);}else{throw new Error(util[_0xea8d('0x21')](_0xea8d('0x4d'),_0x3ec162['id']));}});}function setRelationship(_0x44aaec,_0x1d7855,_0x13de34,_0x2c829a){return request({'form':{'method':_0xea8d('0x4e'),'input_type':_0xea8d('0x1e'),'response_type':_0xea8d('0x1e'),'rest_data':JSON[_0xea8d('0x1f')]({'session':_0x44aaec['id'],'module_name':_0xea8d('0x20'),'module_id':_0x13de34['id'],'link_field_name':_0x2c829a,'related_ids':[_0x1d7855['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xea8d('0x4f')]=function(_0xf8c44a,_0x51f755,_0x3533c1,_0x23e3c1,_0x4df5ab,_0x24aac4){var _0x85de51,_0x443c53,_0x1a0a46,_0x3abef6;_0x24aac4['remoteUri']=intUtil[_0xea8d('0x50')](_0x24aac4[_0xea8d('0x51')]);_0x24aac4[_0xea8d('0x52')]=intUtil[_0xea8d('0x50')](_0x24aac4[_0xea8d('0x52')]);def['uri']=util[_0xea8d('0x21')](_0xea8d('0x53'),_0x24aac4[_0xea8d('0x51')]);if(_0x4df5ab&&_0x4df5ab[_0xea8d('0x54')]){logger[_0xea8d('0xa')](_0xea8d('0x55'),_0xea8d('0x56'));_0x51f755[_0xea8d('0x57')]=util[_0xea8d('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24aac4['serverUrl'],_0x51f755[_0xea8d('0x58')],md5(_0x51f755['uniqueid']));}else{_0x51f755[_0xea8d('0x57')]='';}return getConnection(_0x24aac4)[_0xea8d('0x34')](function(_0x40e72e){_0x3abef6=_0x40e72e;return getUser(_0x24aac4,_0x23e3c1[_0xea8d('0xb')],_0x3abef6);})[_0xea8d('0x34')](function(_0xd680cb){_0x85de51=_0xd680cb;logger[_0xea8d('0xa')](_0xea8d('0x59'),_0x85de51['id']);return getEndUser(_0x24aac4,_0x51f755[_0xea8d('0x5a')],_0x51f755[_0xea8d('0x5b')],_0x3abef6);})[_0xea8d('0x34')](function(_0x501598){_0x443c53=_0x501598;logger['info']('The\x20Enduser\x20ID\x20is:',_0x443c53['id']);return getTicket(_0x24aac4,_0x85de51,_0x443c53,_0x3533c1,_0x51f755,_0x3533c1[_0xea8d('0x5c')],_0x3abef6,_0xea8d('0x5d'));})[_0xea8d('0x34')](function(_0x283b50){_0x1a0a46=_0x283b50;logger['info']('Ticket\x20created!');logger['info'](_0xea8d('0x5e'),_0x1a0a46['id']);return setRelationship(_0x3abef6,_0x85de51,_0x1a0a46,_0xea8d('0x5f'));})['then'](function(){return setRelationship(_0x3abef6,_0x443c53,_0x1a0a46,_0xea8d('0x60'));})[_0xea8d('0x34')](function(){return getServerInfo(_0x3abef6);})[_0xea8d('0x34')](function(_0x5df4fa){var _0x3f60df=parseInt(_0x5df4fa[_0xea8d('0x61')][_0xea8d('0x62')](0x0));var _0x1e5a94=util[_0xea8d('0x21')](_0xea8d('0x63'),_0x24aac4['remoteUri'],_0x1a0a46['id']);if(_0x3f60df>0x6){_0x1e5a94=util['format'](_0xea8d('0x64'),_0x24aac4[_0xea8d('0x51')],_0x1a0a46['id']);}logger[_0xea8d('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea8d('0x21')](_0xea8d('0x65'),_0x23e3c1['name']),'trigger:browser:url',{'uri':_0x1e5a94});})['catch'](function(_0x2446d2){logger[_0xea8d('0x66')](_0xea8d('0x55'),JSON[_0xea8d('0x1f')](_0x2446d2));});};exports['outbound']=function(_0x54b5c0,_0x45a424,_0x4a0a9d,_0x11fdd7,_0x5b337b,_0x502311,_0x55d85e){var _0x23511b,_0x44664d,_0x1147b8,_0x80608e;_0x502311[_0xea8d('0x51')]=intUtil[_0xea8d('0x50')](_0x502311['remoteUri']);_0x502311[_0xea8d('0x52')]=intUtil[_0xea8d('0x50')](_0x502311[_0xea8d('0x52')]);def[_0xea8d('0x67')]=util[_0xea8d('0x21')](_0xea8d('0x53'),_0x502311['remoteUri']);if(_0x55d85e&&_0x55d85e[_0xea8d('0x68')]&&_0x55d85e[_0xea8d('0x68')]!==_0xea8d('0x69')){logger[_0xea8d('0xa')](_0xea8d('0x6a'),_0xea8d('0x56'));_0x45a424[_0xea8d('0x57')]=util[_0xea8d('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x502311['serverUrl'],_0x45a424[_0xea8d('0x58')],md5(_0x45a424[_0xea8d('0x58')]));}return getConnection(_0x502311)[_0xea8d('0x34')](function(_0x3c39b4){_0x80608e=_0x3c39b4;return getUser(_0x502311,_0x11fdd7['name'],_0x80608e);})[_0xea8d('0x34')](function(_0x32b877){_0x23511b=_0x32b877;logger['info'](_0xea8d('0x59'),_0x23511b['id']);return getEndUser(_0x502311,_0x45a424['destcalleridname'],_0x45a424['destcalleridnum'],_0x80608e);})['then'](function(_0x2127cb){_0x44664d=_0x2127cb;logger[_0xea8d('0xa')](_0xea8d('0x6b'),_0x44664d['id']);return getTicket(_0x502311,_0x23511b,_0x44664d,_0x4a0a9d,_0x45a424,_0x4a0a9d[_0xea8d('0x5c')],_0x80608e,_0xea8d('0x6c'));})[_0xea8d('0x34')](function(_0x5e9cb6){_0x1147b8=_0x5e9cb6;logger[_0xea8d('0xa')](_0xea8d('0x6d'));logger[_0xea8d('0xa')](_0xea8d('0x5e'),_0x1147b8['id']);return setRelationship(_0x80608e,_0x23511b,_0x1147b8,_0xea8d('0x5f'));})['then'](function(){return setRelationship(_0x80608e,_0x44664d,_0x1147b8,'contacts');})['then'](function(){return getServerInfo(_0x80608e);})[_0xea8d('0x34')](function(_0x536ee6){var _0xf9f051=parseInt(_0x536ee6[_0xea8d('0x61')]['charAt'](0x0));var _0x912e99=util['format'](_0xea8d('0x63'),_0x502311[_0xea8d('0x51')],_0x1147b8['id']);if(_0xf9f051>0x6){_0x912e99=util[_0xea8d('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x502311['remoteUri'],_0x1147b8['id']);}logger[_0xea8d('0xa')](_0xea8d('0x6a'),_0xea8d('0x6e'));emit(util['format'](_0xea8d('0x65'),_0x11fdd7[_0xea8d('0xb')]),_0xea8d('0x6f'),{'uri':_0x912e99});})[_0xea8d('0x70')](function(_0x3f1123){logger[_0xea8d('0x66')]('[OUTBOUND]',JSON[_0xea8d('0x1f')](_0x3f1123));});};exports[_0xea8d('0x71')]=function(_0x10cbba,_0x1633df,_0x398103,_0x1428bc,_0x577126,_0x2e435c){var _0x5f0422,_0x56a3fa,_0x8330d3,_0x108f27;_0x2e435c[_0xea8d('0x51')]=intUtil[_0xea8d('0x50')](_0x2e435c[_0xea8d('0x51')]);_0x2e435c[_0xea8d('0x52')]=intUtil[_0xea8d('0x50')](_0x2e435c[_0xea8d('0x52')]);def[_0xea8d('0x67')]=util[_0xea8d('0x21')](_0xea8d('0x53'),_0x2e435c[_0xea8d('0x51')]);if(_0x577126&&_0x577126[_0xea8d('0x54')]){logger[_0xea8d('0xa')]('['+_0x1633df[_0xea8d('0x72')][_0xea8d('0x73')]()+']',_0xea8d('0x56'));_0x1633df[_0xea8d('0x57')]=util[_0xea8d('0x21')](_0xea8d('0x74'),_0x2e435c[_0xea8d('0x52')],_0x1633df[_0xea8d('0x58')],md5(_0x1633df['uniqueid']));}else{_0x1633df['recordingURL']='';}return getConnection(_0x2e435c)[_0xea8d('0x34')](function(_0x4e377a){_0x108f27=_0x4e377a;if(!_['isNil'](_0x1428bc)){return getUser(_0x2e435c,_0x1428bc[_0xea8d('0xb')],_0x108f27);}else{return getUser(_0x2e435c,null,_0x108f27);}})[_0xea8d('0x34')](function(_0x3f7337){_0x5f0422=_0x3f7337;logger[_0xea8d('0xa')](_0xea8d('0x59'),_0x5f0422['id']);return getEndUser(_0x2e435c,_0x1633df[_0xea8d('0x5a')],_0x1633df[_0xea8d('0x5b')],_0x108f27);})[_0xea8d('0x34')](function(_0x1d5f87){_0x56a3fa=_0x1d5f87;logger[_0xea8d('0xa')](_0xea8d('0x6b'),_0x56a3fa['id']);return getTicket(_0x2e435c,_0x5f0422,_0x56a3fa,_0x398103,_0x1633df,_0x398103[_0xea8d('0x5c')],_0x108f27,_0xea8d('0x5d'));})[_0xea8d('0x34')](function(_0x2d675d){_0x8330d3=_0x2d675d;logger[_0xea8d('0xa')](_0xea8d('0x6d'));logger[_0xea8d('0xa')]('The\x20Ticket\x20ID\x20is:',_0x8330d3['id']);return setRelationship(_0x108f27,_0x5f0422,_0x8330d3,'users');})[_0xea8d('0x34')](function(){return setRelationship(_0x108f27,_0x56a3fa,_0x8330d3,_0xea8d('0x60'));})[_0xea8d('0x34')](function(){return getServerInfo(_0x108f27);})[_0xea8d('0x70')](function(_0x4be066){logger[_0xea8d('0x66')]('['+_0x1633df[_0xea8d('0x72')]['toUpperCase']()+']',JSON[_0xea8d('0x1f')](_0x4be066));});};
\ No newline at end of file
+var _0x1c55=['error','lastevent','toUpperCase','recordingURL','calleridnum','lodash','request-promise','bluebird','util','ioredis','../../../../config/environment','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','description','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_name','name','direction','forEach','push','idField','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','Employees','user_name','then','length','entry_list','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','phone_home','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','map','string','nameField','customField','toLowerCase','type','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/service/v4_1/rest.php','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','catch'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x1c55,0x1c5));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x51c5('0x0'));var rp=require(_0x51c5('0x1'));var BPromise=require(_0x51c5('0x2'));var md5=require('md5');var util=require(_0x51c5('0x3'));var Redis=require(_0x51c5('0x4'));var intUtil=require('./util');var config=require(_0x51c5('0x5'));var logger=require('../../../../config/logger')(_0x51c5('0x6'));config[_0x51c5('0x7')]=_[_0x51c5('0x8')](config['redis'],{'host':_0x51c5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x51c5('0x7')]));var def={'method':_0x51c5('0xa'),'json':!![]};function emit(_0x5606cc,_0x26a231,_0x2cb9c5){io['to'](_0x5606cc)[_0x51c5('0xb')](_0x26a231,_0x2cb9c5);}function getTicket(_0x50bc1f,_0x5a6fc6,_0x420c11,_0x275691,_0x7d236f,_0x3e6f3a,_0x379b9e,_0x55e7ff){logger[_0x51c5('0xc')](_0x51c5('0xd'));var _0x52a5bd=new Date();var _0xdab641=[{'name':'name','value':intUtil[_0x51c5('0xe')](_0x275691['Subjects'],_0x7d236f,'\x20')},{'name':'assigned_user_id','value':_0x5a6fc6['id']},{'name':'created_by','value':_0x5a6fc6['id']},{'name':_0x51c5('0xf'),'value':intUtil[_0x51c5('0xe')](_0x275691['Descriptions'],_0x7d236f,'\x0a')},{'name':_0x51c5('0x10'),'value':_0x52a5bd[_0x51c5('0x11')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x51c5('0x12'),'value':'0'},{'name':_0x51c5('0x13'),'value':'15'},{'name':_0x51c5('0x14'),'value':_0x420c11['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x51c5('0x15'),'value':_0x420c11[_0x51c5('0x16')]},{'name':_0x51c5('0x17'),'value':_0x55e7ff}];if(_0x3e6f3a['length']){_[_0x51c5('0x18')](_0x3e6f3a,function(_0x1e0cec){if(_0x7d236f[_0x1e0cec['variableName']]){_0xdab641[_0x51c5('0x19')]({'name':_0x1e0cec[_0x51c5('0x1a')],'value':_0x7d236f[_0x1e0cec[_0x51c5('0x1b')]]});}});}return request({'form':{'method':_0x51c5('0x1c'),'input_type':_0x51c5('0x1d'),'response_type':_0x51c5('0x1d'),'rest_data':JSON['stringify']({'session':_0x379b9e['id'],'module_name':_0x51c5('0x1e'),'name_value_list':_0xdab641})}});}function getAuth(_0x4c66c0){return util[_0x51c5('0x1f')](_0x51c5('0x20'),new Buffer(_0x4c66c0[_0x51c5('0x21')]+':X')[_0x51c5('0x22')]('base64'));}function getServerInfo(_0x4e1c1c){return request({'form':{'method':_0x51c5('0x23'),'input_type':_0x51c5('0x1d'),'response_type':'JSON','rest_data':JSON[_0x51c5('0x24')]({'session':_0x4e1c1c['id']})}});}function getUser(_0x366d69,_0x1fef13,_0x79fa7){if(!_[_0x51c5('0x25')](_0x1fef13)){logger[_0x51c5('0xc')]('Getting\x20agent\x20with\x20name',_0x1fef13);return request({'form':{'method':'get_entry_list','input_type':_0x51c5('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x79fa7['id'],'module_name':_0x51c5('0x26'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1fef13),'order_by':'','offset':'0','select_fields':['id','name',_0x51c5('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x51c5('0x28')](function(_0x59f8d7){if(_0x59f8d7['entry_list'][_0x51c5('0x29')]){var _0x4d3e2d=_['find'](_0x59f8d7[_0x51c5('0x2a')],function(_0x4d33f1){return _0x4d33f1[_0x51c5('0x2b')][_0x51c5('0x27')]['value']===_0x1fef13;});if(_0x4d3e2d){logger[_0x51c5('0xc')](_0x51c5('0x2c'));return BPromise[_0x51c5('0x2d')]({'id':_0x4d3e2d[_0x51c5('0x2b')]['id'][_0x51c5('0x2e')],'name':_0x4d3e2d['name_value_list'][_0x51c5('0x16')]['value']});}}logger['info'](_0x51c5('0x2f'));return BPromise[_0x51c5('0x2d')]({'id':_0x79fa7[_0x51c5('0x2b')][_0x51c5('0x30')][_0x51c5('0x2e')],'name':_0x79fa7['name_value_list'][_0x51c5('0x27')][_0x51c5('0x2e')]});});}else{logger[_0x51c5('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x51c5('0x2d')]({'id':_0x79fa7['name_value_list'][_0x51c5('0x30')][_0x51c5('0x2e')],'name':_0x79fa7[_0x51c5('0x2b')][_0x51c5('0x27')]['value']});}}function getEndUser(_0x47446c,_0x29bcda,_0x13d83d,_0x32f28a){logger[_0x51c5('0xc')](_0x51c5('0x31'),_0x13d83d);return request({'form':{'method':_0x51c5('0x32'),'input_type':_0x51c5('0x1d'),'response_type':'JSON','rest_data':JSON[_0x51c5('0x24')]({'session':_0x32f28a['id'],'module_name':_0x51c5('0x33'),'query':util[_0x51c5('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x13d83d),'order_by':'','offset':'0','select_fields':['id',_0x51c5('0x16'),_0x51c5('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x51c5('0x28')](function(_0xfdab46){if(_0xfdab46[_0x51c5('0x2a')]['length']){var _0x1dbbf5=_['find'](_0xfdab46['entry_list'],function(_0x326471){return _0x326471[_0x51c5('0x2b')][_0x51c5('0x34')][_0x51c5('0x2e')]===_0x13d83d;});if(_0x1dbbf5){logger[_0x51c5('0xc')](_0x51c5('0x35'));return BPromise['resolve']({'id':_0x1dbbf5[_0x51c5('0x2b')]['id']['value'],'name':_0x1dbbf5[_0x51c5('0x2b')][_0x51c5('0x16')][_0x51c5('0x2e')],'phone':_0x1dbbf5[_0x51c5('0x2b')][_0x51c5('0x34')]['value']});}}else{logger[_0x51c5('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x51c5('0x1d'),'response_type':_0x51c5('0x1d'),'rest_data':JSON[_0x51c5('0x24')]({'session':_0x32f28a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x51c5('0x36'),'value':_0x29bcda!==_0x51c5('0x37')?_0x29bcda:util[_0x51c5('0x1f')](_0x51c5('0x38'),_0x13d83d)},{'name':_0x51c5('0x34'),'value':_0x13d83d}]})}})[_0x51c5('0x28')](function(_0xdfe06b){logger[_0x51c5('0xc')](_0x51c5('0x39'));return BPromise[_0x51c5('0x2d')]({'id':_0xdfe06b['id'],'name':_0xdfe06b[_0x51c5('0x2a')][_0x51c5('0x36')][_0x51c5('0x2e')],'phone':_0xdfe06b[_0x51c5('0x2a')][_0x51c5('0x34')][_0x51c5('0x2e')]});});}});}function request(_0x3d93ba){logger['debug']('[HTTP]',JSON['stringify'](_0x3d93ba));return rp(_['merge'](def,_0x3d93ba));}function getTags(_0x3d24ef,_0x402cd3){var _0x5f407b=[];if(_0x3d24ef&&_0x3d24ef[_0x51c5('0x29')]>0x0){_0x5f407b=_[_0x51c5('0x3a')](_0x3d24ef,_0x402cd3);}return _0x5f407b;}function getCustomFields(_0x378149,_0x36c0c4){var _0x1ca9d5=[];var _0x52a198={'custom_fields':[]};if(_0x378149['length']>0x0){_['forEach'](_0x378149,function(_0xf3b5cc){if(_0xf3b5cc['type']===_0x51c5('0x3b')&&_0xf3b5cc[_0x51c5('0x3c')]&&!_0xf3b5cc[_0x51c5('0x3d')]){_0x52a198[_0xf3b5cc[_0x51c5('0x3c')][_0x51c5('0x3e')]()]=_0xf3b5cc['content'][_0x51c5('0x22')]();}else if(_0xf3b5cc[_0x51c5('0x3f')]===_0x51c5('0x3b')&&_0xf3b5cc[_0x51c5('0x1a')]&&_0xf3b5cc[_0x51c5('0x3d')]){_0x52a198[_0x51c5('0x40')]['push']({'id':_0xf3b5cc[_0x51c5('0x1a')],'value':_0xf3b5cc['content']['toString']()});}else if(_0xf3b5cc[_0x51c5('0x3f')]===_0x51c5('0x41')&&_0xf3b5cc[_0x51c5('0x1b')]&&_0xf3b5cc['idField']&&_0xf3b5cc['customField']){_0x36c0c4[_0xf3b5cc[_0x51c5('0x1b')]]&&_0x52a198[_0x51c5('0x40')]['push']({'id':_0xf3b5cc[_0x51c5('0x1a')],'value':_0x36c0c4[_0xf3b5cc[_0x51c5('0x1b')]][_0x51c5('0x22')]()});}else if(_0xf3b5cc[_0x51c5('0x3f')]==='customVariable'&&_0xf3b5cc[_0x51c5('0x42')]&&_0xf3b5cc[_0x51c5('0x42')][_0x51c5('0x16')]&&_0xf3b5cc[_0x51c5('0x1a')]&&_0xf3b5cc[_0x51c5('0x3d')]){_0x36c0c4[_0xf3b5cc[_0x51c5('0x42')][_0x51c5('0x16')][_0x51c5('0x3e')]()]&&_0x52a198[_0x51c5('0x40')]['push']({'id':_0xf3b5cc[_0x51c5('0x1a')],'value':_0x36c0c4[_0xf3b5cc[_0x51c5('0x42')][_0x51c5('0x16')][_0x51c5('0x3e')]()]['toString']()});}});}return _0x52a198;}function getConnection(_0x254650){return request({'method':'POST','form':{'method':_0x51c5('0x43'),'input_type':'JSON','response_type':_0x51c5('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x254650[_0x51c5('0x44')],'password':_0x254650[_0x51c5('0x45')],'encryption':_0x51c5('0x46')},'application':_0x51c5('0x47')})}})[_0x51c5('0x28')](function(_0x2d4f52){var _0xeecbee=_0x2d4f52;if(_0xeecbee['id']){def[_0x51c5('0x48')]=_0xeecbee['id'];return BPromise[_0x51c5('0x2d')](_0xeecbee);}else{throw new Error(util[_0x51c5('0x1f')](_0x51c5('0x49'),_0x254650['id']));}});}function setRelationship(_0x454de8,_0x5356f4,_0x4d43b0,_0x47f0d4){return request({'form':{'method':'set_relationship','input_type':_0x51c5('0x1d'),'response_type':_0x51c5('0x1d'),'rest_data':JSON['stringify']({'session':_0x454de8['id'],'module_name':_0x51c5('0x1e'),'module_id':_0x4d43b0['id'],'link_field_name':_0x47f0d4,'related_ids':[_0x5356f4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x51c5('0x4a')]=function(_0x47b23a,_0x1ede94,_0x246127,_0x3ba39b,_0x50d446,_0x231cb2){var _0x11b56e,_0x255e3a,_0x905c0b,_0x513eaa;_0x231cb2[_0x51c5('0x4b')]=intUtil[_0x51c5('0x4c')](_0x231cb2[_0x51c5('0x4b')]);_0x231cb2[_0x51c5('0x4d')]=intUtil[_0x51c5('0x4c')](_0x231cb2[_0x51c5('0x4d')]);def[_0x51c5('0x4e')]=util[_0x51c5('0x1f')]('%s/service/v4_1/rest.php',_0x231cb2[_0x51c5('0x4b')]);if(_0x50d446&&_0x50d446[_0x51c5('0x4f')]){logger['info'](_0x51c5('0x50'),_0x51c5('0x51'));_0x1ede94['recordingURL']=util[_0x51c5('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x231cb2[_0x51c5('0x4d')],_0x1ede94[_0x51c5('0x52')],md5(_0x1ede94[_0x51c5('0x52')]));}else{_0x1ede94['recordingURL']='';}return getConnection(_0x231cb2)['then'](function(_0x1c9273){_0x513eaa=_0x1c9273;return getUser(_0x231cb2,_0x3ba39b['name'],_0x513eaa);})[_0x51c5('0x28')](function(_0x4f6abb){_0x11b56e=_0x4f6abb;logger[_0x51c5('0xc')]('The\x20User\x20ID\x20is:',_0x11b56e['id']);return getEndUser(_0x231cb2,_0x1ede94[_0x51c5('0x53')],_0x1ede94['calleridnum'],_0x513eaa);})[_0x51c5('0x28')](function(_0x28b086){_0x255e3a=_0x28b086;logger['info'](_0x51c5('0x54'),_0x255e3a['id']);return getTicket(_0x231cb2,_0x11b56e,_0x255e3a,_0x246127,_0x1ede94,_0x246127[_0x51c5('0x55')],_0x513eaa,_0x51c5('0x56'));})[_0x51c5('0x28')](function(_0x2e9efe){_0x905c0b=_0x2e9efe;logger[_0x51c5('0xc')](_0x51c5('0x57'));logger[_0x51c5('0xc')](_0x51c5('0x58'),_0x905c0b['id']);return setRelationship(_0x513eaa,_0x11b56e,_0x905c0b,_0x51c5('0x59'));})[_0x51c5('0x28')](function(){return setRelationship(_0x513eaa,_0x255e3a,_0x905c0b,_0x51c5('0x5a'));})[_0x51c5('0x28')](function(){return getServerInfo(_0x513eaa);})[_0x51c5('0x28')](function(_0x32666d){var _0x47a35f=parseInt(_0x32666d[_0x51c5('0x5b')][_0x51c5('0x5c')](0x0));var _0x4e5351=util[_0x51c5('0x1f')](_0x51c5('0x5d'),_0x231cb2['remoteUri'],_0x905c0b['id']);if(_0x47a35f>0x6){_0x4e5351=util[_0x51c5('0x1f')](_0x51c5('0x5e'),_0x231cb2[_0x51c5('0x4b')],_0x905c0b['id']);}logger[_0x51c5('0xc')](_0x51c5('0x50'),_0x51c5('0x5f'));emit(util[_0x51c5('0x1f')](_0x51c5('0x60'),_0x3ba39b[_0x51c5('0x16')]),_0x51c5('0x61'),{'uri':_0x4e5351});})['catch'](function(_0x4ee235){logger['error'](_0x51c5('0x50'),JSON[_0x51c5('0x24')](_0x4ee235));});};exports['outbound']=function(_0x44a02e,_0x21cdb6,_0x5a499f,_0x49bb83,_0x59b327,_0x552821,_0x4d77aa){var _0x503d29,_0xe1bc0f,_0x49bf90,_0x2683e3;_0x552821[_0x51c5('0x4b')]=intUtil[_0x51c5('0x4c')](_0x552821[_0x51c5('0x4b')]);_0x552821[_0x51c5('0x4d')]=intUtil[_0x51c5('0x4c')](_0x552821[_0x51c5('0x4d')]);def['uri']=util[_0x51c5('0x1f')](_0x51c5('0x62'),_0x552821[_0x51c5('0x4b')]);if(_0x4d77aa&&_0x4d77aa['recordingFormat']&&_0x4d77aa['recordingFormat']!==_0x51c5('0x63')){logger[_0x51c5('0xc')](_0x51c5('0x64'),'Recording\x20is\x20enabled!');_0x21cdb6['recordingURL']=util[_0x51c5('0x1f')](_0x51c5('0x65'),_0x552821[_0x51c5('0x4d')],_0x21cdb6[_0x51c5('0x52')],md5(_0x21cdb6['uniqueid']));}return getConnection(_0x552821)['then'](function(_0x434dc9){_0x2683e3=_0x434dc9;return getUser(_0x552821,_0x49bb83['name'],_0x2683e3);})[_0x51c5('0x28')](function(_0xdabbce){_0x503d29=_0xdabbce;logger[_0x51c5('0xc')](_0x51c5('0x66'),_0x503d29['id']);return getEndUser(_0x552821,_0x21cdb6[_0x51c5('0x67')],_0x21cdb6[_0x51c5('0x68')],_0x2683e3);})['then'](function(_0xad53fb){_0xe1bc0f=_0xad53fb;logger[_0x51c5('0xc')](_0x51c5('0x54'),_0xe1bc0f['id']);return getTicket(_0x552821,_0x503d29,_0xe1bc0f,_0x5a499f,_0x21cdb6,_0x5a499f['Fields'],_0x2683e3,_0x51c5('0x69'));})['then'](function(_0x13902b){_0x49bf90=_0x13902b;logger[_0x51c5('0xc')](_0x51c5('0x57'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x49bf90['id']);return setRelationship(_0x2683e3,_0x503d29,_0x49bf90,_0x51c5('0x59'));})[_0x51c5('0x28')](function(){return setRelationship(_0x2683e3,_0xe1bc0f,_0x49bf90,_0x51c5('0x5a'));})[_0x51c5('0x28')](function(){return getServerInfo(_0x2683e3);})['then'](function(_0x183346){var _0x2d21c6=parseInt(_0x183346[_0x51c5('0x5b')][_0x51c5('0x5c')](0x0));var _0x4eff3c=util[_0x51c5('0x1f')](_0x51c5('0x5d'),_0x552821[_0x51c5('0x4b')],_0x49bf90['id']);if(_0x2d21c6>0x6){_0x4eff3c=util[_0x51c5('0x1f')](_0x51c5('0x5e'),_0x552821[_0x51c5('0x4b')],_0x49bf90['id']);}logger['info'](_0x51c5('0x64'),_0x51c5('0x5f'));emit(util['format'](_0x51c5('0x60'),_0x49bb83[_0x51c5('0x16')]),'trigger:browser:url',{'uri':_0x4eff3c});})[_0x51c5('0x6a')](function(_0x3c30c8){logger[_0x51c5('0x6b')](_0x51c5('0x64'),JSON[_0x51c5('0x24')](_0x3c30c8));});};exports['unmanaged']=function(_0x5f3975,_0x21aec4,_0x2212f1,_0x54e941,_0x3506e4,_0x1f7ea4){var _0xa1e0bf,_0x37e4ba,_0x320b9e,_0x3eaf0b;_0x1f7ea4[_0x51c5('0x4b')]=intUtil[_0x51c5('0x4c')](_0x1f7ea4[_0x51c5('0x4b')]);_0x1f7ea4[_0x51c5('0x4d')]=intUtil['stripTrailingSlash'](_0x1f7ea4['serverUrl']);def[_0x51c5('0x4e')]=util['format'](_0x51c5('0x62'),_0x1f7ea4[_0x51c5('0x4b')]);if(_0x3506e4&&_0x3506e4[_0x51c5('0x4f')]){logger[_0x51c5('0xc')]('['+_0x21aec4[_0x51c5('0x6c')][_0x51c5('0x6d')]()+']',_0x51c5('0x51'));_0x21aec4[_0x51c5('0x6e')]=util['format'](_0x51c5('0x65'),_0x1f7ea4['serverUrl'],_0x21aec4[_0x51c5('0x52')],md5(_0x21aec4[_0x51c5('0x52')]));}else{_0x21aec4['recordingURL']='';}return getConnection(_0x1f7ea4)['then'](function(_0x55cd5d){_0x3eaf0b=_0x55cd5d;if(!_[_0x51c5('0x25')](_0x54e941)){return getUser(_0x1f7ea4,_0x54e941[_0x51c5('0x16')],_0x3eaf0b);}else{return getUser(_0x1f7ea4,null,_0x3eaf0b);}})[_0x51c5('0x28')](function(_0x4e934b){_0xa1e0bf=_0x4e934b;logger[_0x51c5('0xc')](_0x51c5('0x66'),_0xa1e0bf['id']);return getEndUser(_0x1f7ea4,_0x21aec4['calleridname'],_0x21aec4[_0x51c5('0x6f')],_0x3eaf0b);})['then'](function(_0x2aa8f8){_0x37e4ba=_0x2aa8f8;logger[_0x51c5('0xc')](_0x51c5('0x54'),_0x37e4ba['id']);return getTicket(_0x1f7ea4,_0xa1e0bf,_0x37e4ba,_0x2212f1,_0x21aec4,_0x2212f1[_0x51c5('0x55')],_0x3eaf0b,_0x51c5('0x56'));})[_0x51c5('0x28')](function(_0x11c013){_0x320b9e=_0x11c013;logger[_0x51c5('0xc')](_0x51c5('0x57'));logger[_0x51c5('0xc')](_0x51c5('0x58'),_0x320b9e['id']);return setRelationship(_0x3eaf0b,_0xa1e0bf,_0x320b9e,_0x51c5('0x59'));})['then'](function(){return setRelationship(_0x3eaf0b,_0x37e4ba,_0x320b9e,_0x51c5('0x5a'));})[_0x51c5('0x28')](function(){return getServerInfo(_0x3eaf0b);})['catch'](function(_0x44a201){logger[_0x51c5('0x6b')]('['+_0x21aec4[_0x51c5('0x6c')][_0x51c5('0x6d')]()+']',JSON[_0x51c5('0x24')](_0x44a201));});};
\ No newline at end of file
index f4f2267..04527e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1200=['push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','length','type','string','variable','variableName'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0x1200,0x7f));var _0x0120=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x1200[_0x3358ba];return _0x296e73;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x2ccee3,_0x309b08,_0x29b66e){var _0x229c55=[];if(_0x2ccee3[_0x0120('0x0')]>0x0){var _0x3796d0=_['sortBy'](_0x2ccee3,['id']);for(var _0x564276=0x0;_0x564276<_0x3796d0[_0x0120('0x0')];_0x564276++){var _0x11b0a3=_0x3796d0[_0x564276];if(_0x11b0a3[_0x0120('0x1')]===_0x0120('0x2')){_0x229c55['push'](_0x11b0a3['content']);}else if(_0x11b0a3[_0x0120('0x1')]===_0x0120('0x3')&&_0x11b0a3[_0x0120('0x4')]){_0x309b08[_0x11b0a3[_0x0120('0x4')]]&&_0x229c55[_0x0120('0x5')](_0x309b08[_0x11b0a3[_0x0120('0x4')]][_0x0120('0x6')]());}else if(_0x11b0a3[_0x0120('0x1')]===_0x0120('0x7')&&_0x11b0a3['Variable']&&_0x11b0a3[_0x0120('0x8')][_0x0120('0x9')]){_0x309b08[_0x11b0a3[_0x0120('0x8')][_0x0120('0x9')][_0x0120('0xa')]()]&&_0x229c55['push'](_0x309b08[_0x11b0a3[_0x0120('0x8')][_0x0120('0x9')]['toLowerCase']()][_0x0120('0x6')]());}else if(_0x11b0a3[_0x0120('0x1')]===_0x0120('0xb')){if(_0x11b0a3[_0x0120('0xc')]===_0x0120('0x2')&&_0x11b0a3[_0x0120('0xd')]){_0x229c55['push'](util[_0x0120('0xe')](_0x0120('0xf'),_0x11b0a3['key'],_0x11b0a3[_0x0120('0x10')]));}else if(_0x11b0a3[_0x0120('0xc')]===_0x0120('0x3')&&_0x11b0a3[_0x0120('0x4')]&&_0x11b0a3['key']){_0x309b08[_0x11b0a3[_0x0120('0x4')]]&&_0x229c55[_0x0120('0x5')](util[_0x0120('0xe')](_0x0120('0xf'),_0x11b0a3[_0x0120('0xd')],_0x309b08[_0x11b0a3[_0x0120('0x4')]]));}else if(_0x11b0a3['keyType']===_0x0120('0x7')&&_0x11b0a3[_0x0120('0x8')]&&_0x11b0a3[_0x0120('0x8')][_0x0120('0x9')]&&_0x11b0a3[_0x0120('0xd')]){_0x309b08[_0x11b0a3[_0x0120('0x8')]['name'][_0x0120('0xa')]()]&&_0x229c55[_0x0120('0x5')](util[_0x0120('0xe')](_0x0120('0xf'),_0x11b0a3[_0x0120('0xd')],_0x309b08[_0x11b0a3[_0x0120('0x8')][_0x0120('0x9')]['toLowerCase']()]));}}}}return _0x229c55[_0x0120('0x11')](_0x29b66e);};exports[_0x0120('0x12')]=function(_0x3153cb){var _0x5a9826=_0x3153cb['slice'](-0x1);if(_0x5a9826==='/'){_0x3153cb=_0x3153cb[_0x0120('0x13')](0x0,_0x3153cb[_0x0120('0x14')](_0x5a9826));}return _0x3153cb;};exports[_0x0120('0x15')]=function(_0x4eb9c9){if(!_['isNil'](_0x4eb9c9)&&_0x4eb9c9!==''){var _0x161b26=/^(([^<>()\[\]\\.,;:\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 _0x161b26['test'](String(_0x4eb9c9)[_0x0120('0xa')]());}else{return![];}};
\ No newline at end of file
+var _0xb43d=['%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','key','format'];(function(_0x25fafc,_0xaaa662){var _0x2f6110=function(_0x3e4cc7){while(--_0x3e4cc7){_0x25fafc['push'](_0x25fafc['shift']());}};_0x2f6110(++_0xaaa662);}(_0xb43d,0xc6));var _0xdb43=function(_0x20a534,_0x505aae){_0x20a534=_0x20a534-0x0;var _0x419fe0=_0xb43d[_0x20a534];return _0x419fe0;};'use strict';var _=require('lodash');var util=require(_0xdb43('0x0'));exports[_0xdb43('0x1')]=function(_0x4dee35,_0x4a34d1,_0x5074b2){var _0x48bff4=[];if(_0x4dee35[_0xdb43('0x2')]>0x0){var _0x2a37bb=_[_0xdb43('0x3')](_0x4dee35,['id']);for(var _0x5510e9=0x0;_0x5510e9<_0x2a37bb[_0xdb43('0x2')];_0x5510e9++){var _0x2c0f37=_0x2a37bb[_0x5510e9];if(_0x2c0f37['type']===_0xdb43('0x4')){_0x48bff4[_0xdb43('0x5')](_0x2c0f37[_0xdb43('0x6')]);}else if(_0x2c0f37[_0xdb43('0x7')]===_0xdb43('0x8')&&_0x2c0f37[_0xdb43('0x9')]){_0x4a34d1[_0x2c0f37['variableName']]&&_0x48bff4['push'](_0x4a34d1[_0x2c0f37[_0xdb43('0x9')]][_0xdb43('0xa')]());}else if(_0x2c0f37['type']===_0xdb43('0xb')&&_0x2c0f37[_0xdb43('0xc')]&&_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')]){_0x4a34d1[_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')][_0xdb43('0xe')]()]&&_0x48bff4[_0xdb43('0x5')](_0x4a34d1[_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')][_0xdb43('0xe')]()]['toString']());}else if(_0x2c0f37[_0xdb43('0x7')]==='keyValue'){if(_0x2c0f37[_0xdb43('0xf')]===_0xdb43('0x4')&&_0x2c0f37[_0xdb43('0x10')]){_0x48bff4[_0xdb43('0x5')](util[_0xdb43('0x11')](_0xdb43('0x12'),_0x2c0f37[_0xdb43('0x10')],_0x2c0f37[_0xdb43('0x13')]));}else if(_0x2c0f37['keyType']===_0xdb43('0x8')&&_0x2c0f37[_0xdb43('0x9')]&&_0x2c0f37['key']){_0x4a34d1[_0x2c0f37[_0xdb43('0x9')]]&&_0x48bff4[_0xdb43('0x5')](util[_0xdb43('0x11')](_0xdb43('0x12'),_0x2c0f37[_0xdb43('0x10')],_0x4a34d1[_0x2c0f37[_0xdb43('0x9')]]));}else if(_0x2c0f37[_0xdb43('0xf')]===_0xdb43('0xb')&&_0x2c0f37[_0xdb43('0xc')]&&_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')]&&_0x2c0f37[_0xdb43('0x10')]){_0x4a34d1[_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')]['toLowerCase']()]&&_0x48bff4[_0xdb43('0x5')](util['format'](_0xdb43('0x12'),_0x2c0f37[_0xdb43('0x10')],_0x4a34d1[_0x2c0f37[_0xdb43('0xc')][_0xdb43('0xd')][_0xdb43('0xe')]()]));}}}}return _0x48bff4[_0xdb43('0x14')](_0x5074b2);};exports[_0xdb43('0x15')]=function(_0x24925c){var _0x6ccf29=_0x24925c[_0xdb43('0x16')](-0x1);if(_0x6ccf29==='/'){_0x24925c=_0x24925c[_0xdb43('0x17')](0x0,_0x24925c['lastIndexOf'](_0x6ccf29));}return _0x24925c;};exports[_0xdb43('0x18')]=function(_0x16e516){if(!_[_0xdb43('0x19')](_0x16e516)&&_0x16e516!==''){var _0x3daa42=/^(([^<>()\[\]\\.,;:\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 _0x3daa42[_0xdb43('0x1a')](String(_0x16e516)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index 78af035..54995e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x2e4796,_0x46dd65){var _0x56d590=function(_0x352d78){while(--_0x352d78){_0x2e4796['push'](_0x2e4796['shift']());}};_0x56d590(++_0x46dd65);}(_0xe706,0xa3));var _0x6e70=function(_0xf24f30,_0x77205b){_0xf24f30=_0xf24f30-0x0;var _0x364bea=_0xe706[_0xf24f30];return _0x364bea;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
+var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x4bbc5a,_0x24722a){var _0x55c482=function(_0x4c4750){while(--_0x4c4750){_0x4bbc5a['push'](_0x4bbc5a['shift']());}};_0x55c482(++_0x24722a);}(_0x34e8,0x12c));var _0x834e=function(_0x3490c0,_0x283de4){_0x3490c0=_0x3490c0-0x0;var _0x12130d=_0x34e8[_0x3490c0];return _0x12130d;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
index 23dd249..212abd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5918=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','zendesk','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','defaults','GET','map','forEach','string','nameField','toLowerCase','includes','picklist','type','idField','customField','push','variable','variableName','custom_fields','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x5918,0x161));var _0x8591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5918[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8591('0x0'));var rp=require(_0x8591('0x1'));var md5=require('md5');var util=require(_0x8591('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8591('0x3'));var config=require(_0x8591('0x4'));var logger=require('../../../../config/logger')(_0x8591('0x5'));config['redis']=_['defaults'](config[_0x8591('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x8591('0x7'))(new Redis(config['redis']));function emit(_0x31d51b,_0x3e34d8,_0x5a5ac3){io['to'](_0x31d51b)['emit'](_0x3e34d8,_0x5a5ac3);}var headers={'Content-Type':_0x8591('0x8'),'Accept':_0x8591('0x8')};function getTicket(_0x3b0ea0,_0x5988cb,_0xf19d2c,_0x1f1bbe,_0x2a71ef){logger[_0x8591('0x9')](_0x8591('0xa'));return request({'uri':util[_0x8591('0xb')](_0x8591('0xc'),_0x3b0ea0[_0x8591('0xd')]),'method':_0x8591('0xe'),'body':{'ticket':_[_0x8591('0xf')]({'requester_id':_0xf19d2c['id'],'submitter_id':_0x5988cb?_0x5988cb['id']:undefined,'assignee_id':_0x5988cb?_0x5988cb['id']:undefined,'tags':getTags(_0x1f1bbe[_0x8591('0x10')],_0x8591('0x11')),'subject':intUtil[_0x8591('0x12')](_0x1f1bbe[_0x8591('0x13')],_0x2a71ef,'\x20'),'description':intUtil[_0x8591('0x12')](_0x1f1bbe[_0x8591('0x14')],_0x2a71ef,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8591('0x12')](_0x1f1bbe['Descriptions'],_0x2a71ef,'\x0a')}},getCustomFields(_0x1f1bbe[_0x8591('0x15')],_0x2a71ef))}})['then'](function(_0x3cf0da){logger['info'](_0x8591('0x16'));return _0x3cf0da[_0x8591('0x17')];});}function getUser(_0x3cd81e,_0x4ab60b){if(intUtil[_0x8591('0x18')](_0x4ab60b)){logger['info'](_0x8591('0x19'),_0x4ab60b);return request({'uri':util[_0x8591('0xb')](_0x8591('0x1a'),_0x3cd81e['remoteUri']),'qs':{'query':util[_0x8591('0xb')](_0x8591('0x1b'),_0x4ab60b)}})[_0x8591('0x1c')](function(_0x586fd3){if(_0x586fd3[_0x8591('0x1d')]){logger[_0x8591('0x9')]('Agent\x20found!');return _[_0x8591('0x1e')](_0x586fd3[_0x8591('0x1f')],{'email':_0x4ab60b,'role':_0x8591('0x20')});}else{logger[_0x8591('0x9')](_0x8591('0x21'));return request({'uri':util[_0x8591('0xb')](_0x8591('0x22'),_0x3cd81e[_0x8591('0xd')])})[_0x8591('0x1c')](function(_0x2dddfe){logger[_0x8591('0x9')](_0x8591('0x23'));return _0x2dddfe['user'];});}});}else{logger[_0x8591('0x9')](_0x8591('0x21'));return request({'uri':util[_0x8591('0xb')]('%s/users/me.json',_0x3cd81e[_0x8591('0xd')])})['then'](function(_0x596e80){logger[_0x8591('0x9')](_0x8591('0x23'));return _0x596e80[_0x8591('0x24')];});}}function getEndUser(_0x36cc1b,_0x2988e8,_0x12e11e){logger['info'](_0x8591('0x25'),_0x12e11e);return request({'uri':util[_0x8591('0xb')](_0x8591('0x1a'),_0x36cc1b[_0x8591('0xd')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x12e11e)}})[_0x8591('0x1c')](function(_0x2ba616){var _0x7aa8f5;if(_0x2ba616[_0x8591('0x1f')][_0x8591('0x26')]){_0x2ba616[_0x8591('0x1f')]=_['filter'](_0x2ba616['results'],{'suspended':![],'role':_0x8591('0x27')});if(_0x2ba616[_0x8591('0x1f')]['length']){_0x7aa8f5=_[_0x8591('0x28')](_0x2ba616[_0x8591('0x1f')]);}}if(_0x7aa8f5){logger['info']('Enduser\x20found!');return _0x7aa8f5;}else{logger[_0x8591('0x9')](_0x8591('0x29'));return request({'uri':util[_0x8591('0xb')](_0x8591('0x2a'),_0x36cc1b['remoteUri']),'method':'POST','body':{'user':{'role':_0x8591('0x27'),'name':util[_0x8591('0xb')]('Caller\x20-\x20%s',_0x2988e8||_0x12e11e),'phone':_0x12e11e}}})['then'](function(_0x3fbc3d){logger[_0x8591('0x9')](_0x8591('0x2b'));return _0x3fbc3d[_0x8591('0x24')];});}});}function getAuth(_0x2c7f6c){var _0xcff013;if(_0x2c7f6c['authType']===_0x8591('0x2c')){_0xcff013=util['format'](_0x8591('0x2d'),_0x2c7f6c[_0x8591('0x2e')],_0x2c7f6c[_0x8591('0x2c')]);}else if(_0x2c7f6c['authType']===_0x8591('0x2f')){_0xcff013=util[_0x8591('0xb')](_0x8591('0x30'),_0x2c7f6c[_0x8591('0x2e')],_0x2c7f6c[_0x8591('0x2f')]);}return util['format'](_0x8591('0x31'),new Buffer(_0xcff013)[_0x8591('0x32')](_0x8591('0x33')));}function request(_0x3c892d){logger['debug'](_0x8591('0x34'),JSON['stringify'](_0x3c892d));return rp(_[_0x8591('0x35')](_0x3c892d,{'method':_0x8591('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x25884f,_0x312385){var _0x334f5b=[];if(_0x25884f&&_0x25884f[_0x8591('0x26')]>0x0){_0x334f5b=_[_0x8591('0x37')](_0x25884f,_0x312385);}return _0x334f5b;}function getCustomFields(_0x111909,_0x118d47){var _0x233872=[];var _0x3f5ed0={'custom_fields':[]};if(_0x111909['length']>0x0){_[_0x8591('0x38')](_0x111909,function(_0x34b572){if(_['includes']([_0x8591('0x39'),'picklist'],_0x34b572['type'])&&_0x34b572[_0x8591('0x3a')]&&!_0x34b572['customField']){_0x3f5ed0[_0x34b572[_0x8591('0x3a')][_0x8591('0x3b')]()]=_0x34b572['content'][_0x8591('0x32')]();}else if(_[_0x8591('0x3c')]([_0x8591('0x39'),_0x8591('0x3d')],_0x34b572[_0x8591('0x3e')])&&_0x34b572[_0x8591('0x3f')]&&_0x34b572[_0x8591('0x40')]){_0x3f5ed0['custom_fields'][_0x8591('0x41')]({'id':_0x34b572[_0x8591('0x3f')],'value':_0x34b572['content'][_0x8591('0x32')]()});}else if(_0x34b572[_0x8591('0x3e')]===_0x8591('0x42')&&_0x34b572[_0x8591('0x43')]&&_0x34b572['idField']&&_0x34b572[_0x8591('0x40')]){_0x118d47[_0x34b572['variableName']]&&_0x3f5ed0[_0x8591('0x44')]['push']({'id':_0x34b572[_0x8591('0x3f')],'value':_0x118d47[_0x34b572[_0x8591('0x43')]]['toString']()});}else if(_0x34b572[_0x8591('0x3e')]===_0x8591('0x45')&&_0x34b572[_0x8591('0x46')]&&_0x34b572[_0x8591('0x46')][_0x8591('0x11')]&&_0x34b572[_0x8591('0x3f')]&&_0x34b572['customField']){_0x118d47[_0x34b572[_0x8591('0x46')][_0x8591('0x11')][_0x8591('0x3b')]()]&&_0x3f5ed0[_0x8591('0x44')]['push']({'id':_0x34b572['idField'],'value':_0x118d47[_0x34b572[_0x8591('0x46')]['name'][_0x8591('0x3b')]()][_0x8591('0x32')]()});}});}return _0x3f5ed0;}exports['queue']=function(_0x2e7bda,_0x11482e,_0x45434f,_0x10e61f,_0x842c7f,_0x5858f2){var _0x4a27af,_0x121514;_0x5858f2[_0x8591('0xd')]=intUtil[_0x8591('0x47')](_0x5858f2[_0x8591('0xd')]);_0x5858f2[_0x8591('0x48')]=intUtil[_0x8591('0x47')](_0x5858f2[_0x8591('0x48')]);if(_0x842c7f&&_0x842c7f['monitor_format']){logger[_0x8591('0x9')](_0x8591('0x49'),_0x8591('0x4a'));_0x11482e[_0x8591('0x4b')]=util[_0x8591('0xb')](_0x8591('0x4c'),_0x5858f2['serverUrl'],_0x11482e[_0x8591('0x4d')],md5(_0x11482e[_0x8591('0x4d')]));}else{_0x11482e[_0x8591('0x4b')]='';}headers[_0x8591('0x4e')]=getAuth(_0x5858f2);return getUser(_0x5858f2,_0x10e61f[_0x8591('0x4f')])[_0x8591('0x1c')](function(_0x4c6f49){_0x4a27af=_0x4c6f49;logger[_0x8591('0x9')](_0x8591('0x50'),_0x4a27af['id']);return getEndUser(_0x5858f2,_0x11482e[_0x8591('0x51')],_0x11482e[_0x8591('0x52')]);})[_0x8591('0x1c')](function(_0xcb7560){_0x121514=_0xcb7560;logger[_0x8591('0x9')]('The\x20Enduser\x20ID\x20is:',_0x121514['id']);return getTicket(_0x5858f2,_0x4a27af,_0x121514,_0x45434f,_0x11482e);})[_0x8591('0x1c')](function(_0x389a40){if(_0x389a40){logger['info'](_0x8591('0x53'),_0x389a40['id']);switch(_0x5858f2['type']){case'integrationTab':logger[_0x8591('0x9')]('[QUEUE]',_0x8591('0x54'));return request({'uri':util['format'](_0x8591('0x55'),_0x5858f2['remoteUri'],_0x4a27af['id'],_0x389a40['id']),'method':_0x8591('0xe')});case _0x8591('0x56'):logger['info'](_0x8591('0x49'),_0x8591('0x57'));emit(util[_0x8591('0xb')](_0x8591('0x58'),_0x10e61f[_0x8591('0x11')]),_0x8591('0x59'),{'uri':util[_0x8591('0xb')](_0x8591('0x5a'),_0x5858f2['remoteUri'][_0x8591('0x5b')](_0x8591('0x5c'),''),_0x389a40['id'])});break;default:logger[_0x8591('0x5d')](_0x8591('0x49'),_0x8591('0x5e'));}}})['catch'](function(_0x272e57){logger[_0x8591('0x5d')](_0x8591('0x5f'),util[_0x8591('0x60')](_0x272e57,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x18f015,_0xcb56c2,_0x59dbea,_0x2dc7f5,_0x5cbf20,_0x356460,_0x300beb){var _0x2ddc09,_0x28444e;_0x356460['remoteUri']=intUtil[_0x8591('0x47')](_0x356460[_0x8591('0xd')]);_0x356460['serverUrl']=intUtil['stripTrailingSlash'](_0x356460[_0x8591('0x48')]);if(_0x300beb&&_0x300beb[_0x8591('0x61')]&&_0x300beb['recordingFormat']!=='none'){logger[_0x8591('0x9')](_0x8591('0x62'),_0x8591('0x4a'));_0xcb56c2['recordingURL']=util[_0x8591('0xb')](_0x8591('0x4c'),_0x356460[_0x8591('0x48')],_0xcb56c2['uniqueid'],md5(_0xcb56c2[_0x8591('0x4d')]));}headers['Authorization']=getAuth(_0x356460);return getUser(_0x356460,_0x2dc7f5['email'])[_0x8591('0x1c')](function(_0x5c7d91){_0x2ddc09=_0x5c7d91;logger[_0x8591('0x9')](_0x8591('0x50'),_0x2ddc09['id']);return getEndUser(_0x356460,_0xcb56c2[_0x8591('0x63')],_0xcb56c2[_0x8591('0x64')]);})[_0x8591('0x1c')](function(_0x3e1443){_0x28444e=_0x3e1443;logger['info'](_0x8591('0x65'),_0x28444e['id']);return getTicket(_0x356460,_0x2ddc09,_0x28444e,_0x59dbea,_0xcb56c2);})[_0x8591('0x1c')](function(_0xcb25de){if(_0xcb25de){logger[_0x8591('0x9')](_0x8591('0x53'),_0xcb25de['id']);switch(_0x356460[_0x8591('0x3e')]){case _0x8591('0x66'):logger['info']('[OUTBOUND]',_0x8591('0x54'));return request({'uri':util[_0x8591('0xb')](_0x8591('0x55'),_0x356460['remoteUri'],_0x2ddc09['id'],_0xcb25de['id']),'method':_0x8591('0xe')});case _0x8591('0x56'):logger[_0x8591('0x9')](_0x8591('0x62'),_0x8591('0x57'));emit(util[_0x8591('0xb')](_0x8591('0x58'),_0x2dc7f5[_0x8591('0x11')]),_0x8591('0x59'),{'uri':util['format'](_0x8591('0x5a'),_0x356460[_0x8591('0xd')][_0x8591('0x5b')](_0x8591('0x5c'),''),_0xcb25de['id'])});break;default:logger[_0x8591('0x5d')](_0x8591('0x62'),_0x8591('0x5e'));}}})[_0x8591('0x67')](function(_0x4de49b){logger[_0x8591('0x5d')](_0x8591('0x68'),util[_0x8591('0x60')](_0x4de49b,{'showHidden':!![],'depth':null}));});};exports[_0x8591('0x69')]=function(_0x53b7bb,_0x21fbb9,_0x220204,_0x24337f,_0x122613,_0x5f21c6){var _0x18f17b,_0x22598c;_0x5f21c6['remoteUri']=intUtil[_0x8591('0x47')](_0x5f21c6[_0x8591('0xd')]);_0x5f21c6[_0x8591('0x48')]=intUtil[_0x8591('0x47')](_0x5f21c6[_0x8591('0x48')]);if(_0x122613&&_0x122613[_0x8591('0x6a')]){logger[_0x8591('0x9')]('['+_0x21fbb9['lastevent'][_0x8591('0x6b')]()+']',_0x8591('0x4a'));_0x21fbb9['recordingURL']=util[_0x8591('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f21c6[_0x8591('0x48')],_0x21fbb9[_0x8591('0x4d')],md5(_0x21fbb9[_0x8591('0x4d')]));}else{_0x21fbb9[_0x8591('0x4b')]='';}headers[_0x8591('0x4e')]=getAuth(_0x5f21c6);return getUser(_0x5f21c6)[_0x8591('0x1c')](function(_0x4a9223){_0x18f17b=_0x4a9223;logger['info']('The\x20User\x20ID\x20is:',_0x18f17b['id']);return getEndUser(_0x5f21c6,_0x21fbb9[_0x8591('0x51')],_0x21fbb9[_0x8591('0x52')]);})[_0x8591('0x1c')](function(_0x1d24a8){_0x22598c=_0x1d24a8;logger[_0x8591('0x9')](_0x8591('0x65'),_0x22598c['id']);return getTicket(_0x5f21c6,_0x18f17b,_0x22598c,_0x220204,_0x21fbb9);})[_0x8591('0x1c')](function(_0x54008e){if(_0x54008e){logger[_0x8591('0x9')]('The\x20Ticket\x20ID\x20is:',_0x54008e['id']);}})[_0x8591('0x67')](function(_0x46ceed){logger[_0x8591('0x5d')]('['+_0x21fbb9[_0x8591('0x6c')][_0x8591('0x6b')]()+']'+_0x8591('0x6d'),util[_0x8591('0x60')](_0x46ceed,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xd461=['[HTTP]','stringify','GET','map','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','custom_fields','push','idField','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','remoteUri','POST','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','count','Agent\x20found!','find','results','agent','%s/users/me.json','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','username','password','authType','token','%s/token:%s','Basic\x20%s','base64','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd461,0xab));var _0x1d46=function(_0x54dd90,_0x494673){_0x54dd90=_0x54dd90-0x0;var _0x3d869a=_0xd461[_0x54dd90];return _0x3d869a;};'use strict';var _=require(_0x1d46('0x0'));var rp=require(_0x1d46('0x1'));var md5=require(_0x1d46('0x2'));var util=require(_0x1d46('0x3'));var Redis=require(_0x1d46('0x4'));var intUtil=require(_0x1d46('0x5'));var config=require(_0x1d46('0x6'));var logger=require(_0x1d46('0x7'))('zendesk');config[_0x1d46('0x8')]=_[_0x1d46('0x9')](config[_0x1d46('0x8')],{'host':_0x1d46('0xa'),'port':0x18eb});var io=require(_0x1d46('0xb'))(new Redis(config[_0x1d46('0x8')]));function emit(_0x509aca,_0x2aaf27,_0x3ce732){io['to'](_0x509aca)[_0x1d46('0xc')](_0x2aaf27,_0x3ce732);}var headers={'Content-Type':_0x1d46('0xd'),'Accept':_0x1d46('0xd')};function getTicket(_0x1d1b8a,_0x10b52d,_0x4862e3,_0x5c089f,_0x41de08){logger[_0x1d46('0xe')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x1d46('0xf')]('%s/tickets.json',_0x1d1b8a[_0x1d46('0x10')]),'method':_0x1d46('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x4862e3['id'],'submitter_id':_0x10b52d?_0x10b52d['id']:undefined,'assignee_id':_0x10b52d?_0x10b52d['id']:undefined,'tags':getTags(_0x5c089f['Tags'],'name'),'subject':intUtil[_0x1d46('0x12')](_0x5c089f['Subjects'],_0x41de08,'\x20'),'description':intUtil[_0x1d46('0x12')](_0x5c089f[_0x1d46('0x13')],_0x41de08,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5c089f[_0x1d46('0x13')],_0x41de08,'\x0a')}},getCustomFields(_0x5c089f[_0x1d46('0x14')],_0x41de08))}})[_0x1d46('0x15')](function(_0x3dcb7b){logger[_0x1d46('0xe')](_0x1d46('0x16'));return _0x3dcb7b[_0x1d46('0x17')];});}function getUser(_0x6d222c,_0x198b01){if(intUtil[_0x1d46('0x18')](_0x198b01)){logger['info']('Getting\x20agent\x20with\x20email',_0x198b01);return request({'uri':util['format'](_0x1d46('0x19'),_0x6d222c['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x198b01)}})[_0x1d46('0x15')](function(_0x20e200){if(_0x20e200[_0x1d46('0x1a')]){logger[_0x1d46('0xe')](_0x1d46('0x1b'));return _[_0x1d46('0x1c')](_0x20e200[_0x1d46('0x1d')],{'email':_0x198b01,'role':_0x1d46('0x1e')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1d46('0xf')](_0x1d46('0x1f'),_0x6d222c[_0x1d46('0x10')])})[_0x1d46('0x15')](function(_0x5a2fc0){logger[_0x1d46('0xe')]('Admin\x20account\x20selected.');return _0x5a2fc0['user'];});}});}else{logger[_0x1d46('0xe')](_0x1d46('0x20'));return request({'uri':util[_0x1d46('0xf')](_0x1d46('0x1f'),_0x6d222c[_0x1d46('0x10')])})['then'](function(_0x2c7d1f){logger[_0x1d46('0xe')](_0x1d46('0x21'));return _0x2c7d1f[_0x1d46('0x22')];});}}function getEndUser(_0x5208df,_0x27d338,_0x5aca24){logger['info'](_0x1d46('0x23'),_0x5aca24);return request({'uri':util[_0x1d46('0xf')](_0x1d46('0x19'),_0x5208df[_0x1d46('0x10')]),'qs':{'query':util[_0x1d46('0xf')](_0x1d46('0x24'),_0x5aca24)}})[_0x1d46('0x15')](function(_0x294e38){var _0x13b90c;if(_0x294e38[_0x1d46('0x1d')][_0x1d46('0x25')]){_0x294e38[_0x1d46('0x1d')]=_[_0x1d46('0x26')](_0x294e38['results'],{'suspended':![],'role':'end-user'});if(_0x294e38[_0x1d46('0x1d')][_0x1d46('0x25')]){_0x13b90c=_[_0x1d46('0x27')](_0x294e38[_0x1d46('0x1d')]);}}if(_0x13b90c){logger[_0x1d46('0xe')](_0x1d46('0x28'));return _0x13b90c;}else{logger[_0x1d46('0xe')](_0x1d46('0x29'));return request({'uri':util[_0x1d46('0xf')](_0x1d46('0x2a'),_0x5208df['remoteUri']),'method':_0x1d46('0x11'),'body':{'user':{'role':_0x1d46('0x2b'),'name':util[_0x1d46('0xf')](_0x1d46('0x2c'),_0x27d338||_0x5aca24),'phone':_0x5aca24}}})['then'](function(_0x1bdfc2){logger['info'](_0x1d46('0x2d'));return _0x1bdfc2[_0x1d46('0x22')];});}});}function getAuth(_0x3c2b00){var _0x154eb1;if(_0x3c2b00['authType']==='password'){_0x154eb1=util['format'](_0x1d46('0x2e'),_0x3c2b00[_0x1d46('0x2f')],_0x3c2b00[_0x1d46('0x30')]);}else if(_0x3c2b00[_0x1d46('0x31')]===_0x1d46('0x32')){_0x154eb1=util['format'](_0x1d46('0x33'),_0x3c2b00[_0x1d46('0x2f')],_0x3c2b00[_0x1d46('0x32')]);}return util['format'](_0x1d46('0x34'),new Buffer(_0x154eb1)['toString'](_0x1d46('0x35')));}function request(_0x3064d4){logger[_0x1d46('0x36')](_0x1d46('0x37'),JSON[_0x1d46('0x38')](_0x3064d4));return rp(_[_0x1d46('0x9')](_0x3064d4,{'method':_0x1d46('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x80f1c4,_0x1805af){var _0x1da861=[];if(_0x80f1c4&&_0x80f1c4['length']>0x0){_0x1da861=_[_0x1d46('0x3a')](_0x80f1c4,_0x1805af);}return _0x1da861;}function getCustomFields(_0x4ff8a5,_0x400b87){var _0x54cf83=[];var _0x11c484={'custom_fields':[]};if(_0x4ff8a5[_0x1d46('0x25')]>0x0){_['forEach'](_0x4ff8a5,function(_0x445f59){if(_['includes']([_0x1d46('0x3b'),_0x1d46('0x3c')],_0x445f59[_0x1d46('0x3d')])&&_0x445f59[_0x1d46('0x3e')]&&!_0x445f59[_0x1d46('0x3f')]){_0x11c484[_0x445f59[_0x1d46('0x3e')][_0x1d46('0x40')]()]=_0x445f59[_0x1d46('0x41')][_0x1d46('0x42')]();}else if(_[_0x1d46('0x43')]([_0x1d46('0x3b'),_0x1d46('0x3c')],_0x445f59[_0x1d46('0x3d')])&&_0x445f59['idField']&&_0x445f59[_0x1d46('0x3f')]){_0x11c484[_0x1d46('0x44')][_0x1d46('0x45')]({'id':_0x445f59[_0x1d46('0x46')],'value':_0x445f59[_0x1d46('0x41')]['toString']()});}else if(_0x445f59[_0x1d46('0x3d')]===_0x1d46('0x47')&&_0x445f59['variableName']&&_0x445f59[_0x1d46('0x46')]&&_0x445f59[_0x1d46('0x3f')]){_0x400b87[_0x445f59['variableName']]&&_0x11c484[_0x1d46('0x44')][_0x1d46('0x45')]({'id':_0x445f59['idField'],'value':_0x400b87[_0x445f59[_0x1d46('0x48')]]['toString']()});}else if(_0x445f59[_0x1d46('0x3d')]===_0x1d46('0x49')&&_0x445f59[_0x1d46('0x4a')]&&_0x445f59['Variable'][_0x1d46('0x4b')]&&_0x445f59[_0x1d46('0x46')]&&_0x445f59[_0x1d46('0x3f')]){_0x400b87[_0x445f59[_0x1d46('0x4a')]['name'][_0x1d46('0x40')]()]&&_0x11c484[_0x1d46('0x44')][_0x1d46('0x45')]({'id':_0x445f59[_0x1d46('0x46')],'value':_0x400b87[_0x445f59[_0x1d46('0x4a')]['name']['toLowerCase']()][_0x1d46('0x42')]()});}});}return _0x11c484;}exports[_0x1d46('0x4c')]=function(_0x26562e,_0x1721f8,_0x17dd92,_0x3c4b0d,_0x1ee915,_0x32bca4){var _0x56d27e,_0x304394;_0x32bca4[_0x1d46('0x10')]=intUtil[_0x1d46('0x4d')](_0x32bca4['remoteUri']);_0x32bca4[_0x1d46('0x4e')]=intUtil[_0x1d46('0x4d')](_0x32bca4[_0x1d46('0x4e')]);if(_0x1ee915&&_0x1ee915[_0x1d46('0x4f')]){logger[_0x1d46('0xe')]('[QUEUE]',_0x1d46('0x50'));_0x1721f8[_0x1d46('0x51')]=util[_0x1d46('0xf')](_0x1d46('0x52'),_0x32bca4[_0x1d46('0x4e')],_0x1721f8[_0x1d46('0x53')],md5(_0x1721f8['uniqueid']));}else{_0x1721f8[_0x1d46('0x51')]='';}headers[_0x1d46('0x54')]=getAuth(_0x32bca4);return getUser(_0x32bca4,_0x3c4b0d[_0x1d46('0x55')])['then'](function(_0x10b63c){_0x56d27e=_0x10b63c;logger[_0x1d46('0xe')](_0x1d46('0x56'),_0x56d27e['id']);return getEndUser(_0x32bca4,_0x1721f8['calleridname'],_0x1721f8[_0x1d46('0x57')]);})[_0x1d46('0x15')](function(_0xd570be){_0x304394=_0xd570be;logger[_0x1d46('0xe')](_0x1d46('0x58'),_0x304394['id']);return getTicket(_0x32bca4,_0x56d27e,_0x304394,_0x17dd92,_0x1721f8);})[_0x1d46('0x15')](function(_0x47b947){if(_0x47b947){logger[_0x1d46('0xe')](_0x1d46('0x59'),_0x47b947['id']);switch(_0x32bca4[_0x1d46('0x3d')]){case _0x1d46('0x5a'):logger[_0x1d46('0xe')]('[QUEUE]',_0x1d46('0x5b'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x32bca4[_0x1d46('0x10')],_0x56d27e['id'],_0x47b947['id']),'method':_0x1d46('0x11')});case'newTab':logger['info'](_0x1d46('0x5c'),_0x1d46('0x5d'));emit(util[_0x1d46('0xf')](_0x1d46('0x5e'),_0x3c4b0d['name']),_0x1d46('0x5f'),{'uri':util['format'](_0x1d46('0x60'),_0x32bca4[_0x1d46('0x10')][_0x1d46('0x61')](_0x1d46('0x62'),''),_0x47b947['id'])});break;default:logger[_0x1d46('0x63')](_0x1d46('0x5c'),_0x1d46('0x64'));}}})['catch'](function(_0x5e945b){logger[_0x1d46('0x63')](_0x1d46('0x65'),util[_0x1d46('0x66')](_0x5e945b,{'showHidden':!![],'depth':null}));});};exports[_0x1d46('0x67')]=function(_0x52f450,_0x1c000a,_0x49035b,_0x43ffbb,_0x4db5e3,_0x315cc6,_0x2ef57d){var _0x34110a,_0x4bf594;_0x315cc6[_0x1d46('0x10')]=intUtil[_0x1d46('0x4d')](_0x315cc6[_0x1d46('0x10')]);_0x315cc6[_0x1d46('0x4e')]=intUtil['stripTrailingSlash'](_0x315cc6['serverUrl']);if(_0x2ef57d&&_0x2ef57d[_0x1d46('0x68')]&&_0x2ef57d[_0x1d46('0x68')]!=='none'){logger[_0x1d46('0xe')](_0x1d46('0x69'),_0x1d46('0x50'));_0x1c000a[_0x1d46('0x51')]=util[_0x1d46('0xf')](_0x1d46('0x52'),_0x315cc6['serverUrl'],_0x1c000a[_0x1d46('0x53')],md5(_0x1c000a[_0x1d46('0x53')]));}headers[_0x1d46('0x54')]=getAuth(_0x315cc6);return getUser(_0x315cc6,_0x43ffbb[_0x1d46('0x55')])[_0x1d46('0x15')](function(_0x5a2160){_0x34110a=_0x5a2160;logger[_0x1d46('0xe')](_0x1d46('0x56'),_0x34110a['id']);return getEndUser(_0x315cc6,_0x1c000a['destcalleridname'],_0x1c000a['destcalleridnum']);})[_0x1d46('0x15')](function(_0x1ad459){_0x4bf594=_0x1ad459;logger[_0x1d46('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4bf594['id']);return getTicket(_0x315cc6,_0x34110a,_0x4bf594,_0x49035b,_0x1c000a);})['then'](function(_0x3f2ee4){if(_0x3f2ee4){logger[_0x1d46('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3f2ee4['id']);switch(_0x315cc6['type']){case'integrationTab':logger[_0x1d46('0xe')](_0x1d46('0x69'),_0x1d46('0x5b'));return request({'uri':util[_0x1d46('0xf')](_0x1d46('0x6a'),_0x315cc6['remoteUri'],_0x34110a['id'],_0x3f2ee4['id']),'method':_0x1d46('0x11')});case'newTab':logger[_0x1d46('0xe')]('[OUTBOUND]',_0x1d46('0x5d'));emit(util[_0x1d46('0xf')](_0x1d46('0x5e'),_0x43ffbb[_0x1d46('0x4b')]),_0x1d46('0x5f'),{'uri':util['format'](_0x1d46('0x60'),_0x315cc6[_0x1d46('0x10')][_0x1d46('0x61')]('/api/v2',''),_0x3f2ee4['id'])});break;default:logger[_0x1d46('0x63')](_0x1d46('0x69'),_0x1d46('0x64'));}}})[_0x1d46('0x6b')](function(_0x4ada8a){logger[_0x1d46('0x63')](_0x1d46('0x6c'),util['inspect'](_0x4ada8a,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x185598,_0x1a17d9,_0x49ef91,_0x50781f,_0xdc4606,_0x5da7d9){var _0x2c844a,_0x48aa88;_0x5da7d9[_0x1d46('0x10')]=intUtil[_0x1d46('0x4d')](_0x5da7d9['remoteUri']);_0x5da7d9['serverUrl']=intUtil[_0x1d46('0x4d')](_0x5da7d9[_0x1d46('0x4e')]);if(_0xdc4606&&_0xdc4606[_0x1d46('0x4f')]){logger[_0x1d46('0xe')]('['+_0x1a17d9[_0x1d46('0x6d')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1a17d9[_0x1d46('0x51')]=util[_0x1d46('0xf')](_0x1d46('0x52'),_0x5da7d9[_0x1d46('0x4e')],_0x1a17d9[_0x1d46('0x53')],md5(_0x1a17d9[_0x1d46('0x53')]));}else{_0x1a17d9[_0x1d46('0x51')]='';}headers[_0x1d46('0x54')]=getAuth(_0x5da7d9);return getUser(_0x5da7d9)[_0x1d46('0x15')](function(_0x2ae8a1){_0x2c844a=_0x2ae8a1;logger['info'](_0x1d46('0x56'),_0x2c844a['id']);return getEndUser(_0x5da7d9,_0x1a17d9[_0x1d46('0x6e')],_0x1a17d9[_0x1d46('0x57')]);})[_0x1d46('0x15')](function(_0x4187dd){_0x48aa88=_0x4187dd;logger[_0x1d46('0xe')](_0x1d46('0x58'),_0x48aa88['id']);return getTicket(_0x5da7d9,_0x2c844a,_0x48aa88,_0x49ef91,_0x1a17d9);})[_0x1d46('0x15')](function(_0x193a5e){if(_0x193a5e){logger[_0x1d46('0xe')](_0x1d46('0x59'),_0x193a5e['id']);}})[_0x1d46('0x6b')](function(_0x24cc5f){logger[_0x1d46('0x63')]('['+_0x1a17d9['lastevent'][_0x1d46('0x6f')]()+']'+_0x1d46('0x70'),util[_0x1d46('0x66')](_0x24cc5f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 1a12d48..398b311 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x006b=['picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','catch','error','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isNil','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','details','moduleCreate','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','connect','Rejected','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','err','log','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','destcalleridname','Outbound','[OUTBOUND]','lastevent','toUpperCase','zoho.eu','calleridnum','lodash','request-promise','md5','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x006b,0x83));var _0xb006=function(_0x4548cf,_0x4bfb76){_0x4548cf=_0x4548cf-0x0;var _0x14340a=_0x006b[_0x4548cf];return _0x14340a;};'use strict';var _=require(_0xb006('0x0'));var rp=require(_0xb006('0x1'));var md5=require(_0xb006('0x2'));var util=require('util');var intUtil=require(_0xb006('0x3'));var moment=require(_0xb006('0x4'));var Redis=require('ioredis');var BPromise=require(_0xb006('0x5'));var config=require(_0xb006('0x6'));var logger=require(_0xb006('0x7'))(_0xb006('0x8'));config[_0xb006('0x9')]=_[_0xb006('0xa')](config[_0xb006('0x9')],{'host':_0xb006('0xb'),'port':0x18eb});var io=require(_0xb006('0xc'))(new Redis(config[_0xb006('0x9')]));function emit(_0x4da909,_0x566fa8,_0x4e325a){io['to'](_0x4da909)[_0xb006('0xd')](_0x566fa8,_0x4e325a);}function request(_0x19a986){logger[_0xb006('0xe')](_0xb006('0xf'),JSON[_0xb006('0x10')](_0x19a986));return rp(_0x19a986);}function getCustomFields(_0x182103,_0x3c1de8){var _0x1b6aa4={};if(_0x182103[_0xb006('0x11')]>0x0){_[_0xb006('0x12')](_0x182103,function(_0x498f9f){if(_[_0xb006('0x13')]([_0xb006('0x14'),_0xb006('0x15')],_0x498f9f[_0xb006('0x16')])&&_0x498f9f[_0xb006('0x17')]){_0x1b6aa4[_0x498f9f[_0xb006('0x17')]]=_0x498f9f['content'][_0xb006('0x18')]();}else if(_0x498f9f[_0xb006('0x16')]===_0xb006('0x19')&&_0x498f9f['variableName']&&_0x498f9f[_0xb006('0x17')]&&_0x3c1de8[_0x498f9f[_0xb006('0x1a')]]){_0x1b6aa4[_0x498f9f[_0xb006('0x17')]]=_0x3c1de8[_0x498f9f[_0xb006('0x1a')]][_0xb006('0x18')]();}else if(_0x498f9f[_0xb006('0x16')]===_0xb006('0x1b')&&_0x498f9f[_0xb006('0x1c')]&&_0x498f9f[_0xb006('0x1c')][_0xb006('0x1d')]&&_0x498f9f[_0xb006('0x17')]&&_0x3c1de8[_0x498f9f[_0xb006('0x1c')]['name'][_0xb006('0x1e')]()]){_0x1b6aa4[_0x498f9f[_0xb006('0x17')]]=_0x3c1de8[_0x498f9f['Variable'][_0xb006('0x1d')][_0xb006('0x1e')]()][_0xb006('0x18')]();}});}return _0x1b6aa4;}function getName(_0x380935){if(_0x380935['indexOf']('\x20')>0x0){var _0x3f956f=_0x380935[_0xb006('0x1f')](/ (.+)/);if(_0x3f956f[0x1]){return _0x3f956f;}}return[_0x380935,_0x380935];}var accountsTokens={};function getAccessToken(_0x1fe14f){return new Promise(function(_0x3b15e3,_0x378c67){if(!_['isNil'](accountsTokens[_0x1fe14f['id']])&&!_['isNil'](accountsTokens[_0x1fe14f['id']][_0xb006('0x20')])){if(moment()[_0xb006('0x21')](accountsTokens[_0x1fe14f['id']][_0xb006('0x22')])){_0x3b15e3(accountsTokens[_0x1fe14f['id']][_0xb006('0x20')]);}}var _0xe1c0e;switch(_0x1fe14f[_0xb006('0x23')]){case'US':_0xe1c0e=_0xb006('0x24');break;case'AU':_0xe1c0e=_0xb006('0x25');break;case'EU':_0xe1c0e=_0xb006('0x26');break;case'IN':_0xe1c0e=_0xb006('0x27');break;case'CN':_0xe1c0e=_0xb006('0x28');break;default:_0xe1c0e=_0xb006('0x26');break;}var _0x42e410={'method':_0xb006('0x29'),'uri':_0xe1c0e+_0xb006('0x2a'),'qs':{'refresh_token':_0x1fe14f[_0xb006('0x2b')],'client_id':_0x1fe14f[_0xb006('0x2c')],'client_secret':_0x1fe14f[_0xb006('0x2d')],'grant_type':_0xb006('0x2e')},'json':!![]};return rp(_0x42e410)['then'](function(_0x287243){accountsTokens[_0x1fe14f['id']]={'access_token':_0x287243[_0xb006('0x20')],'expires_in':moment()[_0xb006('0x2f')](_0x287243[_0xb006('0x22')],'seconds')};_0x3b15e3(_0x287243[_0xb006('0x20')]);})[_0xb006('0x30')](function(_0x57d792){logger[_0xb006('0x31')]('Failing\x20creating\x20the\x20access_token',_0x57d792[_0xb006('0x32')]);_0x378c67(_0x57d792);});});}function getUser(_0x1ded08,_0x9cc519,_0x7b42e6,_0x3401cb){logger[_0xb006('0x33')](_0xb006('0x34'));return request({'method':_0xb006('0x35'),'uri':util['format'](_0xb006('0x36'),_0x9cc519),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xb006('0x37')+_0x1ded08},'json':!![]})[_0xb006('0x38')](function(_0x190575){if(_0x190575['users']){var _0x52a4fb=-0x1;if(_['isArrayLikeObject'](_0x190575[_0xb006('0x39')])){if(!_[_0xb006('0x3a')](_0x3401cb)){_0x52a4fb=_[_0xb006('0x3b')](_0x190575[_0xb006('0x39')],function(_0x58b66b){return _0x58b66b[_0xb006('0x3c')]===_0x3401cb;});}if(_0x52a4fb>=0x0){logger['info'](_0xb006('0x3d'));}else{logger[_0xb006('0x33')](_0xb006('0x3e'));_0x52a4fb=_['findIndex'](_0x190575[_0xb006('0x39')],function(_0x167885){return _0x167885['profile'][_0xb006('0x1d')]===_0xb006('0x3f');});}return _0x190575[_0xb006('0x39')][_0x52a4fb];}else{if(_0x190575[_0xb006('0x40')][_0xb006('0x41')][_0xb006('0x1d')]===_0xb006('0x3f')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x190575[_0xb006('0x40')];return user;}else{logger[_0xb006('0x31')](_0xb006('0x42'),JSON[_0xb006('0x10')](_0x190575));throw new Error(_0xb006('0x43')+JSON[_0xb006('0x10')](_0x190575));}}}else{logger[_0xb006('0x31')](_0xb006('0x42'),JSON[_0xb006('0x10')](_0x190575));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x190575));}})[_0xb006('0x30')](function(_0x20416b){console[_0xb006('0x31')](_0x20416b);});}function getZohoUser(_0x3bd4b4,_0x38c813){return new BPromise(function(_0xb383ae,_0x2826e3){request(_0x3bd4b4)['then'](function(_0xe28ee3){var _0x2ad5ca=null;if(_0xe28ee3){_0x2ad5ca=_0xe28ee3[_0xb006('0x44')][0x0];_0x2ad5ca[_0xb006('0x45')]=_0x38c813;}_0xb383ae(_0x2ad5ca);})[_0xb006('0x30')](function(_0x16c513){_0x2826e3(_0x16c513);});});}function createEndUser(_0x33ba20,_0x3488cd,_0x36fe7a,_0x181b7f,_0x1aedf0,_0x14198b){var _0x36fe7a=getName(_0x36fe7a);return request({'method':_0xb006('0x29'),'uri':_0xb006('0x46')+_0x3488cd+_0xb006('0x47')+_[_0xb006('0x48')](_0x14198b['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x36fe7a[0x1],'First_Name':_0x36fe7a[0x0],'Phone':_0x181b7f,'Owner':{'name':!_[_0xb006('0x3a')](_0x1aedf0[_0xb006('0x49')]['name'])?_0x1aedf0['role'][_0xb006('0x1d')]:!_[_0xb006('0x3a')](_0x1aedf0[_0xb006('0x4a')])?_0x1aedf0[_0xb006('0x4a')]+'\x20'+_0x1aedf0['last_name']:_0x1aedf0[_0xb006('0x4b')],'id':_0x1aedf0['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x33ba20},'json':!![]})[_0xb006('0x38')](function(_0x4aa69f){if(_0x4aa69f&&_0x4aa69f[_0xb006('0x44')][0x0][_0xb006('0x4c')]==='SUCCESS'){var _0x1b73d7=_0x4aa69f[_0xb006('0x44')][0x0][_0xb006('0x4d')];_0x1b73d7['enduserType']=_[_0xb006('0x48')](_0x14198b[_0xb006('0x4e')])+'s';return _0x1b73d7;}logger[_0xb006('0x31')]('The\x20failing\x20result\x20is',JSON[_0xb006('0x10')](data));throw new Error(_0xb006('0x4f')+JSON[_0xb006('0x10')](data));})[_0xb006('0x30')](function(_0x15ad7a){console['log'](_0xb006('0x50'),_0x15ad7a);});}function getEndUser(_0x53aa7f,_0x3641ea,_0x368bad,_0x731898,_0x3075a2,_0x5aa2e4,_0x17bd25){var _0x11c7b1={'method':_0xb006('0x35'),'uri':'','headers':{'Authorization':_0xb006('0x37')+_0x53aa7f},'json':!![]};switch(_0x17bd25[_0xb006('0x51')]){case _0xb006('0x52'):_0x11c7b1['uri']='https://www.zohoapis.'+_0x3641ea+_0xb006('0x53')+_0x3075a2+'))';return getZohoUser(_0x11c7b1,'Contacts')['then'](function(_0x5c5e1f){if(_0x5c5e1f)return _0x5c5e1f;_0x11c7b1[_0xb006('0x54')]=_0xb006('0x46')+_0x3641ea+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3075a2+'))';return getZohoUser(_0x11c7b1,_0xb006('0x55'))['then'](function(_0xd9bad3){if(_0xd9bad3)return _0xd9bad3;if(_0x17bd25[_0xb006('0x4e')]!=_0xb006('0x56')){return createEndUser(_0x53aa7f,_0x3641ea,_0x731898,_0x3075a2,_0x5aa2e4,_0x17bd25);}else{return{};}});});break;case _0xb006('0x57'):_0x11c7b1[_0xb006('0x54')]='https://www.zohoapis.'+_0x3641ea+_0xb006('0x53')+_0x3075a2+'))';return getZohoUser(_0x11c7b1,_0xb006('0x58'))[_0xb006('0x38')](function(_0x5977f6){if(_0x5977f6)return _0x5977f6;if(_0x17bd25['moduleCreate']!='nothing'){return createEndUser(_0x53aa7f,_0x3641ea,_0x731898,_0x3075a2,_0x5aa2e4,_0x17bd25);}else{return{};}});break;case _0xb006('0x59'):_0x11c7b1[_0xb006('0x54')]=_0xb006('0x46')+_0x3641ea+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3075a2+'))';return getZohoUser(_0x11c7b1,_0xb006('0x55'))['then'](function(_0x3ea1af){if(_0x3ea1af)return _0x3ea1af;if(_0x17bd25[_0xb006('0x4e')]!='nothing'){return createEndUser(_0x53aa7f,_0x3641ea,_0x731898,_0x3075a2,_0x5aa2e4,_0x17bd25);}else{return{};}});break;}}function getCall(_0xaca449,_0x5909c1,_0x1bab22,_0xe64944,_0x1d2b26,_0x5ea3ba,_0x4aa539,_0x1b3bce){logger['info'](_0xb006('0x5a'));var _0x23d4ca={};_0x23d4ca[_0xb006('0x5b')]={'name':!_['isNil'](_0xe64944['role'][_0xb006('0x1d')])&&!_[_0xb006('0x3a')](_0xe64944['profile'][_0xb006('0x1d')])&&_0xe64944[_0xb006('0x41')][_0xb006('0x1d')]==='administrator'?_0xe64944[_0xb006('0x49')][_0xb006('0x1d')]:!_['isNil'](_0xe64944[_0xb006('0x4a')])?_0xe64944[_0xb006('0x4a')]+'\x20'+_0xe64944[_0xb006('0x4b')]:_0xe64944[_0xb006('0x4b')],'id':_0xe64944['id']};_0x23d4ca[_0xb006('0x5c')]=intUtil[_0xb006('0x5d')](_0x5ea3ba[_0xb006('0x5e')],_0x4aa539,'\x20');_0x23d4ca['Description']=intUtil[_0xb006('0x5d')](_0x5ea3ba['Descriptions'],_0x4aa539,'\x0a');if(_0x1d2b26[_0xb006('0x45')]===_0xb006('0x58')){_0x23d4ca[_0xb006('0x5f')]={'name':!_[_0xb006('0x3a')](_0x1d2b26[_0xb006('0x60')])?_0x1d2b26[_0xb006('0x60')]:!_['isNil'](_0x1d2b26['First_Name'])?_0x1d2b26[_0xb006('0x61')]+'\x20'+_0x1d2b26[_0xb006('0x62')]:_0x1d2b26[_0xb006('0x62')],'id':_0x1d2b26['id']};}if(_0x1d2b26[_0xb006('0x45')]==='Leads'){_0x23d4ca[_0xb006('0x63')]={'name':!_[_0xb006('0x3a')](_0x1d2b26[_0xb006('0x60')])?_0x1d2b26[_0xb006('0x60')]:!_['isNil'](_0x1d2b26['First_Name'])?_0x1d2b26[_0xb006('0x61')]+'\x20'+_0x1d2b26[_0xb006('0x62')]:_0x1d2b26[_0xb006('0x62')],'id':_0x1d2b26['id']};_0x23d4ca[_0xb006('0x64')]=_[_0xb006('0x48')](_0x1d2b26['enduserType']);}if(_0x4aa539[_0xb006('0x65')]){_0x23d4ca[_0xb006('0x66')]=moment[_0xb006('0x67')](parseInt(_0x4aa539[_0xb006('0x65')])*0x3e8)[_0xb006('0x68')](_0xb006('0x69'));}else if(_0x4aa539['answertime']&&_0x4aa539[_0xb006('0x6a')]){_0x23d4ca[_0xb006('0x66')]=moment['utc'](moment(_0x4aa539[_0xb006('0x6a')],_0xb006('0x6b'))[_0xb006('0x6c')](moment(_0x4aa539[_0xb006('0x6d')],_0xb006('0x6b'))))[_0xb006('0x68')]('mm:ss');}switch(_0x4aa539['lastevent']){case'called':_0x23d4ca[_0xb006('0x6e')]=_0xb006('0x6f');break;case _0xb006('0x70'):case _0xb006('0x71'):_0x23d4ca[_0xb006('0x6e')]='Answered';break;case'rejected':_0x23d4ca[_0xb006('0x6e')]=_0xb006('0x72');break;case'abandoned':_0x23d4ca[_0xb006('0x6e')]=_0xb006('0x73');break;case _0xb006('0x74'):_0x23d4ca['Call_Result']='Timeout';default:}_0x23d4ca[_0xb006('0x75')]=(_0x1b3bce===_0xb006('0x76')?moment(_0x4aa539[_0xb006('0x6d')])[_0xb006('0x68')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4aa539[_0xb006('0x77')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xb006('0x68')]('YYYY-MM-DDTHH:mm:ss');_0x23d4ca['Call_Type']=_0x1b3bce||_0xb006('0x78');_0x23d4ca=_[_0xb006('0x79')](_0x23d4ca,getCustomFields(_0x5ea3ba['Fields'],_0x4aa539));return request({'method':_0xb006('0x29'),'uri':_0xb006('0x46')+_0x5909c1+_0xb006('0x7a'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xaca449},'body':{'data':[_0x23d4ca]},'json':!![]})[_0xb006('0x38')](function(_0x50167a){if(_0x50167a&&_0x50167a[_0xb006('0x44')][0x0][_0xb006('0x4c')]===_0xb006('0x7b')){logger['info'](_0xb006('0x7c'));return{'id':_0x50167a['data'][0x0]['details']['id']};}})[_0xb006('0x30')](function(_0x5a3238){logger[_0xb006('0x33')](_0xb006('0x7d'),_0x5a3238[_0xb006('0x32')]);console[_0xb006('0x7e')](_0xb006('0x7d'),_0x5a3238);});}exports['queue']=function(_0x329b34,_0x1615e7,_0x35501d,_0x3e94c7,_0x10ea75,_0x479a0a){var _0x137222,_0x2bba17,_0x4a53cd;_0x479a0a['host']=intUtil[_0xb006('0x7f')](_0x479a0a[_0xb006('0x80')]);_0x479a0a[_0xb006('0x81')]=intUtil[_0xb006('0x7f')](_0x479a0a[_0xb006('0x81')]);if(_0x10ea75&&_0x10ea75['monitor_format']){logger[_0xb006('0x33')](_0xb006('0x82'),_0xb006('0x83'));_0x1615e7[_0xb006('0x84')]=_0x479a0a[_0xb006('0x81')]+_0xb006('0x85')+_0x1615e7['uniqueid']+_0xb006('0x86')+md5(_0x1615e7[_0xb006('0x87')]);}else{_0x1615e7[_0xb006('0x84')]='';}var _0x43eb5d=_0x479a0a[_0xb006('0x80')]==='zoho.eu'?'eu':_0xb006('0x88');return getAccessToken(_0x479a0a)[_0xb006('0x38')](function(_0x346ae2){_0x4a53cd=_0x346ae2;return getUser(_0x4a53cd,_0x43eb5d,_0x479a0a,_0x3e94c7[_0xb006('0x3c')]);})[_0xb006('0x38')](function(_0x2106f5){_0x137222=_0x2106f5;logger['info'](_0xb006('0x89'),_0x137222['id']);return getEndUser(_0x4a53cd,_0x43eb5d,_0x479a0a,_0x1615e7[_0xb006('0x8a')],_0x1615e7['calleridnum'],_0x137222,_0x35501d);})[_0xb006('0x38')](function(_0x4bde49){_0x2bba17=_0x4bde49;return getCall(_0x4a53cd,_0x43eb5d,_0x479a0a,_0x137222,_0x2bba17,_0x35501d,_0x1615e7,_0xb006('0x78'));})[_0xb006('0x38')](function(_0x125a95){if(_0x125a95){logger[_0xb006('0x33')](_0xb006('0x8b'),_0x125a95['id']);logger['info']('[QUEUE]',_0xb006('0x8c'));emit(util[_0xb006('0x68')](_0xb006('0x8d'),_0x3e94c7[_0xb006('0x1d')]),_0xb006('0x8e'),{'uri':_0xb006('0x8f')+_0x479a0a[_0xb006('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x125a95['id']});}})[_0xb006('0x30')](function(_0x208323){logger[_0xb006('0x31')](_0xb006('0x82'),JSON[_0xb006('0x10')](_0x208323));});};exports[_0xb006('0x76')]=function(_0x26ea54,_0x45d6f7,_0x3d6d01,_0x8065a3,_0x2a3082,_0x16ae45,_0x493b63){var _0x513726,_0x5c6dd0,_0x218dc0;_0x16ae45[_0xb006('0x80')]=intUtil[_0xb006('0x7f')](_0x16ae45[_0xb006('0x80')]);_0x16ae45[_0xb006('0x81')]=intUtil[_0xb006('0x7f')](_0x16ae45[_0xb006('0x81')]);if(_0x493b63&&_0x493b63[_0xb006('0x90')]&&_0x493b63[_0xb006('0x90')]!=='none'){logger[_0xb006('0x33')]('[OUTBOUND]',_0xb006('0x83'));_0x45d6f7[_0xb006('0x84')]=_0x16ae45[_0xb006('0x81')]+_0xb006('0x85')+_0x45d6f7['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x45d6f7[_0xb006('0x87')]);}var _0x3ebb07=_0x16ae45[_0xb006('0x80')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x16ae45)[_0xb006('0x38')](function(_0x27c517){_0x218dc0=_0x27c517;return getUser(_0x218dc0,_0x3ebb07,_0x16ae45,_0x8065a3[_0xb006('0x3c')]);})[_0xb006('0x38')](function(_0x5eca9e){_0x513726=_0x5eca9e;logger[_0xb006('0x33')]('The\x20User\x20ID\x20is:',_0x513726['id']);return getEndUser(_0x218dc0,_0x3ebb07,_0x16ae45,_0x45d6f7[_0xb006('0x91')],_0x45d6f7['destcalleridnum'],_0x513726,_0x3d6d01);})['then'](function(_0x443138){_0x5c6dd0=_0x443138;return getCall(_0x218dc0,_0x3ebb07,_0x16ae45,_0x513726,_0x5c6dd0,_0x3d6d01,_0x45d6f7,_0xb006('0x92'));})[_0xb006('0x38')](function(_0x5b9d49){if(_0x5b9d49){logger[_0xb006('0x33')]('The\x20Call\x20ID\x20is:',_0x5b9d49['id']);logger['info'](_0xb006('0x93'),_0xb006('0x8c'));emit(util['format'](_0xb006('0x8d'),_0x8065a3[_0xb006('0x1d')]),_0xb006('0x8e'),{'uri':_0xb006('0x8f')+_0x16ae45[_0xb006('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5b9d49['id']});}})[_0xb006('0x30')](function(_0x353ab1){logger[_0xb006('0x31')](_0xb006('0x93'),JSON[_0xb006('0x10')](_0x353ab1));});};exports['unmanaged']=function(_0x268fcc,_0x160aea,_0x250f01,_0x512491,_0x58c014,_0x5f2496){var _0x1ba8b8,_0x370e27,_0x8dae87;_0x5f2496[_0xb006('0x80')]=intUtil[_0xb006('0x7f')](_0x5f2496[_0xb006('0x80')]);_0x5f2496['serverUrl']=intUtil[_0xb006('0x7f')](_0x5f2496[_0xb006('0x81')]);if(_0x58c014&&_0x58c014['monitor_format']){logger['info']('['+_0x160aea[_0xb006('0x94')][_0xb006('0x95')]()+']',_0xb006('0x83'));_0x160aea['recordingURL']=_0x5f2496[_0xb006('0x81')]+_0xb006('0x85')+_0x160aea[_0xb006('0x87')]+_0xb006('0x86')+md5(_0x160aea['uniqueid']);}else{_0x160aea['recordingURL']='';}var _0x252aff=_0x5f2496[_0xb006('0x80')]===_0xb006('0x96')?'eu':_0xb006('0x88');return getAccessToken(_0x5f2496)[_0xb006('0x38')](function(_0x395971){_0x8dae87=_0x395971;return getUser(_0x8dae87,_0x252aff,_0x5f2496);})[_0xb006('0x38')](function(_0x22a446){_0x1ba8b8=_0x22a446;logger[_0xb006('0x33')](_0xb006('0x89'),_0x1ba8b8['id']);return getEndUser(_0x8dae87,_0x252aff,_0x5f2496,_0x160aea[_0xb006('0x8a')],_0x160aea[_0xb006('0x97')],_0x1ba8b8,_0x250f01);})['then'](function(_0x313eb3){_0x370e27=_0x313eb3;return getCall(_0x8dae87,_0x252aff,_0x5f2496,_0x1ba8b8,_0x370e27,_0x250f01,_0x160aea,'Inbound');})['then'](function(_0x218683){if(_0x218683){logger[_0xb006('0x33')]('The\x20Call\x20ID\x20is:',_0x218683['id']);}})[_0xb006('0x30')](function(_0x54efa0){logger['error']('['+_0x160aea[_0xb006('0x94')][_0xb006('0x95')]()+']',JSON[_0xb006('0x10')](_0x54efa0));});};
\ No newline at end of file
+var _0xf882=['picklist','type','idField','content','toString','variableName','customVariable','name','toLowerCase','Variable','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','refreshToken','clientId','refresh_token','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','Zoho-oauthtoken\x20','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...','Owner','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','Call_Duration','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','host','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/api/voice/recordings/','zoho.eu','destcalleridnum','Outbound','unmanaged','lastevent','lodash','request-promise','md5','util','./util','../../../../config/logger','zoho','redis','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string'];(function(_0x1ccfc8,_0x247244){var _0x41350b=function(_0x1803e0){while(--_0x1803e0){_0x1ccfc8['push'](_0x1ccfc8['shift']());}};_0x41350b(++_0x247244);}(_0xf882,0x114));var _0x2f88=function(_0x38854d,_0x5bdc2c){_0x38854d=_0x38854d-0x0;var _0x4441aa=_0xf882[_0x38854d];return _0x4441aa;};'use strict';var _=require(_0x2f88('0x0'));var rp=require(_0x2f88('0x1'));var md5=require(_0x2f88('0x2'));var util=require(_0x2f88('0x3'));var intUtil=require(_0x2f88('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x2f88('0x5'))(_0x2f88('0x6'));config[_0x2f88('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2f88('0x8'))(new Redis(config[_0x2f88('0x7')]));function emit(_0x8bb8b6,_0x5277db,_0x3f545d){io['to'](_0x8bb8b6)[_0x2f88('0x9')](_0x5277db,_0x3f545d);}function request(_0x2868b0){logger[_0x2f88('0xa')]('[HTTP]',JSON[_0x2f88('0xb')](_0x2868b0));return rp(_0x2868b0);}function getCustomFields(_0x21cd84,_0x9464a4){var _0x42667e={};if(_0x21cd84[_0x2f88('0xc')]>0x0){_[_0x2f88('0xd')](_0x21cd84,function(_0x115aa3){if(_[_0x2f88('0xe')]([_0x2f88('0xf'),_0x2f88('0x10')],_0x115aa3[_0x2f88('0x11')])&&_0x115aa3[_0x2f88('0x12')]){_0x42667e[_0x115aa3['idField']]=_0x115aa3[_0x2f88('0x13')][_0x2f88('0x14')]();}else if(_0x115aa3['type']==='variable'&&_0x115aa3[_0x2f88('0x15')]&&_0x115aa3[_0x2f88('0x12')]&&_0x9464a4[_0x115aa3[_0x2f88('0x15')]]){_0x42667e[_0x115aa3['idField']]=_0x9464a4[_0x115aa3[_0x2f88('0x15')]][_0x2f88('0x14')]();}else if(_0x115aa3[_0x2f88('0x11')]===_0x2f88('0x16')&&_0x115aa3['Variable']&&_0x115aa3['Variable'][_0x2f88('0x17')]&&_0x115aa3[_0x2f88('0x12')]&&_0x9464a4[_0x115aa3['Variable']['name'][_0x2f88('0x18')]()]){_0x42667e[_0x115aa3[_0x2f88('0x12')]]=_0x9464a4[_0x115aa3[_0x2f88('0x19')]['name']['toLowerCase']()][_0x2f88('0x14')]();}});}return _0x42667e;}function getName(_0x75c7c3){if(_0x75c7c3[_0x2f88('0x1a')]('\x20')>0x0){var _0x165532=_0x75c7c3[_0x2f88('0x1b')](/ (.+)/);if(_0x165532[0x1]){return _0x165532;}}return[_0x75c7c3,_0x75c7c3];}var accountsTokens={};function getAccessToken(_0xd87615){return new Promise(function(_0x4445a9,_0x47d312){if(!_[_0x2f88('0x1c')](accountsTokens[_0xd87615['id']])&&!_[_0x2f88('0x1c')](accountsTokens[_0xd87615['id']][_0x2f88('0x1d')])){if(moment()[_0x2f88('0x1e')](accountsTokens[_0xd87615['id']]['expires_in'])){_0x4445a9(accountsTokens[_0xd87615['id']][_0x2f88('0x1d')]);}}var _0x24a5ff;switch(_0xd87615['zone']){case'US':_0x24a5ff=_0x2f88('0x1f');break;case'AU':_0x24a5ff=_0x2f88('0x20');break;case'EU':_0x24a5ff='https://accounts.zoho.eu';break;case'IN':_0x24a5ff=_0x2f88('0x21');break;case'CN':_0x24a5ff='https://accounts.zoho.com.cn';break;default:_0x24a5ff='https://accounts.zoho.eu';break;}var _0x5cc069={'method':_0x2f88('0x22'),'uri':_0x24a5ff+'/oauth/v2/token','qs':{'refresh_token':_0xd87615[_0x2f88('0x23')],'client_id':_0xd87615[_0x2f88('0x24')],'client_secret':_0xd87615['clientSecret'],'grant_type':_0x2f88('0x25')},'json':!![]};return rp(_0x5cc069)[_0x2f88('0x26')](function(_0x5c2297){accountsTokens[_0xd87615['id']]={'access_token':_0x5c2297[_0x2f88('0x1d')],'expires_in':moment()['add'](_0x5c2297[_0x2f88('0x27')],_0x2f88('0x28'))};_0x4445a9(_0x5c2297[_0x2f88('0x1d')]);})[_0x2f88('0x29')](function(_0x2584ce){logger[_0x2f88('0x2a')](_0x2f88('0x2b'),_0x2584ce[_0x2f88('0x2c')]);_0x47d312(_0x2584ce);});});}function getUser(_0x3e02a2,_0x2b5aa5,_0x171e4f,_0x2ba990){logger[_0x2f88('0x2d')](_0x2f88('0x2e'));return request({'method':_0x2f88('0x2f'),'uri':util[_0x2f88('0x30')](_0x2f88('0x31'),_0x2b5aa5),'qs':{'type':_0x2f88('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3e02a2},'json':!![]})[_0x2f88('0x26')](function(_0x24c662){if(_0x24c662[_0x2f88('0x33')]){var _0x416fca=-0x1;if(_['isArrayLikeObject'](_0x24c662[_0x2f88('0x33')])){if(!_[_0x2f88('0x1c')](_0x2ba990)){_0x416fca=_['findIndex'](_0x24c662[_0x2f88('0x33')],function(_0x50d059){return _0x50d059[_0x2f88('0x34')]===_0x2ba990;});}if(_0x416fca>=0x0){logger[_0x2f88('0x2d')](_0x2f88('0x35'));}else{logger[_0x2f88('0x2d')](_0x2f88('0x36'));_0x416fca=_[_0x2f88('0x37')](_0x24c662[_0x2f88('0x33')],function(_0x2a7acb){return _0x2a7acb[_0x2f88('0x38')][_0x2f88('0x17')]===_0x2f88('0x39');});}return _0x24c662[_0x2f88('0x33')][_0x416fca];}else{if(_0x24c662[_0x2f88('0x3a')][_0x2f88('0x38')]['name']===_0x2f88('0x39')){logger[_0x2f88('0x2d')](_0x2f88('0x36'));user=_0x24c662[_0x2f88('0x3a')];return user;}else{logger[_0x2f88('0x2a')](_0x2f88('0x3b'),JSON[_0x2f88('0xb')](_0x24c662));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2f88('0xb')](_0x24c662));}}}else{logger[_0x2f88('0x2a')](_0x2f88('0x3b'),JSON[_0x2f88('0xb')](_0x24c662));throw new Error(_0x2f88('0x3c')+JSON[_0x2f88('0xb')](_0x24c662));}})[_0x2f88('0x29')](function(_0x3ec281){console[_0x2f88('0x2a')](_0x3ec281);});}function getZohoUser(_0x2cb02b,_0x48d896){return new BPromise(function(_0x586ea6,_0x48f07c){request(_0x2cb02b)[_0x2f88('0x26')](function(_0x54f57e){var _0x12b592=null;if(_0x54f57e){_0x12b592=_0x54f57e[_0x2f88('0x3d')][0x0];_0x12b592[_0x2f88('0x3e')]=_0x48d896;}_0x586ea6(_0x12b592);})[_0x2f88('0x29')](function(_0x109761){_0x48f07c(_0x109761);});});}function createEndUser(_0x319197,_0x5e48e4,_0xcb5078,_0x459049,_0x907c59,_0xbfe4bc){var _0xcb5078=getName(_0xcb5078);return request({'method':_0x2f88('0x22'),'uri':_0x2f88('0x3f')+_0x5e48e4+'/crm/v2/'+_['startCase'](_0xbfe4bc[_0x2f88('0x40')])+'s','body':{'data':[{'Last_Name':_0xcb5078[0x1],'First_Name':_0xcb5078[0x0],'Phone':_0x459049,'Owner':{'name':!_[_0x2f88('0x1c')](_0x907c59[_0x2f88('0x41')]['name'])?_0x907c59[_0x2f88('0x41')][_0x2f88('0x17')]:!_[_0x2f88('0x1c')](_0x907c59[_0x2f88('0x42')])?_0x907c59['first_name']+'\x20'+_0x907c59['last_name']:_0x907c59[_0x2f88('0x43')],'id':_0x907c59['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x319197},'json':!![]})[_0x2f88('0x26')](function(_0x321403){if(_0x321403&&_0x321403[_0x2f88('0x3d')][0x0][_0x2f88('0x44')]===_0x2f88('0x45')){var _0xdc86d3=_0x321403[_0x2f88('0x3d')][0x0][_0x2f88('0x46')];_0xdc86d3[_0x2f88('0x3e')]=_[_0x2f88('0x47')](_0xbfe4bc['moduleCreate'])+'s';return _0xdc86d3;}logger[_0x2f88('0x2a')](_0x2f88('0x3b'),JSON['stringify'](data));throw new Error(_0x2f88('0x48')+JSON[_0x2f88('0xb')](data));})[_0x2f88('0x29')](function(_0x5f44b6){console['log'](_0x2f88('0x49'),_0x5f44b6);});}function getEndUser(_0x57a019,_0x512d3d,_0x1d332c,_0x5ae3fd,_0x214c29,_0x26747c,_0x39d810){var _0x84b4dd={'method':_0x2f88('0x2f'),'uri':'','headers':{'Authorization':_0x2f88('0x4a')+_0x57a019},'json':!![]};switch(_0x39d810[_0x2f88('0x4b')]){case _0x2f88('0x4c'):_0x84b4dd[_0x2f88('0x4d')]='https://www.zohoapis.'+_0x512d3d+_0x2f88('0x4e')+_0x214c29+'))';return getZohoUser(_0x84b4dd,_0x2f88('0x4f'))['then'](function(_0x4c7720){if(_0x4c7720)return _0x4c7720;_0x84b4dd[_0x2f88('0x4d')]=_0x2f88('0x3f')+_0x512d3d+_0x2f88('0x50')+_0x214c29+'))';return getZohoUser(_0x84b4dd,_0x2f88('0x51'))[_0x2f88('0x26')](function(_0x4f5fb2){if(_0x4f5fb2)return _0x4f5fb2;if(_0x39d810[_0x2f88('0x40')]!=_0x2f88('0x52')){return createEndUser(_0x57a019,_0x512d3d,_0x5ae3fd,_0x214c29,_0x26747c,_0x39d810);}else{return{};}});});break;case _0x2f88('0x53'):_0x84b4dd['uri']=_0x2f88('0x3f')+_0x512d3d+_0x2f88('0x4e')+_0x214c29+'))';return getZohoUser(_0x84b4dd,'Contacts')[_0x2f88('0x26')](function(_0x404809){if(_0x404809)return _0x404809;if(_0x39d810[_0x2f88('0x40')]!=_0x2f88('0x52')){return createEndUser(_0x57a019,_0x512d3d,_0x5ae3fd,_0x214c29,_0x26747c,_0x39d810);}else{return{};}});break;case _0x2f88('0x54'):_0x84b4dd[_0x2f88('0x4d')]=_0x2f88('0x3f')+_0x512d3d+_0x2f88('0x50')+_0x214c29+'))';return getZohoUser(_0x84b4dd,_0x2f88('0x51'))['then'](function(_0x3f4888){if(_0x3f4888)return _0x3f4888;if(_0x39d810[_0x2f88('0x40')]!=_0x2f88('0x52')){return createEndUser(_0x57a019,_0x512d3d,_0x5ae3fd,_0x214c29,_0x26747c,_0x39d810);}else{return{};}});break;}}function getCall(_0x5e5a34,_0x54899d,_0x40098f,_0x567736,_0x182aa6,_0x1232b6,_0x5a3db6,_0x2f524f){logger[_0x2f88('0x2d')](_0x2f88('0x55'));var _0x1bc68b={};_0x1bc68b[_0x2f88('0x56')]={'name':!_[_0x2f88('0x1c')](_0x567736[_0x2f88('0x41')][_0x2f88('0x17')])&&!_['isNil'](_0x567736[_0x2f88('0x38')][_0x2f88('0x17')])&&_0x567736[_0x2f88('0x38')]['name']==='administrator'?_0x567736[_0x2f88('0x41')][_0x2f88('0x17')]:!_[_0x2f88('0x1c')](_0x567736[_0x2f88('0x42')])?_0x567736[_0x2f88('0x42')]+'\x20'+_0x567736[_0x2f88('0x43')]:_0x567736[_0x2f88('0x43')],'id':_0x567736['id']};_0x1bc68b[_0x2f88('0x57')]=intUtil[_0x2f88('0x58')](_0x1232b6['Subjects'],_0x5a3db6,'\x20');_0x1bc68b[_0x2f88('0x59')]=intUtil[_0x2f88('0x58')](_0x1232b6[_0x2f88('0x5a')],_0x5a3db6,'\x0a');if(_0x182aa6['enduserType']==='Contacts'){_0x1bc68b['Who_Id']={'name':!_['isNil'](_0x182aa6[_0x2f88('0x5b')])?_0x182aa6['Full_Name']:!_[_0x2f88('0x1c')](_0x182aa6[_0x2f88('0x5c')])?_0x182aa6[_0x2f88('0x5c')]+'\x20'+_0x182aa6['Last_Name']:_0x182aa6['Last_Name'],'id':_0x182aa6['id']};}if(_0x182aa6[_0x2f88('0x3e')]===_0x2f88('0x51')){_0x1bc68b['What_Id']={'name':!_[_0x2f88('0x1c')](_0x182aa6[_0x2f88('0x5b')])?_0x182aa6[_0x2f88('0x5b')]:!_[_0x2f88('0x1c')](_0x182aa6[_0x2f88('0x5c')])?_0x182aa6[_0x2f88('0x5c')]+'\x20'+_0x182aa6['Last_Name']:_0x182aa6[_0x2f88('0x5d')],'id':_0x182aa6['id']};_0x1bc68b['$se_module']=_[_0x2f88('0x47')](_0x182aa6[_0x2f88('0x3e')]);}if(_0x5a3db6['talktime']){_0x1bc68b[_0x2f88('0x5e')]=moment['utc'](parseInt(_0x5a3db6[_0x2f88('0x5f')])*0x3e8)[_0x2f88('0x30')](_0x2f88('0x60'));}else if(_0x5a3db6[_0x2f88('0x61')]&&_0x5a3db6[_0x2f88('0x62')]){_0x1bc68b['Call_Duration']=moment['utc'](moment(_0x5a3db6[_0x2f88('0x62')],_0x2f88('0x63'))['diff'](moment(_0x5a3db6[_0x2f88('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0x2f88('0x30')](_0x2f88('0x60'));}switch(_0x5a3db6['lastevent']){case _0x2f88('0x65'):_0x1bc68b['Call_Result']=_0x2f88('0x66');break;case _0x2f88('0x67'):case _0x2f88('0x68'):_0x1bc68b[_0x2f88('0x69')]=_0x2f88('0x6a');break;case _0x2f88('0x6b'):_0x1bc68b['Call_Result']=_0x2f88('0x6c');break;case _0x2f88('0x6d'):_0x1bc68b['Call_Result']=_0x2f88('0x6e');break;case'timeout':_0x1bc68b['Call_Result']=_0x2f88('0x6f');default:}_0x1bc68b[_0x2f88('0x70')]=(_0x2f524f===_0x2f88('0x71')?moment(_0x5a3db6[_0x2f88('0x64')])[_0x2f88('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5a3db6['agentcalledAt'])[_0x2f88('0x30')](_0x2f88('0x63')))||moment()[_0x2f88('0x30')](_0x2f88('0x63'));_0x1bc68b[_0x2f88('0x72')]=_0x2f524f||_0x2f88('0x73');_0x1bc68b=_[_0x2f88('0x74')](_0x1bc68b,getCustomFields(_0x1232b6[_0x2f88('0x75')],_0x5a3db6));return request({'method':'POST','uri':_0x2f88('0x3f')+_0x54899d+_0x2f88('0x76'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5e5a34},'body':{'data':[_0x1bc68b]},'json':!![]})[_0x2f88('0x26')](function(_0x2af870){if(_0x2af870&&_0x2af870[_0x2f88('0x3d')][0x0][_0x2f88('0x44')]===_0x2f88('0x45')){logger['info']('Call\x20created!');return{'id':_0x2af870[_0x2f88('0x3d')][0x0][_0x2f88('0x46')]['id']};}})[_0x2f88('0x29')](function(_0x1e2878){logger[_0x2f88('0x2d')](_0x2f88('0x77'),_0x1e2878[_0x2f88('0x2c')]);console['log'](_0x2f88('0x77'),_0x1e2878);});}exports['queue']=function(_0x8c8ed1,_0x5f13bc,_0x2b0028,_0x39dcb4,_0x589028,_0x47256f){var _0x190438,_0x4f9332,_0xf52f25;_0x47256f['host']=intUtil['stripTrailingSlash'](_0x47256f['host']);_0x47256f['serverUrl']=intUtil[_0x2f88('0x78')](_0x47256f[_0x2f88('0x79')]);if(_0x589028&&_0x589028['monitor_format']){logger[_0x2f88('0x2d')](_0x2f88('0x7a'),_0x2f88('0x7b'));_0x5f13bc[_0x2f88('0x7c')]=_0x47256f[_0x2f88('0x79')]+'/api/voice/recordings/'+_0x5f13bc[_0x2f88('0x7d')]+_0x2f88('0x7e')+md5(_0x5f13bc[_0x2f88('0x7d')]);}else{_0x5f13bc[_0x2f88('0x7c')]='';}var _0x34e3a3=_0x47256f[_0x2f88('0x7f')]==='zoho.eu'?'eu':_0x2f88('0x80');return getAccessToken(_0x47256f)[_0x2f88('0x26')](function(_0x2fef10){_0xf52f25=_0x2fef10;return getUser(_0xf52f25,_0x34e3a3,_0x47256f,_0x39dcb4[_0x2f88('0x34')]);})[_0x2f88('0x26')](function(_0x358909){_0x190438=_0x358909;logger[_0x2f88('0x2d')](_0x2f88('0x81'),_0x190438['id']);return getEndUser(_0xf52f25,_0x34e3a3,_0x47256f,_0x5f13bc[_0x2f88('0x82')],_0x5f13bc[_0x2f88('0x83')],_0x190438,_0x2b0028);})['then'](function(_0x3df89c){_0x4f9332=_0x3df89c;return getCall(_0xf52f25,_0x34e3a3,_0x47256f,_0x190438,_0x4f9332,_0x2b0028,_0x5f13bc,_0x2f88('0x73'));})[_0x2f88('0x26')](function(_0x1b5690){if(_0x1b5690){logger[_0x2f88('0x2d')](_0x2f88('0x84'),_0x1b5690['id']);logger[_0x2f88('0x2d')]('[QUEUE]',_0x2f88('0x85'));emit(util[_0x2f88('0x30')](_0x2f88('0x86'),_0x39dcb4[_0x2f88('0x17')]),_0x2f88('0x87'),{'uri':_0x2f88('0x88')+_0x47256f['host']+_0x2f88('0x89')+_0x1b5690['id']});}})[_0x2f88('0x29')](function(_0x22e038){logger[_0x2f88('0x2a')](_0x2f88('0x7a'),JSON[_0x2f88('0xb')](_0x22e038));});};exports[_0x2f88('0x71')]=function(_0x11a1e8,_0x2b0b9e,_0x3335ac,_0x4e0a01,_0x24f0db,_0x521819,_0x5bb158){var _0x185ce8,_0x10c3d2,_0xdc694a;_0x521819['host']=intUtil[_0x2f88('0x78')](_0x521819[_0x2f88('0x7f')]);_0x521819[_0x2f88('0x79')]=intUtil['stripTrailingSlash'](_0x521819['serverUrl']);if(_0x5bb158&&_0x5bb158[_0x2f88('0x8a')]&&_0x5bb158[_0x2f88('0x8a')]!=='none'){logger['info'](_0x2f88('0x8b'),_0x2f88('0x7b'));_0x2b0b9e[_0x2f88('0x7c')]=_0x521819[_0x2f88('0x79')]+_0x2f88('0x8c')+_0x2b0b9e['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2b0b9e['uniqueid']);}var _0x56c68c=_0x521819[_0x2f88('0x7f')]===_0x2f88('0x8d')?'eu':_0x2f88('0x80');return getAccessToken(_0x521819)[_0x2f88('0x26')](function(_0x26ad44){_0xdc694a=_0x26ad44;return getUser(_0xdc694a,_0x56c68c,_0x521819,_0x4e0a01['email']);})[_0x2f88('0x26')](function(_0x25b69b){_0x185ce8=_0x25b69b;logger[_0x2f88('0x2d')](_0x2f88('0x81'),_0x185ce8['id']);return getEndUser(_0xdc694a,_0x56c68c,_0x521819,_0x2b0b9e['destcalleridname'],_0x2b0b9e[_0x2f88('0x8e')],_0x185ce8,_0x3335ac);})[_0x2f88('0x26')](function(_0x3389c5){_0x10c3d2=_0x3389c5;return getCall(_0xdc694a,_0x56c68c,_0x521819,_0x185ce8,_0x10c3d2,_0x3335ac,_0x2b0b9e,_0x2f88('0x8f'));})[_0x2f88('0x26')](function(_0x241096){if(_0x241096){logger['info'](_0x2f88('0x84'),_0x241096['id']);logger[_0x2f88('0x2d')]('[OUTBOUND]',_0x2f88('0x85'));emit(util[_0x2f88('0x30')](_0x2f88('0x86'),_0x4e0a01[_0x2f88('0x17')]),_0x2f88('0x87'),{'uri':_0x2f88('0x88')+_0x521819[_0x2f88('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x241096['id']});}})[_0x2f88('0x29')](function(_0x3423d4){logger[_0x2f88('0x2a')]('[OUTBOUND]',JSON[_0x2f88('0xb')](_0x3423d4));});};exports[_0x2f88('0x90')]=function(_0x4589e6,_0x3ebf5d,_0x1281bf,_0x48beb1,_0x1817e4,_0x5adbd8){var _0x39eb08,_0x2f3729,_0x493e85;_0x5adbd8[_0x2f88('0x7f')]=intUtil[_0x2f88('0x78')](_0x5adbd8[_0x2f88('0x7f')]);_0x5adbd8[_0x2f88('0x79')]=intUtil['stripTrailingSlash'](_0x5adbd8[_0x2f88('0x79')]);if(_0x1817e4&&_0x1817e4['monitor_format']){logger[_0x2f88('0x2d')]('['+_0x3ebf5d[_0x2f88('0x91')]['toUpperCase']()+']',_0x2f88('0x7b'));_0x3ebf5d[_0x2f88('0x7c')]=_0x5adbd8[_0x2f88('0x79')]+_0x2f88('0x8c')+_0x3ebf5d[_0x2f88('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x3ebf5d['uniqueid']);}else{_0x3ebf5d['recordingURL']='';}var _0xe4fa4b=_0x5adbd8[_0x2f88('0x7f')]===_0x2f88('0x8d')?'eu':'com';return getAccessToken(_0x5adbd8)[_0x2f88('0x26')](function(_0x4dde50){_0x493e85=_0x4dde50;return getUser(_0x493e85,_0xe4fa4b,_0x5adbd8);})[_0x2f88('0x26')](function(_0xa359af){_0x39eb08=_0xa359af;logger[_0x2f88('0x2d')]('The\x20User\x20ID\x20is:',_0x39eb08['id']);return getEndUser(_0x493e85,_0xe4fa4b,_0x5adbd8,_0x3ebf5d[_0x2f88('0x82')],_0x3ebf5d[_0x2f88('0x83')],_0x39eb08,_0x1281bf);})[_0x2f88('0x26')](function(_0x149b6c){_0x2f3729=_0x149b6c;return getCall(_0x493e85,_0xe4fa4b,_0x5adbd8,_0x39eb08,_0x2f3729,_0x1281bf,_0x3ebf5d,_0x2f88('0x73'));})[_0x2f88('0x26')](function(_0x366e9c){if(_0x366e9c){logger[_0x2f88('0x2d')](_0x2f88('0x84'),_0x366e9c['id']);}})[_0x2f88('0x29')](function(_0x128402){logger['error']('['+_0x3ebf5d[_0x2f88('0x91')]['toUpperCase']()+']',JSON['stringify'](_0x128402));});};
\ No newline at end of file
index aa7f5f8..0496b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0148=['data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','Script'];(function(_0x4f386f,_0x127b74){var _0x35064f=function(_0x17ce9e){while(--_0x17ce9e){_0x4f386f['push'](_0x4f386f['shift']());}};_0x35064f(++_0x127b74);}(_0x0148,0x9f));var _0x8014=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0148[_0x4c12ec];return _0x3ae42c;};'use strict';var util=require(_0x8014('0x0'));var sh=require(_0x8014('0x1'));var Mustache=require(_0x8014('0x2'));var logger=require(_0x8014('0x3'))(_0x8014('0x4'));exports['exec']=function(_0x29816f,_0x231875){var _0x2cd451=_0x29816f['data2']?_0x29816f['data2']:_0x8014('0x5');var _0x4ab6d6=_0x29816f[_0x8014('0x6')]?Mustache[_0x8014('0x7')](_0x29816f[_0x8014('0x6')],_0x231875):_0x231875;sh['exec'](_0x4ab6d6,function(_0x95da55,_0x400da2,_0x51bbac){if(_0x95da55!==0x0){logger['error'](util[_0x8014('0x8')](_0x8014('0x9'),_0x2cd451,_0x4ab6d6,_0x95da55,_0x51bbac));}else{logger[_0x8014('0xa')](util[_0x8014('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2cd451,_0x4ab6d6,_0x400da2));}});};
\ No newline at end of file
+var _0x12f7=['exec','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'];(function(_0x290232,_0x1e8ebd){var _0x3b2a32=function(_0x2de30e){while(--_0x2de30e){_0x290232['push'](_0x290232['shift']());}};_0x3b2a32(++_0x1e8ebd);}(_0x12f7,0xcd));var _0x712f=function(_0x3c3dbc,_0x15baee){_0x3c3dbc=_0x3c3dbc-0x0;var _0x561a78=_0x12f7[_0x3c3dbc];return _0x561a78;};'use strict';var util=require(_0x712f('0x0'));var sh=require(_0x712f('0x1'));var Mustache=require(_0x712f('0x2'));var logger=require(_0x712f('0x3'))(_0x712f('0x4'));exports[_0x712f('0x5')]=function(_0x2fb4fe,_0x5572fa){var _0x55577d=_0x2fb4fe[_0x712f('0x6')]?_0x2fb4fe['data2']:_0x712f('0x7');var _0x513d3c=_0x2fb4fe[_0x712f('0x8')]?Mustache[_0x712f('0x9')](_0x2fb4fe[_0x712f('0x8')],_0x5572fa):_0x5572fa;sh[_0x712f('0x5')](_0x513d3c,function(_0x11b5dd,_0x14df9c,_0x291360){if(_0x11b5dd!==0x0){logger[_0x712f('0xa')](util[_0x712f('0xb')](_0x712f('0xc'),_0x55577d,_0x513d3c,_0x11b5dd,_0x291360));}else{logger['info'](util['format'](_0x712f('0xd'),_0x55577d,_0x513d3c,_0x14df9c));}});};
\ No newline at end of file
index 9ceb29e..00db1af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f0d=['data5','number','headers','parse','data6','error','stack','data1','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','request-promise','../../../../config/logger','trigger','exec','toUpperCase','render','data2'];(function(_0x7ea2b0,_0x23de91){var _0x5a56d3=function(_0x1b2d98){while(--_0x1b2d98){_0x7ea2b0['push'](_0x7ea2b0['shift']());}};_0x5a56d3(++_0x23de91);}(_0x4f0d,0xb3));var _0xd4f0=function(_0x23cc7d,_0x553e85){_0x23cc7d=_0x23cc7d-0x0;var _0x41abb3=_0x4f0d[_0x23cc7d];return _0x41abb3;};'use strict';var rp=require(_0xd4f0('0x0'));var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0xd4f0('0x1'))(_0xd4f0('0x2'));exports[_0xd4f0('0x3')]=function(_0x2747ae,_0x1b0297){var _0x55faac,_0x1ccf50;var _0xc3e066={'method':_0x2747ae['data1'][_0xd4f0('0x4')](),'uri':Mustache[_0xd4f0('0x5')](_0x2747ae[_0xd4f0('0x6')],_0x1b0297),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2747ae[_0xd4f0('0x7')])===_0xd4f0('0x8')&&parseInt(_0x2747ae[_0xd4f0('0x7')])>=0x1&&parseInt(_0x2747ae[_0xd4f0('0x7')])<=0xa?parseInt(_0x2747ae[_0xd4f0('0x7')])*0x3e8:0x5*0x3e8};try{_0xc3e066[_0xd4f0('0x9')]=_0x2747ae['data6']?JSON[_0xd4f0('0xa')](Mustache['render'](_0x2747ae[_0xd4f0('0xb')],_0x1b0297)):{};}catch(_0x484058){logger[_0xd4f0('0xc')](_0x484058[_0xd4f0('0xd')]);}switch(_0x2747ae[_0xd4f0('0xe')][_0xd4f0('0x4')]()){case _0xd4f0('0xf'):case _0xd4f0('0x10'):_0x55faac=null;_0xc3e066['qs']=_0x1b0297;break;case'POST':case _0xd4f0('0x11'):if(_0x2747ae['data7']){try{_0x55faac=JSON[_0xd4f0('0xa')](Mustache[_0xd4f0('0x5')](_0x2747ae[_0xd4f0('0x12')],_0x1b0297));_0xc3e066[_0xd4f0('0x13')]=_0x55faac;}catch(_0x47d958){logger[_0xd4f0('0xc')](_0x47d958[_0xd4f0('0xd')]);logger[_0xd4f0('0xc')](_0xd4f0('0x14'));}}else{_0x55faac=_0x1b0297;_0xc3e066[_0xd4f0('0x13')]=_0x55faac;}break;}logger[_0xd4f0('0x15')](util[_0xd4f0('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2747ae[_0xd4f0('0xe')],_0x2747ae[_0xd4f0('0x6')],JSON[_0xd4f0('0x17')](_0xc3e066)));rp(_0xc3e066)[_0xd4f0('0x18')](function(_0x531fc5){_0x55faac=!_[_0xd4f0('0x19')](_0x55faac)?_0xd4f0('0x1a')+_0x55faac:'';_0x1ccf50=typeof _0x531fc5[_0xd4f0('0x13')]===_0xd4f0('0x1b')?JSON['stringify'](_0x531fc5['body']):_0x531fc5[_0xd4f0('0x13')];logger[_0xd4f0('0x15')](util[_0xd4f0('0x16')](_0xd4f0('0x1c'),_0x2747ae[_0xd4f0('0xe')],_0x2747ae[_0xd4f0('0x6')],_0x531fc5[_0xd4f0('0x1d')],_0x1ccf50));})[_0xd4f0('0x1e')](function(_0x4c2b5e){logger['error'](util[_0xd4f0('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2747ae[_0xd4f0('0xe')],_0x2747ae[_0xd4f0('0x6')],_0x4c2b5e[_0xd4f0('0x1d')],_0x4c2b5e['name'],_0x4c2b5e['message']));});};
\ No newline at end of file
+var _0xa45f=['stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','stringify','isNil',',\x20request\x20body:\x20','object','info','%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','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','toUpperCase','render','data2','data5','headers','data6','error','data1','DELETE','POST','PUT','data7','parse'];(function(_0x31826a,_0x6a484f){var _0x3e5a6e=function(_0x9ca5e1){while(--_0x9ca5e1){_0x31826a['push'](_0x31826a['shift']());}};_0x3e5a6e(++_0x6a484f);}(_0xa45f,0x92));var _0xfa45=function(_0x34080b,_0x4405d7){_0x34080b=_0x34080b-0x0;var _0x4e47f2=_0xa45f[_0x34080b];return _0x4e47f2;};'use strict';var rp=require(_0xfa45('0x0'));var util=require(_0xfa45('0x1'));var _=require(_0xfa45('0x2'));var Mustache=require(_0xfa45('0x3'));var logger=require(_0xfa45('0x4'))(_0xfa45('0x5'));exports['exec']=function(_0x36145f,_0x3f7f8a){var _0xcde65a,_0x498088;var _0x41a796={'method':_0x36145f['data1'][_0xfa45('0x6')](),'uri':Mustache[_0xfa45('0x7')](_0x36145f[_0xfa45('0x8')],_0x3f7f8a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x36145f[_0xfa45('0x9')])==='number'&&parseInt(_0x36145f[_0xfa45('0x9')])>=0x1&&parseInt(_0x36145f[_0xfa45('0x9')])<=0xa?parseInt(_0x36145f['data5'])*0x3e8:0x5*0x3e8};try{_0x41a796[_0xfa45('0xa')]=_0x36145f['data6']?JSON['parse'](Mustache[_0xfa45('0x7')](_0x36145f[_0xfa45('0xb')],_0x3f7f8a)):{};}catch(_0x2f8384){logger[_0xfa45('0xc')](_0x2f8384['stack']);}switch(_0x36145f[_0xfa45('0xd')][_0xfa45('0x6')]()){case'GET':case _0xfa45('0xe'):_0xcde65a=null;_0x41a796['qs']=_0x3f7f8a;break;case _0xfa45('0xf'):case _0xfa45('0x10'):if(_0x36145f[_0xfa45('0x11')]){try{_0xcde65a=JSON[_0xfa45('0x12')](Mustache['render'](_0x36145f[_0xfa45('0x11')],_0x3f7f8a));_0x41a796['body']=_0xcde65a;}catch(_0x19622a){logger[_0xfa45('0xc')](_0x19622a[_0xfa45('0x13')]);logger[_0xfa45('0xc')](_0xfa45('0x14'));}}else{_0xcde65a=_0x3f7f8a;_0x41a796[_0xfa45('0x15')]=_0xcde65a;}break;}logger['info'](util[_0xfa45('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x36145f['data1'],_0x36145f['data2'],JSON[_0xfa45('0x17')](_0x41a796)));rp(_0x41a796)['then'](function(_0x277f1b){_0xcde65a=!_[_0xfa45('0x18')](_0xcde65a)?_0xfa45('0x19')+_0xcde65a:'';_0x498088=typeof _0x277f1b['body']===_0xfa45('0x1a')?JSON[_0xfa45('0x17')](_0x277f1b[_0xfa45('0x15')]):_0x277f1b[_0xfa45('0x15')];logger[_0xfa45('0x1b')](util['format'](_0xfa45('0x1c'),_0x36145f['data1'],_0x36145f[_0xfa45('0x8')],_0x277f1b[_0xfa45('0x1d')],_0x498088));})['catch'](function(_0x425d85){logger[_0xfa45('0xc')](util['format'](_0xfa45('0x1e'),_0x36145f[_0xfa45('0xd')],_0x36145f[_0xfa45('0x8')],_0x425d85[_0xfa45('0x1d')],_0x425d85[_0xfa45('0x1f')],_0x425d85[_0xfa45('0x20')]));});};
\ No newline at end of file
index 6b16b62..0af0025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ff=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','message'];(function(_0x5151e2,_0x160005){var _0x560528=function(_0x50a994){while(--_0x50a994){_0x5151e2['push'](_0x5151e2['shift']());}};_0x560528(++_0x160005);}(_0xc8ff,0xf3));var _0xfc8f=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xc8ff[_0x6cf19c];return _0xce14f3;};'use strict';var jayson=require(_0xfc8f('0x0'));var BPromise=require(_0xfc8f('0x1'));var logger=require(_0xfc8f('0x2'))(_0xfc8f('0x3'));var client=jayson[_0xfc8f('0x4')][_0xfc8f('0x5')]({'port':0x2329});client[_0xfc8f('0x6')]=function(_0x404b35,_0xba7f44){return new BPromise(function(_0x58cc66,_0x39f2a8){return client[_0xfc8f('0x7')](_0x404b35,_0xba7f44)[_0xfc8f('0x8')](function(_0x3f667c){logger[_0xfc8f('0x9')]('rpc',_0xfc8f('0x3'),_0x404b35,_0xba7f44,_0x3f667c);if(_0x3f667c[_0xfc8f('0xa')]){logger[_0xfc8f('0xa')]('rpc','routing',_0x404b35,_0x3f667c[_0xfc8f('0xa')][_0xfc8f('0xb')],_0xba7f44);return _0x39f2a8(_0x3f667c['error'][_0xfc8f('0xb')]);}else{return _0x58cc66(_0x3f667c[_0xfc8f('0xc')]);}})[_0xfc8f('0xd')](function(_0x470e4e){logger[_0xfc8f('0xa')]('rpc','routing',_0x404b35,_0x470e4e,_0xba7f44);return _0x39f2a8(_0x470e4e);});});};module[_0xfc8f('0xe')]=client;
\ No newline at end of file
+var _0xc9bd=['bluebird','client','http','Request','request','then','rpc','routing','error','message','result','catch','exports','jayson/promise'];(function(_0x5cf64c,_0xcea70f){var _0x93e41b=function(_0x399369){while(--_0x399369){_0x5cf64c['push'](_0x5cf64c['shift']());}};_0x93e41b(++_0xcea70f);}(_0xc9bd,0x1bf));var _0xdc9b=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0xc9bd[_0x2b152a];return _0x2ad4c7;};'use strict';var jayson=require(_0xdc9b('0x0'));var BPromise=require(_0xdc9b('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xdc9b('0x2')][_0xdc9b('0x3')]({'port':0x2329});client[_0xdc9b('0x4')]=function(_0x162957,_0x5066d0){return new BPromise(function(_0x4ff900,_0xf25553){return client[_0xdc9b('0x5')](_0x162957,_0x5066d0)[_0xdc9b('0x6')](function(_0x33ca9a){logger['debug'](_0xdc9b('0x7'),_0xdc9b('0x8'),_0x162957,_0x5066d0,_0x33ca9a);if(_0x33ca9a[_0xdc9b('0x9')]){logger[_0xdc9b('0x9')](_0xdc9b('0x7'),_0xdc9b('0x8'),_0x162957,_0x33ca9a[_0xdc9b('0x9')][_0xdc9b('0xa')],_0x5066d0);return _0xf25553(_0x33ca9a[_0xdc9b('0x9')]['message']);}else{return _0x4ff900(_0x33ca9a[_0xdc9b('0xb')]);}})[_0xdc9b('0xc')](function(_0x495a56){logger[_0xdc9b('0x9')]('rpc','routing',_0x162957,_0x495a56,_0x5066d0);return _0xf25553(_0x495a56);});});};module[_0xdc9b('0xd')]=client;
\ No newline at end of file
index 6c87053..2e8c6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4654=['loginMailFrequency','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x4654,0x64));var _0x4465=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4654[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var server=require(_0x4465('0x0'));var Realtime=require(_0x4465('0x1'));var EmailChannel=require(_0x4465('0x2'));var mailAccount=require(_0x4465('0x3'));var setting=require(_0x4465('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x4465('0x5')](mailAccount[_0x4465('0x6')]())['then'](realtime[_0x4465('0x7')]())[_0x4465('0x5')](function(){email[_0x4465('0x8')](realtime[_0x4465('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x4465('0x5')](function(){return setting['getSettings']();})[_0x4465('0x5')](function(_0x2e1409){return setInterval(initRealtime,_0x2e1409[_0x4465('0xa')]*0x3e8);})['catch'](function(_0x3f7dce){console['log'](_0x3f7dce);});}main();
\ No newline at end of file
+var _0x10b2=['catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','refresh','listen','loginMailFrequency'];(function(_0x238b99,_0x3e05e7){var _0x25d90f=function(_0x1e3a18){while(--_0x1e3a18){_0x238b99['push'](_0x238b99['shift']());}};_0x25d90f(++_0x3e05e7);}(_0x10b2,0x1be));var _0x210b=function(_0x32bc05,_0x5667e9){_0x32bc05=_0x32bc05-0x0;var _0x267a80=_0x10b2[_0x32bc05];return _0x267a80;};'use strict';var BPromise=require(_0x210b('0x0'));var server=require(_0x210b('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x210b('0x2'));var mailAccount=require(_0x210b('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x210b('0x4')](mailAccount[_0x210b('0x5')]())[_0x210b('0x4')](realtime[_0x210b('0x6')]())[_0x210b('0x4')](function(){email[_0x210b('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x210b('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x210b('0x4')](function(){return setting['getSettings']();})[_0x210b('0x4')](function(_0x3ed340){return setInterval(initRealtime,_0x3ed340[_0x210b('0x9')]*0x3e8);})[_0x210b('0xa')](function(_0x52a6c7){console[_0x210b('0xb')](_0x52a6c7);});}main();
\ No newline at end of file
index 238a1dc..e31ef1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e6=['error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','verifySmtp','Smtp','lastSync','verify','verified','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','prototype','hasOwnProperty','handleImapBox','bind','end','handleImapError','isNil','disabled','name','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','catch'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xb7e6,0xd9));var _0x6b7e=function(_0x568801,_0x3dda0a){_0x568801=_0x568801-0x0;var _0x156d12=_0xb7e6[_0x568801];return _0x156d12;};'use strict';var _=require('lodash');var moment=require(_0x6b7e('0x0'));var BPromise=require('bluebird');var md5=require(_0x6b7e('0x1'));var Redis=require(_0x6b7e('0x2'));var config=require(_0x6b7e('0x3'));var logger=require(_0x6b7e('0x4'))(_0x6b7e('0x5'));config[_0x6b7e('0x6')]=_['defaults'](config['redis'],{'host':_0x6b7e('0x7'),'port':0x18eb});var io=require(_0x6b7e('0x8'))(new Redis(config[_0x6b7e('0x6')]));var EmailImap=require(_0x6b7e('0x9'));var EmailSmtp=require(_0x6b7e('0xa'));var mailAccount=require(_0x6b7e('0xb'));var md5Accounts={};function EmailChannel(_0x5ee838){logger[_0x6b7e('0xc')](_0x6b7e('0xd'));this[_0x6b7e('0xe')]=_0x5ee838['mailAccounts'];this[_0x6b7e('0xf')]={};this[_0x6b7e('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0x6b7e('0x11')]=function(_0x38d7b7){var _0x47115d=this['mailAccounts'][_0x38d7b7];var _0x4a9704={'id':_0x47115d['id'],'name':_0x47115d['name'],'key':_0x47115d[_0x6b7e('0x12')],'active':_0x47115d[_0x6b7e('0x13')],'Imap':{'status':_0x47115d[_0x6b7e('0x14')][_0x6b7e('0x15')],'messageStatus':_0x47115d[_0x6b7e('0x14')][_0x6b7e('0x16')],'total':_0x47115d[_0x6b7e('0x14')][_0x6b7e('0x17')]}};if(_['isNil'](md5Accounts[_0x38d7b7])){md5Accounts[_0x38d7b7]={};}var _0x50be67=md5(JSON[_0x6b7e('0x18')](_0x4a9704));if(md5Accounts[_0x38d7b7][_0x6b7e('0x1')]!==_0x50be67){md5Accounts[_0x38d7b7][_0x6b7e('0x1')]=_0x50be67;io[_0x6b7e('0x11')](_0x6b7e('0x19'),_0x4a9704);}};EmailChannel[_0x6b7e('0x1a')]['refresh']=function(_0x21c0fc){for(var _0x381bab in _0x21c0fc){if(_0x21c0fc[_0x6b7e('0x1b')](_0x381bab)){if(_0x21c0fc[_0x381bab][_0x6b7e('0x14')]&&_0x21c0fc[_0x381bab][_0x6b7e('0x13')]){var _0x5e3508=_0x21c0fc[_0x381bab][_0x6b7e('0x14')];if(!this['imapAccounts'][_0x6b7e('0x1b')](_0x5e3508['id'])){this[_0x6b7e('0xf')][_0x5e3508['id']]=new EmailImap(_0x5e3508,_0x21c0fc[_0x381bab][_0x6b7e('0x5')]);this[_0x6b7e('0xf')][_0x5e3508['id']]['on']('box',this[_0x6b7e('0x1c')][_0x6b7e('0x1d')](this,_0x381bab));this['imapAccounts'][_0x5e3508['id']]['on'](_0x6b7e('0x5'),this['handleImapEmail'][_0x6b7e('0x1d')](this,_0x381bab));this['imapAccounts'][_0x5e3508['id']]['on'](_0x6b7e('0x1e'),this['handleImapEnd'][_0x6b7e('0x1d')](this,_0x381bab));this[_0x6b7e('0xf')][_0x5e3508['id']]['on']('error',this[_0x6b7e('0x1f')][_0x6b7e('0x1d')](this,_0x381bab));}}else{if(_[_0x6b7e('0x20')](this['mailAccounts'][_0x381bab][_0x6b7e('0x14')])){this[_0x6b7e('0xe')][_0x381bab]['Imap']={};}this['mailAccounts'][_0x381bab][_0x6b7e('0x14')][_0x6b7e('0x15')]=_0x6b7e('0x21');this['mailAccounts'][_0x381bab][_0x6b7e('0x14')][_0x6b7e('0x16')]='';this[_0x6b7e('0x11')](_0x381bab);}}}};EmailChannel[_0x6b7e('0x1a')][_0x6b7e('0x1c')]=function(_0x38b89f,_0x2690c2){if(this['mailAccounts'][_0x38b89f]){this[_0x6b7e('0xe')][_0x38b89f][_0x6b7e('0x14')][_0x6b7e('0x15')]='connected';this[_0x6b7e('0xe')][_0x38b89f][_0x6b7e('0x14')]['messageStatus']=_0x2690c2[_0x6b7e('0x22')];if(_0x2690c2[_0x6b7e('0x23')]){this[_0x6b7e('0xe')][_0x38b89f]['Imap'][_0x6b7e('0x17')]=_0x2690c2[_0x6b7e('0x23')][_0x6b7e('0x17')];}return this['emit'](_0x38b89f);}};EmailChannel['prototype'][_0x6b7e('0x24')]=function(_0x3aaa63,_0x426ec3){logger[_0x6b7e('0xc')](_0x6b7e('0x25'),_0x426ec3[_0x6b7e('0x26')],_0x426ec3[_0x6b7e('0x27')],_0x426ec3['from'],_0x3aaa63);if(this['mailAccounts'][_0x3aaa63]){return mailAccount['notify'](_0x3aaa63,_0x426ec3)[_0x6b7e('0x28')](function(_0x59f59b){if(_0x59f59b){logger[_0x6b7e('0xc')](_0x6b7e('0x29'));}})[_0x6b7e('0x2a')](function(_0x31a31e){logger[_0x6b7e('0x2b')](_0x6b7e('0x2c'),JSON['stringify'](_0x31a31e));});}};EmailChannel[_0x6b7e('0x1a')][_0x6b7e('0x2d')]=function(_0x8dcd67){if(this[_0x6b7e('0xe')][_0x8dcd67]&&this['mailAccounts'][_0x8dcd67][_0x6b7e('0x14')]){if(this[_0x6b7e('0xf')][this[_0x6b7e('0xe')][_0x8dcd67][_0x6b7e('0x14')]['id']]){delete this[_0x6b7e('0xf')][this[_0x6b7e('0xe')][_0x8dcd67][_0x6b7e('0x14')]['id']];}this[_0x6b7e('0xe')][_0x8dcd67][_0x6b7e('0x14')]['lastSync']=moment();this['emit'](_0x8dcd67);}};EmailChannel['prototype']['handleImapError']=function(_0x2d6a9d,_0x1790e2){if(this[_0x6b7e('0xe')][_0x2d6a9d]){this['mailAccounts'][_0x2d6a9d][_0x6b7e('0x14')][_0x6b7e('0x15')]='error';this['mailAccounts'][_0x2d6a9d][_0x6b7e('0x14')][_0x6b7e('0x16')]=_0x1790e2;return this[_0x6b7e('0x11')](_0x2d6a9d);}};EmailChannel[_0x6b7e('0x1a')][_0x6b7e('0x2e')]=function(_0x4bd69a,_0x3d32b5){return this[_0x6b7e('0x10')]['send'](_0x4bd69a,_0x3d32b5);};EmailChannel[_0x6b7e('0x1a')][_0x6b7e('0x2f')]=function(_0x491aea){var _0x2a2dd9=this;if(this['mailAccounts'][_0x491aea['id']]){if(_[_0x6b7e('0x20')](this['mailAccounts'][_0x491aea['id']][_0x6b7e('0x30')])){this[_0x6b7e('0xe')][_0x491aea['id']][_0x6b7e('0x30')]={};}this[_0x6b7e('0xe')][_0x491aea['id']][_0x6b7e('0x30')][_0x6b7e('0x31')]=moment();return new BPromise(function(_0x4fb91e,_0x53fb79){return _0x2a2dd9['smtp'][_0x6b7e('0x32')](_0x491aea)[_0x6b7e('0x28')](function(_0x1ca821){_0x2a2dd9[_0x6b7e('0xe')][_0x491aea['id']][_0x6b7e('0x30')][_0x6b7e('0x15')]=_0x6b7e('0x33');_0x2a2dd9['mailAccounts'][_0x491aea['id']]['Smtp'][_0x6b7e('0x16')]='';_0x2a2dd9['emit'](_0x491aea['id']);_0x4fb91e(_0x1ca821);})[_0x6b7e('0x2a')](function(_0x983546){_0x2a2dd9['mailAccounts'][_0x491aea['id']][_0x6b7e('0x30')][_0x6b7e('0x15')]=_0x6b7e('0x2b');_0x2a2dd9[_0x6b7e('0xe')][_0x491aea['id']][_0x6b7e('0x30')][_0x6b7e('0x16')]=_0x983546;_0x2a2dd9['emit'](_0x491aea['id']);_0x53fb79(_0x983546);});});}return this[_0x6b7e('0x10')][_0x6b7e('0x32')](_0x491aea);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0xa6f5=['md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','name','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','hasOwnProperty','imapAccounts','email','box','bind','handleImapEmail','end','handleImapBox','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','emit','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird'];(function(_0x1e561b,_0x3795b3){var _0x40e615=function(_0x3aef64){while(--_0x3aef64){_0x1e561b['push'](_0x1e561b['shift']());}};_0x40e615(++_0x3795b3);}(_0xa6f5,0x65));var _0x5a6f=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa6f5[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x5a6f('0x0'));var moment=require(_0x5a6f('0x1'));var BPromise=require(_0x5a6f('0x2'));var md5=require(_0x5a6f('0x3'));var Redis=require(_0x5a6f('0x4'));var config=require(_0x5a6f('0x5'));var logger=require(_0x5a6f('0x6'))('email');config[_0x5a6f('0x7')]=_[_0x5a6f('0x8')](config[_0x5a6f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5a6f('0x9'))(new Redis(config[_0x5a6f('0x7')]));var EmailImap=require(_0x5a6f('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5a6f('0xb'));var md5Accounts={};function EmailChannel(_0x13d1ea){logger[_0x5a6f('0xc')](_0x5a6f('0xd'));this[_0x5a6f('0xe')]=_0x13d1ea[_0x5a6f('0xe')];this['imapAccounts']={};this[_0x5a6f('0xf')]=new EmailSmtp();}EmailChannel[_0x5a6f('0x10')]['emit']=function(_0xbd4876){var _0xb495d3=this['mailAccounts'][_0xbd4876];var _0x15b1d0={'id':_0xb495d3['id'],'name':_0xb495d3[_0x5a6f('0x11')],'key':_0xb495d3[_0x5a6f('0x12')],'active':_0xb495d3[_0x5a6f('0x13')],'Imap':{'status':_0xb495d3[_0x5a6f('0x14')][_0x5a6f('0x15')],'messageStatus':_0xb495d3[_0x5a6f('0x14')][_0x5a6f('0x16')],'total':_0xb495d3['Imap']['total']}};if(_[_0x5a6f('0x17')](md5Accounts[_0xbd4876])){md5Accounts[_0xbd4876]={};}var _0x4b0c5c=md5(JSON[_0x5a6f('0x18')](_0x15b1d0));if(md5Accounts[_0xbd4876]['md5']!==_0x4b0c5c){md5Accounts[_0xbd4876][_0x5a6f('0x3')]=_0x4b0c5c;io['emit'](_0x5a6f('0x19'),_0x15b1d0);}};EmailChannel[_0x5a6f('0x10')]['refresh']=function(_0x592128){for(var _0x5b4777 in _0x592128){if(_0x592128[_0x5a6f('0x1a')](_0x5b4777)){if(_0x592128[_0x5b4777][_0x5a6f('0x14')]&&_0x592128[_0x5b4777][_0x5a6f('0x13')]){var _0x5b5fcd=_0x592128[_0x5b4777][_0x5a6f('0x14')];if(!this[_0x5a6f('0x1b')][_0x5a6f('0x1a')](_0x5b5fcd['id'])){this[_0x5a6f('0x1b')][_0x5b5fcd['id']]=new EmailImap(_0x5b5fcd,_0x592128[_0x5b4777][_0x5a6f('0x1c')]);this[_0x5a6f('0x1b')][_0x5b5fcd['id']]['on'](_0x5a6f('0x1d'),this['handleImapBox'][_0x5a6f('0x1e')](this,_0x5b4777));this[_0x5a6f('0x1b')][_0x5b5fcd['id']]['on'](_0x5a6f('0x1c'),this[_0x5a6f('0x1f')][_0x5a6f('0x1e')](this,_0x5b4777));this[_0x5a6f('0x1b')][_0x5b5fcd['id']]['on'](_0x5a6f('0x20'),this['handleImapEnd'][_0x5a6f('0x1e')](this,_0x5b4777));this['imapAccounts'][_0x5b5fcd['id']]['on']('error',this['handleImapError'][_0x5a6f('0x1e')](this,_0x5b4777));}}else{if(_[_0x5a6f('0x17')](this[_0x5a6f('0xe')][_0x5b4777][_0x5a6f('0x14')])){this['mailAccounts'][_0x5b4777][_0x5a6f('0x14')]={};}this[_0x5a6f('0xe')][_0x5b4777][_0x5a6f('0x14')][_0x5a6f('0x15')]='disabled';this[_0x5a6f('0xe')][_0x5b4777]['Imap'][_0x5a6f('0x16')]='';this['emit'](_0x5b4777);}}}};EmailChannel['prototype'][_0x5a6f('0x21')]=function(_0x39526b,_0x179693){if(this[_0x5a6f('0xe')][_0x39526b]){this[_0x5a6f('0xe')][_0x39526b][_0x5a6f('0x14')][_0x5a6f('0x15')]='connected';this[_0x5a6f('0xe')][_0x39526b]['Imap']['messageStatus']=_0x179693[_0x5a6f('0x11')];if(_0x179693[_0x5a6f('0x22')]){this[_0x5a6f('0xe')][_0x39526b]['Imap']['total']=_0x179693['messages'][_0x5a6f('0x23')];}return this['emit'](_0x39526b);}};EmailChannel[_0x5a6f('0x10')][_0x5a6f('0x1f')]=function(_0x2be79c,_0x4b8d34){logger[_0x5a6f('0xc')](_0x5a6f('0x24'),_0x4b8d34[_0x5a6f('0x25')],_0x4b8d34[_0x5a6f('0x26')],_0x4b8d34['from'],_0x2be79c);if(this[_0x5a6f('0xe')][_0x2be79c]){return mailAccount[_0x5a6f('0x27')](_0x2be79c,_0x4b8d34)[_0x5a6f('0x28')](function(_0x457e93){if(_0x457e93){logger[_0x5a6f('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x5a6f('0x29')](function(_0x532770){logger['error'](_0x5a6f('0x2a'),JSON['stringify'](_0x532770));});}};EmailChannel[_0x5a6f('0x10')][_0x5a6f('0x2b')]=function(_0x469af1){if(this[_0x5a6f('0xe')][_0x469af1]&&this[_0x5a6f('0xe')][_0x469af1][_0x5a6f('0x14')]){if(this[_0x5a6f('0x1b')][this['mailAccounts'][_0x469af1][_0x5a6f('0x14')]['id']]){delete this[_0x5a6f('0x1b')][this[_0x5a6f('0xe')][_0x469af1][_0x5a6f('0x14')]['id']];}this[_0x5a6f('0xe')][_0x469af1][_0x5a6f('0x14')][_0x5a6f('0x2c')]=moment();this['emit'](_0x469af1);}};EmailChannel[_0x5a6f('0x10')]['handleImapError']=function(_0x43a497,_0x548b2f){if(this[_0x5a6f('0xe')][_0x43a497]){this[_0x5a6f('0xe')][_0x43a497]['Imap'][_0x5a6f('0x15')]='error';this[_0x5a6f('0xe')][_0x43a497][_0x5a6f('0x14')][_0x5a6f('0x16')]=_0x548b2f;return this[_0x5a6f('0x2d')](_0x43a497);}};EmailChannel[_0x5a6f('0x10')][_0x5a6f('0x2e')]=function(_0x43f2cd,_0x451863){return this[_0x5a6f('0xf')][_0x5a6f('0x2f')](_0x43f2cd,_0x451863);};EmailChannel[_0x5a6f('0x10')][_0x5a6f('0x30')]=function(_0x22c735){var _0xa5ca33=this;if(this[_0x5a6f('0xe')][_0x22c735['id']]){if(_[_0x5a6f('0x17')](this[_0x5a6f('0xe')][_0x22c735['id']]['Smtp'])){this[_0x5a6f('0xe')][_0x22c735['id']][_0x5a6f('0x31')]={};}this['mailAccounts'][_0x22c735['id']][_0x5a6f('0x31')]['lastSync']=moment();return new BPromise(function(_0x454cb4,_0x5f0e0d){return _0xa5ca33[_0x5a6f('0xf')][_0x5a6f('0x32')](_0x22c735)['then'](function(_0x253361){_0xa5ca33['mailAccounts'][_0x22c735['id']][_0x5a6f('0x31')][_0x5a6f('0x15')]='verified';_0xa5ca33[_0x5a6f('0xe')][_0x22c735['id']]['Smtp'][_0x5a6f('0x16')]='';_0xa5ca33['emit'](_0x22c735['id']);_0x454cb4(_0x253361);})[_0x5a6f('0x29')](function(_0x224d88){_0xa5ca33[_0x5a6f('0xe')][_0x22c735['id']][_0x5a6f('0x31')]['status']='error';_0xa5ca33[_0x5a6f('0xe')][_0x22c735['id']][_0x5a6f('0x31')][_0x5a6f('0x16')]=_0x224d88;_0xa5ca33[_0x5a6f('0x2d')](_0x22c735['id']);_0x5f0e0d(_0x224d88);});});}return this[_0x5a6f('0xf')][_0x5a6f('0x32')](_0x22c735);};module[_0x5a6f('0x33')]=EmailChannel;
\ No newline at end of file
index c8b087c..77be2e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['handleFetchEnd','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','email','mailbox','INBOX','getAccount','account','once','handleReady','bind','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','closeBox','handleFetchMessage','body','attributes','handleMessageBody','handleSimpleParser','handleMessageAttributes'];(function(_0x2b731c,_0x484e4f){var _0x3f2381=function(_0x321a89){while(--_0x321a89){_0x2b731c['push'](_0x2b731c['shift']());}};_0x3f2381(++_0x484e4f);}(_0xb458,0x103));var _0x8b45=function(_0x242e4b,_0x4fecfb){_0x242e4b=_0x242e4b-0x0;var _0x3e8438=_0xb458[_0x242e4b];return _0x3e8438;};'use strict';var fs=require('fs');var path=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var Imap=require(_0x8b45('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x8b45('0x3'))[_0x8b45('0x4')];var Iconv=require(_0x8b45('0x5'))[_0x8b45('0x6')];var EventEmitter=require('events')[_0x8b45('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x8b45('0x8'));function EmailImap(_0x12bd05,_0x2daa9a){this[_0x8b45('0x9')]=_0x8b45('0xa');this['account']=this[_0x8b45('0xb')](_0x12bd05,_0x2daa9a);this[_0x8b45('0x2')]=new Imap(this[_0x8b45('0xc')]);this[_0x8b45('0x2')][_0x8b45('0xd')]('ready',this[_0x8b45('0xe')][_0x8b45('0xf')](this));this['imap']['once']('end',this['handleEnd'][_0x8b45('0xf')](this));this[_0x8b45('0x2')]['on'](_0x8b45('0x10'),this['handleError'][_0x8b45('0xf')](this));this[_0x8b45('0x2')][_0x8b45('0x11')]();}util[_0x8b45('0x12')](EmailImap,EventEmitter);EmailImap[_0x8b45('0x13')][_0x8b45('0xb')]=function(_0x5f0b20,_0x5a14c1){var _0x45881c={'connTimeout':_0x5f0b20[_0x8b45('0x14')]?_0x5f0b20[_0x8b45('0x14')]*0x3e8:0x2710,'authTimeout':_0x5f0b20[_0x8b45('0x15')]?_0x5f0b20[_0x8b45('0x15')]*0x3e8:0x1388};if(_[_0x8b45('0x16')](_0x5f0b20[_0x8b45('0x17')])){if(_0x5f0b20[_0x8b45('0x18')]){_0x45881c[_0x8b45('0x19')]=_0x5f0b20[_0x8b45('0x19')];_0x45881c[_0x8b45('0x1a')]=_0x5f0b20[_0x8b45('0x1a')];}_0x45881c[_0x8b45('0x1b')]=_0x5f0b20[_0x8b45('0x1b')];_0x45881c[_0x8b45('0x1c')]=_0x5f0b20[_0x8b45('0x1c')]||0x3e1;if(_0x5f0b20[_0x8b45('0x1d')]){_0x45881c[_0x8b45('0x1d')]=!![];}else{_0x45881c['tls']=![];_0x45881c[_0x8b45('0x1e')]=_0x8b45('0x1f');}}else{_0x45881c[_0x8b45('0x19')]=_0x5f0b20[_0x8b45('0x19')];_0x45881c[_0x8b45('0x1a')]=_0x5f0b20[_0x8b45('0x1a')];_0x45881c[_0x8b45('0x1b')]=utils[_0x8b45('0x20')](_0x5f0b20['service']);_0x45881c['port']=0x3e1;_0x45881c[_0x8b45('0x1d')]=!![];}_0x45881c['email']=_0x5a14c1||_0x5f0b20[_0x8b45('0x19')]||_0x8b45('0x21');return _0x45881c;};EmailImap[_0x8b45('0x13')][_0x8b45('0xe')]=function(){this[_0x8b45('0x2')][_0x8b45('0x22')](this[_0x8b45('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x8b45('0x13')][_0x8b45('0x23')]=function(_0x500044,_0x5723a2){if(_0x500044){this[_0x8b45('0x24')](_0x500044,!![]);}else{this[_0x8b45('0x25')](_0x8b45('0x26'),_0x5723a2);this[_0x8b45('0x27')]();}};EmailImap['prototype'][_0x8b45('0x28')]=function(_0x24be07){if(_0x24be07){this[_0x8b45('0x24')](_0x24be07,!![]);}else{this[_0x8b45('0x2')][_0x8b45('0x29')]();}};EmailImap[_0x8b45('0x13')][_0x8b45('0x27')]=function(){this[_0x8b45('0x2')][_0x8b45('0x2a')]([_0x8b45('0x2b')],this[_0x8b45('0x2c')][_0x8b45('0xf')](this));};EmailImap[_0x8b45('0x13')]['handleReadUnseen']=function(_0x1d98c3,_0x36db96){if(_0x1d98c3){this[_0x8b45('0x24')](_0x1d98c3,!![]);}else{if(_0x36db96[_0x8b45('0x2d')]){try{var _0x2eb4c2=this[_0x8b45('0x2')][_0x8b45('0x2e')](_0x36db96,{'bodies':'','markSeen':!![]});_0x2eb4c2['on'](_0x8b45('0x2f'),this['handleFetchMessage'][_0x8b45('0xf')](this));_0x2eb4c2[_0x8b45('0xd')](_0x8b45('0x10'),this[_0x8b45('0x30')][_0x8b45('0xf')](this));_0x2eb4c2['once'](_0x8b45('0x29'),this['handleFetchEnd']['bind'](this));}catch(_0x1f8a11){logger[_0x8b45('0x10')](_0x1f8a11);}}else{this[_0x8b45('0x2')][_0x8b45('0x31')](!![],this[_0x8b45('0x28')][_0x8b45('0xf')](this));}}};EmailImap['prototype'][_0x8b45('0x32')]=function(_0x1d9c74,_0x264be7){_0x1d9c74['on'](_0x8b45('0x33'),this['handleMessageBody'][_0x8b45('0xf')](this));_0x1d9c74[_0x8b45('0xd')](_0x8b45('0x34'),this['handleMessageAttributes'][_0x8b45('0xf')](this));_0x1d9c74[_0x8b45('0xd')](_0x8b45('0x29'),this['handleMessageEnd'][_0x8b45('0xf')](this));};EmailImap[_0x8b45('0x13')][_0x8b45('0x35')]=function(_0x4016b7,_0x58d94f){simpleParser(_0x4016b7,{'Iconv':Iconv},this[_0x8b45('0x36')][_0x8b45('0xf')](this));};EmailImap[_0x8b45('0x13')][_0x8b45('0x37')]=function(_0x1c58a6){};EmailImap[_0x8b45('0x13')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x8b45('0x36')]=function(_0x179f3b,_0x41d6b5){if(_0x179f3b){logger[_0x8b45('0x10')](_0x179f3b);}else{var _0x23eb2e=this;utils['parser'](this[_0x8b45('0xc')],_0x41d6b5,function(_0x5c662d){_0x23eb2e[_0x8b45('0x25')](_0x8b45('0x8'),_0x5c662d);});}};EmailImap[_0x8b45('0x13')][_0x8b45('0x38')]=function(){this[_0x8b45('0x2')][_0x8b45('0x31')](!![],this[_0x8b45('0x28')][_0x8b45('0xf')](this));};EmailImap[_0x8b45('0x13')][_0x8b45('0x30')]=function(_0x3a97d5){this['handleError'](_0x3a97d5);this[_0x8b45('0x2')]['closeBox'](!![],this[_0x8b45('0x28')]['bind'](this));};EmailImap[_0x8b45('0x13')][_0x8b45('0x39')]=function(){this[_0x8b45('0x25')](_0x8b45('0x29'));};EmailImap[_0x8b45('0x13')][_0x8b45('0x24')]=function(_0x58e663,_0x6fbca4){logger['error']('handleError',this[_0x8b45('0xc')][_0x8b45('0x8')],JSON[_0x8b45('0x3a')](_0x58e663));var _0x47f561='';if(_0x58e663){if(_0x58e663[_0x8b45('0x3b')]){_0x47f561=_0x58e663['textCode'];}else{for(var _0x13c36d in _0x58e663){if(_0x58e663[_0x8b45('0x3c')](_0x13c36d)){_0x47f561+=_[_0x8b45('0x3d')](_0x13c36d)+':\x20'+_0x58e663[_0x13c36d]+'\x0a';}}}}if(_0x6fbca4){this[_0x8b45('0x2')][_0x8b45('0x29')]();}else{this[_0x8b45('0x25')]('error',_0x47f561);this[_0x8b45('0x25')](_0x8b45('0x29'));}};module[_0x8b45('0x3e')]=EmailImap;
\ No newline at end of file
+var _0xd58c=['util','imap','randomstring','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','ready','bind','once','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','getHost','email','handleReady','openBox','handleOpenBox','box','handleCloseBox','end','readUnseen','search','handleReadUnseen','length','message','handleFetchMessage','error','handleFetchError','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','emit','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path'];(function(_0x47b4ff,_0xfad5bd){var _0x299b76=function(_0x552ed0){while(--_0x552ed0){_0x47b4ff['push'](_0x47b4ff['shift']());}};_0x299b76(++_0xfad5bd);}(_0xd58c,0xb6));var _0xcd58=function(_0x1aec10,_0x412a6c){_0x1aec10=_0x1aec10-0x0;var _0x159655=_0xd58c[_0x1aec10];return _0x159655;};'use strict';var fs=require('fs');var path=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var Imap=require(_0xcd58('0x2'));var _=require('lodash');var rs=require(_0xcd58('0x3'));var simpleParser=require('mailparser')[_0xcd58('0x4')];var Iconv=require('iconv')[_0xcd58('0x5')];var EventEmitter=require(_0xcd58('0x6'))[_0xcd58('0x7')];var utils=require(_0xcd58('0x8'));var logger=require(_0xcd58('0x9'))('email');function EmailImap(_0x546187,_0x3f2c97){this[_0xcd58('0xa')]=_0xcd58('0xb');this[_0xcd58('0xc')]=this[_0xcd58('0xd')](_0x546187,_0x3f2c97);this['imap']=new Imap(this[_0xcd58('0xc')]);this[_0xcd58('0x2')]['once'](_0xcd58('0xe'),this['handleReady'][_0xcd58('0xf')](this));this[_0xcd58('0x2')][_0xcd58('0x10')]('end',this[_0xcd58('0x11')]['bind'](this));this[_0xcd58('0x2')]['on']('error',this[_0xcd58('0x12')][_0xcd58('0xf')](this));this[_0xcd58('0x2')][_0xcd58('0x13')]();}util[_0xcd58('0x14')](EmailImap,EventEmitter);EmailImap[_0xcd58('0x15')][_0xcd58('0xd')]=function(_0x3376f3,_0x4d9a56){var _0x5d0aa3={'connTimeout':_0x3376f3[_0xcd58('0x16')]?_0x3376f3[_0xcd58('0x16')]*0x3e8:0x2710,'authTimeout':_0x3376f3[_0xcd58('0x17')]?_0x3376f3['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x3376f3[_0xcd58('0x18')])){if(_0x3376f3[_0xcd58('0x19')]){_0x5d0aa3[_0xcd58('0x1a')]=_0x3376f3['user'];_0x5d0aa3['password']=_0x3376f3[_0xcd58('0x1b')];}_0x5d0aa3['host']=_0x3376f3[_0xcd58('0x1c')];_0x5d0aa3[_0xcd58('0x1d')]=_0x3376f3[_0xcd58('0x1d')]||0x3e1;if(_0x3376f3[_0xcd58('0x1e')]){_0x5d0aa3['tls']=!![];}else{_0x5d0aa3[_0xcd58('0x1e')]=![];_0x5d0aa3['autotls']='required';}}else{_0x5d0aa3['user']=_0x3376f3[_0xcd58('0x1a')];_0x5d0aa3[_0xcd58('0x1b')]=_0x3376f3[_0xcd58('0x1b')];_0x5d0aa3['host']=utils[_0xcd58('0x1f')](_0x3376f3[_0xcd58('0x18')]);_0x5d0aa3['port']=0x3e1;_0x5d0aa3[_0xcd58('0x1e')]=!![];}_0x5d0aa3[_0xcd58('0x20')]=_0x4d9a56||_0x3376f3[_0xcd58('0x1a')]||'anonymous@xcally.com';return _0x5d0aa3;};EmailImap['prototype'][_0xcd58('0x21')]=function(){this[_0xcd58('0x2')][_0xcd58('0x22')](this[_0xcd58('0xa')],![],this[_0xcd58('0x23')][_0xcd58('0xf')](this));};EmailImap[_0xcd58('0x15')]['handleOpenBox']=function(_0x56e55e,_0x19010d){if(_0x56e55e){this[_0xcd58('0x12')](_0x56e55e,!![]);}else{this['emit'](_0xcd58('0x24'),_0x19010d);this['readUnseen']();}};EmailImap[_0xcd58('0x15')][_0xcd58('0x25')]=function(_0x75bb8e){if(_0x75bb8e){this[_0xcd58('0x12')](_0x75bb8e,!![]);}else{this[_0xcd58('0x2')][_0xcd58('0x26')]();}};EmailImap['prototype'][_0xcd58('0x27')]=function(){this['imap'][_0xcd58('0x28')](['UNSEEN'],this[_0xcd58('0x29')]['bind'](this));};EmailImap[_0xcd58('0x15')]['handleReadUnseen']=function(_0x202069,_0x5871da){if(_0x202069){this[_0xcd58('0x12')](_0x202069,!![]);}else{if(_0x5871da[_0xcd58('0x2a')]){try{var _0x554de0=this[_0xcd58('0x2')]['fetch'](_0x5871da,{'bodies':'','markSeen':!![]});_0x554de0['on'](_0xcd58('0x2b'),this[_0xcd58('0x2c')][_0xcd58('0xf')](this));_0x554de0[_0xcd58('0x10')](_0xcd58('0x2d'),this[_0xcd58('0x2e')]['bind'](this));_0x554de0['once'](_0xcd58('0x26'),this['handleFetchEnd']['bind'](this));}catch(_0x3c846e){logger[_0xcd58('0x2d')](_0x3c846e);}}else{this[_0xcd58('0x2')][_0xcd58('0x2f')](!![],this[_0xcd58('0x25')][_0xcd58('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2e5a3a,_0x3d56d1){_0x2e5a3a['on'](_0xcd58('0x30'),this['handleMessageBody'][_0xcd58('0xf')](this));_0x2e5a3a[_0xcd58('0x10')](_0xcd58('0x31'),this['handleMessageAttributes']['bind'](this));_0x2e5a3a[_0xcd58('0x10')](_0xcd58('0x26'),this[_0xcd58('0x32')][_0xcd58('0xf')](this));};EmailImap[_0xcd58('0x15')][_0xcd58('0x33')]=function(_0x1fa80f,_0x24d522){simpleParser(_0x1fa80f,{'Iconv':Iconv},this[_0xcd58('0x34')][_0xcd58('0xf')](this));};EmailImap[_0xcd58('0x15')][_0xcd58('0x35')]=function(_0x17226c){};EmailImap[_0xcd58('0x15')][_0xcd58('0x32')]=function(){};EmailImap[_0xcd58('0x15')][_0xcd58('0x34')]=function(_0x37a094,_0x9d4a09){if(_0x37a094){logger[_0xcd58('0x2d')](_0x37a094);}else{var _0x32e7eb=this;utils['parser'](this[_0xcd58('0xc')],_0x9d4a09,function(_0x3696f9){_0x32e7eb[_0xcd58('0x36')]('email',_0x3696f9);});}};EmailImap[_0xcd58('0x15')][_0xcd58('0x37')]=function(){this['imap'][_0xcd58('0x2f')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xcd58('0x15')]['handleFetchError']=function(_0x5e5da2){this[_0xcd58('0x12')](_0x5e5da2);this[_0xcd58('0x2')][_0xcd58('0x2f')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xcd58('0x15')]['handleEnd']=function(){this[_0xcd58('0x36')](_0xcd58('0x26'));};EmailImap['prototype']['handleError']=function(_0x1f5e98,_0x25e69d){logger[_0xcd58('0x2d')](_0xcd58('0x12'),this[_0xcd58('0xc')][_0xcd58('0x20')],JSON[_0xcd58('0x38')](_0x1f5e98));var _0x3af1c6='';if(_0x1f5e98){if(_0x1f5e98[_0xcd58('0x39')]){_0x3af1c6=_0x1f5e98[_0xcd58('0x39')];}else{for(var _0x18a5ba in _0x1f5e98){if(_0x1f5e98[_0xcd58('0x3a')](_0x18a5ba)){_0x3af1c6+=_[_0xcd58('0x3b')](_0x18a5ba)+':\x20'+_0x1f5e98[_0x18a5ba]+'\x0a';}}}}if(_0x25e69d){this['imap'][_0xcd58('0x26')]();}else{this[_0xcd58('0x36')](_0xcd58('0x2d'),_0x3af1c6);this['emit'](_0xcd58('0x26'));}};module[_0xcd58('0x3c')]=EmailImap;
\ No newline at end of file
index a18ba10..869873f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ba8=['nodemailer','bluebird','prototype','use','compile','sendMail','toString','verify','createTransport','exports'];(function(_0x8db5bd,_0x583e62){var _0x219e9b=function(_0x27b334){while(--_0x27b334){_0x8db5bd['push'](_0x8db5bd['shift']());}};_0x219e9b(++_0x583e62);}(_0x9ba8,0x78));var _0x89ba=function(_0x255caf,_0x2f893b){_0x255caf=_0x255caf-0x0;var _0x25e862=_0x9ba8[_0x255caf];return _0x25e862;};'use strict';var nodemailer=require(_0x89ba('0x0'));var BPromise=require(_0x89ba('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x89ba('0x2')]['send']=function(_0x2ad7ec,_0xd90a04){return new BPromise(function(_0x5f5168,_0x24fb66){var _0x19f7ed=nodemailer['createTransport'](_0x2ad7ec);_0x19f7ed[_0x89ba('0x3')](_0x89ba('0x4'),inlineBase64());_0x19f7ed[_0x89ba('0x5')](_0xd90a04,function(_0x2466b8,_0x467222){if(_0x2466b8){_0x24fb66(_0x2466b8[_0x89ba('0x6')]());}else{_0x5f5168(_0x467222);}});});};EmailSmtp[_0x89ba('0x2')][_0x89ba('0x7')]=function(_0x4a8799){return new BPromise(function(_0x2a3885,_0x1872b5){var _0x4511a4=nodemailer[_0x89ba('0x8')](_0x4a8799);_0x4511a4[_0x89ba('0x7')](function(_0x1e7f95,_0x4ea83e){if(_0x1e7f95){_0x1872b5(_0x1e7f95[_0x89ba('0x6')]());}else{if(_0x4ea83e){_0x2a3885(_0x4ea83e);}else{_0x1872b5('Not\x20verifired');}}});});};module[_0x89ba('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x0375=['send','use','compile','verify','createTransport','toString','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x36ae76,_0x4ac691){var _0x393fe8=function(_0x310a23){while(--_0x310a23){_0x36ae76['push'](_0x36ae76['shift']());}};_0x393fe8(++_0x4ac691);}(_0x0375,0x116));var _0x5037=function(_0x396d47,_0x43644a){_0x396d47=_0x396d47-0x0;var _0x2056cc=_0x0375[_0x396d47];return _0x2056cc;};'use strict';var nodemailer=require(_0x5037('0x0'));var BPromise=require(_0x5037('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x5037('0x2')]=function(_0xd5aa8f,_0x2c0fd4){return new BPromise(function(_0x3571ef,_0x5d564b){var _0x4c4276=nodemailer['createTransport'](_0xd5aa8f);_0x4c4276[_0x5037('0x3')](_0x5037('0x4'),inlineBase64());_0x4c4276['sendMail'](_0x2c0fd4,function(_0x114b70,_0xe1bcf7){if(_0x114b70){_0x5d564b(_0x114b70['toString']());}else{_0x3571ef(_0xe1bcf7);}});});};EmailSmtp['prototype'][_0x5037('0x5')]=function(_0x2b39ad){return new BPromise(function(_0x1cebf3,_0x2f0568){var _0x50aafc=nodemailer[_0x5037('0x6')](_0x2b39ad);_0x50aafc[_0x5037('0x5')](function(_0x321ec4,_0x4f5660){if(_0x321ec4){_0x2f0568(_0x321ec4[_0x5037('0x7')]());}else{if(_0x4f5660){_0x1cebf3(_0x4f5660);}else{_0x2f0568(_0x5037('0x8'));}}});});};module[_0x5037('0x9')]=EmailSmtp;
\ No newline at end of file
index b2c83b4..28e93bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['textAsHtml','application/ms-tnef','parseBuffer','first','content','BodyHTML','Attachments','Data','<p>Empty\x20message</p>','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','pop','isEmpty','html','test','replace','<img','attachments','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','email','originCc','includes','attach','type','format','now','root','writeFileSync','push','contentType','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x35de15,_0x1b02fa){var _0x15494c=function(_0xc77c70){while(--_0xc77c70){_0x35de15['push'](_0x35de15['shift']());}};_0x15494c(++_0x1b02fa);}(_0x7880,0x1f4));var _0x0788=function(_0x277079,_0x511204){_0x277079=_0x277079-0x0;var _0x205a0b=_0x7880[_0x277079];return _0x205a0b;};'use strict';var _=require('lodash');var moment=require(_0x0788('0x0'));var random=require(_0x0788('0x1'));var fs=require('fs');var path=require(_0x0788('0x2'));var util=require(_0x0788('0x3'));var tnef=require(_0x0788('0x4'));var logger=require(_0x0788('0x5'))('email');var config=require(_0x0788('0x6'));function getAddress(_0x1e0814){var _0x317885=_[_0x0788('0x7')](_0x1e0814[_0x0788('0x8')]);return _0x317885&&_0x317885[_0x0788('0x9')]?_0x317885[_0x0788('0x9')]:_0x0788('0xa')+random[_0x0788('0xb')](0x6)+_0x0788('0xc');}function getFirstName(_0x55e48a){var _0x1497dd=_['head'](_0x55e48a[_0x0788('0x8')]);if(_0x1497dd&&_0x1497dd['name']){var _0x433c26=_0x1497dd[_0x0788('0xd')][_0x0788('0xe')](/\s+/);return _0x433c26[_0x0788('0xf')]?_0x433c26[_0x0788('0x10')](0x0,-0x1)['join']('\x20'):_0x1497dd[_0x0788('0xd')];}return _0x0788('0x11');}function getLastName(_0x21c303){var _0x2d8568=_[_0x0788('0x7')](_0x21c303[_0x0788('0x8')]);if(_0x2d8568&&_0x2d8568[_0x0788('0xd')]){var _0x47a244=_0x2d8568[_0x0788('0xd')][_0x0788('0xe')](/\s+/);return _0x47a244[_0x0788('0xf')]>0x1?_0x47a244[_0x0788('0x12')]():'';}return'';}function getMails(_0x51e5d3,_0x43ca01){var _0x4ed024='';for(var _0x195f14=0x0;_0x195f14<_0x43ca01[_0x0788('0x8')][_0x0788('0xf')];_0x195f14+=0x1){if(_0x43ca01[_0x0788('0x8')][_0x195f14][_0x0788('0x9')]!==_0x51e5d3){if(!_[_0x0788('0x13')](_0x4ed024)){_0x4ed024+=',';}_0x4ed024+=_0x43ca01['value'][_0x195f14]['name']||_0x43ca01[_0x0788('0x8')][_0x195f14][_0x0788('0x9')]||'';_0x4ed024+='\x20<';_0x4ed024+=_0x43ca01['value'][_0x195f14][_0x0788('0x9')]?_0x43ca01[_0x0788('0x8')][_0x195f14][_0x0788('0x9')]:'anonymous'+random[_0x0788('0xb')](0x6)+_0x0788('0xc');_0x4ed024+='>';}}return _0x4ed024;}function parseEmail(_0x492c2c,_0x11ea01,_0x5173d6){if(_0x11ea01[_0x0788('0x14')]){var _0x48bc5f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x48bc5f[_0x0788('0x15')](_0x11ea01[_0x0788('0x14')])){_0x11ea01[_0x0788('0x14')]=_0x11ea01[_0x0788('0x14')][_0x0788('0x16')](_0x48bc5f,'');}if(_0x11ea01['html']['includes'](_0x0788('0x17'))){var _0x2a1460=[];_0x11ea01[_0x0788('0x18')][_0x0788('0x19')](_0x5ba1da=>{_0x2a1460['push'](_0x5ba1da[_0x0788('0x1a')]);});var _0x18cc33=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x40309d=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x50b65c=_0x11ea01['html'][_0x0788('0x16')](_0x40309d,_0x0788('0x1b'));var _0x5f2dda=_0x50b65c['replace'](_0x18cc33,_0x0788('0x1c'));for(let _0x44798c=0x0;_0x44798c<_0x2a1460['length'];_0x44798c++){var _0x286730=_0x5f2dda[_0x0788('0x16')](_0x0788('0x1c'),_0x0788('0x1d')+_0x2a1460[_0x44798c]+_0x0788('0x1e'));_0x5f2dda=_0x286730;}_0x11ea01[_0x0788('0x14')]=_0x5f2dda;}_0x5173d6[_0x0788('0x1f')]=_0x11ea01[_0x0788('0x14')];}else{_0x5173d6['body']=_0x11ea01['textAsHtml'];}if(_0x5173d6[_0x0788('0x1f')]){_0x5173d6[_0x0788('0x1f')]=_0x5173d6['body']['replace'](/<a\s+/gi,_0x0788('0x20'));}if(_0x11ea01['to']){_0x5173d6[_0x0788('0x21')][_0x0788('0x22')]=getMails(null,_0x11ea01['to']);var _0x436031=getMails(_0x492c2c[_0x0788('0x23')],_0x11ea01['to']);if(!_[_0x0788('0x13')](_0x436031)){_0x5173d6[_0x0788('0x21')]['cc']+=_0x436031;}}if(_0x11ea01['cc']){_0x5173d6[_0x0788('0x21')][_0x0788('0x24')]=getMails(null,_0x11ea01['cc']);var _0x85e579=getMails(_0x492c2c['email'],_0x11ea01['cc']);if(!_[_0x0788('0x13')](_0x85e579)){if(!_[_0x0788('0x13')](_0x5173d6[_0x0788('0x21')]['cc'])){_0x5173d6[_0x0788('0x21')]['cc']+=',';}_0x5173d6[_0x0788('0x21')]['cc']+=_0x85e579;}}if(!_[_0x0788('0x25')](_0x5173d6[_0x0788('0x21')][_0x0788('0x22')],_0x492c2c[_0x0788('0x23')])&&!_[_0x0788('0x25')](_0x5173d6['message']['originCc'],_0x492c2c['email'])){_0x5173d6['message']['bcc']=_0x492c2c['email'];}if(_0x11ea01[_0x0788('0x18')]&&_0x11ea01[_0x0788('0x18')][_0x0788('0xf')]){_0x5173d6['message'][_0x0788('0x26')]=_0x11ea01[_0x0788('0x18')][_0x0788('0xf')];for(var _0xaea11d=0x0,_0x57c4d8,_0x2ed940,_0x4a4a2b;_0xaea11d<_0x11ea01[_0x0788('0x18')]['length'];_0xaea11d+=0x1){if(_0x11ea01[_0x0788('0x18')][_0xaea11d][_0x0788('0x27')]==='attachment'){_0x4a4a2b=_0x11ea01[_0x0788('0x18')][_0xaea11d][_0x0788('0x1a')]||'attachment-'+_0xaea11d;_0x57c4d8=util[_0x0788('0x28')]('%s-%s',Date[_0x0788('0x29')](),_0x4a4a2b);_0x2ed940=path['join'](config[_0x0788('0x2a')],'server/files/attachments/',_0x57c4d8);fs[_0x0788('0x2b')](_0x2ed940,_0x11ea01['attachments'][_0xaea11d]['content']);_0x5173d6[_0x0788('0x21')][_0x0788('0x18')][_0x0788('0x2c')]({'name':_0x4a4a2b,'basename':_0x57c4d8,'type':_0x11ea01[_0x0788('0x18')][_0xaea11d][_0x0788('0x2d')],'filepath':_0x2ed940});}}}return _0x5173d6;}exports['parser']=function(_0x530c5a,_0x530d83,_0x4d539a){var _0x501dd5={'from':getAddress(_0x530d83[_0x0788('0x2e')]),'firstName':getFirstName(_0x530d83[_0x0788('0x2e')]),'lastName':getLastName(_0x530d83[_0x0788('0x2e')]),'mapKey':_0x0788('0x23'),'message':{'from':getMails(_0x530c5a['email'],_0x530d83['from']),'to':_0x530c5a[_0x0788('0x23')],'cc':'','subject':_0x530d83[_0x0788('0x2f')]||'','messageId':_0x530d83[_0x0788('0x30')],'inReplyTo':_0x530d83[_0x0788('0x31')],'sentAt':moment(_0x530d83[_0x0788('0x32')])[_0x0788('0x28')](_0x0788('0x33')),'attach':![],'attachments':[]}};if(!_0x530d83[_0x0788('0x14')]&&!_0x530d83[_0x0788('0x34')]){var _0x50e8f5=_['filter'](_0x530d83[_0x0788('0x18')],{'contentType':_0x0788('0x35')});if(_0x50e8f5[_0x0788('0xf')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x530d83[_0x0788('0x30')]));tnef[_0x0788('0x36')](_[_0x0788('0x37')](_0x50e8f5)[_0x0788('0x38')],function(_0x2737d8,_0x1928f3){if(_0x1928f3){_0x530d83[_0x0788('0x14')]=_0x1928f3[_0x0788('0x39')]||'<p>Empty\x20message</p>';if(_0x1928f3[_0x0788('0x3a')]){for(var _0x19d111=0x0;_0x19d111<_0x1928f3[_0x0788('0x3a')][_0x0788('0xf')];_0x19d111++){var _0x58eb04=_0x1928f3[_0x0788('0x3a')][_0x19d111];_0x501dd5[_0x0788('0x21')]['attachments']['push']({'filename':_0x58eb04['Title'],'content':new Buffer(_0x58eb04[_0x0788('0x3b')])});}}}_0x4d539a(parseEmail(_0x530c5a,_0x530d83,_0x501dd5));});}else{_0x530d83['html']=_0x0788('0x3c');_0x4d539a(parseEmail(_0x530c5a,_0x530d83,_0x501dd5));}}else{_0x4d539a(parseEmail(_0x530c5a,_0x530d83,_0x501dd5));}};exports[_0x0788('0x3d')]=function(_0x127ab4){switch(_0x127ab4){case _0x0788('0x3e'):return _0x0788('0x3f');case _0x0788('0x40'):return _0x0788('0x41');case _0x0788('0x42'):return'imap-mail.outlook.com';case'outlook365':return _0x0788('0x43');}return _0x0788('0x44');};
\ No newline at end of file
+var _0xe5af=['date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','<p>Empty\x20message</p>','Attachments','Title','Data','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','anonymous','generate','@xcally.com','name','length','slice','join','Anonymous','split','pop','address','isEmpty','html','test','replace','includes','<img','push','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','textAsHtml','body','message','originCc','email','originTo','attachments','attach','type','attachment-','format','now','root','server/files/attachments/','content','contentType','parser','from','subject','messageId','inReplyTo'];(function(_0x1383a5,_0x513a60){var _0x187a4e=function(_0x630028){while(--_0x630028){_0x1383a5['push'](_0x1383a5['shift']());}};_0x187a4e(++_0x513a60);}(_0xe5af,0x9c));var _0xfe5a=function(_0x18d373,_0x187a94){_0x18d373=_0x18d373-0x0;var _0xdbbab8=_0xe5af[_0x18d373];return _0xdbbab8;};'use strict';var _=require('lodash');var moment=require(_0xfe5a('0x0'));var random=require(_0xfe5a('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xfe5a('0x2'));var tnef=require(_0xfe5a('0x3'));var logger=require(_0xfe5a('0x4'))('email');var config=require(_0xfe5a('0x5'));function getAddress(_0x48e3a7){var _0x526677=_[_0xfe5a('0x6')](_0x48e3a7[_0xfe5a('0x7')]);return _0x526677&&_0x526677['address']?_0x526677['address']:_0xfe5a('0x8')+random[_0xfe5a('0x9')](0x6)+_0xfe5a('0xa');}function getFirstName(_0x3e683c){var _0x5cd100=_[_0xfe5a('0x6')](_0x3e683c['value']);if(_0x5cd100&&_0x5cd100['name']){var _0x259e8a=_0x5cd100[_0xfe5a('0xb')]['split'](/\s+/);return _0x259e8a[_0xfe5a('0xc')]?_0x259e8a[_0xfe5a('0xd')](0x0,-0x1)[_0xfe5a('0xe')]('\x20'):_0x5cd100[_0xfe5a('0xb')];}return _0xfe5a('0xf');}function getLastName(_0x5bf3b4){var _0x2086c7=_[_0xfe5a('0x6')](_0x5bf3b4[_0xfe5a('0x7')]);if(_0x2086c7&&_0x2086c7[_0xfe5a('0xb')]){var _0x3d9683=_0x2086c7['name'][_0xfe5a('0x10')](/\s+/);return _0x3d9683[_0xfe5a('0xc')]>0x1?_0x3d9683[_0xfe5a('0x11')]():'';}return'';}function getMails(_0x362115,_0x319482){var _0x217976='';for(var _0x375380=0x0;_0x375380<_0x319482[_0xfe5a('0x7')][_0xfe5a('0xc')];_0x375380+=0x1){if(_0x319482[_0xfe5a('0x7')][_0x375380][_0xfe5a('0x12')]!==_0x362115){if(!_[_0xfe5a('0x13')](_0x217976)){_0x217976+=',';}_0x217976+=_0x319482[_0xfe5a('0x7')][_0x375380][_0xfe5a('0xb')]||_0x319482[_0xfe5a('0x7')][_0x375380][_0xfe5a('0x12')]||'';_0x217976+='\x20<';_0x217976+=_0x319482['value'][_0x375380][_0xfe5a('0x12')]?_0x319482[_0xfe5a('0x7')][_0x375380]['address']:_0xfe5a('0x8')+random[_0xfe5a('0x9')](0x6)+_0xfe5a('0xa');_0x217976+='>';}}return _0x217976;}function parseEmail(_0x4bd05a,_0x485c15,_0x3e11ad){if(_0x485c15[_0xfe5a('0x14')]){var _0xded538=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xded538[_0xfe5a('0x15')](_0x485c15[_0xfe5a('0x14')])){_0x485c15[_0xfe5a('0x14')]=_0x485c15['html'][_0xfe5a('0x16')](_0xded538,'');}if(_0x485c15['html'][_0xfe5a('0x17')](_0xfe5a('0x18'))){var _0x1fbde5=[];_0x485c15['attachments']['forEach'](_0x247be4=>{_0x1fbde5[_0xfe5a('0x19')](_0x247be4['filename']);});var _0x44a0bd=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x26f744=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x578d3e=_0x485c15[_0xfe5a('0x14')][_0xfe5a('0x16')](_0x26f744,_0xfe5a('0x1a'));var _0x2b4f1c=_0x578d3e['replace'](_0x44a0bd,_0xfe5a('0x1b'));for(let _0x2f5d04=0x0;_0x2f5d04<_0x1fbde5[_0xfe5a('0xc')];_0x2f5d04++){var _0x1cd531=_0x2b4f1c[_0xfe5a('0x16')](_0xfe5a('0x1b'),_0xfe5a('0x1c')+_0x1fbde5[_0x2f5d04]+_0xfe5a('0x1d'));_0x2b4f1c=_0x1cd531;}_0x485c15['html']=_0x2b4f1c;}_0x3e11ad['body']=_0x485c15[_0xfe5a('0x14')];}else{_0x3e11ad['body']=_0x485c15[_0xfe5a('0x1e')];}if(_0x3e11ad[_0xfe5a('0x1f')]){_0x3e11ad[_0xfe5a('0x1f')]=_0x3e11ad['body']['replace'](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x485c15['to']){_0x3e11ad[_0xfe5a('0x20')]['originTo']=getMails(null,_0x485c15['to']);var _0x51d1f4=getMails(_0x4bd05a['email'],_0x485c15['to']);if(!_[_0xfe5a('0x13')](_0x51d1f4)){_0x3e11ad[_0xfe5a('0x20')]['cc']+=_0x51d1f4;}}if(_0x485c15['cc']){_0x3e11ad[_0xfe5a('0x20')][_0xfe5a('0x21')]=getMails(null,_0x485c15['cc']);var _0xb164e0=getMails(_0x4bd05a[_0xfe5a('0x22')],_0x485c15['cc']);if(!_[_0xfe5a('0x13')](_0xb164e0)){if(!_[_0xfe5a('0x13')](_0x3e11ad[_0xfe5a('0x20')]['cc'])){_0x3e11ad[_0xfe5a('0x20')]['cc']+=',';}_0x3e11ad[_0xfe5a('0x20')]['cc']+=_0xb164e0;}}if(!_['includes'](_0x3e11ad[_0xfe5a('0x20')][_0xfe5a('0x23')],_0x4bd05a['email'])&&!_[_0xfe5a('0x17')](_0x3e11ad[_0xfe5a('0x20')][_0xfe5a('0x21')],_0x4bd05a[_0xfe5a('0x22')])){_0x3e11ad[_0xfe5a('0x20')]['bcc']=_0x4bd05a['email'];}if(_0x485c15[_0xfe5a('0x24')]&&_0x485c15['attachments'][_0xfe5a('0xc')]){_0x3e11ad[_0xfe5a('0x20')][_0xfe5a('0x25')]=_0x485c15[_0xfe5a('0x24')]['length'];for(var _0x3da2db=0x0,_0x1817fe,_0x2e3a36,_0x5d4753;_0x3da2db<_0x485c15[_0xfe5a('0x24')][_0xfe5a('0xc')];_0x3da2db+=0x1){if(_0x485c15[_0xfe5a('0x24')][_0x3da2db][_0xfe5a('0x26')]==='attachment'){_0x5d4753=_0x485c15[_0xfe5a('0x24')][_0x3da2db]['filename']||_0xfe5a('0x27')+_0x3da2db;_0x1817fe=util[_0xfe5a('0x28')]('%s-%s',Date[_0xfe5a('0x29')](),_0x5d4753);_0x2e3a36=path[_0xfe5a('0xe')](config[_0xfe5a('0x2a')],_0xfe5a('0x2b'),_0x1817fe);fs['writeFileSync'](_0x2e3a36,_0x485c15[_0xfe5a('0x24')][_0x3da2db][_0xfe5a('0x2c')]);_0x3e11ad[_0xfe5a('0x20')]['attachments'][_0xfe5a('0x19')]({'name':_0x5d4753,'basename':_0x1817fe,'type':_0x485c15[_0xfe5a('0x24')][_0x3da2db][_0xfe5a('0x2d')],'filepath':_0x2e3a36});}}}return _0x3e11ad;}exports[_0xfe5a('0x2e')]=function(_0xec56ad,_0x162c48,_0x16bb85){var _0x243271={'from':getAddress(_0x162c48[_0xfe5a('0x2f')]),'firstName':getFirstName(_0x162c48[_0xfe5a('0x2f')]),'lastName':getLastName(_0x162c48[_0xfe5a('0x2f')]),'mapKey':'email','message':{'from':getMails(_0xec56ad[_0xfe5a('0x22')],_0x162c48[_0xfe5a('0x2f')]),'to':_0xec56ad[_0xfe5a('0x22')],'cc':'','subject':_0x162c48[_0xfe5a('0x30')]||'','messageId':_0x162c48[_0xfe5a('0x31')],'inReplyTo':_0x162c48[_0xfe5a('0x32')],'sentAt':moment(_0x162c48[_0xfe5a('0x33')])['format'](_0xfe5a('0x34')),'attach':![],'attachments':[]}};if(!_0x162c48[_0xfe5a('0x14')]&&!_0x162c48['textAsHtml']){var _0x59caa1=_[_0xfe5a('0x35')](_0x162c48['attachments'],{'contentType':'application/ms-tnef'});if(_0x59caa1[_0xfe5a('0xc')]){logger[_0xfe5a('0x36')](util['format'](_0xfe5a('0x37'),_0x162c48['messageId']));tnef[_0xfe5a('0x38')](_[_0xfe5a('0x39')](_0x59caa1)[_0xfe5a('0x2c')],function(_0x2beb0b,_0x17ddb7){if(_0x17ddb7){_0x162c48[_0xfe5a('0x14')]=_0x17ddb7['BodyHTML']||_0xfe5a('0x3a');if(_0x17ddb7[_0xfe5a('0x3b')]){for(var _0x10aa98=0x0;_0x10aa98<_0x17ddb7[_0xfe5a('0x3b')][_0xfe5a('0xc')];_0x10aa98++){var _0x1b0635=_0x17ddb7[_0xfe5a('0x3b')][_0x10aa98];_0x243271[_0xfe5a('0x20')][_0xfe5a('0x24')][_0xfe5a('0x19')]({'filename':_0x1b0635[_0xfe5a('0x3c')],'content':new Buffer(_0x1b0635[_0xfe5a('0x3d')])});}}}_0x16bb85(parseEmail(_0xec56ad,_0x162c48,_0x243271));});}else{_0x162c48[_0xfe5a('0x14')]=_0xfe5a('0x3a');_0x16bb85(parseEmail(_0xec56ad,_0x162c48,_0x243271));}}else{_0x16bb85(parseEmail(_0xec56ad,_0x162c48,_0x243271));}};exports['getHost']=function(_0x5bccae){switch(_0x5bccae){case _0xfe5a('0x3e'):return'imap.gmail.com';case'yahoo':return _0xfe5a('0x3f');case _0xfe5a('0x40'):return _0xfe5a('0x41');case _0xfe5a('0x42'):return _0xfe5a('0x43');}return _0xfe5a('0x44');};
\ No newline at end of file
index e7cd1cc..5128191 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2be=['Service','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x5dacf5,_0x525f75){var _0x26fb33=function(_0x3b1ce9){while(--_0x3b1ce9){_0x5dacf5['push'](_0x5dacf5['shift']());}};_0x26fb33(++_0x525f75);}(_0xb2be,0x15e));var _0xeb2b=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0xb2be[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0xeb2b('0x0'));function MailAccount(_0x3847c4){this['id']=_0x3847c4['id']||0x0;this['name']=_0x3847c4[_0xeb2b('0x1')]||_0xeb2b('0x2');this['key']=_0x3847c4['key']||_0xeb2b('0x3');this[_0xeb2b('0x4')]=_0x3847c4['active']||![];this['Imap']=_0x3847c4[_0xeb2b('0x5')]||[];this[_0xeb2b('0x6')]=_0x3847c4['Smtp']||[];}module[_0xeb2b('0x7')]=MailAccount;
\ No newline at end of file
+var _0x2014=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x2e2bfa,_0x33f408){var _0x42a9c1=function(_0xdc1632){while(--_0xdc1632){_0x2e2bfa['push'](_0x2e2bfa['shift']());}};_0x42a9c1(++_0x33f408);}(_0x2014,0xfc));var _0x4201=function(_0x37c902,_0xba15bb){_0x37c902=_0x37c902-0x0;var _0xf22861=_0x2014[_0x37c902];return _0xf22861;};'use strict';var _=require(_0x4201('0x0'));function MailAccount(_0x478aeb){this['id']=_0x478aeb['id']||0x0;this[_0x4201('0x1')]=_0x478aeb[_0x4201('0x1')]||_0x4201('0x2');this[_0x4201('0x3')]=_0x478aeb[_0x4201('0x3')]||_0x4201('0x4');this[_0x4201('0x5')]=_0x478aeb[_0x4201('0x5')]||![];this[_0x4201('0x6')]=_0x478aeb[_0x4201('0x6')]||[];this[_0x4201('0x7')]=_0x478aeb[_0x4201('0x7')]||[];}module[_0x4201('0x8')]=MailAccount;
\ No newline at end of file
index 796b856..8e1514a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeefc=['lodash','mailAccounts','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x36e764,_0x578ff9){var _0x3fe56b=function(_0x49afdd){while(--_0x49afdd){_0x36e764['push'](_0x36e764['shift']());}};_0x3fe56b(++_0x578ff9);}(_0xeefc,0x1dc));var _0xceef=function(_0x14c8a9,_0x3033ad){_0x14c8a9=_0x14c8a9-0x0;var _0x1f74b9=_0xeefc[_0x14c8a9];return _0x1f74b9;};'use strict';var _=require(_0xceef('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xceef('0x1')]={};};function freeIsNotKey(_0x3111a1,_0x597264,_0x3b82a0){var _0x11d94c=_['mapKeys'](_0x3111a1,function(_0x1abb8c,_0x5e4fa0){return _0x1abb8c[_0x3b82a0];});for(var _0x409241 in _0x597264){if(_0x597264['hasOwnProperty'](_0x409241)){if(!_0x11d94c[_0x409241]){delete _0x597264[_0x409241];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x4146a5,_0x23a688){for(var _0x23d213 in _0x23a688){if(_0x4146a5['hasOwnProperty'](_0x23d213)){_0x4146a5[_0x23d213]=_0x23a688[_0x23d213];}}};Realtime['prototype'][_0xceef('0x2')]=function(){var _0x560cd7=this;return function(_0x21831c){if(_0x21831c){freeIsNotKey(_0x21831c,_0x560cd7['mailAccounts'],'id');for(var _0x385808=0x0,_0x23c91a={},_0x42e1e6={};_0x385808<_0x21831c[_0xceef('0x3')];_0x385808+=0x1){_0x23c91a=_0x21831c[_0x385808];if(_[_0xceef('0x4')](_0x560cd7[_0xceef('0x1')][_0x23c91a['id']])){_0x560cd7[_0xceef('0x1')][_0x23c91a['id']]=new MailAccount(_0x23c91a);}else{_[_0xceef('0x5')](_0x560cd7[_0xceef('0x1')][_0x23c91a['id']],_0x23c91a);}}}return _0x560cd7[_0xceef('0x1')];};};module[_0xceef('0x6')]=Realtime;
\ No newline at end of file
+var _0x0808=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports'];(function(_0x453eaa,_0x242336){var _0x5cf2a0=function(_0x19b950){while(--_0x19b950){_0x453eaa['push'](_0x453eaa['shift']());}};_0x5cf2a0(++_0x242336);}(_0x0808,0x11e));var _0x8080=function(_0x18c327,_0x3ee7f8){_0x18c327=_0x18c327-0x0;var _0x1eed42=_0x0808[_0x18c327];return _0x1eed42;};'use strict';var _=require(_0x8080('0x0'));var MailAccount=require(_0x8080('0x1'));var Realtime=function(){this[_0x8080('0x2')]={};};function freeIsNotKey(_0x2139e8,_0x1a9781,_0x2b46fa){var _0x30383a=_[_0x8080('0x3')](_0x2139e8,function(_0x3a9bfc,_0x76320c){return _0x3a9bfc[_0x2b46fa];});for(var _0x206639 in _0x1a9781){if(_0x1a9781[_0x8080('0x4')](_0x206639)){if(!_0x30383a[_0x206639]){delete _0x1a9781[_0x206639];}}}}Realtime[_0x8080('0x5')][_0x8080('0x6')]=function(_0x2d02b7,_0x41a3e1){for(var _0x2c16b0 in _0x41a3e1){if(_0x2d02b7[_0x8080('0x4')](_0x2c16b0)){_0x2d02b7[_0x2c16b0]=_0x41a3e1[_0x2c16b0];}}};Realtime[_0x8080('0x5')][_0x8080('0x7')]=function(){var _0x205f9c=this;return function(_0x2c020f){if(_0x2c020f){freeIsNotKey(_0x2c020f,_0x205f9c[_0x8080('0x2')],'id');for(var _0x49fb62=0x0,_0x488544={},_0x248668={};_0x49fb62<_0x2c020f[_0x8080('0x8')];_0x49fb62+=0x1){_0x488544=_0x2c020f[_0x49fb62];if(_[_0x8080('0x9')](_0x205f9c[_0x8080('0x2')][_0x488544['id']])){_0x205f9c[_0x8080('0x2')][_0x488544['id']]=new MailAccount(_0x488544);}else{_['merge'](_0x205f9c[_0x8080('0x2')][_0x488544['id']],_0x488544);}}}return _0x205f9c[_0x8080('0x2')];};};module[_0x8080('0xa')]=Realtime;
\ No newline at end of file
index cc63267..6df1c4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1db=['../client','Request','GetMailAccount','name','service','email','key','ListId','TemplateId','MailServerOut','notify','NotifyMailAccount'];(function(_0x2e8278,_0x5212a0){var _0x3b369f=function(_0x26a6a7){while(--_0x26a6a7){_0x2e8278['push'](_0x2e8278['shift']());}};_0x3b369f(++_0x5212a0);}(_0xc1db,0x120));var _0xbc1d=function(_0x3dc795,_0x16dc5b){_0x3dc795=_0x3dc795-0x0;var _0x17e123=_0xc1db[_0x3dc795];return _0x17e123;};'use strict';var client=require(_0xbc1d('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xbc1d('0x1')](_0xbc1d('0x2'),{'options':{'attributes':['id',_0xbc1d('0x3'),_0xbc1d('0x4'),_0xbc1d('0x5'),'active',_0xbc1d('0x6'),_0xbc1d('0x7'),_0xbc1d('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':_0xbc1d('0x9'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0xbc1d('0xa')]=function(_0x562549,_0x268200){return client[_0xbc1d('0x1')]('NotifyMailAccount',{'account':{'id':_0x562549},'body':_0x268200,'log':_0xbc1d('0xb')});};
\ No newline at end of file
+var _0x2297=['getMailAccounts','Request','GetMailAccount','service','email','active','ListId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x2297,0x186));var _0x7229=function(_0x421514,_0x14d5f6){_0x421514=_0x421514-0x0;var _0x48e770=_0x2297[_0x421514];return _0x48e770;};'use strict';var client=require('../client');exports[_0x7229('0x0')]=function(){return function(){return client[_0x7229('0x1')](_0x7229('0x2'),{'options':{'attributes':['id','name',_0x7229('0x3'),_0x7229('0x4'),_0x7229('0x5'),'key',_0x7229('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x7229('0x7'),'as':'Imap'},{'model':_0x7229('0x8'),'as':_0x7229('0x9')}]},'log':_0x7229('0xa')});};};exports[_0x7229('0xb')]=function(_0x21e9d0,_0x3100bf){return client[_0x7229('0x1')](_0x7229('0xc'),{'account':{'id':_0x21e9d0},'body':_0x3100bf,'log':_0x7229('0xc')});};
\ No newline at end of file
index 366f46a..8c23797 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x886a=['GetSettings','../client','getSettings','ShowSetting','loginMailFrequency'];(function(_0x5ce36b,_0x1fead3){var _0x394c98=function(_0x5e7d42){while(--_0x5e7d42){_0x5ce36b['push'](_0x5ce36b['shift']());}};_0x394c98(++_0x1fead3);}(_0x886a,0x18c));var _0xa886=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x886a[_0x29d94e];return _0x106237;};'use strict';var client=require(_0xa886('0x0'));exports[_0xa886('0x1')]=function(){return client['Request'](_0xa886('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa886('0x3')]},'log':_0xa886('0x4')});};
\ No newline at end of file
+var _0x40ee=['Request','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x1dc446,_0x27de1d){var _0xb586f0=function(_0x4a4278){while(--_0x4a4278){_0x1dc446['push'](_0x1dc446['shift']());}};_0xb586f0(++_0x27de1d);}(_0x40ee,0x1b6));var _0xe40e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x40ee[_0x4243a3];return _0x1b2a33;};'use strict';var client=require(_0xe40e('0x0'));exports[_0xe40e('0x1')]=function(){return client[_0xe40e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe40e('0x3')]},'log':_0xe40e('0x4')});};
\ No newline at end of file
index ce61225..c0f8cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 d3ae8be..3f1d723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb509=['default','../../config/express','../../routes','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express','ioredis','createServer','timeout','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers'];(function(_0x356154,_0x29b94c){var _0x42c4a7=function(_0x20bab1){while(--_0x20bab1){_0x356154['push'](_0x356154['shift']());}};_0x42c4a7(++_0x29b94c);}(_0xb509,0xa5));var _0x9b50=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xb509[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x9b50('0x0'));var http=require(_0x9b50('0x1'));var express=require(_0x9b50('0x2'));var sticky=require('sticky-session');var Redis=require(_0x9b50('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x9b50('0x4')](app);server[_0x9b50('0x5')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x9b50('0x6'))(server,{'transports':[_0x9b50('0x7'),_0x9b50('0x8')]});config[_0x9b50('0x9')]=_[_0x9b50('0xa')](config['redis'],{'host':_0x9b50('0xb'),'port':0x18eb});socketio[_0x9b50('0xc')](require(_0x9b50('0xd'))({'pubClient':new Redis(config[_0x9b50('0x9')]),'subClient':new Redis(config['redis'])}));require(_0x9b50('0xe'))[_0x9b50('0xf')]();require('../../config/socketio')['default'](socketio);require(_0x9b50('0x10'))['default'](app);require(_0x9b50('0x11'))['default'](app);}else{server['once']('listening',function(){console['log'](_0x9b50('0x12'),config[_0x9b50('0x13')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0xc9be=['socket.io','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','../../config/environment','listen','port'];(function(_0x462697,_0x4ed303){var _0x32c7de=function(_0x3c0e68){while(--_0x3c0e68){_0x462697['push'](_0x462697['shift']());}};_0x32c7de(++_0x4ed303);}(_0xc9be,0x1f2));var _0xec9b=function(_0x30198,_0xf69f90){_0x30198=_0x30198-0x0;var _0x4e9006=_0xc9be[_0x30198];return _0x4e9006;};'use strict';var _=require('lodash');var http=require(_0xec9b('0x0'));var express=require(_0xec9b('0x1'));var sticky=require('sticky-session');var Redis=require(_0xec9b('0x2'));var config=require(_0xec9b('0x3'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xec9b('0x4')](server,config[_0xec9b('0x5')])){var socketio=require(_0xec9b('0x6'))(server,{'transports':['websocket','polling']});config[_0xec9b('0x7')]=_[_0xec9b('0x8')](config[_0xec9b('0x7')],{'host':_0xec9b('0x9'),'port':0x18eb});socketio['adapter'](require(_0xec9b('0xa'))({'pubClient':new Redis(config[_0xec9b('0x7')]),'subClient':new Redis(config[_0xec9b('0x7')])}));require(_0xec9b('0xb'))[_0xec9b('0xc')]();require(_0xec9b('0xd'))[_0xec9b('0xc')](socketio);require('../../config/express')['default'](app);require(_0xec9b('0xe'))[_0xec9b('0xc')](app);}else{server['once'](_0xec9b('0xf'),function(){console['log'](_0xec9b('0x10'),config[_0xec9b('0x5')]);});}exports=module[_0xec9b('0x11')]=app;
\ No newline at end of file
index b52da35..e852ebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x168c=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','rpc','routing','error','message','catch','exports'];(function(_0x127a5a,_0x57d501){var _0x587c2b=function(_0x413462){while(--_0x413462){_0x127a5a['push'](_0x127a5a['shift']());}};_0x587c2b(++_0x57d501);}(_0x168c,0xd2));var _0xc168=function(_0x33f9d7,_0x86cac2){_0x33f9d7=_0x33f9d7-0x0;var _0x2bd1e9=_0x168c[_0x33f9d7];return _0x2bd1e9;};'use strict';var jayson=require(_0xc168('0x0'));var BPromise=require(_0xc168('0x1'));var logger=require(_0xc168('0x2'))('routing');var client=jayson[_0xc168('0x3')][_0xc168('0x4')]({'port':0x2329});client[_0xc168('0x5')]=function(_0x386310,_0x3fde14){return new BPromise(function(_0x36a47a,_0x350b03){return client[_0xc168('0x6')](_0x386310,_0x3fde14)[_0xc168('0x7')](function(_0x528602){logger['debug'](_0xc168('0x8'),_0xc168('0x9'),_0x386310,_0x3fde14,_0x528602);if(_0x528602[_0xc168('0xa')]){logger[_0xc168('0xa')](_0xc168('0x8'),'routing',_0x386310,_0x528602[_0xc168('0xa')][_0xc168('0xb')],_0x3fde14);return _0x350b03(_0x528602[_0xc168('0xa')]['message']);}else{return _0x36a47a(_0x528602['result']);}})[_0xc168('0xc')](function(_0x25bec9){logger['error']('rpc','routing',_0x386310,_0x25bec9,_0x3fde14);return _0x350b03(_0x25bec9);});});};module[_0xc168('0xd')]=client;
\ No newline at end of file
+var _0xfaa1=['then','rpc','error','message','exports','routing','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfaa1,0xd4));var _0x1faa=function(_0x4f96d0,_0x401802){_0x4f96d0=_0x4f96d0-0x0;var _0x2b24db=_0xfaa1[_0x4f96d0];return _0x2b24db;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x1faa('0x0'));var client=jayson[_0x1faa('0x1')][_0x1faa('0x2')]({'port':0x2329});client['Request']=function(_0x51fc3f,_0x9f0fde){return new BPromise(function(_0xf1a3f9,_0x3ab386){return client[_0x1faa('0x3')](_0x51fc3f,_0x9f0fde)[_0x1faa('0x4')](function(_0xd25c63){logger['debug'](_0x1faa('0x5'),_0x1faa('0x0'),_0x51fc3f,_0x9f0fde,_0xd25c63);if(_0xd25c63[_0x1faa('0x6')]){logger[_0x1faa('0x6')](_0x1faa('0x5'),_0x1faa('0x0'),_0x51fc3f,_0xd25c63['error'][_0x1faa('0x7')],_0x9f0fde);return _0x3ab386(_0xd25c63[_0x1faa('0x6')]['message']);}else{return _0xf1a3f9(_0xd25c63['result']);}})['catch'](function(_0x2df81f){logger[_0x1faa('0x6')](_0x1faa('0x5'),_0x1faa('0x0'),_0x51fc3f,_0x2df81f,_0x9f0fde);return _0x3ab386(_0x2df81f);});});};module[_0x1faa('0x8')]=client;
\ No newline at end of file
index 77073c8..2d7b606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e40=['bluebird','./server','./realtime','./rpc/user','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','log'];(function(_0x13d7d6,_0x3ca322){var _0x25f79b=function(_0x555d64){while(--_0x555d64){_0x13d7d6['push'](_0x13d7d6['shift']());}};_0x25f79b(++_0x3ca322);}(_0x6e40,0x1b0));var _0x06e4=function(_0x476871,_0x3db26e){_0x476871=_0x476871-0x0;var _0x143357=_0x6e40[_0x476871];return _0x143357;};'use strict';var BPromise=require(_0x06e4('0x0'));var server=require(_0x06e4('0x1'));var Realtime=require(_0x06e4('0x2'));var user=require(_0x06e4('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x06e4('0x4'));var mailQueue=require(_0x06e4('0x5'));var faxQueue=require(_0x06e4('0x6'));var whatsappQueue=require(_0x06e4('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x06e4('0x8')]()[_0x06e4('0x9')](user[_0x06e4('0xa')]())[_0x06e4('0x9')](realtime[_0x06e4('0xb')]())[_0x06e4('0x9')](interval[_0x06e4('0xc')]())[_0x06e4('0x9')](realtime[_0x06e4('0xd')]())[_0x06e4('0x9')](openchannelQueue[_0x06e4('0xe')]())[_0x06e4('0x9')](realtime['initOpenchannelQueues']())[_0x06e4('0x9')](chatQueue[_0x06e4('0xf')]())['then'](realtime['initChatQueues']())[_0x06e4('0x9')](smsQueue[_0x06e4('0x10')]())[_0x06e4('0x9')](realtime[_0x06e4('0x11')]())[_0x06e4('0x9')](mailQueue['getMailQueues']())[_0x06e4('0x9')](realtime[_0x06e4('0x12')]())[_0x06e4('0x9')](faxQueue[_0x06e4('0x13')]())['then'](realtime[_0x06e4('0x14')]())[_0x06e4('0x9')](whatsappQueue['getWhatsappQueues']())[_0x06e4('0x9')](realtime[_0x06e4('0x15')]())[_0x06e4('0x9')](function(){return realtime;});}function main(){return server[_0x06e4('0x16')](realtime)['then'](function(_0x65dd16){return initRealtime();})['then'](function(_0x25e8f2){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1bd988){console[_0x06e4('0x17')](_0x1bd988);});}main();
\ No newline at end of file
+var _0xfc5a=['getWhatsappQueues','listen','log','bluebird','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfc5a,0xea));var _0xafc5=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xfc5a[_0x492af5];return _0x59f529;};'use strict';var BPromise=require(_0xafc5('0x0'));var server=require(_0xafc5('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xafc5('0x2'));var openchannelQueue=require(_0xafc5('0x3'));var chatQueue=require(_0xafc5('0x4'));var smsQueue=require(_0xafc5('0x5'));var mailQueue=require(_0xafc5('0x6'));var faxQueue=require(_0xafc5('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xafc5('0x8')](user[_0xafc5('0x9')]())[_0xafc5('0x8')](realtime[_0xafc5('0xa')]())[_0xafc5('0x8')](interval['getIntervals']())['then'](realtime[_0xafc5('0xb')]())[_0xafc5('0x8')](openchannelQueue[_0xafc5('0xc')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xafc5('0xd')]())[_0xafc5('0x8')](realtime['initChatQueues']())['then'](smsQueue[_0xafc5('0xe')]())[_0xafc5('0x8')](realtime[_0xafc5('0xf')]())[_0xafc5('0x8')](mailQueue['getMailQueues']())[_0xafc5('0x8')](realtime['initMailQueues']())[_0xafc5('0x8')](faxQueue[_0xafc5('0x10')]())[_0xafc5('0x8')](realtime[_0xafc5('0x11')]())['then'](whatsappQueue[_0xafc5('0x12')]())[_0xafc5('0x8')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xafc5('0x13')](realtime)['then'](function(_0x96e435){return initRealtime();})[_0xafc5('0x8')](function(_0x1a84c7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x12b9c6){console[_0xafc5('0x14')](_0x12b9c6);});}main();
\ No newline at end of file
index 51e11fe..392b0ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x17f119,_0x4832fc){var _0x484c5f=function(_0x389785){while(--_0x389785){_0x17f119['push'](_0x17f119['shift']());}};_0x484c5f(++_0x4832fc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
+var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x4aa1b1,_0x56b523){var _0x1961c4=function(_0x3baa15){while(--_0x3baa15){_0x4aa1b1['push'](_0x4aa1b1['shift']());}};_0x1961c4(++_0x56b523);}(_0x5fc3,0xa8));var _0x35fc=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x5fc3[_0x334651];return _0x29657c;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
index 8ab0495..1e2d3d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd374=['http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x41670f,_0xeb9b31){var _0x55a99d=function(_0x28a059){while(--_0x28a059){_0x41670f['push'](_0x41670f['shift']());}};_0x55a99d(++_0xeb9b31);}(_0xd374,0xf0));var _0x4d37=function(_0x551d01,_0x86fcd9){_0x551d01=_0x551d01-0x0;var _0x52fc7b=_0xd374[_0x551d01];return _0x52fc7b;};'use strict';var BPromise=require(_0x4d37('0x0'));var jayson=require(_0x4d37('0x1'));var client=jayson['client'][_0x4d37('0x2')]({'port':0x232b});function request(_0x42ff2b,_0x2a9dd0){return new BPromise(function(_0x5b6e5c,_0x18ea78){return client[_0x4d37('0x3')](_0x42ff2b,_0x2a9dd0)[_0x4d37('0x4')](function(_0xd7f0e8){if(_0xd7f0e8['error']){return _0x18ea78(_0xd7f0e8[_0x4d37('0x5')][_0x4d37('0x6')]);}else{return _0x5b6e5c(_0xd7f0e8[_0x4d37('0x7')]);}})[_0x4d37('0x8')](function(_0x7609c0){return _0x18ea78(_0x7609c0);});});}exports[_0x4d37('0x9')]=function(_0x37455c,_0x4488b5){return request(_0x4d37('0xa'),{'account':_0x37455c,'message':_0x4488b5});};
\ No newline at end of file
+var _0x318e=['http','request','error','message','catch','jayson/promise'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x318e,0x14f));var _0xe318=function(_0xe18db9,_0x5d53be){_0xe18db9=_0xe18db9-0x0;var _0x2331e8=_0x318e[_0xe18db9];return _0x2331e8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe318('0x0'));var client=jayson['client'][_0xe318('0x1')]({'port':0x232b});function request(_0x1468f6,_0x590192){return new BPromise(function(_0x2d46ea,_0x92776e){return client[_0xe318('0x2')](_0x1468f6,_0x590192)['then'](function(_0x3730f5){if(_0x3730f5[_0xe318('0x3')]){return _0x92776e(_0x3730f5[_0xe318('0x3')][_0xe318('0x4')]);}else{return _0x2d46ea(_0x3730f5['result']);}})[_0xe318('0x5')](function(_0x4e2eb8){return _0x92776e(_0x4e2eb8);});});}exports['sendMailMessage']=function(_0x1552af,_0x494fb3){return request('SendMail',{'account':_0x1552af,'message':_0x494fb3});};
\ No newline at end of file
index 21c1db1..1a8aa72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x127c=['mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','format','name','openchannelPause','chatStatus','chatCapacity','smsStatus','smsCapacity','busy','stringify','emit','user:save','exports','lodash','md5','defaults','redis','localhost','socket.io-emitter','online','voicePause','chatPause','faxPause','smsPause','chatStatusTime','chatCurrentCapacity','mailStatus','unknown','mailStatusTime'];(function(_0x257e20,_0x484633){var _0x3e673a=function(_0x35f37f){while(--_0x35f37f){_0x257e20['push'](_0x257e20['shift']());}};_0x3e673a(++_0x484633);}(_0x127c,0x121));var _0xc127=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x127c[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc127('0x0'));var moment=require('moment');var md5=require(_0xc127('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xc127('0x2')](config[_0xc127('0x3')],{'host':_0xc127('0x4'),'port':0x18eb});var io=require(_0xc127('0x5'))(new Redis(config[_0xc127('0x3')]));function Agent(_0x442099){this['id']=_0x442099['id']||0x0;this['name']=_0x442099['name']||'';this[_0xc127('0x6')]=_0x442099[_0xc127('0x6')]||!![];this[_0xc127('0x7')]=_0x442099[_0xc127('0x7')]||![];this[_0xc127('0x8')]=_0x442099[_0xc127('0x8')]||![];this['mailPause']=_0x442099['mailPause']||![];this[_0xc127('0x9')]=_0x442099[_0xc127('0x9')]||![];this['smsPause']=_0x442099[_0xc127('0xa')]||![];this['openchannelPause']=_0x442099['openchannelPause']||![];this['chatStatus']='unknown';this[_0xc127('0xb')]=0x0;this['chatCapacity']=_0x442099['chatCapacity']||0x0;this[_0xc127('0xc')]=0x0;this[_0xc127('0xd')]=_0xc127('0xe');this[_0xc127('0xf')]=0x0;this[_0xc127('0x10')]=_0x442099[_0xc127('0x10')]||0x0;this[_0xc127('0x11')]=0x0;this[_0xc127('0x12')]=_0xc127('0xe');this[_0xc127('0x13')]=0x0;this[_0xc127('0x14')]=_0x442099[_0xc127('0x14')]||0x0;this[_0xc127('0x15')]=0x0;this['smsStatus']=_0xc127('0xe');this[_0xc127('0x16')]=0x0;this['smsCapacity']=_0x442099['smsCapacity']||0x0;this[_0xc127('0x17')]=0x0;this[_0xc127('0x18')]=_0xc127('0xe');this[_0xc127('0x19')]=0x0;this[_0xc127('0x1a')]=_0x442099[_0xc127('0x1a')]||0x0;this[_0xc127('0x1b')]=0x0;this[_0xc127('0x1c')]=_0xc127('0xe');this[_0xc127('0x1d')]=0x0;this[_0xc127('0x1e')]=_0x442099[_0xc127('0x1e')]||0x0;this[_0xc127('0x1f')]=0x0;this['busy']=![];this[_0xc127('0x20')]=undefined;this[_0xc127('0x1')]='';this['updateRealtime']();}Agent[_0xc127('0x21')][_0xc127('0x22')]=function(_0x497c1d){if(this[_0x497c1d+_0xc127('0x23')]>0x0){if(this[_0x497c1d+'Capacity']>0x0&&this[_0x497c1d+_0xc127('0x23')]>=this[_0x497c1d+_0xc127('0x24')]){return _0xc127('0x25');}else{return _0xc127('0x26');}}else{return _0xc127('0x27');}};Agent[_0xc127('0x21')][_0xc127('0x28')]=function(){var _0xe7634d=[_0xc127('0x29'),_0xc127('0x2a'),_0xc127('0x2b'),'fax',_0xc127('0x2c'),_0xc127('0x2d')];for(var _0x4b5583=0x0;_0x4b5583<_0xe7634d[_0xc127('0x2e')];_0x4b5583+=0x1){var _0x515703=this[_0xc127('0x22')](_0xe7634d[_0x4b5583]);if(this[_0xe7634d[_0x4b5583]+_0xc127('0x2f')]!==_0x515703){this[_0xe7634d[_0x4b5583]+_0xc127('0x30')]=_['toNumber'](moment()[_0xc127('0x31')]('x'));}this[_0xe7634d[_0x4b5583]+_0xc127('0x2f')]=_0x515703;}var _0x3d6a32={'id':this['id'],'name':this[_0xc127('0x32')],'online':this[_0xc127('0x6')],'voicePause':this['voicePause'],'chatPause':this[_0xc127('0x8')],'mailPause':this['mailPause'],'smsPause':this[_0xc127('0xa')],'faxPause':this[_0xc127('0x9')],'openchannelPause':this[_0xc127('0x33')],'chatStatus':this[_0xc127('0x34')],'chatStatusTime':this[_0xc127('0xb')],'chatCapacity':this[_0xc127('0x35')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xc127('0xf')],'mailCapacity':this[_0xc127('0x10')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xc127('0x12')],'faxStatusTime':this[_0xc127('0x13')],'faxCapacity':this[_0xc127('0x14')],'faxCurrentCapacity':this[_0xc127('0x15')],'smsStatus':this[_0xc127('0x36')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xc127('0x37')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xc127('0x18')],'whatsappStatusTime':this[_0xc127('0x19')],'whatsappCapacity':this[_0xc127('0x1a')],'whatsappCurrentCapacity':this[_0xc127('0x1b')],'openchannelStatus':this[_0xc127('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xc127('0x1e')],'openchannelCurrentCapacity':this[_0xc127('0x1f')],'busy':this[_0xc127('0x38')],'busyQueue':this[_0xc127('0x20')]};var _0x548c32=md5(JSON[_0xc127('0x39')](_0x3d6a32));if(this[_0xc127('0x1')]!==_0x548c32){this[_0xc127('0x1')]=_0x548c32;io[_0xc127('0x3a')](_0xc127('0x3b'),_0x3d6a32);}};module[_0xc127('0x3c')]=Agent;
\ No newline at end of file
+var _0x7fb3=['sms','whatsapp','length','getChannelStatus','Status','toNumber','format','voicePause','chatStatus','mailCapacity','faxCurrentCapacity','emit','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','CurrentCapacity','Capacity','maxcapacity','working','mail','openchannel','fax'];(function(_0x4e00f3,_0x4e7ccc){var _0x2e3471=function(_0x485126){while(--_0x485126){_0x4e00f3['push'](_0x4e00f3['shift']());}};_0x2e3471(++_0x4e7ccc);}(_0x7fb3,0xf9));var _0x37fb=function(_0x5c3c9f,_0x2b6352){_0x5c3c9f=_0x5c3c9f-0x0;var _0x53f7e9=_0x7fb3[_0x5c3c9f];return _0x53f7e9;};'use strict';var _=require(_0x37fb('0x0'));var moment=require(_0x37fb('0x1'));var md5=require(_0x37fb('0x2'));var Redis=require(_0x37fb('0x3'));var config=require('../../../config/environment');config[_0x37fb('0x4')]=_[_0x37fb('0x5')](config[_0x37fb('0x4')],{'host':_0x37fb('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x37fb('0x4')]));function Agent(_0xb4ad77){this['id']=_0xb4ad77['id']||0x0;this[_0x37fb('0x7')]=_0xb4ad77[_0x37fb('0x7')]||'';this[_0x37fb('0x8')]=_0xb4ad77[_0x37fb('0x8')]||!![];this['voicePause']=_0xb4ad77['voicePause']||![];this['chatPause']=_0xb4ad77[_0x37fb('0x9')]||![];this[_0x37fb('0xa')]=_0xb4ad77[_0x37fb('0xa')]||![];this[_0x37fb('0xb')]=_0xb4ad77[_0x37fb('0xb')]||![];this[_0x37fb('0xc')]=_0xb4ad77[_0x37fb('0xc')]||![];this[_0x37fb('0xd')]=_0xb4ad77['openchannelPause']||![];this['chatStatus']=_0x37fb('0xe');this[_0x37fb('0xf')]=0x0;this[_0x37fb('0x10')]=_0xb4ad77[_0x37fb('0x10')]||0x0;this[_0x37fb('0x11')]=0x0;this[_0x37fb('0x12')]=_0x37fb('0xe');this[_0x37fb('0x13')]=0x0;this['mailCapacity']=_0xb4ad77['mailCapacity']||0x0;this[_0x37fb('0x14')]=0x0;this[_0x37fb('0x15')]=_0x37fb('0xe');this[_0x37fb('0x16')]=0x0;this['faxCapacity']=_0xb4ad77[_0x37fb('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x37fb('0x18')]=_0x37fb('0xe');this[_0x37fb('0x19')]=0x0;this[_0x37fb('0x1a')]=_0xb4ad77[_0x37fb('0x1a')]||0x0;this[_0x37fb('0x1b')]=0x0;this[_0x37fb('0x1c')]=_0x37fb('0xe');this[_0x37fb('0x1d')]=0x0;this[_0x37fb('0x1e')]=_0xb4ad77[_0x37fb('0x1e')]||0x0;this[_0x37fb('0x1f')]=0x0;this[_0x37fb('0x20')]=_0x37fb('0xe');this[_0x37fb('0x21')]=0x0;this[_0x37fb('0x22')]=_0xb4ad77[_0x37fb('0x22')]||0x0;this[_0x37fb('0x23')]=0x0;this[_0x37fb('0x24')]=![];this[_0x37fb('0x25')]=undefined;this[_0x37fb('0x2')]='';this['updateRealtime']();}Agent[_0x37fb('0x26')]['getChannelStatus']=function(_0xfdaab8){if(this[_0xfdaab8+_0x37fb('0x27')]>0x0){if(this[_0xfdaab8+_0x37fb('0x28')]>0x0&&this[_0xfdaab8+_0x37fb('0x27')]>=this[_0xfdaab8+_0x37fb('0x28')]){return _0x37fb('0x29');}else{return _0x37fb('0x2a');}}else{return'idle';}};Agent[_0x37fb('0x26')]['updateRealtime']=function(){var _0x496320=[_0x37fb('0x2b'),'chat',_0x37fb('0x2c'),_0x37fb('0x2d'),_0x37fb('0x2e'),_0x37fb('0x2f')];for(var _0x408024=0x0;_0x408024<_0x496320[_0x37fb('0x30')];_0x408024+=0x1){var _0x4000ed=this[_0x37fb('0x31')](_0x496320[_0x408024]);if(this[_0x496320[_0x408024]+_0x37fb('0x32')]!==_0x4000ed){this[_0x496320[_0x408024]+'StatusTime']=_[_0x37fb('0x33')](moment()[_0x37fb('0x34')]('x'));}this[_0x496320[_0x408024]+'Status']=_0x4000ed;}var _0x5f189a={'id':this['id'],'name':this[_0x37fb('0x7')],'online':this[_0x37fb('0x8')],'voicePause':this[_0x37fb('0x35')],'chatPause':this[_0x37fb('0x9')],'mailPause':this[_0x37fb('0xa')],'smsPause':this[_0x37fb('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x37fb('0xd')],'chatStatus':this[_0x37fb('0x36')],'chatStatusTime':this[_0x37fb('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x37fb('0x11')],'mailStatus':this[_0x37fb('0x12')],'mailStatusTime':this[_0x37fb('0x13')],'mailCapacity':this[_0x37fb('0x37')],'mailCurrentCapacity':this[_0x37fb('0x14')],'faxStatus':this[_0x37fb('0x15')],'faxStatusTime':this[_0x37fb('0x16')],'faxCapacity':this[_0x37fb('0x17')],'faxCurrentCapacity':this[_0x37fb('0x38')],'smsStatus':this[_0x37fb('0x18')],'smsStatusTime':this[_0x37fb('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x37fb('0x1b')],'whatsappStatus':this[_0x37fb('0x1c')],'whatsappStatusTime':this[_0x37fb('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x37fb('0x1f')],'openchannelStatus':this[_0x37fb('0x20')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x37fb('0x22')],'openchannelCurrentCapacity':this[_0x37fb('0x23')],'busy':this[_0x37fb('0x24')],'busyQueue':this[_0x37fb('0x25')]};var _0x208708=md5(JSON['stringify'](_0x5f189a));if(this[_0x37fb('0x2')]!==_0x208708){this[_0x37fb('0x2')]=_0x208708;io[_0x37fb('0x39')]('user:save',_0x5f189a);}};module[_0x37fb('0x3a')]=Agent;
\ No newline at end of file
index 08ee4d1..cf5df96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe586=['Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0xd00c54,_0x103add){var _0x2178db=function(_0x299e64){while(--_0x299e64){_0xd00c54['push'](_0xd00c54['shift']());}};_0x2178db(++_0x103add);}(_0xe586,0x1a6));var _0x6e58=function(_0x18bfae,_0x6c38ec){_0x18bfae=_0x18bfae-0x0;var _0x41e227=_0xe586[_0x18bfae];return _0x41e227;};'use strict';var _=require(_0x6e58('0x0'));var md5=require(_0x6e58('0x1'));var util=require('util');var Redis=require(_0x6e58('0x2'));var config=require(_0x6e58('0x3'));config[_0x6e58('0x4')]=_['defaults'](config[_0x6e58('0x4')],{'host':_0x6e58('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e58('0x4')]));function ChatQueue(_0x2fc2a4){this['id']=_0x2fc2a4['id']||0x0;this[_0x6e58('0x6')]=_0x2fc2a4[_0x6e58('0x6')]||'';this[_0x6e58('0x7')]=_0x2fc2a4[_0x6e58('0x7')]||0xa;this[_0x6e58('0x8')]=_0x2fc2a4[_0x6e58('0x8')]||_0x6e58('0x9');this['Agents']=_0x2fc2a4[_0x6e58('0xa')];this[_0x6e58('0xb')]={};this[_0x6e58('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x6e58('0xd')]();}ChatQueue[_0x6e58('0xe')][_0x6e58('0xf')]=function(){var _0x306387=this[_0x6e58('0xb')][_0x6e58('0x10')];this[_0x6e58('0xb')]=_[_0x6e58('0x11')](this[_0x6e58('0xa')],'id');this[_0x6e58('0xb')][_0x6e58('0x10')]=_0x306387;};ChatQueue[_0x6e58('0xe')][_0x6e58('0xd')]=function(){this[_0x6e58('0x12')]=0x0;this[_0x6e58('0x13')]=0x0;for(var _0x1cce28=0x0;_0x1cce28<this[_0x6e58('0xa')]['length'];_0x1cce28+=0x1){if(this[_0x6e58('0xa')][_0x1cce28]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x1cce28][_0x6e58('0x14')]){this[_0x6e58('0x13')]+=0x1;}}this[_0x6e58('0x15')]=this[_0x6e58('0x12')]-this[_0x6e58('0x13')];this['available']=this[_0x6e58('0x15')]>=0x0?this[_0x6e58('0x15')]:0x0;var _0x327253={'id':this['id'],'available':this[_0x6e58('0x15')],'loggedIn':this[_0x6e58('0x12')],'name':this[_0x6e58('0x6')],'paused':this['paused'],'waiting':this[_0x6e58('0xc')]};var _0xbfd352=md5(JSON['stringify'](_0x327253));if(this[_0x6e58('0x1')]!==_0xbfd352){this[_0x6e58('0x1')]=_0xbfd352;io['to'](util[_0x6e58('0x16')](_0x6e58('0x17'),_0x327253['name']))[_0x6e58('0x18')](_0x6e58('0x19'),_0x327253);}};module[_0x6e58('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xd58a=['util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','Agents','chatPause','available','format','chat:queue:%s','emit','exports','lodash','md5'];(function(_0x30e870,_0x509a60){var _0x252193=function(_0x44ff0e){while(--_0x44ff0e){_0x30e870['push'](_0x30e870['shift']());}};_0x252193(++_0x509a60);}(_0xd58a,0x194));var _0xad58=function(_0x40de5d,_0x3943a8){_0x40de5d=_0x40de5d-0x0;var _0x3bd741=_0xd58a[_0x40de5d];return _0x3bd741;};'use strict';var _=require(_0xad58('0x0'));var md5=require(_0xad58('0x1'));var util=require(_0xad58('0x2'));var Redis=require(_0xad58('0x3'));var config=require(_0xad58('0x4'));config['redis']=_[_0xad58('0x5')](config[_0xad58('0x6')],{'host':_0xad58('0x7'),'port':0x18eb});var io=require(_0xad58('0x8'))(new Redis(config[_0xad58('0x6')]));function ChatQueue(_0x3c6d72){this['id']=_0x3c6d72['id']||0x0;this[_0xad58('0x9')]=_0x3c6d72[_0xad58('0x9')]||'';this[_0xad58('0xa')]=_0x3c6d72['timeout']||0xa;this['strategy']=_0x3c6d72[_0xad58('0xb')]||_0xad58('0xc');this['Agents']=_0x3c6d72['Agents'];this['mapAgentsId']={};this[_0xad58('0xd')]=0x0;this['md5']='';this[_0xad58('0xe')]();this[_0xad58('0xf')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x1317d3=this[_0xad58('0x10')][_0xad58('0x11')];this['mapAgentsId']=_[_0xad58('0x12')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x1317d3;};ChatQueue[_0xad58('0x13')][_0xad58('0xf')]=function(){this[_0xad58('0x14')]=0x0;this[_0xad58('0x15')]=0x0;for(var _0x447074=0x0;_0x447074<this[_0xad58('0x16')]['length'];_0x447074+=0x1){if(this[_0xad58('0x16')][_0x447074]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x447074][_0xad58('0x17')]){this[_0xad58('0x15')]+=0x1;}}this['available']=this[_0xad58('0x14')]-this[_0xad58('0x15')];this['available']=this[_0xad58('0x18')]>=0x0?this[_0xad58('0x18')]:0x0;var _0xb83c95={'id':this['id'],'available':this['available'],'loggedIn':this[_0xad58('0x14')],'name':this[_0xad58('0x9')],'paused':this[_0xad58('0x15')],'waiting':this[_0xad58('0xd')]};var _0x3e62c5=md5(JSON['stringify'](_0xb83c95));if(this[_0xad58('0x1')]!==_0x3e62c5){this[_0xad58('0x1')]=_0x3e62c5;io['to'](util[_0xad58('0x19')](_0xad58('0x1a'),_0xb83c95[_0xad58('0x9')]))[_0xad58('0x1b')]('chat_queue:save',_0xb83c95);}};module[_0xad58('0x1c')]=ChatQueue;
\ No newline at end of file
index dfa9025..ad36eb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x954f=['available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x4a4161,_0x17d438){var _0x13a997=function(_0x2d0fca){while(--_0x2d0fca){_0x4a4161['push'](_0x4a4161['shift']());}};_0x13a997(++_0x17d438);}(_0x954f,0x1c8));var _0xf954=function(_0x22283f,_0x39fa1d){_0x22283f=_0x22283f-0x0;var _0x45cb14=_0x954f[_0x22283f];return _0x45cb14;};'use strict';var _=require(_0xf954('0x0'));var md5=require(_0xf954('0x1'));var util=require(_0xf954('0x2'));var Redis=require(_0xf954('0x3'));var config=require('../../../config/environment');config[_0xf954('0x4')]=_[_0xf954('0x5')](config[_0xf954('0x4')],{'host':_0xf954('0x6'),'port':0x18eb});var io=require(_0xf954('0x7'))(new Redis(config[_0xf954('0x4')]));function FaxQueue(_0x5b40ec){this['id']=_0x5b40ec['id']||0x0;this[_0xf954('0x8')]=_0x5b40ec[_0xf954('0x8')]||'';this[_0xf954('0x9')]=_0x5b40ec['timeout']||0xa;this[_0xf954('0xa')]=_0x5b40ec['strategy']||_0xf954('0xb');this[_0xf954('0xc')]=_0x5b40ec[_0xf954('0xc')];this[_0xf954('0xd')]={};this[_0xf954('0xe')]=0x0;this[_0xf954('0x1')]='';this[_0xf954('0xf')]();this[_0xf954('0x10')]();}FaxQueue[_0xf954('0x11')][_0xf954('0xf')]=function(){var _0x102575=this['mapAgentsId'][_0xf954('0x12')];this[_0xf954('0xd')]=_[_0xf954('0x13')](this['Agents'],'id');this[_0xf954('0xd')][_0xf954('0x12')]=_0x102575;};FaxQueue[_0xf954('0x11')]['updateRealtime']=function(){this[_0xf954('0x14')]=0x0;this[_0xf954('0x15')]=0x0;for(var _0x70ec73=0x0;_0x70ec73<this[_0xf954('0xc')][_0xf954('0x16')];_0x70ec73+=0x1){if(this['Agents'][_0x70ec73][_0xf954('0x17')]){this[_0xf954('0x14')]+=0x1;}if(this[_0xf954('0xc')][_0x70ec73]['faxPause']){this[_0xf954('0x15')]+=0x1;}}this[_0xf954('0x18')]=this['loggedIn']-this['paused'];this['available']=this[_0xf954('0x18')]>=0x0?this[_0xf954('0x18')]:0x0;var _0x22f55f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf954('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x1aa30a=md5(JSON[_0xf954('0x19')](_0x22f55f));if(this[_0xf954('0x1')]!==_0x1aa30a){this['md5']=_0x1aa30a;io['to'](util['format'](_0xf954('0x1a'),_0x22f55f[_0xf954('0x8')]))[_0xf954('0x1b')](_0xf954('0x1c'),_0x22f55f);}};module[_0xf954('0x1d')]=FaxQueue;
\ No newline at end of file
+var _0x9e6b=['available','stringify','format','emit','fax_queue:save','lodash','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','faxPause'];(function(_0x26cb75,_0x4d2872){var _0x3e29dd=function(_0x303360){while(--_0x303360){_0x26cb75['push'](_0x26cb75['shift']());}};_0x3e29dd(++_0x4d2872);}(_0x9e6b,0x8c));var _0xb9e6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9e6b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb9e6('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xb9e6('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xb9e6('0x2')],{'host':_0xb9e6('0x3'),'port':0x18eb});var io=require(_0xb9e6('0x4'))(new Redis(config[_0xb9e6('0x2')]));function FaxQueue(_0x36cea0){this['id']=_0x36cea0['id']||0x0;this[_0xb9e6('0x5')]=_0x36cea0[_0xb9e6('0x5')]||'';this[_0xb9e6('0x6')]=_0x36cea0[_0xb9e6('0x6')]||0xa;this[_0xb9e6('0x7')]=_0x36cea0[_0xb9e6('0x7')]||'beepall';this[_0xb9e6('0x8')]=_0x36cea0['Agents'];this['mapAgentsId']={};this[_0xb9e6('0x9')]=0x0;this[_0xb9e6('0xa')]='';this[_0xb9e6('0xb')]();this[_0xb9e6('0xc')]();}FaxQueue[_0xb9e6('0xd')][_0xb9e6('0xb')]=function(){var _0x176195=this[_0xb9e6('0xe')]['_rr'];this['mapAgentsId']=_[_0xb9e6('0xf')](this[_0xb9e6('0x8')],'id');this[_0xb9e6('0xe')][_0xb9e6('0x10')]=_0x176195;};FaxQueue[_0xb9e6('0xd')][_0xb9e6('0xc')]=function(){this[_0xb9e6('0x11')]=0x0;this[_0xb9e6('0x12')]=0x0;for(var _0x1f3256=0x0;_0x1f3256<this['Agents'][_0xb9e6('0x13')];_0x1f3256+=0x1){if(this[_0xb9e6('0x8')][_0x1f3256][_0xb9e6('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x1f3256][_0xb9e6('0x15')]){this['paused']+=0x1;}}this[_0xb9e6('0x16')]=this['loggedIn']-this[_0xb9e6('0x12')];this['available']=this['available']>=0x0?this[_0xb9e6('0x16')]:0x0;var _0x3e4f09={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x5a9326=md5(JSON[_0xb9e6('0x17')](_0x3e4f09));if(this[_0xb9e6('0xa')]!==_0x5a9326){this[_0xb9e6('0xa')]=_0x5a9326;io['to'](util[_0xb9e6('0x18')]('fax:queue:%s',_0x3e4f09[_0xb9e6('0x5')]))[_0xb9e6('0x19')](_0xb9e6('0x1a'),_0x3e4f09);}};module['exports']=FaxQueue;
\ No newline at end of file
index a136069..2f546fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x339d=['name','Intervals','exports'];(function(_0x1bbf7a,_0x122c90){var _0x4c8b1c=function(_0x4791f0){while(--_0x4791f0){_0x1bbf7a['push'](_0x1bbf7a['shift']());}};_0x4c8b1c(++_0x122c90);}(_0x339d,0xf3));var _0xd339=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x339d[_0x5d6456];return _0x4d66c1;};'use strict';function Interval(_0x3b6ab2){this['id']=_0x3b6ab2['id']||0x0;this[_0xd339('0x0')]=_0x3b6ab2[_0xd339('0x0')]||'';this[_0xd339('0x1')]=_0x3b6ab2[_0xd339('0x1')]||{};}module[_0xd339('0x2')]=Interval;
\ No newline at end of file
+var _0x8c6b=['Intervals','exports'];(function(_0x56f5a0,_0x367560){var _0x2be119=function(_0x39c785){while(--_0x39c785){_0x56f5a0['push'](_0x56f5a0['shift']());}};_0x2be119(++_0x367560);}(_0x8c6b,0x198));var _0xb8c6=function(_0x4cd1c1,_0x33bc9a){_0x4cd1c1=_0x4cd1c1-0x0;var _0xa744db=_0x8c6b[_0x4cd1c1];return _0xa744db;};'use strict';function Interval(_0x2d9979){this['id']=_0x2d9979['id']||0x0;this['name']=_0x2d9979['name']||'';this[_0xb8c6('0x0')]=_0x2d9979[_0xb8c6('0x0')]||{};}module[_0xb8c6('0x1')]=Interval;
\ No newline at end of file
index f0b115a..479ee3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x844e=['ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','mailPause','available','waiting','format','emit','exports','lodash','md5'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0x844e,0xe8));var _0xe844=function(_0x1ad94d,_0x38965e){_0x1ad94d=_0x1ad94d-0x0;var _0x5bb280=_0x844e[_0x1ad94d];return _0x5bb280;};'use strict';var _=require(_0xe844('0x0'));var md5=require(_0xe844('0x1'));var util=require('util');var Redis=require(_0xe844('0x2'));var config=require(_0xe844('0x3'));config[_0xe844('0x4')]=_[_0xe844('0x5')](config['redis'],{'host':_0xe844('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0xef3bda){this['id']=_0xef3bda['id']||0x0;this[_0xe844('0x7')]=_0xef3bda[_0xe844('0x7')]||'';this[_0xe844('0x8')]=_0xef3bda[_0xe844('0x8')]||0xa;this[_0xe844('0x9')]=_0xef3bda[_0xe844('0x9')]||_0xe844('0xa');this['Agents']=_0xef3bda[_0xe844('0xb')];this[_0xe844('0xc')]={};this['waiting']=0x0;this[_0xe844('0x1')]='';this[_0xe844('0xd')]();this[_0xe844('0xe')]();}MailQueue[_0xe844('0xf')][_0xe844('0xd')]=function(){var _0x5141bb=this[_0xe844('0xc')][_0xe844('0x10')];this[_0xe844('0xc')]=_[_0xe844('0x11')](this[_0xe844('0xb')],'id');this[_0xe844('0xc')][_0xe844('0x10')]=_0x5141bb;};MailQueue[_0xe844('0xf')][_0xe844('0xe')]=function(){this[_0xe844('0x12')]=0x0;this[_0xe844('0x13')]=0x0;for(var _0x4f508d=0x0;_0x4f508d<this[_0xe844('0xb')]['length'];_0x4f508d+=0x1){if(this[_0xe844('0xb')][_0x4f508d]['online']){this['loggedIn']+=0x1;}if(this[_0xe844('0xb')][_0x4f508d][_0xe844('0x14')]){this[_0xe844('0x13')]+=0x1;}}this['available']=this['loggedIn']-this[_0xe844('0x13')];this[_0xe844('0x15')]=this[_0xe844('0x15')]>=0x0?this[_0xe844('0x15')]:0x0;var _0x1a50b0={'id':this['id'],'available':this[_0xe844('0x15')],'loggedIn':this[_0xe844('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xe844('0x16')]};var _0x3ad979=md5(JSON['stringify'](_0x1a50b0));if(this['md5']!==_0x3ad979){this[_0xe844('0x1')]=_0x3ad979;io['to'](util[_0xe844('0x17')]('mail:queue:%s',_0x1a50b0[_0xe844('0x7')]))[_0xe844('0x18')]('mail_queue:save',_0x1a50b0);}};module[_0xe844('0x19')]=MailQueue;
\ No newline at end of file
+var _0xa631=['mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x3f471b,_0x4c84bb){var _0x4502de=function(_0x5a31f2){while(--_0x5a31f2){_0x3f471b['push'](_0x3f471b['shift']());}};_0x4502de(++_0x4c84bb);}(_0xa631,0xe4));var _0x1a63=function(_0x2047af,_0x44b840){_0x2047af=_0x2047af-0x0;var _0x1b4b9f=_0xa631[_0x2047af];return _0x1b4b9f;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function MailQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}MailQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};MailQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6<this['Agents'][_0x1a63('0x12')];_0x5301b6+=0x1){if(this[_0x1a63('0x8')][_0x5301b6][_0x1a63('0x13')]){this[_0x1a63('0x10')]+=0x1;}if(this[_0x1a63('0x8')][_0x5301b6]['mailPause']){this[_0x1a63('0x11')]+=0x1;}}this['available']=this[_0x1a63('0x10')]-this[_0x1a63('0x11')];this[_0x1a63('0x14')]=this[_0x1a63('0x14')]>=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=MailQueue;
\ No newline at end of file
index d26724c..f3971e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e9075,_0x183b7a){_0x2e9075=_0x2e9075-0x0;var _0xee1a24=_0x2ef3[_0x2e9075];return _0xee1a24;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue;
\ No newline at end of file
+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(_0x1fbd03,_0x2a16ba){var _0x54b3e8=function(_0x49f55f){while(--_0x49f55f){_0x1fbd03['push'](_0x1fbd03['shift']());}};_0x54b3e8(++_0x2a16ba);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x5fc3[_0x2e5f9c];return _0x538b44;};'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 18a44ae..dc4e0a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f29=['map','Agents','paused','online','loggedIn','available','name','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0x5378df,_0x48346e){var _0xd1f078=function(_0xfccea2){while(--_0xfccea2){_0x5378df['push'](_0x5378df['shift']());}};_0xd1f078(++_0x48346e);}(_0x4f29,0xfd));var _0x94f2=function(_0x490816,_0x2da9fe){_0x490816=_0x490816-0x0;var _0x418502=_0x4f29[_0x490816];return _0x418502;};'use strict';var _=require('lodash');var md5=require(_0x94f2('0x0'));var util=require(_0x94f2('0x1'));var Redis=require(_0x94f2('0x2'));var config=require(_0x94f2('0x3'));config[_0x94f2('0x4')]=_[_0x94f2('0x5')](config[_0x94f2('0x4')],{'host':_0x94f2('0x6'),'port':0x18eb});var io=require(_0x94f2('0x7'))(new Redis(config[_0x94f2('0x4')]));function SmsQueue(_0x273314){this['id']=_0x273314['id']||0x0;this['name']=_0x273314['name']||'';this[_0x94f2('0x8')]=_0x273314[_0x94f2('0x8')]||0xa;this[_0x94f2('0x9')]=_0x273314[_0x94f2('0x9')]||_0x94f2('0xa');this['Agents']=_0x273314['Agents'];this['mapAgentsId']={};this[_0x94f2('0xb')]=0x0;this['md5']='';this[_0x94f2('0xc')]();this[_0x94f2('0xd')]();}SmsQueue[_0x94f2('0xe')][_0x94f2('0xc')]=function(){var _0x4f647c=this[_0x94f2('0xf')][_0x94f2('0x10')];this[_0x94f2('0xf')]=_[_0x94f2('0x11')](this[_0x94f2('0x12')],'id');this[_0x94f2('0xf')][_0x94f2('0x10')]=_0x4f647c;};SmsQueue['prototype'][_0x94f2('0xd')]=function(){this['loggedIn']=0x0;this[_0x94f2('0x13')]=0x0;for(var _0x7a3dc0=0x0;_0x7a3dc0<this[_0x94f2('0x12')]['length'];_0x7a3dc0+=0x1){if(this['Agents'][_0x7a3dc0][_0x94f2('0x14')]){this[_0x94f2('0x15')]+=0x1;}if(this[_0x94f2('0x12')][_0x7a3dc0]['smsPause']){this[_0x94f2('0x13')]+=0x1;}}this[_0x94f2('0x16')]=this['loggedIn']-this['paused'];this[_0x94f2('0x16')]=this[_0x94f2('0x16')]>=0x0?this[_0x94f2('0x16')]:0x0;var _0x59b045={'id':this['id'],'available':this[_0x94f2('0x16')],'loggedIn':this[_0x94f2('0x15')],'name':this[_0x94f2('0x17')],'paused':this[_0x94f2('0x13')],'waiting':this['waiting']};var _0x46fee4=md5(JSON[_0x94f2('0x18')](_0x59b045));if(this['md5']!==_0x46fee4){this[_0x94f2('0x0')]=_0x46fee4;io['to'](util[_0x94f2('0x19')](_0x94f2('0x1a'),_0x59b045[_0x94f2('0x17')]))[_0x94f2('0x1b')](_0x94f2('0x1c'),_0x59b045);}};module[_0x94f2('0x1d')]=SmsQueue;
\ No newline at end of file
+var _0x0e35=['smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online'];(function(_0x2d2d35,_0xaaf1f9){var _0x494c7e=function(_0x1b8b62){while(--_0x1b8b62){_0x2d2d35['push'](_0x2d2d35['shift']());}};_0x494c7e(++_0xaaf1f9);}(_0x0e35,0xc2));var _0x50e3=function(_0x2ab2ec,_0x4a0f52){_0x2ab2ec=_0x2ab2ec-0x0;var _0x30cd6d=_0x0e35[_0x2ab2ec];return _0x30cd6d;};'use strict';var _=require(_0x50e3('0x0'));var md5=require(_0x50e3('0x1'));var util=require(_0x50e3('0x2'));var Redis=require(_0x50e3('0x3'));var config=require(_0x50e3('0x4'));config[_0x50e3('0x5')]=_[_0x50e3('0x6')](config[_0x50e3('0x5')],{'host':_0x50e3('0x7'),'port':0x18eb});var io=require(_0x50e3('0x8'))(new Redis(config['redis']));function SmsQueue(_0x86283e){this['id']=_0x86283e['id']||0x0;this[_0x50e3('0x9')]=_0x86283e['name']||'';this['timeout']=_0x86283e[_0x50e3('0xa')]||0xa;this[_0x50e3('0xb')]=_0x86283e['strategy']||'beepall';this[_0x50e3('0xc')]=_0x86283e[_0x50e3('0xc')];this[_0x50e3('0xd')]={};this[_0x50e3('0xe')]=0x0;this[_0x50e3('0x1')]='';this[_0x50e3('0xf')]();this[_0x50e3('0x10')]();}SmsQueue[_0x50e3('0x11')][_0x50e3('0xf')]=function(){var _0x35b58b=this[_0x50e3('0xd')][_0x50e3('0x12')];this[_0x50e3('0xd')]=_['map'](this[_0x50e3('0xc')],'id');this[_0x50e3('0xd')][_0x50e3('0x12')]=_0x35b58b;};SmsQueue[_0x50e3('0x11')]['updateRealtime']=function(){this[_0x50e3('0x13')]=0x0;this[_0x50e3('0x14')]=0x0;for(var _0x4b4d6f=0x0;_0x4b4d6f<this[_0x50e3('0xc')][_0x50e3('0x15')];_0x4b4d6f+=0x1){if(this[_0x50e3('0xc')][_0x4b4d6f][_0x50e3('0x16')]){this[_0x50e3('0x13')]+=0x1;}if(this['Agents'][_0x4b4d6f][_0x50e3('0x17')]){this['paused']+=0x1;}}this[_0x50e3('0x18')]=this[_0x50e3('0x13')]-this[_0x50e3('0x14')];this['available']=this[_0x50e3('0x18')]>=0x0?this[_0x50e3('0x18')]:0x0;var _0x1b4279={'id':this['id'],'available':this[_0x50e3('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x50e3('0x14')],'waiting':this['waiting']};var _0x3ffe22=md5(JSON[_0x50e3('0x19')](_0x1b4279));if(this['md5']!==_0x3ffe22){this['md5']=_0x3ffe22;io['to'](util[_0x50e3('0x1a')](_0x50e3('0x1b'),_0x1b4279['name']))[_0x50e3('0x1c')](_0x50e3('0x1d'),_0x1b4279);}};module[_0x50e3('0x1e')]=SmsQueue;
\ No newline at end of file
index 56f64c3..f69b3e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf9a=['timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','exports','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x2e9659,_0x3008ef){var _0x168a6d=function(_0x31fb3c){while(--_0x31fb3c){_0x2e9659['push'](_0x2e9659['shift']());}};_0x168a6d(++_0x3008ef);}(_0xaf9a,0x181));var _0xaaf9=function(_0x63d248,_0x532c2f){_0x63d248=_0x63d248-0x0;var _0x347827=_0xaf9a[_0x63d248];return _0x347827;};'use strict';var _=require(_0xaaf9('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xaaf9('0x1'));config[_0xaaf9('0x2')]=_[_0xaaf9('0x3')](config[_0xaaf9('0x2')],{'host':_0xaaf9('0x4'),'port':0x18eb});var io=require(_0xaaf9('0x5'))(new Redis(config[_0xaaf9('0x2')]));function WhatsappQueue(_0x1d28e5){this['id']=_0x1d28e5['id']||0x0;this[_0xaaf9('0x6')]=_0x1d28e5['name']||'';this[_0xaaf9('0x7')]=_0x1d28e5[_0xaaf9('0x7')]||0xa;this[_0xaaf9('0x8')]=_0x1d28e5[_0xaaf9('0x8')]||'beepall';this[_0xaaf9('0x9')]=_0x1d28e5[_0xaaf9('0x9')];this[_0xaaf9('0xa')]={};this[_0xaaf9('0xb')]=0x0;this[_0xaaf9('0xc')]='';this[_0xaaf9('0xd')]();this[_0xaaf9('0xe')]();}WhatsappQueue[_0xaaf9('0xf')][_0xaaf9('0xd')]=function(){var _0xc18770=this['mapAgentsId'][_0xaaf9('0x10')];this[_0xaaf9('0xa')]=_[_0xaaf9('0x11')](this['Agents'],'id');this[_0xaaf9('0xa')]['_rr']=_0xc18770;};WhatsappQueue['prototype'][_0xaaf9('0xe')]=function(){this['loggedIn']=0x0;this[_0xaaf9('0x12')]=0x0;for(var _0x228138=0x0;_0x228138<this[_0xaaf9('0x9')][_0xaaf9('0x13')];_0x228138+=0x1){if(this['Agents'][_0x228138]['online']){this[_0xaaf9('0x14')]+=0x1;}if(this[_0xaaf9('0x9')][_0x228138][_0xaaf9('0x15')]){this[_0xaaf9('0x12')]+=0x1;}}this[_0xaaf9('0x16')]=this[_0xaaf9('0x14')]-this[_0xaaf9('0x12')];this[_0xaaf9('0x16')]=this[_0xaaf9('0x16')]>=0x0?this[_0xaaf9('0x16')]:0x0;var _0x26ecb2={'id':this['id'],'available':this[_0xaaf9('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xaaf9('0x6')],'paused':this[_0xaaf9('0x12')],'waiting':this[_0xaaf9('0xb')]};var _0x1a3d6b=md5(JSON[_0xaaf9('0x17')](_0x26ecb2));if(this[_0xaaf9('0xc')]!==_0x1a3d6b){this[_0xaaf9('0xc')]=_0x1a3d6b;io['to'](util[_0xaaf9('0x18')](_0xaaf9('0x19'),_0x26ecb2[_0xaaf9('0x6')]))[_0xaaf9('0x1a')]('whatsapp_queue:save',_0x26ecb2);}};module[_0xaaf9('0x1b')]=WhatsappQueue;
\ No newline at end of file
+var _0xddb8=['whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xddb8,0x99));var _0x8ddb=function(_0x478b96,_0x3b77b1){_0x478b96=_0x478b96-0x0;var _0x9f0f60=_0xddb8[_0x478b96];return _0x9f0f60;};'use strict';var _=require(_0x8ddb('0x0'));var md5=require(_0x8ddb('0x1'));var util=require('util');var Redis=require(_0x8ddb('0x2'));var config=require('../../../config/environment');config[_0x8ddb('0x3')]=_[_0x8ddb('0x4')](config['redis'],{'host':_0x8ddb('0x5'),'port':0x18eb});var io=require(_0x8ddb('0x6'))(new Redis(config[_0x8ddb('0x3')]));function WhatsappQueue(_0x1c969d){this['id']=_0x1c969d['id']||0x0;this[_0x8ddb('0x7')]=_0x1c969d[_0x8ddb('0x7')]||'';this[_0x8ddb('0x8')]=_0x1c969d[_0x8ddb('0x8')]||0xa;this[_0x8ddb('0x9')]=_0x1c969d[_0x8ddb('0x9')]||_0x8ddb('0xa');this[_0x8ddb('0xb')]=_0x1c969d[_0x8ddb('0xb')];this[_0x8ddb('0xc')]={};this[_0x8ddb('0xd')]=0x0;this['md5']='';this[_0x8ddb('0xe')]();this[_0x8ddb('0xf')]();}WhatsappQueue['prototype'][_0x8ddb('0xe')]=function(){var _0x38581a=this['mapAgentsId'][_0x8ddb('0x10')];this['mapAgentsId']=_[_0x8ddb('0x11')](this[_0x8ddb('0xb')],'id');this[_0x8ddb('0xc')]['_rr']=_0x38581a;};WhatsappQueue[_0x8ddb('0x12')][_0x8ddb('0xf')]=function(){this[_0x8ddb('0x13')]=0x0;this[_0x8ddb('0x14')]=0x0;for(var _0x56d8a5=0x0;_0x56d8a5<this[_0x8ddb('0xb')]['length'];_0x56d8a5+=0x1){if(this['Agents'][_0x56d8a5]['online']){this[_0x8ddb('0x13')]+=0x1;}if(this[_0x8ddb('0xb')][_0x56d8a5][_0x8ddb('0x15')]){this[_0x8ddb('0x14')]+=0x1;}}this[_0x8ddb('0x16')]=this[_0x8ddb('0x13')]-this[_0x8ddb('0x14')];this['available']=this[_0x8ddb('0x16')]>=0x0?this[_0x8ddb('0x16')]:0x0;var _0xf2451d={'id':this['id'],'available':this[_0x8ddb('0x16')],'loggedIn':this[_0x8ddb('0x13')],'name':this[_0x8ddb('0x7')],'paused':this[_0x8ddb('0x14')],'waiting':this[_0x8ddb('0xd')]};var _0x5736ab=md5(JSON[_0x8ddb('0x17')](_0xf2451d));if(this['md5']!==_0x5736ab){this[_0x8ddb('0x1')]=_0x5736ab;io['to'](util[_0x8ddb('0x18')](_0x8ddb('0x19'),_0xf2451d[_0x8ddb('0x7')]))[_0x8ddb('0x1a')](_0x8ddb('0x1b'),_0xf2451d);}};module[_0x8ddb('0x1c')]=WhatsappQueue;
\ No newline at end of file
index e80b4a1..2af9e31 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(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x52de96,_0x3af5bf){var _0x4497d0=function(_0x279732){while(--_0x279732){_0x52de96['push'](_0x52de96['shift']());}};_0x4497d0(++_0x3af5bf);}(_0xb10b,0x12a));var _0xbb10=function(_0x4222b5,_0x37422c){_0x4222b5=_0x4222b5-0x0;var _0x425d4c=_0xb10b[_0x4222b5];return _0x425d4c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index 287289b..b9c3853 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa579=['addTags','AddTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x57586e,_0x4813d8){var _0x1e477a=function(_0x71b6d8){while(--_0x71b6d8){_0x57586e['push'](_0x57586e['shift']());}};_0x1e477a(++_0x4813d8);}(_0xa579,0xce));var _0x9a57=function(_0x54c7b0,_0x1db709){_0x54c7b0=_0x54c7b0-0x0;var _0x294ddf=_0xa579[_0x54c7b0];return _0x294ddf;};'use strict';var client=require('../client');exports[_0x9a57('0x0')]=function(_0x59c6c6,_0x508a02){return client[_0x9a57('0x1')](_0x9a57('0x2'),{'body':_0x508a02,'options':{'where':{'id':_0x59c6c6}},'log':_0x9a57('0x3')});};exports[_0x9a57('0x4')]=function(_0x50d11f,_0x59cd26){return client[_0x9a57('0x1')](_0x9a57('0x5'),{'body':_0x59cd26,'options':{'where':{'id':_0x50d11f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x0c76=['AddTagsToChatInteraction','Request','UpdateChatInteraction'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x0c76,0x1b4));var _0x60c7=function(_0x278289,_0x4cd0e7){_0x278289=_0x278289-0x0;var _0x569768=_0x0c76[_0x278289];return _0x569768;};'use strict';var client=require('../client');exports['update']=function(_0x2d5050,_0xd3ae1f){return client[_0x60c7('0x0')](_0x60c7('0x1'),{'body':_0xd3ae1f,'options':{'where':{'id':_0x2d5050}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x344bfa,_0x4df5ba){return client[_0x60c7('0x0')](_0x60c7('0x2'),{'body':_0x4df5ba,'options':{'where':{'id':_0x344bfa}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 6b280d4..7fb52c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f89=['create','Request','createChatMessage','../client'];(function(_0x5b68ca,_0x2d4ffb){var _0x4c9227=function(_0x2a5ae7){while(--_0x2a5ae7){_0x5b68ca['push'](_0x5b68ca['shift']());}};_0x4c9227(++_0x2d4ffb);}(_0x2f89,0x97));var _0x92f8=function(_0x5b1915,_0xd55bda){_0x5b1915=_0x5b1915-0x0;var _0x5f033c=_0x2f89[_0x5b1915];return _0x5f033c;};'use strict';var client=require(_0x92f8('0x0'));exports[_0x92f8('0x1')]=function(_0x46f600){return client[_0x92f8('0x2')]('CreateChatMessage',{'body':_0x46f600,'log':_0x92f8('0x3')});};
\ No newline at end of file
+var _0xb8f2=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x30a407,_0x2abaf9){var _0x4fc367=function(_0x595c85){while(--_0x595c85){_0x30a407['push'](_0x30a407['shift']());}};_0x4fc367(++_0x2abaf9);}(_0xb8f2,0x140));var _0x2b8f=function(_0x5a5083,_0x1f786d){_0x5a5083=_0x5a5083-0x0;var _0x474f36=_0xb8f2[_0x5a5083];return _0x474f36;};'use strict';var client=require(_0x2b8f('0x0'));exports[_0x2b8f('0x1')]=function(_0x4e46eb){return client[_0x2b8f('0x2')](_0x2b8f('0x3'),{'body':_0x4e46eb,'log':_0x2b8f('0x4')});};
\ No newline at end of file
index 4330d4a..19694d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x432b=['getChatQueues','../client','Request','GetChatQueue','name','timeout','Agents','online'];(function(_0x2fc23d,_0x4693d0){var _0x2692f0=function(_0x5eafa7){while(--_0x5eafa7){_0x2fc23d['push'](_0x2fc23d['shift']());}};_0x2692f0(++_0x4693d0);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb432('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xb432('0x1')](_0xb432('0x2'),{'options':{'raw':![],'attributes':['id',_0xb432('0x3'),_0xb432('0x4'),'strategy'],'include':[{'model':'User','as':_0xb432('0x5'),'attributes':['id','name',_0xb432('0x6'),'chatPause']}]},'log':_0xb432('0x7')});};};
\ No newline at end of file
+var _0x0d64=['Request','GetChatQueue','timeout','strategy','Agents','name','online','chatPause','getChatQueues','../client'];(function(_0x17499b,_0x1b2ffd){var _0x5d2b45=function(_0x55f4e2){while(--_0x55f4e2){_0x17499b['push'](_0x17499b['shift']());}};_0x5d2b45(++_0x1b2ffd);}(_0x0d64,0x77));var _0x40d6=function(_0x2857f5,_0x181da1){_0x2857f5=_0x2857f5-0x0;var _0xb5aed6=_0x0d64[_0x2857f5];return _0xb5aed6;};'use strict';var client=require(_0x40d6('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x40d6('0x1')](_0x40d6('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x40d6('0x3'),_0x40d6('0x4')],'include':[{'model':'User','as':_0x40d6('0x5'),'attributes':['id',_0x40d6('0x6'),_0x40d6('0x7'),_0x40d6('0x8')]}]},'log':_0x40d6('0x9')});};};
\ No newline at end of file
index 87f9a5b..b4ce89c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ade=['create','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x266bd1,_0x3934e3){var _0x377302=function(_0x578fec){while(--_0x578fec){_0x266bd1['push'](_0x266bd1['shift']());}};_0x377302(++_0x3934e3);}(_0x9ade,0x107));var _0xe9ad=function(_0x42f0d1,_0x45fe4a){_0x42f0d1=_0x42f0d1-0x0;var _0x43f981=_0x9ade[_0x42f0d1];return _0x43f981;};'use strict';var client=require(_0xe9ad('0x0'));exports[_0xe9ad('0x1')]=function(_0x59fba3){return client['Request'](_0xe9ad('0x2'),{'body':_0x59fba3,'log':'CreateChatQueueReport'});};exports[_0xe9ad('0x3')]=function(_0x38d722,_0x4d4ee0){return client['Request'](_0xe9ad('0x4'),{'body':_0x4d4ee0,'options':{'where':{'uniqueid':_0x38d722},'order':[['id',_0xe9ad('0x5')]],'limit':0x1},'log':_0xe9ad('0x4')});};
\ No newline at end of file
+var _0x2356=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport'];(function(_0x191a9d,_0x1f9e40){var _0x385247=function(_0x1f4671){while(--_0x1f4671){_0x191a9d['push'](_0x191a9d['shift']());}};_0x385247(++_0x1f9e40);}(_0x2356,0x14f));var _0x6235=function(_0xf1da90,_0x17a4f0){_0xf1da90=_0xf1da90-0x0;var _0x24fae3=_0x2356[_0xf1da90];return _0x24fae3;};'use strict';var client=require('../client');exports[_0x6235('0x0')]=function(_0xbfa2ed){return client['Request']('CreateChatQueueReport',{'body':_0xbfa2ed,'log':_0x6235('0x1')});};exports[_0x6235('0x2')]=function(_0x5c536f,_0x52e393){return client[_0x6235('0x3')]('UpdateChatQueueReport',{'body':_0x52e393,'options':{'where':{'uniqueid':_0x5c536f},'order':[['id','DESC']],'limit':0x1},'log':_0x6235('0x4')});};
\ No newline at end of file
index b512641..b569e7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x7a54,0x106));var _0x47a5=function(_0x4cbe6c,_0x17cb05){_0x4cbe6c=_0x4cbe6c-0x0;var _0x10d0da=_0x7a54[_0x4cbe6c];return _0x10d0da;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0x7a54,0x106));var _0x47a5=function(_0x19afb1,_0x5c292d){_0x19afb1=_0x19afb1-0x0;var _0x5b37b4=_0x7a54[_0x19afb1];return _0x5b37b4;};'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 dbcfba8..2bb744c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91f1=['../client','create','Request'];(function(_0x4b3ae2,_0x3da532){var _0x4e9a2f=function(_0x486d68){while(--_0x486d68){_0x4b3ae2['push'](_0x4b3ae2['shift']());}};_0x4e9a2f(++_0x3da532);}(_0x91f1,0x114));var _0x191f=function(_0x356844,_0x3ed336){_0x356844=_0x356844-0x0;var _0x20f225=_0x91f1[_0x356844];return _0x20f225;};'use strict';var client=require(_0x191f('0x0'));exports[_0x191f('0x1')]=function(_0x3bc3bc){return client[_0x191f('0x2')]('CreateFaxMessage',{'body':_0x3bc3bc,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0x8f01=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x3d5f18,_0x46d3ac){var _0x37fb6b=function(_0x2eb8ae){while(--_0x2eb8ae){_0x3d5f18['push'](_0x3d5f18['shift']());}};_0x37fb6b(++_0x46d3ac);}(_0x8f01,0xa0));var _0x18f0=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x8f01[_0x12a554];return _0x244ba0;};'use strict';var client=require(_0x18f0('0x0'));exports[_0x18f0('0x1')]=function(_0x5a5c8f){return client[_0x18f0('0x2')](_0x18f0('0x3'),{'body':_0x5a5c8f,'log':_0x18f0('0x4')});};
\ No newline at end of file
index d097096..b2650e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fea=['timeout','User','Agents','online','faxPause','../client','getFaxQueues','Request','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fea,0x83));var _0xa7fe=function(_0x4679a2,_0x3c884e){_0x4679a2=_0x4679a2-0x0;var _0x2b77a5=_0x7fea[_0x4679a2];return _0x2b77a5;};'use strict';var client=require(_0xa7fe('0x0'));exports[_0xa7fe('0x1')]=function(){return function(){return client[_0xa7fe('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xa7fe('0x3'),_0xa7fe('0x4'),'strategy'],'include':[{'model':_0xa7fe('0x5'),'as':_0xa7fe('0x6'),'attributes':['id','name',_0xa7fe('0x7'),_0xa7fe('0x8')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
+var _0x8785=['../client','getFaxQueues','GetFaxQueue','name','strategy','User','faxPause'];(function(_0x2f3173,_0x532c04){var _0x426e08=function(_0x1037bc){while(--_0x1037bc){_0x2f3173['push'](_0x2f3173['shift']());}};_0x426e08(++_0x532c04);}(_0x8785,0x7e));var _0x5878=function(_0x1a52ce,_0x30f033){_0x1a52ce=_0x1a52ce-0x0;var _0x1caea2=_0x8785[_0x1a52ce];return _0x1caea2;};'use strict';var client=require(_0x5878('0x0'));exports[_0x5878('0x1')]=function(){return function(){return client['Request'](_0x5878('0x2'),{'options':{'raw':![],'attributes':['id',_0x5878('0x3'),'timeout',_0x5878('0x4')],'include':[{'model':_0x5878('0x5'),'as':'Agents','attributes':['id',_0x5878('0x3'),'online',_0x5878('0x6')]}]},'log':_0x5878('0x1')});};};
\ No newline at end of file
index 272b087..e7bd056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a59=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x50b61d,_0x42a657){var _0x5542e1=function(_0x426241){while(--_0x426241){_0x50b61d['push'](_0x50b61d['shift']());}};_0x5542e1(++_0x42a657);}(_0x7a59,0x16e));var _0x97a5=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x7a59[_0x30c649];return _0x3edfb9;};'use strict';var client=require(_0x97a5('0x0'));exports['create']=function(_0x5e8305){return client[_0x97a5('0x1')](_0x97a5('0x2'),{'body':_0x5e8305,'log':_0x97a5('0x2')});};exports[_0x97a5('0x3')]=function(_0x281bfd,_0x5e2db0){return client[_0x97a5('0x1')](_0x97a5('0x4'),{'body':_0x5e2db0,'options':{'where':{'uniqueid':_0x281bfd},'order':[['id',_0x97a5('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x94fa=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x28c338,_0x4b0230){var _0x34ce21=function(_0x252c39){while(--_0x252c39){_0x28c338['push'](_0x28c338['shift']());}};_0x34ce21(++_0x4b0230);}(_0x94fa,0x11e));var _0xa94f=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x94fa[_0x3b5250];return _0xc844a1;};'use strict';var client=require(_0xa94f('0x0'));exports[_0xa94f('0x1')]=function(_0x11e02a){return client[_0xa94f('0x2')]('CreateFaxQueueReport',{'body':_0x11e02a,'log':_0xa94f('0x3')});};exports['update']=function(_0x319745,_0x54d14e){return client[_0xa94f('0x2')](_0xa94f('0x4'),{'body':_0x54d14e,'options':{'where':{'uniqueid':_0x319745},'order':[['id',_0xa94f('0x5')]],'limit':0x1},'log':_0xa94f('0x4')});};
\ No newline at end of file
index b3f5335..13c6f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0311=['../client','Request','name','Interval','Intervals'];(function(_0x16935f,_0x3cf890){var _0x5c0e1f=function(_0x2a9ffd){while(--_0x2a9ffd){_0x16935f['push'](_0x16935f['shift']());}};_0x5c0e1f(++_0x3cf890);}(_0x0311,0xdc));var _0x1031=function(_0x392b14,_0x90ae3){_0x392b14=_0x392b14-0x0;var _0x365754=_0x0311[_0x392b14];return _0x365754;};'use strict';var client=require(_0x1031('0x0'));exports['getIntervals']=function(){return function(){return client[_0x1031('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1031('0x2')],'include':[{'model':_0x1031('0x3'),'as':_0x1031('0x4'),'attributes':['id',_0x1031('0x2'),'interval']}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0xc220=['Intervals','getIntervals','../client','Request','name','Interval'];(function(_0x5254bc,_0x2c558c){var _0x3ec603=function(_0x3b1b47){while(--_0x3b1b47){_0x5254bc['push'](_0x5254bc['shift']());}};_0x3ec603(++_0x2c558c);}(_0xc220,0x170));var _0x0c22=function(_0x247790,_0x419837){_0x247790=_0x247790-0x0;var _0x1d8876=_0xc220[_0x247790];return _0x1d8876;};'use strict';var client=require(_0x0c22('0x0'));exports['getIntervals']=function(){return function(){return client[_0x0c22('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0c22('0x2')],'include':[{'model':_0x0c22('0x3'),'as':_0x0c22('0x4'),'attributes':['id',_0x0c22('0x2'),'interval']}]},'log':_0x0c22('0x5')});};};
\ No newline at end of file
index 8f48f9b..921c87f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['update','UpdateMailInteraction','updateMailInteraction','Request','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x97120e,_0x2915f7){var _0x65eaa1=function(_0x4e4e00){while(--_0x4e4e00){_0x97120e['push'](_0x97120e['shift']());}};_0x65eaa1(++_0x2915f7);}(_0x77d4,0x108));var _0x477d=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0x77d4[_0x3f22e8];return _0x368a7e;};'use strict';var client=require('../client');exports[_0x477d('0x0')]=function(_0x49b615,_0x18c0fe){return client['Request'](_0x477d('0x1'),{'body':_0x18c0fe,'options':{'where':{'id':_0x49b615}},'log':_0x477d('0x2')});};exports['addTags']=function(_0x53e1b8,_0x16213f){return client[_0x477d('0x3')](_0x477d('0x4'),{'body':_0x16213f,'options':{'where':{'id':_0x53e1b8}},'log':_0x477d('0x5')});};
\ No newline at end of file
+var _0x627e=['../client','update','Request','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0x518189,_0x280941){var _0x14f749=function(_0x3c1318){while(--_0x3c1318){_0x518189['push'](_0x518189['shift']());}};_0x14f749(++_0x280941);}(_0x627e,0x14a));var _0xe627=function(_0x5d257d,_0xcc7e1c){_0x5d257d=_0x5d257d-0x0;var _0x1191ae=_0x627e[_0x5d257d];return _0x1191ae;};'use strict';var client=require(_0xe627('0x0'));exports[_0xe627('0x1')]=function(_0x2cc4b4,_0x18dba3){return client[_0xe627('0x2')]('UpdateMailInteraction',{'body':_0x18dba3,'options':{'where':{'id':_0x2cc4b4}},'log':_0xe627('0x3')});};exports[_0xe627('0x4')]=function(_0x2abdc7,_0x59a2c8){return client['Request']('AddTagsToMailInteraction',{'body':_0x59a2c8,'options':{'where':{'id':_0x2abdc7}},'log':_0xe627('0x5')});};
\ No newline at end of file
index 50ab641..f647f0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd212=['create','Request','createMailMessage','../client'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xd212,0x12f));var _0x2d21=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xd212[_0x483d8b];return _0x6500f1;};'use strict';var client=require(_0x2d21('0x0'));exports[_0x2d21('0x1')]=function(_0x17e10c){return client[_0x2d21('0x2')]('CreateMailMessage',{'body':_0x17e10c,'log':_0x2d21('0x3')});};
\ No newline at end of file
+var _0x6600=['../client','createMailMessage'];(function(_0xc018a3,_0x4272fd){var _0x2bf120=function(_0x316620){while(--_0x316620){_0xc018a3['push'](_0xc018a3['shift']());}};_0x2bf120(++_0x4272fd);}(_0x6600,0x16c));var _0x0660=function(_0x41f94e,_0x40d81f){_0x41f94e=_0x41f94e-0x0;var _0x19e29f=_0x6600[_0x41f94e];return _0x19e29f;};'use strict';var client=require(_0x0660('0x0'));exports['create']=function(_0x350a58){return client['Request']('CreateMailMessage',{'body':_0x350a58,'log':_0x0660('0x1')});};
\ No newline at end of file
index cd4ad58..9e2c538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd4=['../client','getMailQueues','Request','name','strategy','User','online'];(function(_0x259c7e,_0x96223a){var _0x15d791=function(_0x5f4198){while(--_0x5f4198){_0x259c7e['push'](_0x259c7e['shift']());}};_0x15d791(++_0x96223a);}(_0xedd4,0xa1));var _0x4edd=function(_0x2f3c91,_0x12ee03){_0x2f3c91=_0x2f3c91-0x0;var _0x1be5b8=_0xedd4[_0x2f3c91];return _0x1be5b8;};'use strict';var client=require(_0x4edd('0x0'));exports[_0x4edd('0x1')]=function(){return function(){return client[_0x4edd('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x4edd('0x3'),'timeout',_0x4edd('0x4')],'include':[{'model':_0x4edd('0x5'),'as':'Agents','attributes':['id','name',_0x4edd('0x6'),'mailPause']}]},'log':_0x4edd('0x1')});};};
\ No newline at end of file
+var _0x6371=['GetMailQueue','name','timeout','strategy','User','Agents','online','../client','getMailQueues','Request'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6371,0xed));var _0x1637=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x6371[_0x13e741];return _0x3f8bb3;};'use strict';var client=require(_0x1637('0x0'));exports[_0x1637('0x1')]=function(){return function(){return client[_0x1637('0x2')](_0x1637('0x3'),{'options':{'raw':![],'attributes':['id',_0x1637('0x4'),_0x1637('0x5'),_0x1637('0x6')],'include':[{'model':_0x1637('0x7'),'as':_0x1637('0x8'),'attributes':['id','name',_0x1637('0x9'),'mailPause']}]},'log':'getMailQueues'});};};
\ No newline at end of file
index d26946f..01469bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfba=['update','Request','UpdateMailQueueReport','DESC','../client','CreateMailQueueReport'];(function(_0x40d5ea,_0x307754){var _0x1aa33b=function(_0x5e5ada){while(--_0x5e5ada){_0x40d5ea['push'](_0x40d5ea['shift']());}};_0x1aa33b(++_0x307754);}(_0xcfba,0x160));var _0xacfb=function(_0x20f684,_0x5f06df){_0x20f684=_0x20f684-0x0;var _0x103bb2=_0xcfba[_0x20f684];return _0x103bb2;};'use strict';var client=require(_0xacfb('0x0'));exports['create']=function(_0x3f9c0e){return client['Request']('CreateMailQueueReport',{'body':_0x3f9c0e,'log':_0xacfb('0x1')});};exports[_0xacfb('0x2')]=function(_0xfb4899,_0x3a229c){return client[_0xacfb('0x3')](_0xacfb('0x4'),{'body':_0x3a229c,'options':{'where':{'uniqueid':_0xfb4899},'order':[['id',_0xacfb('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0xa98f=['Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','create'];(function(_0xaab70e,_0x653796){var _0x2c9f23=function(_0x23e002){while(--_0x23e002){_0xaab70e['push'](_0xaab70e['shift']());}};_0x2c9f23(++_0x653796);}(_0xa98f,0x135));var _0xfa98=function(_0x2a3c33,_0x851fa9){_0x2a3c33=_0x2a3c33-0x0;var _0xe123e4=_0xa98f[_0x2a3c33];return _0xe123e4;};'use strict';var client=require('../client');exports[_0xfa98('0x0')]=function(_0x3d44dd){return client[_0xfa98('0x1')](_0xfa98('0x2'),{'body':_0x3d44dd,'log':_0xfa98('0x2')});};exports['update']=function(_0x5f02d2,_0x18852b){return client[_0xfa98('0x1')](_0xfa98('0x3'),{'body':_0x18852b,'options':{'where':{'uniqueid':_0x5f02d2},'order':[['id',_0xfa98('0x4')]],'limit':0x1},'log':_0xfa98('0x3')});};
\ No newline at end of file
index 98651d4..34e51a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ec=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x14da6f,_0x4dcbc9){var _0x5a74fe=function(_0x297ba5){while(--_0x297ba5){_0x14da6f['push'](_0x14da6f['shift']());}};_0x5a74fe(++_0x4dcbc9);}(_0xd7ec,0x187));var _0xcd7e=function(_0xb92faa,_0x2c304e){_0xb92faa=_0xb92faa-0x0;var _0x46e9e5=_0xd7ec[_0xb92faa];return _0x46e9e5;};'use strict';var client=require(_0xcd7e('0x0'));exports[_0xcd7e('0x1')]=function(_0x1f90c4,_0x2ebcfe){return client[_0xcd7e('0x2')](_0xcd7e('0x3'),{'body':_0x2ebcfe,'options':{'where':{'id':_0x1f90c4}},'log':_0xcd7e('0x4')});};exports[_0xcd7e('0x5')]=function(_0x295a7a,_0x45921b){return client[_0xcd7e('0x2')](_0xcd7e('0x6'),{'body':_0x45921b,'options':{'where':{'id':_0x295a7a}},'log':_0xcd7e('0x7')});};
\ No newline at end of file
+var _0xbd10=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x3a1eaf,_0x52d686){var _0x1bb230=function(_0x4b1f92){while(--_0x4b1f92){_0x3a1eaf['push'](_0x3a1eaf['shift']());}};_0x1bb230(++_0x52d686);}(_0xbd10,0x148));var _0x0bd1=function(_0x1a9bf8,_0xa8cb7f){_0x1a9bf8=_0x1a9bf8-0x0;var _0x45cd66=_0xbd10[_0x1a9bf8];return _0x45cd66;};'use strict';var client=require(_0x0bd1('0x0'));exports[_0x0bd1('0x1')]=function(_0x22eaf4,_0x1e4b27){return client[_0x0bd1('0x2')](_0x0bd1('0x3'),{'body':_0x1e4b27,'options':{'where':{'id':_0x22eaf4}},'log':_0x0bd1('0x4')});};exports[_0x0bd1('0x5')]=function(_0x3ba2a9,_0x91d694){return client[_0x0bd1('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x91d694,'options':{'where':{'id':_0x3ba2a9}},'log':_0x0bd1('0x6')});};
\ No newline at end of file
index 07cdf48..d3eb7c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecb7=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x4fb358,_0x576087){var _0x1d1bf5=function(_0x20f668){while(--_0x20f668){_0x4fb358['push'](_0x4fb358['shift']());}};_0x1d1bf5(++_0x576087);}(_0xecb7,0xef));var _0x7ecb=function(_0x5cb1bf,_0x2c6552){_0x5cb1bf=_0x5cb1bf-0x0;var _0xd7f044=_0xecb7[_0x5cb1bf];return _0xd7f044;};'use strict';var client=require(_0x7ecb('0x0'));exports[_0x7ecb('0x1')]=function(_0x7ef334){return client[_0x7ecb('0x2')](_0x7ecb('0x3'),{'body':_0x7ef334,'log':_0x7ecb('0x4')});};
\ No newline at end of file
+var _0xf4fe=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2baf40,_0x5ebef2){var _0x2bb2cb=function(_0x1a3fc1){while(--_0x1a3fc1){_0x2baf40['push'](_0x2baf40['shift']());}};_0x2bb2cb(++_0x5ebef2);}(_0xf4fe,0x1b0));var _0xef4f=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xf4fe[_0x3a6efd];return _0x487b9a;};'use strict';var client=require('../client');exports['create']=function(_0x5daa71){return client[_0xef4f('0x0')](_0xef4f('0x1'),{'body':_0x5daa71,'log':_0xef4f('0x2')});};
\ No newline at end of file
index f65faf3..c54da00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4998=['../client','getOpenchannelQueues','GetOpenchannelQueue','timeout','User','Agents','name','online','openchannelPause'];(function(_0x414b40,_0x3e6ddb){var _0x4a03a5=function(_0x2f0a61){while(--_0x2f0a61){_0x414b40['push'](_0x414b40['shift']());}};_0x4a03a5(++_0x3e6ddb);}(_0x4998,0x168));var _0x8499=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x4998[_0x41c381];return _0x427981;};'use strict';var client=require(_0x8499('0x0'));exports[_0x8499('0x1')]=function(){return function(){return client['Request'](_0x8499('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8499('0x3'),'strategy'],'include':[{'model':_0x8499('0x4'),'as':_0x8499('0x5'),'attributes':['id',_0x8499('0x6'),_0x8499('0x7'),_0x8499('0x8')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
+var _0x29b4=['GetOpenchannelQueue','timeout','strategy','User','Agents','name','online','../client','getOpenchannelQueues','Request'];(function(_0x17141f,_0x4d7c4b){var _0x3ee900=function(_0x5ec0f4){while(--_0x5ec0f4){_0x17141f['push'](_0x17141f['shift']());}};_0x3ee900(++_0x4d7c4b);}(_0x29b4,0x183));var _0x429b=function(_0x3ba9e1,_0x109a9d){_0x3ba9e1=_0x3ba9e1-0x0;var _0x1420a7=_0x29b4[_0x3ba9e1];return _0x1420a7;};'use strict';var client=require(_0x429b('0x0'));exports[_0x429b('0x1')]=function(){return function(){return client[_0x429b('0x2')](_0x429b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x429b('0x4'),_0x429b('0x5')],'include':[{'model':_0x429b('0x6'),'as':_0x429b('0x7'),'attributes':['id',_0x429b('0x8'),_0x429b('0x9'),'openchannelPause']}]},'log':_0x429b('0x1')});};};
\ No newline at end of file
index 903e906..0be6a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7208=['update','UpdateOpenchannelQueueReport','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x354000,_0xb92142){var _0xda46bf=function(_0x222bd9){while(--_0x222bd9){_0x354000['push'](_0x354000['shift']());}};_0xda46bf(++_0xb92142);}(_0x7208,0x16b));var _0x8720=function(_0x463ce4,_0x3fc095){_0x463ce4=_0x463ce4-0x0;var _0xaa0c3d=_0x7208[_0x463ce4];return _0xaa0c3d;};'use strict';var client=require(_0x8720('0x0'));exports['create']=function(_0x71a686){return client[_0x8720('0x1')]('CreateOpenchannelQueueReport',{'body':_0x71a686,'log':_0x8720('0x2')});};exports[_0x8720('0x3')]=function(_0x5d42a6,_0x560799){return client[_0x8720('0x1')](_0x8720('0x4'),{'body':_0x560799,'options':{'where':{'uniqueid':_0x5d42a6},'order':[['id',_0x8720('0x5')]],'limit':0x1},'log':_0x8720('0x4')});};
\ No newline at end of file
+var _0x0f4b=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0f4b,0x1a9));var _0xb0f4=function(_0x4b665e,_0x3e6a81){_0x4b665e=_0x4b665e-0x0;var _0x16386e=_0x0f4b[_0x4b665e];return _0x16386e;};'use strict';var client=require('../client');exports['create']=function(_0x407689){return client[_0xb0f4('0x0')](_0xb0f4('0x1'),{'body':_0x407689,'log':_0xb0f4('0x1')});};exports['update']=function(_0x557c8a,_0x14289d){return client[_0xb0f4('0x0')](_0xb0f4('0x2'),{'body':_0x14289d,'options':{'where':{'uniqueid':_0x557c8a},'order':[['id','DESC']],'limit':0x1},'log':_0xb0f4('0x2')});};
\ No newline at end of file
index baacafc..c5620d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86dd=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x114cf4,_0x1e03ce){var _0x5a0103=function(_0xcfef29){while(--_0xcfef29){_0x114cf4['push'](_0x114cf4['shift']());}};_0x5a0103(++_0x1e03ce);}(_0x86dd,0x1ee));var _0xd86d=function(_0x547bed,_0x9b1bb1){_0x547bed=_0x547bed-0x0;var _0xedad6b=_0x86dd[_0x547bed];return _0xedad6b;};'use strict';var client=require('../client');exports[_0xd86d('0x0')]=function(_0x52e445,_0x24b16e){return client[_0xd86d('0x1')](_0xd86d('0x2'),{'body':_0x24b16e,'options':{'where':{'id':_0x52e445}},'log':_0xd86d('0x3')});};exports[_0xd86d('0x4')]=function(_0x30a31c,_0x2e82a9){return client[_0xd86d('0x1')](_0xd86d('0x5'),{'body':_0x2e82a9,'options':{'where':{'id':_0x30a31c}},'log':_0xd86d('0x6')});};
\ No newline at end of file
+var _0x4a81=['update','updateSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x216e63,_0x522447){var _0x14e08e=function(_0x32f235){while(--_0x32f235){_0x216e63['push'](_0x216e63['shift']());}};_0x14e08e(++_0x522447);}(_0x4a81,0x1b7));var _0x14a8=function(_0x2baa7e,_0x30ca29){_0x2baa7e=_0x2baa7e-0x0;var _0x49216b=_0x4a81[_0x2baa7e];return _0x49216b;};'use strict';var client=require(_0x14a8('0x0'));exports[_0x14a8('0x1')]=function(_0x3a301f,_0x104041){return client['Request']('UpdateSmsInteraction',{'body':_0x104041,'options':{'where':{'id':_0x3a301f}},'log':_0x14a8('0x2')});};exports['addTags']=function(_0x39c3d4,_0x3363f8){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3363f8,'options':{'where':{'id':_0x39c3d4}},'log':_0x14a8('0x3')});};
\ No newline at end of file
index 877f003..7c6e7fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc75=['createSmsMessage','../client','create','Request'];(function(_0xf81995,_0x3307d2){var _0x7c788=function(_0x2fa362){while(--_0x2fa362){_0xf81995['push'](_0xf81995['shift']());}};_0x7c788(++_0x3307d2);}(_0xbc75,0x1a9));var _0x5bc7=function(_0x4d9bab,_0x2d8763){_0x4d9bab=_0x4d9bab-0x0;var _0xb0f847=_0xbc75[_0x4d9bab];return _0xb0f847;};'use strict';var client=require(_0x5bc7('0x0'));exports[_0x5bc7('0x1')]=function(_0x2e80c0){return client[_0x5bc7('0x2')]('CreateSmsMessage',{'body':_0x2e80c0,'log':_0x5bc7('0x3')});};
\ No newline at end of file
+var _0x7843=['../client','create','createSmsMessage'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x7843,0x17a));var _0x3784=function(_0x41b8c5,_0x5855f9){_0x41b8c5=_0x41b8c5-0x0;var _0x3476d3=_0x7843[_0x41b8c5];return _0x3476d3;};'use strict';var client=require(_0x3784('0x0'));exports[_0x3784('0x1')]=function(_0x420344){return client['Request']('CreateSmsMessage',{'body':_0x420344,'log':_0x3784('0x2')});};
\ No newline at end of file
index ff09c35..004e494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x3d5490,_0x112e42){var _0x1b5120=function(_0x456f46){while(--_0x456f46){_0x3d5490['push'](_0x3d5490['shift']());}};_0x1b5120(++_0x112e42);}(_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')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x270bc0,_0x13c19d){var _0x13277c=function(_0x17ffbb){while(--_0x17ffbb){_0x270bc0['push'](_0x270bc0['shift']());}};_0x13277c(++_0x13c19d);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};};
\ No newline at end of file
index 3e9842b..14d239b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5924d9,_0xd3d69c){var _0x762496=function(_0x103bab){while(--_0x103bab){_0x5924d9['push'](_0x5924d9['shift']());}};_0x762496(++_0xd3d69c);}(_0x3e74,0x175));var _0x43e7=function(_0x24419a,_0x469e78){_0x24419a=_0x24419a-0x0;var _0x3b87ef=_0x3e74[_0x24419a];return _0x3b87ef;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});};
\ No newline at end of file
+var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x23dbf5,_0x5c2424){var _0x486a1e=function(_0x453ad6){while(--_0x453ad6){_0x23dbf5['push'](_0x23dbf5['shift']());}};_0x486a1e(++_0x5c2424);}(_0x34e8,0x12c));var _0x834e=function(_0x58daae,_0x1890da){_0x58daae=_0x58daae-0x0;var _0x326183=_0x34e8[_0x58daae];return _0x326183;};'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
index 22f7b8f..ebf13a9 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(_0x47ba45,_0x505073){var _0x421d4a=function(_0x3ccce0){while(--_0x3ccce0){_0x47ba45['push'](_0x47ba45['shift']());}};_0x421d4a(++_0x505073);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x55f496,_0x1b30f5){var _0x314412=function(_0x409312){while(--_0x409312){_0x55f496['push'](_0x55f496['shift']());}};_0x314412(++_0x1b30f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 9d17aa6..192fa22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','../client','Request'];(function(_0x41810e,_0x1728af){var _0x2f8131=function(_0x205552){while(--_0x205552){_0x41810e['push'](_0x41810e['shift']());}};_0x2f8131(++_0x1728af);}(_0x31f0,0xb7));var _0x031f=function(_0x4bce7b,_0x245cea){_0x4bce7b=_0x4bce7b-0x0;var _0x4a2b63=_0x31f0[_0x4bce7b];return _0x4a2b63;};'use strict';var client=require(_0x031f('0x0'));exports['update']=function(_0xc4ca54,_0x50a1ab){return client[_0x031f('0x1')](_0x031f('0x2'),{'body':_0x50a1ab,'options':{'where':{'id':_0xc4ca54}},'log':_0x031f('0x3')});};exports[_0x031f('0x4')]=function(_0x526a45,_0x3c0612){return client[_0x031f('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x3c0612,'options':{'where':{'id':_0x526a45}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0xba18=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x160fde,_0x2c7331){var _0x2424e7=function(_0x4a8bdd){while(--_0x4a8bdd){_0x160fde['push'](_0x160fde['shift']());}};_0x2424e7(++_0x2c7331);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8ba1('0x0'));exports[_0x8ba1('0x1')]=function(_0x2b1046,_0x43dc6a){return client[_0x8ba1('0x2')](_0x8ba1('0x3'),{'body':_0x43dc6a,'options':{'where':{'id':_0x2b1046}},'log':_0x8ba1('0x4')});};exports[_0x8ba1('0x5')]=function(_0x59c54c,_0xe3bc16){return client[_0x8ba1('0x2')](_0x8ba1('0x6'),{'body':_0xe3bc16,'options':{'where':{'id':_0x59c54c}},'log':_0x8ba1('0x7')});};
\ No newline at end of file
index f8fc927..d6e9e8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa56f=['../client','create','Request','CreateWhatsappMessage'];(function(_0x19df30,_0x59a15e){var _0x5ae3ca=function(_0x577ca3){while(--_0x577ca3){_0x19df30['push'](_0x19df30['shift']());}};_0x5ae3ca(++_0x59a15e);}(_0xa56f,0xd0));var _0xfa56=function(_0x40ca60,_0x4daff6){_0x40ca60=_0x40ca60-0x0;var _0x40b5f2=_0xa56f[_0x40ca60];return _0x40b5f2;};'use strict';var client=require(_0xfa56('0x0'));exports[_0xfa56('0x1')]=function(_0x364666){return client[_0xfa56('0x2')](_0xfa56('0x3'),{'body':_0x364666,'log':'createWhatsappMessage'});};
\ No newline at end of file
+var _0xf6ba=['../client','create','Request','createWhatsappMessage'];(function(_0x3f08d5,_0xf5eae2){var _0x1c95b6=function(_0x1c87c8){while(--_0x1c87c8){_0x3f08d5['push'](_0x3f08d5['shift']());}};_0x1c95b6(++_0xf5eae2);}(_0xf6ba,0x90));var _0xaf6b=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xf6ba[_0x5d4607];return _0x5e4a86;};'use strict';var client=require(_0xaf6b('0x0'));exports[_0xaf6b('0x1')]=function(_0x4bbc40){return client[_0xaf6b('0x2')]('CreateWhatsappMessage',{'body':_0x4bbc40,'log':_0xaf6b('0x3')});};
\ No newline at end of file
index 74aa4c7..da29b50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafe1=['whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','strategy','online'];(function(_0x639684,_0x565138){var _0x484e97=function(_0x814bcb){while(--_0x814bcb){_0x639684['push'](_0x639684['shift']());}};_0x484e97(++_0x565138);}(_0xafe1,0x14a));var _0x1afe=function(_0x20b4bd,_0xf0f37){_0x20b4bd=_0x20b4bd-0x0;var _0x588e21=_0xafe1[_0x20b4bd];return _0x588e21;};'use strict';var client=require(_0x1afe('0x0'));exports[_0x1afe('0x1')]=function(){return function(){return client['Request'](_0x1afe('0x2'),{'options':{'raw':![],'attributes':['id',_0x1afe('0x3'),'timeout',_0x1afe('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x1afe('0x3'),_0x1afe('0x5'),_0x1afe('0x6')]}]},'log':_0x1afe('0x1')});};};
\ No newline at end of file
+var _0xfda1=['timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfda1,0x127));var _0x1fda=function(_0x2f4c39,_0x1146b1){_0x2f4c39=_0x2f4c39-0x0;var _0x3426ab=_0xfda1[_0x2f4c39];return _0x3426ab;};'use strict';var client=require(_0x1fda('0x0'));exports[_0x1fda('0x1')]=function(){return function(){return client[_0x1fda('0x2')](_0x1fda('0x3'),{'options':{'raw':![],'attributes':['id',_0x1fda('0x4'),_0x1fda('0x5'),'strategy'],'include':[{'model':_0x1fda('0x6'),'as':_0x1fda('0x7'),'attributes':['id',_0x1fda('0x4'),_0x1fda('0x8'),_0x1fda('0x9')]}]},'log':_0x1fda('0x1')});};};
\ No newline at end of file
index 363b155..c897cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8bb=['update','Request','DESC','../client','CreateWhatsappQueueReport'];(function(_0x28ac96,_0x188140){var _0x399149=function(_0x184672){while(--_0x184672){_0x28ac96['push'](_0x28ac96['shift']());}};_0x399149(++_0x188140);}(_0xf8bb,0x1e8));var _0xbf8b=function(_0x26d2ed,_0x32991c){_0x26d2ed=_0x26d2ed-0x0;var _0x3a15ec=_0xf8bb[_0x26d2ed];return _0x3a15ec;};'use strict';var client=require(_0xbf8b('0x0'));exports['create']=function(_0x558b71){return client['Request'](_0xbf8b('0x1'),{'body':_0x558b71,'log':_0xbf8b('0x1')});};exports[_0xbf8b('0x2')]=function(_0x4777b8,_0x280bdf){return client[_0xbf8b('0x3')]('UpdateWhatsappQueueReport',{'body':_0x280bdf,'options':{'where':{'uniqueid':_0x4777b8},'order':[['id',_0xbf8b('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0xaeee=['DESC','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x5d7ae1,_0x5ec2e8){var _0x3bace7=function(_0x2c65ee){while(--_0x2c65ee){_0x5d7ae1['push'](_0x5d7ae1['shift']());}};_0x3bace7(++_0x5ec2e8);}(_0xaeee,0x114));var _0xeaee=function(_0x47fe5e,_0x5d9ec2){_0x47fe5e=_0x47fe5e-0x0;var _0x3ec29d=_0xaeee[_0x47fe5e];return _0x3ec29d;};'use strict';var client=require('../client');exports[_0xeaee('0x0')]=function(_0x4c9688){return client[_0xeaee('0x1')](_0xeaee('0x2'),{'body':_0x4c9688,'log':_0xeaee('0x2')});};exports['update']=function(_0x38fd01,_0x4f1098){return client[_0xeaee('0x1')](_0xeaee('0x3'),{'body':_0x4f1098,'options':{'where':{'uniqueid':_0x38fd01},'order':[['id',_0xeaee('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
index 03a6161..1a8ae35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08e0=['map','message','stop','find','agents','timeout','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','toLowerCase','consequence','length','[%s][AGENT]\x20%s'];(function(_0x1d484c,_0x27c954){var _0xb2ec18=function(_0x504d25){while(--_0x504d25){_0x1d484c['push'](_0x1d484c['shift']());}};_0xb2ec18(++_0x27c954);}(_0x08e0,0x19d));var _0x008e=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x08e0[_0x528575];return _0x3063b7;};'use strict';var schema=require(_0x008e('0x0'));var _=require(_0x008e('0x1'));var util=require(_0x008e('0x2'));var seqqueue=require(_0x008e('0x3'));var logger=require(_0x008e('0x4'))(_0x008e('0x5'));var strategy=require(_0x008e('0x6'));var queue=schema({'name':{'type':_0x008e('0x7'),'required':!![],'message':_0x008e('0x8')},'timeout':{'type':'number','message':_0x008e('0x9')}});function writeLog(_0x38b93b,_0x3171ef,_0xf7fbb1){return logger[_0x008e('0xa')](util[_0x008e('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x38b93b,_0x3171ef['name'],_0xf7fbb1));}function handleFindAgent(_0x22a444){return function(_0x361c89){return _0x361c89['name'][_0x008e('0xc')]()===_0x22a444[_0x008e('0xc')]();};}exports[_0x008e('0xd')]=function(_0xfb99,_0x392ce7,_0x5e4edc,_0x275c43){return function(_0xe959ab){try{var _0x1726c0={'name':_0x392ce7[0x0],'timeout':_0x392ce7[0x1]};var _0x4d2403=queue[_0x008e('0x0')](_0x1726c0,{'typecast':!![]});if(_0x4d2403[_0x008e('0xe')]){logger['error'](_0x008e('0xf'),_0xfb99,_[_0x008e('0x10')](_0x4d2403,_0x008e('0x11'))['join'](',\x20'));_0xe959ab[_0x008e('0x12')]();}else{var _0x21cd2e=_[_0x008e('0x13')](_0x5e4edc[_0x008e('0x14')],handleFindAgent(_0x1726c0['name']));if(_0x21cd2e){var _0x8caa67=(_0x1726c0[_0x008e('0x15')]||0xa)*0x3e8;var _0x42d191,_0x5f5620;var _0x22512e=seqqueue['createQueue'](_0x8caa67);_0x22512e['id']=_0xfb99;_0x22512e[_0x008e('0x16')]=_0x8caa67;_0x22512e[_0x008e('0x17')]=_0x275c43[_0x008e('0x17')];writeLog(_0xfb99,_0x21cd2e,util[_0x008e('0xb')](_0x008e('0x18'),_0x8caa67));_0x5e4edc[_0x008e('0x19')][_0xfb99]['on']('end',function(){logger['info'](_0x008e('0x1a'),_0xfb99);clearTimeout(_0x5f5620);_0x5f5620=undefined;_0x22512e['close']();if(_0x5e4edc[_0x008e('0x19')][_0xfb99]){delete _0x5e4edc[_0x008e('0x19')][_0xfb99];}_0xe959ab['stop']();});_0x5e4edc[_0x008e('0x19')][_0xfb99]['on'](_0x008e('0x1b'),function(){if(_0x5e4edc['rules'][_0xfb99]){delete _0x5e4edc['rules'][_0xfb99];}});_0x5f5620=setTimeout(function(){logger['info'](_0x008e('0x1c'),_0xfb99);clearTimeout(_0x5f5620);_0x22512e['close']();_0xe959ab[_0x008e('0x1d')]();},_0x8caa67);strategy['agent'](_0x22512e,_0x21cd2e,_0x5e4edc,_0x275c43);}else{logger['error'](_0x008e('0x1e'),_0xfb99,_0x1726c0['name']);_0xe959ab['stop']();}}}catch(_0x38787b){console[_0x008e('0x1f')](_0x38787b);logger['error'](_0x008e('0x20'),_0xfb99,_0x38787b['stack']);_0xe959ab[_0x008e('0x12')]();}};};
\ No newline at end of file
+var _0x6542=['createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','info','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','error','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','message','join','find','agents','timeout'];(function(_0x11cd4b,_0x4a54ca){var _0x52c3b8=function(_0x316529){while(--_0x316529){_0x11cd4b['push'](_0x11cd4b['shift']());}};_0x52c3b8(++_0x4a54ca);}(_0x6542,0xa1));var _0x2654=function(_0x5b17b4,_0x5a3221){_0x5b17b4=_0x5b17b4-0x0;var _0x55af79=_0x6542[_0x5b17b4];return _0x55af79;};'use strict';var schema=require(_0x2654('0x0'));var _=require(_0x2654('0x1'));var util=require(_0x2654('0x2'));var seqqueue=require(_0x2654('0x3'));var logger=require(_0x2654('0x4'))('routing');var strategy=require(_0x2654('0x5'));var queue=schema({'name':{'type':_0x2654('0x6'),'required':!![],'message':_0x2654('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x623fc3,_0x10700a,_0x5a20e5){return logger['info'](util[_0x2654('0x8')](_0x2654('0x9'),_0x623fc3,_0x10700a[_0x2654('0xa')],_0x5a20e5));}function handleFindAgent(_0x51cd9e){return function(_0x3d1196){return _0x3d1196[_0x2654('0xa')][_0x2654('0xb')]()===_0x51cd9e[_0x2654('0xb')]();};}exports[_0x2654('0xc')]=function(_0x3b1e76,_0x45fb6d,_0x20b5ac,_0x4b0ca8){return function(_0x1c1cf0){try{var _0x5d9822={'name':_0x45fb6d[0x0],'timeout':_0x45fb6d[0x1]};var _0x41b8a7=queue[_0x2654('0x0')](_0x5d9822,{'typecast':!![]});if(_0x41b8a7['length']){logger['error'](_0x2654('0xd'),_0x3b1e76,_['map'](_0x41b8a7,_0x2654('0xe'))[_0x2654('0xf')](',\x20'));_0x1c1cf0['stop']();}else{var _0x2f5c6a=_[_0x2654('0x10')](_0x20b5ac[_0x2654('0x11')],handleFindAgent(_0x5d9822[_0x2654('0xa')]));if(_0x2f5c6a){var _0x266bb8=(_0x5d9822[_0x2654('0x12')]||0xa)*0x3e8;var _0x5cc846,_0x4cb404;var _0x20d493=seqqueue[_0x2654('0x13')](_0x266bb8);_0x20d493['id']=_0x3b1e76;_0x20d493[_0x2654('0x14')]=_0x266bb8;_0x20d493[_0x2654('0x15')]=_0x4b0ca8[_0x2654('0x15')];writeLog(_0x3b1e76,_0x2f5c6a,util[_0x2654('0x8')](_0x2654('0x16'),_0x266bb8));_0x20b5ac[_0x2654('0x17')][_0x3b1e76]['on'](_0x2654('0x18'),function(){logger['info'](_0x2654('0x19'),_0x3b1e76);clearTimeout(_0x4cb404);_0x4cb404=undefined;_0x20d493['close']();if(_0x20b5ac[_0x2654('0x17')][_0x3b1e76]){delete _0x20b5ac[_0x2654('0x17')][_0x3b1e76];}_0x1c1cf0['stop']();});_0x20b5ac[_0x2654('0x17')][_0x3b1e76]['on'](_0x2654('0x1a'),function(){if(_0x20b5ac['rules'][_0x3b1e76]){delete _0x20b5ac['rules'][_0x3b1e76];}});_0x4cb404=setTimeout(function(){logger[_0x2654('0x1b')](_0x2654('0x1c'),_0x3b1e76);clearTimeout(_0x4cb404);_0x20d493[_0x2654('0x1d')]();_0x1c1cf0['next']();},_0x266bb8);strategy[_0x2654('0x1e')](_0x20d493,_0x2f5c6a,_0x20b5ac,_0x4b0ca8);}else{logger['error'](_0x2654('0x1f'),_0x3b1e76,_0x5d9822['name']);_0x1c1cf0[_0x2654('0x20')]();}}}catch(_0xc21367){console['log'](_0xc21367);logger[_0x2654('0x21')](_0x2654('0x22'),_0x3b1e76,_0xc21367[_0x2654('0x23')]);_0x1c1cf0[_0x2654('0x20')]();}};};
\ No newline at end of file
index 82b9f1a..7ef7380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd3e=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','error','amazonlex','providerName','providerResponse','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','Message','body','catch'];(function(_0x3b126f,_0x54f656){var _0x133e72=function(_0xe7afc){while(--_0xe7afc){_0x3b126f['push'](_0x3b126f['shift']());}};_0x133e72(++_0x54f656);}(_0xfd3e,0x176));var _0xefd3=function(_0x23e7a0,_0x3a8deb){_0x23e7a0=_0x23e7a0-0x0;var _0x1a2996=_0xfd3e[_0x23e7a0];return _0x1a2996;};'use strict';var _=require(_0xefd3('0x0'));var moment=require(_0xefd3('0x1'));var AWS=require(_0xefd3('0x2'));var utils=require(_0xefd3('0x3'));var logger=require(_0xefd3('0x4'))(_0xefd3('0x5'));var rpc={'chatMessage':require(_0xefd3('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xefd3('0x7')),'whatsappMessage':require(_0xefd3('0x8'))};exports[_0xefd3('0x9')]=function(_0x1613b3,_0x44aae4){return function(_0x27336c){try{if(!_[_0xefd3('0xa')](this[_0xefd3('0xb')][_0xefd3('0xc')])){logger['info'](_0xefd3('0xd'),_0x1613b3,_0xefd3('0xe'));return _0x27336c[_0xefd3('0xf')]();}var _0x3a8bcf={'ContactId':this[_0xefd3('0x10')]['id'],'sentAt':moment()[_0xefd3('0x11')](_0xefd3('0x12')),'direction':_0xefd3('0x13')};if(this[_0xefd3('0x14')]==='sms'||this[_0xefd3('0x14')]===_0xefd3('0x15')){_0x3a8bcf[_0xefd3('0x16')]=this['interaction'][_0xefd3('0x16')];}var _0x52b5df=this[_0xefd3('0x14')];if(_0x52b5df===_0xefd3('0x17')){_0x3a8bcf[_0xefd3('0x18')]=this[_0xefd3('0x19')]['id'];}else{_0x3a8bcf[_[_0xefd3('0x1a')](_0x52b5df)+_0xefd3('0x1b')]=this['account']['id'];}_0x3a8bcf[_[_0xefd3('0x1a')](_0x52b5df)+'InteractionId']=this[_0xefd3('0xb')]['id'];if(this[_0xefd3('0xb')][_0xefd3('0x1c')]){var _0x537db6=_0x44aae4[0x4];if(!_[_0xefd3('0x1d')](_0x537db6)){_0x3a8bcf['body']=utils[_0xefd3('0x1e')](_0x537db6,this);return rpc[_0x52b5df+_0xefd3('0x1f')]['create'](_0x3a8bcf)['then'](function(_0xa8085f){logger['info'](_0xefd3('0xd'),_0x1613b3,_0x3a8bcf[_0xefd3('0x20')]);})[_0xefd3('0x21')](function(_0x145e6a){logger['error'](_0xefd3('0xd'),_0x1613b3,JSON[_0xefd3('0x22')](_0x145e6a));})[_0xefd3('0x23')](function(){logger['info'](_0xefd3('0x24'),_0x1613b3);_0x27336c[_0xefd3('0x25')]();});}else{logger[_0xefd3('0x26')](_0xefd3('0x27'),_0x1613b3);_0x27336c['stop']();}}else{var _0x5408be=this;var _0x1dda66=new AWS[(_0xefd3('0x28'))]({'accessKeyId':_0x44aae4[0x0],'secretAccessKey':_0x44aae4[0x1],'region':_0x44aae4[0x2]});var _0xe90d25={'botAlias':'$LATEST','botName':_0x44aae4[0x3],'inputText':this[_0xefd3('0x29')]['body'],'userId':this[_0xefd3('0x14')]+':'+this[_0xefd3('0xb')]['id'][_0xefd3('0x2a')]()};_0x1dda66[_0xefd3('0x2b')](_0xe90d25,function(_0xcfccbf,_0x4b6572){if(_0xcfccbf){logger[_0xefd3('0x2c')](_0xefd3('0xd'),_0x1613b3,_0xcfccbf[_0xefd3('0x29')]);_0x27336c['next']();}else if(_0x4b6572&&_0x4b6572[_0xefd3('0x29')]){_0x5408be[_0xefd3('0x20')][_0xefd3('0x2d')]=_0x4b6572;_0x3a8bcf[_0xefd3('0x20')]=_0x4b6572[_0xefd3('0x29')];_0x3a8bcf[_0xefd3('0x2e')]=_0xefd3('0x2d');_0x3a8bcf[_0xefd3('0x2f')]=JSON[_0xefd3('0x22')](_0x4b6572);return rpc[_0x52b5df+_0xefd3('0x1f')]['create'](_0x3a8bcf)[_0xefd3('0x30')](function(_0x1cc751){logger[_0xefd3('0x26')](_0xefd3('0xd'),_0x1613b3,_0x3a8bcf[_0xefd3('0x20')]);if(_0x4b6572[_0xefd3('0x31')]==_0xefd3('0x32')){_0x27336c[_0xefd3('0xf')]();}else{_0x27336c['stop']();}})[_0xefd3('0x21')](function(_0x43327c){logger['error'](_0xefd3('0xd'),_0x1613b3,JSON[_0xefd3('0x22')](_0x43327c));_0x27336c[_0xefd3('0xf')]();});}else{_0x27336c[_0xefd3('0xf')]();}});}}catch(_0x854d9c){logger[_0xefd3('0x2c')](_0xefd3('0xd'),_0x1613b3,JSON['stringify'](_0x854d9c));_0x27336c[_0xefd3('0x25')]();}};};
\ No newline at end of file
+var _0x340a=['format','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','Message','create','catch','error','stringify','finally','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','then','dialogState','Failed','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','contact'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0x340a,0xa7));var _0xa340=function(_0x33fef8,_0x1f8ef1){_0x33fef8=_0x33fef8-0x0;var _0x4b840e=_0x340a[_0x33fef8];return _0x4b840e;};'use strict';var _=require(_0xa340('0x0'));var moment=require(_0xa340('0x1'));var AWS=require('aws-sdk');var utils=require(_0xa340('0x2'));var logger=require('../../../../config/logger')(_0xa340('0x3'));var rpc={'chatMessage':require(_0xa340('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa340('0x5')),'smsMessage':require(_0xa340('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa340('0x7'))};exports['consequence']=function(_0x3f6dd3,_0x5edf89){return function(_0x5d62e5){try{if(!_[_0xa340('0x8')](this[_0xa340('0x9')]['UserId'])){logger[_0xa340('0xa')](_0xa340('0xb'),_0x3f6dd3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5d62e5['next']();}var _0x2d94b0={'ContactId':this[_0xa340('0xc')]['id'],'sentAt':moment()[_0xa340('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xa340('0xe')]===_0xa340('0xf')||this[_0xa340('0xe')]===_0xa340('0x10')){_0x2d94b0['phone']=this[_0xa340('0x9')][_0xa340('0x11')];}var _0x2dbae6=this[_0xa340('0xe')];if(_0x2dbae6===_0xa340('0x12')){_0x2d94b0[_0xa340('0x13')]=this[_0xa340('0x14')]['id'];}else{_0x2d94b0[_[_0xa340('0x15')](_0x2dbae6)+_0xa340('0x16')]=this[_0xa340('0x14')]['id'];}_0x2d94b0[_['upperFirst'](_0x2dbae6)+_0xa340('0x17')]=this[_0xa340('0x9')]['id'];if(this[_0xa340('0x9')]['created']){var _0x6db73d=_0x5edf89[0x4];if(!_[_0xa340('0x18')](_0x6db73d)){_0x2d94b0[_0xa340('0x19')]=utils['getMustacheRender'](_0x6db73d,this);return rpc[_0x2dbae6+_0xa340('0x1a')][_0xa340('0x1b')](_0x2d94b0)['then'](function(_0x16886d){logger[_0xa340('0xa')](_0xa340('0xb'),_0x3f6dd3,_0x2d94b0[_0xa340('0x19')]);})[_0xa340('0x1c')](function(_0x2f9ad1){logger[_0xa340('0x1d')](_0xa340('0xb'),_0x3f6dd3,JSON[_0xa340('0x1e')](_0x2f9ad1));})[_0xa340('0x1f')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3f6dd3);_0x5d62e5[_0xa340('0x20')]();});}else{logger[_0xa340('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3f6dd3);_0x5d62e5[_0xa340('0x20')]();}}else{var _0x696f3a=this;var _0x475366=new AWS[(_0xa340('0x21'))]({'accessKeyId':_0x5edf89[0x0],'secretAccessKey':_0x5edf89[0x1],'region':_0x5edf89[0x2]});var _0x2acc03={'botAlias':_0xa340('0x22'),'botName':_0x5edf89[0x3],'inputText':this[_0xa340('0x23')][_0xa340('0x19')],'userId':this[_0xa340('0xe')]+':'+this[_0xa340('0x9')]['id'][_0xa340('0x24')]()};_0x475366[_0xa340('0x25')](_0x2acc03,function(_0xc1152a,_0x43d034){if(_0xc1152a){logger['error'](_0xa340('0xb'),_0x3f6dd3,_0xc1152a[_0xa340('0x23')]);_0x5d62e5[_0xa340('0x26')]();}else if(_0x43d034&&_0x43d034[_0xa340('0x23')]){_0x696f3a[_0xa340('0x19')][_0xa340('0x27')]=_0x43d034;_0x2d94b0[_0xa340('0x19')]=_0x43d034[_0xa340('0x23')];_0x2d94b0[_0xa340('0x28')]='amazonlex';_0x2d94b0[_0xa340('0x29')]=JSON[_0xa340('0x1e')](_0x43d034);return rpc[_0x2dbae6+_0xa340('0x1a')][_0xa340('0x1b')](_0x2d94b0)[_0xa340('0x2a')](function(_0x1b15e9){logger[_0xa340('0xa')](_0xa340('0xb'),_0x3f6dd3,_0x2d94b0[_0xa340('0x19')]);if(_0x43d034[_0xa340('0x2b')]==_0xa340('0x2c')){_0x5d62e5[_0xa340('0x26')]();}else{_0x5d62e5[_0xa340('0x20')]();}})[_0xa340('0x1c')](function(_0x776840){logger[_0xa340('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3f6dd3,JSON[_0xa340('0x1e')](_0x776840));_0x5d62e5[_0xa340('0x26')]();});}else{_0x5d62e5['next']();}});}}catch(_0x5c9e7b){logger[_0xa340('0x1d')](_0xa340('0xb'),_0x3f6dd3,JSON[_0xa340('0x1e')](_0x5c9e7b));_0x5d62e5[_0xa340('0x20')]();}};};
\ No newline at end of file
index 561be26..f6336dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2574=['Re:\x20','chat','account','upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','authentication','user','inReplyTo','messageId','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','Interaction','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','next','autoreplyExecuted','channel','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','mail','phone','read','subject','startsWith','Re:'];(function(_0xd9ce1,_0x517167){var _0x54be53=function(_0x27a6bd){while(--_0x27a6bd){_0xd9ce1['push'](_0xd9ce1['shift']());}};_0x54be53(++_0x517167);}(_0x2574,0x1c4));var _0x4257=function(_0x483e76,_0x7605ae){_0x483e76=_0x483e76-0x0;var _0x463e65=_0x2574[_0x483e76];return _0x463e65;};'use strict';var _=require(_0x4257('0x0'));var moment=require(_0x4257('0x1'));var utils=require(_0x4257('0x2'));var logger=require(_0x4257('0x3'))('routing');var rpc={'chatMessage':require(_0x4257('0x4')),'openchannelMessage':require(_0x4257('0x5')),'mailMessage':require(_0x4257('0x6')),'smsMessage':require(_0x4257('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x4257('0x8')),'mailInteraction':require(_0x4257('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x4257('0xa')]=function(_0x1b97e2,_0x129046){return function(_0x58a8ca){try{if(_0x129046[0x0]==='1'&&(_[_0x4257('0xb')](this[_0x4257('0xc')][_0x4257('0xd')])||!this[_0x4257('0xc')]['created'])){logger[_0x4257('0xe')](_0x4257('0xf'),_0x1b97e2,'Autoreply\x20already\x20sent');return _0x58a8ca[_0x4257('0x10')]();}if(_0x129046[0x0]==='2'&&this[_0x4257('0xc')][_0x4257('0x11')]){logger[_0x4257('0xe')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1b97e2,'One\x20Time\x20already\x20sent');return _0x58a8ca[_0x4257('0x10')]();}var _0x1b0780=this[_0x4257('0x12')];var _0x589ace={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4257('0x13')](_0x4257('0x14')),'direction':'out'};if(this[_0x4257('0x12')]==='mail'){_0x589ace[_0x4257('0x15')]=utils[_0x4257('0x16')](_0x129046[0x2],this);}else{_0x589ace[_0x4257('0x15')]=utils[_0x4257('0x16')](_0x129046[0x1],this);}if(this[_0x4257('0x17')]){_0x589ace['to']=this[_0x4257('0x17')][_0x4257('0x18')]||'';if(this[_0x4257('0x12')]===_0x4257('0x19')&&_0x129046[0x1]==='1'){_0x589ace['cc']=this[_0x4257('0x17')]['cc']||'';}_0x589ace[_0x4257('0x18')]=this[_0x4257('0x17')]['to']||'';_0x589ace[_0x4257('0x1a')]=this[_0x4257('0x17')][_0x4257('0x1a')]||'';_0x589ace[_0x4257('0x1b')]=!![];if(this['message'][_0x4257('0x1c')]){_0x589ace['subject']='';_0x589ace[_0x4257('0x1c')]+=_[_0x4257('0x1d')](this[_0x4257('0x17')][_0x4257('0x1c')],_0x4257('0x1e'))?'':_0x4257('0x1f');_0x589ace['subject']+=this['message']['subject'];}}if(this[_0x4257('0x12')]===_0x4257('0x20')){_0x589ace['ChatWebsiteId']=this[_0x4257('0x21')]['id'];}else{_0x589ace[_[_0x4257('0x22')](this[_0x4257('0x12')])+_0x4257('0x23')]=this[_0x4257('0x21')]['id'];}_0x589ace[_[_0x4257('0x22')](this[_0x4257('0x12')])+_0x4257('0x24')]=this[_0x4257('0xc')]['id'];var _0x4d7c4c=this[_0x4257('0xc')];if(rpc[this[_0x4257('0x12')]+_0x4257('0x25')]){if(this[_0x4257('0x12')]===_0x4257('0x19')){var _0x32d479={'tls':{'rejectUnauthorized':![]}};if(this[_0x4257('0x21')]['Smtp'][_0x4257('0x26')]){_0x32d479[_0x4257('0x26')]=this[_0x4257('0x21')][_0x4257('0x27')][_0x4257('0x26')];}else{_0x32d479[_0x4257('0x28')]=this['account'][_0x4257('0x27')][_0x4257('0x28')];_0x32d479[_0x4257('0x29')]=this['account'][_0x4257('0x27')][_0x4257('0x29')];_0x32d479[_0x4257('0x2a')]=this[_0x4257('0x21')][_0x4257('0x27')][_0x4257('0x2a')];}if(this[_0x4257('0x21')][_0x4257('0x27')][_0x4257('0x2b')]){_0x32d479['auth']={'user':this[_0x4257('0x21')]['Smtp'][_0x4257('0x2c')],'pass':this[_0x4257('0x21')][_0x4257('0x27')]['pass']};}_0x589ace[_0x4257('0x2d')]=this['message'][_0x4257('0x2e')];_0x589ace['html']='<div\x20id=\x22xm-mail-content\x22>'+_[_0x4257('0x2f')](_0x589ace[_0x4257('0x15')],_0x4257('0x30'),_0x4257('0x31'))+_0x4257('0x32');_0x589ace[_0x4257('0x33')]={'Auto-Submitted':_0x4257('0x34'),'X-Auto-Response-Suppress':_0x4257('0x35'),'Precedence':_0x4257('0x36')};return mailRpc[_0x4257('0x37')](_0x32d479,_0x589ace)[_0x4257('0x38')](function(_0x37b441){logger[_0x4257('0xe')](_0x4257('0x39'),_0x1b97e2);_0x589ace[_0x4257('0x2e')]=_0x37b441[_0x4257('0x17')][_0x4257('0x2e')];return rpc[_0x1b0780+_0x4257('0x25')]['create'](_0x589ace);})[_0x4257('0x38')](function(_0xb7ad31){logger[_0x4257('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b97e2,JSON[_0x4257('0x3a')](_0xb7ad31));})[_0x4257('0x3b')](function(_0x183d5e){logger[_0x4257('0x3c')](_0x4257('0x3d'),_0x1b97e2,JSON[_0x4257('0x3a')](_0x183d5e));})[_0x4257('0x3e')](function(){Promise[_0x4257('0x3f')]()[_0x4257('0x38')](function(){if(_0x129046[0x0]!=='2'||_0x4d7c4c[_0x4257('0x11')])return;return rpc[_0x1b0780+'Interaction'][_0x4257('0x40')](_0x4d7c4c['id'],{'autoreplyExecuted':!![]})[_0x4257('0x38')](function(_0x236d87){logger[_0x4257('0xe')](_0x4257('0x41'),_0x1b97e2,JSON[_0x4257('0x3a')](_0x236d87));})['catch'](function(_0x530643){logger[_0x4257('0x3c')](_0x4257('0x42'),_0x1b97e2,JSON[_0x4257('0x3a')](_0x530643));});})[_0x4257('0x38')](function(){_0x58a8ca[_0x4257('0x10')]();});});}else{return rpc[this[_0x4257('0x12')]+_0x4257('0x25')][_0x4257('0x43')](_0x589ace)[_0x4257('0x38')](function(_0x50cc2b){logger[_0x4257('0xe')](_0x4257('0xf'),_0x1b97e2,_0x589ace[_0x4257('0x15')]);})[_0x4257('0x3b')](function(_0x4cd55c){logger[_0x4257('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x1b97e2,JSON[_0x4257('0x3a')](_0x4cd55c));})[_0x4257('0x3e')](function(){Promise['resolve']()[_0x4257('0x38')](function(){if(_0x129046[0x0]!=='2'||_0x4d7c4c['autoreplyExecuted'])return;return rpc[_0x1b0780+_0x4257('0x44')][_0x4257('0x40')](_0x4d7c4c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5e26e1){logger[_0x4257('0xe')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1b97e2,JSON[_0x4257('0x3a')](_0x5e26e1));})['catch'](function(_0x26ebb7){logger[_0x4257('0x3c')](_0x4257('0x42'),_0x1b97e2,JSON['stringify'](_0x26ebb7));});})[_0x4257('0x38')](function(){_0x58a8ca[_0x4257('0x10')]();});});}}}catch(_0x4efa56){logger[_0x4257('0x3c')](_0x4257('0xf'),_0x1b97e2,JSON[_0x4257('0x3a')](_0x4efa56));_0x58a8ca['stop']();}};};
\ No newline at end of file
+var _0xe191=['InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','pass','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','[%s][AUTOREPLY]\x20%s','stringify','catch','error','finally','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','interaction','created','info','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','mail','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0xb3bbc8,_0x2a3635){var _0x3254b7=function(_0x823e23){while(--_0x823e23){_0xb3bbc8['push'](_0xb3bbc8['shift']());}};_0x3254b7(++_0x2a3635);}(_0xe191,0xb7));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e19('0x0'));var moment=require(_0x1e19('0x1'));var utils=require(_0x1e19('0x2'));var logger=require(_0x1e19('0x3'))('routing');var rpc={'chatMessage':require(_0x1e19('0x4')),'openchannelMessage':require(_0x1e19('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1e19('0x6')),'faxMessage':require(_0x1e19('0x7')),'whatsappMessage':require(_0x1e19('0x8')),'chatInteraction':require(_0x1e19('0x9')),'openchannelInteraction':require(_0x1e19('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x1e19('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1e19('0xc'))};var mailRpc=require(_0x1e19('0xd'));exports[_0x1e19('0xe')]=function(_0x1e24ab,_0x3c8dc2){return function(_0x15d9e6){try{if(_0x3c8dc2[0x0]==='1'&&(_['isNil'](this[_0x1e19('0xf')][_0x1e19('0x10')])||!this[_0x1e19('0xf')][_0x1e19('0x10')])){logger[_0x1e19('0x11')]('[%s][AUTOREPLY]\x20%s',_0x1e24ab,_0x1e19('0x12'));return _0x15d9e6[_0x1e19('0x13')]();}if(_0x3c8dc2[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger['info'](_0x1e19('0x14'),_0x1e24ab,_0x1e19('0x15'));return _0x15d9e6['next']();}var _0x44a725=this[_0x1e19('0x16')];var _0x55e01a={'ContactId':this[_0x1e19('0x17')]['id'],'sentAt':moment()[_0x1e19('0x18')](_0x1e19('0x19')),'direction':_0x1e19('0x1a')};if(this[_0x1e19('0x16')]==='mail'){_0x55e01a[_0x1e19('0x1b')]=utils[_0x1e19('0x1c')](_0x3c8dc2[0x2],this);}else{_0x55e01a[_0x1e19('0x1b')]=utils[_0x1e19('0x1c')](_0x3c8dc2[0x1],this);}if(this[_0x1e19('0x1d')]){_0x55e01a['to']=this[_0x1e19('0x1d')][_0x1e19('0x1e')]||'';if(this['channel']===_0x1e19('0x1f')&&_0x3c8dc2[0x1]==='1'){_0x55e01a['cc']=this[_0x1e19('0x1d')]['cc']||'';}_0x55e01a['from']=this['message']['to']||'';_0x55e01a[_0x1e19('0x20')]=this[_0x1e19('0x1d')][_0x1e19('0x20')]||'';_0x55e01a['read']=!![];if(this['message'][_0x1e19('0x21')]){_0x55e01a[_0x1e19('0x21')]='';_0x55e01a[_0x1e19('0x21')]+=_[_0x1e19('0x22')](this[_0x1e19('0x1d')][_0x1e19('0x21')],_0x1e19('0x23'))?'':_0x1e19('0x24');_0x55e01a[_0x1e19('0x21')]+=this[_0x1e19('0x1d')]['subject'];}}if(this[_0x1e19('0x16')]===_0x1e19('0x25')){_0x55e01a[_0x1e19('0x26')]=this['account']['id'];}else{_0x55e01a[_[_0x1e19('0x27')](this[_0x1e19('0x16')])+_0x1e19('0x28')]=this[_0x1e19('0x29')]['id'];}_0x55e01a[_['upperFirst'](this[_0x1e19('0x16')])+_0x1e19('0x2a')]=this[_0x1e19('0xf')]['id'];var _0x482cc8=this[_0x1e19('0xf')];if(rpc[this['channel']+_0x1e19('0x2b')]){if(this[_0x1e19('0x16')]==='mail'){var _0x2b70d0={'tls':{'rejectUnauthorized':![]}};if(this[_0x1e19('0x29')][_0x1e19('0x2c')]['service']){_0x2b70d0[_0x1e19('0x2d')]=this[_0x1e19('0x29')][_0x1e19('0x2c')]['service'];}else{_0x2b70d0[_0x1e19('0x2e')]=this[_0x1e19('0x29')][_0x1e19('0x2c')][_0x1e19('0x2e')];_0x2b70d0[_0x1e19('0x2f')]=this['account'][_0x1e19('0x2c')][_0x1e19('0x2f')];_0x2b70d0[_0x1e19('0x30')]=this[_0x1e19('0x29')][_0x1e19('0x2c')][_0x1e19('0x30')];}if(this['account'][_0x1e19('0x2c')][_0x1e19('0x31')]){_0x2b70d0[_0x1e19('0x32')]={'user':this[_0x1e19('0x29')][_0x1e19('0x2c')]['user'],'pass':this[_0x1e19('0x29')][_0x1e19('0x2c')][_0x1e19('0x33')]};}_0x55e01a[_0x1e19('0x34')]=this['message'][_0x1e19('0x35')];_0x55e01a['html']=_0x1e19('0x36')+_[_0x1e19('0x37')](_0x55e01a[_0x1e19('0x1b')],_0x1e19('0x38'),_0x1e19('0x39'))+'</div>';_0x55e01a['headers']={'Auto-Submitted':_0x1e19('0x3a'),'X-Auto-Response-Suppress':_0x1e19('0x3b'),'Precedence':_0x1e19('0x3c')};return mailRpc[_0x1e19('0x3d')](_0x2b70d0,_0x55e01a)[_0x1e19('0x3e')](function(_0x1356fd){logger[_0x1e19('0x11')](_0x1e19('0x3f'),_0x1e24ab);_0x55e01a[_0x1e19('0x35')]=_0x1356fd[_0x1e19('0x1d')][_0x1e19('0x35')];return rpc[_0x44a725+_0x1e19('0x2b')]['create'](_0x55e01a);})[_0x1e19('0x3e')](function(_0x5d2b14){logger['info'](_0x1e19('0x40'),_0x1e24ab,JSON[_0x1e19('0x41')](_0x5d2b14));})[_0x1e19('0x42')](function(_0x4fdfe3){logger[_0x1e19('0x43')]('[RPC][%s][AUTOREPLY]\x20%s',_0x1e24ab,JSON[_0x1e19('0x41')](_0x4fdfe3));})[_0x1e19('0x44')](function(){Promise['resolve']()[_0x1e19('0x3e')](function(){if(_0x3c8dc2[0x0]!=='2'||_0x482cc8[_0x1e19('0x45')])return;return rpc[_0x44a725+_0x1e19('0x46')][_0x1e19('0x47')](_0x482cc8['id'],{'autoreplyExecuted':!![]})[_0x1e19('0x3e')](function(_0x30bd21){logger[_0x1e19('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e24ab,JSON['stringify'](_0x30bd21));})[_0x1e19('0x42')](function(_0x40a9ad){logger[_0x1e19('0x43')](_0x1e19('0x48'),_0x1e24ab,JSON[_0x1e19('0x41')](_0x40a9ad));});})[_0x1e19('0x3e')](function(){_0x15d9e6[_0x1e19('0x13')]();});});}else{return rpc[this['channel']+'Message'][_0x1e19('0x49')](_0x55e01a)[_0x1e19('0x3e')](function(_0x2701c6){logger['info']('[%s][AUTOREPLY]\x20%s',_0x1e24ab,_0x55e01a['body']);})['catch'](function(_0x134eb3){logger[_0x1e19('0x43')](_0x1e19('0x40'),_0x1e24ab,JSON[_0x1e19('0x41')](_0x134eb3));})[_0x1e19('0x44')](function(){Promise['resolve']()['then'](function(){if(_0x3c8dc2[0x0]!=='2'||_0x482cc8[_0x1e19('0x45')])return;return rpc[_0x44a725+_0x1e19('0x46')][_0x1e19('0x47')](_0x482cc8['id'],{'autoreplyExecuted':!![]})[_0x1e19('0x3e')](function(_0x5ad5b7){logger[_0x1e19('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e24ab,JSON[_0x1e19('0x41')](_0x5ad5b7));})[_0x1e19('0x42')](function(_0x47f1c5){logger[_0x1e19('0x43')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1e24ab,JSON[_0x1e19('0x41')](_0x47f1c5));});})[_0x1e19('0x3e')](function(){_0x15d9e6[_0x1e19('0x13')]();});});}}}catch(_0x832d11){logger[_0x1e19('0x43')](_0x1e19('0x40'),_0x1e24ab,JSON[_0x1e19('0x41')](_0x832d11));_0x15d9e6[_0x1e19('0x4a')]();}};};
\ No newline at end of file
index a8d4893..5597098 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fe1=['info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7fe1,0x1be));var _0x17fe=function(_0x51c99b,_0x420c1e){_0x51c99b=_0x51c99b-0x0;var _0xecf77e=_0x7fe1[_0x51c99b];return _0xecf77e;};'use strict';var moment=require(_0x17fe('0x0'));var logger=require(_0x17fe('0x1'))(_0x17fe('0x2'));var rpc={'chatInteraction':require(_0x17fe('0x3')),'openchannelInteraction':require(_0x17fe('0x4')),'smsInteraction':require(_0x17fe('0x5')),'mailInteraction':require(_0x17fe('0x6')),'faxInteraction':require(_0x17fe('0x7')),'whatsappInteraction':require(_0x17fe('0x8'))};exports[_0x17fe('0x9')]=function(_0x38fa12,_0x19503e,_0x3686cf,_0x3c1858){return function(_0x4d815d){try{logger[_0x17fe('0xa')](_0x17fe('0xb'),_0x38fa12,_0x19503e[0x0]);var _0x31afc4={'closed':0x1,'closedAt':moment()[_0x17fe('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x17fe('0xd'),'disposition':_0x19503e[0x0]};if(rpc[_0x3c1858[_0x17fe('0xe')]+_0x17fe('0xf')]){rpc[_0x3c1858[_0x17fe('0xe')]+_0x17fe('0xf')][_0x17fe('0x10')](_0x3c1858[_0x17fe('0x11')]['id'],_0x31afc4)[_0x17fe('0x12')](function(_0x58d5dd){logger[_0x17fe('0xa')](_0x17fe('0x13'),_0x38fa12,_0x3c1858[_0x17fe('0x11')]['id']);})[_0x17fe('0x14')](function(_0x4cedbe){logger[_0x17fe('0x15')](_0x17fe('0x16'),_0x38fa12,JSON['stringify'](_0x4cedbe));})[_0x17fe('0x17')](function(){_0x4d815d['stop']();});}}catch(_0x2e675b){logger[_0x17fe('0x15')](_0x17fe('0x16'),_0x38fa12,JSON['stringify'](_0x2e675b));_0x4d815d['stop']();}};};
\ No newline at end of file
+var _0xf497=['finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','Interaction','channel','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x3e290e,_0x5a713c){var _0x57653b=function(_0x322c42){while(--_0x322c42){_0x3e290e['push'](_0x3e290e['shift']());}};_0x57653b(++_0x5a713c);}(_0xf497,0x6b));var _0x7f49=function(_0x3855aa,_0x800a2f){_0x3855aa=_0x3855aa-0x0;var _0xffac73=_0xf497[_0x3855aa];return _0xffac73;};'use strict';var moment=require('moment');var logger=require(_0x7f49('0x0'))(_0x7f49('0x1'));var rpc={'chatInteraction':require(_0x7f49('0x2')),'openchannelInteraction':require(_0x7f49('0x3')),'smsInteraction':require(_0x7f49('0x4')),'mailInteraction':require(_0x7f49('0x5')),'faxInteraction':require(_0x7f49('0x6')),'whatsappInteraction':require(_0x7f49('0x7'))};exports[_0x7f49('0x8')]=function(_0x1156e2,_0x3d1614,_0x26b548,_0x5a317b){return function(_0x1ff57a){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x1156e2,_0x3d1614[0x0]);var _0x48e0b7={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x3d1614[0x0]};if(rpc[_0x5a317b['channel']+_0x7f49('0x9')]){rpc[_0x5a317b[_0x7f49('0xa')]+_0x7f49('0x9')][_0x7f49('0xb')](_0x5a317b['interaction']['id'],_0x48e0b7)[_0x7f49('0xc')](function(_0x5d3d6a){logger[_0x7f49('0xd')](_0x7f49('0xe'),_0x1156e2,_0x5a317b[_0x7f49('0xf')]['id']);})['catch'](function(_0x4613e3){logger[_0x7f49('0x10')](_0x7f49('0x11'),_0x1156e2,JSON[_0x7f49('0x12')](_0x4613e3));})[_0x7f49('0x13')](function(){_0x1ff57a[_0x7f49('0x14')]();});}}catch(_0x4f114c){logger[_0x7f49('0x10')](_0x7f49('0x11'),_0x1156e2,JSON[_0x7f49('0x12')](_0x4f114c));_0x1ff57a[_0x7f49('0x14')]();}};};
\ No newline at end of file
index de05ac8..683ebb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22b4=['next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','Message','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x22b4,0x8b));var _0x422b=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x22b4[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x422b('0x0'));var moment=require(_0x422b('0x1'));var apiai=require(_0x422b('0x2'));var md5=require(_0x422b('0x3'));var utils=require(_0x422b('0x4'));var logger=require(_0x422b('0x5'))('routing');var rpc={'chatMessage':require(_0x422b('0x6')),'openchannelMessage':require(_0x422b('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x422b('0x8')),'faxMessage':require(_0x422b('0x9')),'whatsappMessage':require(_0x422b('0xa'))};exports[_0x422b('0xb')]=function(_0x115622,_0x170011){return function(_0x48bdd2){try{if(!_[_0x422b('0xc')](this['interaction'][_0x422b('0xd')])){logger[_0x422b('0xe')](_0x422b('0xf'),_0x115622,_0x422b('0x10'));return _0x48bdd2[_0x422b('0x11')]();}var _0x42bcfa={'ContactId':this['contact']['id'],'sentAt':moment()[_0x422b('0x12')](_0x422b('0x13')),'direction':_0x422b('0x14')};if(this[_0x422b('0x15')]===_0x422b('0x16')||this[_0x422b('0x15')]===_0x422b('0x17')){_0x42bcfa[_0x422b('0x18')]=this['interaction']['phone'];}var _0x4339ef=this[_0x422b('0x15')];if(_0x4339ef===_0x422b('0x19')){_0x42bcfa[_0x422b('0x1a')]=this[_0x422b('0x1b')]['id'];}else{_0x42bcfa[_[_0x422b('0x1c')](_0x4339ef)+_0x422b('0x1d')]=this[_0x422b('0x1b')]['id'];}_0x42bcfa[_['upperFirst'](_0x4339ef)+_0x422b('0x1e')]=this['interaction']['id'];if(this[_0x422b('0x1f')][_0x422b('0x20')]){var _0x2b2fd1=_0x170011[0x2];if(!_[_0x422b('0x21')](_0x2b2fd1)){_0x42bcfa[_0x422b('0x22')]=utils[_0x422b('0x23')](_0x2b2fd1,this);return rpc[_0x4339ef+'Message'][_0x422b('0x24')](_0x42bcfa)[_0x422b('0x25')](function(_0x1fdb00){logger['info'](_0x422b('0xf'),_0x115622,_0x42bcfa[_0x422b('0x22')]);})[_0x422b('0x26')](function(_0x291f19){logger[_0x422b('0x27')](_0x422b('0xf'),_0x115622,JSON[_0x422b('0x28')](_0x291f19));})['finally'](function(){logger[_0x422b('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x115622);_0x48bdd2['stop']();});}else{logger[_0x422b('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x115622);_0x48bdd2[_0x422b('0x29')]();}}else{var _0x5d1582=this;var _0x3f7619=apiai(_0x170011[0x0],{'language':_0x170011[0x1]||'en'});return _0x3f7619[_0x422b('0x2a')](this[_0x422b('0x2b')]['body'],{'sessionId':md5(this[_0x422b('0x1f')]['id'])})[_0x422b('0x25')](function(_0x3c34db){_0x5d1582[_0x422b('0x22')][_0x422b('0x2c')]=_0x3c34db;_0x42bcfa[_0x422b('0x22')]=_0x3c34db[_0x422b('0x2d')][_0x422b('0x2e')][_0x422b('0x2f')];_0x42bcfa[_0x422b('0x30')]=_0x422b('0x2c');_0x42bcfa['providerResponse']=JSON[_0x422b('0x28')](_0x3c34db);return rpc[_0x4339ef+_0x422b('0x31')][_0x422b('0x24')](_0x42bcfa)['then'](function(_0x48d2d9){logger['info'](_0x422b('0xf'),_0x115622,_0x42bcfa[_0x422b('0x22')]);if(_0x3c34db['result'][_0x422b('0x32')][_0x422b('0x33')]){_0x48bdd2[_0x422b('0x11')]();}else{_0x48bdd2[_0x422b('0x29')]();}})[_0x422b('0x26')](function(_0x19a4e8){logger[_0x422b('0x27')](_0x422b('0xf'),_0x115622,JSON['stringify'](_0x19a4e8));_0x48bdd2['next']();});})[_0x422b('0x26')](function(_0x429cff){logger[_0x422b('0x27')]('[%s][DIALOGFLOW]\x20%s',_0x115622,_0x429cff[_0x422b('0x2b')]);_0x48bdd2[_0x422b('0x11')]();});}}catch(_0x502146){logger[_0x422b('0x27')](_0x422b('0xf'),_0x115622,JSON[_0x422b('0x28')](_0x502146));_0x48bdd2[_0x422b('0x29')]();}};};
\ No newline at end of file
+var _0x7804=['then','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','create','metadata','endConversation','message','error','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','consequence','interaction','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','created','isEmpty','body','Message'];(function(_0x1d68f1,_0x9b88db){var _0xd5a000=function(_0x56bb5d){while(--_0x56bb5d){_0x1d68f1['push'](_0x1d68f1['shift']());}};_0xd5a000(++_0x9b88db);}(_0x7804,0xc3));var _0x4780=function(_0x309ced,_0x5bb2ab){_0x309ced=_0x309ced-0x0;var _0x29d56e=_0x7804[_0x309ced];return _0x29d56e;};'use strict';var _=require(_0x4780('0x0'));var moment=require('moment');var apiai=require(_0x4780('0x1'));var md5=require(_0x4780('0x2'));var utils=require(_0x4780('0x3'));var logger=require('../../../../config/logger')(_0x4780('0x4'));var rpc={'chatMessage':require(_0x4780('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4780('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4780('0x7')]=function(_0x36df6b,_0x9cd1a1){return function(_0x19356d){try{if(!_['isNil'](this[_0x4780('0x8')]['UserId'])){logger['info'](_0x4780('0x9'),_0x36df6b,_0x4780('0xa'));return _0x19356d[_0x4780('0xb')]();}var _0x45369b={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4780('0xc')),'direction':_0x4780('0xd')};if(this[_0x4780('0xe')]==='sms'||this['channel']===_0x4780('0xf')){_0x45369b[_0x4780('0x10')]=this[_0x4780('0x8')][_0x4780('0x10')];}var _0x32e131=this['channel'];if(_0x32e131==='chat'){_0x45369b[_0x4780('0x11')]=this['account']['id'];}else{_0x45369b[_[_0x4780('0x12')](_0x32e131)+_0x4780('0x13')]=this[_0x4780('0x14')]['id'];}_0x45369b[_[_0x4780('0x12')](_0x32e131)+'InteractionId']=this[_0x4780('0x8')]['id'];if(this['interaction'][_0x4780('0x15')]){var _0x382fe1=_0x9cd1a1[0x2];if(!_[_0x4780('0x16')](_0x382fe1)){_0x45369b[_0x4780('0x17')]=utils['getMustacheRender'](_0x382fe1,this);return rpc[_0x32e131+_0x4780('0x18')]['create'](_0x45369b)[_0x4780('0x19')](function(_0x31e76b){logger[_0x4780('0x1a')](_0x4780('0x9'),_0x36df6b,_0x45369b['body']);})[_0x4780('0x1b')](function(_0xc1f0a8){logger['error'](_0x4780('0x9'),_0x36df6b,JSON[_0x4780('0x1c')](_0xc1f0a8));})[_0x4780('0x1d')](function(){logger[_0x4780('0x1a')](_0x4780('0x1e'),_0x36df6b);_0x19356d[_0x4780('0x1f')]();});}else{logger[_0x4780('0x1a')](_0x4780('0x20'),_0x36df6b);_0x19356d[_0x4780('0x1f')]();}}else{var _0x3a7283=this;var _0x12b899=apiai(_0x9cd1a1[0x0],{'language':_0x9cd1a1[0x1]||'en'});return _0x12b899[_0x4780('0x21')](this['message']['body'],{'sessionId':md5(this[_0x4780('0x8')]['id'])})[_0x4780('0x19')](function(_0xb02bd){_0x3a7283[_0x4780('0x17')][_0x4780('0x22')]=_0xb02bd;_0x45369b[_0x4780('0x17')]=_0xb02bd[_0x4780('0x23')][_0x4780('0x24')][_0x4780('0x25')];_0x45369b[_0x4780('0x26')]=_0x4780('0x22');_0x45369b['providerResponse']=JSON[_0x4780('0x1c')](_0xb02bd);return rpc[_0x32e131+'Message'][_0x4780('0x27')](_0x45369b)[_0x4780('0x19')](function(_0x263cee){logger['info'](_0x4780('0x9'),_0x36df6b,_0x45369b[_0x4780('0x17')]);if(_0xb02bd[_0x4780('0x23')][_0x4780('0x28')][_0x4780('0x29')]){_0x19356d[_0x4780('0xb')]();}else{_0x19356d[_0x4780('0x1f')]();}})['catch'](function(_0x3a1c2c){logger['error'](_0x4780('0x9'),_0x36df6b,JSON[_0x4780('0x1c')](_0x3a1c2c));_0x19356d['next']();});})[_0x4780('0x1b')](function(_0x2ea303){logger['error'](_0x4780('0x9'),_0x36df6b,_0x2ea303[_0x4780('0x2a')]);_0x19356d[_0x4780('0xb')]();});}}catch(_0x1abda8){logger[_0x4780('0x2b')](_0x4780('0x9'),_0x36df6b,JSON[_0x4780('0x1c')](_0x1abda8));_0x19356d[_0x4780('0x1f')]();}};};
\ No newline at end of file
index a4470ea..73c2acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd7=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','error','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','length','diagnosticInfo','fields','queryResult','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','all','message','lodash','md5','moment','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','interaction','UserId','info','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat'];(function(_0x3aaab1,_0x227e22){var _0xbcc1ca=function(_0x34af7c){while(--_0x34af7c){_0x3aaab1['push'](_0x3aaab1['shift']());}};_0xbcc1ca(++_0x227e22);}(_0x5cd7,0x102));var _0x75cd=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x5cd7[_0x4191bc];return _0x1ffd4e;};'use strict';var _=require(_0x75cd('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x75cd('0x1'));var moment=require(_0x75cd('0x2'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x75cd('0x3'));var utils=require(_0x75cd('0x4'));var rpc={'chatMessage':require(_0x75cd('0x5')),'openchannelMessage':require(_0x75cd('0x6')),'mailMessage':require(_0x75cd('0x7')),'smsMessage':require(_0x75cd('0x8')),'faxMessage':require(_0x75cd('0x9')),'whatsappMessage':require(_0x75cd('0xa'))};function createMessage(_0x39f9f1,_0x5b06bc,_0x2ff58f,_0x26650d){return new Promise(function(_0x31ad66,_0x36ae05){var _0x46855c=_[_0x75cd('0xb')](_0x2ff58f);_0x46855c[_0x75cd('0xc')]=_0x26650d;return rpc[_0x5b06bc+_0x75cd('0xd')][_0x75cd('0xe')](_0x46855c)[_0x75cd('0xf')](function(){logger['info'](_0x75cd('0x10'),_0x39f9f1,_0x46855c['body']);_0x31ad66();})[_0x75cd('0x11')](function(_0x52585f){logger['error'](_0x75cd('0x10'),_0x39f9f1,JSON['stringify'](_0x52585f));_0x36ae05(_0x52585f);});});}exports[_0x75cd('0x12')]=function(_0x438645,_0x12701f){return function(_0x5f0712){try{if(!_['isNil'](this[_0x75cd('0x13')][_0x75cd('0x14')])){logger[_0x75cd('0x15')](_0x75cd('0x10'),_0x438645,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5f0712[_0x75cd('0x16')]();}var _0x1159b2={'ContactId':this[_0x75cd('0x17')]['id'],'sentAt':moment()['format'](_0x75cd('0x18')),'direction':'out'};if(this[_0x75cd('0x19')]===_0x75cd('0x1a')||this[_0x75cd('0x19')]===_0x75cd('0x1b')){_0x1159b2[_0x75cd('0x1c')]=this['interaction'][_0x75cd('0x1c')];}var _0x4301e1=this['channel'];if(_0x4301e1===_0x75cd('0x1d')){_0x1159b2[_0x75cd('0x1e')]=this[_0x75cd('0x1f')]['id'];}else{_0x1159b2[_[_0x75cd('0x20')](_0x4301e1)+_0x75cd('0x21')]=this[_0x75cd('0x1f')]['id'];}_0x1159b2[_[_0x75cd('0x20')](_0x4301e1)+_0x75cd('0x22')]=this[_0x75cd('0x13')]['id'];if(this[_0x75cd('0x13')][_0x75cd('0x23')]){var _0x44feb1=_0x12701f[0x4];if(!_[_0x75cd('0x24')](_0x44feb1)){_0x1159b2[_0x75cd('0xc')]=utils[_0x75cd('0x25')](_0x44feb1,this);return rpc[_0x4301e1+_0x75cd('0xd')][_0x75cd('0xe')](_0x1159b2)['then'](function(_0xd37b7b){logger[_0x75cd('0x15')](_0x75cd('0x10'),_0x438645,_0x1159b2['body']);})[_0x75cd('0x11')](function(_0x54dba9){logger[_0x75cd('0x26')](_0x75cd('0x10'),_0x438645,JSON[_0x75cd('0x27')](_0x54dba9));})[_0x75cd('0x28')](function(){logger[_0x75cd('0x15')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x438645);_0x5f0712[_0x75cd('0x29')]();});}else{logger[_0x75cd('0x15')](_0x75cd('0x2a'),_0x438645);_0x5f0712[_0x75cd('0x29')]();}}else{var _0x2462fe=this;var _0x37f202=_0x12701f[0x2][_0x75cd('0x2b')](/\\n/g,'\x0a');var _0x5ab986={'credentials':{'private_key':_0x37f202,'client_email':_0x12701f[0x1]}};var _0x1301b3=new dialogflow[(_0x75cd('0x2c'))](_0x5ab986);var _0x4417c3=_0x1301b3['sessionPath'](_0x12701f[0x0],md5(_0x2462fe['interaction']['id']));var _0x45607e={'session':_0x4417c3,'queryInput':{'text':{'text':_0x2462fe['message'][_0x75cd('0xc')],'languageCode':_0x12701f[0x3]||'en'}}};return _0x1301b3[_0x75cd('0x2d')](_0x45607e)[_0x75cd('0xf')](function(_0x28e2b1){if(_0x28e2b1&&_0x28e2b1[_0x75cd('0x2e')]){_0x2462fe[_0x75cd('0xc')]['dialogflowV2']=_0x28e2b1;var _0x27a15c=_0x28e2b1[0x0];var _0xd1a878=_0x27a15c['queryResult']['diagnosticInfo']&&_0x27a15c['queryResult'][_0x75cd('0x2f')][_0x75cd('0x30')]?_0x27a15c[_0x75cd('0x31')]['diagnosticInfo'][_0x75cd('0x30')][_0x75cd('0x32')][_0x75cd('0x33')]:![];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x34')]=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x35')];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x36')]=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x37')];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x38')]=_0x27a15c['queryResult'][_0x75cd('0x2f')]&&_0x27a15c[_0x75cd('0x31')][_0x75cd('0x2f')]['fields']?_0x27a15c[_0x75cd('0x31')][_0x75cd('0x2f')]['fields']['end_conversation'][_0x75cd('0x33')]:![];_0x2462fe[_0x75cd('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x39')]['name'];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x3a')]=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x39')][_0x75cd('0x3b')];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x3c')]=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x39')]['isFallback'];_0x2462fe['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x3d')];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x3e')]=_0x27a15c[_0x75cd('0x31')][_0x75cd('0x3f')];_0x2462fe[_0x75cd('0xc')][_0x75cd('0x40')]=_0x27a15c['queryResult'][_0x75cd('0x41')];_0x1159b2[_0x75cd('0x42')]=_0x75cd('0x43');_0x1159b2[_0x75cd('0x44')]=JSON[_0x75cd('0x27')](_0x28e2b1);var _0x1481fb=[];for(var _0xf79a27=0x0;_0xf79a27<_0x28e2b1[_0x75cd('0x2e')];_0xf79a27++){var _0x517b1e=_0x28e2b1[_0xf79a27];if(_0x517b1e&&_0x517b1e[_0x75cd('0x31')]&&_0x517b1e[_0x75cd('0x31')][_0x75cd('0x45')]){_0x1481fb['push'](createMessage(_0x438645,_0x4301e1,_0x1159b2,_0x517b1e[_0x75cd('0x31')][_0x75cd('0x45')]));}}return Promise[_0x75cd('0x46')](_0x1481fb)[_0x75cd('0xf')](function(){if(_0xd1a878){_0x5f0712['next']();}else{_0x5f0712['stop']();}})[_0x75cd('0x11')](function(_0x206ade){logger[_0x75cd('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x438645,JSON[_0x75cd('0x27')](_0x206ade));_0x5f0712[_0x75cd('0x16')]();});}})['catch'](function(_0x45e900){logger[_0x75cd('0x26')](_0x75cd('0x10'),_0x438645,_0x45e900[_0x75cd('0x47')]);_0x5f0712[_0x75cd('0x16')]();});}}catch(_0x43468d){logger[_0x75cd('0x26')](_0x75cd('0x10'),_0x438645,JSON[_0x75cd('0x27')](_0x43468d));_0x5f0712[_0x75cd('0x29')]();}};};
\ No newline at end of file
+var _0xf684=['isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','InteractionId','created','isEmpty','finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','next','lodash','md5','bluebird','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence'];(function(_0xfde638,_0x29d43f){var _0x1545dd=function(_0xec154e){while(--_0xec154e){_0xfde638['push'](_0xfde638['shift']());}};_0x1545dd(++_0x29d43f);}(_0xf684,0x1d9));var _0x4f68=function(_0x487d7e,_0x28e1dd){_0x487d7e=_0x487d7e-0x0;var _0x2096a4=_0xf684[_0x487d7e];return _0x2096a4;};'use strict';var _=require(_0x4f68('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x4f68('0x1'));var moment=require('moment');var Promise=require(_0x4f68('0x2'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x4f68('0x3'));var rpc={'chatMessage':require(_0x4f68('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4f68('0x5')),'smsMessage':require(_0x4f68('0x6')),'faxMessage':require(_0x4f68('0x7')),'whatsappMessage':require(_0x4f68('0x8'))};function createMessage(_0x2ffcbc,_0x439a57,_0x573572,_0x476cd3){return new Promise(function(_0x528f90,_0x475dcf){var _0x4f2d3d=_['clone'](_0x573572);_0x4f2d3d[_0x4f68('0x9')]=_0x476cd3;return rpc[_0x439a57+'Message'][_0x4f68('0xa')](_0x4f2d3d)[_0x4f68('0xb')](function(){logger['info'](_0x4f68('0xc'),_0x2ffcbc,_0x4f2d3d[_0x4f68('0x9')]);_0x528f90();})[_0x4f68('0xd')](function(_0x42f620){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x2ffcbc,JSON[_0x4f68('0xf')](_0x42f620));_0x475dcf(_0x42f620);});});}exports[_0x4f68('0x10')]=function(_0x492728,_0x47b658){return function(_0x486cd6){try{if(!_[_0x4f68('0x11')](this[_0x4f68('0x12')][_0x4f68('0x13')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x492728,_0x4f68('0x14'));return _0x486cd6['next']();}var _0x3d7e1a={'ContactId':this[_0x4f68('0x15')]['id'],'sentAt':moment()[_0x4f68('0x16')](_0x4f68('0x17')),'direction':_0x4f68('0x18')};if(this[_0x4f68('0x19')]==='sms'||this['channel']===_0x4f68('0x1a')){_0x3d7e1a[_0x4f68('0x1b')]=this[_0x4f68('0x12')][_0x4f68('0x1b')];}var _0x2a513d=this[_0x4f68('0x19')];if(_0x2a513d===_0x4f68('0x1c')){_0x3d7e1a[_0x4f68('0x1d')]=this['account']['id'];}else{_0x3d7e1a[_['upperFirst'](_0x2a513d)+_0x4f68('0x1e')]=this['account']['id'];}_0x3d7e1a[_['upperFirst'](_0x2a513d)+_0x4f68('0x1f')]=this[_0x4f68('0x12')]['id'];if(this[_0x4f68('0x12')][_0x4f68('0x20')]){var _0x16c540=_0x47b658[0x4];if(!_[_0x4f68('0x21')](_0x16c540)){_0x3d7e1a[_0x4f68('0x9')]=utils['getMustacheRender'](_0x16c540,this);return rpc[_0x2a513d+'Message'][_0x4f68('0xa')](_0x3d7e1a)[_0x4f68('0xb')](function(_0xfaac70){logger['info'](_0x4f68('0xc'),_0x492728,_0x3d7e1a[_0x4f68('0x9')]);})['catch'](function(_0x48712a){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x492728,JSON[_0x4f68('0xf')](_0x48712a));})[_0x4f68('0x22')](function(){logger[_0x4f68('0x23')](_0x4f68('0x24'),_0x492728);_0x486cd6[_0x4f68('0x25')]();});}else{logger['info'](_0x4f68('0x26'),_0x492728);_0x486cd6[_0x4f68('0x25')]();}}else{var _0x15443f=this;var _0x1f2e75=_0x47b658[0x2]['replace'](/\\n/g,'\x0a');var _0x1a8e2a={'credentials':{'private_key':_0x1f2e75,'client_email':_0x47b658[0x1]}};var _0x5c54e0=new dialogflow[(_0x4f68('0x27'))](_0x1a8e2a);var _0x454f24=_0x5c54e0[_0x4f68('0x28')](_0x47b658[0x0],md5(_0x15443f[_0x4f68('0x12')]['id']));var _0x19630a={'session':_0x454f24,'queryInput':{'text':{'text':_0x15443f[_0x4f68('0x29')][_0x4f68('0x9')],'languageCode':_0x47b658[0x3]||'en'}}};return _0x5c54e0[_0x4f68('0x2a')](_0x19630a)[_0x4f68('0xb')](function(_0x464833){if(_0x464833&&_0x464833[_0x4f68('0x2b')]){_0x15443f[_0x4f68('0x9')][_0x4f68('0x2c')]=_0x464833;var _0x291dbd=_0x464833[0x0];var _0x102c0b=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')]&&_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')][_0x4f68('0x2f')]?_0x291dbd[_0x4f68('0x2d')]['diagnosticInfo'][_0x4f68('0x2f')][_0x4f68('0x30')][_0x4f68('0x31')]:![];_0x15443f[_0x4f68('0x9')]['DIALOGFLOWV2_ACTION']=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x32')];_0x15443f[_0x4f68('0x9')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x291dbd[_0x4f68('0x2d')]['allRequiredParamsPresent'];_0x15443f[_0x4f68('0x9')][_0x4f68('0x33')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')]&&_0x291dbd[_0x4f68('0x2d')]['diagnosticInfo'][_0x4f68('0x2f')]?_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')][_0x4f68('0x2f')]['end_conversation']['boolValue']:![];_0x15443f[_0x4f68('0x9')][_0x4f68('0x34')]=_0x291dbd[_0x4f68('0x2d')]['intent'][_0x4f68('0x35')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x36')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x37')][_0x4f68('0x38')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x39')]=_0x291dbd['queryResult']['intent'][_0x4f68('0x3a')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3b')]=_0x291dbd[_0x4f68('0x2d')]['languageCode'];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3c')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x3d')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3e')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x3f')];_0x3d7e1a[_0x4f68('0x40')]=_0x4f68('0x2c');_0x3d7e1a[_0x4f68('0x41')]=JSON[_0x4f68('0xf')](_0x464833);var _0x58c48d=[];for(var _0x2ea873=0x0;_0x2ea873<_0x464833['length'];_0x2ea873++){var _0x378eff=_0x464833[_0x2ea873];if(_0x378eff&&_0x378eff[_0x4f68('0x2d')]&&_0x378eff[_0x4f68('0x2d')]['fulfillmentText']){_0x58c48d[_0x4f68('0x42')](createMessage(_0x492728,_0x2a513d,_0x3d7e1a,_0x378eff[_0x4f68('0x2d')][_0x4f68('0x43')]));}}return Promise[_0x4f68('0x44')](_0x58c48d)[_0x4f68('0xb')](function(){if(_0x102c0b){_0x486cd6[_0x4f68('0x45')]();}else{_0x486cd6[_0x4f68('0x25')]();}})[_0x4f68('0xd')](function(_0x5becf0){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x492728,JSON[_0x4f68('0xf')](_0x5becf0));_0x486cd6['next']();});}})[_0x4f68('0xd')](function(_0x2f39db){logger['error'](_0x4f68('0xc'),_0x492728,_0x2f39db['message']);_0x486cd6[_0x4f68('0x45')]();});}}catch(_0x31461e){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x492728,JSON[_0x4f68('0xf')](_0x31461e));_0x486cd6[_0x4f68('0x25')]();}};};
\ No newline at end of file
index 3638b09..2eab69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50dd=['length','error','[%s][GOTOIF]\x20%s','message','condition','priorityTrue','priorityFalse','info','next','findIndex','rules','stop','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x29e2a8,_0xea7708){var _0x13ee0f=function(_0x441ef7){while(--_0x441ef7){_0x29e2a8['push'](_0x29e2a8['shift']());}};_0x13ee0f(++_0xea7708);}(_0x50dd,0x94));var _0xd50d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50dd[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0xd50d('0x0'));var _=require(_0xd50d('0x1'));var htmlToText=require(_0xd50d('0x2'));var utils=require(_0xd50d('0x3'));var logger=require(_0xd50d('0x4'))(_0xd50d('0x5'));var gotoif=schema({'condition':{'type':_0xd50d('0x6'),'required':!![],'message':_0xd50d('0x7')},'priorityTrue':{'type':'number','message':_0xd50d('0x8')},'priorityFalse':{'type':_0xd50d('0x9'),'message':_0xd50d('0xa')}});exports[_0xd50d('0xb')]=function(_0x4e93d1,_0x52311e){return function(_0x1c570b){try{var _0x4575ab={'condition':htmlToText[_0xd50d('0xc')](utils[_0xd50d('0xd')](_0x52311e[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x52311e[0x1],'priorityFalse':_0x52311e[0x2]};var _0x2071d8=gotoif['validate'](_0x4575ab,{'typecast':!![]});if(_0x2071d8[_0xd50d('0xe')]){logger[_0xd50d('0xf')](_0xd50d('0x10'),_0x4e93d1,_['map'](_0x2071d8,_0xd50d('0x11'))['join'](',\x20'));_0x1c570b['stop']();}else{try{var _0x3a5810=eval('('+_0x4575ab[_0xd50d('0x12')]+')');var _0x1bf8e=_0x3a5810?_0x4575ab[_0xd50d('0x13')]:_0x4575ab[_0xd50d('0x14')];logger[_0xd50d('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4e93d1,_0x4575ab['condition'],_0x3a5810,_0x1bf8e||_0xd50d('0x16'));if(_0x1bf8e){var _0x3d384d=_[_0xd50d('0x17')](_0x1c570b[_0xd50d('0x18')](),{'p':_0x1bf8e});if(_0x3d384d>=0x0){logger[_0xd50d('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4e93d1,_0x1bf8e||'next',_0x3d384d);_0x1c570b[_0xd50d('0x16')](_0x3d384d);}else{logger[_0xd50d('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4e93d1,_0x1bf8e||_0xd50d('0x16'));_0x1c570b[_0xd50d('0x19')]();}}else{_0x1c570b[_0xd50d('0x16')]();}}catch(_0xafb7ac){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4e93d1,_0xafb7ac['message']);_0x1c570b[_0xd50d('0x19')]();}}}catch(_0x429716){logger[_0xd50d('0xf')](_0xd50d('0x10'),_0x4e93d1,JSON[_0xd50d('0x1a')](_0x429716));_0x1c570b['stop']();}};};
\ No newline at end of file
+var _0x9ac4=['number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','message','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ac4,0x1e8));var _0x49ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ac4[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x49ac('0x0'));var _=require('lodash');var htmlToText=require(_0x49ac('0x1'));var utils=require(_0x49ac('0x2'));var logger=require(_0x49ac('0x3'))(_0x49ac('0x4'));var gotoif=schema({'condition':{'type':_0x49ac('0x5'),'required':!![],'message':_0x49ac('0x6')},'priorityTrue':{'type':'number','message':_0x49ac('0x7')},'priorityFalse':{'type':_0x49ac('0x8'),'message':_0x49ac('0x9')}});exports[_0x49ac('0xa')]=function(_0x3a2e6e,_0x51242b){return function(_0xe3661e){try{var _0x5a184f={'condition':htmlToText[_0x49ac('0xb')](utils['getMustacheRender'](_0x51242b[0x0],this),{'wordwrap':![]})[_0x49ac('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x51242b[0x1],'priorityFalse':_0x51242b[0x2]};var _0x47a592=gotoif['validate'](_0x5a184f,{'typecast':!![]});if(_0x47a592[_0x49ac('0xd')]){logger['error'](_0x49ac('0xe'),_0x3a2e6e,_[_0x49ac('0xf')](_0x47a592,'message')[_0x49ac('0x10')](',\x20'));_0xe3661e[_0x49ac('0x11')]();}else{try{var _0x47538f=eval('('+_0x5a184f['condition']+')');var _0x389d07=_0x47538f?_0x5a184f[_0x49ac('0x12')]:_0x5a184f[_0x49ac('0x13')];logger['info'](_0x49ac('0x14'),_0x3a2e6e,_0x5a184f[_0x49ac('0x15')],_0x47538f,_0x389d07||_0x49ac('0x16'));if(_0x389d07){var _0x2597d2=_[_0x49ac('0x17')](_0xe3661e[_0x49ac('0x18')](),{'p':_0x389d07});if(_0x2597d2>=0x0){logger[_0x49ac('0x19')](_0x49ac('0x1a'),_0x3a2e6e,_0x389d07||_0x49ac('0x16'),_0x2597d2);_0xe3661e[_0x49ac('0x16')](_0x2597d2);}else{logger[_0x49ac('0x19')](_0x49ac('0x1b'),_0x3a2e6e,_0x389d07||_0x49ac('0x16'));_0xe3661e[_0x49ac('0x11')]();}}else{_0xe3661e['next']();}}catch(_0x40848e){logger[_0x49ac('0x1c')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3a2e6e,_0x40848e[_0x49ac('0x1d')]);_0xe3661e[_0x49ac('0x11')]();}}}catch(_0x5b76a3){logger[_0x49ac('0x1c')](_0x49ac('0xe'),_0x3a2e6e,JSON[_0x49ac('0x1e')](_0x5b76a3));_0xe3661e[_0x49ac('0x11')]();}};};
\ No newline at end of file
index 9e824a8..6d1841f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9362=['error','[%s][GOTOP]\x20%s','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length'];(function(_0x418603,_0x1cb409){var _0x1b9711=function(_0x5cd7f0){while(--_0x5cd7f0){_0x418603['push'](_0x418603['shift']());}};_0x1b9711(++_0x1cb409);}(_0x9362,0x162));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x2936('0x0'))(_0x2936('0x1'));var gotop=schema({'priority':{'type':_0x2936('0x2'),'required':!![],'message':_0x2936('0x3')}});exports[_0x2936('0x4')]=function(_0x5c2771,_0x11110f){return function(_0x4f399c){try{var _0x50d620={'priority':_0x11110f[0x0]};var _0x293814=gotop[_0x2936('0x5')](_0x50d620,{'typecast':!![]});if(_0x293814[_0x2936('0x6')]){logger[_0x2936('0x7')](_0x2936('0x8'),_0x5c2771,_['map'](_0x293814,'message')[_0x2936('0x9')](',\x20'));_0x4f399c[_0x2936('0xa')]();}else{logger[_0x2936('0xb')](_0x2936('0xc'),_0x5c2771,_0x50d620[_0x2936('0xd')]);if(_0x50d620[_0x2936('0xd')]){var _0x1e6cd4=_[_0x2936('0xe')](_0x4f399c[_0x2936('0xf')](),{'p':_0x50d620[_0x2936('0xd')]});if(_0x1e6cd4>=0x0){logger['info'](_0x2936('0x10'),_0x5c2771,_0x50d620['priority']||_0x2936('0x11'),_0x1e6cd4);_0x4f399c['next'](_0x1e6cd4);}else{logger[_0x2936('0xb')](_0x2936('0x12'),_0x5c2771,_0x50d620[_0x2936('0xd')]||_0x2936('0x11'));_0x4f399c[_0x2936('0xa')]();}}else{_0x4f399c[_0x2936('0x11')]();}}}catch(_0x24d5e6){logger[_0x2936('0x7')](_0x2936('0x8'),_0x5c2771,JSON['stringify'](_0x24d5e6));_0x4f399c['stop']();}};};
\ No newline at end of file
+var _0xba6a=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','validate','number','consequence','length','error','map'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xba6a,0x19e));var _0xaba6=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xba6a[_0x2283dc];return _0x16db90;};'use strict';var schema=require(_0xaba6('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xaba6('0x1'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xaba6('0x2')]=function(_0x2b7a57,_0xb9268b){return function(_0x52388e){try{var _0x518e15={'priority':_0xb9268b[0x0]};var _0x5606ce=gotop[_0xaba6('0x0')](_0x518e15,{'typecast':!![]});if(_0x5606ce[_0xaba6('0x3')]){logger[_0xaba6('0x4')]('[%s][GOTOP]\x20%s',_0x2b7a57,_[_0xaba6('0x5')](_0x5606ce,'message')['join'](',\x20'));_0x52388e[_0xaba6('0x6')]();}else{logger[_0xaba6('0x7')](_0xaba6('0x8'),_0x2b7a57,_0x518e15[_0xaba6('0x9')]);if(_0x518e15[_0xaba6('0x9')]){var _0x21c992=_[_0xaba6('0xa')](_0x52388e['rules'](),{'p':_0x518e15[_0xaba6('0x9')]});if(_0x21c992>=0x0){logger[_0xaba6('0x7')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2b7a57,_0x518e15[_0xaba6('0x9')]||'next',_0x21c992);_0x52388e[_0xaba6('0xb')](_0x21c992);}else{logger[_0xaba6('0x7')](_0xaba6('0xc'),_0x2b7a57,_0x518e15[_0xaba6('0x9')]||'next');_0x52388e['stop']();}}else{_0x52388e[_0xaba6('0xb')]();}}}catch(_0x193f27){logger[_0xaba6('0x4')](_0xaba6('0xd'),_0x2b7a57,JSON['stringify'](_0x193f27));_0x52388e[_0xaba6('0x6')]();}};};
\ No newline at end of file
index 19404bf..89ef8e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263f=['then','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','interaction','Message','create'];(function(_0x29ccc0,_0x259364){var _0x3fcaf0=function(_0x9c0ed4){while(--_0x9c0ed4){_0x29ccc0['push'](_0x29ccc0['shift']());}};_0x3fcaf0(++_0x259364);}(_0x263f,0x182));var _0xf263=function(_0x1e8dd5,_0x571f6d){_0x1e8dd5=_0x1e8dd5-0x0;var _0x9aa844=_0x263f[_0x1e8dd5];return _0x9aa844;};'use strict';var _=require(_0xf263('0x0'));var utils=require(_0xf263('0x1'));var logger=require(_0xf263('0x2'))(_0xf263('0x3'));var rpc={'chatMessage':require(_0xf263('0x4')),'openchannelMessage':require(_0xf263('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf263('0x6')),'faxMessage':require(_0xf263('0x7')),'whatsappMessage':require(_0xf263('0x8'))};exports['consequence']=function(_0xbd1369,_0xdb2fc1){return function(_0x4c7ab2){try{var _0x4fded6={'body':utils[_0xf263('0x9')](_0xdb2fc1[0x0],this),'ContactId':this[_0xf263('0xa')]['id']};if(this[_0xf263('0xb')]===_0xf263('0xc')){_0x4fded6['ChatWebsiteId']=this[_0xf263('0xd')]['id'];}else{_0x4fded6[_[_0xf263('0xe')](this[_0xf263('0xb')])+_0xf263('0xf')]=this[_0xf263('0xd')]['id'];}_0x4fded6[_[_0xf263('0xe')](this[_0xf263('0xb')])+'InteractionId']=this[_0xf263('0x10')]['id'];if(rpc[this['channel']+_0xf263('0x11')]){return rpc[this['channel']+'Message'][_0xf263('0x12')](_0x4fded6)[_0xf263('0x13')](function(_0x17471d){logger[_0xf263('0x14')](_0xf263('0x15'),_0xbd1369,_0x4fded6[_0xf263('0x16')]);_0x4c7ab2[_0xf263('0x17')]();})['catch'](function(_0x2f40d8){logger['error'](_0xf263('0x15'),_0xbd1369,JSON[_0xf263('0x18')](_0x2f40d8));_0x4c7ab2[_0xf263('0x19')]();});}}catch(_0x402739){logger[_0xf263('0x1a')](_0xf263('0x15'),_0xbd1369,JSON[_0xf263('0x18')](_0x402739));_0x4c7ab2['stop']();}};};
\ No newline at end of file
+var _0xcaee=['consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','AccountId','channel','InteractionId','interaction','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x5b7ed4,_0x1ef9ab){var _0x3ae1ab=function(_0xa27b5c){while(--_0xa27b5c){_0x5b7ed4['push'](_0x5b7ed4['shift']());}};_0x3ae1ab(++_0x1ef9ab);}(_0xcaee,0x1b8));var _0xecae=function(_0x38d45b,_0x54c034){_0x38d45b=_0x38d45b-0x0;var _0x112c3d=_0xcaee[_0x38d45b];return _0x112c3d;};'use strict';var _=require(_0xecae('0x0'));var utils=require(_0xecae('0x1'));var logger=require(_0xecae('0x2'))(_0xecae('0x3'));var rpc={'chatMessage':require(_0xecae('0x4')),'openchannelMessage':require(_0xecae('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xecae('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xecae('0x7'))};exports[_0xecae('0x8')]=function(_0x56fd39,_0x12d873){return function(_0xcf2ac9){try{var _0x1c2193={'body':utils[_0xecae('0x9')](_0x12d873[0x0],this),'ContactId':this[_0xecae('0xa')]['id']};if(this['channel']===_0xecae('0xb')){_0x1c2193[_0xecae('0xc')]=this[_0xecae('0xd')]['id'];}else{_0x1c2193[_[_0xecae('0xe')](this['channel'])+_0xecae('0xf')]=this[_0xecae('0xd')]['id'];}_0x1c2193[_[_0xecae('0xe')](this[_0xecae('0x10')])+_0xecae('0x11')]=this[_0xecae('0x12')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xecae('0x10')]+'Message']['create'](_0x1c2193)[_0xecae('0x13')](function(_0x3ab440){logger[_0xecae('0x14')](_0xecae('0x15'),_0x56fd39,_0x1c2193[_0xecae('0x16')]);_0xcf2ac9[_0xecae('0x17')]();})[_0xecae('0x18')](function(_0x55424d){logger[_0xecae('0x19')]('[%s][MESSAGE]\x20%s',_0x56fd39,JSON[_0xecae('0x1a')](_0x55424d));_0xcf2ac9[_0xecae('0x1b')]();});}}catch(_0x173ea8){logger[_0xecae('0x19')](_0xecae('0x15'),_0x56fd39,JSON[_0xecae('0x1a')](_0x173ea8));_0xcf2ac9[_0xecae('0x1b')]();}};};
\ No newline at end of file
index 821470a..58222f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a6=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','../../../../config/logger','routing','info'];(function(_0x23ac6d,_0x4145e8){var _0x1547cb=function(_0x2cef6b){while(--_0x2cef6b){_0x23ac6d['push'](_0x23ac6d['shift']());}};_0x1547cb(++_0x4145e8);}(_0x98a6,0x84));var _0x698a=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x98a6[_0x20c9b2];return _0x2c6030;};'use strict';var utils=require('./utils');var logger=require(_0x698a('0x0'))(_0x698a('0x1'));exports['consequence']=function(_0x25a526,_0x19b19d){return function(_0x17f609){try{logger[_0x698a('0x2')](_0x698a('0x3'),_0x25a526,utils[_0x698a('0x4')](_0x19b19d[0x0],this));_0x17f609[_0x698a('0x5')]();}catch(_0x4efe79){logger[_0x698a('0x6')]('[%s][NOOP]\x20%s',_0x25a526,JSON[_0x698a('0x7')](_0x4efe79));_0x17f609[_0x698a('0x8')]();}};};
\ No newline at end of file
+var _0xfcfa=['next','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x4db6d0,_0x31b63d){var _0x17c1fd=function(_0x5d22bf){while(--_0x5d22bf){_0x4db6d0['push'](_0x4db6d0['shift']());}};_0x17c1fd(++_0x31b63d);}(_0xfcfa,0x14b));var _0xafcf=function(_0x3701a2,_0x1ea7aa){_0x3701a2=_0x3701a2-0x0;var _0x23ca69=_0xfcfa[_0x3701a2];return _0x23ca69;};'use strict';var utils=require(_0xafcf('0x0'));var logger=require(_0xafcf('0x1'))(_0xafcf('0x2'));exports[_0xafcf('0x3')]=function(_0x160e49,_0x5a7f0c){return function(_0x12196c){try{logger['info'](_0xafcf('0x4'),_0x160e49,utils['getMustacheRender'](_0x5a7f0c[0x0],this));_0x12196c[_0xafcf('0x5')]();}catch(_0x444ad2){logger['error'](_0xafcf('0x4'),_0x160e49,JSON['stringify'](_0x444ad2));_0x12196c[_0xafcf('0x6')]();}};};
\ No newline at end of file
index d2d624e..4d4eb5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0a5=['WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','Queues','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','lodash','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId'];(function(_0x36642e,_0x1bc747){var _0x587e08=function(_0x356c04){while(--_0x356c04){_0x36642e['push'](_0x36642e['shift']());}};_0x587e08(++_0x1bc747);}(_0xf0a5,0x139));var _0x5f0a=function(_0x7a932b,_0x4b1bd9){_0x7a932b=_0x7a932b-0x0;var _0x30baff=_0xf0a5[_0x7a932b];return _0x30baff;};'use strict';var schema=require('validate');var _=require(_0x5f0a('0x0'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x5f0a('0x1'))('routing');var strategy=require('./strategy');config[_0x5f0a('0x2')]=_[_0x5f0a('0x3')](config['redis'],{'host':_0x5f0a('0x4'),'port':0x18eb});var io=require(_0x5f0a('0x5'))(new Redis(config['redis']));var attributes=['id',_0x5f0a('0x6'),_0x5f0a('0x7'),_0x5f0a('0x8'),_0x5f0a('0x9'),'joinAt'];function emit(_0xe581e6,_0x518baa,_0x3a27){io['to'](_0xe581e6)[_0x5f0a('0xa')](_0x518baa,_0x3a27);}function emitChannelQueueInteraction(_0x2a9929,_0x29a783,_0x445c68,_0x42255f,_0x5e51b3,_0x310d34,_0x33b9b9,_0x5b91b3){var _0x598137=_[_0x5f0a('0xb')](_0x445c68);_0x598137[_0x5f0a('0x6')]=_0x5b91b3;_0x598137[_0x5f0a('0x8')]=_0x29a783;_0x598137[_0x5f0a('0x7')]=_0x42255f;_0x598137['id']=_0x5e51b3;if(_0x310d34){_0x33b9b9[util[_0x5f0a('0xc')](_0x5f0a('0xd'),_0x2a9929)][_0x5e51b3]=_[_0x5f0a('0xe')](_0x598137,attributes);}else{delete _0x33b9b9[util[_0x5f0a('0xc')]('%sQueuesWaitingInteractions',_0x2a9929)][_0x5e51b3];}emit(util[_0x5f0a('0xc')](_0x5f0a('0xf'),_0x2a9929,_0x29a783),util[_0x5f0a('0xc')](_0x5f0a('0x10'),_0x2a9929,_0x310d34?_0x5f0a('0x11'):_0x5f0a('0x12')),_[_0x5f0a('0xe')](_0x598137,attributes));}var rpc={'openchannelQueueReport':require(_0x5f0a('0x13')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x5f0a('0x14')),'faxQueueReport':require(_0x5f0a('0x15')),'whatsappQueueReport':require(_0x5f0a('0x16'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x5f0a('0x17')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xc9fff0,_0x44cd4b,_0x2efafd,_0x17c719){if(_0xc9fff0&&_0x44cd4b&&_0x2efafd){_0x44cd4b[_0x5f0a('0x18')]+=0x1;var _0x2e4dbf={'uniqueid':_0xc9fff0,'from':_0x2efafd[_0x5f0a('0x19')]?_0x2efafd['body']['from']:'','joinAt':moment()[_0x5f0a('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2efafd[_0x5f0a('0x1a')]?_0x2efafd[_0x5f0a('0x1a')]['id']:null,'ListId':_0x2efafd[_0x5f0a('0x1b')]?_0x2efafd[_0x5f0a('0x1b')]['id']:null};_0x2e4dbf[_['upperFirst'](_0x2efafd[_0x5f0a('0x1c')])+_0x5f0a('0x1d')]=_0x44cd4b['id']||null;_0x2e4dbf[_[_0x5f0a('0x1e')](_0x2efafd[_0x5f0a('0x1c')])+_0x5f0a('0x1f')]=_0x2efafd['interaction']?_0x2efafd[_0x5f0a('0x20')]['id']:null;_0x2e4dbf[_['upperFirst'](_0x2efafd[_0x5f0a('0x1c')])+_0x5f0a('0x21')]=_0x2efafd[_0x5f0a('0x22')]?_0x2efafd[_0x5f0a('0x22')]['id']:null;_0x2e4dbf[_[_0x5f0a('0x1e')](_0x2efafd['channel'])+(_0x2efafd['channel']!==_0x5f0a('0x23')?_0x5f0a('0x24'):_0x5f0a('0x25'))]=_0x2efafd[_0x5f0a('0x7')]?_0x2efafd[_0x5f0a('0x7')]['id']:null;logger[_0x5f0a('0x26')](util[_0x5f0a('0xc')]('[%s][START:QUEUE][NAME:%s]',_0xc9fff0,_0x44cd4b[_0x5f0a('0x27')]));emitChannelQueueInteraction(_0x2efafd[_0x5f0a('0x1c')],_0x44cd4b[_0x5f0a('0x27')],_0x2e4dbf,_0x2efafd[_0x5f0a('0x7')][_0x5f0a('0x27')],_0x2efafd['message']['id'],!![],_0x17c719,_0x44cd4b['id']);if(rpc[_0x2efafd['channel']+'QueueReport']){return rpc[_0x2efafd['channel']+_0x5f0a('0x28')][_0x5f0a('0x29')](_0x2e4dbf)[_0x5f0a('0x2a')](function(_0xf47566){logger[_0x5f0a('0x2b')](_0x5f0a('0x2c'));});}}}function stopRouting(_0x16ee03,_0x3ec5e5,_0xb3d448,_0x53088d){if(_0x16ee03&&_0x3ec5e5){_0x3ec5e5[_0x5f0a('0x18')]-=0x1;var _0x48c18a={'leaveAt':moment()[_0x5f0a('0xc')](_0x5f0a('0x2d')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x5f0a('0x26')](util[_0x5f0a('0xc')](_0x5f0a('0x2e'),_0x16ee03,_0x3ec5e5['name']));emitChannelQueueInteraction(_0xb3d448[_0x5f0a('0x1c')],_0x3ec5e5[_0x5f0a('0x27')],_0xb3d448[_0x5f0a('0x19')],_0xb3d448[_0x5f0a('0x7')]['name'],_0xb3d448[_0x5f0a('0x22')]['id'],![],_0x53088d,_0x3ec5e5['id']);if(rpc[_0xb3d448['channel']+'QueueReport']){return rpc[_0xb3d448[_0x5f0a('0x1c')]+_0x5f0a('0x28')][_0x5f0a('0x2f')](_0x16ee03,_0x48c18a)[_0x5f0a('0x2a')](function(_0x185cfb){logger[_0x5f0a('0x2b')](_0x5f0a('0x30'));});}}}function endRouting(_0x12803c,_0x29f9d7,_0x3e3736,_0x405320){if(_0x12803c&&_0x29f9d7){_0x29f9d7[_0x5f0a('0x18')]-=0x1;var _0x25023f={'leaveAt':moment()[_0x5f0a('0xc')](_0x5f0a('0x2d')),'exitAt':moment()[_0x5f0a('0xc')](_0x5f0a('0x2d')),'reason':_0x5f0a('0x31')};logger[_0x5f0a('0x26')](util['format'](_0x5f0a('0x32'),_0x12803c,_0x29f9d7[_0x5f0a('0x27')]));emitChannelQueueInteraction(_0x3e3736[_0x5f0a('0x1c')],_0x29f9d7['name'],_0x3e3736[_0x5f0a('0x19')],_0x3e3736['account']['name'],_0x3e3736[_0x5f0a('0x22')]['id'],![],_0x405320);if(rpc[_0x3e3736['channel']+_0x5f0a('0x28')]){return rpc[_0x3e3736[_0x5f0a('0x1c')]+_0x5f0a('0x28')][_0x5f0a('0x2f')](_0x12803c,_0x25023f)[_0x5f0a('0x2a')](function(_0x554bf5){logger[_0x5f0a('0x2b')](_0x5f0a('0x30'));});}}}function handleFindQueue(_0xa48c7a){return function(_0x51610b){return _0x51610b[_0x5f0a('0x27')][_0x5f0a('0x33')]()===_0xa48c7a[_0x5f0a('0x33')]();};}exports[_0x5f0a('0x34')]=function(_0x3d0ac4,_0x8494e7,_0x57d787,_0xb4de49){return function(_0x5c0f23){try{var _0x17d601={'name':_0x8494e7[0x0],'timeout':_0x8494e7[0x1]};var _0x3ba855=queue[_0x5f0a('0x35')](_0x17d601,{'typecast':!![]});if(_0x3ba855[_0x5f0a('0x36')]){logger[_0x5f0a('0x2b')](_0x5f0a('0x37'),_0x3d0ac4,_[_0x5f0a('0x38')](_0x3ba855,'message')['join'](',\x20'));_0x5c0f23['stop']();}else{var _0x49f6f5=_['find'](_0x57d787[_0xb4de49['channel']+_0x5f0a('0x39')],handleFindQueue(_0x17d601[_0x5f0a('0x27')]));if(_0x49f6f5){startRouting(_0x3d0ac4,_0x49f6f5,_0xb4de49,_0x57d787);var _0x2e0ffd=(_0x49f6f5[_0x5f0a('0x31')]||0xa)*0x3e8;var _0x5c4538=(_0x17d601[_0x5f0a('0x31')]||0x14)*0x3e8;var _0x11c1f2,_0x116425;if(_0x2e0ffd>_0x5c4538){_0x5c4538=_0x2e0ffd;}var _0x64d7a=seqqueue[_0x5f0a('0x3a')](_0x2e0ffd);_0x64d7a['id']=_0x3d0ac4;_0x64d7a[_0x5f0a('0x3b')]=_0x2e0ffd;_0x64d7a['qtimeout']=_0x5c4538;_0x64d7a['channel']=_0xb4de49['channel'];_0x57d787[_0x5f0a('0x3c')][_0x3d0ac4]['on'](_0x5f0a('0x3d'),function(){logger[_0x5f0a('0x26')](_0x5f0a('0x3e'),_0x3d0ac4);stopRouting(_0x3d0ac4,_0x49f6f5,_0xb4de49,_0x57d787);clearTimeout(_0x11c1f2);_0x11c1f2=undefined;_0x64d7a[_0x5f0a('0x3f')](!![]);if(_0x57d787[_0x5f0a('0x3c')][_0x3d0ac4]){delete _0x57d787['rules'][_0x3d0ac4];}_0x5c0f23[_0x5f0a('0x40')]();});_0x57d787[_0x5f0a('0x3c')][_0x3d0ac4]['on'](_0x5f0a('0x41'),function(){if(_0x57d787[_0x5f0a('0x3c')][_0x3d0ac4]){delete _0x57d787['rules'][_0x3d0ac4];}});_0x11c1f2=setTimeout(function(){logger['info'](_0x5f0a('0x42'),_0x3d0ac4);endRouting(_0x3d0ac4,_0x49f6f5,_0xb4de49,_0x57d787);clearTimeout(_0x11c1f2);_0x64d7a['close'](!![]);_0x5c0f23['next']();},_0x5c4538);switch(_0x49f6f5[_0x5f0a('0x43')]){case _0x5f0a('0x44'):strategy['rrmemory'](_0x64d7a,_0x49f6f5,_0x57d787,_0xb4de49);break;default:strategy[_0x5f0a('0x45')](_0x64d7a,_0x49f6f5,_0x57d787,_0xb4de49);}}else{logger[_0x5f0a('0x2b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3d0ac4,_0x17d601[_0x5f0a('0x27')]);_0x5c0f23[_0x5f0a('0x40')]();}}}catch(_0x140768){console['log'](_0x140768);logger['error'](_0x5f0a('0x37'),_0x3d0ac4,_0x140768['stack']);_0x5c0f23[_0x5f0a('0x40')]();}};};
\ No newline at end of file
+var _0x5a3c=['Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','format','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','map','join','stop','find'];(function(_0x424ec9,_0x3d9134){var _0xeb690c=function(_0x2bf5c1){while(--_0x2bf5c1){_0x424ec9['push'](_0x424ec9['shift']());}};_0xeb690c(++_0x3d9134);}(_0x5a3c,0x1b4));var _0xc5a3=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x5a3c[_0x487b0c];return _0x1adbdc;};'use strict';var schema=require('validate');var _=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));var seqqueue=require(_0xc5a3('0x2'));var moment=require(_0xc5a3('0x3'));var Redis=require(_0xc5a3('0x4'));var config=require(_0xc5a3('0x5'));var logger=require(_0xc5a3('0x6'))(_0xc5a3('0x7'));var strategy=require(_0xc5a3('0x8'));config[_0xc5a3('0x9')]=_[_0xc5a3('0xa')](config[_0xc5a3('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xc5a3('0xb'))(new Redis(config[_0xc5a3('0x9')]));var attributes=['id',_0xc5a3('0xc'),_0xc5a3('0xd'),_0xc5a3('0xe'),_0xc5a3('0xf'),_0xc5a3('0x10')];function emit(_0x31cba4,_0x835e4a,_0x3d3b9b){io['to'](_0x31cba4)[_0xc5a3('0x11')](_0x835e4a,_0x3d3b9b);}function emitChannelQueueInteraction(_0x5a1748,_0x408740,_0x1f5ac9,_0x4f74b7,_0x2921b4,_0x322efd,_0x3f0709,_0xaa71a9){var _0x1191e6=_[_0xc5a3('0x12')](_0x1f5ac9);_0x1191e6['queue_id']=_0xaa71a9;_0x1191e6[_0xc5a3('0xe')]=_0x408740;_0x1191e6[_0xc5a3('0xd')]=_0x4f74b7;_0x1191e6['id']=_0x2921b4;if(_0x322efd){_0x3f0709[util['format'](_0xc5a3('0x13'),_0x5a1748)][_0x2921b4]=_['pick'](_0x1191e6,attributes);}else{delete _0x3f0709[util[_0xc5a3('0x14')](_0xc5a3('0x13'),_0x5a1748)][_0x2921b4];}emit(util['format'](_0xc5a3('0x15'),_0x5a1748,_0x408740),util[_0xc5a3('0x14')]('%s_queue_waiting_interaction:%s',_0x5a1748,_0x322efd?_0xc5a3('0x16'):_0xc5a3('0x17')),_[_0xc5a3('0x18')](_0x1191e6,attributes));}var rpc={'openchannelQueueReport':require(_0xc5a3('0x19')),'mailQueueReport':require(_0xc5a3('0x1a')),'chatQueueReport':require(_0xc5a3('0x1b')),'smsQueueReport':require(_0xc5a3('0x1c')),'faxQueueReport':require(_0xc5a3('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xc5a3('0x1e'),'required':!![],'message':_0xc5a3('0x1f')},'timeout':{'type':_0xc5a3('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x196b0a,_0x463219,_0x1072be,_0x4a969d){if(_0x196b0a&&_0x463219&&_0x1072be){_0x463219[_0xc5a3('0x21')]+=0x1;var _0xdba561={'uniqueid':_0x196b0a,'from':_0x1072be['body']?_0x1072be[_0xc5a3('0x22')][_0xc5a3('0xf')]:'','joinAt':moment()[_0xc5a3('0x14')](_0xc5a3('0x23')),'ContactId':_0x1072be[_0xc5a3('0x24')]?_0x1072be[_0xc5a3('0x24')]['id']:null,'ListId':_0x1072be[_0xc5a3('0x25')]?_0x1072be[_0xc5a3('0x25')]['id']:null};_0xdba561[_[_0xc5a3('0x26')](_0x1072be[_0xc5a3('0x27')])+_0xc5a3('0x28')]=_0x463219['id']||null;_0xdba561[_['upperFirst'](_0x1072be['channel'])+_0xc5a3('0x29')]=_0x1072be[_0xc5a3('0x2a')]?_0x1072be[_0xc5a3('0x2a')]['id']:null;_0xdba561[_[_0xc5a3('0x26')](_0x1072be[_0xc5a3('0x27')])+_0xc5a3('0x2b')]=_0x1072be[_0xc5a3('0x2c')]?_0x1072be[_0xc5a3('0x2c')]['id']:null;_0xdba561[_['upperFirst'](_0x1072be[_0xc5a3('0x27')])+(_0x1072be[_0xc5a3('0x27')]!=='chat'?_0xc5a3('0x2d'):_0xc5a3('0x2e'))]=_0x1072be[_0xc5a3('0xd')]?_0x1072be[_0xc5a3('0xd')]['id']:null;logger[_0xc5a3('0x2f')](util[_0xc5a3('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x196b0a,_0x463219['name']));emitChannelQueueInteraction(_0x1072be[_0xc5a3('0x27')],_0x463219[_0xc5a3('0x30')],_0xdba561,_0x1072be[_0xc5a3('0xd')][_0xc5a3('0x30')],_0x1072be[_0xc5a3('0x2c')]['id'],!![],_0x4a969d,_0x463219['id']);if(rpc[_0x1072be['channel']+_0xc5a3('0x31')]){return rpc[_0x1072be[_0xc5a3('0x27')]+_0xc5a3('0x31')][_0xc5a3('0x32')](_0xdba561)[_0xc5a3('0x33')](function(_0x34a717){logger[_0xc5a3('0x34')](_0xc5a3('0x35'));});}}}function stopRouting(_0x2db9e7,_0x1e3245,_0x2cdab4,_0x50ea21){if(_0x2db9e7&&_0x1e3245){_0x1e3245[_0xc5a3('0x21')]-=0x1;var _0xc66daf={'leaveAt':moment()[_0xc5a3('0x14')](_0xc5a3('0x23')),'acceptAt':moment()[_0xc5a3('0x14')](_0xc5a3('0x23')),'reason':_0xc5a3('0x36')};logger[_0xc5a3('0x2f')](util[_0xc5a3('0x14')](_0xc5a3('0x37'),_0x2db9e7,_0x1e3245[_0xc5a3('0x30')]));emitChannelQueueInteraction(_0x2cdab4[_0xc5a3('0x27')],_0x1e3245['name'],_0x2cdab4[_0xc5a3('0x22')],_0x2cdab4[_0xc5a3('0xd')][_0xc5a3('0x30')],_0x2cdab4[_0xc5a3('0x2c')]['id'],![],_0x50ea21,_0x1e3245['id']);if(rpc[_0x2cdab4[_0xc5a3('0x27')]+_0xc5a3('0x31')]){return rpc[_0x2cdab4[_0xc5a3('0x27')]+'QueueReport'][_0xc5a3('0x38')](_0x2db9e7,_0xc66daf)[_0xc5a3('0x33')](function(_0x5af2ef){logger[_0xc5a3('0x34')](_0xc5a3('0x39'));});}}}function endRouting(_0x35769f,_0x27df60,_0x2d0be5,_0x4d5524){if(_0x35769f&&_0x27df60){_0x27df60[_0xc5a3('0x21')]-=0x1;var _0x467a7f={'leaveAt':moment()['format'](_0xc5a3('0x23')),'exitAt':moment()[_0xc5a3('0x14')](_0xc5a3('0x23')),'reason':_0xc5a3('0x3a')};logger['info'](util['format'](_0xc5a3('0x3b'),_0x35769f,_0x27df60[_0xc5a3('0x30')]));emitChannelQueueInteraction(_0x2d0be5[_0xc5a3('0x27')],_0x27df60['name'],_0x2d0be5[_0xc5a3('0x22')],_0x2d0be5[_0xc5a3('0xd')][_0xc5a3('0x30')],_0x2d0be5[_0xc5a3('0x2c')]['id'],![],_0x4d5524);if(rpc[_0x2d0be5['channel']+_0xc5a3('0x31')]){return rpc[_0x2d0be5[_0xc5a3('0x27')]+'QueueReport'][_0xc5a3('0x38')](_0x35769f,_0x467a7f)[_0xc5a3('0x33')](function(_0x2afb24){logger[_0xc5a3('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x460e11){return function(_0x497462){return _0x497462['name']['toLowerCase']()===_0x460e11[_0xc5a3('0x3c')]();};}exports[_0xc5a3('0x3d')]=function(_0x4805b2,_0x4a0851,_0x13baff,_0x53c6cf){return function(_0x47977d){try{var _0x54caf4={'name':_0x4a0851[0x0],'timeout':_0x4a0851[0x1]};var _0xac9179=queue[_0xc5a3('0x3e')](_0x54caf4,{'typecast':!![]});if(_0xac9179['length']){logger[_0xc5a3('0x34')](_0xc5a3('0x3f'),_0x4805b2,_[_0xc5a3('0x40')](_0xac9179,_0xc5a3('0x2c'))[_0xc5a3('0x41')](',\x20'));_0x47977d[_0xc5a3('0x42')]();}else{var _0x38a74b=_[_0xc5a3('0x43')](_0x13baff[_0x53c6cf[_0xc5a3('0x27')]+_0xc5a3('0x44')],handleFindQueue(_0x54caf4[_0xc5a3('0x30')]));if(_0x38a74b){startRouting(_0x4805b2,_0x38a74b,_0x53c6cf,_0x13baff);var _0x27bc5d=(_0x38a74b[_0xc5a3('0x3a')]||0xa)*0x3e8;var _0x4938bf=(_0x54caf4[_0xc5a3('0x3a')]||0x14)*0x3e8;var _0x1b1d1a,_0x555f4c;if(_0x27bc5d>_0x4938bf){_0x4938bf=_0x27bc5d;}var _0x42244e=seqqueue[_0xc5a3('0x45')](_0x27bc5d);_0x42244e['id']=_0x4805b2;_0x42244e[_0xc5a3('0x46')]=_0x27bc5d;_0x42244e[_0xc5a3('0x47')]=_0x4938bf;_0x42244e['channel']=_0x53c6cf[_0xc5a3('0x27')];_0x13baff['rules'][_0x4805b2]['on'](_0xc5a3('0x48'),function(){logger[_0xc5a3('0x2f')](_0xc5a3('0x49'),_0x4805b2);stopRouting(_0x4805b2,_0x38a74b,_0x53c6cf,_0x13baff);clearTimeout(_0x1b1d1a);_0x1b1d1a=undefined;_0x42244e[_0xc5a3('0x4a')](!![]);if(_0x13baff['rules'][_0x4805b2]){delete _0x13baff[_0xc5a3('0x4b')][_0x4805b2];}_0x47977d[_0xc5a3('0x42')]();});_0x13baff['rules'][_0x4805b2]['on'](_0xc5a3('0x4c'),function(){if(_0x13baff[_0xc5a3('0x4b')][_0x4805b2]){delete _0x13baff[_0xc5a3('0x4b')][_0x4805b2];}});_0x1b1d1a=setTimeout(function(){logger[_0xc5a3('0x2f')](_0xc5a3('0x4d'),_0x4805b2);endRouting(_0x4805b2,_0x38a74b,_0x53c6cf,_0x13baff);clearTimeout(_0x1b1d1a);_0x42244e['close'](!![]);_0x47977d['next']();},_0x4938bf);switch(_0x38a74b[_0xc5a3('0x4e')]){case _0xc5a3('0x4f'):strategy[_0xc5a3('0x4f')](_0x42244e,_0x38a74b,_0x13baff,_0x53c6cf);break;default:strategy[_0xc5a3('0x50')](_0x42244e,_0x38a74b,_0x13baff,_0x53c6cf);}}else{logger['error'](_0xc5a3('0x51'),_0x4805b2,_0x54caf4[_0xc5a3('0x30')]);_0x47977d['stop']();}}}catch(_0x21d75d){console[_0xc5a3('0x52')](_0x21d75d);logger['error'](_0xc5a3('0x3f'),_0x4805b2,_0x21d75d[_0xc5a3('0x53')]);_0x47977d[_0xc5a3('0x42')]();}};};
\ No newline at end of file
index 884b179..6b55070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e0=['[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','TIMEOUT','exports','uuid','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','agents','showNotification','RINGING',':FORCED','info'];(function(_0x205ddd,_0x4c1d18){var _0xecf751=function(_0x527d13){while(--_0x527d13){_0x205ddd['push'](_0x205ddd['shift']());}};_0xecf751(++_0x4c1d18);}(_0x94e0,0x9f));var _0x094e=function(_0x20e13b,_0x3f7cd9){_0x20e13b=_0x20e13b-0x0;var _0x44d9d3=_0x94e0[_0x20e13b];return _0x44d9d3;};'use strict';var _=require('lodash');var uuid=require(_0x094e('0x0'));var util=require('./util');var logger=require(_0x094e('0x1'))('routing');var Agent=function(_0x4f6d30,_0x5b497d,_0x44b226,_0x570dd1){this[_0x094e('0x2')]=uuid['v4']();this[_0x094e('0x3')]=_0x4f6d30;this[_0x094e('0x4')]=_0x5b497d;this[_0x094e('0x5')]=_0x44b226;this[_0x094e('0x6')]=_0x570dd1;this[_0x094e('0x3')][_0x094e('0x7')](this[_0x094e('0x8')][_0x094e('0x9')](this),this[_0x094e('0xa')][_0x094e('0x9')](this));this[_0x094e('0x3')]['on'](_0x094e('0xb'),this[_0x094e('0xa')]['bind'](this));this[_0x094e('0x3')]['on'](_0x094e('0xc'),this[_0x094e('0xd')][_0x094e('0x9')](this));};Agent['prototype'][_0x094e('0x7')]=function(){this['squeue'][_0x094e('0x7')](this[_0x094e('0x8')][_0x094e('0x9')](this),this[_0x094e('0xa')][_0x094e('0x9')](this));};Agent[_0x094e('0xe')][_0x094e('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x094e('0xe')][_0x094e('0x8')]=function(_0x3b34f4){logger['info'](_0x094e('0xf'),this[_0x094e('0x3')]['id'],this[_0x094e('0x4')]['id']);if(_[_0x094e('0x10')](this[_0x094e('0x5')]['agents'][this[_0x094e('0x4')]['id']])){logger['info'](_0x094e('0x11'),this[_0x094e('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x094e('0x7')][_0x094e('0x9')](this),0x3e8);}else{if(this[_0x094e('0x6')][_0x094e('0x12')]||util[_0x094e('0x13')](this[_0x094e('0x3')]['id'],this[_0x094e('0x5')]['agents'][this['agent']['id']],this['squeue'][_0x094e('0x14')],![])){this[_0x094e('0x5')]['agents'][this[_0x094e('0x4')]['id']][_0x094e('0x15')]=!![];this[_0x094e('0x5')][_0x094e('0x16')][this[_0x094e('0x4')]['id']]['busyQueue']=undefined;util[_0x094e('0x17')](this[_0x094e('0x2')],this[_0x094e('0x3')]['id'],this[_0x094e('0x5')][_0x094e('0x16')][this[_0x094e('0x4')]['id']],null,this[_0x094e('0x6')]);util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this[_0x094e('0x4')]['id']],_0x094e('0x18')+(this[_0x094e('0x6')][_0x094e('0x12')]?_0x094e('0x19'):''));}else{logger[_0x094e('0x1a')](_0x094e('0x1b'),this['squeue']['id'],this[_0x094e('0x4')]['id']);setTimeout(this[_0x094e('0x7')][_0x094e('0x9')](this),0x3e8);}}};Agent[_0x094e('0xe')][_0x094e('0xa')]=function(_0x5a7ac8){if(_[_0x094e('0x10')](this[_0x094e('0x5')][_0x094e('0x16')][this[_0x094e('0x4')]['id']])){return logger[_0x094e('0x1a')](_0x094e('0x11'),this[_0x094e('0x3')]['id'],this[_0x094e('0x4')]['id']);}else{logger[_0x094e('0x1a')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x094e('0x4')]['id']);util[_0x094e('0x1c')](this[_0x094e('0x2')],this['squeue']['id'],this[_0x094e('0x5')][_0x094e('0x16')][this[_0x094e('0x4')]['id']],null,this[_0x094e('0x6')]);this[_0x094e('0x5')][_0x094e('0x16')][this[_0x094e('0x4')]['id']][_0x094e('0x15')]=![];this['realtime']['agents'][this['agent']['id']]['busyQueue']=undefined;util['writeLog'](this[_0x094e('0x3')]['id'],this[_0x094e('0x5')]['agents'][this[_0x094e('0x4')]['id']],_0x5a7ac8?'STOP':_0x094e('0x1d'));}if(!_0x5a7ac8){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x236ef1,_0x272415,_0x3f03e7,_0x1772f3){return new Agent(_0x236ef1,_0x272415,_0x3f03e7,_0x1772f3);}module[_0x094e('0x1e')]=agent;
\ No newline at end of file
+var _0x5770=[':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','exports','lodash','uuid','notificationId','squeue','agent','routing','bind','timeout','handleTimeout','drained','prototype','push','handleDrained','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','forcedOwnership','channel','busyQueue','showNotification','writeLog'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x5770,0x11e));var _0x0577=function(_0x3ca1f8,_0x4afa33){_0x3ca1f8=_0x3ca1f8-0x0;var _0x94fb6b=_0x5770[_0x3ca1f8];return _0x94fb6b;};'use strict';var _=require(_0x0577('0x0'));var uuid=require(_0x0577('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x19b570,_0x3d200b,_0x5e69fe,_0x403f5d){this[_0x0577('0x2')]=uuid['v4']();this[_0x0577('0x3')]=_0x19b570;this[_0x0577('0x4')]=_0x3d200b;this['realtime']=_0x5e69fe;this[_0x0577('0x5')]=_0x403f5d;this['squeue']['push'](this['handleRun'][_0x0577('0x6')](this),this['handleTimeout'][_0x0577('0x6')](this));this[_0x0577('0x3')]['on'](_0x0577('0x7'),this[_0x0577('0x8')][_0x0577('0x6')](this));this[_0x0577('0x3')]['on'](_0x0577('0x9'),this['handleDrained'][_0x0577('0x6')](this));};Agent[_0x0577('0xa')][_0x0577('0xb')]=function(){this[_0x0577('0x3')][_0x0577('0xb')](this['handleRun'][_0x0577('0x6')](this),this[_0x0577('0x8')][_0x0577('0x6')](this));};Agent['prototype'][_0x0577('0xc')]=function(){this[_0x0577('0x8')](!![]);};Agent[_0x0577('0xa')][_0x0577('0xd')]=function(_0x58e229){logger[_0x0577('0xe')](_0x0577('0xf'),this['squeue']['id'],this[_0x0577('0x4')]['id']);if(_[_0x0577('0x10')](this[_0x0577('0x11')][_0x0577('0x12')][this['agent']['id']])){logger[_0x0577('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x0577('0x3')]['id'],this[_0x0577('0x4')]['id']);setTimeout(this['push'][_0x0577('0x6')](this),0x3e8);}else{if(this['routing'][_0x0577('0x13')]||util['isAgentAvailable'](this[_0x0577('0x3')]['id'],this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']],this['squeue'][_0x0577('0x14')],![])){this[_0x0577('0x11')][_0x0577('0x12')][this['agent']['id']]['busy']=!![];this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']][_0x0577('0x15')]=undefined;util[_0x0577('0x16')](this[_0x0577('0x2')],this[_0x0577('0x3')]['id'],this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']],null,this[_0x0577('0x5')]);util[_0x0577('0x17')](this[_0x0577('0x3')]['id'],this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']],'RINGING'+(this['routing']['forcedOwnership']?_0x0577('0x18'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x0577('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x1a1b67){if(_['isNil'](this['realtime'][_0x0577('0x12')][this[_0x0577('0x4')]['id']])){return logger['info'](_0x0577('0x19'),this[_0x0577('0x3')]['id'],this['agent']['id']);}else{logger[_0x0577('0xe')](_0x0577('0x1a'),this[_0x0577('0x3')]['id'],this[_0x0577('0x4')]['id']);util[_0x0577('0x1b')](this[_0x0577('0x2')],this[_0x0577('0x3')]['id'],this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']],null,this[_0x0577('0x5')]);this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']][_0x0577('0x1c')]=![];this[_0x0577('0x11')]['agents'][this['agent']['id']][_0x0577('0x15')]=undefined;util[_0x0577('0x17')](this[_0x0577('0x3')]['id'],this[_0x0577('0x11')][_0x0577('0x12')][this[_0x0577('0x4')]['id']],_0x1a1b67?_0x0577('0x1d'):'TIMEOUT');}if(!_0x1a1b67){setTimeout(this['push'][_0x0577('0x6')](this),0x3e8);}};function agent(_0x577b69,_0x313426,_0x35ca81,_0xab69c6){return new Agent(_0x577b69,_0x313426,_0x35ca81,_0xab69c6);}module[_0x0577('0x1e')]=agent;
\ No newline at end of file
index f55ea69..3019266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26cf=['busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','busy','uuid','./util','routing','notificationId','queue','realtime','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','isAgentAvailable'];(function(_0x1f492a,_0x2e038a){var _0x2bb138=function(_0x2d3d1e){while(--_0x2d3d1e){_0x1f492a['push'](_0x1f492a['shift']());}};_0x2bb138(++_0x2e038a);}(_0x26cf,0x135));var _0xf26c=function(_0x3d7320,_0x4c2093){_0x3d7320=_0x3d7320-0x0;var _0x19622b=_0x26cf[_0x3d7320];return _0x19622b;};'use strict';var _=require('lodash');var uuid=require(_0xf26c('0x0'));var util=require(_0xf26c('0x1'));var logger=require('../../../../../config/logger')(_0xf26c('0x2'));var Beepall=function(_0x5357ce,_0x1a6d9c,_0x4c414f,_0x314cdf){this[_0xf26c('0x3')]=uuid['v4']();this['squeue']=_0x5357ce;this[_0xf26c('0x4')]=_0x1a6d9c;this[_0xf26c('0x5')]=_0x4c414f;this[_0xf26c('0x2')]=_0x314cdf;this[_0xf26c('0x6')][_0xf26c('0x7')](this[_0xf26c('0x8')]['bind'](this),this['handleTimeout'][_0xf26c('0x9')](this));this[_0xf26c('0x6')]['on'](_0xf26c('0xa'),this[_0xf26c('0xb')][_0xf26c('0x9')](this));this[_0xf26c('0x6')]['on'](_0xf26c('0xc'),this[_0xf26c('0xd')]['bind'](this));};Beepall[_0xf26c('0xe')][_0xf26c('0x7')]=function(){this[_0xf26c('0x6')][_0xf26c('0x7')](this[_0xf26c('0x8')]['bind'](this),this[_0xf26c('0xb')]['bind'](this));};Beepall[_0xf26c('0xe')]['handleDrained']=function(_0x8e5313){this['handleTimeout'](!![]);};Beepall[_0xf26c('0xe')]['handleRun']=function(_0x4246d9){var _0x2cdf68=!![];if(!_[_0xf26c('0xf')](this[_0xf26c('0x4')])&&!_['isNil'](this['queue'][_0xf26c('0x10')])&&this[_0xf26c('0x4')]['Agents'][_0xf26c('0x11')]>0x0){for(var _0x7cb19e=0x0,_0x454f32;_0x7cb19e<this[_0xf26c('0x4')][_0xf26c('0x10')]['length'];_0x7cb19e+=0x1){_0x454f32=this[_0xf26c('0x4')][_0xf26c('0x10')][_0x7cb19e]['id'];if(_[_0xf26c('0xf')](this[_0xf26c('0x5')][_0xf26c('0x12')][_0x454f32])){logger[_0xf26c('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf26c('0x6')]['id'],_0x454f32);}else{if(util[_0xf26c('0x14')](this['squeue']['id'],this['realtime'][_0xf26c('0x12')][_0x454f32],this[_0xf26c('0x6')]['channel'],!![])){_0x2cdf68=![];util['writeLog'](this[_0xf26c('0x6')]['id'],this[_0xf26c('0x5')][_0xf26c('0x12')][_0x454f32],'RINGING');this[_0xf26c('0x5')][_0xf26c('0x12')][_0x454f32]['busy']=!![];this[_0xf26c('0x5')]['agents'][_0x454f32][_0xf26c('0x15')]=this[_0xf26c('0x4')]['name'];util[_0xf26c('0x16')](this['notificationId'],this['squeue']['id'],this[_0xf26c('0x5')][_0xf26c('0x12')][_0x454f32],this[_0xf26c('0x4')],this[_0xf26c('0x2')]);}}}if(_0x2cdf68){logger[_0xf26c('0x13')](_0xf26c('0x17'),this['squeue']['id']);setTimeout(this['push'][_0xf26c('0x9')](this),0x3e8);}}else{logger[_0xf26c('0x13')](_0xf26c('0x18'),this[_0xf26c('0x6')]['id']);setTimeout(this[_0xf26c('0x7')]['bind'](this),0x3e8);}};Beepall['prototype'][_0xf26c('0xb')]=function(_0x4bcd8e){if(!_['isNil'](this[_0xf26c('0x4')])&&!_[_0xf26c('0xf')](this[_0xf26c('0x4')][_0xf26c('0x10')])){for(var _0x4b6b2b=0x0,_0x191377;_0x4b6b2b<this[_0xf26c('0x4')][_0xf26c('0x10')]['length'];_0x4b6b2b+=0x1){_0x191377=this['queue']['Agents'][_0x4b6b2b]['id'];if(_[_0xf26c('0xf')](this[_0xf26c('0x5')]['agents'][_0x191377])){logger[_0xf26c('0x13')](_0xf26c('0x19'),this[_0xf26c('0x6')]['id'],_0x191377);}else{util[_0xf26c('0x1a')](this[_0xf26c('0x3')],this[_0xf26c('0x6')]['id'],this[_0xf26c('0x5')][_0xf26c('0x12')][_0x191377],this[_0xf26c('0x4')],this[_0xf26c('0x2')]);util[_0xf26c('0x1b')](this['squeue']['id'],this[_0xf26c('0x5')][_0xf26c('0x12')][_0x191377],_0x4bcd8e?_0xf26c('0x1c'):'TIMEOUT');this['realtime']['agents'][_0x191377][_0xf26c('0x1d')]=![];this[_0xf26c('0x5')][_0xf26c('0x12')][_0x191377][_0xf26c('0x15')]=undefined;}}}if(!_0x4bcd8e){setTimeout(this[_0xf26c('0x7')]['bind'](this),0x3e8);}};function beepall(_0x230cbb,_0x19d70c,_0x2d106f,_0x187c5b){return new Beepall(_0x230cbb,_0x19d70c,_0x2d106f,_0x187c5b);}module['exports']=beepall;
\ No newline at end of file
+var _0x746f=['routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','isNil','Agents','length','info','isAgentAvailable','agents','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x178ec6,_0x232c1f){var _0x18d587=function(_0xd30b7c){while(--_0xd30b7c){_0x178ec6['push'](_0x178ec6['shift']());}};_0x18d587(++_0x232c1f);}(_0x746f,0x9c));var _0xf746=function(_0x33c5bb,_0x35018b){_0x33c5bb=_0x33c5bb-0x0;var _0x5cf83b=_0x746f[_0x33c5bb];return _0x5cf83b;};'use strict';var _=require(_0xf746('0x0'));var uuid=require(_0xf746('0x1'));var util=require(_0xf746('0x2'));var logger=require(_0xf746('0x3'))(_0xf746('0x4'));var Beepall=function(_0x31f27a,_0x20344a,_0x1be178,_0x357b8e){this[_0xf746('0x5')]=uuid['v4']();this[_0xf746('0x6')]=_0x31f27a;this[_0xf746('0x7')]=_0x20344a;this[_0xf746('0x8')]=_0x1be178;this[_0xf746('0x4')]=_0x357b8e;this[_0xf746('0x6')][_0xf746('0x9')](this[_0xf746('0xa')][_0xf746('0xb')](this),this[_0xf746('0xc')][_0xf746('0xb')](this));this[_0xf746('0x6')]['on'](_0xf746('0xd'),this[_0xf746('0xc')][_0xf746('0xb')](this));this[_0xf746('0x6')]['on']('drained',this[_0xf746('0xe')][_0xf746('0xb')](this));};Beepall[_0xf746('0xf')]['push']=function(){this[_0xf746('0x6')]['push'](this[_0xf746('0xa')][_0xf746('0xb')](this),this[_0xf746('0xc')][_0xf746('0xb')](this));};Beepall[_0xf746('0xf')][_0xf746('0xe')]=function(_0x4d30cc){this[_0xf746('0xc')](!![]);};Beepall[_0xf746('0xf')][_0xf746('0xa')]=function(_0x5027d2){var _0x3271d4=!![];if(!_[_0xf746('0x10')](this[_0xf746('0x7')])&&!_[_0xf746('0x10')](this[_0xf746('0x7')][_0xf746('0x11')])&&this['queue'][_0xf746('0x11')]['length']>0x0){for(var _0x412483=0x0,_0xcc782;_0x412483<this['queue'][_0xf746('0x11')][_0xf746('0x12')];_0x412483+=0x1){_0xcc782=this[_0xf746('0x7')][_0xf746('0x11')][_0x412483]['id'];if(_[_0xf746('0x10')](this[_0xf746('0x8')]['agents'][_0xcc782])){logger[_0xf746('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf746('0x6')]['id'],_0xcc782);}else{if(util[_0xf746('0x14')](this[_0xf746('0x6')]['id'],this[_0xf746('0x8')][_0xf746('0x15')][_0xcc782],this[_0xf746('0x6')]['channel'],!![])){_0x3271d4=![];util[_0xf746('0x16')](this['squeue']['id'],this['realtime'][_0xf746('0x15')][_0xcc782],_0xf746('0x17'));this[_0xf746('0x8')][_0xf746('0x15')][_0xcc782][_0xf746('0x18')]=!![];this[_0xf746('0x8')]['agents'][_0xcc782][_0xf746('0x19')]=this[_0xf746('0x7')][_0xf746('0x1a')];util[_0xf746('0x1b')](this['notificationId'],this['squeue']['id'],this[_0xf746('0x8')]['agents'][_0xcc782],this[_0xf746('0x7')],this[_0xf746('0x4')]);}}}if(_0x3271d4){logger[_0xf746('0x13')](_0xf746('0x1c'),this[_0xf746('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger[_0xf746('0x13')](_0xf746('0x1d'),this[_0xf746('0x6')]['id']);setTimeout(this[_0xf746('0x9')]['bind'](this),0x3e8);}};Beepall[_0xf746('0xf')]['handleTimeout']=function(_0x746b60){if(!_['isNil'](this[_0xf746('0x7')])&&!_[_0xf746('0x10')](this[_0xf746('0x7')][_0xf746('0x11')])){for(var _0x3eb10c=0x0,_0x316607;_0x3eb10c<this['queue'][_0xf746('0x11')][_0xf746('0x12')];_0x3eb10c+=0x1){_0x316607=this[_0xf746('0x7')]['Agents'][_0x3eb10c]['id'];if(_['isNil'](this['realtime'][_0xf746('0x15')][_0x316607])){logger['info'](_0xf746('0x1e'),this[_0xf746('0x6')]['id'],_0x316607);}else{util['hideNotification'](this[_0xf746('0x5')],this[_0xf746('0x6')]['id'],this['realtime'][_0xf746('0x15')][_0x316607],this[_0xf746('0x7')],this[_0xf746('0x4')]);util[_0xf746('0x16')](this[_0xf746('0x6')]['id'],this[_0xf746('0x8')][_0xf746('0x15')][_0x316607],_0x746b60?'STOP':'TIMEOUT');this[_0xf746('0x8')]['agents'][_0x316607]['busy']=![];this[_0xf746('0x8')][_0xf746('0x15')][_0x316607]['busyQueue']=undefined;}}}if(!_0x746b60){setTimeout(this[_0xf746('0x9')]['bind'](this),0x3e8);}};function beepall(_0x181ca1,_0xc700fb,_0x55b381,_0x4f654e){return new Beepall(_0x181ca1,_0xc700fb,_0x55b381,_0x4f654e);}module[_0xf746('0x1f')]=beepall;
\ No newline at end of file
index 13af333..9b22494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69a2=['./agent','exports','./rrmemory','./beepall'];(function(_0x2b8969,_0x43e4d6){var _0x4ddc2f=function(_0x18c99a){while(--_0x18c99a){_0x2b8969['push'](_0x2b8969['shift']());}};_0x4ddc2f(++_0x43e4d6);}(_0x69a2,0xd9));var _0x269a=function(_0x51b933,_0x1dea57){_0x51b933=_0x51b933-0x0;var _0x290cf5=_0x69a2[_0x51b933];return _0x290cf5;};'use strict';module[_0x269a('0x0')]={'rrmemory':require(_0x269a('0x1')),'beepall':require(_0x269a('0x2')),'agent':require(_0x269a('0x3'))};
\ No newline at end of file
+var _0xb56a=['./beepall','exports'];(function(_0x436669,_0x506675){var _0x4b3539=function(_0x1b8bf7){while(--_0x1b8bf7){_0x436669['push'](_0x436669['shift']());}};_0x4b3539(++_0x506675);}(_0xb56a,0x139));var _0xab56=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xb56a[_0x2dadb9];return _0x2f0097;};'use strict';module[_0xab56('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0xab56('0x1')),'agent':require('./agent')};
\ No newline at end of file
index 2d17f67..c2692ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68a7=['notificationId','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','[%s][QUEUE]\x20timeout\x20with\x20%s','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','intervals','push','handleRun','bind','handleTimeout','module','timeout','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x68a7,0x10b));var _0x768a=function(_0x598b6f,_0x55690f){_0x598b6f=_0x598b6f-0x0;var _0x40959f=_0x68a7[_0x598b6f];return _0x40959f;};'use strict';var rr=require('rr');var _=require(_0x768a('0x0'));var uuid=require(_0x768a('0x1'));var util=require(_0x768a('0x2'));var logger=require(_0x768a('0x3'))(_0x768a('0x4'));var RRMemory=function(_0x35f60c,_0x105936,_0x533509,_0x48222){this['notificationId']=uuid['v4']();this[_0x768a('0x5')]=_0x35f60c;this[_0x768a('0x6')]=_0x105936;this[_0x768a('0x7')]=_0x533509;this[_0x768a('0x4')]=_0x48222;this[_0x768a('0x8')]={};this[_0x768a('0x5')][_0x768a('0x9')](this[_0x768a('0xa')][_0x768a('0xb')](this),this[_0x768a('0xc')][_0x768a('0xb')](this),this[_0x768a('0xd')]);this[_0x768a('0x5')]['on'](_0x768a('0xe'),this[_0x768a('0xc')]['bind'](this));this['squeue']['on']('drained',this[_0x768a('0xf')][_0x768a('0xb')](this));};RRMemory[_0x768a('0x10')]['push']=function(){this['squeue']['push'](this[_0x768a('0xa')][_0x768a('0xb')](this),this[_0x768a('0xc')][_0x768a('0xb')](this));};RRMemory[_0x768a('0x10')]['handleDrained']=function(_0x1542f5){this[_0x768a('0xc')](!![]);};RRMemory[_0x768a('0x10')][_0x768a('0x11')]=function(_0x3d130e){if(util[_0x768a('0x12')](this['squeue']['id'],this['realtime'][_0x768a('0x13')][this['agentId']],this['squeue'][_0x768a('0x14')],!![])){logger[_0x768a('0x15')](_0x768a('0x16'),this[_0x768a('0x5')]['id'],this['agentId']);clearInterval(this[_0x768a('0x8')][this[_0x768a('0x17')]]);_0x3d130e['done']();setTimeout(this[_0x768a('0x9')][_0x768a('0xb')](this),0x3e8);}};RRMemory[_0x768a('0x10')][_0x768a('0xa')]=function(_0x53e69f){this[_0x768a('0x17')]=rr(this[_0x768a('0x6')]['mapAgentsId']);logger[_0x768a('0x15')]('[%s][QUEUE]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x768a('0x17')]);if(_[_0x768a('0x18')](this[_0x768a('0x7')][_0x768a('0x13')][this['agentId']])){logger[_0x768a('0x15')](_0x768a('0x19'),this[_0x768a('0x5')]['id'],this[_0x768a('0x17')]);_0x53e69f['done']();setTimeout(this[_0x768a('0x9')][_0x768a('0xb')](this),0x3e8);}else{if(util[_0x768a('0x12')](this[_0x768a('0x5')]['id'],this[_0x768a('0x7')][_0x768a('0x13')][this['agentId']],this[_0x768a('0x5')][_0x768a('0x14')],!![])){this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]][_0x768a('0x1a')]=!![];this[_0x768a('0x7')]['agents'][this[_0x768a('0x17')]][_0x768a('0x1b')]=this['queue'][_0x768a('0x1c')];util['showNotification'](this[_0x768a('0x1d')],this[_0x768a('0x5')]['id'],this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]],this['queue'],this['routing']);util[_0x768a('0x1e')](this[_0x768a('0x5')]['id'],this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]],_0x768a('0x1f'));this[_0x768a('0x8')][this[_0x768a('0x17')]]=setInterval(this[_0x768a('0x11')][_0x768a('0xb')](this,_0x53e69f),0x3e8);}else{logger[_0x768a('0x15')](_0x768a('0x20'),this['squeue']['id'],this['agentId']);_0x53e69f[_0x768a('0x21')]();setTimeout(this[_0x768a('0x9')][_0x768a('0xb')](this),0x3e8);}}};RRMemory[_0x768a('0x10')][_0x768a('0xc')]=function(_0x131b18){logger[_0x768a('0x15')](_0x768a('0x22'),this['squeue']['id'],this[_0x768a('0x17')]);if(_[_0x768a('0x18')](this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]])){logger[_0x768a('0x15')](_0x768a('0x19'),this[_0x768a('0x5')]['id'],this['agentId']);}else{clearInterval(this['intervals'][this[_0x768a('0x17')]]);util['hideNotification'](this[_0x768a('0x1d')],this['squeue']['id'],this[_0x768a('0x7')][_0x768a('0x13')][this['agentId']],this[_0x768a('0x6')],this['routing']);util[_0x768a('0x1e')](this[_0x768a('0x5')]['id'],this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]],_0x768a('0x23'));this[_0x768a('0x7')][_0x768a('0x13')][this[_0x768a('0x17')]][_0x768a('0x1a')]=![];this['realtime']['agents'][this[_0x768a('0x17')]]['busyQueue']=undefined;}if(!_0x131b18){setTimeout(this[_0x768a('0x9')]['bind'](this),0x3e8);}};function rrmemory(_0x432b73,_0x34c9f5,_0x15b2fe,_0x331e77){return new RRMemory(_0x432b73,_0x34c9f5,_0x15b2fe,_0x331e77);}module[_0x768a('0x24')]=rrmemory;
\ No newline at end of file
+var _0xfc15=['agents','agentId','info','[%s][QUEUE]\x20available\x20again\x20%s','done','[%s][QUEUE]\x20try\x20with\x20%s','channel','busyQueue','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','exports','lodash','notificationId','squeue','queue','realtime','routing','intervals','push','bind','module','timeout','drained','handleDrained','prototype','handleRun','handleTimeout','handleCheckReject','isAgentAvailable'];(function(_0x25127c,_0x2d4bda){var _0x4ca861=function(_0xe48094){while(--_0xe48094){_0x25127c['push'](_0x25127c['shift']());}};_0x4ca861(++_0x2d4bda);}(_0xfc15,0x7a));var _0x5fc1=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xfc15[_0x817d9b];return _0x2752e1;};'use strict';var rr=require('rr');var _=require(_0x5fc1('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x2ae521,_0x1f8276,_0x535b3e,_0x5ae98e){this[_0x5fc1('0x1')]=uuid['v4']();this[_0x5fc1('0x2')]=_0x2ae521;this[_0x5fc1('0x3')]=_0x1f8276;this[_0x5fc1('0x4')]=_0x535b3e;this[_0x5fc1('0x5')]=_0x5ae98e;this[_0x5fc1('0x6')]={};this[_0x5fc1('0x2')][_0x5fc1('0x7')](this['handleRun'][_0x5fc1('0x8')](this),this['handleTimeout'][_0x5fc1('0x8')](this),this[_0x5fc1('0x9')]);this[_0x5fc1('0x2')]['on'](_0x5fc1('0xa'),this['handleTimeout']['bind'](this));this[_0x5fc1('0x2')]['on'](_0x5fc1('0xb'),this[_0x5fc1('0xc')][_0x5fc1('0x8')](this));};RRMemory[_0x5fc1('0xd')][_0x5fc1('0x7')]=function(){this[_0x5fc1('0x2')][_0x5fc1('0x7')](this[_0x5fc1('0xe')]['bind'](this),this[_0x5fc1('0xf')][_0x5fc1('0x8')](this));};RRMemory[_0x5fc1('0xd')][_0x5fc1('0xc')]=function(_0x2dca5e){this[_0x5fc1('0xf')](!![]);};RRMemory[_0x5fc1('0xd')][_0x5fc1('0x10')]=function(_0x4f10a0){if(util[_0x5fc1('0x11')](this['squeue']['id'],this[_0x5fc1('0x4')][_0x5fc1('0x12')][this[_0x5fc1('0x13')]],this[_0x5fc1('0x2')]['channel'],!![])){logger[_0x5fc1('0x14')](_0x5fc1('0x15'),this[_0x5fc1('0x2')]['id'],this['agentId']);clearInterval(this['intervals'][this[_0x5fc1('0x13')]]);_0x4f10a0[_0x5fc1('0x16')]();setTimeout(this[_0x5fc1('0x7')][_0x5fc1('0x8')](this),0x3e8);}};RRMemory[_0x5fc1('0xd')][_0x5fc1('0xe')]=function(_0x180625){this['agentId']=rr(this[_0x5fc1('0x3')]['mapAgentsId']);logger[_0x5fc1('0x14')](_0x5fc1('0x17'),this['squeue']['id'],this[_0x5fc1('0x13')]);if(_['isNil'](this[_0x5fc1('0x4')]['agents'][this[_0x5fc1('0x13')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x5fc1('0x13')]);_0x180625['done']();setTimeout(this[_0x5fc1('0x7')][_0x5fc1('0x8')](this),0x3e8);}else{if(util[_0x5fc1('0x11')](this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x4')][_0x5fc1('0x12')][this['agentId']],this[_0x5fc1('0x2')][_0x5fc1('0x18')],!![])){this[_0x5fc1('0x4')][_0x5fc1('0x12')][this[_0x5fc1('0x13')]]['busy']=!![];this[_0x5fc1('0x4')][_0x5fc1('0x12')][this['agentId']][_0x5fc1('0x19')]=this['queue'][_0x5fc1('0x1a')];util[_0x5fc1('0x1b')](this['notificationId'],this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x4')][_0x5fc1('0x12')][this['agentId']],this[_0x5fc1('0x3')],this['routing']);util[_0x5fc1('0x1c')](this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x4')]['agents'][this[_0x5fc1('0x13')]],_0x5fc1('0x1d'));this[_0x5fc1('0x6')][this['agentId']]=setInterval(this['handleCheckReject']['bind'](this,_0x180625),0x3e8);}else{logger['info'](_0x5fc1('0x1e'),this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x13')]);_0x180625['done']();setTimeout(this[_0x5fc1('0x7')][_0x5fc1('0x8')](this),0x3e8);}}};RRMemory[_0x5fc1('0xd')][_0x5fc1('0xf')]=function(_0x47f74b){logger[_0x5fc1('0x14')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x13')]);if(_['isNil'](this[_0x5fc1('0x4')][_0x5fc1('0x12')][this[_0x5fc1('0x13')]])){logger[_0x5fc1('0x14')](_0x5fc1('0x1f'),this[_0x5fc1('0x2')]['id'],this[_0x5fc1('0x13')]);}else{clearInterval(this[_0x5fc1('0x6')][this[_0x5fc1('0x13')]]);util[_0x5fc1('0x20')](this[_0x5fc1('0x1')],this['squeue']['id'],this['realtime']['agents'][this['agentId']],this['queue'],this['routing']);util['writeLog'](this[_0x5fc1('0x2')]['id'],this['realtime'][_0x5fc1('0x12')][this[_0x5fc1('0x13')]],'TIMEOUT');this[_0x5fc1('0x4')][_0x5fc1('0x12')][this[_0x5fc1('0x13')]][_0x5fc1('0x21')]=![];this[_0x5fc1('0x4')][_0x5fc1('0x12')][this[_0x5fc1('0x13')]][_0x5fc1('0x19')]=undefined;}if(!_0x47f74b){setTimeout(this[_0x5fc1('0x7')]['bind'](this),0x3e8);}};function rrmemory(_0x5794e7,_0x4a66ba,_0x2886e3,_0x729439){return new RRMemory(_0x5794e7,_0x4a66ba,_0x2886e3,_0x729439);}module[_0x5fc1('0x22')]=rrmemory;
\ No newline at end of file
index e3c64c2..019d915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['user:%s','name','split','account','notificationSound','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x1af0f5,_0x4fe1d3){var _0x38b327=function(_0x55b509){while(--_0x55b509){_0x1af0f5['push'](_0x1af0f5['shift']());}};_0x38b327(++_0x4fe1d3);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x315ed6,_0x23288c){_0x315ed6=_0x315ed6-0x0;var _0x2f46cc=_0xc6ac[_0x315ed6];return _0x2f46cc;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var utils=require(_0xcc6a('0x2'));var Mustache=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var config=require(_0xcc6a('0x5'));var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));config[_0xcc6a('0x8')]=_[_0xcc6a('0x9')](config[_0xcc6a('0x8')],{'host':_0xcc6a('0xa'),'port':0x18eb});var io=require(_0xcc6a('0xb'))(new Redis(config[_0xcc6a('0x8')]));function emit(_0x5f3887,_0x3dd497,_0x11b919){io['to'](_0x5f3887)[_0xcc6a('0xc')](_0x3dd497,_0x11b919);}function sendNotification(_0x560cc4,_0x43e3bf,_0x210f63,_0x7806a0,_0x463ebb,_0x3eb04a){io['to'](util['format'](_0xcc6a('0xd'),_0x7806a0[_0xcc6a('0xe')]))[_0xcc6a('0xc')]('user:save',_0x7806a0);var _0x1d91a5=_0x3eb04a||{};var _0x9e9a63=_0x210f63[_0xcc6a('0xf')]('.');var _0x55af93={'uniqueid':_0x43e3bf,'channel':_0x9e9a63[0x0],'id':_0x9e9a63[0x1],'title':_0x9e9a63[0x0]+'\x20interaction','interactionId':_0x9e9a63[0x2],'queue':_0x463ebb?_0x463ebb[_0xcc6a('0xe')]:null,'sound':_0x1d91a5[_0xcc6a('0x10')][_0xcc6a('0x11')],'shake':_0x1d91a5['account']['notificationShake']};try{if(!_0x1d91a5[_0xcc6a('0x12')]){_0x1d91a5[_0xcc6a('0x12')]={};}if(_0x463ebb){_0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')]=_0x463ebb;}else if(_0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')]){delete _0x1d91a5[_0xcc6a('0x12')][_0xcc6a('0x13')];}_0x55af93['msg']=utils['getMustacheRender'](_0x1d91a5['account'][_0xcc6a('0x14')],_0x1d91a5);}catch(_0x44910f){_0x55af93[_0xcc6a('0x15')]=_0xcc6a('0x16');logger[_0xcc6a('0x17')](util[_0xcc6a('0x18')](_0xcc6a('0x19'),_0x43e3bf,_0x44910f[_0xcc6a('0x1a')]));}io['to'](util[_0xcc6a('0x18')](_0xcc6a('0xd'),_0x7806a0[_0xcc6a('0xe')]))['emit'](util[_0xcc6a('0x18')](_0xcc6a('0x1b'),_0x560cc4?_0xcc6a('0x1c'):_0xcc6a('0x1d')),_0x55af93);}function writeLog(_0x1495d8,_0x30b8ed,_0x36c80f){return logger[_0xcc6a('0x1e')](util[_0xcc6a('0x18')](_0xcc6a('0x1f'),_0x1495d8,_0x30b8ed[_0xcc6a('0xe')],_0x36c80f));}exports[_0xcc6a('0x20')]=function(_0x51be9a,_0x41c4c8,_0x3a081e,_0x38f812){if(_0x41c4c8['busy']){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x21'));return![];}if(!_0x41c4c8[_0xcc6a('0x22')]){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x23'));return![];}if(_0x41c4c8[_0x3a081e+_0xcc6a('0x24')]){writeLog(_0x51be9a,_0x41c4c8,_0xcc6a('0x25'));return![];}if(_0x38f812&&_0x41c4c8[_0xcc6a('0x26')](_0x3a081e+'Capacity')&&_0x41c4c8[_0xcc6a('0x26')](_0x3a081e+_0xcc6a('0x27'))){if(_0x41c4c8[_0x3a081e+_0xcc6a('0x28')]>0x0&&_0x41c4c8[_0x3a081e+'CurrentCapacity']>=_0x41c4c8[_0x3a081e+_0xcc6a('0x28')]){writeLog(_0x51be9a,_0x41c4c8,_0x3a081e[_0xcc6a('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xcc6a('0x2a')]=function(_0x8b1b2b,_0x3233d1,_0x473f88,_0x5d7399,_0x194aab){return sendNotification(!![],_0x8b1b2b,_0x3233d1,_0x473f88,_0x5d7399,_0x194aab);};exports[_0xcc6a('0x2b')]=function(_0x2c6d88,_0x4f176b,_0x2590a2,_0x5308d4,_0x4f67d3){return sendNotification(![],_0x2c6d88,_0x4f176b,_0x2590a2,_0x5308d4,_0x4f67d3);};exports[_0xcc6a('0x2c')]=writeLog;
\ No newline at end of file
+var _0x1623=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction'];(function(_0x18f28d,_0x141aac){var _0x2403cc=function(_0x24f521){while(--_0x24f521){_0x18f28d['push'](_0x18f28d['shift']());}};_0x2403cc(++_0x141aac);}(_0x1623,0xab));var _0x3162=function(_0x18d483,_0x506559){_0x18d483=_0x18d483-0x0;var _0xe7e44e=_0x1623[_0x18d483];return _0xe7e44e;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0x3162('0x1'));var Redis=require(_0x3162('0x2'));var config=require(_0x3162('0x3'));var logger=require(_0x3162('0x4'))(_0x3162('0x5'));config['redis']=_['defaults'](config[_0x3162('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3162('0x7'))(new Redis(config[_0x3162('0x6')]));function emit(_0x53260d,_0xffe9b6,_0x2dc07e){io['to'](_0x53260d)[_0x3162('0x8')](_0xffe9b6,_0x2dc07e);}function sendNotification(_0x36609e,_0x10d684,_0x382676,_0xe43099,_0x113d28,_0x4bde10){io['to'](util['format'](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))[_0x3162('0x8')](_0x3162('0xb'),_0xe43099);var _0x813d62=_0x4bde10||{};var _0x208f4e=_0x382676[_0x3162('0xc')]('.');var _0x38da60={'uniqueid':_0x10d684,'channel':_0x208f4e[0x0],'id':_0x208f4e[0x1],'title':_0x208f4e[0x0]+_0x3162('0xd'),'interactionId':_0x208f4e[0x2],'queue':_0x113d28?_0x113d28['name']:null,'sound':_0x813d62[_0x3162('0xe')]['notificationSound'],'shake':_0x813d62[_0x3162('0xe')][_0x3162('0xf')]};try{if(!_0x813d62['body']){_0x813d62['body']={};}if(_0x113d28){_0x813d62[_0x3162('0x10')][_0x3162('0x11')]=_0x113d28;}else if(_0x813d62[_0x3162('0x10')]['queue']){delete _0x813d62[_0x3162('0x10')][_0x3162('0x11')];}_0x38da60[_0x3162('0x12')]=utils['getMustacheRender'](_0x813d62[_0x3162('0xe')][_0x3162('0x13')],_0x813d62);}catch(_0x46864e){_0x38da60[_0x3162('0x12')]=_0x3162('0x14');logger[_0x3162('0x15')](util[_0x3162('0x16')]('[%s][QUEUE]\x20%s',_0x10d684,_0x46864e[_0x3162('0x17')]));}io['to'](util[_0x3162('0x16')](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))['emit'](util[_0x3162('0x16')]('notification:%s',_0x36609e?'save':_0x3162('0x18')),_0x38da60);}function writeLog(_0x3e4d23,_0x31946d,_0x523fab){return logger['info'](util[_0x3162('0x16')](_0x3162('0x19'),_0x3e4d23,_0x31946d[_0x3162('0xa')],_0x523fab));}exports[_0x3162('0x1a')]=function(_0x31b27b,_0x14cbba,_0x52ae25,_0x1b2713){if(_0x14cbba['busy']){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1b'));return![];}if(!_0x14cbba[_0x3162('0x1c')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1d'));return![];}if(_0x14cbba[_0x52ae25+_0x3162('0x1e')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1f'));return![];}if(_0x1b2713&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x21'))&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x22'))){if(_0x14cbba[_0x52ae25+_0x3162('0x21')]>0x0&&_0x14cbba[_0x52ae25+_0x3162('0x22')]>=_0x14cbba[_0x52ae25+_0x3162('0x21')]){writeLog(_0x31b27b,_0x14cbba,_0x52ae25[_0x3162('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3162('0x24')]=function(_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567){return sendNotification(!![],_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567);};exports['hideNotification']=function(_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec){return sendNotification(![],_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec);};exports['writeLog']=writeLog;
\ No newline at end of file
index 7416e66..0c79415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c2f=['./utils','string','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0x8c2f,0xdc));var _0xf8c2=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x8c2f[_0x3f4dd9];return _0x31c54a;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0xf8c2('0x0'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xf8c2('0x1'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf8c2('0x2')]=function(_0xa021f8,_0x3d8bdc){return function(_0x5f4796){try{var _0x3c186a={'command':_0x3d8bdc[0x0]};var _0x4d3982=system[_0xf8c2('0x3')](_0x3c186a,{'typecast':!![]});if(_0x4d3982[_0xf8c2('0x4')]){logger[_0xf8c2('0x5')](_0xf8c2('0x6'),_0xa021f8,_[_0xf8c2('0x7')](_0x4d3982,_0xf8c2('0x8'))[_0xf8c2('0x9')](',\x20'));logger[_0xf8c2('0xa')](_0xf8c2('0xb'),_0xa021f8);_0x5f4796[_0xf8c2('0xc')]();}else{var _0x429329=this;var _0x46104f=utils[_0xf8c2('0xd')](_0x3d8bdc[0x0],this);logger[_0xf8c2('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xa021f8,_0x46104f);sh[_0xf8c2('0xe')](_['trim'](_0x46104f),function(_0x258644,_0xf05304){logger[_0xf8c2('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xa021f8,_0x258644);if(_0x258644==0x0){var _0x34e8a2=_0xf05304[_0xf8c2('0xf')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3d8bdc[0x1])||_[_0xf8c2('0x10')](_0x3d8bdc[0x1])){logger['info'](_0xf8c2('0x11'),_0xa021f8);_0x429329[_0xf8c2('0x12')][_0x3d8bdc[0x1]]=_0x34e8a2;}else{logger[_0xf8c2('0xa')](_0xf8c2('0x13'),_0xa021f8,_0x3d8bdc[0x1],_0x34e8a2);_0x429329[_0xf8c2('0x12')][_0x3d8bdc[0x1]]=_0x34e8a2;}}_0x5f4796[_0xf8c2('0xc')]();});}}catch(_0x2241dc){logger[_0xf8c2('0x5')](_0xf8c2('0x6'),_0xa021f8,_[_0xf8c2('0x14')](_0x2241dc)?JSON[_0xf8c2('0x15')](_0x2241dc):_0x2241dc);logger['info'](_0xf8c2('0xb'),_0xa021f8);_0x5f4796[_0xf8c2('0xc')]();}};};
\ No newline at end of file
+var _0x1c5b=['map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','exec','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','lodash','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c5b,0x184));var _0xb1c5=function(_0x3da333,_0x17383f){_0x3da333=_0x3da333-0x0;var _0x5c088d=_0x1c5b[_0x3da333];return _0x5c088d;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xb1c5('0x0'));var utils=require(_0xb1c5('0x1'));var logger=require(_0xb1c5('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xb1c5('0x3')}});exports['consequence']=function(_0x131a47,_0x239681){return function(_0xf81b88){try{var _0x2f1a57={'command':_0x239681[0x0]};var _0x4a05e9=system[_0xb1c5('0x4')](_0x2f1a57,{'typecast':!![]});if(_0x4a05e9[_0xb1c5('0x5')]){logger[_0xb1c5('0x6')](_0xb1c5('0x7'),_0x131a47,_[_0xb1c5('0x8')](_0x4a05e9,'message')[_0xb1c5('0x9')](',\x20'));logger['info'](_0xb1c5('0xa'),_0x131a47);_0xf81b88['next']();}else{var _0x46f62a=this;var _0x17fb22=utils[_0xb1c5('0xb')](_0x239681[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x131a47,_0x17fb22);sh[_0xb1c5('0xc')](_['trim'](_0x17fb22),function(_0x21aaf5,_0x50131f){logger[_0xb1c5('0xd')](_0xb1c5('0xe'),_0x131a47,_0x21aaf5);if(_0x21aaf5==0x0){var _0x1bfb8a=_0x50131f[_0xb1c5('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xb1c5('0x10')](_0x239681[0x1])||_[_0xb1c5('0x11')](_0x239681[0x1])){logger[_0xb1c5('0xd')](_0xb1c5('0x12'),_0x131a47);_0x46f62a[_0xb1c5('0x13')][_0x239681[0x1]]=_0x1bfb8a;}else{logger[_0xb1c5('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x131a47,_0x239681[0x1],_0x1bfb8a);_0x46f62a[_0xb1c5('0x13')][_0x239681[0x1]]=_0x1bfb8a;}}_0xf81b88[_0xb1c5('0x14')]();});}}catch(_0x389819){logger['error'](_0xb1c5('0x7'),_0x131a47,_['isObject'](_0x389819)?JSON[_0xb1c5('0x15')](_0x389819):_0x389819);logger[_0xb1c5('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x131a47);_0xf81b88[_0xb1c5('0x14')]();}};};
\ No newline at end of file
index 3bcbd60..a79ed88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbe2=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction'];(function(_0xc7d00e,_0x53faef){var _0x39bf39=function(_0x19cbec){while(--_0x19cbec){_0xc7d00e['push'](_0xc7d00e['shift']());}};_0x39bf39(++_0x53faef);}(_0xdbe2,0x177));var _0x2dbe=function(_0x120bc0,_0x40e780){_0x120bc0=_0x120bc0-0x0;var _0x49d52a=_0xdbe2[_0x120bc0];return _0x49d52a;};'use strict';var schema=require(_0x2dbe('0x0'));var _=require(_0x2dbe('0x1'));var rpc={'chatInteraction':require(_0x2dbe('0x2')),'openchannelInteraction':require(_0x2dbe('0x3')),'smsInteraction':require(_0x2dbe('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2dbe('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x2dbe('0x6'))(_0x2dbe('0x7'));var tag=schema({'tag':{'type':_0x2dbe('0x8'),'required':!![],'message':_0x2dbe('0x9')}});exports['consequence']=function(_0x736117,_0xfdfb33,_0xb9462e,_0x4f6a81){return function(_0x6b877){try{var _0x574e66={'tag':_0xfdfb33[0x0]};var _0xd1e3a7=tag[_0x2dbe('0x0')](_0x574e66,{'typecast':!![]});if(_0xd1e3a7[_0x2dbe('0xa')]){logger[_0x2dbe('0xb')](_0x2dbe('0xc'),_0x736117,_['map'](_0xd1e3a7,_0x2dbe('0xd'))[_0x2dbe('0xe')](',\x20'));logger[_0x2dbe('0xf')](_0x2dbe('0x10'),_0x736117);_0x6b877[_0x2dbe('0x11')]();}else{var _0x5e4f2d={'ids':[_0xfdfb33[0x0]]};if(rpc[_0x4f6a81[_0x2dbe('0x12')]+_0x2dbe('0x13')]){rpc[_0x4f6a81['channel']+_0x2dbe('0x13')][_0x2dbe('0x14')](_0x4f6a81[_0x2dbe('0x15')]['id'],_0x5e4f2d)[_0x2dbe('0x16')](function(_0x23df31){logger[_0x2dbe('0xf')](_0x2dbe('0x17'),_0x736117,_0xfdfb33[0x1],_0x4f6a81[_0x2dbe('0x12')],_0x4f6a81['interaction']['id']);})[_0x2dbe('0x18')](function(_0x4024e3){logger['error'](_0x2dbe('0xc'),_0x736117,JSON[_0x2dbe('0x19')](_0x4024e3));logger[_0x2dbe('0xf')](_0x2dbe('0x10'),_0x736117);})['finally'](function(){_0x6b877[_0x2dbe('0x11')]();});}}}catch(_0x4a28b6){logger[_0x2dbe('0xb')]('[%s][TAG]\x20%s',_0x736117,_[_0x2dbe('0x1a')](_0x4a28b6)?JSON[_0x2dbe('0x19')](_0x4a28b6):_0x4a28b6);logger[_0x2dbe('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x736117);_0x6b877[_0x2dbe('0x11')]();}};};
\ No newline at end of file
+var _0x1cae=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','info','[%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/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join'];(function(_0x3803f5,_0x48373c){var _0xe6cb5a=function(_0x3dba8e){while(--_0x3dba8e){_0x3803f5['push'](_0x3803f5['shift']());}};_0xe6cb5a(++_0x48373c);}(_0x1cae,0x11d));var _0xe1ca=function(_0x3583ea,_0x2f3171){_0x3583ea=_0x3583ea-0x0;var _0x369269=_0x1cae[_0x3583ea];return _0x369269;};'use strict';var schema=require(_0xe1ca('0x0'));var _=require(_0xe1ca('0x1'));var rpc={'chatInteraction':require(_0xe1ca('0x2')),'openchannelInteraction':require(_0xe1ca('0x3')),'smsInteraction':require(_0xe1ca('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xe1ca('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xe1ca('0x6'))('routing');var tag=schema({'tag':{'type':_0xe1ca('0x7'),'required':!![],'message':_0xe1ca('0x8')}});exports[_0xe1ca('0x9')]=function(_0x435325,_0x249344,_0x2b4b45,_0x1cb8b7){return function(_0x23185f){try{var _0x2aa933={'tag':_0x249344[0x0]};var _0x7a4f52=tag[_0xe1ca('0x0')](_0x2aa933,{'typecast':!![]});if(_0x7a4f52['length']){logger[_0xe1ca('0xa')](_0xe1ca('0xb'),_0x435325,_[_0xe1ca('0xc')](_0x7a4f52,_0xe1ca('0xd'))[_0xe1ca('0xe')](',\x20'));logger['info'](_0xe1ca('0xf'),_0x435325);_0x23185f[_0xe1ca('0x10')]();}else{var _0xba311e={'ids':[_0x249344[0x0]]};if(rpc[_0x1cb8b7[_0xe1ca('0x11')]+'Interaction']){rpc[_0x1cb8b7[_0xe1ca('0x11')]+_0xe1ca('0x12')]['addTags'](_0x1cb8b7[_0xe1ca('0x13')]['id'],_0xba311e)['then'](function(_0x27312b){logger[_0xe1ca('0x14')](_0xe1ca('0x15'),_0x435325,_0x249344[0x1],_0x1cb8b7[_0xe1ca('0x11')],_0x1cb8b7['interaction']['id']);})[_0xe1ca('0x16')](function(_0x26f59d){logger['error'](_0xe1ca('0xb'),_0x435325,JSON[_0xe1ca('0x17')](_0x26f59d));logger[_0xe1ca('0x14')](_0xe1ca('0xf'),_0x435325);})['finally'](function(){_0x23185f[_0xe1ca('0x10')]();});}}}catch(_0x720006){logger[_0xe1ca('0xa')]('[%s][TAG]\x20%s',_0x435325,_[_0xe1ca('0x18')](_0x720006)?JSON[_0xe1ca('0x17')](_0x720006):_0x720006);logger['info'](_0xe1ca('0xf'),_0x435325);_0x23185f['next']();}};};
\ No newline at end of file
index 86ddb34..65912a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x550038,_0x12a1e1){var _0x3a2c2d=function(_0x912629){while(--_0x912629){_0x550038['push'](_0x550038['shift']());}};_0x3a2c2d(++_0x12a1e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5e10ce,_0x4fab83){var _0x3f2cd5=function(_0x28996b){while(--_0x28996b){_0x5e10ce['push'](_0x5e10ce['shift']());}};_0x3f2cd5(++_0x4fab83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
index f664461..6371ae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ee2=['paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','amazonlex','tag','%s:%s:%s','./interval','condition','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x0ee2,0x12b));var _0x20ee=function(_0x1f99e2,_0x21f96f){_0x1f99e2=_0x1f99e2-0x0;var _0x478ed5=_0x0ee2[_0x1f99e2];return _0x478ed5;};'use strict';var _=require(_0x20ee('0x0'));var util=require(_0x20ee('0x1'));var path=require(_0x20ee('0x2'));var fs=require('fs');var jayson=require(_0x20ee('0x3'));var BPromise=require(_0x20ee('0x4'));var uuid=require(_0x20ee('0x5'));var config=require(_0x20ee('0x6'));var logger=require('../../../config/logger')(_0x20ee('0x7'));var rpc={'openchannelQueueReport':require(_0x20ee('0x8')),'mailQueueReport':require(_0x20ee('0x9')),'chatQueueReport':require(_0x20ee('0xa')),'smsQueueReport':require(_0x20ee('0xb')),'faxQueueReport':require(_0x20ee('0xc')),'whatsappQueueReport':require(_0x20ee('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x45a84a,_0x150bd9,_0x3d366c){return util['format'](_0x20ee('0xe'),_0x45a84a,_0x150bd9||0x0,_0x3d366c||0x0);}function getIntervals(_0x42faf6,_0x29af75){var _0x5e9042=[];if(!_['isNil'](_0x29af75[_0x20ee('0xf')])&&!_['isNil'](_0x42faf6[_0x29af75[_0x20ee('0xf')]])&&!_[_0x20ee('0x10')](_0x42faf6[_0x29af75[_0x20ee('0xf')]]['Intervals'])){_0x5e9042=_[_0x20ee('0x11')](_0x42faf6[_0x29af75[_0x20ee('0xf')]][_0x20ee('0x12')],'interval');}else if(!_[_0x20ee('0x10')](_0x29af75[_0x20ee('0x13')])){_0x5e9042=[_0x29af75[_0x20ee('0x13')]];}return _0x5e9042;}exports[_0x20ee('0x14')]=function(_0x2c47a1){_0x2c47a1['rules']={};return new BPromise(function(_0x2c21e4,_0xe08357){var _0x37ff39={'Start':function(_0x48e746){var _0x5ad7de=this;return new Promise(function(_0x3f9bf5,_0x53730a){if(_0x48e746){try{var _0x13ee08=[];var _0x139b89=getId(_0x48e746[_0x20ee('0x15')],_0x48e746[_0x20ee('0x16')]?_0x48e746[_0x20ee('0x16')]['id']:0x0,_0x48e746['interaction']?_0x48e746[_0x20ee('0x17')]['id']:0x0);if(_0x48e746[_0x20ee('0x18')]&&_[_0x20ee('0x19')](_0x48e746['applications'])&&_0x48e746[_0x20ee('0x18')]['length']){for(var _0x23cee8=0x0;_0x23cee8<_0x48e746[_0x20ee('0x18')][_0x20ee('0x1a')];_0x23cee8+=0x1){var _0x264f2a=_0x48e746['applications'][_0x23cee8];if(fs['existsSync'](path[_0x20ee('0x1b')](__dirname,_0x20ee('0x18'),_0x264f2a[_0x20ee('0x1c')]+_0x20ee('0x1d')))){var _0x439dbc=[];switch(_0x264f2a[_0x20ee('0x1c')][_0x20ee('0x1e')]()){case _0x20ee('0x1f'):var _0x28efe6=_0x264f2a[_0x20ee('0x20')][_0x20ee('0x21')](',');if(_0x48e746[_0x20ee('0x15')]===_0x20ee('0x22')){_0x439dbc[_0x20ee('0x23')](_0x28efe6[0x0]);_0x439dbc[_0x20ee('0x23')](_0x28efe6[0x1]);_0x439dbc[_0x20ee('0x23')](_0x28efe6[_0x20ee('0x24')](0x2,_0x28efe6['length'])[_0x20ee('0x1b')](','));}else{_0x439dbc[_0x20ee('0x23')](_0x28efe6[0x0]);_0x439dbc[_0x20ee('0x23')](_0x28efe6[_0x20ee('0x24')](0x1,_0x28efe6[_0x20ee('0x1a')])[_0x20ee('0x1b')](','));}break;case'dialogflow':var _0x3ae8af=_0x264f2a[_0x20ee('0x20')]['split'](',');_0x439dbc[_0x20ee('0x23')](_0x3ae8af[0x0]);_0x439dbc[_0x20ee('0x23')](_0x3ae8af[0x1]);_0x439dbc[_0x20ee('0x23')](_0x3ae8af[_0x20ee('0x24')](0x2,_0x3ae8af['length'])[_0x20ee('0x1b')](','));break;case'dialogflowv2':var _0x41c2ba=_0x264f2a[_0x20ee('0x20')]['split'](',');_0x439dbc['push'](_0x41c2ba[0x0]);_0x439dbc['push'](_0x41c2ba[0x1]);_0x439dbc[_0x20ee('0x23')](_0x41c2ba[0x2]);_0x439dbc[_0x20ee('0x23')](_0x41c2ba[0x3]);_0x439dbc[_0x20ee('0x23')](_0x41c2ba[_0x20ee('0x24')](0x4,_0x41c2ba['length'])['join'](','));break;case _0x20ee('0x25'):var _0x367824=_0x264f2a[_0x20ee('0x20')]['split'](',');_0x439dbc[_0x20ee('0x23')](_0x367824[0x0]);_0x439dbc['push'](_0x367824[0x1]);_0x439dbc[_0x20ee('0x23')](_0x367824[0x2]);_0x439dbc[_0x20ee('0x23')](_0x367824[0x3]);_0x439dbc['push'](_0x367824['slice'](0x4,_0x367824[_0x20ee('0x1a')])['join'](','));break;case _0x20ee('0x16'):_0x439dbc[_0x20ee('0x23')](_0x264f2a[_0x20ee('0x20')]);break;case _0x20ee('0x26'):_0x439dbc['push'](_0x264f2a['TagId']);_0x439dbc[_0x20ee('0x23')](_0x264f2a[_0x20ee('0x20')]);break;default:_0x439dbc=_['isNil'](_0x264f2a[_0x20ee('0x20')])?[]:_0x264f2a['appdata']['split'](',');}var _0x246907={'id':util['format'](_0x20ee('0x27'),_0x139b89,_0x264f2a['id'],_0x264f2a[_0x20ee('0x1c')]),'condition':require(_0x20ee('0x28'))[_0x20ee('0x29')](_0x139b89,getIntervals(_0x2c47a1['intervals'],_0x264f2a),_0x2c47a1),'consequence':require(_0x20ee('0x2a')+_0x264f2a[_0x20ee('0x1c')])[_0x20ee('0x2b')](_0x139b89,_0x439dbc,_0x2c47a1,_0x48e746),'p':_0x264f2a['priority']||0x0};logger[_0x20ee('0x2c')](_0x20ee('0x2d'),_0x246907['id'],_0x20ee('0x2e'),getIntervals(_0x2c47a1[_0x20ee('0x2f')],_0x264f2a)[_0x20ee('0x1b')](_0x20ee('0x30')));_0x13ee08[_0x20ee('0x23')](_0x246907);}else{logger[_0x20ee('0x31')](_0x20ee('0x32'),path[_0x20ee('0x1b')](__dirname,'applications',_0x264f2a[_0x20ee('0x1c')]+'.js'));}}_0x2c47a1[_0x20ee('0x33')][_0x139b89]=new RuleEngine(_0x13ee08);_0x2c47a1[_0x20ee('0x33')][_0x139b89][_0x20ee('0x34')](_0x48e746,function(_0x3cc094){logger[_0x20ee('0x2c')](_0x20ee('0x35'),JSON[_0x20ee('0x36')](_0x3cc094[_0x20ee('0x37')]));if(_0x2c47a1[_0x20ee('0x33')][_0x139b89]){_0x2c47a1['rules'][_0x139b89][_0x20ee('0x38')](_0x20ee('0x39'));}});return _0x3f9bf5({'code':0xc8,'message':_0x48e746});}else{logger[_0x20ee('0x2c')]('No\x20applications\x20to\x20execute');return _0x3f9bf5({'code':0xc8,'message':_0x48e746});}}catch(_0x498c3e){logger[_0x20ee('0x31')](_0x498c3e[_0x20ee('0x3a')]);return _0x53730a(_0x5ad7de[_0x20ee('0x31')](0x1f4,_0x498c3e));}}return _0x53730a(_0x20ee('0x3b'));});},'AcceptMessage':function(_0x1a1455){var _0x540f6e=this;return new Promise(function(_0x101909,_0xf647bb){if(_0x1a1455[_0x20ee('0x3c')]&&_0x1a1455[_0x20ee('0x3c')]['id']){if(_0x2c47a1['agents'][_0x1a1455[_0x20ee('0x3c')]['id']]){_0x2c47a1['agents'][_0x1a1455[_0x20ee('0x3c')]['id']][_0x20ee('0x3d')]=![];_0x2c47a1[_0x20ee('0x3e')][_0x1a1455[_0x20ee('0x3c')]['id']][_0x20ee('0x3f')]=undefined;}}if(_0x1a1455[_0x20ee('0x16')]&&_0x1a1455[_0x20ee('0x16')]['id']){try{var _0x132785=getId(_0x1a1455['channel'],_0x1a1455[_0x20ee('0x16')]?_0x1a1455[_0x20ee('0x16')]['id']:0x0,_0x1a1455[_0x20ee('0x17')]?_0x1a1455[_0x20ee('0x17')]['id']:0x0);if(_0x2c47a1[_0x20ee('0x33')][_0x132785]){_0x2c47a1[_0x20ee('0x33')][_0x132785][_0x20ee('0x38')](_0x20ee('0x40'));if(rpc[_0x1a1455[_0x20ee('0x15')]+_0x20ee('0x41')]){rpc[_0x1a1455[_0x20ee('0x15')]+'QueueReport'][_0x20ee('0x42')](_0x132785,{'UserId':_0x1a1455[_0x20ee('0x16')][_0x20ee('0x43')]})[_0x20ee('0x44')](function(_0xa6551b){logger[_0x20ee('0x31')](_0x20ee('0x45'));});}}return _0x101909({'code':0xc8,'message':_0x1a1455});}catch(_0x359c0b){logger[_0x20ee('0x31')](_0x359c0b['stack']);return _0xf647bb(_0x540f6e[_0x20ee('0x31')](0x1f4,_0x359c0b));}}logger[_0x20ee('0x31')](_0x20ee('0x46'));return _0xf647bb(_0x540f6e[_0x20ee('0x31')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x297b6d){var _0x9b3129=this;return new Promise(function(_0x370a5a,_0x223644){if(_0x297b6d[_0x20ee('0x3c')]&&_0x297b6d[_0x20ee('0x3c')]['id']){try{if(_0x2c47a1[_0x20ee('0x3e')][_0x297b6d[_0x20ee('0x3c')]['id']]){_0x2c47a1[_0x20ee('0x3e')][_0x297b6d[_0x20ee('0x3c')]['id']][_0x20ee('0x3d')]=![];_0x2c47a1[_0x20ee('0x3e')][_0x297b6d['agent']['id']]['busyQueue']=undefined;}return _0x370a5a({'code':0xc8,'message':_0x297b6d});}catch(_0x9c659){logger[_0x20ee('0x31')](_0x9c659[_0x20ee('0x3a')]);return _0x223644(_0x9b3129[_0x20ee('0x31')](0x1f4,_0x9c659));}}logger[_0x20ee('0x31')]('message\x20is\x20empty');return _0x223644(_0x9b3129[_0x20ee('0x31')](0x1f4,_0x20ee('0x46')));});},'AbandonInteraction':function(_0xfd3f01){var _0x2d0d40=this;return new Promise(function(_0x4b88c0,_0x31b338){if(_0xfd3f01[_0x20ee('0x15')]&&_0xfd3f01[_0x20ee('0x17')]&&_0xfd3f01['interaction']['id']){try{var _0x36e6ec=getId(_0xfd3f01[_0x20ee('0x15')],_0xfd3f01['message']?_0xfd3f01['message']['id']:0x0,_0xfd3f01[_0x20ee('0x17')]?_0xfd3f01[_0x20ee('0x17')]['id']:0x0);if(_0x2c47a1[_0x20ee('0x33')][_0x36e6ec]){_0x2c47a1[_0x20ee('0x33')][_0x36e6ec][_0x20ee('0x38')](_0x20ee('0x40'));}return _0x4b88c0({'code':0xc8,'message':_0xfd3f01});}catch(_0x5b4694){logger[_0x20ee('0x31')](_0x5b4694['stack']);return _0x31b338(_0x2d0d40['error'](0x1f4,_0x5b4694));}}logger[_0x20ee('0x31')]('message\x20is\x20empty');return _0x31b338(_0x2d0d40[_0x20ee('0x31')](0x1f4,_0x20ee('0x46')));});},'AgentCapacity':function(_0x2e6dd9){var _0x2fdee0=this;return new Promise(function(_0x4f24b6,_0x19f867){if(_0x2c47a1[_0x20ee('0x3e')][_0x20ee('0x47')](_0x2e6dd9['id'])){for(var _0x529285 in _0x2e6dd9[_0x20ee('0x48')]){if(_0x2e6dd9['capacity'][_0x20ee('0x47')](_0x529285)){if(_0x2c47a1[_0x20ee('0x3e')][_0x2e6dd9['id']][_0x20ee('0x47')](_0x529285+_0x20ee('0x49'))){_0x2c47a1['agents'][_0x2e6dd9['id']][_0x529285+_0x20ee('0x49')]=parseInt(_0x2e6dd9[_0x20ee('0x48')][_0x529285],0xa);}}}_0x2c47a1[_0x20ee('0x3e')][_0x2e6dd9['id']][_0x20ee('0x4a')]();return _0x4f24b6({'code':0xc8,'message':_0x2c47a1['agents'][_0x2e6dd9['id']]});}else{return _0x19f867(_0x2fdee0[_0x20ee('0x31')](0x1f4,_0x20ee('0x4b')));}});},'Agents':function(_0x2268d5){return new Promise(function(_0x282154,_0x6dda46){var _0x58704d=_[_0x20ee('0x4c')](_0x2c47a1[_0x20ee('0x3e')]);_0x282154({'count':_0x58704d['length'],'rows':_0x58704d});});},'ChatQueues':function(_0x170a38){return new Promise(function(_0x3f8fa1,_0x557caa){var _0x371a0d=[];for(var _0x184704 in _0x2c47a1[_0x20ee('0x4d')]){if(_0x2c47a1[_0x20ee('0x4d')][_0x20ee('0x47')](_0x184704)){var _0x2d1b4a=_0x2c47a1[_0x20ee('0x4d')][_0x184704];var _0xef846c={'id':_0x2d1b4a['id'],'available':_0x2d1b4a[_0x20ee('0x4e')],'loggedIn':_0x2d1b4a[_0x20ee('0x4f')],'name':_0x2d1b4a[_0x20ee('0x50')],'paused':_0x2d1b4a[_0x20ee('0x51')],'waiting':_0x2d1b4a['waiting']};_0x371a0d['push'](_0xef846c);}}_0x3f8fa1({'count':_0x371a0d['length'],'rows':_0x371a0d});});},'MailQueues':function(_0x19816b){return new Promise(function(_0x344c9f,_0x956160){var _0x210d37=[];for(var _0x3db3d6 in _0x2c47a1[_0x20ee('0x52')]){if(_0x2c47a1[_0x20ee('0x52')][_0x20ee('0x47')](_0x3db3d6)){var _0x2d7919=_0x2c47a1[_0x20ee('0x52')][_0x3db3d6];var _0x59d3c0={'id':_0x2d7919['id'],'available':_0x2d7919['available'],'loggedIn':_0x2d7919[_0x20ee('0x4f')],'name':_0x2d7919[_0x20ee('0x50')],'paused':_0x2d7919['paused'],'waiting':_0x2d7919[_0x20ee('0x53')]};_0x210d37[_0x20ee('0x23')](_0x59d3c0);}}_0x344c9f({'count':_0x210d37[_0x20ee('0x1a')],'rows':_0x210d37});});},'OpenchannelQueues':function(_0x136ccc){return new Promise(function(_0x11eb6d,_0x3c29d0){var _0x208262=[];for(var _0x1c31f8 in _0x2c47a1['openchannelQueues']){if(_0x2c47a1[_0x20ee('0x54')][_0x20ee('0x47')](_0x1c31f8)){var _0x19debd=_0x2c47a1[_0x20ee('0x54')][_0x1c31f8];var _0x178e2b={'id':_0x19debd['id'],'available':_0x19debd[_0x20ee('0x4e')],'loggedIn':_0x19debd[_0x20ee('0x4f')],'name':_0x19debd[_0x20ee('0x50')],'paused':_0x19debd[_0x20ee('0x51')],'waiting':_0x19debd[_0x20ee('0x53')]};_0x208262[_0x20ee('0x23')](_0x178e2b);}}_0x11eb6d({'count':_0x208262[_0x20ee('0x1a')],'rows':_0x208262});});},'SmsQueues':function(_0x169436){return new Promise(function(_0x595766,_0x4639c4){var _0x4d7b9b=[];for(var _0xa06c4c in _0x2c47a1[_0x20ee('0x55')]){if(_0x2c47a1[_0x20ee('0x55')][_0x20ee('0x47')](_0xa06c4c)){var _0x53b44c=_0x2c47a1[_0x20ee('0x55')][_0xa06c4c];var _0x157d96={'id':_0x53b44c['id'],'available':_0x53b44c[_0x20ee('0x4e')],'loggedIn':_0x53b44c[_0x20ee('0x4f')],'name':_0x53b44c['name'],'paused':_0x53b44c[_0x20ee('0x51')],'waiting':_0x53b44c[_0x20ee('0x53')]};_0x4d7b9b[_0x20ee('0x23')](_0x157d96);}}_0x595766({'count':_0x4d7b9b[_0x20ee('0x1a')],'rows':_0x4d7b9b});});},'FaxQueues':function(_0x2e6c56){return new Promise(function(_0xb6bd,_0x32239d){var _0x35945c=[];for(var _0x34dd7f in _0x2c47a1[_0x20ee('0x56')]){if(_0x2c47a1['faxQueues'][_0x20ee('0x47')](_0x34dd7f)){var _0x143903=_0x2c47a1[_0x20ee('0x56')][_0x34dd7f];var _0x410551={'id':_0x143903['id'],'available':_0x143903['available'],'loggedIn':_0x143903[_0x20ee('0x4f')],'name':_0x143903[_0x20ee('0x50')],'paused':_0x143903[_0x20ee('0x51')],'waiting':_0x143903['waiting']};_0x35945c[_0x20ee('0x23')](_0x410551);}}_0xb6bd({'count':_0x35945c[_0x20ee('0x1a')],'rows':_0x35945c});});},'WhatsappQueues':function(_0x44a564){return new Promise(function(_0x3ac755,_0x3a0f8f){var _0x2d68dd=[];for(var _0x57f117 in _0x2c47a1[_0x20ee('0x57')]){if(_0x2c47a1[_0x20ee('0x57')]['hasOwnProperty'](_0x57f117)){var _0x2c289e=_0x2c47a1[_0x20ee('0x57')][_0x57f117];var _0x5d0df3={'id':_0x2c289e['id'],'available':_0x2c289e[_0x20ee('0x4e')],'loggedIn':_0x2c289e[_0x20ee('0x4f')],'name':_0x2c289e[_0x20ee('0x50')],'paused':_0x2c289e[_0x20ee('0x51')],'waiting':_0x2c289e['waiting']};_0x2d68dd[_0x20ee('0x23')](_0x5d0df3);}}_0x3ac755({'count':_0x2d68dd[_0x20ee('0x1a')],'rows':_0x2d68dd});});},'ChatQueuesWaitingInteractions':function(_0x5d2321){return new Promise(function(_0x379daa,_0x5a0f00){var _0x39ffe8=_[_0x20ee('0x4c')](_0x2c47a1[_0x20ee('0x58')]);_0x379daa({'count':_0x39ffe8[_0x20ee('0x1a')],'rows':_0x39ffe8});});},'MailQueuesWaitingInteractions':function(_0x2a56f0){return new Promise(function(_0xc0c74c,_0xe12dd6){var _0x31bf03=_[_0x20ee('0x4c')](_0x2c47a1[_0x20ee('0x59')]);_0xc0c74c({'count':_0x31bf03['length'],'rows':_0x31bf03});});},'OpenchannelQueuesWaitingInteractions':function(_0x5cc514){return new Promise(function(_0x57a144,_0x4977eb){var _0x21487c=_[_0x20ee('0x4c')](_0x2c47a1['openchannelQueuesWaitingInteractions']);_0x57a144({'count':_0x21487c[_0x20ee('0x1a')],'rows':_0x21487c});});},'SmsQueuesWaitingInteractions':function(_0x52707d){return new Promise(function(_0x25a08c,_0x530203){var _0x197713=_[_0x20ee('0x4c')](_0x2c47a1['smsQueuesWaitingInteractions']);_0x25a08c({'count':_0x197713[_0x20ee('0x1a')],'rows':_0x197713});});},'FaxQueuesWaitingInteractions':function(_0x363379){return new Promise(function(_0x584227,_0x4172ff){var _0x5da4d1=_[_0x20ee('0x4c')](_0x2c47a1[_0x20ee('0x5a')]);_0x584227({'count':_0x5da4d1['length'],'rows':_0x5da4d1});});},'WhatsappQueuesWaitingInteractions':function(_0x5a313b){return new Promise(function(_0x8bddd7,_0x865ab2){var _0x151882=_[_0x20ee('0x4c')](_0x2c47a1[_0x20ee('0x5b')]);_0x8bddd7({'count':_0x151882['length'],'rows':_0x151882});});}};var _0x245738=jayson['server'](_0x37ff39)[_0x20ee('0x5c')]();_0x245738['on'](_0x20ee('0x31'),function(_0x10dddc){logger[_0x20ee('0x31')](JSON[_0x20ee('0x36')](_0x10dddc));return _0xe08357(_0x10dddc);});_0x245738[_0x20ee('0x14')](0x232c,_0x20ee('0x5d'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2c21e4(_0x20ee('0x5e')+0x232c);});});};
\ No newline at end of file
+var _0x2867=['smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','channel','message','interaction','applications','length','join','app','toLowerCase','autoreply','appdata','mail','push','slice','dialogflow','split','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','Applications\x20executed','stringify','rules','emit','complete','stack','agent','agents','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x2867,0xc5));var _0x7286=function(_0x5a8442,_0x2b3948){_0x5a8442=_0x5a8442-0x0;var _0x37b32f=_0x2867[_0x5a8442];return _0x37b32f;};'use strict';var _=require(_0x7286('0x0'));var util=require(_0x7286('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x7286('0x2'));var BPromise=require(_0x7286('0x3'));var uuid=require(_0x7286('0x4'));var config=require(_0x7286('0x5'));var logger=require('../../../config/logger')(_0x7286('0x6'));var rpc={'openchannelQueueReport':require(_0x7286('0x7')),'mailQueueReport':require(_0x7286('0x8')),'chatQueueReport':require(_0x7286('0x9')),'smsQueueReport':require(_0x7286('0xa')),'faxQueueReport':require(_0x7286('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x7286('0xc'));function getId(_0x4c1dcb,_0xfd5ebc,_0x3b8f82){return util[_0x7286('0xd')](_0x7286('0xe'),_0x4c1dcb,_0xfd5ebc||0x0,_0x3b8f82||0x0);}function getIntervals(_0x4e7b27,_0x263b50){var _0x3a1191=[];if(!_[_0x7286('0xf')](_0x263b50[_0x7286('0x10')])&&!_[_0x7286('0xf')](_0x4e7b27[_0x263b50[_0x7286('0x10')]])&&!_[_0x7286('0xf')](_0x4e7b27[_0x263b50['IntervalId']]['Intervals'])){_0x3a1191=_[_0x7286('0x11')](_0x4e7b27[_0x263b50[_0x7286('0x10')]][_0x7286('0x12')],_0x7286('0x13'));}else if(!_['isNil'](_0x263b50[_0x7286('0x13')])){_0x3a1191=[_0x263b50[_0x7286('0x13')]];}return _0x3a1191;}exports['listen']=function(_0x6d8446){_0x6d8446['rules']={};return new BPromise(function(_0x3d913f,_0x336c31){var _0x4a093d={'Start':function(_0x36b7cb){var _0xd4e1c8=this;return new Promise(function(_0x4dfaa6,_0x4a5b58){if(_0x36b7cb){try{var _0x57feb3=[];var _0x3777b8=getId(_0x36b7cb[_0x7286('0x14')],_0x36b7cb['message']?_0x36b7cb[_0x7286('0x15')]['id']:0x0,_0x36b7cb[_0x7286('0x16')]?_0x36b7cb[_0x7286('0x16')]['id']:0x0);if(_0x36b7cb['applications']&&_['isArray'](_0x36b7cb[_0x7286('0x17')])&&_0x36b7cb[_0x7286('0x17')][_0x7286('0x18')]){for(var _0x29d5f6=0x0;_0x29d5f6<_0x36b7cb[_0x7286('0x17')]['length'];_0x29d5f6+=0x1){var _0xf8e96e=_0x36b7cb[_0x7286('0x17')][_0x29d5f6];if(fs['existsSync'](path[_0x7286('0x19')](__dirname,_0x7286('0x17'),_0xf8e96e[_0x7286('0x1a')]+'.js'))){var _0x112f7d=[];switch(_0xf8e96e['app'][_0x7286('0x1b')]()){case _0x7286('0x1c'):var _0x5907d2=_0xf8e96e[_0x7286('0x1d')]['split'](',');if(_0x36b7cb[_0x7286('0x14')]===_0x7286('0x1e')){_0x112f7d['push'](_0x5907d2[0x0]);_0x112f7d[_0x7286('0x1f')](_0x5907d2[0x1]);_0x112f7d[_0x7286('0x1f')](_0x5907d2[_0x7286('0x20')](0x2,_0x5907d2['length'])[_0x7286('0x19')](','));}else{_0x112f7d['push'](_0x5907d2[0x0]);_0x112f7d[_0x7286('0x1f')](_0x5907d2['slice'](0x1,_0x5907d2[_0x7286('0x18')])[_0x7286('0x19')](','));}break;case _0x7286('0x21'):var _0x2dfff0=_0xf8e96e[_0x7286('0x1d')]['split'](',');_0x112f7d['push'](_0x2dfff0[0x0]);_0x112f7d[_0x7286('0x1f')](_0x2dfff0[0x1]);_0x112f7d['push'](_0x2dfff0[_0x7286('0x20')](0x2,_0x2dfff0[_0x7286('0x18')])[_0x7286('0x19')](','));break;case'dialogflowv2':var _0x187db4=_0xf8e96e[_0x7286('0x1d')][_0x7286('0x22')](',');_0x112f7d[_0x7286('0x1f')](_0x187db4[0x0]);_0x112f7d[_0x7286('0x1f')](_0x187db4[0x1]);_0x112f7d['push'](_0x187db4[0x2]);_0x112f7d[_0x7286('0x1f')](_0x187db4[0x3]);_0x112f7d[_0x7286('0x1f')](_0x187db4[_0x7286('0x20')](0x4,_0x187db4['length'])[_0x7286('0x19')](','));break;case _0x7286('0x23'):var _0x438037=_0xf8e96e['appdata']['split'](',');_0x112f7d[_0x7286('0x1f')](_0x438037[0x0]);_0x112f7d[_0x7286('0x1f')](_0x438037[0x1]);_0x112f7d[_0x7286('0x1f')](_0x438037[0x2]);_0x112f7d[_0x7286('0x1f')](_0x438037[0x3]);_0x112f7d[_0x7286('0x1f')](_0x438037[_0x7286('0x20')](0x4,_0x438037[_0x7286('0x18')])['join'](','));break;case'message':_0x112f7d['push'](_0xf8e96e['appdata']);break;case'tag':_0x112f7d[_0x7286('0x1f')](_0xf8e96e[_0x7286('0x24')]);_0x112f7d[_0x7286('0x1f')](_0xf8e96e[_0x7286('0x1d')]);break;default:_0x112f7d=_[_0x7286('0xf')](_0xf8e96e[_0x7286('0x1d')])?[]:_0xf8e96e[_0x7286('0x1d')][_0x7286('0x22')](',');}var _0x4d85c5={'id':util[_0x7286('0xd')](_0x7286('0x25'),_0x3777b8,_0xf8e96e['id'],_0xf8e96e[_0x7286('0x1a')]),'condition':require(_0x7286('0x26'))[_0x7286('0x27')](_0x3777b8,getIntervals(_0x6d8446[_0x7286('0x28')],_0xf8e96e),_0x6d8446),'consequence':require(_0x7286('0x29')+_0xf8e96e[_0x7286('0x1a')])[_0x7286('0x2a')](_0x3777b8,_0x112f7d,_0x6d8446,_0x36b7cb),'p':_0xf8e96e[_0x7286('0x2b')]||0x0};logger[_0x7286('0x2c')](_0x7286('0x2d'),_0x4d85c5['id'],_0x7286('0x2e'),getIntervals(_0x6d8446['intervals'],_0xf8e96e)[_0x7286('0x19')](_0x7286('0x2f')));_0x57feb3['push'](_0x4d85c5);}else{logger[_0x7286('0x30')](_0x7286('0x31'),path[_0x7286('0x19')](__dirname,_0x7286('0x17'),_0xf8e96e['app']+_0x7286('0x32')));}}_0x6d8446['rules'][_0x3777b8]=new RuleEngine(_0x57feb3);_0x6d8446['rules'][_0x3777b8]['execute'](_0x36b7cb,function(_0x4ae30a){logger[_0x7286('0x2c')](_0x7286('0x33'),JSON[_0x7286('0x34')](_0x4ae30a['matchPath']));if(_0x6d8446[_0x7286('0x35')][_0x3777b8]){_0x6d8446[_0x7286('0x35')][_0x3777b8][_0x7286('0x36')](_0x7286('0x37'));}});return _0x4dfaa6({'code':0xc8,'message':_0x36b7cb});}else{logger[_0x7286('0x2c')]('No\x20applications\x20to\x20execute');return _0x4dfaa6({'code':0xc8,'message':_0x36b7cb});}}catch(_0x5b2e47){logger['error'](_0x5b2e47[_0x7286('0x38')]);return _0x4a5b58(_0xd4e1c8[_0x7286('0x30')](0x1f4,_0x5b2e47));}}return _0x4a5b58('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5ee587){var _0x2c8da1=this;return new Promise(function(_0x717f7f,_0x210e0d){if(_0x5ee587[_0x7286('0x39')]&&_0x5ee587['agent']['id']){if(_0x6d8446[_0x7286('0x3a')][_0x5ee587[_0x7286('0x39')]['id']]){_0x6d8446[_0x7286('0x3a')][_0x5ee587[_0x7286('0x39')]['id']]['busy']=![];_0x6d8446[_0x7286('0x3a')][_0x5ee587[_0x7286('0x39')]['id']][_0x7286('0x3b')]=undefined;}}if(_0x5ee587[_0x7286('0x15')]&&_0x5ee587[_0x7286('0x15')]['id']){try{var _0x4278a2=getId(_0x5ee587[_0x7286('0x14')],_0x5ee587['message']?_0x5ee587[_0x7286('0x15')]['id']:0x0,_0x5ee587[_0x7286('0x16')]?_0x5ee587['interaction']['id']:0x0);if(_0x6d8446[_0x7286('0x35')][_0x4278a2]){_0x6d8446['rules'][_0x4278a2][_0x7286('0x36')](_0x7286('0x3c'));if(rpc[_0x5ee587[_0x7286('0x14')]+_0x7286('0x3d')]){rpc[_0x5ee587[_0x7286('0x14')]+'QueueReport'][_0x7286('0x3e')](_0x4278a2,{'UserId':_0x5ee587[_0x7286('0x15')]['UserId']})[_0x7286('0x3f')](function(_0xeaa242){logger[_0x7286('0x30')](_0x7286('0x40'));});}}return _0x717f7f({'code':0xc8,'message':_0x5ee587});}catch(_0x3e2c8a){logger[_0x7286('0x30')](_0x3e2c8a[_0x7286('0x38')]);return _0x210e0d(_0x2c8da1[_0x7286('0x30')](0x1f4,_0x3e2c8a));}}logger[_0x7286('0x30')](_0x7286('0x41'));return _0x210e0d(_0x2c8da1[_0x7286('0x30')](0x1f4,_0x7286('0x41')));});},'RejectMessage':function(_0xfd5aac){var _0x7c8251=this;return new Promise(function(_0x3e9f62,_0x27d3d8){if(_0xfd5aac['agent']&&_0xfd5aac['agent']['id']){try{if(_0x6d8446[_0x7286('0x3a')][_0xfd5aac[_0x7286('0x39')]['id']]){_0x6d8446[_0x7286('0x3a')][_0xfd5aac[_0x7286('0x39')]['id']][_0x7286('0x42')]=![];_0x6d8446[_0x7286('0x3a')][_0xfd5aac['agent']['id']][_0x7286('0x3b')]=undefined;}return _0x3e9f62({'code':0xc8,'message':_0xfd5aac});}catch(_0x3077c2){logger[_0x7286('0x30')](_0x3077c2[_0x7286('0x38')]);return _0x27d3d8(_0x7c8251[_0x7286('0x30')](0x1f4,_0x3077c2));}}logger['error'](_0x7286('0x41'));return _0x27d3d8(_0x7c8251[_0x7286('0x30')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5f45dd){var _0x313898=this;return new Promise(function(_0x1b5d6f,_0x5d1e46){if(_0x5f45dd[_0x7286('0x14')]&&_0x5f45dd['interaction']&&_0x5f45dd[_0x7286('0x16')]['id']){try{var _0x2cfbb0=getId(_0x5f45dd[_0x7286('0x14')],_0x5f45dd[_0x7286('0x15')]?_0x5f45dd[_0x7286('0x15')]['id']:0x0,_0x5f45dd['interaction']?_0x5f45dd['interaction']['id']:0x0);if(_0x6d8446[_0x7286('0x35')][_0x2cfbb0]){_0x6d8446[_0x7286('0x35')][_0x2cfbb0][_0x7286('0x36')](_0x7286('0x3c'));}return _0x1b5d6f({'code':0xc8,'message':_0x5f45dd});}catch(_0x8bc628){logger[_0x7286('0x30')](_0x8bc628[_0x7286('0x38')]);return _0x5d1e46(_0x313898[_0x7286('0x30')](0x1f4,_0x8bc628));}}logger['error'](_0x7286('0x41'));return _0x5d1e46(_0x313898[_0x7286('0x30')](0x1f4,_0x7286('0x41')));});},'AgentCapacity':function(_0x279c9d){var _0x5f5109=this;return new Promise(function(_0x2573af,_0xe265aa){if(_0x6d8446[_0x7286('0x3a')][_0x7286('0x43')](_0x279c9d['id'])){for(var _0x4293e3 in _0x279c9d[_0x7286('0x44')]){if(_0x279c9d[_0x7286('0x44')][_0x7286('0x43')](_0x4293e3)){if(_0x6d8446[_0x7286('0x3a')][_0x279c9d['id']]['hasOwnProperty'](_0x4293e3+_0x7286('0x45'))){_0x6d8446[_0x7286('0x3a')][_0x279c9d['id']][_0x4293e3+_0x7286('0x45')]=parseInt(_0x279c9d[_0x7286('0x44')][_0x4293e3],0xa);}}}_0x6d8446[_0x7286('0x3a')][_0x279c9d['id']][_0x7286('0x46')]();return _0x2573af({'code':0xc8,'message':_0x6d8446['agents'][_0x279c9d['id']]});}else{return _0xe265aa(_0x5f5109[_0x7286('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x16e9cf){return new Promise(function(_0x57fe0c,_0x11f9e1){var _0x1048df=_['values'](_0x6d8446['agents']);_0x57fe0c({'count':_0x1048df[_0x7286('0x18')],'rows':_0x1048df});});},'ChatQueues':function(_0x109617){return new Promise(function(_0x5c6531,_0x3d7f26){var _0x2819b4=[];for(var _0x126ec7 in _0x6d8446['chatQueues']){if(_0x6d8446[_0x7286('0x47')][_0x7286('0x43')](_0x126ec7)){var _0x560f32=_0x6d8446[_0x7286('0x47')][_0x126ec7];var _0x5b25a0={'id':_0x560f32['id'],'available':_0x560f32[_0x7286('0x48')],'loggedIn':_0x560f32[_0x7286('0x49')],'name':_0x560f32[_0x7286('0x4a')],'paused':_0x560f32[_0x7286('0x4b')],'waiting':_0x560f32['waiting']};_0x2819b4['push'](_0x5b25a0);}}_0x5c6531({'count':_0x2819b4[_0x7286('0x18')],'rows':_0x2819b4});});},'MailQueues':function(_0x135267){return new Promise(function(_0x77f60e,_0x29e300){var _0x5abac6=[];for(var _0x5ec74a in _0x6d8446[_0x7286('0x4c')]){if(_0x6d8446[_0x7286('0x4c')]['hasOwnProperty'](_0x5ec74a)){var _0x27f32d=_0x6d8446[_0x7286('0x4c')][_0x5ec74a];var _0x4f3896={'id':_0x27f32d['id'],'available':_0x27f32d[_0x7286('0x48')],'loggedIn':_0x27f32d[_0x7286('0x49')],'name':_0x27f32d[_0x7286('0x4a')],'paused':_0x27f32d['paused'],'waiting':_0x27f32d['waiting']};_0x5abac6['push'](_0x4f3896);}}_0x77f60e({'count':_0x5abac6[_0x7286('0x18')],'rows':_0x5abac6});});},'OpenchannelQueues':function(_0x48e035){return new Promise(function(_0x389a19,_0x4676b1){var _0x1cac2c=[];for(var _0x1f4ee2 in _0x6d8446['openchannelQueues']){if(_0x6d8446[_0x7286('0x4d')]['hasOwnProperty'](_0x1f4ee2)){var _0x565479=_0x6d8446[_0x7286('0x4d')][_0x1f4ee2];var _0x32cf52={'id':_0x565479['id'],'available':_0x565479[_0x7286('0x48')],'loggedIn':_0x565479[_0x7286('0x49')],'name':_0x565479[_0x7286('0x4a')],'paused':_0x565479[_0x7286('0x4b')],'waiting':_0x565479[_0x7286('0x4e')]};_0x1cac2c[_0x7286('0x1f')](_0x32cf52);}}_0x389a19({'count':_0x1cac2c[_0x7286('0x18')],'rows':_0x1cac2c});});},'SmsQueues':function(_0x4de83b){return new Promise(function(_0x1c9dfa,_0x11ccb9){var _0x26077f=[];for(var _0x357e49 in _0x6d8446[_0x7286('0x4f')]){if(_0x6d8446[_0x7286('0x4f')][_0x7286('0x43')](_0x357e49)){var _0x5ce092=_0x6d8446['smsQueues'][_0x357e49];var _0x1b03e2={'id':_0x5ce092['id'],'available':_0x5ce092[_0x7286('0x48')],'loggedIn':_0x5ce092[_0x7286('0x49')],'name':_0x5ce092[_0x7286('0x4a')],'paused':_0x5ce092[_0x7286('0x4b')],'waiting':_0x5ce092[_0x7286('0x4e')]};_0x26077f['push'](_0x1b03e2);}}_0x1c9dfa({'count':_0x26077f[_0x7286('0x18')],'rows':_0x26077f});});},'FaxQueues':function(_0x3f619b){return new Promise(function(_0x14eeae,_0x2fcb29){var _0x2c0cf4=[];for(var _0x1b539b in _0x6d8446[_0x7286('0x50')]){if(_0x6d8446[_0x7286('0x50')][_0x7286('0x43')](_0x1b539b)){var _0x571aa2=_0x6d8446[_0x7286('0x50')][_0x1b539b];var _0x1360f8={'id':_0x571aa2['id'],'available':_0x571aa2[_0x7286('0x48')],'loggedIn':_0x571aa2[_0x7286('0x49')],'name':_0x571aa2[_0x7286('0x4a')],'paused':_0x571aa2[_0x7286('0x4b')],'waiting':_0x571aa2[_0x7286('0x4e')]};_0x2c0cf4[_0x7286('0x1f')](_0x1360f8);}}_0x14eeae({'count':_0x2c0cf4[_0x7286('0x18')],'rows':_0x2c0cf4});});},'WhatsappQueues':function(_0x3e7aab){return new Promise(function(_0x799f62,_0x431a20){var _0x5e09a8=[];for(var _0xfd074b in _0x6d8446[_0x7286('0x51')]){if(_0x6d8446[_0x7286('0x51')][_0x7286('0x43')](_0xfd074b)){var _0x1fdda6=_0x6d8446[_0x7286('0x51')][_0xfd074b];var _0x8d80df={'id':_0x1fdda6['id'],'available':_0x1fdda6[_0x7286('0x48')],'loggedIn':_0x1fdda6[_0x7286('0x49')],'name':_0x1fdda6[_0x7286('0x4a')],'paused':_0x1fdda6[_0x7286('0x4b')],'waiting':_0x1fdda6[_0x7286('0x4e')]};_0x5e09a8['push'](_0x8d80df);}}_0x799f62({'count':_0x5e09a8['length'],'rows':_0x5e09a8});});},'ChatQueuesWaitingInteractions':function(_0x140799){return new Promise(function(_0x5b6721,_0x1f617f){var _0x45d23a=_['values'](_0x6d8446[_0x7286('0x52')]);_0x5b6721({'count':_0x45d23a['length'],'rows':_0x45d23a});});},'MailQueuesWaitingInteractions':function(_0x5b9ffe){return new Promise(function(_0x33dac7,_0x23ed02){var _0x5810b4=_['values'](_0x6d8446['mailQueuesWaitingInteractions']);_0x33dac7({'count':_0x5810b4[_0x7286('0x18')],'rows':_0x5810b4});});},'OpenchannelQueuesWaitingInteractions':function(_0x4c80f1){return new Promise(function(_0x13237e,_0x56e6dd){var _0x52a1a4=_[_0x7286('0x53')](_0x6d8446['openchannelQueuesWaitingInteractions']);_0x13237e({'count':_0x52a1a4[_0x7286('0x18')],'rows':_0x52a1a4});});},'SmsQueuesWaitingInteractions':function(_0x5f346b){return new Promise(function(_0x5f4284,_0x407a0b){var _0x10dd5d=_[_0x7286('0x53')](_0x6d8446[_0x7286('0x54')]);_0x5f4284({'count':_0x10dd5d['length'],'rows':_0x10dd5d});});},'FaxQueuesWaitingInteractions':function(_0x1b3600){return new Promise(function(_0xe6c43f,_0x16fb1e){var _0x4b1157=_['values'](_0x6d8446[_0x7286('0x55')]);_0xe6c43f({'count':_0x4b1157[_0x7286('0x18')],'rows':_0x4b1157});});},'WhatsappQueuesWaitingInteractions':function(_0x40d13e){return new Promise(function(_0x4004dd,_0x4ca395){var _0x22573e=_['values'](_0x6d8446[_0x7286('0x56')]);_0x4004dd({'count':_0x22573e[_0x7286('0x18')],'rows':_0x22573e});});}};var _0x1b8f1a=jayson['server'](_0x4a093d)['http']();_0x1b8f1a['on']('error',function(_0xbd37e0){logger[_0x7286('0x30')](JSON['stringify'](_0xbd37e0));return _0x336c31(_0xbd37e0);});_0x1b8f1a[_0x7286('0x57')](0x232c,_0x7286('0x58'),function(){console[_0x7286('0x59')](_0x7286('0x5a'),0x232c);return _0x3d913f(_0x7286('0x5b')+0x232c);});});};
\ No newline at end of file
index a22dc42..08f1dc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x549b=['[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','some'];(function(_0x1f2f3a,_0x2d3138){var _0x4fce0f=function(_0x40b98e){while(--_0x40b98e){_0x1f2f3a['push'](_0x1f2f3a['shift']());}};_0x4fce0f(++_0x2d3138);}(_0x549b,0x1d7));var _0xb549=function(_0x5cbfed,_0x2b8ba5){_0x5cbfed=_0x5cbfed-0x0;var _0x462d98=_0x549b[_0x5cbfed];return _0x462d98;};'use strict';var util=require(_0xb549('0x0'));var BPromise=require(_0xb549('0x1'));var jayson=require('jayson/promise');var _=require(_0xb549('0x2'));var logger=require(_0xb549('0x3'))(_0xb549('0x4'));var client=jayson[_0xb549('0x5')][_0xb549('0x6')]({'port':0x232a});function request(_0x55823a,_0x204c6){return new BPromise(function(_0x9538f7,_0x238afd){return client['request'](_0x55823a,_0x204c6)[_0xb549('0x7')](function(_0x28ca2b){if(_0x28ca2b['error']){return _0x238afd(_0x28ca2b[_0xb549('0x8')][_0xb549('0x9')]);}else{return _0x9538f7(_0x28ca2b[_0xb549('0xa')]);}})[_0xb549('0xb')](function(_0x54dcfe){return _0x238afd(_0x54dcfe);});});}exports['condition']=function(_0x10edee,_0x4bc606,_0x51c241){return function(_0x3d036c){if(_0x51c241[_0xb549('0xc')]&&!_0x51c241[_0xb549('0xc')][_0x10edee]){logger[_0xb549('0xd')](_0xb549('0xe'),_0x10edee);return _0x3d036c[_0xb549('0xf')]();}var _0x3e8456=[];for(var _0x288de9=0x0;_0x288de9<_0x4bc606[_0xb549('0x10')];_0x288de9+=0x1){_0x3e8456[_0xb549('0x11')](request(_0xb549('0x12'),{'command':util[_0xb549('0x13')](_0xb549('0x14'),_0x4bc606[_0x288de9])})[_0xb549('0x7')](function(_0x3ea9a3){return _0x3ea9a3&&_0x3ea9a3[_0xb549('0x9')]&&_0x3ea9a3[_0xb549('0x9')][_0xb549('0x15')](_0xb549('0x16'))>=0x0?!![]:![];})[_0xb549('0xb')](function(_0x5b24a8){logger[_0xb549('0x8')]('[%s][INTERVAL]\x20%s',_0x10edee,_0x4bc606[_0x288de9]);}));}BPromise[_0xb549('0x17')](_0x3e8456)[_0xb549('0x7')](function(_0x28d237){var _0x37451f=_[_0xb549('0x18')](_0x28d237);logger['info'](_0xb549('0x19'),_0x10edee,_0x4bc606['join'](_0xb549('0x1a')),_0x37451f);_0x3d036c[_0xb549('0x1b')](_0x37451f);})[_0xb549('0xb')](function(_0x5bf48c){console[_0xb549('0x1c')](_0x5bf48c);logger['error'](_0xb549('0x19'),_0x10edee,_0x4bc606[_0xb549('0x1d')](_0xb549('0x1a')),_0x5bf48c[_0xb549('0x1e')]);_0x3d036c['stop']();});};};
\ No newline at end of file
+var _0xea13=['lodash','routing','client','http','request','then','error','message','catch','condition','rules','info','length','push','format','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','jayson/promise'];(function(_0x59943d,_0x2e751b){var _0x46ace9=function(_0xfbd5f2){while(--_0xfbd5f2){_0x59943d['push'](_0x59943d['shift']());}};_0x46ace9(++_0x2e751b);}(_0xea13,0xe5));var _0x3ea1=function(_0x1653b6,_0x5724fb){_0x1653b6=_0x1653b6-0x0;var _0x2d0828=_0xea13[_0x1653b6];return _0x2d0828;};'use strict';var util=require(_0x3ea1('0x0'));var BPromise=require(_0x3ea1('0x1'));var jayson=require(_0x3ea1('0x2'));var _=require(_0x3ea1('0x3'));var logger=require('../../../config/logger')(_0x3ea1('0x4'));var client=jayson[_0x3ea1('0x5')][_0x3ea1('0x6')]({'port':0x232a});function request(_0x495624,_0x4c68ae){return new BPromise(function(_0x1e2050,_0x2b80bc){return client[_0x3ea1('0x7')](_0x495624,_0x4c68ae)[_0x3ea1('0x8')](function(_0x23cdb6){if(_0x23cdb6[_0x3ea1('0x9')]){return _0x2b80bc(_0x23cdb6['error'][_0x3ea1('0xa')]);}else{return _0x1e2050(_0x23cdb6['result']);}})[_0x3ea1('0xb')](function(_0x3f8710){return _0x2b80bc(_0x3f8710);});});}exports[_0x3ea1('0xc')]=function(_0x336ac4,_0x1dee25,_0x1e4c74){return function(_0xfe2bb1){if(_0x1e4c74[_0x3ea1('0xd')]&&!_0x1e4c74[_0x3ea1('0xd')][_0x336ac4]){logger[_0x3ea1('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x336ac4);return _0xfe2bb1['stop']();}var _0x25f214=[];for(var _0xee10c8=0x0;_0xee10c8<_0x1dee25[_0x3ea1('0xf')];_0xee10c8+=0x1){_0x25f214[_0x3ea1('0x10')](request('Command',{'command':util[_0x3ea1('0x11')]('iftime\x20%s',_0x1dee25[_0xee10c8])})[_0x3ea1('0x8')](function(_0x11f000){return _0x11f000&&_0x11f000[_0x3ea1('0xa')]&&_0x11f000[_0x3ea1('0xa')][_0x3ea1('0x12')]('true')>=0x0?!![]:![];})[_0x3ea1('0xb')](function(_0x5b5412){logger[_0x3ea1('0x9')](_0x3ea1('0x13'),_0x336ac4,_0x1dee25[_0xee10c8]);}));}BPromise[_0x3ea1('0x14')](_0x25f214)[_0x3ea1('0x8')](function(_0x24e617){var _0x13a535=_[_0x3ea1('0x15')](_0x24e617);logger[_0x3ea1('0xe')](_0x3ea1('0x16'),_0x336ac4,_0x1dee25[_0x3ea1('0x17')](_0x3ea1('0x18')),_0x13a535);_0xfe2bb1[_0x3ea1('0x19')](_0x13a535);})[_0x3ea1('0xb')](function(_0x25d6b8){console[_0x3ea1('0x1a')](_0x25d6b8);logger[_0x3ea1('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x336ac4,_0x1dee25[_0x3ea1('0x17')](_0x3ea1('0x18')),_0x25d6b8[_0x3ea1('0x1b')]);_0xfe2bb1[_0x3ea1('0x1c')]();});};};
\ No newline at end of file
index 2bd9acb..cee9285 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','ringtime','push','error','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','extension','transferuniqueid','[%s][agents][blindtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transferexten','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','complete','lodash','./utils','format','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','called','info'];(function(_0x21cda7,_0x4a224f){var _0x19d01f=function(_0xf3f092){while(--_0xf3f092){_0x21cda7['push'](_0x21cda7['shift']());}};_0x19d01f(++_0x4a224f);}(_0x351d,0x90));var _0xd351=function(_0x59f03c,_0x37f572){_0x59f03c=_0x59f03c-0x0;var _0x56fdea=_0x351d[_0x59f03c];return _0x56fdea;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var utils=require(_0xd351('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2aa5fd,_0x340931){utils['info'](util[_0xd351('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2aa5fd[_0xd351('0x3')],_0x2aa5fd[_0xd351('0x4')],_0x2aa5fd['queue'],_0x2aa5fd[_0xd351('0x5')],_0x2aa5fd[_0xd351('0x6')],_0x2aa5fd[_0xd351('0x7')],_0x2aa5fd['connectedlinenum'],_0x2aa5fd[_0xd351('0x8')]));if(_0x2aa5fd[_0xd351('0x9')]){utils['getVoiceQueueByName'](_0x2aa5fd[_0xd351('0x9')])[_0xd351('0xa')](function(_0x51c5f4){if(_0x51c5f4){_0x2aa5fd['type']=_0x51c5f4[_0xd351('0xb')];_0x2aa5fd['agentacw']=_0x2aa5fd[_0xd351('0xc')]?_0x51c5f4[_0xd351('0xd')]:![];_0x2aa5fd['acwtime']=_0x2aa5fd[_0xd351('0xe')]?_0x51c5f4[_0xd351('0xf')]:0x0;}utils['request'](_0xd351('0x10'),_0x2aa5fd);});}else{utils['request']('CreateVoiceAgentReport',_0x2aa5fd);}if(_0x340931){delete transfers[_0x2aa5fd[_0xd351('0x3')]];}else{delete agents[_0x2aa5fd[_0xd351('0x11')]];}}exports[_0xd351('0x12')]=function(_0x1eb2a9){try{utils['debug'](util[_0xd351('0x2')](_0xd351('0x13'),_0x1eb2a9['uniqueid']),_0x1eb2a9);agents[_0x1eb2a9[_0xd351('0x11')]]=_0x1eb2a9;agents[_0x1eb2a9[_0xd351('0x11')]][_0xd351('0x14')]=utils[_0xd351('0x15')]();agents[_0x1eb2a9[_0xd351('0x11')]]['lastevent']=_0xd351('0x16');agents[_0x1eb2a9['destuniqueid']]['connectedlinenum']=null;agents[_0x1eb2a9[_0xd351('0x11')]]['connectedlinename']=null;utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x18'),_0x1eb2a9['uniqueid'],agents[_0x1eb2a9[_0xd351('0x11')]][_0xd351('0x5')],_0x1eb2a9[_0xd351('0x11')]));}catch(_0x12b5aa){utils['error'](util[_0xd351('0x2')]('[%s][agents][agentcalled]',_0x1eb2a9['uniqueid']),_0x12b5aa);}};exports[_0xd351('0x19')]=function(_0x4a427b){try{if(!_[_0xd351('0x1a')](agents[_0x4a427b[_0xd351('0x11')]])){utils[_0xd351('0x1b')](util[_0xd351('0x2')](_0xd351('0x1c'),_0x4a427b['uniqueid']),_0x4a427b);utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x1d'),_0x4a427b['uniqueid'],agents[_0x4a427b[_0xd351('0x11')]][_0xd351('0x5')],_0x4a427b[_0xd351('0x11')]));agents[_0x4a427b['destuniqueid']][_0xd351('0x19')]=!![];agents[_0x4a427b[_0xd351('0x11')]][_0xd351('0x1e')]=utils[_0xd351('0x15')]();agents[_0x4a427b['destuniqueid']][_0xd351('0x8')]='timeout';agents[_0x4a427b[_0xd351('0x11')]][_0xd351('0x1f')]='timeout';agents[_0x4a427b[_0xd351('0x11')]]['holdtime']=_0x4a427b['ringtime']?parseInt(_0x4a427b[_0xd351('0x20')])/0x3e8:0x0;agents[_0x4a427b['destuniqueid']]['talktime']=0x0;unanswered[_0xd351('0x21')](_0x4a427b['destuniqueid']);}}catch(_0x38471c){utils[_0xd351('0x22')](util[_0xd351('0x2')]('[%s][agents][agentringnoanswer]',_0x4a427b[_0xd351('0x3')]),_0x38471c);}};exports['queuecallerabandon']=function(_0x1c826b){try{_['forIn'](agents,function(_0x5f07b1,_0xeb4da9){if(_0x5f07b1[_0xd351('0x3')]==_0x1c826b[_0xd351('0x3')]&&!_[_0xd351('0x23')](unanswered,_0x5f07b1['destuniqueid'])){utils[_0xd351('0x1b')](util[_0xd351('0x2')](_0xd351('0x24'),_0x1c826b[_0xd351('0x3')]),_0x1c826b);utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x25'),_0x1c826b[_0xd351('0x3')],_0x5f07b1[_0xd351('0x5')],_0x5f07b1['destuniqueid']));_0x5f07b1[_0xd351('0x19')]=!![];_0x5f07b1[_0xd351('0x1e')]=utils[_0xd351('0x15')]();_0x5f07b1[_0xd351('0x8')]='abandoned';_0x5f07b1[_0xd351('0x1f')]=_0xd351('0x26');_0x5f07b1[_0xd351('0x27')]=_0x1c826b[_0xd351('0x27')];_0x5f07b1[_0xd351('0x28')]=0x0;writeDB(_0x5f07b1);}});}catch(_0x37fbb8){utils[_0xd351('0x22')](util[_0xd351('0x2')](_0xd351('0x24'),_0x1c826b['uniqueid']),_0x37fbb8);}};exports['agentconnect']=function(_0x1fae11){try{if(agents[_0x1fae11[_0xd351('0x11')]]){utils[_0xd351('0x1b')](util[_0xd351('0x2')](_0xd351('0x29'),_0x1fae11[_0xd351('0x3')]),_0x1fae11);utils['info'](util['format'](_0xd351('0x2a'),_0x1fae11['uniqueid'],agents[_0x1fae11[_0xd351('0x11')]][_0xd351('0x5')],_0x1fae11[_0xd351('0x11')]));agents[_0x1fae11[_0xd351('0x11')]][_0xd351('0x2b')]=utils[_0xd351('0x15')]();agents[_0x1fae11[_0xd351('0x11')]][_0xd351('0x2c')]=_0x1fae11[_0xd351('0x2c')];agents[_0x1fae11[_0xd351('0x11')]][_0xd351('0x2d')]=_0x1fae11['connectedlinename'];agents[_0x1fae11[_0xd351('0x11')]]['holdtime']=_0x1fae11[_0xd351('0x20')];agents[_0x1fae11[_0xd351('0x11')]][_0xd351('0x8')]=_0xd351('0x2e');_[_0xd351('0x2f')](agents,function(_0x3db72a,_0x545bfc){if(_0x3db72a[_0xd351('0x11')]!=_0x1fae11[_0xd351('0x11')]&&_0x3db72a['uniqueid']==_0x1fae11[_0xd351('0x3')]){_0x3db72a[_0xd351('0x28')]=0x0;_0x3db72a[_0xd351('0x27')]=_0x1fae11[_0xd351('0x20')];_0x3db72a[_0xd351('0x19')]=!![];_0x3db72a['agentringnoanswerAt']=utils['now']();_0x3db72a[_0xd351('0x8')]=_0xd351('0x30');_0x3db72a['reason']='answered_elsewhere';_0x3db72a[_0xd351('0x31')]=_0x1fae11[_0xd351('0x11')];_0x3db72a['answeredelsewheremembername']=_0x1fae11['membername'];writeDB(_0x3db72a);}});}}catch(_0x46af23){utils[_0xd351('0x22')](util[_0xd351('0x2')](_0xd351('0x29'),_0x1fae11[_0xd351('0x3')]),_0x46af23);}};exports[_0xd351('0xc')]=function(_0x6192c3){try{if(!_[_0xd351('0x1a')](agents[_0x6192c3[_0xd351('0x11')]])){utils['debug'](util['format'](_0xd351('0x32'),_0x6192c3[_0xd351('0x3')]),_0x6192c3);utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x33'),_0x6192c3[_0xd351('0x3')],agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x5')],_0x6192c3[_0xd351('0x11')]));agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0xc')]=!![];agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x34')]=utils[_0xd351('0x15')]();agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x28')]=utils['diffTime'](agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x34')],agents[_0x6192c3[_0xd351('0x11')]]['agentconnectAt']);agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x1f')]=_0x6192c3[_0xd351('0x1f')];agents[_0x6192c3[_0xd351('0x11')]][_0xd351('0x8')]='complete';writeDB(agents[_0x6192c3[_0xd351('0x11')]]);}}catch(_0x575ea0){utils[_0xd351('0x22')](util[_0xd351('0x2')]('[%s][agents][agentcomplete]',_0x6192c3['uniqueid']),_0x575ea0);}};exports[_0xd351('0x35')]=function(_0x444206){try{if(!_[_0xd351('0x1a')](agents[_0x444206['transfereruniqueid']])){utils[_0xd351('0x1b')](util[_0xd351('0x2')]('[%s][agents][blindtransfer]',_0x444206[_0xd351('0x3')]),_0x444206);utils['info'](util[_0xd351('0x2')](_0xd351('0x36'),_0x444206['uniqueid'],agents[_0x444206['transfereruniqueid']][_0xd351('0x5')],agents[_0x444206['transfereruniqueid']][_0xd351('0x3')]));agents[_0x444206[_0xd351('0x37')]][_0xd351('0x38')]=!![];agents[_0x444206['transfereruniqueid']][_0xd351('0x39')]='blind';agents[_0x444206['transfereruniqueid']]['transferexten']=_0x444206[_0xd351('0x3a')];agents[_0x444206[_0xd351('0x37')]][_0xd351('0x3b')]=agents[_0x444206['transfereruniqueid']]['uniqueid'];}}catch(_0x1748f0){utils[_0xd351('0x22')](util['format'](_0xd351('0x3c'),_0x444206[_0xd351('0x3')]),_0x1748f0);}};exports['attendedtransfer']=function(_0x24ee0f){try{utils['debug'](util[_0xd351('0x2')]('[%s][agents][attendedtransfer]',_0x24ee0f[_0xd351('0x3d')]),_0x24ee0f);if(_0x24ee0f[_0xd351('0x3d')]==_0x24ee0f[_0xd351('0x3e')]){if(!_[_0xd351('0x1a')](agents[_0x24ee0f[_0xd351('0x3f')]])){utils[_0xd351('0x17')](util[_0xd351('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x24ee0f['origtransfereruniqueid'],agents[_0x24ee0f[_0xd351('0x3f')]][_0xd351('0x5')]));agents[_0x24ee0f['secondtransfereruniqueid']][_0xd351('0x38')]=!![];agents[_0x24ee0f[_0xd351('0x3f')]][_0xd351('0x39')]='ATTENDED';agents[_0x24ee0f[_0xd351('0x3f')]]['transferexten']=_0x24ee0f['origtransfererexten'];agents[_0x24ee0f[_0xd351('0x3f')]][_0xd351('0x3b')]=_0x24ee0f['origtransfereruniqueid'];}if(_0x24ee0f[_0xd351('0x40')]&&agents[_0x24ee0f[_0xd351('0x40')]]){agents[_0x24ee0f[_0xd351('0x40')]][_0xd351('0x41')]=0x1;transfers[_0x24ee0f[_0xd351('0x40')]]=_[_0xd351('0x42')](agents[_0x24ee0f['transfereeuniqueid']]);transfers[_0x24ee0f[_0xd351('0x40')]][_0xd351('0x7')]=agents[_0x24ee0f[_0xd351('0x3f')]][_0xd351('0x7')];transfers[_0x24ee0f[_0xd351('0x40')]][_0xd351('0x43')]=agents[_0x24ee0f[_0xd351('0x3f')]]['calleridname'];transfers[_0x24ee0f[_0xd351('0x40')]]['agentcalledAt']=utils[_0xd351('0x15')]();transfers[_0x24ee0f[_0xd351('0x40')]][_0xd351('0x2b')]=utils[_0xd351('0x15')]();transfers[_0x24ee0f[_0xd351('0x40')]]['holdtime']=0x0;transfers[_0x24ee0f[_0xd351('0x40')]]['agententerreason']=0x2;}}else if(_0x24ee0f[_0xd351('0x3f')]==_0x24ee0f[_0xd351('0x44')]){if(!_[_0xd351('0x1a')](agents[_0x24ee0f[_0xd351('0x3d')]])){utils[_0xd351('0x17')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x24ee0f[_0xd351('0x3d')],agents[_0x24ee0f[_0xd351('0x3d')]]['membername']));agents[_0x24ee0f[_0xd351('0x3d')]][_0xd351('0x38')]=!![];agents[_0x24ee0f[_0xd351('0x3d')]]['transfertype']=_0xd351('0x45');agents[_0x24ee0f[_0xd351('0x3d')]][_0xd351('0x46')]=_0x24ee0f[_0xd351('0x47')];agents[_0x24ee0f['origtransfereruniqueid']]['transferuniqueid']=_0x24ee0f[_0xd351('0x3f')];}if(_0x24ee0f[_0xd351('0x48')]&&agents[_0x24ee0f[_0xd351('0x48')]]){agents[_0x24ee0f[_0xd351('0x48')]][_0xd351('0x41')]=0x1;transfers[_0x24ee0f[_0xd351('0x48')]]=_[_0xd351('0x42')](agents[_0x24ee0f['transfertargetuniqueid']]);transfers[_0x24ee0f[_0xd351('0x48')]]['calleridnum']=agents[_0x24ee0f['origtransfereruniqueid']][_0xd351('0x7')];transfers[_0x24ee0f[_0xd351('0x48')]]['calleridname']=agents[_0x24ee0f[_0xd351('0x3d')]]['calleridname'];transfers[_0x24ee0f['transfertargetuniqueid']]['agentcalledAt']=utils[_0xd351('0x15')]();transfers[_0x24ee0f[_0xd351('0x48')]][_0xd351('0x2b')]=utils['now']();transfers[_0x24ee0f[_0xd351('0x48')]][_0xd351('0x27')]=0x0;transfers[_0x24ee0f[_0xd351('0x48')]][_0xd351('0x41')]=0x2;}}}catch(_0x2375db){utils[_0xd351('0x22')](util[_0xd351('0x2')](_0xd351('0x49'),_0x24ee0f[_0xd351('0x3d')]),_0x2375db);}};exports[_0xd351('0x4a')]=function(_0x18c261){try{utils['debug'](util[_0xd351('0x2')](_0xd351('0x4b'),_0x18c261[_0xd351('0x3')]),_0x18c261);if(agents[_0x18c261[_0xd351('0x3')]]&&agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x1f')]==='timeout'){if(_0x18c261[_0xd351('0x4c')]==='21'){agents[_0x18c261[_0xd351('0x3')]]['reason']='rejected';agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x8')]=_0xd351('0x4d');}utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x4e'),_0x18c261[_0xd351('0x3')],agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x5')],agents[_0x18c261['uniqueid']][_0xd351('0x1f')],agents[_0x18c261[_0xd351('0x3')]]['lastevent']));writeDB(agents[_0x18c261[_0xd351('0x3')]]);var _0x58eed5=unanswered[_0xd351('0x4f')](_0x18c261['uniqueid']);if(_0x58eed5>-0x1){unanswered[_0xd351('0x50')](_0x58eed5,0x1);}}if(transfers[_0x18c261[_0xd351('0x3')]]){transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0xc')]=!![];transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0x34')]=utils[_0xd351('0x15')]();transfers[_0x18c261['uniqueid']][_0xd351('0x28')]=utils[_0xd351('0x51')](transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0x34')],transfers[_0x18c261[_0xd351('0x3')]]['agentconnectAt']);transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0x1f')]=_0xd351('0x52');transfers[_0x18c261['uniqueid']][_0xd351('0x8')]=_0xd351('0x53');utils[_0xd351('0x17')](util[_0xd351('0x2')](_0xd351('0x4e'),_0x18c261[_0xd351('0x3')],transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0x5')],transfers[_0x18c261[_0xd351('0x3')]]['reason'],transfers[_0x18c261[_0xd351('0x3')]][_0xd351('0x8')]));writeDB(transfers[_0x18c261['uniqueid']],!![]);}if(agents[_0x18c261[_0xd351('0x3')]]&&agents[_0x18c261['uniqueid']]['agentconnectAt']){agents[_0x18c261['uniqueid']][_0xd351('0xc')]=!![];agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x34')]=utils['now']();agents[_0x18c261[_0xd351('0x3')]]['talktime']=utils[_0xd351('0x51')](agents[_0x18c261['uniqueid']][_0xd351('0x34')],agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x2b')]);agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x1f')]=agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x38')]?_0xd351('0x38'):_0xd351('0x52');agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x8')]=_0xd351('0x53');utils['info'](util[_0xd351('0x2')](_0xd351('0x4e'),_0x18c261[_0xd351('0x3')],agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x5')],agents[_0x18c261['uniqueid']][_0xd351('0x1f')],agents[_0x18c261[_0xd351('0x3')]][_0xd351('0x8')]));writeDB(agents[_0x18c261[_0xd351('0x3')]]);}}catch(_0x4a4b25){utils[_0xd351('0x22')](util[_0xd351('0x2')]('[%s][agents][hangup]',_0x18c261[_0xd351('0x3')]),_0x4a4b25);}};
\ No newline at end of file
+var _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x35cd20,_0x3591fb){var _0xa7dbcc=function(_0x38bdcb){while(--_0x38bdcb){_0x35cd20['push'](_0x35cd20['shift']());}};_0xa7dbcc(++_0x3591fb);}(_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 utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}};
\ No newline at end of file
index b7acfe5..9a837c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7744=['endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','destination','\x22\x20<','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','[%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','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','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','queue','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x7744,0xa7));var _0x4774=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x7744[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0x4774('0x0'));var util=require(_0x4774('0x1'));var utils=require(_0x4774('0x2'));var transfers=require(_0x4774('0x3'));var dispositions=[_0x4774('0x4'),_0x4774('0x5'),_0x4774('0x5'),'NO\x20ANSWER',_0x4774('0x4'),_0x4774('0x4'),_0x4774('0x6'),_0x4774('0x7'),_0x4774('0x5'),_0x4774('0x5'),_0x4774('0x5')];var channels={};function writeDB(_0x129cec){var _0x230237;if(transfers[_0x4774('0x8')][_0x129cec['uniqueid']]){_0x230237=_0x129cec[_0x4774('0x9')];_0x129cec[_0x4774('0x9')]=transfers[_0x4774('0x8')][_0x129cec[_0x4774('0x9')]]['transfereeuniqueid'];}utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0xc'),_0x129cec[_0x4774('0x9')],_0x129cec[_0x4774('0xd')],_0x129cec[_0x4774('0xe')],_0x129cec['membername'],_0x129cec['interface'],_0x129cec['calleridnum'],_0x129cec[_0x4774('0xf')],_0x129cec[_0x4774('0x10')]));if(_0x129cec[_0x4774('0x11')]){utils[_0x4774('0x12')](_0x129cec[_0x4774('0x11')])[_0x4774('0x13')](function(_0x3d1443){if(_0x3d1443){_0x129cec[_0x4774('0x14')]=_0x3d1443['id'];}utils[_0x4774('0x15')]('CreateVoiceCallReport',_0x129cec);});}else{utils['request'](_0x4774('0x16'),_0x129cec);}if(channels[_0x129cec[_0x4774('0x9')]]){delete channels[_0x129cec['uniqueid']];}else if(_0x230237&&channels[_0x230237]){delete transfers['blinds'][_0x230237];delete channels[_0x230237];}}exports[_0x4774('0x17')]=function(_0x3e0a09){try{utils[_0x4774('0x18')](util[_0x4774('0xb')](_0x4774('0x19'),_0x3e0a09[_0x4774('0x9')]),_0x3e0a09);if(_0x3e0a09[_0x4774('0x9')]==_0x3e0a09[_0x4774('0x1a')]&&_0x3e0a09[_0x4774('0xd')]!=_0x4774('0x1b')){utils[_0x4774('0xa')](util[_0x4774('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3e0a09[_0x4774('0x9')],_0x3e0a09[_0x4774('0x1c')],_0x3e0a09[_0x4774('0x1d')]));channels[_0x3e0a09[_0x4774('0x9')]]={'uniqueid':_0x3e0a09['uniqueid'],'accountcode':_0x3e0a09['accountcode'],'source':_0x3e0a09['calleridnum'],'destination':_0x3e0a09['exten'],'destinationcontext':_0x3e0a09[_0x4774('0x1c')],'channel':_0x3e0a09[_0x4774('0xd')],'starttime':utils[_0x4774('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4774('0x4'),'amaflags':_0x4774('0x1f')};}}catch(_0x384a71){utils[_0x4774('0x20')](util[_0x4774('0xb')](_0x4774('0x19'),_0x3e0a09[_0x4774('0x9')]),_0x384a71);}};exports[_0x4774('0x21')]=function(_0x3382e5){try{utils['debug'](util[_0x4774('0xb')](_0x4774('0x22'),_0x3382e5['uniqueid']),_0x3382e5);if(!_[_0x4774('0x23')](channels[_0x3382e5['uniqueid']])&&_0x3382e5['channelstate']==0x6){utils['info'](util[_0x4774('0xb')](_0x4774('0x24'),_0x3382e5[_0x4774('0x9')],_0x3382e5[_0x4774('0x1c')],_0x3382e5['channel']));if(_[_0x4774('0x23')](channels[_0x3382e5[_0x4774('0x9')]][_0x4774('0x25')])){channels[_0x3382e5[_0x4774('0x9')]][_0x4774('0x25')]=utils[_0x4774('0x1e')]();}}else if(!_[_0x4774('0x23')](channels[_0x3382e5['linkedid']])&&_0x3382e5[_0x4774('0x26')]==0x6&&_0x3382e5[_0x4774('0x1c')]!='transfer'){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x27'),_0x3382e5['uniqueid'],_0x3382e5[_0x4774('0x1a')],_0x3382e5[_0x4774('0x1c')],_0x3382e5[_0x4774('0xd')]));channels[_0x3382e5[_0x4774('0x1a')]][_0x4774('0x11')]=_0x3382e5[_0x4774('0x11')];channels[_0x3382e5[_0x4774('0x1a')]][_0x4774('0x28')]=_0x3382e5[_0x4774('0xd')];if(_[_0x4774('0x23')](channels[_0x3382e5['linkedid']][_0x4774('0x29')])){channels[_0x3382e5[_0x4774('0x1a')]]['answertime']=utils[_0x4774('0x1e')]();}channels[_0x3382e5[_0x4774('0x1a')]]['disposition']=dispositions[_[_0x4774('0x2a')](_0x3382e5[_0x4774('0x26')])]||_0x4774('0x6');}}catch(_0x28c362){utils['error'](util[_0x4774('0xb')]('[%s][calls][newstate]',_0x3382e5[_0x4774('0x9')]),_0x28c362);}};exports[_0x4774('0x2b')]=function(_0x4798e5){try{if(!_[_0x4774('0x23')](channels[_0x4798e5[_0x4774('0x9')]])){utils['debug'](util[_0x4774('0xb')](_0x4774('0x2c'),_0x4798e5[_0x4774('0x9')]),_0x4798e5);if(_[_0x4774('0x23')](channels[_0x4798e5[_0x4774('0x9')]]['callerid'])){channels[_0x4798e5[_0x4774('0x9')]]['callerid']=_0x4798e5['calleridname']+'\x20<'+_0x4798e5[_0x4774('0x2d')]+'>';}utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x2e'),_0x4798e5[_0x4774('0x9')],channels[_0x4798e5[_0x4774('0x9')]][_0x4774('0x2f')],_0x4798e5[_0x4774('0x30')]));channels[_0x4798e5[_0x4774('0x9')]][_0x4774('0x31')]=utils[_0x4774('0x1e')]();channels[_0x4798e5[_0x4774('0x9')]]['duration']=utils['diffTime'](channels[_0x4798e5[_0x4774('0x9')]]['endtime'],channels[_0x4798e5[_0x4774('0x9')]][_0x4774('0x32')]);channels[_0x4798e5[_0x4774('0x9')]][_0x4774('0x33')]=channels[_0x4798e5[_0x4774('0x9')]][_0x4774('0x29')]?utils[_0x4774('0x34')](channels[_0x4798e5['uniqueid']][_0x4774('0x31')],channels[_0x4798e5['uniqueid']]['answertime']):0x0;writeDB(channels[_0x4798e5[_0x4774('0x9')]]);}}catch(_0x2f5b90){utils['error'](util[_0x4774('0xb')]('[%s][calls][hangup]',_0x4798e5['uniqueid']),_0x2f5b90);}};exports[_0x4774('0x35')]=function(_0x86d310){try{if(!_[_0x4774('0x23')](channels[_0x86d310[_0x4774('0x36')]])){utils[_0x4774('0x18')](util['format'](_0x4774('0x37'),_0x86d310['origtransfereruniqueid']),_0x86d310);if(channels[_0x86d310[_0x4774('0x36')]][_0x4774('0xd')]==_0x86d310['transfereechannel']){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x38'),_0x86d310['origtransfereruniqueid'],_0x86d310[_0x4774('0x36')],_0x86d310[_0x4774('0x39')]));channels[_0x86d310['localtwolinkedid']]['destinationchannel']=_0x86d310[_0x4774('0x39')];channels[_0x86d310[_0x4774('0x36')]][_0x4774('0x3a')]=_0x4774('0x3b');}else if(channels[_0x86d310['localtwolinkedid']]['channel']=_0x86d310['transfertargetchannel']){utils[_0x4774('0xa')](util[_0x4774('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x86d310[_0x4774('0x3c')],_0x86d310['localtwolinkedid'],_0x86d310[_0x4774('0x3d')]));channels[_0x86d310[_0x4774('0x36')]][_0x4774('0x28')]=_0x86d310['origtransfererchannel'];channels[_0x86d310[_0x4774('0x36')]][_0x4774('0x3a')]='_attended';}}}catch(_0x226240){utils[_0x4774('0x20')](util[_0x4774('0xb')](_0x4774('0x37'),_0x86d310['origtransfereruniqueid']),_0x226240);}};exports[_0x4774('0x3e')]=function(_0xaa30a6){try{if(!_[_0x4774('0x23')](channels[_0xaa30a6[_0x4774('0x9')]])){utils[_0x4774('0x18')](util[_0x4774('0xb')](_0x4774('0x3f'),_0xaa30a6[_0x4774('0x9')]),_0xaa30a6);channels[_0xaa30a6['uniqueid']][_0x4774('0x40')]=utils[_0x4774('0x1e')]();utils[_0x4774('0xa')](util[_0x4774('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0xaa30a6['uniqueid'],channels[_0xaa30a6['uniqueid']][_0x4774('0x40')]));}}catch(_0x556719){utils[_0x4774('0x20')](util[_0x4774('0xb')](_0x4774('0x3f'),_0xaa30a6[_0x4774('0x9')]),_0x556719);}};exports[_0x4774('0x41')]=function(_0x3abb8f){try{if(!_[_0x4774('0x23')](channels[_0x3abb8f[_0x4774('0x9')]])){utils[_0x4774('0x18')](util['format'](_0x4774('0x42'),_0x3abb8f[_0x4774('0x9')]),_0x3abb8f);if(!_['isNil'](channels[_0x3abb8f[_0x4774('0x9')]][_0x4774('0x40')])){channels[_0x3abb8f[_0x4774('0x9')]][_0x4774('0x43')]+=utils['diffTime'](utils['now'](),channels[_0x3abb8f[_0x4774('0x9')]][_0x4774('0x40')]);utils[_0x4774('0xa')](util['format'](_0x4774('0x44'),_0x3abb8f[_0x4774('0x9')],channels[_0x3abb8f[_0x4774('0x9')]][_0x4774('0x43')]));delete channels[_0x3abb8f[_0x4774('0x9')]][_0x4774('0x40')];}}}catch(_0x3ae880){utils[_0x4774('0x20')](util[_0x4774('0xb')](_0x4774('0x42'),_0x3abb8f[_0x4774('0x9')]),_0x3ae880);}};exports[_0x4774('0x45')]=function(_0x160bc5){try{if(!_[_0x4774('0x23')](channels[_0x160bc5[_0x4774('0x9')]])){utils[_0x4774('0x18')](util['format'](_0x4774('0x46'),_0x160bc5[_0x4774('0x9')]),_0x160bc5);if(!_[_0x4774('0x23')](_0x160bc5['variable'][_0x4774('0x47')])){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x48'),_0x160bc5[_0x4774('0x9')],_0x160bc5[_0x4774('0x49')]));channels[_0x160bc5[_0x4774('0x9')]]['source']=_0x160bc5[_0x4774('0x49')];}if(!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')]['xmd-phone'])){utils[_0x4774('0xa')](util[_0x4774('0xb')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x160bc5[_0x4774('0x9')],_0x160bc5['value']));channels[_0x160bc5['uniqueid']][_0x4774('0x4b')]=_0x160bc5['value'];channels[_0x160bc5['uniqueid']][_0x4774('0x2f')]='\x22'+_0x160bc5[_0x4774('0x49')]+_0x4774('0x4c')+_0x160bc5['value']+'>';}if(!_[_0x4774('0x23')](_0x160bc5['variable']['xmd-callerid-preview'])||!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x4d')])){utils['info'](util[_0x4774('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x160bc5[_0x4774('0x9')],!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x4e')])?_0x4774('0x4e'):'xmd-callerid',_0x160bc5[_0x4774('0x49')]));channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x2f')]=_0x160bc5['value'];}if(!_[_0x4774('0x23')](_0x160bc5['variable'][_0x4774('0x4f')])||!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x50')])){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x51'),_0x160bc5[_0x4774('0x9')],!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x4f')])?'xmd-queue':'xmcs-queue',_0x160bc5['value']));channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x52')]=_0x4774('0x53');channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x54')]=_0x160bc5['value'];channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0xe')]=!![];}if(!_['isNil'](_0x160bc5[_0x4774('0x4a')]['xmd-contactid'])){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x55'),_0x160bc5[_0x4774('0x9')],_0x160bc5[_0x4774('0x49')]));channels[_0x160bc5['uniqueid']][_0x4774('0x56')]=_0x160bc5[_0x4774('0x49')];}if(!_['isNil'](_0x160bc5[_0x4774('0x4a')][_0x4774('0x57')])){utils['info'](util[_0x4774('0xb')](_0x4774('0x58'),_0x160bc5[_0x4774('0x9')],_0x160bc5[_0x4774('0x49')]));channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x59')]=_0x160bc5[_0x4774('0x49')];}if(!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x5a')])){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x5b'),_0x160bc5[_0x4774('0x9')],_0x160bc5['value']));channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x5c')]=_0x160bc5[_0x4774('0x49')];}if(!_[_0x4774('0x23')](_0x160bc5[_0x4774('0x4a')][_0x4774('0x5d')])){utils[_0x4774('0xa')](util[_0x4774('0xb')](_0x4774('0x5e'),_0x160bc5[_0x4774('0x9')],_0x160bc5[_0x4774('0x49')]));channels[_0x160bc5[_0x4774('0x9')]][_0x4774('0x5d')]=_0x160bc5[_0x4774('0x49')];}}}catch(_0x38a9cd){utils[_0x4774('0x20')](util[_0x4774('0xb')](_0x4774('0x46'),_0x160bc5[_0x4774('0x9')]),_0x38a9cd);}};exports[_0x4774('0x5f')]=function(_0xf8f4f2){try{if(!_['isNil'](channels[_0xf8f4f2['uniqueid']])){utils[_0x4774('0x18')](util[_0x4774('0xb')](_0x4774('0x60'),_0xf8f4f2[_0x4774('0x9')]),_0xf8f4f2);utils['info'](util[_0x4774('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0xf8f4f2[_0x4774('0x9')],_0xf8f4f2[_0x4774('0x61')],_0xf8f4f2[_0x4774('0x62')]));if(_0xf8f4f2['application'][_0x4774('0x63')]()==_0x4774('0x64')&&_['startsWith'](_0xf8f4f2[_0x4774('0x62')][_0x4774('0x63')](),_0x4774('0x65'))){var _0x2ecdc6=_0xf8f4f2[_0x4774('0x62')][_0x4774('0x66')]('=');var _0x1cf023=_0x2ecdc6[0x0]['substring'](_0x2ecdc6[0x0]['lastIndexOf']('(')+0x1,_0x2ecdc6[0x0][_0x4774('0x67')](')'));var _0x24bd45=_0x2ecdc6[0x1];channels[_0xf8f4f2['uniqueid']][_0x1cf023]=_0x24bd45;}if(!_[_0x4774('0x68')]([_0x4774('0x2b'),_0x4774('0x69'),_0x4774('0x6a'),_0x4774('0x64'),_0x4774('0x6b')],_0xf8f4f2[_0x4774('0x61')][_0x4774('0x63')]())){channels[_0xf8f4f2['uniqueid']][_0x4774('0x52')]=_0xf8f4f2[_0x4774('0x61')];channels[_0xf8f4f2[_0x4774('0x9')]][_0x4774('0x54')]=_0xf8f4f2[_0x4774('0x62')];}}}catch(_0x51fe4f){utils['error'](util[_0x4774('0xb')](_0x4774('0x60'),_0xf8f4f2[_0x4774('0x9')]),_0x51fe4f);}};
\ No newline at end of file
+var _0xad86=['isNil','systemanswertime','channelstate','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][attendedtransfer]','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','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<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','hangup','noop','gotoif','[%s][calls][newexten]','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','format','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad86,0x127));var _0x6ad8=function(_0x3e671d,_0x3a843a){_0x3e671d=_0x3e671d-0x0;var _0x28aabe=_0xad86[_0x3e671d];return _0x28aabe;};'use strict';var _=require(_0x6ad8('0x0'));var util=require('util');var utils=require(_0x6ad8('0x1'));var transfers=require(_0x6ad8('0x2'));var dispositions=[_0x6ad8('0x3'),_0x6ad8('0x4'),_0x6ad8('0x4'),'NO\x20ANSWER',_0x6ad8('0x3'),_0x6ad8('0x3'),_0x6ad8('0x5'),_0x6ad8('0x6'),_0x6ad8('0x4'),_0x6ad8('0x4'),_0x6ad8('0x4')];var channels={};function writeDB(_0x31a163){var _0x2b5cfd;if(transfers[_0x6ad8('0x7')][_0x31a163[_0x6ad8('0x8')]]){_0x2b5cfd=_0x31a163[_0x6ad8('0x8')];_0x31a163[_0x6ad8('0x8')]=transfers[_0x6ad8('0x7')][_0x31a163[_0x6ad8('0x8')]][_0x6ad8('0x9')];}utils[_0x6ad8('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x31a163['uniqueid'],_0x31a163[_0x6ad8('0xb')],_0x31a163[_0x6ad8('0xc')],_0x31a163[_0x6ad8('0xd')],_0x31a163[_0x6ad8('0xe')],_0x31a163[_0x6ad8('0xf')],_0x31a163[_0x6ad8('0x10')],_0x31a163[_0x6ad8('0x11')]));if(_0x31a163[_0x6ad8('0x12')]){utils[_0x6ad8('0x13')](_0x31a163[_0x6ad8('0x12')])[_0x6ad8('0x14')](function(_0x26e202){if(_0x26e202){_0x31a163[_0x6ad8('0x15')]=_0x26e202['id'];}utils[_0x6ad8('0x16')](_0x6ad8('0x17'),_0x31a163);});}else{utils['request'](_0x6ad8('0x17'),_0x31a163);}if(channels[_0x31a163[_0x6ad8('0x8')]]){delete channels[_0x31a163[_0x6ad8('0x8')]];}else if(_0x2b5cfd&&channels[_0x2b5cfd]){delete transfers['blinds'][_0x2b5cfd];delete channels[_0x2b5cfd];}}exports[_0x6ad8('0x18')]=function(_0x99b2fd){try{utils[_0x6ad8('0x19')](util['format'](_0x6ad8('0x1a'),_0x99b2fd[_0x6ad8('0x8')]),_0x99b2fd);if(_0x99b2fd[_0x6ad8('0x8')]==_0x99b2fd[_0x6ad8('0x1b')]&&_0x99b2fd[_0x6ad8('0xb')]!='OutgoingSpoolFailed'){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x99b2fd['uniqueid'],_0x99b2fd[_0x6ad8('0x1d')],_0x99b2fd['exten']));channels[_0x99b2fd['uniqueid']]={'uniqueid':_0x99b2fd[_0x6ad8('0x8')],'accountcode':_0x99b2fd[_0x6ad8('0x12')],'source':_0x99b2fd[_0x6ad8('0xf')],'destination':_0x99b2fd['exten'],'destinationcontext':_0x99b2fd[_0x6ad8('0x1d')],'channel':_0x99b2fd[_0x6ad8('0xb')],'starttime':utils[_0x6ad8('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x6ad8('0x3'),'amaflags':_0x6ad8('0x1f')};}}catch(_0x14b313){utils[_0x6ad8('0x20')](util['format'](_0x6ad8('0x1a'),_0x99b2fd['uniqueid']),_0x14b313);}};exports[_0x6ad8('0x21')]=function(_0x1437ab){try{utils[_0x6ad8('0x19')](util[_0x6ad8('0x1c')](_0x6ad8('0x22'),_0x1437ab[_0x6ad8('0x8')]),_0x1437ab);if(!_[_0x6ad8('0x23')](channels[_0x1437ab[_0x6ad8('0x8')]])&&_0x1437ab['channelstate']==0x6){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1437ab['uniqueid'],_0x1437ab[_0x6ad8('0x1d')],_0x1437ab[_0x6ad8('0xb')]));if(_[_0x6ad8('0x23')](channels[_0x1437ab['uniqueid']][_0x6ad8('0x24')])){channels[_0x1437ab[_0x6ad8('0x8')]][_0x6ad8('0x24')]=utils[_0x6ad8('0x1e')]();}}else if(!_[_0x6ad8('0x23')](channels[_0x1437ab[_0x6ad8('0x1b')]])&&_0x1437ab[_0x6ad8('0x25')]==0x6&&_0x1437ab['context']!='transfer'){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1437ab[_0x6ad8('0x8')],_0x1437ab[_0x6ad8('0x1b')],_0x1437ab[_0x6ad8('0x1d')],_0x1437ab[_0x6ad8('0xb')]));channels[_0x1437ab[_0x6ad8('0x1b')]]['accountcode']=_0x1437ab[_0x6ad8('0x12')];channels[_0x1437ab[_0x6ad8('0x1b')]][_0x6ad8('0x26')]=_0x1437ab[_0x6ad8('0xb')];if(_['isNil'](channels[_0x1437ab[_0x6ad8('0x1b')]]['answertime'])){channels[_0x1437ab['linkedid']][_0x6ad8('0x27')]=utils[_0x6ad8('0x1e')]();}channels[_0x1437ab[_0x6ad8('0x1b')]][_0x6ad8('0x28')]=dispositions[_[_0x6ad8('0x29')](_0x1437ab[_0x6ad8('0x25')])]||_0x6ad8('0x5');}}catch(_0x48cd63){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x22'),_0x1437ab['uniqueid']),_0x48cd63);}};exports['hangup']=function(_0x413a38){try{if(!_[_0x6ad8('0x23')](channels[_0x413a38[_0x6ad8('0x8')]])){utils[_0x6ad8('0x19')](util[_0x6ad8('0x1c')](_0x6ad8('0x2a'),_0x413a38[_0x6ad8('0x8')]),_0x413a38);if(_[_0x6ad8('0x23')](channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2b')])){channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2b')]=_0x413a38['calleridname']+'\x20<'+_0x413a38[_0x6ad8('0xf')]+'>';}utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x2c'),_0x413a38[_0x6ad8('0x8')],channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2b')],_0x413a38['cause-txt']));channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2d')]=utils[_0x6ad8('0x1e')]();channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2e')]=utils['diffTime'](channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2d')],channels[_0x413a38['uniqueid']][_0x6ad8('0x2f')]);channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x30')]=channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x27')]?utils[_0x6ad8('0x31')](channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x2d')],channels[_0x413a38[_0x6ad8('0x8')]][_0x6ad8('0x27')]):0x0;writeDB(channels[_0x413a38[_0x6ad8('0x8')]]);}}catch(_0x180c9f){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x2a'),_0x413a38[_0x6ad8('0x8')]),_0x180c9f);}};exports['attendedtransfer']=function(_0x3276d1){try{if(!_[_0x6ad8('0x23')](channels[_0x3276d1['localtwolinkedid']])){utils[_0x6ad8('0x19')](util['format'](_0x6ad8('0x32'),_0x3276d1['origtransfereruniqueid']),_0x3276d1);if(channels[_0x3276d1[_0x6ad8('0x33')]]['channel']==_0x3276d1['transfereechannel']){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x34'),_0x3276d1['origtransfereruniqueid'],_0x3276d1[_0x6ad8('0x33')],_0x3276d1['secondtransfererchannel']));channels[_0x3276d1[_0x6ad8('0x33')]]['destinationchannel']=_0x3276d1[_0x6ad8('0x35')];channels[_0x3276d1[_0x6ad8('0x33')]][_0x6ad8('0x36')]=_0x6ad8('0x37');}else if(channels[_0x3276d1[_0x6ad8('0x33')]][_0x6ad8('0xb')]=_0x3276d1[_0x6ad8('0x38')]){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3276d1[_0x6ad8('0x39')],_0x3276d1['localtwolinkedid'],_0x3276d1[_0x6ad8('0x3a')]));channels[_0x3276d1[_0x6ad8('0x33')]][_0x6ad8('0x26')]=_0x3276d1[_0x6ad8('0x3a')];channels[_0x3276d1[_0x6ad8('0x33')]][_0x6ad8('0x36')]=_0x6ad8('0x37');}}}catch(_0x401b08){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x32'),_0x3276d1[_0x6ad8('0x39')]),_0x401b08);}};exports[_0x6ad8('0x3b')]=function(_0x3381ab){try{if(!_[_0x6ad8('0x23')](channels[_0x3381ab[_0x6ad8('0x8')]])){utils[_0x6ad8('0x19')](util['format']('[%s][calls][musiconholdstart]',_0x3381ab[_0x6ad8('0x8')]),_0x3381ab);channels[_0x3381ab[_0x6ad8('0x8')]]['musiconholdstartAt']=utils['now']();utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3381ab['uniqueid'],channels[_0x3381ab[_0x6ad8('0x8')]][_0x6ad8('0x3c')]));}}catch(_0x22b553){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x3d'),_0x3381ab[_0x6ad8('0x8')]),_0x22b553);}};exports[_0x6ad8('0x3e')]=function(_0x5af205){try{if(!_[_0x6ad8('0x23')](channels[_0x5af205[_0x6ad8('0x8')]])){utils[_0x6ad8('0x19')](util[_0x6ad8('0x1c')]('[%s][calls][musiconholdstop]',_0x5af205['uniqueid']),_0x5af205);if(!_['isNil'](channels[_0x5af205[_0x6ad8('0x8')]][_0x6ad8('0x3c')])){channels[_0x5af205[_0x6ad8('0x8')]]['mohtime']+=utils[_0x6ad8('0x31')](utils[_0x6ad8('0x1e')](),channels[_0x5af205[_0x6ad8('0x8')]]['musiconholdstartAt']);utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x3f'),_0x5af205[_0x6ad8('0x8')],channels[_0x5af205['uniqueid']][_0x6ad8('0x40')]));delete channels[_0x5af205[_0x6ad8('0x8')]][_0x6ad8('0x3c')];}}}catch(_0x160b58){utils['error'](util['format'](_0x6ad8('0x41'),_0x5af205[_0x6ad8('0x8')]),_0x160b58);}};exports[_0x6ad8('0x42')]=function(_0x402f32){try{if(!_['isNil'](channels[_0x402f32[_0x6ad8('0x8')]])){utils[_0x6ad8('0x19')](util[_0x6ad8('0x1c')]('[%s][calls][varset]',_0x402f32[_0x6ad8('0x8')]),_0x402f32);if(!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')][_0x6ad8('0x44')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x45'),_0x402f32['uniqueid'],_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x47')]=_0x402f32[_0x6ad8('0x46')];}if(!_[_0x6ad8('0x23')](_0x402f32['variable'][_0x6ad8('0x48')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x49'),_0x402f32[_0x6ad8('0x8')],_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x4a')]=_0x402f32[_0x6ad8('0x46')];channels[_0x402f32['uniqueid']]['callerid']='\x22'+_0x402f32[_0x6ad8('0x46')]+_0x6ad8('0x4b')+_0x402f32[_0x6ad8('0x46')]+'>';}if(!_['isNil'](_0x402f32[_0x6ad8('0x43')]['xmd-callerid-preview'])||!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')]['xmd-callerid'])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x4c'),_0x402f32[_0x6ad8('0x8')],!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')]['xmd-callerid-preview'])?_0x6ad8('0x4d'):_0x6ad8('0x4e'),_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x2b')]=_0x402f32[_0x6ad8('0x46')];}if(!_[_0x6ad8('0x23')](_0x402f32['variable'][_0x6ad8('0x4f')])||!_['isNil'](_0x402f32['variable'][_0x6ad8('0x50')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x4c'),_0x402f32['uniqueid'],!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')][_0x6ad8('0x4f')])?'xmd-queue':_0x6ad8('0x50'),_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x51')]=_0x6ad8('0x52');channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x53')]=_0x402f32[_0x6ad8('0x46')];channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0xc')]=!![];}if(!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')][_0x6ad8('0x54')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x55'),_0x402f32[_0x6ad8('0x8')],_0x402f32['value']));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x56')]=_0x402f32[_0x6ad8('0x46')];}if(!_[_0x6ad8('0x23')](_0x402f32[_0x6ad8('0x43')][_0x6ad8('0x57')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x58'),_0x402f32[_0x6ad8('0x8')],_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x59')]=_0x402f32[_0x6ad8('0x46')];}if(!_['isNil'](_0x402f32[_0x6ad8('0x43')][_0x6ad8('0x5a')])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x5b'),_0x402f32[_0x6ad8('0x8')],_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]][_0x6ad8('0x5c')]=_0x402f32[_0x6ad8('0x46')];}if(!_['isNil'](_0x402f32[_0x6ad8('0x43')]['sipcallid'])){utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x5d'),_0x402f32[_0x6ad8('0x8')],_0x402f32[_0x6ad8('0x46')]));channels[_0x402f32[_0x6ad8('0x8')]]['sipcallid']=_0x402f32[_0x6ad8('0x46')];}}}catch(_0x4b24b9){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x5e'),_0x402f32['uniqueid']),_0x4b24b9);}};exports[_0x6ad8('0x5f')]=function(_0x21ccf4){try{if(!_[_0x6ad8('0x23')](channels[_0x21ccf4['uniqueid']])){utils[_0x6ad8('0x19')](util['format']('[%s][calls][newexten]',_0x21ccf4['uniqueid']),_0x21ccf4);utils[_0x6ad8('0xa')](util[_0x6ad8('0x1c')](_0x6ad8('0x60'),_0x21ccf4[_0x6ad8('0x8')],_0x21ccf4['application'],_0x21ccf4[_0x6ad8('0x61')]));if(_0x21ccf4[_0x6ad8('0x62')][_0x6ad8('0x63')]()==_0x6ad8('0x64')&&_[_0x6ad8('0x65')](_0x21ccf4[_0x6ad8('0x61')][_0x6ad8('0x63')](),_0x6ad8('0x66'))){var _0x9b2eea=_0x21ccf4[_0x6ad8('0x61')]['split']('=');var _0x1e5dd0=_0x9b2eea[0x0][_0x6ad8('0x67')](_0x9b2eea[0x0][_0x6ad8('0x68')]('(')+0x1,_0x9b2eea[0x0][_0x6ad8('0x68')](')'));var _0x75bfb3=_0x9b2eea[0x1];channels[_0x21ccf4['uniqueid']][_0x1e5dd0]=_0x75bfb3;}if(!_[_0x6ad8('0x69')]([_0x6ad8('0x6a'),_0x6ad8('0x6b'),'execif','set',_0x6ad8('0x6c')],_0x21ccf4[_0x6ad8('0x62')][_0x6ad8('0x63')]())){channels[_0x21ccf4[_0x6ad8('0x8')]][_0x6ad8('0x51')]=_0x21ccf4[_0x6ad8('0x62')];channels[_0x21ccf4['uniqueid']]['lastdata']=_0x21ccf4[_0x6ad8('0x61')];}}}catch(_0x32013c){utils[_0x6ad8('0x20')](util[_0x6ad8('0x1c')](_0x6ad8('0x6d'),_0x21ccf4[_0x6ad8('0x8')]),_0x32013c);}};
\ No newline at end of file
index 32279ef..dcff124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a6c=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','connect','info','shutdown','fullybooted'];(function(_0x53d4f7,_0x1e0f8c){var _0x339e61=function(_0x5b9f1f){while(--_0x5b9f1f){_0x53d4f7['push'](_0x53d4f7['shift']());}};_0x339e61(++_0x1e0f8c);}(_0x0a6c,0xe6));var _0xc0a6=function(_0x4e4c6c,_0x15c7f5){_0x4e4c6c=_0x4e4c6c-0x0;var _0x16ec3b=_0x0a6c[_0x4e4c6c];return _0x16ec3b;};'use strict';var utils=require('./utils');exports[_0xc0a6('0x0')]=function(){utils[_0xc0a6('0x1')]('[core]\x20connected');};exports[_0xc0a6('0x2')]=function(){utils[_0xc0a6('0x1')]('[core]\x20shutdown');};exports[_0xc0a6('0x3')]=function(){utils['info'](_0xc0a6('0x4'));};exports[_0xc0a6('0x5')]=function(_0x4440f0){utils[_0xc0a6('0x5')](_0xc0a6('0x6'),_0x4440f0);};exports[_0xc0a6('0x7')]=function(){utils[_0xc0a6('0x1')]('[core]\x20close');};exports[_0xc0a6('0x8')]=function(_0x2e376d){};
\ No newline at end of file
+var _0x8085=['close','[core]\x20close','managerevent','./utils','[core]\x20connected','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x2b9105,_0x85983d){var _0x486e17=function(_0x30c83f){while(--_0x30c83f){_0x2b9105['push'](_0x2b9105['shift']());}};_0x486e17(++_0x85983d);}(_0x8085,0x71));var _0x5808=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x8085[_0x420b24];return _0x4da552;};'use strict';var utils=require(_0x5808('0x0'));exports['connect']=function(){utils['info'](_0x5808('0x1'));};exports[_0x5808('0x2')]=function(){utils[_0x5808('0x3')](_0x5808('0x4'));};exports['fullybooted']=function(){utils['info'](_0x5808('0x5'));};exports[_0x5808('0x6')]=function(_0x4cbea2){utils[_0x5808('0x6')](_0x5808('0x7'),_0x4cbea2);};exports[_0x5808('0x8')]=function(){utils[_0x5808('0x3')](_0x5808('0x9'));};exports[_0x5808('0xa')]=function(_0x30e63c){};
\ No newline at end of file
index 62a4275..cc74728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc295=['[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','debug'];(function(_0x35f568,_0x2de40e){var _0x587efd=function(_0x3f1aea){while(--_0x3f1aea){_0x35f568['push'](_0x35f568['shift']());}};_0x587efd(++_0x2de40e);}(_0xc295,0xb9));var _0x5c29=function(_0xd98269,_0x38a0fa){_0xd98269=_0xd98269-0x0;var _0xbfcf62=_0xc295[_0xd98269];return _0xbfcf62;};'use strict';var _=require(_0x5c29('0x0'));var util=require('util');var utils=require(_0x5c29('0x1'));var dials={};function writeDB(_0x8db6d2){utils['info'](util[_0x5c29('0x2')](_0x5c29('0x3'),_0x8db6d2['uniqueid'],_0x8db6d2[_0x5c29('0x4')],_0x8db6d2['dialstring'],_0x8db6d2[_0x5c29('0x5')],_0x8db6d2['connectedlinenum'],_0x8db6d2[_0x5c29('0x6')]));utils[_0x5c29('0x7')](_0x5c29('0x8'),_0x8db6d2);delete dials[_0x8db6d2[_0x5c29('0x9')]];}exports[_0x5c29('0xa')]=function(_0x2d03df){try{utils['debug'](util[_0x5c29('0x2')](_0x5c29('0xb'),_0x2d03df[_0x5c29('0x9')]),_0x2d03df);utils[_0x5c29('0xc')](util[_0x5c29('0x2')](_0x5c29('0xd'),_0x2d03df[_0x5c29('0x9')],_0x2d03df[_0x5c29('0xe')],_0x2d03df['appdata']));if(_0x2d03df[_0x5c29('0xe')]['toLowerCase']()==_0x5c29('0xf')&&_[_0x5c29('0x10')](_0x2d03df[_0x5c29('0x11')][_0x5c29('0x12')](),_0x5c29('0x13'))){var _0x162938=_0x2d03df[_0x5c29('0x11')][_0x5c29('0x14')]('=');dials[_0x2d03df['uniqueid']]={'routeId':_0x162938[0x1]};}}catch(_0x563255){utils['error'](util[_0x5c29('0x2')](_0x5c29('0xb'),_0x2d03df[_0x5c29('0x9')]),_0x563255);}};exports[_0x5c29('0x15')]=function(_0x56a054){try{utils['debug'](util[_0x5c29('0x2')]('[%s][dials][varset]',_0x56a054['uniqueid']),_0x56a054);if(!_[_0x5c29('0x16')](_0x56a054[_0x5c29('0x17')][_0x5c29('0x18')])){utils[_0x5c29('0xc')](util[_0x5c29('0x2')](_0x5c29('0x19'),_0x56a054[_0x5c29('0x9')],_0x56a054[_0x5c29('0x1a')]));dials[_0x56a054[_0x5c29('0x9')]]={'routeId':_0x56a054['value']};}}catch(_0x2ecd33){utils[_0x5c29('0x1b')](util[_0x5c29('0x2')](_0x5c29('0x1c'),_0x56a054[_0x5c29('0x9')]),_0x2ecd33);}};exports[_0x5c29('0x1d')]=function(_0x47a8bc){try{if(!_[_0x5c29('0x16')](dials[_0x47a8bc['uniqueid']])){utils[_0x5c29('0x1e')](util[_0x5c29('0x2')](_0x5c29('0x1f'),_0x47a8bc[_0x5c29('0x9')]),_0x47a8bc);dials[_0x47a8bc[_0x5c29('0x9')]]=_[_0x5c29('0x20')](dials[_0x47a8bc['uniqueid']],_0x47a8bc);dials[_0x47a8bc[_0x5c29('0x9')]]['starttime']=utils['now']();dials[_0x47a8bc['uniqueid']][_0x5c29('0x21')]=_0x5c29('0x22');utils['info'](util['format'](_0x5c29('0x23'),_0x47a8bc[_0x5c29('0x9')],dials[_0x47a8bc['uniqueid']]['starttime']));}}catch(_0x3229d2){utils['error'](util[_0x5c29('0x2')]('[%s][dials][dialbegin]',_0x47a8bc['uniqueid']),_0x3229d2);}};exports[_0x5c29('0x24')]=function(_0x27f4d2){try{if(!_[_0x5c29('0x16')](dials[_0x27f4d2[_0x5c29('0x9')]])){utils[_0x5c29('0x1e')](util['format']('[%s][dials][dialend]',_0x27f4d2[_0x5c29('0x9')]),_0x27f4d2);dials[_0x27f4d2[_0x5c29('0x9')]][_0x5c29('0x6')]=_0x27f4d2[_0x5c29('0x6')];if(_0x27f4d2['dialstatus']==_0x5c29('0x25')){dials[_0x27f4d2[_0x5c29('0x9')]]=_['assign'](dials[_0x27f4d2['uniqueid']],_0x27f4d2);dials[_0x27f4d2[_0x5c29('0x9')]][_0x5c29('0x26')]=utils[_0x5c29('0x27')]();dials[_0x27f4d2[_0x5c29('0x9')]][_0x5c29('0x21')]=_0x5c29('0x28');utils[_0x5c29('0xc')](util['format'](_0x5c29('0x29'),_0x27f4d2[_0x5c29('0x9')],_0x27f4d2[_0x5c29('0x6')],dials[_0x27f4d2[_0x5c29('0x9')]][_0x5c29('0x26')]));}else{utils['info'](util[_0x5c29('0x2')](_0x5c29('0x2a'),_0x27f4d2['uniqueid'],_0x27f4d2['dialstatus']));}}}catch(_0x12c529){utils[_0x5c29('0x1b')](util[_0x5c29('0x2')](_0x5c29('0x2b'),_0x27f4d2['uniqueid']),_0x12c529);}};exports[_0x5c29('0x2c')]=function(_0x8afe91){try{if(!_[_0x5c29('0x16')](dials[_0x8afe91[_0x5c29('0x9')]])){utils[_0x5c29('0x1e')](util[_0x5c29('0x2')](_0x5c29('0x2d'),_0x8afe91[_0x5c29('0x9')]),_0x8afe91);utils[_0x5c29('0xc')](util[_0x5c29('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x8afe91['uniqueid'],_0x8afe91['calleridnum'],_0x8afe91[_0x5c29('0x2e')],_0x8afe91[_0x5c29('0x2f')]));dials[_0x8afe91[_0x5c29('0x9')]]=_[_0x5c29('0x20')](dials[_0x8afe91['uniqueid']],{'endtime':utils[_0x5c29('0x27')](),'lastevent':'complete'});dials[_0x8afe91['uniqueid']][_0x5c29('0x30')]=utils[_0x5c29('0x31')](dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x32')],dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x33')]);dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x34')]=utils[_0x5c29('0x31')](dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x26')]||dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x32')],dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x33')]);dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x35')]=dials[_0x8afe91['uniqueid']][_0x5c29('0x26')]?utils[_0x5c29('0x31')](dials[_0x8afe91[_0x5c29('0x9')]][_0x5c29('0x32')],dials[_0x8afe91[_0x5c29('0x9')]]['answertime']):0x0;writeDB(dials[_0x8afe91[_0x5c29('0x9')]]);}}catch(_0x52e455){utils['error'](util[_0x5c29('0x2')]('[%s][dials][hangup]',_0x8afe91['uniqueid']),_0x52e455);}};
\ No newline at end of file
+var _0x8f7f=['debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr(routeid)','split','[%s][dials][newexten]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','diffTime','endtime','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','request','CreateVoiceDialReport','uniqueid','newexten'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8f7f,0x1d4));var _0xf8f7=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x8f7f[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0xf8f7('0x0'));var utils=require(_0xf8f7('0x1'));var dials={};function writeDB(_0x413e1c){utils[_0xf8f7('0x2')](util[_0xf8f7('0x3')](_0xf8f7('0x4'),_0x413e1c['uniqueid'],_0x413e1c[_0xf8f7('0x5')],_0x413e1c['dialstring'],_0x413e1c[_0xf8f7('0x6')],_0x413e1c[_0xf8f7('0x7')],_0x413e1c['dialstatus']));utils[_0xf8f7('0x8')](_0xf8f7('0x9'),_0x413e1c);delete dials[_0x413e1c[_0xf8f7('0xa')]];}exports[_0xf8f7('0xb')]=function(_0x195c57){try{utils[_0xf8f7('0xc')](util[_0xf8f7('0x3')]('[%s][dials][newexten]',_0x195c57[_0xf8f7('0xa')]),_0x195c57);utils['info'](util[_0xf8f7('0x3')](_0xf8f7('0xd'),_0x195c57[_0xf8f7('0xa')],_0x195c57[_0xf8f7('0xe')],_0x195c57[_0xf8f7('0xf')]));if(_0x195c57[_0xf8f7('0xe')]['toLowerCase']()==_0xf8f7('0x10')&&_['startsWith'](_0x195c57[_0xf8f7('0xf')][_0xf8f7('0x11')](),_0xf8f7('0x12'))){var _0x39d6ad=_0x195c57[_0xf8f7('0xf')][_0xf8f7('0x13')]('=');dials[_0x195c57[_0xf8f7('0xa')]]={'routeId':_0x39d6ad[0x1]};}}catch(_0x173fd6){utils['error'](util['format'](_0xf8f7('0x14'),_0x195c57[_0xf8f7('0xa')]),_0x173fd6);}};exports['varset']=function(_0x4ac5d2){try{utils[_0xf8f7('0xc')](util[_0xf8f7('0x3')]('[%s][dials][varset]',_0x4ac5d2['uniqueid']),_0x4ac5d2);if(!_[_0xf8f7('0x15')](_0x4ac5d2[_0xf8f7('0x16')][_0xf8f7('0x17')])){utils[_0xf8f7('0x2')](util[_0xf8f7('0x3')](_0xf8f7('0x18'),_0x4ac5d2[_0xf8f7('0xa')],_0x4ac5d2[_0xf8f7('0x19')]));dials[_0x4ac5d2['uniqueid']]={'routeId':_0x4ac5d2[_0xf8f7('0x19')]};}}catch(_0x4a0090){utils[_0xf8f7('0x1a')](util[_0xf8f7('0x3')](_0xf8f7('0x1b'),_0x4ac5d2[_0xf8f7('0xa')]),_0x4a0090);}};exports[_0xf8f7('0x1c')]=function(_0x2562a1){try{if(!_[_0xf8f7('0x15')](dials[_0x2562a1[_0xf8f7('0xa')]])){utils[_0xf8f7('0xc')](util[_0xf8f7('0x3')](_0xf8f7('0x1d'),_0x2562a1[_0xf8f7('0xa')]),_0x2562a1);dials[_0x2562a1['uniqueid']]=_[_0xf8f7('0x1e')](dials[_0x2562a1['uniqueid']],_0x2562a1);dials[_0x2562a1[_0xf8f7('0xa')]][_0xf8f7('0x1f')]=utils[_0xf8f7('0x20')]();dials[_0x2562a1[_0xf8f7('0xa')]]['lastevent']=_0xf8f7('0x21');utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2562a1['uniqueid'],dials[_0x2562a1[_0xf8f7('0xa')]][_0xf8f7('0x1f')]));}}catch(_0x3e3ed3){utils[_0xf8f7('0x1a')](util['format'](_0xf8f7('0x1d'),_0x2562a1[_0xf8f7('0xa')]),_0x3e3ed3);}};exports[_0xf8f7('0x22')]=function(_0x2f019f){try{if(!_[_0xf8f7('0x15')](dials[_0x2f019f[_0xf8f7('0xa')]])){utils[_0xf8f7('0xc')](util[_0xf8f7('0x3')](_0xf8f7('0x23'),_0x2f019f[_0xf8f7('0xa')]),_0x2f019f);dials[_0x2f019f['uniqueid']][_0xf8f7('0x24')]=_0x2f019f[_0xf8f7('0x24')];if(_0x2f019f[_0xf8f7('0x24')]==_0xf8f7('0x25')){dials[_0x2f019f[_0xf8f7('0xa')]]=_['assign'](dials[_0x2f019f[_0xf8f7('0xa')]],_0x2f019f);dials[_0x2f019f[_0xf8f7('0xa')]][_0xf8f7('0x26')]=utils[_0xf8f7('0x20')]();dials[_0x2f019f[_0xf8f7('0xa')]][_0xf8f7('0x27')]='connect';utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x2f019f[_0xf8f7('0xa')],_0x2f019f[_0xf8f7('0x24')],dials[_0x2f019f[_0xf8f7('0xa')]][_0xf8f7('0x26')]));}else{utils[_0xf8f7('0x2')](util[_0xf8f7('0x3')](_0xf8f7('0x28'),_0x2f019f['uniqueid'],_0x2f019f[_0xf8f7('0x24')]));}}}catch(_0x30e774){utils['error'](util[_0xf8f7('0x3')](_0xf8f7('0x23'),_0x2f019f['uniqueid']),_0x30e774);}};exports['hangup']=function(_0x41634c){try{if(!_[_0xf8f7('0x15')](dials[_0x41634c[_0xf8f7('0xa')]])){utils[_0xf8f7('0xc')](util[_0xf8f7('0x3')](_0xf8f7('0x29'),_0x41634c['uniqueid']),_0x41634c);utils[_0xf8f7('0x2')](util[_0xf8f7('0x3')](_0xf8f7('0x2a'),_0x41634c[_0xf8f7('0xa')],_0x41634c['calleridnum'],_0x41634c[_0xf8f7('0x2b')],_0x41634c['cause-txt']));dials[_0x41634c['uniqueid']]=_['assign'](dials[_0x41634c[_0xf8f7('0xa')]],{'endtime':utils[_0xf8f7('0x20')](),'lastevent':_0xf8f7('0x2c')});dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x2d')]=utils[_0xf8f7('0x2e')](dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x2f')],dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x1f')]);dials[_0x41634c[_0xf8f7('0xa')]]['holdtime']=utils[_0xf8f7('0x2e')](dials[_0x41634c['uniqueid']]['answertime']||dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x2f')],dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x1f')]);dials[_0x41634c[_0xf8f7('0xa')]]['billableseconds']=dials[_0x41634c[_0xf8f7('0xa')]][_0xf8f7('0x26')]?utils[_0xf8f7('0x2e')](dials[_0x41634c['uniqueid']][_0xf8f7('0x2f')],dials[_0x41634c[_0xf8f7('0xa')]]['answertime']):0x0;writeDB(dials[_0x41634c[_0xf8f7('0xa')]]);}}catch(_0x3a13fb){utils[_0xf8f7('0x1a')](util[_0xf8f7('0x3')](_0xf8f7('0x29'),_0x41634c[_0xf8f7('0xa')]),_0x3a13fb);}};
\ No newline at end of file
index 694165b..d498561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbde1=['[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','devicestatechange','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop'];(function(_0x679fa1,_0x3614fa){var _0x3463b9=function(_0x399529){while(--_0x399529){_0x679fa1['push'](_0x679fa1['shift']());}};_0x3463b9(++_0x3614fa);}(_0xbde1,0x1f3));var _0x1bde=function(_0x4a67eb,_0x431aab){_0x4a67eb=_0x4a67eb-0x0;var _0x1fe03b=_0xbde1[_0x4a67eb];return _0x1fe03b;};var AsteriskManager=require(_0x1bde('0x0'));var config=require(_0x1bde('0x1'));var utils=require(_0x1bde('0x2'));var util=require(_0x1bde('0x3'));var ami=new AsteriskManager(config[_0x1bde('0x4')]['port'],config['asterisk']['ip'],config['asterisk'][_0x1bde('0x5')],config[_0x1bde('0x4')][_0x1bde('0x6')],!![]);ami[_0x1bde('0x7')]();if(config[_0x1bde('0x8')]&&config['xdr']['disabled']){utils[_0x1bde('0x9')](_0x1bde('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x1bde('0xb'));var queues=require(_0x1bde('0xc'));var recordings=require(_0x1bde('0xd'));var members=require(_0x1bde('0xe'));var dials=require(_0x1bde('0xf'));var transfers=require(_0x1bde('0x10'));var core=require(_0x1bde('0x11'));ami['on']('connect',core[_0x1bde('0x12')]);ami['on'](_0x1bde('0x13'),core['shutdown']);ami['on'](_0x1bde('0x14'),core[_0x1bde('0x14')]);ami['on'](_0x1bde('0x15'),core[_0x1bde('0x15')]);ami['on'](_0x1bde('0x16'),core[_0x1bde('0x16')]);ami['on']('managerevent',core[_0x1bde('0x17')]);ami['on']('devicestatechange',function(_0x3389da){try{utils[_0x1bde('0x18')](util['format'](_0x1bde('0x19'),_0x3389da['device']),_0x3389da);members[_0x1bde('0x1a')](_0x3389da);}catch(_0xc16138){utils[_0x1bde('0x15')](util['format'](_0x1bde('0x19'),_0x3389da['device']),_0xc16138);}});ami['on'](_0x1bde('0x1b'),function(_0x1e7a4e){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')](_0x1bde('0x1d'),_0x1e7a4e[_0x1bde('0x1e')]),_0x1e7a4e);agents['agentcalled'](_0x1e7a4e);}catch(_0x10759b){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x1d'),_0x1e7a4e[_0x1bde('0x1e')]),_0x10759b);}});ami['on'](_0x1bde('0x1f'),function(_0x44891f){try{utils[_0x1bde('0x18')](util['format'](_0x1bde('0x20'),_0x44891f[_0x1bde('0x1e')]),_0x44891f);agents[_0x1bde('0x1f')](_0x44891f);}catch(_0x3f05ef){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x20'),_0x44891f[_0x1bde('0x1e')]),_0x3f05ef);}});ami['on'](_0x1bde('0x21'),function(_0x31d503){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x22'),_0x31d503['uniqueid']),_0x31d503);agents[_0x1bde('0x21')](_0x31d503);queues[_0x1bde('0x21')](_0x31d503);}catch(_0x4fb1eb){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')]('[%s][index][agentconnect]',_0x31d503[_0x1bde('0x1e')]),_0x4fb1eb);}});ami['on'](_0x1bde('0x23'),function(_0x1f21aa){try{utils[_0x1bde('0x18')](util['format'](_0x1bde('0x24'),_0x1f21aa[_0x1bde('0x1e')]),_0x1f21aa);agents['agentcomplete'](_0x1f21aa);queues[_0x1bde('0x23')](_0x1f21aa);members['agentcomplete'](_0x1f21aa);}catch(_0x341b40){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')]('[%s][index][agentcomplete]',_0x1f21aa[_0x1bde('0x1e')]),_0x341b40);}});ami['on']('queuecallerabandon',function(_0x3e9c8d){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')]('[%s][index][queuecallerabandon]',_0x3e9c8d[_0x1bde('0x1e')]),_0x3e9c8d);agents[_0x1bde('0x25')](_0x3e9c8d);queues['queuecallerabandon'](_0x3e9c8d);}catch(_0x5fabaa){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x3e9c8d[_0x1bde('0x1e')]),_0x5fabaa);}});ami['on'](_0x1bde('0x26'),function(_0x29649d){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')](_0x1bde('0x27'),_0x29649d[_0x1bde('0x1e')]),_0x29649d);queues[_0x1bde('0x26')](_0x29649d);recordings[_0x1bde('0x26')](_0x29649d);}catch(_0x566f7a){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')](_0x1bde('0x27'),_0x29649d[_0x1bde('0x1e')]),_0x566f7a);}});ami['on'](_0x1bde('0x28'),function(_0x4f3462){try{utils['debug'](util['format'](_0x1bde('0x29'),_0x4f3462[_0x1bde('0x1e')]),_0x4f3462);queues[_0x1bde('0x28')](_0x4f3462);}catch(_0x912458){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x29'),_0x4f3462[_0x1bde('0x1e')]),_0x912458);}});ami['on'](_0x1bde('0x2a'),function(_0x1ce7d0){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x2b'),_0x1ce7d0[_0x1bde('0x1e')]),_0x1ce7d0);queues[_0x1bde('0x2a')](_0x1ce7d0);calls['musiconholdstart'](_0x1ce7d0);}catch(_0x1f7d88){utils[_0x1bde('0x15')](util['format']('[%s][index][musiconholdstart]',_0x1ce7d0[_0x1bde('0x1e')]),_0x1f7d88);}});ami['on'](_0x1bde('0x2c'),function(_0x475147){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')](_0x1bde('0x2d'),_0x475147[_0x1bde('0x1e')]),_0x475147);queues[_0x1bde('0x2c')](_0x475147);calls['musiconholdstop'](_0x475147);}catch(_0x26b1ea){utils[_0x1bde('0x15')](util['format']('[%s][index][musiconholdstop]',_0x475147[_0x1bde('0x1e')]),_0x26b1ea);}});ami['on'](_0x1bde('0x2e'),function(_0x5835e9){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x2f'),_0x5835e9['uniqueid']),_0x5835e9);calls['newstate'](_0x5835e9);recordings['newstate'](_0x5835e9);}catch(_0x4f6624){utils[_0x1bde('0x15')](util['format']('[%s][index][newstate]',_0x5835e9['uniqueid']),_0x4f6624);}});ami['on']('hangup',function(_0x385aa0){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')](_0x1bde('0x30'),_0x385aa0[_0x1bde('0x1e')]),_0x385aa0);calls['hangup'](_0x385aa0);recordings[_0x1bde('0x31')](_0x385aa0);dials['hangup'](_0x385aa0);agents[_0x1bde('0x31')](_0x385aa0);queues[_0x1bde('0x31')](_0x385aa0);}catch(_0x17365f){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x30'),_0x385aa0['uniqueid']),_0x17365f);}});ami['on'](_0x1bde('0x32'),function(_0x21c9d1){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')](_0x1bde('0x33'),_0x21c9d1[_0x1bde('0x1e')]),_0x21c9d1);members[_0x1bde('0x32')](_0x21c9d1);}catch(_0x3631a3){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x33'),_0x21c9d1[_0x1bde('0x1e')]),_0x3631a3);}});ami['on'](_0x1bde('0x34'),function(_0x254466){try{utils['debug'](util[_0x1bde('0x1c')]('[%s][index][blindtransfer]',_0x254466[_0x1bde('0x1e')]),_0x254466);queues['blindtransfer'](_0x254466);agents[_0x1bde('0x34')](_0x254466);transfers[_0x1bde('0x34')](_0x254466);}catch(_0x26502e){utils['error'](util[_0x1bde('0x1c')](_0x1bde('0x35'),_0x254466['uniqueid']),_0x26502e);}});ami['on']('attendedtransfer',function(_0x2f21fb){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x36'),_0x2f21fb[_0x1bde('0x37')]),_0x2f21fb);queues[_0x1bde('0x38')](_0x2f21fb);transfers[_0x1bde('0x38')](_0x2f21fb);agents[_0x1bde('0x38')](_0x2f21fb);calls['attendedtransfer'](_0x2f21fb);}catch(_0x220bad){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')]('[%s][index][attendedtransfer]',_0x2f21fb['origtransfereruniqueid']),_0x220bad);}});ami['on'](_0x1bde('0x39'),function(_0x5118bb){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x3a'),_0x5118bb[_0x1bde('0x1e')]),_0x5118bb);queues[_0x1bde('0x39')](_0x5118bb);recordings[_0x1bde('0x39')](_0x5118bb);calls[_0x1bde('0x39')](_0x5118bb);dials[_0x1bde('0x39')](_0x5118bb);}catch(_0x3334a4){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')]('[%s][index][varset]',_0x5118bb['uniqueid']),_0x3334a4);}});ami['on'](_0x1bde('0x3b'),function(_0x10178c){try{utils['debug'](util[_0x1bde('0x1c')](_0x1bde('0x3c'),_0x10178c[_0x1bde('0x1e')]),_0x10178c);calls[_0x1bde('0x3b')](_0x10178c);recordings[_0x1bde('0x3b')](_0x10178c);dials[_0x1bde('0x3b')](_0x10178c);}catch(_0x15670f){utils[_0x1bde('0x15')](util['format'](_0x1bde('0x3c'),_0x10178c[_0x1bde('0x1e')]),_0x15670f);}});ami['on'](_0x1bde('0x3d'),function(_0x5da30d){try{utils[_0x1bde('0x18')](util['format'](_0x1bde('0x3e'),_0x5da30d['uniqueid']),_0x5da30d);calls[_0x1bde('0x3d')](_0x5da30d);recordings[_0x1bde('0x3d')](_0x5da30d);}catch(_0xe39b13){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')]('[%s][index][newchannel]',_0x5da30d[_0x1bde('0x1e')]),_0xe39b13);}});ami['on'](_0x1bde('0x3f'),function(_0x45d576){try{utils[_0x1bde('0x18')](util['format'](_0x1bde('0x40'),_0x45d576[_0x1bde('0x1e')]),_0x45d576);dials[_0x1bde('0x3f')](_0x45d576);}catch(_0x427bda){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')](_0x1bde('0x41'),_0x45d576[_0x1bde('0x1e')]),_0x427bda);}});ami['on'](_0x1bde('0x42'),function(_0x3cefca){try{utils[_0x1bde('0x18')](util[_0x1bde('0x1c')]('[%s][index][dialend]',_0x3cefca[_0x1bde('0x1e')]),_0x3cefca);dials[_0x1bde('0x42')](_0x3cefca);}catch(_0xce3dec){utils[_0x1bde('0x15')](util[_0x1bde('0x1c')](_0x1bde('0x43'),_0x3cefca['uniqueid']),_0xce3dec);}});}
\ No newline at end of file
+var _0x7f8f=['connect','shutdown','fullybooted','error','close','devicestatechange','debug','[%s][index][devicestatechange]','format','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','asterisk','port','password','keepConnected','xdr','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller'];(function(_0x3e9ed7,_0x3a68b5){var _0xe8752f=function(_0x5e3bc2){while(--_0x5e3bc2){_0x3e9ed7['push'](_0x3e9ed7['shift']());}};_0xe8752f(++_0x3a68b5);}(_0x7f8f,0xe7));var _0xf7f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f8f[_0x321bb2];return _0x9c12ed;};var AsteriskManager=require(_0xf7f8('0x0'));var config=require(_0xf7f8('0x1'));var utils=require('./utils');var util=require(_0xf7f8('0x2'));var ami=new AsteriskManager(config[_0xf7f8('0x3')][_0xf7f8('0x4')],config[_0xf7f8('0x3')]['ip'],config[_0xf7f8('0x3')]['username'],config[_0xf7f8('0x3')][_0xf7f8('0x5')],!![]);ami[_0xf7f8('0x6')]();if(config[_0xf7f8('0x7')]&&config[_0xf7f8('0x7')]['disabled']){utils['info']('XDR\x20DISABLED');}else{var agents=require(_0xf7f8('0x8'));var calls=require('./calls.controller');var queues=require(_0xf7f8('0x9'));var recordings=require(_0xf7f8('0xa'));var members=require('./members.controller');var dials=require(_0xf7f8('0xb'));var transfers=require(_0xf7f8('0xc'));var core=require('./core.controller');ami['on'](_0xf7f8('0xd'),core[_0xf7f8('0xd')]);ami['on'](_0xf7f8('0xe'),core[_0xf7f8('0xe')]);ami['on']('fullybooted',core[_0xf7f8('0xf')]);ami['on'](_0xf7f8('0x10'),core['error']);ami['on'](_0xf7f8('0x11'),core[_0xf7f8('0x11')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xf7f8('0x12'),function(_0x616791){try{utils[_0xf7f8('0x13')](util['format'](_0xf7f8('0x14'),_0x616791['device']),_0x616791);members[_0xf7f8('0x12')](_0x616791);}catch(_0x511712){utils['error'](util[_0xf7f8('0x15')]('[%s][index][devicestatechange]',_0x616791[_0xf7f8('0x16')]),_0x511712);}});ami['on'](_0xf7f8('0x17'),function(_0x3d9afa){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')]('[%s][index][agentcalled]',_0x3d9afa[_0xf7f8('0x18')]),_0x3d9afa);agents[_0xf7f8('0x17')](_0x3d9afa);}catch(_0x2df948){utils['error'](util['format'](_0xf7f8('0x19'),_0x3d9afa['uniqueid']),_0x2df948);}});ami['on'](_0xf7f8('0x1a'),function(_0x133ee2){try{utils['debug'](util[_0xf7f8('0x15')]('[%s][index][agentringnoanswer]',_0x133ee2['uniqueid']),_0x133ee2);agents[_0xf7f8('0x1a')](_0x133ee2);}catch(_0x3fb85f){utils['error'](util[_0xf7f8('0x15')]('[%s][index][agentringnoanswer]',_0x133ee2[_0xf7f8('0x18')]),_0x3fb85f);}});ami['on']('agentconnect',function(_0x3bfee3){try{utils[_0xf7f8('0x13')](util['format'](_0xf7f8('0x1b'),_0x3bfee3['uniqueid']),_0x3bfee3);agents['agentconnect'](_0x3bfee3);queues[_0xf7f8('0x1c')](_0x3bfee3);}catch(_0x282376){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')]('[%s][index][agentconnect]',_0x3bfee3[_0xf7f8('0x18')]),_0x282376);}});ami['on']('agentcomplete',function(_0x474793){try{utils['debug'](util[_0xf7f8('0x15')]('[%s][index][agentcomplete]',_0x474793[_0xf7f8('0x18')]),_0x474793);agents[_0xf7f8('0x1d')](_0x474793);queues['agentcomplete'](_0x474793);members[_0xf7f8('0x1d')](_0x474793);}catch(_0x22a3ee){utils['error'](util[_0xf7f8('0x15')]('[%s][index][agentcomplete]',_0x474793['uniqueid']),_0x22a3ee);}});ami['on'](_0xf7f8('0x1e'),function(_0x2db1ea){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x1f'),_0x2db1ea[_0xf7f8('0x18')]),_0x2db1ea);agents[_0xf7f8('0x1e')](_0x2db1ea);queues[_0xf7f8('0x1e')](_0x2db1ea);}catch(_0xed52b8){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x1f'),_0x2db1ea[_0xf7f8('0x18')]),_0xed52b8);}});ami['on'](_0xf7f8('0x20'),function(_0x5b1e39){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')]('[%s][index][queuecallerjoin]',_0x5b1e39[_0xf7f8('0x18')]),_0x5b1e39);queues[_0xf7f8('0x20')](_0x5b1e39);recordings['queuecallerjoin'](_0x5b1e39);}catch(_0x37ddf4){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x21'),_0x5b1e39[_0xf7f8('0x18')]),_0x37ddf4);}});ami['on'](_0xf7f8('0x22'),function(_0x10d0ad){try{utils['debug'](util['format'](_0xf7f8('0x23'),_0x10d0ad['uniqueid']),_0x10d0ad);queues[_0xf7f8('0x22')](_0x10d0ad);}catch(_0x4bd754){utils['error'](util[_0xf7f8('0x15')](_0xf7f8('0x23'),_0x10d0ad[_0xf7f8('0x18')]),_0x4bd754);}});ami['on'](_0xf7f8('0x24'),function(_0x2274f1){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')]('[%s][index][musiconholdstart]',_0x2274f1['uniqueid']),_0x2274f1);queues[_0xf7f8('0x24')](_0x2274f1);calls[_0xf7f8('0x24')](_0x2274f1);}catch(_0x188493){utils['error'](util[_0xf7f8('0x15')]('[%s][index][musiconholdstart]',_0x2274f1[_0xf7f8('0x18')]),_0x188493);}});ami['on'](_0xf7f8('0x25'),function(_0xd67152){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x26'),_0xd67152[_0xf7f8('0x18')]),_0xd67152);queues[_0xf7f8('0x25')](_0xd67152);calls[_0xf7f8('0x25')](_0xd67152);}catch(_0x4ffb5f){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x26'),_0xd67152[_0xf7f8('0x18')]),_0x4ffb5f);}});ami['on']('newstate',function(_0xe7cd81){try{utils['debug'](util[_0xf7f8('0x15')]('[%s][index][newstate]',_0xe7cd81['uniqueid']),_0xe7cd81);calls[_0xf7f8('0x27')](_0xe7cd81);recordings[_0xf7f8('0x27')](_0xe7cd81);}catch(_0x3876ab){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x28'),_0xe7cd81[_0xf7f8('0x18')]),_0x3876ab);}});ami['on'](_0xf7f8('0x29'),function(_0x198943){try{utils[_0xf7f8('0x13')](util['format'](_0xf7f8('0x2a'),_0x198943[_0xf7f8('0x18')]),_0x198943);calls[_0xf7f8('0x29')](_0x198943);recordings[_0xf7f8('0x29')](_0x198943);dials[_0xf7f8('0x29')](_0x198943);agents[_0xf7f8('0x29')](_0x198943);queues[_0xf7f8('0x29')](_0x198943);}catch(_0x9e59e6){utils[_0xf7f8('0x10')](util['format'](_0xf7f8('0x2a'),_0x198943[_0xf7f8('0x18')]),_0x9e59e6);}});ami['on'](_0xf7f8('0x2b'),function(_0x330bbb){try{utils['debug'](util['format'](_0xf7f8('0x2c'),_0x330bbb[_0xf7f8('0x18')]),_0x330bbb);members[_0xf7f8('0x2b')](_0x330bbb);}catch(_0xba7bd4){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x2c'),_0x330bbb['uniqueid']),_0xba7bd4);}});ami['on'](_0xf7f8('0x2d'),function(_0x315cb6){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x2e'),_0x315cb6[_0xf7f8('0x18')]),_0x315cb6);queues[_0xf7f8('0x2d')](_0x315cb6);agents[_0xf7f8('0x2d')](_0x315cb6);transfers['blindtransfer'](_0x315cb6);}catch(_0x585535){utils['error'](util[_0xf7f8('0x15')](_0xf7f8('0x2e'),_0x315cb6[_0xf7f8('0x18')]),_0x585535);}});ami['on']('attendedtransfer',function(_0x51efd8){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0x51efd8[_0xf7f8('0x2f')]),_0x51efd8);queues[_0xf7f8('0x30')](_0x51efd8);transfers[_0xf7f8('0x30')](_0x51efd8);agents['attendedtransfer'](_0x51efd8);calls[_0xf7f8('0x30')](_0x51efd8);}catch(_0x551825){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x31'),_0x51efd8[_0xf7f8('0x2f')]),_0x551825);}});ami['on']('varset',function(_0x55025e){try{utils['debug'](util['format'](_0xf7f8('0x32'),_0x55025e['uniqueid']),_0x55025e);queues['varset'](_0x55025e);recordings['varset'](_0x55025e);calls[_0xf7f8('0x33')](_0x55025e);dials[_0xf7f8('0x33')](_0x55025e);}catch(_0x549ad5){utils[_0xf7f8('0x10')](util['format'](_0xf7f8('0x32'),_0x55025e[_0xf7f8('0x18')]),_0x549ad5);}});ami['on'](_0xf7f8('0x34'),function(_0x390ab2){try{utils['debug'](util[_0xf7f8('0x15')](_0xf7f8('0x35'),_0x390ab2[_0xf7f8('0x18')]),_0x390ab2);calls[_0xf7f8('0x34')](_0x390ab2);recordings[_0xf7f8('0x34')](_0x390ab2);dials[_0xf7f8('0x34')](_0x390ab2);}catch(_0x4e1114){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x35'),_0x390ab2['uniqueid']),_0x4e1114);}});ami['on'](_0xf7f8('0x36'),function(_0x270546){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x37'),_0x270546['uniqueid']),_0x270546);calls['newchannel'](_0x270546);recordings[_0xf7f8('0x36')](_0x270546);}catch(_0x1636b4){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x37'),_0x270546['uniqueid']),_0x1636b4);}});ami['on']('dialbegin',function(_0x1af461){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x38'),_0x1af461[_0xf7f8('0x18')]),_0x1af461);dials[_0xf7f8('0x39')](_0x1af461);}catch(_0x54b3e9){utils[_0xf7f8('0x10')](util[_0xf7f8('0x15')](_0xf7f8('0x3a'),_0x1af461[_0xf7f8('0x18')]),_0x54b3e9);}});ami['on']('dialend',function(_0x73e1d9){try{utils[_0xf7f8('0x13')](util[_0xf7f8('0x15')](_0xf7f8('0x3b'),_0x73e1d9[_0xf7f8('0x18')]),_0x73e1d9);dials[_0xf7f8('0x3c')](_0x73e1d9);}catch(_0x3c5fc5){utils['error'](util[_0xf7f8('0x15')](_0xf7f8('0x3b'),_0x73e1d9[_0xf7f8('0x18')]),_0x3c5fc5);}});}
\ No newline at end of file
index 1c6523d..002e2d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9795=['data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','destination','./utils','Queue:','format','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','some','startsWith','debug','device','info','state','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','source'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9795,0x92));var _0x5979=function(_0x4faa3b,_0x5ca8c8){_0x4faa3b=_0x4faa3b-0x0;var _0x2b38f6=_0x9795[_0x4faa3b];return _0x2b38f6;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5979('0x0'));var members={};var exclude=['Local/_attended@transfer',_0x5979('0x1')];function writeDB(_0x36746e){utils['info'](util[_0x5979('0x2')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x36746e[_0x5979('0x3')],_0x36746e[_0x5979('0x4')],_0x36746e[_0x5979('0x5')],_0x36746e[_0x5979('0x6')],_0x36746e[_0x5979('0x7')],_0x36746e[_0x5979('0x8')]));if(_0x36746e[_0x5979('0x4')]){utils[_0x5979('0x9')](_0x36746e[_0x5979('0x4')])[_0x5979('0xa')](function(_0x228466){if(_0x228466){_0x36746e[_0x5979('0x7')]=_0x228466[_0x5979('0xb')];_0x36746e['internal']=_0x228466[_0x5979('0xc')];utils[_0x5979('0xd')](_0x5979('0xe'),_0x36746e);}else{utils[_0x5979('0xf')](_0x36746e[_0x5979('0x4')][_0x5979('0x10')]('/')[0x1])[_0x5979('0xa')](function(_0x219409){if(_0x219409){_0x36746e[_0x5979('0x7')]=_0x219409['name'];_0x36746e[_0x5979('0xc')]=_0x219409['internal'];utils['request']('CreateMemberReport',_0x36746e);}});}})[_0x5979('0x11')](function(_0x26e2ba){utils['error'](util['format'](_0x5979('0x12'),_0x36746e[_0x5979('0x3')]),_0x26e2ba);});}delete members[_0x36746e[_0x5979('0x4')]];}function startsWith(_0xa8a57c,_0x50c7ef){return _[_0x5979('0x13')](_0xa8a57c,function(_0x3892b3){return _[_0x5979('0x14')](_0x50c7ef,_0x3892b3);});}exports['devicestatechange']=function(_0x5d14be){try{utils[_0x5979('0x15')](util['format']('[%s][members][devicestatechange]',members[_0x5d14be[_0x5979('0x16')]]?members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x3')]:_0x5d14be[_0x5979('0x16')]),_0x5d14be);utils[_0x5979('0x17')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5d14be['device']]?members[_0x5d14be[_0x5979('0x16')]]['uniqueid']:_0x5d14be[_0x5979('0x16')],_0x5d14be['state'],_0x5d14be[_0x5979('0x16')]));switch(_0x5d14be[_0x5979('0x18')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x5d14be[_0x5979('0x16')])){members[_0x5d14be['device']]={'channel':_0x5979('0x19'),'interface':_0x5d14be['device'],'type':_0x5979('0x1a'),'enterAt':utils[_0x5979('0x1b')](),'role':_0x5979('0x1c')};}break;case'NOT_INUSE':if(!_[_0x5979('0x1d')](members[_0x5d14be[_0x5979('0x16')]])){members[_0x5d14be['device']][_0x5979('0x1e')]=utils[_0x5979('0x1b')]();members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x1f')]=utils[_0x5979('0x20')](members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x1e')],members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x21')]);if(members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x3')]){writeDB(members[_0x5d14be[_0x5979('0x16')]]);}}break;default:break;}}catch(_0x44e6e3){utils[_0x5979('0x22')](util[_0x5979('0x2')]('[%s][members][devicestatechange]',members[_0x5d14be[_0x5979('0x16')]]?members[_0x5d14be[_0x5979('0x16')]][_0x5979('0x3')]:_0x5d14be['device']),_0x44e6e3);}};exports[_0x5979('0x23')]=function(_0x7bdc5){try{if(!_[_0x5979('0x1d')](members[_0x7bdc5[_0x5979('0x4')]])){utils[_0x5979('0x15')](util[_0x5979('0x2')]('[%s][members][agentcomplete]',_0x7bdc5['uniqueid']),_0x7bdc5);utils[_0x5979('0x17')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x7bdc5['uniqueid'],_0x7bdc5['interface'],_0x7bdc5[_0x5979('0x24')]));members[_0x7bdc5[_0x5979('0x4')]]=_['assign'](members[_0x7bdc5['interface']],{'data4':_0x7bdc5[_0x5979('0x24')],'uniqueid':_0x7bdc5[_0x5979('0x3')]});}}catch(_0x1ca102){utils[_0x5979('0x22')](util[_0x5979('0x2')](_0x5979('0x25'),_0x7bdc5[_0x5979('0x3')]),_0x1ca102);}};exports[_0x5979('0x26')]=function(_0x55862b){try{utils[_0x5979('0x15')](util['format'](_0x5979('0x27'),_0x55862b[_0x5979('0x3')]),_0x55862b);if(_0x55862b[_0x5979('0x5')]){var _0xa493be=_0x55862b[_0x5979('0x5')][_0x5979('0x10')]('-')[0x0];if(!_[_0x5979('0x1d')](members[_0xa493be])){members[_0xa493be]=_[_0x5979('0x28')](members[_0xa493be],{'data1':members[_0xa493be]['data1']||_0x55862b[_0x5979('0x8')],'data2':members[_0xa493be][_0x5979('0x6')]||_0x55862b[_0x5979('0x29')],'data3':members[_0xa493be][_0x5979('0x2a')]||_0x55862b['destination'],'uniqueid':members[_0xa493be][_0x5979('0x3')]||_0x55862b[_0x5979('0x3')]});utils[_0x5979('0x17')](util[_0x5979('0x2')](_0x5979('0x2b'),_0x55862b[_0x5979('0x3')],members[_0xa493be][_0x5979('0x2c')],members[_0xa493be]['data2'],members[_0xa493be][_0x5979('0x2a')]));if(members[_0xa493be][_0x5979('0x1e')]){writeDB(members[_0xa493be]);}}}if(_0x55862b['destinationchannel']){var _0x4eb50b=_0x55862b[_0x5979('0x2d')][_0x5979('0x10')]('-')[0x0];if(!_[_0x5979('0x1d')](members[_0x4eb50b])){members[_0x4eb50b]=_[_0x5979('0x28')](members[_0x4eb50b],{'data1':members[_0x4eb50b][_0x5979('0x2c')]||_0x55862b['type'],'data2':members[_0x4eb50b]['data2']||_0x55862b[_0x5979('0x29')],'data3':members[_0x4eb50b][_0x5979('0x2a')]||_0x55862b[_0x5979('0x2e')],'uniqueid':members[_0x4eb50b][_0x5979('0x3')]||_0x55862b[_0x5979('0x3')]});utils[_0x5979('0x17')](util[_0x5979('0x2')](_0x5979('0x2b'),_0x55862b[_0x5979('0x3')],members[_0x4eb50b][_0x5979('0x2c')],members[_0x4eb50b][_0x5979('0x6')],members[_0x4eb50b][_0x5979('0x2a')]));if(members[_0x4eb50b][_0x5979('0x1e')]){writeDB(members[_0x4eb50b]);}}}}catch(_0x74d6c3){utils[_0x5979('0x22')](util[_0x5979('0x2')](_0x5979('0x27'),_0x55862b[_0x5979('0x3')]),_0x74d6c3);}};
\ No newline at end of file
+var _0xf963=['diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','channel','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','type','getUserByInterface','then','membername','internal','request','CreateMemberReport','getUserByName','split','name','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration'];(function(_0x4df4ba,_0xcc08a9){var _0x18b851=function(_0x253175){while(--_0x253175){_0x4df4ba['push'](_0x4df4ba['shift']());}};_0x18b851(++_0xcc08a9);}(_0xf963,0x11f));var _0x3f96=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf963[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x3f96('0x0'));var util=require(_0x3f96('0x1'));var utils=require(_0x3f96('0x2'));var members={};var exclude=[_0x3f96('0x3'),'Queue:'];function writeDB(_0x4fce63){utils[_0x3f96('0x4')](util[_0x3f96('0x5')](_0x3f96('0x6'),_0x4fce63['uniqueid'],_0x4fce63[_0x3f96('0x7')],_0x4fce63['channel'],_0x4fce63['data2'],_0x4fce63['membername'],_0x4fce63[_0x3f96('0x8')]));if(_0x4fce63[_0x3f96('0x7')]){utils[_0x3f96('0x9')](_0x4fce63['interface'])[_0x3f96('0xa')](function(_0x4443db){if(_0x4443db){_0x4fce63[_0x3f96('0xb')]=_0x4443db['name'];_0x4fce63[_0x3f96('0xc')]=_0x4443db[_0x3f96('0xc')];utils[_0x3f96('0xd')](_0x3f96('0xe'),_0x4fce63);}else{utils[_0x3f96('0xf')](_0x4fce63[_0x3f96('0x7')][_0x3f96('0x10')]('/')[0x1])[_0x3f96('0xa')](function(_0x5b9b35){if(_0x5b9b35){_0x4fce63[_0x3f96('0xb')]=_0x5b9b35[_0x3f96('0x11')];_0x4fce63[_0x3f96('0xc')]=_0x5b9b35['internal'];utils[_0x3f96('0xd')](_0x3f96('0xe'),_0x4fce63);}});}})[_0x3f96('0x12')](function(_0x55d9b1){utils[_0x3f96('0x13')](util[_0x3f96('0x5')](_0x3f96('0x14'),_0x4fce63[_0x3f96('0x15')]),_0x55d9b1);});}delete members[_0x4fce63[_0x3f96('0x7')]];}function startsWith(_0x379b21,_0x5066c2){return _[_0x3f96('0x16')](_0x379b21,function(_0x1e8554){return _[_0x3f96('0x17')](_0x5066c2,_0x1e8554);});}exports[_0x3f96('0x18')]=function(_0x217f35){try{utils[_0x3f96('0x19')](util['format'](_0x3f96('0x1a'),members[_0x217f35['device']]?members[_0x217f35[_0x3f96('0x1b')]][_0x3f96('0x15')]:_0x217f35[_0x3f96('0x1b')]),_0x217f35);utils[_0x3f96('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x217f35[_0x3f96('0x1b')]]?members[_0x217f35[_0x3f96('0x1b')]][_0x3f96('0x15')]:_0x217f35[_0x3f96('0x1b')],_0x217f35[_0x3f96('0x1c')],_0x217f35[_0x3f96('0x1b')]));switch(_0x217f35[_0x3f96('0x1c')]){case'INUSE':case _0x3f96('0x1d'):if(!startsWith(exclude,_0x217f35['device'])){members[_0x217f35[_0x3f96('0x1b')]]={'channel':_0x3f96('0x1e'),'interface':_0x217f35[_0x3f96('0x1b')],'type':_0x3f96('0x1f'),'enterAt':utils[_0x3f96('0x20')](),'role':_0x3f96('0x21')};}break;case _0x3f96('0x22'):if(!_[_0x3f96('0x23')](members[_0x217f35['device']])){members[_0x217f35[_0x3f96('0x1b')]]['exitAt']=utils['now']();members[_0x217f35['device']][_0x3f96('0x24')]=utils[_0x3f96('0x25')](members[_0x217f35[_0x3f96('0x1b')]][_0x3f96('0x26')],members[_0x217f35[_0x3f96('0x1b')]][_0x3f96('0x27')]);if(members[_0x217f35['device']][_0x3f96('0x15')]){writeDB(members[_0x217f35[_0x3f96('0x1b')]]);}}break;default:break;}}catch(_0x36a090){utils[_0x3f96('0x13')](util[_0x3f96('0x5')](_0x3f96('0x1a'),members[_0x217f35[_0x3f96('0x1b')]]?members[_0x217f35[_0x3f96('0x1b')]][_0x3f96('0x15')]:_0x217f35[_0x3f96('0x1b')]),_0x36a090);}};exports[_0x3f96('0x28')]=function(_0x2864f9){try{if(!_[_0x3f96('0x23')](members[_0x2864f9[_0x3f96('0x7')]])){utils[_0x3f96('0x19')](util[_0x3f96('0x5')](_0x3f96('0x29'),_0x2864f9[_0x3f96('0x15')]),_0x2864f9);utils[_0x3f96('0x4')](util[_0x3f96('0x5')](_0x3f96('0x2a'),_0x2864f9[_0x3f96('0x15')],_0x2864f9[_0x3f96('0x7')],_0x2864f9[_0x3f96('0x2b')]));members[_0x2864f9[_0x3f96('0x7')]]=_[_0x3f96('0x2c')](members[_0x2864f9['interface']],{'data4':_0x2864f9['queue'],'uniqueid':_0x2864f9[_0x3f96('0x15')]});}}catch(_0xca37ad){utils[_0x3f96('0x13')](util[_0x3f96('0x5')](_0x3f96('0x29'),_0x2864f9['uniqueid']),_0xca37ad);}};exports['cdr']=function(_0x4c1d25){try{utils[_0x3f96('0x19')](util['format'](_0x3f96('0x2d'),_0x4c1d25[_0x3f96('0x15')]),_0x4c1d25);if(_0x4c1d25[_0x3f96('0x2e')]){var _0x4d7b00=_0x4c1d25[_0x3f96('0x2e')][_0x3f96('0x10')]('-')[0x0];if(!_[_0x3f96('0x23')](members[_0x4d7b00])){members[_0x4d7b00]=_['assign'](members[_0x4d7b00],{'data1':members[_0x4d7b00][_0x3f96('0x2f')]||_0x4c1d25[_0x3f96('0x8')],'data2':members[_0x4d7b00][_0x3f96('0x30')]||_0x4c1d25[_0x3f96('0x31')],'data3':members[_0x4d7b00][_0x3f96('0x32')]||_0x4c1d25[_0x3f96('0x33')],'uniqueid':members[_0x4d7b00][_0x3f96('0x15')]||_0x4c1d25[_0x3f96('0x15')]});utils[_0x3f96('0x4')](util[_0x3f96('0x5')](_0x3f96('0x34'),_0x4c1d25[_0x3f96('0x15')],members[_0x4d7b00][_0x3f96('0x2f')],members[_0x4d7b00]['data2'],members[_0x4d7b00]['data3']));if(members[_0x4d7b00][_0x3f96('0x26')]){writeDB(members[_0x4d7b00]);}}}if(_0x4c1d25[_0x3f96('0x35')]){var _0x16b184=_0x4c1d25[_0x3f96('0x35')][_0x3f96('0x10')]('-')[0x0];if(!_[_0x3f96('0x23')](members[_0x16b184])){members[_0x16b184]=_[_0x3f96('0x2c')](members[_0x16b184],{'data1':members[_0x16b184][_0x3f96('0x2f')]||_0x4c1d25[_0x3f96('0x8')],'data2':members[_0x16b184][_0x3f96('0x30')]||_0x4c1d25[_0x3f96('0x31')],'data3':members[_0x16b184][_0x3f96('0x32')]||_0x4c1d25['destination'],'uniqueid':members[_0x16b184][_0x3f96('0x15')]||_0x4c1d25[_0x3f96('0x15')]});utils[_0x3f96('0x4')](util[_0x3f96('0x5')](_0x3f96('0x34'),_0x4c1d25[_0x3f96('0x15')],members[_0x16b184][_0x3f96('0x2f')],members[_0x16b184]['data2'],members[_0x16b184][_0x3f96('0x32')]));if(members[_0x16b184][_0x3f96('0x26')]){writeDB(members[_0x16b184]);}}}}catch(_0x1a19b4){utils[_0x3f96('0x13')](util[_0x3f96('0x5')]('[%s][members][cdr]',_0x4c1d25['uniqueid']),_0x1a19b4);}};
\ No newline at end of file
index 4425e44..7778705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c4=['debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin'];(function(_0x559bd4,_0x118183){var _0xbe8e0f=function(_0x52c8d0){while(--_0x52c8d0){_0x559bd4['push'](_0x559bd4['shift']());}};_0xbe8e0f(++_0x118183);}(_0xa3c4,0x1f2));var _0x4a3c=function(_0x4596ef,_0x4cffec){_0x4596ef=_0x4596ef-0x0;var _0x1b621a=_0xa3c4[_0x4596ef];return _0x1b621a;};'use strict';var _=require(_0x4a3c('0x0'));var util=require(_0x4a3c('0x1'));var utils=require(_0x4a3c('0x2'));var queues={};function writeDB(_0x5b338e){utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5b338e[_0x4a3c('0x5')],_0x5b338e['channel'],_0x5b338e[_0x4a3c('0x6')],_0x5b338e[_0x4a3c('0x7')],_0x5b338e[_0x4a3c('0x8')],_0x5b338e['accountcode'],_0x5b338e[_0x4a3c('0x9')]));if(_0x5b338e[_0x4a3c('0x6')]){utils[_0x4a3c('0xa')](_0x5b338e[_0x4a3c('0x6')])[_0x4a3c('0xb')](function(_0x1c7b6a){if(_0x1c7b6a){_0x5b338e[_0x4a3c('0xc')]=_0x1c7b6a[_0x4a3c('0xc')];}utils[_0x4a3c('0xd')](_0x4a3c('0xe'),_0x5b338e);});}else{utils['request'](_0x4a3c('0xe'),_0x5b338e);}if(_0x5b338e[_0x4a3c('0xf')]){delete queues[_0x5b338e[_0x4a3c('0xf')]];}else{delete queues[_0x5b338e[_0x4a3c('0x5')]];}}exports[_0x4a3c('0x10')]=function(_0x1af667){try{utils[_0x4a3c('0x11')](util['format'](_0x4a3c('0x12'),_0x1af667['uniqueid']),_0x1af667);utils['info'](util[_0x4a3c('0x4')](_0x4a3c('0x13'),_0x1af667[_0x4a3c('0x5')],_0x1af667['queue'],_0x1af667[_0x4a3c('0x14')]));queues[_0x1af667['uniqueid']]=_[_0x4a3c('0x15')](_0x1af667,{'originalposition':_0x1af667[_0x4a3c('0x14')],'queuecallerjoinAt':utils[_0x4a3c('0x16')](),'mohtime':0x0});}catch(_0x331b5d){utils[_0x4a3c('0x17')](util[_0x4a3c('0x4')](_0x4a3c('0x12'),_0x1af667[_0x4a3c('0x5')]),_0x331b5d);}};exports[_0x4a3c('0x18')]=function(_0x917f16){try{if(!_[_0x4a3c('0x19')](queues[_0x917f16[_0x4a3c('0x5')]])){utils[_0x4a3c('0x11')](util['format'](_0x4a3c('0x1a'),_0x917f16[_0x4a3c('0x5')]),_0x917f16);if(queues[_0x917f16[_0x4a3c('0x5')]]['queuecallerleaveAt']){if(!queues[_0x917f16['uniqueid']][_0x4a3c('0x1b')]&&!queues[_0x917f16[_0x4a3c('0x5')]]['queuecallerexit']){queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0x1c')]=!![];queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0x1d')]=utils['now']();queues[_0x917f16[_0x4a3c('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x917f16[_0x4a3c('0x5')],queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0x1e')],queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0x9')]));writeDB(queues[_0x917f16[_0x4a3c('0x5')]]);}else if(queues[_0x917f16['uniqueid']]['transfereduniqueid']){utils[_0x4a3c('0x3')](util['format'](_0x4a3c('0x1f'),_0x917f16[_0x4a3c('0x5')],queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0x1e')],queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0xf')]));queues[queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0xf')]]=queues[_0x917f16[_0x4a3c('0x5')]];queues[queues[_0x917f16[_0x4a3c('0x5')]][_0x4a3c('0xf')]][_0x4a3c('0x20')]=0x2;delete queues[_0x917f16[_0x4a3c('0x5')]];}}}catch(_0x10918a){utils[_0x4a3c('0x17')](util['format'](_0x4a3c('0x1a'),_0x917f16[_0x4a3c('0x5')]),_0x10918a);}};exports[_0x4a3c('0x21')]=function(_0x1a5635){try{utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')]('[%s][queues][varset]',_0x1a5635['uniqueid']),_0x1a5635);if(!_[_0x4a3c('0x19')](_0x1a5635[_0x4a3c('0x22')][_0x4a3c('0x23')])&&_0x1a5635[_0x4a3c('0x24')][_0x4a3c('0x25')]()!==_0x4a3c('0x26')){if(!_[_0x4a3c('0x19')](queues[_0x1a5635['uniqueid']])){queues[_0x1a5635['uniqueid']][_0x4a3c('0x1b')]=![];queues[_0x1a5635[_0x4a3c('0x5')]]['queuecallerabandonAt']=null;queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x27')]=!![];queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x28')]=utils[_0x4a3c('0x16')]();queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x9')]=_0x1a5635[_0x4a3c('0x24')][_0x4a3c('0x25')]();utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')](_0x4a3c('0x29'),_0x1a5635[_0x4a3c('0x5')],queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x1e')],_0x1a5635[_0x4a3c('0x24')],queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x9')]));writeDB(queues[_0x1a5635[_0x4a3c('0x5')]]);}}else if(!_[_0x4a3c('0x19')](_0x1a5635[_0x4a3c('0x22')][_0x4a3c('0x2a')])){if(!_['isNil'](queues[_0x1a5635[_0x4a3c('0x5')]])&&!queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x1b')]){queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x1b')]=![];queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x2b')]=null;queues[_0x1a5635[_0x4a3c('0x5')]][_0x4a3c('0x27')]=!![];queues[_0x1a5635['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x1a5635['uniqueid']][_0x4a3c('0x9')]='EXITWITHKEY';utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1a5635['uniqueid'],queues[_0x1a5635['uniqueid']][_0x4a3c('0x1e')],_0x1a5635['value'],queues[_0x1a5635[_0x4a3c('0x5')]]['queuecallerexitreason']));}}}catch(_0x101de8){utils[_0x4a3c('0x17')](util[_0x4a3c('0x4')](_0x4a3c('0x2c'),_0x1a5635['uniqueid']),_0x101de8);}};exports[_0x4a3c('0x1b')]=function(_0x1fd46e){try{if(!_[_0x4a3c('0x19')](queues[_0x1fd46e[_0x4a3c('0x5')]])){utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')]('[%s][queues][queuecallerabandon]',_0x1fd46e[_0x4a3c('0x5')]),_0x1fd46e);queues[_0x1fd46e[_0x4a3c('0x5')]]['queuecallerexit']=![];queues[_0x1fd46e[_0x4a3c('0x5')]][_0x4a3c('0x28')]=null;queues[_0x1fd46e[_0x4a3c('0x5')]][_0x4a3c('0x1b')]=!![];queues[_0x1fd46e['uniqueid']][_0x4a3c('0x2b')]=utils['now']();queues[_0x1fd46e['uniqueid']]['queuecallerexitreason']=_0x4a3c('0x2d');utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1fd46e[_0x4a3c('0x5')],queues[_0x1fd46e[_0x4a3c('0x5')]][_0x4a3c('0x1e')],queues[_0x1fd46e[_0x4a3c('0x5')]][_0x4a3c('0x9')]));}}catch(_0x51e443){utils[_0x4a3c('0x17')](util[_0x4a3c('0x4')]('[%s][queues][queuecallerabandon]',_0x1fd46e[_0x4a3c('0x5')]),_0x51e443);}};exports[_0x4a3c('0x2e')]=function(_0x2b6682){try{if(!_[_0x4a3c('0x19')](queues[_0x2b6682[_0x4a3c('0x5')]])){utils[_0x4a3c('0x11')](util['format'](_0x4a3c('0x2f'),_0x2b6682[_0x4a3c('0x5')]),_0x2b6682);utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2b6682['uniqueid'],queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x1e')],_0x2b6682[_0x4a3c('0x30')],_0x2b6682[_0x4a3c('0x31')]));queues[_0x2b6682[_0x4a3c('0x5')]]['queuecallerleave']=!![];queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x32')]=utils[_0x4a3c('0x16')]();queues[_0x2b6682['uniqueid']][_0x4a3c('0x33')]=utils[_0x4a3c('0x34')](queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x32')],queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x35')]);queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x14')]=_0x2b6682[_0x4a3c('0x14')];queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x36')]=_0x2b6682[_0x4a3c('0x36')];queues[_0x2b6682[_0x4a3c('0x5')]][_0x4a3c('0x30')]=_0x2b6682[_0x4a3c('0x30')];queues[_0x2b6682[_0x4a3c('0x5')]]['connectedlinename']=_0x2b6682[_0x4a3c('0x31')];}}catch(_0x4a174b){utils['error'](util[_0x4a3c('0x4')](_0x4a3c('0x2f'),_0x2b6682[_0x4a3c('0x5')]),_0x4a174b);}};exports[_0x4a3c('0x37')]=function(_0x4a3939){try{if(!_['isNil'](queues[_0x4a3939['uniqueid']])){utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')](_0x4a3c('0x38'),_0x4a3939[_0x4a3c('0x5')]),_0x4a3939);utils['info'](util['format'](_0x4a3c('0x39'),_0x4a3939[_0x4a3c('0x5')],queues[_0x4a3939[_0x4a3c('0x5')]][_0x4a3c('0x1e')],_0x4a3939[_0x4a3c('0x3a')],_0x4a3939['destaccountcode']));queues[_0x4a3939['uniqueid']]['queuecallerabandon']=![];queues[_0x4a3939['uniqueid']]['queuecallerabandon']=![];queues[_0x4a3939['uniqueid']][_0x4a3c('0x2b')]=null;queues[_0x4a3939[_0x4a3c('0x5')]][_0x4a3c('0x27')]=![];queues[_0x4a3939[_0x4a3c('0x5')]][_0x4a3c('0x9')]=null;queues[_0x4a3939['uniqueid']][_0x4a3c('0x28')]=null;queues[_0x4a3939[_0x4a3c('0x5')]][_0x4a3c('0x3b')]=!![];queues[_0x4a3939[_0x4a3c('0x5')]][_0x4a3c('0x3c')]=_0x4a3939['destaccountcode'];queues[_0x4a3939['uniqueid']][_0x4a3c('0x7')]=_0x4a3939['membername'];}}catch(_0xedd484){utils[_0x4a3c('0x17')](util['format']('[%s][queues][agentconnect]',_0x4a3939['uniqueid']),_0xedd484);}};exports[_0x4a3c('0x3d')]=function(_0x3b6d4d){try{if(!_[_0x4a3c('0x19')](queues[_0x3b6d4d['uniqueid']])){if(queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x32')]){utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')](_0x4a3c('0x3e'),_0x3b6d4d[_0x4a3c('0x5')]),_0x3b6d4d);queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x1b')]=![];queues[_0x3b6d4d[_0x4a3c('0x5')]]['queuecallerabandon']=![];queues[_0x3b6d4d['uniqueid']][_0x4a3c('0x2b')]=null;queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x27')]=![];queues[_0x3b6d4d[_0x4a3c('0x5')]]['queuecallerexitAt']=null;queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x3b')]=!![];queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x7')]=_0x3b6d4d[_0x4a3c('0x3a')];queues[_0x3b6d4d['uniqueid']][_0x4a3c('0x1c')]=!![];queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x1d')]=utils[_0x4a3c('0x16')]();if(_0x3b6d4d[_0x4a3c('0x3f')]==_0x4a3c('0x40')){if(!queues[_0x3b6d4d['uniqueid']]['transfer']){queues[_0x3b6d4d['uniqueid']][_0x4a3c('0x9')]='TRANSFER';}}else{queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x9')]='COMPLETEDBY'+_0x3b6d4d[_0x4a3c('0x3f')][_0x4a3c('0x25')]();}utils['info'](util['format'](_0x4a3c('0x41'),_0x3b6d4d[_0x4a3c('0x5')],queues[_0x3b6d4d['uniqueid']][_0x4a3c('0x1e')],_0x3b6d4d['membername'],queues[_0x3b6d4d[_0x4a3c('0x5')]][_0x4a3c('0x9')]));writeDB(queues[_0x3b6d4d[_0x4a3c('0x5')]]);}}}catch(_0x42ba94){utils['error'](util['format']('[%s][queues][agentcomplete]',_0x3b6d4d['uniqueid']),_0x42ba94);}};exports[_0x4a3c('0x42')]=function(_0x390fbb){try{if(!_['isNil'](queues[_0x390fbb[_0x4a3c('0x43')]])){utils[_0x4a3c('0x11')](util['format'](_0x4a3c('0x44'),_0x390fbb[_0x4a3c('0x5')]),_0x390fbb);queues[_0x390fbb[_0x4a3c('0x43')]]['transfer']=!![];queues[_0x390fbb[_0x4a3c('0x43')]]['transfertype']=_0x4a3c('0x45');queues[_0x390fbb[_0x4a3c('0x43')]]['transferexten']=_0x390fbb[_0x4a3c('0x46')];queues[_0x390fbb[_0x4a3c('0x43')]][_0x4a3c('0x47')]=_0x390fbb[_0x4a3c('0x43')];queues[_0x390fbb[_0x4a3c('0x43')]][_0x4a3c('0x9')]=_0x4a3c('0x48');utils['info'](util[_0x4a3c('0x4')](_0x4a3c('0x49'),_0x390fbb['uniqueid'],queues[_0x390fbb[_0x4a3c('0x43')]][_0x4a3c('0x1e')],_0x390fbb['transfereeuniqueid'],_0x390fbb[_0x4a3c('0x46')]));}}catch(_0x3a65aa){utils[_0x4a3c('0x17')](util[_0x4a3c('0x4')](_0x4a3c('0x44'),_0x390fbb[_0x4a3c('0x5')]),_0x3a65aa);}};exports[_0x4a3c('0x4a')]=function(_0x246cfd){try{utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')]('[%s][queues][attendedtransfer]',_0x246cfd['origtransfereruniqueid']),_0x246cfd);if(_0x246cfd[_0x4a3c('0x4b')]==_0x246cfd[_0x4a3c('0x4c')]){if(!_[_0x4a3c('0x19')](queues[_0x246cfd[_0x4a3c('0x4d')]])){utils['info'](util[_0x4a3c('0x4')](_0x4a3c('0x4e'),_0x246cfd['origtransfereruniqueid'],queues[_0x246cfd[_0x4a3c('0x4d')]][_0x4a3c('0x1e')],_0x246cfd[_0x4a3c('0x4f')]));queues[_0x246cfd[_0x4a3c('0x4d')]]['transfer']=!![];queues[_0x246cfd[_0x4a3c('0x4d')]][_0x4a3c('0x50')]=_0x4a3c('0x51');queues[_0x246cfd[_0x4a3c('0x4d')]]['transferexten']=_0x246cfd[_0x4a3c('0x4f')];queues[_0x246cfd['secondtransfererlinkedid']]['transferuniqueid']=_0x246cfd['origtransfereruniqueid'];queues[_0x246cfd[_0x4a3c('0x4d')]][_0x4a3c('0x9')]=_0x4a3c('0x52');}if(!_['isNil'](queues[_0x246cfd[_0x4a3c('0x4c')]])){if(_0x246cfd[_0x4a3c('0x53')]&&queues[_0x246cfd[_0x4a3c('0x53')]]){queues[_0x246cfd[_0x4a3c('0x53')]][_0x4a3c('0x20')]=0x1;queues[_0x246cfd[_0x4a3c('0x43')]]=_[_0x4a3c('0x54')](queues[_0x246cfd['transfereelinkedid']]);queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0xf')]=_0x246cfd[_0x4a3c('0x55')];queues[_0x246cfd['transfereeuniqueid']][_0x4a3c('0x20')]=0x2;queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x8')]=queues[_0x246cfd['secondtransfererlinkedid']]['calleridnum'];queues[_0x246cfd[_0x4a3c('0x43')]]['calleridname']=queues[_0x246cfd[_0x4a3c('0x4d')]][_0x4a3c('0x56')];queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x35')]=utils[_0x4a3c('0x16')]();queues[_0x246cfd[_0x4a3c('0x43')]]['queuecallerleaveAt']=utils[_0x4a3c('0x16')]();queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x33')]=0x0;queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x57')]=0x0;utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x246cfd['origtransfereruniqueid'],queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x1e')],queues[_0x246cfd['transfereeuniqueid']][_0x4a3c('0x8')],queues[_0x246cfd[_0x4a3c('0x43')]][_0x4a3c('0x56')]));}else{utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')](_0x4a3c('0x58'),_0x246cfd[_0x4a3c('0x4b')],queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x1e')],_0x246cfd[_0x4a3c('0x4d')]));queues[_0x246cfd[_0x4a3c('0x4c')]]['transfereduniqueid']=_0x246cfd[_0x4a3c('0x4d')];}}}else if(_0x246cfd[_0x4a3c('0x59')]==_0x246cfd[_0x4a3c('0x4d')]){if(!_[_0x4a3c('0x19')](queues[_0x246cfd['origtransfererlinkedid']])){utils[_0x4a3c('0x3')](util['format'](_0x4a3c('0x5a'),_0x246cfd[_0x4a3c('0x4b')],queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x1e')],_0x246cfd[_0x4a3c('0x59')],_0x246cfd[_0x4a3c('0x5b')]));queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x40')]=!![];queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x50')]='ATTENDED';queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x5c')]=_0x246cfd[_0x4a3c('0x5b')];queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x47')]=_0x246cfd[_0x4a3c('0x59')];queues[_0x246cfd[_0x4a3c('0x4c')]][_0x4a3c('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x4a3c('0x19')](queues[_0x246cfd['secondtransfererlinkedid']])){if(_0x246cfd[_0x4a3c('0x5d')]&&queues[_0x246cfd['transfertargetlinkedid']]){queues[_0x246cfd[_0x4a3c('0x5d')]][_0x4a3c('0x20')]=0x1;queues[_0x246cfd['transfertargetuniqueid']]=_[_0x4a3c('0x54')](queues[_0x246cfd[_0x4a3c('0x5d')]]);queues[_0x246cfd['transfertargetuniqueid']][_0x4a3c('0xf')]=_0x246cfd['transfertargetuniqueid'];queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x20')]=0x2;queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x8')]=queues[_0x246cfd[_0x4a3c('0x4c')]]['calleridnum'];queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x56')]=queues[_0x246cfd[_0x4a3c('0x4c')]]['calleridname'];queues[_0x246cfd[_0x4a3c('0x55')]]['queuecallerjoinAt']=utils[_0x4a3c('0x16')]();queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x32')]=utils[_0x4a3c('0x16')]();queues[_0x246cfd['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x246cfd['transfertargetuniqueid']][_0x4a3c('0x57')]=0x0;utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')](_0x4a3c('0x5e'),_0x246cfd['origtransfereruniqueid'],queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x1e')],queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0xf')],queues[_0x246cfd['transfertargetuniqueid']]['calleridnum'],queues[_0x246cfd[_0x4a3c('0x55')]][_0x4a3c('0x56')]));}else{utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x246cfd[_0x4a3c('0x4b')],queues[_0x246cfd[_0x4a3c('0x4d')]]['name'],_0x246cfd['origtransfererlinkedid']));queues[_0x246cfd['secondtransfererlinkedid']][_0x4a3c('0xf')]=_0x246cfd['origtransfererlinkedid'];}}}}catch(_0x1f8df0){utils[_0x4a3c('0x17')](util[_0x4a3c('0x4')](_0x4a3c('0x5f'),_0x246cfd[_0x4a3c('0x4b')]),_0x1f8df0);}};exports[_0x4a3c('0x60')]=function(_0x3e0199){try{if(!_[_0x4a3c('0x19')](queues[_0x3e0199['uniqueid']])){utils['debug'](util['format'](_0x4a3c('0x61'),_0x3e0199[_0x4a3c('0x5')]),_0x3e0199);queues[_0x3e0199[_0x4a3c('0x5')]][_0x4a3c('0x62')]=utils[_0x4a3c('0x16')]();utils[_0x4a3c('0x3')](util[_0x4a3c('0x4')](_0x4a3c('0x63'),_0x3e0199[_0x4a3c('0x5')],queues[_0x3e0199[_0x4a3c('0x5')]][_0x4a3c('0x1e')],queues[_0x3e0199[_0x4a3c('0x5')]]['musiconholdstartAt']));}}catch(_0x184407){utils['error'](util['format'](_0x4a3c('0x61'),_0x3e0199[_0x4a3c('0x5')]),_0x184407);}};exports[_0x4a3c('0x64')]=function(_0x4d77ad){try{if(!_['isNil'](queues[_0x4d77ad[_0x4a3c('0x5')]])){if(!_[_0x4a3c('0x19')](queues[_0x4d77ad['uniqueid']][_0x4a3c('0x62')])){utils[_0x4a3c('0x11')](util[_0x4a3c('0x4')](_0x4a3c('0x65'),_0x4d77ad[_0x4a3c('0x5')]),_0x4d77ad);queues[_0x4d77ad['uniqueid']][_0x4a3c('0x57')]+=utils['diffTime'](utils[_0x4a3c('0x16')](),queues[_0x4d77ad[_0x4a3c('0x5')]][_0x4a3c('0x62')]);utils['info'](util[_0x4a3c('0x4')](_0x4a3c('0x66'),_0x4d77ad[_0x4a3c('0x5')],queues[_0x4d77ad[_0x4a3c('0x5')]][_0x4a3c('0x1e')],queues[_0x4d77ad[_0x4a3c('0x5')]]['mohtime']));delete queues[_0x4d77ad[_0x4a3c('0x5')]][_0x4a3c('0x62')];}}}catch(_0x183669){utils[_0x4a3c('0x17')](util['format'](_0x4a3c('0x65'),_0x4d77ad[_0x4a3c('0x5')]),_0x183669);}};
\ No newline at end of file
+var _0x9f95=['agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','mohtime','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','name','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0x9f95,0x1ca));var _0x59f9=function(_0x4d4ff8,_0x34a0aa){_0x4d4ff8=_0x4d4ff8-0x0;var _0x244b17=_0x9f95[_0x4d4ff8];return _0x244b17;};'use strict';var _=require(_0x59f9('0x0'));var util=require(_0x59f9('0x1'));var utils=require(_0x59f9('0x2'));var queues={};function writeDB(_0x2ac302){utils[_0x59f9('0x3')](util[_0x59f9('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2ac302[_0x59f9('0x5')],_0x2ac302['channel'],_0x2ac302[_0x59f9('0x6')],_0x2ac302[_0x59f9('0x7')],_0x2ac302['calleridnum'],_0x2ac302[_0x59f9('0x8')],_0x2ac302[_0x59f9('0x9')]));if(_0x2ac302[_0x59f9('0x6')]){utils[_0x59f9('0xa')](_0x2ac302['queue'])[_0x59f9('0xb')](function(_0x4ac259){if(_0x4ac259){_0x2ac302[_0x59f9('0xc')]=_0x4ac259['type'];}utils[_0x59f9('0xd')]('CreateVoiceQueueReport',_0x2ac302);});}else{utils[_0x59f9('0xd')]('CreateVoiceQueueReport',_0x2ac302);}if(_0x2ac302[_0x59f9('0xe')]){delete queues[_0x2ac302['transfereduniqueid']];}else{delete queues[_0x2ac302[_0x59f9('0x5')]];}}exports[_0x59f9('0xf')]=function(_0x29cd98){try{utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x11'),_0x29cd98[_0x59f9('0x5')]),_0x29cd98);utils[_0x59f9('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x29cd98[_0x59f9('0x5')],_0x29cd98[_0x59f9('0x6')],_0x29cd98[_0x59f9('0x12')]));queues[_0x29cd98['uniqueid']]=_[_0x59f9('0x13')](_0x29cd98,{'originalposition':_0x29cd98['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3f33ed){utils[_0x59f9('0x14')](util[_0x59f9('0x4')](_0x59f9('0x11'),_0x29cd98[_0x59f9('0x5')]),_0x3f33ed);}};exports[_0x59f9('0x15')]=function(_0x44c93b){try{if(!_[_0x59f9('0x16')](queues[_0x44c93b[_0x59f9('0x5')]])){utils[_0x59f9('0x10')](util[_0x59f9('0x4')]('[%s][queues][hangup]',_0x44c93b[_0x59f9('0x5')]),_0x44c93b);if(queues[_0x44c93b['uniqueid']][_0x59f9('0x17')]){if(!queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0x18')]&&!queues[_0x44c93b[_0x59f9('0x5')]]['queuecallerexit']){queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0x19')]=!![];queues[_0x44c93b['uniqueid']][_0x59f9('0x1a')]=utils[_0x59f9('0x1b')]();queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0x9')]=_0x59f9('0x1c');}utils['info'](util[_0x59f9('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x44c93b[_0x59f9('0x5')],queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0x1d')],queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0x9')]));writeDB(queues[_0x44c93b[_0x59f9('0x5')]]);}else if(queues[_0x44c93b[_0x59f9('0x5')]]['transfereduniqueid']){utils[_0x59f9('0x3')](util[_0x59f9('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x44c93b[_0x59f9('0x5')],queues[_0x44c93b['uniqueid']]['name'],queues[_0x44c93b['uniqueid']][_0x59f9('0xe')]));queues[queues[_0x44c93b[_0x59f9('0x5')]]['transfereduniqueid']]=queues[_0x44c93b[_0x59f9('0x5')]];queues[queues[_0x44c93b[_0x59f9('0x5')]][_0x59f9('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x44c93b[_0x59f9('0x5')]];}}}catch(_0x2f4f8f){utils['error'](util[_0x59f9('0x4')](_0x59f9('0x1e'),_0x44c93b[_0x59f9('0x5')]),_0x2f4f8f);}};exports[_0x59f9('0x1f')]=function(_0x1782c0){try{utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x20'),_0x1782c0[_0x59f9('0x5')]),_0x1782c0);if(!_[_0x59f9('0x16')](_0x1782c0[_0x59f9('0x21')][_0x59f9('0x22')])&&_0x1782c0[_0x59f9('0x23')]['toUpperCase']()!==_0x59f9('0x24')){if(!_[_0x59f9('0x16')](queues[_0x1782c0[_0x59f9('0x5')]])){queues[_0x1782c0['uniqueid']]['queuecallerabandon']=![];queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x25')]=null;queues[_0x1782c0['uniqueid']][_0x59f9('0x26')]=!![];queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x27')]=utils[_0x59f9('0x1b')]();queues[_0x1782c0[_0x59f9('0x5')]]['queuecallerexitreason']=_0x1782c0[_0x59f9('0x23')]['toUpperCase']();utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x28'),_0x1782c0[_0x59f9('0x5')],queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x1d')],_0x1782c0[_0x59f9('0x23')],queues[_0x1782c0[_0x59f9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1782c0[_0x59f9('0x5')]]);}}else if(!_[_0x59f9('0x16')](_0x1782c0[_0x59f9('0x21')][_0x59f9('0x29')])){if(!_[_0x59f9('0x16')](queues[_0x1782c0[_0x59f9('0x5')]])&&!queues[_0x1782c0['uniqueid']]['queuecallerabandon']){queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x18')]=![];queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x25')]=null;queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x26')]=!![];queues[_0x1782c0['uniqueid']][_0x59f9('0x27')]=utils[_0x59f9('0x1b')]();queues[_0x1782c0[_0x59f9('0x5')]]['queuecallerexitreason']=_0x59f9('0x2a');utils[_0x59f9('0x3')](util[_0x59f9('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1782c0[_0x59f9('0x5')],queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x1d')],_0x1782c0[_0x59f9('0x23')],queues[_0x1782c0[_0x59f9('0x5')]][_0x59f9('0x9')]));}}}catch(_0x32f3c7){utils[_0x59f9('0x14')](util[_0x59f9('0x4')](_0x59f9('0x20'),_0x1782c0[_0x59f9('0x5')]),_0x32f3c7);}};exports[_0x59f9('0x18')]=function(_0x1e4aea){try{if(!_[_0x59f9('0x16')](queues[_0x1e4aea[_0x59f9('0x5')]])){utils['debug'](util[_0x59f9('0x4')](_0x59f9('0x2b'),_0x1e4aea['uniqueid']),_0x1e4aea);queues[_0x1e4aea[_0x59f9('0x5')]][_0x59f9('0x26')]=![];queues[_0x1e4aea['uniqueid']]['queuecallerexitAt']=null;queues[_0x1e4aea[_0x59f9('0x5')]][_0x59f9('0x18')]=!![];queues[_0x1e4aea[_0x59f9('0x5')]][_0x59f9('0x25')]=utils['now']();queues[_0x1e4aea[_0x59f9('0x5')]]['queuecallerexitreason']='ABANDONED';utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x2c'),_0x1e4aea[_0x59f9('0x5')],queues[_0x1e4aea[_0x59f9('0x5')]][_0x59f9('0x1d')],queues[_0x1e4aea[_0x59f9('0x5')]][_0x59f9('0x9')]));}}catch(_0x4b95f4){utils[_0x59f9('0x14')](util[_0x59f9('0x4')]('[%s][queues][queuecallerabandon]',_0x1e4aea[_0x59f9('0x5')]),_0x4b95f4);}};exports['queuecallerleave']=function(_0x1973d2){try{if(!_['isNil'](queues[_0x1973d2[_0x59f9('0x5')]])){utils[_0x59f9('0x10')](util['format'](_0x59f9('0x2d'),_0x1973d2[_0x59f9('0x5')]),_0x1973d2);utils[_0x59f9('0x3')](util['format'](_0x59f9('0x2e'),_0x1973d2[_0x59f9('0x5')],queues[_0x1973d2[_0x59f9('0x5')]]['name'],_0x1973d2['connectedlinenum'],_0x1973d2[_0x59f9('0x2f')]));queues[_0x1973d2[_0x59f9('0x5')]][_0x59f9('0x30')]=!![];queues[_0x1973d2[_0x59f9('0x5')]]['queuecallerleaveAt']=utils[_0x59f9('0x1b')]();queues[_0x1973d2[_0x59f9('0x5')]][_0x59f9('0x31')]=utils['diffTime'](queues[_0x1973d2[_0x59f9('0x5')]][_0x59f9('0x17')],queues[_0x1973d2[_0x59f9('0x5')]][_0x59f9('0x32')]);queues[_0x1973d2['uniqueid']]['position']=_0x1973d2[_0x59f9('0x12')];queues[_0x1973d2['uniqueid']][_0x59f9('0x33')]=_0x1973d2[_0x59f9('0x33')];queues[_0x1973d2['uniqueid']]['connectedlinenum']=_0x1973d2['connectedlinenum'];queues[_0x1973d2[_0x59f9('0x5')]][_0x59f9('0x2f')]=_0x1973d2[_0x59f9('0x2f')];}}catch(_0x2afaa8){utils[_0x59f9('0x14')](util[_0x59f9('0x4')]('[%s][queues][queuecallerleave]',_0x1973d2[_0x59f9('0x5')]),_0x2afaa8);}};exports[_0x59f9('0x34')]=function(_0x121bbf){try{if(!_[_0x59f9('0x16')](queues[_0x121bbf[_0x59f9('0x5')]])){utils[_0x59f9('0x10')](util['format'](_0x59f9('0x35'),_0x121bbf[_0x59f9('0x5')]),_0x121bbf);utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x36'),_0x121bbf[_0x59f9('0x5')],queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x1d')],_0x121bbf[_0x59f9('0x37')],_0x121bbf[_0x59f9('0x38')]));queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x18')]=![];queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x18')]=![];queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x25')]=null;queues[_0x121bbf[_0x59f9('0x5')]]['queuecallerexit']=![];queues[_0x121bbf[_0x59f9('0x5')]]['queuecallerexitreason']=null;queues[_0x121bbf['uniqueid']]['queuecallerexitAt']=null;queues[_0x121bbf[_0x59f9('0x5')]]['assigned']=!![];queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x8')]=_0x121bbf[_0x59f9('0x38')];queues[_0x121bbf[_0x59f9('0x5')]][_0x59f9('0x7')]=_0x121bbf[_0x59f9('0x37')];}}catch(_0x5a7a46){utils[_0x59f9('0x14')](util[_0x59f9('0x4')](_0x59f9('0x35'),_0x121bbf['uniqueid']),_0x5a7a46);}};exports[_0x59f9('0x39')]=function(_0x4f26a7){try{if(!_[_0x59f9('0x16')](queues[_0x4f26a7['uniqueid']])){if(queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x17')]){utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x3a'),_0x4f26a7[_0x59f9('0x5')]),_0x4f26a7);queues[_0x4f26a7['uniqueid']][_0x59f9('0x18')]=![];queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x18')]=![];queues[_0x4f26a7['uniqueid']][_0x59f9('0x25')]=null;queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x26')]=![];queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x27')]=null;queues[_0x4f26a7['uniqueid']][_0x59f9('0x3b')]=!![];queues[_0x4f26a7[_0x59f9('0x5')]]['lastAssignedTo']=_0x4f26a7[_0x59f9('0x37')];queues[_0x4f26a7[_0x59f9('0x5')]]['queuecallercomplete']=!![];queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x1a')]=utils[_0x59f9('0x1b')]();if(_0x4f26a7[_0x59f9('0x3c')]==_0x59f9('0x3d')){if(!queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x3d')]){queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x9')]=_0x59f9('0x3e');}}else{queues[_0x4f26a7[_0x59f9('0x5')]][_0x59f9('0x9')]=_0x59f9('0x3f')+_0x4f26a7['reason'][_0x59f9('0x40')]();}utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x41'),_0x4f26a7[_0x59f9('0x5')],queues[_0x4f26a7['uniqueid']][_0x59f9('0x1d')],_0x4f26a7['membername'],queues[_0x4f26a7[_0x59f9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4f26a7[_0x59f9('0x5')]]);}}}catch(_0x15eff5){utils['error'](util[_0x59f9('0x4')](_0x59f9('0x3a'),_0x4f26a7['uniqueid']),_0x15eff5);}};exports[_0x59f9('0x42')]=function(_0x36c8c1){try{if(!_[_0x59f9('0x16')](queues[_0x36c8c1[_0x59f9('0x43')]])){utils[_0x59f9('0x10')](util['format']('[%s][queues][blindtransfer]',_0x36c8c1['uniqueid']),_0x36c8c1);queues[_0x36c8c1[_0x59f9('0x43')]]['transfer']=!![];queues[_0x36c8c1[_0x59f9('0x43')]][_0x59f9('0x44')]=_0x59f9('0x45');queues[_0x36c8c1[_0x59f9('0x43')]]['transferexten']=_0x36c8c1[_0x59f9('0x46')];queues[_0x36c8c1['transfereeuniqueid']][_0x59f9('0x47')]=_0x36c8c1[_0x59f9('0x43')];queues[_0x36c8c1[_0x59f9('0x43')]][_0x59f9('0x9')]=_0x59f9('0x48');utils[_0x59f9('0x3')](util[_0x59f9('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x36c8c1[_0x59f9('0x5')],queues[_0x36c8c1['transfereeuniqueid']][_0x59f9('0x1d')],_0x36c8c1[_0x59f9('0x43')],_0x36c8c1['extension']));}}catch(_0x1788bd){utils[_0x59f9('0x14')](util['format'](_0x59f9('0x49'),_0x36c8c1['uniqueid']),_0x1788bd);}};exports[_0x59f9('0x4a')]=function(_0x2ddd6a){try{utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x4b'),_0x2ddd6a[_0x59f9('0x4c')]),_0x2ddd6a);if(_0x2ddd6a[_0x59f9('0x4c')]==_0x2ddd6a[_0x59f9('0x4d')]){if(!_[_0x59f9('0x16')](queues[_0x2ddd6a[_0x59f9('0x4e')]])){utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x4f'),_0x2ddd6a['origtransfereruniqueid'],queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0x1d')],_0x2ddd6a[_0x59f9('0x50')]));queues[_0x2ddd6a['secondtransfererlinkedid']][_0x59f9('0x3d')]=!![];queues[_0x2ddd6a['secondtransfererlinkedid']][_0x59f9('0x44')]='ATTENDED';queues[_0x2ddd6a['secondtransfererlinkedid']][_0x59f9('0x51')]=_0x2ddd6a[_0x59f9('0x50')];queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0x47')]=_0x2ddd6a[_0x59f9('0x4c')];queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0x9')]=_0x59f9('0x52');}if(!_[_0x59f9('0x16')](queues[_0x2ddd6a[_0x59f9('0x4d')]])){if(_0x2ddd6a[_0x59f9('0x53')]&&queues[_0x2ddd6a[_0x59f9('0x53')]]){queues[_0x2ddd6a[_0x59f9('0x53')]][_0x59f9('0x54')]=0x1;queues[_0x2ddd6a[_0x59f9('0x43')]]=_[_0x59f9('0x55')](queues[_0x2ddd6a[_0x59f9('0x53')]]);queues[_0x2ddd6a[_0x59f9('0x43')]]['transfereduniqueid']=_0x2ddd6a['transfertargetuniqueid'];queues[_0x2ddd6a['transfereeuniqueid']][_0x59f9('0x54')]=0x2;queues[_0x2ddd6a[_0x59f9('0x43')]][_0x59f9('0x56')]=queues[_0x2ddd6a['secondtransfererlinkedid']]['calleridnum'];queues[_0x2ddd6a[_0x59f9('0x43')]][_0x59f9('0x57')]=queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0x57')];queues[_0x2ddd6a[_0x59f9('0x43')]][_0x59f9('0x32')]=utils[_0x59f9('0x1b')]();queues[_0x2ddd6a[_0x59f9('0x43')]][_0x59f9('0x17')]=utils['now']();queues[_0x2ddd6a['transfereeuniqueid']][_0x59f9('0x31')]=0x0;queues[_0x2ddd6a['transfereeuniqueid']]['mohtime']=0x0;utils[_0x59f9('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x2ddd6a[_0x59f9('0x4c')],queues[_0x2ddd6a[_0x59f9('0x43')]][_0x59f9('0x1d')],queues[_0x2ddd6a['transfereeuniqueid']]['calleridnum'],queues[_0x2ddd6a['transfereeuniqueid']][_0x59f9('0x57')]));}else{utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x58'),_0x2ddd6a[_0x59f9('0x4c')],queues[_0x2ddd6a['origtransfererlinkedid']][_0x59f9('0x1d')],_0x2ddd6a[_0x59f9('0x4e')]));queues[_0x2ddd6a[_0x59f9('0x4d')]][_0x59f9('0xe')]=_0x2ddd6a[_0x59f9('0x4e')];}}}else if(_0x2ddd6a[_0x59f9('0x59')]==_0x2ddd6a['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x2ddd6a[_0x59f9('0x4d')]])){utils[_0x59f9('0x3')](util['format'](_0x59f9('0x5a'),_0x2ddd6a[_0x59f9('0x4c')],queues[_0x2ddd6a['origtransfererlinkedid']][_0x59f9('0x1d')],_0x2ddd6a[_0x59f9('0x59')],_0x2ddd6a[_0x59f9('0x5b')]));queues[_0x2ddd6a['origtransfererlinkedid']][_0x59f9('0x3d')]=!![];queues[_0x2ddd6a[_0x59f9('0x4d')]][_0x59f9('0x44')]=_0x59f9('0x5c');queues[_0x2ddd6a[_0x59f9('0x4d')]]['transferexten']=_0x2ddd6a[_0x59f9('0x5b')];queues[_0x2ddd6a['origtransfererlinkedid']]['transferuniqueid']=_0x2ddd6a['secondtransfereruniqueid'];queues[_0x2ddd6a[_0x59f9('0x4d')]][_0x59f9('0x9')]=_0x59f9('0x52');}if(!_[_0x59f9('0x16')](queues[_0x2ddd6a[_0x59f9('0x4e')]])){if(_0x2ddd6a[_0x59f9('0x5d')]&&queues[_0x2ddd6a[_0x59f9('0x5d')]]){queues[_0x2ddd6a['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x2ddd6a['transfertargetuniqueid']]=_[_0x59f9('0x55')](queues[_0x2ddd6a['transfertargetlinkedid']]);queues[_0x2ddd6a['transfertargetuniqueid']][_0x59f9('0xe')]=_0x2ddd6a[_0x59f9('0x5e')];queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0x54')]=0x2;queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0x56')]=queues[_0x2ddd6a[_0x59f9('0x4d')]][_0x59f9('0x56')];queues[_0x2ddd6a[_0x59f9('0x5e')]]['calleridname']=queues[_0x2ddd6a[_0x59f9('0x4d')]]['calleridname'];queues[_0x2ddd6a[_0x59f9('0x5e')]]['queuecallerjoinAt']=utils[_0x59f9('0x1b')]();queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0x17')]=utils[_0x59f9('0x1b')]();queues[_0x2ddd6a[_0x59f9('0x5e')]]['holdtime']=0x0;queues[_0x2ddd6a[_0x59f9('0x5e')]]['mohtime']=0x0;utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x5f'),_0x2ddd6a[_0x59f9('0x4c')],queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0x1d')],queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0xe')],queues[_0x2ddd6a[_0x59f9('0x5e')]]['calleridnum'],queues[_0x2ddd6a[_0x59f9('0x5e')]][_0x59f9('0x57')]));}else{utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x58'),_0x2ddd6a[_0x59f9('0x4c')],queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0x1d')],_0x2ddd6a[_0x59f9('0x4d')]));queues[_0x2ddd6a[_0x59f9('0x4e')]][_0x59f9('0xe')]=_0x2ddd6a[_0x59f9('0x4d')];}}}}catch(_0x5633db){utils[_0x59f9('0x14')](util[_0x59f9('0x4')]('[%s][queues][attendedtransfer]',_0x2ddd6a[_0x59f9('0x4c')]),_0x5633db);}};exports['musiconholdstart']=function(_0x1eec20){try{if(!_[_0x59f9('0x16')](queues[_0x1eec20['uniqueid']])){utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x60'),_0x1eec20[_0x59f9('0x5')]),_0x1eec20);queues[_0x1eec20[_0x59f9('0x5')]][_0x59f9('0x61')]=utils[_0x59f9('0x1b')]();utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x62'),_0x1eec20[_0x59f9('0x5')],queues[_0x1eec20[_0x59f9('0x5')]][_0x59f9('0x1d')],queues[_0x1eec20['uniqueid']][_0x59f9('0x61')]));}}catch(_0xcd6f9d){utils['error'](util[_0x59f9('0x4')](_0x59f9('0x60'),_0x1eec20['uniqueid']),_0xcd6f9d);}};exports['musiconholdstop']=function(_0x4a53e0){try{if(!_['isNil'](queues[_0x4a53e0['uniqueid']])){if(!_['isNil'](queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x61')])){utils[_0x59f9('0x10')](util[_0x59f9('0x4')](_0x59f9('0x63'),_0x4a53e0[_0x59f9('0x5')]),_0x4a53e0);queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x64')]+=utils[_0x59f9('0x65')](utils[_0x59f9('0x1b')](),queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x61')]);utils[_0x59f9('0x3')](util[_0x59f9('0x4')](_0x59f9('0x66'),_0x4a53e0[_0x59f9('0x5')],queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x1d')],queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x64')]));delete queues[_0x4a53e0[_0x59f9('0x5')]][_0x59f9('0x61')];}}}catch(_0x5f0d8a){utils['error'](util[_0x59f9('0x4')](_0x59f9('0x63'),_0x4a53e0[_0x59f9('0x5')]),_0x5f0d8a);}};
\ No newline at end of file
index 57260a1..9cea10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc0=['debug','format','[%s][recordings][newchannel]','linkedid','info','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','./utils','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0x5fc0,0xa8));var _0x05fc=function(_0x1e5c6b,_0x33419b){_0x1e5c6b=_0x1e5c6b-0x0;var _0x41e5bb=_0x5fc0[_0x1e5c6b];return _0x41e5bb;};'use strict';var _=require('lodash');var util=require(_0x05fc('0x0'));var utils=require(_0x05fc('0x1'));var recordings={};function writeDB(_0x2cdd57){utils['info'](util['format'](_0x05fc('0x2'),_0x2cdd57[_0x05fc('0x3')]));if(_0x2cdd57[_0x05fc('0x4')]){utils[_0x05fc('0x5')](_0x2cdd57[_0x05fc('0x4')])[_0x05fc('0x6')](function(_0x56d2e9){if(_0x56d2e9){_0x2cdd57['membername']=_0x56d2e9[_0x05fc('0x7')];_0x2cdd57[_0x05fc('0x8')]=_0x56d2e9['id'];}utils[_0x05fc('0x9')](_0x05fc('0xa'),_0x2cdd57);});}else{utils[_0x05fc('0x9')](_0x05fc('0xa'),_0x2cdd57);}}exports[_0x05fc('0xb')]=function(_0xb2c004){try{utils[_0x05fc('0xc')](util[_0x05fc('0xd')](_0x05fc('0xe'),_0xb2c004[_0x05fc('0x3')]),_0xb2c004);if(_0xb2c004[_0x05fc('0x3')]==_0xb2c004[_0x05fc('0xf')]){utils[_0x05fc('0x10')](util[_0x05fc('0xd')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xb2c004['uniqueid'],_0xb2c004['context'],_0xb2c004[_0x05fc('0x11')]));recordings[_0xb2c004['uniqueid']]={'uniqueid':_0xb2c004[_0x05fc('0x3')],'accountcode':_0xb2c004[_0x05fc('0x4')],'exten':_0xb2c004[_0x05fc('0x11')],'context':_0xb2c004['context'],'channel':_0xb2c004[_0x05fc('0x12')],'monitors':[]};}}catch(_0x1aa6b9){utils[_0x05fc('0x13')](util[_0x05fc('0xd')]('[%s][recordings][newchannel]',_0xb2c004[_0x05fc('0x3')]),_0x1aa6b9);}};exports['newstate']=function(_0xad1007){try{utils[_0x05fc('0xc')](util[_0x05fc('0xd')](_0x05fc('0x14'),_0xad1007[_0x05fc('0x3')]),_0xad1007);if(!_[_0x05fc('0x15')](recordings[_0xad1007['uniqueid']])&&_0xad1007[_0x05fc('0x16')]==0x6){utils[_0x05fc('0x10')](util[_0x05fc('0xd')](_0x05fc('0x17'),_0xad1007[_0x05fc('0x3')],_0xad1007[_0x05fc('0x18')],_0xad1007['channel']));}else if(!_[_0x05fc('0x15')](recordings[_0xad1007['linkedid']])&&_0xad1007[_0x05fc('0x16')]==0x6&&_0xad1007[_0x05fc('0x18')]!=_0x05fc('0x19')){utils[_0x05fc('0x10')](util[_0x05fc('0xd')](_0x05fc('0x1a'),_0xad1007[_0x05fc('0x3')],_0xad1007[_0x05fc('0xf')],_0xad1007['context'],_0xad1007['channel']));recordings[_0xad1007['linkedid']][_0x05fc('0x4')]=_0xad1007['accountcode'];}}catch(_0x481005){utils['error'](util[_0x05fc('0xd')](_0x05fc('0x14'),_0xad1007[_0x05fc('0x3')]),_0x481005);}};exports['varset']=function(_0x348add){try{if(!_[_0x05fc('0x15')](_0x348add[_0x05fc('0x1b')])&&!_[_0x05fc('0x15')](_0x348add[_0x05fc('0x1b')][_0x05fc('0x1c')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x348add['uniqueid']),_0x348add);utils[_0x05fc('0x10')](util[_0x05fc('0xd')](_0x05fc('0x1d'),_0x348add[_0x05fc('0x3')],_0x348add['variable'],_0x348add[_0x05fc('0x1e')]));if(_['endsWith'](_0x348add[_0x05fc('0x1e')],_0x05fc('0x1f'))){_0x348add[_0x05fc('0x1e')]=_0x348add[_0x05fc('0x1e')][_0x05fc('0x20')](_0x05fc('0x1f'),_0x05fc('0x21'));}if(recordings[_0x348add[_0x05fc('0xf')]]){var _0x490fa8=_['find'](recordings[_0x348add[_0x05fc('0xf')]]['monitors'],{'value':_0x348add[_0x05fc('0x1e')]});if(_[_0x05fc('0x15')](_0x490fa8)){recordings[_0x348add[_0x05fc('0xf')]][_0x05fc('0x22')][_0x05fc('0x23')]({'value':_0x348add[_0x05fc('0x1e')]});}}}}catch(_0xe86f9f){utils[_0x05fc('0x13')](util['format'](_0x05fc('0x24'),_0x348add['uniqueid']),_0xe86f9f);}};exports[_0x05fc('0x25')]=function(_0xacd51){try{if(!_[_0x05fc('0x15')](recordings[_0xacd51['uniqueid']])){utils[_0x05fc('0xc')](util[_0x05fc('0xd')]('[%s][recordings][hangup]',_0xacd51['uniqueid']),_0xacd51);utils['info'](util['format'](_0x05fc('0x26'),_0xacd51[_0x05fc('0x3')],_0xacd51[_0x05fc('0x27')],_0xacd51[_0x05fc('0x28')],_0xacd51[_0x05fc('0x29')]));recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x27')]=_0xacd51[_0x05fc('0x27')];recordings[_0xacd51['uniqueid']]['calleridname']=_0xacd51[_0x05fc('0x28')];recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x2a')]=_0xacd51[_0x05fc('0x2a')];recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x2b')]=_0xacd51[_0x05fc('0x2b')];if(recordings[_0xacd51[_0x05fc('0x3')]]['type']==_0x05fc('0x2c')&&recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x4')]){recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x2a')]=recordings[_0xacd51['uniqueid']][_0x05fc('0x4')];recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x2b')]='';}recordings[_0xacd51[_0x05fc('0x3')]][_0x05fc('0x22')]['forEach'](function(_0x52f1dd){var _0x533a4c=_[_0x05fc('0x2d')](recordings[_0xacd51['uniqueid']]);_0x533a4c[_0x05fc('0x1e')]=_0x52f1dd[_0x05fc('0x1e')];writeDB(_0x533a4c);});delete recordings[_0xacd51[_0x05fc('0x3')]];}}catch(_0x39b6b4){utils[_0x05fc('0x13')](util[_0x05fc('0xd')](_0x05fc('0x2e'),_0xacd51['uniqueid']),_0x39b6b4);}};exports[_0x05fc('0x2f')]=function(_0x1a0aa6){try{if(!_['isNil'](recordings[_0x1a0aa6['uniqueid']])){utils[_0x05fc('0xc')](util[_0x05fc('0xd')](_0x05fc('0x30'),_0x1a0aa6[_0x05fc('0x3')]),_0x1a0aa6);utils['info'](util[_0x05fc('0xd')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1a0aa6[_0x05fc('0x3')],_0x1a0aa6[_0x05fc('0x31')],_0x1a0aa6[_0x05fc('0x32')]));if(_0x1a0aa6[_0x05fc('0x31')][_0x05fc('0x33')]()==_0x05fc('0x34')&&_[_0x05fc('0x35')](_0x1a0aa6[_0x05fc('0x32')][_0x05fc('0x33')](),'cdr')){var _0x696969=_0x1a0aa6[_0x05fc('0x32')][_0x05fc('0x36')]('=');var _0x2c7ff7=_0x696969[0x0][_0x05fc('0x37')](_0x696969[0x0][_0x05fc('0x38')]('(')+0x1,_0x696969[0x0][_0x05fc('0x38')](')'));var _0x1b0f2e=_0x696969[0x1];recordings[_0x1a0aa6[_0x05fc('0x3')]][_0x2c7ff7]=_0x1b0f2e;}}}catch(_0x4522ec){utils[_0x05fc('0x13')](util[_0x05fc('0xd')](_0x05fc('0x30'),_0x1a0aa6['uniqueid']),_0x4522ec);}};exports[_0x05fc('0x39')]=function(_0x109f71){try{if(!_[_0x05fc('0x15')](recordings[_0x109f71['uniqueid']])){utils[_0x05fc('0xc')](util[_0x05fc('0xd')](_0x05fc('0x3a'),_0x109f71['uniqueid']),_0x109f71);utils[_0x05fc('0x10')](util[_0x05fc('0xd')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x109f71[_0x05fc('0x3')],_0x109f71[_0x05fc('0x3b')]));recordings[_0x109f71[_0x05fc('0x3')]][_0x05fc('0x3b')]=_0x109f71[_0x05fc('0x3b')];}}catch(_0x465069){utils['error'](util[_0x05fc('0xd')]('[%s][recordings][queuecallerjoin]',_0x109f71[_0x05fc('0x3')]),_0x465069);}};
\ No newline at end of file
+var _0xa139=['appdata','application','set','startsWith','toLowerCase','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','context','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','.wav49','replace','find','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','monitors','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa139,0x17f));var _0x9a13=function(_0x475dc0,_0x18f63f){_0x475dc0=_0x475dc0-0x0;var _0x33d23b=_0xa139[_0x475dc0];return _0x33d23b;};'use strict';var _=require(_0x9a13('0x0'));var util=require('util');var utils=require(_0x9a13('0x1'));var recordings={};function writeDB(_0x4480e6){utils[_0x9a13('0x2')](util['format'](_0x9a13('0x3'),_0x4480e6[_0x9a13('0x4')]));if(_0x4480e6['accountcode']){utils[_0x9a13('0x5')](_0x4480e6[_0x9a13('0x6')])['then'](function(_0x1befcf){if(_0x1befcf){_0x4480e6[_0x9a13('0x7')]=_0x1befcf[_0x9a13('0x8')];_0x4480e6[_0x9a13('0x9')]=_0x1befcf['id'];}utils[_0x9a13('0xa')](_0x9a13('0xb'),_0x4480e6);});}else{utils[_0x9a13('0xa')](_0x9a13('0xb'),_0x4480e6);}}exports['newchannel']=function(_0x3145b0){try{utils[_0x9a13('0xc')](util['format'](_0x9a13('0xd'),_0x3145b0[_0x9a13('0x4')]),_0x3145b0);if(_0x3145b0['uniqueid']==_0x3145b0['linkedid']){utils[_0x9a13('0x2')](util[_0x9a13('0xe')](_0x9a13('0xf'),_0x3145b0[_0x9a13('0x4')],_0x3145b0['context'],_0x3145b0[_0x9a13('0x10')]));recordings[_0x3145b0[_0x9a13('0x4')]]={'uniqueid':_0x3145b0[_0x9a13('0x4')],'accountcode':_0x3145b0[_0x9a13('0x6')],'exten':_0x3145b0[_0x9a13('0x10')],'context':_0x3145b0['context'],'channel':_0x3145b0[_0x9a13('0x11')],'monitors':[]};}}catch(_0x311025){utils[_0x9a13('0x12')](util[_0x9a13('0xe')](_0x9a13('0xd'),_0x3145b0[_0x9a13('0x4')]),_0x311025);}};exports[_0x9a13('0x13')]=function(_0x120947){try{utils[_0x9a13('0xc')](util[_0x9a13('0xe')](_0x9a13('0x14'),_0x120947[_0x9a13('0x4')]),_0x120947);if(!_[_0x9a13('0x15')](recordings[_0x120947['uniqueid']])&&_0x120947[_0x9a13('0x16')]==0x6){utils[_0x9a13('0x2')](util[_0x9a13('0xe')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x120947[_0x9a13('0x4')],_0x120947[_0x9a13('0x17')],_0x120947[_0x9a13('0x11')]));}else if(!_[_0x9a13('0x15')](recordings[_0x120947[_0x9a13('0x18')]])&&_0x120947['channelstate']==0x6&&_0x120947[_0x9a13('0x17')]!=_0x9a13('0x19')){utils['info'](util[_0x9a13('0xe')](_0x9a13('0x1a'),_0x120947['uniqueid'],_0x120947[_0x9a13('0x18')],_0x120947[_0x9a13('0x17')],_0x120947[_0x9a13('0x11')]));recordings[_0x120947[_0x9a13('0x18')]][_0x9a13('0x6')]=_0x120947[_0x9a13('0x6')];}}catch(_0x4f1ec8){utils['error'](util[_0x9a13('0xe')](_0x9a13('0x14'),_0x120947[_0x9a13('0x4')]),_0x4f1ec8);}};exports[_0x9a13('0x1b')]=function(_0x20b428){try{if(!_[_0x9a13('0x15')](_0x20b428['variable'])&&!_['isNil'](_0x20b428['variable']['mixmonitor_filename'])){utils['debug'](util[_0x9a13('0xe')]('[%s][recordings][varset]',_0x20b428[_0x9a13('0x4')]),_0x20b428);utils[_0x9a13('0x2')](util[_0x9a13('0xe')](_0x9a13('0x1c'),_0x20b428[_0x9a13('0x4')],_0x20b428[_0x9a13('0x1d')],_0x20b428[_0x9a13('0x1e')]));if(_['endsWith'](_0x20b428[_0x9a13('0x1e')],_0x9a13('0x1f'))){_0x20b428[_0x9a13('0x1e')]=_0x20b428['value'][_0x9a13('0x20')]('.wav49','.WAV');}if(recordings[_0x20b428[_0x9a13('0x18')]]){var _0x3b5053=_[_0x9a13('0x21')](recordings[_0x20b428[_0x9a13('0x18')]]['monitors'],{'value':_0x20b428[_0x9a13('0x1e')]});if(_[_0x9a13('0x15')](_0x3b5053)){recordings[_0x20b428['linkedid']]['monitors'][_0x9a13('0x22')]({'value':_0x20b428['value']});}}}}catch(_0x3f6967){utils[_0x9a13('0x12')](util[_0x9a13('0xe')](_0x9a13('0x23'),_0x20b428['uniqueid']),_0x3f6967);}};exports[_0x9a13('0x24')]=function(_0x45d6b4){try{if(!_[_0x9a13('0x15')](recordings[_0x45d6b4[_0x9a13('0x4')]])){utils[_0x9a13('0xc')](util['format']('[%s][recordings][hangup]',_0x45d6b4['uniqueid']),_0x45d6b4);utils[_0x9a13('0x2')](util[_0x9a13('0xe')](_0x9a13('0x25'),_0x45d6b4[_0x9a13('0x4')],_0x45d6b4[_0x9a13('0x26')],_0x45d6b4[_0x9a13('0x27')],_0x45d6b4[_0x9a13('0x28')]));recordings[_0x45d6b4[_0x9a13('0x4')]]['calleridnum']=_0x45d6b4[_0x9a13('0x26')];recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x27')]=_0x45d6b4['calleridname'];recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x29')]=_0x45d6b4[_0x9a13('0x29')];recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x2a')]=_0x45d6b4[_0x9a13('0x2a')];if(recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x2b')]==_0x9a13('0x2c')&&recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x6')]){recordings[_0x45d6b4['uniqueid']]['connectedlinenum']=recordings[_0x45d6b4['uniqueid']]['accountcode'];recordings[_0x45d6b4[_0x9a13('0x4')]][_0x9a13('0x2a')]='';}recordings[_0x45d6b4['uniqueid']][_0x9a13('0x2d')][_0x9a13('0x2e')](function(_0x54944d){var _0x25f5b3=_[_0x9a13('0x2f')](recordings[_0x45d6b4['uniqueid']]);_0x25f5b3['value']=_0x54944d[_0x9a13('0x1e')];writeDB(_0x25f5b3);});delete recordings[_0x45d6b4[_0x9a13('0x4')]];}}catch(_0x163ebc){utils[_0x9a13('0x12')](util['format']('[%s][recordings][hangup]',_0x45d6b4[_0x9a13('0x4')]),_0x163ebc);}};exports[_0x9a13('0x30')]=function(_0x4a2938){try{if(!_[_0x9a13('0x15')](recordings[_0x4a2938[_0x9a13('0x4')]])){utils['debug'](util[_0x9a13('0xe')](_0x9a13('0x31'),_0x4a2938[_0x9a13('0x4')]),_0x4a2938);utils[_0x9a13('0x2')](util[_0x9a13('0xe')](_0x9a13('0x32'),_0x4a2938[_0x9a13('0x4')],_0x4a2938['application'],_0x4a2938[_0x9a13('0x33')]));if(_0x4a2938[_0x9a13('0x34')]['toLowerCase']()==_0x9a13('0x35')&&_[_0x9a13('0x36')](_0x4a2938['appdata'][_0x9a13('0x37')](),'cdr')){var _0x24c92c=_0x4a2938[_0x9a13('0x33')][_0x9a13('0x38')]('=');var _0x4182b7=_0x24c92c[0x0][_0x9a13('0x39')](_0x24c92c[0x0][_0x9a13('0x3a')]('(')+0x1,_0x24c92c[0x0][_0x9a13('0x3a')](')'));var _0x5e3ea1=_0x24c92c[0x1];recordings[_0x4a2938[_0x9a13('0x4')]][_0x4182b7]=_0x5e3ea1;}}}catch(_0x4e48d4){utils[_0x9a13('0x12')](util[_0x9a13('0xe')](_0x9a13('0x31'),_0x4a2938['uniqueid']),_0x4e48d4);}};exports['queuecallerjoin']=function(_0x37511a){try{if(!_[_0x9a13('0x15')](recordings[_0x37511a[_0x9a13('0x4')]])){utils[_0x9a13('0xc')](util['format'](_0x9a13('0x3b'),_0x37511a[_0x9a13('0x4')]),_0x37511a);utils[_0x9a13('0x2')](util[_0x9a13('0xe')](_0x9a13('0x3c'),_0x37511a[_0x9a13('0x4')],_0x37511a[_0x9a13('0x3d')]));recordings[_0x37511a['uniqueid']][_0x9a13('0x3d')]=_0x37511a[_0x9a13('0x3d')];}}catch(_0x48814a){utils[_0x9a13('0x12')](util[_0x9a13('0xe')]('[%s][recordings][queuecallerjoin]',_0x37511a[_0x9a13('0x4')]),_0x48814a);}};
\ No newline at end of file
index e5278ef..29cc87b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d13=['isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext'];(function(_0x571166,_0x17cb05){var _0xdbd2cc=function(_0x1d1f35){while(--_0x1d1f35){_0x571166['push'](_0x571166['shift']());}};_0xdbd2cc(++_0x17cb05);}(_0x5d13,0x159));var _0x35d1=function(_0x30c5b9,_0x4c7aad){_0x30c5b9=_0x30c5b9-0x0;var _0x7614af=_0x5d13[_0x30c5b9];return _0x7614af;};'use strict';var _=require(_0x35d1('0x0'));var util=require(_0x35d1('0x1'));var utils=require(_0x35d1('0x2'));function writeDB(_0x77d0b5){utils[_0x35d1('0x3')](util[_0x35d1('0x4')](_0x35d1('0x5'),_0x77d0b5[_0x35d1('0x6')]===_0x35d1('0x7')?_0x77d0b5[_0x35d1('0x8')]:_0x77d0b5[_0x35d1('0x9')],_0x77d0b5[_0x35d1('0x6')]));utils[_0x35d1('0xa')]('CreateVoiceTransferReport',_0x77d0b5);}exports['blinds']={};exports[_0x35d1('0xb')]=function(_0x52faca){try{utils[_0x35d1('0xc')](util['format'](_0x35d1('0xd'),_0x52faca['uniqueid']),_0x52faca);utils['info'](util['format'](_0x35d1('0xe'),_0x52faca[_0x35d1('0x9')],_0x52faca[_0x35d1('0xf')],_0x52faca['transferercalleridname'],_0x52faca[_0x35d1('0x10')],_0x52faca[_0x35d1('0x11')]));_0x52faca['type']=_0x35d1('0x12');exports[_0x35d1('0x13')][_0x52faca[_0x35d1('0x14')]]=_0x52faca;writeDB(_0x52faca);}catch(_0x13803f){utils['error'](util[_0x35d1('0x4')](_0x35d1('0xd'),_0x52faca['uniqueid']),_0x13803f);}};exports[_0x35d1('0x15')]=function(_0xc50a6c){try{utils['debug'](util[_0x35d1('0x4')](_0x35d1('0x16'),_0xc50a6c[_0x35d1('0x8')]),_0xc50a6c);utils[_0x35d1('0x3')](util[_0x35d1('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xc50a6c[_0x35d1('0x8')],_0xc50a6c['origtransferercalleridnum'],_0xc50a6c['origtransferercalleridname'],_0xc50a6c['transfertargetcalleridnum'],_0xc50a6c[_0x35d1('0x17')]));_0xc50a6c=_['assign'](_0xc50a6c,{'transfererchannel':_0xc50a6c[_0x35d1('0x18')],'transferercalleridnum':_0xc50a6c[_0x35d1('0x19')],'transferercalleridname':_0xc50a6c[_0x35d1('0x1a')],'transfererconnectedlinenum':_0xc50a6c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xc50a6c[_0x35d1('0x1b')],'transfereraccountcode':_0xc50a6c[_0x35d1('0x1c')],'transferercontext':_0xc50a6c[_0x35d1('0x1d')],'transfererexten':_0xc50a6c[_0x35d1('0x1e')],'transfererlinkedid':_0xc50a6c[_0x35d1('0x1f')],'context':_0xc50a6c[_0x35d1('0x20')],'extension':_0xc50a6c['origtransfererexten'],'type':_0x35d1('0x7')});if(_[_0x35d1('0x21')](_0xc50a6c[_0x35d1('0x22')])){_0xc50a6c=_[_0x35d1('0x23')](_0xc50a6c,{'transfereechannel':_0xc50a6c[_0x35d1('0x24')],'transfereecalleridnum':_0xc50a6c[_0x35d1('0x25')],'transfereecalleridname':_0xc50a6c['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xc50a6c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xc50a6c[_0x35d1('0x26')],'transfereeaccountcode':_0xc50a6c['transfertargetaccountcode'],'transfereecontext':_0xc50a6c[_0x35d1('0x27')],'transfereeexten':_0xc50a6c[_0x35d1('0x28')],'transfereelinkedid':_0xc50a6c[_0x35d1('0x29')]});}writeDB(_0xc50a6c);}catch(_0x4a9f11){utils['error'](util['format'](_0x35d1('0x16'),_0xc50a6c['origtransfereruniqueid']),_0x4a9f11);}};
\ No newline at end of file
+var _0xe22b=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0xe22b,0x153));var _0xbe22=function(_0x134fc4,_0x415463){_0x134fc4=_0x134fc4-0x0;var _0x406b26=_0xe22b[_0x134fc4];return _0x406b26;};'use strict';var _=require('lodash');var util=require(_0xbe22('0x0'));var utils=require(_0xbe22('0x1'));function writeDB(_0x490209){utils[_0xbe22('0x2')](util[_0xbe22('0x3')](_0xbe22('0x4'),_0x490209[_0xbe22('0x5')]===_0xbe22('0x6')?_0x490209[_0xbe22('0x7')]:_0x490209['uniqueid'],_0x490209[_0xbe22('0x5')]));utils[_0xbe22('0x8')](_0xbe22('0x9'),_0x490209);}exports[_0xbe22('0xa')]={};exports[_0xbe22('0xb')]=function(_0x284f92){try{utils[_0xbe22('0xc')](util[_0xbe22('0x3')](_0xbe22('0xd'),_0x284f92[_0xbe22('0xe')]),_0x284f92);utils[_0xbe22('0x2')](util[_0xbe22('0x3')](_0xbe22('0xf'),_0x284f92[_0xbe22('0xe')],_0x284f92[_0xbe22('0x10')],_0x284f92[_0xbe22('0x11')],_0x284f92[_0xbe22('0x12')],_0x284f92[_0xbe22('0x13')]));_0x284f92[_0xbe22('0x5')]=_0xbe22('0x14');exports[_0xbe22('0xa')][_0x284f92[_0xbe22('0x15')]]=_0x284f92;writeDB(_0x284f92);}catch(_0x1e0536){utils[_0xbe22('0x16')](util[_0xbe22('0x3')](_0xbe22('0xd'),_0x284f92[_0xbe22('0xe')]),_0x1e0536);}};exports[_0xbe22('0x17')]=function(_0x3e6b19){try{utils[_0xbe22('0xc')](util[_0xbe22('0x3')](_0xbe22('0x18'),_0x3e6b19['origtransfereruniqueid']),_0x3e6b19);utils[_0xbe22('0x2')](util['format'](_0xbe22('0x19'),_0x3e6b19[_0xbe22('0x7')],_0x3e6b19[_0xbe22('0x1a')],_0x3e6b19[_0xbe22('0x1b')],_0x3e6b19[_0xbe22('0x1c')],_0x3e6b19[_0xbe22('0x1d')]));_0x3e6b19=_[_0xbe22('0x1e')](_0x3e6b19,{'transfererchannel':_0x3e6b19[_0xbe22('0x1f')],'transferercalleridnum':_0x3e6b19[_0xbe22('0x1a')],'transferercalleridname':_0x3e6b19[_0xbe22('0x1b')],'transfererconnectedlinenum':_0x3e6b19[_0xbe22('0x20')],'transfererconnectedlinename':_0x3e6b19[_0xbe22('0x21')],'transfereraccountcode':_0x3e6b19[_0xbe22('0x22')],'transferercontext':_0x3e6b19[_0xbe22('0x23')],'transfererexten':_0x3e6b19[_0xbe22('0x24')],'transfererlinkedid':_0x3e6b19[_0xbe22('0x25')],'context':_0x3e6b19[_0xbe22('0x26')],'extension':_0x3e6b19[_0xbe22('0x27')],'type':_0xbe22('0x6')});if(_[_0xbe22('0x28')](_0x3e6b19['transfereechannel'])){_0x3e6b19=_['assign'](_0x3e6b19,{'transfereechannel':_0x3e6b19['transfertargetchannel'],'transfereecalleridnum':_0x3e6b19[_0xbe22('0x1c')],'transfereecalleridname':_0x3e6b19[_0xbe22('0x1d')],'transfereeconnectedlinenum':_0x3e6b19[_0xbe22('0x29')],'transfereeconnectedlinename':_0x3e6b19[_0xbe22('0x2a')],'transfereeaccountcode':_0x3e6b19['transfertargetaccountcode'],'transfereecontext':_0x3e6b19[_0xbe22('0x2b')],'transfereeexten':_0x3e6b19[_0xbe22('0x2c')],'transfereelinkedid':_0x3e6b19[_0xbe22('0x2d')]});}writeDB(_0x3e6b19);}catch(_0x31b51a){utils[_0xbe22('0x16')](util['format'](_0xbe22('0x18'),_0x3e6b19[_0xbe22('0x7')]),_0x31b51a);}};
\ No newline at end of file
index ea9914b..efa493d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc7c=['[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','format','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0xdc7c,0xf2));var _0xcdc7=function(_0x3b7c3d,_0x4626b0){_0x3b7c3d=_0x3b7c3d-0x0;var _0x3e58b7=_0xdc7c[_0x3b7c3d];return _0x3e58b7;};'use strict';var BPromise=require(_0xcdc7('0x0'));var jayson=require('jayson/promise');var moment=require(_0xcdc7('0x1'));var util=require(_0xcdc7('0x2'));var client=jayson[_0xcdc7('0x3')][_0xcdc7('0x4')]({'port':0x2329});var logger=require(_0xcdc7('0x5'))(_0xcdc7('0x6'));exports['info']=function(_0x99420c,_0x2a5db2){logger[_0xcdc7('0x7')](_0x99420c,_0x2a5db2?util[_0xcdc7('0x8')](_0x2a5db2,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4d5ac5,_0x13a710){logger[_0xcdc7('0x9')](_0x4d5ac5,_0x13a710?util[_0xcdc7('0x8')](_0x13a710,{'showHidden':![],'depth':null}):'');};exports[_0xcdc7('0xa')]=function(_0x1f0d14,_0x13f61b){logger['error'](_0x1f0d14,_0x13f61b?util[_0xcdc7('0x8')](_0x13f61b,{'showHidden':![],'depth':null}):'');};exports[_0xcdc7('0xb')]=function(_0x22fd67,_0x586c25){return client['request'](_0x22fd67,{'body':_0x586c25})[_0xcdc7('0xc')](function(_0x1ef630){logger[_0xcdc7('0x9')](_0xcdc7('0xd'),_0x22fd67,_0x1ef630?util[_0xcdc7('0x8')](_0x1ef630,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x192b29){logger['error'](_0xcdc7('0xd'),_0x22fd67,_0x192b29?util['inspect'](_0x192b29,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1e1110){return client[_0xcdc7('0xb')](_0xcdc7('0xe'),{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0x1e1110,'limit':0x1}})['then'](function(_0x306ed7){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xcdc7('0xf')](_0x1e1110),_0x306ed7?util['inspect'](_0x306ed7,{'showHidden':![],'depth':null}):'');return _0x306ed7['result']['length']?_0x306ed7[_0xcdc7('0x10')][0x0]:null;});}exports[_0xcdc7('0x11')]=function(_0x585e8a){return new BPromise(function(_0x1ef6d1,_0x53996f){if(_0x585e8a){return getUser({'internal':_0x585e8a})[_0xcdc7('0xc')](function(_0x369d71){logger[_0xcdc7('0x7')](_0xcdc7('0x12'),_0x585e8a,_0x369d71?_0xcdc7('0x13'):'notfound');return _0x1ef6d1(_0x369d71);})[_0xcdc7('0x14')](function(_0x297d2f){logger[_0xcdc7('0xa')](_0xcdc7('0x15'),_0x297d2f?util['inspect'](_0x297d2f,{'showHidden':![],'depth':null}):'');return _0x1ef6d1(null);});}return _0x1ef6d1(null);});};exports[_0xcdc7('0x16')]=function(_0x2e3a70){return new BPromise(function(_0x4080e9,_0x53d5b8){if(_0x2e3a70){return getUser({'interface':_0x2e3a70})[_0xcdc7('0xc')](function(_0x4f7b59){logger['info'](_0xcdc7('0x17'),_0x2e3a70,_0x4f7b59?'found':_0xcdc7('0x18'));return _0x4080e9(_0x4f7b59);})[_0xcdc7('0x14')](function(_0x4b2971){logger[_0xcdc7('0xa')](_0xcdc7('0x19'),_0x4b2971?util[_0xcdc7('0x8')](_0x4b2971,{'showHidden':![],'depth':null}):'');return _0x4080e9(null);});}return _0x4080e9(null);});};exports[_0xcdc7('0x1a')]=function(_0x15ba52){return new BPromise(function(_0xac1bb6,_0x35b0fa){if(_0x15ba52){return getUser({'name':_0x15ba52})[_0xcdc7('0xc')](function(_0x563003){logger[_0xcdc7('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x15ba52,_0x563003?_0xcdc7('0x13'):_0xcdc7('0x18'));return _0xac1bb6(_0x563003);})[_0xcdc7('0x14')](function(_0x3ac184){logger[_0xcdc7('0xa')]('[utils][getUserByName]',_0x3ac184?util['inspect'](_0x3ac184,{'showHidden':![],'depth':null}):'');return _0xac1bb6(null);});}return _0xac1bb6(null);});};exports[_0xcdc7('0x1b')]=function(_0x5511b3){return new BPromise(function(_0x1a1f08,_0x48db11){if(_0x5511b3){return client['request'](_0xcdc7('0x1c'),{'options':{'raw':!![],'attributes':['id','name','type',_0xcdc7('0x1d'),_0xcdc7('0x1e')],'where':{'name':_0x5511b3},'limit':0x1}})[_0xcdc7('0xc')](function(_0x559aa7){logger[_0xcdc7('0x9')](_0xcdc7('0x1f'),_0x5511b3,_0x559aa7?util['inspect'](_0x559aa7,{'showHidden':![],'depth':null}):'');logger[_0xcdc7('0x7')](_0xcdc7('0x20'),_0x5511b3,_0x559aa7?_0xcdc7('0x13'):'notfound');return _0x1a1f08(_0x559aa7[_0xcdc7('0x10')][_0xcdc7('0x21')]?_0x559aa7[_0xcdc7('0x10')][0x0]:null);})[_0xcdc7('0x14')](function(_0x1d4f1e){logger['error'](_0xcdc7('0x22'),_0x1d4f1e?util['inspect'](_0x1d4f1e,{'showHidden':![],'depth':null}):'');return _0x1a1f08(null);});}return _0x1a1f08(null);});};exports[_0xcdc7('0x23')]=function(_0x1f36de,_0x2c0190){return moment(_0x1f36de)[_0xcdc7('0x24')](_0x2c0190,'seconds')['format'](_0xcdc7('0x25'));};exports['subtractTime']=function(_0x7a8a90,_0x1938a3){return moment(_0x7a8a90)[_0xcdc7('0x26')](_0x1938a3,_0xcdc7('0x27'))[_0xcdc7('0x28')](_0xcdc7('0x25'));};exports['diffTime']=function(_0x4f50c3,_0xeaf206){return moment(_0x4f50c3)[_0xcdc7('0x29')](moment(_0xeaf206),_0xcdc7('0x27'));};exports[_0xcdc7('0x2a')]=function(_0x35798c,_0x773562){return parseInt(_0x35798c,0xa)+parseInt(_0x773562,0xa);};exports[_0xcdc7('0x2b')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x5364fe,_0x1d7b50){if(_0x1d7b50){return moment(_0x5364fe)[_0xcdc7('0x2c')](_0x1d7b50);}return!![];};exports['isBefore']=function(_0xf994a,_0x42bb45){if(_0x42bb45){return moment(_0xf994a)[_0xcdc7('0x2d')](_0x42bb45);}else if(_0xf994a){return!![];}return![];};
\ No newline at end of file
+var _0x5e6f=['[utils][request]\x20name:%s','name','interface','then','[utils][getUser]\x20where:%s','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','catch','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','seconds','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','info','debug','inspect','error','request'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x5e6f,0x1c5));var _0xf5e6=function(_0xd0a290,_0x55cb33){_0xd0a290=_0xd0a290-0x0;var _0x377b3d=_0x5e6f[_0xd0a290];return _0x377b3d;};'use strict';var BPromise=require(_0xf5e6('0x0'));var jayson=require(_0xf5e6('0x1'));var moment=require(_0xf5e6('0x2'));var util=require('util');var client=jayson[_0xf5e6('0x3')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xf5e6('0x4')]=function(_0x2e75a6,_0x3f6d51){logger[_0xf5e6('0x4')](_0x2e75a6,_0x3f6d51?util['inspect'](_0x3f6d51,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x177201,_0x4382e5){logger[_0xf5e6('0x5')](_0x177201,_0x4382e5?util[_0xf5e6('0x6')](_0x4382e5,{'showHidden':![],'depth':null}):'');};exports[_0xf5e6('0x7')]=function(_0x46fc45,_0x8e5ace){logger[_0xf5e6('0x7')](_0x46fc45,_0x8e5ace?util[_0xf5e6('0x6')](_0x8e5ace,{'showHidden':![],'depth':null}):'');};exports[_0xf5e6('0x8')]=function(_0x3f038f,_0x38d06c){return client['request'](_0x3f038f,{'body':_0x38d06c})['then'](function(_0x5d1872){logger[_0xf5e6('0x5')](_0xf5e6('0x9'),_0x3f038f,_0x5d1872?util['inspect'](_0x5d1872,{'showHidden':![],'depth':null}):'');})['catch'](function(_0xb88079){logger[_0xf5e6('0x7')](_0xf5e6('0x9'),_0x3f038f,_0xb88079?util[_0xf5e6('0x6')](_0xb88079,{'showHidden':![],'depth':null}):'');});};function getUser(_0x49ded1){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xf5e6('0xa'),_0xf5e6('0xb')],'where':_0x49ded1,'limit':0x1}})[_0xf5e6('0xc')](function(_0x41168e){logger[_0xf5e6('0x5')](_0xf5e6('0xd'),JSON['stringify'](_0x49ded1),_0x41168e?util[_0xf5e6('0x6')](_0x41168e,{'showHidden':![],'depth':null}):'');return _0x41168e[_0xf5e6('0xe')][_0xf5e6('0xf')]?_0x41168e[_0xf5e6('0xe')][0x0]:null;});}exports['getUserByInternal']=function(_0x334f33){return new BPromise(function(_0x3286a0,_0x5115c0){if(_0x334f33){return getUser({'internal':_0x334f33})['then'](function(_0x3ada54){logger['info'](_0xf5e6('0x10'),_0x334f33,_0x3ada54?'found':_0xf5e6('0x11'));return _0x3286a0(_0x3ada54);})['catch'](function(_0x6070a4){logger[_0xf5e6('0x7')](_0xf5e6('0x12'),_0x6070a4?util['inspect'](_0x6070a4,{'showHidden':![],'depth':null}):'');return _0x3286a0(null);});}return _0x3286a0(null);});};exports[_0xf5e6('0x13')]=function(_0x454268){return new BPromise(function(_0x1a13b2,_0x20c665){if(_0x454268){return getUser({'interface':_0x454268})[_0xf5e6('0xc')](function(_0x23b99e){logger['info'](_0xf5e6('0x14'),_0x454268,_0x23b99e?_0xf5e6('0x15'):_0xf5e6('0x11'));return _0x1a13b2(_0x23b99e);})[_0xf5e6('0x16')](function(_0x690f69){logger[_0xf5e6('0x7')](_0xf5e6('0x17'),_0x690f69?util[_0xf5e6('0x6')](_0x690f69,{'showHidden':![],'depth':null}):'');return _0x1a13b2(null);});}return _0x1a13b2(null);});};exports['getUserByName']=function(_0x14c683){return new BPromise(function(_0xb10a04,_0x4ebfbc){if(_0x14c683){return getUser({'name':_0x14c683})[_0xf5e6('0xc')](function(_0x315bdb){logger['info'](_0xf5e6('0x18'),_0x14c683,_0x315bdb?'found':_0xf5e6('0x11'));return _0xb10a04(_0x315bdb);})[_0xf5e6('0x16')](function(_0xd4d672){logger[_0xf5e6('0x7')](_0xf5e6('0x19'),_0xd4d672?util[_0xf5e6('0x6')](_0xd4d672,{'showHidden':![],'depth':null}):'');return _0xb10a04(null);});}return _0xb10a04(null);});};exports[_0xf5e6('0x1a')]=function(_0x1733b2){return new BPromise(function(_0x510112,_0x318f95){if(_0x1733b2){return client[_0xf5e6('0x8')](_0xf5e6('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xf5e6('0xa'),'type',_0xf5e6('0x1c'),'acwTimeout'],'where':{'name':_0x1733b2},'limit':0x1}})[_0xf5e6('0xc')](function(_0x3d5730){logger[_0xf5e6('0x5')](_0xf5e6('0x1d'),_0x1733b2,_0x3d5730?util[_0xf5e6('0x6')](_0x3d5730,{'showHidden':![],'depth':null}):'');logger[_0xf5e6('0x4')](_0xf5e6('0x1e'),_0x1733b2,_0x3d5730?'found':_0xf5e6('0x11'));return _0x510112(_0x3d5730['result'][_0xf5e6('0xf')]?_0x3d5730['result'][0x0]:null);})[_0xf5e6('0x16')](function(_0xed535){logger['error']('[utils][getVoiceQueueByName]',_0xed535?util[_0xf5e6('0x6')](_0xed535,{'showHidden':![],'depth':null}):'');return _0x510112(null);});}return _0x510112(null);});};exports[_0xf5e6('0x1f')]=function(_0x444c23,_0xf1284e){return moment(_0x444c23)[_0xf5e6('0x20')](_0xf1284e,'seconds')[_0xf5e6('0x21')](_0xf5e6('0x22'));};exports['subtractTime']=function(_0x3ed21a,_0x74ae93){return moment(_0x3ed21a)[_0xf5e6('0x23')](_0x74ae93,'seconds')[_0xf5e6('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x588ee1,_0x17331c){return moment(_0x588ee1)[_0xf5e6('0x24')](moment(_0x17331c),_0xf5e6('0x25'));};exports[_0xf5e6('0x26')]=function(_0x47afed,_0x4905c1){return parseInt(_0x47afed,0xa)+parseInt(_0x4905c1,0xa);};exports[_0xf5e6('0x27')]=function(){return moment()[_0xf5e6('0x21')](_0xf5e6('0x22'));};exports[_0xf5e6('0x28')]=function(_0x2c1490,_0x4e3827){if(_0x4e3827){return moment(_0x2c1490)[_0xf5e6('0x28')](_0x4e3827);}return!![];};exports[_0xf5e6('0x29')]=function(_0x4baecc,_0x3624be){if(_0x3624be){return moment(_0x4baecc)[_0xf5e6('0x29')](_0x3624be);}else if(_0x4baecc){return!![];}return![];};
\ No newline at end of file